From python-checkins at python.org Thu Jan 1 00:30:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 00:30:10 +0100 (CET) Subject: [Python-checkins] r68111 - sandbox/trunk/release/release.py Message-ID: <20081231233010.C25541E403F@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 00:30:10 2009 New Revision: 68111 Log: add some basic (and untested) support for uploading a release to dinsdale Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Thu Jan 1 00:30:10 2009 @@ -65,6 +65,8 @@ p.add_option('-e', '--export', default=False, action='store_true', help='Export the SVN tag to a tarball and build docs') + p.add_option('-u', '--upload', metavar="username", + help='Upload the tarballs and docs to dinsdale') p.add_option('-m', '--branch', default=False, action='store_true', help='create a maintance branch to go along with the release') @@ -215,8 +217,9 @@ def tarball(source): """Build tarballs for a directory.""" print 'Making .tgz' - tgz = source + '.tgz' - bz = source + '.tar.bz2' + base = os.path.basename(source) + tgz = base + '.tgz' + bz = base + '.tar.bz2' run_cmd(['tar cf - %s | gzip -9 > %s' % (source, tgz)]) print "Making .tar.bz2" run_cmd(['tar cf - %s | bzip2 -9 > %s' % @@ -278,8 +281,10 @@ if filename.endswith('.pyc'): os.remove(os.path.join(dirpath, filename)) - tarball(archivename) - print '\n**Now extract the archives and run the tests**' + os.mkdir('src') + with changed_dir('src'): + tarball(os.path.join("..", archivename)) + print '\n**Now extract the archives in dist/src and run the tests**' print '**You may also want to run make install and re-test**' @@ -290,6 +295,19 @@ run_cmd(['make', 'dist']) return os.path.abspath('dist') +def upload(tag, username): + """scp everything to dinsdale""" + address ='"%s at dinsdale.python.org:' % username + def scp(from_loc, to_loc): + run_cmd(['scp %s %s' % (from_loc, to_loc)]) + with changed_dir('dist'): + print "Uploading source tarballs" + scp('src', '/data/python-releases/%s' % tag.nickname) + print "Upload doc tarballs" + scp('docs', '/data/python-releases/doc/%s' % tag.nickname) + print "* Now change the permissions on the tarballs so they are " \ + "writable by the webmaster group. *" + class Tag(object): @@ -396,7 +414,7 @@ parser.print_usage() sys.exit(1) tag = Tag(args[1]) - if not options.export: + if not (options.export or options.upload): check_env() if options.bump: bump(tag) @@ -406,6 +424,8 @@ branch(tag) if options.export: export(tag) + if options.upload: + upload(tag, options.upload) if options.done: done(tag) From python-checkins at python.org Thu Jan 1 00:48:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 00:48:39 +0100 (CET) Subject: [Python-checkins] r68112 - in python/trunk: Lib/inspect.py Misc/NEWS Message-ID: <20081231234839.8E2111E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 00:48:39 2009 New Revision: 68112 Log: #4795 inspect.isgeneratorfunction() should return False instead of None Modified: python/trunk/Lib/inspect.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/inspect.py ============================================================================== --- python/trunk/Lib/inspect.py (original) +++ python/trunk/Lib/inspect.py Thu Jan 1 00:48:39 2009 @@ -161,6 +161,7 @@ if (isfunction(object) or ismethod(object)) and \ object.func_code.co_flags & CO_GENERATOR: return True + return False def isgenerator(object): """Return true if the object is a generator. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 1 00:48:39 2009 @@ -100,6 +100,9 @@ Library ------- +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey. From buildbot at python.org Thu Jan 1 01:13:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 00:13:30 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090101001331.057441E4002@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/4390 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_sqlite ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/sqlite3/test/types.py", line 355, in CheckSqlTimestamp self.failUnlessEqual(ts.year, now.year) AssertionError: 2009 != 2008 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 1 01:16:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 00:16:39 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090101001639.CA9381E4002@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/1706 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_sqlite ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/sqlite3/test/types.py", line 355, in CheckSqlTimestamp self.failUnlessEqual(ts.year, now.year) AssertionError: 2009 != 2008 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 1 01:23:31 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 01:23:31 +0100 (CET) Subject: [Python-checkins] r68113 - in python/branches/py3k: Doc/c-api/arg.rst Doc/c-api/exceptions.rst Doc/howto/unicode.rst Doc/library/multiprocessing.rst Doc/library/pydoc.rst Doc/library/winsound.rst setup.py Message-ID: <20090101002331.5F1221E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 01:23:30 2009 New Revision: 68113 Log: Merged revisions 67952,67957-67958,67960-67961,67963,67973,67978,67995,68030,68057,68061 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67952 | georg.brandl | 2008-12-27 11:42:40 -0600 (Sat, 27 Dec 2008) | 2 lines #4752: actually use custom handler in example. ........ r67957 | georg.brandl | 2008-12-27 12:49:19 -0600 (Sat, 27 Dec 2008) | 2 lines #4754: improve winsound documentation. ........ r67958 | georg.brandl | 2008-12-27 13:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines #4682: 'b' is actually unsigned char. ........ r67960 | georg.brandl | 2008-12-27 13:04:44 -0600 (Sat, 27 Dec 2008) | 2 lines #4695: fix backslashery. ........ r67961 | georg.brandl | 2008-12-27 13:06:04 -0600 (Sat, 27 Dec 2008) | 2 lines Use :samp: role. ........ r67963 | georg.brandl | 2008-12-27 13:11:15 -0600 (Sat, 27 Dec 2008) | 2 lines #4671: document that pydoc imports modules. ........ r67973 | alexandre.vassalotti | 2008-12-27 20:58:22 -0600 (Sat, 27 Dec 2008) | 2 lines Document Py_VaBuildValue. ........ r67978 | georg.brandl | 2008-12-28 05:58:49 -0600 (Sun, 28 Dec 2008) | 2 lines #4731: clarify message about missing module prerequisites. ........ r67995 | benjamin.peterson | 2008-12-28 15:16:07 -0600 (Sun, 28 Dec 2008) | 1 line #4763 PyErr_ExceptionMatches won't blow up with NULL arguments ........ r68030 | benjamin.peterson | 2008-12-29 15:38:14 -0600 (Mon, 29 Dec 2008) | 1 line fix French ........ r68057 | vinay.sajip | 2008-12-30 01:01:25 -0600 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ........ r68061 | georg.brandl | 2008-12-30 04:15:49 -0600 (Tue, 30 Dec 2008) | 2 lines #4778: attributes can't be called. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/arg.rst python/branches/py3k/Doc/c-api/exceptions.rst python/branches/py3k/Doc/howto/unicode.rst python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Doc/library/pydoc.rst python/branches/py3k/Doc/library/winsound.rst python/branches/py3k/setup.py Modified: python/branches/py3k/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k/Doc/c-api/arg.rst (original) +++ python/branches/py3k/Doc/c-api/arg.rst Thu Jan 1 01:23:30 2009 @@ -164,8 +164,9 @@ them. Instead, the implementation assumes that the string object uses the encoding passed in as parameter. -``b`` (integer) [char] - Convert a Python integer to a tiny int, stored in a C :ctype:`char`. +``b`` (integer) [unsigned char] + Convert a nonnegative Python integer to an unsigned tiny int, stored in a C + :ctype:`unsigned char`. ``B`` (integer) [unsigned char] Convert a Python integer to a tiny int without overflow checking, stored in a C @@ -552,3 +553,8 @@ If there is an error in the format string, the :exc:`SystemError` exception is set and *NULL* returned. + +.. cfunction:: PyObject* Py_VaBuildValue(const char *format, va_list vargs) + + Identical to :cfunc:`Py_BuildValue`, except that it accepts a va_list + rather than a variable number of arguments. 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 Jan 1 01:23:30 2009 @@ -67,11 +67,10 @@ .. cfunction:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc) - Return true if the *given* exception matches the exception in *exc*. If *exc* - is a class object, this also returns true when *given* is an instance of a - subclass. If *exc* is a tuple, all exceptions in the tuple (and recursively in - subtuples) are searched for a match. If *given* is *NULL*, a memory access - violation will occur. + Return true if the *given* exception matches the exception in *exc*. If + *exc* is a class object, this also returns true when *given* is an instance + of a subclass. If *exc* is a tuple, all exceptions in the tuple (and + recursively in subtuples) are searched for a match. .. cfunction:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb) Modified: python/branches/py3k/Doc/howto/unicode.rst ============================================================================== --- python/branches/py3k/Doc/howto/unicode.rst (original) +++ python/branches/py3k/Doc/howto/unicode.rst Thu Jan 1 01:23:30 2009 @@ -32,7 +32,7 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHER EST COMPLETE." + PRINT "FICHIER EST COMPLETE." PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Thu Jan 1 01:23:30 2009 @@ -356,7 +356,7 @@ .. attribute:: daemon - The process's daemon flag, a Boolean value. This must be called before + The process's daemon flag, a Boolean value. This must be set before :meth:`start` is called. The initial value is inherited from the creating process. @@ -1808,9 +1808,9 @@ filesystem. * An ``'AF_PIPE'`` address is a string of the form - ``r'\\\\.\\pipe\\PipeName'``. To use :func:`Client` to connect to a named + :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called ServerName* one should use an address of the - form ``r'\\\\ServerName\\pipe\\PipeName'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. Modified: python/branches/py3k/Doc/library/pydoc.rst ============================================================================== --- python/branches/py3k/Doc/library/pydoc.rst (original) +++ python/branches/py3k/Doc/library/pydoc.rst Thu Jan 1 01:23:30 2009 @@ -34,6 +34,13 @@ Unix), and refers to an existing Python source file, then documentation is produced for that file. +.. note:: + + In order to find objects and their documentation, :mod:`pydoc` imports the + module(s) to be documented. Therefore, any code on module level will be + executed on that occasion. Use an ``if __name__ == '__main__':`` guard to + only execute code when a file is invoked as a script and not just imported. + Specifying a :option:`-w` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text on the console. Modified: python/branches/py3k/Doc/library/winsound.rst ============================================================================== --- python/branches/py3k/Doc/library/winsound.rst (original) +++ python/branches/py3k/Doc/library/winsound.rst Thu Jan 1 01:23:30 2009 @@ -26,8 +26,9 @@ Call the underlying :cfunc:`PlaySound` function from the Platform API. The *sound* parameter may be a filename, audio data as a string, or ``None``. Its interpretation depends on the value of *flags*, which can be a bitwise ORed - combination of the constants described below. If the system indicates an error, - :exc:`RuntimeError` is raised. + combination of the constants described below. If the *sound* parameter is + ``None``, any currently playing waveform sound is stopped. If the system + indicates an error, :exc:`RuntimeError` is raised. .. function:: MessageBeep([type=MB_OK]) @@ -102,6 +103,10 @@ Stop playing all instances of the specified sound. + .. note:: + + This flag is not supported on modern Windows platforms. + .. data:: SND_ASYNC Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Thu Jan 1 01:23:30 2009 @@ -208,7 +208,8 @@ if missing: print() - print("Failed to find the necessary bits to build these modules:") + print("Python build finished, but the necessary bits to build " + "these modules were not found:") print_three_column(missing) print("To find the necessary bits, look in setup.py in" " detect_modules() for the module's name.") From python-checkins at python.org Thu Jan 1 01:28:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 01:28:11 +0100 (CET) Subject: [Python-checkins] r68114 - in python/branches/release30-maint: Doc/c-api/arg.rst Doc/c-api/exceptions.rst Doc/howto/unicode.rst Doc/library/multiprocessing.rst Doc/library/pydoc.rst Doc/library/winsound.rst setup.py Message-ID: <20090101002811.EDAF51E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 01:28:11 2009 New Revision: 68114 Log: Merged revisions 68113 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68113 | benjamin.peterson | 2008-12-31 18:23:30 -0600 (Wed, 31 Dec 2008) | 53 lines Merged revisions 67952,67957-67958,67960-67961,67963,67973,67978,67995,68030,68057,68061 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67952 | georg.brandl | 2008-12-27 11:42:40 -0600 (Sat, 27 Dec 2008) | 2 lines #4752: actually use custom handler in example. ........ r67957 | georg.brandl | 2008-12-27 12:49:19 -0600 (Sat, 27 Dec 2008) | 2 lines #4754: improve winsound documentation. ........ r67958 | georg.brandl | 2008-12-27 13:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines #4682: 'b' is actually unsigned char. ........ r67960 | georg.brandl | 2008-12-27 13:04:44 -0600 (Sat, 27 Dec 2008) | 2 lines #4695: fix backslashery. ........ r67961 | georg.brandl | 2008-12-27 13:06:04 -0600 (Sat, 27 Dec 2008) | 2 lines Use :samp: role. ........ r67963 | georg.brandl | 2008-12-27 13:11:15 -0600 (Sat, 27 Dec 2008) | 2 lines #4671: document that pydoc imports modules. ........ r67973 | alexandre.vassalotti | 2008-12-27 20:58:22 -0600 (Sat, 27 Dec 2008) | 2 lines Document Py_VaBuildValue. ........ r67978 | georg.brandl | 2008-12-28 05:58:49 -0600 (Sun, 28 Dec 2008) | 2 lines #4731: clarify message about missing module prerequisites. ........ r67995 | benjamin.peterson | 2008-12-28 15:16:07 -0600 (Sun, 28 Dec 2008) | 1 line #4763 PyErr_ExceptionMatches won't blow up with NULL arguments ........ r68030 | benjamin.peterson | 2008-12-29 15:38:14 -0600 (Mon, 29 Dec 2008) | 1 line fix French ........ r68057 | vinay.sajip | 2008-12-30 01:01:25 -0600 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ........ r68061 | georg.brandl | 2008-12-30 04:15:49 -0600 (Tue, 30 Dec 2008) | 2 lines #4778: attributes can't be called. ........ ................ Modified: python/branches/release30-maint/Doc/c-api/arg.rst python/branches/release30-maint/Doc/c-api/exceptions.rst python/branches/release30-maint/Doc/howto/unicode.rst python/branches/release30-maint/Doc/library/multiprocessing.rst python/branches/release30-maint/Doc/library/pydoc.rst python/branches/release30-maint/Doc/library/winsound.rst python/branches/release30-maint/setup.py Modified: python/branches/release30-maint/Doc/c-api/arg.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/arg.rst (original) +++ python/branches/release30-maint/Doc/c-api/arg.rst Thu Jan 1 01:28:11 2009 @@ -164,8 +164,9 @@ them. Instead, the implementation assumes that the string object uses the encoding passed in as parameter. -``b`` (integer) [char] - Convert a Python integer to a tiny int, stored in a C :ctype:`char`. +``b`` (integer) [unsigned char] + Convert a nonnegative Python integer to an unsigned tiny int, stored in a C + :ctype:`unsigned char`. ``B`` (integer) [unsigned char] Convert a Python integer to a tiny int without overflow checking, stored in a C @@ -552,3 +553,8 @@ If there is an error in the format string, the :exc:`SystemError` exception is set and *NULL* returned. + +.. cfunction:: PyObject* Py_VaBuildValue(const char *format, va_list vargs) + + Identical to :cfunc:`Py_BuildValue`, except that it accepts a va_list + rather than a variable number of arguments. 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 Thu Jan 1 01:28:11 2009 @@ -67,11 +67,10 @@ .. cfunction:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc) - Return true if the *given* exception matches the exception in *exc*. If *exc* - is a class object, this also returns true when *given* is an instance of a - subclass. If *exc* is a tuple, all exceptions in the tuple (and recursively in - subtuples) are searched for a match. If *given* is *NULL*, a memory access - violation will occur. + Return true if the *given* exception matches the exception in *exc*. If + *exc* is a class object, this also returns true when *given* is an instance + of a subclass. If *exc* is a tuple, all exceptions in the tuple (and + recursively in subtuples) are searched for a match. .. cfunction:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb) Modified: python/branches/release30-maint/Doc/howto/unicode.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/unicode.rst (original) +++ python/branches/release30-maint/Doc/howto/unicode.rst Thu Jan 1 01:28:11 2009 @@ -32,7 +32,7 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHER EST COMPLETE." + PRINT "FICHIER EST COMPLETE." PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who Modified: python/branches/release30-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release30-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release30-maint/Doc/library/multiprocessing.rst Thu Jan 1 01:28:11 2009 @@ -356,7 +356,7 @@ .. attribute:: daemon - The process's daemon flag, a Boolean value. This must be called before + The process's daemon flag, a Boolean value. This must be set before :meth:`start` is called. The initial value is inherited from the creating process. @@ -1808,9 +1808,9 @@ filesystem. * An ``'AF_PIPE'`` address is a string of the form - ``r'\\\\.\\pipe\\PipeName'``. To use :func:`Client` to connect to a named + :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called ServerName* one should use an address of the - form ``r'\\\\ServerName\\pipe\\PipeName'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. Modified: python/branches/release30-maint/Doc/library/pydoc.rst ============================================================================== --- python/branches/release30-maint/Doc/library/pydoc.rst (original) +++ python/branches/release30-maint/Doc/library/pydoc.rst Thu Jan 1 01:28:11 2009 @@ -34,6 +34,13 @@ Unix), and refers to an existing Python source file, then documentation is produced for that file. +.. note:: + + In order to find objects and their documentation, :mod:`pydoc` imports the + module(s) to be documented. Therefore, any code on module level will be + executed on that occasion. Use an ``if __name__ == '__main__':`` guard to + only execute code when a file is invoked as a script and not just imported. + Specifying a :option:`-w` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text on the console. Modified: python/branches/release30-maint/Doc/library/winsound.rst ============================================================================== --- python/branches/release30-maint/Doc/library/winsound.rst (original) +++ python/branches/release30-maint/Doc/library/winsound.rst Thu Jan 1 01:28:11 2009 @@ -26,8 +26,9 @@ Call the underlying :cfunc:`PlaySound` function from the Platform API. The *sound* parameter may be a filename, audio data as a string, or ``None``. Its interpretation depends on the value of *flags*, which can be a bitwise ORed - combination of the constants described below. If the system indicates an error, - :exc:`RuntimeError` is raised. + combination of the constants described below. If the *sound* parameter is + ``None``, any currently playing waveform sound is stopped. If the system + indicates an error, :exc:`RuntimeError` is raised. .. function:: MessageBeep([type=MB_OK]) @@ -102,6 +103,10 @@ Stop playing all instances of the specified sound. + .. note:: + + This flag is not supported on modern Windows platforms. + .. data:: SND_ASYNC Modified: python/branches/release30-maint/setup.py ============================================================================== --- python/branches/release30-maint/setup.py (original) +++ python/branches/release30-maint/setup.py Thu Jan 1 01:28:11 2009 @@ -208,7 +208,8 @@ if missing: print() - print("Failed to find the necessary bits to build these modules:") + print("Python build finished, but the necessary bits to build " + "these modules were not found:") print_three_column(missing) print("To find the necessary bits, look in setup.py in" " detect_modules() for the module's name.") From buildbot at python.org Thu Jan 1 01:48:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 00:48:03 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090101004803.771971E4002@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/44 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_sqlite ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/sqlite3/test/types.py", line 367, in CheckSqlTimestamp AssertionError: 2009 != 2008 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 1 02:07:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 01:07:45 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090101010746.010C21E4002@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/18 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: 1 test failed: test_sqlite ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/sqlite3/test/types.py", line 367, in CheckSqlTimestamp AssertionError: 2009 != 2008 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 1 04:32:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 03:32:37 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090101033239.384981E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/27 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_sqlite ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\sqlite3\test\types.py", line 367, in CheckSqlTimestamp self.failUnlessEqual(ts.year, now.year) AssertionError: 2009 != 2008 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 1 05:04:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 05:04:42 +0100 (CET) Subject: [Python-checkins] r68115 - python/trunk/Lib/inspect.py Message-ID: <20090101040442.46C701E402F@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 05:04:41 2009 New Revision: 68115 Log: simplfy code Modified: python/trunk/Lib/inspect.py Modified: python/trunk/Lib/inspect.py ============================================================================== --- python/trunk/Lib/inspect.py (original) +++ python/trunk/Lib/inspect.py Thu Jan 1 05:04:41 2009 @@ -158,10 +158,8 @@ Generator function objects provides same attributes as functions. See isfunction.__doc__ for attributes listing.""" - if (isfunction(object) or ismethod(object)) and \ - object.func_code.co_flags & CO_GENERATOR: - return True - return False + return bool((isfunction(object) or ismethod(object)) and + object.func_code.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. From buildbot at python.org Thu Jan 1 05:11:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 04:11:30 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090101041130.A86F91E4021@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/14 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: 1 test failed: test_sqlite ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\sqlite3\test\types.py", line 367, in CheckSqlTimestamp self.failUnlessEqual(ts.year, now.year) AssertionError: 2009 != 2008 sincerely, -The Buildbot From nnorwitz at gmail.com Thu Jan 1 11:38:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 1 Jan 2009 05:38:09 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090101103809.GA20608@python.psfb.org> svn update tools/sphinx At revision 68115. svn update tools/docutils At revision 68115. svn update tools/jinja At revision 68115. svn update tools/pygments At revision 68115. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html Exception occurred: File "/home/neal/python/trunk/Doc/tools/sphinx/jinja/loaders.py", line 20, in from jinja.utils import CacheDict, raise_syntax_error ImportError: cannot import name raise_syntax_error The full traceback has been saved in /tmp/sphinx-err-vVsS1J.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-dev at googlegroups.com. Thanks! make: *** [build] Error 1 From python-checkins at python.org Thu Jan 1 12:46:51 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 12:46:51 +0100 (CET) Subject: [Python-checkins] r68116 - python/trunk/Doc/library/xml.etree.elementtree.rst Message-ID: <20090101114651.9A5A41E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 12:46:51 2009 New Revision: 68116 Log: #4100: note that element children are not necessarily present on "start" events. 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 Thu Jan 1 12:46:51 2009 @@ -94,6 +94,16 @@ *events* is a list of events to report back. If omitted, only "end" events are reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs. + .. note:: + + :func:`iterparse` only guarantees that it has seen the ">" + character of a starting tag when it emits a "start" event, so the + attributes are defined, but the contents of the text and tail attributes + are undefined at that point. The same applies to the element children; + they may or may not be present. + + If you need a fully populated element, look for "end" events instead. + .. function:: parse(source[, parser]) From python-checkins at python.org Thu Jan 1 12:53:56 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 12:53:56 +0100 (CET) Subject: [Python-checkins] r68117 - python/trunk/Doc/library/urllib2.rst Message-ID: <20090101115356.215EF1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 12:53:55 2009 New Revision: 68117 Log: #4156: make clear that "protocol" is to be replaced with the protocol name. 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 Thu Jan 1 12:53:55 2009 @@ -391,23 +391,23 @@ .. method:: OpenerDirector.add_handler(handler) - *handler* should be an instance of :class:`BaseHandler`. The following methods - are searched, and added to the possible chains (note that HTTP errors are a - special case). + *handler* should be an instance of :class:`BaseHandler`. The following + methods are searched, and added to the possible chains (note that HTTP errors + are a special case). - * :meth:`protocol_open` --- signal that the handler knows how to open *protocol* - URLs. + * :samp:`{protocol}_open` --- signal that the handler knows how to open + *protocol* URLs. - * :meth:`http_error_type` --- signal that the handler knows how to handle HTTP - errors with HTTP error code *type*. + * :samp:`http_error_{type}` --- signal that the handler knows how to handle + HTTP errors with HTTP error code *type*. - * :meth:`protocol_error` --- signal that the handler knows how to handle errors - from (non-\ ``http``) *protocol*. + * :samp:`{protocol}_error` --- signal that the handler knows how to handle + errors from (non-\ ``http``) *protocol*. - * :meth:`protocol_request` --- signal that the handler knows how to pre-process - *protocol* requests. + * :samp:`{protocol}_request` --- signal that the handler knows how to + pre-process *protocol* requests. - * :meth:`protocol_response` --- signal that the handler knows how to + * :samp:`{protocol}_response` --- signal that the handler knows how to post-process *protocol* responses. @@ -441,24 +441,24 @@ The order in which these methods are called within each stage is determined by sorting the handler instances. -#. Every handler with a method named like :meth:`protocol_request` has that +#. Every handler with a method named like :samp:`{protocol}_request` has that method called to pre-process the request. -#. Handlers with a method named like :meth:`protocol_open` are called to handle +#. Handlers with a method named like :samp:`{protocol}_open` are called to handle the request. This stage ends when a handler either returns a non-\ :const:`None` value (ie. a response), or raises an exception (usually :exc:`URLError`). Exceptions are allowed to propagate. In fact, the above algorithm is first tried for methods named - :meth:`default_open`. If all such methods return :const:`None`, the algorithm - is repeated for methods named like :meth:`protocol_open`. If all such methods - return :const:`None`, the algorithm is repeated for methods named - :meth:`unknown_open`. + :meth:`default_open`. If all such methods return :const:`None`, the + algorithm is repeated for methods named like :samp:`{protocol}_open`. If all + such methods return :const:`None`, the algorithm is repeated for methods + named :meth:`unknown_open`. Note that the implementation of these methods may involve calls of the parent :class:`OpenerDirector` instance's :meth:`.open` and :meth:`.error` methods. -#. Every handler with a method named like :meth:`protocol_response` has that +#. Every handler with a method named like :samp:`{protocol}_response` has that method called to post-process the response. @@ -514,8 +514,10 @@ .. method:: BaseHandler.protocol_open(req) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to handle URLs with the given protocol. + define it if they want to handle URLs with the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. Return values should be the same as for :meth:`default_open`. @@ -563,8 +565,10 @@ .. method:: BaseHandler.protocol_request(req) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to pre-process requests of the given protocol. + define it if they want to pre-process requests of the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a @@ -574,8 +578,10 @@ .. method:: BaseHandler.protocol_response(req, response) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to post-process responses of the given protocol. + define it if they want to post-process responses of the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. *response* will be an object @@ -660,7 +666,9 @@ .. method:: ProxyHandler.protocol_open(request) :noindex: - The :class:`ProxyHandler` will have a method :meth:`protocol_open` for every + ("protocol" is to be replaced by the protocol name.) + + The :class:`ProxyHandler` will have a method :samp:`{protocol}_open` for every *protocol* which has a proxy in the *proxies* dictionary given in the constructor. The method will modify requests to go through the proxy, by calling ``request.set_proxy()``, and call the next handler in the chain to @@ -865,9 +873,10 @@ For 200 error codes, the response object is returned immediately. For non-200 error codes, this simply passes the job on to the - :meth:`protocol_error_code` handler methods, via :meth:`OpenerDirector.error`. - Eventually, :class:`urllib2.HTTPDefaultErrorHandler` will raise an - :exc:`HTTPError` if no other handler handles the error. + :samp:`{protocol}_error_code` handler methods, via + :meth:`OpenerDirector.error`. Eventually, + :class:`urllib2.HTTPDefaultErrorHandler` will raise an :exc:`HTTPError` if no + other handler handles the error. .. _urllib2-examples: From python-checkins at python.org Thu Jan 1 13:00:20 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:00:20 +0100 (CET) Subject: [Python-checkins] r68118 - python/trunk/Lib/re.py Message-ID: <20090101120021.000BC1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:00:19 2009 New Revision: 68118 Log: #4185: clarify escape behavior of replacement strings. Modified: python/trunk/Lib/re.py Modified: python/trunk/Lib/re.py ============================================================================== --- python/trunk/Lib/re.py (original) +++ python/trunk/Lib/re.py Thu Jan 1 13:00:19 2009 @@ -145,7 +145,8 @@ """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; - if a callable, it's passed the match object and must return + if a string, backslash escapes in it are processed. If it is + a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).sub(repl, string, count) @@ -155,7 +156,8 @@ non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a string or a - callable; if a callable, it's passed the match object and must + callable; if a string, backslash escapes in it are processed. + If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).subn(repl, string, count) From python-checkins at python.org Thu Jan 1 13:09:40 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:09:40 +0100 (CET) Subject: [Python-checkins] r68119 - in python/trunk: Doc/library/dis.rst Lib/dis.py Message-ID: <20090101120940.EF1731E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:09:40 2009 New Revision: 68119 Log: #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. Modified: python/trunk/Doc/library/dis.rst python/trunk/Lib/dis.py Modified: python/trunk/Doc/library/dis.rst ============================================================================== --- python/trunk/Doc/library/dis.rst (original) +++ python/trunk/Doc/library/dis.rst Thu Jan 1 13:09:40 2009 @@ -64,10 +64,23 @@ .. function:: disco(code[, lasti]) - A synonym for disassemble. It is more convenient to type, and kept for - compatibility with earlier Python releases. + A synonym for :func:`disassemble`. It is more convenient to type, and kept + for compatibility with earlier Python releases. +.. function:: findlinestarts(code) + + This generator function uses the ``co_firstlineno`` and ``co_lnotab`` + attributes of the code object *code* to find the offsets which are starts of + lines in the source code. They are generated as ``(offset, lineno)`` pairs. + + +.. function:: findlabels(code) + + Detect all offsets in the code object *code* which are jump targets, and + return a list of these offsets. + + .. data:: opname Sequence of operation names, indexable using the bytecode. Modified: python/trunk/Lib/dis.py ============================================================================== --- python/trunk/Lib/dis.py (original) +++ python/trunk/Lib/dis.py Thu Jan 1 13:09:40 2009 @@ -6,7 +6,8 @@ from opcode import * from opcode import __all__ as _opcodes_all -__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all +__all__ = ["dis", "disassemble", "distb", "disco", + "findlinestarts", "findlabels"] + _opcodes_all del _opcodes_all def dis(x=None): From python-checkins at python.org Thu Jan 1 13:15:31 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:15:31 +0100 (CET) Subject: [Python-checkins] r68120 - in python/trunk: Lib/test/test_struct.py Misc/NEWS Modules/_struct.c Message-ID: <20090101121531.DF8911E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:15:31 2009 New Revision: 68120 Log: #4228: Pack negative values the same way as 2.4 in struct's L format. Modified: python/trunk/Lib/test/test_struct.py python/trunk/Misc/NEWS python/trunk/Modules/_struct.c Modified: python/trunk/Lib/test/test_struct.py ============================================================================== --- python/trunk/Lib/test/test_struct.py (original) +++ python/trunk/Lib/test/test_struct.py Thu Jan 1 13:15:31 2009 @@ -2,6 +2,8 @@ import unittest import struct import warnings +warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated", + DeprecationWarning) from functools import wraps from test.test_support import TestFailed, verbose, run_unittest @@ -461,6 +463,11 @@ self.check_float_coerce(endian + fmt, 1.0) self.check_float_coerce(endian + fmt, 1.5) + def test_issue4228(self): + # Packing a long may yield either 32 or 64 bits + x = struct.pack('L', -1)[:4] + self.assertEqual(x, '\xff'*4) + def test_unpack_from(self): test_string = 'abcd01234' fmt = '4s' Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 1 13:15:31 2009 @@ -258,6 +258,8 @@ Extension Modules ----------------- +- Issue #4228: Pack negative values the same way as 2.4 in struct's L format. + - Issue #1040026: Fix os.times result on systems where HZ is incorrect. - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, Modified: python/trunk/Modules/_struct.c ============================================================================== --- python/trunk/Modules/_struct.c (original) +++ python/trunk/Modules/_struct.c Thu Jan 1 13:15:31 2009 @@ -663,7 +663,7 @@ return -1; #if (SIZEOF_LONG > SIZEOF_INT) if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX))) - return _range_error(f, 0); + RANGE_ERROR(x, f, 0, -1); #endif y = (int)x; memcpy(p, (char *)&y, sizeof y); @@ -675,12 +675,12 @@ { unsigned long x; unsigned int y; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; y = (unsigned int)x; #if (SIZEOF_LONG > SIZEOF_INT) if (x > ((unsigned long)UINT_MAX)) - return _range_error(f, 1); + RANGE_ERROR(y, f, 1, -1); #endif memcpy(p, (char *)&y, sizeof y); return 0; @@ -700,8 +700,8 @@ np_ulong(char *p, PyObject *v, const formatdef *f) { unsigned long x; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; memcpy(p, (char *)&x, sizeof x); return 0; } From python-checkins at python.org Thu Jan 1 13:43:33 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:43:33 +0100 (CET) Subject: [Python-checkins] r68121 - python/trunk/Doc/library/new.rst Message-ID: <20090101124333.5F49D1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:43:33 2009 New Revision: 68121 Log: Point to types module in new module deprecation notice. Modified: python/trunk/Doc/library/new.rst Modified: python/trunk/Doc/library/new.rst ============================================================================== --- python/trunk/Doc/library/new.rst (original) +++ python/trunk/Doc/library/new.rst Thu Jan 1 13:43:33 2009 @@ -1,4 +1,3 @@ - :mod:`new` --- Creation of runtime internal objects =================================================== @@ -7,7 +6,8 @@ :deprecated: .. deprecated:: 2.6 - The :mod:`new` module has been removed in Python 3.0. + The :mod:`new` module has been removed in Python 3.0. Use the :mod:`types` + module's classes instead. .. sectionauthor:: Moshe Zadka From python-checkins at python.org Thu Jan 1 13:49:14 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:49:14 +0100 (CET) Subject: [Python-checkins] r68122 - peps/trunk/pep-0004.txt Message-ID: <20090101124914.EB4181E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:49:14 2009 New Revision: 68122 Log: Update PEP 4 to point to PEP 3108 for all modules deprecated in 2.6 because of removal in 3.0. Modified: peps/trunk/pep-0004.txt Modified: peps/trunk/pep-0004.txt ============================================================================== --- peps/trunk/pep-0004.txt (original) +++ peps/trunk/pep-0004.txt Thu Jan 1 13:49:14 2009 @@ -250,6 +250,13 @@ Documentation: None +Deprecation of modules removed in Python 3.0 + + PEP 3108 lists all modules that have been removed from Python 3.0. + They all are documented as deprecated in Python 2.6, and raise a + DeprecationWarning if the -3 flag is activated. + + Undeprecated modules None. From python-checkins at python.org Thu Jan 1 13:52:29 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:52:29 +0100 (CET) Subject: [Python-checkins] r68123 - python/trunk/Doc/library/webbrowser.rst Message-ID: <20090101125229.7E9FE1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:52:29 2009 New Revision: 68123 Log: #4784: ... on three counts ... Modified: python/trunk/Doc/library/webbrowser.rst Modified: python/trunk/Doc/library/webbrowser.rst ============================================================================== --- python/trunk/Doc/library/webbrowser.rst (original) +++ python/trunk/Doc/library/webbrowser.rst Thu Jan 1 13:52:29 2009 @@ -172,7 +172,7 @@ Browser Controller Objects -------------------------- -Browser controllers provide two methods which parallel two of the module-level +Browser controllers provide these methods which parallel two of the module-level convenience functions: From python-checkins at python.org Thu Jan 1 13:53:20 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 13:53:20 +0100 (CET) Subject: [Python-checkins] r68124 - python/trunk/Doc/library/json.rst Message-ID: <20090101125320.12B561E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 13:53:19 2009 New Revision: 68124 Log: #4782: Fix markup error that hid load() and loads(). Modified: python/trunk/Doc/library/json.rst Modified: python/trunk/Doc/library/json.rst ============================================================================== --- python/trunk/Doc/library/json.rst (original) +++ python/trunk/Doc/library/json.rst Thu Jan 1 13:53:19 2009 @@ -166,7 +166,7 @@ :func:`dump`. -.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -202,7 +202,7 @@ class. -.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON document) to a Python object. From python-checkins at python.org Thu Jan 1 14:02:10 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 14:02:10 +0100 (CET) Subject: [Python-checkins] r68125 - python/trunk/Doc/distutils/apiref.rst Message-ID: <20090101130210.2E37C1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 14:02:09 2009 New Revision: 68125 Log: #4776: add data_files and package_dir arguments. Modified: python/trunk/Doc/distutils/apiref.rst Modified: python/trunk/Doc/distutils/apiref.rst ============================================================================== --- python/trunk/Doc/distutils/apiref.rst (original) +++ python/trunk/Doc/distutils/apiref.rst Thu Jan 1 14:02:09 2009 @@ -88,9 +88,9 @@ | *options* | default options for the setup | a string | | | script | | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *license* | The license for the package | | + | *license* | The license for the package | a string | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *keywords* | Descriptive meta-data. See | | + | *keywords* | Descriptive meta-data, see | | | | :pep:`314` | | +--------------------+--------------------------------+-------------------------------------------------------------+ | *platforms* | | | @@ -98,6 +98,13 @@ | *cmdclass* | A mapping of command names to | a dictionary | | | :class:`Command` subclasses | | +--------------------+--------------------------------+-------------------------------------------------------------+ + | *data_files* | A list of data files to | a list | + | | install | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + | *package_dir* | A mapping of package to | a dictionary | + | | directory names | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) From python-checkins at python.org Thu Jan 1 14:05:14 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 14:05:14 +0100 (CET) Subject: [Python-checkins] r68126 - python/trunk/Doc/library/logging.rst Message-ID: <20090101130514.7CA591E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 14:05:13 2009 New Revision: 68126 Log: Handlers are in the `logging.handlers` module. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Thu Jan 1 14:05:13 2009 @@ -1559,6 +1559,8 @@ StreamHandler ^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -2065,6 +2067,8 @@ Formatter Objects ----------------- +.. currentmodule:: logging + :class:`Formatter`\ s have the following attributes and methods. They are responsible for converting a :class:`LogRecord` to (usually) a string which can be interpreted by either a human or an external system. The base From python-checkins at python.org Thu Jan 1 14:14:49 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 14:14:49 +0100 (CET) Subject: [Python-checkins] r68127 - python/trunk/Doc/library/email.mime.rst Message-ID: <20090101131449.D2BB31E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 14:14:49 2009 New Revision: 68127 Log: #4767: Use correct submodules for all MIME classes. Modified: python/trunk/Doc/library/email.mime.rst Modified: python/trunk/Doc/library/email.mime.rst ============================================================================== --- python/trunk/Doc/library/email.mime.rst (original) +++ python/trunk/Doc/library/email.mime.rst Thu Jan 1 14:14:49 2009 @@ -19,6 +19,7 @@ Here are the classes: +.. currentmodule:: email.mime.base .. class:: MIMEBase(_maintype, _subtype, **_params) @@ -39,6 +40,8 @@ :mailheader:`MIME-Version` header (always set to ``1.0``). +.. currentmodule:: email.mime.nonmultipart + .. class:: MIMENonMultipart() Module: :mod:`email.mime.nonmultipart` @@ -52,6 +55,8 @@ .. versionadded:: 2.2.2 +.. currentmodule:: email.mime.multipart + .. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` @@ -77,6 +82,8 @@ .. versionadded:: 2.2.2 +.. currentmodule:: email.mime.application + .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.application` @@ -99,6 +106,8 @@ .. versionadded:: 2.5 +.. currentmodule:: email.mime.audio + .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.audio` @@ -122,6 +131,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.image + .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.image` @@ -145,6 +156,8 @@ *_params* are passed straight through to the :class:`MIMEBase` constructor. +.. currentmodule:: email.mime.message + .. class:: MIMEMessage(_msg[, _subtype]) Module: :mod:`email.mime.message` @@ -158,6 +171,8 @@ :mimetype:`rfc822`. +.. currentmodule:: email.mime.text + .. class:: MIMEText(_text[, _subtype[, _charset]]) Module: :mod:`email.mime.text` From python-checkins at python.org Thu Jan 1 15:11:22 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 1 Jan 2009 15:11:22 +0100 (CET) Subject: [Python-checkins] r68128 - in python/trunk: Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_set.py Misc/NEWS Modules/_collectionsmodule.c Objects/dictobject.c Objects/setobject.c Message-ID: <20090101141122.F0CD61E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 1 15:11:22 2009 New Revision: 68128 Log: Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. Modified: python/trunk/Lib/test/test_deque.py python/trunk/Lib/test/test_dict.py python/trunk/Lib/test/test_set.py python/trunk/Misc/NEWS python/trunk/Modules/_collectionsmodule.c python/trunk/Objects/dictobject.c python/trunk/Objects/setobject.c Modified: python/trunk/Lib/test/test_deque.py ============================================================================== --- python/trunk/Lib/test/test_deque.py (original) +++ python/trunk/Lib/test/test_deque.py Thu Jan 1 15:11:22 2009 @@ -1,7 +1,8 @@ from collections import deque import unittest from test import test_support, seq_tests -from weakref import proxy +import gc +import weakref import copy import cPickle as pickle import random @@ -418,6 +419,22 @@ d.append(1) gc.collect() + def test_container_iterator(self): + # Bug # XXX: tp_traverse was not implemented for deque iterator objects + class C(object): + pass + for i in range(2): + obj = C() + ref = weakref.ref(obj) + if i == 0: + container = deque([obj, 1]) + else: + container = reversed(deque([obj, 1])) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): @@ -528,7 +545,7 @@ def test_weakref(self): d = deque('gallahad') - p = proxy(d) + p = weakref.proxy(d) self.assertEqual(str(p), str(d)) d = None self.assertRaises(ReferenceError, str, p) Modified: python/trunk/Lib/test/test_dict.py ============================================================================== --- python/trunk/Lib/test/test_dict.py (original) +++ python/trunk/Lib/test/test_dict.py Thu Jan 1 15:11:22 2009 @@ -2,6 +2,7 @@ from test import test_support import UserDict, random, string +import gc, weakref class DictTest(unittest.TestCase): @@ -554,6 +555,19 @@ pass d = {} + def test_container_iterator(self): + # Bug # XXX: tp_traverse was not implemented for dictiter objects + class C(object): + pass + iterators = (dict.iteritems, dict.itervalues, dict.iterkeys) + for i in iterators: + obj = C() + ref = weakref.ref(obj) + container = {obj: 1} + obj.x = i(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") from test import mapping_tests Modified: python/trunk/Lib/test/test_set.py ============================================================================== --- python/trunk/Lib/test/test_set.py (original) +++ python/trunk/Lib/test/test_set.py Thu Jan 1 15:11:22 2009 @@ -1,6 +1,7 @@ import unittest from test import test_support -from weakref import proxy +import gc +import weakref import operator import copy import pickle @@ -322,6 +323,18 @@ self.assertEqual(sum(elem.hash_count for elem in d), n) self.assertEqual(d3, dict.fromkeys(d, 123)) + def test_container_iterator(self): + # Bug # XXX: tp_traverse was not implemented for set iterator object + class C(object): + pass + obj = C() + ref = weakref.ref(obj) + container = set([obj, 1]) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestSet(TestJointOps): thetype = set @@ -538,7 +551,7 @@ def test_weakref(self): s = self.thetype('gallahad') - p = proxy(s) + p = weakref.proxy(s) self.assertEqual(str(p), str(s)) s = None self.assertRaises(ReferenceError, str, p) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 1 15:11:22 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #3680: Reference cycles created through a dict, set or deque iterator + did not get collected. + - Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types where the tp_hash and tp_dict slots are both NULL. Modified: python/trunk/Modules/_collectionsmodule.c ============================================================================== --- python/trunk/Modules/_collectionsmodule.c (original) +++ python/trunk/Modules/_collectionsmodule.c Thu Jan 1 15:11:22 2009 @@ -958,7 +958,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequeiter_type); + it = PyObject_GC_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; @@ -967,14 +967,22 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } +static int +dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg) +{ + Py_VISIT(dio->deque); + return 0; +} + static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); - Py_TYPE(dio)->tp_free(dio); + PyObject_GC_Del(dio); } static PyObject * @@ -1039,9 +1047,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -1060,7 +1068,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequereviter_type); + it = PyObject_GC_New(dequeiterobject, &dequereviter_type); if (it == NULL) return NULL; it->b = deque->rightblock; @@ -1069,6 +1077,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } @@ -1121,9 +1130,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/trunk/Objects/dictobject.c ============================================================================== --- python/trunk/Objects/dictobject.c (original) +++ python/trunk/Objects/dictobject.c Thu Jan 1 15:11:22 2009 @@ -2331,7 +2331,7 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; - di = PyObject_New(dictiterobject, itertype); + di = PyObject_GC_New(dictiterobject, itertype); if (di == NULL) return NULL; Py_INCREF(dict); @@ -2348,6 +2348,7 @@ } else di->di_result = NULL; + _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -2356,7 +2357,15 @@ { Py_XDECREF(di->di_dict); Py_XDECREF(di->di_result); - PyObject_Del(di); + PyObject_GC_Del(di); +} + +static int +dictiter_traverse(dictiterobject *di, visitproc visit, void *arg) +{ + Py_VISIT(di->di_dict); + Py_VISIT(di->di_result); + return 0; } static PyObject * @@ -2435,9 +2444,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2507,9 +2516,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2593,9 +2602,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/trunk/Objects/setobject.c ============================================================================== --- python/trunk/Objects/setobject.c (original) +++ python/trunk/Objects/setobject.c Thu Jan 1 15:11:22 2009 @@ -810,7 +810,14 @@ setiter_dealloc(setiterobject *si) { Py_XDECREF(si->si_set); - PyObject_Del(si); + PyObject_GC_Del(si); +} + +static int +setiter_traverse(setiterobject *si, visitproc visit, void *arg) +{ + Py_VISIT(si->si_set); + return 0; } static PyObject * @@ -888,9 +895,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)setiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -903,7 +910,7 @@ static PyObject * set_iter(PySetObject *so) { - setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type); + setiterobject *si = PyObject_GC_New(setiterobject, &PySetIter_Type); if (si == NULL) return NULL; Py_INCREF(so); @@ -911,6 +918,7 @@ si->si_used = so->used; si->si_pos = 0; si->len = so->used; + _PyObject_GC_TRACK(si); return (PyObject *)si; } From python-checkins at python.org Thu Jan 1 16:05:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 16:05:06 +0100 (CET) Subject: [Python-checkins] r68129 - in python/branches/py3k: Doc/distutils/apiref.rst Doc/library/dis.rst Doc/library/email.mime.rst Doc/library/json.rst Doc/library/logging.rst Doc/library/webbrowser.rst Doc/library/xml.etree.elementtree.rst Lib/dis.py Lib/re.py Message-ID: <20090101150506.CC9341E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 16:05:06 2009 New Revision: 68129 Log: Merged revisions 68116-68119,68121,68123-68127 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68116 | georg.brandl | 2009-01-01 05:46:51 -0600 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ........ r68117 | georg.brandl | 2009-01-01 05:53:55 -0600 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ........ r68118 | georg.brandl | 2009-01-01 06:00:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ........ r68119 | georg.brandl | 2009-01-01 06:09:40 -0600 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ........ r68121 | georg.brandl | 2009-01-01 06:43:33 -0600 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ........ r68123 | georg.brandl | 2009-01-01 06:52:29 -0600 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ........ r68124 | georg.brandl | 2009-01-01 06:53:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ........ r68125 | georg.brandl | 2009-01-01 07:02:09 -0600 (Thu, 01 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ........ r68126 | georg.brandl | 2009-01-01 07:05:13 -0600 (Thu, 01 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ........ r68127 | georg.brandl | 2009-01-01 07:14:49 -0600 (Thu, 01 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/apiref.rst python/branches/py3k/Doc/library/dis.rst python/branches/py3k/Doc/library/email.mime.rst python/branches/py3k/Doc/library/json.rst python/branches/py3k/Doc/library/logging.rst python/branches/py3k/Doc/library/webbrowser.rst python/branches/py3k/Doc/library/xml.etree.elementtree.rst python/branches/py3k/Lib/dis.py python/branches/py3k/Lib/re.py Modified: python/branches/py3k/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k/Doc/distutils/apiref.rst (original) +++ python/branches/py3k/Doc/distutils/apiref.rst Thu Jan 1 16:05:06 2009 @@ -88,9 +88,9 @@ | *options* | default options for the setup | a string | | | script | | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *license* | The license for the package | | + | *license* | The license for the package | a string | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *keywords* | Descriptive meta-data. See | | + | *keywords* | Descriptive meta-data, see | | | | :pep:`314` | | +--------------------+--------------------------------+-------------------------------------------------------------+ | *platforms* | | | @@ -98,6 +98,13 @@ | *cmdclass* | A mapping of command names to | a dictionary | | | :class:`Command` subclasses | | +--------------------+--------------------------------+-------------------------------------------------------------+ + | *data_files* | A list of data files to | a list | + | | install | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + | *package_dir* | A mapping of package to | a dictionary | + | | directory names | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) Modified: python/branches/py3k/Doc/library/dis.rst ============================================================================== --- python/branches/py3k/Doc/library/dis.rst (original) +++ python/branches/py3k/Doc/library/dis.rst Thu Jan 1 16:05:06 2009 @@ -64,10 +64,23 @@ .. function:: disco(code[, lasti]) - A synonym for disassemble. It is more convenient to type, and kept for - compatibility with earlier Python releases. + A synonym for :func:`disassemble`. It is more convenient to type, and kept + for compatibility with earlier Python releases. +.. function:: findlinestarts(code) + + This generator function uses the ``co_firstlineno`` and ``co_lnotab`` + attributes of the code object *code* to find the offsets which are starts of + lines in the source code. They are generated as ``(offset, lineno)`` pairs. + + +.. function:: findlabels(code) + + Detect all offsets in the code object *code* which are jump targets, and + return a list of these offsets. + + .. data:: opname Sequence of operation names, indexable using the bytecode. Modified: python/branches/py3k/Doc/library/email.mime.rst ============================================================================== --- python/branches/py3k/Doc/library/email.mime.rst (original) +++ python/branches/py3k/Doc/library/email.mime.rst Thu Jan 1 16:05:06 2009 @@ -19,6 +19,7 @@ Here are the classes: +.. currentmodule:: email.mime.base .. class:: MIMEBase(_maintype, _subtype, **_params) @@ -39,6 +40,8 @@ :mailheader:`MIME-Version` header (always set to ``1.0``). +.. currentmodule:: email.mime.nonmultipart + .. class:: MIMENonMultipart() Module: :mod:`email.mime.nonmultipart` @@ -50,6 +53,8 @@ :exc:`MultipartConversionError` exception is raised. +.. currentmodule:: email.mime.multipart + .. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` @@ -73,6 +78,8 @@ dictionary. +.. currentmodule:: email.mime.application + .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.application` @@ -93,6 +100,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.audio + .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.audio` @@ -116,6 +125,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.image + .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.image` @@ -139,6 +150,8 @@ *_params* are passed straight through to the :class:`MIMEBase` constructor. +.. currentmodule:: email.mime.message + .. class:: MIMEMessage(_msg[, _subtype]) Module: :mod:`email.mime.message` @@ -152,6 +165,8 @@ :mimetype:`rfc822`. +.. currentmodule:: email.mime.text + .. class:: MIMEText(_text[, _subtype[, _charset]]) Module: :mod:`email.mime.text` Modified: python/branches/py3k/Doc/library/json.rst ============================================================================== --- python/branches/py3k/Doc/library/json.rst (original) +++ python/branches/py3k/Doc/library/json.rst Thu Jan 1 16:05:06 2009 @@ -165,7 +165,7 @@ :func:`dump`. -.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -201,7 +201,7 @@ class. -.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON document) to a Python object. Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Thu Jan 1 16:05:06 2009 @@ -1534,6 +1534,8 @@ StreamHandler ^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -2035,6 +2037,8 @@ Formatter Objects ----------------- +.. currentmodule:: logging + :class:`Formatter`\ s have the following attributes and methods. They are responsible for converting a :class:`LogRecord` to (usually) a string which can be interpreted by either a human or an external system. The base Modified: python/branches/py3k/Doc/library/webbrowser.rst ============================================================================== --- python/branches/py3k/Doc/library/webbrowser.rst (original) +++ python/branches/py3k/Doc/library/webbrowser.rst Thu Jan 1 16:05:06 2009 @@ -167,7 +167,7 @@ Browser Controller Objects -------------------------- -Browser controllers provide two methods which parallel two of the module-level +Browser controllers provide these methods which parallel two of the module-level convenience functions: 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 Jan 1 16:05:06 2009 @@ -94,6 +94,16 @@ *events* is a list of events to report back. If omitted, only "end" events are reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs. + .. note:: + + :func:`iterparse` only guarantees that it has seen the ">" + character of a starting tag when it emits a "start" event, so the + attributes are defined, but the contents of the text and tail attributes + are undefined at that point. The same applies to the element children; + they may or may not be present. + + If you need a fully populated element, look for "end" events instead. + .. function:: parse(source[, parser]) Modified: python/branches/py3k/Lib/dis.py ============================================================================== --- python/branches/py3k/Lib/dis.py (original) +++ python/branches/py3k/Lib/dis.py Thu Jan 1 16:05:06 2009 @@ -6,7 +6,8 @@ from opcode import * from opcode import __all__ as _opcodes_all -__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all +__all__ = ["dis", "disassemble", "distb", "disco", + "findlinestarts", "findlabels"] + _opcodes_all del _opcodes_all def dis(x=None): Modified: python/branches/py3k/Lib/re.py ============================================================================== --- python/branches/py3k/Lib/re.py (original) +++ python/branches/py3k/Lib/re.py Thu Jan 1 16:05:06 2009 @@ -160,7 +160,8 @@ """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; - if a callable, it's passed the match object and must return + if a string, backslash escapes in it are processed. If it is + a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).sub(repl, string, count) @@ -170,7 +171,8 @@ non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a string or a - callable; if a callable, it's passed the match object and must + callable; if a string, backslash escapes in it are processed. + If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).subn(repl, string, count) From python-checkins at python.org Thu Jan 1 16:09:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 16:09:10 +0100 (CET) Subject: [Python-checkins] r68130 - in python/branches/release30-maint: Doc/distutils/apiref.rst Doc/library/dis.rst Doc/library/email.mime.rst Doc/library/json.rst Doc/library/logging.rst Doc/library/webbrowser.rst Doc/library/xml.etree.elementtree.rst Lib/dis.py Lib/re.py Message-ID: <20090101150910.F145C1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 16:09:10 2009 New Revision: 68130 Log: Merged revisions 68129 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68129 | benjamin.peterson | 2009-01-01 09:05:06 -0600 (Thu, 01 Jan 2009) | 46 lines Merged revisions 68116-68119,68121,68123-68127 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68116 | georg.brandl | 2009-01-01 05:46:51 -0600 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ........ r68117 | georg.brandl | 2009-01-01 05:53:55 -0600 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ........ r68118 | georg.brandl | 2009-01-01 06:00:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ........ r68119 | georg.brandl | 2009-01-01 06:09:40 -0600 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ........ r68121 | georg.brandl | 2009-01-01 06:43:33 -0600 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ........ r68123 | georg.brandl | 2009-01-01 06:52:29 -0600 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ........ r68124 | georg.brandl | 2009-01-01 06:53:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ........ r68125 | georg.brandl | 2009-01-01 07:02:09 -0600 (Thu, 01 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ........ r68126 | georg.brandl | 2009-01-01 07:05:13 -0600 (Thu, 01 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ........ r68127 | georg.brandl | 2009-01-01 07:14:49 -0600 (Thu, 01 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ........ ................ Modified: python/branches/release30-maint/Doc/distutils/apiref.rst python/branches/release30-maint/Doc/library/dis.rst python/branches/release30-maint/Doc/library/email.mime.rst python/branches/release30-maint/Doc/library/json.rst python/branches/release30-maint/Doc/library/logging.rst python/branches/release30-maint/Doc/library/webbrowser.rst python/branches/release30-maint/Doc/library/xml.etree.elementtree.rst python/branches/release30-maint/Lib/dis.py python/branches/release30-maint/Lib/re.py Modified: python/branches/release30-maint/Doc/distutils/apiref.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/apiref.rst (original) +++ python/branches/release30-maint/Doc/distutils/apiref.rst Thu Jan 1 16:09:10 2009 @@ -88,9 +88,9 @@ | *options* | default options for the setup | a string | | | script | | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *license* | The license for the package | | + | *license* | The license for the package | a string | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *keywords* | Descriptive meta-data. See | | + | *keywords* | Descriptive meta-data, see | | | | :pep:`314` | | +--------------------+--------------------------------+-------------------------------------------------------------+ | *platforms* | | | @@ -98,6 +98,13 @@ | *cmdclass* | A mapping of command names to | a dictionary | | | :class:`Command` subclasses | | +--------------------+--------------------------------+-------------------------------------------------------------+ + | *data_files* | A list of data files to | a list | + | | install | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + | *package_dir* | A mapping of package to | a dictionary | + | | directory names | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) Modified: python/branches/release30-maint/Doc/library/dis.rst ============================================================================== --- python/branches/release30-maint/Doc/library/dis.rst (original) +++ python/branches/release30-maint/Doc/library/dis.rst Thu Jan 1 16:09:10 2009 @@ -64,10 +64,23 @@ .. function:: disco(code[, lasti]) - A synonym for disassemble. It is more convenient to type, and kept for - compatibility with earlier Python releases. + A synonym for :func:`disassemble`. It is more convenient to type, and kept + for compatibility with earlier Python releases. +.. function:: findlinestarts(code) + + This generator function uses the ``co_firstlineno`` and ``co_lnotab`` + attributes of the code object *code* to find the offsets which are starts of + lines in the source code. They are generated as ``(offset, lineno)`` pairs. + + +.. function:: findlabels(code) + + Detect all offsets in the code object *code* which are jump targets, and + return a list of these offsets. + + .. data:: opname Sequence of operation names, indexable using the bytecode. Modified: python/branches/release30-maint/Doc/library/email.mime.rst ============================================================================== --- python/branches/release30-maint/Doc/library/email.mime.rst (original) +++ python/branches/release30-maint/Doc/library/email.mime.rst Thu Jan 1 16:09:10 2009 @@ -19,6 +19,7 @@ Here are the classes: +.. currentmodule:: email.mime.base .. class:: MIMEBase(_maintype, _subtype, **_params) @@ -39,6 +40,8 @@ :mailheader:`MIME-Version` header (always set to ``1.0``). +.. currentmodule:: email.mime.nonmultipart + .. class:: MIMENonMultipart() Module: :mod:`email.mime.nonmultipart` @@ -50,6 +53,8 @@ :exc:`MultipartConversionError` exception is raised. +.. currentmodule:: email.mime.multipart + .. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` @@ -73,6 +78,8 @@ dictionary. +.. currentmodule:: email.mime.application + .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.application` @@ -93,6 +100,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.audio + .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.audio` @@ -116,6 +125,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.image + .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.image` @@ -139,6 +150,8 @@ *_params* are passed straight through to the :class:`MIMEBase` constructor. +.. currentmodule:: email.mime.message + .. class:: MIMEMessage(_msg[, _subtype]) Module: :mod:`email.mime.message` @@ -152,6 +165,8 @@ :mimetype:`rfc822`. +.. currentmodule:: email.mime.text + .. class:: MIMEText(_text[, _subtype[, _charset]]) Module: :mod:`email.mime.text` Modified: python/branches/release30-maint/Doc/library/json.rst ============================================================================== --- python/branches/release30-maint/Doc/library/json.rst (original) +++ python/branches/release30-maint/Doc/library/json.rst Thu Jan 1 16:09:10 2009 @@ -165,7 +165,7 @@ :func:`dump`. -.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -201,7 +201,7 @@ class. -.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON document) to a Python object. Modified: python/branches/release30-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release30-maint/Doc/library/logging.rst (original) +++ python/branches/release30-maint/Doc/library/logging.rst Thu Jan 1 16:09:10 2009 @@ -1519,6 +1519,8 @@ StreamHandler ^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -2020,6 +2022,8 @@ Formatter Objects ----------------- +.. currentmodule:: logging + :class:`Formatter`\ s have the following attributes and methods. They are responsible for converting a :class:`LogRecord` to (usually) a string which can be interpreted by either a human or an external system. The base Modified: python/branches/release30-maint/Doc/library/webbrowser.rst ============================================================================== --- python/branches/release30-maint/Doc/library/webbrowser.rst (original) +++ python/branches/release30-maint/Doc/library/webbrowser.rst Thu Jan 1 16:09:10 2009 @@ -167,7 +167,7 @@ Browser Controller Objects -------------------------- -Browser controllers provide two methods which parallel two of the module-level +Browser controllers provide these methods which parallel two of the module-level convenience functions: 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 Jan 1 16:09:10 2009 @@ -94,6 +94,16 @@ *events* is a list of events to report back. If omitted, only "end" events are reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs. + .. note:: + + :func:`iterparse` only guarantees that it has seen the ">" + character of a starting tag when it emits a "start" event, so the + attributes are defined, but the contents of the text and tail attributes + are undefined at that point. The same applies to the element children; + they may or may not be present. + + If you need a fully populated element, look for "end" events instead. + .. function:: parse(source[, parser]) Modified: python/branches/release30-maint/Lib/dis.py ============================================================================== --- python/branches/release30-maint/Lib/dis.py (original) +++ python/branches/release30-maint/Lib/dis.py Thu Jan 1 16:09:10 2009 @@ -6,7 +6,8 @@ from opcode import * from opcode import __all__ as _opcodes_all -__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all +__all__ = ["dis", "disassemble", "distb", "disco", + "findlinestarts", "findlabels"] + _opcodes_all del _opcodes_all def dis(x=None): Modified: python/branches/release30-maint/Lib/re.py ============================================================================== --- python/branches/release30-maint/Lib/re.py (original) +++ python/branches/release30-maint/Lib/re.py Thu Jan 1 16:09:10 2009 @@ -160,7 +160,8 @@ """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; - if a callable, it's passed the match object and must return + if a string, backslash escapes in it are processed. If it is + a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).sub(repl, string, count) @@ -170,7 +171,8 @@ non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a string or a - callable; if a callable, it's passed the match object and must + callable; if a string, backslash escapes in it are processed. + If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).subn(repl, string, count) From python-checkins at python.org Thu Jan 1 16:33:11 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 16:33:11 +0100 (CET) Subject: [Python-checkins] r68131 - python/branches/release26-maint Message-ID: <20090101153311.6D64E1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 16:33:10 2009 New Revision: 68131 Log: Blocked revisions 67902,67946,67954,67976,67978-67980,67985,68089,68092,68119 via svnmerge ........ r67902 | benjamin.peterson | 2008-12-22 21:16:25 +0100 (Mon, 22 Dec 2008) | 1 line add py3k warnings to frame.f_exc_* ........ r67946 | antoine.pitrou | 2008-12-27 16:43:12 +0100 (Sat, 27 Dec 2008) | 4 lines Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by Gabriel Genellina. ........ r67954 | benjamin.peterson | 2008-12-27 19:24:11 +0100 (Sat, 27 Dec 2008) | 1 line #4748 lambda generators shouldn't return values ........ r67976 | georg.brandl | 2008-12-28 12:54:53 +0100 (Sun, 28 Dec 2008) | 7 lines Backport r67974: #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6. ........ r67978 | georg.brandl | 2008-12-28 12:58:49 +0100 (Sun, 28 Dec 2008) | 2 lines #4731: clarify message about missing module prerequisites. ........ r67979 | antoine.pitrou | 2008-12-28 15:09:36 +0100 (Sun, 28 Dec 2008) | 3 lines Issue #4444: Allow assertRaises() to be used as a context handler. ........ r67980 | antoine.pitrou | 2008-12-28 15:24:29 +0100 (Sun, 28 Dec 2008) | 1 line wrong version number in doc changes committed in r67979 ........ r67985 | antoine.pitrou | 2008-12-28 17:01:11 +0100 (Sun, 28 Dec 2008) | 4 lines Issue #2153: modernize coding style of unittest.py, remove obsolete compatibility stuff. Patch by Virgil Dupras. ........ r68089 | benjamin.peterson | 2008-12-31 04:37:51 +0100 (Wed, 31 Dec 2008) | 1 line #4788 qualify some bare except clauses ........ r68092 | benjamin.peterson | 2008-12-31 05:08:55 +0100 (Wed, 31 Dec 2008) | 1 line fix name collision issues ........ r68119 | georg.brandl | 2009-01-01 13:09:40 +0100 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu Jan 1 16:35:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 1 Jan 2009 16:35:34 +0100 (CET) Subject: [Python-checkins] r68132 - in python/branches/py3k: Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_set.py Misc/NEWS Modules/_collectionsmodule.c Objects/dictobject.c Objects/setobject.c Message-ID: <20090101153534.BD5C01E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 1 16:35:33 2009 New Revision: 68132 Log: Merged revisions 68128 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (jeu., 01 janv. 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_deque.py python/branches/py3k/Lib/test/test_dict.py python/branches/py3k/Lib/test/test_set.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_collectionsmodule.c python/branches/py3k/Objects/dictobject.c python/branches/py3k/Objects/setobject.c Modified: python/branches/py3k/Lib/test/test_deque.py ============================================================================== --- python/branches/py3k/Lib/test/test_deque.py (original) +++ python/branches/py3k/Lib/test/test_deque.py Thu Jan 1 16:35:33 2009 @@ -1,7 +1,8 @@ from collections import deque import unittest from test import support, seq_tests -from weakref import proxy +import gc +import weakref import copy import pickle from io import StringIO @@ -420,6 +421,22 @@ d.append(1) gc.collect() + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for deque iterator objects + class C(object): + pass + for i in range(2): + obj = C() + ref = weakref.ref(obj) + if i == 0: + container = deque([obj, 1]) + else: + container = reversed(deque([obj, 1])) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): @@ -530,7 +547,7 @@ def test_weakref(self): d = deque('gallahad') - p = proxy(d) + p = weakref.proxy(d) self.assertEqual(str(p), str(d)) d = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/py3k/Lib/test/test_dict.py ============================================================================== --- python/branches/py3k/Lib/test/test_dict.py (original) +++ python/branches/py3k/Lib/test/test_dict.py Thu Jan 1 16:35:33 2009 @@ -2,6 +2,7 @@ from test import support import sys, collections, random, string +import gc, weakref class DictTest(unittest.TestCase): @@ -648,6 +649,21 @@ pass d = {} + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for dictiter and + # dictview objects. + class C(object): + pass + views = (dict.items, dict.values, dict.keys) + for v in views: + obj = C() + ref = weakref.ref(obj) + container = {obj: 1} + obj.v = v(container) + obj.x = iter(obj.v) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") from test import mapping_tests Modified: python/branches/py3k/Lib/test/test_set.py ============================================================================== --- python/branches/py3k/Lib/test/test_set.py (original) +++ python/branches/py3k/Lib/test/test_set.py Thu Jan 1 16:35:33 2009 @@ -1,6 +1,7 @@ import unittest from test import support -from weakref import proxy +import gc +import weakref import operator import copy import pickle @@ -323,6 +324,18 @@ self.assertEqual(sum(elem.hash_count for elem in d), n) self.assertEqual(d3, dict.fromkeys(d, 123)) + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for set iterator object + class C(object): + pass + obj = C() + ref = weakref.ref(obj) + container = set([obj, 1]) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestSet(TestJointOps): thetype = set basetype = set @@ -546,7 +559,7 @@ def test_weakref(self): s = self.thetype('gallahad') - p = proxy(s) + p = weakref.proxy(s) self.assertEqual(str(p), str(s)) s = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 1 16:35:33 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #3680: Reference cycles created through a dict, set or deque iterator + did not get collected. + - Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types where the tp_hash and tp_dict slots are both NULL. Modified: python/branches/py3k/Modules/_collectionsmodule.c ============================================================================== --- python/branches/py3k/Modules/_collectionsmodule.c (original) +++ python/branches/py3k/Modules/_collectionsmodule.c Thu Jan 1 16:35:33 2009 @@ -900,7 +900,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequeiter_type); + it = PyObject_GC_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; @@ -909,14 +909,22 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } +static int +dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg) +{ + Py_VISIT(dio->deque); + return 0; +} + static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); - Py_TYPE(dio)->tp_free(dio); + PyObject_GC_Del(dio); } static PyObject * @@ -981,9 +989,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -1002,7 +1010,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequereviter_type); + it = PyObject_GC_New(dequeiterobject, &dequereviter_type); if (it == NULL) return NULL; it->b = deque->rightblock; @@ -1011,6 +1019,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } @@ -1063,9 +1072,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/py3k/Objects/dictobject.c ============================================================================== --- python/branches/py3k/Objects/dictobject.c (original) +++ python/branches/py3k/Objects/dictobject.c Thu Jan 1 16:35:33 2009 @@ -2122,7 +2122,7 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; - di = PyObject_New(dictiterobject, itertype); + di = PyObject_GC_New(dictiterobject, itertype); if (di == NULL) return NULL; Py_INCREF(dict); @@ -2139,6 +2139,7 @@ } else di->di_result = NULL; + _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -2147,7 +2148,15 @@ { Py_XDECREF(di->di_dict); Py_XDECREF(di->di_result); - PyObject_Del(di); + PyObject_GC_Del(di); +} + +static int +dictiter_traverse(dictiterobject *di, visitproc visit, void *arg) +{ + Py_VISIT(di->di_dict); + Py_VISIT(di->di_result); + return 0; } static PyObject * @@ -2228,9 +2237,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2300,9 +2309,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2386,9 +2395,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2415,7 +2424,14 @@ dictview_dealloc(dictviewobject *dv) { Py_XDECREF(dv->dv_dict); - PyObject_Del(dv); + PyObject_GC_Del(dv); +} + +static int +dictview_traverse(dictviewobject *dv, visitproc visit, void *arg) +{ + Py_VISIT(dv->dv_dict); + return 0; } static Py_ssize_t @@ -2442,11 +2458,12 @@ type->tp_name, dict->ob_type->tp_name); return NULL; } - dv = PyObject_New(dictviewobject, type); + dv = PyObject_GC_New(dictviewobject, type); if (dv == NULL) return NULL; Py_INCREF(dict); dv->dv_dict = (PyDictObject *)dict; + _PyObject_GC_TRACK(dv); return (PyObject *)dv; } @@ -2693,9 +2710,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ dictview_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2777,9 +2794,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ dictview_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2842,9 +2859,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/py3k/Objects/setobject.c ============================================================================== --- python/branches/py3k/Objects/setobject.c (original) +++ python/branches/py3k/Objects/setobject.c Thu Jan 1 16:35:33 2009 @@ -802,7 +802,14 @@ setiter_dealloc(setiterobject *si) { Py_XDECREF(si->si_set); - PyObject_Del(si); + PyObject_GC_Del(si); +} + +static int +setiter_traverse(setiterobject *si, visitproc visit, void *arg) +{ + Py_VISIT(si->si_set); + return 0; } static PyObject * @@ -880,9 +887,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)setiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -895,7 +902,7 @@ static PyObject * set_iter(PySetObject *so) { - setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type); + setiterobject *si = PyObject_GC_New(setiterobject, &PySetIter_Type); if (si == NULL) return NULL; Py_INCREF(so); @@ -903,6 +910,7 @@ si->si_used = so->used; si->si_pos = 0; si->len = so->used; + _PyObject_GC_TRACK(si); return (PyObject *)si; } From python-checkins at python.org Thu Jan 1 16:38:03 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 1 Jan 2009 16:38:03 +0100 (CET) Subject: [Python-checkins] r68133 - in python/trunk/Lib/test: test_deque.py test_dict.py test_set.py Message-ID: <20090101153803.A35B41E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 1 16:38:03 2009 New Revision: 68133 Log: fill in actual issue number in tests Modified: python/trunk/Lib/test/test_deque.py python/trunk/Lib/test/test_dict.py python/trunk/Lib/test/test_set.py Modified: python/trunk/Lib/test/test_deque.py ============================================================================== --- python/trunk/Lib/test/test_deque.py (original) +++ python/trunk/Lib/test/test_deque.py Thu Jan 1 16:38:03 2009 @@ -420,7 +420,7 @@ gc.collect() def test_container_iterator(self): - # Bug # XXX: tp_traverse was not implemented for deque iterator objects + # Bug #3680: tp_traverse was not implemented for deque iterator objects class C(object): pass for i in range(2): Modified: python/trunk/Lib/test/test_dict.py ============================================================================== --- python/trunk/Lib/test/test_dict.py (original) +++ python/trunk/Lib/test/test_dict.py Thu Jan 1 16:38:03 2009 @@ -556,7 +556,7 @@ d = {} def test_container_iterator(self): - # Bug # XXX: tp_traverse was not implemented for dictiter objects + # Bug #3680: tp_traverse was not implemented for dictiter objects class C(object): pass iterators = (dict.iteritems, dict.itervalues, dict.iterkeys) Modified: python/trunk/Lib/test/test_set.py ============================================================================== --- python/trunk/Lib/test/test_set.py (original) +++ python/trunk/Lib/test/test_set.py Thu Jan 1 16:38:03 2009 @@ -324,7 +324,7 @@ self.assertEqual(d3, dict.fromkeys(d, 123)) def test_container_iterator(self): - # Bug # XXX: tp_traverse was not implemented for set iterator object + # Bug #3680: tp_traverse was not implemented for set iterator object class C(object): pass obj = C() From python-checkins at python.org Thu Jan 1 16:45:40 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Thu, 1 Jan 2009 16:45:40 +0100 (CET) Subject: [Python-checkins] r68134 - in python/trunk: Misc/NEWS Modules/_fileio.c Message-ID: <20090101154540.1B4501E402A@bag.python.org> Author: hirokazu.yamamoto Date: Thu Jan 1 16:45:39 2009 New Revision: 68134 Log: Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. Modified: python/trunk/Misc/NEWS python/trunk/Modules/_fileio.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 1 16:45:39 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open + file with `str' filename on Windows. + - Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. Modified: python/trunk/Modules/_fileio.c ============================================================================== --- python/trunk/Modules/_fileio.c (original) +++ python/trunk/Modules/_fileio.c Thu Jan 1 16:45:39 2009 @@ -265,10 +265,11 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } if(dircheck(self, name) < 0) From python-checkins at python.org Thu Jan 1 16:46:11 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 16:46:11 +0100 (CET) Subject: [Python-checkins] r68135 - in python/branches/release26-maint: Doc/c-api/arg.rst Doc/c-api/exceptions.rst Doc/distutils/apiref.rst Doc/howto/unicode.rst Doc/library/email.mime.rst Doc/library/json.rst Doc/library/logging.rst Doc/library/multiprocessing.rst Doc/library/new.rst Doc/library/pydoc.rst Doc/library/socketserver.rst Doc/library/urllib2.rst Doc/library/webbrowser.rst Doc/library/winsound.rst Doc/library/xml.etree.elementtree.rst Include/unicodeobject.h Lib/distutils/util.py Lib/inspect.py Lib/pydoc.py Lib/re.py Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_file.py Lib/test/test_fileio.py Lib/test/test_set.py Lib/test/test_struct.py Lib/textwrap.py Misc/NEWS Modules/_collectionsmodule.c Modules/_fileio.c Modules/_struct.c Objects/dictobject.c Objects/fileobject.c Objects/setobject.c Tools/pybench/Lists.py Message-ID: <20090101154611.587EA1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 16:46:10 2009 New Revision: 68135 Log: Merged revisions 67952-67953,67955,67957-67958,67960-67961,67963,67965,67967,67970-67971,67973,67982,67988,67990,67995,68014,68016,68030,68057,68061,68112,68115-68118,68120-68121,68123-68128 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67952 | georg.brandl | 2008-12-27 18:42:40 +0100 (Sat, 27 Dec 2008) | 2 lines #4752: actually use custom handler in example. ........ r67953 | georg.brandl | 2008-12-27 19:20:04 +0100 (Sat, 27 Dec 2008) | 3 lines Patch #4739 by David Laban: add symbols to pydoc help topics, so that ``help('@')`` works as expected. ........ r67955 | georg.brandl | 2008-12-27 19:27:53 +0100 (Sat, 27 Dec 2008) | 3 lines Follow-up to r67746 in order to restore backwards-compatibility for those who (monkey-)patch TextWrapper.wordsep_re with a custom RE. ........ r67957 | georg.brandl | 2008-12-27 19:49:19 +0100 (Sat, 27 Dec 2008) | 2 lines #4754: improve winsound documentation. ........ r67958 | georg.brandl | 2008-12-27 20:02:59 +0100 (Sat, 27 Dec 2008) | 2 lines #4682: 'b' is actually unsigned char. ........ r67960 | georg.brandl | 2008-12-27 20:04:44 +0100 (Sat, 27 Dec 2008) | 2 lines #4695: fix backslashery. ........ r67961 | georg.brandl | 2008-12-27 20:06:04 +0100 (Sat, 27 Dec 2008) | 2 lines Use :samp: role. ........ r67963 | georg.brandl | 2008-12-27 20:11:15 +0100 (Sat, 27 Dec 2008) | 2 lines #4671: document that pydoc imports modules. ........ r67965 | antoine.pitrou | 2008-12-27 21:34:52 +0100 (Sat, 27 Dec 2008) | 3 lines Issue #4677: add two list comprehension tests to pybench. ........ r67967 | benjamin.peterson | 2008-12-27 23:18:58 +0100 (Sat, 27 Dec 2008) | 1 line fix markup ........ r67970 | alexandre.vassalotti | 2008-12-28 02:52:58 +0100 (Sun, 28 Dec 2008) | 2 lines Fix name mangling of PyUnicode_ClearFreeList. ........ r67971 | alexandre.vassalotti | 2008-12-28 03:10:35 +0100 (Sun, 28 Dec 2008) | 2 lines Sort UCS-2/UCS-4 name mangling list. ........ r67973 | alexandre.vassalotti | 2008-12-28 03:58:22 +0100 (Sun, 28 Dec 2008) | 2 lines Document Py_VaBuildValue. ........ r67982 | benjamin.peterson | 2008-12-28 16:37:31 +0100 (Sun, 28 Dec 2008) | 1 line fix WORD_BIGEDIAN declaration in Universal builds; fixes #4060 and #4728 ........ r67988 | ronald.oussoren | 2008-12-28 20:40:56 +0100 (Sun, 28 Dec 2008) | 1 line Issue4064: architecture string for universal builds on OSX ........ r67990 | ronald.oussoren | 2008-12-28 20:50:40 +0100 (Sun, 28 Dec 2008) | 3 lines Update the fix for issue4064 to deal correctly with all three variants of universal builds that are presented by the configure script. ........ r67995 | benjamin.peterson | 2008-12-28 22:16:07 +0100 (Sun, 28 Dec 2008) | 1 line #4763 PyErr_ExceptionMatches won't blow up with NULL arguments ........ r68014 | benjamin.peterson | 2008-12-29 18:47:42 +0100 (Mon, 29 Dec 2008) | 1 line #4764 set IOError.filename when trying to open a directory on POSIX platforms ........ r68016 | benjamin.peterson | 2008-12-29 18:56:58 +0100 (Mon, 29 Dec 2008) | 1 line #4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms ........ r68030 | benjamin.peterson | 2008-12-29 22:38:14 +0100 (Mon, 29 Dec 2008) | 1 line fix French ........ r68057 | vinay.sajip | 2008-12-30 08:01:25 +0100 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ........ r68061 | georg.brandl | 2008-12-30 11:15:49 +0100 (Tue, 30 Dec 2008) | 2 lines #4778: attributes can't be called. ........ r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line #4795 inspect.isgeneratorfunction() should return False instead of None ........ r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line simplfy code ........ r68116 | georg.brandl | 2009-01-01 12:46:51 +0100 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ........ r68117 | georg.brandl | 2009-01-01 12:53:55 +0100 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ........ r68118 | georg.brandl | 2009-01-01 13:00:19 +0100 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ........ r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines #4228: Pack negative values the same way as 2.4 in struct's L format. ........ r68121 | georg.brandl | 2009-01-01 13:43:33 +0100 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ........ r68123 | georg.brandl | 2009-01-01 13:52:29 +0100 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ........ r68124 | georg.brandl | 2009-01-01 13:53:19 +0100 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ........ r68125 | georg.brandl | 2009-01-01 14:02:09 +0100 (Thu, 01 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ........ r68126 | georg.brandl | 2009-01-01 14:05:13 +0100 (Thu, 01 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ........ r68127 | georg.brandl | 2009-01-01 14:14:49 +0100 (Thu, 01 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ........ r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (Thu, 01 Jan 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/c-api/arg.rst python/branches/release26-maint/Doc/c-api/exceptions.rst python/branches/release26-maint/Doc/distutils/apiref.rst python/branches/release26-maint/Doc/howto/unicode.rst python/branches/release26-maint/Doc/library/email.mime.rst python/branches/release26-maint/Doc/library/json.rst python/branches/release26-maint/Doc/library/logging.rst python/branches/release26-maint/Doc/library/multiprocessing.rst python/branches/release26-maint/Doc/library/new.rst python/branches/release26-maint/Doc/library/pydoc.rst python/branches/release26-maint/Doc/library/socketserver.rst python/branches/release26-maint/Doc/library/urllib2.rst python/branches/release26-maint/Doc/library/webbrowser.rst python/branches/release26-maint/Doc/library/winsound.rst python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst python/branches/release26-maint/Include/unicodeobject.h python/branches/release26-maint/Lib/distutils/util.py python/branches/release26-maint/Lib/inspect.py python/branches/release26-maint/Lib/pydoc.py python/branches/release26-maint/Lib/re.py python/branches/release26-maint/Lib/test/test_deque.py python/branches/release26-maint/Lib/test/test_dict.py python/branches/release26-maint/Lib/test/test_file.py python/branches/release26-maint/Lib/test/test_fileio.py python/branches/release26-maint/Lib/test/test_set.py python/branches/release26-maint/Lib/test/test_struct.py python/branches/release26-maint/Lib/textwrap.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_collectionsmodule.c python/branches/release26-maint/Modules/_fileio.c python/branches/release26-maint/Modules/_struct.c python/branches/release26-maint/Objects/dictobject.c python/branches/release26-maint/Objects/fileobject.c python/branches/release26-maint/Objects/setobject.c python/branches/release26-maint/Tools/pybench/Lists.py Modified: python/branches/release26-maint/Doc/c-api/arg.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/arg.rst (original) +++ python/branches/release26-maint/Doc/c-api/arg.rst Thu Jan 1 16:46:10 2009 @@ -136,8 +136,9 @@ them. Instead, the implementation assumes that the string object uses the encoding passed in as parameter. -``b`` (integer) [char] - Convert a Python integer to a tiny int, stored in a C :ctype:`char`. +``b`` (integer) [unsigned char] + Convert a nonnegative Python integer to an unsigned tiny int, stored in a C + :ctype:`unsigned char`. ``B`` (integer) [unsigned char] Convert a Python integer to a tiny int without overflow checking, stored in a C @@ -533,3 +534,8 @@ If there is an error in the format string, the :exc:`SystemError` exception is set and *NULL* returned. + +.. cfunction:: PyObject* Py_VaBuildValue(const char *format, va_list vargs) + + Identical to :cfunc:`Py_BuildValue`, except that it accepts a va_list + rather than a variable number of arguments. 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 Thu Jan 1 16:46:10 2009 @@ -73,11 +73,10 @@ .. cfunction:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc) - Return true if the *given* exception matches the exception in *exc*. If *exc* - is a class object, this also returns true when *given* is an instance of a - subclass. If *exc* is a tuple, all exceptions in the tuple (and recursively in - subtuples) are searched for a match. If *given* is *NULL*, a memory access - violation will occur. + Return true if the *given* exception matches the exception in *exc*. If + *exc* is a class object, this also returns true when *given* is an instance + of a subclass. If *exc* is a tuple, all exceptions in the tuple (and + recursively in subtuples) are searched for a match. .. cfunction:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb) Modified: python/branches/release26-maint/Doc/distutils/apiref.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/apiref.rst (original) +++ python/branches/release26-maint/Doc/distutils/apiref.rst Thu Jan 1 16:46:10 2009 @@ -88,9 +88,9 @@ | *options* | default options for the setup | a string | | | script | | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *license* | The license for the package | | + | *license* | The license for the package | a string | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *keywords* | Descriptive meta-data. See | | + | *keywords* | Descriptive meta-data, see | | | | :pep:`314` | | +--------------------+--------------------------------+-------------------------------------------------------------+ | *platforms* | | | @@ -98,6 +98,13 @@ | *cmdclass* | A mapping of command names to | a dictionary | | | :class:`Command` subclasses | | +--------------------+--------------------------------+-------------------------------------------------------------+ + | *data_files* | A list of data files to | a list | + | | install | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + | *package_dir* | A mapping of package to | a dictionary | + | | directory names | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -1100,6 +1107,24 @@ For non-POSIX platforms, currently just returns ``sys.platform``. + For MacOS X systems the OS version reflects the minimal version on which + binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` + during the build of Python), not the OS version of the current system. + + For universal binary builds on MacOS X the architecture value reflects + the univeral binary status instead of the architecture of the current + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. + + Examples of returned values on MacOS X: + + * ``macosx-10.3-ppc`` + + * ``macosx-10.3-fat`` + + * ``macosx-10.5-universal`` + .. % XXX isn't this also provided by some other non-distutils module? Modified: python/branches/release26-maint/Doc/howto/unicode.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/unicode.rst (original) +++ python/branches/release26-maint/Doc/howto/unicode.rst Thu Jan 1 16:46:10 2009 @@ -30,7 +30,7 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHER EST COMPLETE." + PRINT "FICHIER EST COMPLETE." PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who Modified: python/branches/release26-maint/Doc/library/email.mime.rst ============================================================================== --- python/branches/release26-maint/Doc/library/email.mime.rst (original) +++ python/branches/release26-maint/Doc/library/email.mime.rst Thu Jan 1 16:46:10 2009 @@ -19,6 +19,7 @@ Here are the classes: +.. currentmodule:: email.mime.base .. class:: MIMEBase(_maintype, _subtype, **_params) @@ -39,6 +40,8 @@ :mailheader:`MIME-Version` header (always set to ``1.0``). +.. currentmodule:: email.mime.nonmultipart + .. class:: MIMENonMultipart() Module: :mod:`email.mime.nonmultipart` @@ -52,6 +55,8 @@ .. versionadded:: 2.2.2 +.. currentmodule:: email.mime.multipart + .. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` @@ -77,6 +82,8 @@ .. versionadded:: 2.2.2 +.. currentmodule:: email.mime.application + .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.application` @@ -99,6 +106,8 @@ .. versionadded:: 2.5 +.. currentmodule:: email.mime.audio + .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.audio` @@ -122,6 +131,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.image + .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.image` @@ -145,6 +156,8 @@ *_params* are passed straight through to the :class:`MIMEBase` constructor. +.. currentmodule:: email.mime.message + .. class:: MIMEMessage(_msg[, _subtype]) Module: :mod:`email.mime.message` @@ -158,6 +171,8 @@ :mimetype:`rfc822`. +.. currentmodule:: email.mime.text + .. class:: MIMEText(_text[, _subtype[, _charset]]) Module: :mod:`email.mime.text` Modified: python/branches/release26-maint/Doc/library/json.rst ============================================================================== --- python/branches/release26-maint/Doc/library/json.rst (original) +++ python/branches/release26-maint/Doc/library/json.rst Thu Jan 1 16:46:10 2009 @@ -166,7 +166,7 @@ :func:`dump`. -.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -202,7 +202,7 @@ class. -.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON document) to a Python object. Modified: python/branches/release26-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release26-maint/Doc/library/logging.rst (original) +++ python/branches/release26-maint/Doc/library/logging.rst Thu Jan 1 16:46:10 2009 @@ -553,10 +553,10 @@ #. :class:`HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. -The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the -core logging package. The other handlers are defined in a sub- module, -:mod:`logging.handlers`. (There is also another sub-module, -:mod:`logging.config`, for configuration functionality.) +The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` +classes are defined in the core logging package. The other handlers are +defined in a sub- module, :mod:`logging.handlers`. (There is also another +sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the :class:`Formatter` class. They are initialized with a format string suitable for @@ -1544,6 +1544,8 @@ StreamHandler ^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -2050,6 +2052,8 @@ Formatter Objects ----------------- +.. currentmodule:: logging + :class:`Formatter`\ s have the following attributes and methods. They are responsible for converting a :class:`LogRecord` to (usually) a string which can be interpreted by either a human or an external system. The base Modified: python/branches/release26-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release26-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release26-maint/Doc/library/multiprocessing.rst Thu Jan 1 16:46:10 2009 @@ -358,7 +358,7 @@ .. attribute:: daemon - The process's daemon flag, a Boolean value. This must be called before + The process's daemon flag, a Boolean value. This must be set before :meth:`start` is called. The initial value is inherited from the creating process. @@ -1810,9 +1810,9 @@ filesystem. * An ``'AF_PIPE'`` address is a string of the form - ``r'\\\\.\\pipe\\PipeName'``. To use :func:`Client` to connect to a named + :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called ServerName* one should use an address of the - form ``r'\\\\ServerName\\pipe\\PipeName'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. Modified: python/branches/release26-maint/Doc/library/new.rst ============================================================================== --- python/branches/release26-maint/Doc/library/new.rst (original) +++ python/branches/release26-maint/Doc/library/new.rst Thu Jan 1 16:46:10 2009 @@ -1,4 +1,3 @@ - :mod:`new` --- Creation of runtime internal objects =================================================== @@ -7,7 +6,8 @@ :deprecated: .. deprecated:: 2.6 - The :mod:`new` module has been removed in Python 3.0. + The :mod:`new` module has been removed in Python 3.0. Use the :mod:`types` + module's classes instead. .. sectionauthor:: Moshe Zadka Modified: python/branches/release26-maint/Doc/library/pydoc.rst ============================================================================== --- python/branches/release26-maint/Doc/library/pydoc.rst (original) +++ python/branches/release26-maint/Doc/library/pydoc.rst Thu Jan 1 16:46:10 2009 @@ -36,6 +36,13 @@ Unix), and refers to an existing Python source file, then documentation is produced for that file. +.. note:: + + In order to find objects and their documentation, :mod:`pydoc` imports the + module(s) to be documented. Therefore, any code on module level will be + executed on that occasion. Use an ``if __name__ == '__main__':`` guard to + only execute code when a file is invoked as a script and not just imported. + Specifying a :option:`-w` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text on the console. 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 Thu Jan 1 16:46:10 2009 @@ -448,7 +448,7 @@ if __name__ == "__main__": HOST, PORT = "localhost", 9999 - server = SocketServer.UDPServer((HOST, PORT), BaseUDPRequestHandler) + server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler) server.serve_forever() This is the client side:: 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 Thu Jan 1 16:46:10 2009 @@ -391,23 +391,23 @@ .. method:: OpenerDirector.add_handler(handler) - *handler* should be an instance of :class:`BaseHandler`. The following methods - are searched, and added to the possible chains (note that HTTP errors are a - special case). + *handler* should be an instance of :class:`BaseHandler`. The following + methods are searched, and added to the possible chains (note that HTTP errors + are a special case). - * :meth:`protocol_open` --- signal that the handler knows how to open *protocol* - URLs. + * :samp:`{protocol}_open` --- signal that the handler knows how to open + *protocol* URLs. - * :meth:`http_error_type` --- signal that the handler knows how to handle HTTP - errors with HTTP error code *type*. + * :samp:`http_error_{type}` --- signal that the handler knows how to handle + HTTP errors with HTTP error code *type*. - * :meth:`protocol_error` --- signal that the handler knows how to handle errors - from (non-\ ``http``) *protocol*. + * :samp:`{protocol}_error` --- signal that the handler knows how to handle + errors from (non-\ ``http``) *protocol*. - * :meth:`protocol_request` --- signal that the handler knows how to pre-process - *protocol* requests. + * :samp:`{protocol}_request` --- signal that the handler knows how to + pre-process *protocol* requests. - * :meth:`protocol_response` --- signal that the handler knows how to + * :samp:`{protocol}_response` --- signal that the handler knows how to post-process *protocol* responses. @@ -441,24 +441,24 @@ The order in which these methods are called within each stage is determined by sorting the handler instances. -#. Every handler with a method named like :meth:`protocol_request` has that +#. Every handler with a method named like :samp:`{protocol}_request` has that method called to pre-process the request. -#. Handlers with a method named like :meth:`protocol_open` are called to handle +#. Handlers with a method named like :samp:`{protocol}_open` are called to handle the request. This stage ends when a handler either returns a non-\ :const:`None` value (ie. a response), or raises an exception (usually :exc:`URLError`). Exceptions are allowed to propagate. In fact, the above algorithm is first tried for methods named - :meth:`default_open`. If all such methods return :const:`None`, the algorithm - is repeated for methods named like :meth:`protocol_open`. If all such methods - return :const:`None`, the algorithm is repeated for methods named - :meth:`unknown_open`. + :meth:`default_open`. If all such methods return :const:`None`, the + algorithm is repeated for methods named like :samp:`{protocol}_open`. If all + such methods return :const:`None`, the algorithm is repeated for methods + named :meth:`unknown_open`. Note that the implementation of these methods may involve calls of the parent :class:`OpenerDirector` instance's :meth:`.open` and :meth:`.error` methods. -#. Every handler with a method named like :meth:`protocol_response` has that +#. Every handler with a method named like :samp:`{protocol}_response` has that method called to post-process the response. @@ -514,8 +514,10 @@ .. method:: BaseHandler.protocol_open(req) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to handle URLs with the given protocol. + define it if they want to handle URLs with the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. Return values should be the same as for :meth:`default_open`. @@ -563,8 +565,10 @@ .. method:: BaseHandler.protocol_request(req) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to pre-process requests of the given protocol. + define it if they want to pre-process requests of the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a @@ -574,8 +578,10 @@ .. method:: BaseHandler.protocol_response(req, response) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to post-process responses of the given protocol. + define it if they want to post-process responses of the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. *response* will be an object @@ -660,7 +666,9 @@ .. method:: ProxyHandler.protocol_open(request) :noindex: - The :class:`ProxyHandler` will have a method :meth:`protocol_open` for every + ("protocol" is to be replaced by the protocol name.) + + The :class:`ProxyHandler` will have a method :samp:`{protocol}_open` for every *protocol* which has a proxy in the *proxies* dictionary given in the constructor. The method will modify requests to go through the proxy, by calling ``request.set_proxy()``, and call the next handler in the chain to @@ -865,9 +873,10 @@ For 200 error codes, the response object is returned immediately. For non-200 error codes, this simply passes the job on to the - :meth:`protocol_error_code` handler methods, via :meth:`OpenerDirector.error`. - Eventually, :class:`urllib2.HTTPDefaultErrorHandler` will raise an - :exc:`HTTPError` if no other handler handles the error. + :samp:`{protocol}_error_code` handler methods, via + :meth:`OpenerDirector.error`. Eventually, + :class:`urllib2.HTTPDefaultErrorHandler` will raise an :exc:`HTTPError` if no + other handler handles the error. .. _urllib2-examples: Modified: python/branches/release26-maint/Doc/library/webbrowser.rst ============================================================================== --- python/branches/release26-maint/Doc/library/webbrowser.rst (original) +++ python/branches/release26-maint/Doc/library/webbrowser.rst Thu Jan 1 16:46:10 2009 @@ -172,7 +172,7 @@ Browser Controller Objects -------------------------- -Browser controllers provide two methods which parallel two of the module-level +Browser controllers provide these methods which parallel two of the module-level convenience functions: Modified: python/branches/release26-maint/Doc/library/winsound.rst ============================================================================== --- python/branches/release26-maint/Doc/library/winsound.rst (original) +++ python/branches/release26-maint/Doc/library/winsound.rst Thu Jan 1 16:46:10 2009 @@ -30,8 +30,9 @@ Call the underlying :cfunc:`PlaySound` function from the Platform API. The *sound* parameter may be a filename, audio data as a string, or ``None``. Its interpretation depends on the value of *flags*, which can be a bitwise ORed - combination of the constants described below. If the system indicates an error, - :exc:`RuntimeError` is raised. + combination of the constants described below. If the *sound* parameter is + ``None``, any currently playing waveform sound is stopped. If the system + indicates an error, :exc:`RuntimeError` is raised. .. function:: MessageBeep([type=MB_OK]) @@ -108,6 +109,10 @@ Stop playing all instances of the specified sound. + .. note:: + + This flag is not supported on modern Windows platforms. + .. data:: SND_ASYNC 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 Thu Jan 1 16:46:10 2009 @@ -94,6 +94,16 @@ *events* is a list of events to report back. If omitted, only "end" events are reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs. + .. note:: + + :func:`iterparse` only guarantees that it has seen the ">" + character of a starting tag when it emits a "start" event, so the + attributes are defined, but the contents of the text and tail attributes + are undefined at that point. The same applies to the element children; + they may or may not be present. + + If you need a fully populated element, look for "end" events instead. + .. function:: parse(source[, parser]) Modified: python/branches/release26-maint/Include/unicodeobject.h ============================================================================== --- python/branches/release26-maint/Include/unicodeobject.h (original) +++ python/branches/release26-maint/Include/unicodeobject.h Thu Jan 1 16:46:10 2009 @@ -153,6 +153,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS2_Compare # define PyUnicode_Concat PyUnicodeUCS2_Concat # define PyUnicode_Contains PyUnicodeUCS2_Contains @@ -182,13 +183,13 @@ # define PyUnicode_Find PyUnicodeUCS2_Find # define PyUnicode_Format PyUnicodeUCS2_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS2_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromString PyUnicodeUCS2_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS2_GetMax @@ -209,7 +210,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS2_Fini # define _PyUnicode_Init _PyUnicodeUCS2_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit @@ -240,6 +240,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS4_Compare # define PyUnicode_Concat PyUnicodeUCS4_Concat # define PyUnicode_Contains PyUnicodeUCS4_Contains @@ -269,13 +270,13 @@ # define PyUnicode_Find PyUnicodeUCS4_Find # define PyUnicode_Format PyUnicodeUCS4_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS4_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromString PyUnicodeUCS4_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS4_GetMax @@ -296,7 +297,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS4_Fini # define _PyUnicode_Init _PyUnicodeUCS4_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit Modified: python/branches/release26-maint/Lib/distutils/util.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/util.py (original) +++ python/branches/release26-maint/Lib/distutils/util.py Thu Jan 1 16:46:10 2009 @@ -140,9 +140,13 @@ # 'universal' instead of 'fat'. machine = 'fat' + cflags = get_config_vars().get('CFLAGS') - if '-arch x86_64' in get_config_vars().get('CFLAGS'): - machine = 'universal' + if '-arch x86_64' in cflags: + if '-arch i386' in cflags: + machine = 'universal' + else: + machine = 'fat64' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. Modified: python/branches/release26-maint/Lib/inspect.py ============================================================================== --- python/branches/release26-maint/Lib/inspect.py (original) +++ python/branches/release26-maint/Lib/inspect.py Thu Jan 1 16:46:10 2009 @@ -158,9 +158,8 @@ Generator function objects provides same attributes as functions. See isfunction.__doc__ for attributes listing.""" - if (isfunction(object) or ismethod(object)) and \ - object.func_code.co_flags & CO_GENERATOR: - return True + return bool((isfunction(object) or ismethod(object)) and + object.func_code.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. Modified: python/branches/release26-maint/Lib/pydoc.py ============================================================================== --- python/branches/release26-maint/Lib/pydoc.py (original) +++ python/branches/release26-maint/Lib/pydoc.py Thu Jan 1 16:46:10 2009 @@ -1574,6 +1574,42 @@ 'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'), 'yield': ('yield', ''), } + # Either add symbols to this dictionary or to the symbols dictionary + # directly: Whichever is easier. They are merged later. + _symbols_inverse = { + 'STRINGS' : ("'", "'''", "r'", "u'", '"""', '"', 'r"', 'u"'), + 'OPERATORS' : ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&', + '|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'), + 'COMPARISON' : ('<', '>', '<=', '>=', '==', '!=', '<>'), + 'UNARY' : ('-', '~'), + 'AUGMENTEDASSIGNMENT' : ('+=', '-=', '*=', '/=', '%=', '&=', '|=', + '^=', '<<=', '>>=', '**=', '//='), + 'BITWISE' : ('<<', '>>', '&', '|', '^', '~'), + 'COMPLEX' : ('j', 'J') + } + symbols = { + '%': 'OPERATORS FORMATTING', + '**': 'POWER', + ',': 'TUPLES LISTS FUNCTIONS', + '.': 'ATTRIBUTES FLOAT MODULES OBJECTS', + '...': 'ELLIPSIS', + ':': 'SLICINGS DICTIONARYLITERALS', + '@': 'def class', + '\\': 'STRINGS', + '_': 'PRIVATENAMES', + '__': 'PRIVATENAMES SPECIALMETHODS', + '`': 'BACKQUOTES', + '(': 'TUPLES FUNCTIONS CALLS', + ')': 'TUPLES FUNCTIONS CALLS', + '[': 'LISTS SUBSCRIPTS SLICINGS', + ']': 'LISTS SUBSCRIPTS SLICINGS' + } + for topic, symbols_ in _symbols_inverse.iteritems(): + for symbol in symbols_: + topics = symbols.get(symbol, topic) + if topic not in topics: + topics = topics + ' ' + topic + symbols[symbol] = topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS ' @@ -1717,10 +1753,12 @@ if type(request) is type(''): if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() + elif request == 'symbols': self.listsymbols() elif request == 'topics': self.listtopics() elif request == 'modules': self.listmodules() elif request[:8] == 'modules ': self.listmodules(split(request)[1]) + elif request in self.symbols: self.showsymbol(request) elif request in self.keywords: self.showtopic(request) elif request in self.topics: self.showtopic(request) elif request: doc(request, 'Help on %s:') @@ -1766,6 +1804,14 @@ ''') self.list(self.keywords.keys()) + def listsymbols(self): + self.output.write(''' +Here is a list of the punctuation symbols which Python assigns special meaning +to. Enter any symbol to get more help. + +''') + self.list(self.symbols.keys()) + def listtopics(self): self.output.write(''' Here is a list of available topics. Enter any topic name to get more help. @@ -1773,7 +1819,7 @@ ''') self.list(self.topics.keys()) - def showtopic(self, topic): + def showtopic(self, topic, more_xrefs=''): try: import pydoc_topics except ImportError: @@ -1787,7 +1833,7 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return if type(target) is type(''): - return self.showtopic(target) + return self.showtopic(target, more_xrefs) label, xrefs = target try: @@ -1796,6 +1842,8 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return pager(strip(doc) + '\n') + if more_xrefs: + xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: import StringIO, formatter buffer = StringIO.StringIO() @@ -1803,6 +1851,11 @@ 'Related help topics: ' + join(split(xrefs), ', ') + '\n') self.output.write('\n%s\n' % buffer.getvalue()) + def showsymbol(self, symbol): + target = self.symbols[symbol] + topic, _, xrefs = target.partition(' ') + self.showtopic(topic, xrefs) + def listmodules(self, key=''): if key: self.output.write(''' Modified: python/branches/release26-maint/Lib/re.py ============================================================================== --- python/branches/release26-maint/Lib/re.py (original) +++ python/branches/release26-maint/Lib/re.py Thu Jan 1 16:46:10 2009 @@ -145,7 +145,8 @@ """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; - if a callable, it's passed the match object and must return + if a string, backslash escapes in it are processed. If it is + a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).sub(repl, string, count) @@ -155,7 +156,8 @@ non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a string or a - callable; if a callable, it's passed the match object and must + callable; if a string, backslash escapes in it are processed. + If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).subn(repl, string, count) Modified: python/branches/release26-maint/Lib/test/test_deque.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_deque.py (original) +++ python/branches/release26-maint/Lib/test/test_deque.py Thu Jan 1 16:46:10 2009 @@ -1,7 +1,8 @@ from collections import deque import unittest from test import test_support, seq_tests -from weakref import proxy +import gc +import weakref import copy import cPickle as pickle import random @@ -418,6 +419,22 @@ d.append(1) gc.collect() + def test_container_iterator(self): + # Bug # XXX: tp_traverse was not implemented for deque iterator objects + class C(object): + pass + for i in range(2): + obj = C() + ref = weakref.ref(obj) + if i == 0: + container = deque([obj, 1]) + else: + container = reversed(deque([obj, 1])) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): @@ -528,7 +545,7 @@ def test_weakref(self): d = deque('gallahad') - p = proxy(d) + p = weakref.proxy(d) self.assertEqual(str(p), str(d)) d = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/release26-maint/Lib/test/test_dict.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_dict.py (original) +++ python/branches/release26-maint/Lib/test/test_dict.py Thu Jan 1 16:46:10 2009 @@ -2,6 +2,7 @@ from test import test_support import UserDict, random, string +import gc, weakref class DictTest(unittest.TestCase): @@ -554,6 +555,19 @@ pass d = {} + def test_container_iterator(self): + # Bug # XXX: tp_traverse was not implemented for dictiter objects + class C(object): + pass + iterators = (dict.iteritems, dict.itervalues, dict.iterkeys) + for i in iterators: + obj = C() + ref = weakref.ref(obj) + container = {obj: 1} + obj.x = i(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") from test import mapping_tests Modified: python/branches/release26-maint/Lib/test/test_file.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_file.py (original) +++ python/branches/release26-maint/Lib/test/test_file.py Thu Jan 1 16:46:10 2009 @@ -125,6 +125,19 @@ class OtherFileTests(unittest.TestCase): + def testOpenDir(self): + this_dir = os.path.dirname(__file__) + for mode in (None, "w"): + try: + if mode: + f = open(this_dir, mode) + else: + f = open(this_dir) + except IOError as e: + self.assertEqual(e.filename, this_dir) + else: + self.fail("opening a directory didn't raise an IOError") + def testModeStrings(self): # check invalid mode strings for mode in ("", "aU", "wU+"): Modified: python/branches/release26-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fileio.py (original) +++ python/branches/release26-maint/Lib/test/test_fileio.py Thu Jan 1 16:46:10 2009 @@ -109,6 +109,7 @@ _fileio._FileIO('.', 'r') except IOError as e: self.assertNotEqual(e.errno, 0) + self.assertEqual(e.filename, ".") else: self.fail("Should have raised IOError") Modified: python/branches/release26-maint/Lib/test/test_set.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_set.py (original) +++ python/branches/release26-maint/Lib/test/test_set.py Thu Jan 1 16:46:10 2009 @@ -1,6 +1,7 @@ import unittest from test import test_support -from weakref import proxy +import gc +import weakref import operator import copy import pickle @@ -322,6 +323,18 @@ self.assertEqual(sum(elem.hash_count for elem in d), n) self.assertEqual(d3, dict.fromkeys(d, 123)) + def test_container_iterator(self): + # Bug # XXX: tp_traverse was not implemented for set iterator object + class C(object): + pass + obj = C() + ref = weakref.ref(obj) + container = set([obj, 1]) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestSet(TestJointOps): thetype = set @@ -538,7 +551,7 @@ def test_weakref(self): s = self.thetype('gallahad') - p = proxy(s) + p = weakref.proxy(s) self.assertEqual(str(p), str(s)) s = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/release26-maint/Lib/test/test_struct.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_struct.py (original) +++ python/branches/release26-maint/Lib/test/test_struct.py Thu Jan 1 16:46:10 2009 @@ -2,6 +2,8 @@ import unittest import struct import warnings +warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated", + DeprecationWarning) from functools import wraps from test.test_support import TestFailed, verbose, run_unittest @@ -461,6 +463,11 @@ self.check_float_coerce(endian + fmt, 1.0) self.check_float_coerce(endian + fmt, 1.5) + def test_issue4228(self): + # Packing a long may yield either 32 or 64 bits + x = struct.pack('L', -1)[:4] + self.assertEqual(x, '\xff'*4) + def test_unpack_from(self): test_string = 'abcd01234' fmt = '4s' Modified: python/branches/release26-maint/Lib/textwrap.py ============================================================================== --- python/branches/release26-maint/Lib/textwrap.py (original) +++ python/branches/release26-maint/Lib/textwrap.py Thu Jan 1 16:46:10 2009 @@ -84,7 +84,7 @@ # splits into # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option! # (after stripping out empty strings). - wordsep_re = ( + wordsep_re = re.compile( r'(\s+|' # any whitespace r'[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|' # hyphenated words r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash @@ -93,7 +93,7 @@ # "Hello there -- you goof-ball, use the -b option!" # splits into # Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/ - wordsep_simple_re = r'(\s+)' + wordsep_simple_re = re.compile(r'(\s+)') # XXX this is not locale- or charset-aware -- string.lowercase # is US-ASCII only (and therefore English-only) @@ -124,6 +124,13 @@ self.drop_whitespace = drop_whitespace self.break_on_hyphens = break_on_hyphens + # recompile the regexes for Unicode mode -- done in this clumsy way for + # backwards compatibility because it's rather common to monkey-patch + # the TextWrapper class' wordsep_re attribute. + self.wordsep_re_uni = re.compile(self.wordsep_re.pattern, re.U) + self.wordsep_simple_re_uni = re.compile( + self.wordsep_simple_re.pattern, re.U) + # -- Private methods ----------------------------------------------- # (possibly useful for subclasses to override) @@ -160,12 +167,17 @@ 'use', ' ', 'the', ' ', '-b', ' ', option!' otherwise. """ - flags = re.UNICODE if isinstance(text, unicode) else 0 - if self.break_on_hyphens: - pat = self.wordsep_re + if isinstance(text, unicode): + if self.break_on_hyphens: + pat = self.wordsep_re_uni + else: + pat = self.wordsep_simple_re_uni else: - pat = self.wordsep_simple_re - chunks = re.compile(pat, flags).split(text) + if self.break_on_hyphens: + pat = self.wordsep_re + else: + pat = self.wordsep_simple_re + chunks = pat.split(text) chunks = filter(None, chunks) # remove empty chunks return chunks Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Jan 1 16:46:10 2009 @@ -12,9 +12,21 @@ Core and Builtins ----------------- +- Issue #3680: Reference cycles created through a dict, set or deque iterator + did not get collected. + - Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types where the tp_hash and tp_dict slots are both NULL. +- Issue #4764: With io.open, IOError.filename is set when trying to open a + directory on POSIX systems. + +- Issue #4764: IOError.filename is set when trying to open a directory on POSIX + systems. + +- Issue #4759: None is now allowed as the first argument of + bytearray.translate(). It was always allowed for bytes.translate(). + - Issue #4759: fix a segfault for bytearray.translate(x, None). - Added test case to ensure attempts to read from a file opened for writing @@ -138,9 +150,18 @@ Library ------- +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey. + - Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') + works as expected in the interactive environment. + +- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by + Gabriel Genellina. + - Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. @@ -206,9 +227,16 @@ - Issue #4730: Fixed the cPickle module to handle correctly astral characters when protocol 0 is used. +Tools/Demos +----------- + +- Issue #4677: add two list comprehension tests to pybench. + Build ----- +- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. + - Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". - Issue #4289: Remove Cancel button from AdvancedDlg. @@ -239,6 +267,10 @@ Extension Modules ----------------- +- Issue #4228: Pack negative values the same way as 2.4 in struct's L format. + +- Issue #1040026: Fix os.times result on systems where HZ is incorrect. + - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, OpenBSD. Modified: python/branches/release26-maint/Modules/_collectionsmodule.c ============================================================================== --- python/branches/release26-maint/Modules/_collectionsmodule.c (original) +++ python/branches/release26-maint/Modules/_collectionsmodule.c Thu Jan 1 16:46:10 2009 @@ -958,7 +958,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequeiter_type); + it = PyObject_GC_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; @@ -967,14 +967,22 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } +static int +dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg) +{ + Py_VISIT(dio->deque); + return 0; +} + static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); - Py_TYPE(dio)->tp_free(dio); + PyObject_GC_Del(dio); } static PyObject * @@ -1039,9 +1047,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -1060,7 +1068,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequereviter_type); + it = PyObject_GC_New(dequeiterobject, &dequereviter_type); if (it == NULL) return NULL; it->b = deque->rightblock; @@ -1069,6 +1077,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } @@ -1121,9 +1130,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/release26-maint/Modules/_fileio.c ============================================================================== --- python/branches/release26-maint/Modules/_fileio.c (original) +++ python/branches/release26-maint/Modules/_fileio.c Thu Jan 1 16:46:10 2009 @@ -98,7 +98,7 @@ directories, so we need a check. */ static int -dircheck(PyFileIOObject* self) +dircheck(PyFileIOObject* self, char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -109,8 +109,8 @@ PyObject *exc; internal_close(self); - exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + exc = PyObject_CallFunction(PyExc_IOError, "(iss)", + EISDIR, msg, name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return -1; @@ -271,7 +271,7 @@ #endif goto error; } - if(dircheck(self) < 0) + if(dircheck(self, name) < 0) goto error; } Modified: python/branches/release26-maint/Modules/_struct.c ============================================================================== --- python/branches/release26-maint/Modules/_struct.c (original) +++ python/branches/release26-maint/Modules/_struct.c Thu Jan 1 16:46:10 2009 @@ -663,7 +663,7 @@ return -1; #if (SIZEOF_LONG > SIZEOF_INT) if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX))) - return _range_error(f, 0); + RANGE_ERROR(x, f, 0, -1); #endif y = (int)x; memcpy(p, (char *)&y, sizeof y); @@ -675,12 +675,12 @@ { unsigned long x; unsigned int y; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; y = (unsigned int)x; #if (SIZEOF_LONG > SIZEOF_INT) if (x > ((unsigned long)UINT_MAX)) - return _range_error(f, 1); + RANGE_ERROR(y, f, 1, -1); #endif memcpy(p, (char *)&y, sizeof y); return 0; @@ -700,8 +700,8 @@ np_ulong(char *p, PyObject *v, const formatdef *f) { unsigned long x; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; memcpy(p, (char *)&x, sizeof x); return 0; } Modified: python/branches/release26-maint/Objects/dictobject.c ============================================================================== --- python/branches/release26-maint/Objects/dictobject.c (original) +++ python/branches/release26-maint/Objects/dictobject.c Thu Jan 1 16:46:10 2009 @@ -2331,7 +2331,7 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; - di = PyObject_New(dictiterobject, itertype); + di = PyObject_GC_New(dictiterobject, itertype); if (di == NULL) return NULL; Py_INCREF(dict); @@ -2348,6 +2348,7 @@ } else di->di_result = NULL; + _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -2356,7 +2357,15 @@ { Py_XDECREF(di->di_dict); Py_XDECREF(di->di_result); - PyObject_Del(di); + PyObject_GC_Del(di); +} + +static int +dictiter_traverse(dictiterobject *di, visitproc visit, void *arg) +{ + Py_VISIT(di->di_dict); + Py_VISIT(di->di_result); + return 0; } static PyObject * @@ -2435,9 +2444,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2507,9 +2516,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2593,9 +2602,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/release26-maint/Objects/fileobject.c ============================================================================== --- python/branches/release26-maint/Objects/fileobject.c (original) +++ python/branches/release26-maint/Objects/fileobject.c Thu Jan 1 16:46:10 2009 @@ -132,8 +132,8 @@ if (fstat(fileno(f->f_fp), &buf) == 0 && S_ISDIR(buf.st_mode)) { char *msg = strerror(EISDIR); - PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)", + EISDIR, msg, f->f_name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return NULL; Modified: python/branches/release26-maint/Objects/setobject.c ============================================================================== --- python/branches/release26-maint/Objects/setobject.c (original) +++ python/branches/release26-maint/Objects/setobject.c Thu Jan 1 16:46:10 2009 @@ -810,7 +810,14 @@ setiter_dealloc(setiterobject *si) { Py_XDECREF(si->si_set); - PyObject_Del(si); + PyObject_GC_Del(si); +} + +static int +setiter_traverse(setiterobject *si, visitproc visit, void *arg) +{ + Py_VISIT(si->si_set); + return 0; } static PyObject * @@ -888,9 +895,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)setiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -903,7 +910,7 @@ static PyObject * set_iter(PySetObject *so) { - setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type); + setiterobject *si = PyObject_GC_New(setiterobject, &PySetIter_Type); if (si == NULL) return NULL; Py_INCREF(so); @@ -911,6 +918,7 @@ si->si_used = so->used; si->si_pos = 0; si->len = so->used; + _PyObject_GC_TRACK(si); return (PyObject *)si; } Modified: python/branches/release26-maint/Tools/pybench/Lists.py ============================================================================== --- python/branches/release26-maint/Tools/pybench/Lists.py (original) +++ python/branches/release26-maint/Tools/pybench/Lists.py Thu Jan 1 16:46:10 2009 @@ -293,3 +293,58 @@ for i in xrange(self.rounds): pass + +class SimpleListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + n = range(10) * 10 + + for i in xrange(self.rounds): + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + def calibrate(self): + + n = range(10) * 10 + + for i in xrange(self.rounds): + pass + +class NestedListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + m = range(10) + n = range(10) + + for i in xrange(self.rounds): + l = [x for x in n for y in m] + l = [y for x in n for y in m] + + l = [x for x in n for y in m if y] + l = [y for x in n for y in m if x] + + l = [x for x in n for y in m if not y] + l = [y for x in n for y in m if not x] + + def calibrate(self): + + m = range(10) + n = range(10) + + for i in xrange(self.rounds): + pass From python-checkins at python.org Thu Jan 1 16:49:47 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 16:49:47 +0100 (CET) Subject: [Python-checkins] r68136 - python/branches/py3k Message-ID: <20090101154947.668291E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 16:49:47 2009 New Revision: 68136 Log: Blocked revisions 67967,67980 via svnmerge ........ r67967 | benjamin.peterson | 2008-12-27 23:18:58 +0100 (Sat, 27 Dec 2008) | 1 line fix markup ........ r67980 | antoine.pitrou | 2008-12-28 15:24:29 +0100 (Sun, 28 Dec 2008) | 1 line wrong version number in doc changes committed in r67979 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Jan 1 16:53:14 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 16:53:14 +0100 (CET) Subject: [Python-checkins] r68137 - in python/branches/py3k: Lib/pydoc.py Misc/NEWS Message-ID: <20090101155314.6EB101E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 16:53:14 2009 New Revision: 68137 Log: Merged revisions 67953 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67953 | georg.brandl | 2008-12-27 19:20:04 +0100 (Sat, 27 Dec 2008) | 3 lines Patch #4739 by David Laban: add symbols to pydoc help topics, so that ``help('@')`` works as expected. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/pydoc.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/pydoc.py ============================================================================== --- python/branches/py3k/Lib/pydoc.py (original) +++ python/branches/py3k/Lib/pydoc.py Thu Jan 1 16:53:14 2009 @@ -1568,6 +1568,42 @@ 'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'), 'yield': ('yield', ''), } + # Either add symbols to this dictionary or to the symbols dictionary + # directly: Whichever is easier. They are merged later. + _symbols_inverse = { + 'STRINGS' : ("'", "'''", "r'", "b'", '"""', '"', 'r"', 'b"'), + 'OPERATORS' : ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&', + '|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'), + 'COMPARISON' : ('<', '>', '<=', '>=', '==', '!=', '<>'), + 'UNARY' : ('-', '~'), + 'AUGMENTEDASSIGNMENT' : ('+=', '-=', '*=', '/=', '%=', '&=', '|=', + '^=', '<<=', '>>=', '**=', '//='), + 'BITWISE' : ('<<', '>>', '&', '|', '^', '~'), + 'COMPLEX' : ('j', 'J') + } + symbols = { + '%': 'OPERATORS FORMATTING', + '**': 'POWER', + ',': 'TUPLES LISTS FUNCTIONS', + '.': 'ATTRIBUTES FLOAT MODULES OBJECTS', + '...': 'ELLIPSIS', + ':': 'SLICINGS DICTIONARYLITERALS', + '@': 'def class', + '\\': 'STRINGS', + '_': 'PRIVATENAMES', + '__': 'PRIVATENAMES SPECIALMETHODS', + '`': 'BACKQUOTES', + '(': 'TUPLES FUNCTIONS CALLS', + ')': 'TUPLES FUNCTIONS CALLS', + '[': 'LISTS SUBSCRIPTS SLICINGS', + ']': 'LISTS SUBSCRIPTS SLICINGS' + } + for topic, symbols_ in _symbols_inverse.items(): + for symbol in symbols_: + topics = symbols.get(symbol, topic) + if topic not in topics: + topics = topics + ' ' + topic + symbols[symbol] = topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS ' @@ -1705,10 +1741,12 @@ if type(request) is type(''): if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() + elif request == 'symbols': self.listsymbols() elif request == 'topics': self.listtopics() elif request == 'modules': self.listmodules() elif request[:8] == 'modules ': self.listmodules(request.split()[1]) + elif request in self.symbols: self.showsymbol(request) elif request in self.keywords: self.showtopic(request) elif request in self.topics: self.showtopic(request) elif request: doc(request, 'Help on %s:') @@ -1753,6 +1791,14 @@ ''') self.list(self.keywords.keys()) + def listsymbols(self): + self.output.write(''' +Here is a list of the punctuation symbols which Python assigns special meaning +to. Enter any symbol to get more help. + +''') + self.list(self.symbols.keys()) + def listtopics(self): self.output.write(''' Here is a list of available topics. Enter any topic name to get more help. @@ -1760,7 +1806,7 @@ ''') self.list(self.topics.keys()) - def showtopic(self, topic): + def showtopic(self, topic, more_xrefs=''): try: import pydoc_topics except ImportError: @@ -1774,7 +1820,7 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return if type(target) is type(''): - return self.showtopic(target) + return self.showtopic(target, more_xrefs) label, xrefs = target try: @@ -1783,6 +1829,8 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return pager(doc.strip() + '\n') + if more_xrefs: + xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: import io, formatter buffer = io.StringIO() @@ -1790,6 +1838,11 @@ 'Related help topics: ' + ', '.join(xrefs.split()) + '\n') self.output.write('\n%s\n' % buffer.getvalue()) + def showsymbol(self, symbol): + target = self.symbols[symbol] + topic, _, xrefs = target.partition(' ') + self.showtopic(topic, xrefs) + def listmodules(self, key=''): if key: self.output.write(''' Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 1 16:53:14 2009 @@ -83,6 +83,9 @@ - Issue #4444: Allow assertRaises() to be used as a context handler, so that the code under test can be written inline if more practical. +- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') + works as expected in the interactive environment. + - Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by Gabriel Genellina. From python-checkins at python.org Thu Jan 1 16:55:56 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 1 Jan 2009 16:55:56 +0100 (CET) Subject: [Python-checkins] r68138 - python/branches/py3k Message-ID: <20090101155556.D471C1E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 1 16:55:56 2009 New Revision: 68138 Log: Blocked revisions 67955 via svnmerge ........ r67955 | georg.brandl | 2008-12-27 19:27:53 +0100 (Sat, 27 Dec 2008) | 3 lines Follow-up to r67746 in order to restore backwards-compatibility for those who (monkey-)patch TextWrapper.wordsep_re with a custom RE. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Thu Jan 1 16:58:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 15:58:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090101155840.19DD51E4002@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/43 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 python-checkins at python.org Thu Jan 1 17:03:47 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Thu, 1 Jan 2009 17:03:47 +0100 (CET) Subject: [Python-checkins] r68139 - in python/branches/py3k: Misc/NEWS Modules/_fileio.c Message-ID: <20090101160347.5446D1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Thu Jan 1 17:03:45 2009 New Revision: 68139 Log: Merged revisions 68134 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68134 | hirokazu.yamamoto | 2009-01-02 00:45:39 +0900 | 2 lines Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_fileio.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 1 17:03:45 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open + file with `str' filename on Windows. + - Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Thu Jan 1 17:03:45 2009 @@ -284,10 +284,11 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } if(dircheck(self, name) < 0) From python-checkins at python.org Thu Jan 1 17:09:52 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Thu, 1 Jan 2009 17:09:52 +0100 (CET) Subject: [Python-checkins] r68140 - python/branches/py3k/Misc/NEWS Message-ID: <20090101160952.F2D211E4002@bag.python.org> Author: hirokazu.yamamoto Date: Thu Jan 1 17:09:52 2009 New Revision: 68140 Log: News fix. On py3k, `str' is unicode. should use `bytes'. Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 1 17:09:52 2009 @@ -13,7 +13,7 @@ ----------------- - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open - file with `str' filename on Windows. + file with `bytes' filename on Windows. - Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. From buildbot at python.org Thu Jan 1 17:38:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 16:38:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090101163824.E2FBE1E4002@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/18 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: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Thu Jan 1 17:43:12 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 17:43:12 +0100 (CET) Subject: [Python-checkins] r68141 - python/trunk/Doc/library/itertools.rst Message-ID: <20090101164312.6A5E01E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 17:43:12 2009 New Revision: 68141 Log: fix highlighting 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 Thu Jan 1 17:43:12 2009 @@ -547,7 +547,7 @@ .. doctest:: - # Show a dictionary sorted and grouped by value + >>> # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.iteritems(), key=itemgetter(1)) @@ -558,9 +558,9 @@ 2 ['b', 'd', 'f'] 3 ['g'] - # Find runs of consecutive numbers using groupby. The key to the solution - # is differencing with a range so that consecutive numbers all appear in - # same group. + >>> # Find runs of consecutive numbers using groupby. The key to the solution + >>> # is differencing with a range so that consecutive numbers all appear in + >>> # same group. >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x): ... print map(itemgetter(1), g) From python-checkins at python.org Thu Jan 1 18:29:51 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 1 Jan 2009 18:29:51 +0100 (CET) Subject: [Python-checkins] r68142 - in python/trunk: Doc/license.rst LICENSE Python/getcopyright.c README Message-ID: <20090101172951.863701E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 1 18:29:49 2009 New Revision: 68142 Log: welcome to 2009, Python! Modified: python/trunk/Doc/license.rst python/trunk/LICENSE python/trunk/Python/getcopyright.c python/trunk/README Modified: python/trunk/Doc/license.rst ============================================================================== --- python/trunk/Doc/license.rst (original) +++ python/trunk/Doc/license.rst Thu Jan 1 18:29:49 2009 @@ -124,7 +124,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ? 2001-2008 Python Software Foundation; All Rights + copyright, i.e., "Copyright ? 2001-2009 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. Modified: python/trunk/LICENSE ============================================================================== --- python/trunk/LICENSE (original) +++ python/trunk/LICENSE Thu Jan 1 18:29:49 2009 @@ -88,15 +88,14 @@ otherwise using this software ("Python") in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative -version prepared by Licensee. +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python +Software Foundation; All Rights Reserved" are retained in Python alone or in any +derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/trunk/Python/getcopyright.c ============================================================================== --- python/trunk/Python/getcopyright.c (original) +++ python/trunk/Python/getcopyright.c Thu Jan 1 18:29:49 2009 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Thu Jan 1 18:29:49 2009 @@ -1,7 +1,7 @@ This is Python version 2.7 alpha 0 ================================== -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 buildbot at python.org Thu Jan 1 19:05:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 01 Jan 2009 18:05:38 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090101180538.ABCD51E4036@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/45 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,hirokazu.yamamoto 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 mal at egenix.com Thu Jan 1 22:29:37 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 01 Jan 2009 22:29:37 +0100 Subject: [Python-checkins] r68092 - python/trunk/Lib/ssl.py In-Reply-To: <20081231040855.B409E1E4002@bag.python.org> References: <20081231040855.B409E1E4002@bag.python.org> Message-ID: <495D35C1.6060804@egenix.com> On 2008-12-31 05:08, benjamin.peterson wrote: > Author: benjamin.peterson > Date: Wed Dec 31 05:08:55 2008 > New Revision: 68092 > > Log: > fix name collision issues > > Modified: > python/trunk/Lib/ssl.py > > Modified: python/trunk/Lib/ssl.py > ============================================================================== > --- python/trunk/Lib/ssl.py (original) > +++ python/trunk/Lib/ssl.py Wed Dec 31 05:08:55 2008 > @@ -74,7 +74,7 @@ > SSL_ERROR_EOF, \ > SSL_ERROR_INVALID_ERROR_CODE > > -from socket import socket, _fileobject > +from socket import socket, _fileobject, error as socket_error > from socket import getnameinfo as _getnameinfo I'd suggest you remove all these direct imports and replace them with a single "import socket" and proper references to the module attribute where needed. It's probably also better to replace the variable name "socket" with something different. Otherwise, we'll end up reintroducing such naming collisions. > import base64 # for DER-to-PEM translation > > @@ -103,7 +103,7 @@ > # see if it's connected > try: > socket.getpeername(self) > - except socket.error: > + except socket_error: > # no, no connection yet > self._sslobj = None > else: > @@ -441,7 +441,7 @@ > PROTOCOL_SSLv23, None) > try: > sock.getpeername() > - except socket.error: > + except socket_error: > # no, no connection yet > pass > else: > _______________________________________________ > 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, Jan 01 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 Fri Jan 2 00:05:36 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 2 Jan 2009 00:05:36 +0100 (CET) Subject: [Python-checkins] r68143 - in python/branches/py3k: Misc/NEWS Modules/main.c Message-ID: <20090101230536.E5D921E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Jan 2 00:05:36 2009 New Revision: 68143 Log: #4747: on Windows, starting a module with a non-ascii filename would print a useless "SyntaxError: None" when the script contains a "# coding:" declaration. The Python API expects char* to be utf-8 encoded. wcstombs should be avoided here. Reviewed by Benjamin. Will backport to 3.0 Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/main.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 2 00:05:36 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4747: When the terminal does not use utf-8, executing a script with + non-ascii characters in its name could fail with a "SyntaxError: None" error. + - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `bytes' filename on Windows. Modified: python/branches/py3k/Modules/main.c ============================================================================== --- python/branches/py3k/Modules/main.c (original) +++ python/branches/py3k/Modules/main.c Fri Jan 2 00:05:36 2009 @@ -600,18 +600,21 @@ } if (sts==-1) { - char cfilename[PATH_MAX]; + PyObject *filenameObj = NULL; char *p_cfilename = ""; if (filename) { - size_t r = wcstombs(cfilename, filename, PATH_MAX); - p_cfilename = cfilename; - if (r == (size_t)-1 || r >= PATH_MAX) + filenameObj = PyUnicode_FromWideChar( + filename, wcslen(filename)); + if (filenameObj != NULL) + p_cfilename = _PyUnicode_AsString(filenameObj); + else p_cfilename = ""; } sts = PyRun_AnyFileExFlags( fp, p_cfilename, filename != NULL, &cf) != 0; + Py_XDECREF(filenameObj); } } From python-checkins at python.org Fri Jan 2 00:07:21 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 2 Jan 2009 00:07:21 +0100 (CET) Subject: [Python-checkins] r68144 - in python/branches/release30-maint: Misc/NEWS Modules/main.c Message-ID: <20090101230721.5F2F81E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Jan 2 00:07:21 2009 New Revision: 68144 Log: Merged revisions 68143 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68143 | amaury.forgeotdarc | 2009-01-02 00:05:36 +0100 (ven., 02 janv. 2009) | 7 lines #4747: on Windows, starting a module with a non-ascii filename would print a useless "SyntaxError: None" when the script contains a "# coding:" declaration. The Python API expects char* to be utf-8 encoded. wcstombs should be avoided here. Reviewed by Benjamin. Will backport to 3.0 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/main.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Jan 2 00:07:21 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4747: When the terminal does not use utf-8, executing a script with + non-ascii characters in its name could fail with a "SyntaxError: None" error. + - Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types where the tp_hash and tp_dict slots are both NULL. Modified: python/branches/release30-maint/Modules/main.c ============================================================================== --- python/branches/release30-maint/Modules/main.c (original) +++ python/branches/release30-maint/Modules/main.c Fri Jan 2 00:07:21 2009 @@ -600,18 +600,21 @@ } if (sts==-1) { - char cfilename[PATH_MAX]; + PyObject *filenameObj = NULL; char *p_cfilename = ""; if (filename) { - size_t r = wcstombs(cfilename, filename, PATH_MAX); - p_cfilename = cfilename; - if (r == (size_t)-1 || r >= PATH_MAX) + filenameObj = PyUnicode_FromWideChar( + filename, wcslen(filename)); + if (filenameObj != NULL) + p_cfilename = _PyUnicode_AsString(filenameObj); + else p_cfilename = ""; } sts = PyRun_AnyFileExFlags( fp, p_cfilename, filename != NULL, &cf) != 0; + Py_XDECREF(filenameObj); } } From benjamin at python.org Fri Jan 2 00:37:27 2009 From: benjamin at python.org (Benjamin Peterson) Date: Thu, 1 Jan 2009 17:37:27 -0600 Subject: [Python-checkins] r68092 - python/trunk/Lib/ssl.py In-Reply-To: <495D35C1.6060804@egenix.com> References: <20081231040855.B409E1E4002@bag.python.org> <495D35C1.6060804@egenix.com> Message-ID: <1afaf6160901011537u5f419ce4sf45322cb2cede8a6@mail.gmail.com> On Thu, Jan 1, 2009 at 3:29 PM, M.-A. Lemburg wrote: > > I'd suggest you remove all these direct imports and replace > them with a single "import socket" and proper references to > the module attribute where needed. > > It's probably also better to replace the variable name "socket" > with something different. Otherwise, we'll end up reintroducing > such naming collisions. That's a good idea. It's not my library, so I didn't want to be too invasive. You should probably write a tracker ticket and assign it to Bill. -- Regards, Benjamin Peterson From python-checkins at python.org Fri Jan 2 01:03:54 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 2 Jan 2009 01:03:54 +0100 (CET) Subject: [Python-checkins] r68145 - python/trunk/Modules/_collectionsmodule.c Message-ID: <20090102000354.BCF451E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Jan 2 01:03:54 2009 New Revision: 68145 Log: #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. Modified: python/trunk/Modules/_collectionsmodule.c Modified: python/trunk/Modules/_collectionsmodule.c ============================================================================== --- python/trunk/Modules/_collectionsmodule.c (original) +++ python/trunk/Modules/_collectionsmodule.c Fri Jan 2 01:03:54 2009 @@ -967,7 +967,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } @@ -1077,7 +1077,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } From buildbot at python.org Fri Jan 2 08:01:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 07:01:29 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.x Message-ID: <20090102070129.A38A91E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.x/builds/29 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_cmd_line_script make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Fri Jan 2 11:32:25 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 2 Jan 2009 05:32:25 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090102103225.GA21546@python.psfb.org> svn update tools/sphinx At revision 68145. svn update tools/docutils At revision 68145. svn update tools/jinja At revision 68145. svn update tools/pygments At revision 68145. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html Exception occurred: File "/home/neal/python/trunk/Doc/tools/sphinx/jinja/loaders.py", line 20, in from jinja.utils import CacheDict, raise_syntax_error ImportError: cannot import name raise_syntax_error The full traceback has been saved in /tmp/sphinx-err-xG5zQy.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-dev at googlegroups.com. Thanks! make: *** [build] Error 1 From python-checkins at python.org Fri Jan 2 11:44:46 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 11:44:46 +0100 (CET) Subject: [Python-checkins] r68146 - in python/trunk: Makefile.pre.in configure configure.in Message-ID: <20090102104446.8847D1E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 11:44:46 2009 New Revision: 68146 Log: Fix for issue4472: "configure --enable-shared doesn't work on OSX" Modified: python/trunk/Makefile.pre.in python/trunk/configure python/trunk/configure.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Fri Jan 2 11:44:46 2009 @@ -414,10 +414,14 @@ if test $(INSTSONAME) != $(LDLIBRARY); then \ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ - else\ + else \ $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi +libpython$(VERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) @@ -768,13 +772,13 @@ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) - if test -f libpython$(VERSION)$(SO); then \ + if test -f $(LDLIBRARY); then \ if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ else \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ - if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ - (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Fri Jan 2 11:44:46 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67227 . +# From configure.in Revision: 67463 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -4139,6 +4139,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -13003,6 +13009,7 @@ { echo "$as_me:$LINENO: result: $SO" >&5 echo "${ECHO_T}$SO" >&6; } + cat >>confdefs.h <<_ACEOF #define SHLIB_EXT "$SO" _ACEOF @@ -13403,7 +13410,7 @@ fi # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Fri Jan 2 11:44:46 2009 @@ -737,6 +737,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -1597,6 +1603,7 @@ sleep 10 fi AC_MSG_RESULT($SO) + AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 From python-checkins at python.org Fri Jan 2 11:46:42 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 11:46:42 +0100 (CET) Subject: [Python-checkins] r68147 - in python/branches/release26-maint: Makefile.pre.in configure configure.in Message-ID: <20090102104642.86D371E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 11:46:42 2009 New Revision: 68147 Log: Backport of r68146 Modified: python/branches/release26-maint/Makefile.pre.in python/branches/release26-maint/configure python/branches/release26-maint/configure.in Modified: python/branches/release26-maint/Makefile.pre.in ============================================================================== --- python/branches/release26-maint/Makefile.pre.in (original) +++ python/branches/release26-maint/Makefile.pre.in Fri Jan 2 11:46:42 2009 @@ -414,10 +414,14 @@ if test $(INSTSONAME) != $(LDLIBRARY); then \ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ - else\ + else \ $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi +libpython$(VERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) @@ -768,13 +772,13 @@ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) - if test -f libpython$(VERSION)$(SO); then \ + if test -f $(LDLIBRARY); then \ if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ else \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ - if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ - (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ Modified: python/branches/release26-maint/configure ============================================================================== --- python/branches/release26-maint/configure (original) +++ python/branches/release26-maint/configure Fri Jan 2 11:46:42 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67229 . +# From configure.in Revision: 67565 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -4139,6 +4139,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -13003,6 +13009,7 @@ { echo "$as_me:$LINENO: result: $SO" >&5 echo "${ECHO_T}$SO" >&6; } + cat >>confdefs.h <<_ACEOF #define SHLIB_EXT "$SO" _ACEOF @@ -13403,7 +13410,7 @@ fi # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } Modified: python/branches/release26-maint/configure.in ============================================================================== --- python/branches/release26-maint/configure.in (original) +++ python/branches/release26-maint/configure.in Fri Jan 2 11:46:42 2009 @@ -737,6 +737,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -1597,6 +1603,7 @@ sleep 10 fi AC_MSG_RESULT($SO) + AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 From python-checkins at python.org Fri Jan 2 11:48:31 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 11:48:31 +0100 (CET) Subject: [Python-checkins] r68148 - python/trunk/Misc/NEWS Message-ID: <20090102104831.5B7BB1E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 11:48:31 2009 New Revision: 68148 Log: Forgot to add a NEWS item in my previous checkin Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 11:48:31 2009 @@ -232,6 +232,8 @@ Build ----- +- Issue #4472: "configure --enable-shared" now works on OSX + - Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. - Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". From python-checkins at python.org Fri Jan 2 11:50:48 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 11:50:48 +0100 (CET) Subject: [Python-checkins] r68149 - python/trunk/Makefile.pre.in Message-ID: <20090102105048.6DFD81E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 11:50:48 2009 New Revision: 68149 Log: Fix for issue4780 Modified: python/trunk/Makefile.pre.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Fri Jan 2 11:50:48 2009 @@ -909,7 +909,7 @@ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(BUILDEXE)"; \ - cd $(srcdir)/Lib/$(PLATDIR); ./regen + cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) From python-checkins at python.org Fri Jan 2 12:46:05 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 12:46:05 +0100 (CET) Subject: [Python-checkins] r68150 - in python/trunk/Mac: IDLE/Makefile.in PythonLauncher/Makefile.in Message-ID: <20090102114605.A95101E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 12:46:05 2009 New Revision: 68150 Log: Fix for issue 3433 Modified: python/trunk/Mac/IDLE/Makefile.in python/trunk/Mac/PythonLauncher/Makefile.in Modified: python/trunk/Mac/IDLE/Makefile.in ============================================================================== --- python/trunk/Mac/IDLE/Makefile.in (original) +++ python/trunk/Mac/IDLE/Makefile.in Fri Jan 2 12:46:05 2009 @@ -29,10 +29,10 @@ install: IDLE.app $(srcdir)/config-main.def $(srcdir)/config-extensions.def test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" - cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" + /bin/cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" + /bin/cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" clean: rm -rf IDLE.app Modified: python/trunk/Mac/PythonLauncher/Makefile.in ============================================================================== --- python/trunk/Mac/PythonLauncher/Makefile.in (original) +++ python/trunk/Mac/PythonLauncher/Makefile.in Fri Jan 2 12:46:05 2009 @@ -29,7 +29,7 @@ install: Python\ Launcher.app test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" clean: From python-checkins at python.org Fri Jan 2 12:47:17 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 12:47:17 +0100 (CET) Subject: [Python-checkins] r68151 - in python/branches/release26-maint/Mac: IDLE/Makefile.in PythonLauncher/Makefile.in Message-ID: <20090102114717.4E7071E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 12:47:17 2009 New Revision: 68151 Log: Backport of r68150 Modified: python/branches/release26-maint/Mac/IDLE/Makefile.in python/branches/release26-maint/Mac/PythonLauncher/Makefile.in Modified: python/branches/release26-maint/Mac/IDLE/Makefile.in ============================================================================== --- python/branches/release26-maint/Mac/IDLE/Makefile.in (original) +++ python/branches/release26-maint/Mac/IDLE/Makefile.in Fri Jan 2 12:47:17 2009 @@ -29,10 +29,10 @@ install: IDLE.app $(srcdir)/config-main.def $(srcdir)/config-extensions.def test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" - cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" + /bin/cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" + /bin/cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" clean: rm -rf IDLE.app Modified: python/branches/release26-maint/Mac/PythonLauncher/Makefile.in ============================================================================== --- python/branches/release26-maint/Mac/PythonLauncher/Makefile.in (original) +++ python/branches/release26-maint/Mac/PythonLauncher/Makefile.in Fri Jan 2 12:47:17 2009 @@ -29,7 +29,7 @@ install: Python\ Launcher.app test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" clean: From python-checkins at python.org Fri Jan 2 12:48:29 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 12:48:29 +0100 (CET) Subject: [Python-checkins] r68152 - in python/branches/py3k/Mac: Makefile.in PythonLauncher/Makefile.in Message-ID: <20090102114829.467B41E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 12:48:29 2009 New Revision: 68152 Log: Fix for issue 3433 Modified: python/branches/py3k/Mac/Makefile.in python/branches/py3k/Mac/PythonLauncher/Makefile.in Modified: python/branches/py3k/Mac/Makefile.in ============================================================================== --- python/branches/py3k/Mac/Makefile.in (original) +++ python/branches/py3k/Mac/Makefile.in Fri Jan 2 12:48:29 2009 @@ -216,9 +216,9 @@ install_IDLE: test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" - sed "s!%prefix%!$(prefix)!g" < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" + 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" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" Modified: python/branches/py3k/Mac/PythonLauncher/Makefile.in ============================================================================== --- python/branches/py3k/Mac/PythonLauncher/Makefile.in (original) +++ python/branches/py3k/Mac/PythonLauncher/Makefile.in Fri Jan 2 12:48:29 2009 @@ -27,7 +27,7 @@ install: Python\ Launcher.app test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" From buildbot at python.org Fri Jan 2 13:33:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 12:33:37 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090102123337.8DCC21E4002@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/21 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: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Jan 2 13:36:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 12:36:33 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.x Message-ID: <20090102123633.6F1D21E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.x/builds/49 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From buildbot at python.org Fri Jan 2 13:43:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 12:43:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090102124307.BAF801E4002@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/47 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: 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 python-checkins at python.org Fri Jan 2 13:59:33 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 13:59:33 +0100 (CET) Subject: [Python-checkins] r68153 - in python/trunk/Lib/idlelib: NEWS.txt help.txt macosxSupport.py Message-ID: <20090102125933.4A47A1E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 13:59:32 2009 New Revision: 68153 Log: Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk Modified: python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/help.txt python/trunk/Lib/idlelib/macosxSupport.py Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Fri Jan 2 13:59:32 2009 @@ -3,6 +3,8 @@ *Release date: XX-XXX-2008* +- Issue #3549: On MacOS the preferences menu was not present + - Issue #2665: On Windows, an IDLE installation upgraded from an old version would not start if a custom theme was defined. Modified: python/trunk/Lib/idlelib/help.txt ============================================================================== --- python/trunk/Lib/idlelib/help.txt (original) +++ python/trunk/Lib/idlelib/help.txt Fri Jan 2 13:59:32 2009 @@ -90,7 +90,10 @@ Configure IDLE -- Open a configuration dialog. Fonts, indentation, keybindings, and color themes may be altered. Startup Preferences may be set, and Additional Help - Souces can be specified. + Sources can be specified. + + On MacOS X this menu is not present, use + menu 'IDLE -> Preferences...' instead. --- Code Context -- Open a pane at the top of the edit window which shows the block context of the section of code Modified: python/trunk/Lib/idlelib/macosxSupport.py ============================================================================== --- python/trunk/Lib/idlelib/macosxSupport.py (original) +++ python/trunk/Lib/idlelib/macosxSupport.py Fri Jan 2 13:59:32 2009 @@ -89,7 +89,9 @@ ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding tkversion = root.tk.eval('info patchlevel') - if tkversion >= '8.4.14': + # Note: we cannot check if the string tkversion >= '8.4.14', because + # the string '8.4.7' is greater than the string '8.4.14'. + if map(int, tkversion.split('.')) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, From python-checkins at python.org Fri Jan 2 14:00:10 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 14:00:10 +0100 (CET) Subject: [Python-checkins] r68154 - in python/branches/release26-maint/Lib/idlelib: help.txt macosxSupport.py Message-ID: <20090102130010.09D991E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 14:00:09 2009 New Revision: 68154 Log: Backport of r68153 Modified: python/branches/release26-maint/Lib/idlelib/help.txt python/branches/release26-maint/Lib/idlelib/macosxSupport.py Modified: python/branches/release26-maint/Lib/idlelib/help.txt ============================================================================== --- python/branches/release26-maint/Lib/idlelib/help.txt (original) +++ python/branches/release26-maint/Lib/idlelib/help.txt Fri Jan 2 14:00:09 2009 @@ -90,7 +90,10 @@ Configure IDLE -- Open a configuration dialog. Fonts, indentation, keybindings, and color themes may be altered. Startup Preferences may be set, and Additional Help - Souces can be specified. + Sources can be specified. + + On MacOS X this menu is not present, use + menu 'IDLE -> Preferences...' instead. --- Code Context -- Open a pane at the top of the edit window which shows the block context of the section of code Modified: python/branches/release26-maint/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/release26-maint/Lib/idlelib/macosxSupport.py (original) +++ python/branches/release26-maint/Lib/idlelib/macosxSupport.py Fri Jan 2 14:00:09 2009 @@ -89,7 +89,9 @@ ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding tkversion = root.tk.eval('info patchlevel') - if tkversion >= '8.4.14': + # Note: we cannot check if the string tkversion >= '8.4.14', because + # the string '8.4.7' is greater than the string '8.4.14'. + if map(int, tkversion.split('.')) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, From python-checkins at python.org Fri Jan 2 14:10:35 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 14:10:35 +0100 (CET) Subject: [Python-checkins] r68155 - in python/branches/py3k: Lib/idlelib/NEWS.txt Lib/idlelib/help.txt Lib/idlelib/macosxSupport.py Message-ID: <20090102131035.00A791E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 14:10:34 2009 New Revision: 68155 Log: Recorded merge of revisions 68153 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68153 | ronald.oussoren | 2009-01-02 13:59:32 +0100 (Fri, 02 Jan 2009) | 10 lines Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/idlelib/NEWS.txt python/branches/py3k/Lib/idlelib/help.txt python/branches/py3k/Lib/idlelib/macosxSupport.py Modified: python/branches/py3k/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k/Lib/idlelib/NEWS.txt Fri Jan 2 14:10:34 2009 @@ -8,6 +8,11 @@ user configuration of source encoding; all according to PEP 3120. +- Issue #3549: On MacOS the preferences menu was not present + +- Issue #2665: On Windows, an IDLE installation upgraded from an old version + would not start if a custom theme was defined. + What's New in IDLE 3.0a3? ========================= Modified: python/branches/py3k/Lib/idlelib/help.txt ============================================================================== --- python/branches/py3k/Lib/idlelib/help.txt (original) +++ python/branches/py3k/Lib/idlelib/help.txt Fri Jan 2 14:10:34 2009 @@ -90,7 +90,10 @@ Configure IDLE -- Open a configuration dialog. Fonts, indentation, keybindings, and color themes may be altered. Startup Preferences may be set, and Additional Help - Souces can be specified. + Sources can be specified. + + On MacOS X this menu is not present, use + menu 'IDLE -> Preferences...' instead. --- Code Context -- Open a pane at the top of the edit window which shows the block context of the section of code Modified: python/branches/py3k/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/py3k/Lib/idlelib/macosxSupport.py (original) +++ python/branches/py3k/Lib/idlelib/macosxSupport.py Fri Jan 2 14:10:34 2009 @@ -89,7 +89,9 @@ ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding tkversion = root.tk.eval('info patchlevel') - if tkversion >= '8.4.14': + # Note: we cannot check if the string tkversion >= '8.4.14', because + # the string '8.4.7' is greater than the string '8.4.14'. + if tuple(map(int, tkversion.split('.'))) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, From python-checkins at python.org Fri Jan 2 15:10:20 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 15:10:20 +0100 (CET) Subject: [Python-checkins] r68156 - in python/trunk: Lib/test/test_macos.py Mac/Modules/MacOS.c Misc/NEWS Message-ID: <20090102141020.ACAAF1E4025@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 15:10:20 2009 New Revision: 68156 Log: Fix for issue1594 Modified: python/trunk/Lib/test/test_macos.py python/trunk/Mac/Modules/MacOS.c python/trunk/Misc/NEWS Modified: python/trunk/Lib/test/test_macos.py ============================================================================== --- python/trunk/Lib/test/test_macos.py (original) +++ python/trunk/Lib/test/test_macos.py Fri Jan 2 15:10:20 2009 @@ -3,11 +3,66 @@ import Carbon.File from test import test_support import os +import subprocess TESTFN2 = test_support.TESTFN + '2' class TestMacOS(unittest.TestCase): + def testGetCreatorAndType(self): + if not os.path.exists('/Developer/Tools/SetFile'): + return + + try: + fp = open(test_support.TESTFN, 'w') + fp.write('\n') + fp.close() + + subprocess.call( + ['/Developer/Tools/SetFile', '-t', 'ABCD', '-c', 'EFGH', + test_support.TESTFN]) + + cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN) + self.assertEquals(tp, 'ABCD') + self.assertEquals(cr, 'EFGH') + + finally: + os.unlink(test_support.TESTFN) + + def testSetCreatorAndType(self): + if not os.path.exists('/Developer/Tools/GetFileInfo'): + return + + try: + fp = open(test_support.TESTFN, 'w') + fp.write('\n') + fp.close() + + MacOS.SetCreatorAndType(test_support.TESTFN, + 'ABCD', 'EFGH') + + cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN) + self.assertEquals(cr, 'ABCD') + self.assertEquals(tp, 'EFGH') + + data = subprocess.Popen(["/Developer/Tools/GetFileInfo", test_support.TESTFN], + stdout=subprocess.PIPE).communicate()[0] + + tp = None + cr = None + for ln in data.splitlines(): + if ln.startswith('type:'): + tp = ln.split()[-1][1:-1] + if ln.startswith('creator:'): + cr = ln.split()[-1][1:-1] + + self.assertEquals(cr, 'ABCD') + self.assertEquals(tp, 'EFGH') + + finally: + os.unlink(test_support.TESTFN) + + def testOpenRF(self): try: fp = open(test_support.TESTFN, 'w') Modified: python/trunk/Mac/Modules/MacOS.c ============================================================================== --- python/trunk/Mac/Modules/MacOS.c (original) +++ python/trunk/Mac/Modules/MacOS.c Fri Jan 2 15:10:20 2009 @@ -30,6 +30,9 @@ #include #include +#include /* for ntohl, htonl */ + + #ifndef HAVE_OSX105_SDK typedef SInt16 FSIORefNum; #endif @@ -310,6 +313,10 @@ if ((err = FSpGetFInfo(&fss, &info)) != noErr) { return PyErr_Mac(MacOS_Error, err); } + + info.fdCreator = ntohl(info.fdCreator); + info.fdType = ntohl(info.fdType); + creator = PyString_FromStringAndSize( (char *)&info.fdCreator, 4); type = PyString_FromStringAndSize((char *)&info.fdType, 4); @@ -341,6 +348,8 @@ } finfo = (FileInfo*)&(cataloginfo.finderInfo); + finfo->fileCreator = ntohl(finfo->fileCreator); + finfo->fileType = ntohl(finfo->fileType); creator = PyString_FromStringAndSize((char*)&(finfo->fileCreator), 4); type = PyString_FromStringAndSize((char*)&(finfo->fileType), 4); Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 15:10:20 2009 @@ -224,6 +224,9 @@ - Issue #4730: Fixed the cPickle module to handle correctly astral characters when protocol 0 is used. +- Issue #1594: MacOS.GetCreatorAndType now always returns a big-endian result, + to be consistent with Apple tools. + Tools/Demos ----------- From python-checkins at python.org Fri Jan 2 15:30:43 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 2 Jan 2009 15:30:43 +0100 (CET) Subject: [Python-checkins] r68157 - in python/branches/py3k-issue1717: Doc/Makefile Doc/README.txt Doc/c-api/arg.rst Doc/c-api/exceptions.rst Doc/distutils/apiref.rst Doc/distutils/setupscript.rst Doc/extending/extending.rst Doc/howto/functional.rst Doc/howto/unicode.rst Doc/includes/noddy.c Doc/includes/noddy2.c Doc/includes/noddy3.c Doc/includes/noddy4.c Doc/library/dis.rst Doc/library/email.mime.rst Doc/library/functions.rst Doc/library/hashlib.rst Doc/library/json.rst Doc/library/logging.rst Doc/library/math.rst Doc/library/multiprocessing.rst Doc/library/optparse.rst Doc/library/pydoc.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/stdtypes.rst Doc/library/subprocess.rst Doc/library/unittest.rst Doc/library/webbrowser.rst Doc/library/winsound.rst Doc/library/xml.etree.elementtree.rst Doc/library/zipfile.rst Doc/license.rst Doc/tools/sphinx-web.py Doc/tools/sphinxext/download.html Doc/tools/sphinxext/pyspecific.py Doc/tutorial/controlflow.rst Doc/using/unix.rst Doc/whatsnew/2.6.rst Include/pymacconfig.h Include/unicodeobject.h LICENSE Lib/dis.py Lib/distutils/ccompiler.py Lib/distutils/command/register.py Lib/distutils/config.py Lib/distutils/dist.py Lib/distutils/msvc9compiler.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_msvc9compiler.py Lib/distutils/tests/test_register.py Lib/distutils/util.py Lib/idlelib/IOBinding.py Lib/idlelib/NEWS.txt Lib/idlelib/configDialog.py Lib/io.py Lib/lib2to3/main.py Lib/pickle.py Lib/pydoc.py Lib/re.py Lib/ssl.py Lib/test/pickletester.py Lib/test/test_array.py Lib/test/test_bytes.py Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_file.py Lib/test/test_fileio.py Lib/test/test_generators.py Lib/test/test_hash.py Lib/test/test_io.py Lib/test/test_set.py Lib/test/test_unittest.py Lib/test/test_urllib2.py Lib/test/test_zipfile.py Lib/tkinter/colorchooser.py Lib/tkinter/filedialog.py Lib/tkinter/scrolledtext.py Lib/unittest.py Lib/zipfile.py Mac/BuildScript/build-installer.py Mac/BuildScript/resources/Welcome.rtf Mac/IDLE/IDLE.app/Contents/Info.plist Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Mac/Makefile.in Mac/PythonLauncher/Info.plist.in Mac/PythonLauncher/Makefile.in Mac/Tools/bundlebuilder.py Mac/Tools/fixapplepython23.py Makefile.pre.in Misc/NEWS Misc/developers.txt Modules/_collectionsmodule.c Modules/_fileio.c Modules/_pickle.c Modules/_testcapimodule.c Modules/main.c Modules/mathmodule.c Modules/posixmodule.c Objects/bytearrayobject.c Objects/bytesobject.c Objects/dictobject.c Objects/object.c Objects/setobject.c Objects/unicodeobject.c Python/compile.c Python/getargs.c Tools/pybench/Lists.py setup.py Message-ID: <20090102143043.80EC81E4024@bag.python.org> Author: mark.dickinson Date: Fri Jan 2 15:30:39 2009 New Revision: 68157 Log: Merged revisions 67881,67884,67886-67887,67903,67910,67925,67929,67931,67933,67937-67942,67945,67947-67950,67956,67959,67962,67964,67966,67968-67969,67972,67974,67981,67983,68008,68012,68015,68017,68020,68022,68027,68036,68058-68059,68062,68064,68074-68075,68083,68090-68091,68093-68094,68101,68103,68113,68129,68132,68136-68140,68143,68152 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r67881 | benjamin.peterson | 2008-12-20 22:50:25 +0000 (Sat, 20 Dec 2008) | 1 line unpy3kize this; it require 2.x only Mac modules ................ r67884 | benjamin.peterson | 2008-12-20 23:06:29 +0000 (Sat, 20 Dec 2008) | 1 line don't build bsddb anymore ................ r67886 | benjamin.peterson | 2008-12-21 00:06:59 +0000 (Sun, 21 Dec 2008) | 93 lines Merged revisions 67654,67676-67677,67681,67692,67725,67761,67784-67785,67787-67788,67802,67848-67850,67862-67864,67880,67882 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67654 | georg.brandl | 2008-12-07 16:42:09 -0600 (Sun, 07 Dec 2008) | 2 lines #4457: rewrite __import__() documentation. ........ r67676 | benjamin.peterson | 2008-12-08 20:03:03 -0600 (Mon, 08 Dec 2008) | 1 line specify how things are copied ........ r67677 | benjamin.peterson | 2008-12-08 20:05:11 -0600 (Mon, 08 Dec 2008) | 1 line revert unrelated change to installer script ........ r67681 | jeremy.hylton | 2008-12-09 15:03:10 -0600 (Tue, 09 Dec 2008) | 2 lines Add simple unittests for Request ........ r67692 | amaury.forgeotdarc | 2008-12-10 18:03:42 -0600 (Wed, 10 Dec 2008) | 2 lines #1030250: correctly pass the dry_run option to the mkpath() function. ........ r67725 | benjamin.peterson | 2008-12-12 22:02:20 -0600 (Fri, 12 Dec 2008) | 1 line fix incorrect example ........ r67761 | benjamin.peterson | 2008-12-14 11:26:04 -0600 (Sun, 14 Dec 2008) | 1 line fix missing bracket ........ r67784 | georg.brandl | 2008-12-15 02:33:58 -0600 (Mon, 15 Dec 2008) | 2 lines #4446: document "platforms" argument for setup(). ........ r67785 | georg.brandl | 2008-12-15 02:36:11 -0600 (Mon, 15 Dec 2008) | 2 lines #4611: fix typo. ........ r67787 | georg.brandl | 2008-12-15 02:58:59 -0600 (Mon, 15 Dec 2008) | 2 lines #4578: fix has_key() usage in compiler package. ........ r67788 | georg.brandl | 2008-12-15 03:07:39 -0600 (Mon, 15 Dec 2008) | 2 lines #4568: remove limitation in varargs callback example. ........ r67802 | amaury.forgeotdarc | 2008-12-15 16:29:14 -0600 (Mon, 15 Dec 2008) | 4 lines #3632: the "pyo" macro from gdbinit can now run when the GIL is released. Patch by haypo. ........ r67848 | benjamin.peterson | 2008-12-18 20:28:56 -0600 (Thu, 18 Dec 2008) | 1 line fix typo ........ r67849 | benjamin.peterson | 2008-12-18 20:31:35 -0600 (Thu, 18 Dec 2008) | 1 line _call_method -> _callmethod and _get_value to _getvalue ........ r67850 | raymond.hettinger | 2008-12-19 03:06:07 -0600 (Fri, 19 Dec 2008) | 9 lines Fix-up and clean-up docs for int.bit_length(). * Replace dramatic footnote with in-line comment about possible round-off errors in logarithms of large numbers. * Add comments to the pure python code equivalent. * replace floor() with int() in the mathematical equivalent so the type is correct (should be an int, not a float). * add abs() to the mathematical equivalent so that it matches the previous line that it is supposed to be equivalent to. * make one combined example with a negative input. ........ r67862 | benjamin.peterson | 2008-12-19 20:48:02 -0600 (Fri, 19 Dec 2008) | 1 line copy sentence from docstring ........ r67863 | benjamin.peterson | 2008-12-19 20:51:26 -0600 (Fri, 19 Dec 2008) | 1 line add headings ........ r67864 | benjamin.peterson | 2008-12-19 20:57:19 -0600 (Fri, 19 Dec 2008) | 1 line beef up docstring ........ r67880 | benjamin.peterson | 2008-12-20 16:49:24 -0600 (Sat, 20 Dec 2008) | 1 line remove redundant sentence ........ r67882 | benjamin.peterson | 2008-12-20 16:59:49 -0600 (Sat, 20 Dec 2008) | 1 line add some recent releases to the list ........ ................ r67887 | benjamin.peterson | 2008-12-21 00:16:13 +0000 (Sun, 21 Dec 2008) | 9 lines Merged revisions 67885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67885 | benjamin.peterson | 2008-12-20 17:48:54 -0600 (Sat, 20 Dec 2008) | 1 line silence annoying DeprecationWarning ........ ................ r67903 | benjamin.peterson | 2008-12-22 20:19:52 +0000 (Mon, 22 Dec 2008) | 8 lines Blocked revisions 67902 via svnmerge ........ r67902 | benjamin.peterson | 2008-12-22 14:16:25 -0600 (Mon, 22 Dec 2008) | 1 line add py3k warnings to frame.f_exc_* ........ ................ r67910 | skip.montanaro | 2008-12-23 03:51:14 +0000 (Tue, 23 Dec 2008) | 11 lines Merged revisions 67908 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67908 | skip.montanaro | 2008-12-22 21:30:15 -0600 (Mon, 22 Dec 2008) | 4 lines As a result of a regression that snuck into 2.5.3 add a test case that ensures that when you try to read from a file opened for writing an IOError is raised. ........ ................ r67925 | benjamin.peterson | 2008-12-24 16:27:25 +0000 (Wed, 24 Dec 2008) | 1 line return the module object from PyMODINIT_FUNC ................ r67929 | benjamin.peterson | 2008-12-27 02:58:34 +0000 (Sat, 27 Dec 2008) | 1 line string -> bytes in error message #4745 ................ r67931 | hirokazu.yamamoto | 2008-12-27 04:21:44 +0000 (Sat, 27 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. This enables test for protocol 3 (== HIGHEST_PROTOCOL in 3.x) ................ r67933 | alexandre.vassalotti | 2008-12-27 06:43:58 +0000 (Sat, 27 Dec 2008) | 12 lines Merged revisions 67932 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67932 | alexandre.vassalotti | 2008-12-27 01:36:10 -0500 (Sat, 27 Dec 2008) | 5 lines Remove unnecessary casts related to unicode_decode_call_errorhandler. Make the _PyUnicode_Resize macro a static function. These changes are needed to avoid breaking strict aliasing rules. ........ ................ r67937 | alexandre.vassalotti | 2008-12-27 07:32:41 +0000 (Sat, 27 Dec 2008) | 3 lines Update copy of PyUnicode_EncodeRawUnicodeEscape in _pickle. Add astral character test case. ................ r67938 | alexandre.vassalotti | 2008-12-27 09:09:15 +0000 (Sat, 27 Dec 2008) | 3 lines Fix wrong bytes type conversion in PyUnicode_AsUnicodeEscapeString. Fix wrong bytes type conversion in PyUnicode_AsUnicodeDecodeString. ................ r67939 | alexandre.vassalotti | 2008-12-27 09:16:49 +0000 (Sat, 27 Dec 2008) | 6 lines Optimize built-in unicode codecs by avoiding unnecessary copying. The approach used is similiar to what is currently used in the version of unicodeobject.c in Python 2.x. The only difference is we use _PyBytes_Resize instead of _PyString_Resize. ................ r67940 | alexandre.vassalotti | 2008-12-27 09:30:39 +0000 (Sat, 27 Dec 2008) | 4 lines Fix issue #4374: Pickle tests fail w/o _pickle extension. Add an initialization check to mimic the interface of _pickle. ................ r67941 | alexandre.vassalotti | 2008-12-27 09:49:09 +0000 (Sat, 27 Dec 2008) | 2 lines Fix bogus assertion. ................ r67942 | alexandre.vassalotti | 2008-12-27 09:59:15 +0000 (Sat, 27 Dec 2008) | 14 lines Blocked revisions 67934-67935 via svnmerge ........ r67934 | alexandre.vassalotti | 2008-12-27 02:08:47 -0500 (Sat, 27 Dec 2008) | 4 lines Fix issue #4730: cPickle corrupts high-unicode strings. Update outdated copy of PyUnicode_EncodeRawUnicodeEscape. Add a test case. ........ r67935 | alexandre.vassalotti | 2008-12-27 02:13:01 -0500 (Sat, 27 Dec 2008) | 2 lines Add Misc/NEWS entry for r67934. ........ ................ r67945 | hirokazu.yamamoto | 2008-12-27 14:58:17 +0000 (Sat, 27 Dec 2008) | 1 line Fixed incompatible pointer warning. ................ r67947 | antoine.pitrou | 2008-12-27 15:50:40 +0000 (Sat, 27 Dec 2008) | 10 lines Merged revisions 67946 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67946 | antoine.pitrou | 2008-12-27 16:43:12 +0100 (sam., 27 d??c. 2008) | 4 lines Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by Gabriel Genellina. ........ ................ r67948 | benjamin.peterson | 2008-12-27 16:00:54 +0000 (Sat, 27 Dec 2008) | 93 lines Merged revisions 67889-67892,67895,67898,67904-67907,67912,67918,67920-67921,67923-67924,67926-67927,67930,67943 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r67889 | benjamin.peterson | 2008-12-20 19:04:32 -0600 (Sat, 20 Dec 2008) | 1 line sphinx.web is long gone ................ r67890 | benjamin.peterson | 2008-12-20 19:12:26 -0600 (Sat, 20 Dec 2008) | 1 line update readme ................ r67891 | benjamin.peterson | 2008-12-20 19:14:47 -0600 (Sat, 20 Dec 2008) | 1 line there are way too many places which need to have the current version added ................ r67892 | benjamin.peterson | 2008-12-20 19:29:32 -0600 (Sat, 20 Dec 2008) | 9 lines Merged revisions 67809 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line fix logic error ........ ................ r67895 | neal.norwitz | 2008-12-21 08:28:32 -0600 (Sun, 21 Dec 2008) | 2 lines Add Tarek for work on distutils. ................ r67898 | benjamin.peterson | 2008-12-21 15:00:53 -0600 (Sun, 21 Dec 2008) | 1 line compute DISTVERSION with patchlevel.py ................ r67904 | benjamin.peterson | 2008-12-22 14:44:58 -0600 (Mon, 22 Dec 2008) | 1 line less attitude ................ r67905 | benjamin.peterson | 2008-12-22 14:51:15 -0600 (Mon, 22 Dec 2008) | 1 line fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|' ................ r67906 | benjamin.peterson | 2008-12-22 14:52:53 -0600 (Mon, 22 Dec 2008) | 1 line add NEWS note ................ r67907 | benjamin.peterson | 2008-12-22 16:12:19 -0600 (Mon, 22 Dec 2008) | 1 line silence compiler warning ................ r67912 | georg.brandl | 2008-12-23 06:37:21 -0600 (Tue, 23 Dec 2008) | 2 lines Fix missing "svn" command. ................ r67918 | georg.brandl | 2008-12-23 09:44:25 -0600 (Tue, 23 Dec 2008) | 2 lines Markup fix. ................ r67920 | benjamin.peterson | 2008-12-23 14:09:28 -0600 (Tue, 23 Dec 2008) | 1 line use a global variable, so the compiler doesn't optimize the assignment out ................ r67921 | benjamin.peterson | 2008-12-23 14:12:33 -0600 (Tue, 23 Dec 2008) | 1 line make global static ................ r67923 | benjamin.peterson | 2008-12-24 09:10:27 -0600 (Wed, 24 Dec 2008) | 1 line #4736 BufferRWPair.closed shouldn't try to call another property as a function ................ r67924 | benjamin.peterson | 2008-12-24 10:10:05 -0600 (Wed, 24 Dec 2008) | 1 line pretend exceptions don't exist a while longer ................ r67926 | tarek.ziade | 2008-12-24 13:10:05 -0600 (Wed, 24 Dec 2008) | 1 line fixed #4400 : distutils .pypirc default generated file was broken. ................ r67927 | benjamin.peterson | 2008-12-26 17:26:30 -0600 (Fri, 26 Dec 2008) | 1 line python version is included in file name now ................ r67930 | hirokazu.yamamoto | 2008-12-26 22:19:48 -0600 (Fri, 26 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2) ................ r67943 | alexandre.vassalotti | 2008-12-27 04:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines Fix bogus unicode tests in pickletester. ................ ................ r67949 | benjamin.peterson | 2008-12-27 16:58:50 +0000 (Sat, 27 Dec 2008) | 1 line fix syntax ................ r67950 | benjamin.peterson | 2008-12-27 17:00:44 +0000 (Sat, 27 Dec 2008) | 1 line fix 2.x isms in distutils test ................ r67956 | benjamin.peterson | 2008-12-27 18:35:25 +0000 (Sat, 27 Dec 2008) | 1 line fix svnmerge properties ................ r67959 | benjamin.peterson | 2008-12-27 19:03:36 +0000 (Sat, 27 Dec 2008) | 9 lines Merged revisions 67954 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67954 | benjamin.peterson | 2008-12-27 12:24:11 -0600 (Sat, 27 Dec 2008) | 1 line #4748 lambda generators shouldn't return values ........ ................ r67962 | georg.brandl | 2008-12-27 19:08:11 +0000 (Sat, 27 Dec 2008) | 2 lines #4697: clarify that the functions are Unix-only. ................ r67964 | alexandre.vassalotti | 2008-12-27 19:46:35 +0000 (Sat, 27 Dec 2008) | 2 lines Revert unwanted function name change introduced by r67939. ................ r67966 | antoine.pitrou | 2008-12-27 20:39:28 +0000 (Sat, 27 Dec 2008) | 9 lines Merged revisions 67965 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67965 | antoine.pitrou | 2008-12-27 21:34:52 +0100 (sam., 27 d??c. 2008) | 3 lines Issue #4677: add two list comprehension tests to pybench. ........ ................ r67968 | georg.brandl | 2008-12-27 23:12:09 +0000 (Sat, 27 Dec 2008) | 2 lines Remove confusing error message in bytes.translate. ................ r67969 | georg.brandl | 2008-12-27 23:33:20 +0000 (Sat, 27 Dec 2008) | 5 lines Document bytes.translate(). BTW, having str.maketrans() as a static method and string.maketrans() as a function that creates translation tables for bytes objects is not very consistent :) ................ r67972 | alexandre.vassalotti | 2008-12-28 02:13:22 +0000 (Sun, 28 Dec 2008) | 13 lines Merged revisions 67970-67971 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67970 | alexandre.vassalotti | 2008-12-27 20:52:58 -0500 (Sat, 27 Dec 2008) | 2 lines Fix name mangling of PyUnicode_ClearFreeList. ........ r67971 | alexandre.vassalotti | 2008-12-27 21:10:35 -0500 (Sat, 27 Dec 2008) | 2 lines Sort UCS-2/UCS-4 name mangling list. ........ ................ r67974 | georg.brandl | 2008-12-28 11:44:14 +0000 (Sun, 28 Dec 2008) | 4 lines #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6. ................ r67981 | antoine.pitrou | 2008-12-28 14:29:00 +0000 (Sun, 28 Dec 2008) | 9 lines Merged revisions 67979 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67979 | antoine.pitrou | 2008-12-28 15:09:36 +0100 (dim., 28 d??c. 2008) | 3 lines Issue #4444: Allow assertRaises() to be used as a context handler. ........ ................ r67983 | benjamin.peterson | 2008-12-28 15:44:55 +0000 (Sun, 28 Dec 2008) | 12 lines Blocked revisions 67976 via svnmerge ........ r67976 | georg.brandl | 2008-12-28 05:54:53 -0600 (Sun, 28 Dec 2008) | 7 lines Backport r67974: #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6. ........ ................ r68008 | martin.v.loewis | 2008-12-29 16:03:04 +0000 (Mon, 29 Dec 2008) | 9 lines Merged revisions 68006 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68006 | martin.v.loewis | 2008-12-29 16:51:01 +0100 (Mo, 29 Dez 2008) | 2 lines Issue #3248: Allow placing ScrolledText in a PanedWindow. ........ ................ r68012 | martin.v.loewis | 2008-12-29 16:27:13 +0000 (Mon, 29 Dec 2008) | 9 lines Merged revisions 68010 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68010 | martin.v.loewis | 2008-12-29 17:22:25 +0100 (Mo, 29 Dez 2008) | 2 lines Issue #3767: Convert Tk object to string in tkColorChooser. ........ ................ r68015 | benjamin.peterson | 2008-12-29 17:50:07 +0000 (Mon, 29 Dec 2008) | 8 lines Blocked revisions 68014 via svnmerge ........ r68014 | benjamin.peterson | 2008-12-29 11:47:42 -0600 (Mon, 29 Dec 2008) | 1 line #4764 set IOError.filename when trying to open a directory on POSIX platforms ........ ................ r68017 | benjamin.peterson | 2008-12-29 18:02:28 +0000 (Mon, 29 Dec 2008) | 9 lines Merged revisions 68016 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68016 | benjamin.peterson | 2008-12-29 11:56:58 -0600 (Mon, 29 Dec 2008) | 1 line #4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms ........ ................ r68020 | martin.v.loewis | 2008-12-29 18:21:47 +0000 (Mon, 29 Dec 2008) | 9 lines Merged revisions 68018 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68018 | martin.v.loewis | 2008-12-29 19:17:34 +0100 (Mo, 29 Dez 2008) | 2 lines Issue #1040026: Fix os.times result on systems where HZ is incorrect. ........ ................ r68022 | martin.v.loewis | 2008-12-29 18:43:40 +0000 (Mon, 29 Dec 2008) | 5 lines Issue #4323: Always encode source as UTF-8 without asking the user (unless a different encoding is declared); remove user configuration of source encoding; all according to PEP 3120. ................ r68027 | benjamin.peterson | 2008-12-29 20:52:09 +0000 (Mon, 29 Dec 2008) | 1 line hexdigest() doesn't return bytes #4771 ................ r68036 | tarek.ziade | 2008-12-29 22:38:38 +0000 (Mon, 29 Dec 2008) | 9 lines Merged revisions 68033 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68033 | tarek.ziade | 2008-12-29 23:23:53 +0100 (Mon, 29 Dec 2008) | 1 line fixed #4646 : distutils was choking on empty options arg in the setup function. ........ ................ r68058 | nick.coghlan | 2008-12-30 07:29:12 +0000 (Tue, 30 Dec 2008) | 9 lines Recorded merge of revisions 68051 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68051 | nick.coghlan | 2008-12-30 11:18:48 +1000 (Tue, 30 Dec 2008) | 1 line Issue #4701: implicitly call PyType_Ready from PyObject_Hash ........ ................ r68059 | vinay.sajip | 2008-12-30 07:32:59 +0000 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ................ r68062 | ronald.oussoren | 2008-12-30 12:59:02 +0000 (Tue, 30 Dec 2008) | 12 lines Make it possible to install a framework build of Python 3.x on OSX. This the build machinery on OSX to re-enable building (and installing) PythonLauncher.app and IDLE.app. This needs ports of fixes to Lib/distutils/util.py and Include/pymacconfig.h to be fully functiontional, to be fully functional. I also have a patch for Makefile.pre.in that I'll post on bugs.python.org for review. ................ r68064 | ronald.oussoren | 2008-12-30 14:16:51 +0000 (Tue, 30 Dec 2008) | 11 lines Py3k: update OSX installer-generator This update makes sure that the installer won't write files in /usr/local/bin by default. The installer also won't replace /Library/Frameworks/Python.framework/Version/Current. Both to ensure that the installer doens't break an existing install of python 2.x. ................ r68074 | benjamin.peterson | 2008-12-30 17:56:45 +0000 (Tue, 30 Dec 2008) | 18 lines Merged revisions 67982,67988,67990 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67982 | benjamin.peterson | 2008-12-28 09:37:31 -0600 (Sun, 28 Dec 2008) | 1 line fix WORD_BIGEDIAN declaration in Universal builds; fixes #4060 and #4728 ........ r67988 | ronald.oussoren | 2008-12-28 13:40:56 -0600 (Sun, 28 Dec 2008) | 1 line Issue4064: architecture string for universal builds on OSX ........ r67990 | ronald.oussoren | 2008-12-28 13:50:40 -0600 (Sun, 28 Dec 2008) | 3 lines Update the fix for issue4064 to deal correctly with all three variants of universal builds that are presented by the configure script. ........ ................ r68075 | benjamin.peterson | 2008-12-30 18:05:46 +0000 (Tue, 30 Dec 2008) | 2 lines use $(RUNSHARED) to run plat-mac/regen ................ r68083 | tarek.ziade | 2008-12-30 23:09:20 +0000 (Tue, 30 Dec 2008) | 9 lines Merged revisions 68081 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68081 | tarek.ziade | 2008-12-31 00:03:41 +0100 (Wed, 31 Dec 2008) | 1 line Fixed #4702: Throwing DistutilsPlatformError instead of IOError under win32 if MSVC is not found ........ ................ r68090 | benjamin.peterson | 2008-12-31 03:41:35 +0000 (Wed, 31 Dec 2008) | 8 lines Blocked revisions 68089 via svnmerge ........ r68089 | benjamin.peterson | 2008-12-30 21:37:51 -0600 (Tue, 30 Dec 2008) | 1 line #4788 qualify some bare except clauses ........ ................ r68091 | benjamin.peterson | 2008-12-31 03:43:28 +0000 (Wed, 31 Dec 2008) | 1 line #4788 qualify remove a bare except ................ r68093 | benjamin.peterson | 2008-12-31 04:10:35 +0000 (Wed, 31 Dec 2008) | 1 line fix name usage ................ r68094 | benjamin.peterson | 2008-12-31 04:13:40 +0000 (Wed, 31 Dec 2008) | 8 lines Blocked revisions 68092 via svnmerge ........ r68092 | benjamin.peterson | 2008-12-30 22:08:55 -0600 (Tue, 30 Dec 2008) | 1 line fix name collision issues ........ ................ r68101 | hirokazu.yamamoto | 2008-12-31 06:05:46 +0000 (Wed, 31 Dec 2008) | 13 lines Merged revisions 68097,68099 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68097 | hirokazu.yamamoto | 2008-12-31 14:24:37 +0900 | 1 line Fixed compile error on windows. ........ r68099 | hirokazu.yamamoto | 2008-12-31 14:47:19 +0900 | 1 line Just inserted blank line. ........ ................ r68103 | benjamin.peterson | 2008-12-31 14:51:07 +0000 (Wed, 31 Dec 2008) | 1 line #4406 Directory has to inherit from commondialog.Dialog ................ r68113 | benjamin.peterson | 2009-01-01 00:23:30 +0000 (Thu, 01 Jan 2009) | 53 lines Merged revisions 67952,67957-67958,67960-67961,67963,67973,67978,67995,68030,68057,68061 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67952 | georg.brandl | 2008-12-27 11:42:40 -0600 (Sat, 27 Dec 2008) | 2 lines #4752: actually use custom handler in example. ........ r67957 | georg.brandl | 2008-12-27 12:49:19 -0600 (Sat, 27 Dec 2008) | 2 lines #4754: improve winsound documentation. ........ r67958 | georg.brandl | 2008-12-27 13:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines #4682: 'b' is actually unsigned char. ........ r67960 | georg.brandl | 2008-12-27 13:04:44 -0600 (Sat, 27 Dec 2008) | 2 lines #4695: fix backslashery. ........ r67961 | georg.brandl | 2008-12-27 13:06:04 -0600 (Sat, 27 Dec 2008) | 2 lines Use :samp: role. ........ r67963 | georg.brandl | 2008-12-27 13:11:15 -0600 (Sat, 27 Dec 2008) | 2 lines #4671: document that pydoc imports modules. ........ r67973 | alexandre.vassalotti | 2008-12-27 20:58:22 -0600 (Sat, 27 Dec 2008) | 2 lines Document Py_VaBuildValue. ........ r67978 | georg.brandl | 2008-12-28 05:58:49 -0600 (Sun, 28 Dec 2008) | 2 lines #4731: clarify message about missing module prerequisites. ........ r67995 | benjamin.peterson | 2008-12-28 15:16:07 -0600 (Sun, 28 Dec 2008) | 1 line #4763 PyErr_ExceptionMatches won't blow up with NULL arguments ........ r68030 | benjamin.peterson | 2008-12-29 15:38:14 -0600 (Mon, 29 Dec 2008) | 1 line fix French ........ r68057 | vinay.sajip | 2008-12-30 01:01:25 -0600 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ........ r68061 | georg.brandl | 2008-12-30 04:15:49 -0600 (Tue, 30 Dec 2008) | 2 lines #4778: attributes can't be called. ........ ................ r68129 | benjamin.peterson | 2009-01-01 15:05:06 +0000 (Thu, 01 Jan 2009) | 46 lines Merged revisions 68116-68119,68121,68123-68127 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68116 | georg.brandl | 2009-01-01 05:46:51 -0600 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ........ r68117 | georg.brandl | 2009-01-01 05:53:55 -0600 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ........ r68118 | georg.brandl | 2009-01-01 06:00:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ........ r68119 | georg.brandl | 2009-01-01 06:09:40 -0600 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ........ r68121 | georg.brandl | 2009-01-01 06:43:33 -0600 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ........ r68123 | georg.brandl | 2009-01-01 06:52:29 -0600 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ........ r68124 | georg.brandl | 2009-01-01 06:53:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ........ r68125 | georg.brandl | 2009-01-01 07:02:09 -0600 (Thu, 01 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ........ r68126 | georg.brandl | 2009-01-01 07:05:13 -0600 (Thu, 01 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ........ r68127 | georg.brandl | 2009-01-01 07:14:49 -0600 (Thu, 01 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ........ ................ r68132 | antoine.pitrou | 2009-01-01 15:35:33 +0000 (Thu, 01 Jan 2009) | 9 lines Merged revisions 68128 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (jeu., 01 janv. 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ........ ................ r68136 | georg.brandl | 2009-01-01 15:49:47 +0000 (Thu, 01 Jan 2009) | 12 lines Blocked revisions 67967,67980 via svnmerge ........ r67967 | benjamin.peterson | 2008-12-27 23:18:58 +0100 (Sat, 27 Dec 2008) | 1 line fix markup ........ r67980 | antoine.pitrou | 2008-12-28 15:24:29 +0100 (Sun, 28 Dec 2008) | 1 line wrong version number in doc changes committed in r67979 ........ ................ r68137 | georg.brandl | 2009-01-01 15:53:14 +0000 (Thu, 01 Jan 2009) | 10 lines Merged revisions 67953 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67953 | georg.brandl | 2008-12-27 19:20:04 +0100 (Sat, 27 Dec 2008) | 3 lines Patch #4739 by David Laban: add symbols to pydoc help topics, so that ``help('@')`` works as expected. ........ ................ r68138 | georg.brandl | 2009-01-01 15:55:56 +0000 (Thu, 01 Jan 2009) | 9 lines Blocked revisions 67955 via svnmerge ........ r67955 | georg.brandl | 2008-12-27 19:27:53 +0100 (Sat, 27 Dec 2008) | 3 lines Follow-up to r67746 in order to restore backwards-compatibility for those who (monkey-)patch TextWrapper.wordsep_re with a custom RE. ........ ................ r68139 | hirokazu.yamamoto | 2009-01-01 16:03:45 +0000 (Thu, 01 Jan 2009) | 10 lines Merged revisions 68134 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68134 | hirokazu.yamamoto | 2009-01-02 00:45:39 +0900 | 2 lines Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. ........ ................ r68140 | hirokazu.yamamoto | 2009-01-01 16:09:52 +0000 (Thu, 01 Jan 2009) | 1 line News fix. On py3k, `str' is unicode. should use `bytes'. ................ r68143 | amaury.forgeotdarc | 2009-01-01 23:05:36 +0000 (Thu, 01 Jan 2009) | 7 lines #4747: on Windows, starting a module with a non-ascii filename would print a useless "SyntaxError: None" when the script contains a "# coding:" declaration. The Python API expects char* to be utf-8 encoded. wcstombs should be avoided here. Reviewed by Benjamin. Will backport to 3.0 ................ r68152 | ronald.oussoren | 2009-01-02 11:48:29 +0000 (Fri, 02 Jan 2009) | 2 lines Fix for issue 3433 ................ Added: python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py - copied unchanged from r68152, /python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py - copied unchanged from r68152, /python/branches/py3k/Lib/distutils/tests/test_register.py python/branches/py3k-issue1717/Mac/Tools/bundlebuilder.py - copied unchanged from r68152, /python/branches/py3k/Mac/Tools/bundlebuilder.py Removed: python/branches/py3k-issue1717/Doc/tools/sphinx-web.py Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Doc/Makefile python/branches/py3k-issue1717/Doc/README.txt python/branches/py3k-issue1717/Doc/c-api/arg.rst python/branches/py3k-issue1717/Doc/c-api/exceptions.rst python/branches/py3k-issue1717/Doc/distutils/apiref.rst python/branches/py3k-issue1717/Doc/distutils/setupscript.rst python/branches/py3k-issue1717/Doc/extending/extending.rst python/branches/py3k-issue1717/Doc/howto/functional.rst python/branches/py3k-issue1717/Doc/howto/unicode.rst python/branches/py3k-issue1717/Doc/includes/noddy.c python/branches/py3k-issue1717/Doc/includes/noddy2.c python/branches/py3k-issue1717/Doc/includes/noddy3.c python/branches/py3k-issue1717/Doc/includes/noddy4.c python/branches/py3k-issue1717/Doc/library/dis.rst python/branches/py3k-issue1717/Doc/library/email.mime.rst python/branches/py3k-issue1717/Doc/library/functions.rst python/branches/py3k-issue1717/Doc/library/hashlib.rst python/branches/py3k-issue1717/Doc/library/json.rst python/branches/py3k-issue1717/Doc/library/logging.rst python/branches/py3k-issue1717/Doc/library/math.rst python/branches/py3k-issue1717/Doc/library/multiprocessing.rst python/branches/py3k-issue1717/Doc/library/optparse.rst python/branches/py3k-issue1717/Doc/library/pydoc.rst python/branches/py3k-issue1717/Doc/library/shutil.rst python/branches/py3k-issue1717/Doc/library/signal.rst python/branches/py3k-issue1717/Doc/library/stdtypes.rst python/branches/py3k-issue1717/Doc/library/subprocess.rst python/branches/py3k-issue1717/Doc/library/unittest.rst python/branches/py3k-issue1717/Doc/library/webbrowser.rst python/branches/py3k-issue1717/Doc/library/winsound.rst python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst python/branches/py3k-issue1717/Doc/library/zipfile.rst python/branches/py3k-issue1717/Doc/license.rst python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst python/branches/py3k-issue1717/Doc/using/unix.rst python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst python/branches/py3k-issue1717/Include/pymacconfig.h python/branches/py3k-issue1717/Include/unicodeobject.h python/branches/py3k-issue1717/LICENSE python/branches/py3k-issue1717/Lib/dis.py python/branches/py3k-issue1717/Lib/distutils/ccompiler.py python/branches/py3k-issue1717/Lib/distutils/command/register.py python/branches/py3k-issue1717/Lib/distutils/config.py python/branches/py3k-issue1717/Lib/distutils/dist.py python/branches/py3k-issue1717/Lib/distutils/msvc9compiler.py python/branches/py3k-issue1717/Lib/distutils/tests/test_config.py python/branches/py3k-issue1717/Lib/distutils/tests/test_dist.py python/branches/py3k-issue1717/Lib/distutils/util.py python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt python/branches/py3k-issue1717/Lib/idlelib/configDialog.py python/branches/py3k-issue1717/Lib/io.py python/branches/py3k-issue1717/Lib/lib2to3/main.py python/branches/py3k-issue1717/Lib/pickle.py python/branches/py3k-issue1717/Lib/pydoc.py python/branches/py3k-issue1717/Lib/re.py python/branches/py3k-issue1717/Lib/ssl.py python/branches/py3k-issue1717/Lib/test/pickletester.py python/branches/py3k-issue1717/Lib/test/test_array.py python/branches/py3k-issue1717/Lib/test/test_bytes.py python/branches/py3k-issue1717/Lib/test/test_deque.py python/branches/py3k-issue1717/Lib/test/test_dict.py python/branches/py3k-issue1717/Lib/test/test_file.py python/branches/py3k-issue1717/Lib/test/test_fileio.py python/branches/py3k-issue1717/Lib/test/test_generators.py python/branches/py3k-issue1717/Lib/test/test_hash.py python/branches/py3k-issue1717/Lib/test/test_io.py python/branches/py3k-issue1717/Lib/test/test_set.py python/branches/py3k-issue1717/Lib/test/test_unittest.py python/branches/py3k-issue1717/Lib/test/test_urllib2.py python/branches/py3k-issue1717/Lib/test/test_zipfile.py python/branches/py3k-issue1717/Lib/tkinter/colorchooser.py python/branches/py3k-issue1717/Lib/tkinter/filedialog.py python/branches/py3k-issue1717/Lib/tkinter/scrolledtext.py python/branches/py3k-issue1717/Lib/unittest.py python/branches/py3k-issue1717/Lib/zipfile.py python/branches/py3k-issue1717/Mac/BuildScript/build-installer.py python/branches/py3k-issue1717/Mac/BuildScript/resources/Welcome.rtf python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/Info.plist python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE python/branches/py3k-issue1717/Mac/Makefile.in python/branches/py3k-issue1717/Mac/PythonLauncher/Info.plist.in python/branches/py3k-issue1717/Mac/PythonLauncher/Makefile.in python/branches/py3k-issue1717/Mac/Tools/fixapplepython23.py python/branches/py3k-issue1717/Makefile.pre.in python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/Misc/developers.txt python/branches/py3k-issue1717/Modules/_collectionsmodule.c python/branches/py3k-issue1717/Modules/_fileio.c python/branches/py3k-issue1717/Modules/_pickle.c python/branches/py3k-issue1717/Modules/_testcapimodule.c python/branches/py3k-issue1717/Modules/main.c python/branches/py3k-issue1717/Modules/mathmodule.c python/branches/py3k-issue1717/Modules/posixmodule.c python/branches/py3k-issue1717/Objects/bytearrayobject.c python/branches/py3k-issue1717/Objects/bytesobject.c python/branches/py3k-issue1717/Objects/dictobject.c python/branches/py3k-issue1717/Objects/object.c python/branches/py3k-issue1717/Objects/setobject.c python/branches/py3k-issue1717/Objects/unicodeobject.c python/branches/py3k-issue1717/Python/compile.c python/branches/py3k-issue1717/Python/getargs.c python/branches/py3k-issue1717/Tools/pybench/Lists.py python/branches/py3k-issue1717/setup.py Modified: python/branches/py3k-issue1717/Doc/Makefile ============================================================================== --- python/branches/py3k-issue1717/Doc/Makefile (original) +++ python/branches/py3k-issue1717/Doc/Makefile Fri Jan 2 15:30:39 2009 @@ -9,7 +9,7 @@ SPHINXOPTS = PAPER = SOURCES = -DISTVERSION = +DISTVERSION = $(shell $(PYTHON) tools/sphinxext/patchlevel.py) ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) @@ -111,33 +111,33 @@ # archive the HTML make html - cp -pPR build/html dist/python$(DISTVERSION)-docs-html - tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html - bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar - (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html) - rm -r dist/python$(DISTVERSION)-docs-html - rm dist/python$(DISTVERSION)-docs-html.tar + cp -pPR build/html dist/python-$(DISTVERSION)-docs-html + tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html + bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar + (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html) + rm -r dist/python-$(DISTVERSION)-docs-html + rm dist/python-$(DISTVERSION)-docs-html.tar # archive the text build make text - cp -pPR build/text dist/python$(DISTVERSION)-docs-text - tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text - bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar - (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text) - rm -r dist/python$(DISTVERSION)-docs-text - rm dist/python$(DISTVERSION)-docs-text.tar + cp -pPR build/text dist/python-$(DISTVERSION)-docs-text + tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text + bzip2 -9 -k dist/python-$(DISTVERSION)-docs-text.tar + (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text) + rm -r dist/python-$(DISTVERSION)-docs-text + rm dist/python-$(DISTVERSION)-docs-text.tar # archive the A4 latex -rm -r build/latex make latex PAPER=a4 (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) - cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-a4.zip - cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-a4.tar.bz2 + cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip + cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2 # archive the letter latex rm -r build/latex make latex PAPER=letter (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) - cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-letter.zip - cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-letter.tar.bz2 + cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip + cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 Modified: python/branches/py3k-issue1717/Doc/README.txt ============================================================================== --- python/branches/py3k-issue1717/Doc/README.txt (original) +++ python/branches/py3k-issue1717/Doc/README.txt Fri Jan 2 15:30:39 2009 @@ -81,8 +81,7 @@ svn co http://svn.python.org/projects/doctools/trunk/sphinx tools/sphinx -Then, you need to install Docutils 0.4 (the SVN snapshot won't work), either -by checking it out via :: +Then, you need to install Docutils, either by checking it out via :: svn co http://svn.python.org/projects/external/docutils-0.4/docutils tools/docutils @@ -99,19 +98,18 @@ python tools/sphinx-build.py -b . build/ -where `` is one of html, web or htmlhelp (for explanations see the make -targets above). +where `` is one of html, text, latex, or htmlhelp (for explanations see +the make targets above). Contributing ============ -For bugs in the content, the online version at http://docs.python.org/ has a -"suggest change" facility that can be used to correct errors in the source text -and submit them as a patch to the maintainers. +Bugs in the content should be reported to the Python bug tracker at +http://bugs.python.org. -Bugs in the toolset should be reported in the Python bug tracker at -http://bugs.python.org/. +Bugs in the toolset should be reported in the Sphinx bug tracker at +http://www.bitbucket.org/birkenfeld/sphinx/issues/. You can also send a mail to the Python Documentation Team at docs at python.org, and we will process your request as soon as possible. Modified: python/branches/py3k-issue1717/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/arg.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/arg.rst Fri Jan 2 15:30:39 2009 @@ -164,8 +164,9 @@ them. Instead, the implementation assumes that the string object uses the encoding passed in as parameter. -``b`` (integer) [char] - Convert a Python integer to a tiny int, stored in a C :ctype:`char`. +``b`` (integer) [unsigned char] + Convert a nonnegative Python integer to an unsigned tiny int, stored in a C + :ctype:`unsigned char`. ``B`` (integer) [unsigned char] Convert a Python integer to a tiny int without overflow checking, stored in a C @@ -305,8 +306,8 @@ ``;`` The list of format units ends here; the string after the semicolon is used as - the error message *instead* of the default error message. Clearly, ``:`` and - ``;`` mutually exclude each other. + the error message *instead* of the default error message. ``:`` and ``;`` + mutually exclude each other. Note that any Python object references which are provided to the caller are *borrowed* references; do not decrement their reference count! @@ -552,3 +553,8 @@ If there is an error in the format string, the :exc:`SystemError` exception is set and *NULL* returned. + +.. cfunction:: PyObject* Py_VaBuildValue(const char *format, va_list vargs) + + Identical to :cfunc:`Py_BuildValue`, except that it accepts a va_list + rather than a variable number of arguments. Modified: python/branches/py3k-issue1717/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/exceptions.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/exceptions.rst Fri Jan 2 15:30:39 2009 @@ -67,11 +67,10 @@ .. cfunction:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc) - Return true if the *given* exception matches the exception in *exc*. If *exc* - is a class object, this also returns true when *given* is an instance of a - subclass. If *exc* is a tuple, all exceptions in the tuple (and recursively in - subtuples) are searched for a match. If *given* is *NULL*, a memory access - violation will occur. + Return true if the *given* exception matches the exception in *exc*. If + *exc* is a class object, this also returns true when *given* is an instance + of a subclass. If *exc* is a tuple, all exceptions in the tuple (and + recursively in subtuples) are searched for a match. .. cfunction:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb) Modified: python/branches/py3k-issue1717/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/apiref.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/apiref.rst Fri Jan 2 15:30:39 2009 @@ -88,9 +88,9 @@ | *options* | default options for the setup | a string | | | script | | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *license* | The license for the package | | + | *license* | The license for the package | a string | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *keywords* | Descriptive meta-data. See | | + | *keywords* | Descriptive meta-data, see | | | | :pep:`314` | | +--------------------+--------------------------------+-------------------------------------------------------------+ | *platforms* | | | @@ -98,6 +98,13 @@ | *cmdclass* | A mapping of command names to | a dictionary | | | :class:`Command` subclasses | | +--------------------+--------------------------------+-------------------------------------------------------------+ + | *data_files* | A list of data files to | a list | + | | install | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + | *package_dir* | A mapping of package to | a dictionary | + | | directory names | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -1100,6 +1107,24 @@ For non-POSIX platforms, currently just returns ``sys.platform``. + For MacOS X systems the OS version reflects the minimal version on which + binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` + during the build of Python), not the OS version of the current system. + + For universal binary builds on MacOS X the architecture value reflects + the univeral binary status instead of the architecture of the current + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. + + Examples of returned values on MacOS X: + + * ``macosx-10.3-ppc`` + + * ``macosx-10.3-fat`` + + * ``macosx-10.5-universal`` + .. % XXX isn't this also provided by some other non-distutils module? Modified: python/branches/py3k-issue1717/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/setupscript.rst Fri Jan 2 15:30:39 2009 @@ -561,6 +561,8 @@ +----------------------+---------------------------+-----------------+--------+ | ``classifiers`` | a list of classifiers | list of strings | \(4) | +----------------------+---------------------------+-----------------+--------+ +| ``platforms`` | a list of platforms | list of strings | | ++----------------------+---------------------------+-----------------+--------+ Notes: Modified: python/branches/py3k-issue1717/Doc/extending/extending.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/extending/extending.rst (original) +++ python/branches/py3k-issue1717/Doc/extending/extending.rst Fri Jan 2 15:30:39 2009 @@ -326,8 +326,8 @@ return PyModule_Create(&spammodule); } -Note that PyMODINIT_FUNC declares the function as ``void`` return type, -declares any special linkage declarations required by the platform, and for C++ +Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return type, +declares any special linkage declarations required by the platform, and for C++ declares the function as ``extern "C"``. When the Python program imports module :mod:`spam` for the first time, @@ -882,7 +882,7 @@ The advantage of borrowing over owning a reference is that you don't need to take care of disposing of the reference on all possible paths through the code --- in other words, with a borrowed reference you don't run the risk of leaking -when a premature exit is taken. The disadvantage of borrowing over leaking is +when a premature exit is taken. The disadvantage of borrowing over owning is that there are some subtle situations where in seemingly correct code a borrowed reference can be used after the owner from which it was borrowed has in fact disposed of it. Modified: python/branches/py3k-issue1717/Doc/howto/functional.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/functional.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/functional.rst Fri Jan 2 15:30:39 2009 @@ -677,11 +677,10 @@ if line.strip() == '': print('Blank line at line #%i' % i) - -``sorted(iterable, [key=None], [reverse=False)`` collects all the -elements of the iterable into a list, sorts the list, and returns the sorted -result. The ``key`` and ``reverse`` arguments are passed through to -the constructed list's ``.sort()`` method. :: +``sorted(iterable, [key=None], [reverse=False])`` collects all the elements of +the iterable into a list, sorts the list, and returns the sorted result. The +``key``, and ``reverse`` arguments are passed through to the constructed list's +``.sort()`` method. :: >>> import random >>> # Generate 8 random numbers between [0, 10000) Modified: python/branches/py3k-issue1717/Doc/howto/unicode.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/unicode.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/unicode.rst Fri Jan 2 15:30:39 2009 @@ -32,7 +32,7 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHER EST COMPLETE." + PRINT "FICHIER EST COMPLETE." PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who Modified: python/branches/py3k-issue1717/Doc/includes/noddy.c ============================================================================== --- python/branches/py3k-issue1717/Doc/includes/noddy.c (original) +++ python/branches/py3k-issue1717/Doc/includes/noddy.c Fri Jan 2 15:30:39 2009 @@ -52,4 +52,5 @@ Py_INCREF(&noddy_NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType); + return m; } Modified: python/branches/py3k-issue1717/Doc/includes/noddy2.c ============================================================================== --- python/branches/py3k-issue1717/Doc/includes/noddy2.c (original) +++ python/branches/py3k-issue1717/Doc/includes/noddy2.c Fri Jan 2 15:30:39 2009 @@ -186,4 +186,5 @@ Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); + return m; } Modified: python/branches/py3k-issue1717/Doc/includes/noddy3.c ============================================================================== --- python/branches/py3k-issue1717/Doc/includes/noddy3.c (original) +++ python/branches/py3k-issue1717/Doc/includes/noddy3.c Fri Jan 2 15:30:39 2009 @@ -239,4 +239,5 @@ Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); + return m; } Modified: python/branches/py3k-issue1717/Doc/includes/noddy4.c ============================================================================== --- python/branches/py3k-issue1717/Doc/includes/noddy4.c (original) +++ python/branches/py3k-issue1717/Doc/includes/noddy4.c Fri Jan 2 15:30:39 2009 @@ -221,4 +221,5 @@ Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); + return m; } Modified: python/branches/py3k-issue1717/Doc/library/dis.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/dis.rst (original) +++ python/branches/py3k-issue1717/Doc/library/dis.rst Fri Jan 2 15:30:39 2009 @@ -64,10 +64,23 @@ .. function:: disco(code[, lasti]) - A synonym for disassemble. It is more convenient to type, and kept for - compatibility with earlier Python releases. + A synonym for :func:`disassemble`. It is more convenient to type, and kept + for compatibility with earlier Python releases. +.. function:: findlinestarts(code) + + This generator function uses the ``co_firstlineno`` and ``co_lnotab`` + attributes of the code object *code* to find the offsets which are starts of + lines in the source code. They are generated as ``(offset, lineno)`` pairs. + + +.. function:: findlabels(code) + + Detect all offsets in the code object *code* which are jump targets, and + return a list of these offsets. + + .. data:: opname Sequence of operation names, indexable using the bytecode. Modified: python/branches/py3k-issue1717/Doc/library/email.mime.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/email.mime.rst (original) +++ python/branches/py3k-issue1717/Doc/library/email.mime.rst Fri Jan 2 15:30:39 2009 @@ -19,6 +19,7 @@ Here are the classes: +.. currentmodule:: email.mime.base .. class:: MIMEBase(_maintype, _subtype, **_params) @@ -39,6 +40,8 @@ :mailheader:`MIME-Version` header (always set to ``1.0``). +.. currentmodule:: email.mime.nonmultipart + .. class:: MIMENonMultipart() Module: :mod:`email.mime.nonmultipart` @@ -50,6 +53,8 @@ :exc:`MultipartConversionError` exception is raised. +.. currentmodule:: email.mime.multipart + .. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` @@ -73,6 +78,8 @@ dictionary. +.. currentmodule:: email.mime.application + .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.application` @@ -93,6 +100,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.audio + .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.audio` @@ -116,6 +125,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.image + .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.image` @@ -139,6 +150,8 @@ *_params* are passed straight through to the :class:`MIMEBase` constructor. +.. currentmodule:: email.mime.message + .. class:: MIMEMessage(_msg[, _subtype]) Module: :mod:`email.mime.message` @@ -152,6 +165,8 @@ :mimetype:`rfc822`. +.. currentmodule:: email.mime.text + .. class:: MIMEText(_text[, _subtype[, _charset]]) Module: :mod:`email.mime.text` Modified: python/branches/py3k-issue1717/Doc/library/functions.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/functions.rst (original) +++ python/branches/py3k-issue1717/Doc/library/functions.rst Fri Jan 2 15:30:39 2009 @@ -1172,47 +1172,64 @@ This is an advanced function that is not needed in everyday Python programming. - The function is invoked by the :keyword:`import` statement. It mainly exists - so that you can replace it with another function that has a compatible - interface, in order to change the semantics of the :keyword:`import` - statement. See the built-in module :mod:`imp`, which defines some useful - operations out of which you can build your own :func:`__import__` function. - - For example, the statement ``import spam`` results in the following call: - ``__import__('spam', globals(), locals(), [], -1)``; the statement - ``from spam.ham import eggs`` results in ``__import__('spam.ham', globals(), - locals(), ['eggs'], -1)``. Note that even though ``locals()`` and ``['eggs']`` - are passed in as arguments, the :func:`__import__` function does not set the - local variable named ``eggs``; this is done by subsequent code that is generated - for the import statement. (In fact, the standard implementation does not use - its *locals* argument at all, and uses its *globals* only to determine the - package context of the :keyword:`import` statement.) + This function is invoked by the :keyword:`import` statement. It can be + replaced (by importing the :mod:`builtins` module and assigning to + ``builtins.__import__``) in order to change semantics of the + :keyword:`import` statement, but nowadays it is usually simpler to use import + hooks (see :pep:`302`). Direct use of :func:`__import__` is rare, except in + cases where you want to import a module whose name is only known at runtime. + + The function imports the module *name*, potentially using the given *globals* + and *locals* to determine how to interpret the name in a package context. + The *fromlist* gives the names of objects or submodules that should be + imported from the module given by *name*. The standard implementation does + not use its *locals* argument at all, and uses its *globals* only to + determine the package context of the :keyword:`import` statement. + + *level* specifies whether to use absolute or relative imports. The default + is ``-1`` which indicates both absolute and relative imports will be + attempted. ``0`` means only perform absolute imports. Positive values for + *level* indicate the number of parent directories to search relative to the + directory of the module calling :func:`__import__`. When the *name* variable is of the form ``package.module``, normally, the top-level package (the name up till the first dot) is returned, *not* the module named by *name*. However, when a non-empty *fromlist* argument is - given, the module named by *name* is returned. This is done for - compatibility with the :term:`bytecode` generated for the different kinds of import - statement; when using ``import spam.ham.eggs``, the top-level package - :mod:`spam` must be placed in the importing namespace, but when using ``from - spam.ham import eggs``, the ``spam.ham`` subpackage must be used to find the - ``eggs`` variable. As a workaround for this behavior, use :func:`getattr` to - extract the desired components. For example, you could define the following - helper:: - - def my_import(name): - mod = __import__(name) - components = name.split('.') - for comp in components[1:]: - mod = getattr(mod, comp) - return mod - - *level* specifies whether to use absolute or relative imports. The default is - ``-1`` which indicates both absolute and relative imports will be attempted. - ``0`` means only perform absolute imports. Positive values for *level* indicate - the number of parent directories to search relative to the directory of the - module calling :func:`__import__`. + given, the module named by *name* is returned. + For example, the statement ``import spam`` results in bytecode resembling the + following code:: + + spam = __import__('spam', globals(), locals(), [], -1) + + The statement ``import spam.ham`` results in this call:: + + spam = __import__('spam.ham', globals(), locals(), [], -1) + + Note how :func:`__import__` returns the toplevel module here because this is + the object that is bound to a name by the :keyword:`import` statement. + + On the other hand, the statement ``from spam.ham import eggs, sausage as + saus`` results in :: + + _temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], -1) + eggs = _temp.eggs + saus = _temp.sausage + + Here, the ``spam.ham`` module is returned from :func:`__import__`. From this + object, the names to import are retrieved and assigned to their respective + names. + + If you simply want to import a module (potentially within a package) by name, + you can get it from :data:`sys.modules`:: + + >>> import sys + >>> name = 'foo.bar.baz' + >>> __import__(name) + + >>> baz = sys.modules[name] + >>> baz + .. rubric:: Footnotes Modified: python/branches/py3k-issue1717/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/hashlib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/hashlib.rst Fri Jan 2 15:30:39 2009 @@ -64,7 +64,7 @@ More condensed: >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() - b'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' + 'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' A generic :func:`new` constructor that takes the string name of the desired algorithm as its first parameter also exists to allow access to the above listed @@ -76,7 +76,7 @@ >>> h = hashlib.new('ripemd160') >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() - b'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc' + 'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc' The following values are provided as constant attributes of the hash objects returned by the constructors: Modified: python/branches/py3k-issue1717/Doc/library/json.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/json.rst (original) +++ python/branches/py3k-issue1717/Doc/library/json.rst Fri Jan 2 15:30:39 2009 @@ -165,7 +165,7 @@ :func:`dump`. -.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -201,7 +201,7 @@ class. -.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON document) to a Python object. Modified: python/branches/py3k-issue1717/Doc/library/logging.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/logging.rst (original) +++ python/branches/py3k-issue1717/Doc/library/logging.rst Fri Jan 2 15:30:39 2009 @@ -566,10 +566,10 @@ The :class:`NullHandler` class was not present in previous versions. -The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the -core logging package. The other handlers are defined in a sub- module, -:mod:`logging.handlers`. (There is also another sub-module, -:mod:`logging.config`, for configuration functionality.) +The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` +classes are defined in the core logging package. The other handlers are +defined in a sub- module, :mod:`logging.handlers`. (There is also another +sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the :class:`Formatter` class. They are initialized with a format string suitable for @@ -1534,6 +1534,8 @@ StreamHandler ^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -2035,6 +2037,8 @@ Formatter Objects ----------------- +.. currentmodule:: logging + :class:`Formatter`\ s have the following attributes and methods. They are responsible for converting a :class:`LogRecord` to (usually) a string which can be interpreted by either a human or an external system. The base Modified: python/branches/py3k-issue1717/Doc/library/math.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/math.rst (original) +++ python/branches/py3k-issue1717/Doc/library/math.rst Fri Jan 2 15:30:39 2009 @@ -21,8 +21,9 @@ The following functions are provided by this module. Except when explicitly noted otherwise, all return values are floats. -Number-theoretic and representation functions: +Number-theoretic and representation functions +--------------------------------------------- .. function:: ceil(x) @@ -110,8 +111,8 @@ .. function:: modf(x) - Return the fractional and integer parts of *x*. Both results carry the sign of - *x*, and both are floats. + Return the fractional and integer parts of *x*. Both results carry the sign + of *x* and are floats. .. function:: trunc(x) @@ -131,7 +132,9 @@ platform C double type), in which case any float *x* with ``abs(x) >= 2**52`` necessarily has no fractional bits. -Power and logarithmic functions: + +Power and logarithmic functions +------------------------------- .. function:: exp(x) @@ -169,7 +172,8 @@ Return the square root of *x*. -Trigonometric functions: +Trigonometric functions +----------------------- .. function:: acos(x) @@ -217,7 +221,8 @@ Return the tangent of *x* radians. -Angular conversion: +Angular conversion +------------------ .. function:: degrees(x) @@ -229,7 +234,8 @@ Converts angle *x* from degrees to radians. -Hyperbolic functions: +Hyperbolic functions +-------------------- .. function:: acosh(x) @@ -262,9 +268,8 @@ Return the hyperbolic tangent of *x*. - -The module also defines two mathematical constants: - +Constants +========= .. data:: pi Modified: python/branches/py3k-issue1717/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k-issue1717/Doc/library/multiprocessing.rst Fri Jan 2 15:30:39 2009 @@ -356,7 +356,7 @@ .. attribute:: daemon - The process's daemon flag, a Boolean value. This must be called before + The process's daemon flag, a Boolean value. This must be set before :meth:`start` is called. The initial value is inherited from the creating process. @@ -1436,13 +1436,13 @@ Proxy objects are instances of subclasses of :class:`BaseProxy`. - .. method:: _call_method(methodname[, args[, kwds]]) + .. method:: _callmethod(methodname[, args[, kwds]]) Call and return the result of a method of the proxy's referent. If ``proxy`` is a proxy whose referent is ``obj`` then the expression :: - proxy._call_method(methodname, args, kwds) + proxy._callmethod(methodname, args, kwds) will evaluate the expression :: @@ -1455,26 +1455,26 @@ argument of :meth:`BaseManager.register`. If an exception is raised by the call, then then is re-raised by - :meth:`_call_method`. If some other exception is raised in the manager's + :meth:`_callmethod`. If some other exception is raised in the manager's process then this is converted into a :exc:`RemoteError` exception and is - raised by :meth:`_call_method`. + raised by :meth:`_callmethod`. Note in particular that an exception will be raised if *methodname* has not been *exposed* - An example of the usage of :meth:`_call_method`:: + An example of the usage of :meth:`_callmethod`:: >>> l = manager.list(range(10)) - >>> l._call_method('__len__') + >>> l._callmethod('__len__') 10 - >>> l._call_method('__getslice__', (2, 7)) # equiv to `l[2:7]` + >>> l._callmethod('__getslice__', (2, 7)) # equiv to `l[2:7]` [2, 3, 4, 5, 6] - >>> l._call_method('__getitem__', (20,)) # equiv to `l[20]` + >>> l._callmethod('__getitem__', (20,)) # equiv to `l[20]` Traceback (most recent call last): ... IndexError: list index out of range - .. method:: _get_value() + .. method:: _getvalue() Return a copy of the referent. @@ -1808,9 +1808,9 @@ filesystem. * An ``'AF_PIPE'`` address is a string of the form - ``r'\\\\.\\pipe\\PipeName'``. To use :func:`Client` to connect to a named + :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called ServerName* one should use an address of the - form ``r'\\\\ServerName\\pipe\\PipeName'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. Modified: python/branches/py3k-issue1717/Doc/library/optparse.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/optparse.rst (original) +++ python/branches/py3k-issue1717/Doc/library/optparse.rst Fri Jan 2 15:30:39 2009 @@ -1625,36 +1625,33 @@ Nevertheless, here's a stab at a callback for an option with variable arguments:: - def vararg_callback(option, opt_str, value, parser): - assert value is None - done = 0 - value = [] - rargs = parser.rargs - while rargs: - arg = rargs[0] - - # Stop if we hit an arg like "--foo", "-a", "-fx", "--file=f", - # etc. Note that this also stops on "-3" or "-3.0", so if - # your option takes numeric values, you will need to handle - # this. - if ((arg[:2] == "--" and len(arg) > 2) or - (arg[:1] == "-" and len(arg) > 1 and arg[1] != "-")): - break - else: - value.append(arg) - del rargs[0] + def vararg_callback(option, opt_str, value, parser): + assert value is None + value = [] + + def floatable(str): + try: + float(str) + return True + except ValueError: + return False + + for arg in parser.rargs: + # stop on --foo like options + if arg[:2] == "--" and len(arg) > 2: + break + # stop on -a, but not on -3 or -3.0 + if arg[:1] == "-" and len(arg) > 1 and not floatable(arg): + break + value.append(arg) - setattr(parser.values, option.dest, value) + del parser.rargs[:len(value)] + setattr(parser.values, option.dest, value)) [...] parser.add_option("-c", "--callback", dest="vararg_attr", action="callback", callback=vararg_callback) -The main weakness with this particular implementation is that negative numbers -in the arguments following ``"-c"`` will be interpreted as further options -(probably causing an error), rather than as arguments to ``"-c"``. Fixing this -is left as an exercise for the reader. - .. _optparse-extending-optparse: Modified: python/branches/py3k-issue1717/Doc/library/pydoc.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/pydoc.rst (original) +++ python/branches/py3k-issue1717/Doc/library/pydoc.rst Fri Jan 2 15:30:39 2009 @@ -34,6 +34,13 @@ Unix), and refers to an existing Python source file, then documentation is produced for that file. +.. note:: + + In order to find objects and their documentation, :mod:`pydoc` imports the + module(s) to be documented. Therefore, any code on module level will be + executed on that occasion. Use an ``if __name__ == '__main__':`` guard to + only execute code when a file is invoked as a script and not just imported. + Specifying a :option:`-w` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text on the console. Modified: python/branches/py3k-issue1717/Doc/library/shutil.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/shutil.rst (original) +++ python/branches/py3k-issue1717/Doc/library/shutil.rst Fri Jan 2 15:30:39 2009 @@ -139,7 +139,7 @@ Recursively move a file or directory to another location. If the destination is on the current filesystem, then simply use rename. - Otherwise, copy src to the dst and then remove src. + Otherwise, copy src (with :func:`copy2`) to the dst and then remove src. .. exception:: Error Modified: python/branches/py3k-issue1717/Doc/library/signal.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/signal.rst (original) +++ python/branches/py3k-issue1717/Doc/library/signal.rst Fri Jan 2 15:30:39 2009 @@ -52,10 +52,10 @@ .. data:: SIG_DFL - This is one of two standard signal handling options; it will simply perform the - default function for the signal. For example, on most systems the default - action for :const:`SIGQUIT` is to dump core and exit, while the default action - for :const:`SIGCLD` is to simply ignore it. + This is one of two standard signal handling options; it will simply perform + the default function for the signal. For example, on most systems the + default action for :const:`SIGQUIT` is to dump core and exit, while the + default action for :const:`SIGCHLD` is to simply ignore it. .. data:: SIG_IGN Modified: python/branches/py3k-issue1717/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/stdtypes.rst (original) +++ python/branches/py3k-issue1717/Doc/library/stdtypes.rst Fri Jan 2 15:30:39 2009 @@ -442,7 +442,7 @@ Equivalent to:: def bit_length(self): - s = bin(self) # binary representation: bin(-37) --> '-0b100101' + s = bin(x) # binary representation: bin(-37) --> '-0b100101' s = s.lstrip('-0b') # remove leading zeros and minus sign return len(s) # len('100101') --> 6 @@ -1116,13 +1116,12 @@ .. method:: str.translate(map) Return a copy of the *s* where all characters have been mapped through the - *map* which must be a dictionary of Unicode ordinals(integers) to Unicode + *map* which must be a dictionary of Unicode ordinals (integers) to Unicode ordinals, strings or ``None``. Unmapped characters are left untouched. Characters mapped to ``None`` are deleted. - You can use :meth:`str.maketrans` to create a translation table. For string - objects, set the *table* argument to ``None`` for translations that only - delete characters: + You can use :meth:`str.maketrans` to create a translation map from + character-to-character mappings in different formats. .. note:: @@ -1525,23 +1524,23 @@ >>> bytes.fromhex('f0 f1f2 ') b'\xf0\xf1\xf2' -.. XXX verify/document translate() semantics! - - .. method:: bytes.translate(table[, delete]) +The translate method differs in semantics from the version available on strings: + +.. method:: bytes.translate(table[, delete]) - Return a copy of the bytes object where all bytes occurring in the optional - argument *delete* are removed, and the remaining bytes have been mapped - through the given translation table, which must be a bytes object of length - 256. + Return a copy of the bytes or bytearray object where all bytes occurring in + the optional argument *delete* are removed, and the remaining bytes have been + mapped through the given translation table, which must be a bytes object of + length 256. - You can use the :func:`maketrans` helper function in the :mod:`string` module to - create a translation table. + You can use the :func:`string.maketrans` helper function to create a + translation table. - .. XXX a None table doesn't seem to be supported - Set the *table* argument to ``None`` for translations that only delete characters:: + Set the *table* argument to ``None`` for translations that only delete + characters:: - >>> 'read this short text'.translate(None, 'aeiou') - 'rd ths shrt txt' + >>> b'read this short text'.translate(None, b'aeiou') + b'rd ths shrt txt' .. _types-set: Modified: python/branches/py3k-issue1717/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/subprocess.rst (original) +++ python/branches/py3k-issue1717/Doc/library/subprocess.rst Fri Jan 2 15:30:39 2009 @@ -197,6 +197,8 @@ >>> subprocess.getstatusoutput('/bin/junk') (256, 'sh: /bin/junk: not found') + Availability: UNIX. + .. function:: getoutput(cmd) Return output (stdout and stderr) of executing *cmd* in a shell. @@ -208,6 +210,8 @@ >>> subprocess.getoutput('ls /bin/ls') '/bin/ls' + Availability: UNIX. + Exceptions ^^^^^^^^^^ Modified: python/branches/py3k-issue1717/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/unittest.rst (original) +++ python/branches/py3k-issue1717/Doc/library/unittest.rst Fri Jan 2 15:30:39 2009 @@ -610,8 +610,8 @@ equal, the test will fail with the explanation given by *msg*, or :const:`None`. -.. method:: TestCase.assertRaises(exception, callable, ...) - TestCase.failUnlessRaises(exception, callable, ...) +.. method:: TestCase.assertRaises(exception[, callable, ...]) + TestCase.failUnlessRaises(exception[, callable, ...]) Test that an exception is raised when *callable* is called with any positional or keyword arguments that are also passed to :meth:`assertRaises`. The test @@ -619,6 +619,11 @@ fails if no exception is raised. To catch any of a group of exceptions, a tuple containing the exception classes may be passed as *exception*. + If *callable* is omitted or None, returns a context manager so that the code + under test can be written inline rather than as a function:: + + with self.failUnlessRaises(some_error_class): + do_something() .. method:: TestCase.failIf(expr[, msg]) TestCase.assertFalse(expr[, msg]) Modified: python/branches/py3k-issue1717/Doc/library/webbrowser.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/webbrowser.rst (original) +++ python/branches/py3k-issue1717/Doc/library/webbrowser.rst Fri Jan 2 15:30:39 2009 @@ -167,7 +167,7 @@ Browser Controller Objects -------------------------- -Browser controllers provide two methods which parallel two of the module-level +Browser controllers provide these methods which parallel two of the module-level convenience functions: Modified: python/branches/py3k-issue1717/Doc/library/winsound.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/winsound.rst (original) +++ python/branches/py3k-issue1717/Doc/library/winsound.rst Fri Jan 2 15:30:39 2009 @@ -26,8 +26,9 @@ Call the underlying :cfunc:`PlaySound` function from the Platform API. The *sound* parameter may be a filename, audio data as a string, or ``None``. Its interpretation depends on the value of *flags*, which can be a bitwise ORed - combination of the constants described below. If the system indicates an error, - :exc:`RuntimeError` is raised. + combination of the constants described below. If the *sound* parameter is + ``None``, any currently playing waveform sound is stopped. If the system + indicates an error, :exc:`RuntimeError` is raised. .. function:: MessageBeep([type=MB_OK]) @@ -102,6 +103,10 @@ Stop playing all instances of the specified sound. + .. note:: + + This flag is not supported on modern Windows platforms. + .. data:: SND_ASYNC Modified: python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst Fri Jan 2 15:30:39 2009 @@ -94,6 +94,16 @@ *events* is a list of events to report back. If omitted, only "end" events are reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs. + .. note:: + + :func:`iterparse` only guarantees that it has seen the ">" + character of a starting tag when it emits a "start" event, so the + attributes are defined, but the contents of the text and tail attributes + are undefined at that point. The same applies to the element children; + they may or may not be present. + + If you need a fully populated element, look for "end" events instead. + .. function:: parse(source[, parser]) Modified: python/branches/py3k-issue1717/Doc/library/zipfile.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/zipfile.rst (original) +++ python/branches/py3k-issue1717/Doc/library/zipfile.rst Fri Jan 2 15:30:39 2009 @@ -64,9 +64,11 @@ .. function:: is_zipfile(filename) Returns ``True`` if *filename* is a valid ZIP file based on its magic number, - otherwise returns ``False``. This module does not currently handle ZIP files - which have appended comments. + otherwise returns ``False``. *filename* may be a file or file-like object too. + This module does not currently handle ZIP files which have appended comments. + .. versionchanged:: 2.7 + Support for file and file-like objects. .. data:: ZIP_STORED Modified: python/branches/py3k-issue1717/Doc/license.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/license.rst (original) +++ python/branches/py3k-issue1717/Doc/license.rst Fri Jan 2 15:30:39 2009 @@ -31,6 +31,7 @@ Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. +<<<<<<< .working +----------------+--------------+------------+------------+-----------------+ | Release | Derived from | Year | Owner | GPL compatible? | +================+==============+============+============+=================+ @@ -90,9 +91,12 @@ +----------------+--------------+------------+------------+-----------------+ | 2.6 | 2.5 | 2008 | PSF | yes | +----------------+--------------+------------+------------+-----------------+ +| 2.6.1 | 2.6 | 2008 | PSF | yes | ++----------------+--------------+------------+------------+-----------------+ | 3.0 | 2.6 | 2008 | PSF | yes | +----------------+--------------+------------+------------+-----------------+ + .. note:: GPL-compatible doesn't mean that we're distributing Python under the GPL. All Deleted: python/branches/py3k-issue1717/Doc/tools/sphinx-web.py ============================================================================== --- python/branches/py3k-issue1717/Doc/tools/sphinx-web.py Fri Jan 2 15:30:39 2009 +++ (empty file) @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -""" - Sphinx - Python documentation webserver - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - :copyright: 2007 by Georg Brandl. - :license: Python license. -""" - -import sys - -if __name__ == '__main__': - from sphinx.web import main - sys.exit(main(sys.argv)) Modified: python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html (original) +++ python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html Fri Jan 2 15:30:39 2009 @@ -19,20 +19,20 @@ - - + + - - + + - - + + - +
FormatPacked as .zipPacked as .tar.bz2
PDF (US-Letter paper size)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)
PDF (A4 paper size)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)
HTMLDownload (ca. 6 MB)Download (ca. 4 MB)Download (ca. 6 MB)Download (ca. 4 MB)
Plain Text Download (ca. 2 MB)Download (ca. 1.5 MB)Download (ca. 1.5 MB)
Modified: python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py Fri Jan 2 15:30:39 2009 @@ -45,7 +45,11 @@ from pprint import pformat from docutils.io import StringOutput from docutils.utils import new_document -from sphinx.builder import Builder + +try: + from sphinx.builders import Builder +except ImportError: + from sphinx.builder import Builder try: from sphinx.writers.text import TextWriter Modified: python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst Fri Jan 2 15:30:39 2009 @@ -200,42 +200,20 @@ ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... -This is commonly used for creating minimal classes such as exceptions, or -for ignoring unwanted exceptions:: +This is commonly used for creating minimal classes:: - >>> class ParserError(Exception): + >>> class MyEmptyClass: ... pass - ... - >>> try: - ... import audioop - ... except ImportError: - ... pass - ... + ... Another place :keyword:`pass` can be used is as a place-holder for a function or -conditional body when you are working on new code, allowing you to keep -thinking at a more abstract level. However, as :keyword:`pass` is silently -ignored, a better choice may be to raise a :exc:`NotImplementedError` -exception:: +conditional body when you are working on new code, allowing you to keep thinking +at a more abstract level. The :keyword:`pass` is silently ignored:: >>> def initlog(*args): - ... raise NotImplementedError # Open logfile if not already open - ... if not logfp: - ... raise NotImplementedError # Set up dummy log back-end - ... raise NotImplementedError('Call log initialization handler') + ... pass # Remember to implement this! ... -If :keyword:`pass` were used here and you later ran tests, they may fail -without indicating why. Using :exc:`NotImplementedError` causes this code -to raise an exception, telling you exactly where the incomplete code -is. Note the two calling styles of the exceptions above. -The first style, with no message but with an accompanying comment, -lets you easily leave the comment when you remove the exception, -which ideally would be a good description for -the block of code the exception is a placeholder for. However, the -third example, providing a message for the exception, will produce -a more useful traceback. - .. _tut-functions: Defining Functions Modified: python/branches/py3k-issue1717/Doc/using/unix.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/using/unix.rst (original) +++ python/branches/py3k-issue1717/Doc/using/unix.rst Fri Jan 2 15:30:39 2009 @@ -140,8 +140,8 @@ Vim and Emacs are excellent editors which support Python very well. For more information on how to code in python in these editors, look at: -http://www.vim.org/scripts/script.php?script_id=790 -http://sourceforge.net/projects/python-mode +* http://www.vim.org/scripts/script.php?script_id=790 +* http://sourceforge.net/projects/python-mode Geany is an excellent IDE with support for a lot of languages. For more information, read: http://geany.uvena.de/ Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst Fri Jan 2 15:30:39 2009 @@ -738,7 +738,7 @@ Curly brackets can be escaped by doubling them:: - >>> format("Empty dict: {{}}") + >>> "Empty dict: {{}}".format() "Empty dict: {}" Field names can be integers indicating positional arguments, such as Modified: python/branches/py3k-issue1717/Include/pymacconfig.h ============================================================================== --- python/branches/py3k-issue1717/Include/pymacconfig.h (original) +++ python/branches/py3k-issue1717/Include/pymacconfig.h Fri Jan 2 15:30:39 2009 @@ -15,6 +15,8 @@ # undef SIZEOF_SIZE_T # undef SIZEOF_TIME_T # undef SIZEOF_VOID_P +# undef SIZEOF__BOOL +# undef WORDS_BIGENDIAN # undef VA_LIST_IS_ARRAY # if defined(__LP64__) && defined(__x86_64__) @@ -28,12 +30,19 @@ # undef SIZEOF_LONG # ifdef __LP64__ +# define SIZEOF__BOOL 1 +# define SIZEOF__BOOL 1 # define SIZEOF_LONG 8 # define SIZEOF_PTHREAD_T 8 # define SIZEOF_SIZE_T 8 # define SIZEOF_TIME_T 8 # define SIZEOF_VOID_P 8 # else +# ifdef __ppc__ +# define SIZEOF__BOOL 4 +# else +# define SIZEOF__BOOL 1 +# endif # define SIZEOF_LONG 4 # define SIZEOF_PTHREAD_T 4 # define SIZEOF_SIZE_T 4 @@ -54,6 +63,11 @@ # endif +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#endif /* __BIG_ENDIAN */ + + #endif /* defined(_APPLE__) */ #endif /* PYMACCONFIG_H */ Modified: python/branches/py3k-issue1717/Include/unicodeobject.h ============================================================================== --- python/branches/py3k-issue1717/Include/unicodeobject.h (original) +++ python/branches/py3k-issue1717/Include/unicodeobject.h Fri Jan 2 15:30:39 2009 @@ -152,6 +152,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS2_Compare # define PyUnicode_Concat PyUnicodeUCS2_Concat # define PyUnicode_Append PyUnicodeUCS2_Append @@ -185,13 +186,13 @@ # define PyUnicode_Find PyUnicodeUCS2_Find # define PyUnicode_Format PyUnicodeUCS2_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS2_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromString PyUnicodeUCS2_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS2_GetMax @@ -213,7 +214,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS2_Fini # define _PyUnicode_Init _PyUnicodeUCS2_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit @@ -250,6 +250,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS4_Compare # define PyUnicode_Concat PyUnicodeUCS4_Concat # define PyUnicode_Append PyUnicodeUCS4_Append @@ -283,13 +284,13 @@ # define PyUnicode_Find PyUnicodeUCS4_Find # define PyUnicode_Format PyUnicodeUCS4_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS4_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromString PyUnicodeUCS4_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS4_GetMax @@ -311,7 +312,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS4_Fini # define _PyUnicode_Init _PyUnicodeUCS4_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit Modified: python/branches/py3k-issue1717/LICENSE ============================================================================== --- python/branches/py3k-issue1717/LICENSE (original) +++ python/branches/py3k-issue1717/LICENSE Fri Jan 2 15:30:39 2009 @@ -55,7 +55,10 @@ 2.4.4 2.4.3 2006 PSF yes 2.5 2.4 2006 PSF yes 2.5.1 2.5 2007 PSF yes + 2.5.2 2.5.1 2008 PSF yes + 2.5.3 2.5.2 2008 PSF yes 2.6 2.5 2008 PSF yes + 2.6.1 2.6 2008 PSF yes 3.0 2.6 2008 PSF yes Footnotes: Modified: python/branches/py3k-issue1717/Lib/dis.py ============================================================================== --- python/branches/py3k-issue1717/Lib/dis.py (original) +++ python/branches/py3k-issue1717/Lib/dis.py Fri Jan 2 15:30:39 2009 @@ -6,7 +6,8 @@ from opcode import * from opcode import __all__ as _opcodes_all -__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all +__all__ = ["dis", "disassemble", "distb", "disco", + "findlinestarts", "findlabels"] + _opcodes_all del _opcodes_all def dis(x=None): Modified: python/branches/py3k-issue1717/Lib/distutils/ccompiler.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/ccompiler.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/ccompiler.py Fri Jan 2 15:30:39 2009 @@ -984,8 +984,8 @@ def move_file(self, src, dst): return move_file(src, dst, dry_run=self.dry_run) - def mkpath(self, name, mode=0o777): - mkpath(name, mode, self.dry_run) + def mkpath (self, name, mode=0o777): + mkpath(name, mode, dry_run=self.dry_run) # Map a sys.platform/os.name ('posix', 'nt') to the default compiler Modified: python/branches/py3k-issue1717/Lib/distutils/command/register.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/command/register.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/command/register.py Fri Jan 2 15:30:39 2009 @@ -143,12 +143,13 @@ # get the user's login info choices = '1 2 3 4'.split() while choice not in choices: - print('''We need to know who you are, so please choose either: + self.announce('''\ +We need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit -Your selection [default 1]: ''', end=' ') +Your selection [default 1]: ''', log.INFO) choice = input() if not choice: choice = '1' @@ -169,12 +170,16 @@ # send the info to the server and report the result code, result = self.post_to_server(self.build_post_data('submit'), auth) - print('Server response (%s): %s'%(code, result)) + self.announce('Server response (%s): %s' % (code, result), + log.INFO) # possibly save the login if not self.has_config and code == 200: - print('I can store your PyPI login so future submissions will be faster.') - print('(the login will be stored in %s)' % self._get_rc_file()) + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' while choice.lower() not in 'yn': choice = input('Save your login (y/N)?') Modified: python/branches/py3k-issue1717/Lib/distutils/config.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/config.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/config.py Fri Jan 2 15:30:39 2009 @@ -10,8 +10,8 @@ from distutils.cmd import Command DEFAULT_PYPIRC = """\ -[pypirc] -servers = +[distutils] +index-servers = pypi [pypi] Modified: python/branches/py3k-issue1717/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/dist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/dist.py Fri Jan 2 15:30:39 2009 @@ -228,7 +228,7 @@ # command options will override any supplied redundantly # through the general options dictionary. options = attrs.get('options') - if options: + if options is not None: del attrs['options'] for (command, cmd_options) in options.items(): opt_dict = self.get_option_dict(command) Modified: python/branches/py3k-issue1717/Lib/distutils/msvc9compiler.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/msvc9compiler.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/msvc9compiler.py Fri Jan 2 15:30:39 2009 @@ -247,7 +247,7 @@ result = {} if vcvarsall is None: - raise IOError("Unable to find vcvarsall.bat") + raise DistutilsPlatformError("Unable to find vcvarsall.bat") log.debug("Calling 'vcvarsall.bat %s' (version=%s)", arch, version) popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch), stdout=subprocess.PIPE, @@ -255,7 +255,7 @@ stdout, stderr = popen.communicate() if popen.wait() != 0: - raise IOError(stderr.decode("mbcs")) + raise DistutilsPlatformError(stderr.decode("mbcs")) stdout = stdout.decode("mbcs") for line in stdout.split("\n"): Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_config.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_config.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_config.py Fri Jan 2 15:30:39 2009 @@ -5,6 +5,8 @@ from distutils.core import PyPIRCCommand from distutils.core import Distribution +from distutils.log import set_threshold +from distutils.log import WARN from distutils.tests import support @@ -32,6 +34,17 @@ password:secret """ +WANTED = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:xxx +""" + + class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): @@ -53,6 +66,7 @@ finalize_options = initialize_options self._cmd = command + self.old_threshold = set_threshold(WARN) def tearDown(self): """Removes the patch.""" @@ -62,6 +76,7 @@ os.environ['HOME'] = self._old_home if os.path.exists(self.rc): os.remove(self.rc) + set_threshold(self.old_threshold) def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: @@ -96,6 +111,20 @@ ('server', 'server-login'), ('username', 'tarek')] self.assertEquals(config, waited) + def test_server_empty_registration(self): + + cmd = self._cmd(self.dist) + rc = cmd._get_rc_file() + self.assert_(not os.path.exists(rc)) + + cmd._store_pypirc('tarek', 'xxx') + + self.assert_(os.path.exists(rc)) + content = open(rc).read() + + self.assertEquals(content, WANTED) + + def test_suite(): return unittest.makeSuite(PyPIRCCommandTestCase) Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_dist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_dist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_dist.py Fri Jan 2 15:30:39 2009 @@ -6,6 +6,7 @@ import io import sys import unittest +import warnings from test.support import TESTFN @@ -96,6 +97,29 @@ os.unlink(TESTFN) + def test_empty_options(self): + # an empty options dictionary should not stay in the + # list of attributes + klass = distutils.dist.Distribution + + # catching warnings + warns = [] + def _warn(msg): + warns.append(msg) + + old_warn = warnings.warn + warnings.warn = _warn + try: + dist = klass(attrs={'author': 'xxx', + 'name': 'xxx', + 'version': 'xxx', + 'url': 'xxxx', + 'options': {}}) + finally: + warnings.warn = old_warn + + self.assertEquals(len(warns), 0) + class MetadataTestCase(unittest.TestCase): def test_simple_metadata(self): Modified: python/branches/py3k-issue1717/Lib/distutils/util.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/util.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/util.py Fri Jan 2 15:30:39 2009 @@ -99,7 +99,11 @@ if not macver: macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET') - if not macver: + if 1: + # Always calculate the release of the running machine, + # needed to determine if we can build fat binaries or not. + + macrelease = macver # Get the system version. Reading this plist is a documented # way to get the system version (see the documentation for # the Gestalt Manager) @@ -115,16 +119,18 @@ r'(.*?)', f.read()) f.close() if m is not None: - macver = '.'.join(m.group(1).split('.')[:2]) + macrelease = '.'.join(m.group(1).split('.')[:2]) # else: fall back to the default behaviour + if not macver: + macver = macrelease + if macver: from distutils.sysconfig import get_config_vars release = macver osname = "macosx" - - if (release + '.') >= '10.4.' and \ + if (macrelease + '.') >= '10.4.' and \ '-arch' in get_config_vars().get('CFLAGS', '').strip(): # The universal build will build fat binaries, but not on # systems before 10.4 @@ -133,9 +139,13 @@ # 'universal' instead of 'fat'. machine = 'fat' + cflags = get_config_vars().get('CFLAGS') - if '-arch x86_64' in get_config_vars().get('CFLAGS'): - machine = 'universal' + if '-arch x86_64' in cflags: + if '-arch i386' in cflags: + machine = 'universal' + else: + machine = 'fat64' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. Modified: python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py Fri Jan 2 15:30:39 2009 @@ -64,52 +64,6 @@ coding_re = re.compile("coding[:=]\s*([-\w_.]+)") -class EncodingMessage(SimpleDialog): - "Inform user that an encoding declaration is needed." - def __init__(self, master, enc): - self.should_edit = False - - self.root = top = Toplevel(master) - top.bind("", self.return_event) - top.bind("", self.do_ok) - top.protocol("WM_DELETE_WINDOW", self.wm_delete_window) - top.wm_title("I/O Warning") - top.wm_iconname("I/O Warning") - self.top = top - - l1 = Label(top, - text="Non-ASCII found, yet no encoding declared. Add a line like") - l1.pack(side=TOP, anchor=W) - l2 = Entry(top, font="courier") - l2.insert(0, "# -*- coding: %s -*-" % enc) - # For some reason, the text is not selectable anymore if the - # widget is disabled. - # l2['state'] = DISABLED - l2.pack(side=TOP, anchor = W, fill=X) - l3 = Label(top, text="to your file\n" - "Choose OK to save this file as %s\n" - "Edit your general options to silence this warning" % enc) - l3.pack(side=TOP, anchor = W) - - buttons = Frame(top) - buttons.pack(side=TOP, fill=X) - # Both return and cancel mean the same thing: do nothing - self.default = self.cancel = 0 - b1 = Button(buttons, text="Ok", default="active", - command=self.do_ok) - b1.pack(side=LEFT, fill=BOTH, expand=1) - b2 = Button(buttons, text="Edit my file", - command=self.do_edit) - b2.pack(side=LEFT, fill=BOTH, expand=1) - - self._set_transient(master) - - def do_ok(self): - self.done(0) - - def do_edit(self): - self.done(1) - def coding_spec(data): """Return the encoding declaration according to PEP 263. @@ -409,6 +363,9 @@ # This is either plain ASCII, or Tk was returning mixed-encoding # text to us. Don't try to guess further. return chars + # Preserve a BOM that might have been present on opening + if self.fileencoding == 'BOM': + return BOM_UTF8 + chars.encode("utf-8") # See whether there is anything non-ASCII in it. # If not, no need to figure out the encoding. try: @@ -423,61 +380,22 @@ except LookupError as msg: failed = msg enc = None + else: + if not enc: + # PEP 3120: default source encoding is UTF-8 + enc = 'utf-8' if enc: try: return chars.encode(enc) except UnicodeError: failed = "Invalid encoding '%s'" % enc - if failed: - tkMessageBox.showerror( - "I/O Error", - "%s.\nSaving as UTF-8" % failed, - master = self.text) - # If there was a UTF-8 signature, use that. This should not fail - if self.fileencoding == 'BOM' or failed: - return BOM_UTF8 + chars.encode("utf-8") - # Try the original file encoding next, if any - if self.fileencoding: - try: - return chars.encode(self.fileencoding) - except UnicodeError: - tkMessageBox.showerror( - "I/O Error", - "Cannot save this as '%s' anymore. Saving as UTF-8" \ - % self.fileencoding, - master = self.text) - return BOM_UTF8 + chars.encode("utf-8") - # Nothing was declared, and we had not determined an encoding - # on loading. Recommend an encoding line. - config_encoding = idleConf.GetOption("main","EditorWindow", - "encoding") - if config_encoding == 'utf-8': - # User has requested that we save files as UTF-8 - return BOM_UTF8 + chars.encode("utf-8") - ask_user = True - try: - chars = chars.encode(encoding) - enc = encoding - if config_encoding == 'locale': - ask_user = False - except UnicodeError: - chars = BOM_UTF8 + chars.encode("utf-8") - enc = "utf-8" - if not ask_user: - return chars - dialog = EncodingMessage(self.editwin.top, enc) - dialog.go() - if dialog.num == 1: - # User asked us to edit the file - encline = "# -*- coding: %s -*-\n" % enc - firstline = self.text.get("1.0", "2.0") - if firstline.startswith("#!"): - # Insert encoding after #! line - self.text.insert("2.0", encline) - else: - self.text.insert("1.0", encline) - return self.encode(self.text.get("1.0", "end-1c")) - return chars + tkMessageBox.showerror( + "I/O Error", + "%s.\nSaving as UTF-8" % failed, + master = self.text) + # Fallback: save as UTF-8, with BOM - ignoring the incorrect + # declared encoding + return BOM_UTF8 + chars.encode("utf-8") def fixlastline(self): c = self.text.get("end-2c") Modified: python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt Fri Jan 2 15:30:39 2009 @@ -1,3 +1,14 @@ +What's New in IDLE 3.1a1? +========================= + +*Release date: XX-XXX-XXXX* + +- Issue #4323: Always encode source as UTF-8 without asking + the user (unless a different encoding is declared); remove + user configuration of source encoding; all according to + PEP 3120. + + What's New in IDLE 3.0a3? ========================= Modified: python/branches/py3k-issue1717/Lib/idlelib/configDialog.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/configDialog.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/configDialog.py Fri Jan 2 15:30:39 2009 @@ -336,7 +336,6 @@ text=' Autosave Preferences ') frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE) - frameEncoding=Frame(frame,borderwidth=2,relief=GROOVE) frameHelp=LabelFrame(frame,borderwidth=2,relief=GROOVE, text=' Additional Help Sources ') #frameRun @@ -365,14 +364,6 @@ ' width (in characters)') entryParaWidth=Entry(frameParaSize,textvariable=self.paraWidth, width=3) - #frameEncoding - labelEncodingTitle=Label(frameEncoding,text="Default Source Encoding") - radioEncLocale=Radiobutton(frameEncoding,variable=self.encoding, - value="locale",text="Locale-defined") - radioEncUTF8=Radiobutton(frameEncoding,variable=self.encoding, - value="utf-8",text="UTF-8") - radioEncNone=Radiobutton(frameEncoding,variable=self.encoding, - value="none",text="None") #frameHelp frameHelpList=Frame(frameHelp) frameHelpListButtons=Frame(frameHelpList) @@ -394,7 +385,6 @@ frameSave.pack(side=TOP,padx=5,pady=5,fill=X) frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X) frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X) - frameEncoding.pack(side=TOP,padx=5,pady=5,fill=X) frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) #frameRun labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) @@ -413,11 +403,6 @@ #paragraphFormatWidth labelParaWidthTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) entryParaWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) - #frameEncoding - labelEncodingTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) - radioEncNone.pack(side=RIGHT,anchor=E,pady=5) - radioEncUTF8.pack(side=RIGHT,anchor=E,pady=5) - radioEncLocale.pack(side=RIGHT,anchor=E,pady=5) #frameHelp frameHelpListButtons.pack(side=RIGHT,padx=5,pady=5,fill=Y) frameHelpList.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) Modified: python/branches/py3k-issue1717/Lib/io.py ============================================================================== --- python/branches/py3k-issue1717/Lib/io.py (original) +++ python/branches/py3k-issue1717/Lib/io.py Fri Jan 2 15:30:39 2009 @@ -1157,7 +1157,7 @@ @property def closed(self): - return self.writer.closed() + return self.writer.closed class BufferedRandom(BufferedWriter, BufferedReader): Modified: python/branches/py3k-issue1717/Lib/lib2to3/main.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/main.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/main.py Fri Jan 2 15:30:39 2009 @@ -40,7 +40,8 @@ # Actually write the new file super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) - shutil.copymode(filename, backup) + if not self.nobackups: + shutil.copymode(filename, backup) def print_output(self, lines): for line in lines: Modified: python/branches/py3k-issue1717/Lib/pickle.py ============================================================================== --- python/branches/py3k-issue1717/Lib/pickle.py (original) +++ python/branches/py3k-issue1717/Lib/pickle.py Fri Jan 2 15:30:39 2009 @@ -222,6 +222,11 @@ def dump(self, obj): """Write a pickled representation of obj to the open file.""" + # Check whether Pickler was initialized correctly. This is + # only needed to mimic the behavior of _pickle.Pickler.dump(). + if not hasattr(self, "write"): + raise PicklingError("Pickler.__init__() was not called by " + "%s.__init__()" % (self.__class__.__name__,)) if self.proto >= 2: self.write(PROTO + bytes([self.proto])) self.save(obj) @@ -789,6 +794,11 @@ Return the reconstituted object hierarchy specified in the file. """ + # Check whether Unpickler was initialized correctly. This is + # only needed to mimic the behavior of _pickle.Unpickler.dump(). + if not hasattr(self, "read"): + raise UnpicklingError("Unpickler.__init__() was not called by " + "%s.__init__()" % (self.__class__.__name__,)) self.mark = object() # any new unique object self.stack = [] self.append = self.stack.append Modified: python/branches/py3k-issue1717/Lib/pydoc.py ============================================================================== --- python/branches/py3k-issue1717/Lib/pydoc.py (original) +++ python/branches/py3k-issue1717/Lib/pydoc.py Fri Jan 2 15:30:39 2009 @@ -1568,6 +1568,42 @@ 'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'), 'yield': ('yield', ''), } + # Either add symbols to this dictionary or to the symbols dictionary + # directly: Whichever is easier. They are merged later. + _symbols_inverse = { + 'STRINGS' : ("'", "'''", "r'", "b'", '"""', '"', 'r"', 'b"'), + 'OPERATORS' : ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&', + '|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'), + 'COMPARISON' : ('<', '>', '<=', '>=', '==', '!=', '<>'), + 'UNARY' : ('-', '~'), + 'AUGMENTEDASSIGNMENT' : ('+=', '-=', '*=', '/=', '%=', '&=', '|=', + '^=', '<<=', '>>=', '**=', '//='), + 'BITWISE' : ('<<', '>>', '&', '|', '^', '~'), + 'COMPLEX' : ('j', 'J') + } + symbols = { + '%': 'OPERATORS FORMATTING', + '**': 'POWER', + ',': 'TUPLES LISTS FUNCTIONS', + '.': 'ATTRIBUTES FLOAT MODULES OBJECTS', + '...': 'ELLIPSIS', + ':': 'SLICINGS DICTIONARYLITERALS', + '@': 'def class', + '\\': 'STRINGS', + '_': 'PRIVATENAMES', + '__': 'PRIVATENAMES SPECIALMETHODS', + '`': 'BACKQUOTES', + '(': 'TUPLES FUNCTIONS CALLS', + ')': 'TUPLES FUNCTIONS CALLS', + '[': 'LISTS SUBSCRIPTS SLICINGS', + ']': 'LISTS SUBSCRIPTS SLICINGS' + } + for topic, symbols_ in _symbols_inverse.items(): + for symbol in symbols_: + topics = symbols.get(symbol, topic) + if topic not in topics: + topics = topics + ' ' + topic + symbols[symbol] = topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS ' @@ -1705,10 +1741,12 @@ if type(request) is type(''): if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() + elif request == 'symbols': self.listsymbols() elif request == 'topics': self.listtopics() elif request == 'modules': self.listmodules() elif request[:8] == 'modules ': self.listmodules(request.split()[1]) + elif request in self.symbols: self.showsymbol(request) elif request in self.keywords: self.showtopic(request) elif request in self.topics: self.showtopic(request) elif request: doc(request, 'Help on %s:') @@ -1753,6 +1791,14 @@ ''') self.list(self.keywords.keys()) + def listsymbols(self): + self.output.write(''' +Here is a list of the punctuation symbols which Python assigns special meaning +to. Enter any symbol to get more help. + +''') + self.list(self.symbols.keys()) + def listtopics(self): self.output.write(''' Here is a list of available topics. Enter any topic name to get more help. @@ -1760,7 +1806,7 @@ ''') self.list(self.topics.keys()) - def showtopic(self, topic): + def showtopic(self, topic, more_xrefs=''): try: import pydoc_topics except ImportError: @@ -1774,7 +1820,7 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return if type(target) is type(''): - return self.showtopic(target) + return self.showtopic(target, more_xrefs) label, xrefs = target try: @@ -1783,6 +1829,8 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return pager(doc.strip() + '\n') + if more_xrefs: + xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: import io, formatter buffer = io.StringIO() @@ -1790,6 +1838,11 @@ 'Related help topics: ' + ', '.join(xrefs.split()) + '\n') self.output.write('\n%s\n' % buffer.getvalue()) + def showsymbol(self, symbol): + target = self.symbols[symbol] + topic, _, xrefs = target.partition(' ') + self.showtopic(topic, xrefs) + def listmodules(self, key=''): if key: self.output.write(''' Modified: python/branches/py3k-issue1717/Lib/re.py ============================================================================== --- python/branches/py3k-issue1717/Lib/re.py (original) +++ python/branches/py3k-issue1717/Lib/re.py Fri Jan 2 15:30:39 2009 @@ -160,7 +160,8 @@ """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; - if a callable, it's passed the match object and must return + if a string, backslash escapes in it are processed. If it is + a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).sub(repl, string, count) @@ -170,7 +171,8 @@ non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a string or a - callable; if a callable, it's passed the match object and must + callable; if a string, backslash escapes in it are processed. + If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).subn(repl, string, count) Modified: python/branches/py3k-issue1717/Lib/ssl.py ============================================================================== --- python/branches/py3k-issue1717/Lib/ssl.py (original) +++ python/branches/py3k-issue1717/Lib/ssl.py Fri Jan 2 15:30:39 2009 @@ -114,7 +114,7 @@ # see if it's connected try: socket.getpeername(self) - except: + except socket_error: # no, no connection yet self._sslobj = None else: Modified: python/branches/py3k-issue1717/Lib/test/pickletester.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/pickletester.py (original) +++ python/branches/py3k-issue1717/Lib/test/pickletester.py Fri Jan 2 15:30:39 2009 @@ -484,13 +484,21 @@ self.assertRaises(ValueError, self.loads, buf) def test_unicode(self): - endcases = ['', '<\\u>', '<\\\u1234>', '<\n>', '<\\>'] + endcases = ['', '<\\u>', '<\\\u1234>', '<\n>', + '<\\>', '<\\\U00012345>'] for proto in protocols: for u in endcases: p = self.dumps(u, proto) u2 = self.loads(p) self.assertEqual(u2, u) + def test_unicode_high_plane(self): + t = '\U00012345' + for proto in protocols: + p = self.dumps(t, proto) + t2 = self.loads(p) + self.assertEqual(t2, t) + def test_bytes(self): for proto in protocols: for u in b'', b'xyz', b'xyz'*100: Modified: python/branches/py3k-issue1717/Lib/test/test_array.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_array.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_array.py Fri Jan 2 15:30:39 2009 @@ -7,7 +7,7 @@ from test import support from weakref import proxy import array, io, math -from pickle import loads, dumps +from pickle import loads, dumps, HIGHEST_PROTOCOL import operator class ArraySubclass(array.array): @@ -98,7 +98,7 @@ self.assertEqual(a, b) def test_pickle(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode, self.example) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) @@ -113,7 +113,7 @@ self.assertEqual(type(a), type(b)) def test_pickle_for_empty_array(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) Modified: python/branches/py3k-issue1717/Lib/test/test_bytes.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_bytes.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_bytes.py Fri Jan 2 15:30:39 2009 @@ -888,11 +888,21 @@ def test_translate(self): b = b'hello' + ba = bytearray(b) rosetta = bytearray(range(0, 256)) rosetta[ord('o')] = ord('e') c = b.translate(rosetta, b'l') self.assertEqual(b, b'hello') self.assertEqual(c, b'hee') + c = ba.translate(rosetta, b'l') + self.assertEqual(ba, b'hello') + self.assertEqual(c, b'hee') + c = b.translate(None, b'e') + self.assertEqual(c, b'hllo') + c = ba.translate(None, b'e') + self.assertEqual(c, b'hllo') + self.assertRaises(TypeError, b.translate, None, None) + self.assertRaises(TypeError, ba.translate, None, None) def test_split_bytearray(self): self.assertEqual(b'a b'.split(memoryview(b' ')), [b'a', b'b']) Modified: python/branches/py3k-issue1717/Lib/test/test_deque.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_deque.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_deque.py Fri Jan 2 15:30:39 2009 @@ -1,7 +1,8 @@ from collections import deque import unittest from test import support, seq_tests -from weakref import proxy +import gc +import weakref import copy import pickle from io import StringIO @@ -374,7 +375,7 @@ def test_pickle(self): d = deque(range(200)) - for i in (0, 1, 2): + for i in range(pickle.HIGHEST_PROTOCOL + 1): s = pickle.dumps(d, i) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) @@ -383,7 +384,7 @@ ## def test_pickle_recursive(self): ## d = deque('abc') ## d.append(d) -## for i in (0, 1, 2): +## for i in range(pickle.HIGHEST_PROTOCOL + 1): ## e = pickle.loads(pickle.dumps(d, i)) ## self.assertNotEqual(id(d), id(e)) ## self.assertEqual(id(e), id(e[-1])) @@ -419,6 +420,22 @@ d.append(1) gc.collect() + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for deque iterator objects + class C(object): + pass + for i in range(2): + obj = C() + ref = weakref.ref(obj) + if i == 0: + container = deque([obj, 1]) + else: + container = reversed(deque([obj, 1])) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): @@ -529,7 +546,7 @@ def test_weakref(self): d = deque('gallahad') - p = proxy(d) + p = weakref.proxy(d) self.assertEqual(str(p), str(d)) d = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/py3k-issue1717/Lib/test/test_dict.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_dict.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_dict.py Fri Jan 2 15:30:39 2009 @@ -2,6 +2,7 @@ from test import support import sys, collections, random, string +import gc, weakref class DictTest(unittest.TestCase): @@ -648,6 +649,21 @@ pass d = {} + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for dictiter and + # dictview objects. + class C(object): + pass + views = (dict.items, dict.values, dict.keys) + for v in views: + obj = C() + ref = weakref.ref(obj) + container = {obj: 1} + obj.v = v(container) + obj.x = iter(obj.v) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") from test import mapping_tests Modified: python/branches/py3k-issue1717/Lib/test/test_file.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_file.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_file.py Fri Jan 2 15:30:39 2009 @@ -123,6 +123,8 @@ except: self.assertEquals(self.f.__exit__(*sys.exc_info()), None) + def testReadWhenWriting(self): + self.assertRaises(IOError, self.f.read) class OtherFileTests(unittest.TestCase): Modified: python/branches/py3k-issue1717/Lib/test/test_fileio.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_fileio.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_fileio.py Fri Jan 2 15:30:39 2009 @@ -108,6 +108,7 @@ _fileio._FileIO('.', 'r') except IOError as e: self.assertNotEqual(e.errno, 0) + self.assertEqual(e.filename, ".") else: self.fail("Should have raised IOError") Modified: python/branches/py3k-issue1717/Lib/test/test_generators.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_generators.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_generators.py Fri Jan 2 15:30:39 2009 @@ -928,6 +928,16 @@ 'f' >>> repr(g) # doctest: +ELLIPSIS '' + +Lambdas shouldn't have their usual return behavior. + +>>> x = lambda: (yield 1) +>>> list(x()) +[1] + +>>> x = lambda: ((yield 1), (yield 2)) +>>> list(x()) +[1, 2] """ # conjoin is a simple backtracking generator, named in honor of Icon's Modified: python/branches/py3k-issue1717/Lib/test/test_hash.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_hash.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_hash.py Fri Jan 2 15:30:39 2009 @@ -97,9 +97,30 @@ self.assertFalse(isinstance(obj, Hashable), repr(obj)) +# Issue #4701: Check that some builtin types are correctly hashable +class DefaultIterSeq(object): + seq = range(10) + def __len__(self): + return len(self.seq) + def __getitem__(self, index): + return self.seq[index] + +class HashBuiltinsTestCase(unittest.TestCase): + hashes_to_check = [range(10), + enumerate(range(10)), + iter(DefaultIterSeq()), + iter(lambda: 0, 0), + ] + + def test_hashes(self): + _default_hash = object.__hash__ + for obj in self.hashes_to_check: + self.assertEqual(hash(obj), _default_hash(obj)) + def test_main(): support.run_unittest(HashEqualityTestCase, - HashInheritanceTestCase) + HashInheritanceTestCase, + HashBuiltinsTestCase) if __name__ == "__main__": Modified: python/branches/py3k-issue1717/Lib/test/test_io.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_io.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_io.py Fri Jan 2 15:30:39 2009 @@ -553,8 +553,9 @@ r = MockRawIO(()) w = MockRawIO() pair = io.BufferedRWPair(r, w) + self.assertFalse(pair.closed) - # XXX need implementation + # XXX More Tests class BufferedRandomTest(unittest.TestCase): Modified: python/branches/py3k-issue1717/Lib/test/test_set.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_set.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_set.py Fri Jan 2 15:30:39 2009 @@ -1,6 +1,7 @@ import unittest from test import support -from weakref import proxy +import gc +import weakref import operator import copy import pickle @@ -219,7 +220,7 @@ self.failIf(set('cbs').issuperset('a')) def test_pickling(self): - for i in (0, 1, 2): + for i in range(pickle.HIGHEST_PROTOCOL + 1): p = pickle.dumps(self.s, i) dup = pickle.loads(p) self.assertEqual(self.s, dup, "%s != %s" % (self.s, dup)) @@ -323,6 +324,18 @@ self.assertEqual(sum(elem.hash_count for elem in d), n) self.assertEqual(d3, dict.fromkeys(d, 123)) + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for set iterator object + class C(object): + pass + obj = C() + ref = weakref.ref(obj) + container = set([obj, 1]) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestSet(TestJointOps): thetype = set basetype = set @@ -546,7 +559,7 @@ def test_weakref(self): s = self.thetype('gallahad') - p = proxy(s) + p = weakref.proxy(s) self.assertEqual(str(p), str(s)) s = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/py3k-issue1717/Lib/test/test_unittest.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_unittest.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_unittest.py Fri Jan 2 15:30:39 2009 @@ -2294,6 +2294,43 @@ self.assertRaises(AssertionError, self.failIfAlmostEqual, 0, .1+.1j, places=0) + def test_assertRaises(self): + def _raise(e): + raise e + self.assertRaises(KeyError, _raise, KeyError) + self.assertRaises(KeyError, _raise, KeyError("key")) + try: + self.assertRaises(KeyError, lambda: None) + except AssertionError as e: + self.assert_("KeyError not raised" in str(e), str(e)) + else: + self.fail("assertRaises() didn't fail") + try: + self.assertRaises(KeyError, _raise, ValueError) + except ValueError: + pass + else: + self.fail("assertRaises() didn't let exception pass through") + with self.assertRaises(KeyError): + raise KeyError + with self.assertRaises(KeyError): + raise KeyError("key") + try: + with self.assertRaises(KeyError): + pass + except AssertionError as e: + self.assert_("KeyError not raised" in str(e), str(e)) + else: + self.fail("assertRaises() didn't fail") + try: + with self.assertRaises(KeyError): + raise ValueError + except ValueError: + pass + else: + self.fail("assertRaises() didn't let exception pass through") + + ###################################################################### ## Main ###################################################################### Modified: python/branches/py3k-issue1717/Lib/test/test_urllib2.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_urllib2.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_urllib2.py Fri Jan 2 15:30:39 2009 @@ -1104,6 +1104,51 @@ else: self.assert_(False) +class RequestTests(unittest.TestCase): + + def setUp(self): + self.get = Request("http://www.python.org/~jeremy/") + self.post = Request("http://www.python.org/~jeremy/", + "data", + headers={"X-Test": "test"}) + + def test_method(self): + self.assertEqual("POST", self.post.get_method()) + self.assertEqual("GET", self.get.get_method()) + + def test_add_data(self): + self.assert_(not self.get.has_data()) + self.assertEqual("GET", self.get.get_method()) + self.get.add_data("spam") + self.assert_(self.get.has_data()) + self.assertEqual("POST", self.get.get_method()) + + def test_get_full_url(self): + self.assertEqual("http://www.python.org/~jeremy/", + self.get.get_full_url()) + + def test_selector(self): + self.assertEqual("/~jeremy/", self.get.get_selector()) + req = Request("http://www.python.org/") + self.assertEqual("/", req.get_selector()) + + def test_get_type(self): + self.assertEqual("http", self.get.get_type()) + + def test_get_host(self): + self.assertEqual("www.python.org", self.get.get_host()) + + def test_get_host_unquote(self): + req = Request("http://www.%70ython.org/") + self.assertEqual("www.python.org", req.get_host()) + + def test_proxy(self): + self.assert_(not self.get.has_proxy()) + self.get.set_proxy("www.perl.org", "http") + self.assert_(self.get.has_proxy()) + self.assertEqual("www.python.org", self.get.get_origin_req_host()) + self.assertEqual("www.perl.org", self.get.get_host()) + def test_main(verbose=None): from test import test_urllib2 @@ -1112,7 +1157,8 @@ tests = (TrivialTests, OpenerDirectorTests, HandlerTests, - MiscTests) + MiscTests, + RequestTests) support.run_unittest(*tests) if __name__ == "__main__": Modified: python/branches/py3k-issue1717/Lib/test/test_zipfile.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_zipfile.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_zipfile.py Fri Jan 2 15:30:39 2009 @@ -621,20 +621,49 @@ def testIsZipErroneousFile(self): # This test checks that the is_zipfile function correctly identifies # a file that is not a zip file - fp = open(TESTFN, "w") - fp.write("this is not a legal zip file\n") - fp.close() + + # - passing a filename + with open(TESTFN, "w") as fp: + fp.write("this is not a legal zip file\n") chk = zipfile.is_zipfile(TESTFN) - self.assert_(chk is False) + self.assert_(not chk) + # - passing a file object + with open(TESTFN, "rb") as fp: + chk = zipfile.is_zipfile(fp) + self.assert_(not chk) + # - passing a file-like object + fp = io.BytesIO() + fp.write(b"this is not a legal zip file\n") + chk = zipfile.is_zipfile(fp) + self.assert_(not chk) + fp.seek(0,0) + chk = zipfile.is_zipfile(fp) + self.assert_(not chk) def testIsZipValidFile(self): # This test checks that the is_zipfile function correctly identifies # a file that is a zip file + + # - passing a filename zipf = zipfile.ZipFile(TESTFN, mode="w") zipf.writestr("foo.txt", b"O, for a Muse of Fire!") zipf.close() chk = zipfile.is_zipfile(TESTFN) - self.assert_(chk is True) + self.assert_(chk) + # - passing a file object + with open(TESTFN, "rb") as fp: + chk = zipfile.is_zipfile(fp) + self.assert_(chk) + fp.seek(0,0) + zip_contents = fp.read() + # - passing a file-like object + fp = io.BytesIO() + fp.write(zip_contents) + chk = zipfile.is_zipfile(fp) + self.assert_(chk) + fp.seek(0,0) + chk = zipfile.is_zipfile(fp) + self.assert_(chk) def testNonExistentFileRaisesIOError(self): # make sure we don't raise an AttributeError when a partially-constructed Modified: python/branches/py3k-issue1717/Lib/tkinter/colorchooser.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/colorchooser.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/colorchooser.py Fri Jan 2 15:30:39 2009 @@ -34,19 +34,22 @@ try: # make sure initialcolor is a tk color string color = self.options["initialcolor"] - if type(color) == type(()): + if isinstance(color, tuple): # assume an RGB triplet self.options["initialcolor"] = "#%02x%02x%02x" % color except KeyError: pass def _fixresult(self, widget, result): + # result can be somethings: an empty tuple, an empty string or + # a Tcl_Obj, so this somewhat weird check handles that + if not result or not str(result): + return None, None # canceled + # to simplify application code, the color chooser returns # an RGB tuple together with the Tk color string - if not result: - return None, None # canceled r, g, b = widget.winfo_rgb(result) - return (r/256, g/256, b/256), result + return (r/256, g/256, b/256), str(result) # @@ -66,5 +69,4 @@ # test stuff if __name__ == "__main__": - print("color", askcolor()) Modified: python/branches/py3k-issue1717/Lib/tkinter/filedialog.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/filedialog.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/filedialog.py Fri Jan 2 15:30:39 2009 @@ -350,7 +350,7 @@ # the directory dialog has its own _fix routines. -class Directory(Dialog): +class Directory(commondialog.Dialog): "Ask for a directory" command = "tk_chooseDirectory" Modified: python/branches/py3k-issue1717/Lib/tkinter/scrolledtext.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/scrolledtext.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/scrolledtext.py Fri Jan 2 15:30:39 2009 @@ -1,42 +1,52 @@ -# A ScrolledText widget feels like a text widget but also has a -# vertical scroll bar on its right. (Later, options may be added to -# add a horizontal bar as well, to make the bars disappear -# automatically when not needed, to move them to the other side of the -# window, etc.) -# -# Configuration options are passed to the Text widget. -# A Frame widget is inserted between the master and the text, to hold -# the Scrollbar widget. -# Most methods calls are inherited from the Text widget; Pack methods -# are redirected to the Frame widget however. +"""A ScrolledText widget feels like a text widget but also has a +vertical scroll bar on its right. (Later, options may be added to +add a horizontal bar as well, to make the bars disappear +automatically when not needed, to move them to the other side of the +window, etc.) -from tkinter import * -from tkinter import _cnfmerge +Configuration options are passed to the Text widget. +A Frame widget is inserted between the master and the text, to hold +the Scrollbar widget. +Most methods calls are inherited from the Text widget; Pack, Grid and +Place methods are redirected to the Frame widget however. +""" -class ScrolledText(Text): - def __init__(self, master=None, cnf=None, **kw): - if cnf is None: - cnf = {} - if kw: - cnf = _cnfmerge((cnf, kw)) - fcnf = {k:v for k,v in cnf.items() if isinstance(k,type) or k=='name'} - for k in fcnf.keys(): - del cnf[k] +__all__ = ['ScrolledText'] + +from tkinter import Frame, Text, Scrollbar, Pack, Grid, Place +from tkinter.constants import RIGHT, LEFT, Y, BOTH - self.frame = Frame(master, **fcnf) - self.vbar = Scrollbar(self.frame, name='vbar') +class ScrolledText(Text): + def __init__(self, master=None, **kw): + self.frame = Frame(master) + self.vbar = Scrollbar(self.frame) self.vbar.pack(side=RIGHT, fill=Y) - cnf['name'] = 'text' - Text.__init__(self, self.frame, **cnf) - self.pack(side=LEFT, fill=BOTH, expand=1) - self['yscrollcommand'] = self.vbar.set + + kw.update({'yscrollcommand': self.vbar.set}) + Text.__init__(self, self.frame, **kw) + self.pack(side=LEFT, fill=BOTH, expand=True) self.vbar['command'] = self.yview # Copy geometry methods of self.frame -- hack! - methods = Pack.__dict__.keys() - methods = methods + Grid.__dict__.keys() - methods = methods + Place.__dict__.keys() + methods = vars(Pack).keys() + vars(Grid).keys() + vars(Place).keys() for m in methods: if m[0] != '_' and m != 'config' and m != 'configure': setattr(self, m, getattr(self.frame, m)) + + def __str__(self): + return str(self.frame) + + +def example(): + import __main__ + from tkinter.constants import END + + stext = ScrolledText(bg='white', height=10) + stext.insert(END, __main__.__doc__) + stext.pack(fill=BOTH, side=LEFT, expand=True) + stext.focus_set() + stext.mainloop() + +if __name__ == "__main__": + example() Modified: python/branches/py3k-issue1717/Lib/unittest.py ============================================================================== --- python/branches/py3k-issue1717/Lib/unittest.py (original) +++ python/branches/py3k-issue1717/Lib/unittest.py Fri Jan 2 15:30:39 2009 @@ -149,6 +149,36 @@ (_strclass(self.__class__), self.testsRun, len(self.errors), len(self.failures)) +class AssertRaisesContext: + def __init__(self, expected, test_case, callable_obj=None): + self.expected = expected + self.failureException = test_case.failureException + if callable_obj is not None: + try: + self.obj_name = callable_obj.__name__ + except AttributeError: + self.obj_name = str(callable_obj) + else: + self.obj_name = None + def __enter__(self): + pass + def __exit__(self, exc_type, exc_value, traceback): + if exc_type is None: + try: + exc_name = self.expected.__name__ + except AttributeError: + exc_name = str(self.expected) + if self.obj_name: + raise self.failureException("{0} not raised by {1}" + .format(exc_name, self.obj_name)) + else: + raise self.failureException("{0} not raised" + .format(exc_name)) + if issubclass(exc_type, self.expected): + return True + # Let unexpected exceptions skip through + return False + class TestCase: """A class whose instances are single test cases. @@ -299,23 +329,25 @@ """Fail the test unless the expression is true.""" if not expr: raise self.failureException(msg) - def failUnlessRaises(self, excClass, callableObj, *args, **kwargs): + def failUnlessRaises(self, excClass, callableObj=None, *args, **kwargs): """Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception. + + If called with callableObj omitted or None, will return a + context object used like this:: + + with self.failUnlessRaises(some_error_class): + do_something() """ - try: + context = AssertRaisesContext(excClass, self, callableObj) + if callableObj is None: + return context + with context: callableObj(*args, **kwargs) - except excClass: - return - else: - excName = str(getattr(excClass, '__name__', excClass)) - objName = str(getattr(callableObj, '__name__', callableObj)) - raise self.failureException("%s not raised by %s" % (excName, - objName)) def failUnlessEqual(self, first, second, msg=None): """Fail if the two objects are unequal as determined by the '==' Modified: python/branches/py3k-issue1717/Lib/zipfile.py ============================================================================== --- python/branches/py3k-issue1717/Lib/zipfile.py (original) +++ python/branches/py3k-issue1717/Lib/zipfile.py Fri Jan 2 15:30:39 2009 @@ -130,18 +130,30 @@ _CD64_DIRECTORY_SIZE = 8 _CD64_OFFSET_START_CENTDIR = 9 -def is_zipfile(filename): - """Quickly see if file is a ZIP file by checking the magic number.""" +def _check_zipfile(fp): try: - fpin = io.open(filename, "rb") - endrec = _EndRecData(fpin) - fpin.close() - if endrec: - return True # file has correct magic number + if _EndRecData(fp): + return True # file has correct magic number except IOError: pass return False +def is_zipfile(filename): + """Quickly see if a file is a ZIP file by checking the magic number. + + The filename argument may be a file or file-like object too. + """ + result = False + try: + if hasattr(filename, "read"): + result = _check_zipfile(fp=filename) + else: + with open(filename, "rb") as fp: + result = _check_zipfile(fp) + except IOError: + pass + return result + def _EndRecData64(fpin, offset, endrec): """ Read the ZIP64 end-of-archive records and use that to update endrec Modified: python/branches/py3k-issue1717/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/py3k-issue1717/Mac/BuildScript/build-installer.py (original) +++ python/branches/py3k-issue1717/Mac/BuildScript/build-installer.py Fri Jan 2 15:30:39 2009 @@ -9,8 +9,7 @@ Usage: see USAGE variable in the script. """ -import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd -import urllib.request +import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd import grp INCLUDE_TIMESTAMP = 1 @@ -55,7 +54,7 @@ if 'PY_VERSION' in ln: return ln.split()[-1][1:-1] - raise RuntimeError("Cannot find full version??") + raise RuntimeError, "Cannot find full version??" # The directory we'll use to create the build (will be erased and recreated) WORKDIR = "/tmp/_py" @@ -170,17 +169,6 @@ getVersion(), ), ), - dict( - name="Sleepycat DB 4.7.25", - url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz", - #name="Sleepycat DB 4.3.29", - #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz", - buildDir="build_unix", - configure="../dist/configure", - configure_pre=[ - '--includedir=/usr/local/include/db4', - ] - ), ] @@ -196,6 +184,7 @@ wrappers for lots of Mac OS X API's. """, postflight="scripts/postflight.framework", + selected='selected', ), dict( name="PythonApplications", @@ -209,6 +198,7 @@ It also installs a number of examples and demos. """, required=False, + selected='selected', ), dict( name="PythonUnixTools", @@ -220,6 +210,7 @@ is not necessary to use MacPython. """, required=False, + selected='unselected', ), dict( name="PythonDocumentation", @@ -234,6 +225,7 @@ """, postflight="scripts/postflight.documentation", required=False, + selected='selected', ), dict( name="PythonProfileChanges", @@ -251,6 +243,7 @@ topdir="/Library/Frameworks/Python.framework", source="/empty-dir", required=False, + selected='unselected', ), dict( name="PythonSystemFixes", @@ -264,6 +257,7 @@ topdir="/Library/Frameworks/Python.framework", source="/empty-dir", required=False, + selected='unselected', ) ] @@ -292,7 +286,7 @@ xit = fd.close() if xit is not None: sys.stdout.write(data) - raise RuntimeError("command failed: %s"%(commandline,)) + raise RuntimeError, "command failed: %s"%(commandline,) if VERBOSE: sys.stdout.write(data); sys.stdout.flush() @@ -303,7 +297,7 @@ xit = fd.close() if xit is not None: sys.stdout.write(data) - raise RuntimeError("command failed: %s"%(commandline,)) + raise RuntimeError, "command failed: %s"%(commandline,) return data @@ -336,17 +330,17 @@ try: options, args = getopt.getopt(args, '?hb', [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=']) - except getopt.error as msg: - print(msg) + except getopt.error, msg: + print msg sys.exit(1) if args: - print("Additional arguments") + print "Additional arguments" sys.exit(1) for k, v in options: if k in ('-h', '-?'): - print(USAGE) + print USAGE sys.exit(0) elif k in ('-d', '--build-dir'): @@ -362,19 +356,19 @@ SRCDIR=v else: - raise NotImplementedError(k) + raise NotImplementedError, k SRCDIR=os.path.abspath(SRCDIR) WORKDIR=os.path.abspath(WORKDIR) SDKPATH=os.path.abspath(SDKPATH) DEPSRC=os.path.abspath(DEPSRC) - print("Settings:") - print(" * Source directory:", SRCDIR) - print(" * Build directory: ", WORKDIR) - print(" * SDK location: ", SDKPATH) - print(" * third-party source:", DEPSRC) - print("") + print "Settings:" + print " * Source directory:", SRCDIR + print " * Build directory: ", WORKDIR + print " * SDK location: ", SDKPATH + print " * third-party source:", DEPSRC + print "" @@ -419,7 +413,7 @@ xit = fp.close() if xit is not None: sys.stdout.write(data) - raise RuntimeError("Cannot extract %s"%(archiveName,)) + raise RuntimeError, "Cannot extract %s"%(archiveName,) return os.path.join(builddir, retval) @@ -441,9 +435,9 @@ pass else: if KNOWNSIZES.get(url) == size: - print("Using existing file for", url) + print "Using existing file for", url return - fpIn = urllib.request.urlopen(url) + fpIn = urllib2.urlopen(url) fpOut = open(fname, 'wb') block = fpIn.read(10240) try: @@ -480,14 +474,14 @@ if os.path.exists(sourceArchive): - print("Using local copy of %s"%(name,)) + print "Using local copy of %s"%(name,) else: - print("Downloading %s"%(name,)) + print "Downloading %s"%(name,) downloadURL(url, sourceArchive) - print("Archive for %s stored as %s"%(name, sourceArchive)) + print "Archive for %s stored as %s"%(name, sourceArchive) - print("Extracting archive for %s"%(name,)) + print "Extracting archive for %s"%(name,) buildDir=os.path.join(WORKDIR, '_bld') if not os.path.exists(buildDir): os.mkdir(buildDir) @@ -550,14 +544,14 @@ configure_args.insert(0, configure) configure_args = [ shellQuote(a) for a in configure_args ] - print("Running configure for %s"%(name,)) + print "Running configure for %s"%(name,) runCommand(' '.join(configure_args) + ' 2>&1') - print("Running install for %s"%(name,)) + print "Running install for %s"%(name,) runCommand('{ ' + install + ' ;} 2>&1') - print("Done %s"%(name,)) - print("") + print "Done %s"%(name,) + print "" os.chdir(curdir) @@ -565,9 +559,9 @@ """ Build our dependencies into $WORKDIR/libraries/usr/local """ - print("") - print("Building required libraries") - print("") + print "" + print "Building required libraries" + print "" universal = os.path.join(WORKDIR, 'libraries') os.mkdir(universal) os.makedirs(os.path.join(universal, 'usr', 'local', 'lib')) @@ -581,7 +575,7 @@ def buildPythonDocs(): # This stores the documentation as Resources/English.lproj/Docuentation # inside the framwork. pydoc and IDLE will pick it up there. - print("Install python documentation") + print "Install python documentation" rootDir = os.path.join(WORKDIR, '_root') version = getVersion() docdir = os.path.join(rootDir, 'pydocs') @@ -590,13 +584,13 @@ name = 'html-%s.tar.bz2'%(getFullVersion(),) sourceArchive = os.path.join(DEPSRC, name) if os.path.exists(sourceArchive): - print("Using local copy of %s"%(name,)) + print "Using local copy of %s"%(name,) else: print "Downloading %s"%(novername,) downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( getFullVersion(), novername), sourceArchive) - print("Archive for %s stored as %s"%(name, sourceArchive)) + print "Archive for %s stored as %s"%(name, sourceArchive) extractArchive(os.path.dirname(docdir), sourceArchive) @@ -607,7 +601,7 @@ def buildPython(): - print("Building a universal python") + print "Building a universal python" buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') @@ -630,24 +624,24 @@ # several paths. version = getVersion() - print("Running configure...") + print "Running configure..." runCommand("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%( shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH), shellQuote(WORKDIR)[1:-1], shellQuote(WORKDIR)[1:-1])) - print("Running make") + print "Running make" runCommand("make") - print("Running make frameworkinstall") + print "Running make frameworkinstall" runCommand("make frameworkinstall DESTDIR=%s"%( shellQuote(rootDir))) - print("Running make frameworkinstallextras") + print "Running make frameworkinstallextras" runCommand("make frameworkinstallextras DESTDIR=%s"%( shellQuote(rootDir))) - print("Copying required shared libraries") + print "Copying required shared libraries" if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')): runCommand("mv %s/* %s"%( shellQuote(os.path.join( @@ -658,10 +652,12 @@ 'Python.framework', 'Versions', getVersion(), 'lib')))) - print("Fix file modes") + print "Fix file modes" frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') gid = grp.getgrnam('admin').gr_gid + + for dirpath, dirnames, filenames in os.walk(frmDir): for dn in dirnames: os.chmod(os.path.join(dirpath, dn), 0775) @@ -708,6 +704,11 @@ os.chdir(curdir) + # Remove the 'Current' link, that way we don't accidently mess with an already installed + # version of python + os.unlink(os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current')) + + def patchFile(inPath, outPath): @@ -747,7 +748,7 @@ readme = textwrap.dedent(recipe['readme']) isRequired = recipe.get('required', True) - print("- building package %s"%(pkgname,)) + print "- building package %s"%(pkgname,) # Substitute some variables textvars = dict( @@ -842,7 +843,7 @@ IFPkgFlagPackageList=[ dict( IFPkgFlagPackageLocation='%s-%s.pkg'%(item['name'], getVersion()), - IFPkgFlagPackageSelection='selected' + IFPkgFlagPackageSelection=item['selected'], ) for item in PKG_RECIPES ], @@ -1050,9 +1051,9 @@ shutil.copy('../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt')) fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w') - print("# BUILD INFO", file=fp) - print("# Date:", time.ctime(), file=fp) - print("# By:", pwd.getpwuid(os.getuid()).pw_gecos, file=fp) + print >> fp, "# BUILD INFO" + print >> fp, "# Date:", time.ctime() + print >> fp, "# By:", pwd.getpwuid(os.getuid()).pw_gecos fp.close() # Custom icon for the DMG, shown when the DMG is mounted. Modified: python/branches/py3k-issue1717/Mac/BuildScript/resources/Welcome.rtf ============================================================================== --- python/branches/py3k-issue1717/Mac/BuildScript/resources/Welcome.rtf (original) +++ python/branches/py3k-issue1717/Mac/BuildScript/resources/Welcome.rtf Fri Jan 2 15:30:39 2009 @@ -1,18 +1,20 @@ -{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;} +{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \f0\fs24 \cf0 This package will install -\f1\b MacPython $FULL_VERSION -\f0\b0 for -\f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET -\f0\b0 .\ +\b MacPython $FULL_VERSION +\b0 for +\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).\ \ See the ReadMe file for more information.\ \ -\ -This package will by default update your shell profile to ensure that this version of Python is on the search path of your shell. Please deselect the "Shell profile updater" package on the package customization screen if you want to avoid this modification. } \ No newline at end of file + +\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 Modified: python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/Info.plist ============================================================================== --- python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/Info.plist (original) +++ python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/Info.plist Fri Jan 2 15:30:39 2009 @@ -36,7 +36,7 @@ CFBundleExecutable IDLE CFBundleGetInfoString - 2.6.0, ?? 001-2006 Python Software Foundation + %version%, ?? 2001-2008 Python Software Foundation CFBundleIconFile IDLE.icns CFBundleIdentifier @@ -48,10 +48,10 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.6.0 + %version% CFBundleSignature ???? CFBundleVersion - 2.6.0 + %version% Modified: python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE ============================================================================== --- python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE (original) +++ python/branches/py3k-issue1717/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Fri Jan 2 15:30:39 2009 @@ -1,4 +1,4 @@ -#!/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/Contents/MacOS/Python +#!%prefix%/Resources/Python.app/Contents/MacOS/Python3 import sys, os execdir = os.path.dirname(sys.argv[0]) Modified: python/branches/py3k-issue1717/Mac/Makefile.in ============================================================================== --- python/branches/py3k-issue1717/Mac/Makefile.in (original) +++ python/branches/py3k-issue1717/Mac/Makefile.in Fri Jan 2 15:30:39 2009 @@ -216,8 +216,10 @@ install_IDLE: test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR IDLE/IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" + /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" + 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" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" $(INSTALLED_PYTHONAPP): install_Python Modified: python/branches/py3k-issue1717/Mac/PythonLauncher/Info.plist.in ============================================================================== --- python/branches/py3k-issue1717/Mac/PythonLauncher/Info.plist.in (original) +++ python/branches/py3k-issue1717/Mac/PythonLauncher/Info.plist.in Fri Jan 2 15:30:39 2009 @@ -40,7 +40,7 @@ CFBundleExecutable PythonLauncher CFBundleGetInfoString - %VERSION%, ?? 001-2006 Python Software Foundation + %VERSION%, ?? 2001-2008 Python Software Foundation CFBundleIconFile PythonLauncher.icns CFBundleIdentifier Modified: python/branches/py3k-issue1717/Mac/PythonLauncher/Makefile.in ============================================================================== --- python/branches/py3k-issue1717/Mac/PythonLauncher/Makefile.in (original) +++ python/branches/py3k-issue1717/Mac/PythonLauncher/Makefile.in Fri Jan 2 15:30:39 2009 @@ -19,13 +19,63 @@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@ @EXPORT_MACOSX_DEPLOYMENT_TARGET at export MACOSX_DEPLOYMENT_TARGET -BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py +BUNDLEBULDER=$(srcdir)/../Tools/bundlebuilder.py PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION) OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o -install: +install: Python\ Launcher.app test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" + + +clean: + rm -f *.o "Python Launcher" + rm -rf "Python Launcher.app" + +Python\ Launcher.app: Info.plist \ + Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \ + $(srcdir)/../Icons/PythonSource.icns \ + $(srcdir)/../Icons/PythonCompiled.icns \ + $(srcdir)/factorySettings.plist + rm -fr "Python Launcher.app" + $(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \ + --builddir=. \ + --name="Python Launcher" \ + --executable="Python Launcher" \ + --iconfile=$(srcdir)/../Icons/PythonLauncher.icns \ + --bundle-id=org.python.PythonLauncher \ + --resource=$(srcdir)/../Icons/PythonSource.icns \ + --resource=$(srcdir)/../Icons/PythonCompiled.icns \ + --resource=$(srcdir)/English.lproj \ + --resource=$(srcdir)/factorySettings.plist \ + --plist Info.plist \ + build + find "Python Launcher.app" -name '.svn' -print0 | xargs -0 rm -r + + +FileSettings.o: $(srcdir)/FileSettings.m + $(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m + +MyAppDelegate.o: $(srcdir)/MyAppDelegate.m + $(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m + +MyDocument.o: $(srcdir)/MyDocument.m + $(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m + +PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m + $(CC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m + +doscript.o: $(srcdir)/doscript.m + $(CC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m + +main.o: $(srcdir)/main.m + $(CC) $(CFLAGS) -o $@ -c $(srcdir)/main.m + +Python\ Launcher: $(OBJECTS) + $(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon + +Info.plist: $(srcdir)/Info.plist.in + sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist Modified: python/branches/py3k-issue1717/Mac/Tools/fixapplepython23.py ============================================================================== --- python/branches/py3k-issue1717/Mac/Tools/fixapplepython23.py (original) +++ python/branches/py3k-issue1717/Mac/Tools/fixapplepython23.py Fri Jan 2 15:30:39 2009 @@ -14,7 +14,7 @@ """ import sys import os -import gestalt as _gestalt +import platform MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile' CHANGES=(( @@ -99,11 +99,12 @@ print("fixapplypython23: no fix is needed on MacOSX on Intel") sys.exit(0) - if gestalt.gestalt('sysv') < 0x1030: + osver = platform.mac_ver() + if osver != '10.3' and os.ver < '10.3.': print('fixapplepython23: no fix needed on MacOSX < 10.3') sys.exit(0) - if gestalt.gestalt('sysv') >= 0x1040: + if osver >= '10.4': print('fixapplepython23: no fix needed on MacOSX >= 10.4') sys.exit(0) Modified: python/branches/py3k-issue1717/Makefile.pre.in ============================================================================== --- python/branches/py3k-issue1717/Makefile.pre.in (original) +++ python/branches/py3k-issue1717/Makefile.pre.in Fri Jan 2 15:30:39 2009 @@ -899,7 +899,7 @@ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(BUILDEXE)"; \ - cd $(srcdir)/Lib/$(PLATDIR); ./regen + cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) Modified: python/branches/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Fri Jan 2 15:30:39 2009 @@ -19,6 +19,24 @@ The tp_compare slot is reserved for future usage. A type definition with an assigned tp_compare slot will raise a TypeError. +- Issue #4747: When the terminal does not use utf-8, executing a script with + non-ascii characters in its name could fail with a "SyntaxError: None" error. + +- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open + file with `bytes' filename on Windows. + +- Issue #3680: Reference cycles created through a dict, set or deque iterator + did not get collected. + +- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types + where the tp_hash and tp_dict slots are both NULL. + +- Issue #4759: None is now allowed as the first argument of + bytearray.translate(). It was always allowed for bytes.translate(). + +- Added test case to ensure attempts to read from a file opened for writing + fail. + - Issue #3106: Speedup some comparisons (str/str and int/int). - Issue #2183: Simplify and optimize bytecode for list, dict and set @@ -60,9 +78,30 @@ - Issue #4569: Interpreter crash when mutating a memoryview with an item size larger than 1. +- Issue #4748: Lambda generators no longer return a value. + Library ------- +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. + +- Issue #4646: distutils was choking on empty options arg in the setup + function. Original patch by Thomas Heller. + +- Issue #3767: Convert Tk object to string in tkColorChooser. + +- Issue #3248: Allow placing ScrolledText in a PanedWindow. + +- Issue #4444: Allow assertRaises() to be used as a context handler, so that + the code under test can be written inline if more practical. + +- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') + works as expected in the interactive environment. + +- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by + Gabriel Genellina. + - Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char boundary. @@ -135,9 +174,16 @@ support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. +Tools/Demos +----------- + +- Issue #4677: add two list comprehension tests to pybench. + Extension Modules ----------------- +- Issue #1040026: Fix os.times result on systems where HZ is incorrect. + - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, OpenBSD. Modified: python/branches/py3k-issue1717/Misc/developers.txt ============================================================================== --- python/branches/py3k-issue1717/Misc/developers.txt (original) +++ python/branches/py3k-issue1717/Misc/developers.txt Fri Jan 2 15:30:39 2009 @@ -17,6 +17,9 @@ Permissions History ------------------- +- Tarek Ziad? as given SVN access on Decmeber 21 2008 by NCN, + for maintenance of distutils. + - Hirokazu Yamamoto was given SVN access on August 12 2008 by MvL, for contributions to the Windows build. Modified: python/branches/py3k-issue1717/Modules/_collectionsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_collectionsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/_collectionsmodule.c Fri Jan 2 15:30:39 2009 @@ -900,7 +900,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequeiter_type); + it = PyObject_GC_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; @@ -909,14 +909,22 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } +static int +dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg) +{ + Py_VISIT(dio->deque); + return 0; +} + static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); - Py_TYPE(dio)->tp_free(dio); + PyObject_GC_Del(dio); } static PyObject * @@ -981,9 +989,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -1002,7 +1010,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequereviter_type); + it = PyObject_GC_New(dequeiterobject, &dequereviter_type); if (it == NULL) return NULL; it->b = deque->rightblock; @@ -1011,6 +1019,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } @@ -1063,9 +1072,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/py3k-issue1717/Modules/_fileio.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_fileio.c (original) +++ python/branches/py3k-issue1717/Modules/_fileio.c Fri Jan 2 15:30:39 2009 @@ -116,7 +116,7 @@ directories, so we need a check. */ static int -dircheck(PyFileIOObject* self) +dircheck(PyFileIOObject* self, char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -128,8 +128,8 @@ if (internal_close(self)) return -1; - exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + exc = PyObject_CallFunction(PyExc_IOError, "(iss)", + EISDIR, msg, name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return -1; @@ -284,13 +284,14 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } - if(dircheck(self) < 0) + if(dircheck(self, name) < 0) goto error; } Modified: python/branches/py3k-issue1717/Modules/_pickle.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_pickle.c (original) +++ python/branches/py3k-issue1717/Modules/_pickle.c Fri Jan 2 15:30:39 2009 @@ -1109,16 +1109,21 @@ static const char *hexdigits = "0123456789abcdef"; #ifdef Py_UNICODE_WIDE - repr = PyBytes_FromStringAndSize(NULL, 10 * size); + const Py_ssize_t expandsize = 10; #else - repr = PyBytes_FromStringAndSize(NULL, 6 * size); + const Py_ssize_t expandsize = 6; #endif + + if (size > PY_SSIZE_T_MAX / expandsize) + return PyErr_NoMemory(); + + repr = PyByteArray_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) goto done; - p = q = PyBytes_AS_STRING(repr); + p = q = PyByteArray_AS_STRING(repr); while (size-- > 0) { Py_UNICODE ch = *s++; #ifdef Py_UNICODE_WIDE @@ -1136,6 +1141,32 @@ *p++ = hexdigits[ch & 15]; } 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++; + } #endif /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256 || ch == '\\' || ch == '\n') { @@ -1146,14 +1177,14 @@ *p++ = hexdigits[(ch >> 4) & 0xf]; *p++ = hexdigits[ch & 15]; } - /* Copy everything else as-is */ + /* Copy everything else as-is */ else *p++ = (char) ch; } size = p - q; done: - result = PyBytes_FromStringAndSize(PyBytes_AS_STRING(repr), size); + result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(repr), size); Py_DECREF(repr); return result; } Modified: python/branches/py3k-issue1717/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_testcapimodule.c (original) +++ python/branches/py3k-issue1717/Modules/_testcapimodule.c Fri Jan 2 15:30:39 2009 @@ -175,6 +175,105 @@ } +/* Issue #4701: Check that PyObject_Hash implicitly calls + * PyType_Ready if it hasn't already been called + */ +static PyTypeObject _HashInheritanceTester_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "hashinheritancetester", /* Name of this type */ + sizeof(PyObject), /* Basic object size */ + 0, /* Item size for varobject */ + (destructor)PyObject_Del, /* 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, /* 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 */ + 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 */ + PyType_GenericNew, /* tp_new */ +}; + +static PyObject* +test_lazy_hash_inheritance(PyObject* self) +{ + PyTypeObject *type; + PyObject *obj; + long hash; + + type = &_HashInheritanceTester_Type; + obj = PyObject_New(PyObject, type); + if (obj == NULL) { + PyErr_Clear(); + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: failed to create object"); + return NULL; + } + + if (type->tp_dict != NULL) { + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: type initialised too soon"); + Py_DECREF(obj); + return NULL; + } + + hash = PyObject_Hash(obj); + if ((hash == -1) && PyErr_Occurred()) { + PyErr_Clear(); + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: could not hash object"); + Py_DECREF(obj); + return NULL; + } + + if (type->tp_dict == NULL) { + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: type not initialised by hash()"); + Py_DECREF(obj); + return NULL; + } + + if (type->tp_hash != PyType_Type.tp_hash) { + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: unexpected hash function"); + Py_DECREF(obj); + return NULL; + } + + Py_RETURN_NONE; +} + + /* Tests of PyLong_{As, From}{Unsigned,}Long(), and (#ifdef HAVE_LONG_LONG) PyLong_{As, From}{Unsigned,}LongLong(). @@ -508,6 +607,8 @@ Py_RETURN_NONE; } +static volatile int x; + /* Test the u and u# codes for PyArg_ParseTuple. May leak memory in case of an error. */ @@ -522,7 +623,6 @@ /* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */ /* Just use the macro and check that it compiles */ x = Py_UNICODE_ISSPACE(25); - x = x; tuple = PyTuple_New(1); if (tuple == NULL) @@ -608,6 +708,32 @@ } static PyObject * +test_empty_argparse(PyObject *self) +{ + /* Test that formats can begin with '|'. See issue #4720. */ + PyObject *tuple, *dict = NULL; + static char *kwlist[] = {NULL}; + int result; + tuple = PyTuple_New(0); + if (!tuple) + return NULL; + if ((result = PyArg_ParseTuple(tuple, "|:test_empty_argparse")) < 0) + goto done; + dict = PyDict_New(); + if (!dict) + goto done; + result = PyArg_ParseTupleAndKeywords(tuple, dict, "|:test_empty_argparse", kwlist); + done: + Py_DECREF(tuple); + Py_XDECREF(dict); + if (result < 0) + return NULL; + else { + Py_RETURN_NONE; + } +} + +static PyObject * codec_incrementalencoder(PyObject *self, PyObject *args) { const char *encoding, *errors = NULL; @@ -1009,9 +1135,11 @@ {"test_config", (PyCFunction)test_config, METH_NOARGS}, {"test_list_api", (PyCFunction)test_list_api, METH_NOARGS}, {"test_dict_iteration", (PyCFunction)test_dict_iteration,METH_NOARGS}, + {"test_lazy_hash_inheritance", (PyCFunction)test_lazy_hash_inheritance,METH_NOARGS}, {"test_long_api", (PyCFunction)test_long_api, METH_NOARGS}, {"test_long_numbits", (PyCFunction)test_long_numbits, METH_NOARGS}, {"test_k_code", (PyCFunction)test_k_code, METH_NOARGS}, + {"test_empty_argparse", (PyCFunction)test_empty_argparse,METH_NOARGS}, {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, {"test_string_from_format", (PyCFunction)test_string_from_format, METH_NOARGS}, {"test_with_docstring", (PyCFunction)test_with_docstring, METH_NOARGS, @@ -1211,6 +1339,8 @@ if (m == NULL) return NULL; + Py_TYPE(&_HashInheritanceTester_Type)=&PyType_Type; + Py_TYPE(&test_structmembersType)=&PyType_Type; Py_INCREF(&test_structmembersType); PyModule_AddObject(m, "test_structmembersType", (PyObject *)&test_structmembersType); Modified: python/branches/py3k-issue1717/Modules/main.c ============================================================================== --- python/branches/py3k-issue1717/Modules/main.c (original) +++ python/branches/py3k-issue1717/Modules/main.c Fri Jan 2 15:30:39 2009 @@ -600,18 +600,21 @@ } if (sts==-1) { - char cfilename[PATH_MAX]; + PyObject *filenameObj = NULL; char *p_cfilename = ""; if (filename) { - size_t r = wcstombs(cfilename, filename, PATH_MAX); - p_cfilename = cfilename; - if (r == (size_t)-1 || r >= PATH_MAX) + filenameObj = PyUnicode_FromWideChar( + filename, wcslen(filename)); + if (filenameObj != NULL) + p_cfilename = _PyUnicode_AsString(filenameObj); + else p_cfilename = ""; } sts = PyRun_AnyFileExFlags( fp, p_cfilename, filename != NULL, &cf) != 0; + Py_XDECREF(filenameObj); } } Modified: python/branches/py3k-issue1717/Modules/mathmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/mathmodule.c (original) +++ python/branches/py3k-issue1717/Modules/mathmodule.c Fri Jan 2 15:30:39 2009 @@ -685,7 +685,10 @@ return NULL; } -PyDoc_STRVAR(math_factorial_doc, "Return n!"); +PyDoc_STRVAR(math_factorial_doc, +"factorial(x) -> Integral\n" +"\n" +"Find x!. Raise a ValueError if x is negative or non-integral."); static PyObject * math_trunc(PyObject *self, PyObject *number) @@ -837,7 +840,7 @@ "modf(x)\n" "\n" "Return the fractional and integer parts of x. Both results carry the sign\n" -"of x. The integer part is returned as a real."); +"of x and are floats."); /* A decent logarithm is easy to compute even for huge longs, but libm can't do that by itself -- loghelper can. func is log or log10, and name is Modified: python/branches/py3k-issue1717/Modules/posixmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/posixmodule.c (original) +++ python/branches/py3k-issue1717/Modules/posixmodule.c Fri Jan 2 15:30:39 2009 @@ -4494,10 +4494,6 @@ #ifdef HAVE_TIMES -#ifndef HZ -#define HZ 60 /* Universal constant :-) */ -#endif /* HZ */ - #if defined(PYCC_VACPP) && defined(PYOS_OS2) static long system_uptime(void) @@ -4523,6 +4519,8 @@ (double)system_uptime() / 1000); } #else /* not OS2 */ +#define NEED_TICKS_PER_SECOND +static long ticks_per_second = -1; static PyObject * posix_times(PyObject *self, PyObject *noargs) { @@ -4533,11 +4531,11 @@ if (c == (clock_t) -1) return posix_error(); return Py_BuildValue("ddddd", - (double)t.tms_utime / HZ, - (double)t.tms_stime / HZ, - (double)t.tms_cutime / HZ, - (double)t.tms_cstime / HZ, - (double)c / HZ); + (double)t.tms_utime / ticks_per_second, + (double)t.tms_stime / ticks_per_second, + (double)t.tms_cutime / ticks_per_second, + (double)t.tms_cstime / ticks_per_second, + (double)c / ticks_per_second); } #endif /* not OS2 */ #endif /* HAVE_TIMES */ @@ -7409,6 +7407,15 @@ statvfs_result_desc.name = MODNAME ".statvfs_result"; PyStructSequence_InitType(&StatVFSResultType, &statvfs_result_desc); +#ifdef NEED_TICKS_PER_SECOND +# if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK) + ticks_per_second = sysconf(_SC_CLK_TCK); +# elif defined(HZ) + ticks_per_second = HZ; +# else + ticks_per_second = 60; /* magic fallback value; may be bogus */ +# endif +#endif } Py_INCREF((PyObject*) &StatResultType); PyModule_AddObject(m, "stat_result", (PyObject*) &StatResultType); Modified: python/branches/py3k-issue1717/Objects/bytearrayobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/bytearrayobject.c (original) +++ python/branches/py3k-issue1717/Objects/bytearrayobject.c Fri Jan 2 15:30:39 2009 @@ -1371,28 +1371,32 @@ PyObject *input_obj = (PyObject*)self; const char *output_start; Py_ssize_t inlen; - PyObject *result; + PyObject *result = NULL; int trans_table[256]; - PyObject *tableobj, *delobj = NULL; + PyObject *tableobj = NULL, *delobj = NULL; Py_buffer vtable, vdel; if (!PyArg_UnpackTuple(args, "translate", 1, 2, &tableobj, &delobj)) return NULL; - if (_getbuffer(tableobj, &vtable) < 0) + if (tableobj == Py_None) { + table = NULL; + tableobj = NULL; + } else if (_getbuffer(tableobj, &vtable) < 0) { return NULL; - - if (vtable.len != 256) { - PyErr_SetString(PyExc_ValueError, - "translation table must be 256 characters long"); - result = NULL; - goto done; + } else { + if (vtable.len != 256) { + PyErr_SetString(PyExc_ValueError, + "translation table must be 256 characters long"); + goto done; + } + table = (const char*)vtable.buf; } if (delobj != NULL) { if (_getbuffer(delobj, &vdel) < 0) { - result = NULL; + delobj = NULL; /* don't try to release vdel buffer on exit */ goto done; } } @@ -1401,7 +1405,6 @@ vdel.len = 0; } - table = (const char *)vtable.buf; inlen = PyByteArray_GET_SIZE(input_obj); result = PyByteArray_FromStringAndSize((char *)NULL, inlen); if (result == NULL) @@ -1409,7 +1412,7 @@ output_start = output = PyByteArray_AsString(result); input = PyByteArray_AS_STRING(input_obj); - if (vdel.len == 0) { + if (vdel.len == 0 && table != NULL) { /* If no deletions are required, use faster code */ for (i = inlen; --i >= 0; ) { c = Py_CHARMASK(*input++); @@ -1417,9 +1420,14 @@ } goto done; } - - for (i = 0; i < 256; i++) - trans_table[i] = Py_CHARMASK(table[i]); + + if (table == NULL) { + for (i = 0; i < 256; i++) + trans_table[i] = Py_CHARMASK(i); + } else { + for (i = 0; i < 256; i++) + trans_table[i] = Py_CHARMASK(table[i]); + } for (i = 0; i < vdel.len; i++) trans_table[(int) Py_CHARMASK( ((unsigned char*)vdel.buf)[i] )] = -1; @@ -1435,7 +1443,8 @@ PyByteArray_Resize(result, output - output_start); done: - PyBuffer_Release(&vtable); + if (tableobj != NULL) + PyBuffer_Release(&vtable); if (delobj != NULL) PyBuffer_Release(&vdel); return result; Modified: python/branches/py3k-issue1717/Objects/bytesobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/bytesobject.c (original) +++ python/branches/py3k-issue1717/Objects/bytesobject.c Fri Jan 2 15:30:39 2009 @@ -1892,11 +1892,6 @@ del_table = PyBytes_AS_STRING(delobj); dellen = PyBytes_GET_SIZE(delobj); } - else if (PyUnicode_Check(delobj)) { - PyErr_SetString(PyExc_TypeError, - "deletions are implemented differently for unicode"); - return NULL; - } else if (PyObject_AsCharBuffer(delobj, &del_table, &dellen)) return NULL; } Modified: python/branches/py3k-issue1717/Objects/dictobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/dictobject.c (original) +++ python/branches/py3k-issue1717/Objects/dictobject.c Fri Jan 2 15:30:39 2009 @@ -2122,7 +2122,7 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; - di = PyObject_New(dictiterobject, itertype); + di = PyObject_GC_New(dictiterobject, itertype); if (di == NULL) return NULL; Py_INCREF(dict); @@ -2139,6 +2139,7 @@ } else di->di_result = NULL; + _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -2147,7 +2148,15 @@ { Py_XDECREF(di->di_dict); Py_XDECREF(di->di_result); - PyObject_Del(di); + PyObject_GC_Del(di); +} + +static int +dictiter_traverse(dictiterobject *di, visitproc visit, void *arg) +{ + Py_VISIT(di->di_dict); + Py_VISIT(di->di_result); + return 0; } static PyObject * @@ -2228,9 +2237,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2300,9 +2309,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2386,9 +2395,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2415,7 +2424,14 @@ dictview_dealloc(dictviewobject *dv) { Py_XDECREF(dv->dv_dict); - PyObject_Del(dv); + PyObject_GC_Del(dv); +} + +static int +dictview_traverse(dictviewobject *dv, visitproc visit, void *arg) +{ + Py_VISIT(dv->dv_dict); + return 0; } static Py_ssize_t @@ -2442,11 +2458,12 @@ type->tp_name, dict->ob_type->tp_name); return NULL; } - dv = PyObject_New(dictviewobject, type); + dv = PyObject_GC_New(dictviewobject, type); if (dv == NULL) return NULL; Py_INCREF(dict); dv->dv_dict = (PyDictObject *)dict; + _PyObject_GC_TRACK(dv); return (PyObject *)dv; } @@ -2693,9 +2710,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ dictview_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2777,9 +2794,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ dictview_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2842,9 +2859,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/py3k-issue1717/Objects/object.c ============================================================================== --- python/branches/py3k-issue1717/Objects/object.c (original) +++ python/branches/py3k-issue1717/Objects/object.c Fri Jan 2 15:30:39 2009 @@ -344,8 +344,11 @@ if (op == NULL) fprintf(stderr, "NULL\n"); else { + PyGILState_STATE gil; fprintf(stderr, "object : "); + gil = PyGILState_Ensure(); (void)PyObject_Print(op, stderr, 0); + PyGILState_Release(gil); /* XXX(twouters) cast refcount to long until %zd is universally available */ fprintf(stderr, "\n" @@ -724,6 +727,17 @@ PyTypeObject *tp = Py_TYPE(v); if (tp->tp_hash != NULL) return (*tp->tp_hash)(v); + /* To keep to the general practice that inheriting + * solely from object in C code should work without + * an explicit call to PyType_Ready, we implicitly call + * PyType_Ready here and then check the tp_hash slot again + */ + if (tp->tp_dict == NULL) { + if (PyType_Ready(tp) < 0) + return -1; + if (tp->tp_hash != NULL) + return (*tp->tp_hash)(v); + } /* Otherwise, the object can't be hashed */ return PyObject_HashNotImplemented(v); } Modified: python/branches/py3k-issue1717/Objects/setobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/setobject.c (original) +++ python/branches/py3k-issue1717/Objects/setobject.c Fri Jan 2 15:30:39 2009 @@ -802,7 +802,14 @@ setiter_dealloc(setiterobject *si) { Py_XDECREF(si->si_set); - PyObject_Del(si); + PyObject_GC_Del(si); +} + +static int +setiter_traverse(setiterobject *si, visitproc visit, void *arg) +{ + Py_VISIT(si->si_set); + return 0; } static PyObject * @@ -880,9 +887,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)setiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -895,7 +902,7 @@ static PyObject * set_iter(PySetObject *so) { - setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type); + setiterobject *si = PyObject_GC_New(setiterobject, &PySetIter_Type); if (si == NULL) return NULL; Py_INCREF(so); @@ -903,6 +910,7 @@ si->si_used = so->used; si->si_pos = 0; si->len = so->used; + _PyObject_GC_TRACK(si); return (PyObject *)si; } Modified: python/branches/py3k-issue1717/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/unicodeobject.c (original) +++ python/branches/py3k-issue1717/Objects/unicodeobject.c Fri Jan 2 15:30:39 2009 @@ -418,7 +418,8 @@ } } -int PyUnicode_Resize(PyObject **unicode, Py_ssize_t length) +static +int _PyUnicode_Resize(PyUnicodeObject **unicode, Py_ssize_t length) { register PyUnicodeObject *v; @@ -427,7 +428,7 @@ PyErr_BadInternalCall(); return -1; } - v = (PyUnicodeObject *)*unicode; + v = *unicode; if (v == NULL || !PyUnicode_Check(v) || Py_REFCNT(v) != 1 || length < 0) { PyErr_BadInternalCall(); return -1; @@ -444,7 +445,7 @@ Py_UNICODE_COPY(w->str, v->str, length < v->length ? length : v->length); Py_DECREF(*unicode); - *unicode = (PyObject *)w; + *unicode = w; return 0; } @@ -453,9 +454,10 @@ return unicode_resize(v, length); } -/* Internal API for use in unicodeobject.c only ! */ -#define _PyUnicode_Resize(unicodevar, length) \ - PyUnicode_Resize(((PyObject **)(unicodevar)), length) +int PyUnicode_Resize(PyObject **unicode, Py_ssize_t length) +{ + return _PyUnicode_Resize((PyUnicodeObject **)unicode, length); +} PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size) @@ -989,7 +991,7 @@ PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); - _PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); + PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; fail: if (callresults) { @@ -1549,7 +1551,7 @@ 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, - PyObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) + PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) { static char *argparse = "O!n;decoding error handler must return (str, int) tuple"; @@ -1627,7 +1629,7 @@ if (requiredsize > outsize) { if (requiredsize<2*outsize) requiredsize = 2*outsize; - if (PyUnicode_Resize(output, requiredsize) < 0) + if (_PyUnicode_Resize(output, requiredsize) < 0) goto onError; *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; } @@ -1827,7 +1829,7 @@ errors, &errorHandler, "utf7", errmsg, &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -1838,7 +1840,7 @@ errors, &errorHandler, "utf7", "unterminated shift sequence", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; if (s < e) goto restart; @@ -1871,7 +1873,7 @@ int encodeWhiteSpace, const char *errors) { - PyObject *v, *result; + PyObject *v; /* It might be possible to tighten this worst case */ Py_ssize_t cbAllocated = 5 * size; int inShift = 0; @@ -1887,11 +1889,11 @@ if (cbAllocated / 5 != size) return PyErr_NoMemory(); - v = PyByteArray_FromStringAndSize(NULL, cbAllocated); + v = PyBytes_FromStringAndSize(NULL, cbAllocated); if (v == NULL) return NULL; - start = out = PyByteArray_AS_STRING(v); + start = out = PyBytes_AS_STRING(v); for (;i < size; ++i) { Py_UNICODE ch = s[i]; @@ -1956,10 +1958,9 @@ *out++= B64(charsleft << (6-bitsleft) ); *out++ = '-'; } - - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(v), out - start); - Py_DECREF(v); - return result; + if (_PyBytes_Resize(&v, out - start) < 0) + return NULL; + return v; } #undef SPECIAL @@ -2166,7 +2167,7 @@ errors, &errorHandler, "utf8", errmsg, &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } if (consumed) @@ -2446,7 +2447,7 @@ errors, &errorHandler, "utf32", errmsg, &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -2477,7 +2478,7 @@ const char *errors, int byteorder) { - PyObject *v, *result; + PyObject *v; unsigned char *p; Py_ssize_t nsize, bytesize; #ifndef Py_UNICODE_WIDE @@ -2513,11 +2514,11 @@ bytesize = nsize * 4; if (bytesize / 4 != nsize) return PyErr_NoMemory(); - v = PyByteArray_FromStringAndSize(NULL, bytesize); + v = PyBytes_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; - p = (unsigned char *)PyByteArray_AS_STRING(v); + p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) STORECHAR(0xFEFF); if (size == 0) @@ -2554,9 +2555,7 @@ } done: - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(v), Py_SIZE(v)); - Py_DECREF(v); - return result; + return v; #undef STORECHAR } @@ -2724,7 +2723,7 @@ errors, &errorHandler, "utf16", errmsg, &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -2755,7 +2754,7 @@ const char *errors, int byteorder) { - PyObject *v, *result; + PyObject *v; unsigned char *p; Py_ssize_t nsize, bytesize; #ifdef Py_UNICODE_WIDE @@ -2790,11 +2789,11 @@ bytesize = nsize * 2; if (bytesize / 2 != nsize) return PyErr_NoMemory(); - v = PyByteArray_FromStringAndSize(NULL, bytesize); + v = PyBytes_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; - p = (unsigned char *)PyByteArray_AS_STRING(v); + p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) STORECHAR(0xFEFF); if (size == 0) @@ -2826,9 +2825,7 @@ } done: - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(v), Py_SIZE(v)); - Py_DECREF(v); - return result; + return v; #undef STORECHAR } @@ -2949,7 +2946,7 @@ errors, &errorHandler, "unicodeescape", "end of string in escape sequence", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2961,7 +2958,7 @@ errors, &errorHandler, "unicodeescape", message, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3000,7 +2997,7 @@ errors, &errorHandler, "unicodeescape", "illegal Unicode character", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } break; @@ -3042,7 +3039,7 @@ errors, &errorHandler, "unicodeescape", message, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; break; @@ -3056,7 +3053,7 @@ errors, &errorHandler, "unicodeescape", message, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } else { @@ -3118,7 +3115,7 @@ PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size) { - PyObject *repr, *result; + PyObject *repr; char *p; #ifdef Py_UNICODE_WIDE @@ -3145,17 +3142,20 @@ escape. */ + if (size == 0) + return PyBytes_FromStringAndSize(NULL, 0); + if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) return PyErr_NoMemory(); - repr = PyByteArray_FromStringAndSize(NULL, + repr = PyBytes_FromStringAndSize(NULL, 2 + expandsize*size + 1); if (repr == NULL) return NULL; - p = PyByteArray_AS_STRING(repr); + p = PyBytes_AS_STRING(repr); while (size-- > 0) { Py_UNICODE ch = *s++; @@ -3247,28 +3247,22 @@ *p++ = (char) ch; } - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(repr), - p - PyByteArray_AS_STRING(repr)); - Py_DECREF(repr); - return result; + assert(p - PyBytes_AS_STRING(repr) > 0); + if (_PyBytes_Resize(&repr, p - PyBytes_AS_STRING(repr)) < 0) + return NULL; + return repr; } PyObject *PyUnicode_AsUnicodeEscapeString(PyObject *unicode) { - PyObject *s, *result; + PyObject *s; if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); return NULL; } s = PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode)); - - if (!s) - return NULL; - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(s), - PyByteArray_GET_SIZE(s)); - Py_DECREF(s); - return result; + return s; } /* --- Raw Unicode Escape Codec ------------------------------------------- */ @@ -3339,7 +3333,7 @@ errors, &errorHandler, "rawunicodeescape", "truncated \\uXXXX", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3371,7 +3365,7 @@ errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } nextByte: @@ -3393,7 +3387,7 @@ PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size) { - PyObject *repr, *result; + PyObject *repr; char *p; char *q; @@ -3406,13 +3400,13 @@ if (size > PY_SSIZE_T_MAX / expandsize) return PyErr_NoMemory(); - repr = PyByteArray_FromStringAndSize(NULL, expandsize * size); + repr = PyBytes_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) - goto done; + return repr; - p = q = PyByteArray_AS_STRING(repr); + p = q = PyBytes_AS_STRING(repr); while (size-- > 0) { Py_UNICODE ch = *s++; #ifdef Py_UNICODE_WIDE @@ -3472,15 +3466,15 @@ } size = p - q; - done: - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(repr), size); - Py_DECREF(repr); - return result; + assert(size > 0); + if (_PyBytes_Resize(&repr, size) < 0) + return NULL; + return repr; } PyObject *PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) { - PyObject *s, *result; + PyObject *s; if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); return NULL; @@ -3488,12 +3482,7 @@ s = PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode)); - if (!s) - return NULL; - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(s), - PyByteArray_GET_SIZE(s)); - Py_DECREF(s); - return result; + return s; } /* --- Unicode Internal Codec ------------------------------------------- */ @@ -3551,7 +3540,7 @@ errors, &errorHandler, "unicode_internal", reason, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { goto onError; } } @@ -3715,7 +3704,6 @@ const char *reason = (limit == 256) ? "ordinal not in range(256)" : "ordinal not in range(128)"; PyObject *errorHandler = NULL; PyObject *exc = NULL; - PyObject *result = NULL; /* the following variable is used for caching string comparisons * -1=not initialized, 0=unknown, 1=strict, 2=replace, 3=ignore, 4=xmlcharrefreplace */ int known_errorHandler = -1; @@ -3724,10 +3712,10 @@ replacements, if we need more, we'll resize */ if (size == 0) return PyBytes_FromStringAndSize(NULL, 0); - res = PyByteArray_FromStringAndSize(NULL, size); + res = PyBytes_FromStringAndSize(NULL, size); if (res == NULL) return NULL; - str = PyByteArray_AS_STRING(res); + str = PyBytes_AS_STRING(res); ressize = size; while (p ressize) { if (requiredsize<2*ressize) requiredsize = 2*ressize; - if (PyByteArray_Resize(res, requiredsize)) + if (_PyBytes_Resize(&res, requiredsize)) goto onError; - str = PyByteArray_AS_STRING(res) + respos; + str = PyBytes_AS_STRING(res) + respos; ressize = requiredsize; } /* generate replacement (temporarily (mis)uses p) */ @@ -3824,17 +3812,17 @@ /* 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 - PyByteArray_AS_STRING(res); + 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 (PyByteArray_Resize(res, requiredsize)) { + if (_PyBytes_Resize(&res, requiredsize)) { Py_DECREF(repunicode); goto onError; } - str = PyByteArray_AS_STRING(res) + respos; + str = PyBytes_AS_STRING(res) + respos; ressize = requiredsize; } /* check if there is anything unencodable in the replacement @@ -3854,13 +3842,23 @@ } } } - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(res), - str - PyByteArray_AS_STRING(res)); + /* Resize if we allocated to much */ + size = str - PyBytes_AS_STRING(res); + if (size < ressize) { /* If this falls res will be NULL */ + assert(size >= 0); + if (_PyBytes_Resize(&res, size) < 0) + goto onError; + } + + Py_XDECREF(errorHandler); + Py_XDECREF(exc); + return res; + onError: - Py_DECREF(res); + Py_XDECREF(res); Py_XDECREF(errorHandler); Py_XDECREF(exc); - return result; + return NULL; } PyObject *PyUnicode_EncodeLatin1(const Py_UNICODE *p, @@ -3924,7 +3922,7 @@ errors, &errorHandler, "ascii", "ordinal not in range(128)", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } } @@ -4225,7 +4223,7 @@ errors, &errorHandler, "charmap", "character maps to ", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { goto onError; } continue; @@ -4275,7 +4273,7 @@ errors, &errorHandler, "charmap", "character maps to ", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { Py_DECREF(x); goto onError; } @@ -4843,7 +4841,8 @@ /* Resize if we allocated to much */ if (resposu->u_argcount = asdl_seq_LEN(args->args); c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs); VISIT_IN_SCOPE(c, expr, e->v.Lambda.body); - ADDOP_IN_SCOPE(c, RETURN_VALUE); + if (c->u->u_ste->ste_generator) { + ADDOP_IN_SCOPE(c, POP_TOP); + } + else { + ADDOP_IN_SCOPE(c, RETURN_VALUE); + } co = assemble(c, 1); compiler_exit_scope(c); if (co == NULL) Modified: python/branches/py3k-issue1717/Python/getargs.c ============================================================================== --- python/branches/py3k-issue1717/Python/getargs.c (original) +++ python/branches/py3k-issue1717/Python/getargs.c Fri Jan 2 15:30:39 2009 @@ -1392,7 +1392,7 @@ Py_ssize_t count; PyBufferProcs *pb = arg->ob_type->tp_as_buffer; if (pb == NULL) { - *errmsg = "string or buffer"; + *errmsg = "bytes or buffer"; return -1; } if (pb->bf_getbuffer) { @@ -1649,7 +1649,7 @@ } } - if (!IS_END_OF_FORMAT(*format)) { + if (!IS_END_OF_FORMAT(*format) && *format != '|') { PyErr_Format(PyExc_RuntimeError, "more argument specifiers than keyword list entries " "(remaining format:'%s')", format); Modified: python/branches/py3k-issue1717/Tools/pybench/Lists.py ============================================================================== --- python/branches/py3k-issue1717/Tools/pybench/Lists.py (original) +++ python/branches/py3k-issue1717/Tools/pybench/Lists.py Fri Jan 2 15:30:39 2009 @@ -293,3 +293,58 @@ for i in range(self.rounds): pass + +class SimpleListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + n = list(range(10)) * 10 + + for i in range(self.rounds): + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + def calibrate(self): + + n = list(range(10)) * 10 + + for i in range(self.rounds): + pass + +class NestedListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + m = list(range(10)) + n = list(range(10)) + + for i in range(self.rounds): + l = [x for x in n for y in m] + l = [y for x in n for y in m] + + l = [x for x in n for y in m if y] + l = [y for x in n for y in m if x] + + l = [x for x in n for y in m if not y] + l = [y for x in n for y in m if not x] + + def calibrate(self): + + m = list(range(10)) + n = list(range(10)) + + for i in range(self.rounds): + pass Modified: python/branches/py3k-issue1717/setup.py ============================================================================== --- python/branches/py3k-issue1717/setup.py (original) +++ python/branches/py3k-issue1717/setup.py Fri Jan 2 15:30:39 2009 @@ -208,7 +208,8 @@ if missing: print() - print("Failed to find the necessary bits to build these modules:") + print("Python build finished, but the necessary bits to build " + "these modules were not found:") print_three_column(missing) print("To find the necessary bits, look in setup.py in" " detect_modules() for the module's name.") From python-checkins at python.org Fri Jan 2 15:46:19 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 15:46:19 +0100 (CET) Subject: [Python-checkins] r68158 - in python/trunk: Lib/plat-mac/videoreader.py Misc/NEWS Message-ID: <20090102144619.7431B1E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 15:46:19 2009 New Revision: 68158 Log: Fix for issue 900949 Modified: python/trunk/Lib/plat-mac/videoreader.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/plat-mac/videoreader.py ============================================================================== --- python/trunk/Lib/plat-mac/videoreader.py (original) +++ python/trunk/Lib/plat-mac/videoreader.py Fri Jan 2 15:46:19 2009 @@ -238,12 +238,12 @@ width = self.videodescr['width'] height = self.videodescr['height'] start = 0 - rv = '' + rv = [] for i in range(height): nextline = Qdoffs.GetPixMapBytes(self.pixmap, start, width*4) start = start + rowbytes - rv = rv + nextline - return rv + rv.append(nextline) + return ''.join(rv) def reader(url): try: @@ -255,9 +255,9 @@ def _test(): import EasyDialogs try: - import img + from PIL import Image except ImportError: - img = None + Image = None import MacOS Qt.EnterMovies() path = EasyDialogs.AskFileForOpen(message='Video to convert') @@ -277,13 +277,11 @@ fname = 'frame%04.4d.jpg'%num num = num+1 pname = os.path.join(dstdir, fname) - if not img: print 'Not', + if not Image: print 'Not', print 'Writing %s, size %dx%d, %d bytes'%(fname, imgw, imgh, len(data)) - if img: - wrt = img.writer(imgfmt, pname) - wrt.width = imgw - wrt.height = imgh - wrt.write(data) + if Image: + img = Image.fromstring("RGBA", (imgw, imgh), data) + img.save(pname, 'JPEG') timestamp, data = rdr.ReadVideo() MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG') if num > 20: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 15:46:19 2009 @@ -227,6 +227,9 @@ - Issue #1594: MacOS.GetCreatorAndType now always returns a big-endian result, to be consistent with Apple tools. +- Issue #900949: plat-mac/videoreader.py no longer relies on a non-existing + module. + Tools/Demos ----------- From python-checkins at python.org Fri Jan 2 15:48:18 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 15:48:18 +0100 (CET) Subject: [Python-checkins] r68159 - in python/trunk: Lib/plat-mac/videoreader.py Misc/NEWS Message-ID: <20090102144818.56B211E405A@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 15:48:17 2009 New Revision: 68159 Log: Fix for issue 1627952 Modified: python/trunk/Lib/plat-mac/videoreader.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/plat-mac/videoreader.py ============================================================================== --- python/trunk/Lib/plat-mac/videoreader.py (original) +++ python/trunk/Lib/plat-mac/videoreader.py Fri Jan 2 15:48:17 2009 @@ -18,7 +18,7 @@ from Carbon import QDOffscreen from Carbon import Res try: - import MediaDescr + from Carbon import MediaDescr except ImportError: def _audiodescr(data): return None Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 15:48:17 2009 @@ -230,6 +230,8 @@ - Issue #900949: plat-mac/videoreader.py no longer relies on a non-existing module. +- Issue #16278952: plat-mac/videoreader.py now correctly imports MediaDescr + Tools/Demos ----------- From python-checkins at python.org Fri Jan 2 15:52:09 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 15:52:09 +0100 (CET) Subject: [Python-checkins] r68160 - in python/trunk: Lib/plat-mac/EasyDialogs.py Misc/NEWS Message-ID: <20090102145209.9D1DF1E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 15:52:09 2009 New Revision: 68160 Log: Fix for issue r1737832 Modified: python/trunk/Lib/plat-mac/EasyDialogs.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/plat-mac/EasyDialogs.py ============================================================================== --- python/trunk/Lib/plat-mac/EasyDialogs.py (original) +++ python/trunk/Lib/plat-mac/EasyDialogs.py Fri Jan 2 15:52:09 2009 @@ -573,7 +573,7 @@ del d def _process_Nav_args(dftflags, **args): - import aepack + import Carbon.AppleEvents import Carbon.AE import Carbon.File for k in args.keys(): @@ -585,11 +585,14 @@ if args.has_key('defaultLocation') and \ not isinstance(args['defaultLocation'], Carbon.AE.AEDesc): defaultLocation = args['defaultLocation'] - if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): - args['defaultLocation'] = aepack.pack(defaultLocation) + if isinstance(defaultLocation, Carbon.File.FSSpec): + args['defaultLocation'] = Carbon.AE.AECreateDesc( + Carbon.AppleEvents.typeFSS, defaultLocation.data) else: - defaultLocation = Carbon.File.FSRef(defaultLocation) - args['defaultLocation'] = aepack.pack(defaultLocation) + if not isinstance(defaultLocation, Carbon.File.FSRef): + defaultLocation = Carbon.File.FSRef(defaultLocation) + args['defaultLocation'] = Carbon.AE.AECreateDesc( + Carbon.AppleEvents.typeFSRef, defaultLocation.data) if args.has_key('typeList') and not isinstance(args['typeList'], Carbon.Res.ResourceType): typeList = args['typeList'][:] # Workaround for OSX typeless files: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 15:52:09 2009 @@ -232,6 +232,9 @@ - Issue #16278952: plat-mac/videoreader.py now correctly imports MediaDescr +- Issue #1737832 : plat-mac/EasyDialog.py no longer uses the broken aepack + module. + Tools/Demos ----------- From python-checkins at python.org Fri Jan 2 16:00:06 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 16:00:06 +0100 (CET) Subject: [Python-checkins] r68161 - in python/trunk: Lib/plat-mac/macostools.py Misc/NEWS Message-ID: <20090102150006.34DAC1E4002@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 16:00:05 2009 New Revision: 68161 Log: Fix for issue 1149804 Modified: python/trunk/Lib/plat-mac/macostools.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/plat-mac/macostools.py ============================================================================== --- python/trunk/Lib/plat-mac/macostools.py (original) +++ python/trunk/Lib/plat-mac/macostools.py Fri Jan 2 16:00:05 2009 @@ -62,7 +62,14 @@ if os.sep == ':' and not ':' in head: head = head + ':' mkdirs(head) - os.mkdir(dst, 0777) + + try: + os.mkdir(dst, 0777) + except OSError, e: + # be happy if someone already created the path + if e.errno != errno.EEXIST: + raise + def touched(dst): """Tell the finder a file has changed. No-op on MacOSX.""" Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 16:00:05 2009 @@ -235,6 +235,9 @@ - Issue #1737832 : plat-mac/EasyDialog.py no longer uses the broken aepack module. +- Issue #1149804: macostools.mkdirs now even works when another process + creates one of the needed subdirectories. + Tools/Demos ----------- From python-checkins at python.org Fri Jan 2 16:06:00 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 16:06:00 +0100 (CET) Subject: [Python-checkins] r68162 - python/trunk/Makefile.pre.in Message-ID: <20090102150600.7D0A91E401E@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 16:06:00 2009 New Revision: 68162 Log: Fix for issue 4472 is incompatible with Cygwin, this patch should fix that. Modified: python/trunk/Makefile.pre.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Fri Jan 2 16:06:00 2009 @@ -773,8 +773,8 @@ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) if test -f $(LDLIBRARY); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ From python-checkins at python.org Fri Jan 2 16:25:36 2009 From: python-checkins at python.org (ronald.oussoren) Date: Fri, 2 Jan 2009 16:25:36 +0100 (CET) Subject: [Python-checkins] r68163 - in python/trunk: Lib/plat-mac/bundlebuilder.py Misc/NEWS Message-ID: <20090102152536.73A901E402B@bag.python.org> Author: ronald.oussoren Date: Fri Jan 2 16:25:36 2009 New Revision: 68163 Log: Fix for issues #841800 and #900506 Modified: python/trunk/Lib/plat-mac/bundlebuilder.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/plat-mac/bundlebuilder.py ============================================================================== --- python/trunk/Lib/plat-mac/bundlebuilder.py (original) +++ python/trunk/Lib/plat-mac/bundlebuilder.py Fri Jan 2 16:25:36 2009 @@ -245,14 +245,14 @@ del sys.path[1:] # sys.path[0] is Contents/Resources/ """ -if USE_ZIPIMPORT: - ZIP_ARCHIVE = "Modules.zip" - SITE_PY += "sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE - def getPycData(fullname, code, ispkg): - if ispkg: - fullname += ".__init__" - path = fullname.replace(".", os.sep) + PYC_EXT - return path, MAGIC + '\0\0\0\0' + marshal.dumps(code) +ZIP_ARCHIVE = "Modules.zip" +SITE_PY_ZIP = SITE_PY + ("sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE) + +def getPycData(fullname, code, ispkg): + if ispkg: + fullname += ".__init__" + path = fullname.replace(".", os.sep) + PYC_EXT + return path, MAGIC + '\0\0\0\0' + marshal.dumps(code) # # Extension modules can't be in the modules zip archive, so a placeholder @@ -301,6 +301,9 @@ libdir = os.path.join(os.path.dirname(execdir), "Frameworks") mainprogram = os.path.join(resdir, "%(mainprogram)s") +if %(optimize)s: + sys.argv.insert(1, '-O') + sys.argv.insert(1, mainprogram) if %(standalone)s or %(semi_standalone)s: os.environ["PYTHONPATH"] = resdir @@ -311,6 +314,7 @@ if pypath: pypath = ":" + pypath os.environ["PYTHONPATH"] = resdir + pypath + os.environ["PYTHONEXECUTABLE"] = executable os.environ["DYLD_LIBRARY_PATH"] = libdir os.environ["DYLD_FRAMEWORK_PATH"] = libdir @@ -350,6 +354,8 @@ class AppBuilder(BundleBuilder): + use_zipimport = USE_ZIPIMPORT + # Override type of the bundle. type = "APPL" @@ -506,6 +512,7 @@ hashbang = os.path.realpath(sys.executable) standalone = self.standalone semi_standalone = self.semi_standalone + optimize = sys.flags.optimize open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals()) os.chmod(bootstrappath, 0775) @@ -552,13 +559,14 @@ self.files.append((src, dst)) def _getSiteCode(self): - return compile(SITE_PY % {"semi_standalone": self.semi_standalone}, + if self.use_zipimport: + return compile(SITE_PY % {"semi_standalone": self.semi_standalone}, "<-bundlebuilder.py->", "exec") def addPythonModules(self): self.message("Adding Python modules", 1) - if USE_ZIPIMPORT: + if self.use_zipimport: # Create a zip file containing all modules as pyc. import zipfile relpath = pathjoin("Contents", "Resources", ZIP_ARCHIVE) @@ -624,7 +632,7 @@ self.message("Finding module dependencies", 1) import modulefinder mf = modulefinder.ModuleFinder(excludes=self.excludeModules) - if USE_ZIPIMPORT: + if self.use_zipimport: # zipimport imports zlib, must add it manually mf.import_hook("zlib") # manually add our own site.py @@ -658,7 +666,7 @@ filename = os.path.basename(path) pathitems = name.split(".")[:-1] + [filename] dstpath = pathjoin(*pathitems) - if USE_ZIPIMPORT: + if self.use_zipimport: if name != "zlib": # neatly pack all extension modules in a subdirectory, # except zlib, since it's neccesary for bootstrapping. @@ -672,9 +680,9 @@ self.files.append((path, pathjoin("Contents", "Resources", dstpath))) if mod.__code__ is not None: ispkg = mod.__path__ is not None - if not USE_ZIPIMPORT or name != "site": + if not self.use_zipimport or name != "site": # Our site.py is doing the bootstrapping, so we must - # include a real .pyc file if USE_ZIPIMPORT is True. + # include a real .pyc file if self.use_zipimport is True. self.pymodules.append((name, mod.__code__, ispkg)) if hasattr(mf, "any_missing_maybe"): @@ -820,6 +828,7 @@ --semi-standalone build a standalone application, which depends on an installed Python, yet includes all third-party modules. + --no-zipimport Do not copy code into a zip file --python=FILE Python to use in #! line in stead of current Python --lib=FILE shared library or framework to be copied into the bundle @@ -847,7 +856,9 @@ "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "argv", "standalone", "exclude=", "include=", "package=", "strip", "iconfile=", - "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=") + "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=" + "no-zipimport" + ) try: options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) @@ -911,6 +922,8 @@ builder.strip = 1 elif opt == '--destroot': builder.destroot = arg + elif opt == '--no-zipimport': + builder.use_zipimport = False if len(args) != 1: usage("Must specify one command ('build', 'report' or 'help')") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 16:25:36 2009 @@ -238,6 +238,10 @@ - Issue #1149804: macostools.mkdirs now even works when another process creates one of the needed subdirectories. +- Issue #900506: added --no-zipimport flag to the bundlebuilder script + +- Issue #841800: bundlebuilder now works with 'python -O' + Tools/Demos ----------- From buildbot at python.org Fri Jan 2 16:35:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 15:35:46 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.x Message-ID: <20090102153546.998BD1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.x/builds/40 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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_traceback make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 2 18:01:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 2 Jan 2009 18:01:59 +0100 (CET) Subject: [Python-checkins] r68164 - in python/branches/release30-maint: Lib/idlelib/NEWS.txt Lib/idlelib/help.txt Lib/idlelib/macosxSupport.py Mac/Makefile.in Mac/PythonLauncher/Makefile.in Message-ID: <20090102170159.497491E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 2 18:01:59 2009 New Revision: 68164 Log: Merged revisions 68152,68155 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68152 | ronald.oussoren | 2009-01-02 05:48:29 -0600 (Fri, 02 Jan 2009) | 2 lines Fix for issue 3433 ................ r68155 | ronald.oussoren | 2009-01-02 07:10:34 -0600 (Fri, 02 Jan 2009) | 17 lines Recorded merge of revisions 68153 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68153 | ronald.oussoren | 2009-01-02 13:59:32 +0100 (Fri, 02 Jan 2009) | 10 lines Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk ........ ................ Modified: python/branches/release30-maint/Lib/idlelib/NEWS.txt python/branches/release30-maint/Lib/idlelib/help.txt python/branches/release30-maint/Lib/idlelib/macosxSupport.py python/branches/release30-maint/Mac/Makefile.in python/branches/release30-maint/Mac/PythonLauncher/Makefile.in Modified: python/branches/release30-maint/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/release30-maint/Lib/idlelib/NEWS.txt (original) +++ python/branches/release30-maint/Lib/idlelib/NEWS.txt Fri Jan 2 18:01:59 2009 @@ -8,6 +8,11 @@ user configuration of source encoding; all according to PEP 3120. +- Issue #3549: On MacOS the preferences menu was not present + +- Issue #2665: On Windows, an IDLE installation upgraded from an old version + would not start if a custom theme was defined. + What's New in IDLE 3.0a3? ========================= Modified: python/branches/release30-maint/Lib/idlelib/help.txt ============================================================================== --- python/branches/release30-maint/Lib/idlelib/help.txt (original) +++ python/branches/release30-maint/Lib/idlelib/help.txt Fri Jan 2 18:01:59 2009 @@ -90,7 +90,10 @@ Configure IDLE -- Open a configuration dialog. Fonts, indentation, keybindings, and color themes may be altered. Startup Preferences may be set, and Additional Help - Souces can be specified. + Sources can be specified. + + On MacOS X this menu is not present, use + menu 'IDLE -> Preferences...' instead. --- Code Context -- Open a pane at the top of the edit window which shows the block context of the section of code 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 Fri Jan 2 18:01:59 2009 @@ -89,7 +89,9 @@ ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding tkversion = root.tk.eval('info patchlevel') - if tkversion >= '8.4.14': + # Note: we cannot check if the string tkversion >= '8.4.14', because + # the string '8.4.7' is greater than the string '8.4.14'. + if tuple(map(int, tkversion.split('.'))) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, Modified: python/branches/release30-maint/Mac/Makefile.in ============================================================================== --- python/branches/release30-maint/Mac/Makefile.in (original) +++ python/branches/release30-maint/Mac/Makefile.in Fri Jan 2 18:01:59 2009 @@ -216,9 +216,9 @@ install_IDLE: test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" - sed "s!%prefix%!$(prefix)!g" < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" + 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" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" Modified: python/branches/release30-maint/Mac/PythonLauncher/Makefile.in ============================================================================== --- python/branches/release30-maint/Mac/PythonLauncher/Makefile.in (original) +++ python/branches/release30-maint/Mac/PythonLauncher/Makefile.in Fri Jan 2 18:01:59 2009 @@ -27,7 +27,7 @@ install: Python\ Launcher.app test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" From python-checkins at python.org Fri Jan 2 18:34:35 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 2 Jan 2009 18:34:35 +0100 (CET) Subject: [Python-checkins] r68165 - in python/branches/py3k: Misc/NEWS Modules/zlibmodule.c Message-ID: <20090102173435.7BFD01E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 2 18:34:35 2009 New Revision: 68165 Log: Issue #4738: finer-grained locking in the zlib module. Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/zlibmodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 2 18:34:35 2009 @@ -175,6 +175,10 @@ Extension Modules ----------------- +- Issue #4738: Each zlib object now has a separate lock, allowing to compress + or decompress several streams at once on multi-CPU systems. Also, the GIL + is now released when computing the CRC of a large buffer. Patch by ebfe. + - Issue #1040026: Fix os.times result on systems where HZ is incorrect. - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, Modified: python/branches/py3k/Modules/zlibmodule.c ============================================================================== --- python/branches/py3k/Modules/zlibmodule.c (original) +++ python/branches/py3k/Modules/zlibmodule.c Fri Jan 2 18:34:35 2009 @@ -9,38 +9,15 @@ #include "zlib.h" #ifdef WITH_THREAD -#include "pythread.h" - -/* #defs ripped off from _tkinter.c, even though the situation here is much - simpler, because we don't have to worry about waiting for Tcl - events! And, since zlib itself is threadsafe, we don't need to worry - about re-entering zlib functions. - - N.B. - - Since ENTER_ZLIB and LEAVE_ZLIB only need to be called on functions - that modify the components of preexisting de/compress objects, it - could prove to be a performance gain on multiprocessor machines if - there was an de/compress object-specific lock. However, for the - moment the ENTER_ZLIB and LEAVE_ZLIB calls are global for ALL - de/compress objects. - */ - -static PyThread_type_lock zlib_lock = NULL; /* initialized on module load */ - -#define ENTER_ZLIB \ - Py_BEGIN_ALLOW_THREADS \ - PyThread_acquire_lock(zlib_lock, 1); \ - Py_END_ALLOW_THREADS - -#define LEAVE_ZLIB \ - PyThread_release_lock(zlib_lock); - + #include "pythread.h" + #define ENTER_ZLIB(obj) \ + Py_BEGIN_ALLOW_THREADS; \ + PyThread_acquire_lock((obj)->lock, 1); \ + Py_END_ALLOW_THREADS; + #define LEAVE_ZLIB(obj) PyThread_release_lock((obj)->lock); #else - -#define ENTER_ZLIB -#define LEAVE_ZLIB - + #define ENTER_ZLIB(obj) + #define LEAVE_ZLIB(obj) #endif /* The following parameters are copied from zutil.h, version 0.95 */ @@ -67,6 +44,9 @@ PyObject *unused_data; PyObject *unconsumed_tail; int is_initialised; + #ifdef WITH_THREAD + PyThread_type_lock lock; + #endif } compobject; static void @@ -106,6 +86,9 @@ Py_DECREF(self); return NULL; } +#ifdef WITH_THREAD + self->lock = PyThread_allocate_lock(); +#endif return self; } @@ -376,23 +359,30 @@ } static void -Comp_dealloc(compobject *self) +Dealloc(compobject *self) { - if (self->is_initialised) - deflateEnd(&self->zst); +#ifdef WITH_THREAD + PyThread_free_lock(self->lock); +#endif Py_XDECREF(self->unused_data); Py_XDECREF(self->unconsumed_tail); PyObject_Del(self); } static void +Comp_dealloc(compobject *self) +{ + if (self->is_initialised) + deflateEnd(&self->zst); + Dealloc(self); +} + +static void Decomp_dealloc(compobject *self) { if (self->is_initialised) - inflateEnd(&self->zst); - Py_XDECREF(self->unused_data); - Py_XDECREF(self->unconsumed_tail); - PyObject_Del(self); + inflateEnd(&self->zst); + Dealloc(self); } PyDoc_STRVAR(comp_compress__doc__, @@ -422,7 +412,7 @@ return NULL; } - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_in = inplen; @@ -468,7 +458,7 @@ } error: - LEAVE_ZLIB + LEAVE_ZLIB(self); PyBuffer_Release(&pinput); return RetVal; } @@ -514,7 +504,7 @@ return NULL; } - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_in = inplen; @@ -600,7 +590,7 @@ } error: - LEAVE_ZLIB + LEAVE_ZLIB(self); PyBuffer_Release(&pinput); return RetVal; } @@ -633,7 +623,7 @@ if (!(RetVal = PyBytes_FromStringAndSize(NULL, length))) return NULL; - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_in = 0; @@ -693,7 +683,7 @@ } error: - LEAVE_ZLIB + LEAVE_ZLIB(self); return RetVal; } @@ -714,7 +704,7 @@ /* Copy the zstream state * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe */ - ENTER_ZLIB + ENTER_ZLIB(self); err = deflateCopy(&retval->zst, &self->zst); switch(err) { case(Z_OK): @@ -730,7 +720,6 @@ zlib_error(self->zst, err, "while copying compression object"); goto error; } - Py_INCREF(self->unused_data); Py_INCREF(self->unconsumed_tail); Py_XDECREF(retval->unused_data); @@ -741,11 +730,11 @@ /* Mark it as being initialized */ retval->is_initialised = 1; - LEAVE_ZLIB + LEAVE_ZLIB(self); return (PyObject *)retval; error: - LEAVE_ZLIB + LEAVE_ZLIB(self); Py_XDECREF(retval); return NULL; } @@ -765,7 +754,7 @@ /* Copy the zstream state * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe */ - ENTER_ZLIB + ENTER_ZLIB(self); err = inflateCopy(&retval->zst, &self->zst); switch(err) { case(Z_OK): @@ -792,11 +781,11 @@ /* Mark it as being initialized */ retval->is_initialised = 1; - LEAVE_ZLIB + LEAVE_ZLIB(self); return (PyObject *)retval; error: - LEAVE_ZLIB + LEAVE_ZLIB(self); Py_XDECREF(retval); return NULL; } @@ -826,7 +815,7 @@ return NULL; - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_out = length; @@ -873,7 +862,7 @@ error: - LEAVE_ZLIB + LEAVE_ZLIB(self); return retval; } @@ -921,12 +910,20 @@ PyZlib_adler32(PyObject *self, PyObject *args) { unsigned int adler32val = 1; /* adler32(0L, Z_NULL, 0) */ - Byte *buf; - int len; + Py_buffer pbuf; - if (!PyArg_ParseTuple(args, "s#|I:adler32", &buf, &len, &adler32val)) + if (!PyArg_ParseTuple(args, "s*|I:adler32", &pbuf, &adler32val)) return NULL; - adler32val = adler32(adler32val, buf, len); + /* Releasing the GIL for very small buffers is inefficient + and may lower performance */ + if (pbuf.len > 1024*5) { + Py_BEGIN_ALLOW_THREADS + adler32val = adler32(adler32val, pbuf.buf, pbuf.len); + Py_END_ALLOW_THREADS + } else { + adler32val = adler32(adler32val, pbuf.buf, pbuf.len); + } + PyBuffer_Release(&pbuf); return PyLong_FromUnsignedLong(adler32val & 0xffffffffU); } @@ -945,7 +942,15 @@ if (!PyArg_ParseTuple(args, "s*|I:crc32", &pbuf, &crc32val)) return NULL; - signed_val = crc32(crc32val, pbuf.buf, pbuf.len); + /* Releasing the GIL for very small buffers is inefficient + and may lower performance */ + if (pbuf.len > 1024*5) { + Py_BEGIN_ALLOW_THREADS + signed_val = crc32(crc32val, pbuf.buf, pbuf.len); + Py_END_ALLOW_THREADS + } else { + signed_val = crc32(crc32val, pbuf.buf, pbuf.len); + } PyBuffer_Release(&pbuf); return PyLong_FromUnsignedLong(signed_val & 0xffffffffU); } @@ -1096,8 +1101,5 @@ PyModule_AddStringConstant(m, "__version__", "1.0"); -#ifdef WITH_THREAD - zlib_lock = PyThread_allocate_lock(); -#endif /* WITH_THREAD */ return m; } From buildbot at python.org Fri Jan 2 18:55:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 17:55:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090102175554.355451E4002@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/20 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: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 2 19:26:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 2 Jan 2009 19:26:23 +0100 (CET) Subject: [Python-checkins] r68166 - python/trunk/Doc/c-api/structures.rst Message-ID: <20090102182623.564E91E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 2 19:26:23 2009 New Revision: 68166 Log: document PyMemberDef Modified: python/trunk/Doc/c-api/structures.rst Modified: python/trunk/Doc/c-api/structures.rst ============================================================================== --- python/trunk/Doc/c-api/structures.rst (original) +++ python/trunk/Doc/c-api/structures.rst Fri Jan 2 19:26:23 2009 @@ -205,6 +205,69 @@ .. versionadded:: 2.4 +.. ctype:: PyMemberDef + + Structure which describes an attribute of a type which corresponds to a C + struct member. It's fields are: + + +------------------+-------------+-------------------------------+ + | Field | C Type | Meaning | + +==================+=============+===============================+ + | :attr:`name` | char \* | name of the member | + +------------------+-------------+-------------------------------+ + | :attr:`type` | int | the type of the member in the | + | | | C struct | + +------------------+-------------+-------------------------------+ + | :attr:`offset` | Py_ssize_t | the offset in bytes that the | + | | | member is located on the | + | | | type's object struct | + +------------------+-------------+-------------------------------+ + | :attr:`flags` | int | flag bits indicating if the | + | | | field should be read-only or | + | | | writable | + +------------------+-------------+-------------------------------+ + | :attr:`doc` | char \* | points to the contents of the | + | | | docstring | + +------------------+-------------+-------------------------------+ + + :attr:`type` can be one of many ``T_`` macros corresponding to various C + types. When the member is accessed in Python, it will be converted to the + equivalent Python type. + + =============== ================== + Macro name C type + =============== ================== + T_SHORT short + T_INT int + T_LONG long + T_FLOAT float + T_DOUBLE double + T_STRING char \* + T_OBJECT PyObject \* + T_OBJECT_EX PyObject \* + T_CHAR char + T_BYTE char + T_UNBYTE unsigned char + T_UINT unsigned int + T_USHORT unsigned short + T_ULONG unsigned long + T_BOOL char + T_LONGLONG long long + T_ULONGLONG unsigned long long + T_PYSSIZET Py_ssize_t + =============== ================== + + :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that + :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and + :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. + + :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for + read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` can be + deleted. (They are set to *NULL*). + + + .. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name) Return a bound method object for an extension type implemented in C. This can From buildbot at python.org Fri Jan 2 19:36:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 18:36:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090102183611.ABD651E4002@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/49 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 2 19:36:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 18:36:51 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20090102183652.023601E4039@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/19 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 2 19:53:05 2009 From: python-checkins at python.org (vinay.sajip) Date: Fri, 2 Jan 2009 19:53:05 +0100 (CET) Subject: [Python-checkins] r68167 - python/trunk/Doc/library/logging.rst Message-ID: <20090102185305.01BCE1E4002@bag.python.org> Author: vinay.sajip Date: Fri Jan 2 19:53:04 2009 New Revision: 68167 Log: Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Fri Jan 2 19:53:04 2009 @@ -1559,8 +1559,6 @@ StreamHandler ^^^^^^^^^^^^^ -.. module:: logging.handlers - The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -1616,11 +1614,32 @@ Outputs the record to the file. +NullHandler +^^^^^^^^^^^ + +.. versionadded:: 2.7 + +The :class:`NullHandler` class, located in the core :mod:`logging` package, +does not do any formatting or output. It is essentially a "no-op" handler +for use by library developers. + + +.. class:: NullHandler() + + Returns a new instance of the :class:`NullHandler` class. + + + .. method:: emit(record) + + This method does nothing. + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ .. versionadded:: 2.6 +.. module:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. @@ -2304,12 +2323,12 @@ .. function:: fileConfig(fname[, defaults]) - Reads the logging configuration from a ConfigParser-format file named *fname*. - This function can be called several times from an application, allowing an end - user the ability to select from various pre-canned configurations (if the - developer provides a mechanism to present the choices and load the chosen - configuration). Defaults to be passed to ConfigParser can be specified in the - *defaults* argument. + Reads the logging configuration from a :mod:`ConfigParser`\-format file named + *fname*. This function can be called several times from an application, + allowing an end user the ability to select from various pre-canned + configurations (if the developer provides a mechanism to present the choices + and load the chosen configuration). Defaults to be passed to the ConfigParser + can be specified in the *defaults* argument. .. function:: listen([port]) @@ -2340,17 +2359,17 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^ The configuration file format understood by :func:`fileConfig` is based on -ConfigParser functionality. The file must contain sections called ``[loggers]``, -``[handlers]`` and ``[formatters]`` which identify by name the entities of each -type which are defined in the file. For each such entity, there is a separate -section which identified how that entity is configured. Thus, for a logger named -``log01`` in the ``[loggers]`` section, the relevant configuration details are -held in a section ``[logger_log01]``. Similarly, a handler called ``hand01`` in -the ``[handlers]`` section will have its configuration held in a section called -``[handler_hand01]``, while a formatter called ``form01`` in the -``[formatters]`` section will have its configuration specified in a section -called ``[formatter_form01]``. The root logger configuration must be specified -in a section called ``[logger_root]``. +:mod:`ConfigParser` functionality. The file must contain sections called +``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the +entities of each type which are defined in the file. For each such entity, +there is a separate section which identifies how that entity is configured. +Thus, for a logger named ``log01`` in the ``[loggers]`` section, the relevant +configuration details are held in a section ``[logger_log01]``. Similarly, a +handler called ``hand01`` in the ``[handlers]`` section will have its +configuration held in a section called ``[handler_hand01]``, while a formatter +called ``form01`` in the ``[formatters]`` section will have its configuration +specified in a section called ``[formatter_form01]``. The root logger +configuration must be specified in a section called ``[logger_root]``. Examples of these sections in the file are given below. :: From python-checkins at python.org Fri Jan 2 19:53:46 2009 From: python-checkins at python.org (vinay.sajip) Date: Fri, 2 Jan 2009 19:53:46 +0100 (CET) Subject: [Python-checkins] r68168 - python/branches/py3k/Doc/library/logging.rst Message-ID: <20090102185346.0AA5F1E4002@bag.python.org> Author: vinay.sajip Date: Fri Jan 2 19:53:45 2009 New Revision: 68168 Log: Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. Modified: python/branches/py3k/Doc/library/logging.rst Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Fri Jan 2 19:53:45 2009 @@ -1534,8 +1534,6 @@ StreamHandler ^^^^^^^^^^^^^ -.. module:: logging.handlers - The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -1591,9 +1589,30 @@ Outputs the record to the file. +NullHandler +^^^^^^^^^^^ + +.. versionadded:: 3.1 + +The :class:`NullHandler` class, located in the core :mod:`logging` package, +does not do any formatting or output. It is essentially a "no-op" handler +for use by library developers. + + +.. class:: NullHandler() + + Returns a new instance of the :class:`NullHandler` class. + + + .. method:: emit(record) + + This method does nothing. + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. @@ -2306,7 +2325,7 @@ sections called ``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the entities of each type which are defined in the file. For each such entity, there is a separate section which -identified how that entity is configured. Thus, for a logger named +identifies how that entity is configured. Thus, for a logger named ``log01`` in the ``[loggers]`` section, the relevant configuration details are held in a section ``[logger_log01]``. Similarly, a handler called ``hand01`` in the ``[handlers]`` section will have its From python-checkins at python.org Fri Jan 2 20:20:26 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 2 Jan 2009 20:20:26 +0100 (CET) Subject: [Python-checkins] r68169 - in python/branches/py3k: Objects/moduleobject.c PC/example_nt/example.c Message-ID: <20090102192026.8B0CA1E4043@bag.python.org> Author: georg.brandl Date: Fri Jan 2 20:20:26 2009 New Revision: 68169 Log: Remove traces of Py_InitModule*. Modified: python/branches/py3k/Objects/moduleobject.c python/branches/py3k/PC/example_nt/example.c Modified: python/branches/py3k/Objects/moduleobject.c ============================================================================== --- python/branches/py3k/Objects/moduleobject.c (original) +++ python/branches/py3k/Objects/moduleobject.c Fri Jan 2 20:20:26 2009 @@ -91,9 +91,9 @@ This is a bit of a hack: when the shared library is loaded, the module name is "package.module", but the module calls - Py_InitModule*() with just "module" for the name. The shared + PyModule_Create*() with just "module" for the name. The shared library loader squirrels away the true name of the module in - _Py_PackageContext, and Py_InitModule*() will substitute this + _Py_PackageContext, and PyModule_Create*() will substitute this (if the name actually matches). */ if (_Py_PackageContext != NULL) { Modified: python/branches/py3k/PC/example_nt/example.c ============================================================================== --- python/branches/py3k/PC/example_nt/example.c (original) +++ python/branches/py3k/PC/example_nt/example.c Fri Jan 2 20:20:26 2009 @@ -13,8 +13,20 @@ {NULL, NULL} }; +static struct PyModuleDef examplemodule = { + PyModuleDef_HEAD_INIT, + "example", + "example module doc string", + -1, + example_methods, + NULL, + NULL, + NULL, + NULL +}; + PyMODINIT_FUNC -initexample(void) +PyInit_example(void) { - Py_InitModule("example", example_methods); + return PyModule_Create(&examplemodule); } From python-checkins at python.org Fri Jan 2 21:10:06 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 2 Jan 2009 21:10:06 +0100 (CET) Subject: [Python-checkins] r68170 - python/branches/py3k/Doc/library/threading.rst Message-ID: <20090102201006.196B81E4002@bag.python.org> Author: georg.brandl Date: Fri Jan 2 21:10:05 2009 New Revision: 68170 Log: #4808: move old API below new API doc. Modified: python/branches/py3k/Doc/library/threading.rst Modified: python/branches/py3k/Doc/library/threading.rst ============================================================================== --- python/branches/py3k/Doc/library/threading.rst (original) +++ python/branches/py3k/Doc/library/threading.rst Fri Jan 2 21:10:05 2009 @@ -278,12 +278,6 @@ raises the same exception. -.. method:: Thread.getName() - Thread.setName() - - Old API for :attr:`~Thread.name`. - - .. attribute:: Thread.name A string used for identification purposes only. It has no semantics. @@ -291,6 +285,13 @@ constructor. +.. method:: Thread.getName() + Thread.setName() + + Old getter/setter API for :attr:`~Thread.name`; use it directly as a property + instead. + + .. attribute:: Thread.ident The 'thread identifier' of this thread or ``None`` if the thread has not been @@ -309,12 +310,6 @@ returns a list of all alive threads. -.. method:: Thread.isDaemon() - Thread.setDaemon() - - Old API for :attr:`~Thread.daemon`. - - .. attribute:: Thread.daemon The thread's daemon flag. This must be set before :meth:`start` is called, @@ -325,6 +320,13 @@ The entire Python program exits when no alive non-daemon threads are left. +.. method:: Thread.isDaemon() + Thread.setDaemon() + + Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a + property instead. + + .. _lock-objects: Lock Objects From python-checkins at python.org Fri Jan 2 21:25:14 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 2 Jan 2009 21:25:14 +0100 (CET) Subject: [Python-checkins] r68171 - in python/trunk/Doc: ACKS.txt c-api/arg.rst distutils/apiref.rst howto/functional.rst howto/urllib2.rst install/index.rst library/cookielib.rst library/email.mime.rst library/gzip.rst library/json.rst library/multiprocessing.rst library/numbers.rst library/parser.rst library/smtplib.rst library/urlparse.rst tutorial/inputoutput.rst using/cmdline.rst whatsnew/2.4.rst whatsnew/2.5.rst Message-ID: <20090102202514.91AD31E4002@bag.python.org> Author: georg.brandl Date: Fri Jan 2 21:25:14 2009 New Revision: 68171 Log: #4811: fix markup glitches (mostly remains of the conversion), found by Gabriel Genellina. Modified: python/trunk/Doc/ACKS.txt python/trunk/Doc/c-api/arg.rst python/trunk/Doc/distutils/apiref.rst python/trunk/Doc/howto/functional.rst python/trunk/Doc/howto/urllib2.rst python/trunk/Doc/install/index.rst python/trunk/Doc/library/cookielib.rst python/trunk/Doc/library/email.mime.rst python/trunk/Doc/library/gzip.rst python/trunk/Doc/library/json.rst python/trunk/Doc/library/multiprocessing.rst python/trunk/Doc/library/numbers.rst python/trunk/Doc/library/parser.rst python/trunk/Doc/library/smtplib.rst python/trunk/Doc/library/urlparse.rst python/trunk/Doc/tutorial/inputoutput.rst python/trunk/Doc/using/cmdline.rst python/trunk/Doc/whatsnew/2.4.rst python/trunk/Doc/whatsnew/2.5.rst Modified: python/trunk/Doc/ACKS.txt ============================================================================== --- python/trunk/Doc/ACKS.txt (original) +++ python/trunk/Doc/ACKS.txt Fri Jan 2 21:25:14 2009 @@ -60,6 +60,7 @@ * Peter Funk * Lele Gaifax * Matthew Gallagher + * Gabriel Genellina * Ben Gertzfield * Nadim Ghaznavi * Jonathan Giddy Modified: python/trunk/Doc/c-api/arg.rst ============================================================================== --- python/trunk/Doc/c-api/arg.rst (original) +++ python/trunk/Doc/c-api/arg.rst Fri Jan 2 21:25:14 2009 @@ -46,12 +46,12 @@ :ctype:`Py_ssize_t` rather than an int. ``s*`` (string, Unicode, or any buffer compatible object) [Py_buffer \*] - Similar to ``s#``, this code fills a Py_buffer structure provided by the caller. - The buffer gets locked, so that the caller can subsequently use the buffer even - inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling - ``PyBuffer_Release`` with the structure after it has processed the data. + Similar to ``s#``, this code fills a Py_buffer structure provided by the caller. + The buffer gets locked, so that the caller can subsequently use the buffer even + inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling + ``PyBuffer_Release`` with the structure after it has processed the data. - .. versionadded:: 2.6 + .. versionadded:: 2.6 ``z`` (string or ``None``) [const char \*] Like ``s``, but the Python object may also be ``None``, in which case the C @@ -63,7 +63,7 @@ ``z*`` (string or ``None`` or any buffer compatible object) [Py_buffer*] This is to ``s*`` as ``z`` is to ``s``. - .. versionadded:: 2.6 + .. versionadded:: 2.6 ``u`` (Unicode object) [Py_UNICODE \*] Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of @@ -261,6 +261,7 @@ ``w*`` (read-write byte-oriented buffer) [Py_buffer \*] This is to ``w`` what ``s*`` is to ``s``. + .. versionadded:: 2.6 ``(items)`` (tuple) [*matching-items*] Modified: python/trunk/Doc/distutils/apiref.rst ============================================================================== --- python/trunk/Doc/distutils/apiref.rst (original) +++ python/trunk/Doc/distutils/apiref.rst Fri Jan 2 21:25:14 2009 @@ -188,9 +188,10 @@ | | for C/C++ header files (in | | | | Unix form for portability) | | +------------------------+--------------------------------+---------------------------+ - | *define_macros* | list of macros to define; each | (string,string) tuple or | - | | macro is defined using a | (name,``None``) | - | | 2-tuple, where 'value' is | | + | *define_macros* | list of macros to define; each | (string, string) tuple or | + | | macro is defined using a | (name, ``None``) | + | | 2-tuple ``(name, value)``, | | + | | where *value* is | | | | either the string to define it | | | | to or ``None`` to define it | | | | without a particular value | | Modified: python/trunk/Doc/howto/functional.rst ============================================================================== --- python/trunk/Doc/howto/functional.rst (original) +++ python/trunk/Doc/howto/functional.rst Fri Jan 2 21:25:14 2009 @@ -585,7 +585,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration Modified: python/trunk/Doc/howto/urllib2.rst ============================================================================== --- python/trunk/Doc/howto/urllib2.rst (original) +++ python/trunk/Doc/howto/urllib2.rst Fri Jan 2 21:25:14 2009 @@ -470,7 +470,7 @@ password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. - # If we knew the realm, we could use it instead of ``None``. + # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) Modified: python/trunk/Doc/install/index.rst ============================================================================== --- python/trunk/Doc/install/index.rst (original) +++ python/trunk/Doc/install/index.rst Fri Jan 2 21:25:14 2009 @@ -587,7 +587,7 @@ $ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 - Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. + Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', Modified: python/trunk/Doc/library/cookielib.rst ============================================================================== --- python/trunk/Doc/library/cookielib.rst (original) +++ python/trunk/Doc/library/cookielib.rst Fri Jan 2 21:25:14 2009 @@ -733,7 +733,7 @@ The :class:`Cookie` class also defines the following method: -.. method:: Cookie.is_expired([now=:const:`None`]) +.. method:: Cookie.is_expired([now=None]) True if cookie has passed the time at which the server requested it should expire. If *now* is given (in seconds since the epoch), return whether the Modified: python/trunk/Doc/library/email.mime.rst ============================================================================== --- python/trunk/Doc/library/email.mime.rst (original) +++ python/trunk/Doc/library/email.mime.rst Fri Jan 2 21:25:14 2009 @@ -57,14 +57,14 @@ .. currentmodule:: email.mime.multipart -.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) +.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A - :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be + :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added. Modified: python/trunk/Doc/library/gzip.rst ============================================================================== --- python/trunk/Doc/library/gzip.rst (original) +++ python/trunk/Doc/library/gzip.rst Fri Jan 2 21:25:14 2009 @@ -7,7 +7,7 @@ This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would. -The data compression is provided by the :mod:``zlib`` module. +The data compression is provided by the :mod:`zlib` module. The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled after Python's File Object. The :class:`GzipFile` class reads and writes Modified: python/trunk/Doc/library/json.rst ============================================================================== --- python/trunk/Doc/library/json.rst (original) +++ python/trunk/Doc/library/json.rst Fri Jan 2 21:25:14 2009 @@ -152,7 +152,7 @@ *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. - To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the + To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the *cls* kwarg. Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Fri Jan 2 21:25:14 2009 @@ -1138,18 +1138,18 @@ Returns a :class:`Server` object which represents the actual server under the control of the Manager. The :class:`Server` object supports the - :meth:`serve_forever` method:: + :meth:`serve_forever` method: - >>> from multiprocessing.managers import BaseManager - >>> m = BaseManager(address=('', 50000), authkey='abc')) - >>> server = m.get_server() - >>> s.serve_forever() + >>> from multiprocessing.managers import BaseManager + >>> m = BaseManager(address=('', 50000), authkey='abc')) + >>> server = m.get_server() + >>> s.serve_forever() - :class:`Server` additionally have an :attr:`address` attribute. + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - Connect a local manager object to a remote manager process:: + Connect a local manager object to a remote manager process: >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) @@ -1295,7 +1295,7 @@ >>>>>>>>>>>>>>>>>>> To create one's own manager, one creates a subclass of :class:`BaseManager` and -use the :meth:`~BaseManager.resgister` classmethod to register new types or +use the :meth:`~BaseManager.register` classmethod to register new types or callables with the manager class. For example:: from multiprocessing.managers import BaseManager @@ -1811,7 +1811,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named - pipe on a remote computer called ServerName* one should use an address of the + pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be Modified: python/trunk/Doc/library/numbers.rst ============================================================================== --- python/trunk/Doc/library/numbers.rst (original) +++ python/trunk/Doc/library/numbers.rst Fri Jan 2 21:25:14 2009 @@ -51,14 +51,14 @@ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``. - Real also provides defaults for :func:`complex`, :attr:`Complex.real`, - :attr:`Complex.imag`, and :meth:`Complex.conjugate`. + Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, + :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. .. class:: Rational Subtypes :class:`Real` and adds - :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which + :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which should be in lowest terms. With these, it provides a default for :func:`float`. @@ -74,8 +74,8 @@ .. class:: Integral Subtypes :class:`Rational` and adds a conversion to :class:`int`. - Provides defaults for :func:`float`, :attr:`Rational.numerator`, and - :attr:`Rational.denominator`, and bit-string operations: ``<<``, + Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and + :attr:`~Rational.denominator`, and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``. @@ -171,7 +171,7 @@ knowledge of ``A``, so it can handle those instances before delegating to :class:`Complex`. -If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, +If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``. Modified: python/trunk/Doc/library/parser.rst ============================================================================== --- python/trunk/Doc/library/parser.rst (original) +++ python/trunk/Doc/library/parser.rst Fri Jan 2 21:25:14 2009 @@ -641,7 +641,7 @@ while the long form uses an indented block and allows nested definitions:: def make_power(exp): - "Make a function that raises an argument to the exponent `exp'." + "Make a function that raises an argument to the exponent `exp`." def raiser(x, y=exp): return x ** y return raiser Modified: python/trunk/Doc/library/smtplib.rst ============================================================================== --- python/trunk/Doc/library/smtplib.rst (original) +++ python/trunk/Doc/library/smtplib.rst Fri Jan 2 21:25:14 2009 @@ -207,7 +207,7 @@ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. - :exc:SMTPHeloError + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. .. versionadded:: 2.6 Modified: python/trunk/Doc/library/urlparse.rst ============================================================================== --- python/trunk/Doc/library/urlparse.rst (original) +++ python/trunk/Doc/library/urlparse.rst Fri Jan 2 21:25:14 2009 @@ -290,7 +290,7 @@ .. versionadded:: 2.5 -The following classes provide the implementations of the parse results:: +The following classes provide the implementations of the parse results: .. class:: BaseResult Modified: python/trunk/Doc/tutorial/inputoutput.rst ============================================================================== --- python/trunk/Doc/tutorial/inputoutput.rst (original) +++ python/trunk/Doc/tutorial/inputoutput.rst Fri Jan 2 21:25:14 2009 @@ -148,7 +148,7 @@ ... other='Georg') The story of Bill, Manfred, and Georg. -An optional ``':``` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This also greater control over how the value is formatted. The following example truncates the Pi to three places after the decimal. Modified: python/trunk/Doc/using/cmdline.rst ============================================================================== --- python/trunk/Doc/using/cmdline.rst (original) +++ python/trunk/Doc/using/cmdline.rst Fri Jan 2 21:25:14 2009 @@ -404,7 +404,7 @@ compiled form). Extension modules cannot be imported from zipfiles. The default search path is installation dependent, but generally begins with - :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It + :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. An additional directory will be inserted in the search path in front of Modified: python/trunk/Doc/whatsnew/2.4.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.4.rst (original) +++ python/trunk/Doc/whatsnew/2.4.rst Fri Jan 2 21:25:14 2009 @@ -1428,7 +1428,7 @@ you get the following output:: ********************************************************************** - File ``t.py'', line 15, in g + File "t.py", line 15, in g Failed example: g(4) Differences (unified diff with -expected +actual): Modified: python/trunk/Doc/whatsnew/2.5.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.5.rst (original) +++ python/trunk/Doc/whatsnew/2.5.rst Fri Jan 2 21:25:14 2009 @@ -485,7 +485,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration From python-checkins at python.org Fri Jan 2 21:32:55 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 2 Jan 2009 21:32:55 +0100 (CET) Subject: [Python-checkins] r68172 - in python/trunk: Misc/NEWS Python/pythonrun.c Message-ID: <20090102203255.D76961E4002@bag.python.org> Author: martin.v.loewis Date: Fri Jan 2 21:32:55 2009 New Revision: 68172 Log: Issue #4075: Use OutputDebugStringW in Py_FatalError. Modified: python/trunk/Misc/NEWS python/trunk/Python/pythonrun.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 21:32:55 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4075: Use OutputDebugStringW in Py_FatalError. + - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. Modified: python/trunk/Python/pythonrun.c ============================================================================== --- python/trunk/Python/pythonrun.c (original) +++ python/trunk/Python/pythonrun.c Fri Jan 2 21:32:55 2009 @@ -22,6 +22,8 @@ #include #endif +#include "malloc.h" /* for alloca */ + #ifdef HAVE_LANGINFO_H #include #include @@ -1628,9 +1630,21 @@ { fprintf(stderr, "Fatal Python error: %s\n", msg); #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif From python-checkins at python.org Fri Jan 2 21:40:15 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 2 Jan 2009 21:40:15 +0100 (CET) Subject: [Python-checkins] r68173 - in python/trunk: Misc/NEWS Modules/cPickle.c Message-ID: <20090102204015.030C91E4002@bag.python.org> Author: martin.v.loewis Date: Fri Jan 2 21:40:14 2009 New Revision: 68173 Log: Issue #4051: Prevent conflict of UNICODE macros in cPickle. Modified: python/trunk/Misc/NEWS python/trunk/Modules/cPickle.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 2 21:40:14 2009 @@ -286,6 +286,8 @@ Extension Modules ----------------- +- Issue #4051: Prevent conflict of UNICODE macros in cPickle. + - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. - Issue #1040026: Fix os.times result on systems where HZ is incorrect. Modified: python/trunk/Modules/cPickle.c ============================================================================== --- python/trunk/Modules/cPickle.c (original) +++ python/trunk/Modules/cPickle.c Fri Jan 2 21:40:14 2009 @@ -18,6 +18,14 @@ #define HIGHEST_PROTOCOL 2 /* + * Note: The UNICODE macro controls the TCHAR meaning of the win32 API. Since + * all headers have already been included here, we can safely redefine it. + */ +#ifdef UNICODE +# undef UNICODE +#endif + +/* * Pickle opcodes. These must be kept in synch with pickle.py. Extensive * docs are in pickletools.py. */ From python-checkins at python.org Fri Jan 2 21:47:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 2 Jan 2009 21:47:27 +0100 (CET) Subject: [Python-checkins] r68174 - python/trunk/Python/pythonrun.c Message-ID: <20090102204727.CC34F1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 2 21:47:27 2009 New Revision: 68174 Log: fix compilation on non-Windows platforms Modified: python/trunk/Python/pythonrun.c Modified: python/trunk/Python/pythonrun.c ============================================================================== --- python/trunk/Python/pythonrun.c (original) +++ python/trunk/Python/pythonrun.c Fri Jan 2 21:47:27 2009 @@ -22,7 +22,9 @@ #include #endif +#ifdef MS_WINDOWS #include "malloc.h" /* for alloca */ +#endif #ifdef HAVE_LANGINFO_H #include From python-checkins at python.org Fri Jan 2 21:47:49 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 2 Jan 2009 21:47:49 +0100 (CET) Subject: [Python-checkins] r68175 - in python/branches/py3k: Misc/NEWS Python/pythonrun.c Message-ID: <20090102204749.078BD1E4002@bag.python.org> Author: martin.v.loewis Date: Fri Jan 2 21:47:48 2009 New Revision: 68175 Log: Merged revisions 68172-68173 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68172 | martin.v.loewis | 2009-01-02 21:32:55 +0100 (Fr, 02 Jan 2009) | 2 lines Issue #4075: Use OutputDebugStringW in Py_FatalError. ........ r68173 | martin.v.loewis | 2009-01-02 21:40:14 +0100 (Fr, 02 Jan 2009) | 2 lines Issue #4051: Prevent conflict of UNICODE macros in cPickle. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Python/pythonrun.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 2 21:47:48 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4075: Use OutputDebugStringW in Py_FatalError. + - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. @@ -175,6 +177,8 @@ Extension Modules ----------------- +- Issue #4051: Prevent conflict of UNICODE macros in cPickle. + - Issue #4738: Each zlib object now has a separate lock, allowing to compress or decompress several streams at once on multi-CPU systems. Also, the GIL is now released when computing the CRC of a large buffer. Patch by ebfe. Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Fri Jan 2 21:47:48 2009 @@ -23,6 +23,8 @@ #include #endif +#include "malloc.h" /* for alloca */ + #ifdef HAVE_LANGINFO_H #include #include @@ -1918,9 +1920,21 @@ PyErr_Print(); } #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif From python-checkins at python.org Fri Jan 2 22:00:36 2009 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 2 Jan 2009 22:00:36 +0100 (CET) Subject: [Python-checkins] r68176 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090102210036.09BF81E402D@bag.python.org> Author: andrew.kuchling Date: Fri Jan 2 22:00:35 2009 New Revision: 68176 Log: Add various items Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Fri Jan 2 22:00:35 2009 @@ -103,7 +103,23 @@ :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. -* To be written. +* 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 + error, or raises a :exc:`CalledProcessError` exception otherwise. + + :: + + >>> subprocess.check_output(['df', '-h', '.']) + 'Filesystem Size Used Avail Capacity Mounted on\n + /dev/disk0s2 52G 49G 3.0G 94% /\n' + + >>> subprocess.check_output(['df', '-h', '/bogus']) + ... + subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1 + + (Contributed by Gregory P. Smith.) + .. ====================================================================== .. whole new modules get described in subsections here @@ -116,13 +132,22 @@ Changes to Python's build process and to the C API include: -* To be written. +* 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`.) .. ====================================================================== Port-Specific Changes: Windows ----------------------------------- +* The :mod:`msvcrt` module now contains some constants from + the :file:`crtassem.h` header file: + :data:`CRT_ASSEMBLY_VERSION`, + :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`, + and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. + (Added by Martin von Loewis (XXX check); :issue:`4365`.) .. ====================================================================== From nnorwitz at gmail.com Fri Jan 2 22:15:56 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 2 Jan 2009 16:15:56 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (2) Message-ID: <20090102211556.GA31381@python.psfb.org> 327 tests OK. 2 tests failed: test_fork1 test_ftplib 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 test_fork1 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/fork_wait.py", line 55, in test_wait self.assertEquals(a, range(NUM_THREADS)) AssertionError: [] != [0, 1, 2, 3] test_format test_fpformat test_fractions test_frozen test_ftplib test test_ftplib failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_ftplib.py", line 234, in setUp self.client.connect(self.server.host, self.server.port) File "/tmp/python-test/local/lib/python2.7/ftplib.py", line 134, in connect self.welcome = self.getresp() File "/tmp/python-test/local/lib/python2.7/ftplib.py", line 209, in getresp resp = self.getmultiline() File "/tmp/python-test/local/lib/python2.7/ftplib.py", line 195, in getmultiline line = self.getline() File "/tmp/python-test/local/lib/python2.7/ftplib.py", line 182, in getline line = self.file.readline() File "/tmp/python-test/local/lib/python2.7/socket.py", line 404, in readline data = self._sock.recv(self._rbufsize) timeout: timed out 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 Unhandled exception in thread started by > Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/fork_wait.py", line 29, in f self.alive[id] = os.getpid() AttributeError: 'NoneType' object has no attribute 'getpid' Unhandled exception in thread started by > Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/fork_wait.py", line 29, in f self.alive[id] = os.getpid() AttributeError: 'NoneType' object has no attribute 'getpid' Unhandled exception in thread started by > Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/fork_wait.py", line 29, in f self.alive[id] = os.getpid() AttributeError: 'NoneType' object has no attribute 'getpid' Unhandled exception in thread started by > Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/fork_wait.py", line 29, in f self.alive[id] = os.getpid() AttributeError: 'NoneType' object has no attribute 'getpid' 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 327 tests OK. 2 tests failed: test_fork1 test_ftplib 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [655167 refs] From python-checkins at python.org Fri Jan 2 22:20:39 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 2 Jan 2009 22:20:39 +0100 (CET) Subject: [Python-checkins] r68177 - in python/branches/release26-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090102212039.4D12F1E402C@bag.python.org> Author: raymond.hettinger Date: Fri Jan 2 22:20:38 2009 New Revision: 68177 Log: Issue #4615. Document how to use itertools for de-duping. Modified: python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Lib/test/test_itertools.py 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 Fri Jan 2 22:20:38 2009 @@ -687,3 +687,27 @@ return 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 imap(next, imap(itemgetter(1), groupby(iterable, key))) 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 Fri Jan 2 22:20:38 2009 @@ -1277,6 +1277,30 @@ ... 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 imap(next, imap(itemgetter(1), groupby(iterable, key))) + This is not part of the examples but it tests to make sure the definitions perform as purported. @@ -1339,6 +1363,18 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(unique_everseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D'] + +>>> list(unique_everseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'D'] + +>>> list(unique_justseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D', 'A', 'B'] + +>>> list(unique_justseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'A', 'D'] + """ __test__ = {'libreftest' : libreftest} From python-checkins at python.org Fri Jan 2 22:24:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 2 Jan 2009 22:24:04 +0100 (CET) Subject: [Python-checkins] r68178 - in python/branches/py3k: Python/pythonrun.c Message-ID: <20090102212404.9BC741E402B@bag.python.org> Author: benjamin.peterson Date: Fri Jan 2 22:24:04 2009 New Revision: 68178 Log: Merged revisions 68174 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68174 | benjamin.peterson | 2009-01-02 14:47:27 -0600 (Fri, 02 Jan 2009) | 1 line fix compilation on non-Windows platforms ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Python/pythonrun.c Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Fri Jan 2 22:24:04 2009 @@ -23,7 +23,9 @@ #include #endif +#ifdef MS_WINDOWS #include "malloc.h" /* for alloca */ +#endif #ifdef HAVE_LANGINFO_H #include From python-checkins at python.org Fri Jan 2 22:26:45 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 2 Jan 2009 22:26:45 +0100 (CET) Subject: [Python-checkins] r68179 - in python/trunk: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090102212645.AA4B11E4002@bag.python.org> Author: raymond.hettinger Date: Fri Jan 2 22:26:45 2009 New Revision: 68179 Log: Issue #4615. Document how to use itertools for de-duping. Modified: python/trunk/Doc/library/itertools.rst python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Fri Jan 2 22:26:45 2009 @@ -687,3 +687,27 @@ return 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 imap(next, imap(itemgetter(1), groupby(iterable, key))) Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Fri Jan 2 22:26:45 2009 @@ -1277,6 +1277,30 @@ ... 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 imap(next, imap(itemgetter(1), groupby(iterable, key))) + This is not part of the examples but it tests to make sure the definitions perform as purported. @@ -1339,6 +1363,18 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(unique_everseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D'] + +>>> list(unique_everseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'D'] + +>>> list(unique_justseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D', 'A', 'B'] + +>>> list(unique_justseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'A', 'D'] + """ __test__ = {'libreftest' : libreftest} From nnorwitz at gmail.com Fri Jan 2 22:27:10 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 2 Jan 2009 16:27:10 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090102212710.GA374@python.psfb.org> 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_urllib2 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known 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 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [654440 refs] From python-checkins at python.org Fri Jan 2 22:30:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 2 Jan 2009 22:30:35 +0100 (CET) Subject: [Python-checkins] r68180 - in python/branches/release30-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090102213035.D9EC31E4002@bag.python.org> Author: raymond.hettinger Date: Fri Jan 2 22:30:35 2009 New Revision: 68180 Log: Issue #4615. Document how to use itertools for de-duping. Modified: python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Lib/test/test_itertools.py 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 Fri Jan 2 22:30:35 2009 @@ -606,3 +606,27 @@ return 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))) 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 Fri Jan 2 22:30:35 2009 @@ -1298,6 +1298,30 @@ ... 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))) + This is not part of the examples but it tests to make sure the definitions perform as purported. @@ -1360,6 +1384,18 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(unique_everseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D'] + +>>> list(unique_everseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'D'] + +>>> list(unique_justseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D', 'A', 'B'] + +>>> list(unique_justseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'A', 'D'] + """ __test__ = {'libreftest' : libreftest} From buildbot at python.org Fri Jan 2 22:32:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 21:32:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090102213236.BCF2B1E4002@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/51 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,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 2 22:39:08 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 2 Jan 2009 22:39:08 +0100 (CET) Subject: [Python-checkins] r68181 - in python/branches/py3k: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090102213908.10A601E4002@bag.python.org> Author: raymond.hettinger Date: Fri Jan 2 22:39:07 2009 New Revision: 68181 Log: Issue #4615. Document how to use itertools for de-duping. Modified: python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.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 Jan 2 22:39:07 2009 @@ -606,3 +606,27 @@ return 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))) 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 Fri Jan 2 22:39:07 2009 @@ -1298,6 +1298,30 @@ ... 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))) + This is not part of the examples but it tests to make sure the definitions perform as purported. @@ -1360,6 +1384,18 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(unique_everseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D'] + +>>> list(unique_everseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'D'] + +>>> list(unique_justseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D', 'A', 'B'] + +>>> list(unique_justseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'A', 'D'] + """ __test__ = {'libreftest' : libreftest} From python-checkins at python.org Sat Jan 3 00:07:09 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 00:07:09 +0100 (CET) Subject: [Python-checkins] r68182 - in python/trunk: Lib/decimal.py Misc/NEWS Message-ID: <20090102230709.032011E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 00:07:08 2009 New Revision: 68182 Log: Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) Modified: python/trunk/Lib/decimal.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sat Jan 3 00:07:08 2009 @@ -216,7 +216,7 @@ if args: ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) return ans._fix_nan(context) - return NaN + return _NaN class ConversionSyntax(InvalidOperation): """Trying to convert badly formed string. @@ -226,7 +226,7 @@ syntax. The result is [0,qNaN]. """ def handle(self, context, *args): - return NaN + return _NaN class DivisionByZero(DecimalException, ZeroDivisionError): """Division by 0. @@ -242,7 +242,7 @@ """ def handle(self, context, sign, *args): - return Infsign[sign] + return _Infsign[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -253,7 +253,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class DivisionUndefined(InvalidOperation, ZeroDivisionError): """Undefined result of division. @@ -264,7 +264,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Inexact(DecimalException): """Had to round, losing information. @@ -290,7 +290,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Rounded(DecimalException): """Number got rounded (not necessarily changed during rounding). @@ -340,15 +340,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return Infsign[sign] + return _Infsign[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1171,12 +1171,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return Infsign[resultsign] + return _Infsign[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return Infsign[resultsign] + return _Infsign[resultsign] resultexp = self._exp + other._exp @@ -1226,7 +1226,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return Infsign[sign] + return _Infsign[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1329,7 +1329,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (Infsign[sign], + return (_Infsign[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1477,7 +1477,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return Infsign[self._sign ^ other._sign] + return _Infsign[self._sign ^ other._sign] if not other: if self: @@ -1732,12 +1732,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2087,7 +2087,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return Dec_p1 + return _Dec_p1 # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2109,19 +2109,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return Infsign[result_sign] + return _Infsign[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == Dec_p1: + if self == _Dec_p1: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2154,7 +2154,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2674,9 +2674,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return Dec_n1 + return _Dec_n1 if not self._sign and other._sign: - return Dec_p1 + return _Dec_p1 sign = self._sign # let's handle both NaN types @@ -2686,51 +2686,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._int > other._int: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 if sign: if self_nan == 1: - return Dec_n1 + return _Dec_n1 if other_nan == 1: - return Dec_p1 + return _Dec_p1 if self_nan == 2: - return Dec_n1 + return _Dec_n1 if other_nan == 2: - return Dec_p1 + return _Dec_p1 else: if self_nan == 1: - return Dec_p1 + return _Dec_p1 if other_nan == 1: - return Dec_n1 + return _Dec_n1 if self_nan == 2: - return Dec_p1 + return _Dec_p1 if other_nan == 2: - return Dec_n1 + return _Dec_n1 if self < other: - return Dec_n1 + return _Dec_n1 if self > other: - return Dec_p1 + return _Dec_p1 if self._exp < other._exp: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._exp > other._exp: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 def compare_total_mag(self, other): @@ -2771,11 +2771,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return Dec_0 + return _Dec_0 # exp(0) = 1 if not self: - return Dec_p1 + return _Dec_p1 # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2927,15 +2927,15 @@ # ln(0.0) == -Infinity if not self: - return negInf + return _negInf # ln(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # ln(1.0) == 0.0 - if self == Dec_p1: - return Dec_0 + if self == _Dec_p1: + return _Dec_0 # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3007,11 +3007,11 @@ # log10(0.0) == -Infinity if not self: - return negInf + return _negInf # log10(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3063,7 +3063,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return Inf + return _Inf # logb(0) = -Inf, DivisionByZero if not self: @@ -3220,7 +3220,7 @@ return ans if self._isinfinity() == -1: - return negInf + return _negInf if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3243,7 +3243,7 @@ return ans if self._isinfinity() == 1: - return Inf + return _Inf if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5490,15 +5490,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -Inf = Decimal('Inf') -negInf = Decimal('-Inf') -NaN = Decimal('NaN') -Dec_0 = Decimal(0) -Dec_p1 = Decimal(1) -Dec_n1 = Decimal(-1) +_Inf = Decimal('Inf') +_negInf = Decimal('-Inf') +_NaN = Decimal('NaN') +_Dec_0 = Decimal(0) +_Dec_p1 = Decimal(1) +_Dec_n1 = Decimal(-1) -# Infsign[sign] is infinity w/ that sign -Infsign = (Inf, negInf) +# _Infsign[sign] is infinity w/ that sign +_Infsign = (_Inf, _negInf) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 3 00:07:08 2009 @@ -108,6 +108,9 @@ Library ------- +- Issue #4812: add missing underscore prefix to some internal-use-only + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) + - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. From python-checkins at python.org Sat Jan 3 00:16:52 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 00:16:52 +0100 (CET) Subject: [Python-checkins] r68183 - in python/branches/release26-maint: Lib/decimal.py Misc/NEWS Message-ID: <20090102231652.079671E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 00:16:51 2009 New Revision: 68183 Log: Merged revisions 68182 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68182 | mark.dickinson | 2009-01-02 23:07:08 +0000 (Fri, 02 Jan 2009) | 4 lines Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/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 Sat Jan 3 00:16:51 2009 @@ -216,7 +216,7 @@ if args: ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) return ans._fix_nan(context) - return NaN + return _NaN class ConversionSyntax(InvalidOperation): """Trying to convert badly formed string. @@ -226,7 +226,7 @@ syntax. The result is [0,qNaN]. """ def handle(self, context, *args): - return NaN + return _NaN class DivisionByZero(DecimalException, ZeroDivisionError): """Division by 0. @@ -242,7 +242,7 @@ """ def handle(self, context, sign, *args): - return Infsign[sign] + return _Infsign[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -253,7 +253,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class DivisionUndefined(InvalidOperation, ZeroDivisionError): """Undefined result of division. @@ -264,7 +264,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Inexact(DecimalException): """Had to round, losing information. @@ -290,7 +290,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Rounded(DecimalException): """Number got rounded (not necessarily changed during rounding). @@ -340,15 +340,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return Infsign[sign] + return _Infsign[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1171,12 +1171,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return Infsign[resultsign] + return _Infsign[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return Infsign[resultsign] + return _Infsign[resultsign] resultexp = self._exp + other._exp @@ -1226,7 +1226,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return Infsign[sign] + return _Infsign[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1329,7 +1329,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (Infsign[sign], + return (_Infsign[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1477,7 +1477,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return Infsign[self._sign ^ other._sign] + return _Infsign[self._sign ^ other._sign] if not other: if self: @@ -1732,12 +1732,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2087,7 +2087,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return Dec_p1 + return _Dec_p1 # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2109,19 +2109,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return Infsign[result_sign] + return _Infsign[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == Dec_p1: + if self == _Dec_p1: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2154,7 +2154,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2674,9 +2674,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return Dec_n1 + return _Dec_n1 if not self._sign and other._sign: - return Dec_p1 + return _Dec_p1 sign = self._sign # let's handle both NaN types @@ -2686,51 +2686,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._int > other._int: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 if sign: if self_nan == 1: - return Dec_n1 + return _Dec_n1 if other_nan == 1: - return Dec_p1 + return _Dec_p1 if self_nan == 2: - return Dec_n1 + return _Dec_n1 if other_nan == 2: - return Dec_p1 + return _Dec_p1 else: if self_nan == 1: - return Dec_p1 + return _Dec_p1 if other_nan == 1: - return Dec_n1 + return _Dec_n1 if self_nan == 2: - return Dec_p1 + return _Dec_p1 if other_nan == 2: - return Dec_n1 + return _Dec_n1 if self < other: - return Dec_n1 + return _Dec_n1 if self > other: - return Dec_p1 + return _Dec_p1 if self._exp < other._exp: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._exp > other._exp: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 def compare_total_mag(self, other): @@ -2771,11 +2771,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return Dec_0 + return _Dec_0 # exp(0) = 1 if not self: - return Dec_p1 + return _Dec_p1 # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2927,15 +2927,15 @@ # ln(0.0) == -Infinity if not self: - return negInf + return _negInf # ln(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # ln(1.0) == 0.0 - if self == Dec_p1: - return Dec_0 + if self == _Dec_p1: + return _Dec_0 # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3007,11 +3007,11 @@ # log10(0.0) == -Infinity if not self: - return negInf + return _negInf # log10(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3063,7 +3063,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return Inf + return _Inf # logb(0) = -Inf, DivisionByZero if not self: @@ -3220,7 +3220,7 @@ return ans if self._isinfinity() == -1: - return negInf + return _negInf if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3243,7 +3243,7 @@ return ans if self._isinfinity() == 1: - return Inf + return _Inf if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5490,15 +5490,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -Inf = Decimal('Inf') -negInf = Decimal('-Inf') -NaN = Decimal('NaN') -Dec_0 = Decimal(0) -Dec_p1 = Decimal(1) -Dec_n1 = Decimal(-1) +_Inf = Decimal('Inf') +_negInf = Decimal('-Inf') +_NaN = Decimal('NaN') +_Dec_0 = Decimal(0) +_Dec_p1 = Decimal(1) +_Dec_n1 = Decimal(-1) -# Infsign[sign] is infinity w/ that sign -Infsign = (Inf, negInf) +# _Infsign[sign] is infinity w/ that sign +_Infsign = (_Inf, _negInf) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 3 00:16:51 2009 @@ -150,6 +150,9 @@ Library ------- +- Issue #4812: add missing underscore prefix to some internal-use-only + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) + - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. From python-checkins at python.org Sat Jan 3 00:23:21 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 00:23:21 +0100 (CET) Subject: [Python-checkins] r68184 - in python/branches/py3k: Lib/decimal.py Misc/NEWS Message-ID: <20090102232321.A01901E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 00:23:21 2009 New Revision: 68184 Log: Merged revisions 68182 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68182 | mark.dickinson | 2009-01-02 23:07:08 +0000 (Fri, 02 Jan 2009) | 4 lines Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/decimal.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/decimal.py ============================================================================== --- python/branches/py3k/Lib/decimal.py (original) +++ python/branches/py3k/Lib/decimal.py Sat Jan 3 00:23:21 2009 @@ -217,7 +217,7 @@ if args: ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) return ans._fix_nan(context) - return NaN + return _NaN class ConversionSyntax(InvalidOperation): """Trying to convert badly formed string. @@ -227,7 +227,7 @@ syntax. The result is [0,qNaN]. """ def handle(self, context, *args): - return NaN + return _NaN class DivisionByZero(DecimalException, ZeroDivisionError): """Division by 0. @@ -243,7 +243,7 @@ """ def handle(self, context, sign, *args): - return Infsign[sign] + return _Infsign[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -254,7 +254,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class DivisionUndefined(InvalidOperation, ZeroDivisionError): """Undefined result of division. @@ -265,7 +265,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Inexact(DecimalException): """Had to round, losing information. @@ -291,7 +291,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Rounded(DecimalException): """Number got rounded (not necessarily changed during rounding). @@ -341,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return Infsign[sign] + return _Infsign[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1173,12 +1173,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return Infsign[resultsign] + return _Infsign[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return Infsign[resultsign] + return _Infsign[resultsign] resultexp = self._exp + other._exp @@ -1228,7 +1228,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return Infsign[sign] + return _Infsign[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1328,7 +1328,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (Infsign[sign], + return (_Infsign[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1476,7 +1476,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return Infsign[self._sign ^ other._sign] + return _Infsign[self._sign ^ other._sign] if not other: if self: @@ -1820,12 +1820,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2175,7 +2175,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return Dec_p1 + return _Dec_p1 # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2197,19 +2197,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return Infsign[result_sign] + return _Infsign[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == Dec_p1: + if self == _Dec_p1: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2242,7 +2242,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2762,9 +2762,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return Dec_n1 + return _Dec_n1 if not self._sign and other._sign: - return Dec_p1 + return _Dec_p1 sign = self._sign # let's handle both NaN types @@ -2774,51 +2774,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._int > other._int: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 if sign: if self_nan == 1: - return Dec_n1 + return _Dec_n1 if other_nan == 1: - return Dec_p1 + return _Dec_p1 if self_nan == 2: - return Dec_n1 + return _Dec_n1 if other_nan == 2: - return Dec_p1 + return _Dec_p1 else: if self_nan == 1: - return Dec_p1 + return _Dec_p1 if other_nan == 1: - return Dec_n1 + return _Dec_n1 if self_nan == 2: - return Dec_p1 + return _Dec_p1 if other_nan == 2: - return Dec_n1 + return _Dec_n1 if self < other: - return Dec_n1 + return _Dec_n1 if self > other: - return Dec_p1 + return _Dec_p1 if self._exp < other._exp: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._exp > other._exp: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 def compare_total_mag(self, other): @@ -2859,11 +2859,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return Dec_0 + return _Dec_0 # exp(0) = 1 if not self: - return Dec_p1 + return _Dec_p1 # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -3015,15 +3015,15 @@ # ln(0.0) == -Infinity if not self: - return negInf + return _negInf # ln(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # ln(1.0) == 0.0 - if self == Dec_p1: - return Dec_0 + if self == _Dec_p1: + return _Dec_0 # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3095,11 +3095,11 @@ # log10(0.0) == -Infinity if not self: - return negInf + return _negInf # log10(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3151,7 +3151,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return Inf + return _Inf # logb(0) = -Inf, DivisionByZero if not self: @@ -3308,7 +3308,7 @@ return ans if self._isinfinity() == -1: - return negInf + return _negInf if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3331,7 +3331,7 @@ return ans if self._isinfinity() == 1: - return Inf + return _Inf if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5572,15 +5572,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -Inf = Decimal('Inf') -negInf = Decimal('-Inf') -NaN = Decimal('NaN') -Dec_0 = Decimal(0) -Dec_p1 = Decimal(1) -Dec_n1 = Decimal(-1) +_Inf = Decimal('Inf') +_negInf = Decimal('-Inf') +_NaN = Decimal('NaN') +_Dec_0 = Decimal(0) +_Dec_p1 = Decimal(1) +_Dec_n1 = Decimal(-1) -# Infsign[sign] is infinity w/ that sign -Infsign = (Inf, negInf) +# _Infsign[sign] is infinity w/ that sign +_Infsign = (_Inf, _negInf) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 00:23:21 2009 @@ -78,6 +78,9 @@ Library ------- +- Issue #4812: add missing underscore prefix to some internal-use-only + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey. From python-checkins at python.org Sat Jan 3 00:28:00 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 00:28:00 +0100 (CET) Subject: [Python-checkins] r68185 - in python/branches/release30-maint: Lib/decimal.py Misc/NEWS Message-ID: <20090102232800.D815F1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 00:28:00 2009 New Revision: 68185 Log: Merged revisions 68184 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68184 | mark.dickinson | 2009-01-02 23:23:21 +0000 (Fri, 02 Jan 2009) | 10 lines Merged revisions 68182 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68182 | mark.dickinson | 2009-01-02 23:07:08 +0000 (Fri, 02 Jan 2009) | 4 lines Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/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 Sat Jan 3 00:28:00 2009 @@ -217,7 +217,7 @@ if args: ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) return ans._fix_nan(context) - return NaN + return _NaN class ConversionSyntax(InvalidOperation): """Trying to convert badly formed string. @@ -227,7 +227,7 @@ syntax. The result is [0,qNaN]. """ def handle(self, context, *args): - return NaN + return _NaN class DivisionByZero(DecimalException, ZeroDivisionError): """Division by 0. @@ -243,7 +243,7 @@ """ def handle(self, context, sign, *args): - return Infsign[sign] + return _Infsign[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -254,7 +254,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class DivisionUndefined(InvalidOperation, ZeroDivisionError): """Undefined result of division. @@ -265,7 +265,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Inexact(DecimalException): """Had to round, losing information. @@ -291,7 +291,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Rounded(DecimalException): """Number got rounded (not necessarily changed during rounding). @@ -341,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return Infsign[sign] + return _Infsign[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return Infsign[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1173,12 +1173,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return Infsign[resultsign] + return _Infsign[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return Infsign[resultsign] + return _Infsign[resultsign] resultexp = self._exp + other._exp @@ -1228,7 +1228,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return Infsign[sign] + return _Infsign[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1328,7 +1328,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (Infsign[sign], + return (_Infsign[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1476,7 +1476,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return Infsign[self._sign ^ other._sign] + return _Infsign[self._sign ^ other._sign] if not other: if self: @@ -1820,12 +1820,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = Infsign[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2175,7 +2175,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return Dec_p1 + return _Dec_p1 # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2197,19 +2197,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return Infsign[result_sign] + return _Infsign[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == Dec_p1: + if self == _Dec_p1: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2242,7 +2242,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _Infsign[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2762,9 +2762,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return Dec_n1 + return _Dec_n1 if not self._sign and other._sign: - return Dec_p1 + return _Dec_p1 sign = self._sign # let's handle both NaN types @@ -2774,51 +2774,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._int > other._int: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 if sign: if self_nan == 1: - return Dec_n1 + return _Dec_n1 if other_nan == 1: - return Dec_p1 + return _Dec_p1 if self_nan == 2: - return Dec_n1 + return _Dec_n1 if other_nan == 2: - return Dec_p1 + return _Dec_p1 else: if self_nan == 1: - return Dec_p1 + return _Dec_p1 if other_nan == 1: - return Dec_n1 + return _Dec_n1 if self_nan == 2: - return Dec_p1 + return _Dec_p1 if other_nan == 2: - return Dec_n1 + return _Dec_n1 if self < other: - return Dec_n1 + return _Dec_n1 if self > other: - return Dec_p1 + return _Dec_p1 if self._exp < other._exp: if sign: - return Dec_p1 + return _Dec_p1 else: - return Dec_n1 + return _Dec_n1 if self._exp > other._exp: if sign: - return Dec_n1 + return _Dec_n1 else: - return Dec_p1 - return Dec_0 + return _Dec_p1 + return _Dec_0 def compare_total_mag(self, other): @@ -2859,11 +2859,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return Dec_0 + return _Dec_0 # exp(0) = 1 if not self: - return Dec_p1 + return _Dec_p1 # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -3015,15 +3015,15 @@ # ln(0.0) == -Infinity if not self: - return negInf + return _negInf # ln(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # ln(1.0) == 0.0 - if self == Dec_p1: - return Dec_0 + if self == _Dec_p1: + return _Dec_0 # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3095,11 +3095,11 @@ # log10(0.0) == -Infinity if not self: - return negInf + return _negInf # log10(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Inf # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3151,7 +3151,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return Inf + return _Inf # logb(0) = -Inf, DivisionByZero if not self: @@ -3308,7 +3308,7 @@ return ans if self._isinfinity() == -1: - return negInf + return _negInf if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3331,7 +3331,7 @@ return ans if self._isinfinity() == 1: - return Inf + return _Inf if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5572,15 +5572,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -Inf = Decimal('Inf') -negInf = Decimal('-Inf') -NaN = Decimal('NaN') -Dec_0 = Decimal(0) -Dec_p1 = Decimal(1) -Dec_n1 = Decimal(-1) +_Inf = Decimal('Inf') +_negInf = Decimal('-Inf') +_NaN = Decimal('NaN') +_Dec_0 = Decimal(0) +_Dec_p1 = Decimal(1) +_Dec_n1 = Decimal(-1) -# Infsign[sign] is infinity w/ that sign -Infsign = (Inf, negInf) +# _Infsign[sign] is infinity w/ that sign +_Infsign = (_Inf, _negInf) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 3 00:28:00 2009 @@ -48,6 +48,9 @@ Library ------- +- Issue #4812: add missing underscore prefix to some internal-use-only + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) + - Issue 4790: The nsmallest() and nlargest() functions in the heapq module did unnecessary work in the common case where no key function was specified. From buildbot at python.org Sat Jan 3 00:43:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 02 Jan 2009 23:43:15 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090102234315.213631E4002@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/53 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: 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 Sat Jan 3 01:22:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 00:22:45 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090103002245.9C3101E4002@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/22 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 08:46:36 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 08:46:36 +0100 (CET) Subject: [Python-checkins] r68186 - python/branches/release26-maint/Doc/library/decimal.rst Message-ID: <20090103074636.987911E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 08:46:36 2009 New Revision: 68186 Log: Simplify one of the decimal recipes. Modified: python/branches/release26-maint/Doc/library/decimal.rst Modified: python/branches/release26-maint/Doc/library/decimal.rst ============================================================================== --- python/branches/release26-maint/Doc/library/decimal.rst (original) +++ python/branches/release26-maint/Doc/library/decimal.rst Sat Jan 3 08:46:36 2009 @@ -1880,13 +1880,13 @@ def float_to_decimal(f): "Convert a floating point number to a Decimal with no loss of information" n, d = f.as_integer_ratio() - with localcontext() as ctx: - ctx.traps[Inexact] = True - while True: - try: - return Decimal(n) / Decimal(d) - except Inexact: - ctx.prec += 1 + numerator, denominator = Decimal(n), Decimal(d) + ctx = Context(prec=60) + result = ctx.divide(numerator, denominator) + while ctx.flags[Inexact]: + ctx.prec *= 2 + result = ctx.divide(numerator, denominator) + return result .. doctest:: From python-checkins at python.org Sat Jan 3 08:50:46 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 08:50:46 +0100 (CET) Subject: [Python-checkins] r68187 - python/branches/release26-maint/Doc/library/decimal.rst Message-ID: <20090103075046.7A19A1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 08:50:46 2009 New Revision: 68187 Log: Lost one line on a decimal recipe. Modified: python/branches/release26-maint/Doc/library/decimal.rst Modified: python/branches/release26-maint/Doc/library/decimal.rst ============================================================================== --- python/branches/release26-maint/Doc/library/decimal.rst (original) +++ python/branches/release26-maint/Doc/library/decimal.rst Sat Jan 3 08:50:46 2009 @@ -1884,6 +1884,7 @@ ctx = Context(prec=60) result = ctx.divide(numerator, denominator) while ctx.flags[Inexact]: + ctx.flags[Inexact] = False ctx.prec *= 2 result = ctx.divide(numerator, denominator) return result From python-checkins at python.org Sat Jan 3 10:24:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 10:24:19 +0100 (CET) Subject: [Python-checkins] r68188 - in python/branches/release26-maint: Lib/fractions.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090103092419.202201E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 10:24:18 2009 New Revision: 68188 Log: Fractions.from_float() no longer loses precision with large integer inputs. Modified: python/branches/release26-maint/Lib/fractions.py python/branches/release26-maint/Lib/test/test_fractions.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/fractions.py ============================================================================== --- python/branches/release26-maint/Lib/fractions.py (original) +++ python/branches/release26-maint/Lib/fractions.py Sat Jan 3 10:24:18 2009 @@ -111,7 +111,7 @@ """ if isinstance(f, numbers.Integral): - f = float(f) + return cls(f) elif not isinstance(f, float): raise TypeError("%s.from_float() only takes floats, not %r (%s)" % (cls.__name__, f, type(f).__name__)) 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 Sat Jan 3 10:24:18 2009 @@ -139,6 +139,8 @@ def testFromFloat(self): self.assertRaises(TypeError, F.from_float, 3+4j) self.assertEquals((10, 1), _components(F.from_float(10))) + bigint = 1234567890123456789 + self.assertEquals((bigint, 1), _components(F.from_float(bigint))) self.assertEquals((0, 1), _components(F.from_float(-0.0))) self.assertEquals((10, 1), _components(F.from_float(10.0))) self.assertEquals((-5, 2), _components(F.from_float(-2.5))) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 3 10:24:18 2009 @@ -56,6 +56,9 @@ Library ------- +- Fractions.from_float() no longer loses precision for integers to big to + cast as floats. + - Issue 4790: The nsmallest() and nlargest() functions in the heapq module did unnecessary work in the common case where no key function was specified. From python-checkins at python.org Sat Jan 3 10:27:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 10:27:09 +0100 (CET) Subject: [Python-checkins] r68189 - in python/branches/release30-maint: Lib/fractions.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090103092709.46F641E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 10:27:08 2009 New Revision: 68189 Log: Fractions.from_float() no longer loses precision with large integer inputs. Modified: python/branches/release30-maint/Lib/fractions.py python/branches/release30-maint/Lib/test/test_fractions.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/fractions.py ============================================================================== --- python/branches/release30-maint/Lib/fractions.py (original) +++ python/branches/release30-maint/Lib/fractions.py Sat Jan 3 10:27:08 2009 @@ -109,7 +109,7 @@ """ if isinstance(f, numbers.Integral): - f = float(f) + return cls(f) elif not isinstance(f, float): raise TypeError("%s.from_float() only takes floats, not %r (%s)" % (cls.__name__, f, type(f).__name__)) 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 Sat Jan 3 10:27:08 2009 @@ -136,6 +136,8 @@ def testFromFloat(self): self.assertRaises(TypeError, F.from_float, 3+4j) self.assertEquals((10, 1), _components(F.from_float(10))) + bigint = 1234567890123456789 + self.assertEquals((bigint, 1), _components(F.from_float(bigint))) self.assertEquals((0, 1), _components(F.from_float(-0.0))) self.assertEquals((10, 1), _components(F.from_float(10.0))) self.assertEquals((-5, 2), _components(F.from_float(-2.5))) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 3 10:27:08 2009 @@ -48,6 +48,9 @@ Library ------- +- Fractions.from_float() no longer loses precision for integers too big to + cast as floats. + - Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) From python-checkins at python.org Sat Jan 3 10:27:41 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 10:27:41 +0100 (CET) Subject: [Python-checkins] r68190 - python/branches/release26-maint/Misc/NEWS Message-ID: <20090103092741.9E6BC1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 10:27:41 2009 New Revision: 68190 Log: Fix spelling. 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 Sat Jan 3 10:27:41 2009 @@ -56,7 +56,7 @@ Library ------- -- Fractions.from_float() no longer loses precision for integers to big to +- Fractions.from_float() no longer loses precision for integers too big to cast as floats. - Issue 4790: The nsmallest() and nlargest() functions in the heapq module From python-checkins at python.org Sat Jan 3 13:07:21 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 13:07:21 +0100 (CET) Subject: [Python-checkins] r68191 - python/trunk/Lib/decimal.py Message-ID: <20090103120721.2DCDF1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 13:07:20 2009 New Revision: 68191 Log: Issue #4812: further renaming of internal Decimal constants, for clarity. Modified: python/trunk/Lib/decimal.py Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sat Jan 3 13:07:20 2009 @@ -242,7 +242,7 @@ """ def handle(self, context, sign, *args): - return _Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -340,15 +340,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return _Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1171,12 +1171,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1226,7 +1226,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return _Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1329,7 +1329,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (_Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1477,7 +1477,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return _Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1732,12 +1732,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2087,7 +2087,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return _Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2109,19 +2109,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == _Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2154,7 +2154,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2674,9 +2674,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return _Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return _Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2686,51 +2686,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return _Dec_n1 + return _NegativeOne if other_nan == 1: - return _Dec_p1 + return _One if self_nan == 2: - return _Dec_n1 + return _NegativeOne if other_nan == 2: - return _Dec_p1 + return _One else: if self_nan == 1: - return _Dec_p1 + return _One if other_nan == 1: - return _Dec_n1 + return _NegativeOne if self_nan == 2: - return _Dec_p1 + return _One if other_nan == 2: - return _Dec_n1 + return _NegativeOne if self < other: - return _Dec_n1 + return _NegativeOne if self > other: - return _Dec_p1 + return _One if self._exp < other._exp: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2771,11 +2771,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return _Dec_0 + return _Zero # exp(0) = 1 if not self: - return _Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2927,15 +2927,15 @@ # ln(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # ln(1.0) == 0.0 - if self == _Dec_p1: - return _Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3007,11 +3007,11 @@ # log10(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3063,7 +3063,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return _Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3220,7 +3220,7 @@ return ans if self._isinfinity() == -1: - return _negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3243,7 +3243,7 @@ return ans if self._isinfinity() == 1: - return _Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5490,15 +5490,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -_Inf = Decimal('Inf') -_negInf = Decimal('-Inf') +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') _NaN = Decimal('NaN') -_Dec_0 = Decimal(0) -_Dec_p1 = Decimal(1) -_Dec_n1 = Decimal(-1) +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# _Infsign[sign] is infinity w/ that sign -_Infsign = (_Inf, _negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) From python-checkins at python.org Sat Jan 3 13:09:22 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 13:09:22 +0100 (CET) Subject: [Python-checkins] r68192 - in python/branches/release26-maint: Lib/decimal.py Message-ID: <20090103120922.E881E1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 13:09:22 2009 New Revision: 68192 Log: Merged revisions 68191 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68191 | mark.dickinson | 2009-01-03 12:07:20 +0000 (Sat, 03 Jan 2009) | 2 lines Issue #4812: further renaming of internal Decimal constants, for clarity. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/decimal.py Modified: python/branches/release26-maint/Lib/decimal.py ============================================================================== --- python/branches/release26-maint/Lib/decimal.py (original) +++ python/branches/release26-maint/Lib/decimal.py Sat Jan 3 13:09:22 2009 @@ -242,7 +242,7 @@ """ def handle(self, context, sign, *args): - return _Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -340,15 +340,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return _Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1171,12 +1171,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1226,7 +1226,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return _Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1329,7 +1329,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (_Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1477,7 +1477,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return _Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1732,12 +1732,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2087,7 +2087,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return _Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2109,19 +2109,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == _Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2154,7 +2154,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2674,9 +2674,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return _Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return _Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2686,51 +2686,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return _Dec_n1 + return _NegativeOne if other_nan == 1: - return _Dec_p1 + return _One if self_nan == 2: - return _Dec_n1 + return _NegativeOne if other_nan == 2: - return _Dec_p1 + return _One else: if self_nan == 1: - return _Dec_p1 + return _One if other_nan == 1: - return _Dec_n1 + return _NegativeOne if self_nan == 2: - return _Dec_p1 + return _One if other_nan == 2: - return _Dec_n1 + return _NegativeOne if self < other: - return _Dec_n1 + return _NegativeOne if self > other: - return _Dec_p1 + return _One if self._exp < other._exp: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2771,11 +2771,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return _Dec_0 + return _Zero # exp(0) = 1 if not self: - return _Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2927,15 +2927,15 @@ # ln(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # ln(1.0) == 0.0 - if self == _Dec_p1: - return _Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3007,11 +3007,11 @@ # log10(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3063,7 +3063,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return _Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3220,7 +3220,7 @@ return ans if self._isinfinity() == -1: - return _negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3243,7 +3243,7 @@ return ans if self._isinfinity() == 1: - return _Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5490,15 +5490,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -_Inf = Decimal('Inf') -_negInf = Decimal('-Inf') +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') _NaN = Decimal('NaN') -_Dec_0 = Decimal(0) -_Dec_p1 = Decimal(1) -_Dec_n1 = Decimal(-1) +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# _Infsign[sign] is infinity w/ that sign -_Infsign = (_Inf, _negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) From python-checkins at python.org Sat Jan 3 13:11:47 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 13:11:47 +0100 (CET) Subject: [Python-checkins] r68193 - in python/branches/py3k: Lib/decimal.py Message-ID: <20090103121147.E8D631E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 13:11:47 2009 New Revision: 68193 Log: Merged revisions 68191 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68191 | mark.dickinson | 2009-01-03 12:07:20 +0000 (Sat, 03 Jan 2009) | 2 lines Issue #4812: further renaming of internal Decimal constants, for clarity. ........ Modified: python/branches/py3k/ (props changed) 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 Sat Jan 3 13:11:47 2009 @@ -243,7 +243,7 @@ """ def handle(self, context, sign, *args): - return _Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -341,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return _Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1173,12 +1173,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1228,7 +1228,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return _Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1328,7 +1328,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (_Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1476,7 +1476,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return _Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1820,12 +1820,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2175,7 +2175,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return _Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2197,19 +2197,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == _Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2242,7 +2242,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2762,9 +2762,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return _Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return _Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2774,51 +2774,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return _Dec_n1 + return _NegativeOne if other_nan == 1: - return _Dec_p1 + return _One if self_nan == 2: - return _Dec_n1 + return _NegativeOne if other_nan == 2: - return _Dec_p1 + return _One else: if self_nan == 1: - return _Dec_p1 + return _One if other_nan == 1: - return _Dec_n1 + return _NegativeOne if self_nan == 2: - return _Dec_p1 + return _One if other_nan == 2: - return _Dec_n1 + return _NegativeOne if self < other: - return _Dec_n1 + return _NegativeOne if self > other: - return _Dec_p1 + return _One if self._exp < other._exp: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2859,11 +2859,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return _Dec_0 + return _Zero # exp(0) = 1 if not self: - return _Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -3015,15 +3015,15 @@ # ln(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # ln(1.0) == 0.0 - if self == _Dec_p1: - return _Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3095,11 +3095,11 @@ # log10(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3151,7 +3151,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return _Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3308,7 +3308,7 @@ return ans if self._isinfinity() == -1: - return _negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3331,7 +3331,7 @@ return ans if self._isinfinity() == 1: - return _Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5572,15 +5572,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -_Inf = Decimal('Inf') -_negInf = Decimal('-Inf') +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') _NaN = Decimal('NaN') -_Dec_0 = Decimal(0) -_Dec_p1 = Decimal(1) -_Dec_n1 = Decimal(-1) +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# _Infsign[sign] is infinity w/ that sign -_Infsign = (_Inf, _negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) From python-checkins at python.org Sat Jan 3 13:15:35 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 3 Jan 2009 13:15:35 +0100 (CET) Subject: [Python-checkins] r68194 - in python/branches/release30-maint: Lib/decimal.py Message-ID: <20090103121535.840B41E401C@bag.python.org> Author: mark.dickinson Date: Sat Jan 3 13:15:35 2009 New Revision: 68194 Log: Merged revisions 68193 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68193 | mark.dickinson | 2009-01-03 12:11:47 +0000 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68191 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68191 | mark.dickinson | 2009-01-03 12:07:20 +0000 (Sat, 03 Jan 2009) | 2 lines Issue #4812: further renaming of internal Decimal constants, for clarity. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/decimal.py Modified: python/branches/release30-maint/Lib/decimal.py ============================================================================== --- python/branches/release30-maint/Lib/decimal.py (original) +++ python/branches/release30-maint/Lib/decimal.py Sat Jan 3 13:15:35 2009 @@ -243,7 +243,7 @@ """ def handle(self, context, sign, *args): - return _Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -341,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return _Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1173,12 +1173,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1228,7 +1228,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return _Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1328,7 +1328,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (_Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1476,7 +1476,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return _Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1820,12 +1820,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2175,7 +2175,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return _Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2197,19 +2197,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == _Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2242,7 +2242,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2762,9 +2762,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return _Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return _Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2774,51 +2774,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return _Dec_n1 + return _NegativeOne if other_nan == 1: - return _Dec_p1 + return _One if self_nan == 2: - return _Dec_n1 + return _NegativeOne if other_nan == 2: - return _Dec_p1 + return _One else: if self_nan == 1: - return _Dec_p1 + return _One if other_nan == 1: - return _Dec_n1 + return _NegativeOne if self_nan == 2: - return _Dec_p1 + return _One if other_nan == 2: - return _Dec_n1 + return _NegativeOne if self < other: - return _Dec_n1 + return _NegativeOne if self > other: - return _Dec_p1 + return _One if self._exp < other._exp: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2859,11 +2859,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return _Dec_0 + return _Zero # exp(0) = 1 if not self: - return _Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -3015,15 +3015,15 @@ # ln(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # ln(1.0) == 0.0 - if self == _Dec_p1: - return _Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3095,11 +3095,11 @@ # log10(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3151,7 +3151,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return _Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3308,7 +3308,7 @@ return ans if self._isinfinity() == -1: - return _negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3331,7 +3331,7 @@ return ans if self._isinfinity() == 1: - return _Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5572,15 +5572,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -_Inf = Decimal('Inf') -_negInf = Decimal('-Inf') +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') _NaN = Decimal('NaN') -_Dec_0 = Decimal(0) -_Dec_p1 = Decimal(1) -_Dec_n1 = Decimal(-1) +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# _Infsign[sign] is infinity w/ that sign -_Infsign = (_Inf, _negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) From buildbot at python.org Sat Jan 3 13:32:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 12:32:40 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090103123240.55B0E1E4002@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/4411 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 3 13:57:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 12:57:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090103125740.9BA5E1E4002@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/55 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 Sat Jan 3 14:26:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 13:26:21 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090103132622.2CE0B1E4002@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/58 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 Sat Jan 3 14:38:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 13:38:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090103133812.725561E4002@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/24 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 14:45:15 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 14:45:15 +0100 (CET) Subject: [Python-checkins] r68195 - python/trunk/Parser/asdl.py Message-ID: <20090103134515.C6C141E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 14:45:15 2009 New Revision: 68195 Log: Remove useless string literal. Modified: python/trunk/Parser/asdl.py Modified: python/trunk/Parser/asdl.py ============================================================================== --- python/trunk/Parser/asdl.py (original) +++ python/trunk/Parser/asdl.py Sat Jan 3 14:45:15 2009 @@ -167,7 +167,7 @@ return Product(fields) def p_sum_0(self, (constructor,)): - " sum ::= constructor """ + " sum ::= constructor " return [constructor] def p_sum_1(self, (constructor, _, sum)): From buildbot at python.org Sat Jan 3 15:02:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 14:02:06 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090103140207.188391E4002@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/25 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: sincerely, -The Buildbot From buildbot at python.org Sat Jan 3 15:12:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 14:12:02 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090103141202.E02511E4002@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/26 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Jan 3 15:13:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 14:13:04 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.x Message-ID: <20090103141305.87E0B1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.x/builds/45 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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 Sat Jan 3 15:26:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 14:26:29 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 2.6 Message-ID: <20090103142629.6188E1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%202.6/builds/22 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc 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 Sat Jan 3 15:29:54 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 15:29:54 +0100 (CET) Subject: [Python-checkins] r68196 - python/trunk/Doc/library/multiprocessing.rst Message-ID: <20090103142954.06CD51E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 15:29:53 2009 New Revision: 68196 Log: Fix indentation. Modified: python/trunk/Doc/library/multiprocessing.rst Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Sat Jan 3 15:29:53 2009 @@ -109,12 +109,12 @@ def f(q): q.put([42, None, 'hello']) - if __name__ == '__main__': - q = Queue() - p = Process(target=f, args=(q,)) - p.start() - print q.get() # prints "[42, None, 'hello']" - p.join() + if __name__ == '__main__': + q = Queue() + p = Process(target=f, args=(q,)) + p.start() + print q.get() # prints "[42, None, 'hello']" + p.join() Queues are thread and process safe. From buildbot at python.org Sat Jan 3 15:48:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 14:48:25 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090103144826.1D5761E4002@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/640 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Jan 3 16:09:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 15:09:09 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090103150909.71C3C1E4002@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/48 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 buildbot at python.org Sat Jan 3 16:53:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 15:53:25 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20090103155325.801431E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/23 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Jan 3 17:12:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 16:12:29 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090103161229.C24D91E4002@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/23 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Jan 3 17:15:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 16:15:41 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20090103161541.46C2B1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/935 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc 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 Sat Jan 3 17:34:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 3 Jan 2009 17:34:03 +0100 (CET) Subject: [Python-checkins] r68197 - in python/trunk/Lib/lib2to3: fixer_util.py fixes/fix_execfile.py fixes/fix_import.py fixes/fix_imports.py fixes/fix_long.py main.py refactor.py tests/data/py3_test_grammar.py tests/test_fixers.py Message-ID: <20090103163403.1044D1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 3 17:34:02 2009 New Revision: 68197 Log: Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ Modified: python/trunk/Lib/lib2to3/ (props changed) python/trunk/Lib/lib2to3/fixer_util.py python/trunk/Lib/lib2to3/fixes/fix_execfile.py python/trunk/Lib/lib2to3/fixes/fix_import.py python/trunk/Lib/lib2to3/fixes/fix_imports.py python/trunk/Lib/lib2to3/fixes/fix_long.py python/trunk/Lib/lib2to3/main.py python/trunk/Lib/lib2to3/refactor.py python/trunk/Lib/lib2to3/tests/data/py3_test_grammar.py python/trunk/Lib/lib2to3/tests/test_fixers.py Modified: python/trunk/Lib/lib2to3/fixer_util.py ============================================================================== --- python/trunk/Lib/lib2to3/fixer_util.py (original) +++ python/trunk/Lib/lib2to3/fixer_util.py Sat Jan 3 17:34:02 2009 @@ -222,6 +222,29 @@ return True return False +def is_probably_builtin(node): + """ + Check that something isn't an attribute or function name etc. + """ + prev = node.get_prev_sibling() + if prev is not None and prev.type == token.DOT: + # Attribute lookup. + return False + parent = node.parent + if parent.type in (syms.funcdef, syms.classdef): + return False + if parent.type == syms.expr_stmt and parent.children[0] is node: + # Assignment. + return False + if parent.type == syms.parameters or \ + (parent.type == syms.typedargslist and ( + (prev is not None and prev.type == token.COMMA) or + parent.children[0] is node + )): + # The name of an argument. + return False + return True + ########################################################### ### The following functions are to find bindings in a suite ########################################################### Modified: python/trunk/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_execfile.py Sat Jan 3 17:34:02 2009 @@ -7,9 +7,9 @@ exec() function. """ -from .. import pytree from .. import fixer_base -from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) class FixExecfile(fixer_base.BaseFix): @@ -22,16 +22,30 @@ def transform(self, node, results): assert results - syms = self.syms filename = results["filename"] globals = results.get("globals") locals = results.get("locals") - args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(), - Name('read'), LParen(), RParen()] - args[0].set_prefix("") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.set_prefix(" ") + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_import.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_import.py Sat Jan 3 17:34:02 2009 @@ -13,55 +13,78 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport, syms +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unkown node type") + class FixImport(fixer_base.BaseFix): PATTERN = """ - import_from< type='from' imp=any 'import' ['('] any [')'] > + import_from< 'from' imp=any 'import' ['('] any [')'] > | - import_name< type='import' imp=any > + import_name< 'import' imp=any > """ def transform(self, node, results): imp = results['imp'] - mod_name = unicode(imp.children[0] if imp.type == syms.dotted_as_name \ - else imp) - - if mod_name.startswith('.'): - # Already a new-style import - return - - if not probably_a_local_import(mod_name, self.filename): - # I guess this is a global import -- skip it! - return - - if results['type'].value == 'from': + if node.type == syms.import_from: # Some imps are top-level (eg: 'import ham') # some are first level (eg: 'import ham.eggs') # some are third level (eg: 'import ham.eggs as spam') # Hence, the loop while not hasattr(imp, 'value'): imp = imp.children[0] - imp.value = "." + imp.value - node.changed() + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + return node else: - new = FromImport('.', getattr(imp, 'content', None) or [imp]) + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport('.', [imp]) new.set_prefix(node.get_prefix()) - node = new - return node + return new -def probably_a_local_import(imp_name, file_path): - # Must be stripped because the right space is included by the parser - imp_name = imp_name.split('.', 1)[0].strip() - base_path = dirname(file_path) - base_path = join(base_path, imp_name) - # If there is no __init__.py next to the file its not in a package - # so can't be a relative import. - if not exists(join(dirname(base_path), '__init__.py')): + def probably_a_local_import(self, imp_name): + imp_name = imp_name.split('.', 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False + for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: + if exists(base_path + ext): + return True return False - for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: - if exists(base_path + ext): - return True - return False Modified: python/trunk/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_imports.py Sat Jan 3 17:34:02 2009 @@ -118,7 +118,7 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[(import_mod or mod_name).value] + new_name = self.mapping[import_mod.value] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, @@ -129,10 +129,8 @@ # line (e.g., "import StringIO, urlparse"). The problem is that I # can't figure out an easy way to make a pattern recognize the # keys of MAPPING randomly sprinkled in an import statement. - while True: - results = self.match(node) - if not results: - break + results = self.match(node) + if results: self.transform(node, results) else: # Replace usage of the module. Modified: python/trunk/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_long.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_long.py Sat Jan 3 17:34:02 2009 @@ -5,20 +5,18 @@ """ # Local imports -from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Number +from ..fixer_util import Name, Number, is_probably_builtin class FixLong(fixer_base.BaseFix): PATTERN = "'long'" - static_long = Name("long") static_int = Name("int") def transform(self, node, results): - assert node == self.static_long, node - new = self.static_int.clone() - new.set_prefix(node.get_prefix()) - return new + if is_probably_builtin(node): + new = self.static_int.clone() + new.set_prefix(node.get_prefix()) + return new Modified: python/trunk/Lib/lib2to3/main.py ============================================================================== --- python/trunk/Lib/lib2to3/main.py (original) +++ python/trunk/Lib/lib2to3/main.py Sat Jan 3 17:34:02 2009 @@ -41,7 +41,7 @@ super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) if not self.nobackups: - shutil.copymode(filename, backup) + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: Modified: python/trunk/Lib/lib2to3/refactor.py ============================================================================== --- python/trunk/Lib/lib2to3/refactor.py (original) +++ python/trunk/Lib/lib2to3/refactor.py Sat Jan 3 17:34:02 2009 @@ -287,17 +287,13 @@ Returns: True if the tree was modified, False otherwise. """ - # Two calls to chain are required because pre_order.values() - # will be a list of lists of fixers: - # [[, ], []] - all_fixers = chain(self.pre_order, self.post_order) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.start_tree(tree, name) self.traverse_by(self.pre_order_heads, tree.pre_order()) self.traverse_by(self.post_order_heads, tree.post_order()) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.finish_tree(tree, name) return tree.was_changed Modified: python/trunk/Lib/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/data/py3_test_grammar.py (original) +++ python/trunk/Lib/lib2to3/tests/data/py3_test_grammar.py Sat Jan 3 17:34:02 2009 @@ -485,6 +485,14 @@ global a, b global one, two, three, four, five, six, seven, eight, nine, ten + def testNonlocal(self): + # 'nonlocal' NAME (',' NAME)* + x = 0 + y = 0 + def f(): + nonlocal x + nonlocal x, y + def testAssert(self): # assert_stmt: 'assert' test [',' test] assert 1 Modified: python/trunk/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_fixers.py (original) +++ python/trunk/Lib/lib2to3/tests/test_fixers.py Sat Jan 3 17:34:02 2009 @@ -1073,11 +1073,72 @@ a = """z = type(x) in (int, int)""" self.check(b, a) + def test_unchanged(self): + s = """long = True""" + self.unchanged(s) + + s = """s.long = True""" + self.unchanged(s) + + s = """def long(): pass""" + self.unchanged(s) + + s = """class long(): pass""" + self.unchanged(s) + + s = """def f(long): pass""" + self.unchanged(s) + + s = """def f(g, long): pass""" + self.unchanged(s) + + s = """def f(x, long=True): pass""" + self.unchanged(s) + def test_prefix_preservation(self): b = """x = long( x )""" a = """x = int( x )""" self.check(b, a) + +class Test_execfile(FixerTestCase): + fixer = "execfile" + + def test_conversion(self): + b = """execfile("fn")""" + a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + self.check(b, a) + + b = """execfile("fn", glob, loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + self.check(b, a) + + b = """execfile("fn", locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob, locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + self.check(b, a) + + def test_spacing(self): + b = """execfile( "fn" )""" + a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", globals = glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + self.check(b, a) + + class Test_isinstance(FixerTestCase): fixer = "isinstance" @@ -3466,11 +3527,30 @@ a = "from . import foo, bar" self.check_both(b, a) + b = "import foo, bar, x" + a = "from . import foo, bar, x" + self.check_both(b, a) + + b = "import x, y, z" + a = "from . import x, y, z" + self.check_both(b, a) + def test_import_as(self): b = "import foo as x" a = "from . import foo as x" self.check_both(b, a) + b = "import a as b, b as c, c as d" + a = "from . import a as b, b as c, c as d" + self.check_both(b, a) + + def test_local_and_absolute(self): + self.always_exists = False + self.present_files = set(["foo.py", "__init__.py"]) + + s = "import foo, bar" + self.warns_unchanged(s, "absolute and local imports together") + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" From python-checkins at python.org Sat Jan 3 17:53:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 3 Jan 2009 17:53:14 +0100 (CET) Subject: [Python-checkins] r68198 - in python/branches/py3k: Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_execfile.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_long.py Lib/lib2to3/main.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/py3_test_grammar.py Lib/lib2to3/tests/test_fixers.py Message-ID: <20090103165314.5B55A1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 3 17:53:14 2009 New Revision: 68198 Log: Merged revisions 68197 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68197 | benjamin.peterson | 2009-01-03 10:34:02 -0600 (Sat, 03 Jan 2009) | 55 lines Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ ................ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/lib2to3/fixer_util.py python/branches/py3k/Lib/lib2to3/fixes/fix_execfile.py python/branches/py3k/Lib/lib2to3/fixes/fix_import.py python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py python/branches/py3k/Lib/lib2to3/fixes/fix_long.py python/branches/py3k/Lib/lib2to3/main.py python/branches/py3k/Lib/lib2to3/refactor.py python/branches/py3k/Lib/lib2to3/tests/data/py3_test_grammar.py python/branches/py3k/Lib/lib2to3/tests/test_fixers.py Modified: python/branches/py3k/Lib/lib2to3/fixer_util.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixer_util.py (original) +++ python/branches/py3k/Lib/lib2to3/fixer_util.py Sat Jan 3 17:53:14 2009 @@ -222,6 +222,29 @@ return True return False +def is_probably_builtin(node): + """ + Check that something isn't an attribute or function name etc. + """ + prev = node.get_prev_sibling() + if prev is not None and prev.type == token.DOT: + # Attribute lookup. + return False + parent = node.parent + if parent.type in (syms.funcdef, syms.classdef): + return False + if parent.type == syms.expr_stmt and parent.children[0] is node: + # Assignment. + return False + if parent.type == syms.parameters or \ + (parent.type == syms.typedargslist and ( + (prev is not None and prev.type == token.COMMA) or + parent.children[0] is node + )): + # The name of an argument. + return False + return True + ########################################################### ### The following functions are to find bindings in a suite ########################################################### Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_execfile.py Sat Jan 3 17:53:14 2009 @@ -7,9 +7,9 @@ exec() function. """ -from .. import pytree from .. import fixer_base -from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) class FixExecfile(fixer_base.BaseFix): @@ -22,16 +22,30 @@ def transform(self, node, results): assert results - syms = self.syms filename = results["filename"] globals = results.get("globals") locals = results.get("locals") - args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(), - Name('read'), LParen(), RParen()] - args[0].set_prefix("") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.set_prefix(" ") + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_import.py Sat Jan 3 17:53:14 2009 @@ -13,55 +13,78 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport, syms +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unkown node type") + class FixImport(fixer_base.BaseFix): PATTERN = """ - import_from< type='from' imp=any 'import' ['('] any [')'] > + import_from< 'from' imp=any 'import' ['('] any [')'] > | - import_name< type='import' imp=any > + import_name< 'import' imp=any > """ def transform(self, node, results): imp = results['imp'] - mod_name = str(imp.children[0] if imp.type == syms.dotted_as_name \ - else imp) - - if str(imp).startswith('.'): - # Already a new-style import - return - - if not probably_a_local_import(str(mod_name), self.filename): - # I guess this is a global import -- skip it! - return - - if results['type'].value == 'from': + if node.type == syms.import_from: # Some imps are top-level (eg: 'import ham') # some are first level (eg: 'import ham.eggs') # some are third level (eg: 'import ham.eggs as spam') # Hence, the loop while not hasattr(imp, 'value'): imp = imp.children[0] - imp.value = "." + imp.value - node.changed() + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + return node else: - new = FromImport('.', getattr(imp, 'content', None) or [imp]) + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport('.', [imp]) new.set_prefix(node.get_prefix()) - node = new - return node + return new -def probably_a_local_import(imp_name, file_path): - # Must be stripped because the right space is included by the parser - imp_name = imp_name.split('.', 1)[0].strip() - base_path = dirname(file_path) - base_path = join(base_path, imp_name) - # If there is no __init__.py next to the file its not in a package - # so can't be a relative import. - if not exists(join(dirname(base_path), '__init__.py')): + def probably_a_local_import(self, imp_name): + imp_name = imp_name.split('.', 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False + for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: + if exists(base_path + ext): + return True return False - for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: - if exists(base_path + ext): - return True - return False Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py Sat Jan 3 17:53:14 2009 @@ -118,7 +118,7 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[(import_mod or mod_name).value] + new_name = self.mapping[import_mod.value] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, @@ -129,10 +129,8 @@ # line (e.g., "import StringIO, urlparse"). The problem is that I # can't figure out an easy way to make a pattern recognize the # keys of MAPPING randomly sprinkled in an import statement. - while True: - results = self.match(node) - if not results: - break + results = self.match(node) + if results: self.transform(node, results) else: # Replace usage of the module. Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_long.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_long.py Sat Jan 3 17:53:14 2009 @@ -5,20 +5,18 @@ """ # Local imports -from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Number +from ..fixer_util import Name, Number, is_probably_builtin class FixLong(fixer_base.BaseFix): PATTERN = "'long'" - static_long = Name("long") static_int = Name("int") def transform(self, node, results): - assert node == self.static_long, node - new = self.static_int.clone() - new.set_prefix(node.get_prefix()) - return new + if is_probably_builtin(node): + new = self.static_int.clone() + new.set_prefix(node.get_prefix()) + return new Modified: python/branches/py3k/Lib/lib2to3/main.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/main.py (original) +++ python/branches/py3k/Lib/lib2to3/main.py Sat Jan 3 17:53:14 2009 @@ -41,7 +41,7 @@ super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) if not self.nobackups: - shutil.copymode(filename, backup) + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: Modified: python/branches/py3k/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/refactor.py (original) +++ python/branches/py3k/Lib/lib2to3/refactor.py Sat Jan 3 17:53:14 2009 @@ -287,17 +287,13 @@ Returns: True if the tree was modified, False otherwise. """ - # Two calls to chain are required because pre_order.values() - # will be a list of lists of fixers: - # [[, ], []] - all_fixers = chain(self.pre_order, self.post_order) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.start_tree(tree, name) self.traverse_by(self.pre_order_heads, tree.pre_order()) self.traverse_by(self.post_order_heads, tree.post_order()) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.finish_tree(tree, name) return tree.was_changed Modified: python/branches/py3k/Lib/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/data/py3_test_grammar.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/data/py3_test_grammar.py Sat Jan 3 17:53:14 2009 @@ -485,6 +485,14 @@ global a, b global one, two, three, four, five, six, seven, eight, nine, ten + def testNonlocal(self): + # 'nonlocal' NAME (',' NAME)* + x = 0 + y = 0 + def f(): + nonlocal x + nonlocal x, y + def testAssert(self): # assert_stmt: 'assert' test [',' test] assert 1 Modified: python/branches/py3k/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/test_fixers.py Sat Jan 3 17:53:14 2009 @@ -1073,11 +1073,72 @@ a = """z = type(x) in (int, int)""" self.check(b, a) + def test_unchanged(self): + s = """long = True""" + self.unchanged(s) + + s = """s.long = True""" + self.unchanged(s) + + s = """def long(): pass""" + self.unchanged(s) + + s = """class long(): pass""" + self.unchanged(s) + + s = """def f(long): pass""" + self.unchanged(s) + + s = """def f(g, long): pass""" + self.unchanged(s) + + s = """def f(x, long=True): pass""" + self.unchanged(s) + def test_prefix_preservation(self): b = """x = long( x )""" a = """x = int( x )""" self.check(b, a) + +class Test_execfile(FixerTestCase): + fixer = "execfile" + + def test_conversion(self): + b = """execfile("fn")""" + a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + self.check(b, a) + + b = """execfile("fn", glob, loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + self.check(b, a) + + b = """execfile("fn", locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob, locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + self.check(b, a) + + def test_spacing(self): + b = """execfile( "fn" )""" + a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", globals = glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + self.check(b, a) + + class Test_isinstance(FixerTestCase): fixer = "isinstance" @@ -3466,11 +3527,30 @@ a = "from . import foo, bar" self.check_both(b, a) + b = "import foo, bar, x" + a = "from . import foo, bar, x" + self.check_both(b, a) + + b = "import x, y, z" + a = "from . import x, y, z" + self.check_both(b, a) + def test_import_as(self): b = "import foo as x" a = "from . import foo as x" self.check_both(b, a) + b = "import a as b, b as c, c as d" + a = "from . import a as b, b as c, c as d" + self.check_both(b, a) + + def test_local_and_absolute(self): + self.always_exists = False + self.present_files = set(["foo.py", "__init__.py"]) + + s = "import foo, bar" + self.warns_unchanged(s, "absolute and local imports together") + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" From python-checkins at python.org Sat Jan 3 17:54:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 3 Jan 2009 17:54:29 +0100 (CET) Subject: [Python-checkins] r68199 - in python/branches/release26-maint: Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_execfile.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_long.py Lib/lib2to3/main.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/py3_test_grammar.py Lib/lib2to3/tests/test_fixers.py Message-ID: <20090103165429.4B3991E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 3 17:54:28 2009 New Revision: 68199 Log: Merged revisions 68197 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68197 | benjamin.peterson | 2009-01-03 10:34:02 -0600 (Sat, 03 Jan 2009) | 55 lines Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ ................ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/lib2to3/fixer_util.py python/branches/release26-maint/Lib/lib2to3/fixes/fix_execfile.py python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py python/branches/release26-maint/Lib/lib2to3/fixes/fix_long.py python/branches/release26-maint/Lib/lib2to3/main.py python/branches/release26-maint/Lib/lib2to3/refactor.py python/branches/release26-maint/Lib/lib2to3/tests/data/py3_test_grammar.py python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py Modified: python/branches/release26-maint/Lib/lib2to3/fixer_util.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixer_util.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixer_util.py Sat Jan 3 17:54:28 2009 @@ -222,6 +222,29 @@ return True return False +def is_probably_builtin(node): + """ + Check that something isn't an attribute or function name etc. + """ + prev = node.get_prev_sibling() + if prev is not None and prev.type == token.DOT: + # Attribute lookup. + return False + parent = node.parent + if parent.type in (syms.funcdef, syms.classdef): + return False + if parent.type == syms.expr_stmt and parent.children[0] is node: + # Assignment. + return False + if parent.type == syms.parameters or \ + (parent.type == syms.typedargslist and ( + (prev is not None and prev.type == token.COMMA) or + parent.children[0] is node + )): + # The name of an argument. + return False + return True + ########################################################### ### The following functions are to find bindings in a suite ########################################################### Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_execfile.py Sat Jan 3 17:54:28 2009 @@ -7,9 +7,9 @@ exec() function. """ -from .. import pytree from .. import fixer_base -from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) class FixExecfile(fixer_base.BaseFix): @@ -22,16 +22,30 @@ def transform(self, node, results): assert results - syms = self.syms filename = results["filename"] globals = results.get("globals") locals = results.get("locals") - args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(), - Name('read'), LParen(), RParen()] - args[0].set_prefix("") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.set_prefix(" ") + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py Sat Jan 3 17:54:28 2009 @@ -13,55 +13,78 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport, syms +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unkown node type") + class FixImport(fixer_base.BaseFix): PATTERN = """ - import_from< type='from' imp=any 'import' ['('] any [')'] > + import_from< 'from' imp=any 'import' ['('] any [')'] > | - import_name< type='import' imp=any > + import_name< 'import' imp=any > """ def transform(self, node, results): imp = results['imp'] - mod_name = unicode(imp.children[0] if imp.type == syms.dotted_as_name \ - else imp) - - if mod_name.startswith('.'): - # Already a new-style import - return - - if not probably_a_local_import(mod_name, self.filename): - # I guess this is a global import -- skip it! - return - - if results['type'].value == 'from': + if node.type == syms.import_from: # Some imps are top-level (eg: 'import ham') # some are first level (eg: 'import ham.eggs') # some are third level (eg: 'import ham.eggs as spam') # Hence, the loop while not hasattr(imp, 'value'): imp = imp.children[0] - imp.value = "." + imp.value - node.changed() + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + return node else: - new = FromImport('.', getattr(imp, 'content', None) or [imp]) + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport('.', [imp]) new.set_prefix(node.get_prefix()) - node = new - return node + return new -def probably_a_local_import(imp_name, file_path): - # Must be stripped because the right space is included by the parser - imp_name = imp_name.split('.', 1)[0].strip() - base_path = dirname(file_path) - base_path = join(base_path, imp_name) - # If there is no __init__.py next to the file its not in a package - # so can't be a relative import. - if not exists(join(dirname(base_path), '__init__.py')): + def probably_a_local_import(self, imp_name): + imp_name = imp_name.split('.', 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False + for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: + if exists(base_path + ext): + return True return False - for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: - if exists(base_path + ext): - return True - return False Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py Sat Jan 3 17:54:28 2009 @@ -118,7 +118,7 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[(import_mod or mod_name).value] + new_name = self.mapping[import_mod.value] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, @@ -129,10 +129,8 @@ # line (e.g., "import StringIO, urlparse"). The problem is that I # can't figure out an easy way to make a pattern recognize the # keys of MAPPING randomly sprinkled in an import statement. - while True: - results = self.match(node) - if not results: - break + results = self.match(node) + if results: self.transform(node, results) else: # Replace usage of the module. Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_long.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_long.py Sat Jan 3 17:54:28 2009 @@ -5,20 +5,18 @@ """ # Local imports -from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Number +from ..fixer_util import Name, Number, is_probably_builtin class FixLong(fixer_base.BaseFix): PATTERN = "'long'" - static_long = Name("long") static_int = Name("int") def transform(self, node, results): - assert node == self.static_long, node - new = self.static_int.clone() - new.set_prefix(node.get_prefix()) - return new + if is_probably_builtin(node): + new = self.static_int.clone() + new.set_prefix(node.get_prefix()) + return new Modified: python/branches/release26-maint/Lib/lib2to3/main.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/main.py (original) +++ python/branches/release26-maint/Lib/lib2to3/main.py Sat Jan 3 17:54:28 2009 @@ -41,7 +41,7 @@ super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) if not self.nobackups: - shutil.copymode(filename, backup) + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: Modified: python/branches/release26-maint/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/refactor.py (original) +++ python/branches/release26-maint/Lib/lib2to3/refactor.py Sat Jan 3 17:54:28 2009 @@ -287,17 +287,13 @@ Returns: True if the tree was modified, False otherwise. """ - # Two calls to chain are required because pre_order.values() - # will be a list of lists of fixers: - # [[, ], []] - all_fixers = chain(self.pre_order, self.post_order) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.start_tree(tree, name) self.traverse_by(self.pre_order_heads, tree.pre_order()) self.traverse_by(self.post_order_heads, tree.post_order()) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.finish_tree(tree, name) return tree.was_changed Modified: python/branches/release26-maint/Lib/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/tests/data/py3_test_grammar.py (original) +++ python/branches/release26-maint/Lib/lib2to3/tests/data/py3_test_grammar.py Sat Jan 3 17:54:28 2009 @@ -485,6 +485,14 @@ global a, b global one, two, three, four, five, six, seven, eight, nine, ten + def testNonlocal(self): + # 'nonlocal' NAME (',' NAME)* + x = 0 + y = 0 + def f(): + nonlocal x + nonlocal x, y + def testAssert(self): # assert_stmt: 'assert' test [',' test] assert 1 Modified: python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py Sat Jan 3 17:54:28 2009 @@ -1073,11 +1073,72 @@ a = """z = type(x) in (int, int)""" self.check(b, a) + def test_unchanged(self): + s = """long = True""" + self.unchanged(s) + + s = """s.long = True""" + self.unchanged(s) + + s = """def long(): pass""" + self.unchanged(s) + + s = """class long(): pass""" + self.unchanged(s) + + s = """def f(long): pass""" + self.unchanged(s) + + s = """def f(g, long): pass""" + self.unchanged(s) + + s = """def f(x, long=True): pass""" + self.unchanged(s) + def test_prefix_preservation(self): b = """x = long( x )""" a = """x = int( x )""" self.check(b, a) + +class Test_execfile(FixerTestCase): + fixer = "execfile" + + def test_conversion(self): + b = """execfile("fn")""" + a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + self.check(b, a) + + b = """execfile("fn", glob, loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + self.check(b, a) + + b = """execfile("fn", locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob, locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + self.check(b, a) + + def test_spacing(self): + b = """execfile( "fn" )""" + a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", globals = glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + self.check(b, a) + + class Test_isinstance(FixerTestCase): fixer = "isinstance" @@ -3466,11 +3527,30 @@ a = "from . import foo, bar" self.check_both(b, a) + b = "import foo, bar, x" + a = "from . import foo, bar, x" + self.check_both(b, a) + + b = "import x, y, z" + a = "from . import x, y, z" + self.check_both(b, a) + def test_import_as(self): b = "import foo as x" a = "from . import foo as x" self.check_both(b, a) + b = "import a as b, b as c, c as d" + a = "from . import a as b, b as c, c as d" + self.check_both(b, a) + + def test_local_and_absolute(self): + self.always_exists = False + self.present_files = set(["foo.py", "__init__.py"]) + + s = "import foo, bar" + self.warns_unchanged(s, "absolute and local imports together") + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" From python-checkins at python.org Sat Jan 3 17:59:18 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 17:59:18 +0100 (CET) Subject: [Python-checkins] r68200 - in python/branches/py3k: Include/object.h Lib/ctypes/test/test_pep3118.py Lib/test/test_io.py Lib/test/test_memoryview.py Lib/test/test_sys.py Misc/NEWS Objects/memoryobject.c Objects/unicodeobject.c Message-ID: <20090103165918.8AB9C1E4044@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 17:59:18 2009 New Revision: 68200 Log: Issue #4580: slicing of memoryviews when itemsize != 1 is wrong. Also fix len() to return number of items rather than length in bytes. I'm sorry it was not possible for me to work on this without reindenting a bit some stuff around. The indentation in memoryobject.c is a mess, I'll open a separate bug for it. Modified: python/branches/py3k/Include/object.h python/branches/py3k/Lib/ctypes/test/test_pep3118.py python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Lib/test/test_memoryview.py python/branches/py3k/Lib/test/test_sys.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/memoryobject.c python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Sat Jan 3 17:59:18 2009 @@ -144,16 +144,18 @@ typedef struct bufferinfo { void *buf; PyObject *obj; /* owned reference */ - Py_ssize_t len; - Py_ssize_t itemsize; /* This is Py_ssize_t so it can be - pointed to by strides in simple case.*/ - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + Py_ssize_t len; + Py_ssize_t itemsize; /* This is Py_ssize_t so it can be + pointed to by strides in simple case.*/ + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + Py_ssize_t smalltable[2]; /* static store for shape and strides of + mono-dimensional buffers. */ + void *internal; } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); Modified: python/branches/py3k/Lib/ctypes/test/test_pep3118.py ============================================================================== --- python/branches/py3k/Lib/ctypes/test/test_pep3118.py (original) +++ python/branches/py3k/Lib/ctypes/test/test_pep3118.py Sat Jan 3 17:59:18 2009 @@ -25,7 +25,10 @@ v = memoryview(ob) try: self.failUnlessEqual(normalize(v.format), normalize(fmt)) - self.failUnlessEqual(len(v), sizeof(ob)) + if shape is not None: + self.failUnlessEqual(len(v), shape[0]) + else: + self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block @@ -37,7 +40,7 @@ n = 1 for dim in v.shape: n = n * dim - self.failUnlessEqual(v.itemsize * n, len(v)) + self.failUnlessEqual(n * v.itemsize, len(v.tobytes())) except: # so that we can see the failing type print(tp) @@ -49,7 +52,10 @@ v = memoryview(ob) try: self.failUnlessEqual(v.format, fmt) - self.failUnlessEqual(len(v), sizeof(ob)) + if shape is not None: + self.failUnlessEqual(len(v), shape[0]) + else: + self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block @@ -61,7 +67,7 @@ n = 1 for dim in v.shape: n = n * dim - self.failUnlessEqual(v.itemsize * n, len(v)) + self.failUnlessEqual(n, len(v)) except: # so that we can see the failing type print(tp) Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Sat Jan 3 17:59:18 2009 @@ -260,7 +260,7 @@ def test_array_writes(self): a = array.array('i', range(10)) - n = len(memoryview(a)) + n = len(a.tostring()) f = io.open(support.TESTFN, "wb", 0) self.assertEqual(f.write(a), n) f.close() Modified: python/branches/py3k/Lib/test/test_memoryview.py ============================================================================== --- python/branches/py3k/Lib/test/test_memoryview.py (original) +++ python/branches/py3k/Lib/test/test_memoryview.py Sat Jan 3 17:59:18 2009 @@ -8,24 +8,30 @@ import sys import gc import weakref +import array -class CommonMemoryTests: - # - # Tests common to direct memoryviews and sliced memoryviews - # +class AbstractMemoryTests: + source_bytes = b"abcdef" - base_object = b"abcdef" + @property + def _source(self): + return self.source_bytes + + @property + def _types(self): + return filter(None, [self.ro_type, self.rw_type]) def check_getitem_with_type(self, tp): - b = tp(self.base_object) + item = self.getitem_type + b = tp(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) - self.assertEquals(m[0], b"a") + self.assertEquals(m[0], item(b"a")) self.assert_(isinstance(m[0], bytes), type(m[0])) - self.assertEquals(m[5], b"f") - self.assertEquals(m[-1], b"f") - self.assertEquals(m[-6], b"a") + self.assertEquals(m[5], item(b"f")) + self.assertEquals(m[-1], item(b"f")) + self.assertEquals(m[-6], item(b"a")) # Bounds checking self.assertRaises(IndexError, lambda: m[6]) self.assertRaises(IndexError, lambda: m[-7]) @@ -38,14 +44,14 @@ m = None self.assertEquals(sys.getrefcount(b), oldrefcount) - def test_getitem_readonly(self): - self.check_getitem_with_type(bytes) - - def test_getitem_writable(self): - self.check_getitem_with_type(bytearray) + def test_getitem(self): + for tp in self._types: + self.check_getitem_with_type(tp) def test_setitem_readonly(self): - b = self.base_object + if not self.ro_type: + return + b = self.ro_type(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) def setitem(value): @@ -57,27 +63,30 @@ self.assertEquals(sys.getrefcount(b), oldrefcount) def test_setitem_writable(self): - b = bytearray(self.base_object) + if not self.rw_type: + return + tp = self.rw_type + b = self.rw_type(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) - m[0] = b"0" - self._check_contents(b, b"0bcdef") - m[1:3] = b"12" - self._check_contents(b, b"012def") - m[1:1] = b"" - self._check_contents(b, b"012def") - m[:] = b"abcdef" - self._check_contents(b, b"abcdef") + m[0] = tp(b"0") + self._check_contents(tp, b, b"0bcdef") + m[1:3] = tp(b"12") + self._check_contents(tp, b, b"012def") + m[1:1] = tp(b"") + self._check_contents(tp, b, b"012def") + m[:] = tp(b"abcdef") + self._check_contents(tp, b, b"abcdef") # Overlapping copies of a view into itself m[0:3] = m[2:5] - self._check_contents(b, b"cdedef") - m[:] = b"abcdef" + self._check_contents(tp, b, b"cdedef") + m[:] = tp(b"abcdef") m[2:5] = m[0:3] - self._check_contents(b, b"ababcf") + self._check_contents(tp, b, b"ababcf") def setitem(key, value): - m[key] = value + m[key] = tp(value) # Bounds checking self.assertRaises(IndexError, setitem, 6, b"a") self.assertRaises(IndexError, setitem, -7, b"a") @@ -96,159 +105,224 @@ m = None self.assertEquals(sys.getrefcount(b), oldrefcount) - def test_len(self): - self.assertEquals(len(self._view(self.base_object)), 6) - def test_tobytes(self): - m = self._view(self.base_object) - b = m.tobytes() - self.assertEquals(b, b"abcdef") - self.assert_(isinstance(b, bytes), type(b)) + for tp in self._types: + m = self._view(tp(self._source)) + b = m.tobytes() + # This calls self.getitem_type() on each separate byte of b"abcdef" + expected = b"".join( + self.getitem_type(bytes([c])) for c in b"abcdef") + self.assertEquals(b, expected) + self.assert_(isinstance(b, bytes), type(b)) def test_tolist(self): - m = self._view(self.base_object) - l = m.tolist() - self.assertEquals(l, list(b"abcdef")) + for tp in self._types: + m = self._view(tp(self._source)) + l = m.tolist() + self.assertEquals(l, list(b"abcdef")) def test_compare(self): # memoryviews can compare for equality with other objects # having the buffer interface. - m = self._view(self.base_object) - for tp in (bytes, bytearray): - self.assertTrue(m == tp(b"abcdef")) - self.assertFalse(m != tp(b"abcdef")) - self.assertFalse(m == tp(b"abcde")) - self.assertTrue(m != tp(b"abcde")) - self.assertFalse(m == tp(b"abcde1")) - self.assertTrue(m != tp(b"abcde1")) - self.assertTrue(m == m) - self.assertTrue(m == m[:]) - self.assertTrue(m[0:6] == m[:]) - self.assertFalse(m[0:5] == m) - - # Comparison with objects which don't support the buffer API - self.assertFalse(m == "abc") - self.assertTrue(m != "abc") - self.assertFalse("abc" == m) - self.assertTrue("abc" != m) - - # Unordered comparisons - for c in (m, b"abcdef"): - self.assertRaises(TypeError, lambda: m < c) - self.assertRaises(TypeError, lambda: c <= m) - self.assertRaises(TypeError, lambda: m >= c) - self.assertRaises(TypeError, lambda: c > m) + for tp in self._types: + m = self._view(tp(self._source)) + for tp_comp in self._types: + self.assertTrue(m == tp_comp(b"abcdef")) + self.assertFalse(m != tp_comp(b"abcdef")) + self.assertFalse(m == tp_comp(b"abcde")) + self.assertTrue(m != tp_comp(b"abcde")) + self.assertFalse(m == tp_comp(b"abcde1")) + self.assertTrue(m != tp_comp(b"abcde1")) + self.assertTrue(m == m) + self.assertTrue(m == m[:]) + self.assertTrue(m[0:6] == m[:]) + self.assertFalse(m[0:5] == m) + + # Comparison with objects which don't support the buffer API + self.assertFalse(m == "abcdef") + self.assertTrue(m != "abcdef") + self.assertFalse("abcdef" == m) + self.assertTrue("abcdef" != m) + + # Unordered comparisons + for c in (m, b"abcdef"): + self.assertRaises(TypeError, lambda: m < c) + self.assertRaises(TypeError, lambda: c <= m) + self.assertRaises(TypeError, lambda: m >= c) + self.assertRaises(TypeError, lambda: c > m) def check_attributes_with_type(self, tp): - b = tp(self.base_object) - m = self._view(b) - self.assertEquals(m.format, 'B') - self.assertEquals(m.itemsize, 1) + m = self._view(tp(self._source)) + self.assertEquals(m.format, self.format) + self.assertEquals(m.itemsize, self.itemsize) self.assertEquals(m.ndim, 1) self.assertEquals(m.shape, (6,)) self.assertEquals(len(m), 6) - self.assertEquals(m.strides, (1,)) + self.assertEquals(m.strides, (self.itemsize,)) self.assertEquals(m.suboffsets, None) return m def test_attributes_readonly(self): - m = self.check_attributes_with_type(bytes) + if not self.ro_type: + return + m = self.check_attributes_with_type(self.ro_type) self.assertEquals(m.readonly, True) def test_attributes_writable(self): - m = self.check_attributes_with_type(bytearray) + if not self.rw_type: + return + m = self.check_attributes_with_type(self.rw_type) self.assertEquals(m.readonly, False) def test_getbuffer(self): # Test PyObject_GetBuffer() on a memoryview object. - b = self.base_object - oldrefcount = sys.getrefcount(b) - m = self._view(b) - oldviewrefcount = sys.getrefcount(m) - s = str(m, "utf-8") - self._check_contents(b, s.encode("utf-8")) - self.assertEquals(sys.getrefcount(m), oldviewrefcount) - m = None - self.assertEquals(sys.getrefcount(b), oldrefcount) + for tp in self._types: + b = tp(self._source) + oldrefcount = sys.getrefcount(b) + m = self._view(b) + oldviewrefcount = sys.getrefcount(m) + s = str(m, "utf-8") + self._check_contents(tp, b, s.encode("utf-8")) + self.assertEquals(sys.getrefcount(m), oldviewrefcount) + m = None + self.assertEquals(sys.getrefcount(b), oldrefcount) def test_gc(self): - class MyBytes(bytes): - pass - class MyObject: - pass + for tp in self._types: + if not isinstance(tp, type): + # If tp is a factory rather than a plain type, skip + continue + + class MySource(tp): + pass + class MyObject: + pass + + # Create a reference cycle through a memoryview object + b = MySource(tp(b'abc')) + m = self._view(b) + o = MyObject() + b.m = m + b.o = o + wr = weakref.ref(o) + b = m = o = None + # The cycle must be broken + gc.collect() + self.assert_(wr() is None, wr()) + + +# Variations on source objects for the buffer: bytes-like objects, then arrays +# with itemsize > 1. +# NOTE: support for multi-dimensional objects is unimplemented. + +class BaseBytesMemoryTests(AbstractMemoryTests): + ro_type = bytes + rw_type = bytearray + getitem_type = bytes + itemsize = 1 + format = 'B' + +class BaseArrayMemoryTests(AbstractMemoryTests): + ro_type = None + rw_type = lambda self, b: array.array('i', list(b)) + getitem_type = lambda self, b: array.array('i', list(b)).tostring() + itemsize = array.array('i').itemsize + format = 'i' - # Create a reference cycle through a memoryview object - b = MyBytes(b'abc') - m = self._view(b) - o = MyObject() - b.m = m - b.o = o - wr = weakref.ref(o) - b = m = o = None - # The cycle must be broken - gc.collect() - self.assert_(wr() is None, wr()) + def test_getbuffer(self): + # XXX Test should be adapted for non-byte buffers + pass + + def test_tolist(self): + # XXX NotImplementedError: tolist() only supports byte views + pass -class MemoryviewTest(unittest.TestCase, CommonMemoryTests): +# Variations on indirection levels: memoryview, slice of memoryview, +# slice of slice of memoryview. +# This is important to test allocation subtleties. +class BaseMemoryviewTests: def _view(self, obj): return memoryview(obj) - def _check_contents(self, obj, contents): - self.assertEquals(obj, contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj, tp(contents)) - def test_constructor(self): - ob = b'test' - self.assert_(memoryview(ob)) - self.assert_(memoryview(object=ob)) - self.assertRaises(TypeError, memoryview) - self.assertRaises(TypeError, memoryview, ob, ob) - self.assertRaises(TypeError, memoryview, argument=ob) - self.assertRaises(TypeError, memoryview, ob, argument=True) - - def test_array_assign(self): - # Issue #4569: segfault when mutating a memoryview with itemsize != 1 - from array import array - a = array('i', range(10)) - m = memoryview(a) - new_a = array('i', range(9, -1, -1)) - m[:] = new_a - self.assertEquals(a, new_a) - - -class MemorySliceTest(unittest.TestCase, CommonMemoryTests): - base_object = b"XabcdefY" +class BaseMemorySliceTests: + source_bytes = b"XabcdefY" def _view(self, obj): m = memoryview(obj) return m[1:7] - def _check_contents(self, obj, contents): - self.assertEquals(obj[1:7], contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj[1:7], tp(contents)) def test_refs(self): - m = memoryview(b"ab") - oldrefcount = sys.getrefcount(m) - m[1:2] - self.assertEquals(sys.getrefcount(m), oldrefcount) - + for tp in self._types: + m = memoryview(tp(self._source)) + oldrefcount = sys.getrefcount(m) + m[1:2] + self.assertEquals(sys.getrefcount(m), oldrefcount) -class MemorySliceSliceTest(unittest.TestCase, CommonMemoryTests): - base_object = b"XabcdefY" +class BaseMemorySliceSliceTests: + source_bytes = b"XabcdefY" def _view(self, obj): m = memoryview(obj) return m[:7][1:] - def _check_contents(self, obj, contents): - self.assertEquals(obj[1:7], contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj[1:7], tp(contents)) -def test_main(): - test.support.run_unittest( - MemoryviewTest, MemorySliceTest, MemorySliceSliceTest) +# Concrete test classes + +class BytesMemoryviewTest(unittest.TestCase, + BaseMemoryviewTests, BaseBytesMemoryTests): + + def test_constructor(self): + for tp in self._types: + ob = tp(self._source) + self.assert_(memoryview(ob)) + self.assert_(memoryview(object=ob)) + self.assertRaises(TypeError, memoryview) + self.assertRaises(TypeError, memoryview, ob, ob) + self.assertRaises(TypeError, memoryview, argument=ob) + self.assertRaises(TypeError, memoryview, ob, argument=True) + +class ArrayMemoryviewTest(unittest.TestCase, + BaseMemoryviewTests, BaseArrayMemoryTests): + + def test_array_assign(self): + # Issue #4569: segfault when mutating a memoryview with itemsize != 1 + a = array.array('i', range(10)) + m = memoryview(a) + new_a = array.array('i', range(9, -1, -1)) + m[:] = new_a + self.assertEquals(a, new_a) +class BytesMemorySliceTest(unittest.TestCase, + BaseMemorySliceTests, BaseBytesMemoryTests): + pass + +class ArrayMemorySliceTest(unittest.TestCase, + BaseMemorySliceTests, BaseArrayMemoryTests): + pass + +class BytesMemorySliceSliceTest(unittest.TestCase, + BaseMemorySliceSliceTests, BaseBytesMemoryTests): + pass + +class ArrayMemorySliceSliceTest(unittest.TestCase, + BaseMemorySliceSliceTests, BaseArrayMemoryTests): + pass + + +def test_main(): + test.support.run_unittest(__name__) + if __name__ == "__main__": test_main() 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 Sat Jan 3 17:59:18 2009 @@ -559,7 +559,7 @@ check(32768*32768-1, size(vh) + 2*self.H) check(32768*32768, size(vh) + 3*self.H) # memory - check(memoryview(b''), size(h + 'P PP2P2i5P')) + check(memoryview(b''), size(h + 'P PP2P2i7P')) # module check(unittest, size(h + '3P')) # None Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 17:59:18 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4580: Fix slicing of memoryviews when the item size is greater than + one byte. Also fixes the meaning of len() so that it returns the number of + items, rather than the size in bytes. + - Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4747: When the terminal does not use utf-8, executing a script with Modified: python/branches/py3k/Objects/memoryobject.c ============================================================================== --- python/branches/py3k/Objects/memoryobject.c (original) +++ python/branches/py3k/Objects/memoryobject.c Sat Jan 3 17:59:18 2009 @@ -3,26 +3,31 @@ #include "Python.h" -static void -dup_buffer(Py_buffer *dest, Py_buffer *src) -{ - *dest = *src; - if (src->shape == &(src->len)) - dest->shape = &(dest->len); - if (src->strides == &(src->itemsize)) - dest->strides = &(dest->itemsize); -} - -/* XXX The buffer API should mandate that the shape array be non-NULL, but - it would complicate some code since the (de)allocation semantics of shape - are not specified. */ static Py_ssize_t get_shape0(Py_buffer *buf) { if (buf->shape != NULL) return buf->shape[0]; - assert(buf->ndim == 1 && buf->itemsize > 0); - return buf->len / buf->itemsize; + if (buf->ndim == 0) + return 1; + PyErr_SetString(PyExc_TypeError, + "exported buffer does not have any shape information associated " + "to it"); + return -1; +} + +static void +dup_buffer(Py_buffer *dest, Py_buffer *src) +{ + *dest = *src; + if (src->ndim == 1 && src->shape != NULL) { + dest->shape = &(dest->smalltable[0]); + dest->shape[0] = get_shape0(src); + } + if (src->ndim == 1 && src->strides != NULL) { + dest->strides = &(dest->smalltable[1]); + dest->strides[0] = src->strides[0]; + } } static int @@ -449,8 +454,6 @@ return res; } - - static PyMethodDef memory_methods[] = { {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, @@ -474,19 +477,19 @@ PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), PyTuple_GET_ITEM(self->base,1)); - /* The view member should have readonly == -1 in - this instance indicating that the memory can - be "locked" and was locked and will be unlocked - again after this call. - */ - PyBuffer_Release(&(self->view)); - } - else { - PyBuffer_Release(&(self->view)); - } - Py_CLEAR(self->base); + /* The view member should have readonly == -1 in + this instance indicating that the memory can + be "locked" and was locked and will be unlocked + again after this call. + */ + PyBuffer_Release(&(self->view)); + } + else { + PyBuffer_Release(&(self->view)); } - PyObject_GC_Del(self); + Py_CLEAR(self->base); + } + PyObject_GC_Del(self); } static PyObject * @@ -512,16 +515,10 @@ } /* Sequence methods */ - static Py_ssize_t memory_length(PyMemoryViewObject *self) { - Py_buffer view; - - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return -1; - PyBuffer_Release(&view); - return view.len; + return get_shape0(&self->view); } /* @@ -589,40 +586,38 @@ } } else if (PySlice_Check(key)) { - Py_ssize_t start, stop, step, slicelength; - + Py_ssize_t start, stop, step, slicelength; + if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view), - &start, &stop, &step, &slicelength) < 0) { - return NULL; - } + &start, &stop, &step, &slicelength) < 0) { + return NULL; + } - if (step == 1 && view->ndim == 1) { - Py_buffer newview; - void *newbuf = (char *) view->buf - + start * view->itemsize; - int newflags = view->readonly - ? PyBUF_CONTIG_RO : PyBUF_CONTIG; + if (step == 1 && view->ndim == 1) { + Py_buffer newview; + void *newbuf = (char *) view->buf + + start * view->itemsize; + int newflags = view->readonly + ? PyBUF_CONTIG_RO : PyBUF_CONTIG; - /* XXX There should be an API to create a subbuffer */ - if (view->obj != NULL) { - if (PyObject_GetBuffer(view->obj, - &newview, newflags) == -1) - return NULL; - } - else { - newview = *view; - } - newview.buf = newbuf; - newview.len = slicelength; - newview.format = view->format; - if (view->shape == &(view->len)) - newview.shape = &(newview.len); - if (view->strides == &(view->itemsize)) - newview.strides = &(newview.itemsize); - return PyMemoryView_FromBuffer(&newview); - } - PyErr_SetNone(PyExc_NotImplementedError); - return NULL; + /* XXX There should be an API to create a subbuffer */ + if (view->obj != NULL) { + if (PyObject_GetBuffer(view->obj, &newview, newflags) == -1) + return NULL; + } + else { + newview = *view; + } + newview.buf = newbuf; + newview.len = slicelength * newview.itemsize; + newview.format = view->format; + newview.shape = &(newview.smalltable[0]); + newview.shape[0] = slicelength; + newview.strides = &(newview.itemsize); + return PyMemoryView_FromBuffer(&newview); + } + PyErr_SetNone(PyExc_NotImplementedError); + return NULL; } PyErr_Format(PyExc_TypeError, "cannot index memory using \"%.200s\"", @@ -747,7 +742,7 @@ if (vv.itemsize != ww.itemsize || vv.len != ww.len) goto _end; - equal = !memcmp(vv.buf, ww.buf, vv.len * vv.itemsize); + equal = !memcmp(vv.buf, ww.buf, vv.len); _end: PyBuffer_Release(&vv); Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat Jan 3 17:59:18 2009 @@ -1205,7 +1205,7 @@ /* Decode via the codec registry */ buffer = NULL; - if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_SIMPLE) < 0) + if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_FULL_RO) < 0) goto onError; buffer = PyMemoryView_FromBuffer(&info); if (buffer == NULL) From python-checkins at python.org Sat Jan 3 18:06:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 3 Jan 2009 18:06:28 +0100 (CET) Subject: [Python-checkins] r68201 - in python/branches/release30-maint/Lib/lib2to3: fixer_util.py fixes/fix_execfile.py fixes/fix_import.py fixes/fix_imports.py fixes/fix_long.py main.py refactor.py tests/data/py3_test_grammar.py tests/test_fixers.py Message-ID: <20090103170628.88F5E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 3 18:06:28 2009 New Revision: 68201 Log: Merged revisions 68198 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68198 | benjamin.peterson | 2009-01-03 10:53:14 -0600 (Sat, 03 Jan 2009) | 62 lines Merged revisions 68197 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68197 | benjamin.peterson | 2009-01-03 10:34:02 -0600 (Sat, 03 Jan 2009) | 55 lines Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ ................ ................ Modified: python/branches/release30-maint/Lib/lib2to3/fixer_util.py python/branches/release30-maint/Lib/lib2to3/fixes/fix_execfile.py python/branches/release30-maint/Lib/lib2to3/fixes/fix_import.py python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py python/branches/release30-maint/Lib/lib2to3/fixes/fix_long.py python/branches/release30-maint/Lib/lib2to3/main.py python/branches/release30-maint/Lib/lib2to3/refactor.py python/branches/release30-maint/Lib/lib2to3/tests/data/py3_test_grammar.py python/branches/release30-maint/Lib/lib2to3/tests/test_fixers.py Modified: python/branches/release30-maint/Lib/lib2to3/fixer_util.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixer_util.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixer_util.py Sat Jan 3 18:06:28 2009 @@ -222,6 +222,29 @@ return True return False +def is_probably_builtin(node): + """ + Check that something isn't an attribute or function name etc. + """ + prev = node.get_prev_sibling() + if prev is not None and prev.type == token.DOT: + # Attribute lookup. + return False + parent = node.parent + if parent.type in (syms.funcdef, syms.classdef): + return False + if parent.type == syms.expr_stmt and parent.children[0] is node: + # Assignment. + return False + if parent.type == syms.parameters or \ + (parent.type == syms.typedargslist and ( + (prev is not None and prev.type == token.COMMA) or + parent.children[0] is node + )): + # The name of an argument. + return False + return True + ########################################################### ### The following functions are to find bindings in a suite ########################################################### Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_execfile.py Sat Jan 3 18:06:28 2009 @@ -7,9 +7,9 @@ exec() function. """ -from .. import pytree from .. import fixer_base -from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) class FixExecfile(fixer_base.BaseFix): @@ -22,16 +22,30 @@ def transform(self, node, results): assert results - syms = self.syms filename = results["filename"] globals = results.get("globals") locals = results.get("locals") - args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(), - Name('read'), LParen(), RParen()] - args[0].set_prefix("") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.set_prefix(" ") + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_import.py Sat Jan 3 18:06:28 2009 @@ -13,55 +13,78 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport, syms +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unkown node type") + class FixImport(fixer_base.BaseFix): PATTERN = """ - import_from< type='from' imp=any 'import' ['('] any [')'] > + import_from< 'from' imp=any 'import' ['('] any [')'] > | - import_name< type='import' imp=any > + import_name< 'import' imp=any > """ def transform(self, node, results): imp = results['imp'] - mod_name = str(imp.children[0] if imp.type == syms.dotted_as_name \ - else imp) - - if str(imp).startswith('.'): - # Already a new-style import - return - - if not probably_a_local_import(str(mod_name), self.filename): - # I guess this is a global import -- skip it! - return - - if results['type'].value == 'from': + if node.type == syms.import_from: # Some imps are top-level (eg: 'import ham') # some are first level (eg: 'import ham.eggs') # some are third level (eg: 'import ham.eggs as spam') # Hence, the loop while not hasattr(imp, 'value'): imp = imp.children[0] - imp.value = "." + imp.value - node.changed() + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + return node else: - new = FromImport('.', getattr(imp, 'content', None) or [imp]) + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport('.', [imp]) new.set_prefix(node.get_prefix()) - node = new - return node + return new -def probably_a_local_import(imp_name, file_path): - # Must be stripped because the right space is included by the parser - imp_name = imp_name.split('.', 1)[0].strip() - base_path = dirname(file_path) - base_path = join(base_path, imp_name) - # If there is no __init__.py next to the file its not in a package - # so can't be a relative import. - if not exists(join(dirname(base_path), '__init__.py')): + def probably_a_local_import(self, imp_name): + imp_name = imp_name.split('.', 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False + for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: + if exists(base_path + ext): + return True return False - for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: - if exists(base_path + ext): - return True - return False Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py Sat Jan 3 18:06:28 2009 @@ -118,7 +118,7 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[(import_mod or mod_name).value] + new_name = self.mapping[import_mod.value] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, @@ -129,10 +129,8 @@ # line (e.g., "import StringIO, urlparse"). The problem is that I # can't figure out an easy way to make a pattern recognize the # keys of MAPPING randomly sprinkled in an import statement. - while True: - results = self.match(node) - if not results: - break + results = self.match(node) + if results: self.transform(node, results) else: # Replace usage of the module. Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_long.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_long.py Sat Jan 3 18:06:28 2009 @@ -5,20 +5,18 @@ """ # Local imports -from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Number +from ..fixer_util import Name, Number, is_probably_builtin class FixLong(fixer_base.BaseFix): PATTERN = "'long'" - static_long = Name("long") static_int = Name("int") def transform(self, node, results): - assert node == self.static_long, node - new = self.static_int.clone() - new.set_prefix(node.get_prefix()) - return new + if is_probably_builtin(node): + new = self.static_int.clone() + new.set_prefix(node.get_prefix()) + return new Modified: python/branches/release30-maint/Lib/lib2to3/main.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/main.py (original) +++ python/branches/release30-maint/Lib/lib2to3/main.py Sat Jan 3 18:06:28 2009 @@ -41,7 +41,7 @@ super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) if not self.nobackups: - shutil.copymode(filename, backup) + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: Modified: python/branches/release30-maint/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/refactor.py (original) +++ python/branches/release30-maint/Lib/lib2to3/refactor.py Sat Jan 3 18:06:28 2009 @@ -287,17 +287,13 @@ Returns: True if the tree was modified, False otherwise. """ - # Two calls to chain are required because pre_order.values() - # will be a list of lists of fixers: - # [[, ], []] - all_fixers = chain(self.pre_order, self.post_order) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.start_tree(tree, name) self.traverse_by(self.pre_order_heads, tree.pre_order()) self.traverse_by(self.post_order_heads, tree.post_order()) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.finish_tree(tree, name) return tree.was_changed Modified: python/branches/release30-maint/Lib/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/tests/data/py3_test_grammar.py (original) +++ python/branches/release30-maint/Lib/lib2to3/tests/data/py3_test_grammar.py Sat Jan 3 18:06:28 2009 @@ -485,6 +485,14 @@ global a, b global one, two, three, four, five, six, seven, eight, nine, ten + def testNonlocal(self): + # 'nonlocal' NAME (',' NAME)* + x = 0 + y = 0 + def f(): + nonlocal x + nonlocal x, y + def testAssert(self): # assert_stmt: 'assert' test [',' test] assert 1 Modified: python/branches/release30-maint/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/release30-maint/Lib/lib2to3/tests/test_fixers.py Sat Jan 3 18:06:28 2009 @@ -1073,11 +1073,72 @@ a = """z = type(x) in (int, int)""" self.check(b, a) + def test_unchanged(self): + s = """long = True""" + self.unchanged(s) + + s = """s.long = True""" + self.unchanged(s) + + s = """def long(): pass""" + self.unchanged(s) + + s = """class long(): pass""" + self.unchanged(s) + + s = """def f(long): pass""" + self.unchanged(s) + + s = """def f(g, long): pass""" + self.unchanged(s) + + s = """def f(x, long=True): pass""" + self.unchanged(s) + def test_prefix_preservation(self): b = """x = long( x )""" a = """x = int( x )""" self.check(b, a) + +class Test_execfile(FixerTestCase): + fixer = "execfile" + + def test_conversion(self): + b = """execfile("fn")""" + a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + self.check(b, a) + + b = """execfile("fn", glob, loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + self.check(b, a) + + b = """execfile("fn", locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob, locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + self.check(b, a) + + def test_spacing(self): + b = """execfile( "fn" )""" + a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", globals = glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + self.check(b, a) + + class Test_isinstance(FixerTestCase): fixer = "isinstance" @@ -3466,11 +3527,30 @@ a = "from . import foo, bar" self.check_both(b, a) + b = "import foo, bar, x" + a = "from . import foo, bar, x" + self.check_both(b, a) + + b = "import x, y, z" + a = "from . import x, y, z" + self.check_both(b, a) + def test_import_as(self): b = "import foo as x" a = "from . import foo as x" self.check_both(b, a) + b = "import a as b, b as c, c as d" + a = "from . import a as b, b as c, c as d" + self.check_both(b, a) + + def test_local_and_absolute(self): + self.always_exists = False + self.present_files = set(["foo.py", "__init__.py"]) + + s = "import foo, bar" + self.warns_unchanged(s, "absolute and local imports together") + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" From python-checkins at python.org Sat Jan 3 18:10:06 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 18:10:06 +0100 (CET) Subject: [Python-checkins] r68202 - in python/branches/release30-maint: Include/object.h Lib/ctypes/test/test_pep3118.py Lib/test/test_io.py Lib/test/test_memoryview.py Lib/test/test_sys.py Misc/NEWS Objects/memoryobject.c Objects/unicodeobject.c Message-ID: <20090103171006.598291E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 18:10:05 2009 New Revision: 68202 Log: Merged revisions 68200 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68200 | antoine.pitrou | 2009-01-03 17:59:18 +0100 (sam., 03 janv. 2009) | 8 lines Issue #4580: slicing of memoryviews when itemsize != 1 is wrong. Also fix len() to return number of items rather than length in bytes. I'm sorry it was not possible for me to work on this without reindenting a bit some stuff around. The indentation in memoryobject.c is a mess, I'll open a separate bug for it. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/object.h python/branches/release30-maint/Lib/ctypes/test/test_pep3118.py python/branches/release30-maint/Lib/test/test_io.py python/branches/release30-maint/Lib/test/test_memoryview.py python/branches/release30-maint/Lib/test/test_sys.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/memoryobject.c python/branches/release30-maint/Objects/unicodeobject.c Modified: python/branches/release30-maint/Include/object.h ============================================================================== --- python/branches/release30-maint/Include/object.h (original) +++ python/branches/release30-maint/Include/object.h Sat Jan 3 18:10:05 2009 @@ -144,16 +144,18 @@ typedef struct bufferinfo { void *buf; PyObject *obj; /* owned reference */ - Py_ssize_t len; - Py_ssize_t itemsize; /* This is Py_ssize_t so it can be - pointed to by strides in simple case.*/ - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + Py_ssize_t len; + Py_ssize_t itemsize; /* This is Py_ssize_t so it can be + pointed to by strides in simple case.*/ + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + Py_ssize_t smalltable[2]; /* static store for shape and strides of + mono-dimensional buffers. */ + void *internal; } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); Modified: python/branches/release30-maint/Lib/ctypes/test/test_pep3118.py ============================================================================== --- python/branches/release30-maint/Lib/ctypes/test/test_pep3118.py (original) +++ python/branches/release30-maint/Lib/ctypes/test/test_pep3118.py Sat Jan 3 18:10:05 2009 @@ -25,7 +25,10 @@ v = memoryview(ob) try: self.failUnlessEqual(normalize(v.format), normalize(fmt)) - self.failUnlessEqual(len(v), sizeof(ob)) + if shape is not None: + self.failUnlessEqual(len(v), shape[0]) + else: + self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block @@ -37,7 +40,7 @@ n = 1 for dim in v.shape: n = n * dim - self.failUnlessEqual(v.itemsize * n, len(v)) + self.failUnlessEqual(n * v.itemsize, len(v.tobytes())) except: # so that we can see the failing type print(tp) @@ -49,7 +52,10 @@ v = memoryview(ob) try: self.failUnlessEqual(v.format, fmt) - self.failUnlessEqual(len(v), sizeof(ob)) + if shape is not None: + self.failUnlessEqual(len(v), shape[0]) + else: + self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block @@ -61,7 +67,7 @@ n = 1 for dim in v.shape: n = n * dim - self.failUnlessEqual(v.itemsize * n, len(v)) + self.failUnlessEqual(n, len(v)) except: # so that we can see the failing type print(tp) 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 Sat Jan 3 18:10:05 2009 @@ -260,7 +260,7 @@ def test_array_writes(self): a = array.array('i', range(10)) - n = len(memoryview(a)) + n = len(a.tostring()) f = io.open(support.TESTFN, "wb", 0) self.assertEqual(f.write(a), n) f.close() Modified: python/branches/release30-maint/Lib/test/test_memoryview.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_memoryview.py (original) +++ python/branches/release30-maint/Lib/test/test_memoryview.py Sat Jan 3 18:10:05 2009 @@ -8,24 +8,30 @@ import sys import gc import weakref +import array -class CommonMemoryTests: - # - # Tests common to direct memoryviews and sliced memoryviews - # +class AbstractMemoryTests: + source_bytes = b"abcdef" - base_object = b"abcdef" + @property + def _source(self): + return self.source_bytes + + @property + def _types(self): + return filter(None, [self.ro_type, self.rw_type]) def check_getitem_with_type(self, tp): - b = tp(self.base_object) + item = self.getitem_type + b = tp(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) - self.assertEquals(m[0], b"a") + self.assertEquals(m[0], item(b"a")) self.assert_(isinstance(m[0], bytes), type(m[0])) - self.assertEquals(m[5], b"f") - self.assertEquals(m[-1], b"f") - self.assertEquals(m[-6], b"a") + self.assertEquals(m[5], item(b"f")) + self.assertEquals(m[-1], item(b"f")) + self.assertEquals(m[-6], item(b"a")) # Bounds checking self.assertRaises(IndexError, lambda: m[6]) self.assertRaises(IndexError, lambda: m[-7]) @@ -38,14 +44,14 @@ m = None self.assertEquals(sys.getrefcount(b), oldrefcount) - def test_getitem_readonly(self): - self.check_getitem_with_type(bytes) - - def test_getitem_writable(self): - self.check_getitem_with_type(bytearray) + def test_getitem(self): + for tp in self._types: + self.check_getitem_with_type(tp) def test_setitem_readonly(self): - b = self.base_object + if not self.ro_type: + return + b = self.ro_type(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) def setitem(value): @@ -57,27 +63,30 @@ self.assertEquals(sys.getrefcount(b), oldrefcount) def test_setitem_writable(self): - b = bytearray(self.base_object) + if not self.rw_type: + return + tp = self.rw_type + b = self.rw_type(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) - m[0] = b"0" - self._check_contents(b, b"0bcdef") - m[1:3] = b"12" - self._check_contents(b, b"012def") - m[1:1] = b"" - self._check_contents(b, b"012def") - m[:] = b"abcdef" - self._check_contents(b, b"abcdef") + m[0] = tp(b"0") + self._check_contents(tp, b, b"0bcdef") + m[1:3] = tp(b"12") + self._check_contents(tp, b, b"012def") + m[1:1] = tp(b"") + self._check_contents(tp, b, b"012def") + m[:] = tp(b"abcdef") + self._check_contents(tp, b, b"abcdef") # Overlapping copies of a view into itself m[0:3] = m[2:5] - self._check_contents(b, b"cdedef") - m[:] = b"abcdef" + self._check_contents(tp, b, b"cdedef") + m[:] = tp(b"abcdef") m[2:5] = m[0:3] - self._check_contents(b, b"ababcf") + self._check_contents(tp, b, b"ababcf") def setitem(key, value): - m[key] = value + m[key] = tp(value) # Bounds checking self.assertRaises(IndexError, setitem, 6, b"a") self.assertRaises(IndexError, setitem, -7, b"a") @@ -96,159 +105,224 @@ m = None self.assertEquals(sys.getrefcount(b), oldrefcount) - def test_len(self): - self.assertEquals(len(self._view(self.base_object)), 6) - def test_tobytes(self): - m = self._view(self.base_object) - b = m.tobytes() - self.assertEquals(b, b"abcdef") - self.assert_(isinstance(b, bytes), type(b)) + for tp in self._types: + m = self._view(tp(self._source)) + b = m.tobytes() + # This calls self.getitem_type() on each separate byte of b"abcdef" + expected = b"".join( + self.getitem_type(bytes([c])) for c in b"abcdef") + self.assertEquals(b, expected) + self.assert_(isinstance(b, bytes), type(b)) def test_tolist(self): - m = self._view(self.base_object) - l = m.tolist() - self.assertEquals(l, list(b"abcdef")) + for tp in self._types: + m = self._view(tp(self._source)) + l = m.tolist() + self.assertEquals(l, list(b"abcdef")) def test_compare(self): # memoryviews can compare for equality with other objects # having the buffer interface. - m = self._view(self.base_object) - for tp in (bytes, bytearray): - self.assertTrue(m == tp(b"abcdef")) - self.assertFalse(m != tp(b"abcdef")) - self.assertFalse(m == tp(b"abcde")) - self.assertTrue(m != tp(b"abcde")) - self.assertFalse(m == tp(b"abcde1")) - self.assertTrue(m != tp(b"abcde1")) - self.assertTrue(m == m) - self.assertTrue(m == m[:]) - self.assertTrue(m[0:6] == m[:]) - self.assertFalse(m[0:5] == m) - - # Comparison with objects which don't support the buffer API - self.assertFalse(m == "abc") - self.assertTrue(m != "abc") - self.assertFalse("abc" == m) - self.assertTrue("abc" != m) - - # Unordered comparisons - for c in (m, b"abcdef"): - self.assertRaises(TypeError, lambda: m < c) - self.assertRaises(TypeError, lambda: c <= m) - self.assertRaises(TypeError, lambda: m >= c) - self.assertRaises(TypeError, lambda: c > m) + for tp in self._types: + m = self._view(tp(self._source)) + for tp_comp in self._types: + self.assertTrue(m == tp_comp(b"abcdef")) + self.assertFalse(m != tp_comp(b"abcdef")) + self.assertFalse(m == tp_comp(b"abcde")) + self.assertTrue(m != tp_comp(b"abcde")) + self.assertFalse(m == tp_comp(b"abcde1")) + self.assertTrue(m != tp_comp(b"abcde1")) + self.assertTrue(m == m) + self.assertTrue(m == m[:]) + self.assertTrue(m[0:6] == m[:]) + self.assertFalse(m[0:5] == m) + + # Comparison with objects which don't support the buffer API + self.assertFalse(m == "abcdef") + self.assertTrue(m != "abcdef") + self.assertFalse("abcdef" == m) + self.assertTrue("abcdef" != m) + + # Unordered comparisons + for c in (m, b"abcdef"): + self.assertRaises(TypeError, lambda: m < c) + self.assertRaises(TypeError, lambda: c <= m) + self.assertRaises(TypeError, lambda: m >= c) + self.assertRaises(TypeError, lambda: c > m) def check_attributes_with_type(self, tp): - b = tp(self.base_object) - m = self._view(b) - self.assertEquals(m.format, 'B') - self.assertEquals(m.itemsize, 1) + m = self._view(tp(self._source)) + self.assertEquals(m.format, self.format) + self.assertEquals(m.itemsize, self.itemsize) self.assertEquals(m.ndim, 1) self.assertEquals(m.shape, (6,)) self.assertEquals(len(m), 6) - self.assertEquals(m.strides, (1,)) + self.assertEquals(m.strides, (self.itemsize,)) self.assertEquals(m.suboffsets, None) return m def test_attributes_readonly(self): - m = self.check_attributes_with_type(bytes) + if not self.ro_type: + return + m = self.check_attributes_with_type(self.ro_type) self.assertEquals(m.readonly, True) def test_attributes_writable(self): - m = self.check_attributes_with_type(bytearray) + if not self.rw_type: + return + m = self.check_attributes_with_type(self.rw_type) self.assertEquals(m.readonly, False) def test_getbuffer(self): # Test PyObject_GetBuffer() on a memoryview object. - b = self.base_object - oldrefcount = sys.getrefcount(b) - m = self._view(b) - oldviewrefcount = sys.getrefcount(m) - s = str(m, "utf-8") - self._check_contents(b, s.encode("utf-8")) - self.assertEquals(sys.getrefcount(m), oldviewrefcount) - m = None - self.assertEquals(sys.getrefcount(b), oldrefcount) + for tp in self._types: + b = tp(self._source) + oldrefcount = sys.getrefcount(b) + m = self._view(b) + oldviewrefcount = sys.getrefcount(m) + s = str(m, "utf-8") + self._check_contents(tp, b, s.encode("utf-8")) + self.assertEquals(sys.getrefcount(m), oldviewrefcount) + m = None + self.assertEquals(sys.getrefcount(b), oldrefcount) def test_gc(self): - class MyBytes(bytes): - pass - class MyObject: - pass + for tp in self._types: + if not isinstance(tp, type): + # If tp is a factory rather than a plain type, skip + continue + + class MySource(tp): + pass + class MyObject: + pass + + # Create a reference cycle through a memoryview object + b = MySource(tp(b'abc')) + m = self._view(b) + o = MyObject() + b.m = m + b.o = o + wr = weakref.ref(o) + b = m = o = None + # The cycle must be broken + gc.collect() + self.assert_(wr() is None, wr()) + + +# Variations on source objects for the buffer: bytes-like objects, then arrays +# with itemsize > 1. +# NOTE: support for multi-dimensional objects is unimplemented. + +class BaseBytesMemoryTests(AbstractMemoryTests): + ro_type = bytes + rw_type = bytearray + getitem_type = bytes + itemsize = 1 + format = 'B' + +class BaseArrayMemoryTests(AbstractMemoryTests): + ro_type = None + rw_type = lambda self, b: array.array('i', list(b)) + getitem_type = lambda self, b: array.array('i', list(b)).tostring() + itemsize = array.array('i').itemsize + format = 'i' - # Create a reference cycle through a memoryview object - b = MyBytes(b'abc') - m = self._view(b) - o = MyObject() - b.m = m - b.o = o - wr = weakref.ref(o) - b = m = o = None - # The cycle must be broken - gc.collect() - self.assert_(wr() is None, wr()) + def test_getbuffer(self): + # XXX Test should be adapted for non-byte buffers + pass + + def test_tolist(self): + # XXX NotImplementedError: tolist() only supports byte views + pass -class MemoryviewTest(unittest.TestCase, CommonMemoryTests): +# Variations on indirection levels: memoryview, slice of memoryview, +# slice of slice of memoryview. +# This is important to test allocation subtleties. +class BaseMemoryviewTests: def _view(self, obj): return memoryview(obj) - def _check_contents(self, obj, contents): - self.assertEquals(obj, contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj, tp(contents)) - def test_constructor(self): - ob = b'test' - self.assert_(memoryview(ob)) - self.assert_(memoryview(object=ob)) - self.assertRaises(TypeError, memoryview) - self.assertRaises(TypeError, memoryview, ob, ob) - self.assertRaises(TypeError, memoryview, argument=ob) - self.assertRaises(TypeError, memoryview, ob, argument=True) - - def test_array_assign(self): - # Issue #4569: segfault when mutating a memoryview with itemsize != 1 - from array import array - a = array('i', range(10)) - m = memoryview(a) - new_a = array('i', range(9, -1, -1)) - m[:] = new_a - self.assertEquals(a, new_a) - - -class MemorySliceTest(unittest.TestCase, CommonMemoryTests): - base_object = b"XabcdefY" +class BaseMemorySliceTests: + source_bytes = b"XabcdefY" def _view(self, obj): m = memoryview(obj) return m[1:7] - def _check_contents(self, obj, contents): - self.assertEquals(obj[1:7], contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj[1:7], tp(contents)) def test_refs(self): - m = memoryview(b"ab") - oldrefcount = sys.getrefcount(m) - m[1:2] - self.assertEquals(sys.getrefcount(m), oldrefcount) - + for tp in self._types: + m = memoryview(tp(self._source)) + oldrefcount = sys.getrefcount(m) + m[1:2] + self.assertEquals(sys.getrefcount(m), oldrefcount) -class MemorySliceSliceTest(unittest.TestCase, CommonMemoryTests): - base_object = b"XabcdefY" +class BaseMemorySliceSliceTests: + source_bytes = b"XabcdefY" def _view(self, obj): m = memoryview(obj) return m[:7][1:] - def _check_contents(self, obj, contents): - self.assertEquals(obj[1:7], contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj[1:7], tp(contents)) -def test_main(): - test.support.run_unittest( - MemoryviewTest, MemorySliceTest, MemorySliceSliceTest) +# Concrete test classes + +class BytesMemoryviewTest(unittest.TestCase, + BaseMemoryviewTests, BaseBytesMemoryTests): + + def test_constructor(self): + for tp in self._types: + ob = tp(self._source) + self.assert_(memoryview(ob)) + self.assert_(memoryview(object=ob)) + self.assertRaises(TypeError, memoryview) + self.assertRaises(TypeError, memoryview, ob, ob) + self.assertRaises(TypeError, memoryview, argument=ob) + self.assertRaises(TypeError, memoryview, ob, argument=True) + +class ArrayMemoryviewTest(unittest.TestCase, + BaseMemoryviewTests, BaseArrayMemoryTests): + + def test_array_assign(self): + # Issue #4569: segfault when mutating a memoryview with itemsize != 1 + a = array.array('i', range(10)) + m = memoryview(a) + new_a = array.array('i', range(9, -1, -1)) + m[:] = new_a + self.assertEquals(a, new_a) +class BytesMemorySliceTest(unittest.TestCase, + BaseMemorySliceTests, BaseBytesMemoryTests): + pass + +class ArrayMemorySliceTest(unittest.TestCase, + BaseMemorySliceTests, BaseArrayMemoryTests): + pass + +class BytesMemorySliceSliceTest(unittest.TestCase, + BaseMemorySliceSliceTests, BaseBytesMemoryTests): + pass + +class ArrayMemorySliceSliceTest(unittest.TestCase, + BaseMemorySliceSliceTests, BaseArrayMemoryTests): + pass + + +def test_main(): + test.support.run_unittest(__name__) + if __name__ == "__main__": test_main() Modified: python/branches/release30-maint/Lib/test/test_sys.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_sys.py (original) +++ python/branches/release30-maint/Lib/test/test_sys.py Sat Jan 3 18:10:05 2009 @@ -559,7 +559,7 @@ check(32768*32768-1, size(vh) + 2*self.H) check(32768*32768, size(vh) + 3*self.H) # memory - check(memoryview(b''), size(h + 'P PP2P2i5P')) + check(memoryview(b''), size(h + 'P PP2P2i7P')) # module check(unittest, size(h + '3P')) # None Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 3 18:10:05 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4580: Fix slicing of memoryviews when the item size is greater than + one byte. Also fixes the meaning of len() so that it returns the number of + items, rather than the size in bytes. + - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. Modified: python/branches/release30-maint/Objects/memoryobject.c ============================================================================== --- python/branches/release30-maint/Objects/memoryobject.c (original) +++ python/branches/release30-maint/Objects/memoryobject.c Sat Jan 3 18:10:05 2009 @@ -3,26 +3,31 @@ #include "Python.h" -static void -dup_buffer(Py_buffer *dest, Py_buffer *src) -{ - *dest = *src; - if (src->shape == &(src->len)) - dest->shape = &(dest->len); - if (src->strides == &(src->itemsize)) - dest->strides = &(dest->itemsize); -} - -/* XXX The buffer API should mandate that the shape array be non-NULL, but - it would complicate some code since the (de)allocation semantics of shape - are not specified. */ static Py_ssize_t get_shape0(Py_buffer *buf) { if (buf->shape != NULL) return buf->shape[0]; - assert(buf->ndim == 1 && buf->itemsize > 0); - return buf->len / buf->itemsize; + if (buf->ndim == 0) + return 1; + PyErr_SetString(PyExc_TypeError, + "exported buffer does not have any shape information associated " + "to it"); + return -1; +} + +static void +dup_buffer(Py_buffer *dest, Py_buffer *src) +{ + *dest = *src; + if (src->ndim == 1 && src->shape != NULL) { + dest->shape = &(dest->smalltable[0]); + dest->shape[0] = get_shape0(src); + } + if (src->ndim == 1 && src->strides != NULL) { + dest->strides = &(dest->smalltable[1]); + dest->strides[0] = src->strides[0]; + } } static int @@ -449,8 +454,6 @@ return res; } - - static PyMethodDef memory_methods[] = { {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, @@ -474,19 +477,19 @@ PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), PyTuple_GET_ITEM(self->base,1)); - /* The view member should have readonly == -1 in - this instance indicating that the memory can - be "locked" and was locked and will be unlocked - again after this call. - */ - PyBuffer_Release(&(self->view)); - } - else { - PyBuffer_Release(&(self->view)); - } - Py_CLEAR(self->base); + /* The view member should have readonly == -1 in + this instance indicating that the memory can + be "locked" and was locked and will be unlocked + again after this call. + */ + PyBuffer_Release(&(self->view)); + } + else { + PyBuffer_Release(&(self->view)); } - PyObject_GC_Del(self); + Py_CLEAR(self->base); + } + PyObject_GC_Del(self); } static PyObject * @@ -512,16 +515,10 @@ } /* Sequence methods */ - static Py_ssize_t memory_length(PyMemoryViewObject *self) { - Py_buffer view; - - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return -1; - PyBuffer_Release(&view); - return view.len; + return get_shape0(&self->view); } /* @@ -589,40 +586,38 @@ } } else if (PySlice_Check(key)) { - Py_ssize_t start, stop, step, slicelength; - + Py_ssize_t start, stop, step, slicelength; + if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view), - &start, &stop, &step, &slicelength) < 0) { - return NULL; - } + &start, &stop, &step, &slicelength) < 0) { + return NULL; + } - if (step == 1 && view->ndim == 1) { - Py_buffer newview; - void *newbuf = (char *) view->buf - + start * view->itemsize; - int newflags = view->readonly - ? PyBUF_CONTIG_RO : PyBUF_CONTIG; + if (step == 1 && view->ndim == 1) { + Py_buffer newview; + void *newbuf = (char *) view->buf + + start * view->itemsize; + int newflags = view->readonly + ? PyBUF_CONTIG_RO : PyBUF_CONTIG; - /* XXX There should be an API to create a subbuffer */ - if (view->obj != NULL) { - if (PyObject_GetBuffer(view->obj, - &newview, newflags) == -1) - return NULL; - } - else { - newview = *view; - } - newview.buf = newbuf; - newview.len = slicelength; - newview.format = view->format; - if (view->shape == &(view->len)) - newview.shape = &(newview.len); - if (view->strides == &(view->itemsize)) - newview.strides = &(newview.itemsize); - return PyMemoryView_FromBuffer(&newview); - } - PyErr_SetNone(PyExc_NotImplementedError); - return NULL; + /* XXX There should be an API to create a subbuffer */ + if (view->obj != NULL) { + if (PyObject_GetBuffer(view->obj, &newview, newflags) == -1) + return NULL; + } + else { + newview = *view; + } + newview.buf = newbuf; + newview.len = slicelength * newview.itemsize; + newview.format = view->format; + newview.shape = &(newview.smalltable[0]); + newview.shape[0] = slicelength; + newview.strides = &(newview.itemsize); + return PyMemoryView_FromBuffer(&newview); + } + PyErr_SetNone(PyExc_NotImplementedError); + return NULL; } PyErr_Format(PyExc_TypeError, "cannot index memory using \"%.200s\"", @@ -747,7 +742,7 @@ if (vv.itemsize != ww.itemsize || vv.len != ww.len) goto _end; - equal = !memcmp(vv.buf, ww.buf, vv.len * vv.itemsize); + equal = !memcmp(vv.buf, ww.buf, vv.len); _end: PyBuffer_Release(&vv); Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Sat Jan 3 18:10:05 2009 @@ -1203,7 +1203,7 @@ /* Decode via the codec registry */ buffer = NULL; - if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_SIMPLE) < 0) + if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_FULL_RO) < 0) goto onError; buffer = PyMemoryView_FromBuffer(&info); if (buffer == NULL) From python-checkins at python.org Sat Jan 3 18:19:27 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 3 Jan 2009 18:19:27 +0100 (CET) Subject: [Python-checkins] r68203 - in python/trunk: Doc/c-api/sys.rst Doc/data/refcounts.dat Makefile.pre.in Misc/NEWS PC/VC6/pythoncore.dsp PC/VS7.1/pythoncore.vcproj PC/VS8.0/pythoncore.vcproj PC/os2emx/Makefile PC/os2emx/python27.def PC/os2vacpp/makefile PC/os2vacpp/makefile.omk PC/os2vacpp/python.def PCbuild/pythoncore.vcproj Python/getmtime.c Python/import.c RISCOS/Makefile RISCOS/Python/getmtime_riscos.c Message-ID: <20090103171927.1BDBB1E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 3 18:19:26 2009 New Revision: 68203 Log: Issue #4817: Remove unused function PyOS_GetLastModificationTime. Removed: python/trunk/Python/getmtime.c python/trunk/RISCOS/Python/getmtime_riscos.c Modified: python/trunk/Doc/c-api/sys.rst python/trunk/Doc/data/refcounts.dat python/trunk/Makefile.pre.in python/trunk/Misc/NEWS python/trunk/PC/VC6/pythoncore.dsp python/trunk/PC/VS7.1/pythoncore.vcproj python/trunk/PC/VS8.0/pythoncore.vcproj python/trunk/PC/os2emx/Makefile python/trunk/PC/os2emx/python27.def python/trunk/PC/os2vacpp/makefile python/trunk/PC/os2vacpp/makefile.omk python/trunk/PC/os2vacpp/python.def python/trunk/PCbuild/pythoncore.vcproj python/trunk/Python/import.c python/trunk/RISCOS/Makefile Modified: python/trunk/Doc/c-api/sys.rst ============================================================================== --- python/trunk/Doc/c-api/sys.rst (original) +++ python/trunk/Doc/c-api/sys.rst Sat Jan 3 18:19:26 2009 @@ -15,13 +15,6 @@ one of the strings ``''`` or ``'???'``. -.. cfunction:: long PyOS_GetLastModificationTime(char *filename) - - Return the time of last modification of the file *filename*. The result is - encoded in the same way as the timestamp returned by the standard C library - function :cfunc:`time`. - - .. cfunction:: void PyOS_AfterFork() Function to update some internal state after a process fork; this should be Modified: python/trunk/Doc/data/refcounts.dat ============================================================================== --- python/trunk/Doc/data/refcounts.dat (original) +++ python/trunk/Doc/data/refcounts.dat Sat Jan 3 18:19:26 2009 @@ -841,9 +841,6 @@ PyNumber_Xor:PyObject*:o1:0: PyNumber_Xor:PyObject*:o2:0: -PyOS_GetLastModificationTime:long::: -PyOS_GetLastModificationTime:char*:filename:: - PyObject_AsFileDescriptor:int::: PyObject_AsFileDescriptor:PyObject*:o:0: Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Sat Jan 3 18:19:26 2009 @@ -264,7 +264,6 @@ Python/getargs.o \ Python/getcompiler.o \ Python/getcopyright.o \ - Python/getmtime.o \ Python/getplatform.o \ Python/getversion.o \ Python/graminit.o \ Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 3 18:19:26 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4817: Remove unused function PyOS_GetLastModificationTime. + - Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open Modified: python/trunk/PC/VC6/pythoncore.dsp ============================================================================== --- python/trunk/PC/VC6/pythoncore.dsp (original) +++ python/trunk/PC/VC6/pythoncore.dsp Sat Jan 3 18:19:26 2009 @@ -410,10 +410,6 @@ # End Source File # Begin Source File -SOURCE=..\..\Python\getmtime.c -# End Source File -# Begin Source File - SOURCE=..\..\Python\getopt.c # End Source File # Begin Source File Modified: python/trunk/PC/VS7.1/pythoncore.vcproj ============================================================================== --- python/trunk/PC/VS7.1/pythoncore.vcproj (original) +++ python/trunk/PC/VS7.1/pythoncore.vcproj Sat Jan 3 18:19:26 2009 @@ -569,9 +569,6 @@ RelativePath="..\..\Python\getcopyright.c"> - - - - Modified: python/trunk/PC/os2emx/Makefile ============================================================================== --- python/trunk/PC/os2emx/Makefile (original) +++ python/trunk/PC/os2emx/Makefile Sat Jan 3 18:19:26 2009 @@ -351,7 +351,6 @@ Python/getargs.c \ Python/getcompiler.c \ Python/getcopyright.c \ - Python/getmtime.c \ Python/getplatform.c \ Python/getversion.c \ Python/graminit.c \ Modified: python/trunk/PC/os2emx/python27.def ============================================================================== --- python/trunk/PC/os2emx/python27.def (original) +++ python/trunk/PC/os2emx/python27.def Sat Jan 3 18:19:26 2009 @@ -931,9 +931,6 @@ ; From python27_s.lib(getcopyright) "Py_GetCopyright" -; From python27_s.lib(getmtime) - "PyOS_GetLastModificationTime" - ; From python27_s.lib(getplatform) "Py_GetPlatform" Modified: python/trunk/PC/os2vacpp/makefile ============================================================================== --- python/trunk/PC/os2vacpp/makefile (original) +++ python/trunk/PC/os2vacpp/makefile Sat Jan 3 18:19:26 2009 @@ -1693,8 +1693,6 @@ $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \ $(PY_INCLUDE)\tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \ $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \ pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \ Modified: python/trunk/PC/os2vacpp/makefile.omk ============================================================================== --- python/trunk/PC/os2vacpp/makefile.omk (original) +++ python/trunk/PC/os2vacpp/makefile.omk Sat Jan 3 18:19:26 2009 @@ -1155,8 +1155,6 @@ pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \ stringobject.h sysmodule.h traceback.h tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \ pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \ import.h intobject.h intrcheck.h listobject.h longobject.h \ Modified: python/trunk/PC/os2vacpp/python.def ============================================================================== --- python/trunk/PC/os2vacpp/python.def (original) +++ python/trunk/PC/os2vacpp/python.def Sat Jan 3 18:19:26 2009 @@ -284,7 +284,6 @@ PyNumber_Xor PyOS_AfterFork PyOS_FiniInterrupts - PyOS_GetLastModificationTime PyOS_InitInterrupts PyOS_InterruptOccurred PyOS_Readline Modified: python/trunk/PCbuild/pythoncore.vcproj ============================================================================== --- python/trunk/PCbuild/pythoncore.vcproj (original) +++ python/trunk/PCbuild/pythoncore.vcproj Sat Jan 3 18:19:26 2009 @@ -1687,10 +1687,6 @@ > - - Deleted: python/trunk/Python/getmtime.c ============================================================================== --- python/trunk/Python/getmtime.c Sat Jan 3 18:19:26 2009 +++ (empty file) @@ -1,26 +0,0 @@ - -/* Subroutine to get the last modification time of a file */ - -/* (A separate file because this may be OS dependent) */ - -#include "Python.h" -#include "pyconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -time_t -PyOS_GetLastModificationTime(char *path, FILE *fp) -{ - struct stat st; - if (fstat(fileno(fp), &st) != 0) - return -1; - else - return st.st_mtime; -} - -#ifdef __cplusplus -} -#endif - Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Sat Jan 3 18:19:26 2009 @@ -27,8 +27,6 @@ typedef unsigned short mode_t; #endif -extern time_t PyOS_GetLastModificationTime(char *, FILE *); - /* In getmtime.c */ /* Magic word to reject .pyc files generated by other Python versions. It should change for each incompatible change to the bytecode. Modified: python/trunk/RISCOS/Makefile ============================================================================== --- python/trunk/RISCOS/Makefile (original) +++ python/trunk/RISCOS/Makefile Sat Jan 3 18:19:26 2009 @@ -135,7 +135,6 @@ OBJECTS_RISCOS = \ @.Python.o.dynload_riscos\ @.Python.o.getcwd_riscos\ - @.Python.o.getmtime_riscos\ @.o.unixstuff Deleted: python/trunk/RISCOS/Python/getmtime_riscos.c ============================================================================== --- python/trunk/RISCOS/Python/getmtime_riscos.c Sat Jan 3 18:19:26 2009 +++ (empty file) @@ -1,20 +0,0 @@ -#include - -#define __swi -#include "oslib/osfile.h" - -long PyOS_GetLastModificationTime(char *path, FILE *fp) -{ - int obj; - bits load, exec, ftype; - - if (xosfile_read_stamped_no_path(path, &obj, &load, &exec, 0, 0, &ftype)) return -1; - if (obj != osfile_IS_FILE) return -1; - if (ftype == osfile_TYPE_UNTYPED) return -1; - - load &= 0xFF; - load -= 51; - if (exec < 1855548004U) load--; - exec -= 1855548004U; - return exec/100+42949672*load+(95*load)/100; -} From python-checkins at python.org Sat Jan 3 18:22:41 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 3 Jan 2009 18:22:41 +0100 (CET) Subject: [Python-checkins] r68204 - in python/branches/py3k: Doc/c-api/sys.rst Doc/data/refcounts.dat Makefile.pre.in Misc/NEWS PC/VC6/pythoncore.dsp PC/VS7.1/pythoncore.vcproj PC/VS8.0/pythoncore.vcproj PC/os2emx/Makefile PC/os2emx/python27.def PC/os2vacpp/makefile PC/os2vacpp/makefile.omk PC/os2vacpp/python.def PCbuild/pythoncore.vcproj Python/getmtime.c Python/import.c Message-ID: <20090103172241.23FDA1E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 3 18:22:40 2009 New Revision: 68204 Log: Merged revisions 68203 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68203 | martin.v.loewis | 2009-01-03 18:19:26 +0100 (Sa, 03 Jan 2009) | 2 lines Issue #4817: Remove unused function PyOS_GetLastModificationTime. ........ Removed: python/branches/py3k/Python/getmtime.c Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/sys.rst python/branches/py3k/Doc/data/refcounts.dat python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/NEWS python/branches/py3k/PC/VC6/pythoncore.dsp python/branches/py3k/PC/VS7.1/pythoncore.vcproj python/branches/py3k/PC/VS8.0/pythoncore.vcproj python/branches/py3k/PC/os2emx/Makefile python/branches/py3k/PC/os2emx/python27.def python/branches/py3k/PC/os2vacpp/makefile python/branches/py3k/PC/os2vacpp/makefile.omk python/branches/py3k/PC/os2vacpp/python.def python/branches/py3k/PCbuild/pythoncore.vcproj python/branches/py3k/Python/import.c Modified: python/branches/py3k/Doc/c-api/sys.rst ============================================================================== --- python/branches/py3k/Doc/c-api/sys.rst (original) +++ python/branches/py3k/Doc/c-api/sys.rst Sat Jan 3 18:22:40 2009 @@ -15,13 +15,6 @@ one of the strings ``''`` or ``'???'``. -.. cfunction:: long PyOS_GetLastModificationTime(char *filename) - - Return the time of last modification of the file *filename*. The result is - encoded in the same way as the timestamp returned by the standard C library - function :cfunc:`time`. - - .. cfunction:: void PyOS_AfterFork() Function to update some internal state after a process fork; this should be Modified: python/branches/py3k/Doc/data/refcounts.dat ============================================================================== --- python/branches/py3k/Doc/data/refcounts.dat (original) +++ python/branches/py3k/Doc/data/refcounts.dat Sat Jan 3 18:22:40 2009 @@ -841,9 +841,6 @@ PyNumber_Xor:PyObject*:o1:0: PyNumber_Xor:PyObject*:o2:0: -PyOS_GetLastModificationTime:long::: -PyOS_GetLastModificationTime:char*:filename:: - PyObject_AsFileDescriptor:int::: PyObject_AsFileDescriptor:PyObject*:o:0: Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat Jan 3 18:22:40 2009 @@ -263,7 +263,6 @@ Python/getargs.o \ Python/getcompiler.o \ Python/getcopyright.o \ - Python/getmtime.o \ Python/getplatform.o \ Python/getversion.o \ Python/graminit.o \ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 18:22:40 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4817: Remove unused function PyOS_GetLastModificationTime. + - Issue #4580: Fix slicing of memoryviews when the item size is greater than one byte. Also fixes the meaning of len() so that it returns the number of items, rather than the size in bytes. Modified: python/branches/py3k/PC/VC6/pythoncore.dsp ============================================================================== --- python/branches/py3k/PC/VC6/pythoncore.dsp (original) +++ python/branches/py3k/PC/VC6/pythoncore.dsp Sat Jan 3 18:22:40 2009 @@ -402,10 +402,6 @@ # End Source File # Begin Source File -SOURCE=..\..\Python\getmtime.c -# End Source File -# Begin Source File - SOURCE=..\..\Python\getopt.c # End Source File # Begin Source File Modified: python/branches/py3k/PC/VS7.1/pythoncore.vcproj ============================================================================== --- python/branches/py3k/PC/VS7.1/pythoncore.vcproj (original) +++ python/branches/py3k/PC/VS7.1/pythoncore.vcproj Sat Jan 3 18:22:40 2009 @@ -557,9 +557,6 @@ RelativePath="..\..\Python\getcopyright.c"> - - - - Modified: python/branches/py3k/PC/os2emx/Makefile ============================================================================== --- python/branches/py3k/PC/os2emx/Makefile (original) +++ python/branches/py3k/PC/os2emx/Makefile Sat Jan 3 18:22:40 2009 @@ -339,7 +339,6 @@ Python/getargs.c \ Python/getcompiler.c \ Python/getcopyright.c \ - Python/getmtime.c \ Python/getplatform.c \ Python/getversion.c \ Python/graminit.c \ Modified: python/branches/py3k/PC/os2emx/python27.def ============================================================================== --- python/branches/py3k/PC/os2emx/python27.def (original) +++ python/branches/py3k/PC/os2emx/python27.def Sat Jan 3 18:22:40 2009 @@ -930,9 +930,6 @@ ; From python26_s.lib(getcopyright) "Py_GetCopyright" -; From python26_s.lib(getmtime) - "PyOS_GetLastModificationTime" - ; From python26_s.lib(getplatform) "Py_GetPlatform" Modified: python/branches/py3k/PC/os2vacpp/makefile ============================================================================== --- python/branches/py3k/PC/os2vacpp/makefile (original) +++ python/branches/py3k/PC/os2vacpp/makefile Sat Jan 3 18:22:40 2009 @@ -1377,8 +1377,6 @@ $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \ $(PY_INCLUDE)\tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \ $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \ pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \ Modified: python/branches/py3k/PC/os2vacpp/makefile.omk ============================================================================== --- python/branches/py3k/PC/os2vacpp/makefile.omk (original) +++ python/branches/py3k/PC/os2vacpp/makefile.omk Sat Jan 3 18:22:40 2009 @@ -939,8 +939,6 @@ pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \ stringobject.h sysmodule.h traceback.h tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \ pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \ import.h intobject.h intrcheck.h listobject.h longobject.h \ Modified: python/branches/py3k/PC/os2vacpp/python.def ============================================================================== --- python/branches/py3k/PC/os2vacpp/python.def (original) +++ python/branches/py3k/PC/os2vacpp/python.def Sat Jan 3 18:22:40 2009 @@ -280,7 +280,6 @@ PyNumber_Xor PyOS_AfterFork PyOS_FiniInterrupts - PyOS_GetLastModificationTime PyOS_InitInterrupts PyOS_InterruptOccurred PyOS_Readline Modified: python/branches/py3k/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/py3k/PCbuild/pythoncore.vcproj (original) +++ python/branches/py3k/PCbuild/pythoncore.vcproj Sat Jan 3 18:22:40 2009 @@ -1651,10 +1651,6 @@ > - - Deleted: python/branches/py3k/Python/getmtime.c ============================================================================== --- python/branches/py3k/Python/getmtime.c Sat Jan 3 18:22:40 2009 +++ (empty file) @@ -1,26 +0,0 @@ - -/* Subroutine to get the last modification time of a file */ - -/* (A separate file because this may be OS dependent) */ - -#include "Python.h" -#include "pyconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -time_t -PyOS_GetLastModificationTime(char *path, FILE *fp) -{ - struct stat st; - if (fstat(fileno(fp), &st) != 0) - return -1; - else - return st.st_mtime; -} - -#ifdef __cplusplus -} -#endif - Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Sat Jan 3 18:22:40 2009 @@ -27,8 +27,6 @@ typedef unsigned short mode_t; #endif -extern time_t PyOS_GetLastModificationTime(char *, FILE *); - /* In getmtime.c */ /* Magic word to reject .pyc files generated by other Python versions. It should change for each incompatible change to the bytecode. From buildbot at python.org Sat Jan 3 18:24:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 17:24:24 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.x Message-ID: <20090103172425.2A8541E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.x/builds/34 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc 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 Sat Jan 3 19:07:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 18:07:38 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090103180738.611F61E4002@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/27 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 19:41:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 19:41:50 +0100 (CET) Subject: [Python-checkins] r68205 - in python/branches/py3k: Doc/library/wsgiref.rst Lib/test/test_wsgiref.py Lib/wsgiref/handlers.py Lib/wsgiref/headers.py Lib/wsgiref/simple_server.py Lib/wsgiref/util.py Lib/wsgiref/validate.py Misc/NEWS Message-ID: <20090103184150.1D2C61E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 19:41:49 2009 New Revision: 68205 Log: Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x, in accordance with http://www.wsgi.org/wsgi/Amendments_1.0 Modified: python/branches/py3k/Doc/library/wsgiref.rst python/branches/py3k/Lib/test/test_wsgiref.py python/branches/py3k/Lib/wsgiref/handlers.py python/branches/py3k/Lib/wsgiref/headers.py python/branches/py3k/Lib/wsgiref/simple_server.py python/branches/py3k/Lib/wsgiref/util.py python/branches/py3k/Lib/wsgiref/validate.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/wsgiref.rst ============================================================================== --- python/branches/py3k/Doc/library/wsgiref.rst (original) +++ python/branches/py3k/Doc/library/wsgiref.rst Sat Jan 3 19:41:49 2009 @@ -122,13 +122,13 @@ def simple_app(environ, start_response): setup_testing_defaults(environ) - status = '200 OK' - headers = [('Content-type', 'text/plain')] + status = b'200 OK' + headers = [(b'Content-type', b'text/plain; charset=utf-8')] start_response(status, headers) - ret = ["%s: %s\n" % (key, value) - for key, value in environ.iteritems()] + ret = [("%s: %s\n" % (key, value)).encode("utf-8") + for key, value in environ.items()] return ret httpd = make_server('', 8000, simple_app) @@ -161,7 +161,7 @@ Example usage:: - from StringIO import StringIO + from io import StringIO from wsgiref.util import FileWrapper # We're using a StringIO-buffer for as the file-like object @@ -416,13 +416,13 @@ # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): - status = '200 OK' # HTTP Status - headers = [('Content-type', 'text/plain')] # HTTP Headers + status = b'200 OK' # HTTP Status + headers = [(b'Content-type', b'text/plain')] # HTTP Headers start_response(status, headers) # This is going to break because we need to return a list, and # the validator is going to inform us - return "Hello World" + return b"Hello World" # This is the application wrapped in a validator validator_app = validator(simple_app) @@ -509,7 +509,7 @@ .. method:: BaseHandler._write(data) - Buffer the string *data* for transmission to the client. It's okay if this + Buffer the bytes *data* for transmission to the client. It's okay if this method actually transmits the data; :class:`BaseHandler` just separates write and flush operations for greater efficiency when the underlying system actually has such a distinction. @@ -712,12 +712,12 @@ # is a dictionary containing CGI-style envrironment variables and the # second variable is the callable object (see PEP333) def hello_world_app(environ, start_response): - status = '200 OK' # HTTP Status - headers = [('Content-type', 'text/plain')] # HTTP Headers + status = b'200 OK' # HTTP Status + headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers start_response(status, headers) # The returned object is going to be printed - return ["Hello World"] + return [b"Hello World"] httpd = make_server('', 8000, hello_world_app) print("Serving on port 8000...") Modified: python/branches/py3k/Lib/test/test_wsgiref.py ============================================================================== --- python/branches/py3k/Lib/test/test_wsgiref.py (original) +++ python/branches/py3k/Lib/test/test_wsgiref.py Sat Jan 3 19:41:49 2009 @@ -50,7 +50,7 @@ def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"): server = make_server("", 80, app, MockServer, MockHandler) inp = BufferedReader(BytesIO(data)) - out = StringIO() + out = BytesIO() olderr = sys.stderr err = sys.stderr = StringIO() @@ -128,13 +128,13 @@ def check_hello(self, out, has_length=True): self.assertEqual(out, - "HTTP/1.0 200 OK\r\n" + ("HTTP/1.0 200 OK\r\n" "Server: WSGIServer/0.1 Python/"+sys.version.split()[0]+"\r\n" "Content-Type: text/plain\r\n" "Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" + (has_length and "Content-Length: 13\r\n" or "") + "\r\n" - "Hello, world!" + "Hello, world!").encode("iso-8859-1") ) def test_plain_hello(self): @@ -152,7 +152,7 @@ return ["Hello, world!"] out, err = run_amock(validator(bad_app)) self.failUnless(out.endswith( - "A server error occurred. Please contact the administrator." + b"A server error occurred. Please contact the administrator." )) self.assertEqual( err.splitlines()[-2], @@ -160,7 +160,36 @@ " be of type list: " ) + def test_wsgi_input(self): + def bad_app(e,s): + e["wsgi.input"].read() + s(b"200 OK", [(b"Content-Type", b"text/plain; charset=utf-8")]) + return [b"data"] + out, err = run_amock(validator(bad_app)) + self.failUnless(out.endswith( + b"A server error occurred. Please contact the administrator." + )) + self.assertEqual( + err.splitlines()[-2], "AssertionError" + ) + def test_bytes_validation(self): + def app(e, s): + s(b"200 OK", [ + (b"Content-Type", b"text/plain; charset=utf-8"), + ("Date", "Wed, 24 Dec 2008 13:29:32 GMT"), + ]) + return [b"data"] + out, err = run_amock(validator(app)) + self.failUnless(err.endswith('"GET / HTTP/1.0" 200 4\n')) + self.assertEqual( + b"HTTP/1.0 200 OK\r\n" + b"Server: WSGIServer/0.1 Python/3.1a0\r\n" + b"Content-Type: text/plain; charset=utf-8\r\n" + b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n" + b"\r\n" + b"data", + out) @@ -181,6 +210,8 @@ util.setup_testing_defaults(env) if isinstance(value,StringIO): self.failUnless(isinstance(env[key],StringIO)) + elif isinstance(value,BytesIO): + self.failUnless(isinstance(env[key],BytesIO)) else: self.assertEqual(env[key],value) @@ -260,7 +291,7 @@ ('wsgi.run_once', 0), ('wsgi.multithread', 0), ('wsgi.multiprocess', 0), - ('wsgi.input', StringIO("")), + ('wsgi.input', BytesIO()), ('wsgi.errors', StringIO()), ('wsgi.url_scheme','http'), ]: @@ -386,6 +417,23 @@ '\r\n' ) + def testBytes(self): + h = Headers([ + (b"Content-Type", b"text/plain; charset=utf-8"), + ]) + self.assertEqual("text/plain; charset=utf-8", h.get("Content-Type")) + + h[b"Foo"] = bytes(b"bar") + self.assertEqual("bar", h.get("Foo")) + + h.setdefault(b"Bar", b"foo") + self.assertEqual("foo", h.get("Bar")) + + h.add_header(b'content-disposition', b'attachment', + filename=b'bud.gif') + self.assertEqual('attachment; filename="bud.gif"', + h.get("content-disposition")) + class ErrorHandler(BaseCGIHandler): """Simple handler subclass for testing BaseHandler""" @@ -393,7 +441,7 @@ def __init__(self,**kw): setup_testing_defaults(kw) BaseCGIHandler.__init__( - self, StringIO(''), StringIO(), StringIO(), kw, + self, BytesIO(), BytesIO(), StringIO(), kw, multithread=True, multiprocess=True ) @@ -474,21 +522,32 @@ s('200 OK',[])(e['wsgi.url_scheme']) return [] + def trivial_app3(e,s): + s('200 OK',[]) + return ['\u0442\u0435\u0441\u0442'.encode("utf-8")] + h = TestHandler() h.run(trivial_app1) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "Content-Length: 4\r\n" "\r\n" - "http") + "http").encode("iso-8859-1")) h = TestHandler() h.run(trivial_app2) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "\r\n" - "http") + "http").encode("iso-8859-1")) + h = TestHandler() + h.run(trivial_app3) + self.assertEqual(h.stdout.getvalue(), + b'Status: 200 OK\r\n' + b'Content-Length: 8\r\n' + b'\r\n' + b'\xd1\x82\xd0\xb5\xd1\x81\xd1\x82') @@ -507,18 +566,19 @@ h = ErrorHandler() h.run(non_error_app) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "Content-Length: 0\r\n" - "\r\n") + "\r\n").encode("iso-8859-1")) self.assertEqual(h.stderr.getvalue(),"") h = ErrorHandler() h.run(error_app) self.assertEqual(h.stdout.getvalue(), - "Status: %s\r\n" + ("Status: %s\r\n" "Content-Type: text/plain\r\n" "Content-Length: %d\r\n" - "\r\n%s" % (h.error_status,len(h.error_body),h.error_body)) + "\r\n%s" % (h.error_status,len(h.error_body),h.error_body) + ).encode("iso-8859-1")) self.failUnless("AssertionError" in h.stderr.getvalue()) @@ -531,8 +591,8 @@ h = ErrorHandler() h.run(error_app) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" - "\r\n"+MSG) + ("Status: 200 OK\r\n" + "\r\n"+MSG).encode("iso-8859-1")) self.failUnless("AssertionError" in h.stderr.getvalue()) @@ -549,7 +609,7 @@ ) shortpat = ( "Status: 200 OK\r\n" "Content-Length: 0\r\n" "\r\n" - ) + ).encode("iso-8859-1") for ssw in "FooBar/1.0", None: sw = ssw and "Server: %s\r\n" % ssw or "" @@ -570,13 +630,31 @@ h.server_software = ssw h.run(non_error_app) if proto=="HTTP/0.9": - self.assertEqual(h.stdout.getvalue(),"") + self.assertEqual(h.stdout.getvalue(),b"") else: self.failUnless( - re.match(stdpat%(version,sw), h.stdout.getvalue()), - (stdpat%(version,sw), h.stdout.getvalue()) + re.match((stdpat%(version,sw)).encode("iso-8859-1"), + h.stdout.getvalue()), + ((stdpat%(version,sw)).encode("iso-8859-1"), + h.stdout.getvalue()) ) + def testBytesData(self): + def app(e, s): + s(b"200 OK", [ + (b"Content-Type", b"text/plain; charset=utf-8"), + ]) + return [b"data"] + + h = TestHandler() + h.run(app) + self.assertEqual(b"Status: 200 OK\r\n" + b"Content-Type: text/plain; charset=utf-8\r\n" + b"Content-Length: 4\r\n" + b"\r\n" + b"data", + h.stdout.getvalue()) + # This epilogue is needed for compatibility with the Python 2.5 regrtest module def test_main(): Modified: python/branches/py3k/Lib/wsgiref/handlers.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/handlers.py (original) +++ python/branches/py3k/Lib/wsgiref/handlers.py Sat Jan 3 19:41:49 2009 @@ -157,19 +157,29 @@ elif self.headers is not None: raise AssertionError("Headers already set!") - assert type(status) is str,"Status must be a string" + status = self._convert_string_type(status, "Status") assert len(status)>=4,"Status must be at least 4 characters" assert int(status[:3]),"Status message must begin w/3-digit code" assert status[3]==" ", "Status message must have a space after code" - if __debug__: - for name,val in headers: - assert type(name) is str,"Header names must be strings" - assert type(val) is str,"Header values must be strings" - assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" + + str_headers = [] + for name,val in headers: + name = self._convert_string_type(name, "Header name") + val = self._convert_string_type(val, "Header value") + str_headers.append((name, val)) + assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" + self.status = status - self.headers = self.headers_class(headers) + self.headers = self.headers_class(str_headers) return self.write + def _convert_string_type(self, value, title): + """Convert/check value type.""" + if isinstance(value, str): + return value + assert isinstance(value, bytes), \ + "{0} must be a string or bytes object (not {1})".format(title, value) + return str(value, "iso-8859-1") def send_preamble(self): """Transmit version/status/date/server, via self._write()""" @@ -188,7 +198,8 @@ def write(self, data): """'write()' callable as specified by PEP 333""" - assert type(data) is str,"write() argument must be string" + assert isinstance(data, (str, bytes)), \ + "write() argument must be a string or bytes" if not self.status: raise AssertionError("write() before start_response()") @@ -382,8 +393,13 @@ self.environ.update(self.base_env) def _write(self,data): + if isinstance(data, str): + try: + data = data.encode("iso-8859-1") + except UnicodeEncodeError: + raise ValueError("Unicode data must contain only code points" + " representable in ISO-8859-1 encoding") self.stdout.write(data) - self._write = self.stdout.write def _flush(self): self.stdout.flush() Modified: python/branches/py3k/Lib/wsgiref/headers.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/headers.py (original) +++ python/branches/py3k/Lib/wsgiref/headers.py Sat Jan 3 19:41:49 2009 @@ -44,7 +44,19 @@ def __init__(self,headers): if not isinstance(headers, list): raise TypeError("Headers must be a list of name/value tuples") - self._headers = headers + self._headers = [] + for k, v in headers: + k = self._convert_string_type(k) + v = self._convert_string_type(v) + self._headers.append((k, v)) + + def _convert_string_type(self, value): + """Convert/check value type.""" + if isinstance(value, str): + return value + assert isinstance(value, bytes), ("Header names/values must be" + " a string or bytes object (not {0})".format(value)) + return str(value, "iso-8859-1") def __len__(self): """Return the total number of headers, including duplicates.""" @@ -53,7 +65,8 @@ def __setitem__(self, name, val): """Set the value of a header.""" del self[name] - self._headers.append((name, val)) + self._headers.append( + (self._convert_string_type(name), self._convert_string_type(val))) def __delitem__(self,name): """Delete all occurrences of a header, if present. @@ -152,7 +165,8 @@ and value 'value'.""" result = self.get(name) if result is None: - self._headers.append((name,value)) + self._headers.append((self._convert_string_type(name), + self._convert_string_type(value))) return value else: return result @@ -176,13 +190,16 @@ """ parts = [] if _value is not None: + _value = self._convert_string_type(_value) parts.append(_value) for k, v in _params.items(): + k = self._convert_string_type(k) if v is None: parts.append(k.replace('_', '-')) else: + v = self._convert_string_type(v) parts.append(_formatparam(k.replace('_', '-'), v)) - self._headers.append((_name, "; ".join(parts))) + self._headers.append((self._convert_string_type(_name), "; ".join(parts))) Modified: python/branches/py3k/Lib/wsgiref/simple_server.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/simple_server.py (original) +++ python/branches/py3k/Lib/wsgiref/simple_server.py Sat Jan 3 19:41:49 2009 @@ -111,8 +111,7 @@ if length: env['CONTENT_LENGTH'] = length - for h in self.headers: - k,v = h.split(':',1) + for k, v in self.headers.items(): k=k.replace('-','_').upper(); v=v.strip() if k in env: continue # skip content length, type,etc. @@ -168,11 +167,11 @@ stdout = StringIO() print("Hello world!", file=stdout) print(file=stdout) - h = environ.items(); h.sort() + h = sorted(environ.items()) for k,v in h: print(k,'=',repr(v), file=stdout) - start_response("200 OK", [('Content-Type','text/plain')]) - return [stdout.getvalue()] + start_response(b"200 OK", [(b'Content-Type',b'text/plain; charset=utf-8')]) + return [stdout.getvalue().encode("utf-8")] def make_server( Modified: python/branches/py3k/Lib/wsgiref/util.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/util.py (original) +++ python/branches/py3k/Lib/wsgiref/util.py Sat Jan 3 19:41:49 2009 @@ -149,8 +149,8 @@ environ.setdefault('wsgi.multithread', 0) environ.setdefault('wsgi.multiprocess', 0) - from io import StringIO - environ.setdefault('wsgi.input', StringIO("")) + from io import StringIO, BytesIO + environ.setdefault('wsgi.input', BytesIO()) environ.setdefault('wsgi.errors', StringIO()) environ.setdefault('wsgi.url_scheme',guess_scheme(environ)) Modified: python/branches/py3k/Lib/wsgiref/validate.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/validate.py (original) +++ python/branches/py3k/Lib/wsgiref/validate.py Sat Jan 3 19:41:49 2009 @@ -127,6 +127,13 @@ if not cond: raise AssertionError(*args) +def check_string_type(value, title): + if isinstance(value, str): + return value + assert isinstance(value, bytes), \ + "{0} must be a string or bytes object (not {1})".format(title, value) + return str(value, "iso-8859-1") + def validator(application): """ @@ -188,14 +195,14 @@ self.input = wsgi_input def read(self, *args): - assert_(len(args) <= 1) + assert_(len(args) == 1) v = self.input.read(*args) - assert_(isinstance(v, str)) + assert_(isinstance(v, bytes)) return v def readline(self): v = self.input.readline() - assert_(isinstance(v, str)) + assert_(isinstance(v, bytes)) return v def readlines(self, *args): @@ -203,7 +210,7 @@ lines = self.input.readlines(*args) assert_(isinstance(lines, list)) for line in lines: - assert_(isinstance(line, str)) + assert_(isinstance(line, bytes)) return lines def __iter__(self): @@ -241,7 +248,7 @@ self.writer = wsgi_writer def __call__(self, s): - assert_(isinstance(s, str)) + assert_(isinstance(s, (str, bytes))) self.writer(s) class PartialIteratorWrapper: @@ -364,8 +371,7 @@ % (wsgi_errors, attr)) def check_status(status): - assert_(isinstance(status, str), - "Status must be a string (not %r)" % status) + status = check_string_type(status, "Status") # Implicitly check that we can turn it into an integer: status_code = status.split(None, 1)[0] assert_(len(status_code) == 3, @@ -389,6 +395,8 @@ % (item, type(item))) assert_(len(item) == 2) name, value = item + name = check_string_type(name, "Header name") + value = check_string_type(value, "Header value") assert_(name.lower() != 'status', "The Status header cannot be used; it conflicts with CGI " "script, and HTTP status is not given through headers " @@ -404,11 +412,13 @@ % (value, bad_header_value_re.search(value).group(0))) def check_content_type(status, headers): + status = check_string_type(status, "Status") code = int(status.split(None, 1)[0]) # @@: need one more person to verify this interpretation of RFC 2616 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html NO_MESSAGE_BODY = (204, 304) for name, value in headers: + name = check_string_type(name, "Header name") if name.lower() == 'content-type': if code not in NO_MESSAGE_BODY: return @@ -426,6 +436,6 @@ # Technically a string is legal, which is why it's a really bad # idea, because it may cause the response to be returned # character-by-character - assert_(not isinstance(iterator, str), + assert_(not isinstance(iterator, (str, bytes)), "You should not return a string as your application iterator, " "instead return a single-item list containing that string.") Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 19:41:49 2009 @@ -84,6 +84,10 @@ Library ------- +- Issue #4718: Adapt the wsgiref package so that it actually works with + Python 3.x, in accordance with the `official amendments of the spec + `_. + - Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) From python-checkins at python.org Sat Jan 3 19:49:42 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 19:49:42 +0100 (CET) Subject: [Python-checkins] r68206 - python/branches/py3k/Lib/test/test_wsgiref.py Message-ID: <20090103184942.0E0951E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 19:49:41 2009 New Revision: 68206 Log: Actually make test_wsgiref independent from the Python version. Modified: python/branches/py3k/Lib/test/test_wsgiref.py Modified: python/branches/py3k/Lib/test/test_wsgiref.py ============================================================================== --- python/branches/py3k/Lib/test/test_wsgiref.py (original) +++ python/branches/py3k/Lib/test/test_wsgiref.py Sat Jan 3 19:49:41 2009 @@ -182,9 +182,10 @@ return [b"data"] out, err = run_amock(validator(app)) self.failUnless(err.endswith('"GET / HTTP/1.0" 200 4\n')) + ver = sys.version.split()[0].encode('ascii') self.assertEqual( b"HTTP/1.0 200 OK\r\n" - b"Server: WSGIServer/0.1 Python/3.1a0\r\n" + b"Server: WSGIServer/0.1 Python/" + ver + b"\r\n" b"Content-Type: text/plain; charset=utf-8\r\n" b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n" b"\r\n" From python-checkins at python.org Sat Jan 3 19:57:08 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 19:57:08 +0100 (CET) Subject: [Python-checkins] r68207 - in python/branches/release30-maint: Doc/library/wsgiref.rst Lib/test/test_wsgiref.py Lib/wsgiref/handlers.py Lib/wsgiref/headers.py Lib/wsgiref/simple_server.py Lib/wsgiref/util.py Lib/wsgiref/validate.py Misc/NEWS Message-ID: <20090103185708.EA9901E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 19:57:08 2009 New Revision: 68207 Log: Merged revisions 68205-68206 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68205 | antoine.pitrou | 2009-01-03 19:41:49 +0100 (sam., 03 janv. 2009) | 4 lines Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x, in accordance with http://www.wsgi.org/wsgi/Amendments_1.0 ........ r68206 | antoine.pitrou | 2009-01-03 19:49:41 +0100 (sam., 03 janv. 2009) | 3 lines Actually make test_wsgiref independent from the Python version. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/wsgiref.rst python/branches/release30-maint/Lib/test/test_wsgiref.py python/branches/release30-maint/Lib/wsgiref/handlers.py python/branches/release30-maint/Lib/wsgiref/headers.py python/branches/release30-maint/Lib/wsgiref/simple_server.py python/branches/release30-maint/Lib/wsgiref/util.py python/branches/release30-maint/Lib/wsgiref/validate.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Doc/library/wsgiref.rst ============================================================================== --- python/branches/release30-maint/Doc/library/wsgiref.rst (original) +++ python/branches/release30-maint/Doc/library/wsgiref.rst Sat Jan 3 19:57:08 2009 @@ -122,13 +122,13 @@ def simple_app(environ, start_response): setup_testing_defaults(environ) - status = '200 OK' - headers = [('Content-type', 'text/plain')] + status = b'200 OK' + headers = [(b'Content-type', b'text/plain; charset=utf-8')] start_response(status, headers) - ret = ["%s: %s\n" % (key, value) - for key, value in environ.iteritems()] + ret = [("%s: %s\n" % (key, value)).encode("utf-8") + for key, value in environ.items()] return ret httpd = make_server('', 8000, simple_app) @@ -161,7 +161,7 @@ Example usage:: - from StringIO import StringIO + from io import StringIO from wsgiref.util import FileWrapper # We're using a StringIO-buffer for as the file-like object @@ -416,13 +416,13 @@ # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): - status = '200 OK' # HTTP Status - headers = [('Content-type', 'text/plain')] # HTTP Headers + status = b'200 OK' # HTTP Status + headers = [(b'Content-type', b'text/plain')] # HTTP Headers start_response(status, headers) # This is going to break because we need to return a list, and # the validator is going to inform us - return "Hello World" + return b"Hello World" # This is the application wrapped in a validator validator_app = validator(simple_app) @@ -509,7 +509,7 @@ .. method:: BaseHandler._write(data) - Buffer the string *data* for transmission to the client. It's okay if this + Buffer the bytes *data* for transmission to the client. It's okay if this method actually transmits the data; :class:`BaseHandler` just separates write and flush operations for greater efficiency when the underlying system actually has such a distinction. @@ -712,12 +712,12 @@ # is a dictionary containing CGI-style envrironment variables and the # second variable is the callable object (see PEP333) def hello_world_app(environ, start_response): - status = '200 OK' # HTTP Status - headers = [('Content-type', 'text/plain')] # HTTP Headers + status = b'200 OK' # HTTP Status + headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers start_response(status, headers) # The returned object is going to be printed - return ["Hello World"] + return [b"Hello World"] httpd = make_server('', 8000, hello_world_app) print("Serving on port 8000...") Modified: python/branches/release30-maint/Lib/test/test_wsgiref.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_wsgiref.py (original) +++ python/branches/release30-maint/Lib/test/test_wsgiref.py Sat Jan 3 19:57:08 2009 @@ -50,7 +50,7 @@ def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"): server = make_server("", 80, app, MockServer, MockHandler) inp = BufferedReader(BytesIO(data)) - out = StringIO() + out = BytesIO() olderr = sys.stderr err = sys.stderr = StringIO() @@ -128,13 +128,13 @@ def check_hello(self, out, has_length=True): self.assertEqual(out, - "HTTP/1.0 200 OK\r\n" + ("HTTP/1.0 200 OK\r\n" "Server: WSGIServer/0.1 Python/"+sys.version.split()[0]+"\r\n" "Content-Type: text/plain\r\n" "Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" + (has_length and "Content-Length: 13\r\n" or "") + "\r\n" - "Hello, world!" + "Hello, world!").encode("iso-8859-1") ) def test_plain_hello(self): @@ -152,7 +152,7 @@ return ["Hello, world!"] out, err = run_amock(validator(bad_app)) self.failUnless(out.endswith( - "A server error occurred. Please contact the administrator." + b"A server error occurred. Please contact the administrator." )) self.assertEqual( err.splitlines()[-2], @@ -160,7 +160,37 @@ " be of type list: " ) + def test_wsgi_input(self): + def bad_app(e,s): + e["wsgi.input"].read() + s(b"200 OK", [(b"Content-Type", b"text/plain; charset=utf-8")]) + return [b"data"] + out, err = run_amock(validator(bad_app)) + self.failUnless(out.endswith( + b"A server error occurred. Please contact the administrator." + )) + self.assertEqual( + err.splitlines()[-2], "AssertionError" + ) + def test_bytes_validation(self): + def app(e, s): + s(b"200 OK", [ + (b"Content-Type", b"text/plain; charset=utf-8"), + ("Date", "Wed, 24 Dec 2008 13:29:32 GMT"), + ]) + return [b"data"] + out, err = run_amock(validator(app)) + self.failUnless(err.endswith('"GET / HTTP/1.0" 200 4\n')) + ver = sys.version.split()[0].encode('ascii') + self.assertEqual( + b"HTTP/1.0 200 OK\r\n" + b"Server: WSGIServer/0.1 Python/" + ver + b"\r\n" + b"Content-Type: text/plain; charset=utf-8\r\n" + b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n" + b"\r\n" + b"data", + out) @@ -181,6 +211,8 @@ util.setup_testing_defaults(env) if isinstance(value,StringIO): self.failUnless(isinstance(env[key],StringIO)) + elif isinstance(value,BytesIO): + self.failUnless(isinstance(env[key],BytesIO)) else: self.assertEqual(env[key],value) @@ -260,7 +292,7 @@ ('wsgi.run_once', 0), ('wsgi.multithread', 0), ('wsgi.multiprocess', 0), - ('wsgi.input', StringIO("")), + ('wsgi.input', BytesIO()), ('wsgi.errors', StringIO()), ('wsgi.url_scheme','http'), ]: @@ -386,6 +418,23 @@ '\r\n' ) + def testBytes(self): + h = Headers([ + (b"Content-Type", b"text/plain; charset=utf-8"), + ]) + self.assertEqual("text/plain; charset=utf-8", h.get("Content-Type")) + + h[b"Foo"] = bytes(b"bar") + self.assertEqual("bar", h.get("Foo")) + + h.setdefault(b"Bar", b"foo") + self.assertEqual("foo", h.get("Bar")) + + h.add_header(b'content-disposition', b'attachment', + filename=b'bud.gif') + self.assertEqual('attachment; filename="bud.gif"', + h.get("content-disposition")) + class ErrorHandler(BaseCGIHandler): """Simple handler subclass for testing BaseHandler""" @@ -393,7 +442,7 @@ def __init__(self,**kw): setup_testing_defaults(kw) BaseCGIHandler.__init__( - self, StringIO(''), StringIO(), StringIO(), kw, + self, BytesIO(), BytesIO(), StringIO(), kw, multithread=True, multiprocess=True ) @@ -474,21 +523,32 @@ s('200 OK',[])(e['wsgi.url_scheme']) return [] + def trivial_app3(e,s): + s('200 OK',[]) + return ['\u0442\u0435\u0441\u0442'.encode("utf-8")] + h = TestHandler() h.run(trivial_app1) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "Content-Length: 4\r\n" "\r\n" - "http") + "http").encode("iso-8859-1")) h = TestHandler() h.run(trivial_app2) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "\r\n" - "http") + "http").encode("iso-8859-1")) + h = TestHandler() + h.run(trivial_app3) + self.assertEqual(h.stdout.getvalue(), + b'Status: 200 OK\r\n' + b'Content-Length: 8\r\n' + b'\r\n' + b'\xd1\x82\xd0\xb5\xd1\x81\xd1\x82') @@ -507,18 +567,19 @@ h = ErrorHandler() h.run(non_error_app) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "Content-Length: 0\r\n" - "\r\n") + "\r\n").encode("iso-8859-1")) self.assertEqual(h.stderr.getvalue(),"") h = ErrorHandler() h.run(error_app) self.assertEqual(h.stdout.getvalue(), - "Status: %s\r\n" + ("Status: %s\r\n" "Content-Type: text/plain\r\n" "Content-Length: %d\r\n" - "\r\n%s" % (h.error_status,len(h.error_body),h.error_body)) + "\r\n%s" % (h.error_status,len(h.error_body),h.error_body) + ).encode("iso-8859-1")) self.failUnless("AssertionError" in h.stderr.getvalue()) @@ -531,8 +592,8 @@ h = ErrorHandler() h.run(error_app) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" - "\r\n"+MSG) + ("Status: 200 OK\r\n" + "\r\n"+MSG).encode("iso-8859-1")) self.failUnless("AssertionError" in h.stderr.getvalue()) @@ -549,7 +610,7 @@ ) shortpat = ( "Status: 200 OK\r\n" "Content-Length: 0\r\n" "\r\n" - ) + ).encode("iso-8859-1") for ssw in "FooBar/1.0", None: sw = ssw and "Server: %s\r\n" % ssw or "" @@ -570,13 +631,31 @@ h.server_software = ssw h.run(non_error_app) if proto=="HTTP/0.9": - self.assertEqual(h.stdout.getvalue(),"") + self.assertEqual(h.stdout.getvalue(),b"") else: self.failUnless( - re.match(stdpat%(version,sw), h.stdout.getvalue()), - (stdpat%(version,sw), h.stdout.getvalue()) + re.match((stdpat%(version,sw)).encode("iso-8859-1"), + h.stdout.getvalue()), + ((stdpat%(version,sw)).encode("iso-8859-1"), + h.stdout.getvalue()) ) + def testBytesData(self): + def app(e, s): + s(b"200 OK", [ + (b"Content-Type", b"text/plain; charset=utf-8"), + ]) + return [b"data"] + + h = TestHandler() + h.run(app) + self.assertEqual(b"Status: 200 OK\r\n" + b"Content-Type: text/plain; charset=utf-8\r\n" + b"Content-Length: 4\r\n" + b"\r\n" + b"data", + h.stdout.getvalue()) + # This epilogue is needed for compatibility with the Python 2.5 regrtest module def test_main(): Modified: python/branches/release30-maint/Lib/wsgiref/handlers.py ============================================================================== --- python/branches/release30-maint/Lib/wsgiref/handlers.py (original) +++ python/branches/release30-maint/Lib/wsgiref/handlers.py Sat Jan 3 19:57:08 2009 @@ -157,19 +157,29 @@ elif self.headers is not None: raise AssertionError("Headers already set!") - assert type(status) is str,"Status must be a string" + status = self._convert_string_type(status, "Status") assert len(status)>=4,"Status must be at least 4 characters" assert int(status[:3]),"Status message must begin w/3-digit code" assert status[3]==" ", "Status message must have a space after code" - if __debug__: - for name,val in headers: - assert type(name) is str,"Header names must be strings" - assert type(val) is str,"Header values must be strings" - assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" + + str_headers = [] + for name,val in headers: + name = self._convert_string_type(name, "Header name") + val = self._convert_string_type(val, "Header value") + str_headers.append((name, val)) + assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" + self.status = status - self.headers = self.headers_class(headers) + self.headers = self.headers_class(str_headers) return self.write + def _convert_string_type(self, value, title): + """Convert/check value type.""" + if isinstance(value, str): + return value + assert isinstance(value, bytes), \ + "{0} must be a string or bytes object (not {1})".format(title, value) + return str(value, "iso-8859-1") def send_preamble(self): """Transmit version/status/date/server, via self._write()""" @@ -188,7 +198,8 @@ def write(self, data): """'write()' callable as specified by PEP 333""" - assert type(data) is str,"write() argument must be string" + assert isinstance(data, (str, bytes)), \ + "write() argument must be a string or bytes" if not self.status: raise AssertionError("write() before start_response()") @@ -382,8 +393,13 @@ self.environ.update(self.base_env) def _write(self,data): + if isinstance(data, str): + try: + data = data.encode("iso-8859-1") + except UnicodeEncodeError: + raise ValueError("Unicode data must contain only code points" + " representable in ISO-8859-1 encoding") self.stdout.write(data) - self._write = self.stdout.write def _flush(self): self.stdout.flush() Modified: python/branches/release30-maint/Lib/wsgiref/headers.py ============================================================================== --- python/branches/release30-maint/Lib/wsgiref/headers.py (original) +++ python/branches/release30-maint/Lib/wsgiref/headers.py Sat Jan 3 19:57:08 2009 @@ -44,7 +44,19 @@ def __init__(self,headers): if not isinstance(headers, list): raise TypeError("Headers must be a list of name/value tuples") - self._headers = headers + self._headers = [] + for k, v in headers: + k = self._convert_string_type(k) + v = self._convert_string_type(v) + self._headers.append((k, v)) + + def _convert_string_type(self, value): + """Convert/check value type.""" + if isinstance(value, str): + return value + assert isinstance(value, bytes), ("Header names/values must be" + " a string or bytes object (not {0})".format(value)) + return str(value, "iso-8859-1") def __len__(self): """Return the total number of headers, including duplicates.""" @@ -53,7 +65,8 @@ def __setitem__(self, name, val): """Set the value of a header.""" del self[name] - self._headers.append((name, val)) + self._headers.append( + (self._convert_string_type(name), self._convert_string_type(val))) def __delitem__(self,name): """Delete all occurrences of a header, if present. @@ -152,7 +165,8 @@ and value 'value'.""" result = self.get(name) if result is None: - self._headers.append((name,value)) + self._headers.append((self._convert_string_type(name), + self._convert_string_type(value))) return value else: return result @@ -176,13 +190,16 @@ """ parts = [] if _value is not None: + _value = self._convert_string_type(_value) parts.append(_value) for k, v in _params.items(): + k = self._convert_string_type(k) if v is None: parts.append(k.replace('_', '-')) else: + v = self._convert_string_type(v) parts.append(_formatparam(k.replace('_', '-'), v)) - self._headers.append((_name, "; ".join(parts))) + self._headers.append((self._convert_string_type(_name), "; ".join(parts))) Modified: python/branches/release30-maint/Lib/wsgiref/simple_server.py ============================================================================== --- python/branches/release30-maint/Lib/wsgiref/simple_server.py (original) +++ python/branches/release30-maint/Lib/wsgiref/simple_server.py Sat Jan 3 19:57:08 2009 @@ -111,8 +111,7 @@ if length: env['CONTENT_LENGTH'] = length - for h in self.headers: - k,v = h.split(':',1) + for k, v in self.headers.items(): k=k.replace('-','_').upper(); v=v.strip() if k in env: continue # skip content length, type,etc. @@ -168,11 +167,11 @@ stdout = StringIO() print("Hello world!", file=stdout) print(file=stdout) - h = environ.items(); h.sort() + h = sorted(environ.items()) for k,v in h: print(k,'=',repr(v), file=stdout) - start_response("200 OK", [('Content-Type','text/plain')]) - return [stdout.getvalue()] + start_response(b"200 OK", [(b'Content-Type',b'text/plain; charset=utf-8')]) + return [stdout.getvalue().encode("utf-8")] def make_server( Modified: python/branches/release30-maint/Lib/wsgiref/util.py ============================================================================== --- python/branches/release30-maint/Lib/wsgiref/util.py (original) +++ python/branches/release30-maint/Lib/wsgiref/util.py Sat Jan 3 19:57:08 2009 @@ -149,8 +149,8 @@ environ.setdefault('wsgi.multithread', 0) environ.setdefault('wsgi.multiprocess', 0) - from io import StringIO - environ.setdefault('wsgi.input', StringIO("")) + from io import StringIO, BytesIO + environ.setdefault('wsgi.input', BytesIO()) environ.setdefault('wsgi.errors', StringIO()) environ.setdefault('wsgi.url_scheme',guess_scheme(environ)) Modified: python/branches/release30-maint/Lib/wsgiref/validate.py ============================================================================== --- python/branches/release30-maint/Lib/wsgiref/validate.py (original) +++ python/branches/release30-maint/Lib/wsgiref/validate.py Sat Jan 3 19:57:08 2009 @@ -127,6 +127,13 @@ if not cond: raise AssertionError(*args) +def check_string_type(value, title): + if isinstance(value, str): + return value + assert isinstance(value, bytes), \ + "{0} must be a string or bytes object (not {1})".format(title, value) + return str(value, "iso-8859-1") + def validator(application): """ @@ -188,14 +195,14 @@ self.input = wsgi_input def read(self, *args): - assert_(len(args) <= 1) + assert_(len(args) == 1) v = self.input.read(*args) - assert_(isinstance(v, str)) + assert_(isinstance(v, bytes)) return v def readline(self): v = self.input.readline() - assert_(isinstance(v, str)) + assert_(isinstance(v, bytes)) return v def readlines(self, *args): @@ -203,7 +210,7 @@ lines = self.input.readlines(*args) assert_(isinstance(lines, list)) for line in lines: - assert_(isinstance(line, str)) + assert_(isinstance(line, bytes)) return lines def __iter__(self): @@ -241,7 +248,7 @@ self.writer = wsgi_writer def __call__(self, s): - assert_(isinstance(s, str)) + assert_(isinstance(s, (str, bytes))) self.writer(s) class PartialIteratorWrapper: @@ -364,8 +371,7 @@ % (wsgi_errors, attr)) def check_status(status): - assert_(isinstance(status, str), - "Status must be a string (not %r)" % status) + status = check_string_type(status, "Status") # Implicitly check that we can turn it into an integer: status_code = status.split(None, 1)[0] assert_(len(status_code) == 3, @@ -389,6 +395,8 @@ % (item, type(item))) assert_(len(item) == 2) name, value = item + name = check_string_type(name, "Header name") + value = check_string_type(value, "Header value") assert_(name.lower() != 'status', "The Status header cannot be used; it conflicts with CGI " "script, and HTTP status is not given through headers " @@ -404,11 +412,13 @@ % (value, bad_header_value_re.search(value).group(0))) def check_content_type(status, headers): + status = check_string_type(status, "Status") code = int(status.split(None, 1)[0]) # @@: need one more person to verify this interpretation of RFC 2616 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html NO_MESSAGE_BODY = (204, 304) for name, value in headers: + name = check_string_type(name, "Header name") if name.lower() == 'content-type': if code not in NO_MESSAGE_BODY: return @@ -426,6 +436,6 @@ # Technically a string is legal, which is why it's a really bad # idea, because it may cause the response to be returned # character-by-character - assert_(not isinstance(iterator, str), + assert_(not isinstance(iterator, (str, bytes)), "You should not return a string as your application iterator, " "instead return a single-item list containing that string.") Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 3 19:57:08 2009 @@ -52,6 +52,10 @@ Library ------- +- Issue #4718: Adapt the wsgiref package so that it actually works with + Python 3.x, in accordance with the `official amendments of the spec + `_. + - Fractions.from_float() no longer loses precision for integers too big to cast as floats. From python-checkins at python.org Sat Jan 3 20:02:24 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 20:02:24 +0100 (CET) Subject: [Python-checkins] r68208 - in python/trunk: Doc/library/decimal.rst Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS Message-ID: <20090103190224.9F2EE1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 20:02:23 2009 New Revision: 68208 Log: Issue 4796: Add from_float methods to the decimal module. Modified: python/trunk/Doc/library/decimal.rst python/trunk/Lib/decimal.py python/trunk/Lib/test/test_decimal.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/decimal.rst ============================================================================== --- python/trunk/Doc/library/decimal.rst (original) +++ python/trunk/Doc/library/decimal.rst Sat Jan 3 20:02:23 2009 @@ -484,6 +484,29 @@ .. versionadded:: 2.6 + .. method:: from_float(f) + + Classmethod that converts a float to a decimal number, exactly. + + Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + `0x1.999999999999ap-4`. That equivalent value in decimal is + `0.1000000000000000055511151231257827021181583404541015625`. + + .. doctest:: + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(float('-inf')) + Decimal('-Infinity') + + .. versionadded:: 2.7 + .. method:: fma(other, third[, context]) Fused multiply-add. Return self*other+third with no rounding of the @@ -1007,6 +1030,26 @@ If the argument is a string, no leading or trailing whitespace is permitted. +.. method:: create_decimal_from_float(f) + + Creates a new Decimal instance from a float *f* but rounding using *self* + as the context. Unlike the :method:`Decimal.from_float` class method, + the context precision, rounding method, flags, and traps are applied to + the conversion. + + .. doctest:: + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(math.pi) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(math.pi) + Traceback (most recent call last): + ... + Inexact: None + + .. versionadded:: 2.7 + .. method:: Etiny() Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sat Jan 3 20:02:23 2009 @@ -135,6 +135,7 @@ ] import copy as _copy +import math as _math try: from collections import namedtuple as _namedtuple @@ -242,7 +243,7 @@ """ def handle(self, context, sign, *args): - return _SignedInfinity[sign] + return _Infsign[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -340,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return _SignedInfinity[sign] + return _Infsign[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return _SignedInfinity[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return _SignedInfinity[sign] + return _Infsign[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -653,6 +654,38 @@ raise TypeError("Cannot convert %r to Decimal" % value) + @classmethod + def from_float(cls, f): + """Converts a float to a decimal number, exactly. + + Note that Decimal.from_float(0.1) is not the same as Decimal('0.1'). + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + 0x1.999999999999ap-4. The exact equivalent of the value in decimal + is 0.1000000000000000055511151231257827021181583404541015625. + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(-float('inf')) + Decimal('-Infinity') + >>> Decimal.from_float(-0.0) + Decimal('-0') + + """ + if isinstance(f, (int, long)): # handle integer inputs + return cls(f) + if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float + return cls(repr(f)) + sign = 0 if _math.copysign(1.0, f) == 1.0 else 1 + n, d = abs(f).as_integer_ratio() + k = d.bit_length() - 1 + result = _dec_from_triple(sign, str(n*5**k), -k) + return result if cls is Decimal else cls(result) + def _isnan(self): """Returns whether the number is not actually one. @@ -1171,12 +1204,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return _SignedInfinity[resultsign] + return _Infsign[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return _SignedInfinity[resultsign] + return _Infsign[resultsign] resultexp = self._exp + other._exp @@ -1226,7 +1259,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return _SignedInfinity[sign] + return _Infsign[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1329,7 +1362,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (_SignedInfinity[sign], + return (_Infsign[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1477,7 +1510,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return _SignedInfinity[self._sign ^ other._sign] + return _Infsign[self._sign ^ other._sign] if not other: if self: @@ -1732,12 +1765,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = _SignedInfinity[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = _SignedInfinity[self._sign ^ other._sign] + product = _Infsign[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2087,7 +2120,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return _One + return _Dec_p1 # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2109,19 +2142,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return _SignedInfinity[result_sign] + return _Infsign[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return _SignedInfinity[result_sign] + return _Infsign[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == _One: + if self == _Dec_p1: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2154,7 +2187,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return _SignedInfinity[result_sign] + return _Infsign[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2674,9 +2707,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return _NegativeOne + return _Dec_n1 if not self._sign and other._sign: - return _One + return _Dec_p1 sign = self._sign # let's handle both NaN types @@ -2686,51 +2719,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return _One + return _Dec_p1 else: - return _NegativeOne + return _Dec_n1 if self._int > other._int: if sign: - return _NegativeOne + return _Dec_n1 else: - return _One - return _Zero + return _Dec_p1 + return _Dec_0 if sign: if self_nan == 1: - return _NegativeOne + return _Dec_n1 if other_nan == 1: - return _One + return _Dec_p1 if self_nan == 2: - return _NegativeOne + return _Dec_n1 if other_nan == 2: - return _One + return _Dec_p1 else: if self_nan == 1: - return _One + return _Dec_p1 if other_nan == 1: - return _NegativeOne + return _Dec_n1 if self_nan == 2: - return _One + return _Dec_p1 if other_nan == 2: - return _NegativeOne + return _Dec_n1 if self < other: - return _NegativeOne + return _Dec_n1 if self > other: - return _One + return _Dec_p1 if self._exp < other._exp: if sign: - return _One + return _Dec_p1 else: - return _NegativeOne + return _Dec_n1 if self._exp > other._exp: if sign: - return _NegativeOne + return _Dec_n1 else: - return _One - return _Zero + return _Dec_p1 + return _Dec_0 def compare_total_mag(self, other): @@ -2771,11 +2804,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return _Zero + return _Dec_0 # exp(0) = 1 if not self: - return _One + return _Dec_p1 # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2927,15 +2960,15 @@ # ln(0.0) == -Infinity if not self: - return _NegativeInfinity + return _negInf # ln(Infinity) = Infinity if self._isinfinity() == 1: - return _Infinity + return _Inf # ln(1.0) == 0.0 - if self == _One: - return _Zero + if self == _Dec_p1: + return _Dec_0 # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3007,11 +3040,11 @@ # log10(0.0) == -Infinity if not self: - return _NegativeInfinity + return _negInf # log10(Infinity) = Infinity if self._isinfinity() == 1: - return _Infinity + return _Inf # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3063,7 +3096,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return _Infinity + return _Inf # logb(0) = -Inf, DivisionByZero if not self: @@ -3220,7 +3253,7 @@ return ans if self._isinfinity() == -1: - return _NegativeInfinity + return _negInf if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3243,7 +3276,7 @@ return ans if self._isinfinity() == 1: - return _Infinity + return _Inf if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -3744,6 +3777,23 @@ "diagnostic info too long in NaN") return d._fix(self) + def create_decimal_from_float(self, f): + """Creates a new Decimal instance from a float but rounding using self + as the context. + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(3.1415926535897932) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(3.1415926535897932) + Traceback (most recent call last): + ... + Inexact: None + + """ + d = Decimal.from_float(f) # An exact conversion + return d._fix(self) # Apply the context rounding + # Methods def abs(self, a): """Returns the absolute value of the operand. @@ -5490,15 +5540,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -_Infinity = Decimal('Inf') -_NegativeInfinity = Decimal('-Inf') +_Inf = Decimal('Inf') +_negInf = Decimal('-Inf') _NaN = Decimal('NaN') -_Zero = Decimal(0) -_One = Decimal(1) -_NegativeOne = Decimal(-1) +_Dec_0 = Decimal(0) +_Dec_p1 = Decimal(1) +_Dec_n1 = Decimal(-1) -# _SignedInfinity[sign] is infinity w/ that sign -_SignedInfinity = (_Infinity, _NegativeInfinity) +# _Infsign[sign] is infinity w/ that sign +_Infsign = (_Inf, _negInf) Modified: python/trunk/Lib/test/test_decimal.py ============================================================================== --- python/trunk/Lib/test/test_decimal.py (original) +++ python/trunk/Lib/test/test_decimal.py Sat Jan 3 20:02:23 2009 @@ -1361,6 +1361,55 @@ r = d.to_integral(ROUND_DOWN) self.assertEqual(Decimal(math.trunc(d)), r) + def test_from_float(self): + + class MyDecimal(Decimal): + pass + + r = MyDecimal.from_float(0.1) + self.assertEqual(type(r), MyDecimal) + self.assertEqual(str(r), + '0.1000000000000000055511151231257827021181583404541015625') + bigint = 12345678901234567890123456789 + self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) + self.assert_(MyDecimal.from_float(float('nan')).is_qnan()) + self.assert_(MyDecimal.from_float(float('inf')).is_infinite()) + self.assert_(MyDecimal.from_float(float('-inf')).is_infinite()) + self.assertEqual(str(MyDecimal.from_float(float('nan'))), + str(Decimal('NaN'))) + self.assertEqual(str(MyDecimal.from_float(float('inf'))), + str(Decimal('Infinity'))) + self.assertEqual(str(MyDecimal.from_float(float('-inf'))), + str(Decimal('-Infinity'))) + self.assertRaises(TypeError, MyDecimal.from_float, 'abc') + for i in range(200): + x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0) + self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip + + def test_create_decimal_from_float(self): + context = Context(prec=5, rounding=ROUND_DOWN) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1415') + ) + context = Context(prec=5, rounding=ROUND_UP) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1416') + ) + context = Context(prec=5, traps=[Inexact]) + self.assertRaises( + Inexact, + context.create_decimal_from_float, + math.pi + ) + self.assertEqual(repr(context.create_decimal_from_float(-0.0)), + "Decimal('-0')") + self.assertEqual(repr(context.create_decimal_from_float(1.0)), + "Decimal('1')") + self.assertEqual(repr(context.create_decimal_from_float(10)), + "Decimal('10')") + class ContextAPItests(unittest.TestCase): def test_pickle(self): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 3 20:02:23 2009 @@ -12,8 +12,6 @@ Core and Builtins ----------------- -- Issue #4817: Remove unused function PyOS_GetLastModificationTime. - - Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open @@ -110,6 +108,9 @@ Library ------- +- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() + to the decimal module. + - Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) From buildbot at python.org Sat Jan 3 20:07:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 19:07:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090103190711.90AEF1E4002@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/57 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,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test_distutils test_doctest 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 python-checkins at python.org Sat Jan 3 20:08:13 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 20:08:13 +0100 (CET) Subject: [Python-checkins] r68209 - python/trunk/Lib/decimal.py Message-ID: <20090103190813.23DBE1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 20:08:10 2009 New Revision: 68209 Log: Reapply r68191. Modified: python/trunk/Lib/decimal.py Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sat Jan 3 20:08:10 2009 @@ -243,7 +243,7 @@ """ def handle(self, context, sign, *args): - return _Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -341,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return _Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return _Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -1204,12 +1204,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return _Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1259,7 +1259,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return _Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1362,7 +1362,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (_Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1510,7 +1510,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return _Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1765,12 +1765,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = _Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2120,7 +2120,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return _Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2142,19 +2142,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == _Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2187,7 +2187,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return _Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2707,9 +2707,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return _Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return _Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2719,51 +2719,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return _Dec_n1 + return _NegativeOne if other_nan == 1: - return _Dec_p1 + return _One if self_nan == 2: - return _Dec_n1 + return _NegativeOne if other_nan == 2: - return _Dec_p1 + return _One else: if self_nan == 1: - return _Dec_p1 + return _One if other_nan == 1: - return _Dec_n1 + return _NegativeOne if self_nan == 2: - return _Dec_p1 + return _One if other_nan == 2: - return _Dec_n1 + return _NegativeOne if self < other: - return _Dec_n1 + return _NegativeOne if self > other: - return _Dec_p1 + return _One if self._exp < other._exp: if sign: - return _Dec_p1 + return _One else: - return _Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return _Dec_n1 + return _NegativeOne else: - return _Dec_p1 - return _Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2804,11 +2804,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return _Dec_0 + return _Zero # exp(0) = 1 if not self: - return _Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2960,15 +2960,15 @@ # ln(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # ln(1.0) == 0.0 - if self == _Dec_p1: - return _Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3040,11 +3040,11 @@ # log10(0.0) == -Infinity if not self: - return _negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return _Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3096,7 +3096,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return _Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3253,7 +3253,7 @@ return ans if self._isinfinity() == -1: - return _negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3276,7 +3276,7 @@ return ans if self._isinfinity() == 1: - return _Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -5540,15 +5540,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -_Inf = Decimal('Inf') -_negInf = Decimal('-Inf') +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') _NaN = Decimal('NaN') -_Dec_0 = Decimal(0) -_Dec_p1 = Decimal(1) -_Dec_n1 = Decimal(-1) +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# _Infsign[sign] is infinity w/ that sign -_Infsign = (_Inf, _negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) From buildbot at python.org Sat Jan 3 20:10:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 19:10:01 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090103191001.BF8351E400C@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/63 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 test Excerpt from the test logfile: 1 test failed: test_wsgiref ====================================================================== ERROR: testEnviron (test.test_wsgiref.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_wsgiref.py", line 490, in testEnviron File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_wsgiref.py", line 482, in checkOSEnviron KeyError: 'AUTH_TYPE' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 20:10:13 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 20:10:13 +0100 (CET) Subject: [Python-checkins] r68210 - python/trunk/Doc/includes/mp_distributing.py Message-ID: <20090103191013.1735D1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 20:10:12 2009 New Revision: 68210 Log: Set eol-style correctly for mp_distributing.py. Modified: python/trunk/Doc/includes/mp_distributing.py (contents, props changed) Modified: python/trunk/Doc/includes/mp_distributing.py ============================================================================== --- python/trunk/Doc/includes/mp_distributing.py (original) +++ python/trunk/Doc/includes/mp_distributing.py Sat Jan 3 20:10:12 2009 @@ -1,364 +1,364 @@ -# -# Module to allow spawning of processes on foreign host -# -# Depends on `multiprocessing` package -- tested with `processing-0.60` -# -# Copyright (c) 2006-2008, R Oudkerk -# All rights reserved. -# - -__all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] - -# -# Imports -# - -import sys -import os -import tarfile -import shutil -import subprocess -import logging -import itertools -import Queue - -try: - import cPickle as pickle -except ImportError: - import pickle - -from multiprocessing import Process, current_process, cpu_count -from multiprocessing import util, managers, connection, forking, pool - -# -# Logging -# - -def get_logger(): - return _logger - -_logger = logging.getLogger('distributing') -_logger.propogate = 0 - -_formatter = logging.Formatter(util.DEFAULT_LOGGING_FORMAT) -_handler = logging.StreamHandler() -_handler.setFormatter(_formatter) -_logger.addHandler(_handler) - -info = _logger.info -debug = _logger.debug - -# -# Get number of cpus -# - -try: - slot_count = cpu_count() -except NotImplemented: - slot_count = 1 - -# -# Manager type which spawns subprocesses -# - -class HostManager(managers.SyncManager): - ''' - Manager type used for spawning processes on a (presumably) foreign host - ''' - def __init__(self, address, authkey): - managers.SyncManager.__init__(self, address, authkey) - self._name = 'Host-unknown' - - def Process(self, group=None, target=None, name=None, args=(), kwargs={}): - if hasattr(sys.modules['__main__'], '__file__'): - main_path = os.path.basename(sys.modules['__main__'].__file__) - else: - main_path = None - data = pickle.dumps((target, args, kwargs)) - p = self._RemoteProcess(data, main_path) - if name is None: - temp = self._name.split('Host-')[-1] + '/Process-%s' - name = temp % ':'.join(map(str, p.get_identity())) - p.set_name(name) - return p - - @classmethod - def from_address(cls, address, authkey): - manager = cls(address, authkey) - managers.transact(address, authkey, 'dummy') - manager._state.value = managers.State.STARTED - manager._name = 'Host-%s:%s' % manager.address - manager.shutdown = util.Finalize( - manager, HostManager._finalize_host, - args=(manager._address, manager._authkey, manager._name), - exitpriority=-10 - ) - return manager - - @staticmethod - def _finalize_host(address, authkey, name): - managers.transact(address, authkey, 'shutdown') - - def __repr__(self): - return '' % self._name - -# -# Process subclass representing a process on (possibly) a remote machine -# - -class RemoteProcess(Process): - ''' - Represents a process started on a remote host - ''' - def __init__(self, data, main_path): - assert not main_path or os.path.basename(main_path) == main_path - Process.__init__(self) - self._data = data - self._main_path = main_path - - def _bootstrap(self): - forking.prepare({'main_path': self._main_path}) - self._target, self._args, self._kwargs = pickle.loads(self._data) - return Process._bootstrap(self) - - def get_identity(self): - return self._identity - -HostManager.register('_RemoteProcess', RemoteProcess) - -# -# A Pool class that uses a cluster -# - -class DistributedPool(pool.Pool): - - def __init__(self, cluster, processes=None, initializer=None, initargs=()): - self._cluster = cluster - self.Process = cluster.Process - pool.Pool.__init__(self, processes or len(cluster), - initializer, initargs) - - def _setup_queues(self): - self._inqueue = self._cluster._SettableQueue() - self._outqueue = self._cluster._SettableQueue() - self._quick_put = self._inqueue.put - self._quick_get = self._outqueue.get - - @staticmethod - def _help_stuff_finish(inqueue, task_handler, size): - inqueue.set_contents([None] * size) - -# -# Manager type which starts host managers on other machines -# - -def LocalProcess(**kwds): - p = Process(**kwds) - p.set_name('localhost/' + p.name) - return p - -class Cluster(managers.SyncManager): - ''' - Represents collection of slots running on various hosts. - - `Cluster` is a subclass of `SyncManager` so it allows creation of - various types of shared objects. - ''' - def __init__(self, hostlist, modules): - managers.SyncManager.__init__(self, address=('localhost', 0)) - self._hostlist = hostlist - self._modules = modules - if __name__ not in modules: - modules.append(__name__) - files = [sys.modules[name].__file__ for name in modules] - for i, file in enumerate(files): - if file.endswith('.pyc') or file.endswith('.pyo'): - files[i] = file[:-4] + '.py' - self._files = [os.path.abspath(file) for file in files] - - def start(self): - managers.SyncManager.start(self) - - l = connection.Listener(family='AF_INET', authkey=self._authkey) - - for i, host in enumerate(self._hostlist): - host._start_manager(i, self._authkey, l.address, self._files) - - for host in self._hostlist: - if host.hostname != 'localhost': - conn = l.accept() - i, address, cpus = conn.recv() - conn.close() - other_host = self._hostlist[i] - other_host.manager = HostManager.from_address(address, - self._authkey) - other_host.slots = other_host.slots or cpus - other_host.Process = other_host.manager.Process - else: - host.slots = host.slots or slot_count - host.Process = LocalProcess - - self._slotlist = [ - Slot(host) for host in self._hostlist for i in range(host.slots) - ] - self._slot_iterator = itertools.cycle(self._slotlist) - self._base_shutdown = self.shutdown - del self.shutdown - - def shutdown(self): - for host in self._hostlist: - if host.hostname != 'localhost': - host.manager.shutdown() - self._base_shutdown() - - def Process(self, group=None, target=None, name=None, args=(), kwargs={}): - slot = self._slot_iterator.next() - return slot.Process( - group=group, target=target, name=name, args=args, kwargs=kwargs - ) - - def Pool(self, processes=None, initializer=None, initargs=()): - return DistributedPool(self, processes, initializer, initargs) - - def __getitem__(self, i): - return self._slotlist[i] - - def __len__(self): - return len(self._slotlist) - - def __iter__(self): - return iter(self._slotlist) - -# -# Queue subclass used by distributed pool -# - -class SettableQueue(Queue.Queue): - def empty(self): - return not self.queue - def full(self): - return self.maxsize > 0 and len(self.queue) == self.maxsize - def set_contents(self, contents): - # length of contents must be at least as large as the number of - # threads which have potentially called get() - self.not_empty.acquire() - try: - self.queue.clear() - self.queue.extend(contents) - self.not_empty.notifyAll() - finally: - self.not_empty.release() - -Cluster.register('_SettableQueue', SettableQueue) - -# -# Class representing a notional cpu in the cluster -# - -class Slot(object): - def __init__(self, host): - self.host = host - self.Process = host.Process - -# -# Host -# - -class Host(object): - ''' - Represents a host to use as a node in a cluster. - - `hostname` gives the name of the host. If hostname is not - "localhost" then ssh is used to log in to the host. To log in as - a different user use a host name of the form - "username at somewhere.org" - - `slots` is used to specify the number of slots for processes on - the host. This affects how often processes will be allocated to - this host. Normally this should be equal to the number of cpus on - that host. - ''' - def __init__(self, hostname, slots=None): - self.hostname = hostname - self.slots = slots - - def _start_manager(self, index, authkey, address, files): - if self.hostname != 'localhost': - tempdir = copy_to_remote_temporary_directory(self.hostname, files) - debug('startup files copied to %s:%s', self.hostname, tempdir) - p = subprocess.Popen( - ['ssh', self.hostname, 'python', '-c', - '"import os; os.chdir(%r); ' - 'from distributing import main; main()"' % tempdir], - stdin=subprocess.PIPE - ) - data = dict( - name='BoostrappingHost', index=index, - dist_log_level=_logger.getEffectiveLevel(), - dir=tempdir, authkey=str(authkey), parent_address=address - ) - pickle.dump(data, p.stdin, pickle.HIGHEST_PROTOCOL) - p.stdin.close() - -# -# Copy files to remote directory, returning name of directory -# - -unzip_code = '''" -import tempfile, os, sys, tarfile -tempdir = tempfile.mkdtemp(prefix='distrib-') -os.chdir(tempdir) -tf = tarfile.open(fileobj=sys.stdin, mode='r|gz') -for ti in tf: - tf.extract(ti) -print tempdir -"''' - -def copy_to_remote_temporary_directory(host, files): - p = subprocess.Popen( - ['ssh', host, 'python', '-c', unzip_code], - stdout=subprocess.PIPE, stdin=subprocess.PIPE - ) - tf = tarfile.open(fileobj=p.stdin, mode='w|gz') - for name in files: - tf.add(name, os.path.basename(name)) - tf.close() - p.stdin.close() - return p.stdout.read().rstrip() - -# -# Code which runs a host manager -# - -def main(): - # get data from parent over stdin - data = pickle.load(sys.stdin) - sys.stdin.close() - - # set some stuff - _logger.setLevel(data['dist_log_level']) - forking.prepare(data) - - # create server for a `HostManager` object - server = managers.Server(HostManager._registry, ('', 0), data['authkey']) - current_process()._server = server - - # report server address and number of cpus back to parent - conn = connection.Client(data['parent_address'], authkey=data['authkey']) - conn.send((data['index'], server.address, slot_count)) - conn.close() - - # set name etc - current_process().set_name('Host-%s:%s' % server.address) - util._run_after_forkers() - - # register a cleanup function - def cleanup(directory): - debug('removing directory %s', directory) - shutil.rmtree(directory) - debug('shutting down host manager') - util.Finalize(None, cleanup, args=[data['dir']], exitpriority=0) - - # start host manager - debug('remote host manager starting in %s', data['dir']) - server.serve_forever() +# +# Module to allow spawning of processes on foreign host +# +# Depends on `multiprocessing` package -- tested with `processing-0.60` +# +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# + +__all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] + +# +# Imports +# + +import sys +import os +import tarfile +import shutil +import subprocess +import logging +import itertools +import Queue + +try: + import cPickle as pickle +except ImportError: + import pickle + +from multiprocessing import Process, current_process, cpu_count +from multiprocessing import util, managers, connection, forking, pool + +# +# Logging +# + +def get_logger(): + return _logger + +_logger = logging.getLogger('distributing') +_logger.propogate = 0 + +_formatter = logging.Formatter(util.DEFAULT_LOGGING_FORMAT) +_handler = logging.StreamHandler() +_handler.setFormatter(_formatter) +_logger.addHandler(_handler) + +info = _logger.info +debug = _logger.debug + +# +# Get number of cpus +# + +try: + slot_count = cpu_count() +except NotImplemented: + slot_count = 1 + +# +# Manager type which spawns subprocesses +# + +class HostManager(managers.SyncManager): + ''' + Manager type used for spawning processes on a (presumably) foreign host + ''' + def __init__(self, address, authkey): + managers.SyncManager.__init__(self, address, authkey) + self._name = 'Host-unknown' + + def Process(self, group=None, target=None, name=None, args=(), kwargs={}): + if hasattr(sys.modules['__main__'], '__file__'): + main_path = os.path.basename(sys.modules['__main__'].__file__) + else: + main_path = None + data = pickle.dumps((target, args, kwargs)) + p = self._RemoteProcess(data, main_path) + if name is None: + temp = self._name.split('Host-')[-1] + '/Process-%s' + name = temp % ':'.join(map(str, p.get_identity())) + p.set_name(name) + return p + + @classmethod + def from_address(cls, address, authkey): + manager = cls(address, authkey) + managers.transact(address, authkey, 'dummy') + manager._state.value = managers.State.STARTED + manager._name = 'Host-%s:%s' % manager.address + manager.shutdown = util.Finalize( + manager, HostManager._finalize_host, + args=(manager._address, manager._authkey, manager._name), + exitpriority=-10 + ) + return manager + + @staticmethod + def _finalize_host(address, authkey, name): + managers.transact(address, authkey, 'shutdown') + + def __repr__(self): + return '' % self._name + +# +# Process subclass representing a process on (possibly) a remote machine +# + +class RemoteProcess(Process): + ''' + Represents a process started on a remote host + ''' + def __init__(self, data, main_path): + assert not main_path or os.path.basename(main_path) == main_path + Process.__init__(self) + self._data = data + self._main_path = main_path + + def _bootstrap(self): + forking.prepare({'main_path': self._main_path}) + self._target, self._args, self._kwargs = pickle.loads(self._data) + return Process._bootstrap(self) + + def get_identity(self): + return self._identity + +HostManager.register('_RemoteProcess', RemoteProcess) + +# +# A Pool class that uses a cluster +# + +class DistributedPool(pool.Pool): + + def __init__(self, cluster, processes=None, initializer=None, initargs=()): + self._cluster = cluster + self.Process = cluster.Process + pool.Pool.__init__(self, processes or len(cluster), + initializer, initargs) + + def _setup_queues(self): + self._inqueue = self._cluster._SettableQueue() + self._outqueue = self._cluster._SettableQueue() + self._quick_put = self._inqueue.put + self._quick_get = self._outqueue.get + + @staticmethod + def _help_stuff_finish(inqueue, task_handler, size): + inqueue.set_contents([None] * size) + +# +# Manager type which starts host managers on other machines +# + +def LocalProcess(**kwds): + p = Process(**kwds) + p.set_name('localhost/' + p.name) + return p + +class Cluster(managers.SyncManager): + ''' + Represents collection of slots running on various hosts. + + `Cluster` is a subclass of `SyncManager` so it allows creation of + various types of shared objects. + ''' + def __init__(self, hostlist, modules): + managers.SyncManager.__init__(self, address=('localhost', 0)) + self._hostlist = hostlist + self._modules = modules + if __name__ not in modules: + modules.append(__name__) + files = [sys.modules[name].__file__ for name in modules] + for i, file in enumerate(files): + if file.endswith('.pyc') or file.endswith('.pyo'): + files[i] = file[:-4] + '.py' + self._files = [os.path.abspath(file) for file in files] + + def start(self): + managers.SyncManager.start(self) + + l = connection.Listener(family='AF_INET', authkey=self._authkey) + + for i, host in enumerate(self._hostlist): + host._start_manager(i, self._authkey, l.address, self._files) + + for host in self._hostlist: + if host.hostname != 'localhost': + conn = l.accept() + i, address, cpus = conn.recv() + conn.close() + other_host = self._hostlist[i] + other_host.manager = HostManager.from_address(address, + self._authkey) + other_host.slots = other_host.slots or cpus + other_host.Process = other_host.manager.Process + else: + host.slots = host.slots or slot_count + host.Process = LocalProcess + + self._slotlist = [ + Slot(host) for host in self._hostlist for i in range(host.slots) + ] + self._slot_iterator = itertools.cycle(self._slotlist) + self._base_shutdown = self.shutdown + del self.shutdown + + def shutdown(self): + for host in self._hostlist: + if host.hostname != 'localhost': + host.manager.shutdown() + self._base_shutdown() + + def Process(self, group=None, target=None, name=None, args=(), kwargs={}): + slot = self._slot_iterator.next() + return slot.Process( + group=group, target=target, name=name, args=args, kwargs=kwargs + ) + + def Pool(self, processes=None, initializer=None, initargs=()): + return DistributedPool(self, processes, initializer, initargs) + + def __getitem__(self, i): + return self._slotlist[i] + + def __len__(self): + return len(self._slotlist) + + def __iter__(self): + return iter(self._slotlist) + +# +# Queue subclass used by distributed pool +# + +class SettableQueue(Queue.Queue): + def empty(self): + return not self.queue + def full(self): + return self.maxsize > 0 and len(self.queue) == self.maxsize + def set_contents(self, contents): + # length of contents must be at least as large as the number of + # threads which have potentially called get() + self.not_empty.acquire() + try: + self.queue.clear() + self.queue.extend(contents) + self.not_empty.notifyAll() + finally: + self.not_empty.release() + +Cluster.register('_SettableQueue', SettableQueue) + +# +# Class representing a notional cpu in the cluster +# + +class Slot(object): + def __init__(self, host): + self.host = host + self.Process = host.Process + +# +# Host +# + +class Host(object): + ''' + Represents a host to use as a node in a cluster. + + `hostname` gives the name of the host. If hostname is not + "localhost" then ssh is used to log in to the host. To log in as + a different user use a host name of the form + "username at somewhere.org" + + `slots` is used to specify the number of slots for processes on + the host. This affects how often processes will be allocated to + this host. Normally this should be equal to the number of cpus on + that host. + ''' + def __init__(self, hostname, slots=None): + self.hostname = hostname + self.slots = slots + + def _start_manager(self, index, authkey, address, files): + if self.hostname != 'localhost': + tempdir = copy_to_remote_temporary_directory(self.hostname, files) + debug('startup files copied to %s:%s', self.hostname, tempdir) + p = subprocess.Popen( + ['ssh', self.hostname, 'python', '-c', + '"import os; os.chdir(%r); ' + 'from distributing import main; main()"' % tempdir], + stdin=subprocess.PIPE + ) + data = dict( + name='BoostrappingHost', index=index, + dist_log_level=_logger.getEffectiveLevel(), + dir=tempdir, authkey=str(authkey), parent_address=address + ) + pickle.dump(data, p.stdin, pickle.HIGHEST_PROTOCOL) + p.stdin.close() + +# +# Copy files to remote directory, returning name of directory +# + +unzip_code = '''" +import tempfile, os, sys, tarfile +tempdir = tempfile.mkdtemp(prefix='distrib-') +os.chdir(tempdir) +tf = tarfile.open(fileobj=sys.stdin, mode='r|gz') +for ti in tf: + tf.extract(ti) +print tempdir +"''' + +def copy_to_remote_temporary_directory(host, files): + p = subprocess.Popen( + ['ssh', host, 'python', '-c', unzip_code], + stdout=subprocess.PIPE, stdin=subprocess.PIPE + ) + tf = tarfile.open(fileobj=p.stdin, mode='w|gz') + for name in files: + tf.add(name, os.path.basename(name)) + tf.close() + p.stdin.close() + return p.stdout.read().rstrip() + +# +# Code which runs a host manager +# + +def main(): + # get data from parent over stdin + data = pickle.load(sys.stdin) + sys.stdin.close() + + # set some stuff + _logger.setLevel(data['dist_log_level']) + forking.prepare(data) + + # create server for a `HostManager` object + server = managers.Server(HostManager._registry, ('', 0), data['authkey']) + current_process()._server = server + + # report server address and number of cpus back to parent + conn = connection.Client(data['parent_address'], authkey=data['authkey']) + conn.send((data['index'], server.address, slot_count)) + conn.close() + + # set name etc + current_process().set_name('Host-%s:%s' % server.address) + util._run_after_forkers() + + # register a cleanup function + def cleanup(directory): + debug('removing directory %s', directory) + shutil.rmtree(directory) + debug('shutting down host manager') + util.Finalize(None, cleanup, args=[data['dir']], exitpriority=0) + + # start host manager + debug('remote host manager starting in %s', data['dir']) + server.serve_forever() From python-checkins at python.org Sat Jan 3 20:20:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 3 Jan 2009 20:20:32 +0100 (CET) Subject: [Python-checkins] r68211 - in python/branches/py3k: Doc/library/decimal.rst Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS Message-ID: <20090103192032.89D111E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 3 20:20:32 2009 New Revision: 68211 Log: Issue 4796: Add from_float methods to the decimal module. Modified: python/branches/py3k/Doc/library/decimal.rst python/branches/py3k/Lib/decimal.py python/branches/py3k/Lib/test/test_decimal.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k/Doc/library/decimal.rst (original) +++ python/branches/py3k/Doc/library/decimal.rst Sat Jan 3 20:20:32 2009 @@ -453,6 +453,29 @@ >>> Decimal(321).exp() Decimal('2.561702493119680037517373933E+139') + .. method:: from_float(f) + + Classmethod that converts a float to a decimal number, exactly. + + Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + `0x1.999999999999ap-4`. That equivalent value in decimal is + `0.1000000000000000055511151231257827021181583404541015625`. + + .. doctest:: + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(float('-inf')) + Decimal('-Infinity') + + .. versionadded:: 2.7 + .. method:: fma(other, third[, context]) Fused multiply-add. Return self*other+third with no rounding of the @@ -910,6 +933,26 @@ If the argument is a string, no leading or trailing whitespace is permitted. +.. method:: create_decimal_from_float(f) + + Creates a new Decimal instance from a float *f* but rounding using *self* + as the context. Unlike the :method:`Decimal.from_float` class method, + the context precision, rounding method, flags, and traps are applied to + the conversion. + + .. doctest:: + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(math.pi) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(math.pi) + Traceback (most recent call last): + ... + decimal.Inexact: None + + .. versionadded:: 2.7 + .. method:: Etiny() Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent Modified: python/branches/py3k/Lib/decimal.py ============================================================================== --- python/branches/py3k/Lib/decimal.py (original) +++ python/branches/py3k/Lib/decimal.py Sat Jan 3 20:20:32 2009 @@ -136,6 +136,7 @@ import numbers as _numbers import copy as _copy +import math as _math try: from collections import namedtuple as _namedtuple @@ -654,6 +655,38 @@ raise TypeError("Cannot convert %r to Decimal" % value) + @classmethod + def from_float(cls, f): + """Converts a float to a decimal number, exactly. + + Note that Decimal.from_float(0.1) is not the same as Decimal('0.1'). + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + 0x1.999999999999ap-4. The exact equivalent of the value in decimal + is 0.1000000000000000055511151231257827021181583404541015625. + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(-float('inf')) + Decimal('-Infinity') + >>> Decimal.from_float(-0.0) + Decimal('-0') + + """ + if isinstance(f, int): # handle integer inputs + return cls(f) + if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float + return cls(repr(f)) + sign = 0 if _math.copysign(1.0, f) == 1.0 else 1 + n, d = abs(f).as_integer_ratio() + k = d.bit_length() - 1 + result = _dec_from_triple(sign, str(n*5**k), -k) + return result if cls is Decimal else cls(result) + def _isnan(self): """Returns whether the number is not actually one. @@ -3830,6 +3863,23 @@ "diagnostic info too long in NaN") return d._fix(self) + def create_decimal_from_float(self, f): + """Creates a new Decimal instance from a float but rounding using self + as the context. + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(3.1415926535897932) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(3.1415926535897932) + Traceback (most recent call last): + ... + decimal.Inexact: None + + """ + d = Decimal.from_float(f) # An exact conversion + return d._fix(self) # Apply the context rounding + # Methods def abs(self, a): """Returns the absolute value of the operand. 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 Sat Jan 3 20:20:32 2009 @@ -1421,6 +1421,55 @@ r = d.to_integral(ROUND_DOWN) self.assertEqual(Decimal(math.trunc(d)), r) + def test_from_float(self): + + class MyDecimal(Decimal): + pass + + r = MyDecimal.from_float(0.1) + self.assertEqual(type(r), MyDecimal) + self.assertEqual(str(r), + '0.1000000000000000055511151231257827021181583404541015625') + bigint = 12345678901234567890123456789 + self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) + self.assert_(MyDecimal.from_float(float('nan')).is_qnan()) + self.assert_(MyDecimal.from_float(float('inf')).is_infinite()) + self.assert_(MyDecimal.from_float(float('-inf')).is_infinite()) + self.assertEqual(str(MyDecimal.from_float(float('nan'))), + str(Decimal('NaN'))) + self.assertEqual(str(MyDecimal.from_float(float('inf'))), + str(Decimal('Infinity'))) + self.assertEqual(str(MyDecimal.from_float(float('-inf'))), + str(Decimal('-Infinity'))) + self.assertRaises(TypeError, MyDecimal.from_float, 'abc') + for i in range(200): + x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0) + self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip + + def test_create_decimal_from_float(self): + context = Context(prec=5, rounding=ROUND_DOWN) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1415') + ) + context = Context(prec=5, rounding=ROUND_UP) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1416') + ) + context = Context(prec=5, traps=[Inexact]) + self.assertRaises( + Inexact, + context.create_decimal_from_float, + math.pi + ) + self.assertEqual(repr(context.create_decimal_from_float(-0.0)), + "Decimal('-0')") + self.assertEqual(repr(context.create_decimal_from_float(1.0)), + "Decimal('1')") + self.assertEqual(repr(context.create_decimal_from_float(10)), + "Decimal('10')") + class ContextAPItests(unittest.TestCase): def test_pickle(self): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 20:20:32 2009 @@ -12,8 +12,6 @@ Core and Builtins ----------------- -- Issue #4817: Remove unused function PyOS_GetLastModificationTime. - - Issue #4580: Fix slicing of memoryviews when the item size is greater than one byte. Also fixes the meaning of len() so that it returns the number of items, rather than the size in bytes. @@ -88,6 +86,9 @@ Python 3.x, in accordance with the `official amendments of the spec `_. +- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() + to the decimal module. + - Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) From python-checkins at python.org Sat Jan 3 20:20:37 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 20:20:37 +0100 (CET) Subject: [Python-checkins] r68212 - in python/branches/py3k: Include/memoryobject.h Objects/memoryobject.c Message-ID: <20090103192037.3C6641E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 20:20:36 2009 New Revision: 68212 Log: Issue #4822: fix messy indentation in memoryobject.c/.h, before we may backport it to trunk. Reviewed on IRC by Georg Brandl, with assistance by Benjamin Peterson. Modified: python/branches/py3k/Include/memoryobject.h python/branches/py3k/Objects/memoryobject.c Modified: python/branches/py3k/Include/memoryobject.h ============================================================================== --- python/branches/py3k/Include/memoryobject.h (original) +++ python/branches/py3k/Include/memoryobject.h Sat Jan 3 20:20:36 2009 @@ -20,53 +20,53 @@ int buffertype, char fort); - /* Return a contiguous chunk of memory representing the buffer - from an object in a memory view object. If a copy is made then the - base object for the memory view will be a *new* bytes object. - - Otherwise, the base-object will be the object itself and no - data-copying will be done. - - The buffertype argument can be PyBUF_READ, PyBUF_WRITE, - PyBUF_SHADOW to determine whether the returned buffer - should be READONLY, WRITABLE, or set to update the - original buffer if a copy must be made. If buffertype is - PyBUF_WRITE and the buffer is not contiguous an error will - be raised. In this circumstance, the user can use - PyBUF_SHADOW to ensure that a a writable temporary - contiguous buffer is returned. The contents of this - contiguous buffer will be copied back into the original - object after the memoryview object is deleted as long as - the original object is writable and allows setting an - exclusive write lock. If this is not allowed by the - original object, then a BufferError is raised. - - If the object is multi-dimensional and if fortran is 'F', - the first dimension of the underlying array will vary the - fastest in the buffer. If fortran is 'C', then the last - dimension will vary the fastest (C-style contiguous). If - fortran is 'A', then it does not matter and you will get - whatever the object decides is more efficient. + /* Return a contiguous chunk of memory representing the buffer + from an object in a memory view object. If a copy is made then the + base object for the memory view will be a *new* bytes object. + + Otherwise, the base-object will be the object itself and no + data-copying will be done. + + The buffertype argument can be PyBUF_READ, PyBUF_WRITE, + PyBUF_SHADOW to determine whether the returned buffer + should be READONLY, WRITABLE, or set to update the + original buffer if a copy must be made. If buffertype is + PyBUF_WRITE and the buffer is not contiguous an error will + be raised. In this circumstance, the user can use + PyBUF_SHADOW to ensure that a a writable temporary + contiguous buffer is returned. The contents of this + contiguous buffer will be copied back into the original + object after the memoryview object is deleted as long as + the original object is writable and allows setting an + exclusive write lock. If this is not allowed by the + original object, then a BufferError is raised. + + If the object is multi-dimensional and if fortran is 'F', + the first dimension of the underlying array will vary the + fastest in the buffer. If fortran is 'C', then the last + dimension will vary the fastest (C-style contiguous). If + fortran is 'A', then it does not matter and you will get + whatever the object decides is more efficient. - A new reference is returned that must be DECREF'd when finished. - */ + A new reference is returned that must be DECREF'd when finished. + */ PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info); - /* create new if bufptr is NULL - will be a new bytesobject in base */ + /* create new if bufptr is NULL + will be a new bytesobject in base */ + - /* The struct is declared here so that macros can work, but it shouldn't be considered public. Don't access those fields directly, use the macros and functions instead! */ typedef struct { - PyObject_HEAD - PyObject *base; - Py_buffer view; + PyObject_HEAD + PyObject *base; + Py_buffer view; } PyMemoryViewObject; - + #ifdef __cplusplus } Modified: python/branches/py3k/Objects/memoryobject.c ============================================================================== --- python/branches/py3k/Objects/memoryobject.c (original) +++ python/branches/py3k/Objects/memoryobject.c Sat Jan 3 20:20:36 2009 @@ -33,21 +33,21 @@ static int memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags) { - int res = 0; - /* XXX for whatever reason fixing the flags seems necessary */ - if (self->view.readonly) - flags &= ~PyBUF_WRITABLE; - if (self->view.obj != NULL) - res = PyObject_GetBuffer(self->view.obj, view, flags); - if (view) - dup_buffer(view, &self->view); - return res; + int res = 0; + /* XXX for whatever reason fixing the flags seems necessary */ + if (self->view.readonly) + flags &= ~PyBUF_WRITABLE; + if (self->view.obj != NULL) + res = PyObject_GetBuffer(self->view.obj, view, flags); + if (view) + dup_buffer(view, &self->view); + return res; } static void memory_releasebuf(PyMemoryViewObject *self, Py_buffer *view) { - PyBuffer_Release(view); + PyBuffer_Release(view); } PyDoc_STRVAR(memory_doc, @@ -58,61 +58,61 @@ PyObject * PyMemoryView_FromBuffer(Py_buffer *info) { - PyMemoryViewObject *mview; + PyMemoryViewObject *mview; - mview = (PyMemoryViewObject *) - PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mview == NULL) - return NULL; - mview->base = NULL; - dup_buffer(&mview->view, info); - /* NOTE: mview->view.obj should already have been incref'ed as - part of PyBuffer_FillInfo(). */ - _PyObject_GC_TRACK(mview); - return (PyObject *)mview; + mview = (PyMemoryViewObject *) + PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mview == NULL) + return NULL; + mview->base = NULL; + dup_buffer(&mview->view, info); + /* NOTE: mview->view.obj should already have been incref'ed as + part of PyBuffer_FillInfo(). */ + _PyObject_GC_TRACK(mview); + return (PyObject *)mview; } PyObject * PyMemoryView_FromObject(PyObject *base) { - PyMemoryViewObject *mview; + PyMemoryViewObject *mview; - if (!PyObject_CheckBuffer(base)) { - PyErr_SetString(PyExc_TypeError, - "cannot make memory view because object does " - "not have the buffer interface"); - return NULL; - } + if (!PyObject_CheckBuffer(base)) { + PyErr_SetString(PyExc_TypeError, + "cannot make memory view because object does " + "not have the buffer interface"); + return NULL; + } - mview = (PyMemoryViewObject *) - PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mview == NULL) - return NULL; - - mview->base = NULL; - if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) { - Py_DECREF(mview); - return NULL; - } + mview = (PyMemoryViewObject *) + PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mview == NULL) + return NULL; - mview->base = base; - Py_INCREF(base); - _PyObject_GC_TRACK(mview); - return (PyObject *)mview; + mview->base = NULL; + if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) { + Py_DECREF(mview); + return NULL; + } + + mview->base = base; + Py_INCREF(base); + _PyObject_GC_TRACK(mview); + return (PyObject *)mview; } static PyObject * memory_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *obj; - static char *kwlist[] = {"object", 0}; + PyObject *obj; + static char *kwlist[] = {"object", 0}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist, - &obj)) { - return NULL; - } + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist, + &obj)) { + return NULL; + } - return PyMemoryView_FromObject(obj); + return PyMemoryView_FromObject(obj); } @@ -120,58 +120,58 @@ _strided_copy_nd(char *dest, char *src, int nd, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char fort) { - int k; - Py_ssize_t outstride; + int k; + Py_ssize_t outstride; - if (nd==0) { - memcpy(dest, src, itemsize); + if (nd==0) { + memcpy(dest, src, itemsize); + } + else if (nd == 1) { + for (k = 0; kndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { - PyErr_NoMemory(); - return -1; - } + if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { + PyErr_NoMemory(); + return -1; + } - indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); - if (indices == NULL) { - PyErr_NoMemory(); - return -1; - } - for (k=0; kndim;k++) { - indices[k] = 0; - } + indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); + if (indices == NULL) { + PyErr_NoMemory(); + return -1; + } + for (k=0; kndim;k++) { + indices[k] = 0; + } - elements = 1; - for (k=0; kndim; k++) { - elements *= view->shape[k]; - } - if (fort == 'F') { - func = _add_one_to_index_F; - } - else { - func = _add_one_to_index_C; - } - while (elements--) { - func(view->ndim, indices, view->shape); - ptr = PyBuffer_GetPointer(view, indices); - memcpy(dest, ptr, view->itemsize); - dest += view->itemsize; - } + elements = 1; + for (k=0; kndim; k++) { + elements *= view->shape[k]; + } + if (fort == 'F') { + func = _add_one_to_index_F; + } + else { + func = _add_one_to_index_C; + } + while (elements--) { + func(view->ndim, indices, view->shape); + ptr = PyBuffer_GetPointer(view, indices); + memcpy(dest, ptr, view->itemsize); + dest += view->itemsize; + } - PyMem_Free(indices); - return 0; + PyMem_Free(indices); + return 0; } /* @@ -240,181 +240,181 @@ the shadow buffer which can be written to and then will be copied back into the other buffer when the memory view is de-allocated. While the shadow buffer is - being used, it will have an exclusive write lock on - the original buffer. + being used, it will have an exclusive write lock on + the original buffer. */ PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort) { - PyMemoryViewObject *mem; - PyObject *bytes; - Py_buffer *view; - int flags; - char *dest; - - if (!PyObject_CheckBuffer(obj)) { - PyErr_SetString(PyExc_TypeError, - "object does not have the buffer interface"); - return NULL; - } + PyMemoryViewObject *mem; + PyObject *bytes; + Py_buffer *view; + int flags; + char *dest; - mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mem == NULL) - return NULL; - - view = &mem->view; - flags = PyBUF_FULL_RO; - switch(buffertype) { - case PyBUF_WRITE: - flags = PyBUF_FULL; - break; - } + if (!PyObject_CheckBuffer(obj)) { + PyErr_SetString(PyExc_TypeError, + "object does not have the buffer interface"); + return NULL; + } - if (PyObject_GetBuffer(obj, view, flags) != 0) { - Py_DECREF(mem); - return NULL; - } + mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mem == NULL) + return NULL; - if (PyBuffer_IsContiguous(view, fort)) { - /* no copy needed */ - Py_INCREF(obj); - mem->base = obj; - _PyObject_GC_TRACK(mem); - return (PyObject *)mem; - } - /* otherwise a copy is needed */ - if (buffertype == PyBUF_WRITE) { - Py_DECREF(mem); - PyErr_SetString(PyExc_BufferError, - "writable contiguous buffer requested " - "for a non-contiguousobject."); - return NULL; - } - bytes = PyBytes_FromStringAndSize(NULL, view->len); - if (bytes == NULL) { - Py_DECREF(mem); - return NULL; - } - dest = PyBytes_AS_STRING(bytes); - /* different copying strategy depending on whether - or not any pointer de-referencing is needed - */ - /* strided or in-direct copy */ - if (view->suboffsets==NULL) { - _strided_copy_nd(dest, view->buf, view->ndim, view->shape, - view->strides, view->itemsize, fort); - } - else { - if (_indirect_copy_nd(dest, view, fort) < 0) { - Py_DECREF(bytes); - Py_DECREF(mem); - return NULL; - } - } - if (buffertype == PyBUF_SHADOW) { - /* return a shadowed memory-view object */ - view->buf = dest; - mem->base = PyTuple_Pack(2, obj, bytes); - Py_DECREF(bytes); - if (mem->base == NULL) { - Py_DECREF(mem); - return NULL; - } + view = &mem->view; + flags = PyBUF_FULL_RO; + switch(buffertype) { + case PyBUF_WRITE: + flags = PyBUF_FULL; + break; + } + + if (PyObject_GetBuffer(obj, view, flags) != 0) { + Py_DECREF(mem); + return NULL; + } + + if (PyBuffer_IsContiguous(view, fort)) { + /* no copy needed */ + Py_INCREF(obj); + mem->base = obj; + _PyObject_GC_TRACK(mem); + return (PyObject *)mem; + } + /* otherwise a copy is needed */ + if (buffertype == PyBUF_WRITE) { + Py_DECREF(mem); + PyErr_SetString(PyExc_BufferError, + "writable contiguous buffer requested " + "for a non-contiguousobject."); + return NULL; + } + bytes = PyBytes_FromStringAndSize(NULL, view->len); + if (bytes == NULL) { + Py_DECREF(mem); + return NULL; + } + dest = PyBytes_AS_STRING(bytes); + /* different copying strategy depending on whether + or not any pointer de-referencing is needed + */ + /* strided or in-direct copy */ + if (view->suboffsets==NULL) { + _strided_copy_nd(dest, view->buf, view->ndim, view->shape, + view->strides, view->itemsize, fort); + } + else { + if (_indirect_copy_nd(dest, view, fort) < 0) { + Py_DECREF(bytes); + Py_DECREF(mem); + return NULL; } - else { - PyBuffer_Release(view); /* XXX ? */ - /* steal the reference */ - mem->base = bytes; + } + if (buffertype == PyBUF_SHADOW) { + /* return a shadowed memory-view object */ + view->buf = dest; + mem->base = PyTuple_Pack(2, obj, bytes); + Py_DECREF(bytes); + if (mem->base == NULL) { + Py_DECREF(mem); + return NULL; } - _PyObject_GC_TRACK(mem); - return (PyObject *)mem; + } + else { + PyBuffer_Release(view); /* XXX ? */ + /* steal the reference */ + mem->base = bytes; + } + _PyObject_GC_TRACK(mem); + return (PyObject *)mem; } static PyObject * memory_format_get(PyMemoryViewObject *self) { - return PyUnicode_FromString(self->view.format); + return PyUnicode_FromString(self->view.format); } static PyObject * memory_itemsize_get(PyMemoryViewObject *self) { - return PyLong_FromSsize_t(self->view.itemsize); + return PyLong_FromSsize_t(self->view.itemsize); } static PyObject * _IntTupleFromSsizet(int len, Py_ssize_t *vals) { - int i; - PyObject *o; - PyObject *intTuple; - - if (vals == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - intTuple = PyTuple_New(len); - if (!intTuple) return NULL; - for(i=0; iview.ndim, self->view.shape); + return _IntTupleFromSsizet(self->view.ndim, self->view.shape); } static PyObject * memory_strides_get(PyMemoryViewObject *self) { - return _IntTupleFromSsizet(self->view.ndim, self->view.strides); + return _IntTupleFromSsizet(self->view.ndim, self->view.strides); } static PyObject * memory_suboffsets_get(PyMemoryViewObject *self) { - return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); + return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); } static PyObject * memory_readonly_get(PyMemoryViewObject *self) { - return PyBool_FromLong(self->view.readonly); + return PyBool_FromLong(self->view.readonly); } static PyObject * memory_ndim_get(PyMemoryViewObject *self) { - return PyLong_FromLong(self->view.ndim); + return PyLong_FromLong(self->view.ndim); } static PyGetSetDef memory_getsetlist[] ={ - {"format", (getter)memory_format_get, NULL, NULL}, - {"itemsize", (getter)memory_itemsize_get, NULL, NULL}, - {"shape", (getter)memory_shape_get, NULL, NULL}, - {"strides", (getter)memory_strides_get, NULL, NULL}, - {"suboffsets", (getter)memory_suboffsets_get, NULL, NULL}, - {"readonly", (getter)memory_readonly_get, NULL, NULL}, - {"ndim", (getter)memory_ndim_get, NULL, NULL}, - {NULL, NULL, NULL, NULL}, + {"format", (getter)memory_format_get, NULL, NULL}, + {"itemsize", (getter)memory_itemsize_get, NULL, NULL}, + {"shape", (getter)memory_shape_get, NULL, NULL}, + {"strides", (getter)memory_strides_get, NULL, NULL}, + {"suboffsets", (getter)memory_suboffsets_get, NULL, NULL}, + {"readonly", (getter)memory_readonly_get, NULL, NULL}, + {"ndim", (getter)memory_ndim_get, NULL, NULL}, + {NULL, NULL, NULL, NULL}, }; static PyObject * memory_tobytes(PyMemoryViewObject *mem, PyObject *noargs) { - return PyObject_CallFunctionObjArgs( - (PyObject *) &PyBytes_Type, mem, NULL); + return PyObject_CallFunctionObjArgs( + (PyObject *) &PyBytes_Type, mem, NULL); } /* TODO: rewrite this function using the struct module to unpack @@ -423,59 +423,59 @@ static PyObject * memory_tolist(PyMemoryViewObject *mem, PyObject *noargs) { - Py_buffer *view = &(mem->view); - Py_ssize_t i; - PyObject *res, *item; - char *buf; - - if (strcmp(view->format, "B") || view->itemsize != 1) { - PyErr_SetString(PyExc_NotImplementedError, - "tolist() only supports byte views"); - return NULL; - } - if (view->ndim != 1) { - PyErr_SetString(PyExc_NotImplementedError, - "tolist() only supports one-dimensional objects"); - return NULL; - } - res = PyList_New(view->len); - if (res == NULL) - return NULL; - buf = view->buf; - for (i = 0; i < view->len; i++) { - item = PyLong_FromUnsignedLong((unsigned char) *buf); - if (item == NULL) { - Py_DECREF(res); - return NULL; - } - PyList_SET_ITEM(res, i, item); - buf++; - } - return res; + Py_buffer *view = &(mem->view); + Py_ssize_t i; + PyObject *res, *item; + char *buf; + + if (strcmp(view->format, "B") || view->itemsize != 1) { + PyErr_SetString(PyExc_NotImplementedError, + "tolist() only supports byte views"); + return NULL; + } + if (view->ndim != 1) { + PyErr_SetString(PyExc_NotImplementedError, + "tolist() only supports one-dimensional objects"); + return NULL; + } + res = PyList_New(view->len); + if (res == NULL) + return NULL; + buf = view->buf; + for (i = 0; i < view->len; i++) { + item = PyLong_FromUnsignedLong((unsigned char) *buf); + if (item == NULL) { + Py_DECREF(res); + return NULL; + } + PyList_SET_ITEM(res, i, item); + buf++; + } + return res; } static PyMethodDef memory_methods[] = { - {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, - {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, - {NULL, NULL} /* sentinel */ + {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, + {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, + {NULL, NULL} /* sentinel */ }; static void memory_dealloc(PyMemoryViewObject *self) { - _PyObject_GC_UNTRACK(self); - if (self->view.obj != NULL) { - if (self->base && PyTuple_Check(self->base)) { - /* Special case when first element is generic object - with buffer interface and the second element is a - contiguous "shadow" that must be copied back into - the data areay of the first tuple element before - releasing the buffer on the first element. - */ + _PyObject_GC_UNTRACK(self); + if (self->view.obj != NULL) { + if (self->base && PyTuple_Check(self->base)) { + /* Special case when first element is generic object + with buffer interface and the second element is a + contiguous "shadow" that must be copied back into + the data areay of the first tuple element before + releasing the buffer on the first element. + */ - PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), - PyTuple_GET_ITEM(self->base,1)); + PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), + PyTuple_GET_ITEM(self->base,1)); /* The view member should have readonly == -1 in this instance indicating that the memory can @@ -495,23 +495,23 @@ static PyObject * memory_repr(PyMemoryViewObject *self) { - return PyUnicode_FromFormat("", self); + return PyUnicode_FromFormat("", self); } static PyObject * memory_str(PyMemoryViewObject *self) { - Py_buffer view; - PyObject *res; + Py_buffer view; + PyObject *res; - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return NULL; + 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; + res = PyBytes_FromStringAndSize(NULL, view.len); + PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C'); + PyBuffer_Release(&view); + return res; } /* Sequence methods */ @@ -524,10 +524,10 @@ /* mem[obj] returns a bytes object holding the data for one element if obj fully indexes the memory view or another memory-view object - if it does not. + if it does not. - 0-d memory-view objects can be referenced using ... or () but - not with anything else. + 0-d memory-view objects can be referenced using ... or () but + not with anything else. */ static PyObject * memory_subscript(PyMemoryViewObject *self, PyObject *key) @@ -536,61 +536,60 @@ view = &(self->view); if (view->ndim == 0) { - if (key == Py_Ellipsis || - (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) { - Py_INCREF(self); - return (PyObject *)self; - } - else { - PyErr_SetString(PyExc_IndexError, - "invalid indexing of 0-dim memory"); - return NULL; - } + if (key == Py_Ellipsis || + (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) { + Py_INCREF(self); + return (PyObject *)self; + } + else { + PyErr_SetString(PyExc_IndexError, + "invalid indexing of 0-dim memory"); + return NULL; + } } if (PyIndex_Check(key)) { - Py_ssize_t result; - result = PyNumber_AsSsize_t(key, NULL); - if (result == -1 && PyErr_Occurred()) - return NULL; - if (view->ndim == 1) { - /* Return a bytes object */ - char *ptr; - ptr = (char *)view->buf; - if (result < 0) { + Py_ssize_t result; + result = PyNumber_AsSsize_t(key, NULL); + if (result == -1 && PyErr_Occurred()) + return NULL; + if (view->ndim == 1) { + /* Return a bytes object */ + char *ptr; + ptr = (char *)view->buf; + if (result < 0) { result += get_shape0(view); - } + } if ((result < 0) || (result >= get_shape0(view))) { - PyErr_SetString(PyExc_IndexError, - "index out of bounds"); - return NULL; - } - if (view->strides == NULL) - ptr += view->itemsize * result; - else - ptr += view->strides[0] * result; - if (view->suboffsets != NULL && - view->suboffsets[0] >= 0) - { - ptr = *((char **)ptr) + view->suboffsets[0]; - } - return PyBytes_FromStringAndSize(ptr, view->itemsize); - } - else { - /* Return a new memory-view object */ - Py_buffer newview; - memset(&newview, 0, sizeof(newview)); - /* XXX: This needs to be fixed so it - actually returns a sub-view - */ - return PyMemoryView_FromBuffer(&newview); - } + PyErr_SetString(PyExc_IndexError, + "index out of bounds"); + return NULL; + } + if (view->strides == NULL) + ptr += view->itemsize * result; + else + ptr += view->strides[0] * result; + if (view->suboffsets != NULL && + view->suboffsets[0] >= 0) { + ptr = *((char **)ptr) + view->suboffsets[0]; + } + return PyBytes_FromStringAndSize(ptr, view->itemsize); + } + else { + /* Return a new memory-view object */ + Py_buffer newview; + memset(&newview, 0, sizeof(newview)); + /* XXX: This needs to be fixed so it + actually returns a sub-view + */ + return PyMemoryView_FromBuffer(&newview); + } } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength; if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view), &start, &stop, &step, &slicelength) < 0) { - return NULL; + return NULL; } if (step == 1 && view->ndim == 1) { @@ -620,8 +619,8 @@ return NULL; } PyErr_Format(PyExc_TypeError, - "cannot index memory using \"%.200s\"", - key->ob_type->tp_name); + "cannot index memory using \"%.200s\"", + key->ob_type->tp_name); return NULL; } @@ -722,118 +721,118 @@ static PyObject * memory_richcompare(PyObject *v, PyObject *w, int op) { - Py_buffer vv, ww; - int equal = 0; - PyObject *res; - - vv.obj = NULL; - ww.obj = NULL; - if (op != Py_EQ && op != Py_NE) - goto _notimpl; - if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) { - PyErr_Clear(); - goto _notimpl; - } - if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) { - PyErr_Clear(); - goto _notimpl; - } + Py_buffer vv, ww; + int equal = 0; + PyObject *res; + + vv.obj = NULL; + ww.obj = NULL; + if (op != Py_EQ && op != Py_NE) + goto _notimpl; + if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) { + PyErr_Clear(); + goto _notimpl; + } + if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) { + PyErr_Clear(); + goto _notimpl; + } - if (vv.itemsize != ww.itemsize || vv.len != ww.len) - goto _end; + if (vv.itemsize != ww.itemsize || vv.len != ww.len) + goto _end; - equal = !memcmp(vv.buf, ww.buf, vv.len); + equal = !memcmp(vv.buf, ww.buf, vv.len); _end: - PyBuffer_Release(&vv); - PyBuffer_Release(&ww); - if ((equal && op == Py_EQ) || (!equal && op == Py_NE)) - res = Py_True; - else - res = Py_False; - Py_INCREF(res); - return res; + PyBuffer_Release(&vv); + PyBuffer_Release(&ww); + if ((equal && op == Py_EQ) || (!equal && op == Py_NE)) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; _notimpl: - PyBuffer_Release(&vv); - PyBuffer_Release(&ww); - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + PyBuffer_Release(&vv); + PyBuffer_Release(&ww); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } static int memory_traverse(PyMemoryViewObject *self, visitproc visit, void *arg) { - if (self->base != NULL) - Py_VISIT(self->base); - if (self->view.obj != NULL) - Py_VISIT(self->view.obj); - return 0; + if (self->base != NULL) + Py_VISIT(self->base); + if (self->view.obj != NULL) + Py_VISIT(self->view.obj); + return 0; } static int memory_clear(PyMemoryViewObject *self) { - Py_CLEAR(self->base); - PyBuffer_Release(&self->view); - return 0; + Py_CLEAR(self->base); + PyBuffer_Release(&self->view); + return 0; } /* As mapping */ static PyMappingMethods memory_as_mapping = { - (lenfunc)memory_length, /*mp_length*/ - (binaryfunc)memory_subscript, /*mp_subscript*/ - (objobjargproc)memory_ass_sub, /*mp_ass_subscript*/ + (lenfunc)memory_length, /* mp_length */ + (binaryfunc)memory_subscript, /* mp_subscript */ + (objobjargproc)memory_ass_sub, /* mp_ass_subscript */ }; /* Buffer methods */ static PyBufferProcs memory_as_buffer = { - (getbufferproc)memory_getbuf, /* bf_getbuffer */ - (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */ + (getbufferproc)memory_getbuf, /* bf_getbuffer */ + (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */ }; PyTypeObject PyMemoryView_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "memoryview", - sizeof(PyMemoryViewObject), - 0, - (destructor)memory_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - (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 */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - &memory_as_buffer, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ - memory_doc, /* tp_doc */ - (traverseproc)memory_traverse, /* tp_traverse */ - (inquiry)memory_clear, /* tp_clear */ - memory_richcompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - memory_methods, /* tp_methods */ - 0, /* tp_members */ - memory_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 */ - memory_new, /* tp_new */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "memoryview", + sizeof(PyMemoryViewObject), + 0, + (destructor)memory_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + (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 */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + &memory_as_buffer, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + memory_doc, /* tp_doc */ + (traverseproc)memory_traverse, /* tp_traverse */ + (inquiry)memory_clear, /* tp_clear */ + memory_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + memory_methods, /* tp_methods */ + 0, /* tp_members */ + memory_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 */ + memory_new, /* tp_new */ }; From buildbot at python.org Sat Jan 3 20:21:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 19:21:19 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090103192119.69A181E4002@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/27 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_wsgiref ====================================================================== ERROR: testEnviron (test.test_wsgiref.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_wsgiref.py", line 490, in testEnviron File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_wsgiref.py", line 482, in checkOSEnviron KeyError: 'NO_PROXY' ====================================================================== ERROR: testBytes (test.test_wsgiref.HeaderTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_wsgiref.py", line 427, in testBytes File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/wsgiref/headers.py", line 67, in __setitem__ del self[name] File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/wsgiref/headers.py", line 77, in __delitem__ self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/wsgiref/headers.py", line 77, in self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 20:29:01 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 20:29:01 +0100 (CET) Subject: [Python-checkins] r68213 - in python/branches/release30-maint: Include/memoryobject.h Objects/memoryobject.c Message-ID: <20090103192901.582F81E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 20:29:00 2009 New Revision: 68213 Log: Merged revisions 68212 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68212 | antoine.pitrou | 2009-01-03 20:20:36 +0100 (sam., 03 janv. 2009) | 4 lines Issue #4822: fix messy indentation in memoryobject.c/.h, before we may backport it to trunk. Reviewed on IRC by Georg Brandl, with assistance by Benjamin Peterson. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/memoryobject.h python/branches/release30-maint/Objects/memoryobject.c Modified: python/branches/release30-maint/Include/memoryobject.h ============================================================================== --- python/branches/release30-maint/Include/memoryobject.h (original) +++ python/branches/release30-maint/Include/memoryobject.h Sat Jan 3 20:29:00 2009 @@ -20,53 +20,53 @@ int buffertype, char fort); - /* Return a contiguous chunk of memory representing the buffer - from an object in a memory view object. If a copy is made then the - base object for the memory view will be a *new* bytes object. - - Otherwise, the base-object will be the object itself and no - data-copying will be done. - - The buffertype argument can be PyBUF_READ, PyBUF_WRITE, - PyBUF_SHADOW to determine whether the returned buffer - should be READONLY, WRITABLE, or set to update the - original buffer if a copy must be made. If buffertype is - PyBUF_WRITE and the buffer is not contiguous an error will - be raised. In this circumstance, the user can use - PyBUF_SHADOW to ensure that a a writable temporary - contiguous buffer is returned. The contents of this - contiguous buffer will be copied back into the original - object after the memoryview object is deleted as long as - the original object is writable and allows setting an - exclusive write lock. If this is not allowed by the - original object, then a BufferError is raised. - - If the object is multi-dimensional and if fortran is 'F', - the first dimension of the underlying array will vary the - fastest in the buffer. If fortran is 'C', then the last - dimension will vary the fastest (C-style contiguous). If - fortran is 'A', then it does not matter and you will get - whatever the object decides is more efficient. + /* Return a contiguous chunk of memory representing the buffer + from an object in a memory view object. If a copy is made then the + base object for the memory view will be a *new* bytes object. + + Otherwise, the base-object will be the object itself and no + data-copying will be done. + + The buffertype argument can be PyBUF_READ, PyBUF_WRITE, + PyBUF_SHADOW to determine whether the returned buffer + should be READONLY, WRITABLE, or set to update the + original buffer if a copy must be made. If buffertype is + PyBUF_WRITE and the buffer is not contiguous an error will + be raised. In this circumstance, the user can use + PyBUF_SHADOW to ensure that a a writable temporary + contiguous buffer is returned. The contents of this + contiguous buffer will be copied back into the original + object after the memoryview object is deleted as long as + the original object is writable and allows setting an + exclusive write lock. If this is not allowed by the + original object, then a BufferError is raised. + + If the object is multi-dimensional and if fortran is 'F', + the first dimension of the underlying array will vary the + fastest in the buffer. If fortran is 'C', then the last + dimension will vary the fastest (C-style contiguous). If + fortran is 'A', then it does not matter and you will get + whatever the object decides is more efficient. - A new reference is returned that must be DECREF'd when finished. - */ + A new reference is returned that must be DECREF'd when finished. + */ PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info); - /* create new if bufptr is NULL - will be a new bytesobject in base */ + /* create new if bufptr is NULL + will be a new bytesobject in base */ + - /* The struct is declared here so that macros can work, but it shouldn't be considered public. Don't access those fields directly, use the macros and functions instead! */ typedef struct { - PyObject_HEAD - PyObject *base; - Py_buffer view; + PyObject_HEAD + PyObject *base; + Py_buffer view; } PyMemoryViewObject; - + #ifdef __cplusplus } Modified: python/branches/release30-maint/Objects/memoryobject.c ============================================================================== --- python/branches/release30-maint/Objects/memoryobject.c (original) +++ python/branches/release30-maint/Objects/memoryobject.c Sat Jan 3 20:29:00 2009 @@ -33,21 +33,21 @@ static int memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags) { - int res = 0; - /* XXX for whatever reason fixing the flags seems necessary */ - if (self->view.readonly) - flags &= ~PyBUF_WRITABLE; - if (self->view.obj != NULL) - res = PyObject_GetBuffer(self->view.obj, view, flags); - if (view) - dup_buffer(view, &self->view); - return res; + int res = 0; + /* XXX for whatever reason fixing the flags seems necessary */ + if (self->view.readonly) + flags &= ~PyBUF_WRITABLE; + if (self->view.obj != NULL) + res = PyObject_GetBuffer(self->view.obj, view, flags); + if (view) + dup_buffer(view, &self->view); + return res; } static void memory_releasebuf(PyMemoryViewObject *self, Py_buffer *view) { - PyBuffer_Release(view); + PyBuffer_Release(view); } PyDoc_STRVAR(memory_doc, @@ -58,61 +58,61 @@ PyObject * PyMemoryView_FromBuffer(Py_buffer *info) { - PyMemoryViewObject *mview; + PyMemoryViewObject *mview; - mview = (PyMemoryViewObject *) - PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mview == NULL) - return NULL; - mview->base = NULL; - dup_buffer(&mview->view, info); - /* NOTE: mview->view.obj should already have been incref'ed as - part of PyBuffer_FillInfo(). */ - _PyObject_GC_TRACK(mview); - return (PyObject *)mview; + mview = (PyMemoryViewObject *) + PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mview == NULL) + return NULL; + mview->base = NULL; + dup_buffer(&mview->view, info); + /* NOTE: mview->view.obj should already have been incref'ed as + part of PyBuffer_FillInfo(). */ + _PyObject_GC_TRACK(mview); + return (PyObject *)mview; } PyObject * PyMemoryView_FromObject(PyObject *base) { - PyMemoryViewObject *mview; + PyMemoryViewObject *mview; - if (!PyObject_CheckBuffer(base)) { - PyErr_SetString(PyExc_TypeError, - "cannot make memory view because object does " - "not have the buffer interface"); - return NULL; - } + if (!PyObject_CheckBuffer(base)) { + PyErr_SetString(PyExc_TypeError, + "cannot make memory view because object does " + "not have the buffer interface"); + return NULL; + } - mview = (PyMemoryViewObject *) - PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mview == NULL) - return NULL; - - mview->base = NULL; - if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) { - Py_DECREF(mview); - return NULL; - } + mview = (PyMemoryViewObject *) + PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mview == NULL) + return NULL; - mview->base = base; - Py_INCREF(base); - _PyObject_GC_TRACK(mview); - return (PyObject *)mview; + mview->base = NULL; + if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) { + Py_DECREF(mview); + return NULL; + } + + mview->base = base; + Py_INCREF(base); + _PyObject_GC_TRACK(mview); + return (PyObject *)mview; } static PyObject * memory_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *obj; - static char *kwlist[] = {"object", 0}; + PyObject *obj; + static char *kwlist[] = {"object", 0}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist, - &obj)) { - return NULL; - } + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist, + &obj)) { + return NULL; + } - return PyMemoryView_FromObject(obj); + return PyMemoryView_FromObject(obj); } @@ -120,58 +120,58 @@ _strided_copy_nd(char *dest, char *src, int nd, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char fort) { - int k; - Py_ssize_t outstride; + int k; + Py_ssize_t outstride; - if (nd==0) { - memcpy(dest, src, itemsize); + if (nd==0) { + memcpy(dest, src, itemsize); + } + else if (nd == 1) { + for (k = 0; kndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { - PyErr_NoMemory(); - return -1; - } + if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { + PyErr_NoMemory(); + return -1; + } - indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); - if (indices == NULL) { - PyErr_NoMemory(); - return -1; - } - for (k=0; kndim;k++) { - indices[k] = 0; - } + indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); + if (indices == NULL) { + PyErr_NoMemory(); + return -1; + } + for (k=0; kndim;k++) { + indices[k] = 0; + } - elements = 1; - for (k=0; kndim; k++) { - elements *= view->shape[k]; - } - if (fort == 'F') { - func = _add_one_to_index_F; - } - else { - func = _add_one_to_index_C; - } - while (elements--) { - func(view->ndim, indices, view->shape); - ptr = PyBuffer_GetPointer(view, indices); - memcpy(dest, ptr, view->itemsize); - dest += view->itemsize; - } + elements = 1; + for (k=0; kndim; k++) { + elements *= view->shape[k]; + } + if (fort == 'F') { + func = _add_one_to_index_F; + } + else { + func = _add_one_to_index_C; + } + while (elements--) { + func(view->ndim, indices, view->shape); + ptr = PyBuffer_GetPointer(view, indices); + memcpy(dest, ptr, view->itemsize); + dest += view->itemsize; + } - PyMem_Free(indices); - return 0; + PyMem_Free(indices); + return 0; } /* @@ -240,181 +240,181 @@ the shadow buffer which can be written to and then will be copied back into the other buffer when the memory view is de-allocated. While the shadow buffer is - being used, it will have an exclusive write lock on - the original buffer. + being used, it will have an exclusive write lock on + the original buffer. */ PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort) { - PyMemoryViewObject *mem; - PyObject *bytes; - Py_buffer *view; - int flags; - char *dest; - - if (!PyObject_CheckBuffer(obj)) { - PyErr_SetString(PyExc_TypeError, - "object does not have the buffer interface"); - return NULL; - } + PyMemoryViewObject *mem; + PyObject *bytes; + Py_buffer *view; + int flags; + char *dest; - mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mem == NULL) - return NULL; - - view = &mem->view; - flags = PyBUF_FULL_RO; - switch(buffertype) { - case PyBUF_WRITE: - flags = PyBUF_FULL; - break; - } + if (!PyObject_CheckBuffer(obj)) { + PyErr_SetString(PyExc_TypeError, + "object does not have the buffer interface"); + return NULL; + } - if (PyObject_GetBuffer(obj, view, flags) != 0) { - Py_DECREF(mem); - return NULL; - } + mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mem == NULL) + return NULL; - if (PyBuffer_IsContiguous(view, fort)) { - /* no copy needed */ - Py_INCREF(obj); - mem->base = obj; - _PyObject_GC_TRACK(mem); - return (PyObject *)mem; - } - /* otherwise a copy is needed */ - if (buffertype == PyBUF_WRITE) { - Py_DECREF(mem); - PyErr_SetString(PyExc_BufferError, - "writable contiguous buffer requested " - "for a non-contiguousobject."); - return NULL; - } - bytes = PyBytes_FromStringAndSize(NULL, view->len); - if (bytes == NULL) { - Py_DECREF(mem); - return NULL; - } - dest = PyBytes_AS_STRING(bytes); - /* different copying strategy depending on whether - or not any pointer de-referencing is needed - */ - /* strided or in-direct copy */ - if (view->suboffsets==NULL) { - _strided_copy_nd(dest, view->buf, view->ndim, view->shape, - view->strides, view->itemsize, fort); - } - else { - if (_indirect_copy_nd(dest, view, fort) < 0) { - Py_DECREF(bytes); - Py_DECREF(mem); - return NULL; - } - } - if (buffertype == PyBUF_SHADOW) { - /* return a shadowed memory-view object */ - view->buf = dest; - mem->base = PyTuple_Pack(2, obj, bytes); - Py_DECREF(bytes); - if (mem->base == NULL) { - Py_DECREF(mem); - return NULL; - } + view = &mem->view; + flags = PyBUF_FULL_RO; + switch(buffertype) { + case PyBUF_WRITE: + flags = PyBUF_FULL; + break; + } + + if (PyObject_GetBuffer(obj, view, flags) != 0) { + Py_DECREF(mem); + return NULL; + } + + if (PyBuffer_IsContiguous(view, fort)) { + /* no copy needed */ + Py_INCREF(obj); + mem->base = obj; + _PyObject_GC_TRACK(mem); + return (PyObject *)mem; + } + /* otherwise a copy is needed */ + if (buffertype == PyBUF_WRITE) { + Py_DECREF(mem); + PyErr_SetString(PyExc_BufferError, + "writable contiguous buffer requested " + "for a non-contiguousobject."); + return NULL; + } + bytes = PyBytes_FromStringAndSize(NULL, view->len); + if (bytes == NULL) { + Py_DECREF(mem); + return NULL; + } + dest = PyBytes_AS_STRING(bytes); + /* different copying strategy depending on whether + or not any pointer de-referencing is needed + */ + /* strided or in-direct copy */ + if (view->suboffsets==NULL) { + _strided_copy_nd(dest, view->buf, view->ndim, view->shape, + view->strides, view->itemsize, fort); + } + else { + if (_indirect_copy_nd(dest, view, fort) < 0) { + Py_DECREF(bytes); + Py_DECREF(mem); + return NULL; } - else { - PyBuffer_Release(view); /* XXX ? */ - /* steal the reference */ - mem->base = bytes; + } + if (buffertype == PyBUF_SHADOW) { + /* return a shadowed memory-view object */ + view->buf = dest; + mem->base = PyTuple_Pack(2, obj, bytes); + Py_DECREF(bytes); + if (mem->base == NULL) { + Py_DECREF(mem); + return NULL; } - _PyObject_GC_TRACK(mem); - return (PyObject *)mem; + } + else { + PyBuffer_Release(view); /* XXX ? */ + /* steal the reference */ + mem->base = bytes; + } + _PyObject_GC_TRACK(mem); + return (PyObject *)mem; } static PyObject * memory_format_get(PyMemoryViewObject *self) { - return PyUnicode_FromString(self->view.format); + return PyUnicode_FromString(self->view.format); } static PyObject * memory_itemsize_get(PyMemoryViewObject *self) { - return PyLong_FromSsize_t(self->view.itemsize); + return PyLong_FromSsize_t(self->view.itemsize); } static PyObject * _IntTupleFromSsizet(int len, Py_ssize_t *vals) { - int i; - PyObject *o; - PyObject *intTuple; - - if (vals == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - intTuple = PyTuple_New(len); - if (!intTuple) return NULL; - for(i=0; iview.ndim, self->view.shape); + return _IntTupleFromSsizet(self->view.ndim, self->view.shape); } static PyObject * memory_strides_get(PyMemoryViewObject *self) { - return _IntTupleFromSsizet(self->view.ndim, self->view.strides); + return _IntTupleFromSsizet(self->view.ndim, self->view.strides); } static PyObject * memory_suboffsets_get(PyMemoryViewObject *self) { - return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); + return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); } static PyObject * memory_readonly_get(PyMemoryViewObject *self) { - return PyBool_FromLong(self->view.readonly); + return PyBool_FromLong(self->view.readonly); } static PyObject * memory_ndim_get(PyMemoryViewObject *self) { - return PyLong_FromLong(self->view.ndim); + return PyLong_FromLong(self->view.ndim); } static PyGetSetDef memory_getsetlist[] ={ - {"format", (getter)memory_format_get, NULL, NULL}, - {"itemsize", (getter)memory_itemsize_get, NULL, NULL}, - {"shape", (getter)memory_shape_get, NULL, NULL}, - {"strides", (getter)memory_strides_get, NULL, NULL}, - {"suboffsets", (getter)memory_suboffsets_get, NULL, NULL}, - {"readonly", (getter)memory_readonly_get, NULL, NULL}, - {"ndim", (getter)memory_ndim_get, NULL, NULL}, - {NULL, NULL, NULL, NULL}, + {"format", (getter)memory_format_get, NULL, NULL}, + {"itemsize", (getter)memory_itemsize_get, NULL, NULL}, + {"shape", (getter)memory_shape_get, NULL, NULL}, + {"strides", (getter)memory_strides_get, NULL, NULL}, + {"suboffsets", (getter)memory_suboffsets_get, NULL, NULL}, + {"readonly", (getter)memory_readonly_get, NULL, NULL}, + {"ndim", (getter)memory_ndim_get, NULL, NULL}, + {NULL, NULL, NULL, NULL}, }; static PyObject * memory_tobytes(PyMemoryViewObject *mem, PyObject *noargs) { - return PyObject_CallFunctionObjArgs( - (PyObject *) &PyBytes_Type, mem, NULL); + return PyObject_CallFunctionObjArgs( + (PyObject *) &PyBytes_Type, mem, NULL); } /* TODO: rewrite this function using the struct module to unpack @@ -423,59 +423,59 @@ static PyObject * memory_tolist(PyMemoryViewObject *mem, PyObject *noargs) { - Py_buffer *view = &(mem->view); - Py_ssize_t i; - PyObject *res, *item; - char *buf; - - if (strcmp(view->format, "B") || view->itemsize != 1) { - PyErr_SetString(PyExc_NotImplementedError, - "tolist() only supports byte views"); - return NULL; - } - if (view->ndim != 1) { - PyErr_SetString(PyExc_NotImplementedError, - "tolist() only supports one-dimensional objects"); - return NULL; - } - res = PyList_New(view->len); - if (res == NULL) - return NULL; - buf = view->buf; - for (i = 0; i < view->len; i++) { - item = PyLong_FromUnsignedLong((unsigned char) *buf); - if (item == NULL) { - Py_DECREF(res); - return NULL; - } - PyList_SET_ITEM(res, i, item); - buf++; - } - return res; + Py_buffer *view = &(mem->view); + Py_ssize_t i; + PyObject *res, *item; + char *buf; + + if (strcmp(view->format, "B") || view->itemsize != 1) { + PyErr_SetString(PyExc_NotImplementedError, + "tolist() only supports byte views"); + return NULL; + } + if (view->ndim != 1) { + PyErr_SetString(PyExc_NotImplementedError, + "tolist() only supports one-dimensional objects"); + return NULL; + } + res = PyList_New(view->len); + if (res == NULL) + return NULL; + buf = view->buf; + for (i = 0; i < view->len; i++) { + item = PyLong_FromUnsignedLong((unsigned char) *buf); + if (item == NULL) { + Py_DECREF(res); + return NULL; + } + PyList_SET_ITEM(res, i, item); + buf++; + } + return res; } static PyMethodDef memory_methods[] = { - {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, - {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, - {NULL, NULL} /* sentinel */ + {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, + {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, + {NULL, NULL} /* sentinel */ }; static void memory_dealloc(PyMemoryViewObject *self) { - _PyObject_GC_UNTRACK(self); - if (self->view.obj != NULL) { - if (self->base && PyTuple_Check(self->base)) { - /* Special case when first element is generic object - with buffer interface and the second element is a - contiguous "shadow" that must be copied back into - the data areay of the first tuple element before - releasing the buffer on the first element. - */ + _PyObject_GC_UNTRACK(self); + if (self->view.obj != NULL) { + if (self->base && PyTuple_Check(self->base)) { + /* Special case when first element is generic object + with buffer interface and the second element is a + contiguous "shadow" that must be copied back into + the data areay of the first tuple element before + releasing the buffer on the first element. + */ - PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), - PyTuple_GET_ITEM(self->base,1)); + PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), + PyTuple_GET_ITEM(self->base,1)); /* The view member should have readonly == -1 in this instance indicating that the memory can @@ -495,23 +495,23 @@ static PyObject * memory_repr(PyMemoryViewObject *self) { - return PyUnicode_FromFormat("", self); + return PyUnicode_FromFormat("", self); } static PyObject * memory_str(PyMemoryViewObject *self) { - Py_buffer view; - PyObject *res; + Py_buffer view; + PyObject *res; - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return NULL; + 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; + res = PyBytes_FromStringAndSize(NULL, view.len); + PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C'); + PyBuffer_Release(&view); + return res; } /* Sequence methods */ @@ -524,10 +524,10 @@ /* mem[obj] returns a bytes object holding the data for one element if obj fully indexes the memory view or another memory-view object - if it does not. + if it does not. - 0-d memory-view objects can be referenced using ... or () but - not with anything else. + 0-d memory-view objects can be referenced using ... or () but + not with anything else. */ static PyObject * memory_subscript(PyMemoryViewObject *self, PyObject *key) @@ -536,61 +536,60 @@ view = &(self->view); if (view->ndim == 0) { - if (key == Py_Ellipsis || - (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) { - Py_INCREF(self); - return (PyObject *)self; - } - else { - PyErr_SetString(PyExc_IndexError, - "invalid indexing of 0-dim memory"); - return NULL; - } + if (key == Py_Ellipsis || + (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) { + Py_INCREF(self); + return (PyObject *)self; + } + else { + PyErr_SetString(PyExc_IndexError, + "invalid indexing of 0-dim memory"); + return NULL; + } } if (PyIndex_Check(key)) { - Py_ssize_t result; - result = PyNumber_AsSsize_t(key, NULL); - if (result == -1 && PyErr_Occurred()) - return NULL; - if (view->ndim == 1) { - /* Return a bytes object */ - char *ptr; - ptr = (char *)view->buf; - if (result < 0) { + Py_ssize_t result; + result = PyNumber_AsSsize_t(key, NULL); + if (result == -1 && PyErr_Occurred()) + return NULL; + if (view->ndim == 1) { + /* Return a bytes object */ + char *ptr; + ptr = (char *)view->buf; + if (result < 0) { result += get_shape0(view); - } + } if ((result < 0) || (result >= get_shape0(view))) { - PyErr_SetString(PyExc_IndexError, - "index out of bounds"); - return NULL; - } - if (view->strides == NULL) - ptr += view->itemsize * result; - else - ptr += view->strides[0] * result; - if (view->suboffsets != NULL && - view->suboffsets[0] >= 0) - { - ptr = *((char **)ptr) + view->suboffsets[0]; - } - return PyBytes_FromStringAndSize(ptr, view->itemsize); - } - else { - /* Return a new memory-view object */ - Py_buffer newview; - memset(&newview, 0, sizeof(newview)); - /* XXX: This needs to be fixed so it - actually returns a sub-view - */ - return PyMemoryView_FromBuffer(&newview); - } + PyErr_SetString(PyExc_IndexError, + "index out of bounds"); + return NULL; + } + if (view->strides == NULL) + ptr += view->itemsize * result; + else + ptr += view->strides[0] * result; + if (view->suboffsets != NULL && + view->suboffsets[0] >= 0) { + ptr = *((char **)ptr) + view->suboffsets[0]; + } + return PyBytes_FromStringAndSize(ptr, view->itemsize); + } + else { + /* Return a new memory-view object */ + Py_buffer newview; + memset(&newview, 0, sizeof(newview)); + /* XXX: This needs to be fixed so it + actually returns a sub-view + */ + return PyMemoryView_FromBuffer(&newview); + } } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength; if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view), &start, &stop, &step, &slicelength) < 0) { - return NULL; + return NULL; } if (step == 1 && view->ndim == 1) { @@ -620,8 +619,8 @@ return NULL; } PyErr_Format(PyExc_TypeError, - "cannot index memory using \"%.200s\"", - key->ob_type->tp_name); + "cannot index memory using \"%.200s\"", + key->ob_type->tp_name); return NULL; } @@ -722,118 +721,118 @@ static PyObject * memory_richcompare(PyObject *v, PyObject *w, int op) { - Py_buffer vv, ww; - int equal = 0; - PyObject *res; - - vv.obj = NULL; - ww.obj = NULL; - if (op != Py_EQ && op != Py_NE) - goto _notimpl; - if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) { - PyErr_Clear(); - goto _notimpl; - } - if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) { - PyErr_Clear(); - goto _notimpl; - } + Py_buffer vv, ww; + int equal = 0; + PyObject *res; + + vv.obj = NULL; + ww.obj = NULL; + if (op != Py_EQ && op != Py_NE) + goto _notimpl; + if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) { + PyErr_Clear(); + goto _notimpl; + } + if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) { + PyErr_Clear(); + goto _notimpl; + } - if (vv.itemsize != ww.itemsize || vv.len != ww.len) - goto _end; + if (vv.itemsize != ww.itemsize || vv.len != ww.len) + goto _end; - equal = !memcmp(vv.buf, ww.buf, vv.len); + equal = !memcmp(vv.buf, ww.buf, vv.len); _end: - PyBuffer_Release(&vv); - PyBuffer_Release(&ww); - if ((equal && op == Py_EQ) || (!equal && op == Py_NE)) - res = Py_True; - else - res = Py_False; - Py_INCREF(res); - return res; + PyBuffer_Release(&vv); + PyBuffer_Release(&ww); + if ((equal && op == Py_EQ) || (!equal && op == Py_NE)) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; _notimpl: - PyBuffer_Release(&vv); - PyBuffer_Release(&ww); - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + PyBuffer_Release(&vv); + PyBuffer_Release(&ww); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } static int memory_traverse(PyMemoryViewObject *self, visitproc visit, void *arg) { - if (self->base != NULL) - Py_VISIT(self->base); - if (self->view.obj != NULL) - Py_VISIT(self->view.obj); - return 0; + if (self->base != NULL) + Py_VISIT(self->base); + if (self->view.obj != NULL) + Py_VISIT(self->view.obj); + return 0; } static int memory_clear(PyMemoryViewObject *self) { - Py_CLEAR(self->base); - PyBuffer_Release(&self->view); - return 0; + Py_CLEAR(self->base); + PyBuffer_Release(&self->view); + return 0; } /* As mapping */ static PyMappingMethods memory_as_mapping = { - (lenfunc)memory_length, /*mp_length*/ - (binaryfunc)memory_subscript, /*mp_subscript*/ - (objobjargproc)memory_ass_sub, /*mp_ass_subscript*/ + (lenfunc)memory_length, /* mp_length */ + (binaryfunc)memory_subscript, /* mp_subscript */ + (objobjargproc)memory_ass_sub, /* mp_ass_subscript */ }; /* Buffer methods */ static PyBufferProcs memory_as_buffer = { - (getbufferproc)memory_getbuf, /* bf_getbuffer */ - (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */ + (getbufferproc)memory_getbuf, /* bf_getbuffer */ + (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */ }; PyTypeObject PyMemoryView_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "memoryview", - sizeof(PyMemoryViewObject), - 0, - (destructor)memory_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - (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 */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - &memory_as_buffer, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ - memory_doc, /* tp_doc */ - (traverseproc)memory_traverse, /* tp_traverse */ - (inquiry)memory_clear, /* tp_clear */ - memory_richcompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - memory_methods, /* tp_methods */ - 0, /* tp_members */ - memory_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 */ - memory_new, /* tp_new */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "memoryview", + sizeof(PyMemoryViewObject), + 0, + (destructor)memory_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + (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 */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + &memory_as_buffer, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + memory_doc, /* tp_doc */ + (traverseproc)memory_traverse, /* tp_traverse */ + (inquiry)memory_clear, /* tp_clear */ + memory_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + memory_methods, /* tp_methods */ + 0, /* tp_members */ + memory_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 */ + memory_new, /* tp_new */ }; From buildbot at python.org Sat Jan 3 20:38:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 19:38:28 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090103193828.4DE421E4002@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/26 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_wsgiref ====================================================================== ERROR: testEnviron (test.test_wsgiref.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_wsgiref.py", line 490, in testEnviron File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_wsgiref.py", line 482, in checkOSEnviron KeyError: 'NO_PROXY' ====================================================================== ERROR: testBytes (test.test_wsgiref.HeaderTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_wsgiref.py", line 427, in testBytes File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/wsgiref/headers.py", line 67, in __setitem__ del self[name] File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/wsgiref/headers.py", line 77, in __delitem__ self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/wsgiref/headers.py", line 77, in self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 20:44:48 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 20:44:48 +0100 (CET) Subject: [Python-checkins] r68214 - python/trunk/Doc/library/decimal.rst Message-ID: <20090103194448.8338B1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 20:44:48 2009 New Revision: 68214 Log: Make indentation consistent. Modified: python/trunk/Doc/library/decimal.rst Modified: python/trunk/Doc/library/decimal.rst ============================================================================== --- python/trunk/Doc/library/decimal.rst (original) +++ python/trunk/Doc/library/decimal.rst Sat Jan 3 20:44:48 2009 @@ -1030,7 +1030,7 @@ If the argument is a string, no leading or trailing whitespace is permitted. -.. method:: create_decimal_from_float(f) + .. method:: create_decimal_from_float(f) Creates a new Decimal instance from a float *f* but rounding using *self* as the context. Unlike the :method:`Decimal.from_float` class method, @@ -1039,14 +1039,14 @@ .. doctest:: - >>> context = Context(prec=5, rounding=ROUND_DOWN) - >>> context.create_decimal_from_float(math.pi) - Decimal('3.1415') - >>> context = Context(prec=5, traps=[Inexact]) - >>> context.create_decimal_from_float(math.pi) - Traceback (most recent call last): - ... - Inexact: None + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(math.pi) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(math.pi) + Traceback (most recent call last): + ... + Inexact: None .. versionadded:: 2.7 From buildbot at python.org Sat Jan 3 20:53:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 19:53:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090103195353.05FF41E4002@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/26 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: 4 tests failed: test_distutils test_posix test_subprocess test_wsgiref ====================================================================== 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 ====================================================================== ERROR: testEnviron (test.test_wsgiref.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_wsgiref.py", line 490, in testEnviron self.checkOSEnviron(h) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_wsgiref.py", line 482, in checkOSEnviron self.assertEqual(env[k],v) KeyError: 'AUTH_TYPE' ====================================================================== ERROR: testBytes (test.test_wsgiref.HeaderTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_wsgiref.py", line 427, in testBytes h[b"Foo"] = bytes(b"bar") File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/wsgiref/headers.py", line 67, in __setitem__ del self[name] File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/wsgiref/headers.py", line 77, in __delitem__ self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/wsgiref/headers.py", line 77, in self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] BytesWarning: Comparison between bytes and string sincerely, -The Buildbot From solipsis at pitrou.net Sat Jan 3 21:04:43 2009 From: solipsis at pitrou.net (Antoine Pitrou) Date: Sat, 3 Jan 2009 20:04:43 +0000 (UTC) Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 References: <20090103193828.4DE421E4002@bag.python.org> Message-ID: Ouch, I should have run the test suite with -bb. Reopening #4718. python.org> writes: > > ====================================================================== > ERROR: testBytes (test.test_wsgiref.HeaderTests) > ---------------------------------------------------------------------- > > Traceback (most recent call last): > File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_wsgiref.py", line 427, in testBytes > File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/wsgiref/headers.py", line 67, in __setitem__ > del self[name] > File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/wsgiref/headers.py", line 77, in __delitem__ > self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] > File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/wsgiref/headers.py", line 77, in > self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] > BytesWarning: Comparison between bytes and string From buildbot at python.org Sat Jan 3 21:07:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 20:07:42 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090103200742.A6B841E4002@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/59 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_wsgiref ====================================================================== ERROR: testEnviron (test.test_wsgiref.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_wsgiref.py", line 490, in testEnviron File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_wsgiref.py", line 482, in checkOSEnviron KeyError: 'AUTH_TYPE' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 21:15:14 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 21:15:14 +0100 (CET) Subject: [Python-checkins] r68215 - python/trunk/Doc/library/decimal.rst Message-ID: <20090103201514.F21D81E4017@bag.python.org> Author: georg.brandl Date: Sat Jan 3 21:15:14 2009 New Revision: 68215 Log: Fix role name. Modified: python/trunk/Doc/library/decimal.rst Modified: python/trunk/Doc/library/decimal.rst ============================================================================== --- python/trunk/Doc/library/decimal.rst (original) +++ python/trunk/Doc/library/decimal.rst Sat Jan 3 21:15:14 2009 @@ -1033,7 +1033,7 @@ .. method:: create_decimal_from_float(f) Creates a new Decimal instance from a float *f* but rounding using *self* - as the context. Unlike the :method:`Decimal.from_float` class method, + as the context. Unlike the :meth:`Decimal.from_float` class method, the context precision, rounding method, flags, and traps are applied to the conversion. From python-checkins at python.org Sat Jan 3 21:28:05 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 21:28:05 +0100 (CET) Subject: [Python-checkins] r68216 - in python/branches/py3k/Lib: test/test_wsgiref.py wsgiref/headers.py Message-ID: <20090103202805.44E741E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 21:28:05 2009 New Revision: 68216 Log: Fix BytesWarning with -bb in wsgiref.headers.Headers. Modified: python/branches/py3k/Lib/test/test_wsgiref.py python/branches/py3k/Lib/wsgiref/headers.py Modified: python/branches/py3k/Lib/test/test_wsgiref.py ============================================================================== --- python/branches/py3k/Lib/test/test_wsgiref.py (original) +++ python/branches/py3k/Lib/test/test_wsgiref.py Sat Jan 3 21:28:05 2009 @@ -426,15 +426,20 @@ h[b"Foo"] = bytes(b"bar") self.assertEqual("bar", h.get("Foo")) + self.assertEqual("bar", h.get(b"Foo")) h.setdefault(b"Bar", b"foo") self.assertEqual("foo", h.get("Bar")) + self.assertEqual("foo", h.get(b"Bar")) h.add_header(b'content-disposition', b'attachment', filename=b'bud.gif') self.assertEqual('attachment; filename="bud.gif"', h.get("content-disposition")) + del h['content-disposition'] + self.assert_(b'content-disposition' not in h) + class ErrorHandler(BaseCGIHandler): """Simple handler subclass for testing BaseHandler""" Modified: python/branches/py3k/Lib/wsgiref/headers.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/headers.py (original) +++ python/branches/py3k/Lib/wsgiref/headers.py Sat Jan 3 21:28:05 2009 @@ -73,7 +73,7 @@ Does *not* raise an exception if the header is missing. """ - name = name.lower() + name = self._convert_string_type(name.lower()) self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] def __getitem__(self,name): @@ -104,13 +104,13 @@ fields deleted and re-inserted are always appended to the header list. If no fields exist with the given name, returns an empty list. """ - name = name.lower() + name = self._convert_string_type(name.lower()) return [kv[1] for kv in self._headers if kv[0].lower()==name] def get(self,name,default=None): """Get the first header value for 'name', or return 'default'""" - name = name.lower() + name = self._convert_string_type(name.lower()) for k,v in self._headers: if k.lower()==name: return v From python-checkins at python.org Sat Jan 3 21:30:15 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 21:30:15 +0100 (CET) Subject: [Python-checkins] r68217 - in python/trunk/Doc: Makefile tools/rstlint.py Message-ID: <20090103203015.B068F1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 21:30:15 2009 New Revision: 68217 Log: Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. Added: python/trunk/Doc/tools/rstlint.py (contents, props changed) Modified: python/trunk/Doc/Makefile Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Sat Jan 3 21:30:15 2009 @@ -14,7 +14,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html htmlhelp clean coverage dist +.PHONY: help checkout update build html htmlhelp clean coverage dist check help: @echo "Please use \`make ' where is one of" @@ -141,3 +141,5 @@ cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 +check: + $(PYTHON) tools/rstlint.py -i tools -s 2 Added: python/trunk/Doc/tools/rstlint.py ============================================================================== --- (empty file) +++ python/trunk/Doc/tools/rstlint.py Sat Jan 3 21:30:15 2009 @@ -0,0 +1,217 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Check for stylistic and formal issues in .rst and .py +# files included in the documentation. +# +# 01/2009, Georg Brandl + +from __future__ import with_statement + +import os +import re +import sys +import getopt +import subprocess +from os.path import join, splitext, abspath, exists +from collections import defaultdict + +directives = [ + # standard docutils ones + 'admonition', 'attention', 'caution', 'class', 'compound', 'container', + 'contents', 'csv-table', 'danger', 'date', 'default-role', 'epigraph', + 'error', 'figure', 'footer', 'header', 'highlights', 'hint', 'image', + 'important', 'include', 'line-block', 'list-table', 'meta', 'note', + 'parsed-literal', 'pull-quote', 'raw', 'replace', + 'restructuredtext-test-directive', 'role', 'rubric', 'sectnum', 'sidebar', + 'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning', + # Sphinx custom ones + 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', + 'autoexception', 'autofunction', 'automethod', 'automodule', 'centered', + 'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember', + 'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar', + 'data', 'deprecated', 'describe', 'directive', 'doctest', 'envvar', 'event', + 'exception', 'function', 'glossary', 'highlight', 'highlightlang', 'index', + 'literalinclude', 'method', 'module', 'moduleauthor', 'productionlist', + 'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod', + 'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo', + 'todolist', 'versionadded', 'versionchanged' +] + +all_directives = '(' + '|'.join(directives) + ')' +seems_directive_re = re.compile(r'\.\. %s([^a-z:]|:(?!:))' % all_directives) + +leaked_markup_re = re.compile(r'[a-z]::[^=]|:[a-z]+:|`|\.\.\s*\w+:') + + +checkers = {} + +checker_props = {'severity': 1, 'falsepositives': False} + +def checker(*suffixes, **kwds): + """Decorator to register a function as a checker.""" + def deco(func): + for suffix in suffixes: + checkers.setdefault(suffix, []).append(func) + for prop in checker_props: + setattr(func, prop, kwds.get(prop, checker_props[prop])) + return func + return deco + + + at checker('.py', severity=4) +def check_syntax(fn, lines): + """Check Python examples for valid syntax.""" + try: + code = ''.join(lines) + if '\r' in code: + yield 0, '\\r in code file' + code = code.replace('\r', '') + compile(code, fn, 'exec') + except SyntaxError, err: + yield err.lineno, 'not compilable: %s' % err + + + at checker('.rst', severity=2) +def check_suspicious_constructs(fn, lines): + """Check for suspicious reST constructs.""" + for lno, line in enumerate(lines): + if seems_directive_re.match(line): + yield lno+1, 'comment seems to be intended as a directive' + + + at checker('.py', '.rst') +def check_whitespace(fn, lines): + """Check for whitespace and line length issues.""" + lasti = 0 + for lno, line in enumerate(lines): + if '\r' in line: + yield lno+1, '\\r in line' + if '\t' in line: + yield lno+1, 'OMG TABS!!!1' + if line[:-1].rstrip(' \t') != line[:-1]: + yield lno+1, 'trailing whitespace' + if len(line) > 86: + # don't complain about tables, links and function signatures + if line.lstrip()[0] not in '+|' and \ + 'http://' not in line and \ + not line.lstrip().startswith(('.. function', + '.. method', + '.. cfunction')): + yield lno+1, "line too long" + + + at checker('.html', severity=2, falsepositives=True) +def check_leaked_markup(fn, lines): + """Check HTML files for leaked reST markup; this only works if + the HTML files have been built. + """ + for lno, line in enumerate(lines): + if leaked_markup_re.search(line): + yield lno+1, 'possibly leaked markup: %r' % line + + +def main(argv): + usage = '''\ +Usage: %s [-v] [-f] [-s sev] [-i path]* [path] + +Options: -v verbose (print all checked file names) + -f enable checkers that yield many false positives + -s sev only show problems with severity >= sev + -i path ignore subdir or file path +''' % argv[0] + try: + gopts, args = getopt.getopt(argv[1:], 'vfs:i:') + except getopt.GetoptError: + print usage + return 2 + + verbose = False + severity = 1 + ignore = [] + falsepos = False + for opt, val in gopts: + if opt == '-v': + verbose = True + elif opt == '-f': + falsepos = True + elif opt == '-s': + severity = int(val) + elif opt == '-i': + ignore.append(abspath(val)) + + if len(args) == 0: + path = '.' + elif len(args) == 1: + path = args[0] + else: + print usage + return 2 + + if not exists(path): + print 'Error: path %s does not exist' % path + return 2 + + count = defaultdict(int) + out = sys.stdout + + for root, dirs, files in os.walk(path): + # ignore subdirs controlled by svn + if '.svn' in dirs: + dirs.remove('.svn') + + # ignore subdirs in ignore list + if abspath(root) in ignore: + del dirs[:] + continue + + for fn in files: + fn = join(root, fn) + if fn[:2] == './': + fn = fn[2:] + + # ignore files in ignore list + if abspath(fn) in ignore: + continue + + ext = splitext(fn)[1] + checkerlist = checkers.get(ext, None) + if not checkerlist: + continue + + if verbose: + print 'Checking %s...' % fn + + try: + with open(fn, 'r') as f: + lines = list(f) + except (IOError, OSError), err: + print '%s: cannot open: %s' % (fn, err) + count[4] += 1 + continue + + for checker in checkerlist: + if checker.falsepositives and not falsepos: + continue + csev = checker.severity + if csev >= severity: + for lno, msg in checker(fn, lines): + print >>out, '[%d] %s:%d: %s' % (csev, fn, lno, msg) + count[csev] += 1 + if verbose: + print + if not count: + if severity > 1: + print 'No problems with severity >= %d found.' % severity + else: + print 'No problems found.' + else: + for severity in sorted(count): + number = count[severity] + print '%d problem%s with severity %d found.' % \ + (number, number > 1 and 's' or '', severity) + return int(bool(count)) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) From python-checkins at python.org Sat Jan 3 21:38:59 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 21:38:59 +0100 (CET) Subject: [Python-checkins] r68218 - python/trunk/Doc/tools/rstlint.py Message-ID: <20090103203859.A8DEC1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 21:38:59 2009 New Revision: 68218 Log: Recognize usage of the default role. Modified: python/trunk/Doc/tools/rstlint.py Modified: python/trunk/Doc/tools/rstlint.py ============================================================================== --- python/trunk/Doc/tools/rstlint.py (original) +++ python/trunk/Doc/tools/rstlint.py Sat Jan 3 21:38:59 2009 @@ -40,7 +40,7 @@ all_directives = '(' + '|'.join(directives) + ')' seems_directive_re = re.compile(r'\.\. %s([^a-z:]|:(?!:))' % all_directives) - +default_role_re = re.compile(r'(^| )`\w([^`]*?\w)?`($| )') leaked_markup_re = re.compile(r'[a-z]::[^=]|:[a-z]+:|`|\.\.\s*\w+:') @@ -65,7 +65,8 @@ try: code = ''.join(lines) if '\r' in code: - yield 0, '\\r in code file' + if os.name != 'nt': + yield 0, '\\r in code file' code = code.replace('\r', '') compile(code, fn, 'exec') except SyntaxError, err: @@ -75,9 +76,16 @@ @checker('.rst', severity=2) def check_suspicious_constructs(fn, lines): """Check for suspicious reST constructs.""" + inprod = False for lno, line in enumerate(lines): if seems_directive_re.match(line): yield lno+1, 'comment seems to be intended as a directive' + if '.. productionlist::' in line: + inprod = True + elif not inprod and default_role_re.search(line): + yield lno+1, 'default role used' + elif inprod and not line.strip(): + inprod = False @checker('.py', '.rst') From python-checkins at python.org Sat Jan 3 21:47:01 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 21:47:01 +0100 (CET) Subject: [Python-checkins] r68219 - in python/trunk/Doc: c-api/file.rst distutils/uploading.rst documenting/markup.rst library/ast.rst library/configparser.rst library/ctypes.rst library/decimal.rst library/fractions.rst library/repr.rst library/socketserver.rst library/tempfile.rst Message-ID: <20090103204701.7F6681E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 21:47:01 2009 New Revision: 68219 Log: Fix uses of the default role. Modified: python/trunk/Doc/c-api/file.rst python/trunk/Doc/distutils/uploading.rst python/trunk/Doc/documenting/markup.rst python/trunk/Doc/library/ast.rst python/trunk/Doc/library/configparser.rst python/trunk/Doc/library/ctypes.rst python/trunk/Doc/library/decimal.rst python/trunk/Doc/library/fractions.rst python/trunk/Doc/library/repr.rst python/trunk/Doc/library/socketserver.rst python/trunk/Doc/library/tempfile.rst Modified: python/trunk/Doc/c-api/file.rst ============================================================================== --- python/trunk/Doc/c-api/file.rst (original) +++ python/trunk/Doc/c-api/file.rst Sat Jan 3 21:47:01 2009 @@ -63,8 +63,8 @@ Return the file object associated with *p* as a :ctype:`FILE\*`. If the caller will ever use the returned :ctype:`FILE\*` object while - the GIL is released it must also call the `PyFile_IncUseCount` and - `PyFile_DecUseCount` functions described below as appropriate. + the GIL is released it must also call the :cfunc:`PyFile_IncUseCount` and + :cfunc:`PyFile_DecUseCount` functions described below as appropriate. .. cfunction:: void PyFile_IncUseCount(PyFileObject \*p) @@ -72,13 +72,13 @@ Increments the PyFileObject's internal use count to indicate that the underlying :ctype:`FILE\*` is being used. This prevents Python from calling f_close() on it from another thread. - Callers of this must call `PyFile_DecUseCount` when they are + Callers of this must call :cfunc:`PyFile_DecUseCount` when they are finished with the :ctype:`FILE\*`. Otherwise the file object will never be closed by Python. The GIL must be held while calling this function. - The suggested use is to call this after `PyFile_AsFile` just before + The suggested use is to call this after :cfunc:`PyFile_AsFile` just before you release the GIL. .. versionadded:: 2.6 @@ -88,7 +88,7 @@ Decrements the PyFileObject's internal unlocked_count member to indicate that the caller is done with its own use of the :ctype:`FILE\*`. - This may only be called to undo a prior call to `PyFile_IncUseCount`. + This may only be called to undo a prior call to :cfunc:`PyFile_IncUseCount`. The GIL must be held while calling this function. Modified: python/trunk/Doc/distutils/uploading.rst ============================================================================== --- python/trunk/Doc/distutils/uploading.rst (original) +++ python/trunk/Doc/distutils/uploading.rst Sat Jan 3 21:47:01 2009 @@ -35,9 +35,9 @@ be available for execution on the system :envvar:`PATH`. You can also specify which key to use for signing using the :option:`--identity=*name*` option. -Other :command:`upload` options include :option:`--repository=*url*` -or :option:`--repository=*section*` where `url` is the url of the server -and `section` the name of the section in :file:`$HOME/.pypirc`, and +Other :command:`upload` options include :option:`--repository=` or +:option:`--repository=
` where *url* is the url of the server and +*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). Modified: python/trunk/Doc/documenting/markup.rst ============================================================================== --- python/trunk/Doc/documenting/markup.rst (original) +++ python/trunk/Doc/documenting/markup.rst Sat Jan 3 21:47:01 2009 @@ -599,7 +599,7 @@ Example:: .. versionadded:: 2.5 - The `spam` parameter. + The *spam* parameter. Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. @@ -760,7 +760,7 @@ Blank lines are not allowed within ``productionlist`` directive arguments. The definition can contain token names which are marked as interpreted text - (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references + (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references to the productions of these tokens. Note that no further reST parsing is done in the production, so that you Modified: python/trunk/Doc/library/ast.rst ============================================================================== --- python/trunk/Doc/library/ast.rst (original) +++ python/trunk/Doc/library/ast.rst Sat Jan 3 21:47:01 2009 @@ -191,7 +191,7 @@ A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -220,11 +220,11 @@ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: Modified: python/trunk/Doc/library/configparser.rst ============================================================================== --- python/trunk/Doc/library/configparser.rst (original) +++ python/trunk/Doc/library/configparser.rst Sat Jan 3 21:47:01 2009 @@ -11,9 +11,9 @@ .. note:: - The :mod:`ConfigParser` module has been renamed to `configparser` in Python - 3.0. The :term:`2to3` tool will automatically adapt imports when converting - your sources to 3.0. + The :mod:`ConfigParser` module has been renamed to :mod:`configparser` in + Python 3.0. The :term:`2to3` tool will automatically adapt imports when + converting your sources to 3.0. .. index:: pair: .ini; file Modified: python/trunk/Doc/library/ctypes.rst ============================================================================== --- python/trunk/Doc/library/ctypes.rst (original) +++ python/trunk/Doc/library/ctypes.rst Sat Jan 3 21:47:01 2009 @@ -1378,24 +1378,22 @@ The *mode* parameter can be used to specify how the library is loaded. For details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored. -The *use_errno* parameter, when set to True, enables a ctypes -mechanism that allows to access the system `errno` error number in a -safe way. `ctypes` maintains a thread-local copy of the systems -`errno` variable; if you call foreign functions created with -`use_errno=True` then the `errno` value before the function call is -swapped with the ctypes private copy, the same happens immediately -after the function call. - -The function `ctypes.get_errno()` returns the value of the ctypes -private copy, and the function `ctypes.set_errno(value)` changes the -ctypes private copy to `value` and returns the former value. - -The *use_last_error* parameter, when set to True, enables the same -mechanism for the Windows error code which is managed by the -:func:`GetLastError` and :func:`SetLastError` Windows API functions; -`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used -to request and change the ctypes private copy of the windows error -code. +The *use_errno* parameter, when set to True, enables a ctypes mechanism that +allows to access the system :data:`errno` error number in a safe way. +:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` +variable; if you call foreign functions created with ``use_errno=True`` then the +:data:`errno` value before the function call is swapped with the ctypes private +copy, the same happens immediately after the function call. + +The function :func:`ctypes.get_errno` returns the value of the ctypes private +copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy +to a new value and returns the former value. + +The *use_last_error* parameter, when set to True, enables the same mechanism for +the Windows error code which is managed by the :func:`GetLastError` and +:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and +:func:`ctypes.set_last_error` are used to request and change the ctypes private +copy of the windows error code. .. versionadded:: 2.6 The ``use_last_error`` and ``use_errno`` optional parameters @@ -1602,22 +1600,23 @@ .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) The returned function prototype creates functions that use the standard C - calling convention. The function will release the GIL during the call. - If `use_errno` is set to True, the ctypes private copy of the system `errno` - variable is exchanged with the real `errno` value bafore and after the call; - `use_last_error` does the same for the Windows error code. + calling convention. The function will release the GIL during the call. If + *use_errno* is set to True, the ctypes private copy of the system + :data:`errno` variable is exchanged with the real :data:`errno` value bafore + and after the call; *use_last_error* does the same for the Windows error + code. .. versionchanged:: 2.6 - The optional `use_errno` and `use_last_error` parameters were - added. + The optional *use_errno* and *use_last_error* parameters were added. .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) Windows only: The returned function prototype creates functions that use the - ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE` - is the same as :func:`CFUNCTYPE`. The function will release the GIL during the - call. `use_errno` and `use_last_error` have the same meaning as above. + ``stdcall`` calling convention, except on Windows CE where + :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will + release the GIL during the call. *use_errno* and *use_last_error* have the + same meaning as above. .. function:: PYFUNCTYPE(restype, *argtypes) @@ -1864,10 +1863,10 @@ .. function:: find_library(name) :module: ctypes.util - Try to find a library and return a pathname. `name` is the library name without - any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this - is the form used for the posix linker option :option:`-l`). If no library can - be found, returns ``None``. + Try to find a library and return a pathname. *name* is the library name + without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + number (this is the form used for the posix linker option :option:`-l`). If + no library can be found, returns ``None``. The exact functionality is system dependent. @@ -1905,14 +1904,14 @@ .. function:: get_errno() Returns the current value of the ctypes-private copy of the system - `errno` variable in the calling thread. + :data:`errno` variable in the calling thread. .. versionadded:: 2.6 .. function:: get_last_error() Windows only: returns the current value of the ctypes-private copy of the system - `LastError` variable in the calling thread. + :data:`LastError` variable in the calling thread. .. versionadded:: 2.6 @@ -1969,17 +1968,16 @@ .. function:: set_errno(value) - Set the current value of the ctypes-private copy of the system - `errno` variable in the calling thread to `value` and return the - previous value. + Set the current value of the ctypes-private copy of the system :data:`errno` + variable in the calling thread to *value* and return the previous value. .. versionadded:: 2.6 .. function:: set_last_error(value) - Windows only: set the current value of the ctypes-private copy of - the system `LastError` variable in the calling thread to `value` - and return the previous value. + Windows only: set the current value of the ctypes-private copy of the system + :data:`LastError` variable in the calling thread to *value* and return the + previous value. .. versionadded:: 2.6 Modified: python/trunk/Doc/library/decimal.rst ============================================================================== --- python/trunk/Doc/library/decimal.rst (original) +++ python/trunk/Doc/library/decimal.rst Sat Jan 3 21:47:01 2009 @@ -1211,7 +1211,7 @@ .. method:: logical_and(x, y) - Applies the logical operation `and` between each operand's digits. + Applies the logical operation *and* between each operand's digits. .. method:: logical_invert(x) @@ -1221,12 +1221,12 @@ .. method:: logical_or(x, y) - Applies the logical operation `or` between each operand's digits. + Applies the logical operation *or* between each operand's digits. .. method:: logical_xor(x, y) - Applies the logical operation `xor` between each operand's digits. + Applies the logical operation *xor* between each operand's digits. .. method:: max(x, y) @@ -1337,8 +1337,8 @@ .. method:: remainder_near(x, y) - Returns `x - y * n`, where *n* is the integer nearest the exact value - of `x / y` (if the result is `0` then its sign will be the sign of *x*). + Returns ``x - y * n``, where *n* is the integer nearest the exact value + of ``x / y`` (if the result is 0 then its sign will be the sign of *x*). .. method:: rotate(x, y) Modified: python/trunk/Doc/library/fractions.rst ============================================================================== --- python/trunk/Doc/library/fractions.rst (original) +++ python/trunk/Doc/library/fractions.rst Sat Jan 3 21:47:01 2009 @@ -101,11 +101,11 @@ .. function:: gcd(a, b) - Return the greatest common divisor of the integers `a` and `b`. If - either `a` or `b` is nonzero, then the absolute value of `gcd(a, - b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)` - has the same sign as `b` if `b` is nonzero; otherwise it takes the sign - of `a`. `gcd(0, 0)` returns `0`. + Return the greatest common divisor of the integers *a* and *b*. If either + *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the + largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same + sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0, + 0)`` returns ``0``. .. seealso:: Modified: python/trunk/Doc/library/repr.rst ============================================================================== --- python/trunk/Doc/library/repr.rst (original) +++ python/trunk/Doc/library/repr.rst Sat Jan 3 21:47:01 2009 @@ -125,15 +125,15 @@ the handling of types already supported. This example shows how special support for file objects could be added:: - import repr + import repr as reprlib import sys - class MyRepr(repr.Repr): + class MyRepr(reprlib.Repr): def repr_file(self, obj, level): if obj.name in ['', '', '']: return obj.name else: - return `obj` + return repr(obj) aRepr = MyRepr() print aRepr.repr(sys.stdin) # prints '' Modified: python/trunk/Doc/library/socketserver.rst ============================================================================== --- python/trunk/Doc/library/socketserver.rst (original) +++ python/trunk/Doc/library/socketserver.rst Sat Jan 3 21:47:01 2009 @@ -7,9 +7,9 @@ .. note:: - The :mod:`SocketServer` module has been renamed to `socketserver` in Python - 3.0. The :term:`2to3` tool will automatically adapt imports when converting - your sources to 3.0. + The :mod:`SocketServer` module has been renamed to :mod:`socketserver` in + Python 3.0. The :term:`2to3` tool will automatically adapt imports when + converting your sources to 3.0. The :mod:`SocketServer` module simplifies the task of writing network servers. Modified: python/trunk/Doc/library/tempfile.rst ============================================================================== --- python/trunk/Doc/library/tempfile.rst (original) +++ python/trunk/Doc/library/tempfile.rst Sat Jan 3 21:47:01 2009 @@ -164,11 +164,11 @@ .. warning:: - Use of this function may introduce a security hole in your program. - By the time you get around to doing anything with the file name it - returns, someone else may have beaten you to the punch. - :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + Use of this function may introduce a security hole in your program. By + the time you get around to doing anything with the file name it returns, + someone else may have beaten you to the punch. :func:`mktemp` usage can + be replaced easily with :func:`NamedTemporaryFile`, passing it the + ``delete=False`` parameter:: >>> f = NamedTemporaryFile(delete=False) >>> f From python-checkins at python.org Sat Jan 3 21:55:08 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 21:55:08 +0100 (CET) Subject: [Python-checkins] r68220 - in python/trunk/Doc: c-api/buffer.rst c-api/conversion.rst c-api/init.rst c-api/long.rst c-api/module.rst c-api/reflection.rst c-api/sequence.rst c-api/set.rst c-api/structures.rst distutils/apiref.rst distutils/builtdist.rst distutils/configfile.rst distutils/packageindex.rst distutils/setupscript.rst documenting/markup.rst extending/building.rst extending/extending.rst extending/newtypes.rst extending/windows.rst glossary.rst howto/curses.rst howto/doanddont.rst howto/functional.rst howto/regex.rst howto/sockets.rst howto/unicode.rst howto/urllib2.rst howto/webservers.rst install/index.rst library/abc.rst library/aifc.rst library/al.rst library/ast.rst library/audioop.rst library/bastion.rst library/bdb.rst library/bsddb.rst library/bz2.rst library/cd.rst library/cmath.rst library/codeop.rst library/collections.rst library/compiler.rst library/crypt.rst library/csv.rst library/datetime.rst library/decimal.rst library/difflib.rst library/dircache.rst library/dis.rst library/dl.rst library/email.mime.rst library/fileinput.rst library/fl.rst library/fm.rst library/fpformat.rst library/functions.rst library/gl.rst library/heapq.rst library/htmllib.rst library/idle.rst library/imageop.rst library/imgfile.rst library/io.rst library/itertools.rst library/jpeg.rst library/json.rst library/locale.rst library/macos.rst library/mailbox.rst library/marshal.rst library/math.rst library/mhlib.rst library/mmap.rst library/msvcrt.rst library/multiprocessing.rst library/mutex.rst library/nntplib.rst library/operator.rst library/optparse.rst library/os.rst library/ossaudiodev.rst library/othergui.rst library/pdb.rst library/pickle.rst library/popen2.rst library/profile.rst library/pyexpat.rst library/re.rst library/rexec.rst library/rlcompleter.rst library/robotparser.rst library/sched.rst library/sgmllib.rst library/shutil.rst library/signal.rst library/simplexmlrpcserver.rst library/smtplib.rst library/socket.rst library/sqlite3.rst library/ssl.rst library/statvfs.rst library/stdtypes.rst library/string.rst library/stringio.rst library/subprocess.rst library/sunaudio.rst library/sys.rst library/tk.rst library/tkinter.rst library/trace.rst library/traceback.rst library/turtle.rst library/undoc.rst library/unicodedata.rst library/unittest.rst library/urllib.rst library/urllib2.rst library/warnings.rst library/webbrowser.rst library/wsgiref.rst library/xml.etree.elementtree.rst library/zipfile.rst library/zipimport.rst license.rst reference/expressions.rst reference/lexical_analysis.rst reference/simple_stmts.rst tutorial/classes.rst tutorial/controlflow.rst tutorial/datastructures.rst tutorial/errors.rst tutorial/index.rst tutorial/inputoutput.rst tutorial/interpreter.rst tutorial/introduction.rst tutorial/modules.rst tutorial/stdlib.rst tutorial/whatnow.rst using/cmdline.rst using/unix.rst using/windows.rst whatsnew/2.0.rst whatsnew/2.1.rst whatsnew/2.2.rst whatsnew/2.3.rst whatsnew/2.4.rst whatsnew/2.5.rst whatsnew/2.6.rst Message-ID: <20090103205508.5DBFE1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 21:55:06 2009 New Revision: 68220 Log: Remove trailing whitespace. Modified: python/trunk/Doc/c-api/buffer.rst python/trunk/Doc/c-api/conversion.rst python/trunk/Doc/c-api/init.rst python/trunk/Doc/c-api/long.rst python/trunk/Doc/c-api/module.rst python/trunk/Doc/c-api/reflection.rst python/trunk/Doc/c-api/sequence.rst python/trunk/Doc/c-api/set.rst python/trunk/Doc/c-api/structures.rst python/trunk/Doc/distutils/apiref.rst python/trunk/Doc/distutils/builtdist.rst python/trunk/Doc/distutils/configfile.rst python/trunk/Doc/distutils/packageindex.rst python/trunk/Doc/distutils/setupscript.rst python/trunk/Doc/documenting/markup.rst python/trunk/Doc/extending/building.rst python/trunk/Doc/extending/extending.rst python/trunk/Doc/extending/newtypes.rst python/trunk/Doc/extending/windows.rst python/trunk/Doc/glossary.rst python/trunk/Doc/howto/curses.rst python/trunk/Doc/howto/doanddont.rst python/trunk/Doc/howto/functional.rst python/trunk/Doc/howto/regex.rst python/trunk/Doc/howto/sockets.rst python/trunk/Doc/howto/unicode.rst python/trunk/Doc/howto/urllib2.rst python/trunk/Doc/howto/webservers.rst python/trunk/Doc/install/index.rst python/trunk/Doc/library/abc.rst python/trunk/Doc/library/aifc.rst python/trunk/Doc/library/al.rst python/trunk/Doc/library/ast.rst python/trunk/Doc/library/audioop.rst python/trunk/Doc/library/bastion.rst python/trunk/Doc/library/bdb.rst python/trunk/Doc/library/bsddb.rst python/trunk/Doc/library/bz2.rst python/trunk/Doc/library/cd.rst python/trunk/Doc/library/cmath.rst python/trunk/Doc/library/codeop.rst python/trunk/Doc/library/collections.rst python/trunk/Doc/library/compiler.rst python/trunk/Doc/library/crypt.rst python/trunk/Doc/library/csv.rst python/trunk/Doc/library/datetime.rst python/trunk/Doc/library/decimal.rst python/trunk/Doc/library/difflib.rst python/trunk/Doc/library/dircache.rst python/trunk/Doc/library/dis.rst python/trunk/Doc/library/dl.rst python/trunk/Doc/library/email.mime.rst python/trunk/Doc/library/fileinput.rst python/trunk/Doc/library/fl.rst python/trunk/Doc/library/fm.rst python/trunk/Doc/library/fpformat.rst python/trunk/Doc/library/functions.rst python/trunk/Doc/library/gl.rst python/trunk/Doc/library/heapq.rst python/trunk/Doc/library/htmllib.rst python/trunk/Doc/library/idle.rst python/trunk/Doc/library/imageop.rst python/trunk/Doc/library/imgfile.rst python/trunk/Doc/library/io.rst python/trunk/Doc/library/itertools.rst python/trunk/Doc/library/jpeg.rst python/trunk/Doc/library/json.rst python/trunk/Doc/library/locale.rst python/trunk/Doc/library/macos.rst python/trunk/Doc/library/mailbox.rst python/trunk/Doc/library/marshal.rst python/trunk/Doc/library/math.rst python/trunk/Doc/library/mhlib.rst python/trunk/Doc/library/mmap.rst python/trunk/Doc/library/msvcrt.rst python/trunk/Doc/library/multiprocessing.rst python/trunk/Doc/library/mutex.rst python/trunk/Doc/library/nntplib.rst python/trunk/Doc/library/operator.rst python/trunk/Doc/library/optparse.rst python/trunk/Doc/library/os.rst python/trunk/Doc/library/ossaudiodev.rst python/trunk/Doc/library/othergui.rst python/trunk/Doc/library/pdb.rst python/trunk/Doc/library/pickle.rst python/trunk/Doc/library/popen2.rst python/trunk/Doc/library/profile.rst python/trunk/Doc/library/pyexpat.rst python/trunk/Doc/library/re.rst python/trunk/Doc/library/rexec.rst python/trunk/Doc/library/rlcompleter.rst python/trunk/Doc/library/robotparser.rst python/trunk/Doc/library/sched.rst python/trunk/Doc/library/sgmllib.rst python/trunk/Doc/library/shutil.rst python/trunk/Doc/library/signal.rst python/trunk/Doc/library/simplexmlrpcserver.rst python/trunk/Doc/library/smtplib.rst python/trunk/Doc/library/socket.rst python/trunk/Doc/library/sqlite3.rst python/trunk/Doc/library/ssl.rst python/trunk/Doc/library/statvfs.rst python/trunk/Doc/library/stdtypes.rst python/trunk/Doc/library/string.rst python/trunk/Doc/library/stringio.rst python/trunk/Doc/library/subprocess.rst python/trunk/Doc/library/sunaudio.rst python/trunk/Doc/library/sys.rst python/trunk/Doc/library/tk.rst python/trunk/Doc/library/tkinter.rst python/trunk/Doc/library/trace.rst python/trunk/Doc/library/traceback.rst python/trunk/Doc/library/turtle.rst python/trunk/Doc/library/undoc.rst python/trunk/Doc/library/unicodedata.rst python/trunk/Doc/library/unittest.rst python/trunk/Doc/library/urllib.rst python/trunk/Doc/library/urllib2.rst python/trunk/Doc/library/warnings.rst python/trunk/Doc/library/webbrowser.rst python/trunk/Doc/library/wsgiref.rst python/trunk/Doc/library/xml.etree.elementtree.rst python/trunk/Doc/library/zipfile.rst python/trunk/Doc/library/zipimport.rst python/trunk/Doc/license.rst python/trunk/Doc/reference/expressions.rst python/trunk/Doc/reference/lexical_analysis.rst python/trunk/Doc/reference/simple_stmts.rst python/trunk/Doc/tutorial/classes.rst python/trunk/Doc/tutorial/controlflow.rst python/trunk/Doc/tutorial/datastructures.rst python/trunk/Doc/tutorial/errors.rst python/trunk/Doc/tutorial/index.rst python/trunk/Doc/tutorial/inputoutput.rst python/trunk/Doc/tutorial/interpreter.rst python/trunk/Doc/tutorial/introduction.rst python/trunk/Doc/tutorial/modules.rst python/trunk/Doc/tutorial/stdlib.rst python/trunk/Doc/tutorial/whatnow.rst python/trunk/Doc/using/cmdline.rst python/trunk/Doc/using/unix.rst python/trunk/Doc/using/windows.rst python/trunk/Doc/whatsnew/2.0.rst python/trunk/Doc/whatsnew/2.1.rst python/trunk/Doc/whatsnew/2.2.rst python/trunk/Doc/whatsnew/2.3.rst python/trunk/Doc/whatsnew/2.4.rst python/trunk/Doc/whatsnew/2.5.rst python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/c-api/buffer.rst ============================================================================== --- python/trunk/Doc/c-api/buffer.rst (original) +++ python/trunk/Doc/c-api/buffer.rst Sat Jan 3 21:55:06 2009 @@ -30,7 +30,7 @@ .. index:: single: PyBufferProcs -More information on the buffer interface is provided in the section +More information on the buffer interface is provided in the section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`. A "buffer object" is defined in the :file:`bufferobject.h` header (included by Modified: python/trunk/Doc/c-api/conversion.rst ============================================================================== --- python/trunk/Doc/c-api/conversion.rst (original) +++ python/trunk/Doc/c-api/conversion.rst Sat Jan 3 21:55:06 2009 @@ -77,7 +77,7 @@ .. versionadded:: 2.4 - + .. cfunction:: double PyOS_ascii_atof(const char *nptr) Convert a string to a :ctype:`double` in a locale-independent way. @@ -86,7 +86,7 @@ See the Unix man page :manpage:`atof(2)` for details. - + .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) Case insensitive comparison of strings. The function works almost Modified: python/trunk/Doc/c-api/init.rst ============================================================================== --- python/trunk/Doc/c-api/init.rst (original) +++ python/trunk/Doc/c-api/init.rst Sat Jan 3 21:55:06 2009 @@ -902,7 +902,7 @@ Return a tuple of function call counts. There are constants defined for the positions within the tuple: - + +-------------------------------+-------+ | Name | Value | +===============================+=======+ @@ -928,7 +928,7 @@ +-------------------------------+-------+ | :const:`PCALL_POP` | 10 | +-------------------------------+-------+ - + :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used. Modified: python/trunk/Doc/c-api/long.rst ============================================================================== --- python/trunk/Doc/c-api/long.rst (original) +++ python/trunk/Doc/c-api/long.rst Sat Jan 3 21:55:06 2009 @@ -126,7 +126,7 @@ Return a C :ctype:`long` representation of the contents of *pylong*. If *pylong* is greater than :const:`LONG_MAX`, an :exc:`OverflowError` is raised - and ``-1`` will be returned. + and ``-1`` will be returned. .. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong) Modified: python/trunk/Doc/c-api/module.rst ============================================================================== --- python/trunk/Doc/c-api/module.rst (original) +++ python/trunk/Doc/c-api/module.rst Sat Jan 3 21:55:06 2009 @@ -106,7 +106,7 @@ .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro) - Add an int constant to *module*. The name and the value are taken from + Add an int constant to *module*. The name and the value are taken from *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on error, ``0`` on success. Modified: python/trunk/Doc/c-api/reflection.rst ============================================================================== --- python/trunk/Doc/c-api/reflection.rst (original) +++ python/trunk/Doc/c-api/reflection.rst Sat Jan 3 21:55:06 2009 @@ -15,7 +15,7 @@ Return a dictionary of the local variables in the current execution frame, or *NULL* if no frame is currently executing. - + .. cfunction:: PyObject* PyEval_GetGlobals() Modified: python/trunk/Doc/c-api/sequence.rst ============================================================================== --- python/trunk/Doc/c-api/sequence.rst (original) +++ python/trunk/Doc/c-api/sequence.rst Sat Jan 3 21:55:06 2009 @@ -143,9 +143,9 @@ Return the underlying array of PyObject pointers. Assumes that *o* was returned by :cfunc:`PySequence_Fast` and *o* is not *NULL*. - + Note, if a list gets resized, the reallocation may relocate the items array. - So, only use the underlying array pointer in contexts where the sequence + So, only use the underlying array pointer in contexts where the sequence cannot change. .. versionadded:: 2.4 Modified: python/trunk/Doc/c-api/set.rst ============================================================================== --- python/trunk/Doc/c-api/set.rst (original) +++ python/trunk/Doc/c-api/set.rst Sat Jan 3 21:55:06 2009 @@ -101,7 +101,7 @@ .. versionchanged:: 2.6 Now guaranteed to return a brand-new :class:`frozenset`. Formerly, - frozensets of zero-length were a singleton. This got in the way of + frozensets of zero-length were a singleton. This got in the way of building-up new frozensets with :meth:`PySet_Add`. The following functions and macros are available for instances of :class:`set` Modified: python/trunk/Doc/c-api/structures.rst ============================================================================== --- python/trunk/Doc/c-api/structures.rst (original) +++ python/trunk/Doc/c-api/structures.rst Sat Jan 3 21:55:06 2009 @@ -265,7 +265,7 @@ read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` can be deleted. (They are set to *NULL*). - + .. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name) Modified: python/trunk/Doc/distutils/apiref.rst ============================================================================== --- python/trunk/Doc/distutils/apiref.rst (original) +++ python/trunk/Doc/distutils/apiref.rst Sat Jan 3 21:55:06 2009 @@ -104,7 +104,7 @@ | *package_dir* | A mapping of package to | a dictionary | | | directory names | | +--------------------+--------------------------------+-------------------------------------------------------------+ - + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -755,7 +755,7 @@ standard output, otherwise do nothing. .. % \subsection{Compiler-specific modules} -.. % +.. % .. % The following modules implement concrete subclasses of the abstract .. % \class{CCompiler} class. They should not be instantiated directly, but should .. % be created using \function{distutils.ccompiler.new_compiler()} factory @@ -859,7 +859,7 @@ Macintosh. Needs work to support CW on Windows or Mac OS X. .. % \subsection{Utility modules} -.. % +.. % .. % The following modules all provide general utility functions. They haven't .. % all been documented yet. @@ -1110,13 +1110,13 @@ For MacOS X systems the OS version reflects the minimal version on which binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` - during the build of Python), not the OS version of the current system. + during the build of Python), not the OS version of the current system. For universal binary builds on MacOS X the architecture value reflects the univeral binary status instead of the architecture of the current - processor. For 32-bit universal binaries the architecture is ``fat``, - for 64-bit universal binaries the architecture is ``fat64``, and - for 4-way universal binaries the architecture is ``universal``. + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. Examples of returned values on MacOS X: @@ -1693,7 +1693,7 @@ .. % todo .. % \section{Distutils Commands} -.. % +.. % .. % This part of Distutils implements the various Distutils commands, such .. % as \code{build}, \code{install} \&c. Each command is implemented as a .. % separate module, with the command name as the name of the module. Modified: python/trunk/Doc/distutils/builtdist.rst ============================================================================== --- python/trunk/Doc/distutils/builtdist.rst (original) +++ python/trunk/Doc/distutils/builtdist.rst Sat Jan 3 21:55:06 2009 @@ -268,13 +268,13 @@ .. % \longprogramopt{spec-file} option; used in conjunction with .. % \longprogramopt{spec-only}, this gives you an opportunity to customize .. % the \file{.spec} file manually: -.. % +.. % .. % \ begin{verbatim} .. % > python setup.py bdist_rpm --spec-only .. % # ...edit dist/FooBar-1.0.spec .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec .. % \ end{verbatim} -.. % +.. % .. % (Although a better way to do this is probably to override the standard .. % \command{bdist\_rpm} command with one that writes whatever else you want .. % to the \file{.spec} file.) @@ -334,31 +334,31 @@ Cross-compiling on Windows ========================== -Starting with Python 2.6, distutils is capable of cross-compiling between -Windows platforms. In practice, this means that with the correct tools +Starting with Python 2.6, distutils is capable of cross-compiling between +Windows platforms. In practice, this means that with the correct tools installed, you can use a 32bit version of Windows to create 64bit extensions and vice-versa. -To build for an alternate platform, specify the :option:`--plat-name` option -to the build command. Valid values are currently 'win32', 'win-amd64' and +To build for an alternate platform, specify the :option:`--plat-name` option +to the build command. Valid values are currently 'win32', 'win-amd64' and 'win-ia64'. For example, on a 32bit version of Windows, you could execute:: python setup.py build --plat-name=win-amd64 -to build a 64bit version of your extension. The Windows Installers also +to build a 64bit version of your extension. The Windows Installers also support this option, so the command:: python setup.py build --plat-name=win-amd64 bdist_wininst would create a 64bit installation executable on your 32bit version of Windows. -To cross-compile, you must download the Python source code and cross-compile +To cross-compile, you must download the Python source code and cross-compile Python itself for the platform you are targetting - it is not possible from a binary installtion of Python (as the .lib etc file for other platforms are -not included.) In practice, this means the user of a 32 bit operating -system will need to use Visual Studio 2008 to open the -:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the -"x64" configuration of the 'pythoncore' project before cross-compiling +not included.) In practice, this means the user of a 32 bit operating +system will need to use Visual Studio 2008 to open the +:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the +"x64" configuration of the 'pythoncore' project before cross-compiling extensions is possible. Note that by default, Visual Studio 2008 does not install 64bit compilers or Modified: python/trunk/Doc/distutils/configfile.rst ============================================================================== --- python/trunk/Doc/distutils/configfile.rst (original) +++ python/trunk/Doc/distutils/configfile.rst Sat Jan 3 21:55:06 2009 @@ -63,7 +63,7 @@ --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine - --swig-opts list of SWIG command line options + --swig-opts list of SWIG command line options [...] Note that an option spelled :option:`--foo-bar` on the command-line is spelled Modified: python/trunk/Doc/distutils/packageindex.rst ============================================================================== --- python/trunk/Doc/distutils/packageindex.rst (original) +++ python/trunk/Doc/distutils/packageindex.rst Sat Jan 3 21:55:06 2009 @@ -72,7 +72,7 @@ index-servers = pypi other - + [pypi] repository: username: @@ -91,4 +91,4 @@ python setup.py register -r other - + Modified: python/trunk/Doc/distutils/setupscript.rst ============================================================================== --- python/trunk/Doc/distutils/setupscript.rst (original) +++ python/trunk/Doc/distutils/setupscript.rst Sat Jan 3 21:55:06 2009 @@ -213,7 +213,7 @@ this:: setup(..., - ext_modules=[Extension('_foo', ['foo.i'], + ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], ) Modified: python/trunk/Doc/documenting/markup.rst ============================================================================== --- python/trunk/Doc/documenting/markup.rst (original) +++ python/trunk/Doc/documenting/markup.rst Sat Jan 3 21:55:06 2009 @@ -508,7 +508,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. .. describe:: var @@ -767,7 +767,7 @@ don't have to escape ``*`` or ``|`` characters. -.. XXX describe optional first parameter +.. XXX describe optional first parameter The following is an example taken from the Python Reference Manual:: Modified: python/trunk/Doc/extending/building.rst ============================================================================== --- python/trunk/Doc/extending/building.rst (original) +++ python/trunk/Doc/extending/building.rst Sat Jan 3 21:55:06 2009 @@ -39,7 +39,7 @@ With this :file:`setup.py`, and a file :file:`demo.c`, running :: - python setup.py build + python setup.py build will compile :file:`demo.c`, and produce an extension module named ``demo`` in the :file:`build` directory. Depending on the system, the module file will end Modified: python/trunk/Doc/extending/extending.rst ============================================================================== --- python/trunk/Doc/extending/extending.rst (original) +++ python/trunk/Doc/extending/extending.rst Sat Jan 3 21:55:06 2009 @@ -471,7 +471,7 @@ :cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of -arguments. To call the Python function with no arguments, pass in NULL, or +arguments. To call the Python function with no arguments, pass in NULL, or an empty tuple; to call it with one argument, pass a singleton tuple. :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example:: @@ -510,7 +510,7 @@ if (result == NULL) return NULL; /* Pass error back */ ...use result... - Py_DECREF(result); + Py_DECREF(result); Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases @@ -535,7 +535,7 @@ the error check! Also note that strictly speaking this code is not complete: :cfunc:`Py_BuildValue` may run out of memory, and this should be checked. -You may also call a function with keyword arguments by using +You may also call a function with keyword arguments by using :cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. :: @@ -671,7 +671,7 @@ static PyObject * keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) - { + { int voltage; char *state = "a stiff"; char *action = "voom"; @@ -679,11 +679,11 @@ static char *kwlist[] = {"voltage", "state", "action", "type", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, &voltage, &state, &action, &type)) - return NULL; + return NULL; - printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", + printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", action, voltage); printf("-- Lovely plumage, the %s -- It's %s!\n", type, state); Modified: python/trunk/Doc/extending/newtypes.rst ============================================================================== --- python/trunk/Doc/extending/newtypes.rst (original) +++ python/trunk/Doc/extending/newtypes.rst Sat Jan 3 21:55:06 2009 @@ -1234,7 +1234,7 @@ of *NULL* is required. .. XXX Descriptors need to be explained in more detail somewhere, but not here. - + Descriptor objects have two handler functions which correspond to the \member{tp_getattro} and \member{tp_setattro} handlers. The \method{__get__()} handler is a function which is passed the descriptor, Modified: python/trunk/Doc/extending/windows.rst ============================================================================== --- python/trunk/Doc/extending/windows.rst (original) +++ python/trunk/Doc/extending/windows.rst Sat Jan 3 21:55:06 2009 @@ -102,7 +102,7 @@ and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its first argument (use the minimal :file:`example.c` in this directory as a guide). By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. - The output file should be called :file:`spam.pyd` (in Release mode) or + The output file should be called :file:`spam.pyd` (in Release mode) or :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. Modified: python/trunk/Doc/glossary.rst ============================================================================== --- python/trunk/Doc/glossary.rst (original) +++ python/trunk/Doc/glossary.rst Sat Jan 3 21:55:06 2009 @@ -11,7 +11,7 @@ ``>>>`` The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter. - + ``...`` The default Python prompt of the interactive shell when entering code for an indented code block or within a pair of matching left and right @@ -50,11 +50,11 @@ A value associated with an object which is referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. - + BDFL Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator. - + bytecode Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in @@ -67,11 +67,11 @@ A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class. - + classic class Any class which does not inherit from :class:`object`. See :term:`new-style class`. Classic classes will be removed in Python 3.0. - + coercion The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, @@ -84,7 +84,7 @@ ``operator.add(3.0, 4.5)``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. - + complex number An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary @@ -96,7 +96,7 @@ :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them. - + context manager An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. @@ -138,7 +138,7 @@ class methods, static methods, and reference to super classes. For more information about descriptors' methods, see :ref:`descriptors`. - + dictionary An associative array, where arbitrary keys are mapped to values. The use of :class:`dict` closely resembles that for :class:`list`, but the keys can @@ -152,8 +152,8 @@ of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object. - - duck-typing + + duck-typing A pythonic programming style which determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it @@ -163,13 +163,13 @@ :func:`isinstance`. (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming. - + EAFP Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` - statements. The technique contrasts with the :term:`LBYL` style + statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C. expression @@ -195,14 +195,14 @@ which are not compatible with the current interpreter. For example, the expression ``11/4`` currently evaluates to ``2``. If the module in which it is executed had enabled *true division* by executing:: - + from __future__ import division - + the expression ``11/4`` would evaluate to ``2.75``. By importing the :mod:`__future__` module and evaluating its variables, you can see when a new feature was first added to the language and when it will become the default:: - + >>> import __future__ >>> __future__.division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) @@ -211,7 +211,7 @@ The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. - + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -221,21 +221,21 @@ stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the :meth:`next` method of the returned iterator. - + .. index:: single: generator expression - + generator expression An expression that returns a generator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: - + >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285 - + GIL See :term:`global interpreter lock`. - + global interpreter lock The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. @@ -261,21 +261,21 @@ containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`. - + IDLE An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application. - + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary. - + integer division Mathematical division discarding any remainder. For example, the expression ``11/4`` currently evaluates to ``2`` in contrast to the @@ -287,7 +287,7 @@ divided by a float will result in a float value, possibly with a decimal fraction. Integer division can be forced by using the ``//`` operator instead of the ``/`` operator. See also :term:`__future__`. - + interactive Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately @@ -295,7 +295,7 @@ arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). - + interpreted Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the @@ -304,7 +304,7 @@ Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`. - + iterable A container object capable of returning its members one at a time. Examples of iterables include all sequence types (such as @@ -320,7 +320,7 @@ statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`. - + iterator An object representing a stream of data. Repeated calls to the iterator's :meth:`next` method return successive items in the stream. When no more @@ -335,7 +335,7 @@ :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container. - + More information can be found in :ref:`typeiter`. keyword argument @@ -359,7 +359,7 @@ A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1). - + list comprehension A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ["0x%02x" % x for x in @@ -367,11 +367,11 @@ even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed. - + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. - + metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for @@ -390,7 +390,7 @@ of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`. - + mutable Mutable objects can change their value but keep their :func:`id`. See also :term:`immutable`. @@ -407,7 +407,7 @@ :func:`collections.namedtuple`. The latter approach automatically provides extra features such as a self-documenting representation like ``Employee(name='jones', title='programmer')``. - + namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and builtin namespaces as well @@ -419,7 +419,7 @@ :func:`random.seed` or :func:`itertools.izip` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively. - + nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to @@ -427,7 +427,7 @@ reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. - + new-style class Any class which inherits from :class:`object`. This includes all built-in types like :class:`list` and :class:`dict`. Only new-style classes can @@ -440,7 +440,7 @@ Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`. - + positional argument The arguments assigned to local names inside a function or method, determined by the order in which they were given in the call. ``*`` is @@ -448,7 +448,7 @@ definition), or pass several arguments as a list to a function. See :term:`argument`. - Python 3000 + Python 3000 Nickname for the next major Python version, 3.0 (coined long ago when the release of version 3 was something in the distant future.) This is also abbreviated "Py3k". @@ -460,7 +460,7 @@ to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:: - + for i in range(len(food)): print food[i] @@ -483,7 +483,7 @@ dictionaries. Though popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. - + sequence An :term:`iterable` which supports efficient element access using integer indices via the :meth:`__getitem__` special method and defines a @@ -529,7 +529,7 @@ virtual machine A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler. - + Zen of Python Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing Modified: python/trunk/Doc/howto/curses.rst ============================================================================== --- python/trunk/Doc/howto/curses.rst (original) +++ python/trunk/Doc/howto/curses.rst Sat Jan 3 21:55:06 2009 @@ -399,8 +399,8 @@ curses.echo() # Enable echoing of characters - # Get a 15-character string, with the cursor on the top line - s = stdscr.getstr(0,0, 15) + # Get a 15-character string, with the cursor on the top line + s = stdscr.getstr(0,0, 15) The Python :mod:`curses.textpad` module supplies something better. With it, you can turn a window into a text box that supports an Emacs-like set of Modified: python/trunk/Doc/howto/doanddont.rst ============================================================================== --- python/trunk/Doc/howto/doanddont.rst (original) +++ python/trunk/Doc/howto/doanddont.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ ************************************ - Idioms and Anti-Idioms in Python + Idioms and Anti-Idioms in Python ************************************ :Author: Moshe Zadka @@ -127,7 +127,7 @@ # bar.py from foo import a if something(): - a = 2 # danger: foo.a != a + a = 2 # danger: foo.a != a Good example:: @@ -303,6 +303,6 @@ This version is bulletproof:: - value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + calculate_number(10, 20)*forbulate(500, 360)) Modified: python/trunk/Doc/howto/functional.rst ============================================================================== --- python/trunk/Doc/howto/functional.rst (original) +++ python/trunk/Doc/howto/functional.rst Sat Jan 3 21:55:06 2009 @@ -145,7 +145,7 @@ functions are also easier to read and to check for errors. -Ease of debugging and testing +Ease of debugging and testing ----------------------------- Testing and debugging a functional-style program is easier. @@ -213,7 +213,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> Python expects iterable objects in several different contexts, the most important being the ``for`` statement. In the statement ``for X in Y``, Y must @@ -362,7 +362,7 @@ comprehensions are surrounded by square brackets ("[]"). Generator expressions have the form:: - ( expression for expr in sequence1 + ( expression for expr in sequence1 if condition1 for expr2 in sequence2 if condition2 @@ -404,7 +404,7 @@ if not (conditionN): continue # Skip this element - # Output the value of + # Output the value of # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` @@ -418,8 +418,8 @@ >>> seq1 = 'abc' >>> seq2 = (1,2,3) >>> [(x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), + [('a', 1), ('a', 2), ('a', 3), + ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)] To avoid introducing an ambiguity into Python's grammar, if ``expression`` is @@ -759,7 +759,7 @@ True >>> all([0,1,0]) False - >>> all([0,0,0]) + >>> all([0,0,0]) False >>> all([1,1,1]) True @@ -845,7 +845,7 @@ 4) Convert the lambda to a def statement, using that name. 5) Remove the comment. -I really like these rules, but you're free to disagree +I really like these rules, but you're free to disagree about whether this lambda-free style is better. @@ -970,7 +970,7 @@ ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream of tuples, and calls ``f()`` using these tuples as the arguments:: - itertools.starmap(os.path.join, + itertools.starmap(os.path.join, [('/usr', 'bin', 'java'), ('/bin', 'python'), ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) => @@ -1039,9 +1039,9 @@ :: - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), + city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), + ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), ... ] @@ -1056,7 +1056,7 @@ where iterator-1 => ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => + iterator-2 => ('Anchorage', 'AK'), ('Nome', 'AK') iterator-3 => ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') @@ -1150,7 +1150,7 @@ >>> double(add(5, 6)) 22 - + The ``unpack`` keyword is provided to work around the fact that Python functions are not always `fully curried `__. By default, it is expected that the ``inner`` function will return a single object @@ -1159,15 +1159,15 @@ will be expanded before being passed to ``outer``. Put simply, :: compose(f, g)(5, 6) - + is equivalent to:: f(g(5, 6)) - + while :: compose(f, g, unpack=True)(5, 6) - + is equivalent to:: f(*g(5, 6)) @@ -1178,20 +1178,20 @@ ``functional`` and ``functools``). :: from functional import compose, partial - + multi_compose = partial(reduce, compose) - - + + We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of ``"".join(...)`` that converts its arguments to string:: from functional import compose, partial - + join = compose("".join, partial(map, str)) ``flip(func)`` - + ``flip()`` wraps the callable in ``func`` and causes it to receive its non-keyword arguments in reverse order. :: @@ -1206,7 +1206,7 @@ (7, 6, 5) ``foldl(func, start, iterable)`` - + ``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable. The function is applied to the starting value and the first element of the list, then the result of that and the second element of the @@ -1220,7 +1220,7 @@ f(f(f(0, 1), 2), 3) - + ``foldl()`` is roughly equivalent to the following recursive function:: def foldl(func, start, seq): @@ -1298,7 +1298,7 @@ Text Processing". Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see +for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__, Modified: python/trunk/Doc/howto/regex.rst ============================================================================== --- python/trunk/Doc/howto/regex.rst (original) +++ python/trunk/Doc/howto/regex.rst Sat Jan 3 21:55:06 2009 @@ -1,7 +1,7 @@ .. _regex-howto: **************************** - Regular Expression HOWTO + Regular Expression HOWTO **************************** :Author: A.M. Kuchling @@ -611,7 +611,7 @@ is to read? :: charref = re.compile(r""" - &[#] # Start of a numeric entity reference + &[#] # Start of a numeric entity reference ( 0[0-7]+ # Octal form | [0-9]+ # Decimal form @@ -732,7 +732,7 @@ >>> p = re.compile('\bclass\b') >>> print p.search('no class at all') None - >>> print p.search('\b' + 'class' + '\b') + >>> print p.search('\b' + 'class' + '\b') Second, inside a character class, where there's no use for this assertion, @@ -1236,9 +1236,9 @@ only report a successful match which will start at 0; if the match wouldn't start at zero, :func:`match` will *not* report it. :: - >>> print re.match('super', 'superstition').span() + >>> print re.match('super', 'superstition').span() (0, 5) - >>> print re.match('super', 'insuperable') + >>> print re.match('super', 'insuperable') None On the other hand, :func:`search` will scan forward through the string, Modified: python/trunk/Doc/howto/sockets.rst ============================================================================== --- python/trunk/Doc/howto/sockets.rst (original) +++ python/trunk/Doc/howto/sockets.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -63,7 +63,7 @@ #create an INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -78,7 +78,7 @@ #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -185,7 +185,7 @@ length message:: class mysocket: - '''demonstration class only + '''demonstration class only - coded for clarity, not efficiency ''' @@ -343,9 +343,9 @@ ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might Modified: python/trunk/Doc/howto/unicode.rst ============================================================================== --- python/trunk/Doc/howto/unicode.rst (original) +++ python/trunk/Doc/howto/unicode.rst Sat Jan 3 21:55:06 2009 @@ -122,8 +122,8 @@ representation, the string "Python" would look like this:: P y t h o n - 0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 + 0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 This representation is straightforward but using it presents a number of problems. @@ -181,7 +181,7 @@ between 128 and 255. 3. Code points >0x7ff are turned into three- or four-byte sequences, where each byte of the sequence is between 128 and 255. - + UTF-8 has several convenient properties: 1. It can handle any Unicode code point. @@ -252,7 +252,7 @@ >>> unicode('abcdef' + chr(255)) Traceback (most recent call last): File "", line 1, in ? - UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 6: + UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 6: ordinal not in range(128) The ``errors`` argument specifies the response when the input string can't be @@ -264,7 +264,7 @@ >>> unicode('\x80abc', errors='strict') Traceback (most recent call last): File "", line 1, in ? - UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: + UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) >>> unicode('\x80abc', errors='replace') u'\ufffdabc' @@ -350,7 +350,7 @@ >>> u2 = utf8_version.decode('utf-8') # Decode using UTF-8 >>> u == u2 # The two strings match True - + The low-level routines for registering and accessing the available encodings are found in the :mod:`codecs` module. However, the encoding and decoding functions returned by this module are usually more low-level than is comfortable, so I'm @@ -362,8 +362,8 @@ The most commonly used part of the :mod:`codecs` module is the :func:`codecs.open` function which will be discussed in the section on input and output. - - + + Unicode Literals in Python Source Code -------------------------------------- @@ -381,10 +381,10 @@ >>> s = u"a\xac\u1234\u20ac\U00008000" ^^^^ two-digit hex escape - ^^^^^^ four-digit Unicode escape + ^^^^^^ four-digit Unicode escape ^^^^^^^^^^ eight-digit Unicode escape >>> for c in s: print ord(c), - ... + ... 97 172 4660 8364 32768 Using escape sequences for code points greater than 127 is fine in small doses, @@ -404,10 +404,10 @@ #!/usr/bin/env python # -*- coding: latin-1 -*- - + u = u'abcd?' print ord(u[-1]) - + The syntax is inspired by Emacs's notation for specifying variables local to a file. Emacs supports many different variables, but Python only supports 'coding'. The ``-*-`` symbols indicate to Emacs that the comment is special; @@ -427,10 +427,10 @@ When you run it with Python 2.4, it will output the following warning:: amk:~$ python p263.py - sys:1: DeprecationWarning: Non-ASCII character '\xe9' - in file p263.py on line 2, but no encoding declared; + sys:1: DeprecationWarning: Non-ASCII character '\xe9' + in file p263.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details - + Unicode Properties ------------------ @@ -446,13 +446,13 @@ prints the numeric value of one particular character:: import unicodedata - + u = unichr(233) + unichr(0x0bf2) + unichr(3972) + unichr(6000) + unichr(13231) - + for i, c in enumerate(u): print i, '%04x' % ord(c), unicodedata.category(c), print unicodedata.name(c) - + # Get numeric value of second character print unicodedata.numeric(u[1]) @@ -615,7 +615,7 @@ the Unicode versions. - + Tips for Writing Unicode-aware Programs --------------------------------------- @@ -661,7 +661,7 @@ unicode_name = filename.decode(encoding) f = open(unicode_name, 'r') # ... return contents of file ... - + However, if an attacker could specify the ``'base64'`` encoding, they could pass ``'L2V0Yy9wYXNzd2Q='``, which is the base-64 encoded form of the string ``'/etc/passwd'``, to read a system file. The above code looks for ``'/'`` @@ -697,7 +697,7 @@ .. comment Describe obscure -U switch somewhere? .. comment Describe use of codecs.StreamRecoder and StreamReaderWriter -.. comment +.. comment Original outline: - [ ] Unicode introduction Modified: python/trunk/Doc/howto/urllib2.rst ============================================================================== --- python/trunk/Doc/howto/urllib2.rst (original) +++ python/trunk/Doc/howto/urllib2.rst Sat Jan 3 21:55:06 2009 @@ -10,7 +10,7 @@ HOWTO, available at `urllib2 - Le Manuel manquant `_. - + Introduction ============ @@ -19,9 +19,9 @@ You may also find useful the following article on fetching web resources with Python : - + * `Basic Authentication `_ - + A tutorial on *Basic Authentication*, with examples in Python. **urllib2** is a `Python `_ module for fetching URLs @@ -98,7 +98,7 @@ *not* from ``urllib2``. :: import urllib - import urllib2 + import urllib2 url = 'http://www.someserver.com/cgi-bin/register.cgi' values = {'name' : 'Michael Foord', @@ -161,15 +161,15 @@ Explorer [#]_. :: import urllib - import urllib2 - + import urllib2 + url = 'http://www.someserver.com/cgi-bin/register.cgi' - user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' + user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - + data = urllib.urlencode(values) req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) @@ -183,7 +183,7 @@ =================== *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as +with Python APIs, builtin exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised). @@ -309,18 +309,18 @@ geturl, and info, methods. :: >>> req = urllib2.Request('http://www.python.org/fish.html') - >>> try: + >>> try: >>> urllib2.urlopen(req) >>> except URLError, e: >>> print e.code >>> print e.read() - >>> + >>> 404 - - - Error 404: File Not Found + Error 404: File Not Found ...... etc... Wrapping it Up @@ -372,7 +372,7 @@ print 'Error code: ', e.code else: # everything is fine - + info and geturl =============== @@ -443,7 +443,7 @@ and a 'realm'. The header looks like : ``Www-authenticate: SCHEME realm="REALM"``. -e.g. :: +e.g. :: Www-authenticate: Basic realm="cPanel Users" @@ -467,24 +467,24 @@ than the URL you pass to .add_password() will also match. :: # create a password manager - password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() + password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) - handler = urllib2.HTTPBasicAuthHandler(password_mgr) + handler = urllib2.HTTPBasicAuthHandler(password_mgr) # create "opener" (OpenerDirector instance) - opener = urllib2.build_opener(handler) + opener = urllib2.build_opener(handler) # use the opener to fetch a URL - opener.open(a_url) + opener.open(a_url) # Install the opener. # Now all calls to urllib2.urlopen use our opener. - urllib2.install_opener(opener) + urllib2.install_opener(opener) .. note:: @@ -540,7 +540,7 @@ # timeout in seconds timeout = 10 - socket.setdefaulttimeout(timeout) + socket.setdefaulttimeout(timeout) # this call to urllib2.urlopen now uses the default timeout # we have set in the socket module @@ -557,7 +557,7 @@ This document was reviewed and revised by John Lee. .. [#] For an introduction to the CGI protocol see - `Writing Web Applications in Python `_. + `Writing Web Applications in Python `_. .. [#] Like Google for example. The *proper* way to use google from a program is to use `PyGoogle `_ of course. See `Voidspace Google `_ @@ -574,6 +574,6 @@ is set to use the proxy, which urllib2 picks up on. In order to test scripts with a localhost server, I have to prevent urllib2 from using the proxy. -.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe +.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_. - + Modified: python/trunk/Doc/howto/webservers.rst ============================================================================== --- python/trunk/Doc/howto/webservers.rst (original) +++ python/trunk/Doc/howto/webservers.rst Sat Jan 3 21:55:06 2009 @@ -88,7 +88,7 @@ `_ with some additional information about CGI in Python. - + Simple script for testing CGI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -386,7 +386,7 @@ You might be interested in some WSGI-supporting modules already contained in the standard library, namely: - + * :mod:`wsgiref` -- some tiny utilities and servers for WSGI @@ -499,7 +499,7 @@ time in looking through the most popular ones. Some frameworks have their own template engine or have a recommentation for one. It's wise to use these. - + Popular template engines include: * Mako @@ -687,7 +687,7 @@ found in the Python wiki. .. seealso:: - + The Python wiki contains an extensive list of `web frameworks `_. Modified: python/trunk/Doc/install/index.rst ============================================================================== --- python/trunk/Doc/install/index.rst (original) +++ python/trunk/Doc/install/index.rst Sat Jan 3 21:55:06 2009 @@ -3,7 +3,7 @@ .. _install-index: ***************************** - Installing Python Modules + Installing Python Modules ***************************** :Author: Greg Ward @@ -18,7 +18,7 @@ Thus, I have to be sure to explain the basics at some point: sys.path and PYTHONPATH at least. Should probably give pointers to other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc. - + Finally, it might be useful to include all the material from my "Care and Feeding of a Python Installation" talk in here somewhere. Yow! @@ -268,7 +268,7 @@ statements shown below, and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`:: - Python 2.4 (#26, Aug 7 2004, 17:19:02) + Python 2.4 (#26, Aug 7 2004, 17:19:02) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix @@ -590,8 +590,8 @@ Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path - ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', - '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', + ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', + '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>> Modified: python/trunk/Doc/library/abc.rst ============================================================================== --- python/trunk/Doc/library/abc.rst (original) +++ python/trunk/Doc/library/abc.rst Sat Jan 3 21:55:06 2009 @@ -130,7 +130,7 @@ A decorator indicating abstract methods. Using this decorator requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. @@ -166,7 +166,7 @@ A subclass of the built-in :func:`property`, indicating an abstract property. Using this function requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract properties can be called using any of the normal Modified: python/trunk/Doc/library/aifc.rst ============================================================================== --- python/trunk/Doc/library/aifc.rst (original) +++ python/trunk/Doc/library/aifc.rst Sat Jan 3 21:55:06 2009 @@ -17,7 +17,7 @@ ability to compress the audio data. .. warning:: - + Some operations may only work under IRIX; these will raise :exc:`ImportError` when attempting to import the :mod:`cl` module, which is only available on IRIX. Modified: python/trunk/Doc/library/al.rst ============================================================================== --- python/trunk/Doc/library/al.rst (original) +++ python/trunk/Doc/library/al.rst Sat Jan 3 21:55:06 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Audio functions on the SGI. :deprecated: - + .. deprecated:: 2.6 The :mod:`al` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/ast.rst ============================================================================== --- python/trunk/Doc/library/ast.rst (original) +++ python/trunk/Doc/library/ast.rst Sat Jan 3 21:55:06 2009 @@ -127,7 +127,7 @@ Parse an expression into an AST node. Equivalent to ``compile(expr, filename, mode, ast.PyCF_ONLY_AST)``. - + .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python @@ -205,7 +205,7 @@ .. method:: generic_visit(node) This visitor calls :meth:`visit` on all children of the node. - + Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself. Modified: python/trunk/Doc/library/audioop.rst ============================================================================== --- python/trunk/Doc/library/audioop.rst (original) +++ python/trunk/Doc/library/audioop.rst Sat Jan 3 21:55:06 2009 @@ -265,7 +265,7 @@ in_test = inputdata[pos*2:] ipos, factor = audioop.findfit(in_test, out_test) # Optional (for better cancellation): - # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], + # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) Modified: python/trunk/Doc/library/bastion.rst ============================================================================== --- python/trunk/Doc/library/bastion.rst (original) +++ python/trunk/Doc/library/bastion.rst Sat Jan 3 21:55:06 2009 @@ -5,10 +5,10 @@ .. module:: Bastion :synopsis: Providing restricted access to objects. :deprecated: - + .. deprecated:: 2.6 The :mod:`Bastion` module has been removed in Python 3.0. - + .. moduleauthor:: Barry Warsaw Modified: python/trunk/Doc/library/bdb.rst ============================================================================== --- python/trunk/Doc/library/bdb.rst (original) +++ python/trunk/Doc/library/bdb.rst Sat Jan 3 21:55:06 2009 @@ -325,7 +325,7 @@ Check whether we should break here, depending on the way the breakpoint *b* was set. - + If it was set via line number, it checks if ``b.line`` is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if @@ -335,7 +335,7 @@ Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. - + Called only if we know there is a breakpoint at this location. Returns the breakpoint that was triggered and a flag that indicates if it is ok to delete a temporary breakpoint. Modified: python/trunk/Doc/library/bsddb.rst ============================================================================== --- python/trunk/Doc/library/bsddb.rst (original) +++ python/trunk/Doc/library/bsddb.rst Sat Jan 3 21:55:06 2009 @@ -172,7 +172,7 @@ >>> import bsddb >>> db = bsddb.btopen('/tmp/spam.db', 'c') >>> for i in range(10): db['%d'%i] = '%d'% (i*i) - ... + ... >>> db['3'] '9' >>> db.keys() @@ -185,7 +185,7 @@ ('9', '81') >>> db.set_location('2') ('2', '4') - >>> db.previous() + >>> db.previous() ('1', '1') >>> for k, v in db.iteritems(): ... print k, v Modified: python/trunk/Doc/library/bz2.rst ============================================================================== --- python/trunk/Doc/library/bz2.rst (original) +++ python/trunk/Doc/library/bz2.rst Sat Jan 3 21:55:06 2009 @@ -93,7 +93,7 @@ performance optimizations previously implemented in the :mod:`xreadlines` module. - .. deprecated:: 2.3 + .. deprecated:: 2.3 This exists only for compatibility with the method by this name on :class:`file` objects, which is deprecated. Use ``for line in file`` instead. Modified: python/trunk/Doc/library/cd.rst ============================================================================== --- python/trunk/Doc/library/cd.rst (original) +++ python/trunk/Doc/library/cd.rst Sat Jan 3 21:55:06 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: Interface to the CD-ROM on Silicon Graphics systems. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`cd` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/cmath.rst ============================================================================== --- python/trunk/Doc/library/cmath.rst (original) +++ python/trunk/Doc/library/cmath.rst Sat Jan 3 21:55:06 2009 @@ -70,9 +70,9 @@ .. function:: polar(x) - Convert a :class:`complex` from rectangular coordinates to polar + Convert a :class:`complex` from rectangular coordinates to polar coordinates. The function returns a tuple with the two elements - *r* and *phi*. *r* is the distance from 0 and *phi* the phase + *r* and *phi*. *r* is the distance from 0 and *phi* the phase angle. .. versionadded:: 2.6 Modified: python/trunk/Doc/library/codeop.rst ============================================================================== --- python/trunk/Doc/library/codeop.rst (original) +++ python/trunk/Doc/library/codeop.rst Sat Jan 3 21:55:06 2009 @@ -43,7 +43,7 @@ other value will cause :exc:`ValueError` to be raised. .. warning:: - + It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Sat Jan 3 21:55:06 2009 @@ -55,34 +55,34 @@ :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` :class:`Sized` ``__len__`` :class:`Callable` ``__call__`` - + :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. :class:`Iterable`, and ``__len__`` ``index``, and ``count`` - :class:`Container` - + :class:`Container` + :class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` - + :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:`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:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, :class:`Set` ``__iter__`` @@ -549,8 +549,8 @@ if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result - - def __getnewargs__(self): + + def __getnewargs__(self): return tuple(self) x = property(itemgetter(0)) Modified: python/trunk/Doc/library/compiler.rst ============================================================================== --- python/trunk/Doc/library/compiler.rst (original) +++ python/trunk/Doc/library/compiler.rst Sat Jan 3 21:55:06 2009 @@ -559,24 +559,24 @@ >>> import compiler >>> mod = compiler.parseFile("/tmp/doublelib.py") >>> mod - Module('This is an example module.\n\nThis is the docstring.\n', + Module('This is an example module.\n\nThis is the docstring.\n', Stmt([Function(None, 'double', ['x'], [], 0, - 'Return twice the argument', + 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))]))])) >>> from compiler.ast import * - >>> Module('This is an example module.\n\nThis is the docstring.\n', + >>> Module('This is an example module.\n\nThis is the docstring.\n', ... Stmt([Function(None, 'double', ['x'], [], 0, - ... 'Return twice the argument', + ... 'Return twice the argument', ... Stmt([Return(Mul((Name('x'), Const(2))))]))])) - Module('This is an example module.\n\nThis is the docstring.\n', + Module('This is an example module.\n\nThis is the docstring.\n', Stmt([Function(None, 'double', ['x'], [], 0, - 'Return twice the argument', + 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))]))])) >>> mod.doc 'This is an example module.\n\nThis is the docstring.\n' >>> for node in mod.node.nodes: ... print node - ... + ... Function(None, 'double', ['x'], [], 0, 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))])) >>> func = mod.node.nodes[0] Modified: python/trunk/Doc/library/crypt.rst ============================================================================== --- python/trunk/Doc/library/crypt.rst (original) +++ python/trunk/Doc/library/crypt.rst Sat Jan 3 21:55:06 2009 @@ -51,7 +51,7 @@ username = raw_input('Python login:') cryptedpasswd = pwd.getpwnam(username)[1] if cryptedpasswd: - if cryptedpasswd == 'x' or cryptedpasswd == '*': + if cryptedpasswd == 'x' or cryptedpasswd == '*': raise "Sorry, currently no support for shadow passwords" cleartext = getpass.getpass() return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd Modified: python/trunk/Doc/library/csv.rst ============================================================================== --- python/trunk/Doc/library/csv.rst (original) +++ python/trunk/Doc/library/csv.rst Sat Jan 3 21:55:06 2009 @@ -76,7 +76,7 @@ performed. A short usage example:: - + >>> import csv >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|') >>> for row in spamReader: Modified: python/trunk/Doc/library/datetime.rst ============================================================================== --- python/trunk/Doc/library/datetime.rst (original) +++ python/trunk/Doc/library/datetime.rst Sat Jan 3 21:55:06 2009 @@ -266,10 +266,10 @@ considered to be true if and only if it isn't equal to ``timedelta(0)``. Example usage: - + >>> from datetime import timedelta >>> year = timedelta(days=365) - >>> another_year = timedelta(weeks=40, days=84, hours=23, + >>> another_year = timedelta(weeks=40, days=84, hours=23, ... minutes=50, seconds=600) # adds up to 365 days >>> year == another_year True @@ -517,10 +517,10 @@ True >>> my_birthday = date(today.year, 6, 24) >>> if my_birthday < today: - ... my_birthday = my_birthday.replace(year=today.year + 1) + ... my_birthday = my_birthday.replace(year=today.year + 1) >>> my_birthday datetime.date(2008, 6, 24) - >>> time_to_birthday = abs(my_birthday - today) + >>> time_to_birthday = abs(my_birthday - today) >>> time_to_birthday.days 202 @@ -1015,7 +1015,7 @@ >>> tt = dt.timetuple() >>> for it in tt: # doctest: +SKIP ... print it - ... + ... 2006 # year 11 # month 21 # day @@ -1044,23 +1044,23 @@ ... def __init__(self): # DST starts last Sunday in March ... d = datetime(dt.year, 4, 1) # ends last Sunday in October ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) - ... def dst(self, dt): + ... def dst(self, dt): ... if self.dston <= dt.replace(tzinfo=None) < self.dstoff: ... return timedelta(hours=1) ... else: ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +1" - ... + ... >>> class GMT2(tzinfo): ... def __init__(self): - ... d = datetime(dt.year, 4, 1) + ... d = datetime(dt.year, 4, 1) ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) @@ -1071,7 +1071,7 @@ ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +2" - ... + ... >>> gmt1 = GMT1() >>> # Daylight Saving Time >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1) @@ -1092,7 +1092,7 @@ datetime.datetime(2006, 6, 14, 13, 0, tzinfo=) >>> dt2.utctimetuple() == dt3.utctimetuple() True - + .. _datetime-time: @@ -1240,12 +1240,12 @@ return ``None`` or a string object. Example: - + >>> from datetime import time, tzinfo >>> class GMT1(tzinfo): ... def utcoffset(self, dt): - ... return timedelta(hours=1) - ... def dst(self, dt): + ... return timedelta(hours=1) + ... def dst(self, dt): ... return timedelta(0) ... def tzname(self,dt): ... return "Europe/Prague" @@ -1476,7 +1476,7 @@ :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any other fixed-offset :class:`tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)). - + .. _strftime-behavior: @@ -1521,7 +1521,7 @@ The full set of format codes supported varies across platforms, because Python calls the platform C library's :func:`strftime` function, and platform -variations are common. +variations are common. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C Modified: python/trunk/Doc/library/decimal.rst ============================================================================== --- python/trunk/Doc/library/decimal.rst (original) +++ python/trunk/Doc/library/decimal.rst Sat Jan 3 21:55:06 2009 @@ -328,7 +328,7 @@ infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity - numeric-string ::= [sign] numeric-value | [sign] nan + numeric-string ::= [sign] numeric-value | [sign] nan If *value* is a :class:`tuple`, it should have three components, a sign (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of @@ -970,7 +970,7 @@ * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer), * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or * :const:`ROUND_UP` (away from zero). - * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero + * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise towards zero) The *traps* and *flags* fields list any signals to be set. Generally, new @@ -1313,7 +1313,7 @@ that would be obtained by computing ``(x**y) % modulo`` with unbounded precision, but is computed more efficiently. It is always exact. - .. versionchanged:: 2.6 + .. versionchanged:: 2.6 ``y`` may now be nonintegral in ``x**y``. Stricter requirements for the three-argument version. @@ -1455,7 +1455,7 @@ sqrt(-x) and x > 0 0 ** 0 x ** (non-integer) - x ** Infinity + x ** Infinity .. class:: Overflow @@ -1558,7 +1558,7 @@ Decimal('9.51111111') >>> u + (v + w) Decimal('9.51111111') - >>> + >>> >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003') >>> (u*v) + (u*w) Decimal('0.0060000') @@ -1697,7 +1697,7 @@ """ q = Decimal(10) ** -places # 2 places --> '0.01' - sign, digits, exp = value.quantize(q).as_tuple() + sign, digits, exp = value.quantize(q).as_tuple() result = [] digits = map(str, digits) build, next = result.append, digits.pop @@ -1754,12 +1754,12 @@ getcontext().prec += 2 i, lasts, s, fact, num = 0, 0, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 1 fact *= i - num *= x - s += num / fact - getcontext().prec -= 2 + num *= x + s += num / fact + getcontext().prec -= 2 return +s def cos(x): @@ -1776,13 +1776,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s def sin(x): @@ -1799,13 +1799,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s @@ -1839,7 +1839,7 @@ >>> Decimal('3.214').quantize(TWOPLACES) Decimal('3.21') - >>> # Validate that a number does not exceed two places + >>> # Validate that a number does not exceed two places >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact])) Decimal('3.21') Modified: python/trunk/Doc/library/difflib.rst ============================================================================== --- python/trunk/Doc/library/difflib.rst (original) +++ python/trunk/Doc/library/difflib.rst Sat Jan 3 21:55:06 2009 @@ -428,7 +428,7 @@ .. XXX Explain why a dummy is used! - .. versionchanged:: 2.5 + .. versionchanged:: 2.5 The guarantee that adjacent triples always describe non-adjacent blocks was implemented. Modified: python/trunk/Doc/library/dircache.rst ============================================================================== --- python/trunk/Doc/library/dircache.rst (original) +++ python/trunk/Doc/library/dircache.rst Sat Jan 3 21:55:06 2009 @@ -5,11 +5,11 @@ .. module:: dircache :synopsis: Return directory listing, with cache mechanism. :deprecated: - + .. deprecated:: 2.6 The :mod:`dircache` module has been removed in Python 3.0. - - + + .. sectionauthor:: Moshe Zadka Modified: python/trunk/Doc/library/dis.rst ============================================================================== --- python/trunk/Doc/library/dis.rst (original) +++ python/trunk/Doc/library/dis.rst Sat Jan 3 21:55:06 2009 @@ -79,8 +79,8 @@ Detect all offsets in the code object *code* which are jump targets, and return a list of these offsets. - - + + .. data:: opname Sequence of operation names, indexable using the bytecode. @@ -770,7 +770,7 @@ opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, - the function object to call is on the stack. Pops all function arguments, and + the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value. Modified: python/trunk/Doc/library/dl.rst ============================================================================== --- python/trunk/Doc/library/dl.rst (original) +++ python/trunk/Doc/library/dl.rst Sat Jan 3 21:55:06 2009 @@ -6,11 +6,11 @@ :platform: Unix :synopsis: Call C functions in shared objects. :deprecated: - + .. deprecated:: 2.6 The :mod:`dl` module has been removed in Python 3.0. Use the :mod:`ctypes` module instead. - + .. sectionauthor:: Moshe Zadka The :mod:`dl` module defines an interface to the :cfunc:`dlopen` function, which @@ -91,9 +91,9 @@ Return the pointer for the function named *name*, as a number, if it exists in the referenced shared object, otherwise ``None``. This is useful in code like:: - >>> if a.sym('time'): + >>> if a.sym('time'): ... a.call('time') - ... else: + ... else: ... time.time() (Note that this function will return a non-zero number, as zero is the *NULL* Modified: python/trunk/Doc/library/email.mime.rst ============================================================================== --- python/trunk/Doc/library/email.mime.rst (original) +++ python/trunk/Doc/library/email.mime.rst Sat Jan 3 21:55:06 2009 @@ -2,7 +2,7 @@ ---------------------------------------------------------- .. module:: email.mime - :synopsis: Build MIME messages. + :synopsis: Build MIME messages. Ordinarily, you get a message object structure by passing a file or some text to Modified: python/trunk/Doc/library/fileinput.rst ============================================================================== --- python/trunk/Doc/library/fileinput.rst (original) +++ python/trunk/Doc/library/fileinput.rst Sat Jan 3 21:55:06 2009 @@ -151,7 +151,7 @@ when standard input is read. .. warning:: - + The current implementation does not work for MS-DOS 8+3 filesystems. Modified: python/trunk/Doc/library/fl.rst ============================================================================== --- python/trunk/Doc/library/fl.rst (original) +++ python/trunk/Doc/library/fl.rst Sat Jan 3 21:55:06 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: FORMS library for applications with graphical user interfaces. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`fl` module has been deprecated for removal in Python 3.0. @@ -484,8 +484,8 @@ :platform: IRIX :synopsis: Constants used with the fl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`FL` module has been deprecated for removal in Python 3.0. @@ -506,8 +506,8 @@ :platform: IRIX :synopsis: Functions for loading stored FORMS designs. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`flp` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/fm.rst ============================================================================== --- python/trunk/Doc/library/fm.rst (original) +++ python/trunk/Doc/library/fm.rst Sat Jan 3 21:55:06 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Font Manager interface for SGI workstations. :deprecated: - + .. deprecated:: 2.6 The :mod:`fm` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/fpformat.rst ============================================================================== --- python/trunk/Doc/library/fpformat.rst (original) +++ python/trunk/Doc/library/fpformat.rst Sat Jan 3 21:55:06 2009 @@ -5,10 +5,10 @@ .. module:: fpformat :synopsis: General floating point formatting functions. :deprecated: - + .. deprecated:: 2.6 The :mod:`fpformat` module has been removed in Python 3.0. - + .. sectionauthor:: Moshe Zadka Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Sat Jan 3 21:55:06 2009 @@ -888,7 +888,7 @@ .. versionchanged:: 2.5 Use *fget*'s docstring if no *doc* given. - .. versionchanged:: 2.6 + .. versionchanged:: 2.6 The ``getter``, ``setter``, and ``deleter`` attributes were added. @@ -1178,10 +1178,10 @@ 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. - + The second use case is to support cooperative multiple inheritence 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 + 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 @@ -1242,7 +1242,7 @@ >>> class X(object): ... a = 1 - ... + ... >>> X = type('X', (object,), dict(a=1)) .. versionadded:: 2.2 @@ -1397,7 +1397,7 @@ For example, the statement ``import spam`` results in bytecode resembling the following code:: - + spam = __import__('spam', globals(), locals(), [], -1) The statement ``import spam.ham`` results in this call:: Modified: python/trunk/Doc/library/gl.rst ============================================================================== --- python/trunk/Doc/library/gl.rst (original) +++ python/trunk/Doc/library/gl.rst Sat Jan 3 21:55:06 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: Functions from the Silicon Graphics Graphics Library. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`gl` module has been deprecated for removal in Python 3.0. @@ -166,8 +166,8 @@ :platform: IRIX :synopsis: Constants used with the gl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`DEVICE` module has been deprecated for removal in Python 3.0. @@ -184,8 +184,8 @@ :platform: IRIX :synopsis: Constants used with the gl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`GL` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/heapq.rst ============================================================================== --- python/trunk/Doc/library/heapq.rst (original) +++ python/trunk/Doc/library/heapq.rst Sat Jan 3 21:55:06 2009 @@ -102,7 +102,7 @@ H N - + The module also offers three general purpose functions based on heaps. Modified: python/trunk/Doc/library/htmllib.rst ============================================================================== --- python/trunk/Doc/library/htmllib.rst (original) +++ python/trunk/Doc/library/htmllib.rst Sat Jan 3 21:55:06 2009 @@ -4,7 +4,7 @@ .. module:: htmllib :synopsis: A parser for HTML documents. :deprecated: - + .. deprecated:: 2.6 The :mod:`htmllib` module has been removed in Python 3.0. Modified: python/trunk/Doc/library/idle.rst ============================================================================== --- python/trunk/Doc/library/idle.rst (original) +++ python/trunk/Doc/library/idle.rst Sat Jan 3 21:55:06 2009 @@ -230,7 +230,7 @@ Keywords orange - Strings + Strings green Comments Modified: python/trunk/Doc/library/imageop.rst ============================================================================== --- python/trunk/Doc/library/imageop.rst (original) +++ python/trunk/Doc/library/imageop.rst Sat Jan 3 21:55:06 2009 @@ -5,7 +5,7 @@ .. module:: imageop :synopsis: Manipulate raw image data. :deprecated: - + .. deprecated:: 2.6 The :mod:`imageop` module has been removed in Python 3.0. Modified: python/trunk/Doc/library/imgfile.rst ============================================================================== --- python/trunk/Doc/library/imgfile.rst (original) +++ python/trunk/Doc/library/imgfile.rst Sat Jan 3 21:55:06 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Support for SGI imglib files. :deprecated: - + .. deprecated:: 2.6 The :mod:`imgfile` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/io.rst ============================================================================== --- python/trunk/Doc/library/io.rst (original) +++ python/trunk/Doc/library/io.rst Sat Jan 3 21:55:06 2009 @@ -215,7 +215,7 @@ .. method:: close() Flush and close this stream. This method has no effect if the file is - already closed. Once the file is closed, any operation on the file + already closed. Once the file is closed, any operation on the file (e.g. reading or writing) will raise an :exc:`IOError`. The internal file descriptor isn't closed if *closefd* was False. @@ -629,7 +629,7 @@ .. attribute:: line_buffering Whether line buffering is enabled. - + .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Sat Jan 3 21:55:06 2009 @@ -76,7 +76,7 @@ .. function:: itertools.chain.from_iterable(iterable) - Alternate constructor for :func:`chain`. Gets chained inputs from a + Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Equivalent to:: @classmethod @@ -93,9 +93,9 @@ Return *r* length subsequences of elements from the input *iterable*. - Combinations are emitted in lexicographic sort order. So, if the + Combinations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the combination tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -314,7 +314,7 @@ for i, element in enumerate(iterable): if i == nexti: yield element - nexti = it.next() + nexti = it.next() If *start* is ``None``, then iteration starts at zero. If *step* is ``None``, then the step defaults to one. @@ -380,12 +380,12 @@ Return successive *r* length permutations of elements in the *iterable*. If *r* is not specified or is ``None``, then *r* defaults to the length - of the *iterable* and all possible full-length permutations + of the *iterable* and all possible full-length permutations are generated. - Permutations are emitted in lexicographic sort order. So, if the + Permutations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the permutation tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -416,7 +416,7 @@ else: return - The code for :func:`permutations` can be also expressed as a subsequence of + The code for :func:`permutations` can be also expressed as a subsequence of :func:`product`, filtered to exclude entries with repeated elements (those from the same position in the input pool):: @@ -564,7 +564,7 @@ >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x): ... print map(itemgetter(1), g) - ... + ... [1] [4, 5, 6] [10] @@ -691,7 +691,7 @@ 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 + # unique_everseen('ABBCcAD', str.lower) --> A B C D seen = set() seen_add = seen.add if key is None: Modified: python/trunk/Doc/library/jpeg.rst ============================================================================== --- python/trunk/Doc/library/jpeg.rst (original) +++ python/trunk/Doc/library/jpeg.rst Sat Jan 3 21:55:06 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Read and write image files in compressed JPEG format. :deprecated: - + .. deprecated:: 2.6 The :mod:`jpeg` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/json.rst ============================================================================== --- python/trunk/Doc/library/json.rst (original) +++ python/trunk/Doc/library/json.rst Sat Jan 3 21:55:06 2009 @@ -14,7 +14,7 @@ :mod:`marshal` and :mod:`pickle` modules. Encoding basic Python object hierarchies:: - + >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' @@ -43,12 +43,12 @@ >>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) { - "4": 5, + "4": 5, "6": 7 } Decoding JSON:: - + >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] @@ -66,7 +66,7 @@ ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct - ... + ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) @@ -75,26 +75,26 @@ Decimal('1.1') Extending :class:`JSONEncoder`:: - + >>> import json >>> class ComplexEncoder(json.JSONEncoder): ... def default(self, obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... return json.JSONEncoder.default(self, obj) - ... + ... >>> dumps(2 + 1j, cls=ComplexEncoder) '[2.0, 1.0]' >>> ComplexEncoder().encode(2 + 1j) '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[', '2.0', ', ', '1.0', ']'] - + .. highlight:: none Using json.tool from the shell to validate and pretty-print:: - + $ echo '{"json":"obj"}' | python -mjson.tool { "json": "obj" @@ -104,7 +104,7 @@ .. highlight:: python -.. note:: +.. note:: The JSON produced by this module's default settings is a subset of YAML, so it may be used as a serializer for that as well. @@ -368,7 +368,7 @@ For example, to support arbitrary iterators, you could implement default like this:: - + def default(self, o): try: iterable = iter(o) @@ -392,6 +392,6 @@ Encode the given object, *o*, and yield each string representation as available. For example:: - + for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) Modified: python/trunk/Doc/library/locale.rst ============================================================================== --- python/trunk/Doc/library/locale.rst (original) +++ python/trunk/Doc/library/locale.rst Sat Jan 3 21:55:06 2009 @@ -494,7 +494,7 @@ >>> import locale >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale Modified: python/trunk/Doc/library/macos.rst ============================================================================== --- python/trunk/Doc/library/macos.rst (original) +++ python/trunk/Doc/library/macos.rst Sat Jan 3 21:55:06 2009 @@ -82,7 +82,7 @@ parameter can be a pathname or an ``FSSpec`` or ``FSRef`` object. .. note:: - + It is not possible to use an ``FSSpec`` in 64-bit mode. @@ -93,7 +93,7 @@ strings. .. note:: - + It is not possible to use an ``FSSpec`` in 64-bit mode. .. function:: openrf(name [, mode]) Modified: python/trunk/Doc/library/mailbox.rst ============================================================================== --- python/trunk/Doc/library/mailbox.rst (original) +++ python/trunk/Doc/library/mailbox.rst Sat Jan 3 21:55:06 2009 @@ -1686,7 +1686,7 @@ # that's better than losing a message completely. box.lock() box.add(message) - box.flush() + box.flush() box.unlock() # Remove original message Modified: python/trunk/Doc/library/marshal.rst ============================================================================== --- python/trunk/Doc/library/marshal.rst (original) +++ python/trunk/Doc/library/marshal.rst Sat Jan 3 21:55:06 2009 @@ -45,7 +45,7 @@ (they will cause infinite loops). .. warning:: - + On machines where C's ``long int`` type has more than 32 bits (such as the DEC Alpha), it is possible to create plain Python integers that are longer than 32 bits. If such an integer is marshaled and read back in on a machine Modified: python/trunk/Doc/library/math.rst ============================================================================== --- python/trunk/Doc/library/math.rst (original) +++ python/trunk/Doc/library/math.rst Sat Jan 3 21:55:06 2009 @@ -109,7 +109,7 @@ .. function:: isnan(x) Checks if the float *x* is a NaN (not a number). NaNs are part of the - IEEE 754 standards. Operation like but not limited to ``inf * 0``, + IEEE 754 standards. Operation like but not limited to ``inf * 0``, ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return a NaN. Modified: python/trunk/Doc/library/mhlib.rst ============================================================================== --- python/trunk/Doc/library/mhlib.rst (original) +++ python/trunk/Doc/library/mhlib.rst Sat Jan 3 21:55:06 2009 @@ -4,7 +4,7 @@ .. module:: mhlib :synopsis: Manipulate MH mailboxes from Python. :deprecated: - + .. deprecated:: 2.6 The :mod:`mhlib` module has been removed in Python 3.0. Use the :mod:`mailbox` instead. Modified: python/trunk/Doc/library/mmap.rst ============================================================================== --- python/trunk/Doc/library/mmap.rst (original) +++ python/trunk/Doc/library/mmap.rst Sat Jan 3 21:55:06 2009 @@ -93,7 +93,7 @@ will be relative to the offset from the beginning of the file. *offset* defaults to 0. *offset* must be a multiple of the PAGESIZE or ALLOCATIONGRANULARITY. - + This example shows a simple way of using :class:`mmap`:: import mmap Modified: python/trunk/Doc/library/msvcrt.rst ============================================================================== --- python/trunk/Doc/library/msvcrt.rst (original) +++ python/trunk/Doc/library/msvcrt.rst Sat Jan 3 21:55:06 2009 @@ -18,7 +18,7 @@ The module implements both the normal and wide char variants of the console I/O api. The normal API deals only with ASCII characters and is of limited use -for internationalized applications. The wide char API should be used where +for internationalized applications. The wide char API should be used where ever possible .. _msvcrt-files: @@ -98,13 +98,13 @@ return the keycode. The :kbd:`Control-C` keypress cannot be read with this function. - + .. function:: getwch() Wide char variant of :func:`getch`, returning a Unicode value. - + .. versionadded:: 2.6 - + .. function:: getche() @@ -115,7 +115,7 @@ .. function:: getwche() Wide char variant of :func:`getche`, returning a Unicode value. - + .. versionadded:: 2.6 @@ -123,24 +123,24 @@ Print the character *char* to the console without buffering. - + .. function:: putwch(unicode_char) Wide char variant of :func:`putch`, accepting a Unicode value. - + .. versionadded:: 2.6 - + .. function:: ungetch(char) Cause the character *char* to be "pushed back" into the console buffer; it will be the next character read by :func:`getch` or :func:`getche`. - + .. function:: ungetwch(unicode_char) Wide char variant of :func:`ungetch`, accepting a Unicode value. - + .. versionadded:: 2.6 Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Sat Jan 3 21:55:06 2009 @@ -21,9 +21,9 @@ .. warning:: Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See :issue:`3770` for additional information. .. note:: @@ -38,7 +38,7 @@ >>> p = Pool(5) >>> def f(x): ... return x*x - ... + ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: @@ -77,11 +77,11 @@ print 'module name:', __name__ print 'parent process:', os.getppid() print 'process id:', os.getpid() - + def f(name): info('function f') print 'hello', name - + if __name__ == '__main__': info('main line') p = Process(target=f, args=('bob',)) @@ -543,7 +543,7 @@ .. method:: put(item[, block[, timeout]]) - Put item into the queue. If the optional argument *block* is ``True`` + Put item into the queue. If the optional argument *block* is ``True`` (the default) and *timeout* is ``None`` (the default), block if necessary until a free slot is available. If *timeout* is a positive number, it blocks at most *timeout* seconds and raises the :exc:`Queue.Full` exception if no @@ -858,7 +858,7 @@ acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it specifies a timeout in seconds. If *block* is ``False`` then *timeout* is ignored. - + Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments for these will be ignored. @@ -1135,22 +1135,22 @@ server process which is using the given address and authentication key. .. method:: get_server() - + Returns a :class:`Server` object which represents the actual server under - the control of the Manager. The :class:`Server` object supports the + the control of the Manager. The :class:`Server` object supports the :meth:`serve_forever` method: - + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address=('', 50000), authkey='abc')) >>> server = m.get_server() >>> s.serve_forever() - + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - + Connect a local manager object to a remote manager process: - + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) >>> m.connect() @@ -1360,7 +1360,7 @@ >>> queue.get() 'hello' -Local processes can also access that queue, using the code from above on the +Local processes can also access that queue, using the code from above on the client to access it remotely:: >>> from multiprocessing import Process, Queue @@ -1371,12 +1371,12 @@ ... super(Worker, self).__init__() ... def run(self): ... self.q.put('local hello') - ... + ... >>> queue = Queue() >>> w = Worker(queue) >>> w.start() >>> class QueueManager(BaseManager): pass - ... + ... >>> QueueManager.register('get_queue', callable=lambda: queue) >>> m = QueueManager(address=('', 50000), authkey='abracadabra') >>> s = m.get_server() @@ -2120,7 +2120,7 @@ .. literalinclude:: ../includes/mp_benchmarks.py An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process` -and others to build a system which can distribute processes and work via a +and others to build a system which can distribute processes and work via a distributed queue to a "cluster" of machines on a network, accessible via SSH. You will need to have private key authentication for all hosts configured for this to work. Modified: python/trunk/Doc/library/mutex.rst ============================================================================== --- python/trunk/Doc/library/mutex.rst (original) +++ python/trunk/Doc/library/mutex.rst Sat Jan 3 21:55:06 2009 @@ -5,7 +5,7 @@ .. module:: mutex :synopsis: Lock and queue for mutual exclusion. :deprecated: - + .. deprecated:: The :mod:`mutex` module has been removed in Python 3.0. Modified: python/trunk/Doc/library/nntplib.rst ============================================================================== --- python/trunk/Doc/library/nntplib.rst (original) +++ python/trunk/Doc/library/nntplib.rst Sat Jan 3 21:55:06 2009 @@ -24,16 +24,16 @@ Group comp.lang.python has 59 articles, range 3742 to 3803 >>> resp, subs = s.xhdr('subject', first + '-' + last) >>> for id, sub in subs[-10:]: print id, sub - ... + ... 3792 Re: Removing elements from a list while iterating... 3793 Re: Who likes Info files? 3794 Emacs and doc strings 3795 a few questions about the Mac implementation 3796 Re: executable python scripts 3797 Re: executable python scripts - 3798 Re: a few questions about the Mac implementation + 3798 Re: a few questions about the Mac implementation 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules - 3802 Re: executable python scripts + 3802 Re: executable python scripts 3803 Re: \POSIX{} wait and SIGCHLD >>> s.quit() '205 news.cwi.nl closing connection. Goodbye.' Modified: python/trunk/Doc/library/operator.rst ============================================================================== --- python/trunk/Doc/library/operator.rst (original) +++ python/trunk/Doc/library/operator.rst Sat Jan 3 21:55:06 2009 @@ -7,7 +7,7 @@ .. testsetup:: - + import operator from operator import itemgetter @@ -437,7 +437,7 @@ >>> class C: ... pass - ... + ... >>> import operator >>> obj = C() >>> operator.isMappingType(obj) @@ -547,9 +547,9 @@ def g(obj): return tuple(obj[item] for item in items) return g - - The items can be any type accepted by the operand's :meth:`__getitem__` - method. Dictionaries accept any hashable value. Lists, tuples, and + + The items can be any type accepted by the operand's :meth:`__getitem__` + method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice: >>> itemgetter(1)('ABCDEFG') Modified: python/trunk/Doc/library/optparse.rst ============================================================================== --- python/trunk/Doc/library/optparse.rst (original) +++ python/trunk/Doc/library/optparse.rst Sat Jan 3 21:55:06 2009 @@ -799,7 +799,7 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an +attributes, or fail to pass required ones, :mod:`optparse` raises an :exc:`OptionError` exception explaining your mistake. An option's *action* determines what :mod:`optparse` does when it encounters Modified: python/trunk/Doc/library/os.rst ============================================================================== --- python/trunk/Doc/library/os.rst (original) +++ python/trunk/Doc/library/os.rst Sat Jan 3 21:55:06 2009 @@ -368,7 +368,7 @@ is returned. Availability: Unix, Windows. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. .. versionchanged:: 2.0 @@ -418,7 +418,7 @@ child_stdout)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -432,7 +432,7 @@ child_stdout, child_stderr)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -446,7 +446,7 @@ child_stdout_and_stderr)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -1449,7 +1449,7 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered @@ -1481,7 +1481,7 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. + inherit the environment of the current process. Availability: Unix, Windows. @@ -1718,7 +1718,7 @@ (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is - preferable to using these functions. Check specially the *Replacing Older + preferable to using these functions. Check specially the *Replacing Older Functions with the subprocess Module* section in that documentation page.) If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new Modified: python/trunk/Doc/library/ossaudiodev.rst ============================================================================== --- python/trunk/Doc/library/ossaudiodev.rst (original) +++ python/trunk/Doc/library/ossaudiodev.rst Sat Jan 3 21:55:06 2009 @@ -18,26 +18,26 @@ use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast majority of Linux audio apps anyways. - + Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: - + > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial > OSS installation manual tells you to remove references to OSS/Free from the > kernel :) - + but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes from its : > * WARNING! WARNING! > * This is an OSS (Linux) audio emulator. > * Use the Native NetBSD API for developing new code, and this > * only for compiling Linux programs. - + There's also an ossaudio manpage on OpenBSD that explains things further. Presumably NetBSD and OpenBSD have a different standard audio interface. That's the great thing about standards, there are so many to choose from ... ;-) - + This probably all warrants a footnote or two, but I don't understand things well enough right now to write it! --GPW Modified: python/trunk/Doc/library/othergui.rst ============================================================================== --- python/trunk/Doc/library/othergui.rst (original) +++ python/trunk/Doc/library/othergui.rst Sat Jan 3 21:55:06 2009 @@ -70,7 +70,7 @@ Robin Dunn. PyGTK, PyQt, and wxPython, all have a modern look and feel and more -widgets than Tkinter. In addition, there are many other GUI toolkits for +widgets than Tkinter. In addition, there are many other GUI toolkits for Python, both cross-platform, and platform-specific. See the `GUI Programming `_ page in the Python Wiki for a much more complete list, and also for links to documents where the Modified: python/trunk/Doc/library/pdb.rst ============================================================================== --- python/trunk/Doc/library/pdb.rst (original) +++ python/trunk/Doc/library/pdb.rst Sat Jan 3 21:55:06 2009 @@ -37,7 +37,7 @@ (Pdb) continue NameError: 'spam' > (1)?() - (Pdb) + (Pdb) :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -68,7 +68,7 @@ >>> pdb.pm() > ./mymodule.py(3)test2() -> print spam - (Pdb) + (Pdb) The module defines the following functions; each enters the debugger in a slightly different way: @@ -109,7 +109,7 @@ .. function:: post_mortem([traceback]) - Enter post-mortem debugging of the given *traceback* object. If no + Enter post-mortem debugging of the given *traceback* object. If no *traceback* is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used). Modified: python/trunk/Doc/library/pickle.rst ============================================================================== --- python/trunk/Doc/library/pickle.rst (original) +++ python/trunk/Doc/library/pickle.rst Sat Jan 3 21:55:06 2009 @@ -413,7 +413,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: object.__getinitargs__() - + When a pickled class instance is unpickled, its :meth:`__init__` method is normally *not* invoked. If it is desirable that the :meth:`__init__` method be called on unpickling, an old-style class can define a method @@ -430,31 +430,31 @@ is affected by the values passed to the :meth:`__new__` method for the type (as it is for tuples and strings). Instances of a :term:`new-style class` ``C`` are created using :: - + obj = C.__new__(C, *args) - + where *args* is the result of calling :meth:`__getnewargs__` on the original object; if there is no :meth:`__getnewargs__`, an empty tuple is assumed. .. method:: object.__getstate__() - + Classes can further influence how their instances are pickled; if the class defines the method :meth:`__getstate__`, it is called and the return state is pickled as the contents for the instance, instead of the contents of the instance's dictionary. If there is no :meth:`__getstate__` method, the instance's :attr:`__dict__` is pickled. -.. method:: object.__setstate__() - +.. method:: object.__setstate__() + Upon unpickling, if the class also defines the method :meth:`__setstate__`, it is called with the unpickled state. [#]_ If there is no :meth:`__setstate__` method, the pickled state must be a dictionary and its items are assigned to the new instance's dictionary. If a class defines both :meth:`__getstate__` and :meth:`__setstate__`, the state object needn't be a dictionary and these methods can do what they want. [#]_ - + .. warning:: - + For :term:`new-style class`\es, if :meth:`__getstate__` returns a false value, the :meth:`__setstate__` method will not be called. @@ -463,7 +463,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: object.__reduce__() - + When the :class:`Pickler` encounters an object of a type it knows nothing about --- such as an extension type --- it looks in two places for a hint of how to pickle it. One alternative is for the object to implement a @@ -518,7 +518,7 @@ is primarily used for dictionary subclasses, but may be used by other classes as long as they implement :meth:`__setitem__`. -.. method:: object.__reduce_ex__(protocol) +.. method:: object.__reduce_ex__(protocol) It is sometimes useful to know the protocol version when implementing :meth:`__reduce__`. This can be done by implementing a method named Modified: python/trunk/Doc/library/popen2.rst ============================================================================== --- python/trunk/Doc/library/popen2.rst (original) +++ python/trunk/Doc/library/popen2.rst Sat Jan 3 21:55:06 2009 @@ -9,7 +9,7 @@ .. deprecated:: 2.6 - This module is obsolete. Use the :mod:`subprocess` module. Check + This module is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. This module allows you to spawn processes and connect to their Modified: python/trunk/Doc/library/profile.rst ============================================================================== --- python/trunk/Doc/library/profile.rst (original) +++ python/trunk/Doc/library/profile.rst Sat Jan 3 21:55:06 2009 @@ -51,17 +51,17 @@ The Python standard library provides three different profilers: -#. :mod:`cProfile` is recommended for most users; it's a C extension +#. :mod:`cProfile` is recommended for most users; it's a C extension with reasonable overhead - that makes it suitable for profiling long-running programs. + that makes it suitable for profiling long-running programs. Based on :mod:`lsprof`, - contributed by Brett Rosen and Ted Czotter. + contributed by Brett Rosen and Ted Czotter. .. versionadded:: 2.5 #. :mod:`profile`, a pure Python module whose interface is imitated by - :mod:`cProfile`. Adds significant overhead to profiled programs. - If you're trying to extend + :mod:`cProfile`. Adds significant overhead to profiled programs. + If you're trying to extend the profiler in some way, the task might be easier with this module. Copyright ? 1994, by InfoSeek Corporation. @@ -72,7 +72,7 @@ the overhead of profiling, at the expense of longer data post-processing times. It is no longer maintained and may be dropped in a future version of Python. - + .. versionchanged:: 2.5 The results should be more meaningful than in the past: the timing core @@ -276,24 +276,24 @@ that the text string in the far right column was used to sort the output. The column headings include: - ncalls + ncalls for the number of calls, - tottime + tottime for the total time spent in the given function (and excluding time made in calls to sub-functions), - percall + percall is the quotient of ``tottime`` divided by ``ncalls`` - cumtime + cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate *even* for recursive functions. - percall + percall is the quotient of ``cumtime`` divided by primitive calls - filename:lineno(function) + filename:lineno(function) provides the respective data of each function When there are two numbers in the first column (for example, ``43/3``), then the Modified: python/trunk/Doc/library/pyexpat.rst ============================================================================== --- python/trunk/Doc/library/pyexpat.rst (original) +++ python/trunk/Doc/library/pyexpat.rst Sat Jan 3 21:55:06 2009 @@ -182,9 +182,9 @@ .. attribute:: xmlparser.buffer_size - The size of the buffer used when :attr:`buffer_text` is true. - A new buffer size can be set by assigning a new integer value - to this attribute. + The size of the buffer used when :attr:`buffer_text` is true. + A new buffer size can be set by assigning a new integer value + to this attribute. When the size is changed, the buffer will be flushed. .. versionadded:: 2.3 Modified: python/trunk/Doc/library/re.rst ============================================================================== --- python/trunk/Doc/library/re.rst (original) +++ python/trunk/Doc/library/re.rst Sat Jan 3 21:55:06 2009 @@ -994,14 +994,14 @@ >>> pair.match("717ak").group(1) '7' - + # Error because re.match() returns None, which doesn't have a group() method: >>> pair.match("718ak").group(1) Traceback (most recent call last): File "", line 1, in re.match(r".*(.).*\1", "718ak").group(1) AttributeError: 'NoneType' object has no attribute 'group' - + >>> pair.match("354aa").group(1) 'a' @@ -1110,7 +1110,7 @@ Making a Phonebook ^^^^^^^^^^^^^^^^^^ -:func:`split` splits a string into a list delimited by the passed pattern. The +:func:`split` splits a string into a list delimited by the passed pattern. The method is invaluable for converting textual data into data structures that can be easily read and modified by Python as demonstrated in the following example that creates a phonebook. @@ -1119,7 +1119,7 @@ triple-quoted string syntax: >>> input = """Ross McFluff: 834.345.1254 155 Elm Street - ... + ... ... Ronald Heathmore: 892.345.3428 436 Finley Avenue ... Frank Burger: 925.541.7625 662 South Dogwood Way ... Modified: python/trunk/Doc/library/rexec.rst ============================================================================== --- python/trunk/Doc/library/rexec.rst (original) +++ python/trunk/Doc/library/rexec.rst Sat Jan 3 21:55:06 2009 @@ -5,7 +5,7 @@ .. module:: rexec :synopsis: Basic restricted execution framework. :deprecated: - + .. deprecated:: 2.6 The :mod:`rexec` module has been removed in Python 3.0. @@ -272,7 +272,7 @@ pass elif mode in ('w', 'wb', 'a', 'ab'): # check filename : must begin with /tmp/ - if file[:5]!='/tmp/': + if file[:5]!='/tmp/': raise IOError, "can't write outside /tmp" elif (string.find(file, '/../') >= 0 or file[:3] == '../' or file[-3:] == '/..'): Modified: python/trunk/Doc/library/rlcompleter.rst ============================================================================== --- python/trunk/Doc/library/rlcompleter.rst (original) +++ python/trunk/Doc/library/rlcompleter.rst Sat Jan 3 21:55:06 2009 @@ -61,6 +61,6 @@ If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`__getattr__`) up to the last part, and find matches for the rest via the - :func:`dir` function. Any exception raised during the evaluation of the + :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned. Modified: python/trunk/Doc/library/robotparser.rst ============================================================================== --- python/trunk/Doc/library/robotparser.rst (original) +++ python/trunk/Doc/library/robotparser.rst Sat Jan 3 21:55:06 2009 @@ -13,7 +13,7 @@ single: World Wide Web single: URL single: robots.txt - + .. note:: The :mod:`robotparser` module has been renamed :mod:`urllib.robotparser` in Python 3.0. Modified: python/trunk/Doc/library/sched.rst ============================================================================== --- python/trunk/Doc/library/sched.rst (original) +++ python/trunk/Doc/library/sched.rst Sat Jan 3 21:55:06 2009 @@ -42,7 +42,7 @@ 930343700.276 In multi-threaded environments, the :class:`scheduler` class has limitations -with respect to thread-safety, inability to insert a new task before +with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the :class:`threading.Timer` class instead. @@ -59,7 +59,7 @@ ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() ... time.sleep(11) # sleep while time-delay events execute - ... print time.time() + ... print time.time() ... >>> print_some_times() 930343690.257 Modified: python/trunk/Doc/library/sgmllib.rst ============================================================================== --- python/trunk/Doc/library/sgmllib.rst (original) +++ python/trunk/Doc/library/sgmllib.rst Sat Jan 3 21:55:06 2009 @@ -4,7 +4,7 @@ .. module:: sgmllib :synopsis: Only as much of an SGML parser as needed to parse HTML. :deprecated: - + .. deprecated:: 2.6 The :mod:`sgmllib` module has been removed in Python 3.0. Modified: python/trunk/Doc/library/shutil.rst ============================================================================== --- python/trunk/Doc/library/shutil.rst (original) +++ python/trunk/Doc/library/shutil.rst Sat Jan 3 21:55:06 2009 @@ -20,7 +20,7 @@ Even the higher-level file copying functions (:func:`copy`, :func:`copy2`) can't copy all file metadata. - + On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will @@ -124,7 +124,7 @@ error. Copy permissions and times of directories using :func:`copystat`. .. versionchanged:: 2.6 - Added the *ignore* argument to be able to influence what is being copied. + Added the *ignore* argument to be able to influence what is being copied. .. function:: rmtree(path[, ignore_errors[, onerror]]) @@ -189,7 +189,7 @@ os.makedirs(dst) errors = [] for name in names: - if name in ignored_names: + if name in ignored_names: continue srcname = os.path.join(src, name) dstname = os.path.join(dst, name) @@ -221,7 +221,7 @@ Another example that uses the :func:`ignore_patterns` helper:: from shutil import copytree, ignore_patterns - + copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*')) This will copy everything except ``.pyc`` files and files or directories whose @@ -231,7 +231,7 @@ from shutil import copytree import logging - + def _logpath(path, names): logging.info('Working in %s' % path) return [] # nothing will be ignored Modified: python/trunk/Doc/library/signal.rst ============================================================================== --- python/trunk/Doc/library/signal.rst (original) +++ python/trunk/Doc/library/signal.rst Sat Jan 3 21:55:06 2009 @@ -39,12 +39,12 @@ * Some care must be taken if both signals and threads are used in the same program. The fundamental thing to remember in using signals and threads simultaneously is: always perform :func:`signal` operations in the main thread - of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, - :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread - can set a new signal handler, and the main thread will be the only one to - receive signals (this is enforced by the Python :mod:`signal` module, even - if the underlying thread implementation supports sending signals to - individual threads). This means that signals can't be used as a means of + of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, + :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread + can set a new signal handler, and the main thread will be the only one to + receive signals (this is enforced by the Python :mod:`signal` module, even + if the underlying thread implementation supports sending signals to + individual threads). This means that signals can't be used as a means of inter-thread communication. Use locks instead. The variables defined in the :mod:`signal` module are: @@ -80,22 +80,22 @@ One more than the number of the highest signal number. -.. data:: ITIMER_REAL +.. data:: ITIMER_REAL Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration. -.. data:: ITIMER_VIRTUAL +.. data:: ITIMER_VIRTUAL - Decrements interval timer only when the process is executing, and delivers + Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration. .. data:: ITIMER_PROF - - Decrements interval timer both when the process executes and when the - system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, - this timer is usually used to profile the time spent by the application + + Decrements interval timer both when the process executes and when the + system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, + this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration. @@ -105,7 +105,7 @@ Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid - interval timer or a negative time is passed to :func:`setitimer`. + interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`IOError`. @@ -143,21 +143,21 @@ .. function:: setitimer(which, seconds[, interval]) - Sets given interval timer (one of :const:`signal.ITIMER_REAL`, + Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified - by *which* to fire after *seconds* (float is accepted, different from + by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds. The interval timer specified by *which* can be cleared by setting seconds to zero. When an interval timer fires, a signal is sent to the process. - The signal sent is dependent on the timer being used; - :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, + The signal sent is dependent on the timer being used; + :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`. The old values are returned as a tuple: (delay, interval). - Attempting to pass an invalid interval timer will cause a + Attempting to pass an invalid interval timer will cause a :exc:`ItimerError`. .. versionadded:: 2.6 @@ -190,7 +190,7 @@ will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing. Availability: Unix (see the man page :manpage:`siginterrupt(3)` for further information). - + Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag* value for the given signal. @@ -239,7 +239,7 @@ signal.alarm(5) # This open() may hang indefinitely - fd = os.open('/dev/ttyS0', os.O_RDWR) + fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm Modified: python/trunk/Doc/library/simplexmlrpcserver.rst ============================================================================== --- python/trunk/Doc/library/simplexmlrpcserver.rst (original) +++ python/trunk/Doc/library/simplexmlrpcserver.rst Sat Jan 3 21:55:06 2009 @@ -151,7 +151,7 @@ requestHandler=RequestHandler) server.register_introspection_functions() - # Register pow() function; this will use the value of + # Register pow() function; this will use the value of # pow.__name__ as the name, which is just 'pow'. server.register_function(pow) @@ -160,10 +160,10 @@ return x + y server.register_function(adder_function, 'add') - # Register an instance; all the methods of the instance are + # Register an instance; all the methods of the instance are # published as XML-RPC methods (in this case, just 'div'). class MyFuncs: - def div(self, x, y): + def div(self, x, y): return x // y server.register_instance(MyFuncs()) Modified: python/trunk/Doc/library/smtplib.rst ============================================================================== --- python/trunk/Doc/library/smtplib.rst (original) +++ python/trunk/Doc/library/smtplib.rst Sat Jan 3 21:55:06 2009 @@ -189,9 +189,9 @@ Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the - response for ESMTP option and store them for use by :meth:`has_extn`. - Also sets several informational attributes: the message returned by - the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` + response for ESMTP option and store them for use by :meth:`has_extn`. + Also sets several informational attributes: the message returned by + the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to true or false depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their Modified: python/trunk/Doc/library/socket.rst ============================================================================== --- python/trunk/Doc/library/socket.rst (original) +++ python/trunk/Doc/library/socket.rst Sat Jan 3 21:55:06 2009 @@ -184,10 +184,10 @@ .. data:: SIO_* RCVALL_* - + Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`ioctl` method of socket objects. - + .. versionadded:: 2.6 .. data:: TIPC_* @@ -222,7 +222,7 @@ all the necessary arguments for creating the corresponding socket. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. - The rest of the arguments are optional and must be numeric if specified. + The rest of the arguments are optional and must be numeric if specified. By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following @@ -588,14 +588,14 @@ contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as strings). - + .. method:: socket.ioctl(control, option) - :platform: Windows - + :platform: Windows + The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the MSDN documentation for more information. - + .. versionadded:: 2.6 @@ -909,7 +909,7 @@ s.close() print 'Received', repr(data) - + The last example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface:: @@ -918,19 +918,19 @@ # the public network interface HOST = socket.gethostbyname(socket.gethostname()) - + # create a raw socket and bind it to the public interface s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) s.bind((HOST, 0)) - + # Include IP headers s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) - + # receive all packages s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) - + # receive a package print s.recvfrom(65565) - + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) Modified: python/trunk/Doc/library/sqlite3.rst ============================================================================== --- python/trunk/Doc/library/sqlite3.rst (original) +++ python/trunk/Doc/library/sqlite3.rst Sat Jan 3 21:55:06 2009 @@ -244,7 +244,7 @@ .. method:: Connection.rollback() - This method rolls back any changes to the database since the last call to + This method rolls back any changes to the database since the last call to :meth:`commit`. .. method:: Connection.close() @@ -487,29 +487,29 @@ .. literalinclude:: ../includes/sqlite3/executescript.py -.. method:: Cursor.fetchone() - +.. method:: Cursor.fetchone() + Fetches the next row of a query result set, returning a single sequence, or :const:`None` when no more data is available. .. method:: Cursor.fetchmany([size=cursor.arraysize]) - + Fetches the next set of rows of a query result, returning a list. An empty list is returned when no more rows are available. - + The number of rows to fetch per call is specified by the *size* parameter. If it is not given, the cursor's arraysize determines the number of rows to be fetched. The method should try to fetch as many rows as indicated by the size parameter. If this is not possible due to the specified number of rows not being available, fewer rows may be returned. - + Note there are performance considerations involved with the *size* parameter. For optimal performance, it is usually best to use the arraysize attribute. If the *size* parameter is used, then it is best for it to retain the same value from one :meth:`fetchmany` call to the next. - -.. method:: Cursor.fetchall() + +.. method:: Cursor.fetchall() Fetches all (remaining) rows of a query result, returning a list. Note that the cursor's arraysize attribute can affect the performance of this operation. @@ -546,8 +546,8 @@ This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each - column where the last six items of each tuple are :const:`None`. - + column where the last six items of each tuple are :const:`None`. + It is set for ``SELECT`` statements without any matching rows as well. .. _sqlite3-row-objects: @@ -558,7 +558,7 @@ .. class:: Row A :class:`Row` instance serves as a highly optimized - :attr:`~Connection.row_factory` for :class:`Connection` objects. + :attr:`~Connection.row_factory` for :class:`Connection` objects. It tries to mimic a tuple in most of its features. It supports mapping access by column name and index, iteration, @@ -566,7 +566,7 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - + .. versionchanged:: 2.6 Added iteration and equality (hashability). @@ -793,7 +793,7 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. +Data Modification Language (DML) statement (i.e. ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions implicitly before a non-DML, non-query statement (i. e. anything other than ``SELECT`` or the aforementioned). Modified: python/trunk/Doc/library/ssl.rst ============================================================================== --- python/trunk/Doc/library/ssl.rst (original) +++ python/trunk/Doc/library/ssl.rst Sat Jan 3 21:55:06 2009 @@ -48,7 +48,7 @@ .. exception:: SSLError - Raised to signal an error from the underlying SSL implementation. This + Raised to signal an error from the underlying SSL implementation. This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`socket.error`, which @@ -173,7 +173,7 @@ >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' - >>> + >>> .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None) @@ -385,7 +385,7 @@ the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, -that is, a certificate which has the same subject and issuer, +that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the @@ -422,13 +422,13 @@ you only need the root certificates, and the remote peer is supposed to furnish the other certificates necessary to chain from its certificate to a root certificate. -See :rfc:`4158` for more discussion of the way in which +See :rfc:`4158` for more discussion of the way in which certification chains can be built. If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, -such as buying one from a certification authority. Another common +such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following:: @@ -570,7 +570,7 @@ And go back to listening for new client connections. - + .. seealso:: Class :class:`socket.socket` Modified: python/trunk/Doc/library/statvfs.rst ============================================================================== --- python/trunk/Doc/library/statvfs.rst (original) +++ python/trunk/Doc/library/statvfs.rst Sat Jan 3 21:55:06 2009 @@ -4,7 +4,7 @@ .. module:: statvfs :synopsis: Constants for interpreting the result of os.statvfs(). :deprecated: - + .. deprecated:: 2.6 The :mod:`statvfs` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/stdtypes.rst ============================================================================== --- python/trunk/Doc/library/stdtypes.rst (original) +++ python/trunk/Doc/library/stdtypes.rst Sat Jan 3 21:55:06 2009 @@ -362,9 +362,9 @@ though the result's type is not necessarily int. (6) - float also accepts the strings "nan" and "inf" with an optional prefix "+" + float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity. - + .. versionadded:: 2.6 (7) @@ -489,7 +489,7 @@ original float and with a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - + .. versionadded:: 2.6 Two methods support conversion to @@ -1209,7 +1209,7 @@ Return the numeric string left filled with zeros in a string of length *width*. A sign prefix is handled correctly. The original string is returned if *width* is less than ``len(s)``. - + .. versionadded:: 2.2.2 @@ -1221,7 +1221,7 @@ otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. - + .. method:: unicode.isdecimal() Return ``True`` if there are only decimal characters in S, ``False`` @@ -1898,7 +1898,7 @@ Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map. - .. versionadded:: 2.5 + .. versionadded:: 2.5 If a subclass of dict defines a method :meth:`__missing__`, if the key *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or @@ -2217,7 +2217,7 @@ positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). There is no return value. - + For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last. Modified: python/trunk/Doc/library/string.rst ============================================================================== --- python/trunk/Doc/library/string.rst (original) +++ python/trunk/Doc/library/string.rst Sat Jan 3 21:55:06 2009 @@ -126,7 +126,7 @@ :meth:`format` is just a wrapper that calls :meth:`vformat`. .. method:: vformat(format_string, args, kwargs) - + This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the @@ -139,12 +139,12 @@ intended to be replaced by subclasses: .. method:: parse(format_string) - + Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string in to either literal text, or replacement fields. - + The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then @@ -162,7 +162,7 @@ *key* parameter to :meth:`get_value`. .. method:: get_value(key, args, kwargs) - + Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a @@ -200,7 +200,7 @@ method is provided so that subclasses can override it. .. method:: convert_field(value, conversion) - + Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method.) The default version understands 'r' (repr) and 's' (str) conversion types. @@ -229,7 +229,7 @@ element_index: `integer` conversion: "r" | "s" format_spec: - + In less formal terms, the replacement field starts with a *field_name*, which can either be a number (for a positional argument), or an identifier (for keyword arguments). Following this is an optional *conversion* field, which is @@ -249,7 +249,7 @@ "My quest is {name}" # References keyword argument 'name' "Weight in tons {0.weight}" # 'weight' attribute of first positional arg "Units destroyed: {players[0]}" # First element of keyword argument 'players'. - + The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted @@ -292,11 +292,11 @@ Then the outer replacement field would be evaluated, producing:: "noses " - + Which is substituted into the string, yielding:: - + "A man with two noses " - + (The extra space is because we specified a field width of 10, and because left alignment is the default for strings.) @@ -328,7 +328,7 @@ width: `integer` precision: `integer` type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - + The *fill* character can be any character other than '}' (which signifies the end of the field). The presence of a fill character is signaled by the *next* character, which must be one of the alignment options. If the second character @@ -421,9 +421,9 @@ +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ - + The available presentation types for floating point and decimal values are: - + +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ Modified: python/trunk/Doc/library/stringio.rst ============================================================================== --- python/trunk/Doc/library/stringio.rst (original) +++ python/trunk/Doc/library/stringio.rst Sat Jan 3 21:55:06 2009 @@ -52,7 +52,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() @@ -81,7 +81,7 @@ Calling :func:`StringIO` with a Unicode string parameter populates the object with the buffer representation of the Unicode string, instead of -encoding the string. +encoding the string. Another difference from the :mod:`StringIO` module is that calling :func:`StringIO` with a string parameter creates a read-only object. Unlike an @@ -118,7 +118,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Sat Jan 3 21:55:06 2009 @@ -131,7 +131,7 @@ Special value that can be used as the *stderr* argument to :class:`Popen` and indicates that standard error should go into the same handle as standard output. - + Convenience Functions ^^^^^^^^^^^^^^^^^^^^^ @@ -326,7 +326,7 @@ The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly by :meth:`communicate`). A ``None`` value indicates that the process hasn't terminated yet. - + A negative value ``-N`` indicates that the child was terminated by signal ``N`` (Unix only). Modified: python/trunk/Doc/library/sunaudio.rst ============================================================================== --- python/trunk/Doc/library/sunaudio.rst (original) +++ python/trunk/Doc/library/sunaudio.rst Sat Jan 3 21:55:06 2009 @@ -6,7 +6,7 @@ :platform: SunOS :synopsis: Access to Sun audio hardware. :deprecated: - + .. deprecated:: 2.6 The :mod:`sunaudiodev` module has been deprecated for removal in Python 3.0. @@ -151,7 +151,7 @@ :platform: SunOS :synopsis: Constants for use with sunaudiodev. :deprecated: - + .. deprecated:: 2.6 The :mod:`SUNAUDIODEV` module has been deprecated for removal in Python 3.0. Modified: python/trunk/Doc/library/sys.rst ============================================================================== --- python/trunk/Doc/library/sys.rst (original) +++ python/trunk/Doc/library/sys.rst Sat Jan 3 21:55:06 2009 @@ -402,7 +402,7 @@ The *default* argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would - cause a `TypeError`. + cause a `TypeError`. func:`getsizeof` calls the object's __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. @@ -731,7 +731,7 @@ The events have the following meaning: - ``'call'`` + ``'call'`` A function is called (or some other code block entered). The global trace function is called; *arg* is ``None``; the return value specifies the local trace function. @@ -799,7 +799,7 @@ prompts of :func:`input` and :func:`raw_input`. The interpreter's own prompts and (almost all of) its error messages go to ``stderr``. ``stdout`` and ``stderr`` needn't be built-in file objects: any object is acceptable as long - as it has a :meth:`write` method that takes a string argument. (Changing these + as it has a :meth:`write` method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) Modified: python/trunk/Doc/library/tk.rst ============================================================================== --- python/trunk/Doc/library/tk.rst (original) +++ python/trunk/Doc/library/tk.rst Sat Jan 3 21:55:06 2009 @@ -22,15 +22,15 @@ mechanism which allows Python and Tcl to interact. :mod:`Tkinter`'s chief virtues are that it is fast, and that it usually comes -bundled with Python. Although its standard documentation is weak, good -material is available, which includes: references, tutorials, a book and -others. :mod:`Tkinter` is also famous for having an outdated look and feel, -which has been vastly improved in Tk 8.5. Nevertheless, there are many other -GUI libraries that you could be interested in. For more information about +bundled with Python. Although its standard documentation is weak, good +material is available, which includes: references, tutorials, a book and +others. :mod:`Tkinter` is also famous for having an outdated look and feel, +which has been vastly improved in Tk 8.5. Nevertheless, there are many other +GUI libraries that you could be interested in. For more information about alternatives, see the :ref:`other-gui-packages` section. .. toctree:: - + tkinter.rst tix.rst scrolledtext.rst Modified: python/trunk/Doc/library/tkinter.rst ============================================================================== --- python/trunk/Doc/library/tkinter.rst (original) +++ python/trunk/Doc/library/tkinter.rst Sat Jan 3 21:55:06 2009 @@ -284,7 +284,7 @@ someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say:: - .fred someAction someOptions + .fred someAction someOptions Note that the object name, ``.fred``, starts with a dot. @@ -490,7 +490,7 @@ For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout's book. -anchor +anchor Anchor type. Denotes where the packer is to place each slave in its parcel. expand @@ -720,7 +720,7 @@ they are denoted in Tk, which can be useful when referring to the Tk man pages. :: - Tk Tkinter Event Field Tk Tkinter Event Field + Tk Tkinter Event Field Tk Tkinter Event Field -- ------------------- -- ------------------- %f focus %A char %h height %E send_event Modified: python/trunk/Doc/library/trace.rst ============================================================================== --- python/trunk/Doc/library/trace.rst (original) +++ python/trunk/Doc/library/trace.rst Sat Jan 3 21:55:06 2009 @@ -65,13 +65,13 @@ :option:`--ignore-module` Accepts comma separated list of module names. Ignore each of the named - module and its submodules (if it is a package). May be given + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` Ignore all modules and packages in the named directory and subdirectories (multiple directories can be joined by os.pathsep). May be given multiple - times. + times. .. _trace-api: Modified: python/trunk/Doc/library/traceback.rst ============================================================================== --- python/trunk/Doc/library/traceback.rst (original) +++ python/trunk/Doc/library/traceback.rst Sat Jan 3 21:55:06 2009 @@ -169,10 +169,10 @@ def lumberjack(): bright_side_of_death() - + def bright_side_of_death(): return tuple()[0] - + try: lumberjack() except: @@ -251,12 +251,12 @@ >>> import traceback >>> def another_function(): ... lumberstack() - ... + ... >>> def lumberstack(): ... traceback.print_stack() ... print repr(traceback.extract_stack()) ... print repr(traceback.format_stack()) - ... + ... >>> another_function() File "", line 10, in another_function() Modified: python/trunk/Doc/library/turtle.rst ============================================================================== --- python/trunk/Doc/library/turtle.rst (original) +++ python/trunk/Doc/library/turtle.rst Sat Jan 3 21:55:06 2009 @@ -1587,7 +1587,7 @@ Subclass of TurtleScreen, with :ref:`four methods added `. - + .. class:: ScrolledCavas(master) :param master: some Tkinter widget to contain the ScrolledCanvas, i.e. @@ -1612,13 +1612,13 @@ "compound" ``None`` (a compund shape has to be constructed using the :meth:`addcomponent` method) =========== =========== - + .. method:: addcomponent(poly, fill, outline=None) :param poly: a polygon, i.e. a tuple of pairs of numbers :param fill: a color the *poly* will be filled with :param outline: a color for the poly's outline (if given) - + Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1662,31 +1662,31 @@ >>> help(Screen.bgcolor) Help on method bgcolor in module turtle: - + bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - - + + >>> screen.bgcolor("orange") >>> screen.bgcolor() "orange" >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() "#800080" - + >>> help(Turtle.penup) Help on method penup in module turtle: - + penup(self) unbound turtle.Turtle method Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + >>> turtle.penup() - The docstrings of the functions which are derived from methods have a modified @@ -1694,32 +1694,32 @@ >>> help(bgcolor) Help on function bgcolor in module turtle: - + bgcolor(*args) Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - + Example:: - + >>> bgcolor("orange") >>> bgcolor() "orange" >>> bgcolor(0.5,0,0.5) >>> bgcolor() "#800080" - + >>> help(penup) Help on function penup in module turtle: - + penup() Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + Example: >>> penup() Modified: python/trunk/Doc/library/undoc.rst ============================================================================== --- python/trunk/Doc/library/undoc.rst (original) +++ python/trunk/Doc/library/undoc.rst Sat Jan 3 21:55:06 2009 @@ -21,7 +21,7 @@ :mod:`ihooks` --- Import hook support (for :mod:`rexec`; may become obsolete). - + .. warning:: The :mod:`ihooks` module has been removed in Python 3.0. @@ -54,7 +54,7 @@ :mod:`linuxaudiodev` --- Play audio data on the Linux audio device. Replaced in Python 2.3 by the :mod:`ossaudiodev` module. - + .. warning:: The :mod:`linuxaudiodev` module has been removed in Python 3.0. :mod:`sunaudio` @@ -240,7 +240,7 @@ :mod:`timing` --- Measure time intervals to high resolution (use :func:`time.clock` instead). - + .. warning:: The :mod:`timing` module has been removed in Python 3.0. @@ -255,6 +255,6 @@ :mod:`sv` --- Interface to the "simple video" board on SGI Indigo (obsolete hardware). - + .. warning:: The :mod:`sv` module has been removed in Python 3.0. Modified: python/trunk/Doc/library/unicodedata.rst ============================================================================== --- python/trunk/Doc/library/unicodedata.rst (original) +++ python/trunk/Doc/library/unicodedata.rst Sat Jan 3 21:55:06 2009 @@ -164,7 +164,7 @@ File "", line 1, in ? ValueError: not a decimal >>> unicodedata.category(u'A') # 'L'etter, 'u'ppercase - 'Lu' + 'Lu' >>> unicodedata.bidirectional(u'\u0660') # 'A'rabic, 'N'umber 'AN' Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sat Jan 3 21:55:06 2009 @@ -595,7 +595,7 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare @@ -606,7 +606,7 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare Modified: python/trunk/Doc/library/urllib.rst ============================================================================== --- python/trunk/Doc/library/urllib.rst (original) +++ python/trunk/Doc/library/urllib.rst Sat Jan 3 21:55:06 2009 @@ -123,7 +123,7 @@ .. versionchanged:: 2.6 Added :meth:`getcode` to returned object and support for the :envvar:`no_proxy` environment variable. - + .. deprecated:: 2.6 The :func:`urlopen` function has been removed in Python 3.0 in favor of :func:`urllib2.urlopen`. Modified: python/trunk/Doc/library/urllib2.rst ============================================================================== --- python/trunk/Doc/library/urllib2.rst (original) +++ python/trunk/Doc/library/urllib2.rst Sat Jan 3 21:55:06 2009 @@ -109,7 +109,7 @@ .. attribute:: code - An HTTP status code as defined in `RFC 2616 `_. + An HTTP status code as defined in `RFC 2616 `_. This numeric value corresponds to a value found in the dictionary of codes as found in :attr:`BaseHTTPServer.BaseHTTPRequestHandler.responses`. Modified: python/trunk/Doc/library/warnings.rst ============================================================================== --- python/trunk/Doc/library/warnings.rst (original) +++ python/trunk/Doc/library/warnings.rst Sat Jan 3 21:55:06 2009 @@ -274,7 +274,7 @@ .. function:: warnpy3k(message[, category[, stacklevel]]) - Issue a warning related to Python 3.x deprecation. Warnings are only shown + Issue a warning related to Python 3.x deprecation. Warnings are only shown when Python is started with the -3 option. Like :func:`warn` *message* must be a string and *category* a subclass of :exc:`Warning`. :func:`warnpy3k` is using :exc:`DeprecationWarning` as default warning class. @@ -288,7 +288,7 @@ this function with an alternative implementation by assigning to ``warnings.showwarning``. *line* is a line of source code to be included in the warning - message; if *line* is not supplied, :func:`showwarning` will + message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. versionchanged:: 2.6 @@ -299,8 +299,8 @@ .. function:: formatwarning(message, category, filename, lineno[, line]) Format a warning the standard way. This returns a string which may contain - embedded newlines and ends in a newline. *line* is - a line of source code to be included in the warning message; if *line* is not supplied, + embedded newlines and ends in a newline. *line* is + a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. .. versionchanged:: 2.6 Modified: python/trunk/Doc/library/webbrowser.rst ============================================================================== --- python/trunk/Doc/library/webbrowser.rst (original) +++ python/trunk/Doc/library/webbrowser.rst Sat Jan 3 21:55:06 2009 @@ -160,7 +160,7 @@ url = 'http://www.python.org' - # Open URL in a new tab, if a browser window is already open. + # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(url + '/doc') # Open URL in new window, raising the window if possible. Modified: python/trunk/Doc/library/wsgiref.rst ============================================================================== --- python/trunk/Doc/library/wsgiref.rst (original) +++ python/trunk/Doc/library/wsgiref.rst Sat Jan 3 21:55:06 2009 @@ -170,7 +170,7 @@ filelike = StringIO("This is an example file-like object"*10) wrapper = FileWrapper(filelike, blksize=5) - for chunk in wrapper: + for chunk in wrapper: print chunk @@ -415,7 +415,7 @@ from wsgiref.validate import validator from wsgiref.simple_server import make_server - # Our callable object which is intentionally not compliant to the + # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): status = '200 OK' # HTTP Status 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 Sat Jan 3 21:55:06 2009 @@ -34,7 +34,7 @@ A C implementation of this API is available as :mod:`xml.etree.cElementTree`. See http://effbot.org/zone/element-index.htm for tutorials and links to other -docs. Fredrik Lundh's page is also the location of the development version of the +docs. Fredrik Lundh's page is also the location of the development version of the xml.etree.ElementTree. .. _elementtree-functions: @@ -379,7 +379,7 @@ Example page -

Moved to example.org +

Moved to example.org or example.com.

@@ -486,9 +486,9 @@ :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method for each opening tag, its :meth:`end` method for each closing tag, -and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` -calls *target*\'s method :meth:`close`. -:class:`XMLTreeBuilder` can be used not only for building a tree structure. +and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` +calls *target*\'s method :meth:`close`. +:class:`XMLTreeBuilder` can be used not only for building a tree structure. This is an example of counting the maximum depth of an XML file:: >>> from xml.etree.ElementTree import XMLTreeBuilder @@ -496,16 +496,16 @@ ... maxDepth = 0 ... depth = 0 ... def start(self, tag, attrib): # Called for each opening tag. - ... self.depth += 1 + ... self.depth += 1 ... if self.depth > self.maxDepth: ... self.maxDepth = self.depth ... def end(self, tag): # Called for each closing tag. ... self.depth -= 1 - ... def data(self, data): + ... def data(self, data): ... pass # We do not need to do anything with data. ... def close(self): # Called when all data has been parsed. ... return self.maxDepth - ... + ... >>> target = MaxDepth() >>> parser = XMLTreeBuilder(target=target) >>> exampleXml = """ Modified: python/trunk/Doc/library/zipfile.rst ============================================================================== --- python/trunk/Doc/library/zipfile.rst (original) +++ python/trunk/Doc/library/zipfile.rst Sat Jan 3 21:55:06 2009 @@ -202,7 +202,7 @@ .. method:: ZipFile.extractall([path[, members[, pwd]]]) - Extract all members from the archive to the current working directory. *path* + Extract all members from the archive to the current working directory. *path* specifies a different directory to extract to. *members* is optional and must be a subset of the list returned by :meth:`namelist`. *pwd* is the password used for encrypted files. @@ -282,9 +282,9 @@ .. note:: - When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, - the compression method used will be that specified in the *compress_type* - member of the given :class:`ZipInfo` instance. By default, the + When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, + the compression method used will be that specified in the *compress_type* + member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. The following data attributes are also available: @@ -298,9 +298,9 @@ .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a - :class:`ZipFile` instance created with mode 'a' or 'w', this should be a - string no longer than 65535 bytes. Comments longer than this will be + The comment text associated with the ZIP file. If assigning a comment to a + :class:`ZipFile` instance created with mode 'a' or 'w', this should be a + string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when :meth:`ZipFile.close` is called. .. _pyzipfile-objects: @@ -329,10 +329,10 @@ internal use only. The :meth:`writepy` method makes archives with file names like this:: - string.pyc # Top level name - test/__init__.pyc # Package directory + string.pyc # Top level name + test/__init__.pyc # Package directory test/test_support.pyc # Module test.test_support - test/bogus/__init__.pyc # Subpackage directory + test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile Modified: python/trunk/Doc/library/zipimport.rst ============================================================================== --- python/trunk/Doc/library/zipimport.rst (original) +++ python/trunk/Doc/library/zipimport.rst Sat Jan 3 21:55:06 2009 @@ -148,7 +148,7 @@ -------- ------- 8467 1 file $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading Modified: python/trunk/Doc/license.rst ============================================================================== --- python/trunk/Doc/license.rst (original) +++ python/trunk/Doc/license.rst Sat Jan 3 21:55:06 2009 @@ -386,8 +386,8 @@ The source for the :mod:`fpectl` module includes the following notice:: - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -419,7 +419,7 @@ | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / + \ endorsement purposes. / --------------------------------------------------------------------- Modified: python/trunk/Doc/reference/expressions.rst ============================================================================== --- python/trunk/Doc/reference/expressions.rst (original) +++ python/trunk/Doc/reference/expressions.rst Sat Jan 3 21:55:06 2009 @@ -560,7 +560,7 @@ .. productionlist:: slicing: `simple_slicing` | `extended_slicing` simple_slicing: `primary` "[" `short_slice` "]" - extended_slicing: `primary` "[" `slice_list` "]" + extended_slicing: `primary` "[" `slice_list` "]" slice_list: `slice_item` ("," `slice_item`)* [","] slice_item: `expression` | `proper_slice` | `ellipsis` proper_slice: `short_slice` | `long_slice` @@ -664,7 +664,7 @@ the call. .. note:: - + An implementation may provide builtin functions whose positional parameters do not have names, even if they are 'named' for the purpose of documentation, and which therefore cannot be supplied by keyword. In CPython, this is the case for @@ -1321,7 +1321,7 @@ .. rubric:: Footnotes .. [#] In Python 2.3 and later releases, a list comprehension "leaks" the control - variables of each ``for`` it contains into the containing scope. However, this + variables of each ``for`` it contains into the containing scope. However, this behavior is deprecated, and relying on it will not work in Python 3.0 .. [#] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be @@ -1354,7 +1354,7 @@ only, but this caused surprises because people expected to be able to test a dictionary for emptiness by comparing it to ``{}``. -.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of +.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 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. Modified: python/trunk/Doc/reference/lexical_analysis.rst ============================================================================== --- python/trunk/Doc/reference/lexical_analysis.rst (original) +++ python/trunk/Doc/reference/lexical_analysis.rst Sat Jan 3 21:55:06 2009 @@ -341,13 +341,13 @@ language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:: - and del from not while - as elif global or with - assert else if pass yield - break except import print - class exec in raise - continue finally is return - def for lambda try + and del from not while + as elif global or with + assert else if pass yield + break except import print + class exec in raise + continue finally is return + def for lambda try .. versionchanged:: 2.4 :const:`None` became a constant and is now recognized by the compiler as a name @@ -654,7 +654,7 @@ 7 2147483647 0177 3L 79228162514264337593543950336L 0377L 0x100000000L - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: @@ -701,7 +701,7 @@ part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of imaginary literals:: - 3.14j 10.j 10j .001j 1e100j 3.14e-10j + 3.14j 10.j 10j .001j 1e100j 3.14e-10j .. _operators: Modified: python/trunk/Doc/reference/simple_stmts.rst ============================================================================== --- python/trunk/Doc/reference/simple_stmts.rst (original) +++ python/trunk/Doc/reference/simple_stmts.rst Sat Jan 3 21:55:06 2009 @@ -745,7 +745,7 @@ searched inside the package. A package is generally a subdirectory of a directory on ``sys.path`` that has a file :file:`__init__.py`. -.. +.. [XXX Can't be bothered to spell this out right now; see the URL http://www.python.org/doc/essays/packages.html for more details, also about how Modified: python/trunk/Doc/tutorial/classes.rst ============================================================================== --- python/trunk/Doc/tutorial/classes.rst (original) +++ python/trunk/Doc/tutorial/classes.rst Sat Jan 3 21:55:06 2009 @@ -250,7 +250,7 @@ ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -481,7 +481,7 @@ ``issubclass(unicode, str)`` is ``False`` since :class:`unicode` is not a subclass of :class:`str` (they only share a common ancestor, :class:`basestring`). - + .. _tut-multiple: @@ -743,7 +743,7 @@ f l o - g + g Anything that can be done with generators can also be done with class based iterators as described in the previous section. What makes generators so Modified: python/trunk/Doc/tutorial/controlflow.rst ============================================================================== --- python/trunk/Doc/tutorial/controlflow.rst (original) +++ python/trunk/Doc/tutorial/controlflow.rst Sat Jan 3 21:55:06 2009 @@ -62,7 +62,7 @@ ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print x, len(x) - ... + ... cat 3 window 6 defenestrate 12 @@ -75,7 +75,7 @@ >>> for x in a[:]: # make a slice copy of the entire list ... if len(x) > 6: a.insert(0, x) - ... + ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] @@ -110,7 +110,7 @@ >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print i, a[i] - ... + ... 0 Mary 1 had 2 a @@ -146,7 +146,7 @@ ... else: ... # loop fell through without finding a factor ... print n, 'is a prime number' - ... + ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 @@ -167,7 +167,7 @@ >>> while True: ... pass # Busy-wait for keyboard interrupt (Ctrl+C) - ... + ... This is commonly used for creating minimal classes:: @@ -181,7 +181,7 @@ >>> def initlog(*args): ... pass # Remember to implement this! - ... + ... .. _tut-functions: @@ -197,7 +197,7 @@ ... while b < n: ... print b, ... a, b = b, a+b - ... + ... >>> # Now call the function we just defined: ... fib(2000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 @@ -268,7 +268,7 @@ ... result.append(b) # see below ... a, b = b, a+b ... return result - ... + ... >>> f100 = fib2(100) # call it >>> f100 # write the result [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -403,7 +403,7 @@ >>> def function(a): ... pass - ... + ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in ? @@ -456,7 +456,7 @@ ------------------------ .. index:: - statement: * + statement: * Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -565,11 +565,11 @@ >>> def my_function(): ... """Do nothing, but document it. - ... + ... ... No, really, it doesn't do anything. ... """ ... pass - ... + ... >>> print my_function.__doc__ Do nothing, but document it. Modified: python/trunk/Doc/tutorial/datastructures.rst ============================================================================== --- python/trunk/Doc/tutorial/datastructures.rst (original) +++ python/trunk/Doc/tutorial/datastructures.rst Sat Jan 3 21:55:06 2009 @@ -214,7 +214,7 @@ >>> def sum(seq): ... def add(x,y): return x+y ... return reduce(add, seq, 0) - ... + ... >>> sum(range(1, 11)) 55 >>> sum([]) @@ -281,7 +281,7 @@ powerful tool but -- like all powerful tools -- they need to be used carefully, if at all. -Consider the following example of a 3x3 matrix held as a list containing three +Consider the following example of a 3x3 matrix held as a list containing three lists, one list per row:: >>> mat = [ @@ -290,7 +290,7 @@ ... [7, 8, 9], ... ] -Now, if you wanted to swap rows and columns, you could use a list +Now, if you wanted to swap rows and columns, you could use a list comprehension:: >>> print [[row[i] for row in mat] for i in [0, 1, 2]] @@ -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 builtin functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> zip(*mat) @@ -551,7 +551,7 @@ >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print 'What is your {0}? It is {1}.'.format(q, a) - ... + ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. @@ -574,7 +574,7 @@ >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print f - ... + ... apple banana orange Modified: python/trunk/Doc/tutorial/errors.rst ============================================================================== --- python/trunk/Doc/tutorial/errors.rst (original) +++ python/trunk/Doc/tutorial/errors.rst Sat Jan 3 21:55:06 2009 @@ -91,7 +91,7 @@ ... break ... except ValueError: ... print "Oops! That was no valid number. Try again..." - ... + ... The :keyword:`try` statement works as follows. @@ -199,12 +199,12 @@ >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as detail: ... print 'Handling run-time error:', detail - ... + ... Handling run-time error: integer division or modulo by zero @@ -256,12 +256,12 @@ ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print 'My exception occurred, value:', e.value - ... + ... My exception occurred, value: 4 >>> raise MyError, 'oops!' Traceback (most recent call last): @@ -331,7 +331,7 @@ ... raise KeyboardInterrupt ... finally: ... print 'Goodbye, world!' - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? Modified: python/trunk/Doc/tutorial/index.rst ============================================================================== --- python/trunk/Doc/tutorial/index.rst (original) +++ python/trunk/Doc/tutorial/index.rst Sat Jan 3 21:55:06 2009 @@ -1,7 +1,7 @@ .. _tutorial-index: ###################### - The Python Tutorial + The Python Tutorial ###################### :Release: |version| Modified: python/trunk/Doc/tutorial/inputoutput.rst ============================================================================== --- python/trunk/Doc/tutorial/inputoutput.rst (original) +++ python/trunk/Doc/tutorial/inputoutput.rst Sat Jan 3 21:55:06 2009 @@ -87,7 +87,7 @@ >>> for x in range(1,11): ... print '{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x) - ... + ... 1 1 1 2 4 8 3 9 27 @@ -162,7 +162,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): ... print '{0:10} ==> {1:10d}'.format(name, phone) - ... + ... Jack ==> 4098 Dcab ==> 7678 Sjoerd ==> 4127 @@ -330,7 +330,7 @@ >>> f = open('/tmp/workfile', 'r+') >>> f.write('0123456789abcdef') >>> f.seek(5) # Go to the 6th byte in the file - >>> f.read(1) + >>> f.read(1) '5' >>> f.seek(-3, 2) # Go to the 3rd byte before the end >>> f.read(1) Modified: python/trunk/Doc/tutorial/interpreter.rst ============================================================================== --- python/trunk/Doc/tutorial/interpreter.rst (original) +++ python/trunk/Doc/tutorial/interpreter.rst Sat Jan 3 21:55:06 2009 @@ -112,7 +112,7 @@ >>> the_world_is_flat = 1 >>> if the_world_is_flat: ... print "Be careful not to fall off!" - ... + ... Be careful not to fall off! @@ -180,7 +180,7 @@ best way to do it is to put one more special comment line right after the ``#!`` line to define the source file encoding:: - # -*- coding: encoding -*- + # -*- coding: encoding -*- With that declaration, all characters in the source file will be treated as Modified: python/trunk/Doc/tutorial/introduction.rst ============================================================================== --- python/trunk/Doc/tutorial/introduction.rst (original) +++ python/trunk/Doc/tutorial/introduction.rst Sat Jan 3 21:55:06 2009 @@ -84,7 +84,7 @@ >>> # try to access an undefined variable ... n - Traceback (most recent call last): + Traceback (most recent call last): File "", line 1, in NameError: name 'n' is not defined @@ -219,14 +219,14 @@ they will be included in the string. :: print """ - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """ produces the following output:: - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to @@ -350,10 +350,10 @@ Then the right edge of the last character of a string of *n* characters has index *n*, for example:: - +---+---+---+---+---+ + +---+---+---+---+---+ | H | e | l | p | A | - +---+---+---+---+---+ - 0 1 2 3 4 5 + +---+---+---+---+---+ + 0 1 2 3 4 5 -5 -4 -3 -2 -1 The first row of numbers gives the position of the indices 0...5 in the string; @@ -595,7 +595,7 @@ >>> while b < 10: ... print b ... a, b = b, a+b - ... + ... 1 1 2 @@ -645,7 +645,7 @@ >>> while b < 1000: ... print b, ... a, b = b, a+b - ... + ... 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Note that the interpreter inserts a newline before it prints the next prompt if Modified: python/trunk/Doc/tutorial/modules.rst ============================================================================== --- python/trunk/Doc/tutorial/modules.rst (original) +++ python/trunk/Doc/tutorial/modules.rst Sat Jan 3 21:55:06 2009 @@ -281,7 +281,7 @@ ['__name__', 'fib', 'fib2'] >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', + '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'callstats', 'copyright', 'displayhook', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', @@ -314,7 +314,7 @@ 'FloatingPointError', 'FutureWarning', 'IOError', 'ImportError', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImplemented', - 'NotImplementedError', 'OSError', 'OverflowError', + 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', Modified: python/trunk/Doc/tutorial/stdlib.rst ============================================================================== --- python/trunk/Doc/tutorial/stdlib.rst (original) +++ python/trunk/Doc/tutorial/stdlib.rst Sat Jan 3 21:55:06 2009 @@ -136,7 +136,7 @@ >>> random.random() # random float 0.17970987693706186 >>> random.randrange(6) # random integer chosen from range(6) - 4 + 4 .. _tut-internet-access: Modified: python/trunk/Doc/tutorial/whatnow.rst ============================================================================== --- python/trunk/Doc/tutorial/whatnow.rst (original) +++ python/trunk/Doc/tutorial/whatnow.rst Sat Jan 3 21:55:06 2009 @@ -63,6 +63,6 @@ .. Postings figure based on average of last six months activity as reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182 - days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) + days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) Modified: python/trunk/Doc/using/cmdline.rst ============================================================================== --- python/trunk/Doc/using/cmdline.rst (original) +++ python/trunk/Doc/using/cmdline.rst Sat Jan 3 21:55:06 2009 @@ -8,8 +8,8 @@ The CPython interpreter scans the command line and the environment for various settings. -.. note:: - +.. note:: + Other implementations' command line schemes may differ. See :ref:`implementations` for further resources. @@ -61,7 +61,7 @@ Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code. - + If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top @@ -72,7 +72,7 @@ Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module. - + Since the argument is a *module* name, you must not give a file extension (``.py``). The ``module-name`` should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to @@ -84,18 +84,18 @@ written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available. - + If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. - + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details - .. seealso:: + .. seealso:: :func:`runpy.run_module` The actual implementation of this feature. @@ -163,7 +163,7 @@ --version Print the Python version number and exit. Example output could be:: - + Python 2.5.1 .. versionchanged:: 2.5 @@ -201,7 +201,7 @@ enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal. The :envvar:`PYTHONSTARTUP` file is not read. - + This can be useful to inspect global variables or a stack trace when a script raises an exception. See also :envvar:`PYTHONINSPECT`. @@ -221,7 +221,7 @@ .. cmdoption:: -Q Division control. The argument must be one of the following: - + ``old`` division of int/int and long/long return an int or long (*default*) ``new`` @@ -264,10 +264,10 @@ .. cmdoption:: -u - + Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. - + Note that there is internal buffering in :meth:`file.readlines` and :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced by this option. To work around this, you will want to use @@ -279,7 +279,7 @@ .. XXX should the -U option be documented? .. cmdoption:: -v - + Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (:option:`-vv`), print a message for each file that is checked for when @@ -288,13 +288,13 @@ .. cmdoption:: -W arg - + Warning control. Python's warning machinery by default prints warning messages to :data:`sys.stderr`. A typical warning message has the following form:: file:line: category: message - + By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. @@ -302,13 +302,13 @@ one option, the action for the last matching option is performed. Invalid :option:`-W` options are ignored (though, a warning message is printed about invalid options when the first warning is issued). - + Warnings can also be controlled from within a Python program using the :mod:`warnings` module. The simplest form of argument is one of the following action strings (or a unique abbreviation): - + ``ignore`` Ignore all warnings. ``default`` @@ -324,9 +324,9 @@ Print each warning only the first time it occurs in the program. ``error`` Raise an exception instead of printing a warning message. - - The full form of argument is:: - + + The full form of argument is:: + action:message:category:module:line Here, *action* is as explained above but only applies to messages that match @@ -347,10 +347,10 @@ .. cmdoption:: -x - + Skip the first line of the source, allowing use of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only. - + .. warning:: The line numbers in error messages will be off by one! @@ -380,13 +380,13 @@ These environment variables influence Python's behavior. .. envvar:: PYTHONHOME - + Change the location of the standard Python libraries. By default, the libraries are searched in :file:`{prefix}/lib/python{version}` and :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and :file:`{exec_prefix}` are installation-dependent directories, both defaulting to :file:`/usr/local`. - + When :envvar:`PYTHONHOME` is set to a single directory, its value replaces both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`. @@ -402,11 +402,11 @@ In addition to normal directories, individual :envvar:`PYTHONPATH` entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. - + The default search path is installation dependent, but generally begins with :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. - + An additional directory will be inserted in the search path in front of :envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-options`. The search path can be manipulated from @@ -414,7 +414,7 @@ .. envvar:: PYTHONSTARTUP - + If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so @@ -424,7 +424,7 @@ .. envvar:: PYTHONY2K - + Set this to a non-empty string to cause the :mod:`time` module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the :mod:`time` module @@ -432,21 +432,21 @@ .. envvar:: PYTHONOPTIMIZE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-O` option. If set to an integer, it is equivalent to specifying :option:`-O` multiple times. .. envvar:: PYTHONDEBUG - + If this is set to a non-empty string it is equivalent to specifying the :option:`-d` option. If set to an integer, it is equivalent to specifying :option:`-d` multiple times. .. envvar:: PYTHONINSPECT - + If this is set to a non-empty string it is equivalent to specifying the :option:`-i` option. @@ -455,20 +455,20 @@ .. envvar:: PYTHONUNBUFFERED - + If this is set to a non-empty string it is equivalent to specifying the :option:`-u` option. .. envvar:: PYTHONVERBOSE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-v` option. If set to an integer, it is equivalent to specifying :option:`-v` multiple times. .. envvar:: PYTHONCASEOK - + If this is set, Python ignores case in :keyword:`import` statements. This only works on Windows. Modified: python/trunk/Doc/using/unix.rst ============================================================================== --- python/trunk/Doc/using/unix.rst (original) +++ python/trunk/Doc/using/unix.rst Sat Jan 3 21:55:06 2009 @@ -19,7 +19,7 @@ package on all others. However there are certain features you might want to use that are not available on your distro's package. You can easily compile the latest version of Python from source. - + In the event that Python doesn't come preinstalled and isn't in the repositories as well, you can easily make packages for your own distro. Have a look at the following links: @@ -45,8 +45,8 @@ * OpenBSD users use:: - pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz - + pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz + For example i386 users get the 2.5.1 version of Python using:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz @@ -87,7 +87,7 @@ Python-related paths and files ============================== - + These are subject to difference depending on local installation conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``) are installation-dependent and should be interpreted as for GNU software; they @@ -112,7 +112,7 @@ | | by the user module; not used by default | | | or by most applications. | +-----------------------------------------------+------------------------------------------+ - + Miscellaneous ============= Modified: python/trunk/Doc/using/windows.rst ============================================================================== --- python/trunk/Doc/using/windows.rst (original) +++ python/trunk/Doc/using/windows.rst Sat Jan 3 21:55:06 2009 @@ -88,9 +88,9 @@ --------------------------------------- Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab +guide applies to XP classical view): Right-click the icon for your machine +(usually located on your Desktop and called "My Computer") and choose +:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab and click the :guilabel:`Environment Variables` button. In short, your path is: @@ -193,11 +193,11 @@ #. Launch a command prompt. #. Associate the correct file group with ``.py`` scripts:: - + assoc .py=Python.File #. Redirect all Python files to the new executable:: - + ftype Python.File=C:\Path\to\pythonw.exe "%1" %* Modified: python/trunk/Doc/whatsnew/2.0.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.0.rst (original) +++ python/trunk/Doc/whatsnew/2.0.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.0 + What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka @@ -277,9 +277,9 @@ finding all the strings in the list containing a given substring. You could write the following to do it:: - # Given the list L, make a list of all strings + # Given the list L, make a list of all strings # containing the substring S. - sublist = filter( lambda s, substring=S: + sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, L) @@ -291,7 +291,7 @@ List comprehensions have the form:: - [ expression for expr in sequence1 + [ expression for expr in sequence1 for expr2 in sequence2 ... for exprN in sequenceN if condition ] @@ -312,8 +312,8 @@ ... for exprN in sequenceN: if (condition): - # Append the value of - # the expression to the + # Append the value of + # the expression to the # resulting list. This means that when there are multiple :keyword:`for`...\ :keyword:`in` @@ -590,7 +590,7 @@ def f(): print "i=",i - i = i + 1 + i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been @@ -627,7 +627,7 @@ the following lines of code:: if dict.has_key( key ): return dict[key] - else: + else: dict[key] = [] return dict[key] @@ -836,14 +836,14 @@ :file:`setup.py` can be just a few lines long:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:`setup.py` file isn't much more complicated if the software consists of a few packages:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", packages = ["package", "package.subpackage"]) A C extension can be the most complicated case; here's an example taken from @@ -860,7 +860,7 @@ 'extensions/expat/xmltok/xmlrole.c', ] ) - setup (name = "PyXML", version = "0.5.4", + setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) The Distutils can also take care of creating source and binary distributions. Modified: python/trunk/Doc/whatsnew/2.1.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.1.rst (original) +++ python/trunk/Doc/whatsnew/2.1.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.1 + What's New in Python 2.1 **************************** :Author: A.M. Kuchling @@ -98,7 +98,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x Modified: python/trunk/Doc/whatsnew/2.2.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.2.rst (original) +++ python/trunk/Doc/whatsnew/2.2.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.2 + What's New in Python 2.2 **************************** :Author: A.M. Kuchling @@ -473,7 +473,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it expects something for which :func:`iter` will return an iterator. For backward @@ -909,7 +909,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x @@ -952,8 +952,8 @@ items = s.meerkat.getItems( {'channel': 4} ) # 'items' is another list of dictionaries, like this: - # [{'link': 'http://freshmeat.net/releases/52719/', - # 'description': 'A utility which converts HTML to XSL FO.', + # [{'link': 'http://freshmeat.net/releases/52719/', + # 'description': 'A utility which converts HTML to XSL FO.', # 'title': 'html2fo 0.3 (Default)'}, ... ] The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward Modified: python/trunk/Doc/whatsnew/2.3.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.3.rst (original) +++ python/trunk/Doc/whatsnew/2.3.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.3 + What's New in Python 2.3 **************************** :Author: A.M. Kuchling @@ -301,7 +301,7 @@ -------- ------- 8467 1 file amk at nyman:~/src/python$ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading @@ -671,7 +671,7 @@ # ... } - if (hasattr(core, 'setup_keywords') and + if (hasattr(core, 'setup_keywords') and 'classifiers' in core.setup_keywords): kw['classifiers'] = \ ['Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -1027,7 +1027,7 @@ creating small dictionaries:: >>> dict(red=1, blue=2, green=3, black=4) - {'blue': 2, 'black': 4, 'green': 3, 'red': 1} + {'blue': 2, 'black': 4, 'green': 3, 'red': 1} (Contributed by Just van Rossum.) @@ -1622,7 +1622,7 @@ ... self.valuelist.pop(i) ... def keys(self): ... return list(self.keylist) - ... + ... >>> s = SeqDict() >>> dir(s) # See that other dictionary methods are implemented ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__', @@ -1779,7 +1779,7 @@ set input filename -lLENGTH, --length=LENGTH set maximum length of output - $ + $ See the module's documentation for more details. Modified: python/trunk/Doc/whatsnew/2.4.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.4.rst (original) +++ python/trunk/Doc/whatsnew/2.4.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.4 + What's New in Python 2.4 **************************** :Author: A.M. Kuchling @@ -63,10 +63,10 @@ >>> a.add('z') # add a new element >>> a.update('wxy') # add multiple new elements >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) >>> a.remove('x') # take one element out >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) The :func:`frozenset` type is an immutable version of :func:`set`. Since it is immutable and hashable, it may be used as a dictionary key or as a member of @@ -351,7 +351,7 @@ >>> for i in reversed(xrange(1,4)): ... print i - ... + ... 3 2 1 @@ -366,7 +366,7 @@ >>> input = open('/etc/passwd', 'r') >>> for line in reversed(list(input)): ... print line - ... + ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... @@ -650,7 +650,7 @@ 28 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.1428571428571428571428571429") - >>> decimal.getcontext().prec = 9 + >>> decimal.getcontext().prec = 9 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.142857143") @@ -665,7 +665,7 @@ >>> decimal.getcontext().traps[decimal.DivisionByZero] = False >>> decimal.Decimal(1) / decimal.Decimal(0) Decimal("Infinity") - >>> + >>> The :class:`Context` instance also has various methods for formatting numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`. @@ -803,7 +803,7 @@ >>> 'www.python.org'.split('.', 1) ['www', 'python.org'] 'www.python.org'.rsplit('.', 1) - ['www.python', 'org'] + ['www.python', 'org'] * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :meth:`sort` method of lists. These parameters make some common usages of @@ -1045,7 +1045,7 @@ >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque - True + True Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take advantage of :class:`collections.deque` for improved performance. (Contributed @@ -1106,13 +1106,13 @@ >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14] >>> for key_val, it in itertools.groupby(L, lambda x: x % 2): ... print key_val, list(it) - ... + ... 0 [2, 4, 6] 1 [7] 0 [8] 1 [9, 11] 0 [12, 14] - >>> + >>> :func:`groupby` is typically used with sorted input. The logic for :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for @@ -1120,21 +1120,21 @@ >>> word = 'abracadabra' >>> letters = sorted(word) # Turn string into a sorted list of letters - >>> letters + >>> letters ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r'] >>> for k, g in itertools.groupby(letters): ... print k, list(g) - ... + ... a ['a', 'a', 'a', 'a', 'a'] b ['b', 'b'] c ['c'] d ['d'] r ['r', 'r'] >>> # List unique letters - >>> [k for k, g in groupby(letters)] + >>> [k for k, g in groupby(letters)] ['a', 'b', 'c', 'd', 'r'] >>> # Count letter occurrences - >>> [(k, len(list(g))) for k, g in groupby(letters)] + >>> [(k, len(list(g))) for k, g in groupby(letters)] [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)] (Contributed by Hye-Shik Chang.) @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that Modified: python/trunk/Doc/whatsnew/2.5.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.5.rst (original) +++ python/trunk/Doc/whatsnew/2.5.rst Sat Jan 3 21:55:06 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.5 + What's New in Python 2.5 **************************** :Author: A.M. Kuchling @@ -220,7 +220,7 @@ required packages. :: VERSION = '1.0' - setup(name='PyPackage', + setup(name='PyPackage', version=VERSION, requires=['numarray', 'zlib (>=1.1.4)'], obsoletes=['OldPackage'] @@ -388,7 +388,7 @@ else: else-block finally: - final-block + final-block The code in *block-1* is executed. If the code raises an exception, the various :keyword:`except` blocks are tested: if the exception is of class @@ -835,8 +835,8 @@ ... except (KeyboardInterrupt, SystemExit): raise - except: - # Log error... + except: + # Log error... # Continue running program... In Python 2.5, you can now write ``except Exception`` to achieve the same @@ -947,7 +947,7 @@ class C: def __index__ (self): - return self.value + return self.value The return value must be either a Python integer or long integer. The interpreter will check that the type returned is correct, and raises a @@ -1035,9 +1035,9 @@ L = ['medium', 'longest', 'short'] # Prints 'longest' - print max(L, key=len) + print max(L, key=len) # Prints 'short', because lexicographically 'short' has the largest value - print max(L) + print max(L) (Contributed by Steven Bethard and Raymond Hettinger.) @@ -1070,8 +1070,8 @@ using the default ASCII encoding. The result of the comparison is false:: >>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode - __main__:1: UnicodeWarning: Unicode equal comparison failed - to convert both arguments to Unicode - interpreting them + __main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them as being unequal False >>> chr(127) == unichr(127) # chr(127) can be converted @@ -1259,10 +1259,10 @@ Printing ``index`` results in the following output:: - defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], - 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], - 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], - 'p': ['per'], 's': ['selva', 'smarrita'], + defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], + 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], + 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], + 'p': ['per'], 's': ['selva', 'smarrita'], 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} (Contributed by Guido van Rossum.) @@ -1884,17 +1884,17 @@ differently. :: # Old versions - h = md5.md5() - h = md5.new() + h = md5.md5() + h = md5.new() - # New version + # New version h = hashlib.md5() # Old versions - h = sha.sha() - h = sha.new() + h = sha.sha() + h = sha.new() - # New version + # New version h = hashlib.sha1() # Hash that weren't previously available @@ -2191,7 +2191,7 @@ case that your extensions were using it, you can replace it by something like the following:: - range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", + range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", start, stop, step); .. ====================================================================== Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Sat Jan 3 21:55:06 2009 @@ -744,7 +744,7 @@ >>> import sys >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) Platform: darwin - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' >>> import mimetypes @@ -958,8 +958,8 @@ The primary use of :class:`bytes` in 2.6 will be to write tests of object type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, which can't tell whether 2.x code intends strings to -contain either characters or 8-bit bytes; you can now -use either :class:`bytes` or :class:`str` to represent your intention +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention exactly, and the resulting code will also be correct in Python 3.0. There's also a ``__future__`` import that causes all string literals @@ -1834,9 +1834,9 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) - The :func:`parse_qs` and :func:`parse_qsl` functions have been + The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated from the :mod:`cgi` module to the :mod:`urlparse` module. - The versions still available in the :mod:`cgi` module will + The versions still available in the :mod:`cgi` module will trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`). @@ -1931,7 +1931,7 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) - + :: # Boldface text starting at y=0,x=21 @@ -2428,9 +2428,9 @@ :issue:`742598`, :issue:`1193577`.) * The :mod:`sqlite3` module, maintained by Gerhard Haering, - has been updated from version 2.3.2 in Python 2.5 to + has been updated from version 2.3.2 in Python 2.5 to version 2.4.1. - + * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type, using the format character ``'?'``. (Contributed by David Remahl.) @@ -2525,9 +2525,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module gained a number - of context managers useful for writing tests. - :func:`EnvironmentVarGuard` is a +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2542,7 +2542,7 @@ f = urllib.urlopen('https://sf.net') ... - Finally, :func:`check_warnings` resets the :mod:`warning` module's + Finally, :func:`check_warnings` resets the :mod:`warning` module's warning filters and returns an object that will record all warning messages triggered (:issue:`3781`):: @@ -2582,7 +2582,7 @@ :meth:`activeCount` method is renamed to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module support the same properties and renamed methods, but don't remove the old methods. No date has been set - for the deprecation of the old APIs in Python 3.x; the old APIs won't + for the deprecation of the old APIs in Python 3.x; the old APIs won't be removed in any 2.x version. (Carried out by several people, most notably Benjamin Peterson.) @@ -2639,7 +2639,7 @@ (Added by Facundo Batista.) * The Unicode database provided by the :mod:`unicodedata` module - has been updated to version 5.1.0. (Updated by + has been updated to version 5.1.0. (Updated by Martin von Loewis; :issue:`3811`.) * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` @@ -2650,7 +2650,7 @@ A new function, :func:`catch_warnings`, is a context manager intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). - + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` @@ -3220,8 +3220,8 @@ * :meth:`object.__init__` previously accepted arbitrary arguments and keyword arguments, ignoring them. In Python 2.6, this is no longer - allowed and will result in a :exc:`TypeError`. This will affect - :meth:`__init__` methods that end up calling the corresponding + allowed and will result in a :exc:`TypeError`. This will affect + :meth:`__init__` methods that end up calling the corresponding method on :class:`object` (perhaps through using :func:`super`). See :issue:`1683368` for discussion. @@ -3281,7 +3281,7 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, -Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner. From python-checkins at python.org Sat Jan 3 22:04:56 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:04:56 +0100 (CET) Subject: [Python-checkins] r68221 - in python/trunk/Doc: extending/newtypes.rst howto/curses.rst howto/regex.rst howto/sockets.rst howto/unicode.rst library/abc.rst library/collections.rst library/gettext.rst library/multiprocessing.rst library/optparse.rst library/sched.rst library/socket.rst library/xmlrpclib.rst license.rst tutorial/datastructures.rst tutorial/stdlib2.rst whatsnew/2.0.rst whatsnew/2.2.rst whatsnew/2.4.rst whatsnew/2.6.rst Message-ID: <20090103210456.D4E331E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:04:55 2009 New Revision: 68221 Log: Remove tabs from the documentation. Modified: python/trunk/Doc/extending/newtypes.rst python/trunk/Doc/howto/curses.rst python/trunk/Doc/howto/regex.rst python/trunk/Doc/howto/sockets.rst python/trunk/Doc/howto/unicode.rst python/trunk/Doc/library/abc.rst python/trunk/Doc/library/collections.rst python/trunk/Doc/library/gettext.rst python/trunk/Doc/library/multiprocessing.rst python/trunk/Doc/library/optparse.rst python/trunk/Doc/library/sched.rst python/trunk/Doc/library/socket.rst python/trunk/Doc/library/xmlrpclib.rst python/trunk/Doc/license.rst python/trunk/Doc/tutorial/datastructures.rst python/trunk/Doc/tutorial/stdlib2.rst python/trunk/Doc/whatsnew/2.0.rst python/trunk/Doc/whatsnew/2.2.rst python/trunk/Doc/whatsnew/2.4.rst python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/extending/newtypes.rst ============================================================================== --- python/trunk/Doc/extending/newtypes.rst (original) +++ python/trunk/Doc/extending/newtypes.rst Sat Jan 3 22:04:55 2009 @@ -840,8 +840,8 @@ previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -854,10 +854,10 @@ static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -876,18 +876,18 @@ PyMODINIT_FUNC initshoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return; - - m = Py_InitModule3("shoddy", NULL, "Shoddy module"); - if (m == NULL) - return; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return; + + m = Py_InitModule3("shoddy", NULL, "Shoddy module"); + if (m == NULL) + return; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1167,7 +1167,7 @@ typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; Modified: python/trunk/Doc/howto/curses.rst ============================================================================== --- python/trunk/Doc/howto/curses.rst (original) +++ python/trunk/Doc/howto/curses.rst Sat Jan 3 22:04:55 2009 @@ -297,7 +297,7 @@ could code:: stdscr.addstr(0, 0, "Current mode: Typing mode", - curses.A_REVERSE) + curses.A_REVERSE) stdscr.refresh() The curses library also supports color on those terminals that provide it, The Modified: python/trunk/Doc/howto/regex.rst ============================================================================== --- python/trunk/Doc/howto/regex.rst (original) +++ python/trunk/Doc/howto/regex.rst Sat Jan 3 22:04:55 2009 @@ -917,7 +917,7 @@ InternalDate = re.compile(r'INTERNALDATE "' r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-' - r'(?P[0-9][0-9][0-9][0-9])' + r'(?P[0-9][0-9][0-9][0-9])' r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])' r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])' r'"') Modified: python/trunk/Doc/howto/sockets.rst ============================================================================== --- python/trunk/Doc/howto/sockets.rst (original) +++ python/trunk/Doc/howto/sockets.rst Sat Jan 3 22:04:55 2009 @@ -190,33 +190,33 @@ ''' def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock def connect(self, host, port): - self.sock.connect((host, port)) + self.sock.connect((host, port)) def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError, \ - "socket connection broken" - totalsent = totalsent + sent + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError, \ + "socket connection broken" + totalsent = totalsent + sent def myreceive(self): - msg = '' - while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError, \ - "socket connection broken" - msg = msg + chunk - return msg + msg = '' + while len(msg) < MSGLEN: + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError, \ + "socket connection broken" + msg = msg + chunk + return msg The sending code here is usable for almost any messaging scheme - in Python you send strings, and you can use ``len()`` to determine its length (even if it has Modified: python/trunk/Doc/howto/unicode.rst ============================================================================== --- python/trunk/Doc/howto/unicode.rst (original) +++ python/trunk/Doc/howto/unicode.rst Sat Jan 3 22:04:55 2009 @@ -30,8 +30,8 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHIER EST COMPLETE." - PRINT "CARACTERE NON ACCEPTE." + PRINT "FICHIER EST COMPLETE." + PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who can read French. @@ -89,11 +89,11 @@ character with value 0x12ca (4810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:: - 0061 'a'; LATIN SMALL LETTER A - 0062 'b'; LATIN SMALL LETTER B - 0063 'c'; LATIN SMALL LETTER C - ... - 007B '{'; LEFT CURLY BRACKET + 0061 'a'; LATIN SMALL LETTER A + 0062 'b'; LATIN SMALL LETTER B + 0063 'c'; LATIN SMALL LETTER C + ... + 007B '{'; LEFT CURLY BRACKET Strictly, these definitions imply that it's meaningless to say 'this is character U+12ca'. U+12ca is a code point, which represents some particular @@ -597,19 +597,19 @@ path will return the 8-bit versions of the filenames. For example, assuming the default filesystem encoding is UTF-8, running the following program:: - fn = u'filename\u4500abc' - f = open(fn, 'w') - f.close() - - import os - print os.listdir('.') - print os.listdir(u'.') + fn = u'filename\u4500abc' + f = open(fn, 'w') + f.close() + + import os + print os.listdir('.') + print os.listdir(u'.') will produce the following output:: - amk:~$ python t.py - ['.svn', 'filename\xe4\x94\x80abc', ...] - [u'.svn', u'filename\u4500abc', ...] + amk:~$ python t.py + ['.svn', 'filename\xe4\x94\x80abc', ...] + [u'.svn', u'filename\u4500abc', ...] The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions. @@ -703,26 +703,26 @@ - [ ] Unicode introduction - [ ] ASCII - [ ] Terms - - [ ] Character - - [ ] Code point - - [ ] Encodings - - [ ] Common encodings: ASCII, Latin-1, UTF-8 + - [ ] Character + - [ ] Code point + - [ ] Encodings + - [ ] Common encodings: ASCII, Latin-1, UTF-8 - [ ] Unicode Python type - - [ ] Writing unicode literals - - [ ] Obscurity: -U switch - - [ ] Built-ins - - [ ] unichr() - - [ ] ord() - - [ ] unicode() constructor - - [ ] Unicode type - - [ ] encode(), decode() methods + - [ ] Writing unicode literals + - [ ] Obscurity: -U switch + - [ ] Built-ins + - [ ] unichr() + - [ ] ord() + - [ ] unicode() constructor + - [ ] Unicode type + - [ ] encode(), decode() methods - [ ] Unicodedata module for character properties - [ ] I/O - - [ ] Reading/writing Unicode data into files - - [ ] Byte-order marks - - [ ] Unicode filenames + - [ ] Reading/writing Unicode data into files + - [ ] Byte-order marks + - [ ] Unicode filenames - [ ] Writing Unicode programs - - [ ] Do everything in Unicode - - [ ] Declaring source code encodings (PEP 263) + - [ ] Do everything in Unicode + - [ ] Declaring source code encodings (PEP 263) - [ ] Other issues - - [ ] Building Python (UCS2, UCS4) + - [ ] Building Python (UCS2, UCS4) Modified: python/trunk/Doc/library/abc.rst ============================================================================== --- python/trunk/Doc/library/abc.rst (original) +++ python/trunk/Doc/library/abc.rst Sat Jan 3 22:04:55 2009 @@ -43,15 +43,15 @@ Register *subclass* as a "virtual subclass" of this ABC. For example:: - from abc import ABCMeta + from abc import ABCMeta - class MyABC: - __metaclass__ = ABCMeta + class MyABC: + __metaclass__ = ABCMeta - MyABC.register(tuple) + MyABC.register(tuple) - assert issubclass(tuple, MyABC) - assert isinstance((), MyABC) + assert issubclass(tuple, MyABC) + assert isinstance((), MyABC) You can also override this method in an abstract base class: Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Sat Jan 3 22:04:55 2009 @@ -53,7 +53,7 @@ :class:`Hashable` ``__hash__`` :class:`Iterable` ``__iter__`` :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` -:class:`Sized` ``__len__`` +:class:`Sized` ``__len__`` :class:`Callable` ``__call__`` :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. @@ -80,7 +80,7 @@ :class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and ``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``, ``__delitem__``, and ``setdefault`` - ``__iter__``, and + ``__iter__``, and ``__len__`` :class:`MappingView` :class:`Sized` ``__len__`` @@ -96,7 +96,7 @@ size = None if isinstance(myvar, collections.Sized): - size = len(myvar) + size = len(myvar) Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting Modified: python/trunk/Doc/library/gettext.rst ============================================================================== --- python/trunk/Doc/library/gettext.rst (original) +++ python/trunk/Doc/library/gettext.rst Sat Jan 3 22:04:55 2009 @@ -648,10 +648,9 @@ animals = ['mollusk', 'albatross', - 'rat', - 'penguin', - 'python', - ] + 'rat', + 'penguin', + 'python', ] # ... for a in animals: print a @@ -666,10 +665,9 @@ animals = [_('mollusk'), _('albatross'), - _('rat'), - _('penguin'), - _('python'), - ] + _('rat'), + _('penguin'), + _('python'), ] del _ @@ -692,10 +690,9 @@ animals = [N_('mollusk'), N_('albatross'), - N_('rat'), - N_('penguin'), - N_('python'), - ] + N_('rat'), + N_('penguin'), + N_('python'), ] # ... for a in animals: Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Sat Jan 3 22:04:55 2009 @@ -37,7 +37,7 @@ >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): - ... return x*x + ... return x*x ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Modified: python/trunk/Doc/library/optparse.rst ============================================================================== --- python/trunk/Doc/library/optparse.rst (original) +++ python/trunk/Doc/library/optparse.rst Sat Jan 3 22:04:55 2009 @@ -548,8 +548,8 @@ :class:`OptionGroup` to a parser is easy:: group = OptionGroup(parser, "Dangerous Options", - "Caution: use these options at your own risk. " - "It is believed that some of them bite.") + "Caution: use these options at your own risk. " + "It is believed that some of them bite.") group.add_option("-g", action="store_true", help="Group option.") parser.add_option_group(group) @@ -563,12 +563,12 @@ -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --file=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' - [default], 'expert' + [default], 'expert' Dangerous Options: - Caution: use of these options is at your own risk. It is believed that - some of them bite. - -g Group option. + Caution: use of these options is at your own risk. It is believed that + some of them bite. + -g Group option. .. _optparse-printing-version-string: Modified: python/trunk/Doc/library/sched.rst ============================================================================== --- python/trunk/Doc/library/sched.rst (original) +++ python/trunk/Doc/library/sched.rst Sat Jan 3 22:04:55 2009 @@ -58,7 +58,7 @@ ... print time.time() ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() - ... time.sleep(11) # sleep while time-delay events execute + ... time.sleep(11) # sleep while time-delay events execute ... print time.time() ... >>> print_some_times() Modified: python/trunk/Doc/library/socket.rst ============================================================================== --- python/trunk/Doc/library/socket.rst (original) +++ python/trunk/Doc/library/socket.rst Sat Jan 3 22:04:55 2009 @@ -852,20 +852,21 @@ HOST = None # Symbolic name meaning all available interfaces PORT = 50007 # Arbitrary non-privileged port s = None - for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE): + for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, + socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error, msg: - s = None - continue + s = None + continue try: - s.bind(sa) - s.listen(1) + s.bind(sa) + s.listen(1) except socket.error, msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print 'could not open socket' @@ -890,16 +891,16 @@ for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error, msg: - s = None - continue + s = None + continue try: - s.connect(sa) + s.connect(sa) except socket.error, msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print 'could not open socket' Modified: python/trunk/Doc/library/xmlrpclib.rst ============================================================================== --- python/trunk/Doc/library/xmlrpclib.rst (original) +++ python/trunk/Doc/library/xmlrpclib.rst Sat Jan 3 22:04:55 2009 @@ -560,8 +560,8 @@ self.proxy = proxy def make_connection(self, host): self.realhost = host - h = httplib.HTTP(self.proxy) - return h + h = httplib.HTTP(self.proxy) + return h def send_request(self, connection, handler, request_body): connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) def send_host(self, connection, host): Modified: python/trunk/Doc/license.rst ============================================================================== --- python/trunk/Doc/license.rst (original) +++ python/trunk/Doc/license.rst Sat Jan 3 22:04:55 2009 @@ -453,7 +453,7 @@ This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at - http://www.ietf.org/rfc/rfc1321.txt + http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being @@ -464,12 +464,12 @@ that follows (in reverse chronological order): 2002-04-13 lpd Removed support for non-ANSI compilers; removed - references to Ghostscript; clarified derivation from RFC 1321; - now handles byte order either statically or dynamically. + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); - added conditionalization for C++ compilation from Martin - Purschke . + added conditionalization for C++ compilation from Martin + Purschke . 1999-05-03 lpd Original version. Modified: python/trunk/Doc/tutorial/datastructures.rst ============================================================================== --- python/trunk/Doc/tutorial/datastructures.rst (original) +++ python/trunk/Doc/tutorial/datastructures.rst Sat Jan 3 22:04:55 2009 @@ -251,7 +251,7 @@ [] >>> [[x,x**2] for x in vec] [[2, 4], [4, 16], [6, 36]] - >>> [x, x**2 for x in vec] # error - parens required for tuples + >>> [x, x**2 for x in vec] # error - parens required for tuples File "", line 1, in ? [x, x**2 for x in vec] ^ Modified: python/trunk/Doc/tutorial/stdlib2.rst ============================================================================== --- python/trunk/Doc/tutorial/stdlib2.rst (original) +++ python/trunk/Doc/tutorial/stdlib2.rst Sat Jan 3 22:04:55 2009 @@ -62,7 +62,7 @@ >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], - ... conv['frac_digits'], x), grouping=True) + ... conv['frac_digits'], x), grouping=True) '$1,234,567.80' Modified: python/trunk/Doc/whatsnew/2.0.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.0.rst (original) +++ python/trunk/Doc/whatsnew/2.0.rst Sat Jan 3 22:04:55 2009 @@ -281,7 +281,7 @@ # containing the substring S. sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, - L) + L) Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` statement knows what @@ -293,7 +293,7 @@ [ expression for expr in sequence1 for expr2 in sequence2 ... - for exprN in sequenceN + for exprN in sequenceN if condition ] The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be @@ -368,7 +368,7 @@ def __init__(self, value): self.value = value def __iadd__(self, increment): - return Number( self.value + increment) + return Number( self.value + increment) n = Number(5) n += 3 @@ -852,13 +852,12 @@ from distutils.core import setup, Extension expat_extension = Extension('xml.parsers.pyexpat', - define_macros = [('XML_NS', None)], - include_dirs = [ 'extensions/expat/xmltok', - 'extensions/expat/xmlparse' ], - sources = [ 'extensions/pyexpat.c', - 'extensions/expat/xmltok/xmltok.c', - 'extensions/expat/xmltok/xmlrole.c', - ] + define_macros = [('XML_NS', None)], + include_dirs = [ 'extensions/expat/xmltok', + 'extensions/expat/xmlparse' ], + sources = [ 'extensions/pyexpat.c', + 'extensions/expat/xmltok/xmltok.c', + 'extensions/expat/xmltok/xmlrole.c', ] ) setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) Modified: python/trunk/Doc/whatsnew/2.2.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.2.rst (original) +++ python/trunk/Doc/whatsnew/2.2.rst Sat Jan 3 22:04:55 2009 @@ -295,7 +295,7 @@ class D (B,C): def save (self): - # Call superclass .save() + # Call superclass .save() super(D, self).save() # Save D's private information here ... Modified: python/trunk/Doc/whatsnew/2.4.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.4.rst (original) +++ python/trunk/Doc/whatsnew/2.4.rst Sat Jan 3 22:04:55 2009 @@ -396,10 +396,10 @@ different keyword arguments. :: class Popen(args, bufsize=0, executable=None, - stdin=None, stdout=None, stderr=None, - preexec_fn=None, close_fds=False, shell=False, - cwd=None, env=None, universal_newlines=False, - startupinfo=None, creationflags=0): + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): *args* is commonly a sequence of strings that will be the arguments to the program executed as the subprocess. (If the *shell* argument is true, *args* Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Sat Jan 3 22:04:55 2009 @@ -586,30 +586,30 @@ def factorial(queue, N): - "Compute a factorial." - # If N is a multiple of 4, this function will take much longer. - if (N % 4) == 0: - time.sleep(.05 * N/4) - - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # If N is a multiple of 4, this function will take much longer. + if (N % 4) == 0: + time.sleep(.05 * N/4) + + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i - # Put the result on the queue - queue.put(fact) + # Put the result on the queue + queue.put(fact) if __name__ == '__main__': - queue = Queue() + queue = Queue() - N = 5 + N = 5 - p = Process(target=factorial, args=(queue, N)) - p.start() - p.join() + p = Process(target=factorial, args=(queue, N)) + p.start() + p.join() - result = queue.get() - print 'Factorial', N, '=', result + result = queue.get() + print 'Factorial', N, '=', result A :class:`Queue` is used to communicate the input parameter *N* and the result. The :class:`Queue` object is stored in a global variable. @@ -630,12 +630,12 @@ from multiprocessing import Pool def factorial(N, dictionary): - "Compute a factorial." - ... + "Compute a factorial." + ... p = Pool(5) result = p.map(factorial, range(1, 1000, 10)) for v in result: - print v + print v This produces the following output:: @@ -1885,9 +1885,9 @@ ('id', 'name', 'type', 'size') >>> var = var_type(1, 'frequency', 'int', 4) - >>> print var[0], var.id # Equivalent + >>> print var[0], var.id # Equivalent 1 1 - >>> print var[2], var.type # Equivalent + >>> print var[2], var.type # Equivalent int int >>> var._asdict() {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'} @@ -2046,8 +2046,8 @@ >>> list(itertools.product([1,2,3], [4,5,6])) [(1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6)] + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, From python-checkins at python.org Sat Jan 3 22:11:59 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:11:59 +0100 (CET) Subject: [Python-checkins] r68222 - in python/trunk/Doc: Makefile tools/rstlint.py Message-ID: <20090103211159.A88791E4024@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:11:58 2009 New Revision: 68222 Log: Disable the line length checker by default. Modified: python/trunk/Doc/Makefile python/trunk/Doc/tools/rstlint.py Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Sat Jan 3 22:11:58 2009 @@ -142,4 +142,4 @@ cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 check: - $(PYTHON) tools/rstlint.py -i tools -s 2 + $(PYTHON) tools/rstlint.py -i tools Modified: python/trunk/Doc/tools/rstlint.py ============================================================================== --- python/trunk/Doc/tools/rstlint.py (original) +++ python/trunk/Doc/tools/rstlint.py Sat Jan 3 22:11:58 2009 @@ -91,7 +91,6 @@ @checker('.py', '.rst') def check_whitespace(fn, lines): """Check for whitespace and line length issues.""" - lasti = 0 for lno, line in enumerate(lines): if '\r' in line: yield lno+1, '\\r in line' @@ -99,7 +98,13 @@ yield lno+1, 'OMG TABS!!!1' if line[:-1].rstrip(' \t') != line[:-1]: yield lno+1, 'trailing whitespace' - if len(line) > 86: + + + at checker('.rst', severity=0) +def check_line_length(fn, lines): + """Check for line length; this checker is not run by default.""" + for lno, line in enumerate(lines): + if len(line) > 81: # don't complain about tables, links and function signatures if line.lstrip()[0] not in '+|' and \ 'http://' not in line and \ From python-checkins at python.org Sat Jan 3 22:15:21 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:15:21 +0100 (CET) Subject: [Python-checkins] r68223 - in python/branches/py3k: Doc/Makefile Doc/library/decimal.rst Doc/tools/rstlint.py Message-ID: <20090103211521.BF37C1E4015@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:15:20 2009 New Revision: 68223 Log: Merged revisions 68214-68215,68217-68218 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines Make indentation consistent. ........ r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines Fix role name. ........ r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. ........ r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines Recognize usage of the default role. ........ Added: python/branches/py3k/Doc/tools/rstlint.py - copied, changed from r68218, /python/trunk/Doc/tools/rstlint.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/Makefile python/branches/py3k/Doc/library/decimal.rst Modified: python/branches/py3k/Doc/Makefile ============================================================================== --- python/branches/py3k/Doc/Makefile (original) +++ python/branches/py3k/Doc/Makefile Sat Jan 3 22:15:20 2009 @@ -14,7 +14,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html htmlhelp clean coverage dist +.PHONY: help checkout update build html htmlhelp clean coverage dist check help: @echo "Please use \`make ' where is one of" @@ -141,3 +141,5 @@ cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 +check: + $(PYTHON) tools/rstlint.py -i tools -s 2 Modified: python/branches/py3k/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k/Doc/library/decimal.rst (original) +++ python/branches/py3k/Doc/library/decimal.rst Sat Jan 3 22:15:20 2009 @@ -474,7 +474,7 @@ >>> Decimal.from_float(float('-inf')) Decimal('-Infinity') - .. versionadded:: 2.7 + .. versionadded:: 3.1 .. method:: fma(other, third[, context]) @@ -933,25 +933,25 @@ If the argument is a string, no leading or trailing whitespace is permitted. -.. method:: create_decimal_from_float(f) + .. method:: create_decimal_from_float(f) Creates a new Decimal instance from a float *f* but rounding using *self* - as the context. Unlike the :method:`Decimal.from_float` class method, + as the context. Unlike the :meth:`Decimal.from_float` class method, the context precision, rounding method, flags, and traps are applied to the conversion. .. doctest:: - >>> context = Context(prec=5, rounding=ROUND_DOWN) - >>> context.create_decimal_from_float(math.pi) - Decimal('3.1415') - >>> context = Context(prec=5, traps=[Inexact]) - >>> context.create_decimal_from_float(math.pi) - Traceback (most recent call last): - ... - decimal.Inexact: None + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(math.pi) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(math.pi) + Traceback (most recent call last): + ... + decimal.Inexact: None - .. versionadded:: 2.7 + .. versionadded:: 3.1 .. method:: Etiny() Copied: python/branches/py3k/Doc/tools/rstlint.py (from r68218, /python/trunk/Doc/tools/rstlint.py) ============================================================================== --- /python/trunk/Doc/tools/rstlint.py (original) +++ python/branches/py3k/Doc/tools/rstlint.py Sat Jan 3 22:15:20 2009 @@ -69,7 +69,7 @@ yield 0, '\\r in code file' code = code.replace('\r', '') compile(code, fn, 'exec') - except SyntaxError, err: + except SyntaxError as err: yield err.lineno, 'not compilable: %s' % err @@ -131,7 +131,7 @@ try: gopts, args = getopt.getopt(argv[1:], 'vfs:i:') except getopt.GetoptError: - print usage + print(usage) return 2 verbose = False @@ -153,11 +153,11 @@ elif len(args) == 1: path = args[0] else: - print usage + print(usage) return 2 if not exists(path): - print 'Error: path %s does not exist' % path + print('Error: path %s does not exist' % path) return 2 count = defaultdict(int) @@ -188,13 +188,13 @@ continue if verbose: - print 'Checking %s...' % fn + print('Checking %s...' % fn) try: with open(fn, 'r') as f: lines = list(f) - except (IOError, OSError), err: - print '%s: cannot open: %s' % (fn, err) + except (IOError, OSError) as err: + print('%s: cannot open: %s' % (fn, err)) count[4] += 1 continue @@ -204,20 +204,21 @@ csev = checker.severity if csev >= severity: for lno, msg in checker(fn, lines): - print >>out, '[%d] %s:%d: %s' % (csev, fn, lno, msg) + print('[%d] %s:%d: %s' % (csev, fn, lno, msg), + file=out) count[csev] += 1 if verbose: - print + print() if not count: if severity > 1: - print 'No problems with severity >= %d found.' % severity + print('No problems with severity >= %d found.' % severity) else: - print 'No problems found.' + print('No problems found.') else: for severity in sorted(count): number = count[severity] - print '%d problem%s with severity %d found.' % \ - (number, number > 1 and 's' or '', severity) + print('%d problem%s with severity %d found.' % + (number, number > 1 and 's' or '', severity)) return int(bool(count)) From python-checkins at python.org Sat Jan 3 22:17:05 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:17:05 +0100 (CET) Subject: [Python-checkins] r68224 - in python/branches/py3k: Doc/distutils/uploading.rst Doc/documenting/markup.rst Doc/library/ast.rst Doc/library/ctypes.rst Doc/library/decimal.rst Doc/library/fractions.rst Doc/library/tempfile.rst Message-ID: <20090103211705.89C0E1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:17:04 2009 New Revision: 68224 Log: Merged revisions 68219 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines Fix uses of the default role. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/uploading.rst python/branches/py3k/Doc/documenting/markup.rst python/branches/py3k/Doc/library/ast.rst python/branches/py3k/Doc/library/ctypes.rst python/branches/py3k/Doc/library/decimal.rst python/branches/py3k/Doc/library/fractions.rst python/branches/py3k/Doc/library/tempfile.rst Modified: python/branches/py3k/Doc/distutils/uploading.rst ============================================================================== --- python/branches/py3k/Doc/distutils/uploading.rst (original) +++ python/branches/py3k/Doc/distutils/uploading.rst Sat Jan 3 22:17:04 2009 @@ -33,9 +33,9 @@ be available for execution on the system :envvar:`PATH`. You can also specify which key to use for signing using the :option:`--identity=*name*` option. -Other :command:`upload` options include :option:`--repository=*url*` -or :option:`--repository=*section*` where `url` is the url of the server -and `section` the name of the section in :file:`$HOME/.pypirc`, and +Other :command:`upload` options include :option:`--repository=` or +:option:`--repository=
` where *url* is the url of the server and +*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). Modified: python/branches/py3k/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k/Doc/documenting/markup.rst (original) +++ python/branches/py3k/Doc/documenting/markup.rst Sat Jan 3 22:17:04 2009 @@ -599,7 +599,7 @@ Example:: .. versionadded:: 2.5 - The `spam` parameter. + The *spam* parameter. Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. @@ -760,7 +760,7 @@ Blank lines are not allowed within ``productionlist`` directive arguments. The definition can contain token names which are marked as interpreted text - (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references + (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references to the productions of these tokens. Note that no further reST parsing is done in the production, so that you Modified: python/branches/py3k/Doc/library/ast.rst ============================================================================== --- python/branches/py3k/Doc/library/ast.rst (original) +++ python/branches/py3k/Doc/library/ast.rst Sat Jan 3 22:17:04 2009 @@ -178,7 +178,7 @@ A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -207,11 +207,11 @@ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: Modified: python/branches/py3k/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k/Doc/library/ctypes.rst (original) +++ python/branches/py3k/Doc/library/ctypes.rst Sat Jan 3 22:17:04 2009 @@ -1376,24 +1376,22 @@ The *mode* parameter can be used to specify how the library is loaded. For details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored. -The *use_errno* parameter, when set to True, enables a ctypes -mechanism that allows to access the system `errno` error number in a -safe way. `ctypes` maintains a thread-local copy of the systems -`errno` variable; if you call foreign functions created with -`use_errno=True` then the `errno` value before the function call is -swapped with the ctypes private copy, the same happens immediately -after the function call. - -The function `ctypes.get_errno()` returns the value of the ctypes -private copy, and the function `ctypes.set_errno(value)` changes the -ctypes private copy to `value` and returns the former value. - -The *use_last_error* parameter, when set to True, enables the same -mechanism for the Windows error code which is managed by the -:func:`GetLastError` and :func:`SetLastError` Windows API functions; -`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used -to request and change the ctypes private copy of the windows error -code. +The *use_errno* parameter, when set to True, enables a ctypes mechanism that +allows to access the system :data:`errno` error number in a safe way. +:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` +variable; if you call foreign functions created with ``use_errno=True`` then the +:data:`errno` value before the function call is swapped with the ctypes private +copy, the same happens immediately after the function call. + +The function :func:`ctypes.get_errno` returns the value of the ctypes private +copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy +to a new value and returns the former value. + +The *use_last_error* parameter, when set to True, enables the same mechanism for +the Windows error code which is managed by the :func:`GetLastError` and +:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and +:func:`ctypes.set_last_error` are used to request and change the ctypes private +copy of the windows error code. .. data:: RTLD_GLOBAL :noindex: @@ -1596,18 +1594,20 @@ .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) The returned function prototype creates functions that use the standard C - calling convention. The function will release the GIL during the call. - If `use_errno` is set to True, the ctypes private copy of the system `errno` - variable is exchanged with the real `errno` value bafore and after the call; - `use_last_error` does the same for the Windows error code. + calling convention. The function will release the GIL during the call. If + *use_errno* is set to True, the ctypes private copy of the system + :data:`errno` variable is exchanged with the real :data:`errno` value bafore + and after the call; *use_last_error* does the same for the Windows error + code. .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) Windows only: The returned function prototype creates functions that use the - ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE` - is the same as :func:`CFUNCTYPE`. The function will release the GIL during the - call. `use_errno` and `use_last_error` have the same meaning as above. + ``stdcall`` calling convention, except on Windows CE where + :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will + release the GIL during the call. *use_errno* and *use_last_error* have the + same meaning as above. .. function:: PYFUNCTYPE(restype, *argtypes) @@ -1852,10 +1852,10 @@ .. function:: find_library(name) :module: ctypes.util - Try to find a library and return a pathname. `name` is the library name without - any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this - is the form used for the posix linker option :option:`-l`). If no library can - be found, returns ``None``. + Try to find a library and return a pathname. *name* is the library name + without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + number (this is the form used for the posix linker option :option:`-l`). If + no library can be found, returns ``None``. The exact functionality is system dependent. @@ -1887,12 +1887,12 @@ .. function:: get_errno() Returns the current value of the ctypes-private copy of the system - `errno` variable in the calling thread. + :data:`errno` variable in the calling thread. .. function:: get_last_error() Windows only: returns the current value of the ctypes-private copy of the system - `LastError` variable in the calling thread. + :data:`LastError` variable in the calling thread. .. function:: memmove(dst, src, count) @@ -1947,15 +1947,14 @@ .. function:: set_errno(value) - Set the current value of the ctypes-private copy of the system - `errno` variable in the calling thread to `value` and return the - previous value. + Set the current value of the ctypes-private copy of the system :data:`errno` + variable in the calling thread to *value* and return the previous value. .. function:: set_last_error(value) - Windows only: set the current value of the ctypes-private copy of - the system `LastError` variable in the calling thread to `value` - and return the previous value. + Windows only: set the current value of the ctypes-private copy of the system + :data:`LastError` variable in the calling thread to *value* and return the + previous value. .. function:: sizeof(obj_or_type) Modified: python/branches/py3k/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k/Doc/library/decimal.rst (original) +++ python/branches/py3k/Doc/library/decimal.rst Sat Jan 3 22:17:04 2009 @@ -1114,7 +1114,7 @@ .. method:: logical_and(x, y) - Applies the logical operation `and` between each operand's digits. + Applies the logical operation *and* between each operand's digits. .. method:: logical_invert(x) @@ -1124,12 +1124,12 @@ .. method:: logical_or(x, y) - Applies the logical operation `or` between each operand's digits. + Applies the logical operation *or* between each operand's digits. .. method:: logical_xor(x, y) - Applies the logical operation `xor` between each operand's digits. + Applies the logical operation *xor* between each operand's digits. .. method:: max(x, y) @@ -1237,8 +1237,8 @@ .. method:: remainder_near(x, y) - Returns `x - y * n`, where *n* is the integer nearest the exact value - of `x / y` (if the result is `0` then its sign will be the sign of *x*). + Returns ``x - y * n``, where *n* is the integer nearest the exact value + of ``x / y`` (if the result is 0 then its sign will be the sign of *x*). .. method:: rotate(x, y) Modified: python/branches/py3k/Doc/library/fractions.rst ============================================================================== --- python/branches/py3k/Doc/library/fractions.rst (original) +++ python/branches/py3k/Doc/library/fractions.rst Sat Jan 3 22:17:04 2009 @@ -126,11 +126,11 @@ .. function:: gcd(a, b) - Return the greatest common divisor of the integers `a` and `b`. If - either `a` or `b` is nonzero, then the absolute value of `gcd(a, - b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)` - has the same sign as `b` if `b` is nonzero; otherwise it takes the sign - of `a`. `gcd(0, 0)` returns `0`. + Return the greatest common divisor of the integers *a* and *b*. If either + *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the + largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same + sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0, + 0)`` returns ``0``. .. seealso:: Modified: python/branches/py3k/Doc/library/tempfile.rst ============================================================================== --- python/branches/py3k/Doc/library/tempfile.rst (original) +++ python/branches/py3k/Doc/library/tempfile.rst Sat Jan 3 22:17:04 2009 @@ -149,11 +149,11 @@ .. warning:: - Use of this function may introduce a security hole in your program. - By the time you get around to doing anything with the file name it - returns, someone else may have beaten you to the punch. - :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + Use of this function may introduce a security hole in your program. By + the time you get around to doing anything with the file name it returns, + someone else may have beaten you to the punch. :func:`mktemp` usage can + be replaced easily with :func:`NamedTemporaryFile`, passing it the + ``delete=False`` parameter:: >>> f = NamedTemporaryFile(delete=False) >>> f From python-checkins at python.org Sat Jan 3 22:17:44 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:17:44 +0100 (CET) Subject: [Python-checkins] r68225 - python/branches/py3k Message-ID: <20090103211744.7EE371E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:17:44 2009 New Revision: 68225 Log: Blocked revisions 68220 via svnmerge ........ r68220 | georg.brandl | 2009-01-03 21:55:06 +0100 (Sat, 03 Jan 2009) | 2 lines Remove trailing whitespace. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 3 22:18:56 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:18:56 +0100 (CET) Subject: [Python-checkins] r68226 - in python/branches/py3k/Doc: c-api/buffer.rst c-api/conversion.rst c-api/file.rst c-api/init.rst c-api/long.rst c-api/module.rst c-api/reflection.rst c-api/sequence.rst distutils/apiref.rst distutils/builtdist.rst distutils/configfile.rst distutils/packageindex.rst distutils/setupscript.rst documenting/markup.rst extending/building.rst extending/extending.rst extending/newtypes.rst extending/windows.rst glossary.rst howto/curses.rst howto/doanddont.rst howto/functional.rst howto/sockets.rst howto/urllib2.rst howto/webservers.rst install/index.rst library/abc.rst library/aifc.rst library/array.rst library/ast.rst library/audioop.rst library/bdb.rst library/cmath.rst library/codeop.rst library/collections.rst library/configparser.rst library/constants.rst library/crypt.rst library/csv.rst library/datetime.rst library/decimal.rst library/dis.rst library/email.mime.rst library/fileinput.rst library/functions.rst library/gettext.rst library/heapq.rst library/idle.rst library/inspect.rst library/io.rst library/itertools.rst library/json.rst library/locale.rst library/mailbox.rst library/math.rst library/mmap.rst library/msvcrt.rst library/multiprocessing.rst library/nntplib.rst library/operator.rst library/optparse.rst library/os.rst library/ossaudiodev.rst library/othergui.rst library/pdb.rst library/pickle.rst library/profile.rst library/pyexpat.rst library/queue.rst library/re.rst library/rlcompleter.rst library/sched.rst library/shutil.rst library/signal.rst library/smtplib.rst library/socket.rst library/sqlite3.rst library/ssl.rst library/stdtypes.rst library/string.rst library/subprocess.rst library/sys.rst library/tk.rst library/tkinter.rst library/tkinter.tix.rst library/tokenize.rst library/trace.rst library/traceback.rst library/turtle.rst library/unicodedata.rst library/unittest.rst library/warnings.rst library/webbrowser.rst library/wsgiref.rst library/xml.etree.elementtree.rst library/xmlrpc.server.rst library/zipfile.rst library/zipimport.rst license.rst reference/datamodel.rst reference/expressions.rst reference/lexical_analysis.rst reference/simple_stmts.rst tutorial/classes.rst tutorial/controlflow.rst tutorial/datastructures.rst tutorial/errors.rst tutorial/index.rst tutorial/inputoutput.rst tutorial/interpreter.rst tutorial/introduction.rst tutorial/modules.rst tutorial/stdlib.rst tutorial/stdlib2.rst tutorial/whatnow.rst using/cmdline.rst using/unix.rst using/windows.rst whatsnew/2.0.rst whatsnew/2.1.rst whatsnew/2.2.rst whatsnew/2.3.rst whatsnew/2.4.rst whatsnew/2.5.rst whatsnew/2.6.rst whatsnew/3.0.rst whatsnew/3.1.rst Message-ID: <20090103211856.15A111E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:18:54 2009 New Revision: 68226 Log: Remove trailing whitespace. Modified: python/branches/py3k/Doc/c-api/buffer.rst python/branches/py3k/Doc/c-api/conversion.rst python/branches/py3k/Doc/c-api/file.rst python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Doc/c-api/long.rst python/branches/py3k/Doc/c-api/module.rst python/branches/py3k/Doc/c-api/reflection.rst python/branches/py3k/Doc/c-api/sequence.rst python/branches/py3k/Doc/distutils/apiref.rst python/branches/py3k/Doc/distutils/builtdist.rst python/branches/py3k/Doc/distutils/configfile.rst python/branches/py3k/Doc/distutils/packageindex.rst python/branches/py3k/Doc/distutils/setupscript.rst python/branches/py3k/Doc/documenting/markup.rst python/branches/py3k/Doc/extending/building.rst python/branches/py3k/Doc/extending/extending.rst python/branches/py3k/Doc/extending/newtypes.rst python/branches/py3k/Doc/extending/windows.rst python/branches/py3k/Doc/glossary.rst python/branches/py3k/Doc/howto/curses.rst python/branches/py3k/Doc/howto/doanddont.rst python/branches/py3k/Doc/howto/functional.rst python/branches/py3k/Doc/howto/sockets.rst python/branches/py3k/Doc/howto/urllib2.rst python/branches/py3k/Doc/howto/webservers.rst python/branches/py3k/Doc/install/index.rst python/branches/py3k/Doc/library/abc.rst python/branches/py3k/Doc/library/aifc.rst python/branches/py3k/Doc/library/array.rst python/branches/py3k/Doc/library/ast.rst python/branches/py3k/Doc/library/audioop.rst python/branches/py3k/Doc/library/bdb.rst python/branches/py3k/Doc/library/cmath.rst python/branches/py3k/Doc/library/codeop.rst python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Doc/library/configparser.rst python/branches/py3k/Doc/library/constants.rst python/branches/py3k/Doc/library/crypt.rst python/branches/py3k/Doc/library/csv.rst python/branches/py3k/Doc/library/datetime.rst python/branches/py3k/Doc/library/decimal.rst python/branches/py3k/Doc/library/dis.rst python/branches/py3k/Doc/library/email.mime.rst python/branches/py3k/Doc/library/fileinput.rst python/branches/py3k/Doc/library/functions.rst python/branches/py3k/Doc/library/gettext.rst python/branches/py3k/Doc/library/heapq.rst python/branches/py3k/Doc/library/idle.rst python/branches/py3k/Doc/library/inspect.rst python/branches/py3k/Doc/library/io.rst python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Doc/library/json.rst python/branches/py3k/Doc/library/locale.rst python/branches/py3k/Doc/library/mailbox.rst python/branches/py3k/Doc/library/math.rst python/branches/py3k/Doc/library/mmap.rst python/branches/py3k/Doc/library/msvcrt.rst python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Doc/library/nntplib.rst python/branches/py3k/Doc/library/operator.rst python/branches/py3k/Doc/library/optparse.rst python/branches/py3k/Doc/library/os.rst python/branches/py3k/Doc/library/ossaudiodev.rst python/branches/py3k/Doc/library/othergui.rst python/branches/py3k/Doc/library/pdb.rst python/branches/py3k/Doc/library/pickle.rst python/branches/py3k/Doc/library/profile.rst python/branches/py3k/Doc/library/pyexpat.rst python/branches/py3k/Doc/library/queue.rst python/branches/py3k/Doc/library/re.rst python/branches/py3k/Doc/library/rlcompleter.rst python/branches/py3k/Doc/library/sched.rst python/branches/py3k/Doc/library/shutil.rst python/branches/py3k/Doc/library/signal.rst python/branches/py3k/Doc/library/smtplib.rst python/branches/py3k/Doc/library/socket.rst python/branches/py3k/Doc/library/sqlite3.rst python/branches/py3k/Doc/library/ssl.rst python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Doc/library/string.rst python/branches/py3k/Doc/library/subprocess.rst python/branches/py3k/Doc/library/sys.rst python/branches/py3k/Doc/library/tk.rst python/branches/py3k/Doc/library/tkinter.rst python/branches/py3k/Doc/library/tkinter.tix.rst python/branches/py3k/Doc/library/tokenize.rst python/branches/py3k/Doc/library/trace.rst python/branches/py3k/Doc/library/traceback.rst python/branches/py3k/Doc/library/turtle.rst python/branches/py3k/Doc/library/unicodedata.rst python/branches/py3k/Doc/library/unittest.rst python/branches/py3k/Doc/library/warnings.rst python/branches/py3k/Doc/library/webbrowser.rst python/branches/py3k/Doc/library/wsgiref.rst python/branches/py3k/Doc/library/xml.etree.elementtree.rst python/branches/py3k/Doc/library/xmlrpc.server.rst python/branches/py3k/Doc/library/zipfile.rst python/branches/py3k/Doc/library/zipimport.rst python/branches/py3k/Doc/license.rst python/branches/py3k/Doc/reference/datamodel.rst python/branches/py3k/Doc/reference/expressions.rst python/branches/py3k/Doc/reference/lexical_analysis.rst python/branches/py3k/Doc/reference/simple_stmts.rst python/branches/py3k/Doc/tutorial/classes.rst python/branches/py3k/Doc/tutorial/controlflow.rst python/branches/py3k/Doc/tutorial/datastructures.rst python/branches/py3k/Doc/tutorial/errors.rst python/branches/py3k/Doc/tutorial/index.rst python/branches/py3k/Doc/tutorial/inputoutput.rst python/branches/py3k/Doc/tutorial/interpreter.rst python/branches/py3k/Doc/tutorial/introduction.rst python/branches/py3k/Doc/tutorial/modules.rst python/branches/py3k/Doc/tutorial/stdlib.rst python/branches/py3k/Doc/tutorial/stdlib2.rst python/branches/py3k/Doc/tutorial/whatnow.rst python/branches/py3k/Doc/using/cmdline.rst python/branches/py3k/Doc/using/unix.rst python/branches/py3k/Doc/using/windows.rst python/branches/py3k/Doc/whatsnew/2.0.rst python/branches/py3k/Doc/whatsnew/2.1.rst python/branches/py3k/Doc/whatsnew/2.2.rst python/branches/py3k/Doc/whatsnew/2.3.rst python/branches/py3k/Doc/whatsnew/2.4.rst python/branches/py3k/Doc/whatsnew/2.5.rst python/branches/py3k/Doc/whatsnew/2.6.rst python/branches/py3k/Doc/whatsnew/3.0.rst python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/c-api/buffer.rst ============================================================================== --- python/branches/py3k/Doc/c-api/buffer.rst (original) +++ python/branches/py3k/Doc/c-api/buffer.rst Sat Jan 3 22:18:54 2009 @@ -31,7 +31,7 @@ .. index:: single: PyBufferProcs -More information on the buffer interface is provided in the section +More information on the buffer interface is provided in the section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`. Buffer objects are useful as a way to expose the data from another object's @@ -104,7 +104,7 @@ pointer += strides[i] * indices[i]; if (suboffsets[i] >=0 ) { pointer = *((char**)pointer) + suboffsets[i]; - } + } } return (void*)pointer; } Modified: python/branches/py3k/Doc/c-api/conversion.rst ============================================================================== --- python/branches/py3k/Doc/c-api/conversion.rst (original) +++ python/branches/py3k/Doc/c-api/conversion.rst Sat Jan 3 22:18:54 2009 @@ -80,7 +80,7 @@ See the Unix man page :manpage:`atof(2)` for details. - + .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) Case insensitive comparison of strings. The function works almost Modified: python/branches/py3k/Doc/c-api/file.rst ============================================================================== --- python/branches/py3k/Doc/c-api/file.rst (original) +++ python/branches/py3k/Doc/c-api/file.rst Sat Jan 3 22:18:54 2009 @@ -22,7 +22,7 @@ .. warning:: - Take care when you are mixing streams and descriptors! For more + Take care when you are mixing streams and descriptors! For more information, see `the GNU C Library docs `_. 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 Sat Jan 3 22:18:54 2009 @@ -885,7 +885,7 @@ Return a tuple of function call counts. There are constants defined for the positions within the tuple: - + +-------------------------------+-------+ | Name | Value | +===============================+=======+ @@ -911,7 +911,7 @@ +-------------------------------+-------+ | :const:`PCALL_POP` | 10 | +-------------------------------+-------+ - + :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used. 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 Sat Jan 3 22:18:54 2009 @@ -107,7 +107,7 @@ retrieved from the resulting value using :cfunc:`PyLong_AsVoidPtr`. -.. XXX alias PyLong_AS_LONG (for now) +.. XXX alias PyLong_AS_LONG (for now) .. cfunction:: long PyLong_AsLong(PyObject *pylong) .. index:: @@ -123,7 +123,7 @@ Return a C :ctype:`long` representation of the contents of *pylong*. If *pylong* is greater than :const:`LONG_MAX`, return -1 and - set `*overflow` to 1 (for overflow) or -1 (for underflow). + set `*overflow` to 1 (for overflow) or -1 (for underflow). If an exception is set because of type errors, also return -1. Modified: python/branches/py3k/Doc/c-api/module.rst ============================================================================== --- python/branches/py3k/Doc/c-api/module.rst (original) +++ python/branches/py3k/Doc/c-api/module.rst Sat Jan 3 22:18:54 2009 @@ -96,7 +96,7 @@ .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro) - Add an int constant to *module*. The name and the value are taken from + Add an int constant to *module*. The name and the value are taken from *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on error, ``0`` on success. Modified: python/branches/py3k/Doc/c-api/reflection.rst ============================================================================== --- python/branches/py3k/Doc/c-api/reflection.rst (original) +++ python/branches/py3k/Doc/c-api/reflection.rst Sat Jan 3 22:18:54 2009 @@ -15,7 +15,7 @@ Return a dictionary of the local variables in the current execution frame, or *NULL* if no frame is currently executing. - + .. cfunction:: PyObject* PyEval_GetGlobals() Modified: python/branches/py3k/Doc/c-api/sequence.rst ============================================================================== --- python/branches/py3k/Doc/c-api/sequence.rst (original) +++ python/branches/py3k/Doc/c-api/sequence.rst Sat Jan 3 22:18:54 2009 @@ -143,9 +143,9 @@ Return the underlying array of PyObject pointers. Assumes that *o* was returned by :cfunc:`PySequence_Fast` and *o* is not *NULL*. - + Note, if a list gets resized, the reallocation may relocate the items array. - So, only use the underlying array pointer in contexts where the sequence + So, only use the underlying array pointer in contexts where the sequence cannot change. Modified: python/branches/py3k/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k/Doc/distutils/apiref.rst (original) +++ python/branches/py3k/Doc/distutils/apiref.rst Sat Jan 3 22:18:54 2009 @@ -104,7 +104,7 @@ | *package_dir* | A mapping of package to | a dictionary | | | directory names | | +--------------------+--------------------------------+-------------------------------------------------------------+ - + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -754,7 +754,7 @@ standard output, otherwise do nothing. .. % \subsection{Compiler-specific modules} -.. % +.. % .. % The following modules implement concrete subclasses of the abstract .. % \class{CCompiler} class. They should not be instantiated directly, but should .. % be created using \function{distutils.ccompiler.new_compiler()} factory @@ -858,7 +858,7 @@ Macintosh. Needs work to support CW on Windows or Mac OS X. .. % \subsection{Utility modules} -.. % +.. % .. % The following modules all provide general utility functions. They haven't .. % all been documented yet. @@ -1109,13 +1109,13 @@ For MacOS X systems the OS version reflects the minimal version on which binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` - during the build of Python), not the OS version of the current system. + during the build of Python), not the OS version of the current system. For universal binary builds on MacOS X the architecture value reflects the univeral binary status instead of the architecture of the current - processor. For 32-bit universal binaries the architecture is ``fat``, - for 64-bit universal binaries the architecture is ``fat64``, and - for 4-way universal binaries the architecture is ``universal``. + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. Examples of returned values on MacOS X: @@ -1692,7 +1692,7 @@ .. % todo .. % \section{Distutils Commands} -.. % +.. % .. % This part of Distutils implements the various Distutils commands, such .. % as \code{build}, \code{install} \&c. Each command is implemented as a .. % separate module, with the command name as the name of the module. Modified: python/branches/py3k/Doc/distutils/builtdist.rst ============================================================================== --- python/branches/py3k/Doc/distutils/builtdist.rst (original) +++ python/branches/py3k/Doc/distutils/builtdist.rst Sat Jan 3 22:18:54 2009 @@ -268,13 +268,13 @@ .. % \longprogramopt{spec-file} option; used in conjunction with .. % \longprogramopt{spec-only}, this gives you an opportunity to customize .. % the \file{.spec} file manually: -.. % +.. % .. % \ begin{verbatim} .. % > python setup.py bdist_rpm --spec-only .. % # ...edit dist/FooBar-1.0.spec .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec .. % \ end{verbatim} -.. % +.. % .. % (Although a better way to do this is probably to override the standard .. % \command{bdist\_rpm} command with one that writes whatever else you want .. % to the \file{.spec} file.) @@ -334,31 +334,31 @@ Cross-compiling on Windows ========================== -Starting with Python 2.6, distutils is capable of cross-compiling between -Windows platforms. In practice, this means that with the correct tools +Starting with Python 2.6, distutils is capable of cross-compiling between +Windows platforms. In practice, this means that with the correct tools installed, you can use a 32bit version of Windows to create 64bit extensions and vice-versa. -To build for an alternate platform, specify the :option:`--plat-name` option -to the build command. Valid values are currently 'win32', 'win-amd64' and +To build for an alternate platform, specify the :option:`--plat-name` option +to the build command. Valid values are currently 'win32', 'win-amd64' and 'win-ia64'. For example, on a 32bit version of Windows, you could execute:: python setup.py build --plat-name=win-amd64 -to build a 64bit version of your extension. The Windows Installers also +to build a 64bit version of your extension. The Windows Installers also support this option, so the command:: python setup.py build --plat-name=win-amd64 bdist_wininst would create a 64bit installation executable on your 32bit version of Windows. -To cross-compile, you must download the Python source code and cross-compile +To cross-compile, you must download the Python source code and cross-compile Python itself for the platform you are targetting - it is not possible from a binary installtion of Python (as the .lib etc file for other platforms are -not included.) In practice, this means the user of a 32 bit operating -system will need to use Visual Studio 2008 to open the -:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the -"x64" configuration of the 'pythoncore' project before cross-compiling +not included.) In practice, this means the user of a 32 bit operating +system will need to use Visual Studio 2008 to open the +:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the +"x64" configuration of the 'pythoncore' project before cross-compiling extensions is possible. Note that by default, Visual Studio 2008 does not install 64bit compilers or Modified: python/branches/py3k/Doc/distutils/configfile.rst ============================================================================== --- python/branches/py3k/Doc/distutils/configfile.rst (original) +++ python/branches/py3k/Doc/distutils/configfile.rst Sat Jan 3 22:18:54 2009 @@ -63,7 +63,7 @@ --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine - --swig-opts list of SWIG command line options + --swig-opts list of SWIG command line options [...] Note that an option spelled :option:`--foo-bar` on the command-line is spelled Modified: python/branches/py3k/Doc/distutils/packageindex.rst ============================================================================== --- python/branches/py3k/Doc/distutils/packageindex.rst (original) +++ python/branches/py3k/Doc/distutils/packageindex.rst Sat Jan 3 22:18:54 2009 @@ -72,7 +72,7 @@ index-servers = pypi other - + [pypi] repository: username: @@ -91,4 +91,4 @@ python setup.py register -r other - + Modified: python/branches/py3k/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k/Doc/distutils/setupscript.rst Sat Jan 3 22:18:54 2009 @@ -213,7 +213,7 @@ this:: setup(..., - ext_modules=[Extension('_foo', ['foo.i'], + ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], ) Modified: python/branches/py3k/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k/Doc/documenting/markup.rst (original) +++ python/branches/py3k/Doc/documenting/markup.rst Sat Jan 3 22:18:54 2009 @@ -508,7 +508,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. .. describe:: var @@ -767,7 +767,7 @@ don't have to escape ``*`` or ``|`` characters. -.. XXX describe optional first parameter +.. XXX describe optional first parameter The following is an example taken from the Python Reference Manual:: Modified: python/branches/py3k/Doc/extending/building.rst ============================================================================== --- python/branches/py3k/Doc/extending/building.rst (original) +++ python/branches/py3k/Doc/extending/building.rst Sat Jan 3 22:18:54 2009 @@ -39,7 +39,7 @@ With this :file:`setup.py`, and a file :file:`demo.c`, running :: - python setup.py build + python setup.py build will compile :file:`demo.c`, and produce an extension module named ``demo`` in the :file:`build` directory. Depending on the system, the module file will end Modified: python/branches/py3k/Doc/extending/extending.rst ============================================================================== --- python/branches/py3k/Doc/extending/extending.rst (original) +++ python/branches/py3k/Doc/extending/extending.rst Sat Jan 3 22:18:54 2009 @@ -334,7 +334,7 @@ :cfunc:`PyInit_spam` is called. (See below for comments about embedding Python.) It calls :cfunc:`PyModule_Create`, which returns a module object, and inserts built-in function objects into the newly created module based upon the -table (an array of :ctype:`PyMethodDef` structures) found in the module definition. +table (an array of :ctype:`PyMethodDef` structures) found in the module definition. :cfunc:`PyModule_Create` returns a pointer to the module object that it creates. It may abort with a fatal error for certain errors, or return *NULL* if the module could not be initialized @@ -482,7 +482,7 @@ :cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of -arguments. To call the Python function with no arguments, pass in NULL, or +arguments. To call the Python function with no arguments, pass in NULL, or an empty tuple; to call it with one argument, pass a singleton tuple. :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example:: @@ -521,7 +521,7 @@ if (result == NULL) return NULL; /* Pass error back */ ...use result... - Py_DECREF(result); + Py_DECREF(result); Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases @@ -546,7 +546,7 @@ the error check! Also note that strictly speaking this code is not complete: :cfunc:`Py_BuildValue` may run out of memory, and this should be checked. -You may also call a function with keyword arguments by using +You may also call a function with keyword arguments by using :cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. :: @@ -687,7 +687,7 @@ static PyObject * keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) - { + { int voltage; char *state = "a stiff"; char *action = "voom"; @@ -695,11 +695,11 @@ static char *kwlist[] = {"voltage", "state", "action", "type", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, &voltage, &state, &action, &type)) - return NULL; + return NULL; - printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", + printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", action, voltage); printf("-- Lovely plumage, the %s -- It's %s!\n", type, state); Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Sat Jan 3 22:18:54 2009 @@ -1180,7 +1180,7 @@ of *NULL* is required. .. XXX Descriptors need to be explained in more detail somewhere, but not here. - + Descriptor objects have two handler functions which correspond to the \member{tp_getattro} and \member{tp_setattro} handlers. The \method{__get__()} handler is a function which is passed the descriptor, @@ -1233,15 +1233,15 @@ return -1; } -.. XXX tp_compare is dead; need to rewrite for tp_richcompare! +.. XXX tp_compare is dead; need to rewrite for tp_richcompare! Object Comparison ----------------- - + :: - + cmpfunc tp_compare; - + The :attr:`tp_compare` handler is called when comparisons are needed and the object does not implement the specific rich comparison method which matches the requested comparison. (It is always used if defined and the @@ -1252,18 +1252,18 @@ allowed to return arbitrary negative or positive integers for less than and 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_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`. - + Here is a sample implementation:: - + static int newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) { long result; - + if (obj1->obj_UnderlyingDatatypePtr->size < obj2->obj_UnderlyingDatatypePtr->size) { result = -1; Modified: python/branches/py3k/Doc/extending/windows.rst ============================================================================== --- python/branches/py3k/Doc/extending/windows.rst (original) +++ python/branches/py3k/Doc/extending/windows.rst Sat Jan 3 22:18:54 2009 @@ -102,7 +102,7 @@ and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its first argument (use the minimal :file:`example.c` in this directory as a guide). By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. - The output file should be called :file:`spam.pyd` (in Release mode) or + The output file should be called :file:`spam.pyd` (in Release mode) or :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. Modified: python/branches/py3k/Doc/glossary.rst ============================================================================== --- python/branches/py3k/Doc/glossary.rst (original) +++ python/branches/py3k/Doc/glossary.rst Sat Jan 3 22:18:54 2009 @@ -11,7 +11,7 @@ ``>>>`` The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter. - + ``...`` The default Python prompt of the interactive shell when entering code for an indented code block or within a pair of matching left and right @@ -50,11 +50,11 @@ A value associated with an object which is referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. - + BDFL Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator. - + bytecode Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in @@ -67,7 +67,7 @@ A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class. - + coercion The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, @@ -77,7 +77,7 @@ will raise a ``TypeError``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. - + complex number An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary @@ -89,7 +89,7 @@ :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them. - + context manager An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. @@ -132,7 +132,7 @@ and reference to super classes. For more information about descriptors' methods, see :ref:`descriptors`. - + dictionary An associative array, where arbitrary keys are mapped to values. The use of :class:`dict` closely resembles that for :class:`list`, but the keys can @@ -146,8 +146,8 @@ of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object. - - duck-typing + + duck-typing A pythonic programming style which determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it @@ -157,13 +157,13 @@ :func:`isinstance`. (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming. - + EAFP Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` - statements. The technique contrasts with the :term:`LBYL` style + statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C. expression @@ -196,7 +196,7 @@ By importing the :mod:`__future__` module and evaluating its variables, you can see when a new feature was first added to the language and when it becomes the default:: - + >>> import __future__ >>> __future__.division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) @@ -205,7 +205,7 @@ The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. - + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -215,21 +215,21 @@ stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the :meth:`__next__` method of the returned iterator. - + .. index:: single: generator expression - + generator expression An expression that returns a generator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: - + >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285 - + GIL See :term:`global interpreter lock`. - + global interpreter lock The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. @@ -255,14 +255,14 @@ containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`. - + IDLE An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application. - + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to @@ -277,7 +277,7 @@ arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). - + interpreted Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the @@ -286,7 +286,7 @@ Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`. - + iterable A container object capable of returning its members one at a time. Examples of iterables include all sequence types (such as @@ -302,7 +302,7 @@ statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`. - + iterator An object representing a stream of data. Repeated calls to the iterator's :meth:`__next__` (or passing it to the builtin function) :func:`next` @@ -318,7 +318,7 @@ :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container. - + More information can be found in :ref:`typeiter`. keyword argument @@ -342,7 +342,7 @@ A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1). - + list comprehension A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ["0x%02x" % x for x in @@ -350,11 +350,11 @@ even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed. - + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. - + metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for @@ -373,7 +373,7 @@ of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`. - + mutable Mutable objects can change their value but keep their :func:`id`. See also :term:`immutable`. @@ -390,7 +390,7 @@ :func:`collections.namedtuple`. The latter approach automatically provides extra features such as a self-documenting representation like ``Employee(name='jones', title='programmer')``. - + namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and builtin namespaces as well @@ -402,7 +402,7 @@ :func:`random.seed` or :func:`itertools.izip` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively. - + nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to @@ -410,7 +410,7 @@ reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. - + new-style class Old name for the flavor of classes now used for all class objects. In earlier Python versions, only new-style classes could use Python's newer, @@ -421,7 +421,7 @@ Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`. - + positional argument The arguments assigned to local names inside a function or method, determined by the order in which they were given in the call. ``*`` is @@ -441,7 +441,7 @@ to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:: - + for i in range(len(food)): print(food[i]) @@ -464,7 +464,7 @@ popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. - + sequence An :term:`iterable` which supports efficient element access using integer indices via the :meth:`__getitem__` special method and defines a @@ -516,7 +516,7 @@ virtual machine A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler. - + Zen of Python Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing Modified: python/branches/py3k/Doc/howto/curses.rst ============================================================================== --- python/branches/py3k/Doc/howto/curses.rst (original) +++ python/branches/py3k/Doc/howto/curses.rst Sat Jan 3 22:18:54 2009 @@ -399,8 +399,8 @@ curses.echo() # Enable echoing of characters - # Get a 15-character string, with the cursor on the top line - s = stdscr.getstr(0,0, 15) + # Get a 15-character string, with the cursor on the top line + s = stdscr.getstr(0,0, 15) The Python :mod:`curses.textpad` module supplies something better. With it, you can turn a window into a text box that supports an Emacs-like set of Modified: python/branches/py3k/Doc/howto/doanddont.rst ============================================================================== --- python/branches/py3k/Doc/howto/doanddont.rst (original) +++ python/branches/py3k/Doc/howto/doanddont.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ ************************************ - Idioms and Anti-Idioms in Python + Idioms and Anti-Idioms in Python ************************************ :Author: Moshe Zadka @@ -94,7 +94,7 @@ # bar.py from foo import a if something(): - a = 2 # danger: foo.a != a + a = 2 # danger: foo.a != a Good example:: @@ -271,6 +271,6 @@ This version is bulletproof:: - value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + calculate_number(10, 20)*forbulate(500, 360)) Modified: python/branches/py3k/Doc/howto/functional.rst ============================================================================== --- python/branches/py3k/Doc/howto/functional.rst (original) +++ python/branches/py3k/Doc/howto/functional.rst Sat Jan 3 22:18:54 2009 @@ -145,7 +145,7 @@ functions are also easier to read and to check for errors. -Ease of debugging and testing +Ease of debugging and testing ----------------------------- Testing and debugging a functional-style program is easier. @@ -213,7 +213,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> Python expects iterable objects in several different contexts, the most important being the ``for`` statement. In the statement ``for X in Y``, Y must @@ -363,7 +363,7 @@ comprehensions are surrounded by square brackets ("[]"). Generator expressions have the form:: - ( expression for expr in sequence1 + ( expression for expr in sequence1 if condition1 for expr2 in sequence2 if condition2 @@ -405,7 +405,7 @@ if not (conditionN): continue # Skip this element - # Output the value of + # Output the value of # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` @@ -419,8 +419,8 @@ >>> seq1 = 'abc' >>> seq2 = (1,2,3) >>> [(x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), + [('a', 1), ('a', 2), ('a', 3), + ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)] To avoid introducing an ambiguity into Python's grammar, if ``expression`` is @@ -627,7 +627,7 @@ Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate the features of generator expressions: -``map(f, iterA, iterB, ...)`` returns an iterator over the sequence +``map(f, iterA, iterB, ...)`` returns an iterator over the sequence ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``. >>> def upper(s): @@ -639,7 +639,7 @@ >>> [upper(s) for s in ['sentence', 'fragment']] ['SENTENCE', 'FRAGMENT'] -You can of course achieve the same effect with a list comprehension. +You can of course achieve the same effect with a list comprehension. ``filter(predicate, iter)`` returns an iterator over all the sequence elements that meet a certain condition, and is similarly duplicated by list @@ -709,7 +709,7 @@ True >>> all([0,1,0]) False - >>> all([0,0,0]) + >>> all([0,0,0]) False >>> all([1,1,1]) True @@ -827,7 +827,7 @@ ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream of tuples, and calls ``f()`` using these tuples as the arguments:: - itertools.starmap(os.path.join, + itertools.starmap(os.path.join, [('/usr', 'bin', 'java'), ('/bin', 'python'), ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) => @@ -887,9 +887,9 @@ :: - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), + city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), + ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), ... ] @@ -904,7 +904,7 @@ where iterator-1 => ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => + iterator-2 => ('Anchorage', 'AK'), ('Nome', 'AK') iterator-3 => ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') @@ -1045,7 +1045,7 @@ >>> double(add(5, 6)) 22 - + The ``unpack`` keyword is provided to work around the fact that Python functions are not always `fully curried `__. By default, it is expected that the ``inner`` function will return a single object @@ -1054,15 +1054,15 @@ will be expanded before being passed to ``outer``. Put simply, :: compose(f, g)(5, 6) - + is equivalent to:: f(g(5, 6)) - + while :: compose(f, g, unpack=True)(5, 6) - + is equivalent to:: f(*g(5, 6)) @@ -1074,21 +1074,21 @@ from functional import compose, partial import functools - + multi_compose = partial(functools.reduce, compose) - - + + We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of ``"".join(...)`` that converts its arguments to string:: from functional import compose, partial - + join = compose("".join, partial(map, str)) ``flip(func)`` - + ``flip()`` wraps the callable in ``func`` and causes it to receive its non-keyword arguments in reverse order. :: @@ -1103,7 +1103,7 @@ (7, 6, 5) ``foldl(func, start, iterable)`` - + ``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable. The function is applied to the starting value and the first element of the list, then the result of that and the second element of the @@ -1117,7 +1117,7 @@ f(f(f(0, 1), 2), 3) - + ``foldl()`` is roughly equivalent to the following recursive function:: def foldl(func, start, seq): @@ -1224,7 +1224,7 @@ 4) Convert the lambda to a def statement, using that name. 5) Remove the comment. -I really like these rules, but you're free to disagree +I really like these rules, but you're free to disagree about whether this lambda-free style is better. @@ -1282,7 +1282,7 @@ Text Processing". Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see +for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__, Modified: python/branches/py3k/Doc/howto/sockets.rst ============================================================================== --- python/branches/py3k/Doc/howto/sockets.rst (original) +++ python/branches/py3k/Doc/howto/sockets.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -62,7 +62,7 @@ #create an INET, STREAMing socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -77,7 +77,7 @@ #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -184,7 +184,7 @@ length message:: class mysocket: - """demonstration class only + """demonstration class only - coded for clarity, not efficiency """ @@ -340,9 +340,9 @@ ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might Modified: python/branches/py3k/Doc/howto/urllib2.rst ============================================================================== --- python/branches/py3k/Doc/howto/urllib2.rst (original) +++ python/branches/py3k/Doc/howto/urllib2.rst Sat Jan 3 22:18:54 2009 @@ -10,7 +10,7 @@ HOWTO, available at `urllib2 - Le Manuel manquant `_. - + Introduction ============ @@ -19,9 +19,9 @@ You may also find useful the following article on fetching web resources with Python: - + * `Basic Authentication `_ - + A tutorial on *Basic Authentication*, with examples in Python. **urllib.request** is a `Python `_ module for fetching URLs @@ -98,7 +98,7 @@ library. :: import urllib.parse - import urllib.request + import urllib.request url = 'http://www.someserver.com/cgi-bin/register.cgi' values = {'name' : 'Michael Foord', @@ -161,15 +161,15 @@ Explorer [#]_. :: import urllib.parse - import urllib.request - + import urllib.request + url = 'http://www.someserver.com/cgi-bin/register.cgi' - user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' + user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - + data = urllib.parse.urlencode(values) req = urllib.request.Request(url, data, headers) response = urllib.request.urlopen(req) @@ -183,7 +183,7 @@ =================== *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as +with Python APIs, builtin exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised). @@ -311,18 +311,18 @@ geturl, and info, methods as returned by the ``urllib.response`` module:: >>> req = urllib.request.Request('http://www.python.org/fish.html') - >>> try: + >>> try: >>> urllib.request.urlopen(req) >>> except urllib.error.URLError, e: >>> print(e.code) >>> print(e.read()) - >>> + >>> 404 - - - Error 404: File Not Found + Error 404: File Not Found ...... etc... Wrapping it Up @@ -376,7 +376,7 @@ print('Error code: ', e.code) else: # everything is fine - + info and geturl =============== @@ -448,7 +448,7 @@ and a 'realm'. The header looks like : ``Www-authenticate: SCHEME realm="REALM"``. -e.g. :: +e.g. :: Www-authenticate: Basic realm="cPanel Users" @@ -472,24 +472,24 @@ than the URL you pass to .add_password() will also match. :: # create a password manager - password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() + password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. # If we knew the realm, we could use it instead of ``None``. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) - handler = urllib.request.HTTPBasicAuthHandler(password_mgr) + handler = urllib.request.HTTPBasicAuthHandler(password_mgr) # create "opener" (OpenerDirector instance) - opener = urllib.request.build_opener(handler) + opener = urllib.request.build_opener(handler) # use the opener to fetch a URL - opener.open(a_url) + opener.open(a_url) # Install the opener. # Now all calls to urllib.request.urlopen use our opener. - urllib.request.install_opener(opener) + urllib.request.install_opener(opener) .. note:: @@ -545,7 +545,7 @@ # timeout in seconds timeout = 10 - socket.setdefaulttimeout(timeout) + socket.setdefaulttimeout(timeout) # this call to urllib.request.urlopen now uses the default timeout # we have set in the socket module @@ -562,7 +562,7 @@ This document was reviewed and revised by John Lee. .. [#] For an introduction to the CGI protocol see - `Writing Web Applications in Python `_. + `Writing Web Applications in Python `_. .. [#] Like Google for example. The *proper* way to use google from a program is to use `PyGoogle `_ of course. See `Voidspace Google `_ @@ -579,6 +579,6 @@ is set to use the proxy, which urllib picks up on. In order to test scripts with a localhost server, I have to prevent urllib from using the proxy. -.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe +.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_. - + Modified: python/branches/py3k/Doc/howto/webservers.rst ============================================================================== --- python/branches/py3k/Doc/howto/webservers.rst (original) +++ python/branches/py3k/Doc/howto/webservers.rst Sat Jan 3 22:18:54 2009 @@ -88,7 +88,7 @@ `_ with some additional information about CGI in Python. - + Simple script for testing CGI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -387,7 +387,7 @@ You might be interested in some WSGI-supporting modules already contained in the standard library, namely: - + * :mod:`wsgiref` -- some tiny utilities and servers for WSGI @@ -500,7 +500,7 @@ time in looking through the most popular ones. Some frameworks have their own template engine or have a recommentation for one. It's wise to use these. - + Popular template engines include: * Mako @@ -688,7 +688,7 @@ found in the Python wiki. .. seealso:: - + The Python wiki contains an extensive list of `web frameworks `_. Modified: python/branches/py3k/Doc/install/index.rst ============================================================================== --- python/branches/py3k/Doc/install/index.rst (original) +++ python/branches/py3k/Doc/install/index.rst Sat Jan 3 22:18:54 2009 @@ -3,7 +3,7 @@ .. _install-index: ***************************** - Installing Python Modules + Installing Python Modules ***************************** :Author: Greg Ward @@ -18,7 +18,7 @@ Thus, I have to be sure to explain the basics at some point: sys.path and PYTHONPATH at least. Should probably give pointers to other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc. - + Finally, it might be useful to include all the material from my "Care and Feeding of a Python Installation" talk in here somewhere. Yow! @@ -268,7 +268,7 @@ statements shown below, and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`:: - Python 2.4 (#26, Aug 7 2004, 17:19:02) + Python 2.4 (#26, Aug 7 2004, 17:19:02) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix @@ -587,8 +587,8 @@ Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. >>> import sys >>> sys.path - ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', - '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', + ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', + '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>> Modified: python/branches/py3k/Doc/library/abc.rst ============================================================================== --- python/branches/py3k/Doc/library/abc.rst (original) +++ python/branches/py3k/Doc/library/abc.rst Sat Jan 3 22:18:54 2009 @@ -128,7 +128,7 @@ A decorator indicating abstract methods. Using this decorator requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. @@ -163,7 +163,7 @@ A subclass of the built-in :func:`property`, indicating an abstract property. Using this function requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract properties can be called using any of the normal Modified: python/branches/py3k/Doc/library/aifc.rst ============================================================================== --- python/branches/py3k/Doc/library/aifc.rst (original) +++ python/branches/py3k/Doc/library/aifc.rst Sat Jan 3 22:18:54 2009 @@ -17,7 +17,7 @@ ability to compress the audio data. .. warning:: - + Some operations may only work under IRIX; these will raise :exc:`ImportError` when attempting to import the :mod:`cl` module, which is only available on IRIX. Modified: python/branches/py3k/Doc/library/array.rst ============================================================================== --- python/branches/py3k/Doc/library/array.rst (original) +++ python/branches/py3k/Doc/library/array.rst Sat Jan 3 22:18:54 2009 @@ -52,7 +52,7 @@ Return a new array whose items are restricted by *typecode*, and initialized from the optional *initializer* value, which must be a list, object - supporting the buffer interface, or iterable over elements of the + supporting the buffer interface, or iterable over elements of the appropriate type. If given a list or string, the initializer is passed to the new array's Modified: python/branches/py3k/Doc/library/ast.rst ============================================================================== --- python/branches/py3k/Doc/library/ast.rst (original) +++ python/branches/py3k/Doc/library/ast.rst Sat Jan 3 22:18:54 2009 @@ -114,7 +114,7 @@ Parse an expression into an AST node. Equivalent to ``compile(expr, filename, mode, ast.PyCF_ONLY_AST)``. - + .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python @@ -192,7 +192,7 @@ .. method:: generic_visit(node) This visitor calls :meth:`visit` on all children of the node. - + Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself. Modified: python/branches/py3k/Doc/library/audioop.rst ============================================================================== --- python/branches/py3k/Doc/library/audioop.rst (original) +++ python/branches/py3k/Doc/library/audioop.rst Sat Jan 3 22:18:54 2009 @@ -260,7 +260,7 @@ in_test = inputdata[pos*2:] ipos, factor = audioop.findfit(in_test, out_test) # Optional (for better cancellation): - # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], + # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) Modified: python/branches/py3k/Doc/library/bdb.rst ============================================================================== --- python/branches/py3k/Doc/library/bdb.rst (original) +++ python/branches/py3k/Doc/library/bdb.rst Sat Jan 3 22:18:54 2009 @@ -325,7 +325,7 @@ Check whether we should break here, depending on the way the breakpoint *b* was set. - + If it was set via line number, it checks if ``b.line`` is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if Modified: python/branches/py3k/Doc/library/cmath.rst ============================================================================== --- python/branches/py3k/Doc/library/cmath.rst (original) +++ python/branches/py3k/Doc/library/cmath.rst Sat Jan 3 22:18:54 2009 @@ -68,9 +68,9 @@ .. function:: polar(x) - Convert a :class:`complex` from rectangular coordinates to polar + Convert a :class:`complex` from rectangular coordinates to polar coordinates. The function returns a tuple with the two elements - *r* and *phi*. *r* is the distance from 0 and *phi* the phase + *r* and *phi*. *r* is the distance from 0 and *phi* the phase angle. Modified: python/branches/py3k/Doc/library/codeop.rst ============================================================================== --- python/branches/py3k/Doc/library/codeop.rst (original) +++ python/branches/py3k/Doc/library/codeop.rst Sat Jan 3 22:18:54 2009 @@ -43,7 +43,7 @@ other value will cause :exc:`ValueError` to be raised. .. warning:: - + It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Sat Jan 3 22:18:54 2009 @@ -43,34 +43,34 @@ :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` :class:`Sized` ``__len__`` :class:`Callable` ``__call__`` - + :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. :class:`Iterable`, and ``__len__`` ``index``, and ``count`` - :class:`Container` - + :class:`Container` + :class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` - + :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:`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:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, :class:`Set` ``__iter__`` @@ -526,8 +526,8 @@ if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result - - def __getnewargs__(self): + + def __getnewargs__(self): return tuple(self) x = property(itemgetter(0)) @@ -674,8 +674,8 @@ :class:`UserDict` objects ------------------------- -The class, :class:`UserDict` acts as a wrapper around dictionary objects. -The need for this class has been partially supplanted by the ability to +The class, :class:`UserDict` acts as a wrapper around dictionary objects. +The need for this class has been partially supplanted by the ability to subclass directly from :class:`dict`; however, this class can be easier to work with because the underlying dictionary is accessible as an attribute. @@ -688,7 +688,7 @@ initialized with its contents; note that a reference to *initialdata* will not be kept, allowing it be used for other purposes. -In addition to supporting the methods and operations of mappings, +In addition to supporting the methods and operations of mappings, :class:`UserDict` instances provide the following attribute: .. attribute:: UserDict.data @@ -701,11 +701,11 @@ ------------------------- This class acts as a wrapper around list objects. It is a useful base class -for your own list-like classes which can inherit from them and override +for your own list-like classes which can inherit from them and override existing methods or add new ones. In this way, one can add new behaviors to lists. -The need for this class has been partially supplanted by the ability to +The need for this class has been partially supplanted by the ability to subclass directly from :class:`list`; however, this class can be easier to work with because the underlying list is accessible as an attribute. @@ -717,12 +717,12 @@ defaulting to the empty list ``[]``. *list* can be any iterable, for example a real Python list or a :class:`UserList` object. -In addition to supporting the methods and operations of mutable sequences, +In addition to supporting the methods and operations of mutable sequences, :class:`UserList` instances provide the following attribute: .. attribute:: UserList.data - A real :class:`list` object used to store the contents of the + A real :class:`list` object used to store the contents of the :class:`UserList` class. **Subclassing requirements:** Subclasses of :class:`UserList` are expect to @@ -740,8 +740,8 @@ :class:`UserString` objects --------------------------- -The class, :class:`UserString` acts as a wrapper around string objects. -The need for this class has been partially supplanted by the ability to +The class, :class:`UserString` acts as a wrapper around string objects. +The need for this class has been partially supplanted by the ability to subclass directly from :class:`str`; however, this class can be easier to work with because the underlying string is accessible as an attribute. @@ -749,8 +749,8 @@ .. class:: UserString([sequence]) Class that simulates a string or a Unicode string object. The instance's - content is kept in a regular string object, which is accessible via the - :attr:`data` attribute of :class:`UserString` instances. The instance's + content is kept in a regular string object, which is accessible via the + :attr:`data` attribute of :class:`UserString` instances. The instance's contents are initially set to a copy of *sequence*. The *sequence* can be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a subclass) or an arbitrary sequence which can be converted into a string using Modified: python/branches/py3k/Doc/library/configparser.rst ============================================================================== --- python/branches/py3k/Doc/library/configparser.rst (original) +++ python/branches/py3k/Doc/library/configparser.rst Sat Jan 3 22:18:54 2009 @@ -344,7 +344,7 @@ import configparser config = configparser.RawConfigParser() - + # When adding sections or items, add them in the reverse order of # how you want them to be displayed in the actual file. # In addition, please note that using RawConfigParser's and the raw @@ -359,7 +359,7 @@ config.set('Section1', 'baz', 'fun') config.set('Section1', 'bar', 'Python') config.set('Section1', 'foo', '%(bar)s is %(baz)s!') - + # Writing our configuration file to 'example.cfg' with open('example.cfg', 'wb') as configfile: config.write(configfile) @@ -399,7 +399,7 @@ print(config.get('Section1', 'foo', 0, {'bar': 'Documentation', 'baz': 'evil'})) -Defaults are available in all three types of ConfigParsers. They are used in +Defaults are available in all three types of ConfigParsers. They are used in interpolation if an option used is not defined elsewhere. :: import configparser @@ -407,7 +407,7 @@ # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'}) config.read('example.cfg') - + print(config.get('Section1', 'foo')) # -> "Python is fun!" config.remove_option('Section1', 'bar') config.remove_option('Section1', 'baz') Modified: python/branches/py3k/Doc/library/constants.rst ============================================================================== --- python/branches/py3k/Doc/library/constants.rst (original) +++ python/branches/py3k/Doc/library/constants.rst Sat Jan 3 22:18:54 2009 @@ -14,13 +14,13 @@ .. data:: False - The false value of the :class:`bool` type. Assignments to ``False`` + The false value of the :class:`bool` type. Assignments to ``False`` are illegal and raise a :exc:`SyntaxError`. .. data:: True - The true value of the :class:`bool` type. Assignments to ``True`` + The true value of the :class:`bool` type. Assignments to ``True`` are illegal and raise a :exc:`SyntaxError`. Modified: python/branches/py3k/Doc/library/crypt.rst ============================================================================== --- python/branches/py3k/Doc/library/crypt.rst (original) +++ python/branches/py3k/Doc/library/crypt.rst Sat Jan 3 22:18:54 2009 @@ -51,7 +51,7 @@ username = input('Python login:') cryptedpasswd = pwd.getpwnam(username)[1] if cryptedpasswd: - if cryptedpasswd == 'x' or cryptedpasswd == '*': + if cryptedpasswd == 'x' or cryptedpasswd == '*': raise "Sorry, currently no support for shadow passwords" cleartext = getpass.getpass() return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd Modified: python/branches/py3k/Doc/library/csv.rst ============================================================================== --- python/branches/py3k/Doc/library/csv.rst (original) +++ python/branches/py3k/Doc/library/csv.rst Sat Jan 3 22:18:54 2009 @@ -82,7 +82,7 @@ be split into lines in a manner which preserves the newline characters. A short usage example:: - + >>> import csv >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|') >>> for row in spamReader: Modified: python/branches/py3k/Doc/library/datetime.rst ============================================================================== --- python/branches/py3k/Doc/library/datetime.rst (original) +++ python/branches/py3k/Doc/library/datetime.rst Sat Jan 3 22:18:54 2009 @@ -264,10 +264,10 @@ considered to be true if and only if it isn't equal to ``timedelta(0)``. Example usage: - + >>> from datetime import timedelta >>> year = timedelta(days=365) - >>> another_year = timedelta(weeks=40, days=84, hours=23, + >>> another_year = timedelta(weeks=40, days=84, hours=23, ... minutes=50, seconds=600) # adds up to 365 days >>> year == another_year True @@ -515,10 +515,10 @@ True >>> my_birthday = date(today.year, 6, 24) >>> if my_birthday < today: - ... my_birthday = my_birthday.replace(year=today.year + 1) + ... my_birthday = my_birthday.replace(year=today.year + 1) >>> my_birthday datetime.date(2008, 6, 24) - >>> time_to_birthday = abs(my_birthday - today) + >>> time_to_birthday = abs(my_birthday - today) >>> time_to_birthday.days 202 @@ -1012,7 +1012,7 @@ >>> tt = dt.timetuple() >>> for it in tt: # doctest: +SKIP ... print(it) - ... + ... 2006 # year 11 # month 21 # day @@ -1041,23 +1041,23 @@ ... def __init__(self): # DST starts last Sunday in March ... d = datetime(dt.year, 4, 1) # ends last Sunday in October ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) - ... def dst(self, dt): + ... def dst(self, dt): ... if self.dston <= dt.replace(tzinfo=None) < self.dstoff: ... return timedelta(hours=1) ... else: ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +1" - ... + ... >>> class GMT2(tzinfo): ... def __init__(self): - ... d = datetime(dt.year, 4, 1) + ... d = datetime(dt.year, 4, 1) ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) @@ -1068,7 +1068,7 @@ ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +2" - ... + ... >>> gmt1 = GMT1() >>> # Daylight Saving Time >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1) @@ -1089,7 +1089,7 @@ datetime.datetime(2006, 6, 14, 13, 0, tzinfo=) >>> dt2.utctimetuple() == dt3.utctimetuple() True - + .. _datetime-time: @@ -1237,12 +1237,12 @@ return ``None`` or a string object. Example: - + >>> from datetime import time, tzinfo >>> class GMT1(tzinfo): ... def utcoffset(self, dt): - ... return timedelta(hours=1) - ... def dst(self, dt): + ... return timedelta(hours=1) + ... def dst(self, dt): ... return timedelta(0) ... def tzname(self,dt): ... return "Europe/Prague" @@ -1473,7 +1473,7 @@ :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any other fixed-offset :class:`tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)). - + .. _strftime-behavior: @@ -1516,7 +1516,7 @@ The full set of format codes supported varies across platforms, because Python calls the platform C library's :func:`strftime` function, and platform -variations are common. +variations are common. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C Modified: python/branches/py3k/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k/Doc/library/decimal.rst (original) +++ python/branches/py3k/Doc/library/decimal.rst Sat Jan 3 22:18:54 2009 @@ -323,7 +323,7 @@ infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity - numeric-string ::= [sign] numeric-value | [sign] nan + numeric-string ::= [sign] numeric-value | [sign] nan If *value* is a :class:`tuple`, it should have three components, a sign (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of @@ -875,7 +875,7 @@ * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer), * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or * :const:`ROUND_UP` (away from zero). - * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero + * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise towards zero) The *traps* and *flags* fields list any signals to be set. Generally, new @@ -1355,7 +1355,7 @@ sqrt(-x) and x > 0 0 ** 0 x ** (non-integer) - x ** Infinity + x ** Infinity .. class:: Overflow @@ -1458,7 +1458,7 @@ Decimal('9.51111111') >>> u + (v + w) Decimal('9.51111111') - >>> + >>> >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003') >>> (u*v) + (u*w) Decimal('0.0060000') @@ -1597,7 +1597,7 @@ """ q = Decimal(10) ** -places # 2 places --> '0.01' - sign, digits, exp = value.quantize(q).as_tuple() + sign, digits, exp = value.quantize(q).as_tuple() result = [] digits = list(map(str, digits)) build, next = result.append, digits.pop @@ -1654,12 +1654,12 @@ getcontext().prec += 2 i, lasts, s, fact, num = 0, 0, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 1 fact *= i - num *= x - s += num / fact - getcontext().prec -= 2 + num *= x + s += num / fact + getcontext().prec -= 2 return +s def cos(x): @@ -1676,13 +1676,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s def sin(x): @@ -1699,13 +1699,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s @@ -1739,7 +1739,7 @@ >>> Decimal('3.214').quantize(TWOPLACES) Decimal('3.21') - >>> # Validate that a number does not exceed two places + >>> # Validate that a number does not exceed two places >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact])) Decimal('3.21') Modified: python/branches/py3k/Doc/library/dis.rst ============================================================================== --- python/branches/py3k/Doc/library/dis.rst (original) +++ python/branches/py3k/Doc/library/dis.rst Sat Jan 3 22:18:54 2009 @@ -79,8 +79,8 @@ Detect all offsets in the code object *code* which are jump targets, and return a list of these offsets. - - + + .. data:: opname Sequence of operation names, indexable using the bytecode. @@ -502,7 +502,7 @@ The low byte of *counts* is the number of values before the list value, the high byte of *counts* the number of values after it. The resulting values are put onto the stack right-to-left. - + .. opcode:: DUP_TOPX (count) @@ -701,7 +701,7 @@ opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, - the function object to call is on the stack. Pops all function arguments, and + the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value. Modified: python/branches/py3k/Doc/library/email.mime.rst ============================================================================== --- python/branches/py3k/Doc/library/email.mime.rst (original) +++ python/branches/py3k/Doc/library/email.mime.rst Sat Jan 3 22:18:54 2009 @@ -2,7 +2,7 @@ ---------------------------------------------------------- .. module:: email.mime - :synopsis: Build MIME messages. + :synopsis: Build MIME messages. Ordinarily, you get a message object structure by passing a file or some text to Modified: python/branches/py3k/Doc/library/fileinput.rst ============================================================================== --- python/branches/py3k/Doc/library/fileinput.rst (original) +++ python/branches/py3k/Doc/library/fileinput.rst Sat Jan 3 22:18:54 2009 @@ -145,7 +145,7 @@ when standard input is read. .. warning:: - + The current implementation does not work for MS-DOS 8+3 filesystems. Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Sat Jan 3 22:18:54 2009 @@ -95,7 +95,7 @@ the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :class:`bytearray` -- it has the same non-mutating methods and the same indexing and slicing behavior. - + Accordingly, constructor arguments are interpreted as for :func:`buffer`. Bytes objects can also be created with literals, see :ref:`strings`. @@ -271,7 +271,7 @@ Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed - operand types, the rules for binary arithmetic operators apply. For integers, + operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as ``(a // b, a % b)``. For floating point numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very close to @@ -411,12 +411,12 @@ .. index:: 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`. - + .. note:: ``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``. @@ -573,7 +573,7 @@ returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, returns a new empty list, ``[]``. - :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. + :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. .. function:: locals() @@ -654,7 +654,7 @@ .. function:: open(file[, mode='r'[, buffering=None[, encoding=None[, errors=None[, newline=None[, closefd=True]]]]]]) Open a file. If the file cannot be opened, :exc:`IOError` is raised. - + *file* is either a string or bytes object 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 @@ -699,7 +699,7 @@ *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 @@ -991,7 +991,7 @@ .. function:: str([object[, encoding[, errors]]]) Return a string version of an object, using one of the following modes: - + If *encoding* and/or *errors* are given, :func:`str` will decode the *object* which can either be a byte string or a character buffer using the codec for *encoding*. The *encoding* parameter is a string giving @@ -1002,7 +1002,7 @@ errors, while a value of ``'ignore'`` causes errors to be silently ignored, and a value of ``'replace'`` causes the official Unicode replacement character, U+FFFD, to be used to replace input characters which cannot be decoded. - See also the :mod:`codecs` module. + See also the :mod:`codecs` module. When only *object* is given, this returns its nicely printable representation. For strings, this is the string itself. The difference with ``repr(object)`` @@ -1042,10 +1042,10 @@ single inheritance, :func:`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. - + The second use case is to support cooperative multiple inheritence 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 + 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 @@ -1080,7 +1080,7 @@ 3])`` returns ``(1, 2, 3)``. If no argument is given, returns a new empty tuple, ``()``. - :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. + :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. .. function:: type(object) @@ -1110,7 +1110,7 @@ >>> class X(object): ... a = 1 - ... + ... >>> X = type('X', (object,), dict(a=1)) @@ -1125,12 +1125,12 @@ .. function:: zip(*iterables) - Make an iterator that aggregates elements from each of the iterables. + Make an iterator that aggregates elements from each of the iterables. Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th element from each of the argument sequences or iterables. The iterator stops when the shortest input iterable is exhausted. With a single - iterable argument, it returns an iterator of 1-tuples. With no arguments, + iterable argument, it returns an iterator of 1-tuples. With no arguments, it returns an empty iterator. Equivalent to:: def zip(*iterables): @@ -1199,7 +1199,7 @@ For example, the statement ``import spam`` results in bytecode resembling the following code:: - + spam = __import__('spam', globals(), locals(), [], -1) The statement ``import spam.ham`` results in this call:: Modified: python/branches/py3k/Doc/library/gettext.rst ============================================================================== --- python/branches/py3k/Doc/library/gettext.rst (original) +++ python/branches/py3k/Doc/library/gettext.rst Sat Jan 3 22:18:54 2009 @@ -369,7 +369,7 @@ If the message id is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's :meth:`ngettext` method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is returned in all other cases. - + Here is an example:: n = len(os.listdir('.')) Modified: python/branches/py3k/Doc/library/heapq.rst ============================================================================== --- python/branches/py3k/Doc/library/heapq.rst (original) +++ python/branches/py3k/Doc/library/heapq.rst Sat Jan 3 22:18:54 2009 @@ -100,7 +100,7 @@ H N - + The module also offers three general purpose functions based on heaps. Modified: python/branches/py3k/Doc/library/idle.rst ============================================================================== --- python/branches/py3k/Doc/library/idle.rst (original) +++ python/branches/py3k/Doc/library/idle.rst Sat Jan 3 22:18:54 2009 @@ -230,7 +230,7 @@ Keywords orange - Strings + Strings green Comments Modified: python/branches/py3k/Doc/library/inspect.rst ============================================================================== --- python/branches/py3k/Doc/library/inspect.rst (original) +++ python/branches/py3k/Doc/library/inspect.rst Sat Jan 3 22:18:54 2009 @@ -384,7 +384,7 @@ .. function:: getargspec(func) - Get the names and default values of a function's arguments. A + Get the names and default values of a function's arguments. A :term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is returned. *args* is a list of the argument names. *varargs* and *varkw* are the names of the ``*`` and @@ -416,7 +416,7 @@ .. function:: getargvalues(frame) - Get information about arguments passed into a particular frame. A :term:`named tuple` + Get information about arguments passed into a particular frame. A :term:`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. *args* is a list of the argument names (it may contain nested lists). *varargs* and *varkw* are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals @@ -484,7 +484,7 @@ .. function:: getframeinfo(frame[, context]) - Get information about a frame or traceback object. A :term:`named tuple` + Get information about a frame or traceback object. A :term:`named tuple` ``Traceback(filename, lineno, function, code_context, index)`` is returned. Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Sat Jan 3 22:18:54 2009 @@ -214,7 +214,7 @@ .. method:: close() Flush and close this stream. This method has no effect if the file is - already closed. Once the file is closed, any operation on the file + already closed. Once the file is closed, any operation on the file (e.g. reading or writing) will raise an :exc:`IOError`. The internal file descriptor isn't closed if *closefd* was False. @@ -628,7 +628,7 @@ .. attribute:: line_buffering Whether line buffering is enabled. - + .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) @@ -659,7 +659,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Sat Jan 3 22:18:54 2009 @@ -74,7 +74,7 @@ .. function:: itertools.chain.from_iterable(iterable) - Alternate constructor for :func:`chain`. Gets chained inputs from a + Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Equivalent to:: @classmethod @@ -89,9 +89,9 @@ Return *r* length subsequences of elements from the input *iterable*. - Combinations are emitted in lexicographic sort order. So, if the + Combinations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the combination tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -306,12 +306,12 @@ Return successive *r* length permutations of elements in the *iterable*. If *r* is not specified or is ``None``, then *r* defaults to the length - of the *iterable* and all possible full-length permutations + of the *iterable* and all possible full-length permutations are generated. - Permutations are emitted in lexicographic sort order. So, if the + Permutations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the permutation tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -342,7 +342,7 @@ else: return - The code for :func:`permutations` can be also expressed as a subsequence of + The code for :func:`permutations` can be also expressed as a subsequence of :func:`product`, filtered to exclude entries with repeated elements (those from the same position in the input pool):: @@ -483,7 +483,7 @@ >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]): ... print(map(operator.itemgetter(1), g)) - ... + ... [1] [4, 5, 6] [10] @@ -610,7 +610,7 @@ 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 + # unique_everseen('ABBCcAD', str.lower) --> A B C D seen = set() seen_add = seen.add if key is None: Modified: python/branches/py3k/Doc/library/json.rst ============================================================================== --- python/branches/py3k/Doc/library/json.rst (original) +++ python/branches/py3k/Doc/library/json.rst Sat Jan 3 22:18:54 2009 @@ -13,7 +13,7 @@ :mod:`marshal` and :mod:`pickle` modules. Encoding basic Python object hierarchies:: - + >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' @@ -42,12 +42,12 @@ >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { - "4": 5, + "4": 5, "6": 7 } Decoding JSON:: - + >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] @@ -74,7 +74,7 @@ Decimal('1.1') Extending :class:`JSONEncoder`:: - + >>> import json >>> class ComplexEncoder(json.JSONEncoder): ... def default(self, obj): @@ -88,12 +88,12 @@ '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[', '2.0', ', ', '1.0', ']'] - + .. highlight:: none Using json.tool from the shell to validate and pretty-print:: - + $ echo '{"json":"obj"}' | python -mjson.tool { "json": "obj" @@ -103,7 +103,7 @@ .. highlight:: python -.. note:: +.. note:: The JSON produced by this module's default settings is a subset of YAML, so it may be used as a serializer for that as well. @@ -367,7 +367,7 @@ For example, to support arbitrary iterators, you could implement default like this:: - + def default(self, o): try: iterable = iter(o) @@ -391,6 +391,6 @@ Encode the given object, *o*, and yield each string representation as available. For example:: - + for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) Modified: python/branches/py3k/Doc/library/locale.rst ============================================================================== --- python/branches/py3k/Doc/library/locale.rst (original) +++ python/branches/py3k/Doc/library/locale.rst Sat Jan 3 22:18:54 2009 @@ -474,7 +474,7 @@ >>> import locale >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale Modified: python/branches/py3k/Doc/library/mailbox.rst ============================================================================== --- python/branches/py3k/Doc/library/mailbox.rst (original) +++ python/branches/py3k/Doc/library/mailbox.rst Sat Jan 3 22:18:54 2009 @@ -1553,7 +1553,7 @@ # that's better than losing a message completely. box.lock() box.add(message) - box.flush() + box.flush() box.unlock() # Remove original message Modified: python/branches/py3k/Doc/library/math.rst ============================================================================== --- python/branches/py3k/Doc/library/math.rst (original) +++ python/branches/py3k/Doc/library/math.rst Sat Jan 3 22:18:54 2009 @@ -98,7 +98,7 @@ .. function:: isnan(x) Checks if the float *x* is a NaN (not a number). NaNs are part of the - IEEE 754 standards. Operation like but not limited to ``inf * 0``, + IEEE 754 standards. Operation like but not limited to ``inf * 0``, ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return a NaN. Modified: python/branches/py3k/Doc/library/mmap.rst ============================================================================== --- python/branches/py3k/Doc/library/mmap.rst (original) +++ python/branches/py3k/Doc/library/mmap.rst Sat Jan 3 22:18:54 2009 @@ -87,7 +87,7 @@ will be relative to the offset from the beginning of the file. *offset* defaults to 0. *offset* must be a multiple of the PAGESIZE or ALLOCATIONGRANULARITY. - + This example shows a simple way of using :class:`mmap`:: import mmap Modified: python/branches/py3k/Doc/library/msvcrt.rst ============================================================================== --- python/branches/py3k/Doc/library/msvcrt.rst (original) +++ python/branches/py3k/Doc/library/msvcrt.rst Sat Jan 3 22:18:54 2009 @@ -18,7 +18,7 @@ The module implements both the normal and wide char variants of the console I/O api. The normal API deals only with ASCII characters and is of limited use -for internationalized applications. The wide char API should be used where +for internationalized applications. The wide char API should be used where ever possible .. _msvcrt-files: @@ -98,11 +98,11 @@ return the keycode. The :kbd:`Control-C` keypress cannot be read with this function. - + .. function:: getwch() Wide char variant of :func:`getch`, returning a Unicode value. - + .. function:: getche() @@ -113,28 +113,28 @@ .. function:: getwche() Wide char variant of :func:`getche`, returning a Unicode value. - + .. function:: putch(char) Print the character *char* to the console without buffering. - + .. function:: putwch(unicode_char) Wide char variant of :func:`putch`, accepting a Unicode value. - + .. function:: ungetch(char) Cause the character *char* to be "pushed back" into the console buffer; it will be the next character read by :func:`getch` or :func:`getche`. - + .. function:: ungetwch(unicode_char) Wide char variant of :func:`ungetch`, accepting a Unicode value. - + .. _msvcrt-other: Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Sat Jan 3 22:18:54 2009 @@ -19,9 +19,9 @@ .. warning:: Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See :issue:`3770` for additional information. .. note:: @@ -36,7 +36,7 @@ >>> p = Pool(5) >>> def f(x): ... return x*x - ... + ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: @@ -75,11 +75,11 @@ print 'module name:', __name__ print 'parent process:', os.getppid() print 'process id:', os.getpid() - + def f(name): info('function f') print 'hello', name - + if __name__ == '__main__': info('main line') p = Process(target=f, args=('bob',)) @@ -541,7 +541,7 @@ .. method:: put(item[, block[, timeout]]) - Put item into the queue. If the optional argument *block* is ``True`` + Put item into the queue. If the optional argument *block* is ``True`` (the default) and *timeout* is ``None`` (the default), block if necessary until a free slot is available. If *timeout* is a positive number, it blocks at most *timeout* seconds and raises the :exc:`queue.Full` exception if no @@ -856,7 +856,7 @@ acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it specifies a timeout in seconds. If *block* is ``False`` then *timeout* is ignored. - + Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments for these will be ignored. @@ -1133,22 +1133,22 @@ server process which is using the given address and authentication key. .. method:: get_server() - + Returns a :class:`Server` object which represents the actual server under - the control of the Manager. The :class:`Server` object supports the + the control of the Manager. The :class:`Server` object supports the :meth:`serve_forever` method:: - + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address=('', 50000), authkey='abc')) >>> server = m.get_server() >>> s.serve_forever() - + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - + Connect a local manager object to a remote manager process:: - + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) >>> m.connect() @@ -1358,7 +1358,7 @@ >>> queue.get() 'hello' -Local processes can also access that queue, using the code from above on the +Local processes can also access that queue, using the code from above on the client to access it remotely:: >>> from multiprocessing import Process, Queue @@ -1369,12 +1369,12 @@ ... super(Worker, self).__init__() ... def run(self): ... self.q.put('local hello') - ... + ... >>> queue = Queue() >>> w = Worker(queue) >>> w.start() >>> class QueueManager(BaseManager): pass - ... + ... >>> QueueManager.register('get_queue', callable=lambda: queue) >>> m = QueueManager(address=('', 50000), authkey='abracadabra') >>> s = m.get_server() @@ -2118,7 +2118,7 @@ .. literalinclude:: ../includes/mp_benchmarks.py An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process` -and others to build a system which can distribute processes and work via a +and others to build a system which can distribute processes and work via a distributed queue to a "cluster" of machines on a network, accessible via SSH. You will need to have private key authentication for all hosts configured for this to work. Modified: python/branches/py3k/Doc/library/nntplib.rst ============================================================================== --- python/branches/py3k/Doc/library/nntplib.rst (original) +++ python/branches/py3k/Doc/library/nntplib.rst Sat Jan 3 22:18:54 2009 @@ -24,16 +24,16 @@ Group comp.lang.python has 59 articles, range 3742 to 3803 >>> resp, subs = s.xhdr('subject', first + '-' + last) >>> for id, sub in subs[-10:]: print(id, sub) - ... + ... 3792 Re: Removing elements from a list while iterating... 3793 Re: Who likes Info files? 3794 Emacs and doc strings 3795 a few questions about the Mac implementation 3796 Re: executable python scripts 3797 Re: executable python scripts - 3798 Re: a few questions about the Mac implementation + 3798 Re: a few questions about the Mac implementation 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules - 3802 Re: executable python scripts + 3802 Re: executable python scripts 3803 Re: \POSIX{} wait and SIGCHLD >>> s.quit() '205 news.cwi.nl closing connection. Goodbye.' Modified: python/branches/py3k/Doc/library/operator.rst ============================================================================== --- python/branches/py3k/Doc/library/operator.rst (original) +++ python/branches/py3k/Doc/library/operator.rst Sat Jan 3 22:18:54 2009 @@ -7,7 +7,7 @@ .. testsetup:: - + import operator from operator import itemgetter @@ -209,7 +209,7 @@ Remove the value of *a* at index *b*. - + .. function:: getitem(a, b) __getitem__(a, b) @@ -337,7 +337,7 @@ >>> class C: ... pass - ... + ... >>> import operator >>> obj = C() >>> operator.isMappingType(obj) @@ -427,9 +427,9 @@ def g(obj): return tuple(obj[item] for item in items) return g - - The items can be any type accepted by the operand's :meth:`__getitem__` - method. Dictionaries accept any hashable value. Lists, tuples, and + + The items can be any type accepted by the operand's :meth:`__getitem__` + method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice: >>> itemgetter(1)('ABCDEFG') Modified: python/branches/py3k/Doc/library/optparse.rst ============================================================================== --- python/branches/py3k/Doc/library/optparse.rst (original) +++ python/branches/py3k/Doc/library/optparse.rst Sat Jan 3 22:18:54 2009 @@ -794,7 +794,7 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an +attributes, or fail to pass required ones, :mod:`optparse` raises an :exc:`OptionError` exception explaining your mistake. An option's *action* determines what :mod:`optparse` does when it encounters Modified: python/branches/py3k/Doc/library/os.rst ============================================================================== --- python/branches/py3k/Doc/library/os.rst (original) +++ python/branches/py3k/Doc/library/os.rst Sat Jan 3 22:18:54 2009 @@ -1226,7 +1226,7 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered @@ -1258,7 +1258,7 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. + inherit the environment of the current process. Availability: Unix, Windows. @@ -1456,7 +1456,7 @@ (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is - preferable to using these functions. Check specially the *Replacing Older + preferable to using these functions. Check specially the *Replacing Older Functions with the subprocess Module* section in that documentation page.) If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new Modified: python/branches/py3k/Doc/library/ossaudiodev.rst ============================================================================== --- python/branches/py3k/Doc/library/ossaudiodev.rst (original) +++ python/branches/py3k/Doc/library/ossaudiodev.rst Sat Jan 3 22:18:54 2009 @@ -16,26 +16,26 @@ use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast majority of Linux audio apps anyways. - + Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: - + > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial > OSS installation manual tells you to remove references to OSS/Free from the > kernel :) - + but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes from its : > * WARNING! WARNING! > * This is an OSS (Linux) audio emulator. > * Use the Native NetBSD API for developing new code, and this > * only for compiling Linux programs. - + There's also an ossaudio manpage on OpenBSD that explains things further. Presumably NetBSD and OpenBSD have a different standard audio interface. That's the great thing about standards, there are so many to choose from ... ;-) - + This probably all warrants a footnote or two, but I don't understand things well enough right now to write it! --GPW Modified: python/branches/py3k/Doc/library/othergui.rst ============================================================================== --- python/branches/py3k/Doc/library/othergui.rst (original) +++ python/branches/py3k/Doc/library/othergui.rst Sat Jan 3 22:18:54 2009 @@ -70,7 +70,7 @@ Robin Dunn. PyGTK, PyQt, and wxPython, all have a modern look and feel and more -widgets than Tkinter. In addition, there are many other GUI toolkits for +widgets than Tkinter. In addition, there are many other GUI toolkits for Python, both cross-platform, and platform-specific. See the `GUI Programming `_ page in the Python Wiki for a much more complete list, and also for links to documents where the Modified: python/branches/py3k/Doc/library/pdb.rst ============================================================================== --- python/branches/py3k/Doc/library/pdb.rst (original) +++ python/branches/py3k/Doc/library/pdb.rst Sat Jan 3 22:18:54 2009 @@ -37,7 +37,7 @@ (Pdb) continue NameError: 'spam' > (1)?() - (Pdb) + (Pdb) :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -65,7 +65,7 @@ >>> pdb.pm() > ./mymodule.py(3)test2() -> print(spam) - (Pdb) + (Pdb) The module defines the following functions; each enters the debugger in a slightly different way: @@ -105,7 +105,7 @@ .. function:: post_mortem([traceback]) - Enter post-mortem debugging of the given *traceback* object. If no + Enter post-mortem debugging of the given *traceback* object. If no *traceback* is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used). Modified: python/branches/py3k/Doc/library/pickle.rst ============================================================================== --- python/branches/py3k/Doc/library/pickle.rst (original) +++ python/branches/py3k/Doc/library/pickle.rst Sat Jan 3 22:18:54 2009 @@ -478,7 +478,7 @@ fact, these methods are part of the copy protocol which implements the :meth:`__reduce__` special method. The copy protocol provides a unified interface for retrieving the data necessary for pickling and copying -objects. [#]_ +objects. [#]_ Although powerful, implementing :meth:`__reduce__` directly in your classes is error prone. For this reason, class designers should use the high-level @@ -715,7 +715,7 @@ .. XXX Add note about how extension codes could evade our protection - mechanism (e.g. cached classes do not invokes find_class()). + mechanism (e.g. cached classes do not invokes find_class()). As our examples shows, you have to be careful with what you allow to be unpickled. Therefore if security is a concern, you may want to consider Modified: python/branches/py3k/Doc/library/profile.rst ============================================================================== --- python/branches/py3k/Doc/library/profile.rst (original) +++ python/branches/py3k/Doc/library/profile.rst Sat Jan 3 22:18:54 2009 @@ -51,15 +51,15 @@ The Python standard library provides two different profilers: -#. :mod:`cProfile` is recommended for most users; it's a C extension +#. :mod:`cProfile` is recommended for most users; it's a C extension with reasonable overhead - that makes it suitable for profiling long-running programs. + that makes it suitable for profiling long-running programs. Based on :mod:`lsprof`, - contributed by Brett Rosen and Ted Czotter. + contributed by Brett Rosen and Ted Czotter. #. :mod:`profile`, a pure Python module whose interface is imitated by - :mod:`cProfile`. Adds significant overhead to profiled programs. - If you're trying to extend + :mod:`cProfile`. Adds significant overhead to profiled programs. + If you're trying to extend the profiler in some way, the task might be easier with this module. Copyright ? 1994, by InfoSeek Corporation. @@ -260,24 +260,24 @@ that the text string in the far right column was used to sort the output. The column headings include: - ncalls + ncalls for the number of calls, - tottime + tottime for the total time spent in the given function (and excluding time made in calls to sub-functions), - percall + percall is the quotient of ``tottime`` divided by ``ncalls`` - cumtime + cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate *even* for recursive functions. - percall + percall is the quotient of ``cumtime`` divided by primitive calls - filename:lineno(function) + filename:lineno(function) provides the respective data of each function When there are two numbers in the first column (for example, ``43/3``), then the Modified: python/branches/py3k/Doc/library/pyexpat.rst ============================================================================== --- python/branches/py3k/Doc/library/pyexpat.rst (original) +++ python/branches/py3k/Doc/library/pyexpat.rst Sat Jan 3 22:18:54 2009 @@ -177,9 +177,9 @@ .. attribute:: xmlparser.buffer_size - The size of the buffer used when :attr:`buffer_text` is true. - A new buffer size can be set by assigning a new integer value - to this attribute. + The size of the buffer used when :attr:`buffer_text` is true. + A new buffer size can be set by assigning a new integer value + to this attribute. When the size is changed, the buffer will be flushed. Modified: python/branches/py3k/Doc/library/queue.rst ============================================================================== --- python/branches/py3k/Doc/library/queue.rst (original) +++ python/branches/py3k/Doc/library/queue.rst Sat Jan 3 22:18:54 2009 @@ -68,7 +68,7 @@ ------------- Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`) -provide the public methods described below. +provide the public methods described below. .. method:: Queue.qsize() @@ -138,20 +138,20 @@ Example of how to wait for enqueued tasks to be completed:: - def worker(): - while True: - item = q.get() - do_work(item) - q.task_done() + def worker(): + while True: + item = q.get() + do_work(item) + q.task_done() - q = Queue() - for i in range(num_worker_threads): + q = Queue() + for i in range(num_worker_threads): t = Thread(target=worker) t.set_daemon(True) - t.start() + t.start() for item in source(): - q.put(item) + q.put(item) q.join() # block until all tasks are done Modified: python/branches/py3k/Doc/library/re.rst ============================================================================== --- python/branches/py3k/Doc/library/re.rst (original) +++ python/branches/py3k/Doc/library/re.rst Sat Jan 3 22:18:54 2009 @@ -221,7 +221,7 @@ ``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters set the corresponding flags: :const:`re.a` (ASCII-only matching), :const:`re.I` (ignore case), :const:`re.L` (locale dependent), - :const:`re.M` (multi-line), :const:`re.S` (dot matches all), + :const:`re.M` (multi-line), :const:`re.S` (dot matches all), and :const:`re.X` (verbose), for the entire regular expression. (The flags are described in :ref:`contents-of-module-re`.) This is useful if you wish to include the flags as part of the regular @@ -487,7 +487,7 @@ counterpart ``(?u)``), but these are redundant in Python 3.0 since matches are Unicode by default for strings (and Unicode matching isn't allowed for bytes). - + .. data:: I IGNORECASE @@ -1011,14 +1011,14 @@ >>> pair.match("717ak").group(1) '7' - + # Error because re.match() returns None, which doesn't have a group() method: >>> pair.match("718ak").group(1) Traceback (most recent call last): File "", line 1, in re.match(r".*(.).*\1", "718ak").group(1) AttributeError: 'NoneType' object has no attribute 'group' - + >>> pair.match("354aa").group(1) 'a' @@ -1127,7 +1127,7 @@ Making a Phonebook ^^^^^^^^^^^^^^^^^^ -:func:`split` splits a string into a list delimited by the passed pattern. The +:func:`split` splits a string into a list delimited by the passed pattern. The method is invaluable for converting textual data into data structures that can be easily read and modified by Python as demonstrated in the following example that creates a phonebook. @@ -1136,7 +1136,7 @@ triple-quoted string syntax: >>> input = """Ross McFluff: 834.345.1254 155 Elm Street - ... + ... ... Ronald Heathmore: 892.345.3428 436 Finley Avenue ... Frank Burger: 925.541.7625 662 South Dogwood Way ... Modified: python/branches/py3k/Doc/library/rlcompleter.rst ============================================================================== --- python/branches/py3k/Doc/library/rlcompleter.rst (original) +++ python/branches/py3k/Doc/library/rlcompleter.rst Sat Jan 3 22:18:54 2009 @@ -61,6 +61,6 @@ If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`__getattr__`) up to the last part, and find matches for the rest via the - :func:`dir` function. Any exception raised during the evaluation of the + :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned. Modified: python/branches/py3k/Doc/library/sched.rst ============================================================================== --- python/branches/py3k/Doc/library/sched.rst (original) +++ python/branches/py3k/Doc/library/sched.rst Sat Jan 3 22:18:54 2009 @@ -42,7 +42,7 @@ 930343700.276 In multi-threaded environments, the :class:`scheduler` class has limitations -with respect to thread-safety, inability to insert a new task before +with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the :class:`threading.Timer` class instead. Modified: python/branches/py3k/Doc/library/shutil.rst ============================================================================== --- python/branches/py3k/Doc/library/shutil.rst (original) +++ python/branches/py3k/Doc/library/shutil.rst Sat Jan 3 22:18:54 2009 @@ -20,7 +20,7 @@ Even the higher-level file copying functions (:func:`copy`, :func:`copy2`) can't copy all file metadata. - + On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will Modified: python/branches/py3k/Doc/library/signal.rst ============================================================================== --- python/branches/py3k/Doc/library/signal.rst (original) +++ python/branches/py3k/Doc/library/signal.rst Sat Jan 3 22:18:54 2009 @@ -39,12 +39,12 @@ * Some care must be taken if both signals and threads are used in the same program. The fundamental thing to remember in using signals and threads simultaneously is: always perform :func:`signal` operations in the main thread - of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, - :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread - can set a new signal handler, and the main thread will be the only one to - receive signals (this is enforced by the Python :mod:`signal` module, even - if the underlying thread implementation supports sending signals to - individual threads). This means that signals can't be used as a means of + of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, + :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread + can set a new signal handler, and the main thread will be the only one to + receive signals (this is enforced by the Python :mod:`signal` module, even + if the underlying thread implementation supports sending signals to + individual threads). This means that signals can't be used as a means of inter-thread communication. Use locks instead. The variables defined in the :mod:`signal` module are: @@ -80,22 +80,22 @@ One more than the number of the highest signal number. -.. data:: ITIMER_REAL +.. data:: ITIMER_REAL Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration. -.. data:: ITIMER_VIRTUAL +.. data:: ITIMER_VIRTUAL - Decrements interval timer only when the process is executing, and delivers + Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration. .. data:: ITIMER_PROF - - Decrements interval timer both when the process executes and when the - system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, - this timer is usually used to profile the time spent by the application + + Decrements interval timer both when the process executes and when the + system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, + this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration. @@ -105,7 +105,7 @@ Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid - interval timer or a negative time is passed to :func:`setitimer`. + interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`IOError`. @@ -143,21 +143,21 @@ .. function:: setitimer(which, seconds[, interval]) - Sets given interval timer (one of :const:`signal.ITIMER_REAL`, + Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified - by *which* to fire after *seconds* (float is accepted, different from + by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds. The interval timer specified by *which* can be cleared by setting seconds to zero. When an interval timer fires, a signal is sent to the process. - The signal sent is dependent on the timer being used; - :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, + The signal sent is dependent on the timer being used; + :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`. The old values are returned as a tuple: (delay, interval). - Attempting to pass an invalid interval timer will cause a + Attempting to pass an invalid interval timer will cause a :exc:`ItimerError`. @@ -186,7 +186,7 @@ will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing. Availability: Unix (see the man page :manpage:`siginterrupt(3)` for further information). - + Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag* value for the given signal. @@ -233,7 +233,7 @@ signal.alarm(5) # This open() may hang indefinitely - fd = os.open('/dev/ttyS0', os.O_RDWR) + fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm Modified: python/branches/py3k/Doc/library/smtplib.rst ============================================================================== --- python/branches/py3k/Doc/library/smtplib.rst (original) +++ python/branches/py3k/Doc/library/smtplib.rst Sat Jan 3 22:18:54 2009 @@ -182,9 +182,9 @@ Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the - response for ESMTP option and store them for use by :meth:`has_extn`. - Also sets several informational attributes: the message returned by - the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` + response for ESMTP option and store them for use by :meth:`has_extn`. + Also sets several informational attributes: the message returned by + the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to true or false depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their Modified: python/branches/py3k/Doc/library/socket.rst ============================================================================== --- python/branches/py3k/Doc/library/socket.rst (original) +++ python/branches/py3k/Doc/library/socket.rst Sat Jan 3 22:18:54 2009 @@ -178,10 +178,10 @@ .. data:: SIO_* RCVALL_* - + Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`ioctl` method of socket objects. - + .. data:: TIPC_* @@ -210,7 +210,7 @@ all the necessary arguments for creating the corresponding socket. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. - The rest of the arguments are optional and must be numeric if specified. + The rest of the arguments are optional and must be numeric if specified. By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following @@ -544,14 +544,14 @@ contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as byte strings). - + .. method:: socket.ioctl(control, option) - :platform: Windows - + :platform: Windows + The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the MSDN documentation for more information. - + .. method:: socket.listen(backlog) @@ -851,7 +851,7 @@ s.close() print('Received', repr(data)) - + The last example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface:: @@ -860,19 +860,19 @@ # the public network interface HOST = socket.gethostbyname(socket.gethostname()) - + # create a raw socket and bind it to the public interface s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) s.bind((HOST, 0)) - + # Include IP headers s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) - + # receive all packages s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) - + # receive a package print(s.recvfrom(65565)) - + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) Modified: python/branches/py3k/Doc/library/sqlite3.rst ============================================================================== --- python/branches/py3k/Doc/library/sqlite3.rst (original) +++ python/branches/py3k/Doc/library/sqlite3.rst Sat Jan 3 22:18:54 2009 @@ -541,8 +541,8 @@ This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each - column where the last six items of each tuple are :const:`None`. - + column where the last six items of each tuple are :const:`None`. + It is set for ``SELECT`` statements without any matching rows as well. .. _sqlite3-row-objects: @@ -553,7 +553,7 @@ .. class:: Row A :class:`Row` instance serves as a highly optimized - :attr:`~Connection.row_factory` for :class:`Connection` objects. + :attr:`~Connection.row_factory` for :class:`Connection` objects. It tries to mimic a tuple in most of its features. It supports mapping access by column name and index, iteration, @@ -561,7 +561,7 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - + .. versionchanged:: 2.6 Added iteration and equality (hashability). @@ -780,7 +780,7 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. +Data Modification Language (DML) statement (i.e. ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions implicitly before a non-DML, non-query statement (i. e. anything other than ``SELECT`` or the aforementioned). Modified: python/branches/py3k/Doc/library/ssl.rst ============================================================================== --- python/branches/py3k/Doc/library/ssl.rst (original) +++ python/branches/py3k/Doc/library/ssl.rst Sat Jan 3 22:18:54 2009 @@ -45,7 +45,7 @@ .. exception:: SSLError - Raised to signal an error from the underlying SSL implementation. This + Raised to signal an error from the underlying SSL implementation. This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`socket.error`, which @@ -170,7 +170,7 @@ >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' - >>> + >>> .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None) @@ -397,7 +397,7 @@ the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, -that is, a certificate which has the same subject and issuer, +that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the @@ -433,13 +433,13 @@ you only need the root certificates, and the remote peer is supposed to furnish the other certificates necessary to chain from its certificate to a root certificate. -See :rfc:`4158` for more discussion of the way in which +See :rfc:`4158` for more discussion of the way in which certification chains can be built. If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, -such as buying one from a certification authority. Another common +such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following:: @@ -581,7 +581,7 @@ And go back to listening for new client connections. - + .. seealso:: Class :class:`socket.socket` Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sat Jan 3 22:18:54 2009 @@ -172,7 +172,7 @@ any operand is a complex number, the objects are of different types that cannot be compared, or other cases where there is no defined ordering. -.. index:: +.. index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) @@ -330,14 +330,14 @@ for well-defined conversions. (4) - float also accepts the strings "nan" and "inf" with an optional prefix "+" + float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity. (5) Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for programming languages. - + All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: @@ -460,7 +460,7 @@ original float and with a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - + .. versionadded:: 2.6 Two methods support conversion to @@ -875,7 +875,7 @@ otherwise. Decimal characters include digit characters, and all characters that that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. - + .. method:: str.isdigit() @@ -903,7 +903,7 @@ that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. - + .. method:: str.isprintable() Return true if all characters in the string are printable or the string is @@ -1474,7 +1474,7 @@ example, sort by department, then by salary grade). While a list is being sorted, the effect of attempting to mutate, or even - inspect, the list is undefined. The C implementation + inspect, the list is undefined. The C implementation makes the list appear empty for the duration, and raises :exc:`ValueError` if it can detect that the list has been mutated during a sort. @@ -1525,7 +1525,7 @@ b'\xf0\xf1\xf2' The translate method differs in semantics from the version available on strings: - + .. method:: bytes.translate(table[, delete]) Return a copy of the bytes or bytearray object where all bytes occurring in @@ -1807,7 +1807,7 @@ Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map. - + If a subclass of dict defines a method :meth:`__missing__`, if the key *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or raises whatever is @@ -2149,7 +2149,7 @@ positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). There is no return value. - + For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last. Modified: python/branches/py3k/Doc/library/string.rst ============================================================================== --- python/branches/py3k/Doc/library/string.rst (original) +++ python/branches/py3k/Doc/library/string.rst Sat Jan 3 22:18:54 2009 @@ -98,7 +98,7 @@ :meth:`format` is just a wrapper that calls :meth:`vformat`. .. method:: vformat(format_string, args, kwargs) - + This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the @@ -111,12 +111,12 @@ intended to be replaced by subclasses: .. method:: parse(format_string) - + Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string in to either literal text, or replacement fields. - + The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then @@ -134,7 +134,7 @@ *key* parameter to :meth:`get_value`. .. method:: get_value(key, args, kwargs) - + Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a @@ -172,7 +172,7 @@ method is provided so that subclasses can override it. .. method:: convert_field(value, conversion) - + Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method.) The default version understands 'r' (repr) and 's' (str) conversion types. @@ -201,7 +201,7 @@ element_index: `integer` conversion: "r" | "s" | "a" format_spec: - + In less formal terms, the replacement field starts with a *field_name*, which can either be a number (for a positional argument), or an identifier (for keyword arguments). Following this is an optional *conversion* field, which is @@ -221,7 +221,7 @@ "My quest is {name}" # References keyword argument 'name' "Weight in tons {0.weight}" # 'weight' attribute of first positional arg "Units destroyed: {players[0]}" # First element of keyword argument 'players'. - + The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted @@ -265,11 +265,11 @@ Then the outer replacement field would be evaluated, producing:: "noses " - + Which is substituted into the string, yielding:: - + "A man with two noses " - + (The extra space is because we specified a field width of 10, and because left alignment is the default for strings.) @@ -301,7 +301,7 @@ width: `integer` precision: `integer` type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - + The *fill* character can be any character other than '}' (which signifies the end of the field). The presence of a fill character is signaled by the *next* character, which must be one of the alignment options. If the second character @@ -394,9 +394,9 @@ +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ - + The available presentation types for floating point and decimal values are: - + +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ Modified: python/branches/py3k/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k/Doc/library/subprocess.rst (original) +++ python/branches/py3k/Doc/library/subprocess.rst Sat Jan 3 22:18:54 2009 @@ -126,7 +126,7 @@ Special value that can be used as the *stderr* argument to :class:`Popen` and indicates that standard error should go into the same handle as standard output. - + Convenience Functions ^^^^^^^^^^^^^^^^^^^^^ @@ -346,7 +346,7 @@ The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly by :meth:`communicate`). A ``None`` value indicates that the process hasn't terminated yet. - + A negative value ``-N`` indicates that the child was terminated by signal ``N`` (Unix only). Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Sat Jan 3 22:18:54 2009 @@ -327,7 +327,7 @@ The *default* argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would - cause a `TypeError`. + cause a `TypeError`. func:`getsizeof` calls the object's __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. @@ -642,7 +642,7 @@ The events have the following meaning: - ``'call'`` + ``'call'`` A function is called (or some other code block entered). The global trace function is called; *arg* is ``None``; the return value specifies the local trace function. @@ -704,7 +704,7 @@ prompts of :func:`input`. The interpreter's own prompts and (almost all of) its error messages go to ``stderr``. ``stdout`` and ``stderr`` needn't be built-in file objects: any object is acceptable as long - as it has a :meth:`write` method that takes a string argument. (Changing these + as it has a :meth:`write` method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) Modified: python/branches/py3k/Doc/library/tk.rst ============================================================================== --- python/branches/py3k/Doc/library/tk.rst (original) +++ python/branches/py3k/Doc/library/tk.rst Sat Jan 3 22:18:54 2009 @@ -12,7 +12,7 @@ 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` +using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix` module. The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. To @@ -23,15 +23,15 @@ mechanism which allows Python and Tcl to interact. :mod:`tkinter`'s chief virtues are that it is fast, and that it usually comes -bundled with Python. Although its standard documentation is weak, good -material is available, which includes: references, tutorials, a book and -others. :mod:`tkinter` is also famous for having an outdated look and feel, -which has been vastly improved in Tk 8.5. Nevertheless, there are many other -GUI libraries that you could be interested in. For more information about +bundled with Python. Although its standard documentation is weak, good +material is available, which includes: references, tutorials, a book and +others. :mod:`tkinter` is also famous for having an outdated look and feel, +which has been vastly improved in Tk 8.5. Nevertheless, there are many other +GUI libraries that you could be interested in. For more information about alternatives, see the :ref:`other-gui-packages` section. .. toctree:: - + tkinter.rst tkinter.tix.rst tkinter.scrolledtext.rst Modified: python/branches/py3k/Doc/library/tkinter.rst ============================================================================== --- python/branches/py3k/Doc/library/tkinter.rst (original) +++ python/branches/py3k/Doc/library/tkinter.rst Sat Jan 3 22:18:54 2009 @@ -41,7 +41,7 @@ linked with the Python interpreter. In addition to the Tk interface module, :mod:`tkinter` includes a number of -Python modules, :mod:`tkinter.constants` being one of the most important. +Python modules, :mod:`tkinter.constants` being one of the most important. Importing :mod:`tkinter` will automatically import :mod:`tkinter.constants`, so, usually, to use Tkinter all you need is a simple import statement:: @@ -96,7 +96,7 @@ Basic dialogs and convenience functions. :mod:`tkinter.dnd` - Drag-and-drop support for :mod:`tkinter`. This is experimental and should + Drag-and-drop support for :mod:`tkinter`. This is experimental and should become deprecated when it is replaced with the Tk DND. :mod:`turtle` @@ -156,7 +156,7 @@ the novice. The book is not exhaustive, and for many details it defers to the man pages. -* :file:`tkinter/__init__.py` is a last resort for most, but can be a good +* :file:`tkinter/__init__.py` is a last resort for most, but can be a good place to go when nothing else makes sense. @@ -271,7 +271,7 @@ someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say:: - .fred someAction someOptions + .fred someAction someOptions Note that the object name, ``.fred``, starts with a dot. @@ -320,7 +320,7 @@ arguments. In Tkinter, the Pack class holds all this functionality, and the various forms of the pack command are implemented as methods. All widgets in :mod:`tkinter` are subclassed from the Packer, and so inherit all the packing -methods. See the :mod:`tkinter.tix` module documentation for additional +methods. See the :mod:`tkinter.tix` module documentation for additional information on the Form geometry manager. :: pack .fred -side left =====> fred.pack(side = "left") @@ -477,7 +477,7 @@ For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout's book. -anchor +anchor Anchor type. Denotes where the packer is to place each slave in its parcel. expand @@ -707,7 +707,7 @@ they are denoted in Tk, which can be useful when referring to the Tk man pages. :: - Tk Tkinter Event Field Tk Tkinter Event Field + Tk Tkinter Event Field Tk Tkinter Event Field -- ------------------- -- ------------------- %f focus %A char %h height %E send_event Modified: python/branches/py3k/Doc/library/tkinter.tix.rst ============================================================================== --- python/branches/py3k/Doc/library/tkinter.tix.rst (original) +++ python/branches/py3k/Doc/library/tkinter.tix.rst Sat Jan 3 22:18:54 2009 @@ -8,12 +8,12 @@ .. index:: single: Tix -The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional -rich set of widgets. Although the standard Tk library has many useful widgets, +The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional +rich set of widgets. Although the standard Tk library has many useful widgets, they are far from complete. The :mod:`tkinter.tix` library provides most of the -commonly needed widgets that are missing from standard Tk: :class:`HList`, -:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of -scrollable widgets. +commonly needed widgets that are missing from standard Tk: :class:`HList`, +:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of +scrollable widgets. :mod:`tkinter.tix` also includes many more widgets that are generally useful in a wide range of applications: :class:`NoteBook`, :class:`FileEntry`, :class:`PanedWindow`, etc; there are more than 40 of them. @@ -50,10 +50,10 @@ Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. - Classes in the :mod:`tkinter.tix` module subclasses the classes in the - :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` - with Tkinter, all you need to do is to import one module. In general, you - can just import :mod:`tkinter.tix`, and replace the toplevel call to + Classes in the :mod:`tkinter.tix` module subclasses the classes in the + :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` + with Tkinter, all you need to do is to import one module. In general, you + can just import :mod:`tkinter.tix`, and replace the toplevel call to :class:`tkinter.Tk` with :class:`tix.Tk`:: from tkinter import tix @@ -437,7 +437,7 @@ The :mod:`tkinter.tix` module adds: * `pixmap `_ - capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create + capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create color images from XPM files. .. Python Demo of: Modified: python/branches/py3k/Doc/library/tokenize.rst ============================================================================== --- python/branches/py3k/Doc/library/tokenize.rst (original) +++ python/branches/py3k/Doc/library/tokenize.rst Sat Jan 3 22:18:54 2009 @@ -19,16 +19,16 @@ The :func:`tokenize` generator requires one argument, *readline*, which must be a callable object which provides the same interface as the :meth:`readline` method of built-in file objects (see section - :ref:`bltin-file-objects`). Each call to the function should return one + :ref:`bltin-file-objects`). Each call to the function should return one line of input as bytes. - The generator produces 5-tuples with these members: the token type; the - token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and - column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of - ints specifying the row and column where the token ends in the source; and + The generator produces 5-tuples with these members: the token type; the + token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and + column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of + ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed (the last tuple item) is the *logical* line; continuation lines are included. - + :func:`tokenize` determines the source encoding of the file by looking for a UTF-8 BOM or encoding cookie, according to :pep:`263`. @@ -44,35 +44,35 @@ .. data:: NL Token value used to indicate a non-terminating newline. The NEWLINE token - indicates the end of a logical line of Python code; NL tokens are generated + indicates the end of a logical line of Python code; NL tokens are generated when a logical line of code is continued over multiple physical lines. .. data:: ENCODING - Token value that indicates the encoding used to decode the source bytes - into text. The first token returned by :func:`tokenize` will always be an + Token value that indicates the encoding used to decode the source bytes + into text. The first token returned by :func:`tokenize` will always be an ENCODING token. -Another function is provided to reverse the tokenization process. This is -useful for creating tools that tokenize a script, modify the token stream, and +Another function is provided to reverse the tokenization process. This is +useful for creating tools that tokenize a script, modify the token stream, and write back the modified script. .. function:: untokenize(iterable) Converts tokens back into Python source code. The *iterable* must return - sequences with at least two elements, the token type and the token string. + sequences with at least two elements, the token type and the token string. Any additional sequence elements are ignored. - + The reconstructed script is returned as a single string. The result is guaranteed to tokenize back to match the input so that the conversion is - lossless and round-trips are assured. The guarantee applies only to the - token type and token string as the spacing between tokens (column + lossless and round-trips are assured. The guarantee applies only to the + token type and token string as the spacing between tokens (column positions) may change. - - It returns bytes, encoded using the ENCODING token, which is the first + + It returns bytes, encoded using the ENCODING token, which is the first token sequence output by :func:`tokenize`. @@ -81,43 +81,43 @@ .. function:: detect_encoding(readline) - The :func:`detect_encoding` function is used to detect the encoding that - should be used to decode a Python source file. It requires one argment, + The :func:`detect_encoding` function is used to detect the encoding that + should be used to decode a Python source file. It requires one argment, readline, in the same way as the :func:`tokenize` generator. - + It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (not decoded from bytes) it has read in. - + It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. - - If no encoding is specified, then the default of 'utf-8' will be returned. - + If no encoding is specified, then the default of 'utf-8' will be returned. + + Example of a script re-writer that transforms float literals into Decimal objects:: def decistmt(s): """Substitute Decimals for floats in a string of statements. - + >>> from decimal import Decimal >>> s = 'print(+21.3e-5*-.1234/81.7)' >>> decistmt(s) "print (+Decimal ('21.3e-5')*-Decimal ('.1234')/Decimal ('81.7'))" - + The format of the exponent is inherited from the platform C library. Known cases are "e-007" (Windows) and "e-07" (not Windows). Since we're only showing 12 digits, and the 13th isn't close to 5, the rest of the output should be platform-independent. - + >>> exec(s) #doctest: +ELLIPSIS -3.21716034272e-0...7 - + Output from calculations with Decimal should be identical across all platforms. - + >>> exec(decistmt(s)) -3.217160342717258261933904529E-7 """ Modified: python/branches/py3k/Doc/library/trace.rst ============================================================================== --- python/branches/py3k/Doc/library/trace.rst (original) +++ python/branches/py3k/Doc/library/trace.rst Sat Jan 3 22:18:54 2009 @@ -65,13 +65,13 @@ :option:`--ignore-module` Accepts comma separated list of module names. Ignore each of the named - module and its submodules (if it is a package). May be given + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` Ignore all modules and packages in the named directory and subdirectories (multiple directories can be joined by os.pathsep). May be given multiple - times. + times. .. _trace-api: Modified: python/branches/py3k/Doc/library/traceback.rst ============================================================================== --- python/branches/py3k/Doc/library/traceback.rst (original) +++ python/branches/py3k/Doc/library/traceback.rst Sat Jan 3 22:18:54 2009 @@ -163,10 +163,10 @@ def lumberjack(): bright_side_of_death() - + def bright_side_of_death(): return tuple()[0] - + try: lumberjack() except: @@ -245,12 +245,12 @@ >>> import traceback >>> def another_function(): ... lumberstack() - ... + ... >>> def lumberstack(): ... traceback.print_stack() ... print(repr(traceback.extract_stack())) ... print(repr(traceback.format_stack())) - ... + ... >>> another_function() File "", line 10, in another_function() Modified: python/branches/py3k/Doc/library/turtle.rst ============================================================================== --- python/branches/py3k/Doc/library/turtle.rst (original) +++ python/branches/py3k/Doc/library/turtle.rst Sat Jan 3 22:18:54 2009 @@ -1563,7 +1563,7 @@ Subclass of TurtleScreen, with :ref:`four methods added `. - + .. class:: ScrolledCavas(master) :param master: some Tkinter widget to contain the ScrolledCanvas, i.e. @@ -1588,13 +1588,13 @@ "compound" ``None`` (a compund shape has to be constructed using the :meth:`addcomponent` method) =========== =========== - + .. method:: addcomponent(poly, fill, outline=None) :param poly: a polygon, i.e. a tuple of pairs of numbers :param fill: a color the *poly* will be filled with :param outline: a color for the poly's outline (if given) - + Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1638,31 +1638,31 @@ >>> help(Screen.bgcolor) Help on method bgcolor in module turtle: - + bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - - + + >>> screen.bgcolor("orange") >>> screen.bgcolor() "orange" >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() "#800080" - + >>> help(Turtle.penup) Help on method penup in module turtle: - + penup(self) unbound turtle.Turtle method Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + >>> turtle.penup() - The docstrings of the functions which are derived from methods have a modified @@ -1670,32 +1670,32 @@ >>> help(bgcolor) Help on function bgcolor in module turtle: - + bgcolor(*args) Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - + Example:: - + >>> bgcolor("orange") >>> bgcolor() "orange" >>> bgcolor(0.5,0,0.5) >>> bgcolor() "#800080" - + >>> help(penup) Help on function penup in module turtle: - + penup() Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + Example: >>> penup() @@ -1871,19 +1871,19 @@ Changes since Python 2.6 ======================== -- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and - :meth:`Turtle.window_height` have been eliminated. - Methods with these names and functionality are now available only +- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and + :meth:`Turtle.window_height` have been eliminated. + Methods with these names and functionality are now available only as methods of :class:`Screen`. The functions derived from these remain - available. (In fact already in Python 2.6 these methods were merely - duplications of the corresponding + available. (In fact already in Python 2.6 these methods were merely + duplications of the corresponding :class:`TurtleScreen`/:class:`Screen`-methods.) -- The method :meth:`Turtle.fill` has been eliminated. - The behaviour of :meth:`begin_fill` and :meth:`end_fill` - have changed slightly: now every filling-process must be completed with an +- The method :meth:`Turtle.fill` has been eliminated. + The behaviour of :meth:`begin_fill` and :meth:`end_fill` + have changed slightly: now every filling-process must be completed with an ``end_fill()`` call. - + - A method :meth:`Turtle.filling` has been added. It returns a boolean value: ``True`` if a filling process is under way, ``False`` otherwise. This behaviour corresponds to a ``fill()`` call without arguments in Modified: python/branches/py3k/Doc/library/unicodedata.rst ============================================================================== --- python/branches/py3k/Doc/library/unicodedata.rst (original) +++ python/branches/py3k/Doc/library/unicodedata.rst Sat Jan 3 22:18:54 2009 @@ -156,7 +156,7 @@ File "", line 1, in ? ValueError: not a decimal >>> unicodedata.category('A') # 'L'etter, 'u'ppercase - 'Lu' + 'Lu' >>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber 'AN' Modified: python/branches/py3k/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k/Doc/library/unittest.rst (original) +++ python/branches/py3k/Doc/library/unittest.rst Sat Jan 3 22:18:54 2009 @@ -591,7 +591,7 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare @@ -602,7 +602,7 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare Modified: python/branches/py3k/Doc/library/warnings.rst ============================================================================== --- python/branches/py3k/Doc/library/warnings.rst (original) +++ python/branches/py3k/Doc/library/warnings.rst Sat Jan 3 22:18:54 2009 @@ -279,15 +279,15 @@ this function with an alternative implementation by assigning to ``warnings.showwarning``. *line* is a line of source code to be included in the warning - message; if *line* is not supplied, :func:`showwarning` will + message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. function:: formatwarning(message, category, filename, lineno[, line]) Format a warning the standard way. This returns a string which may contain - embedded newlines and ends in a newline. *line* is - a line of source code to be included in the warning message; if *line* is not supplied, + embedded newlines and ends in a newline. *line* is + a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. Modified: python/branches/py3k/Doc/library/webbrowser.rst ============================================================================== --- python/branches/py3k/Doc/library/webbrowser.rst (original) +++ python/branches/py3k/Doc/library/webbrowser.rst Sat Jan 3 22:18:54 2009 @@ -155,7 +155,7 @@ url = 'http://www.python.org' - # Open URL in a new tab, if a browser window is already open. + # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(url + '/doc') # Open URL in new window, raising the window if possible. Modified: python/branches/py3k/Doc/library/wsgiref.rst ============================================================================== --- python/branches/py3k/Doc/library/wsgiref.rst (original) +++ python/branches/py3k/Doc/library/wsgiref.rst Sat Jan 3 22:18:54 2009 @@ -168,7 +168,7 @@ filelike = StringIO("This is an example file-like object"*10) wrapper = FileWrapper(filelike, blksize=5) - for chunk in wrapper: + for chunk in wrapper: print(chunk) @@ -413,7 +413,7 @@ from wsgiref.validate import validator from wsgiref.simple_server import make_server - # Our callable object which is intentionally not compliant to the + # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): status = b'200 OK' # HTTP Status 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 Sat Jan 3 22:18:54 2009 @@ -32,7 +32,7 @@ A C implementation of this API is available as :mod:`xml.etree.cElementTree`. See http://effbot.org/zone/element-index.htm for tutorials and links to other -docs. Fredrik Lundh's page is also the location of the development version of the +docs. Fredrik Lundh's page is also the location of the development version of the xml.etree.ElementTree. .. _elementtree-functions: @@ -379,7 +379,7 @@ Example page -

Moved to example.org +

Moved to example.org or example.com.

@@ -486,9 +486,9 @@ :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method for each opening tag, its :meth:`end` method for each closing tag, -and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` -calls *target*\'s method :meth:`close`. -:class:`XMLTreeBuilder` can be used not only for building a tree structure. +and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` +calls *target*\'s method :meth:`close`. +:class:`XMLTreeBuilder` can be used not only for building a tree structure. This is an example of counting the maximum depth of an XML file:: >>> from xml.etree.ElementTree import XMLTreeBuilder @@ -496,16 +496,16 @@ ... maxDepth = 0 ... depth = 0 ... def start(self, tag, attrib): # Called for each opening tag. - ... self.depth += 1 + ... self.depth += 1 ... if self.depth > self.maxDepth: ... self.maxDepth = self.depth ... def end(self, tag): # Called for each closing tag. ... self.depth -= 1 - ... def data(self, data): + ... def data(self, data): ... pass # We do not need to do anything with data. ... def close(self): # Called when all data has been parsed. ... return self.maxDepth - ... + ... >>> target = MaxDepth() >>> parser = XMLTreeBuilder(target=target) >>> exampleXml = """ Modified: python/branches/py3k/Doc/library/xmlrpc.server.rst ============================================================================== --- python/branches/py3k/Doc/library/xmlrpc.server.rst (original) +++ python/branches/py3k/Doc/library/xmlrpc.server.rst Sat Jan 3 22:18:54 2009 @@ -126,7 +126,7 @@ requestHandler=RequestHandler) server.register_introspection_functions() - # Register pow() function; this will use the value of + # Register pow() function; this will use the value of # pow.__name__ as the name, which is just 'pow'. server.register_function(pow) @@ -135,10 +135,10 @@ return x + y server.register_function(adder_function, 'add') - # Register an instance; all the methods of the instance are + # Register an instance; all the methods of the instance are # published as XML-RPC methods (in this case, just 'div'). class MyFuncs: - def div(self, x, y): + def div(self, x, y): return x // y server.register_instance(MyFuncs()) Modified: python/branches/py3k/Doc/library/zipfile.rst ============================================================================== --- python/branches/py3k/Doc/library/zipfile.rst (original) +++ python/branches/py3k/Doc/library/zipfile.rst Sat Jan 3 22:18:54 2009 @@ -193,7 +193,7 @@ .. method:: ZipFile.extractall([path[, members[, pwd]]]) - Extract all members from the archive to the current working directory. *path* + Extract all members from the archive to the current working directory. *path* specifies a different directory to extract to. *members* is optional and must be a subset of the list returned by :meth:`namelist`. *pwd* is the password used for encrypted files. @@ -266,9 +266,9 @@ .. note:: - When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, - the compression method used will be that specified in the *compress_type* - member of the given :class:`ZipInfo` instance. By default, the + When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, + the compression method used will be that specified in the *compress_type* + member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. The following data attributes are also available: @@ -282,9 +282,9 @@ .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a - :class:`ZipFile` instance created with mode 'a' or 'w', this should be a - string no longer than 65535 bytes. Comments longer than this will be + The comment text associated with the ZIP file. If assigning a comment to a + :class:`ZipFile` instance created with mode 'a' or 'w', this should be a + string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when :meth:`ZipFile.close` is called. .. _pyzipfile-objects: @@ -313,10 +313,10 @@ internal use only. The :meth:`writepy` method makes archives with file names like this:: - string.pyc # Top level name - test/__init__.pyc # Package directory + string.pyc # Top level name + test/__init__.pyc # Package directory test/testall.pyc # Module test.testall - test/bogus/__init__.pyc # Subpackage directory + test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile Modified: python/branches/py3k/Doc/library/zipimport.rst ============================================================================== --- python/branches/py3k/Doc/library/zipimport.rst (original) +++ python/branches/py3k/Doc/library/zipimport.rst Sat Jan 3 22:18:54 2009 @@ -142,7 +142,7 @@ -------- ------- 8467 1 file $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading Modified: python/branches/py3k/Doc/license.rst ============================================================================== --- python/branches/py3k/Doc/license.rst (original) +++ python/branches/py3k/Doc/license.rst Sat Jan 3 22:18:54 2009 @@ -386,8 +386,8 @@ The source for the :mod:`fpectl` module includes the following notice:: - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -419,7 +419,7 @@ | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / + \ endorsement purposes. / --------------------------------------------------------------------- Modified: python/branches/py3k/Doc/reference/datamodel.rst ============================================================================== --- python/branches/py3k/Doc/reference/datamodel.rst (original) +++ python/branches/py3k/Doc/reference/datamodel.rst Sat Jan 3 22:18:54 2009 @@ -1152,7 +1152,7 @@ implementing :meth:`__format__`, however most classes will either delegate formatting to one of the built-in types, or use a similar formatting option syntax. - + See :ref:`formatspec` for a description of the standard formatting syntax. The return value must be a string object. Modified: python/branches/py3k/Doc/reference/expressions.rst ============================================================================== --- python/branches/py3k/Doc/reference/expressions.rst (original) +++ python/branches/py3k/Doc/reference/expressions.rst Sat Jan 3 22:18:54 2009 @@ -552,7 +552,7 @@ :keyword:`del` statements. The syntax for a slicing: .. productionlist:: - slicing: `primary` "[" `slice_list` "]" + slicing: `primary` "[" `slice_list` "]" slice_list: `slice_item` ("," `slice_item`)* [","] slice_item: `expression` | `proper_slice` proper_slice: [`lower_bound`] ":" [`upper_bound`] [ ":" [`stride`] ] @@ -640,7 +640,7 @@ the call. .. note:: - + An implementation may provide builtin functions whose positional parameters do not have names, even if they are 'named' for the purpose of documentation, and which therefore cannot be supplied by keyword. In CPython, this is the case for @@ -1045,7 +1045,7 @@ Comparison of objects of the differing types depends on whether either of the types provide explicit support for the comparison. Most numeric types can be compared with one another, but comparisons of :class:`float` and -:class:`Decimal` are not supported to avoid the inevitable confusion arising +:class:`Decimal` are not supported to avoid the inevitable confusion arising from representation issues such as ``float('1.1')`` being inexactly represented and therefore not exactly equal to ``Decimal('1.1')`` which is. When cross-type comparison is not supported, the comparison method returns @@ -1323,7 +1323,7 @@ identity only, but this caused surprises because people expected to be able to test a dictionary for emptiness by comparing it to ``{}``. -.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of +.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 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. Modified: python/branches/py3k/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/py3k/Doc/reference/lexical_analysis.rst (original) +++ python/branches/py3k/Doc/reference/lexical_analysis.rst Sat Jan 3 22:18:54 2009 @@ -608,7 +608,7 @@ 7 2147483647 0o177 0b100110111 3 79228162514264337593543950336 0o377 0x100000000 - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: @@ -654,7 +654,7 @@ part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of imaginary literals:: - 3.14j 10.j 10j .001j 1e100j 3.14e-10j + 3.14j 10.j 10j .001j 1e100j 3.14e-10j .. _operators: 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 Sat Jan 3 22:18:54 2009 @@ -507,7 +507,7 @@ .. index:: pair: exception; chaining __cause__ (exception attribute) __context__ (exception attribute) - + The ``from`` clause is used for exception chaining: if given, the second *expression* must be another exception class or instance, which will then be attached to the raised exception as the :attr:`__cause__` attribute (which is @@ -729,7 +729,7 @@ searched inside the package. A package is generally a subdirectory of a directory on ``sys.path`` that has a file :file:`__init__.py`. -.. +.. [XXX Can't be bothered to spell this out right now; see the URL http://www.python.org/doc/essays/packages.html for more details, also about how @@ -874,9 +874,9 @@ : ["=" (`target_list` "=")+ `expression_list`] : | "nonlocal" `identifier` `augop` `expression_list` -The :keyword:`nonlocal` statement causes the listed identifiers to refer to -previously bound variables in the nearest enclosing scope. This is important -because the default behavior for binding is to search the local namespace +The :keyword:`nonlocal` statement causes the listed identifiers to refer to +previously bound variables in the nearest enclosing scope. This is important +because the default behavior for binding is to search the local namespace first. The statement allows encapsulated code to rebind variables outside of the local scope besides the global (module) scope. @@ -889,7 +889,7 @@ enclosing scope (the scope in which a new binding should be created cannot be determined unambiguously). -Names listed in a :keyword:`nonlocal` statement must not collide with +Names listed in a :keyword:`nonlocal` statement must not collide with pre-existing bindings in the local scope. .. seealso:: Modified: python/branches/py3k/Doc/tutorial/classes.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/classes.rst (original) +++ python/branches/py3k/Doc/tutorial/classes.rst Sat Jan 3 22:18:54 2009 @@ -14,7 +14,7 @@ class or classes, and a method can call the method of a base class with the same name. Objects can contain an arbitrary amount of private data. -In C++ terminology, normally class members (including the data members) are +In C++ terminology, normally class members (including the data members) are *public* (except see below :ref:`tut-private`), and all member functions are *virtual*. There are no special constructors or destructors. As in Modula-3, there are no shorthands for referencing the @@ -171,7 +171,7 @@ def do_global(): global spam spam = "global spam" - + spam = "test spam" do_local() print("After local assignment:", spam) @@ -302,7 +302,7 @@ ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -532,7 +532,7 @@ is ``True`` since :class:`bool` is a subclass of :class:`int`. However, ``issubclass(float, int)`` is ``False`` since :class:`float` is not a subclass of :class:`int`. - + .. _tut-multiple: Modified: python/branches/py3k/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/controlflow.rst (original) +++ python/branches/py3k/Doc/tutorial/controlflow.rst Sat Jan 3 22:18:54 2009 @@ -61,7 +61,7 @@ ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print(x, len(x)) - ... + ... cat 3 window 6 defenestrate 12 @@ -74,7 +74,7 @@ >>> for x in a[:]: # make a slice copy of the entire list ... if len(x) > 6: a.insert(0, x) - ... + ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] @@ -96,7 +96,7 @@ 2 3 4 - + The given end point is never part of the generated list; ``range(10)`` generates @@ -104,13 +104,13 @@ is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the 'step'):: - range(5, 10) + range(5, 10) 5 through 9 - range(0, 10, 3) + range(0, 10, 3) 0, 3, 6, 9 - range(-10, -100, -30) + range(-10, -100, -30) -10, -40, -70 To iterate over the indices of a sequence, you can combine :func:`range` and @@ -119,7 +119,7 @@ >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print(i, a[i]) - ... + ... 0 Mary 1 had 2 a @@ -135,12 +135,12 @@ range(0, 10) In many ways the object returned by :func:`range` behaves as if it is a list, -but in fact it isn't. It is an object which returns the successive items of -the desired sequence when you iterate over it, but it doesn't really make -the list, thus saving space. +but in fact it isn't. It is an object which returns the successive items of +the desired sequence when you iterate over it, but it doesn't really make +the list, thus saving space. -We say such an object is *iterable*, that is, suitable as a target for -functions and constructs that expect something from which they can +We say such an object is *iterable*, that is, suitable as a target for +functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the :keyword:`for` statement is such an *iterator*. The function :func:`list` is another; it creates lists from iterables:: @@ -177,7 +177,7 @@ ... else: ... # loop fell through without finding a factor ... print(n, 'is a prime number') - ... + ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 @@ -198,7 +198,7 @@ >>> while True: ... pass # Busy-wait for keyboard interrupt (Ctrl+C) - ... + ... This is commonly used for creating minimal classes:: @@ -212,7 +212,7 @@ >>> def initlog(*args): ... pass # Remember to implement this! - ... + ... .. _tut-functions: @@ -229,7 +229,7 @@ ... print(b, end=' ') ... a, b = b, a+b ... print() - ... + ... >>> # Now call the function we just defined: ... fib(2000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 @@ -300,7 +300,7 @@ ... result.append(b) # see below ... a, b = b, a+b ... return result - ... + ... >>> f100 = fib2(100) # call it >>> f100 # write the result [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -436,7 +436,7 @@ >>> def function(a): ... pass - ... + ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in ? @@ -487,7 +487,7 @@ ------------------------ .. index:: - statement: * + statement: * Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -497,13 +497,13 @@ def write_multiple_items(file, separator, *args): file.write(separator.join(args)) - + Normally, these ``variadic`` arguments will be last in the list of formal -parameters, because they scoop up all remaining input arguments that are +parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the ``*args`` -parameter are 'keyword-only' arguments, meaning that they can only be used as +parameter are 'keyword-only' arguments, meaning that they can only be used as keywords rather than positional arguments. :: - + >>> def concat(*args, sep="/"): ... return sep.join(args) ... @@ -581,7 +581,7 @@ single: strings, documentation Here are some conventions about the content and formatting of documentation -strings. +strings. The first line should always be a short, concise summary of the object's purpose. For brevity, it should not explicitly state the object's name or type, @@ -610,11 +610,11 @@ >>> def my_function(): ... """Do nothing, but document it. - ... + ... ... No, really, it doesn't do anything. ... """ ... pass - ... + ... >>> print(my_function.__doc__) Do nothing, but document it. Modified: python/branches/py3k/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/datastructures.rst (original) +++ python/branches/py3k/Doc/tutorial/datastructures.rst Sat Jan 3 22:18:54 2009 @@ -159,7 +159,7 @@ List comprehensions provide a concise way to create lists from sequences. Common applications are to make lists where each element is the result of -some operations applied to each member of the sequence, or to create a +some operations applied to each member of the sequence, or to create a subsequence of those elements that satisfy a certain condition. @@ -167,7 +167,7 @@ clause, then zero or more :keyword:`for` or :keyword:`if` clauses. The result will be a list resulting from evaluating the expression in the context of the :keyword:`for` and :keyword:`if` clauses which follow it. If the expression -would evaluate to a tuple, it must be parenthesized. +would evaluate to a tuple, it must be parenthesized. Here we take a list of numbers and return a list of three times each number:: @@ -227,7 +227,7 @@ powerful tool but -- like all powerful tools -- they need to be used carefully, if at all. -Consider the following example of a 3x3 matrix held as a list containing three +Consider the following example of a 3x3 matrix held as a list containing three lists, one list per row:: >>> mat = [ @@ -236,7 +236,7 @@ ... [7, 8, 9], ... ] -Now, if you wanted to swap rows and columns, you could use a list +Now, if you wanted to swap rows and columns, you could use a list comprehension:: >>> print([[row[i] for row in mat] for i in [0, 1, 2]]) @@ -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 builtin 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/errors.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/errors.rst (original) +++ python/branches/py3k/Doc/tutorial/errors.rst Sat Jan 3 22:18:54 2009 @@ -91,7 +91,7 @@ ... break ... except ValueError: ... print("Oops! That was no valid number. Try again...") - ... + ... The :keyword:`try` statement works as follows. @@ -195,12 +195,12 @@ >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as err: ... print('Handling run-time error:', err) - ... + ... Handling run-time error: int division or modulo by zero @@ -251,12 +251,12 @@ ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print('My exception occurred, value:', e.value) - ... + ... My exception occurred, value: 4 >>> raise MyError('oops!') Traceback (most recent call last): @@ -326,7 +326,7 @@ ... raise KeyboardInterrupt ... finally: ... print('Goodbye, world!') - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? @@ -389,9 +389,9 @@ print(line) The problem with this code is that it leaves the file open for an indeterminate -amount of time after this part of the code has finished executing. -This is not an issue in simple scripts, but can be a problem for larger -applications. The :keyword:`with` statement allows objects like files to be +amount of time after this part of the code has finished executing. +This is not an issue in simple scripts, but can be a problem for larger +applications. The :keyword:`with` statement allows objects like files to be used in a way that ensures they are always cleaned up promptly and correctly. :: with open("myfile.txt") as f: Modified: python/branches/py3k/Doc/tutorial/index.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/index.rst (original) +++ python/branches/py3k/Doc/tutorial/index.rst Sat Jan 3 22:18:54 2009 @@ -1,7 +1,7 @@ .. _tutorial-index: ###################### - The Python Tutorial + The Python Tutorial ###################### :Release: |version| Modified: python/branches/py3k/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/inputoutput.rst (original) +++ python/branches/py3k/Doc/tutorial/inputoutput.rst Sat Jan 3 22:18:54 2009 @@ -90,7 +90,7 @@ >>> for x in range(1, 11): ... print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x)) - ... + ... 1 1 1 2 4 8 3 9 27 @@ -165,7 +165,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): ... print('{0:10} ==> {1:10d}'.format(name, phone)) - ... + ... Jack ==> 4098 Dcab ==> 7678 Sjoerd ==> 4127 @@ -343,7 +343,7 @@ 16 >>> f.seek(5) # Go to the 6th byte in the file 5 - >>> f.read(1) + >>> f.read(1) b'5' >>> f.seek(-3, 2) # Go to the 3rd byte before the end 13 @@ -353,7 +353,7 @@ In text files (those opened without a ``b`` in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with ``seek(0, 2)``). - + When you're done with a file, call ``f.close()`` to close it and free up any system resources taken up by the open file. After calling ``f.close()``, attempts to use the file object will automatically fail. :: Modified: python/branches/py3k/Doc/tutorial/interpreter.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/interpreter.rst (original) +++ python/branches/py3k/Doc/tutorial/interpreter.rst Sat Jan 3 22:18:54 2009 @@ -115,7 +115,7 @@ >>> the_world_is_flat = 1 >>> if the_world_is_flat: ... print("Be careful not to fall off!") - ... + ... Be careful not to fall off! @@ -191,7 +191,7 @@ to do this, put one more special comment line right after the ``#!`` line to define the source file encoding:: - # -*- coding: encoding -*- + # -*- coding: encoding -*- With that declaration, everything in the source file will be treated as having the encoding *encoding* instead of UTF-8. The list of possible encodings can be Modified: python/branches/py3k/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/introduction.rst (original) +++ python/branches/py3k/Doc/tutorial/introduction.rst Sat Jan 3 22:18:54 2009 @@ -58,7 +58,7 @@ >>> 8/5 # Fractions aren't lost when dividing integers 1.6000000000000001 -Note: You might not see exactly the same result; floating point results can +Note: You might not see exactly the same result; floating point results can differ from one machine to another. We will say more later about controlling the appearance of floating point output; what we see here is the most informative display but not as easy to read as we would get with:: @@ -71,9 +71,9 @@ why these two ways of displaying floating point data come to be different. See :ref:`tut-fp-issues` for a full discussion. -To do integer division and get an integer result, +To do integer division and get an integer result, discarding any fractional result, there is another operator, ``//``:: - + >>> # Integer division returns the floor: ... 7//3 2 @@ -103,7 +103,7 @@ >>> # try to access an undefined variable ... n - Traceback (most recent call last): + Traceback (most recent call last): File "", line 1, in NameError: name 'n' is not defined @@ -245,14 +245,14 @@ they will be included in the string. :: print(""" - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """) produces the following output:: - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to @@ -371,10 +371,10 @@ Then the right edge of the last character of a string of *n* characters has index *n*, for example:: - +---+---+---+---+---+ + +---+---+---+---+---+ | H | e | l | p | A | - +---+---+---+---+---+ - 0 1 2 3 4 5 + +---+---+---+---+---+ + 0 1 2 3 4 5 -5 -4 -3 -2 -1 The first row of numbers gives the position of the indices 0...5 in the string; @@ -396,7 +396,7 @@ .. seealso:: :ref:`typesseq` - Strings are examples of *sequence types*, and support the common + Strings are examples of *sequence types*, and support the common operations supported by such types. :ref:`string-methods` @@ -565,7 +565,7 @@ >>> while b < 10: ... print(b) ... a, b = b, a+b - ... + ... 1 1 2 @@ -601,8 +601,8 @@ * The :func:`print` function writes the value of the expression(s) it is given. It differs from just writing the expression you want to write (as we did - earlier in the calculator examples) in the way it handles multiple - expressions, floating point quantities, + earlier in the calculator examples) in the way it handles multiple + expressions, floating point quantities, and strings. Strings are printed without quotes, and a space is inserted between items, so you can format things nicely, like this:: @@ -617,5 +617,5 @@ >>> while b < 1000: ... print(b, end=' ') ... a, b = b, a+b - ... + ... 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Modified: python/branches/py3k/Doc/tutorial/modules.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/modules.rst (original) +++ python/branches/py3k/Doc/tutorial/modules.rst Sat Jan 3 22:18:54 2009 @@ -103,8 +103,8 @@ 1 1 2 3 5 8 13 21 34 55 89 144 233 377 This imports all names except those beginning with an underscore (``_``). -In most cases Python programmers do not use this facility since it introduces -an unknown set of names into the interpreter, possibly hiding some things +In most cases Python programmers do not use this facility since it introduces +an unknown set of names into the interpreter, possibly hiding some things you have already defined. .. note:: @@ -287,7 +287,7 @@ ['__name__', 'fib', 'fib2'] >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', + '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'callstats', 'copyright', 'displayhook', 'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', @@ -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', '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'] .. _tut-packages: Modified: python/branches/py3k/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/stdlib.rst (original) +++ python/branches/py3k/Doc/tutorial/stdlib.rst Sat Jan 3 22:18:54 2009 @@ -136,7 +136,7 @@ >>> random.random() # random float 0.17970987693706186 >>> random.randrange(6) # random integer chosen from range(6) - 4 + 4 The SciPy project has many other modules for numerical computations. Modified: python/branches/py3k/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/stdlib2.rst (original) +++ python/branches/py3k/Doc/tutorial/stdlib2.rst Sat Jan 3 22:18:54 2009 @@ -174,7 +174,7 @@ class AsyncZip(threading.Thread): def __init__(self, infile, outfile): - threading.Thread.__init__(self) + threading.Thread.__init__(self) self.infile = infile self.outfile = outfile def run(self): @@ -358,11 +358,11 @@ results in decimal floating point and binary floating point. The difference becomes significant if the results are rounded to the nearest cent:: - >>> from decimal import * + >>> from decimal import * >>> Decimal('0.70') * Decimal('1.05') Decimal("0.7350") >>> .70 * 1.05 - 0.73499999999999999 + 0.73499999999999999 The :class:`Decimal` result keeps a trailing zero, automatically inferring four place significance from multiplicands with two place significance. Decimal @@ -380,7 +380,7 @@ >>> sum([Decimal('0.1')]*10) == Decimal('1.0') True >>> sum([0.1]*10) == 1.0 - False + False The :mod:`decimal` module provides arithmetic with as much precision as needed:: Modified: python/branches/py3k/Doc/tutorial/whatnow.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/whatnow.rst (original) +++ python/branches/py3k/Doc/tutorial/whatnow.rst Sat Jan 3 22:18:54 2009 @@ -49,8 +49,8 @@ Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.) * http://scipy.org: The Scientific Python project includes modules for fast - array computations and manipulations plus a host of packages for such - things as linear algebra, Fourier transforms, non-linear solvers, + array computations and manipulations plus a host of packages for such + things as linear algebra, Fourier transforms, non-linear solvers, random number distributions, statistical analysis and the like. For Python-related questions and problem reports, you can post to the newsgroup @@ -68,6 +68,6 @@ .. Postings figure based on average of last six months activity as reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182 - days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) + days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) Modified: python/branches/py3k/Doc/using/cmdline.rst ============================================================================== --- python/branches/py3k/Doc/using/cmdline.rst (original) +++ python/branches/py3k/Doc/using/cmdline.rst Sat Jan 3 22:18:54 2009 @@ -8,8 +8,8 @@ The CPython interpreter scans the command line and the environment for various settings. -.. note:: - +.. note:: + Other implementations' command line schemes may differ. See :ref:`implementations` for further resources. @@ -61,7 +61,7 @@ Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code. - + If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top @@ -72,7 +72,7 @@ Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module. - + Since the argument is a *module* name, you must not give a file extension (``.py``). The ``module-name`` should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to @@ -84,18 +84,18 @@ written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available. - + If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. - + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details - .. seealso:: + .. seealso:: :func:`runpy.run_module` The actual implementation of this feature. @@ -152,7 +152,7 @@ --version Print the Python version number and exit. Example output could be:: - + Python 3.0 @@ -189,7 +189,7 @@ enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal. The :envvar:`PYTHONSTARTUP` file is not read. - + This can be useful to inspect global variables or a stack trace when a script raises an exception. See also :envvar:`PYTHONINSPECT`. @@ -222,10 +222,10 @@ .. cmdoption:: -u - + Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. - + Note that there is internal buffering in :meth:`file.readlines` and :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced by this option. To work around this, you will want to use @@ -237,7 +237,7 @@ .. XXX should the -U option be documented? .. cmdoption:: -v - + Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (:option:`-vv`), print a message for each file that is checked for when @@ -246,13 +246,13 @@ .. cmdoption:: -W arg - + Warning control. Python's warning machinery by default prints warning messages to :data:`sys.stderr`. A typical warning message has the following form:: file:line: category: message - + By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. @@ -260,13 +260,13 @@ one option, the action for the last matching option is performed. Invalid :option:`-W` options are ignored (though, a warning message is printed about invalid options when the first warning is issued). - + Warnings can also be controlled from within a Python program using the :mod:`warnings` module. The simplest form of argument is one of the following action strings (or a unique abbreviation): - + ``ignore`` Ignore all warnings. ``default`` @@ -282,9 +282,9 @@ Print each warning only the first time it occurs in the program. ``error`` Raise an exception instead of printing a warning message. - - The full form of argument is:: - + + The full form of argument is:: + action:message:category:module:line Here, *action* is as explained above but only applies to messages that match @@ -305,10 +305,10 @@ .. cmdoption:: -x - + Skip the first line of the source, allowing use of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only. - + .. warning:: The line numbers in error messages will be off by one! .. _using-on-envvars: @@ -319,13 +319,13 @@ These environment variables influence Python's behavior. .. envvar:: PYTHONHOME - + Change the location of the standard Python libraries. By default, the libraries are searched in :file:`{prefix}/lib/python{version}` and :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and :file:`{exec_prefix}` are installation-dependent directories, both defaulting to :file:`/usr/local`. - + When :envvar:`PYTHONHOME` is set to a single directory, its value replaces both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`. @@ -341,11 +341,11 @@ In addition to normal directories, individual :envvar:`PYTHONPATH` entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. - + The default search path is installation dependent, but generally begins with :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. - + An additional directory will be inserted in the search path in front of :envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-options`. The search path can be manipulated from @@ -353,7 +353,7 @@ .. envvar:: PYTHONSTARTUP - + If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so @@ -363,7 +363,7 @@ .. envvar:: PYTHONY2K - + Set this to a non-empty string to cause the :mod:`time` module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the :mod:`time` module @@ -371,21 +371,21 @@ .. envvar:: PYTHONOPTIMIZE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-O` option. If set to an integer, it is equivalent to specifying :option:`-O` multiple times. .. envvar:: PYTHONDEBUG - + If this is set to a non-empty string it is equivalent to specifying the :option:`-d` option. If set to an integer, it is equivalent to specifying :option:`-d` multiple times. .. envvar:: PYTHONINSPECT - + If this is set to a non-empty string it is equivalent to specifying the :option:`-i` option. @@ -394,20 +394,20 @@ .. envvar:: PYTHONUNBUFFERED - + If this is set to a non-empty string it is equivalent to specifying the :option:`-u` option. .. envvar:: PYTHONVERBOSE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-v` option. If set to an integer, it is equivalent to specifying :option:`-v` multiple times. .. envvar:: PYTHONCASEOK - + If this is set, Python ignores case in :keyword:`import` statements. This only works on Windows. Modified: python/branches/py3k/Doc/using/unix.rst ============================================================================== --- python/branches/py3k/Doc/using/unix.rst (original) +++ python/branches/py3k/Doc/using/unix.rst Sat Jan 3 22:18:54 2009 @@ -45,7 +45,7 @@ * OpenBSD users use:: - pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz + pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz For example i386 users get the 2.5.1 version of Python using:: @@ -87,7 +87,7 @@ Python-related paths and files ============================== - + These are subject to difference depending on local installation conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``) are installation-dependent and should be interpreted as for GNU software; they @@ -112,7 +112,7 @@ | | by the user module; not used by default | | | or by most applications. | +-----------------------------------------------+------------------------------------------+ - + Miscellaneous ============= Modified: python/branches/py3k/Doc/using/windows.rst ============================================================================== --- python/branches/py3k/Doc/using/windows.rst (original) +++ python/branches/py3k/Doc/using/windows.rst Sat Jan 3 22:18:54 2009 @@ -86,9 +86,9 @@ --------------------------------------- Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab +guide applies to XP classical view): Right-click the icon for your machine +(usually located on your Desktop and called "My Computer") and choose +:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab and click the :guilabel:`Environment Variables` button. In short, your path is: @@ -191,11 +191,11 @@ #. Launch a command prompt. #. Associate the correct file group with ``.py`` scripts:: - + assoc .py=Python.File #. Redirect all Python files to the new executable:: - + ftype Python.File=C:\Path\to\pythonw.exe "%1" %* Modified: python/branches/py3k/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.0.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.0.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.0 + What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka @@ -277,9 +277,9 @@ finding all the strings in the list containing a given substring. You could write the following to do it:: - # Given the list L, make a list of all strings + # Given the list L, make a list of all strings # containing the substring S. - sublist = filter( lambda s, substring=S: + sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, L) @@ -291,7 +291,7 @@ List comprehensions have the form:: - [ expression for expr in sequence1 + [ expression for expr in sequence1 for expr2 in sequence2 ... for exprN in sequenceN if condition ] @@ -312,8 +312,8 @@ ... for exprN in sequenceN: if (condition): - # Append the value of - # the expression to the + # Append the value of + # the expression to the # resulting list. This means that when there are multiple :keyword:`for`...\ :keyword:`in` @@ -590,7 +590,7 @@ def f(): print "i=",i - i = i + 1 + i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been @@ -627,7 +627,7 @@ the following lines of code:: if dict.has_key( key ): return dict[key] - else: + else: dict[key] = [] return dict[key] @@ -836,14 +836,14 @@ :file:`setup.py` can be just a few lines long:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:`setup.py` file isn't much more complicated if the software consists of a few packages:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", packages = ["package", "package.subpackage"]) A C extension can be the most complicated case; here's an example taken from @@ -860,7 +860,7 @@ 'extensions/expat/xmltok/xmlrole.c', ] ) - setup (name = "PyXML", version = "0.5.4", + setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) The Distutils can also take care of creating source and binary distributions. Modified: python/branches/py3k/Doc/whatsnew/2.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.1.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.1 + What's New in Python 2.1 **************************** :Author: A.M. Kuchling @@ -98,7 +98,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x Modified: python/branches/py3k/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.2.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.2.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.2 + What's New in Python 2.2 **************************** :Author: A.M. Kuchling @@ -473,7 +473,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it expects something for which :func:`iter` will return an iterator. For backward @@ -909,7 +909,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x @@ -952,8 +952,8 @@ items = s.meerkat.getItems( {'channel': 4} ) # 'items' is another list of dictionaries, like this: - # [{'link': 'http://freshmeat.net/releases/52719/', - # 'description': 'A utility which converts HTML to XSL FO.', + # [{'link': 'http://freshmeat.net/releases/52719/', + # 'description': 'A utility which converts HTML to XSL FO.', # 'title': 'html2fo 0.3 (Default)'}, ... ] The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward Modified: python/branches/py3k/Doc/whatsnew/2.3.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.3.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.3.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.3 + What's New in Python 2.3 **************************** :Author: A.M. Kuchling @@ -301,7 +301,7 @@ -------- ------- 8467 1 file amk at nyman:~/src/python$ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading @@ -671,7 +671,7 @@ # ... } - if (hasattr(core, 'setup_keywords') and + if (hasattr(core, 'setup_keywords') and 'classifiers' in core.setup_keywords): kw['classifiers'] = \ ['Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -1027,7 +1027,7 @@ creating small dictionaries:: >>> dict(red=1, blue=2, green=3, black=4) - {'blue': 2, 'black': 4, 'green': 3, 'red': 1} + {'blue': 2, 'black': 4, 'green': 3, 'red': 1} (Contributed by Just van Rossum.) @@ -1622,7 +1622,7 @@ ... self.valuelist.pop(i) ... def keys(self): ... return list(self.keylist) - ... + ... >>> s = SeqDict() >>> dir(s) # See that other dictionary methods are implemented ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__', @@ -1779,7 +1779,7 @@ set input filename -lLENGTH, --length=LENGTH set maximum length of output - $ + $ See the module's documentation for more details. Modified: python/branches/py3k/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.4.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.4.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.4 + What's New in Python 2.4 **************************** :Author: A.M. Kuchling @@ -63,10 +63,10 @@ >>> a.add('z') # add a new element >>> a.update('wxy') # add multiple new elements >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) >>> a.remove('x') # take one element out >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) The :func:`frozenset` type is an immutable version of :func:`set`. Since it is immutable and hashable, it may be used as a dictionary key or as a member of @@ -351,7 +351,7 @@ >>> for i in reversed(xrange(1,4)): ... print i - ... + ... 3 2 1 @@ -366,7 +366,7 @@ >>> input = open('/etc/passwd', 'r') >>> for line in reversed(list(input)): ... print line - ... + ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... @@ -650,7 +650,7 @@ 28 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.1428571428571428571428571429") - >>> decimal.getcontext().prec = 9 + >>> decimal.getcontext().prec = 9 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.142857143") @@ -665,7 +665,7 @@ >>> decimal.getcontext().traps[decimal.DivisionByZero] = False >>> decimal.Decimal(1) / decimal.Decimal(0) Decimal("Infinity") - >>> + >>> The :class:`Context` instance also has various methods for formatting numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`. @@ -803,7 +803,7 @@ >>> 'www.python.org'.split('.', 1) ['www', 'python.org'] 'www.python.org'.rsplit('.', 1) - ['www.python', 'org'] + ['www.python', 'org'] * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :meth:`sort` method of lists. These parameters make some common usages of @@ -1045,7 +1045,7 @@ >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque - True + True Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take advantage of :class:`collections.deque` for improved performance. (Contributed @@ -1106,13 +1106,13 @@ >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14] >>> for key_val, it in itertools.groupby(L, lambda x: x % 2): ... print key_val, list(it) - ... + ... 0 [2, 4, 6] 1 [7] 0 [8] 1 [9, 11] 0 [12, 14] - >>> + >>> :func:`groupby` is typically used with sorted input. The logic for :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for @@ -1120,21 +1120,21 @@ >>> word = 'abracadabra' >>> letters = sorted(word) # Turn string into a sorted list of letters - >>> letters + >>> letters ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r'] >>> for k, g in itertools.groupby(letters): ... print k, list(g) - ... + ... a ['a', 'a', 'a', 'a', 'a'] b ['b', 'b'] c ['c'] d ['d'] r ['r', 'r'] >>> # List unique letters - >>> [k for k, g in groupby(letters)] + >>> [k for k, g in groupby(letters)] ['a', 'b', 'c', 'd', 'r'] >>> # Count letter occurrences - >>> [(k, len(list(g))) for k, g in groupby(letters)] + >>> [(k, len(list(g))) for k, g in groupby(letters)] [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)] (Contributed by Hye-Shik Chang.) @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that 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 Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.5 + What's New in Python 2.5 **************************** :Author: A.M. Kuchling @@ -220,7 +220,7 @@ required packages. :: VERSION = '1.0' - setup(name='PyPackage', + setup(name='PyPackage', version=VERSION, requires=['numarray', 'zlib (>=1.1.4)'], obsoletes=['OldPackage'] @@ -388,7 +388,7 @@ else: else-block finally: - final-block + final-block The code in *block-1* is executed. If the code raises an exception, the various :keyword:`except` blocks are tested: if the exception is of class @@ -835,8 +835,8 @@ ... except (KeyboardInterrupt, SystemExit): raise - except: - # Log error... + except: + # Log error... # Continue running program... In Python 2.5, you can now write ``except Exception`` to achieve the same @@ -947,7 +947,7 @@ class C: def __index__ (self): - return self.value + return self.value The return value must be either a Python integer or long integer. The interpreter will check that the type returned is correct, and raises a @@ -1035,9 +1035,9 @@ L = ['medium', 'longest', 'short'] # Prints 'longest' - print max(L, key=len) + print max(L, key=len) # Prints 'short', because lexicographically 'short' has the largest value - print max(L) + print max(L) (Contributed by Steven Bethard and Raymond Hettinger.) @@ -1070,8 +1070,8 @@ using the default ASCII encoding. The result of the comparison is false:: >>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode - __main__:1: UnicodeWarning: Unicode equal comparison failed - to convert both arguments to Unicode - interpreting them + __main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them as being unequal False >>> chr(127) == unichr(127) # chr(127) can be converted @@ -1259,10 +1259,10 @@ Printing ``index`` results in the following output:: - defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], - 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], - 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], - 'p': ['per'], 's': ['selva', 'smarrita'], + defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], + 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], + 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], + 'p': ['per'], 's': ['selva', 'smarrita'], 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} (Contributed by Guido van Rossum.) @@ -1884,17 +1884,17 @@ differently. :: # Old versions - h = md5.md5() - h = md5.new() + h = md5.md5() + h = md5.new() - # New version + # New version h = hashlib.md5() # Old versions - h = sha.sha() - h = sha.new() + h = sha.sha() + h = sha.new() - # New version + # New version h = hashlib.sha1() # Hash that weren't previously available @@ -2191,7 +2191,7 @@ case that your extensions were using it, you can replace it by something like the following:: - range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", + range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", start, stop, step); .. ====================================================================== Modified: python/branches/py3k/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.6.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.6.rst Sat Jan 3 22:18:54 2009 @@ -748,7 +748,7 @@ >>> import sys >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) Platform: darwin - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' >>> import mimetypes @@ -962,8 +962,8 @@ The primary use of :class:`bytes` in 2.6 will be to write tests of object type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, which can't tell whether 2.x code intends strings to -contain either characters or 8-bit bytes; you can now -use either :class:`bytes` or :class:`str` to represent your intention +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention exactly, and the resulting code will also be correct in Python 3.0. There's also a ``__future__`` import that causes all string literals @@ -1838,9 +1838,9 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) - The :func:`parse_qs` and :func:`parse_qsl` functions have been + The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated from the :mod:`cgi` module to the :mod:`urlparse` module. - The versions still available in the :mod:`cgi` module will + The versions still available in the :mod:`cgi` module will trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`). @@ -1935,7 +1935,7 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) - + :: # Boldface text starting at y=0,x=21 @@ -2432,9 +2432,9 @@ :issue:`742598`, :issue:`1193577`.) * The :mod:`sqlite3` module, maintained by Gerhard Haering, - has been updated from version 2.3.2 in Python 2.5 to + has been updated from version 2.3.2 in Python 2.5 to version 2.4.1. - + * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type, using the format character ``'?'``. (Contributed by David Remahl.) @@ -2529,9 +2529,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module gained a number - of context managers useful for writing tests. - :func:`EnvironmentVarGuard` is a +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2546,7 +2546,7 @@ f = urllib.urlopen('https://sf.net') ... - Finally, :func:`check_warnings` resets the :mod:`warning` module's + Finally, :func:`check_warnings` resets the :mod:`warning` module's warning filters and returns an object that will record all warning messages triggered (:issue:`3781`):: @@ -2586,7 +2586,7 @@ :meth:`activeCount` method is renamed to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module support the same properties and renamed methods, but don't remove the old methods. No date has been set - for the deprecation of the old APIs in Python 3.x; the old APIs won't + for the deprecation of the old APIs in Python 3.x; the old APIs won't be removed in any 2.x version. (Carried out by several people, most notably Benjamin Peterson.) @@ -2643,7 +2643,7 @@ (Added by Facundo Batista.) * The Unicode database provided by the :mod:`unicodedata` module - has been updated to version 5.1.0. (Updated by + has been updated to version 5.1.0. (Updated by Martin von Loewis; :issue:`3811`.) * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` @@ -2654,7 +2654,7 @@ A new function, :func:`catch_warnings`, is a context manager intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). - + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` @@ -3224,8 +3224,8 @@ * :meth:`object.__init__` previously accepted arbitrary arguments and keyword arguments, ignoring them. In Python 2.6, this is no longer - allowed and will result in a :exc:`TypeError`. This will affect - :meth:`__init__` methods that end up calling the corresponding + allowed and will result in a :exc:`TypeError`. This will affect + :meth:`__init__` methods that end up calling the corresponding method on :class:`object` (perhaps through using :func:`super`). See :issue:`1683368` for discussion. @@ -3285,7 +3285,7 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, -Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner. 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 Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New In Python 3.0 + What's New In Python 3.0 **************************** .. XXX Add trademark info for Apple, Microsoft. @@ -10,45 +10,45 @@ .. $Id$ Rules for maintenance: - + * Anyone can add text to this document. Do not spend very much time on the wording of your changes, because your text will probably get rewritten to some degree. - + * The maintainer will go through Misc/NEWS periodically and add changes; it's therefore more important to add your changes to Misc/NEWS than to this file. (Note: I didn't get to this for 3.0. GvR.) - + * This is not a complete list of every single change; completeness is the purpose of Misc/NEWS. Some changes I consider too small or esoteric to include. If such a change is added to the text, I'll just remove it. (This is another reason you shouldn't spend too much time on writing your addition.) - + * If you want to draw your new text to the attention of the maintainer, add 'XXX' to the beginning of the paragraph or section. - + * It's OK to just add a fragmentary note about a change. For example: "XXX Describe the transmogrify() function added to the socket module." The maintainer will research the change and write the necessary text. - + * You can comment out your additions if you like, but it's not necessary (especially when a final release is some months away). - + * Credit the author of a patch or bugfix. Just the name is sufficient; the e-mail address isn't necessary. (Due to time constraints I haven't managed to do this for 3.0. GvR.) - + * It's helpful to add the bug/patch number as a comment: - + % Patch 12345 XXX Describe the transmogrify() function added to the socket module. (Contributed by P.Y. Developer.) - + This saves the maintainer the effort of going through the SVN log when researching a change. (Again, I didn't get to this for 3.0. GvR.) @@ -819,7 +819,7 @@ need it; however, 99 percent of the time an explicit :keyword:`for` loop is more readable. -* Removed :func:`reload`. Use :func:`imp.reload`. +* Removed :func:`reload`. Use :func:`imp.reload`. * Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator instead. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Sat Jan 3 22:18:54 2009 @@ -1,5 +1,5 @@ **************************** - What's New In Python 3.1 + What's New In Python 3.1 **************************** .. XXX Add trademark info for Apple, Microsoft. @@ -10,45 +10,45 @@ .. $Id$ Rules for maintenance: - + * Anyone can add text to this document. Do not spend very much time on the wording of your changes, because your text will probably get rewritten to some degree. - + * The maintainer will go through Misc/NEWS periodically and add changes; it's therefore more important to add your changes to Misc/NEWS than to this file. (Note: I didn't get to this for 3.0. GvR.) - + * This is not a complete list of every single change; completeness is the purpose of Misc/NEWS. Some changes I consider too small or esoteric to include. If such a change is added to the text, I'll just remove it. (This is another reason you shouldn't spend too much time on writing your addition.) - + * If you want to draw your new text to the attention of the maintainer, add 'XXX' to the beginning of the paragraph or section. - + * It's OK to just add a fragmentary note about a change. For example: "XXX Describe the transmogrify() function added to the socket module." The maintainer will research the change and write the necessary text. - + * You can comment out your additions if you like, but it's not necessary (especially when a final release is some months away). - + * Credit the author of a patch or bugfix. Just the name is sufficient; the e-mail address isn't necessary. (Due to time constraints I haven't managed to do this for 3.0. GvR.) - + * It's helpful to add the bug/patch number as a comment: - + % Patch 12345 XXX Describe the transmogrify() function added to the socket module. (Contributed by P.Y. Developer.) - + This saves the maintainer the effort of going through the SVN log when researching a change. (Again, I didn't get to this for 3.0. GvR.) From python-checkins at python.org Sat Jan 3 22:26:06 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:26:06 +0100 (CET) Subject: [Python-checkins] r68227 - in python/branches/py3k: Doc/extending/newtypes.rst Doc/howto/curses.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/library/abc.rst Doc/library/collections.rst Doc/library/gettext.rst Doc/library/multiprocessing.rst Doc/library/optparse.rst Doc/library/sched.rst Doc/library/socket.rst Doc/tutorial/datastructures.rst Doc/tutorial/stdlib2.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.6.rst Message-ID: <20090103212606.1B7421E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:26:05 2009 New Revision: 68227 Log: Merged revisions 68221 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines Remove tabs from the documentation. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/extending/newtypes.rst python/branches/py3k/Doc/howto/curses.rst python/branches/py3k/Doc/howto/regex.rst python/branches/py3k/Doc/howto/sockets.rst python/branches/py3k/Doc/howto/unicode.rst python/branches/py3k/Doc/library/abc.rst python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Doc/library/gettext.rst python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Doc/library/optparse.rst python/branches/py3k/Doc/library/sched.rst python/branches/py3k/Doc/library/socket.rst python/branches/py3k/Doc/tutorial/datastructures.rst python/branches/py3k/Doc/tutorial/stdlib2.rst python/branches/py3k/Doc/whatsnew/2.0.rst python/branches/py3k/Doc/whatsnew/2.2.rst python/branches/py3k/Doc/whatsnew/2.4.rst python/branches/py3k/Doc/whatsnew/2.6.rst Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Sat Jan 3 22:26:05 2009 @@ -823,8 +823,8 @@ previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -837,10 +837,10 @@ static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -859,18 +859,18 @@ PyMODINIT_FUNC PyInit_shoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return NULL; - - m = PyModule_Create(&shoddymodule); - if (m == NULL) - return NULL; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return NULL; + + m = PyModule_Create(&shoddymodule); + if (m == NULL) + return NULL; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1113,7 +1113,7 @@ typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; Modified: python/branches/py3k/Doc/howto/curses.rst ============================================================================== --- python/branches/py3k/Doc/howto/curses.rst (original) +++ python/branches/py3k/Doc/howto/curses.rst Sat Jan 3 22:26:05 2009 @@ -297,7 +297,7 @@ could code:: stdscr.addstr(0, 0, "Current mode: Typing mode", - curses.A_REVERSE) + curses.A_REVERSE) stdscr.refresh() The curses library also supports color on those terminals that provide it, The Modified: python/branches/py3k/Doc/howto/regex.rst ============================================================================== --- python/branches/py3k/Doc/howto/regex.rst (original) +++ python/branches/py3k/Doc/howto/regex.rst Sat Jan 3 22:26:05 2009 @@ -917,7 +917,7 @@ InternalDate = re.compile(r'INTERNALDATE "' r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-' - r'(?P[0-9][0-9][0-9][0-9])' + r'(?P[0-9][0-9][0-9][0-9])' r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])' r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])' r'"') Modified: python/branches/py3k/Doc/howto/sockets.rst ============================================================================== --- python/branches/py3k/Doc/howto/sockets.rst (original) +++ python/branches/py3k/Doc/howto/sockets.rst Sat Jan 3 22:26:05 2009 @@ -189,30 +189,30 @@ """ def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock def connect(self, host, port): self.sock.connect((host, port)) def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError("socket connection broken") - totalsent = totalsent + sent + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError("socket connection broken") + totalsent = totalsent + sent def myreceive(self): msg = '' while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError("socket connection broken") - msg = msg + chunk + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError("socket connection broken") + msg = msg + chunk return msg The sending code here is usable for almost any messaging scheme - in Python you Modified: python/branches/py3k/Doc/howto/unicode.rst ============================================================================== --- python/branches/py3k/Doc/howto/unicode.rst (original) +++ python/branches/py3k/Doc/howto/unicode.rst Sat Jan 3 22:26:05 2009 @@ -32,8 +32,8 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHIER EST COMPLETE." - PRINT "CARACTERE NON ACCEPTE." + PRINT "FICHIER EST COMPLETE." + PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who can read French. @@ -91,11 +91,11 @@ character with value 0x12ca (4810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:: - 0061 'a'; LATIN SMALL LETTER A - 0062 'b'; LATIN SMALL LETTER B - 0063 'c'; LATIN SMALL LETTER C - ... - 007B '{'; LEFT CURLY BRACKET + 0061 'a'; LATIN SMALL LETTER A + 0062 'b'; LATIN SMALL LETTER B + 0063 'c'; LATIN SMALL LETTER C + ... + 007B '{'; LEFT CURLY BRACKET Strictly, these definitions imply that it's meaningless to say 'this is character U+12ca'. U+12ca is a code point, which represents some particular @@ -527,19 +527,19 @@ assuming the default filesystem encoding is UTF-8, running the following program:: - fn = 'filename\u4500abc' - f = open(fn, 'w') - f.close() - - import os - print(os.listdir(b'.')) - print(os.listdir('.')) + fn = 'filename\u4500abc' + f = open(fn, 'w') + f.close() + + import os + print(os.listdir(b'.')) + print(os.listdir('.')) will produce the following output:: - amk:~$ python t.py - [b'.svn', b'filename\xe4\x94\x80abc', ...] - ['.svn', 'filename\u4500abc', ...] + amk:~$ python t.py + [b'.svn', b'filename\xe4\x94\x80abc', ...] + ['.svn', 'filename\u4500abc', ...] The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions. @@ -636,26 +636,26 @@ - [ ] Unicode introduction - [ ] ASCII - [ ] Terms - - [ ] Character - - [ ] Code point - - [ ] Encodings - - [ ] Common encodings: ASCII, Latin-1, UTF-8 + - [ ] Character + - [ ] Code point + - [ ] Encodings + - [ ] Common encodings: ASCII, Latin-1, UTF-8 - [ ] Unicode Python type - - [ ] Writing unicode literals - - [ ] Obscurity: -U switch - - [ ] Built-ins - - [ ] unichr() - - [ ] ord() - - [ ] unicode() constructor - - [ ] Unicode type - - [ ] encode(), decode() methods + - [ ] Writing unicode literals + - [ ] Obscurity: -U switch + - [ ] Built-ins + - [ ] unichr() + - [ ] ord() + - [ ] unicode() constructor + - [ ] Unicode type + - [ ] encode(), decode() methods - [ ] Unicodedata module for character properties - [ ] I/O - - [ ] Reading/writing Unicode data into files - - [ ] Byte-order marks - - [ ] Unicode filenames + - [ ] Reading/writing Unicode data into files + - [ ] Byte-order marks + - [ ] Unicode filenames - [ ] Writing Unicode programs - - [ ] Do everything in Unicode - - [ ] Declaring source code encodings (PEP 263) + - [ ] Do everything in Unicode + - [ ] Declaring source code encodings (PEP 263) - [ ] Other issues - - [ ] Building Python (UCS2, UCS4) + - [ ] Building Python (UCS2, UCS4) Modified: python/branches/py3k/Doc/library/abc.rst ============================================================================== --- python/branches/py3k/Doc/library/abc.rst (original) +++ python/branches/py3k/Doc/library/abc.rst Sat Jan 3 22:26:05 2009 @@ -42,15 +42,15 @@ Register *subclass* as a "virtual subclass" of this ABC. For example:: - from abc import ABCMeta + from abc import ABCMeta - class MyABC(metaclass=ABCMeta): - pass + class MyABC(metaclass=ABCMeta): + pass - MyABC.register(tuple) + MyABC.register(tuple) - assert issubclass(tuple, MyABC) - assert isinstance((), MyABC) + assert issubclass(tuple, MyABC) + assert isinstance((), MyABC) You can also override this method in an abstract base class: Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Sat Jan 3 22:26:05 2009 @@ -41,7 +41,7 @@ :class:`Hashable` ``__hash__`` :class:`Iterable` ``__iter__`` :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` -:class:`Sized` ``__len__`` +:class:`Sized` ``__len__`` :class:`Callable` ``__call__`` :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. @@ -68,7 +68,7 @@ :class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and ``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``, ``__delitem__``, and ``setdefault`` - ``__iter__``, and + ``__iter__``, and ``__len__`` :class:`MappingView` :class:`Sized` ``__len__`` @@ -84,7 +84,7 @@ size = None if isinstance(myvar, collections.Sized): - size = len(myvar) + size = len(myvar) Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting Modified: python/branches/py3k/Doc/library/gettext.rst ============================================================================== --- python/branches/py3k/Doc/library/gettext.rst (original) +++ python/branches/py3k/Doc/library/gettext.rst Sat Jan 3 22:26:05 2009 @@ -551,10 +551,9 @@ animals = ['mollusk', 'albatross', - 'rat', - 'penguin', - 'python', - ] + 'rat', + 'penguin', + 'python', ] # ... for a in animals: print(a) @@ -569,10 +568,9 @@ animals = [_('mollusk'), _('albatross'), - _('rat'), - _('penguin'), - _('python'), - ] + _('rat'), + _('penguin'), + _('python'), ] del _ @@ -595,10 +593,9 @@ animals = [N_('mollusk'), N_('albatross'), - N_('rat'), - N_('penguin'), - N_('python'), - ] + N_('rat'), + N_('penguin'), + N_('python'), ] # ... for a in animals: Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Sat Jan 3 22:26:05 2009 @@ -35,7 +35,7 @@ >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): - ... return x*x + ... return x*x ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Modified: python/branches/py3k/Doc/library/optparse.rst ============================================================================== --- python/branches/py3k/Doc/library/optparse.rst (original) +++ python/branches/py3k/Doc/library/optparse.rst Sat Jan 3 22:26:05 2009 @@ -543,8 +543,8 @@ :class:`OptionGroup` to a parser is easy:: group = OptionGroup(parser, "Dangerous Options", - "Caution: use these options at your own risk. " - "It is believed that some of them bite.") + "Caution: use these options at your own risk. " + "It is believed that some of them bite.") group.add_option("-g", action="store_true", help="Group option.") parser.add_option_group(group) @@ -558,12 +558,12 @@ -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --file=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' - [default], 'expert' + [default], 'expert' Dangerous Options: - Caution: use of these options is at your own risk. It is believed that - some of them bite. - -g Group option. + Caution: use of these options is at your own risk. It is believed that + some of them bite. + -g Group option. .. _optparse-printing-version-string: Modified: python/branches/py3k/Doc/library/sched.rst ============================================================================== --- python/branches/py3k/Doc/library/sched.rst (original) +++ python/branches/py3k/Doc/library/sched.rst Sat Jan 3 22:26:05 2009 @@ -58,7 +58,7 @@ ... print(time.time()) ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() - ... time.sleep(11) # sleep while time-delay events execute + ... time.sleep(11) # sleep while time-delay events execute ... print(time.time()) ... >>> print_some_times() Modified: python/branches/py3k/Doc/library/socket.rst ============================================================================== --- python/branches/py3k/Doc/library/socket.rst (original) +++ python/branches/py3k/Doc/library/socket.rst Sat Jan 3 22:26:05 2009 @@ -797,17 +797,17 @@ socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error as msg: - s = None - continue + s = None + continue try: - s.bind(sa) - s.listen(1) + s.bind(sa) + s.listen(1) except socket.error as msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print('could not open socket') @@ -832,16 +832,16 @@ for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error as msg: - s = None - continue + s = None + continue try: - s.connect(sa) + s.connect(sa) except socket.error as msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print('could not open socket') Modified: python/branches/py3k/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/datastructures.rst (original) +++ python/branches/py3k/Doc/tutorial/datastructures.rst Sat Jan 3 22:26:05 2009 @@ -195,7 +195,7 @@ Tuples can often be created without their parentheses, but not here:: - >>> [x, x**2 for x in vec] # error - parens required for tuples + >>> [x, x**2 for x in vec] # error - parens required for tuples File "", line 1, in ? [x, x**2 for x in vec] ^ Modified: python/branches/py3k/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/stdlib2.rst (original) +++ python/branches/py3k/Doc/tutorial/stdlib2.rst Sat Jan 3 22:26:05 2009 @@ -62,7 +62,7 @@ >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], - ... conv['frac_digits'], x), grouping=True) + ... conv['frac_digits'], x), grouping=True) '$1,234,567.80' Modified: python/branches/py3k/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.0.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.0.rst Sat Jan 3 22:26:05 2009 @@ -281,7 +281,7 @@ # containing the substring S. sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, - L) + L) Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` statement knows what @@ -293,7 +293,7 @@ [ expression for expr in sequence1 for expr2 in sequence2 ... - for exprN in sequenceN + for exprN in sequenceN if condition ] The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be @@ -368,7 +368,7 @@ def __init__(self, value): self.value = value def __iadd__(self, increment): - return Number( self.value + increment) + return Number( self.value + increment) n = Number(5) n += 3 @@ -852,13 +852,12 @@ from distutils.core import setup, Extension expat_extension = Extension('xml.parsers.pyexpat', - define_macros = [('XML_NS', None)], - include_dirs = [ 'extensions/expat/xmltok', - 'extensions/expat/xmlparse' ], - sources = [ 'extensions/pyexpat.c', - 'extensions/expat/xmltok/xmltok.c', - 'extensions/expat/xmltok/xmlrole.c', - ] + define_macros = [('XML_NS', None)], + include_dirs = [ 'extensions/expat/xmltok', + 'extensions/expat/xmlparse' ], + sources = [ 'extensions/pyexpat.c', + 'extensions/expat/xmltok/xmltok.c', + 'extensions/expat/xmltok/xmlrole.c', ] ) setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) Modified: python/branches/py3k/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.2.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.2.rst Sat Jan 3 22:26:05 2009 @@ -295,7 +295,7 @@ class D (B,C): def save (self): - # Call superclass .save() + # Call superclass .save() super(D, self).save() # Save D's private information here ... Modified: python/branches/py3k/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.4.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.4.rst Sat Jan 3 22:26:05 2009 @@ -396,10 +396,10 @@ different keyword arguments. :: class Popen(args, bufsize=0, executable=None, - stdin=None, stdout=None, stderr=None, - preexec_fn=None, close_fds=False, shell=False, - cwd=None, env=None, universal_newlines=False, - startupinfo=None, creationflags=0): + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): *args* is commonly a sequence of strings that will be the arguments to the program executed as the subprocess. (If the *shell* argument is true, *args* Modified: python/branches/py3k/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.6.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.6.rst Sat Jan 3 22:26:05 2009 @@ -590,30 +590,30 @@ def factorial(queue, N): - "Compute a factorial." - # If N is a multiple of 4, this function will take much longer. - if (N % 4) == 0: - time.sleep(.05 * N/4) - - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # If N is a multiple of 4, this function will take much longer. + if (N % 4) == 0: + time.sleep(.05 * N/4) + + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i - # Put the result on the queue - queue.put(fact) + # Put the result on the queue + queue.put(fact) if __name__ == '__main__': - queue = Queue() + queue = Queue() - N = 5 + N = 5 - p = Process(target=factorial, args=(queue, N)) - p.start() - p.join() + p = Process(target=factorial, args=(queue, N)) + p.start() + p.join() - result = queue.get() - print 'Factorial', N, '=', result + result = queue.get() + print 'Factorial', N, '=', result A :class:`Queue` is used to communicate the input parameter *N* and the result. The :class:`Queue` object is stored in a global variable. @@ -634,12 +634,12 @@ from multiprocessing import Pool def factorial(N, dictionary): - "Compute a factorial." - ... + "Compute a factorial." + ... p = Pool(5) result = p.map(factorial, range(1, 1000, 10)) for v in result: - print v + print v This produces the following output:: @@ -1889,9 +1889,9 @@ ('id', 'name', 'type', 'size') >>> var = var_type(1, 'frequency', 'int', 4) - >>> print var[0], var.id # Equivalent + >>> print var[0], var.id # Equivalent 1 1 - >>> print var[2], var.type # Equivalent + >>> print var[2], var.type # Equivalent int int >>> var._asdict() {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'} @@ -2050,8 +2050,8 @@ >>> list(itertools.product([1,2,3], [4,5,6])) [(1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6)] + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, From python-checkins at python.org Sat Jan 3 22:30:41 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:30:41 +0100 (CET) Subject: [Python-checkins] r68228 - in python/branches/py3k/Doc: Makefile tools/rstlint.py Message-ID: <20090103213041.8E2C81E4056@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:30:40 2009 New Revision: 68228 Log: Merged revisions 68222 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines Disable the line length checker by default. ........ Modified: python/branches/py3k/Doc/Makefile python/branches/py3k/Doc/tools/rstlint.py Modified: python/branches/py3k/Doc/Makefile ============================================================================== --- python/branches/py3k/Doc/Makefile (original) +++ python/branches/py3k/Doc/Makefile Sat Jan 3 22:30:40 2009 @@ -142,4 +142,4 @@ cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 check: - $(PYTHON) tools/rstlint.py -i tools -s 2 + $(PYTHON) tools/rstlint.py -i tools Modified: python/branches/py3k/Doc/tools/rstlint.py ============================================================================== --- python/branches/py3k/Doc/tools/rstlint.py (original) +++ python/branches/py3k/Doc/tools/rstlint.py Sat Jan 3 22:30:40 2009 @@ -91,7 +91,6 @@ @checker('.py', '.rst') def check_whitespace(fn, lines): """Check for whitespace and line length issues.""" - lasti = 0 for lno, line in enumerate(lines): if '\r' in line: yield lno+1, '\\r in line' @@ -99,7 +98,13 @@ yield lno+1, 'OMG TABS!!!1' if line[:-1].rstrip(' \t') != line[:-1]: yield lno+1, 'trailing whitespace' - if len(line) > 86: + + + at checker('.rst', severity=0) +def check_line_length(fn, lines): + """Check for line length; this checker is not run by default.""" + for lno, line in enumerate(lines): + if len(line) > 81: # don't complain about tables, links and function signatures if line.lstrip()[0] not in '+|' and \ 'http://' not in line and \ From python-checkins at python.org Sat Jan 3 22:31:48 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:31:48 +0100 (CET) Subject: [Python-checkins] r68229 - in python/branches/py3k: Doc/extending/newtypes.rst Doc/howto/regex.rst Doc/library/bdb.rst Doc/library/urllib.request.rst Doc/library/xmlrpc.client.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tutorial/classes.rst Doc/tutorial/datastructures.rst Doc/using/unix.rst Doc/whatsnew/2.4.rst Message-ID: <20090103213148.BC6311E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:31:47 2009 New Revision: 68229 Log: Fix a few remaining problems found by rstlint. Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/extending/newtypes.rst python/branches/py3k/Doc/howto/regex.rst python/branches/py3k/Doc/library/bdb.rst python/branches/py3k/Doc/library/urllib.request.rst python/branches/py3k/Doc/library/xmlrpc.client.rst python/branches/py3k/Doc/reference/lexical_analysis.rst python/branches/py3k/Doc/reference/simple_stmts.rst python/branches/py3k/Doc/tutorial/classes.rst python/branches/py3k/Doc/tutorial/datastructures.rst python/branches/py3k/Doc/using/unix.rst python/branches/py3k/Doc/whatsnew/2.4.rst Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Sat Jan 3 22:31:47 2009 @@ -1216,7 +1216,7 @@ PyErr_Format(PyExc_AttributeError, "'%.50s' object has no attribute '%.400s'", - tp->tp_name, name); + tp->tp_name, name); return NULL; } Modified: python/branches/py3k/Doc/howto/regex.rst ============================================================================== --- python/branches/py3k/Doc/howto/regex.rst (original) +++ python/branches/py3k/Doc/howto/regex.rst Sat Jan 3 22:31:47 2009 @@ -611,7 +611,7 @@ is to read? :: charref = re.compile(r""" - &[#] # Start of a numeric entity reference + &[#] # Start of a numeric entity reference ( 0[0-7]+ # Octal form | [0-9]+ # Decimal form Modified: python/branches/py3k/Doc/library/bdb.rst ============================================================================== --- python/branches/py3k/Doc/library/bdb.rst (original) +++ python/branches/py3k/Doc/library/bdb.rst Sat Jan 3 22:31:47 2009 @@ -335,7 +335,7 @@ Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. - + Called only if we know there is a breakpoint at this location. Returns the breakpoint that was triggered and a flag that indicates if it is ok to delete a temporary breakpoint. 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 Sat Jan 3 22:31:47 2009 @@ -49,8 +49,8 @@ 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 `ProxyHandler` - objects. + as a dict parameter to urlopen can be availed by the use of + :class:`ProxyHandler` objects. .. function:: install_opener(opener) Modified: python/branches/py3k/Doc/library/xmlrpc.client.rst ============================================================================== --- python/branches/py3k/Doc/library/xmlrpc.client.rst (original) +++ python/branches/py3k/Doc/library/xmlrpc.client.rst Sat Jan 3 22:31:47 2009 @@ -513,8 +513,8 @@ self.proxy = proxy def make_connection(self, host): self.realhost = host - h = http.client.HTTP(self.proxy) - return h + h = http.client.HTTP(self.proxy) + return h def send_request(self, connection, handler, request_body): connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) def send_host(self, connection, host): Modified: python/branches/py3k/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/py3k/Doc/reference/lexical_analysis.rst (original) +++ python/branches/py3k/Doc/reference/lexical_analysis.rst Sat Jan 3 22:31:47 2009 @@ -608,7 +608,7 @@ 7 2147483647 0o177 0b100110111 3 79228162514264337593543950336 0o377 0x100000000 - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: 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 Sat Jan 3 22:31:47 2009 @@ -871,8 +871,8 @@ nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)* .. XXX add when implemented - : ["=" (`target_list` "=")+ `expression_list`] - : | "nonlocal" `identifier` `augop` `expression_list` + : ["=" (`target_list` "=")+ expression_list] + : | "nonlocal" identifier augop expression_list The :keyword:`nonlocal` statement causes the listed identifiers to refer to previously bound variables in the nearest enclosing scope. This is important Modified: python/branches/py3k/Doc/tutorial/classes.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/classes.rst (original) +++ python/branches/py3k/Doc/tutorial/classes.rst Sat Jan 3 22:31:47 2009 @@ -789,7 +789,7 @@ f l o - g + g Anything that can be done with generators can also be done with class based iterators as described in the previous section. What makes generators so Modified: python/branches/py3k/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/datastructures.rst (original) +++ python/branches/py3k/Doc/tutorial/datastructures.rst Sat Jan 3 22:31:47 2009 @@ -519,7 +519,7 @@ >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print('What is your {0}? It is {1}.'.format(q, a)) - ... + ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. @@ -542,7 +542,7 @@ >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print(f) - ... + ... apple banana orange Modified: python/branches/py3k/Doc/using/unix.rst ============================================================================== --- python/branches/py3k/Doc/using/unix.rst (original) +++ python/branches/py3k/Doc/using/unix.rst Sat Jan 3 22:31:47 2009 @@ -19,7 +19,7 @@ package on all others. However there are certain features you might want to use that are not available on your distro's package. You can easily compile the latest version of Python from source. - + In the event that Python doesn't come preinstalled and isn't in the repositories as well, you can easily make packages for your own distro. Have a look at the following links: @@ -46,7 +46,7 @@ * OpenBSD users use:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz - + For example i386 users get the 2.5.1 version of Python using:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz Modified: python/branches/py3k/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.4.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.4.rst Sat Jan 3 22:31:47 2009 @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that From python-checkins at python.org Sat Jan 3 22:38:36 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 22:38:36 +0100 (CET) Subject: [Python-checkins] r68230 - in python/branches/release30-maint: Lib/test/test_wsgiref.py Lib/wsgiref/headers.py Message-ID: <20090103213836.011AF1E400C@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 22:38:35 2009 New Revision: 68230 Log: Merged revisions 68216 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68216 | antoine.pitrou | 2009-01-03 21:28:05 +0100 (sam., 03 janv. 2009) | 3 lines Fix BytesWarning with -bb in wsgiref.headers.Headers. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_wsgiref.py python/branches/release30-maint/Lib/wsgiref/headers.py Modified: python/branches/release30-maint/Lib/test/test_wsgiref.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_wsgiref.py (original) +++ python/branches/release30-maint/Lib/test/test_wsgiref.py Sat Jan 3 22:38:35 2009 @@ -426,15 +426,20 @@ h[b"Foo"] = bytes(b"bar") self.assertEqual("bar", h.get("Foo")) + self.assertEqual("bar", h.get(b"Foo")) h.setdefault(b"Bar", b"foo") self.assertEqual("foo", h.get("Bar")) + self.assertEqual("foo", h.get(b"Bar")) h.add_header(b'content-disposition', b'attachment', filename=b'bud.gif') self.assertEqual('attachment; filename="bud.gif"', h.get("content-disposition")) + del h['content-disposition'] + self.assert_(b'content-disposition' not in h) + class ErrorHandler(BaseCGIHandler): """Simple handler subclass for testing BaseHandler""" Modified: python/branches/release30-maint/Lib/wsgiref/headers.py ============================================================================== --- python/branches/release30-maint/Lib/wsgiref/headers.py (original) +++ python/branches/release30-maint/Lib/wsgiref/headers.py Sat Jan 3 22:38:35 2009 @@ -73,7 +73,7 @@ Does *not* raise an exception if the header is missing. """ - name = name.lower() + name = self._convert_string_type(name.lower()) self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] def __getitem__(self,name): @@ -104,13 +104,13 @@ fields deleted and re-inserted are always appended to the header list. If no fields exist with the given name, returns an empty list. """ - name = name.lower() + name = self._convert_string_type(name.lower()) return [kv[1] for kv in self._headers if kv[0].lower()==name] def get(self,name,default=None): """Get the first header value for 'name', or return 'default'""" - name = name.lower() + name = self._convert_string_type(name.lower()) for k,v in self._headers: if k.lower()==name: return v From python-checkins at python.org Sat Jan 3 22:51:09 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 3 Jan 2009 22:51:09 +0100 (CET) Subject: [Python-checkins] r68231 - in python/trunk: Misc/NEWS Modules/_tkinter.c Message-ID: <20090103215109.74DB41E4002@bag.python.org> Author: guilherme.polo Date: Sat Jan 3 22:51:09 2009 New Revision: 68231 Log: The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x (part of issue #3638). Modified: python/trunk/Misc/NEWS python/trunk/Modules/_tkinter.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 3 22:51:09 2009 @@ -108,6 +108,10 @@ Library ------- +- The _tkinter module functions "createfilehandler", "deletefilehandler", + "createtimerhandler", "mainloop", "dooneevent" and "quit" have been + deprecated for removal in 3.x + - Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() to the decimal module. Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Sat Jan 3 22:51:09 2009 @@ -2255,6 +2255,12 @@ PyObject *file, *func; int mask, tfile; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.createfilehandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "OiO:createfilehandler", &file, &mask, &func)) return NULL; @@ -2299,6 +2305,12 @@ PyObject *file; int tfile; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.deletefilehandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) return NULL; @@ -2472,6 +2484,12 @@ PyObject *func; TkttObject *v; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.createtimerhandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "iO:createtimerhandler", &milliseconds, &func)) return NULL; @@ -2515,6 +2533,12 @@ PyThreadState *tstate = PyThreadState_Get(); #endif + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.mainloop is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold)) return NULL; @@ -2590,6 +2614,12 @@ int flags = 0; int rv; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.dooneevent is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "|i:dooneevent", &flags)) return NULL; @@ -2603,6 +2633,12 @@ Tkapp_Quit(PyObject *self, PyObject *args) { + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.createfilehandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, ":quit")) return NULL; From python-checkins at python.org Sat Jan 3 22:52:16 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:52:16 +0100 (CET) Subject: [Python-checkins] r68232 - python/trunk/Doc/c-api/structures.rst Message-ID: <20090103215216.439F41E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:52:16 2009 New Revision: 68232 Log: Grammar fix. Modified: python/trunk/Doc/c-api/structures.rst Modified: python/trunk/Doc/c-api/structures.rst ============================================================================== --- python/trunk/Doc/c-api/structures.rst (original) +++ python/trunk/Doc/c-api/structures.rst Sat Jan 3 22:52:16 2009 @@ -208,7 +208,7 @@ .. ctype:: PyMemberDef Structure which describes an attribute of a type which corresponds to a C - struct member. It's fields are: + struct member. Its fields are: +------------------+-------------+-------------------------------+ | Field | C Type | Meaning | @@ -263,9 +263,8 @@ :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies - :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` can be - deleted. (They are set to *NULL*). - + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` + members can be deleted. (They are set to *NULL*). .. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name) From python-checkins at python.org Sat Jan 3 22:53:34 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 3 Jan 2009 22:53:34 +0100 (CET) Subject: [Python-checkins] r68233 - python/branches/py3k Message-ID: <20090103215334.C99831E4002@bag.python.org> Author: guilherme.polo Date: Sat Jan 3 22:53:34 2009 New Revision: 68233 Log: Blocked revisions 68231 via svnmerge ........ r68231 | guilherme.polo | 2009-01-03 19:51:09 -0200 (Sat, 03 Jan 2009) | 4 lines The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x (part of issue #3638). ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 3 22:55:20 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:55:20 +0100 (CET) Subject: [Python-checkins] r68234 - in python/branches/release26-maint: Doc/ACKS.txt Doc/Makefile Doc/c-api/arg.rst Doc/c-api/buffer.rst Doc/c-api/conversion.rst Doc/c-api/file.rst Doc/c-api/init.rst Doc/c-api/long.rst Doc/c-api/module.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/structures.rst Doc/distutils/apiref.rst Doc/distutils/builtdist.rst Doc/distutils/configfile.rst Doc/distutils/packageindex.rst Doc/distutils/setupscript.rst Doc/distutils/uploading.rst Doc/documenting/markup.rst Doc/extending/building.rst Doc/extending/extending.rst Doc/extending/newtypes.rst Doc/extending/windows.rst Doc/glossary.rst Doc/howto/curses.rst Doc/howto/doanddont.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/howto/urllib2.rst Doc/howto/webservers.rst Doc/includes/mp_distributing.py Doc/install/index.rst Doc/library/abc.rst Doc/library/aifc.rst Doc/library/al.rst Doc/library/ast.rst Doc/library/audioop.rst Doc/library/bastion.rst Doc/library/bdb.rst Doc/library/bsddb.rst Doc/library/bz2.rst Doc/library/cd.rst Doc/library/cmath.rst Doc/library/codeop.rst Doc/library/collections.rst Doc/library/compiler.rst Doc/library/configparser.rst Doc/library/cookielib.rst Doc/library/crypt.rst Doc/library/csv.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/decimal.rst Doc/library/difflib.rst Doc/library/dircache.rst Doc/library/dis.rst Doc/library/dl.rst Doc/library/email.mime.rst Doc/library/fileinput.rst Doc/library/fl.rst Doc/library/fm.rst Doc/library/fpformat.rst Doc/library/fractions.rst Doc/library/functions.rst Doc/library/gettext.rst Doc/library/gl.rst Doc/library/gzip.rst Doc/library/heapq.rst Doc/library/htmllib.rst Doc/library/idle.rst Doc/library/imageop.rst Doc/library/imgfile.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/jpeg.rst Doc/library/json.rst Doc/library/locale.rst Doc/library/macos.rst Doc/library/mailbox.rst Doc/library/marshal.rst Doc/library/math.rst Doc/library/mhlib.rst Doc/library/mmap.rst Doc/library/msvcrt.rst Doc/library/multiprocessing.rst Doc/library/mutex.rst Doc/library/nntplib.rst Doc/library/numbers.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/ossaudiodev.rst Doc/library/othergui.rst Doc/library/parser.rst Doc/library/pdb.rst Doc/library/pickle.rst Doc/library/popen2.rst Doc/library/profile.rst Doc/library/pyexpat.rst Doc/library/re.rst Doc/library/repr.rst Doc/library/rexec.rst Doc/library/rlcompleter.rst Doc/library/robotparser.rst Doc/library/sched.rst Doc/library/sgmllib.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/simplexmlrpcserver.rst Doc/library/smtplib.rst Doc/library/socket.rst Doc/library/socketserver.rst Doc/library/sqlite3.rst Doc/library/ssl.rst Doc/library/statvfs.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/stringio.rst Doc/library/subprocess.rst Doc/library/sunaudio.rst Doc/library/sys.rst Doc/library/tempfile.rst Doc/library/tk.rst Doc/library/tkinter.rst Doc/library/trace.rst Doc/library/traceback.rst Doc/library/turtle.rst Doc/library/undoc.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/urllib.rst Doc/library/urllib2.rst Doc/library/urlparse.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/library/wsgiref.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpclib.rst Doc/library/zipfile.rst Doc/library/zipimport.rst Doc/license.rst Doc/reference/expressions.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tools/rstlint.py Doc/tutorial/classes.rst Doc/tutorial/controlflow.rst Doc/tutorial/datastructures.rst Doc/tutorial/errors.rst Doc/tutorial/index.rst Doc/tutorial/inputoutput.rst Doc/tutorial/interpreter.rst Doc/tutorial/introduction.rst Doc/tutorial/modules.rst Doc/tutorial/stdlib.rst Doc/tutorial/stdlib2.rst Doc/tutorial/whatnow.rst Doc/using/cmdline.rst Doc/using/unix.rst Doc/using/windows.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.1.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.3.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.6.rst LICENSE Lib/plat-mac/EasyDialogs.py Lib/plat-mac/macostools.py Lib/plat-mac/videoreader.py Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_set.py Makefile.pre.in Misc/NEWS Modules/_collectionsmodule.c Modules/_fileio.c Modules/cPickle.c Parser/asdl.py Python/getcopyright.c Python/pythonrun.c README Message-ID: <20090103215520.C46091E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:55:17 2009 New Revision: 68234 Log: Merged revisions 68133-68134,68141-68142,68145-68146,68148-68149,68159-68162,68166,68171-68174,68179,68195-68196,68210,68214-68215,68217-68222 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line fill in actual issue number in tests ........ r68134 | hirokazu.yamamoto | 2009-01-01 16:45:39 +0100 (Thu, 01 Jan 2009) | 2 lines Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. ........ r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line fix highlighting ........ r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines welcome to 2009, Python! ........ r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. ........ r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4472: "configure --enable-shared doesn't work on OSX" ........ r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines Forgot to add a NEWS item in my previous checkin ........ r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4780 ........ r68159 | ronald.oussoren | 2009-01-02 15:48:17 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 1627952 ........ r68160 | ronald.oussoren | 2009-01-02 15:52:09 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue r1737832 ........ r68161 | ronald.oussoren | 2009-01-02 16:00:05 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 1149804 ........ r68162 | ronald.oussoren | 2009-01-02 16:06:00 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 4472 is incompatible with Cygwin, this patch should fix that. ........ r68166 | benjamin.peterson | 2009-01-02 19:26:23 +0100 (Fri, 02 Jan 2009) | 1 line document PyMemberDef ........ r68171 | georg.brandl | 2009-01-02 21:25:14 +0100 (Fri, 02 Jan 2009) | 3 lines #4811: fix markup glitches (mostly remains of the conversion), found by Gabriel Genellina. ........ r68172 | martin.v.loewis | 2009-01-02 21:32:55 +0100 (Fri, 02 Jan 2009) | 2 lines Issue #4075: Use OutputDebugStringW in Py_FatalError. ........ r68173 | martin.v.loewis | 2009-01-02 21:40:14 +0100 (Fri, 02 Jan 2009) | 2 lines Issue #4051: Prevent conflict of UNICODE macros in cPickle. ........ r68174 | benjamin.peterson | 2009-01-02 21:47:27 +0100 (Fri, 02 Jan 2009) | 1 line fix compilation on non-Windows platforms ........ r68179 | raymond.hettinger | 2009-01-02 22:26:45 +0100 (Fri, 02 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ........ r68195 | georg.brandl | 2009-01-03 14:45:15 +0100 (Sat, 03 Jan 2009) | 2 lines Remove useless string literal. ........ r68196 | georg.brandl | 2009-01-03 15:29:53 +0100 (Sat, 03 Jan 2009) | 2 lines Fix indentation. ........ r68210 | georg.brandl | 2009-01-03 20:10:12 +0100 (Sat, 03 Jan 2009) | 2 lines Set eol-style correctly for mp_distributing.py. ........ r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines Make indentation consistent. ........ r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines Fix role name. ........ r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. ........ r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines Recognize usage of the default role. ........ r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines Fix uses of the default role. ........ r68220 | georg.brandl | 2009-01-03 21:55:06 +0100 (Sat, 03 Jan 2009) | 2 lines Remove trailing whitespace. ........ r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines Remove tabs from the documentation. ........ r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines Disable the line length checker by default. ........ Added: python/branches/release26-maint/Doc/tools/rstlint.py (contents, props changed) Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/ACKS.txt python/branches/release26-maint/Doc/Makefile python/branches/release26-maint/Doc/c-api/arg.rst python/branches/release26-maint/Doc/c-api/buffer.rst python/branches/release26-maint/Doc/c-api/conversion.rst python/branches/release26-maint/Doc/c-api/file.rst python/branches/release26-maint/Doc/c-api/init.rst python/branches/release26-maint/Doc/c-api/long.rst python/branches/release26-maint/Doc/c-api/module.rst python/branches/release26-maint/Doc/c-api/reflection.rst python/branches/release26-maint/Doc/c-api/sequence.rst python/branches/release26-maint/Doc/c-api/set.rst python/branches/release26-maint/Doc/c-api/structures.rst python/branches/release26-maint/Doc/distutils/apiref.rst python/branches/release26-maint/Doc/distutils/builtdist.rst python/branches/release26-maint/Doc/distutils/configfile.rst python/branches/release26-maint/Doc/distutils/packageindex.rst python/branches/release26-maint/Doc/distutils/setupscript.rst python/branches/release26-maint/Doc/distutils/uploading.rst python/branches/release26-maint/Doc/documenting/markup.rst python/branches/release26-maint/Doc/extending/building.rst python/branches/release26-maint/Doc/extending/extending.rst python/branches/release26-maint/Doc/extending/newtypes.rst python/branches/release26-maint/Doc/extending/windows.rst python/branches/release26-maint/Doc/glossary.rst python/branches/release26-maint/Doc/howto/curses.rst python/branches/release26-maint/Doc/howto/doanddont.rst python/branches/release26-maint/Doc/howto/functional.rst python/branches/release26-maint/Doc/howto/regex.rst python/branches/release26-maint/Doc/howto/sockets.rst python/branches/release26-maint/Doc/howto/unicode.rst python/branches/release26-maint/Doc/howto/urllib2.rst python/branches/release26-maint/Doc/howto/webservers.rst python/branches/release26-maint/Doc/includes/mp_distributing.py (contents, props changed) python/branches/release26-maint/Doc/install/index.rst python/branches/release26-maint/Doc/library/abc.rst python/branches/release26-maint/Doc/library/aifc.rst python/branches/release26-maint/Doc/library/al.rst python/branches/release26-maint/Doc/library/ast.rst python/branches/release26-maint/Doc/library/audioop.rst python/branches/release26-maint/Doc/library/bastion.rst python/branches/release26-maint/Doc/library/bdb.rst python/branches/release26-maint/Doc/library/bsddb.rst python/branches/release26-maint/Doc/library/bz2.rst python/branches/release26-maint/Doc/library/cd.rst python/branches/release26-maint/Doc/library/cmath.rst python/branches/release26-maint/Doc/library/codeop.rst python/branches/release26-maint/Doc/library/collections.rst python/branches/release26-maint/Doc/library/compiler.rst python/branches/release26-maint/Doc/library/configparser.rst python/branches/release26-maint/Doc/library/cookielib.rst python/branches/release26-maint/Doc/library/crypt.rst python/branches/release26-maint/Doc/library/csv.rst python/branches/release26-maint/Doc/library/ctypes.rst python/branches/release26-maint/Doc/library/datetime.rst python/branches/release26-maint/Doc/library/decimal.rst python/branches/release26-maint/Doc/library/difflib.rst python/branches/release26-maint/Doc/library/dircache.rst python/branches/release26-maint/Doc/library/dis.rst python/branches/release26-maint/Doc/library/dl.rst python/branches/release26-maint/Doc/library/email.mime.rst python/branches/release26-maint/Doc/library/fileinput.rst python/branches/release26-maint/Doc/library/fl.rst python/branches/release26-maint/Doc/library/fm.rst python/branches/release26-maint/Doc/library/fpformat.rst python/branches/release26-maint/Doc/library/fractions.rst python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/library/gettext.rst python/branches/release26-maint/Doc/library/gl.rst python/branches/release26-maint/Doc/library/gzip.rst python/branches/release26-maint/Doc/library/heapq.rst python/branches/release26-maint/Doc/library/htmllib.rst python/branches/release26-maint/Doc/library/idle.rst python/branches/release26-maint/Doc/library/imageop.rst python/branches/release26-maint/Doc/library/imgfile.rst python/branches/release26-maint/Doc/library/io.rst python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Doc/library/jpeg.rst python/branches/release26-maint/Doc/library/json.rst python/branches/release26-maint/Doc/library/locale.rst python/branches/release26-maint/Doc/library/macos.rst python/branches/release26-maint/Doc/library/mailbox.rst python/branches/release26-maint/Doc/library/marshal.rst python/branches/release26-maint/Doc/library/math.rst python/branches/release26-maint/Doc/library/mhlib.rst python/branches/release26-maint/Doc/library/mmap.rst python/branches/release26-maint/Doc/library/msvcrt.rst python/branches/release26-maint/Doc/library/multiprocessing.rst python/branches/release26-maint/Doc/library/mutex.rst python/branches/release26-maint/Doc/library/nntplib.rst python/branches/release26-maint/Doc/library/numbers.rst python/branches/release26-maint/Doc/library/operator.rst python/branches/release26-maint/Doc/library/optparse.rst python/branches/release26-maint/Doc/library/os.rst python/branches/release26-maint/Doc/library/ossaudiodev.rst python/branches/release26-maint/Doc/library/othergui.rst python/branches/release26-maint/Doc/library/parser.rst python/branches/release26-maint/Doc/library/pdb.rst python/branches/release26-maint/Doc/library/pickle.rst python/branches/release26-maint/Doc/library/popen2.rst python/branches/release26-maint/Doc/library/profile.rst python/branches/release26-maint/Doc/library/pyexpat.rst python/branches/release26-maint/Doc/library/re.rst python/branches/release26-maint/Doc/library/repr.rst python/branches/release26-maint/Doc/library/rexec.rst python/branches/release26-maint/Doc/library/rlcompleter.rst python/branches/release26-maint/Doc/library/robotparser.rst python/branches/release26-maint/Doc/library/sched.rst python/branches/release26-maint/Doc/library/sgmllib.rst python/branches/release26-maint/Doc/library/shutil.rst python/branches/release26-maint/Doc/library/signal.rst python/branches/release26-maint/Doc/library/simplexmlrpcserver.rst python/branches/release26-maint/Doc/library/smtplib.rst python/branches/release26-maint/Doc/library/socket.rst python/branches/release26-maint/Doc/library/socketserver.rst python/branches/release26-maint/Doc/library/sqlite3.rst python/branches/release26-maint/Doc/library/ssl.rst python/branches/release26-maint/Doc/library/statvfs.rst python/branches/release26-maint/Doc/library/stdtypes.rst python/branches/release26-maint/Doc/library/string.rst python/branches/release26-maint/Doc/library/stringio.rst python/branches/release26-maint/Doc/library/subprocess.rst python/branches/release26-maint/Doc/library/sunaudio.rst python/branches/release26-maint/Doc/library/sys.rst python/branches/release26-maint/Doc/library/tempfile.rst python/branches/release26-maint/Doc/library/tk.rst python/branches/release26-maint/Doc/library/tkinter.rst python/branches/release26-maint/Doc/library/trace.rst python/branches/release26-maint/Doc/library/traceback.rst python/branches/release26-maint/Doc/library/turtle.rst python/branches/release26-maint/Doc/library/undoc.rst python/branches/release26-maint/Doc/library/unicodedata.rst python/branches/release26-maint/Doc/library/unittest.rst python/branches/release26-maint/Doc/library/urllib.rst python/branches/release26-maint/Doc/library/urllib2.rst python/branches/release26-maint/Doc/library/urlparse.rst python/branches/release26-maint/Doc/library/warnings.rst python/branches/release26-maint/Doc/library/webbrowser.rst python/branches/release26-maint/Doc/library/wsgiref.rst python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst python/branches/release26-maint/Doc/library/xmlrpclib.rst python/branches/release26-maint/Doc/library/zipfile.rst python/branches/release26-maint/Doc/library/zipimport.rst python/branches/release26-maint/Doc/license.rst python/branches/release26-maint/Doc/reference/expressions.rst python/branches/release26-maint/Doc/reference/lexical_analysis.rst python/branches/release26-maint/Doc/reference/simple_stmts.rst python/branches/release26-maint/Doc/tutorial/classes.rst python/branches/release26-maint/Doc/tutorial/controlflow.rst python/branches/release26-maint/Doc/tutorial/datastructures.rst python/branches/release26-maint/Doc/tutorial/errors.rst python/branches/release26-maint/Doc/tutorial/index.rst python/branches/release26-maint/Doc/tutorial/inputoutput.rst python/branches/release26-maint/Doc/tutorial/interpreter.rst python/branches/release26-maint/Doc/tutorial/introduction.rst python/branches/release26-maint/Doc/tutorial/modules.rst python/branches/release26-maint/Doc/tutorial/stdlib.rst python/branches/release26-maint/Doc/tutorial/stdlib2.rst python/branches/release26-maint/Doc/tutorial/whatnow.rst python/branches/release26-maint/Doc/using/cmdline.rst python/branches/release26-maint/Doc/using/unix.rst python/branches/release26-maint/Doc/using/windows.rst python/branches/release26-maint/Doc/whatsnew/2.0.rst python/branches/release26-maint/Doc/whatsnew/2.1.rst python/branches/release26-maint/Doc/whatsnew/2.2.rst python/branches/release26-maint/Doc/whatsnew/2.3.rst python/branches/release26-maint/Doc/whatsnew/2.4.rst python/branches/release26-maint/Doc/whatsnew/2.5.rst python/branches/release26-maint/Doc/whatsnew/2.6.rst python/branches/release26-maint/LICENSE python/branches/release26-maint/Lib/plat-mac/EasyDialogs.py python/branches/release26-maint/Lib/plat-mac/macostools.py python/branches/release26-maint/Lib/plat-mac/videoreader.py python/branches/release26-maint/Lib/test/test_deque.py python/branches/release26-maint/Lib/test/test_dict.py python/branches/release26-maint/Lib/test/test_set.py python/branches/release26-maint/Makefile.pre.in python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_collectionsmodule.c python/branches/release26-maint/Modules/_fileio.c python/branches/release26-maint/Modules/cPickle.c python/branches/release26-maint/Parser/asdl.py python/branches/release26-maint/Python/getcopyright.c python/branches/release26-maint/Python/pythonrun.c python/branches/release26-maint/README Modified: python/branches/release26-maint/Doc/ACKS.txt ============================================================================== --- python/branches/release26-maint/Doc/ACKS.txt (original) +++ python/branches/release26-maint/Doc/ACKS.txt Sat Jan 3 22:55:17 2009 @@ -60,6 +60,7 @@ * Peter Funk * Lele Gaifax * Matthew Gallagher + * Gabriel Genellina * Ben Gertzfield * Nadim Ghaznavi * Jonathan Giddy Modified: python/branches/release26-maint/Doc/Makefile ============================================================================== --- python/branches/release26-maint/Doc/Makefile (original) +++ python/branches/release26-maint/Doc/Makefile Sat Jan 3 22:55:17 2009 @@ -14,7 +14,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html htmlhelp clean coverage dist +.PHONY: help checkout update build html htmlhelp clean coverage dist check help: @echo "Please use \`make ' where is one of" @@ -141,3 +141,5 @@ cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 +check: + $(PYTHON) tools/rstlint.py -i tools Modified: python/branches/release26-maint/Doc/c-api/arg.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/arg.rst (original) +++ python/branches/release26-maint/Doc/c-api/arg.rst Sat Jan 3 22:55:17 2009 @@ -46,12 +46,12 @@ :ctype:`Py_ssize_t` rather than an int. ``s*`` (string, Unicode, or any buffer compatible object) [Py_buffer \*] - Similar to ``s#``, this code fills a Py_buffer structure provided by the caller. - The buffer gets locked, so that the caller can subsequently use the buffer even - inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling - ``PyBuffer_Release`` with the structure after it has processed the data. + Similar to ``s#``, this code fills a Py_buffer structure provided by the caller. + The buffer gets locked, so that the caller can subsequently use the buffer even + inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling + ``PyBuffer_Release`` with the structure after it has processed the data. - .. versionadded:: 2.6 + .. versionadded:: 2.6 ``z`` (string or ``None``) [const char \*] Like ``s``, but the Python object may also be ``None``, in which case the C @@ -63,7 +63,7 @@ ``z*`` (string or ``None`` or any buffer compatible object) [Py_buffer*] This is to ``s*`` as ``z`` is to ``s``. - .. versionadded:: 2.6 + .. versionadded:: 2.6 ``u`` (Unicode object) [Py_UNICODE \*] Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of @@ -261,6 +261,7 @@ ``w*`` (read-write byte-oriented buffer) [Py_buffer \*] This is to ``w`` what ``s*`` is to ``s``. + .. versionadded:: 2.6 ``(items)`` (tuple) [*matching-items*] Modified: python/branches/release26-maint/Doc/c-api/buffer.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/buffer.rst (original) +++ python/branches/release26-maint/Doc/c-api/buffer.rst Sat Jan 3 22:55:17 2009 @@ -30,7 +30,7 @@ .. index:: single: PyBufferProcs -More information on the buffer interface is provided in the section +More information on the buffer interface is provided in the section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`. A "buffer object" is defined in the :file:`bufferobject.h` header (included by Modified: python/branches/release26-maint/Doc/c-api/conversion.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/conversion.rst (original) +++ python/branches/release26-maint/Doc/c-api/conversion.rst Sat Jan 3 22:55:17 2009 @@ -77,7 +77,7 @@ .. versionadded:: 2.4 - + .. cfunction:: double PyOS_ascii_atof(const char *nptr) Convert a string to a :ctype:`double` in a locale-independent way. @@ -86,7 +86,7 @@ See the Unix man page :manpage:`atof(2)` for details. - + .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) Case insensitive comparison of strings. The function works almost Modified: python/branches/release26-maint/Doc/c-api/file.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/file.rst (original) +++ python/branches/release26-maint/Doc/c-api/file.rst Sat Jan 3 22:55:17 2009 @@ -63,8 +63,8 @@ Return the file object associated with *p* as a :ctype:`FILE\*`. If the caller will ever use the returned :ctype:`FILE\*` object while - the GIL is released it must also call the `PyFile_IncUseCount` and - `PyFile_DecUseCount` functions described below as appropriate. + the GIL is released it must also call the :cfunc:`PyFile_IncUseCount` and + :cfunc:`PyFile_DecUseCount` functions described below as appropriate. .. cfunction:: void PyFile_IncUseCount(PyFileObject \*p) @@ -72,13 +72,13 @@ Increments the PyFileObject's internal use count to indicate that the underlying :ctype:`FILE\*` is being used. This prevents Python from calling f_close() on it from another thread. - Callers of this must call `PyFile_DecUseCount` when they are + Callers of this must call :cfunc:`PyFile_DecUseCount` when they are finished with the :ctype:`FILE\*`. Otherwise the file object will never be closed by Python. The GIL must be held while calling this function. - The suggested use is to call this after `PyFile_AsFile` just before + The suggested use is to call this after :cfunc:`PyFile_AsFile` just before you release the GIL. .. versionadded:: 2.6 @@ -88,7 +88,7 @@ Decrements the PyFileObject's internal unlocked_count member to indicate that the caller is done with its own use of the :ctype:`FILE\*`. - This may only be called to undo a prior call to `PyFile_IncUseCount`. + This may only be called to undo a prior call to :cfunc:`PyFile_IncUseCount`. The GIL must be held while calling this function. 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 Sat Jan 3 22:55:17 2009 @@ -902,7 +902,7 @@ Return a tuple of function call counts. There are constants defined for the positions within the tuple: - + +-------------------------------+-------+ | Name | Value | +===============================+=======+ @@ -928,7 +928,7 @@ +-------------------------------+-------+ | :const:`PCALL_POP` | 10 | +-------------------------------+-------+ - + :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used. Modified: python/branches/release26-maint/Doc/c-api/long.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/long.rst (original) +++ python/branches/release26-maint/Doc/c-api/long.rst Sat Jan 3 22:55:17 2009 @@ -126,7 +126,7 @@ Return a C :ctype:`long` representation of the contents of *pylong*. If *pylong* is greater than :const:`LONG_MAX`, an :exc:`OverflowError` is raised - and ``-1`` will be returned. + and ``-1`` will be returned. .. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong) Modified: python/branches/release26-maint/Doc/c-api/module.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/module.rst (original) +++ python/branches/release26-maint/Doc/c-api/module.rst Sat Jan 3 22:55:17 2009 @@ -106,7 +106,7 @@ .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro) - Add an int constant to *module*. The name and the value are taken from + Add an int constant to *module*. The name and the value are taken from *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on error, ``0`` on success. Modified: python/branches/release26-maint/Doc/c-api/reflection.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/reflection.rst (original) +++ python/branches/release26-maint/Doc/c-api/reflection.rst Sat Jan 3 22:55:17 2009 @@ -15,7 +15,7 @@ Return a dictionary of the local variables in the current execution frame, or *NULL* if no frame is currently executing. - + .. cfunction:: PyObject* PyEval_GetGlobals() Modified: python/branches/release26-maint/Doc/c-api/sequence.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/sequence.rst (original) +++ python/branches/release26-maint/Doc/c-api/sequence.rst Sat Jan 3 22:55:17 2009 @@ -143,9 +143,9 @@ Return the underlying array of PyObject pointers. Assumes that *o* was returned by :cfunc:`PySequence_Fast` and *o* is not *NULL*. - + Note, if a list gets resized, the reallocation may relocate the items array. - So, only use the underlying array pointer in contexts where the sequence + So, only use the underlying array pointer in contexts where the sequence cannot change. .. versionadded:: 2.4 Modified: python/branches/release26-maint/Doc/c-api/set.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/set.rst (original) +++ python/branches/release26-maint/Doc/c-api/set.rst Sat Jan 3 22:55:17 2009 @@ -101,7 +101,7 @@ .. versionchanged:: 2.6 Now guaranteed to return a brand-new :class:`frozenset`. Formerly, - frozensets of zero-length were a singleton. This got in the way of + frozensets of zero-length were a singleton. This got in the way of building-up new frozensets with :meth:`PySet_Add`. The following functions and macros are available for instances of :class:`set` Modified: python/branches/release26-maint/Doc/c-api/structures.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/structures.rst (original) +++ python/branches/release26-maint/Doc/c-api/structures.rst Sat Jan 3 22:55:17 2009 @@ -205,6 +205,69 @@ .. versionadded:: 2.4 +.. ctype:: PyMemberDef + + Structure which describes an attribute of a type which corresponds to a C + struct member. It's fields are: + + +------------------+-------------+-------------------------------+ + | Field | C Type | Meaning | + +==================+=============+===============================+ + | :attr:`name` | char \* | name of the member | + +------------------+-------------+-------------------------------+ + | :attr:`type` | int | the type of the member in the | + | | | C struct | + +------------------+-------------+-------------------------------+ + | :attr:`offset` | Py_ssize_t | the offset in bytes that the | + | | | member is located on the | + | | | type's object struct | + +------------------+-------------+-------------------------------+ + | :attr:`flags` | int | flag bits indicating if the | + | | | field should be read-only or | + | | | writable | + +------------------+-------------+-------------------------------+ + | :attr:`doc` | char \* | points to the contents of the | + | | | docstring | + +------------------+-------------+-------------------------------+ + + :attr:`type` can be one of many ``T_`` macros corresponding to various C + types. When the member is accessed in Python, it will be converted to the + equivalent Python type. + + =============== ================== + Macro name C type + =============== ================== + T_SHORT short + T_INT int + T_LONG long + T_FLOAT float + T_DOUBLE double + T_STRING char \* + T_OBJECT PyObject \* + T_OBJECT_EX PyObject \* + T_CHAR char + T_BYTE char + T_UNBYTE unsigned char + T_UINT unsigned int + T_USHORT unsigned short + T_ULONG unsigned long + T_BOOL char + T_LONGLONG long long + T_ULONGLONG unsigned long long + T_PYSSIZET Py_ssize_t + =============== ================== + + :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that + :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and + :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. + + :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for + read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` can be + deleted. (They are set to *NULL*). + + + .. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name) Return a bound method object for an extension type implemented in C. This can Modified: python/branches/release26-maint/Doc/distutils/apiref.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/apiref.rst (original) +++ python/branches/release26-maint/Doc/distutils/apiref.rst Sat Jan 3 22:55:17 2009 @@ -104,7 +104,7 @@ | *package_dir* | A mapping of package to | a dictionary | | | directory names | | +--------------------+--------------------------------+-------------------------------------------------------------+ - + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -188,9 +188,10 @@ | | for C/C++ header files (in | | | | Unix form for portability) | | +------------------------+--------------------------------+---------------------------+ - | *define_macros* | list of macros to define; each | (string,string) tuple or | - | | macro is defined using a | (name,``None``) | - | | 2-tuple, where 'value' is | | + | *define_macros* | list of macros to define; each | (string, string) tuple or | + | | macro is defined using a | (name, ``None``) | + | | 2-tuple ``(name, value)``, | | + | | where *value* is | | | | either the string to define it | | | | to or ``None`` to define it | | | | without a particular value | | @@ -754,7 +755,7 @@ standard output, otherwise do nothing. .. % \subsection{Compiler-specific modules} -.. % +.. % .. % The following modules implement concrete subclasses of the abstract .. % \class{CCompiler} class. They should not be instantiated directly, but should .. % be created using \function{distutils.ccompiler.new_compiler()} factory @@ -858,7 +859,7 @@ Macintosh. Needs work to support CW on Windows or Mac OS X. .. % \subsection{Utility modules} -.. % +.. % .. % The following modules all provide general utility functions. They haven't .. % all been documented yet. @@ -1109,13 +1110,13 @@ For MacOS X systems the OS version reflects the minimal version on which binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` - during the build of Python), not the OS version of the current system. + during the build of Python), not the OS version of the current system. For universal binary builds on MacOS X the architecture value reflects the univeral binary status instead of the architecture of the current - processor. For 32-bit universal binaries the architecture is ``fat``, - for 64-bit universal binaries the architecture is ``fat64``, and - for 4-way universal binaries the architecture is ``universal``. + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. Examples of returned values on MacOS X: @@ -1692,7 +1693,7 @@ .. % todo .. % \section{Distutils Commands} -.. % +.. % .. % This part of Distutils implements the various Distutils commands, such .. % as \code{build}, \code{install} \&c. Each command is implemented as a .. % separate module, with the command name as the name of the module. Modified: python/branches/release26-maint/Doc/distutils/builtdist.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/builtdist.rst (original) +++ python/branches/release26-maint/Doc/distutils/builtdist.rst Sat Jan 3 22:55:17 2009 @@ -268,13 +268,13 @@ .. % \longprogramopt{spec-file} option; used in conjunction with .. % \longprogramopt{spec-only}, this gives you an opportunity to customize .. % the \file{.spec} file manually: -.. % +.. % .. % \ begin{verbatim} .. % > python setup.py bdist_rpm --spec-only .. % # ...edit dist/FooBar-1.0.spec .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec .. % \ end{verbatim} -.. % +.. % .. % (Although a better way to do this is probably to override the standard .. % \command{bdist\_rpm} command with one that writes whatever else you want .. % to the \file{.spec} file.) @@ -334,31 +334,31 @@ Cross-compiling on Windows ========================== -Starting with Python 2.6, distutils is capable of cross-compiling between -Windows platforms. In practice, this means that with the correct tools +Starting with Python 2.6, distutils is capable of cross-compiling between +Windows platforms. In practice, this means that with the correct tools installed, you can use a 32bit version of Windows to create 64bit extensions and vice-versa. -To build for an alternate platform, specify the :option:`--plat-name` option -to the build command. Valid values are currently 'win32', 'win-amd64' and +To build for an alternate platform, specify the :option:`--plat-name` option +to the build command. Valid values are currently 'win32', 'win-amd64' and 'win-ia64'. For example, on a 32bit version of Windows, you could execute:: python setup.py build --plat-name=win-amd64 -to build a 64bit version of your extension. The Windows Installers also +to build a 64bit version of your extension. The Windows Installers also support this option, so the command:: python setup.py build --plat-name=win-amd64 bdist_wininst would create a 64bit installation executable on your 32bit version of Windows. -To cross-compile, you must download the Python source code and cross-compile +To cross-compile, you must download the Python source code and cross-compile Python itself for the platform you are targetting - it is not possible from a binary installtion of Python (as the .lib etc file for other platforms are -not included.) In practice, this means the user of a 32 bit operating -system will need to use Visual Studio 2008 to open the -:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the -"x64" configuration of the 'pythoncore' project before cross-compiling +not included.) In practice, this means the user of a 32 bit operating +system will need to use Visual Studio 2008 to open the +:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the +"x64" configuration of the 'pythoncore' project before cross-compiling extensions is possible. Note that by default, Visual Studio 2008 does not install 64bit compilers or Modified: python/branches/release26-maint/Doc/distutils/configfile.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/configfile.rst (original) +++ python/branches/release26-maint/Doc/distutils/configfile.rst Sat Jan 3 22:55:17 2009 @@ -63,7 +63,7 @@ --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine - --swig-opts list of SWIG command line options + --swig-opts list of SWIG command line options [...] Note that an option spelled :option:`--foo-bar` on the command-line is spelled Modified: python/branches/release26-maint/Doc/distutils/packageindex.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/packageindex.rst (original) +++ python/branches/release26-maint/Doc/distutils/packageindex.rst Sat Jan 3 22:55:17 2009 @@ -72,7 +72,7 @@ index-servers = pypi other - + [pypi] repository: username: @@ -91,4 +91,4 @@ python setup.py register -r other - + Modified: python/branches/release26-maint/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/setupscript.rst (original) +++ python/branches/release26-maint/Doc/distutils/setupscript.rst Sat Jan 3 22:55:17 2009 @@ -213,7 +213,7 @@ this:: setup(..., - ext_modules=[Extension('_foo', ['foo.i'], + ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], ) Modified: python/branches/release26-maint/Doc/distutils/uploading.rst ============================================================================== --- python/branches/release26-maint/Doc/distutils/uploading.rst (original) +++ python/branches/release26-maint/Doc/distutils/uploading.rst Sat Jan 3 22:55:17 2009 @@ -35,9 +35,9 @@ be available for execution on the system :envvar:`PATH`. You can also specify which key to use for signing using the :option:`--identity=*name*` option. -Other :command:`upload` options include :option:`--repository=*url*` -or :option:`--repository=*section*` where `url` is the url of the server -and `section` the name of the section in :file:`$HOME/.pypirc`, and +Other :command:`upload` options include :option:`--repository=` or +:option:`--repository=
` where *url* is the url of the server and +*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). 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 Sat Jan 3 22:55:17 2009 @@ -508,7 +508,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. .. describe:: var @@ -599,7 +599,7 @@ Example:: .. versionadded:: 2.5 - The `spam` parameter. + The *spam* parameter. Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. @@ -760,14 +760,14 @@ Blank lines are not allowed within ``productionlist`` directive arguments. The definition can contain token names which are marked as interpreted text - (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references + (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references to the productions of these tokens. Note that no further reST parsing is done in the production, so that you don't have to escape ``*`` or ``|`` characters. -.. XXX describe optional first parameter +.. XXX describe optional first parameter The following is an example taken from the Python Reference Manual:: Modified: python/branches/release26-maint/Doc/extending/building.rst ============================================================================== --- python/branches/release26-maint/Doc/extending/building.rst (original) +++ python/branches/release26-maint/Doc/extending/building.rst Sat Jan 3 22:55:17 2009 @@ -39,7 +39,7 @@ With this :file:`setup.py`, and a file :file:`demo.c`, running :: - python setup.py build + python setup.py build will compile :file:`demo.c`, and produce an extension module named ``demo`` in the :file:`build` directory. Depending on the system, the module file will end Modified: python/branches/release26-maint/Doc/extending/extending.rst ============================================================================== --- python/branches/release26-maint/Doc/extending/extending.rst (original) +++ python/branches/release26-maint/Doc/extending/extending.rst Sat Jan 3 22:55:17 2009 @@ -471,7 +471,7 @@ :cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of -arguments. To call the Python function with no arguments, pass in NULL, or +arguments. To call the Python function with no arguments, pass in NULL, or an empty tuple; to call it with one argument, pass a singleton tuple. :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example:: @@ -510,7 +510,7 @@ if (result == NULL) return NULL; /* Pass error back */ ...use result... - Py_DECREF(result); + Py_DECREF(result); Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases @@ -535,7 +535,7 @@ the error check! Also note that strictly speaking this code is not complete: :cfunc:`Py_BuildValue` may run out of memory, and this should be checked. -You may also call a function with keyword arguments by using +You may also call a function with keyword arguments by using :cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. :: @@ -671,7 +671,7 @@ static PyObject * keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) - { + { int voltage; char *state = "a stiff"; char *action = "voom"; @@ -679,11 +679,11 @@ static char *kwlist[] = {"voltage", "state", "action", "type", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, &voltage, &state, &action, &type)) - return NULL; + return NULL; - printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", + printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", action, voltage); printf("-- Lovely plumage, the %s -- It's %s!\n", type, state); Modified: python/branches/release26-maint/Doc/extending/newtypes.rst ============================================================================== --- python/branches/release26-maint/Doc/extending/newtypes.rst (original) +++ python/branches/release26-maint/Doc/extending/newtypes.rst Sat Jan 3 22:55:17 2009 @@ -840,8 +840,8 @@ previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -854,10 +854,10 @@ static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -876,18 +876,18 @@ PyMODINIT_FUNC initshoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return; - - m = Py_InitModule3("shoddy", NULL, "Shoddy module"); - if (m == NULL) - return; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return; + + m = Py_InitModule3("shoddy", NULL, "Shoddy module"); + if (m == NULL) + return; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1167,7 +1167,7 @@ typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; @@ -1234,7 +1234,7 @@ of *NULL* is required. .. XXX Descriptors need to be explained in more detail somewhere, but not here. - + Descriptor objects have two handler functions which correspond to the \member{tp_getattro} and \member{tp_setattro} handlers. The \method{__get__()} handler is a function which is passed the descriptor, Modified: python/branches/release26-maint/Doc/extending/windows.rst ============================================================================== --- python/branches/release26-maint/Doc/extending/windows.rst (original) +++ python/branches/release26-maint/Doc/extending/windows.rst Sat Jan 3 22:55:17 2009 @@ -102,7 +102,7 @@ and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its first argument (use the minimal :file:`example.c` in this directory as a guide). By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. - The output file should be called :file:`spam.pyd` (in Release mode) or + The output file should be called :file:`spam.pyd` (in Release mode) or :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. Modified: python/branches/release26-maint/Doc/glossary.rst ============================================================================== --- python/branches/release26-maint/Doc/glossary.rst (original) +++ python/branches/release26-maint/Doc/glossary.rst Sat Jan 3 22:55:17 2009 @@ -11,7 +11,7 @@ ``>>>`` The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter. - + ``...`` The default Python prompt of the interactive shell when entering code for an indented code block or within a pair of matching left and right @@ -50,11 +50,11 @@ A value associated with an object which is referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. - + BDFL Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator. - + bytecode Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in @@ -67,11 +67,11 @@ A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class. - + classic class Any class which does not inherit from :class:`object`. See :term:`new-style class`. Classic classes will be removed in Python 3.0. - + coercion The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, @@ -84,7 +84,7 @@ ``operator.add(3.0, 4.5)``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. - + complex number An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary @@ -96,7 +96,7 @@ :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them. - + context manager An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. @@ -138,7 +138,7 @@ class methods, static methods, and reference to super classes. For more information about descriptors' methods, see :ref:`descriptors`. - + dictionary An associative array, where arbitrary keys are mapped to values. The use of :class:`dict` closely resembles that for :class:`list`, but the keys can @@ -152,8 +152,8 @@ of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object. - - duck-typing + + duck-typing A pythonic programming style which determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it @@ -163,13 +163,13 @@ :func:`isinstance`. (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming. - + EAFP Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` - statements. The technique contrasts with the :term:`LBYL` style + statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C. expression @@ -195,14 +195,14 @@ which are not compatible with the current interpreter. For example, the expression ``11/4`` currently evaluates to ``2``. If the module in which it is executed had enabled *true division* by executing:: - + from __future__ import division - + the expression ``11/4`` would evaluate to ``2.75``. By importing the :mod:`__future__` module and evaluating its variables, you can see when a new feature was first added to the language and when it will become the default:: - + >>> import __future__ >>> __future__.division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) @@ -211,7 +211,7 @@ The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. - + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -221,21 +221,21 @@ stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the :meth:`next` method of the returned iterator. - + .. index:: single: generator expression - + generator expression An expression that returns a generator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: - + >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285 - + GIL See :term:`global interpreter lock`. - + global interpreter lock The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. @@ -261,21 +261,21 @@ containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`. - + IDLE An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application. - + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary. - + integer division Mathematical division discarding any remainder. For example, the expression ``11/4`` currently evaluates to ``2`` in contrast to the @@ -287,7 +287,7 @@ divided by a float will result in a float value, possibly with a decimal fraction. Integer division can be forced by using the ``//`` operator instead of the ``/`` operator. See also :term:`__future__`. - + interactive Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately @@ -295,7 +295,7 @@ arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). - + interpreted Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the @@ -304,7 +304,7 @@ Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`. - + iterable A container object capable of returning its members one at a time. Examples of iterables include all sequence types (such as @@ -320,7 +320,7 @@ statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`. - + iterator An object representing a stream of data. Repeated calls to the iterator's :meth:`next` method return successive items in the stream. When no more @@ -335,7 +335,7 @@ :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container. - + More information can be found in :ref:`typeiter`. keyword argument @@ -359,7 +359,7 @@ A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1). - + list comprehension A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ["0x%02x" % x for x in @@ -367,11 +367,11 @@ even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed. - + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. - + metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for @@ -390,7 +390,7 @@ of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`. - + mutable Mutable objects can change their value but keep their :func:`id`. See also :term:`immutable`. @@ -407,7 +407,7 @@ :func:`collections.namedtuple`. The latter approach automatically provides extra features such as a self-documenting representation like ``Employee(name='jones', title='programmer')``. - + namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and builtin namespaces as well @@ -419,7 +419,7 @@ :func:`random.seed` or :func:`itertools.izip` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively. - + nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to @@ -427,7 +427,7 @@ reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. - + new-style class Any class which inherits from :class:`object`. This includes all built-in types like :class:`list` and :class:`dict`. Only new-style classes can @@ -440,7 +440,7 @@ Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`. - + positional argument The arguments assigned to local names inside a function or method, determined by the order in which they were given in the call. ``*`` is @@ -448,7 +448,7 @@ definition), or pass several arguments as a list to a function. See :term:`argument`. - Python 3000 + Python 3000 Nickname for the next major Python version, 3.0 (coined long ago when the release of version 3 was something in the distant future.) This is also abbreviated "Py3k". @@ -460,7 +460,7 @@ to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:: - + for i in range(len(food)): print food[i] @@ -483,7 +483,7 @@ dictionaries. Though popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. - + sequence An :term:`iterable` which supports efficient element access using integer indices via the :meth:`__getitem__` special method and defines a @@ -529,7 +529,7 @@ virtual machine A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler. - + Zen of Python Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing Modified: python/branches/release26-maint/Doc/howto/curses.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/curses.rst (original) +++ python/branches/release26-maint/Doc/howto/curses.rst Sat Jan 3 22:55:17 2009 @@ -297,7 +297,7 @@ could code:: stdscr.addstr(0, 0, "Current mode: Typing mode", - curses.A_REVERSE) + curses.A_REVERSE) stdscr.refresh() The curses library also supports color on those terminals that provide it, The @@ -399,8 +399,8 @@ curses.echo() # Enable echoing of characters - # Get a 15-character string, with the cursor on the top line - s = stdscr.getstr(0,0, 15) + # Get a 15-character string, with the cursor on the top line + s = stdscr.getstr(0,0, 15) The Python :mod:`curses.textpad` module supplies something better. With it, you can turn a window into a text box that supports an Emacs-like set of Modified: python/branches/release26-maint/Doc/howto/doanddont.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/doanddont.rst (original) +++ python/branches/release26-maint/Doc/howto/doanddont.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ ************************************ - Idioms and Anti-Idioms in Python + Idioms and Anti-Idioms in Python ************************************ :Author: Moshe Zadka @@ -127,7 +127,7 @@ # bar.py from foo import a if something(): - a = 2 # danger: foo.a != a + a = 2 # danger: foo.a != a Good example:: @@ -303,6 +303,6 @@ This version is bulletproof:: - value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + calculate_number(10, 20)*forbulate(500, 360)) Modified: python/branches/release26-maint/Doc/howto/functional.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/functional.rst (original) +++ python/branches/release26-maint/Doc/howto/functional.rst Sat Jan 3 22:55:17 2009 @@ -145,7 +145,7 @@ functions are also easier to read and to check for errors. -Ease of debugging and testing +Ease of debugging and testing ----------------------------- Testing and debugging a functional-style program is easier. @@ -213,7 +213,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> Python expects iterable objects in several different contexts, the most important being the ``for`` statement. In the statement ``for X in Y``, Y must @@ -362,7 +362,7 @@ comprehensions are surrounded by square brackets ("[]"). Generator expressions have the form:: - ( expression for expr in sequence1 + ( expression for expr in sequence1 if condition1 for expr2 in sequence2 if condition2 @@ -404,7 +404,7 @@ if not (conditionN): continue # Skip this element - # Output the value of + # Output the value of # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` @@ -418,8 +418,8 @@ >>> seq1 = 'abc' >>> seq2 = (1,2,3) >>> [(x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), + [('a', 1), ('a', 2), ('a', 3), + ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)] To avoid introducing an ambiguity into Python's grammar, if ``expression`` is @@ -585,7 +585,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration @@ -759,7 +759,7 @@ True >>> all([0,1,0]) False - >>> all([0,0,0]) + >>> all([0,0,0]) False >>> all([1,1,1]) True @@ -845,7 +845,7 @@ 4) Convert the lambda to a def statement, using that name. 5) Remove the comment. -I really like these rules, but you're free to disagree +I really like these rules, but you're free to disagree about whether this lambda-free style is better. @@ -970,7 +970,7 @@ ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream of tuples, and calls ``f()`` using these tuples as the arguments:: - itertools.starmap(os.path.join, + itertools.starmap(os.path.join, [('/usr', 'bin', 'java'), ('/bin', 'python'), ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) => @@ -1039,9 +1039,9 @@ :: - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), + city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), + ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), ... ] @@ -1056,7 +1056,7 @@ where iterator-1 => ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => + iterator-2 => ('Anchorage', 'AK'), ('Nome', 'AK') iterator-3 => ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') @@ -1150,7 +1150,7 @@ >>> double(add(5, 6)) 22 - + The ``unpack`` keyword is provided to work around the fact that Python functions are not always `fully curried `__. By default, it is expected that the ``inner`` function will return a single object @@ -1159,15 +1159,15 @@ will be expanded before being passed to ``outer``. Put simply, :: compose(f, g)(5, 6) - + is equivalent to:: f(g(5, 6)) - + while :: compose(f, g, unpack=True)(5, 6) - + is equivalent to:: f(*g(5, 6)) @@ -1178,20 +1178,20 @@ ``functional`` and ``functools``). :: from functional import compose, partial - + multi_compose = partial(reduce, compose) - - + + We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of ``"".join(...)`` that converts its arguments to string:: from functional import compose, partial - + join = compose("".join, partial(map, str)) ``flip(func)`` - + ``flip()`` wraps the callable in ``func`` and causes it to receive its non-keyword arguments in reverse order. :: @@ -1206,7 +1206,7 @@ (7, 6, 5) ``foldl(func, start, iterable)`` - + ``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable. The function is applied to the starting value and the first element of the list, then the result of that and the second element of the @@ -1220,7 +1220,7 @@ f(f(f(0, 1), 2), 3) - + ``foldl()`` is roughly equivalent to the following recursive function:: def foldl(func, start, seq): @@ -1298,7 +1298,7 @@ Text Processing". Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see +for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__, Modified: python/branches/release26-maint/Doc/howto/regex.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/regex.rst (original) +++ python/branches/release26-maint/Doc/howto/regex.rst Sat Jan 3 22:55:17 2009 @@ -1,7 +1,7 @@ .. _regex-howto: **************************** - Regular Expression HOWTO + Regular Expression HOWTO **************************** :Author: A.M. Kuchling @@ -611,7 +611,7 @@ is to read? :: charref = re.compile(r""" - &[#] # Start of a numeric entity reference + &[#] # Start of a numeric entity reference ( 0[0-7]+ # Octal form | [0-9]+ # Decimal form @@ -732,7 +732,7 @@ >>> p = re.compile('\bclass\b') >>> print p.search('no class at all') None - >>> print p.search('\b' + 'class' + '\b') + >>> print p.search('\b' + 'class' + '\b') Second, inside a character class, where there's no use for this assertion, @@ -917,7 +917,7 @@ InternalDate = re.compile(r'INTERNALDATE "' r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-' - r'(?P[0-9][0-9][0-9][0-9])' + r'(?P[0-9][0-9][0-9][0-9])' r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])' r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])' r'"') @@ -1236,9 +1236,9 @@ only report a successful match which will start at 0; if the match wouldn't start at zero, :func:`match` will *not* report it. :: - >>> print re.match('super', 'superstition').span() + >>> print re.match('super', 'superstition').span() (0, 5) - >>> print re.match('super', 'insuperable') + >>> print re.match('super', 'insuperable') None On the other hand, :func:`search` will scan forward through the string, Modified: python/branches/release26-maint/Doc/howto/sockets.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/sockets.rst (original) +++ python/branches/release26-maint/Doc/howto/sockets.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -63,7 +63,7 @@ #create an INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -78,7 +78,7 @@ #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -185,38 +185,38 @@ length message:: class mysocket: - '''demonstration class only + '''demonstration class only - coded for clarity, not efficiency ''' def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock def connect(self, host, port): - self.sock.connect((host, port)) + self.sock.connect((host, port)) def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError, \ - "socket connection broken" - totalsent = totalsent + sent + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError, \ + "socket connection broken" + totalsent = totalsent + sent def myreceive(self): - msg = '' - while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError, \ - "socket connection broken" - msg = msg + chunk - return msg + msg = '' + while len(msg) < MSGLEN: + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError, \ + "socket connection broken" + msg = msg + chunk + return msg The sending code here is usable for almost any messaging scheme - in Python you send strings, and you can use ``len()`` to determine its length (even if it has @@ -343,9 +343,9 @@ ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might Modified: python/branches/release26-maint/Doc/howto/unicode.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/unicode.rst (original) +++ python/branches/release26-maint/Doc/howto/unicode.rst Sat Jan 3 22:55:17 2009 @@ -30,8 +30,8 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHIER EST COMPLETE." - PRINT "CARACTERE NON ACCEPTE." + PRINT "FICHIER EST COMPLETE." + PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who can read French. @@ -89,11 +89,11 @@ character with value 0x12ca (4810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:: - 0061 'a'; LATIN SMALL LETTER A - 0062 'b'; LATIN SMALL LETTER B - 0063 'c'; LATIN SMALL LETTER C - ... - 007B '{'; LEFT CURLY BRACKET + 0061 'a'; LATIN SMALL LETTER A + 0062 'b'; LATIN SMALL LETTER B + 0063 'c'; LATIN SMALL LETTER C + ... + 007B '{'; LEFT CURLY BRACKET Strictly, these definitions imply that it's meaningless to say 'this is character U+12ca'. U+12ca is a code point, which represents some particular @@ -122,8 +122,8 @@ representation, the string "Python" would look like this:: P y t h o n - 0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 + 0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 This representation is straightforward but using it presents a number of problems. @@ -181,7 +181,7 @@ between 128 and 255. 3. Code points >0x7ff are turned into three- or four-byte sequences, where each byte of the sequence is between 128 and 255. - + UTF-8 has several convenient properties: 1. It can handle any Unicode code point. @@ -252,7 +252,7 @@ >>> unicode('abcdef' + chr(255)) Traceback (most recent call last): File "", line 1, in ? - UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 6: + UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 6: ordinal not in range(128) The ``errors`` argument specifies the response when the input string can't be @@ -264,7 +264,7 @@ >>> unicode('\x80abc', errors='strict') Traceback (most recent call last): File "", line 1, in ? - UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: + UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) >>> unicode('\x80abc', errors='replace') u'\ufffdabc' @@ -350,7 +350,7 @@ >>> u2 = utf8_version.decode('utf-8') # Decode using UTF-8 >>> u == u2 # The two strings match True - + The low-level routines for registering and accessing the available encodings are found in the :mod:`codecs` module. However, the encoding and decoding functions returned by this module are usually more low-level than is comfortable, so I'm @@ -362,8 +362,8 @@ The most commonly used part of the :mod:`codecs` module is the :func:`codecs.open` function which will be discussed in the section on input and output. - - + + Unicode Literals in Python Source Code -------------------------------------- @@ -381,10 +381,10 @@ >>> s = u"a\xac\u1234\u20ac\U00008000" ^^^^ two-digit hex escape - ^^^^^^ four-digit Unicode escape + ^^^^^^ four-digit Unicode escape ^^^^^^^^^^ eight-digit Unicode escape >>> for c in s: print ord(c), - ... + ... 97 172 4660 8364 32768 Using escape sequences for code points greater than 127 is fine in small doses, @@ -404,10 +404,10 @@ #!/usr/bin/env python # -*- coding: latin-1 -*- - + u = u'abcd?' print ord(u[-1]) - + The syntax is inspired by Emacs's notation for specifying variables local to a file. Emacs supports many different variables, but Python only supports 'coding'. The ``-*-`` symbols indicate to Emacs that the comment is special; @@ -427,10 +427,10 @@ When you run it with Python 2.4, it will output the following warning:: amk:~$ python p263.py - sys:1: DeprecationWarning: Non-ASCII character '\xe9' - in file p263.py on line 2, but no encoding declared; + sys:1: DeprecationWarning: Non-ASCII character '\xe9' + in file p263.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details - + Unicode Properties ------------------ @@ -446,13 +446,13 @@ prints the numeric value of one particular character:: import unicodedata - + u = unichr(233) + unichr(0x0bf2) + unichr(3972) + unichr(6000) + unichr(13231) - + for i, c in enumerate(u): print i, '%04x' % ord(c), unicodedata.category(c), print unicodedata.name(c) - + # Get numeric value of second character print unicodedata.numeric(u[1]) @@ -597,25 +597,25 @@ path will return the 8-bit versions of the filenames. For example, assuming the default filesystem encoding is UTF-8, running the following program:: - fn = u'filename\u4500abc' - f = open(fn, 'w') - f.close() - - import os - print os.listdir('.') - print os.listdir(u'.') + fn = u'filename\u4500abc' + f = open(fn, 'w') + f.close() + + import os + print os.listdir('.') + print os.listdir(u'.') will produce the following output:: - amk:~$ python t.py - ['.svn', 'filename\xe4\x94\x80abc', ...] - [u'.svn', u'filename\u4500abc', ...] + amk:~$ python t.py + ['.svn', 'filename\xe4\x94\x80abc', ...] + [u'.svn', u'filename\u4500abc', ...] The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions. - + Tips for Writing Unicode-aware Programs --------------------------------------- @@ -661,7 +661,7 @@ unicode_name = filename.decode(encoding) f = open(unicode_name, 'r') # ... return contents of file ... - + However, if an attacker could specify the ``'base64'`` encoding, they could pass ``'L2V0Yy9wYXNzd2Q='``, which is the base-64 encoded form of the string ``'/etc/passwd'``, to read a system file. The above code looks for ``'/'`` @@ -697,32 +697,32 @@ .. comment Describe obscure -U switch somewhere? .. comment Describe use of codecs.StreamRecoder and StreamReaderWriter -.. comment +.. comment Original outline: - [ ] Unicode introduction - [ ] ASCII - [ ] Terms - - [ ] Character - - [ ] Code point - - [ ] Encodings - - [ ] Common encodings: ASCII, Latin-1, UTF-8 + - [ ] Character + - [ ] Code point + - [ ] Encodings + - [ ] Common encodings: ASCII, Latin-1, UTF-8 - [ ] Unicode Python type - - [ ] Writing unicode literals - - [ ] Obscurity: -U switch - - [ ] Built-ins - - [ ] unichr() - - [ ] ord() - - [ ] unicode() constructor - - [ ] Unicode type - - [ ] encode(), decode() methods + - [ ] Writing unicode literals + - [ ] Obscurity: -U switch + - [ ] Built-ins + - [ ] unichr() + - [ ] ord() + - [ ] unicode() constructor + - [ ] Unicode type + - [ ] encode(), decode() methods - [ ] Unicodedata module for character properties - [ ] I/O - - [ ] Reading/writing Unicode data into files - - [ ] Byte-order marks - - [ ] Unicode filenames + - [ ] Reading/writing Unicode data into files + - [ ] Byte-order marks + - [ ] Unicode filenames - [ ] Writing Unicode programs - - [ ] Do everything in Unicode - - [ ] Declaring source code encodings (PEP 263) + - [ ] Do everything in Unicode + - [ ] Declaring source code encodings (PEP 263) - [ ] Other issues - - [ ] Building Python (UCS2, UCS4) + - [ ] Building Python (UCS2, UCS4) Modified: python/branches/release26-maint/Doc/howto/urllib2.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/urllib2.rst (original) +++ python/branches/release26-maint/Doc/howto/urllib2.rst Sat Jan 3 22:55:17 2009 @@ -10,7 +10,7 @@ HOWTO, available at `urllib2 - Le Manuel manquant `_. - + Introduction ============ @@ -19,9 +19,9 @@ You may also find useful the following article on fetching web resources with Python : - + * `Basic Authentication `_ - + A tutorial on *Basic Authentication*, with examples in Python. **urllib2** is a `Python `_ module for fetching URLs @@ -98,7 +98,7 @@ *not* from ``urllib2``. :: import urllib - import urllib2 + import urllib2 url = 'http://www.someserver.com/cgi-bin/register.cgi' values = {'name' : 'Michael Foord', @@ -161,15 +161,15 @@ Explorer [#]_. :: import urllib - import urllib2 - + import urllib2 + url = 'http://www.someserver.com/cgi-bin/register.cgi' - user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' + user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - + data = urllib.urlencode(values) req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) @@ -183,7 +183,7 @@ =================== *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as +with Python APIs, builtin exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised). @@ -309,18 +309,18 @@ geturl, and info, methods. :: >>> req = urllib2.Request('http://www.python.org/fish.html') - >>> try: + >>> try: >>> urllib2.urlopen(req) >>> except URLError, e: >>> print e.code >>> print e.read() - >>> + >>> 404 - - - Error 404: File Not Found + Error 404: File Not Found ...... etc... Wrapping it Up @@ -372,7 +372,7 @@ print 'Error code: ', e.code else: # everything is fine - + info and geturl =============== @@ -443,7 +443,7 @@ and a 'realm'. The header looks like : ``Www-authenticate: SCHEME realm="REALM"``. -e.g. :: +e.g. :: Www-authenticate: Basic realm="cPanel Users" @@ -467,24 +467,24 @@ than the URL you pass to .add_password() will also match. :: # create a password manager - password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() + password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. - # If we knew the realm, we could use it instead of ``None``. + # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) - handler = urllib2.HTTPBasicAuthHandler(password_mgr) + handler = urllib2.HTTPBasicAuthHandler(password_mgr) # create "opener" (OpenerDirector instance) - opener = urllib2.build_opener(handler) + opener = urllib2.build_opener(handler) # use the opener to fetch a URL - opener.open(a_url) + opener.open(a_url) # Install the opener. # Now all calls to urllib2.urlopen use our opener. - urllib2.install_opener(opener) + urllib2.install_opener(opener) .. note:: @@ -540,7 +540,7 @@ # timeout in seconds timeout = 10 - socket.setdefaulttimeout(timeout) + socket.setdefaulttimeout(timeout) # this call to urllib2.urlopen now uses the default timeout # we have set in the socket module @@ -557,7 +557,7 @@ This document was reviewed and revised by John Lee. .. [#] For an introduction to the CGI protocol see - `Writing Web Applications in Python `_. + `Writing Web Applications in Python `_. .. [#] Like Google for example. The *proper* way to use google from a program is to use `PyGoogle `_ of course. See `Voidspace Google `_ @@ -574,6 +574,6 @@ is set to use the proxy, which urllib2 picks up on. In order to test scripts with a localhost server, I have to prevent urllib2 from using the proxy. -.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe +.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_. - + 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 Sat Jan 3 22:55:17 2009 @@ -88,7 +88,7 @@ `_ with some additional information about CGI in Python. - + Simple script for testing CGI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -386,7 +386,7 @@ You might be interested in some WSGI-supporting modules already contained in the standard library, namely: - + * :mod:`wsgiref` -- some tiny utilities and servers for WSGI @@ -499,7 +499,7 @@ time in looking through the most popular ones. Some frameworks have their own template engine or have a recommentation for one. It's wise to use these. - + Popular template engines include: * Mako @@ -687,7 +687,7 @@ found in the Python wiki. .. seealso:: - + The Python wiki contains an extensive list of `web frameworks `_. Modified: python/branches/release26-maint/Doc/includes/mp_distributing.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_distributing.py (original) +++ python/branches/release26-maint/Doc/includes/mp_distributing.py Sat Jan 3 22:55:17 2009 @@ -1,364 +1,364 @@ -# -# Module to allow spawning of processes on foreign host -# -# Depends on `multiprocessing` package -- tested with `processing-0.60` -# -# Copyright (c) 2006-2008, R Oudkerk -# All rights reserved. -# - -__all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] - -# -# Imports -# - -import sys -import os -import tarfile -import shutil -import subprocess -import logging -import itertools -import Queue - -try: - import cPickle as pickle -except ImportError: - import pickle - -from multiprocessing import Process, current_process, cpu_count -from multiprocessing import util, managers, connection, forking, pool - -# -# Logging -# - -def get_logger(): - return _logger - -_logger = logging.getLogger('distributing') -_logger.propogate = 0 - -_formatter = logging.Formatter(util.DEFAULT_LOGGING_FORMAT) -_handler = logging.StreamHandler() -_handler.setFormatter(_formatter) -_logger.addHandler(_handler) - -info = _logger.info -debug = _logger.debug - -# -# Get number of cpus -# - -try: - slot_count = cpu_count() -except NotImplemented: - slot_count = 1 - -# -# Manager type which spawns subprocesses -# - -class HostManager(managers.SyncManager): - ''' - Manager type used for spawning processes on a (presumably) foreign host - ''' - def __init__(self, address, authkey): - managers.SyncManager.__init__(self, address, authkey) - self._name = 'Host-unknown' - - def Process(self, group=None, target=None, name=None, args=(), kwargs={}): - if hasattr(sys.modules['__main__'], '__file__'): - main_path = os.path.basename(sys.modules['__main__'].__file__) - else: - main_path = None - data = pickle.dumps((target, args, kwargs)) - p = self._RemoteProcess(data, main_path) - if name is None: - temp = self._name.split('Host-')[-1] + '/Process-%s' - name = temp % ':'.join(map(str, p.get_identity())) - p.set_name(name) - return p - - @classmethod - def from_address(cls, address, authkey): - manager = cls(address, authkey) - managers.transact(address, authkey, 'dummy') - manager._state.value = managers.State.STARTED - manager._name = 'Host-%s:%s' % manager.address - manager.shutdown = util.Finalize( - manager, HostManager._finalize_host, - args=(manager._address, manager._authkey, manager._name), - exitpriority=-10 - ) - return manager - - @staticmethod - def _finalize_host(address, authkey, name): - managers.transact(address, authkey, 'shutdown') - - def __repr__(self): - return '' % self._name - -# -# Process subclass representing a process on (possibly) a remote machine -# - -class RemoteProcess(Process): - ''' - Represents a process started on a remote host - ''' - def __init__(self, data, main_path): - assert not main_path or os.path.basename(main_path) == main_path - Process.__init__(self) - self._data = data - self._main_path = main_path - - def _bootstrap(self): - forking.prepare({'main_path': self._main_path}) - self._target, self._args, self._kwargs = pickle.loads(self._data) - return Process._bootstrap(self) - - def get_identity(self): - return self._identity - -HostManager.register('_RemoteProcess', RemoteProcess) - -# -# A Pool class that uses a cluster -# - -class DistributedPool(pool.Pool): - - def __init__(self, cluster, processes=None, initializer=None, initargs=()): - self._cluster = cluster - self.Process = cluster.Process - pool.Pool.__init__(self, processes or len(cluster), - initializer, initargs) - - def _setup_queues(self): - self._inqueue = self._cluster._SettableQueue() - self._outqueue = self._cluster._SettableQueue() - self._quick_put = self._inqueue.put - self._quick_get = self._outqueue.get - - @staticmethod - def _help_stuff_finish(inqueue, task_handler, size): - inqueue.set_contents([None] * size) - -# -# Manager type which starts host managers on other machines -# - -def LocalProcess(**kwds): - p = Process(**kwds) - p.set_name('localhost/' + p.name) - return p - -class Cluster(managers.SyncManager): - ''' - Represents collection of slots running on various hosts. - - `Cluster` is a subclass of `SyncManager` so it allows creation of - various types of shared objects. - ''' - def __init__(self, hostlist, modules): - managers.SyncManager.__init__(self, address=('localhost', 0)) - self._hostlist = hostlist - self._modules = modules - if __name__ not in modules: - modules.append(__name__) - files = [sys.modules[name].__file__ for name in modules] - for i, file in enumerate(files): - if file.endswith('.pyc') or file.endswith('.pyo'): - files[i] = file[:-4] + '.py' - self._files = [os.path.abspath(file) for file in files] - - def start(self): - managers.SyncManager.start(self) - - l = connection.Listener(family='AF_INET', authkey=self._authkey) - - for i, host in enumerate(self._hostlist): - host._start_manager(i, self._authkey, l.address, self._files) - - for host in self._hostlist: - if host.hostname != 'localhost': - conn = l.accept() - i, address, cpus = conn.recv() - conn.close() - other_host = self._hostlist[i] - other_host.manager = HostManager.from_address(address, - self._authkey) - other_host.slots = other_host.slots or cpus - other_host.Process = other_host.manager.Process - else: - host.slots = host.slots or slot_count - host.Process = LocalProcess - - self._slotlist = [ - Slot(host) for host in self._hostlist for i in range(host.slots) - ] - self._slot_iterator = itertools.cycle(self._slotlist) - self._base_shutdown = self.shutdown - del self.shutdown - - def shutdown(self): - for host in self._hostlist: - if host.hostname != 'localhost': - host.manager.shutdown() - self._base_shutdown() - - def Process(self, group=None, target=None, name=None, args=(), kwargs={}): - slot = self._slot_iterator.next() - return slot.Process( - group=group, target=target, name=name, args=args, kwargs=kwargs - ) - - def Pool(self, processes=None, initializer=None, initargs=()): - return DistributedPool(self, processes, initializer, initargs) - - def __getitem__(self, i): - return self._slotlist[i] - - def __len__(self): - return len(self._slotlist) - - def __iter__(self): - return iter(self._slotlist) - -# -# Queue subclass used by distributed pool -# - -class SettableQueue(Queue.Queue): - def empty(self): - return not self.queue - def full(self): - return self.maxsize > 0 and len(self.queue) == self.maxsize - def set_contents(self, contents): - # length of contents must be at least as large as the number of - # threads which have potentially called get() - self.not_empty.acquire() - try: - self.queue.clear() - self.queue.extend(contents) - self.not_empty.notifyAll() - finally: - self.not_empty.release() - -Cluster.register('_SettableQueue', SettableQueue) - -# -# Class representing a notional cpu in the cluster -# - -class Slot(object): - def __init__(self, host): - self.host = host - self.Process = host.Process - -# -# Host -# - -class Host(object): - ''' - Represents a host to use as a node in a cluster. - - `hostname` gives the name of the host. If hostname is not - "localhost" then ssh is used to log in to the host. To log in as - a different user use a host name of the form - "username at somewhere.org" - - `slots` is used to specify the number of slots for processes on - the host. This affects how often processes will be allocated to - this host. Normally this should be equal to the number of cpus on - that host. - ''' - def __init__(self, hostname, slots=None): - self.hostname = hostname - self.slots = slots - - def _start_manager(self, index, authkey, address, files): - if self.hostname != 'localhost': - tempdir = copy_to_remote_temporary_directory(self.hostname, files) - debug('startup files copied to %s:%s', self.hostname, tempdir) - p = subprocess.Popen( - ['ssh', self.hostname, 'python', '-c', - '"import os; os.chdir(%r); ' - 'from distributing import main; main()"' % tempdir], - stdin=subprocess.PIPE - ) - data = dict( - name='BoostrappingHost', index=index, - dist_log_level=_logger.getEffectiveLevel(), - dir=tempdir, authkey=str(authkey), parent_address=address - ) - pickle.dump(data, p.stdin, pickle.HIGHEST_PROTOCOL) - p.stdin.close() - -# -# Copy files to remote directory, returning name of directory -# - -unzip_code = '''" -import tempfile, os, sys, tarfile -tempdir = tempfile.mkdtemp(prefix='distrib-') -os.chdir(tempdir) -tf = tarfile.open(fileobj=sys.stdin, mode='r|gz') -for ti in tf: - tf.extract(ti) -print tempdir -"''' - -def copy_to_remote_temporary_directory(host, files): - p = subprocess.Popen( - ['ssh', host, 'python', '-c', unzip_code], - stdout=subprocess.PIPE, stdin=subprocess.PIPE - ) - tf = tarfile.open(fileobj=p.stdin, mode='w|gz') - for name in files: - tf.add(name, os.path.basename(name)) - tf.close() - p.stdin.close() - return p.stdout.read().rstrip() - -# -# Code which runs a host manager -# - -def main(): - # get data from parent over stdin - data = pickle.load(sys.stdin) - sys.stdin.close() - - # set some stuff - _logger.setLevel(data['dist_log_level']) - forking.prepare(data) - - # create server for a `HostManager` object - server = managers.Server(HostManager._registry, ('', 0), data['authkey']) - current_process()._server = server - - # report server address and number of cpus back to parent - conn = connection.Client(data['parent_address'], authkey=data['authkey']) - conn.send((data['index'], server.address, slot_count)) - conn.close() - - # set name etc - current_process().set_name('Host-%s:%s' % server.address) - util._run_after_forkers() - - # register a cleanup function - def cleanup(directory): - debug('removing directory %s', directory) - shutil.rmtree(directory) - debug('shutting down host manager') - util.Finalize(None, cleanup, args=[data['dir']], exitpriority=0) - - # start host manager - debug('remote host manager starting in %s', data['dir']) - server.serve_forever() +# +# Module to allow spawning of processes on foreign host +# +# Depends on `multiprocessing` package -- tested with `processing-0.60` +# +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# + +__all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] + +# +# Imports +# + +import sys +import os +import tarfile +import shutil +import subprocess +import logging +import itertools +import Queue + +try: + import cPickle as pickle +except ImportError: + import pickle + +from multiprocessing import Process, current_process, cpu_count +from multiprocessing import util, managers, connection, forking, pool + +# +# Logging +# + +def get_logger(): + return _logger + +_logger = logging.getLogger('distributing') +_logger.propogate = 0 + +_formatter = logging.Formatter(util.DEFAULT_LOGGING_FORMAT) +_handler = logging.StreamHandler() +_handler.setFormatter(_formatter) +_logger.addHandler(_handler) + +info = _logger.info +debug = _logger.debug + +# +# Get number of cpus +# + +try: + slot_count = cpu_count() +except NotImplemented: + slot_count = 1 + +# +# Manager type which spawns subprocesses +# + +class HostManager(managers.SyncManager): + ''' + Manager type used for spawning processes on a (presumably) foreign host + ''' + def __init__(self, address, authkey): + managers.SyncManager.__init__(self, address, authkey) + self._name = 'Host-unknown' + + def Process(self, group=None, target=None, name=None, args=(), kwargs={}): + if hasattr(sys.modules['__main__'], '__file__'): + main_path = os.path.basename(sys.modules['__main__'].__file__) + else: + main_path = None + data = pickle.dumps((target, args, kwargs)) + p = self._RemoteProcess(data, main_path) + if name is None: + temp = self._name.split('Host-')[-1] + '/Process-%s' + name = temp % ':'.join(map(str, p.get_identity())) + p.set_name(name) + return p + + @classmethod + def from_address(cls, address, authkey): + manager = cls(address, authkey) + managers.transact(address, authkey, 'dummy') + manager._state.value = managers.State.STARTED + manager._name = 'Host-%s:%s' % manager.address + manager.shutdown = util.Finalize( + manager, HostManager._finalize_host, + args=(manager._address, manager._authkey, manager._name), + exitpriority=-10 + ) + return manager + + @staticmethod + def _finalize_host(address, authkey, name): + managers.transact(address, authkey, 'shutdown') + + def __repr__(self): + return '' % self._name + +# +# Process subclass representing a process on (possibly) a remote machine +# + +class RemoteProcess(Process): + ''' + Represents a process started on a remote host + ''' + def __init__(self, data, main_path): + assert not main_path or os.path.basename(main_path) == main_path + Process.__init__(self) + self._data = data + self._main_path = main_path + + def _bootstrap(self): + forking.prepare({'main_path': self._main_path}) + self._target, self._args, self._kwargs = pickle.loads(self._data) + return Process._bootstrap(self) + + def get_identity(self): + return self._identity + +HostManager.register('_RemoteProcess', RemoteProcess) + +# +# A Pool class that uses a cluster +# + +class DistributedPool(pool.Pool): + + def __init__(self, cluster, processes=None, initializer=None, initargs=()): + self._cluster = cluster + self.Process = cluster.Process + pool.Pool.__init__(self, processes or len(cluster), + initializer, initargs) + + def _setup_queues(self): + self._inqueue = self._cluster._SettableQueue() + self._outqueue = self._cluster._SettableQueue() + self._quick_put = self._inqueue.put + self._quick_get = self._outqueue.get + + @staticmethod + def _help_stuff_finish(inqueue, task_handler, size): + inqueue.set_contents([None] * size) + +# +# Manager type which starts host managers on other machines +# + +def LocalProcess(**kwds): + p = Process(**kwds) + p.set_name('localhost/' + p.name) + return p + +class Cluster(managers.SyncManager): + ''' + Represents collection of slots running on various hosts. + + `Cluster` is a subclass of `SyncManager` so it allows creation of + various types of shared objects. + ''' + def __init__(self, hostlist, modules): + managers.SyncManager.__init__(self, address=('localhost', 0)) + self._hostlist = hostlist + self._modules = modules + if __name__ not in modules: + modules.append(__name__) + files = [sys.modules[name].__file__ for name in modules] + for i, file in enumerate(files): + if file.endswith('.pyc') or file.endswith('.pyo'): + files[i] = file[:-4] + '.py' + self._files = [os.path.abspath(file) for file in files] + + def start(self): + managers.SyncManager.start(self) + + l = connection.Listener(family='AF_INET', authkey=self._authkey) + + for i, host in enumerate(self._hostlist): + host._start_manager(i, self._authkey, l.address, self._files) + + for host in self._hostlist: + if host.hostname != 'localhost': + conn = l.accept() + i, address, cpus = conn.recv() + conn.close() + other_host = self._hostlist[i] + other_host.manager = HostManager.from_address(address, + self._authkey) + other_host.slots = other_host.slots or cpus + other_host.Process = other_host.manager.Process + else: + host.slots = host.slots or slot_count + host.Process = LocalProcess + + self._slotlist = [ + Slot(host) for host in self._hostlist for i in range(host.slots) + ] + self._slot_iterator = itertools.cycle(self._slotlist) + self._base_shutdown = self.shutdown + del self.shutdown + + def shutdown(self): + for host in self._hostlist: + if host.hostname != 'localhost': + host.manager.shutdown() + self._base_shutdown() + + def Process(self, group=None, target=None, name=None, args=(), kwargs={}): + slot = self._slot_iterator.next() + return slot.Process( + group=group, target=target, name=name, args=args, kwargs=kwargs + ) + + def Pool(self, processes=None, initializer=None, initargs=()): + return DistributedPool(self, processes, initializer, initargs) + + def __getitem__(self, i): + return self._slotlist[i] + + def __len__(self): + return len(self._slotlist) + + def __iter__(self): + return iter(self._slotlist) + +# +# Queue subclass used by distributed pool +# + +class SettableQueue(Queue.Queue): + def empty(self): + return not self.queue + def full(self): + return self.maxsize > 0 and len(self.queue) == self.maxsize + def set_contents(self, contents): + # length of contents must be at least as large as the number of + # threads which have potentially called get() + self.not_empty.acquire() + try: + self.queue.clear() + self.queue.extend(contents) + self.not_empty.notifyAll() + finally: + self.not_empty.release() + +Cluster.register('_SettableQueue', SettableQueue) + +# +# Class representing a notional cpu in the cluster +# + +class Slot(object): + def __init__(self, host): + self.host = host + self.Process = host.Process + +# +# Host +# + +class Host(object): + ''' + Represents a host to use as a node in a cluster. + + `hostname` gives the name of the host. If hostname is not + "localhost" then ssh is used to log in to the host. To log in as + a different user use a host name of the form + "username at somewhere.org" + + `slots` is used to specify the number of slots for processes on + the host. This affects how often processes will be allocated to + this host. Normally this should be equal to the number of cpus on + that host. + ''' + def __init__(self, hostname, slots=None): + self.hostname = hostname + self.slots = slots + + def _start_manager(self, index, authkey, address, files): + if self.hostname != 'localhost': + tempdir = copy_to_remote_temporary_directory(self.hostname, files) + debug('startup files copied to %s:%s', self.hostname, tempdir) + p = subprocess.Popen( + ['ssh', self.hostname, 'python', '-c', + '"import os; os.chdir(%r); ' + 'from distributing import main; main()"' % tempdir], + stdin=subprocess.PIPE + ) + data = dict( + name='BoostrappingHost', index=index, + dist_log_level=_logger.getEffectiveLevel(), + dir=tempdir, authkey=str(authkey), parent_address=address + ) + pickle.dump(data, p.stdin, pickle.HIGHEST_PROTOCOL) + p.stdin.close() + +# +# Copy files to remote directory, returning name of directory +# + +unzip_code = '''" +import tempfile, os, sys, tarfile +tempdir = tempfile.mkdtemp(prefix='distrib-') +os.chdir(tempdir) +tf = tarfile.open(fileobj=sys.stdin, mode='r|gz') +for ti in tf: + tf.extract(ti) +print tempdir +"''' + +def copy_to_remote_temporary_directory(host, files): + p = subprocess.Popen( + ['ssh', host, 'python', '-c', unzip_code], + stdout=subprocess.PIPE, stdin=subprocess.PIPE + ) + tf = tarfile.open(fileobj=p.stdin, mode='w|gz') + for name in files: + tf.add(name, os.path.basename(name)) + tf.close() + p.stdin.close() + return p.stdout.read().rstrip() + +# +# Code which runs a host manager +# + +def main(): + # get data from parent over stdin + data = pickle.load(sys.stdin) + sys.stdin.close() + + # set some stuff + _logger.setLevel(data['dist_log_level']) + forking.prepare(data) + + # create server for a `HostManager` object + server = managers.Server(HostManager._registry, ('', 0), data['authkey']) + current_process()._server = server + + # report server address and number of cpus back to parent + conn = connection.Client(data['parent_address'], authkey=data['authkey']) + conn.send((data['index'], server.address, slot_count)) + conn.close() + + # set name etc + current_process().set_name('Host-%s:%s' % server.address) + util._run_after_forkers() + + # register a cleanup function + def cleanup(directory): + debug('removing directory %s', directory) + shutil.rmtree(directory) + debug('shutting down host manager') + util.Finalize(None, cleanup, args=[data['dir']], exitpriority=0) + + # start host manager + debug('remote host manager starting in %s', data['dir']) + server.serve_forever() Modified: python/branches/release26-maint/Doc/install/index.rst ============================================================================== --- python/branches/release26-maint/Doc/install/index.rst (original) +++ python/branches/release26-maint/Doc/install/index.rst Sat Jan 3 22:55:17 2009 @@ -3,7 +3,7 @@ .. _install-index: ***************************** - Installing Python Modules + Installing Python Modules ***************************** :Author: Greg Ward @@ -18,7 +18,7 @@ Thus, I have to be sure to explain the basics at some point: sys.path and PYTHONPATH at least. Should probably give pointers to other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc. - + Finally, it might be useful to include all the material from my "Care and Feeding of a Python Installation" talk in here somewhere. Yow! @@ -268,7 +268,7 @@ statements shown below, and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`:: - Python 2.4 (#26, Aug 7 2004, 17:19:02) + Python 2.4 (#26, Aug 7 2004, 17:19:02) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix @@ -587,11 +587,11 @@ $ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 - Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. + Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path - ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', - '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', + ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', + '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>> Modified: python/branches/release26-maint/Doc/library/abc.rst ============================================================================== --- python/branches/release26-maint/Doc/library/abc.rst (original) +++ python/branches/release26-maint/Doc/library/abc.rst Sat Jan 3 22:55:17 2009 @@ -43,15 +43,15 @@ Register *subclass* as a "virtual subclass" of this ABC. For example:: - from abc import ABCMeta + from abc import ABCMeta - class MyABC: - __metaclass__ = ABCMeta + class MyABC: + __metaclass__ = ABCMeta - MyABC.register(tuple) + MyABC.register(tuple) - assert issubclass(tuple, MyABC) - assert isinstance((), MyABC) + assert issubclass(tuple, MyABC) + assert isinstance((), MyABC) You can also override this method in an abstract base class: @@ -130,7 +130,7 @@ A decorator indicating abstract methods. Using this decorator requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. @@ -166,7 +166,7 @@ A subclass of the built-in :func:`property`, indicating an abstract property. Using this function requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract properties can be called using any of the normal Modified: python/branches/release26-maint/Doc/library/aifc.rst ============================================================================== --- python/branches/release26-maint/Doc/library/aifc.rst (original) +++ python/branches/release26-maint/Doc/library/aifc.rst Sat Jan 3 22:55:17 2009 @@ -17,7 +17,7 @@ ability to compress the audio data. .. warning:: - + Some operations may only work under IRIX; these will raise :exc:`ImportError` when attempting to import the :mod:`cl` module, which is only available on IRIX. Modified: python/branches/release26-maint/Doc/library/al.rst ============================================================================== --- python/branches/release26-maint/Doc/library/al.rst (original) +++ python/branches/release26-maint/Doc/library/al.rst Sat Jan 3 22:55:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Audio functions on the SGI. :deprecated: - + .. deprecated:: 2.6 The :mod:`al` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/ast.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ast.rst (original) +++ python/branches/release26-maint/Doc/library/ast.rst Sat Jan 3 22:55:17 2009 @@ -127,7 +127,7 @@ Parse an expression into an AST node. Equivalent to ``compile(expr, filename, mode, ast.PyCF_ONLY_AST)``. - + .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python @@ -191,7 +191,7 @@ A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -205,7 +205,7 @@ .. method:: generic_visit(node) This visitor calls :meth:`visit` on all children of the node. - + Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself. @@ -220,11 +220,11 @@ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: Modified: python/branches/release26-maint/Doc/library/audioop.rst ============================================================================== --- python/branches/release26-maint/Doc/library/audioop.rst (original) +++ python/branches/release26-maint/Doc/library/audioop.rst Sat Jan 3 22:55:17 2009 @@ -265,7 +265,7 @@ in_test = inputdata[pos*2:] ipos, factor = audioop.findfit(in_test, out_test) # Optional (for better cancellation): - # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], + # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) Modified: python/branches/release26-maint/Doc/library/bastion.rst ============================================================================== --- python/branches/release26-maint/Doc/library/bastion.rst (original) +++ python/branches/release26-maint/Doc/library/bastion.rst Sat Jan 3 22:55:17 2009 @@ -5,10 +5,10 @@ .. module:: Bastion :synopsis: Providing restricted access to objects. :deprecated: - + .. deprecated:: 2.6 The :mod:`Bastion` module has been removed in Python 3.0. - + .. moduleauthor:: Barry Warsaw Modified: python/branches/release26-maint/Doc/library/bdb.rst ============================================================================== --- python/branches/release26-maint/Doc/library/bdb.rst (original) +++ python/branches/release26-maint/Doc/library/bdb.rst Sat Jan 3 22:55:17 2009 @@ -325,7 +325,7 @@ Check whether we should break here, depending on the way the breakpoint *b* was set. - + If it was set via line number, it checks if ``b.line`` is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if @@ -335,7 +335,7 @@ Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. - + Called only if we know there is a breakpoint at this location. Returns the breakpoint that was triggered and a flag that indicates if it is ok to delete a temporary breakpoint. Modified: python/branches/release26-maint/Doc/library/bsddb.rst ============================================================================== --- python/branches/release26-maint/Doc/library/bsddb.rst (original) +++ python/branches/release26-maint/Doc/library/bsddb.rst Sat Jan 3 22:55:17 2009 @@ -172,7 +172,7 @@ >>> import bsddb >>> db = bsddb.btopen('/tmp/spam.db', 'c') >>> for i in range(10): db['%d'%i] = '%d'% (i*i) - ... + ... >>> db['3'] '9' >>> db.keys() @@ -185,7 +185,7 @@ ('9', '81') >>> db.set_location('2') ('2', '4') - >>> db.previous() + >>> db.previous() ('1', '1') >>> for k, v in db.iteritems(): ... print k, v Modified: python/branches/release26-maint/Doc/library/bz2.rst ============================================================================== --- python/branches/release26-maint/Doc/library/bz2.rst (original) +++ python/branches/release26-maint/Doc/library/bz2.rst Sat Jan 3 22:55:17 2009 @@ -93,7 +93,7 @@ performance optimizations previously implemented in the :mod:`xreadlines` module. - .. deprecated:: 2.3 + .. deprecated:: 2.3 This exists only for compatibility with the method by this name on :class:`file` objects, which is deprecated. Use ``for line in file`` instead. Modified: python/branches/release26-maint/Doc/library/cd.rst ============================================================================== --- python/branches/release26-maint/Doc/library/cd.rst (original) +++ python/branches/release26-maint/Doc/library/cd.rst Sat Jan 3 22:55:17 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: Interface to the CD-ROM on Silicon Graphics systems. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`cd` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/cmath.rst ============================================================================== --- python/branches/release26-maint/Doc/library/cmath.rst (original) +++ python/branches/release26-maint/Doc/library/cmath.rst Sat Jan 3 22:55:17 2009 @@ -70,9 +70,9 @@ .. function:: polar(x) - Convert a :class:`complex` from rectangular coordinates to polar + Convert a :class:`complex` from rectangular coordinates to polar coordinates. The function returns a tuple with the two elements - *r* and *phi*. *r* is the distance from 0 and *phi* the phase + *r* and *phi*. *r* is the distance from 0 and *phi* the phase angle. .. versionadded:: 2.6 Modified: python/branches/release26-maint/Doc/library/codeop.rst ============================================================================== --- python/branches/release26-maint/Doc/library/codeop.rst (original) +++ python/branches/release26-maint/Doc/library/codeop.rst Sat Jan 3 22:55:17 2009 @@ -43,7 +43,7 @@ other value will cause :exc:`ValueError` to be raised. .. warning:: - + It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, 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 Sat Jan 3 22:55:17 2009 @@ -53,36 +53,36 @@ :class:`Hashable` ``__hash__`` :class:`Iterable` ``__iter__`` :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` -:class:`Sized` ``__len__`` +:class:`Sized` ``__len__`` :class:`Callable` ``__call__`` - + :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. :class:`Iterable`, and ``__len__`` ``index``, and ``count`` - :class:`Container` - + :class:`Container` + :class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` - + :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:`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 + ``__iter__``, and ``__len__`` - + :class:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, :class:`Set` ``__iter__`` @@ -96,7 +96,7 @@ size = None if isinstance(myvar, collections.Sized): - size = len(myvar) + size = len(myvar) Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting @@ -549,8 +549,8 @@ if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result - - def __getnewargs__(self): + + def __getnewargs__(self): return tuple(self) x = property(itemgetter(0)) Modified: python/branches/release26-maint/Doc/library/compiler.rst ============================================================================== --- python/branches/release26-maint/Doc/library/compiler.rst (original) +++ python/branches/release26-maint/Doc/library/compiler.rst Sat Jan 3 22:55:17 2009 @@ -559,24 +559,24 @@ >>> import compiler >>> mod = compiler.parseFile("/tmp/doublelib.py") >>> mod - Module('This is an example module.\n\nThis is the docstring.\n', + Module('This is an example module.\n\nThis is the docstring.\n', Stmt([Function(None, 'double', ['x'], [], 0, - 'Return twice the argument', + 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))]))])) >>> from compiler.ast import * - >>> Module('This is an example module.\n\nThis is the docstring.\n', + >>> Module('This is an example module.\n\nThis is the docstring.\n', ... Stmt([Function(None, 'double', ['x'], [], 0, - ... 'Return twice the argument', + ... 'Return twice the argument', ... Stmt([Return(Mul((Name('x'), Const(2))))]))])) - Module('This is an example module.\n\nThis is the docstring.\n', + Module('This is an example module.\n\nThis is the docstring.\n', Stmt([Function(None, 'double', ['x'], [], 0, - 'Return twice the argument', + 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))]))])) >>> mod.doc 'This is an example module.\n\nThis is the docstring.\n' >>> for node in mod.node.nodes: ... print node - ... + ... Function(None, 'double', ['x'], [], 0, 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))])) >>> func = mod.node.nodes[0] Modified: python/branches/release26-maint/Doc/library/configparser.rst ============================================================================== --- python/branches/release26-maint/Doc/library/configparser.rst (original) +++ python/branches/release26-maint/Doc/library/configparser.rst Sat Jan 3 22:55:17 2009 @@ -11,9 +11,9 @@ .. note:: - The :mod:`ConfigParser` module has been renamed to `configparser` in Python - 3.0. The :term:`2to3` tool will automatically adapt imports when converting - your sources to 3.0. + The :mod:`ConfigParser` module has been renamed to :mod:`configparser` in + Python 3.0. The :term:`2to3` tool will automatically adapt imports when + converting your sources to 3.0. .. index:: pair: .ini; file 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 Sat Jan 3 22:55:17 2009 @@ -733,7 +733,7 @@ The :class:`Cookie` class also defines the following method: -.. method:: Cookie.is_expired([now=:const:`None`]) +.. method:: Cookie.is_expired([now=None]) True if cookie has passed the time at which the server requested it should expire. If *now* is given (in seconds since the epoch), return whether the Modified: python/branches/release26-maint/Doc/library/crypt.rst ============================================================================== --- python/branches/release26-maint/Doc/library/crypt.rst (original) +++ python/branches/release26-maint/Doc/library/crypt.rst Sat Jan 3 22:55:17 2009 @@ -51,7 +51,7 @@ username = raw_input('Python login:') cryptedpasswd = pwd.getpwnam(username)[1] if cryptedpasswd: - if cryptedpasswd == 'x' or cryptedpasswd == '*': + if cryptedpasswd == 'x' or cryptedpasswd == '*': raise "Sorry, currently no support for shadow passwords" cleartext = getpass.getpass() return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd Modified: python/branches/release26-maint/Doc/library/csv.rst ============================================================================== --- python/branches/release26-maint/Doc/library/csv.rst (original) +++ python/branches/release26-maint/Doc/library/csv.rst Sat Jan 3 22:55:17 2009 @@ -76,7 +76,7 @@ performed. A short usage example:: - + >>> import csv >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|') >>> for row in spamReader: 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 Sat Jan 3 22:55:17 2009 @@ -1378,24 +1378,22 @@ The *mode* parameter can be used to specify how the library is loaded. For details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored. -The *use_errno* parameter, when set to True, enables a ctypes -mechanism that allows to access the system `errno` error number in a -safe way. `ctypes` maintains a thread-local copy of the systems -`errno` variable; if you call foreign functions created with -`use_errno=True` then the `errno` value before the function call is -swapped with the ctypes private copy, the same happens immediately -after the function call. - -The function `ctypes.get_errno()` returns the value of the ctypes -private copy, and the function `ctypes.set_errno(value)` changes the -ctypes private copy to `value` and returns the former value. - -The *use_last_error* parameter, when set to True, enables the same -mechanism for the Windows error code which is managed by the -:func:`GetLastError` and :func:`SetLastError` Windows API functions; -`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used -to request and change the ctypes private copy of the windows error -code. +The *use_errno* parameter, when set to True, enables a ctypes mechanism that +allows to access the system :data:`errno` error number in a safe way. +:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` +variable; if you call foreign functions created with ``use_errno=True`` then the +:data:`errno` value before the function call is swapped with the ctypes private +copy, the same happens immediately after the function call. + +The function :func:`ctypes.get_errno` returns the value of the ctypes private +copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy +to a new value and returns the former value. + +The *use_last_error* parameter, when set to True, enables the same mechanism for +the Windows error code which is managed by the :func:`GetLastError` and +:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and +:func:`ctypes.set_last_error` are used to request and change the ctypes private +copy of the windows error code. .. versionadded:: 2.6 The ``use_last_error`` and ``use_errno`` optional parameters @@ -1602,22 +1600,23 @@ .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) The returned function prototype creates functions that use the standard C - calling convention. The function will release the GIL during the call. - If `use_errno` is set to True, the ctypes private copy of the system `errno` - variable is exchanged with the real `errno` value bafore and after the call; - `use_last_error` does the same for the Windows error code. + calling convention. The function will release the GIL during the call. If + *use_errno* is set to True, the ctypes private copy of the system + :data:`errno` variable is exchanged with the real :data:`errno` value bafore + and after the call; *use_last_error* does the same for the Windows error + code. .. versionchanged:: 2.6 - The optional `use_errno` and `use_last_error` parameters were - added. + The optional *use_errno* and *use_last_error* parameters were added. .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) Windows only: The returned function prototype creates functions that use the - ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE` - is the same as :func:`CFUNCTYPE`. The function will release the GIL during the - call. `use_errno` and `use_last_error` have the same meaning as above. + ``stdcall`` calling convention, except on Windows CE where + :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will + release the GIL during the call. *use_errno* and *use_last_error* have the + same meaning as above. .. function:: PYFUNCTYPE(restype, *argtypes) @@ -1864,10 +1863,10 @@ .. function:: find_library(name) :module: ctypes.util - Try to find a library and return a pathname. `name` is the library name without - any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this - is the form used for the posix linker option :option:`-l`). If no library can - be found, returns ``None``. + Try to find a library and return a pathname. *name* is the library name + without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + number (this is the form used for the posix linker option :option:`-l`). If + no library can be found, returns ``None``. The exact functionality is system dependent. @@ -1905,14 +1904,14 @@ .. function:: get_errno() Returns the current value of the ctypes-private copy of the system - `errno` variable in the calling thread. + :data:`errno` variable in the calling thread. .. versionadded:: 2.6 .. function:: get_last_error() Windows only: returns the current value of the ctypes-private copy of the system - `LastError` variable in the calling thread. + :data:`LastError` variable in the calling thread. .. versionadded:: 2.6 @@ -1969,17 +1968,16 @@ .. function:: set_errno(value) - Set the current value of the ctypes-private copy of the system - `errno` variable in the calling thread to `value` and return the - previous value. + Set the current value of the ctypes-private copy of the system :data:`errno` + variable in the calling thread to *value* and return the previous value. .. versionadded:: 2.6 .. function:: set_last_error(value) - Windows only: set the current value of the ctypes-private copy of - the system `LastError` variable in the calling thread to `value` - and return the previous value. + Windows only: set the current value of the ctypes-private copy of the system + :data:`LastError` variable in the calling thread to *value* and return the + previous value. .. versionadded:: 2.6 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 Sat Jan 3 22:55:17 2009 @@ -266,10 +266,10 @@ considered to be true if and only if it isn't equal to ``timedelta(0)``. Example usage: - + >>> from datetime import timedelta >>> year = timedelta(days=365) - >>> another_year = timedelta(weeks=40, days=84, hours=23, + >>> another_year = timedelta(weeks=40, days=84, hours=23, ... minutes=50, seconds=600) # adds up to 365 days >>> year == another_year True @@ -517,10 +517,10 @@ True >>> my_birthday = date(today.year, 6, 24) >>> if my_birthday < today: - ... my_birthday = my_birthday.replace(year=today.year + 1) + ... my_birthday = my_birthday.replace(year=today.year + 1) >>> my_birthday datetime.date(2008, 6, 24) - >>> time_to_birthday = abs(my_birthday - today) + >>> time_to_birthday = abs(my_birthday - today) >>> time_to_birthday.days 202 @@ -1015,7 +1015,7 @@ >>> tt = dt.timetuple() >>> for it in tt: # doctest: +SKIP ... print it - ... + ... 2006 # year 11 # month 21 # day @@ -1044,23 +1044,23 @@ ... def __init__(self): # DST starts last Sunday in March ... d = datetime(dt.year, 4, 1) # ends last Sunday in October ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) - ... def dst(self, dt): + ... def dst(self, dt): ... if self.dston <= dt.replace(tzinfo=None) < self.dstoff: ... return timedelta(hours=1) ... else: ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +1" - ... + ... >>> class GMT2(tzinfo): ... def __init__(self): - ... d = datetime(dt.year, 4, 1) + ... d = datetime(dt.year, 4, 1) ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) @@ -1071,7 +1071,7 @@ ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +2" - ... + ... >>> gmt1 = GMT1() >>> # Daylight Saving Time >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1) @@ -1092,7 +1092,7 @@ datetime.datetime(2006, 6, 14, 13, 0, tzinfo=) >>> dt2.utctimetuple() == dt3.utctimetuple() True - + .. _datetime-time: @@ -1240,12 +1240,12 @@ return ``None`` or a string object. Example: - + >>> from datetime import time, tzinfo >>> class GMT1(tzinfo): ... def utcoffset(self, dt): - ... return timedelta(hours=1) - ... def dst(self, dt): + ... return timedelta(hours=1) + ... def dst(self, dt): ... return timedelta(0) ... def tzname(self,dt): ... return "Europe/Prague" @@ -1476,7 +1476,7 @@ :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any other fixed-offset :class:`tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)). - + .. _strftime-behavior: @@ -1521,7 +1521,7 @@ The full set of format codes supported varies across platforms, because Python calls the platform C library's :func:`strftime` function, and platform -variations are common. +variations are common. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C Modified: python/branches/release26-maint/Doc/library/decimal.rst ============================================================================== --- python/branches/release26-maint/Doc/library/decimal.rst (original) +++ python/branches/release26-maint/Doc/library/decimal.rst Sat Jan 3 22:55:17 2009 @@ -328,7 +328,7 @@ infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity - numeric-string ::= [sign] numeric-value | [sign] nan + numeric-string ::= [sign] numeric-value | [sign] nan If *value* is a :class:`tuple`, it should have three components, a sign (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of @@ -947,7 +947,7 @@ * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer), * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or * :const:`ROUND_UP` (away from zero). - * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero + * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise towards zero) The *traps* and *flags* fields list any signals to be set. Generally, new @@ -1168,7 +1168,7 @@ .. method:: logical_and(x, y) - Applies the logical operation `and` between each operand's digits. + Applies the logical operation *and* between each operand's digits. .. method:: logical_invert(x) @@ -1178,12 +1178,12 @@ .. method:: logical_or(x, y) - Applies the logical operation `or` between each operand's digits. + Applies the logical operation *or* between each operand's digits. .. method:: logical_xor(x, y) - Applies the logical operation `xor` between each operand's digits. + Applies the logical operation *xor* between each operand's digits. .. method:: max(x, y) @@ -1270,7 +1270,7 @@ that would be obtained by computing ``(x**y) % modulo`` with unbounded precision, but is computed more efficiently. It is always exact. - .. versionchanged:: 2.6 + .. versionchanged:: 2.6 ``y`` may now be nonintegral in ``x**y``. Stricter requirements for the three-argument version. @@ -1294,8 +1294,8 @@ .. method:: remainder_near(x, y) - Returns `x - y * n`, where *n* is the integer nearest the exact value - of `x / y` (if the result is `0` then its sign will be the sign of *x*). + Returns ``x - y * n``, where *n* is the integer nearest the exact value + of ``x / y`` (if the result is 0 then its sign will be the sign of *x*). .. method:: rotate(x, y) @@ -1412,7 +1412,7 @@ sqrt(-x) and x > 0 0 ** 0 x ** (non-integer) - x ** Infinity + x ** Infinity .. class:: Overflow @@ -1515,7 +1515,7 @@ Decimal('9.51111111') >>> u + (v + w) Decimal('9.51111111') - >>> + >>> >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003') >>> (u*v) + (u*w) Decimal('0.0060000') @@ -1654,7 +1654,7 @@ """ q = Decimal(10) ** -places # 2 places --> '0.01' - sign, digits, exp = value.quantize(q).as_tuple() + sign, digits, exp = value.quantize(q).as_tuple() result = [] digits = map(str, digits) build, next = result.append, digits.pop @@ -1711,12 +1711,12 @@ getcontext().prec += 2 i, lasts, s, fact, num = 0, 0, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 1 fact *= i - num *= x - s += num / fact - getcontext().prec -= 2 + num *= x + s += num / fact + getcontext().prec -= 2 return +s def cos(x): @@ -1733,13 +1733,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s def sin(x): @@ -1756,13 +1756,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s @@ -1796,7 +1796,7 @@ >>> Decimal('3.214').quantize(TWOPLACES) Decimal('3.21') - >>> # Validate that a number does not exceed two places + >>> # Validate that a number does not exceed two places >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact])) Decimal('3.21') Modified: python/branches/release26-maint/Doc/library/difflib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/difflib.rst (original) +++ python/branches/release26-maint/Doc/library/difflib.rst Sat Jan 3 22:55:17 2009 @@ -428,7 +428,7 @@ .. XXX Explain why a dummy is used! - .. versionchanged:: 2.5 + .. versionchanged:: 2.5 The guarantee that adjacent triples always describe non-adjacent blocks was implemented. Modified: python/branches/release26-maint/Doc/library/dircache.rst ============================================================================== --- python/branches/release26-maint/Doc/library/dircache.rst (original) +++ python/branches/release26-maint/Doc/library/dircache.rst Sat Jan 3 22:55:17 2009 @@ -5,11 +5,11 @@ .. module:: dircache :synopsis: Return directory listing, with cache mechanism. :deprecated: - + .. deprecated:: 2.6 The :mod:`dircache` module has been removed in Python 3.0. - - + + .. sectionauthor:: Moshe Zadka Modified: python/branches/release26-maint/Doc/library/dis.rst ============================================================================== --- python/branches/release26-maint/Doc/library/dis.rst (original) +++ python/branches/release26-maint/Doc/library/dis.rst Sat Jan 3 22:55:17 2009 @@ -755,7 +755,7 @@ opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, - the function object to call is on the stack. Pops all function arguments, and + the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value. Modified: python/branches/release26-maint/Doc/library/dl.rst ============================================================================== --- python/branches/release26-maint/Doc/library/dl.rst (original) +++ python/branches/release26-maint/Doc/library/dl.rst Sat Jan 3 22:55:17 2009 @@ -6,11 +6,11 @@ :platform: Unix :synopsis: Call C functions in shared objects. :deprecated: - + .. deprecated:: 2.6 The :mod:`dl` module has been removed in Python 3.0. Use the :mod:`ctypes` module instead. - + .. sectionauthor:: Moshe Zadka The :mod:`dl` module defines an interface to the :cfunc:`dlopen` function, which @@ -91,9 +91,9 @@ Return the pointer for the function named *name*, as a number, if it exists in the referenced shared object, otherwise ``None``. This is useful in code like:: - >>> if a.sym('time'): + >>> if a.sym('time'): ... a.call('time') - ... else: + ... else: ... time.time() (Note that this function will return a non-zero number, as zero is the *NULL* Modified: python/branches/release26-maint/Doc/library/email.mime.rst ============================================================================== --- python/branches/release26-maint/Doc/library/email.mime.rst (original) +++ python/branches/release26-maint/Doc/library/email.mime.rst Sat Jan 3 22:55:17 2009 @@ -2,7 +2,7 @@ ---------------------------------------------------------- .. module:: email.mime - :synopsis: Build MIME messages. + :synopsis: Build MIME messages. Ordinarily, you get a message object structure by passing a file or some text to @@ -57,14 +57,14 @@ .. currentmodule:: email.mime.multipart -.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) +.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A - :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be + :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added. Modified: python/branches/release26-maint/Doc/library/fileinput.rst ============================================================================== --- python/branches/release26-maint/Doc/library/fileinput.rst (original) +++ python/branches/release26-maint/Doc/library/fileinput.rst Sat Jan 3 22:55:17 2009 @@ -151,7 +151,7 @@ when standard input is read. .. warning:: - + The current implementation does not work for MS-DOS 8+3 filesystems. Modified: python/branches/release26-maint/Doc/library/fl.rst ============================================================================== --- python/branches/release26-maint/Doc/library/fl.rst (original) +++ python/branches/release26-maint/Doc/library/fl.rst Sat Jan 3 22:55:17 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: FORMS library for applications with graphical user interfaces. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`fl` module has been deprecated for removal in Python 3.0. @@ -484,8 +484,8 @@ :platform: IRIX :synopsis: Constants used with the fl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`FL` module has been deprecated for removal in Python 3.0. @@ -506,8 +506,8 @@ :platform: IRIX :synopsis: Functions for loading stored FORMS designs. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`flp` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/fm.rst ============================================================================== --- python/branches/release26-maint/Doc/library/fm.rst (original) +++ python/branches/release26-maint/Doc/library/fm.rst Sat Jan 3 22:55:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Font Manager interface for SGI workstations. :deprecated: - + .. deprecated:: 2.6 The :mod:`fm` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/fpformat.rst ============================================================================== --- python/branches/release26-maint/Doc/library/fpformat.rst (original) +++ python/branches/release26-maint/Doc/library/fpformat.rst Sat Jan 3 22:55:17 2009 @@ -5,10 +5,10 @@ .. module:: fpformat :synopsis: General floating point formatting functions. :deprecated: - + .. deprecated:: 2.6 The :mod:`fpformat` module has been removed in Python 3.0. - + .. sectionauthor:: Moshe Zadka Modified: python/branches/release26-maint/Doc/library/fractions.rst ============================================================================== --- python/branches/release26-maint/Doc/library/fractions.rst (original) +++ python/branches/release26-maint/Doc/library/fractions.rst Sat Jan 3 22:55:17 2009 @@ -101,11 +101,11 @@ .. function:: gcd(a, b) - Return the greatest common divisor of the integers `a` and `b`. If - either `a` or `b` is nonzero, then the absolute value of `gcd(a, - b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)` - has the same sign as `b` if `b` is nonzero; otherwise it takes the sign - of `a`. `gcd(0, 0)` returns `0`. + Return the greatest common divisor of the integers *a* and *b*. If either + *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the + largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same + sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0, + 0)`` returns ``0``. .. seealso:: 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 Sat Jan 3 22:55:17 2009 @@ -888,7 +888,7 @@ .. versionchanged:: 2.5 Use *fget*'s docstring if no *doc* given. - .. versionchanged:: 2.6 + .. versionchanged:: 2.6 The ``getter``, ``setter``, and ``deleter`` attributes were added. @@ -1178,10 +1178,10 @@ 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. - + The second use case is to support cooperative multiple inheritence 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 + 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 @@ -1242,7 +1242,7 @@ >>> class X(object): ... a = 1 - ... + ... >>> X = type('X', (object,), dict(a=1)) .. versionadded:: 2.2 @@ -1397,7 +1397,7 @@ For example, the statement ``import spam`` results in bytecode resembling the following code:: - + spam = __import__('spam', globals(), locals(), [], -1) The statement ``import spam.ham`` results in this call:: Modified: python/branches/release26-maint/Doc/library/gettext.rst ============================================================================== --- python/branches/release26-maint/Doc/library/gettext.rst (original) +++ python/branches/release26-maint/Doc/library/gettext.rst Sat Jan 3 22:55:17 2009 @@ -648,10 +648,9 @@ animals = ['mollusk', 'albatross', - 'rat', - 'penguin', - 'python', - ] + 'rat', + 'penguin', + 'python', ] # ... for a in animals: print a @@ -666,10 +665,9 @@ animals = [_('mollusk'), _('albatross'), - _('rat'), - _('penguin'), - _('python'), - ] + _('rat'), + _('penguin'), + _('python'), ] del _ @@ -692,10 +690,9 @@ animals = [N_('mollusk'), N_('albatross'), - N_('rat'), - N_('penguin'), - N_('python'), - ] + N_('rat'), + N_('penguin'), + N_('python'), ] # ... for a in animals: Modified: python/branches/release26-maint/Doc/library/gl.rst ============================================================================== --- python/branches/release26-maint/Doc/library/gl.rst (original) +++ python/branches/release26-maint/Doc/library/gl.rst Sat Jan 3 22:55:17 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: Functions from the Silicon Graphics Graphics Library. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`gl` module has been deprecated for removal in Python 3.0. @@ -166,8 +166,8 @@ :platform: IRIX :synopsis: Constants used with the gl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`DEVICE` module has been deprecated for removal in Python 3.0. @@ -184,8 +184,8 @@ :platform: IRIX :synopsis: Constants used with the gl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`GL` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/gzip.rst ============================================================================== --- python/branches/release26-maint/Doc/library/gzip.rst (original) +++ python/branches/release26-maint/Doc/library/gzip.rst Sat Jan 3 22:55:17 2009 @@ -7,7 +7,7 @@ This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would. -The data compression is provided by the :mod:``zlib`` module. +The data compression is provided by the :mod:`zlib` module. The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled after Python's File Object. The :class:`GzipFile` class reads and writes Modified: python/branches/release26-maint/Doc/library/heapq.rst ============================================================================== --- python/branches/release26-maint/Doc/library/heapq.rst (original) +++ python/branches/release26-maint/Doc/library/heapq.rst Sat Jan 3 22:55:17 2009 @@ -102,7 +102,7 @@ H N - + The module also offers three general purpose functions based on heaps. Modified: python/branches/release26-maint/Doc/library/htmllib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/htmllib.rst (original) +++ python/branches/release26-maint/Doc/library/htmllib.rst Sat Jan 3 22:55:17 2009 @@ -4,7 +4,7 @@ .. module:: htmllib :synopsis: A parser for HTML documents. :deprecated: - + .. deprecated:: 2.6 The :mod:`htmllib` module has been removed in Python 3.0. Modified: python/branches/release26-maint/Doc/library/idle.rst ============================================================================== --- python/branches/release26-maint/Doc/library/idle.rst (original) +++ python/branches/release26-maint/Doc/library/idle.rst Sat Jan 3 22:55:17 2009 @@ -230,7 +230,7 @@ Keywords orange - Strings + Strings green Comments Modified: python/branches/release26-maint/Doc/library/imageop.rst ============================================================================== --- python/branches/release26-maint/Doc/library/imageop.rst (original) +++ python/branches/release26-maint/Doc/library/imageop.rst Sat Jan 3 22:55:17 2009 @@ -5,7 +5,7 @@ .. module:: imageop :synopsis: Manipulate raw image data. :deprecated: - + .. deprecated:: 2.6 The :mod:`imageop` module has been removed in Python 3.0. Modified: python/branches/release26-maint/Doc/library/imgfile.rst ============================================================================== --- python/branches/release26-maint/Doc/library/imgfile.rst (original) +++ python/branches/release26-maint/Doc/library/imgfile.rst Sat Jan 3 22:55:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Support for SGI imglib files. :deprecated: - + .. deprecated:: 2.6 The :mod:`imgfile` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/io.rst ============================================================================== --- python/branches/release26-maint/Doc/library/io.rst (original) +++ python/branches/release26-maint/Doc/library/io.rst Sat Jan 3 22:55:17 2009 @@ -215,7 +215,7 @@ .. method:: close() Flush and close this stream. This method has no effect if the file is - already closed. Once the file is closed, any operation on the file + already closed. Once the file is closed, any operation on the file (e.g. reading or writing) will raise an :exc:`IOError`. The internal file descriptor isn't closed if *closefd* was False. @@ -629,7 +629,7 @@ .. attribute:: line_buffering Whether line buffering is enabled. - + .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) 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 Sat Jan 3 22:55:17 2009 @@ -76,7 +76,7 @@ .. function:: itertools.chain.from_iterable(iterable) - Alternate constructor for :func:`chain`. Gets chained inputs from a + Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Equivalent to:: @classmethod @@ -93,9 +93,9 @@ Return *r* length subsequences of elements from the input *iterable*. - Combinations are emitted in lexicographic sort order. So, if the + Combinations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the combination tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -314,7 +314,7 @@ for i, element in enumerate(iterable): if i == nexti: yield element - nexti = it.next() + nexti = it.next() If *start* is ``None``, then iteration starts at zero. If *step* is ``None``, then the step defaults to one. @@ -380,12 +380,12 @@ Return successive *r* length permutations of elements in the *iterable*. If *r* is not specified or is ``None``, then *r* defaults to the length - of the *iterable* and all possible full-length permutations + of the *iterable* and all possible full-length permutations are generated. - Permutations are emitted in lexicographic sort order. So, if the + Permutations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the permutation tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -416,7 +416,7 @@ else: return - The code for :func:`permutations` can be also expressed as a subsequence of + The code for :func:`permutations` can be also expressed as a subsequence of :func:`product`, filtered to exclude entries with repeated elements (those from the same position in the input pool):: @@ -547,7 +547,7 @@ .. doctest:: - # Show a dictionary sorted and grouped by value + >>> # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.iteritems(), key=itemgetter(1)) @@ -558,13 +558,13 @@ 2 ['b', 'd', 'f'] 3 ['g'] - # Find runs of consecutive numbers using groupby. The key to the solution - # is differencing with a range so that consecutive numbers all appear in - # same group. + >>> # Find runs of consecutive numbers using groupby. The key to the solution + >>> # is differencing with a range so that consecutive numbers all appear in + >>> # same group. >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x): ... print map(itemgetter(1), g) - ... + ... [1] [4, 5, 6] [10] @@ -691,7 +691,7 @@ 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 + # unique_everseen('ABBCcAD', str.lower) --> A B C D seen = set() seen_add = seen.add if key is None: Modified: python/branches/release26-maint/Doc/library/jpeg.rst ============================================================================== --- python/branches/release26-maint/Doc/library/jpeg.rst (original) +++ python/branches/release26-maint/Doc/library/jpeg.rst Sat Jan 3 22:55:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Read and write image files in compressed JPEG format. :deprecated: - + .. deprecated:: 2.6 The :mod:`jpeg` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/json.rst ============================================================================== --- python/branches/release26-maint/Doc/library/json.rst (original) +++ python/branches/release26-maint/Doc/library/json.rst Sat Jan 3 22:55:17 2009 @@ -14,7 +14,7 @@ :mod:`marshal` and :mod:`pickle` modules. Encoding basic Python object hierarchies:: - + >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' @@ -43,12 +43,12 @@ >>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) { - "4": 5, + "4": 5, "6": 7 } Decoding JSON:: - + >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] @@ -66,7 +66,7 @@ ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct - ... + ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) @@ -75,26 +75,26 @@ Decimal('1.1') Extending :class:`JSONEncoder`:: - + >>> import json >>> class ComplexEncoder(json.JSONEncoder): ... def default(self, obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... return json.JSONEncoder.default(self, obj) - ... + ... >>> dumps(2 + 1j, cls=ComplexEncoder) '[2.0, 1.0]' >>> ComplexEncoder().encode(2 + 1j) '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[', '2.0', ', ', '1.0', ']'] - + .. highlight:: none Using json.tool from the shell to validate and pretty-print:: - + $ echo '{"json":"obj"}' | python -mjson.tool { "json": "obj" @@ -104,7 +104,7 @@ .. highlight:: python -.. note:: +.. note:: The JSON produced by this module's default settings is a subset of YAML, so it may be used as a serializer for that as well. @@ -152,7 +152,7 @@ *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. - To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the + To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the *cls* kwarg. @@ -368,7 +368,7 @@ For example, to support arbitrary iterators, you could implement default like this:: - + def default(self, o): try: iterable = iter(o) @@ -392,6 +392,6 @@ Encode the given object, *o*, and yield each string representation as available. For example:: - + for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) Modified: python/branches/release26-maint/Doc/library/locale.rst ============================================================================== --- python/branches/release26-maint/Doc/library/locale.rst (original) +++ python/branches/release26-maint/Doc/library/locale.rst Sat Jan 3 22:55:17 2009 @@ -494,7 +494,7 @@ >>> import locale >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale Modified: python/branches/release26-maint/Doc/library/macos.rst ============================================================================== --- python/branches/release26-maint/Doc/library/macos.rst (original) +++ python/branches/release26-maint/Doc/library/macos.rst Sat Jan 3 22:55:17 2009 @@ -82,7 +82,7 @@ parameter can be a pathname or an ``FSSpec`` or ``FSRef`` object. .. note:: - + It is not possible to use an ``FSSpec`` in 64-bit mode. @@ -93,7 +93,7 @@ strings. .. note:: - + It is not possible to use an ``FSSpec`` in 64-bit mode. .. function:: openrf(name [, mode]) Modified: python/branches/release26-maint/Doc/library/mailbox.rst ============================================================================== --- python/branches/release26-maint/Doc/library/mailbox.rst (original) +++ python/branches/release26-maint/Doc/library/mailbox.rst Sat Jan 3 22:55:17 2009 @@ -1686,7 +1686,7 @@ # that's better than losing a message completely. box.lock() box.add(message) - box.flush() + box.flush() box.unlock() # Remove original message Modified: python/branches/release26-maint/Doc/library/marshal.rst ============================================================================== --- python/branches/release26-maint/Doc/library/marshal.rst (original) +++ python/branches/release26-maint/Doc/library/marshal.rst Sat Jan 3 22:55:17 2009 @@ -45,7 +45,7 @@ (they will cause infinite loops). .. warning:: - + On machines where C's ``long int`` type has more than 32 bits (such as the DEC Alpha), it is possible to create plain Python integers that are longer than 32 bits. If such an integer is marshaled and read back in on a machine 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 Sat Jan 3 22:55:17 2009 @@ -109,7 +109,7 @@ .. function:: isnan(x) Checks if the float *x* is a NaN (not a number). NaNs are part of the - IEEE 754 standards. Operation like but not limited to ``inf * 0``, + IEEE 754 standards. Operation like but not limited to ``inf * 0``, ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return a NaN. Modified: python/branches/release26-maint/Doc/library/mhlib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/mhlib.rst (original) +++ python/branches/release26-maint/Doc/library/mhlib.rst Sat Jan 3 22:55:17 2009 @@ -4,7 +4,7 @@ .. module:: mhlib :synopsis: Manipulate MH mailboxes from Python. :deprecated: - + .. deprecated:: 2.6 The :mod:`mhlib` module has been removed in Python 3.0. Use the :mod:`mailbox` instead. Modified: python/branches/release26-maint/Doc/library/mmap.rst ============================================================================== --- python/branches/release26-maint/Doc/library/mmap.rst (original) +++ python/branches/release26-maint/Doc/library/mmap.rst Sat Jan 3 22:55:17 2009 @@ -93,7 +93,7 @@ will be relative to the offset from the beginning of the file. *offset* defaults to 0. *offset* must be a multiple of the PAGESIZE or ALLOCATIONGRANULARITY. - + This example shows a simple way of using :class:`mmap`:: import mmap Modified: python/branches/release26-maint/Doc/library/msvcrt.rst ============================================================================== --- python/branches/release26-maint/Doc/library/msvcrt.rst (original) +++ python/branches/release26-maint/Doc/library/msvcrt.rst Sat Jan 3 22:55:17 2009 @@ -18,7 +18,7 @@ The module implements both the normal and wide char variants of the console I/O api. The normal API deals only with ASCII characters and is of limited use -for internationalized applications. The wide char API should be used where +for internationalized applications. The wide char API should be used where ever possible .. _msvcrt-files: @@ -98,13 +98,13 @@ return the keycode. The :kbd:`Control-C` keypress cannot be read with this function. - + .. function:: getwch() Wide char variant of :func:`getch`, returning a Unicode value. - + .. versionadded:: 2.6 - + .. function:: getche() @@ -115,7 +115,7 @@ .. function:: getwche() Wide char variant of :func:`getche`, returning a Unicode value. - + .. versionadded:: 2.6 @@ -123,24 +123,24 @@ Print the character *char* to the console without buffering. - + .. function:: putwch(unicode_char) Wide char variant of :func:`putch`, accepting a Unicode value. - + .. versionadded:: 2.6 - + .. function:: ungetch(char) Cause the character *char* to be "pushed back" into the console buffer; it will be the next character read by :func:`getch` or :func:`getche`. - + .. function:: ungetwch(unicode_char) Wide char variant of :func:`ungetch`, accepting a Unicode value. - + .. versionadded:: 2.6 Modified: python/branches/release26-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release26-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release26-maint/Doc/library/multiprocessing.rst Sat Jan 3 22:55:17 2009 @@ -21,9 +21,9 @@ .. warning:: Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See :issue:`3770` for additional information. .. note:: @@ -37,8 +37,8 @@ >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): - ... return x*x - ... + ... return x*x + ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: @@ -77,11 +77,11 @@ print 'module name:', __name__ print 'parent process:', os.getppid() print 'process id:', os.getpid() - + def f(name): info('function f') print 'hello', name - + if __name__ == '__main__': info('main line') p = Process(target=f, args=('bob',)) @@ -109,12 +109,12 @@ def f(q): q.put([42, None, 'hello']) - if __name__ == '__main__': - q = Queue() - p = Process(target=f, args=(q,)) - p.start() - print q.get() # prints "[42, None, 'hello']" - p.join() + if __name__ == '__main__': + q = Queue() + p = Process(target=f, args=(q,)) + p.start() + print q.get() # prints "[42, None, 'hello']" + p.join() Queues are thread and process safe. @@ -543,7 +543,7 @@ .. method:: put(item[, block[, timeout]]) - Put item into the queue. If the optional argument *block* is ``True`` + Put item into the queue. If the optional argument *block* is ``True`` (the default) and *timeout* is ``None`` (the default), block if necessary until a free slot is available. If *timeout* is a positive number, it blocks at most *timeout* seconds and raises the :exc:`Queue.Full` exception if no @@ -858,7 +858,7 @@ acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it specifies a timeout in seconds. If *block* is ``False`` then *timeout* is ignored. - + Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments for these will be ignored. @@ -1135,22 +1135,22 @@ server process which is using the given address and authentication key. .. method:: get_server() - + Returns a :class:`Server` object which represents the actual server under - the control of the Manager. The :class:`Server` object supports the - :meth:`serve_forever` method:: - - >>> from multiprocessing.managers import BaseManager - >>> m = BaseManager(address=('', 50000), authkey='abc')) - >>> server = m.get_server() - >>> s.serve_forever() - - :class:`Server` additionally have an :attr:`address` attribute. + the control of the Manager. The :class:`Server` object supports the + :meth:`serve_forever` method: + + >>> from multiprocessing.managers import BaseManager + >>> m = BaseManager(address=('', 50000), authkey='abc')) + >>> server = m.get_server() + >>> s.serve_forever() + + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - - Connect a local manager object to a remote manager process:: - + + Connect a local manager object to a remote manager process: + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) >>> m.connect() @@ -1295,7 +1295,7 @@ >>>>>>>>>>>>>>>>>>> To create one's own manager, one creates a subclass of :class:`BaseManager` and -use the :meth:`~BaseManager.resgister` classmethod to register new types or +use the :meth:`~BaseManager.register` classmethod to register new types or callables with the manager class. For example:: from multiprocessing.managers import BaseManager @@ -1360,7 +1360,7 @@ >>> queue.get() 'hello' -Local processes can also access that queue, using the code from above on the +Local processes can also access that queue, using the code from above on the client to access it remotely:: >>> from multiprocessing import Process, Queue @@ -1371,12 +1371,12 @@ ... super(Worker, self).__init__() ... def run(self): ... self.q.put('local hello') - ... + ... >>> queue = Queue() >>> w = Worker(queue) >>> w.start() >>> class QueueManager(BaseManager): pass - ... + ... >>> QueueManager.register('get_queue', callable=lambda: queue) >>> m = QueueManager(address=('', 50000), authkey='abracadabra') >>> s = m.get_server() @@ -1811,7 +1811,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named - pipe on a remote computer called ServerName* one should use an address of the + pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be @@ -2120,7 +2120,7 @@ .. literalinclude:: ../includes/mp_benchmarks.py An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process` -and others to build a system which can distribute processes and work via a +and others to build a system which can distribute processes and work via a distributed queue to a "cluster" of machines on a network, accessible via SSH. You will need to have private key authentication for all hosts configured for this to work. Modified: python/branches/release26-maint/Doc/library/mutex.rst ============================================================================== --- python/branches/release26-maint/Doc/library/mutex.rst (original) +++ python/branches/release26-maint/Doc/library/mutex.rst Sat Jan 3 22:55:17 2009 @@ -5,7 +5,7 @@ .. module:: mutex :synopsis: Lock and queue for mutual exclusion. :deprecated: - + .. deprecated:: The :mod:`mutex` module has been removed in Python 3.0. Modified: python/branches/release26-maint/Doc/library/nntplib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/nntplib.rst (original) +++ python/branches/release26-maint/Doc/library/nntplib.rst Sat Jan 3 22:55:17 2009 @@ -24,16 +24,16 @@ Group comp.lang.python has 59 articles, range 3742 to 3803 >>> resp, subs = s.xhdr('subject', first + '-' + last) >>> for id, sub in subs[-10:]: print id, sub - ... + ... 3792 Re: Removing elements from a list while iterating... 3793 Re: Who likes Info files? 3794 Emacs and doc strings 3795 a few questions about the Mac implementation 3796 Re: executable python scripts 3797 Re: executable python scripts - 3798 Re: a few questions about the Mac implementation + 3798 Re: a few questions about the Mac implementation 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules - 3802 Re: executable python scripts + 3802 Re: executable python scripts 3803 Re: \POSIX{} wait and SIGCHLD >>> s.quit() '205 news.cwi.nl closing connection. Goodbye.' Modified: python/branches/release26-maint/Doc/library/numbers.rst ============================================================================== --- python/branches/release26-maint/Doc/library/numbers.rst (original) +++ python/branches/release26-maint/Doc/library/numbers.rst Sat Jan 3 22:55:17 2009 @@ -51,14 +51,14 @@ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``. - Real also provides defaults for :func:`complex`, :attr:`Complex.real`, - :attr:`Complex.imag`, and :meth:`Complex.conjugate`. + Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, + :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. .. class:: Rational Subtypes :class:`Real` and adds - :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which + :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which should be in lowest terms. With these, it provides a default for :func:`float`. @@ -74,8 +74,8 @@ .. class:: Integral Subtypes :class:`Rational` and adds a conversion to :class:`int`. - Provides defaults for :func:`float`, :attr:`Rational.numerator`, and - :attr:`Rational.denominator`, and bit-string operations: ``<<``, + Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and + :attr:`~Rational.denominator`, and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``. @@ -171,7 +171,7 @@ knowledge of ``A``, so it can handle those instances before delegating to :class:`Complex`. -If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, +If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``. 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 Sat Jan 3 22:55:17 2009 @@ -7,7 +7,7 @@ .. testsetup:: - + import operator from operator import itemgetter @@ -437,7 +437,7 @@ >>> class C: ... pass - ... + ... >>> import operator >>> obj = C() >>> operator.isMappingType(obj) @@ -547,9 +547,9 @@ def g(obj): return tuple(obj[item] for item in items) return g - - The items can be any type accepted by the operand's :meth:`__getitem__` - method. Dictionaries accept any hashable value. Lists, tuples, and + + The items can be any type accepted by the operand's :meth:`__getitem__` + method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice: >>> itemgetter(1)('ABCDEFG') 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 Sat Jan 3 22:55:17 2009 @@ -548,8 +548,8 @@ :class:`OptionGroup` to a parser is easy:: group = OptionGroup(parser, "Dangerous Options", - "Caution: use these options at your own risk. " - "It is believed that some of them bite.") + "Caution: use these options at your own risk. " + "It is believed that some of them bite.") group.add_option("-g", action="store_true", help="Group option.") parser.add_option_group(group) @@ -563,12 +563,12 @@ -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --file=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' - [default], 'expert' + [default], 'expert' Dangerous Options: - Caution: use of these options is at your own risk. It is believed that - some of them bite. - -g Group option. + Caution: use of these options is at your own risk. It is believed that + some of them bite. + -g Group option. .. _optparse-printing-version-string: @@ -799,7 +799,7 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an +attributes, or fail to pass required ones, :mod:`optparse` raises an :exc:`OptionError` exception explaining your mistake. An option's *action* determines what :mod:`optparse` does when it encounters Modified: python/branches/release26-maint/Doc/library/os.rst ============================================================================== --- python/branches/release26-maint/Doc/library/os.rst (original) +++ python/branches/release26-maint/Doc/library/os.rst Sat Jan 3 22:55:17 2009 @@ -368,7 +368,7 @@ is returned. Availability: Unix, Windows. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. .. versionchanged:: 2.0 @@ -418,7 +418,7 @@ child_stdout)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -432,7 +432,7 @@ child_stdout, child_stderr)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -446,7 +446,7 @@ child_stdout_and_stderr)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -1449,7 +1449,7 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered @@ -1481,7 +1481,7 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. + inherit the environment of the current process. Availability: Unix, Windows. @@ -1718,7 +1718,7 @@ (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is - preferable to using these functions. Check specially the *Replacing Older + preferable to using these functions. Check specially the *Replacing Older Functions with the subprocess Module* section in that documentation page.) If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new Modified: python/branches/release26-maint/Doc/library/ossaudiodev.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ossaudiodev.rst (original) +++ python/branches/release26-maint/Doc/library/ossaudiodev.rst Sat Jan 3 22:55:17 2009 @@ -18,26 +18,26 @@ use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast majority of Linux audio apps anyways. - + Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: - + > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial > OSS installation manual tells you to remove references to OSS/Free from the > kernel :) - + but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes from its : > * WARNING! WARNING! > * This is an OSS (Linux) audio emulator. > * Use the Native NetBSD API for developing new code, and this > * only for compiling Linux programs. - + There's also an ossaudio manpage on OpenBSD that explains things further. Presumably NetBSD and OpenBSD have a different standard audio interface. That's the great thing about standards, there are so many to choose from ... ;-) - + This probably all warrants a footnote or two, but I don't understand things well enough right now to write it! --GPW Modified: python/branches/release26-maint/Doc/library/othergui.rst ============================================================================== --- python/branches/release26-maint/Doc/library/othergui.rst (original) +++ python/branches/release26-maint/Doc/library/othergui.rst Sat Jan 3 22:55:17 2009 @@ -70,7 +70,7 @@ Robin Dunn. PyGTK, PyQt, and wxPython, all have a modern look and feel and more -widgets than Tkinter. In addition, there are many other GUI toolkits for +widgets than Tkinter. In addition, there are many other GUI toolkits for Python, both cross-platform, and platform-specific. See the `GUI Programming `_ page in the Python Wiki for a much more complete list, and also for links to documents where the Modified: python/branches/release26-maint/Doc/library/parser.rst ============================================================================== --- python/branches/release26-maint/Doc/library/parser.rst (original) +++ python/branches/release26-maint/Doc/library/parser.rst Sat Jan 3 22:55:17 2009 @@ -641,7 +641,7 @@ while the long form uses an indented block and allows nested definitions:: def make_power(exp): - "Make a function that raises an argument to the exponent `exp'." + "Make a function that raises an argument to the exponent `exp`." def raiser(x, y=exp): return x ** y return raiser Modified: python/branches/release26-maint/Doc/library/pdb.rst ============================================================================== --- python/branches/release26-maint/Doc/library/pdb.rst (original) +++ python/branches/release26-maint/Doc/library/pdb.rst Sat Jan 3 22:55:17 2009 @@ -37,7 +37,7 @@ (Pdb) continue NameError: 'spam' > (1)?() - (Pdb) + (Pdb) :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -68,7 +68,7 @@ >>> pdb.pm() > ./mymodule.py(3)test2() -> print spam - (Pdb) + (Pdb) The module defines the following functions; each enters the debugger in a slightly different way: @@ -109,7 +109,7 @@ .. function:: post_mortem([traceback]) - Enter post-mortem debugging of the given *traceback* object. If no + Enter post-mortem debugging of the given *traceback* object. If no *traceback* is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used). Modified: python/branches/release26-maint/Doc/library/pickle.rst ============================================================================== --- python/branches/release26-maint/Doc/library/pickle.rst (original) +++ python/branches/release26-maint/Doc/library/pickle.rst Sat Jan 3 22:55:17 2009 @@ -413,7 +413,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: object.__getinitargs__() - + When a pickled class instance is unpickled, its :meth:`__init__` method is normally *not* invoked. If it is desirable that the :meth:`__init__` method be called on unpickling, an old-style class can define a method @@ -430,31 +430,31 @@ is affected by the values passed to the :meth:`__new__` method for the type (as it is for tuples and strings). Instances of a :term:`new-style class` ``C`` are created using :: - + obj = C.__new__(C, *args) - + where *args* is the result of calling :meth:`__getnewargs__` on the original object; if there is no :meth:`__getnewargs__`, an empty tuple is assumed. .. method:: object.__getstate__() - + Classes can further influence how their instances are pickled; if the class defines the method :meth:`__getstate__`, it is called and the return state is pickled as the contents for the instance, instead of the contents of the instance's dictionary. If there is no :meth:`__getstate__` method, the instance's :attr:`__dict__` is pickled. -.. method:: object.__setstate__() - +.. method:: object.__setstate__() + Upon unpickling, if the class also defines the method :meth:`__setstate__`, it is called with the unpickled state. [#]_ If there is no :meth:`__setstate__` method, the pickled state must be a dictionary and its items are assigned to the new instance's dictionary. If a class defines both :meth:`__getstate__` and :meth:`__setstate__`, the state object needn't be a dictionary and these methods can do what they want. [#]_ - + .. warning:: - + For :term:`new-style class`\es, if :meth:`__getstate__` returns a false value, the :meth:`__setstate__` method will not be called. @@ -463,7 +463,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: object.__reduce__() - + When the :class:`Pickler` encounters an object of a type it knows nothing about --- such as an extension type --- it looks in two places for a hint of how to pickle it. One alternative is for the object to implement a @@ -518,7 +518,7 @@ is primarily used for dictionary subclasses, but may be used by other classes as long as they implement :meth:`__setitem__`. -.. method:: object.__reduce_ex__(protocol) +.. method:: object.__reduce_ex__(protocol) It is sometimes useful to know the protocol version when implementing :meth:`__reduce__`. This can be done by implementing a method named Modified: python/branches/release26-maint/Doc/library/popen2.rst ============================================================================== --- python/branches/release26-maint/Doc/library/popen2.rst (original) +++ python/branches/release26-maint/Doc/library/popen2.rst Sat Jan 3 22:55:17 2009 @@ -9,7 +9,7 @@ .. deprecated:: 2.6 - This module is obsolete. Use the :mod:`subprocess` module. Check + This module is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. This module allows you to spawn processes and connect to their Modified: python/branches/release26-maint/Doc/library/profile.rst ============================================================================== --- python/branches/release26-maint/Doc/library/profile.rst (original) +++ python/branches/release26-maint/Doc/library/profile.rst Sat Jan 3 22:55:17 2009 @@ -51,17 +51,17 @@ The Python standard library provides three different profilers: -#. :mod:`cProfile` is recommended for most users; it's a C extension +#. :mod:`cProfile` is recommended for most users; it's a C extension with reasonable overhead - that makes it suitable for profiling long-running programs. + that makes it suitable for profiling long-running programs. Based on :mod:`lsprof`, - contributed by Brett Rosen and Ted Czotter. + contributed by Brett Rosen and Ted Czotter. .. versionadded:: 2.5 #. :mod:`profile`, a pure Python module whose interface is imitated by - :mod:`cProfile`. Adds significant overhead to profiled programs. - If you're trying to extend + :mod:`cProfile`. Adds significant overhead to profiled programs. + If you're trying to extend the profiler in some way, the task might be easier with this module. Copyright ? 1994, by InfoSeek Corporation. @@ -72,7 +72,7 @@ the overhead of profiling, at the expense of longer data post-processing times. It is no longer maintained and may be dropped in a future version of Python. - + .. versionchanged:: 2.5 The results should be more meaningful than in the past: the timing core @@ -276,24 +276,24 @@ that the text string in the far right column was used to sort the output. The column headings include: - ncalls + ncalls for the number of calls, - tottime + tottime for the total time spent in the given function (and excluding time made in calls to sub-functions), - percall + percall is the quotient of ``tottime`` divided by ``ncalls`` - cumtime + cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate *even* for recursive functions. - percall + percall is the quotient of ``cumtime`` divided by primitive calls - filename:lineno(function) + filename:lineno(function) provides the respective data of each function When there are two numbers in the first column (for example, ``43/3``), then the Modified: python/branches/release26-maint/Doc/library/pyexpat.rst ============================================================================== --- python/branches/release26-maint/Doc/library/pyexpat.rst (original) +++ python/branches/release26-maint/Doc/library/pyexpat.rst Sat Jan 3 22:55:17 2009 @@ -182,9 +182,9 @@ .. attribute:: xmlparser.buffer_size - The size of the buffer used when :attr:`buffer_text` is true. - A new buffer size can be set by assigning a new integer value - to this attribute. + The size of the buffer used when :attr:`buffer_text` is true. + A new buffer size can be set by assigning a new integer value + to this attribute. When the size is changed, the buffer will be flushed. .. versionadded:: 2.3 Modified: python/branches/release26-maint/Doc/library/re.rst ============================================================================== --- python/branches/release26-maint/Doc/library/re.rst (original) +++ python/branches/release26-maint/Doc/library/re.rst Sat Jan 3 22:55:17 2009 @@ -994,14 +994,14 @@ >>> pair.match("717ak").group(1) '7' - + # Error because re.match() returns None, which doesn't have a group() method: >>> pair.match("718ak").group(1) Traceback (most recent call last): File "", line 1, in re.match(r".*(.).*\1", "718ak").group(1) AttributeError: 'NoneType' object has no attribute 'group' - + >>> pair.match("354aa").group(1) 'a' @@ -1110,7 +1110,7 @@ Making a Phonebook ^^^^^^^^^^^^^^^^^^ -:func:`split` splits a string into a list delimited by the passed pattern. The +:func:`split` splits a string into a list delimited by the passed pattern. The method is invaluable for converting textual data into data structures that can be easily read and modified by Python as demonstrated in the following example that creates a phonebook. @@ -1119,7 +1119,7 @@ triple-quoted string syntax: >>> input = """Ross McFluff: 834.345.1254 155 Elm Street - ... + ... ... Ronald Heathmore: 892.345.3428 436 Finley Avenue ... Frank Burger: 925.541.7625 662 South Dogwood Way ... Modified: python/branches/release26-maint/Doc/library/repr.rst ============================================================================== --- python/branches/release26-maint/Doc/library/repr.rst (original) +++ python/branches/release26-maint/Doc/library/repr.rst Sat Jan 3 22:55:17 2009 @@ -125,15 +125,15 @@ the handling of types already supported. This example shows how special support for file objects could be added:: - import repr + import repr as reprlib import sys - class MyRepr(repr.Repr): + class MyRepr(reprlib.Repr): def repr_file(self, obj, level): if obj.name in ['', '', '']: return obj.name else: - return `obj` + return repr(obj) aRepr = MyRepr() print aRepr.repr(sys.stdin) # prints '' Modified: python/branches/release26-maint/Doc/library/rexec.rst ============================================================================== --- python/branches/release26-maint/Doc/library/rexec.rst (original) +++ python/branches/release26-maint/Doc/library/rexec.rst Sat Jan 3 22:55:17 2009 @@ -5,7 +5,7 @@ .. module:: rexec :synopsis: Basic restricted execution framework. :deprecated: - + .. deprecated:: 2.6 The :mod:`rexec` module has been removed in Python 3.0. @@ -272,7 +272,7 @@ pass elif mode in ('w', 'wb', 'a', 'ab'): # check filename : must begin with /tmp/ - if file[:5]!='/tmp/': + if file[:5]!='/tmp/': raise IOError, "can't write outside /tmp" elif (string.find(file, '/../') >= 0 or file[:3] == '../' or file[-3:] == '/..'): Modified: python/branches/release26-maint/Doc/library/rlcompleter.rst ============================================================================== --- python/branches/release26-maint/Doc/library/rlcompleter.rst (original) +++ python/branches/release26-maint/Doc/library/rlcompleter.rst Sat Jan 3 22:55:17 2009 @@ -61,6 +61,6 @@ If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`__getattr__`) up to the last part, and find matches for the rest via the - :func:`dir` function. Any exception raised during the evaluation of the + :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned. Modified: python/branches/release26-maint/Doc/library/robotparser.rst ============================================================================== --- python/branches/release26-maint/Doc/library/robotparser.rst (original) +++ python/branches/release26-maint/Doc/library/robotparser.rst Sat Jan 3 22:55:17 2009 @@ -13,7 +13,7 @@ single: World Wide Web single: URL single: robots.txt - + .. note:: The :mod:`robotparser` module has been renamed :mod:`urllib.robotparser` in Python 3.0. Modified: python/branches/release26-maint/Doc/library/sched.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sched.rst (original) +++ python/branches/release26-maint/Doc/library/sched.rst Sat Jan 3 22:55:17 2009 @@ -42,7 +42,7 @@ 930343700.276 In multi-threaded environments, the :class:`scheduler` class has limitations -with respect to thread-safety, inability to insert a new task before +with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the :class:`threading.Timer` class instead. @@ -58,8 +58,8 @@ ... print time.time() ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() - ... time.sleep(11) # sleep while time-delay events execute - ... print time.time() + ... time.sleep(11) # sleep while time-delay events execute + ... print time.time() ... >>> print_some_times() 930343690.257 Modified: python/branches/release26-maint/Doc/library/sgmllib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sgmllib.rst (original) +++ python/branches/release26-maint/Doc/library/sgmllib.rst Sat Jan 3 22:55:17 2009 @@ -4,7 +4,7 @@ .. module:: sgmllib :synopsis: Only as much of an SGML parser as needed to parse HTML. :deprecated: - + .. deprecated:: 2.6 The :mod:`sgmllib` module has been removed in Python 3.0. Modified: python/branches/release26-maint/Doc/library/shutil.rst ============================================================================== --- python/branches/release26-maint/Doc/library/shutil.rst (original) +++ python/branches/release26-maint/Doc/library/shutil.rst Sat Jan 3 22:55:17 2009 @@ -20,7 +20,7 @@ Even the higher-level file copying functions (:func:`copy`, :func:`copy2`) can't copy all file metadata. - + On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will @@ -124,7 +124,7 @@ error. Copy permissions and times of directories using :func:`copystat`. .. versionchanged:: 2.6 - Added the *ignore* argument to be able to influence what is being copied. + Added the *ignore* argument to be able to influence what is being copied. .. function:: rmtree(path[, ignore_errors[, onerror]]) @@ -189,7 +189,7 @@ os.makedirs(dst) errors = [] for name in names: - if name in ignored_names: + if name in ignored_names: continue srcname = os.path.join(src, name) dstname = os.path.join(dst, name) @@ -221,7 +221,7 @@ Another example that uses the :func:`ignore_patterns` helper:: from shutil import copytree, ignore_patterns - + copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*')) This will copy everything except ``.pyc`` files and files or directories whose @@ -231,7 +231,7 @@ from shutil import copytree import logging - + def _logpath(path, names): logging.info('Working in %s' % path) return [] # nothing will be ignored Modified: python/branches/release26-maint/Doc/library/signal.rst ============================================================================== --- python/branches/release26-maint/Doc/library/signal.rst (original) +++ python/branches/release26-maint/Doc/library/signal.rst Sat Jan 3 22:55:17 2009 @@ -39,12 +39,12 @@ * Some care must be taken if both signals and threads are used in the same program. The fundamental thing to remember in using signals and threads simultaneously is: always perform :func:`signal` operations in the main thread - of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, - :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread - can set a new signal handler, and the main thread will be the only one to - receive signals (this is enforced by the Python :mod:`signal` module, even - if the underlying thread implementation supports sending signals to - individual threads). This means that signals can't be used as a means of + of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, + :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread + can set a new signal handler, and the main thread will be the only one to + receive signals (this is enforced by the Python :mod:`signal` module, even + if the underlying thread implementation supports sending signals to + individual threads). This means that signals can't be used as a means of inter-thread communication. Use locks instead. The variables defined in the :mod:`signal` module are: @@ -80,22 +80,22 @@ One more than the number of the highest signal number. -.. data:: ITIMER_REAL +.. data:: ITIMER_REAL Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration. -.. data:: ITIMER_VIRTUAL +.. data:: ITIMER_VIRTUAL - Decrements interval timer only when the process is executing, and delivers + Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration. .. data:: ITIMER_PROF - - Decrements interval timer both when the process executes and when the - system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, - this timer is usually used to profile the time spent by the application + + Decrements interval timer both when the process executes and when the + system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, + this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration. @@ -105,7 +105,7 @@ Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid - interval timer or a negative time is passed to :func:`setitimer`. + interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`IOError`. @@ -143,21 +143,21 @@ .. function:: setitimer(which, seconds[, interval]) - Sets given interval timer (one of :const:`signal.ITIMER_REAL`, + Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified - by *which* to fire after *seconds* (float is accepted, different from + by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds. The interval timer specified by *which* can be cleared by setting seconds to zero. When an interval timer fires, a signal is sent to the process. - The signal sent is dependent on the timer being used; - :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, + The signal sent is dependent on the timer being used; + :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`. The old values are returned as a tuple: (delay, interval). - Attempting to pass an invalid interval timer will cause a + Attempting to pass an invalid interval timer will cause a :exc:`ItimerError`. .. versionadded:: 2.6 @@ -190,7 +190,7 @@ will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing. Availability: Unix (see the man page :manpage:`siginterrupt(3)` for further information). - + Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag* value for the given signal. @@ -239,7 +239,7 @@ signal.alarm(5) # This open() may hang indefinitely - fd = os.open('/dev/ttyS0', os.O_RDWR) + fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm Modified: python/branches/release26-maint/Doc/library/simplexmlrpcserver.rst ============================================================================== --- python/branches/release26-maint/Doc/library/simplexmlrpcserver.rst (original) +++ python/branches/release26-maint/Doc/library/simplexmlrpcserver.rst Sat Jan 3 22:55:17 2009 @@ -151,7 +151,7 @@ requestHandler=RequestHandler) server.register_introspection_functions() - # Register pow() function; this will use the value of + # Register pow() function; this will use the value of # pow.__name__ as the name, which is just 'pow'. server.register_function(pow) @@ -160,10 +160,10 @@ return x + y server.register_function(adder_function, 'add') - # Register an instance; all the methods of the instance are + # Register an instance; all the methods of the instance are # published as XML-RPC methods (in this case, just 'div'). class MyFuncs: - def div(self, x, y): + def div(self, x, y): return x // y server.register_instance(MyFuncs()) Modified: python/branches/release26-maint/Doc/library/smtplib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/smtplib.rst (original) +++ python/branches/release26-maint/Doc/library/smtplib.rst Sat Jan 3 22:55:17 2009 @@ -189,9 +189,9 @@ Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the - response for ESMTP option and store them for use by :meth:`has_extn`. - Also sets several informational attributes: the message returned by - the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` + response for ESMTP option and store them for use by :meth:`has_extn`. + Also sets several informational attributes: the message returned by + the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to true or false depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their @@ -207,7 +207,7 @@ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. - :exc:SMTPHeloError + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. .. versionadded:: 2.6 Modified: python/branches/release26-maint/Doc/library/socket.rst ============================================================================== --- python/branches/release26-maint/Doc/library/socket.rst (original) +++ python/branches/release26-maint/Doc/library/socket.rst Sat Jan 3 22:55:17 2009 @@ -184,10 +184,10 @@ .. data:: SIO_* RCVALL_* - + Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`ioctl` method of socket objects. - + .. versionadded:: 2.6 .. data:: TIPC_* @@ -222,7 +222,7 @@ all the necessary arguments for creating the corresponding socket. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. - The rest of the arguments are optional and must be numeric if specified. + The rest of the arguments are optional and must be numeric if specified. By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following @@ -588,14 +588,14 @@ contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as strings). - + .. method:: socket.ioctl(control, option) - :platform: Windows - + :platform: Windows + The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the MSDN documentation for more information. - + .. versionadded:: 2.6 @@ -852,20 +852,21 @@ HOST = None # Symbolic name meaning all available interfaces PORT = 50007 # Arbitrary non-privileged port s = None - for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE): + for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, + socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error, msg: - s = None - continue + s = None + continue try: - s.bind(sa) - s.listen(1) + s.bind(sa) + s.listen(1) except socket.error, msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print 'could not open socket' @@ -890,16 +891,16 @@ for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error, msg: - s = None - continue + s = None + continue try: - s.connect(sa) + s.connect(sa) except socket.error, msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print 'could not open socket' @@ -909,7 +910,7 @@ s.close() print 'Received', repr(data) - + The last example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface:: @@ -918,19 +919,19 @@ # the public network interface HOST = socket.gethostbyname(socket.gethostname()) - + # create a raw socket and bind it to the public interface s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) s.bind((HOST, 0)) - + # Include IP headers s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) - + # receive all packages s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) - + # receive a package print s.recvfrom(65565) - + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) 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 Sat Jan 3 22:55:17 2009 @@ -7,9 +7,9 @@ .. note:: - The :mod:`SocketServer` module has been renamed to `socketserver` in Python - 3.0. The :term:`2to3` tool will automatically adapt imports when converting - your sources to 3.0. + The :mod:`SocketServer` module has been renamed to :mod:`socketserver` in + Python 3.0. The :term:`2to3` tool will automatically adapt imports when + converting your sources to 3.0. The :mod:`SocketServer` module simplifies the task of writing network servers. Modified: python/branches/release26-maint/Doc/library/sqlite3.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sqlite3.rst (original) +++ python/branches/release26-maint/Doc/library/sqlite3.rst Sat Jan 3 22:55:17 2009 @@ -244,7 +244,7 @@ .. method:: Connection.rollback() - This method rolls back any changes to the database since the last call to + This method rolls back any changes to the database since the last call to :meth:`commit`. .. method:: Connection.close() @@ -487,29 +487,29 @@ .. literalinclude:: ../includes/sqlite3/executescript.py -.. method:: Cursor.fetchone() - +.. method:: Cursor.fetchone() + Fetches the next row of a query result set, returning a single sequence, or :const:`None` when no more data is available. .. method:: Cursor.fetchmany([size=cursor.arraysize]) - + Fetches the next set of rows of a query result, returning a list. An empty list is returned when no more rows are available. - + The number of rows to fetch per call is specified by the *size* parameter. If it is not given, the cursor's arraysize determines the number of rows to be fetched. The method should try to fetch as many rows as indicated by the size parameter. If this is not possible due to the specified number of rows not being available, fewer rows may be returned. - + Note there are performance considerations involved with the *size* parameter. For optimal performance, it is usually best to use the arraysize attribute. If the *size* parameter is used, then it is best for it to retain the same value from one :meth:`fetchmany` call to the next. - -.. method:: Cursor.fetchall() + +.. method:: Cursor.fetchall() Fetches all (remaining) rows of a query result, returning a list. Note that the cursor's arraysize attribute can affect the performance of this operation. @@ -546,8 +546,8 @@ This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each - column where the last six items of each tuple are :const:`None`. - + column where the last six items of each tuple are :const:`None`. + It is set for ``SELECT`` statements without any matching rows as well. .. _sqlite3-row-objects: @@ -558,7 +558,7 @@ .. class:: Row A :class:`Row` instance serves as a highly optimized - :attr:`~Connection.row_factory` for :class:`Connection` objects. + :attr:`~Connection.row_factory` for :class:`Connection` objects. It tries to mimic a tuple in most of its features. It supports mapping access by column name and index, iteration, @@ -566,7 +566,7 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - + .. versionchanged:: 2.6 Added iteration and equality (hashability). @@ -793,7 +793,7 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. +Data Modification Language (DML) statement (i.e. ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions implicitly before a non-DML, non-query statement (i. e. anything other than ``SELECT`` or the aforementioned). Modified: python/branches/release26-maint/Doc/library/ssl.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ssl.rst (original) +++ python/branches/release26-maint/Doc/library/ssl.rst Sat Jan 3 22:55:17 2009 @@ -48,7 +48,7 @@ .. exception:: SSLError - Raised to signal an error from the underlying SSL implementation. This + Raised to signal an error from the underlying SSL implementation. This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`socket.error`, which @@ -173,7 +173,7 @@ >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' - >>> + >>> .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None) @@ -385,7 +385,7 @@ the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, -that is, a certificate which has the same subject and issuer, +that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the @@ -422,13 +422,13 @@ you only need the root certificates, and the remote peer is supposed to furnish the other certificates necessary to chain from its certificate to a root certificate. -See :rfc:`4158` for more discussion of the way in which +See :rfc:`4158` for more discussion of the way in which certification chains can be built. If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, -such as buying one from a certification authority. Another common +such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following:: @@ -570,7 +570,7 @@ And go back to listening for new client connections. - + .. seealso:: Class :class:`socket.socket` Modified: python/branches/release26-maint/Doc/library/statvfs.rst ============================================================================== --- python/branches/release26-maint/Doc/library/statvfs.rst (original) +++ python/branches/release26-maint/Doc/library/statvfs.rst Sat Jan 3 22:55:17 2009 @@ -4,7 +4,7 @@ .. module:: statvfs :synopsis: Constants for interpreting the result of os.statvfs(). :deprecated: - + .. deprecated:: 2.6 The :mod:`statvfs` module has been deprecated for removal in Python 3.0. 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 Sat Jan 3 22:55:17 2009 @@ -360,9 +360,9 @@ though the result's type is not necessarily int. (6) - float also accepts the strings "nan" and "inf" with an optional prefix "+" + float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity. - + .. versionadded:: 2.6 (7) @@ -456,7 +456,7 @@ original float and with a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - + .. versionadded:: 2.6 Two methods support conversion to @@ -1176,7 +1176,7 @@ Return the numeric string left filled with zeros in a string of length *width*. A sign prefix is handled correctly. The original string is returned if *width* is less than ``len(s)``. - + .. versionadded:: 2.2.2 @@ -1188,7 +1188,7 @@ otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. - + .. method:: unicode.isdecimal() Return ``True`` if there are only decimal characters in S, ``False`` @@ -1865,7 +1865,7 @@ Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map. - .. versionadded:: 2.5 + .. versionadded:: 2.5 If a subclass of dict defines a method :meth:`__missing__`, if the key *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or @@ -2184,7 +2184,7 @@ positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). There is no return value. - + For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last. Modified: python/branches/release26-maint/Doc/library/string.rst ============================================================================== --- python/branches/release26-maint/Doc/library/string.rst (original) +++ python/branches/release26-maint/Doc/library/string.rst Sat Jan 3 22:55:17 2009 @@ -126,7 +126,7 @@ :meth:`format` is just a wrapper that calls :meth:`vformat`. .. method:: vformat(format_string, args, kwargs) - + This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the @@ -139,12 +139,12 @@ intended to be replaced by subclasses: .. method:: parse(format_string) - + Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string in to either literal text, or replacement fields. - + The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then @@ -162,7 +162,7 @@ *key* parameter to :meth:`get_value`. .. method:: get_value(key, args, kwargs) - + Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a @@ -200,7 +200,7 @@ method is provided so that subclasses can override it. .. method:: convert_field(value, conversion) - + Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method.) The default version understands 'r' (repr) and 's' (str) conversion types. @@ -229,7 +229,7 @@ element_index: `integer` conversion: "r" | "s" format_spec: - + In less formal terms, the replacement field starts with a *field_name*, which can either be a number (for a positional argument), or an identifier (for keyword arguments). Following this is an optional *conversion* field, which is @@ -249,7 +249,7 @@ "My quest is {name}" # References keyword argument 'name' "Weight in tons {0.weight}" # 'weight' attribute of first positional arg "Units destroyed: {players[0]}" # First element of keyword argument 'players'. - + The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted @@ -292,11 +292,11 @@ Then the outer replacement field would be evaluated, producing:: "noses " - + Which is substituted into the string, yielding:: - + "A man with two noses " - + (The extra space is because we specified a field width of 10, and because left alignment is the default for strings.) @@ -328,7 +328,7 @@ width: `integer` precision: `integer` type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - + The *fill* character can be any character other than '}' (which signifies the end of the field). The presence of a fill character is signaled by the *next* character, which must be one of the alignment options. If the second character @@ -421,9 +421,9 @@ +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ - + The available presentation types for floating point and decimal values are: - + +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ Modified: python/branches/release26-maint/Doc/library/stringio.rst ============================================================================== --- python/branches/release26-maint/Doc/library/stringio.rst (original) +++ python/branches/release26-maint/Doc/library/stringio.rst Sat Jan 3 22:55:17 2009 @@ -52,7 +52,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() @@ -81,7 +81,7 @@ Calling :func:`StringIO` with a Unicode string parameter populates the object with the buffer representation of the Unicode string, instead of -encoding the string. +encoding the string. Another difference from the :mod:`StringIO` module is that calling :func:`StringIO` with a string parameter creates a read-only object. Unlike an @@ -118,7 +118,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() Modified: python/branches/release26-maint/Doc/library/subprocess.rst ============================================================================== --- python/branches/release26-maint/Doc/library/subprocess.rst (original) +++ python/branches/release26-maint/Doc/library/subprocess.rst Sat Jan 3 22:55:17 2009 @@ -131,7 +131,7 @@ Special value that can be used as the *stderr* argument to :class:`Popen` and indicates that standard error should go into the same handle as standard output. - + Convenience Functions ^^^^^^^^^^^^^^^^^^^^^ @@ -302,7 +302,7 @@ The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly by :meth:`communicate`). A ``None`` value indicates that the process hasn't terminated yet. - + A negative value ``-N`` indicates that the child was terminated by signal ``N`` (Unix only). Modified: python/branches/release26-maint/Doc/library/sunaudio.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sunaudio.rst (original) +++ python/branches/release26-maint/Doc/library/sunaudio.rst Sat Jan 3 22:55:17 2009 @@ -6,7 +6,7 @@ :platform: SunOS :synopsis: Access to Sun audio hardware. :deprecated: - + .. deprecated:: 2.6 The :mod:`sunaudiodev` module has been deprecated for removal in Python 3.0. @@ -151,7 +151,7 @@ :platform: SunOS :synopsis: Constants for use with sunaudiodev. :deprecated: - + .. deprecated:: 2.6 The :mod:`SUNAUDIODEV` module has been deprecated for removal in Python 3.0. Modified: python/branches/release26-maint/Doc/library/sys.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sys.rst (original) +++ python/branches/release26-maint/Doc/library/sys.rst Sat Jan 3 22:55:17 2009 @@ -402,7 +402,7 @@ The *default* argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would - cause a `TypeError`. + cause a `TypeError`. func:`getsizeof` calls the object's __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. @@ -731,7 +731,7 @@ The events have the following meaning: - ``'call'`` + ``'call'`` A function is called (or some other code block entered). The global trace function is called; *arg* is ``None``; the return value specifies the local trace function. @@ -799,7 +799,7 @@ prompts of :func:`input` and :func:`raw_input`. The interpreter's own prompts and (almost all of) its error messages go to ``stderr``. ``stdout`` and ``stderr`` needn't be built-in file objects: any object is acceptable as long - as it has a :meth:`write` method that takes a string argument. (Changing these + as it has a :meth:`write` method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) Modified: python/branches/release26-maint/Doc/library/tempfile.rst ============================================================================== --- python/branches/release26-maint/Doc/library/tempfile.rst (original) +++ python/branches/release26-maint/Doc/library/tempfile.rst Sat Jan 3 22:55:17 2009 @@ -164,11 +164,11 @@ .. warning:: - Use of this function may introduce a security hole in your program. - By the time you get around to doing anything with the file name it - returns, someone else may have beaten you to the punch. - :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + Use of this function may introduce a security hole in your program. By + the time you get around to doing anything with the file name it returns, + someone else may have beaten you to the punch. :func:`mktemp` usage can + be replaced easily with :func:`NamedTemporaryFile`, passing it the + ``delete=False`` parameter:: >>> f = NamedTemporaryFile(delete=False) >>> f Modified: python/branches/release26-maint/Doc/library/tk.rst ============================================================================== --- python/branches/release26-maint/Doc/library/tk.rst (original) +++ python/branches/release26-maint/Doc/library/tk.rst Sat Jan 3 22:55:17 2009 @@ -22,15 +22,15 @@ mechanism which allows Python and Tcl to interact. :mod:`Tkinter`'s chief virtues are that it is fast, and that it usually comes -bundled with Python. Although its standard documentation is weak, good -material is available, which includes: references, tutorials, a book and -others. :mod:`Tkinter` is also famous for having an outdated look and feel, -which has been vastly improved in Tk 8.5. Nevertheless, there are many other -GUI libraries that you could be interested in. For more information about +bundled with Python. Although its standard documentation is weak, good +material is available, which includes: references, tutorials, a book and +others. :mod:`Tkinter` is also famous for having an outdated look and feel, +which has been vastly improved in Tk 8.5. Nevertheless, there are many other +GUI libraries that you could be interested in. For more information about alternatives, see the :ref:`other-gui-packages` section. .. toctree:: - + tkinter.rst tix.rst scrolledtext.rst Modified: python/branches/release26-maint/Doc/library/tkinter.rst ============================================================================== --- python/branches/release26-maint/Doc/library/tkinter.rst (original) +++ python/branches/release26-maint/Doc/library/tkinter.rst Sat Jan 3 22:55:17 2009 @@ -284,7 +284,7 @@ someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say:: - .fred someAction someOptions + .fred someAction someOptions Note that the object name, ``.fred``, starts with a dot. @@ -490,7 +490,7 @@ For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout's book. -anchor +anchor Anchor type. Denotes where the packer is to place each slave in its parcel. expand @@ -720,7 +720,7 @@ they are denoted in Tk, which can be useful when referring to the Tk man pages. :: - Tk Tkinter Event Field Tk Tkinter Event Field + Tk Tkinter Event Field Tk Tkinter Event Field -- ------------------- -- ------------------- %f focus %A char %h height %E send_event Modified: python/branches/release26-maint/Doc/library/trace.rst ============================================================================== --- python/branches/release26-maint/Doc/library/trace.rst (original) +++ python/branches/release26-maint/Doc/library/trace.rst Sat Jan 3 22:55:17 2009 @@ -65,13 +65,13 @@ :option:`--ignore-module` Accepts comma separated list of module names. Ignore each of the named - module and its submodules (if it is a package). May be given + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` Ignore all modules and packages in the named directory and subdirectories (multiple directories can be joined by os.pathsep). May be given multiple - times. + times. .. _trace-api: Modified: python/branches/release26-maint/Doc/library/traceback.rst ============================================================================== --- python/branches/release26-maint/Doc/library/traceback.rst (original) +++ python/branches/release26-maint/Doc/library/traceback.rst Sat Jan 3 22:55:17 2009 @@ -169,10 +169,10 @@ def lumberjack(): bright_side_of_death() - + def bright_side_of_death(): return tuple()[0] - + try: lumberjack() except: @@ -251,12 +251,12 @@ >>> import traceback >>> def another_function(): ... lumberstack() - ... + ... >>> def lumberstack(): ... traceback.print_stack() ... print repr(traceback.extract_stack()) ... print repr(traceback.format_stack()) - ... + ... >>> another_function() File "", line 10, in another_function() Modified: python/branches/release26-maint/Doc/library/turtle.rst ============================================================================== --- python/branches/release26-maint/Doc/library/turtle.rst (original) +++ python/branches/release26-maint/Doc/library/turtle.rst Sat Jan 3 22:55:17 2009 @@ -1587,7 +1587,7 @@ Subclass of TurtleScreen, with :ref:`four methods added `. - + .. class:: ScrolledCavas(master) :param master: some Tkinter widget to contain the ScrolledCanvas, i.e. @@ -1612,13 +1612,13 @@ "compound" ``None`` (a compund shape has to be constructed using the :meth:`addcomponent` method) =========== =========== - + .. method:: addcomponent(poly, fill, outline=None) :param poly: a polygon, i.e. a tuple of pairs of numbers :param fill: a color the *poly* will be filled with :param outline: a color for the poly's outline (if given) - + Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1662,31 +1662,31 @@ >>> help(Screen.bgcolor) Help on method bgcolor in module turtle: - + bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - - + + >>> screen.bgcolor("orange") >>> screen.bgcolor() "orange" >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() "#800080" - + >>> help(Turtle.penup) Help on method penup in module turtle: - + penup(self) unbound turtle.Turtle method Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + >>> turtle.penup() - The docstrings of the functions which are derived from methods have a modified @@ -1694,32 +1694,32 @@ >>> help(bgcolor) Help on function bgcolor in module turtle: - + bgcolor(*args) Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - + Example:: - + >>> bgcolor("orange") >>> bgcolor() "orange" >>> bgcolor(0.5,0,0.5) >>> bgcolor() "#800080" - + >>> help(penup) Help on function penup in module turtle: - + penup() Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + Example: >>> penup() Modified: python/branches/release26-maint/Doc/library/undoc.rst ============================================================================== --- python/branches/release26-maint/Doc/library/undoc.rst (original) +++ python/branches/release26-maint/Doc/library/undoc.rst Sat Jan 3 22:55:17 2009 @@ -21,7 +21,7 @@ :mod:`ihooks` --- Import hook support (for :mod:`rexec`; may become obsolete). - + .. warning:: The :mod:`ihooks` module has been removed in Python 3.0. @@ -54,7 +54,7 @@ :mod:`linuxaudiodev` --- Play audio data on the Linux audio device. Replaced in Python 2.3 by the :mod:`ossaudiodev` module. - + .. warning:: The :mod:`linuxaudiodev` module has been removed in Python 3.0. :mod:`sunaudio` @@ -240,7 +240,7 @@ :mod:`timing` --- Measure time intervals to high resolution (use :func:`time.clock` instead). - + .. warning:: The :mod:`timing` module has been removed in Python 3.0. @@ -255,6 +255,6 @@ :mod:`sv` --- Interface to the "simple video" board on SGI Indigo (obsolete hardware). - + .. warning:: The :mod:`sv` module has been removed in Python 3.0. Modified: python/branches/release26-maint/Doc/library/unicodedata.rst ============================================================================== --- python/branches/release26-maint/Doc/library/unicodedata.rst (original) +++ python/branches/release26-maint/Doc/library/unicodedata.rst Sat Jan 3 22:55:17 2009 @@ -164,7 +164,7 @@ File "", line 1, in ? ValueError: not a decimal >>> unicodedata.category(u'A') # 'L'etter, 'u'ppercase - 'Lu' + 'Lu' >>> unicodedata.bidirectional(u'\u0660') # 'A'rabic, 'N'umber 'AN' Modified: python/branches/release26-maint/Doc/library/unittest.rst ============================================================================== --- python/branches/release26-maint/Doc/library/unittest.rst (original) +++ python/branches/release26-maint/Doc/library/unittest.rst Sat Jan 3 22:55:17 2009 @@ -595,7 +595,7 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare @@ -606,7 +606,7 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare Modified: python/branches/release26-maint/Doc/library/urllib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/urllib.rst (original) +++ python/branches/release26-maint/Doc/library/urllib.rst Sat Jan 3 22:55:17 2009 @@ -123,7 +123,7 @@ .. versionchanged:: 2.6 Added :meth:`getcode` to returned object and support for the :envvar:`no_proxy` environment variable. - + .. deprecated:: 2.6 The :func:`urlopen` function has been removed in Python 3.0 in favor of :func:`urllib2.urlopen`. 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 Sat Jan 3 22:55:17 2009 @@ -109,7 +109,7 @@ .. attribute:: code - An HTTP status code as defined in `RFC 2616 `_. + An HTTP status code as defined in `RFC 2616 `_. This numeric value corresponds to a value found in the dictionary of codes as found in :attr:`BaseHTTPServer.BaseHTTPRequestHandler.responses`. Modified: python/branches/release26-maint/Doc/library/urlparse.rst ============================================================================== --- python/branches/release26-maint/Doc/library/urlparse.rst (original) +++ python/branches/release26-maint/Doc/library/urlparse.rst Sat Jan 3 22:55:17 2009 @@ -290,7 +290,7 @@ .. versionadded:: 2.5 -The following classes provide the implementations of the parse results:: +The following classes provide the implementations of the parse results: .. class:: BaseResult Modified: python/branches/release26-maint/Doc/library/warnings.rst ============================================================================== --- python/branches/release26-maint/Doc/library/warnings.rst (original) +++ python/branches/release26-maint/Doc/library/warnings.rst Sat Jan 3 22:55:17 2009 @@ -274,7 +274,7 @@ .. function:: warnpy3k(message[, category[, stacklevel]]) - Issue a warning related to Python 3.x deprecation. Warnings are only shown + Issue a warning related to Python 3.x deprecation. Warnings are only shown when Python is started with the -3 option. Like :func:`warn` *message* must be a string and *category* a subclass of :exc:`Warning`. :func:`warnpy3k` is using :exc:`DeprecationWarning` as default warning class. @@ -288,7 +288,7 @@ this function with an alternative implementation by assigning to ``warnings.showwarning``. *line* is a line of source code to be included in the warning - message; if *line* is not supplied, :func:`showwarning` will + message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. versionchanged:: 2.6 @@ -299,8 +299,8 @@ .. function:: formatwarning(message, category, filename, lineno[, line]) Format a warning the standard way. This returns a string which may contain - embedded newlines and ends in a newline. *line* is - a line of source code to be included in the warning message; if *line* is not supplied, + embedded newlines and ends in a newline. *line* is + a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. .. versionchanged:: 2.6 Modified: python/branches/release26-maint/Doc/library/webbrowser.rst ============================================================================== --- python/branches/release26-maint/Doc/library/webbrowser.rst (original) +++ python/branches/release26-maint/Doc/library/webbrowser.rst Sat Jan 3 22:55:17 2009 @@ -160,7 +160,7 @@ url = 'http://www.python.org' - # Open URL in a new tab, if a browser window is already open. + # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(url + '/doc') # Open URL in new window, raising the window if possible. Modified: python/branches/release26-maint/Doc/library/wsgiref.rst ============================================================================== --- python/branches/release26-maint/Doc/library/wsgiref.rst (original) +++ python/branches/release26-maint/Doc/library/wsgiref.rst Sat Jan 3 22:55:17 2009 @@ -170,7 +170,7 @@ filelike = StringIO("This is an example file-like object"*10) wrapper = FileWrapper(filelike, blksize=5) - for chunk in wrapper: + for chunk in wrapper: print chunk @@ -415,7 +415,7 @@ from wsgiref.validate import validator from wsgiref.simple_server import make_server - # Our callable object which is intentionally not compliant to the + # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): status = '200 OK' # HTTP Status 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 Sat Jan 3 22:55:17 2009 @@ -34,7 +34,7 @@ A C implementation of this API is available as :mod:`xml.etree.cElementTree`. See http://effbot.org/zone/element-index.htm for tutorials and links to other -docs. Fredrik Lundh's page is also the location of the development version of the +docs. Fredrik Lundh's page is also the location of the development version of the xml.etree.ElementTree. .. _elementtree-functions: @@ -379,7 +379,7 @@ Example page -

Moved to example.org +

Moved to example.org or example.com.

@@ -486,9 +486,9 @@ :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method for each opening tag, its :meth:`end` method for each closing tag, -and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` -calls *target*\'s method :meth:`close`. -:class:`XMLTreeBuilder` can be used not only for building a tree structure. +and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` +calls *target*\'s method :meth:`close`. +:class:`XMLTreeBuilder` can be used not only for building a tree structure. This is an example of counting the maximum depth of an XML file:: >>> from xml.etree.ElementTree import XMLTreeBuilder @@ -496,16 +496,16 @@ ... maxDepth = 0 ... depth = 0 ... def start(self, tag, attrib): # Called for each opening tag. - ... self.depth += 1 + ... self.depth += 1 ... if self.depth > self.maxDepth: ... self.maxDepth = self.depth ... def end(self, tag): # Called for each closing tag. ... self.depth -= 1 - ... def data(self, data): + ... def data(self, data): ... pass # We do not need to do anything with data. ... def close(self): # Called when all data has been parsed. ... return self.maxDepth - ... + ... >>> target = MaxDepth() >>> parser = XMLTreeBuilder(target=target) >>> exampleXml = """ 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 Sat Jan 3 22:55:17 2009 @@ -560,8 +560,8 @@ self.proxy = proxy def make_connection(self, host): self.realhost = host - h = httplib.HTTP(self.proxy) - return h + h = httplib.HTTP(self.proxy) + return h def send_request(self, connection, handler, request_body): connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) def send_host(self, connection, host): Modified: python/branches/release26-maint/Doc/library/zipfile.rst ============================================================================== --- python/branches/release26-maint/Doc/library/zipfile.rst (original) +++ python/branches/release26-maint/Doc/library/zipfile.rst Sat Jan 3 22:55:17 2009 @@ -200,7 +200,7 @@ .. method:: ZipFile.extractall([path[, members[, pwd]]]) - Extract all members from the archive to the current working directory. *path* + Extract all members from the archive to the current working directory. *path* specifies a different directory to extract to. *members* is optional and must be a subset of the list returned by :meth:`namelist`. *pwd* is the password used for encrypted files. @@ -280,9 +280,9 @@ .. note:: - When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, - the compression method used will be that specified in the *compress_type* - member of the given :class:`ZipInfo` instance. By default, the + When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, + the compression method used will be that specified in the *compress_type* + member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. The following data attributes are also available: @@ -296,9 +296,9 @@ .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a - :class:`ZipFile` instance created with mode 'a' or 'w', this should be a - string no longer than 65535 bytes. Comments longer than this will be + The comment text associated with the ZIP file. If assigning a comment to a + :class:`ZipFile` instance created with mode 'a' or 'w', this should be a + string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when :meth:`ZipFile.close` is called. .. _pyzipfile-objects: @@ -327,10 +327,10 @@ internal use only. The :meth:`writepy` method makes archives with file names like this:: - string.pyc # Top level name - test/__init__.pyc # Package directory + string.pyc # Top level name + test/__init__.pyc # Package directory test/test_support.pyc # Module test.test_support - test/bogus/__init__.pyc # Subpackage directory + test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile Modified: python/branches/release26-maint/Doc/library/zipimport.rst ============================================================================== --- python/branches/release26-maint/Doc/library/zipimport.rst (original) +++ python/branches/release26-maint/Doc/library/zipimport.rst Sat Jan 3 22:55:17 2009 @@ -148,7 +148,7 @@ -------- ------- 8467 1 file $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading Modified: python/branches/release26-maint/Doc/license.rst ============================================================================== --- python/branches/release26-maint/Doc/license.rst (original) +++ python/branches/release26-maint/Doc/license.rst Sat Jan 3 22:55:17 2009 @@ -124,7 +124,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ? 2001-2008 Python Software Foundation; All Rights + copyright, i.e., "Copyright ? 2001-2009 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. @@ -386,8 +386,8 @@ The source for the :mod:`fpectl` module includes the following notice:: - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -419,7 +419,7 @@ | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / + \ endorsement purposes. / --------------------------------------------------------------------- @@ -453,7 +453,7 @@ This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at - http://www.ietf.org/rfc/rfc1321.txt + http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being @@ -464,12 +464,12 @@ that follows (in reverse chronological order): 2002-04-13 lpd Removed support for non-ANSI compilers; removed - references to Ghostscript; clarified derivation from RFC 1321; - now handles byte order either statically or dynamically. + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); - added conditionalization for C++ compilation from Martin - Purschke . + added conditionalization for C++ compilation from Martin + Purschke . 1999-05-03 lpd Original version. 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 Sat Jan 3 22:55:17 2009 @@ -560,7 +560,7 @@ .. productionlist:: slicing: `simple_slicing` | `extended_slicing` simple_slicing: `primary` "[" `short_slice` "]" - extended_slicing: `primary` "[" `slice_list` "]" + extended_slicing: `primary` "[" `slice_list` "]" slice_list: `slice_item` ("," `slice_item`)* [","] slice_item: `expression` | `proper_slice` | `ellipsis` proper_slice: `short_slice` | `long_slice` @@ -664,7 +664,7 @@ the call. .. note:: - + An implementation may provide builtin functions whose positional parameters do not have names, even if they are 'named' for the purpose of documentation, and which therefore cannot be supplied by keyword. In CPython, this is the case for @@ -1321,7 +1321,7 @@ .. rubric:: Footnotes .. [#] In Python 2.3 and later releases, a list comprehension "leaks" the control - variables of each ``for`` it contains into the containing scope. However, this + variables of each ``for`` it contains into the containing scope. However, this behavior is deprecated, and relying on it will not work in Python 3.0 .. [#] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be @@ -1354,7 +1354,7 @@ only, but this caused surprises because people expected to be able to test a dictionary for emptiness by comparing it to ``{}``. -.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of +.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 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. Modified: python/branches/release26-maint/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/lexical_analysis.rst (original) +++ python/branches/release26-maint/Doc/reference/lexical_analysis.rst Sat Jan 3 22:55:17 2009 @@ -341,13 +341,13 @@ language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:: - and del from not while - as elif global or with - assert else if pass yield - break except import print - class exec in raise - continue finally is return - def for lambda try + and del from not while + as elif global or with + assert else if pass yield + break except import print + class exec in raise + continue finally is return + def for lambda try .. versionchanged:: 2.4 :const:`None` became a constant and is now recognized by the compiler as a name @@ -654,7 +654,7 @@ 7 2147483647 0177 3L 79228162514264337593543950336L 0377L 0x100000000L - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: @@ -701,7 +701,7 @@ part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of imaginary literals:: - 3.14j 10.j 10j .001j 1e100j 3.14e-10j + 3.14j 10.j 10j .001j 1e100j 3.14e-10j .. _operators: 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 Sat Jan 3 22:55:17 2009 @@ -745,7 +745,7 @@ searched inside the package. A package is generally a subdirectory of a directory on ``sys.path`` that has a file :file:`__init__.py`. -.. +.. [XXX Can't be bothered to spell this out right now; see the URL http://www.python.org/doc/essays/packages.html for more details, also about how Added: python/branches/release26-maint/Doc/tools/rstlint.py ============================================================================== --- (empty file) +++ python/branches/release26-maint/Doc/tools/rstlint.py Sat Jan 3 22:55:17 2009 @@ -0,0 +1,230 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Check for stylistic and formal issues in .rst and .py +# files included in the documentation. +# +# 01/2009, Georg Brandl + +from __future__ import with_statement + +import os +import re +import sys +import getopt +import subprocess +from os.path import join, splitext, abspath, exists +from collections import defaultdict + +directives = [ + # standard docutils ones + 'admonition', 'attention', 'caution', 'class', 'compound', 'container', + 'contents', 'csv-table', 'danger', 'date', 'default-role', 'epigraph', + 'error', 'figure', 'footer', 'header', 'highlights', 'hint', 'image', + 'important', 'include', 'line-block', 'list-table', 'meta', 'note', + 'parsed-literal', 'pull-quote', 'raw', 'replace', + 'restructuredtext-test-directive', 'role', 'rubric', 'sectnum', 'sidebar', + 'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning', + # Sphinx custom ones + 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', + 'autoexception', 'autofunction', 'automethod', 'automodule', 'centered', + 'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember', + 'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar', + 'data', 'deprecated', 'describe', 'directive', 'doctest', 'envvar', 'event', + 'exception', 'function', 'glossary', 'highlight', 'highlightlang', 'index', + 'literalinclude', 'method', 'module', 'moduleauthor', 'productionlist', + 'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod', + 'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo', + 'todolist', 'versionadded', 'versionchanged' +] + +all_directives = '(' + '|'.join(directives) + ')' +seems_directive_re = re.compile(r'\.\. %s([^a-z:]|:(?!:))' % all_directives) +default_role_re = re.compile(r'(^| )`\w([^`]*?\w)?`($| )') +leaked_markup_re = re.compile(r'[a-z]::[^=]|:[a-z]+:|`|\.\.\s*\w+:') + + +checkers = {} + +checker_props = {'severity': 1, 'falsepositives': False} + +def checker(*suffixes, **kwds): + """Decorator to register a function as a checker.""" + def deco(func): + for suffix in suffixes: + checkers.setdefault(suffix, []).append(func) + for prop in checker_props: + setattr(func, prop, kwds.get(prop, checker_props[prop])) + return func + return deco + + + at checker('.py', severity=4) +def check_syntax(fn, lines): + """Check Python examples for valid syntax.""" + try: + code = ''.join(lines) + if '\r' in code: + if os.name != 'nt': + yield 0, '\\r in code file' + code = code.replace('\r', '') + compile(code, fn, 'exec') + except SyntaxError, err: + yield err.lineno, 'not compilable: %s' % err + + + at checker('.rst', severity=2) +def check_suspicious_constructs(fn, lines): + """Check for suspicious reST constructs.""" + inprod = False + for lno, line in enumerate(lines): + if seems_directive_re.match(line): + yield lno+1, 'comment seems to be intended as a directive' + if '.. productionlist::' in line: + inprod = True + elif not inprod and default_role_re.search(line): + yield lno+1, 'default role used' + elif inprod and not line.strip(): + inprod = False + + + at checker('.py', '.rst') +def check_whitespace(fn, lines): + """Check for whitespace and line length issues.""" + for lno, line in enumerate(lines): + if '\r' in line: + yield lno+1, '\\r in line' + if '\t' in line: + yield lno+1, 'OMG TABS!!!1' + if line[:-1].rstrip(' \t') != line[:-1]: + yield lno+1, 'trailing whitespace' + + + at checker('.rst', severity=0) +def check_line_length(fn, lines): + """Check for line length; this checker is not run by default.""" + for lno, line in enumerate(lines): + if len(line) > 81: + # don't complain about tables, links and function signatures + if line.lstrip()[0] not in '+|' and \ + 'http://' not in line and \ + not line.lstrip().startswith(('.. function', + '.. method', + '.. cfunction')): + yield lno+1, "line too long" + + + at checker('.html', severity=2, falsepositives=True) +def check_leaked_markup(fn, lines): + """Check HTML files for leaked reST markup; this only works if + the HTML files have been built. + """ + for lno, line in enumerate(lines): + if leaked_markup_re.search(line): + yield lno+1, 'possibly leaked markup: %r' % line + + +def main(argv): + usage = '''\ +Usage: %s [-v] [-f] [-s sev] [-i path]* [path] + +Options: -v verbose (print all checked file names) + -f enable checkers that yield many false positives + -s sev only show problems with severity >= sev + -i path ignore subdir or file path +''' % argv[0] + try: + gopts, args = getopt.getopt(argv[1:], 'vfs:i:') + except getopt.GetoptError: + print usage + return 2 + + verbose = False + severity = 1 + ignore = [] + falsepos = False + for opt, val in gopts: + if opt == '-v': + verbose = True + elif opt == '-f': + falsepos = True + elif opt == '-s': + severity = int(val) + elif opt == '-i': + ignore.append(abspath(val)) + + if len(args) == 0: + path = '.' + elif len(args) == 1: + path = args[0] + else: + print usage + return 2 + + if not exists(path): + print 'Error: path %s does not exist' % path + return 2 + + count = defaultdict(int) + out = sys.stdout + + for root, dirs, files in os.walk(path): + # ignore subdirs controlled by svn + if '.svn' in dirs: + dirs.remove('.svn') + + # ignore subdirs in ignore list + if abspath(root) in ignore: + del dirs[:] + continue + + for fn in files: + fn = join(root, fn) + if fn[:2] == './': + fn = fn[2:] + + # ignore files in ignore list + if abspath(fn) in ignore: + continue + + ext = splitext(fn)[1] + checkerlist = checkers.get(ext, None) + if not checkerlist: + continue + + if verbose: + print 'Checking %s...' % fn + + try: + with open(fn, 'r') as f: + lines = list(f) + except (IOError, OSError), err: + print '%s: cannot open: %s' % (fn, err) + count[4] += 1 + continue + + for checker in checkerlist: + if checker.falsepositives and not falsepos: + continue + csev = checker.severity + if csev >= severity: + for lno, msg in checker(fn, lines): + print >>out, '[%d] %s:%d: %s' % (csev, fn, lno, msg) + count[csev] += 1 + if verbose: + print + if not count: + if severity > 1: + print 'No problems with severity >= %d found.' % severity + else: + print 'No problems found.' + else: + for severity in sorted(count): + number = count[severity] + print '%d problem%s with severity %d found.' % \ + (number, number > 1 and 's' or '', severity) + return int(bool(count)) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) Modified: python/branches/release26-maint/Doc/tutorial/classes.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/classes.rst (original) +++ python/branches/release26-maint/Doc/tutorial/classes.rst Sat Jan 3 22:55:17 2009 @@ -250,7 +250,7 @@ ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -481,7 +481,7 @@ ``issubclass(unicode, str)`` is ``False`` since :class:`unicode` is not a subclass of :class:`str` (they only share a common ancestor, :class:`basestring`). - + .. _tut-multiple: @@ -743,7 +743,7 @@ f l o - g + g Anything that can be done with generators can also be done with class based iterators as described in the previous section. What makes generators so Modified: python/branches/release26-maint/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/controlflow.rst (original) +++ python/branches/release26-maint/Doc/tutorial/controlflow.rst Sat Jan 3 22:55:17 2009 @@ -62,7 +62,7 @@ ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print x, len(x) - ... + ... cat 3 window 6 defenestrate 12 @@ -75,7 +75,7 @@ >>> for x in a[:]: # make a slice copy of the entire list ... if len(x) > 6: a.insert(0, x) - ... + ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] @@ -110,7 +110,7 @@ >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print i, a[i] - ... + ... 0 Mary 1 had 2 a @@ -146,7 +146,7 @@ ... else: ... # loop fell through without finding a factor ... print n, 'is a prime number' - ... + ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 @@ -167,7 +167,7 @@ >>> while True: ... pass # Busy-wait for keyboard interrupt (Ctrl+C) - ... + ... This is commonly used for creating minimal classes:: @@ -181,7 +181,7 @@ >>> def initlog(*args): ... pass # Remember to implement this! - ... + ... .. _tut-functions: @@ -197,7 +197,7 @@ ... while b < n: ... print b, ... a, b = b, a+b - ... + ... >>> # Now call the function we just defined: ... fib(2000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 @@ -268,7 +268,7 @@ ... result.append(b) # see below ... a, b = b, a+b ... return result - ... + ... >>> f100 = fib2(100) # call it >>> f100 # write the result [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -403,7 +403,7 @@ >>> def function(a): ... pass - ... + ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in ? @@ -456,7 +456,7 @@ ------------------------ .. index:: - statement: * + statement: * Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -565,11 +565,11 @@ >>> def my_function(): ... """Do nothing, but document it. - ... + ... ... No, really, it doesn't do anything. ... """ ... pass - ... + ... >>> print my_function.__doc__ Do nothing, but document it. Modified: python/branches/release26-maint/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/datastructures.rst (original) +++ python/branches/release26-maint/Doc/tutorial/datastructures.rst Sat Jan 3 22:55:17 2009 @@ -214,7 +214,7 @@ >>> def sum(seq): ... def add(x,y): return x+y ... return reduce(add, seq, 0) - ... + ... >>> sum(range(1, 11)) 55 >>> sum([]) @@ -251,7 +251,7 @@ [] >>> [[x,x**2] for x in vec] [[2, 4], [4, 16], [6, 36]] - >>> [x, x**2 for x in vec] # error - parens required for tuples + >>> [x, x**2 for x in vec] # error - parens required for tuples File "", line 1, in ? [x, x**2 for x in vec] ^ @@ -281,7 +281,7 @@ powerful tool but -- like all powerful tools -- they need to be used carefully, if at all. -Consider the following example of a 3x3 matrix held as a list containing three +Consider the following example of a 3x3 matrix held as a list containing three lists, one list per row:: >>> mat = [ @@ -290,7 +290,7 @@ ... [7, 8, 9], ... ] -Now, if you wanted to swap rows and columns, you could use a list +Now, if you wanted to swap rows and columns, you could use a list comprehension:: >>> print [[row[i] for row in mat] for i in [0, 1, 2]] @@ -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 builtin functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> zip(*mat) @@ -551,7 +551,7 @@ >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print 'What is your {0}? It is {1}.'.format(q, a) - ... + ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. @@ -574,7 +574,7 @@ >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print f - ... + ... apple banana orange Modified: python/branches/release26-maint/Doc/tutorial/errors.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/errors.rst (original) +++ python/branches/release26-maint/Doc/tutorial/errors.rst Sat Jan 3 22:55:17 2009 @@ -91,7 +91,7 @@ ... break ... except ValueError: ... print "Oops! That was no valid number. Try again..." - ... + ... The :keyword:`try` statement works as follows. @@ -199,12 +199,12 @@ >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as detail: ... print 'Handling run-time error:', detail - ... + ... Handling run-time error: integer division or modulo by zero @@ -256,12 +256,12 @@ ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print 'My exception occurred, value:', e.value - ... + ... My exception occurred, value: 4 >>> raise MyError, 'oops!' Traceback (most recent call last): @@ -331,7 +331,7 @@ ... raise KeyboardInterrupt ... finally: ... print 'Goodbye, world!' - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? Modified: python/branches/release26-maint/Doc/tutorial/index.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/index.rst (original) +++ python/branches/release26-maint/Doc/tutorial/index.rst Sat Jan 3 22:55:17 2009 @@ -1,7 +1,7 @@ .. _tutorial-index: ###################### - The Python Tutorial + The Python Tutorial ###################### :Release: |version| Modified: python/branches/release26-maint/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/inputoutput.rst (original) +++ python/branches/release26-maint/Doc/tutorial/inputoutput.rst Sat Jan 3 22:55:17 2009 @@ -87,7 +87,7 @@ >>> for x in range(1,11): ... print '{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x) - ... + ... 1 1 1 2 4 8 3 9 27 @@ -148,7 +148,7 @@ ... other='Georg') The story of Bill, Manfred, and Georg. -An optional ``':``` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This also greater control over how the value is formatted. The following example truncates the Pi to three places after the decimal. @@ -162,7 +162,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): ... print '{0:10} ==> {1:10d}'.format(name, phone) - ... + ... Jack ==> 4098 Dcab ==> 7678 Sjoerd ==> 4127 @@ -330,7 +330,7 @@ >>> f = open('/tmp/workfile', 'r+') >>> f.write('0123456789abcdef') >>> f.seek(5) # Go to the 6th byte in the file - >>> f.read(1) + >>> f.read(1) '5' >>> f.seek(-3, 2) # Go to the 3rd byte before the end >>> f.read(1) Modified: python/branches/release26-maint/Doc/tutorial/interpreter.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/interpreter.rst (original) +++ python/branches/release26-maint/Doc/tutorial/interpreter.rst Sat Jan 3 22:55:17 2009 @@ -112,7 +112,7 @@ >>> the_world_is_flat = 1 >>> if the_world_is_flat: ... print "Be careful not to fall off!" - ... + ... Be careful not to fall off! @@ -180,7 +180,7 @@ best way to do it is to put one more special comment line right after the ``#!`` line to define the source file encoding:: - # -*- coding: encoding -*- + # -*- coding: encoding -*- With that declaration, all characters in the source file will be treated as Modified: python/branches/release26-maint/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/introduction.rst (original) +++ python/branches/release26-maint/Doc/tutorial/introduction.rst Sat Jan 3 22:55:17 2009 @@ -84,7 +84,7 @@ >>> # try to access an undefined variable ... n - Traceback (most recent call last): + Traceback (most recent call last): File "", line 1, in NameError: name 'n' is not defined @@ -219,14 +219,14 @@ they will be included in the string. :: print """ - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """ produces the following output:: - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to @@ -350,10 +350,10 @@ Then the right edge of the last character of a string of *n* characters has index *n*, for example:: - +---+---+---+---+---+ + +---+---+---+---+---+ | H | e | l | p | A | - +---+---+---+---+---+ - 0 1 2 3 4 5 + +---+---+---+---+---+ + 0 1 2 3 4 5 -5 -4 -3 -2 -1 The first row of numbers gives the position of the indices 0...5 in the string; @@ -595,7 +595,7 @@ >>> while b < 10: ... print b ... a, b = b, a+b - ... + ... 1 1 2 @@ -645,7 +645,7 @@ >>> while b < 1000: ... print b, ... a, b = b, a+b - ... + ... 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Note that the interpreter inserts a newline before it prints the next prompt if Modified: python/branches/release26-maint/Doc/tutorial/modules.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/modules.rst (original) +++ python/branches/release26-maint/Doc/tutorial/modules.rst Sat Jan 3 22:55:17 2009 @@ -281,7 +281,7 @@ ['__name__', 'fib', 'fib2'] >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', + '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'callstats', 'copyright', 'displayhook', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', @@ -314,7 +314,7 @@ 'FloatingPointError', 'FutureWarning', 'IOError', 'ImportError', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImplemented', - 'NotImplementedError', 'OSError', 'OverflowError', + 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', Modified: python/branches/release26-maint/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/stdlib.rst (original) +++ python/branches/release26-maint/Doc/tutorial/stdlib.rst Sat Jan 3 22:55:17 2009 @@ -136,7 +136,7 @@ >>> random.random() # random float 0.17970987693706186 >>> random.randrange(6) # random integer chosen from range(6) - 4 + 4 .. _tut-internet-access: Modified: python/branches/release26-maint/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/stdlib2.rst (original) +++ python/branches/release26-maint/Doc/tutorial/stdlib2.rst Sat Jan 3 22:55:17 2009 @@ -62,7 +62,7 @@ >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], - ... conv['frac_digits'], x), grouping=True) + ... conv['frac_digits'], x), grouping=True) '$1,234,567.80' Modified: python/branches/release26-maint/Doc/tutorial/whatnow.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/whatnow.rst (original) +++ python/branches/release26-maint/Doc/tutorial/whatnow.rst Sat Jan 3 22:55:17 2009 @@ -63,6 +63,6 @@ .. Postings figure based on average of last six months activity as reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182 - days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) + days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) Modified: python/branches/release26-maint/Doc/using/cmdline.rst ============================================================================== --- python/branches/release26-maint/Doc/using/cmdline.rst (original) +++ python/branches/release26-maint/Doc/using/cmdline.rst Sat Jan 3 22:55:17 2009 @@ -8,8 +8,8 @@ The CPython interpreter scans the command line and the environment for various settings. -.. note:: - +.. note:: + Other implementations' command line schemes may differ. See :ref:`implementations` for further resources. @@ -61,7 +61,7 @@ Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code. - + If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top @@ -72,7 +72,7 @@ Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module. - + Since the argument is a *module* name, you must not give a file extension (``.py``). The ``module-name`` should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to @@ -84,18 +84,18 @@ written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available. - + If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. - + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details - .. seealso:: + .. seealso:: :func:`runpy.run_module` The actual implementation of this feature. @@ -163,7 +163,7 @@ --version Print the Python version number and exit. Example output could be:: - + Python 2.5.1 .. versionchanged:: 2.5 @@ -201,7 +201,7 @@ enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal. The :envvar:`PYTHONSTARTUP` file is not read. - + This can be useful to inspect global variables or a stack trace when a script raises an exception. See also :envvar:`PYTHONINSPECT`. @@ -221,7 +221,7 @@ .. cmdoption:: -Q Division control. The argument must be one of the following: - + ``old`` division of int/int and long/long return an int or long (*default*) ``new`` @@ -264,10 +264,10 @@ .. cmdoption:: -u - + Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. - + Note that there is internal buffering in :meth:`file.readlines` and :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced by this option. To work around this, you will want to use @@ -279,7 +279,7 @@ .. XXX should the -U option be documented? .. cmdoption:: -v - + Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (:option:`-vv`), print a message for each file that is checked for when @@ -288,13 +288,13 @@ .. cmdoption:: -W arg - + Warning control. Python's warning machinery by default prints warning messages to :data:`sys.stderr`. A typical warning message has the following form:: file:line: category: message - + By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. @@ -302,13 +302,13 @@ one option, the action for the last matching option is performed. Invalid :option:`-W` options are ignored (though, a warning message is printed about invalid options when the first warning is issued). - + Warnings can also be controlled from within a Python program using the :mod:`warnings` module. The simplest form of argument is one of the following action strings (or a unique abbreviation): - + ``ignore`` Ignore all warnings. ``default`` @@ -324,9 +324,9 @@ Print each warning only the first time it occurs in the program. ``error`` Raise an exception instead of printing a warning message. - - The full form of argument is:: - + + The full form of argument is:: + action:message:category:module:line Here, *action* is as explained above but only applies to messages that match @@ -347,10 +347,10 @@ .. cmdoption:: -x - + Skip the first line of the source, allowing use of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only. - + .. warning:: The line numbers in error messages will be off by one! @@ -380,13 +380,13 @@ These environment variables influence Python's behavior. .. envvar:: PYTHONHOME - + Change the location of the standard Python libraries. By default, the libraries are searched in :file:`{prefix}/lib/python{version}` and :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and :file:`{exec_prefix}` are installation-dependent directories, both defaulting to :file:`/usr/local`. - + When :envvar:`PYTHONHOME` is set to a single directory, its value replaces both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`. @@ -402,11 +402,11 @@ In addition to normal directories, individual :envvar:`PYTHONPATH` entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. - + The default search path is installation dependent, but generally begins with - :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It + :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. - + An additional directory will be inserted in the search path in front of :envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-options`. The search path can be manipulated from @@ -414,7 +414,7 @@ .. envvar:: PYTHONSTARTUP - + If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so @@ -424,7 +424,7 @@ .. envvar:: PYTHONY2K - + Set this to a non-empty string to cause the :mod:`time` module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the :mod:`time` module @@ -432,21 +432,21 @@ .. envvar:: PYTHONOPTIMIZE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-O` option. If set to an integer, it is equivalent to specifying :option:`-O` multiple times. .. envvar:: PYTHONDEBUG - + If this is set to a non-empty string it is equivalent to specifying the :option:`-d` option. If set to an integer, it is equivalent to specifying :option:`-d` multiple times. .. envvar:: PYTHONINSPECT - + If this is set to a non-empty string it is equivalent to specifying the :option:`-i` option. @@ -455,20 +455,20 @@ .. envvar:: PYTHONUNBUFFERED - + If this is set to a non-empty string it is equivalent to specifying the :option:`-u` option. .. envvar:: PYTHONVERBOSE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-v` option. If set to an integer, it is equivalent to specifying :option:`-v` multiple times. .. envvar:: PYTHONCASEOK - + If this is set, Python ignores case in :keyword:`import` statements. This only works on Windows. Modified: python/branches/release26-maint/Doc/using/unix.rst ============================================================================== --- python/branches/release26-maint/Doc/using/unix.rst (original) +++ python/branches/release26-maint/Doc/using/unix.rst Sat Jan 3 22:55:17 2009 @@ -19,7 +19,7 @@ package on all others. However there are certain features you might want to use that are not available on your distro's package. You can easily compile the latest version of Python from source. - + In the event that Python doesn't come preinstalled and isn't in the repositories as well, you can easily make packages for your own distro. Have a look at the following links: @@ -45,8 +45,8 @@ * OpenBSD users use:: - pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz - + pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz + For example i386 users get the 2.5.1 version of Python using:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz @@ -87,7 +87,7 @@ Python-related paths and files ============================== - + These are subject to difference depending on local installation conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``) are installation-dependent and should be interpreted as for GNU software; they @@ -112,7 +112,7 @@ | | by the user module; not used by default | | | or by most applications. | +-----------------------------------------------+------------------------------------------+ - + Miscellaneous ============= Modified: python/branches/release26-maint/Doc/using/windows.rst ============================================================================== --- python/branches/release26-maint/Doc/using/windows.rst (original) +++ python/branches/release26-maint/Doc/using/windows.rst Sat Jan 3 22:55:17 2009 @@ -88,9 +88,9 @@ --------------------------------------- Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab +guide applies to XP classical view): Right-click the icon for your machine +(usually located on your Desktop and called "My Computer") and choose +:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab and click the :guilabel:`Environment Variables` button. In short, your path is: @@ -193,11 +193,11 @@ #. Launch a command prompt. #. Associate the correct file group with ``.py`` scripts:: - + assoc .py=Python.File #. Redirect all Python files to the new executable:: - + ftype Python.File=C:\Path\to\pythonw.exe "%1" %* Modified: python/branches/release26-maint/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.0.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.0.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.0 + What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka @@ -277,11 +277,11 @@ finding all the strings in the list containing a given substring. You could write the following to do it:: - # Given the list L, make a list of all strings + # Given the list L, make a list of all strings # containing the substring S. - sublist = filter( lambda s, substring=S: + sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, - L) + L) Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` statement knows what @@ -291,9 +291,9 @@ List comprehensions have the form:: - [ expression for expr in sequence1 + [ expression for expr in sequence1 for expr2 in sequence2 ... - for exprN in sequenceN + for exprN in sequenceN if condition ] The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be @@ -312,8 +312,8 @@ ... for exprN in sequenceN: if (condition): - # Append the value of - # the expression to the + # Append the value of + # the expression to the # resulting list. This means that when there are multiple :keyword:`for`...\ :keyword:`in` @@ -368,7 +368,7 @@ def __init__(self, value): self.value = value def __iadd__(self, increment): - return Number( self.value + increment) + return Number( self.value + increment) n = Number(5) n += 3 @@ -590,7 +590,7 @@ def f(): print "i=",i - i = i + 1 + i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been @@ -627,7 +627,7 @@ the following lines of code:: if dict.has_key( key ): return dict[key] - else: + else: dict[key] = [] return dict[key] @@ -836,14 +836,14 @@ :file:`setup.py` can be just a few lines long:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:`setup.py` file isn't much more complicated if the software consists of a few packages:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", packages = ["package", "package.subpackage"]) A C extension can be the most complicated case; here's an example taken from @@ -852,15 +852,14 @@ from distutils.core import setup, Extension expat_extension = Extension('xml.parsers.pyexpat', - define_macros = [('XML_NS', None)], - include_dirs = [ 'extensions/expat/xmltok', - 'extensions/expat/xmlparse' ], - sources = [ 'extensions/pyexpat.c', - 'extensions/expat/xmltok/xmltok.c', - 'extensions/expat/xmltok/xmlrole.c', - ] + define_macros = [('XML_NS', None)], + include_dirs = [ 'extensions/expat/xmltok', + 'extensions/expat/xmlparse' ], + sources = [ 'extensions/pyexpat.c', + 'extensions/expat/xmltok/xmltok.c', + 'extensions/expat/xmltok/xmlrole.c', ] ) - setup (name = "PyXML", version = "0.5.4", + setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) The Distutils can also take care of creating source and binary distributions. Modified: python/branches/release26-maint/Doc/whatsnew/2.1.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.1.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.1.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.1 + What's New in Python 2.1 **************************** :Author: A.M. Kuchling @@ -98,7 +98,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x Modified: python/branches/release26-maint/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.2.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.2.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.2 + What's New in Python 2.2 **************************** :Author: A.M. Kuchling @@ -295,7 +295,7 @@ class D (B,C): def save (self): - # Call superclass .save() + # Call superclass .save() super(D, self).save() # Save D's private information here ... @@ -473,7 +473,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it expects something for which :func:`iter` will return an iterator. For backward @@ -909,7 +909,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x @@ -952,8 +952,8 @@ items = s.meerkat.getItems( {'channel': 4} ) # 'items' is another list of dictionaries, like this: - # [{'link': 'http://freshmeat.net/releases/52719/', - # 'description': 'A utility which converts HTML to XSL FO.', + # [{'link': 'http://freshmeat.net/releases/52719/', + # 'description': 'A utility which converts HTML to XSL FO.', # 'title': 'html2fo 0.3 (Default)'}, ... ] The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward Modified: python/branches/release26-maint/Doc/whatsnew/2.3.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.3.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.3.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.3 + What's New in Python 2.3 **************************** :Author: A.M. Kuchling @@ -301,7 +301,7 @@ -------- ------- 8467 1 file amk at nyman:~/src/python$ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading @@ -671,7 +671,7 @@ # ... } - if (hasattr(core, 'setup_keywords') and + if (hasattr(core, 'setup_keywords') and 'classifiers' in core.setup_keywords): kw['classifiers'] = \ ['Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -1027,7 +1027,7 @@ creating small dictionaries:: >>> dict(red=1, blue=2, green=3, black=4) - {'blue': 2, 'black': 4, 'green': 3, 'red': 1} + {'blue': 2, 'black': 4, 'green': 3, 'red': 1} (Contributed by Just van Rossum.) @@ -1622,7 +1622,7 @@ ... self.valuelist.pop(i) ... def keys(self): ... return list(self.keylist) - ... + ... >>> s = SeqDict() >>> dir(s) # See that other dictionary methods are implemented ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__', @@ -1779,7 +1779,7 @@ set input filename -lLENGTH, --length=LENGTH set maximum length of output - $ + $ See the module's documentation for more details. Modified: python/branches/release26-maint/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.4.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.4.rst Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.4 + What's New in Python 2.4 **************************** :Author: A.M. Kuchling @@ -63,10 +63,10 @@ >>> a.add('z') # add a new element >>> a.update('wxy') # add multiple new elements >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) >>> a.remove('x') # take one element out >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) The :func:`frozenset` type is an immutable version of :func:`set`. Since it is immutable and hashable, it may be used as a dictionary key or as a member of @@ -351,7 +351,7 @@ >>> for i in reversed(xrange(1,4)): ... print i - ... + ... 3 2 1 @@ -366,7 +366,7 @@ >>> input = open('/etc/passwd', 'r') >>> for line in reversed(list(input)): ... print line - ... + ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... @@ -396,10 +396,10 @@ different keyword arguments. :: class Popen(args, bufsize=0, executable=None, - stdin=None, stdout=None, stderr=None, - preexec_fn=None, close_fds=False, shell=False, - cwd=None, env=None, universal_newlines=False, - startupinfo=None, creationflags=0): + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): *args* is commonly a sequence of strings that will be the arguments to the program executed as the subprocess. (If the *shell* argument is true, *args* @@ -650,7 +650,7 @@ 28 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.1428571428571428571428571429") - >>> decimal.getcontext().prec = 9 + >>> decimal.getcontext().prec = 9 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.142857143") @@ -665,7 +665,7 @@ >>> decimal.getcontext().traps[decimal.DivisionByZero] = False >>> decimal.Decimal(1) / decimal.Decimal(0) Decimal("Infinity") - >>> + >>> The :class:`Context` instance also has various methods for formatting numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`. @@ -803,7 +803,7 @@ >>> 'www.python.org'.split('.', 1) ['www', 'python.org'] 'www.python.org'.rsplit('.', 1) - ['www.python', 'org'] + ['www.python', 'org'] * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :meth:`sort` method of lists. These parameters make some common usages of @@ -1045,7 +1045,7 @@ >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque - True + True Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take advantage of :class:`collections.deque` for improved performance. (Contributed @@ -1106,13 +1106,13 @@ >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14] >>> for key_val, it in itertools.groupby(L, lambda x: x % 2): ... print key_val, list(it) - ... + ... 0 [2, 4, 6] 1 [7] 0 [8] 1 [9, 11] 0 [12, 14] - >>> + >>> :func:`groupby` is typically used with sorted input. The logic for :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for @@ -1120,21 +1120,21 @@ >>> word = 'abracadabra' >>> letters = sorted(word) # Turn string into a sorted list of letters - >>> letters + >>> letters ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r'] >>> for k, g in itertools.groupby(letters): ... print k, list(g) - ... + ... a ['a', 'a', 'a', 'a', 'a'] b ['b', 'b'] c ['c'] d ['d'] r ['r', 'r'] >>> # List unique letters - >>> [k for k, g in groupby(letters)] + >>> [k for k, g in groupby(letters)] ['a', 'b', 'c', 'd', 'r'] >>> # Count letter occurrences - >>> [(k, len(list(g))) for k, g in groupby(letters)] + >>> [(k, len(list(g))) for k, g in groupby(letters)] [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)] (Contributed by Hye-Shik Chang.) @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that @@ -1428,7 +1428,7 @@ you get the following output:: ********************************************************************** - File ``t.py'', line 15, in g + File "t.py", line 15, in g Failed example: g(4) Differences (unified diff with -expected +actual): 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 Sat Jan 3 22:55:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.5 + What's New in Python 2.5 **************************** :Author: A.M. Kuchling @@ -220,7 +220,7 @@ required packages. :: VERSION = '1.0' - setup(name='PyPackage', + setup(name='PyPackage', version=VERSION, requires=['numarray', 'zlib (>=1.1.4)'], obsoletes=['OldPackage'] @@ -388,7 +388,7 @@ else: else-block finally: - final-block + final-block The code in *block-1* is executed. If the code raises an exception, the various :keyword:`except` blocks are tested: if the exception is of class @@ -485,7 +485,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration @@ -835,8 +835,8 @@ ... except (KeyboardInterrupt, SystemExit): raise - except: - # Log error... + except: + # Log error... # Continue running program... In Python 2.5, you can now write ``except Exception`` to achieve the same @@ -947,7 +947,7 @@ class C: def __index__ (self): - return self.value + return self.value The return value must be either a Python integer or long integer. The interpreter will check that the type returned is correct, and raises a @@ -1035,9 +1035,9 @@ L = ['medium', 'longest', 'short'] # Prints 'longest' - print max(L, key=len) + print max(L, key=len) # Prints 'short', because lexicographically 'short' has the largest value - print max(L) + print max(L) (Contributed by Steven Bethard and Raymond Hettinger.) @@ -1070,8 +1070,8 @@ using the default ASCII encoding. The result of the comparison is false:: >>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode - __main__:1: UnicodeWarning: Unicode equal comparison failed - to convert both arguments to Unicode - interpreting them + __main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them as being unequal False >>> chr(127) == unichr(127) # chr(127) can be converted @@ -1259,10 +1259,10 @@ Printing ``index`` results in the following output:: - defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], - 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], - 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], - 'p': ['per'], 's': ['selva', 'smarrita'], + defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], + 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], + 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], + 'p': ['per'], 's': ['selva', 'smarrita'], 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} (Contributed by Guido van Rossum.) @@ -1884,17 +1884,17 @@ differently. :: # Old versions - h = md5.md5() - h = md5.new() + h = md5.md5() + h = md5.new() - # New version + # New version h = hashlib.md5() # Old versions - h = sha.sha() - h = sha.new() + h = sha.sha() + h = sha.new() - # New version + # New version h = hashlib.sha1() # Hash that weren't previously available @@ -2191,7 +2191,7 @@ case that your extensions were using it, you can replace it by something like the following:: - range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", + range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", start, stop, step); .. ====================================================================== Modified: python/branches/release26-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.6.rst Sat Jan 3 22:55:17 2009 @@ -586,30 +586,30 @@ def factorial(queue, N): - "Compute a factorial." - # If N is a multiple of 4, this function will take much longer. - if (N % 4) == 0: - time.sleep(.05 * N/4) - - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # If N is a multiple of 4, this function will take much longer. + if (N % 4) == 0: + time.sleep(.05 * N/4) + + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i - # Put the result on the queue - queue.put(fact) + # Put the result on the queue + queue.put(fact) if __name__ == '__main__': - queue = Queue() + queue = Queue() - N = 5 + N = 5 - p = Process(target=factorial, args=(queue, N)) - p.start() - p.join() + p = Process(target=factorial, args=(queue, N)) + p.start() + p.join() - result = queue.get() - print 'Factorial', N, '=', result + result = queue.get() + print 'Factorial', N, '=', result A :class:`Queue` is used to communicate the input parameter *N* and the result. The :class:`Queue` object is stored in a global variable. @@ -630,12 +630,12 @@ from multiprocessing import Pool def factorial(N, dictionary): - "Compute a factorial." - ... + "Compute a factorial." + ... p = Pool(5) result = p.map(factorial, range(1, 1000, 10)) for v in result: - print v + print v This produces the following output:: @@ -744,7 +744,7 @@ >>> import sys >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) Platform: darwin - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' >>> import mimetypes @@ -958,8 +958,8 @@ The primary use of :class:`bytes` in 2.6 will be to write tests of object type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, which can't tell whether 2.x code intends strings to -contain either characters or 8-bit bytes; you can now -use either :class:`bytes` or :class:`str` to represent your intention +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention exactly, and the resulting code will also be correct in Python 3.0. There's also a ``__future__`` import that causes all string literals @@ -1834,9 +1834,9 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) - The :func:`parse_qs` and :func:`parse_qsl` functions have been + The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated from the :mod:`cgi` module to the :mod:`urlparse` module. - The versions still available in the :mod:`cgi` module will + The versions still available in the :mod:`cgi` module will trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`). @@ -1885,9 +1885,9 @@ ('id', 'name', 'type', 'size') >>> var = var_type(1, 'frequency', 'int', 4) - >>> print var[0], var.id # Equivalent + >>> print var[0], var.id # Equivalent 1 1 - >>> print var[2], var.type # Equivalent + >>> print var[2], var.type # Equivalent int int >>> var._asdict() {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'} @@ -1931,7 +1931,7 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) - + :: # Boldface text starting at y=0,x=21 @@ -2046,8 +2046,8 @@ >>> list(itertools.product([1,2,3], [4,5,6])) [(1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6)] + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, @@ -2428,9 +2428,9 @@ :issue:`742598`, :issue:`1193577`.) * The :mod:`sqlite3` module, maintained by Gerhard Haering, - has been updated from version 2.3.2 in Python 2.5 to + has been updated from version 2.3.2 in Python 2.5 to version 2.4.1. - + * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type, using the format character ``'?'``. (Contributed by David Remahl.) @@ -2525,9 +2525,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module gained a number - of context managers useful for writing tests. - :func:`EnvironmentVarGuard` is a +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2542,7 +2542,7 @@ f = urllib.urlopen('https://sf.net') ... - Finally, :func:`check_warnings` resets the :mod:`warning` module's + Finally, :func:`check_warnings` resets the :mod:`warning` module's warning filters and returns an object that will record all warning messages triggered (:issue:`3781`):: @@ -2582,7 +2582,7 @@ :meth:`activeCount` method is renamed to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module support the same properties and renamed methods, but don't remove the old methods. No date has been set - for the deprecation of the old APIs in Python 3.x; the old APIs won't + for the deprecation of the old APIs in Python 3.x; the old APIs won't be removed in any 2.x version. (Carried out by several people, most notably Benjamin Peterson.) @@ -2639,7 +2639,7 @@ (Added by Facundo Batista.) * The Unicode database provided by the :mod:`unicodedata` module - has been updated to version 5.1.0. (Updated by + has been updated to version 5.1.0. (Updated by Martin von Loewis; :issue:`3811`.) * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` @@ -2650,7 +2650,7 @@ A new function, :func:`catch_warnings`, is a context manager intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). - + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` @@ -3220,8 +3220,8 @@ * :meth:`object.__init__` previously accepted arbitrary arguments and keyword arguments, ignoring them. In Python 2.6, this is no longer - allowed and will result in a :exc:`TypeError`. This will affect - :meth:`__init__` methods that end up calling the corresponding + allowed and will result in a :exc:`TypeError`. This will affect + :meth:`__init__` methods that end up calling the corresponding method on :class:`object` (perhaps through using :func:`super`). See :issue:`1683368` for discussion. @@ -3281,7 +3281,7 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, -Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner. Modified: python/branches/release26-maint/LICENSE ============================================================================== --- python/branches/release26-maint/LICENSE (original) +++ python/branches/release26-maint/LICENSE Sat Jan 3 22:55:17 2009 @@ -88,15 +88,14 @@ otherwise using this software ("Python") in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative -version prepared by Licensee. +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python +Software Foundation; All Rights Reserved" are retained in Python alone or in any +derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/branches/release26-maint/Lib/plat-mac/EasyDialogs.py ============================================================================== --- python/branches/release26-maint/Lib/plat-mac/EasyDialogs.py (original) +++ python/branches/release26-maint/Lib/plat-mac/EasyDialogs.py Sat Jan 3 22:55:17 2009 @@ -573,7 +573,7 @@ del d def _process_Nav_args(dftflags, **args): - import aepack + import Carbon.AppleEvents import Carbon.AE import Carbon.File for k in args.keys(): @@ -585,11 +585,14 @@ if args.has_key('defaultLocation') and \ not isinstance(args['defaultLocation'], Carbon.AE.AEDesc): defaultLocation = args['defaultLocation'] - if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): - args['defaultLocation'] = aepack.pack(defaultLocation) + if isinstance(defaultLocation, Carbon.File.FSSpec): + args['defaultLocation'] = Carbon.AE.AECreateDesc( + Carbon.AppleEvents.typeFSS, defaultLocation.data) else: - defaultLocation = Carbon.File.FSRef(defaultLocation) - args['defaultLocation'] = aepack.pack(defaultLocation) + if not isinstance(defaultLocation, Carbon.File.FSRef): + defaultLocation = Carbon.File.FSRef(defaultLocation) + args['defaultLocation'] = Carbon.AE.AECreateDesc( + Carbon.AppleEvents.typeFSRef, defaultLocation.data) if args.has_key('typeList') and not isinstance(args['typeList'], Carbon.Res.ResourceType): typeList = args['typeList'][:] # Workaround for OSX typeless files: Modified: python/branches/release26-maint/Lib/plat-mac/macostools.py ============================================================================== --- python/branches/release26-maint/Lib/plat-mac/macostools.py (original) +++ python/branches/release26-maint/Lib/plat-mac/macostools.py Sat Jan 3 22:55:17 2009 @@ -62,7 +62,14 @@ if os.sep == ':' and not ':' in head: head = head + ':' mkdirs(head) - os.mkdir(dst, 0777) + + try: + os.mkdir(dst, 0777) + except OSError, e: + # be happy if someone already created the path + if e.errno != errno.EEXIST: + raise + def touched(dst): """Tell the finder a file has changed. No-op on MacOSX.""" Modified: python/branches/release26-maint/Lib/plat-mac/videoreader.py ============================================================================== --- python/branches/release26-maint/Lib/plat-mac/videoreader.py (original) +++ python/branches/release26-maint/Lib/plat-mac/videoreader.py Sat Jan 3 22:55:17 2009 @@ -18,7 +18,7 @@ from Carbon import QDOffscreen from Carbon import Res try: - import MediaDescr + from Carbon import MediaDescr except ImportError: def _audiodescr(data): return None Modified: python/branches/release26-maint/Lib/test/test_deque.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_deque.py (original) +++ python/branches/release26-maint/Lib/test/test_deque.py Sat Jan 3 22:55:17 2009 @@ -420,7 +420,7 @@ gc.collect() def test_container_iterator(self): - # Bug # XXX: tp_traverse was not implemented for deque iterator objects + # Bug #3680: tp_traverse was not implemented for deque iterator objects class C(object): pass for i in range(2): Modified: python/branches/release26-maint/Lib/test/test_dict.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_dict.py (original) +++ python/branches/release26-maint/Lib/test/test_dict.py Sat Jan 3 22:55:17 2009 @@ -556,7 +556,7 @@ d = {} def test_container_iterator(self): - # Bug # XXX: tp_traverse was not implemented for dictiter objects + # Bug #3680: tp_traverse was not implemented for dictiter objects class C(object): pass iterators = (dict.iteritems, dict.itervalues, dict.iterkeys) Modified: python/branches/release26-maint/Lib/test/test_set.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_set.py (original) +++ python/branches/release26-maint/Lib/test/test_set.py Sat Jan 3 22:55:17 2009 @@ -324,7 +324,7 @@ self.assertEqual(d3, dict.fromkeys(d, 123)) def test_container_iterator(self): - # Bug # XXX: tp_traverse was not implemented for set iterator object + # Bug #3680: tp_traverse was not implemented for set iterator object class C(object): pass obj = C() Modified: python/branches/release26-maint/Makefile.pre.in ============================================================================== --- python/branches/release26-maint/Makefile.pre.in (original) +++ python/branches/release26-maint/Makefile.pre.in Sat Jan 3 22:55:17 2009 @@ -773,8 +773,8 @@ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) if test -f $(LDLIBRARY); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ @@ -909,7 +909,7 @@ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(BUILDEXE)"; \ - cd $(srcdir)/Lib/$(PLATDIR); ./regen + cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 3 22:55:17 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4075: Use OutputDebugStringW in Py_FatalError. + +- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open + file with `str' filename on Windows. + - Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. @@ -233,6 +238,14 @@ - Issue #4730: Fixed the cPickle module to handle correctly astral characters when protocol 0 is used. +- Issue #16278952: plat-mac/videoreader.py now correctly imports MediaDescr + +- Issue #1737832 : plat-mac/EasyDialog.py no longer uses the broken aepack + module. + +- Issue #1149804: macostools.mkdirs now even works when another process + creates one of the needed subdirectories. + Tools/Demos ----------- @@ -241,6 +254,8 @@ Build ----- +- Issue #4472: "configure --enable-shared" now works on OSX + - Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. - Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". @@ -273,6 +288,8 @@ Extension Modules ----------------- +- Issue #4051: Prevent conflict of UNICODE macros in cPickle. + - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. - Issue #1040026: Fix os.times result on systems where HZ is incorrect. Modified: python/branches/release26-maint/Modules/_collectionsmodule.c ============================================================================== --- python/branches/release26-maint/Modules/_collectionsmodule.c (original) +++ python/branches/release26-maint/Modules/_collectionsmodule.c Sat Jan 3 22:55:17 2009 @@ -967,7 +967,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } @@ -1077,7 +1077,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } Modified: python/branches/release26-maint/Modules/_fileio.c ============================================================================== --- python/branches/release26-maint/Modules/_fileio.c (original) +++ python/branches/release26-maint/Modules/_fileio.c Sat Jan 3 22:55:17 2009 @@ -265,10 +265,11 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } if(dircheck(self, name) < 0) Modified: python/branches/release26-maint/Modules/cPickle.c ============================================================================== --- python/branches/release26-maint/Modules/cPickle.c (original) +++ python/branches/release26-maint/Modules/cPickle.c Sat Jan 3 22:55:17 2009 @@ -18,6 +18,14 @@ #define HIGHEST_PROTOCOL 2 /* + * Note: The UNICODE macro controls the TCHAR meaning of the win32 API. Since + * all headers have already been included here, we can safely redefine it. + */ +#ifdef UNICODE +# undef UNICODE +#endif + +/* * Pickle opcodes. These must be kept in synch with pickle.py. Extensive * docs are in pickletools.py. */ Modified: python/branches/release26-maint/Parser/asdl.py ============================================================================== --- python/branches/release26-maint/Parser/asdl.py (original) +++ python/branches/release26-maint/Parser/asdl.py Sat Jan 3 22:55:17 2009 @@ -167,7 +167,7 @@ return Product(fields) def p_sum_0(self, (constructor,)): - " sum ::= constructor """ + " sum ::= constructor " return [constructor] def p_sum_1(self, (constructor, _, sum)): Modified: python/branches/release26-maint/Python/getcopyright.c ============================================================================== --- python/branches/release26-maint/Python/getcopyright.c (original) +++ python/branches/release26-maint/Python/getcopyright.c Sat Jan 3 22:55:17 2009 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ Modified: python/branches/release26-maint/Python/pythonrun.c ============================================================================== --- python/branches/release26-maint/Python/pythonrun.c (original) +++ python/branches/release26-maint/Python/pythonrun.c Sat Jan 3 22:55:17 2009 @@ -22,6 +22,10 @@ #include #endif +#ifdef MS_WINDOWS +#include "malloc.h" /* for alloca */ +#endif + #ifdef HAVE_LANGINFO_H #include #include @@ -1628,9 +1632,21 @@ { fprintf(stderr, "Fatal Python error: %s\n", msg); #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif Modified: python/branches/release26-maint/README ============================================================================== --- python/branches/release26-maint/README (original) +++ python/branches/release26-maint/README Sat Jan 3 22:55:17 2009 @@ -1,7 +1,7 @@ This is Python version 2.6.1 ============================ -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 Sat Jan 3 22:56:59 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:56:59 +0100 (CET) Subject: [Python-checkins] r68235 - python/branches/release26-maint Message-ID: <20090103215659.0CECC1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:56:58 2009 New Revision: 68235 Log: Blocked revisions 68150,68153,68156,68158,68163,68167,68176,68203,68208-68209,68231 via svnmerge ........ r68150 | ronald.oussoren | 2009-01-02 12:46:05 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue 3433 ........ r68153 | ronald.oussoren | 2009-01-02 13:59:32 +0100 (Fri, 02 Jan 2009) | 10 lines Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk ........ r68156 | ronald.oussoren | 2009-01-02 15:10:20 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue1594 ........ r68158 | ronald.oussoren | 2009-01-02 15:46:19 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 900949 ........ r68163 | ronald.oussoren | 2009-01-02 16:25:36 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issues #841800 and #900506 ........ r68167 | vinay.sajip | 2009-01-02 19:53:04 +0100 (Fri, 02 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ........ r68176 | andrew.kuchling | 2009-01-02 22:00:35 +0100 (Fri, 02 Jan 2009) | 1 line Add various items ........ r68203 | martin.v.loewis | 2009-01-03 18:19:26 +0100 (Sat, 03 Jan 2009) | 2 lines Issue #4817: Remove unused function PyOS_GetLastModificationTime. ........ r68208 | raymond.hettinger | 2009-01-03 20:02:23 +0100 (Sat, 03 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ........ r68209 | raymond.hettinger | 2009-01-03 20:08:10 +0100 (Sat, 03 Jan 2009) | 1 line Reapply r68191. ........ r68231 | guilherme.polo | 2009-01-03 22:51:09 +0100 (Sat, 03 Jan 2009) | 4 lines The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x (part of issue #3638). ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Jan 3 22:58:35 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 22:58:35 +0100 (CET) Subject: [Python-checkins] r68236 - in python/branches/release26-maint: Doc/c-api/structures.rst Message-ID: <20090103215835.EEBF51E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 22:58:35 2009 New Revision: 68236 Log: Merged revisions 68232 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68232 | georg.brandl | 2009-01-03 22:52:16 +0100 (Sat, 03 Jan 2009) | 2 lines Grammar fix. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/c-api/structures.rst Modified: python/branches/release26-maint/Doc/c-api/structures.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/structures.rst (original) +++ python/branches/release26-maint/Doc/c-api/structures.rst Sat Jan 3 22:58:35 2009 @@ -208,7 +208,7 @@ .. ctype:: PyMemberDef Structure which describes an attribute of a type which corresponds to a C - struct member. It's fields are: + struct member. Its fields are: +------------------+-------------+-------------------------------+ | Field | C Type | Meaning | @@ -263,9 +263,8 @@ :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies - :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` can be - deleted. (They are set to *NULL*). - + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` + members can be deleted. (They are set to *NULL*). .. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name) From python-checkins at python.org Sat Jan 3 23:00:40 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 3 Jan 2009 23:00:40 +0100 (CET) Subject: [Python-checkins] r68237 - in python/branches/py3k: Misc/NEWS Modules/_tkinter.c Message-ID: <20090103220040.51B4B1E4002@bag.python.org> Author: guilherme.polo Date: Sat Jan 3 23:00:39 2009 New Revision: 68237 Log: Fix for issue #3638: Remove module level functions in _tkinter that depend on TkappObject Modified: 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 Jan 3 23:00:39 2009 @@ -82,6 +82,9 @@ Library ------- +- Issue #3638: Remove functions from _tkinter module level that depend on + TkappObject to work with multiple threads. + - Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x, in accordance with the `official amendments of the spec `_. Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Sat Jan 3 23:00:39 2009 @@ -2171,19 +2171,7 @@ &file, &mask, &func)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.createfilehandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); if (tfile < 0) @@ -2214,19 +2202,7 @@ if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.deletefilehandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); if (tfile < 0) @@ -2400,19 +2376,7 @@ return NULL; } -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.createtimerhandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; v = Tktt_New(func); if (v) { @@ -2438,20 +2402,8 @@ if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.mainloop not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - self->dispatching = 1; - } + CHECK_TCL_APPARTMENT; + self->dispatching = 1; quitMainLoop = 0; while (Tk_GetNumMainWindows() > threshold && @@ -2461,7 +2413,7 @@ int result; #ifdef WITH_THREAD - if (self && self->threaded) { + if (self->threaded) { /* Allow other Python threads to run. */ ENTER_TCL result = Tcl_DoOneEvent(0); @@ -2483,15 +2435,13 @@ #endif if (PyErr_CheckSignals() != 0) { - if (self) - self->dispatching = 0; + self->dispatching = 0; return NULL; } if (result < 0) break; } - if (self) - self->dispatching = 0; + self->dispatching = 0; quitMainLoop = 0; if (errorInCmd) { @@ -2884,14 +2834,6 @@ { {"_flatten", Tkinter_Flatten, METH_VARARGS}, {"create", Tkinter_Create, METH_VARARGS}, -#ifdef HAVE_CREATEFILEHANDLER - {"createfilehandler", Tkapp_CreateFileHandler, METH_VARARGS}, - {"deletefilehandler", Tkapp_DeleteFileHandler, METH_VARARGS}, -#endif - {"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS}, - {"mainloop", Tkapp_MainLoop, METH_VARARGS}, - {"dooneevent", Tkapp_DoOneEvent, METH_VARARGS}, - {"quit", Tkapp_Quit, METH_VARARGS}, {"setbusywaitinterval",Tkinter_setbusywaitinterval, METH_VARARGS, setbusywaitinterval_doc}, {"getbusywaitinterval",(PyCFunction)Tkinter_getbusywaitinterval, From buildbot at python.org Sat Jan 3 23:01:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 22:01:09 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090103220109.531411E400C@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/25 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_wsgiref ====================================================================== ERROR: testEnviron (test.test_wsgiref.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_wsgiref.py", line 490, in testEnviron File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_wsgiref.py", line 482, in checkOSEnviron KeyError: 'AUTH_TYPE' ====================================================================== ERROR: testBytes (test.test_wsgiref.HeaderTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_wsgiref.py", line 427, in testBytes File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/wsgiref/headers.py", line 67, in __setitem__ del self[name] File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/wsgiref/headers.py", line 77, in __delitem__ self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/wsgiref/headers.py", line 77, in self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 3 23:03:12 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:03:12 +0100 (CET) Subject: [Python-checkins] r68238 - in python/trunk: Doc/library/decimal.rst Lib/fractions.py Lib/heapq.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090103220312.CEFE41E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:03:11 2009 New Revision: 68238 Log: Manually merge r68095,68186,68187,68188,68190 from 2.6 branch. Modified: python/trunk/Doc/library/decimal.rst python/trunk/Lib/fractions.py python/trunk/Lib/heapq.py python/trunk/Lib/test/test_fractions.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/decimal.rst ============================================================================== --- python/trunk/Doc/library/decimal.rst (original) +++ python/trunk/Doc/library/decimal.rst Sat Jan 3 23:03:11 2009 @@ -1923,13 +1923,14 @@ def float_to_decimal(f): "Convert a floating point number to a Decimal with no loss of information" n, d = f.as_integer_ratio() - with localcontext() as ctx: - ctx.traps[Inexact] = True - while True: - try: - return Decimal(n) / Decimal(d) - except Inexact: - ctx.prec += 1 + numerator, denominator = Decimal(n), Decimal(d) + ctx = Context(prec=60) + result = ctx.divide(numerator, denominator) + while ctx.flags[Inexact]: + ctx.flags[Inexact] = False + ctx.prec *= 2 + result = ctx.divide(numerator, denominator) + return result .. doctest:: Modified: python/trunk/Lib/fractions.py ============================================================================== --- python/trunk/Lib/fractions.py (original) +++ python/trunk/Lib/fractions.py Sat Jan 3 23:03:11 2009 @@ -111,7 +111,7 @@ """ if isinstance(f, numbers.Integral): - f = float(f) + return cls(f) elif not isinstance(f, float): raise TypeError("%s.from_float() only takes floats, not %r (%s)" % (cls.__name__, f, type(f).__name__)) Modified: python/trunk/Lib/heapq.py ============================================================================== --- python/trunk/Lib/heapq.py (original) +++ python/trunk/Lib/heapq.py Sat Jan 3 23:03:11 2009 @@ -354,6 +354,10 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + if key is None: + it = izip(iterable, count()) # decorate + result = _nsmallest(n, it) + return map(itemgetter(0), result) # undecorate in1, in2 = tee(iterable) it = izip(imap(key, in1), count(), in2) # decorate result = _nsmallest(n, it) @@ -365,6 +369,10 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + if key is None: + it = izip(iterable, imap(neg, count())) # decorate + result = _nlargest(n, it) + return map(itemgetter(0), result) # undecorate in1, in2 = tee(iterable) it = izip(imap(key, in1), imap(neg, count()), in2) # decorate result = _nlargest(n, it) Modified: python/trunk/Lib/test/test_fractions.py ============================================================================== --- python/trunk/Lib/test/test_fractions.py (original) +++ python/trunk/Lib/test/test_fractions.py Sat Jan 3 23:03:11 2009 @@ -139,6 +139,8 @@ def testFromFloat(self): self.assertRaises(TypeError, F.from_float, 3+4j) self.assertEquals((10, 1), _components(F.from_float(10))) + bigint = 1234567890123456789 + self.assertEquals((bigint, 1), _components(F.from_float(bigint))) self.assertEquals((0, 1), _components(F.from_float(-0.0))) self.assertEquals((10, 1), _components(F.from_float(10.0))) self.assertEquals((-5, 2), _components(F.from_float(-2.5))) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 3 23:03:11 2009 @@ -127,6 +127,12 @@ - Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. +- Fractions.from_float() no longer loses precision for integers too big to + cast as floats. + +- Issue 4790: The nsmallest() and nlargest() functions in the heapq module + did unnecessary work in the common case where no key function was specified. + - Issue #3767: Convert Tk object to string in tkColorChooser. - Issue #3248: Allow placing ScrolledText in a PanedWindow. From python-checkins at python.org Sat Jan 3 23:04:50 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 3 Jan 2009 23:04:50 +0100 (CET) Subject: [Python-checkins] r68239 - in python/branches/release30-maint: Misc/NEWS Modules/_tkinter.c Message-ID: <20090103220450.82DBF1E4002@bag.python.org> Author: guilherme.polo Date: Sat Jan 3 23:04:49 2009 New Revision: 68239 Log: Merged revisions 68237 via svnmerge from svn+ssh://pythondev/python/branches/py3k ........ r68237 | guilherme.polo | 2009-01-03 20:00:39 -0200 (Sat, 03 Jan 2009) | 3 lines Fix for issue #3638: Remove module level functions in _tkinter that depend on TkappObject ........ 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 Sat Jan 3 23:04:49 2009 @@ -52,6 +52,9 @@ Library ------- +- Issue #3638: Remove functions from _tkinter module level that depend on + TkappObject to work with multiple threads. + - Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x, in accordance with the `official amendments of the spec `_. Modified: python/branches/release30-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release30-maint/Modules/_tkinter.c (original) +++ python/branches/release30-maint/Modules/_tkinter.c Sat Jan 3 23:04:49 2009 @@ -2171,19 +2171,7 @@ &file, &mask, &func)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.createfilehandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); if (tfile < 0) @@ -2214,19 +2202,7 @@ if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.deletefilehandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); if (tfile < 0) @@ -2400,19 +2376,7 @@ return NULL; } -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.createtimerhandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; v = Tktt_New(func); if (v) { @@ -2438,20 +2402,8 @@ if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.mainloop not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - self->dispatching = 1; - } + CHECK_TCL_APPARTMENT; + self->dispatching = 1; quitMainLoop = 0; while (Tk_GetNumMainWindows() > threshold && @@ -2461,7 +2413,7 @@ int result; #ifdef WITH_THREAD - if (self && self->threaded) { + if (self->threaded) { /* Allow other Python threads to run. */ ENTER_TCL result = Tcl_DoOneEvent(0); @@ -2483,15 +2435,13 @@ #endif if (PyErr_CheckSignals() != 0) { - if (self) - self->dispatching = 0; + self->dispatching = 0; return NULL; } if (result < 0) break; } - if (self) - self->dispatching = 0; + self->dispatching = 0; quitMainLoop = 0; if (errorInCmd) { @@ -2884,14 +2834,6 @@ { {"_flatten", Tkinter_Flatten, METH_VARARGS}, {"create", Tkinter_Create, METH_VARARGS}, -#ifdef HAVE_CREATEFILEHANDLER - {"createfilehandler", Tkapp_CreateFileHandler, METH_VARARGS}, - {"deletefilehandler", Tkapp_DeleteFileHandler, METH_VARARGS}, -#endif - {"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS}, - {"mainloop", Tkapp_MainLoop, METH_VARARGS}, - {"dooneevent", Tkapp_DoOneEvent, METH_VARARGS}, - {"quit", Tkapp_Quit, METH_VARARGS}, {"setbusywaitinterval",Tkinter_setbusywaitinterval, METH_VARARGS, setbusywaitinterval_doc}, {"getbusywaitinterval",(PyCFunction)Tkinter_getbusywaitinterval, From python-checkins at python.org Sat Jan 3 23:05:24 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:05:24 +0100 (CET) Subject: [Python-checkins] r68240 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090103220524.6A01D1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:05:22 2009 New Revision: 68240 Log: Manually merge r67868 from 2.6 branch. 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 Sat Jan 3 23:05:22 2009 @@ -338,15 +338,13 @@ module: math single: floor() (in module math) single: ceil() (in module math) + single: trunc() (in module math) pair: numeric; conversions - pair: C; language - Conversion from floating point to (long or plain) integer may round or - truncate as in C; see functions :func:`math.floor` and :func:`math.ceil` for - well-defined conversions. - - .. deprecated:: 2.6 - Instead, convert floats to long explicitly with :func:`trunc`. + Conversion from floats using :func:`int` or :func:`long` truncates toward + zero like the related function, :func:`math.trunc`. Use the function + :func:`math.floor` to round downward and :func:`math.ceil` to round + upward. (3) See :ref:`built-in-funcs` for a full description. From python-checkins at python.org Sat Jan 3 23:07:57 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:07:57 +0100 (CET) Subject: [Python-checkins] r68241 - in python/branches/py3k: Lib/fractions.py Lib/heapq.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090103220757.E78861E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:07:57 2009 New Revision: 68241 Log: Manually merge r68096,68189 from 3.0 branch. Modified: python/branches/py3k/Lib/fractions.py python/branches/py3k/Lib/heapq.py python/branches/py3k/Lib/test/test_fractions.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/fractions.py ============================================================================== --- python/branches/py3k/Lib/fractions.py (original) +++ python/branches/py3k/Lib/fractions.py Sat Jan 3 23:07:57 2009 @@ -109,7 +109,7 @@ """ if isinstance(f, numbers.Integral): - f = float(f) + return cls(f) elif not isinstance(f, float): raise TypeError("%s.from_float() only takes floats, not %r (%s)" % (cls.__name__, f, type(f).__name__)) Modified: python/branches/py3k/Lib/heapq.py ============================================================================== --- python/branches/py3k/Lib/heapq.py (original) +++ python/branches/py3k/Lib/heapq.py Sat Jan 3 23:07:57 2009 @@ -354,9 +354,12 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + if key is None: + it = zip(iterable, count()) # decorate + result = _nsmallest(n, it) + return list(map(itemgetter(0), result)) # undecorate in1, in2 = tee(iterable) - keys = in1 if key is None else map(key, in1) - it = zip(keys, count(), in2) # decorate + it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) return list(map(itemgetter(2), result)) # undecorate @@ -366,9 +369,12 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + if key is None: + it = zip(iterable, map(neg, count())) # decorate + result = _nlargest(n, it) + return list(map(itemgetter(0), result)) # undecorate in1, in2 = tee(iterable) - keys = in1 if key is None else map(key, in1) - it = zip(keys, map(neg, count()), in2) # decorate + it = zip(map(key, in1), map(neg, count()), in2) # decorate result = _nlargest(n, it) return list(map(itemgetter(2), result)) # undecorate 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 Sat Jan 3 23:07:57 2009 @@ -136,6 +136,8 @@ def testFromFloat(self): self.assertRaises(TypeError, F.from_float, 3+4j) self.assertEquals((10, 1), _components(F.from_float(10))) + bigint = 1234567890123456789 + self.assertEquals((bigint, 1), _components(F.from_float(bigint))) self.assertEquals((0, 1), _components(F.from_float(-0.0))) self.assertEquals((10, 1), _components(F.from_float(10.0))) self.assertEquals((-5, 2), _components(F.from_float(-2.5))) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 23:07:57 2009 @@ -92,9 +92,15 @@ - Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() to the decimal module. +- Fractions.from_float() no longer loses precision for integers too big to + cast as floats. + - Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) +- Issue 4790: The nsmallest() and nlargest() functions in the heapq module + did unnecessary work in the common case where no key function was specified. + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey. From python-checkins at python.org Sat Jan 3 23:13:31 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 3 Jan 2009 23:13:31 +0100 (CET) Subject: [Python-checkins] r68242 - python/branches/py3k/Lib/tkinter/__init__.py Message-ID: <20090103221331.A199F1E4002@bag.python.org> Author: guilherme.polo Date: Sat Jan 3 23:13:31 2009 New Revision: 68242 Log: Forgot to remove no longer needed code since r68237 Modified: python/branches/py3k/Lib/tkinter/__init__.py Modified: python/branches/py3k/Lib/tkinter/__init__.py ============================================================================== --- python/branches/py3k/Lib/tkinter/__init__.py (original) +++ python/branches/py3k/Lib/tkinter/__init__.py Sat Jan 3 23:13:31 2009 @@ -49,12 +49,6 @@ WRITABLE = _tkinter.WRITABLE EXCEPTION = _tkinter.EXCEPTION -# These are not always defined, e.g. not on Win32 with Tk 8.0 :-( -try: _tkinter.createfilehandler -except AttributeError: _tkinter.createfilehandler = None -try: _tkinter.deletefilehandler -except AttributeError: _tkinter.deletefilehandler = None - def _flatten(seq): """Internal function.""" From python-checkins at python.org Sat Jan 3 23:15:43 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:15:43 +0100 (CET) Subject: [Python-checkins] r68243 - python/trunk/Misc/build.sh Message-ID: <20090103221543.1F98B1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:15:42 2009 New Revision: 68243 Log: Add temporary code to fix the automatic doc build failure. Modified: python/trunk/Misc/build.sh Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Sat Jan 3 23:15:42 2009 @@ -247,6 +247,10 @@ cd $DIR/Doc F="make-doc.out" start=`current_time` + +# Temporary measure to fix build problem +rm -rf tools/sphinx/jinja + # XXX(nnorwitz): For now, keep the code that checks for a conflicted file until # after the first release of 2.6a1 or 3.0a1. At that point, it will be clear # if there will be a similar problem with the new doc system. From python-checkins at python.org Sat Jan 3 23:17:59 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 3 Jan 2009 23:17:59 +0100 (CET) Subject: [Python-checkins] r68244 - in python/branches/release30-maint: Lib/tkinter/__init__.py Message-ID: <20090103221759.CD9261E4039@bag.python.org> Author: guilherme.polo Date: Sat Jan 3 23:17:59 2009 New Revision: 68244 Log: Merged revisions 68242 via svnmerge from svn+ssh://pythondev/python/branches/py3k ........ r68242 | guilherme.polo | 2009-01-03 20:13:31 -0200 (Sat, 03 Jan 2009) | 2 lines Forgot to remove no longer needed code since r68237 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/tkinter/__init__.py 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 Sat Jan 3 23:17:59 2009 @@ -49,12 +49,6 @@ WRITABLE = _tkinter.WRITABLE EXCEPTION = _tkinter.EXCEPTION -# These are not always defined, e.g. not on Win32 with Tk 8.0 :-( -try: _tkinter.createfilehandler -except AttributeError: _tkinter.createfilehandler = None -try: _tkinter.deletefilehandler -except AttributeError: _tkinter.deletefilehandler = None - def _flatten(seq): """Internal function.""" From python-checkins at python.org Sat Jan 3 23:33:39 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:33:39 +0100 (CET) Subject: [Python-checkins] r68245 - in python/branches/py3k: Doc/library/itertools.rst Doc/license.rst LICENSE Lib/inspect.py Lib/test/test_struct.py Makefile.pre.in Misc/NEWS Modules/_collectionsmodule.c Modules/_struct.c Python/getcopyright.c README configure configure.in Message-ID: <20090103223339.DCBF21E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:33:39 2009 New Revision: 68245 Log: Merged revisions 68112,68115,68120,68133,68141-68142,68145-68146,68148-68149 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line #4795 inspect.isgeneratorfunction() should return False instead of None ........ r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line simplfy code ........ r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines #4228: Pack negative values the same way as 2.4 in struct's L format. ........ r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line fill in actual issue number in tests ........ r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line fix highlighting ........ r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines welcome to 2009, Python! ........ r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. ........ r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4472: "configure --enable-shared doesn't work on OSX" ........ r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines Forgot to add a NEWS item in my previous checkin ........ r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4780 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Doc/license.rst python/branches/py3k/LICENSE python/branches/py3k/Lib/inspect.py python/branches/py3k/Lib/test/test_struct.py python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_collectionsmodule.c python/branches/py3k/Modules/_struct.c python/branches/py3k/Python/getcopyright.c python/branches/py3k/README python/branches/py3k/configure python/branches/py3k/configure.in Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Sat Jan 3 23:33:39 2009 @@ -466,7 +466,7 @@ .. doctest:: - # Show a dictionary sorted and grouped by value + >>> # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.items(), key=itemgetter(1)) @@ -477,9 +477,9 @@ 2 ['b', 'd', 'f'] 3 ['g'] - # Find runs of consecutive numbers using groupby. The key to the solution - # is differencing with a range so that consecutive numbers all appear in - # same group. + >>> # Find runs of consecutive numbers using groupby. The key to the solution + >>> # is differencing with a range so that consecutive numbers all appear in + >>> # same group. >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]): ... print(map(operator.itemgetter(1), g)) Modified: python/branches/py3k/Doc/license.rst ============================================================================== --- python/branches/py3k/Doc/license.rst (original) +++ python/branches/py3k/Doc/license.rst Sat Jan 3 23:33:39 2009 @@ -124,7 +124,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ? 2001-2008 Python Software Foundation; All Rights + copyright, i.e., "Copyright ? 2001-2009 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. Modified: python/branches/py3k/LICENSE ============================================================================== --- python/branches/py3k/LICENSE (original) +++ python/branches/py3k/LICENSE Sat Jan 3 23:33:39 2009 @@ -89,15 +89,14 @@ otherwise using this software ("Python") in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative -version prepared by Licensee. +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python +Software Foundation; All Rights Reserved" are retained in Python alone or in any +derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/branches/py3k/Lib/inspect.py ============================================================================== --- python/branches/py3k/Lib/inspect.py (original) +++ python/branches/py3k/Lib/inspect.py Sat Jan 3 23:33:39 2009 @@ -158,9 +158,8 @@ Generator function objects provides same attributes as functions. See isfunction.__doc__ for attributes listing.""" - if (isfunction(object) or ismethod(object)) and \ - object.__code__.co_flags & CO_GENERATOR: - return True + return bool((isfunction(object) or ismethod(object)) and + object.__code__.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. 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 Sat Jan 3 23:33:39 2009 @@ -2,6 +2,8 @@ import unittest import struct import warnings +warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated", + DeprecationWarning) from functools import wraps from test.support import TestFailed, verbose, run_unittest @@ -469,6 +471,11 @@ self.check_float_coerce(endian + fmt, 1.0) self.check_float_coerce(endian + fmt, 1.5) + def test_issue4228(self): + # Packing a long may yield either 32 or 64 bits + x = struct.pack('L', -1)[:4] + self.assertEqual(x, b'\xff'*4) + def test_unpack_from(self): test_string = b'abcd01234' fmt = '4s' Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat Jan 3 23:33:39 2009 @@ -411,10 +411,14 @@ if test $(INSTSONAME) != $(LDLIBRARY); then \ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ - else\ + else \ $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi +libpython$(VERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) @@ -772,13 +776,13 @@ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) - if test -f libpython$(VERSION)$(SO); then \ + if test -f $(LDLIBRARY); then \ if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ else \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ - if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ - (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 3 23:33:39 2009 @@ -101,6 +101,9 @@ - Issue 4790: The nsmallest() and nlargest() functions in the heapq module did unnecessary work in the common case where no key function was specified. +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey. @@ -197,6 +200,43 @@ - Issue #4677: add two list comprehension tests to pybench. + +Build +----- + +- Issue #4472: "configure --enable-shared" now works on OSX + +- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. + +- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". + +- Issue #4289: Remove Cancel button from AdvancedDlg. + +- Issue #1656675: Register a drop handler for .py* files on Windows. + +- Issue #4120: Exclude manifest from extension modules in VS2008. + +- Issue #4091: Install pythonxy.dll in system32 again. + +- Issue #4018: Disable "for me" installations on Vista. + +- Issue #3758: Add ``patchcheck`` build target to .PHONY. + +- Issue #4204: Fixed module build errors on FreeBSD 4. + + +C-API +----- + +- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. + +- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when + the GIL is released, or owned by another thread. + +- Issue #4122: On Windows, fix a compilation error when using the + Py_UNICODE_ISSPACE macro in an extension module. + + Extension Modules ----------------- @@ -206,6 +246,8 @@ or decompress several streams at once on multi-CPU systems. Also, the GIL is now released when computing the CRC of a large buffer. Patch by ebfe. +- Issue #4228: Pack negative values the same way as 2.4 in struct's L format. + - Issue #1040026: Fix os.times result on systems where HZ is incorrect. - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, @@ -215,9 +257,6 @@ has been exported, resulting in an interpreter crash when accessing the buffer. -Build ------ - Docs ---- Modified: python/branches/py3k/Modules/_collectionsmodule.c ============================================================================== --- python/branches/py3k/Modules/_collectionsmodule.c (original) +++ python/branches/py3k/Modules/_collectionsmodule.c Sat Jan 3 23:33:39 2009 @@ -909,7 +909,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } @@ -1019,7 +1019,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } Modified: python/branches/py3k/Modules/_struct.c ============================================================================== --- python/branches/py3k/Modules/_struct.c (original) +++ python/branches/py3k/Modules/_struct.c Sat Jan 3 23:33:39 2009 @@ -661,7 +661,7 @@ return -1; #if (SIZEOF_LONG > SIZEOF_INT) if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX))) - return _range_error(f, 0); + RANGE_ERROR(x, f, 0, -1); #endif y = (int)x; memcpy(p, (char *)&y, sizeof y); @@ -673,12 +673,12 @@ { unsigned long x; unsigned int y; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; y = (unsigned int)x; #if (SIZEOF_LONG > SIZEOF_INT) if (x > ((unsigned long)UINT_MAX)) - return _range_error(f, 1); + RANGE_ERROR(y, f, 1, -1); #endif memcpy(p, (char *)&y, sizeof y); return 0; @@ -698,8 +698,8 @@ np_ulong(char *p, PyObject *v, const formatdef *f) { unsigned long x; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; memcpy(p, (char *)&x, sizeof x); return 0; } Modified: python/branches/py3k/Python/getcopyright.c ============================================================================== --- python/branches/py3k/Python/getcopyright.c (original) +++ python/branches/py3k/Python/getcopyright.c Sat Jan 3 23:33:39 2009 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Sat Jan 3 23:33:39 2009 @@ -2,7 +2,7 @@ ================================== For notes specific to this release, see RELNOTES in this directory. -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. Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sat Jan 3 23:33:39 2009 @@ -4085,6 +4085,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -12915,6 +12921,7 @@ { echo "$as_me:$LINENO: result: $SO" >&5 echo "${ECHO_T}$SO" >&6; } + cat >>confdefs.h <<_ACEOF #define SHLIB_EXT "$SO" _ACEOF @@ -13311,7 +13318,7 @@ fi # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sat Jan 3 23:33:39 2009 @@ -693,6 +693,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -1527,6 +1533,7 @@ sleep 10 fi AC_MSG_RESULT($SO) + AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 From python-checkins at python.org Sat Jan 3 23:37:18 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:37:18 +0100 (CET) Subject: [Python-checkins] r68246 - python/branches/py3k Message-ID: <20090103223718.280601E4029@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:37:17 2009 New Revision: 68246 Log: Blocked revisions 68150,68156,68158-68161,68163 via svnmerge ........ r68150 | ronald.oussoren | 2009-01-02 12:46:05 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue 3433 ........ r68156 | ronald.oussoren | 2009-01-02 15:10:20 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue1594 ........ r68158 | ronald.oussoren | 2009-01-02 15:46:19 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 900949 ........ r68159 | ronald.oussoren | 2009-01-02 15:48:17 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 1627952 ........ r68160 | ronald.oussoren | 2009-01-02 15:52:09 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue r1737832 ........ r68161 | ronald.oussoren | 2009-01-02 16:00:05 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 1149804 ........ r68163 | ronald.oussoren | 2009-01-02 16:25:36 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issues #841800 and #900506 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 3 23:47:40 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:47:40 +0100 (CET) Subject: [Python-checkins] r68247 - in python/branches/py3k: Doc/ACKS.txt Doc/c-api/arg.rst Doc/c-api/structures.rst Doc/distutils/apiref.rst Doc/howto/functional.rst Doc/howto/urllib2.rst Doc/install/index.rst Doc/library/email.mime.rst Doc/library/gzip.rst Doc/library/http.cookiejar.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/numbers.rst Doc/library/parser.rst Doc/library/smtplib.rst Doc/library/urllib.parse.rst Doc/tutorial/inputoutput.rst Doc/using/cmdline.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.7.rst Makefile.pre.in Parser/asdl.py Message-ID: <20090103224740.60B0A1E401B@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:47:39 2009 New Revision: 68247 Log: Merged revisions 68162,68166,68171,68176,68195-68196,68210,68232 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68162 | ronald.oussoren | 2009-01-02 16:06:00 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 4472 is incompatible with Cygwin, this patch should fix that. ........ r68166 | benjamin.peterson | 2009-01-02 19:26:23 +0100 (Fri, 02 Jan 2009) | 1 line document PyMemberDef ........ r68171 | georg.brandl | 2009-01-02 21:25:14 +0100 (Fri, 02 Jan 2009) | 3 lines #4811: fix markup glitches (mostly remains of the conversion), found by Gabriel Genellina. ........ r68176 | andrew.kuchling | 2009-01-02 22:00:35 +0100 (Fri, 02 Jan 2009) | 1 line Add various items ........ r68195 | georg.brandl | 2009-01-03 14:45:15 +0100 (Sat, 03 Jan 2009) | 2 lines Remove useless string literal. ........ r68196 | georg.brandl | 2009-01-03 15:29:53 +0100 (Sat, 03 Jan 2009) | 2 lines Fix indentation. ........ r68210 | georg.brandl | 2009-01-03 20:10:12 +0100 (Sat, 03 Jan 2009) | 2 lines Set eol-style correctly for mp_distributing.py. ........ r68232 | georg.brandl | 2009-01-03 22:52:16 +0100 (Sat, 03 Jan 2009) | 2 lines Grammar fix. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/ACKS.txt python/branches/py3k/Doc/c-api/arg.rst python/branches/py3k/Doc/c-api/structures.rst python/branches/py3k/Doc/distutils/apiref.rst python/branches/py3k/Doc/howto/functional.rst python/branches/py3k/Doc/howto/urllib2.rst python/branches/py3k/Doc/install/index.rst python/branches/py3k/Doc/library/email.mime.rst python/branches/py3k/Doc/library/gzip.rst python/branches/py3k/Doc/library/http.cookiejar.rst python/branches/py3k/Doc/library/json.rst python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Doc/library/numbers.rst python/branches/py3k/Doc/library/parser.rst python/branches/py3k/Doc/library/smtplib.rst python/branches/py3k/Doc/library/urllib.parse.rst python/branches/py3k/Doc/tutorial/inputoutput.rst python/branches/py3k/Doc/using/cmdline.rst python/branches/py3k/Doc/whatsnew/2.4.rst python/branches/py3k/Doc/whatsnew/2.5.rst python/branches/py3k/Doc/whatsnew/2.7.rst python/branches/py3k/Makefile.pre.in python/branches/py3k/Parser/asdl.py Modified: python/branches/py3k/Doc/ACKS.txt ============================================================================== --- python/branches/py3k/Doc/ACKS.txt (original) +++ python/branches/py3k/Doc/ACKS.txt Sat Jan 3 23:47:39 2009 @@ -60,6 +60,7 @@ * Peter Funk * Lele Gaifax * Matthew Gallagher + * Gabriel Genellina * Ben Gertzfield * Nadim Ghaznavi * Jonathan Giddy Modified: python/branches/py3k/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k/Doc/c-api/arg.rst (original) +++ python/branches/py3k/Doc/c-api/arg.rst Sat Jan 3 23:47:39 2009 @@ -53,8 +53,9 @@ string may contain embedded null bytes. Unicode objects pass back a pointer to the default encoded string version of the object if such a conversion is possible. All other read-buffer compatible objects pass back a reference to - the raw internal data representation. Since this format doesn't allow writable buffer compatible objects like byte - arrays, ``s*`` is to be preferred. + the raw internal data representation. Since this format doesn't allow + writable buffer compatible objects like byte arrays, ``s*`` is to be + preferred. The type of the length argument (int or :ctype:`Py_ssize_t`) is controlled by defining the macro :cmacro:`PY_SSIZE_T_CLEAN` before including Modified: python/branches/py3k/Doc/c-api/structures.rst ============================================================================== --- python/branches/py3k/Doc/c-api/structures.rst (original) +++ python/branches/py3k/Doc/c-api/structures.rst Sat Jan 3 23:47:39 2009 @@ -198,3 +198,64 @@ object and will co-exist with the slot. This is helpful because calls to PyCFunctions are optimized more than wrapper object calls. + +.. ctype:: PyMemberDef + + Structure which describes an attribute of a type which corresponds to a C + struct member. Its fields are: + + +------------------+-------------+-------------------------------+ + | Field | C Type | Meaning | + +==================+=============+===============================+ + | :attr:`name` | char \* | name of the member | + +------------------+-------------+-------------------------------+ + | :attr:`type` | int | the type of the member in the | + | | | C struct | + +------------------+-------------+-------------------------------+ + | :attr:`offset` | Py_ssize_t | the offset in bytes that the | + | | | member is located on the | + | | | type's object struct | + +------------------+-------------+-------------------------------+ + | :attr:`flags` | int | flag bits indicating if the | + | | | field should be read-only or | + | | | writable | + +------------------+-------------+-------------------------------+ + | :attr:`doc` | char \* | points to the contents of the | + | | | docstring | + +------------------+-------------+-------------------------------+ + + :attr:`type` can be one of many ``T_`` macros corresponding to various C + types. When the member is accessed in Python, it will be converted to the + equivalent Python type. + + =============== ================== + Macro name C type + =============== ================== + T_SHORT short + T_INT int + T_LONG long + T_FLOAT float + T_DOUBLE double + T_STRING char \* + T_OBJECT PyObject \* + T_OBJECT_EX PyObject \* + T_CHAR char + T_BYTE char + T_UNBYTE unsigned char + T_UINT unsigned int + T_USHORT unsigned short + T_ULONG unsigned long + T_BOOL char + T_LONGLONG long long + T_ULONGLONG unsigned long long + T_PYSSIZET Py_ssize_t + =============== ================== + + :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that + :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and + :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. + + :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for + read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` + members can be deleted. (They are set to *NULL*). Modified: python/branches/py3k/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k/Doc/distutils/apiref.rst (original) +++ python/branches/py3k/Doc/distutils/apiref.rst Sat Jan 3 23:47:39 2009 @@ -188,9 +188,10 @@ | | for C/C++ header files (in | | | | Unix form for portability) | | +------------------------+--------------------------------+---------------------------+ - | *define_macros* | list of macros to define; each | (string,string) tuple or | - | | macro is defined using a | (name,``None``) | - | | 2-tuple, where 'value' is | | + | *define_macros* | list of macros to define; each | (string, string) tuple or | + | | macro is defined using a | (name, ``None``) | + | | 2-tuple ``(name, value)``, | | + | | where *value* is | | | | either the string to define it | | | | to or ``None`` to define it | | | | without a particular value | | Modified: python/branches/py3k/Doc/howto/functional.rst ============================================================================== --- python/branches/py3k/Doc/howto/functional.rst (original) +++ python/branches/py3k/Doc/howto/functional.rst Sat Jan 3 23:47:39 2009 @@ -586,7 +586,7 @@ 9 >>> next(it) Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? it.next() StopIteration Modified: python/branches/py3k/Doc/howto/urllib2.rst ============================================================================== --- python/branches/py3k/Doc/howto/urllib2.rst (original) +++ python/branches/py3k/Doc/howto/urllib2.rst Sat Jan 3 23:47:39 2009 @@ -475,7 +475,7 @@ password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. - # If we knew the realm, we could use it instead of ``None``. + # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) Modified: python/branches/py3k/Doc/install/index.rst ============================================================================== --- python/branches/py3k/Doc/install/index.rst (original) +++ python/branches/py3k/Doc/install/index.rst Sat Jan 3 23:47:39 2009 @@ -584,7 +584,7 @@ $ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 - Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. + Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', Modified: python/branches/py3k/Doc/library/email.mime.rst ============================================================================== --- python/branches/py3k/Doc/library/email.mime.rst (original) +++ python/branches/py3k/Doc/library/email.mime.rst Sat Jan 3 23:47:39 2009 @@ -55,14 +55,14 @@ .. currentmodule:: email.mime.multipart -.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) +.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A - :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be + :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added. Modified: python/branches/py3k/Doc/library/gzip.rst ============================================================================== --- python/branches/py3k/Doc/library/gzip.rst (original) +++ python/branches/py3k/Doc/library/gzip.rst Sat Jan 3 23:47:39 2009 @@ -7,7 +7,7 @@ This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would. -The data compression is provided by the :mod:``zlib`` module. +The data compression is provided by the :mod:`zlib` module. The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled after Python's File Object. The :class:`GzipFile` class reads and writes Modified: python/branches/py3k/Doc/library/http.cookiejar.rst ============================================================================== --- python/branches/py3k/Doc/library/http.cookiejar.rst (original) +++ python/branches/py3k/Doc/library/http.cookiejar.rst Sat Jan 3 23:47:39 2009 @@ -704,7 +704,7 @@ The :class:`Cookie` class also defines the following method: -.. method:: Cookie.is_expired([now=:const:`None`]) +.. method:: Cookie.is_expired([now=None]) True if cookie has passed the time at which the server requested it should expire. If *now* is given (in seconds since the epoch), return whether the Modified: python/branches/py3k/Doc/library/json.rst ============================================================================== --- python/branches/py3k/Doc/library/json.rst (original) +++ python/branches/py3k/Doc/library/json.rst Sat Jan 3 23:47:39 2009 @@ -151,7 +151,7 @@ *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. - To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the + To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the *cls* kwarg. Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Sat Jan 3 23:47:39 2009 @@ -107,12 +107,12 @@ def f(q): q.put([42, None, 'hello']) - if __name__ == '__main__': - q = Queue() - p = Process(target=f, args=(q,)) - p.start() - print(q.get()) # prints "[42, None, 'hello']" - p.join() + if __name__ == '__main__': + q = Queue() + p = Process(target=f, args=(q,)) + p.start() + print(q.get()) # prints "[42, None, 'hello']" + p.join() Queues are thread and process safe. @@ -1136,18 +1136,18 @@ Returns a :class:`Server` object which represents the actual server under the control of the Manager. The :class:`Server` object supports the - :meth:`serve_forever` method:: + :meth:`serve_forever` method: - >>> from multiprocessing.managers import BaseManager - >>> m = BaseManager(address=('', 50000), authkey='abc')) - >>> server = m.get_server() - >>> s.serve_forever() + >>> from multiprocessing.managers import BaseManager + >>> m = BaseManager(address=('', 50000), authkey='abc')) + >>> server = m.get_server() + >>> s.serve_forever() - :class:`Server` additionally have an :attr:`address` attribute. + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - Connect a local manager object to a remote manager process:: + Connect a local manager object to a remote manager process: >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) @@ -1293,7 +1293,7 @@ >>>>>>>>>>>>>>>>>>> To create one's own manager, one creates a subclass of :class:`BaseManager` and -use the :meth:`~BaseManager.resgister` classmethod to register new types or +use the :meth:`~BaseManager.register` classmethod to register new types or callables with the manager class. For example:: from multiprocessing.managers import BaseManager @@ -1809,7 +1809,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named - pipe on a remote computer called ServerName* one should use an address of the + pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be Modified: python/branches/py3k/Doc/library/numbers.rst ============================================================================== --- python/branches/py3k/Doc/library/numbers.rst (original) +++ python/branches/py3k/Doc/library/numbers.rst Sat Jan 3 23:47:39 2009 @@ -49,14 +49,14 @@ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``. - Real also provides defaults for :func:`complex`, :attr:`Complex.real`, - :attr:`Complex.imag`, and :meth:`Complex.conjugate`. + Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, + :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. .. class:: Rational Subtypes :class:`Real` and adds - :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which + :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which should be in lowest terms. With these, it provides a default for :func:`float`. @@ -72,8 +72,8 @@ .. class:: Integral Subtypes :class:`Rational` and adds a conversion to :class:`int`. - Provides defaults for :func:`float`, :attr:`Rational.numerator`, and - :attr:`Rational.denominator`, and bit-string operations: ``<<``, + Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and + :attr:`~Rational.denominator`, and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``. @@ -169,7 +169,7 @@ knowledge of ``A``, so it can handle those instances before delegating to :class:`Complex`. -If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, +If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``. Modified: python/branches/py3k/Doc/library/parser.rst ============================================================================== --- python/branches/py3k/Doc/library/parser.rst (original) +++ python/branches/py3k/Doc/library/parser.rst Sat Jan 3 23:47:39 2009 @@ -635,7 +635,7 @@ while the long form uses an indented block and allows nested definitions:: def make_power(exp): - "Make a function that raises an argument to the exponent `exp'." + "Make a function that raises an argument to the exponent `exp`." def raiser(x, y=exp): return x ** y return raiser Modified: python/branches/py3k/Doc/library/smtplib.rst ============================================================================== --- python/branches/py3k/Doc/library/smtplib.rst (original) +++ python/branches/py3k/Doc/library/smtplib.rst Sat Jan 3 23:47:39 2009 @@ -200,7 +200,7 @@ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. - :exc:SMTPHeloError + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. .. method:: SMTP.has_extn(name) Modified: python/branches/py3k/Doc/library/urllib.parse.rst ============================================================================== --- python/branches/py3k/Doc/library/urllib.parse.rst (original) +++ python/branches/py3k/Doc/library/urllib.parse.rst Sat Jan 3 23:47:39 2009 @@ -365,7 +365,7 @@ 'http://www.Python.org/doc/' -The following classes provide the implementations of the parse results:: +The following classes provide the implementations of the parse results: .. class:: BaseResult Modified: python/branches/py3k/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/inputoutput.rst (original) +++ python/branches/py3k/Doc/tutorial/inputoutput.rst Sat Jan 3 23:47:39 2009 @@ -151,7 +151,7 @@ other='Georg')) The story of Bill, Manfred, and Georg. -An optional ``':``` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This also greater control over how the value is formatted. The following example truncates the Pi to three places after the decimal. Modified: python/branches/py3k/Doc/using/cmdline.rst ============================================================================== --- python/branches/py3k/Doc/using/cmdline.rst (original) +++ python/branches/py3k/Doc/using/cmdline.rst Sat Jan 3 23:47:39 2009 @@ -343,7 +343,7 @@ compiled form). Extension modules cannot be imported from zipfiles. The default search path is installation dependent, but generally begins with - :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It + :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. An additional directory will be inserted in the search path in front of Modified: python/branches/py3k/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.4.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.4.rst Sat Jan 3 23:47:39 2009 @@ -1428,7 +1428,7 @@ you get the following output:: ********************************************************************** - File ``t.py'', line 15, in g + File "t.py", line 15, in g Failed example: g(4) Differences (unified diff with -expected +actual): 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 Sat Jan 3 23:47:39 2009 @@ -485,7 +485,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration 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 Sat Jan 3 23:47:39 2009 @@ -103,7 +103,23 @@ :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. -* To be written. +* 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 + error, or raises a :exc:`CalledProcessError` exception otherwise. + + :: + + >>> subprocess.check_output(['df', '-h', '.']) + 'Filesystem Size Used Avail Capacity Mounted on\n + /dev/disk0s2 52G 49G 3.0G 94% /\n' + + >>> subprocess.check_output(['df', '-h', '/bogus']) + ... + subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1 + + (Contributed by Gregory P. Smith.) + .. ====================================================================== .. whole new modules get described in subsections here @@ -116,13 +132,22 @@ Changes to Python's build process and to the C API include: -* To be written. +* 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`.) .. ====================================================================== Port-Specific Changes: Windows ----------------------------------- +* The :mod:`msvcrt` module now contains some constants from + the :file:`crtassem.h` header file: + :data:`CRT_ASSEMBLY_VERSION`, + :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`, + and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. + (Added by Martin von Loewis (XXX check); :issue:`4365`.) .. ====================================================================== Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat Jan 3 23:47:39 2009 @@ -777,8 +777,8 @@ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) if test -f $(LDLIBRARY); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ Modified: python/branches/py3k/Parser/asdl.py ============================================================================== --- python/branches/py3k/Parser/asdl.py (original) +++ python/branches/py3k/Parser/asdl.py Sat Jan 3 23:47:39 2009 @@ -176,7 +176,7 @@ return Product(fields) def p_sum_0(self, constructor): - " sum ::= constructor """ + " sum ::= constructor " return [constructor[0]] def p_sum_1(self, info): From python-checkins at python.org Sat Jan 3 23:48:18 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:48:18 +0100 (CET) Subject: [Python-checkins] r68248 - python/branches/py3k Message-ID: <20090103224818.7A9CD1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:48:18 2009 New Revision: 68248 Log: Blocked revisions 68179,68208-68209,68238,68240 via svnmerge ........ r68179 | raymond.hettinger | 2009-01-02 22:26:45 +0100 (Fri, 02 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ........ r68208 | raymond.hettinger | 2009-01-03 20:02:23 +0100 (Sat, 03 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ........ r68209 | raymond.hettinger | 2009-01-03 20:08:10 +0100 (Sat, 03 Jan 2009) | 1 line Reapply r68191. ........ r68238 | georg.brandl | 2009-01-03 23:03:11 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r68095,68186,68187,68188,68190 from 2.6 branch. ........ r68240 | georg.brandl | 2009-01-03 23:05:22 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r67868 from 2.6 branch. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 3 23:55:39 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 3 Jan 2009 23:55:39 +0100 (CET) Subject: [Python-checkins] r68249 - python/branches/py3k/Lib/test/test_urllib.py Message-ID: <20090103225539.336891E401C@bag.python.org> Author: antoine.pitrou Date: Sat Jan 3 23:55:38 2009 New Revision: 68249 Log: test_urllib would set environment variable NO_PROXY without removing it afterwards. 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 Sat Jan 3 23:55:38 2009 @@ -130,10 +130,14 @@ os.environ[k] = v def test_getproxies_environment_keep_no_proxies(self): - os.environ['NO_PROXY'] = 'localhost' - proxies = urllib.request.getproxies_environment() - # getproxies_environment use lowered case truncated (no '_proxy') keys - self.assertEquals('localhost', proxies['no']) + try: + os.environ['NO_PROXY'] = 'localhost' + proxies = urllib.request.getproxies_environment() + # getproxies_environment use lowered case truncated (no '_proxy') keys + self.assertEquals('localhost', proxies['no']) + finally: + # The old value will be restored by tearDown, if applicable. + del os.environ['NO_PROXY'] class urlopen_HttpTests(unittest.TestCase): From python-checkins at python.org Sat Jan 3 23:59:51 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 3 Jan 2009 23:59:51 +0100 (CET) Subject: [Python-checkins] r68250 - python/branches/release30-maint Message-ID: <20090103225951.E3E3D1E4002@bag.python.org> Author: georg.brandl Date: Sat Jan 3 23:59:51 2009 New Revision: 68250 Log: Blocked revisions 67702,67749,67763,67798,67823,67903,67942,67983,68015,68090,68094,68136,68138,68225,68233,68246,68248 via svnmerge ................ r67702 | mark.dickinson | 2008-12-11 10:22:25 +0100 (Thu, 11 Dec 2008) | 12 lines Blocked revisions 67694 via svnmerge ........ r67694 | facundo.batista | 2008-12-11 04:19:46 +0000 (Thu, 11 Dec 2008) | 6 lines Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to give correct results in the case where one argument is a quiet NaN and the other is a finite number that requires rounding. Thanks Mark Dickinson. ........ ................ r67749 | benjamin.peterson | 2008-12-14 02:53:41 +0100 (Sun, 14 Dec 2008) | 8 lines Blocked revisions 67748 via svnmerge ........ r67748 | benjamin.peterson | 2008-12-13 19:46:11 -0600 (Sat, 13 Dec 2008) | 1 line remove has_key usage ........ ................ r67763 | antoine.pitrou | 2008-12-14 18:44:09 +0100 (Sun, 14 Dec 2008) | 8 lines Blocked revisions 67762 via svnmerge ........ r67762 | antoine.pitrou | 2008-12-14 18:40:51 +0100 (dim., 14 d?\195?\169c. 2008) | 3 lines Backport r67759 (fix io.IncrementalNewlineDecoder for UTF-16 et al.). ........ ................ r67798 | amaury.forgeotdarc | 2008-12-15 23:10:56 +0100 (Mon, 15 Dec 2008) | 10 lines Blocked revisions 67797 via svnmerge ........ r67797 | amaury.forgeotdarc | 2008-12-15 22:47:57 +0100 (Mon, 15 Dec 2008) | 4 lines #3954: Fix error handling code in _hotshot.logreader Will port to 2.6. hotshot was deleted from python 3. ........ ................ r67823 | mark.dickinson | 2008-12-17 17:16:41 +0100 (Wed, 17 Dec 2008) | 10 lines Blocked revisions 67822 via svnmerge ........ r67822 | mark.dickinson | 2008-12-17 16:14:37 +0000 (Wed, 17 Dec 2008) | 4 lines Issue #3439: add bit_length method to int and long. Thanks Fredrik Johansson and Victor Stinner for code, Raymond Hettinger for review. ........ ................ r67903 | benjamin.peterson | 2008-12-22 21:19:52 +0100 (Mon, 22 Dec 2008) | 8 lines Blocked revisions 67902 via svnmerge ........ r67902 | benjamin.peterson | 2008-12-22 14:16:25 -0600 (Mon, 22 Dec 2008) | 1 line add py3k warnings to frame.f_exc_* ........ ................ r67942 | alexandre.vassalotti | 2008-12-27 10:59:15 +0100 (Sat, 27 Dec 2008) | 14 lines Blocked revisions 67934-67935 via svnmerge ........ r67934 | alexandre.vassalotti | 2008-12-27 02:08:47 -0500 (Sat, 27 Dec 2008) | 4 lines Fix issue #4730: cPickle corrupts high-unicode strings. Update outdated copy of PyUnicode_EncodeRawUnicodeEscape. Add a test case. ........ r67935 | alexandre.vassalotti | 2008-12-27 02:13:01 -0500 (Sat, 27 Dec 2008) | 2 lines Add Misc/NEWS entry for r67934. ........ ................ r67983 | benjamin.peterson | 2008-12-28 16:44:55 +0100 (Sun, 28 Dec 2008) | 12 lines Blocked revisions 67976 via svnmerge ........ r67976 | georg.brandl | 2008-12-28 05:54:53 -0600 (Sun, 28 Dec 2008) | 7 lines Backport r67974: #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6. ........ ................ r68015 | benjamin.peterson | 2008-12-29 18:50:07 +0100 (Mon, 29 Dec 2008) | 8 lines Blocked revisions 68014 via svnmerge ........ r68014 | benjamin.peterson | 2008-12-29 11:47:42 -0600 (Mon, 29 Dec 2008) | 1 line #4764 set IOError.filename when trying to open a directory on POSIX platforms ........ ................ r68090 | benjamin.peterson | 2008-12-31 04:41:35 +0100 (Wed, 31 Dec 2008) | 8 lines Blocked revisions 68089 via svnmerge ........ r68089 | benjamin.peterson | 2008-12-30 21:37:51 -0600 (Tue, 30 Dec 2008) | 1 line #4788 qualify some bare except clauses ........ ................ r68094 | benjamin.peterson | 2008-12-31 05:13:40 +0100 (Wed, 31 Dec 2008) | 8 lines Blocked revisions 68092 via svnmerge ........ r68092 | benjamin.peterson | 2008-12-30 22:08:55 -0600 (Tue, 30 Dec 2008) | 1 line fix name collision issues ........ ................ r68136 | georg.brandl | 2009-01-01 16:49:47 +0100 (Thu, 01 Jan 2009) | 12 lines Blocked revisions 67967,67980 via svnmerge ........ r67967 | benjamin.peterson | 2008-12-27 23:18:58 +0100 (Sat, 27 Dec 2008) | 1 line fix markup ........ r67980 | antoine.pitrou | 2008-12-28 15:24:29 +0100 (Sun, 28 Dec 2008) | 1 line wrong version number in doc changes committed in r67979 ........ ................ r68138 | georg.brandl | 2009-01-01 16:55:56 +0100 (Thu, 01 Jan 2009) | 9 lines Blocked revisions 67955 via svnmerge ........ r67955 | georg.brandl | 2008-12-27 19:27:53 +0100 (Sat, 27 Dec 2008) | 3 lines Follow-up to r67746 in order to restore backwards-compatibility for those who (monkey-)patch TextWrapper.wordsep_re with a custom RE. ........ ................ r68225 | georg.brandl | 2009-01-03 22:17:44 +0100 (Sat, 03 Jan 2009) | 8 lines Blocked revisions 68220 via svnmerge ........ r68220 | georg.brandl | 2009-01-03 21:55:06 +0100 (Sat, 03 Jan 2009) | 2 lines Remove trailing whitespace. ........ ................ r68233 | guilherme.polo | 2009-01-03 22:53:34 +0100 (Sat, 03 Jan 2009) | 10 lines Blocked revisions 68231 via svnmerge ........ r68231 | guilherme.polo | 2009-01-03 19:51:09 -0200 (Sat, 03 Jan 2009) | 4 lines The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x (part of issue #3638). ........ ................ r68246 | georg.brandl | 2009-01-03 23:37:17 +0100 (Sat, 03 Jan 2009) | 32 lines Blocked revisions 68150,68156,68158-68161,68163 via svnmerge ........ r68150 | ronald.oussoren | 2009-01-02 12:46:05 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue 3433 ........ r68156 | ronald.oussoren | 2009-01-02 15:10:20 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue1594 ........ r68158 | ronald.oussoren | 2009-01-02 15:46:19 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 900949 ........ r68159 | ronald.oussoren | 2009-01-02 15:48:17 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 1627952 ........ r68160 | ronald.oussoren | 2009-01-02 15:52:09 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue r1737832 ........ r68161 | ronald.oussoren | 2009-01-02 16:00:05 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 1149804 ........ r68163 | ronald.oussoren | 2009-01-02 16:25:36 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issues #841800 and #900506 ........ ................ r68248 | georg.brandl | 2009-01-03 23:48:18 +0100 (Sat, 03 Jan 2009) | 24 lines Blocked revisions 68179,68208-68209,68238,68240 via svnmerge ........ r68179 | raymond.hettinger | 2009-01-02 22:26:45 +0100 (Fri, 02 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ........ r68208 | raymond.hettinger | 2009-01-03 20:02:23 +0100 (Sat, 03 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ........ r68209 | raymond.hettinger | 2009-01-03 20:08:10 +0100 (Sat, 03 Jan 2009) | 1 line Reapply r68191. ........ r68238 | georg.brandl | 2009-01-03 23:03:11 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r68095,68186,68187,68188,68190 from 2.6 branch. ........ r68240 | georg.brandl | 2009-01-03 23:05:22 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r67868 from 2.6 branch. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 00:00:09 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 4 Jan 2009 00:00:09 +0100 (CET) Subject: [Python-checkins] r68251 - in python/branches/release30-maint: Lib/test/test_urllib.py Message-ID: <20090103230009.19FA51E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 4 00:00:08 2009 New Revision: 68251 Log: Merged revisions 68249 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68249 | antoine.pitrou | 2009-01-03 23:55:38 +0100 (sam., 03 janv. 2009) | 3 lines test_urllib would set environment variable NO_PROXY without removing it afterwards. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_urllib.py Modified: python/branches/release30-maint/Lib/test/test_urllib.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_urllib.py (original) +++ python/branches/release30-maint/Lib/test/test_urllib.py Sun Jan 4 00:00:08 2009 @@ -130,10 +130,14 @@ os.environ[k] = v def test_getproxies_environment_keep_no_proxies(self): - os.environ['NO_PROXY'] = 'localhost' - proxies = urllib.request.getproxies_environment() - # getproxies_environment use lowered case truncated (no '_proxy') keys - self.assertEquals('localhost', proxies['no']) + try: + os.environ['NO_PROXY'] = 'localhost' + proxies = urllib.request.getproxies_environment() + # getproxies_environment use lowered case truncated (no '_proxy') keys + self.assertEquals('localhost', proxies['no']) + finally: + # The old value will be restored by tearDown, if applicable. + del os.environ['NO_PROXY'] class urlopen_HttpTests(unittest.TestCase): From nnorwitz at gmail.com Sun Jan 4 00:15:02 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 3 Jan 2009 18:15:02 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090103231502.GA25612@python.psfb.org> svn update tools/sphinx At revision 68251. svn update tools/docutils At revision 68251. svn update tools/jinja At revision 68251. svn update tools/pygments At revision 68251. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html Exception occurred: File "/home/neal/python/trunk/Doc/tools/sphinx/jinja/loaders.py", line 20, in from jinja.utils import CacheDict, raise_syntax_error ImportError: cannot import name raise_syntax_error The full traceback has been saved in /tmp/sphinx-err-Bx__ab.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-dev at googlegroups.com. Thanks! make: *** [build] Error 1 From python-checkins at python.org Sun Jan 4 00:25:34 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:25:34 +0100 (CET) Subject: [Python-checkins] r68252 - in python/branches/release30-maint: Doc/extending/embedding.rst Doc/extending/extending.rst Doc/howto/functional.rst Doc/includes/noddy.c Doc/includes/noddy2.c Doc/includes/noddy3.c Doc/includes/noddy4.c Doc/library/functions.rst Doc/library/stdtypes.rst Doc/reference/lexical_analysis.rst Doc/tutorial/datastructures.rst Doc/tutorial/modules.rst Doc/whatsnew/3.0.rst Lib/http/client.py Lib/test/test_array.py Lib/test/test_deque.py Lib/test/test_httplib.py Lib/test/test_set.py Lib/traceback.py Lib/webbrowser.py Mac/BuildScript/build-installer.py Modules/_fileio.c Objects/floatobject.c Parser/tokenizer.c Python/getargs.c Message-ID: <20090103232534.D98AB1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:25:33 2009 New Revision: 68252 Log: Merged revisions 67653,67655,67682-67683,67724,67755,67780-67783,67786,67789,67841,67843,67865,67881,67884,67925,67929,67931 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r67653 | neal.norwitz | 2008-12-07 23:42:03 +0100 (Sun, 07 Dec 2008) | 1 line Remove unnecessary import ........ r67655 | georg.brandl | 2008-12-07 23:45:56 +0100 (Sun, 07 Dec 2008) | 2 lines #4586: fix usage of Py_InitModule. ........ r67682 | georg.brandl | 2008-12-10 00:48:44 +0100 (Wed, 10 Dec 2008) | 1 line #4592: fix embedding example with new C API changes. ........ r67683 | fred.drake | 2008-12-10 07:02:39 +0100 (Wed, 10 Dec 2008) | 2 lines simplify imports ........ r67724 | benjamin.peterson | 2008-12-13 04:03:41 +0100 (Sat, 13 Dec 2008) | 1 line string.maketrans -> str.maketrans ........ r67755 | benjamin.peterson | 2008-12-14 16:09:34 +0100 (Sun, 14 Dec 2008) | 1 line tip-toe around dictionary keys view in the tutorial ........ r67780 | jeremy.hylton | 2008-12-15 04:00:50 +0100 (Mon, 15 Dec 2008) | 2 lines Use True/False for ints instead of 1/0. That's so Python 2.0. ........ r67781 | jeremy.hylton | 2008-12-15 04:08:30 +0100 (Mon, 15 Dec 2008) | 2 lines Reflow long line. ........ r67782 | georg.brandl | 2008-12-15 09:28:37 +0100 (Mon, 15 Dec 2008) | 2 lines #4667: fix some 2.x leftovers in the tutorial. ........ r67783 | georg.brandl | 2008-12-15 09:29:32 +0100 (Mon, 15 Dec 2008) | 2 lines #4668: wrap iterator returns in list() in functional howto. ........ r67786 | georg.brandl | 2008-12-15 09:43:10 +0100 (Mon, 15 Dec 2008) | 2 lines #4603: Note that inconsistent tab/space use is now illegal. ........ r67789 | georg.brandl | 2008-12-15 10:16:15 +0100 (Mon, 15 Dec 2008) | 2 lines Use :samp: role. ........ r67841 | kristjan.jonsson | 2008-12-18 18:08:57 +0100 (Thu, 18 Dec 2008) | 2 lines Add missing Py_CHARMASK when calling isspace(). Found by enabling runtime tests on windows, by disabling the _set_invalid_parameter_handler() fiddling. ........ r67843 | kristjan.jonsson | 2008-12-18 18:15:54 +0100 (Thu, 18 Dec 2008) | 5 lines Fix an issue in the tokenizer, where a file is opened by fd, but the underlying PyFileIO object wasn created with the closefd attribute true. Also fix error handling for close() int _fileio.c . It was incorrect, looking for a negative refcount, and so errors weren't raised. This is why this issue wasn't caught. There is a second reason why it isn't seen: Class IOBase in io.py has a try:/except: around the close() funtion in the __del__() method. This also masks these error conditions. This issue was discovered by removing the _set_invalid_parameter_handler() fiddling, thus enabling the C runtime checks on windows. ........ r67865 | benjamin.peterson | 2008-12-20 04:20:23 +0100 (Sat, 20 Dec 2008) | 1 line fix syntax ........ r67881 | benjamin.peterson | 2008-12-20 23:50:25 +0100 (Sat, 20 Dec 2008) | 1 line unpy3kize this; it require 2.x only Mac modules ........ r67884 | benjamin.peterson | 2008-12-21 00:06:29 +0100 (Sun, 21 Dec 2008) | 1 line don't build bsddb anymore ........ r67925 | benjamin.peterson | 2008-12-24 17:27:25 +0100 (Wed, 24 Dec 2008) | 1 line return the module object from PyMODINIT_FUNC ........ r67929 | benjamin.peterson | 2008-12-27 03:58:34 +0100 (Sat, 27 Dec 2008) | 1 line string -> bytes in error message #4745 ........ r67931 | hirokazu.yamamoto | 2008-12-27 05:21:44 +0100 (Sat, 27 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. This enables test for protocol 3 (== HIGHEST_PROTOCOL in 3.x) ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/extending/embedding.rst python/branches/release30-maint/Doc/extending/extending.rst python/branches/release30-maint/Doc/howto/functional.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/library/functions.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/reference/lexical_analysis.rst python/branches/release30-maint/Doc/tutorial/datastructures.rst python/branches/release30-maint/Doc/tutorial/modules.rst python/branches/release30-maint/Doc/whatsnew/3.0.rst python/branches/release30-maint/Lib/http/client.py python/branches/release30-maint/Lib/test/test_array.py python/branches/release30-maint/Lib/test/test_deque.py python/branches/release30-maint/Lib/test/test_httplib.py python/branches/release30-maint/Lib/test/test_set.py python/branches/release30-maint/Lib/traceback.py python/branches/release30-maint/Lib/webbrowser.py python/branches/release30-maint/Mac/BuildScript/build-installer.py python/branches/release30-maint/Modules/_fileio.c python/branches/release30-maint/Objects/floatobject.c python/branches/release30-maint/Parser/tokenizer.c python/branches/release30-maint/Python/getargs.c Modified: python/branches/release30-maint/Doc/extending/embedding.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/embedding.rst (original) +++ python/branches/release30-maint/Doc/extending/embedding.rst Sun Jan 4 00:25:33 2009 @@ -218,11 +218,22 @@ {NULL, NULL, 0, NULL} }; + static PyModuleDef EmbModule = { + PyModuleDef_HEAD_INIT, "emb", NULL, -1, EmbMethods, + NULL, NULL, NULL, NULL + }; + + static PyObject* + PyInit_emb(void) + { + return PyModule_Create(&EmbModule); + } + Insert the above code just above the :cfunc:`main` function. Also, insert the -following two statements directly after :cfunc:`Py_Initialize`:: +following two statements before the call to :cfunc:`Py_Initialize`:: numargs = argc; - Py_InitModule("emb", EmbMethods); + PyImport_AppendInittab("emb", &PyInit_emb); These two lines initialize the ``numargs`` variable, and make the :func:`emb.numargs` function accessible to the embedded Python interpreter. Modified: python/branches/release30-maint/Doc/extending/extending.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/extending.rst (original) +++ python/branches/release30-maint/Doc/extending/extending.rst Sun Jan 4 00:25:33 2009 @@ -326,8 +326,8 @@ return PyModule_Create(&spammodule); } -Note that PyMODINIT_FUNC declares the function as ``void`` return type, -declares any special linkage declarations required by the platform, and for C++ +Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return type, +declares any special linkage declarations required by the platform, and for C++ declares the function as ``extern "C"``. When the Python program imports module :mod:`spam` for the first time, @@ -342,7 +342,7 @@ so that it then gets inserted into ``sys.modules``. When embedding Python, the :cfunc:`PyInit_spam` function is not called -automatically unless there's an entry in the :cdata:`_PyImport_Inittab` table. +automatically unless there's an entry in the :cdata:`PyImport_Inittab` table. To add the module to the initialization table, use :cfunc:`PyImport_AppendInittab`, optionally followed by an import of the module:: Modified: python/branches/release30-maint/Doc/howto/functional.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/functional.rst (original) +++ python/branches/release30-maint/Doc/howto/functional.rst Sun Jan 4 00:25:33 2009 @@ -634,7 +634,7 @@ ... return s.upper() - >>> map(upper, ['sentence', 'fragment']) + >>> list(map(upper, ['sentence', 'fragment'])) ['SENTENCE', 'FRAGMENT'] >>> [upper(s) for s in ['sentence', 'fragment']] ['SENTENCE', 'FRAGMENT'] @@ -650,7 +650,7 @@ >>> def is_even(x): ... return (x % 2) == 0 - >>> filter(is_even, range(10)) + >>> list(filter(is_even, range(10))) [0, 2, 4, 6, 8] 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 Sun Jan 4 00:25:33 2009 @@ -52,4 +52,5 @@ Py_INCREF(&noddy_NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType); + return m; } 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 Sun Jan 4 00:25:33 2009 @@ -186,4 +186,5 @@ Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); + return m; } 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 Sun Jan 4 00:25:33 2009 @@ -239,4 +239,5 @@ Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); + return m; } 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 Sun Jan 4 00:25:33 2009 @@ -221,4 +221,5 @@ Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); + return m; } 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 Sun Jan 4 00:25:33 2009 @@ -289,7 +289,7 @@ :func:`enumerate` is useful for obtaining an indexed series: ``(0, seq[0])``, ``(1, seq[1])``, ``(2, seq[2])``, .... For example: - >>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter')]: + >>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']): ... print(i, season) 0 Spring 1 Summer 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 Sun Jan 4 00:25:33 2009 @@ -1090,12 +1090,9 @@ ordinals, strings or ``None``. Unmapped characters are left untouched. Characters mapped to ``None`` are deleted. - A *map* for :meth:`translate` is usually best created by - :meth:`str.maketrans`. - - You can use the :func:`maketrans` helper function in the :mod:`string` module to - create a translation table. For string objects, set the *table* argument to - ``None`` for translations that only delete characters: + You can use :meth:`str.maketrans` to create a translation table. For string + objects, set the *table* argument to ``None`` for translations that only + delete characters: .. note:: Modified: python/branches/release30-maint/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/lexical_analysis.rst (original) +++ python/branches/release30-maint/Doc/reference/lexical_analysis.rst Sun Jan 4 00:25:33 2009 @@ -174,14 +174,18 @@ to compute the indentation level of the line, which in turn is used to determine the grouping of statements. -First, tabs are replaced (from left to right) by one to eight spaces such that -the total number of characters up to and including the replacement is a multiple -of eight (this is intended to be the same rule as used by Unix). The total -number of spaces preceding the first non-blank character then determines the -line's indentation. Indentation cannot be split over multiple physical lines -using backslashes; the whitespace up to the first backslash determines the +Tabs are replaced (from left to right) by one to eight spaces such that the +total number of characters up to and including the replacement is a multiple of +eight (this is intended to be the same rule as used by Unix). The total number +of spaces preceding the first non-blank character then determines the line's +indentation. Indentation cannot be split over multiple physical lines using +backslashes; the whitespace up to the first backslash determines the indentation. +Indentation is rejected as inconsistent if a source file mixes tabs and spaces +in a way that makes the meaning dependent on the worth of a tab in spaces; a +:exc:`TabError` is raised in that case. + **Cross-platform compatibility note:** because of the nature of text editors on non-UNIX platforms, it is unwise to use a mixture of spaces and tabs for the indentation in a single source file. It should also be noted that different Modified: python/branches/release30-maint/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/datastructures.rst (original) +++ python/branches/release30-maint/Doc/tutorial/datastructures.rst Sun Jan 4 00:25:33 2009 @@ -440,9 +440,9 @@ value associated with that key is forgotten. It is an error to extract a value using a non-existent key. -The :meth:`keys` method of a dictionary object returns a list of all the keys +Performing ``list(d.keys())`` on a dictionary returns a list of all the keys used in the dictionary, in arbitrary order (if you want it sorted, just apply -the :meth:`sort` method to the list of keys). To check whether a single key is +the :meth:`sorted` function instead). To check whether a single key is in the dictionary, use the :keyword:`in` keyword. Here is a small example using a dictionary:: @@ -458,6 +458,8 @@ >>> tel {'guido': 4127, 'irv': 4127, 'jack': 4098} >>> list(tel.keys()) + ['irv', 'guido', 'jack'] + >>> sorted(tel.keys()) ['guido', 'irv', 'jack'] >>> 'guido' in tel True 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 Jan 4 00:25:33 2009 @@ -112,7 +112,7 @@ For efficiency reasons, each module is only imported once per interpreter session. Therefore, if you change your modules, you must restart the interpreter -- or, if it's just one module you want to test interactively, - use :func:`reload`, e.g. ``reload(modulename)``. + use :func:`imp.reload`, e.g. ``import imp; imp.reload(modulename)``. .. _tut-modulesasscripts: Modified: python/branches/release30-maint/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/3.0.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/3.0.rst Sun Jan 4 00:25:33 2009 @@ -696,15 +696,15 @@ * Exceptions no longer behave as sequences. Use the :attr:`args` attribute instead. -* :pep:`3109`: Raising exceptions. You must now use :keyword:`raise` - *Exception*(*args*) instead of :keyword:`raise` *Exception*, *args*. +* :pep:`3109`: Raising exceptions. You must now use :samp:`raise + {Exception}({args})` instead of :samp:`raise {Exception}, {args}`. Additionally, you can no longer explicitly specify a traceback; instead, if you *have* to do this, you can assign directly to the :attr:`__traceback__` attribute (see below). * :pep:`3110`: Catching exceptions. You must now use - :keyword:`except` *SomeException* :keyword:`as` *variable* instead - of :keyword:`except` *SomeException*, *variable*. Moreover, the + :samp:`except {SomeException} as {variable}` instead + of :samp:`except {SomeException}, {variable}`. Moreover, the *variable* is explicitly deleted when the :keyword:`except` block is left. 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 Sun Jan 4 00:25:33 2009 @@ -359,8 +359,8 @@ if self.version == 9: self.length = None - self.chunked = 0 - self.will_close = 1 + self.chunked = False + self.will_close = True self.msg = email.message_from_string('') return @@ -373,10 +373,10 @@ # are we using the chunked-style of transfer encoding? tr_enc = self.msg.get("transfer-encoding") if tr_enc and tr_enc.lower() == "chunked": - self.chunked = 1 + self.chunked = True self.chunk_left = None else: - self.chunked = 0 + self.chunked = False # will the connection close at the end of the response? self.will_close = self._check_close() @@ -411,7 +411,7 @@ if (not self.will_close and not self.chunked and self.length is None): - self.will_close = 1 + self.will_close = True def _check_close(self): conn = self.msg.get("connection") Modified: python/branches/release30-maint/Lib/test/test_array.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_array.py (original) +++ python/branches/release30-maint/Lib/test/test_array.py Sun Jan 4 00:25:33 2009 @@ -7,7 +7,7 @@ from test import support from weakref import proxy import array, io, math -from pickle import loads, dumps +from pickle import loads, dumps, HIGHEST_PROTOCOL import operator class ArraySubclass(array.array): @@ -98,7 +98,7 @@ self.assertEqual(a, b) def test_pickle(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode, self.example) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) @@ -113,7 +113,7 @@ self.assertEqual(type(a), type(b)) def test_pickle_for_empty_array(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) Modified: python/branches/release30-maint/Lib/test/test_deque.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_deque.py (original) +++ python/branches/release30-maint/Lib/test/test_deque.py Sun Jan 4 00:25:33 2009 @@ -375,7 +375,7 @@ def test_pickle(self): d = deque(range(200)) - for i in (0, 1, 2): + for i in range(pickle.HIGHEST_PROTOCOL + 1): s = pickle.dumps(d, i) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) @@ -384,7 +384,7 @@ ## def test_pickle_recursive(self): ## d = deque('abc') ## d.append(d) -## for i in (0, 1, 2): +## for i in range(pickle.HIGHEST_PROTOCOL + 1): ## e = pickle.loads(pickle.dumps(d, i)) ## self.assertNotEqual(id(d), id(e)) ## self.assertEqual(id(e), id(e[-1])) 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 Sun Jan 4 00:25:33 2009 @@ -188,7 +188,8 @@ resp.close() def test_negative_content_length(self): - sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n') + sock = FakeSocket( + 'HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n') resp = httplib.HTTPResponse(sock, method="GET") resp.begin() self.assertEquals(resp.read(), b'Hello\r\n') Modified: python/branches/release30-maint/Lib/test/test_set.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_set.py (original) +++ python/branches/release30-maint/Lib/test/test_set.py Sun Jan 4 00:25:33 2009 @@ -219,7 +219,7 @@ self.failIf(set('cbs').issuperset('a')) def test_pickling(self): - for i in (0, 1, 2): + for i in range(pickle.HIGHEST_PROTOCOL + 1): p = pickle.dumps(self.s, i) dup = pickle.loads(p) self.assertEqual(self.s, dup, "%s != %s" % (self.s, dup)) Modified: python/branches/release30-maint/Lib/traceback.py ============================================================================== --- python/branches/release30-maint/Lib/traceback.py (original) +++ python/branches/release30-maint/Lib/traceback.py Sun Jan 4 00:25:33 2009 @@ -2,7 +2,6 @@ import linecache import sys -import types __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', Modified: python/branches/release30-maint/Lib/webbrowser.py ============================================================================== --- python/branches/release30-maint/Lib/webbrowser.py (original) +++ python/branches/release30-maint/Lib/webbrowser.py Sun Jan 4 00:25:33 2009 @@ -2,6 +2,7 @@ """Interfaces for launching and remotely controlling Web browsers.""" # Maintained by Georg Brandl. +import io import os import shlex import sys @@ -223,7 +224,6 @@ cmdline = [self.name] + raise_opt + args if remote or self.background: - import io inout = io.open(os.devnull, "r+") else: # for TTY browsers, we need stdin/out @@ -348,7 +348,6 @@ else: action = "openURL" - import io devnull = io.open(os.devnull, "r+") # if possible, put browser in separate process group, so # keyboard interrupts don't affect browser as well as Python 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 Sun Jan 4 00:25:33 2009 @@ -9,8 +9,7 @@ Usage: see USAGE variable in the script. """ -import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd -import urllib.request +import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd import grp INCLUDE_TIMESTAMP = 1 @@ -55,7 +54,7 @@ if 'PY_VERSION' in ln: return ln.split()[-1][1:-1] - raise RuntimeError("Cannot find full version??") + raise RuntimeError, "Cannot find full version??" # The directory we'll use to create the build (will be erased and recreated) WORKDIR = "/tmp/_py" @@ -170,17 +169,6 @@ getVersion(), ), ), - dict( - name="Sleepycat DB 4.7.25", - url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz", - #name="Sleepycat DB 4.3.29", - #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz", - buildDir="build_unix", - configure="../dist/configure", - configure_pre=[ - '--includedir=/usr/local/include/db4', - ] - ), ] @@ -298,7 +286,7 @@ xit = fd.close() if xit is not None: sys.stdout.write(data) - raise RuntimeError("command failed: %s"%(commandline,)) + raise RuntimeError, "command failed: %s"%(commandline,) if VERBOSE: sys.stdout.write(data); sys.stdout.flush() @@ -309,7 +297,7 @@ xit = fd.close() if xit is not None: sys.stdout.write(data) - raise RuntimeError("command failed: %s"%(commandline,)) + raise RuntimeError, "command failed: %s"%(commandline,) return data @@ -342,17 +330,17 @@ try: options, args = getopt.getopt(args, '?hb', [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=']) - except getopt.error as msg: - print(msg) + except getopt.error, msg: + print msg sys.exit(1) if args: - print("Additional arguments") + print "Additional arguments" sys.exit(1) for k, v in options: if k in ('-h', '-?'): - print(USAGE) + print USAGE sys.exit(0) elif k in ('-d', '--build-dir'): @@ -368,19 +356,19 @@ SRCDIR=v else: - raise NotImplementedError(k) + raise NotImplementedError, k SRCDIR=os.path.abspath(SRCDIR) WORKDIR=os.path.abspath(WORKDIR) SDKPATH=os.path.abspath(SDKPATH) DEPSRC=os.path.abspath(DEPSRC) - print("Settings:") - print(" * Source directory:", SRCDIR) - print(" * Build directory: ", WORKDIR) - print(" * SDK location: ", SDKPATH) - print(" * third-party source:", DEPSRC) - print("") + print "Settings:" + print " * Source directory:", SRCDIR + print " * Build directory: ", WORKDIR + print " * SDK location: ", SDKPATH + print " * third-party source:", DEPSRC + print "" @@ -425,7 +413,7 @@ xit = fp.close() if xit is not None: sys.stdout.write(data) - raise RuntimeError("Cannot extract %s"%(archiveName,)) + raise RuntimeError, "Cannot extract %s"%(archiveName,) return os.path.join(builddir, retval) @@ -447,9 +435,9 @@ pass else: if KNOWNSIZES.get(url) == size: - print("Using existing file for", url) + print "Using existing file for", url return - fpIn = urllib.request.urlopen(url) + fpIn = urllib2.urlopen(url) fpOut = open(fname, 'wb') block = fpIn.read(10240) try: @@ -486,14 +474,14 @@ if os.path.exists(sourceArchive): - print("Using local copy of %s"%(name,)) + print "Using local copy of %s"%(name,) else: - print("Downloading %s"%(name,)) + print "Downloading %s"%(name,) downloadURL(url, sourceArchive) - print("Archive for %s stored as %s"%(name, sourceArchive)) + print "Archive for %s stored as %s"%(name, sourceArchive) - print("Extracting archive for %s"%(name,)) + print "Extracting archive for %s"%(name,) buildDir=os.path.join(WORKDIR, '_bld') if not os.path.exists(buildDir): os.mkdir(buildDir) @@ -556,14 +544,14 @@ configure_args.insert(0, configure) configure_args = [ shellQuote(a) for a in configure_args ] - print("Running configure for %s"%(name,)) + print "Running configure for %s"%(name,) runCommand(' '.join(configure_args) + ' 2>&1') - print("Running install for %s"%(name,)) + print "Running install for %s"%(name,) runCommand('{ ' + install + ' ;} 2>&1') - print("Done %s"%(name,)) - print("") + print "Done %s"%(name,) + print "" os.chdir(curdir) @@ -571,9 +559,9 @@ """ Build our dependencies into $WORKDIR/libraries/usr/local """ - print("") - print("Building required libraries") - print("") + print "" + print "Building required libraries" + print "" universal = os.path.join(WORKDIR, 'libraries') os.mkdir(universal) os.makedirs(os.path.join(universal, 'usr', 'local', 'lib')) @@ -587,7 +575,7 @@ def buildPythonDocs(): # This stores the documentation as Resources/English.lproj/Docuentation # inside the framwork. pydoc and IDLE will pick it up there. - print("Install python documentation") + print "Install python documentation" rootDir = os.path.join(WORKDIR, '_root') version = getVersion() docdir = os.path.join(rootDir, 'pydocs') @@ -596,13 +584,13 @@ name = 'html-%s.tar.bz2'%(getFullVersion(),) sourceArchive = os.path.join(DEPSRC, name) if os.path.exists(sourceArchive): - print("Using local copy of %s"%(name,)) + print "Using local copy of %s"%(name,) else: print "Downloading %s"%(novername,) downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( getFullVersion(), novername), sourceArchive) - print("Archive for %s stored as %s"%(name, sourceArchive)) + print "Archive for %s stored as %s"%(name, sourceArchive) extractArchive(os.path.dirname(docdir), sourceArchive) @@ -613,7 +601,7 @@ def buildPython(): - print("Building a universal python") + print "Building a universal python" buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') @@ -636,24 +624,24 @@ # several paths. version = getVersion() - print("Running configure...") + print "Running configure..." runCommand("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%( shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH), shellQuote(WORKDIR)[1:-1], shellQuote(WORKDIR)[1:-1])) - print("Running make") + print "Running make" runCommand("make") - print("Running make frameworkinstall") + print "Running make frameworkinstall" runCommand("make frameworkinstall DESTDIR=%s"%( shellQuote(rootDir))) - print("Running make frameworkinstallextras") + print "Running make frameworkinstallextras" runCommand("make frameworkinstallextras DESTDIR=%s"%( shellQuote(rootDir))) - print("Copying required shared libraries") + print "Copying required shared libraries" if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')): runCommand("mv %s/* %s"%( shellQuote(os.path.join( @@ -664,7 +652,7 @@ 'Python.framework', 'Versions', getVersion(), 'lib')))) - print("Fix file modes") + print "Fix file modes" frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') gid = grp.getgrnam('admin').gr_gid @@ -760,7 +748,7 @@ readme = textwrap.dedent(recipe['readme']) isRequired = recipe.get('required', True) - print("- building package %s"%(pkgname,)) + print "- building package %s"%(pkgname,) # Substitute some variables textvars = dict( @@ -1063,9 +1051,9 @@ shutil.copy('../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt')) fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w') - print("# BUILD INFO", file=fp) - print("# Date:", time.ctime(), file=fp) - print("# By:", pwd.getpwuid(os.getuid()).pw_gecos, file=fp) + print >> fp, "# BUILD INFO" + print >> fp, "# Date:", time.ctime() + print >> fp, "# By:", pwd.getpwuid(os.getuid()).pw_gecos fp.close() # Custom icon for the DMG, shown when the DMG is mounted. Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Sun Jan 4 00:25:33 2009 @@ -55,20 +55,27 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) -/* Returns 0 on success, errno (which is < 0) on failure. */ +/* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) { - int save_errno = 0; + int err = 0; + int save_errno; if (self->fd >= 0) { int fd = self->fd; self->fd = -1; Py_BEGIN_ALLOW_THREADS - if (close(fd) < 0) + err = close(fd); + if (err < 0) save_errno = errno; Py_END_ALLOW_THREADS } - return save_errno; + if (err < 0) { + errno = save_errno; + PyErr_SetFromErrno(PyExc_IOError); + return -1; + } + return 0; } static PyObject * @@ -78,11 +85,8 @@ self->fd = -1; Py_RETURN_NONE; } - errno = internal_close(self); - if (errno < 0) { - PyErr_SetFromErrno(PyExc_IOError); + if (internal_close(self)) return NULL; - } Py_RETURN_NONE; } @@ -121,7 +125,8 @@ if (fstat(self->fd, &buf) == 0 && S_ISDIR(buf.st_mode)) { char *msg = strerror(EISDIR); PyObject *exc; - internal_close(self); + if (internal_close(self)) + return -1; exc = PyObject_CallFunction(PyExc_IOError, "(is)", EISDIR, msg); @@ -306,11 +311,8 @@ PyObject_ClearWeakRefs((PyObject *) self); if (self->fd >= 0 && self->closefd) { - errno = internal_close(self); - if (errno < 0) { - PySys_WriteStderr("close failed: [Errno %d] %s\n", - errno, strerror(errno)); - } + if(internal_close(self)) + PyErr_WriteUnraisable((PyObject*)self); } Py_TYPE(self)->tp_free((PyObject *)self); Modified: python/branches/release30-maint/Objects/floatobject.c ============================================================================== --- python/branches/release30-maint/Objects/floatobject.c (original) +++ python/branches/release30-maint/Objects/floatobject.c Sun Jan 4 00:25:33 2009 @@ -1238,7 +1238,7 @@ ********************/ /* leading whitespace and optional sign */ - while (isspace(*s)) + while (isspace(Py_CHARMASK(*s))) s++; if (*s == '-') { s++; @@ -1308,7 +1308,7 @@ exp = 0; /* optional trailing whitespace leading to the end of the string */ - while (isspace(*s)) + while (isspace(Py_CHARMASK(*s))) s++; if (s != s_end) goto parse_error; Modified: python/branches/release30-maint/Parser/tokenizer.c ============================================================================== --- python/branches/release30-maint/Parser/tokenizer.c (original) +++ python/branches/release30-maint/Parser/tokenizer.c Sun Jan 4 00:25:33 2009 @@ -452,8 +452,8 @@ stream = PyObject_CallMethod(io, "open", "ssis", tok->filename, "r", -1, enc); else - stream = PyObject_CallMethod(io, "open", "isis", - fileno(tok->fp), "r", -1, enc); + stream = PyObject_CallMethod(io, "open", "isisOOO", + fileno(tok->fp), "r", -1, enc, Py_None, Py_None, Py_False); if (stream == NULL) goto cleanup; Modified: python/branches/release30-maint/Python/getargs.c ============================================================================== --- python/branches/release30-maint/Python/getargs.c (original) +++ python/branches/release30-maint/Python/getargs.c Sun Jan 4 00:25:33 2009 @@ -1392,7 +1392,7 @@ Py_ssize_t count; PyBufferProcs *pb = arg->ob_type->tp_as_buffer; if (pb == NULL) { - *errmsg = "string or buffer"; + *errmsg = "bytes or buffer"; return -1; } if (pb->bf_getbuffer) { From python-checkins at python.org Sun Jan 4 00:26:38 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:26:38 +0100 (CET) Subject: [Python-checkins] r68253 - python/branches/release30-maint Message-ID: <20090103232638.516E31E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:26:37 2009 New Revision: 68253 Log: Blocked revisions 67713,67715,67747,67824,67839,67851,67858,67939 via svnmerge ................ r67713 | benjamin.peterson | 2008-12-12 02:33:38 +0100 (Fri, 12 Dec 2008) | 1 line reuse tokenize.detect_encoding for linecache #4016 ................ r67715 | benjamin.peterson | 2008-12-12 03:02:24 +0100 (Fri, 12 Dec 2008) | 1 line revert r67713. it causes build problems ................ r67747 | antoine.pitrou | 2008-12-14 00:20:54 +0100 (Sun, 14 Dec 2008) | 3 lines Issue #4163: textwrap module: allow word splitting on a hyphen preceded by a non-ASCII letter. ................ r67824 | mark.dickinson | 2008-12-17 17:19:07 +0100 (Wed, 17 Dec 2008) | 2 lines Forward merge of r67822 to py3k: add bit_length method to int. ................ r67839 | antoine.pitrou | 2008-12-18 12:06:25 +0100 (Thu, 18 Dec 2008) | 9 lines Merged revisions 67818 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67818 | antoine.pitrou | 2008-12-17 01:38:28 +0100 (mer., 17 d?\195?\169c. 2008) | 3 lines Issue #2183: Simplify and optimize bytecode for list comprehensions. ........ ................ r67851 | raymond.hettinger | 2008-12-19 10:11:49 +0100 (Fri, 19 Dec 2008) | 9 lines Fix-up and clean-up docs for int.bit_length(). * Replace dramatic footnote with in-line comment about possible round-off errors in logarithms of large numbers. * Add comments to the pure python code equivalent. * replace floor() with int() in the mathematical equivalent so the type is correct (should be an int, not a float). * add abs() to the mathematical equivalent so that it matches the previous line that it is supposed to be equivalent to. * make one combined example with a negative input. ................ r67858 | mark.dickinson | 2008-12-19 18:48:51 +0100 (Fri, 19 Dec 2008) | 9 lines Merged revisions 67857 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67857 | mark.dickinson | 2008-12-19 17:46:51 +0000 (Fri, 19 Dec 2008) | 2 lines Fix typo in Python equivalent for bit_length. ........ ................ r67939 | alexandre.vassalotti | 2008-12-27 10:16:49 +0100 (Sat, 27 Dec 2008) | 6 lines Optimize built-in unicode codecs by avoiding unnecessary copying. The approach used is similiar to what is currently used in the version of unicodeobject.c in Python 2.x. The only difference is we use _PyBytes_Resize instead of _PyString_Resize. ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 00:28:57 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:28:57 +0100 (CET) Subject: [Python-checkins] r68254 - in python/branches/release30-maint: Misc/NEWS Modules/gcmodule.c Message-ID: <20090103232857.513521E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:28:57 2009 New Revision: 68254 Log: Merged revisions 67834 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r67834 | antoine.pitrou | 2008-12-18 00:18:19 +0100 (Thu, 18 Dec 2008) | 10 lines Merged revisions 67832 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67832 | antoine.pitrou | 2008-12-17 23:46:54 +0100 (mer., 17 d?\195?\169c. 2008) | 4 lines Issue #2467: gc.DEBUG_STATS reports invalid elapsed times. Patch by Neil Schemenauer, very slightly modified. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/gcmodule.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 00:28:57 2009 @@ -16,6 +16,12 @@ one byte. Also fixes the meaning of len() so that it returns the number of items, rather than the size in bytes. +- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always + print elapsed times, not only when some objects are uncollectable / + unreachable. Original patch by Neil Schemenauer. + +- Issue #3439: Add a bit_length method to int. + - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. Modified: python/branches/release30-maint/Modules/gcmodule.c ============================================================================== --- python/branches/release30-maint/Modules/gcmodule.c (original) +++ python/branches/release30-maint/Modules/gcmodule.c Sun Jan 4 00:28:57 2009 @@ -709,6 +709,24 @@ (void)PyFloat_ClearFreeList(); } +static double +get_time(void) +{ + double result = 0; + if (tmod != NULL) { + PyObject *f = PyObject_CallMethod(tmod, "time", NULL); + if (f == NULL) { + PyErr_Clear(); + } + else { + if (PyFloat_Check(f)) + result = PyFloat_AsDouble(f); + Py_DECREF(f); + } + } + return result; +} + /* This is the main function. Read this to understand how the * collection process works. */ static Py_ssize_t @@ -731,16 +749,7 @@ } if (debug & DEBUG_STATS) { - if (tmod != NULL) { - PyObject *f = PyObject_CallMethod(tmod, "time", NULL); - if (f == NULL) { - PyErr_Clear(); - } - else { - t1 = PyFloat_AsDouble(f); - Py_DECREF(f); - } - } + t1 = get_time(); PySys_WriteStderr("gc: collecting generation %d...\n", generation); PySys_WriteStderr("gc: objects in each generation:"); @@ -813,17 +822,6 @@ if (debug & DEBUG_COLLECTABLE) { debug_cycle("collectable", FROM_GC(gc)); } - if (tmod != NULL && (debug & DEBUG_STATS)) { - PyObject *f = PyObject_CallMethod(tmod, "time", NULL); - if (f == NULL) { - PyErr_Clear(); - } - else { - t1 = PyFloat_AsDouble(f)-t1; - Py_DECREF(f); - PySys_WriteStderr("gc: %.4fs elapsed.\n", t1); - } - } } /* Clear weakrefs and invoke callbacks as necessary. */ @@ -845,14 +843,19 @@ debug_cycle("uncollectable", FROM_GC(gc)); } if (debug & DEBUG_STATS) { + double t2 = get_time(); if (m == 0 && n == 0) - PySys_WriteStderr("gc: done.\n"); + PySys_WriteStderr("gc: done"); else PySys_WriteStderr( "gc: done, " "%" PY_FORMAT_SIZE_T "d unreachable, " - "%" PY_FORMAT_SIZE_T "d uncollectable.\n", + "%" PY_FORMAT_SIZE_T "d uncollectable", n+m, n); + if (t1 && t2) { + PySys_WriteStderr(", %.4fs elapsed", t2-t1); + } + PySys_WriteStderr(".\n"); } /* Append instances in the uncollectable set to a Python From python-checkins at python.org Sun Jan 4 00:32:31 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:32:31 +0100 (CET) Subject: [Python-checkins] r68255 - in python/branches/release30-maint: Objects/unicodeobject.c Message-ID: <20090103233231.6F47F1E4011@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:32:31 2009 New Revision: 68255 Log: Merged revisions 67933 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r67933 | alexandre.vassalotti | 2008-12-27 07:43:58 +0100 (Sat, 27 Dec 2008) | 12 lines Merged revisions 67932 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67932 | alexandre.vassalotti | 2008-12-27 01:36:10 -0500 (Sat, 27 Dec 2008) | 5 lines Remove unnecessary casts related to unicode_decode_call_errorhandler. Make the _PyUnicode_Resize macro a static function. These changes are needed to avoid breaking strict aliasing rules. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/unicodeobject.c Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Sun Jan 4 00:32:31 2009 @@ -418,7 +418,8 @@ } } -int PyUnicode_Resize(PyObject **unicode, Py_ssize_t length) +static +int _PyUnicode_Resize(PyUnicodeObject **unicode, Py_ssize_t length) { register PyUnicodeObject *v; @@ -427,7 +428,7 @@ PyErr_BadInternalCall(); return -1; } - v = (PyUnicodeObject *)*unicode; + v = *unicode; if (v == NULL || !PyUnicode_Check(v) || Py_REFCNT(v) != 1 || length < 0) { PyErr_BadInternalCall(); return -1; @@ -444,7 +445,7 @@ Py_UNICODE_COPY(w->str, v->str, length < v->length ? length : v->length); Py_DECREF(*unicode); - *unicode = (PyObject *)w; + *unicode = w; return 0; } @@ -453,9 +454,10 @@ return unicode_resize(v, length); } -/* Internal API for use in unicodeobject.c only ! */ -#define _PyUnicode_Resize(unicodevar, length) \ - PyUnicode_Resize(((PyObject **)(unicodevar)), length) +int PyUnicode_Resize(PyObject **unicode, Py_ssize_t length) +{ + return _PyUnicode_Resize((PyUnicodeObject **)unicode, length); +} PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size) @@ -989,7 +991,7 @@ PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); - _PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); + PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; fail: if (callresults) { @@ -1549,7 +1551,7 @@ 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, - PyObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) + PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) { static char *argparse = "O!n;decoding error handler must return (str, int) tuple"; @@ -1627,7 +1629,7 @@ if (requiredsize > outsize) { if (requiredsize<2*outsize) requiredsize = 2*outsize; - if (PyUnicode_Resize(output, requiredsize) < 0) + if (_PyUnicode_Resize(output, requiredsize) < 0) goto onError; *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; } @@ -1827,7 +1829,7 @@ errors, &errorHandler, "utf7", errmsg, &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -1838,7 +1840,7 @@ errors, &errorHandler, "utf7", "unterminated shift sequence", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; if (s < e) goto restart; @@ -2166,7 +2168,7 @@ errors, &errorHandler, "utf8", errmsg, &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } if (consumed) @@ -2446,7 +2448,7 @@ errors, &errorHandler, "utf32", errmsg, &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -2724,7 +2726,7 @@ errors, &errorHandler, "utf16", errmsg, &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -2949,7 +2951,7 @@ errors, &errorHandler, "unicodeescape", "end of string in escape sequence", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2961,7 +2963,7 @@ errors, &errorHandler, "unicodeescape", message, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3000,7 +3002,7 @@ errors, &errorHandler, "unicodeescape", "illegal Unicode character", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } break; @@ -3042,7 +3044,7 @@ errors, &errorHandler, "unicodeescape", message, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; break; @@ -3056,7 +3058,7 @@ errors, &errorHandler, "unicodeescape", message, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } else { @@ -3339,7 +3341,7 @@ errors, &errorHandler, "rawunicodeescape", "truncated \\uXXXX", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3371,7 +3373,7 @@ errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } nextByte: @@ -3551,7 +3553,7 @@ errors, &errorHandler, "unicode_internal", reason, &starts, &end, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { goto onError; } } @@ -3924,7 +3926,7 @@ errors, &errorHandler, "ascii", "ordinal not in range(128)", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } } @@ -4225,7 +4227,7 @@ errors, &errorHandler, "charmap", "character maps to ", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { goto onError; } continue; @@ -4275,7 +4277,7 @@ errors, &errorHandler, "charmap", "character maps to ", &starts, &e, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { Py_DECREF(x); goto onError; } @@ -5025,7 +5027,7 @@ /* exponentially overallocate to minimize reallocations */ if (requiredsize < 2 * oldsize) requiredsize = 2 * oldsize; - if (_PyUnicode_Resize(outobj, requiredsize) < 0) + if (PyUnicode_Resize(outobj, requiredsize) < 0) return -1; *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; } @@ -5204,7 +5206,7 @@ /* Resize if we allocated to much */ respos = str-PyUnicode_AS_UNICODE(res); if (respos Author: georg.brandl Date: Sun Jan 4 00:34:15 2009 New Revision: 68256 Log: Merged revisions 67937-67938 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r67937 | alexandre.vassalotti | 2008-12-27 08:32:41 +0100 (Sat, 27 Dec 2008) | 3 lines Update copy of PyUnicode_EncodeRawUnicodeEscape in _pickle. Add astral character test case. ........ r67938 | alexandre.vassalotti | 2008-12-27 10:09:15 +0100 (Sat, 27 Dec 2008) | 3 lines Fix wrong bytes type conversion in PyUnicode_AsUnicodeEscapeString. Fix wrong bytes type conversion in PyUnicode_AsUnicodeDecodeString. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/pickletester.py python/branches/release30-maint/Modules/_pickle.c python/branches/release30-maint/Objects/unicodeobject.c Modified: python/branches/release30-maint/Lib/test/pickletester.py ============================================================================== --- python/branches/release30-maint/Lib/test/pickletester.py (original) +++ python/branches/release30-maint/Lib/test/pickletester.py Sun Jan 4 00:34:15 2009 @@ -484,14 +484,21 @@ self.assertRaises(ValueError, self.loads, buf) def test_unicode(self): - endcases = ['', '<\\u>', '<\\\u1234>', '<\n>', - '<\\>', '<\\\U00012345>'] + endcases = ['', '<\\u>', '<\\\u1234>', '<\n>', '<\\>', + '<\\\U00012345>'] for proto in protocols: for u in endcases: p = self.dumps(u, proto) u2 = self.loads(p) self.assertEqual(u2, u) + def test_unicode_high_plane(self): + t = '\U00012345' + for proto in protocols: + p = self.dumps(t, proto) + t2 = self.loads(p) + self.assertEqual(t2, t) + def test_bytes(self): for proto in protocols: for u in b'', b'xyz', b'xyz'*100: Modified: python/branches/release30-maint/Modules/_pickle.c ============================================================================== --- python/branches/release30-maint/Modules/_pickle.c (original) +++ python/branches/release30-maint/Modules/_pickle.c Sun Jan 4 00:34:15 2009 @@ -1109,16 +1109,21 @@ static const char *hexdigits = "0123456789abcdef"; #ifdef Py_UNICODE_WIDE - repr = PyBytes_FromStringAndSize(NULL, 10 * size); + const Py_ssize_t expandsize = 10; #else - repr = PyBytes_FromStringAndSize(NULL, 6 * size); + const Py_ssize_t expandsize = 6; #endif + + if (size > PY_SSIZE_T_MAX / expandsize) + return PyErr_NoMemory(); + + repr = PyByteArray_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) goto done; - p = q = PyBytes_AS_STRING(repr); + p = q = PyByteArray_AS_STRING(repr); while (size-- > 0) { Py_UNICODE ch = *s++; #ifdef Py_UNICODE_WIDE @@ -1136,6 +1141,32 @@ *p++ = hexdigits[ch & 15]; } 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++; + } #endif /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256 || ch == '\\' || ch == '\n') { @@ -1146,14 +1177,14 @@ *p++ = hexdigits[(ch >> 4) & 0xf]; *p++ = hexdigits[ch & 15]; } - /* Copy everything else as-is */ + /* Copy everything else as-is */ else *p++ = (char) ch; } size = p - q; done: - result = PyBytes_FromStringAndSize(PyBytes_AS_STRING(repr), size); + result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(repr), size); Py_DECREF(repr); return result; } Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Sun Jan 4 00:34:15 2009 @@ -3257,20 +3257,14 @@ PyObject *PyUnicode_AsUnicodeEscapeString(PyObject *unicode) { - PyObject *s, *result; + PyObject *s; if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); return NULL; } s = PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode)); - - if (!s) - return NULL; - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(s), - PyByteArray_GET_SIZE(s)); - Py_DECREF(s); - return result; + return s; } /* --- Raw Unicode Escape Codec ------------------------------------------- */ @@ -3482,7 +3476,7 @@ PyObject *PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) { - PyObject *s, *result; + PyObject *s; if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); return NULL; @@ -3490,12 +3484,7 @@ s = PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode)); - if (!s) - return NULL; - result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(s), - PyByteArray_GET_SIZE(s)); - Py_DECREF(s); - return result; + return s; } /* --- Unicode Internal Codec ------------------------------------------- */ From python-checkins at python.org Sun Jan 4 00:38:23 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:38:23 +0100 (CET) Subject: [Python-checkins] r68257 - in python/branches/release30-maint: Lib/pickle.py Message-ID: <20090103233823.99D651E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:38:23 2009 New Revision: 68257 Log: Merged revisions 67940 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r67940 | alexandre.vassalotti | 2008-12-27 10:30:39 +0100 (Sat, 27 Dec 2008) | 4 lines Fix issue #4374: Pickle tests fail w/o _pickle extension. Add an initialization check to mimic the interface of _pickle. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/pickle.py Modified: python/branches/release30-maint/Lib/pickle.py ============================================================================== --- python/branches/release30-maint/Lib/pickle.py (original) +++ python/branches/release30-maint/Lib/pickle.py Sun Jan 4 00:38:23 2009 @@ -222,6 +222,11 @@ def dump(self, obj): """Write a pickled representation of obj to the open file.""" + # Check whether Pickler was initialized correctly. This is + # only needed to mimic the behavior of _pickle.Pickler.dump(). + if not hasattr(self, "write"): + raise PicklingError("Pickler.__init__() was not called by " + "%s.__init__()" % (self.__class__.__name__,)) if self.proto >= 2: self.write(PROTO + bytes([self.proto])) self.save(obj) @@ -789,6 +794,11 @@ Return the reconstituted object hierarchy specified in the file. """ + # Check whether Unpickler was initialized correctly. This is + # only needed to mimic the behavior of _pickle.Unpickler.dump(). + if not hasattr(self, "read"): + raise UnpicklingError("Unpickler.__init__() was not called by " + "%s.__init__()" % (self.__class__.__name__,)) self.mark = object() # any new unique object self.stack = [] self.append = self.stack.append From python-checkins at python.org Sun Jan 4 00:39:11 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:39:11 +0100 (CET) Subject: [Python-checkins] r68258 - python/branches/release30-maint Message-ID: <20090103233911.482D21E403A@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:39:10 2009 New Revision: 68258 Log: Blocked revisions 67810,67886-67887,67910,67941,67945,67947 via svnmerge ................ r67810 | benjamin.peterson | 2008-12-16 04:57:54 +0100 (Tue, 16 Dec 2008) | 118 lines Merged revisions 67806 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r67806 | benjamin.peterson | 2008-12-15 21:35:28 -0600 (Mon, 15 Dec 2008) | 111 lines Merged revisions 67427,67431,67433,67435,67630,67652,67656-67657,67674-67675,67678-67679,67705-67706,67716,67723,67765-67771,67774,67776,67778 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67427 | benjamin.peterson | 2008-11-28 16:07:41 -0600 (Fri, 28 Nov 2008) | 1 line fix spelling in comment ........ r67431 | benjamin.peterson | 2008-11-28 17:14:08 -0600 (Fri, 28 Nov 2008) | 1 line add a scripts directory; move things to it ........ r67433 | benjamin.peterson | 2008-11-28 17:18:48 -0600 (Fri, 28 Nov 2008) | 1 line run svneol.py ........ r67435 | benjamin.peterson | 2008-11-28 17:25:03 -0600 (Fri, 28 Nov 2008) | 1 line rename pre/post_order_mapping to pre/post_order_heads ........ r67630 | alexandre.vassalotti | 2008-12-06 21:51:56 -0600 (Sat, 06 Dec 2008) | 2 lines Fix typo in the urllib2.HTTPDigestAuthHandler fixer. ........ r67652 | armin.ronacher | 2008-12-07 15:39:43 -0600 (Sun, 07 Dec 2008) | 5 lines Added a fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. ........ r67656 | armin.ronacher | 2008-12-07 16:54:16 -0600 (Sun, 07 Dec 2008) | 3 lines Added missing copyright fo 2to3 fix_isinstance. ........ r67657 | armin.ronacher | 2008-12-07 18:29:35 -0600 (Sun, 07 Dec 2008) | 3 lines 2to3: intern and reduce fixes now add the imports if missing. Because that is a common task the fixer_util module now has a function "touch_import" that adds imports if missing. ........ r67674 | benjamin.peterson | 2008-12-08 19:58:11 -0600 (Mon, 08 Dec 2008) | 1 line copy permission bits when making backup files #4602 ........ r67675 | benjamin.peterson | 2008-12-08 19:59:11 -0600 (Mon, 08 Dec 2008) | 1 line add forgotten import ........ r67678 | benjamin.peterson | 2008-12-08 20:08:30 -0600 (Mon, 08 Dec 2008) | 1 line fix #4602 for real ........ r67679 | armin.ronacher | 2008-12-09 00:54:03 -0600 (Tue, 09 Dec 2008) | 3 lines Removed redudant code from the 2to3 long fixer. This fixes #4590. ........ r67705 | benjamin.peterson | 2008-12-11 13:04:08 -0600 (Thu, 11 Dec 2008) | 1 line put trailers after a range call after the list() ........ r67706 | benjamin.peterson | 2008-12-11 13:17:57 -0600 (Thu, 11 Dec 2008) | 1 line add html related modules to the fix_imports mapping ........ r67716 | benjamin.peterson | 2008-12-11 22:16:47 -0600 (Thu, 11 Dec 2008) | 1 line consolidate tests ........ r67723 | benjamin.peterson | 2008-12-12 19:49:31 -0600 (Fri, 12 Dec 2008) | 1 line fix name ........ r67765 | benjamin.peterson | 2008-12-14 14:05:05 -0600 (Sun, 14 Dec 2008) | 1 line run fix_isinstance after fix_long and fix_unicode ........ r67766 | benjamin.peterson | 2008-12-14 14:13:05 -0600 (Sun, 14 Dec 2008) | 1 line use run_order instead of order ........ r67767 | benjamin.peterson | 2008-12-14 14:28:12 -0600 (Sun, 14 Dec 2008) | 1 line don't retain parenthesis if there is only one item left ........ r67768 | benjamin.peterson | 2008-12-14 14:32:30 -0600 (Sun, 14 Dec 2008) | 1 line use insert_child() ........ r67769 | benjamin.peterson | 2008-12-14 14:59:10 -0600 (Sun, 14 Dec 2008) | 1 line parenthesize doesn't belong in pygram or FixerBase ........ r67770 | alexandre.vassalotti | 2008-12-14 15:15:36 -0600 (Sun, 14 Dec 2008) | 2 lines Fix typo: html.paser -> html.parser. ........ r67771 | benjamin.peterson | 2008-12-14 15:22:09 -0600 (Sun, 14 Dec 2008) | 1 line altering .children needs to call changed() ........ r67774 | benjamin.peterson | 2008-12-14 15:55:38 -0600 (Sun, 14 Dec 2008) | 1 line employ an evil hack to fix multiple names in the same import statement ........ r67776 | benjamin.peterson | 2008-12-14 16:22:38 -0600 (Sun, 14 Dec 2008) | 1 line make a common mixin class for Test_imports and friends ........ r67778 | alexandre.vassalotti | 2008-12-14 17:48:20 -0600 (Sun, 14 Dec 2008) | 2 lines Make fix_imports refactor multiple imports as. ........ ................ ................ r67886 | benjamin.peterson | 2008-12-21 01:06:59 +0100 (Sun, 21 Dec 2008) | 93 lines Merged revisions 67654,67676-67677,67681,67692,67725,67761,67784-67785,67787-67788,67802,67848-67850,67862-67864,67880,67882 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67654 | georg.brandl | 2008-12-07 16:42:09 -0600 (Sun, 07 Dec 2008) | 2 lines #4457: rewrite __import__() documentation. ........ r67676 | benjamin.peterson | 2008-12-08 20:03:03 -0600 (Mon, 08 Dec 2008) | 1 line specify how things are copied ........ r67677 | benjamin.peterson | 2008-12-08 20:05:11 -0600 (Mon, 08 Dec 2008) | 1 line revert unrelated change to installer script ........ r67681 | jeremy.hylton | 2008-12-09 15:03:10 -0600 (Tue, 09 Dec 2008) | 2 lines Add simple unittests for Request ........ r67692 | amaury.forgeotdarc | 2008-12-10 18:03:42 -0600 (Wed, 10 Dec 2008) | 2 lines #1030250: correctly pass the dry_run option to the mkpath() function. ........ r67725 | benjamin.peterson | 2008-12-12 22:02:20 -0600 (Fri, 12 Dec 2008) | 1 line fix incorrect example ........ r67761 | benjamin.peterson | 2008-12-14 11:26:04 -0600 (Sun, 14 Dec 2008) | 1 line fix missing bracket ........ r67784 | georg.brandl | 2008-12-15 02:33:58 -0600 (Mon, 15 Dec 2008) | 2 lines #4446: document "platforms" argument for setup(). ........ r67785 | georg.brandl | 2008-12-15 02:36:11 -0600 (Mon, 15 Dec 2008) | 2 lines #4611: fix typo. ........ r67787 | georg.brandl | 2008-12-15 02:58:59 -0600 (Mon, 15 Dec 2008) | 2 lines #4578: fix has_key() usage in compiler package. ........ r67788 | georg.brandl | 2008-12-15 03:07:39 -0600 (Mon, 15 Dec 2008) | 2 lines #4568: remove limitation in varargs callback example. ........ r67802 | amaury.forgeotdarc | 2008-12-15 16:29:14 -0600 (Mon, 15 Dec 2008) | 4 lines #3632: the "pyo" macro from gdbinit can now run when the GIL is released. Patch by haypo. ........ r67848 | benjamin.peterson | 2008-12-18 20:28:56 -0600 (Thu, 18 Dec 2008) | 1 line fix typo ........ r67849 | benjamin.peterson | 2008-12-18 20:31:35 -0600 (Thu, 18 Dec 2008) | 1 line _call_method -> _callmethod and _get_value to _getvalue ........ r67850 | raymond.hettinger | 2008-12-19 03:06:07 -0600 (Fri, 19 Dec 2008) | 9 lines Fix-up and clean-up docs for int.bit_length(). * Replace dramatic footnote with in-line comment about possible round-off errors in logarithms of large numbers. * Add comments to the pure python code equivalent. * replace floor() with int() in the mathematical equivalent so the type is correct (should be an int, not a float). * add abs() to the mathematical equivalent so that it matches the previous line that it is supposed to be equivalent to. * make one combined example with a negative input. ........ r67862 | benjamin.peterson | 2008-12-19 20:48:02 -0600 (Fri, 19 Dec 2008) | 1 line copy sentence from docstring ........ r67863 | benjamin.peterson | 2008-12-19 20:51:26 -0600 (Fri, 19 Dec 2008) | 1 line add headings ........ r67864 | benjamin.peterson | 2008-12-19 20:57:19 -0600 (Fri, 19 Dec 2008) | 1 line beef up docstring ........ r67880 | benjamin.peterson | 2008-12-20 16:49:24 -0600 (Sat, 20 Dec 2008) | 1 line remove redundant sentence ........ r67882 | benjamin.peterson | 2008-12-20 16:59:49 -0600 (Sat, 20 Dec 2008) | 1 line add some recent releases to the list ........ ................ r67887 | benjamin.peterson | 2008-12-21 01:16:13 +0100 (Sun, 21 Dec 2008) | 9 lines Merged revisions 67885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67885 | benjamin.peterson | 2008-12-20 17:48:54 -0600 (Sat, 20 Dec 2008) | 1 line silence annoying DeprecationWarning ........ ................ r67910 | skip.montanaro | 2008-12-23 04:51:14 +0100 (Tue, 23 Dec 2008) | 11 lines Merged revisions 67908 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67908 | skip.montanaro | 2008-12-22 21:30:15 -0600 (Mon, 22 Dec 2008) | 4 lines As a result of a regression that snuck into 2.5.3 add a test case that ensures that when you try to read from a file opened for writing an IOError is raised. ........ ................ r67941 | alexandre.vassalotti | 2008-12-27 10:49:09 +0100 (Sat, 27 Dec 2008) | 2 lines Fix bogus assertion. ................ r67945 | hirokazu.yamamoto | 2008-12-27 15:58:17 +0100 (Sat, 27 Dec 2008) | 1 line Fixed incompatible pointer warning. ................ r67947 | antoine.pitrou | 2008-12-27 16:50:40 +0100 (Sat, 27 Dec 2008) | 10 lines Merged revisions 67946 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67946 | antoine.pitrou | 2008-12-27 16:43:12 +0100 (sam., 27 d?\195?\169c. 2008) | 4 lines Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by Gabriel Genellina. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun Jan 4 00:41:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 03 Jan 2009 23:41:35 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20090103234135.629971E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/25 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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_wsgiref ====================================================================== ERROR: testBytes (test.test_wsgiref.HeaderTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_wsgiref.py", line 427, in testBytes File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/wsgiref/headers.py", line 67, in __setitem__ del self[name] File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/wsgiref/headers.py", line 77, in __delitem__ self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/wsgiref/headers.py", line 77, in self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 4 00:47:58 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:47:58 +0100 (CET) Subject: [Python-checkins] r68259 - in python/branches/release30-maint: Doc/library/hashlib.rst Doc/library/stdtypes.rst Doc/library/subprocess.rst Lib/ssl.py Objects/bytesobject.c Message-ID: <20090103234758.930B71E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:47:58 2009 New Revision: 68259 Log: Merged revisions 67950,67962,67968-67969,68027,68075,68091,68093 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r67950 | benjamin.peterson | 2008-12-27 18:00:44 +0100 (Sat, 27 Dec 2008) | 1 line fix 2.x isms in distutils test ........ r67962 | georg.brandl | 2008-12-27 20:08:11 +0100 (Sat, 27 Dec 2008) | 2 lines #4697: clarify that the functions are Unix-only. ........ r67968 | georg.brandl | 2008-12-28 00:12:09 +0100 (Sun, 28 Dec 2008) | 2 lines Remove confusing error message in bytes.translate. ........ r67969 | georg.brandl | 2008-12-28 00:33:20 +0100 (Sun, 28 Dec 2008) | 5 lines Document bytes.translate(). BTW, having str.maketrans() as a static method and string.maketrans() as a function that creates translation tables for bytes objects is not very consistent :) ........ r68027 | benjamin.peterson | 2008-12-29 21:52:09 +0100 (Mon, 29 Dec 2008) | 1 line hexdigest() doesn't return bytes #4771 ........ r68075 | benjamin.peterson | 2008-12-30 19:05:46 +0100 (Tue, 30 Dec 2008) | 2 lines use $(RUNSHARED) to run plat-mac/regen ........ r68091 | benjamin.peterson | 2008-12-31 04:43:28 +0100 (Wed, 31 Dec 2008) | 1 line #4788 qualify remove a bare except ........ r68093 | benjamin.peterson | 2008-12-31 05:10:35 +0100 (Wed, 31 Dec 2008) | 1 line fix name usage ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/hashlib.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/library/subprocess.rst python/branches/release30-maint/Lib/ssl.py python/branches/release30-maint/Objects/bytesobject.c Modified: python/branches/release30-maint/Doc/library/hashlib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/hashlib.rst (original) +++ python/branches/release30-maint/Doc/library/hashlib.rst Sun Jan 4 00:47:58 2009 @@ -64,7 +64,7 @@ More condensed: >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() - b'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' + 'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' A generic :func:`new` constructor that takes the string name of the desired algorithm as its first parameter also exists to allow access to the above listed @@ -76,7 +76,7 @@ >>> h = hashlib.new('ripemd160') >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() - b'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc' + 'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc' The following values are provided as constant attributes of the hash objects returned by the constructors: 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 Sun Jan 4 00:47:58 2009 @@ -1086,13 +1086,12 @@ .. method:: str.translate(map) Return a copy of the *s* where all characters have been mapped through the - *map* which must be a dictionary of Unicode ordinals(integers) to Unicode + *map* which must be a dictionary of Unicode ordinals (integers) to Unicode ordinals, strings or ``None``. Unmapped characters are left untouched. Characters mapped to ``None`` are deleted. - You can use :meth:`str.maketrans` to create a translation table. For string - objects, set the *table* argument to ``None`` for translations that only - delete characters: + You can use :meth:`str.maketrans` to create a translation map from + character-to-character mappings in different formats. .. note:: @@ -1495,23 +1494,23 @@ >>> bytes.fromhex('f0 f1f2 ') b'\xf0\xf1\xf2' -.. XXX verify/document translate() semantics! - - .. method:: bytes.translate(table[, delete]) +The translate method differs in semantics from the version available on strings: + +.. method:: bytes.translate(table[, delete]) - Return a copy of the bytes object where all bytes occurring in the optional - argument *delete* are removed, and the remaining bytes have been mapped - through the given translation table, which must be a bytes object of length - 256. + Return a copy of the bytes or bytearray object where all bytes occurring in + the optional argument *delete* are removed, and the remaining bytes have been + mapped through the given translation table, which must be a bytes object of + length 256. - You can use the :func:`maketrans` helper function in the :mod:`string` module to - create a translation table. + You can use the :func:`string.maketrans` helper function to create a + translation table. - .. XXX a None table doesn't seem to be supported - Set the *table* argument to ``None`` for translations that only delete characters:: + Set the *table* argument to ``None`` for translations that only delete + characters:: - >>> 'read this short text'.translate(None, 'aeiou') - 'rd ths shrt txt' + >>> b'read this short text'.translate(None, b'aeiou') + b'rd ths shrt txt' .. _types-set: Modified: python/branches/release30-maint/Doc/library/subprocess.rst ============================================================================== --- python/branches/release30-maint/Doc/library/subprocess.rst (original) +++ python/branches/release30-maint/Doc/library/subprocess.rst Sun Jan 4 00:47:58 2009 @@ -173,6 +173,8 @@ >>> subprocess.getstatusoutput('/bin/junk') (256, 'sh: /bin/junk: not found') + Availability: UNIX. + .. function:: getoutput(cmd) Return output ``(stdout or stderr)`` of executing *cmd* in a shell. @@ -184,6 +186,8 @@ >>> subprocess.getoutput('ls /bin/ls') '/bin/ls' + Availability: UNIX. + Exceptions ^^^^^^^^^^ Modified: python/branches/release30-maint/Lib/ssl.py ============================================================================== --- python/branches/release30-maint/Lib/ssl.py (original) +++ python/branches/release30-maint/Lib/ssl.py Sun Jan 4 00:47:58 2009 @@ -114,7 +114,7 @@ # see if it's connected try: socket.getpeername(self) - except: + except socket_error: # no, no connection yet self._sslobj = None else: Modified: python/branches/release30-maint/Objects/bytesobject.c ============================================================================== --- python/branches/release30-maint/Objects/bytesobject.c (original) +++ python/branches/release30-maint/Objects/bytesobject.c Sun Jan 4 00:47:58 2009 @@ -1884,11 +1884,6 @@ del_table = PyBytes_AS_STRING(delobj); dellen = PyBytes_GET_SIZE(delobj); } - else if (PyUnicode_Check(delobj)) { - PyErr_SetString(PyExc_TypeError, - "deletions are implemented differently for unicode"); - return NULL; - } else if (PyObject_AsCharBuffer(delobj, &del_table, &dellen)) return NULL; } From python-checkins at python.org Sun Jan 4 00:48:43 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:48:43 +0100 (CET) Subject: [Python-checkins] r68260 - python/branches/release30-maint Message-ID: <20090103234843.F352A1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:48:43 2009 New Revision: 68260 Log: Blocked revisions 67948-67949,67956,67959,67964,67974,67981,68059 via svnmerge ................ r67948 | benjamin.peterson | 2008-12-27 17:00:54 +0100 (Sat, 27 Dec 2008) | 93 lines Merged revisions 67889-67892,67895,67898,67904-67907,67912,67918,67920-67921,67923-67924,67926-67927,67930,67943 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r67889 | benjamin.peterson | 2008-12-20 19:04:32 -0600 (Sat, 20 Dec 2008) | 1 line sphinx.web is long gone ................ r67890 | benjamin.peterson | 2008-12-20 19:12:26 -0600 (Sat, 20 Dec 2008) | 1 line update readme ................ r67891 | benjamin.peterson | 2008-12-20 19:14:47 -0600 (Sat, 20 Dec 2008) | 1 line there are way too many places which need to have the current version added ................ r67892 | benjamin.peterson | 2008-12-20 19:29:32 -0600 (Sat, 20 Dec 2008) | 9 lines Merged revisions 67809 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line fix logic error ........ ................ r67895 | neal.norwitz | 2008-12-21 08:28:32 -0600 (Sun, 21 Dec 2008) | 2 lines Add Tarek for work on distutils. ................ r67898 | benjamin.peterson | 2008-12-21 15:00:53 -0600 (Sun, 21 Dec 2008) | 1 line compute DISTVERSION with patchlevel.py ................ r67904 | benjamin.peterson | 2008-12-22 14:44:58 -0600 (Mon, 22 Dec 2008) | 1 line less attitude ................ r67905 | benjamin.peterson | 2008-12-22 14:51:15 -0600 (Mon, 22 Dec 2008) | 1 line fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|' ................ r67906 | benjamin.peterson | 2008-12-22 14:52:53 -0600 (Mon, 22 Dec 2008) | 1 line add NEWS note ................ r67907 | benjamin.peterson | 2008-12-22 16:12:19 -0600 (Mon, 22 Dec 2008) | 1 line silence compiler warning ................ r67912 | georg.brandl | 2008-12-23 06:37:21 -0600 (Tue, 23 Dec 2008) | 2 lines Fix missing "svn" command. ................ r67918 | georg.brandl | 2008-12-23 09:44:25 -0600 (Tue, 23 Dec 2008) | 2 lines Markup fix. ................ r67920 | benjamin.peterson | 2008-12-23 14:09:28 -0600 (Tue, 23 Dec 2008) | 1 line use a global variable, so the compiler doesn't optimize the assignment out ................ r67921 | benjamin.peterson | 2008-12-23 14:12:33 -0600 (Tue, 23 Dec 2008) | 1 line make global static ................ r67923 | benjamin.peterson | 2008-12-24 09:10:27 -0600 (Wed, 24 Dec 2008) | 1 line #4736 BufferRWPair.closed shouldn't try to call another property as a function ................ r67924 | benjamin.peterson | 2008-12-24 10:10:05 -0600 (Wed, 24 Dec 2008) | 1 line pretend exceptions don't exist a while longer ................ r67926 | tarek.ziade | 2008-12-24 13:10:05 -0600 (Wed, 24 Dec 2008) | 1 line fixed #4400 : distutils .pypirc default generated file was broken. ................ r67927 | benjamin.peterson | 2008-12-26 17:26:30 -0600 (Fri, 26 Dec 2008) | 1 line python version is included in file name now ................ r67930 | hirokazu.yamamoto | 2008-12-26 22:19:48 -0600 (Fri, 26 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2) ................ r67943 | alexandre.vassalotti | 2008-12-27 04:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines Fix bogus unicode tests in pickletester. ................ ................ r67949 | benjamin.peterson | 2008-12-27 17:58:50 +0100 (Sat, 27 Dec 2008) | 1 line fix syntax ................ r67956 | benjamin.peterson | 2008-12-27 19:35:25 +0100 (Sat, 27 Dec 2008) | 1 line fix svnmerge properties ................ r67959 | benjamin.peterson | 2008-12-27 20:03:36 +0100 (Sat, 27 Dec 2008) | 9 lines Merged revisions 67954 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67954 | benjamin.peterson | 2008-12-27 12:24:11 -0600 (Sat, 27 Dec 2008) | 1 line #4748 lambda generators shouldn't return values ........ ................ r67964 | alexandre.vassalotti | 2008-12-27 20:46:35 +0100 (Sat, 27 Dec 2008) | 2 lines Revert unwanted function name change introduced by r67939. ................ r67974 | georg.brandl | 2008-12-28 12:44:14 +0100 (Sun, 28 Dec 2008) | 4 lines #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6. ................ r67981 | antoine.pitrou | 2008-12-28 15:29:00 +0100 (Sun, 28 Dec 2008) | 9 lines Merged revisions 67979 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67979 | antoine.pitrou | 2008-12-28 15:09:36 +0100 (dim., 28 d?\195?\169c. 2008) | 3 lines Issue #4444: Allow assertRaises() to be used as a context handler. ........ ................ r68059 | vinay.sajip | 2008-12-30 08:32:59 +0100 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 00:49:21 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:49:21 +0100 (CET) Subject: [Python-checkins] r68261 - in python/branches/release30-maint: Misc/NEWS Tools/pybench/Lists.py Message-ID: <20090103234921.1413F1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:49:20 2009 New Revision: 68261 Log: Merged revisions 67966 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r67966 | antoine.pitrou | 2008-12-27 21:39:28 +0100 (Sat, 27 Dec 2008) | 9 lines Merged revisions 67965 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67965 | antoine.pitrou | 2008-12-27 21:34:52 +0100 (sam., 27 d?\195?\169c. 2008) | 3 lines Issue #4677: add two list comprehension tests to pybench. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Tools/pybench/Lists.py Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 00:49:20 2009 @@ -137,6 +137,11 @@ support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. +Tools/Demos +----------- + +- Issue #4677: add two list comprehension tests to pybench. + Extension Modules ----------------- Modified: python/branches/release30-maint/Tools/pybench/Lists.py ============================================================================== --- python/branches/release30-maint/Tools/pybench/Lists.py (original) +++ python/branches/release30-maint/Tools/pybench/Lists.py Sun Jan 4 00:49:20 2009 @@ -293,3 +293,58 @@ for i in range(self.rounds): pass + +class SimpleListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + n = list(range(10)) * 10 + + for i in range(self.rounds): + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + def calibrate(self): + + n = list(range(10)) * 10 + + for i in range(self.rounds): + pass + +class NestedListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + m = list(range(10)) + n = list(range(10)) + + for i in range(self.rounds): + l = [x for x in n for y in m] + l = [y for x in n for y in m] + + l = [x for x in n for y in m if y] + l = [y for x in n for y in m if x] + + l = [x for x in n for y in m if not y] + l = [y for x in n for y in m if not x] + + def calibrate(self): + + m = list(range(10)) + n = list(range(10)) + + for i in range(self.rounds): + pass From python-checkins at python.org Sun Jan 4 00:49:57 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:49:57 +0100 (CET) Subject: [Python-checkins] r68262 - in python/branches/release30-maint: Include/unicodeobject.h Message-ID: <20090103234957.69A3B1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:49:57 2009 New Revision: 68262 Log: Merged revisions 67972 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r67972 | alexandre.vassalotti | 2008-12-28 03:13:22 +0100 (Sun, 28 Dec 2008) | 13 lines Merged revisions 67970-67971 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67970 | alexandre.vassalotti | 2008-12-27 20:52:58 -0500 (Sat, 27 Dec 2008) | 2 lines Fix name mangling of PyUnicode_ClearFreeList. ........ r67971 | alexandre.vassalotti | 2008-12-27 21:10:35 -0500 (Sat, 27 Dec 2008) | 2 lines Sort UCS-2/UCS-4 name mangling list. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/unicodeobject.h Modified: python/branches/release30-maint/Include/unicodeobject.h ============================================================================== --- python/branches/release30-maint/Include/unicodeobject.h (original) +++ python/branches/release30-maint/Include/unicodeobject.h Sun Jan 4 00:49:57 2009 @@ -152,6 +152,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS2_Compare # define PyUnicode_Concat PyUnicodeUCS2_Concat # define PyUnicode_Append PyUnicodeUCS2_Append @@ -185,13 +186,13 @@ # define PyUnicode_Find PyUnicodeUCS2_Find # define PyUnicode_Format PyUnicodeUCS2_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS2_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromString PyUnicodeUCS2_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS2_GetMax @@ -213,7 +214,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS2_Fini # define _PyUnicode_Init _PyUnicodeUCS2_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit @@ -250,6 +250,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS4_Compare # define PyUnicode_Concat PyUnicodeUCS4_Concat # define PyUnicode_Append PyUnicodeUCS4_Append @@ -283,13 +284,13 @@ # define PyUnicode_Find PyUnicodeUCS4_Find # define PyUnicode_Format PyUnicodeUCS4_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS4_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromString PyUnicodeUCS4_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS4_GetMax @@ -311,7 +312,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS4_Fini # define _PyUnicode_Init _PyUnicodeUCS4_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit From python-checkins at python.org Sun Jan 4 00:50:37 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:50:37 +0100 (CET) Subject: [Python-checkins] r68263 - in python/branches/release30-maint: Lib/test/test_fileio.py Modules/_fileio.c Message-ID: <20090103235037.63A7E1E4045@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:50:37 2009 New Revision: 68263 Log: Merged revisions 68017 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68017 | benjamin.peterson | 2008-12-29 19:02:28 +0100 (Mon, 29 Dec 2008) | 9 lines Merged revisions 68016 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68016 | benjamin.peterson | 2008-12-29 11:56:58 -0600 (Mon, 29 Dec 2008) | 1 line #4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_fileio.py python/branches/release30-maint/Modules/_fileio.c Modified: python/branches/release30-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_fileio.py (original) +++ python/branches/release30-maint/Lib/test/test_fileio.py Sun Jan 4 00:50:37 2009 @@ -108,6 +108,7 @@ _fileio._FileIO('.', 'r') except IOError as e: self.assertNotEqual(e.errno, 0) + self.assertEqual(e.filename, ".") else: self.fail("Should have raised IOError") Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Sun Jan 4 00:50:37 2009 @@ -116,7 +116,7 @@ directories, so we need a check. */ static int -dircheck(PyFileIOObject* self) +dircheck(PyFileIOObject* self, char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -128,8 +128,8 @@ if (internal_close(self)) return -1; - exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + exc = PyObject_CallFunction(PyExc_IOError, "(iss)", + EISDIR, msg, name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return -1; @@ -290,7 +290,7 @@ #endif goto error; } - if(dircheck(self) < 0) + if(dircheck(self, name) < 0) goto error; } From python-checkins at python.org Sun Jan 4 00:51:15 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:51:15 +0100 (CET) Subject: [Python-checkins] r68264 - python/branches/release30-maint Message-ID: <20090103235115.187781E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:51:14 2009 New Revision: 68264 Log: Merged revisions 68074 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68074 | benjamin.peterson | 2008-12-30 18:56:45 +0100 (Tue, 30 Dec 2008) | 18 lines Merged revisions 67982,67988,67990 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67982 | benjamin.peterson | 2008-12-28 09:37:31 -0600 (Sun, 28 Dec 2008) | 1 line fix WORD_BIGEDIAN declaration in Universal builds; fixes #4060 and #4728 ........ r67988 | ronald.oussoren | 2008-12-28 13:40:56 -0600 (Sun, 28 Dec 2008) | 1 line Issue4064: architecture string for universal builds on OSX ........ r67990 | ronald.oussoren | 2008-12-28 13:50:40 -0600 (Sun, 28 Dec 2008) | 3 lines Update the fix for issue4064 to deal correctly with all three variants of universal builds that are presented by the configure script. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 00:52:55 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:52:55 +0100 (CET) Subject: [Python-checkins] r68265 - in python/branches/release30-maint: Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_set.py Misc/NEWS Modules/_collectionsmodule.c Objects/dictobject.c Objects/setobject.c Message-ID: <20090103235255.DFED81E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:52:55 2009 New Revision: 68265 Log: Merged revisions 68132 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68132 | antoine.pitrou | 2009-01-01 16:35:33 +0100 (Thu, 01 Jan 2009) | 9 lines Merged revisions 68128 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (jeu., 01 janv. 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_deque.py python/branches/release30-maint/Lib/test/test_dict.py python/branches/release30-maint/Lib/test/test_set.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_collectionsmodule.c python/branches/release30-maint/Objects/dictobject.c python/branches/release30-maint/Objects/setobject.c Modified: python/branches/release30-maint/Lib/test/test_deque.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_deque.py (original) +++ python/branches/release30-maint/Lib/test/test_deque.py Sun Jan 4 00:52:55 2009 @@ -1,7 +1,8 @@ from collections import deque import unittest from test import support, seq_tests -from weakref import proxy +import gc +import weakref import copy import pickle from io import StringIO @@ -420,6 +421,22 @@ d.append(1) gc.collect() + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for deque iterator objects + class C(object): + pass + for i in range(2): + obj = C() + ref = weakref.ref(obj) + if i == 0: + container = deque([obj, 1]) + else: + container = reversed(deque([obj, 1])) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): @@ -530,7 +547,7 @@ def test_weakref(self): d = deque('gallahad') - p = proxy(d) + p = weakref.proxy(d) self.assertEqual(str(p), str(d)) d = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/release30-maint/Lib/test/test_dict.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_dict.py (original) +++ python/branches/release30-maint/Lib/test/test_dict.py Sun Jan 4 00:52:55 2009 @@ -2,6 +2,7 @@ from test import support import sys, collections, random, string +import gc, weakref class DictTest(unittest.TestCase): @@ -648,6 +649,21 @@ pass d = {} + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for dictiter and + # dictview objects. + class C(object): + pass + views = (dict.items, dict.values, dict.keys) + for v in views: + obj = C() + ref = weakref.ref(obj) + container = {obj: 1} + obj.v = v(container) + obj.x = iter(obj.v) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") from test import mapping_tests Modified: python/branches/release30-maint/Lib/test/test_set.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_set.py (original) +++ python/branches/release30-maint/Lib/test/test_set.py Sun Jan 4 00:52:55 2009 @@ -1,6 +1,7 @@ import unittest from test import support -from weakref import proxy +import gc +import weakref import operator import copy import pickle @@ -323,6 +324,18 @@ self.assertEqual(sum(elem.hash_count for elem in d), n) self.assertEqual(d3, dict.fromkeys(d, 123)) + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for set iterator object + class C(object): + pass + obj = C() + ref = weakref.ref(obj) + container = set([obj, 1]) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestSet(TestJointOps): thetype = set basetype = set @@ -546,7 +559,7 @@ def test_weakref(self): s = self.thetype('gallahad') - p = proxy(s) + p = weakref.proxy(s) self.assertEqual(str(p), str(s)) s = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 00:52:55 2009 @@ -25,6 +25,9 @@ - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. +- Issue #3680: Reference cycles created through a dict, set or deque iterator + did not get collected. + - Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types where the tp_hash and tp_dict slots are both NULL. Modified: python/branches/release30-maint/Modules/_collectionsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_collectionsmodule.c (original) +++ python/branches/release30-maint/Modules/_collectionsmodule.c Sun Jan 4 00:52:55 2009 @@ -900,7 +900,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequeiter_type); + it = PyObject_GC_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; @@ -909,14 +909,22 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } +static int +dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg) +{ + Py_VISIT(dio->deque); + return 0; +} + static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); - Py_TYPE(dio)->tp_free(dio); + PyObject_GC_Del(dio); } static PyObject * @@ -981,9 +989,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -1002,7 +1010,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequereviter_type); + it = PyObject_GC_New(dequeiterobject, &dequereviter_type); if (it == NULL) return NULL; it->b = deque->rightblock; @@ -1011,6 +1019,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + _PyObject_GC_TRACK(it); return (PyObject *)it; } @@ -1063,9 +1072,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/release30-maint/Objects/dictobject.c ============================================================================== --- python/branches/release30-maint/Objects/dictobject.c (original) +++ python/branches/release30-maint/Objects/dictobject.c Sun Jan 4 00:52:55 2009 @@ -2122,7 +2122,7 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; - di = PyObject_New(dictiterobject, itertype); + di = PyObject_GC_New(dictiterobject, itertype); if (di == NULL) return NULL; Py_INCREF(dict); @@ -2139,6 +2139,7 @@ } else di->di_result = NULL; + _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -2147,7 +2148,15 @@ { Py_XDECREF(di->di_dict); Py_XDECREF(di->di_result); - PyObject_Del(di); + PyObject_GC_Del(di); +} + +static int +dictiter_traverse(dictiterobject *di, visitproc visit, void *arg) +{ + Py_VISIT(di->di_dict); + Py_VISIT(di->di_result); + return 0; } static PyObject * @@ -2228,9 +2237,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2300,9 +2309,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2386,9 +2395,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2415,7 +2424,14 @@ dictview_dealloc(dictviewobject *dv) { Py_XDECREF(dv->dv_dict); - PyObject_Del(dv); + PyObject_GC_Del(dv); +} + +static int +dictview_traverse(dictviewobject *dv, visitproc visit, void *arg) +{ + Py_VISIT(dv->dv_dict); + return 0; } static Py_ssize_t @@ -2442,11 +2458,12 @@ type->tp_name, dict->ob_type->tp_name); return NULL; } - dv = PyObject_New(dictviewobject, type); + dv = PyObject_GC_New(dictviewobject, type); if (dv == NULL) return NULL; Py_INCREF(dict); dv->dv_dict = (PyDictObject *)dict; + _PyObject_GC_TRACK(dv); return (PyObject *)dv; } @@ -2693,9 +2710,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ dictview_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2777,9 +2794,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ dictview_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2842,9 +2859,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictview_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/release30-maint/Objects/setobject.c ============================================================================== --- python/branches/release30-maint/Objects/setobject.c (original) +++ python/branches/release30-maint/Objects/setobject.c Sun Jan 4 00:52:55 2009 @@ -802,7 +802,14 @@ setiter_dealloc(setiterobject *si) { Py_XDECREF(si->si_set); - PyObject_Del(si); + PyObject_GC_Del(si); +} + +static int +setiter_traverse(setiterobject *si, visitproc visit, void *arg) +{ + Py_VISIT(si->si_set); + return 0; } static PyObject * @@ -880,9 +887,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)setiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -895,7 +902,7 @@ static PyObject * set_iter(PySetObject *so) { - setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type); + setiterobject *si = PyObject_GC_New(setiterobject, &PySetIter_Type); if (si == NULL) return NULL; Py_INCREF(so); @@ -903,6 +910,7 @@ si->si_used = so->used; si->si_pos = 0; si->len = so->used; + _PyObject_GC_TRACK(si); return (PyObject *)si; } From python-checkins at python.org Sun Jan 4 00:53:44 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:53:44 +0100 (CET) Subject: [Python-checkins] r68266 - in python/branches/release30-maint: Lib/pydoc.py Misc/NEWS Message-ID: <20090103235344.81F321E401C@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:53:44 2009 New Revision: 68266 Log: Merged revisions 68137 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68137 | georg.brandl | 2009-01-01 16:53:14 +0100 (Thu, 01 Jan 2009) | 10 lines Merged revisions 67953 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67953 | georg.brandl | 2008-12-27 19:20:04 +0100 (Sat, 27 Dec 2008) | 3 lines Patch #4739 by David Laban: add symbols to pydoc help topics, so that ``help('@')`` works as expected. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/pydoc.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/pydoc.py ============================================================================== --- python/branches/release30-maint/Lib/pydoc.py (original) +++ python/branches/release30-maint/Lib/pydoc.py Sun Jan 4 00:53:44 2009 @@ -1568,6 +1568,42 @@ 'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'), 'yield': ('yield', ''), } + # Either add symbols to this dictionary or to the symbols dictionary + # directly: Whichever is easier. They are merged later. + _symbols_inverse = { + 'STRINGS' : ("'", "'''", "r'", "b'", '"""', '"', 'r"', 'b"'), + 'OPERATORS' : ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&', + '|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'), + 'COMPARISON' : ('<', '>', '<=', '>=', '==', '!=', '<>'), + 'UNARY' : ('-', '~'), + 'AUGMENTEDASSIGNMENT' : ('+=', '-=', '*=', '/=', '%=', '&=', '|=', + '^=', '<<=', '>>=', '**=', '//='), + 'BITWISE' : ('<<', '>>', '&', '|', '^', '~'), + 'COMPLEX' : ('j', 'J') + } + symbols = { + '%': 'OPERATORS FORMATTING', + '**': 'POWER', + ',': 'TUPLES LISTS FUNCTIONS', + '.': 'ATTRIBUTES FLOAT MODULES OBJECTS', + '...': 'ELLIPSIS', + ':': 'SLICINGS DICTIONARYLITERALS', + '@': 'def class', + '\\': 'STRINGS', + '_': 'PRIVATENAMES', + '__': 'PRIVATENAMES SPECIALMETHODS', + '`': 'BACKQUOTES', + '(': 'TUPLES FUNCTIONS CALLS', + ')': 'TUPLES FUNCTIONS CALLS', + '[': 'LISTS SUBSCRIPTS SLICINGS', + ']': 'LISTS SUBSCRIPTS SLICINGS' + } + for topic, symbols_ in _symbols_inverse.items(): + for symbol in symbols_: + topics = symbols.get(symbol, topic) + if topic not in topics: + topics = topics + ' ' + topic + symbols[symbol] = topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS ' @@ -1705,10 +1741,12 @@ if type(request) is type(''): if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() + elif request == 'symbols': self.listsymbols() elif request == 'topics': self.listtopics() elif request == 'modules': self.listmodules() elif request[:8] == 'modules ': self.listmodules(request.split()[1]) + elif request in self.symbols: self.showsymbol(request) elif request in self.keywords: self.showtopic(request) elif request in self.topics: self.showtopic(request) elif request: doc(request, 'Help on %s:') @@ -1753,6 +1791,14 @@ ''') self.list(self.keywords.keys()) + def listsymbols(self): + self.output.write(''' +Here is a list of the punctuation symbols which Python assigns special meaning +to. Enter any symbol to get more help. + +''') + self.list(self.symbols.keys()) + def listtopics(self): self.output.write(''' Here is a list of available topics. Enter any topic name to get more help. @@ -1760,7 +1806,7 @@ ''') self.list(self.topics.keys()) - def showtopic(self, topic): + def showtopic(self, topic, more_xrefs=''): try: import pydoc_topics except ImportError: @@ -1774,7 +1820,7 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return if type(target) is type(''): - return self.showtopic(target) + return self.showtopic(target, more_xrefs) label, xrefs = target try: @@ -1783,6 +1829,8 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return pager(doc.strip() + '\n') + if more_xrefs: + xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: import io, formatter buffer = io.StringIO() @@ -1790,6 +1838,11 @@ 'Related help topics: ' + ', '.join(xrefs.split()) + '\n') self.output.write('\n%s\n' % buffer.getvalue()) + def showsymbol(self, symbol): + target = self.symbols[symbol] + topic, _, xrefs = target.partition(' ') + self.showtopic(topic, xrefs) + def listmodules(self, key=''): if key: self.output.write(''' Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 00:53:44 2009 @@ -87,6 +87,9 @@ - Issue #3248: Allow placing ScrolledText in a PanedWindow. +- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') + works as expected in the interactive environment. + - Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char boundary. From python-checkins at python.org Sun Jan 4 00:54:46 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:54:46 +0100 (CET) Subject: [Python-checkins] r68267 - in python/branches/release30-maint: Misc/NEWS Modules/_fileio.c Message-ID: <20090103235446.76C751E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:54:46 2009 New Revision: 68267 Log: Merged revisions 68139 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68139 | hirokazu.yamamoto | 2009-01-01 17:03:45 +0100 (Thu, 01 Jan 2009) | 10 lines Merged revisions 68134 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68134 | hirokazu.yamamoto | 2009-01-02 00:45:39 +0900 | 2 lines Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_fileio.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 00:54:46 2009 @@ -20,11 +20,12 @@ print elapsed times, not only when some objects are uncollectable / unreachable. Original patch by Neil Schemenauer. -- Issue #3439: Add a bit_length method to int. - - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. +- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open + file with `str' filename on Windows. + - Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Sun Jan 4 00:54:46 2009 @@ -284,10 +284,11 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } if(dircheck(self, name) < 0) From python-checkins at python.org Sun Jan 4 00:56:02 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:56:02 +0100 (CET) Subject: [Python-checkins] r68268 - in python/branches/release30-maint: Misc/NEWS Message-ID: <20090103235602.6AFB21E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:56:02 2009 New Revision: 68268 Log: Merged revisions 68140,68152 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r68140 | hirokazu.yamamoto | 2009-01-01 17:09:52 +0100 (Thu, 01 Jan 2009) | 1 line News fix. On py3k, `str' is unicode. should use `bytes'. ........ r68152 | ronald.oussoren | 2009-01-02 12:48:29 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 3433 ........ Modified: python/branches/release30-maint/ (props changed) 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 Sun Jan 4 00:56:02 2009 @@ -24,7 +24,7 @@ non-ascii characters in its name could fail with a "SyntaxError: None" error. - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open - file with `str' filename on Windows. + file with `bytes' filename on Windows. - Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. From python-checkins at python.org Sun Jan 4 00:57:38 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:57:38 +0100 (CET) Subject: [Python-checkins] r68269 - in python/branches/release30-maint: Doc/library/threading.rst Objects/moduleobject.c PC/example_nt/example.c Message-ID: <20090103235738.8B0E01E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:57:38 2009 New Revision: 68269 Log: Merged revisions 68169-68170 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r68169 | georg.brandl | 2009-01-02 20:20:26 +0100 (Fri, 02 Jan 2009) | 2 lines Remove traces of Py_InitModule*. ........ r68170 | georg.brandl | 2009-01-02 21:10:05 +0100 (Fri, 02 Jan 2009) | 2 lines #4808: move old API below new API doc. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/threading.rst python/branches/release30-maint/Objects/moduleobject.c python/branches/release30-maint/PC/example_nt/example.c 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 Sun Jan 4 00:57:38 2009 @@ -278,12 +278,6 @@ raises the same exception. -.. method:: Thread.getName() - Thread.setName() - - Old API for :attr:`~Thread.name`. - - .. attribute:: Thread.name A string used for identification purposes only. It has no semantics. @@ -291,6 +285,13 @@ constructor. +.. method:: Thread.getName() + Thread.setName() + + Old getter/setter API for :attr:`~Thread.name`; use it directly as a property + instead. + + .. attribute:: Thread.ident The 'thread identifier' of this thread or ``None`` if the thread has not been @@ -309,12 +310,6 @@ returns a list of all alive threads. -.. method:: Thread.isDaemon() - Thread.setDaemon() - - Old API for :attr:`~Thread.daemon`. - - .. attribute:: Thread.daemon The thread's daemon flag. This must be set before :meth:`start` is called, @@ -325,6 +320,13 @@ The entire Python program exits when no alive non-daemon threads are left. +.. method:: Thread.isDaemon() + Thread.setDaemon() + + Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a + property instead. + + .. _lock-objects: Lock Objects Modified: python/branches/release30-maint/Objects/moduleobject.c ============================================================================== --- python/branches/release30-maint/Objects/moduleobject.c (original) +++ python/branches/release30-maint/Objects/moduleobject.c Sun Jan 4 00:57:38 2009 @@ -91,9 +91,9 @@ This is a bit of a hack: when the shared library is loaded, the module name is "package.module", but the module calls - Py_InitModule*() with just "module" for the name. The shared + PyModule_Create*() with just "module" for the name. The shared library loader squirrels away the true name of the module in - _Py_PackageContext, and Py_InitModule*() will substitute this + _Py_PackageContext, and PyModule_Create*() will substitute this (if the name actually matches). */ if (_Py_PackageContext != NULL) { Modified: python/branches/release30-maint/PC/example_nt/example.c ============================================================================== --- python/branches/release30-maint/PC/example_nt/example.c (original) +++ python/branches/release30-maint/PC/example_nt/example.c Sun Jan 4 00:57:38 2009 @@ -13,8 +13,20 @@ {NULL, NULL} }; +static struct PyModuleDef examplemodule = { + PyModuleDef_HEAD_INIT, + "example", + "example module doc string", + -1, + example_methods, + NULL, + NULL, + NULL, + NULL +}; + PyMODINIT_FUNC -initexample(void) +PyInit_example(void) { - Py_InitModule("example", example_methods); + return PyModule_Create(&examplemodule); } From python-checkins at python.org Sun Jan 4 00:58:58 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:58:58 +0100 (CET) Subject: [Python-checkins] r68270 - in python/branches/release30-maint: Misc/NEWS Python/pythonrun.c Message-ID: <20090103235858.540961E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:58:58 2009 New Revision: 68270 Log: Merged revisions 68175 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68175 | martin.v.loewis | 2009-01-02 21:47:48 +0100 (Fri, 02 Jan 2009) | 13 lines Merged revisions 68172-68173 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68172 | martin.v.loewis | 2009-01-02 21:32:55 +0100 (Fr, 02 Jan 2009) | 2 lines Issue #4075: Use OutputDebugStringW in Py_FatalError. ........ r68173 | martin.v.loewis | 2009-01-02 21:40:14 +0100 (Fr, 02 Jan 2009) | 2 lines Issue #4051: Prevent conflict of UNICODE macros in cPickle. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Python/pythonrun.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 00:58:58 2009 @@ -20,6 +20,8 @@ print elapsed times, not only when some objects are uncollectable / unreachable. Original patch by Neil Schemenauer. +- Issue #4075: Use OutputDebugStringW in Py_FatalError. + - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. Modified: python/branches/release30-maint/Python/pythonrun.c ============================================================================== --- python/branches/release30-maint/Python/pythonrun.c (original) +++ python/branches/release30-maint/Python/pythonrun.c Sun Jan 4 00:58:58 2009 @@ -23,6 +23,8 @@ #include #endif +#include "malloc.h" /* for alloca */ + #ifdef HAVE_LANGINFO_H #include #include @@ -1918,9 +1920,21 @@ PyErr_Print(); } #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif From python-checkins at python.org Sun Jan 4 00:59:37 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 00:59:37 +0100 (CET) Subject: [Python-checkins] r68271 - in python/branches/release30-maint: Python/pythonrun.c Message-ID: <20090103235937.16F0D1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 00:59:36 2009 New Revision: 68271 Log: Merged revisions 68178 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68178 | benjamin.peterson | 2009-01-02 22:24:04 +0100 (Fri, 02 Jan 2009) | 9 lines Merged revisions 68174 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68174 | benjamin.peterson | 2009-01-02 14:47:27 -0600 (Fri, 02 Jan 2009) | 1 line fix compilation on non-Windows platforms ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Python/pythonrun.c Modified: python/branches/release30-maint/Python/pythonrun.c ============================================================================== --- python/branches/release30-maint/Python/pythonrun.c (original) +++ python/branches/release30-maint/Python/pythonrun.c Sun Jan 4 00:59:36 2009 @@ -23,7 +23,9 @@ #include #endif +#ifdef MS_WINDOWS #include "malloc.h" /* for alloca */ +#endif #ifdef HAVE_LANGINFO_H #include From python-checkins at python.org Sun Jan 4 01:01:17 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:01:17 +0100 (CET) Subject: [Python-checkins] r68272 - python/branches/release30-maint Message-ID: <20090104000117.B482D1E400C@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:01:17 2009 New Revision: 68272 Log: Blocked revisions 68113,68129,68165,68168,68181,68198,68204,68211 via svnmerge ................ r68113 | benjamin.peterson | 2009-01-01 01:23:30 +0100 (Thu, 01 Jan 2009) | 53 lines Merged revisions 67952,67957-67958,67960-67961,67963,67973,67978,67995,68030,68057,68061 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67952 | georg.brandl | 2008-12-27 11:42:40 -0600 (Sat, 27 Dec 2008) | 2 lines #4752: actually use custom handler in example. ........ r67957 | georg.brandl | 2008-12-27 12:49:19 -0600 (Sat, 27 Dec 2008) | 2 lines #4754: improve winsound documentation. ........ r67958 | georg.brandl | 2008-12-27 13:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines #4682: 'b' is actually unsigned char. ........ r67960 | georg.brandl | 2008-12-27 13:04:44 -0600 (Sat, 27 Dec 2008) | 2 lines #4695: fix backslashery. ........ r67961 | georg.brandl | 2008-12-27 13:06:04 -0600 (Sat, 27 Dec 2008) | 2 lines Use :samp: role. ........ r67963 | georg.brandl | 2008-12-27 13:11:15 -0600 (Sat, 27 Dec 2008) | 2 lines #4671: document that pydoc imports modules. ........ r67973 | alexandre.vassalotti | 2008-12-27 20:58:22 -0600 (Sat, 27 Dec 2008) | 2 lines Document Py_VaBuildValue. ........ r67978 | georg.brandl | 2008-12-28 05:58:49 -0600 (Sun, 28 Dec 2008) | 2 lines #4731: clarify message about missing module prerequisites. ........ r67995 | benjamin.peterson | 2008-12-28 15:16:07 -0600 (Sun, 28 Dec 2008) | 1 line #4763 PyErr_ExceptionMatches won't blow up with NULL arguments ........ r68030 | benjamin.peterson | 2008-12-29 15:38:14 -0600 (Mon, 29 Dec 2008) | 1 line fix French ........ r68057 | vinay.sajip | 2008-12-30 01:01:25 -0600 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ........ r68061 | georg.brandl | 2008-12-30 04:15:49 -0600 (Tue, 30 Dec 2008) | 2 lines #4778: attributes can't be called. ........ ................ r68129 | benjamin.peterson | 2009-01-01 16:05:06 +0100 (Thu, 01 Jan 2009) | 46 lines Merged revisions 68116-68119,68121,68123-68127 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68116 | georg.brandl | 2009-01-01 05:46:51 -0600 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ........ r68117 | georg.brandl | 2009-01-01 05:53:55 -0600 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ........ r68118 | georg.brandl | 2009-01-01 06:00:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ........ r68119 | georg.brandl | 2009-01-01 06:09:40 -0600 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ........ r68121 | georg.brandl | 2009-01-01 06:43:33 -0600 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ........ r68123 | georg.brandl | 2009-01-01 06:52:29 -0600 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ........ r68124 | georg.brandl | 2009-01-01 06:53:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ........ r68125 | georg.brandl | 2009-01-01 07:02:09 -0600 (Thu, 01 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ........ r68126 | georg.brandl | 2009-01-01 07:05:13 -0600 (Thu, 01 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ........ r68127 | georg.brandl | 2009-01-01 07:14:49 -0600 (Thu, 01 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ........ ................ r68165 | antoine.pitrou | 2009-01-02 18:34:35 +0100 (Fri, 02 Jan 2009) | 3 lines Issue #4738: finer-grained locking in the zlib module. ................ r68168 | vinay.sajip | 2009-01-02 19:53:45 +0100 (Fri, 02 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ................ r68181 | raymond.hettinger | 2009-01-02 22:39:07 +0100 (Fri, 02 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ................ r68198 | benjamin.peterson | 2009-01-03 17:53:14 +0100 (Sat, 03 Jan 2009) | 62 lines Merged revisions 68197 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68197 | benjamin.peterson | 2009-01-03 10:34:02 -0600 (Sat, 03 Jan 2009) | 55 lines Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ ................ ................ r68204 | martin.v.loewis | 2009-01-03 18:22:40 +0100 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68203 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68203 | martin.v.loewis | 2009-01-03 18:19:26 +0100 (Sa, 03 Jan 2009) | 2 lines Issue #4817: Remove unused function PyOS_GetLastModificationTime. ........ ................ r68211 | raymond.hettinger | 2009-01-03 20:20:32 +0100 (Sat, 03 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 01:02:16 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:02:16 +0100 (CET) Subject: [Python-checkins] r68273 - in python/branches/release30-maint: Doc/Makefile Doc/tools/rstlint.py Message-ID: <20090104000216.114801E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:02:15 2009 New Revision: 68273 Log: Merged revisions 68223 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68223 | georg.brandl | 2009-01-03 22:15:20 +0100 (Sat, 03 Jan 2009) | 21 lines Merged revisions 68214-68215,68217-68218 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines Make indentation consistent. ........ r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines Fix role name. ........ r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. ........ r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines Recognize usage of the default role. ........ ................ Added: python/branches/release30-maint/Doc/tools/rstlint.py - copied unchanged from r68223, /python/branches/py3k/Doc/tools/rstlint.py Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/Makefile Modified: python/branches/release30-maint/Doc/Makefile ============================================================================== --- python/branches/release30-maint/Doc/Makefile (original) +++ python/branches/release30-maint/Doc/Makefile Sun Jan 4 01:02:15 2009 @@ -14,7 +14,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html htmlhelp clean coverage dist +.PHONY: help checkout update build html htmlhelp clean coverage dist check help: @echo "Please use \`make ' where is one of" @@ -141,3 +141,5 @@ cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 +check: + $(PYTHON) tools/rstlint.py -i tools -s 2 From python-checkins at python.org Sun Jan 4 01:02:52 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:02:52 +0100 (CET) Subject: [Python-checkins] r68274 - in python/branches/release30-maint: Doc/distutils/uploading.rst Doc/documenting/markup.rst Doc/library/ast.rst Doc/library/ctypes.rst Doc/library/decimal.rst Doc/library/fractions.rst Doc/library/tempfile.rst Message-ID: <20090104000252.C8FFB1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:02:52 2009 New Revision: 68274 Log: Merged revisions 68224 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68224 | georg.brandl | 2009-01-03 22:17:04 +0100 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68219 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines Fix uses of the default role. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/distutils/uploading.rst python/branches/release30-maint/Doc/documenting/markup.rst python/branches/release30-maint/Doc/library/ast.rst python/branches/release30-maint/Doc/library/ctypes.rst python/branches/release30-maint/Doc/library/decimal.rst python/branches/release30-maint/Doc/library/fractions.rst python/branches/release30-maint/Doc/library/tempfile.rst Modified: python/branches/release30-maint/Doc/distutils/uploading.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/uploading.rst (original) +++ python/branches/release30-maint/Doc/distutils/uploading.rst Sun Jan 4 01:02:52 2009 @@ -33,9 +33,9 @@ be available for execution on the system :envvar:`PATH`. You can also specify which key to use for signing using the :option:`--identity=*name*` option. -Other :command:`upload` options include :option:`--repository=*url*` -or :option:`--repository=*section*` where `url` is the url of the server -and `section` the name of the section in :file:`$HOME/.pypirc`, and +Other :command:`upload` options include :option:`--repository=` or +:option:`--repository=
` where *url* is the url of the server and +*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). Modified: python/branches/release30-maint/Doc/documenting/markup.rst ============================================================================== --- python/branches/release30-maint/Doc/documenting/markup.rst (original) +++ python/branches/release30-maint/Doc/documenting/markup.rst Sun Jan 4 01:02:52 2009 @@ -599,7 +599,7 @@ Example:: .. versionadded:: 2.5 - The `spam` parameter. + The *spam* parameter. Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. @@ -760,7 +760,7 @@ Blank lines are not allowed within ``productionlist`` directive arguments. The definition can contain token names which are marked as interpreted text - (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references + (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references to the productions of these tokens. Note that no further reST parsing is done in the production, so that you Modified: python/branches/release30-maint/Doc/library/ast.rst ============================================================================== --- python/branches/release30-maint/Doc/library/ast.rst (original) +++ python/branches/release30-maint/Doc/library/ast.rst Sun Jan 4 01:02:52 2009 @@ -178,7 +178,7 @@ A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -207,11 +207,11 @@ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: 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 Sun Jan 4 01:02:52 2009 @@ -1376,24 +1376,22 @@ The *mode* parameter can be used to specify how the library is loaded. For details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored. -The *use_errno* parameter, when set to True, enables a ctypes -mechanism that allows to access the system `errno` error number in a -safe way. `ctypes` maintains a thread-local copy of the systems -`errno` variable; if you call foreign functions created with -`use_errno=True` then the `errno` value before the function call is -swapped with the ctypes private copy, the same happens immediately -after the function call. - -The function `ctypes.get_errno()` returns the value of the ctypes -private copy, and the function `ctypes.set_errno(value)` changes the -ctypes private copy to `value` and returns the former value. - -The *use_last_error* parameter, when set to True, enables the same -mechanism for the Windows error code which is managed by the -:func:`GetLastError` and :func:`SetLastError` Windows API functions; -`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used -to request and change the ctypes private copy of the windows error -code. +The *use_errno* parameter, when set to True, enables a ctypes mechanism that +allows to access the system :data:`errno` error number in a safe way. +:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` +variable; if you call foreign functions created with ``use_errno=True`` then the +:data:`errno` value before the function call is swapped with the ctypes private +copy, the same happens immediately after the function call. + +The function :func:`ctypes.get_errno` returns the value of the ctypes private +copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy +to a new value and returns the former value. + +The *use_last_error* parameter, when set to True, enables the same mechanism for +the Windows error code which is managed by the :func:`GetLastError` and +:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and +:func:`ctypes.set_last_error` are used to request and change the ctypes private +copy of the windows error code. .. data:: RTLD_GLOBAL :noindex: @@ -1596,18 +1594,20 @@ .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) The returned function prototype creates functions that use the standard C - calling convention. The function will release the GIL during the call. - If `use_errno` is set to True, the ctypes private copy of the system `errno` - variable is exchanged with the real `errno` value bafore and after the call; - `use_last_error` does the same for the Windows error code. + calling convention. The function will release the GIL during the call. If + *use_errno* is set to True, the ctypes private copy of the system + :data:`errno` variable is exchanged with the real :data:`errno` value bafore + and after the call; *use_last_error* does the same for the Windows error + code. .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) Windows only: The returned function prototype creates functions that use the - ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE` - is the same as :func:`CFUNCTYPE`. The function will release the GIL during the - call. `use_errno` and `use_last_error` have the same meaning as above. + ``stdcall`` calling convention, except on Windows CE where + :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will + release the GIL during the call. *use_errno* and *use_last_error* have the + same meaning as above. .. function:: PYFUNCTYPE(restype, *argtypes) @@ -1852,10 +1852,10 @@ .. function:: find_library(name) :module: ctypes.util - Try to find a library and return a pathname. `name` is the library name without - any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this - is the form used for the posix linker option :option:`-l`). If no library can - be found, returns ``None``. + Try to find a library and return a pathname. *name* is the library name + without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + number (this is the form used for the posix linker option :option:`-l`). If + no library can be found, returns ``None``. The exact functionality is system dependent. @@ -1887,12 +1887,12 @@ .. function:: get_errno() Returns the current value of the ctypes-private copy of the system - `errno` variable in the calling thread. + :data:`errno` variable in the calling thread. .. function:: get_last_error() Windows only: returns the current value of the ctypes-private copy of the system - `LastError` variable in the calling thread. + :data:`LastError` variable in the calling thread. .. function:: memmove(dst, src, count) @@ -1947,15 +1947,14 @@ .. function:: set_errno(value) - Set the current value of the ctypes-private copy of the system - `errno` variable in the calling thread to `value` and return the - previous value. + Set the current value of the ctypes-private copy of the system :data:`errno` + variable in the calling thread to *value* and return the previous value. .. function:: set_last_error(value) - Windows only: set the current value of the ctypes-private copy of - the system `LastError` variable in the calling thread to `value` - and return the previous value. + Windows only: set the current value of the ctypes-private copy of the system + :data:`LastError` variable in the calling thread to *value* and return the + previous value. .. function:: sizeof(obj_or_type) Modified: python/branches/release30-maint/Doc/library/decimal.rst ============================================================================== --- python/branches/release30-maint/Doc/library/decimal.rst (original) +++ python/branches/release30-maint/Doc/library/decimal.rst Sun Jan 4 01:02:52 2009 @@ -1071,7 +1071,7 @@ .. method:: logical_and(x, y) - Applies the logical operation `and` between each operand's digits. + Applies the logical operation *and* between each operand's digits. .. method:: logical_invert(x) @@ -1081,12 +1081,12 @@ .. method:: logical_or(x, y) - Applies the logical operation `or` between each operand's digits. + Applies the logical operation *or* between each operand's digits. .. method:: logical_xor(x, y) - Applies the logical operation `xor` between each operand's digits. + Applies the logical operation *xor* between each operand's digits. .. method:: max(x, y) @@ -1194,8 +1194,8 @@ .. method:: remainder_near(x, y) - Returns `x - y * n`, where *n* is the integer nearest the exact value - of `x / y` (if the result is `0` then its sign will be the sign of *x*). + Returns ``x - y * n``, where *n* is the integer nearest the exact value + of ``x / y`` (if the result is 0 then its sign will be the sign of *x*). .. method:: rotate(x, y) Modified: python/branches/release30-maint/Doc/library/fractions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/fractions.rst (original) +++ python/branches/release30-maint/Doc/library/fractions.rst Sun Jan 4 01:02:52 2009 @@ -126,11 +126,11 @@ .. function:: gcd(a, b) - Return the greatest common divisor of the integers `a` and `b`. If - either `a` or `b` is nonzero, then the absolute value of `gcd(a, - b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)` - has the same sign as `b` if `b` is nonzero; otherwise it takes the sign - of `a`. `gcd(0, 0)` returns `0`. + Return the greatest common divisor of the integers *a* and *b*. If either + *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the + largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same + sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0, + 0)`` returns ``0``. .. seealso:: Modified: python/branches/release30-maint/Doc/library/tempfile.rst ============================================================================== --- python/branches/release30-maint/Doc/library/tempfile.rst (original) +++ python/branches/release30-maint/Doc/library/tempfile.rst Sun Jan 4 01:02:52 2009 @@ -149,11 +149,11 @@ .. warning:: - Use of this function may introduce a security hole in your program. - By the time you get around to doing anything with the file name it - returns, someone else may have beaten you to the punch. - :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + Use of this function may introduce a security hole in your program. By + the time you get around to doing anything with the file name it returns, + someone else may have beaten you to the punch. :func:`mktemp` usage can + be replaced easily with :func:`NamedTemporaryFile`, passing it the + ``delete=False`` parameter:: >>> f = NamedTemporaryFile(delete=False) >>> f From python-checkins at python.org Sun Jan 4 01:04:28 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:04:28 +0100 (CET) Subject: [Python-checkins] r68275 - in python/branches/release30-maint: Doc/c-api/buffer.rst Doc/c-api/conversion.rst Doc/c-api/file.rst Doc/c-api/init.rst Doc/c-api/long.rst Doc/c-api/module.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/distutils/apiref.rst Doc/distutils/builtdist.rst Doc/distutils/configfile.rst Doc/distutils/packageindex.rst Doc/distutils/setupscript.rst Doc/documenting/markup.rst Doc/extending/building.rst Doc/extending/extending.rst Doc/extending/newtypes.rst Doc/extending/windows.rst Doc/glossary.rst Doc/howto/curses.rst Doc/howto/doanddont.rst Doc/howto/functional.rst Doc/howto/sockets.rst Doc/howto/urllib2.rst Doc/howto/webservers.rst Doc/install/index.rst Doc/library/abc.rst Doc/library/aifc.rst Doc/library/array.rst Doc/library/ast.rst Doc/library/audioop.rst Doc/library/bdb.rst Doc/library/cmath.rst Doc/library/codeop.rst Doc/library/collections.rst Doc/library/configparser.rst Doc/library/constants.rst Doc/library/crypt.rst Doc/library/csv.rst Doc/library/datetime.rst Doc/library/decimal.rst Doc/library/dis.rst Doc/library/email.mime.rst Doc/library/fileinput.rst Doc/library/functions.rst Doc/library/gettext.rst Doc/library/heapq.rst Doc/library/idle.rst Doc/library/inspect.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/json.rst Doc/library/locale.rst Doc/library/mailbox.rst Doc/library/math.rst Doc/library/mmap.rst Doc/library/msvcrt.rst Doc/library/multiprocessing.rst Doc/library/nntplib.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/ossaudiodev.rst Doc/library/othergui.rst Doc/library/pdb.rst Doc/library/pickle.rst Doc/library/profile.rst Doc/library/pyexpat.rst Doc/library/queue.rst Doc/library/re.rst Doc/library/rlcompleter.rst Doc/library/sched.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/smtplib.rst Doc/library/socket.rst Doc/library/sqlite3.rst Doc/library/ssl.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/subprocess.rst Doc/library/sys.rst Doc/library/tk.rst Doc/library/tkinter.rst Doc/library/tkinter.tix.rst Doc/library/tokenize.rst Doc/library/trace.rst Doc/library/traceback.rst Doc/library/turtle.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/library/wsgiref.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpc.server.rst Doc/library/zipfile.rst Doc/library/zipimport.rst Doc/license.rst Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tutorial/classes.rst Doc/tutorial/controlflow.rst Doc/tutorial/datastructures.rst Doc/tutorial/errors.rst Doc/tutorial/index.rst Doc/tutorial/inputoutput.rst Doc/tutorial/interpreter.rst Doc/tutorial/introduction.rst Doc/tutorial/modules.rst Doc/tutorial/stdlib.rst Doc/tutorial/stdlib2.rst Doc/tutorial/whatnow.rst Doc/using/cmdline.rst Doc/using/unix.rst Doc/using/windows.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.1.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.3.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.6.rst Doc/whatsnew/3.0.rst Message-ID: <20090104000428.B8A231E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:04:26 2009 New Revision: 68275 Log: Merged revisions 68226 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r68226 | georg.brandl | 2009-01-03 22:18:54 +0100 (Sat, 03 Jan 2009) | 2 lines Remove trailing whitespace. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/buffer.rst python/branches/release30-maint/Doc/c-api/conversion.rst python/branches/release30-maint/Doc/c-api/file.rst python/branches/release30-maint/Doc/c-api/init.rst python/branches/release30-maint/Doc/c-api/long.rst python/branches/release30-maint/Doc/c-api/module.rst python/branches/release30-maint/Doc/c-api/reflection.rst python/branches/release30-maint/Doc/c-api/sequence.rst python/branches/release30-maint/Doc/distutils/apiref.rst python/branches/release30-maint/Doc/distutils/builtdist.rst python/branches/release30-maint/Doc/distutils/configfile.rst python/branches/release30-maint/Doc/distutils/packageindex.rst python/branches/release30-maint/Doc/distutils/setupscript.rst python/branches/release30-maint/Doc/documenting/markup.rst python/branches/release30-maint/Doc/extending/building.rst python/branches/release30-maint/Doc/extending/extending.rst python/branches/release30-maint/Doc/extending/newtypes.rst python/branches/release30-maint/Doc/extending/windows.rst python/branches/release30-maint/Doc/glossary.rst python/branches/release30-maint/Doc/howto/curses.rst python/branches/release30-maint/Doc/howto/doanddont.rst python/branches/release30-maint/Doc/howto/functional.rst python/branches/release30-maint/Doc/howto/sockets.rst python/branches/release30-maint/Doc/howto/urllib2.rst python/branches/release30-maint/Doc/howto/webservers.rst python/branches/release30-maint/Doc/install/index.rst python/branches/release30-maint/Doc/library/abc.rst python/branches/release30-maint/Doc/library/aifc.rst python/branches/release30-maint/Doc/library/array.rst python/branches/release30-maint/Doc/library/ast.rst python/branches/release30-maint/Doc/library/audioop.rst python/branches/release30-maint/Doc/library/bdb.rst python/branches/release30-maint/Doc/library/cmath.rst python/branches/release30-maint/Doc/library/codeop.rst python/branches/release30-maint/Doc/library/collections.rst python/branches/release30-maint/Doc/library/configparser.rst python/branches/release30-maint/Doc/library/constants.rst python/branches/release30-maint/Doc/library/crypt.rst python/branches/release30-maint/Doc/library/csv.rst python/branches/release30-maint/Doc/library/datetime.rst python/branches/release30-maint/Doc/library/decimal.rst python/branches/release30-maint/Doc/library/dis.rst python/branches/release30-maint/Doc/library/email.mime.rst python/branches/release30-maint/Doc/library/fileinput.rst python/branches/release30-maint/Doc/library/functions.rst python/branches/release30-maint/Doc/library/gettext.rst python/branches/release30-maint/Doc/library/heapq.rst python/branches/release30-maint/Doc/library/idle.rst python/branches/release30-maint/Doc/library/inspect.rst python/branches/release30-maint/Doc/library/io.rst python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Doc/library/json.rst python/branches/release30-maint/Doc/library/locale.rst python/branches/release30-maint/Doc/library/mailbox.rst python/branches/release30-maint/Doc/library/math.rst python/branches/release30-maint/Doc/library/mmap.rst python/branches/release30-maint/Doc/library/msvcrt.rst python/branches/release30-maint/Doc/library/multiprocessing.rst python/branches/release30-maint/Doc/library/nntplib.rst python/branches/release30-maint/Doc/library/operator.rst python/branches/release30-maint/Doc/library/optparse.rst python/branches/release30-maint/Doc/library/os.rst python/branches/release30-maint/Doc/library/ossaudiodev.rst python/branches/release30-maint/Doc/library/othergui.rst python/branches/release30-maint/Doc/library/pdb.rst python/branches/release30-maint/Doc/library/pickle.rst python/branches/release30-maint/Doc/library/profile.rst python/branches/release30-maint/Doc/library/pyexpat.rst python/branches/release30-maint/Doc/library/queue.rst python/branches/release30-maint/Doc/library/re.rst python/branches/release30-maint/Doc/library/rlcompleter.rst python/branches/release30-maint/Doc/library/sched.rst python/branches/release30-maint/Doc/library/shutil.rst python/branches/release30-maint/Doc/library/signal.rst python/branches/release30-maint/Doc/library/smtplib.rst python/branches/release30-maint/Doc/library/socket.rst python/branches/release30-maint/Doc/library/sqlite3.rst python/branches/release30-maint/Doc/library/ssl.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/library/string.rst python/branches/release30-maint/Doc/library/subprocess.rst python/branches/release30-maint/Doc/library/sys.rst python/branches/release30-maint/Doc/library/tk.rst python/branches/release30-maint/Doc/library/tkinter.rst python/branches/release30-maint/Doc/library/tkinter.tix.rst python/branches/release30-maint/Doc/library/tokenize.rst python/branches/release30-maint/Doc/library/trace.rst python/branches/release30-maint/Doc/library/traceback.rst python/branches/release30-maint/Doc/library/turtle.rst python/branches/release30-maint/Doc/library/unicodedata.rst python/branches/release30-maint/Doc/library/unittest.rst python/branches/release30-maint/Doc/library/warnings.rst python/branches/release30-maint/Doc/library/webbrowser.rst python/branches/release30-maint/Doc/library/wsgiref.rst python/branches/release30-maint/Doc/library/xml.etree.elementtree.rst python/branches/release30-maint/Doc/library/xmlrpc.server.rst python/branches/release30-maint/Doc/library/zipfile.rst python/branches/release30-maint/Doc/library/zipimport.rst python/branches/release30-maint/Doc/license.rst python/branches/release30-maint/Doc/reference/datamodel.rst python/branches/release30-maint/Doc/reference/expressions.rst python/branches/release30-maint/Doc/reference/lexical_analysis.rst python/branches/release30-maint/Doc/reference/simple_stmts.rst python/branches/release30-maint/Doc/tutorial/classes.rst python/branches/release30-maint/Doc/tutorial/controlflow.rst python/branches/release30-maint/Doc/tutorial/datastructures.rst python/branches/release30-maint/Doc/tutorial/errors.rst python/branches/release30-maint/Doc/tutorial/index.rst python/branches/release30-maint/Doc/tutorial/inputoutput.rst python/branches/release30-maint/Doc/tutorial/interpreter.rst python/branches/release30-maint/Doc/tutorial/introduction.rst python/branches/release30-maint/Doc/tutorial/modules.rst python/branches/release30-maint/Doc/tutorial/stdlib.rst python/branches/release30-maint/Doc/tutorial/stdlib2.rst python/branches/release30-maint/Doc/tutorial/whatnow.rst python/branches/release30-maint/Doc/using/cmdline.rst python/branches/release30-maint/Doc/using/unix.rst python/branches/release30-maint/Doc/using/windows.rst python/branches/release30-maint/Doc/whatsnew/2.0.rst python/branches/release30-maint/Doc/whatsnew/2.1.rst python/branches/release30-maint/Doc/whatsnew/2.2.rst python/branches/release30-maint/Doc/whatsnew/2.3.rst python/branches/release30-maint/Doc/whatsnew/2.4.rst python/branches/release30-maint/Doc/whatsnew/2.5.rst python/branches/release30-maint/Doc/whatsnew/2.6.rst python/branches/release30-maint/Doc/whatsnew/3.0.rst Modified: python/branches/release30-maint/Doc/c-api/buffer.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/buffer.rst (original) +++ python/branches/release30-maint/Doc/c-api/buffer.rst Sun Jan 4 01:04:26 2009 @@ -31,7 +31,7 @@ .. index:: single: PyBufferProcs -More information on the buffer interface is provided in the section +More information on the buffer interface is provided in the section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`. Buffer objects are useful as a way to expose the data from another object's @@ -104,7 +104,7 @@ pointer += strides[i] * indices[i]; if (suboffsets[i] >=0 ) { pointer = *((char**)pointer) + suboffsets[i]; - } + } } return (void*)pointer; } Modified: python/branches/release30-maint/Doc/c-api/conversion.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/conversion.rst (original) +++ python/branches/release30-maint/Doc/c-api/conversion.rst Sun Jan 4 01:04:26 2009 @@ -80,7 +80,7 @@ See the Unix man page :manpage:`atof(2)` for details. - + .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) Case insensitive comparison of strings. The function works almost Modified: python/branches/release30-maint/Doc/c-api/file.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/file.rst (original) +++ python/branches/release30-maint/Doc/c-api/file.rst Sun Jan 4 01:04:26 2009 @@ -22,7 +22,7 @@ .. warning:: - Take care when you are mixing streams and descriptors! For more + Take care when you are mixing streams and descriptors! For more information, see `the GNU C Library docs `_. 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 Sun Jan 4 01:04:26 2009 @@ -885,7 +885,7 @@ Return a tuple of function call counts. There are constants defined for the positions within the tuple: - + +-------------------------------+-------+ | Name | Value | +===============================+=======+ @@ -911,7 +911,7 @@ +-------------------------------+-------+ | :const:`PCALL_POP` | 10 | +-------------------------------+-------+ - + :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used. Modified: python/branches/release30-maint/Doc/c-api/long.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/long.rst (original) +++ python/branches/release30-maint/Doc/c-api/long.rst Sun Jan 4 01:04:26 2009 @@ -107,7 +107,7 @@ retrieved from the resulting value using :cfunc:`PyLong_AsVoidPtr`. -.. XXX alias PyLong_AS_LONG (for now) +.. XXX alias PyLong_AS_LONG (for now) .. cfunction:: long PyLong_AsLong(PyObject *pylong) .. index:: @@ -123,7 +123,7 @@ Return a C :ctype:`long` representation of the contents of *pylong*. If *pylong* is greater than :const:`LONG_MAX`, return -1 and - set `*overflow` to 1 (for overflow) or -1 (for underflow). + set `*overflow` to 1 (for overflow) or -1 (for underflow). If an exception is set because of type errors, also return -1. Modified: python/branches/release30-maint/Doc/c-api/module.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/module.rst (original) +++ python/branches/release30-maint/Doc/c-api/module.rst Sun Jan 4 01:04:26 2009 @@ -96,7 +96,7 @@ .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro) - Add an int constant to *module*. The name and the value are taken from + Add an int constant to *module*. The name and the value are taken from *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on error, ``0`` on success. Modified: python/branches/release30-maint/Doc/c-api/reflection.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/reflection.rst (original) +++ python/branches/release30-maint/Doc/c-api/reflection.rst Sun Jan 4 01:04:26 2009 @@ -15,7 +15,7 @@ Return a dictionary of the local variables in the current execution frame, or *NULL* if no frame is currently executing. - + .. cfunction:: PyObject* PyEval_GetGlobals() Modified: python/branches/release30-maint/Doc/c-api/sequence.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/sequence.rst (original) +++ python/branches/release30-maint/Doc/c-api/sequence.rst Sun Jan 4 01:04:26 2009 @@ -143,9 +143,9 @@ Return the underlying array of PyObject pointers. Assumes that *o* was returned by :cfunc:`PySequence_Fast` and *o* is not *NULL*. - + Note, if a list gets resized, the reallocation may relocate the items array. - So, only use the underlying array pointer in contexts where the sequence + So, only use the underlying array pointer in contexts where the sequence cannot change. Modified: python/branches/release30-maint/Doc/distutils/apiref.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/apiref.rst (original) +++ python/branches/release30-maint/Doc/distutils/apiref.rst Sun Jan 4 01:04:26 2009 @@ -104,7 +104,7 @@ | *package_dir* | A mapping of package to | a dictionary | | | directory names | | +--------------------+--------------------------------+-------------------------------------------------------------+ - + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -754,7 +754,7 @@ standard output, otherwise do nothing. .. % \subsection{Compiler-specific modules} -.. % +.. % .. % The following modules implement concrete subclasses of the abstract .. % \class{CCompiler} class. They should not be instantiated directly, but should .. % be created using \function{distutils.ccompiler.new_compiler()} factory @@ -858,7 +858,7 @@ Macintosh. Needs work to support CW on Windows or Mac OS X. .. % \subsection{Utility modules} -.. % +.. % .. % The following modules all provide general utility functions. They haven't .. % all been documented yet. @@ -1109,13 +1109,13 @@ For MacOS X systems the OS version reflects the minimal version on which binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` - during the build of Python), not the OS version of the current system. + during the build of Python), not the OS version of the current system. For universal binary builds on MacOS X the architecture value reflects the univeral binary status instead of the architecture of the current - processor. For 32-bit universal binaries the architecture is ``fat``, - for 64-bit universal binaries the architecture is ``fat64``, and - for 4-way universal binaries the architecture is ``universal``. + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. Examples of returned values on MacOS X: @@ -1692,7 +1692,7 @@ .. % todo .. % \section{Distutils Commands} -.. % +.. % .. % This part of Distutils implements the various Distutils commands, such .. % as \code{build}, \code{install} \&c. Each command is implemented as a .. % separate module, with the command name as the name of the module. Modified: python/branches/release30-maint/Doc/distutils/builtdist.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/builtdist.rst (original) +++ python/branches/release30-maint/Doc/distutils/builtdist.rst Sun Jan 4 01:04:26 2009 @@ -268,13 +268,13 @@ .. % \longprogramopt{spec-file} option; used in conjunction with .. % \longprogramopt{spec-only}, this gives you an opportunity to customize .. % the \file{.spec} file manually: -.. % +.. % .. % \ begin{verbatim} .. % > python setup.py bdist_rpm --spec-only .. % # ...edit dist/FooBar-1.0.spec .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec .. % \ end{verbatim} -.. % +.. % .. % (Although a better way to do this is probably to override the standard .. % \command{bdist\_rpm} command with one that writes whatever else you want .. % to the \file{.spec} file.) @@ -334,31 +334,31 @@ Cross-compiling on Windows ========================== -Starting with Python 2.6, distutils is capable of cross-compiling between -Windows platforms. In practice, this means that with the correct tools +Starting with Python 2.6, distutils is capable of cross-compiling between +Windows platforms. In practice, this means that with the correct tools installed, you can use a 32bit version of Windows to create 64bit extensions and vice-versa. -To build for an alternate platform, specify the :option:`--plat-name` option -to the build command. Valid values are currently 'win32', 'win-amd64' and +To build for an alternate platform, specify the :option:`--plat-name` option +to the build command. Valid values are currently 'win32', 'win-amd64' and 'win-ia64'. For example, on a 32bit version of Windows, you could execute:: python setup.py build --plat-name=win-amd64 -to build a 64bit version of your extension. The Windows Installers also +to build a 64bit version of your extension. The Windows Installers also support this option, so the command:: python setup.py build --plat-name=win-amd64 bdist_wininst would create a 64bit installation executable on your 32bit version of Windows. -To cross-compile, you must download the Python source code and cross-compile +To cross-compile, you must download the Python source code and cross-compile Python itself for the platform you are targetting - it is not possible from a binary installtion of Python (as the .lib etc file for other platforms are -not included.) In practice, this means the user of a 32 bit operating -system will need to use Visual Studio 2008 to open the -:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the -"x64" configuration of the 'pythoncore' project before cross-compiling +not included.) In practice, this means the user of a 32 bit operating +system will need to use Visual Studio 2008 to open the +:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the +"x64" configuration of the 'pythoncore' project before cross-compiling extensions is possible. Note that by default, Visual Studio 2008 does not install 64bit compilers or Modified: python/branches/release30-maint/Doc/distutils/configfile.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/configfile.rst (original) +++ python/branches/release30-maint/Doc/distutils/configfile.rst Sun Jan 4 01:04:26 2009 @@ -63,7 +63,7 @@ --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine - --swig-opts list of SWIG command line options + --swig-opts list of SWIG command line options [...] Note that an option spelled :option:`--foo-bar` on the command-line is spelled Modified: python/branches/release30-maint/Doc/distutils/packageindex.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/packageindex.rst (original) +++ python/branches/release30-maint/Doc/distutils/packageindex.rst Sun Jan 4 01:04:26 2009 @@ -72,7 +72,7 @@ index-servers = pypi other - + [pypi] repository: username: @@ -91,4 +91,4 @@ python setup.py register -r other - + Modified: python/branches/release30-maint/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/setupscript.rst (original) +++ python/branches/release30-maint/Doc/distutils/setupscript.rst Sun Jan 4 01:04:26 2009 @@ -213,7 +213,7 @@ this:: setup(..., - ext_modules=[Extension('_foo', ['foo.i'], + ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], ) Modified: python/branches/release30-maint/Doc/documenting/markup.rst ============================================================================== --- python/branches/release30-maint/Doc/documenting/markup.rst (original) +++ python/branches/release30-maint/Doc/documenting/markup.rst Sun Jan 4 01:04:26 2009 @@ -508,7 +508,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. .. describe:: var @@ -767,7 +767,7 @@ don't have to escape ``*`` or ``|`` characters. -.. XXX describe optional first parameter +.. XXX describe optional first parameter The following is an example taken from the Python Reference Manual:: Modified: python/branches/release30-maint/Doc/extending/building.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/building.rst (original) +++ python/branches/release30-maint/Doc/extending/building.rst Sun Jan 4 01:04:26 2009 @@ -39,7 +39,7 @@ With this :file:`setup.py`, and a file :file:`demo.c`, running :: - python setup.py build + python setup.py build will compile :file:`demo.c`, and produce an extension module named ``demo`` in the :file:`build` directory. Depending on the system, the module file will end Modified: python/branches/release30-maint/Doc/extending/extending.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/extending.rst (original) +++ python/branches/release30-maint/Doc/extending/extending.rst Sun Jan 4 01:04:26 2009 @@ -334,7 +334,7 @@ :cfunc:`PyInit_spam` is called. (See below for comments about embedding Python.) It calls :cfunc:`PyModule_Create`, which returns a module object, and inserts built-in function objects into the newly created module based upon the -table (an array of :ctype:`PyMethodDef` structures) found in the module definition. +table (an array of :ctype:`PyMethodDef` structures) found in the module definition. :cfunc:`PyModule_Create` returns a pointer to the module object that it creates. It may abort with a fatal error for certain errors, or return *NULL* if the module could not be initialized @@ -482,7 +482,7 @@ :cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of -arguments. To call the Python function with no arguments, pass in NULL, or +arguments. To call the Python function with no arguments, pass in NULL, or an empty tuple; to call it with one argument, pass a singleton tuple. :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example:: @@ -521,7 +521,7 @@ if (result == NULL) return NULL; /* Pass error back */ ...use result... - Py_DECREF(result); + Py_DECREF(result); Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases @@ -546,7 +546,7 @@ the error check! Also note that strictly speaking this code is not complete: :cfunc:`Py_BuildValue` may run out of memory, and this should be checked. -You may also call a function with keyword arguments by using +You may also call a function with keyword arguments by using :cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. :: @@ -687,7 +687,7 @@ static PyObject * keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) - { + { int voltage; char *state = "a stiff"; char *action = "voom"; @@ -695,11 +695,11 @@ static char *kwlist[] = {"voltage", "state", "action", "type", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, &voltage, &state, &action, &type)) - return NULL; + return NULL; - printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", + printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", action, voltage); printf("-- Lovely plumage, the %s -- It's %s!\n", type, state); 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 Sun Jan 4 01:04:26 2009 @@ -1180,7 +1180,7 @@ of *NULL* is required. .. XXX Descriptors need to be explained in more detail somewhere, but not here. - + Descriptor objects have two handler functions which correspond to the \member{tp_getattro} and \member{tp_setattro} handlers. The \method{__get__()} handler is a function which is passed the descriptor, @@ -1233,15 +1233,15 @@ return -1; } -.. XXX tp_compare is dead; need to rewrite for tp_richcompare! +.. XXX tp_compare is dead; need to rewrite for tp_richcompare! Object Comparison ----------------- - + :: - + cmpfunc tp_compare; - + The :attr:`tp_compare` handler is called when comparisons are needed and the object does not implement the specific rich comparison method which matches the requested comparison. (It is always used if defined and the @@ -1252,18 +1252,18 @@ allowed to return arbitrary negative or positive integers for less than and 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_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`. - + Here is a sample implementation:: - + static int newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) { long result; - + if (obj1->obj_UnderlyingDatatypePtr->size < obj2->obj_UnderlyingDatatypePtr->size) { result = -1; Modified: python/branches/release30-maint/Doc/extending/windows.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/windows.rst (original) +++ python/branches/release30-maint/Doc/extending/windows.rst Sun Jan 4 01:04:26 2009 @@ -102,7 +102,7 @@ and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its first argument (use the minimal :file:`example.c` in this directory as a guide). By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. - The output file should be called :file:`spam.pyd` (in Release mode) or + The output file should be called :file:`spam.pyd` (in Release mode) or :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. Modified: python/branches/release30-maint/Doc/glossary.rst ============================================================================== --- python/branches/release30-maint/Doc/glossary.rst (original) +++ python/branches/release30-maint/Doc/glossary.rst Sun Jan 4 01:04:26 2009 @@ -11,7 +11,7 @@ ``>>>`` The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter. - + ``...`` The default Python prompt of the interactive shell when entering code for an indented code block or within a pair of matching left and right @@ -50,11 +50,11 @@ A value associated with an object which is referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. - + BDFL Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator. - + bytecode Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in @@ -67,7 +67,7 @@ A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class. - + coercion The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, @@ -77,7 +77,7 @@ will raise a ``TypeError``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. - + complex number An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary @@ -89,7 +89,7 @@ :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them. - + context manager An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. @@ -132,7 +132,7 @@ and reference to super classes. For more information about descriptors' methods, see :ref:`descriptors`. - + dictionary An associative array, where arbitrary keys are mapped to values. The use of :class:`dict` closely resembles that for :class:`list`, but the keys can @@ -146,8 +146,8 @@ of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object. - - duck-typing + + duck-typing A pythonic programming style which determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it @@ -157,13 +157,13 @@ :func:`isinstance`. (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming. - + EAFP Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` - statements. The technique contrasts with the :term:`LBYL` style + statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C. expression @@ -196,7 +196,7 @@ By importing the :mod:`__future__` module and evaluating its variables, you can see when a new feature was first added to the language and when it becomes the default:: - + >>> import __future__ >>> __future__.division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) @@ -205,7 +205,7 @@ The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. - + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -215,21 +215,21 @@ stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the :meth:`__next__` method of the returned iterator. - + .. index:: single: generator expression - + generator expression An expression that returns a generator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: - + >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285 - + GIL See :term:`global interpreter lock`. - + global interpreter lock The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. @@ -255,14 +255,14 @@ containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`. - + IDLE An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application. - + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to @@ -277,7 +277,7 @@ arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). - + interpreted Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the @@ -286,7 +286,7 @@ Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`. - + iterable A container object capable of returning its members one at a time. Examples of iterables include all sequence types (such as @@ -302,7 +302,7 @@ statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`. - + iterator An object representing a stream of data. Repeated calls to the iterator's :meth:`__next__` (or passing it to the builtin function) :func:`next` @@ -318,7 +318,7 @@ :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container. - + More information can be found in :ref:`typeiter`. keyword argument @@ -342,7 +342,7 @@ A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1). - + list comprehension A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ["0x%02x" % x for x in @@ -350,11 +350,11 @@ even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed. - + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. - + metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for @@ -373,7 +373,7 @@ of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`. - + mutable Mutable objects can change their value but keep their :func:`id`. See also :term:`immutable`. @@ -390,7 +390,7 @@ :func:`collections.namedtuple`. The latter approach automatically provides extra features such as a self-documenting representation like ``Employee(name='jones', title='programmer')``. - + namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and builtin namespaces as well @@ -402,7 +402,7 @@ :func:`random.seed` or :func:`itertools.izip` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively. - + nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to @@ -410,7 +410,7 @@ reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. - + new-style class Old name for the flavor of classes now used for all class objects. In earlier Python versions, only new-style classes could use Python's newer, @@ -421,7 +421,7 @@ Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`. - + positional argument The arguments assigned to local names inside a function or method, determined by the order in which they were given in the call. ``*`` is @@ -441,7 +441,7 @@ to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:: - + for i in range(len(food)): print(food[i]) @@ -464,7 +464,7 @@ popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. - + sequence An :term:`iterable` which supports efficient element access using integer indices via the :meth:`__getitem__` special method and defines a @@ -516,7 +516,7 @@ virtual machine A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler. - + Zen of Python Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing Modified: python/branches/release30-maint/Doc/howto/curses.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/curses.rst (original) +++ python/branches/release30-maint/Doc/howto/curses.rst Sun Jan 4 01:04:26 2009 @@ -399,8 +399,8 @@ curses.echo() # Enable echoing of characters - # Get a 15-character string, with the cursor on the top line - s = stdscr.getstr(0,0, 15) + # Get a 15-character string, with the cursor on the top line + s = stdscr.getstr(0,0, 15) The Python :mod:`curses.textpad` module supplies something better. With it, you can turn a window into a text box that supports an Emacs-like set of Modified: python/branches/release30-maint/Doc/howto/doanddont.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/doanddont.rst (original) +++ python/branches/release30-maint/Doc/howto/doanddont.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ ************************************ - Idioms and Anti-Idioms in Python + Idioms and Anti-Idioms in Python ************************************ :Author: Moshe Zadka @@ -94,7 +94,7 @@ # bar.py from foo import a if something(): - a = 2 # danger: foo.a != a + a = 2 # danger: foo.a != a Good example:: @@ -271,6 +271,6 @@ This version is bulletproof:: - value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + calculate_number(10, 20)*forbulate(500, 360)) Modified: python/branches/release30-maint/Doc/howto/functional.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/functional.rst (original) +++ python/branches/release30-maint/Doc/howto/functional.rst Sun Jan 4 01:04:26 2009 @@ -145,7 +145,7 @@ functions are also easier to read and to check for errors. -Ease of debugging and testing +Ease of debugging and testing ----------------------------- Testing and debugging a functional-style program is easier. @@ -213,7 +213,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> Python expects iterable objects in several different contexts, the most important being the ``for`` statement. In the statement ``for X in Y``, Y must @@ -363,7 +363,7 @@ comprehensions are surrounded by square brackets ("[]"). Generator expressions have the form:: - ( expression for expr in sequence1 + ( expression for expr in sequence1 if condition1 for expr2 in sequence2 if condition2 @@ -405,7 +405,7 @@ if not (conditionN): continue # Skip this element - # Output the value of + # Output the value of # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` @@ -419,8 +419,8 @@ >>> seq1 = 'abc' >>> seq2 = (1,2,3) >>> [(x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), + [('a', 1), ('a', 2), ('a', 3), + ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)] To avoid introducing an ambiguity into Python's grammar, if ``expression`` is @@ -627,7 +627,7 @@ Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate the features of generator expressions: -``map(f, iterA, iterB, ...)`` returns an iterator over the sequence +``map(f, iterA, iterB, ...)`` returns an iterator over the sequence ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``. >>> def upper(s): @@ -639,7 +639,7 @@ >>> [upper(s) for s in ['sentence', 'fragment']] ['SENTENCE', 'FRAGMENT'] -You can of course achieve the same effect with a list comprehension. +You can of course achieve the same effect with a list comprehension. ``filter(predicate, iter)`` returns an iterator over all the sequence elements that meet a certain condition, and is similarly duplicated by list @@ -709,7 +709,7 @@ True >>> all([0,1,0]) False - >>> all([0,0,0]) + >>> all([0,0,0]) False >>> all([1,1,1]) True @@ -827,7 +827,7 @@ ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream of tuples, and calls ``f()`` using these tuples as the arguments:: - itertools.starmap(os.path.join, + itertools.starmap(os.path.join, [('/usr', 'bin', 'java'), ('/bin', 'python'), ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) => @@ -887,9 +887,9 @@ :: - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), + city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), + ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), ... ] @@ -904,7 +904,7 @@ where iterator-1 => ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => + iterator-2 => ('Anchorage', 'AK'), ('Nome', 'AK') iterator-3 => ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') @@ -1045,7 +1045,7 @@ >>> double(add(5, 6)) 22 - + The ``unpack`` keyword is provided to work around the fact that Python functions are not always `fully curried `__. By default, it is expected that the ``inner`` function will return a single object @@ -1054,15 +1054,15 @@ will be expanded before being passed to ``outer``. Put simply, :: compose(f, g)(5, 6) - + is equivalent to:: f(g(5, 6)) - + while :: compose(f, g, unpack=True)(5, 6) - + is equivalent to:: f(*g(5, 6)) @@ -1074,21 +1074,21 @@ from functional import compose, partial import functools - + multi_compose = partial(functools.reduce, compose) - - + + We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of ``"".join(...)`` that converts its arguments to string:: from functional import compose, partial - + join = compose("".join, partial(map, str)) ``flip(func)`` - + ``flip()`` wraps the callable in ``func`` and causes it to receive its non-keyword arguments in reverse order. :: @@ -1103,7 +1103,7 @@ (7, 6, 5) ``foldl(func, start, iterable)`` - + ``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable. The function is applied to the starting value and the first element of the list, then the result of that and the second element of the @@ -1117,7 +1117,7 @@ f(f(f(0, 1), 2), 3) - + ``foldl()`` is roughly equivalent to the following recursive function:: def foldl(func, start, seq): @@ -1224,7 +1224,7 @@ 4) Convert the lambda to a def statement, using that name. 5) Remove the comment. -I really like these rules, but you're free to disagree +I really like these rules, but you're free to disagree about whether this lambda-free style is better. @@ -1282,7 +1282,7 @@ Text Processing". Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see +for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__, Modified: python/branches/release30-maint/Doc/howto/sockets.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/sockets.rst (original) +++ python/branches/release30-maint/Doc/howto/sockets.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -62,7 +62,7 @@ #create an INET, STREAMing socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -77,7 +77,7 @@ #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -184,7 +184,7 @@ length message:: class mysocket: - """demonstration class only + """demonstration class only - coded for clarity, not efficiency """ @@ -340,9 +340,9 @@ ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might Modified: python/branches/release30-maint/Doc/howto/urllib2.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/urllib2.rst (original) +++ python/branches/release30-maint/Doc/howto/urllib2.rst Sun Jan 4 01:04:26 2009 @@ -10,7 +10,7 @@ HOWTO, available at `urllib2 - Le Manuel manquant `_. - + Introduction ============ @@ -19,9 +19,9 @@ You may also find useful the following article on fetching web resources with Python: - + * `Basic Authentication `_ - + A tutorial on *Basic Authentication*, with examples in Python. **urllib.request** is a `Python `_ module for fetching URLs @@ -98,7 +98,7 @@ library. :: import urllib.parse - import urllib.request + import urllib.request url = 'http://www.someserver.com/cgi-bin/register.cgi' values = {'name' : 'Michael Foord', @@ -161,15 +161,15 @@ Explorer [#]_. :: import urllib.parse - import urllib.request - + import urllib.request + url = 'http://www.someserver.com/cgi-bin/register.cgi' - user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' + user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - + data = urllib.parse.urlencode(values) req = urllib.request.Request(url, data, headers) response = urllib.request.urlopen(req) @@ -183,7 +183,7 @@ =================== *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as +with Python APIs, builtin exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised). @@ -311,18 +311,18 @@ geturl, and info, methods as returned by the ``urllib.response`` module:: >>> req = urllib.request.Request('http://www.python.org/fish.html') - >>> try: + >>> try: >>> urllib.request.urlopen(req) >>> except urllib.error.URLError, e: >>> print(e.code) >>> print(e.read()) - >>> + >>> 404 - - - Error 404: File Not Found + Error 404: File Not Found ...... etc... Wrapping it Up @@ -376,7 +376,7 @@ print('Error code: ', e.code) else: # everything is fine - + info and geturl =============== @@ -448,7 +448,7 @@ and a 'realm'. The header looks like : ``Www-authenticate: SCHEME realm="REALM"``. -e.g. :: +e.g. :: Www-authenticate: Basic realm="cPanel Users" @@ -472,24 +472,24 @@ than the URL you pass to .add_password() will also match. :: # create a password manager - password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() + password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. # If we knew the realm, we could use it instead of ``None``. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) - handler = urllib.request.HTTPBasicAuthHandler(password_mgr) + handler = urllib.request.HTTPBasicAuthHandler(password_mgr) # create "opener" (OpenerDirector instance) - opener = urllib.request.build_opener(handler) + opener = urllib.request.build_opener(handler) # use the opener to fetch a URL - opener.open(a_url) + opener.open(a_url) # Install the opener. # Now all calls to urllib.request.urlopen use our opener. - urllib.request.install_opener(opener) + urllib.request.install_opener(opener) .. note:: @@ -545,7 +545,7 @@ # timeout in seconds timeout = 10 - socket.setdefaulttimeout(timeout) + socket.setdefaulttimeout(timeout) # this call to urllib.request.urlopen now uses the default timeout # we have set in the socket module @@ -562,7 +562,7 @@ This document was reviewed and revised by John Lee. .. [#] For an introduction to the CGI protocol see - `Writing Web Applications in Python `_. + `Writing Web Applications in Python `_. .. [#] Like Google for example. The *proper* way to use google from a program is to use `PyGoogle `_ of course. See `Voidspace Google `_ @@ -579,6 +579,6 @@ is set to use the proxy, which urllib picks up on. In order to test scripts with a localhost server, I have to prevent urllib from using the proxy. -.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe +.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_. - + 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 Sun Jan 4 01:04:26 2009 @@ -88,7 +88,7 @@ `_ with some additional information about CGI in Python. - + Simple script for testing CGI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -387,7 +387,7 @@ You might be interested in some WSGI-supporting modules already contained in the standard library, namely: - + * :mod:`wsgiref` -- some tiny utilities and servers for WSGI @@ -500,7 +500,7 @@ time in looking through the most popular ones. Some frameworks have their own template engine or have a recommentation for one. It's wise to use these. - + Popular template engines include: * Mako @@ -688,7 +688,7 @@ found in the Python wiki. .. seealso:: - + The Python wiki contains an extensive list of `web frameworks `_. Modified: python/branches/release30-maint/Doc/install/index.rst ============================================================================== --- python/branches/release30-maint/Doc/install/index.rst (original) +++ python/branches/release30-maint/Doc/install/index.rst Sun Jan 4 01:04:26 2009 @@ -3,7 +3,7 @@ .. _install-index: ***************************** - Installing Python Modules + Installing Python Modules ***************************** :Author: Greg Ward @@ -18,7 +18,7 @@ Thus, I have to be sure to explain the basics at some point: sys.path and PYTHONPATH at least. Should probably give pointers to other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc. - + Finally, it might be useful to include all the material from my "Care and Feeding of a Python Installation" talk in here somewhere. Yow! @@ -268,7 +268,7 @@ statements shown below, and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`:: - Python 2.4 (#26, Aug 7 2004, 17:19:02) + Python 2.4 (#26, Aug 7 2004, 17:19:02) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix @@ -587,8 +587,8 @@ Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. >>> import sys >>> sys.path - ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', - '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', + ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', + '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>> 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 Sun Jan 4 01:04:26 2009 @@ -128,7 +128,7 @@ A decorator indicating abstract methods. Using this decorator requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. @@ -163,7 +163,7 @@ A subclass of the built-in :func:`property`, indicating an abstract property. Using this function requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract properties can be called using any of the normal Modified: python/branches/release30-maint/Doc/library/aifc.rst ============================================================================== --- python/branches/release30-maint/Doc/library/aifc.rst (original) +++ python/branches/release30-maint/Doc/library/aifc.rst Sun Jan 4 01:04:26 2009 @@ -17,7 +17,7 @@ ability to compress the audio data. .. warning:: - + Some operations may only work under IRIX; these will raise :exc:`ImportError` when attempting to import the :mod:`cl` module, which is only available on IRIX. Modified: python/branches/release30-maint/Doc/library/array.rst ============================================================================== --- python/branches/release30-maint/Doc/library/array.rst (original) +++ python/branches/release30-maint/Doc/library/array.rst Sun Jan 4 01:04:26 2009 @@ -52,7 +52,7 @@ Return a new array whose items are restricted by *typecode*, and initialized from the optional *initializer* value, which must be a list, object - supporting the buffer interface, or iterable over elements of the + supporting the buffer interface, or iterable over elements of the appropriate type. If given a list or string, the initializer is passed to the new array's Modified: python/branches/release30-maint/Doc/library/ast.rst ============================================================================== --- python/branches/release30-maint/Doc/library/ast.rst (original) +++ python/branches/release30-maint/Doc/library/ast.rst Sun Jan 4 01:04:26 2009 @@ -114,7 +114,7 @@ Parse an expression into an AST node. Equivalent to ``compile(expr, filename, mode, ast.PyCF_ONLY_AST)``. - + .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python @@ -192,7 +192,7 @@ .. method:: generic_visit(node) This visitor calls :meth:`visit` on all children of the node. - + Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself. Modified: python/branches/release30-maint/Doc/library/audioop.rst ============================================================================== --- python/branches/release30-maint/Doc/library/audioop.rst (original) +++ python/branches/release30-maint/Doc/library/audioop.rst Sun Jan 4 01:04:26 2009 @@ -260,7 +260,7 @@ in_test = inputdata[pos*2:] ipos, factor = audioop.findfit(in_test, out_test) # Optional (for better cancellation): - # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], + # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) Modified: python/branches/release30-maint/Doc/library/bdb.rst ============================================================================== --- python/branches/release30-maint/Doc/library/bdb.rst (original) +++ python/branches/release30-maint/Doc/library/bdb.rst Sun Jan 4 01:04:26 2009 @@ -325,7 +325,7 @@ Check whether we should break here, depending on the way the breakpoint *b* was set. - + If it was set via line number, it checks if ``b.line`` is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if Modified: python/branches/release30-maint/Doc/library/cmath.rst ============================================================================== --- python/branches/release30-maint/Doc/library/cmath.rst (original) +++ python/branches/release30-maint/Doc/library/cmath.rst Sun Jan 4 01:04:26 2009 @@ -68,9 +68,9 @@ .. function:: polar(x) - Convert a :class:`complex` from rectangular coordinates to polar + Convert a :class:`complex` from rectangular coordinates to polar coordinates. The function returns a tuple with the two elements - *r* and *phi*. *r* is the distance from 0 and *phi* the phase + *r* and *phi*. *r* is the distance from 0 and *phi* the phase angle. Modified: python/branches/release30-maint/Doc/library/codeop.rst ============================================================================== --- python/branches/release30-maint/Doc/library/codeop.rst (original) +++ python/branches/release30-maint/Doc/library/codeop.rst Sun Jan 4 01:04:26 2009 @@ -43,7 +43,7 @@ other value will cause :exc:`ValueError` to be raised. .. warning:: - + It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, 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 Sun Jan 4 01:04:26 2009 @@ -43,34 +43,34 @@ :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` :class:`Sized` ``__len__`` :class:`Callable` ``__call__`` - + :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. :class:`Iterable`, and ``__len__`` ``index``, and ``count`` - :class:`Container` - + :class:`Container` + :class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` - + :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:`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:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, :class:`Set` ``__iter__`` @@ -526,8 +526,8 @@ if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result - - def __getnewargs__(self): + + def __getnewargs__(self): return tuple(self) x = property(itemgetter(0)) @@ -674,8 +674,8 @@ :class:`UserDict` objects ------------------------- -The class, :class:`UserDict` acts as a wrapper around dictionary objects. -The need for this class has been partially supplanted by the ability to +The class, :class:`UserDict` acts as a wrapper around dictionary objects. +The need for this class has been partially supplanted by the ability to subclass directly from :class:`dict`; however, this class can be easier to work with because the underlying dictionary is accessible as an attribute. @@ -688,7 +688,7 @@ initialized with its contents; note that a reference to *initialdata* will not be kept, allowing it be used for other purposes. -In addition to supporting the methods and operations of mappings, +In addition to supporting the methods and operations of mappings, :class:`UserDict` instances provide the following attribute: .. attribute:: UserDict.data @@ -701,11 +701,11 @@ ------------------------- This class acts as a wrapper around list objects. It is a useful base class -for your own list-like classes which can inherit from them and override +for your own list-like classes which can inherit from them and override existing methods or add new ones. In this way, one can add new behaviors to lists. -The need for this class has been partially supplanted by the ability to +The need for this class has been partially supplanted by the ability to subclass directly from :class:`list`; however, this class can be easier to work with because the underlying list is accessible as an attribute. @@ -717,12 +717,12 @@ defaulting to the empty list ``[]``. *list* can be any iterable, for example a real Python list or a :class:`UserList` object. -In addition to supporting the methods and operations of mutable sequences, +In addition to supporting the methods and operations of mutable sequences, :class:`UserList` instances provide the following attribute: .. attribute:: UserList.data - A real :class:`list` object used to store the contents of the + A real :class:`list` object used to store the contents of the :class:`UserList` class. **Subclassing requirements:** Subclasses of :class:`UserList` are expect to @@ -740,8 +740,8 @@ :class:`UserString` objects --------------------------- -The class, :class:`UserString` acts as a wrapper around string objects. -The need for this class has been partially supplanted by the ability to +The class, :class:`UserString` acts as a wrapper around string objects. +The need for this class has been partially supplanted by the ability to subclass directly from :class:`str`; however, this class can be easier to work with because the underlying string is accessible as an attribute. @@ -749,8 +749,8 @@ .. class:: UserString([sequence]) Class that simulates a string or a Unicode string object. The instance's - content is kept in a regular string object, which is accessible via the - :attr:`data` attribute of :class:`UserString` instances. The instance's + content is kept in a regular string object, which is accessible via the + :attr:`data` attribute of :class:`UserString` instances. The instance's contents are initially set to a copy of *sequence*. The *sequence* can be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a subclass) or an arbitrary sequence which can be converted into a string using Modified: python/branches/release30-maint/Doc/library/configparser.rst ============================================================================== --- python/branches/release30-maint/Doc/library/configparser.rst (original) +++ python/branches/release30-maint/Doc/library/configparser.rst Sun Jan 4 01:04:26 2009 @@ -344,7 +344,7 @@ import configparser config = configparser.RawConfigParser() - + # When adding sections or items, add them in the reverse order of # how you want them to be displayed in the actual file. # In addition, please note that using RawConfigParser's and the raw @@ -359,7 +359,7 @@ config.set('Section1', 'baz', 'fun') config.set('Section1', 'bar', 'Python') config.set('Section1', 'foo', '%(bar)s is %(baz)s!') - + # Writing our configuration file to 'example.cfg' with open('example.cfg', 'wb') as configfile: config.write(configfile) @@ -399,7 +399,7 @@ print(config.get('Section1', 'foo', 0, {'bar': 'Documentation', 'baz': 'evil'})) -Defaults are available in all three types of ConfigParsers. They are used in +Defaults are available in all three types of ConfigParsers. They are used in interpolation if an option used is not defined elsewhere. :: import configparser @@ -407,7 +407,7 @@ # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'}) config.read('example.cfg') - + print(config.get('Section1', 'foo')) # -> "Python is fun!" config.remove_option('Section1', 'bar') config.remove_option('Section1', 'baz') Modified: python/branches/release30-maint/Doc/library/constants.rst ============================================================================== --- python/branches/release30-maint/Doc/library/constants.rst (original) +++ python/branches/release30-maint/Doc/library/constants.rst Sun Jan 4 01:04:26 2009 @@ -14,13 +14,13 @@ .. data:: False - The false value of the :class:`bool` type. Assignments to ``False`` + The false value of the :class:`bool` type. Assignments to ``False`` are illegal and raise a :exc:`SyntaxError`. .. data:: True - The true value of the :class:`bool` type. Assignments to ``True`` + The true value of the :class:`bool` type. Assignments to ``True`` are illegal and raise a :exc:`SyntaxError`. Modified: python/branches/release30-maint/Doc/library/crypt.rst ============================================================================== --- python/branches/release30-maint/Doc/library/crypt.rst (original) +++ python/branches/release30-maint/Doc/library/crypt.rst Sun Jan 4 01:04:26 2009 @@ -51,7 +51,7 @@ username = input('Python login:') cryptedpasswd = pwd.getpwnam(username)[1] if cryptedpasswd: - if cryptedpasswd == 'x' or cryptedpasswd == '*': + if cryptedpasswd == 'x' or cryptedpasswd == '*': raise "Sorry, currently no support for shadow passwords" cleartext = getpass.getpass() return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd Modified: python/branches/release30-maint/Doc/library/csv.rst ============================================================================== --- python/branches/release30-maint/Doc/library/csv.rst (original) +++ python/branches/release30-maint/Doc/library/csv.rst Sun Jan 4 01:04:26 2009 @@ -82,7 +82,7 @@ be split into lines in a manner which preserves the newline characters. A short usage example:: - + >>> import csv >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|') >>> for row in spamReader: Modified: python/branches/release30-maint/Doc/library/datetime.rst ============================================================================== --- python/branches/release30-maint/Doc/library/datetime.rst (original) +++ python/branches/release30-maint/Doc/library/datetime.rst Sun Jan 4 01:04:26 2009 @@ -264,10 +264,10 @@ considered to be true if and only if it isn't equal to ``timedelta(0)``. Example usage: - + >>> from datetime import timedelta >>> year = timedelta(days=365) - >>> another_year = timedelta(weeks=40, days=84, hours=23, + >>> another_year = timedelta(weeks=40, days=84, hours=23, ... minutes=50, seconds=600) # adds up to 365 days >>> year == another_year True @@ -515,10 +515,10 @@ True >>> my_birthday = date(today.year, 6, 24) >>> if my_birthday < today: - ... my_birthday = my_birthday.replace(year=today.year + 1) + ... my_birthday = my_birthday.replace(year=today.year + 1) >>> my_birthday datetime.date(2008, 6, 24) - >>> time_to_birthday = abs(my_birthday - today) + >>> time_to_birthday = abs(my_birthday - today) >>> time_to_birthday.days 202 @@ -1012,7 +1012,7 @@ >>> tt = dt.timetuple() >>> for it in tt: # doctest: +SKIP ... print(it) - ... + ... 2006 # year 11 # month 21 # day @@ -1041,23 +1041,23 @@ ... def __init__(self): # DST starts last Sunday in March ... d = datetime(dt.year, 4, 1) # ends last Sunday in October ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) - ... def dst(self, dt): + ... def dst(self, dt): ... if self.dston <= dt.replace(tzinfo=None) < self.dstoff: ... return timedelta(hours=1) ... else: ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +1" - ... + ... >>> class GMT2(tzinfo): ... def __init__(self): - ... d = datetime(dt.year, 4, 1) + ... d = datetime(dt.year, 4, 1) ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) @@ -1068,7 +1068,7 @@ ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +2" - ... + ... >>> gmt1 = GMT1() >>> # Daylight Saving Time >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1) @@ -1089,7 +1089,7 @@ datetime.datetime(2006, 6, 14, 13, 0, tzinfo=) >>> dt2.utctimetuple() == dt3.utctimetuple() True - + .. _datetime-time: @@ -1237,12 +1237,12 @@ return ``None`` or a string object. Example: - + >>> from datetime import time, tzinfo >>> class GMT1(tzinfo): ... def utcoffset(self, dt): - ... return timedelta(hours=1) - ... def dst(self, dt): + ... return timedelta(hours=1) + ... def dst(self, dt): ... return timedelta(0) ... def tzname(self,dt): ... return "Europe/Prague" @@ -1473,7 +1473,7 @@ :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any other fixed-offset :class:`tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)). - + .. _strftime-behavior: @@ -1516,7 +1516,7 @@ The full set of format codes supported varies across platforms, because Python calls the platform C library's :func:`strftime` function, and platform -variations are common. +variations are common. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C Modified: python/branches/release30-maint/Doc/library/decimal.rst ============================================================================== --- python/branches/release30-maint/Doc/library/decimal.rst (original) +++ python/branches/release30-maint/Doc/library/decimal.rst Sun Jan 4 01:04:26 2009 @@ -323,7 +323,7 @@ infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity - numeric-string ::= [sign] numeric-value | [sign] nan + numeric-string ::= [sign] numeric-value | [sign] nan If *value* is a :class:`tuple`, it should have three components, a sign (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of @@ -852,7 +852,7 @@ * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer), * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or * :const:`ROUND_UP` (away from zero). - * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero + * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise towards zero) The *traps* and *flags* fields list any signals to be set. Generally, new @@ -1312,7 +1312,7 @@ sqrt(-x) and x > 0 0 ** 0 x ** (non-integer) - x ** Infinity + x ** Infinity .. class:: Overflow @@ -1415,7 +1415,7 @@ Decimal('9.51111111') >>> u + (v + w) Decimal('9.51111111') - >>> + >>> >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003') >>> (u*v) + (u*w) Decimal('0.0060000') @@ -1554,7 +1554,7 @@ """ q = Decimal(10) ** -places # 2 places --> '0.01' - sign, digits, exp = value.quantize(q).as_tuple() + sign, digits, exp = value.quantize(q).as_tuple() result = [] digits = list(map(str, digits)) build, next = result.append, digits.pop @@ -1611,12 +1611,12 @@ getcontext().prec += 2 i, lasts, s, fact, num = 0, 0, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 1 fact *= i - num *= x - s += num / fact - getcontext().prec -= 2 + num *= x + s += num / fact + getcontext().prec -= 2 return +s def cos(x): @@ -1633,13 +1633,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s def sin(x): @@ -1656,13 +1656,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s @@ -1696,7 +1696,7 @@ >>> Decimal('3.214').quantize(TWOPLACES) Decimal('3.21') - >>> # Validate that a number does not exceed two places + >>> # Validate that a number does not exceed two places >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact])) Decimal('3.21') Modified: python/branches/release30-maint/Doc/library/dis.rst ============================================================================== --- python/branches/release30-maint/Doc/library/dis.rst (original) +++ python/branches/release30-maint/Doc/library/dis.rst Sun Jan 4 01:04:26 2009 @@ -79,8 +79,8 @@ Detect all offsets in the code object *code* which are jump targets, and return a list of these offsets. - - + + .. data:: opname Sequence of operation names, indexable using the bytecode. @@ -491,7 +491,7 @@ The low byte of *counts* is the number of values before the list value, the high byte of *counts* the number of values after it. The resulting values are put onto the stack right-to-left. - + .. opcode:: DUP_TOPX (count) @@ -690,7 +690,7 @@ opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, - the function object to call is on the stack. Pops all function arguments, and + the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value. Modified: python/branches/release30-maint/Doc/library/email.mime.rst ============================================================================== --- python/branches/release30-maint/Doc/library/email.mime.rst (original) +++ python/branches/release30-maint/Doc/library/email.mime.rst Sun Jan 4 01:04:26 2009 @@ -2,7 +2,7 @@ ---------------------------------------------------------- .. module:: email.mime - :synopsis: Build MIME messages. + :synopsis: Build MIME messages. Ordinarily, you get a message object structure by passing a file or some text to Modified: python/branches/release30-maint/Doc/library/fileinput.rst ============================================================================== --- python/branches/release30-maint/Doc/library/fileinput.rst (original) +++ python/branches/release30-maint/Doc/library/fileinput.rst Sun Jan 4 01:04:26 2009 @@ -145,7 +145,7 @@ when standard input is read. .. warning:: - + The current implementation does not work for MS-DOS 8+3 filesystems. 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 Sun Jan 4 01:04:26 2009 @@ -95,7 +95,7 @@ the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :class:`bytearray` -- it has the same non-mutating methods and the same indexing and slicing behavior. - + Accordingly, constructor arguments are interpreted as for :func:`buffer`. Bytes objects can also be created with literals, see :ref:`strings`. @@ -271,7 +271,7 @@ Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed - operand types, the rules for binary arithmetic operators apply. For integers, + operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as ``(a // b, a % b)``. For floating point numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very close to @@ -411,12 +411,12 @@ .. index:: 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`. - + .. note:: ``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``. @@ -573,7 +573,7 @@ returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, returns a new empty list, ``[]``. - :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. + :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. .. function:: locals() @@ -654,7 +654,7 @@ .. function:: open(file[, mode='r'[, buffering=None[, encoding=None[, errors=None[, newline=None[, closefd=True]]]]]]) Open a file. If the file cannot be opened, :exc:`IOError` is raised. - + *file* is either a string or bytes object 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 @@ -699,7 +699,7 @@ *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 @@ -991,7 +991,7 @@ .. function:: str([object[, encoding[, errors]]]) Return a string version of an object, using one of the following modes: - + If *encoding* and/or *errors* are given, :func:`str` will decode the *object* which can either be a byte string or a character buffer using the codec for *encoding*. The *encoding* parameter is a string giving @@ -1002,7 +1002,7 @@ errors, while a value of ``'ignore'`` causes errors to be silently ignored, and a value of ``'replace'`` causes the official Unicode replacement character, U+FFFD, to be used to replace input characters which cannot be decoded. - See also the :mod:`codecs` module. + See also the :mod:`codecs` module. When only *object* is given, this returns its nicely printable representation. For strings, this is the string itself. The difference with ``repr(object)`` @@ -1042,10 +1042,10 @@ single inheritance, :func:`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. - + The second use case is to support cooperative multiple inheritence 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 + 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 @@ -1080,7 +1080,7 @@ 3])`` returns ``(1, 2, 3)``. If no argument is given, returns a new empty tuple, ``()``. - :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. + :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. .. function:: type(object) @@ -1110,7 +1110,7 @@ >>> class X(object): ... a = 1 - ... + ... >>> X = type('X', (object,), dict(a=1)) @@ -1125,12 +1125,12 @@ .. function:: zip(*iterables) - Make an iterator that aggregates elements from each of the iterables. + Make an iterator that aggregates elements from each of the iterables. Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th element from each of the argument sequences or iterables. The iterator stops when the shortest input iterable is exhausted. With a single - iterable argument, it returns an iterator of 1-tuples. With no arguments, + iterable argument, it returns an iterator of 1-tuples. With no arguments, it returns an empty iterator. Equivalent to:: def zip(*iterables): @@ -1199,7 +1199,7 @@ For example, the statement ``import spam`` results in bytecode resembling the following code:: - + spam = __import__('spam', globals(), locals(), [], -1) The statement ``import spam.ham`` results in this call:: Modified: python/branches/release30-maint/Doc/library/gettext.rst ============================================================================== --- python/branches/release30-maint/Doc/library/gettext.rst (original) +++ python/branches/release30-maint/Doc/library/gettext.rst Sun Jan 4 01:04:26 2009 @@ -369,7 +369,7 @@ If the message id is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's :meth:`ngettext` method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is returned in all other cases. - + Here is an example:: n = len(os.listdir('.')) Modified: python/branches/release30-maint/Doc/library/heapq.rst ============================================================================== --- python/branches/release30-maint/Doc/library/heapq.rst (original) +++ python/branches/release30-maint/Doc/library/heapq.rst Sun Jan 4 01:04:26 2009 @@ -100,7 +100,7 @@ H N - + The module also offers three general purpose functions based on heaps. Modified: python/branches/release30-maint/Doc/library/idle.rst ============================================================================== --- python/branches/release30-maint/Doc/library/idle.rst (original) +++ python/branches/release30-maint/Doc/library/idle.rst Sun Jan 4 01:04:26 2009 @@ -230,7 +230,7 @@ Keywords orange - Strings + Strings green Comments Modified: python/branches/release30-maint/Doc/library/inspect.rst ============================================================================== --- python/branches/release30-maint/Doc/library/inspect.rst (original) +++ python/branches/release30-maint/Doc/library/inspect.rst Sun Jan 4 01:04:26 2009 @@ -384,7 +384,7 @@ .. function:: getargspec(func) - Get the names and default values of a function's arguments. A + Get the names and default values of a function's arguments. A :term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is returned. *args* is a list of the argument names. *varargs* and *varkw* are the names of the ``*`` and @@ -416,7 +416,7 @@ .. function:: getargvalues(frame) - Get information about arguments passed into a particular frame. A :term:`named tuple` + Get information about arguments passed into a particular frame. A :term:`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. *args* is a list of the argument names (it may contain nested lists). *varargs* and *varkw* are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals @@ -484,7 +484,7 @@ .. function:: getframeinfo(frame[, context]) - Get information about a frame or traceback object. A :term:`named tuple` + Get information about a frame or traceback object. A :term:`named tuple` ``Traceback(filename, lineno, function, code_context, index)`` is returned. Modified: python/branches/release30-maint/Doc/library/io.rst ============================================================================== --- python/branches/release30-maint/Doc/library/io.rst (original) +++ python/branches/release30-maint/Doc/library/io.rst Sun Jan 4 01:04:26 2009 @@ -214,7 +214,7 @@ .. method:: close() Flush and close this stream. This method has no effect if the file is - already closed. Once the file is closed, any operation on the file + already closed. Once the file is closed, any operation on the file (e.g. reading or writing) will raise an :exc:`IOError`. The internal file descriptor isn't closed if *closefd* was False. @@ -628,7 +628,7 @@ .. attribute:: line_buffering Whether line buffering is enabled. - + .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) @@ -659,7 +659,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() 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 Sun Jan 4 01:04:26 2009 @@ -74,7 +74,7 @@ .. function:: itertools.chain.from_iterable(iterable) - Alternate constructor for :func:`chain`. Gets chained inputs from a + Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Equivalent to:: @classmethod @@ -89,9 +89,9 @@ Return *r* length subsequences of elements from the input *iterable*. - Combinations are emitted in lexicographic sort order. So, if the + Combinations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the combination tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -306,12 +306,12 @@ Return successive *r* length permutations of elements in the *iterable*. If *r* is not specified or is ``None``, then *r* defaults to the length - of the *iterable* and all possible full-length permutations + of the *iterable* and all possible full-length permutations are generated. - Permutations are emitted in lexicographic sort order. So, if the + Permutations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the permutation tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -342,7 +342,7 @@ else: return - The code for :func:`permutations` can be also expressed as a subsequence of + The code for :func:`permutations` can be also expressed as a subsequence of :func:`product`, filtered to exclude entries with repeated elements (those from the same position in the input pool):: @@ -483,7 +483,7 @@ >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]): ... print(map(operator.itemgetter(1), g)) - ... + ... [1] [4, 5, 6] [10] @@ -610,7 +610,7 @@ 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 + # unique_everseen('ABBCcAD', str.lower) --> A B C D seen = set() seen_add = seen.add if key is None: Modified: python/branches/release30-maint/Doc/library/json.rst ============================================================================== --- python/branches/release30-maint/Doc/library/json.rst (original) +++ python/branches/release30-maint/Doc/library/json.rst Sun Jan 4 01:04:26 2009 @@ -13,7 +13,7 @@ :mod:`marshal` and :mod:`pickle` modules. Encoding basic Python object hierarchies:: - + >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' @@ -42,12 +42,12 @@ >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { - "4": 5, + "4": 5, "6": 7 } Decoding JSON:: - + >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] @@ -74,7 +74,7 @@ Decimal('1.1') Extending :class:`JSONEncoder`:: - + >>> import json >>> class ComplexEncoder(json.JSONEncoder): ... def default(self, obj): @@ -88,12 +88,12 @@ '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[', '2.0', ', ', '1.0', ']'] - + .. highlight:: none Using json.tool from the shell to validate and pretty-print:: - + $ echo '{"json":"obj"}' | python -mjson.tool { "json": "obj" @@ -103,7 +103,7 @@ .. highlight:: python -.. note:: +.. note:: The JSON produced by this module's default settings is a subset of YAML, so it may be used as a serializer for that as well. @@ -367,7 +367,7 @@ For example, to support arbitrary iterators, you could implement default like this:: - + def default(self, o): try: iterable = iter(o) @@ -391,6 +391,6 @@ Encode the given object, *o*, and yield each string representation as available. For example:: - + for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) 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 Jan 4 01:04:26 2009 @@ -474,7 +474,7 @@ >>> import locale >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale Modified: python/branches/release30-maint/Doc/library/mailbox.rst ============================================================================== --- python/branches/release30-maint/Doc/library/mailbox.rst (original) +++ python/branches/release30-maint/Doc/library/mailbox.rst Sun Jan 4 01:04:26 2009 @@ -1553,7 +1553,7 @@ # that's better than losing a message completely. box.lock() box.add(message) - box.flush() + box.flush() box.unlock() # Remove original message 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 Sun Jan 4 01:04:26 2009 @@ -98,7 +98,7 @@ .. function:: isnan(x) Checks if the float *x* is a NaN (not a number). NaNs are part of the - IEEE 754 standards. Operation like but not limited to ``inf * 0``, + IEEE 754 standards. Operation like but not limited to ``inf * 0``, ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return a NaN. Modified: python/branches/release30-maint/Doc/library/mmap.rst ============================================================================== --- python/branches/release30-maint/Doc/library/mmap.rst (original) +++ python/branches/release30-maint/Doc/library/mmap.rst Sun Jan 4 01:04:26 2009 @@ -87,7 +87,7 @@ will be relative to the offset from the beginning of the file. *offset* defaults to 0. *offset* must be a multiple of the PAGESIZE or ALLOCATIONGRANULARITY. - + This example shows a simple way of using :class:`mmap`:: import mmap Modified: python/branches/release30-maint/Doc/library/msvcrt.rst ============================================================================== --- python/branches/release30-maint/Doc/library/msvcrt.rst (original) +++ python/branches/release30-maint/Doc/library/msvcrt.rst Sun Jan 4 01:04:26 2009 @@ -18,7 +18,7 @@ The module implements both the normal and wide char variants of the console I/O api. The normal API deals only with ASCII characters and is of limited use -for internationalized applications. The wide char API should be used where +for internationalized applications. The wide char API should be used where ever possible .. _msvcrt-files: @@ -98,11 +98,11 @@ return the keycode. The :kbd:`Control-C` keypress cannot be read with this function. - + .. function:: getwch() Wide char variant of :func:`getch`, returning a Unicode value. - + .. function:: getche() @@ -113,28 +113,28 @@ .. function:: getwche() Wide char variant of :func:`getche`, returning a Unicode value. - + .. function:: putch(char) Print the character *char* to the console without buffering. - + .. function:: putwch(unicode_char) Wide char variant of :func:`putch`, accepting a Unicode value. - + .. function:: ungetch(char) Cause the character *char* to be "pushed back" into the console buffer; it will be the next character read by :func:`getch` or :func:`getche`. - + .. function:: ungetwch(unicode_char) Wide char variant of :func:`ungetch`, accepting a Unicode value. - + .. _msvcrt-other: Modified: python/branches/release30-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release30-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release30-maint/Doc/library/multiprocessing.rst Sun Jan 4 01:04:26 2009 @@ -19,9 +19,9 @@ .. warning:: Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See :issue:`3770` for additional information. .. note:: @@ -36,7 +36,7 @@ >>> p = Pool(5) >>> def f(x): ... return x*x - ... + ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: @@ -75,11 +75,11 @@ print 'module name:', __name__ print 'parent process:', os.getppid() print 'process id:', os.getpid() - + def f(name): info('function f') print 'hello', name - + if __name__ == '__main__': info('main line') p = Process(target=f, args=('bob',)) @@ -541,7 +541,7 @@ .. method:: put(item[, block[, timeout]]) - Put item into the queue. If the optional argument *block* is ``True`` + Put item into the queue. If the optional argument *block* is ``True`` (the default) and *timeout* is ``None`` (the default), block if necessary until a free slot is available. If *timeout* is a positive number, it blocks at most *timeout* seconds and raises the :exc:`queue.Full` exception if no @@ -856,7 +856,7 @@ acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it specifies a timeout in seconds. If *block* is ``False`` then *timeout* is ignored. - + Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments for these will be ignored. @@ -1133,22 +1133,22 @@ server process which is using the given address and authentication key. .. method:: get_server() - + Returns a :class:`Server` object which represents the actual server under - the control of the Manager. The :class:`Server` object supports the + the control of the Manager. The :class:`Server` object supports the :meth:`serve_forever` method:: - + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address=('', 50000), authkey='abc')) >>> server = m.get_server() >>> s.serve_forever() - + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - + Connect a local manager object to a remote manager process:: - + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) >>> m.connect() @@ -1358,7 +1358,7 @@ >>> queue.get() 'hello' -Local processes can also access that queue, using the code from above on the +Local processes can also access that queue, using the code from above on the client to access it remotely:: >>> from multiprocessing import Process, Queue @@ -1369,12 +1369,12 @@ ... super(Worker, self).__init__() ... def run(self): ... self.q.put('local hello') - ... + ... >>> queue = Queue() >>> w = Worker(queue) >>> w.start() >>> class QueueManager(BaseManager): pass - ... + ... >>> QueueManager.register('get_queue', callable=lambda: queue) >>> m = QueueManager(address=('', 50000), authkey='abracadabra') >>> s = m.get_server() @@ -2118,7 +2118,7 @@ .. literalinclude:: ../includes/mp_benchmarks.py An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process` -and others to build a system which can distribute processes and work via a +and others to build a system which can distribute processes and work via a distributed queue to a "cluster" of machines on a network, accessible via SSH. You will need to have private key authentication for all hosts configured for this to work. Modified: python/branches/release30-maint/Doc/library/nntplib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/nntplib.rst (original) +++ python/branches/release30-maint/Doc/library/nntplib.rst Sun Jan 4 01:04:26 2009 @@ -24,16 +24,16 @@ Group comp.lang.python has 59 articles, range 3742 to 3803 >>> resp, subs = s.xhdr('subject', first + '-' + last) >>> for id, sub in subs[-10:]: print(id, sub) - ... + ... 3792 Re: Removing elements from a list while iterating... 3793 Re: Who likes Info files? 3794 Emacs and doc strings 3795 a few questions about the Mac implementation 3796 Re: executable python scripts 3797 Re: executable python scripts - 3798 Re: a few questions about the Mac implementation + 3798 Re: a few questions about the Mac implementation 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules - 3802 Re: executable python scripts + 3802 Re: executable python scripts 3803 Re: \POSIX{} wait and SIGCHLD >>> s.quit() '205 news.cwi.nl closing connection. Goodbye.' 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 Jan 4 01:04:26 2009 @@ -7,7 +7,7 @@ .. testsetup:: - + import operator from operator import itemgetter @@ -209,7 +209,7 @@ Remove the value of *a* at index *b*. - + .. function:: getitem(a, b) __getitem__(a, b) @@ -337,7 +337,7 @@ >>> class C: ... pass - ... + ... >>> import operator >>> obj = C() >>> operator.isMappingType(obj) @@ -427,9 +427,9 @@ def g(obj): return tuple(obj[item] for item in items) return g - - The items can be any type accepted by the operand's :meth:`__getitem__` - method. Dictionaries accept any hashable value. Lists, tuples, and + + The items can be any type accepted by the operand's :meth:`__getitem__` + method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice: >>> itemgetter(1)('ABCDEFG') 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 Sun Jan 4 01:04:26 2009 @@ -794,7 +794,7 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an +attributes, or fail to pass required ones, :mod:`optparse` raises an :exc:`OptionError` exception explaining your mistake. An option's *action* determines what :mod:`optparse` does when it encounters Modified: python/branches/release30-maint/Doc/library/os.rst ============================================================================== --- python/branches/release30-maint/Doc/library/os.rst (original) +++ python/branches/release30-maint/Doc/library/os.rst Sun Jan 4 01:04:26 2009 @@ -1226,7 +1226,7 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered @@ -1258,7 +1258,7 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. + inherit the environment of the current process. Availability: Unix, Windows. @@ -1456,7 +1456,7 @@ (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is - preferable to using these functions. Check specially the *Replacing Older + preferable to using these functions. Check specially the *Replacing Older Functions with the subprocess Module* section in that documentation page.) If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new Modified: python/branches/release30-maint/Doc/library/ossaudiodev.rst ============================================================================== --- python/branches/release30-maint/Doc/library/ossaudiodev.rst (original) +++ python/branches/release30-maint/Doc/library/ossaudiodev.rst Sun Jan 4 01:04:26 2009 @@ -16,26 +16,26 @@ use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast majority of Linux audio apps anyways. - + Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: - + > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial > OSS installation manual tells you to remove references to OSS/Free from the > kernel :) - + but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes from its : > * WARNING! WARNING! > * This is an OSS (Linux) audio emulator. > * Use the Native NetBSD API for developing new code, and this > * only for compiling Linux programs. - + There's also an ossaudio manpage on OpenBSD that explains things further. Presumably NetBSD and OpenBSD have a different standard audio interface. That's the great thing about standards, there are so many to choose from ... ;-) - + This probably all warrants a footnote or two, but I don't understand things well enough right now to write it! --GPW Modified: python/branches/release30-maint/Doc/library/othergui.rst ============================================================================== --- python/branches/release30-maint/Doc/library/othergui.rst (original) +++ python/branches/release30-maint/Doc/library/othergui.rst Sun Jan 4 01:04:26 2009 @@ -70,7 +70,7 @@ Robin Dunn. PyGTK, PyQt, and wxPython, all have a modern look and feel and more -widgets than Tkinter. In addition, there are many other GUI toolkits for +widgets than Tkinter. In addition, there are many other GUI toolkits for Python, both cross-platform, and platform-specific. See the `GUI Programming `_ page in the Python Wiki for a much more complete list, and also for links to documents where the Modified: python/branches/release30-maint/Doc/library/pdb.rst ============================================================================== --- python/branches/release30-maint/Doc/library/pdb.rst (original) +++ python/branches/release30-maint/Doc/library/pdb.rst Sun Jan 4 01:04:26 2009 @@ -37,7 +37,7 @@ (Pdb) continue NameError: 'spam' > (1)?() - (Pdb) + (Pdb) :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -65,7 +65,7 @@ >>> pdb.pm() > ./mymodule.py(3)test2() -> print(spam) - (Pdb) + (Pdb) The module defines the following functions; each enters the debugger in a slightly different way: @@ -105,7 +105,7 @@ .. function:: post_mortem([traceback]) - Enter post-mortem debugging of the given *traceback* object. If no + Enter post-mortem debugging of the given *traceback* object. If no *traceback* is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used). Modified: python/branches/release30-maint/Doc/library/pickle.rst ============================================================================== --- python/branches/release30-maint/Doc/library/pickle.rst (original) +++ python/branches/release30-maint/Doc/library/pickle.rst Sun Jan 4 01:04:26 2009 @@ -478,7 +478,7 @@ fact, these methods are part of the copy protocol which implements the :meth:`__reduce__` special method. The copy protocol provides a unified interface for retrieving the data necessary for pickling and copying -objects. [#]_ +objects. [#]_ Although powerful, implementing :meth:`__reduce__` directly in your classes is error prone. For this reason, class designers should use the high-level @@ -715,7 +715,7 @@ .. XXX Add note about how extension codes could evade our protection - mechanism (e.g. cached classes do not invokes find_class()). + mechanism (e.g. cached classes do not invokes find_class()). As our examples shows, you have to be careful with what you allow to be unpickled. Therefore if security is a concern, you may want to consider Modified: python/branches/release30-maint/Doc/library/profile.rst ============================================================================== --- python/branches/release30-maint/Doc/library/profile.rst (original) +++ python/branches/release30-maint/Doc/library/profile.rst Sun Jan 4 01:04:26 2009 @@ -51,15 +51,15 @@ The Python standard library provides two different profilers: -#. :mod:`cProfile` is recommended for most users; it's a C extension +#. :mod:`cProfile` is recommended for most users; it's a C extension with reasonable overhead - that makes it suitable for profiling long-running programs. + that makes it suitable for profiling long-running programs. Based on :mod:`lsprof`, - contributed by Brett Rosen and Ted Czotter. + contributed by Brett Rosen and Ted Czotter. #. :mod:`profile`, a pure Python module whose interface is imitated by - :mod:`cProfile`. Adds significant overhead to profiled programs. - If you're trying to extend + :mod:`cProfile`. Adds significant overhead to profiled programs. + If you're trying to extend the profiler in some way, the task might be easier with this module. Copyright ? 1994, by InfoSeek Corporation. @@ -260,24 +260,24 @@ that the text string in the far right column was used to sort the output. The column headings include: - ncalls + ncalls for the number of calls, - tottime + tottime for the total time spent in the given function (and excluding time made in calls to sub-functions), - percall + percall is the quotient of ``tottime`` divided by ``ncalls`` - cumtime + cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate *even* for recursive functions. - percall + percall is the quotient of ``cumtime`` divided by primitive calls - filename:lineno(function) + filename:lineno(function) provides the respective data of each function When there are two numbers in the first column (for example, ``43/3``), then the Modified: python/branches/release30-maint/Doc/library/pyexpat.rst ============================================================================== --- python/branches/release30-maint/Doc/library/pyexpat.rst (original) +++ python/branches/release30-maint/Doc/library/pyexpat.rst Sun Jan 4 01:04:26 2009 @@ -177,9 +177,9 @@ .. attribute:: xmlparser.buffer_size - The size of the buffer used when :attr:`buffer_text` is true. - A new buffer size can be set by assigning a new integer value - to this attribute. + The size of the buffer used when :attr:`buffer_text` is true. + A new buffer size can be set by assigning a new integer value + to this attribute. When the size is changed, the buffer will be flushed. Modified: python/branches/release30-maint/Doc/library/queue.rst ============================================================================== --- python/branches/release30-maint/Doc/library/queue.rst (original) +++ python/branches/release30-maint/Doc/library/queue.rst Sun Jan 4 01:04:26 2009 @@ -68,7 +68,7 @@ ------------- Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`) -provide the public methods described below. +provide the public methods described below. .. method:: Queue.qsize() @@ -138,20 +138,20 @@ Example of how to wait for enqueued tasks to be completed:: - def worker(): - while True: - item = q.get() - do_work(item) - q.task_done() + def worker(): + while True: + item = q.get() + do_work(item) + q.task_done() - q = Queue() - for i in range(num_worker_threads): + q = Queue() + for i in range(num_worker_threads): t = Thread(target=worker) t.set_daemon(True) - t.start() + t.start() for item in source(): - q.put(item) + q.put(item) q.join() # block until all tasks are done Modified: python/branches/release30-maint/Doc/library/re.rst ============================================================================== --- python/branches/release30-maint/Doc/library/re.rst (original) +++ python/branches/release30-maint/Doc/library/re.rst Sun Jan 4 01:04:26 2009 @@ -221,7 +221,7 @@ ``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters set the corresponding flags: :const:`re.a` (ASCII-only matching), :const:`re.I` (ignore case), :const:`re.L` (locale dependent), - :const:`re.M` (multi-line), :const:`re.S` (dot matches all), + :const:`re.M` (multi-line), :const:`re.S` (dot matches all), and :const:`re.X` (verbose), for the entire regular expression. (The flags are described in :ref:`contents-of-module-re`.) This is useful if you wish to include the flags as part of the regular @@ -487,7 +487,7 @@ counterpart ``(?u)``), but these are redundant in Python 3.0 since matches are Unicode by default for strings (and Unicode matching isn't allowed for bytes). - + .. data:: I IGNORECASE @@ -1011,14 +1011,14 @@ >>> pair.match("717ak").group(1) '7' - + # Error because re.match() returns None, which doesn't have a group() method: >>> pair.match("718ak").group(1) Traceback (most recent call last): File "", line 1, in re.match(r".*(.).*\1", "718ak").group(1) AttributeError: 'NoneType' object has no attribute 'group' - + >>> pair.match("354aa").group(1) 'a' @@ -1127,7 +1127,7 @@ Making a Phonebook ^^^^^^^^^^^^^^^^^^ -:func:`split` splits a string into a list delimited by the passed pattern. The +:func:`split` splits a string into a list delimited by the passed pattern. The method is invaluable for converting textual data into data structures that can be easily read and modified by Python as demonstrated in the following example that creates a phonebook. @@ -1136,7 +1136,7 @@ triple-quoted string syntax: >>> input = """Ross McFluff: 834.345.1254 155 Elm Street - ... + ... ... Ronald Heathmore: 892.345.3428 436 Finley Avenue ... Frank Burger: 925.541.7625 662 South Dogwood Way ... Modified: python/branches/release30-maint/Doc/library/rlcompleter.rst ============================================================================== --- python/branches/release30-maint/Doc/library/rlcompleter.rst (original) +++ python/branches/release30-maint/Doc/library/rlcompleter.rst Sun Jan 4 01:04:26 2009 @@ -61,6 +61,6 @@ If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`__getattr__`) up to the last part, and find matches for the rest via the - :func:`dir` function. Any exception raised during the evaluation of the + :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned. Modified: python/branches/release30-maint/Doc/library/sched.rst ============================================================================== --- python/branches/release30-maint/Doc/library/sched.rst (original) +++ python/branches/release30-maint/Doc/library/sched.rst Sun Jan 4 01:04:26 2009 @@ -42,7 +42,7 @@ 930343700.276 In multi-threaded environments, the :class:`scheduler` class has limitations -with respect to thread-safety, inability to insert a new task before +with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the :class:`threading.Timer` class instead. Modified: python/branches/release30-maint/Doc/library/shutil.rst ============================================================================== --- python/branches/release30-maint/Doc/library/shutil.rst (original) +++ python/branches/release30-maint/Doc/library/shutil.rst Sun Jan 4 01:04:26 2009 @@ -20,7 +20,7 @@ Even the higher-level file copying functions (:func:`copy`, :func:`copy2`) can't copy all file metadata. - + On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will Modified: python/branches/release30-maint/Doc/library/signal.rst ============================================================================== --- python/branches/release30-maint/Doc/library/signal.rst (original) +++ python/branches/release30-maint/Doc/library/signal.rst Sun Jan 4 01:04:26 2009 @@ -39,12 +39,12 @@ * Some care must be taken if both signals and threads are used in the same program. The fundamental thing to remember in using signals and threads simultaneously is: always perform :func:`signal` operations in the main thread - of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, - :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread - can set a new signal handler, and the main thread will be the only one to - receive signals (this is enforced by the Python :mod:`signal` module, even - if the underlying thread implementation supports sending signals to - individual threads). This means that signals can't be used as a means of + of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, + :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread + can set a new signal handler, and the main thread will be the only one to + receive signals (this is enforced by the Python :mod:`signal` module, even + if the underlying thread implementation supports sending signals to + individual threads). This means that signals can't be used as a means of inter-thread communication. Use locks instead. The variables defined in the :mod:`signal` module are: @@ -80,22 +80,22 @@ One more than the number of the highest signal number. -.. data:: ITIMER_REAL +.. data:: ITIMER_REAL Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration. -.. data:: ITIMER_VIRTUAL +.. data:: ITIMER_VIRTUAL - Decrements interval timer only when the process is executing, and delivers + Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration. .. data:: ITIMER_PROF - - Decrements interval timer both when the process executes and when the - system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, - this timer is usually used to profile the time spent by the application + + Decrements interval timer both when the process executes and when the + system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, + this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration. @@ -105,7 +105,7 @@ Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid - interval timer or a negative time is passed to :func:`setitimer`. + interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`IOError`. @@ -143,21 +143,21 @@ .. function:: setitimer(which, seconds[, interval]) - Sets given interval timer (one of :const:`signal.ITIMER_REAL`, + Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified - by *which* to fire after *seconds* (float is accepted, different from + by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds. The interval timer specified by *which* can be cleared by setting seconds to zero. When an interval timer fires, a signal is sent to the process. - The signal sent is dependent on the timer being used; - :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, + The signal sent is dependent on the timer being used; + :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`. The old values are returned as a tuple: (delay, interval). - Attempting to pass an invalid interval timer will cause a + Attempting to pass an invalid interval timer will cause a :exc:`ItimerError`. @@ -186,7 +186,7 @@ will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing. Availability: Unix (see the man page :manpage:`siginterrupt(3)` for further information). - + Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag* value for the given signal. @@ -233,7 +233,7 @@ signal.alarm(5) # This open() may hang indefinitely - fd = os.open('/dev/ttyS0', os.O_RDWR) + fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm Modified: python/branches/release30-maint/Doc/library/smtplib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/smtplib.rst (original) +++ python/branches/release30-maint/Doc/library/smtplib.rst Sun Jan 4 01:04:26 2009 @@ -182,9 +182,9 @@ Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the - response for ESMTP option and store them for use by :meth:`has_extn`. - Also sets several informational attributes: the message returned by - the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` + response for ESMTP option and store them for use by :meth:`has_extn`. + Also sets several informational attributes: the message returned by + the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to true or false depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their Modified: python/branches/release30-maint/Doc/library/socket.rst ============================================================================== --- python/branches/release30-maint/Doc/library/socket.rst (original) +++ python/branches/release30-maint/Doc/library/socket.rst Sun Jan 4 01:04:26 2009 @@ -178,10 +178,10 @@ .. data:: SIO_* RCVALL_* - + Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`ioctl` method of socket objects. - + .. data:: TIPC_* @@ -210,7 +210,7 @@ all the necessary arguments for creating the corresponding socket. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. - The rest of the arguments are optional and must be numeric if specified. + The rest of the arguments are optional and must be numeric if specified. By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following @@ -544,14 +544,14 @@ contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as byte strings). - + .. method:: socket.ioctl(control, option) - :platform: Windows - + :platform: Windows + The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the MSDN documentation for more information. - + .. method:: socket.listen(backlog) @@ -851,7 +851,7 @@ s.close() print('Received', repr(data)) - + The last example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface:: @@ -860,19 +860,19 @@ # the public network interface HOST = socket.gethostbyname(socket.gethostname()) - + # create a raw socket and bind it to the public interface s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) s.bind((HOST, 0)) - + # Include IP headers s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) - + # receive all packages s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) - + # receive a package print(s.recvfrom(65565)) - + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) Modified: python/branches/release30-maint/Doc/library/sqlite3.rst ============================================================================== --- python/branches/release30-maint/Doc/library/sqlite3.rst (original) +++ python/branches/release30-maint/Doc/library/sqlite3.rst Sun Jan 4 01:04:26 2009 @@ -541,8 +541,8 @@ This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each - column where the last six items of each tuple are :const:`None`. - + column where the last six items of each tuple are :const:`None`. + It is set for ``SELECT`` statements without any matching rows as well. .. _sqlite3-row-objects: @@ -553,7 +553,7 @@ .. class:: Row A :class:`Row` instance serves as a highly optimized - :attr:`~Connection.row_factory` for :class:`Connection` objects. + :attr:`~Connection.row_factory` for :class:`Connection` objects. It tries to mimic a tuple in most of its features. It supports mapping access by column name and index, iteration, @@ -561,7 +561,7 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - + .. versionchanged:: 2.6 Added iteration and equality (hashability). @@ -780,7 +780,7 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. +Data Modification Language (DML) statement (i.e. ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions implicitly before a non-DML, non-query statement (i. e. anything other than ``SELECT`` or the aforementioned). Modified: python/branches/release30-maint/Doc/library/ssl.rst ============================================================================== --- python/branches/release30-maint/Doc/library/ssl.rst (original) +++ python/branches/release30-maint/Doc/library/ssl.rst Sun Jan 4 01:04:26 2009 @@ -45,7 +45,7 @@ .. exception:: SSLError - Raised to signal an error from the underlying SSL implementation. This + Raised to signal an error from the underlying SSL implementation. This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`socket.error`, which @@ -170,7 +170,7 @@ >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' - >>> + >>> .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None) @@ -397,7 +397,7 @@ the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, -that is, a certificate which has the same subject and issuer, +that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the @@ -433,13 +433,13 @@ you only need the root certificates, and the remote peer is supposed to furnish the other certificates necessary to chain from its certificate to a root certificate. -See :rfc:`4158` for more discussion of the way in which +See :rfc:`4158` for more discussion of the way in which certification chains can be built. If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, -such as buying one from a certification authority. Another common +such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following:: @@ -581,7 +581,7 @@ And go back to listening for new client connections. - + .. seealso:: Class :class:`socket.socket` 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 Sun Jan 4 01:04:26 2009 @@ -172,7 +172,7 @@ any operand is a complex number, the objects are of different types that cannot be compared, or other cases where there is no defined ordering. -.. index:: +.. index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) @@ -330,14 +330,14 @@ for well-defined conversions. (4) - float also accepts the strings "nan" and "inf" with an optional prefix "+" + float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity. (5) Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for programming languages. - + All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: @@ -430,7 +430,7 @@ original float and with a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - + .. versionadded:: 2.6 Two methods support conversion to @@ -845,7 +845,7 @@ otherwise. Decimal characters include digit characters, and all characters that that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. - + .. method:: str.isdigit() @@ -873,7 +873,7 @@ that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. - + .. method:: str.isprintable() Return true if all characters in the string are printable or the string is @@ -1444,7 +1444,7 @@ example, sort by department, then by salary grade). While a list is being sorted, the effect of attempting to mutate, or even - inspect, the list is undefined. The C implementation + inspect, the list is undefined. The C implementation makes the list appear empty for the duration, and raises :exc:`ValueError` if it can detect that the list has been mutated during a sort. @@ -1495,7 +1495,7 @@ b'\xf0\xf1\xf2' The translate method differs in semantics from the version available on strings: - + .. method:: bytes.translate(table[, delete]) Return a copy of the bytes or bytearray object where all bytes occurring in @@ -1777,7 +1777,7 @@ Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map. - + If a subclass of dict defines a method :meth:`__missing__`, if the key *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or raises whatever is @@ -2119,7 +2119,7 @@ positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). There is no return value. - + For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last. Modified: python/branches/release30-maint/Doc/library/string.rst ============================================================================== --- python/branches/release30-maint/Doc/library/string.rst (original) +++ python/branches/release30-maint/Doc/library/string.rst Sun Jan 4 01:04:26 2009 @@ -98,7 +98,7 @@ :meth:`format` is just a wrapper that calls :meth:`vformat`. .. method:: vformat(format_string, args, kwargs) - + This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the @@ -111,12 +111,12 @@ intended to be replaced by subclasses: .. method:: parse(format_string) - + Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string in to either literal text, or replacement fields. - + The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then @@ -134,7 +134,7 @@ *key* parameter to :meth:`get_value`. .. method:: get_value(key, args, kwargs) - + Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a @@ -172,7 +172,7 @@ method is provided so that subclasses can override it. .. method:: convert_field(value, conversion) - + Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method.) The default version understands 'r' (repr) and 's' (str) conversion types. @@ -201,7 +201,7 @@ element_index: `integer` conversion: "r" | "s" | "a" format_spec: - + In less formal terms, the replacement field starts with a *field_name*, which can either be a number (for a positional argument), or an identifier (for keyword arguments). Following this is an optional *conversion* field, which is @@ -221,7 +221,7 @@ "My quest is {name}" # References keyword argument 'name' "Weight in tons {0.weight}" # 'weight' attribute of first positional arg "Units destroyed: {players[0]}" # First element of keyword argument 'players'. - + The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted @@ -265,11 +265,11 @@ Then the outer replacement field would be evaluated, producing:: "noses " - + Which is substituted into the string, yielding:: - + "A man with two noses " - + (The extra space is because we specified a field width of 10, and because left alignment is the default for strings.) @@ -301,7 +301,7 @@ width: `integer` precision: `integer` type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - + The *fill* character can be any character other than '}' (which signifies the end of the field). The presence of a fill character is signaled by the *next* character, which must be one of the alignment options. If the second character @@ -394,9 +394,9 @@ +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ - + The available presentation types for floating point and decimal values are: - + +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ Modified: python/branches/release30-maint/Doc/library/subprocess.rst ============================================================================== --- python/branches/release30-maint/Doc/library/subprocess.rst (original) +++ python/branches/release30-maint/Doc/library/subprocess.rst Sun Jan 4 01:04:26 2009 @@ -126,7 +126,7 @@ Special value that can be used as the *stderr* argument to :class:`Popen` and indicates that standard error should go into the same handle as standard output. - + Convenience Functions ^^^^^^^^^^^^^^^^^^^^^ @@ -322,7 +322,7 @@ The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly by :meth:`communicate`). A ``None`` value indicates that the process hasn't terminated yet. - + A negative value ``-N`` indicates that the child was terminated by signal ``N`` (Unix only). Modified: python/branches/release30-maint/Doc/library/sys.rst ============================================================================== --- python/branches/release30-maint/Doc/library/sys.rst (original) +++ python/branches/release30-maint/Doc/library/sys.rst Sun Jan 4 01:04:26 2009 @@ -327,7 +327,7 @@ The *default* argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would - cause a `TypeError`. + cause a `TypeError`. func:`getsizeof` calls the object's __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. @@ -642,7 +642,7 @@ The events have the following meaning: - ``'call'`` + ``'call'`` A function is called (or some other code block entered). The global trace function is called; *arg* is ``None``; the return value specifies the local trace function. @@ -704,7 +704,7 @@ prompts of :func:`input`. The interpreter's own prompts and (almost all of) its error messages go to ``stderr``. ``stdout`` and ``stderr`` needn't be built-in file objects: any object is acceptable as long - as it has a :meth:`write` method that takes a string argument. (Changing these + as it has a :meth:`write` method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) Modified: python/branches/release30-maint/Doc/library/tk.rst ============================================================================== --- python/branches/release30-maint/Doc/library/tk.rst (original) +++ python/branches/release30-maint/Doc/library/tk.rst Sun Jan 4 01:04:26 2009 @@ -12,7 +12,7 @@ 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` +using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix` module. The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. To @@ -23,15 +23,15 @@ mechanism which allows Python and Tcl to interact. :mod:`tkinter`'s chief virtues are that it is fast, and that it usually comes -bundled with Python. Although its standard documentation is weak, good -material is available, which includes: references, tutorials, a book and -others. :mod:`tkinter` is also famous for having an outdated look and feel, -which has been vastly improved in Tk 8.5. Nevertheless, there are many other -GUI libraries that you could be interested in. For more information about +bundled with Python. Although its standard documentation is weak, good +material is available, which includes: references, tutorials, a book and +others. :mod:`tkinter` is also famous for having an outdated look and feel, +which has been vastly improved in Tk 8.5. Nevertheless, there are many other +GUI libraries that you could be interested in. For more information about alternatives, see the :ref:`other-gui-packages` section. .. toctree:: - + tkinter.rst tkinter.tix.rst tkinter.scrolledtext.rst Modified: python/branches/release30-maint/Doc/library/tkinter.rst ============================================================================== --- python/branches/release30-maint/Doc/library/tkinter.rst (original) +++ python/branches/release30-maint/Doc/library/tkinter.rst Sun Jan 4 01:04:26 2009 @@ -41,7 +41,7 @@ linked with the Python interpreter. In addition to the Tk interface module, :mod:`tkinter` includes a number of -Python modules, :mod:`tkinter.constants` being one of the most important. +Python modules, :mod:`tkinter.constants` being one of the most important. Importing :mod:`tkinter` will automatically import :mod:`tkinter.constants`, so, usually, to use Tkinter all you need is a simple import statement:: @@ -96,7 +96,7 @@ Basic dialogs and convenience functions. :mod:`tkinter.dnd` - Drag-and-drop support for :mod:`tkinter`. This is experimental and should + Drag-and-drop support for :mod:`tkinter`. This is experimental and should become deprecated when it is replaced with the Tk DND. :mod:`turtle` @@ -156,7 +156,7 @@ the novice. The book is not exhaustive, and for many details it defers to the man pages. -* :file:`tkinter/__init__.py` is a last resort for most, but can be a good +* :file:`tkinter/__init__.py` is a last resort for most, but can be a good place to go when nothing else makes sense. @@ -271,7 +271,7 @@ someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say:: - .fred someAction someOptions + .fred someAction someOptions Note that the object name, ``.fred``, starts with a dot. @@ -320,7 +320,7 @@ arguments. In Tkinter, the Pack class holds all this functionality, and the various forms of the pack command are implemented as methods. All widgets in :mod:`tkinter` are subclassed from the Packer, and so inherit all the packing -methods. See the :mod:`tkinter.tix` module documentation for additional +methods. See the :mod:`tkinter.tix` module documentation for additional information on the Form geometry manager. :: pack .fred -side left =====> fred.pack(side = "left") @@ -477,7 +477,7 @@ For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout's book. -anchor +anchor Anchor type. Denotes where the packer is to place each slave in its parcel. expand @@ -707,7 +707,7 @@ they are denoted in Tk, which can be useful when referring to the Tk man pages. :: - Tk Tkinter Event Field Tk Tkinter Event Field + Tk Tkinter Event Field Tk Tkinter Event Field -- ------------------- -- ------------------- %f focus %A char %h height %E send_event Modified: python/branches/release30-maint/Doc/library/tkinter.tix.rst ============================================================================== --- python/branches/release30-maint/Doc/library/tkinter.tix.rst (original) +++ python/branches/release30-maint/Doc/library/tkinter.tix.rst Sun Jan 4 01:04:26 2009 @@ -8,12 +8,12 @@ .. index:: single: Tix -The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional -rich set of widgets. Although the standard Tk library has many useful widgets, +The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional +rich set of widgets. Although the standard Tk library has many useful widgets, they are far from complete. The :mod:`tkinter.tix` library provides most of the -commonly needed widgets that are missing from standard Tk: :class:`HList`, -:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of -scrollable widgets. +commonly needed widgets that are missing from standard Tk: :class:`HList`, +:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of +scrollable widgets. :mod:`tkinter.tix` also includes many more widgets that are generally useful in a wide range of applications: :class:`NoteBook`, :class:`FileEntry`, :class:`PanedWindow`, etc; there are more than 40 of them. @@ -50,10 +50,10 @@ Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. - Classes in the :mod:`tkinter.tix` module subclasses the classes in the - :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` - with Tkinter, all you need to do is to import one module. In general, you - can just import :mod:`tkinter.tix`, and replace the toplevel call to + Classes in the :mod:`tkinter.tix` module subclasses the classes in the + :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` + with Tkinter, all you need to do is to import one module. In general, you + can just import :mod:`tkinter.tix`, and replace the toplevel call to :class:`tkinter.Tk` with :class:`tix.Tk`:: from tkinter import tix @@ -437,7 +437,7 @@ The :mod:`tkinter.tix` module adds: * `pixmap `_ - capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create + capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create color images from XPM files. .. Python Demo of: Modified: python/branches/release30-maint/Doc/library/tokenize.rst ============================================================================== --- python/branches/release30-maint/Doc/library/tokenize.rst (original) +++ python/branches/release30-maint/Doc/library/tokenize.rst Sun Jan 4 01:04:26 2009 @@ -19,16 +19,16 @@ The :func:`tokenize` generator requires one argument, *readline*, which must be a callable object which provides the same interface as the :meth:`readline` method of built-in file objects (see section - :ref:`bltin-file-objects`). Each call to the function should return one + :ref:`bltin-file-objects`). Each call to the function should return one line of input as bytes. - The generator produces 5-tuples with these members: the token type; the - token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and - column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of - ints specifying the row and column where the token ends in the source; and + The generator produces 5-tuples with these members: the token type; the + token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and + column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of + ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed (the last tuple item) is the *logical* line; continuation lines are included. - + :func:`tokenize` determines the source encoding of the file by looking for a UTF-8 BOM or encoding cookie, according to :pep:`263`. @@ -44,35 +44,35 @@ .. data:: NL Token value used to indicate a non-terminating newline. The NEWLINE token - indicates the end of a logical line of Python code; NL tokens are generated + indicates the end of a logical line of Python code; NL tokens are generated when a logical line of code is continued over multiple physical lines. .. data:: ENCODING - Token value that indicates the encoding used to decode the source bytes - into text. The first token returned by :func:`tokenize` will always be an + Token value that indicates the encoding used to decode the source bytes + into text. The first token returned by :func:`tokenize` will always be an ENCODING token. -Another function is provided to reverse the tokenization process. This is -useful for creating tools that tokenize a script, modify the token stream, and +Another function is provided to reverse the tokenization process. This is +useful for creating tools that tokenize a script, modify the token stream, and write back the modified script. .. function:: untokenize(iterable) Converts tokens back into Python source code. The *iterable* must return - sequences with at least two elements, the token type and the token string. + sequences with at least two elements, the token type and the token string. Any additional sequence elements are ignored. - + The reconstructed script is returned as a single string. The result is guaranteed to tokenize back to match the input so that the conversion is - lossless and round-trips are assured. The guarantee applies only to the - token type and token string as the spacing between tokens (column + lossless and round-trips are assured. The guarantee applies only to the + token type and token string as the spacing between tokens (column positions) may change. - - It returns bytes, encoded using the ENCODING token, which is the first + + It returns bytes, encoded using the ENCODING token, which is the first token sequence output by :func:`tokenize`. @@ -81,43 +81,43 @@ .. function:: detect_encoding(readline) - The :func:`detect_encoding` function is used to detect the encoding that - should be used to decode a Python source file. It requires one argment, + The :func:`detect_encoding` function is used to detect the encoding that + should be used to decode a Python source file. It requires one argment, readline, in the same way as the :func:`tokenize` generator. - + It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (not decoded from bytes) it has read in. - + It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. - - If no encoding is specified, then the default of 'utf-8' will be returned. - + If no encoding is specified, then the default of 'utf-8' will be returned. + + Example of a script re-writer that transforms float literals into Decimal objects:: def decistmt(s): """Substitute Decimals for floats in a string of statements. - + >>> from decimal import Decimal >>> s = 'print(+21.3e-5*-.1234/81.7)' >>> decistmt(s) "print (+Decimal ('21.3e-5')*-Decimal ('.1234')/Decimal ('81.7'))" - + The format of the exponent is inherited from the platform C library. Known cases are "e-007" (Windows) and "e-07" (not Windows). Since we're only showing 12 digits, and the 13th isn't close to 5, the rest of the output should be platform-independent. - + >>> exec(s) #doctest: +ELLIPSIS -3.21716034272e-0...7 - + Output from calculations with Decimal should be identical across all platforms. - + >>> exec(decistmt(s)) -3.217160342717258261933904529E-7 """ Modified: python/branches/release30-maint/Doc/library/trace.rst ============================================================================== --- python/branches/release30-maint/Doc/library/trace.rst (original) +++ python/branches/release30-maint/Doc/library/trace.rst Sun Jan 4 01:04:26 2009 @@ -65,13 +65,13 @@ :option:`--ignore-module` Accepts comma separated list of module names. Ignore each of the named - module and its submodules (if it is a package). May be given + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` Ignore all modules and packages in the named directory and subdirectories (multiple directories can be joined by os.pathsep). May be given multiple - times. + times. .. _trace-api: Modified: python/branches/release30-maint/Doc/library/traceback.rst ============================================================================== --- python/branches/release30-maint/Doc/library/traceback.rst (original) +++ python/branches/release30-maint/Doc/library/traceback.rst Sun Jan 4 01:04:26 2009 @@ -163,10 +163,10 @@ def lumberjack(): bright_side_of_death() - + def bright_side_of_death(): return tuple()[0] - + try: lumberjack() except: @@ -245,12 +245,12 @@ >>> import traceback >>> def another_function(): ... lumberstack() - ... + ... >>> def lumberstack(): ... traceback.print_stack() ... print(repr(traceback.extract_stack())) ... print(repr(traceback.format_stack())) - ... + ... >>> another_function() File "", line 10, in another_function() Modified: python/branches/release30-maint/Doc/library/turtle.rst ============================================================================== --- python/branches/release30-maint/Doc/library/turtle.rst (original) +++ python/branches/release30-maint/Doc/library/turtle.rst Sun Jan 4 01:04:26 2009 @@ -1563,7 +1563,7 @@ Subclass of TurtleScreen, with :ref:`four methods added `. - + .. class:: ScrolledCavas(master) :param master: some Tkinter widget to contain the ScrolledCanvas, i.e. @@ -1588,13 +1588,13 @@ "compound" ``None`` (a compund shape has to be constructed using the :meth:`addcomponent` method) =========== =========== - + .. method:: addcomponent(poly, fill, outline=None) :param poly: a polygon, i.e. a tuple of pairs of numbers :param fill: a color the *poly* will be filled with :param outline: a color for the poly's outline (if given) - + Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1638,31 +1638,31 @@ >>> help(Screen.bgcolor) Help on method bgcolor in module turtle: - + bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - - + + >>> screen.bgcolor("orange") >>> screen.bgcolor() "orange" >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() "#800080" - + >>> help(Turtle.penup) Help on method penup in module turtle: - + penup(self) unbound turtle.Turtle method Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + >>> turtle.penup() - The docstrings of the functions which are derived from methods have a modified @@ -1670,32 +1670,32 @@ >>> help(bgcolor) Help on function bgcolor in module turtle: - + bgcolor(*args) Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - + Example:: - + >>> bgcolor("orange") >>> bgcolor() "orange" >>> bgcolor(0.5,0,0.5) >>> bgcolor() "#800080" - + >>> help(penup) Help on function penup in module turtle: - + penup() Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + Example: >>> penup() @@ -1871,19 +1871,19 @@ Changes since Python 2.6 ======================== -- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and - :meth:`Turtle.window_height` have been eliminated. - Methods with these names and functionality are now available only +- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and + :meth:`Turtle.window_height` have been eliminated. + Methods with these names and functionality are now available only as methods of :class:`Screen`. The functions derived from these remain - available. (In fact already in Python 2.6 these methods were merely - duplications of the corresponding + available. (In fact already in Python 2.6 these methods were merely + duplications of the corresponding :class:`TurtleScreen`/:class:`Screen`-methods.) -- The method :meth:`Turtle.fill` has been eliminated. - The behaviour of :meth:`begin_fill` and :meth:`end_fill` - have changed slightly: now every filling-process must be completed with an +- The method :meth:`Turtle.fill` has been eliminated. + The behaviour of :meth:`begin_fill` and :meth:`end_fill` + have changed slightly: now every filling-process must be completed with an ``end_fill()`` call. - + - A method :meth:`Turtle.filling` has been added. It returns a boolean value: ``True`` if a filling process is under way, ``False`` otherwise. This behaviour corresponds to a ``fill()`` call without arguments in Modified: python/branches/release30-maint/Doc/library/unicodedata.rst ============================================================================== --- python/branches/release30-maint/Doc/library/unicodedata.rst (original) +++ python/branches/release30-maint/Doc/library/unicodedata.rst Sun Jan 4 01:04:26 2009 @@ -156,7 +156,7 @@ File "", line 1, in ? ValueError: not a decimal >>> unicodedata.category('A') # 'L'etter, 'u'ppercase - 'Lu' + 'Lu' >>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber 'AN' 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 Jan 4 01:04:26 2009 @@ -591,7 +591,7 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare @@ -602,7 +602,7 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare Modified: python/branches/release30-maint/Doc/library/warnings.rst ============================================================================== --- python/branches/release30-maint/Doc/library/warnings.rst (original) +++ python/branches/release30-maint/Doc/library/warnings.rst Sun Jan 4 01:04:26 2009 @@ -279,15 +279,15 @@ this function with an alternative implementation by assigning to ``warnings.showwarning``. *line* is a line of source code to be included in the warning - message; if *line* is not supplied, :func:`showwarning` will + message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. function:: formatwarning(message, category, filename, lineno[, line]) Format a warning the standard way. This returns a string which may contain - embedded newlines and ends in a newline. *line* is - a line of source code to be included in the warning message; if *line* is not supplied, + embedded newlines and ends in a newline. *line* is + a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. Modified: python/branches/release30-maint/Doc/library/webbrowser.rst ============================================================================== --- python/branches/release30-maint/Doc/library/webbrowser.rst (original) +++ python/branches/release30-maint/Doc/library/webbrowser.rst Sun Jan 4 01:04:26 2009 @@ -155,7 +155,7 @@ url = 'http://www.python.org' - # Open URL in a new tab, if a browser window is already open. + # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(url + '/doc') # Open URL in new window, raising the window if possible. Modified: python/branches/release30-maint/Doc/library/wsgiref.rst ============================================================================== --- python/branches/release30-maint/Doc/library/wsgiref.rst (original) +++ python/branches/release30-maint/Doc/library/wsgiref.rst Sun Jan 4 01:04:26 2009 @@ -168,7 +168,7 @@ filelike = StringIO("This is an example file-like object"*10) wrapper = FileWrapper(filelike, blksize=5) - for chunk in wrapper: + for chunk in wrapper: print(chunk) @@ -413,7 +413,7 @@ from wsgiref.validate import validator from wsgiref.simple_server import make_server - # Our callable object which is intentionally not compliant to the + # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): status = b'200 OK' # HTTP Status 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 Sun Jan 4 01:04:26 2009 @@ -32,7 +32,7 @@ A C implementation of this API is available as :mod:`xml.etree.cElementTree`. See http://effbot.org/zone/element-index.htm for tutorials and links to other -docs. Fredrik Lundh's page is also the location of the development version of the +docs. Fredrik Lundh's page is also the location of the development version of the xml.etree.ElementTree. .. _elementtree-functions: @@ -379,7 +379,7 @@ Example page -

Moved to example.org +

Moved to example.org or example.com.

@@ -486,9 +486,9 @@ :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method for each opening tag, its :meth:`end` method for each closing tag, -and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` -calls *target*\'s method :meth:`close`. -:class:`XMLTreeBuilder` can be used not only for building a tree structure. +and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` +calls *target*\'s method :meth:`close`. +:class:`XMLTreeBuilder` can be used not only for building a tree structure. This is an example of counting the maximum depth of an XML file:: >>> from xml.etree.ElementTree import XMLTreeBuilder @@ -496,16 +496,16 @@ ... maxDepth = 0 ... depth = 0 ... def start(self, tag, attrib): # Called for each opening tag. - ... self.depth += 1 + ... self.depth += 1 ... if self.depth > self.maxDepth: ... self.maxDepth = self.depth ... def end(self, tag): # Called for each closing tag. ... self.depth -= 1 - ... def data(self, data): + ... def data(self, data): ... pass # We do not need to do anything with data. ... def close(self): # Called when all data has been parsed. ... return self.maxDepth - ... + ... >>> target = MaxDepth() >>> parser = XMLTreeBuilder(target=target) >>> exampleXml = """ Modified: python/branches/release30-maint/Doc/library/xmlrpc.server.rst ============================================================================== --- python/branches/release30-maint/Doc/library/xmlrpc.server.rst (original) +++ python/branches/release30-maint/Doc/library/xmlrpc.server.rst Sun Jan 4 01:04:26 2009 @@ -126,7 +126,7 @@ requestHandler=RequestHandler) server.register_introspection_functions() - # Register pow() function; this will use the value of + # Register pow() function; this will use the value of # pow.__name__ as the name, which is just 'pow'. server.register_function(pow) @@ -135,10 +135,10 @@ return x + y server.register_function(adder_function, 'add') - # Register an instance; all the methods of the instance are + # Register an instance; all the methods of the instance are # published as XML-RPC methods (in this case, just 'div'). class MyFuncs: - def div(self, x, y): + def div(self, x, y): return x // y server.register_instance(MyFuncs()) Modified: python/branches/release30-maint/Doc/library/zipfile.rst ============================================================================== --- python/branches/release30-maint/Doc/library/zipfile.rst (original) +++ python/branches/release30-maint/Doc/library/zipfile.rst Sun Jan 4 01:04:26 2009 @@ -191,7 +191,7 @@ .. method:: ZipFile.extractall([path[, members[, pwd]]]) - Extract all members from the archive to the current working directory. *path* + Extract all members from the archive to the current working directory. *path* specifies a different directory to extract to. *members* is optional and must be a subset of the list returned by :meth:`namelist`. *pwd* is the password used for encrypted files. @@ -264,9 +264,9 @@ .. note:: - When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, - the compression method used will be that specified in the *compress_type* - member of the given :class:`ZipInfo` instance. By default, the + When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, + the compression method used will be that specified in the *compress_type* + member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. The following data attributes are also available: @@ -280,9 +280,9 @@ .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a - :class:`ZipFile` instance created with mode 'a' or 'w', this should be a - string no longer than 65535 bytes. Comments longer than this will be + The comment text associated with the ZIP file. If assigning a comment to a + :class:`ZipFile` instance created with mode 'a' or 'w', this should be a + string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when :meth:`ZipFile.close` is called. .. _pyzipfile-objects: @@ -311,10 +311,10 @@ internal use only. The :meth:`writepy` method makes archives with file names like this:: - string.pyc # Top level name - test/__init__.pyc # Package directory + string.pyc # Top level name + test/__init__.pyc # Package directory test/testall.pyc # Module test.testall - test/bogus/__init__.pyc # Subpackage directory + test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile Modified: python/branches/release30-maint/Doc/library/zipimport.rst ============================================================================== --- python/branches/release30-maint/Doc/library/zipimport.rst (original) +++ python/branches/release30-maint/Doc/library/zipimport.rst Sun Jan 4 01:04:26 2009 @@ -142,7 +142,7 @@ -------- ------- 8467 1 file $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading Modified: python/branches/release30-maint/Doc/license.rst ============================================================================== --- python/branches/release30-maint/Doc/license.rst (original) +++ python/branches/release30-maint/Doc/license.rst Sun Jan 4 01:04:26 2009 @@ -386,8 +386,8 @@ The source for the :mod:`fpectl` module includes the following notice:: - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -419,7 +419,7 @@ | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / + \ endorsement purposes. / --------------------------------------------------------------------- Modified: python/branches/release30-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release30-maint/Doc/reference/datamodel.rst Sun Jan 4 01:04:26 2009 @@ -1152,7 +1152,7 @@ implementing :meth:`__format__`, however most classes will either delegate formatting to one of the built-in types, or use a similar formatting option syntax. - + See :ref:`formatspec` for a description of the standard formatting syntax. The return value must be a string object. 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 Jan 4 01:04:26 2009 @@ -552,7 +552,7 @@ :keyword:`del` statements. The syntax for a slicing: .. productionlist:: - slicing: `primary` "[" `slice_list` "]" + slicing: `primary` "[" `slice_list` "]" slice_list: `slice_item` ("," `slice_item`)* [","] slice_item: `expression` | `proper_slice` proper_slice: [`lower_bound`] ":" [`upper_bound`] [ ":" [`stride`] ] @@ -640,7 +640,7 @@ the call. .. note:: - + An implementation may provide builtin functions whose positional parameters do not have names, even if they are 'named' for the purpose of documentation, and which therefore cannot be supplied by keyword. In CPython, this is the case for @@ -1045,7 +1045,7 @@ Comparison of objects of the differing types depends on whether either of the types provide explicit support for the comparison. Most numeric types can be compared with one another, but comparisons of :class:`float` and -:class:`Decimal` are not supported to avoid the inevitable confusion arising +:class:`Decimal` are not supported to avoid the inevitable confusion arising from representation issues such as ``float('1.1')`` being inexactly represented and therefore not exactly equal to ``Decimal('1.1')`` which is. When cross-type comparison is not supported, the comparison method returns @@ -1323,7 +1323,7 @@ identity only, but this caused surprises because people expected to be able to test a dictionary for emptiness by comparing it to ``{}``. -.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of +.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 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. Modified: python/branches/release30-maint/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/lexical_analysis.rst (original) +++ python/branches/release30-maint/Doc/reference/lexical_analysis.rst Sun Jan 4 01:04:26 2009 @@ -608,7 +608,7 @@ 7 2147483647 0o177 0b100110111 3 79228162514264337593543950336 0o377 0x100000000 - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: @@ -654,7 +654,7 @@ part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of imaginary literals:: - 3.14j 10.j 10j .001j 1e100j 3.14e-10j + 3.14j 10.j 10j .001j 1e100j 3.14e-10j .. _operators: 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 Sun Jan 4 01:04:26 2009 @@ -507,7 +507,7 @@ .. index:: pair: exception; chaining __cause__ (exception attribute) __context__ (exception attribute) - + The ``from`` clause is used for exception chaining: if given, the second *expression* must be another exception class or instance, which will then be attached to the raised exception as the :attr:`__cause__` attribute (which is @@ -729,7 +729,7 @@ searched inside the package. A package is generally a subdirectory of a directory on ``sys.path`` that has a file :file:`__init__.py`. -.. +.. [XXX Can't be bothered to spell this out right now; see the URL http://www.python.org/doc/essays/packages.html for more details, also about how @@ -874,9 +874,9 @@ : ["=" (`target_list` "=")+ `expression_list`] : | "nonlocal" `identifier` `augop` `expression_list` -The :keyword:`nonlocal` statement causes the listed identifiers to refer to -previously bound variables in the nearest enclosing scope. This is important -because the default behavior for binding is to search the local namespace +The :keyword:`nonlocal` statement causes the listed identifiers to refer to +previously bound variables in the nearest enclosing scope. This is important +because the default behavior for binding is to search the local namespace first. The statement allows encapsulated code to rebind variables outside of the local scope besides the global (module) scope. @@ -889,7 +889,7 @@ enclosing scope (the scope in which a new binding should be created cannot be determined unambiguously). -Names listed in a :keyword:`nonlocal` statement must not collide with +Names listed in a :keyword:`nonlocal` statement must not collide with pre-existing bindings in the local scope. .. seealso:: Modified: python/branches/release30-maint/Doc/tutorial/classes.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/classes.rst (original) +++ python/branches/release30-maint/Doc/tutorial/classes.rst Sun Jan 4 01:04:26 2009 @@ -14,7 +14,7 @@ class or classes, and a method can call the method of a base class with the same name. Objects can contain an arbitrary amount of private data. -In C++ terminology, normally class members (including the data members) are +In C++ terminology, normally class members (including the data members) are *public* (except see below :ref:`tut-private`), and all member functions are *virtual*. There are no special constructors or destructors. As in Modula-3, there are no shorthands for referencing the @@ -171,7 +171,7 @@ def do_global(): global spam spam = "global spam" - + spam = "test spam" do_local() print("After local assignment:", spam) @@ -302,7 +302,7 @@ ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -532,7 +532,7 @@ is ``True`` since :class:`bool` is a subclass of :class:`int`. However, ``issubclass(float, int)`` is ``False`` since :class:`float` is not a subclass of :class:`int`. - + .. _tut-multiple: Modified: python/branches/release30-maint/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/controlflow.rst (original) +++ python/branches/release30-maint/Doc/tutorial/controlflow.rst Sun Jan 4 01:04:26 2009 @@ -61,7 +61,7 @@ ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print(x, len(x)) - ... + ... cat 3 window 6 defenestrate 12 @@ -74,7 +74,7 @@ >>> for x in a[:]: # make a slice copy of the entire list ... if len(x) > 6: a.insert(0, x) - ... + ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] @@ -96,7 +96,7 @@ 2 3 4 - + The given end point is never part of the generated list; ``range(10)`` generates @@ -104,13 +104,13 @@ is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the 'step'):: - range(5, 10) + range(5, 10) 5 through 9 - range(0, 10, 3) + range(0, 10, 3) 0, 3, 6, 9 - range(-10, -100, -30) + range(-10, -100, -30) -10, -40, -70 To iterate over the indices of a sequence, you can combine :func:`range` and @@ -119,7 +119,7 @@ >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print(i, a[i]) - ... + ... 0 Mary 1 had 2 a @@ -135,12 +135,12 @@ range(0, 10) In many ways the object returned by :func:`range` behaves as if it is a list, -but in fact it isn't. It is an object which returns the successive items of -the desired sequence when you iterate over it, but it doesn't really make -the list, thus saving space. +but in fact it isn't. It is an object which returns the successive items of +the desired sequence when you iterate over it, but it doesn't really make +the list, thus saving space. -We say such an object is *iterable*, that is, suitable as a target for -functions and constructs that expect something from which they can +We say such an object is *iterable*, that is, suitable as a target for +functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the :keyword:`for` statement is such an *iterator*. The function :func:`list` is another; it creates lists from iterables:: @@ -177,7 +177,7 @@ ... else: ... # loop fell through without finding a factor ... print(n, 'is a prime number') - ... + ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 @@ -198,7 +198,7 @@ >>> while True: ... pass # Busy-wait for keyboard interrupt (Ctrl+C) - ... + ... This is commonly used for creating minimal classes:: @@ -212,7 +212,7 @@ >>> def initlog(*args): ... pass # Remember to implement this! - ... + ... .. _tut-functions: @@ -229,7 +229,7 @@ ... print(b, end=' ') ... a, b = b, a+b ... print() - ... + ... >>> # Now call the function we just defined: ... fib(2000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 @@ -300,7 +300,7 @@ ... result.append(b) # see below ... a, b = b, a+b ... return result - ... + ... >>> f100 = fib2(100) # call it >>> f100 # write the result [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -436,7 +436,7 @@ >>> def function(a): ... pass - ... + ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in ? @@ -487,7 +487,7 @@ ------------------------ .. index:: - statement: * + statement: * Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -497,13 +497,13 @@ def write_multiple_items(file, separator, *args): file.write(separator.join(args)) - + Normally, these ``variadic`` arguments will be last in the list of formal -parameters, because they scoop up all remaining input arguments that are +parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the ``*args`` -parameter are 'keyword-only' arguments, meaning that they can only be used as +parameter are 'keyword-only' arguments, meaning that they can only be used as keywords rather than positional arguments. :: - + >>> def concat(*args, sep="/"): ... return sep.join(args) ... @@ -581,7 +581,7 @@ single: strings, documentation Here are some conventions about the content and formatting of documentation -strings. +strings. The first line should always be a short, concise summary of the object's purpose. For brevity, it should not explicitly state the object's name or type, @@ -610,11 +610,11 @@ >>> def my_function(): ... """Do nothing, but document it. - ... + ... ... No, really, it doesn't do anything. ... """ ... pass - ... + ... >>> print(my_function.__doc__) Do nothing, but document it. Modified: python/branches/release30-maint/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/datastructures.rst (original) +++ python/branches/release30-maint/Doc/tutorial/datastructures.rst Sun Jan 4 01:04:26 2009 @@ -159,7 +159,7 @@ List comprehensions provide a concise way to create lists from sequences. Common applications are to make lists where each element is the result of -some operations applied to each member of the sequence, or to create a +some operations applied to each member of the sequence, or to create a subsequence of those elements that satisfy a certain condition. @@ -167,7 +167,7 @@ clause, then zero or more :keyword:`for` or :keyword:`if` clauses. The result will be a list resulting from evaluating the expression in the context of the :keyword:`for` and :keyword:`if` clauses which follow it. If the expression -would evaluate to a tuple, it must be parenthesized. +would evaluate to a tuple, it must be parenthesized. Here we take a list of numbers and return a list of three times each number:: @@ -227,7 +227,7 @@ powerful tool but -- like all powerful tools -- they need to be used carefully, if at all. -Consider the following example of a 3x3 matrix held as a list containing three +Consider the following example of a 3x3 matrix held as a list containing three lists, one list per row:: >>> mat = [ @@ -236,7 +236,7 @@ ... [7, 8, 9], ... ] -Now, if you wanted to swap rows and columns, you could use a list +Now, if you wanted to swap rows and columns, you could use a list comprehension:: >>> print([[row[i] for row in mat] for i in [0, 1, 2]]) @@ -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 builtin functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> list(zip(*mat)) Modified: python/branches/release30-maint/Doc/tutorial/errors.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/errors.rst (original) +++ python/branches/release30-maint/Doc/tutorial/errors.rst Sun Jan 4 01:04:26 2009 @@ -91,7 +91,7 @@ ... break ... except ValueError: ... print("Oops! That was no valid number. Try again...") - ... + ... The :keyword:`try` statement works as follows. @@ -195,12 +195,12 @@ >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as err: ... print('Handling run-time error:', err) - ... + ... Handling run-time error: int division or modulo by zero @@ -251,12 +251,12 @@ ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print('My exception occurred, value:', e.value) - ... + ... My exception occurred, value: 4 >>> raise MyError('oops!') Traceback (most recent call last): @@ -326,7 +326,7 @@ ... raise KeyboardInterrupt ... finally: ... print('Goodbye, world!') - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? @@ -389,9 +389,9 @@ print(line) The problem with this code is that it leaves the file open for an indeterminate -amount of time after this part of the code has finished executing. -This is not an issue in simple scripts, but can be a problem for larger -applications. The :keyword:`with` statement allows objects like files to be +amount of time after this part of the code has finished executing. +This is not an issue in simple scripts, but can be a problem for larger +applications. The :keyword:`with` statement allows objects like files to be used in a way that ensures they are always cleaned up promptly and correctly. :: with open("myfile.txt") as f: Modified: python/branches/release30-maint/Doc/tutorial/index.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/index.rst (original) +++ python/branches/release30-maint/Doc/tutorial/index.rst Sun Jan 4 01:04:26 2009 @@ -1,7 +1,7 @@ .. _tutorial-index: ###################### - The Python Tutorial + The Python Tutorial ###################### :Release: |version| Modified: python/branches/release30-maint/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/inputoutput.rst (original) +++ python/branches/release30-maint/Doc/tutorial/inputoutput.rst Sun Jan 4 01:04:26 2009 @@ -90,7 +90,7 @@ >>> for x in range(1, 11): ... print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x)) - ... + ... 1 1 1 2 4 8 3 9 27 @@ -165,7 +165,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): ... print('{0:10} ==> {1:10d}'.format(name, phone)) - ... + ... Jack ==> 4098 Dcab ==> 7678 Sjoerd ==> 4127 @@ -343,7 +343,7 @@ 16 >>> f.seek(5) # Go to the 6th byte in the file 5 - >>> f.read(1) + >>> f.read(1) b'5' >>> f.seek(-3, 2) # Go to the 3rd byte before the end 13 @@ -353,7 +353,7 @@ In text files (those opened without a ``b`` in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with ``seek(0, 2)``). - + When you're done with a file, call ``f.close()`` to close it and free up any system resources taken up by the open file. After calling ``f.close()``, attempts to use the file object will automatically fail. :: Modified: python/branches/release30-maint/Doc/tutorial/interpreter.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/interpreter.rst (original) +++ python/branches/release30-maint/Doc/tutorial/interpreter.rst Sun Jan 4 01:04:26 2009 @@ -115,7 +115,7 @@ >>> the_world_is_flat = 1 >>> if the_world_is_flat: ... print("Be careful not to fall off!") - ... + ... Be careful not to fall off! @@ -191,7 +191,7 @@ to do this, put one more special comment line right after the ``#!`` line to define the source file encoding:: - # -*- coding: encoding -*- + # -*- coding: encoding -*- With that declaration, everything in the source file will be treated as having the encoding *encoding* instead of UTF-8. The list of possible encodings can be Modified: python/branches/release30-maint/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/introduction.rst (original) +++ python/branches/release30-maint/Doc/tutorial/introduction.rst Sun Jan 4 01:04:26 2009 @@ -58,7 +58,7 @@ >>> 8/5 # Fractions aren't lost when dividing integers 1.6000000000000001 -Note: You might not see exactly the same result; floating point results can +Note: You might not see exactly the same result; floating point results can differ from one machine to another. We will say more later about controlling the appearance of floating point output; what we see here is the most informative display but not as easy to read as we would get with:: @@ -71,9 +71,9 @@ why these two ways of displaying floating point data come to be different. See :ref:`tut-fp-issues` for a full discussion. -To do integer division and get an integer result, +To do integer division and get an integer result, discarding any fractional result, there is another operator, ``//``:: - + >>> # Integer division returns the floor: ... 7//3 2 @@ -103,7 +103,7 @@ >>> # try to access an undefined variable ... n - Traceback (most recent call last): + Traceback (most recent call last): File "", line 1, in NameError: name 'n' is not defined @@ -245,14 +245,14 @@ they will be included in the string. :: print(""" - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """) produces the following output:: - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to @@ -371,10 +371,10 @@ Then the right edge of the last character of a string of *n* characters has index *n*, for example:: - +---+---+---+---+---+ + +---+---+---+---+---+ | H | e | l | p | A | - +---+---+---+---+---+ - 0 1 2 3 4 5 + +---+---+---+---+---+ + 0 1 2 3 4 5 -5 -4 -3 -2 -1 The first row of numbers gives the position of the indices 0...5 in the string; @@ -396,7 +396,7 @@ .. seealso:: :ref:`typesseq` - Strings are examples of *sequence types*, and support the common + Strings are examples of *sequence types*, and support the common operations supported by such types. :ref:`string-methods` @@ -565,7 +565,7 @@ >>> while b < 10: ... print(b) ... a, b = b, a+b - ... + ... 1 1 2 @@ -601,8 +601,8 @@ * The :func:`print` function writes the value of the expression(s) it is given. It differs from just writing the expression you want to write (as we did - earlier in the calculator examples) in the way it handles multiple - expressions, floating point quantities, + earlier in the calculator examples) in the way it handles multiple + expressions, floating point quantities, and strings. Strings are printed without quotes, and a space is inserted between items, so you can format things nicely, like this:: @@ -617,5 +617,5 @@ >>> while b < 1000: ... print(b, end=' ') ... a, b = b, a+b - ... + ... 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 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 Jan 4 01:04:26 2009 @@ -103,8 +103,8 @@ 1 1 2 3 5 8 13 21 34 55 89 144 233 377 This imports all names except those beginning with an underscore (``_``). -In most cases Python programmers do not use this facility since it introduces -an unknown set of names into the interpreter, possibly hiding some things +In most cases Python programmers do not use this facility since it introduces +an unknown set of names into the interpreter, possibly hiding some things you have already defined. .. note:: @@ -287,7 +287,7 @@ ['__name__', 'fib', 'fib2'] >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', + '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'callstats', 'copyright', 'displayhook', 'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', @@ -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', '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'] .. _tut-packages: Modified: python/branches/release30-maint/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/stdlib.rst (original) +++ python/branches/release30-maint/Doc/tutorial/stdlib.rst Sun Jan 4 01:04:26 2009 @@ -136,7 +136,7 @@ >>> random.random() # random float 0.17970987693706186 >>> random.randrange(6) # random integer chosen from range(6) - 4 + 4 The SciPy project has many other modules for numerical computations. Modified: python/branches/release30-maint/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/stdlib2.rst (original) +++ python/branches/release30-maint/Doc/tutorial/stdlib2.rst Sun Jan 4 01:04:26 2009 @@ -174,7 +174,7 @@ class AsyncZip(threading.Thread): def __init__(self, infile, outfile): - threading.Thread.__init__(self) + threading.Thread.__init__(self) self.infile = infile self.outfile = outfile def run(self): @@ -358,11 +358,11 @@ results in decimal floating point and binary floating point. The difference becomes significant if the results are rounded to the nearest cent:: - >>> from decimal import * + >>> from decimal import * >>> Decimal('0.70') * Decimal('1.05') Decimal("0.7350") >>> .70 * 1.05 - 0.73499999999999999 + 0.73499999999999999 The :class:`Decimal` result keeps a trailing zero, automatically inferring four place significance from multiplicands with two place significance. Decimal @@ -380,7 +380,7 @@ >>> sum([Decimal('0.1')]*10) == Decimal('1.0') True >>> sum([0.1]*10) == 1.0 - False + False The :mod:`decimal` module provides arithmetic with as much precision as needed:: Modified: python/branches/release30-maint/Doc/tutorial/whatnow.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/whatnow.rst (original) +++ python/branches/release30-maint/Doc/tutorial/whatnow.rst Sun Jan 4 01:04:26 2009 @@ -49,8 +49,8 @@ Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.) * http://scipy.org: The Scientific Python project includes modules for fast - array computations and manipulations plus a host of packages for such - things as linear algebra, Fourier transforms, non-linear solvers, + array computations and manipulations plus a host of packages for such + things as linear algebra, Fourier transforms, non-linear solvers, random number distributions, statistical analysis and the like. For Python-related questions and problem reports, you can post to the newsgroup @@ -68,6 +68,6 @@ .. Postings figure based on average of last six months activity as reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182 - days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) + days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) Modified: python/branches/release30-maint/Doc/using/cmdline.rst ============================================================================== --- python/branches/release30-maint/Doc/using/cmdline.rst (original) +++ python/branches/release30-maint/Doc/using/cmdline.rst Sun Jan 4 01:04:26 2009 @@ -8,8 +8,8 @@ The CPython interpreter scans the command line and the environment for various settings. -.. note:: - +.. note:: + Other implementations' command line schemes may differ. See :ref:`implementations` for further resources. @@ -61,7 +61,7 @@ Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code. - + If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top @@ -72,7 +72,7 @@ Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module. - + Since the argument is a *module* name, you must not give a file extension (``.py``). The ``module-name`` should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to @@ -84,18 +84,18 @@ written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available. - + If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. - + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details - .. seealso:: + .. seealso:: :func:`runpy.run_module` The actual implementation of this feature. @@ -152,7 +152,7 @@ --version Print the Python version number and exit. Example output could be:: - + Python 3.0 @@ -189,7 +189,7 @@ enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal. The :envvar:`PYTHONSTARTUP` file is not read. - + This can be useful to inspect global variables or a stack trace when a script raises an exception. See also :envvar:`PYTHONINSPECT`. @@ -222,10 +222,10 @@ .. cmdoption:: -u - + Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. - + Note that there is internal buffering in :meth:`file.readlines` and :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced by this option. To work around this, you will want to use @@ -237,7 +237,7 @@ .. XXX should the -U option be documented? .. cmdoption:: -v - + Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (:option:`-vv`), print a message for each file that is checked for when @@ -246,13 +246,13 @@ .. cmdoption:: -W arg - + Warning control. Python's warning machinery by default prints warning messages to :data:`sys.stderr`. A typical warning message has the following form:: file:line: category: message - + By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. @@ -260,13 +260,13 @@ one option, the action for the last matching option is performed. Invalid :option:`-W` options are ignored (though, a warning message is printed about invalid options when the first warning is issued). - + Warnings can also be controlled from within a Python program using the :mod:`warnings` module. The simplest form of argument is one of the following action strings (or a unique abbreviation): - + ``ignore`` Ignore all warnings. ``default`` @@ -282,9 +282,9 @@ Print each warning only the first time it occurs in the program. ``error`` Raise an exception instead of printing a warning message. - - The full form of argument is:: - + + The full form of argument is:: + action:message:category:module:line Here, *action* is as explained above but only applies to messages that match @@ -305,10 +305,10 @@ .. cmdoption:: -x - + Skip the first line of the source, allowing use of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only. - + .. warning:: The line numbers in error messages will be off by one! .. _using-on-envvars: @@ -319,13 +319,13 @@ These environment variables influence Python's behavior. .. envvar:: PYTHONHOME - + Change the location of the standard Python libraries. By default, the libraries are searched in :file:`{prefix}/lib/python{version}` and :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and :file:`{exec_prefix}` are installation-dependent directories, both defaulting to :file:`/usr/local`. - + When :envvar:`PYTHONHOME` is set to a single directory, its value replaces both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`. @@ -341,11 +341,11 @@ In addition to normal directories, individual :envvar:`PYTHONPATH` entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. - + The default search path is installation dependent, but generally begins with :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. - + An additional directory will be inserted in the search path in front of :envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-options`. The search path can be manipulated from @@ -353,7 +353,7 @@ .. envvar:: PYTHONSTARTUP - + If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so @@ -363,7 +363,7 @@ .. envvar:: PYTHONY2K - + Set this to a non-empty string to cause the :mod:`time` module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the :mod:`time` module @@ -371,21 +371,21 @@ .. envvar:: PYTHONOPTIMIZE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-O` option. If set to an integer, it is equivalent to specifying :option:`-O` multiple times. .. envvar:: PYTHONDEBUG - + If this is set to a non-empty string it is equivalent to specifying the :option:`-d` option. If set to an integer, it is equivalent to specifying :option:`-d` multiple times. .. envvar:: PYTHONINSPECT - + If this is set to a non-empty string it is equivalent to specifying the :option:`-i` option. @@ -394,20 +394,20 @@ .. envvar:: PYTHONUNBUFFERED - + If this is set to a non-empty string it is equivalent to specifying the :option:`-u` option. .. envvar:: PYTHONVERBOSE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-v` option. If set to an integer, it is equivalent to specifying :option:`-v` multiple times. .. envvar:: PYTHONCASEOK - + If this is set, Python ignores case in :keyword:`import` statements. This only works on Windows. Modified: python/branches/release30-maint/Doc/using/unix.rst ============================================================================== --- python/branches/release30-maint/Doc/using/unix.rst (original) +++ python/branches/release30-maint/Doc/using/unix.rst Sun Jan 4 01:04:26 2009 @@ -45,7 +45,7 @@ * OpenBSD users use:: - pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz + pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz For example i386 users get the 2.5.1 version of Python using:: @@ -87,7 +87,7 @@ Python-related paths and files ============================== - + These are subject to difference depending on local installation conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``) are installation-dependent and should be interpreted as for GNU software; they @@ -112,7 +112,7 @@ | | by the user module; not used by default | | | or by most applications. | +-----------------------------------------------+------------------------------------------+ - + Miscellaneous ============= Modified: python/branches/release30-maint/Doc/using/windows.rst ============================================================================== --- python/branches/release30-maint/Doc/using/windows.rst (original) +++ python/branches/release30-maint/Doc/using/windows.rst Sun Jan 4 01:04:26 2009 @@ -86,9 +86,9 @@ --------------------------------------- Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab +guide applies to XP classical view): Right-click the icon for your machine +(usually located on your Desktop and called "My Computer") and choose +:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab and click the :guilabel:`Environment Variables` button. In short, your path is: @@ -191,11 +191,11 @@ #. Launch a command prompt. #. Associate the correct file group with ``.py`` scripts:: - + assoc .py=Python.File #. Redirect all Python files to the new executable:: - + ftype Python.File=C:\Path\to\pythonw.exe "%1" %* Modified: python/branches/release30-maint/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.0.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.0.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.0 + What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka @@ -277,9 +277,9 @@ finding all the strings in the list containing a given substring. You could write the following to do it:: - # Given the list L, make a list of all strings + # Given the list L, make a list of all strings # containing the substring S. - sublist = filter( lambda s, substring=S: + sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, L) @@ -291,7 +291,7 @@ List comprehensions have the form:: - [ expression for expr in sequence1 + [ expression for expr in sequence1 for expr2 in sequence2 ... for exprN in sequenceN if condition ] @@ -312,8 +312,8 @@ ... for exprN in sequenceN: if (condition): - # Append the value of - # the expression to the + # Append the value of + # the expression to the # resulting list. This means that when there are multiple :keyword:`for`...\ :keyword:`in` @@ -590,7 +590,7 @@ def f(): print "i=",i - i = i + 1 + i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been @@ -627,7 +627,7 @@ the following lines of code:: if dict.has_key( key ): return dict[key] - else: + else: dict[key] = [] return dict[key] @@ -836,14 +836,14 @@ :file:`setup.py` can be just a few lines long:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:`setup.py` file isn't much more complicated if the software consists of a few packages:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", packages = ["package", "package.subpackage"]) A C extension can be the most complicated case; here's an example taken from @@ -860,7 +860,7 @@ 'extensions/expat/xmltok/xmlrole.c', ] ) - setup (name = "PyXML", version = "0.5.4", + setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) The Distutils can also take care of creating source and binary distributions. Modified: python/branches/release30-maint/Doc/whatsnew/2.1.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.1.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.1.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.1 + What's New in Python 2.1 **************************** :Author: A.M. Kuchling @@ -98,7 +98,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x Modified: python/branches/release30-maint/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.2.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.2.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.2 + What's New in Python 2.2 **************************** :Author: A.M. Kuchling @@ -473,7 +473,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it expects something for which :func:`iter` will return an iterator. For backward @@ -909,7 +909,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x @@ -952,8 +952,8 @@ items = s.meerkat.getItems( {'channel': 4} ) # 'items' is another list of dictionaries, like this: - # [{'link': 'http://freshmeat.net/releases/52719/', - # 'description': 'A utility which converts HTML to XSL FO.', + # [{'link': 'http://freshmeat.net/releases/52719/', + # 'description': 'A utility which converts HTML to XSL FO.', # 'title': 'html2fo 0.3 (Default)'}, ... ] The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward Modified: python/branches/release30-maint/Doc/whatsnew/2.3.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.3.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.3.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.3 + What's New in Python 2.3 **************************** :Author: A.M. Kuchling @@ -301,7 +301,7 @@ -------- ------- 8467 1 file amk at nyman:~/src/python$ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading @@ -671,7 +671,7 @@ # ... } - if (hasattr(core, 'setup_keywords') and + if (hasattr(core, 'setup_keywords') and 'classifiers' in core.setup_keywords): kw['classifiers'] = \ ['Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -1027,7 +1027,7 @@ creating small dictionaries:: >>> dict(red=1, blue=2, green=3, black=4) - {'blue': 2, 'black': 4, 'green': 3, 'red': 1} + {'blue': 2, 'black': 4, 'green': 3, 'red': 1} (Contributed by Just van Rossum.) @@ -1622,7 +1622,7 @@ ... self.valuelist.pop(i) ... def keys(self): ... return list(self.keylist) - ... + ... >>> s = SeqDict() >>> dir(s) # See that other dictionary methods are implemented ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__', @@ -1779,7 +1779,7 @@ set input filename -lLENGTH, --length=LENGTH set maximum length of output - $ + $ See the module's documentation for more details. Modified: python/branches/release30-maint/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.4.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.4.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.4 + What's New in Python 2.4 **************************** :Author: A.M. Kuchling @@ -63,10 +63,10 @@ >>> a.add('z') # add a new element >>> a.update('wxy') # add multiple new elements >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) >>> a.remove('x') # take one element out >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) The :func:`frozenset` type is an immutable version of :func:`set`. Since it is immutable and hashable, it may be used as a dictionary key or as a member of @@ -351,7 +351,7 @@ >>> for i in reversed(xrange(1,4)): ... print i - ... + ... 3 2 1 @@ -366,7 +366,7 @@ >>> input = open('/etc/passwd', 'r') >>> for line in reversed(list(input)): ... print line - ... + ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... @@ -650,7 +650,7 @@ 28 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.1428571428571428571428571429") - >>> decimal.getcontext().prec = 9 + >>> decimal.getcontext().prec = 9 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.142857143") @@ -665,7 +665,7 @@ >>> decimal.getcontext().traps[decimal.DivisionByZero] = False >>> decimal.Decimal(1) / decimal.Decimal(0) Decimal("Infinity") - >>> + >>> The :class:`Context` instance also has various methods for formatting numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`. @@ -803,7 +803,7 @@ >>> 'www.python.org'.split('.', 1) ['www', 'python.org'] 'www.python.org'.rsplit('.', 1) - ['www.python', 'org'] + ['www.python', 'org'] * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :meth:`sort` method of lists. These parameters make some common usages of @@ -1045,7 +1045,7 @@ >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque - True + True Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take advantage of :class:`collections.deque` for improved performance. (Contributed @@ -1106,13 +1106,13 @@ >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14] >>> for key_val, it in itertools.groupby(L, lambda x: x % 2): ... print key_val, list(it) - ... + ... 0 [2, 4, 6] 1 [7] 0 [8] 1 [9, 11] 0 [12, 14] - >>> + >>> :func:`groupby` is typically used with sorted input. The logic for :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for @@ -1120,21 +1120,21 @@ >>> word = 'abracadabra' >>> letters = sorted(word) # Turn string into a sorted list of letters - >>> letters + >>> letters ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r'] >>> for k, g in itertools.groupby(letters): ... print k, list(g) - ... + ... a ['a', 'a', 'a', 'a', 'a'] b ['b', 'b'] c ['c'] d ['d'] r ['r', 'r'] >>> # List unique letters - >>> [k for k, g in groupby(letters)] + >>> [k for k, g in groupby(letters)] ['a', 'b', 'c', 'd', 'r'] >>> # Count letter occurrences - >>> [(k, len(list(g))) for k, g in groupby(letters)] + >>> [(k, len(list(g))) for k, g in groupby(letters)] [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)] (Contributed by Hye-Shik Chang.) @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that 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 Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.5 + What's New in Python 2.5 **************************** :Author: A.M. Kuchling @@ -220,7 +220,7 @@ required packages. :: VERSION = '1.0' - setup(name='PyPackage', + setup(name='PyPackage', version=VERSION, requires=['numarray', 'zlib (>=1.1.4)'], obsoletes=['OldPackage'] @@ -388,7 +388,7 @@ else: else-block finally: - final-block + final-block The code in *block-1* is executed. If the code raises an exception, the various :keyword:`except` blocks are tested: if the exception is of class @@ -835,8 +835,8 @@ ... except (KeyboardInterrupt, SystemExit): raise - except: - # Log error... + except: + # Log error... # Continue running program... In Python 2.5, you can now write ``except Exception`` to achieve the same @@ -947,7 +947,7 @@ class C: def __index__ (self): - return self.value + return self.value The return value must be either a Python integer or long integer. The interpreter will check that the type returned is correct, and raises a @@ -1035,9 +1035,9 @@ L = ['medium', 'longest', 'short'] # Prints 'longest' - print max(L, key=len) + print max(L, key=len) # Prints 'short', because lexicographically 'short' has the largest value - print max(L) + print max(L) (Contributed by Steven Bethard and Raymond Hettinger.) @@ -1070,8 +1070,8 @@ using the default ASCII encoding. The result of the comparison is false:: >>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode - __main__:1: UnicodeWarning: Unicode equal comparison failed - to convert both arguments to Unicode - interpreting them + __main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them as being unequal False >>> chr(127) == unichr(127) # chr(127) can be converted @@ -1259,10 +1259,10 @@ Printing ``index`` results in the following output:: - defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], - 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], - 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], - 'p': ['per'], 's': ['selva', 'smarrita'], + defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], + 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], + 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], + 'p': ['per'], 's': ['selva', 'smarrita'], 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} (Contributed by Guido van Rossum.) @@ -1884,17 +1884,17 @@ differently. :: # Old versions - h = md5.md5() - h = md5.new() + h = md5.md5() + h = md5.new() - # New version + # New version h = hashlib.md5() # Old versions - h = sha.sha() - h = sha.new() + h = sha.sha() + h = sha.new() - # New version + # New version h = hashlib.sha1() # Hash that weren't previously available @@ -2191,7 +2191,7 @@ case that your extensions were using it, you can replace it by something like the following:: - range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", + range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", start, stop, step); .. ====================================================================== Modified: python/branches/release30-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.6.rst Sun Jan 4 01:04:26 2009 @@ -748,7 +748,7 @@ >>> import sys >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) Platform: darwin - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' >>> import mimetypes @@ -962,8 +962,8 @@ The primary use of :class:`bytes` in 2.6 will be to write tests of object type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, which can't tell whether 2.x code intends strings to -contain either characters or 8-bit bytes; you can now -use either :class:`bytes` or :class:`str` to represent your intention +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention exactly, and the resulting code will also be correct in Python 3.0. There's also a ``__future__`` import that causes all string literals @@ -1838,9 +1838,9 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) - The :func:`parse_qs` and :func:`parse_qsl` functions have been + The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated from the :mod:`cgi` module to the :mod:`urlparse` module. - The versions still available in the :mod:`cgi` module will + The versions still available in the :mod:`cgi` module will trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`). @@ -1935,7 +1935,7 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) - + :: # Boldface text starting at y=0,x=21 @@ -2432,9 +2432,9 @@ :issue:`742598`, :issue:`1193577`.) * The :mod:`sqlite3` module, maintained by Gerhard Haering, - has been updated from version 2.3.2 in Python 2.5 to + has been updated from version 2.3.2 in Python 2.5 to version 2.4.1. - + * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type, using the format character ``'?'``. (Contributed by David Remahl.) @@ -2529,9 +2529,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module gained a number - of context managers useful for writing tests. - :func:`EnvironmentVarGuard` is a +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2546,7 +2546,7 @@ f = urllib.urlopen('https://sf.net') ... - Finally, :func:`check_warnings` resets the :mod:`warning` module's + Finally, :func:`check_warnings` resets the :mod:`warning` module's warning filters and returns an object that will record all warning messages triggered (:issue:`3781`):: @@ -2586,7 +2586,7 @@ :meth:`activeCount` method is renamed to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module support the same properties and renamed methods, but don't remove the old methods. No date has been set - for the deprecation of the old APIs in Python 3.x; the old APIs won't + for the deprecation of the old APIs in Python 3.x; the old APIs won't be removed in any 2.x version. (Carried out by several people, most notably Benjamin Peterson.) @@ -2643,7 +2643,7 @@ (Added by Facundo Batista.) * The Unicode database provided by the :mod:`unicodedata` module - has been updated to version 5.1.0. (Updated by + has been updated to version 5.1.0. (Updated by Martin von Loewis; :issue:`3811`.) * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` @@ -2654,7 +2654,7 @@ A new function, :func:`catch_warnings`, is a context manager intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). - + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` @@ -3224,8 +3224,8 @@ * :meth:`object.__init__` previously accepted arbitrary arguments and keyword arguments, ignoring them. In Python 2.6, this is no longer - allowed and will result in a :exc:`TypeError`. This will affect - :meth:`__init__` methods that end up calling the corresponding + allowed and will result in a :exc:`TypeError`. This will affect + :meth:`__init__` methods that end up calling the corresponding method on :class:`object` (perhaps through using :func:`super`). See :issue:`1683368` for discussion. @@ -3285,7 +3285,7 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, -Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner. Modified: python/branches/release30-maint/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/3.0.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/3.0.rst Sun Jan 4 01:04:26 2009 @@ -1,5 +1,5 @@ **************************** - What's New In Python 3.0 + What's New In Python 3.0 **************************** .. XXX Add trademark info for Apple, Microsoft. @@ -10,45 +10,45 @@ .. $Id$ Rules for maintenance: - + * Anyone can add text to this document. Do not spend very much time on the wording of your changes, because your text will probably get rewritten to some degree. - + * The maintainer will go through Misc/NEWS periodically and add changes; it's therefore more important to add your changes to Misc/NEWS than to this file. (Note: I didn't get to this for 3.0. GvR.) - + * This is not a complete list of every single change; completeness is the purpose of Misc/NEWS. Some changes I consider too small or esoteric to include. If such a change is added to the text, I'll just remove it. (This is another reason you shouldn't spend too much time on writing your addition.) - + * If you want to draw your new text to the attention of the maintainer, add 'XXX' to the beginning of the paragraph or section. - + * It's OK to just add a fragmentary note about a change. For example: "XXX Describe the transmogrify() function added to the socket module." The maintainer will research the change and write the necessary text. - + * You can comment out your additions if you like, but it's not necessary (especially when a final release is some months away). - + * Credit the author of a patch or bugfix. Just the name is sufficient; the e-mail address isn't necessary. (Due to time constraints I haven't managed to do this for 3.0. GvR.) - + * It's helpful to add the bug/patch number as a comment: - + % Patch 12345 XXX Describe the transmogrify() function added to the socket module. (Contributed by P.Y. Developer.) - + This saves the maintainer the effort of going through the SVN log when researching a change. (Again, I didn't get to this for 3.0. GvR.) @@ -819,7 +819,7 @@ need it; however, 99 percent of the time an explicit :keyword:`for` loop is more readable. -* Removed :func:`reload`. Use :func:`imp.reload`. +* Removed :func:`reload`. Use :func:`imp.reload`. * Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator instead. From python-checkins at python.org Sun Jan 4 01:04:50 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 4 Jan 2009 01:04:50 +0100 (CET) Subject: [Python-checkins] r68276 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090104000450.279481E400C@bag.python.org> Author: tarek.ziade Date: Sun Jan 4 01:04:49 2009 New Revision: 68276 Log: fixed #1702551: distutils sdist was not pruning VCS directories under win32 Added: python/trunk/Lib/distutils/tests/test_sdist.py (contents, props changed) Modified: python/trunk/Lib/distutils/command/sdist.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Sun Jan 4 01:04:49 2009 @@ -7,6 +7,7 @@ __revision__ = "$Id$" import os, string +import sys from types import * from glob import glob from distutils.core import Command @@ -354,8 +355,13 @@ self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) + # pruning out vcs directories + # both separators are used under win32 + seps = sys.platform == 'win32' and r'/|\\' or '/' + vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in Added: python/trunk/Lib/distutils/tests/test_sdist.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_sdist.py Sun Jan 4 01:04:49 2009 @@ -0,0 +1,110 @@ +"""Tests for distutils.command.sdist.""" +import os +import unittest +import shutil +import zipfile +from os.path import join + +from distutils.command.sdist import sdist +from distutils.core import Distribution +from distutils.tests.test_config import PyPIRCCommandTestCase + +CURDIR = os.path.dirname(__file__) +TEMP_PKG = join(CURDIR, 'temppkg') + +SETUP_PY = """ +from distutils.core import setup +import somecode + +setup(name='fake') +""" + +MANIFEST_IN = """ +recursive-include somecode * +""" + +class sdistTestCase(PyPIRCCommandTestCase): + + def setUp(self): + PyPIRCCommandTestCase.setUp(self) + self.old_path = os.getcwd() + + def tearDown(self): + os.chdir(self.old_path) + if os.path.exists(TEMP_PKG): + shutil.rmtree(TEMP_PKG) + PyPIRCCommandTestCase.tearDown(self) + + def _write(self, path, content): + f = open(path, 'w') + try: + f.write(content) + finally: + f.close() + + def test_prune_file_list(self): + # this test creates a package with some vcs dirs in it + # and launch sdist to make sure they get pruned + # on all systems + if not os.path.exists(TEMP_PKG): + os.mkdir(TEMP_PKG) + os.mkdir(join(TEMP_PKG, 'somecode')) + + # 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) + + # 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(TEMP_PKG, 'somecode', '.hg')) + self._write(join(TEMP_PKG, 'somecode', '.hg', + 'ok'), 'xxx') + + os.mkdir(join(TEMP_PKG, 'somecode', '.git')) + self._write(join(TEMP_PKG, 'somecode', '.git', + 'ok'), 'xxx') + + os.chdir(TEMP_PKG) + + # 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' + + # zip is available universally + # (tar might not be installed under win32) + cmd.formats = ['zip'] + cmd.run() + + # now let's check what we have + dist_folder = join(TEMP_PKG, '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 has been pruned correctly + self.assertEquals(len(content), 4) + +def test_suite(): + return unittest.makeSuite(sdistTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 4 01:04:49 2009 @@ -108,6 +108,9 @@ Library ------- +- Issue #1702551: distutils sdist was not excluding VCS directories under + Windows. Inital solution by Guy Dalberto. + - The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x From python-checkins at python.org Sun Jan 4 01:05:25 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:05:25 +0100 (CET) Subject: [Python-checkins] r68277 - in python/branches/release30-maint: Doc/Makefile Doc/tools/rstlint.py Message-ID: <20090104000525.C4DB11E403A@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:05:25 2009 New Revision: 68277 Log: Merged revisions 68228 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68228 | georg.brandl | 2009-01-03 22:30:40 +0100 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68222 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines Disable the line length checker by default. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/Makefile python/branches/release30-maint/Doc/tools/rstlint.py Modified: python/branches/release30-maint/Doc/Makefile ============================================================================== --- python/branches/release30-maint/Doc/Makefile (original) +++ python/branches/release30-maint/Doc/Makefile Sun Jan 4 01:05:25 2009 @@ -142,4 +142,4 @@ cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 check: - $(PYTHON) tools/rstlint.py -i tools -s 2 + $(PYTHON) tools/rstlint.py -i tools Modified: python/branches/release30-maint/Doc/tools/rstlint.py ============================================================================== --- python/branches/release30-maint/Doc/tools/rstlint.py (original) +++ python/branches/release30-maint/Doc/tools/rstlint.py Sun Jan 4 01:05:25 2009 @@ -91,7 +91,6 @@ @checker('.py', '.rst') def check_whitespace(fn, lines): """Check for whitespace and line length issues.""" - lasti = 0 for lno, line in enumerate(lines): if '\r' in line: yield lno+1, '\\r in line' @@ -99,7 +98,13 @@ yield lno+1, 'OMG TABS!!!1' if line[:-1].rstrip(' \t') != line[:-1]: yield lno+1, 'trailing whitespace' - if len(line) > 86: + + + at checker('.rst', severity=0) +def check_line_length(fn, lines): + """Check for line length; this checker is not run by default.""" + for lno, line in enumerate(lines): + if len(line) > 81: # don't complain about tables, links and function signatures if line.lstrip()[0] not in '+|' and \ 'http://' not in line and \ From python-checkins at python.org Sun Jan 4 01:06:17 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:06:17 +0100 (CET) Subject: [Python-checkins] r68278 - in python/branches/release30-maint: Doc/extending/newtypes.rst Doc/howto/regex.rst Doc/library/bdb.rst Doc/library/urllib.request.rst Doc/library/xmlrpc.client.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tutorial/classes.rst Doc/tutorial/datastructures.rst Doc/using/unix.rst Doc/whatsnew/2.4.rst Message-ID: <20090104000617.9F0911E400C@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:06:17 2009 New Revision: 68278 Log: Merged revisions 68229 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r68229 | georg.brandl | 2009-01-03 22:31:47 +0100 (Sat, 03 Jan 2009) | 2 lines Fix a few remaining problems found by rstlint. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/extending/newtypes.rst python/branches/release30-maint/Doc/howto/regex.rst python/branches/release30-maint/Doc/library/bdb.rst python/branches/release30-maint/Doc/library/urllib.request.rst python/branches/release30-maint/Doc/library/xmlrpc.client.rst python/branches/release30-maint/Doc/reference/lexical_analysis.rst python/branches/release30-maint/Doc/reference/simple_stmts.rst python/branches/release30-maint/Doc/tutorial/classes.rst python/branches/release30-maint/Doc/tutorial/datastructures.rst python/branches/release30-maint/Doc/using/unix.rst python/branches/release30-maint/Doc/whatsnew/2.4.rst 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 Sun Jan 4 01:06:17 2009 @@ -1216,7 +1216,7 @@ PyErr_Format(PyExc_AttributeError, "'%.50s' object has no attribute '%.400s'", - tp->tp_name, name); + tp->tp_name, name); return NULL; } Modified: python/branches/release30-maint/Doc/howto/regex.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/regex.rst (original) +++ python/branches/release30-maint/Doc/howto/regex.rst Sun Jan 4 01:06:17 2009 @@ -611,7 +611,7 @@ is to read? :: charref = re.compile(r""" - &[#] # Start of a numeric entity reference + &[#] # Start of a numeric entity reference ( 0[0-7]+ # Octal form | [0-9]+ # Decimal form Modified: python/branches/release30-maint/Doc/library/bdb.rst ============================================================================== --- python/branches/release30-maint/Doc/library/bdb.rst (original) +++ python/branches/release30-maint/Doc/library/bdb.rst Sun Jan 4 01:06:17 2009 @@ -335,7 +335,7 @@ Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. - + Called only if we know there is a breakpoint at this location. Returns the breakpoint that was triggered and a flag that indicates if it is ok to delete a temporary breakpoint. Modified: python/branches/release30-maint/Doc/library/urllib.request.rst ============================================================================== --- python/branches/release30-maint/Doc/library/urllib.request.rst (original) +++ python/branches/release30-maint/Doc/library/urllib.request.rst Sun Jan 4 01:06:17 2009 @@ -49,8 +49,8 @@ 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 `ProxyHandler` - objects. + as a dict parameter to urlopen can be availed by the use of + :class:`ProxyHandler` objects. .. function:: install_opener(opener) Modified: python/branches/release30-maint/Doc/library/xmlrpc.client.rst ============================================================================== --- python/branches/release30-maint/Doc/library/xmlrpc.client.rst (original) +++ python/branches/release30-maint/Doc/library/xmlrpc.client.rst Sun Jan 4 01:06:17 2009 @@ -513,8 +513,8 @@ self.proxy = proxy def make_connection(self, host): self.realhost = host - h = http.client.HTTP(self.proxy) - return h + h = http.client.HTTP(self.proxy) + return h def send_request(self, connection, handler, request_body): connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) def send_host(self, connection, host): Modified: python/branches/release30-maint/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/lexical_analysis.rst (original) +++ python/branches/release30-maint/Doc/reference/lexical_analysis.rst Sun Jan 4 01:06:17 2009 @@ -608,7 +608,7 @@ 7 2147483647 0o177 0b100110111 3 79228162514264337593543950336 0o377 0x100000000 - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: 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 Sun Jan 4 01:06:17 2009 @@ -871,8 +871,8 @@ nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)* .. XXX add when implemented - : ["=" (`target_list` "=")+ `expression_list`] - : | "nonlocal" `identifier` `augop` `expression_list` + : ["=" (`target_list` "=")+ expression_list] + : | "nonlocal" identifier augop expression_list The :keyword:`nonlocal` statement causes the listed identifiers to refer to previously bound variables in the nearest enclosing scope. This is important Modified: python/branches/release30-maint/Doc/tutorial/classes.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/classes.rst (original) +++ python/branches/release30-maint/Doc/tutorial/classes.rst Sun Jan 4 01:06:17 2009 @@ -789,7 +789,7 @@ f l o - g + g Anything that can be done with generators can also be done with class based iterators as described in the previous section. What makes generators so Modified: python/branches/release30-maint/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/datastructures.rst (original) +++ python/branches/release30-maint/Doc/tutorial/datastructures.rst Sun Jan 4 01:06:17 2009 @@ -519,7 +519,7 @@ >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print('What is your {0}? It is {1}.'.format(q, a)) - ... + ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. @@ -542,7 +542,7 @@ >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print(f) - ... + ... apple banana orange Modified: python/branches/release30-maint/Doc/using/unix.rst ============================================================================== --- python/branches/release30-maint/Doc/using/unix.rst (original) +++ python/branches/release30-maint/Doc/using/unix.rst Sun Jan 4 01:06:17 2009 @@ -19,7 +19,7 @@ package on all others. However there are certain features you might want to use that are not available on your distro's package. You can easily compile the latest version of Python from source. - + In the event that Python doesn't come preinstalled and isn't in the repositories as well, you can easily make packages for your own distro. Have a look at the following links: @@ -46,7 +46,7 @@ * OpenBSD users use:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz - + For example i386 users get the 2.5.1 version of Python using:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz Modified: python/branches/release30-maint/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.4.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.4.rst Sun Jan 4 01:06:17 2009 @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that From python-checkins at python.org Sun Jan 4 01:07:14 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 4 Jan 2009 01:07:14 +0100 (CET) Subject: [Python-checkins] r68279 - in python/branches/release26-maint: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090104000714.8EB771E4026@bag.python.org> Author: tarek.ziade Date: Sun Jan 4 01:07:14 2009 New Revision: 68279 Log: Merged revisions 68276 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68276 | tarek.ziade | 2009-01-04 01:04:49 +0100 (Sun, 04 Jan 2009) | 1 line fixed #1702551: distutils sdist was not pruning VCS directories under win32 ........ Added: python/branches/release26-maint/Lib/distutils/tests/test_sdist.py - copied unchanged from r68276, /python/trunk/Lib/distutils/tests/test_sdist.py Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/sdist.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/command/sdist.py Sun Jan 4 01:07:14 2009 @@ -7,6 +7,7 @@ __revision__ = "$Id$" import os, string +import sys from types import * from glob import glob from distutils.core import Command @@ -354,8 +355,13 @@ self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) + # pruning out vcs directories + # both separators are used under win32 + seps = sys.platform == 'win32' and r'/|\\' or '/' + vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun Jan 4 01:07:14 2009 @@ -158,6 +158,9 @@ Library ------- +- Issue #1702551: distutils sdist was not excluding VCS directories under + Windows. Inital solution by Guy Dalberto. + - Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) From python-checkins at python.org Sun Jan 4 01:08:31 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:08:31 +0100 (CET) Subject: [Python-checkins] r68280 - in python/branches/release30-maint: Doc/library/itertools.rst Doc/license.rst LICENSE Lib/inspect.py Lib/test/test_struct.py Makefile.pre.in Misc/NEWS Modules/_collectionsmodule.c Modules/_struct.c Python/getcopyright.c README configure configure.in Message-ID: <20090104000831.EC7F51E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:08:31 2009 New Revision: 68280 Log: Merged revisions 68245 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68245 | georg.brandl | 2009-01-03 23:33:39 +0100 (Sat, 03 Jan 2009) | 49 lines Merged revisions 68112,68115,68120,68133,68141-68142,68145-68146,68148-68149 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line #4795 inspect.isgeneratorfunction() should return False instead of None ........ r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line simplfy code ........ r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines #4228: Pack negative values the same way as 2.4 in struct's L format. ........ r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line fill in actual issue number in tests ........ r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line fix highlighting ........ r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines welcome to 2009, Python! ........ r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. ........ r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4472: "configure --enable-shared doesn't work on OSX" ........ r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines Forgot to add a NEWS item in my previous checkin ........ r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4780 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Doc/license.rst python/branches/release30-maint/LICENSE python/branches/release30-maint/Lib/inspect.py python/branches/release30-maint/Lib/test/test_struct.py python/branches/release30-maint/Makefile.pre.in python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_collectionsmodule.c python/branches/release30-maint/Modules/_struct.c python/branches/release30-maint/Python/getcopyright.c python/branches/release30-maint/README python/branches/release30-maint/configure python/branches/release30-maint/configure.in 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 Sun Jan 4 01:08:31 2009 @@ -466,7 +466,7 @@ .. doctest:: - # Show a dictionary sorted and grouped by value + >>> # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.items(), key=itemgetter(1)) @@ -477,9 +477,9 @@ 2 ['b', 'd', 'f'] 3 ['g'] - # Find runs of consecutive numbers using groupby. The key to the solution - # is differencing with a range so that consecutive numbers all appear in - # same group. + >>> # Find runs of consecutive numbers using groupby. The key to the solution + >>> # is differencing with a range so that consecutive numbers all appear in + >>> # same group. >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]): ... print(map(operator.itemgetter(1), g)) Modified: python/branches/release30-maint/Doc/license.rst ============================================================================== --- python/branches/release30-maint/Doc/license.rst (original) +++ python/branches/release30-maint/Doc/license.rst Sun Jan 4 01:08:31 2009 @@ -124,7 +124,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ? 2001-2008 Python Software Foundation; All Rights + copyright, i.e., "Copyright ? 2001-2009 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. Modified: python/branches/release30-maint/LICENSE ============================================================================== --- python/branches/release30-maint/LICENSE (original) +++ python/branches/release30-maint/LICENSE Sun Jan 4 01:08:31 2009 @@ -89,15 +89,14 @@ otherwise using this software ("Python") in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative -version prepared by Licensee. +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python +Software Foundation; All Rights Reserved" are retained in Python alone or in any +derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/branches/release30-maint/Lib/inspect.py ============================================================================== --- python/branches/release30-maint/Lib/inspect.py (original) +++ python/branches/release30-maint/Lib/inspect.py Sun Jan 4 01:08:31 2009 @@ -158,9 +158,8 @@ Generator function objects provides same attributes as functions. See isfunction.__doc__ for attributes listing.""" - if (isfunction(object) or ismethod(object)) and \ - object.__code__.co_flags & CO_GENERATOR: - return True + return bool((isfunction(object) or ismethod(object)) and + object.__code__.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. Modified: python/branches/release30-maint/Lib/test/test_struct.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_struct.py (original) +++ python/branches/release30-maint/Lib/test/test_struct.py Sun Jan 4 01:08:31 2009 @@ -2,6 +2,8 @@ import unittest import struct import warnings +warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated", + DeprecationWarning) from functools import wraps from test.support import TestFailed, verbose, run_unittest @@ -469,6 +471,11 @@ self.check_float_coerce(endian + fmt, 1.0) self.check_float_coerce(endian + fmt, 1.5) + def test_issue4228(self): + # Packing a long may yield either 32 or 64 bits + x = struct.pack('L', -1)[:4] + self.assertEqual(x, b'\xff'*4) + def test_unpack_from(self): test_string = b'abcd01234' fmt = '4s' Modified: python/branches/release30-maint/Makefile.pre.in ============================================================================== --- python/branches/release30-maint/Makefile.pre.in (original) +++ python/branches/release30-maint/Makefile.pre.in Sun Jan 4 01:08:31 2009 @@ -412,10 +412,14 @@ if test $(INSTSONAME) != $(LDLIBRARY); then \ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ - else\ + else \ $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi +libpython$(VERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) @@ -773,13 +777,13 @@ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) - if test -f libpython$(VERSION)$(SO); then \ + if test -f $(LDLIBRARY); then \ if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ else \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ - if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ - (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 01:08:31 2009 @@ -80,6 +80,9 @@ - Issue 4790: The nsmallest() and nlargest() functions in the heapq module did unnecessary work in the common case where no key function was specified. +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey. @@ -151,9 +154,48 @@ - Issue #4677: add two list comprehension tests to pybench. + +Build +----- + +- Issue #4472: "configure --enable-shared" now works on OSX + +- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. + +- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". + +- Issue #4289: Remove Cancel button from AdvancedDlg. + +- Issue #1656675: Register a drop handler for .py* files on Windows. + +- Issue #4120: Exclude manifest from extension modules in VS2008. + +- Issue #4091: Install pythonxy.dll in system32 again. + +- Issue #4018: Disable "for me" installations on Vista. + +- Issue #3758: Add ``patchcheck`` build target to .PHONY. + +- Issue #4204: Fixed module build errors on FreeBSD 4. + + +C-API +----- + +- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. + +- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when + the GIL is released, or owned by another thread. + +- Issue #4122: On Windows, fix a compilation error when using the + Py_UNICODE_ISSPACE macro in an extension module. + + Extension Modules ----------------- +- Issue #4228: Pack negative values the same way as 2.4 in struct's L format. + - Issue #1040026: Fix os.times result on systems where HZ is incorrect. - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, @@ -163,6 +205,7 @@ has been exported, resulting in an interpreter crash when accessing the buffer. + What's New in Python 3.0 final ============================== Modified: python/branches/release30-maint/Modules/_collectionsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_collectionsmodule.c (original) +++ python/branches/release30-maint/Modules/_collectionsmodule.c Sun Jan 4 01:08:31 2009 @@ -909,7 +909,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } @@ -1019,7 +1019,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } Modified: python/branches/release30-maint/Modules/_struct.c ============================================================================== --- python/branches/release30-maint/Modules/_struct.c (original) +++ python/branches/release30-maint/Modules/_struct.c Sun Jan 4 01:08:31 2009 @@ -661,7 +661,7 @@ return -1; #if (SIZEOF_LONG > SIZEOF_INT) if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX))) - return _range_error(f, 0); + RANGE_ERROR(x, f, 0, -1); #endif y = (int)x; memcpy(p, (char *)&y, sizeof y); @@ -673,12 +673,12 @@ { unsigned long x; unsigned int y; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; y = (unsigned int)x; #if (SIZEOF_LONG > SIZEOF_INT) if (x > ((unsigned long)UINT_MAX)) - return _range_error(f, 1); + RANGE_ERROR(y, f, 1, -1); #endif memcpy(p, (char *)&y, sizeof y); return 0; @@ -698,8 +698,8 @@ np_ulong(char *p, PyObject *v, const formatdef *f) { unsigned long x; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; memcpy(p, (char *)&x, sizeof x); return 0; } Modified: python/branches/release30-maint/Python/getcopyright.c ============================================================================== --- python/branches/release30-maint/Python/getcopyright.c (original) +++ python/branches/release30-maint/Python/getcopyright.c Sun Jan 4 01:08:31 2009 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ Modified: python/branches/release30-maint/README ============================================================================== --- python/branches/release30-maint/README (original) +++ python/branches/release30-maint/README Sun Jan 4 01:08:31 2009 @@ -2,7 +2,7 @@ ================================ For notes specific to this release, see RELNOTES in this directory. -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. Modified: python/branches/release30-maint/configure ============================================================================== --- python/branches/release30-maint/configure (original) +++ python/branches/release30-maint/configure Sun Jan 4 01:08:31 2009 @@ -4085,6 +4085,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -12915,6 +12921,7 @@ { echo "$as_me:$LINENO: result: $SO" >&5 echo "${ECHO_T}$SO" >&6; } + cat >>confdefs.h <<_ACEOF #define SHLIB_EXT "$SO" _ACEOF @@ -13311,7 +13318,7 @@ fi # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } Modified: python/branches/release30-maint/configure.in ============================================================================== --- python/branches/release30-maint/configure.in (original) +++ python/branches/release30-maint/configure.in Sun Jan 4 01:08:31 2009 @@ -693,6 +693,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -1527,6 +1533,7 @@ sleep 10 fi AC_MSG_RESULT($SO) + AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 From python-checkins at python.org Sun Jan 4 01:09:41 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:09:41 +0100 (CET) Subject: [Python-checkins] r68281 - in python/branches/release30-maint: Doc/ACKS.txt Doc/c-api/arg.rst Doc/c-api/structures.rst Doc/distutils/apiref.rst Doc/howto/functional.rst Doc/howto/urllib2.rst Doc/install/index.rst Doc/library/email.mime.rst Doc/library/gzip.rst Doc/library/http.cookiejar.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/numbers.rst Doc/library/parser.rst Doc/library/smtplib.rst Doc/library/urllib.parse.rst Doc/tutorial/inputoutput.rst Doc/using/cmdline.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.7.rst Makefile.pre.in Parser/asdl.py Message-ID: <20090104000941.A07CE1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:09:41 2009 New Revision: 68281 Log: Merged revisions 68247 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68247 | georg.brandl | 2009-01-03 23:47:39 +0100 (Sat, 03 Jan 2009) | 39 lines Merged revisions 68162,68166,68171,68176,68195-68196,68210,68232 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68162 | ronald.oussoren | 2009-01-02 16:06:00 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 4472 is incompatible with Cygwin, this patch should fix that. ........ r68166 | benjamin.peterson | 2009-01-02 19:26:23 +0100 (Fri, 02 Jan 2009) | 1 line document PyMemberDef ........ r68171 | georg.brandl | 2009-01-02 21:25:14 +0100 (Fri, 02 Jan 2009) | 3 lines #4811: fix markup glitches (mostly remains of the conversion), found by Gabriel Genellina. ........ r68176 | andrew.kuchling | 2009-01-02 22:00:35 +0100 (Fri, 02 Jan 2009) | 1 line Add various items ........ r68195 | georg.brandl | 2009-01-03 14:45:15 +0100 (Sat, 03 Jan 2009) | 2 lines Remove useless string literal. ........ r68196 | georg.brandl | 2009-01-03 15:29:53 +0100 (Sat, 03 Jan 2009) | 2 lines Fix indentation. ........ r68210 | georg.brandl | 2009-01-03 20:10:12 +0100 (Sat, 03 Jan 2009) | 2 lines Set eol-style correctly for mp_distributing.py. ........ r68232 | georg.brandl | 2009-01-03 22:52:16 +0100 (Sat, 03 Jan 2009) | 2 lines Grammar fix. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/ACKS.txt python/branches/release30-maint/Doc/c-api/arg.rst python/branches/release30-maint/Doc/c-api/structures.rst python/branches/release30-maint/Doc/distutils/apiref.rst python/branches/release30-maint/Doc/howto/functional.rst python/branches/release30-maint/Doc/howto/urllib2.rst python/branches/release30-maint/Doc/install/index.rst python/branches/release30-maint/Doc/library/email.mime.rst python/branches/release30-maint/Doc/library/gzip.rst python/branches/release30-maint/Doc/library/http.cookiejar.rst python/branches/release30-maint/Doc/library/json.rst python/branches/release30-maint/Doc/library/multiprocessing.rst python/branches/release30-maint/Doc/library/numbers.rst python/branches/release30-maint/Doc/library/parser.rst python/branches/release30-maint/Doc/library/smtplib.rst python/branches/release30-maint/Doc/library/urllib.parse.rst python/branches/release30-maint/Doc/tutorial/inputoutput.rst python/branches/release30-maint/Doc/using/cmdline.rst python/branches/release30-maint/Doc/whatsnew/2.4.rst python/branches/release30-maint/Doc/whatsnew/2.5.rst python/branches/release30-maint/Doc/whatsnew/2.7.rst python/branches/release30-maint/Makefile.pre.in python/branches/release30-maint/Parser/asdl.py Modified: python/branches/release30-maint/Doc/ACKS.txt ============================================================================== --- python/branches/release30-maint/Doc/ACKS.txt (original) +++ python/branches/release30-maint/Doc/ACKS.txt Sun Jan 4 01:09:41 2009 @@ -60,6 +60,7 @@ * Peter Funk * Lele Gaifax * Matthew Gallagher + * Gabriel Genellina * Ben Gertzfield * Nadim Ghaznavi * Jonathan Giddy Modified: python/branches/release30-maint/Doc/c-api/arg.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/arg.rst (original) +++ python/branches/release30-maint/Doc/c-api/arg.rst Sun Jan 4 01:09:41 2009 @@ -53,8 +53,9 @@ string may contain embedded null bytes. Unicode objects pass back a pointer to the default encoded string version of the object if such a conversion is possible. All other read-buffer compatible objects pass back a reference to - the raw internal data representation. Since this format doesn't allow writable buffer compatible objects like byte - arrays, ``s*`` is to be preferred. + the raw internal data representation. Since this format doesn't allow + writable buffer compatible objects like byte arrays, ``s*`` is to be + preferred. The type of the length argument (int or :ctype:`Py_ssize_t`) is controlled by defining the macro :cmacro:`PY_SSIZE_T_CLEAN` before including Modified: python/branches/release30-maint/Doc/c-api/structures.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/structures.rst (original) +++ python/branches/release30-maint/Doc/c-api/structures.rst Sun Jan 4 01:09:41 2009 @@ -198,3 +198,64 @@ object and will co-exist with the slot. This is helpful because calls to PyCFunctions are optimized more than wrapper object calls. + +.. ctype:: PyMemberDef + + Structure which describes an attribute of a type which corresponds to a C + struct member. Its fields are: + + +------------------+-------------+-------------------------------+ + | Field | C Type | Meaning | + +==================+=============+===============================+ + | :attr:`name` | char \* | name of the member | + +------------------+-------------+-------------------------------+ + | :attr:`type` | int | the type of the member in the | + | | | C struct | + +------------------+-------------+-------------------------------+ + | :attr:`offset` | Py_ssize_t | the offset in bytes that the | + | | | member is located on the | + | | | type's object struct | + +------------------+-------------+-------------------------------+ + | :attr:`flags` | int | flag bits indicating if the | + | | | field should be read-only or | + | | | writable | + +------------------+-------------+-------------------------------+ + | :attr:`doc` | char \* | points to the contents of the | + | | | docstring | + +------------------+-------------+-------------------------------+ + + :attr:`type` can be one of many ``T_`` macros corresponding to various C + types. When the member is accessed in Python, it will be converted to the + equivalent Python type. + + =============== ================== + Macro name C type + =============== ================== + T_SHORT short + T_INT int + T_LONG long + T_FLOAT float + T_DOUBLE double + T_STRING char \* + T_OBJECT PyObject \* + T_OBJECT_EX PyObject \* + T_CHAR char + T_BYTE char + T_UNBYTE unsigned char + T_UINT unsigned int + T_USHORT unsigned short + T_ULONG unsigned long + T_BOOL char + T_LONGLONG long long + T_ULONGLONG unsigned long long + T_PYSSIZET Py_ssize_t + =============== ================== + + :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that + :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and + :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. + + :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for + read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` + members can be deleted. (They are set to *NULL*). Modified: python/branches/release30-maint/Doc/distutils/apiref.rst ============================================================================== --- python/branches/release30-maint/Doc/distutils/apiref.rst (original) +++ python/branches/release30-maint/Doc/distutils/apiref.rst Sun Jan 4 01:09:41 2009 @@ -188,9 +188,10 @@ | | for C/C++ header files (in | | | | Unix form for portability) | | +------------------------+--------------------------------+---------------------------+ - | *define_macros* | list of macros to define; each | (string,string) tuple or | - | | macro is defined using a | (name,``None``) | - | | 2-tuple, where 'value' is | | + | *define_macros* | list of macros to define; each | (string, string) tuple or | + | | macro is defined using a | (name, ``None``) | + | | 2-tuple ``(name, value)``, | | + | | where *value* is | | | | either the string to define it | | | | to or ``None`` to define it | | | | without a particular value | | Modified: python/branches/release30-maint/Doc/howto/functional.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/functional.rst (original) +++ python/branches/release30-maint/Doc/howto/functional.rst Sun Jan 4 01:09:41 2009 @@ -586,7 +586,7 @@ 9 >>> next(it) Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? it.next() StopIteration Modified: python/branches/release30-maint/Doc/howto/urllib2.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/urllib2.rst (original) +++ python/branches/release30-maint/Doc/howto/urllib2.rst Sun Jan 4 01:09:41 2009 @@ -475,7 +475,7 @@ password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. - # If we knew the realm, we could use it instead of ``None``. + # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) Modified: python/branches/release30-maint/Doc/install/index.rst ============================================================================== --- python/branches/release30-maint/Doc/install/index.rst (original) +++ python/branches/release30-maint/Doc/install/index.rst Sun Jan 4 01:09:41 2009 @@ -584,7 +584,7 @@ $ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 - Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. + Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', Modified: python/branches/release30-maint/Doc/library/email.mime.rst ============================================================================== --- python/branches/release30-maint/Doc/library/email.mime.rst (original) +++ python/branches/release30-maint/Doc/library/email.mime.rst Sun Jan 4 01:09:41 2009 @@ -55,14 +55,14 @@ .. currentmodule:: email.mime.multipart -.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) +.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A - :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be + :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added. Modified: python/branches/release30-maint/Doc/library/gzip.rst ============================================================================== --- python/branches/release30-maint/Doc/library/gzip.rst (original) +++ python/branches/release30-maint/Doc/library/gzip.rst Sun Jan 4 01:09:41 2009 @@ -7,7 +7,7 @@ This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would. -The data compression is provided by the :mod:``zlib`` module. +The data compression is provided by the :mod:`zlib` module. The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled after Python's File Object. The :class:`GzipFile` class reads and writes Modified: python/branches/release30-maint/Doc/library/http.cookiejar.rst ============================================================================== --- python/branches/release30-maint/Doc/library/http.cookiejar.rst (original) +++ python/branches/release30-maint/Doc/library/http.cookiejar.rst Sun Jan 4 01:09:41 2009 @@ -704,7 +704,7 @@ The :class:`Cookie` class also defines the following method: -.. method:: Cookie.is_expired([now=:const:`None`]) +.. method:: Cookie.is_expired([now=None]) True if cookie has passed the time at which the server requested it should expire. If *now* is given (in seconds since the epoch), return whether the Modified: python/branches/release30-maint/Doc/library/json.rst ============================================================================== --- python/branches/release30-maint/Doc/library/json.rst (original) +++ python/branches/release30-maint/Doc/library/json.rst Sun Jan 4 01:09:41 2009 @@ -151,7 +151,7 @@ *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. - To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the + To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the *cls* kwarg. Modified: python/branches/release30-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release30-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release30-maint/Doc/library/multiprocessing.rst Sun Jan 4 01:09:41 2009 @@ -107,12 +107,12 @@ def f(q): q.put([42, None, 'hello']) - if __name__ == '__main__': - q = Queue() - p = Process(target=f, args=(q,)) - p.start() - print(q.get()) # prints "[42, None, 'hello']" - p.join() + if __name__ == '__main__': + q = Queue() + p = Process(target=f, args=(q,)) + p.start() + print(q.get()) # prints "[42, None, 'hello']" + p.join() Queues are thread and process safe. @@ -1136,18 +1136,18 @@ Returns a :class:`Server` object which represents the actual server under the control of the Manager. The :class:`Server` object supports the - :meth:`serve_forever` method:: + :meth:`serve_forever` method: - >>> from multiprocessing.managers import BaseManager - >>> m = BaseManager(address=('', 50000), authkey='abc')) - >>> server = m.get_server() - >>> s.serve_forever() + >>> from multiprocessing.managers import BaseManager + >>> m = BaseManager(address=('', 50000), authkey='abc')) + >>> server = m.get_server() + >>> s.serve_forever() - :class:`Server` additionally have an :attr:`address` attribute. + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - Connect a local manager object to a remote manager process:: + Connect a local manager object to a remote manager process: >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) @@ -1293,7 +1293,7 @@ >>>>>>>>>>>>>>>>>>> To create one's own manager, one creates a subclass of :class:`BaseManager` and -use the :meth:`~BaseManager.resgister` classmethod to register new types or +use the :meth:`~BaseManager.register` classmethod to register new types or callables with the manager class. For example:: from multiprocessing.managers import BaseManager @@ -1809,7 +1809,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named - pipe on a remote computer called ServerName* one should use an address of the + pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. Note that any string beginning with two backslashes is assumed by default to be Modified: python/branches/release30-maint/Doc/library/numbers.rst ============================================================================== --- python/branches/release30-maint/Doc/library/numbers.rst (original) +++ python/branches/release30-maint/Doc/library/numbers.rst Sun Jan 4 01:09:41 2009 @@ -49,14 +49,14 @@ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``. - Real also provides defaults for :func:`complex`, :attr:`Complex.real`, - :attr:`Complex.imag`, and :meth:`Complex.conjugate`. + Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, + :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. .. class:: Rational Subtypes :class:`Real` and adds - :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which + :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which should be in lowest terms. With these, it provides a default for :func:`float`. @@ -72,8 +72,8 @@ .. class:: Integral Subtypes :class:`Rational` and adds a conversion to :class:`int`. - Provides defaults for :func:`float`, :attr:`Rational.numerator`, and - :attr:`Rational.denominator`, and bit-string operations: ``<<``, + Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and + :attr:`~Rational.denominator`, and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``. @@ -169,7 +169,7 @@ knowledge of ``A``, so it can handle those instances before delegating to :class:`Complex`. -If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, +If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``. Modified: python/branches/release30-maint/Doc/library/parser.rst ============================================================================== --- python/branches/release30-maint/Doc/library/parser.rst (original) +++ python/branches/release30-maint/Doc/library/parser.rst Sun Jan 4 01:09:41 2009 @@ -635,7 +635,7 @@ while the long form uses an indented block and allows nested definitions:: def make_power(exp): - "Make a function that raises an argument to the exponent `exp'." + "Make a function that raises an argument to the exponent `exp`." def raiser(x, y=exp): return x ** y return raiser Modified: python/branches/release30-maint/Doc/library/smtplib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/smtplib.rst (original) +++ python/branches/release30-maint/Doc/library/smtplib.rst Sun Jan 4 01:09:41 2009 @@ -200,7 +200,7 @@ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. - :exc:SMTPHeloError + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. .. method:: SMTP.has_extn(name) Modified: python/branches/release30-maint/Doc/library/urllib.parse.rst ============================================================================== --- python/branches/release30-maint/Doc/library/urllib.parse.rst (original) +++ python/branches/release30-maint/Doc/library/urllib.parse.rst Sun Jan 4 01:09:41 2009 @@ -365,7 +365,7 @@ 'http://www.Python.org/doc/' -The following classes provide the implementations of the parse results:: +The following classes provide the implementations of the parse results: .. class:: BaseResult Modified: python/branches/release30-maint/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/inputoutput.rst (original) +++ python/branches/release30-maint/Doc/tutorial/inputoutput.rst Sun Jan 4 01:09:41 2009 @@ -151,7 +151,7 @@ other='Georg')) The story of Bill, Manfred, and Georg. -An optional ``':``` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This also greater control over how the value is formatted. The following example truncates the Pi to three places after the decimal. Modified: python/branches/release30-maint/Doc/using/cmdline.rst ============================================================================== --- python/branches/release30-maint/Doc/using/cmdline.rst (original) +++ python/branches/release30-maint/Doc/using/cmdline.rst Sun Jan 4 01:09:41 2009 @@ -343,7 +343,7 @@ compiled form). Extension modules cannot be imported from zipfiles. The default search path is installation dependent, but generally begins with - :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It + :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. An additional directory will be inserted in the search path in front of Modified: python/branches/release30-maint/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.4.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.4.rst Sun Jan 4 01:09:41 2009 @@ -1428,7 +1428,7 @@ you get the following output:: ********************************************************************** - File ``t.py'', line 15, in g + File "t.py", line 15, in g Failed example: g(4) Differences (unified diff with -expected +actual): 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 Sun Jan 4 01:09:41 2009 @@ -485,7 +485,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration 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 Sun Jan 4 01:09:41 2009 @@ -87,7 +87,23 @@ :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. -* To be written. +* 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 + error, or raises a :exc:`CalledProcessError` exception otherwise. + + :: + + >>> subprocess.check_output(['df', '-h', '.']) + 'Filesystem Size Used Avail Capacity Mounted on\n + /dev/disk0s2 52G 49G 3.0G 94% /\n' + + >>> subprocess.check_output(['df', '-h', '/bogus']) + ... + subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1 + + (Contributed by Gregory P. Smith.) + .. ====================================================================== .. whole new modules get described in subsections here @@ -100,13 +116,22 @@ Changes to Python's build process and to the C API include: -* To be written. +* 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`.) .. ====================================================================== Port-Specific Changes: Windows ----------------------------------- +* The :mod:`msvcrt` module now contains some constants from + the :file:`crtassem.h` header file: + :data:`CRT_ASSEMBLY_VERSION`, + :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`, + and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. + (Added by Martin von Loewis (XXX check); :issue:`4365`.) .. ====================================================================== Modified: python/branches/release30-maint/Makefile.pre.in ============================================================================== --- python/branches/release30-maint/Makefile.pre.in (original) +++ python/branches/release30-maint/Makefile.pre.in Sun Jan 4 01:09:41 2009 @@ -778,8 +778,8 @@ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) if test -f $(LDLIBRARY); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ Modified: python/branches/release30-maint/Parser/asdl.py ============================================================================== --- python/branches/release30-maint/Parser/asdl.py (original) +++ python/branches/release30-maint/Parser/asdl.py Sun Jan 4 01:09:41 2009 @@ -176,7 +176,7 @@ return Product(fields) def p_sum_0(self, constructor): - " sum ::= constructor """ + " sum ::= constructor " return [constructor[0]] def p_sum_1(self, info): From python-checkins at python.org Sun Jan 4 01:10:06 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:10:06 +0100 (CET) Subject: [Python-checkins] r68282 - python/branches/release30-maint Message-ID: <20090104001006.3A5511E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:10:04 2009 New Revision: 68282 Log: Blocked revisions 68241 via svnmerge ........ r68241 | georg.brandl | 2009-01-03 23:07:57 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r68096,68189 from 3.0 branch. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 01:12:50 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:12:50 +0100 (CET) Subject: [Python-checkins] r68283 - in python/branches/release30-maint: Doc/extending/newtypes.rst Doc/howto/curses.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/library/abc.rst Doc/library/collections.rst Doc/library/gettext.rst Doc/library/multiprocessing.rst Doc/library/optparse.rst Doc/library/sched.rst Doc/library/socket.rst Doc/tutorial/datastructures.rst Doc/tutorial/stdlib2.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.6.rst Message-ID: <20090104001250.251B81E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:12:49 2009 New Revision: 68283 Log: Merged revisions 68227 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ................ r68227 | georg.brandl | 2009-01-03 22:26:05 +0100 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68221 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines Remove tabs from the documentation. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/extending/newtypes.rst python/branches/release30-maint/Doc/howto/curses.rst python/branches/release30-maint/Doc/howto/regex.rst python/branches/release30-maint/Doc/howto/sockets.rst python/branches/release30-maint/Doc/howto/unicode.rst python/branches/release30-maint/Doc/library/abc.rst python/branches/release30-maint/Doc/library/collections.rst python/branches/release30-maint/Doc/library/gettext.rst python/branches/release30-maint/Doc/library/multiprocessing.rst python/branches/release30-maint/Doc/library/optparse.rst python/branches/release30-maint/Doc/library/sched.rst python/branches/release30-maint/Doc/library/socket.rst python/branches/release30-maint/Doc/tutorial/datastructures.rst python/branches/release30-maint/Doc/tutorial/stdlib2.rst python/branches/release30-maint/Doc/whatsnew/2.0.rst python/branches/release30-maint/Doc/whatsnew/2.2.rst python/branches/release30-maint/Doc/whatsnew/2.4.rst python/branches/release30-maint/Doc/whatsnew/2.6.rst 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 Sun Jan 4 01:12:49 2009 @@ -823,8 +823,8 @@ previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -837,10 +837,10 @@ static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -859,18 +859,18 @@ PyMODINIT_FUNC PyInit_shoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return NULL; - - m = PyModule_Create(&shoddymodule); - if (m == NULL) - return NULL; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return NULL; + + m = PyModule_Create(&shoddymodule); + if (m == NULL) + return NULL; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1113,7 +1113,7 @@ typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; Modified: python/branches/release30-maint/Doc/howto/curses.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/curses.rst (original) +++ python/branches/release30-maint/Doc/howto/curses.rst Sun Jan 4 01:12:49 2009 @@ -297,7 +297,7 @@ could code:: stdscr.addstr(0, 0, "Current mode: Typing mode", - curses.A_REVERSE) + curses.A_REVERSE) stdscr.refresh() The curses library also supports color on those terminals that provide it, The Modified: python/branches/release30-maint/Doc/howto/regex.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/regex.rst (original) +++ python/branches/release30-maint/Doc/howto/regex.rst Sun Jan 4 01:12:49 2009 @@ -917,7 +917,7 @@ InternalDate = re.compile(r'INTERNALDATE "' r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-' - r'(?P[0-9][0-9][0-9][0-9])' + r'(?P[0-9][0-9][0-9][0-9])' r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])' r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])' r'"') Modified: python/branches/release30-maint/Doc/howto/sockets.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/sockets.rst (original) +++ python/branches/release30-maint/Doc/howto/sockets.rst Sun Jan 4 01:12:49 2009 @@ -189,30 +189,30 @@ """ def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock def connect(self, host, port): self.sock.connect((host, port)) def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError("socket connection broken") - totalsent = totalsent + sent + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError("socket connection broken") + totalsent = totalsent + sent def myreceive(self): msg = '' while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError("socket connection broken") - msg = msg + chunk + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError("socket connection broken") + msg = msg + chunk return msg The sending code here is usable for almost any messaging scheme - in Python you Modified: python/branches/release30-maint/Doc/howto/unicode.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/unicode.rst (original) +++ python/branches/release30-maint/Doc/howto/unicode.rst Sun Jan 4 01:12:49 2009 @@ -32,8 +32,8 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHIER EST COMPLETE." - PRINT "CARACTERE NON ACCEPTE." + PRINT "FICHIER EST COMPLETE." + PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who can read French. @@ -91,11 +91,11 @@ character with value 0x12ca (4810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:: - 0061 'a'; LATIN SMALL LETTER A - 0062 'b'; LATIN SMALL LETTER B - 0063 'c'; LATIN SMALL LETTER C - ... - 007B '{'; LEFT CURLY BRACKET + 0061 'a'; LATIN SMALL LETTER A + 0062 'b'; LATIN SMALL LETTER B + 0063 'c'; LATIN SMALL LETTER C + ... + 007B '{'; LEFT CURLY BRACKET Strictly, these definitions imply that it's meaningless to say 'this is character U+12ca'. U+12ca is a code point, which represents some particular @@ -527,19 +527,19 @@ assuming the default filesystem encoding is UTF-8, running the following program:: - fn = 'filename\u4500abc' - f = open(fn, 'w') - f.close() - - import os - print(os.listdir(b'.')) - print(os.listdir('.')) + fn = 'filename\u4500abc' + f = open(fn, 'w') + f.close() + + import os + print(os.listdir(b'.')) + print(os.listdir('.')) will produce the following output:: - amk:~$ python t.py - [b'.svn', b'filename\xe4\x94\x80abc', ...] - ['.svn', 'filename\u4500abc', ...] + amk:~$ python t.py + [b'.svn', b'filename\xe4\x94\x80abc', ...] + ['.svn', 'filename\u4500abc', ...] The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions. @@ -636,26 +636,26 @@ - [ ] Unicode introduction - [ ] ASCII - [ ] Terms - - [ ] Character - - [ ] Code point - - [ ] Encodings - - [ ] Common encodings: ASCII, Latin-1, UTF-8 + - [ ] Character + - [ ] Code point + - [ ] Encodings + - [ ] Common encodings: ASCII, Latin-1, UTF-8 - [ ] Unicode Python type - - [ ] Writing unicode literals - - [ ] Obscurity: -U switch - - [ ] Built-ins - - [ ] unichr() - - [ ] ord() - - [ ] unicode() constructor - - [ ] Unicode type - - [ ] encode(), decode() methods + - [ ] Writing unicode literals + - [ ] Obscurity: -U switch + - [ ] Built-ins + - [ ] unichr() + - [ ] ord() + - [ ] unicode() constructor + - [ ] Unicode type + - [ ] encode(), decode() methods - [ ] Unicodedata module for character properties - [ ] I/O - - [ ] Reading/writing Unicode data into files - - [ ] Byte-order marks - - [ ] Unicode filenames + - [ ] Reading/writing Unicode data into files + - [ ] Byte-order marks + - [ ] Unicode filenames - [ ] Writing Unicode programs - - [ ] Do everything in Unicode - - [ ] Declaring source code encodings (PEP 263) + - [ ] Do everything in Unicode + - [ ] Declaring source code encodings (PEP 263) - [ ] Other issues - - [ ] Building Python (UCS2, UCS4) + - [ ] Building Python (UCS2, UCS4) 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 Sun Jan 4 01:12:49 2009 @@ -42,15 +42,15 @@ Register *subclass* as a "virtual subclass" of this ABC. For example:: - from abc import ABCMeta + from abc import ABCMeta - class MyABC(metaclass=ABCMeta): - pass + class MyABC(metaclass=ABCMeta): + pass - MyABC.register(tuple) + MyABC.register(tuple) - assert issubclass(tuple, MyABC) - assert isinstance((), MyABC) + assert issubclass(tuple, MyABC) + assert isinstance((), MyABC) You can also override this method in an abstract base class: 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 Sun Jan 4 01:12:49 2009 @@ -41,7 +41,7 @@ :class:`Hashable` ``__hash__`` :class:`Iterable` ``__iter__`` :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` -:class:`Sized` ``__len__`` +:class:`Sized` ``__len__`` :class:`Callable` ``__call__`` :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. @@ -68,7 +68,7 @@ :class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and ``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``, ``__delitem__``, and ``setdefault`` - ``__iter__``, and + ``__iter__``, and ``__len__`` :class:`MappingView` :class:`Sized` ``__len__`` @@ -84,7 +84,7 @@ size = None if isinstance(myvar, collections.Sized): - size = len(myvar) + size = len(myvar) Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting Modified: python/branches/release30-maint/Doc/library/gettext.rst ============================================================================== --- python/branches/release30-maint/Doc/library/gettext.rst (original) +++ python/branches/release30-maint/Doc/library/gettext.rst Sun Jan 4 01:12:49 2009 @@ -551,10 +551,9 @@ animals = ['mollusk', 'albatross', - 'rat', - 'penguin', - 'python', - ] + 'rat', + 'penguin', + 'python', ] # ... for a in animals: print(a) @@ -569,10 +568,9 @@ animals = [_('mollusk'), _('albatross'), - _('rat'), - _('penguin'), - _('python'), - ] + _('rat'), + _('penguin'), + _('python'), ] del _ @@ -595,10 +593,9 @@ animals = [N_('mollusk'), N_('albatross'), - N_('rat'), - N_('penguin'), - N_('python'), - ] + N_('rat'), + N_('penguin'), + N_('python'), ] # ... for a in animals: Modified: python/branches/release30-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release30-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release30-maint/Doc/library/multiprocessing.rst Sun Jan 4 01:12:49 2009 @@ -35,7 +35,7 @@ >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): - ... return x*x + ... return x*x ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: 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 Sun Jan 4 01:12:49 2009 @@ -543,8 +543,8 @@ :class:`OptionGroup` to a parser is easy:: group = OptionGroup(parser, "Dangerous Options", - "Caution: use these options at your own risk. " - "It is believed that some of them bite.") + "Caution: use these options at your own risk. " + "It is believed that some of them bite.") group.add_option("-g", action="store_true", help="Group option.") parser.add_option_group(group) @@ -558,12 +558,12 @@ -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --file=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' - [default], 'expert' + [default], 'expert' Dangerous Options: - Caution: use of these options is at your own risk. It is believed that - some of them bite. - -g Group option. + Caution: use of these options is at your own risk. It is believed that + some of them bite. + -g Group option. .. _optparse-printing-version-string: Modified: python/branches/release30-maint/Doc/library/sched.rst ============================================================================== --- python/branches/release30-maint/Doc/library/sched.rst (original) +++ python/branches/release30-maint/Doc/library/sched.rst Sun Jan 4 01:12:49 2009 @@ -58,7 +58,7 @@ ... print(time.time()) ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() - ... time.sleep(11) # sleep while time-delay events execute + ... time.sleep(11) # sleep while time-delay events execute ... print(time.time()) ... >>> print_some_times() Modified: python/branches/release30-maint/Doc/library/socket.rst ============================================================================== --- python/branches/release30-maint/Doc/library/socket.rst (original) +++ python/branches/release30-maint/Doc/library/socket.rst Sun Jan 4 01:12:49 2009 @@ -797,17 +797,17 @@ socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error as msg: - s = None - continue + s = None + continue try: - s.bind(sa) - s.listen(1) + s.bind(sa) + s.listen(1) except socket.error as msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print('could not open socket') @@ -832,16 +832,16 @@ for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error as msg: - s = None - continue + s = None + continue try: - s.connect(sa) + s.connect(sa) except socket.error as msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print('could not open socket') Modified: python/branches/release30-maint/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/datastructures.rst (original) +++ python/branches/release30-maint/Doc/tutorial/datastructures.rst Sun Jan 4 01:12:49 2009 @@ -195,7 +195,7 @@ Tuples can often be created without their parentheses, but not here:: - >>> [x, x**2 for x in vec] # error - parens required for tuples + >>> [x, x**2 for x in vec] # error - parens required for tuples File "", line 1, in ? [x, x**2 for x in vec] ^ Modified: python/branches/release30-maint/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/stdlib2.rst (original) +++ python/branches/release30-maint/Doc/tutorial/stdlib2.rst Sun Jan 4 01:12:49 2009 @@ -62,7 +62,7 @@ >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], - ... conv['frac_digits'], x), grouping=True) + ... conv['frac_digits'], x), grouping=True) '$1,234,567.80' Modified: python/branches/release30-maint/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.0.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.0.rst Sun Jan 4 01:12:49 2009 @@ -281,7 +281,7 @@ # containing the substring S. sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, - L) + L) Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` statement knows what @@ -293,7 +293,7 @@ [ expression for expr in sequence1 for expr2 in sequence2 ... - for exprN in sequenceN + for exprN in sequenceN if condition ] The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be @@ -368,7 +368,7 @@ def __init__(self, value): self.value = value def __iadd__(self, increment): - return Number( self.value + increment) + return Number( self.value + increment) n = Number(5) n += 3 @@ -852,13 +852,12 @@ from distutils.core import setup, Extension expat_extension = Extension('xml.parsers.pyexpat', - define_macros = [('XML_NS', None)], - include_dirs = [ 'extensions/expat/xmltok', - 'extensions/expat/xmlparse' ], - sources = [ 'extensions/pyexpat.c', - 'extensions/expat/xmltok/xmltok.c', - 'extensions/expat/xmltok/xmlrole.c', - ] + define_macros = [('XML_NS', None)], + include_dirs = [ 'extensions/expat/xmltok', + 'extensions/expat/xmlparse' ], + sources = [ 'extensions/pyexpat.c', + 'extensions/expat/xmltok/xmltok.c', + 'extensions/expat/xmltok/xmlrole.c', ] ) setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) Modified: python/branches/release30-maint/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.2.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.2.rst Sun Jan 4 01:12:49 2009 @@ -295,7 +295,7 @@ class D (B,C): def save (self): - # Call superclass .save() + # Call superclass .save() super(D, self).save() # Save D's private information here ... Modified: python/branches/release30-maint/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.4.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.4.rst Sun Jan 4 01:12:49 2009 @@ -396,10 +396,10 @@ different keyword arguments. :: class Popen(args, bufsize=0, executable=None, - stdin=None, stdout=None, stderr=None, - preexec_fn=None, close_fds=False, shell=False, - cwd=None, env=None, universal_newlines=False, - startupinfo=None, creationflags=0): + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): *args* is commonly a sequence of strings that will be the arguments to the program executed as the subprocess. (If the *shell* argument is true, *args* Modified: python/branches/release30-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.6.rst Sun Jan 4 01:12:49 2009 @@ -590,30 +590,30 @@ def factorial(queue, N): - "Compute a factorial." - # If N is a multiple of 4, this function will take much longer. - if (N % 4) == 0: - time.sleep(.05 * N/4) - - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # If N is a multiple of 4, this function will take much longer. + if (N % 4) == 0: + time.sleep(.05 * N/4) + + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i - # Put the result on the queue - queue.put(fact) + # Put the result on the queue + queue.put(fact) if __name__ == '__main__': - queue = Queue() + queue = Queue() - N = 5 + N = 5 - p = Process(target=factorial, args=(queue, N)) - p.start() - p.join() + p = Process(target=factorial, args=(queue, N)) + p.start() + p.join() - result = queue.get() - print 'Factorial', N, '=', result + result = queue.get() + print 'Factorial', N, '=', result A :class:`Queue` is used to communicate the input parameter *N* and the result. The :class:`Queue` object is stored in a global variable. @@ -634,12 +634,12 @@ from multiprocessing import Pool def factorial(N, dictionary): - "Compute a factorial." - ... + "Compute a factorial." + ... p = Pool(5) result = p.map(factorial, range(1, 1000, 10)) for v in result: - print v + print v This produces the following output:: @@ -1889,9 +1889,9 @@ ('id', 'name', 'type', 'size') >>> var = var_type(1, 'frequency', 'int', 4) - >>> print var[0], var.id # Equivalent + >>> print var[0], var.id # Equivalent 1 1 - >>> print var[2], var.type # Equivalent + >>> print var[2], var.type # Equivalent int int >>> var._asdict() {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'} @@ -2050,8 +2050,8 @@ >>> list(itertools.product([1,2,3], [4,5,6])) [(1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6)] + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, From g.brandl at gmx.net Sun Jan 4 01:12:18 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Sun, 04 Jan 2009 01:12:18 +0100 Subject: [Python-checkins] r68276 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS In-Reply-To: <20090104000450.279481E400C@bag.python.org> References: <20090104000450.279481E400C@bag.python.org> Message-ID: tarek.ziade schrieb: > Author: tarek.ziade > Date: Sun Jan 4 01:04:49 2009 > New Revision: 68276 > > Log: > fixed #1702551: distutils sdist was not pruning VCS directories under win32 > > Added: > python/trunk/Lib/distutils/tests/test_sdist.py (contents, props changed) > Modified: > python/trunk/Lib/distutils/command/sdist.py > python/trunk/Misc/NEWS > > Modified: python/trunk/Lib/distutils/command/sdist.py > ============================================================================== > --- python/trunk/Lib/distutils/command/sdist.py (original) > +++ python/trunk/Lib/distutils/command/sdist.py Sun Jan 4 01:04:49 2009 > @@ -7,6 +7,7 @@ > __revision__ = "$Id$" > > import os, string > +import sys > from types import * > from glob import glob > from distutils.core import Command > @@ -354,8 +355,13 @@ > > self.filelist.exclude_pattern(None, prefix=build.build_base) > self.filelist.exclude_pattern(None, prefix=base_dir) > - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) > > + # pruning out vcs directories > + # both separators are used under win32 > + seps = sys.platform == 'win32' and r'/|\\' or '/' > + vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] ^ ^ ^ ^ You should double these backslashes or use raw strings. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From python-checkins at python.org Sun Jan 4 01:13:33 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:13:33 +0100 (CET) Subject: [Python-checkins] r68284 - python/branches/release30-maint Message-ID: <20090104001333.1EB721E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:13:32 2009 New Revision: 68284 Log: Blocked revisions 68155 via svnmerge ................ r68155 | ronald.oussoren | 2009-01-02 14:10:34 +0100 (Fri, 02 Jan 2009) | 17 lines Recorded merge of revisions 68153 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68153 | ronald.oussoren | 2009-01-02 13:59:32 +0100 (Fri, 02 Jan 2009) | 10 lines Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 01:28:14 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:28:14 +0100 (CET) Subject: [Python-checkins] r68285 - in python/branches/py3k/Doc: c-api/object.rst documenting/markup.rst extending/windows.rst library/http.cookies.rst library/sqlite3.rst library/stdtypes.rst library/test.rst library/warnings.rst library/zipfile.rst Message-ID: <20090104002814.B31531E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:28:14 2009 New Revision: 68285 Log: Remove 2.6 versionchanges, turn 2.7 ones into 3.1. Modified: python/branches/py3k/Doc/c-api/object.rst python/branches/py3k/Doc/documenting/markup.rst python/branches/py3k/Doc/extending/windows.rst python/branches/py3k/Doc/library/http.cookies.rst python/branches/py3k/Doc/library/sqlite3.rst python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Doc/library/test.rst python/branches/py3k/Doc/library/warnings.rst python/branches/py3k/Doc/library/zipfile.rst 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 Jan 4 01:28:14 2009 @@ -262,8 +262,6 @@ allowing a type to explicitly indicate to the interpreter that it is not hashable. - .. versionadded:: 2.6 - .. cfunction:: int PyObject_IsTrue(PyObject *o) Modified: python/branches/py3k/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k/Doc/documenting/markup.rst (original) +++ python/branches/py3k/Doc/documenting/markup.rst Sun Jan 4 01:28:14 2009 @@ -598,7 +598,7 @@ Example:: - .. versionadded:: 2.5 + .. versionadded:: 3.1 The *spam* parameter. Note that there must be no blank line between the directive head and the Modified: python/branches/py3k/Doc/extending/windows.rst ============================================================================== --- python/branches/py3k/Doc/extending/windows.rst (original) +++ python/branches/py3k/Doc/extending/windows.rst Sun Jan 4 01:28:14 2009 @@ -107,10 +107,6 @@ to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. - .. versionchanged:: 2.5 - Previously, file names like :file:`spam.dll` (in release mode) or - :file:`spam_d.dll` (in debug mode) were also recognized. - Now your options are: #. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to Modified: python/branches/py3k/Doc/library/http.cookies.rst ============================================================================== --- python/branches/py3k/Doc/library/http.cookies.rst (original) +++ python/branches/py3k/Doc/library/http.cookies.rst Sun Jan 4 01:28:14 2009 @@ -131,9 +131,6 @@ The keys are case-insensitive. - .. versionadded:: 2.6 - The :attr:`httponly` attribute was added. - .. attribute:: Morsel.value Modified: python/branches/py3k/Doc/library/sqlite3.rst ============================================================================== --- python/branches/py3k/Doc/library/sqlite3.rst (original) +++ python/branches/py3k/Doc/library/sqlite3.rst Sun Jan 4 01:28:14 2009 @@ -562,16 +562,11 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - .. versionchanged:: 2.6 - Added iteration and equality (hashability). - .. method:: keys This method returns a tuple of column names. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`. - .. versionadded:: 2.6 - Let's assume we initialize a table as in the example given above:: conn = sqlite3.connect(":memory:") Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sun Jan 4 01:28:14 2009 @@ -461,8 +461,6 @@ :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - .. versionadded:: 2.6 - Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a Modified: python/branches/py3k/Doc/library/test.rst ============================================================================== --- python/branches/py3k/Doc/library/test.rst (original) +++ python/branches/py3k/Doc/library/test.rst Sun Jan 4 01:28:14 2009 @@ -353,5 +353,3 @@ Class used to record warnings for unit tests. See documentation of :func:`check_warnings` above for more details. - .. versionadded:: 2.6 - Modified: python/branches/py3k/Doc/library/warnings.rst ============================================================================== --- python/branches/py3k/Doc/library/warnings.rst (original) +++ python/branches/py3k/Doc/library/warnings.rst Sun Jan 4 01:28:14 2009 @@ -335,8 +335,3 @@ module returned when you import :mod:`warnings` whose filter will be protected. This argument exists primarily for testing the :mod:`warnings` module itself. - - .. versionchanged:: 3.0 - - Constructor arguments turned into keyword-only arguments. - Modified: python/branches/py3k/Doc/library/zipfile.rst ============================================================================== --- python/branches/py3k/Doc/library/zipfile.rst (original) +++ python/branches/py3k/Doc/library/zipfile.rst Sun Jan 4 01:28:14 2009 @@ -67,8 +67,8 @@ otherwise returns ``False``. *filename* may be a file or file-like object too. This module does not currently handle ZIP files which have appended comments. - .. versionchanged:: 2.7 - Support for file and file-like objects. + .. versionchanged:: 3.1 + Support for file and file-like objects. .. data:: ZIP_STORED From python-checkins at python.org Sun Jan 4 01:28:52 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:28:52 +0100 (CET) Subject: [Python-checkins] r68286 - in python/branches/release30-maint/Doc: c-api/object.rst documenting/markup.rst extending/windows.rst library/http.cookies.rst library/sqlite3.rst library/stdtypes.rst library/test.rst library/warnings.rst Message-ID: <20090104002852.824821E4043@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:28:52 2009 New Revision: 68286 Log: Remove 2.6 versionchanges. Modified: python/branches/release30-maint/Doc/c-api/object.rst python/branches/release30-maint/Doc/documenting/markup.rst python/branches/release30-maint/Doc/extending/windows.rst python/branches/release30-maint/Doc/library/http.cookies.rst python/branches/release30-maint/Doc/library/sqlite3.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/library/test.rst python/branches/release30-maint/Doc/library/warnings.rst 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 Jan 4 01:28:52 2009 @@ -262,8 +262,6 @@ allowing a type to explicitly indicate to the interpreter that it is not hashable. - .. versionadded:: 2.6 - .. cfunction:: int PyObject_IsTrue(PyObject *o) Modified: python/branches/release30-maint/Doc/documenting/markup.rst ============================================================================== --- python/branches/release30-maint/Doc/documenting/markup.rst (original) +++ python/branches/release30-maint/Doc/documenting/markup.rst Sun Jan 4 01:28:52 2009 @@ -598,7 +598,7 @@ Example:: - .. versionadded:: 2.5 + .. versionadded:: 3.1 The *spam* parameter. Note that there must be no blank line between the directive head and the Modified: python/branches/release30-maint/Doc/extending/windows.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/windows.rst (original) +++ python/branches/release30-maint/Doc/extending/windows.rst Sun Jan 4 01:28:52 2009 @@ -107,10 +107,6 @@ to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. - .. versionchanged:: 2.5 - Previously, file names like :file:`spam.dll` (in release mode) or - :file:`spam_d.dll` (in debug mode) were also recognized. - Now your options are: #. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to Modified: python/branches/release30-maint/Doc/library/http.cookies.rst ============================================================================== --- python/branches/release30-maint/Doc/library/http.cookies.rst (original) +++ python/branches/release30-maint/Doc/library/http.cookies.rst Sun Jan 4 01:28:52 2009 @@ -131,9 +131,6 @@ The keys are case-insensitive. - .. versionadded:: 2.6 - The :attr:`httponly` attribute was added. - .. attribute:: Morsel.value Modified: python/branches/release30-maint/Doc/library/sqlite3.rst ============================================================================== --- python/branches/release30-maint/Doc/library/sqlite3.rst (original) +++ python/branches/release30-maint/Doc/library/sqlite3.rst Sun Jan 4 01:28:52 2009 @@ -562,16 +562,11 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - .. versionchanged:: 2.6 - Added iteration and equality (hashability). - .. method:: keys This method returns a tuple of column names. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`. - .. versionadded:: 2.6 - Let's assume we initialize a table as in the example given above:: conn = sqlite3.connect(":memory:") 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 Sun Jan 4 01:28:52 2009 @@ -431,8 +431,6 @@ :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - .. versionadded:: 2.6 - Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a Modified: python/branches/release30-maint/Doc/library/test.rst ============================================================================== --- python/branches/release30-maint/Doc/library/test.rst (original) +++ python/branches/release30-maint/Doc/library/test.rst Sun Jan 4 01:28:52 2009 @@ -352,6 +352,3 @@ Class used to record warnings for unit tests. See documentation of :func:`check_warnings` above for more details. - - .. versionadded:: 2.6 - Modified: python/branches/release30-maint/Doc/library/warnings.rst ============================================================================== --- python/branches/release30-maint/Doc/library/warnings.rst (original) +++ python/branches/release30-maint/Doc/library/warnings.rst Sun Jan 4 01:28:52 2009 @@ -335,8 +335,3 @@ module returned when you import :mod:`warnings` whose filter will be protected. This argument exists primarily for testing the :mod:`warnings` module itself. - - .. versionchanged:: 3.0 - - Constructor arguments turned into keyword-only arguments. - From python-checkins at python.org Sun Jan 4 01:29:22 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 01:29:22 +0100 (CET) Subject: [Python-checkins] r68287 - python/branches/release30-maint Message-ID: <20090104002922.43B341E402D@bag.python.org> Author: georg.brandl Date: Sun Jan 4 01:29:22 2009 New Revision: 68287 Log: Blocked revisions 68285 via svnmerge ........ r68285 | georg.brandl | 2009-01-04 01:28:14 +0100 (Sun, 04 Jan 2009) | 2 lines Remove 2.6 versionchanges, turn 2.7 ones into 3.1. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 4 01:39:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 01:39:08 +0100 (CET) Subject: [Python-checkins] r68288 - python/trunk/Doc/tools/rstlint.py Message-ID: <20090104003908.522031E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 01:39:07 2009 New Revision: 68288 Log: only check the actual compile() call for a SyntaxError Modified: python/trunk/Doc/tools/rstlint.py Modified: python/trunk/Doc/tools/rstlint.py ============================================================================== --- python/trunk/Doc/tools/rstlint.py (original) +++ python/trunk/Doc/tools/rstlint.py Sun Jan 4 01:39:07 2009 @@ -62,12 +62,12 @@ @checker('.py', severity=4) def check_syntax(fn, lines): """Check Python examples for valid syntax.""" + code = ''.join(lines) + if '\r' in code: + if os.name != 'nt': + yield 0, '\\r in code file' + code = code.replace('\r', '') try: - code = ''.join(lines) - if '\r' in code: - if os.name != 'nt': - yield 0, '\\r in code file' - code = code.replace('\r', '') compile(code, fn, 'exec') except SyntaxError, err: yield err.lineno, 'not compilable: %s' % err From buildbot at python.org Sun Jan 4 01:52:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 00:52:00 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090104005201.1A6811E4002@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/61 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,georg.brandl,guilherme.polo 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 Jan 4 02:39:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 01:39:04 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090104013904.D848C1E4002@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/30 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,georg.brandl 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 ncoghlan at gmail.com Sun Jan 4 02:49:26 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sun, 04 Jan 2009 11:49:26 +1000 Subject: [Python-checkins] r68276 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS In-Reply-To: References: <20090104000450.279481E400C@bag.python.org> Message-ID: <496015A6.8050208@gmail.com> Georg Brandl wrote: > tarek.ziade schrieb: >> + # pruning out vcs directories >> + # both separators are used under win32 >> + seps = sys.platform == 'win32' and r'/|\\' or '/' >> + vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] > > ^ ^ ^ ^ > You should double these backslashes or use raw strings. Agreed - while the code will work as written, relying on a given character not being part of an escape sequence (i.e. "." in this case) is a rather dubious way to do things. Better to be explicit and escape the backslash or use raw strings as Georg suggests. Using an if/else conditional expression on the line above would also be clearer than using the and/or chain. Cheers, Nick. P.S. Added Tarek explicitly to the CC list. Tarek, if you aren't subscribed to python-checkins yet, please head to python.org and sign up for it - follow-up comments in the response to the checkin message are a useful form of post-commit review. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From buildbot at python.org Sun Jan 4 03:30:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 02:30:13 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.x Message-ID: <20090104023013.8E1291E4021@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.x/builds/48 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,georg.brandl,guilherme.polo,raymond.hettinger 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 Sun Jan 4 09:26:10 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 09:26:10 +0100 (CET) Subject: [Python-checkins] r68289 - python/trunk/Doc/library/ftplib.rst Message-ID: <20090104082610.CE7391E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 09:26:10 2009 New Revision: 68289 Log: Test commit. Modified: python/trunk/Doc/library/ftplib.rst Modified: python/trunk/Doc/library/ftplib.rst ============================================================================== --- python/trunk/Doc/library/ftplib.rst (original) +++ python/trunk/Doc/library/ftplib.rst Sun Jan 4 09:26:10 2009 @@ -1,4 +1,3 @@ - :mod:`ftplib` --- FTP protocol client ===================================== From python-checkins at python.org Sun Jan 4 11:23:49 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 11:23:49 +0100 (CET) Subject: [Python-checkins] r68290 - in python/trunk/Doc: Makefile make.bat tools/sphinxext/pyspecific.py tools/sphinxext/susp-ignored.csv tools/sphinxext/suspicious.py Message-ID: <20090104102349.C785F1E4010@bag.python.org> Author: georg.brandl Date: Sun Jan 4 11:23:49 2009 New Revision: 68290 Log: Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. Added: python/trunk/Doc/tools/sphinxext/susp-ignored.csv (contents, props changed) python/trunk/Doc/tools/sphinxext/suspicious.py (contents, props changed) Modified: python/trunk/Doc/Makefile python/trunk/Doc/make.bat python/trunk/Doc/tools/sphinxext/pyspecific.py Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Sun Jan 4 11:23:49 2009 @@ -24,6 +24,7 @@ @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" + @echo " suspicious to check for suspicious markup in output text" @echo " coverage to check documentation coverage for library and C API" @echo " dist to create a \"dist\" directory with archived docs for download" @@ -84,6 +85,11 @@ @echo "Link check complete; look for any errors in the above output " \ "or in build/$(BUILDER)/output.txt" +suspicious: BUILDER = suspicious +suspicious: build + @echo "Suspicious check complete; look for any errors in the above output " \ + "or in build/$(BUILDER)/suspicious.txt" + coverage: BUILDER = coverage coverage: build @echo "Coverage finished; see c.txt and python.txt in build/coverage" Modified: python/trunk/Doc/make.bat ============================================================================== --- python/trunk/Doc/make.bat (original) +++ python/trunk/Doc/make.bat Sun Jan 4 11:23:49 2009 @@ -8,28 +8,35 @@ if "%1" EQU "" goto help if "%1" EQU "html" goto build if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun +if "%1" EQU "latex" goto build +if "%1" EQU "text" goto build +if "%1" EQU "suspicious" goto build +if "%1" EQU "linkcheck" goto build +if "%1" EQU "changes" goto build if "%1" EQU "checkout" goto checkout if "%1" EQU "update" goto update :help +set this=%~n0 echo HELP echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun +echo %this% checkout +echo %this% update +echo %this% html +echo %this% htmlhelp +echo %this% latex +echo %this% text +echo %this% suspicious +echo %this% linkcheck +echo %this% changes echo. goto end :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments +svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils +svn co %SVNROOT%/external/Jinja-1.2/jinja tools/jinja +svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update @@ -43,7 +50,7 @@ if not exist build mkdir build if not exist build\%1 mkdir build\%1 if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 +cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%* if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/trunk/Doc/tools/sphinxext/pyspecific.py (original) +++ python/trunk/Doc/tools/sphinxext/pyspecific.py Sun Jan 4 11:23:49 2009 @@ -92,6 +92,9 @@ finally: f.close() +# Support for checking for suspicious markup + +import suspicious # Support for documenting Opcodes @@ -116,5 +119,6 @@ def setup(app): app.add_role('issue', issue_role) app.add_builder(PydocTopicsBuilder) + app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) Added: python/trunk/Doc/tools/sphinxext/susp-ignored.csv ============================================================================== --- (empty file) +++ python/trunk/Doc/tools/sphinxext/susp-ignored.csv Sun Jan 4 11:23:49 2009 @@ -0,0 +1,164 @@ +c-api/arg,,:ref,"PyArg_ParseTuple(args, ""O|O:ref"", &object, &callback)" +c-api/list,,:high,list[low:high] +c-api/list,,:high,list[low:high] = itemlist +c-api/sequence,,:i2,o[i1:i2] +c-api/sequence,,:i2,o[i1:i2] = v +c-api/sequence,,:i2,del o[i1:i2] +c-api/unicode,,:end,str[start:end] +distutils/apiref,,:action,http://pypi.python.org/pypi?:action=list_classifiers +distutils/setupscript,,::, +extending/embedding,,:numargs,"if(!PyArg_ParseTuple(args, "":numargs""))" +extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)) {" +extending/extending,,:myfunction,"PyArg_ParseTuple(args, ""D:myfunction"", &c);" +extending/newtypes,,:call,"if (!PyArg_ParseTuple(args, ""sss:call"", &arg1, &arg2, &arg3)) {" +extending/windows,,:initspam,/export:initspam +howto/cporting,,:add,"if (!PyArg_ParseTuple(args, ""ii:add_ints"", &one, &two))" +howto/cporting,,:encode,"if (!PyArg_ParseTuple(args, ""O:encode_object"", &myobj))" +howto/cporting,,:say,"if (!PyArg_ParseTuple(args, ""U:say_hello"", &name))" +howto/curses,,:black,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/curses,,:blue,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/curses,,:cyan,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/curses,,:green,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/curses,,:magenta,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/curses,,:red,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/curses,,:white,"7:white." +howto/curses,,:yellow,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and" +howto/regex,,::, +howto/regex,,:foo,(?:foo) +howto/urllib2,,:example,"for example ""joe at password:example.com""" +howto/webservers,,.. image:,.. image:: http.png +library/audioop,,:ipos,"# factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)]," +library/datetime,,:MM, +library/datetime,,:SS, +library/decimal,,:optional,"trailneg:optional trailing minus indicator" +library/difflib,,:ahi,a[alo:ahi] +library/difflib,,:bhi,b[blo:bhi] +library/difflib,,:i2, +library/difflib,,:j2, +library/difflib,,:i1, +library/dis,,:TOS, +library/dis,,`,TOS = `TOS` +library/doctest,,`,``factorial`` from the ``example`` module: +library/doctest,,`,The ``example`` module +library/doctest,,`,Using ``factorial`` +library/functions,,:step,a[start:stop:step] +library/functions,,:stop,"a[start:stop, i]" +library/functions,,:stop,a[start:stop:step] +library/hotshot,,:lineno,"ncalls tottime percall cumtime percall filename:lineno(function)" +library/httplib,,:port,host:port +library/imaplib,,:MM,"""DD-Mmm-YYYY HH:MM:SS +HHMM""" +library/imaplib,,:SS,"""DD-Mmm-YYYY HH:MM:SS +HHMM""" +library/linecache,,:sys,"sys:x:3:3:sys:/dev:/bin/sh" +library/logging,,:And, +library/logging,,:package1, +library/logging,,:package2, +library/logging,,:root, +library/logging,,:This, +library/logging,,:port,host:port +library/mmap,,:i2,obj[i1:i2] +library/multiprocessing,,:queue,">>> QueueManager.register('get_queue', callable=lambda:queue)" +library/multiprocessing,,`,">>> l._callmethod('__getitem__', (20,)) # equiv to `l[20]`" +library/multiprocessing,,`,">>> l._callmethod('__getslice__', (2, 7)) # equiv to `l[2:7]`" +library/multiprocessing,,`,# `BaseManager`. +library/multiprocessing,,`,# `Pool.imap()` (which will save on the amount of code needed anyway). +library/multiprocessing,,`,# A test file for the `multiprocessing` package +library/multiprocessing,,`,# A test of `multiprocessing.Pool` class +library/multiprocessing,,`,# Add more tasks using `put()` +library/multiprocessing,,`,# create server for a `HostManager` object +library/multiprocessing,,`,# Depends on `multiprocessing` package -- tested with `processing-0.60` +library/multiprocessing,,`,# in the original order then consider using `Pool.map()` or +library/multiprocessing,,`,# Not sure if we should synchronize access to `socket.accept()` method by +library/multiprocessing,,`,# object. (We import `multiprocessing.reduction` to enable this pickling.) +library/multiprocessing,,`,# register the Foo class; make `f()` and `g()` accessible via proxy +library/multiprocessing,,`,# register the Foo class; make `g()` and `_h()` accessible via proxy +library/multiprocessing,,`,# register the generator function baz; use `GeneratorProxy` to make proxies +library/multiprocessing,,`,`Cluster` is a subclass of `SyncManager` so it allows creation of +library/multiprocessing,,`,`hostname` gives the name of the host. If hostname is not +library/multiprocessing,,`,`slots` is used to specify the number of slots for processes on +library/optparse,,:len,"del parser.rargs[:len(value)]" +library/os.path,,:foo,c:foo +library/parser,,`,"""Make a function that raises an argument to the exponent `exp`.""" +library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS""" +library/profile,,:lineno,ncalls tottime percall cumtime percall filename:lineno(function) +library/profile,,:lineno,filename:lineno(function) +library/pyexpat,,:elem1, +library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">" +library/repr,,`,"return `obj`" +library/smtplib,,:port,"as well as a regular host:port server." +library/socket,,::,'5aef:2b::8' +library/sqlite3,,:memory, +library/sqlite3,,:age,"select name_last, age from people where name_last=:who and age=:age" +library/sqlite3,,:who,"select name_last, age from people where name_last=:who and age=:age" +library/ssl,,:My,"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc." +library/ssl,,:My,"Organizational Unit Name (eg, section) []:My Group" +library/ssl,,:myserver,"Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com" +library/ssl,,:MyState,State or Province Name (full name) [Some-State]:MyState +library/ssl,,:ops,Email Address []:ops at myserver.mygroup.myorganization.com +library/ssl,,:Some,"Locality Name (eg, city) []:Some City" +library/ssl,,:US,Country Name (2 letter code) [AU]:US +library/stdtypes,,:len,s[len(s):len(s)] +library/stdtypes,,:len,s[len(s):len(s)] +library/string,,:end,s[start:end] +library/string,,:end,s[start:end] +library/subprocess,,`,"output=`mycmd myarg`" +library/subprocess,,`,"output=`dmesg | grep hda`" +library/tarfile,,:compression,filemode[:compression] +library/tarfile,,:gz, +library/tarfile,,:bz2, +library/time,,:mm, +library/time,,:ss, +library/turtle,,::,Example:: +library/urllib,,:port,:port +library/urllib2,,:password,"""joe:password at python.org""" +library/uuid,,:uuid,urn:uuid:12345678-1234-5678-1234-567812345678 +library/xmlrpclib,,:pass,http://user:pass at host:port/path +library/xmlrpclib,,:pass,user:pass +library/xmlrpclib,,:port,http://user:pass at host:port/path +license,,`,THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND +license,,:zooko,mailto:zooko at zooko.com +license,,`,THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +reference/datamodel,,:step,a[i:j:step] +reference/datamodel,,:max, +reference/expressions,,:index,x[index:index] +reference/expressions,,:datum,{key:datum...} +reference/expressions,,`,`expressions...` +reference/grammar,,:output,#diagram:output +reference/grammar,,:rules,#diagram:rules +reference/grammar,,:token,#diagram:token +reference/grammar,,`,'`' testlist1 '`' +reference/lexical_analysis,,:fileencoding,# vim:fileencoding= +reference/lexical_analysis,,`,", : . ` = ;" +tutorial/datastructures,,:value,key:value pairs within the braces adds initial key:value pairs +tutorial/datastructures,,:value,It is also possible to delete a key:value +tutorial/stdlib2,,:start,"fields = struct.unpack(' don't care + self.issue = issue # the markup fragment that triggered this rule + self.line = line # text of the container element (single line only) + + +class CheckSuspiciousMarkupBuilder(Builder): + """ + Checks for possibly invalid markup that may leak into the output + """ + name = 'suspicious' + + def init(self): + # create output file + self.log_file_name = os.path.join(self.outdir, 'suspicious.csv') + open(self.log_file_name, 'w').close() + # load database of previously ignored issues + self.load_rules(os.path.join(os.path.dirname(__file__), 'susp-ignored.csv')) + + def get_outdated_docs(self): + return self.env.found_docs + + def get_target_uri(self, docname, typ=None): + return '' + + def prepare_writing(self, docnames): + ### PYTHON PROJECT SPECIFIC ### + for name in set(docnames): + if name.split('/', 1)[0] == 'documenting': + docnames.remove(name) + ### PYTHON PROJECT SPECIFIC ### + + def write_doc(self, docname, doctree): + self.any_issue = False # set when any issue is encountered in this document + self.docname = docname + visitor = SuspiciousVisitor(doctree, self) + doctree.walk(visitor) + + def finish(self): + return + + def check_issue(self, line, lineno, issue): + if not self.is_ignored(line, lineno, issue): + self.report_issue(line, lineno, issue) + + def is_ignored(self, line, lineno, issue): + """Determine whether this issue should be ignored. + """ + docname = self.docname + for rule in self.rules: + if rule.docname != docname: continue + if rule.issue != issue: continue + # Both lines must match *exactly*. This is rather strict, + # and probably should be improved. + # Doing fuzzy matches with levenshtein distance could work, + # but that means bringing other libraries... + # Ok, relax that requirement: just check if the rule fragment + # is contained in the document line + if rule.line not in line: continue + # Check both line numbers. If they're "near" + # this rule matches. (lineno=None means "don't care") + if (rule.lineno is not None) and \ + abs(rule.lineno - lineno) > 5: continue + # if it came this far, the rule matched + return True + return False + + def report_issue(self, text, lineno, issue): + if not self.any_issue: self.info() + self.any_issue = True + self.write_log_entry(lineno, issue, text) + self.warn('[%s:%d] "%s" found in "%-.120s"' % ( + self.docname.encode(sys.getdefaultencoding(),'replace'), + lineno, + issue.encode(sys.getdefaultencoding(),'replace'), + text.strip().encode(sys.getdefaultencoding(),'replace'))) + self.app.statuscode = 1 + + def write_log_entry(self, lineno, issue, text): + f = open(self.log_file_name, 'ab') + writer = csv.writer(f) + writer.writerow([self.docname.encode('utf-8'), + lineno, + issue.encode('utf-8'), + text.strip().encode('utf-8')]) + del writer + f.close() + + def load_rules(self, filename): + """Load database of previously ignored issues. + + A csv file, with exactly the same format as suspicious.csv + Fields: document name (normalized), line number, issue, surrounding text + """ + self.info("loading ignore rules... ", nonl=1) + self.rules = rules = [] + try: f = open(filename, 'rb') + except IOError: return + for i, row in enumerate(csv.reader(f)): + if len(row) != 4: + raise ValueError, "wrong format in %s, line %d: %s" % (filename, i+1, row) + docname, lineno, issue, text = row + docname = docname.decode('utf-8') + if lineno: lineno = int(lineno) + else: lineno = None + issue = issue.decode('utf-8') + text = text.decode('utf-8') + rule = Rule(docname, lineno, issue, text) + rules.append(rule) + f.close() + self.info('done, %d rules loaded' % len(self.rules)) + + +def get_lineno(node): + "Obtain line number information for a node" + lineno = None + while lineno is None and node: + node = node.parent + lineno = node.line + return lineno + + +def extract_line(text, index): + """text may be a multiline string; extract + only the line containing the given character index. + + >>> extract_line("abc\ndefgh\ni", 6) + >>> 'defgh' + >>> for i in (0, 2, 3, 4, 10): + ... print extract_line("abc\ndefgh\ni", i) + abc + abc + abc + defgh + defgh + i + """ + p = text.rfind('\n', 0, index) + 1 + q = text.find('\n', index) + if q<0: q = len(text) + return text[p:q] + + +class SuspiciousVisitor(nodes.GenericNodeVisitor): + + lastlineno = 0 + + def __init__(self, document, builder): + nodes.GenericNodeVisitor.__init__(self, document) + self.builder = builder + + def default_visit(self, node): + if isinstance(node, (nodes.Text, nodes.image)): # direct text containers + text = node.astext() + # lineno seems to go backwards sometimes (?) + self.lastlineno = lineno = max(get_lineno(node) or 0, self.lastlineno) + seen = set() # don't report the same issue more than only once per line + for match in detect_all(text): + #import pdb; pdb.set_trace() + issue = match.group() + line = extract_line(text, match.start()) + if (issue, line) not in seen: + self.builder.check_issue(line, lineno, issue) + seen.add((issue, line)) + + unknown_visit = default_visit + + def visit_document(self, node): + self.lastlineno = 0 + + def visit_comment(self, node): + # ignore comments -- too much false positives. + # (although doing this could miss some errors; + # there were two sections "commented-out" by mistake + # in the Python docs that would not be catched) + raise nodes.SkipNode From python-checkins at python.org Sun Jan 4 11:24:09 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 11:24:09 +0100 (CET) Subject: [Python-checkins] r68291 - in python/trunk/Doc/library: ctypes.rst multiprocessing.rst stdtypes.rst Message-ID: <20090104102409.F0EEC1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 11:24:09 2009 New Revision: 68291 Log: Fix two issues found by the suspicious builder. Modified: python/trunk/Doc/library/ctypes.rst python/trunk/Doc/library/multiprocessing.rst python/trunk/Doc/library/stdtypes.rst Modified: python/trunk/Doc/library/ctypes.rst ============================================================================== --- python/trunk/Doc/library/ctypes.rst (original) +++ python/trunk/Doc/library/ctypes.rst Sun Jan 4 11:24:09 2009 @@ -1864,7 +1864,7 @@ :module: ctypes.util Try to find a library and return a pathname. *name* is the library name - without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix linker option :option:`-l`). If no library can be found, returns ``None``. Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Sun Jan 4 11:24:09 2009 @@ -1812,7 +1812,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the - form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. Modified: python/trunk/Doc/library/stdtypes.rst ============================================================================== --- python/trunk/Doc/library/stdtypes.rst (original) +++ python/trunk/Doc/library/stdtypes.rst Sun Jan 4 11:24:09 2009 @@ -338,7 +338,7 @@ module: math single: floor() (in module math) single: ceil() (in module math) - single: trunc() (in module math) + single: trunc() (in module math) pair: numeric; conversions Conversion from floats using :func:`int` or :func:`long` truncates toward From nnorwitz at gmail.com Sun Jan 4 11:34:00 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 4 Jan 2009 05:34:00 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090104103400.GA11308@python.psfb.org> svn update tools/sphinx At revision 68291. svn update tools/docutils At revision 68291. svn update tools/jinja At revision 68291. svn update tools/pygments At revision 68291. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html Exception occurred: File "/home/neal/python/trunk/Doc/tools/sphinx/jinja/loaders.py", line 20, in from jinja.utils import CacheDict, raise_syntax_error ImportError: cannot import name raise_syntax_error The full traceback has been saved in /tmp/sphinx-err-8yfMyI.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-dev at googlegroups.com. Thanks! make: *** [build] Error 1 From python-checkins at python.org Sun Jan 4 11:36:58 2009 From: python-checkins at python.org (skip.montanaro) Date: Sun, 4 Jan 2009 11:36:58 +0100 (CET) Subject: [Python-checkins] r68292 - python/trunk/configure.in Message-ID: <20090104103658.5A47E1E4002@bag.python.org> Author: skip.montanaro Date: Sun Jan 4 11:36:58 2009 New Revision: 68292 Log: If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". Modified: python/trunk/configure.in Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sun Jan 4 11:36:58 2009 @@ -407,7 +407,7 @@ AC_HELP_STRING(--without-gcc,never use gcc), [ case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; From python-checkins at python.org Sun Jan 4 11:37:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 4 Jan 2009 11:37:52 +0100 (CET) Subject: [Python-checkins] r68293 - python/trunk/Lib/distutils/command/sdist.py Message-ID: <20090104103752.78B8A1E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 4 11:37:52 2009 New Revision: 68293 Log: using clearer syntax Modified: python/trunk/Lib/distutils/command/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 Sun Jan 4 11:37:52 2009 @@ -358,8 +358,13 @@ # pruning out vcs directories # both separators are used under win32 - seps = sys.platform == 'win32' and r'/|\\' or '/' - vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) From buildbot at python.org Sun Jan 4 11:39:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 10:39:59 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 2.6 Message-ID: <20090104103959.3CBDE1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%202.6/builds/25 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: georg.brandl,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From ziade.tarek at gmail.com Sun Jan 4 11:40:36 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Sun, 4 Jan 2009 11:40:36 +0100 Subject: [Python-checkins] r68276 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS In-Reply-To: <496015A6.8050208@gmail.com> References: <20090104000450.279481E400C@bag.python.org> <496015A6.8050208@gmail.com> Message-ID: <94bdd2610901040240m5c7ecb7na7c1216d586365ec@mail.gmail.com> On Sun, Jan 4, 2009 at 2:49 AM, Nick Coghlan wrote: > Georg Brandl wrote: >> tarek.ziade schrieb: >>> + # pruning out vcs directories >>> + # both separators are used under win32 >>> + seps = sys.platform == 'win32' and r'/|\\' or '/' >>> + vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] >> >> ^ ^ ^ ^ >> You should double these backslashes or use raw strings. > > > Agreed - while the code will work as written, relying on a given > character not being part of an escape sequence (i.e. "." in this case) > is a rather dubious way to do things. > Yes that's why I didn't use a raw string in the first place, but I agree it is not very explicit. > Better to be explicit and escape the backslash or use raw strings as > Georg suggests. > > Using an if/else conditional expression on the line above would also be > clearer than using the and/or chain. > both done in r68293, thanks for the reviews ! Cheers Tarek From python-checkins at python.org Sun Jan 4 11:43:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 4 Jan 2009 11:43:32 +0100 (CET) Subject: [Python-checkins] r68294 - in python/branches/release26-maint: Lib/distutils/command/sdist.py Message-ID: <20090104104332.D096C1E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 4 11:43:32 2009 New Revision: 68294 Log: Merged revisions 68293 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68293 | tarek.ziade | 2009-01-04 11:37:52 +0100 (Sun, 04 Jan 2009) | 1 line using clearer syntax ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/sdist.py Modified: python/branches/release26-maint/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/command/sdist.py Sun Jan 4 11:43:32 2009 @@ -358,8 +358,13 @@ # pruning out vcs directories # both separators are used under win32 - seps = sys.platform == 'win32' and r'/|\\' or '/' - vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs'] + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) From python-checkins at python.org Sun Jan 4 13:11:54 2009 From: python-checkins at python.org (skip.montanaro) Date: Sun, 4 Jan 2009 13:11:54 +0100 (CET) Subject: [Python-checkins] r68295 - sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Message-ID: <20090104121154.B1DFF1E4002@bag.python.org> Author: skip.montanaro Date: Sun Jan 4 13:11:54 2009 New Revision: 68295 Log: Rework performance measurements a bit. Only commit once every 100 calls to __setitem__. Explicitly commit on close. Modified: sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Modified: sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Sun Jan 4 13:11:54 2009 @@ -6,116 +6,149 @@ * Obvious speed problems (all tests performed on 2.2GHz MacBook Pro running OSX 10.5.4 with SQLite 3.6.2): - - Read performance: - # Using a file... + PYTHON=python3.0 + + $PYTHON -c 'import sqlite3 + print("module version:", sqlite3.version_info) + print("sqlite version:", sqlite3.sqlite_version_info) + ' + + echo + echo 'read from file' for m in dumb gnu ndbm sqlite ; do echo $m for n in 10 100 ; do rm -f /tmp/trash.db* - python3.0 -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f[b"1"]' - done - done - dumb - 100 loops, best of 3: 4.06 msec per loop - 10 loops, best of 3: 43.8 msec per loop - gnu - 1000 loops, best of 3: 304 usec per loop - 100 loops, best of 3: 2.98 msec per loop - ndbm - 10000 loops, best of 3: 29.1 usec per loop - 1000 loops, best of 3: 299 usec per loop - sqlite - 10 loops, best of 3: 25.9 msec per loop - 10 loops, best of 3: 271 msec per loop - # Using :memory: + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f[b"1"]' + done + done + + echo + echo 'read from :memory:' for m in sqlite ; do echo $m for n in 10 100 ; do - python3.0 -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f[b"1"]' + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f[b"1"]' done done - sqlite - 1000 loops, best of 3: 249 usec per loop - 100 loops, best of 3: 2.48 msec per loop - - Write performance: - # Using a file... + echo + echo 'write to file' for m in dumb gnu ndbm sqlite ; do echo $m for n in 10 100 ; do rm -f /tmp/trash.db* - python3.0 -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' - done - done - 100 loops, best of 3: 3.92 msec per loop - 10 loops, best of 3: 41.9 msec per loop - gnu - 1000 loops, best of 3: 301 usec per loop - 100 loops, best of 3: 3.02 msec per loop - ndbm - 10000 loops, best of 3: 28.9 usec per loop - 1000 loops, best of 3: 296 usec per loop - sqlite - 10 loops, best of 3: 22.5 msec per loop - 10 loops, best of 3: 278 msec per loop - # Using :memory: + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' + done + done + + echo + echo 'write to :memory:' for m in sqlite ; do echo $m for n in 10 100 ; do - python3.0 -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' done done - sqlite - 1000 loops, best of 3: 452 usec per loop - 100 loops, best of 3: 4.95 msec per loop - - Keys: - # Using a file... + echo + echo 'keys from file' for m in dumb gnu ndbm sqlite ; do echo $m for n in 10 100 ; do rm -f /tmp/trash.db* - python3.0 -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.keys()' - done - done - dumb - 10000 loops, best of 3: 21.6 usec per loop - 1000 loops, best of 3: 210 usec per loop - gnu - 10000 loops, best of 3: 36.6 usec per loop - 1000 loops, best of 3: 349 usec per loop - ndbm - 100000 loops, best of 3: 5.49 usec per loop - 10000 loops, best of 3: 50.8 usec per loop - sqlite - 1000 loops, best of 3: 562 usec per loop - 100 loops, best of 3: 5.55 msec per loop - # Using :memory: + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.keys()' + done + done + + echo + echo 'keys from :memory:' for m in sqlite ; do echo $m for n in 10 100 ; do - python3.0 -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.keys()' - done - done - sqlite - 10000 loops, best of 3: 185 usec per loop - 1000 loops, best of 3: 1.85 msec per loop + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.keys()' + done + done + +As of 2009-01-04 I get this output on a 2.2GHz MacBook Pro: + + module version: (2, 4, 1) + sqlite version: (3, 6, 2) + + read from file + dumb 10: 1000 loops, best of 3: 1.03 msec per loop + dumb 100: 100 loops, best of 3: 10.2 msec per loop + dumb 1000: 10 loops, best of 3: 103 msec per loop + gnu 10: 100000 loops, best of 3: 4.32 usec per loop + gnu 100: 10000 loops, best of 3: 38.8 usec per loop + gnu 1000: 1000 loops, best of 3: 394 usec per loop + ndbm 10: 100000 loops, best of 3: 3.54 usec per loop + ndbm 100: 10000 loops, best of 3: 31.2 usec per loop + ndbm 1000: 1000 loops, best of 3: 321 usec per loop + sqlite 10: 1000 loops, best of 3: 261 usec per loop + sqlite 100: 100 loops, best of 3: 2.53 msec per loop + sqlite 1000: 10 loops, best of 3: 25.7 msec per loop + + read from :memory: + sqlite 10: 1000 loops, best of 3: 237 usec per loop + sqlite 100: 100 loops, best of 3: 2.31 msec per loop + sqlite 1000: 10 loops, best of 3: 23.1 msec per loop + + write to file + dumb 10: 100 loops, best of 3: 3.88 msec per loop + dumb 100: 10 loops, best of 3: 42.4 msec per loop + dumb 1000: 10 loops, best of 3: 424 msec per loop + gnu 10: 1000 loops, best of 3: 295 usec per loop + gnu 100: 100 loops, best of 3: 2.94 msec per loop + gnu 1000: 10 loops, best of 3: 30 msec per loop + ndbm 10: 10000 loops, best of 3: 27.3 usec per loop + ndbm 100: 1000 loops, best of 3: 281 usec per loop + ndbm 1000: 100 loops, best of 3: 6.07 msec per loop + sqlite 10: 1000 loops, best of 3: 764 usec per loop + sqlite 100: 100 loops, best of 3: 8.39 msec per loop + sqlite 1000: 10 loops, best of 3: 95.9 msec per loop + + write to :memory: + sqlite 10: 1000 loops, best of 3: 295 usec per loop + sqlite 100: 100 loops, best of 3: 3.3 msec per loop + sqlite 1000: 10 loops, best of 3: 35.1 msec per loop + + keys from file + dumb 10: 100000 loops, best of 3: 14.7 usec per loop + dumb 100: 10000 loops, best of 3: 142 usec per loop + dumb 1000: 1000 loops, best of 3: 1.44 msec per loop + gnu 10: 10000 loops, best of 3: 35.9 usec per loop + gnu 100: 1000 loops, best of 3: 354 usec per loop + gnu 1000: 100 loops, best of 3: 3.52 msec per loop + ndbm 10: 100000 loops, best of 3: 5.72 usec per loop + ndbm 100: 10000 loops, best of 3: 52.5 usec per loop + ndbm 1000: 1000 loops, best of 3: 534 usec per loop + sqlite 10: 10000 loops, best of 3: 181 usec per loop + sqlite 100: 1000 loops, best of 3: 1.8 msec per loop + sqlite 1000: 100 loops, best of 3: 18.3 msec per loop + + keys from :memory: + sqlite 10: 10000 loops, best of 3: 165 usec per loop + sqlite 100: 1000 loops, best of 3: 1.67 msec per loop + sqlite 1000: 100 loops, best of 3: 16.6 msec per loop + +Note the poor performance compared to dbm.dumb while reading keys. """ import sqlite3 @@ -131,6 +164,7 @@ self._filename = filename self._conn = sqlite3.connect(filename) self.initialize_table() + self._writes = 0 def initialize_table(self): c = self._conn.cursor() @@ -152,7 +186,9 @@ def __setitem__(self, key, val): c = self._conn.cursor() c.execute("replace into dict (key, value) values (?, ?)", (key, val)) - self._conn.commit() + self._writes += 1 + if self._writes % 100 == 0: + self._conn.commit() def __delitem__(self, key): # Complain if it's not there. @@ -163,18 +199,18 @@ def iterkeys(self): c = self._conn.cursor() - c.execute("select key from dict order by key") + c.execute("select key from dict order by rowid") return (e[0] for e in c) __iter__ = iterkeys def itervalues(self): c = self._conn.cursor() - c.execute("select value from dict order by key") + c.execute("select value from dict order by rowid") return (e[0] for e in c) def iteritems(self): c = self._conn.cursor() - c.execute("select key, value from dict order by key") + c.execute("select key, value from dict order by rowid") return (e for e in c) def __contains__(self, key): @@ -201,6 +237,7 @@ def close(self): if self._conn is not None: + self._conn.commit() self._conn.close() self._conn = None From python-checkins at python.org Sun Jan 4 13:29:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 13:29:37 +0100 (CET) Subject: [Python-checkins] r68296 - in python/trunk: configure configure.in pyconfig.h.in Message-ID: <20090104122937.4DE0D1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 13:29:36 2009 New Revision: 68296 Log: Add autoconf test to detect x87-style double rounding, as described in issue #2937. This information can be helpful for diagnosing platform- specific problems in math and cmath. The result of the test also serves as a fairly reliable indicator of whether the x87 floating-point instructions (as opposed to SSE2) are in use on Intel x86/x86_64 systems. Modified: python/trunk/configure python/trunk/configure.in python/trunk/pyconfig.h.in Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Sun Jan 4 13:29:36 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67463 . +# From configure.in Revision: 68292 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -2256,7 +2256,7 @@ if test "${with_gcc+set}" = set; then withval=$with_gcc; case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -21523,6 +21523,94 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +if test "${ac_cv_x87_double_rounding+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +if test "$cross_compiling" = yes; then + ac_cv_x87_double_rounding=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_x87_double_rounding=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_x87_double_rounding=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +if test "$ac_cv_x87_double_rounding" = yes +then + +cat >>confdefs.h <<\_ACEOF +#define X87_DOUBLE_ROUNDING 1 +_ACEOF + +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. { echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sun Jan 4 13:29:36 2009 @@ -3143,6 +3143,44 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +AC_MSG_CHECKING(for x87-style double rounding) +AC_CACHE_VAL(ac_cv_x87_double_rounding, [ +AC_TRY_RUN([ +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} +], +ac_cv_x87_double_rounding=no, +ac_cv_x87_double_rounding=yes, +ac_cv_x87_double_rounding=no)]) +AC_MSG_RESULT($ac_cv_x87_double_rounding) +if test "$ac_cv_x87_double_rounding" = yes +then + AC_DEFINE(X87_DOUBLE_ROUNDING, 1, + [Define if arithmetic is subject to x87-style double rounding issue]) +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. AC_MSG_CHECKING(whether tanh preserves the sign of zero) Modified: python/trunk/pyconfig.h.in ============================================================================== --- python/trunk/pyconfig.h.in (original) +++ python/trunk/pyconfig.h.in Sun Jan 4 13:29:36 2009 @@ -983,6 +983,9 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if arithmetic is subject to x87-style double rounding issue */ +#undef X87_DOUBLE_ROUNDING + /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ From python-checkins at python.org Sun Jan 4 13:36:29 2009 From: python-checkins at python.org (skip.montanaro) Date: Sun, 4 Jan 2009 13:36:29 +0100 (CET) Subject: [Python-checkins] r68297 - sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Message-ID: <20090104123629.AACC71E4002@bag.python.org> Author: skip.montanaro Date: Sun Jan 4 13:36:29 2009 New Revision: 68297 Log: Add iterkeys() perf check. Why should iterkeys() be slower() than keys()? Modified: sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Modified: sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Sun Jan 4 13:36:29 2009 @@ -6,147 +6,185 @@ * Obvious speed problems (all tests performed on 2.2GHz MacBook Pro running OSX 10.5.4 with SQLite 3.6.2): - PYTHON=python3.0 +PYTHON=python3.0 - $PYTHON -c 'import sqlite3 - print("module version:", sqlite3.version_info) - print("sqlite version:", sqlite3.sqlite_version_info) - ' - - echo - echo 'read from file' - for m in dumb gnu ndbm sqlite ; do - echo $m - for n in 10 100 ; do - rm -f /tmp/trash.db* - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f[b"1"]' - done - done - - echo - echo 'read from :memory:' - for m in sqlite ; do - echo $m - for n in 10 100 ; do - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f[b"1"]' - done - done - - echo - echo 'write to file' - for m in dumb gnu ndbm sqlite ; do - echo $m - for n in 10 100 ; do - rm -f /tmp/trash.db* - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' - done - done - - echo - echo 'write to :memory:' - for m in sqlite ; do - echo $m - for n in 10 100 ; do - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' - done - done - - echo - echo 'keys from file' - for m in dumb gnu ndbm sqlite ; do - echo $m - for n in 10 100 ; do - rm -f /tmp/trash.db* - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.keys()' - done - done - - echo - echo 'keys from :memory:' - for m in sqlite ; do - echo $m - for n in 10 100 ; do - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.keys()' - done +$PYTHON -c 'import sqlite3 +print("module version:", sqlite3.version_info) +print("sqlite version:", sqlite3.sqlite_version_info) +' + +echo +echo 'read from file' +for m in dumb gnu ndbm sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f[b"1"]' done +done + +echo +echo 'read from :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f[b"1"]' + done +done + +echo +echo 'write to file' +for m in dumb gnu ndbm sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' + done +done + +echo +echo 'write to :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' + done +done + +echo +echo 'keys from file' +for m in dumb gnu ndbm sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.keys()' + done +done + +echo +echo 'keys from :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.keys()' + done +done + +echo +echo 'iterkeys from file' +for m in dumb sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.iterkeys()' + done +done + +echo +echo 'iterkeys from :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.iterkeys()' + done +done As of 2009-01-04 I get this output on a 2.2GHz MacBook Pro: - module version: (2, 4, 1) - sqlite version: (3, 6, 2) +module version: (2, 4, 1) +sqlite version: (3, 6, 2) - read from file - dumb 10: 1000 loops, best of 3: 1.03 msec per loop - dumb 100: 100 loops, best of 3: 10.2 msec per loop - dumb 1000: 10 loops, best of 3: 103 msec per loop - gnu 10: 100000 loops, best of 3: 4.32 usec per loop - gnu 100: 10000 loops, best of 3: 38.8 usec per loop - gnu 1000: 1000 loops, best of 3: 394 usec per loop - ndbm 10: 100000 loops, best of 3: 3.54 usec per loop - ndbm 100: 10000 loops, best of 3: 31.2 usec per loop - ndbm 1000: 1000 loops, best of 3: 321 usec per loop - sqlite 10: 1000 loops, best of 3: 261 usec per loop - sqlite 100: 100 loops, best of 3: 2.53 msec per loop - sqlite 1000: 10 loops, best of 3: 25.7 msec per loop - - read from :memory: - sqlite 10: 1000 loops, best of 3: 237 usec per loop - sqlite 100: 100 loops, best of 3: 2.31 msec per loop - sqlite 1000: 10 loops, best of 3: 23.1 msec per loop - - write to file - dumb 10: 100 loops, best of 3: 3.88 msec per loop - dumb 100: 10 loops, best of 3: 42.4 msec per loop - dumb 1000: 10 loops, best of 3: 424 msec per loop - gnu 10: 1000 loops, best of 3: 295 usec per loop - gnu 100: 100 loops, best of 3: 2.94 msec per loop - gnu 1000: 10 loops, best of 3: 30 msec per loop - ndbm 10: 10000 loops, best of 3: 27.3 usec per loop - ndbm 100: 1000 loops, best of 3: 281 usec per loop - ndbm 1000: 100 loops, best of 3: 6.07 msec per loop - sqlite 10: 1000 loops, best of 3: 764 usec per loop - sqlite 100: 100 loops, best of 3: 8.39 msec per loop - sqlite 1000: 10 loops, best of 3: 95.9 msec per loop - - write to :memory: - sqlite 10: 1000 loops, best of 3: 295 usec per loop - sqlite 100: 100 loops, best of 3: 3.3 msec per loop - sqlite 1000: 10 loops, best of 3: 35.1 msec per loop - - keys from file - dumb 10: 100000 loops, best of 3: 14.7 usec per loop - dumb 100: 10000 loops, best of 3: 142 usec per loop - dumb 1000: 1000 loops, best of 3: 1.44 msec per loop - gnu 10: 10000 loops, best of 3: 35.9 usec per loop - gnu 100: 1000 loops, best of 3: 354 usec per loop - gnu 1000: 100 loops, best of 3: 3.52 msec per loop - ndbm 10: 100000 loops, best of 3: 5.72 usec per loop - ndbm 100: 10000 loops, best of 3: 52.5 usec per loop - ndbm 1000: 1000 loops, best of 3: 534 usec per loop - sqlite 10: 10000 loops, best of 3: 181 usec per loop - sqlite 100: 1000 loops, best of 3: 1.8 msec per loop - sqlite 1000: 100 loops, best of 3: 18.3 msec per loop - - keys from :memory: - sqlite 10: 10000 loops, best of 3: 165 usec per loop - sqlite 100: 1000 loops, best of 3: 1.67 msec per loop - sqlite 1000: 100 loops, best of 3: 16.6 msec per loop +read from file +dumb 10: 1000 loops, best of 3: 1.04 msec per loop +dumb 100: 100 loops, best of 3: 10.4 msec per loop +dumb 1000: 10 loops, best of 3: 104 msec per loop +gnu 10: 100000 loops, best of 3: 4.41 usec per loop +gnu 100: 10000 loops, best of 3: 38.5 usec per loop +gnu 1000: 1000 loops, best of 3: 395 usec per loop +ndbm 10: 100000 loops, best of 3: 3.64 usec per loop +ndbm 100: 10000 loops, best of 3: 31.1 usec per loop +ndbm 1000: 1000 loops, best of 3: 320 usec per loop +sqlite 10: 1000 loops, best of 3: 258 usec per loop +sqlite 100: 100 loops, best of 3: 2.57 msec per loop +sqlite 1000: 10 loops, best of 3: 25.4 msec per loop + +read from :memory: +sqlite 10: 1000 loops, best of 3: 233 usec per loop +sqlite 100: 100 loops, best of 3: 2.32 msec per loop +sqlite 1000: 10 loops, best of 3: 23.2 msec per loop + +write to file +dumb 10: 100 loops, best of 3: 3.89 msec per loop +dumb 100: 10 loops, best of 3: 40.9 msec per loop +dumb 1000: 10 loops, best of 3: 415 msec per loop +gnu 10: 1000 loops, best of 3: 306 usec per loop +gnu 100: 100 loops, best of 3: 2.96 msec per loop +gnu 1000: 10 loops, best of 3: 30.1 msec per loop +ndbm 10: 10000 loops, best of 3: 27 usec per loop +ndbm 100: 1000 loops, best of 3: 283 usec per loop +ndbm 1000: 100 loops, best of 3: 6.08 msec per loop +sqlite 10: 1000 loops, best of 3: 750 usec per loop +sqlite 100: 100 loops, best of 3: 8.19 msec per loop +sqlite 1000: 10 loops, best of 3: 94.1 msec per loop + +write to :memory: +sqlite 10: 1000 loops, best of 3: 293 usec per loop +sqlite 100: 100 loops, best of 3: 3.25 msec per loop +sqlite 1000: 10 loops, best of 3: 34.9 msec per loop + +keys from file +dumb 10: 100000 loops, best of 3: 14.6 usec per loop +dumb 100: 10000 loops, best of 3: 141 usec per loop +dumb 1000: 1000 loops, best of 3: 1.43 msec per loop +gnu 10: 10000 loops, best of 3: 35.3 usec per loop +gnu 100: 1000 loops, best of 3: 354 usec per loop +gnu 1000: 100 loops, best of 3: 3.56 msec per loop +ndbm 10: 100000 loops, best of 3: 5.78 usec per loop +ndbm 100: 10000 loops, best of 3: 53.1 usec per loop +ndbm 1000: 1000 loops, best of 3: 532 usec per loop +sqlite 10: 10000 loops, best of 3: 183 usec per loop +sqlite 100: 1000 loops, best of 3: 1.79 msec per loop +sqlite 1000: 100 loops, best of 3: 18 msec per loop + +keys from :memory: +sqlite 10: 10000 loops, best of 3: 164 usec per loop +sqlite 100: 1000 loops, best of 3: 1.64 msec per loop +sqlite 1000: 100 loops, best of 3: 16.4 msec per loop + +iterkeys from file +dumb 10: 100000 loops, best of 3: 9.87 usec per loop +dumb 100: 10000 loops, best of 3: 93.3 usec per loop +dumb 1000: 1000 loops, best of 3: 943 usec per loop +sqlite 10: 1000 loops, best of 3: 285 usec per loop +sqlite 100: 100 loops, best of 3: 2.91 msec per loop +sqlite 1000: 10 loops, best of 3: 29.1 msec per loop + +iterkeys from :memory: +sqlite 10: 1000 loops, best of 3: 265 usec per loop +sqlite 100: 100 loops, best of 3: 2.63 msec per loop +sqlite 1000: 10 loops, best of 3: 26.5 msec per loop Note the poor performance compared to dbm.dumb while reading keys. """ From python-checkins at python.org Sun Jan 4 13:44:20 2009 From: python-checkins at python.org (skip.montanaro) Date: Sun, 4 Jan 2009 13:44:20 +0100 (CET) Subject: [Python-checkins] r68298 - in sandbox/trunk/dbm_sqlite/Lib/dbm: sqlite.py sqliteperf.out sqliteperf.sh Message-ID: <20090104124420.8E6001E4002@bag.python.org> Author: skip.montanaro Date: Sun Jan 4 13:44:20 2009 New Revision: 68298 Log: pull tests out Added: sandbox/trunk/dbm_sqlite/Lib/dbm/sqliteperf.out (contents, props changed) sandbox/trunk/dbm_sqlite/Lib/dbm/sqliteperf.sh (contents, props changed) Modified: sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Modified: sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/Lib/dbm/sqlite.py Sun Jan 4 13:44:20 2009 @@ -4,189 +4,8 @@ XXX TO DO: * Obvious speed problems (all tests performed on 2.2GHz MacBook Pro running - OSX 10.5.4 with SQLite 3.6.2): - -PYTHON=python3.0 - -$PYTHON -c 'import sqlite3 -print("module version:", sqlite3.version_info) -print("sqlite version:", sqlite3.sqlite_version_info) -' - -echo -echo 'read from file' -for m in dumb gnu ndbm sqlite ; do - for n in 10 100 1000 ; do - rm -f /tmp/trash.db* - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f[b"1"]' - done -done - -echo -echo 'read from :memory:' -for m in sqlite ; do - for n in 10 100 1000 ; do - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f[b"1"]' - done -done - -echo -echo 'write to file' -for m in dumb gnu ndbm sqlite ; do - for n in 10 100 1000 ; do - rm -f /tmp/trash.db* - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' - done -done - -echo -echo 'write to :memory:' -for m in sqlite ; do - for n in 10 100 1000 ; do - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' - done -done - -echo -echo 'keys from file' -for m in dumb gnu ndbm sqlite ; do - for n in 10 100 1000 ; do - rm -f /tmp/trash.db* - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.keys()' - done -done - -echo -echo 'keys from :memory:' -for m in sqlite ; do - for n in 10 100 1000 ; do - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.keys()' - done -done - -echo -echo 'iterkeys from file' -for m in dumb sqlite ; do - for n in 10 100 1000 ; do - rm -f /tmp/trash.db* - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open("/tmp/trash.db", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.iterkeys()' - done -done - -echo -echo 'iterkeys from :memory:' -for m in sqlite ; do - for n in 10 100 1000 ; do - echo -n "$m $n: " - $PYTHON -m timeit -s 'import dbm.'$m' as db' \ - -s 'f = db.open(":memory:", "c")' \ - -s 'f[b"1"] = b"a"' \ - 'for i in range('$n'): x = f.iterkeys()' - done -done - -As of 2009-01-04 I get this output on a 2.2GHz MacBook Pro: - -module version: (2, 4, 1) -sqlite version: (3, 6, 2) - -read from file -dumb 10: 1000 loops, best of 3: 1.04 msec per loop -dumb 100: 100 loops, best of 3: 10.4 msec per loop -dumb 1000: 10 loops, best of 3: 104 msec per loop -gnu 10: 100000 loops, best of 3: 4.41 usec per loop -gnu 100: 10000 loops, best of 3: 38.5 usec per loop -gnu 1000: 1000 loops, best of 3: 395 usec per loop -ndbm 10: 100000 loops, best of 3: 3.64 usec per loop -ndbm 100: 10000 loops, best of 3: 31.1 usec per loop -ndbm 1000: 1000 loops, best of 3: 320 usec per loop -sqlite 10: 1000 loops, best of 3: 258 usec per loop -sqlite 100: 100 loops, best of 3: 2.57 msec per loop -sqlite 1000: 10 loops, best of 3: 25.4 msec per loop - -read from :memory: -sqlite 10: 1000 loops, best of 3: 233 usec per loop -sqlite 100: 100 loops, best of 3: 2.32 msec per loop -sqlite 1000: 10 loops, best of 3: 23.2 msec per loop - -write to file -dumb 10: 100 loops, best of 3: 3.89 msec per loop -dumb 100: 10 loops, best of 3: 40.9 msec per loop -dumb 1000: 10 loops, best of 3: 415 msec per loop -gnu 10: 1000 loops, best of 3: 306 usec per loop -gnu 100: 100 loops, best of 3: 2.96 msec per loop -gnu 1000: 10 loops, best of 3: 30.1 msec per loop -ndbm 10: 10000 loops, best of 3: 27 usec per loop -ndbm 100: 1000 loops, best of 3: 283 usec per loop -ndbm 1000: 100 loops, best of 3: 6.08 msec per loop -sqlite 10: 1000 loops, best of 3: 750 usec per loop -sqlite 100: 100 loops, best of 3: 8.19 msec per loop -sqlite 1000: 10 loops, best of 3: 94.1 msec per loop - -write to :memory: -sqlite 10: 1000 loops, best of 3: 293 usec per loop -sqlite 100: 100 loops, best of 3: 3.25 msec per loop -sqlite 1000: 10 loops, best of 3: 34.9 msec per loop - -keys from file -dumb 10: 100000 loops, best of 3: 14.6 usec per loop -dumb 100: 10000 loops, best of 3: 141 usec per loop -dumb 1000: 1000 loops, best of 3: 1.43 msec per loop -gnu 10: 10000 loops, best of 3: 35.3 usec per loop -gnu 100: 1000 loops, best of 3: 354 usec per loop -gnu 1000: 100 loops, best of 3: 3.56 msec per loop -ndbm 10: 100000 loops, best of 3: 5.78 usec per loop -ndbm 100: 10000 loops, best of 3: 53.1 usec per loop -ndbm 1000: 1000 loops, best of 3: 532 usec per loop -sqlite 10: 10000 loops, best of 3: 183 usec per loop -sqlite 100: 1000 loops, best of 3: 1.79 msec per loop -sqlite 1000: 100 loops, best of 3: 18 msec per loop - -keys from :memory: -sqlite 10: 10000 loops, best of 3: 164 usec per loop -sqlite 100: 1000 loops, best of 3: 1.64 msec per loop -sqlite 1000: 100 loops, best of 3: 16.4 msec per loop - -iterkeys from file -dumb 10: 100000 loops, best of 3: 9.87 usec per loop -dumb 100: 10000 loops, best of 3: 93.3 usec per loop -dumb 1000: 1000 loops, best of 3: 943 usec per loop -sqlite 10: 1000 loops, best of 3: 285 usec per loop -sqlite 100: 100 loops, best of 3: 2.91 msec per loop -sqlite 1000: 10 loops, best of 3: 29.1 msec per loop - -iterkeys from :memory: -sqlite 10: 1000 loops, best of 3: 265 usec per loop -sqlite 100: 100 loops, best of 3: 2.63 msec per loop -sqlite 1000: 10 loops, best of 3: 26.5 msec per loop - -Note the poor performance compared to dbm.dumb while reading keys. + OSX 10.5.4 with SQLite 3.6.2). See sqliteperf.sh and sqliteperf.out. + Note the poor performance compared to dbm.dumb while reading keys. """ import sqlite3 Added: sandbox/trunk/dbm_sqlite/Lib/dbm/sqliteperf.out ============================================================================== --- (empty file) +++ sandbox/trunk/dbm_sqlite/Lib/dbm/sqliteperf.out Sun Jan 4 13:44:20 2009 @@ -0,0 +1,74 @@ +As of 2009-01-04 I get this output on a 2.2GHz MacBook Pro: + +module version: (2, 4, 1) +sqlite version: (3, 6, 2) + +read from file +dumb 10: 1000 loops, best of 3: 1.04 msec per loop +dumb 100: 100 loops, best of 3: 10.4 msec per loop +dumb 1000: 10 loops, best of 3: 104 msec per loop +gnu 10: 100000 loops, best of 3: 4.41 usec per loop +gnu 100: 10000 loops, best of 3: 38.5 usec per loop +gnu 1000: 1000 loops, best of 3: 395 usec per loop +ndbm 10: 100000 loops, best of 3: 3.64 usec per loop +ndbm 100: 10000 loops, best of 3: 31.1 usec per loop +ndbm 1000: 1000 loops, best of 3: 320 usec per loop +sqlite 10: 1000 loops, best of 3: 258 usec per loop +sqlite 100: 100 loops, best of 3: 2.57 msec per loop +sqlite 1000: 10 loops, best of 3: 25.4 msec per loop + +read from :memory: +sqlite 10: 1000 loops, best of 3: 233 usec per loop +sqlite 100: 100 loops, best of 3: 2.32 msec per loop +sqlite 1000: 10 loops, best of 3: 23.2 msec per loop + +write to file +dumb 10: 100 loops, best of 3: 3.89 msec per loop +dumb 100: 10 loops, best of 3: 40.9 msec per loop +dumb 1000: 10 loops, best of 3: 415 msec per loop +gnu 10: 1000 loops, best of 3: 306 usec per loop +gnu 100: 100 loops, best of 3: 2.96 msec per loop +gnu 1000: 10 loops, best of 3: 30.1 msec per loop +ndbm 10: 10000 loops, best of 3: 27 usec per loop +ndbm 100: 1000 loops, best of 3: 283 usec per loop +ndbm 1000: 100 loops, best of 3: 6.08 msec per loop +sqlite 10: 1000 loops, best of 3: 750 usec per loop +sqlite 100: 100 loops, best of 3: 8.19 msec per loop +sqlite 1000: 10 loops, best of 3: 94.1 msec per loop + +write to :memory: +sqlite 10: 1000 loops, best of 3: 293 usec per loop +sqlite 100: 100 loops, best of 3: 3.25 msec per loop +sqlite 1000: 10 loops, best of 3: 34.9 msec per loop + +keys from file +dumb 10: 100000 loops, best of 3: 14.6 usec per loop +dumb 100: 10000 loops, best of 3: 141 usec per loop +dumb 1000: 1000 loops, best of 3: 1.43 msec per loop +gnu 10: 10000 loops, best of 3: 35.3 usec per loop +gnu 100: 1000 loops, best of 3: 354 usec per loop +gnu 1000: 100 loops, best of 3: 3.56 msec per loop +ndbm 10: 100000 loops, best of 3: 5.78 usec per loop +ndbm 100: 10000 loops, best of 3: 53.1 usec per loop +ndbm 1000: 1000 loops, best of 3: 532 usec per loop +sqlite 10: 10000 loops, best of 3: 183 usec per loop +sqlite 100: 1000 loops, best of 3: 1.79 msec per loop +sqlite 1000: 100 loops, best of 3: 18 msec per loop + +keys from :memory: +sqlite 10: 10000 loops, best of 3: 164 usec per loop +sqlite 100: 1000 loops, best of 3: 1.64 msec per loop +sqlite 1000: 100 loops, best of 3: 16.4 msec per loop + +iterkeys from file +dumb 10: 100000 loops, best of 3: 9.87 usec per loop +dumb 100: 10000 loops, best of 3: 93.3 usec per loop +dumb 1000: 1000 loops, best of 3: 943 usec per loop +sqlite 10: 1000 loops, best of 3: 285 usec per loop +sqlite 100: 100 loops, best of 3: 2.91 msec per loop +sqlite 1000: 10 loops, best of 3: 29.1 msec per loop + +iterkeys from :memory: +sqlite 10: 1000 loops, best of 3: 265 usec per loop +sqlite 100: 100 loops, best of 3: 2.63 msec per loop +sqlite 1000: 10 loops, best of 3: 26.5 msec per loop Added: sandbox/trunk/dbm_sqlite/Lib/dbm/sqliteperf.sh ============================================================================== --- (empty file) +++ sandbox/trunk/dbm_sqlite/Lib/dbm/sqliteperf.sh Sun Jan 4 13:44:20 2009 @@ -0,0 +1,106 @@ +#!/bin/bash + +PYTHON=${PYTHON:-python3.0} + +$PYTHON -c 'import sqlite3 +print("module version:", sqlite3.version_info) +print("sqlite version:", sqlite3.sqlite_version_info) +' + +echo +echo 'read from file' +for m in dumb gnu ndbm sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f[b"1"]' + done +done + +echo +echo 'read from :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f[b"1"]' + done +done + +echo +echo 'write to file' +for m in dumb gnu ndbm sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' + done +done + +echo +echo 'write to :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + 'for i in range('$n'): f[bytes(str(i), "ascii")] = bytes(str(i), "ascii")' + done +done + +echo +echo 'keys from file' +for m in dumb gnu ndbm sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.keys()' + done +done + +echo +echo 'keys from :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.keys()' + done +done + +echo +echo 'iterkeys from file' +for m in dumb sqlite ; do + for n in 10 100 1000 ; do + rm -f /tmp/trash.db* + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open("/tmp/trash.db", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.iterkeys()' + done +done + +echo +echo 'iterkeys from :memory:' +for m in sqlite ; do + for n in 10 100 1000 ; do + echo -n "$m $n: " + $PYTHON -m timeit -s 'import dbm.'$m' as db' \ + -s 'f = db.open(":memory:", "c")' \ + -s 'f[b"1"] = b"a"' \ + 'for i in range('$n'): x = f.iterkeys()' + done +done From buildbot at python.org Sun Jan 4 13:54:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 12:54:47 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090104125447.CA2D61E4002@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/4421 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 4 14:57:27 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 14:57:27 +0100 (CET) Subject: [Python-checkins] r68299 - in python/trunk: Include/pymath.h PC/pyconfig.h configure configure.in pyconfig.h.in Message-ID: <20090104135727.1A9461E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 14:57:26 2009 New Revision: 68299 Log: isinf and isnan are macros, not functions; fix configure script to use AC_CHECK_DECLS instead of AC_CHECK_FUNCS for these. (See discussion in issue #4506) Modified: python/trunk/Include/pymath.h python/trunk/PC/pyconfig.h python/trunk/configure python/trunk/configure.in python/trunk/pyconfig.h.in Modified: python/trunk/Include/pymath.h ============================================================================== --- python/trunk/Include/pymath.h (original) +++ python/trunk/Include/pymath.h Sun Jan 4 14:57:26 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_ISNAN +#ifdef HAVE_DECL_ISNAN #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_ISINF +#ifdef HAVE_DECL_ISINF #define Py_IS_INFINITY(X) isinf(X) #else #define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X)) Modified: python/trunk/PC/pyconfig.h ============================================================================== --- python/trunk/PC/pyconfig.h (original) +++ python/trunk/PC/pyconfig.h Sun Jan 4 14:57:26 2009 @@ -399,11 +399,11 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 -/* Define to 1 if you have the `isinf' function. */ -#define HAVE_ISINF 1 +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 /* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 +#define HAVE_DECL_ISNAN 1 /* Define if on AIX 3. System headers sometimes define this. Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Sun Jan 4 14:57:26 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68292 . +# From configure.in Revision: 68296 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -21797,9 +21797,7 @@ - - -for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p +for ac_func in acosh asinh atanh copysign expm1 finite log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21892,6 +21890,209 @@ fi done +{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isinf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isinf + (void) isinf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isinf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isinf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } +if test $ac_cv_have_decl_isinf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isnan+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isnan + (void) isnan; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isnan=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isnan=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } +if test $ac_cv_have_decl_isnan = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isfinite+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isfinite + (void) isfinite; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isfinite=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isfinite=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } +if test $ac_cv_have_decl_isfinite = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 0 +_ACEOF + + +fi + + LIBS=$LIBS_SAVE Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sun Jan 4 14:57:26 2009 @@ -3209,7 +3209,8 @@ AC_REPLACE_FUNCS(hypot) -AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite log1p]) +AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE Modified: python/trunk/pyconfig.h.in ============================================================================== --- python/trunk/pyconfig.h.in (original) +++ python/trunk/pyconfig.h.in Sun Jan 4 14:57:26 2009 @@ -115,6 +115,18 @@ /* Define if you have the 'resize_term' function. */ #undef HAVE_CURSES_RESIZE_TERM +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#undef HAVE_DECL_ISNAN + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -315,12 +327,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL From python-checkins at python.org Sun Jan 4 16:09:02 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 16:09:02 +0100 (CET) Subject: [Python-checkins] r68300 - in python/branches/py3k: Include/pymath.h PC/pyconfig.h configure configure.in pyconfig.h.in Message-ID: <20090104150902.F28931E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 16:09:02 2009 New Revision: 68300 Log: Merged revisions 68296,68299 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68296 | mark.dickinson | 2009-01-04 12:29:36 +0000 (Sun, 04 Jan 2009) | 6 lines Add autoconf test to detect x87-style double rounding, as described in issue #2937. This information can be helpful for diagnosing platform- specific problems in math and cmath. The result of the test also serves as a fairly reliable indicator of whether the x87 floating-point instructions (as opposed to SSE2) are in use on Intel x86/x86_64 systems. ........ r68299 | mark.dickinson | 2009-01-04 13:57:26 +0000 (Sun, 04 Jan 2009) | 4 lines isinf and isnan are macros, not functions; fix configure script to use AC_CHECK_DECLS instead of AC_CHECK_FUNCS for these. (See discussion in issue #4506) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/pymath.h python/branches/py3k/PC/pyconfig.h python/branches/py3k/configure python/branches/py3k/configure.in python/branches/py3k/pyconfig.h.in Modified: python/branches/py3k/Include/pymath.h ============================================================================== --- python/branches/py3k/Include/pymath.h (original) +++ python/branches/py3k/Include/pymath.h Sun Jan 4 16:09:02 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_ISNAN +#ifdef HAVE_DECL_ISNAN #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_ISINF +#ifdef HAVE_DECL_ISINF #define Py_IS_INFINITY(X) isinf(X) #else #define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X)) Modified: python/branches/py3k/PC/pyconfig.h ============================================================================== --- python/branches/py3k/PC/pyconfig.h (original) +++ python/branches/py3k/PC/pyconfig.h Sun Jan 4 16:09:02 2009 @@ -395,11 +395,11 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 -/* Define to 1 if you have the `isinf' function. */ -#define HAVE_ISINF 1 +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 /* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 +#define HAVE_DECL_ISNAN 1 /* Define if on AIX 3. System headers sometimes define this. Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sun Jan 4 16:09:02 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67461 . +# From configure.in Revision: 68245 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -21214,6 +21214,94 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +if test "${ac_cv_x87_double_rounding+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +if test "$cross_compiling" = yes; then + ac_cv_x87_double_rounding=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_x87_double_rounding=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_x87_double_rounding=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +if test "$ac_cv_x87_double_rounding" = yes +then + +cat >>confdefs.h <<\_ACEOF +#define X87_DOUBLE_ROUNDING 1 +_ACEOF + +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. { echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 @@ -21400,9 +21488,7 @@ - - -for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p +for ac_func in acosh asinh atanh copysign expm1 finite log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21495,6 +21581,209 @@ fi done +{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isinf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isinf + (void) isinf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isinf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isinf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } +if test $ac_cv_have_decl_isinf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isnan+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isnan + (void) isnan; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isnan=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isnan=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } +if test $ac_cv_have_decl_isnan = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isfinite+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isfinite + (void) isfinite; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isfinite=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isfinite=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } +if test $ac_cv_have_decl_isfinite = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 0 +_ACEOF + + +fi + + LIBS=$LIBS_SAVE Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sun Jan 4 16:09:02 2009 @@ -3056,6 +3056,44 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +AC_MSG_CHECKING(for x87-style double rounding) +AC_CACHE_VAL(ac_cv_x87_double_rounding, [ +AC_TRY_RUN([ +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} +], +ac_cv_x87_double_rounding=no, +ac_cv_x87_double_rounding=yes, +ac_cv_x87_double_rounding=no)]) +AC_MSG_RESULT($ac_cv_x87_double_rounding) +if test "$ac_cv_x87_double_rounding" = yes +then + AC_DEFINE(X87_DOUBLE_ROUNDING, 1, + [Define if arithmetic is subject to x87-style double rounding issue]) +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. AC_MSG_CHECKING(whether tanh preserves the sign of zero) @@ -3084,7 +3122,8 @@ AC_REPLACE_FUNCS(hypot) -AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite log1p]) +AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE Modified: python/branches/py3k/pyconfig.h.in ============================================================================== --- python/branches/py3k/pyconfig.h.in (original) +++ python/branches/py3k/pyconfig.h.in Sun Jan 4 16:09:02 2009 @@ -58,6 +58,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BLUETOOTH_H +/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide + chars that would be converted. */ +#undef HAVE_BROKEN_MBSTOWCS + /* Define if nice() returns success/failure instead of the new priority. */ #undef HAVE_BROKEN_NICE @@ -112,6 +116,18 @@ /* Define if you have the 'resize_term' function. */ #undef HAVE_CURSES_RESIZE_TERM +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#undef HAVE_DECL_ISNAN + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -312,12 +328,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -357,7 +367,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `readline' library (-lreadline). */ +/* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ @@ -800,10 +810,6 @@ /* Define to 1 if you have the `wcsxfrm' function. */ #undef HAVE_WCSXFRM -/* Define if mbstowcs(NULL, "text", 0) does not return the number of - wide chars that would be converted */ -#undef HAVE_BROKEN_MBSTOWCS - /* Define if tzset() actually switches the local timezone in a meaningful way. */ #undef HAVE_WORKING_TZSET @@ -984,6 +990,9 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if arithmetic is subject to x87-style double rounding issue */ +#undef X87_DOUBLE_ROUNDING + /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ From python-checkins at python.org Sun Jan 4 16:30:40 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 16:30:40 +0100 (CET) Subject: [Python-checkins] r68301 - python/branches/py3k/Python/bltinmodule.c Message-ID: <20090104153040.274261E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 16:30:39 2009 New Revision: 68301 Log: #4826 exec() doesn't take a file object anymore Modified: python/branches/py3k/Python/bltinmodule.c Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Sun Jan 4 16:30:39 2009 @@ -820,8 +820,8 @@ PyDoc_STRVAR(exec_doc, "exec(object[, globals[, locals]])\n\ \n\ -Read and execute code from a object, which can be a string, a code\n\ -object or a file object.\n\ +Read and execute code from a object, which can be a string or a code\n\ +object.\n\ The globals and locals are dictionaries, defaulting to the current\n\ globals and locals. If only globals is given, locals defaults to it."); From python-checkins at python.org Sun Jan 4 17:06:40 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 17:06:40 +0100 (CET) Subject: [Python-checkins] r68302 - python/trunk/Include/pymath.h Message-ID: <20090104160640.EBC231E4038@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 17:06:40 2009 New Revision: 68302 Log: Oops. Need to check not only that HAVE_DECL_ISINF is defined, but also that it's equal to 1. (If isinf isn't defined, HAVE_DECL_ISINF is defined to be 0, rather than being undefined.) Modified: python/trunk/Include/pymath.h Modified: python/trunk/Include/pymath.h ============================================================================== --- python/trunk/Include/pymath.h (original) +++ python/trunk/Include/pymath.h Sun Jan 4 17:06:40 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_DECL_ISNAN +#ifdef HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_DECL_ISINF +#ifdef 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)) From python-checkins at python.org Sun Jan 4 17:41:08 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 17:41:08 +0100 (CET) Subject: [Python-checkins] r68303 - in python/branches/py3k: Include/pymath.h Message-ID: <20090104164108.567171E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 17:41:08 2009 New Revision: 68303 Log: Merged revisions 68302 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68302 | mark.dickinson | 2009-01-04 16:06:40 +0000 (Sun, 04 Jan 2009) | 4 lines Oops. Need to check not only that HAVE_DECL_ISINF is defined, but also that it's equal to 1. (If isinf isn't defined, HAVE_DECL_ISINF is defined to be 0, rather than being undefined.) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/pymath.h Modified: python/branches/py3k/Include/pymath.h ============================================================================== --- python/branches/py3k/Include/pymath.h (original) +++ python/branches/py3k/Include/pymath.h Sun Jan 4 17:41:08 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_DECL_ISNAN +#ifdef HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_DECL_ISINF +#ifdef 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)) From python-checkins at python.org Sun Jan 4 18:02:05 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 18:02:05 +0100 (CET) Subject: [Python-checkins] r68304 - python/trunk/Include/pymath.h Message-ID: <20090104170205.9BDB51E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 18:02:05 2009 New Revision: 68304 Log: Fix HAVE_DECL_ISINF/ISNAN test (again). Modified: python/trunk/Include/pymath.h Modified: python/trunk/Include/pymath.h ============================================================================== --- python/trunk/Include/pymath.h (original) +++ python/trunk/Include/pymath.h Sun Jan 4 18:02:05 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 +#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)) From python-checkins at python.org Sun Jan 4 18:02:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 18:02:56 +0100 (CET) Subject: [Python-checkins] r68305 - in python/branches/py3k: Include/pymath.h Message-ID: <20090104170256.EDB2C1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 18:02:56 2009 New Revision: 68305 Log: Merged revisions 68304 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68304 | mark.dickinson | 2009-01-04 17:02:05 +0000 (Sun, 04 Jan 2009) | 2 lines Fix HAVE_DECL_ISINF/ISNAN test (again). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/pymath.h Modified: python/branches/py3k/Include/pymath.h ============================================================================== --- python/branches/py3k/Include/pymath.h (original) +++ python/branches/py3k/Include/pymath.h Sun Jan 4 18:02:56 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 +#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)) From buildbot at python.org Sun Jan 4 18:16:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 17:16:35 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090104171635.965C71E4002@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/67 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_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 4 19:22:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 18:22:26 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.x Message-ID: <20090104182226.838D61E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.x/builds/51 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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 Jan 4 19:27:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 19:27:19 +0100 (CET) Subject: [Python-checkins] r68306 - sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Message-ID: <20090104182719.61F631E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 19:27:19 2009 New Revision: 68306 Log: fix_urllib: add mappings for the url parsing functions Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Sun Jan 4 19:27:19 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pahtname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -34,9 +37,12 @@ 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) # def alternates(members): # return "(" + "|".join(map(repr, members)) + ")" From python-checkins at python.org Sun Jan 4 19:30:01 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 19:30:01 +0100 (CET) Subject: [Python-checkins] r68307 - sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Message-ID: <20090104183001.B4A8B1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 19:30:01 2009 New Revision: 68307 Log: remove duplicated function Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Sun Jan 4 19:30:01 2009 @@ -44,9 +44,6 @@ # Duplicate the url parsing functions for urllib2. MAPPING["urllib2"].append(MAPPING["urllib"][1]) -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" - def build_pattern(): bare = set() From buildbot at python.org Sun Jan 4 19:32:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 18:32:24 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20090104183224.3C4801E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/940 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Sun Jan 4 19:41:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 18:41:24 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090104184124.DF08A1E400C@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/853 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: mark.dickinson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Sun Jan 4 19:50:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 19:50:35 +0100 (CET) Subject: [Python-checkins] r68308 - sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Message-ID: <20090104185035.13E0D1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 19:50:34 2009 New Revision: 68308 Log: turtle is no longer renamed Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Sun Jan 4 19:50:34 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', From python-checkins at python.org Sun Jan 4 19:53:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 19:53:29 +0100 (CET) Subject: [Python-checkins] r68309 - in python/branches/py3k/Demo: tix/grid.py tix/samples/Balloon.py tix/samples/BtnBox.py tix/samples/CmpImg.py tix/samples/ComboBox.py tix/samples/Control.py tix/samples/DirList.py tix/samples/DirTree.py tix/samples/NoteBook.py tix/samples/OptMenu.py tix/samples/PanedWin.py tix/samples/PopMenu.py tix/samples/SHList1.py tix/samples/SHList2.py tix/samples/Tree.py tix/tixwidgets.py tkinter/guido/AttrDialog.py tkinter/guido/ManPage.py tkinter/guido/MimeViewer.py tkinter/guido/ShellWindow.py tkinter/guido/brownian.py tkinter/guido/brownian2.py tkinter/guido/canvasevents.py tkinter/guido/dialog.py tkinter/guido/electrons.py tkinter/guido/hanoi.py tkinter/guido/hello.py tkinter/guido/imagedraw.py tkinter/guido/imageview.py tkinter/guido/kill.py tkinter/guido/listtree.py tkinter/guido/mbox.py tkinter/guido/newmenubardemo.py tkinter/guido/optionmenu.py tkinter/guido/paint.py tkinter/guido/rmt.py tkinter/guido/solitaire.py tkinter/guido/sortvisu.py tkinter/guido/ss1.py tkinter/guido/svkill.py tkinter/guido/switch.py tkinter/guido/tkman.py tkinter/matt/00-HELLO-WORLD.py tkinter/matt/animation-simple.py tkinter/matt/animation-w-velocity-ctrl.py tkinter/matt/bind-w-mult-calls-p-type.py tkinter/matt/canvas-demo-simple.py tkinter/matt/canvas-gridding.py tkinter/matt/canvas-moving-or-creating.py tkinter/matt/canvas-moving-w-mouse.py tkinter/matt/canvas-mult-item-sel.py tkinter/matt/canvas-reading-tag-info.py tkinter/matt/canvas-w-widget-draw-el.py tkinter/matt/canvas-with-scrollbars.py tkinter/matt/dialog-box.py tkinter/matt/entry-simple.py tkinter/matt/entry-with-shared-variable.py tkinter/matt/killing-window-w-wm.py tkinter/matt/menu-all-types-of-entries.py tkinter/matt/menu-simple.py tkinter/matt/not-what-you-might-think-1.py tkinter/matt/not-what-you-might-think-2.py tkinter/matt/packer-and-placer-together.py tkinter/matt/packer-simple.py tkinter/matt/placer-simple.py tkinter/matt/pong-demo-1.py tkinter/matt/printing-coords-of-items.py tkinter/matt/radiobutton-simple.py tkinter/matt/rubber-band-box-demo-1.py tkinter/matt/rubber-line-demo-1.py tkinter/matt/slider-demo-1.py tkinter/matt/subclass-existing-widgets.py tkinter/matt/two-radio-groups.py tkinter/matt/window-creation-more.py tkinter/matt/window-creation-simple.py tkinter/matt/window-creation-w-location.py Message-ID: <20090104185329.43B6A1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 19:53:28 2009 New Revision: 68309 Log: fix a lot of Tkinter imports Modified: python/branches/py3k/Demo/tix/grid.py python/branches/py3k/Demo/tix/samples/Balloon.py python/branches/py3k/Demo/tix/samples/BtnBox.py python/branches/py3k/Demo/tix/samples/CmpImg.py python/branches/py3k/Demo/tix/samples/ComboBox.py python/branches/py3k/Demo/tix/samples/Control.py python/branches/py3k/Demo/tix/samples/DirList.py python/branches/py3k/Demo/tix/samples/DirTree.py python/branches/py3k/Demo/tix/samples/NoteBook.py python/branches/py3k/Demo/tix/samples/OptMenu.py python/branches/py3k/Demo/tix/samples/PanedWin.py python/branches/py3k/Demo/tix/samples/PopMenu.py python/branches/py3k/Demo/tix/samples/SHList1.py python/branches/py3k/Demo/tix/samples/SHList2.py python/branches/py3k/Demo/tix/samples/Tree.py python/branches/py3k/Demo/tix/tixwidgets.py python/branches/py3k/Demo/tkinter/guido/AttrDialog.py python/branches/py3k/Demo/tkinter/guido/ManPage.py python/branches/py3k/Demo/tkinter/guido/MimeViewer.py python/branches/py3k/Demo/tkinter/guido/ShellWindow.py python/branches/py3k/Demo/tkinter/guido/brownian.py python/branches/py3k/Demo/tkinter/guido/brownian2.py python/branches/py3k/Demo/tkinter/guido/canvasevents.py python/branches/py3k/Demo/tkinter/guido/dialog.py python/branches/py3k/Demo/tkinter/guido/electrons.py python/branches/py3k/Demo/tkinter/guido/hanoi.py python/branches/py3k/Demo/tkinter/guido/hello.py python/branches/py3k/Demo/tkinter/guido/imagedraw.py python/branches/py3k/Demo/tkinter/guido/imageview.py python/branches/py3k/Demo/tkinter/guido/kill.py python/branches/py3k/Demo/tkinter/guido/listtree.py python/branches/py3k/Demo/tkinter/guido/mbox.py python/branches/py3k/Demo/tkinter/guido/newmenubardemo.py python/branches/py3k/Demo/tkinter/guido/optionmenu.py python/branches/py3k/Demo/tkinter/guido/paint.py python/branches/py3k/Demo/tkinter/guido/rmt.py python/branches/py3k/Demo/tkinter/guido/solitaire.py python/branches/py3k/Demo/tkinter/guido/sortvisu.py python/branches/py3k/Demo/tkinter/guido/ss1.py python/branches/py3k/Demo/tkinter/guido/svkill.py python/branches/py3k/Demo/tkinter/guido/switch.py python/branches/py3k/Demo/tkinter/guido/tkman.py python/branches/py3k/Demo/tkinter/matt/00-HELLO-WORLD.py python/branches/py3k/Demo/tkinter/matt/animation-simple.py python/branches/py3k/Demo/tkinter/matt/animation-w-velocity-ctrl.py python/branches/py3k/Demo/tkinter/matt/bind-w-mult-calls-p-type.py python/branches/py3k/Demo/tkinter/matt/canvas-demo-simple.py python/branches/py3k/Demo/tkinter/matt/canvas-gridding.py python/branches/py3k/Demo/tkinter/matt/canvas-moving-or-creating.py python/branches/py3k/Demo/tkinter/matt/canvas-moving-w-mouse.py python/branches/py3k/Demo/tkinter/matt/canvas-mult-item-sel.py python/branches/py3k/Demo/tkinter/matt/canvas-reading-tag-info.py python/branches/py3k/Demo/tkinter/matt/canvas-w-widget-draw-el.py python/branches/py3k/Demo/tkinter/matt/canvas-with-scrollbars.py python/branches/py3k/Demo/tkinter/matt/dialog-box.py python/branches/py3k/Demo/tkinter/matt/entry-simple.py python/branches/py3k/Demo/tkinter/matt/entry-with-shared-variable.py python/branches/py3k/Demo/tkinter/matt/killing-window-w-wm.py python/branches/py3k/Demo/tkinter/matt/menu-all-types-of-entries.py python/branches/py3k/Demo/tkinter/matt/menu-simple.py python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-1.py python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-2.py python/branches/py3k/Demo/tkinter/matt/packer-and-placer-together.py python/branches/py3k/Demo/tkinter/matt/packer-simple.py python/branches/py3k/Demo/tkinter/matt/placer-simple.py python/branches/py3k/Demo/tkinter/matt/pong-demo-1.py python/branches/py3k/Demo/tkinter/matt/printing-coords-of-items.py python/branches/py3k/Demo/tkinter/matt/radiobutton-simple.py python/branches/py3k/Demo/tkinter/matt/rubber-band-box-demo-1.py python/branches/py3k/Demo/tkinter/matt/rubber-line-demo-1.py python/branches/py3k/Demo/tkinter/matt/slider-demo-1.py python/branches/py3k/Demo/tkinter/matt/subclass-existing-widgets.py python/branches/py3k/Demo/tkinter/matt/two-radio-groups.py python/branches/py3k/Demo/tkinter/matt/window-creation-more.py python/branches/py3k/Demo/tkinter/matt/window-creation-simple.py python/branches/py3k/Demo/tkinter/matt/window-creation-w-location.py Modified: python/branches/py3k/Demo/tix/grid.py ============================================================================== --- python/branches/py3k/Demo/tix/grid.py (original) +++ python/branches/py3k/Demo/tix/grid.py Sun Jan 4 19:53:28 2009 @@ -1,5 +1,5 @@ ### -import Tix as tk +import tkinter.tix as tk from pprint import pprint r= tk.Tk() Modified: python/branches/py3k/Demo/tix/samples/Balloon.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/Balloon.py (original) +++ python/branches/py3k/Demo/tix/samples/Balloon.py Sun Jan 4 19:53:28 2009 @@ -15,7 +15,7 @@ # Your can display the help message in a "balloon" and a status bar widget. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -32,20 +32,20 @@ z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) - status = Tix.Label(w, width=40, relief=Tix.SUNKEN, bd=1) - status.pack(side=Tix.BOTTOM, fill=Tix.Y, padx=2, pady=1) + status = tkinter.tix.Label(w, width=40, relief=tkinter.tix.SUNKEN, bd=1) + status.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.Y, padx=2, pady=1) # Create two mysterious widgets that need balloon help - button1 = Tix.Button(w, text='Something Unexpected', + button1 = tkinter.tix.Button(w, text='Something Unexpected', command=self.quitcmd) - button2 = Tix.Button(w, text='Something Else Unexpected') + button2 = tkinter.tix.Button(w, text='Something Else Unexpected') button2['command'] = lambda w=button2: w.destroy() - button1.pack(side=Tix.TOP, expand=1) - button2.pack(side=Tix.TOP, expand=1) + button1.pack(side=tkinter.tix.TOP, expand=1) + button2.pack(side=tkinter.tix.TOP, expand=1) # Create the balloon widget and associate it with the widgets that we want # to provide tips for: - b = Tix.Balloon(w, statusbar=status) + b = tkinter.tix.Balloon(w, statusbar=status) b.bind_widget(button1, balloonmsg='Close Window', statusmsg='Press this button to close this window') @@ -64,5 +64,5 @@ self.root.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k/Demo/tix/samples/BtnBox.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/BtnBox.py (original) +++ python/branches/py3k/Demo/tix/samples/BtnBox.py Sun Jan 4 19:53:28 2009 @@ -15,13 +15,13 @@ # for example. # -import Tix +import tkinter.tix def RunSample(w): # Create the label on the top of the dialog box # - top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED, - anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') + top = tkinter.tix.Label(w, padx=20, pady=10, bd=1, relief=tkinter.tix.RAISED, + anchor=tkinter.tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') # Create the button box and add a few buttons in it. Set the # -width of all the buttons to the same value so that they @@ -30,15 +30,15 @@ # Note that the -text, -underline, -command and -width options are all # standard options of the button widgets. # - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='OK', underline=0, width=5, command=lambda w=w: w.destroy()) box.add('close', text='Cancel', underline=0, width=5, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/samples/CmpImg.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/CmpImg.py (original) +++ python/branches/py3k/Demo/tix/samples/CmpImg.py Sun Jan 4 19:53:28 2009 @@ -15,7 +15,7 @@ # buttons # -import Tix +import tkinter.tix network_pixmap = """/* XPM */ static char * netw_xpm[] = { @@ -144,15 +144,15 @@ """ def RunSample(w): - w.img0 = Tix.Image('pixmap', data=network_pixmap) + w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap) if not w.img0: - w.img0 = Tix.Image('bitmap', data=network_bitmap) - w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap) + w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap) + w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap) if not w.img0: - w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap) + w.img1 = tkinter.tix.Image('bitmap', data=hard_disk_bitmap) - hdd = Tix.Button(w, padx=4, pady=1, width=120) - net = Tix.Button(w, padx=4, pady=1, width=120) + hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120) + net = tkinter.tix.Button(w, padx=4, pady=1, width=120) # Create the first image: we create a line, then put a string, # a space and a image into this line, from left to right. @@ -160,7 +160,7 @@ # individual items # # The tk.calls should be methods in Tix ... - w.hdd_img = Tix.Image('compound', window=hdd) + w.hdd_img = tkinter.tix.Image('compound', window=hdd) w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line') w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk', '-underline', '0') @@ -172,7 +172,7 @@ hdd['image'] = w.hdd_img # Next button - w.net_img = Tix.Image('compound', window=net) + w.net_img = tkinter.tix.Image('compound', window=net) w.net_img.tk.call(str(w.net_img), 'add', 'line') w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network', '-underline', '0') @@ -183,14 +183,14 @@ # net['image'] = w.net_img - close = Tix.Button(w, pady=1, text='Close', + close = tkinter.tix.Button(w, pady=1, text='Close', command=lambda w=w: w.destroy()) - hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - net.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - close.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) + hdd.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/samples/ComboBox.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/ComboBox.py (original) +++ python/branches/py3k/Demo/tix/samples/ComboBox.py Sun Jan 4 19:53:28 2009 @@ -13,15 +13,15 @@ # This file demonstrates the use of the tixComboBox widget, which is close # to the MS Window Combo Box control. # -import Tix +import tkinter.tix def RunSample(w): global demo_month, demo_year - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) - demo_month = Tix.StringVar() - demo_year = Tix.StringVar() + demo_month = tkinter.tix.StringVar() + demo_year = tkinter.tix.StringVar() # $w.top.a is a drop-down combo box. It is not editable -- who wants # to invent new months? @@ -30,7 +30,7 @@ # [Hint] We set the label.width subwidget option of both comboboxes to # be 10 so that their labels appear to be aligned. # - a = Tix.ComboBox(top, label="Month: ", dropdown=1, + a = tkinter.tix.ComboBox(top, label="Month: ", dropdown=1, command=select_month, editable=0, variable=demo_month, options='listbox.height 6 label.width 10 label.anchor e') @@ -43,31 +43,31 @@ # [Hint] Notice that you should use padY (the NAME of the option) and not # pady (the SWITCH of the option). # - b = Tix.ComboBox(top, label="Year: ", dropdown=0, + b = tkinter.tix.ComboBox(top, label="Year: ", dropdown=0, command=select_year, editable=1, variable=demo_year, options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne') - a.pack(side=Tix.TOP, anchor=Tix.W) - b.pack(side=Tix.TOP, anchor=Tix.W) + a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) - a.insert(Tix.END, 'January') - a.insert(Tix.END, 'February') - a.insert(Tix.END, 'March') - a.insert(Tix.END, 'April') - a.insert(Tix.END, 'May') - a.insert(Tix.END, 'June') - a.insert(Tix.END, 'July') - a.insert(Tix.END, 'August') - a.insert(Tix.END, 'September') - a.insert(Tix.END, 'October') - a.insert(Tix.END, 'November') - a.insert(Tix.END, 'December') - - b.insert(Tix.END, '1992') - b.insert(Tix.END, '1993') - b.insert(Tix.END, '1994') - b.insert(Tix.END, '1995') - b.insert(Tix.END, '1996') + a.insert(tkinter.tix.END, 'January') + a.insert(tkinter.tix.END, 'February') + a.insert(tkinter.tix.END, 'March') + a.insert(tkinter.tix.END, 'April') + a.insert(tkinter.tix.END, 'May') + a.insert(tkinter.tix.END, 'June') + a.insert(tkinter.tix.END, 'July') + a.insert(tkinter.tix.END, 'August') + a.insert(tkinter.tix.END, 'September') + a.insert(tkinter.tix.END, 'October') + a.insert(tkinter.tix.END, 'November') + a.insert(tkinter.tix.END, 'December') + + b.insert(tkinter.tix.END, '1992') + b.insert(tkinter.tix.END, '1993') + b.insert(tkinter.tix.END, '1994') + b.insert(tkinter.tix.END, '1995') + b.insert(tkinter.tix.END, '1996') # Use "tixSetSilent" to set the values of the combo box if you # don't want your -command procedures (cbx:select_month and @@ -76,13 +76,13 @@ a.set_silent('January') b.set_silent('1995') - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: ok_command(w)) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def select_month(event=None): # tixDemo:Status "Month = %s" % demo_month.get() @@ -97,6 +97,6 @@ w.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/samples/Control.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/Control.py (original) +++ python/branches/py3k/Demo/tix/samples/Control.py Sun Jan 4 19:53:28 2009 @@ -18,7 +18,7 @@ # integer values; one lets you select floating point values and the last # one lets you select a few names. -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -34,14 +34,14 @@ global demo_maker, demo_thrust, demo_num_engines - demo_maker = Tix.StringVar() - demo_thrust = Tix.DoubleVar() - demo_num_engines = Tix.IntVar() + demo_maker = tkinter.tix.StringVar() + demo_thrust = tkinter.tix.DoubleVar() + demo_num_engines = tkinter.tix.IntVar() demo_maker.set('P&W') demo_thrust.set(20000.0) demo_num_engines.set(2) - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) # $w.top.a allows only integer values # @@ -49,16 +49,16 @@ # [Hint] We set the label.width subwidget option of the Controls to # be 16 so that their labels appear to be aligned. # - a = Tix.Control(top, label='Number of Engines: ', integer=1, + a = tkinter.tix.Control(top, label='Number of Engines: ', integer=1, variable=demo_num_engines, min=1, max=4, options='entry.width 10 label.width 20 label.anchor e') - b = Tix.Control(top, label='Thrust: ', integer=0, + b = tkinter.tix.Control(top, label='Thrust: ', integer=0, min='10000.0', max='60000.0', step=500, variable=demo_thrust, options='entry.width 10 label.width 20 label.anchor e') - c = Tix.Control(top, label='Engine Maker: ', value='P&W', + c = tkinter.tix.Control(top, label='Engine Maker: ', value='P&W', variable=demo_maker, options='entry.width 10 label.width 20 label.anchor e') @@ -68,17 +68,17 @@ c['decrcmd'] = lambda w=c: adjust_maker(w, -1) c['validatecmd'] = lambda w=c: validate_maker(w) - a.pack(side=Tix.TOP, anchor=Tix.W) - b.pack(side=Tix.TOP, anchor=Tix.W) - c.pack(side=Tix.TOP, anchor=Tix.W) + a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + c.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.okcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def okcmd (self): # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get()) @@ -118,5 +118,5 @@ return maker_list[i] if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k/Demo/tix/samples/DirList.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/DirList.py (original) +++ python/branches/py3k/Demo/tix/samples/DirList.py Sun Jan 4 19:53:28 2009 @@ -16,8 +16,8 @@ # installation directory for an application. # -import Tix, os, copy -from Tkconstants import * +import tkinter.tix, os, copy +from tkinter.constants import * TCL_ALL_EVENTS = 0 @@ -40,25 +40,25 @@ # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 - top = Tix.Frame( w, relief=RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=RAISED, bd=1) # Create the DirList widget. By default it will show the current # directory # # - top.dir = Tix.DirList(top) + top.dir = tkinter.tix.DirList(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # - top.btn = Tix.Button(top, text = " >> ", pady = 0) + top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirList widget, or he can type in the directory # manually # - top.ent = Tix.LabelEntry(top, label="Installation Directory:", + top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 @@ -85,7 +85,7 @@ # Use a ButtonBox to hold the buttons. # - box = Tix.ButtonBox (w, orientation='horizontal') + box = tkinter.tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, @@ -118,14 +118,14 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - import tkMessageBox, traceback + import tkinter.messagebox, traceback try: - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) except: t, v, tb = sys.exc_info() text = "Error running the demo script:\n" for line in traceback.format_exception(t,v,tb): text = text + line + '\n' - d = tkMessageBox.showerror ( 'Tix Demo Error', text) + d = tkinter.messagebox.showerror ( 'Tix Demo Error', text) Modified: python/branches/py3k/Demo/tix/samples/DirTree.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/DirTree.py (original) +++ python/branches/py3k/Demo/tix/samples/DirTree.py Sun Jan 4 19:53:28 2009 @@ -16,8 +16,8 @@ # installation directory for an application. # -import Tix, os, copy -from Tkconstants import * +import tkinter.tix, os, copy +from tkinter.constants import * TCL_ALL_EVENTS = 0 @@ -40,25 +40,25 @@ # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 - top = Tix.Frame( w, relief=RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=RAISED, bd=1) # Create the DirTree widget. By default it will show the current # directory # # - top.dir = Tix.DirTree(top) + top.dir = tkinter.tix.DirTree(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # - top.btn = Tix.Button(top, text = " >> ", pady = 0) + top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirTree widget, or he can type in the directory # manually # - top.ent = Tix.LabelEntry(top, label="Installation Directory:", + top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 @@ -79,7 +79,7 @@ # Use a ButtonBox to hold the buttons. # - box = Tix.ButtonBox (w, orientation='horizontal') + box = tkinter.tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, @@ -113,5 +113,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k/Demo/tix/samples/NoteBook.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/NoteBook.py (original) +++ python/branches/py3k/Demo/tix/samples/NoteBook.py Sun Jan 4 19:53:28 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixNoteBook widget, which allows # you to lay out your interface using a "notebook" metaphore # -import Tix +import tkinter.tix def RunSample(w): global root @@ -21,20 +21,20 @@ # We use these options to set the sizes of the subwidgets inside the # notebook, so that they are well-aligned on the screen. - prefix = Tix.OptionName(w) + prefix = tkinter.tix.OptionName(w) if prefix: prefix = '*'+prefix else: prefix = '' w.option_add(prefix+'*TixControl*entry.width', 10) w.option_add(prefix+'*TixControl*label.width', 18) - w.option_add(prefix+'*TixControl*label.anchor', Tix.E) + w.option_add(prefix+'*TixControl*label.anchor', tkinter.tix.E) w.option_add(prefix+'*TixNoteBook*tagPadX', 8) # Create the notebook widget and set its backpagecolor to gray. # Note that the -backpagecolor option belongs to the "nbframe" # subwidget. - nb = Tix.NoteBook(w, name='nb', ipadx=6, ipady=6) + nb = tkinter.tix.NoteBook(w, name='nb', ipadx=6, ipady=6) nb['bg'] = 'gray' nb.nbframe['backpagecolor'] = 'gray' @@ -45,7 +45,7 @@ nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('network', label="Network", underline=0) - nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP) + nb.pack(expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5 ,side=tkinter.tix.TOP) #---------------------------------------- # Create the first page @@ -54,21 +54,21 @@ # other widgets # tab=nb.hard_disk - f = Tix.Frame(tab) - common = Tix.Frame(tab) + f = tkinter.tix.Frame(tab) + common = tkinter.tix.Frame(tab) - f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) - common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) + f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1) + common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y) - a = Tix.Control(f, value=12, label='Access time: ') - w = Tix.Control(f, value=400, label='Write Throughput: ') - r = Tix.Control(f, value=400, label='Read Throughput: ') - c = Tix.Control(f, value=1021, label='Capacity: ') - - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(f, value=12, label='Access time: ') + w = tkinter.tix.Control(f, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(f, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(f, value=1021, label='Capacity: ') + + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) # Create the common buttons createCommonButtons(common) @@ -79,23 +79,23 @@ tab = nb.network - f = Tix.Frame(tab) - common = Tix.Frame(tab) + f = tkinter.tix.Frame(tab) + common = tkinter.tix.Frame(tab) - f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) - common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) + f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1) + common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y) - a = Tix.Control(f, value=12, label='Access time: ') - w = Tix.Control(f, value=400, label='Write Throughput: ') - r = Tix.Control(f, value=400, label='Read Throughput: ') - c = Tix.Control(f, value=1021, label='Capacity: ') - u = Tix.Control(f, value=10, label='Users: ') - - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) - u.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(f, value=12, label='Access time: ') + w = tkinter.tix.Control(f, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(f, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(f, value=1021, label='Capacity: ') + u = tkinter.tix.Control(f, value=10, label='Users: ') + + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) + u.pack(side=tkinter.tix.TOP, padx=20, pady=2) createCommonButtons(common) @@ -104,16 +104,16 @@ root.destroy() def createCommonButtons(master): - ok = Tix.Button(master, name='ok', text='OK', width=6, + ok = tkinter.tix.Button(master, name='ok', text='OK', width=6, command=doDestroy) - cancel = Tix.Button(master, name='cancel', + cancel = tkinter.tix.Button(master, name='cancel', text='Cancel', width=6, command=doDestroy) - ok.pack(side=Tix.TOP, padx=2, pady=2) - cancel.pack(side=Tix.TOP, padx=2, pady=2) + ok.pack(side=tkinter.tix.TOP, padx=2, pady=2) + cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/samples/OptMenu.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/OptMenu.py (original) +++ python/branches/py3k/Demo/tix/samples/OptMenu.py Sun Jan 4 19:53:28 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixOptionMenu widget -- you can # use it for the user to choose from a fixed set of options # -import Tix +import tkinter.tix options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML', 'tex':'LaTeX', 'rtf':'Rich Text Format'} @@ -21,16 +21,16 @@ def RunSample(w): global demo_opt_from, demo_opt_to - demo_opt_from = Tix.StringVar() - demo_opt_to = Tix.StringVar() + demo_opt_from = tkinter.tix.StringVar() + demo_opt_to = tkinter.tix.StringVar() - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) - from_file = Tix.OptionMenu(top, label="From File Format : ", + from_file = tkinter.tix.OptionMenu(top, label="From File Format : ", variable=demo_opt_from, options = 'label.width 19 label.anchor e menubutton.width 15') - to_file = Tix.OptionMenu(top, label="To File Format : ", + to_file = tkinter.tix.OptionMenu(top, label="To File Format : ", variable=demo_opt_to, options='label.width 19 label.anchor e menubutton.width 15') @@ -47,22 +47,22 @@ demo_opt_from.set('html') demo_opt_to.set('post') - from_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) - to_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) + from_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6) + to_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: ok_command(w)) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def ok_command(w): # tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get()) w.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/samples/PanedWin.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/PanedWin.py (original) +++ python/branches/py3k/Demo/tix/samples/PanedWin.py Sun Jan 4 19:53:28 2009 @@ -15,7 +15,7 @@ # of artical names and the size of the text widget that shows the body # of the article. -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -32,30 +32,30 @@ z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) - group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') + group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') - pane = Tix.PanedWindow(w, orientation='vertical') + pane = tkinter.tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) - list = Tix.ScrolledListBox(p1) + list = tkinter.tix.ScrolledListBox(p1) list.listbox['width'] = 80 list.listbox['height'] = 5 - text = Tix.ScrolledText(p2) + text = tkinter.tix.ScrolledText(p2) text.text['width'] = 80 text.text['height'] = 20 - list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' - text.text.insert(Tix.END, """ + text.text.insert(tkinter.tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi at blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania @@ -70,18 +70,18 @@ """) text.text['state'] = 'disabled' - list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) - text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) + list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) + text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) - group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) + group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.quitcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) - box.pack(side=Tix.BOTTOM, fill=Tix.X) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) def quitcmd (self): self.exit = 0 @@ -94,5 +94,5 @@ self.root.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k/Demo/tix/samples/PopMenu.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/PopMenu.py (original) +++ python/branches/py3k/Demo/tix/samples/PopMenu.py Sun Jan 4 19:53:28 2009 @@ -12,18 +12,18 @@ # This file demonstrates the use of the tixPopupMenu widget. # -import Tix +import tkinter.tix def RunSample(w): # We create the frame and the button, then we'll bind the PopupMenu # to both widgets. The result is, when you press the right mouse # button over $w.top or $w.top.but, the PopupMenu will come up. # - top = Tix.Frame(w, relief=Tix.RAISED, bd=1) - but = Tix.Button(top, text='Press the right mouse button over this button or its surrounding area') - but.pack(expand=1, fill=Tix.BOTH, padx=50, pady=50) + top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1) + but = tkinter.tix.Button(top, text='Press the right mouse button over this button or its surrounding area') + but.pack(expand=1, fill=tkinter.tix.BOTH, padx=50, pady=50) - p = Tix.PopupMenu(top, title='Popup Test') + p = tkinter.tix.PopupMenu(top, title='Popup Test') p.bind_widget(top) p.bind_widget(but) @@ -37,21 +37,21 @@ p.menu.add_command(label='Find', underline=0) p.menu.add_command(label='System', underline=1) p.menu.add_command(label='Help', underline=0) - m1 = Tix.Menu(p.menu) + m1 = tkinter.tix.Menu(p.menu) m1.add_command(label='Hello') p.menu.add_cascade(label='More', menu=m1) - but.pack(side=Tix.TOP, padx=40, pady=50) + but.pack(side=tkinter.tix.TOP, padx=40, pady=50) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: w.destroy()) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/samples/SHList1.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/SHList1.py (original) +++ python/branches/py3k/Demo/tix/samples/SHList1.py Sun Jan 4 19:53:28 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixScrolledHList widget. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -33,13 +33,13 @@ # We create the frame and the ScrolledHList widget # at the top of the dialog box # - top = Tix.Frame( w, relief=Tix.RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1) # Put a simple hierachy into the HList (two levels). Use colors and # separator widgets (frames) to make the list look fancy # - top.a = Tix.ScrolledHList(top) - top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) + top.a = tkinter.tix.ScrolledHList(top) + top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP) # This is our little relational database # @@ -68,13 +68,13 @@ count=0 for boss,name in bosses : if count : - f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150, - bd=2, relief=Tix.SUNKEN ) + f=tkinter.tix.Frame(hlist, name='sep%d' % count, height=2, width=150, + bd=2, relief=tkinter.tix.SUNKEN ) - hlist.add_child( itemtype=Tix.WINDOW, - window=f, state=Tix.DISABLED ) + hlist.add_child( itemtype=tkinter.tix.WINDOW, + window=f, state=tkinter.tix.DISABLED ) - hlist.add(boss, itemtype=Tix.TEXT, text=name) + hlist.add(boss, itemtype=tkinter.tix.TEXT, text=name) count = count+1 @@ -99,15 +99,15 @@ # Use a ButtonBox to hold the buttons. # - box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) + box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, command = self.okcmd) box.add( 'cancel', text='Cancel', underline=0, width=6, command = self.quitcmd) - box.pack( side=Tix.BOTTOM, fill=Tix.X) - top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) + box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 ) def okcmd (self): self.quitcmd() @@ -127,5 +127,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k/Demo/tix/samples/SHList2.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/SHList2.py (original) +++ python/branches/py3k/Demo/tix/samples/SHList2.py Sun Jan 4 19:53:28 2009 @@ -16,7 +16,7 @@ # In a tixHList widget, you can have one ore more columns. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -36,13 +36,13 @@ # We create the frame and the ScrolledHList widget # at the top of the dialog box # - top = Tix.Frame( w, relief=Tix.RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1) # Put a simple hierachy into the HList (two levels). Use colors and # separator widgets (frames) to make the list look fancy # - top.a = Tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) - top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) + top.a = tkinter.tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) + top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP) hlist=top.a.hlist @@ -55,12 +55,12 @@ # First some styles for the headers style={} - style['header'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist, - anchor=Tix.CENTER, padx=8, pady=2, font = boldfont ) + style['header'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist, + anchor=tkinter.tix.CENTER, padx=8, pady=2, font = boldfont ) - hlist.header_create(0, itemtype=Tix.TEXT, text='Name', + hlist.header_create(0, itemtype=tkinter.tix.TEXT, text='Name', style=style['header']) - hlist.header_create(1, itemtype=Tix.TEXT, text='Position', + hlist.header_create(1, itemtype=tkinter.tix.TEXT, text='Position', style=style['header']) # Notice that we use 3 columns in the hlist widget. This way when the user @@ -90,13 +90,13 @@ ('chuck', 'jeff', 'Chuck McLean', 'Cleaner') ] - style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) + style['mgr_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist) - style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) + style['mgr_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist) - style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) + style['empl_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist) - style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) + style['empl_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist) # Let configure the appearance of the HList subwidget # @@ -105,9 +105,9 @@ # Create the boss # - hlist.add ('.', itemtype=Tix.TEXT, text=boss[1], + hlist.add ('.', itemtype=tkinter.tix.TEXT, text=boss[1], style=style['mgr_name']) - hlist.item_create('.', 1, itemtype=Tix.TEXT, text=boss[2], + hlist.item_create('.', 1, itemtype=tkinter.tix.TEXT, text=boss[2], style=style['mgr_posn']) # Create the managers @@ -115,9 +115,9 @@ for key,name,posn in managers : e= '.'+ key - hlist.add(e, itemtype=Tix.TEXT, text=name, + hlist.add(e, itemtype=tkinter.tix.TEXT, text=name, style=style['mgr_name']) - hlist.item_create(e, 1, itemtype=Tix.TEXT, text=posn, + hlist.item_create(e, 1, itemtype=tkinter.tix.TEXT, text=posn, style=style['mgr_posn']) @@ -130,21 +130,21 @@ # parent entryPath / child's name hlist.add(entrypath, text=name, style=style['empl_name']) - hlist.item_create(entrypath, 1, itemtype=Tix.TEXT, + hlist.item_create(entrypath, 1, itemtype=tkinter.tix.TEXT, text = posn, style = style['empl_posn'] ) # Use a ButtonBox to hold the buttons. # - box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) + box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, command = self.okcmd ) box.add( 'cancel', text='Cancel', underline=0, width=6, command = self.quitcmd ) - box.pack( side=Tix.BOTTOM, fill=Tix.X) - top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) + box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 ) def okcmd (self): self.quitcmd() @@ -164,5 +164,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k/Demo/tix/samples/Tree.py ============================================================================== --- python/branches/py3k/Demo/tix/samples/Tree.py (original) +++ python/branches/py3k/Demo/tix/samples/Tree.py Sun Jan 4 19:53:28 2009 @@ -14,30 +14,30 @@ # dynamic hierachical data (the files in the Unix file system) # -import Tix, os +import tkinter.tix, os def RunSample(w): - top = Tix.Frame(w, relief=Tix.RAISED, bd=1) - tree = Tix.Tree(top, options='separator "/"') - tree.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.LEFT) + top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1) + tree = tkinter.tix.Tree(top, options='separator "/"') + tree.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.LEFT) tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir) # The / directory is added in the "open" mode. The user can open it # and then browse its subdirectories ... adddir(tree, "/") - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, command=w.destroy, width=6) box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def adddir(tree, dir): if dir == '/': text = '/' else: text = os.path.basename(dir) - tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text, + tree.hlist.add(dir, itemtype=tkinter.tix.IMAGETEXT, text=text, image=tree.tk.call('tix', 'getimage', 'folder')) try: os.listdir(dir) @@ -71,10 +71,10 @@ if os.path.isdir(dir + '/' + file): adddir(tree, dir + '/' + file) else: - tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file, + tree.hlist.add(dir + '/' + file, itemtype=tkinter.tix.IMAGETEXT, text=file, image=tree.tk.call('tix', 'getimage', 'file')) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k/Demo/tix/tixwidgets.py ============================================================================== --- python/branches/py3k/Demo/tix/tixwidgets.py (original) +++ python/branches/py3k/Demo/tix/tixwidgets.py Sun Jan 4 19:53:28 2009 @@ -12,9 +12,9 @@ # % python tixwidgets.py # -import os, os.path, sys, Tix -from Tkconstants import * -import traceback, tkMessageBox +import os, os.path, sys, tkinter.tix +from tkinter.constants import * +import traceback, tkinter.messagebox TCL_DONT_WAIT = 1<<1 TCL_WINDOW_EVENTS = 1<<2 @@ -30,7 +30,7 @@ self.dir = None # script directory self.balloon = None # balloon widget - self.useBalloons = Tix.StringVar() + self.useBalloons = tkinter.tix.StringVar() self.useBalloons.set('0') self.statusbar = None # status bar widget self.welmsg = None # Msg widget @@ -56,14 +56,14 @@ def MkMainMenu(self): top = self.root - w = Tix.Frame(top, bd=2, relief=RAISED) - file = Tix.Menubutton(w, text='File', underline=0, takefocus=0) - help = Tix.Menubutton(w, text='Help', underline=0, takefocus=0) + w = tkinter.tix.Frame(top, bd=2, relief=RAISED) + file = tkinter.tix.Menubutton(w, text='File', underline=0, takefocus=0) + help = tkinter.tix.Menubutton(w, text='Help', underline=0, takefocus=0) file.pack(side=LEFT) help.pack(side=RIGHT) - fm = Tix.Menu(file, tearoff=0) + fm = tkinter.tix.Menu(file, tearoff=0) file['menu'] = fm - hm = Tix.Menu(help, tearoff=0) + hm = tkinter.tix.Menu(help, tearoff=0) help['menu'] = hm fm.add_command(label='Exit', underline=1, @@ -77,7 +77,7 @@ def MkMainNotebook(self): top = self.root - w = Tix.NoteBook(top, ipadx=5, ipady=5, options=""" + w = tkinter.tix.NoteBook(top, ipadx=5, ipady=5, options=""" tagPadX 6 tagPadY 4 borderWidth 2 @@ -103,8 +103,8 @@ global demo top = self.root - w = Tix.Frame(top, relief=Tix.RAISED, bd=1) - demo.statusbar = Tix.Label(w, relief=Tix.SUNKEN, bd=1) + w = tkinter.tix.Frame(top, relief=tkinter.tix.RAISED, bd=1) + demo.statusbar = tkinter.tix.Label(w, relief=tkinter.tix.SUNKEN, bd=1) demo.statusbar.form(padx=3, pady=3, left=0, right='%70') return w @@ -116,7 +116,7 @@ z.geometry('790x590+10+10') else: z.geometry('890x640+10+10') - demo.balloon = Tix.Balloon(root) + demo.balloon = tkinter.tix.Balloon(root) frame1 = self.MkMainMenu() frame2 = self.MkMainNotebook() frame3 = self.MkMainStatus() @@ -152,7 +152,7 @@ self.exit = 1 return except KeyboardInterrupt: - if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes': + if tkinter.messagebox.askquestion ('Interrupt', 'Really Quit?') == 'yes': # self.tk.eval('exit') self.exit = 1 return @@ -163,7 +163,7 @@ text = "" for line in traceback.format_exception(t,v,tb): text += line + '\n' - try: tkMessageBox.showerror ('Error', text) + try: tkinter.messagebox.showerror ('Error', text) except: pass self.exit = 1 raise SystemExit(1) @@ -191,9 +191,9 @@ def MkWelcomeBar(top): global demo - w = Tix.Frame(top, bd=2, relief=Tix.GROOVE) - b1 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) - b2 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) + w = tkinter.tix.Frame(top, bd=2, relief=tkinter.tix.GROOVE) + b1 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) + b2 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) b1.entry['width'] = 15 b1.slistbox.listbox['height'] = 3 b2.entry['width'] = 4 @@ -202,22 +202,22 @@ demo.welfont = b1 demo.welsize = b2 - b1.insert(Tix.END, 'Courier') - b1.insert(Tix.END, 'Helvetica') - b1.insert(Tix.END, 'Lucida') - b1.insert(Tix.END, 'Times Roman') - - b2.insert(Tix.END, '8') - b2.insert(Tix.END, '10') - b2.insert(Tix.END, '12') - b2.insert(Tix.END, '14') - b2.insert(Tix.END, '18') + b1.insert(tkinter.tix.END, 'Courier') + b1.insert(tkinter.tix.END, 'Helvetica') + b1.insert(tkinter.tix.END, 'Lucida') + b1.insert(tkinter.tix.END, 'Times Roman') + + b2.insert(tkinter.tix.END, '8') + b2.insert(tkinter.tix.END, '10') + b2.insert(tkinter.tix.END, '12') + b2.insert(tkinter.tix.END, '14') + b2.insert(tkinter.tix.END, '18') b1.pick(1) b2.pick(3) - b1.pack(side=Tix.LEFT, padx=4, pady=4) - b2.pack(side=Tix.LEFT, padx=4, pady=4) + b1.pack(side=tkinter.tix.LEFT, padx=4, pady=4) + b2.pack(side=tkinter.tix.LEFT, padx=4, pady=4) demo.balloon.bind_widget(b1, msg='Choose\na font', statusmsg='Choose a font for this page') @@ -228,20 +228,20 @@ def MkWelcomeText(top): global demo - w = Tix.ScrolledWindow(top, scrollbar='auto') + w = tkinter.tix.ScrolledWindow(top, scrollbar='auto') win = w.window text = 'Welcome to TIX in Python' - title = Tix.Label(win, - bd=0, width=30, anchor=Tix.N, text=text) - msg = Tix.Message(win, - bd=0, width=400, anchor=Tix.N, + title = tkinter.tix.Label(win, + bd=0, width=30, anchor=tkinter.tix.N, text=text) + msg = tkinter.tix.Message(win, + bd=0, width=400, anchor=tkinter.tix.N, text='Tix is a set of mega-widgets based on TK. This program \ demonstrates the widgets in the Tix widget set. You can choose the pages \ in this window to look at the corresponding widgets. \n\n\ To quit this program, choose the "File | Exit" command.\n\n\ For more information, see http://tix.sourceforge.net.') - title.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10) - msg.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10) + title.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10) + msg.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10) demo.welmsg = msg return w @@ -267,14 +267,14 @@ w = nb.page(name) options = "label.padX 4" - til = Tix.LabelFrame(w, label='Chooser Widgets', options=options) - cbx = Tix.LabelFrame(w, label='tixComboBox', options=options) - ctl = Tix.LabelFrame(w, label='tixControl', options=options) - sel = Tix.LabelFrame(w, label='tixSelect', options=options) - opt = Tix.LabelFrame(w, label='tixOptionMenu', options=options) - fil = Tix.LabelFrame(w, label='tixFileEntry', options=options) - fbx = Tix.LabelFrame(w, label='tixFileSelectBox', options=options) - tbr = Tix.LabelFrame(w, label='Tool Bar', options=options) + til = tkinter.tix.LabelFrame(w, label='Chooser Widgets', options=options) + cbx = tkinter.tix.LabelFrame(w, label='tixComboBox', options=options) + ctl = tkinter.tix.LabelFrame(w, label='tixControl', options=options) + sel = tkinter.tix.LabelFrame(w, label='tixSelect', options=options) + opt = tkinter.tix.LabelFrame(w, label='tixOptionMenu', options=options) + fil = tkinter.tix.LabelFrame(w, label='tixFileEntry', options=options) + fbx = tkinter.tix.LabelFrame(w, label='tixFileSelectBox', options=options) + tbr = tkinter.tix.LabelFrame(w, label='Tool Bar', options=options) MkTitle(til.frame) MkCombo(cbx.frame) @@ -301,38 +301,38 @@ fbx.form(right=-1, top=0, left='%66') def MkCombo(w): - options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 14) + options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 14) - static = Tix.ComboBox(w, label='Static', editable=0, options=options) - editable = Tix.ComboBox(w, label='Editable', editable=1, options=options) - history = Tix.ComboBox(w, label='History', editable=1, history=1, - anchor=Tix.E, options=options) - static.insert(Tix.END, 'January') - static.insert(Tix.END, 'February') - static.insert(Tix.END, 'March') - static.insert(Tix.END, 'April') - static.insert(Tix.END, 'May') - static.insert(Tix.END, 'June') - static.insert(Tix.END, 'July') - static.insert(Tix.END, 'August') - static.insert(Tix.END, 'September') - static.insert(Tix.END, 'October') - static.insert(Tix.END, 'November') - static.insert(Tix.END, 'December') - - editable.insert(Tix.END, 'Angola') - editable.insert(Tix.END, 'Bangladesh') - editable.insert(Tix.END, 'China') - editable.insert(Tix.END, 'Denmark') - editable.insert(Tix.END, 'Ecuador') - - history.insert(Tix.END, '/usr/bin/ksh') - history.insert(Tix.END, '/usr/local/lib/python') - history.insert(Tix.END, '/var/adm') - - static.pack(side=Tix.TOP, padx=5, pady=3) - editable.pack(side=Tix.TOP, padx=5, pady=3) - history.pack(side=Tix.TOP, padx=5, pady=3) + static = tkinter.tix.ComboBox(w, label='Static', editable=0, options=options) + editable = tkinter.tix.ComboBox(w, label='Editable', editable=1, options=options) + history = tkinter.tix.ComboBox(w, label='History', editable=1, history=1, + anchor=tkinter.tix.E, options=options) + static.insert(tkinter.tix.END, 'January') + static.insert(tkinter.tix.END, 'February') + static.insert(tkinter.tix.END, 'March') + static.insert(tkinter.tix.END, 'April') + static.insert(tkinter.tix.END, 'May') + static.insert(tkinter.tix.END, 'June') + static.insert(tkinter.tix.END, 'July') + static.insert(tkinter.tix.END, 'August') + static.insert(tkinter.tix.END, 'September') + static.insert(tkinter.tix.END, 'October') + static.insert(tkinter.tix.END, 'November') + static.insert(tkinter.tix.END, 'December') + + editable.insert(tkinter.tix.END, 'Angola') + editable.insert(tkinter.tix.END, 'Bangladesh') + editable.insert(tkinter.tix.END, 'China') + editable.insert(tkinter.tix.END, 'Denmark') + editable.insert(tkinter.tix.END, 'Ecuador') + + history.insert(tkinter.tix.END, '/usr/bin/ksh') + history.insert(tkinter.tix.END, '/usr/local/lib/python') + history.insert(tkinter.tix.END, '/var/adm') + + static.pack(side=tkinter.tix.TOP, padx=5, pady=3) + editable.pack(side=tkinter.tix.TOP, padx=5, pady=3) + history.pack(side=tkinter.tix.TOP, padx=5, pady=3) states = ['Bengal', 'Delhi', 'Karnataka', 'Tamil Nadu'] @@ -359,30 +359,30 @@ def MkControl(w): global demo_spintxt - options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 13) + options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 13) - demo_spintxt = Tix.StringVar() + demo_spintxt = tkinter.tix.StringVar() demo_spintxt.set(states[0]) - simple = Tix.Control(w, label='Numbers', options=options) - spintxt = Tix.Control(w, label='States', variable=demo_spintxt, + simple = tkinter.tix.Control(w, label='Numbers', options=options) + spintxt = tkinter.tix.Control(w, label='States', variable=demo_spintxt, options=options) spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1) spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1) spintxt['validatecmd'] = lambda w=spintxt: spin_validate(w) - simple.pack(side=Tix.TOP, padx=5, pady=3) - spintxt.pack(side=Tix.TOP, padx=5, pady=3) + simple.pack(side=tkinter.tix.TOP, padx=5, pady=3) + spintxt.pack(side=tkinter.tix.TOP, padx=5, pady=3) def MkSelect(w): - options = "label.anchor %s" % Tix.CENTER + options = "label.anchor %s" % tkinter.tix.CENTER - sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1, - orientation=Tix.VERTICAL, - labelside=Tix.TOP, + sel1 = tkinter.tix.Select(w, label='Mere Mortals', allowzero=1, radio=1, + orientation=tkinter.tix.VERTICAL, + labelside=tkinter.tix.TOP, options=options) - sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0, - orientation=Tix.VERTICAL, - labelside= Tix.TOP, + sel2 = tkinter.tix.Select(w, label='Geeks', allowzero=1, radio=0, + orientation=tkinter.tix.VERTICAL, + labelside= tkinter.tix.TOP, options=options) sel1.add('eat', text='Eat') @@ -397,13 +397,13 @@ sel2.add('prog3', text='Program') sel2.add('sleep', text='Sleep') - sel1.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X) - sel2.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X) + sel1.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X) + sel2.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X) def MkOptMenu(w): - options='menubutton.width 15 label.anchor %s' % Tix.E + options='menubutton.width 15 label.anchor %s' % tkinter.tix.E - m = Tix.OptionMenu(w, label='File Format : ', options=options) + m = tkinter.tix.OptionMenu(w, label='File Format : ', options=options) m.add_command('text', label='Plain Text') m.add_command('post', label='PostScript') m.add_command('format', label='Formatted Text') @@ -412,27 +412,27 @@ m.add_command('tex', label='LaTeX') m.add_command('rtf', label='Rich Text Format') - m.pack(fill=Tix.X, padx=5, pady=3) + m.pack(fill=tkinter.tix.X, padx=5, pady=3) def MkFileEnt(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='Press the "open file" icon button and a TixFileSelectDialog will popup.') - ent = Tix.FileEntry(w, label='Select a file : ') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - ent.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) + ent = tkinter.tix.FileEntry(w, label='Select a file : ') + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + ent.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) def MkFileBox(w): """The FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.') - box = Tix.FileSelectBox(w) - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - box.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) + box = tkinter.tix.FileSelectBox(w) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + box.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) def MkToolBar(w): """The Select widget is also good for arranging buttons in a tool bar. @@ -441,12 +441,12 @@ options='frame.borderWidth 1' - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Select widget is also good for arranging buttons in a tool bar.') - bar = Tix.Frame(w, bd=2, relief=Tix.RAISED) - font = Tix.Select(w, allowzero=1, radio=0, label='', options=options) - para = Tix.Select(w, allowzero=0, radio=1, label='', options=options) + bar = tkinter.tix.Frame(w, bd=2, relief=tkinter.tix.RAISED) + font = tkinter.tix.Select(w, allowzero=1, radio=0, label='', options=options) + para = tkinter.tix.Select(w, allowzero=0, radio=1, label='', options=options) font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm') font.add('italic', bitmap='@' + demo.dir + '/bitmaps/italic.xbm') @@ -458,24 +458,24 @@ para.add('center', bitmap='@' + demo.dir + '/bitmaps/centerj.xbm') para.add('justify', bitmap='@' + demo.dir + '/bitmaps/justify.xbm') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - bar.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) - font.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3) - para.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + bar.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) + font.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3) + para.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3) def MkTitle(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='There are many types of "chooser" widgets that allow the user to input different types of information') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) def MkScroll(nb, name): w = nb.page(name) options='label.padX 4' - sls = Tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options) - swn = Tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options) - stx = Tix.LabelFrame(w, label='Tix.ScrolledText', options=options) + sls = tkinter.tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options) + swn = tkinter.tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options) + stx = tkinter.tix.LabelFrame(w, label='Tix.ScrolledText', options=options) MkSList(sls.frame) MkSWindow(swn.frame) @@ -490,31 +490,31 @@ """This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear. """ - top = Tix.Frame(w, width=300, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=300, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.') - list = Tix.ScrolledListBox(top, scrollbar='auto') + list = tkinter.tix.ScrolledListBox(top, scrollbar='auto') list.place(x=50, y=150, width=120, height=80) - list.listbox.insert(Tix.END, 'Alabama') - list.listbox.insert(Tix.END, 'California') - list.listbox.insert(Tix.END, 'Montana') - list.listbox.insert(Tix.END, 'New Jersey') - list.listbox.insert(Tix.END, 'New York') - list.listbox.insert(Tix.END, 'Pennsylvania') - list.listbox.insert(Tix.END, 'Washington') + list.listbox.insert(tkinter.tix.END, 'Alabama') + list.listbox.insert(tkinter.tix.END, 'California') + list.listbox.insert(tkinter.tix.END, 'Montana') + list.listbox.insert(tkinter.tix.END, 'New Jersey') + list.listbox.insert(tkinter.tix.END, 'New York') + list.listbox.insert(tkinter.tix.END, 'Pennsylvania') + list.listbox.insert(tkinter.tix.END, 'Washington') - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) list.bind('', func=lambda arg=0, rh=rh, list=list: list.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(list))) @@ -535,29 +535,29 @@ if not os.path.isfile(file): text += ' (Image missing)' - top = Tix.Frame(w, width=330, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=330, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text=text) - win = Tix.ScrolledWindow(top, scrollbar='auto') + win = tkinter.tix.ScrolledWindow(top, scrollbar='auto') image1 = win.window.image_create('photo', file=file) - lbl = Tix.Label(win.window, image=image1) - lbl.pack(expand=1, fill=Tix.BOTH) + lbl = tkinter.tix.Label(win.window, image=image1) + lbl.pack(expand=1, fill=tkinter.tix.BOTH) win.place(x=30, y=150, width=190, height=120) - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) win.bind('', func=lambda arg=0, rh=rh, win=win: win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win))) @@ -570,15 +570,15 @@ def MkSText(w): """The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.""" - top = Tix.Frame(w, width=330, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=330, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') - win = Tix.ScrolledText(top, scrollbar='auto') + win = tkinter.tix.ScrolledText(top, scrollbar='auto') win.text['wrap'] = 'none' - win.text.insert(Tix.END, '''When -scrollbar is set to "auto", the + win.text.insert(tkinter.tix.END, '''When -scrollbar is set to "auto", the scrollbars are shown only when needed. Additional modifiers can be used to force a scrollbar to be shown or hidden. For example, @@ -591,15 +591,15 @@ ) win.place(x=30, y=150, width=190, height=100) - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) win.bind('', func=lambda arg=0, rh=rh, win=win: win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win))) @@ -612,8 +612,8 @@ w = nb.page(name) options='label.padX 4' - pane = Tix.LabelFrame(w, label='Tix.PanedWindow', options=options) - note = Tix.LabelFrame(w, label='Tix.NoteBook', options=options) + pane = tkinter.tix.LabelFrame(w, label='Tix.PanedWindow', options=options) + note = tkinter.tix.LabelFrame(w, label='Tix.NoteBook', options=options) MkPanedWindow(pane.frame) MkNoteBook(note.frame) @@ -626,29 +626,29 @@ the sizes of several panes. The panes can be arranged either vertically or horizontally. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') - group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') + group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') - pane = Tix.PanedWindow(w, orientation='vertical') + pane = tkinter.tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) - list = Tix.ScrolledListBox(p1) - text = Tix.ScrolledText(p2) + list = tkinter.tix.ScrolledListBox(p1) + text = tkinter.tix.ScrolledText(p2) - list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' - text.text.insert(Tix.END, """ + text.text.insert(tkinter.tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi at blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania @@ -661,71 +661,71 @@ support the -image option. For example, you can display a text string string together with a bitmap, at the same time, inside a TK button widget. """) - list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) - text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) + list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) + text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) - msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) + msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1) def MkNoteBook(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The NoteBook widget allows you to layout a complex interface into individual pages.') # prefix = Tix.OptionName(w) # if not prefix: prefix = '' # w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8) - options = "entry.width %d label.width %d label.anchor %s" % (10, 18, Tix.E) + options = "entry.width %d label.width %d label.anchor %s" % (10, 18, tkinter.tix.E) - nb = Tix.NoteBook(w, ipadx=6, ipady=6, options=options) + nb = tkinter.tix.NoteBook(w, ipadx=6, ipady=6, options=options) nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('network', label="Network", underline=0) # Frame for the buttons that are present on all pages - common = Tix.Frame(nb.hard_disk) - common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y) + common = tkinter.tix.Frame(nb.hard_disk) + common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y) CreateCommonButtons(common) # Widgets belonging only to this page - a = Tix.Control(nb.hard_disk, value=12, label='Access Time: ') - w = Tix.Control(nb.hard_disk, value=400, label='Write Throughput: ') - r = Tix.Control(nb.hard_disk, value=400, label='Read Throughput: ') - c = Tix.Control(nb.hard_disk, value=1021, label='Capacity: ') - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(nb.hard_disk, value=12, label='Access Time: ') + w = tkinter.tix.Control(nb.hard_disk, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(nb.hard_disk, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(nb.hard_disk, value=1021, label='Capacity: ') + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) - common = Tix.Frame(nb.network) - common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y) + common = tkinter.tix.Frame(nb.network) + common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y) CreateCommonButtons(common) - a = Tix.Control(nb.network, value=12, label='Access Time: ') - w = Tix.Control(nb.network, value=400, label='Write Throughput: ') - r = Tix.Control(nb.network, value=400, label='Read Throughput: ') - c = Tix.Control(nb.network, value=1021, label='Capacity: ') - u = Tix.Control(nb.network, value=10, label='Users: ') - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) - u.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(nb.network, value=12, label='Access Time: ') + w = tkinter.tix.Control(nb.network, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(nb.network, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(nb.network, value=1021, label='Capacity: ') + u = tkinter.tix.Control(nb.network, value=10, label='Users: ') + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) + u.pack(side=tkinter.tix.TOP, padx=20, pady=2) - msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - nb.pack(side=Tix.TOP, padx=5, pady=5, fill=Tix.BOTH, expand=1) + msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + nb.pack(side=tkinter.tix.TOP, padx=5, pady=5, fill=tkinter.tix.BOTH, expand=1) def CreateCommonButtons(f): - ok = Tix.Button(f, text='OK', width = 6) - cancel = Tix.Button(f, text='Cancel', width = 6) - ok.pack(side=Tix.TOP, padx=2, pady=2) - cancel.pack(side=Tix.TOP, padx=2, pady=2) + ok = tkinter.tix.Button(f, text='OK', width = 6) + cancel = tkinter.tix.Button(f, text='Cancel', width = 6) + ok.pack(side=tkinter.tix.TOP, padx=2, pady=2) + cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2) def MkDirList(nb, name): w = nb.page(name) options = "label.padX 4" - dir = Tix.LabelFrame(w, label='Tix.DirList', options=options) - fsbox = Tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options) + dir = tkinter.tix.LabelFrame(w, label='Tix.DirList', options=options) + fsbox = tkinter.tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options) MkDirListWidget(dir.frame) MkExFileWidget(fsbox.frame) dir.form(top=0, left=0, right='%40', bottom=-1) @@ -736,23 +736,23 @@ system directory and makes it easy for the user to choose and access directories. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix DirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.') - dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - dirlist.pack(side=Tix.TOP, padx=3, pady=3) + dirlist = tkinter.tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16') + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + dirlist.pack(side=tkinter.tix.TOP, padx=3, pady=3) def MkExFileWidget(w): """The TixExFileSelectBox widget is more user friendly than the Motif style FileSelectBox. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.') # There's a bug in the ComboBoxes - the scrolledlistbox is destroyed - box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED) - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - box.pack(side=Tix.TOP, padx=3, pady=3) + box = tkinter.tix.ExFileSelectBox(w, bd=2, relief=tkinter.tix.RAISED) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + box.pack(side=tkinter.tix.TOP, padx=3, pady=3) ### ### List of all the demos we want to show off @@ -875,39 +875,39 @@ w = nb.page(name) options = "label.padX 4" - pane = Tix.PanedWindow(w, orientation='horizontal') - pane.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH) + pane = tkinter.tix.PanedWindow(w, orientation='horizontal') + pane.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH) f1 = pane.add('list', expand='1') f2 = pane.add('text', expand='5') f1['relief'] = 'flat' f2['relief'] = 'flat' - lab = Tix.LabelFrame(f1, label='Select a sample program:') - lab.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5) - lab1 = Tix.LabelFrame(f2, label='Source:') - lab1.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5) + lab = tkinter.tix.LabelFrame(f1, label='Select a sample program:') + lab.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5) + lab1 = tkinter.tix.LabelFrame(f2, label='Source:') + lab1.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5) - slb = Tix.Tree(lab.frame, options='hlist.width 20') - slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5) + slb = tkinter.tix.Tree(lab.frame, options='hlist.width 20') + slb.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5) - stext = Tix.ScrolledText(lab1.frame, name='stext') + stext = tkinter.tix.ScrolledText(lab1.frame, name='stext') font = root.tk.eval('tix option get fixed_font') stext.text.config(font=font) - frame = Tix.Frame(lab1.frame, name='frame') + frame = tkinter.tix.Frame(lab1.frame, name='frame') - run = Tix.Button(frame, text='Run ...', name='run') - view = Tix.Button(frame, text='View Source ...', name='view') - run.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) - view.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) + run = tkinter.tix.Button(frame, text='Run ...', name='run') + view = tkinter.tix.Button(frame, text='View Source ...', name='view') + run.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE) + view.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE) stext.text['bg'] = slb.hlist['bg'] stext.text['state'] = 'disabled' stext.text['wrap'] = 'none' stext.text['width'] = 80 - frame.pack(side=Tix.BOTTOM, expand=0, fill=Tix.X, padx=7) - stext.pack(side=Tix.TOP, expand=0, fill=Tix.BOTH, padx=7) + frame.pack(side=tkinter.tix.BOTTOM, expand=0, fill=tkinter.tix.X, padx=7) + stext.pack(side=tkinter.tix.TOP, expand=0, fill=tkinter.tix.BOTH, padx=7) slb.hlist['separator'] = '.' slb.hlist['width'] = 25 @@ -922,13 +922,13 @@ for type in ['widget', 'image']: if type != 'widget': - x = Tix.Frame(slb.hlist, bd=2, height=2, width=150, - relief=Tix.SUNKEN, bg=slb.hlist['bg']) - slb.hlist.add_child(itemtype=Tix.WINDOW, window=x, state='disabled') - x = slb.hlist.add_child(itemtype=Tix.TEXT, state='disabled', + x = tkinter.tix.Frame(slb.hlist, bd=2, height=2, width=150, + relief=tkinter.tix.SUNKEN, bg=slb.hlist['bg']) + slb.hlist.add_child(itemtype=tkinter.tix.WINDOW, window=x, state='disabled') + x = slb.hlist.add_child(itemtype=tkinter.tix.TEXT, state='disabled', text=comments[type]) for key in stypes[type]: - slb.hlist.add_child(x, itemtype=Tix.TEXT, data=key, + slb.hlist.add_child(x, itemtype=tkinter.tix.TEXT, data=key, text=key) slb.hlist.selection_clear() @@ -955,12 +955,12 @@ if action == 'run': exec('import ' + prog) - w = Tix.Toplevel() + w = tkinter.tix.Toplevel() w.title(title) rtn = eval(prog + '.RunSample') rtn(w) elif action == 'view': - w = Tix.Toplevel() + w = tkinter.tix.Toplevel() w.title('Source view: ' + title) LoadFile(w, demo.dir + '/samples/' + prog + '.py') elif action == 'browse': @@ -968,8 +968,8 @@ def LoadFile(w, fname): global root - b = Tix.Button(w, text='Close', command=w.destroy) - t = Tix.ScrolledText(w) + b = tkinter.tix.Button(w, text='Close', command=w.destroy) + t = tkinter.tix.ScrolledText(w) # b.form(left=0, bottom=0, padx=4, pady=4) # t.form(left=0, bottom=b, right='-0', top=0) t.pack() @@ -985,18 +985,18 @@ def ReadFile(w, fname): old_state = w['state'] w['state'] = 'normal' - w.delete('0.0', Tix.END) + w.delete('0.0', tkinter.tix.END) try: f = open(fname) lines = f.readlines() for s in lines: - w.insert(Tix.END, s) + w.insert(tkinter.tix.END, s) f.close() finally: # w.see('1.0') w['state'] = old_state if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunMain(root) Modified: python/branches/py3k/Demo/tkinter/guido/AttrDialog.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/AttrDialog.py (original) +++ python/branches/py3k/Demo/tkinter/guido/AttrDialog.py Sun Jan 4 19:53:28 2009 @@ -12,7 +12,7 @@ # -- totally static, though different between PackDialog and WidgetDialog # (but even that could be unified) -from Tkinter import * +from tkinter import * class Option: Modified: python/branches/py3k/Demo/tkinter/guido/ManPage.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/ManPage.py (original) +++ python/branches/py3k/Demo/tkinter/guido/ManPage.py Sun Jan 4 19:53:28 2009 @@ -1,9 +1,9 @@ # Widget to display a man page import re -from Tkinter import * -from Tkinter import _tkinter -from ScrolledText import ScrolledText +from tkinter import * +from tkinter import _tkinter +from tkinter.scrolledtext import ScrolledText # XXX These fonts may have to be changed to match your system BOLDFONT = '*-Courier-Bold-R-Normal-*-120-*' Modified: python/branches/py3k/Demo/tkinter/guido/MimeViewer.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/MimeViewer.py (original) +++ python/branches/py3k/Demo/tkinter/guido/MimeViewer.py Sun Jan 4 19:53:28 2009 @@ -5,8 +5,8 @@ import string from types import * -from Tkinter import * -from ScrolledText import ScrolledText +from tkinter import * +from tkinter.scrolledtext import ScrolledText class MimeViewer: def __init__(self, parent, title, msg): Modified: python/branches/py3k/Demo/tkinter/guido/ShellWindow.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/ShellWindow.py (original) +++ python/branches/py3k/Demo/tkinter/guido/ShellWindow.py Sun Jan 4 19:53:28 2009 @@ -1,9 +1,9 @@ import os import sys import string -from Tkinter import * -from ScrolledText import ScrolledText -from Dialog import Dialog +from tkinter import * +from tkinter.scrolledtext import ScrolledText +from tkinter.dialog import Dialog import signal BUFSIZE = 512 Modified: python/branches/py3k/Demo/tkinter/guido/brownian.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/brownian.py (original) +++ python/branches/py3k/Demo/tkinter/guido/brownian.py Sun Jan 4 19:53:28 2009 @@ -1,6 +1,6 @@ # Brownian motion -- an example of a multi-threaded Tkinter program. -from Tkinter import * +from tkinter import * import random import threading import time Modified: python/branches/py3k/Demo/tkinter/guido/brownian2.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/brownian2.py (original) +++ python/branches/py3k/Demo/tkinter/guido/brownian2.py Sun Jan 4 19:53:28 2009 @@ -1,7 +1,7 @@ # Brownian motion -- an example of a NON multi-threaded Tkinter program ;) # By Michele Simoniato, inspired by brownian.py -from Tkinter import * +from tkinter import * import random import sys Modified: python/branches/py3k/Demo/tkinter/guido/canvasevents.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/canvasevents.py (original) +++ python/branches/py3k/Demo/tkinter/guido/canvasevents.py Sun Jan 4 19:53:28 2009 @@ -1,6 +1,6 @@ #! /usr/bin/env python -from Tkinter import * +from tkinter import * from Canvas import Oval, Group, CanvasText Modified: python/branches/py3k/Demo/tkinter/guido/dialog.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/dialog.py (original) +++ python/branches/py3k/Demo/tkinter/guido/dialog.py Sun Jan 4 19:53:28 2009 @@ -4,7 +4,7 @@ # optional bitmap, and any number of buttons. # Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270. -from Tkinter import * +from tkinter import * import sys Modified: python/branches/py3k/Demo/tkinter/guido/electrons.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/electrons.py (original) +++ python/branches/py3k/Demo/tkinter/guido/electrons.py Sun Jan 4 19:53:28 2009 @@ -11,7 +11,7 @@ # /usr/include/X11/bitmaps for samples); it is displayed as the # background of the animation. Default is no bitmap. -from Tkinter import * +from tkinter import * import random Modified: python/branches/py3k/Demo/tkinter/guido/hanoi.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/hanoi.py (original) +++ python/branches/py3k/Demo/tkinter/guido/hanoi.py Sun Jan 4 19:53:28 2009 @@ -10,7 +10,7 @@ # background of the animation. Default is no bitmap. # This uses Steen Lumholt's Tk interface -from Tkinter import * +from tkinter import * # Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c Modified: python/branches/py3k/Demo/tkinter/guido/hello.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/hello.py (original) +++ python/branches/py3k/Demo/tkinter/guido/hello.py Sun Jan 4 19:53:28 2009 @@ -1,7 +1,7 @@ # Display hello, world in a button; clicking it quits the program import sys -from Tkinter import * +from tkinter import * def main(): root = Tk() Modified: python/branches/py3k/Demo/tkinter/guido/imagedraw.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/imagedraw.py (original) +++ python/branches/py3k/Demo/tkinter/guido/imagedraw.py Sun Jan 4 19:53:28 2009 @@ -1,6 +1,6 @@ """Draw on top of an image""" -from Tkinter import * +from tkinter import * import sys def main(): Modified: python/branches/py3k/Demo/tkinter/guido/imageview.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/imageview.py (original) +++ python/branches/py3k/Demo/tkinter/guido/imageview.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import sys def main(): Modified: python/branches/py3k/Demo/tkinter/guido/kill.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/kill.py (original) +++ python/branches/py3k/Demo/tkinter/guido/kill.py Sun Jan 4 19:53:28 2009 @@ -1,7 +1,7 @@ #! /usr/bin/env python # Tkinter interface to Linux `kill' command. -from Tkinter import * +from tkinter import * from string import splitfields from string import split import subprocess Modified: python/branches/py3k/Demo/tkinter/guido/listtree.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/listtree.py (original) +++ python/branches/py3k/Demo/tkinter/guido/listtree.py Sun Jan 4 19:53:28 2009 @@ -3,7 +3,7 @@ import sys import string -from Tkinter import * +from tkinter import * def listtree(master, app): list = Listbox(master, name='list') Modified: python/branches/py3k/Demo/tkinter/guido/mbox.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/mbox.py (original) +++ python/branches/py3k/Demo/tkinter/guido/mbox.py Sun Jan 4 19:53:28 2009 @@ -9,7 +9,7 @@ import string import mhlib -from Tkinter import * +from tkinter import * from dialog import dialog Modified: python/branches/py3k/Demo/tkinter/guido/newmenubardemo.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/newmenubardemo.py (original) +++ python/branches/py3k/Demo/tkinter/guido/newmenubardemo.py Sun Jan 4 19:53:28 2009 @@ -2,7 +2,7 @@ """Play with the new Tk 8.0 toplevel menu option.""" -from Tkinter import * +from tkinter import * class App: Modified: python/branches/py3k/Demo/tkinter/guido/optionmenu.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/optionmenu.py (original) +++ python/branches/py3k/Demo/tkinter/guido/optionmenu.py Sun Jan 4 19:53:28 2009 @@ -1,6 +1,6 @@ # option menu sample (Fredrik Lundh, September 1997) -from Tkinter import * +from tkinter import * root = Tk() Modified: python/branches/py3k/Demo/tkinter/guido/paint.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/paint.py (original) +++ python/branches/py3k/Demo/tkinter/guido/paint.py Sun Jan 4 19:53:28 2009 @@ -20,7 +20,7 @@ davem at magnet.com """ -from Tkinter import * +from tkinter import * """paint.py: not exactly a paint program.. just a smooth line drawing demo.""" Modified: python/branches/py3k/Demo/tkinter/guido/rmt.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/rmt.py (original) +++ python/branches/py3k/Demo/tkinter/guido/rmt.py Sun Jan 4 19:53:28 2009 @@ -11,7 +11,7 @@ # XXX This should be written in a more Python-like style!!! -from Tkinter import * +from tkinter import * import sys # 1. Create basic application structure: menu bar on top of Modified: python/branches/py3k/Demo/tkinter/guido/solitaire.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/solitaire.py (original) +++ python/branches/py3k/Demo/tkinter/guido/solitaire.py Sun Jan 4 19:53:28 2009 @@ -25,7 +25,7 @@ import math import random -from Tkinter import * +from tkinter import * from Canvas import Rectangle, CanvasText, Group, Window Modified: python/branches/py3k/Demo/tkinter/guido/sortvisu.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/sortvisu.py (original) +++ python/branches/py3k/Demo/tkinter/guido/sortvisu.py Sun Jan 4 19:53:28 2009 @@ -19,7 +19,7 @@ """ -from Tkinter import * +from tkinter import * from Canvas import Line, Rectangle import random Modified: python/branches/py3k/Demo/tkinter/guido/ss1.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/ss1.py (original) +++ python/branches/py3k/Demo/tkinter/guido/ss1.py Sun Jan 4 19:53:28 2009 @@ -485,7 +485,7 @@ s = chr(m+ord('A')) + s return s -import Tkinter as Tk +import tkinter as Tk class SheetGUI: Modified: python/branches/py3k/Demo/tkinter/guido/svkill.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/svkill.py (original) +++ python/branches/py3k/Demo/tkinter/guido/svkill.py Sun Jan 4 19:53:28 2009 @@ -2,7 +2,7 @@ # Tkinter interface to SYSV `ps' and `kill' commands. -from Tkinter import * +from tkinter import * if TkVersion < 4.0: raise ImportError("This version of svkill requires Tk 4.0 or later") Modified: python/branches/py3k/Demo/tkinter/guido/switch.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/switch.py (original) +++ python/branches/py3k/Demo/tkinter/guido/switch.py Sun Jan 4 19:53:28 2009 @@ -1,6 +1,6 @@ # Show how to do switchable panels. -from Tkinter import * +from tkinter import * class App: Modified: python/branches/py3k/Demo/tkinter/guido/tkman.py ============================================================================== --- python/branches/py3k/Demo/tkinter/guido/tkman.py (original) +++ python/branches/py3k/Demo/tkinter/guido/tkman.py Sun Jan 4 19:53:28 2009 @@ -6,7 +6,7 @@ import os import string import re -from Tkinter import * +from tkinter import * from ManPage import ManPage MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann'] Modified: python/branches/py3k/Demo/tkinter/matt/00-HELLO-WORLD.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/00-HELLO-WORLD.py (original) +++ python/branches/py3k/Demo/tkinter/matt/00-HELLO-WORLD.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # note that there is no explicit call to start Tk. # Tkinter is smart enough to start the system if it's not already going. Modified: python/branches/py3k/Demo/tkinter/matt/animation-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/animation-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/animation-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This program shows how to use the "after" function to make animation. Modified: python/branches/py3k/Demo/tkinter/matt/animation-w-velocity-ctrl.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/animation-w-velocity-ctrl.py (original) +++ python/branches/py3k/Demo/tkinter/matt/animation-w-velocity-ctrl.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. Modified: python/branches/py3k/Demo/tkinter/matt/bind-w-mult-calls-p-type.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/bind-w-mult-calls-p-type.py (original) +++ python/branches/py3k/Demo/tkinter/matt/bind-w-mult-calls-p-type.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to use a simple type-in box Modified: python/branches/py3k/Demo/tkinter/matt/canvas-demo-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-demo-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-demo-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this program creates a canvas and puts a single polygon on the canvas Modified: python/branches/py3k/Demo/tkinter/matt/canvas-gridding.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-gridding.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-gridding.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. Modified: python/branches/py3k/Demo/tkinter/matt/canvas-moving-or-creating.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-moving-or-creating.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-moving-or-creating.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates a more sophisticated movement -- # move dots or create new ones if you click outside the dots Modified: python/branches/py3k/Demo/tkinter/matt/canvas-moving-w-mouse.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-moving-w-mouse.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-moving-w-mouse.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the movement of a single canvas item under mouse control Modified: python/branches/py3k/Demo/tkinter/matt/canvas-mult-item-sel.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-mult-item-sel.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-mult-item-sel.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # allows moving dots with multiple selection. Modified: python/branches/py3k/Demo/tkinter/matt/canvas-reading-tag-info.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-reading-tag-info.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-reading-tag-info.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k/Demo/tkinter/matt/canvas-w-widget-draw-el.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-w-widget-draw-el.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-w-widget-draw-el.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the creation of widgets as part of a canvas object Modified: python/branches/py3k/Demo/tkinter/matt/canvas-with-scrollbars.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/canvas-with-scrollbars.py (original) +++ python/branches/py3k/Demo/tkinter/matt/canvas-with-scrollbars.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This example program creates a scroling canvas, and demonstrates # how to tie scrollbars and canvses together. The mechanism Modified: python/branches/py3k/Demo/tkinter/matt/dialog-box.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/dialog-box.py (original) +++ python/branches/py3k/Demo/tkinter/matt/dialog-box.py Sun Jan 4 19:53:28 2009 @@ -1,5 +1,5 @@ -from Tkinter import * -from Dialog import Dialog +from tkinter import * +from tkinter.dialog import Dialog # this shows how to create a new window with a button in it # that can create new windows Modified: python/branches/py3k/Demo/tkinter/matt/entry-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/entry-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/entry-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to use a simple type-in box Modified: python/branches/py3k/Demo/tkinter/matt/entry-with-shared-variable.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/entry-with-shared-variable.py (original) +++ python/branches/py3k/Demo/tkinter/matt/entry-with-shared-variable.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to make a typein box shadow a program variable. Modified: python/branches/py3k/Demo/tkinter/matt/killing-window-w-wm.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/killing-window-w-wm.py (original) +++ python/branches/py3k/Demo/tkinter/matt/killing-window-w-wm.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This file shows how to trap the killing of a window # when the user uses window manager menus (typ. upper left hand corner 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 Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages 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 Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages Modified: python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-1.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-1.py (original) +++ python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-1.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-2.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-2.py (original) +++ python/branches/py3k/Demo/tkinter/matt/not-what-you-might-think-2.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k/Demo/tkinter/matt/packer-and-placer-together.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/packer-and-placer-together.py (original) +++ python/branches/py3k/Demo/tkinter/matt/packer-and-placer-together.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that tests the placer geom manager in conjunction with # the packer. The background (green) is packed, while the widget inside is placed Modified: python/branches/py3k/Demo/tkinter/matt/packer-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/packer-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/packer-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k/Demo/tkinter/matt/placer-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/placer-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/placer-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that tests the placer geom manager Modified: python/branches/py3k/Demo/tkinter/matt/pong-demo-1.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/pong-demo-1.py (original) +++ python/branches/py3k/Demo/tkinter/matt/pong-demo-1.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string Modified: python/branches/py3k/Demo/tkinter/matt/printing-coords-of-items.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/printing-coords-of-items.py (original) +++ python/branches/py3k/Demo/tkinter/matt/printing-coords-of-items.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the creation of widgets as part of a canvas object Modified: python/branches/py3k/Demo/tkinter/matt/radiobutton-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/radiobutton-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/radiobutton-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a demo program that shows how to # create radio buttons and how to get other widgets to Modified: python/branches/py3k/Demo/tkinter/matt/rubber-band-box-demo-1.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/rubber-band-box-demo-1.py (original) +++ python/branches/py3k/Demo/tkinter/matt/rubber-band-box-demo-1.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): def printit(self): Modified: python/branches/py3k/Demo/tkinter/matt/rubber-line-demo-1.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/rubber-line-demo-1.py (original) +++ python/branches/py3k/Demo/tkinter/matt/rubber-line-demo-1.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): def printit(self): Modified: python/branches/py3k/Demo/tkinter/matt/slider-demo-1.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/slider-demo-1.py (original) +++ python/branches/py3k/Demo/tkinter/matt/slider-demo-1.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # shows how to make a slider, set and get its value under program control Modified: python/branches/py3k/Demo/tkinter/matt/subclass-existing-widgets.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/subclass-existing-widgets.py (original) +++ python/branches/py3k/Demo/tkinter/matt/subclass-existing-widgets.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that makes a simple two button application Modified: python/branches/py3k/Demo/tkinter/matt/two-radio-groups.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/two-radio-groups.py (original) +++ python/branches/py3k/Demo/tkinter/matt/two-radio-groups.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # The way to think about this is that each radio button menu # controls a different variable -- clicking on one of the Modified: python/branches/py3k/Demo/tkinter/matt/window-creation-more.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/window-creation-more.py (original) +++ python/branches/py3k/Demo/tkinter/matt/window-creation-more.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this shows how to create a new window with a button in it # that can create new windows Modified: python/branches/py3k/Demo/tkinter/matt/window-creation-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/window-creation-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/window-creation-simple.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this shows how to spawn off new windows at a button press Modified: python/branches/py3k/Demo/tkinter/matt/window-creation-w-location.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/window-creation-w-location.py (original) +++ python/branches/py3k/Demo/tkinter/matt/window-creation-w-location.py Sun Jan 4 19:53:28 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import sys ##sys.path.append("/users/mjc4y/projects/python/tkinter/utils") From python-checkins at python.org Sun Jan 4 20:01:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 20:01:20 +0100 (CET) Subject: [Python-checkins] r68310 - in python/branches/release30-maint: Demo/tix/grid.py Demo/tix/samples/Balloon.py Demo/tix/samples/BtnBox.py Demo/tix/samples/CmpImg.py Demo/tix/samples/ComboBox.py Demo/tix/samples/Control.py Demo/tix/samples/DirList.py Demo/tix/samples/DirTree.py Demo/tix/samples/NoteBook.py Demo/tix/samples/OptMenu.py Demo/tix/samples/PanedWin.py Demo/tix/samples/PopMenu.py Demo/tix/samples/SHList1.py Demo/tix/samples/SHList2.py Demo/tix/samples/Tree.py Demo/tix/tixwidgets.py Demo/tkinter/guido/AttrDialog.py Demo/tkinter/guido/ManPage.py Demo/tkinter/guido/MimeViewer.py Demo/tkinter/guido/ShellWindow.py Demo/tkinter/guido/brownian.py Demo/tkinter/guido/brownian2.py Demo/tkinter/guido/canvasevents.py Demo/tkinter/guido/dialog.py Demo/tkinter/guido/electrons.py Demo/tkinter/guido/hanoi.py Demo/tkinter/guido/hello.py Demo/tkinter/guido/imagedraw.py Demo/tkinter/guido/imageview.py Demo/tkinter/guido/kill.py Demo/tkinter/guido/listtree.py Demo/tkinter/guido/mbox.py Demo/tkinter/guido/newmenubardemo.py Demo/tkinter/guido/optionmenu.py Demo/tkinter/guido/paint.py Demo/tkinter/guido/rmt.py Demo/tkinter/guido/solitaire.py Demo/tkinter/guido/sortvisu.py Demo/tkinter/guido/ss1.py Demo/tkinter/guido/svkill.py Demo/tkinter/guido/switch.py Demo/tkinter/guido/tkman.py Demo/tkinter/matt/00-HELLO-WORLD.py Demo/tkinter/matt/animation-simple.py Demo/tkinter/matt/animation-w-velocity-ctrl.py Demo/tkinter/matt/bind-w-mult-calls-p-type.py Demo/tkinter/matt/canvas-demo-simple.py Demo/tkinter/matt/canvas-gridding.py Demo/tkinter/matt/canvas-moving-or-creating.py Demo/tkinter/matt/canvas-moving-w-mouse.py Demo/tkinter/matt/canvas-mult-item-sel.py Demo/tkinter/matt/canvas-reading-tag-info.py Demo/tkinter/matt/canvas-w-widget-draw-el.py Demo/tkinter/matt/canvas-with-scrollbars.py Demo/tkinter/matt/dialog-box.py Demo/tkinter/matt/entry-simple.py Demo/tkinter/matt/entry-with-shared-variable.py Demo/tkinter/matt/killing-window-w-wm.py Demo/tkinter/matt/menu-all-types-of-entries.py Demo/tkinter/matt/menu-simple.py Demo/tkinter/matt/not-what-you-might-think-1.py Demo/tkinter/matt/not-what-you-might-think-2.py Demo/tkinter/matt/packer-and-placer-together.py Demo/tkinter/matt/packer-simple.py Demo/tkinter/matt/placer-simple.py Demo/tkinter/matt/pong-demo-1.py Demo/tkinter/matt/printing-coords-of-items.py Demo/tkinter/matt/radiobutton-simple.py Demo/tkinter/matt/rubber-band-box-demo-1.py Demo/tkinter/matt/rubber-line-demo-1.py Demo/tkinter/matt/slider-demo-1.py Demo/tkinter/matt/subclass-existing-widgets.py Demo/tkinter/matt/two-radio-groups.py Demo/tkinter/matt/window-creation-more.py Demo/tkinter/matt/window-creation-simple.py Demo/tkinter/matt/window-creation-w-location.py Message-ID: <20090104190120.D3CAE1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 20:01:19 2009 New Revision: 68310 Log: Merged revisions 68309 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68309 | benjamin.peterson | 2009-01-04 12:53:28 -0600 (Sun, 04 Jan 2009) | 1 line fix a lot of Tkinter imports ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Demo/tix/grid.py python/branches/release30-maint/Demo/tix/samples/Balloon.py python/branches/release30-maint/Demo/tix/samples/BtnBox.py python/branches/release30-maint/Demo/tix/samples/CmpImg.py python/branches/release30-maint/Demo/tix/samples/ComboBox.py python/branches/release30-maint/Demo/tix/samples/Control.py python/branches/release30-maint/Demo/tix/samples/DirList.py python/branches/release30-maint/Demo/tix/samples/DirTree.py python/branches/release30-maint/Demo/tix/samples/NoteBook.py python/branches/release30-maint/Demo/tix/samples/OptMenu.py python/branches/release30-maint/Demo/tix/samples/PanedWin.py python/branches/release30-maint/Demo/tix/samples/PopMenu.py python/branches/release30-maint/Demo/tix/samples/SHList1.py python/branches/release30-maint/Demo/tix/samples/SHList2.py python/branches/release30-maint/Demo/tix/samples/Tree.py python/branches/release30-maint/Demo/tix/tixwidgets.py python/branches/release30-maint/Demo/tkinter/guido/AttrDialog.py python/branches/release30-maint/Demo/tkinter/guido/ManPage.py python/branches/release30-maint/Demo/tkinter/guido/MimeViewer.py python/branches/release30-maint/Demo/tkinter/guido/ShellWindow.py python/branches/release30-maint/Demo/tkinter/guido/brownian.py python/branches/release30-maint/Demo/tkinter/guido/brownian2.py python/branches/release30-maint/Demo/tkinter/guido/canvasevents.py python/branches/release30-maint/Demo/tkinter/guido/dialog.py python/branches/release30-maint/Demo/tkinter/guido/electrons.py python/branches/release30-maint/Demo/tkinter/guido/hanoi.py python/branches/release30-maint/Demo/tkinter/guido/hello.py python/branches/release30-maint/Demo/tkinter/guido/imagedraw.py python/branches/release30-maint/Demo/tkinter/guido/imageview.py python/branches/release30-maint/Demo/tkinter/guido/kill.py python/branches/release30-maint/Demo/tkinter/guido/listtree.py python/branches/release30-maint/Demo/tkinter/guido/mbox.py python/branches/release30-maint/Demo/tkinter/guido/newmenubardemo.py python/branches/release30-maint/Demo/tkinter/guido/optionmenu.py python/branches/release30-maint/Demo/tkinter/guido/paint.py python/branches/release30-maint/Demo/tkinter/guido/rmt.py python/branches/release30-maint/Demo/tkinter/guido/solitaire.py python/branches/release30-maint/Demo/tkinter/guido/sortvisu.py python/branches/release30-maint/Demo/tkinter/guido/ss1.py python/branches/release30-maint/Demo/tkinter/guido/svkill.py python/branches/release30-maint/Demo/tkinter/guido/switch.py python/branches/release30-maint/Demo/tkinter/guido/tkman.py python/branches/release30-maint/Demo/tkinter/matt/00-HELLO-WORLD.py python/branches/release30-maint/Demo/tkinter/matt/animation-simple.py python/branches/release30-maint/Demo/tkinter/matt/animation-w-velocity-ctrl.py python/branches/release30-maint/Demo/tkinter/matt/bind-w-mult-calls-p-type.py python/branches/release30-maint/Demo/tkinter/matt/canvas-demo-simple.py python/branches/release30-maint/Demo/tkinter/matt/canvas-gridding.py python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-or-creating.py python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-w-mouse.py python/branches/release30-maint/Demo/tkinter/matt/canvas-mult-item-sel.py python/branches/release30-maint/Demo/tkinter/matt/canvas-reading-tag-info.py python/branches/release30-maint/Demo/tkinter/matt/canvas-w-widget-draw-el.py python/branches/release30-maint/Demo/tkinter/matt/canvas-with-scrollbars.py python/branches/release30-maint/Demo/tkinter/matt/dialog-box.py python/branches/release30-maint/Demo/tkinter/matt/entry-simple.py python/branches/release30-maint/Demo/tkinter/matt/entry-with-shared-variable.py python/branches/release30-maint/Demo/tkinter/matt/killing-window-w-wm.py python/branches/release30-maint/Demo/tkinter/matt/menu-all-types-of-entries.py python/branches/release30-maint/Demo/tkinter/matt/menu-simple.py python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-1.py python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-2.py python/branches/release30-maint/Demo/tkinter/matt/packer-and-placer-together.py python/branches/release30-maint/Demo/tkinter/matt/packer-simple.py python/branches/release30-maint/Demo/tkinter/matt/placer-simple.py python/branches/release30-maint/Demo/tkinter/matt/pong-demo-1.py python/branches/release30-maint/Demo/tkinter/matt/printing-coords-of-items.py python/branches/release30-maint/Demo/tkinter/matt/radiobutton-simple.py python/branches/release30-maint/Demo/tkinter/matt/rubber-band-box-demo-1.py python/branches/release30-maint/Demo/tkinter/matt/rubber-line-demo-1.py python/branches/release30-maint/Demo/tkinter/matt/slider-demo-1.py python/branches/release30-maint/Demo/tkinter/matt/subclass-existing-widgets.py python/branches/release30-maint/Demo/tkinter/matt/two-radio-groups.py python/branches/release30-maint/Demo/tkinter/matt/window-creation-more.py python/branches/release30-maint/Demo/tkinter/matt/window-creation-simple.py python/branches/release30-maint/Demo/tkinter/matt/window-creation-w-location.py Modified: python/branches/release30-maint/Demo/tix/grid.py ============================================================================== --- python/branches/release30-maint/Demo/tix/grid.py (original) +++ python/branches/release30-maint/Demo/tix/grid.py Sun Jan 4 20:01:19 2009 @@ -1,5 +1,5 @@ ### -import Tix as tk +import tkinter.tix as tk from pprint import pprint r= tk.Tk() Modified: python/branches/release30-maint/Demo/tix/samples/Balloon.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/Balloon.py (original) +++ python/branches/release30-maint/Demo/tix/samples/Balloon.py Sun Jan 4 20:01:19 2009 @@ -15,7 +15,7 @@ # Your can display the help message in a "balloon" and a status bar widget. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -32,20 +32,20 @@ z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) - status = Tix.Label(w, width=40, relief=Tix.SUNKEN, bd=1) - status.pack(side=Tix.BOTTOM, fill=Tix.Y, padx=2, pady=1) + status = tkinter.tix.Label(w, width=40, relief=tkinter.tix.SUNKEN, bd=1) + status.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.Y, padx=2, pady=1) # Create two mysterious widgets that need balloon help - button1 = Tix.Button(w, text='Something Unexpected', + button1 = tkinter.tix.Button(w, text='Something Unexpected', command=self.quitcmd) - button2 = Tix.Button(w, text='Something Else Unexpected') + button2 = tkinter.tix.Button(w, text='Something Else Unexpected') button2['command'] = lambda w=button2: w.destroy() - button1.pack(side=Tix.TOP, expand=1) - button2.pack(side=Tix.TOP, expand=1) + button1.pack(side=tkinter.tix.TOP, expand=1) + button2.pack(side=tkinter.tix.TOP, expand=1) # Create the balloon widget and associate it with the widgets that we want # to provide tips for: - b = Tix.Balloon(w, statusbar=status) + b = tkinter.tix.Balloon(w, statusbar=status) b.bind_widget(button1, balloonmsg='Close Window', statusmsg='Press this button to close this window') @@ -64,5 +64,5 @@ self.root.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/release30-maint/Demo/tix/samples/BtnBox.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/BtnBox.py (original) +++ python/branches/release30-maint/Demo/tix/samples/BtnBox.py Sun Jan 4 20:01:19 2009 @@ -15,13 +15,13 @@ # for example. # -import Tix +import tkinter.tix def RunSample(w): # Create the label on the top of the dialog box # - top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED, - anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') + top = tkinter.tix.Label(w, padx=20, pady=10, bd=1, relief=tkinter.tix.RAISED, + anchor=tkinter.tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') # Create the button box and add a few buttons in it. Set the # -width of all the buttons to the same value so that they @@ -30,15 +30,15 @@ # Note that the -text, -underline, -command and -width options are all # standard options of the button widgets. # - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='OK', underline=0, width=5, command=lambda w=w: w.destroy()) box.add('close', text='Cancel', underline=0, width=5, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/samples/CmpImg.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/CmpImg.py (original) +++ python/branches/release30-maint/Demo/tix/samples/CmpImg.py Sun Jan 4 20:01:19 2009 @@ -15,7 +15,7 @@ # buttons # -import Tix +import tkinter.tix network_pixmap = """/* XPM */ static char * netw_xpm[] = { @@ -144,15 +144,15 @@ """ def RunSample(w): - w.img0 = Tix.Image('pixmap', data=network_pixmap) + w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap) if not w.img0: - w.img0 = Tix.Image('bitmap', data=network_bitmap) - w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap) + w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap) + w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap) if not w.img0: - w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap) + w.img1 = tkinter.tix.Image('bitmap', data=hard_disk_bitmap) - hdd = Tix.Button(w, padx=4, pady=1, width=120) - net = Tix.Button(w, padx=4, pady=1, width=120) + hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120) + net = tkinter.tix.Button(w, padx=4, pady=1, width=120) # Create the first image: we create a line, then put a string, # a space and a image into this line, from left to right. @@ -160,7 +160,7 @@ # individual items # # The tk.calls should be methods in Tix ... - w.hdd_img = Tix.Image('compound', window=hdd) + w.hdd_img = tkinter.tix.Image('compound', window=hdd) w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line') w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk', '-underline', '0') @@ -172,7 +172,7 @@ hdd['image'] = w.hdd_img # Next button - w.net_img = Tix.Image('compound', window=net) + w.net_img = tkinter.tix.Image('compound', window=net) w.net_img.tk.call(str(w.net_img), 'add', 'line') w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network', '-underline', '0') @@ -183,14 +183,14 @@ # net['image'] = w.net_img - close = Tix.Button(w, pady=1, text='Close', + close = tkinter.tix.Button(w, pady=1, text='Close', command=lambda w=w: w.destroy()) - hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - net.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - close.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) + hdd.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/samples/ComboBox.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/ComboBox.py (original) +++ python/branches/release30-maint/Demo/tix/samples/ComboBox.py Sun Jan 4 20:01:19 2009 @@ -13,15 +13,15 @@ # This file demonstrates the use of the tixComboBox widget, which is close # to the MS Window Combo Box control. # -import Tix +import tkinter.tix def RunSample(w): global demo_month, demo_year - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) - demo_month = Tix.StringVar() - demo_year = Tix.StringVar() + demo_month = tkinter.tix.StringVar() + demo_year = tkinter.tix.StringVar() # $w.top.a is a drop-down combo box. It is not editable -- who wants # to invent new months? @@ -30,7 +30,7 @@ # [Hint] We set the label.width subwidget option of both comboboxes to # be 10 so that their labels appear to be aligned. # - a = Tix.ComboBox(top, label="Month: ", dropdown=1, + a = tkinter.tix.ComboBox(top, label="Month: ", dropdown=1, command=select_month, editable=0, variable=demo_month, options='listbox.height 6 label.width 10 label.anchor e') @@ -43,31 +43,31 @@ # [Hint] Notice that you should use padY (the NAME of the option) and not # pady (the SWITCH of the option). # - b = Tix.ComboBox(top, label="Year: ", dropdown=0, + b = tkinter.tix.ComboBox(top, label="Year: ", dropdown=0, command=select_year, editable=1, variable=demo_year, options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne') - a.pack(side=Tix.TOP, anchor=Tix.W) - b.pack(side=Tix.TOP, anchor=Tix.W) + a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) - a.insert(Tix.END, 'January') - a.insert(Tix.END, 'February') - a.insert(Tix.END, 'March') - a.insert(Tix.END, 'April') - a.insert(Tix.END, 'May') - a.insert(Tix.END, 'June') - a.insert(Tix.END, 'July') - a.insert(Tix.END, 'August') - a.insert(Tix.END, 'September') - a.insert(Tix.END, 'October') - a.insert(Tix.END, 'November') - a.insert(Tix.END, 'December') - - b.insert(Tix.END, '1992') - b.insert(Tix.END, '1993') - b.insert(Tix.END, '1994') - b.insert(Tix.END, '1995') - b.insert(Tix.END, '1996') + a.insert(tkinter.tix.END, 'January') + a.insert(tkinter.tix.END, 'February') + a.insert(tkinter.tix.END, 'March') + a.insert(tkinter.tix.END, 'April') + a.insert(tkinter.tix.END, 'May') + a.insert(tkinter.tix.END, 'June') + a.insert(tkinter.tix.END, 'July') + a.insert(tkinter.tix.END, 'August') + a.insert(tkinter.tix.END, 'September') + a.insert(tkinter.tix.END, 'October') + a.insert(tkinter.tix.END, 'November') + a.insert(tkinter.tix.END, 'December') + + b.insert(tkinter.tix.END, '1992') + b.insert(tkinter.tix.END, '1993') + b.insert(tkinter.tix.END, '1994') + b.insert(tkinter.tix.END, '1995') + b.insert(tkinter.tix.END, '1996') # Use "tixSetSilent" to set the values of the combo box if you # don't want your -command procedures (cbx:select_month and @@ -76,13 +76,13 @@ a.set_silent('January') b.set_silent('1995') - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: ok_command(w)) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def select_month(event=None): # tixDemo:Status "Month = %s" % demo_month.get() @@ -97,6 +97,6 @@ w.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/samples/Control.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/Control.py (original) +++ python/branches/release30-maint/Demo/tix/samples/Control.py Sun Jan 4 20:01:19 2009 @@ -18,7 +18,7 @@ # integer values; one lets you select floating point values and the last # one lets you select a few names. -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -34,14 +34,14 @@ global demo_maker, demo_thrust, demo_num_engines - demo_maker = Tix.StringVar() - demo_thrust = Tix.DoubleVar() - demo_num_engines = Tix.IntVar() + demo_maker = tkinter.tix.StringVar() + demo_thrust = tkinter.tix.DoubleVar() + demo_num_engines = tkinter.tix.IntVar() demo_maker.set('P&W') demo_thrust.set(20000.0) demo_num_engines.set(2) - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) # $w.top.a allows only integer values # @@ -49,16 +49,16 @@ # [Hint] We set the label.width subwidget option of the Controls to # be 16 so that their labels appear to be aligned. # - a = Tix.Control(top, label='Number of Engines: ', integer=1, + a = tkinter.tix.Control(top, label='Number of Engines: ', integer=1, variable=demo_num_engines, min=1, max=4, options='entry.width 10 label.width 20 label.anchor e') - b = Tix.Control(top, label='Thrust: ', integer=0, + b = tkinter.tix.Control(top, label='Thrust: ', integer=0, min='10000.0', max='60000.0', step=500, variable=demo_thrust, options='entry.width 10 label.width 20 label.anchor e') - c = Tix.Control(top, label='Engine Maker: ', value='P&W', + c = tkinter.tix.Control(top, label='Engine Maker: ', value='P&W', variable=demo_maker, options='entry.width 10 label.width 20 label.anchor e') @@ -68,17 +68,17 @@ c['decrcmd'] = lambda w=c: adjust_maker(w, -1) c['validatecmd'] = lambda w=c: validate_maker(w) - a.pack(side=Tix.TOP, anchor=Tix.W) - b.pack(side=Tix.TOP, anchor=Tix.W) - c.pack(side=Tix.TOP, anchor=Tix.W) + a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + c.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.okcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def okcmd (self): # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get()) @@ -118,5 +118,5 @@ return maker_list[i] if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/release30-maint/Demo/tix/samples/DirList.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/DirList.py (original) +++ python/branches/release30-maint/Demo/tix/samples/DirList.py Sun Jan 4 20:01:19 2009 @@ -16,8 +16,8 @@ # installation directory for an application. # -import Tix, os, copy -from Tkconstants import * +import tkinter.tix, os, copy +from tkinter.constants import * TCL_ALL_EVENTS = 0 @@ -40,25 +40,25 @@ # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 - top = Tix.Frame( w, relief=RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=RAISED, bd=1) # Create the DirList widget. By default it will show the current # directory # # - top.dir = Tix.DirList(top) + top.dir = tkinter.tix.DirList(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # - top.btn = Tix.Button(top, text = " >> ", pady = 0) + top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirList widget, or he can type in the directory # manually # - top.ent = Tix.LabelEntry(top, label="Installation Directory:", + top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 @@ -85,7 +85,7 @@ # Use a ButtonBox to hold the buttons. # - box = Tix.ButtonBox (w, orientation='horizontal') + box = tkinter.tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, @@ -118,14 +118,14 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - import tkMessageBox, traceback + import tkinter.messagebox, traceback try: - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) except: t, v, tb = sys.exc_info() text = "Error running the demo script:\n" for line in traceback.format_exception(t,v,tb): text = text + line + '\n' - d = tkMessageBox.showerror ( 'Tix Demo Error', text) + d = tkinter.messagebox.showerror ( 'Tix Demo Error', text) Modified: python/branches/release30-maint/Demo/tix/samples/DirTree.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/DirTree.py (original) +++ python/branches/release30-maint/Demo/tix/samples/DirTree.py Sun Jan 4 20:01:19 2009 @@ -16,8 +16,8 @@ # installation directory for an application. # -import Tix, os, copy -from Tkconstants import * +import tkinter.tix, os, copy +from tkinter.constants import * TCL_ALL_EVENTS = 0 @@ -40,25 +40,25 @@ # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 - top = Tix.Frame( w, relief=RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=RAISED, bd=1) # Create the DirTree widget. By default it will show the current # directory # # - top.dir = Tix.DirTree(top) + top.dir = tkinter.tix.DirTree(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # - top.btn = Tix.Button(top, text = " >> ", pady = 0) + top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirTree widget, or he can type in the directory # manually # - top.ent = Tix.LabelEntry(top, label="Installation Directory:", + top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 @@ -79,7 +79,7 @@ # Use a ButtonBox to hold the buttons. # - box = Tix.ButtonBox (w, orientation='horizontal') + box = tkinter.tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, @@ -113,5 +113,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/release30-maint/Demo/tix/samples/NoteBook.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/NoteBook.py (original) +++ python/branches/release30-maint/Demo/tix/samples/NoteBook.py Sun Jan 4 20:01:19 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixNoteBook widget, which allows # you to lay out your interface using a "notebook" metaphore # -import Tix +import tkinter.tix def RunSample(w): global root @@ -21,20 +21,20 @@ # We use these options to set the sizes of the subwidgets inside the # notebook, so that they are well-aligned on the screen. - prefix = Tix.OptionName(w) + prefix = tkinter.tix.OptionName(w) if prefix: prefix = '*'+prefix else: prefix = '' w.option_add(prefix+'*TixControl*entry.width', 10) w.option_add(prefix+'*TixControl*label.width', 18) - w.option_add(prefix+'*TixControl*label.anchor', Tix.E) + w.option_add(prefix+'*TixControl*label.anchor', tkinter.tix.E) w.option_add(prefix+'*TixNoteBook*tagPadX', 8) # Create the notebook widget and set its backpagecolor to gray. # Note that the -backpagecolor option belongs to the "nbframe" # subwidget. - nb = Tix.NoteBook(w, name='nb', ipadx=6, ipady=6) + nb = tkinter.tix.NoteBook(w, name='nb', ipadx=6, ipady=6) nb['bg'] = 'gray' nb.nbframe['backpagecolor'] = 'gray' @@ -45,7 +45,7 @@ nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('network', label="Network", underline=0) - nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP) + nb.pack(expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5 ,side=tkinter.tix.TOP) #---------------------------------------- # Create the first page @@ -54,21 +54,21 @@ # other widgets # tab=nb.hard_disk - f = Tix.Frame(tab) - common = Tix.Frame(tab) + f = tkinter.tix.Frame(tab) + common = tkinter.tix.Frame(tab) - f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) - common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) + f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1) + common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y) - a = Tix.Control(f, value=12, label='Access time: ') - w = Tix.Control(f, value=400, label='Write Throughput: ') - r = Tix.Control(f, value=400, label='Read Throughput: ') - c = Tix.Control(f, value=1021, label='Capacity: ') - - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(f, value=12, label='Access time: ') + w = tkinter.tix.Control(f, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(f, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(f, value=1021, label='Capacity: ') + + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) # Create the common buttons createCommonButtons(common) @@ -79,23 +79,23 @@ tab = nb.network - f = Tix.Frame(tab) - common = Tix.Frame(tab) + f = tkinter.tix.Frame(tab) + common = tkinter.tix.Frame(tab) - f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) - common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) + f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1) + common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y) - a = Tix.Control(f, value=12, label='Access time: ') - w = Tix.Control(f, value=400, label='Write Throughput: ') - r = Tix.Control(f, value=400, label='Read Throughput: ') - c = Tix.Control(f, value=1021, label='Capacity: ') - u = Tix.Control(f, value=10, label='Users: ') - - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) - u.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(f, value=12, label='Access time: ') + w = tkinter.tix.Control(f, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(f, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(f, value=1021, label='Capacity: ') + u = tkinter.tix.Control(f, value=10, label='Users: ') + + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) + u.pack(side=tkinter.tix.TOP, padx=20, pady=2) createCommonButtons(common) @@ -104,16 +104,16 @@ root.destroy() def createCommonButtons(master): - ok = Tix.Button(master, name='ok', text='OK', width=6, + ok = tkinter.tix.Button(master, name='ok', text='OK', width=6, command=doDestroy) - cancel = Tix.Button(master, name='cancel', + cancel = tkinter.tix.Button(master, name='cancel', text='Cancel', width=6, command=doDestroy) - ok.pack(side=Tix.TOP, padx=2, pady=2) - cancel.pack(side=Tix.TOP, padx=2, pady=2) + ok.pack(side=tkinter.tix.TOP, padx=2, pady=2) + cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/samples/OptMenu.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/OptMenu.py (original) +++ python/branches/release30-maint/Demo/tix/samples/OptMenu.py Sun Jan 4 20:01:19 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixOptionMenu widget -- you can # use it for the user to choose from a fixed set of options # -import Tix +import tkinter.tix options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML', 'tex':'LaTeX', 'rtf':'Rich Text Format'} @@ -21,16 +21,16 @@ def RunSample(w): global demo_opt_from, demo_opt_to - demo_opt_from = Tix.StringVar() - demo_opt_to = Tix.StringVar() + demo_opt_from = tkinter.tix.StringVar() + demo_opt_to = tkinter.tix.StringVar() - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) - from_file = Tix.OptionMenu(top, label="From File Format : ", + from_file = tkinter.tix.OptionMenu(top, label="From File Format : ", variable=demo_opt_from, options = 'label.width 19 label.anchor e menubutton.width 15') - to_file = Tix.OptionMenu(top, label="To File Format : ", + to_file = tkinter.tix.OptionMenu(top, label="To File Format : ", variable=demo_opt_to, options='label.width 19 label.anchor e menubutton.width 15') @@ -47,22 +47,22 @@ demo_opt_from.set('html') demo_opt_to.set('post') - from_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) - to_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) + from_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6) + to_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: ok_command(w)) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def ok_command(w): # tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get()) w.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/samples/PanedWin.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/PanedWin.py (original) +++ python/branches/release30-maint/Demo/tix/samples/PanedWin.py Sun Jan 4 20:01:19 2009 @@ -15,7 +15,7 @@ # of artical names and the size of the text widget that shows the body # of the article. -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -32,30 +32,30 @@ z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) - group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') + group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') - pane = Tix.PanedWindow(w, orientation='vertical') + pane = tkinter.tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) - list = Tix.ScrolledListBox(p1) + list = tkinter.tix.ScrolledListBox(p1) list.listbox['width'] = 80 list.listbox['height'] = 5 - text = Tix.ScrolledText(p2) + text = tkinter.tix.ScrolledText(p2) text.text['width'] = 80 text.text['height'] = 20 - list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' - text.text.insert(Tix.END, """ + text.text.insert(tkinter.tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi at blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania @@ -70,18 +70,18 @@ """) text.text['state'] = 'disabled' - list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) - text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) + list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) + text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) - group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) + group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.quitcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) - box.pack(side=Tix.BOTTOM, fill=Tix.X) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) def quitcmd (self): self.exit = 0 @@ -94,5 +94,5 @@ self.root.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/release30-maint/Demo/tix/samples/PopMenu.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/PopMenu.py (original) +++ python/branches/release30-maint/Demo/tix/samples/PopMenu.py Sun Jan 4 20:01:19 2009 @@ -12,18 +12,18 @@ # This file demonstrates the use of the tixPopupMenu widget. # -import Tix +import tkinter.tix def RunSample(w): # We create the frame and the button, then we'll bind the PopupMenu # to both widgets. The result is, when you press the right mouse # button over $w.top or $w.top.but, the PopupMenu will come up. # - top = Tix.Frame(w, relief=Tix.RAISED, bd=1) - but = Tix.Button(top, text='Press the right mouse button over this button or its surrounding area') - but.pack(expand=1, fill=Tix.BOTH, padx=50, pady=50) + top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1) + but = tkinter.tix.Button(top, text='Press the right mouse button over this button or its surrounding area') + but.pack(expand=1, fill=tkinter.tix.BOTH, padx=50, pady=50) - p = Tix.PopupMenu(top, title='Popup Test') + p = tkinter.tix.PopupMenu(top, title='Popup Test') p.bind_widget(top) p.bind_widget(but) @@ -37,21 +37,21 @@ p.menu.add_command(label='Find', underline=0) p.menu.add_command(label='System', underline=1) p.menu.add_command(label='Help', underline=0) - m1 = Tix.Menu(p.menu) + m1 = tkinter.tix.Menu(p.menu) m1.add_command(label='Hello') p.menu.add_cascade(label='More', menu=m1) - but.pack(side=Tix.TOP, padx=40, pady=50) + but.pack(side=tkinter.tix.TOP, padx=40, pady=50) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: w.destroy()) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/samples/SHList1.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/SHList1.py (original) +++ python/branches/release30-maint/Demo/tix/samples/SHList1.py Sun Jan 4 20:01:19 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixScrolledHList widget. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -33,13 +33,13 @@ # We create the frame and the ScrolledHList widget # at the top of the dialog box # - top = Tix.Frame( w, relief=Tix.RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1) # Put a simple hierachy into the HList (two levels). Use colors and # separator widgets (frames) to make the list look fancy # - top.a = Tix.ScrolledHList(top) - top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) + top.a = tkinter.tix.ScrolledHList(top) + top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP) # This is our little relational database # @@ -68,13 +68,13 @@ count=0 for boss,name in bosses : if count : - f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150, - bd=2, relief=Tix.SUNKEN ) + f=tkinter.tix.Frame(hlist, name='sep%d' % count, height=2, width=150, + bd=2, relief=tkinter.tix.SUNKEN ) - hlist.add_child( itemtype=Tix.WINDOW, - window=f, state=Tix.DISABLED ) + hlist.add_child( itemtype=tkinter.tix.WINDOW, + window=f, state=tkinter.tix.DISABLED ) - hlist.add(boss, itemtype=Tix.TEXT, text=name) + hlist.add(boss, itemtype=tkinter.tix.TEXT, text=name) count = count+1 @@ -99,15 +99,15 @@ # Use a ButtonBox to hold the buttons. # - box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) + box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, command = self.okcmd) box.add( 'cancel', text='Cancel', underline=0, width=6, command = self.quitcmd) - box.pack( side=Tix.BOTTOM, fill=Tix.X) - top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) + box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 ) def okcmd (self): self.quitcmd() @@ -127,5 +127,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/release30-maint/Demo/tix/samples/SHList2.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/SHList2.py (original) +++ python/branches/release30-maint/Demo/tix/samples/SHList2.py Sun Jan 4 20:01:19 2009 @@ -16,7 +16,7 @@ # In a tixHList widget, you can have one ore more columns. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -36,13 +36,13 @@ # We create the frame and the ScrolledHList widget # at the top of the dialog box # - top = Tix.Frame( w, relief=Tix.RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1) # Put a simple hierachy into the HList (two levels). Use colors and # separator widgets (frames) to make the list look fancy # - top.a = Tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) - top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) + top.a = tkinter.tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) + top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP) hlist=top.a.hlist @@ -55,12 +55,12 @@ # First some styles for the headers style={} - style['header'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist, - anchor=Tix.CENTER, padx=8, pady=2, font = boldfont ) + style['header'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist, + anchor=tkinter.tix.CENTER, padx=8, pady=2, font = boldfont ) - hlist.header_create(0, itemtype=Tix.TEXT, text='Name', + hlist.header_create(0, itemtype=tkinter.tix.TEXT, text='Name', style=style['header']) - hlist.header_create(1, itemtype=Tix.TEXT, text='Position', + hlist.header_create(1, itemtype=tkinter.tix.TEXT, text='Position', style=style['header']) # Notice that we use 3 columns in the hlist widget. This way when the user @@ -90,13 +90,13 @@ ('chuck', 'jeff', 'Chuck McLean', 'Cleaner') ] - style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) + style['mgr_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist) - style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) + style['mgr_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist) - style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) + style['empl_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist) - style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) + style['empl_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist) # Let configure the appearance of the HList subwidget # @@ -105,9 +105,9 @@ # Create the boss # - hlist.add ('.', itemtype=Tix.TEXT, text=boss[1], + hlist.add ('.', itemtype=tkinter.tix.TEXT, text=boss[1], style=style['mgr_name']) - hlist.item_create('.', 1, itemtype=Tix.TEXT, text=boss[2], + hlist.item_create('.', 1, itemtype=tkinter.tix.TEXT, text=boss[2], style=style['mgr_posn']) # Create the managers @@ -115,9 +115,9 @@ for key,name,posn in managers : e= '.'+ key - hlist.add(e, itemtype=Tix.TEXT, text=name, + hlist.add(e, itemtype=tkinter.tix.TEXT, text=name, style=style['mgr_name']) - hlist.item_create(e, 1, itemtype=Tix.TEXT, text=posn, + hlist.item_create(e, 1, itemtype=tkinter.tix.TEXT, text=posn, style=style['mgr_posn']) @@ -130,21 +130,21 @@ # parent entryPath / child's name hlist.add(entrypath, text=name, style=style['empl_name']) - hlist.item_create(entrypath, 1, itemtype=Tix.TEXT, + hlist.item_create(entrypath, 1, itemtype=tkinter.tix.TEXT, text = posn, style = style['empl_posn'] ) # Use a ButtonBox to hold the buttons. # - box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) + box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, command = self.okcmd ) box.add( 'cancel', text='Cancel', underline=0, width=6, command = self.quitcmd ) - box.pack( side=Tix.BOTTOM, fill=Tix.X) - top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) + box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 ) def okcmd (self): self.quitcmd() @@ -164,5 +164,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/release30-maint/Demo/tix/samples/Tree.py ============================================================================== --- python/branches/release30-maint/Demo/tix/samples/Tree.py (original) +++ python/branches/release30-maint/Demo/tix/samples/Tree.py Sun Jan 4 20:01:19 2009 @@ -14,30 +14,30 @@ # dynamic hierachical data (the files in the Unix file system) # -import Tix, os +import tkinter.tix, os def RunSample(w): - top = Tix.Frame(w, relief=Tix.RAISED, bd=1) - tree = Tix.Tree(top, options='separator "/"') - tree.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.LEFT) + top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1) + tree = tkinter.tix.Tree(top, options='separator "/"') + tree.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.LEFT) tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir) # The / directory is added in the "open" mode. The user can open it # and then browse its subdirectories ... adddir(tree, "/") - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, command=w.destroy, width=6) box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def adddir(tree, dir): if dir == '/': text = '/' else: text = os.path.basename(dir) - tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text, + tree.hlist.add(dir, itemtype=tkinter.tix.IMAGETEXT, text=text, image=tree.tk.call('tix', 'getimage', 'folder')) try: os.listdir(dir) @@ -71,10 +71,10 @@ if os.path.isdir(dir + '/' + file): adddir(tree, dir + '/' + file) else: - tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file, + tree.hlist.add(dir + '/' + file, itemtype=tkinter.tix.IMAGETEXT, text=file, image=tree.tk.call('tix', 'getimage', 'file')) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/release30-maint/Demo/tix/tixwidgets.py ============================================================================== --- python/branches/release30-maint/Demo/tix/tixwidgets.py (original) +++ python/branches/release30-maint/Demo/tix/tixwidgets.py Sun Jan 4 20:01:19 2009 @@ -12,9 +12,9 @@ # % python tixwidgets.py # -import os, os.path, sys, Tix -from Tkconstants import * -import traceback, tkMessageBox +import os, os.path, sys, tkinter.tix +from tkinter.constants import * +import traceback, tkinter.messagebox TCL_DONT_WAIT = 1<<1 TCL_WINDOW_EVENTS = 1<<2 @@ -30,7 +30,7 @@ self.dir = None # script directory self.balloon = None # balloon widget - self.useBalloons = Tix.StringVar() + self.useBalloons = tkinter.tix.StringVar() self.useBalloons.set('0') self.statusbar = None # status bar widget self.welmsg = None # Msg widget @@ -56,14 +56,14 @@ def MkMainMenu(self): top = self.root - w = Tix.Frame(top, bd=2, relief=RAISED) - file = Tix.Menubutton(w, text='File', underline=0, takefocus=0) - help = Tix.Menubutton(w, text='Help', underline=0, takefocus=0) + w = tkinter.tix.Frame(top, bd=2, relief=RAISED) + file = tkinter.tix.Menubutton(w, text='File', underline=0, takefocus=0) + help = tkinter.tix.Menubutton(w, text='Help', underline=0, takefocus=0) file.pack(side=LEFT) help.pack(side=RIGHT) - fm = Tix.Menu(file, tearoff=0) + fm = tkinter.tix.Menu(file, tearoff=0) file['menu'] = fm - hm = Tix.Menu(help, tearoff=0) + hm = tkinter.tix.Menu(help, tearoff=0) help['menu'] = hm fm.add_command(label='Exit', underline=1, @@ -77,7 +77,7 @@ def MkMainNotebook(self): top = self.root - w = Tix.NoteBook(top, ipadx=5, ipady=5, options=""" + w = tkinter.tix.NoteBook(top, ipadx=5, ipady=5, options=""" tagPadX 6 tagPadY 4 borderWidth 2 @@ -103,8 +103,8 @@ global demo top = self.root - w = Tix.Frame(top, relief=Tix.RAISED, bd=1) - demo.statusbar = Tix.Label(w, relief=Tix.SUNKEN, bd=1) + w = tkinter.tix.Frame(top, relief=tkinter.tix.RAISED, bd=1) + demo.statusbar = tkinter.tix.Label(w, relief=tkinter.tix.SUNKEN, bd=1) demo.statusbar.form(padx=3, pady=3, left=0, right='%70') return w @@ -116,7 +116,7 @@ z.geometry('790x590+10+10') else: z.geometry('890x640+10+10') - demo.balloon = Tix.Balloon(root) + demo.balloon = tkinter.tix.Balloon(root) frame1 = self.MkMainMenu() frame2 = self.MkMainNotebook() frame3 = self.MkMainStatus() @@ -152,7 +152,7 @@ self.exit = 1 return except KeyboardInterrupt: - if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes': + if tkinter.messagebox.askquestion ('Interrupt', 'Really Quit?') == 'yes': # self.tk.eval('exit') self.exit = 1 return @@ -163,7 +163,7 @@ text = "" for line in traceback.format_exception(t,v,tb): text += line + '\n' - try: tkMessageBox.showerror ('Error', text) + try: tkinter.messagebox.showerror ('Error', text) except: pass self.exit = 1 raise SystemExit(1) @@ -191,9 +191,9 @@ def MkWelcomeBar(top): global demo - w = Tix.Frame(top, bd=2, relief=Tix.GROOVE) - b1 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) - b2 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) + w = tkinter.tix.Frame(top, bd=2, relief=tkinter.tix.GROOVE) + b1 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) + b2 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) b1.entry['width'] = 15 b1.slistbox.listbox['height'] = 3 b2.entry['width'] = 4 @@ -202,22 +202,22 @@ demo.welfont = b1 demo.welsize = b2 - b1.insert(Tix.END, 'Courier') - b1.insert(Tix.END, 'Helvetica') - b1.insert(Tix.END, 'Lucida') - b1.insert(Tix.END, 'Times Roman') - - b2.insert(Tix.END, '8') - b2.insert(Tix.END, '10') - b2.insert(Tix.END, '12') - b2.insert(Tix.END, '14') - b2.insert(Tix.END, '18') + b1.insert(tkinter.tix.END, 'Courier') + b1.insert(tkinter.tix.END, 'Helvetica') + b1.insert(tkinter.tix.END, 'Lucida') + b1.insert(tkinter.tix.END, 'Times Roman') + + b2.insert(tkinter.tix.END, '8') + b2.insert(tkinter.tix.END, '10') + b2.insert(tkinter.tix.END, '12') + b2.insert(tkinter.tix.END, '14') + b2.insert(tkinter.tix.END, '18') b1.pick(1) b2.pick(3) - b1.pack(side=Tix.LEFT, padx=4, pady=4) - b2.pack(side=Tix.LEFT, padx=4, pady=4) + b1.pack(side=tkinter.tix.LEFT, padx=4, pady=4) + b2.pack(side=tkinter.tix.LEFT, padx=4, pady=4) demo.balloon.bind_widget(b1, msg='Choose\na font', statusmsg='Choose a font for this page') @@ -228,20 +228,20 @@ def MkWelcomeText(top): global demo - w = Tix.ScrolledWindow(top, scrollbar='auto') + w = tkinter.tix.ScrolledWindow(top, scrollbar='auto') win = w.window text = 'Welcome to TIX in Python' - title = Tix.Label(win, - bd=0, width=30, anchor=Tix.N, text=text) - msg = Tix.Message(win, - bd=0, width=400, anchor=Tix.N, + title = tkinter.tix.Label(win, + bd=0, width=30, anchor=tkinter.tix.N, text=text) + msg = tkinter.tix.Message(win, + bd=0, width=400, anchor=tkinter.tix.N, text='Tix is a set of mega-widgets based on TK. This program \ demonstrates the widgets in the Tix widget set. You can choose the pages \ in this window to look at the corresponding widgets. \n\n\ To quit this program, choose the "File | Exit" command.\n\n\ For more information, see http://tix.sourceforge.net.') - title.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10) - msg.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10) + title.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10) + msg.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10) demo.welmsg = msg return w @@ -267,14 +267,14 @@ w = nb.page(name) options = "label.padX 4" - til = Tix.LabelFrame(w, label='Chooser Widgets', options=options) - cbx = Tix.LabelFrame(w, label='tixComboBox', options=options) - ctl = Tix.LabelFrame(w, label='tixControl', options=options) - sel = Tix.LabelFrame(w, label='tixSelect', options=options) - opt = Tix.LabelFrame(w, label='tixOptionMenu', options=options) - fil = Tix.LabelFrame(w, label='tixFileEntry', options=options) - fbx = Tix.LabelFrame(w, label='tixFileSelectBox', options=options) - tbr = Tix.LabelFrame(w, label='Tool Bar', options=options) + til = tkinter.tix.LabelFrame(w, label='Chooser Widgets', options=options) + cbx = tkinter.tix.LabelFrame(w, label='tixComboBox', options=options) + ctl = tkinter.tix.LabelFrame(w, label='tixControl', options=options) + sel = tkinter.tix.LabelFrame(w, label='tixSelect', options=options) + opt = tkinter.tix.LabelFrame(w, label='tixOptionMenu', options=options) + fil = tkinter.tix.LabelFrame(w, label='tixFileEntry', options=options) + fbx = tkinter.tix.LabelFrame(w, label='tixFileSelectBox', options=options) + tbr = tkinter.tix.LabelFrame(w, label='Tool Bar', options=options) MkTitle(til.frame) MkCombo(cbx.frame) @@ -301,38 +301,38 @@ fbx.form(right=-1, top=0, left='%66') def MkCombo(w): - options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 14) + options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 14) - static = Tix.ComboBox(w, label='Static', editable=0, options=options) - editable = Tix.ComboBox(w, label='Editable', editable=1, options=options) - history = Tix.ComboBox(w, label='History', editable=1, history=1, - anchor=Tix.E, options=options) - static.insert(Tix.END, 'January') - static.insert(Tix.END, 'February') - static.insert(Tix.END, 'March') - static.insert(Tix.END, 'April') - static.insert(Tix.END, 'May') - static.insert(Tix.END, 'June') - static.insert(Tix.END, 'July') - static.insert(Tix.END, 'August') - static.insert(Tix.END, 'September') - static.insert(Tix.END, 'October') - static.insert(Tix.END, 'November') - static.insert(Tix.END, 'December') - - editable.insert(Tix.END, 'Angola') - editable.insert(Tix.END, 'Bangladesh') - editable.insert(Tix.END, 'China') - editable.insert(Tix.END, 'Denmark') - editable.insert(Tix.END, 'Ecuador') - - history.insert(Tix.END, '/usr/bin/ksh') - history.insert(Tix.END, '/usr/local/lib/python') - history.insert(Tix.END, '/var/adm') - - static.pack(side=Tix.TOP, padx=5, pady=3) - editable.pack(side=Tix.TOP, padx=5, pady=3) - history.pack(side=Tix.TOP, padx=5, pady=3) + static = tkinter.tix.ComboBox(w, label='Static', editable=0, options=options) + editable = tkinter.tix.ComboBox(w, label='Editable', editable=1, options=options) + history = tkinter.tix.ComboBox(w, label='History', editable=1, history=1, + anchor=tkinter.tix.E, options=options) + static.insert(tkinter.tix.END, 'January') + static.insert(tkinter.tix.END, 'February') + static.insert(tkinter.tix.END, 'March') + static.insert(tkinter.tix.END, 'April') + static.insert(tkinter.tix.END, 'May') + static.insert(tkinter.tix.END, 'June') + static.insert(tkinter.tix.END, 'July') + static.insert(tkinter.tix.END, 'August') + static.insert(tkinter.tix.END, 'September') + static.insert(tkinter.tix.END, 'October') + static.insert(tkinter.tix.END, 'November') + static.insert(tkinter.tix.END, 'December') + + editable.insert(tkinter.tix.END, 'Angola') + editable.insert(tkinter.tix.END, 'Bangladesh') + editable.insert(tkinter.tix.END, 'China') + editable.insert(tkinter.tix.END, 'Denmark') + editable.insert(tkinter.tix.END, 'Ecuador') + + history.insert(tkinter.tix.END, '/usr/bin/ksh') + history.insert(tkinter.tix.END, '/usr/local/lib/python') + history.insert(tkinter.tix.END, '/var/adm') + + static.pack(side=tkinter.tix.TOP, padx=5, pady=3) + editable.pack(side=tkinter.tix.TOP, padx=5, pady=3) + history.pack(side=tkinter.tix.TOP, padx=5, pady=3) states = ['Bengal', 'Delhi', 'Karnataka', 'Tamil Nadu'] @@ -359,30 +359,30 @@ def MkControl(w): global demo_spintxt - options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 13) + options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 13) - demo_spintxt = Tix.StringVar() + demo_spintxt = tkinter.tix.StringVar() demo_spintxt.set(states[0]) - simple = Tix.Control(w, label='Numbers', options=options) - spintxt = Tix.Control(w, label='States', variable=demo_spintxt, + simple = tkinter.tix.Control(w, label='Numbers', options=options) + spintxt = tkinter.tix.Control(w, label='States', variable=demo_spintxt, options=options) spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1) spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1) spintxt['validatecmd'] = lambda w=spintxt: spin_validate(w) - simple.pack(side=Tix.TOP, padx=5, pady=3) - spintxt.pack(side=Tix.TOP, padx=5, pady=3) + simple.pack(side=tkinter.tix.TOP, padx=5, pady=3) + spintxt.pack(side=tkinter.tix.TOP, padx=5, pady=3) def MkSelect(w): - options = "label.anchor %s" % Tix.CENTER + options = "label.anchor %s" % tkinter.tix.CENTER - sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1, - orientation=Tix.VERTICAL, - labelside=Tix.TOP, + sel1 = tkinter.tix.Select(w, label='Mere Mortals', allowzero=1, radio=1, + orientation=tkinter.tix.VERTICAL, + labelside=tkinter.tix.TOP, options=options) - sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0, - orientation=Tix.VERTICAL, - labelside= Tix.TOP, + sel2 = tkinter.tix.Select(w, label='Geeks', allowzero=1, radio=0, + orientation=tkinter.tix.VERTICAL, + labelside= tkinter.tix.TOP, options=options) sel1.add('eat', text='Eat') @@ -397,13 +397,13 @@ sel2.add('prog3', text='Program') sel2.add('sleep', text='Sleep') - sel1.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X) - sel2.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X) + sel1.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X) + sel2.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X) def MkOptMenu(w): - options='menubutton.width 15 label.anchor %s' % Tix.E + options='menubutton.width 15 label.anchor %s' % tkinter.tix.E - m = Tix.OptionMenu(w, label='File Format : ', options=options) + m = tkinter.tix.OptionMenu(w, label='File Format : ', options=options) m.add_command('text', label='Plain Text') m.add_command('post', label='PostScript') m.add_command('format', label='Formatted Text') @@ -412,27 +412,27 @@ m.add_command('tex', label='LaTeX') m.add_command('rtf', label='Rich Text Format') - m.pack(fill=Tix.X, padx=5, pady=3) + m.pack(fill=tkinter.tix.X, padx=5, pady=3) def MkFileEnt(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='Press the "open file" icon button and a TixFileSelectDialog will popup.') - ent = Tix.FileEntry(w, label='Select a file : ') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - ent.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) + ent = tkinter.tix.FileEntry(w, label='Select a file : ') + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + ent.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) def MkFileBox(w): """The FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.') - box = Tix.FileSelectBox(w) - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - box.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) + box = tkinter.tix.FileSelectBox(w) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + box.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) def MkToolBar(w): """The Select widget is also good for arranging buttons in a tool bar. @@ -441,12 +441,12 @@ options='frame.borderWidth 1' - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Select widget is also good for arranging buttons in a tool bar.') - bar = Tix.Frame(w, bd=2, relief=Tix.RAISED) - font = Tix.Select(w, allowzero=1, radio=0, label='', options=options) - para = Tix.Select(w, allowzero=0, radio=1, label='', options=options) + bar = tkinter.tix.Frame(w, bd=2, relief=tkinter.tix.RAISED) + font = tkinter.tix.Select(w, allowzero=1, radio=0, label='', options=options) + para = tkinter.tix.Select(w, allowzero=0, radio=1, label='', options=options) font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm') font.add('italic', bitmap='@' + demo.dir + '/bitmaps/italic.xbm') @@ -458,24 +458,24 @@ para.add('center', bitmap='@' + demo.dir + '/bitmaps/centerj.xbm') para.add('justify', bitmap='@' + demo.dir + '/bitmaps/justify.xbm') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - bar.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) - font.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3) - para.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + bar.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) + font.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3) + para.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3) def MkTitle(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='There are many types of "chooser" widgets that allow the user to input different types of information') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) def MkScroll(nb, name): w = nb.page(name) options='label.padX 4' - sls = Tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options) - swn = Tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options) - stx = Tix.LabelFrame(w, label='Tix.ScrolledText', options=options) + sls = tkinter.tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options) + swn = tkinter.tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options) + stx = tkinter.tix.LabelFrame(w, label='Tix.ScrolledText', options=options) MkSList(sls.frame) MkSWindow(swn.frame) @@ -490,31 +490,31 @@ """This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear. """ - top = Tix.Frame(w, width=300, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=300, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.') - list = Tix.ScrolledListBox(top, scrollbar='auto') + list = tkinter.tix.ScrolledListBox(top, scrollbar='auto') list.place(x=50, y=150, width=120, height=80) - list.listbox.insert(Tix.END, 'Alabama') - list.listbox.insert(Tix.END, 'California') - list.listbox.insert(Tix.END, 'Montana') - list.listbox.insert(Tix.END, 'New Jersey') - list.listbox.insert(Tix.END, 'New York') - list.listbox.insert(Tix.END, 'Pennsylvania') - list.listbox.insert(Tix.END, 'Washington') + list.listbox.insert(tkinter.tix.END, 'Alabama') + list.listbox.insert(tkinter.tix.END, 'California') + list.listbox.insert(tkinter.tix.END, 'Montana') + list.listbox.insert(tkinter.tix.END, 'New Jersey') + list.listbox.insert(tkinter.tix.END, 'New York') + list.listbox.insert(tkinter.tix.END, 'Pennsylvania') + list.listbox.insert(tkinter.tix.END, 'Washington') - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) list.bind('', func=lambda arg=0, rh=rh, list=list: list.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(list))) @@ -535,29 +535,29 @@ if not os.path.isfile(file): text += ' (Image missing)' - top = Tix.Frame(w, width=330, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=330, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text=text) - win = Tix.ScrolledWindow(top, scrollbar='auto') + win = tkinter.tix.ScrolledWindow(top, scrollbar='auto') image1 = win.window.image_create('photo', file=file) - lbl = Tix.Label(win.window, image=image1) - lbl.pack(expand=1, fill=Tix.BOTH) + lbl = tkinter.tix.Label(win.window, image=image1) + lbl.pack(expand=1, fill=tkinter.tix.BOTH) win.place(x=30, y=150, width=190, height=120) - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) win.bind('', func=lambda arg=0, rh=rh, win=win: win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win))) @@ -570,15 +570,15 @@ def MkSText(w): """The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.""" - top = Tix.Frame(w, width=330, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=330, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') - win = Tix.ScrolledText(top, scrollbar='auto') + win = tkinter.tix.ScrolledText(top, scrollbar='auto') win.text['wrap'] = 'none' - win.text.insert(Tix.END, '''When -scrollbar is set to "auto", the + win.text.insert(tkinter.tix.END, '''When -scrollbar is set to "auto", the scrollbars are shown only when needed. Additional modifiers can be used to force a scrollbar to be shown or hidden. For example, @@ -591,15 +591,15 @@ ) win.place(x=30, y=150, width=190, height=100) - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) win.bind('', func=lambda arg=0, rh=rh, win=win: win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win))) @@ -612,8 +612,8 @@ w = nb.page(name) options='label.padX 4' - pane = Tix.LabelFrame(w, label='Tix.PanedWindow', options=options) - note = Tix.LabelFrame(w, label='Tix.NoteBook', options=options) + pane = tkinter.tix.LabelFrame(w, label='Tix.PanedWindow', options=options) + note = tkinter.tix.LabelFrame(w, label='Tix.NoteBook', options=options) MkPanedWindow(pane.frame) MkNoteBook(note.frame) @@ -626,29 +626,29 @@ the sizes of several panes. The panes can be arranged either vertically or horizontally. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') - group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') + group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') - pane = Tix.PanedWindow(w, orientation='vertical') + pane = tkinter.tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) - list = Tix.ScrolledListBox(p1) - text = Tix.ScrolledText(p2) + list = tkinter.tix.ScrolledListBox(p1) + text = tkinter.tix.ScrolledText(p2) - list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' - text.text.insert(Tix.END, """ + text.text.insert(tkinter.tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi at blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania @@ -661,71 +661,71 @@ support the -image option. For example, you can display a text string string together with a bitmap, at the same time, inside a TK button widget. """) - list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) - text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) + list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) + text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) - msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) + msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1) def MkNoteBook(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The NoteBook widget allows you to layout a complex interface into individual pages.') # prefix = Tix.OptionName(w) # if not prefix: prefix = '' # w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8) - options = "entry.width %d label.width %d label.anchor %s" % (10, 18, Tix.E) + options = "entry.width %d label.width %d label.anchor %s" % (10, 18, tkinter.tix.E) - nb = Tix.NoteBook(w, ipadx=6, ipady=6, options=options) + nb = tkinter.tix.NoteBook(w, ipadx=6, ipady=6, options=options) nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('network', label="Network", underline=0) # Frame for the buttons that are present on all pages - common = Tix.Frame(nb.hard_disk) - common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y) + common = tkinter.tix.Frame(nb.hard_disk) + common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y) CreateCommonButtons(common) # Widgets belonging only to this page - a = Tix.Control(nb.hard_disk, value=12, label='Access Time: ') - w = Tix.Control(nb.hard_disk, value=400, label='Write Throughput: ') - r = Tix.Control(nb.hard_disk, value=400, label='Read Throughput: ') - c = Tix.Control(nb.hard_disk, value=1021, label='Capacity: ') - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(nb.hard_disk, value=12, label='Access Time: ') + w = tkinter.tix.Control(nb.hard_disk, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(nb.hard_disk, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(nb.hard_disk, value=1021, label='Capacity: ') + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) - common = Tix.Frame(nb.network) - common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y) + common = tkinter.tix.Frame(nb.network) + common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y) CreateCommonButtons(common) - a = Tix.Control(nb.network, value=12, label='Access Time: ') - w = Tix.Control(nb.network, value=400, label='Write Throughput: ') - r = Tix.Control(nb.network, value=400, label='Read Throughput: ') - c = Tix.Control(nb.network, value=1021, label='Capacity: ') - u = Tix.Control(nb.network, value=10, label='Users: ') - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) - u.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(nb.network, value=12, label='Access Time: ') + w = tkinter.tix.Control(nb.network, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(nb.network, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(nb.network, value=1021, label='Capacity: ') + u = tkinter.tix.Control(nb.network, value=10, label='Users: ') + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) + u.pack(side=tkinter.tix.TOP, padx=20, pady=2) - msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - nb.pack(side=Tix.TOP, padx=5, pady=5, fill=Tix.BOTH, expand=1) + msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + nb.pack(side=tkinter.tix.TOP, padx=5, pady=5, fill=tkinter.tix.BOTH, expand=1) def CreateCommonButtons(f): - ok = Tix.Button(f, text='OK', width = 6) - cancel = Tix.Button(f, text='Cancel', width = 6) - ok.pack(side=Tix.TOP, padx=2, pady=2) - cancel.pack(side=Tix.TOP, padx=2, pady=2) + ok = tkinter.tix.Button(f, text='OK', width = 6) + cancel = tkinter.tix.Button(f, text='Cancel', width = 6) + ok.pack(side=tkinter.tix.TOP, padx=2, pady=2) + cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2) def MkDirList(nb, name): w = nb.page(name) options = "label.padX 4" - dir = Tix.LabelFrame(w, label='Tix.DirList', options=options) - fsbox = Tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options) + dir = tkinter.tix.LabelFrame(w, label='Tix.DirList', options=options) + fsbox = tkinter.tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options) MkDirListWidget(dir.frame) MkExFileWidget(fsbox.frame) dir.form(top=0, left=0, right='%40', bottom=-1) @@ -736,23 +736,23 @@ system directory and makes it easy for the user to choose and access directories. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix DirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.') - dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - dirlist.pack(side=Tix.TOP, padx=3, pady=3) + dirlist = tkinter.tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16') + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + dirlist.pack(side=tkinter.tix.TOP, padx=3, pady=3) def MkExFileWidget(w): """The TixExFileSelectBox widget is more user friendly than the Motif style FileSelectBox. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.') # There's a bug in the ComboBoxes - the scrolledlistbox is destroyed - box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED) - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - box.pack(side=Tix.TOP, padx=3, pady=3) + box = tkinter.tix.ExFileSelectBox(w, bd=2, relief=tkinter.tix.RAISED) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + box.pack(side=tkinter.tix.TOP, padx=3, pady=3) ### ### List of all the demos we want to show off @@ -875,39 +875,39 @@ w = nb.page(name) options = "label.padX 4" - pane = Tix.PanedWindow(w, orientation='horizontal') - pane.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH) + pane = tkinter.tix.PanedWindow(w, orientation='horizontal') + pane.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH) f1 = pane.add('list', expand='1') f2 = pane.add('text', expand='5') f1['relief'] = 'flat' f2['relief'] = 'flat' - lab = Tix.LabelFrame(f1, label='Select a sample program:') - lab.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5) - lab1 = Tix.LabelFrame(f2, label='Source:') - lab1.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5) + lab = tkinter.tix.LabelFrame(f1, label='Select a sample program:') + lab.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5) + lab1 = tkinter.tix.LabelFrame(f2, label='Source:') + lab1.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5) - slb = Tix.Tree(lab.frame, options='hlist.width 20') - slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5) + slb = tkinter.tix.Tree(lab.frame, options='hlist.width 20') + slb.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5) - stext = Tix.ScrolledText(lab1.frame, name='stext') + stext = tkinter.tix.ScrolledText(lab1.frame, name='stext') font = root.tk.eval('tix option get fixed_font') stext.text.config(font=font) - frame = Tix.Frame(lab1.frame, name='frame') + frame = tkinter.tix.Frame(lab1.frame, name='frame') - run = Tix.Button(frame, text='Run ...', name='run') - view = Tix.Button(frame, text='View Source ...', name='view') - run.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) - view.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) + run = tkinter.tix.Button(frame, text='Run ...', name='run') + view = tkinter.tix.Button(frame, text='View Source ...', name='view') + run.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE) + view.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE) stext.text['bg'] = slb.hlist['bg'] stext.text['state'] = 'disabled' stext.text['wrap'] = 'none' stext.text['width'] = 80 - frame.pack(side=Tix.BOTTOM, expand=0, fill=Tix.X, padx=7) - stext.pack(side=Tix.TOP, expand=0, fill=Tix.BOTH, padx=7) + frame.pack(side=tkinter.tix.BOTTOM, expand=0, fill=tkinter.tix.X, padx=7) + stext.pack(side=tkinter.tix.TOP, expand=0, fill=tkinter.tix.BOTH, padx=7) slb.hlist['separator'] = '.' slb.hlist['width'] = 25 @@ -922,13 +922,13 @@ for type in ['widget', 'image']: if type != 'widget': - x = Tix.Frame(slb.hlist, bd=2, height=2, width=150, - relief=Tix.SUNKEN, bg=slb.hlist['bg']) - slb.hlist.add_child(itemtype=Tix.WINDOW, window=x, state='disabled') - x = slb.hlist.add_child(itemtype=Tix.TEXT, state='disabled', + x = tkinter.tix.Frame(slb.hlist, bd=2, height=2, width=150, + relief=tkinter.tix.SUNKEN, bg=slb.hlist['bg']) + slb.hlist.add_child(itemtype=tkinter.tix.WINDOW, window=x, state='disabled') + x = slb.hlist.add_child(itemtype=tkinter.tix.TEXT, state='disabled', text=comments[type]) for key in stypes[type]: - slb.hlist.add_child(x, itemtype=Tix.TEXT, data=key, + slb.hlist.add_child(x, itemtype=tkinter.tix.TEXT, data=key, text=key) slb.hlist.selection_clear() @@ -955,12 +955,12 @@ if action == 'run': exec('import ' + prog) - w = Tix.Toplevel() + w = tkinter.tix.Toplevel() w.title(title) rtn = eval(prog + '.RunSample') rtn(w) elif action == 'view': - w = Tix.Toplevel() + w = tkinter.tix.Toplevel() w.title('Source view: ' + title) LoadFile(w, demo.dir + '/samples/' + prog + '.py') elif action == 'browse': @@ -968,8 +968,8 @@ def LoadFile(w, fname): global root - b = Tix.Button(w, text='Close', command=w.destroy) - t = Tix.ScrolledText(w) + b = tkinter.tix.Button(w, text='Close', command=w.destroy) + t = tkinter.tix.ScrolledText(w) # b.form(left=0, bottom=0, padx=4, pady=4) # t.form(left=0, bottom=b, right='-0', top=0) t.pack() @@ -985,18 +985,18 @@ def ReadFile(w, fname): old_state = w['state'] w['state'] = 'normal' - w.delete('0.0', Tix.END) + w.delete('0.0', tkinter.tix.END) try: f = open(fname) lines = f.readlines() for s in lines: - w.insert(Tix.END, s) + w.insert(tkinter.tix.END, s) f.close() finally: # w.see('1.0') w['state'] = old_state if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunMain(root) Modified: python/branches/release30-maint/Demo/tkinter/guido/AttrDialog.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/AttrDialog.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/AttrDialog.py Sun Jan 4 20:01:19 2009 @@ -12,7 +12,7 @@ # -- totally static, though different between PackDialog and WidgetDialog # (but even that could be unified) -from Tkinter import * +from tkinter import * class Option: Modified: python/branches/release30-maint/Demo/tkinter/guido/ManPage.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/ManPage.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/ManPage.py Sun Jan 4 20:01:19 2009 @@ -1,9 +1,9 @@ # Widget to display a man page import re -from Tkinter import * -from Tkinter import _tkinter -from ScrolledText import ScrolledText +from tkinter import * +from tkinter import _tkinter +from tkinter.scrolledtext import ScrolledText # XXX These fonts may have to be changed to match your system BOLDFONT = '*-Courier-Bold-R-Normal-*-120-*' Modified: python/branches/release30-maint/Demo/tkinter/guido/MimeViewer.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/MimeViewer.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/MimeViewer.py Sun Jan 4 20:01:19 2009 @@ -5,8 +5,8 @@ import string from types import * -from Tkinter import * -from ScrolledText import ScrolledText +from tkinter import * +from tkinter.scrolledtext import ScrolledText class MimeViewer: def __init__(self, parent, title, msg): Modified: python/branches/release30-maint/Demo/tkinter/guido/ShellWindow.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/ShellWindow.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/ShellWindow.py Sun Jan 4 20:01:19 2009 @@ -1,9 +1,9 @@ import os import sys import string -from Tkinter import * -from ScrolledText import ScrolledText -from Dialog import Dialog +from tkinter import * +from tkinter.scrolledtext import ScrolledText +from tkinter.dialog import Dialog import signal BUFSIZE = 512 Modified: python/branches/release30-maint/Demo/tkinter/guido/brownian.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/brownian.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/brownian.py Sun Jan 4 20:01:19 2009 @@ -1,6 +1,6 @@ # Brownian motion -- an example of a multi-threaded Tkinter program. -from Tkinter import * +from tkinter import * import random import threading import time Modified: python/branches/release30-maint/Demo/tkinter/guido/brownian2.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/brownian2.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/brownian2.py Sun Jan 4 20:01:19 2009 @@ -1,7 +1,7 @@ # Brownian motion -- an example of a NON multi-threaded Tkinter program ;) # By Michele Simoniato, inspired by brownian.py -from Tkinter import * +from tkinter import * import random import sys Modified: python/branches/release30-maint/Demo/tkinter/guido/canvasevents.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/canvasevents.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/canvasevents.py Sun Jan 4 20:01:19 2009 @@ -1,6 +1,6 @@ #! /usr/bin/env python -from Tkinter import * +from tkinter import * from Canvas import Oval, Group, CanvasText Modified: python/branches/release30-maint/Demo/tkinter/guido/dialog.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/dialog.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/dialog.py Sun Jan 4 20:01:19 2009 @@ -4,7 +4,7 @@ # optional bitmap, and any number of buttons. # Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270. -from Tkinter import * +from tkinter import * import sys Modified: python/branches/release30-maint/Demo/tkinter/guido/electrons.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/electrons.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/electrons.py Sun Jan 4 20:01:19 2009 @@ -11,7 +11,7 @@ # /usr/include/X11/bitmaps for samples); it is displayed as the # background of the animation. Default is no bitmap. -from Tkinter import * +from tkinter import * import random Modified: python/branches/release30-maint/Demo/tkinter/guido/hanoi.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/hanoi.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/hanoi.py Sun Jan 4 20:01:19 2009 @@ -10,7 +10,7 @@ # background of the animation. Default is no bitmap. # This uses Steen Lumholt's Tk interface -from Tkinter import * +from tkinter import * # Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c Modified: python/branches/release30-maint/Demo/tkinter/guido/hello.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/hello.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/hello.py Sun Jan 4 20:01:19 2009 @@ -1,7 +1,7 @@ # Display hello, world in a button; clicking it quits the program import sys -from Tkinter import * +from tkinter import * def main(): root = Tk() Modified: python/branches/release30-maint/Demo/tkinter/guido/imagedraw.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/imagedraw.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/imagedraw.py Sun Jan 4 20:01:19 2009 @@ -1,6 +1,6 @@ """Draw on top of an image""" -from Tkinter import * +from tkinter import * import sys def main(): Modified: python/branches/release30-maint/Demo/tkinter/guido/imageview.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/imageview.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/imageview.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import sys def main(): Modified: python/branches/release30-maint/Demo/tkinter/guido/kill.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/kill.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/kill.py Sun Jan 4 20:01:19 2009 @@ -1,7 +1,7 @@ #! /usr/bin/env python # Tkinter interface to Linux `kill' command. -from Tkinter import * +from tkinter import * from string import splitfields from string import split import subprocess Modified: python/branches/release30-maint/Demo/tkinter/guido/listtree.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/listtree.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/listtree.py Sun Jan 4 20:01:19 2009 @@ -3,7 +3,7 @@ import sys import string -from Tkinter import * +from tkinter import * def listtree(master, app): list = Listbox(master, name='list') Modified: python/branches/release30-maint/Demo/tkinter/guido/mbox.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/mbox.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/mbox.py Sun Jan 4 20:01:19 2009 @@ -9,7 +9,7 @@ import string import mhlib -from Tkinter import * +from tkinter import * from dialog import dialog Modified: python/branches/release30-maint/Demo/tkinter/guido/newmenubardemo.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/newmenubardemo.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/newmenubardemo.py Sun Jan 4 20:01:19 2009 @@ -2,7 +2,7 @@ """Play with the new Tk 8.0 toplevel menu option.""" -from Tkinter import * +from tkinter import * class App: Modified: python/branches/release30-maint/Demo/tkinter/guido/optionmenu.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/optionmenu.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/optionmenu.py Sun Jan 4 20:01:19 2009 @@ -1,6 +1,6 @@ # option menu sample (Fredrik Lundh, September 1997) -from Tkinter import * +from tkinter import * root = Tk() Modified: python/branches/release30-maint/Demo/tkinter/guido/paint.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/paint.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/paint.py Sun Jan 4 20:01:19 2009 @@ -20,7 +20,7 @@ davem at magnet.com """ -from Tkinter import * +from tkinter import * """paint.py: not exactly a paint program.. just a smooth line drawing demo.""" Modified: python/branches/release30-maint/Demo/tkinter/guido/rmt.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/rmt.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/rmt.py Sun Jan 4 20:01:19 2009 @@ -11,7 +11,7 @@ # XXX This should be written in a more Python-like style!!! -from Tkinter import * +from tkinter import * import sys # 1. Create basic application structure: menu bar on top of Modified: python/branches/release30-maint/Demo/tkinter/guido/solitaire.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/solitaire.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/solitaire.py Sun Jan 4 20:01:19 2009 @@ -25,7 +25,7 @@ import math import random -from Tkinter import * +from tkinter import * from Canvas import Rectangle, CanvasText, Group, Window Modified: python/branches/release30-maint/Demo/tkinter/guido/sortvisu.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/sortvisu.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/sortvisu.py Sun Jan 4 20:01:19 2009 @@ -19,7 +19,7 @@ """ -from Tkinter import * +from tkinter import * from Canvas import Line, Rectangle import random Modified: python/branches/release30-maint/Demo/tkinter/guido/ss1.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/ss1.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/ss1.py Sun Jan 4 20:01:19 2009 @@ -485,7 +485,7 @@ s = chr(m+ord('A')) + s return s -import Tkinter as Tk +import tkinter as Tk class SheetGUI: Modified: python/branches/release30-maint/Demo/tkinter/guido/svkill.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/svkill.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/svkill.py Sun Jan 4 20:01:19 2009 @@ -2,7 +2,7 @@ # Tkinter interface to SYSV `ps' and `kill' commands. -from Tkinter import * +from tkinter import * if TkVersion < 4.0: raise ImportError("This version of svkill requires Tk 4.0 or later") Modified: python/branches/release30-maint/Demo/tkinter/guido/switch.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/switch.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/switch.py Sun Jan 4 20:01:19 2009 @@ -1,6 +1,6 @@ # Show how to do switchable panels. -from Tkinter import * +from tkinter import * class App: Modified: python/branches/release30-maint/Demo/tkinter/guido/tkman.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/guido/tkman.py (original) +++ python/branches/release30-maint/Demo/tkinter/guido/tkman.py Sun Jan 4 20:01:19 2009 @@ -6,7 +6,7 @@ import os import string import re -from Tkinter import * +from tkinter import * from ManPage import ManPage MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann'] Modified: python/branches/release30-maint/Demo/tkinter/matt/00-HELLO-WORLD.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/00-HELLO-WORLD.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/00-HELLO-WORLD.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # note that there is no explicit call to start Tk. # Tkinter is smart enough to start the system if it's not already going. Modified: python/branches/release30-maint/Demo/tkinter/matt/animation-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/animation-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/animation-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This program shows how to use the "after" function to make animation. Modified: python/branches/release30-maint/Demo/tkinter/matt/animation-w-velocity-ctrl.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/animation-w-velocity-ctrl.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/animation-w-velocity-ctrl.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. Modified: python/branches/release30-maint/Demo/tkinter/matt/bind-w-mult-calls-p-type.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/bind-w-mult-calls-p-type.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/bind-w-mult-calls-p-type.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to use a simple type-in box Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-demo-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-demo-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-demo-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this program creates a canvas and puts a single polygon on the canvas Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-gridding.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-gridding.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-gridding.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-or-creating.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-or-creating.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-or-creating.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates a more sophisticated movement -- # move dots or create new ones if you click outside the dots Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-w-mouse.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-w-mouse.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-moving-w-mouse.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the movement of a single canvas item under mouse control Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-mult-item-sel.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-mult-item-sel.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-mult-item-sel.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # allows moving dots with multiple selection. Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-reading-tag-info.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-reading-tag-info.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-reading-tag-info.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-w-widget-draw-el.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-w-widget-draw-el.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-w-widget-draw-el.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the creation of widgets as part of a canvas object Modified: python/branches/release30-maint/Demo/tkinter/matt/canvas-with-scrollbars.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/canvas-with-scrollbars.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/canvas-with-scrollbars.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This example program creates a scroling canvas, and demonstrates # how to tie scrollbars and canvses together. The mechanism Modified: python/branches/release30-maint/Demo/tkinter/matt/dialog-box.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/dialog-box.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/dialog-box.py Sun Jan 4 20:01:19 2009 @@ -1,5 +1,5 @@ -from Tkinter import * -from Dialog import Dialog +from tkinter import * +from tkinter.dialog import Dialog # this shows how to create a new window with a button in it # that can create new windows Modified: python/branches/release30-maint/Demo/tkinter/matt/entry-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/entry-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/entry-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to use a simple type-in box Modified: python/branches/release30-maint/Demo/tkinter/matt/entry-with-shared-variable.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/entry-with-shared-variable.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/entry-with-shared-variable.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to make a typein box shadow a program variable. Modified: python/branches/release30-maint/Demo/tkinter/matt/killing-window-w-wm.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/killing-window-w-wm.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/killing-window-w-wm.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This file shows how to trap the killing of a window # when the user uses window manager menus (typ. upper left hand corner Modified: python/branches/release30-maint/Demo/tkinter/matt/menu-all-types-of-entries.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/menu-all-types-of-entries.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/menu-all-types-of-entries.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages Modified: python/branches/release30-maint/Demo/tkinter/matt/menu-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/menu-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/menu-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages Modified: python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-1.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-1.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-1.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-2.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-2.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/not-what-you-might-think-2.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/release30-maint/Demo/tkinter/matt/packer-and-placer-together.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/packer-and-placer-together.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/packer-and-placer-together.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that tests the placer geom manager in conjunction with # the packer. The background (green) is packed, while the widget inside is placed Modified: python/branches/release30-maint/Demo/tkinter/matt/packer-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/packer-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/packer-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/release30-maint/Demo/tkinter/matt/placer-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/placer-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/placer-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that tests the placer geom manager Modified: python/branches/release30-maint/Demo/tkinter/matt/pong-demo-1.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/pong-demo-1.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/pong-demo-1.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string Modified: python/branches/release30-maint/Demo/tkinter/matt/printing-coords-of-items.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/printing-coords-of-items.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/printing-coords-of-items.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the creation of widgets as part of a canvas object Modified: python/branches/release30-maint/Demo/tkinter/matt/radiobutton-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/radiobutton-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/radiobutton-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a demo program that shows how to # create radio buttons and how to get other widgets to Modified: python/branches/release30-maint/Demo/tkinter/matt/rubber-band-box-demo-1.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/rubber-band-box-demo-1.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/rubber-band-box-demo-1.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): def printit(self): Modified: python/branches/release30-maint/Demo/tkinter/matt/rubber-line-demo-1.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/rubber-line-demo-1.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/rubber-line-demo-1.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): def printit(self): Modified: python/branches/release30-maint/Demo/tkinter/matt/slider-demo-1.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/slider-demo-1.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/slider-demo-1.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # shows how to make a slider, set and get its value under program control Modified: python/branches/release30-maint/Demo/tkinter/matt/subclass-existing-widgets.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/subclass-existing-widgets.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/subclass-existing-widgets.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that makes a simple two button application Modified: python/branches/release30-maint/Demo/tkinter/matt/two-radio-groups.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/two-radio-groups.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/two-radio-groups.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # The way to think about this is that each radio button menu # controls a different variable -- clicking on one of the Modified: python/branches/release30-maint/Demo/tkinter/matt/window-creation-more.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/window-creation-more.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/window-creation-more.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this shows how to create a new window with a button in it # that can create new windows Modified: python/branches/release30-maint/Demo/tkinter/matt/window-creation-simple.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/window-creation-simple.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/window-creation-simple.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this shows how to spawn off new windows at a button press Modified: python/branches/release30-maint/Demo/tkinter/matt/window-creation-w-location.py ============================================================================== --- python/branches/release30-maint/Demo/tkinter/matt/window-creation-w-location.py (original) +++ python/branches/release30-maint/Demo/tkinter/matt/window-creation-w-location.py Sun Jan 4 20:01:19 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import sys ##sys.path.append("/users/mjc4y/projects/python/tkinter/utils") From buildbot at python.org Sun Jan 4 20:46:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 19:46:46 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090104194646.218371E4002@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/32 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: 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 Jan 4 20:53:00 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 20:53:00 +0100 (CET) Subject: [Python-checkins] r68311 - python/trunk/Include/pymath.h Message-ID: <20090104195300.7A80F1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 20:53:00 2009 New Revision: 68311 Log: Use C99 'isfinite' macro in preference to BSD-derived 'finite' function. Modified: python/trunk/Include/pymath.h Modified: python/trunk/Include/pymath.h ============================================================================== --- python/trunk/Include/pymath.h (original) +++ python/trunk/Include/pymath.h Sun Jan 4 20:53:00 2009 @@ -118,7 +118,9 @@ * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE -#ifdef HAVE_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) From python-checkins at python.org Sun Jan 4 21:19:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 21:19:41 +0100 (CET) Subject: [Python-checkins] r68312 - in python/trunk: configure configure.in Message-ID: <20090104201941.BF4731E4024@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 21:19:41 2009 New Revision: 68312 Log: It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any Python/hypot.c replacement file. Use AC_CHECK_FUNCS instead. This change should be backported to 2.6 and 3.0. Modified: python/trunk/configure python/trunk/configure.in Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Sun Jan 4 21:19:41 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68296 . +# From configure.in Revision: 68299 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -21688,108 +21688,6 @@ fi -for ac_func in hypot -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; 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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "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 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - -fi -done - - - @@ -21797,7 +21695,7 @@ -for ac_func in acosh asinh atanh copysign expm1 finite log1p +for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sun Jan 4 21:19:41 2009 @@ -3207,9 +3207,7 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_REPLACE_FUNCS(hypot) - -AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite log1p]) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p]) AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE From python-checkins at python.org Sun Jan 4 21:39:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 21:39:00 +0100 (CET) Subject: [Python-checkins] r68313 - in doctools/trunk: AUTHORS CHANGES EXAMPLES LICENSE MANIFEST.in README TODO babel.cfg doc/Makefile doc/_templates/index.html doc/_templates/indexsidebar.html doc/builders.rst doc/concepts.rst doc/conf.py doc/config.rst doc/ext/appapi.rst doc/ext/builderapi.rst doc/ext/coverage.rst doc/ext/doctest.rst doc/ext/math.rst doc/ext/refcounting.rst doc/ext/todo.rst doc/ext/tutorial.rst doc/extensions.rst doc/glossary.rst doc/intro.rst doc/markup/code.rst doc/markup/desc.rst doc/markup/inline.rst doc/markup/para.rst doc/rest.rst doc/sphinx-build.1 doc/sphinx-quickstart.1 doc/templating.rst ez_setup.py setup.py sphinx-build.py sphinx-quickstart.py sphinx/__init__.py sphinx/__init__.pyc sphinx/_jinja.py sphinx/addnodes.py sphinx/application.py sphinx/builder.py sphinx/builders sphinx/builders/__init__.py sphinx/builders/changes.py sphinx/builders/html.py sphinx/builders/htmlhelp.py sphinx/builders/latex.py sphinx/builders/linkcheck.py sphinx/builders/qthelp.py sphinx/builders/text.py sphinx/cmdline.py sphinx/config.py sphinx/directives/__init__.py sphinx/directives/code.py sphinx/directives/desc.py sphinx/directives/other.py sphinx/environment.py sphinx/ext/__init__.py sphinx/ext/autodoc.py sphinx/ext/coverage.py sphinx/ext/doctest.py sphinx/ext/ifconfig.py sphinx/ext/intersphinx.py sphinx/ext/jsmath.py sphinx/ext/mathbase.py sphinx/ext/pngmath.py sphinx/ext/refcounting.py sphinx/ext/todo.py sphinx/highlighting.py sphinx/jinja2glue.py sphinx/locale/__init__.py sphinx/locale/cs/LC_MESSAGES/sphinx.js sphinx/locale/cs/LC_MESSAGES/sphinx.mo sphinx/locale/cs/LC_MESSAGES/sphinx.po sphinx/locale/de/LC_MESSAGES/sphinx.po sphinx/locale/es/LC_MESSAGES/sphinx.po sphinx/locale/fr/LC_MESSAGES/sphinx.po sphinx/locale/it sphinx/locale/it/LC_MESSAGES sphinx/locale/it/LC_MESSAGES/sphinx.js sphinx/locale/it/LC_MESSAGES/sphinx.mo sphinx/locale/it/LC_MESSAGES/sphinx.po sphinx/locale/ja/LC_MESSAGES/sphinx.po sphinx/locale/nl/LC_MESSAGES/sphinx.po sphinx/locale/pl/LC_MESSAGES/sphinx.po sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po sphinx/locale/sl/LC_MESSAGES/sphinx.po sphinx/locale/sphinx.pot sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po sphinx/pycode sphinx/pycode/Grammar.txt sphinx/pycode/__init__.py sphinx/pycode/nodes.py sphinx/pycode/pgen2 sphinx/pycode/pgen2/__init__.py sphinx/pycode/pgen2/driver.py sphinx/pycode/pgen2/grammar.py sphinx/pycode/pgen2/literals.py sphinx/pycode/pgen2/parse.c sphinx/pycode/pgen2/parse.py sphinx/pycode/pgen2/parse.pyx sphinx/pycode/pgen2/pgen.py sphinx/pycode/pgen2/token.py sphinx/pycode/pgen2/tokenize.py sphinx/quickstart.py sphinx/roles.py sphinx/search.py sphinx/setup_command.py sphinx/static/searchtools.js sphinx/templates/changes/versionchanges.html sphinx/templates/layout.html sphinx/templates/modindex.html sphinx/templates/page.html sphinx/texinputs/sphinx.sty sphinx/util/__init__.py sphinx/util/compat.py sphinx/util/console.py sphinx/util/docstrings.py sphinx/util/jsdump.py sphinx/util/png.py sphinx/util/stemmer.py sphinx/util/texescape.py sphinx/writers sphinx/writers/__init__.py sphinx/writers/html.py sphinx/writers/latex.py sphinx/writers/text.py tests/root/_static/README tests/root/_templates/layout.html tests/root/conf.py tests/root/contents.txt tests/root/ext.pyc tests/root/images.txt tests/root/includes.txt tests/root/literal.inc tests/root/markup.txt tests/root/subdir/images.txt tests/root/subdir/simg.png tests/run.py tests/test_application.py tests/test_autodoc.py tests/test_build.py tests/test_config.py tests/test_coverage.py tests/test_env.py tests/test_highlighting.py tests/test_i18n.py tests/test_markup.py tests/test_quickstart.py tests/util.py utils/check_sources.py Message-ID: <20090104203900.979A11E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 21:38:57 2009 New Revision: 68313 Log: update to sphinx hg:964 Added: doctools/trunk/MANIFEST.in (contents, props changed) doctools/trunk/doc/ext/todo.rst (contents, props changed) doctools/trunk/doc/ext/tutorial.rst (contents, props changed) doctools/trunk/doc/sphinx-build.1 (contents, props changed) doctools/trunk/doc/sphinx-quickstart.1 (contents, props changed) doctools/trunk/sphinx/__init__.pyc (contents, props changed) doctools/trunk/sphinx/builders/ doctools/trunk/sphinx/builders/__init__.py (contents, props changed) doctools/trunk/sphinx/builders/changes.py (contents, props changed) doctools/trunk/sphinx/builders/html.py (contents, props changed) doctools/trunk/sphinx/builders/htmlhelp.py (contents, props changed) doctools/trunk/sphinx/builders/latex.py (contents, props changed) doctools/trunk/sphinx/builders/linkcheck.py (contents, props changed) doctools/trunk/sphinx/builders/qthelp.py (contents, props changed) doctools/trunk/sphinx/builders/text.py (contents, props changed) doctools/trunk/sphinx/jinja2glue.py (contents, props changed) doctools/trunk/sphinx/locale/it/ doctools/trunk/sphinx/locale/it/LC_MESSAGES/ doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.js (contents, props changed) doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.mo (contents, props changed) doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.po (contents, props changed) doctools/trunk/sphinx/pycode/ doctools/trunk/sphinx/pycode/Grammar.txt (contents, props changed) doctools/trunk/sphinx/pycode/__init__.py (contents, props changed) doctools/trunk/sphinx/pycode/nodes.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/ doctools/trunk/sphinx/pycode/pgen2/__init__.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/driver.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/grammar.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/literals.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/parse.c (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/parse.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/parse.pyx (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/pgen.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/token.py (contents, props changed) doctools/trunk/sphinx/pycode/pgen2/tokenize.py (contents, props changed) doctools/trunk/sphinx/util/docstrings.py (contents, props changed) doctools/trunk/sphinx/util/png.py (contents, props changed) doctools/trunk/sphinx/writers/ doctools/trunk/sphinx/writers/__init__.py (contents, props changed) doctools/trunk/sphinx/writers/html.py (contents, props changed) doctools/trunk/sphinx/writers/latex.py (contents, props changed) doctools/trunk/sphinx/writers/text.py (contents, props changed) doctools/trunk/tests/root/_static/README (contents, props changed) doctools/trunk/tests/root/_templates/layout.html (contents, props changed) doctools/trunk/tests/root/ext.pyc (contents, props changed) doctools/trunk/tests/root/subdir/images.txt (contents, props changed) doctools/trunk/tests/root/subdir/simg.png (contents, props changed) doctools/trunk/tests/test_highlighting.py (contents, props changed) Modified: doctools/trunk/AUTHORS doctools/trunk/CHANGES doctools/trunk/EXAMPLES doctools/trunk/LICENSE doctools/trunk/README doctools/trunk/TODO doctools/trunk/babel.cfg doctools/trunk/doc/Makefile doctools/trunk/doc/_templates/index.html doctools/trunk/doc/_templates/indexsidebar.html doctools/trunk/doc/builders.rst doctools/trunk/doc/concepts.rst doctools/trunk/doc/conf.py doctools/trunk/doc/config.rst doctools/trunk/doc/ext/appapi.rst doctools/trunk/doc/ext/builderapi.rst doctools/trunk/doc/ext/coverage.rst doctools/trunk/doc/ext/doctest.rst doctools/trunk/doc/ext/math.rst doctools/trunk/doc/ext/refcounting.rst doctools/trunk/doc/extensions.rst doctools/trunk/doc/glossary.rst doctools/trunk/doc/intro.rst doctools/trunk/doc/markup/code.rst doctools/trunk/doc/markup/desc.rst doctools/trunk/doc/markup/inline.rst doctools/trunk/doc/markup/para.rst doctools/trunk/doc/rest.rst doctools/trunk/doc/templating.rst doctools/trunk/ez_setup.py doctools/trunk/setup.py doctools/trunk/sphinx-build.py doctools/trunk/sphinx-quickstart.py doctools/trunk/sphinx/__init__.py doctools/trunk/sphinx/_jinja.py doctools/trunk/sphinx/addnodes.py doctools/trunk/sphinx/application.py doctools/trunk/sphinx/builder.py doctools/trunk/sphinx/cmdline.py doctools/trunk/sphinx/config.py doctools/trunk/sphinx/directives/__init__.py doctools/trunk/sphinx/directives/code.py doctools/trunk/sphinx/directives/desc.py doctools/trunk/sphinx/directives/other.py doctools/trunk/sphinx/environment.py doctools/trunk/sphinx/ext/__init__.py doctools/trunk/sphinx/ext/autodoc.py doctools/trunk/sphinx/ext/coverage.py doctools/trunk/sphinx/ext/doctest.py doctools/trunk/sphinx/ext/ifconfig.py doctools/trunk/sphinx/ext/intersphinx.py doctools/trunk/sphinx/ext/jsmath.py doctools/trunk/sphinx/ext/mathbase.py doctools/trunk/sphinx/ext/pngmath.py doctools/trunk/sphinx/ext/refcounting.py doctools/trunk/sphinx/ext/todo.py doctools/trunk/sphinx/highlighting.py doctools/trunk/sphinx/locale/__init__.py doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/sphinx.pot doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/quickstart.py doctools/trunk/sphinx/roles.py doctools/trunk/sphinx/search.py doctools/trunk/sphinx/setup_command.py doctools/trunk/sphinx/static/searchtools.js doctools/trunk/sphinx/templates/changes/versionchanges.html doctools/trunk/sphinx/templates/layout.html doctools/trunk/sphinx/templates/modindex.html doctools/trunk/sphinx/templates/page.html doctools/trunk/sphinx/texinputs/sphinx.sty doctools/trunk/sphinx/util/__init__.py doctools/trunk/sphinx/util/compat.py doctools/trunk/sphinx/util/console.py doctools/trunk/sphinx/util/jsdump.py doctools/trunk/sphinx/util/stemmer.py doctools/trunk/sphinx/util/texescape.py doctools/trunk/tests/root/conf.py doctools/trunk/tests/root/contents.txt doctools/trunk/tests/root/images.txt doctools/trunk/tests/root/includes.txt doctools/trunk/tests/root/literal.inc doctools/trunk/tests/root/markup.txt doctools/trunk/tests/run.py doctools/trunk/tests/test_application.py doctools/trunk/tests/test_autodoc.py doctools/trunk/tests/test_build.py doctools/trunk/tests/test_config.py doctools/trunk/tests/test_coverage.py doctools/trunk/tests/test_env.py doctools/trunk/tests/test_i18n.py doctools/trunk/tests/test_markup.py doctools/trunk/tests/test_quickstart.py doctools/trunk/tests/util.py doctools/trunk/utils/check_sources.py Modified: doctools/trunk/AUTHORS ============================================================================== --- doctools/trunk/AUTHORS (original) +++ doctools/trunk/AUTHORS Sun Jan 4 21:38:57 2009 @@ -1,8 +1,27 @@ -The doctools are written and maintained by Georg Brandl . -Substantial parts of the templates and the web application were written by -Armin Ronacher . +Sphinx is written and maintained by Georg Brandl . -Other contributors are noted in the :copyright: fields within the docstrings -of the respective files. +Substantial parts of the templates were written by Armin Ronacher +. + +Other contributors, listed alphabetically, are: + +* Daniel B?ltmann -- todo extension +* Josip Dzolonga -- coverage builder +* Horst Gutmann -- internationalization support +* Martin Hans -- autodoc improvements +* Dave Kuhlman -- original LaTeX writer +* Thomas Lamb -- linkcheck builder +* Benjamin Peterson -- unittests +* Antonio Valentino -- qthelp builder +* Pauli Virtanen -- autodoc improvements +* Sebastian Wiesner -- image handling, distutils support Many thanks for all contributions! + +There are also a few modules or functions incorporated from other +authors and projects: + +* sphinx.util.jsdump uses the basestring encoding from simplejson, + written by Bob Ippolito, released under the MIT license +* sphinx.util.stemmer was written by Vivake Gupta, placed in the + Public Domain Modified: doctools/trunk/CHANGES ============================================================================== --- doctools/trunk/CHANGES (original) +++ doctools/trunk/CHANGES Sun Jan 4 21:38:57 2009 @@ -1,9 +1,152 @@ -Release 0.5 (in development) +Release 0.6 (in development) ============================ New features added ------------------ +* Incompatible changes: + + - Templating now requires the Jinja2 library, which is an enhanced + version of the old Jinja1 engine. Since the syntax and semantic + is largely the same, very few fixes should be necessary in + custom templates. + + - The ``autodoc_skip_member`` event now also gets to decide + whether to skip members whose name starts with underscores. + Previously, these members were always automatically skipped. + Therefore, if you handle this event, add something like this + to your event handler to restore the old behavior:: + + if name.startswith('_'): + return True + +* Markup: + + - Due to popular demand, added a ``:doc:`` role which directly + links to another document without the need of creating a + label to which a ``:ref:`` could link to. + + - #4: Added a ``:download:`` role that marks a non-document file + for inclusion into the HTML output and links to it. + + - The ``literalinclude`` directive now supports several more + options, to include only parts of a file. + + - The ``toctree`` directive now supports a ``:hidden:`` flag, + which will prevent links from being generated in place of + the directive -- this allows you to define your document + structure, but place the links yourself. + + - #77: If a description environment with info field list only + contains one ``:param:`` entry, no bullet list is generated. + + - #6: Don't generate redundant ``
    `` for top-level TOC tree + items, which leads to a visual separation of TOC entries. + + - #23: Added a ``classmethod`` directive along with ``method`` + and ``staticmethod``. + +* Configuration: + + - The new ``html_add_permalinks`` config value can be used to + switch off the generated "paragraph sign" permalinks for each + heading and definition environment. + + - The new ``html_show_sourcelink`` config value can be used to + switch off the links to the reST sources in the sidebar. + + - The default value for ``htmlhelp_basename`` is now the project + title, cleaned up as a filename. + +* Builders: + + - New builder for Qt help collections, by Antonio Valentino. + + - The new ``html_link_suffix`` config value can be used to select + the suffix of generated links between HTML files. + +* New translations: + + - Italian by Sandro Dentella. + +* Extensions and API: + + - Autodoc now handles documented attributes. + + - Autodoc now handles inner classes and their methods. + + - There is now a ``Sphinx.add_lexer()`` method to be able to use + custom Pygments lexers easily. + +* Other changes: + + - Config overrides for single dict keys can now be given on the + command line. + + - There is now a ``doctest_global_setup`` config value that can + be used to give setup code for all doctests in the documentation. + + - Source links in HTML are now generated with ``rel="nofollow"``. + + +Release 0.5.2 (in development) +============================== + +* #81: Write environment and search index in a manner that is safe + from exceptions that occur during dumping. + +* #80: Fix UnicodeErrors when a locale is set with setlocale(). + + +Release 0.5.1 (Dec 15, 2008) +============================ + +* #67: Output warnings about failed doctests in the doctest extension + even when running in quiet mode. + +* #72: In pngmath, make it possible to give a full path to LaTeX and + dvipng on Windows. For that to work, the ``pngmath_latex`` and + ``pngmath_dvipng`` options are no longer split into command and + additional arguments; use ``pngmath_latex_args`` and + ``pngmath_dvipng_args`` to give additional arguments. + +* Don't crash on failing doctests with non-ASCII characters. + +* Don't crash on writing status messages and warnings containing + unencodable characters. + +* Warn if a doctest extension block doesn't contain any code. + +* Fix the handling of ``:param:`` and ``:type:`` doc fields when + they contain markup (especially cross-referencing roles). + +* #65: Fix storage of depth information for PNGs generated by the + pngmath extension. + +* Fix autodoc crash when automethod is used outside a class context. + +* #68: Fix LaTeX writer output for images with specified height. + +* #60: Fix wrong generated image path when including images in sources + in subdirectories. + +* Fix the JavaScript search when html_copy_source is off. + +* Fix an indentation problem in autodoc when documenting classes + with the option ``autoclass_content = "both"`` set. + +* Don't crash on empty index entries, only emit a warning. + +* Fix a typo in the search JavaScript code, leading to unusable + search function in some setups. + + +Release 0.5 (Nov 23, 2008) -- Birthday release! +=============================================== + +New features added +------------------ + * Markup features: - Citations are now global: all citation defined in any file can be @@ -28,6 +171,12 @@ - Lists enumerated by letters or roman numerals are now handled like in standard reST. + - The ``seealso`` directive can now also be given arguments, as a short + form. + + - You can now document several programs and their options with the + new ``program`` directive. + * HTML output and templates: - Incompatible change: The "root" relation link (top left in the @@ -39,6 +188,12 @@ - The JavaScript search now searches for objects before searching in the full text. + - TOC tree entries now have CSS classes that make it possible to + style them depending on their depth. + + - Highlighted code blocks now have CSS classes that make it possible + to style them depending on their language. + - HTML ```` tags via the docutils ``meta`` directive are now supported. @@ -58,6 +213,9 @@ used to disable the anchor-link creation after headlines and definition links. + - Only generate a module index if there are some modules in the + documentation. + * New and changed config values: - Added support for internationalization in generated text with the @@ -70,6 +228,10 @@ * Micha? Kandulski -- Polish * Yasushi Masuda -- Japanese * Guillem Borrell -- Spanish + * Luc Saffre and Peter Bertels -- Dutch + * Fred Lin -- Traditional Chinese + * Roger Demetrescu -- Brazilian Portuguese + * Rok Garbas -- Slovenian - The new config value ``highlight_language`` set a global default for highlighting. When ``'python3'`` is selected, console output blocks @@ -94,6 +256,10 @@ creates links to Sphinx documentation of Python objects in other projects. + - The new extension ``sphinx.ext.todo`` allows the insertion of + "To do" directives whose visibility in the output can be toggled. + It also adds a directive to compile a list of all todo items. + - sphinx.ext.autodoc has a new event ``autodoc-process-signature`` that allows tuning function signature introspection. @@ -115,10 +281,18 @@ default HTML template. - Added new events: ``source-read``, ``env-updated``, - ``missing-reference``, ``build-finished``. + ``env-purge-doc``, ``missing-reference``, ``build-finished``. * Other changes: + - Added a command-line switch ``-Q``: it will suppress warnings. + + - Added a command-line switch ``-A``: it can be used to supply + additional values into the HTML templates. + + - Added a command-line switch ``-C``: if it is given, no configuration + file ``conf.py`` is required. + - Added a distutils command `build_sphinx`: When Sphinx is installed, you can call ``python setup.py build_sphinx`` for projects that have Sphinx documentation, which will build the docs and place them in @@ -130,13 +304,33 @@ Bugs fixed ---------- +* #51: Escape configuration values placed in HTML templates. + +* #44: Fix small problems in HTML help index generation. + +* Fix LaTeX output for line blocks in tables. + +* #38: Fix "illegal unit" error when using pixel image widths/heights. + +* Support table captions in LaTeX output. + +* #39: Work around a bug in Jinja that caused "" to be + emitted in HTML output. + +* Fix a problem with module links not being generated in LaTeX output. + +* Fix the handling of images in different directories. + +* #29: Support option lists in the text writer. Make sure that dashes + introducing long option names are not contracted to en-dashes. + * Support the "scale" option for images in HTML output. -* Properly escape quotes in HTML help attribute values. +* #25: Properly escape quotes in HTML help attribute values. * Fix LaTeX build for some description environments with ``:noindex:``. -* Don't crash on weird casing of role names (like ``:Class:``). +* #24: Don't crash on uncommon casing of role names (like ``:Class:``). * Only output ANSI colors on color terminals. Modified: doctools/trunk/EXAMPLES ============================================================================== --- doctools/trunk/EXAMPLES (original) +++ doctools/trunk/EXAMPLES Sun Jan 4 21:38:57 2009 @@ -1,36 +1,47 @@ Projects using Sphinx ===================== -This is an (incomplete) list of projects that use Sphinx or are -experimenting with using it for their documentation. If you like -to be included, please mail to `the Google group +This is an (incomplete) alphabetic list of projects that use Sphinx or are +experimenting with using it for their documentation. If you like to be +included, please mail to `the Google group `_. -* Sphinx: http://sphinx.pocoo.org/ -* Python: http://docs.python.org/dev/ -* NumPy: http://mentat.za.net/numpy/refguide/ -* Matplotlib: http://matplotlib.sourceforge.net/ -* Pylons: http://docs.pylonshq.com/ +* APSW: http://apsw.googlecode.com/svn/publish/index.html +* Calibre: http://calibre.kovidgoyal.net/user_manual/ +* Chaco: http://code.enthought.com/projects/chaco/docs/html/ +* Cython: http://docs.cython.org/ +* Director: http://packages.python.org/director/ * Django: http://docs.djangoproject.com/ +* F2py: http://www.f2py.org/html/ +* GeoDjango: http://geodjango.org/docs/ +* Glashammer: http://glashammer.org/ * Grok: http://grok.zope.org/doc/current/ -* TurboGears: http://turbogears.org/2.0/docs/ +* IFM: http://fluffybunny.memebot.com/ifm-docs/index.html * Jinja: http://jinja.pocoo.org/2/documentation/ -* Cython: http://docs.cython.org/ -* F2py: http://www.f2py.org/html/ -* zc.async: http://packages.python.org/zc.async/1.5.0/ +* MapServer: http://mapserver.osgeo.org/ +* Matplotlib: http://matplotlib.sourceforge.net/ * Mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi -* Chaco: http://code.enthought.com/projects/chaco/docs/html/ +* Mixin.com: http://dev.mixin.com/ +* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html +* NetworkX: http://networkx.lanl.gov/ +* NumPy: http://docs.scipy.org/doc/numpy/reference/ +* ObjectListView: http://objectlistview.sourceforge.net/python +* OpenLayers: http://docs.openlayers.org/ +* Paste: http://pythonpaste.org/script/ * Paver: http://www.blueskyonmars.com/projects/paver/ -* Satchmo: http://www.satchmoproject.com/docs/svn/ +* Py on Windows: http://timgolden.me.uk/python-on-windows/ * PyEphem: http://rhodesmill.org/pyephem/ -* Paste: http://pythonpaste.org/script/ -* Calibre: http://calibre.kovidgoyal.net/user_manual/ +* PyPubSub: http://pubsub.sourceforge.net/ * PyUblas: http://tiker.net/doc/pyublas/ -* Py on Windows: http://timgolden.me.uk/python-on-windows/ -* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html -* Zope 3: e.g. http://docs.carduner.net/z3c-tutorial/ -* Glashammer: http://glashammer.org/ +* Pylons: http://docs.pylonshq.com/ +* Pysparse: http://pysparse.sourceforge.net/ +* Python: http://docs.python.org/dev/ +* Satchmo: http://www.satchmoproject.com/docs/svn/ +* Sphinx: http://sphinx.pocoo.org/ +* SQLAlchemy: http://www.sqlalchemy.org/docs/ * SymPy: http://docs.sympy.org/ -* GeoDjango: http://geodjango.org/docs/ -* Mixin.com: http://dev.mixin.com/ -* PyPubSub: http://pubsub.sourceforge.net/ +* tinyTiM: http://tinytim.sourceforge.net/docs/2.0/ +* TurboGears: http://turbogears.org/2.0/docs/ +* WFront: http://discorporate.us/projects/WFront/ +* Zope 3: e.g. http://docs.carduner.net/z3c-tutorial/ +* zc.async: http://packages.python.org/zc.async/1.5.0/ Modified: doctools/trunk/LICENSE ============================================================================== --- doctools/trunk/LICENSE (original) +++ doctools/trunk/LICENSE Sun Jan 4 21:38:57 2009 @@ -1,30 +1,188 @@ -Copyright (c) 2007-2008 by the respective authors (see AUTHORS file). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright (c) 2007-2009 by the Sphinx team (see AUTHORS file). +All rights reserved. + +License for Sphinx +================== + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Licenses for incorporated software +================================== + +The pgen2 package, included in this distribution under the name +sphinx.pycode.pgen2, is available in the Python 2.6 distribution under +the PSF license agreement for Python: + +---------------------------------------------------------------------- +1. This LICENSE AGREEMENT is between the Python Software Foundation + ("PSF"), and the Individual or Organization ("Licensee") accessing + and otherwise using Python 2.6 software in source or binary form + and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF + hereby grants Licensee a nonexclusive, royalty-free, world-wide + license to reproduce, analyze, test, perform and/or display + publicly, prepare derivative works, distribute, and otherwise use + Python 2.6 alone or in any derivative version, provided, however, + that PSF's License Agreement and PSF's notice of copyright, i.e., + "Copyright ? 2001-2008 Python Software Foundation; All Rights + Reserved" are retained in Python 2.6 alone or in any derivative + version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on + or incorporates Python 2.6 or any part thereof, and wants to make + the derivative work available to others as provided herein, then + Licensee hereby agrees to include in any such work a brief summary + of the changes made to Python 2.6. + +4. PSF is making Python 2.6 available to Licensee on an "AS IS" basis. + PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY + WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY + REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY + PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.6 WILL NOT INFRINGE + ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON + 2.6 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS + AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON + 2.6, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY + THEREOF. + +6. This License Agreement will automatically terminate upon a material + breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any + relationship of agency, partnership, or joint venture between PSF + and Licensee. This License Agreement does not grant permission to + use PSF trademarks or trade name in a trademark sense to endorse or + promote products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python 2.6, Licensee + agrees to be bound by the terms and conditions of this License + Agreement. +---------------------------------------------------------------------- + +The included smartypants module, included as sphinx.util.smartypants, +is available under the following license: + +---------------------------------------------------------------------- +SmartyPants_ license:: + + Copyright (c) 2003 John Gruber + (http://daringfireball.net/) + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + * Neither the name "SmartyPants" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + This software is provided by the copyright holders and + contributors "as is" and any express or implied warranties, + including, but not limited to, the implied warranties of + merchantability and fitness for a particular purpose are + disclaimed. In no event shall the copyright owner or contributors + be liable for any direct, indirect, incidental, special, + exemplary, or consequential damages (including, but not limited + to, procurement of substitute goods or services; loss of use, + data, or profits; or business interruption) however caused and on + any theory of liability, whether in contract, strict liability, or + tort (including negligence or otherwise) arising in any way out of + the use of this software, even if advised of the possibility of + such damage. + + +smartypants.py license:: + + smartypants.py is a derivative work of SmartyPants. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + This software is provided by the copyright holders and + contributors "as is" and any express or implied warranties, + including, but not limited to, the implied warranties of + merchantability and fitness for a particular purpose are + disclaimed. In no event shall the copyright owner or contributors + be liable for any direct, indirect, incidental, special, + exemplary, or consequential damages (including, but not limited + to, procurement of substitute goods or services; loss of use, + data, or profits; or business interruption) however caused and on + any theory of liability, whether in contract, strict liability, or + tort (including negligence or otherwise) arising in any way out of + the use of this software, even if advised of the possibility of + such damage. +---------------------------------------------------------------------- + +The ElementTree package, included in this distribution in +test/etree13, is available under the following license: + +---------------------------------------------------------------------- +The ElementTree toolkit is + +Copyright (c) 1999-2007 by Fredrik Lundh + +By obtaining, using, and/or copying this software and/or its +associated documentation, you agree that you have read, understood, +and will comply with the following terms and conditions: + +Permission to use, copy, modify, and distribute this software and its +associated documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appears in all +copies, and that both that copyright notice and this permission notice +appear in supporting documentation, and that the name of Secret Labs +AB or the author not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- ABILITY +AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +---------------------------------------------------------------------- Added: doctools/trunk/MANIFEST.in ============================================================================== --- (empty file) +++ doctools/trunk/MANIFEST.in Sun Jan 4 21:38:57 2009 @@ -0,0 +1,22 @@ +include README +include LICENSE +include AUTHORS +include CHANGES +include EXAMPLES +include TODO + +include babel.cfg +include Makefile +include ez_setup.py +include sphinx-build.py +include sphinx-quickstart.py + +recursive-include sphinx/texinputs * +recursive-include sphinx/templates *.html *.xml +recursive-include sphinx/static * +recursive-include sphinx/locale * +recursive-include tests * +recursive-include utils * + +recursive-include doc * +prune doc/_build Modified: doctools/trunk/README ============================================================================== --- doctools/trunk/README (original) +++ doctools/trunk/README Sun Jan 4 21:38:57 2009 @@ -17,9 +17,9 @@ After installing:: cd doc - mkdir -p _build/html sphinx-build . _build/html - browser _build/index.html + +Then, direct your browser to ``_build/html/index.html``. Or read them online at . @@ -27,4 +27,4 @@ Contributing ============ -Send wishes, comments, patches, etc. to georg at python.org. +Send wishes, comments, patches, etc. to sphinx-dev at googlegroups.com. Modified: doctools/trunk/TODO ============================================================================== --- doctools/trunk/TODO (original) +++ doctools/trunk/TODO Sun Jan 4 21:38:57 2009 @@ -2,5 +2,5 @@ =========== All todo items are now tracked as issues in the Sphinx issue tracker at -. +. Modified: doctools/trunk/babel.cfg ============================================================================== --- doctools/trunk/babel.cfg (original) +++ doctools/trunk/babel.cfg Sun Jan 4 21:38:57 2009 @@ -1,6 +1,4 @@ -[extractors] -jinja = sphinx._jinja.babel_extract [python: **.py] -[jinja: **/templates/**.html] -[jinja: **/templates/**.xml] +[jinja2: **/templates/**.html] +[jinja2: **/templates/**.xml] [javascript: **.js] Modified: doctools/trunk/doc/Makefile ============================================================================== --- doctools/trunk/doc/Makefile (original) +++ doctools/trunk/doc/Makefile Sun Jan 4 21:38:57 2009 @@ -11,12 +11,12 @@ ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) \ $(SPHINXOPTS) . -.PHONY: help clean html web htmlhelp latex changes linkcheck +.PHONY: help clean html pickle htmlhelp qthelp latex changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" - @echo " web to make files usable by Sphinx.web" + @echo " pickle to make pickle files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview over all changed/added/deprecated items" @@ -31,13 +31,15 @@ @echo @echo "Build finished. The HTML pages are in _build/html." +text: + mkdir -p _build/text _build/doctrees + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) _build/text + @echo + @echo "Build finished." + pickle: mkdir -p _build/pickle _build/doctrees $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle - @echo - @echo "Build finished; now you can run" - @echo " python -m sphinx.web _build/pickle" - @echo "to start the server." htmlhelp: mkdir -p _build/htmlhelp _build/doctrees @@ -46,6 +48,16 @@ @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in _build/htmlhelp." +qthelp: + mkdir -p _build/qthelp _build/doctrees + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp + @echo + @echo "Build finished; now you can run qcollectiongenerator with the" \ + ".qhcp project file in build/qthelp." + @echo "# qcollectiongenerator _build/qthelp/Sphinx.qhcp" + @echo "To view the help collection:" + @echo "# assistant -collectionFile _build/qthelp/Sphinx.qhc" + latex: mkdir -p _build/latex _build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex Modified: doctools/trunk/doc/_templates/index.html ============================================================================== --- doctools/trunk/doc/_templates/index.html (original) +++ doctools/trunk/doc/_templates/index.html Sun Jan 4 21:38:57 2009 @@ -3,17 +3,22 @@ {% block body %}

    Welcome

    +
    +

    What users say:

    +

    “Cheers for a great tool that actually makes programmers want + to write documentation!”

    +
    +

    Sphinx is a tool that makes it easy to create intelligent and beautiful - documentation for Python projects, written by Georg Brandl and licensed - under the BSD license.

    + documentation, written by Georg Brandl and licensed under the BSD license.

    It was originally created to translate the - new Python documentation, but has now been cleaned up in the hope that - it will be useful to many other projects. (Of course, this site is also - created from reStructuredText sources using Sphinx!) + new Python documentation, and it has excellent support for the documentation + of Python projects, but other documents can be written with it too. Of course, + this site is also created from reStructuredText sources using Sphinx!

    - Although it is still under constant development, the following features are + It is still under constant development, and the following features are already present, work fine and can be seen “in action” in the Python docs:

    @@ -74,7 +79,7 @@ package on the Python Package Index.

    -

    The code can be found on the Python SVN server, under - http://svn.python.org/projects/doctools.

    +

    The code can be found in a Mercurial repository, at + http://bitbucket.org/birkenfeld/sphinx/.

    {% endblock %} Modified: doctools/trunk/doc/_templates/indexsidebar.html ============================================================================== --- doctools/trunk/doc/_templates/indexsidebar.html (original) +++ doctools/trunk/doc/_templates/indexsidebar.html Sun Jan 4 21:38:57 2009 @@ -1,16 +1,16 @@

    Download

    -{% if version.endswith('(SVN)') %} +{% if version.endswith('(hg)') %}

    This documentation is for version {{ version }}, which is not released yet.

    -

    You can check it out from - Subversion or look for +

    You can use it from the + Mercurial repo or look for released versions in the Python Package Index.

    {% else %}

    Current version: {{ version }}

    Get Sphinx from the Python Package Index, or install it with:

    -
    easy_install Sphinx
    +
    easy_install -U Sphinx
    {% endif %}

    Questions? Suggestions?

    @@ -23,4 +23,4 @@

    or come to the #python-docs channel on FreeNode.

    You can also open an issue at the - tracker.

    + tracker.

    Modified: doctools/trunk/doc/builders.rst ============================================================================== --- doctools/trunk/doc/builders.rst (original) +++ doctools/trunk/doc/builders.rst Sun Jan 4 21:38:57 2009 @@ -3,7 +3,7 @@ Available builders ================== -.. module:: sphinx.builder +.. module:: sphinx.builders :synopsis: Available built-in builder classes. These are the built-in Sphinx builders. More builders can be added by @@ -13,6 +13,7 @@ :program:`sphinx-build` to select a builder. +.. module:: sphinx.builders.html .. class:: StandaloneHTMLBuilder This is the standard HTML builder. Its output is a directory with HTML @@ -30,34 +31,7 @@ Its name is ``htmlhelp``. -.. class:: PickleHTMLBuilder - - This builder produces a directory with pickle files containing mostly HTML - fragments and TOC information, for use of a web application (or custom - postprocessing tool) that doesn't use the standard HTML templates. - - See :ref:`serialization-details` for details about the output format. - - Its name is ``pickle``. (The old name ``web`` still works as well.) - - The file suffix is ``.fpickle``. The global context is called - ``globalcontext.pickle``, the search index ``searchindex.pickle``. - -.. class:: JSONHTMLBuilder - - This builder produces a directory with JSON files containing mostly HTML - fragments and TOC information, for use of a web application (or custom - postprocessing tool) that doesn't use the standard HTML templates. - - See :ref:`serialization-details` for details about the output format. - - Its name is ``json``. - - The file suffix is ``.fjson``. The global context is called - ``globalcontext.json``, the search index ``searchindex.json``. - - .. versionadded:: 0.5 - +.. module:: sphinx.builders.latex .. class:: LaTeXBuilder This builder produces a bunch of LaTeX files in the output directory. You @@ -66,8 +40,19 @@ configuration values that customize the output of this builder, see the chapter :ref:`latex-options` for details. + .. note:: + + The produced LaTeX file uses several LaTeX packages that may not be + present in a "minimal" TeX distribution installation. For TeXLive, + the following packages need to be installed: + + * latex-recommended + * latex-extra + * fonts-recommended + Its name is ``latex``. +.. module:: sphinx.builders.text .. class:: TextBuilder This builder produces a text file for each reST file -- this is almost the @@ -78,6 +63,7 @@ .. versionadded:: 0.4 +.. currentmodule:: sphinx.builders.html .. class:: SerializingHTMLBuilder This builder uses a module that implements the Python serialization API @@ -124,7 +110,36 @@ See :ref:`serialization-details` for details about the output format. .. versionadded:: 0.5 - + +.. class:: PickleHTMLBuilder + + This builder produces a directory with pickle files containing mostly HTML + fragments and TOC information, for use of a web application (or custom + postprocessing tool) that doesn't use the standard HTML templates. + + See :ref:`serialization-details` for details about the output format. + + Its name is ``pickle``. (The old name ``web`` still works as well.) + + The file suffix is ``.fpickle``. The global context is called + ``globalcontext.pickle``, the search index ``searchindex.pickle``. + +.. class:: JSONHTMLBuilder + + This builder produces a directory with JSON files containing mostly HTML + fragments and TOC information, for use of a web application (or custom + postprocessing tool) that doesn't use the standard HTML templates. + + See :ref:`serialization-details` for details about the output format. + + Its name is ``json``. + + The file suffix is ``.fjson``. The global context is called + ``globalcontext.json``, the search index ``searchindex.json``. + + .. versionadded:: 0.5 + +.. module:: sphinx.builders.changes .. class:: ChangesBuilder This builder produces an HTML overview of all :dir:`versionadded`, @@ -134,6 +149,7 @@ Its name is ``changes``. +.. module:: sphinx.builders.linkcheck .. class:: CheckExternalLinksBuilder This builder scans all documents for external links, tries to open them with Modified: doctools/trunk/doc/concepts.rst ============================================================================== --- doctools/trunk/doc/concepts.rst (original) +++ doctools/trunk/doc/concepts.rst Sun Jan 4 21:38:57 2009 @@ -85,6 +85,18 @@ This includes first all documents whose names start with ``intro``, then all documents in the ``recipe`` folder, then all remaining documents (except the one containing the directive, of course.) [#]_ + + You can also give a "hidden" option to the directive, like this:: + + .. toctree:: + :hidden: + + doc_1 + doc_2 + + This will still notify Sphinx of the document hierarchy, but not insert links + into the document at the location of the directive -- this makes sense if you + intend to insert these links yourself, in a different style. In the end, all documents in the :term:`source directory` (or subdirectories) must occur in some ``toctree`` directive; Sphinx will emit a warning if it @@ -100,6 +112,9 @@ .. versionchanged:: 0.3 Added "globbing" option. + .. versionchanged:: 0.6 + Added "hidden" option. + Special names ------------- Modified: doctools/trunk/doc/conf.py ============================================================================== --- doctools/trunk/doc/conf.py (original) +++ doctools/trunk/doc/conf.py Sun Jan 4 21:38:57 2009 @@ -19,9 +19,11 @@ # General configuration # --------------------- +language = 'en' + # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.addons.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -34,7 +36,7 @@ # General substitutions. project = 'Sphinx' -copyright = '2008, Georg Brandl' +copyright = '2007-2009, Georg Brandl' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -134,6 +136,12 @@ #latex_appendices = [] +# Extension options +# ----------------- + +todo_include_todos = True + + # Extension interface # ------------------- Modified: doctools/trunk/doc/config.rst ============================================================================== --- doctools/trunk/doc/config.rst (original) +++ doctools/trunk/doc/config.rst Sun Jan 4 21:38:57 2009 @@ -22,8 +22,8 @@ * The term "fully-qualified name" refers to a string that names an importable Python object inside a module; for example, the FQN - ``"sphinx.builder.Builder"`` means the ``Builder`` class in the - ``sphinx.builder`` module. + ``"sphinx.builders.Builder"`` means the ``Builder`` class in the + ``sphinx.builders`` module. * Remember that document names use ``/`` as the path separator and don't contain the file name extension. @@ -45,7 +45,7 @@ .. confval:: extensions A list of strings that are module names of Sphinx extensions. These can be - extensions coming with Sphinx (named ``sphinx.addons.*``) or custom ones. + extensions coming with Sphinx (named ``sphinx.ext.*``) or custom ones. Note that you can extend :data:`sys.path` within the conf file if your extensions live in another directory -- but make sure you use absolute paths. @@ -203,8 +203,14 @@ * ``cs`` -- Czech * ``de`` -- German * ``en`` -- English + * ``es`` -- Spanish * ``fr`` -- French + * ``it`` -- Italian + * ``nl`` -- Dutch * ``pl`` -- Polish + * ``pt_BR`` -- Brazilian Portuguese + * ``sl`` -- Slovenian + * ``zh_TW`` -- Traditional Chinese .. confval:: today today_fmt @@ -327,6 +333,15 @@ If true, *SmartyPants* will be used to convert quotes and dashes to typographically correct entities. Default: ``True``. +.. confval:: html_add_permalinks + + If true, Sphinx will add "permalinks" for each heading and description + environment as paragraph signs that become visible when the mouse hovers over + them. Default: ``True``. + + .. versionadded:: 0.6 + Previously, this was always activated. + .. confval:: html_sidebars Custom sidebar templates, must be a dictionary that maps document names to @@ -388,6 +403,19 @@ If true, the reST sources are included in the HTML build as :file:`_sources/{name}`. The default is ``True``. + .. warning:: + + If this config value is set to ``False``, the JavaScript search function + will only display the titles of matching documents, and no excerpt from + the matching contents. + +.. confval:: html_show_sourcelink + + If true (and :confval:`html_copy_source` is true as well), links to the + reST sources will be added to the sidebar. The default is ``True``. + + .. versionadded:: 0.6 + .. confval:: html_use_opensearch If nonempty, an `OpenSearch ` description file will be @@ -404,10 +432,18 @@ .. versionadded:: 0.4 +.. confval:: html_link_suffix + + Suffix for generated links to HTML files. The default is whatever + :confval:`html_file_suffix` is set to; it can be set differently (e.g. to + support different web server setups). + + .. versionadded:: 0.6 + .. confval:: html_translator_class A string with the fully-qualified name of a HTML Translator class, that is, a - subclass of Sphinx' :class:`~sphinx.htmlwriter.HTMLTranslator`, that is used + subclass of Sphinx' :class:`~sphinx.writers.html.HTMLTranslator`, that is used to translate document trees to HTML. Default is ``None`` (use the builtin translator). Modified: doctools/trunk/doc/ext/appapi.rst ============================================================================== --- doctools/trunk/doc/ext/appapi.rst (original) +++ doctools/trunk/doc/ext/appapi.rst Sun Jan 4 21:38:57 2009 @@ -13,7 +13,7 @@ .. method:: Sphinx.add_builder(builder) Register a new builder. *builder* must be a class that inherits from - :class:`~sphinx.builder.Builder`. + :class:`~sphinx.builders.Builder`. .. method:: Sphinx.add_config_value(name, default, rebuild_env) @@ -59,7 +59,7 @@ .. versionchanged:: 0.5 Added the support for keyword arguments giving visit functions. -.. method:: Sphinx.add_directive(name, cls, content, arguments, **options) +.. method:: Sphinx.add_directive(name, func, content, arguments, **options) Register a Docutils directive. *name* must be the prospective directive name, *func* the directive function for details about the signature and @@ -68,6 +68,16 @@ options, respectively. For their exact meaning, please consult the Docutils documentation. + For example, the (already existing) :dir:`literalinclude` directive would be + added like this:: + + from docutils.parsers.rst import directives + add_directive('literalinclude', literalinclude_directive, + content = 0, arguments = (1, 0, 0), + linenos = directives.flag, + language = direcitves.unchanged, + encoding = directives.encoding) + .. XXX once we target docutils 0.5, update this .. method:: Sphinx.add_role(name, role) @@ -157,6 +167,13 @@ :confval:`the docs for the config value `. .. versionadded:: 0.5 + +.. method:: Sphinx.add_lexer(alias, lexer) + + Use *lexer*, which must be an instance of a Pygments lexer class, to + highlight code blocks with the given language *alias*. + + .. versionadded:: 0.6 .. method:: Sphinx.connect(event, callback) @@ -208,12 +225,29 @@ Emitted when the builder object has been created. It is available as ``app.builder``. +.. event:: env-purge-doc (app, env, docname) + + Emitted when all traces of a source file should be cleaned from the + environment, that is, if the source file is removed or before it is freshly + read. This is for extensions that keep their own caches in attributes of the + environment. + + For example, there is a cache of all modules on the environment. When a + source file has been changed, the cache's entries for the file are cleared, + since the module declarations could have been removed from the file. + + .. versionadded:: 0.5 + .. event:: source-read (app, docname, source) Emitted when a source file has been read. The *source* argument is a list whose single element is the contents of the source file. You can process the contents and replace this item to implement source-level transformations. + For example, if you want to use ``$`` signs to delimit inline math, like in + LaTeX, you can use a regular expression to replace ``$...$`` by + ``:math:`...```. + .. versionadded:: 0.5 .. event:: doctree-read (app, doctree) @@ -241,7 +275,11 @@ .. event:: doctree-resolved (app, doctree, docname) Emitted when a doctree has been "resolved" by the environment, that is, all - references have been resolved and TOCs have been inserted. + references have been resolved and TOCs have been inserted. The *doctree* can + be modified in place. + + Here is the place to replace custom nodes that don't have visitor methods in + the writers, so that they don't cause errors when the writers encounter them. .. event:: env-updated (app, env) Modified: doctools/trunk/doc/ext/builderapi.rst ============================================================================== --- doctools/trunk/doc/ext/builderapi.rst (original) +++ doctools/trunk/doc/ext/builderapi.rst Sun Jan 4 21:38:57 2009 @@ -3,9 +3,9 @@ Writing new builders ==================== -XXX to be expanded. +.. todo:: Expand this. -.. currentmodule:: sphinx.builder +.. currentmodule:: sphinx.builders .. class:: Builder @@ -20,7 +20,7 @@ .. automethod:: build_update .. automethod:: build - These methods must be overridden in concrete builder classes: + These methods can be overridden in concrete builder classes: .. automethod:: init .. automethod:: get_outdated_docs @@ -28,3 +28,7 @@ .. automethod:: prepare_writing .. automethod:: write_doc .. automethod:: finish + + Useful helpers: + + .. automethod:: init_templates Modified: doctools/trunk/doc/ext/coverage.rst ============================================================================== --- doctools/trunk/doc/ext/coverage.rst (original) +++ doctools/trunk/doc/ext/coverage.rst Sun Jan 4 21:38:57 2009 @@ -12,7 +12,7 @@ To use this builder, activate the coverage extension in your configuration file and give ``-b coverage`` on the command line. -XXX to be expanded. +.. todo:: Write this section. Several new configuration values can be used to specify what the builder should check: Modified: doctools/trunk/doc/ext/doctest.rst ============================================================================== --- doctools/trunk/doc/ext/doctest.rst (original) +++ doctools/trunk/doc/ext/doctest.rst Sun Jan 4 21:38:57 2009 @@ -149,6 +149,14 @@ A list of directories that will be added to :data:`sys.path` when the doctest builder is used. (Make sure it contains absolute paths.) +.. confval:: doctest_global_setup + + Python code that is treated like it were put in a ``testsetup`` directive for + *every* file that is tested, and for every group. You can use this to + e.g. import modules you will always need in your doctests. + + .. versionadded:: 0.6 + .. confval:: doctest_test_doctest_blocks If this is a nonempty string (the default is ``'default'``), standard reST Modified: doctools/trunk/doc/ext/math.rst ============================================================================== --- doctools/trunk/doc/ext/math.rst (original) +++ doctools/trunk/doc/ext/math.rst Sun Jan 4 21:38:57 2009 @@ -12,8 +12,13 @@ supports math in documentation with two extensions. The basic math support that is common to both extensions is contained in -:mod:`sphinx.ext.mathbase`. Other math support extensions should, if possible, -reuse that support too. +:mod:`sphinx.ext.mathbase`. Other math support extensions should, +if possible, reuse that support too. + +.. note:: + + :mod:`sphinx.ext.mathbase` does not need to be added to the + :confval:`extensions` config value. The input language for mathematics is LaTeX markup. This is the de-facto standard for plain-text math notation and has the added advantage that no @@ -105,9 +110,6 @@ may need to set this to a full path if ``latex`` not in the executable search path. - This string is split into words with :func:`shlex.split`, so that you can - include arguments as well if needed. - Since this setting is not portable from system to system, it is normally not useful to set it in ``conf.py``; rather, giving it on the :program:`sphinx-build` command line via the :option:`-D` option should be @@ -115,12 +117,23 @@ sphinx-build -b html -D pngmath_latex=C:\tex\latex.exe . _build/html + .. versionchanged:: 0.5.1 + This value should only contain the path to the latex executable, not + further arguments; use :confval:`pngmath_latex_args` for that purpose. + .. confval:: pngmath_dvipng The command name with which to invoke ``dvipng``. The default is ``'dvipng'``; you may need to set this to a full path if ``dvipng`` is not in the executable search path. +.. confval:: pngmath_latex_args + + Additional arguments to give to latex, as a list. The default is an empty + list. + + .. versionadded:: 0.5.1 + .. confval:: pngmath_latex_preamble Additional LaTeX code to put into the preamble of the short LaTeX files that @@ -129,11 +142,21 @@ .. confval:: pngmath_dvipng_args - Additional arguments to give to dvipng, as a list. This is empty by default. - Arguments you might want to add here are e.g. ``['-bg', 'Transparent']``, + Additional arguments to give to dvipng, as a list. The default value is + ``['-gamma 1.5', '-D 110']`` which makes the image a bit darker and larger + then it is by default. + + An arguments you might want to add here is e.g. ``'-bg Transparent'``, which produces PNGs with a transparent background. This is not enabled by default because some Internet Explorer versions don't like transparent PNGs. + .. note:: + + When you "add" an argument, you need to reproduce the default arguments if + you want to keep them; that is, like this:: + + pngmath_dvipng_args = ['-gamma 1.5', '-D 110', '-bg Transparent'] + .. confval:: pngmath_use_preview ``dvipng`` has the ability to determine the "depth" of the rendered text: for Modified: doctools/trunk/doc/ext/refcounting.rst ============================================================================== --- doctools/trunk/doc/ext/refcounting.rst (original) +++ doctools/trunk/doc/ext/refcounting.rst Sun Jan 4 21:38:57 2009 @@ -4,4 +4,4 @@ .. module:: sphinx.ext.refcounting :synopsis: Keep track of reference counting behavior. -XXX to be written. +.. todo:: Write this section. Added: doctools/trunk/doc/ext/todo.rst ============================================================================== --- (empty file) +++ doctools/trunk/doc/ext/todo.rst Sun Jan 4 21:38:57 2009 @@ -0,0 +1,30 @@ +:mod:`sphinx.ext.todo` -- Support for todo items +================================================ + +.. module:: sphinx.ext.todo + :synopsis: Allow inserting todo items into documents. +.. moduleauthor:: Daniel B?ltmann + +.. versionadded:: 0.5 + +There are two additional directives when using this extension: + +.. directive:: todo + + Use this directive like, for example, :dir:`note`. + + It will only show up in the output if :confval:`todo_include_todos` is true. + + +.. directive:: todolist + + This directive is replaced by a list of all todo directives in the whole + documentation, if :confval:`todo_include_todos` is true. + + +There is also an additional config value: + +.. confval:: todo_include_todos + + If this is ``True``, :dir:`todo` and :dir:`todolist` produce output, else + they produce nothing. The default is ``False``. Added: doctools/trunk/doc/ext/tutorial.rst ============================================================================== --- (empty file) +++ doctools/trunk/doc/ext/tutorial.rst Sun Jan 4 21:38:57 2009 @@ -0,0 +1,316 @@ +.. _exttut: + +Tutorial: Writing a simple extension +==================================== + +This section is intended as a walkthrough for the creation of custom extensions. +It covers the basics of writing and activating an extensions, as well as +commonly used features of extensions. + +As an example, we will cover a "todo" extension that adds capabilities to +include todo entries in the documentation, and collecting these in a central +place. (A similar "todo" extension is distributed with Sphinx.) + + +Build Phases +------------ + +One thing that is vital in order to understand extension mechanisms is the way +in which a Sphinx project is built: this works in several phases. + +**Phase 0: Initialization** + + In this phase, almost nothing interesting for us happens. The source + directory is searched for source files, and extensions are initialized. + Should a stored build environment exist, it is loaded, otherwise a new one is + created. + +**Phase 1: Reading** + + In Phase 1, all source files (and on subsequent builds, those that are new or + changed) are read and parsed. This is the phase where directives and roles + are encountered by the docutils, and the corresponding functions are called. + The output of this phase is a *doctree* for each source files, that is a tree + of docutils nodes. For document elements that aren't fully known until all + existing files are read, temporary nodes are created. + + During reading, the build environment is updated with all meta- and cross + reference data of the read documents, such as labels, the names of headings, + described Python objects and index entries. This will later be used to + replace the temporary nodes. + + The parsed doctrees are stored on the disk, because it is not possible to + hold all of them in memory. + +**Phase 2: Consistency checks** + + Some checking is done to ensure no surprises in the built documents. + +**Phase 3: Resolving** + + Now that the metadata and cross-reference data of all existing documents is + known, all temporary nodes are replaced by nodes that can be converted into + output. For example, links are created for object references that exist, and + simple literal nodes are created for those that don't. + +**Phase 4: Writing** + + This phase converts the resolved doctrees to the desired output format, such + as HTML or LaTeX. This happens via a so-called docutils writer that visits + the individual nodes of each doctree and produces some output in the process. + +.. note:: + + Some builders deviate from this general build plan, for example, the builder + that checks external links does not need anything more than the parsed + doctrees and therefore does not have phases 2--4. + + +Extension Design +---------------- + +We want the extension to add the following to Sphinx: + +* A "todo" directive, containing some content that is marked with "TODO", and + only shown in the output if a new config value is set. (Todo entries should + not be in the output by default.) + +* A "todolist" directive that creates a list of all todo entries throughout the + documentation. + +For that, we will need to add the following elements to Sphinx: + +* New directives, called ``todo`` and ``todolist``. +* New document tree nodes to represent these directives, conventionally also + called ``todo`` and ``todolist``. We wouldn't need new nodes if the new + directives only produced some content representable by existing nodes. +* A new config value ``todo_include_todos`` (config value names should start + with the extension name, in order to stay unique) that controls whether todo + entries make it into the output. +* New event handlers: one for the :event:`doctree-resolved` event, to replace + the todo and todolist nodes, and one for :event:`env-purge-doc` (the reason + for that will be covered later). + + +The Setup Function +------------------ + +.. currentmodule:: sphinx.application + +The new elements are added in the extension's setup function. Let us create a +new Python module called :file:`todo.py` and add the setup function:: + + def setup(app): + app.add_config_value('todo_include_todos', False, False) + + app.add_node(todolist) + app.add_node(todo, + html=(visit_todo_node, depart_todo_node), + latex=(visit_todo_node, depart_todo_node), + text=(visit_todo_node, depart_todo_node)) + + app.add_directive('todo', todo_directive, 1, (0, 0, 1)) + app.add_directive('todolist', todolist_directive, 0, (0, 0, 0)) + app.connect('doctree-resolved', process_todo_nodes) + app.connect('env-purge-doc', purge_todos) + +The calls in this function refer to classes and functions not yet written. What +the individual calls do is the following: + +* :meth:`~Sphinx.add_config_value` lets Sphinx know that it should recognize the + new *config value* ``todo_include_todos``, whose default value should be + ``False`` (this also tells Sphinx that it is a boolean value). + + If the third argument was ``True``, all documents would be re-read if the + config value changed its value. This is needed for config values that + influence reading (build phase 1). + +* :meth:`~Sphinx.add_node` adds a new *node class* to the build system. It also + can specify visitor functions for each supported output format. These visitor + functions are needed when the new nodes stay until phase 4 -- since the + ``todolist`` node is always replaced in phase 3, it doesn't need any. + + We need to create the two node classes ``todo`` and ``todolist`` later. + +* :meth:`~Sphinx.add_directive` adds a new *directive*, given by name, handler + function and two arguments that specify if the directive has content and how + many arguments it accepts. + + The handler functions are created later. + +* Finally, :meth:`~Sphinx.connect` adds an *event handler* to the event whose + name is given by the first argument. The event handler function is called + with several arguments which are documented with the event. + + +The Node Classes +---------------- + +Let's start with the node classes:: + + from docutils import nodes + + class todo(nodes.Admonition, nodes.Element): + pass + + class todolist(nodes.General, nodes.Element): + pass + + def visit_todo_node(self, node): + self.visit_admonition(node) + + def depart_todo_node(self, node): + self.depart_admonition(node) + +Node classes usually don't have to do anything except inherit from the standard +docutils classes defined in :mod:`docutils.nodes`. ``todo`` inherits from +``Admonition`` because it should be handled like a note or warning, ``todolist`` +is just a "general" node. + + +The Directive Handlers +---------------------- + +A directive handler is a function with a host of arguments, covered in detail in +the docutils documentation. It must return a list of nodes. + +The ``todolist`` directive is quite simple:: + + def todolist_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return [todolist('')] + +An instance of our ``todolist`` node class is created and returned. The +todolist directive has neither content nor arguments that need to be handled. + +The ``todo`` directive function looks like this:: + + from sphinx.util.compat import make_admonition + + def todo_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + env = state.document.settings.env + + targetid = "todo-%s" % env.index_num + env.index_num += 1 + targetnode = nodes.target('', '', ids=[targetid]) + + ad = make_admonition(todo, name, [_('Todo')], options, content, lineno, + content_offset, block_text, state, state_machine) + + if not hasattr(env, 'todo_all_todos'): + env.todo_all_todos = [] + env.todo_all_todos.append({ + 'docname': env.docname, + 'lineno': lineno, + 'todo': ad[0].deepcopy(), + 'target': targetnode, + }) + + return [targetnode] + ad + +Several important things are covered here. First, as you can see, you can refer +to the build environment instance using ``state.document.settings.env``. + +Then, to act as a link target (from the todolist), the todo directive needs to +return a target node in addition to the todo node. The target ID (in HTML, this +will be the anchor name) is generated by using ``env.index_num`` which is +persistent between directive calls and therefore leads to unique target names. +The target node is instantiated without any text (the first two arguments). + +An admonition is created using a standard docutils function (wrapped in Sphinx +for docutils cross-version compatibility). The first argument gives the node +class, in our case ``todo``. The third argument gives the admonition title (use +``arguments`` here to let the user specify the title). A list of nodes is +returned from ``make_admonition``. + +Then, the todo node is added to the environment. This is needed to be able to +create a list of all todo entries throughout the documentation, in the place +where the author puts a ``todolist`` directive. For this case, the environment +attribute ``todo_all_todos`` is used (again, the name should be unique, so it is +prefixed by the extension name). It does not exist when a new environment is +created, so the directive must check and create it if necessary. Various +information about the todo entry's location are stored along with a copy of the +node. + +In the last line, the nodes that should be put into the doctree are returned: +the target node and the admonition node. + + +The Event Handlers +------------------ + +Finally, let's look at the event handlers. First, the one for the +:event:`env-purge-doc` event:: + + def purge_todos(app, env, docname): + if not hasattr(env, 'todo_all_todos'): + return + env.todo_all_todos = [todo for todo in env.todo_all_todos + if todo['docname'] != docname] + +Since we store information from source files in the environment, which is +persistent, it may become out of date when the source file changes. Therefore, +before each source file is read, the environment's records of it are cleared, +and the :event:`env-purge-doc` event gives extensions a chance to do the same. +Here we clear out all todos whose docname matches the given one from the +``todo_all_todos`` list. If there are todos left in the document, they will be +added again during parsing. + +The other handler belongs to the :event:`doctree-resolved` event. This event is +emitted at the end of phase 3 and allows custom resolving to be done:: + + def process_todo_nodes(app, doctree, fromdocname): + if not app.config.todo_include_todos: + for node in doctree.traverse(todo_node): + node.parent.remove(node) + + # Replace all todolist nodes with a list of the collected todos. + # Augment each todo with a backlink to the original location. + env = app.builder.env + + for node in doctree.traverse(todolist): + if not app.config.todo_include_todos: + node.replace_self([]) + continue + + content = [] + + for todo_info in env.todo_all_todos: + para = nodes.paragraph() + filename = env.doc2path(todo_info['docname'], base=None) + description = ( + _('(The original entry is located in %s, line %d and can be found ') % + (filename, todo_info['lineno'])) + para += nodes.Text(description, description) + + # Create a reference + newnode = nodes.reference('', '') + innernode = nodes.emphasis(_('here'), _('here')) + newnode['refdocname'] = todo_info['docname'] + newnode['refuri'] = app.builder.get_relative_uri( + fromdocname, todo_info['docname']) + newnode['refuri'] += '#' + todo_info['target']['refid'] + newnode.append(innernode) + para += newnode + para += nodes.Text('.)', '.)') + + # Insert into the todolist + content.append(todo_info['todo']) + content.append(para) + + node.replace_self(content) + +It is a bit more involved. If our new "todo_include_todos" config value is +false, all todo and todolist nodes are removed from the documents. + +If not, todo nodes just stay where and how they are. Todolist nodes are +replaced by a list of todo entries, complete with backlinks to the location +where they come from. The list items are composed of the nodes from the todo +entry and docutils nodes created on the fly: a paragraph for each entry, +containing text that gives the location, and a link (reference node containing +an italic node) with the backreference. The reference URI is built by +``app.builder.get_relative_uri`` which creates a suitable URI depending on the +used builder, and appending the todo node's (the target's) ID as the anchor +name. + Modified: doctools/trunk/doc/extensions.rst ============================================================================== --- doctools/trunk/doc/extensions.rst (original) +++ doctools/trunk/doc/extensions.rst Sun Jan 4 21:38:57 2009 @@ -9,17 +9,25 @@ Since many projects will need special features in their documentation, Sphinx is designed to be extensible on several levels. -First, you can add new :term:`builder`\s to support new output formats or -actions on the parsed documents. Then, it is possible to register custom -reStructuredText roles and directives, extending the markup. And finally, there -are so-called "hook points" at strategic places throughout the build process, -where an extension can register a hook and run specialized code. - -The configuration file itself can be an extension, see the :confval:`extensions` -configuration value docs. +This is what you can do in an extension: First, you can add new +:term:`builder`\s to support new output formats or actions on the parsed +documents. Then, it is possible to register custom reStructuredText roles and +directives, extending the markup. And finally, there are so-called "hook +points" at strategic places throughout the build process, where an extension can +register a hook and run specialized code. + +An extension is simply a Python module. When an extension is loaded, Sphinx +imports this module and executes its ``setup()`` function, which in turn +notifies Sphinx of everything the extension offers -- see the extension tutorial +for examples. + +The configuration file itself can be treated as an extension if it contains a +``setup()`` function. All other extensions to load must be listed in the +:confval:`extensions` configuration value. .. toctree:: + ext/tutorial ext/appapi ext/builderapi @@ -39,3 +47,36 @@ ext/refcounting ext/ifconfig ext/coverage + ext/todo + + +Third-party extensions +---------------------- + +There are several extensions that are not (yet) maintained in the Sphinx +distribution. The `Wiki at BitBucket`_ maintains a list of those. + +If you write an extension that you think others will find useful, please write +to the project mailing list (sphinx-dev at googlegroups.com) and we'll find the +proper way of including or hosting it for the public. + +.. _Wiki at BitBucket: http://www.bitbucket.org/birkenfeld/sphinx/wiki/Home + + +Where to put your own extensions? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Extensions local to a project should be put within the project's directory +structure. Set Python's module search path, ``sys.path``, accordingly so that +Sphinx can find them. +E.g., if your extension ``foo.py`` lies in the ``exts`` subdirectory of the +project root, put into :file:`conf.py`:: + + import sys, os + + sys.path.append(os.path.abspath('exts')) + + extensions = ['foo'] + +You can also install extensions anywhere else on ``sys.path``, e.g. in the +``site-packages`` directory. Modified: doctools/trunk/doc/glossary.rst ============================================================================== --- doctools/trunk/doc/glossary.rst (original) +++ doctools/trunk/doc/glossary.rst Sun Jan 4 21:38:57 2009 @@ -6,7 +6,7 @@ .. glossary:: builder - A class (inheriting from :class:`~sphinx.builder.Builder`) that takes + A class (inheriting from :class:`~sphinx.builders.Builder`) that takes parsed documents and performs an action on them. Normally, builders translate the documents to an output format, but it is also possible to use the builder builders that e.g. check for broken links in the Modified: doctools/trunk/doc/intro.rst ============================================================================== --- doctools/trunk/doc/intro.rst (original) +++ doctools/trunk/doc/intro.rst Sun Jan 4 21:38:57 2009 @@ -105,17 +105,33 @@ .. versionadded:: 0.3 +**-C** + Don't look for a configuration file; only take options via the ``-D`` option. + + .. versionadded:: 0.5 + **-D** *setting=value* - Override a configuration value set in the :file:`conf.py` file. (The value - must be a string value.) + Override a configuration value set in the :file:`conf.py` file. The value + must be a string or dictionary value. For the latter, supply the setting + name and key like this: ``-D latex_elements.docclass=scrartcl``. + + .. versionchanged:: 0.6 + The value can now be a dictionary value. + +**-A** *name=value* + Make the *name* assigned to *value* in the HTML templates. **-N** Do not do colored output. (On Windows, colored output is disabled in any case.) **-q** - Do not output anything on standard output, only write warnings to standard - error. + Do not output anything on standard output, only write warnings and errors to + standard error. + +**-Q** + Do not output anything on standard output, also suppress warnings. Only + errors are written to standard error. **-P** (Useful for debugging only.) Run the Python debugger, :mod:`pdb`, if an Modified: doctools/trunk/doc/markup/code.rst ============================================================================== --- doctools/trunk/doc/markup/code.rst (original) +++ doctools/trunk/doc/markup/code.rst Sun Jan 4 21:38:57 2009 @@ -113,8 +113,35 @@ .. literalinclude:: example.py :encoding: latin-1 + The directive also supports including only parts of the file. If it is a + Python module, you can select a class, function or method to include using + the ``pyobject`` option:: + + .. literalinclude:: example.py + :pyobject: Timer.start + + This would only include the code lines belonging to the ``start()`` method in + the ``Timer`` class within the file. + + Alternately, you can specify exactly which lines to include by giving a + ``lines`` option:: + + .. literalinclude:: example.py + :lines: 1,3,5-10,20- + + This includes the lines 1, 3, 5 to 10 and lines 20 to the last line. + + Another way to control which part of the file is included is to use the + ``start-after`` and ``end-before`` options (or only one of them). If + ``start-after`` is given as a string option, only lines that follow the first + line containing that string are included. If ``end-before`` is given as a + string option, only lines that precede the first lines containing that string + are included. + .. versionadded:: 0.4.3 The ``encoding`` option. + .. versionadded:: 0.6 + The ``pyobject``, ``lines``, ``start-after`` and ``end-before`` options. .. rubric:: Footnotes Modified: doctools/trunk/doc/markup/desc.rst ============================================================================== --- doctools/trunk/doc/markup/desc.rst (original) +++ doctools/trunk/doc/markup/desc.rst Sun Jan 4 21:38:57 2009 @@ -17,7 +17,7 @@ .. moduleauthor:: John Idle -The directives you can use for module are: +The directives you can use for module declarations are: .. directive:: .. module:: name @@ -67,8 +67,8 @@ .. _desc-units: -Description units ------------------ +Object description units +------------------------ There are a number of directives used to describe specific features provided by modules. Each directive requires one or more signatures to provide basic @@ -204,39 +204,12 @@ Like :dir:`method`, but indicates that the method is a static method. .. versionadded:: 0.4 - -.. directive:: .. cmdoption:: name args, name args, ... - - Describes a command line option or switch. Option argument names should be - enclosed in angle brackets. Example:: - - .. cmdoption:: -m , --module - - Run a module as a script. - - The directive will create a cross-reference target named after the *first* - option, referencable by :role:`option` (in the example case, you'd use - something like ``:option:`-m```). - -.. directive:: .. envvar:: name - Describes an environment variable that the documented code uses or defines. +.. directive:: .. classmethod:: name(signature) + Like :dir:`method`, but indicates that the method is a class method. -There is also a generic version of these directives: - -.. directive:: .. describe:: text - - This directive produces the same formatting as the specific ones explained - above but does not create index entries or cross-referencing targets. It is - used, for example, to describe the directives in this document. Example:: - - .. describe:: opcode - - Describes a Python bytecode instruction. - -Extensions may add more directives like that, using the -:func:`~sphinx.application.Sphinx.add_description_unit` method. + .. versionadded:: 0.6 .. _signatures: @@ -288,7 +261,7 @@ Format the exception with a traceback. - :param object: exception type + :param etype: exception type :param value: exception value :param tb: traceback object :param limit: maximum number of stack frames to show @@ -302,9 +275,83 @@ Format the exception with a traceback. - :param object: exception type + :param etype: exception type :param value: exception value :param tb: traceback object :param limit: maximum number of stack frames to show :type limit: integer or None :rtype: list of strings + + +Command-line program markup +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There is a set of directives allowing documenting command-line programs: + +.. directive:: .. cmdoption:: name args, name args, ... + + Describes a command line option or switch. Option argument names should be + enclosed in angle brackets. Example:: + + .. cmdoption:: -m , --module + + Run a module as a script. + + The directive will create a cross-reference target named after the *first* + option, referencable by :role:`option` (in the example case, you'd use + something like ``:option:`-m```). + +.. directive:: .. envvar:: name + + Describes an environment variable that the documented code or program uses or + defines. + + +.. directive:: .. program:: name + + Like :dir:`currentmodule`, this directive produces no output. Instead, it + serves to notify Sphinx that all following :dir:`cmdoption` directives + document options for the program called *name*. + + If you use :dir:`program`, you have to qualify the references in your + :role:`option` roles by the program name, so if you have the following + situation :: + + .. program:: rm + + .. cmdoption:: -r + + Work recursively. + + .. program:: svn + + .. cmdoption:: -r revision + + Specify the revision to work upon. + + then ``:option:`rm -r``` would refer to the first option, while + ``:option:`svn -r``` would refer to the second one. + + The program name may contain spaces (in case you want to document subcommands + like ``svn add`` and ``svn commit`` separately). + + .. versionadded:: 0.5 + + +Custom description units +~~~~~~~~~~~~~~~~~~~~~~~~ + +There is also a generic version of these directives: + +.. directive:: .. describe:: text + + This directive produces the same formatting as the specific ones explained + above but does not create index entries or cross-referencing targets. It is + used, for example, to describe the directives in this document. Example:: + + .. describe:: opcode + + Describes a Python bytecode instruction. + +Extensions may add more directives like that, using the +:func:`~sphinx.application.Sphinx.add_description_unit` method. Modified: doctools/trunk/doc/markup/inline.rst ============================================================================== --- doctools/trunk/doc/markup/inline.rst (original) +++ doctools/trunk/doc/markup/inline.rst Sun Jan 4 21:38:57 2009 @@ -12,7 +12,8 @@ .. note:: The default role (```content```) has no special meaning by default. You are - free to use it for anything you like. + free to use it for anything you like; use the :confval:`default_role` config + value to set it to a known role. .. _xref-syntax: @@ -223,7 +224,50 @@ Using :role:`ref` is advised over standard reStructuredText links to sections (like ```Section title`_``) because it works across files, when section headings are changed, and for all builders that support cross-references. - + + +Cross-referencing documents +--------------------------- + +.. versionadded:: 0.6 + +There is also a way to directly link to documents: + +.. role:: doc + + Link to the specified document; the document name can be specified in + absolute or relative fashion. For example, if the reference + ``:doc:`parrot``` occurs in the document ``sketches/index``, then the link + refers to ``sketches/parrot``. If the reference is ``:doc:`/people``` or + ``:doc:`../people```, the link refers to ``people``. + + If no explicit link text is given (like usual: ``:doc:`Monty Python members + ```), the link caption will be the title of the given document. + + +Referencing downloadable files +------------------------------ + +.. versionadded:: 0.6 + +.. role:: download + + This role lets you link to files within your source tree that are not reST + documents that can be viewed, but files that can be downloaded. + + When you use this role, the referenced file is automatically marked for + inclusion in the output when building (obviously, for HTML output only). + All downloadable files are put into the ``_downloads`` subdirectory of the + output directory; duplicate filenames are handled. + + An example:: + + See :download:`this example script <../example.py>`. + + The given filename is relative to the directory the current source file is + contained in. The ``../example.py`` file will be copied to the output + directory, and a suitable link generated to it. + Other semantic markup --------------------- @@ -329,7 +373,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. The following roles generate external links: @@ -350,6 +394,7 @@ Note that there are no special roles for including hyperlinks as you can use the standard reST markup for that purpose. + .. _default-substitutions: Substitutions @@ -372,6 +417,6 @@ .. describe:: |today| - Replaced by either today's date, or the date set in the build configuration - file. Normally has the format ``April 14, 2007``. Set by - :confval:`today_fmt` and :confval:`today`. + Replaced by either today's date (the date on which the document is read), or + the date set in the build configuration file. Normally has the format + ``April 14, 2007``. Set by :confval:`today_fmt` and :confval:`today`. Modified: doctools/trunk/doc/markup/para.rst ============================================================================== --- doctools/trunk/doc/markup/para.rst (original) +++ doctools/trunk/doc/markup/para.rst Sun Jan 4 21:38:57 2009 @@ -74,6 +74,13 @@ `GNU tar manual, Basic Tar Format `_ Documentation for tar archive files, including GNU tar extensions. + There's also a "short form" allowed that looks like this:: + + .. seealso:: modules :mod:`zipfile`, :mod:`tarfile` + + .. versionadded:: 0.5 + The short form. + .. directive:: .. rubric:: title This directive creates a paragraph heading that is not used to create a Modified: doctools/trunk/doc/rest.rst ============================================================================== --- doctools/trunk/doc/rest.rst (original) +++ doctools/trunk/doc/rest.rst Sun Jan 4 21:38:57 2009 @@ -217,6 +217,11 @@ subdirectory of the output directory on building (e.g. the ``_static`` directory for HTML output.) +Interpretation of image size options (``width`` and ``height``) is as follows: +if the size has no unit or the unit is pixels, the given size will only be +respected for output channels that support pixels (i.e. not in LaTeX output). +Other units (like ``pt`` for points) will be used for HTML and LaTeX output. + Sphinx extends the standard docutils behavior by allowing an asterisk for the extension:: @@ -291,7 +296,17 @@ -------- Every explicit markup block which isn't a valid markup construct (like the -footnotes above) is regarded as a comment. +footnotes above) is regarded as a comment. For example:: + + .. This is a comment. + +You can indent text after a comment start to form multiline comments:: + + .. + This whole indented block + is a comment. + + Still in the comment. Source encoding @@ -312,4 +327,7 @@ separated from the surrounding text by non-word characters, you have to use a backslash-escaped space to get around that. +* **No nested inline markup:** Something like ``*see :func:`foo`*`` is not + possible. + .. XXX more? Added: doctools/trunk/doc/sphinx-build.1 ============================================================================== --- (empty file) +++ doctools/trunk/doc/sphinx-build.1 Sun Jan 4 21:38:57 2009 @@ -0,0 +1,96 @@ +.TH sphinx-build 1 "Jan 2009" "Sphinx 0.6" "User Commands" +.SH NAME +sphinx-build \- Sphinx documentation generator tool +.SH SYNOPSIS +.B sphinx-build +[\fIoptions\fR] <\fIsourcedir\fR> <\fIoutdir\fR> [\fIfilenames\fR...] +.SH DESCRIPTION +sphinx-build generates documentation from the files in and places it +in the . + +sphinx-build looks for /conf.py for the configuration settings. +.B sphinx-quickstart(1) +may be used to generate template files, including conf.py. + +sphinx-build can create documentation in different formats. A format is +selected by specifying the builder name on the command line; it defaults to +HTML. Builders can also perform other tasks related to documentation +processing. + +By default, everything that is outdated is built. Output only for selected +files can be built by specifying individual filenames. + +List of available builders: +.TP +\fBhtml\fR +HTML files generation. This is default builder. +.TP +\fBhtmlhelp\fR +Generates files for CHM generation. +.TP +\fBqthelp\fR +Generates files for Qt help collection generation. +.TP +\fBlatex\fR +Generates a LaTeX version of the documentation. +.TP +\fBtext\fR +Generates a plain-text version of the documentation. +.TP +\fBchanges\fR +Generates HTML files listing changed/added/deprecated items for the +current version. +.TP +\fBlinkcheck\fR +Checks the integrity of all external links in the documentation. +.TP +\fBpickle / json\fR +Generates serialized HTML files in the selected format. + +.SH OPTIONS +.TP +\fB-b\fR +Builder to use; defaults to html. See the full list of builders above. +.TP +\fB-a\fR +Generates output for all files; without this option only output for +new and changed files is generated. +.TP +\fB-E\fR +Ignores cached files, forces to re-read all source files from disk. +.TP +\fB-c\fR +Locates the conf.py file in the specified path instead of . +.TP +\fB-C\fR +Specifies that no conf.py file at all is to be used. Configuration can +only be set with the -D option. +.TP +\fB-D\fR = +Overrides a setting from the configuration file. +.TP +\fB-d\fR +Path to cached files; defaults to /.doctrees. +.TP +\fB-A\fR = +Passes a value into the HTML templates (only for html builders). +.TP +\fB-N\fR +Prevents colored output. +.TP +\fB-q\fR +Quiet operation, just prints warnings and errors on stderr. +.TP +\fB-Q\fR +Very quiet operation, doesn't print anything except for errors. +.TP +\fB-P\fR +Runs Pdb on exception. +.SH "SEE ALSO" +.BR sphinx-quickstart(1) +.SH AUTHOR +Georg Brandl , Armin Ronacher et +al. +.PP +This manual page was initially written by Mikhail Gusarov +, for the Debian project. Added: doctools/trunk/doc/sphinx-quickstart.1 ============================================================================== --- (empty file) +++ doctools/trunk/doc/sphinx-quickstart.1 Sun Jan 4 21:38:57 2009 @@ -0,0 +1,17 @@ +.TH sphinx-quickstart 1 "Jan 2009" "Sphinx 0.6" "User Commands" +.SH NAME +sphinx-quickstart \- Sphinx documentation template generator +.SH SYNOPSIS +.B sphinx-quickstart +.SH DESCRIPTION +sphinx-quickstart is an interactive tool that asks some questions about your +project and then generates a complete documentation directory and sample +Makefile to be used with \fBsphinx-build(1)\fR. +.SH "SEE ALSO" +.BR sphinx-build(1) +.SH AUTHOR +Georg Brandl , Armin Ronacher et +al. +.PP +This manual page was initially written by Mikhail Gusarov + for the Debian project. Modified: doctools/trunk/doc/templating.rst ============================================================================== --- doctools/trunk/doc/templating.rst (original) +++ doctools/trunk/doc/templating.rst Sun Jan 4 21:38:57 2009 @@ -19,10 +19,10 @@ configuration value accordingly. * You can :ref:`write a custom builder ` that derives from - :class:`~sphinx.builder.StandaloneHTMLBuilder` and calls your template engine + :class:`~sphinx.builders.StandaloneHTMLBuilder` and calls your template engine of choice. -* You can use the :class:`~sphinx.builder.PickleHTMLBuilder` that produces +* You can use the :class:`~sphinx.builders.PickleHTMLBuilder` that produces pickle files with the page contents, and postprocess them using a custom tool, or use them in your Web application. @@ -135,6 +135,10 @@ `sidebarrel` The relation links (previous, next document) within the sidebar. +`sidebarsourcelink` + The "Show source" link within the sidebar (normally only shown if this is + enabled by :confval:`html_show_sourcelink`). + `sidebarsearch` The search box within the sidebar. Override this if you want to place some content at the bottom of the sidebar. Modified: doctools/trunk/ez_setup.py ============================================================================== --- doctools/trunk/ez_setup.py (original) +++ doctools/trunk/ez_setup.py Sun Jan 4 21:38:57 2009 @@ -14,7 +14,7 @@ This file can also be run as a script to install or upgrade setuptools. """ import sys -DEFAULT_VERSION = "0.6c8" +DEFAULT_VERSION = "0.6c9" DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] md5_data = { @@ -48,13 +48,18 @@ 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', + 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03', + 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a', + 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6', + 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a', } import sys, os +try: from hashlib import md5 +except ImportError: from md5 import md5 def _validate_md5(egg_name, data): if egg_name in md5_data: - from md5 import md5 digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( @@ -64,7 +69,6 @@ sys.exit(2) return data - def use_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 @@ -233,7 +237,6 @@ """Update our built-in md5 registry""" import re - from md5 import md5 for name in filenames: base = os.path.basename(name) @@ -270,3 +273,4 @@ + Modified: doctools/trunk/setup.py ============================================================================== --- doctools/trunk/setup.py (original) +++ doctools/trunk/setup.py Sun Jan 4 21:38:57 2009 @@ -4,7 +4,7 @@ import os import sys -from setuptools import setup +from setuptools import setup, find_packages from distutils import log import sphinx @@ -24,7 +24,7 @@ Although it is still under constant development, the following features are already present, work fine and can be seen "in action" in the Python docs: -* Output formats: HTML (including Windows HTML Help) and LaTeX, +* Output formats: HTML (including Windows HTML Help), plain text and LaTeX, for printable PDF versions * Extensive cross-references: semantic markup and automatic links for functions, classes, glossary terms and similar pieces of information @@ -36,7 +36,7 @@ and inclusion of appropriately formatted docstrings. ''' -requires = ['Pygments>=0.8', 'Jinja>=1.1', 'docutils>=0.4'] +requires = ['Pygments>=0.8', 'Jinja2>=2.0', 'docutils>=0.4'] if sys.version_info < (2, 4): print 'ERROR: Sphinx requires at least Python 2.4 to run.' @@ -172,7 +172,7 @@ 'Topic :: Utilities', ], platforms='any', - packages=['sphinx'], + packages=find_packages(), include_package_data=True, entry_points={ 'console_scripts': [ Modified: doctools/trunk/sphinx-build.py ============================================================================== --- doctools/trunk/sphinx-build.py (original) +++ doctools/trunk/sphinx-build.py Sun Jan 4 21:38:57 2009 @@ -4,8 +4,8 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys Modified: doctools/trunk/sphinx-quickstart.py ============================================================================== --- doctools/trunk/sphinx-quickstart.py (original) +++ doctools/trunk/sphinx-quickstart.py Sun Jan 4 21:38:57 2009 @@ -4,8 +4,8 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys Modified: doctools/trunk/sphinx/__init__.py ============================================================================== --- doctools/trunk/sphinx/__init__.py (original) +++ doctools/trunk/sphinx/__init__.py Sun Jan 4 21:38:57 2009 @@ -5,15 +5,18 @@ The Sphinx documentation toolchain. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys +from os import path __revision__ = '$Revision$' -__version__ = '0.5' -__released__ = '0.5' +__version__ = '0.6' +__released__ = '0.6 (hg)' + +package_dir = path.abspath(path.dirname(__file__)) def main(argv=sys.argv): @@ -28,17 +31,23 @@ errstr = str(err) if errstr.lower().startswith('no module named'): whichmod = errstr[16:] + hint = '' if whichmod.startswith('docutils'): whichmod = 'Docutils library' elif whichmod.startswith('jinja'): whichmod = 'Jinja library' elif whichmod == 'roman': whichmod = 'roman module (which is distributed with Docutils)' + hint = ('This can happen if you upgraded docutils using\n' + 'easy_install without uninstalling the old version' + 'first.') else: whichmod += ' module' print >>sys.stderr, \ 'Error: The %s cannot be found. Did you install Sphinx '\ 'and its dependencies correctly?' % whichmod + if hint: + print >> sys.stderr, hint return 1 raise return cmdline.main(argv) Added: doctools/trunk/sphinx/__init__.pyc ============================================================================== Binary file. No diff available. Modified: doctools/trunk/sphinx/_jinja.py ============================================================================== --- doctools/trunk/sphinx/_jinja.py (original) +++ doctools/trunk/sphinx/_jinja.py Sun Jan 4 21:38:57 2009 @@ -5,13 +5,14 @@ Jinja glue. - :copyright: 2007-2008 by Georg Brandl, Horst Gutmann. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import codecs from os import path +from sphinx import package_dir from sphinx.util import mtimes_of_files from sphinx.application import TemplateBridge @@ -88,7 +89,7 @@ class BuiltinTemplates(TemplateBridge): def init(self, builder): self.templates = {} - base_templates_path = path.join(path.dirname(__file__), 'templates') + base_templates_path = path.join(package_dir, 'templates') ext_templates_path = [path.join(builder.confdir, dir) for dir in builder.config.templates_path] self.templates_path = [base_templates_path] + ext_templates_path Modified: doctools/trunk/sphinx/addnodes.py ============================================================================== --- doctools/trunk/sphinx/addnodes.py (original) +++ doctools/trunk/sphinx/addnodes.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Additional docutils nodes. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from docutils import nodes @@ -23,8 +23,12 @@ class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement): pass # compatibility alias desc_classname = desc_addname -# return type (C); object type, e.g. -> annotation (Python) +# return type (C); object type class desc_type(nodes.Part, nodes.Inline, nodes.TextElement): pass +# -> annotation (Python) +class desc_returns(desc_type): + def astext(self): + return ' -> ' + nodes.TextElement.astext(self) # main name of object class desc_name(nodes.Part, nodes.Inline, nodes.TextElement): pass # argument list @@ -64,6 +68,9 @@ # compact paragraph -- never makes a

    class compact_paragraph(nodes.paragraph): pass +# reference to a file to download +class download_reference(nodes.reference): pass + # for the ACKS list class acks(nodes.Element): pass @@ -90,8 +97,9 @@ # make them known to docutils. this is needed, because the HTML writer # will choke at some point if these are not added -nodes._add_node_class_names("""index desc desc_content desc_signature desc_type - desc_addname desc_name desc_parameterlist desc_parameter desc_optional +nodes._add_node_class_names("""index desc desc_content desc_signature + desc_type desc_returns desc_addname desc_name desc_parameterlist + desc_parameter desc_optional download_reference centered versionmodified seealso productionlist production toctree pending_xref compact_paragraph highlightlang literal_emphasis glossary acks module start_of_file tabular_col_spec meta""".split()) Modified: doctools/trunk/sphinx/application.py ============================================================================== --- doctools/trunk/sphinx/application.py (original) +++ doctools/trunk/sphinx/application.py Sun Jan 4 21:38:57 2009 @@ -7,9 +7,8 @@ Gracefully adapted from the TextPress system by Armin. - - :copyright: 2008 by Georg Brandl, Armin Ronacher. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys @@ -22,7 +21,7 @@ import sphinx from sphinx.roles import xfileref_role, innernodetypes from sphinx.config import Config -from sphinx.builder import builtin_builders, StandaloneHTMLBuilder +from sphinx.builders import BUILTIN_BUILDERS from sphinx.directives import desc_directive, target_directive, additional_xref_types from sphinx.environment import SphinxStandaloneReader from sphinx.util.console import bold @@ -77,7 +76,7 @@ confoverrides, status, warning=sys.stderr, freshenv=False): self.next_listener_id = 0 self._listeners = {} - self.builderclasses = builtin_builders.copy() + self.builderclasses = BUILTIN_BUILDERS.copy() self.builder = None self.srcdir = srcdir @@ -125,6 +124,11 @@ buildername))) builderclass = self.builderclasses[buildername] + if isinstance(builderclass, tuple): + # builtin builder + mod, cls = builderclass + builderclass = getattr( + __import__('sphinx.builders.' + mod, None, None, [cls]), cls) self.builder = builderclass(self, freshenv=freshenv) self.emit('builder-inited') @@ -144,13 +148,20 @@ def warn(self, message): self._warncount += 1 - self._warning.write('WARNING: %s\n' % message) + try: + self._warning.write('WARNING: %s\n' % message) + except UnicodeEncodeError: + encoding = getattr(self._warning, 'encoding', 'ascii') + self._warning.write(('WARNING: %s\n' % message).encode(encoding, 'replace')) def info(self, message='', nonl=False): - if nonl: + try: self._status.write(message) - else: - self._status.write(message + '\n') + except UnicodeEncodeError: + encoding = getattr(self._status, 'encoding', 'ascii') + self._status.write(message.encode(encoding, 'replace')) + if not nonl: + self._status.write('\n') self._status.flush() # general extensibility interface @@ -220,8 +231,12 @@ if not hasattr(builder, 'name'): raise ExtensionError('Builder class %s has no "name" attribute' % builder) if builder.name in self.builderclasses: - raise ExtensionError('Builder %r already exists (in module %s)' % ( - builder.name, self.builderclasses[builder.name].__module__)) + if isinstance(self.builderclasses[builder.name], tuple): + raise ExtensionError('Builder %r is a builtin builder' % + builder.name) + else: + raise ExtensionError('Builder %r already exists (in module %s)' % ( + builder.name, self.builderclasses[builder.name].__module__)) self.builderclasses[builder.name] = builder def add_config_value(self, name, default, rebuild_env): @@ -243,11 +258,11 @@ raise ExtensionError('Value for key %r must be a (visit, depart) ' 'function tuple' % key) if key == 'html': - from sphinx.htmlwriter import HTMLTranslator as translator + from sphinx.writers.html import HTMLTranslator as translator elif key == 'latex': - from sphinx.latexwriter import LaTeXTranslator as translator + from sphinx.writers.latex import LaTeXTranslator as translator elif key == 'text': - from sphinx.textwriter import TextTranslator as translator + from sphinx.writers.text import TextTranslator as translator else: # ignore invalid keys for compatibility continue @@ -284,9 +299,16 @@ SphinxStandaloneReader.transforms.append(transform) def add_javascript(self, filename): + from sphinx.builders.html import StandaloneHTMLBuilder StandaloneHTMLBuilder.script_files.append( posixpath.join('_static', filename)) + def add_lexer(self, alias, lexer): + from sphinx.highlighting import lexers + if lexers is None: + return + lexers[alias] = lexer + class TemplateBridge(object): """ Modified: doctools/trunk/sphinx/builder.py ============================================================================== --- doctools/trunk/sphinx/builder.py (original) +++ doctools/trunk/sphinx/builder.py Sun Jan 4 21:38:57 2009 @@ -3,1268 +3,26 @@ sphinx.builder ~~~~~~~~~~~~~~ - Builder classes for different output formats. + .. warning:: - :copyright: 2007-2008 by Georg Brandl, Sebastian Wiesner, Horst Gutmann. - :license: BSD. -""" - -import os -import time -import codecs -import shutil -import gettext -import cPickle as pickle -from os import path -from cgi import escape - -from docutils import nodes -from docutils.io import StringOutput, FileOutput, DocTreeInput -from docutils.core import publish_parts -from docutils.utils import new_document -from docutils.frontend import OptionParser -from docutils.readers.doctree import Reader as DoctreeReader - -from sphinx import addnodes, locale, __version__ -from sphinx.util import ensuredir, relative_uri, SEP, os_path, texescape, ustrftime -from sphinx.htmlhelp import build_hhx -from sphinx.htmlwriter import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator -from sphinx.textwriter import TextWriter -from sphinx.latexwriter import LaTeXWriter -from sphinx.environment import BuildEnvironment, NoUri -from sphinx.highlighting import PygmentsBridge -from sphinx.util.console import bold, purple, darkgreen -from sphinx.search import js_index - -try: - import json -except ImportError: - try: - import simplejson as json - except ImportError: - json = None - -# side effect: registers roles and directives -from sphinx import roles -from sphinx import directives - -ENV_PICKLE_FILENAME = 'environment.pickle' -LAST_BUILD_FILENAME = 'last_build' -INVENTORY_FILENAME = 'objects.inv' - - -class Builder(object): - """ - Builds target formats from the reST sources. - """ - - # builder's name, for the -b command line options - name = '' - - def __init__(self, app, env=None, freshenv=False): - self.srcdir = app.srcdir - self.confdir = app.confdir - self.outdir = app.outdir - self.doctreedir = app.doctreedir - if not path.isdir(self.doctreedir): - os.makedirs(self.doctreedir) - - self.app = app - self.warn = app.warn - self.info = app.info - self.config = app.config - - self.load_i18n() - - # images that need to be copied over (source -> dest) - self.images = {} - - # if None, this is set in load_env() - self.env = env - self.freshenv = freshenv - - self.init() - self.load_env() - - # helper methods - - def init(self): - """Load necessary templates and perform initialization.""" - raise NotImplementedError - - def init_templates(self): - # Call this from init() if you need templates. - if self.config.template_bridge: - self.templates = self.app.import_object( - self.config.template_bridge, 'template_bridge setting')() - else: - from sphinx._jinja import BuiltinTemplates - self.templates = BuiltinTemplates() - self.templates.init(self) - - def get_target_uri(self, docname, typ=None): - """ - Return the target URI for a document name (typ can be used to qualify - the link characteristic for individual builders). - """ - raise NotImplementedError - - def get_relative_uri(self, from_, to, typ=None): - """ - Return a relative URI between two source filenames. May raise environment.NoUri - if there's no way to return a sensible URI. - """ - return relative_uri(self.get_target_uri(from_), - self.get_target_uri(to, typ)) - - def get_outdated_docs(self): - """ - Return an iterable of output files that are outdated, or a string describing - what an update build will build. - """ - raise NotImplementedError - - def status_iterator(self, iterable, summary, colorfunc=darkgreen): - l = -1 - for item in iterable: - if l == -1: - self.info(bold(summary), nonl=1) - l = 0 - self.info(colorfunc(item) + ' ', nonl=1) - yield item - if l == 0: - self.info() - - supported_image_types = [] - - def post_process_images(self, doctree): - """ - Pick the best candidate for all image URIs. - """ - for node in doctree.traverse(nodes.image): - if '?' in node['candidates']: - # don't rewrite nonlocal image URIs - continue - if '*' not in node['candidates']: - for imgtype in self.supported_image_types: - candidate = node['candidates'].get(imgtype, None) - if candidate: - break - else: - self.warn('%s:%s: no matching candidate for image URI %r' % - (node.source, getattr(node, 'lineno', ''), node['uri'])) - continue - node['uri'] = candidate - else: - candidate = node['uri'] - if candidate not in self.env.images: - # non-existing URI; let it alone - continue - self.images[candidate] = self.env.images[candidate][1] - - # build methods - - def load_i18n(self): - """ - Load translated strings from the configured localedirs if - enabled in the configuration. - """ - self.translator = None - if self.config.language is not None: - self.info(bold('loading translations [%s]... ' % self.config.language), - nonl=True) - locale_dirs = [path.join(path.dirname(__file__), 'locale')] + \ - [path.join(self.srcdir, x) for x in self.config.locale_dirs] - for dir_ in locale_dirs: - try: - trans = gettext.translation('sphinx', localedir=dir_, - languages=[self.config.language]) - if self.translator is None: - self.translator = trans - else: - self.translator._catalog.update(trans.catalog) - except Exception: - # Language couldn't be found in the specified path - pass - if self.translator is not None: - self.info('done') - else: - self.info('locale not available') - if self.translator is None: - self.translator = gettext.NullTranslations() - self.translator.install(unicode=True) - locale.init() # translate common labels - - def load_env(self): - """Set up the build environment.""" - if self.env: - return - if not self.freshenv: - try: - self.info(bold('loading pickled environment... '), nonl=True) - self.env = BuildEnvironment.frompickle(self.config, - path.join(self.doctreedir, ENV_PICKLE_FILENAME)) - self.info('done') - except Exception, err: - if type(err) is IOError and err.errno == 2: - self.info('not found') - else: - self.info('failed: %s' % err) - self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) - self.env.find_files(self.config) - else: - self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) - self.env.find_files(self.config) - self.env.set_warnfunc(self.warn) - - def build_all(self): - """Build all source files.""" - self.build(None, summary='all source files', method='all') - - def build_specific(self, filenames): - """Only rebuild as much as needed for changes in the source_filenames.""" - # bring the filenames to the canonical format, that is, - # relative to the source directory and without source_suffix. - dirlen = len(self.srcdir) + 1 - to_write = [] - suffix = self.config.source_suffix - for filename in filenames: - filename = path.abspath(filename)[dirlen:] - if filename.endswith(suffix): - filename = filename[:-len(suffix)] - filename = filename.replace(os.path.sep, SEP) - to_write.append(filename) - self.build(to_write, method='specific', - summary='%d source files given on command ' - 'line' % len(to_write)) - - def build_update(self): - """Only rebuild files changed or added since last build.""" - to_build = self.get_outdated_docs() - if isinstance(to_build, str): - self.build(['__all__'], to_build) - else: - to_build = list(to_build) - self.build(to_build, - summary='targets for %d source files that are ' - 'out of date' % len(to_build)) - - def build(self, docnames, summary=None, method='update'): - if summary: - self.info(bold('building [%s]: ' % self.name), nonl=1) - self.info(summary) - - updated_docnames = [] - # while reading, collect all warnings from docutils - warnings = [] - self.env.set_warnfunc(warnings.append) - self.info(bold('updating environment: '), nonl=1) - iterator = self.env.update(self.config, self.srcdir, self.doctreedir, self.app) - # the first item in the iterator is a summary message - self.info(iterator.next()) - for docname in self.status_iterator(iterator, 'reading sources... ', purple): - updated_docnames.append(docname) - # nothing further to do, the environment has already done the reading - for warning in warnings: - if warning.strip(): - self.warn(warning) - self.env.set_warnfunc(self.warn) - - if updated_docnames: - # save the environment - self.info(bold('pickling environment... '), nonl=True) - self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME)) - self.info('done') - - # global actions - self.info(bold('checking consistency... '), nonl=True) - self.env.check_consistency() - self.info('done') - else: - if method == 'update' and not docnames: - self.info(bold('no targets are out of date.')) - return - - # another indirection to support methods which don't build files - # individually - self.write(docnames, updated_docnames, method) - - # finish (write static files etc.) - self.finish() - if self.app._warncount: - self.info(bold('build succeeded, %s warning%s.' % - (self.app._warncount, - self.app._warncount != 1 and 's' or ''))) - else: - self.info(bold('build succeeded.')) - - def write(self, build_docnames, updated_docnames, method='update'): - if build_docnames is None or build_docnames == ['__all__']: - # build_all - build_docnames = self.env.found_docs - if method == 'update': - # build updated ones as well - docnames = set(build_docnames) | set(updated_docnames) - else: - docnames = set(build_docnames) - - # add all toctree-containing files that may have changed - for docname in list(docnames): - for tocdocname in self.env.files_to_rebuild.get(docname, []): - docnames.add(tocdocname) - docnames.add(self.config.master_doc) - - self.info(bold('preparing documents... '), nonl=True) - self.prepare_writing(docnames) - self.info('done') - - # write target files - warnings = [] - self.env.set_warnfunc(warnings.append) - for docname in self.status_iterator(sorted(docnames), - 'writing output... ', darkgreen): - doctree = self.env.get_and_resolve_doctree(docname, self) - self.write_doc(docname, doctree) - for warning in warnings: - if warning.strip(): - self.warn(warning) - self.env.set_warnfunc(self.warn) - - def prepare_writing(self, docnames): - raise NotImplementedError - - def write_doc(self, docname, doctree): - raise NotImplementedError - - def finish(self): - raise NotImplementedError - - -class StandaloneHTMLBuilder(Builder): - """ - Builds standalone HTML docs. - """ - name = 'html' - copysource = True - out_suffix = '.html' - indexer_format = js_index - supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', - 'image/jpeg'] - searchindex_filename = 'searchindex.js' - add_header_links = True - add_definition_links = True - - # This is a class attribute because it is mutated by Sphinx.add_javascript. - script_files = ['_static/jquery.js', '_static/doctools.js'] - - def init(self): - """Load templates.""" - self.init_templates() - self.init_translator_class() - if self.config.html_file_suffix: - self.out_suffix = self.config.html_file_suffix - - if self.config.language is not None: - jsfile = path.join(path.dirname(__file__), 'locale', self.config.language, - 'LC_MESSAGES', 'sphinx.js') - if path.isfile(jsfile): - self.script_files.append('_static/translations.js') - - def init_translator_class(self): - if self.config.html_translator_class: - self.translator_class = self.app.import_object( - self.config.html_translator_class, 'html_translator_class setting') - elif self.config.html_use_smartypants: - self.translator_class = SmartyPantsHTMLTranslator - else: - self.translator_class = HTMLTranslator - - def render_partial(self, node): - """Utility: Render a lone doctree node.""" - doc = new_document('') - doc.append(node) - return publish_parts( - doc, - source_class=DocTreeInput, - reader=DoctreeReader(), - writer=HTMLWriter(self), - settings_overrides={'output_encoding': 'unicode'} - ) - - def prepare_writing(self, docnames): - from sphinx.search import IndexBuilder - - self.indexer = IndexBuilder(self.env) - self.load_indexer(docnames) - self.docwriter = HTMLWriter(self) - self.docsettings = OptionParser( - defaults=self.env.settings, - components=(self.docwriter,)).get_default_values() - - # format the "last updated on" string, only once is enough since it - # typically doesn't include the time of day - lufmt = self.config.html_last_updated_fmt - if lufmt is not None: - self.last_updated = ustrftime(lufmt or _('%b %d, %Y')) - else: - self.last_updated = None - - logo = self.config.html_logo and \ - path.basename(self.config.html_logo) or '' - - favicon = self.config.html_favicon and \ - path.basename(self.config.html_favicon) or '' - if favicon and os.path.splitext(favicon)[1] != '.ico': - self.warn('html_favicon is not an .ico file') - - if not isinstance(self.config.html_use_opensearch, basestring): - self.warn('html_use_opensearch config value must now be a string') - - self.relations = self.env.collect_relations() - - rellinks = [] - if self.config.html_use_index: - rellinks.append(('genindex', _('General Index'), 'I', _('index'))) - if self.config.html_use_modindex and self.env.modules: - rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules'))) - - self.globalcontext = dict( - project = self.config.project, - release = self.config.release, - version = self.config.version, - last_updated = self.last_updated, - copyright = self.config.copyright, - master_doc = self.config.master_doc, - style = self.config.html_style, - use_opensearch = self.config.html_use_opensearch, - docstitle = self.config.html_title, - shorttitle = self.config.html_short_title, - show_sphinx = self.config.html_show_sphinx, - file_suffix = self.out_suffix, - script_files = self.script_files, - sphinx_version = __version__, - rellinks = rellinks, - builder = self.name, - parents = [], - logo = logo, - favicon = favicon, - ) - self.globalcontext.update(self.config.html_context) - - def get_doc_context(self, docname, body, metatags): - """Collect items for the template context of a page.""" - # find out relations - prev = next = None - parents = [] - rellinks = self.globalcontext['rellinks'][:] - related = self.relations.get(docname) - titles = self.env.titles - if related and related[2]: - try: - next = {'link': self.get_relative_uri(docname, related[2]), - 'title': self.render_partial(titles[related[2]])['title']} - rellinks.append((related[2], next['title'], 'N', _('next'))) - except KeyError: - next = None - if related and related[1]: - try: - prev = {'link': self.get_relative_uri(docname, related[1]), - 'title': self.render_partial(titles[related[1]])['title']} - rellinks.append((related[1], prev['title'], 'P', _('previous'))) - except KeyError: - # the relation is (somehow) not in the TOC tree, handle that gracefully - prev = None - while related and related[0]: - try: - parents.append( - {'link': self.get_relative_uri(docname, related[0]), - 'title': self.render_partial(titles[related[0]])['title']}) - except KeyError: - pass - related = self.relations.get(related[0]) - if parents: - parents.pop() # remove link to the master file; we have a generic - # "back to index" link already - parents.reverse() - - # title rendered as HTML - title = titles.get(docname) - title = title and self.render_partial(title)['title'] or '' - # the name for the copied source - sourcename = self.config.html_copy_source and docname + '.txt' or '' - - # metadata for the document - meta = self.env.metadata.get(docname) - - return dict( - parents = parents, - prev = prev, - next = next, - title = title, - meta = meta, - body = body, - metatags = metatags, - rellinks = rellinks, - sourcename = sourcename, - toc = self.render_partial(self.env.get_toc_for(docname))['fragment'], - # only display a TOC if there's more than one item to show - display_toc = (self.env.toc_num_entries[docname] > 1), - ) - - def write_doc(self, docname, doctree): - self.post_process_images(doctree) - destination = StringOutput(encoding='utf-8') - doctree.settings = self.docsettings - - self.imgpath = relative_uri(self.get_target_uri(docname), '_images') - self.docwriter.write(doctree, destination) - self.docwriter.assemble_parts() - body = self.docwriter.parts['fragment'] - metatags = self.docwriter.clean_meta - - ctx = self.get_doc_context(docname, body, metatags) - self.index_page(docname, doctree, ctx.get('title', '')) - self.handle_page(docname, ctx, event_arg=doctree) - - def finish(self): - self.info(bold('writing additional files...'), nonl=1) - - # the global general index - - if self.config.html_use_index: - # the total count of lines for each index letter, used to distribute - # the entries into two columns - genindex = self.env.create_index(self) - indexcounts = [] - for _, entries in genindex: - indexcounts.append(sum(1 + len(subitems) - for _, (_, subitems) in entries)) - - genindexcontext = dict( - genindexentries = genindex, - genindexcounts = indexcounts, - split_index = self.config.html_split_index, - ) - self.info(' genindex', nonl=1) - - if self.config.html_split_index: - self.handle_page('genindex', genindexcontext, 'genindex-split.html') - self.handle_page('genindex-all', genindexcontext, 'genindex.html') - for (key, entries), count in zip(genindex, indexcounts): - ctx = {'key': key, 'entries': entries, 'count': count, - 'genindexentries': genindex} - self.handle_page('genindex-' + key, ctx, 'genindex-single.html') - else: - self.handle_page('genindex', genindexcontext, 'genindex.html') - - # the global module index - - if self.config.html_use_modindex and self.env.modules: - # the sorted list of all modules, for the global module index - modules = sorted(((mn, (self.get_relative_uri('modindex', fn) + - '#module-' + mn, sy, pl, dep)) - for (mn, (fn, sy, pl, dep)) in - self.env.modules.iteritems()), - key=lambda x: x[0].lower()) - # collect all platforms - platforms = set() - # sort out collapsable modules - modindexentries = [] - letters = [] - pmn = '' - num_toplevels = 0 - num_collapsables = 0 - cg = 0 # collapse group - fl = '' # first letter - for mn, (fn, sy, pl, dep) in modules: - pl = pl and pl.split(', ') or [] - platforms.update(pl) - if fl != mn[0].lower() and mn[0] != '_': - # heading - modindexentries.append(['', False, 0, False, - mn[0].upper(), '', [], False]) - letters.append(mn[0].upper()) - tn = mn.split('.')[0] - if tn != mn: - # submodule - if pmn == tn: - # first submodule - make parent collapsable - modindexentries[-1][1] = True - num_collapsables += 1 - elif not pmn.startswith(tn): - # submodule without parent in list, add dummy entry - cg += 1 - modindexentries.append([tn, True, cg, False, '', '', [], False]) - else: - num_toplevels += 1 - cg += 1 - modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl, dep]) - pmn = mn - fl = mn[0].lower() - platforms = sorted(platforms) - - # apply heuristics when to collapse modindex at page load: - # only collapse if number of toplevel modules is larger than - # number of submodules - collapse = len(modules) - num_toplevels < num_toplevels - - modindexcontext = dict( - modindexentries = modindexentries, - platforms = platforms, - letters = letters, - collapse_modindex = collapse, - ) - self.info(' modindex', nonl=1) - self.handle_page('modindex', modindexcontext, 'modindex.html') - - # the search page - if self.name != 'htmlhelp': - self.info(' search', nonl=1) - self.handle_page('search', {}, 'search.html') - - # additional pages from conf.py - for pagename, template in self.config.html_additional_pages.items(): - self.info(' '+pagename, nonl=1) - self.handle_page(pagename, {}, template) - - if self.config.html_use_opensearch and self.name != 'htmlhelp': - self.info(' opensearch', nonl=1) - fn = path.join(self.outdir, '_static', 'opensearch.xml') - self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn) - - self.info() - - # copy image files - if self.images: - self.info(bold('copying images...'), nonl=True) - ensuredir(path.join(self.outdir, '_images')) - for src, dest in self.images.iteritems(): - self.info(' '+src, nonl=1) - shutil.copyfile(path.join(self.srcdir, src), - path.join(self.outdir, '_images', dest)) - self.info() - - # copy static files - self.info(bold('copying static files... '), nonl=True) - ensuredir(path.join(self.outdir, '_static')) - # first, create pygments style file - f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w') - f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet()) - f.close() - # then, copy translations JavaScript file - if self.config.language is not None: - jsfile = path.join(path.dirname(__file__), 'locale', self.config.language, - 'LC_MESSAGES', 'sphinx.js') - if path.isfile(jsfile): - shutil.copyfile(jsfile, path.join(self.outdir, '_static', - 'translations.js')) - # then, copy over all user-supplied static files - staticdirnames = [path.join(path.dirname(__file__), 'static')] + \ - [path.join(self.confdir, spath) - for spath in self.config.html_static_path] - for staticdirname in staticdirnames: - for filename in os.listdir(staticdirname): - if filename.startswith('.'): - continue - fullname = path.join(staticdirname, filename) - targetname = path.join(self.outdir, '_static', filename) - if path.isfile(fullname): - shutil.copyfile(fullname, targetname) - elif path.isdir(fullname): - if filename in self.config.exclude_dirnames: - continue - if path.exists(targetname): - shutil.rmtree(targetname) - shutil.copytree(fullname, targetname) - # last, copy logo file (handled differently) - if self.config.html_logo: - logobase = path.basename(self.config.html_logo) - shutil.copyfile(path.join(self.confdir, self.config.html_logo), - path.join(self.outdir, '_static', logobase)) - self.info('done') - - # dump the search index - self.handle_finish() - - def get_outdated_docs(self): - if self.templates: - template_mtime = self.templates.newest_template_mtime() - else: - template_mtime = 0 - for docname in self.env.found_docs: - if docname not in self.env.all_docs: - yield docname - continue - targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) - try: - targetmtime = path.getmtime(targetname) - except Exception: - targetmtime = 0 - try: - srcmtime = max(path.getmtime(self.env.doc2path(docname)), - template_mtime) - if srcmtime > targetmtime: - yield docname - except EnvironmentError: - # source doesn't exist anymore - pass - - def load_indexer(self, docnames): - keep = set(self.env.all_docs) - set(docnames) - try: - f = open(path.join(self.outdir, self.searchindex_filename), 'rb') - try: - self.indexer.load(f, self.indexer_format) - finally: - f.close() - except (IOError, OSError, ValueError): - if keep: - self.warn("search index couldn't be loaded, but not all documents " - "will be built: the index will be incomplete.") - # delete all entries for files that will be rebuilt - self.indexer.prune(keep) - - def index_page(self, pagename, doctree, title): - # only index pages with title - if self.indexer is not None and title: - self.indexer.feed(pagename, title, doctree) - - # --------- these are overwritten by the serialization builder - - def get_target_uri(self, docname, typ=None): - return docname + self.out_suffix - - def handle_page(self, pagename, addctx, templatename='page.html', - outfilename=None, event_arg=None): - ctx = self.globalcontext.copy() - # current_page_name is backwards compatibility - ctx['pagename'] = ctx['current_page_name'] = pagename - - def pathto(otheruri, resource=False, - baseuri=self.get_target_uri(pagename)): - if not resource: - otheruri = self.get_target_uri(otheruri) - return relative_uri(baseuri, otheruri) - ctx['pathto'] = pathto - ctx['hasdoc'] = lambda name: name in self.env.all_docs - ctx['customsidebar'] = self.config.html_sidebars.get(pagename) - ctx.update(addctx) - - self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) - - output = self.templates.render(templatename, ctx) - if not outfilename: - outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) - ensuredir(path.dirname(outfilename)) # normally different from self.outdir - try: - f = codecs.open(outfilename, 'w', 'utf-8') - try: - f.write(output) - finally: - f.close() - except (IOError, OSError), err: - self.warn("Error writing file %s: %s" % (outfilename, err)) - if self.copysource and ctx.get('sourcename'): - # copy the source file for the "show source" link - source_name = path.join(self.outdir, '_sources', os_path(ctx['sourcename'])) - ensuredir(path.dirname(source_name)) - shutil.copyfile(self.env.doc2path(pagename), source_name) - - def handle_finish(self): - self.info(bold('dumping search index... '), nonl=True) - self.indexer.prune(self.env.all_docs) - f = open(path.join(self.outdir, self.searchindex_filename), 'wb') - try: - self.indexer.dump(f, self.indexer_format) - finally: - f.close() - self.info('done') - - self.info(bold('dumping object inventory... '), nonl=True) - f = open(path.join(self.outdir, INVENTORY_FILENAME), 'w') - try: - f.write('# Sphinx inventory version 1\n') - f.write('# Project: %s\n' % self.config.project.encode('utf-8')) - f.write('# Version: %s\n' % self.config.version) - for modname, info in self.env.modules.iteritems(): - f.write('%s mod %s\n' % (modname, self.get_target_uri(info[0]))) - for refname, (docname, desctype) in self.env.descrefs.iteritems(): - f.write('%s %s %s\n' % (refname, desctype, self.get_target_uri(docname))) - finally: - f.close() - self.info('done') - - -class SerializingHTMLBuilder(StandaloneHTMLBuilder): - """ - An abstract builder that serializes the HTML generated. - """ - #: the serializing implementation to use. Set this to a module that - #: implements a `dump`, `load`, `dumps` and `loads` functions - #: (pickle, simplejson etc.) - implementation = None - - #: the filename for the global context file - globalcontext_filename = None - - supported_image_types = ('image/svg+xml', 'image/png', 'image/gif', - 'image/jpeg') - - def init(self): - self.init_translator_class() - self.templates = None # no template bridge necessary - - def get_target_uri(self, docname, typ=None): - if docname == 'index': - return '' - if docname.endswith(SEP + 'index'): - return docname[:-5] # up to sep - return docname + SEP - - def handle_page(self, pagename, ctx, templatename='page.html', - outfilename=None, event_arg=None): - ctx['current_page_name'] = pagename - sidebarfile = self.config.html_sidebars.get(pagename) - if sidebarfile: - ctx['customsidebar'] = sidebarfile - - if not outfilename: - outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) - - self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) - - ensuredir(path.dirname(outfilename)) - f = open(outfilename, 'wb') - try: - self.implementation.dump(ctx, f, 2) - finally: - f.close() - - # if there is a source file, copy the source file for the - # "show source" link - if ctx.get('sourcename'): - source_name = path.join(self.outdir, '_sources', - os_path(ctx['sourcename'])) - ensuredir(path.dirname(source_name)) - shutil.copyfile(self.env.doc2path(pagename), source_name) - - def handle_finish(self): - # dump the global context - outfilename = path.join(self.outdir, self.globalcontext_filename) - f = open(outfilename, 'wb') - try: - self.implementation.dump(self.globalcontext, f, 2) - finally: - f.close() - - # super here to dump the search index - StandaloneHTMLBuilder.handle_finish(self) - - # copy the environment file from the doctree dir to the output dir - # as needed by the web app - shutil.copyfile(path.join(self.doctreedir, ENV_PICKLE_FILENAME), - path.join(self.outdir, ENV_PICKLE_FILENAME)) - - # touch 'last build' file, used by the web application to determine - # when to reload its environment and clear the cache - open(path.join(self.outdir, LAST_BUILD_FILENAME), 'w').close() - - -class PickleHTMLBuilder(SerializingHTMLBuilder): - """ - A Builder that dumps the generated HTML into pickle files. - """ - implementation = pickle - indexer_format = pickle - name = 'pickle' - out_suffix = '.fpickle' - globalcontext_filename = 'globalcontext.pickle' - searchindex_filename = 'searchindex.pickle' - - -class JSONHTMLBuilder(SerializingHTMLBuilder): - """ - A builder that dumps the generated HTML into JSON files. - """ - implementation = json - indexer_format = json - name = 'json' - out_suffix = '.fjson' - globalcontext_filename = 'globalcontext.json' - searchindex_filename = 'searchindex.json' - - def init(self): - if json is None: - from sphinx.application import SphinxError - raise SphinxError('The module simplejson (or json in Python >= 2.6) ' - 'is not available. The JSONHTMLBuilder builder ' - 'will not work.') - SerializingHTMLBuilder.init(self) - - -class HTMLHelpBuilder(StandaloneHTMLBuilder): - """ - Builder that also outputs Windows HTML help project, contents and index files. - Adapted from the original Doc/tools/prechm.py. - """ - name = 'htmlhelp' - - # don't copy the reST source - copysource = False - supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] - - # don't add links - add_header_links = False - add_definition_links = False - - def init(self): - StandaloneHTMLBuilder.init(self) - # the output files for HTML help must be .html only - self.out_suffix = '.html' - - def handle_finish(self): - build_hhx(self, self.outdir, self.config.htmlhelp_basename) - - -class LaTeXBuilder(Builder): - """ - Builds LaTeX output to create PDF. - """ - name = 'latex' - supported_image_types = ['application/pdf', 'image/png', 'image/gif', - 'image/jpeg'] - - def init(self): - self.docnames = [] - self.document_data = [] - texescape.init() - - def get_outdated_docs(self): - return 'all documents' # for now - - def get_target_uri(self, docname, typ=None): - if typ == 'token': - # token references are always inside production lists and must be - # replaced by \token{} in LaTeX - return '@token' - if docname not in self.docnames: - raise NoUri - else: - return '' - - def init_document_data(self): - preliminary_document_data = map(list, self.config.latex_documents) - if not preliminary_document_data: - self.warn('No "latex_documents" config value found; no documents ' - 'will be written.') - return - # assign subdirs to titles - self.titles = [] - for entry in preliminary_document_data: - docname = entry[0] - if docname not in self.env.all_docs: - self.warn('"latex_documents" config value references unknown ' - 'document %s' % docname) - continue - self.document_data.append(entry) - if docname.endswith(SEP+'index'): - docname = docname[:-5] - self.titles.append((docname, entry[2])) - - def write(self, *ignored): - # first, assemble the "appendix" docs that are in every PDF - appendices = [] - for fname in self.config.latex_appendices: - appendices.append(self.env.get_doctree(fname)) - - docwriter = LaTeXWriter(self) - docsettings = OptionParser( - defaults=self.env.settings, - components=(docwriter,)).get_default_values() - - self.init_document_data() - - for entry in self.document_data: - docname, targetname, title, author, docclass = entry[:5] - toctree_only = False - if len(entry) > 5: - toctree_only = entry[5] - destination = FileOutput( - destination_path=path.join(self.outdir, targetname), - encoding='utf-8') - self.info("processing " + targetname + "... ", nonl=1) - doctree = self.assemble_doctree(docname, toctree_only, - appendices=(docclass == 'manual') and appendices or []) - self.post_process_images(doctree) - self.info("writing... ", nonl=1) - doctree.settings = docsettings - doctree.settings.author = author - doctree.settings.title = title - doctree.settings.docname = docname - doctree.settings.docclass = docclass - docwriter.write(doctree, destination) - self.info("done") - - def assemble_doctree(self, indexfile, toctree_only, appendices): - self.docnames = set([indexfile] + appendices) - self.info(darkgreen(indexfile) + " ", nonl=1) - def process_tree(docname, tree): - tree = tree.deepcopy() - for toctreenode in tree.traverse(addnodes.toctree): - newnodes = [] - includefiles = map(str, toctreenode['includefiles']) - for includefile in includefiles: - try: - self.info(darkgreen(includefile) + " ", nonl=1) - subtree = process_tree(includefile, - self.env.get_doctree(includefile)) - self.docnames.add(includefile) - except Exception: - self.warn('%s: toctree contains ref to nonexisting file %r' % - (docname, includefile)) - else: - sof = addnodes.start_of_file() - sof.children = subtree.children - newnodes.append(sof) - toctreenode.parent.replace(toctreenode, newnodes) - return tree - tree = self.env.get_doctree(indexfile) - if toctree_only: - # extract toctree nodes from the tree and put them in a fresh document - new_tree = new_document('') - new_sect = nodes.section() - new_sect += nodes.title(u'', u'') - new_tree += new_sect - for node in tree.traverse(addnodes.toctree): - new_sect += node - tree = new_tree - largetree = process_tree(indexfile, tree) - largetree.extend(appendices) - self.info() - self.info("resolving references...") - self.env.resolve_references(largetree, indexfile, self) - # resolve :ref:s to distant tex files -- we can't add a cross-reference, - # but append the document name - for pendingnode in largetree.traverse(addnodes.pending_xref): - docname = pendingnode['refdocname'] - sectname = pendingnode['refsectname'] - newnodes = [nodes.emphasis(sectname, sectname)] - for subdir, title in self.titles: - if docname.startswith(subdir): - newnodes.append(nodes.Text(_(' (in '), _(' (in '))) - newnodes.append(nodes.emphasis(title, title)) - newnodes.append(nodes.Text(')', ')')) - break - else: - pass - pendingnode.replace_self(newnodes) - return largetree - - def finish(self): - # copy image files - if self.images: - self.info(bold('copying images...'), nonl=1) - for src, dest in self.images.iteritems(): - self.info(' '+src, nonl=1) - shutil.copyfile(path.join(self.srcdir, src), - path.join(self.outdir, dest)) - self.info() - - # the logo is handled differently - if self.config.latex_logo: - logobase = path.basename(self.config.latex_logo) - shutil.copyfile(path.join(self.confdir, self.config.latex_logo), - path.join(self.outdir, logobase)) - - self.info(bold('copying TeX support files... '), nonl=True) - staticdirname = path.join(path.dirname(__file__), 'texinputs') - for filename in os.listdir(staticdirname): - if not filename.startswith('.'): - shutil.copyfile(path.join(staticdirname, filename), - path.join(self.outdir, filename)) - self.info('done') - - -class ChangesBuilder(Builder): - """ - Write a summary with all versionadded/changed directives. - """ - name = 'changes' - - def init(self): - self.init_templates() - - def get_outdated_docs(self): - return self.outdir - - typemap = { - 'versionadded': 'added', - 'versionchanged': 'changed', - 'deprecated': 'deprecated', - } - - def write(self, *ignored): - version = self.config.version - libchanges = {} - apichanges = [] - otherchanges = {} - if version not in self.env.versionchanges: - self.info(bold('no changes in this version.')) - return - self.info(bold('writing summary file...')) - for type, docname, lineno, module, descname, content in \ - self.env.versionchanges[version]: - ttext = self.typemap[type] - context = content.replace('\n', ' ') - if descname and docname.startswith('c-api'): - if not descname: - continue - if context: - entry = '%s: %s: %s' % (descname, ttext, context) - else: - entry = '%s: %s.' % (descname, ttext) - apichanges.append((entry, docname, lineno)) - elif descname or module: - if not module: - module = _('Builtins') - if not descname: - descname = _('Module level') - if context: - entry = '%s: %s: %s' % (descname, ttext, context) - else: - entry = '%s: %s.' % (descname, ttext) - libchanges.setdefault(module, []).append((entry, docname, lineno)) - else: - if not context: - continue - entry = '%s: %s' % (ttext.capitalize(), context) - title = self.env.titles[docname].astext() - otherchanges.setdefault((docname, title), []).append( - (entry, docname, lineno)) - - ctx = { - 'project': self.config.project, - 'version': version, - 'docstitle': self.config.html_title, - 'shorttitle': self.config.html_short_title, - 'libchanges': sorted(libchanges.iteritems()), - 'apichanges': sorted(apichanges), - 'otherchanges': sorted(otherchanges.iteritems()), - 'show_sphinx': self.config.html_show_sphinx, - } - f = open(path.join(self.outdir, 'index.html'), 'w') - try: - f.write(self.templates.render('changes/frameset.html', ctx)) - finally: - f.close() - f = open(path.join(self.outdir, 'changes.html'), 'w') - try: - f.write(self.templates.render('changes/versionchanges.html', ctx)) - finally: - f.close() - - hltext = ['.. versionadded:: %s' % version, - '.. versionchanged:: %s' % version, - '.. deprecated:: %s' % version] - - def hl(no, line): - line = ' ' % no + escape(line) - for x in hltext: - if x in line: - line = '%s' % line - break - return line - - self.info(bold('copying source files...')) - for docname in self.env.all_docs: - f = open(self.env.doc2path(docname)) - lines = f.readlines() - targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html' - ensuredir(path.dirname(targetfn)) - f = codecs.open(targetfn, 'w', 'utf8') - try: - text = ''.join(hl(i+1, line) for (i, line) in enumerate(lines)) - ctx = {'filename': self.env.doc2path(docname, None), 'text': text} - f.write(self.templates.render('changes/rstsource.html', ctx)) - finally: - f.close() - shutil.copyfile(path.join(path.dirname(__file__), 'static', 'default.css'), - path.join(self.outdir, 'default.css')) - - def hl(self, text, version): - text = escape(text) - for directive in ['versionchanged', 'versionadded', 'deprecated']: - text = text.replace('.. %s:: %s' % (directive, version), - '.. %s:: %s' % (directive, version)) - return text - - def finish(self): - pass - - -class TextBuilder(Builder): - name = 'text' - out_suffix = '.txt' - - def init(self): - pass - - def get_outdated_docs(self): - for docname in self.env.found_docs: - if docname not in self.env.all_docs: - yield docname - continue - targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) - try: - targetmtime = path.getmtime(targetname) - except Exception: - targetmtime = 0 - try: - srcmtime = path.getmtime(self.env.doc2path(docname)) - if srcmtime > targetmtime: - yield docname - except EnvironmentError: - # source doesn't exist anymore - pass - - def get_target_uri(self, docname, typ=None): - return '' - - def prepare_writing(self, docnames): - self.writer = TextWriter(self) - - def write_doc(self, docname, doctree): - destination = StringOutput(encoding='utf-8') - self.writer.write(doctree, destination) - outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix) - ensuredir(path.dirname(outfilename)) # normally different from self.outdir - try: - f = codecs.open(outfilename, 'w', 'utf-8') - try: - f.write(self.writer.output) - finally: - f.close() - except (IOError, OSError), err: - self.warn("Error writing file %s: %s" % (outfilename, err)) - - def finish(self): - pass - - -# compatibility alias -WebHTMLBuilder = PickleHTMLBuilder + This module is only kept for API compatibility; new code should + import these classes directly from the sphinx.builders package. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" -from sphinx.linkcheck import CheckExternalLinksBuilder +import warnings -builtin_builders = { - 'html': StandaloneHTMLBuilder, - 'pickle': PickleHTMLBuilder, - 'json': JSONHTMLBuilder, - 'web': PickleHTMLBuilder, - 'htmlhelp': HTMLHelpBuilder, - 'latex': LaTeXBuilder, - 'text': TextBuilder, - 'changes': ChangesBuilder, - 'linkcheck': CheckExternalLinksBuilder, -} +from sphinx.builders import Builder +from sphinx.builders.text import TextBuilder +from sphinx.builders.html import StandaloneHTMLBuilder, WebHTMLBuilder, \ + PickleHTMLBuilder, JSONHTMLBuilder +from sphinx.builders.latex import LaTeXBuilder +from sphinx.builders.changes import ChangesBuilder +from sphinx.builders.htmlhelp import HTMLHelpBuilder +from sphinx.builders.linkcheck import CheckExternalLinksBuilder + +warnings.warn('The sphinx.builder module is deprecated; please import ' + 'builders from the respective sphinx.builders submodules.', + DeprecationWarning, stacklevel=2) Added: doctools/trunk/sphinx/builders/__init__.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/__init__.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,346 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders + ~~~~~~~~~~~~~~~ + + Builder superclass for all builders. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import gettext +from os import path + +from docutils import nodes + +from sphinx import package_dir, locale +from sphinx.util import SEP, relative_uri +from sphinx.environment import BuildEnvironment +from sphinx.util.console import bold, purple, darkgreen + +# side effect: registers roles and directives +from sphinx import roles +from sphinx import directives + + +ENV_PICKLE_FILENAME = 'environment.pickle' + + +class Builder(object): + """ + Builds target formats from the reST sources. + """ + + # builder's name, for the -b command line options + name = '' + + def __init__(self, app, env=None, freshenv=False): + self.srcdir = app.srcdir + self.confdir = app.confdir + self.outdir = app.outdir + self.doctreedir = app.doctreedir + if not path.isdir(self.doctreedir): + os.makedirs(self.doctreedir) + + self.app = app + self.warn = app.warn + self.info = app.info + self.config = app.config + + self.load_i18n() + + # images that need to be copied over (source -> dest) + self.images = {} + + # if None, this is set in load_env() + self.env = env + self.freshenv = freshenv + + self.init() + self.load_env() + + # helper methods + + def init(self): + """ + Load necessary templates and perform initialization. The default + implementation does nothing. + """ + pass + + def init_templates(self): + """ + Initialize the template system. + + Call this method from init() if you need templates in your builder. + """ + if self.config.template_bridge: + self.templates = self.app.import_object( + self.config.template_bridge, 'template_bridge setting')() + else: + from sphinx.jinja2glue import BuiltinTemplates + self.templates = BuiltinTemplates() + self.templates.init(self) + + def get_target_uri(self, docname, typ=None): + """ + Return the target URI for a document name (*typ* can be used to qualify + the link characteristic for individual builders). + """ + raise NotImplementedError + + def get_relative_uri(self, from_, to, typ=None): + """ + Return a relative URI between two source filenames. May raise environment.NoUri + if there's no way to return a sensible URI. + """ + return relative_uri(self.get_target_uri(from_), + self.get_target_uri(to, typ)) + + def get_outdated_docs(self): + """ + Return an iterable of output files that are outdated, or a string describing + what an update build will build. + + If the builder does not output individual files corresponding to source files, + return a string here. If it does, return an iterable of those files that need + to be written. + """ + raise NotImplementedError + + def status_iterator(self, iterable, summary, colorfunc=darkgreen): + l = -1 + for item in iterable: + if l == -1: + self.info(bold(summary), nonl=1) + l = 0 + self.info(colorfunc(item) + ' ', nonl=1) + yield item + if l == 0: + self.info() + + supported_image_types = [] + + def post_process_images(self, doctree): + """ + Pick the best candidate for all image URIs. + """ + for node in doctree.traverse(nodes.image): + if '?' in node['candidates']: + # don't rewrite nonlocal image URIs + continue + if '*' not in node['candidates']: + for imgtype in self.supported_image_types: + candidate = node['candidates'].get(imgtype, None) + if candidate: + break + else: + self.warn('%s:%s: no matching candidate for image URI %r' % + (node.source, getattr(node, 'lineno', ''), node['uri'])) + continue + node['uri'] = candidate + else: + candidate = node['uri'] + if candidate not in self.env.images: + # non-existing URI; let it alone + continue + self.images[candidate] = self.env.images[candidate][1] + + # build methods + + def load_i18n(self): + """ + Load translated strings from the configured localedirs if + enabled in the configuration. + """ + self.translator = None + if self.config.language is not None: + self.info(bold('loading translations [%s]... ' % self.config.language), + nonl=True) + locale_dirs = [path.join(package_dir, 'locale')] + \ + [path.join(self.srcdir, x) for x in self.config.locale_dirs] + for dir_ in locale_dirs: + try: + trans = gettext.translation('sphinx', localedir=dir_, + languages=[self.config.language]) + if self.translator is None: + self.translator = trans + else: + self.translator._catalog.update(trans.catalog) + except Exception: + # Language couldn't be found in the specified path + pass + if self.translator is not None: + self.info('done') + else: + self.info('locale not available') + if self.translator is None: + self.translator = gettext.NullTranslations() + self.translator.install(unicode=True) + locale.init() # translate common labels + + def load_env(self): + """Set up the build environment.""" + if self.env: + return + if not self.freshenv: + try: + self.info(bold('loading pickled environment... '), nonl=True) + self.env = BuildEnvironment.frompickle(self.config, + path.join(self.doctreedir, ENV_PICKLE_FILENAME)) + self.info('done') + except Exception, err: + if type(err) is IOError and err.errno == 2: + self.info('not found') + else: + self.info('failed: %s' % err) + self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) + self.env.find_files(self.config) + else: + self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) + self.env.find_files(self.config) + self.env.set_warnfunc(self.warn) + + def build_all(self): + """Build all source files.""" + self.build(None, summary='all source files', method='all') + + def build_specific(self, filenames): + """Only rebuild as much as needed for changes in the *filenames*.""" + # bring the filenames to the canonical format, that is, + # relative to the source directory and without source_suffix. + dirlen = len(self.srcdir) + 1 + to_write = [] + suffix = self.config.source_suffix + for filename in filenames: + filename = path.abspath(filename)[dirlen:] + if filename.endswith(suffix): + filename = filename[:-len(suffix)] + filename = filename.replace(os.path.sep, SEP) + to_write.append(filename) + self.build(to_write, method='specific', + summary='%d source files given on command ' + 'line' % len(to_write)) + + def build_update(self): + """Only rebuild what was changed or added since last build.""" + to_build = self.get_outdated_docs() + if isinstance(to_build, str): + self.build(['__all__'], to_build) + else: + to_build = list(to_build) + self.build(to_build, + summary='targets for %d source files that are ' + 'out of date' % len(to_build)) + + def build(self, docnames, summary=None, method='update'): + """ + Main build method. First updates the environment, and then calls :meth:`write`. + """ + if summary: + self.info(bold('building [%s]: ' % self.name), nonl=1) + self.info(summary) + + updated_docnames = [] + # while reading, collect all warnings from docutils + warnings = [] + self.env.set_warnfunc(warnings.append) + self.info(bold('updating environment: '), nonl=1) + iterator = self.env.update(self.config, self.srcdir, self.doctreedir, self.app) + # the first item in the iterator is a summary message + self.info(iterator.next()) + for docname in self.status_iterator(iterator, 'reading sources... ', purple): + updated_docnames.append(docname) + # nothing further to do, the environment has already done the reading + for warning in warnings: + if warning.strip(): + self.warn(warning) + self.env.set_warnfunc(self.warn) + + if updated_docnames: + # save the environment + self.info(bold('pickling environment... '), nonl=True) + self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME)) + self.info('done') + + # global actions + self.info(bold('checking consistency... '), nonl=True) + self.env.check_consistency() + self.info('done') + else: + if method == 'update' and not docnames: + self.info(bold('no targets are out of date.')) + return + + # another indirection to support builders that don't build files individually + self.write(docnames, updated_docnames, method) + + # finish (write static files etc.) + self.finish() + status = self.app.statuscode == 0 and 'succeeded' or 'finished with problems' + if self.app._warncount: + self.info(bold('build %s, %s warning%s.' % + (status, self.app._warncount, + self.app._warncount != 1 and 's' or ''))) + else: + self.info(bold('build %s.' % status)) + + def write(self, build_docnames, updated_docnames, method='update'): + if build_docnames is None or build_docnames == ['__all__']: + # build_all + build_docnames = self.env.found_docs + if method == 'update': + # build updated ones as well + docnames = set(build_docnames) | set(updated_docnames) + else: + docnames = set(build_docnames) + + # add all toctree-containing files that may have changed + for docname in list(docnames): + for tocdocname in self.env.files_to_rebuild.get(docname, []): + docnames.add(tocdocname) + docnames.add(self.config.master_doc) + + self.info(bold('preparing documents... '), nonl=True) + self.prepare_writing(docnames) + self.info('done') + + # write target files + warnings = [] + self.env.set_warnfunc(warnings.append) + for docname in self.status_iterator(sorted(docnames), + 'writing output... ', darkgreen): + doctree = self.env.get_and_resolve_doctree(docname, self) + self.write_doc(docname, doctree) + for warning in warnings: + if warning.strip(): + self.warn(warning) + self.env.set_warnfunc(self.warn) + + def prepare_writing(self, docnames): + raise NotImplementedError + + def write_doc(self, docname, doctree): + raise NotImplementedError + + def finish(self): + """ + Finish the building process. The default implementation does nothing. + """ + pass + + +BUILTIN_BUILDERS = { + 'html': ('html', 'StandaloneHTMLBuilder'), + 'pickle': ('html', 'PickleHTMLBuilder'), + 'json': ('html', 'JSONHTMLBuilder'), + 'web': ('html', 'PickleHTMLBuilder'), + 'htmlhelp': ('htmlhelp', 'HTMLHelpBuilder'), + 'qthelp': ('qthelp', 'QtHelpBuilder'), + 'latex': ('latex', 'LaTeXBuilder'), + 'text': ('text', 'TextBuilder'), + 'changes': ('changes', 'ChangesBuilder'), + 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'), +} Added: doctools/trunk/sphinx/builders/changes.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/changes.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.changes + ~~~~~~~~~~~~~~~~~~~~~~~ + + Changelog builder. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +import shutil +from os import path +from cgi import escape + +from sphinx import package_dir +from sphinx.util import ensuredir, os_path +from sphinx.builders import Builder +from sphinx.util.console import bold + + +class ChangesBuilder(Builder): + """ + Write a summary with all versionadded/changed directives. + """ + name = 'changes' + + def init(self): + self.init_templates() + + def get_outdated_docs(self): + return self.outdir + + typemap = { + 'versionadded': 'added', + 'versionchanged': 'changed', + 'deprecated': 'deprecated', + } + + def write(self, *ignored): + version = self.config.version + libchanges = {} + apichanges = [] + otherchanges = {} + if version not in self.env.versionchanges: + self.info(bold('no changes in this version.')) + return + self.info(bold('writing summary file...')) + for type, docname, lineno, module, descname, content in \ + self.env.versionchanges[version]: + ttext = self.typemap[type] + context = content.replace('\n', ' ') + if descname and docname.startswith('c-api'): + if not descname: + continue + if context: + entry = '%s: %s: %s' % (descname, ttext, context) + else: + entry = '%s: %s.' % (descname, ttext) + apichanges.append((entry, docname, lineno)) + elif descname or module: + if not module: + module = _('Builtins') + if not descname: + descname = _('Module level') + if context: + entry = '%s: %s: %s' % (descname, ttext, context) + else: + entry = '%s: %s.' % (descname, ttext) + libchanges.setdefault(module, []).append((entry, docname, lineno)) + else: + if not context: + continue + entry = '%s: %s' % (ttext.capitalize(), context) + title = self.env.titles[docname].astext() + otherchanges.setdefault((docname, title), []).append( + (entry, docname, lineno)) + + ctx = { + 'project': self.config.project, + 'version': version, + 'docstitle': self.config.html_title, + 'shorttitle': self.config.html_short_title, + 'libchanges': sorted(libchanges.iteritems()), + 'apichanges': sorted(apichanges), + 'otherchanges': sorted(otherchanges.iteritems()), + 'show_sphinx': self.config.html_show_sphinx, + } + f = codecs.open(path.join(self.outdir, 'index.html'), 'w', 'utf8') + try: + f.write(self.templates.render('changes/frameset.html', ctx)) + finally: + f.close() + f = codecs.open(path.join(self.outdir, 'changes.html'), 'w', 'utf8') + try: + f.write(self.templates.render('changes/versionchanges.html', ctx)) + finally: + f.close() + + hltext = ['.. versionadded:: %s' % version, + '.. versionchanged:: %s' % version, + '.. deprecated:: %s' % version] + + def hl(no, line): + line = ' ' % no + escape(line) + for x in hltext: + if x in line: + line = '%s' % line + break + return line + + self.info(bold('copying source files...')) + for docname in self.env.all_docs: + f = codecs.open(self.env.doc2path(docname), 'r', 'latin1') + lines = f.readlines() + targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html' + ensuredir(path.dirname(targetfn)) + f = codecs.open(targetfn, 'w', 'latin1') + try: + text = ''.join(hl(i+1, line) for (i, line) in enumerate(lines)) + ctx = {'filename': self.env.doc2path(docname, None), 'text': text} + f.write(self.templates.render('changes/rstsource.html', ctx)) + finally: + f.close() + shutil.copyfile(path.join(package_dir, 'static', 'default.css'), + path.join(self.outdir, 'default.css')) + + def hl(self, text, version): + text = escape(text) + for directive in ['versionchanged', 'versionadded', 'deprecated']: + text = text.replace('.. %s:: %s' % (directive, version), + '.. %s:: %s' % (directive, version)) + return text + + def finish(self): + pass Added: doctools/trunk/sphinx/builders/html.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/html.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,632 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.html + ~~~~~~~~~~~~~~~~~~~~ + + Several HTML builders. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import codecs +import shutil +import cPickle as pickle +from os import path + +from docutils.io import DocTreeInput, StringOutput +from docutils.core import publish_parts +from docutils.utils import new_document +from docutils.frontend import OptionParser +from docutils.readers.doctree import Reader as DoctreeReader + +from sphinx import package_dir, __version__ +from sphinx.util import SEP, os_path, relative_uri, ensuredir, ustrftime +from sphinx.search import js_index +from sphinx.builders import Builder, ENV_PICKLE_FILENAME +from sphinx.highlighting import PygmentsBridge +from sphinx.util.console import bold +from sphinx.writers.html import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator + +try: + import json +except ImportError: + try: + import simplejson as json + except ImportError: + json = None + +#: the filename for the inventory of objects +INVENTORY_FILENAME = 'objects.inv' +#: the filename for the "last build" file (for serializing builders) +LAST_BUILD_FILENAME = 'last_build' + + +class StandaloneHTMLBuilder(Builder): + """ + Builds standalone HTML docs. + """ + name = 'html' + copysource = True + out_suffix = '.html' + link_suffix = '.html' # defaults to matching out_suffix + indexer_format = js_index + supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', + 'image/jpeg'] + searchindex_filename = 'searchindex.js' + add_permalinks = True + embedded = False # for things like HTML help or Qt help: suppresses sidebar + + # This is a class attribute because it is mutated by Sphinx.add_javascript. + script_files = ['_static/jquery.js', '_static/doctools.js'] + + def init(self): + """Load templates.""" + self.init_templates() + self.init_translator_class() + if self.config.html_file_suffix: + self.out_suffix = self.config.html_file_suffix + + if self.config.html_link_suffix is not None: + self.link_suffix = self.config.html_link_suffix + else: + self.link_suffix = self.out_suffix + + if self.config.language is not None: + jsfile = path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js') + if path.isfile(jsfile): + self.script_files.append('_static/translations.js') + + def init_translator_class(self): + if self.config.html_translator_class: + self.translator_class = self.app.import_object( + self.config.html_translator_class, 'html_translator_class setting') + elif self.config.html_use_smartypants: + self.translator_class = SmartyPantsHTMLTranslator + else: + self.translator_class = HTMLTranslator + + def render_partial(self, node): + """Utility: Render a lone doctree node.""" + doc = new_document('') + doc.append(node) + return publish_parts( + doc, + source_class=DocTreeInput, + reader=DoctreeReader(), + writer=HTMLWriter(self), + settings_overrides={'output_encoding': 'unicode'} + ) + + def prepare_writing(self, docnames): + from sphinx.search import IndexBuilder + + self.indexer = IndexBuilder(self.env) + self.load_indexer(docnames) + self.docwriter = HTMLWriter(self) + self.docsettings = OptionParser( + defaults=self.env.settings, + components=(self.docwriter,)).get_default_values() + + # format the "last updated on" string, only once is enough since it + # typically doesn't include the time of day + lufmt = self.config.html_last_updated_fmt + if lufmt is not None: + self.last_updated = ustrftime(lufmt or _('%b %d, %Y')) + else: + self.last_updated = None + + logo = self.config.html_logo and \ + path.basename(self.config.html_logo) or '' + + favicon = self.config.html_favicon and \ + path.basename(self.config.html_favicon) or '' + if favicon and os.path.splitext(favicon)[1] != '.ico': + self.warn('html_favicon is not an .ico file') + + if not isinstance(self.config.html_use_opensearch, basestring): + self.warn('html_use_opensearch config value must now be a string') + + self.relations = self.env.collect_relations() + + rellinks = [] + if self.config.html_use_index: + rellinks.append(('genindex', _('General Index'), 'I', _('index'))) + if self.config.html_use_modindex and self.env.modules: + rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules'))) + + self.globalcontext = dict( + embedded = self.embedded, + project = self.config.project, + release = self.config.release, + version = self.config.version, + last_updated = self.last_updated, + copyright = self.config.copyright, + master_doc = self.config.master_doc, + style = self.config.html_style, + use_opensearch = self.config.html_use_opensearch, + docstitle = self.config.html_title, + shorttitle = self.config.html_short_title, + show_sphinx = self.config.html_show_sphinx, + has_source = self.config.html_copy_source, + show_source = self.config.html_show_sourcelink, + file_suffix = self.out_suffix, + script_files = self.script_files, + sphinx_version = __version__, + rellinks = rellinks, + builder = self.name, + parents = [], + logo = logo, + favicon = favicon, + ) + self.globalcontext.update(self.config.html_context) + + def get_doc_context(self, docname, body, metatags): + """Collect items for the template context of a page.""" + # find out relations + prev = next = None + parents = [] + rellinks = self.globalcontext['rellinks'][:] + related = self.relations.get(docname) + titles = self.env.titles + if related and related[2]: + try: + next = {'link': self.get_relative_uri(docname, related[2]), + 'title': self.render_partial(titles[related[2]])['title']} + rellinks.append((related[2], next['title'], 'N', _('next'))) + except KeyError: + next = None + if related and related[1]: + try: + prev = {'link': self.get_relative_uri(docname, related[1]), + 'title': self.render_partial(titles[related[1]])['title']} + rellinks.append((related[1], prev['title'], 'P', _('previous'))) + except KeyError: + # the relation is (somehow) not in the TOC tree, handle that gracefully + prev = None + while related and related[0]: + try: + parents.append( + {'link': self.get_relative_uri(docname, related[0]), + 'title': self.render_partial(titles[related[0]])['title']}) + except KeyError: + pass + related = self.relations.get(related[0]) + if parents: + parents.pop() # remove link to the master file; we have a generic + # "back to index" link already + parents.reverse() + + # title rendered as HTML + title = titles.get(docname) + title = title and self.render_partial(title)['title'] or '' + # the name for the copied source + sourcename = self.config.html_copy_source and docname + '.txt' or '' + + # metadata for the document + meta = self.env.metadata.get(docname) + + return dict( + parents = parents, + prev = prev, + next = next, + title = title, + meta = meta, + body = body, + metatags = metatags, + rellinks = rellinks, + sourcename = sourcename, + toc = self.render_partial(self.env.get_toc_for(docname))['fragment'], + # only display a TOC if there's more than one item to show + display_toc = (self.env.toc_num_entries[docname] > 1), + ) + + def write_doc(self, docname, doctree): + self.post_process_images(doctree) + destination = StringOutput(encoding='utf-8') + doctree.settings = self.docsettings + + self.imgpath = relative_uri(self.get_target_uri(docname), '_images') + self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') + self.docwriter.write(doctree, destination) + self.docwriter.assemble_parts() + body = self.docwriter.parts['fragment'] + metatags = self.docwriter.clean_meta + + ctx = self.get_doc_context(docname, body, metatags) + self.index_page(docname, doctree, ctx.get('title', '')) + self.handle_page(docname, ctx, event_arg=doctree) + + def finish(self): + self.info(bold('writing additional files...'), nonl=1) + + # the global general index + + if self.config.html_use_index: + # the total count of lines for each index letter, used to distribute + # the entries into two columns + genindex = self.env.create_index(self) + indexcounts = [] + for _, entries in genindex: + indexcounts.append(sum(1 + len(subitems) + for _, (_, subitems) in entries)) + + genindexcontext = dict( + genindexentries = genindex, + genindexcounts = indexcounts, + split_index = self.config.html_split_index, + ) + self.info(' genindex', nonl=1) + + if self.config.html_split_index: + self.handle_page('genindex', genindexcontext, 'genindex-split.html') + self.handle_page('genindex-all', genindexcontext, 'genindex.html') + for (key, entries), count in zip(genindex, indexcounts): + ctx = {'key': key, 'entries': entries, 'count': count, + 'genindexentries': genindex} + self.handle_page('genindex-' + key, ctx, 'genindex-single.html') + else: + self.handle_page('genindex', genindexcontext, 'genindex.html') + + # the global module index + + if self.config.html_use_modindex and self.env.modules: + # the sorted list of all modules, for the global module index + modules = sorted(((mn, (self.get_relative_uri('modindex', fn) + + '#module-' + mn, sy, pl, dep)) + for (mn, (fn, sy, pl, dep)) in + self.env.modules.iteritems()), + key=lambda x: x[0].lower()) + # collect all platforms + platforms = set() + # sort out collapsable modules + modindexentries = [] + letters = [] + pmn = '' + num_toplevels = 0 + num_collapsables = 0 + cg = 0 # collapse group + fl = '' # first letter + for mn, (fn, sy, pl, dep) in modules: + pl = pl and pl.split(', ') or [] + platforms.update(pl) + if fl != mn[0].lower() and mn[0] != '_': + # heading + modindexentries.append(['', False, 0, False, + mn[0].upper(), '', [], False]) + letters.append(mn[0].upper()) + tn = mn.split('.')[0] + if tn != mn: + # submodule + if pmn == tn: + # first submodule - make parent collapsable + modindexentries[-1][1] = True + num_collapsables += 1 + elif not pmn.startswith(tn): + # submodule without parent in list, add dummy entry + cg += 1 + modindexentries.append([tn, True, cg, False, '', '', [], False]) + else: + num_toplevels += 1 + cg += 1 + modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl, dep]) + pmn = mn + fl = mn[0].lower() + platforms = sorted(platforms) + + # apply heuristics when to collapse modindex at page load: + # only collapse if number of toplevel modules is larger than + # number of submodules + collapse = len(modules) - num_toplevels < num_toplevels + + modindexcontext = dict( + modindexentries = modindexentries, + platforms = platforms, + letters = letters, + collapse_modindex = collapse, + ) + self.info(' modindex', nonl=1) + self.handle_page('modindex', modindexcontext, 'modindex.html') + + # the search page + if self.name != 'htmlhelp': + self.info(' search', nonl=1) + self.handle_page('search', {}, 'search.html') + + # additional pages from conf.py + for pagename, template in self.config.html_additional_pages.items(): + self.info(' '+pagename, nonl=1) + self.handle_page(pagename, {}, template) + + if self.config.html_use_opensearch and self.name != 'htmlhelp': + self.info(' opensearch', nonl=1) + fn = path.join(self.outdir, '_static', 'opensearch.xml') + self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn) + + self.info() + + # copy image files + if self.images: + self.info(bold('copying images...'), nonl=True) + ensuredir(path.join(self.outdir, '_images')) + for src, dest in self.images.iteritems(): + self.info(' '+src, nonl=1) + shutil.copyfile(path.join(self.srcdir, src), + path.join(self.outdir, '_images', dest)) + self.info() + + # copy downloadable files + if self.env.dlfiles: + self.info(bold('copying downloadable files...'), nonl=True) + ensuredir(path.join(self.outdir, '_downloads')) + for src, (_, dest) in self.env.dlfiles.iteritems(): + self.info(' '+src, nonl=1) + shutil.copyfile(path.join(self.srcdir, src), + path.join(self.outdir, '_downloads', dest)) + self.info() + + # copy static files + self.info(bold('copying static files... '), nonl=True) + ensuredir(path.join(self.outdir, '_static')) + # first, create pygments style file + f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w') + f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet()) + f.close() + # then, copy translations JavaScript file + if self.config.language is not None: + jsfile = path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js') + if path.isfile(jsfile): + shutil.copyfile(jsfile, path.join(self.outdir, '_static', + 'translations.js')) + # then, copy over all user-supplied static files + staticdirnames = [path.join(package_dir, 'static')] + \ + [path.join(self.confdir, spath) + for spath in self.config.html_static_path] + for staticdirname in staticdirnames: + for filename in os.listdir(staticdirname): + if filename.startswith('.'): + continue + fullname = path.join(staticdirname, filename) + targetname = path.join(self.outdir, '_static', filename) + if path.isfile(fullname): + shutil.copyfile(fullname, targetname) + elif path.isdir(fullname): + if filename in self.config.exclude_dirnames: + continue + if path.exists(targetname): + shutil.rmtree(targetname) + shutil.copytree(fullname, targetname) + # last, copy logo file (handled differently) + if self.config.html_logo: + logobase = path.basename(self.config.html_logo) + shutil.copyfile(path.join(self.confdir, self.config.html_logo), + path.join(self.outdir, '_static', logobase)) + self.info('done') + + # dump the search index + self.handle_finish() + + def get_outdated_docs(self): + if self.templates: + template_mtime = self.templates.newest_template_mtime() + else: + template_mtime = 0 + for docname in self.env.found_docs: + if docname not in self.env.all_docs: + yield docname + continue + targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) + try: + targetmtime = path.getmtime(targetname) + except Exception: + targetmtime = 0 + try: + srcmtime = max(path.getmtime(self.env.doc2path(docname)), + template_mtime) + if srcmtime > targetmtime: + yield docname + except EnvironmentError: + # source doesn't exist anymore + pass + + def load_indexer(self, docnames): + keep = set(self.env.all_docs) - set(docnames) + try: + f = open(path.join(self.outdir, self.searchindex_filename), 'rb') + try: + self.indexer.load(f, self.indexer_format) + finally: + f.close() + except (IOError, OSError, ValueError): + if keep: + self.warn("search index couldn't be loaded, but not all documents " + "will be built: the index will be incomplete.") + # delete all entries for files that will be rebuilt + self.indexer.prune(keep) + + def index_page(self, pagename, doctree, title): + # only index pages with title + if self.indexer is not None and title: + self.indexer.feed(pagename, title, doctree) + + # --------- these are overwritten by the serialization builder + + def get_target_uri(self, docname, typ=None): + return docname + self.link_suffix + + def handle_page(self, pagename, addctx, templatename='page.html', + outfilename=None, event_arg=None): + ctx = self.globalcontext.copy() + # current_page_name is backwards compatibility + ctx['pagename'] = ctx['current_page_name'] = pagename + + def pathto(otheruri, resource=False, + baseuri=self.get_target_uri(pagename)): + if not resource: + otheruri = self.get_target_uri(otheruri) + return relative_uri(baseuri, otheruri) + ctx['pathto'] = pathto + ctx['hasdoc'] = lambda name: name in self.env.all_docs + ctx['customsidebar'] = self.config.html_sidebars.get(pagename) + ctx.update(addctx) + + self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) + + output = self.templates.render(templatename, ctx) + if not outfilename: + outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) + ensuredir(path.dirname(outfilename)) # normally different from self.outdir + try: + f = codecs.open(outfilename, 'w', 'utf-8') + try: + f.write(output) + finally: + f.close() + except (IOError, OSError), err: + self.warn("Error writing file %s: %s" % (outfilename, err)) + if self.copysource and ctx.get('sourcename'): + # copy the source file for the "show source" link + source_name = path.join(self.outdir, '_sources', os_path(ctx['sourcename'])) + ensuredir(path.dirname(source_name)) + shutil.copyfile(self.env.doc2path(pagename), source_name) + + def handle_finish(self): + self.info(bold('dumping search index... '), nonl=True) + self.indexer.prune(self.env.all_docs) + searchindexfn = path.join(self.outdir, self.searchindex_filename) + # first write to a temporary file, so that if dumping fails, the existing + # index won't be overwritten + f = open(searchindexfn + '.tmp', 'wb') + try: + self.indexer.dump(f, self.indexer_format) + finally: + f.close() + os.rename(searchindexfn + '.tmp', searchindexfn) + self.info('done') + + self.info(bold('dumping object inventory... '), nonl=True) + f = open(path.join(self.outdir, INVENTORY_FILENAME), 'w') + try: + f.write('# Sphinx inventory version 1\n') + f.write('# Project: %s\n' % self.config.project.encode('utf-8')) + f.write('# Version: %s\n' % self.config.version) + for modname, info in self.env.modules.iteritems(): + f.write('%s mod %s\n' % (modname, self.get_target_uri(info[0]))) + for refname, (docname, desctype) in self.env.descrefs.iteritems(): + f.write('%s %s %s\n' % (refname, desctype, self.get_target_uri(docname))) + finally: + f.close() + self.info('done') + + +class SerializingHTMLBuilder(StandaloneHTMLBuilder): + """ + An abstract builder that serializes the HTML generated. + """ + #: the serializing implementation to use. Set this to a module that + #: implements a `dump`, `load`, `dumps` and `loads` functions + #: (pickle, simplejson etc.) + implementation = None + + #: the filename for the global context file + globalcontext_filename = None + + supported_image_types = ('image/svg+xml', 'image/png', 'image/gif', + 'image/jpeg') + + def init(self): + self.init_translator_class() + self.templates = None # no template bridge necessary + + def get_target_uri(self, docname, typ=None): + if docname == 'index': + return '' + if docname.endswith(SEP + 'index'): + return docname[:-5] # up to sep + return docname + SEP + + def handle_page(self, pagename, ctx, templatename='page.html', + outfilename=None, event_arg=None): + ctx['current_page_name'] = pagename + sidebarfile = self.config.html_sidebars.get(pagename) + if sidebarfile: + ctx['customsidebar'] = sidebarfile + + if not outfilename: + outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) + + self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) + + ensuredir(path.dirname(outfilename)) + f = open(outfilename, 'wb') + try: + self.implementation.dump(ctx, f, 2) + finally: + f.close() + + # if there is a source file, copy the source file for the + # "show source" link + if ctx.get('sourcename'): + source_name = path.join(self.outdir, '_sources', + os_path(ctx['sourcename'])) + ensuredir(path.dirname(source_name)) + shutil.copyfile(self.env.doc2path(pagename), source_name) + + def handle_finish(self): + # dump the global context + outfilename = path.join(self.outdir, self.globalcontext_filename) + f = open(outfilename, 'wb') + try: + self.implementation.dump(self.globalcontext, f, 2) + finally: + f.close() + + # super here to dump the search index + StandaloneHTMLBuilder.handle_finish(self) + + # copy the environment file from the doctree dir to the output dir + # as needed by the web app + shutil.copyfile(path.join(self.doctreedir, ENV_PICKLE_FILENAME), + path.join(self.outdir, ENV_PICKLE_FILENAME)) + + # touch 'last build' file, used by the web application to determine + # when to reload its environment and clear the cache + open(path.join(self.outdir, LAST_BUILD_FILENAME), 'w').close() + + +class PickleHTMLBuilder(SerializingHTMLBuilder): + """ + A Builder that dumps the generated HTML into pickle files. + """ + implementation = pickle + indexer_format = pickle + name = 'pickle' + out_suffix = '.fpickle' + globalcontext_filename = 'globalcontext.pickle' + searchindex_filename = 'searchindex.pickle' + +# compatibility alias +WebHTMLBuilder = PickleHTMLBuilder + + +class JSONHTMLBuilder(SerializingHTMLBuilder): + """ + A builder that dumps the generated HTML into JSON files. + """ + implementation = json + indexer_format = json + name = 'json' + out_suffix = '.fjson' + globalcontext_filename = 'globalcontext.json' + searchindex_filename = 'searchindex.json' + + def init(self): + if json is None: + from sphinx.application import SphinxError + raise SphinxError('The module simplejson (or json in Python >= 2.6) ' + 'is not available. The JSONHTMLBuilder builder ' + 'will not work.') + SerializingHTMLBuilder.init(self) Added: doctools/trunk/sphinx/builders/htmlhelp.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/htmlhelp.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,246 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.htmlhelp + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Build HTML help support files. + Parts adapted from Python's Doc/tools/prechm.py. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import cgi +from os import path + +from docutils import nodes + +from sphinx import addnodes +from sphinx.builders.html import StandaloneHTMLBuilder + + +# Project file (*.hhp) template. 'outname' is the file basename (like +# the pythlp in pythlp.hhp); 'version' is the doc version number (like +# the 2.2 in Python 2.2). +# The magical numbers in the long line under [WINDOWS] set most of the +# user-visible features (visible buttons, tabs, etc). +# About 0x10384e: This defines the buttons in the help viewer. The +# following defns are taken from htmlhelp.h. Not all possibilities +# actually work, and not all those that work are available from the Help +# Workshop GUI. In particular, the Zoom/Font button works and is not +# available from the GUI. The ones we're using are marked with 'x': +# +# 0x000002 Hide/Show x +# 0x000004 Back x +# 0x000008 Forward x +# 0x000010 Stop +# 0x000020 Refresh +# 0x000040 Home x +# 0x000080 Forward +# 0x000100 Back +# 0x000200 Notes +# 0x000400 Contents +# 0x000800 Locate x +# 0x001000 Options x +# 0x002000 Print x +# 0x004000 Index +# 0x008000 Search +# 0x010000 History +# 0x020000 Favorites +# 0x040000 Jump 1 +# 0x080000 Jump 2 +# 0x100000 Zoom/Font x +# 0x200000 TOC Next +# 0x400000 TOC Prev + +project_template = '''\ +[OPTIONS] +Binary TOC=Yes +Binary Index=No +Compiled file=%(outname)s.chm +Contents file=%(outname)s.hhc +Default Window=%(outname)s +Default topic=index.html +Display compile progress=No +Full text search stop list file=%(outname)s.stp +Full-text search=Yes +Index file=%(outname)s.hhk +Language=0x409 +Title=%(title)s + +[WINDOWS] +%(outname)s="%(title)s","%(outname)s.hhc","%(outname)s.hhk",\ +"index.html","index.html",,,,,0x63520,220,0x10384e,[0,0,1024,768],,,,,,,0 + +[FILES] +''' + +contents_header = '''\ + + + + + + + + + + +

      +''' + +contents_footer = '''\ +
    +''' + +object_sitemap = '''\ + + + + +''' + +# List of words the full text search facility shouldn't index. This +# becomes file outname.stp. Note that this list must be pretty small! +# Different versions of the MS docs claim the file has a maximum size of +# 256 or 512 bytes (including \r\n at the end of each line). +# Note that "and", "or", "not" and "near" are operators in the search +# language, so no point indexing them even if we wanted to. +stopwords = """ +a and are as at +be but by +for +if in into is it +near no not +of on or +such +that the their then there these they this to +was will with +""".split() + + +class HTMLHelpBuilder(StandaloneHTMLBuilder): + """ + Builder that also outputs Windows HTML help project, contents and index files. + Adapted from the original Doc/tools/prechm.py. + """ + name = 'htmlhelp' + + # don't copy the reST source + copysource = False + supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] + + # don't add links + add_permalinks = False + # don't add sidebar etc. + embedded = True + + def init(self): + StandaloneHTMLBuilder.init(self) + # the output files for HTML help must be .html only + self.out_suffix = '.html' + + def handle_finish(self): + self.build_hhx(self.outdir, self.config.htmlhelp_basename) + + def build_hhx(self, outdir, outname): + self.info('dumping stopword list...') + f = open(path.join(outdir, outname+'.stp'), 'w') + try: + for word in sorted(stopwords): + print >>f, word + finally: + f.close() + + self.info('writing project file...') + f = open(path.join(outdir, outname+'.hhp'), 'w') + try: + f.write(project_template % {'outname': outname, + 'title': self.config.html_title, + 'version': self.config.version, + 'project': self.config.project}) + if not outdir.endswith(os.sep): + outdir += os.sep + olen = len(outdir) + for root, dirs, files in os.walk(outdir): + staticdir = (root == path.join(outdir, '_static')) + for fn in files: + if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'): + print >>f, path.join(root, fn)[olen:].replace(os.sep, '\\') + finally: + f.close() + + self.info('writing TOC file...') + f = open(path.join(outdir, outname+'.hhc'), 'w') + try: + f.write(contents_header) + # special books + f.write('
  • ' + object_sitemap % (self.config.html_short_title, + 'index.html')) + if self.config.html_use_modindex: + f.write('
  • ' + object_sitemap % (_('Global Module Index'), + 'modindex.html')) + # the TOC + tocdoc = self.env.get_and_resolve_doctree(self.config.master_doc, self, + prune_toctrees=False) + def write_toc(node, ullevel=0): + if isinstance(node, nodes.list_item): + f.write('
  • ') + for subnode in node: + write_toc(subnode, ullevel) + elif isinstance(node, nodes.reference): + link = node['refuri'] + title = cgi.escape(node.astext()).replace('"','"') + item = object_sitemap % (title, link) + f.write(item.encode('ascii', 'xmlcharrefreplace')) + elif isinstance(node, nodes.bullet_list): + if ullevel != 0: + f.write('
      \n') + for subnode in node: + write_toc(subnode, ullevel+1) + if ullevel != 0: + f.write('
    \n') + elif isinstance(node, addnodes.compact_paragraph): + for subnode in node: + write_toc(subnode, ullevel) + istoctree = lambda node: isinstance(node, addnodes.compact_paragraph) and \ + node.has_key('toctree') + for node in tocdoc.traverse(istoctree): + write_toc(node) + f.write(contents_footer) + finally: + f.close() + + self.info('writing index file...') + index = self.env.create_index(self) + f = open(path.join(outdir, outname+'.hhk'), 'w') + try: + f.write('
      \n') + def write_index(title, refs, subitems): + def write_param(name, value): + item = ' \n' % (name, value) + f.write(item.encode('ascii', 'xmlcharrefreplace')) + title = cgi.escape(title) + f.write('
    • \n') + write_param('Keyword', title) + if len(refs) == 0: + write_param('See Also', title) + elif len(refs) == 1: + write_param('Local', refs[0]) + else: + for i, ref in enumerate(refs): + write_param('Name', '[%d] %s' % (i, ref)) # XXX: better title? + write_param('Local', ref) + f.write('\n') + if subitems: + f.write('
        ') + for subitem in subitems: + write_index(subitem[0], subitem[1], []) + f.write('
      ') + for (key, group) in index: + for title, (refs, subitems) in group: + write_index(title, refs, subitems) + f.write('
    \n') + finally: + f.close() Added: doctools/trunk/sphinx/builders/latex.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/latex.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.latex + ~~~~~~~~~~~~~~~~~~~~~ + + LaTeX builder. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import shutil +from os import path + +from docutils import nodes +from docutils.io import FileOutput +from docutils.utils import new_document +from docutils.frontend import OptionParser + +from sphinx import package_dir, addnodes +from sphinx.util import SEP, texescape +from sphinx.builders import Builder +from sphinx.environment import NoUri +from sphinx.util.console import bold, darkgreen +from sphinx.writers.latex import LaTeXWriter + + +class LaTeXBuilder(Builder): + """ + Builds LaTeX output to create PDF. + """ + name = 'latex' + supported_image_types = ['application/pdf', 'image/png', 'image/gif', + 'image/jpeg'] + + def init(self): + self.docnames = [] + self.document_data = [] + texescape.init() + + def get_outdated_docs(self): + return 'all documents' # for now + + def get_target_uri(self, docname, typ=None): + if typ == 'token': + # token references are always inside production lists and must be + # replaced by \token{} in LaTeX + return '@token' + if docname not in self.docnames: + raise NoUri + else: + return '%' + docname + + def init_document_data(self): + preliminary_document_data = map(list, self.config.latex_documents) + if not preliminary_document_data: + self.warn('No "latex_documents" config value found; no documents ' + 'will be written.') + return + # assign subdirs to titles + self.titles = [] + for entry in preliminary_document_data: + docname = entry[0] + if docname not in self.env.all_docs: + self.warn('"latex_documents" config value references unknown ' + 'document %s' % docname) + continue + self.document_data.append(entry) + if docname.endswith(SEP+'index'): + docname = docname[:-5] + self.titles.append((docname, entry[2])) + + def write(self, *ignored): + # first, assemble the "appendix" docs that are in every PDF + appendices = [] + for fname in self.config.latex_appendices: + appendices.append(self.env.get_doctree(fname)) + + docwriter = LaTeXWriter(self) + docsettings = OptionParser( + defaults=self.env.settings, + components=(docwriter,)).get_default_values() + + self.init_document_data() + + for entry in self.document_data: + docname, targetname, title, author, docclass = entry[:5] + toctree_only = False + if len(entry) > 5: + toctree_only = entry[5] + destination = FileOutput( + destination_path=path.join(self.outdir, targetname), + encoding='utf-8') + self.info("processing " + targetname + "... ", nonl=1) + doctree = self.assemble_doctree(docname, toctree_only, + appendices=(docclass == 'manual') and appendices or []) + self.post_process_images(doctree) + self.info("writing... ", nonl=1) + doctree.settings = docsettings + doctree.settings.author = author + doctree.settings.title = title + doctree.settings.docname = docname + doctree.settings.docclass = docclass + docwriter.write(doctree, destination) + self.info("done") + + def assemble_doctree(self, indexfile, toctree_only, appendices): + self.docnames = set([indexfile] + appendices) + self.info(darkgreen(indexfile) + " ", nonl=1) + def process_tree(docname, tree): + tree = tree.deepcopy() + for toctreenode in tree.traverse(addnodes.toctree): + newnodes = [] + includefiles = map(str, toctreenode['includefiles']) + for includefile in includefiles: + try: + self.info(darkgreen(includefile) + " ", nonl=1) + subtree = process_tree(includefile, + self.env.get_doctree(includefile)) + self.docnames.add(includefile) + except Exception: + self.warn('%s: toctree contains ref to nonexisting file %r' % + (docname, includefile)) + else: + sof = addnodes.start_of_file(docname=includefile) + sof.children = subtree.children + newnodes.append(sof) + toctreenode.parent.replace(toctreenode, newnodes) + return tree + tree = self.env.get_doctree(indexfile) + tree['docname'] = indexfile + if toctree_only: + # extract toctree nodes from the tree and put them in a fresh document + new_tree = new_document('') + new_sect = nodes.section() + new_sect += nodes.title(u'', u'') + new_tree += new_sect + for node in tree.traverse(addnodes.toctree): + new_sect += node + tree = new_tree + largetree = process_tree(indexfile, tree) + largetree.extend(appendices) + self.info() + self.info("resolving references...") + self.env.resolve_references(largetree, indexfile, self) + # resolve :ref:s to distant tex files -- we can't add a cross-reference, + # but append the document name + for pendingnode in largetree.traverse(addnodes.pending_xref): + docname = pendingnode['refdocname'] + sectname = pendingnode['refsectname'] + newnodes = [nodes.emphasis(sectname, sectname)] + for subdir, title in self.titles: + if docname.startswith(subdir): + newnodes.append(nodes.Text(_(' (in '), _(' (in '))) + newnodes.append(nodes.emphasis(title, title)) + newnodes.append(nodes.Text(')', ')')) + break + else: + pass + pendingnode.replace_self(newnodes) + return largetree + + def finish(self): + # copy image files + if self.images: + self.info(bold('copying images...'), nonl=1) + for src, dest in self.images.iteritems(): + self.info(' '+src, nonl=1) + shutil.copyfile(path.join(self.srcdir, src), + path.join(self.outdir, dest)) + self.info() + + # the logo is handled differently + if self.config.latex_logo: + logobase = path.basename(self.config.latex_logo) + shutil.copyfile(path.join(self.confdir, self.config.latex_logo), + path.join(self.outdir, logobase)) + + self.info(bold('copying TeX support files... '), nonl=True) + staticdirname = path.join(package_dir, 'texinputs') + for filename in os.listdir(staticdirname): + if not filename.startswith('.'): + shutil.copyfile(path.join(staticdirname, filename), + path.join(self.outdir, filename)) + self.info('done') Added: doctools/trunk/sphinx/builders/linkcheck.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/linkcheck.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.linkcheck + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + The CheckExternalLinksBuilder class. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import socket +from os import path +from urllib2 import build_opener, HTTPError + +from docutils import nodes + +from sphinx.builders import Builder +from sphinx.util.console import purple, red, darkgreen + +# create an opener that will simulate a browser user-agent +opener = build_opener() +opener.addheaders = [('User-agent', 'Mozilla/5.0')] + + +class CheckExternalLinksBuilder(Builder): + """ + Checks for broken external links. + """ + name = 'linkcheck' + + def init(self): + self.good = set() + self.broken = {} + self.redirected = {} + # set a timeout for non-responding servers + socket.setdefaulttimeout(5.0) + # create output file + open(path.join(self.outdir, 'output.txt'), 'w').close() + + def get_target_uri(self, docname, typ=None): + return '' + + def get_outdated_docs(self): + return self.env.found_docs + + def prepare_writing(self, docnames): + return + + def write_doc(self, docname, doctree): + self.info() + for node in doctree.traverse(nodes.reference): + try: + self.check(node, docname) + except KeyError: + continue + + def check(self, node, docname): + uri = node['refuri'] + + if '#' in uri: + uri = uri.split('#')[0] + + if uri in self.good: + return + + lineno = None + while lineno is None and node: + node = node.parent + lineno = node.line + + if uri[0:5] == 'http:' or uri[0:6] == 'https:': + self.info(uri, nonl=1) + + if uri in self.broken: + (r, s) = self.broken[uri] + elif uri in self.redirected: + (r, s) = self.redirected[uri] + else: + (r, s) = self.resolve(uri) + + if r == 0: + self.info(' - ' + darkgreen('working')) + self.good.add(uri) + elif r == 2: + self.info(' - ' + red('broken: ') + s) + self.write_entry('broken', docname, lineno, uri + ': ' + s) + self.broken[uri] = (r, s) + if self.app.quiet: + self.warn('%s:%s: broken link: %s' % (docname, lineno, uri)) + else: + self.info(' - ' + purple('redirected') + ' to ' + s) + self.write_entry('redirected', docname, lineno, uri + ' to ' + s) + self.redirected[uri] = (r, s) + elif len(uri) == 0 or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': + return + else: + self.warn(uri + ' - ' + red('malformed!')) + self.write_entry('malformed', docname, lineno, uri) + if self.app.quiet: + self.warn('%s:%s: malformed link: %s' % (docname, lineno, uri)) + self.app.statuscode = 1 + + if self.broken: + self.app.statuscode = 1 + + def write_entry(self, what, docname, line, uri): + output = open(path.join(self.outdir, 'output.txt'), 'a') + output.write("%s:%s: [%s] %s\n" % (self.env.doc2path(docname, None), + line, what, uri)) + output.close() + + def resolve(self, uri): + try: + f = opener.open(uri) + f.close() + except HTTPError, err: + #if err.code == 403 and uri.startswith('http://en.wikipedia.org/'): + # # Wikipedia blocks requests from urllib User-Agent + # return (0, 0) + return (2, str(err)) + except Exception, err: + return (2, str(err)) + if f.url.rstrip('/') == uri.rstrip('/'): + return (0, 0) + else: + return (1, f.url) + + def finish(self): + return Added: doctools/trunk/sphinx/builders/qthelp.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/qthelp.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,261 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.qthelp + ~~~~~~~~~~~~~~~~~~~~~~ + + Build input files for the Qt collection generator. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import re +import cgi +from os import path + +from docutils import nodes + +from sphinx import addnodes +from sphinx.builders.html import StandaloneHTMLBuilder + +_idpattern = re.compile('(?P.+) (\((?P<id>[\w\.]+)( (?P<descr>\w+))?\))$') + + +# Qt Help Collection Project (.qhcp). +# Is the input file for the help collection generator. +# It contains references to compressed help files which should be +# included in the collection. +# It may contain various other information for customizing Qt Assistant. +collection_template = '''\ +<?xml version="1.0" encoding="utf-8" ?> +<QHelpCollectionProject version="1.0"> + <docFiles> + <generate> + <file> + <input>%(outname)s.qhp</input> + <output>%(outname)s.qch</output> + </file> + </generate> + <register> + <file>%(outname)s.qch</file> + </register> + </docFiles> +</QHelpCollectionProject> +''' + +# Qt Help Project (.qhp) +# This is the input file for the help generator. +# It contains the table of contents, indices and references to the +# actual documentation files (*.html). +# In addition it defines a unique namespace for the documentation. +project_template = '''\ +<?xml version="1.0" encoding="UTF-8"?> +<QtHelpProject version="1.0"> + <namespace>%(outname)s.org.%(outname)s.%(nversion)s</namespace> + <virtualFolder>doc</virtualFolder> + <customFilter name="%(project)s %(version)s"> + <filterAttribute>%(outname)s</filterAttribute> + <filterAttribute>%(version)s</filterAttribute> + </customFilter> + <filterSection> + <filterAttribute>%(outname)s</filterAttribute> + <filterAttribute>%(version)s</filterAttribute> + <toc> + <section title="%(title)s" ref="%(masterdoc)s.html"> +%(sections)s + </section> + </toc> + <keywords> +%(keywords)s + </keywords> + <files> +%(files)s + </files> + </filterSection> +</QtHelpProject> +''' + +section_template = '<section title="%(title)s" ref="%(ref)s"/>' +file_template = ' '*12 + '<file>%(filename)s</file>' + + +class QtHelpBuilder(StandaloneHTMLBuilder): + """ + Builder that also outputs Qt help project, contents and index files. + """ + name = 'qthelp' + + # don't copy the reST source + copysource = False + supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', + 'image/jpeg'] + + # don't add links + add_permalinks = False + # don't add sidebar etc. + embedded = True + + def init(self): + StandaloneHTMLBuilder.init(self) + # the output files for HTML help must be .html only + self.out_suffix = '.html' + #self.config.html_style = 'traditional.css' + + def handle_finish(self): + self.build_qhcp(self.outdir, self.config.qthelp_basename) + self.build_qhp(self.outdir, self.config.qthelp_basename) + + def build_qhcp(self, outdir, outname): + self.info('writing collection project file...') + f = open(path.join(outdir, outname+'.qhcp'), 'w') + try: + f.write(collection_template % {'outname': outname}) + finally: + f.close() + + def build_qhp(self, outdir, outname): + self.info('writing project file...') + + # sections + tocdoc = self.env.get_and_resolve_doctree(self.config.master_doc, self, + prune_toctrees=False) + istoctree = lambda node: ( + isinstance(node, addnodes.compact_paragraph) + and node.has_key('toctree')) + sections = [] + for node in tocdoc.traverse(istoctree): + sections.extend(self.write_toc(node)) + + if self.config.html_use_modindex: + item = section_template % {'title': _('Global Module Index'), + 'ref': 'modindex.html'} + sections.append(' '*4*4 + item) + sections = '\n'.join(sections) + + # keywords + keywords = [] + index = self.env.create_index(self) + for (key, group) in index: + for title, (refs, subitems) in group: + keywords.extend(self.build_keywords(title, refs, subitems)) + keywords = '\n'.join(keywords) + + # files + if not outdir.endswith(os.sep): + outdir += os.sep + olen = len(outdir) + projectfiles = [] + for root, dirs, files in os.walk(outdir): + staticdir = (root == path.join(outdir, '_static')) + for fn in files: + if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'): + filename = path.join(root, fn)[olen:] + #filename = filename.replace(os.sep, '\\') # XXX + projectfiles.append(file_template % {'filename': filename}) + projectfiles = '\n'.join(projectfiles) + + # write the project file + f = open(path.join(outdir, outname+'.qhp'), 'w') + try: + nversion = self.config.version.replace('.', '_') + nversion = nversion.replace(' ', '_') + f.write(project_template % {'outname': outname, + 'title': self.config.html_title, + 'version': self.config.version, + 'project': self.config.project, + 'nversion': nversion, + 'masterdoc': self.config.master_doc, + 'sections': sections, + 'keywords': keywords, + 'files': projectfiles}) + finally: + f.close() + + def isdocnode(self, node): + if not isinstance(node, nodes.list_item): + return False + if len(node.children) != 2: + return False + if not isinstance(node.children[0], addnodes.compact_paragraph): + return False + if not isinstance(node.children[0][0], nodes.reference): + return False + if not isinstance(node.children[1], nodes.bullet_list): + return False + return True + + def write_toc(self, node, indentlevel=4): + parts = [] + if self.isdocnode(node): + refnode = node.children[0][0] + link = refnode['refuri'] + title = cgi.escape(refnode.astext()).replace('"','"') + item = '<section title="%(title)s" ref="%(ref)s">' % { + 'title': title, + 'ref': link} + parts.append(' '*4*indentlevel + item) + for subnode in node.children[1]: + parts.extend(self.write_toc(subnode, indentlevel+1)) + parts.append(' '*4*indentlevel + '</section>') + elif isinstance(node, nodes.list_item): + for subnode in node: + parts.extend(self.write_toc(subnode, indentlevel)) + elif isinstance(node, nodes.reference): + link = node['refuri'] + title = cgi.escape(node.astext()).replace('"','"') + item = section_template % {'title': title, 'ref': link} + item = ' '*4*indentlevel + item.encode('ascii', 'xmlcharrefreplace') + parts.append(item.encode('ascii', 'xmlcharrefreplace')) + elif isinstance(node, nodes.bullet_list): + for subnode in node: + parts.extend(self.write_toc(subnode, indentlevel)) + elif isinstance(node, addnodes.compact_paragraph): + for subnode in node: + parts.extend(self.write_toc(subnode, indentlevel)) + + return parts + + def keyword_item(self, name, ref): + matchobj = _idpattern.match(name) + if matchobj: + groupdict = matchobj.groupdict() + shortname = groupdict['title'] + id = groupdict.get('id') +# descr = groupdict.get('descr') + if shortname.endswith('()'): + shortname = shortname[:-2] + id = '%s.%s' % (id, shortname) + else: + id = descr = None + + if id: + item = ' '*12 + '<keyword name="%s" id="%s" ref="%s"/>' % ( + name, id, ref) + else: + item = ' '*12 + '<keyword name="%s" ref="%s"/>' % (name, ref) + item.encode('ascii', 'xmlcharrefreplace') + return item + + def build_keywords(self, title, refs, subitems): + keywords = [] + + title = cgi.escape(title) +# if len(refs) == 0: # XXX +# write_param('See Also', title) + if len(refs) == 1: + keywords.append(self.keyword_item(title, refs[0])) + elif len(refs) > 1: + for i, ref in enumerate(refs): # XXX +# item = (' '*12 + +# '<keyword name="%s [%d]" ref="%s"/>' % ( +# title, i, ref)) +# item.encode('ascii', 'xmlcharrefreplace') +# keywords.append(item) + keywords.append(self.keyword_item(title, ref)) + + if subitems: + for subitem in subitems: + keywords.extend(self.build_keywords(subitem[0], subitem[1], [])) + + return keywords Added: doctools/trunk/sphinx/builders/text.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/builders/text.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.text + ~~~~~~~~~~~~~~~~~~~~ + + Plain-text Sphinx builder. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +from os import path + +from docutils.io import StringOutput + +from sphinx.util import ensuredir, os_path +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + + +class TextBuilder(Builder): + name = 'text' + out_suffix = '.txt' + + def init(self): + pass + + def get_outdated_docs(self): + for docname in self.env.found_docs: + if docname not in self.env.all_docs: + yield docname + continue + targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) + try: + targetmtime = path.getmtime(targetname) + except Exception: + targetmtime = 0 + try: + srcmtime = path.getmtime(self.env.doc2path(docname)) + if srcmtime > targetmtime: + yield docname + except EnvironmentError: + # source doesn't exist anymore + pass + + def get_target_uri(self, docname, typ=None): + return '' + + def prepare_writing(self, docnames): + self.writer = TextWriter(self) + + def write_doc(self, docname, doctree): + destination = StringOutput(encoding='utf-8') + self.writer.write(doctree, destination) + outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix) + ensuredir(path.dirname(outfilename)) # normally different from self.outdir + try: + f = codecs.open(outfilename, 'w', 'utf-8') + try: + f.write(self.writer.output) + finally: + f.close() + except (IOError, OSError), err: + self.warn("Error writing file %s: %s" % (outfilename, err)) + + def finish(self): + pass Modified: doctools/trunk/sphinx/cmdline.py ============================================================================== --- doctools/trunk/sphinx/cmdline.py (original) +++ doctools/trunk/sphinx/cmdline.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ sphinx-build command-line handling. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import os Modified: doctools/trunk/sphinx/config.py ============================================================================== --- doctools/trunk/sphinx/config.py (original) +++ doctools/trunk/sphinx/config.py Sun Jan 4 21:38:57 2009 @@ -5,13 +5,15 @@ Build configuration file handling. - :copyright: 2008 by Georg Brandl. - :license: BSD license. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import os from os import path +from sphinx.util import make_filename + class Config(object): """Configuration file abstraction.""" @@ -65,16 +67,22 @@ html_sidebars = ({}, False), html_additional_pages = ({}, False), html_use_modindex = (True, False), + html_add_permalinks = (True, False), html_use_index = (True, False), html_split_index = (False, False), html_copy_source = (True, False), + html_show_sourcelink = (True, False), html_use_opensearch = ('', False), html_file_suffix = (None, False), + html_link_suffix = (None, False), html_show_sphinx = (True, False), html_context = ({}, False), # HTML help only options - htmlhelp_basename = ('pydoc', False), + htmlhelp_basename = (lambda self: make_filename(self.project), False), + + # Qt help only options + qthelp_basename = (lambda self: make_filename(self.project), False), # LaTeX options latex_documents = ([], False), @@ -111,6 +119,12 @@ def init_values(self): config = self._raw_config + for valname, value in self.overrides.iteritems(): + if '.' in valname: + realvalname, key = valname.split('.', 1) + config.setdefault(realvalname, {})[key] = value + else: + config[valname] = value config.update(self.overrides) for name in config: if name in self.values: Modified: doctools/trunk/sphinx/directives/__init__.py ============================================================================== --- doctools/trunk/sphinx/directives/__init__.py (original) +++ doctools/trunk/sphinx/directives/__init__.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Handlers for additional ReST directives. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from sphinx.directives.desc import * Modified: doctools/trunk/sphinx/directives/code.py ============================================================================== --- doctools/trunk/sphinx/directives/code.py (original) +++ doctools/trunk/sphinx/directives/code.py Sun Jan 4 21:38:57 2009 @@ -3,8 +3,8 @@ sphinx.directives.code ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys @@ -15,6 +15,7 @@ from docutils.parsers.rst import directives from sphinx import addnodes +from sphinx.util import parselinenos # ------ highlight directive -------------------------------------------------------- @@ -68,32 +69,78 @@ lineno - state_machine.input_offset - 1))) fn = path.normpath(path.join(source_dir, rel_fn)) + if 'pyobject' in options and 'lines' in options: + return [state.document.reporter.warning( + 'Cannot use both "pyobject" and "lines" options', line=lineno)] + encoding = options.get('encoding', env.config.source_encoding) try: f = codecs.open(fn, 'r', encoding) - text = f.read() + lines = f.readlines() f.close() except (IOError, OSError): - retnode = state.document.reporter.warning( - 'Include file %r not found or reading it failed' % arguments[0], line=lineno) + return [state.document.reporter.warning( + 'Include file %r not found or reading it failed' % arguments[0], + line=lineno)] except UnicodeError: - retnode = state.document.reporter.warning( + return [state.document.reporter.warning( 'Encoding %r used for reading included file %r seems to ' 'be wrong, try giving an :encoding: option' % - (encoding, arguments[0])) - else: - retnode = nodes.literal_block(text, text, source=fn) - retnode.line = 1 - if options.get('language', ''): - retnode['language'] = options['language'] - if 'linenos' in options: - retnode['linenos'] = True - state.document.settings.env.note_dependency(rel_fn) + (encoding, arguments[0]))] + + objectname = options.get('pyobject') + if objectname is not None: + from sphinx.pycode import ModuleAnalyzer + analyzer = ModuleAnalyzer.for_file(fn, '') + tags = analyzer.find_tags() + if objectname not in tags: + return [state.document.reporter.warning( + 'Object named %r not found in include file %r' % + (objectname, arguments[0]), line=lineno)] + else: + lines = lines[tags[objectname][1] - 1 : tags[objectname][2] - 1] + + linespec = options.get('lines') + if linespec is not None: + try: + linelist = parselinenos(linespec, len(lines)) + except ValueError, err: + return [state.document.reporter.warning(str(err), line=lineno)] + lines = [lines[i] for i in linelist] + + startafter = options.get('start-after') + endbefore = options.get('end-before') + if startafter is not None or endbefore is not None: + use = not startafter + res = [] + for line in lines: + if not use and startafter in line: + use = True + elif use and endbefore in line: + use = False + break + elif use: + res.append(line) + lines = res + + text = ''.join(lines) + retnode = nodes.literal_block(text, text, source=fn) + retnode.line = 1 + if options.get('language', ''): + retnode['language'] = options['language'] + if 'linenos' in options: + retnode['linenos'] = True + state.document.settings.env.note_dependency(rel_fn) return [retnode] literalinclude_directive.options = {'linenos': directives.flag, - 'language': directives.unchanged, - 'encoding': directives.encoding} + 'language': directives.unchanged_required, + 'encoding': directives.encoding, + 'pyobject': directives.unchanged_required, + 'lines': directives.unchanged_required, + 'start-after': directives.unchanged_required, + 'end-before': directives.unchanged_required, + } literalinclude_directive.content = 0 literalinclude_directive.arguments = (1, 0, 0) directives.register_directive('literalinclude', literalinclude_directive) Modified: doctools/trunk/sphinx/directives/desc.py ============================================================================== --- doctools/trunk/sphinx/directives/desc.py (original) +++ doctools/trunk/sphinx/directives/desc.py Sun Jan 4 21:38:57 2009 @@ -3,8 +3,8 @@ sphinx.directives.desc ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re @@ -58,6 +58,18 @@ return _('%s() (%s.%s static method)') % (methname, module, clsname) else: return _('%s() (%s static method)') % (methname, clsname) + elif desctype == 'classmethod': + try: + clsname, methname = name.rsplit('.', 1) + except ValueError: + if module: + return '%s() (in module %s)' % (name, module) + else: + return '%s()' % name + if module: + return '%s() (%s.%s class method)' % (methname, module, clsname) + else: + return '%s() (%s class method)' % (methname, clsname) elif desctype == 'attribute': try: clsname, attrname = name.rsplit('.', 1) @@ -118,12 +130,27 @@ del _ + +def _is_only_paragraph(node): + # determine if the node only contains one paragraph (and system messages) + if len(node) == 0: + return False + elif len(node) > 1: + for subnode in node[1:]: + if not isinstance(subnode, nodes.system_message): + return False + if isinstance(node[0], nodes.paragraph): + return True + return False + + def handle_doc_fields(node, env): # don't traverse, only handle field lists that are immediate children for child in node.children: if not isinstance(child, nodes.field_list): continue - params = None + params = [] + pfield = None param_nodes = {} param_types = {} new_list = nodes.field_list() @@ -132,18 +159,14 @@ try: typ, obj = fname.astext().split(None, 1) typdesc = _(doc_fields_with_arg[typ]) - if len(fbody.children) == 1 and \ - isinstance(fbody.children[0], nodes.paragraph): + if _is_only_paragraph(fbody): children = fbody.children[0].children else: children = fbody.children if typdesc == '%param': if not params: + # add the field that later gets all the parameters pfield = nodes.field() - pfield += nodes.field_name('', _('Parameters')) - pfield += nodes.field_body() - params = nodes.bullet_list() - pfield[1] += params new_list += pfield dlitem = nodes.list_item() dlpar = nodes.paragraph() @@ -152,9 +175,13 @@ dlpar += children param_nodes[obj] = dlpar dlitem += dlpar - params += dlitem + params.append(dlitem) elif typdesc == '%type': - param_types[obj] = fbody.astext() + typenodes = fbody.children + if _is_only_paragraph(fbody): + typenodes = [nodes.Text(' (')] + \ + typenodes[0].children + [nodes.Text(')')] + param_types[obj] = typenodes else: fieldname = typdesc + ' ' nfield = nodes.field() @@ -181,9 +208,20 @@ typ = fnametext.capitalize() fname[0] = nodes.Text(typ) new_list += field + if params: + if len(params) == 1: + pfield += nodes.field_name('', _('Parameter')) + pfield += nodes.field_body() + pfield[1] += params[0][0] + else: + pfield += nodes.field_name('', _('Parameters')) + pfield += nodes.field_body() + pfield[1] += nodes.bullet_list() + pfield[1][0].extend(params) + for param, type in param_types.iteritems(): if param in param_nodes: - param_nodes[param].insert(1, nodes.Text(' (%s)' % type)) + param_nodes[param][1:1] = type child.replace_self(new_list) @@ -192,8 +230,9 @@ py_sig_re = re.compile( r'''^ ([\w.]*\.)? # class name(s) (\w+) \s* # thing name - (?: \((.*)\) # optional arguments - (\s* -> \s* .*)? )? $ # optional return annotation + (?: \((.*)\) # optional: arguments + (?:\s* -> \s* (.*))? # return annotation + )? $ # and nothing more ''', re.VERBOSE) py_paramlist_re = re.compile(r'([\[\],])') # split at '[', ']' and ',' @@ -212,9 +251,6 @@ raise ValueError classname, name, arglist, retann = m.groups() - if retann: - retann = u' \N{RIGHTWARDS ARROW} ' + retann.strip()[2:] - if env.currclass: add_module = False if classname and classname.startswith(env.currclass): @@ -234,6 +270,8 @@ if desctype == 'staticmethod': signode += addnodes.desc_annotation('static ', 'static ') + elif desctype == 'classmethod': + signode += addnodes.desc_annotation('classmethod ', 'classmethod ') if classname: signode += addnodes.desc_addname(classname, classname) @@ -246,11 +284,11 @@ signode += addnodes.desc_name(name, name) if not arglist: - if desctype in ('function', 'method', 'staticmethod'): + if desctype in ('function', 'method', 'staticmethod', 'classmethod'): # for callables, add an empty parameter list signode += addnodes.desc_parameterlist() if retann: - signode += addnodes.desc_type(retann, retann) + signode += addnodes.desc_returns(retann, retann) return fullname, classname signode += addnodes.desc_parameterlist() @@ -273,7 +311,7 @@ if len(stack) != 1: raise ValueError if retann: - signode += addnodes.desc_type(retann, retann) + signode += addnodes.desc_returns(retann, retann) return fullname, classname @@ -302,7 +340,7 @@ # add cross-ref nodes for all words for part in filter(None, wsplit_re.split(ctype)): tnode = nodes.Text(part, part) - if part[0] in string.letters+'_' and part not in stopwords: + if part[0] in string.ascii_letters+'_' and part not in stopwords: pnode = addnodes.pending_xref( '', reftype='ctype', reftarget=part, modname=None, classname=None) pnode += tnode @@ -409,7 +447,8 @@ node.append(signode) try: if desctype in ('function', 'data', 'class', 'exception', - 'method', 'staticmethod', 'attribute'): + 'method', 'staticmethod', 'classmethod', + 'attribute'): name, clsname = parse_py_signature(signode, sig, desctype, module, env) elif desctype in ('cfunction', 'cmember', 'cmacro', 'ctype', 'cvar'): name = parse_c_signature(signode, sig, desctype) @@ -486,8 +525,8 @@ if desctype in ('class', 'exception') and names: env.currclass = names[0] clsname_set = True - elif desctype in ('method', 'staticmethod', 'attribute') and \ - clsname and not env.currclass: + elif desctype in ('method', 'staticmethod', 'classmethod', + 'attribute') and clsname and not env.currclass: env.currclass = clsname.strip('.') clsname_set = True # needed for association of version{added,changed} directives @@ -512,6 +551,7 @@ 'data', 'class', 'method', + 'classmethod', 'staticmethod', 'attribute', 'exception', Modified: doctools/trunk/sphinx/directives/other.py ============================================================================== --- doctools/trunk/sphinx/directives/other.py (original) +++ doctools/trunk/sphinx/directives/other.py Sun Jan 4 21:38:57 2009 @@ -3,19 +3,18 @@ sphinx.directives.other ~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re -import posixpath from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.locale import pairindextypes -from sphinx.util import patfilter, ws_re, caption_ref_re +from sphinx.util import patfilter, ws_re, caption_ref_re, docname_join from sphinx.util.compat import make_admonition @@ -25,11 +24,9 @@ content_offset, block_text, state, state_machine): env = state.document.settings.env suffix = env.config.source_suffix - dirname = posixpath.dirname(env.docname) glob = 'glob' in options ret = [] - subnode = addnodes.toctree() includefiles = [] includetitles = {} all_docnames = env.found_docs.copy() @@ -50,14 +47,14 @@ if docname.endswith(suffix): docname = docname[:-len(suffix)] # absolutize filenames - docname = posixpath.normpath(posixpath.join(dirname, docname)) + docname = docname_join(env.docname, docname) if docname not in env.found_docs: ret.append(state.document.reporter.warning( 'toctree references unknown document %r' % docname, line=lineno)) else: includefiles.append(docname) else: - patname = posixpath.normpath(posixpath.join(dirname, entry)) + patname = docname_join(env.docname, entry) docnames = sorted(patfilter(all_docnames, patname)) for docname in docnames: all_docnames.remove(docname) # don't include it again @@ -66,15 +63,18 @@ ret.append(state.document.reporter.warning( 'toctree glob pattern %r didn\'t match any documents' % entry, line=lineno)) + subnode = addnodes.toctree() subnode['includefiles'] = includefiles subnode['includetitles'] = includetitles subnode['maxdepth'] = options.get('maxdepth', -1) subnode['glob'] = glob + subnode['hidden'] = 'hidden' in options ret.append(subnode) return ret toctree_directive.content = 1 -toctree_directive.options = {'maxdepth': int, 'glob': directives.flag} +toctree_directive.options = {'maxdepth': int, 'glob': directives.flag, + 'hidden': directives.flag} directives.register_directive('toctree', toctree_directive) Modified: doctools/trunk/sphinx/environment.py ============================================================================== --- doctools/trunk/sphinx/environment.py (original) +++ doctools/trunk/sphinx/environment.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Global creation environment. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re @@ -15,11 +15,12 @@ import heapq import types import imghdr +import string import difflib import cPickle as pickle from os import path from glob import glob -from string import uppercase +from string import ascii_uppercase as uppercase from itertools import izip, groupby try: import hashlib @@ -42,7 +43,8 @@ from docutils.transforms.parts import ContentsFilter from sphinx import addnodes -from sphinx.util import get_matching_docs, SEP, ustrftime +from sphinx.util import get_matching_docs, SEP, ustrftime, docname_join, \ + FilenameUniqDict from sphinx.directives import additional_xref_types default_settings = { @@ -57,7 +59,7 @@ # This is increased every time an environment attribute is added # or changed to properly invalidate pickle files. -ENV_VERSION = 26 +ENV_VERSION = 27 default_substitutions = set([ @@ -203,7 +205,9 @@ self.set_warnfunc(None) values = self.config.values del self.config.values - picklefile = open(filename, 'wb') + # first write to a temporary file, so that if dumping fails, the existing + # environment won't be overwritten + picklefile = open(filename + '.tmp', 'wb') # remove potentially pickling-problematic values from config for key, val in vars(self.config).items(): if key.startswith('_') or \ @@ -215,6 +219,7 @@ pickle.dump(self, picklefile, pickle.HIGHEST_PROTOCOL) finally: picklefile.close() + os.rename(filename + '.tmp', filename) # reset attributes self.config.values = values self.set_warnfunc(warnfunc) @@ -276,7 +281,8 @@ # (type, string, target, aliasname) self.versionchanges = {} # version -> list of # (type, docname, lineno, module, descname, content) - self.images = {} # absolute path -> (docnames, unique filename) + self.images = FilenameUniqDict() # absolute path -> (docnames, unique filename) + self.dlfiles = FilenameUniqDict() # absolute path -> (docnames, unique filename) # These are set while parsing a file self.docname = None # current document name @@ -288,9 +294,12 @@ self.gloss_entries = set() # existing definition labels # Some magically present labels - self.labels['genindex'] = ('genindex', '', _('Index')) - self.labels['modindex'] = ('modindex', '', _('Module Index')) - self.labels['search'] = ('search', '', _('Search Page')) + def add_magic_label(name, description): + self.labels[name] = (name, '', description) + self.anonlabels[name] = (name, '') + add_magic_label('genindex', _('Index')) + add_magic_label('modindex', _('Module Index')) + add_magic_label('search', _('Search Page')) def set_warnfunc(self, func): self._warnfunc = func @@ -317,6 +326,8 @@ self.filemodules.pop(docname, None) self.indexentries.pop(docname, None) self.glob_toctrees.discard(docname) + self.images.purge_doc(docname) + self.dlfiles.purge_doc(docname) for subfn, fnset in self.files_to_rebuild.items(): fnset.discard(docname) @@ -340,10 +351,6 @@ for version, changes in self.versionchanges.items(): new = [change for change in changes if change[1] != docname] changes[:] = new - for fullpath, (docs, _) in self.images.items(): - docs.discard(docname) - if not docs: - del self.images[fullpath] def doc2path(self, docname, base=True, suffix=None): """ @@ -480,12 +487,6 @@ self.doc2path(config.master_doc)) self.app = None - - # remove all non-existing images from inventory - for imgsrc in self.images.keys(): - if not os.access(path.join(self.srcdir, imgsrc), os.R_OK): - del self.images[imgsrc] - if app: app.emit('env-updated', self) @@ -544,6 +545,7 @@ self.filter_messages(doctree) self.process_dependencies(docname, doctree) self.process_images(docname, doctree) + self.process_downloads(docname, doctree) self.process_metadata(docname, doctree) self.create_title_from(docname, doctree) self.note_labels_from(docname, doctree) @@ -608,11 +610,25 @@ dep = path.join(docdir, dep) self.dependencies.setdefault(docname, set()).add(dep) + def process_downloads(self, docname, doctree): + """ + Process downloadable file paths. + """ + docdir = path.dirname(self.doc2path(docname, base=None)) + for node in doctree.traverse(addnodes.download_reference): + filepath = path.normpath(path.join(docdir, node['reftarget'])) + self.dependencies.setdefault(docname, set()).add(filepath) + if not os.access(path.join(self.srcdir, filepath), os.R_OK): + self.warn(docname, 'Download file not readable: %s' % filepath, + getattr(node, 'line', None)) + continue + uniquename = self.dlfiles.add_file(docname, filepath) + node['filename'] = uniquename + def process_images(self, docname, doctree): """ Process and rewrite image URIs. """ - existing_names = set(v[1] for v in self.images.itervalues()) docdir = path.dirname(self.doc2path(docname, base=None)) for node in doctree.traverse(nodes.image): # Map the mimetype to the corresponding image. The writer may @@ -625,15 +641,17 @@ self.warn(docname, 'Nonlocal image URI found: %s' % imguri, node.line) candidates['?'] = imguri continue + # imgpath is the image path *from srcdir* imgpath = path.normpath(path.join(docdir, imguri)) + # set imgpath as default URI node['uri'] = imgpath if imgpath.endswith(os.extsep + '*'): for filename in glob(path.join(self.srcdir, imgpath)): - relname = relative_path(self.srcdir, filename) + new_imgpath = relative_path(self.srcdir, filename) if filename.lower().endswith('.pdf'): - candidates['application/pdf'] = path.join(docdir, relname) + candidates['application/pdf'] = new_imgpath elif filename.lower().endswith('.svg'): - candidates['image/svg+xml'] = path.join(docdir, relname) + candidates['image/svg+xml'] = new_imgpath else: try: f = open(filename, 'rb') @@ -644,25 +662,18 @@ except (OSError, IOError): self.warn(docname, 'Image file %s not readable' % filename) if imgtype: - candidates['image/' + imgtype] = path.join(docdir, relname) + candidates['image/' + imgtype] = new_imgpath else: candidates['*'] = imgpath + # map image paths to unique image names (so that they can be put + # into a single directory) for imgpath in candidates.itervalues(): self.dependencies.setdefault(docname, set()).add(imgpath) if not os.access(path.join(self.srcdir, imgpath), os.R_OK): self.warn(docname, 'Image file not readable: %s' % imgpath, node.line) - if imgpath in self.images: - self.images[imgpath][0].add(docname) continue - uniquename = path.basename(imgpath) - base, ext = path.splitext(uniquename) - i = 0 - while uniquename in existing_names: - i += 1 - uniquename = '%s%s%s' % (base, i, ext) - self.images[imgpath] = (set([docname]), uniquename) - existing_names.add(uniquename) + self.images.add_file(docname, imgpath) def process_metadata(self, docname, doctree): """ @@ -898,6 +909,8 @@ If *titles_only* is True, only toplevel document titles will be in the resulting tree. """ + if toctree.get('hidden', False): + return None def _walk_depth(node, depth, maxdepth, titleoverrides): """Utility: Cut a TOC at a specified depth.""" @@ -911,7 +924,7 @@ else: _walk_depth(subnode, depth+1, maxdepth, titleoverrides) - def _entries_from_toctree(toctreenode, separate=False): + def _entries_from_toctree(toctreenode, separate=False, subtree=False): """Return TOC entries for a toctree node.""" includefiles = map(str, toctreenode['includefiles']) @@ -941,7 +954,7 @@ # resolve all sub-toctrees for toctreenode in toc.traverse(addnodes.toctree): i = toctreenode.parent.index(toctreenode) + 1 - for item in _entries_from_toctree(toctreenode): + for item in _entries_from_toctree(toctreenode, subtree=True): toctreenode.parent.insert(i, item) i += 1 toctreenode.parent.remove(toctreenode) @@ -949,12 +962,19 @@ entries.append(toc) else: entries.extend(toc.children) + if not subtree and not separate: + ret = nodes.bullet_list() + ret += entries + return [ret] return entries maxdepth = maxdepth or toctree.get('maxdepth', -1) titleoverrides = toctree.get('includetitles', {}) - tocentries = _entries_from_toctree(toctree, separate=True) + # NOTE: previously, this was separate=True, but that leads to artificial + # separation when two or more toctree entries form a logical unit, so + # separating mode is no longer used -- it's kept here for history's sake + tocentries = _entries_from_toctree(toctree, separate=False) if not tocentries: return None @@ -1023,6 +1043,24 @@ if labelid: newnode['refuri'] += '#' + labelid newnode.append(innernode) + elif typ == 'doc': + # directly reference to document by source name; can be absolute + # or relative + docname = docname_join(fromdocname, target) + if docname not in self.all_docs: + newnode = doctree.reporter.system_message( + 2, 'unknown document: %s' % docname) + else: + if node['refcaption']: + # reference with explicit title + caption = node.astext() + else: + caption = self.titles[docname].astext() + innernode = nodes.emphasis(caption, caption) + newnode = nodes.reference('', '') + newnode['refuri'] = builder.get_relative_uri( + fromdocname, docname) + newnode.append(innernode) elif typ == 'keyword': # keywords are referenced by named labels docname, labelid, _ = self.labels.get(target, ('','','')) Modified: doctools/trunk/sphinx/ext/__init__.py ============================================================================== --- doctools/trunk/sphinx/ext/__init__.py (original) +++ doctools/trunk/sphinx/ext/__init__.py Sun Jan 4 21:38:57 2009 @@ -5,6 +5,6 @@ Contains Sphinx features not activated by default. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ Modified: doctools/trunk/sphinx/ext/autodoc.py ============================================================================== --- doctools/trunk/sphinx/ext/autodoc.py (original) +++ doctools/trunk/sphinx/ext/autodoc.py Sun Jan 4 21:38:57 2009 @@ -7,46 +7,57 @@ the doctree, thus avoiding duplication between docstrings and documentation for those who like elaborate docstrings. - :copyright: 2008 by Georg Brandl, Pauli Virtanen, Martin Hans. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re import sys -import types import inspect import linecache -from types import FunctionType, BuiltinMethodType, MethodType +from types import FunctionType, BuiltinFunctionType, MethodType, ClassType from docutils import nodes from docutils.parsers.rst import directives from docutils.statemachine import ViewList -from sphinx.util import rpartition, nested_parse_with_titles -from sphinx.directives.desc import py_sig_re +from sphinx.util import rpartition, nested_parse_with_titles, force_decode +from sphinx.pycode import ModuleAnalyzer, PycodeError +from sphinx.util.docstrings import prepare_docstring +clstypes = (type, ClassType) try: base_exception = BaseException except NameError: base_exception = Exception -_charset_re = re.compile(r'coding[:=]\s*([-\w.]+)') -_module_charsets = {} + +py_ext_sig_re = re.compile( + r'''^ ([\w.]+::)? # explicit module name + ([\w.]+\.)? # module and/or class name(s) + (\w+) \s* # thing name + (?: \((.*)\) # optional: arguments + (?:\s* -> \s* (.*))? # return annotation + )? $ # and nothing more + ''', re.VERBOSE) class Options(object): pass -def is_static_method(obj): - """Check if the object given is a static method.""" - if isinstance(obj, (FunctionType, classmethod)): - return True - elif isinstance(obj, BuiltinMethodType): - return obj.__self__ is not None - elif isinstance(obj, MethodType): - return obj.im_self is not None - return False +def get_method_type(obj): + """ + Return the method type for an object: method, staticmethod or classmethod. + """ + if isinstance(obj, classmethod) or \ + (isinstance(obj, MethodType) and obj.im_self is not None): + return 'classmethod' + elif isinstance(obj, FunctionType) or \ + (isinstance(obj, BuiltinFunctionType) and obj.__self__ is not None): + return 'staticmethod' + else: + return 'method' class AutodocReporter(object): @@ -160,56 +171,6 @@ return False -def prepare_docstring(s): - """ - Convert a docstring into lines of parseable reST. Return it as a list of - lines usable for inserting into a docutils ViewList (used as argument - of nested_parse().) An empty line is added to act as a separator between - this docstring and following content. - """ - lines = s.expandtabs().splitlines() - # Find minimum indentation of any non-blank lines after first line. - margin = sys.maxint - for line in lines[1:]: - content = len(line.lstrip()) - if content: - indent = len(line) - content - margin = min(margin, indent) - # Remove indentation. - if lines: - lines[0] = lines[0].lstrip() - if margin < sys.maxint: - for i in range(1, len(lines)): lines[i] = lines[i][margin:] - # Remove any leading blank lines. - while lines and not lines[0]: - lines.pop(0) - # make sure there is an empty line at the end - if lines and lines[-1]: - lines.append('') - return lines - - -def get_module_charset(module): - """Return the charset of the given module (cached in _module_charsets).""" - if module in _module_charsets: - return _module_charsets[module] - try: - filename = __import__(module, None, None, ['foo']).__file__ - except (ImportError, AttributeError): - return None - if filename[-4:].lower() in ('.pyc', '.pyo'): - filename = filename[:-1] - for line in [linecache.getline(filename, x) for x in (1, 2)]: - match = _charset_re.search(line) - if match is not None: - charset = match.group(1) - break - else: - charset = 'ascii' - _module_charsets[module] = charset - return charset - - class RstGenerator(object): def __init__(self, options, document, lineno): self.options = options @@ -223,15 +184,19 @@ def warn(self, msg): self.warnings.append(self.reporter.warning(msg, line=self.lineno)) - def get_doc(self, what, name, obj): - """Format and yield lines of the docstring(s) for the object.""" + def get_doc(self, what, obj, encoding=None): + """Decode and return lines of the docstring(s) for the object.""" docstrings = [] + + # add the regular docstring if present if getattr(obj, '__doc__', None): docstrings.append(obj.__doc__) - # skip some lines in module docstrings if configured + + # skip some lines in module docstrings if configured (deprecated!) if what == 'module' and self.env.config.automodule_skip_lines and docstrings: docstrings[0] = '\n'.join(docstrings[0].splitlines() [self.env.config.automodule_skip_lines:]) + # for classes, what the "docstring" is can be controlled via an option if what in ('class', 'exception'): content = self.env.config.autoclass_content @@ -244,27 +209,16 @@ if content == 'init': docstrings = [initdocstring] else: - docstrings.append('\n\n' + initdocstring) + docstrings.append(initdocstring) # the default is only the class docstring - # decode the docstrings using the module's source encoding - charset = None - module = getattr(obj, '__module__', None) - if module is not None: - charset = get_module_charset(module) - - for docstring in docstrings: - if isinstance(docstring, str): - if charset: - docstring = docstring.decode(charset) - else: - try: - # try decoding with utf-8, should only work for real UTF-8 - docstring = docstring.decode('utf-8') - except UnicodeError: - # last resort -- can't fail - docstring = docstring.decode('latin1') - docstringlines = prepare_docstring(docstring) + # make sure we have Unicode docstrings, then sanitize and split into lines + return [prepare_docstring(force_decode(docstring, encoding)) + for docstring in docstrings] + + def process_doc(self, docstrings, what, name, obj): + """Let the user process the docstrings.""" + for docstringlines in docstrings: if self.env.app: # let extensions preprocess docstrings self.env.app.emit('autodoc-process-docstring', @@ -282,58 +236,71 @@ # first, parse the definition -- auto directives for classes and functions # can contain a signature which is then used instead of an autogenerated one try: - path, base, args, retann = py_sig_re.match(name).groups() + mod, path, base, args, retann = py_ext_sig_re.match(name).groups() except: self.warn('invalid signature for auto%s (%r)' % (what, name)) - return - # fullname is the fully qualified name, base the name after the last dot - fullname = (path or '') + base + return None, [], None, None + + # support explicit module and class name separation via :: + if mod is not None: + mod = mod[:-2] + parents = path and path.rstrip('.').split('.') or [] + else: + parents = [] if what == 'module': + if mod is not None: + self.warn('"::" in automodule name doesn\'t make sense') if args or retann: self.warn('ignoring signature arguments and return annotation ' - 'for automodule %s' % fullname) - return fullname, fullname, [], None, None + 'for automodule %s' % name) + return (path or '') + base, [], None, None - elif what in ('class', 'exception', 'function'): - if path: - mod = path.rstrip('.') - else: - mod = None - # if documenting a toplevel object without explicit module, it can - # be contained in another auto directive ... - if hasattr(self.env, 'autodoc_current_module'): + elif what in ('exception', 'function', 'class', 'data'): + if mod is None: + if path: + mod = path.rstrip('.') + else: + # if documenting a toplevel object without explicit module, it can + # be contained in another auto directive ... + if hasattr(self.env, 'autodoc_current_module'): + mod = self.env.autodoc_current_module + # ... or in the scope of a module directive + if not mod: + mod = self.env.currmodule + return mod, parents + [base], args, retann + + else: + if mod is None: + if path: + mod_cls = path.rstrip('.') + else: + mod_cls = None + # if documenting a class-level object without path, there must be a + # current class, either from a parent auto directive ... + if hasattr(self.env, 'autodoc_current_class'): + mod_cls = self.env.autodoc_current_class + # ... or from a class directive + if mod_cls is None: + mod_cls = self.env.currclass + # ... if still None, there's no way to know + if mod_cls is None: + return None, [], None, None + mod, cls = rpartition(mod_cls, '.') + parents = [cls] + # if the module name is still missing, get it like above + if not mod and hasattr(self.env, 'autodoc_current_module'): mod = self.env.autodoc_current_module - # ... or in the scope of a module directive if not mod: mod = self.env.currmodule - return fullname, mod, [base], args, retann - - else: - if path: - mod_cls = path.rstrip('.') - else: - mod_cls = None - # if documenting a class-level object without path, there must be a - # current class, either from a parent auto directive ... - if hasattr(self.env, 'autodoc_current_class'): - mod_cls = self.env.autodoc_current_class - # ... or from a class directive - if mod_cls is None: - mod_cls = self.env.currclass - mod, cls = rpartition(mod_cls, '.') - # if the module name is still missing, get it like above - if not mod and hasattr(self.env, 'autodoc_current_module'): - mod = self.env.autodoc_current_module - if not mod: - mod = self.env.currmodule - return fullname, mod, [cls, base], args, retann + return mod, parents + [base], args, retann def format_signature(self, what, name, obj, args, retann): """ Return the signature of the object, formatted for display. """ - if what not in ('class', 'method', 'function'): + if what not in ('class', 'method', 'staticmethod', 'classmethod', + 'function'): return '' err = None @@ -358,7 +325,8 @@ getargs = False if getargs: argspec = inspect.getargspec(obj) - if what in ('class', 'method') and argspec[0] and \ + if what in ('class', 'method', 'staticmethod', + 'classmethod') and argspec[0] and \ argspec[0][0] in ('cls', 'self'): del argspec[0][0] args = inspect.formatargspec(*argspec) @@ -372,38 +340,35 @@ args, retann = result if args is not None: - return '%s%s' % (args, retann or '') + return '%s%s' % (args, retann and (' -> %s' % retann) or '') elif err: # re-raise the error for perusal of the handler in generate() raise RuntimeError(err) else: return '' - def generate(self, what, name, members, add_content, indent=u'', check_module=False): + def generate(self, what, name, members, add_content, indent=u'', check_module=False, + no_docstring=False): """ Generate reST for the object in self.result. """ - fullname, mod, objpath, args, retann = self.resolve_name(what, name) + mod, objpath, args, retann = self.resolve_name(what, name) if not mod: # need a module to import self.warn('don\'t know which module to import for autodocumenting %r ' '(try placing a "module" or "currentmodule" directive in the ' - 'document, or giving an explicit module name)' % fullname) + 'document, or giving an explicit module name)' % name) return + # fully-qualified name + fullname = mod + (objpath and '.' + '.'.join(objpath) or '') # the name to put into the generated directive -- doesn't contain the module name_in_directive = '.'.join(objpath) or mod # now, import the module and get object to document try: - todoc = module = __import__(mod, None, None, ['foo']) - if hasattr(module, '__file__') and module.__file__: - modfile = module.__file__ - if modfile[-4:].lower() in ('.pyc', '.pyo'): - modfile = modfile[:-1] - self.filename_set.add(modfile) - else: - modfile = None # e.g. for builtin and C modules + __import__(mod) + todoc = module = sys.modules[mod] for part in objpath: todoc = getattr(todoc, part) except (ImportError, AttributeError), err: @@ -412,28 +377,39 @@ (what, str(fullname), err)) return + # try to also get a source code analyzer for attribute docs + try: + analyzer = ModuleAnalyzer.for_module(mod) + except PycodeError, err: + # no source file -- e.g. for builtin and C modules + analyzer = None + else: + self.filename_set.add(analyzer.srcname) + # check __module__ of object if wanted (for members not given explicitly) if check_module: if hasattr(todoc, '__module__'): if todoc.__module__ != mod: return + # make sure that the result starts with an empty line. This is + # necessary for some situations where another directive preprocesses + # reST and no starting newline is present + self.result.append(u'', '') + # format the object's signature, if any try: - sig = self.format_signature(what, name, todoc, args, retann) + sig = self.format_signature(what, fullname, todoc, args, retann) except Exception, err: self.warn('error while formatting signature for %s: %s' % (fullname, err)) sig = '' - # make sure that the result starts with an empty line. This is - # necessary for some situations where another directive preprocesses - # reST and no starting newline is present - self.result.append(u'', '') - # now, create the directive header - directive = (what == 'method' and is_static_method(todoc)) \ - and 'staticmethod' or what + if what == 'method': + directive = get_method_type(todoc) + else: + directive = what self.result.append(indent + u'.. %s:: %s%s' % (directive, name_in_directive, sig), '<autodoc>') if what == 'module': @@ -454,13 +430,14 @@ self.result.append(indent + u' :noindex:', '<autodoc>') self.result.append(u'', '<autodoc>') + # add inheritance info, if wanted if self.options.show_inheritance and what in ('class', 'exception'): if len(todoc.__bases__): bases = [b.__module__ == '__builtin__' and u':class:`%s`' % b.__name__ or u':class:`%s.%s`' % (b.__module__, b.__name__) for b in todoc.__bases__] - self.result.append(indent + u' Bases: %s' % ', '.join(bases), + self.result.append(indent + _(u' Bases: %s') % ', '.join(bases), '<autodoc>') self.result.append(u'', '<autodoc>') @@ -468,22 +445,38 @@ if what != 'module': indent += u' ' - if modfile: - sourcename = '%s:docstring of %s' % (modfile, fullname) + # add content from attribute documentation + if analyzer: + sourcename = '%s:docstring of %s' % (analyzer.srcname, fullname) + attr_docs = analyzer.find_attr_docs() + if what in ('data', 'attribute'): + key = ('.'.join(objpath[:-1]), objpath[-1]) + if key in attr_docs: + no_docstring = True + docstrings = [attr_docs[key]] + for i, line in enumerate(self.process_doc(docstrings, what, + fullname, todoc)): + self.result.append(indent + line, sourcename, i) else: sourcename = 'docstring of %s' % fullname + attr_docs = {} # add content from docstrings - for i, line in enumerate(self.get_doc(what, fullname, todoc)): - self.result.append(indent + line, sourcename, i) + if not no_docstring: + encoding = analyzer and analyzer.encoding + docstrings = self.get_doc(what, todoc, encoding) + for i, line in enumerate(self.process_doc(docstrings, what, + fullname, todoc)): + self.result.append(indent + line, sourcename, i) - # add source content, if present + # add additional content (e.g. from document), if present if add_content: for line, src in zip(add_content.data, add_content.items): self.result.append(indent + line, src[0], src[1]) # document members? - if not members or what in ('function', 'method', 'attribute'): + if not members or what in ('function', 'method', 'staticmethod', + 'classmethod', 'data', 'attribute'): return # set current namespace for finding members @@ -491,10 +484,10 @@ if objpath: self.env.autodoc_current_class = objpath[0] - # add members, if possible - _all = members == ['__all__'] + # look for members to include + want_all_members = members == ['__all__'] members_check_module = False - if _all: + if want_all_members: # unqualified :members: given if what == 'module': if hasattr(todoc, '__all__'): @@ -522,14 +515,29 @@ all_members = sorted(todoc.__dict__.iteritems()) else: all_members = [(mname, getattr(todoc, mname)) for mname in members] + + # search for members in source code too + namespace = '.'.join(objpath) # will be empty for modules + for (membername, member) in all_members: - # ignore members whose name starts with _ by default - if _all and membername.startswith('_'): - continue + # if isattr is True, the member is documented as an attribute + isattr = False + # if content is not None, no extra content from docstrings will be added + content = None + + if want_all_members and membername.startswith('_'): + # ignore members whose name starts with _ by default + skip = True + else: + if (namespace, membername) in attr_docs: + # keep documented attributes + skip = False + isattr = True + else: + # ignore undocumented members if :undoc-members: is not given + doc = getattr(member, '__doc__', None) + skip = not self.options.undoc_members and not doc - # ignore undocumented members if :undoc-members: is not given - doc = getattr(member, '__doc__', None) - skip = not self.options.undoc_members and not doc # give the user a chance to decide whether this member should be skipped if self.env.app: # let extensions preprocess docstrings @@ -540,30 +548,48 @@ if skip: continue + # determine member type if what == 'module': - if isinstance(member, (types.FunctionType, - types.BuiltinFunctionType)): + if isinstance(member, (FunctionType, BuiltinFunctionType)): memberwhat = 'function' - elif isinstance(member, types.ClassType) or \ - isinstance(member, type): - if issubclass(member, base_exception): + elif isattr: + memberwhat = 'attribute' + elif isinstance(member, clstypes): + if member.__name__ != membername: + # assume it's aliased + memberwhat = 'data' + content = ViewList([_('alias of :class:`%s`') % member.__name__], + source='') + elif issubclass(member, base_exception): memberwhat = 'exception' else: memberwhat = 'class' else: - # XXX: todo -- attribute docs continue else: - if callable(member): + if inspect.isroutine(member): memberwhat = 'method' + elif isattr: + memberwhat = 'attribute' + elif isinstance(member, clstypes): + if member.__name__ != membername: + # assume it's aliased + memberwhat = 'attribute' + content = ViewList([_('alias of :class:`%s`') % member.__name__], + source='') + else: + memberwhat = 'class' elif isdescriptor(member): memberwhat = 'attribute' else: - # XXX: todo -- attribute docs continue - full_membername = fullname + '.' + membername - self.generate(memberwhat, full_membername, ['__all__'], None, indent, - check_module=members_check_module) + + # give explicitly separated module name, so that members of inner classes + # can be documented + full_membername = mod + '::' + '.'.join(objpath + [membername]) + self.generate(memberwhat, full_membername, ['__all__'], + add_content=content, no_docstring=bool(content), + indent=indent, check_module=members_check_module) self.env.autodoc_current_module = None self.env.autodoc_current_class = None @@ -638,6 +664,8 @@ 1, (1, 0, 1), **cls_options) app.add_directive('autoexception', autoclass_directive, 1, (1, 0, 1), **cls_options) + app.add_directive('autodata', auto_directive, 1, (1, 0, 1), + noindex=directives.flag) app.add_directive('autofunction', auto_directive, 1, (1, 0, 1), noindex=directives.flag) app.add_directive('automethod', auto_directive, 1, (1, 0, 1), Modified: doctools/trunk/sphinx/ext/coverage.py ============================================================================== --- doctools/trunk/sphinx/ext/coverage.py (original) +++ doctools/trunk/sphinx/ext/coverage.py Sun Jan 4 21:38:57 2009 @@ -6,8 +6,8 @@ Check Python modules and C API for coverage. Mostly written by Josip Dzolonga for the Google Highly Open Participation contest. - :copyright: 2008 by Josip Dzolonga, Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re @@ -16,7 +16,7 @@ import cPickle as pickle from os import path -from sphinx.builder import Builder +from sphinx.builders import Builder # utility Modified: doctools/trunk/sphinx/ext/doctest.py ============================================================================== --- doctools/trunk/sphinx/ext/doctest.py (original) +++ doctools/trunk/sphinx/ext/doctest.py Sun Jan 4 21:38:57 2009 @@ -6,13 +6,14 @@ Mimic doctest by automatically executing code snippets and checking their results. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re import sys import time +import codecs import StringIO from os import path # circumvent relative import @@ -21,7 +22,7 @@ from docutils import nodes from docutils.parsers.rst import directives -from sphinx.builder import Builder +from sphinx.builders import Builder from sphinx.util.console import bold blankline_re = re.compile(r'^\s*<BLANKLINE>', re.MULTILINE) @@ -98,9 +99,12 @@ self.setup = [] self.tests = [] - def add_code(self, code): + def add_code(self, code, prepend=False): if code.type == 'testsetup': - self.setup.append(code) + if prepend: + self.setup.insert(0, code) + else: + self.setup.append(code) elif code.type == 'doctest': self.tests.append([code]) elif code.type == 'testcode': @@ -169,7 +173,8 @@ date = time.strftime('%Y-%m-%d %H:%M:%S') - self.outfile = file(path.join(self.outdir, 'output.txt'), 'w') + self.outfile = codecs.open(path.join(self.outdir, 'output.txt'), + 'w', encoding='utf-8') self.outfile.write('''\ Results of doctest builder run on %s ==================================%s @@ -179,6 +184,12 @@ self.info(text, nonl=True) self.outfile.write(text) + def _warn_out(self, text): + self.info(text, nonl=True) + if self.app.quiet: + self.warn(text) + self.outfile.write(text) + def get_target_uri(self, docname, typ=None): return '' @@ -200,6 +211,9 @@ self.setup_failures, s(self.setup_failures))) self.outfile.close() + if self.total_failures or self.setup_failures: + self.app.statuscode = 1 + sys.path[0:0] = self.config.doctest_path def write(self, build_docnames, updated_docnames, method='update'): @@ -229,8 +243,12 @@ return isinstance(node, (nodes.literal_block, nodes.comment)) \ and node.has_key('testnodetype') for node in doctree.traverse(condition): - code = TestCode(node.has_key('test') and node['test'] or node.astext(), - type=node.get('testnodetype', 'doctest'), + source = node.has_key('test') and node['test'] or node.astext() + if not source: + self.warn('no code/output in %s block at %s:%s' % + (node.get('testnodetype', 'doctest'), + self.env.doc2path(docname), node.line)) + code = TestCode(source, type=node.get('testnodetype', 'doctest'), lineno=node.line, options=node.get('options')) node_groups = node.get('groups', ['default']) if '*' in node_groups: @@ -243,6 +261,10 @@ for code in add_to_all_groups: for group in groups.itervalues(): group.add_code(code) + if self.config.doctest_global_setup: + code = TestCode(self.config.doctest_global_setup, 'testsetup', lineno=0) + for group in groups.itervalues(): + group.add_code(code, prepend=True) if not groups: return @@ -274,7 +296,7 @@ setup_doctest.globs = ns old_f = self.setup_runner.failures self.type = 'exec' # the snippet may contain multiple statements - self.setup_runner.run(setup_doctest, out=self._out, + self.setup_runner.run(setup_doctest, out=self._warn_out, clear_globs=False) if self.setup_runner.failures > old_f: # don't run the group @@ -284,8 +306,6 @@ test = parser.get_doctest(code[0].code, {}, group.name, filename, code[0].lineno) if not test.examples: - self._out('WARNING: no examples in doctest block at ' - + filename + ', line %s\n' % code[0].lineno) continue for example in test.examples: # apply directive's comparison options @@ -307,7 +327,7 @@ # DocTest.__init__ copies the globs namespace, which we don't want test.globs = ns # also don't clear the globs namespace after running the doctest - self.test_runner.run(test, out=self._out, clear_globs=False) + self.test_runner.run(test, out=self._warn_out, clear_globs=False) def setup(app): @@ -322,3 +342,4 @@ # this config value adds to sys.path app.add_config_value('doctest_path', [], False) app.add_config_value('doctest_test_doctest_blocks', 'default', False) + app.add_config_value('doctest_global_setup', '', False) Modified: doctools/trunk/sphinx/ext/ifconfig.py ============================================================================== --- doctools/trunk/sphinx/ext/ifconfig.py (original) +++ doctools/trunk/sphinx/ext/ifconfig.py Sun Jan 4 21:38:57 2009 @@ -16,8 +16,8 @@ namespace of the project configuration (that is, all variables from ``conf.py`` are available.) - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from docutils import nodes Modified: doctools/trunk/sphinx/ext/intersphinx.py ============================================================================== --- doctools/trunk/sphinx/ext/intersphinx.py (original) +++ doctools/trunk/sphinx/ext/intersphinx.py Sun Jan 4 21:38:57 2009 @@ -20,8 +20,8 @@ also be specified individually, e.g. if the docs should be buildable without Internet access. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import time @@ -31,7 +31,7 @@ from docutils import nodes -from sphinx.builder import INVENTORY_FILENAME +from sphinx.builders.html import INVENTORY_FILENAME def fetch_inventory(app, uri, inv): Modified: doctools/trunk/sphinx/ext/jsmath.py ============================================================================== --- doctools/trunk/sphinx/ext/jsmath.py (original) +++ doctools/trunk/sphinx/ext/jsmath.py Sun Jan 4 21:38:57 2009 @@ -6,8 +6,8 @@ Set up everything for use of JSMath to display math in HTML via JavaScript. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from docutils import nodes Modified: doctools/trunk/sphinx/ext/mathbase.py ============================================================================== --- doctools/trunk/sphinx/ext/mathbase.py (original) +++ doctools/trunk/sphinx/ext/mathbase.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Set up math support in source files and LaTeX/text output. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from docutils import nodes, utils Modified: doctools/trunk/sphinx/ext/pngmath.py ============================================================================== --- doctools/trunk/sphinx/ext/pngmath.py (original) +++ doctools/trunk/sphinx/ext/pngmath.py Sun Jan 4 21:38:57 2009 @@ -5,12 +5,11 @@ Render math in HTML via dvipng. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re -import shlex import shutil import tempfile import posixpath @@ -24,6 +23,7 @@ from docutils import nodes from sphinx.util import ensuredir +from sphinx.util.png import read_png_depth, write_png_depth from sphinx.application import SphinxError from sphinx.ext.mathbase import setup as mathbase_setup, wrap_displaymath @@ -79,7 +79,8 @@ relfn = posixpath.join(self.builder.imgpath, 'math', shasum) outfn = path.join(self.builder.outdir, '_images', 'math', shasum) if path.isfile(outfn): - return relfn, self.builder.env._pngmath_depth.get(shasum, None) + depth = read_png_depth(outfn) + return relfn, depth latex = DOC_HEAD + self.builder.config.pngmath_latex_preamble latex += (use_preview and DOC_BODY_PREVIEW or DOC_BODY) % math @@ -101,8 +102,10 @@ # build latex command; old versions of latex don't have the # --output-directory option, so we have to manually chdir to the # temp dir to run it. - ltx_args = shlex.split(self.builder.config.pngmath_latex) - ltx_args += ['--interaction=nonstopmode', 'math.tex'] + ltx_args = [self.builder.config.pngmath_latex, '--interaction=nonstopmode'] + # add custom args from the config file + ltx_args.extend(self.builder.config.pngmath_latex_args) + ltx_args.append('math.tex') curdir = getcwd() chdir(tempdir) @@ -129,7 +132,7 @@ ensuredir(path.dirname(outfn)) # use some standard dvipng arguments - dvipng_args = shlex.split(self.builder.config.pngmath_dvipng) + dvipng_args = [self.builder.config.pngmath_dvipng] dvipng_args += ['-o', outfn, '-T', 'tight', '-z9'] # add custom ones from config value dvipng_args.extend(self.builder.config.pngmath_dvipng_args) @@ -158,15 +161,11 @@ m = depth_re.match(line) if m: depth = int(m.group(1)) - self.builder.env._pngmath_depth[shasum] = depth + write_png_depth(outfn, depth) break return relfn, depth -def ensure_depthcache(app, env): - if not hasattr(env, '_pngmath_depth'): - env._pngmath_depth = {} - def cleanup_tempdir(app, exc): if exc: return @@ -220,6 +219,6 @@ app.add_config_value('pngmath_latex', 'latex', False) app.add_config_value('pngmath_use_preview', False, False) app.add_config_value('pngmath_dvipng_args', ['-gamma 1.5', '-D 110'], False) + app.add_config_value('pngmath_latex_args', [], False) app.add_config_value('pngmath_latex_preamble', '', False) - app.connect('env-updated', ensure_depthcache) app.connect('build-finished', cleanup_tempdir) Modified: doctools/trunk/sphinx/ext/refcounting.py ============================================================================== --- doctools/trunk/sphinx/ext/refcounting.py (original) +++ doctools/trunk/sphinx/ext/refcounting.py Sun Jan 4 21:38:57 2009 @@ -9,8 +9,8 @@ Usage: Set the `refcount_file` config value to the path to the reference count data file. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from os import path Modified: doctools/trunk/sphinx/ext/todo.py ============================================================================== --- doctools/trunk/sphinx/ext/todo.py (original) +++ doctools/trunk/sphinx/ext/todo.py Sun Jan 4 21:38:57 2009 @@ -8,8 +8,8 @@ all todos of your project and lists them along with a backlink to the original location. - :copyright: 2008 Daniel B?ltmann. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from docutils import nodes Modified: doctools/trunk/sphinx/highlighting.py ============================================================================== --- doctools/trunk/sphinx/highlighting.py (original) +++ doctools/trunk/sphinx/highlighting.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Highlight code blocks using Pygments. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys @@ -30,6 +30,8 @@ from pygments.token import Generic, Comment, Number except ImportError: pygments = None + lexers = None + HtmlFormatter = LatexFormatter = None else: class SphinxStyle(Style): """ @@ -81,6 +83,11 @@ class PygmentsBridge(object): + # Set these attributes if you want to have different Pygments formatters + # than the default ones. + html_formatter = HtmlFormatter + latex_formatter = LatexFormatter + def __init__(self, dest='html', stylename='sphinx'): self.dest = dest if not pygments: @@ -89,14 +96,17 @@ style = SphinxStyle elif '.' in stylename: module, stylename = stylename.rsplit('.', 1) - style = getattr(__import__(module, None, None, ['']), stylename) + style = getattr(__import__(module, None, None, ['__name__']), stylename) else: style = get_style_by_name(stylename) - self.hfmter = {False: HtmlFormatter(style=style), - True: HtmlFormatter(style=style, linenos=True)} - self.lfmter = {False: LatexFormatter(style=style, commandprefix='PYG'), - True: LatexFormatter(style=style, linenos=True, - commandprefix='PYG')} + if dest == 'html': + self.fmter = {False: self.html_formatter(style=style), + True: self.html_formatter(style=style, linenos=True)} + else: + self.fmter = {False: self.latex_formatter(style=style, + commandprefix='PYG'), + True: self.latex_formatter(style=style, linenos=True, + commandprefix='PYG')} def unhighlighted(self, source): if self.dest == 'html': @@ -170,9 +180,9 @@ lexer.add_filter('raiseonerror') try: if self.dest == 'html': - return highlight(source, lexer, self.hfmter[bool(linenos)]) + return highlight(source, lexer, self.fmter[bool(linenos)]) else: - hlsource = highlight(source, lexer, self.lfmter[bool(linenos)]) + hlsource = highlight(source, lexer, self.fmter[bool(linenos)]) return hlsource.translate(tex_hl_escape_map) except ErrorToken: # this is most probably not the selected language, @@ -186,9 +196,9 @@ # no HTML styles needed return '' if self.dest == 'html': - return self.hfmter[0].get_style_defs() + return self.fmter[0].get_style_defs() else: - styledefs = self.lfmter[0].get_style_defs() + styledefs = self.fmter[0].get_style_defs() # workaround for Pygments < 0.12 if styledefs.startswith('\\newcommand\\at{@}'): styledefs += _LATEX_STYLES Added: doctools/trunk/sphinx/jinja2glue.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/jinja2glue.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +""" + sphinx.jinja2glue + ~~~~~~~~~~~~~~~~~ + + Glue code for the jinja2 templating engine. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +from os import path + +import jinja2 + +from sphinx.util import mtimes_of_files +from sphinx.application import TemplateBridge + + +class SphinxLoader(jinja2.BaseLoader): + """ + A jinja2 reimplementation of `sphinx._jinja.SphinxFileSystemLoader`. + """ + + def __init__(self, basepath, extpaths, encoding='utf-8'): + """ + Create a new loader for sphinx. + + *extpaths* is a list of directories, which provide additional templates + to sphinx. + + *encoding* is used to decode the templates into unicode strings. + Defaults to utf-8. + + If *basepath* is set, this path is used to load sphinx core templates. + If False, these templates are loaded from the sphinx package. + """ + self.core_loader = jinja2.FileSystemLoader(basepath) + self.all_loaders = jinja2.ChoiceLoader( + [jinja2.FileSystemLoader(extpath) for extpath in extpaths] + + [self.core_loader]) + + def get_source(self, environment, template): + # exclamation mark forces loading from core + if template.startswith('!'): + return self.core_loader.get_source(environment, template[1:]) + # check if the template is probably an absolute path + fs_path = template.replace('/', path.sep) + if path.isabs(fs_path): + if not path.exists(fs_path): + raise jinja2.TemplateNotFound(template) + f = codecs.open(fs_path, 'r', self.encoding) + try: + mtime = path.getmtime(path) + return (f.read(), fs_path, + lambda: mtime == path.getmtime(path)) + finally: + f.close() + # finally try to load from custom templates + return self.all_loaders.get_source(environment, template) + + +class BuiltinTemplates(TemplateBridge): + """ + Interfaces the rendering environment of jinja2 for use in sphinx. + """ + + def init(self, builder): + base_templates_path = path.join(path.dirname(__file__), 'templates') + ext_templates_path = [path.join(builder.confdir, dir) + for dir in builder.config.templates_path] + self.templates_path = [base_templates_path] + ext_templates_path + loader = SphinxLoader(base_templates_path, ext_templates_path) + use_i18n = builder.translator is not None + extensions = use_i18n and ['jinja2.ext.i18n'] or [] + self.environment = jinja2.Environment(loader=loader, + extensions=extensions) + if use_i18n: + self.environment.install_gettext_translations(builder.translator) + + def render(self, template, context): + return self.environment.get_template(template).render(context) + + def newest_template_mtime(self): + return max(mtimes_of_files(self.templates_path, '.html')) Modified: doctools/trunk/sphinx/locale/__init__.py ============================================================================== --- doctools/trunk/sphinx/locale/__init__.py (original) +++ doctools/trunk/sphinx/locale/__init__.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Locale utilities. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ _ = lambda x: x Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js Sun Jan 4 21:38:57 2009 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modul", "Preparing search...": "", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Search finished, found %s page(s) matching the search query.": "", ", in ": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "hledej", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "Hide Search Matches": "", "Search Results": "V\u00fdsledky hled\u00e1n\u00ed"}}); \ No newline at end of file +Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modul, v", "Preparing search...": "P?ipravuji hled?n?...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nenalezli jsme ??dn? dokument. Ujist?te se pros?m, ?e v?echna slova jsou spr?vn?.", "Search finished, found %s page(s) matching the search query.": "Vyhled?v?n? skon?ilo, nalezeno %s stran.", ", in ": ", v", "Permalink to this headline": "Trval? odkaz na tento nadpis", "Searching": "Hled?m", "Permalink to this definition": "Trval? odkaz na tuto definici", "Hide Search Matches": "Skr?t v?sledky hled?n?", "Search Results": "V?sledky hled?n?"}}); Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo ============================================================================== Binary files doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo (original) and doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo Sun Jan 4 21:38:57 2009 differ Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -7,23 +7,25 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" -"POT-Creation-Date: 2008-08-10 11:43+0000\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"POT-Creation-Date: 2008-11-27 18:39+0100\n" +"PO-Revision-Date: 2008-12-25 05:59+0100\n" "Last-Translator: Pavel Kosina <pavel.kosina at gmail.com>\n" "Language-Team: Pavel Kosina <pavel.kosina at gmail.com>\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "Generated-By: Babel 0.9.4\n" +"X-Poedit-Language: Czech\n" +"X-Poedit-Country: CZECH REPUBLIC\n" #: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%d.%m.%Y" -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 +#: sphinx/templates/defindex.html:21 msgid "General Index" msgstr "Rejst??k index?" @@ -31,11 +33,13 @@ msgid "index" msgstr "index" -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 +#: sphinx/builder.py:429 +#: sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" -msgstr "Rejst??k modul?" +msgstr "Celkov? rejst??k modul?" #: sphinx/builder.py:429 msgid "modules" @@ -51,45 +55,51 @@ #: sphinx/builder.py:1054 msgid " (in " -msgstr "" +msgstr "(v" #: sphinx/builder.py:1129 msgid "Builtins" -msgstr "Vestav?n? funkce" +msgstr "Vestav?n? funkce " #: sphinx/builder.py:1131 msgid "Module level" msgstr "?rove? modul?" -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:102 +#: sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%d.%m.%Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/environment.py:291 +#: sphinx/latexwriter.py:175 #: sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/genindex-split.html:5 +#: sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 +#: sphinx/templates/genindex.html:48 #: sphinx/templates/layout.html:130 msgid "Index" msgstr "Index" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 -#, fuzzy +#: sphinx/environment.py:292 +#: sphinx/latexwriter.py:174 msgid "Module Index" -msgstr "Rejst??k modul?" +msgstr "Rejst??k modul? " -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 -#, fuzzy +#: sphinx/environment.py:293 +#: sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Vyhled?vac? str?nka" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 +#: sphinx/htmlwriter.py:79 +#: sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Trval? odkaz na tuto definici" -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 +#: sphinx/htmlwriter.py:399 +#: sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Trval? odkaz na tento nadpis" @@ -97,7 +107,8 @@ msgid "Release" msgstr "Vyd?n?" -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 +#: sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "promm?n? prost?ed?, %s" @@ -121,7 +132,8 @@ msgid "%s() (built-in function)" msgstr "%s() (vestav?n? funkce)" -#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:42 #: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" @@ -132,15 +144,16 @@ msgid "%s (built-in variable)" msgstr "%s() (vestav?n? prom?nn?)" -#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s() (v modulu %s)" #: sphinx/directives/desc.py:33 -#, fuzzy, python-format +#, python-format msgid "%s (built-in class)" -msgstr "%s() (vestav?n? prom?nn?)" +msgstr "%s () (vestav?n? prom?nn?)" #: sphinx/directives/desc.py:34 #, python-format @@ -223,9 +236,9 @@ msgstr "Parametry" #: sphinx/directives/desc.py:423 -#, fuzzy, python-format +#, python-format msgid "%scommand line option; %s" -msgstr "%sparametry p??kazov?ho ??dku; %s" +msgstr "%s parametry p??kazov?ho ??dku; %s" #: sphinx/directives/other.py:101 msgid "Platforms: " @@ -254,16 +267,16 @@ #: sphinx/ext/todo.py:31 msgid "Todo" -msgstr "" +msgstr "Todo" #: sphinx/ext/todo.py:75 #, python-format msgid "(The original entry is located in %s, line %d and can be found " -msgstr "" +msgstr "(P?vodn? z?znam je v %s, ??dka %d a lze jej nal?zt" #: sphinx/ext/todo.py:81 msgid "here" -msgstr "" +msgstr "zde" #: sphinx/locale/__init__.py:15 msgid "Attention" @@ -350,40 +363,37 @@ #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" -msgstr "" +msgstr "Skr?t v?sledky vyhled?v?n?" #: sphinx/static/searchtools.js:274 -#, fuzzy msgid "Searching" -msgstr "hledej" +msgstr "Hled?m" #: sphinx/static/searchtools.js:279 msgid "Preparing search..." -msgstr "" +msgstr "P?ipravuji vyhled?v?n?...." #: sphinx/static/searchtools.js:338 -#, fuzzy msgid "module, in " -msgstr "modul" +msgstr "modul, v" #: sphinx/static/searchtools.js:347 msgid ", in " -msgstr "" +msgstr ", v" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:447 +#: sphinx/templates/search.html:18 msgid "Search Results" msgstr "V?sledky hled?n?" #: sphinx/static/searchtools.js:449 -msgid "" -"Your search did not match any documents. Please make sure that all words " -"are spelled correctly and that you've selected enough categories." -msgstr "" +msgid "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." +msgstr "Nenalezli jsme ??dn? dokument. Ujist?te se pros?m, ?e v?echna slova jsou spr?vn? a ?e jste vybral dostatek kategori?." #: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." -msgstr "" +msgstr "Vyhled?v?n? skon?ilo, nalezeno %s stran." #: sphinx/templates/defindex.html:2 msgid "Overview" @@ -420,7 +430,8 @@ #: sphinx/templates/genindex-single.html:44 #: sphinx/templates/genindex-split.html:14 -#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +#: sphinx/templates/genindex-split.html:27 +#: sphinx/templates/genindex.html:54 msgid "Full index on one page" msgstr "Pln? index na jedn? str?nce" @@ -464,7 +475,8 @@ msgid "Suggest Change" msgstr "N?vrh zm?nu" -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:60 +#: sphinx/templates/layout.html:62 msgid "Show Source" msgstr "Uk?zat zdroj" @@ -493,7 +505,8 @@ msgid "About these documents" msgstr "O t?chto dokumentech" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:131 +#: sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Hled?n?" @@ -515,16 +528,12 @@ #: sphinx/templates/layout.html:183 #, python-format msgid "Last updated on %(last_updated)s." -msgstr "Naposledy aktualizov?no dne %(last_updated)s." +msgstr "Aktualizov?no dne %(last_updated)s." #: sphinx/templates/layout.html:186 #, python-format -msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " -"%(sphinx_version)s." -msgstr "" -"Vytvo?eno pomoc? <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " -"%(sphinx_version)s." +msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." +msgstr "Vytvo?eno pomoc? <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." #: sphinx/templates/modindex.html:15 msgid "Most popular modules:" @@ -544,27 +553,18 @@ msgstr "Prohledat %(docstitle)s" #: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Pozn?mka:</strong> Str?nka, kterou hled?te, " -"neexistuje.<br>Sna?ili jsme se naj?t nov? um?st?n? t?to str?nky, ale " -"nepovedlo se." +msgid "<strong>Note:</strong> You requested an out-of-date URL from this server. We've tried to redirect you to the new location of this page, but it may not be the right one." +msgstr "<strong>Pozn?mka:</strong> Str?nka, kterou hled?te, neexistuje.<br>Sna?ili jsme se naj?t nov? um?st?n? t?to str?nky, ale nepovedlo se." #: sphinx/templates/search.html:7 -#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" " containing fewer words won't appear in the result list." msgstr "" -"Toto je vyhled?vac? str?nka. Zadejte kl??ov? slova do pole n??e a " -"klikn?te na \"hledej\". \n" -"Prohled?v?n? funkc? hled? automaticky v?echna slova. Str?nky obsahuj?c?" -" slov m?n?, nebudou nalezeny." +"Toto je vyhled?vac? str?nka. Zadejte kl??ov? slova a klikn?te na \"hledej\". \n" +"Vyhled?v?n? hled? automaticky v?echna slova. Nebudou tedy nalezeny str?nky, obsahuj?c? m?n? slov." #: sphinx/templates/search.html:14 msgid "search" Modified: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -7,93 +7,37 @@ "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-08-07 21:40+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Horst Gutmann <zerok at zerokspot.com>\n" "Language-Team: de <LL at li.org>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d. %m. %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Allgemeiner Index" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "Index" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Globaler Modulindex" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "Module" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "weiter" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "zur?ck" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Builtins" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Modulebene" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d. %m. %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Stichwortverzeichnis" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Modulindex" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Suche" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Permalink zu dieser Definition" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Permalink zu dieser ?berschrift" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Release" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "Umgebungsvariable; %s" @@ -103,14 +47,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Builtins" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Modulebene" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plattform: %s" +msgid "%b %d, %Y" +msgstr "%d. %m. %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[Bild]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Allgemeiner Index" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "Index" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Globaler Modulindex" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "Module" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "weiter" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "zur?ck" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -214,11 +192,16 @@ msgid "Return type" msgstr "R?ckgabetyp" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parameter" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parameter" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%sKommandozeilenoption; %s" @@ -244,10 +227,15 @@ msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Siehe auch" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -344,6 +332,14 @@ msgid "built-in function" msgstr "eingebaute Funktion" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Permalink zu dieser ?berschrift" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Permalink zu dieser Definition" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Suchergebnisse ausblenden" @@ -364,11 +360,11 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Suchergebnisse" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -376,7 +372,7 @@ "Es wurden keine Dokumente gefunden. Haben Sie alle Suchworte richtig " "geschrieben und gen?gend Kategorien ausgew?hlt?" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Suche beendet, %s Seite(n) mit Ergebnissen wurden gefunden." @@ -452,68 +448,61 @@ msgid "next chapter" msgstr "n?chstes Kapitel" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Diese Seite" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "?nderung vorschlagen" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Quelltext anzeigen" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Schnellsuche" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Stichwortsuche" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Los" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Gib einen Modul-, Klassen- oder Funktionsnamen an." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Suche in %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "?ber diese Dokumentation" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Suche" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Zuletzt aktualisiert am %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -522,15 +511,7 @@ "Mit <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s " "erstellt." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Beliebteste Module:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Zeige nur Module, die auf diesen Plattformen verf?gbar sind" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Veraltet" @@ -539,16 +520,6 @@ msgid "Search %(docstitle)s" msgstr "Suche in %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Anmerkung:</strong> Du hast eine nicht l?nger g?ltige URL von " -"diesem Server angefragt. Wir haben versucht dich auf die neue Adresse " -"dieser Seite umzuleiten, aber dies muss nicht die richtige Seite sein." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -599,3 +570,42 @@ msgid "Other changes" msgstr "Andere ?nderungen" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Release" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plattform: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[Bild]" + +#~ msgid "Suggest Change" +#~ msgstr "?nderung vorschlagen" + +#~ msgid "Keyword search" +#~ msgstr "Stichwortsuche" + +#~ msgid "Most popular modules:" +#~ msgstr "Beliebteste Module:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Zeige nur Module, die auf diesen Plattformen verf?gbar sind" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Anmerkung:</strong> Du hast eine nicht" +#~ " l?nger g?ltige URL von diesem Server" +#~ " angefragt. Wir haben versucht dich " +#~ "auf die neue Adresse dieser Seite " +#~ "umzuleiten, aber dies muss nicht die " +#~ "richtige Seite sein." + Modified: doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -8,96 +8,37 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: guillem at torroja.dmt.upm.es\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Guillem Borrell <guillem at torroja.dmt.upm.es>\n" "Language-Team: es <LL at li.org>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d %b, %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "?ndice General" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "?ndice" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "?ndice Global de M?dulos" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "m?dulos" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "siguiente" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "anterior" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -#, fuzzy -msgid "Builtins" -msgstr "Funciones de base" - -#: sphinx/builder.py:1131 -#, fuzzy -msgid "Module level" -msgstr "M?dulos" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, fuzzy, python-format msgid "%B %d, %Y" msgstr "%d de %B de %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "?ndice" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "?ndice de M?dulos" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "P?gina de B?squeda" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Enlazar permanentemente con esta definici?n" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Enlazar permanentemente con este t?tulo" - -#: sphinx/latexwriter.py:172 -#, fuzzy -msgid "Release" -msgstr "Versi?n" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "variables de entorno; %s" @@ -107,14 +48,50 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +#, fuzzy +msgid "Builtins" +msgstr "Funciones de base" + +#: sphinx/builders/changes.py:66 +#, fuzzy +msgid "Module level" +msgstr "M?dulos" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plataforma: %s" +msgid "%b %d, %Y" +msgstr "%d %b, %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[imagen]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "?ndice General" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "?ndice" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "?ndice Global de M?dulos" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "m?dulos" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "siguiente" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "anterior" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, fuzzy, python-format @@ -219,11 +196,16 @@ msgid "Return type" msgstr "Tipo del argumento devuelto" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Par?metros" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Par?metros" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%sOpciones en l?nea de comandos; %s" @@ -249,10 +231,15 @@ msgid "Author: " msgstr "Autor:" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Ver tambi?n" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -350,6 +337,14 @@ msgid "built-in function" msgstr "funci?n de base" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Enlazar permanentemente con este t?tulo" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Enlazar permanentemente con esta definici?n" + #: sphinx/static/doctools.js:174 #, fuzzy msgid "Hide Search Matches" @@ -372,11 +367,11 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Resultados de la b?squeda" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -385,7 +380,7 @@ "todas las palabras correctamente y que ha seleccionado suficientes " "categor?as" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -463,68 +458,61 @@ msgid "next chapter" msgstr "Pr?ximo cap?tulo" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Esta p?gina" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Sugerir una modificaci?n" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Ense?ar el c?digo" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "B?squeda r?pida" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "B?squeda por palabras clave" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Ir a" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Introducir en nombre de un m?dulo, clase o funci?n" -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Buscar en %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Sobre este documento" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "B?squeda" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\\\"%(path)s\\\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Actualizado por ?ltima vez en %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -533,15 +521,7 @@ "Creado con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "M?dulos m?s comunes:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Mostrar s?lo los m?dulos disponibles en estas plataformas" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Obsoleto" @@ -550,16 +530,6 @@ msgid "Search %(docstitle)s" msgstr "Buscar en %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Nota:</strong> Has solicitado una direcci?n desactualizada a este" -" servidor. Hemos intentado redirigirte a la nueva direcci?n de la misma " -"p?gina pero puede no ser la correcta." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -609,3 +579,42 @@ msgid "Other changes" msgstr "Otros cambios" +#: sphinx/writers/latex.py:173 +#, fuzzy +msgid "Release" +msgstr "Versi?n" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plataforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[imagen]" + +#~ msgid "Suggest Change" +#~ msgstr "Sugerir una modificaci?n" + +#~ msgid "Keyword search" +#~ msgstr "B?squeda por palabras clave" + +#~ msgid "Most popular modules:" +#~ msgstr "M?dulos m?s comunes:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Mostrar s?lo los m?dulos disponibles en estas plataformas" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Nota:</strong> Has solicitado una " +#~ "direcci?n desactualizada a este servidor. " +#~ "Hemos intentado redirigirte a la nueva" +#~ " direcci?n de la misma p?gina pero" +#~ " puede no ser la correcta." + Modified: doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -9,93 +9,37 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: larlet at gmail.com\n" "POT-Creation-Date: 2008-08-08 12:39+0000\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: S?bastien Douche <sdouche at gmail.com>\n" "Language-Team: French Translation Team <sphinx-dev at googlegroups.com>\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d %b %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Index g?n?ral" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "index" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Index g?n?ral des modules" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "modules" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "suivant" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "pr?c?dent" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "(dans" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Fonctions de base" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Module" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d %B %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Index" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Index du module" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Page de recherche" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Lien permanent vers cette d?finition" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Lien permanent vers ce titre" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Version" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "variable d'environnement; %s" @@ -105,14 +49,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Fonctions de base" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Module" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plateforme : %s" +msgid "%b %d, %Y" +msgstr "%d %b %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[image]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Index g?n?ral" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "index" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Index g?n?ral des modules" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "modules" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "suivant" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "pr?c?dent" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "(dans" #: sphinx/directives/desc.py:25 #, python-format @@ -216,11 +194,16 @@ msgid "Return type" msgstr "Type retourn?" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Param?tres" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Param?tres" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%soption de ligne de commande; %s" @@ -246,10 +229,15 @@ msgid "Author: " msgstr "Auteur : " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Voir aussi" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "A faire" @@ -346,6 +334,14 @@ msgid "built-in function" msgstr "fonction de base" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Lien permanent vers ce titre" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Lien permanent vers cette d?finition" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Cacher les r?sultats de la recherche" @@ -366,11 +362,11 @@ msgid ", in " msgstr ", dans" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "R?sultats de la recherche" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -379,7 +375,7 @@ "des termes de recherche et que vous avez s?lectionn? suffisamment de " "cat?gories." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "La recherche est termin?e, %s page(s) correspond(ent) ? la requ?te." @@ -455,68 +451,61 @@ msgid "next chapter" msgstr "Chapitre suivant" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Cette page" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Sugg?rer une modification" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Montrer la source" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Recherche rapide" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Recherche par mot-cl?" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Go" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Saisissez un nom de module, classe ou fonction." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Recherchez dans %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "? propos de ces documents" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Recherche" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Mis ? jour le %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -525,15 +514,7 @@ "Cr?? avec <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Modules les plus utilis?s :" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "N'afficher que les modules disponibles sur ces plateformes" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Obsol?te" @@ -542,16 +523,6 @@ msgid "Search %(docstitle)s" msgstr "Rechercher %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Note :</strong> Vous tentez d'acc?der ? une ancienne URL de ce " -"serveur. Nous avons essay? de vous rediriger vers la nouvelle adresse de " -"cette page, mais ce n'est peut-?tre pas la bonne." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -604,3 +575,42 @@ msgid "Other changes" msgstr "Autres modifications" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Version" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plateforme : %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[image]" + +#~ msgid "Suggest Change" +#~ msgstr "Sugg?rer une modification" + +#~ msgid "Keyword search" +#~ msgstr "Recherche par mot-cl?" + +#~ msgid "Most popular modules:" +#~ msgstr "Modules les plus utilis?s :" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "N'afficher que les modules disponibles sur ces plateformes" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Note :</strong> Vous tentez d'acc?der" +#~ " ? une ancienne URL de ce " +#~ "serveur. Nous avons essay? de vous " +#~ "rediriger vers la nouvelle adresse de" +#~ " cette page, mais ce n'est peut-?tre" +#~ " pas la bonne." + Added: doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.js ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.js Sun Jan 4 21:38:57 2009 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "it", "plural_expr": "(n != 1)", "messages": {"module, in ": "modulo, in", "Preparing search...": "Preparazione della ricerca", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La tua ricerca non ha trovato alcun risultato. Controlla la corettezzadei termini di ricerca e di avere selezionato un numero sufficiente di categorie", "Search finished, found %s page(s) matching the search query.": "Ricera terminata, trovate %s pagine corrispondenti alla ricerca.", ", in ": ", in ", "Permalink to this headline": "link permanente per questa inestazione", "Searching": "Ricerca in corso", "Permalink to this definition": "link permanente per questa definizione", "Hide Search Matches": "Nascondi i risultati della ricerca", "Search Results": "Risultati della ricerca"}}); \ No newline at end of file Added: doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.mo ============================================================================== Binary file. No diff available. Added: doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.po ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/it/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -0,0 +1,612 @@ +# Italian translations for Sphinx. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# Sandro Dentella <sandro at e-den.it>, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" +"POT-Creation-Date: 2008-11-27 18:39+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" +"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n" +"Language-Team: it <LL at li.org>\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.3\n" + +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 +#, python-format +msgid "%B %d, %Y" +msgstr "%d %B %Y" + +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 +msgid "Index" +msgstr "Indice" + +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 +msgid "Module Index" +msgstr "Indice dei Moduli" + +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "Cerca" + +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 +#, python-format +msgid "environment variable; %s" +msgstr "variabile d?mbiente, %s" + +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python Enhancement Proposals!PEP %s" + +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Builtin" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Modulo" + +#: sphinx/builders/html.py:115 +#, python-format +msgid "%b %d, %Y" +msgstr "%d/%b/%Y" + +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Indice generale" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "indice" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Indice dei moduli" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "moduli" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "successivo" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "precedente" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr " (in " + +#: sphinx/directives/desc.py:25 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (funzione built-in)" + +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (nel modulo %s)" + +#: sphinx/directives/desc.py:29 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (variabile built-in)" + +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (nel modulo %s)" + +#: sphinx/directives/desc.py:33 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (classe built-in)" + +#: sphinx/directives/desc.py:34 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (classe in %s)" + +#: sphinx/directives/desc.py:46 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metodo)" + +#: sphinx/directives/desc.py:48 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metodo)" + +#: sphinx/directives/desc.py:58 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s metodo statico)" + +#: sphinx/directives/desc.py:60 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s metodo statico)" + +#: sphinx/directives/desc.py:70 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s attributo)" + +#: sphinx/directives/desc.py:72 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s attributo)" + +#: sphinx/directives/desc.py:74 +#, python-format +msgid "%s (C function)" +msgstr "%s (functione C)" + +#: sphinx/directives/desc.py:76 +#, python-format +msgid "%s (C member)" +msgstr "%s (membro C )" + +#: sphinx/directives/desc.py:78 +#, python-format +msgid "%s (C macro)" +msgstr "%s (macro C)" + +#: sphinx/directives/desc.py:80 +#, python-format +msgid "%s (C type)" +msgstr "%s (tipo C)" + +#: sphinx/directives/desc.py:82 +#, python-format +msgid "%s (C variable)" +msgstr "%s (variabile C)" + +#: sphinx/directives/desc.py:100 +msgid "Raises" +msgstr "Solleva" + +#: sphinx/directives/desc.py:104 +msgid "Variable" +msgstr "Variabile" + +#: sphinx/directives/desc.py:107 +msgid "Returns" +msgstr "Ritorna" + +#: sphinx/directives/desc.py:116 +msgid "Return type" +msgstr "Tipo di ritorno" + +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parametri" + +#: sphinx/directives/desc.py:205 +msgid "Parameters" +msgstr "Parametri" + +#: sphinx/directives/desc.py:450 +#, python-format +msgid "%scommand line option; %s" +msgstr "%sopzione di linea di comando; %s" + +#: sphinx/directives/other.py:101 +msgid "Platforms: " +msgstr "Piattaforme:" + +#: sphinx/directives/other.py:106 +#, python-format +msgid "%s (module)" +msgstr "%s (modulo)" + +#: sphinx/directives/other.py:146 +msgid "Section author: " +msgstr "Autore della sezione" + +#: sphinx/directives/other.py:148 +msgid "Module author: " +msgstr "Autore del modulo" + +#: sphinx/directives/other.py:150 +msgid "Author: " +msgstr "Autore: " + +#: sphinx/directives/other.py:249 +msgid "See also" +msgstr "Vedi anche" + +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "Da fare" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(La riga originale si trova in %s, linea %d e pu? essere trovata " + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "qui" + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "Attenzione" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "Attenzione" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "Pericolo" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "Errore" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "Consiglio" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "Importante" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "Nota" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "Vedi anche" + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "Suggerimento" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "Avvertimento" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "Nuovo nella versione %s" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "Cambiato nella versione %s" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "Deprecato dalla versione %s" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "modulo" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "keyword" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "operatore" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "oggetto" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "eccezione" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "statement" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "funzione built-in" + +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "link permanente per questa inestazione" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "link permanente per questa definizione" + +#: sphinx/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "Nascondi i risultati della ricerca" + +#: sphinx/static/searchtools.js:274 +msgid "Searching" +msgstr "Ricerca in corso" + +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Preparazione della ricerca" + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "modulo, in" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr ", in " + +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 +msgid "Search Results" +msgstr "Risultati della ricerca" + +#: sphinx/static/searchtools.js:455 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "" +"La tua ricerca non ha trovato alcun risultato. Controlla la corettezzadei" +" termini di ricerca e di avere selezionato un numero sufficiente di " +"categorie" + +#: sphinx/static/searchtools.js:457 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Ricera terminata, trovate %s pagine corrispondenti alla ricerca." + +#: sphinx/templates/defindex.html:2 +msgid "Overview" +msgstr "Sintesi" + +#: sphinx/templates/defindex.html:11 +msgid "Indices and tables:" +msgstr "Indici e tabelle:" + +#: sphinx/templates/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Tabella dei contenuti completa" + +#: sphinx/templates/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "elenca l'insieme delle sezioni e sottosezioni" + +#: sphinx/templates/defindex.html:17 +msgid "search this documentation" +msgstr "cerca in questa documentazione" + +#: sphinx/templates/defindex.html:20 +msgid "quick access to all modules" +msgstr "accesso veloce ai moduli" + +#: sphinx/templates/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "tutte le funzioni, classi e moduli" + +#: sphinx/templates/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "Indice – %(key)s" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +msgid "Full index on one page" +msgstr "Indice completo in una pagina" + +#: sphinx/templates/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Indice delle pagine per lettera" + +#: sphinx/templates/genindex-split.html:15 +msgid "can be huge" +msgstr "pu? essere enorme" + +#: sphinx/templates/layout.html:9 +msgid "Navigation" +msgstr "Navigazione" + +#: sphinx/templates/layout.html:40 +msgid "Table Of Contents" +msgstr "Tablella dei contenuti" + +#: sphinx/templates/layout.html:46 +msgid "Previous topic" +msgstr "Argomento precedente" + +#: sphinx/templates/layout.html:47 +msgid "previous chapter" +msgstr "capitolo precedente" + +#: sphinx/templates/layout.html:50 +msgid "Next topic" +msgstr "Argomento successivo" + +#: sphinx/templates/layout.html:51 +msgid "next chapter" +msgstr "capitolo successivo" + +#: sphinx/templates/layout.html:56 +msgid "This Page" +msgstr "Questa pagina" + +#: sphinx/templates/layout.html:58 +msgid "Show Source" +msgstr "Mostra sorgente" + +#: sphinx/templates/layout.html:67 +msgid "Quick search" +msgstr "Ricerca veloce" + +#: sphinx/templates/layout.html:69 +msgid "Go" +msgstr "Vai" + +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." +msgstr "Inserisci un modulo, classe o nome di funzione" + +#: sphinx/templates/layout.html:106 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Cerca in %(docstitle)s" + +#: sphinx/templates/layout.html:115 +msgid "About these documents" +msgstr "A proposito di questi documenti" + +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 +#: sphinx/templates/search.html:5 +msgid "Search" +msgstr "Cerca" + +#: sphinx/templates/layout.html:120 +msgid "Copyright" +msgstr "Copyright" + +#: sphinx/templates/layout.html:165 +#, python-format +msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." + +#: sphinx/templates/layout.html:167 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:170 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Ultimo Aggiornamento on %(last_updated)s." + +#: sphinx/templates/layout.html:173 +#, python-format +msgid "" +"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"%(sphinx_version)s." +msgstr "" +"Creato con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"%(sphinx_version)s." + +#: sphinx/templates/modindex.html:36 +msgid "Deprecated" +msgstr "Deprecato" + +#: sphinx/templates/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Cerca %(docstitle)s" + +#: sphinx/templates/search.html:7 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"Puoi effettuare una ricerca in questi documenti. Immetti le parole chiave" +" \n" +" della tua ricerca nel riquadro sottostante \"search\". Nota che la " +"funzione\n" +" di ricerca cerca automaticamente per tutte le parole. Le pagine\n" +" che contendono meno parole non compariranno nei risultati di ricerca." + +#: sphinx/templates/search.html:14 +msgid "search" +msgstr "cerca" + +#: sphinx/templates/search.html:20 +msgid "Your search did not match any results." +msgstr "La tua ricerca non ha ottenuto risultati" + +#: sphinx/templates/changes/frameset.html:5 +#: sphinx/templates/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Modifiche nella Versione %(version)s — %(docstitle)s" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/templates/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Lista delle modifiche generata automaticamente nella versione %(version)s" + +#: sphinx/templates/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Modifiche nela libreria" + +#: sphinx/templates/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Modifche nelle API C" + +#: sphinx/templates/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Altre modifiche" + +#: sphinx/writers/latex.py:173 +#, fuzzy +msgid "Release" +msgstr "Release" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Piattaforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[immagine]" + +#~ msgid "Suggest Change" +#~ msgstr "Suggerisci una modifica" + +#~ msgid "Keyword search" +#~ msgstr "Ricerca per parola chiave" + +#~ msgid "Most popular modules:" +#~ msgstr "Moduli pi? utilizzati" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Mostra solo i moduli disponibili su questa piattaforma" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Nota:</strong> Hai chiesto un URL " +#~ "non pi? valido. Abbiamo provato a " +#~ "ridirigerti verso il nuovo indirizzo, ma" +#~ " potrebbe non essere quello giusto" + Modified: doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -8,93 +8,37 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Yasushi MASUDA <whosaysni at gmail.com>\n" "Language-Team: ja <LL at li.org>\n" "Plural-Forms: nplurals=1; plural=0\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%Y ? %m ? %d ?" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "????" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "??" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "????????" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "?????" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "??" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "??" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "????" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "????????" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%Y ? %m ? %d ?" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "??" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "???????" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "?????" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "????????????" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "????????????????" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "????" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "????; %s" @@ -104,14 +48,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "????" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "????????" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "????????: %s" +msgid "%b %d, %Y" +msgstr "%Y ? %m ? %d ?" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[??]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "????" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "??" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "????????" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "?????" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "??" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "??" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -215,11 +193,16 @@ msgid "Return type" msgstr "?????" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "????" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "????" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%s????????????; %s" @@ -245,10 +228,15 @@ msgid "Author: " msgstr "??: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "??" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -345,6 +333,14 @@ msgid "built-in function" msgstr "??????" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "????????????????" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "????????????" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "???????" @@ -366,17 +362,17 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "????" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "?????????????????????????????????????????????????????????????????????????????????????" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "?????????????????? %s ?????????" @@ -452,68 +448,61 @@ msgid "next chapter" msgstr "????" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "?????" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "????????" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "?????????" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "??????" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "???????" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "??" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "?????????????????????????" -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "%(docstitle)s ????" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "????????????" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "??" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "???" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "????: %(last_updated)s" -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -522,15 +511,7 @@ "????????? <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s ????????" -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "??????????????:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "????????????????????????????" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "??" @@ -539,15 +520,6 @@ msgid "Search %(docstitle)s" msgstr "%(docstitle)s ????" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>??:</strong> ?????????????????? URL ???????????????? URL " -"?????????????????????????????????????????????" - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -593,3 +565,39 @@ msgid "Other changes" msgstr "??????" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "????" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "????????: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[??]" + +#~ msgid "Suggest Change" +#~ msgstr "????????" + +#~ msgid "Keyword search" +#~ msgstr "???????" + +#~ msgid "Most popular modules:" +#~ msgstr "??????????????:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "????????????????????????????" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>??:</strong> ?????????????????? URL " +#~ "???????????????? URL " +#~ "?????????????????????????????????????????????" + Modified: doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -7,93 +7,37 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n" "Language-Team: nl <LL at li.org>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d.%b.%Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Algemene index" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "Index" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Globale Module-index" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "modules" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "volgende" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "vorige" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Builtins" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Moduleniveau" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d. %B %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Index" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Module-index" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Zoekpagina" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Permanente link naar deze definitie" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Permanente link naar deze titel" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Release" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "Omgevingsvariabele; %s" @@ -103,14 +47,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Builtins" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Moduleniveau" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Platform: %s" +msgid "%b %d, %Y" +msgstr "%d.%b.%Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[afbeelding]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Algemene index" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "Index" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Globale Module-index" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "modules" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "volgende" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "vorige" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -214,11 +192,16 @@ msgid "Return type" msgstr "Return type" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parameters" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parameters" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%scommandolijn optie; %s" @@ -244,10 +227,15 @@ msgid "Author: " msgstr "Auteur: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Zie ook" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -344,6 +332,14 @@ msgid "built-in function" msgstr "ge?ntegreerde functie" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Permanente link naar deze titel" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Permanente link naar deze definitie" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Zoekresultaten verbergen" @@ -365,11 +361,11 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Zoekresultaten" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -377,7 +373,7 @@ "Uw zoekopdracht leverde geen resultaten op. Controleer of alle " "woordencorrect gespeld zijn en dat u genoeg categori?n hebt geselecteerd." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Zoeken voltooid, %s pagina(s) gevonden." @@ -453,68 +449,61 @@ msgid "next chapter" msgstr "volgend hoofdstuk" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Deze Pagina" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Wijziging Voorstellen" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Broncode weergeven" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Snel zoeken" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Trefwoord opzoeken" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Go" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Geef de naam van een module, klasse of functie." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Zoeken in %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Over deze documenten" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Zoeken" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Laatste aanpassing op %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -523,15 +512,7 @@ "Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Populairste modules:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Enkel modules weergeven die op deze platformen beschikbaar zijn" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Verouderd" @@ -540,16 +521,6 @@ msgid "Search %(docstitle)s" msgstr "Zoeken %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Opgelet:</strong> U heeft een verouderde URL aangevraagd op deze " -"server. Wij hebben probeerd u door te verwijzen naar de nieuwe locatie " -"van deze pagina, maar dat is misschien niet gelukt." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -601,3 +572,42 @@ msgid "Other changes" msgstr "Andere veranderingen" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Release" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platform: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[afbeelding]" + +#~ msgid "Suggest Change" +#~ msgstr "Wijziging Voorstellen" + +#~ msgid "Keyword search" +#~ msgstr "Trefwoord opzoeken" + +#~ msgid "Most popular modules:" +#~ msgstr "Populairste modules:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Enkel modules weergeven die op deze platformen beschikbaar zijn" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Opgelet:</strong> U heeft een " +#~ "verouderde URL aangevraagd op deze " +#~ "server. Wij hebben probeerd u door " +#~ "te verwijzen naar de nieuwe locatie " +#~ "van deze pagina, maar dat is " +#~ "misschien niet gelukt." + Modified: doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -4,7 +4,7 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-08-10 11:43+0000\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Micha? Kandulski <Michal.Kandulski at poczta.onet.pl>\n" "Language-Team: \n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && " @@ -12,86 +12,30 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%b %d %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Indeks og?lny" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "indeks" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Indeks modu??w" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "modu?y" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "dalej" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "wstecz" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Wbudowane" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Poziom modu?u" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%B %d %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Indeks" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Indeks modu??w" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Wyszukiwanie" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Sta?y odno?nik do tej definicji" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Sta?y odno?nik do tego nag??wka" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Wydanie" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "zmienna ?rodowiskowa; %s" @@ -101,14 +45,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Wbudowane" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Poziom modu?u" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Platforma: %s" +msgid "%b %d, %Y" +msgstr "%b %d %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[obrazek]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Indeks og?lny" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "indeks" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Indeks modu??w" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "modu?y" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "dalej" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "wstecz" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -212,11 +190,16 @@ msgid "Return type" msgstr "Typ zwracany" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parametry" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parametry" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%sopcja linii komend; %s" @@ -242,10 +225,15 @@ msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Zobacz tak?e" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -342,6 +330,14 @@ msgid "built-in function" msgstr "funkcja wbudowana" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Sta?y odno?nik do tego nag??wka" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Sta?y odno?nik do tej definicji" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Ukryj wyniki wyszukiwania" @@ -363,11 +359,11 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Wyniki wyszukiwania" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -375,7 +371,7 @@ "Nie znaleziono ?adnych pasuj?cych dokument?w. Upewnij si?, ?e wszystkie " "s?owa s? poprawnie wpisane i ?e wybra?e? wystarczaj?c?liczb? kategorii." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Przeszukiwanie zako?czone, znaleziono %s pasuj?cych stron." @@ -451,68 +447,61 @@ msgid "next chapter" msgstr "nast?pny rozdzia?" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Ta strona" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Zasugeruj zmian?" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Poka? ?r?d?o" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Szybkie wyszukiwanie" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Szukanie wg s?owa kluczowego" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Szukaj" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Wprowad? nazw? modu?u, klasy lub funkcji." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Szukaj po?r?d %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "O tych dokumentach" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Szukaj" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Ostatnia modyfikacja %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -521,15 +510,7 @@ "Utworzone przy pomocy <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>'a " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Najbardziej popularne modu?y:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Poka? modu?y dost?pne tylko na tych platformach" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Niezalecane" @@ -538,16 +519,6 @@ msgid "Search %(docstitle)s" msgstr "Przeszukaj %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Uwaga:</strong> Za??dano przedawnionego URL'a z tego serwera. " -"Nast?pi?a pr?ba przekierowania do nowej lokalizacji, ale mo?e ona by? " -"niew?a?ciwa." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -598,3 +569,40 @@ msgid "Other changes" msgstr "Inne zmiany" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Wydanie" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[obrazek]" + +#~ msgid "Suggest Change" +#~ msgstr "Zasugeruj zmian?" + +#~ msgid "Keyword search" +#~ msgstr "Szukanie wg s?owa kluczowego" + +#~ msgid "Most popular modules:" +#~ msgstr "Najbardziej popularne modu?y:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Poka? modu?y dost?pne tylko na tych platformach" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Uwaga:</strong> Za??dano przedawnionego " +#~ "URL'a z tego serwera. Nast?pi?a pr?ba" +#~ " przekierowania do nowej lokalizacji, ale" +#~ " mo?e ona by? niew?a?ciwa." + Modified: doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -8,93 +8,37 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: roger.demetrescu at gmail.com\n" "POT-Creation-Date: 2008-11-09 19:46+0100\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Roger Demetrescu <roger.demetrescu at gmail.com>\n" "Language-Team: pt_BR <roger.demetrescu at gmail.com>\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d/%m/%Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "?ndice Geral" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "?ndice" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "?ndice Global de M?dulos" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "m?dulos" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "pr?ximo" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "anterior" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr " (em " - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Internos" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "M?dulo" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d/%m/%Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "?ndice" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "?ndice do M?dulo" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "P?gina de Pesquisa" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Link permanente para esta defini??o" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Link permanente para este t?tulo" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Vers?o" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "v?riavel de ambiente; %s" @@ -104,14 +48,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Internos" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "M?dulo" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plataforma: %s" +msgid "%b %d, %Y" +msgstr "%d/%m/%Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[imagem]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "?ndice Geral" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "?ndice" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "?ndice Global de M?dulos" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "m?dulos" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "pr?ximo" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "anterior" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr " (em " #: sphinx/directives/desc.py:25 #, python-format @@ -215,11 +193,16 @@ msgid "Return type" msgstr "Tipo de retorno" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Par?metros" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Par?metros" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%sop??o de linha de comando; %s" @@ -245,10 +228,15 @@ msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Veja tamb?m" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "Por fazer" @@ -345,6 +333,14 @@ msgid "built-in function" msgstr "fun??o interna" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Link permanente para este t?tulo" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Link permanente para esta defini??o" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Esconder Resultados da Pesquisa" @@ -365,11 +361,11 @@ msgid ", in " msgstr ", em " -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Resultados da Pesquisa" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -378,7 +374,7 @@ " todas as palavras foram digitadas corretamente e de que voc? tenha " "selecionado o m?nimo de categorias." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -456,68 +452,61 @@ msgid "next chapter" msgstr "pr?ximo cap?tulo" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Esta P?gina" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Sugerir Altera??o" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Exibir Fonte" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Pesquisa r?pida" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Pesquisa de palavras-chave" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Ir" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Informe o nome de um m?dulo, classe ou fun??o." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Pesquisar dentro de %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Sobre estes documentos" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Pesquisar" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "?ltima atualiza??o em %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -526,15 +515,7 @@ "Criado com <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "M?dulos mais populares:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Exibir somente m?dulos dispon?veis nestas plataformas" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Obsoleto" @@ -543,16 +524,6 @@ msgid "Search %(docstitle)s" msgstr "Pesquisar em %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Nota:</strong> Voc? requisitou uma URL desatualizada deste " -"servidor. Tentamos redirecion?-lo para um novo endere?o desta p?gina, " -"por?m ? poss?vel que o mesmo n?o seja o correto." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -604,3 +575,41 @@ msgid "Other changes" msgstr "Outras altera??es" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Vers?o" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plataforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[imagem]" + +#~ msgid "Suggest Change" +#~ msgstr "Sugerir Altera??o" + +#~ msgid "Keyword search" +#~ msgstr "Pesquisa de palavras-chave" + +#~ msgid "Most popular modules:" +#~ msgstr "M?dulos mais populares:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Exibir somente m?dulos dispon?veis nestas plataformas" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Nota:</strong> Voc? requisitou uma URL" +#~ " desatualizada deste servidor. Tentamos " +#~ "redirecion?-lo para um novo endere?o " +#~ "desta p?gina, por?m ? poss?vel que " +#~ "o mesmo n?o seja o correto." + Modified: doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -4,93 +4,37 @@ "Project-Id-Version: Sphinx\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Rok Garbas <rok.garbas at gmail.com>\n" "Language-Team: Rok Garbas <rok.garbas at gmail.com>\n" "Plural-Forms: nplurals=1; plural=0\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d %b, %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Splo?ni abecedni seznam" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "abecedni seznam" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Splo?en Seznam Modulov" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "Moduli" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "naprej" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "nazaj" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "(v " - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Vgrajeni deli" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Nivo modula" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d %B, %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Abecedni seznam" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Seznam modulov" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Iskalna stran" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Povezava na to definicijo" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Povezava na naslov" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Izdaja" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "globalna spremenljivka; %s" @@ -100,14 +44,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Vgrajeni deli" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Nivo modula" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Platforma: %s" +msgid "%b %d, %Y" +msgstr "%d %b, %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[slika]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Splo?ni abecedni seznam" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "abecedni seznam" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Splo?en Seznam Modulov" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "Moduli" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "naprej" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "nazaj" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "(v " #: sphinx/directives/desc.py:25 #, python-format @@ -211,11 +189,16 @@ msgid "Return type" msgstr "Vrne tip" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parametri" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parametri" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%sopcija komandne linije; %s" @@ -241,10 +224,15 @@ msgid "Author: " msgstr "Avtor:" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Poglej tudi" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "Naredi" @@ -341,6 +329,14 @@ msgid "built-in function" msgstr "vgrajene funkcije" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Povezava na naslov" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Povezava na to definicijo" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Skrij Resultate Iskanja" @@ -361,11 +357,11 @@ msgid ", in " msgstr ", v " -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Rezultati Iskanja" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -373,7 +369,7 @@ "Za va?e iskanje ni rezultatov. Prosimo preglejte ali so vse besede " "pravilno ?rkovane in ali ste izbrali dovolj kategorij." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Iskanje kon?ano, najdeno %s strani, ki ustrezajo iskalnemu nizu." @@ -449,68 +445,61 @@ msgid "next chapter" msgstr "naslednje poglavje" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Ta stran" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Predlagaj spremembo" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Prika?i izvorno kodo" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Hitro iskanje" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Iskanje po klju?niih besedah" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Potrdi" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Vnesi ime mudla, razreda ali funkcije." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "I??i med %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "O teh dokumentih" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "I??i" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Vse pravice pridr?ane" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Vse pravice pridr?ane</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Vse pravice pridr?ane %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Zadnji? posodobljeno na %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -519,15 +508,7 @@ "Narejeno s <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Najbolj popularni moduli:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Prika?i module na razpolago na platformah" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Zastarelo" @@ -536,16 +517,6 @@ msgid "Search %(docstitle)s" msgstr "I??i %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Opomba:</strong> Va? zahtevek za URL s tega streznika je " -"zastaral. Posku?ali smo vas preusmeriti na novo lokacijo, vendar utegne " -"biti napa?na." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -595,3 +566,40 @@ msgid "Other changes" msgstr "Ostale spremembe" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Izdaja" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[slika]" + +#~ msgid "Suggest Change" +#~ msgstr "Predlagaj spremembo" + +#~ msgid "Keyword search" +#~ msgstr "Iskanje po klju?niih besedah" + +#~ msgid "Most popular modules:" +#~ msgstr "Najbolj popularni moduli:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Prika?i module na razpolago na platformah" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Opomba:</strong> Va? zahtevek za URL" +#~ " s tega streznika je zastaral. " +#~ "Posku?ali smo vas preusmeriti na novo" +#~ " lokacijo, vendar utegne biti napa?na." + Modified: doctools/trunk/sphinx/locale/sphinx.pot ============================================================================== --- doctools/trunk/sphinx/locale/sphinx.pot (original) +++ doctools/trunk/sphinx/locale/sphinx.pot Sun Jan 4 21:38:57 2009 @@ -6,111 +6,89 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Sphinx 0.5\n" +"Project-Id-Version: Sphinx 0.6\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" -"POT-Creation-Date: 2008-11-27 18:39+0100\n" +"POT-Creation-Date: 2008-12-28 23:40+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n" "Language-Team: LANGUAGE <LL at li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format -msgid "%b %d, %Y" -msgstr "" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "" - -#: sphinx/builder.py:427 -msgid "index" +msgid "%B %d, %Y" msgstr "" -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 +msgid "Index" msgstr "" -#: sphinx/builder.py:429 -msgid "modules" +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 +msgid "Module Index" msgstr "" -#: sphinx/builder.py:466 -msgid "next" +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 +msgid "Search Page" msgstr "" -#: sphinx/builder.py:473 -msgid "previous" +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 +#, python-format +msgid "environment variable; %s" msgstr "" -#: sphinx/builder.py:1054 -msgid " (in " +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" msgstr "" -#: sphinx/builder.py:1129 +#: sphinx/builders/changes.py:64 msgid "Builtins" msgstr "" -#: sphinx/builder.py:1131 +#: sphinx/builders/changes.py:66 msgid "Module level" msgstr "" -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/builders/html.py:115 #, python-format -msgid "%B %d, %Y" -msgstr "" - -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 -#: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 -msgid "Index" -msgstr "" - -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 -msgid "Module Index" -msgstr "" - -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 -msgid "Search Page" +msgid "%b %d, %Y" msgstr "" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" msgstr "" -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" +#: sphinx/builders/html.py:134 +msgid "index" msgstr "" -#: sphinx/latexwriter.py:172 -msgid "Release" +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" msgstr "" -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 -#, python-format -msgid "environment variable; %s" +#: sphinx/builders/html.py:136 +msgid "modules" msgstr "" -#: sphinx/roles.py:60 -#, python-format -msgid "Python Enhancement Proposals!PEP %s" +#: sphinx/builders/html.py:175 +msgid "next" msgstr "" -#: sphinx/textwriter.py:166 -#, python-format -msgid "Platform: %s" +#: sphinx/builders/html.py:182 +msgid "previous" msgstr "" -#: sphinx/textwriter.py:422 -msgid "[image]" +#: sphinx/builders/latex.py:155 +msgid " (in " msgstr "" #: sphinx/directives/desc.py:25 @@ -215,11 +193,15 @@ msgid "Return type" msgstr "" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +msgid "Parameter" +msgstr "" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "" @@ -245,10 +227,15 @@ msgid "Author: " msgstr "" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -345,6 +332,14 @@ msgid "built-in function" msgstr "" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "" @@ -365,17 +360,17 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -451,83 +446,67 @@ msgid "next chapter" msgstr "" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +msgid "Enter search terms or a module, class or function name." msgstr "" -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "" -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "" @@ -536,13 +515,6 @@ msgid "Search %(docstitle)s" msgstr "" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" - #: sphinx/templates/search.html:7 msgid "" "From here you can search these documents. Enter your search\n" @@ -587,3 +559,16 @@ msgid "Other changes" msgstr "" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "" + Modified: doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po Sun Jan 4 21:38:57 2009 @@ -8,93 +8,37 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-11-09 19:46+0100\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Fred Lin <gasolin at gmail.com>\n" "Language-Team: tw <LL at li.org>\n" "Plural-Forms: nplurals=1; plural=0\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.4\n" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%Y ? %m ? %d ?" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "???" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "??" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "??" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "???" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "???" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%Y ? %m ? %d ?" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "??" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "????" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "????" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "??" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "????; %s" @@ -104,14 +48,48 @@ msgid "Python Enhancement Proposals!PEP %s" msgstr "Python ????!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "???%s" +msgid "%b %d, %Y" +msgstr "%Y ? %m ? %d ?" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[??]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "???" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "??" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "??" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "???" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "???" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -215,11 +193,16 @@ msgid "Return type" msgstr "????" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "??" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "??" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%s?????; %s" @@ -245,10 +228,15 @@ msgid "Author: " msgstr "???" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "??" @@ -345,6 +333,14 @@ msgid "built-in function" msgstr "????" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "" @@ -365,17 +361,17 @@ msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "????" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -451,83 +447,68 @@ msgid "next chapter" msgstr "???" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "??" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "?????" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "????" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "?????" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "????????????????." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "? %(docstitle)s ???" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "??" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "????" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "??????? %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "???" @@ -536,13 +517,6 @@ msgid "Search %(docstitle)s" msgstr "?? %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" - #: sphinx/templates/search.html:7 msgid "" "From here you can search these documents. Enter your search\n" @@ -587,12 +561,36 @@ msgid "Other changes" msgstr "?????" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "??" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "???%s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[??]" + +#~ msgid "Suggest Change" +#~ msgstr "" + +#~ msgid "Keyword search" +#~ msgstr "?????" + +#~ msgid "Most popular modules:" +#~ msgstr "" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "" + #~ msgid "" -#~ "From here you can search these documents. Enter your search\n" -#~ " words into the box below and" -#~ " click \"search\". Note that the " -#~ "search\n" -#~ " function will automatically search for all of the words. Pages\n" -#~ " containing less words won't appear in the result list." +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." #~ msgstr "" Added: doctools/trunk/sphinx/pycode/Grammar.txt ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/Grammar.txt Sun Jan 4 21:38:57 2009 @@ -0,0 +1,155 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake <fdrake at acm.org> will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Commands for Kees Blom's railroad program +#diagram:token NAME +#diagram:token NUMBER +#diagram:token STRING +#diagram:token NEWLINE +#diagram:token ENDMARKER +#diagram:token INDENT +#diagram:output\input python.bla +#diagram:token DEDENT +#diagram:output\textwidth 20.04cm\oddsidemargin 0.0cm\evensidemargin 0.0cm +#diagram:rules + +# Start symbols for the grammar: +# file_input is a module or sequence of commands read from an input file; +# single_input is a single interactive statement; +# eval_input is the input for the eval() and input() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +file_input: (NEWLINE | stmt)* ENDMARKER +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ['->' test] ':' suite +parameters: '(' [typedargslist] ')' +typedargslist: ((tfpdef ['=' test] ',')* + ('*' [tname] (',' tname ['=' test])* [',' '**' tname] | '**' tname) + | tfpdef ['=' test] (',' tfpdef ['=' test])* [',']) +tname: NAME [':' test] +tfpdef: tname | '(' tfplist ')' +tfplist: tfpdef (',' tfpdef)* [','] +varargslist: ((vfpdef ['=' test] ',')* + ('*' [vname] (',' vname ['=' test])* [',' '**' vname] | '**' vname) + | vfpdef ['=' test] (',' vfpdef ['=' test])* [',']) +vname: NAME +vfpdef: vname | '(' vfplist ')' +vfplist: vfpdef (',' vfpdef)* [','] + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | exec_stmt | assert_stmt) +expr_stmt: testlist (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist))*) +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +print_stmt: 'print' ( [ test (',' test)* [','] ] | + '>>' test [ (',' test)+ [','] ] ) +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test | ',' test [',' test]]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +import_from: ('from' ('.'* dotted_name | '.'+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: ('global' | 'nonlocal') NAME (',' NAME)* +exec_stmt: 'exec' expr ['in' test [',' test]] +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' test [ with_var ] ':' suite +with_var: 'as' expr +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test [(',' | 'as') test]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +# Backward compatibility cruft to support: +# [ x for x in lambda: True, lambda: False if x() ] +# even while also allowing: +# lambda x: 5 if x else 2 +# (But not a mix of the two) +testlist_safe: old_test [(',' old_test)+ [',']] +old_test: or_test | old_lambdef +old_lambdef: 'lambda' [varargslist] ':' old_test + +test: or_test ['if' or_test 'else' test] | lambdef +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_gexp] ')' | + '[' [listmaker] ']' | + '{' [dictsetmaker] '}' | + '`' testlist1 '`' | + NAME | NUMBER | STRING+ | '.' '.' '.') +listmaker: test ( comp_for | (',' test)* [','] ) +testlist_gexp: test ( comp_for | (',' test)* [','] ) +lambdef: 'lambda' [varargslist] ':' test +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: expr (',' expr)* [','] +testlist: test (',' test)* [','] +dictsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) | + (test (comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +argument: test [comp_for] | test '=' test # Really [keyword '='] test + +comp_iter: comp_for | comp_if +comp_for: 'for' exprlist 'in' testlist_safe [comp_iter] +comp_if: 'if' old_test [comp_iter] + +testlist1: test (',' test)* + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [testlist] Added: doctools/trunk/sphinx/pycode/__init__.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/__init__.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,303 @@ +# -*- coding: utf-8 -*- +""" + sphinx.pycode + ~~~~~~~~~~~~~ + + Utilities parsing and analyzing Python code. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import sys +from os import path +from cStringIO import StringIO + +from sphinx.pycode import nodes +from sphinx.pycode.pgen2 import driver, token, tokenize, parse, literals +from sphinx.util.docstrings import prepare_docstring, prepare_commentdoc + + +# load the Python grammar +_grammarfile = path.join(path.dirname(__file__), 'Grammar.txt') +pygrammar = driver.load_grammar(_grammarfile) +pydriver = driver.Driver(pygrammar, convert=nodes.convert) + +# an object with attributes corresponding to token and symbol names +class sym: pass +for k, v in pygrammar.symbol2number.iteritems(): + setattr(sym, k, v) +for k, v in token.tok_name.iteritems(): + setattr(sym, v, k) + +# a dict mapping terminal and nonterminal numbers to their names +number2name = pygrammar.number2symbol.copy() +number2name.update(token.tok_name) + + +# a regex to recognize coding cookies +_coding_re = re.compile(r'coding[:=]\s*([-\w.]+)') + +_eq = nodes.Leaf(token.EQUAL, '=') + + +class AttrDocVisitor(nodes.NodeVisitor): + """ + Visitor that collects docstrings for attribute assignments on toplevel and + in classes. + + The docstrings can either be in special '#:' comments before the assignment + or in a docstring after it. + """ + def init(self, scope, encoding): + self.scope = scope + self.encoding = encoding + self.namespace = [] + self.collected = {} + + def visit_classdef(self, node): + self.namespace.append(node[1].value) + self.generic_visit(node) + self.namespace.pop() + + def visit_expr_stmt(self, node): + """Visit an assignment which may have a special comment before it.""" + if _eq not in node.children: + # not an assignment (we don't care for augmented assignments) + return + pnode = node[0] + prefix = pnode.get_prefix() + # if the assignment is the first statement on a new indentation + # level, its preceding whitespace and comments are not assigned + # to that token, but the first INDENT or DEDENT token + while not prefix: + pnode = pnode.get_prev_leaf() + if not pnode or pnode.type not in (token.INDENT, token.DEDENT): + break + prefix = pnode.get_prefix() + prefix = prefix.decode(self.encoding) + docstring = prepare_commentdoc(prefix) + if docstring: + self.add_docstring(node, docstring) + + def visit_simple_stmt(self, node): + """Visit a docstring statement which may have an assignment before.""" + if node[0].type != token.STRING: + # not a docstring; but still need to visit children + return self.generic_visit(node) + prev = node.get_prev_sibling() + if not prev: + return + if prev.type == sym.simple_stmt and \ + prev[0].type == sym.expr_stmt and _eq in prev[0].children: + # need to "eval" the string because it's returned in its original form + docstring = literals.evalString(node[0].value, self.encoding) + docstring = prepare_docstring(docstring) + self.add_docstring(prev[0], docstring) + + def visit_funcdef(self, node): + # don't descend into functions -- nothing interesting there + return + + def add_docstring(self, node, docstring): + # add an item for each assignment target + for i in range(0, len(node) - 1, 2): + target = node[i] + if target.type != token.NAME: + # don't care about complex targets + continue + namespace = '.'.join(self.namespace) + if namespace.startswith(self.scope): + self.collected[namespace, target.value] = docstring + + +class PycodeError(Exception): + def __str__(self): + res = self.args[0] + if len(self.args) > 1: + res += ' (exception was: %r)' % self.args[1] + return res + + +class ModuleAnalyzer(object): + # cache for analyzer objects -- caches both by module and file name + cache = {} + + @classmethod + def for_string(cls, string, modname, srcname='<string>'): + return cls(StringIO(string), modname, srcname) + + @classmethod + def for_file(cls, filename, modname): + if ('file', filename) in cls.cache: + return cls.cache['file', filename] + try: + fileobj = open(filename, 'r') + except Exception, err: + raise PycodeError('error opening %r' % filename, err) + obj = cls(fileobj, modname, filename) + cls.cache['file', filename] = obj + return obj + + @classmethod + def for_module(cls, modname): + if ('module', modname) in cls.cache: + entry = cls.cache['module', modname] + if isinstance(entry, PycodeError): + raise entry + return entry + + try: + if modname not in sys.modules: + try: + __import__(modname) + except ImportError, err: + raise PycodeError('error importing %r' % modname, err) + mod = sys.modules[modname] + if hasattr(mod, '__loader__'): + try: + source = mod.__loader__.get_source(modname) + except Exception, err: + raise PycodeError('error getting source for %r' % modname, err) + obj = cls.for_string(source, modname) + cls.cache['module', modname] = obj + return obj + filename = getattr(mod, '__file__', None) + if filename is None: + raise PycodeError('no source found for module %r' % modname) + filename = path.normpath(filename) + lfilename = filename.lower() + if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'): + filename = filename[:-1] + elif not lfilename.endswith('.py'): + raise PycodeError('source is not a .py file: %r' % filename) + if not path.isfile(filename): + raise PycodeError('source file is not present: %r' % filename) + obj = cls.for_file(filename, modname) + except PycodeError, err: + cls.cache['module', modname] = err + raise + cls.cache['module', modname] = obj + return obj + + def __init__(self, source, modname, srcname): + # name of the module + self.modname = modname + # name of the source file + self.srcname = srcname + # file-like object yielding source lines + self.source = source + + # will be filled by tokenize() + self.tokens = None + # will be filled by parse() + self.parsetree = None + # will be filled by find_attr_docs() + self.attr_docs = None + # will be filled by find_tags() + self.tags = None + + def tokenize(self): + """Generate tokens from the source.""" + if self.tokens is not None: + return + self.tokens = list(tokenize.generate_tokens(self.source.readline)) + self.source.close() + + def parse(self): + """Parse the generated source tokens.""" + if self.parsetree is not None: + return + self.tokenize() + self.parsetree = pydriver.parse_tokens(self.tokens) + # find the source code encoding + encoding = sys.getdefaultencoding() + comments = self.parsetree.get_prefix() + for line in comments.splitlines()[:2]: + match = _coding_re.search(line) + if match is not None: + encoding = match.group(1) + break + self.encoding = encoding + + def find_attr_docs(self, scope=''): + """Find class and module-level attributes and their documentation.""" + if self.attr_docs is not None: + return self.attr_docs + self.parse() + attr_visitor = AttrDocVisitor(number2name, scope, self.encoding) + attr_visitor.visit(self.parsetree) + self.attr_docs = attr_visitor.collected + return attr_visitor.collected + + def find_tags(self): + """Find class, function and method definitions and their location.""" + if self.tags is not None: + return self.tags + self.tokenize() + result = {} + namespace = [] + stack = [] + indent = 0 + defline = False + expect_indent = False + def tokeniter(ignore = (token.COMMENT, token.NL)): + for tokentup in self.tokens: + if tokentup[0] not in ignore: + yield tokentup + tokeniter = tokeniter() + for type, tok, spos, epos, line in tokeniter: + if expect_indent: + if type != token.INDENT: + # no suite -- one-line definition + assert stack + dtype, fullname, startline, _ = stack.pop() + endline = epos[0] + namespace.pop() + result[fullname] = (dtype, startline, endline) + expect_indent = False + if tok in ('def', 'class'): + name = tokeniter.next()[1] + namespace.append(name) + fullname = '.'.join(namespace) + stack.append((tok, fullname, spos[0], indent)) + defline = True + elif type == token.INDENT: + expect_indent = False + indent += 1 + elif type == token.DEDENT: + indent -= 1 + # if the stacklevel is the same as it was before the last + # def/class block, this dedent closes that block + if stack and indent == stack[-1][3]: + dtype, fullname, startline, _ = stack.pop() + endline = spos[0] + namespace.pop() + result[fullname] = (dtype, startline, endline) + elif type == token.NEWLINE: + # if this line contained a definition, expect an INDENT to start the + # suite; if there is no such INDENT it's a one-line definition + if defline: + defline = False + expect_indent = True + self.tags = result + return result + + +if __name__ == '__main__': + import time, pprint + x0 = time.time() + #ma = ModuleAnalyzer.for_file(__file__.rstrip('c'), 'sphinx.builders.html') + ma = ModuleAnalyzer.for_file('sphinx/builders/html.py', 'sphinx.builders.html') + ma.tokenize() + x1 = time.time() + ma.parse() + x2 = time.time() + #for (ns, name), doc in ma.find_attr_docs().iteritems(): + # print '>>', ns, name + # print '\n'.join(doc) + pprint.pprint(ma.find_tags()) + x3 = time.time() + #print nodes.nice_repr(ma.parsetree, number2name) + print "tokenizing %.4f, parsing %.4f, finding %.4f" % (x1-x0, x2-x1, x3-x2) Added: doctools/trunk/sphinx/pycode/nodes.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/nodes.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +""" + sphinx.pycode.nodes + ~~~~~~~~~~~~~~~~~~~ + + Parse tree node implementations. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + + +class BaseNode(object): + """ + Node superclass for both terminal and nonterminal nodes. + """ + + def _eq(self, other): + raise NotImplementedError + + def __eq__(self, other): + if self.__class__ is not other.__class__: + return NotImplemented + return self._eq(other) + + def __ne__(self, other): + if self.__class__ is not other.__class__: + return NotImplemented + return not self._eq(other) + + def get_prev_sibling(self): + """Return previous child in parent's children, or None.""" + if self.parent is None: + return None + for i, child in enumerate(self.parent.children): + if child is self: + if i == 0: + return None + return self.parent.children[i-1] + + def get_next_sibling(self): + """Return next child in parent's children, or None.""" + if self.parent is None: + return None + for i, child in enumerate(self.parent.children): + if child is self: + try: + return self.parent.children[i+1] + except IndexError: + return None + + def get_prev_leaf(self): + """Return the leaf node that precedes this node in the parse tree.""" + def last_child(node): + if isinstance(node, Leaf): + return node + elif not node.children: + return None + else: + return last_child(node.children[-1]) + if self.parent is None: + return None + prev = self.get_prev_sibling() + if isinstance(prev, Leaf): + return prev + elif prev is not None: + return last_child(prev) + return self.parent.get_prev_leaf() + + def get_next_leaf(self): + """Return self if leaf, otherwise the leaf node that succeeds this + node in the parse tree. + """ + node = self + while not isinstance(node, Leaf): + assert node.children + node = node.children[0] + return node + + def get_lineno(self): + """Return the line number which generated the invocant node.""" + return self.get_next_leaf().lineno + + def get_prefix(self): + """Return the prefix of the next leaf node.""" + # only leaves carry a prefix + return self.get_next_leaf().prefix + + +class Node(BaseNode): + """ + Node implementation for nonterminals. + """ + + def __init__(self, type, children, context=None): + # type of nonterminals is >= 256 + # assert type >= 256, type + self.type = type + self.children = list(children) + for ch in self.children: + # assert ch.parent is None, repr(ch) + ch.parent = self + + def __repr__(self): + return '%s(%s, %r)' % (self.__class__.__name__, self.type, self.children) + + def __str__(self): + """This reproduces the input source exactly.""" + return ''.join(map(str, self.children)) + + def _eq(self, other): + return (self.type, self.children) == (other.type, other.children) + + # support indexing the node directly instead of .children + + def __getitem__(self, index): + return self.children[index] + + def __iter__(self): + return iter(self.children) + + def __len__(self): + return len(self.children) + + +class Leaf(BaseNode): + """ + Node implementation for leaf nodes (terminals). + """ + prefix = '' # Whitespace and comments preceding this token in the input + lineno = 0 # Line where this token starts in the input + column = 0 # Column where this token tarts in the input + + def __init__(self, type, value, context=None): + # type of terminals is below 256 + # assert 0 <= type < 256, type + self.type = type + self.value = value + if context is not None: + self.prefix, (self.lineno, self.column) = context + + def __repr__(self): + return '%s(%r, %r, %r)' % (self.__class__.__name__, + self.type, self.value, self.prefix) + + def __str__(self): + """This reproduces the input source exactly.""" + return self.prefix + str(self.value) + + def _eq(self, other): + """Compares two nodes for equality.""" + return (self.type, self.value) == (other.type, other.value) + + +def convert(grammar, raw_node): + """Convert raw node to a Node or Leaf instance.""" + type, value, context, children = raw_node + if children or type in grammar.number2symbol: + # If there's exactly one child, return that child instead of + # creating a new node. + if len(children) == 1: + return children[0] + return Node(type, children, context=context) + else: + return Leaf(type, value, context=context) + + +def nice_repr(node, number2name, prefix=False): + def _repr(node): + if isinstance(node, Leaf): + return "%s(%r)" % (number2name[node.type], node.value) + else: + return "%s(%s)" % (number2name[node.type], + ', '.join(map(_repr, node.children))) + def _prepr(node): + if isinstance(node, Leaf): + return "%s(%r, %r)" % (number2name[node.type], node.prefix, node.value) + else: + return "%s(%s)" % (number2name[node.type], + ', '.join(map(_prepr, node.children))) + return (prefix and _prepr or _repr)(node) + + +class NodeVisitor(object): + def __init__(self, number2name, *args): + self.number2name = number2name + self.init(*args) + + def init(self, *args): + pass + + def visit(self, node): + """Visit a node.""" + method = 'visit_' + self.number2name[node.type] + visitor = getattr(self, method, self.generic_visit) + return visitor(node) + + def generic_visit(self, node): + """Called if no explicit visitor function exists for a node.""" + if isinstance(node, Node): + for child in node: + self.visit(child) Added: doctools/trunk/sphinx/pycode/pgen2/__init__.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/__init__.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,4 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""The pgen2 package.""" Added: doctools/trunk/sphinx/pycode/pgen2/driver.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/driver.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,145 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Parser driver. + +This provides a high-level interface to parse a file into a syntax tree. + +""" + +__author__ = "Guido van Rossum <guido at python.org>" + +__all__ = ["Driver", "load_grammar"] + +# Python imports +import os +import logging +import sys + +# Pgen imports +from sphinx.pycode.pgen2 import grammar, parse, token, tokenize, pgen + + +class Driver(object): + + def __init__(self, grammar, convert=None, logger=None): + self.grammar = grammar + if logger is None: + logger = logging.getLogger() + self.logger = logger + self.convert = convert + + def parse_tokens(self, tokens, debug=False): + """Parse a series of tokens and return the syntax tree.""" + # XXX Move the prefix computation into a wrapper around tokenize. + p = parse.Parser(self.grammar, self.convert) + p.setup() + lineno = 1 + column = 0 + type = value = start = end = line_text = None + prefix = "" + opmap = grammar.opmap + for type, value, start, end, line_text in tokens: + if start != (lineno, column): + assert (lineno, column) <= start, ((lineno, column), start) + s_lineno, s_column = start + if lineno < s_lineno: + prefix += "\n" * (s_lineno - lineno) + lineno = s_lineno + column = 0 + if column < s_column: + prefix += line_text[column:s_column] + column = s_column + if type in (tokenize.COMMENT, tokenize.NL): + prefix += value + lineno, column = end + if value.endswith("\n"): + lineno += 1 + column = 0 + continue + if type == token.OP: + type = opmap[value] + # if debug: + # self.logger.debug("%s %r (prefix=%r)", + # token.tok_name[type], value, prefix) + if p.addtoken(type, value, (prefix, start)): + # if debug: + # self.logger.debug("Stop.") + break + prefix = "" + lineno, column = end + if value.endswith("\n"): + lineno += 1 + column = 0 + else: + # We never broke out -- EOF is too soon (how can this happen???) + raise parse.ParseError("incomplete input", type, value, line_text) + return p.rootnode + + def parse_stream_raw(self, stream, debug=False): + """Parse a stream and return the syntax tree.""" + tokens = tokenize.generate_tokens(stream.readline) + return self.parse_tokens(tokens, debug) + + def parse_stream(self, stream, debug=False): + """Parse a stream and return the syntax tree.""" + return self.parse_stream_raw(stream, debug) + + def parse_file(self, filename, debug=False): + """Parse a file and return the syntax tree.""" + stream = open(filename) + try: + return self.parse_stream(stream, debug) + finally: + stream.close() + + def parse_string(self, text, debug=False): + """Parse a string and return the syntax tree.""" + tokens = tokenize.generate_tokens(generate_lines(text).next) + return self.parse_tokens(tokens, debug) + + +def generate_lines(text): + """Generator that behaves like readline without using StringIO.""" + for line in text.splitlines(True): + yield line + while True: + yield "" + + +def load_grammar(gt="Grammar.txt", gp=None, + save=True, force=False, logger=None): + """Load the grammar (maybe from a pickle).""" + if logger is None: + logger = logging.getLogger() + if gp is None: + head, tail = os.path.splitext(gt) + if tail == ".txt": + tail = "" + gp = head + tail + ".".join(map(str, sys.version_info)) + ".pickle" + if force or not _newer(gp, gt): + logger.info("Generating grammar tables from %s", gt) + g = pgen.generate_grammar(gt) + if save: + logger.info("Writing grammar tables to %s", gp) + try: + g.dump(gp) + except IOError, e: + logger.info("Writing failed:"+str(e)) + else: + g = grammar.Grammar() + g.load(gp) + return g + + +def _newer(a, b): + """Inquire whether file a was written since file b.""" + if not os.path.exists(a): + return False + if not os.path.exists(b): + return True + return os.path.getmtime(a) >= os.path.getmtime(b) Added: doctools/trunk/sphinx/pycode/pgen2/grammar.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/grammar.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,171 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""This module defines the data structures used to represent a grammar. + +These are a bit arcane because they are derived from the data +structures used by Python's 'pgen' parser generator. + +There's also a table here mapping operators to their names in the +token module; the Python tokenize module reports all operators as the +fallback token code OP, but the parser needs the actual token code. + +""" + +# Python imports +import pickle + +# Local imports +from sphinx.pycode.pgen2 import token, tokenize + + +class Grammar(object): + """Pgen parsing tables tables conversion class. + + Once initialized, this class supplies the grammar tables for the + parsing engine implemented by parse.py. The parsing engine + accesses the instance variables directly. The class here does not + provide initialization of the tables; several subclasses exist to + do this (see the conv and pgen modules). + + The load() method reads the tables from a pickle file, which is + much faster than the other ways offered by subclasses. The pickle + file is written by calling dump() (after loading the grammar + tables using a subclass). The report() method prints a readable + representation of the tables to stdout, for debugging. + + The instance variables are as follows: + + symbol2number -- a dict mapping symbol names to numbers. Symbol + numbers are always 256 or higher, to distinguish + them from token numbers, which are between 0 and + 255 (inclusive). + + number2symbol -- a dict mapping numbers to symbol names; + these two are each other's inverse. + + states -- a list of DFAs, where each DFA is a list of + states, each state is is a list of arcs, and each + arc is a (i, j) pair where i is a label and j is + a state number. The DFA number is the index into + this list. (This name is slightly confusing.) + Final states are represented by a special arc of + the form (0, j) where j is its own state number. + + dfas -- a dict mapping symbol numbers to (DFA, first) + pairs, where DFA is an item from the states list + above, and first is a set of tokens that can + begin this grammar rule (represented by a dict + whose values are always 1). + + labels -- a list of (x, y) pairs where x is either a token + number or a symbol number, and y is either None + or a string; the strings are keywords. The label + number is the index in this list; label numbers + are used to mark state transitions (arcs) in the + DFAs. + + start -- the number of the grammar's start symbol. + + keywords -- a dict mapping keyword strings to arc labels. + + tokens -- a dict mapping token numbers to arc labels. + + """ + + def __init__(self): + self.symbol2number = {} + self.number2symbol = {} + self.states = [] + self.dfas = {} + self.labels = [(0, "EMPTY")] + self.keywords = {} + self.tokens = {} + self.symbol2label = {} + self.start = 256 + + def dump(self, filename): + """Dump the grammar tables to a pickle file.""" + f = open(filename, "wb") + pickle.dump(self.__dict__, f, 2) + f.close() + + def load(self, filename): + """Load the grammar tables from a pickle file.""" + f = open(filename, "rb") + d = pickle.load(f) + f.close() + self.__dict__.update(d) + + def report(self): + """Dump the grammar tables to standard output, for debugging.""" + from pprint import pprint + print "s2n" + pprint(self.symbol2number) + print "n2s" + pprint(self.number2symbol) + print "states" + pprint(self.states) + print "dfas" + pprint(self.dfas) + print "labels" + pprint(self.labels) + print "start", self.start + + +# Map from operator to number (since tokenize doesn't do this) + +opmap_raw = """ +( LPAR +) RPAR +[ LSQB +] RSQB +: COLON +, COMMA +; SEMI ++ PLUS +- MINUS +* STAR +/ SLASH +| VBAR +& AMPER +< LESS +> GREATER += EQUAL +. DOT +% PERCENT +` BACKQUOTE +{ LBRACE +} RBRACE +@ AT +== EQEQUAL +!= NOTEQUAL +<> NOTEQUAL +<= LESSEQUAL +>= GREATEREQUAL +~ TILDE +^ CIRCUMFLEX +<< LEFTSHIFT +>> RIGHTSHIFT +** DOUBLESTAR ++= PLUSEQUAL +-= MINEQUAL +*= STAREQUAL +/= SLASHEQUAL +%= PERCENTEQUAL +&= AMPEREQUAL +|= VBAREQUAL +^= CIRCUMFLEXEQUAL +<<= LEFTSHIFTEQUAL +>>= RIGHTSHIFTEQUAL +**= DOUBLESTAREQUAL +// DOUBLESLASH +//= DOUBLESLASHEQUAL +-> RARROW +""" + +opmap = {} +for line in opmap_raw.splitlines(): + if line: + op, name = line.split() + opmap[op] = getattr(token, name) Added: doctools/trunk/sphinx/pycode/pgen2/literals.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/literals.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,96 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Extended to handle raw and unicode literals by Georg Brandl. + +"""Safely evaluate Python string literals without using eval().""" + +import re + +simple_escapes = {"a": "\a", + "b": "\b", + "f": "\f", + "n": "\n", + "r": "\r", + "t": "\t", + "v": "\v", + "'": "'", + '"': '"', + "\\": "\\"} + +def convert_hex(x, n): + if len(x) < n+1: + raise ValueError("invalid hex string escape ('\\%s')" % x) + try: + return int(x[1:], 16) + except ValueError: + raise ValueError("invalid hex string escape ('\\%s')" % x) + +def escape(m): + all, tail = m.group(0, 1) + assert all.startswith("\\") + esc = simple_escapes.get(tail) + if esc is not None: + return esc + elif tail.startswith("x"): + return chr(convert_hex(tail, 2)) + elif tail.startswith('u'): + return unichr(convert_hex(tail, 4)) + elif tail.startswith('U'): + return unichr(convert_hex(tail, 8)) + elif tail.startswith('N'): + import unicodedata + try: + return unicodedata.lookup(tail[1:-1]) + except KeyError: + raise ValueError("undefined character name %r" % tail[1:-1]) + else: + try: + return chr(int(tail, 8)) + except ValueError: + raise ValueError("invalid octal string escape ('\\%s')" % tail) + +def escaperaw(m): + all, tail = m.group(0, 1) + if tail.startswith('u'): + return unichr(convert_hex(tail, 4)) + elif tail.startswith('U'): + return unichr(convert_hex(tail, 8)) + else: + return all + +escape_re = re.compile(r"\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3})") +uni_escape_re = re.compile(r"\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}|" + r"u[0-9a-fA-F]{0,4}|U[0-9a-fA-F]{0,8}|N\{.+?\})") + +def evalString(s, encoding=None): + regex = escape_re + repl = escape + if encoding: + s = s.decode(encoding) + if s.startswith('u') or s.startswith('U'): + regex = uni_escape_re + s = s[1:] + if s.startswith('r') or s.startswith('R'): + repl = escaperaw + s = s[1:] + assert s.startswith("'") or s.startswith('"'), repr(s[:1]) + q = s[0] + if s[:3] == q*3: + q = q*3 + assert s.endswith(q), repr(s[-len(q):]) + assert len(s) >= 2*len(q) + s = s[len(q):-len(q)] + return regex.sub(repl, s) + +def test(): + for i in range(256): + c = chr(i) + s = repr(c) + e = evalString(s) + if e != c: + print i, c, s, e + + +if __name__ == "__main__": + test() Added: doctools/trunk/sphinx/pycode/pgen2/parse.c ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/parse.c Sun Jan 4 21:38:57 2009 @@ -0,0 +1,3261 @@ +/* Generated by Cython 0.9.8.1 on Thu Jan 1 23:45:38 2009 */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#include "structmember.h" +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#if PY_VERSION_HEX < 0x02040000 + #define METH_COEXIST 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) + #define PyNumber_Index(o) PyNumber_Int(o) + #define PyIndex_Check(o) PyNumber_Check(o) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + + typedef struct { + void *buf; + Py_ssize_t len; + int readonly; + const char *format; + int ndim; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + Py_ssize_t itemsize; + void *internal; + } Py_buffer; + + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_LOCK 0x0002 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyString_Type PyBytes_Type + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define PyBytes_Type PyString_Type +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif +#else + #define _USE_MATH_DEFINES +#endif +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +#include <math.h> +#define __PYX_HAVE_API__sphinx__pycode__pgen2__parse + + +#ifdef __GNUC__ +#define INLINE __inline__ +#elif _WIN32 +#define INLINE __inline +#else +#define INLINE +#endif + +typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ + + + +static int __pyx_skip_dispatch = 0; + + +/* Type Conversion Predeclarations */ + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyBytes_FromString PyString_FromString +#define __Pyx_PyBytes_AsString PyString_AsString +#else +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_AsString PyBytes_AsString +#endif + +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static INLINE int __Pyx_PyObject_IsTrue(PyObject* x); +static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x); +static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x); +static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b); + +#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x)) +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) + +static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x); +static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x); +static INLINE char __pyx_PyInt_char(PyObject* x); +static INLINE short __pyx_PyInt_short(PyObject* x); +static INLINE int __pyx_PyInt_int(PyObject* x); +static INLINE long __pyx_PyInt_long(PyObject* x); +static INLINE signed char __pyx_PyInt_signed_char(PyObject* x); +static INLINE signed short __pyx_PyInt_signed_short(PyObject* x); +static INLINE signed int __pyx_PyInt_signed_int(PyObject* x); +static INLINE signed long __pyx_PyInt_signed_long(PyObject* x); +static INLINE long double __pyx_PyInt_long_double(PyObject* x); +#ifdef __GNUC__ +/* Test for GCC > 2.95 */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#else /* __GNUC__ > 2 ... */ +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; +static const char **__pyx_f; + +static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ + +static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) { + PyObject *r; + if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { + r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + } + else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) { + r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + } + else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned)) + r = PySequence_GetItem(o, i); + else { + PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); + if (!j) + return 0; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + } + return r; +} + +static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (PyList_Append(L, x) < 0) return NULL; + Py_INCREF(Py_None); + return Py_None; // this is just to have an accurate signature + } + else { + return PyObject_CallMethod(L, "append", "(O)", x); + } +} + +static INLINE int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v, int is_unsigned) { + int r; + if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { + Py_DECREF(PyList_GET_ITEM(o, i)); + Py_INCREF(v); + PyList_SET_ITEM(o, i, v); + return 1; + } + else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0) || !is_unsigned)) + r = PySequence_SetItem(o, i, v); + else { + PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); + if (!j) + return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + } + return r; +} + +static void __Pyx_WriteUnraisable(const char *name); /*proto*/ + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static void __Pyx_AddTraceback(const char *funcname); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + +/* Type declarations */ + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":31 + * + * + * cdef class Parser: # <<<<<<<<<<<<<< + * cdef public grammar, stack, rootnode, used_names + * cdef _grammar_dfas, _grammar_labels, _grammar_keywords, _grammar_tokens + */ + +struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser { + PyObject_HEAD + struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_vtab; + PyObject *grammar; + PyObject *stack; + PyObject *rootnode; + PyObject *used_names; + PyObject *_grammar_dfas; + PyObject *_grammar_labels; + PyObject *_grammar_keywords; + PyObject *_grammar_tokens; + PyObject *_grammar_number2symbol; +}; + + +struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser { + int (*classify)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *); + void (*shift)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *); + void (*push)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *); + void (*pop)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *); + PyObject *(*convert)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *); +}; +static struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser; +/* Module declarations from sphinx.pycode.pgen2.parse */ + +static PyTypeObject *__pyx_ptype_6sphinx_6pycode_5pgen2_5parse_Parser = 0; + + +/* Implementation of sphinx.pycode.pgen2.parse */ +static char __pyx_k_2[] = "Exception to signal the parser is stuck."; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static char __pyx_k___init__[] = "__init__"; +static PyObject *__pyx_kp___init__; +static char __pyx_k_setup[] = "setup"; +static PyObject *__pyx_kp_setup; +static char __pyx_k_addtoken[] = "addtoken"; +static PyObject *__pyx_kp_addtoken; +static char __pyx_k_1[] = "sphinx.pycode.nodes"; +static PyObject *__pyx_kp_1; +static char __pyx_k_Node[] = "Node"; +static PyObject *__pyx_kp_Node; +static char __pyx_k_Leaf[] = "Leaf"; +static PyObject *__pyx_kp_Leaf; +static char __pyx_k_ParseError[] = "ParseError"; +static PyObject *__pyx_kp_ParseError; +static char __pyx_k_Exception[] = "Exception"; +static PyObject *__pyx_kp_Exception; +static char __pyx_k_msg[] = "msg"; +static PyObject *__pyx_kp_msg; +static char __pyx_k_type[] = "type"; +static PyObject *__pyx_kp_type; +static char __pyx_k_value[] = "value"; +static PyObject *__pyx_kp_value; +static char __pyx_k_context[] = "context"; +static PyObject *__pyx_kp_context; +static char __pyx_k_dfas[] = "dfas"; +static PyObject *__pyx_kp_dfas; +static char __pyx_k_labels[] = "labels"; +static PyObject *__pyx_kp_labels; +static char __pyx_k_keywords[] = "keywords"; +static PyObject *__pyx_kp_keywords; +static char __pyx_k_tokens[] = "tokens"; +static PyObject *__pyx_kp_tokens; +static char __pyx_k_4[] = "number2symbol"; +static PyObject *__pyx_kp_4; +static char __pyx_k_start[] = "start"; +static PyObject *__pyx_kp_start; +static char __pyx_k_add[] = "add"; +static PyObject *__pyx_kp_add; +static char __pyx_k_get[] = "get"; +static PyObject *__pyx_kp_get; +static char __pyx_k_append[] = "append"; +static PyObject *__pyx_kp_append; +static char __pyx_k_pop[] = "pop"; +static PyObject *__pyx_kp_pop; +static char __pyx_k_used_names[] = "used_names"; +static PyObject *__pyx_kp_used_names; +static PyObject *__pyx_kp_2; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_kp_3; +static char __pyx_k_3[] = "%s: type=%r, value=%r, context=%r"; +static PyObject *__pyx_kp_5; +static PyObject *__pyx_kp_6; +static char __pyx_k_5[] = "too much input"; +static char __pyx_k_6[] = "bad input"; +static PyObject *__pyx_kp_7; +static char __pyx_k_7[] = "bad token"; + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":22 + * """Exception to signal the parser is stuck.""" + * + * def __init__(self, msg, type, value, context): # <<<<<<<<<<<<<< + * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + * (msg, type, value, context)) + */ + +static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__ = {"__init__", (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_context = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"self","msg","type","value","context",0}; + __pyx_self = __pyx_self; + if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 5)) { + __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); + __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 2); + __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 3); + __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 4); + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_msg, &__pyx_v_type, &__pyx_v_value, &__pyx_v_context))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4; + __pyx_L3_error:; + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.ParseError.__init__"); + return NULL; + __pyx_L4:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":23 + * + * def __init__(self, msg, type, value, context): + * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % # <<<<<<<<<<<<<< + * (msg, type, value, context)) + * self.msg = msg + */ + __pyx_1 = PyObject_GetAttr(__pyx_builtin_Exception, __pyx_kp___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":24 + * def __init__(self, msg, type, value, context): + * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + * (msg, type, value, context)) # <<<<<<<<<<<<<< + * self.msg = msg + * self.type = type + */ + __pyx_2 = PyTuple_New(4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_msg); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_msg); + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_type); + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_value); + Py_INCREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_context); + __pyx_3 = PyNumber_Remainder(__pyx_kp_3, ((PyObject *)__pyx_2)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":25 + * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + * (msg, type, value, context)) + * self.msg = msg # <<<<<<<<<<<<<< + * self.type = type + * self.value = value + */ + if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":26 + * (msg, type, value, context)) + * self.msg = msg + * self.type = type # <<<<<<<<<<<<<< + * self.value = value + * self.context = context + */ + if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_type, __pyx_v_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":27 + * self.msg = msg + * self.type = type + * self.value = value # <<<<<<<<<<<<<< + * self.context = context + * + */ + if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":28 + * self.type = type + * self.value = value + * self.context = context # <<<<<<<<<<<<<< + * + * + */ + if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.ParseError.__init__"); + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":36 + * cdef _grammar_number2symbol + * + * def __init__(self, grammar, convert=None): # <<<<<<<<<<<<<< + * self.grammar = grammar + * #self.convert = convert or noconvert + */ + +static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_grammar = 0; + PyObject *__pyx_v_convert = 0; + int __pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {"grammar","convert",0}; + __pyx_v_convert = Py_None; + if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { + __pyx_v_grammar = PyTuple_GET_ITEM(__pyx_args, 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_convert = PyTuple_GET_ITEM(__pyx_args, 1); + } + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_grammar, &__pyx_v_convert))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4; + __pyx_L3_error:; + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.__init__"); + return -1; + __pyx_L4:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":37 + * + * def __init__(self, grammar, convert=None): + * self.grammar = grammar # <<<<<<<<<<<<<< + * #self.convert = convert or noconvert + * + */ + Py_INCREF(__pyx_v_grammar); + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar = __pyx_v_grammar; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":40 + * #self.convert = convert or noconvert + * + * self._grammar_dfas = grammar.dfas # <<<<<<<<<<<<<< + * self._grammar_labels = grammar.labels + * self._grammar_keywords = grammar.keywords + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_dfas); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas = __pyx_1; + __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":41 + * + * self._grammar_dfas = grammar.dfas + * self._grammar_labels = grammar.labels # <<<<<<<<<<<<<< + * self._grammar_keywords = grammar.keywords + * self._grammar_tokens = grammar.tokens + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_labels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels = __pyx_1; + __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":42 + * self._grammar_dfas = grammar.dfas + * self._grammar_labels = grammar.labels + * self._grammar_keywords = grammar.keywords # <<<<<<<<<<<<<< + * self._grammar_tokens = grammar.tokens + * self._grammar_number2symbol = grammar.number2symbol + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_keywords); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords = __pyx_1; + __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":43 + * self._grammar_labels = grammar.labels + * self._grammar_keywords = grammar.keywords + * self._grammar_tokens = grammar.tokens # <<<<<<<<<<<<<< + * self._grammar_number2symbol = grammar.number2symbol + * + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_tokens); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens = __pyx_1; + __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":44 + * self._grammar_keywords = grammar.keywords + * self._grammar_tokens = grammar.tokens + * self._grammar_number2symbol = grammar.number2symbol # <<<<<<<<<<<<<< + * + * def setup(self, start=None): + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol = __pyx_1; + __pyx_1 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.__init__"); + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":46 + * self._grammar_number2symbol = grammar.number2symbol + * + * def setup(self, start=None): # <<<<<<<<<<<<<< + * if start is None: + * start = self.grammar.start + */ + +static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_start = 0; + PyObject *__pyx_v_newnode; + PyObject *__pyx_v_stackentry; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"start",0}; + __pyx_v_start = Py_None; + if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { + if (PyTuple_GET_SIZE(__pyx_args) > 0) { + __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0); + } + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_start))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4; + __pyx_L3_error:; + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.setup"); + return NULL; + __pyx_L4:; + Py_INCREF(__pyx_v_start); + __pyx_v_newnode = Py_None; Py_INCREF(Py_None); + __pyx_v_stackentry = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":47 + * + * def setup(self, start=None): + * if start is None: # <<<<<<<<<<<<<< + * start = self.grammar.start + * # Each stack entry is a tuple: (dfa, state, node). + */ + __pyx_1 = (__pyx_v_start == Py_None); + if (__pyx_1) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":48 + * def setup(self, start=None): + * if start is None: + * start = self.grammar.start # <<<<<<<<<<<<<< + * # Each stack entry is a tuple: (dfa, state, node). + * # A node is a tuple: (type, value, context, children), + */ + __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar, __pyx_kp_start); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_start); + __pyx_v_start = __pyx_2; + __pyx_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":52 + * # A node is a tuple: (type, value, context, children), + * # where children is a list of nodes or None, and context may be None. + * newnode = (start, None, None, []) # <<<<<<<<<<<<<< + * stackentry = (self._grammar_dfas[start], 0, newnode) + * self.stack = [stackentry] + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_start); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_start); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_3, 1, Py_None); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_3, 2, Py_None); + PyTuple_SET_ITEM(__pyx_3, 3, ((PyObject *)__pyx_2)); + __pyx_2 = 0; + Py_DECREF(__pyx_v_newnode); + __pyx_v_newnode = ((PyObject *)__pyx_3); + __pyx_3 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":53 + * # where children is a list of nodes or None, and context may be None. + * newnode = (start, None, None, []) + * stackentry = (self._grammar_dfas[start], 0, newnode) # <<<<<<<<<<<<<< + * self.stack = [stackentry] + * self.rootnode = None + */ + __pyx_2 = PyObject_GetItem(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas, __pyx_v_start); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + Py_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0); + Py_INCREF(__pyx_v_newnode); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_newnode); + __pyx_2 = 0; + Py_DECREF(__pyx_v_stackentry); + __pyx_v_stackentry = ((PyObject *)__pyx_3); + __pyx_3 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":54 + * newnode = (start, None, None, []) + * stackentry = (self._grammar_dfas[start], 0, newnode) + * self.stack = [stackentry] # <<<<<<<<<<<<<< + * self.rootnode = None + * self.used_names = set() # Aliased to self.rootnode.used_names in pop() + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_stackentry); + PyList_SET_ITEM(__pyx_2, 0, __pyx_v_stackentry); + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack = ((PyObject *)__pyx_2); + __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":55 + * stackentry = (self._grammar_dfas[start], 0, newnode) + * self.stack = [stackentry] + * self.rootnode = None # <<<<<<<<<<<<<< + * self.used_names = set() # Aliased to self.rootnode.used_names in pop() + * + */ + Py_INCREF(Py_None); + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->rootnode); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->rootnode = Py_None; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":56 + * self.stack = [stackentry] + * self.rootnode = None + * self.used_names = set() # Aliased to self.rootnode.used_names in pop() # <<<<<<<<<<<<<< + * + * def addtoken(self, type, value, context): + */ + __pyx_3 = PyObject_Call(((PyObject*)&PySet_Type), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names); + ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names = __pyx_3; + __pyx_3 = 0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.setup"); + __pyx_r = NULL; + __pyx_L0:; + Py_DECREF(__pyx_v_newnode); + Py_DECREF(__pyx_v_stackentry); + Py_DECREF(__pyx_v_start); + return __pyx_r; +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":58 + * self.used_names = set() # Aliased to self.rootnode.used_names in pop() + * + * def addtoken(self, type, value, context): # <<<<<<<<<<<<<< + * """Add a token; return True iff this is the end of the program.""" + * cdef int ilabel, i, t, state, newstate + */ + +static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken[] = "Add a token; return True iff this is the end of the program."; +static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_context = 0; + int __pyx_v_ilabel; + int __pyx_v_i; + int __pyx_v_t; + int __pyx_v_state; + int __pyx_v_newstate; + PyObject *__pyx_v_dfa; + PyObject *__pyx_v_node; + PyObject *__pyx_v_states; + PyObject *__pyx_v_first; + PyObject *__pyx_v_arcs; + PyObject *__pyx_v_v; + PyObject *__pyx_v_itsdfa; + PyObject *__pyx_v_itsstates; + PyObject *__pyx_v_itsfirst; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + int __pyx_5; + Py_ssize_t __pyx_6 = 0; + PyObject *__pyx_7 = 0; + int __pyx_8; + static char *__pyx_argnames[] = {"type","value","context",0}; + if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 3)) { + __pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 0); + __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 2); + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_type, &__pyx_v_value, &__pyx_v_context))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4; + __pyx_L3_error:; + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.addtoken"); + return NULL; + __pyx_L4:; + __pyx_v_dfa = Py_None; Py_INCREF(Py_None); + __pyx_v_node = Py_None; Py_INCREF(Py_None); + __pyx_v_states = Py_None; Py_INCREF(Py_None); + __pyx_v_first = Py_None; Py_INCREF(Py_None); + __pyx_v_arcs = Py_None; Py_INCREF(Py_None); + __pyx_v_v = Py_None; Py_INCREF(Py_None); + __pyx_v_itsdfa = Py_None; Py_INCREF(Py_None); + __pyx_v_itsstates = Py_None; Py_INCREF(Py_None); + __pyx_v_itsfirst = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":62 + * cdef int ilabel, i, t, state, newstate + * # Map from token to label + * ilabel = self.classify(type, value, context) # <<<<<<<<<<<<<< + * # Loop until the token is shifted; may raise exceptions + * while True: + */ + __pyx_v_ilabel = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->classify(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_context); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":64 + * ilabel = self.classify(type, value, context) + * # Loop until the token is shifted; may raise exceptions + * while True: # <<<<<<<<<<<<<< + * dfa, state, node = self.stack[-1] + * states, first = dfa + */ + while (1) { + __pyx_1 = 1; + if (!__pyx_1) break; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":65 + * # Loop until the token is shifted; may raise exceptions + * while True: + * dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<< + * states, first = dfa + * arcs = states[state] + */ + __pyx_2 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack, -1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) { + PyObject* tuple = __pyx_2; + __pyx_4 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_4); + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_4; + __pyx_4 = 0; + __pyx_4 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_4); + __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_state = __pyx_5; + __pyx_4 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_4); + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_4; + __pyx_4 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + else { + __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_4; + __pyx_4 = 0; + __pyx_4 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_state = __pyx_5; + __pyx_4 = __Pyx_UnpackItem(__pyx_3, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_4; + __pyx_4 = 0; + if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":66 + * while True: + * dfa, state, node = self.stack[-1] + * states, first = dfa # <<<<<<<<<<<<<< + * arcs = states[state] + * # Look for a state with this label + */ + if (PyTuple_CheckExact(__pyx_v_dfa) && PyTuple_GET_SIZE(__pyx_v_dfa) == 2) { + PyObject* tuple = __pyx_v_dfa; + __pyx_2 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_states); + __pyx_v_states = __pyx_2; + __pyx_2 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_first); + __pyx_v_first = __pyx_3; + __pyx_3 = 0; + } + else { + __pyx_4 = PyObject_GetIter(__pyx_v_dfa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_states); + __pyx_v_states = __pyx_2; + __pyx_2 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_first); + __pyx_v_first = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":67 + * dfa, state, node = self.stack[-1] + * states, first = dfa + * arcs = states[state] # <<<<<<<<<<<<<< + * # Look for a state with this label + * for i, newstate in arcs: + */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_states, __pyx_v_state, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_arcs); + __pyx_v_arcs = __pyx_2; + __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":69 + * arcs = states[state] + * # Look for a state with this label + * for i, newstate in arcs: # <<<<<<<<<<<<<< + * t, v = self._grammar_labels[i] + * if ilabel == i: + */ + if (PyList_CheckExact(__pyx_v_arcs) || PyTuple_CheckExact(__pyx_v_arcs)) { + __pyx_6 = 0; __pyx_3 = __pyx_v_arcs; Py_INCREF(__pyx_3); + } else { + __pyx_6 = -1; __pyx_3 = PyObject_GetIter(__pyx_v_arcs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + for (;;) { + if (likely(PyList_CheckExact(__pyx_3))) { + if (__pyx_6 >= PyList_GET_SIZE(__pyx_3)) break; + __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_6); Py_INCREF(__pyx_4); __pyx_6++; + } else if (likely(PyTuple_CheckExact(__pyx_3))) { + if (__pyx_6 >= PyTuple_GET_SIZE(__pyx_3)) break; + __pyx_4 = PyTuple_GET_ITEM(__pyx_3, __pyx_6); Py_INCREF(__pyx_4); __pyx_6++; + } else { + __pyx_4 = PyIter_Next(__pyx_3); + if (!__pyx_4) { + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + } + if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) { + PyObject* tuple = __pyx_4; + __pyx_7 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_7); + __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_v_i = __pyx_5; + __pyx_7 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_7); + __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_v_newstate = __pyx_5; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + else { + __pyx_2 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_7 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_v_i = __pyx_5; + __pyx_7 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_v_newstate = __pyx_5; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":70 + * # Look for a state with this label + * for i, newstate in arcs: + * t, v = self._grammar_labels[i] # <<<<<<<<<<<<<< + * if ilabel == i: + * # Look it up in the list of labels + */ + __pyx_7 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels, __pyx_v_i, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyTuple_CheckExact(__pyx_7) && PyTuple_GET_SIZE(__pyx_7) == 2) { + PyObject* tuple = __pyx_7; + __pyx_2 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_2); + __pyx_5 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_v_t = __pyx_5; + __pyx_2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_v); + __pyx_v_v = __pyx_2; + __pyx_2 = 0; + Py_DECREF(__pyx_7); __pyx_7 = 0; + } + else { + __pyx_4 = PyObject_GetIter(__pyx_7); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_v_t = __pyx_5; + __pyx_2 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_v); + __pyx_v_v = __pyx_2; + __pyx_2 = 0; + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":71 + * for i, newstate in arcs: + * t, v = self._grammar_labels[i] + * if ilabel == i: # <<<<<<<<<<<<<< + * # Look it up in the list of labels + * ## assert t < 256 + */ + __pyx_1 = (__pyx_v_ilabel == __pyx_v_i); + if (__pyx_1) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":75 + * ## assert t < 256 + * # Shift a token; we're done with it + * self.shift(type, value, newstate, context) # <<<<<<<<<<<<<< + * # Pop while we are in an accept-only state + * state = newstate + */ + __pyx_2 = PyInt_FromLong(__pyx_v_newstate); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->shift(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_2, __pyx_v_context); + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":77 + * self.shift(type, value, newstate, context) + * # Pop while we are in an accept-only state + * state = newstate # <<<<<<<<<<<<<< + * while states[state] == [(0, state)]: + * self.pop() + */ + __pyx_v_state = __pyx_v_newstate; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":78 + * # Pop while we are in an accept-only state + * state = newstate + * while states[state] == [(0, state)]: # <<<<<<<<<<<<<< + * self.pop() + * if not self.stack: + */ + while (1) { + __pyx_7 = __Pyx_GetItemInt(__pyx_v_states, __pyx_v_state, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_4 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyList_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyList_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_2)); + __pyx_2 = 0; + __pyx_2 = PyObject_RichCompare(__pyx_7, ((PyObject *)__pyx_4), Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (!__pyx_1) break; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":79 + * state = newstate + * while states[state] == [(0, state)]: + * self.pop() # <<<<<<<<<<<<<< + * if not self.stack: + * # Done parsing! + */ + ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->pop(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":80 + * while states[state] == [(0, state)]: + * self.pop() + * if not self.stack: # <<<<<<<<<<<<<< + * # Done parsing! + * return True + */ + __pyx_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_8 = (!__pyx_1); + if (__pyx_8) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":82 + * if not self.stack: + * # Done parsing! + * return True # <<<<<<<<<<<<<< + * dfa, state, node = self.stack[-1] + * states, first = dfa + */ + __pyx_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_7; + __pyx_7 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":83 + * # Done parsing! + * return True + * dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<< + * states, first = dfa + * # Done with this token + */ + __pyx_4 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack, -1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 3) { + PyObject* tuple = __pyx_4; + __pyx_7 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_7); + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_7; + __pyx_7 = 0; + __pyx_7 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_7); + __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_v_state = __pyx_5; + __pyx_7 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_7); + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_7; + __pyx_7 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + else { + __pyx_2 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_7 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_7; + __pyx_7 = 0; + __pyx_7 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_v_state = __pyx_5; + __pyx_7 = __Pyx_UnpackItem(__pyx_2, 2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_7; + __pyx_7 = 0; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":84 + * return True + * dfa, state, node = self.stack[-1] + * states, first = dfa # <<<<<<<<<<<<<< + * # Done with this token + * return False + */ + if (PyTuple_CheckExact(__pyx_v_dfa) && PyTuple_GET_SIZE(__pyx_v_dfa) == 2) { + PyObject* tuple = __pyx_v_dfa; + __pyx_4 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_4); + Py_DECREF(__pyx_v_states); + __pyx_v_states = __pyx_4; + __pyx_4 = 0; + __pyx_2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_first); + __pyx_v_first = __pyx_2; + __pyx_2 = 0; + } + else { + __pyx_7 = PyObject_GetIter(__pyx_v_dfa); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_4 = __Pyx_UnpackItem(__pyx_7, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_states); + __pyx_v_states = __pyx_4; + __pyx_4 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_7, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_first); + __pyx_v_first = __pyx_2; + __pyx_2 = 0; + if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + } + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":86 + * states, first = dfa + * # Done with this token + * return False # <<<<<<<<<<<<<< + * elif t >= 256: + * # See if it's a symbol and if we're in its first set + */ + __pyx_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_4; + __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L0; + goto __pyx_L9; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":87 + * # Done with this token + * return False + * elif t >= 256: # <<<<<<<<<<<<<< + * # See if it's a symbol and if we're in its first set + * itsdfa = self._grammar_dfas[t] + */ + __pyx_1 = (__pyx_v_t >= 256); + if (__pyx_1) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":89 + * elif t >= 256: + * # See if it's a symbol and if we're in its first set + * itsdfa = self._grammar_dfas[t] # <<<<<<<<<<<<<< + * itsstates, itsfirst = itsdfa + * if ilabel in itsfirst: + */ + __pyx_2 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas, __pyx_v_t, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_itsdfa); + __pyx_v_itsdfa = __pyx_2; + __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":90 + * # See if it's a symbol and if we're in its first set + * itsdfa = self._grammar_dfas[t] + * itsstates, itsfirst = itsdfa # <<<<<<<<<<<<<< + * if ilabel in itsfirst: + * # Push a symbol + */ + if (PyTuple_CheckExact(__pyx_v_itsdfa) && PyTuple_GET_SIZE(__pyx_v_itsdfa) == 2) { + PyObject* tuple = __pyx_v_itsdfa; + __pyx_4 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_4); + Py_DECREF(__pyx_v_itsstates); + __pyx_v_itsstates = __pyx_4; + __pyx_4 = 0; + __pyx_2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_itsfirst); + __pyx_v_itsfirst = __pyx_2; + __pyx_2 = 0; + } + else { + __pyx_7 = PyObject_GetIter(__pyx_v_itsdfa); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_4 = __Pyx_UnpackItem(__pyx_7, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_itsstates); + __pyx_v_itsstates = __pyx_4; + __pyx_4 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_7, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_itsfirst); + __pyx_v_itsfirst = __pyx_2; + __pyx_2 = 0; + if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":91 + * itsdfa = self._grammar_dfas[t] + * itsstates, itsfirst = itsdfa + * if ilabel in itsfirst: # <<<<<<<<<<<<<< + * # Push a symbol + * self.push(t, itsdfa, newstate, context) + */ + __pyx_4 = PyInt_FromLong(__pyx_v_ilabel); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_8 = (PySequence_Contains(__pyx_v_itsfirst, __pyx_4)); if (unlikely(__pyx_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + if (__pyx_8) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":93 + * if ilabel in itsfirst: + * # Push a symbol + * self.push(t, itsdfa, newstate, context) # <<<<<<<<<<<<<< + * break # To continue the outer while loop + * else: + */ + __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_7 = PyInt_FromLong(__pyx_v_newstate); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->push(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_2, __pyx_v_itsdfa, __pyx_7, __pyx_v_context); + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_7); __pyx_7 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":94 + * # Push a symbol + * self.push(t, itsdfa, newstate, context) + * break # To continue the outer while loop # <<<<<<<<<<<<<< + * else: + * if (0, state) in arcs: + */ + goto __pyx_L8; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L9; + } + __pyx_L9:; + } + /*else*/ { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":96 + * break # To continue the outer while loop + * else: + * if (0, state) in arcs: # <<<<<<<<<<<<<< + * # An accepting state, pop it and try something else + * self.pop() + */ + __pyx_4 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); + __pyx_4 = 0; + __pyx_1 = (PySequence_Contains(__pyx_v_arcs, ((PyObject *)__pyx_2))); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; + if (__pyx_1) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":98 + * if (0, state) in arcs: + * # An accepting state, pop it and try something else + * self.pop() # <<<<<<<<<<<<<< + * if not self.stack: + * # Done parsing, but another token is input + */ + ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->pop(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":99 + * # An accepting state, pop it and try something else + * self.pop() + * if not self.stack: # <<<<<<<<<<<<<< + * # Done parsing, but another token is input + * raise ParseError("too much input", + */ + __pyx_8 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack); if (unlikely(__pyx_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = (!__pyx_8); + if (__pyx_1) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":101 + * if not self.stack: + * # Done parsing, but another token is input + * raise ParseError("too much input", # <<<<<<<<<<<<<< + * type, value, context) + * else: + */ + __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":102 + * # Done parsing, but another token is input + * raise ParseError("too much input", + * type, value, context) # <<<<<<<<<<<<<< + * else: + * # No success finding a transition + */ + __pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_kp_5); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_5); + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_type); + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_value); + Py_INCREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_4, 3, __pyx_v_context); + __pyx_2 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L15; + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":105 + * else: + * # No success finding a transition + * raise ParseError("bad input", type, value, context) # <<<<<<<<<<<<<< + * + * cdef int classify(self, type, value, context): + */ + __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_kp_6); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_6); + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_type); + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_value); + Py_INCREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_4, 3, __pyx_v_context); + __pyx_2 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L14:; + } + __pyx_L8:; + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_7); + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.addtoken"); + __pyx_r = NULL; + __pyx_L0:; + Py_DECREF(__pyx_v_dfa); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_states); + Py_DECREF(__pyx_v_first); + Py_DECREF(__pyx_v_arcs); + Py_DECREF(__pyx_v_v); + Py_DECREF(__pyx_v_itsdfa); + Py_DECREF(__pyx_v_itsstates); + Py_DECREF(__pyx_v_itsfirst); + return __pyx_r; +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":107 + * raise ParseError("bad input", type, value, context) + * + * cdef int classify(self, type, value, context): # <<<<<<<<<<<<<< + * """Turn a token into a label. (Internal)""" + * if type == NAME: + */ + +static int __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_context) { + PyObject *__pyx_v_ilabel; + int __pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + int __pyx_5; + __pyx_v_ilabel = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":109 + * cdef int classify(self, type, value, context): + * """Turn a token into a label. (Internal)""" + * if type == NAME: # <<<<<<<<<<<<<< + * # Keep a listing of all used names + * self.used_names.add(value) + */ + __pyx_1 = PyObject_RichCompare(__pyx_v_type, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (__pyx_2) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":111 + * if type == NAME: + * # Keep a listing of all used names + * self.used_names.add(value) # <<<<<<<<<<<<<< + * # Check for reserved words + * ilabel = self._grammar_keywords.get(value) + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self->used_names, __pyx_kp_add); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value); + __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":113 + * self.used_names.add(value) + * # Check for reserved words + * ilabel = self._grammar_keywords.get(value) # <<<<<<<<<<<<<< + * if ilabel is not None: + * return ilabel + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self->_grammar_keywords, __pyx_kp_get); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value); + __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; + Py_DECREF(__pyx_v_ilabel); + __pyx_v_ilabel = __pyx_4; + __pyx_4 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":114 + * # Check for reserved words + * ilabel = self._grammar_keywords.get(value) + * if ilabel is not None: # <<<<<<<<<<<<<< + * return ilabel + * ilabel = self._grammar_tokens.get(type) + */ + __pyx_2 = (__pyx_v_ilabel != Py_None); + if (__pyx_2) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":115 + * ilabel = self._grammar_keywords.get(value) + * if ilabel is not None: + * return ilabel # <<<<<<<<<<<<<< + * ilabel = self._grammar_tokens.get(type) + * if ilabel is None: + */ + __pyx_5 = __pyx_PyInt_int(__pyx_v_ilabel); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_5; + goto __pyx_L0; + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":116 + * if ilabel is not None: + * return ilabel + * ilabel = self._grammar_tokens.get(type) # <<<<<<<<<<<<<< + * if ilabel is None: + * raise ParseError("bad token", type, value, context) + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self->_grammar_tokens, __pyx_kp_get); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_type); + __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; + Py_DECREF(__pyx_v_ilabel); + __pyx_v_ilabel = __pyx_4; + __pyx_4 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":117 + * return ilabel + * ilabel = self._grammar_tokens.get(type) + * if ilabel is None: # <<<<<<<<<<<<<< + * raise ParseError("bad token", type, value, context) + * return ilabel + */ + __pyx_2 = (__pyx_v_ilabel == Py_None); + if (__pyx_2) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":118 + * ilabel = self._grammar_tokens.get(type) + * if ilabel is None: + * raise ParseError("bad token", type, value, context) # <<<<<<<<<<<<<< + * return ilabel + * + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_kp_7); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_7); + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_type); + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_value); + Py_INCREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_3, 3, __pyx_v_context); + __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":119 + * if ilabel is None: + * raise ParseError("bad token", type, value, context) + * return ilabel # <<<<<<<<<<<<<< + * + * cdef void shift(self, type, value, newstate, context): + */ + __pyx_5 = __pyx_PyInt_int(__pyx_v_ilabel); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_5; + goto __pyx_L0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.classify"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_ilabel); + return __pyx_r; +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":121 + * return ilabel + * + * cdef void shift(self, type, value, newstate, context): # <<<<<<<<<<<<<< + * """Shift a token. (Internal)""" + * dfa, state, node = self.stack[-1] + */ + +static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_shift(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_newstate, PyObject *__pyx_v_context) { + PyObject *__pyx_v_dfa; + PyObject *__pyx_v_state; + PyObject *__pyx_v_node; + PyObject *__pyx_v_newnode; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + __pyx_v_dfa = Py_None; Py_INCREF(Py_None); + __pyx_v_state = Py_None; Py_INCREF(Py_None); + __pyx_v_node = Py_None; Py_INCREF(Py_None); + __pyx_v_newnode = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":123 + * cdef void shift(self, type, value, newstate, context): + * """Shift a token. (Internal)""" + * dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<< + * newnode = (type, value, context, None) + * newnode = self.convert(newnode) + */ + __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->stack, -1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) { + PyObject* tuple = __pyx_1; + __pyx_3 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_state); + __pyx_v_state = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_3; + __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + else { + __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_state); + __pyx_v_state = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":124 + * """Shift a token. (Internal)""" + * dfa, state, node = self.stack[-1] + * newnode = (type, value, context, None) # <<<<<<<<<<<<<< + * newnode = self.convert(newnode) + * if newnode is not None: + */ + __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_type); + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_value); + Py_INCREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_context); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_3, 3, Py_None); + Py_DECREF(__pyx_v_newnode); + __pyx_v_newnode = ((PyObject *)__pyx_3); + __pyx_3 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":125 + * dfa, state, node = self.stack[-1] + * newnode = (type, value, context, None) + * newnode = self.convert(newnode) # <<<<<<<<<<<<<< + * if newnode is not None: + * node[-1].append(newnode) + */ + __pyx_1 = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self->__pyx_vtab)->convert(__pyx_v_self, __pyx_v_newnode); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_newnode); + __pyx_v_newnode = __pyx_1; + __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":126 + * newnode = (type, value, context, None) + * newnode = self.convert(newnode) + * if newnode is not None: # <<<<<<<<<<<<<< + * node[-1].append(newnode) + * self.stack[-1] = (dfa, newstate, node) + */ + __pyx_4 = (__pyx_v_newnode != Py_None); + if (__pyx_4) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":127 + * newnode = self.convert(newnode) + * if newnode is not None: + * node[-1].append(newnode) # <<<<<<<<<<<<<< + * self.stack[-1] = (dfa, newstate, node) + * + */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_node, -1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = __Pyx_PyObject_Append(__pyx_2, __pyx_v_newnode); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":128 + * if newnode is not None: + * node[-1].append(newnode) + * self.stack[-1] = (dfa, newstate, node) # <<<<<<<<<<<<<< + * + * cdef void push(self, type, newdfa, newstate, context): + */ + __pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_dfa); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_dfa); + Py_INCREF(__pyx_v_newstate); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_newstate); + Py_INCREF(__pyx_v_node); + PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_node); + if (__Pyx_SetItemInt(__pyx_v_self->stack, -1, ((PyObject *)__pyx_1), 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; + + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.shift"); + __pyx_L0:; + Py_DECREF(__pyx_v_dfa); + Py_DECREF(__pyx_v_state); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_newnode); +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":130 + * self.stack[-1] = (dfa, newstate, node) + * + * cdef void push(self, type, newdfa, newstate, context): # <<<<<<<<<<<<<< + * """Push a nonterminal. (Internal)""" + * dfa, state, node = self.stack[-1] + */ + +static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_push(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_newdfa, PyObject *__pyx_v_newstate, PyObject *__pyx_v_context) { + PyObject *__pyx_v_dfa; + PyObject *__pyx_v_state; + PyObject *__pyx_v_node; + PyObject *__pyx_v_newnode; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + __pyx_v_dfa = Py_None; Py_INCREF(Py_None); + __pyx_v_state = Py_None; Py_INCREF(Py_None); + __pyx_v_node = Py_None; Py_INCREF(Py_None); + __pyx_v_newnode = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":132 + * cdef void push(self, type, newdfa, newstate, context): + * """Push a nonterminal. (Internal)""" + * dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<< + * newnode = (type, None, context, []) + * self.stack[-1] = (dfa, newstate, node) + */ + __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->stack, -1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) { + PyObject* tuple = __pyx_1; + __pyx_3 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_state); + __pyx_v_state = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_3; + __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + else { + __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_state); + __pyx_v_state = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":133 + * """Push a nonterminal. (Internal)""" + * dfa, state, node = self.stack[-1] + * newnode = (type, None, context, []) # <<<<<<<<<<<<<< + * self.stack[-1] = (dfa, newstate, node) + * self.stack.append((newdfa, 0, newnode)) + */ + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = PyTuple_New(4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_type); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_1, 1, Py_None); + Py_INCREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_context); + PyTuple_SET_ITEM(__pyx_1, 3, ((PyObject *)__pyx_3)); + __pyx_3 = 0; + Py_DECREF(__pyx_v_newnode); + __pyx_v_newnode = ((PyObject *)__pyx_1); + __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":134 + * dfa, state, node = self.stack[-1] + * newnode = (type, None, context, []) + * self.stack[-1] = (dfa, newstate, node) # <<<<<<<<<<<<<< + * self.stack.append((newdfa, 0, newnode)) + * + */ + __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_dfa); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_dfa); + Py_INCREF(__pyx_v_newstate); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_newstate); + Py_INCREF(__pyx_v_node); + PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_node); + if (__Pyx_SetItemInt(__pyx_v_self->stack, -1, ((PyObject *)__pyx_2), 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":135 + * newnode = (type, None, context, []) + * self.stack[-1] = (dfa, newstate, node) + * self.stack.append((newdfa, 0, newnode)) # <<<<<<<<<<<<<< + * + * cdef void pop(self): + */ + __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_newdfa); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_newdfa); + Py_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0); + Py_INCREF(__pyx_v_newnode); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_newnode); + __pyx_1 = __Pyx_PyObject_Append(__pyx_v_self->stack, ((PyObject *)__pyx_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.push"); + __pyx_L0:; + Py_DECREF(__pyx_v_dfa); + Py_DECREF(__pyx_v_state); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_newnode); +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":137 + * self.stack.append((newdfa, 0, newnode)) + * + * cdef void pop(self): # <<<<<<<<<<<<<< + * """Pop a nonterminal. (Internal)""" + * popdfa, popstate, popnode = self.stack.pop() + */ + +static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self) { + PyObject *__pyx_v_popdfa; + PyObject *__pyx_v_popstate; + PyObject *__pyx_v_popnode; + PyObject *__pyx_v_newnode; + PyObject *__pyx_v_dfa; + PyObject *__pyx_v_state; + PyObject *__pyx_v_node; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + __pyx_v_popdfa = Py_None; Py_INCREF(Py_None); + __pyx_v_popstate = Py_None; Py_INCREF(Py_None); + __pyx_v_popnode = Py_None; Py_INCREF(Py_None); + __pyx_v_newnode = Py_None; Py_INCREF(Py_None); + __pyx_v_dfa = Py_None; Py_INCREF(Py_None); + __pyx_v_state = Py_None; Py_INCREF(Py_None); + __pyx_v_node = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":139 + * cdef void pop(self): + * """Pop a nonterminal. (Internal)""" + * popdfa, popstate, popnode = self.stack.pop() # <<<<<<<<<<<<<< + * newnode = self.convert(popnode) + * if newnode is not None: + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self->stack, __pyx_kp_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) { + PyObject* tuple = __pyx_2; + __pyx_3 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_popdfa); + __pyx_v_popdfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_popstate); + __pyx_v_popstate = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_popnode); + __pyx_v_popnode = __pyx_3; + __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + else { + __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_popdfa); + __pyx_v_popdfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_popstate); + __pyx_v_popstate = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_popnode); + __pyx_v_popnode = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":140 + * """Pop a nonterminal. (Internal)""" + * popdfa, popstate, popnode = self.stack.pop() + * newnode = self.convert(popnode) # <<<<<<<<<<<<<< + * if newnode is not None: + * if self.stack: + */ + __pyx_3 = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self->__pyx_vtab)->convert(__pyx_v_self, __pyx_v_popnode); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_newnode); + __pyx_v_newnode = __pyx_3; + __pyx_3 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":141 + * popdfa, popstate, popnode = self.stack.pop() + * newnode = self.convert(popnode) + * if newnode is not None: # <<<<<<<<<<<<<< + * if self.stack: + * dfa, state, node = self.stack[-1] + */ + __pyx_4 = (__pyx_v_newnode != Py_None); + if (__pyx_4) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":142 + * newnode = self.convert(popnode) + * if newnode is not None: + * if self.stack: # <<<<<<<<<<<<<< + * dfa, state, node = self.stack[-1] + * node[-1].append(newnode) + */ + __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->stack); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_4) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":143 + * if newnode is not None: + * if self.stack: + * dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<< + * node[-1].append(newnode) + * else: + */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_self->stack, -1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) { + PyObject* tuple = __pyx_2; + __pyx_3 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_state); + __pyx_v_state = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_3; + __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + else { + __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_dfa); + __pyx_v_dfa = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_state); + __pyx_v_state = __pyx_3; + __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_node); + __pyx_v_node = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":144 + * if self.stack: + * dfa, state, node = self.stack[-1] + * node[-1].append(newnode) # <<<<<<<<<<<<<< + * else: + * self.rootnode = newnode + */ + __pyx_3 = __Pyx_GetItemInt(__pyx_v_node, -1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = __Pyx_PyObject_Append(__pyx_3, __pyx_v_newnode); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":146 + * node[-1].append(newnode) + * else: + * self.rootnode = newnode # <<<<<<<<<<<<<< + * self.rootnode.used_names = self.used_names + * + */ + Py_INCREF(__pyx_v_newnode); + Py_DECREF(__pyx_v_self->rootnode); + __pyx_v_self->rootnode = __pyx_v_newnode; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":147 + * else: + * self.rootnode = newnode + * self.rootnode.used_names = self.used_names # <<<<<<<<<<<<<< + * + * cdef convert(self, raw_node): + */ + if (PyObject_SetAttr(__pyx_v_self->rootnode, __pyx_kp_used_names, __pyx_v_self->used_names) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.pop"); + __pyx_L0:; + Py_DECREF(__pyx_v_popdfa); + Py_DECREF(__pyx_v_popstate); + Py_DECREF(__pyx_v_popnode); + Py_DECREF(__pyx_v_newnode); + Py_DECREF(__pyx_v_dfa); + Py_DECREF(__pyx_v_state); + Py_DECREF(__pyx_v_node); +} + +/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":149 + * self.rootnode.used_names = self.used_names + * + * cdef convert(self, raw_node): # <<<<<<<<<<<<<< + * type, value, context, children = raw_node + * if children or type in self._grammar_number2symbol: + */ + +static PyObject *__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_convert(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_raw_node) { + PyObject *__pyx_v_type; + PyObject *__pyx_v_value; + PyObject *__pyx_v_context; + PyObject *__pyx_v_children; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + Py_ssize_t __pyx_4 = 0; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + __pyx_v_type = Py_None; Py_INCREF(Py_None); + __pyx_v_value = Py_None; Py_INCREF(Py_None); + __pyx_v_context = Py_None; Py_INCREF(Py_None); + __pyx_v_children = Py_None; Py_INCREF(Py_None); + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":150 + * + * cdef convert(self, raw_node): + * type, value, context, children = raw_node # <<<<<<<<<<<<<< + * if children or type in self._grammar_number2symbol: + * # If there's exactly one child, return that child instead of + */ + if (PyTuple_CheckExact(__pyx_v_raw_node) && PyTuple_GET_SIZE(__pyx_v_raw_node) == 4) { + PyObject* tuple = __pyx_v_raw_node; + __pyx_2 = PyTuple_GET_ITEM(tuple, 0); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_type); + __pyx_v_type = __pyx_2; + __pyx_2 = 0; + __pyx_2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_value); + __pyx_v_value = __pyx_2; + __pyx_2 = 0; + __pyx_2 = PyTuple_GET_ITEM(tuple, 2); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_context); + __pyx_v_context = __pyx_2; + __pyx_2 = 0; + __pyx_2 = PyTuple_GET_ITEM(tuple, 3); + Py_INCREF(__pyx_2); + Py_DECREF(__pyx_v_children); + __pyx_v_children = __pyx_2; + __pyx_2 = 0; + } + else { + __pyx_1 = PyObject_GetIter(__pyx_v_raw_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_type); + __pyx_v_type = __pyx_2; + __pyx_2 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_value); + __pyx_v_value = __pyx_2; + __pyx_2 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_context); + __pyx_v_context = __pyx_2; + __pyx_2 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1, 3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_v_children); + __pyx_v_children = __pyx_2; + __pyx_2 = 0; + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":151 + * cdef convert(self, raw_node): + * type, value, context, children = raw_node + * if children or type in self._grammar_number2symbol: # <<<<<<<<<<<<<< + * # If there's exactly one child, return that child instead of + * # creating a new node. + */ + __pyx_2 = __pyx_v_children; + Py_INCREF(__pyx_2); + __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_3) { + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = (PySequence_Contains(__pyx_v_self->_grammar_number2symbol, __pyx_v_type)); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = __Pyx_PyBool_FromLong(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_3) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":154 + * # If there's exactly one child, return that child instead of + * # creating a new node. + * if len(children) == 1: # <<<<<<<<<<<<<< + * return children[0] + * return Node(type, children, context=context) + */ + __pyx_4 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = (__pyx_4 == 1); + if (__pyx_3) { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":155 + * # creating a new node. + * if len(children) == 1: + * return children[0] # <<<<<<<<<<<<<< + * return Node(type, children, context=context) + * else: + */ + __pyx_1 = __Pyx_GetItemInt(__pyx_v_children, 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":156 + * if len(children) == 1: + * return children[0] + * return Node(type, children, context=context) # <<<<<<<<<<<<<< + * else: + * return Leaf(type, value, context=context) + */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_Node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_type); + Py_INCREF(__pyx_v_children); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_children); + __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_5, __pyx_kp_context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; + __pyx_r = __pyx_6; + __pyx_6 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":158 + * return Node(type, children, context=context) + * else: + * return Leaf(type, value, context=context) # <<<<<<<<<<<<<< + */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_Leaf); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_type); + Py_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_value); + __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_5, __pyx_kp_context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; + __pyx_r = __pyx_6; + __pyx_6 = 0; + goto __pyx_L0; + } + __pyx_L3:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.convert"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_type); + Py_DECREF(__pyx_v_value); + Py_DECREF(__pyx_v_context); + Py_DECREF(__pyx_v_children); + return __pyx_r; +} +static struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser; + +static PyObject *__pyx_tp_new_6sphinx_6pycode_5pgen2_5parse_Parser(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p; + PyObject *o = (*t->tp_alloc)(t, 0); + if (!o) return 0; + p = ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o); + p->__pyx_vtab = __pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser; + p->grammar = Py_None; Py_INCREF(Py_None); + p->stack = Py_None; Py_INCREF(Py_None); + p->rootnode = Py_None; Py_INCREF(Py_None); + p->used_names = Py_None; Py_INCREF(Py_None); + p->_grammar_dfas = Py_None; Py_INCREF(Py_None); + p->_grammar_labels = Py_None; Py_INCREF(Py_None); + p->_grammar_keywords = Py_None; Py_INCREF(Py_None); + p->_grammar_tokens = Py_None; Py_INCREF(Py_None); + p->_grammar_number2symbol = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o) { + struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p = (struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o; + Py_XDECREF(p->grammar); + Py_XDECREF(p->stack); + Py_XDECREF(p->rootnode); + Py_XDECREF(p->used_names); + Py_XDECREF(p->_grammar_dfas); + Py_XDECREF(p->_grammar_labels); + Py_XDECREF(p->_grammar_keywords); + Py_XDECREF(p->_grammar_tokens); + Py_XDECREF(p->_grammar_number2symbol); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p = (struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o; + if (p->grammar) { + e = (*v)(p->grammar, a); if (e) return e; + } + if (p->stack) { + e = (*v)(p->stack, a); if (e) return e; + } + if (p->rootnode) { + e = (*v)(p->rootnode, a); if (e) return e; + } + if (p->used_names) { + e = (*v)(p->used_names, a); if (e) return e; + } + if (p->_grammar_dfas) { + e = (*v)(p->_grammar_dfas, a); if (e) return e; + } + if (p->_grammar_labels) { + e = (*v)(p->_grammar_labels, a); if (e) return e; + } + if (p->_grammar_keywords) { + e = (*v)(p->_grammar_keywords, a); if (e) return e; + } + if (p->_grammar_tokens) { + e = (*v)(p->_grammar_tokens, a); if (e) return e; + } + if (p->_grammar_number2symbol) { + e = (*v)(p->_grammar_number2symbol, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o) { + struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p = (struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o; + PyObject* tmp; + tmp = ((PyObject*)p->grammar); + p->grammar = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->stack); + p->stack = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->rootnode); + p->rootnode = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->used_names); + p->used_names = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_grammar_dfas); + p->_grammar_dfas = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_grammar_labels); + p->_grammar_labels = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_grammar_keywords); + p->_grammar_keywords = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_grammar_tokens); + p->_grammar_tokens = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_grammar_number2symbol); + p->_grammar_number2symbol = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static struct PyMethodDef __pyx_methods_6sphinx_6pycode_5pgen2_5parse_Parser[] = { + {"setup", (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup, METH_VARARGS|METH_KEYWORDS, 0}, + {"addtoken", (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken}, + {0, 0, 0, 0} +}; + +static struct PyMemberDef __pyx_members_6sphinx_6pycode_5pgen2_5parse_Parser[] = { + {"grammar", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, grammar), 0, 0}, + {"stack", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, stack), 0, 0}, + {"rootnode", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, rootnode), 0, 0}, + {"used_names", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, used_names), 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Parser = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Parser = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Parser = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Parser = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER) + 0, /*bf_getbuffer*/ + #endif + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER) + 0, /*bf_releasebuffer*/ + #endif +}; + +PyTypeObject __pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser = { + PyVarObject_HEAD_INIT(0, 0) + "sphinx.pycode.pgen2.parse.Parser", /*tp_name*/ + sizeof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + &__pyx_tp_as_number_Parser, /*tp_as_number*/ + &__pyx_tp_as_sequence_Parser, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Parser, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Parser, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_traverse*/ + __pyx_tp_clear_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_methods*/ + __pyx_members_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static struct PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +static void __pyx_init_filenames(void); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "parse", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 0, 1, 1}, + {&__pyx_kp_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 1, 1}, + {&__pyx_kp_addtoken, __pyx_k_addtoken, sizeof(__pyx_k_addtoken), 0, 1, 1}, + {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 1}, + {&__pyx_kp_Node, __pyx_k_Node, sizeof(__pyx_k_Node), 1, 1, 1}, + {&__pyx_kp_Leaf, __pyx_k_Leaf, sizeof(__pyx_k_Leaf), 1, 1, 1}, + {&__pyx_kp_ParseError, __pyx_k_ParseError, sizeof(__pyx_k_ParseError), 0, 1, 1}, + {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1}, + {&__pyx_kp_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 1, 1, 1}, + {&__pyx_kp_type, __pyx_k_type, sizeof(__pyx_k_type), 1, 1, 1}, + {&__pyx_kp_value, __pyx_k_value, sizeof(__pyx_k_value), 1, 1, 1}, + {&__pyx_kp_context, __pyx_k_context, sizeof(__pyx_k_context), 1, 1, 1}, + {&__pyx_kp_dfas, __pyx_k_dfas, sizeof(__pyx_k_dfas), 1, 1, 1}, + {&__pyx_kp_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 1, 1, 1}, + {&__pyx_kp_keywords, __pyx_k_keywords, sizeof(__pyx_k_keywords), 1, 1, 1}, + {&__pyx_kp_tokens, __pyx_k_tokens, sizeof(__pyx_k_tokens), 1, 1, 1}, + {&__pyx_kp_4, __pyx_k_4, sizeof(__pyx_k_4), 1, 1, 1}, + {&__pyx_kp_start, __pyx_k_start, sizeof(__pyx_k_start), 1, 1, 1}, + {&__pyx_kp_add, __pyx_k_add, sizeof(__pyx_k_add), 1, 1, 1}, + {&__pyx_kp_get, __pyx_k_get, sizeof(__pyx_k_get), 1, 1, 1}, + {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1}, + {&__pyx_kp_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 1, 1, 1}, + {&__pyx_kp_used_names, __pyx_k_used_names, sizeof(__pyx_k_used_names), 1, 1, 1}, + {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0}, + {&__pyx_kp_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 0}, + {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0}, + {&__pyx_kp_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 0}, + {&__pyx_kp_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 0}, + {0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitGlobals(void) { + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initparse(void); /*proto*/ +PyMODINIT_FUNC initparse(void) +#else +PyMODINIT_FUNC PyInit_parse(void); /*proto*/ +PyMODINIT_FUNC PyInit_parse(void) +#endif +{ + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Libary function declarations ---*/ + __pyx_init_filenames(); + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("parse", __pyx_methods, 0, 0, PYTHON_API_VERSION); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #if PY_MAJOR_VERSION < 3 + Py_INCREF(__pyx_m); + #endif + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_skip_dispatch = 0; + /*--- Global init code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser = &__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser; + *(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.classify = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify; + *(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.shift = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_shift; + *(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.push = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_push; + *(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.pop = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop; + *(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.convert = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_convert; + if (PyType_Ready(&__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser.tp_dict, __pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Parser", (PyObject *)&__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6sphinx_6pycode_5pgen2_5parse_Parser = &__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser; + /*--- Type import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":15 + * """ + * + * from sphinx.pycode.nodes import Node, Leaf # <<<<<<<<<<<<<< + * + * DEF NAME = 1 + */ + __pyx_1 = PyList_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_kp_Node); + PyList_SET_ITEM(__pyx_1, 0, __pyx_kp_Node); + Py_INCREF(__pyx_kp_Leaf); + PyList_SET_ITEM(__pyx_1, 1, __pyx_kp_Leaf); + __pyx_2 = __Pyx_Import(__pyx_kp_1, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_Node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_kp_Node, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_Leaf); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_kp_Leaf, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":19 + * DEF NAME = 1 + * + * class ParseError(Exception): # <<<<<<<<<<<<<< + * """Exception to signal the parser is stuck.""" + * + */ + __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_builtin_Exception); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_builtin_Exception); + if (PyDict_SetItemString(((PyObject *)__pyx_2), "__doc__", __pyx_kp_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_1), ((PyObject *)__pyx_2), __pyx_kp_ParseError, "sphinx.pycode.pgen2.parse"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":22 + * """Exception to signal the parser is stuck.""" + * + * def __init__(self, msg, type, value, context): # <<<<<<<<<<<<<< + * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + * (msg, type, value, context)) + */ + __pyx_1 = PyCFunction_New(&__pyx_mdef_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_3, __pyx_kp___init__, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_ParseError, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; + + /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":149 + * self.rootnode.used_names = self.used_names + * + * cdef convert(self, raw_node): # <<<<<<<<<<<<<< + * type, value, context, children = raw_node + * if children or type in self._grammar_number2symbol: + */ + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif + __pyx_L1_error:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("sphinx.pycode.pgen2.parse"); + #if PY_MAJOR_VERSION >= 3 + return NULL; + #endif +} + +static const char *__pyx_filenames[] = { + "parse.pyx", +}; + +/* Runtime support code */ + +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; +} + +static INLINE void __Pyx_RaiseArgtupleTooLong( + Py_ssize_t num_expected, + Py_ssize_t num_found) +{ + const char* error_message = + #if PY_VERSION_HEX < 0x02050000 + "function takes at most %d positional arguments (%d given)"; + #else + "function takes at most %zd positional arguments (%zd given)"; + #endif + PyErr_Format(PyExc_TypeError, error_message, num_expected, num_found); +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { + PyObject *__import__ = 0; + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) + goto bad; + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); +bad: + Py_XDECREF(empty_list); + Py_XDECREF(__import__); + Py_XDECREF(empty_dict); + return module; +} + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + +static PyObject *__Pyx_CreateClass( + PyObject *bases, PyObject *dict, PyObject *name, char *modname) +{ + PyObject *py_modname; + PyObject *result = 0; + + #if PY_MAJOR_VERSION < 3 + py_modname = PyString_FromString(modname); + #else + py_modname = PyUnicode_FromString(modname); + #endif + if (!py_modname) + goto bad; + if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) + goto bad; + #if PY_MAJOR_VERSION < 3 + result = PyClass_New(bases, dict, name); + #else + result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL); + #endif +bad: + Py_XDECREF(py_modname); + return result; +} + + +static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { + PyObject *item; + if (!(item = PyIter_Next(iter))) { + if (!PyErr_Occurred()) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "need more than %d values to unpack", (int)index); + #else + "need more than %zd values to unpack", index); + #endif + } + } + return item; +} + +static int __Pyx_EndUnpack(PyObject *iter) { + PyObject *item; + if ((item = PyIter_Next(iter))) { + Py_DECREF(item); + PyErr_SetString(PyExc_ValueError, "too many values to unpack"); + return -1; + } + else if (!PyErr_Occurred()) + return 0; + else + return -1; +} + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise <class>, <instance> */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + PyErr_Restore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} + + +static void __Pyx_WriteUnraisable(const char *name) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + PyErr_Fetch(&old_exc, &old_val, &old_tb); + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + PyErr_Restore(old_exc, old_val, old_tb); + if (!ctx) + ctx = Py_None; + PyErr_WriteUnraisable(ctx); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + PyObject *pycobj = 0; + int result; + + pycobj = PyCObject_FromVoidPtr(vtable, 0); + if (!pycobj) + goto bad; + if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) + goto bad; + result = 0; + goto done; + +bad: + result = -1; +done: + Py_XDECREF(pycobj); + return result; +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" + +static void __Pyx_AddTraceback(const char *funcname) { + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + PyObject *py_globals = 0; + PyObject *empty_string = 0; + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); + #else + py_srcfile = PyUnicode_FromString(__pyx_filename); + #endif + if (!py_srcfile) goto bad; + if (__pyx_clineno) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + #if PY_MAJOR_VERSION < 3 + empty_string = PyString_FromStringAndSize("", 0); + #else + empty_string = PyBytes_FromStringAndSize("", 0); + #endif + if (!empty_string) goto bad; + py_code = PyCode_New( + 0, /*int argcount,*/ + #if PY_MAJOR_VERSION >= 3 + 0, /*int kwonlyargcount,*/ + #endif + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + empty_string, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + __pyx_lineno, /*int firstlineno,*/ + empty_string /*PyObject *lnotab*/ + ); + if (!py_code) goto bad; + py_frame = PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = __pyx_lineno; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + Py_XDECREF(empty_string); + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode && (!t->is_identifier)) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_identifier || (t->is_unicode && t->intern)) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->is_unicode) { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +/* Type Conversion Functions */ + +static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject* x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} + +static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + if (x == Py_True) return 1; + else if (x == Py_False) return 0; + else return PyObject_IsTrue(x); +} + +static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) { + if (PyInt_CheckExact(x)) { + return PyInt_AS_LONG(x); + } + else if (PyLong_CheckExact(x)) { + return PyLong_AsLongLong(x); + } + else { + PY_LONG_LONG val; + PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; + val = __pyx_PyInt_AsLongLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) { + if (PyInt_CheckExact(x)) { + long val = PyInt_AS_LONG(x); + if (unlikely(val < 0)) { + PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type."); + return (unsigned PY_LONG_LONG)-1; + } + return val; + } + else if (PyLong_CheckExact(x)) { + return PyLong_AsUnsignedLongLong(x); + } + else { + PY_LONG_LONG val; + PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; + val = __pyx_PyInt_AsUnsignedLongLong(tmp); + Py_DECREF(tmp); + return val; + } +} + + +static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) { + if (sizeof(unsigned char) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + unsigned char val = (unsigned char)long_val; + if (unlikely((val != long_val) || (long_val < 0))) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); + return (unsigned char)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) { + if (sizeof(unsigned short) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + unsigned short val = (unsigned short)long_val; + if (unlikely((val != long_val) || (long_val < 0))) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short"); + return (unsigned short)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE char __pyx_PyInt_char(PyObject* x) { + if (sizeof(char) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + char val = (char)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); + return (char)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE short __pyx_PyInt_short(PyObject* x) { + if (sizeof(short) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + short val = (short)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to short"); + return (short)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE int __pyx_PyInt_int(PyObject* x) { + if (sizeof(int) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + int val = (int)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); + return (int)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE long __pyx_PyInt_long(PyObject* x) { + if (sizeof(long) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + long val = (long)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); + return (long)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) { + if (sizeof(signed char) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + signed char val = (signed char)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char"); + return (signed char)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) { + if (sizeof(signed short) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + signed short val = (signed short)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short"); + return (signed short)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) { + if (sizeof(signed int) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + signed int val = (signed int)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int"); + return (signed int)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) { + if (sizeof(signed long) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + signed long val = (signed long)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long"); + return (signed long)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + +static INLINE long double __pyx_PyInt_long_double(PyObject* x) { + if (sizeof(long double) < sizeof(long)) { + long long_val = __pyx_PyInt_AsLong(x); + long double val = (long double)long_val; + if (unlikely((val != long_val) )) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double"); + return (long double)-1; + } + return val; + } + else { + return __pyx_PyInt_AsLong(x); + } +} + Added: doctools/trunk/sphinx/pycode/pgen2/parse.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/parse.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,201 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Parser engine for the grammar tables generated by pgen. + +The grammar table must be loaded first. + +See Parser/parser.c in the Python distribution for additional info on +how this parsing engine works. + +""" + +# Local imports +from sphinx.pycode.pgen2 import token + +class ParseError(Exception): + """Exception to signal the parser is stuck.""" + + def __init__(self, msg, type, value, context): + Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + (msg, type, value, context)) + self.msg = msg + self.type = type + self.value = value + self.context = context + +class Parser(object): + """Parser engine. + + The proper usage sequence is: + + p = Parser(grammar, [converter]) # create instance + p.setup([start]) # prepare for parsing + <for each input token>: + if p.addtoken(...): # parse a token; may raise ParseError + break + root = p.rootnode # root of abstract syntax tree + + A Parser instance may be reused by calling setup() repeatedly. + + A Parser instance contains state pertaining to the current token + sequence, and should not be used concurrently by different threads + to parse separate token sequences. + + See driver.py for how to get input tokens by tokenizing a file or + string. + + Parsing is complete when addtoken() returns True; the root of the + abstract syntax tree can then be retrieved from the rootnode + instance variable. When a syntax error occurs, addtoken() raises + the ParseError exception. There is no error recovery; the parser + cannot be used after a syntax error was reported (but it can be + reinitialized by calling setup()). + + """ + + def __init__(self, grammar, convert=None): + """Constructor. + + The grammar argument is a grammar.Grammar instance; see the + grammar module for more information. + + The parser is not ready yet for parsing; you must call the + setup() method to get it started. + + The optional convert argument is a function mapping concrete + syntax tree nodes to abstract syntax tree nodes. If not + given, no conversion is done and the syntax tree produced is + the concrete syntax tree. If given, it must be a function of + two arguments, the first being the grammar (a grammar.Grammar + instance), and the second being the concrete syntax tree node + to be converted. The syntax tree is converted from the bottom + up. + + A concrete syntax tree node is a (type, value, context, nodes) + tuple, where type is the node type (a token or symbol number), + value is None for symbols and a string for tokens, context is + None or an opaque value used for error reporting (typically a + (lineno, offset) pair), and nodes is a list of children for + symbols, and None for tokens. + + An abstract syntax tree node may be anything; this is entirely + up to the converter function. + + """ + self.grammar = grammar + self.convert = convert or (lambda grammar, node: node) + + def setup(self, start=None): + """Prepare for parsing. + + This *must* be called before starting to parse. + + The optional argument is an alternative start symbol; it + defaults to the grammar's start symbol. + + You can use a Parser instance to parse any number of programs; + each time you call setup() the parser is reset to an initial + state determined by the (implicit or explicit) start symbol. + + """ + if start is None: + start = self.grammar.start + # Each stack entry is a tuple: (dfa, state, node). + # A node is a tuple: (type, value, context, children), + # where children is a list of nodes or None, and context may be None. + newnode = (start, None, None, []) + stackentry = (self.grammar.dfas[start], 0, newnode) + self.stack = [stackentry] + self.rootnode = None + self.used_names = set() # Aliased to self.rootnode.used_names in pop() + + def addtoken(self, type, value, context): + """Add a token; return True iff this is the end of the program.""" + # Map from token to label + ilabel = self.classify(type, value, context) + # Loop until the token is shifted; may raise exceptions + while True: + dfa, state, node = self.stack[-1] + states, first = dfa + arcs = states[state] + # Look for a state with this label + for i, newstate in arcs: + t, v = self.grammar.labels[i] + if ilabel == i: + # Look it up in the list of labels + assert t < 256 + # Shift a token; we're done with it + self.shift(type, value, newstate, context) + # Pop while we are in an accept-only state + state = newstate + while states[state] == [(0, state)]: + self.pop() + if not self.stack: + # Done parsing! + return True + dfa, state, node = self.stack[-1] + states, first = dfa + # Done with this token + return False + elif t >= 256: + # See if it's a symbol and if we're in its first set + itsdfa = self.grammar.dfas[t] + itsstates, itsfirst = itsdfa + if ilabel in itsfirst: + # Push a symbol + self.push(t, self.grammar.dfas[t], newstate, context) + break # To continue the outer while loop + else: + if (0, state) in arcs: + # An accepting state, pop it and try something else + self.pop() + if not self.stack: + # Done parsing, but another token is input + raise ParseError("too much input", + type, value, context) + else: + # No success finding a transition + raise ParseError("bad input", type, value, context) + + def classify(self, type, value, context): + """Turn a token into a label. (Internal)""" + if type == token.NAME: + # Keep a listing of all used names + self.used_names.add(value) + # Check for reserved words + ilabel = self.grammar.keywords.get(value) + if ilabel is not None: + return ilabel + ilabel = self.grammar.tokens.get(type) + if ilabel is None: + raise ParseError("bad token", type, value, context) + return ilabel + + def shift(self, type, value, newstate, context): + """Shift a token. (Internal)""" + dfa, state, node = self.stack[-1] + newnode = (type, value, context, None) + newnode = self.convert(self.grammar, newnode) + if newnode is not None: + node[-1].append(newnode) + self.stack[-1] = (dfa, newstate, node) + + def push(self, type, newdfa, newstate, context): + """Push a nonterminal. (Internal)""" + dfa, state, node = self.stack[-1] + newnode = (type, None, context, []) + self.stack[-1] = (dfa, newstate, node) + self.stack.append((newdfa, 0, newnode)) + + def pop(self): + """Pop a nonterminal. (Internal)""" + popdfa, popstate, popnode = self.stack.pop() + newnode = self.convert(self.grammar, popnode) + if newnode is not None: + if self.stack: + dfa, state, node = self.stack[-1] + node[-1].append(newnode) + else: + self.rootnode = newnode + self.rootnode.used_names = self.used_names Added: doctools/trunk/sphinx/pycode/pgen2/parse.pyx ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/parse.pyx Sun Jan 4 21:38:57 2009 @@ -0,0 +1,158 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Adapted from parse.py to be compiled with Cython by Georg Brandl. + +"""Parser engine for the grammar tables generated by pgen. + +The grammar table must be loaded first. + +See Parser/parser.c in the Python distribution for additional info on +how this parsing engine works. + +""" + +from sphinx.pycode.nodes import Node, Leaf + +DEF NAME = 1 + +class ParseError(Exception): + """Exception to signal the parser is stuck.""" + + def __init__(self, msg, type, value, context): + Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + (msg, type, value, context)) + self.msg = msg + self.type = type + self.value = value + self.context = context + + +cdef class Parser: + cdef public grammar, stack, rootnode, used_names + cdef _grammar_dfas, _grammar_labels, _grammar_keywords, _grammar_tokens + cdef _grammar_number2symbol + + def __init__(self, grammar, convert=None): + self.grammar = grammar + #self.convert = convert or noconvert + + self._grammar_dfas = grammar.dfas + self._grammar_labels = grammar.labels + self._grammar_keywords = grammar.keywords + self._grammar_tokens = grammar.tokens + self._grammar_number2symbol = grammar.number2symbol + + def setup(self, start=None): + if start is None: + start = self.grammar.start + # Each stack entry is a tuple: (dfa, state, node). + # A node is a tuple: (type, value, context, children), + # where children is a list of nodes or None, and context may be None. + newnode = (start, None, None, []) + stackentry = (self._grammar_dfas[start], 0, newnode) + self.stack = [stackentry] + self.rootnode = None + self.used_names = set() # Aliased to self.rootnode.used_names in pop() + + def addtoken(self, type, value, context): + """Add a token; return True iff this is the end of the program.""" + cdef int ilabel, i, t, state, newstate + # Map from token to label + ilabel = self.classify(type, value, context) + # Loop until the token is shifted; may raise exceptions + while True: + dfa, state, node = self.stack[-1] + states, first = dfa + arcs = states[state] + # Look for a state with this label + for i, newstate in arcs: + t, v = self._grammar_labels[i] + if ilabel == i: + # Look it up in the list of labels + ## assert t < 256 + # Shift a token; we're done with it + self.shift(type, value, newstate, context) + # Pop while we are in an accept-only state + state = newstate + while states[state] == [(0, state)]: + self.pop() + if not self.stack: + # Done parsing! + return True + dfa, state, node = self.stack[-1] + states, first = dfa + # Done with this token + return False + elif t >= 256: + # See if it's a symbol and if we're in its first set + itsdfa = self._grammar_dfas[t] + itsstates, itsfirst = itsdfa + if ilabel in itsfirst: + # Push a symbol + self.push(t, itsdfa, newstate, context) + break # To continue the outer while loop + else: + if (0, state) in arcs: + # An accepting state, pop it and try something else + self.pop() + if not self.stack: + # Done parsing, but another token is input + raise ParseError("too much input", + type, value, context) + else: + # No success finding a transition + raise ParseError("bad input", type, value, context) + + cdef int classify(self, type, value, context): + """Turn a token into a label. (Internal)""" + if type == NAME: + # Keep a listing of all used names + self.used_names.add(value) + # Check for reserved words + ilabel = self._grammar_keywords.get(value) + if ilabel is not None: + return ilabel + ilabel = self._grammar_tokens.get(type) + if ilabel is None: + raise ParseError("bad token", type, value, context) + return ilabel + + cdef void shift(self, type, value, newstate, context): + """Shift a token. (Internal)""" + dfa, state, node = self.stack[-1] + newnode = (type, value, context, None) + newnode = self.convert(newnode) + if newnode is not None: + node[-1].append(newnode) + self.stack[-1] = (dfa, newstate, node) + + cdef void push(self, type, newdfa, newstate, context): + """Push a nonterminal. (Internal)""" + dfa, state, node = self.stack[-1] + newnode = (type, None, context, []) + self.stack[-1] = (dfa, newstate, node) + self.stack.append((newdfa, 0, newnode)) + + cdef void pop(self): + """Pop a nonterminal. (Internal)""" + popdfa, popstate, popnode = self.stack.pop() + newnode = self.convert(popnode) + if newnode is not None: + if self.stack: + dfa, state, node = self.stack[-1] + node[-1].append(newnode) + else: + self.rootnode = newnode + self.rootnode.used_names = self.used_names + + cdef convert(self, raw_node): + type, value, context, children = raw_node + if children or type in self._grammar_number2symbol: + # If there's exactly one child, return that child instead of + # creating a new node. + if len(children) == 1: + return children[0] + return Node(type, children, context=context) + else: + return Leaf(type, value, context=context) Added: doctools/trunk/sphinx/pycode/pgen2/pgen.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/pgen.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,384 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Pgen imports +from sphinx.pycode.pgen2 import grammar, token, tokenize + +class PgenGrammar(grammar.Grammar): + pass + +class ParserGenerator(object): + + def __init__(self, filename, stream=None): + close_stream = None + if stream is None: + stream = open(filename) + close_stream = stream.close + self.filename = filename + self.stream = stream + self.generator = tokenize.generate_tokens(stream.readline) + self.gettoken() # Initialize lookahead + self.dfas, self.startsymbol = self.parse() + if close_stream is not None: + close_stream() + self.first = {} # map from symbol name to set of tokens + self.addfirstsets() + + def make_grammar(self): + c = PgenGrammar() + names = self.dfas.keys() + names.sort() + names.remove(self.startsymbol) + names.insert(0, self.startsymbol) + for name in names: + i = 256 + len(c.symbol2number) + c.symbol2number[name] = i + c.number2symbol[i] = name + for name in names: + dfa = self.dfas[name] + states = [] + for state in dfa: + arcs = [] + for label, next in state.arcs.iteritems(): + arcs.append((self.make_label(c, label), dfa.index(next))) + if state.isfinal: + arcs.append((0, dfa.index(state))) + states.append(arcs) + c.states.append(states) + c.dfas[c.symbol2number[name]] = (states, self.make_first(c, name)) + c.start = c.symbol2number[self.startsymbol] + return c + + def make_first(self, c, name): + rawfirst = self.first[name] + first = {} + for label in rawfirst: + ilabel = self.make_label(c, label) + ##assert ilabel not in first # XXX failed on <> ... != + first[ilabel] = 1 + return first + + def make_label(self, c, label): + # XXX Maybe this should be a method on a subclass of converter? + ilabel = len(c.labels) + if label[0].isalpha(): + # Either a symbol name or a named token + if label in c.symbol2number: + # A symbol name (a non-terminal) + if label in c.symbol2label: + return c.symbol2label[label] + else: + c.labels.append((c.symbol2number[label], None)) + c.symbol2label[label] = ilabel + return ilabel + else: + # A named token (NAME, NUMBER, STRING) + itoken = getattr(token, label, None) + assert isinstance(itoken, int), label + assert itoken in token.tok_name, label + if itoken in c.tokens: + return c.tokens[itoken] + else: + c.labels.append((itoken, None)) + c.tokens[itoken] = ilabel + return ilabel + else: + # Either a keyword or an operator + assert label[0] in ('"', "'"), label + value = eval(label) + if value[0].isalpha(): + # A keyword + if value in c.keywords: + return c.keywords[value] + else: + c.labels.append((token.NAME, value)) + c.keywords[value] = ilabel + return ilabel + else: + # An operator (any non-numeric token) + itoken = grammar.opmap[value] # Fails if unknown token + if itoken in c.tokens: + return c.tokens[itoken] + else: + c.labels.append((itoken, None)) + c.tokens[itoken] = ilabel + return ilabel + + def addfirstsets(self): + names = self.dfas.keys() + names.sort() + for name in names: + if name not in self.first: + self.calcfirst(name) + #print name, self.first[name].keys() + + def calcfirst(self, name): + dfa = self.dfas[name] + self.first[name] = None # dummy to detect left recursion + state = dfa[0] + totalset = {} + overlapcheck = {} + for label, next in state.arcs.iteritems(): + if label in self.dfas: + if label in self.first: + fset = self.first[label] + if fset is None: + raise ValueError("recursion for rule %r" % name) + else: + self.calcfirst(label) + fset = self.first[label] + totalset.update(fset) + overlapcheck[label] = fset + else: + totalset[label] = 1 + overlapcheck[label] = {label: 1} + inverse = {} + for label, itsfirst in overlapcheck.iteritems(): + for symbol in itsfirst: + if symbol in inverse: + raise ValueError("rule %s is ambiguous; %s is in the" + " first sets of %s as well as %s" % + (name, symbol, label, inverse[symbol])) + inverse[symbol] = label + self.first[name] = totalset + + def parse(self): + dfas = {} + startsymbol = None + # MSTART: (NEWLINE | RULE)* ENDMARKER + while self.type != token.ENDMARKER: + while self.type == token.NEWLINE: + self.gettoken() + # RULE: NAME ':' RHS NEWLINE + name = self.expect(token.NAME) + self.expect(token.OP, ":") + a, z = self.parse_rhs() + self.expect(token.NEWLINE) + #self.dump_nfa(name, a, z) + dfa = self.make_dfa(a, z) + #self.dump_dfa(name, dfa) + oldlen = len(dfa) + self.simplify_dfa(dfa) + newlen = len(dfa) + dfas[name] = dfa + #print name, oldlen, newlen + if startsymbol is None: + startsymbol = name + return dfas, startsymbol + + def make_dfa(self, start, finish): + # To turn an NFA into a DFA, we define the states of the DFA + # to correspond to *sets* of states of the NFA. Then do some + # state reduction. Let's represent sets as dicts with 1 for + # values. + assert isinstance(start, NFAState) + assert isinstance(finish, NFAState) + def closure(state): + base = {} + addclosure(state, base) + return base + def addclosure(state, base): + assert isinstance(state, NFAState) + if state in base: + return + base[state] = 1 + for label, next in state.arcs: + if label is None: + addclosure(next, base) + states = [DFAState(closure(start), finish)] + for state in states: # NB states grows while we're iterating + arcs = {} + for nfastate in state.nfaset: + for label, next in nfastate.arcs: + if label is not None: + addclosure(next, arcs.setdefault(label, {})) + for label, nfaset in arcs.iteritems(): + for st in states: + if st.nfaset == nfaset: + break + else: + st = DFAState(nfaset, finish) + states.append(st) + state.addarc(st, label) + return states # List of DFAState instances; first one is start + + def dump_nfa(self, name, start, finish): + print "Dump of NFA for", name + todo = [start] + for i, state in enumerate(todo): + print " State", i, state is finish and "(final)" or "" + for label, next in state.arcs: + if next in todo: + j = todo.index(next) + else: + j = len(todo) + todo.append(next) + if label is None: + print " -> %d" % j + else: + print " %s -> %d" % (label, j) + + def dump_dfa(self, name, dfa): + print "Dump of DFA for", name + for i, state in enumerate(dfa): + print " State", i, state.isfinal and "(final)" or "" + for label, next in state.arcs.iteritems(): + print " %s -> %d" % (label, dfa.index(next)) + + def simplify_dfa(self, dfa): + # This is not theoretically optimal, but works well enough. + # Algorithm: repeatedly look for two states that have the same + # set of arcs (same labels pointing to the same nodes) and + # unify them, until things stop changing. + + # dfa is a list of DFAState instances + changes = True + while changes: + changes = False + for i, state_i in enumerate(dfa): + for j in range(i+1, len(dfa)): + state_j = dfa[j] + if state_i == state_j: + #print " unify", i, j + del dfa[j] + for state in dfa: + state.unifystate(state_j, state_i) + changes = True + break + + def parse_rhs(self): + # RHS: ALT ('|' ALT)* + a, z = self.parse_alt() + if self.value != "|": + return a, z + else: + aa = NFAState() + zz = NFAState() + aa.addarc(a) + z.addarc(zz) + while self.value == "|": + self.gettoken() + a, z = self.parse_alt() + aa.addarc(a) + z.addarc(zz) + return aa, zz + + def parse_alt(self): + # ALT: ITEM+ + a, b = self.parse_item() + while (self.value in ("(", "[") or + self.type in (token.NAME, token.STRING)): + c, d = self.parse_item() + b.addarc(c) + b = d + return a, b + + def parse_item(self): + # ITEM: '[' RHS ']' | ATOM ['+' | '*'] + if self.value == "[": + self.gettoken() + a, z = self.parse_rhs() + self.expect(token.OP, "]") + a.addarc(z) + return a, z + else: + a, z = self.parse_atom() + value = self.value + if value not in ("+", "*"): + return a, z + self.gettoken() + z.addarc(a) + if value == "+": + return a, z + else: + return a, a + + def parse_atom(self): + # ATOM: '(' RHS ')' | NAME | STRING + if self.value == "(": + self.gettoken() + a, z = self.parse_rhs() + self.expect(token.OP, ")") + return a, z + elif self.type in (token.NAME, token.STRING): + a = NFAState() + z = NFAState() + a.addarc(z, self.value) + self.gettoken() + return a, z + else: + self.raise_error("expected (...) or NAME or STRING, got %s/%s", + self.type, self.value) + + def expect(self, type, value=None): + if self.type != type or (value is not None and self.value != value): + self.raise_error("expected %s/%s, got %s/%s", + type, value, self.type, self.value) + value = self.value + self.gettoken() + return value + + def gettoken(self): + tup = self.generator.next() + while tup[0] in (tokenize.COMMENT, tokenize.NL): + tup = self.generator.next() + self.type, self.value, self.begin, self.end, self.line = tup + #print token.tok_name[self.type], repr(self.value) + + def raise_error(self, msg, *args): + if args: + try: + msg = msg % args + except: + msg = " ".join([msg] + map(str, args)) + raise SyntaxError(msg, (self.filename, self.end[0], + self.end[1], self.line)) + +class NFAState(object): + + def __init__(self): + self.arcs = [] # list of (label, NFAState) pairs + + def addarc(self, next, label=None): + assert label is None or isinstance(label, str) + assert isinstance(next, NFAState) + self.arcs.append((label, next)) + +class DFAState(object): + + def __init__(self, nfaset, final): + assert isinstance(nfaset, dict) + assert isinstance(iter(nfaset).next(), NFAState) + assert isinstance(final, NFAState) + self.nfaset = nfaset + self.isfinal = final in nfaset + self.arcs = {} # map from label to DFAState + + def addarc(self, next, label): + assert isinstance(label, str) + assert label not in self.arcs + assert isinstance(next, DFAState) + self.arcs[label] = next + + def unifystate(self, old, new): + for label, next in self.arcs.iteritems(): + if next is old: + self.arcs[label] = new + + def __eq__(self, other): + # Equality test -- ignore the nfaset instance variable + assert isinstance(other, DFAState) + if self.isfinal != other.isfinal: + return False + # Can't just return self.arcs == other.arcs, because that + # would invoke this method recursively, with cycles... + if len(self.arcs) != len(other.arcs): + return False + for label, next in self.arcs.iteritems(): + if next is not other.arcs.get(label): + return False + return True + +def generate_grammar(filename="Grammar.txt"): + p = ParserGenerator(filename) + return p.make_grammar() Added: doctools/trunk/sphinx/pycode/pgen2/token.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/token.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,82 @@ +#! /usr/bin/env python + +"""Token constants (from "token.h").""" + +# Taken from Python (r53757) and modified to include some tokens +# originally monkeypatched in by pgen2.tokenize + +#--start constants-- +ENDMARKER = 0 +NAME = 1 +NUMBER = 2 +STRING = 3 +NEWLINE = 4 +INDENT = 5 +DEDENT = 6 +LPAR = 7 +RPAR = 8 +LSQB = 9 +RSQB = 10 +COLON = 11 +COMMA = 12 +SEMI = 13 +PLUS = 14 +MINUS = 15 +STAR = 16 +SLASH = 17 +VBAR = 18 +AMPER = 19 +LESS = 20 +GREATER = 21 +EQUAL = 22 +DOT = 23 +PERCENT = 24 +BACKQUOTE = 25 +LBRACE = 26 +RBRACE = 27 +EQEQUAL = 28 +NOTEQUAL = 29 +LESSEQUAL = 30 +GREATEREQUAL = 31 +TILDE = 32 +CIRCUMFLEX = 33 +LEFTSHIFT = 34 +RIGHTSHIFT = 35 +DOUBLESTAR = 36 +PLUSEQUAL = 37 +MINEQUAL = 38 +STAREQUAL = 39 +SLASHEQUAL = 40 +PERCENTEQUAL = 41 +AMPEREQUAL = 42 +VBAREQUAL = 43 +CIRCUMFLEXEQUAL = 44 +LEFTSHIFTEQUAL = 45 +RIGHTSHIFTEQUAL = 46 +DOUBLESTAREQUAL = 47 +DOUBLESLASH = 48 +DOUBLESLASHEQUAL = 49 +AT = 50 +OP = 51 +COMMENT = 52 +NL = 53 +RARROW = 54 +ERRORTOKEN = 55 +N_TOKENS = 56 +NT_OFFSET = 256 +#--end constants-- + +tok_name = {} +for _name, _value in globals().items(): + if type(_value) is type(0): + tok_name[_value] = _name + + +def ISTERMINAL(x): + return x < NT_OFFSET + +def ISNONTERMINAL(x): + return x >= NT_OFFSET + +def ISEOF(x): + return x == ENDMARKER Added: doctools/trunk/sphinx/pycode/pgen2/tokenize.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/pycode/pgen2/tokenize.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,405 @@ +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. +# All rights reserved. + +"""Tokenization help for Python programs. + +generate_tokens(readline) is a generator that breaks a stream of +text into Python tokens. It accepts a readline-like method which is called +repeatedly to get the next line of input (or "" for EOF). It generates +5-tuples with these members: + + the token type (see token.py) + the token (a string) + the starting (row, column) indices of the token (a 2-tuple of ints) + the ending (row, column) indices of the token (a 2-tuple of ints) + the original line (string) + +It is designed to match the working of the Python tokenizer exactly, except +that it produces COMMENT tokens for comments and gives type OP for all +operators + +Older entry points + tokenize_loop(readline, tokeneater) + tokenize(readline, tokeneater=printtoken) +are the same, except instead of generating tokens, tokeneater is a callback +function to which the 5 fields described above are passed as 5 arguments, +each time a new token is found.""" + +__author__ = 'Ka-Ping Yee <ping at lfw.org>' +__credits__ = \ + 'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro' + +import string, re +from sphinx.pycode.pgen2.token import * +from sphinx.pycode.pgen2 import token + +__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize", + "generate_tokens", "untokenize"] +del token + +def group(*choices): return '(' + '|'.join(choices) + ')' +def any(*choices): return group(*choices) + '*' +def maybe(*choices): return group(*choices) + '?' + +Whitespace = r'[ \f\t]*' +Comment = r'#[^\r\n]*' +Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment) +Name = r'[a-zA-Z_]\w*' + +Binnumber = r'0[bB][01]*' +Hexnumber = r'0[xX][\da-fA-F]*[lL]?' +Octnumber = r'0[oO]?[0-7]*[lL]?' +Decnumber = r'[1-9]\d*[lL]?' +Intnumber = group(Binnumber, Hexnumber, Octnumber, Decnumber) +Exponent = r'[eE][-+]?\d+' +Pointfloat = group(r'\d+\.\d*', r'\.\d+') + maybe(Exponent) +Expfloat = r'\d+' + Exponent +Floatnumber = group(Pointfloat, Expfloat) +Imagnumber = group(r'\d+[jJ]', Floatnumber + r'[jJ]') +Number = group(Imagnumber, Floatnumber, Intnumber) + +# Tail end of ' string. +Single = r"[^'\\]*(?:\\.[^'\\]*)*'" +# Tail end of " string. +Double = r'[^"\\]*(?:\\.[^"\\]*)*"' +# Tail end of ''' string. +Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''" +# Tail end of """ string. +Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""' +Triple = group("[ubUB]?[rR]?'''", '[ubUB]?[rR]?"""') +# Single-line ' or " string. +String = group(r"[uU]?[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*'", + r'[uU]?[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*"') + +# Because of leftmost-then-longest match semantics, be sure to put the +# longest operators first (e.g., if = came before ==, == would get +# recognized as two instances of =). +Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", + r"//=?", r"->", + r"[+\-*/%&|^=<>]=?", + r"~") + +Bracket = '[][(){}]' +Special = group(r'\r?\n', r'[:;.,`@]') +Funny = group(Operator, Bracket, Special) + +PlainToken = group(Number, Funny, String, Name) +Token = Ignore + PlainToken + +# First (or only) line of ' or " string. +ContStr = group(r"[uUbB]?[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*" + + group("'", r'\\\r?\n'), + r'[uUbB]?[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*' + + group('"', r'\\\r?\n')) +PseudoExtras = group(r'\\\r?\n', Comment, Triple) +PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name) + +tokenprog, pseudoprog, single3prog, double3prog = map( + re.compile, (Token, PseudoToken, Single3, Double3)) +endprogs = {"'": re.compile(Single), '"': re.compile(Double), + "'''": single3prog, '"""': double3prog, + "r'''": single3prog, 'r"""': double3prog, + "u'''": single3prog, 'u"""': double3prog, + "b'''": single3prog, 'b"""': double3prog, + "ur'''": single3prog, 'ur"""': double3prog, + "br'''": single3prog, 'br"""': double3prog, + "R'''": single3prog, 'R"""': double3prog, + "U'''": single3prog, 'U"""': double3prog, + "B'''": single3prog, 'B"""': double3prog, + "uR'''": single3prog, 'uR"""': double3prog, + "Ur'''": single3prog, 'Ur"""': double3prog, + "UR'''": single3prog, 'UR"""': double3prog, + "bR'''": single3prog, 'bR"""': double3prog, + "Br'''": single3prog, 'Br"""': double3prog, + "BR'''": single3prog, 'BR"""': double3prog, + 'r': None, 'R': None, + 'u': None, 'U': None, + 'b': None, 'B': None} + +triple_quoted = {} +for t in ("'''", '"""', + "r'''", 'r"""', "R'''", 'R"""', + "u'''", 'u"""', "U'''", 'U"""', + "b'''", 'b"""', "B'''", 'B"""', + "ur'''", 'ur"""', "Ur'''", 'Ur"""', + "uR'''", 'uR"""', "UR'''", 'UR"""', + "br'''", 'br"""', "Br'''", 'Br"""', + "bR'''", 'bR"""', "BR'''", 'BR"""',): + triple_quoted[t] = t +single_quoted = {} +for t in ("'", '"', + "r'", 'r"', "R'", 'R"', + "u'", 'u"', "U'", 'U"', + "b'", 'b"', "B'", 'B"', + "ur'", 'ur"', "Ur'", 'Ur"', + "uR'", 'uR"', "UR'", 'UR"', + "br'", 'br"', "Br'", 'Br"', + "bR'", 'bR"', "BR'", 'BR"', ): + single_quoted[t] = t + +tabsize = 8 + +class TokenError(Exception): pass + +class StopTokenizing(Exception): pass + +def printtoken(type, token, (srow, scol), (erow, ecol), line): # for testing + print "%d,%d-%d,%d:\t%s\t%s" % \ + (srow, scol, erow, ecol, tok_name[type], repr(token)) + +def tokenize(readline, tokeneater=printtoken): + """ + The tokenize() function accepts two parameters: one representing the + input stream, and one providing an output mechanism for tokenize(). + + The first parameter, readline, must be a callable object which provides + the same interface as the readline() method of built-in file objects. + Each call to the function should return one line of input as a string. + + The second parameter, tokeneater, must also be a callable object. It is + called once for each token, with five arguments, corresponding to the + tuples generated by generate_tokens(). + """ + try: + tokenize_loop(readline, tokeneater) + except StopTokenizing: + pass + +# backwards compatible interface +def tokenize_loop(readline, tokeneater): + for token_info in generate_tokens(readline): + tokeneater(*token_info) + +class Untokenizer: + + def __init__(self): + self.tokens = [] + self.prev_row = 1 + self.prev_col = 0 + + def add_whitespace(self, start): + row, col = start + assert row <= self.prev_row + col_offset = col - self.prev_col + if col_offset: + self.tokens.append(" " * col_offset) + + def untokenize(self, iterable): + for t in iterable: + if len(t) == 2: + self.compat(t, iterable) + break + tok_type, token, start, end, line = t + self.add_whitespace(start) + self.tokens.append(token) + self.prev_row, self.prev_col = end + if tok_type in (NEWLINE, NL): + self.prev_row += 1 + self.prev_col = 0 + return "".join(self.tokens) + + def compat(self, token, iterable): + startline = False + indents = [] + toks_append = self.tokens.append + toknum, tokval = token + if toknum in (NAME, NUMBER): + tokval += ' ' + if toknum in (NEWLINE, NL): + startline = True + for tok in iterable: + toknum, tokval = tok[:2] + + if toknum in (NAME, NUMBER): + tokval += ' ' + + if toknum == INDENT: + indents.append(tokval) + continue + elif toknum == DEDENT: + indents.pop() + continue + elif toknum in (NEWLINE, NL): + startline = True + elif startline and indents: + toks_append(indents[-1]) + startline = False + toks_append(tokval) + +def untokenize(iterable): + """Transform tokens back into Python source code. + + Each element returned by the iterable must be a token sequence + with at least two elements, a token number and token value. If + only two tokens are passed, the resulting output is poor. + + Round-trip invariant for full input: + Untokenized source will match input source exactly + + Round-trip invariant for limited intput: + # Output text will tokenize the back to the input + t1 = [tok[:2] for tok in generate_tokens(f.readline)] + newcode = untokenize(t1) + readline = iter(newcode.splitlines(1)).next + t2 = [tok[:2] for tokin generate_tokens(readline)] + assert t1 == t2 + """ + ut = Untokenizer() + return ut.untokenize(iterable) + +def generate_tokens(readline): + """ + The generate_tokens() generator requires one argment, readline, which + must be a callable object which provides the same interface as the + readline() method of built-in file objects. Each call to the function + should return one line of input as a string. Alternately, readline + can be a callable function terminating with StopIteration: + readline = open(myfile).next # Example of alternate readline + + The generator produces 5-tuples with these members: the token type; the + token string; a 2-tuple (srow, scol) of ints specifying the row and + column where the token begins in the source; a 2-tuple (erow, ecol) of + ints specifying the row and column where the token ends in the source; + and the line on which the token was found. The line passed is the + logical line; continuation lines are included. + """ + lnum = parenlev = continued = 0 + namechars, numchars = string.ascii_letters + '_', '0123456789' + contstr, needcont = '', 0 + contline = None + indents = [0] + + while 1: # loop over lines in stream + try: + line = readline() + except StopIteration: + line = '' + lnum = lnum + 1 + pos, max = 0, len(line) + + if contstr: # continued string + if not line: + raise TokenError, ("EOF in multi-line string", strstart) + endmatch = endprog.match(line) + if endmatch: + pos = end = endmatch.end(0) + yield (STRING, contstr + line[:end], + strstart, (lnum, end), contline + line) + contstr, needcont = '', 0 + contline = None + elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n': + yield (ERRORTOKEN, contstr + line, + strstart, (lnum, len(line)), contline) + contstr = '' + contline = None + continue + else: + contstr = contstr + line + contline = contline + line + continue + + elif parenlev == 0 and not continued: # new statement + if not line: break + column = 0 + while pos < max: # measure leading whitespace + if line[pos] == ' ': column = column + 1 + elif line[pos] == '\t': column = (column/tabsize + 1)*tabsize + elif line[pos] == '\f': column = 0 + else: break + pos = pos + 1 + if pos == max: break + + if line[pos] in '#\r\n': # skip comments or blank lines + if line[pos] == '#': + comment_token = line[pos:].rstrip('\r\n') + nl_pos = pos + len(comment_token) + yield (COMMENT, comment_token, + (lnum, pos), (lnum, pos + len(comment_token)), line) + yield (NL, line[nl_pos:], + (lnum, nl_pos), (lnum, len(line)), line) + else: + yield ((NL, COMMENT)[line[pos] == '#'], line[pos:], + (lnum, pos), (lnum, len(line)), line) + continue + + if column > indents[-1]: # count indents or dedents + indents.append(column) + yield (INDENT, line[:pos], (lnum, 0), (lnum, pos), line) + while column < indents[-1]: + if column not in indents: + raise IndentationError( + "unindent does not match any outer indentation level", + ("<tokenize>", lnum, pos, line)) + indents = indents[:-1] + yield (DEDENT, '', (lnum, pos), (lnum, pos), line) + + else: # continued statement + if not line: + raise TokenError, ("EOF in multi-line statement", (lnum, 0)) + continued = 0 + + while pos < max: + pseudomatch = pseudoprog.match(line, pos) + if pseudomatch: # scan for tokens + start, end = pseudomatch.span(1) + spos, epos, pos = (lnum, start), (lnum, end), end + token, initial = line[start:end], line[start] + + if initial in numchars or \ + (initial == '.' and token != '.'): # ordinary number + yield (NUMBER, token, spos, epos, line) + elif initial in '\r\n': + newline = NEWLINE + if parenlev > 0: + newline = NL + yield (newline, token, spos, epos, line) + elif initial == '#': + assert not token.endswith("\n") + yield (COMMENT, token, spos, epos, line) + elif token in triple_quoted: + endprog = endprogs[token] + endmatch = endprog.match(line, pos) + if endmatch: # all on one line + pos = endmatch.end(0) + token = line[start:pos] + yield (STRING, token, spos, (lnum, pos), line) + else: + strstart = (lnum, start) # multiple lines + contstr = line[start:] + contline = line + break + elif initial in single_quoted or \ + token[:2] in single_quoted or \ + token[:3] in single_quoted: + if token[-1] == '\n': # continued string + strstart = (lnum, start) + endprog = (endprogs[initial] or endprogs[token[1]] or + endprogs[token[2]]) + contstr, needcont = line[start:], 1 + contline = line + break + else: # ordinary string + yield (STRING, token, spos, epos, line) + elif initial in namechars: # ordinary name + yield (NAME, token, spos, epos, line) + elif initial == '\\': # continued stmt + # This yield is new; needed for better idempotency: + yield (NL, token, spos, (lnum, pos), line) + continued = 1 + else: + if initial in '([{': parenlev = parenlev + 1 + elif initial in ')]}': parenlev = parenlev - 1 + yield (OP, token, spos, epos, line) + else: + yield (ERRORTOKEN, line[pos], + (lnum, pos), (lnum, pos+1), line) + pos = pos + 1 + + for indent in indents[1:]: # pop remaining indent levels + yield (DEDENT, '', (lnum, 0), (lnum, 0), '') + yield (ENDMARKER, '', (lnum, 0), (lnum, 0), '') + +if __name__ == '__main__': # testing + import sys + if len(sys.argv) > 1: tokenize(open(sys.argv[1]).readline) + else: tokenize(sys.stdin.readline) Modified: doctools/trunk/sphinx/quickstart.py ============================================================================== --- doctools/trunk/sphinx/quickstart.py (original) +++ doctools/trunk/sphinx/quickstart.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Quickly setup documentation source to work with Sphinx. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys, os, time @@ -165,8 +165,8 @@ # If true, the index is split into individual pages for each letter. #html_split_index = False -# If true, the reST sources are included in the HTML build as _sources/<name>. -#html_copy_source = True +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the @@ -257,7 +257,7 @@ ALLSPHINXOPTS = -d %(rbuilddir)s/doctrees $(PAPEROPT_$(PAPER)) \ $(SPHINXOPTS) %(rsrcdir)s -.PHONY: help clean html web pickle htmlhelp latex changes linkcheck +.PHONY: help clean html pickle json htmlhelp qthelp latex changes linkcheck help: \t at echo "Please use \\`make <target>' where <target> is one of" @@ -265,6 +265,7 @@ \t at echo " pickle to make pickle files" \t at echo " json to make JSON files" \t at echo " htmlhelp to make HTML files and a HTML help project" +\t at echo " qthelp to make HTML files and a qthelp project" \t at echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" \t at echo " changes to make an overview over all changed/added/deprecated items" \t at echo " linkcheck to check all external links for integrity" @@ -284,8 +285,6 @@ \t at echo \t at echo "Build finished; now you can process the pickle files." -web: pickle - json: \tmkdir -p %(rbuilddir)s/json %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) %(rbuilddir)s/json @@ -299,6 +298,16 @@ \t at echo "Build finished; now you can run HTML Help Workshop with the" \\ \t ".hhp project file in %(rbuilddir)s/htmlhelp." +qthelp: +\tmkdir -p %(rbuilddir)s/qthelp %(rbuilddir)s/doctrees +\t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) %(rbuilddir)s/qthelp +\t at echo +\t at echo "Build finished; now you can run "qcollectiongenerator" with the" \\ +\t ".qhcp project file in %(rbuilddir)s/qthelp, like this:" +\t at echo "# qcollectiongenerator %(rbuilddir)s/qthelp/Sphinx.qhcp" +\t at echo "To view the help file:" +\t at echo "# assistant -collectionFile %(rbuilddir)s/qthelp/%(project)s.qhc" + latex: \tmkdir -p %(rbuilddir)s/latex %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex Modified: doctools/trunk/sphinx/roles.py ============================================================================== --- doctools/trunk/sphinx/roles.py (original) +++ doctools/trunk/sphinx/roles.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Handlers for additional ReST roles. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re @@ -24,7 +24,7 @@ 'guilabel' : nodes.strong, 'kbd' : nodes.literal, 'mailheader' : addnodes.literal_emphasis, - 'makevar' : nodes.Text, + 'makevar' : nodes.strong, 'manpage' : addnodes.literal_emphasis, 'mimetype' : addnodes.literal_emphasis, 'newsgroup' : addnodes.literal_emphasis, @@ -96,6 +96,7 @@ 'term': nodes.emphasis, 'token': nodes.strong, 'envvar': nodes.strong, + 'download': nodes.strong, 'option': addnodes.literal_emphasis, } @@ -122,8 +123,10 @@ return [innernodetypes.get(typ, nodes.literal)( rawtext, text, classes=['xref'])], [] # we want a cross-reference, create the reference node - pnode = addnodes.pending_xref(rawtext, reftype=typ, refcaption=False, - modname=env.currmodule, classname=env.currclass) + nodeclass = (typ == 'download') and addnodes.download_reference or \ + addnodes.pending_xref + pnode = nodeclass(rawtext, reftype=typ, refcaption=False, + modname=env.currmodule, classname=env.currclass) # we may need the line number for warnings pnode.line = lineno # the link title may differ from the target, but by default they are the same @@ -235,6 +238,8 @@ 'token': xfileref_role, 'term': xfileref_role, 'option': xfileref_role, + 'doc': xfileref_role, + 'download': xfileref_role, 'menuselection': menusel_role, 'file': emph_literal_role, Modified: doctools/trunk/sphinx/search.py ============================================================================== --- doctools/trunk/sphinx/search.py (original) +++ doctools/trunk/sphinx/search.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Create a search index for offline search. - :copyright: 2007-2008 by Armin Ronacher. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re import cPickle as pickle Modified: doctools/trunk/sphinx/setup_command.py ============================================================================== --- doctools/trunk/sphinx/setup_command.py (original) +++ doctools/trunk/sphinx/setup_command.py Sun Jan 4 21:38:57 2009 @@ -8,8 +8,8 @@ :author: Sebastian Wiesner :contact: basti.wiesner at gmx.net - :copyright: 2008 by Sebastian Wiesner. - :license: MIT. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys Modified: doctools/trunk/sphinx/static/searchtools.js ============================================================================== --- doctools/trunk/sphinx/static/searchtools.js (original) +++ doctools/trunk/sphinx/static/searchtools.js Sun Jan 4 21:38:57 2009 @@ -239,7 +239,7 @@ }, hasIndex : function() { - return self._index !== null; + return this._index !== null; }, deferQuery : function(query) { @@ -431,7 +431,7 @@ listItem.slideDown(5, function() { displayNextItem(); }); - } else { + } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { $.get('_sources/' + item[0] + '.txt', function(data) { listItem.append($.makeSearchSummary(data, searchterms, hlterms)); Search.output.append(listItem); @@ -439,6 +439,12 @@ displayNextItem(); }); }); + } else { + // no source available, just display title + Search.output.append(listItem); + listItem.slideDown(5, function() { + displayNextItem(); + }); } } // search finished, update title and status message Modified: doctools/trunk/sphinx/templates/changes/versionchanges.html ============================================================================== --- doctools/trunk/sphinx/templates/changes/versionchanges.html (original) +++ doctools/trunk/sphinx/templates/changes/versionchanges.html Sun Jan 4 21:38:57 2009 @@ -1,4 +1,4 @@ -{% macro entries changes %} +{% macro entries(changes) %} <ul>{% for entry, docname, lineno in changes %} <li><a href="rst/{{ docname }}.html#L{{ lineno-10 }}" target="src">{{ entry }}</a></li> {% endfor %}</ul> Modified: doctools/trunk/sphinx/templates/layout.html ============================================================================== --- doctools/trunk/sphinx/templates/layout.html (original) +++ doctools/trunk/sphinx/templates/layout.html Sun Jan 4 21:38:57 2009 @@ -4,7 +4,7 @@ {%- endblock %} {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} -{%- macro relbar %} +{%- macro relbar() %} <div class="related"> <h3>{{ _('Navigation') }}</h3> <ul> @@ -24,8 +24,8 @@ </ul> </div> {%- endmacro %} -{%- macro sidebar %} - {%- if builder != 'htmlhelp' %} +{%- macro sidebar() %} + {%- if not embedded %} <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> {%- block sidebarlogo %} @@ -51,64 +51,53 @@ <p class="topless"><a href="{{ next.link|e }}" title="{{ _('next chapter') }}">{{ next.title }}</a></p> {%- endif %} {%- endblock %} - {%- if sourcename %} + {%- block sidebarsourcelink %} + {%- if show_source and has_source and sourcename %} <h3>{{ _('This Page') }}</h3> <ul class="this-page-menu"> - {%- if builder == 'web' %} - <li><a href="#comments">Comments ({{ comments|length }} so far)</a></li> - <li><a href="{{ pathto('@edit/' + sourcename)|e }}">{{ _('Suggest Change') }}</a></li> - <li><a href="{{ pathto('@source/' + sourcename)|e }}">{{ _('Show Source') }}</a></li> - {%- elif builder == 'html' %} - <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">{{ _('Show Source') }}</a></li> - {%- endif %} + <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow">{{ _('Show Source') }}</a></li> </ul> {%- endif %} + {%- endblock %} {%- if customsidebar %} - {{ rendertemplate(customsidebar) }} + {% include customsidebar %} {%- endif %} {%- block sidebarsearch %} {%- if pagename != "search" %} - <h3>{% if builder == 'web' %}{{ _('Keyword search')}}{% else %}{{ _('Quick search') }}{% endif %}</h3> + <h3>{{ _('Quick search') }}</h3> <form class="search" action="{{ pathto('search') }}" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> - {%- if builder == 'web' %} - <p style="font-size: 90%">{{ _('Enter a module, class or function name.') }}</p> - {%- endif %} + <p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p> {%- endif %} {%- endblock %} </div> </div> {%- endif %} -{%- endmacro -%} +{%- endmacro %} <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> {{ metatags }} - {%- if builder != 'htmlhelp' %} - {%- set titlesuffix = " — " + docstitle|e %} + {%- if not embedded %} + {%- set titlesuffix = " — "|safe + docstitle|e %} + {%- else %} + {%- set titlesuffix = "" %} {%- endif %} <title>{{ title|striptags }}{{ titlesuffix }} - {%- if builder == 'web' %} - - {%- for link, type, title in page_links %} - - {%- endfor %} - {%- else %} - {%- endif %} - {%- if builder != 'htmlhelp' %} + {%- if not embedded %} {%- for scriptfile in script_files %} @@ -154,13 +143,13 @@ {%- block document %}
    - {%- if builder != 'htmlhelp' %} + {%- if not embedded %}
    {%- endif %}
    {% block body %} {% endblock %}
    - {%- if builder != 'htmlhelp' %} + {%- if not embedded %}
    {%- endif %}
    Modified: doctools/trunk/sphinx/templates/modindex.html ============================================================================== --- doctools/trunk/sphinx/templates/modindex.html (original) +++ doctools/trunk/sphinx/templates/modindex.html Sun Jan 4 21:38:57 2009 @@ -2,7 +2,7 @@ {% set title = _('Global Module Index') %} {% block extrahead %} {{ super() }} -{% if builder != 'htmlhelp' and collapse_modindex %} +{% if not embedded and collapse_modindex %} @@ -11,26 +11,6 @@ {% block body %}

    {{ _('Global Module Index') }}

    -{% if builder == 'web' and freqentries %} -

    {{ _('Most popular modules:') }}

    -
    - {%- for module in freqentries %} - {{ module.name|e }} - {%- endfor %} -
    -{% endif %} -{% if builder == 'web' %} -
    - {{ _('Show modules only available on these platforms') }}:
    - {% for pl in platforms -%} - - - {% endfor %} - - -
    -{% endif %} {%- for letter in letters %} {{ letter }} {% if not loop.last %}| {% endif %} @@ -52,7 +32,7 @@ {% if fname %}{% endif -%} {{ modname|e }} {%- if fname %}{% endif %} - {%- if pform[0] %} ({{ pform|join(', ') }}){% endif -%} + {%- if pform and pform[0] %} ({{ pform|join(', ') }}){% endif -%} {% if dep %}{{ _('Deprecated')}}:{% endif %} {{ synops|e }} {%- endif -%} Modified: doctools/trunk/sphinx/templates/page.html ============================================================================== --- doctools/trunk/sphinx/templates/page.html (original) +++ doctools/trunk/sphinx/templates/page.html Sun Jan 4 21:38:57 2009 @@ -1,12 +1,4 @@ {% extends "layout.html" %} -{% set page_links = [ - (pathto('@rss/' + sourcename), 'application/rss+xml', 'Page Comments'), -] %} {% block body %} - {% if oldurl %} -
    - {% trans %}Note: You requested an out-of-date URL from this server. We've tried to redirect you to the new location of this page, but it may not be the right one.{% endtrans %} -
    - {% endif %} {{ body }} {% endblock %} Modified: doctools/trunk/sphinx/texinputs/sphinx.sty ============================================================================== --- doctools/trunk/sphinx/texinputs/sphinx.sty (original) +++ doctools/trunk/sphinx/texinputs/sphinx.sty Sun Jan 4 21:38:57 2009 @@ -451,6 +451,35 @@ \fi }{\end{fulllineitems}} +% class method ---------------------------------------------------------- +% \begin{classmethoddesc}[classname]{methodname}{args} +\newcommand{\classmethodline}[3][\@undefined]{ + \classmethodlineni{#2}{#3} + \ifx\@undefined#1\relax + \index{#2@{\py at idxcode{#2()}} (\py at thisclass\ class method)} + \else + \index{#2@{\py at idxcode{#2()}} (#1 class method)} + \fi +} +\newenvironment{classmethoddesc}[3][\@undefined]{ + \begin{fulllineitems} + \ifx\@undefined#1\relax + \classmethodline{#2}{#3} + \else + \def\py at thisclass{#1} + \classmethodline{#2}{#3} + \fi +}{\end{fulllineitems}} + +% similar to {classmethoddesc}, but doesn't add to the index +% (never actually uses the optional argument) +\newcommand{\classmethodlineni}[3][\py at classbadkey]{% + \py at sigline{class \bfcode{#2}}{#3}} +\newenvironment{classmethoddescni}[3][\py at classbadkey]{ + \begin{fulllineitems} + \classmethodlineni{#2}{#3} +}{\end{fulllineitems}} + % object data attribute -------------------------------------------------- % \begin{memberdesc}[classname]{membername} \newcommand{\memberline}[2][\py at classbadkey]{% Modified: doctools/trunk/sphinx/util/__init__.py ============================================================================== --- doctools/trunk/sphinx/util/__init__.py (original) +++ doctools/trunk/sphinx/util/__init__.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Utility functions for Sphinx. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import os @@ -15,6 +15,7 @@ import time import fnmatch import tempfile +import posixpath import traceback from os import path @@ -48,6 +49,11 @@ return ('..' + SEP) * (len(b2)-1) + SEP.join(t2) +def docname_join(basedocname, docname): + return posixpath.normpath( + posixpath.join('/' + basedocname, '..', docname))[1:] + + def ensuredir(path): """Ensure that a path exists.""" try: @@ -282,3 +288,76 @@ def ustrftime(format, *args): # strftime for unicode strings return time.strftime(unicode(format).encode('utf-8'), *args).decode('utf-8') + + +class FilenameUniqDict(dict): + """ + A dictionary that automatically generates unique names for its keys, + interpreted as filenames, and keeps track of a set of docnames they + appear in. Used for images and downloadable files in the environment. + """ + def __init__(self): + self._existing = set() + + def add_file(self, docname, newfile): + if newfile in self: + self[newfile][0].add(docname) + return + uniquename = path.basename(newfile) + base, ext = path.splitext(uniquename) + i = 0 + while uniquename in self._existing: + i += 1 + uniquename = '%s%s%s' % (base, i, ext) + self[newfile] = (set([docname]), uniquename) + self._existing.add(uniquename) + return uniquename + + def purge_doc(self, docname): + for filename, (docs, _) in self.items(): + docs.discard(docname) + if not docs: + del self[filename] + + def __getstate__(self): + return self._existing + + def __setstate__(self, state): + self._existing = state + + +def parselinenos(spec, total): + """ + Parse a line number spec (such as "1,2,4-6") and return a list of + wanted line numbers. + """ + items = list() + parts = spec.split(',') + for part in parts: + try: + begend = part.strip().split('-') + if len(begend) > 2: + raise ValueError + if len(begend) == 1: + items.append(int(begend[0])-1) + else: + start = (begend[0] == '') and 0 or int(begend[0])-1 + end = (begend[1] == '') and total or int(begend[1]) + items.extend(xrange(start, end)) + except Exception, err: + raise ValueError('invalid line number spec: %r' % spec) + return items + + +def force_decode(string, encoding): + if isinstance(string, str): + if encoding: + string = string.decode(encoding) + else: + try: + # try decoding with utf-8, should only work for real UTF-8 + string = string.decode('utf-8') + except UnicodeError: + # last resort -- can't fail + string = string.decode('latin1') + return string Modified: doctools/trunk/sphinx/util/compat.py ============================================================================== --- doctools/trunk/sphinx/util/compat.py (original) +++ doctools/trunk/sphinx/util/compat.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Stuff for docutils compatibility. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from docutils import nodes Modified: doctools/trunk/sphinx/util/console.py ============================================================================== --- doctools/trunk/sphinx/util/console.py (original) +++ doctools/trunk/sphinx/util/console.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Format colored console output. - :copyright: 2007-2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import os Added: doctools/trunk/sphinx/util/docstrings.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/util/docstrings.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +""" + sphinx.util.docstrings + ~~~~~~~~~~~~~~~~~~~~~~ + + Utilities for docstring processing. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import sys + + +def prepare_docstring(s): + """ + Convert a docstring into lines of parseable reST. Return it as a list of + lines usable for inserting into a docutils ViewList (used as argument + of nested_parse().) An empty line is added to act as a separator between + this docstring and following content. + """ + lines = s.expandtabs().splitlines() + # Find minimum indentation of any non-blank lines after first line. + margin = sys.maxint + for line in lines[1:]: + content = len(line.lstrip()) + if content: + indent = len(line) - content + margin = min(margin, indent) + # Remove indentation. + if lines: + lines[0] = lines[0].lstrip() + if margin < sys.maxint: + for i in range(1, len(lines)): lines[i] = lines[i][margin:] + # Remove any leading blank lines. + while lines and not lines[0]: + lines.pop(0) + # make sure there is an empty line at the end + if lines and lines[-1]: + lines.append('') + return lines + + +def prepare_commentdoc(s): + """ + Extract documentation comment lines (starting with #:) and return them as a + list of lines. Returns an empty list if there is no documentation. + """ + result = [] + lines = [line.strip() for line in s.expandtabs().splitlines()] + for line in lines: + if line.startswith('#: '): + result.append(line[3:]) + if result and result[-1]: + result.append('') + return result Modified: doctools/trunk/sphinx/util/jsdump.py ============================================================================== --- doctools/trunk/sphinx/util/jsdump.py (original) +++ doctools/trunk/sphinx/util/jsdump.py Sun Jan 4 21:38:57 2009 @@ -4,10 +4,10 @@ ~~~~~~~~~~~~~~~~~~ This module implements a simple JavaScript serializer. - Uses the basestring encode function from simplejson. + Uses the basestring encode function from simplejson by Bob Ippolito. - :copyright: 2008 by Armin Ronacher, Bob Ippolito, Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re Added: doctools/trunk/sphinx/util/png.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/util/png.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +""" + sphinx.util.png + ~~~~~~~~~~~~~~~ + + PNG image manipulation helpers. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import struct +import binascii + +LEN_IEND = 12 +LEN_DEPTH = 22 + +DEPTH_CHUNK_LEN = struct.pack('!i', 10) +DEPTH_CHUNK_START = 'tEXtDepth\x00' +IEND_CHUNK = '\x00\x00\x00\x00IEND\xAE\x42\x60\x82' + + +def read_png_depth(filename): + """ + Read the special tEXt chunk indicating the depth from a PNG file. + """ + result = None + f = open(filename, 'rb') + try: + f.seek(- (LEN_IEND + LEN_DEPTH), 2) + depthchunk = f.read(LEN_DEPTH) + if not depthchunk.startswith(DEPTH_CHUNK_LEN + DEPTH_CHUNK_START): + # either not a PNG file or not containing the depth chunk + return None + result = struct.unpack('!i', depthchunk[14:18])[0] + finally: + f.close() + return result + + +def write_png_depth(filename, depth): + """ + Write the special tEXt chunk indicating the depth to a PNG file. + The chunk is placed immediately before the special IEND chunk. + """ + data = struct.pack('!i', depth) + f = open(filename, 'r+b') + try: + # seek to the beginning of the IEND chunk + f.seek(-LEN_IEND, 2) + # overwrite it with the depth chunk + f.write(DEPTH_CHUNK_LEN + DEPTH_CHUNK_START + data) + # calculate the checksum over chunk name and data + f.write(struct.pack('!i', binascii.crc32(DEPTH_CHUNK_START + data))) + # replace the IEND chunk + f.write(IEND_CHUNK) + finally: + f.close() Modified: doctools/trunk/sphinx/util/stemmer.py ============================================================================== --- doctools/trunk/sphinx/util/stemmer.py (original) +++ doctools/trunk/sphinx/util/stemmer.py Sun Jan 4 21:38:57 2009 @@ -24,7 +24,7 @@ Release 1: January 2001 - :copyright: 2001 by Vivake Gupta . + :copyright: Copyright 2001 by Vivake Gupta . :license: Public Domain ("can be used free of charge for any purpose"). """ Modified: doctools/trunk/sphinx/util/texescape.py ============================================================================== --- doctools/trunk/sphinx/util/texescape.py (original) +++ doctools/trunk/sphinx/util/texescape.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ TeX escaping helper. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ tex_replacements = [ Added: doctools/trunk/sphinx/writers/__init__.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/writers/__init__.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers + ~~~~~~~~~~~~~~ + + Custom docutils writers. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" Added: doctools/trunk/sphinx/writers/html.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/writers/html.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,473 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers.html + ~~~~~~~~~~~~~~~~~~~ + + docutils writers handling Sphinx' custom nodes. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import sys +import posixpath +import os + +from docutils import nodes +from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator + +from sphinx.locale import admonitionlabels, versionlabels +from sphinx.highlighting import PygmentsBridge +from sphinx.util.smartypants import sphinx_smarty_pants + +try: + import Image # check for the Python Imaging Library +except ImportError: + Image = None + +class HTMLWriter(Writer): + def __init__(self, builder): + Writer.__init__(self) + self.builder = builder + + def translate(self): + # sadly, this is mostly copied from parent class + self.visitor = visitor = self.builder.translator_class(self.builder, + self.document) + self.document.walkabout(visitor) + self.output = visitor.astext() + for attr in ('head_prefix', 'stylesheet', 'head', 'body_prefix', + 'body_pre_docinfo', 'docinfo', 'body', 'fragment', + 'body_suffix', 'meta', 'title', 'subtitle', 'header', + 'footer', 'html_prolog', 'html_head', 'html_title', + 'html_subtitle', 'html_body', ): + setattr(self, attr, getattr(visitor, attr, None)) + self.clean_meta = ''.join(visitor.meta[2:]) + + +class HTMLTranslator(BaseTranslator): + """ + Our custom HTML translator. + """ + + def __init__(self, builder, *args, **kwds): + BaseTranslator.__init__(self, *args, **kwds) + self.highlighter = PygmentsBridge('html', builder.config.pygments_style) + self.no_smarty = 0 + self.builder = builder + self.highlightlang = builder.config.highlight_language + self.highlightlinenothreshold = sys.maxint + self.protect_literal_text = 0 + self.add_permalinks = builder.config.html_add_permalinks + + def visit_desc(self, node): + self.body.append(self.starttag(node, 'dl', CLASS=node['desctype'])) + def depart_desc(self, node): + self.body.append('\n\n') + + def visit_desc_signature(self, node): + # the id is set automatically + self.body.append(self.starttag(node, 'dt')) + # anchor for per-desc interactive data + if node.parent['desctype'] != 'describe' and node['ids'] and node['first']: + self.body.append('' % node['ids'][0]) + if node.parent['desctype'] in ('class', 'exception'): + self.body.append('%s ' % node.parent['desctype']) + def depart_desc_signature(self, node): + if node['ids'] and self.add_permalinks and self.builder.add_permalinks: + self.body.append(u'\u00B6' % + _('Permalink to this definition')) + self.body.append('\n') + + def visit_desc_addname(self, node): + self.body.append(self.starttag(node, 'tt', '', CLASS='descclassname')) + def depart_desc_addname(self, node): + self.body.append('') + + def visit_desc_type(self, node): + pass + def depart_desc_type(self, node): + pass + + def visit_desc_returns(self, node): + self.body.append(' → ') + def depart_desc_returns(self, node): + pass + + def visit_desc_name(self, node): + self.body.append(self.starttag(node, 'tt', '', CLASS='descname')) + def depart_desc_name(self, node): + self.body.append('') + + def visit_desc_parameterlist(self, node): + self.body.append('(') + self.first_param = 1 + def depart_desc_parameterlist(self, node): + self.body.append(')') + + def visit_desc_parameter(self, node): + if not self.first_param: + self.body.append(', ') + else: + self.first_param = 0 + if not node.hasattr('noemph'): + self.body.append('') + def depart_desc_parameter(self, node): + if not node.hasattr('noemph'): + self.body.append('') + + def visit_desc_optional(self, node): + self.body.append('[') + def depart_desc_optional(self, node): + self.body.append(']') + + def visit_desc_annotation(self, node): + self.body.append(self.starttag(node, 'em', CLASS='property')) + def depart_desc_annotation(self, node): + self.body.append('') + + def visit_desc_content(self, node): + self.body.append(self.starttag(node, 'dd', '')) + def depart_desc_content(self, node): + self.body.append('') + + def visit_refcount(self, node): + self.body.append(self.starttag(node, 'em', '', CLASS='refcount')) + def depart_refcount(self, node): + self.body.append('') + + def visit_versionmodified(self, node): + self.body.append(self.starttag(node, 'p')) + text = versionlabels[node['type']] % node['version'] + if len(node): + text += ': ' + else: + text += '.' + self.body.append('%s' % text) + def depart_versionmodified(self, node): + self.body.append('

    \n') + + # overwritten + def visit_reference(self, node): + BaseTranslator.visit_reference(self, node) + if node.hasattr('reftitle'): + # ugly hack to add a title attribute + starttag = self.body[-1] + if not starttag.startswith(' tag + self.section_level += 1 + self.body.append(self.starttag(node, 'div', CLASS='section')) + + def visit_title(self, node): + # don't move the id attribute inside the tag + BaseTranslator.visit_title(self, node, move_ids=0) + + # overwritten + def visit_literal_block(self, node): + if node.rawsource != node.astext(): + # most probably a parsed-literal block -- don't highlight + return BaseTranslator.visit_literal_block(self, node) + lang = self.highlightlang + linenos = node.rawsource.count('\n') >= self.highlightlinenothreshold - 1 + if node.has_key('language'): + # code-block directives + lang = node['language'] + if node.has_key('linenos'): + linenos = node['linenos'] + highlighted = self.highlighter.highlight_block(node.rawsource, lang, linenos) + starttag = self.starttag(node, 'div', suffix='', CLASS='highlight-%s' % lang) + self.body.append(starttag + highlighted + '
    \n') + raise nodes.SkipNode + + def visit_doctest_block(self, node): + self.visit_literal_block(node) + + # overwritten + def visit_literal(self, node): + if len(node.children) == 1 and \ + node.children[0] in ('None', 'True', 'False'): + node['classes'].append('xref') + self.body.append(self.starttag(node, 'tt', '', CLASS='docutils literal')) + self.protect_literal_text += 1 + def depart_literal(self, node): + self.protect_literal_text -= 1 + self.body.append('') + + def visit_productionlist(self, node): + self.body.append(self.starttag(node, 'pre')) + names = [] + for production in node: + names.append(production['tokenname']) + maxlen = max(len(name) for name in names) + for production in node: + if production['tokenname']: + lastname = production['tokenname'].ljust(maxlen) + self.body.append(self.starttag(production, 'strong', '')) + self.body.append(lastname + ' ::= ') + else: + self.body.append('%s ' % (' '*len(lastname))) + production.walkabout(self) + self.body.append('\n') + self.body.append('\n') + raise nodes.SkipNode + def depart_productionlist(self, node): + pass + + def visit_production(self, node): + pass + def depart_production(self, node): + pass + + def visit_centered(self, node): + self.body.append(self.starttag(node, 'p', CLASS="centered") + '') + def depart_centered(self, node): + self.body.append('

    ') + + def visit_compact_paragraph(self, node): + pass + def depart_compact_paragraph(self, node): + pass + + def visit_highlightlang(self, node): + self.highlightlang = node['lang'] + self.highlightlinenothreshold = node['linenothreshold'] + def depart_highlightlang(self, node): + pass + + def visit_download_reference(self, node): + if node.hasattr('filename'): + self.body.append('
    ' % posixpath.join( + self.builder.dlpath, node['filename'])) + self.context.append('') + else: + self.context.append('') + def depart_download_reference(self, node): + self.body.append(self.context.pop()) + + # overwritten + def visit_image(self, node): + olduri = node['uri'] + # rewrite the URI if the environment knows about it + if olduri in self.builder.images: + node['uri'] = posixpath.join(self.builder.imgpath, + self.builder.images[olduri]) + + if node.has_key('scale'): + if Image and not (node.has_key('width') + and node.has_key('height')): + try: + im = Image.open(os.path.join(self.builder.srcdir, + olduri)) + except (IOError, # Source image can't be found or opened + UnicodeError): # PIL doesn't like Unicode paths. + print olduri + pass + else: + if not node.has_key('width'): + node['width'] = str(im.size[0]) + if not node.has_key('height'): + node['height'] = str(im.size[1]) + del im + BaseTranslator.visit_image(self, node) + + def visit_toctree(self, node): + # this only happens when formatting a toc from env.tocs -- in this + # case we don't want to include the subtree + raise nodes.SkipNode + + def visit_index(self, node): + raise nodes.SkipNode + + def visit_tabular_col_spec(self, node): + raise nodes.SkipNode + + def visit_glossary(self, node): + pass + def depart_glossary(self, node): + pass + + def visit_acks(self, node): + pass + def depart_acks(self, node): + pass + + def visit_module(self, node): + pass + def depart_module(self, node): + pass + + def bulk_text_processor(self, text): + return text + + # overwritten + def visit_Text(self, node): + text = node.astext() + encoded = self.encode(text) + if self.protect_literal_text: + # moved here from base class's visit_literal to support + # more formatting in literal nodes + for token in self.words_and_spaces.findall(encoded): + if token.strip(): + # protect literal text from line wrapping + self.body.append('%s' % token) + elif token in ' \n': + # allow breaks at whitespace + self.body.append(token) + else: + # protect runs of multiple spaces; the last one can wrap + self.body.append(' ' * (len(token)-1) + ' ') + else: + if self.in_mailto and self.settings.cloak_email_addresses: + encoded = self.cloak_email(encoded) + else: + encoded = self.bulk_text_processor(encoded) + self.body.append(encoded) + + # these are all for docutils 0.5 compatibility + + def visit_note(self, node): + self.visit_admonition(node, 'note') + def depart_note(self, node): + self.depart_admonition(node) + + def visit_warning(self, node): + self.visit_admonition(node, 'warning') + def depart_warning(self, node): + self.depart_admonition(node) + + def visit_attention(self, node): + self.visit_admonition(node, 'attention') + + def depart_attention(self, node): + self.depart_admonition() + + def visit_caution(self, node): + self.visit_admonition(node, 'caution') + def depart_caution(self, node): + self.depart_admonition() + + def visit_danger(self, node): + self.visit_admonition(node, 'danger') + def depart_danger(self, node): + self.depart_admonition() + + def visit_error(self, node): + self.visit_admonition(node, 'error') + def depart_error(self, node): + self.depart_admonition() + + def visit_hint(self, node): + self.visit_admonition(node, 'hint') + def depart_hint(self, node): + self.depart_admonition() + + def visit_important(self, node): + self.visit_admonition(node, 'important') + def depart_important(self, node): + self.depart_admonition() + + def visit_tip(self, node): + self.visit_admonition(node, 'tip') + def depart_tip(self, node): + self.depart_admonition() + + # these are only handled specially in the SmartyPantsHTMLTranslator + def visit_literal_emphasis(self, node): + return self.visit_emphasis(node) + def depart_literal_emphasis(self, node): + return self.depart_emphasis(node) + + def depart_title(self, node): + close_tag = self.context[-1] + if self.add_permalinks and self.builder.add_permalinks and \ + (close_tag.startswith('\u00B6' % + _('Permalink to this headline')) + BaseTranslator.depart_title(self, node) + + def unknown_visit(self, node): + raise NotImplementedError('Unknown node: ' + node.__class__.__name__) + + +class SmartyPantsHTMLTranslator(HTMLTranslator): + """ + Handle ordinary text via smartypants, converting quotes and dashes + to the correct entities. + """ + + def __init__(self, *args, **kwds): + self.no_smarty = 0 + HTMLTranslator.__init__(self, *args, **kwds) + + def visit_literal(self, node): + self.no_smarty += 1 + try: + # this raises SkipNode + HTMLTranslator.visit_literal(self, node) + finally: + self.no_smarty -= 1 + + def visit_literal_emphasis(self, node): + self.no_smarty += 1 + self.visit_emphasis(node) + + def depart_literal_emphasis(self, node): + self.depart_emphasis(node) + self.no_smarty -= 1 + + def visit_desc_signature(self, node): + self.no_smarty += 1 + HTMLTranslator.visit_desc_signature(self, node) + + def depart_desc_signature(self, node): + self.no_smarty -= 1 + HTMLTranslator.depart_desc_signature(self, node) + + def visit_productionlist(self, node): + self.no_smarty += 1 + try: + HTMLTranslator.visit_productionlist(self, node) + finally: + self.no_smarty -= 1 + + def visit_option(self, node): + self.no_smarty += 1 + HTMLTranslator.visit_option(self, node) + def depart_option(self, node): + self.no_smarty -= 1 + HTMLTranslator.depart_option(self, node) + + def bulk_text_processor(self, text): + if self.no_smarty <= 0: + return sphinx_smarty_pants(text) + return text Added: doctools/trunk/sphinx/writers/latex.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/writers/latex.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,1216 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers.latex + ~~~~~~~~~~~~~~~~~~~~ + + Custom docutils writer for LaTeX. + + Much of this code is adapted from Dave Kuhlman's "docpy" writer from his + docutils sandbox. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import sys +from os import path + +from docutils import nodes, writers +from docutils.writers.latex2e import Babel + +from sphinx import addnodes +from sphinx import highlighting +from sphinx.locale import admonitionlabels, versionlabels +from sphinx.util import ustrftime +from sphinx.util.texescape import tex_escape_map +from sphinx.util.smartypants import educateQuotesLatex + +HEADER = r'''%% Generated by Sphinx. +\documentclass[%(papersize)s,%(pointsize)s%(classoptions)s]{%(docclass)s} +%(inputenc)s +%(fontenc)s +%(babel)s +%(fontpkg)s +%(fncychap)s +\usepackage{sphinx} +%(preamble)s + +\title{%(title)s} +\date{%(date)s} +\release{%(release)s} +\author{%(author)s} +\newcommand{\sphinxlogo}{%(logo)s} +\renewcommand{\releasename}{%(releasename)s} +%(makeindex)s +%(makemodindex)s +''' + +BEGIN_DOC = r''' +\begin{document} +%(shorthandoff)s +%(maketitle)s +%(tableofcontents)s +''' + +FOOTER = r''' +%(footer)s +\renewcommand{\indexname}{%(modindexname)s} +%(printmodindex)s +\renewcommand{\indexname}{%(indexname)s} +%(printindex)s +\end{document} +''' + + +class LaTeXWriter(writers.Writer): + + supported = ('sphinxlatex',) + + settings_spec = ('LaTeX writer options', '', ( + ('Document name', ['--docname'], {'default': ''}), + ('Document class', ['--docclass'], {'default': 'manual'}), + ('Author', ['--author'], {'default': ''}), + )) + settings_defaults = {} + + output = None + + def __init__(self, builder): + writers.Writer.__init__(self) + self.builder = builder + + def translate(self): + visitor = LaTeXTranslator(self.document, self.builder) + self.document.walkabout(visitor) + self.output = visitor.astext() + + +# Helper classes + +class ExtBabel(Babel): + def get_shorthandoff(self): + shortlang = self.language.split('_')[0] + if shortlang in ('de', 'sl', 'pt', 'es', 'nl', 'pl', 'it'): + return '\\shorthandoff{"}' + return '' + + _ISO639_TO_BABEL = Babel._ISO639_TO_BABEL.copy() + _ISO639_TO_BABEL['sl'] = 'slovene' + + +class Table(object): + def __init__(self): + self.col = 0 + self.colcount = 0 + self.colspec = None + self.had_head = False + self.has_verbatim = False + self.caption = None + + +class Desc(object): + def __init__(self, node): + self.env = LaTeXTranslator.desc_map.get(node['desctype'], 'describe') + self.type = self.cls = self.name = self.params = \ + self.annotation = self.returns = '' + self.count = 0 + + +class LaTeXTranslator(nodes.NodeVisitor): + sectionnames = ["part", "chapter", "section", "subsection", + "subsubsection", "paragraph", "subparagraph"] + + ignore_missing_images = False + + default_elements = { + 'docclass': 'manual', + 'papersize': 'letterpaper', + 'pointsize': '10pt', + 'classoptions': '', + 'inputenc': '\\usepackage[utf8]{inputenc}', + 'fontenc': '\\usepackage[T1]{fontenc}', + 'babel': '\\usepackage{babel}', + 'fontpkg': '\\usepackage{times}', + 'fncychap': '\\usepackage[Bjarne]{fncychap}', + 'preamble': '', + 'title': '', + 'date': '', + 'release': '', + 'author': '', + 'logo': '', + 'releasename': 'Release', + 'makeindex': '\\makeindex', + 'makemodindex': '\\makemodindex', + 'shorthandoff': '', + 'maketitle': '\\maketitle', + 'tableofcontents': '\\tableofcontents', + 'footer': '', + 'printmodindex': '\\printmodindex', + 'printindex': '\\printindex', + } + + def __init__(self, document, builder): + nodes.NodeVisitor.__init__(self, document) + self.builder = builder + self.body = [] + + # sort out some elements + papersize = builder.config.latex_paper_size + 'paper' + if papersize == 'paper': # e.g. command line "-D latex_paper_size=" + papersize = 'letterpaper' + + self.elements = self.default_elements.copy() + self.elements.update({ + 'docclass': document.settings.docclass, + 'papersize': papersize, + 'pointsize': builder.config.latex_font_size, + # if empty, the title is set to the first section title + 'title': document.settings.title, + 'date': ustrftime(builder.config.today_fmt or _('%B %d, %Y')), + 'release': builder.config.release, + 'author': document.settings.author, + 'releasename': _('Release'), + 'preamble': builder.config.latex_preamble, + 'modindexname': _('Module Index'), + 'indexname': _('Index'), + }) + if builder.config.latex_logo: + self.elements['logo'] = '\\includegraphics{%s}\\par' % \ + path.basename(builder.config.latex_logo) + if builder.config.language: + babel = ExtBabel(builder.config.language) + lang = babel.get_language() + if lang: + self.elements['classoptions'] += ',' + babel.get_language() + else: + self.builder.warn('no Babel option known for language %r' % + builder.config.language) + self.elements['shorthandoff'] = babel.get_shorthandoff() + self.elements['fncychap'] = '\\usepackage[Sonny]{fncychap}' + else: + self.elements['classoptions'] += ',english' + if not builder.config.latex_use_modindex: + self.elements['makemodindex'] = '' + self.elements['printmodindex'] = '' + # allow the user to override them all + self.elements.update(builder.config.latex_elements) + + self.highlighter = highlighting.PygmentsBridge( + 'latex', builder.config.pygments_style) + self.context = [] + self.descstack = [] + self.bibitems = [] + self.table = None + self.next_table_colspec = None + self.highlightlang = builder.config.highlight_language + self.highlightlinenothreshold = sys.maxint + self.written_ids = set() + self.footnotestack = [] + if self.elements['docclass'] == 'manual': + if builder.config.latex_use_parts: + self.top_sectionlevel = 0 + else: + self.top_sectionlevel = 1 + else: + self.top_sectionlevel = 2 + self.next_section_target = None + # flags + self.verbatim = None + self.in_title = 0 + self.in_production_list = 0 + self.first_document = 1 + self.this_is_the_title = 1 + self.literal_whitespace = 0 + self.no_contractions = 0 + + def astext(self): + return (HEADER % self.elements + self.highlighter.get_stylesheet() + + u''.join(self.body) + FOOTER % self.elements) + + def visit_document(self, node): + self.footnotestack.append(self.collect_footnotes(node)) + if self.first_document == 1: + # the first document is all the regular content ... + self.body.append(BEGIN_DOC % self.elements) + self.first_document = 0 + elif self.first_document == 0: + # ... and all others are the appendices + self.body.append('\n\\appendix\n') + self.first_document = -1 + if 'docname' in node: + self.body.append('\\hypertarget{--doc-%s}{}' % node['docname']) + # "- 1" because the level is increased before the title is visited + self.sectionlevel = self.top_sectionlevel - 1 + def depart_document(self, node): + if self.bibitems: + widest_label = "" + for bi in self.bibitems: + if len(widest_label) < len(bi[0]): + widest_label = bi[0] + self.body.append('\n\\begin{thebibliography}{%s}\n' % widest_label) + for bi in self.bibitems: + # cite_key: underscores must not be escaped + cite_key = bi[0].replace(r"\_", "_") + self.body.append('\\bibitem[%s]{%s}{%s}\n' % (bi[0], cite_key, bi[1])) + self.body.append('\\end{thebibliography}\n') + self.bibitems = [] + + def visit_start_of_file(self, node): + # This marks the begin of a new file; therefore the current module and + # class must be reset + self.body.append('\n\\resetcurrentobjects\n') + # and also, new footnotes + self.footnotestack.append(self.collect_footnotes(node)) + # also add a document target + self.body.append('\\hypertarget{--doc-%s}{}' % node['docname']) + + def collect_footnotes(self, node): + fnotes = {} + def footnotes_under(n): + if isinstance(n, nodes.footnote): + yield n + else: + for c in n.children: + if isinstance(c, addnodes.start_of_file): + continue + for k in footnotes_under(c): + yield k + for fn in footnotes_under(node): + num = fn.children[0].astext().strip() + fnotes[num] = fn + fn.parent.remove(fn) + return fnotes + + def depart_start_of_file(self, node): + self.footnotestack.pop() + + def visit_highlightlang(self, node): + self.highlightlang = node['lang'] + self.highlightlinenothreshold = node['linenothreshold'] + raise nodes.SkipNode + + def visit_section(self, node): + if not self.this_is_the_title: + self.sectionlevel += 1 + self.body.append('\n\n') + if self.next_section_target: + self.body.append(r'\hypertarget{%s}{}' % self.next_section_target) + self.next_section_target = None + #if node.get('ids'): + # for id in node['ids']: + # if id not in self.written_ids: + # self.body.append(r'\hypertarget{%s}{}' % id) + # self.written_ids.add(id) + def depart_section(self, node): + self.sectionlevel = max(self.sectionlevel - 1, self.top_sectionlevel - 1) + + def visit_problematic(self, node): + self.body.append(r'{\color{red}\bfseries{}') + def depart_problematic(self, node): + self.body.append('}') + + def visit_topic(self, node): + self.body.append('\\setbox0\\vbox{\n' + '\\begin{minipage}{0.95\\textwidth}\n') + def depart_topic(self, node): + self.body.append('\\end{minipage}}\n' + '\\begin{center}\\setlength{\\fboxsep}{5pt}' + '\\shadowbox{\\box0}\\end{center}\n') + visit_sidebar = visit_topic + depart_sidebar = depart_topic + + def visit_glossary(self, node): + pass + def depart_glossary(self, node): + pass + + def visit_productionlist(self, node): + self.body.append('\n\n\\begin{productionlist}\n') + self.in_production_list = 1 + def depart_productionlist(self, node): + self.body.append('\\end{productionlist}\n\n') + self.in_production_list = 0 + + def visit_production(self, node): + if node['tokenname']: + self.body.append('\\production{%s}{' % self.encode(node['tokenname'])) + else: + self.body.append('\\productioncont{') + def depart_production(self, node): + self.body.append('}\n') + + def visit_transition(self, node): + self.body.append('\n\n\\bigskip\\hrule{}\\bigskip\n\n') + def depart_transition(self, node): + pass + + def visit_title(self, node): + parent = node.parent + if isinstance(parent, addnodes.seealso): + # the environment already handles this + raise nodes.SkipNode + elif self.this_is_the_title: + if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text): + self.builder.warn('document title is not a single Text node') + if not self.elements['title']: + # text needs to be escaped since it is inserted into + # the output literally + self.elements['title'] = node.astext().translate(tex_escape_map) + self.this_is_the_title = 0 + raise nodes.SkipNode + elif isinstance(parent, nodes.section): + try: + self.body.append(r'\%s{' % self.sectionnames[self.sectionlevel]) + except IndexError: + from sphinx.application import SphinxError + raise SphinxError('too many nesting section levels for LaTeX, ' + 'at heading: %s' % node.astext()) + self.context.append('}\n') + elif isinstance(parent, (nodes.topic, nodes.sidebar)): + self.body.append(r'\textbf{') + self.context.append('}\n\n\medskip\n\n') + elif isinstance(parent, nodes.Admonition): + self.body.append('{') + self.context.append('}\n') + elif isinstance(parent, nodes.table): + self.table.caption = self.encode(node.astext()) + raise nodes.SkipNode + else: + self.builder.warn('encountered title node not in section, topic, ' + 'table, admonition or sidebar') + self.body.append('\\textbf{') + self.context.append('}\n') + self.in_title = 1 + def depart_title(self, node): + self.in_title = 0 + self.body.append(self.context.pop()) + + def visit_subtitle(self, node): + if isinstance(node.parent, nodes.sidebar): + self.body.append('~\\\\\n\\textbf{') + self.context.append('}\n\\smallskip\n') + else: + self.context.append('') + def depart_subtitle(self, node): + self.body.append(self.context.pop()) + + desc_map = { + 'function' : 'funcdesc', + 'class': 'classdesc', + 'method': 'methoddesc', + 'classmethod': 'classmethoddesc', + 'staticmethod': 'staticmethoddesc', + 'exception': 'excdesc', + 'data': 'datadesc', + 'attribute': 'memberdesc', + 'opcode': 'opcodedesc', + + 'cfunction': 'cfuncdesc', + 'cmember': 'cmemberdesc', + 'cmacro': 'csimplemacrodesc', + 'ctype': 'ctypedesc', + 'cvar': 'cvardesc', + + 'describe': 'describe', + # and all others are 'describe' too + } + + def visit_desc(self, node): + self.descstack.append(Desc(node)) + def depart_desc(self, node): + d = self.descstack.pop() + self.body.append("\\end{%s}\n" % d.env) + + def visit_desc_signature(self, node): + d = self.descstack[-1] + # reset these for every signature + d.type = d.cls = d.name = d.params = '' + def depart_desc_signature(self, node): + d = self.descstack[-1] + d.cls = d.cls.rstrip('.') + if node.parent['desctype'] != 'describe' and node['ids']: + hyper = '\\hypertarget{%s}{}' % node['ids'][0] + else: + hyper = '' + if d.count == 0: + t1 = "\n\n%s\\begin{%s}" % (hyper, d.env) + else: + t1 = "\n%s\\%sline" % (hyper, d.env[:-4]) + d.count += 1 + if d.env in ('funcdesc', 'classdesc', 'excclassdesc'): + t2 = "{%s}{%s}" % (d.name, d.params) + elif d.env in ('datadesc', 'excdesc', 'csimplemacrodesc'): + t2 = "{%s}" % (d.name) + elif d.env in ('methoddesc', 'classmethoddesc', 'staticmethoddesc'): + if d.cls: + t2 = "[%s]{%s}{%s}" % (d.cls, d.name, d.params) + else: + t2 = "{%s}{%s}" % (d.name, d.params) + elif d.env == 'memberdesc': + if d.cls: + t2 = "[%s]{%s}" % (d.cls, d.name) + else: + t2 = "{%s}" % d.name + elif d.env == 'cfuncdesc': + if d.cls: + # C++ class names + d.name = '%s::%s' % (d.cls, d.name) + t2 = "{%s}{%s}{%s}" % (d.type, d.name, d.params) + elif d.env == 'cmemberdesc': + try: + type, container = d.type.rsplit(' ', 1) + container = container.rstrip('.') + except ValueError: + container = '' + type = d.type + t2 = "{%s}{%s}{%s}" % (container, type, d.name) + elif d.env == 'cvardesc': + t2 = "{%s}{%s}" % (d.type, d.name) + elif d.env == 'ctypedesc': + t2 = "{%s}" % (d.name) + elif d.env == 'opcodedesc': + t2 = "{%s}{%s}" % (d.name, d.params) + elif d.env == 'describe': + t2 = "{%s}" % d.name + self.body.append(t1 + t2) + + def visit_desc_type(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += self.encode(node.astext()) + else: + self.descstack[-1].type = self.encode(node.astext().strip()) + raise nodes.SkipNode + + def visit_desc_returns(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += ' $\\rightarrow$ ' + self.encode(node.astext()) + else: + self.descstack[-1].returns = self.encode(node.astext().strip()) + raise nodes.SkipNode + + def visit_desc_name(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += self.encode(node.astext()) + else: + self.descstack[-1].name = self.encode(node.astext().strip()) + raise nodes.SkipNode + + def visit_desc_addname(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += self.encode(node.astext()) + else: + self.descstack[-1].cls = self.encode(node.astext().strip()) + raise nodes.SkipNode + + def visit_desc_parameterlist(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += self.encode(node.astext()) + else: + self.descstack[-1].params = self.encode(node.astext().strip()) + raise nodes.SkipNode + + def visit_desc_annotation(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += self.encode(node.astext()) + else: + self.descstack[-1].annotation = self.encode(node.astext().strip()) + raise nodes.SkipNode + + def visit_refcount(self, node): + self.body.append("\\emph{") + def depart_refcount(self, node): + self.body.append("}\\\\") + + def visit_desc_content(self, node): + if node.children and not isinstance(node.children[0], nodes.paragraph): + # avoid empty desc environment which causes a formatting bug + self.body.append('~') + def depart_desc_content(self, node): + pass + + def visit_seealso(self, node): + self.body.append("\n\n\\strong{%s:}\n\n" % admonitionlabels['seealso']) + def depart_seealso(self, node): + self.body.append("\n\n") + + def visit_rubric(self, node): + if len(node.children) == 1 and node.children[0].astext() == 'Footnotes': + raise nodes.SkipNode + self.body.append('\\paragraph{') + self.context.append('}\n') + def depart_rubric(self, node): + self.body.append(self.context.pop()) + + def visit_footnote(self, node): + pass + def depart_footnote(self, node): + pass + + def visit_label(self, node): + if isinstance(node.parent, nodes.citation): + self.bibitems[-1][0] = node.astext() + raise nodes.SkipNode + + def visit_tabular_col_spec(self, node): + self.next_table_colspec = node['spec'] + raise nodes.SkipNode + + def visit_table(self, node): + if self.table: + raise NotImplementedError('Nested tables are not supported.') + self.table = Table() + self.tablebody = [] + # Redirect body output until table is finished. + self._body = self.body + self.body = self.tablebody + def depart_table(self, node): + self.body = self._body + if self.table.caption is not None: + self.body.append('\n\\begin{threeparttable}\n' + '\\caption{%s}\n' % self.table.caption) + if self.table.has_verbatim: + self.body.append('\n\\begin{tabular}') + else: + self.body.append('\n\\begin{tabulary}{\\textwidth}') + if self.table.colspec: + self.body.append(self.table.colspec) + else: + if self.table.has_verbatim: + colwidth = 0.95 / self.table.colcount + colspec = ('p{%.3f\\textwidth}|' % colwidth) * self.table.colcount + self.body.append('{|' + colspec + '}\n') + else: + self.body.append('{|' + ('L|' * self.table.colcount) + '}\n') + self.body.extend(self.tablebody) + if self.table.has_verbatim: + self.body.append('\\end{tabular}\n\n') + else: + self.body.append('\\end{tabulary}\n\n') + if self.table.caption is not None: + self.body.append('\\end{threeparttable}\n\n') + self.table = None + self.tablebody = None + + def visit_colspec(self, node): + self.table.colcount += 1 + def depart_colspec(self, node): + pass + + def visit_tgroup(self, node): + pass + def depart_tgroup(self, node): + pass + + def visit_thead(self, node): + if self.next_table_colspec: + self.table.colspec = '{%s}\n' % self.next_table_colspec + self.next_table_colspec = None + self.body.append('\\hline\n') + self.table.had_head = True + def depart_thead(self, node): + self.body.append('\\hline\n') + + def visit_tbody(self, node): + if not self.table.had_head: + self.visit_thead(node) + def depart_tbody(self, node): + self.body.append('\\hline\n') + + def visit_row(self, node): + self.table.col = 0 + def depart_row(self, node): + self.body.append('\\\\\n') + + def visit_entry(self, node): + if node.has_key('morerows') or node.has_key('morecols'): + raise NotImplementedError('Column or row spanning cells are ' + 'not implemented.') + if self.table.col > 0: + self.body.append(' & ') + self.table.col += 1 + if isinstance(node.parent.parent, nodes.thead): + self.body.append('\\textbf{') + self.context.append('}') + else: + self.context.append('') + def depart_entry(self, node): + self.body.append(self.context.pop()) # header + + def visit_acks(self, node): + # this is a list in the source, but should be rendered as a + # comma-separated list here + self.body.append('\n\n') + self.body.append(', '.join(n.astext() for n in node.children[0].children) + '.') + self.body.append('\n\n') + raise nodes.SkipNode + + def visit_bullet_list(self, node): + self.body.append('\\begin{itemize}\n' ) + def depart_bullet_list(self, node): + self.body.append('\\end{itemize}\n' ) + + def visit_enumerated_list(self, node): + self.body.append('\\begin{enumerate}\n' ) + def depart_enumerated_list(self, node): + self.body.append('\\end{enumerate}\n' ) + + def visit_list_item(self, node): + # Append "{}" in case the next character is "[", which would break + # LaTeX's list environment (no numbering and the "[" is not printed). + self.body.append(r'\item {} ') + def depart_list_item(self, node): + self.body.append('\n') + + def visit_definition_list(self, node): + self.body.append('\\begin{description}\n') + def depart_definition_list(self, node): + self.body.append('\\end{description}\n') + + def visit_definition_list_item(self, node): + pass + def depart_definition_list_item(self, node): + pass + + def visit_term(self, node): + ctx = ']' + if node.has_key('ids') and node['ids']: + ctx += '\\hypertarget{%s}{}' % node['ids'][0] + self.body.append('\\item[') + self.context.append(ctx) + def depart_term(self, node): + self.body.append(self.context.pop()) + + def visit_classifier(self, node): + self.body.append('{[}') + def depart_classifier(self, node): + self.body.append('{]}') + + def visit_definition(self, node): + pass + def depart_definition(self, node): + self.body.append('\n') + + def visit_field_list(self, node): + self.body.append('\\begin{quote}\\begin{description}\n') + def depart_field_list(self, node): + self.body.append('\\end{description}\\end{quote}\n') + + def visit_field(self, node): + pass + def depart_field(self, node): + pass + + visit_field_name = visit_term + depart_field_name = depart_term + + visit_field_body = visit_definition + depart_field_body = depart_definition + + def visit_paragraph(self, node): + self.body.append('\n') + def depart_paragraph(self, node): + self.body.append('\n') + + def visit_centered(self, node): + self.body.append('\n\\begin{centering}') + def depart_centered(self, node): + self.body.append('\n\\end{centering}') + + def visit_module(self, node): + modname = node['modname'] + self.body.append('\n\\declaremodule[%s]{}{%s}' % (modname.replace('_', ''), + self.encode(modname))) + self.body.append('\n\\modulesynopsis{%s}' % self.encode(node['synopsis'])) + if node.has_key('platform'): + self.body.append('\\platform{%s}' % self.encode(node['platform'])) + def depart_module(self, node): + pass + + def latex_image_length(self, width_str): + match = re.match('(\d*\.?\d*)\s*(\S*)', width_str) + if not match: + # fallback + return width_str + res = width_str + amount, unit = match.groups()[:2] + if not unit or unit == "px": + # pixels: let LaTeX alone + return None + elif unit == "%": + res = "%.3f\\linewidth" % (float(amount) / 100.0) + return res + + def visit_image(self, node): + attrs = node.attributes + pre = [] # in reverse order + post = [] + include_graphics_options = [] + inline = isinstance(node.parent, nodes.TextElement) + if attrs.has_key('scale'): + # Could also be done with ``scale`` option to + # ``\includegraphics``; doing it this way for consistency. + pre.append('\\scalebox{%f}{' % (attrs['scale'] / 100.0,)) + post.append('}') + if attrs.has_key('width'): + w = self.latex_image_length(attrs['width']) + if w: + include_graphics_options.append('width=%s' % w) + if attrs.has_key('height'): + h = self.latex_image_length(attrs['height']) + if h: + include_graphics_options.append('height=%s' % h) + if attrs.has_key('align'): + align_prepost = { + # By default latex aligns the top of an image. + (1, 'top'): ('', ''), + (1, 'middle'): ('\\raisebox{-0.5\\height}{', '}'), + (1, 'bottom'): ('\\raisebox{-\\height}{', '}'), + (0, 'center'): ('{\\hfill', '\\hfill}'), + # These 2 don't exactly do the right thing. The image should + # be floated alongside the paragraph. See + # http://www.w3.org/TR/html4/struct/objects.html#adef-align-IMG + (0, 'left'): ('{', '\\hfill}'), + (0, 'right'): ('{\\hfill', '}'),} + try: + pre.append(align_prepost[inline, attrs['align']][0]) + post.append(align_prepost[inline, attrs['align']][1]) + except KeyError: + pass # XXX complain here? + if not inline: + pre.append('\n') + post.append('\n') + pre.reverse() + if node['uri'] in self.builder.images: + uri = self.builder.images[node['uri']] + else: + # missing image! + if self.ignore_missing_images: + return + uri = node['uri'] + if uri.find('://') != -1: + # ignore remote images + return + self.body.extend(pre) + options = '' + if include_graphics_options: + options = '[%s]' % ','.join(include_graphics_options) + self.body.append('\\includegraphics%s{%s}' % (options, uri)) + self.body.extend(post) + def depart_image(self, node): + pass + + def visit_figure(self, node): + if (not node.attributes.has_key('align') or + node.attributes['align'] == 'center'): + # centering does not add vertical space like center. + align = '\n\\centering' + align_end = '' + else: + # TODO non vertical space for other alignments. + align = '\\begin{flush%s}' % node.attributes['align'] + align_end = '\\end{flush%s}' % node.attributes['align'] + self.body.append('\\begin{figure}[htbp]%s\n' % align) + self.context.append('%s\\end{figure}\n' % align_end) + def depart_figure(self, node): + self.body.append(self.context.pop()) + + def visit_caption(self, node): + self.body.append('\\caption{') + def depart_caption(self, node): + self.body.append('}') + + def visit_legend(self, node): + self.body.append('{\\small ') + def depart_legend(self, node): + self.body.append('}') + + def visit_admonition(self, node): + self.body.append('\n\\begin{notice}{note}') + def depart_admonition(self, node): + self.body.append('\\end{notice}\n') + + def _make_visit_admonition(name): + def visit_admonition(self, node): + self.body.append('\n\\begin{notice}{%s}{%s:}' % + (name, admonitionlabels[name])) + return visit_admonition + def _depart_named_admonition(self, node): + self.body.append('\\end{notice}\n') + + visit_attention = _make_visit_admonition('attention') + depart_attention = _depart_named_admonition + visit_caution = _make_visit_admonition('caution') + depart_caution = _depart_named_admonition + visit_danger = _make_visit_admonition('danger') + depart_danger = _depart_named_admonition + visit_error = _make_visit_admonition('error') + depart_error = _depart_named_admonition + visit_hint = _make_visit_admonition('hint') + depart_hint = _depart_named_admonition + visit_important = _make_visit_admonition('important') + depart_important = _depart_named_admonition + visit_note = _make_visit_admonition('note') + depart_note = _depart_named_admonition + visit_tip = _make_visit_admonition('tip') + depart_tip = _depart_named_admonition + visit_warning = _make_visit_admonition('warning') + depart_warning = _depart_named_admonition + + def visit_versionmodified(self, node): + intro = versionlabels[node['type']] % node['version'] + if node.children: + intro += ': ' + else: + intro += '.' + self.body.append(intro) + def depart_versionmodified(self, node): + pass + + def visit_target(self, node): + def add_target(id): + # indexing uses standard LaTeX index markup, so the targets + # will be generated differently + if not id.startswith('index-'): + self.body.append(r'\hypertarget{%s}{}' % id) + + if node.has_key('refid') and node['refid'] not in self.written_ids: + parindex = node.parent.index(node) + try: + next = node.parent[parindex+1] + if isinstance(next, nodes.section): + self.next_section_target = node['refid'] + return + except IndexError: + pass + add_target(node['refid']) + self.written_ids.add(node['refid']) + def depart_target(self, node): + pass + + def visit_attribution(self, node): + self.body.append('\n\\begin{flushright}\n') + self.body.append('---') + def depart_attribution(self, node): + self.body.append('\n\\end{flushright}\n') + + def visit_index(self, node, scre=re.compile(r';\s*')): + entries = node['entries'] + for type, string, tid, _ in entries: + if type == 'single': + self.body.append(r'\index{%s}' % scre.sub('!', self.encode(string))) + elif type == 'pair': + parts = tuple(self.encode(x.strip()) for x in string.split(';', 1)) + try: + self.body.append(r'\indexii{%s}{%s}' % parts) + except TypeError: + self.builder.warn('invalid pair index entry %r' % string) + elif type == 'triple': + parts = tuple(self.encode(x.strip()) for x in string.split(';', 2)) + try: + self.body.append(r'\indexiii{%s}{%s}{%s}' % parts) + except TypeError: + self.builder.warn('invalid triple index entry %r' % string) + else: + self.builder.warn('unknown index entry type %s found' % type) + raise nodes.SkipNode + + def visit_raw(self, node): + if 'latex' in node.get('format', '').split(): + self.body.append(node.astext()) + raise nodes.SkipNode + + def visit_reference(self, node): + uri = node.get('refuri', '') + if self.in_title or not uri: + self.context.append('') + elif uri.startswith('mailto:') or uri.startswith('http:') or \ + uri.startswith('https:') or uri.startswith('ftp:'): + self.body.append('\\href{%s}{' % self.encode(uri)) + self.context.append('}') + elif uri.startswith('#'): + self.body.append('\\hyperlink{%s}{' % uri[1:]) + self.context.append('}') + elif uri.startswith('%'): + hashindex = uri.find('#') + targetname = (hashindex == -1) and '--doc-' + uri[1:] or uri[hashindex+1:] + self.body.append('\\hyperlink{%s}{' % targetname) + self.context.append('}') + elif uri.startswith('@token'): + if self.in_production_list: + self.body.append('\\token{') + else: + self.body.append('\\grammartoken{') + self.context.append('}') + else: + self.builder.warn('unusable reference target found: %s' % uri) + self.context.append('') + def depart_reference(self, node): + self.body.append(self.context.pop()) + + def visit_download_reference(self, node): + pass + def depart_download_reference(self, node): + pass + + def visit_pending_xref(self, node): + pass + def depart_pending_xref(self, node): + pass + + def visit_emphasis(self, node): + self.body.append(r'\emph{') + def depart_emphasis(self, node): + self.body.append('}') + + def visit_literal_emphasis(self, node): + self.body.append(r'\emph{\texttt{') + self.no_contractions += 1 + def depart_literal_emphasis(self, node): + self.body.append('}}') + self.no_contractions -= 1 + + def visit_strong(self, node): + self.body.append(r'\textbf{') + def depart_strong(self, node): + self.body.append('}') + + def visit_title_reference(self, node): + self.body.append(r'\emph{') + def depart_title_reference(self, node): + self.body.append('}') + + def visit_citation(self, node): + # TODO maybe use cite bibitems + self.bibitems.append(['', '']) + self.context.append(len(self.body)) + def depart_citation(self, node): + size = self.context.pop() + text = ''.join(self.body[size:]) + del self.body[size:] + self.bibitems[-1][1] = text + + def visit_citation_reference(self, node): + citeid = node.astext() + self.body.append('\\cite{%s}' % citeid) + raise nodes.SkipNode + + def visit_literal(self, node): + content = self.encode(node.astext().strip()) + if self.in_title: + self.body.append(r'\texttt{%s}' % content) + elif node.has_key('role') and node['role'] == 'samp': + self.body.append(r'\samp{%s}' % content) + else: + self.body.append(r'\code{%s}' % content) + raise nodes.SkipNode + + def visit_footnote_reference(self, node): + num = node.astext().strip() + try: + fn = self.footnotestack[-1][num] + except (KeyError, IndexError): + raise nodes.SkipNode + self.body.append('\\footnote{') + fn.walkabout(self) + raise nodes.SkipChildren + def depart_footnote_reference(self, node): + self.body.append('}') + + def visit_literal_block(self, node): + self.verbatim = '' + def depart_literal_block(self, node): + code = self.verbatim.rstrip('\n') + lang = self.highlightlang + linenos = code.count('\n') >= self.highlightlinenothreshold - 1 + if node.has_key('language'): + # code-block directives + lang = node['language'] + if node.has_key('linenos'): + linenos = node['linenos'] + hlcode = self.highlighter.highlight_block(code, lang, linenos) + # workaround for Unicode issue + hlcode = hlcode.replace(u'?', u'@texteuro[]') + # must use original Verbatim environment and "tabular" environment + if self.table: + hlcode = hlcode.replace('\\begin{Verbatim}', + '\\begin{OriginalVerbatim}') + self.table.has_verbatim = True + # get consistent trailer + hlcode = hlcode.rstrip()[:-14] # strip \end{Verbatim} + hlcode = hlcode.rstrip() + '\n' + self.body.append('\n' + hlcode + '\\end{%sVerbatim}\n' % + (self.table and 'Original' or '')) + self.verbatim = None + visit_doctest_block = visit_literal_block + depart_doctest_block = depart_literal_block + + def visit_line_block(self, node): + """line-block: + * whitespace (including linebreaks) is significant + * inline markup is supported. + * serif typeface + """ + self.body.append('{\\raggedright{}') + self.literal_whitespace = 1 + def depart_line_block(self, node): + self.literal_whitespace = 0 + # remove the last \\ + del self.body[-1] + self.body.append('}\n') + + def visit_line(self, node): + self._line_start = len(self.body) + def depart_line(self, node): + if self._line_start == len(self.body): + # no output in this line -- add a nonbreaking space, else the + # \\ command will give an error + self.body.append('~') + if self.table is not None: + self.body.append('\\newline\n') + else: + self.body.append('\\\\\n') + + def visit_block_quote(self, node): + # If the block quote contains a single object and that object + # is a list, then generate a list not a block quote. + # This lets us indent lists. + done = 0 + if len(node.children) == 1: + child = node.children[0] + if isinstance(child, nodes.bullet_list) or \ + isinstance(child, nodes.enumerated_list): + done = 1 + if not done: + self.body.append('\\begin{quote}\n') + def depart_block_quote(self, node): + done = 0 + if len(node.children) == 1: + child = node.children[0] + if isinstance(child, nodes.bullet_list) or \ + isinstance(child, nodes.enumerated_list): + done = 1 + if not done: + self.body.append('\\end{quote}\n') + + # option node handling copied from docutils' latex writer + + def visit_option(self, node): + if self.context[-1]: + # this is not the first option + self.body.append(', ') + def depart_option(self, node): + # flag that the first option is done. + self.context[-1] += 1 + + def visit_option_argument(self, node): + """The delimiter betweeen an option and its argument.""" + self.body.append(node.get('delimiter', ' ')) + def depart_option_argument(self, node): + pass + + def visit_option_group(self, node): + self.body.append('\\item [') + # flag for first option + self.context.append(0) + def depart_option_group(self, node): + self.context.pop() # the flag + self.body.append('] ') + + def visit_option_list(self, node): + self.body.append('\\begin{optionlist}{3cm}\n') + def depart_option_list(self, node): + self.body.append('\\end{optionlist}\n') + + def visit_option_list_item(self, node): + pass + def depart_option_list_item(self, node): + pass + + def visit_option_string(self, node): + ostring = node.astext() + self.body.append(self.encode(ostring.replace('--', u'-{-}'))) + raise nodes.SkipNode + + def visit_description(self, node): + self.body.append( ' ' ) + def depart_description(self, node): + pass + + def visit_superscript(self, node): + self.body.append('$^{\\text{') + def depart_superscript(self, node): + self.body.append('}}$') + + def visit_subscript(self, node): + self.body.append('$_{\\text{') + def depart_subscript(self, node): + self.body.append('}}$') + + def visit_substitution_definition(self, node): + raise nodes.SkipNode + + def visit_substitution_reference(self, node): + raise nodes.SkipNode + + def visit_generated(self, node): + pass + def depart_generated(self, node): + pass + + def visit_compound(self, node): + pass + def depart_compound(self, node): + pass + + def visit_container(self, node): + pass + def depart_container(self, node): + pass + + def visit_decoration(self, node): + pass + def depart_decoration(self, node): + pass + + # text handling + + def encode(self, text): + text = unicode(text).translate(tex_escape_map) + if self.literal_whitespace: + # Insert a blank before the newline, to avoid + # ! LaTeX Error: There's no line here to end. + text = text.replace(u'\n', u'~\\\\\n').replace(u' ', u'~') + if self.no_contractions: + text = text.replace('--', u'-{-}') + return text + + def visit_Text(self, node): + if self.verbatim is not None: + self.verbatim += node.astext() + else: + text = self.encode(node.astext()) + self.body.append(educateQuotesLatex(text)) + def depart_Text(self, node): + pass + + def visit_comment(self, node): + raise nodes.SkipNode + + def visit_meta(self, node): + # only valid for HTML + raise nodes.SkipNode + + def visit_system_message(self, node): + pass + def depart_system_message(self, node): + self.body.append('\n') + + def unknown_visit(self, node): + raise NotImplementedError('Unknown node: ' + node.__class__.__name__) Added: doctools/trunk/sphinx/writers/text.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/writers/text.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,689 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers.text + ~~~~~~~~~~~~~~~~~~~ + + Custom docutils writer for plain text. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import textwrap + +from docutils import nodes, writers + +from sphinx import addnodes +from sphinx.locale import admonitionlabels, versionlabels + + +class TextWriter(writers.Writer): + supported = ('text',) + settings_spec = ('No options here.', '', ()) + settings_defaults = {} + + output = None + + def __init__(self, builder): + writers.Writer.__init__(self) + self.builder = builder + + def translate(self): + visitor = TextTranslator(self.document, self.builder) + self.document.walkabout(visitor) + self.output = visitor.body + +# monkey-patch... +new_wordsep_re = re.compile( + r'(\s+|' # any whitespace + r'(?<=\s)(?::[a-z-]+:)?`\S+|' # interpreted text start + r'[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|' # hyphenated words + r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash +textwrap.TextWrapper.wordsep_re = new_wordsep_re + +MAXWIDTH = 70 +STDINDENT = 3 + + +class TextTranslator(nodes.NodeVisitor): + sectionchars = '*=-~"+' + + def __init__(self, document, builder): + nodes.NodeVisitor.__init__(self, document) + + self.states = [[]] + self.stateindent = [0] + self.sectionlevel = 0 + self.table = None + + def add_text(self, text): + self.states[-1].append((-1, text)) + def new_state(self, indent=STDINDENT): + self.states.append([]) + self.stateindent.append(indent) + def end_state(self, wrap=True, end=[''], first=None): + content = self.states.pop() + maxindent = sum(self.stateindent) + indent = self.stateindent.pop() + result = [] + toformat = [] + def do_format(): + if not toformat: + return + if wrap: + res = textwrap.wrap(''.join(toformat), width=MAXWIDTH-maxindent) + else: + res = ''.join(toformat).splitlines() + if end: + res += end + result.append((indent, res)) + for itemindent, item in content: + if itemindent == -1: + toformat.append(item) + else: + do_format() + result.append((indent + itemindent, item)) + toformat = [] + do_format() + if first is not None and result: + itemindent, item = result[0] + if item: + result.insert(0, (itemindent - indent, [first + item[0]])) + result[1] = (itemindent, item[1:]) + self.states[-1].extend(result) + + def visit_document(self, node): + self.new_state(0) + def depart_document(self, node): + self.end_state() + self.body = '\n'.join(line and (' '*indent + line) + for indent, lines in self.states[0] + for line in lines) + # XXX header/footer? + + def visit_highlightlang(self, node): + raise nodes.SkipNode + + def visit_section(self, node): + self._title_char = self.sectionchars[self.sectionlevel] + self.sectionlevel += 1 + def depart_section(self, node): + self.sectionlevel -= 1 + + def visit_topic(self, node): + self.new_state(0) + def depart_topic(self, node): + self.end_state() + + visit_sidebar = visit_topic + depart_sidebar = depart_topic + + def visit_rubric(self, node): + self.new_state(0) + self.add_text('-[ ') + def depart_rubric(self, node): + self.add_text(' ]-') + self.end_state() + + def visit_compound(self, node): + pass + def depart_compound(self, node): + pass + + def visit_glossary(self, node): + pass + def depart_glossary(self, node): + pass + + def visit_title(self, node): + if isinstance(node.parent, nodes.Admonition): + self.add_text(node.astext()+': ') + raise nodes.SkipNode + self.new_state(0) + def depart_title(self, node): + if isinstance(node.parent, nodes.section): + char = self._title_char + else: + char = '^' + text = ''.join(x[1] for x in self.states.pop() if x[0] == -1) + self.stateindent.pop() + self.states[-1].append((0, ['', text, '%s' % (char * len(text)), ''])) + + def visit_subtitle(self, node): + pass + def depart_subtitle(self, node): + pass + + def visit_attribution(self, node): + self.add_text('-- ') + def depart_attribution(self, node): + pass + + def visit_module(self, node): + if node.has_key('platform'): + self.new_state(0) + self.add_text(_('Platform: %s') % node['platform']) + self.end_state() + raise nodes.SkipNode + + def visit_desc(self, node): + pass + def depart_desc(self, node): + pass + + def visit_desc_signature(self, node): + self.new_state(0) + if node.parent['desctype'] in ('class', 'exception'): + self.add_text('%s ' % node.parent['desctype']) + def depart_desc_signature(self, node): + # XXX: wrap signatures in a way that makes sense + self.end_state(wrap=False, end=None) + + def visit_desc_name(self, node): + pass + def depart_desc_name(self, node): + pass + + def visit_desc_addname(self, node): + pass + def depart_desc_addname(self, node): + pass + + def visit_desc_type(self, node): + pass + def depart_desc_type(self, node): + pass + + def visit_desc_returns(self, node): + self.add_text(' -> ') + def depart_desc_returns(self, node): + pass + + def visit_desc_parameterlist(self, node): + self.add_text('(') + self.first_param = 1 + def depart_desc_parameterlist(self, node): + self.add_text(')') + + def visit_desc_parameter(self, node): + if not self.first_param: + self.add_text(', ') + else: + self.first_param = 0 + self.add_text(node.astext()) + raise nodes.SkipNode + + def visit_desc_optional(self, node): + self.add_text('[') + def depart_desc_optional(self, node): + self.add_text(']') + + def visit_desc_annotation(self, node): + pass + def depart_desc_annotation(self, node): + pass + + def visit_refcount(self, node): + pass + def depart_refcount(self, node): + pass + + def visit_desc_content(self, node): + self.new_state() + self.add_text('\n') + def depart_desc_content(self, node): + self.end_state() + + def visit_figure(self, node): + self.new_state() + def depart_figure(self, node): + self.end_state() + + def visit_caption(self, node): + pass + def depart_caption(self, node): + pass + + def visit_productionlist(self, node): + self.new_state() + names = [] + for production in node: + names.append(production['tokenname']) + maxlen = max(len(name) for name in names) + for production in node: + if production['tokenname']: + self.add_text(production['tokenname'].ljust(maxlen) + ' ::=') + lastname = production['tokenname'] + else: + self.add_text('%s ' % (' '*len(lastname))) + self.add_text(production.astext() + '\n') + self.end_state(wrap=False) + raise nodes.SkipNode + + def visit_seealso(self, node): + self.new_state() + def depart_seealso(self, node): + self.end_state(first='') + + def visit_footnote(self, node): + self._footnote = node.children[0].astext().strip() + self.new_state(len(self._footnote) + 3) + def depart_footnote(self, node): + self.end_state(first='[%s] ' % self._footnote) + + def visit_citation(self, node): + if len(node) and isinstance(node[0], nodes.label): + self._citlabel = node[0].astext() + else: + self._citlabel = '' + self.new_state(len(self._citlabel) + 3) + def depart_citation(self, node): + self.end_state(first='[%s] ' % self._citlabel) + + def visit_label(self, node): + raise nodes.SkipNode + + # XXX: option list could use some better styling + + def visit_option_list(self, node): + pass + def depart_option_list(self, node): + pass + + def visit_option_list_item(self, node): + self.new_state(0) + def depart_option_list_item(self, node): + self.end_state() + + def visit_option_group(self, node): + self._firstoption = True + def depart_option_group(self, node): + self.add_text(' ') + + def visit_option(self, node): + if self._firstoption: + self._firstoption = False + else: + self.add_text(', ') + def depart_option(self, node): + pass + + def visit_option_string(self, node): + pass + def depart_option_string(self, node): + pass + + def visit_option_argument(self, node): + self.add_text(node['delimiter']) + def depart_option_argument(self, node): + pass + + def visit_description(self, node): + pass + def depart_description(self, node): + pass + + def visit_tabular_col_spec(self, node): + raise nodes.SkipNode + + def visit_colspec(self, node): + self.table[0].append(node['colwidth']) + raise nodes.SkipNode + + def visit_tgroup(self, node): + pass + def depart_tgroup(self, node): + pass + + def visit_thead(self, node): + pass + def depart_thead(self, node): + pass + + def visit_tbody(self, node): + self.table.append('sep') + def depart_tbody(self, node): + pass + + def visit_row(self, node): + self.table.append([]) + def depart_row(self, node): + pass + + def visit_entry(self, node): + if node.has_key('morerows') or node.has_key('morecols'): + raise NotImplementedError('Column or row spanning cells are ' + 'not implemented.') + self.new_state(0) + def depart_entry(self, node): + text = '\n'.join('\n'.join(x[1]) for x in self.states.pop()) + self.stateindent.pop() + self.table[-1].append(text) + + def visit_table(self, node): + if self.table: + raise NotImplementedError('Nested tables are not supported.') + self.new_state(0) + self.table = [[]] + def depart_table(self, node): + lines = self.table[1:] + fmted_rows = [] + colwidths = self.table[0] + realwidths = colwidths[:] + separator = 0 + # don't allow paragraphs in table cells for now + for line in lines: + if line == 'sep': + separator = len(fmted_rows) + else: + cells = [] + for i, cell in enumerate(line): + par = textwrap.wrap(cell, width=colwidths[i]) + if par: + maxwidth = max(map(len, par)) + else: + maxwidth = 0 + realwidths[i] = max(realwidths[i], maxwidth) + cells.append(par) + fmted_rows.append(cells) + + def writesep(char='-'): + out = ['+'] + for width in realwidths: + out.append(char * (width+2)) + out.append('+') + self.add_text(''.join(out) + '\n') + + def writerow(row): + lines = map(None, *row) + for line in lines: + out = ['|'] + for i, cell in enumerate(line): + if cell: + out.append(' ' + cell.ljust(realwidths[i]+1)) + else: + out.append(' ' * (realwidths[i] + 2)) + out.append('|') + self.add_text(''.join(out) + '\n') + + for i, row in enumerate(fmted_rows): + if separator and i == separator: + writesep('=') + else: + writesep('-') + writerow(row) + writesep('-') + self.table = None + self.end_state(wrap=False) + + def visit_acks(self, node): + self.new_state(0) + self.add_text(', '.join(n.astext() for n in node.children[0].children) + '.') + self.end_state() + raise nodes.SkipNode + + def visit_image(self, node): + self.add_text(_('[image]')) + raise nodes.SkipNode + + def visit_transition(self, node): + indent = sum(self.stateindent) + self.new_state(0) + self.add_text('=' * (MAXWIDTH - indent)) + self.end_state() + raise nodes.SkipNode + + def visit_bullet_list(self, node): + self._list_counter = -1 + def depart_bullet_list(self, node): + pass + + def visit_enumerated_list(self, node): + self._list_counter = 0 + def depart_enumerated_list(self, node): + pass + + def visit_definition_list(self, node): + self._list_counter = -2 + def depart_definition_list(self, node): + pass + + def visit_list_item(self, node): + if self._list_counter == -1: + # bullet list + self.new_state(2) + elif self._list_counter == -2: + # definition list + pass + else: + # enumerated list + self._list_counter += 1 + self.new_state(len(str(self._list_counter)) + 2) + def depart_list_item(self, node): + if self._list_counter == -1: + self.end_state(first='* ', end=None) + elif self._list_counter == -2: + pass + else: + self.end_state(first='%s. ' % self._list_counter, end=None) + + def visit_definition_list_item(self, node): + self._li_has_classifier = len(node) >= 2 and \ + isinstance(node[1], nodes.classifier) + def depart_definition_list_item(self, node): + pass + + def visit_term(self, node): + self.new_state(0) + def depart_term(self, node): + if not self._li_has_classifier: + self.end_state(end=None) + + def visit_classifier(self, node): + self.add_text(' : ') + def depart_classifier(self, node): + self.end_state(end=None) + + def visit_definition(self, node): + self.new_state() + def depart_definition(self, node): + self.end_state() + + def visit_field_list(self, node): + pass + def depart_field_list(self, node): + pass + + def visit_field(self, node): + pass + def depart_field(self, node): + pass + + def visit_field_name(self, node): + self.new_state(0) + def depart_field_name(self, node): + self.add_text(':') + self.end_state(end=None) + + def visit_field_body(self, node): + self.new_state() + def depart_field_body(self, node): + self.end_state() + + def visit_centered(self, node): + pass + def depart_centered(self, node): + pass + + def visit_admonition(self, node): + self.new_state(0) + def depart_admonition(self, node): + self.end_state() + + def _visit_admonition(self, node): + self.new_state(2) + def _make_depart_admonition(name): + def depart_admonition(self, node): + self.end_state(first=admonitionlabels[name] + ': ') + return depart_admonition + + visit_attention = _visit_admonition + depart_attention = _make_depart_admonition('attention') + visit_caution = _visit_admonition + depart_caution = _make_depart_admonition('caution') + visit_danger = _visit_admonition + depart_danger = _make_depart_admonition('danger') + visit_error = _visit_admonition + depart_error = _make_depart_admonition('error') + visit_hint = _visit_admonition + depart_hint = _make_depart_admonition('hint') + visit_important = _visit_admonition + depart_important = _make_depart_admonition('important') + visit_note = _visit_admonition + depart_note = _make_depart_admonition('note') + visit_tip = _visit_admonition + depart_tip = _make_depart_admonition('tip') + visit_warning = _visit_admonition + depart_warning = _make_depart_admonition('warning') + + def visit_versionmodified(self, node): + self.new_state(0) + if node.children: + self.add_text(versionlabels[node['type']] % node['version'] + ': ') + else: + self.add_text(versionlabels[node['type']] % node['version'] + '.') + def depart_versionmodified(self, node): + self.end_state() + + def visit_literal_block(self, node): + self.new_state() + def depart_literal_block(self, node): + self.end_state(wrap=False) + + def visit_doctest_block(self, node): + self.new_state(0) + def depart_doctest_block(self, node): + self.end_state(wrap=False) + + def visit_line_block(self, node): + self.new_state(0) + def depart_line_block(self, node): + self.end_state(wrap=False) + + def visit_line(self, node): + pass + def depart_line(self, node): + pass + + def visit_block_quote(self, node): + self.new_state() + def depart_block_quote(self, node): + self.end_state() + + def visit_compact_paragraph(self, node): + pass + def depart_compact_paragraph(self, node): + pass + + def visit_paragraph(self, node): + if not isinstance(node.parent, nodes.Admonition) or \ + isinstance(node.parent, addnodes.seealso): + self.new_state(0) + def depart_paragraph(self, node): + if not isinstance(node.parent, nodes.Admonition) or \ + isinstance(node.parent, addnodes.seealso): + self.end_state() + + def visit_target(self, node): + raise nodes.SkipNode + + def visit_index(self, node): + raise nodes.SkipNode + + def visit_substitution_definition(self, node): + raise nodes.SkipNode + + def visit_pending_xref(self, node): + pass + def depart_pending_xref(self, node): + pass + + def visit_reference(self, node): + pass + def depart_reference(self, node): + pass + + def visit_download_reference(self, node): + pass + def depart_download_reference(self, node): + pass + + def visit_emphasis(self, node): + self.add_text('*') + def depart_emphasis(self, node): + self.add_text('*') + + def visit_literal_emphasis(self, node): + self.add_text('*') + def depart_literal_emphasis(self, node): + self.add_text('*') + + def visit_strong(self, node): + self.add_text('**') + def depart_strong(self, node): + self.add_text('**') + + def visit_title_reference(self, node): + self.add_text('*') + def depart_title_reference(self, node): + self.add_text('*') + + def visit_literal(self, node): + self.add_text('``') + def depart_literal(self, node): + self.add_text('``') + + def visit_subscript(self, node): + self.add_text('_') + def depart_subscript(self, node): + pass + + def visit_superscript(self, node): + self.add_text('^') + def depart_superscript(self, node): + pass + + def visit_footnote_reference(self, node): + self.add_text('[%s]' % node.astext()) + raise nodes.SkipNode + + def visit_citation_reference(self, node): + self.add_text('[%s]' % node.astext()) + raise nodes.SkipNode + + def visit_Text(self, node): + self.add_text(node.astext()) + def depart_Text(self, node): + pass + + def visit_problematic(self, node): + self.add_text('>>') + def depart_problematic(self, node): + self.add_text('<<') + + def visit_system_message(self, node): + self.new_state(0) + self.add_text('' % node.astext()) + self.end_state() + raise nodes.SkipNode + + def visit_comment(self, node): + raise nodes.SkipNode + + def visit_meta(self, node): + # only valid for HTML + raise nodes.SkipNode + + def unknown_visit(self, node): + raise NotImplementedError('Unknown node: ' + node.__class__.__name__) Added: doctools/trunk/tests/root/_static/README ============================================================================== --- (empty file) +++ doctools/trunk/tests/root/_static/README Sun Jan 4 21:38:57 2009 @@ -0,0 +1 @@ +This placeholder file is there because Mercurial ignores empty directories. Added: doctools/trunk/tests/root/_templates/layout.html ============================================================================== --- (empty file) +++ doctools/trunk/tests/root/_templates/layout.html Sun Jan 4 21:38:57 2009 @@ -0,0 +1,4 @@ +{% extends "!layout.html" %} +{% block extrahead %} + +{% endblock %} Modified: doctools/trunk/tests/root/conf.py ============================================================================== --- doctools/trunk/tests/root/conf.py (original) +++ doctools/trunk/tests/root/conf.py Sun Jan 4 21:38:57 2009 @@ -23,7 +23,8 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['ext', 'sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.coverage'] +extensions = ['ext', 'sphinx.ext.autodoc', 'sphinx.ext.jsmath', + 'sphinx.ext.coverage', 'sphinx.ext.todo'] jsmath_path = 'dummy.js' # Add any paths that contain templates here, relative to this directory. @@ -36,8 +37,8 @@ master_doc = 'contents' # General substitutions. -project = 'Sphinx Tests' -copyright = '2008, Georg Brandl' +project = 'Sphinx ' +copyright = '2008, Georg Brandl & Team' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -133,6 +134,8 @@ # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' +html_context = {'hckey': 'hcval'} + # Output file base name for HTML help builder. htmlhelp_basename = 'SphinxTestsdoc' Modified: doctools/trunk/tests/root/contents.txt ============================================================================== --- doctools/trunk/tests/root/contents.txt (original) +++ doctools/trunk/tests/root/contents.txt Sun Jan 4 21:38:57 2009 @@ -11,6 +11,7 @@ :maxdepth: 2 images + subdir/images includes markup desc Added: doctools/trunk/tests/root/ext.pyc ============================================================================== Binary file. No diff available. Modified: doctools/trunk/tests/root/images.txt ============================================================================== --- doctools/trunk/tests/root/images.txt (original) +++ doctools/trunk/tests/root/images.txt Sun Jan 4 21:38:57 2009 @@ -9,6 +9,8 @@ .. an image with path name (relative to this directory!) .. image:: subdir/img.png + :height: 100 + :width: 200 .. an image with unspecified extension .. image:: img.* @@ -18,3 +20,6 @@ .. a non-local image URI .. image:: http://www.python.org/logo.png + +.. an image with subdir and unspecified extension +.. image:: subdir/simg.* Modified: doctools/trunk/tests/root/includes.txt ============================================================================== --- doctools/trunk/tests/root/includes.txt (original) +++ doctools/trunk/tests/root/includes.txt Sun Jan 4 21:38:57 2009 @@ -14,3 +14,33 @@ :encoding: latin-1 .. include:: wrongenc.inc :encoding: latin-1 + +Literalinclude options +====================== + +.. highlight:: text + +.. cssclass:: inc-pyobj1 +.. literalinclude:: literal.inc + :pyobject: Foo + +.. cssclass:: inc-pyobj2 +.. literalinclude:: literal.inc + :pyobject: Bar.baz + +.. cssclass:: inc-lines +.. literalinclude:: literal.inc + :lines: 6-7,9 + +.. cssclass:: inc-startend +.. literalinclude:: literal.inc + :start-after: coding: utf-8 + :end-before: class Foo + + +Testing downloadable files +========================== + +Download :download:`img.png` here. +Download :download:`this ` there. +Don't download :download:`this `. Modified: doctools/trunk/tests/root/literal.inc ============================================================================== --- doctools/trunk/tests/root/literal.inc (original) +++ doctools/trunk/tests/root/literal.inc Sun Jan 4 21:38:57 2009 @@ -2,3 +2,12 @@ # -*- coding: utf-8 -*- foo = u"Including Unicode characters: ???" + +class Foo: + pass + +class Bar: + def baz(): + pass + +def bar(): pass Modified: doctools/trunk/tests/root/markup.txt ============================================================================== --- doctools/trunk/tests/root/markup.txt (original) +++ doctools/trunk/tests/root/markup.txt Sun Jan 4 21:38:57 2009 @@ -99,7 +99,7 @@ Reference lookup: [Ref1]_ (defined in another file). -.. seealso:: +.. seealso:: something, something else, something more `Google `_ For everything. @@ -110,6 +110,11 @@ This tests :CLASS:`role names in uppercase`. +Option list: + +-h help +--help also help + .. centered:: LICENSE AGREEMENT .. acks:: @@ -143,6 +148,14 @@ single: entry pair: entry; pair triple: index; entry; triple + keyword: with + +Invalid index markup... + +.. index:: + single: + pair: + keyword: ?... Some strange characters Added: doctools/trunk/tests/root/subdir/images.txt ============================================================================== --- (empty file) +++ doctools/trunk/tests/root/subdir/images.txt Sun Jan 4 21:38:57 2009 @@ -0,0 +1,4 @@ +Image including source in subdir +================================ + +.. image:: img.* Added: doctools/trunk/tests/root/subdir/simg.png ============================================================================== Binary file. No diff available. Modified: doctools/trunk/tests/run.py ============================================================================== --- doctools/trunk/tests/run.py (original) +++ doctools/trunk/tests/run.py Sun Jan 4 21:38:57 2009 @@ -6,8 +6,8 @@ This script runs the Sphinx unit test suite. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys Modified: doctools/trunk/tests/test_application.py ============================================================================== --- doctools/trunk/tests/test_application.py (original) +++ doctools/trunk/tests/test_application.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Test the Sphinx class. - :copyright: 2008 by Benjamin Peterson. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from StringIO import StringIO Modified: doctools/trunk/tests/test_autodoc.py ============================================================================== --- doctools/trunk/tests/test_autodoc.py (original) +++ doctools/trunk/tests/test_autodoc.py Sun Jan 4 21:38:57 2009 @@ -6,8 +6,8 @@ Test the autodoc extension. This tests mainly the RstGenerator; the auto directives are tested in a test source file translated by test_build. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from util import * @@ -24,6 +24,7 @@ app.builder.env.app = app app.connect('autodoc-process-docstring', process_docstring) app.connect('autodoc-process-signature', process_signature) + app.connect('autodoc-skip-member', skip_member) options = Struct( inherited_members = False, @@ -71,44 +72,51 @@ return '42', None +def skip_member(app, what, name, obj, skip, options): + if name.startswith('_'): + return True + if name == 'skipmeth': + return True + + def test_resolve_name(): # for modules assert gen.resolve_name('module', 'test_autodoc') == \ - ('test_autodoc', 'test_autodoc', [], None, None) + ('test_autodoc', [], None, None) assert gen.resolve_name('module', 'test.test_autodoc') == \ - ('test.test_autodoc', 'test.test_autodoc', [], None, None) + ('test.test_autodoc', [], None, None) assert gen.resolve_name('module', 'test(arg)') == \ - ('test', 'test', [], None, None) + ('test', [], None, None) assert 'ignoring signature arguments' in gen.warnings[0] del gen.warnings[:] # for functions/classes assert gen.resolve_name('function', 'util.raises') == \ - ('util.raises', 'util', ['raises'], None, None) + ('util', ['raises'], None, None) assert gen.resolve_name('function', 'util.raises(exc) -> None') == \ - ('util.raises', 'util', ['raises'], 'exc', ' -> None') + ('util', ['raises'], 'exc', 'None') gen.env.autodoc_current_module = 'util' assert gen.resolve_name('function', 'raises') == \ - ('raises', 'util', ['raises'], None, None) + ('util', ['raises'], None, None) gen.env.autodoc_current_module = None gen.env.currmodule = 'util' assert gen.resolve_name('function', 'raises') == \ - ('raises', 'util', ['raises'], None, None) + ('util', ['raises'], None, None) assert gen.resolve_name('class', 'TestApp') == \ - ('TestApp', 'util', ['TestApp'], None, None) + ('util', ['TestApp'], None, None) # for members gen.env.currmodule = 'foo' assert gen.resolve_name('method', 'util.TestApp.cleanup') == \ - ('util.TestApp.cleanup', 'util', ['TestApp', 'cleanup'], None, None) + ('util', ['TestApp', 'cleanup'], None, None) gen.env.currmodule = 'util' gen.env.currclass = 'Foo' gen.env.autodoc_current_class = 'TestApp' assert gen.resolve_name('method', 'cleanup') == \ - ('cleanup', 'util', ['TestApp', 'cleanup'], None, None) + ('util', ['TestApp', 'cleanup'], None, None) assert gen.resolve_name('method', 'TestApp.cleanup') == \ - ('TestApp.cleanup', 'util', ['TestApp', 'cleanup'], None, None) + ('util', ['TestApp', 'cleanup'], None, None) # and clean up gen.env.currmodule = None @@ -126,7 +134,7 @@ assert gen.format_signature('function', 'f', f, None, None) == '(a, b, c=1, **d)' assert gen.format_signature('function', 'f', f, 'a, b, c, d', None) == \ '(a, b, c, d)' - assert gen.format_signature('function', 'f', f, None, ' -> None') == \ + assert gen.format_signature('function', 'f', f, None, 'None') == \ '(a, b, c=1, **d) -> None' # test for classes @@ -144,7 +152,7 @@ pass for C in (F, G): assert gen.format_signature('class', 'C', C, None, None) == '(a, b=None)' - assert gen.format_signature('class', 'C', D, 'a, b', ' -> X') == '(a, b) -> X' + assert gen.format_signature('class', 'C', D, 'a, b', 'X') == '(a, b) -> X' # test for methods class H: @@ -165,13 +173,14 @@ def test_get_doc(): def getdocl(*args): - # strip the empty line at the end - return list(gen.get_doc(*args))[:-1] + ds = gen.get_doc(*args) + # for testing purposes, concat them and strip the empty line at the end + return sum(ds, [])[:-1] # objects without docstring def f(): pass - assert getdocl('function', 'f', f) == [] + assert getdocl('function', f) == [] # standard function, diverse docstring styles... def f(): @@ -181,7 +190,7 @@ Docstring """ for func in (f, g): - assert getdocl('function', 'f', func) == ['Docstring'] + assert getdocl('function', func) == ['Docstring'] # first line vs. other lines indentation def f(): @@ -190,17 +199,17 @@ Other lines """ - assert getdocl('function', 'f', f) == ['First line', '', 'Other', ' lines'] + assert getdocl('function', f) == ['First line', '', 'Other', ' lines'] # charset guessing (this module is encoded in utf-8) def f(): """D?cstring""" - assert getdocl('function', 'f', f) == [u'D?cstring'] + assert getdocl('function', f) == [u'D?cstring'] # already-unicode docstrings must be taken literally def f(): u"""D?cstring""" - assert getdocl('function', 'f', f) == [u'D?cstring'] + assert getdocl('function', f) == [u'D?cstring'] # class docstring: depends on config value which one is taken class C: @@ -208,21 +217,37 @@ def __init__(self): """Init docstring""" gen.env.config.autoclass_content = 'class' - assert getdocl('class', 'C', C) == ['Class docstring'] + assert getdocl('class', C) == ['Class docstring'] gen.env.config.autoclass_content = 'init' - assert getdocl('class', 'C', C) == ['Init docstring'] + assert getdocl('class', C) == ['Init docstring'] gen.env.config.autoclass_content = 'both' - assert getdocl('class', 'C', C) == ['Class docstring', '', 'Init docstring'] + assert getdocl('class', C) == ['Class docstring', '', 'Init docstring'] class D: + """Class docstring""" + def __init__(self): + """Init docstring + + Other + lines + """ + + # Indentation is normalized for 'both' + assert getdocl('class', D) == ['Class docstring', '', 'Init docstring', + '', 'Other', ' lines'] + + +def test_docstring_processing(): + def process(what, name, obj): + return list(gen.process_doc(gen.get_doc(what, obj), what, name, obj)) + + class E: def __init__(self): """Init docstring""" # docstring processing by event handler - assert getdocl('class', 'bar', D) == ['Init docstring', '', '42'] + assert process('class', 'bar', E) == ['Init docstring', '', '42', ''] - -def test_docstring_processing_functions(): lid = app.connect('autodoc-process-docstring', cut_lines(1, 1, ['function'])) def f(): """ @@ -230,7 +255,7 @@ second line third line """ - assert list(gen.get_doc('function', 'f', f)) == ['second line', ''] + assert process('function', 'f', f) == ['second line', ''] app.disconnect(lid) lid = app.connect('autodoc-process-docstring', between('---', ['function'])) @@ -242,7 +267,7 @@ --- third line """ - assert list(gen.get_doc('function', 'f', f)) == ['second line', ''] + assert process('function', 'f', f) == ['second line', ''] app.disconnect(lid) @@ -268,7 +293,7 @@ def assert_result_contains(item, *args): gen.generate(*args) - print '\n'.join(gen.result) + #print '\n'.join(gen.result) assert len(gen.warnings) == 0, gen.warnings assert item in gen.result del gen.result[:] @@ -300,17 +325,20 @@ assert_works('exception', 'test_autodoc.CustomEx', [], None) # test diverse inclusion settings for members - should = [('class', 'Class')] + should = [('class', 'test_autodoc.Class')] assert_processes(should, 'class', 'Class', [], None) - should.extend([('method', 'Class.meth')]) + should.extend([('method', 'test_autodoc.Class.meth')]) assert_processes(should, 'class', 'Class', ['meth'], None) - should.extend([('attribute', 'Class.prop')]) + should.extend([('attribute', 'test_autodoc.Class.prop'), + ('attribute', 'test_autodoc.Class.attr'), + ('attribute', 'test_autodoc.Class.docattr'), + ('attribute', 'test_autodoc.Class.udocattr')]) assert_processes(should, 'class', 'Class', ['__all__'], None) options.undoc_members = True - should.append(('method', 'Class.undocmeth')) + should.append(('method', 'test_autodoc.Class.undocmeth')) assert_processes(should, 'class', 'Class', ['__all__'], None) options.inherited_members = True - should.append(('method', 'Class.inheritedmeth')) + should.append(('method', 'test_autodoc.Class.inheritedmeth')) assert_processes(should, 'class', 'Class', ['__all__'], None) # test module flags @@ -342,6 +370,17 @@ assert_result_contains('.. class:: CustomDict', 'class', 'CustomDict', ['__all__'], None) + # test inner class handling + assert_processes([('class', 'test_autodoc.Outer'), + ('class', 'test_autodoc.Outer.Inner'), + ('method', 'test_autodoc.Outer.Inner.meth')], + 'class', 'Outer', ['__all__'], None) + + # test generation for C modules (which have no source file) + gen.env.currmodule = 'time' + assert_processes([('function', 'time.asctime')], 'function', 'asctime', [], None) + assert_processes([('function', 'time.asctime')], 'function', 'asctime', [], None) + # --- generate fodder ------------ @@ -367,10 +406,26 @@ def undocmeth(self): pass + def skipmeth(self): + """Method that should be skipped.""" + pass + + # should not be documented + skipattr = 'foo' + + #: should be documented -- s?? + attr = 'bar' + @property def prop(self): """Property.""" + docattr = 'baz' + """should likewise be documented -- s??""" + + udocattr = 'quux' + u"""should be documented as well - s??""" + class CustomDict(dict): """Docstring.""" @@ -379,3 +434,16 @@ Return spam. """ pass + + +class Outer(object): + """Foo""" + + class Inner(object): + """Foo""" + + def meth(self): + """Foo""" + + # should be documented as an alias + factory = dict Modified: doctools/trunk/tests/test_build.py ============================================================================== --- doctools/trunk/tests/test_build.py (original) +++ doctools/trunk/tests/test_build.py Sun Jan 4 21:38:57 2009 @@ -5,11 +5,13 @@ Test the entire build process with the test root. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import os +import re +import sys import difflib import htmlentitydefs from StringIO import StringIO @@ -18,8 +20,9 @@ from util import * from etree13 import ElementTree as ET -from sphinx.builder import StandaloneHTMLBuilder, LaTeXBuilder -from sphinx.latexwriter import LaTeXTranslator +from sphinx.builders.html import StandaloneHTMLBuilder +from sphinx.builders.latex import LaTeXBuilder +from sphinx.writers.latex import LaTeXTranslator html_warnfile = StringIO() @@ -27,38 +30,58 @@ ENV_WARNINGS = """\ WARNING: %(root)s/images.txt:9: Image file not readable: foo.png -WARNING: %(root)s/images.txt:20: Nonlocal image URI found: http://www.python.org/logo.png +WARNING: %(root)s/images.txt:23: Nonlocal image URI found: http://www.python.org/logo.png WARNING: %(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8' used for reading included \ file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option +WARNING: %(root)s/includes.txt:56: Download file not readable: nonexisting.png """ HTML_WARNINGS = ENV_WARNINGS + """\ WARNING: %(root)s/images.txt:: no matching candidate for image URI u'foo.*' +WARNING: %(root)s/markup.txt:: invalid index entry u'' +WARNING: %(root)s/markup.txt:: invalid pair index entry u'' +WARNING: %(root)s/markup.txt:: invalid pair index entry u'keyword; ' """ LATEX_WARNINGS = ENV_WARNINGS + """\ WARNING: None:: no matching candidate for image URI u'foo.*' +WARNING: invalid pair index entry u'' """ HTML_XPATH = { 'images.html': { ".//img[@src='_images/img.png']": '', ".//img[@src='_images/img1.png']": '', + ".//img[@src='_images/simg.png']": '', + }, + 'subdir/images.html': { + ".//img[@src='../_images/img1.png']": '', }, 'includes.html': { ".//pre/span[@class='s']": u'???', ".//pre": u'Max Strau?', + ".//a[@href='_downloads/img.png']": '', + ".//a[@href='_downloads/img1.png']": '', + ".//div[@class='inc-pyobj1 highlight-text']/div/pre": + r'^class Foo:\n pass\n\s*$', + ".//div[@class='inc-pyobj2 highlight-text']/div/pre": + r'^ def baz\(\):\n pass\n\s*$', + ".//div[@class='inc-lines highlight-text']/div/pre": + r'^class Foo:\n pass\nclass Bar:\n$', + ".//div[@class='inc-startend highlight-text']/div/pre": + ur'^foo = u"Including Unicode characters: ???"\n$', }, 'autodoc.html': { ".//dt[@id='test_autodoc.Class']": '', - ".//dt[@id='test_autodoc.function']/em": '**kwds', - ".//dd": 'Return spam.', + ".//dt[@id='test_autodoc.function']/em": r'\*\*kwds', + ".//dd": r'Return spam\.', }, 'markup.html': { ".//meta[@name='author'][@content='Me']": '', ".//meta[@name='keywords'][@content='docs, sphinx']": '', ".//a[@href='contents.html#ref1']": '', ".//div[@id='label']": '', + ".//span[@class='option']": '--help', }, 'desc.html': { ".//dt[@id='mod.Cls.meth1']": '', @@ -66,7 +89,12 @@ ".//a[@href='#mod.Cls']": '', }, 'contents.html': { - ".//td[@class='label']": '[Ref1]', + ".//meta[@name='hc'][@content='hcval']": '', + ".//td[@class='label']": r'\[Ref1\]', + ".//li[@class='toctree-l1']/a": 'Testing various markup', + ".//li[@class='toctree-l2']/a": 'Admonitions', + ".//title": 'Sphinx ', + ".//div[@class='footer']": 'Georg Brandl & Team', }, } @@ -98,18 +126,23 @@ parser = NslessParser() parser.entity.update(htmlentitydefs.entitydefs) etree = ET.parse(os.path.join(app.outdir, fname), parser) - for path, text in paths.iteritems(): + for path, check in paths.iteritems(): nodes = list(etree.findall(path)) assert nodes != [] - if not text: + if callable(check): + check(nodes) + elif not check: # only check for node presence continue - for node in nodes: - if node.text and text in node.text: - break else: - assert False, ('%r not found in any node matching ' - 'path %s in %s' % (text, path, fname)) + rex = re.compile(check) + for node in nodes: + if node.text and rex.search(node.text): + break + else: + assert False, ('%r not found in any node matching ' + 'path %s in %s: %r' % (check, path, fname, + [node.text for node in nodes])) @with_app(buildername='latex', warning=latex_warnfile) @@ -122,6 +155,32 @@ '\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(), latex_warnings.splitlines())) + # only run latex if all needed packages are there + def kpsetest(filename): + try: + p = Popen(['kpsewhich', filename], stdout=PIPE) + except OSError, err: + # no kpsewhich... either no tex distribution is installed or it is + # a "strange" one -- don't bother running latex + return None + else: + p.communicate() + if p.returncode != 0: + # not found + return False + # found + return True + + if kpsetest('article.sty') is None: + print >>sys.stderr, 'info: not running latex, it doesn\'t seem to be installed' + return + for filename in ['fancyhdr.sty', 'fancybox.sty', 'titlesec.sty', 'amsmath.sty', + 'framed.sty', 'color.sty', 'fancyvrb.sty', 'threeparttable.sty']: + if not kpsetest(filename): + print >>sys.stderr, 'info: not running latex, the %s package doesn\'t ' \ + 'seem to be installed' % filename + return + # now, try to run latex over it cwd = os.getcwd() os.chdir(app.outdir) Modified: doctools/trunk/tests/test_config.py ============================================================================== --- doctools/trunk/tests/test_config.py (original) +++ doctools/trunk/tests/test_config.py Sun Jan 4 21:38:57 2009 @@ -6,8 +6,8 @@ Test the sphinx.config.Config class and its handling in the Application class. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from util import * @@ -15,17 +15,19 @@ from sphinx.application import ExtensionError - at with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True'}) + at with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True', + 'latex_elements.docclass': 'scrartcl'}) def test_core_config(app): cfg = app.config # simple values assert 'project' in cfg.__dict__ - assert cfg.project == 'Sphinx Tests' + assert cfg.project == 'Sphinx ' assert cfg.templates_path == ['_templates'] # overrides assert cfg.master_doc == 'master' + assert cfg.latex_elements['docclass'] == 'scrartcl' # simple default values assert 'exclude_dirs' not in cfg.__dict__ @@ -34,7 +36,7 @@ # complex default values assert 'html_title' not in cfg.__dict__ - assert cfg.html_title == 'Sphinx Tests v0.4alpha1 documentation' + assert cfg.html_title == 'Sphinx v0.4alpha1 documentation' # complex default values mustn't raise for valuename in cfg.config_values: Modified: doctools/trunk/tests/test_coverage.py ============================================================================== --- doctools/trunk/tests/test_coverage.py (original) +++ doctools/trunk/tests/test_coverage.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Test the coverage builder. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import pickle Modified: doctools/trunk/tests/test_env.py ============================================================================== --- doctools/trunk/tests/test_env.py (original) +++ doctools/trunk/tests/test_env.py Sun Jan 4 21:38:57 2009 @@ -5,14 +5,15 @@ Test the BuildEnvironment class. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from util import * from sphinx.environment import BuildEnvironment -from sphinx.builder import StandaloneHTMLBuilder, LaTeXBuilder +from sphinx.builders.html import StandaloneHTMLBuilder +from sphinx.builders.latex import LaTeXBuilder app = env = None warnings = [] @@ -54,16 +55,19 @@ htmlbuilder = StandaloneHTMLBuilder(app, env) htmlbuilder.post_process_images(tree) assert "no matching candidate for image URI u'foo.*'" in app._warning.content[-1] - assert set(htmlbuilder.images.keys()) == set(['subdir/img.png', 'img.png']) - assert set(htmlbuilder.images.values()) == set(['img.png', 'img1.png']) + assert set(htmlbuilder.images.keys()) == set(['subdir/img.png', 'img.png', + 'subdir/simg.png']) + assert set(htmlbuilder.images.values()) == set(['img.png', 'img1.png', + 'simg.png']) app._warning.reset() latexbuilder = LaTeXBuilder(app, env) latexbuilder.post_process_images(tree) assert "no matching candidate for image URI u'foo.*'" in app._warning.content[-1] - assert set(latexbuilder.images.keys()) == set(['subdir/img.png', + assert set(latexbuilder.images.keys()) == set(['subdir/img.png', 'subdir/simg.png', 'img.png', 'img.pdf']) - assert set(latexbuilder.images.values()) == set(['img.pdf', 'img.png', 'img1.png']) + assert set(latexbuilder.images.values()) == set(['img.pdf', 'img.png', + 'img1.png', 'simg.png']) def test_second_update(): # delete, add and "edit" (change saved mtime) some files and update again @@ -73,11 +77,13 @@ (root / 'new.txt').write_text('New file\n========\n') it = env.update(app.config, app.srcdir, app.doctreedir, app) msg = it.next() - assert '1 added, 1 changed, 1 removed' in msg + assert '1 added, 2 changed, 1 removed' in msg docnames = set() for docname in it: docnames.add(docname) - assert docnames == set(['contents', 'new']) + # "includes" is in there because it contains a reference to a nonexisting + # downloadable file, which is given another chance to exist + assert docnames == set(['contents', 'new', 'includes']) assert 'images' not in env.all_docs assert 'images' not in env.found_docs Added: doctools/trunk/tests/test_highlighting.py ============================================================================== --- (empty file) +++ doctools/trunk/tests/test_highlighting.py Sun Jan 4 21:38:57 2009 @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" + test_highlighting + ~~~~~~~~~~~~~~~~~ + + Test the Pygments highlighting bridge. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from util import * + +from pygments.lexer import RegexLexer +from pygments.token import Text, Name +from pygments.formatters.html import HtmlFormatter + +from sphinx.highlighting import PygmentsBridge + + +class MyLexer(RegexLexer): + name = 'testlexer' + + tokens = { + 'root': [ + ('a', Name), + ('b', Text), + ], + } + +class ComplainOnUnhighlighted(PygmentsBridge): + + def unhighlighted(self, source): + raise AssertionError("should highlight %r" % source) + +class MyFormatter(HtmlFormatter): + def format(self, tokensource, outfile): + outfile.write('test') + + + at with_app() +def test_add_lexer(app): + app.add_lexer('test', MyLexer()) + + bridge = PygmentsBridge('html') + ret = bridge.highlight_block('ab', 'test') + assert 'ab' in ret + +def test_detect_interactive(): + bridge = ComplainOnUnhighlighted('html') + blocks = [ + """ + >>> testing() + True + """, + ] + for block in blocks: + ret = bridge.highlight_block(block.lstrip(), 'python') + assert ret.startswith("
    ") + +def test_set_formatter(): + PygmentsBridge.html_formatter = MyFormatter + try: + bridge = PygmentsBridge('html') + ret = bridge.highlight_block('foo', 'python') + assert ret == 'test' + finally: + PygmentsBridge.html_formatter = HtmlFormatter Modified: doctools/trunk/tests/test_i18n.py ============================================================================== --- doctools/trunk/tests/test_i18n.py (original) +++ doctools/trunk/tests/test_i18n.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Test locale features. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ from util import * Modified: doctools/trunk/tests/test_markup.py ============================================================================== --- doctools/trunk/tests/test_markup.py (original) +++ doctools/trunk/tests/test_markup.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Test various Sphinx-specific markup extensions. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import re @@ -17,11 +17,13 @@ from docutils.parsers import rst from sphinx import addnodes -from sphinx.htmlwriter import HTMLWriter, SmartyPantsHTMLTranslator -from sphinx.latexwriter import LaTeXWriter, LaTeXTranslator +from sphinx.util import texescape +from sphinx.writers.html import HTMLWriter, SmartyPantsHTMLTranslator +from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator def setup_module(): global app, settings, parser + texescape.init() # otherwise done by the latex builder app = TestApp(cleanenv=True) optparser = frontend.OptionParser(components=(rst.Parser, HTMLWriter, LaTeXWriter)) settings = optparser.get_default_values() @@ -94,7 +96,7 @@ # non-interpolation of dashes in option role verify_re(':option:`--with-option`', '

    --with-option

    $', - r'\\emph{\\texttt{--with-option}}$') + r'\\emph{\\texttt{-{-}with-option}}$') # verify smarty-pants quotes verify('"John"', '

    “John”

    ', "``John''") Modified: doctools/trunk/tests/test_quickstart.py ============================================================================== --- doctools/trunk/tests/test_quickstart.py (original) +++ doctools/trunk/tests/test_quickstart.py Sun Jan 4 21:38:57 2009 @@ -5,8 +5,8 @@ Test the sphinx.quickstart module. - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys Modified: doctools/trunk/tests/util.py ============================================================================== --- doctools/trunk/tests/util.py (original) +++ doctools/trunk/tests/util.py Sun Jan 4 21:38:57 2009 @@ -3,8 +3,8 @@ Sphinx test suite utilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2008 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys @@ -13,9 +13,13 @@ import tempfile import shutil -from functools import wraps +try: + from functools import wraps +except ImportError: + # functools is new in 2.4 + wraps = lambda f: (lambda w: w) -from sphinx import application, builder +from sphinx import application from path import path Modified: doctools/trunk/utils/check_sources.py ============================================================================== --- doctools/trunk/utils/check_sources.py (original) +++ doctools/trunk/utils/check_sources.py Sun Jan 4 21:38:57 2009 @@ -7,7 +7,7 @@ Make sure each Python file has a correct file header including copyright and license information. - :copyright: 2006-2008 by Georg Brandl. + :copyright: Copyright 2006-2009 by Georg Brandl. :license: GNU GPL, see LICENSE for more details. """ @@ -30,7 +30,8 @@ name_mail_re = r'[\w ]+(<.*?>)?' -copyright_re = re.compile(r'^ :copyright: 200\d(-200\d)? by %s(, %s)*[,.]$' % +copyright_re = re.compile(r'^ :copyright: Copyright 200\d(-200\d)?' + r'by %s(, %s)*[,.]$' % (name_mail_re, name_mail_re)) license_re = re.compile(r" :license: (.*?).\n") copyright_2_re = re.compile(r'^ %s(, %s)*[,.]$' % From buildbot at python.org Sun Jan 4 21:47:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 20:47:44 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20090104204744.F03471E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/28 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 4 21:53:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 20:53:04 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu trunk Message-ID: <20090104205304.237AC1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%20trunk/builds/1137 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Bus error sincerely, -The Buildbot From buildbot at python.org Sun Jan 4 22:05:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 21:05:41 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090104210541.4219D1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/39 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_io ====================================================================== ERROR: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 928, in testBasicIO self.assertEquals(f.write("abc"), 3) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1488, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testEncodingErrorsReading (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 763, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 350, in failUnlessRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1721, in read decoder.decode(self.buffer.read(), final=True)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testEncodingErrorsWriting (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 781, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 350, in failUnlessRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1488, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testNewlinesInput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 889, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 534, in readlines return list(self) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1736, in __next__ line = self.readline() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1810, in readline while self._read_chunk(): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testNewlinesOutput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 914, in testNewlinesOutput txt.write(data) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1488, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1150, in test_issue1395_1 c = txt.read(1) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1730, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1162, in test_issue1395_2 c = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1730, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1172, in test_issue1395_3 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1730, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1183, in test_issue1395_4 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1730, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1191, in test_issue1395_5 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1730, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' sincerely, -The Buildbot From python-checkins at python.org Sun Jan 4 22:10:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 22:10:56 +0100 (CET) Subject: [Python-checkins] r68314 - python/trunk/Lib/decimal.py Message-ID: <20090104211056.32CD11E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 22:10:56 2009 New Revision: 68314 Log: Fix Decimal.from_float to use valid Python 2.3 syntax, as per comments at top of decimal.py. (But note that the from_float method itself with still not be usable before Python 2.7.) See issue 4796 for discussion. Modified: python/trunk/Lib/decimal.py Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sun Jan 4 22:10:56 2009 @@ -654,7 +654,8 @@ raise TypeError("Cannot convert %r to Decimal" % value) - @classmethod + # @classmethod, but @decorator is not valid Python 2.3 syntax, so + # don't use it (see notes on Py2.3 compatibility at top of file) def from_float(cls, f): """Converts a float to a decimal number, exactly. @@ -680,11 +681,18 @@ return cls(f) if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float return cls(repr(f)) - sign = 0 if _math.copysign(1.0, f) == 1.0 else 1 + if _math.copysign(1.0, f) == 1.0: + sign = 0 + else: + sign = 1 n, d = abs(f).as_integer_ratio() k = d.bit_length() - 1 result = _dec_from_triple(sign, str(n*5**k), -k) - return result if cls is Decimal else cls(result) + if cls is Decimal: + return result + else: + return cls(result) + from_float = classmethod(from_float) def _isnan(self): """Returns whether the number is not actually one. From python-checkins at python.org Sun Jan 4 22:11:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 4 Jan 2009 22:11:11 +0100 (CET) Subject: [Python-checkins] r68315 - python/branches/py3k/Lib/gzip.py Message-ID: <20090104211111.3D6B71E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 4 22:11:10 2009 New Revision: 68315 Log: Buglet: restore functioning of gzip as an executable when (de)compressing from stdin to stdout Modified: python/branches/py3k/Lib/gzip.py Modified: python/branches/py3k/Lib/gzip.py ============================================================================== --- python/branches/py3k/Lib/gzip.py (original) +++ python/branches/py3k/Lib/gzip.py Sun Jan 4 22:11:10 2009 @@ -473,8 +473,8 @@ for arg in args: if decompress: if arg == "-": - f = GzipFile(filename="", mode="rb", fileobj=sys.stdin) - g = sys.stdout + f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer) + g = sys.stdout.buffer else: if arg[-3:] != ".gz": print("filename doesn't end in .gz:", repr(arg)) @@ -483,8 +483,8 @@ g = builtins.open(arg[:-3], "wb") else: if arg == "-": - f = sys.stdin - g = GzipFile(filename="", mode="wb", fileobj=sys.stdout) + f = sys.stdin.buffer + g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer) else: f = builtins.open(arg, "rb") g = open(arg + ".gz", "wb") From python-checkins at python.org Sun Jan 4 22:17:44 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 22:17:44 +0100 (CET) Subject: [Python-checkins] r68316 - in python/branches/py3k: Lib/decimal.py Message-ID: <20090104211744.139191E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 22:17:43 2009 New Revision: 68316 Log: Merged revisions 68314 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68314 | mark.dickinson | 2009-01-04 21:10:56 +0000 (Sun, 04 Jan 2009) | 5 lines Fix Decimal.from_float to use valid Python 2.3 syntax, as per comments at top of decimal.py. (But note that the from_float method itself with still not be usable before Python 2.7.) See issue 4796 for discussion. ........ Modified: python/branches/py3k/ (props changed) 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 Sun Jan 4 22:17:43 2009 @@ -655,7 +655,8 @@ raise TypeError("Cannot convert %r to Decimal" % value) - @classmethod + # @classmethod, but @decorator is not valid Python 2.3 syntax, so + # don't use it (see notes on Py2.3 compatibility at top of file) def from_float(cls, f): """Converts a float to a decimal number, exactly. @@ -681,11 +682,18 @@ return cls(f) if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float return cls(repr(f)) - sign = 0 if _math.copysign(1.0, f) == 1.0 else 1 + if _math.copysign(1.0, f) == 1.0: + sign = 0 + else: + sign = 1 n, d = abs(f).as_integer_ratio() k = d.bit_length() - 1 result = _dec_from_triple(sign, str(n*5**k), -k) - return result if cls is Decimal else cls(result) + if cls is Decimal: + return result + else: + return cls(result) + from_float = classmethod(from_float) def _isnan(self): """Returns whether the number is not actually one. From python-checkins at python.org Sun Jan 4 22:22:03 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 22:22:03 +0100 (CET) Subject: [Python-checkins] r68317 - python/trunk/Lib/decimal.py Message-ID: <20090104212203.2D6131E404E@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 22:22:02 2009 New Revision: 68317 Log: More Python 2.3 compatibility fixes for decimal.py. Modified: python/trunk/Lib/decimal.py Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sun Jan 4 22:22:02 2009 @@ -1556,13 +1556,13 @@ __trunc__ = __int__ - @property def real(self): return self + real = property(real) - @property def imag(self): return Decimal(0) + imag = property(imag) def conjugate(self): return self @@ -3174,7 +3174,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def logical_xor(self, other, context=None): @@ -3188,7 +3188,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def max_mag(self, other, context=None): From python-checkins at python.org Sun Jan 4 22:25:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 22:25:41 +0100 (CET) Subject: [Python-checkins] r68318 - python/trunk/Misc/NEWS Message-ID: <20090104212541.0B8CD1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 22:25:40 2009 New Revision: 68318 Log: Misc/NEWS entry for r68317 Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 4 22:25:40 2009 @@ -108,6 +108,8 @@ Library ------- +- Restore Python 2.3 compatibility for decimal.py. + - Issue #1702551: distutils sdist was not excluding VCS directories under Windows. Inital solution by Guy Dalberto. From python-checkins at python.org Sun Jan 4 22:29:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 4 Jan 2009 22:29:24 +0100 (CET) Subject: [Python-checkins] r68319 - in python/trunk: Doc/library/gzip.rst Lib/gzip.py Lib/test/test_gzip.py Misc/NEWS Message-ID: <20090104212924.0F80A1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 4 22:29:23 2009 New Revision: 68319 Log: Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. Modified: python/trunk/Doc/library/gzip.rst python/trunk/Lib/gzip.py python/trunk/Lib/test/test_gzip.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/gzip.rst ============================================================================== --- python/trunk/Doc/library/gzip.rst (original) +++ python/trunk/Doc/library/gzip.rst Sun Jan 4 22:29:23 2009 @@ -24,7 +24,7 @@ The module defines the following items: -.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj]]]]) +.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]]) Constructor for the :class:`GzipFile` class, which simulates most of the methods of a file object, with the exception of the :meth:`readinto` and @@ -52,6 +52,15 @@ level of compression; ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. The default is ``9``. + The *mtime* argument is an optional numeric timestamp to be written to + the stream when compressing. All :program:`gzip`compressed streams are + required to contain a timestamp. If omitted or ``None``, the current + time is used. This module ignores the timestamp when decompressing; + however, some programs, such as :program:`gunzip`\ , make use of it. + The format of the timestamp is the same as that of the return value of + ``time.time()`` and of the ``st_mtime`` member of the object returned + by ``os.stat()``. + Calling a :class:`GzipFile` object's :meth:`close` method does not close *fileobj*, since you might wish to append more material after the compressed data. This also allows you to pass a :class:`StringIO` object opened for Modified: python/trunk/Lib/gzip.py ============================================================================== --- python/trunk/Lib/gzip.py (original) +++ python/trunk/Lib/gzip.py Sun Jan 4 22:29:23 2009 @@ -42,7 +42,7 @@ max_read_chunk = 10 * 1024 * 1024 # 10Mb def __init__(self, filename=None, mode=None, - compresslevel=9, fileobj=None): + compresslevel=9, fileobj=None, mtime=None): """Constructor for the GzipFile class. At least one of fileobj and filename must be given a @@ -69,6 +69,15 @@ level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. The default is 9. + The mtime argument is an optional numeric timestamp to be written + to the stream when compressing. All gzip compressed streams + are required to contain a timestamp. If omitted or None, the + current time is used. This module ignores the timestamp when + decompressing; however, some programs, such as gunzip, make use + of it. The format of the timestamp is the same as that of the + return value of time.time() and of the st_mtime member of the + object returned by os.stat(). + """ # guarantee the file is opened in binary mode on platforms @@ -107,6 +116,7 @@ self.fileobj = fileobj self.offset = 0 + self.mtime = mtime if self.mode == WRITE: self._write_gzip_header() @@ -140,7 +150,10 @@ if fname: flags = FNAME self.fileobj.write(chr(flags)) - write32u(self.fileobj, long(time.time())) + mtime = self.mtime + if mtime is None: + mtime = time.time() + write32u(self.fileobj, long(mtime)) self.fileobj.write('\002') self.fileobj.write('\377') if fname: @@ -158,10 +171,10 @@ if method != 8: raise IOError, 'Unknown compression method' flag = ord( self.fileobj.read(1) ) - # modtime = self.fileobj.read(4) + self.mtime = read32(self.fileobj) # extraflag = self.fileobj.read(1) # os = self.fileobj.read(1) - self.fileobj.read(6) + self.fileobj.read(2) if flag & FEXTRA: # Read & discard the extra field, if present Modified: python/trunk/Lib/test/test_gzip.py ============================================================================== --- python/trunk/Lib/test/test_gzip.py (original) +++ python/trunk/Lib/test/test_gzip.py Sun Jan 4 22:29:23 2009 @@ -6,6 +6,7 @@ from test import test_support import os import gzip +import struct data1 = """ int length=DEFAULTALLOC, err = Z_OK; @@ -160,6 +161,67 @@ self.assertEqual(f.name, self.filename) f.close() + def test_mtime(self): + mtime = 123456789 + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + + fRead = gzip.GzipFile(self.filename) + dataRead = fRead.read() + self.assertEqual(dataRead, data1) + self.assert_(hasattr(fRead, 'mtime')) + self.assertEqual(fRead.mtime, mtime) + fRead.close() + + def test_metadata(self): + mtime = 123456789 + + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + + fRead = open(self.filename, 'rb') + + # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html + + idBytes = fRead.read(2) + self.assertEqual(idBytes, '\x1f\x8b') # gzip ID + + cmByte = fRead.read(1) + self.assertEqual(cmByte, '\x08') # deflate + + flagsByte = fRead.read(1) + self.assertEqual(flagsByte, '\x08') # only the FNAME flag is set + + mtimeBytes = fRead.read(4) + self.assertEqual(mtimeBytes, struct.pack(' Author: mark.dickinson Date: Sun Jan 4 22:30:17 2009 New Revision: 68320 Log: Merged revisions 68317-68318 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68317 | mark.dickinson | 2009-01-04 21:22:02 +0000 (Sun, 04 Jan 2009) | 2 lines More Python 2.3 compatibility fixes for decimal.py. ........ r68318 | mark.dickinson | 2009-01-04 21:25:40 +0000 (Sun, 04 Jan 2009) | 2 lines Misc/NEWS entry for r68317 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/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 Sun Jan 4 22:30:17 2009 @@ -1515,13 +1515,13 @@ __trunc__ = __int__ - @property def real(self): return self + real = property(real) - @property def imag(self): return Decimal(0) + imag = property(imag) def conjugate(self): return self @@ -3133,7 +3133,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def logical_xor(self, other, context=None): @@ -3147,7 +3147,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def max_mag(self, other, context=None): Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun Jan 4 22:30:17 2009 @@ -158,6 +158,8 @@ Library ------- +- Restore Python 2.3 compatibility for decimal.py. + - Issue #1702551: distutils sdist was not excluding VCS directories under Windows. Inital solution by Guy Dalberto. From python-checkins at python.org Sun Jan 4 22:34:18 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 22:34:18 +0100 (CET) Subject: [Python-checkins] r68321 - in python/branches/py3k: Lib/decimal.py Misc/NEWS Message-ID: <20090104213418.466541E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 22:34:18 2009 New Revision: 68321 Log: Merged revisions 68317-68318 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68317 | mark.dickinson | 2009-01-04 21:22:02 +0000 (Sun, 04 Jan 2009) | 2 lines More Python 2.3 compatibility fixes for decimal.py. ........ r68318 | mark.dickinson | 2009-01-04 21:25:40 +0000 (Sun, 04 Jan 2009) | 2 lines Misc/NEWS entry for r68317 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/decimal.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/decimal.py ============================================================================== --- python/branches/py3k/Lib/decimal.py (original) +++ python/branches/py3k/Lib/decimal.py Sun Jan 4 22:34:18 2009 @@ -1555,13 +1555,13 @@ __trunc__ = __int__ - @property def real(self): return self + real = property(real) - @property def imag(self): return Decimal(0) + imag = property(imag) def conjugate(self): return self @@ -3262,7 +3262,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def logical_xor(self, other, context=None): @@ -3276,7 +3276,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def max_mag(self, other, context=None): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 4 22:34:18 2009 @@ -82,6 +82,8 @@ Library ------- +- Restore Python 2.3 compatibility for decimal.py. + - Issue #3638: Remove functions from _tkinter module level that depend on TkappObject to work with multiple threads. From python-checkins at python.org Sun Jan 4 22:37:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 4 Jan 2009 22:37:56 +0100 (CET) Subject: [Python-checkins] r68322 - in python/branches/release30-maint: Lib/decimal.py Misc/NEWS Message-ID: <20090104213756.8ACC01E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 4 22:37:56 2009 New Revision: 68322 Log: Merged revisions 68321 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68321 | mark.dickinson | 2009-01-04 21:34:18 +0000 (Sun, 04 Jan 2009) | 13 lines Merged revisions 68317-68318 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68317 | mark.dickinson | 2009-01-04 21:22:02 +0000 (Sun, 04 Jan 2009) | 2 lines More Python 2.3 compatibility fixes for decimal.py. ........ r68318 | mark.dickinson | 2009-01-04 21:25:40 +0000 (Sun, 04 Jan 2009) | 2 lines Misc/NEWS entry for r68317 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/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 Sun Jan 4 22:37:56 2009 @@ -1514,13 +1514,13 @@ __trunc__ = __int__ - @property def real(self): return self + real = property(real) - @property def imag(self): return Decimal(0) + imag = property(imag) def conjugate(self): return self @@ -3221,7 +3221,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def logical_xor(self, other, context=None): @@ -3235,7 +3235,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def max_mag(self, other, context=None): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 4 22:37:56 2009 @@ -64,6 +64,8 @@ Library ------- +- Restore Python 2.3 compatibility for decimal.py. + - Issue #3638: Remove functions from _tkinter module level that depend on TkappObject to work with multiple threads. From python-checkins at python.org Sun Jan 4 22:37:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 4 Jan 2009 22:37:59 +0100 (CET) Subject: [Python-checkins] r68323 - in python/branches/py3k: Doc/library/gzip.rst Lib/gzip.py Lib/test/test_gzip.py Misc/NEWS Message-ID: <20090104213759.E05F01E4033@bag.python.org> Author: antoine.pitrou Date: Sun Jan 4 22:37:59 2009 New Revision: 68323 Log: Merged revisions 68319 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68319 | antoine.pitrou | 2009-01-04 22:29:23 +0100 (dim., 04 janv. 2009) | 3 lines Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/gzip.rst python/branches/py3k/Lib/gzip.py python/branches/py3k/Lib/test/test_gzip.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/gzip.rst ============================================================================== --- python/branches/py3k/Doc/library/gzip.rst (original) +++ python/branches/py3k/Doc/library/gzip.rst Sun Jan 4 22:37:59 2009 @@ -24,7 +24,7 @@ The module defines the following items: -.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj]]]]) +.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]]) Constructor for the :class:`GzipFile` class, which simulates most of the methods of a file object, with the exception of the :meth:`readinto` and @@ -52,6 +52,15 @@ level of compression; ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. The default is ``9``. + The *mtime* argument is an optional numeric timestamp to be written to + the stream when compressing. All :program:`gzip`compressed streams are + required to contain a timestamp. If omitted or ``None``, the current + time is used. This module ignores the timestamp when decompressing; + however, some programs, such as :program:`gunzip`\ , make use of it. + The format of the timestamp is the same as that of the return value of + ``time.time()`` and of the ``st_mtime`` member of the object returned + by ``os.stat()``. + Calling a :class:`GzipFile` object's :meth:`close` method does not close *fileobj*, since you might wish to append more material after the compressed data. This also allows you to pass a :class:`StringIO` object opened for Modified: python/branches/py3k/Lib/gzip.py ============================================================================== --- python/branches/py3k/Lib/gzip.py (original) +++ python/branches/py3k/Lib/gzip.py Sun Jan 4 22:37:59 2009 @@ -54,7 +54,7 @@ max_read_chunk = 10 * 1024 * 1024 # 10Mb def __init__(self, filename=None, mode=None, - compresslevel=9, fileobj=None): + compresslevel=9, fileobj=None, mtime=None): """Constructor for the GzipFile class. At least one of fileobj and filename must be given a @@ -81,6 +81,15 @@ level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. The default is 9. + The mtime argument is an optional numeric timestamp to be written + to the stream when compressing. All gzip compressed streams + are required to contain a timestamp. If omitted or None, the + current time is used. This module ignores the timestamp when + decompressing; however, some programs, such as gunzip, make use + of it. The format of the timestamp is the same as that of the + return value of time.time() and of the st_mtime member of the + object returned by os.stat(). + """ # guarantee the file is opened in binary mode on platforms @@ -119,6 +128,7 @@ self.fileobj = fileobj self.offset = 0 + self.mtime = mtime if self.mode == WRITE: self._write_gzip_header() @@ -157,7 +167,10 @@ if fname: flags = FNAME self.fileobj.write(chr(flags).encode('latin-1')) - write32u(self.fileobj, int(time.time())) + mtime = self.mtime + if mtime is None: + mtime = time.time() + write32u(self.fileobj, int(mtime)) self.fileobj.write(b'\002') self.fileobj.write(b'\377') if fname: @@ -175,10 +188,10 @@ if method != 8: raise IOError('Unknown compression method') flag = ord( self.fileobj.read(1) ) - # modtime = self.fileobj.read(4) + self.mtime = read32(self.fileobj) # extraflag = self.fileobj.read(1) # os = self.fileobj.read(1) - self.fileobj.read(6) + self.fileobj.read(2) if flag & FEXTRA: # Read & discard the extra field, if present Modified: python/branches/py3k/Lib/test/test_gzip.py ============================================================================== --- python/branches/py3k/Lib/test/test_gzip.py (original) +++ python/branches/py3k/Lib/test/test_gzip.py Sun Jan 4 22:37:59 2009 @@ -6,6 +6,7 @@ from test import support import os import gzip +import struct data1 = b""" int length=DEFAULTALLOC, err = Z_OK; @@ -160,6 +161,68 @@ self.assertEqual(f.name, self.filename) f.close() + def test_mtime(self): + mtime = 123456789 + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + + fRead = gzip.GzipFile(self.filename) + dataRead = fRead.read() + self.assertEqual(dataRead, data1) + self.assert_(hasattr(fRead, 'mtime')) + self.assertEqual(fRead.mtime, mtime) + fRead.close() + + def test_metadata(self): + mtime = 123456789 + + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + + fRead = open(self.filename, 'rb') + + # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html + + idBytes = fRead.read(2) + self.assertEqual(idBytes, b'\x1f\x8b') # gzip ID + + cmByte = fRead.read(1) + self.assertEqual(cmByte, b'\x08') # deflate + + flagsByte = fRead.read(1) + self.assertEqual(flagsByte, b'\x08') # only the FNAME flag is set + + mtimeBytes = fRead.read(4) + self.assertEqual(mtimeBytes, struct.pack(' 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/66 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 4 23:00:18 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 4 Jan 2009 23:00:18 +0100 (CET) Subject: [Python-checkins] r68325 - in python/trunk/Doc: Makefile tools Message-ID: <20090104220018.655E11E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 4 23:00:18 2009 New Revision: 68325 Log: use Jinja 2.1.1 Modified: python/trunk/Doc/Makefile python/trunk/Doc/tools/ (props changed) Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Sun Jan 4 23:00:18 2009 @@ -37,9 +37,9 @@ echo "Checking out Docutils..."; \ svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \ fi - @if [ ! -d tools/jinja ]; then \ + @if [ ! -d tools/jinja2 ]; then \ echo "Checking out Jinja..."; \ - svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \ + svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \ fi @if [ ! -d tools/pygments ]; then \ echo "Checking out Pygments..."; \ @@ -49,7 +49,7 @@ update: checkout svn update tools/sphinx svn update tools/docutils - svn update tools/jinja + svn update tools/jinja2 svn update tools/pygments build: checkout From python-checkins at python.org Sun Jan 4 23:03:10 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 4 Jan 2009 23:03:10 +0100 (CET) Subject: [Python-checkins] r68326 - python/trunk/Doc/make.bat Message-ID: <20090104220310.A31811E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 4 23:03:10 2009 New Revision: 68326 Log: Update make.bat. Modified: python/trunk/Doc/make.bat Modified: python/trunk/Doc/make.bat ============================================================================== --- python/trunk/Doc/make.bat (original) +++ python/trunk/Doc/make.bat Sun Jan 4 23:03:10 2009 @@ -35,14 +35,14 @@ :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.2/jinja tools/jinja +svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2 svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update svn update tools/sphinx svn update tools/docutils -svn update tools/jinja +svn update tools/jinja2 svn update tools/pygments goto end @@ -54,9 +54,4 @@ if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - :end From python-checkins at python.org Mon Jan 5 00:20:14 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 5 Jan 2009 00:20:14 +0100 (CET) Subject: [Python-checkins] r68327 - in python/branches/py3k/Doc/c-api: allocation.rst module.rst Message-ID: <20090104232014.7569D1E4002@bag.python.org> Author: georg.brandl Date: Mon Jan 5 00:20:14 2009 New Revision: 68327 Log: #4614: document PyModule_Create and PyModuleDef struct. Modified: python/branches/py3k/Doc/c-api/allocation.rst python/branches/py3k/Doc/c-api/module.rst Modified: python/branches/py3k/Doc/c-api/allocation.rst ============================================================================== --- python/branches/py3k/Doc/c-api/allocation.rst (original) +++ python/branches/py3k/Doc/c-api/allocation.rst Mon Jan 5 00:20:14 2009 @@ -54,40 +54,15 @@ accessed after this call as the memory is no longer a valid Python object. -.. cfunction:: PyObject* Py_InitModule(char *name, PyMethodDef *methods) - - Create a new module object based on a name and table of functions, returning - the new module object; the *methods* argument can be *NULL* if no methods are - to be defined for the module. - - -.. cfunction:: PyObject* Py_InitModule3(char *name, PyMethodDef *methods, char *doc) - - Create a new module object based on a name and table of functions, returning - the new module object. The *methods* argument can be *NULL* if no methods - are to be defined for the module. If *doc* is non-*NULL*, it will be used to - define the docstring for the module. - - -.. cfunction:: PyObject* Py_InitModule4(char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver) - - Create a new module object based on a name and table of functions, returning - the new module object. The *methods* argument can be *NULL* if no methods - are to be defined for the module. If *doc* is non-*NULL*, it will be used to - define the docstring for the module. If *self* is non-*NULL*, it will passed - to the functions of the module as their (otherwise *NULL*) first parameter. - (This was added as an experimental feature, and there are no known uses in - the current version of Python.) For *apiver*, the only value which should be - passed is defined by the constant :const:`PYTHON_API_VERSION`. - - .. note:: - - Most uses of this function should probably be using the :cfunc:`Py_InitModule3` - instead; only use this if you are sure you need it. - - .. cvar:: PyObject _Py_NoneStruct Object which is visible in Python as ``None``. This should only be accessed using the :cmacro:`Py_None` macro, which evaluates to a pointer to this object. + + +.. seealso:: + + :cfunc:`PyModule_Create` + To allocate and create extension modules. + Modified: python/branches/py3k/Doc/c-api/module.rst ============================================================================== --- python/branches/py3k/Doc/c-api/module.rst (original) +++ python/branches/py3k/Doc/c-api/module.rst Mon Jan 5 00:20:14 2009 @@ -73,6 +73,101 @@ raise :exc:`SystemError` and return *NULL*. +.. cfunction:: void* PyModule_GetState(PyObject *module) + + Return the "state" of the module, that is, a pointer to the block of memory + allocated at module creation time, or *NULL*. See + :cmember:`PyModuleDef.m_size`. + + +.. cfunction:: PyModuleDef* PyModule_GetDef(PyObject *module) + + Return a pointer to the :ctype:`PyModuleDef` struct from which the module was + created, or *NULL* if the module wasn't created with + :cfunc:`PyModule_Create`. + + +Initializing C modules +^^^^^^^^^^^^^^^^^^^^^^ + +These functions are usually used in the module initialization function. + +.. cfunction:: PyObject* PyModule_Create(PyModuleDef *module) + + Create a new module object, given the definition in *module*. This behaves + like :cfunc:`PyModule_Create2` with *module_api_version* set to + :const:`PYTHON_API_VERSION`. + + +.. cfunction:: PyObject* PyModule_Create2(PyModuleDef *module, int module_api_version) + + Create a new module object, given the definition in *module*, assuming the + API version *module_api_version*. If that version does not match the version + of the running interpreter, a :exc:`RuntimeWarning` is emitted. + + .. note:: + + Most uses of this function should be using :cfunc:`PyModule_Create` + instead; only use this if you are sure you need it. + + +.. ctype:: PyModuleDef + + This struct holds all information that is needed to create a module object. + There is usually only one static variable of that type for each module, which + is statically initialized and then passed to :cfunc:`PyModule_Create` in the + module initialization function. + + .. cmember:: PyModuleDef_Base m_base + + Always initialize this member to :const:`PyModuleDef_HEAD_INIT`. + + .. cmember:: char* m_name + + Name for the new module. + + .. cmember:: char* m_doc + + Docstring for the module; usually a docstring variable created with + :cfunc:`PyDoc_STRVAR` is used. + + .. cmember:: Py_ssize_t m_size + + If the module object needs additional memory, this should be set to the + number of bytes to allocate; a pointer to the block of memory can be + retrieved with :cfunc:`PyModule_GetState`. If no memory is needed, set + this to ``-1``. + + This memory should be used, rather than static globals, to hold per-module + state, since it is then safe for use in multiple sub-interpreters. It is + freed when the module object is deallocated, after the :cmember:`m_free` + function has been called, if present. + + .. cmember:: PyMethodDef* m_methods + + A pointer to a table of module-level functions, described by + :ctype:`PyMethodDef` values. Can be *NULL* if no functions are present. + + .. cmember:: inquiry m_reload + + Currently unused, should be *NULL*. + + .. cmember:: traverseproc m_traverse + + A traversal function to call during GC traversal of the module object, or + *NULL* if not needed. + + .. cmember:: inquiry m_clear + + A clear function to call during GC clearing of the module object, or + *NULL* if not needed. + + .. cmember:: freefunc m_free + + A function to call during deallocation of the module object, or *NULL* if + not needed. + + .. cfunction:: int PyModule_AddObject(PyObject *module, const char *name, PyObject *value) Add an object to *module* as *name*. This is a convenience function which can @@ -105,4 +200,3 @@ .. cfunction:: int PyModule_AddStringMacro(PyObject *module, macro) Add a string constant to *module*. - From nnorwitz at gmail.com Mon Jan 5 00:22:33 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 4 Jan 2009 18:22:33 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090104232233.GA29568@python.psfb.org> svn update tools/sphinx svn: Failed to add file 'tools/sphinx/__init__.pyc': object of the same name already exists A tools/sphinx/jinja2glue.py U tools/sphinx/_jinja.py U tools/sphinx/quickstart.py A tools/sphinx/pycode A tools/sphinx/pycode/nodes.py A tools/sphinx/pycode/Grammar.txt A tools/sphinx/pycode/__init__.py A tools/sphinx/pycode/pgen2 A tools/sphinx/pycode/pgen2/tokenize.py A tools/sphinx/pycode/pgen2/pgen.py A tools/sphinx/pycode/pgen2/parse.py A tools/sphinx/pycode/pgen2/driver.py A tools/sphinx/pycode/pgen2/__init__.py A tools/sphinx/pycode/pgen2/literals.py A tools/sphinx/pycode/pgen2/token.py A tools/sphinx/pycode/pgen2/parse.pyx A tools/sphinx/pycode/pgen2/parse.c A tools/sphinx/pycode/pgen2/grammar.py U tools/sphinx/setup_command.py U tools/sphinx/__init__.py U tools/sphinx/static/searchtools.js make: *** [update] Error 1 From python-checkins at python.org Mon Jan 5 00:25:12 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 00:25:12 +0100 (CET) Subject: [Python-checkins] r68328 - doctools/trunk/sphinx/__init__.pyc Message-ID: <20090104232512.C3DFB1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 00:25:12 2009 New Revision: 68328 Log: remove accidental checkin of pyc Removed: doctools/trunk/sphinx/__init__.pyc Deleted: doctools/trunk/sphinx/__init__.pyc ============================================================================== Binary file. No diff available. From python-checkins at python.org Mon Jan 5 00:33:56 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 00:33:56 +0100 (CET) Subject: [Python-checkins] r68329 - doctools/trunk/tests/root/ext.pyc Message-ID: <20090104233356.CEBE71E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 00:33:56 2009 New Revision: 68329 Log: kill off another pyc Removed: doctools/trunk/tests/root/ext.pyc Deleted: doctools/trunk/tests/root/ext.pyc ============================================================================== Binary file. No diff available. From buildbot at python.org Mon Jan 5 00:58:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 04 Jan 2009 23:58:35 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.x Message-ID: <20090104235835.365A91E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.x/builds/39 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_signal make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 5 02:12:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 02:12:53 +0100 (CET) Subject: [Python-checkins] r68330 - peps/trunk/genpepindex.py Message-ID: <20090105011253.ADDC81E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 02:12:53 2009 New Revision: 68330 Log: output an nice error message instead of tracebacking Modified: peps/trunk/genpepindex.py Modified: peps/trunk/genpepindex.py ============================================================================== --- peps/trunk/genpepindex.py (original) +++ peps/trunk/genpepindex.py Mon Jan 5 02:12:53 2009 @@ -23,7 +23,7 @@ from operator import attrgetter from pep0.output import write_pep0 -from pep0.pep import PEP +from pep0.pep import PEP, PEPError def main(argv): @@ -40,7 +40,13 @@ continue if file_path.startswith("pep-") and file_path.endswith(".txt"): with codecs.open(abs_file_path, 'r', encoding='UTF-8') as pep_file: - peps.append(PEP(pep_file)) + try: + peps.append(PEP(pep_file)) + except PEPError, e: + errmsg = "Error processing PEP %s, excluding:" % \ + (e.number,) + print >>sys.stderr, errmsg, e + sys.exit(1) peps.sort(key=attrgetter('number')) elif os.path.isfile(path): with open(path, 'r') as pep_file: From python-checkins at python.org Mon Jan 5 02:20:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 02:20:25 +0100 (CET) Subject: [Python-checkins] r68331 - peps/trunk/pep-3140.txt Message-ID: <20090105012025.CBA931E4012@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 02:20:25 2009 New Revision: 68331 Log: add initial Modified: peps/trunk/pep-3140.txt Modified: peps/trunk/pep-3140.txt ============================================================================== --- peps/trunk/pep-3140.txt (original) +++ peps/trunk/pep-3140.txt Mon Jan 5 02:20:25 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Oleg Broytmann , - Jim Jewett + Jim J. Jewett Discussions-To: python-3000 at python.org Status: Rejected Type: Standards Track From python-checkins at python.org Mon Jan 5 02:23:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 02:23:28 +0100 (CET) Subject: [Python-checkins] r68332 - peps/trunk/pep0/constants.py Message-ID: <20090105012328.B569A1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 02:23:28 2009 New Revision: 68332 Log: scrap the note the about the BDFL pronouncement page; it's out of date Modified: peps/trunk/pep0/constants.py Modified: peps/trunk/pep0/constants.py ============================================================================== --- peps/trunk/pep0/constants.py (original) +++ peps/trunk/pep0/constants.py Mon Jan 5 02:23:28 2009 @@ -19,10 +19,6 @@ known as PEPs. PEP numbers are assigned by the PEP Editor, and once assigned are never changed. The SVN history[1] of the PEP texts represent their historical record. - - The BDFL maintains his own Pronouncements page[2] at - http://www.python.org/doc/essays/pepparade.html which contains his - musings on the various outstanding PEPs. """ references = u""" From python-checkins at python.org Mon Jan 5 02:25:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 02:25:14 +0100 (CET) Subject: [Python-checkins] r68333 - peps/trunk/pep0/output.py Message-ID: <20090105012514.2BECF1E4036@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 02:25:13 2009 New Revision: 68333 Log: fix typo Modified: peps/trunk/pep0/output.py Modified: peps/trunk/pep0/output.py ============================================================================== --- peps/trunk/pep0/output.py (original) +++ peps/trunk/pep0/output.py Mon Jan 5 02:25:13 2009 @@ -109,7 +109,7 @@ write_column_headers(output) meta, info, accepted, open_, finished, dead = sort_peps(peps) print>>output - print>>output, u" Meta-PEPs (PEPs about PEPs or Processs)" + print>>output, u" Meta-PEPs (PEPs about PEPs or Processes)" print>>output for pep in meta: print>>output, unicode(pep) From python-checkins at python.org Mon Jan 5 02:28:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 02:28:38 +0100 (CET) Subject: [Python-checkins] r68334 - peps/trunk/pep-0362.txt Message-ID: <20090105012838.B56CF1E4030@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 02:28:38 2009 New Revision: 68334 Log: fix spacing Modified: peps/trunk/pep-0362.txt Modified: peps/trunk/pep-0362.txt ============================================================================== --- peps/trunk/pep-0362.txt (original) +++ peps/trunk/pep-0362.txt Mon Jan 5 02:28:38 2009 @@ -2,8 +2,7 @@ Title: Function Signature Object Version: $Revision$ Last-Modified: $Date$ -Author: Brett Cannon - Jiwon Seo +Author: Brett Cannon , Jiwon Seo Status: Draft Type: Standards Track Content-Type: text/x-rst From python-checkins at python.org Mon Jan 5 02:38:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 02:38:06 +0100 (CET) Subject: [Python-checkins] r68335 - peps/trunk/pep0/pep.py Message-ID: <20090105013806.C9C651E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 02:38:06 2009 New Revision: 68335 Log: employ a rather nasty hack to sort umlauts properly Modified: peps/trunk/pep0/pep.py Modified: peps/trunk/pep0/pep.py ============================================================================== --- peps/trunk/pep0/pep.py (original) +++ peps/trunk/pep0/pep.py Mon Jan 5 02:38:06 2009 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Code for handling object representation of a PEP.""" import re import textwrap @@ -94,7 +95,9 @@ break else: raise ValueError("last name missing a capital letter") - return u' '.join(name_parts[index:]) + # This replace() hack is so people with an umlaut will sort in the right + # letter. + return u' '.join(name_parts[index:]).replace(u"?", u"o") def _last_name(self, full_name): """Find the last name (or nickname) of a full name. From nnorwitz at gmail.com Mon Jan 5 02:40:18 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 4 Jan 2009 20:40:18 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090105014018.GA11500@python.psfb.org> svn update tools/sphinx A tools/sphinx/jinja2glue.py U tools/sphinx/_jinja.py U tools/sphinx/quickstart.py A tools/sphinx/pycode A tools/sphinx/pycode/nodes.py A tools/sphinx/pycode/Grammar.txt A tools/sphinx/pycode/__init__.py A tools/sphinx/pycode/pgen2 A tools/sphinx/pycode/pgen2/tokenize.py A tools/sphinx/pycode/pgen2/pgen.py A tools/sphinx/pycode/pgen2/parse.py A tools/sphinx/pycode/pgen2/driver.py A tools/sphinx/pycode/pgen2/__init__.py A tools/sphinx/pycode/pgen2/literals.py A tools/sphinx/pycode/pgen2/token.py A tools/sphinx/pycode/pgen2/parse.pyx A tools/sphinx/pycode/pgen2/parse.c A tools/sphinx/pycode/pgen2/grammar.py U tools/sphinx/setup_command.py U tools/sphinx/__init__.py U tools/sphinx/static/searchtools.js U tools/sphinx/application.py U tools/sphinx/environment.py U tools/sphinx/highlighting.py U tools/sphinx/config.py U tools/sphinx/search.py U tools/sphinx/templates/page.html U tools/sphinx/templates/layout.html U tools/sphinx/templates/changes/versionchanges.html U tools/sphinx/templates/modindex.html U tools/sphinx/locale/cs/LC_MESSAGES/sphinx.mo U tools/sphinx/locale/cs/LC_MESSAGES/sphinx.js U tools/sphinx/locale/cs/LC_MESSAGES/sphinx.po U tools/sphinx/locale/__init__.py U tools/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po U tools/sphinx/locale/es/LC_MESSAGES/sphinx.po U tools/sphinx/locale/fr/LC_MESSAGES/sphinx.po U tools/sphinx/locale/de/LC_MESSAGES/sphinx.po U tools/sphinx/locale/nl/LC_MESSAGES/sphinx.po U tools/sphinx/locale/ja/LC_MESSAGES/sphinx.po U tools/sphinx/locale/sphinx.pot U tools/sphinx/locale/pl/LC_MESSAGES/sphinx.po U tools/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po A tools/sphinx/locale/it A tools/sphinx/locale/it/LC_MESSAGES A tools/sphinx/locale/it/LC_MESSAGES/sphinx.mo A tools/sphinx/locale/it/LC_MESSAGES/sphinx.js A tools/sphinx/locale/it/LC_MESSAGES/sphinx.po U tools/sphinx/locale/sl/LC_MESSAGES/sphinx.po A tools/sphinx/writers A tools/sphinx/writers/latex.py A tools/sphinx/writers/__init__.py A tools/sphinx/writers/html.py A tools/sphinx/writers/text.py U tools/sphinx/ext/coverage.py U tools/sphinx/ext/intersphinx.py U tools/sphinx/ext/autodoc.py U tools/sphinx/ext/pngmath.py U tools/sphinx/ext/__init__.py U tools/sphinx/ext/refcounting.py U tools/sphinx/ext/ifconfig.py U tools/sphinx/ext/mathbase.py U tools/sphinx/ext/doctest.py U tools/sphinx/ext/todo.py U tools/sphinx/ext/jsmath.py U tools/sphinx/directives/code.py U tools/sphinx/directives/desc.py U tools/sphinx/directives/__init__.py U tools/sphinx/directives/other.py U tools/sphinx/cmdline.py U tools/sphinx/texinputs/sphinx.sty U tools/sphinx/addnodes.py A tools/sphinx/builders A tools/sphinx/builders/changes.py A tools/sphinx/builders/linkcheck.py A tools/sphinx/builders/htmlhelp.py A tools/sphinx/builders/latex.py A tools/sphinx/builders/qthelp.py A tools/sphinx/builders/__init__.py A tools/sphinx/builders/html.py A tools/sphinx/builders/text.py U tools/sphinx/roles.py U tools/sphinx/builder.py U tools/sphinx/util/stemmer.py U tools/sphinx/util/__init__.py A tools/sphinx/util/docstrings.py U tools/sphinx/util/texescape.py U tools/sphinx/util/console.py U tools/sphinx/util/jsdump.py U tools/sphinx/util/compat.py A tools/sphinx/util/png.py Updated to revision 68335. svn update tools/docutils At revision 68335. svn update tools/jinja At revision 68335. svn update tools/pygments At revision 68335. mkdir -p build/html build/doctrees python2.5 tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html Exception occurred: File "/home/neal/python/py3k/Doc/tools/sphinx/jinja2glue.py", line 15, in import jinja2 ImportError: No module named jinja2 The full traceback has been saved in /tmp/sphinx-err-Zjn6hk.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-dev at googlegroups.com. Thanks! make: *** [build] Error 1 From python-checkins at python.org Mon Jan 5 04:48:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 04:48:09 +0100 (CET) Subject: [Python-checkins] r68336 - peps/trunk/pep0/pep.py Message-ID: <20090105034809.4DE6A1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 04:48:09 2009 New Revision: 68336 Log: add nickname in parenthesis to name listing for clarity Modified: peps/trunk/pep0/pep.py Modified: peps/trunk/pep0/pep.py ============================================================================== --- peps/trunk/pep0/pep.py (original) +++ peps/trunk/pep0/pep.py Mon Jan 5 04:48:09 2009 @@ -76,6 +76,7 @@ self.nick = "JvR" else: raise ValueError("unkown van Rossum %r!" % self) + self.last_first += " (%s)" % (self.nick,) else: self.nick = self.last From python-checkins at python.org Mon Jan 5 04:49:32 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 5 Jan 2009 04:49:32 +0100 (CET) Subject: [Python-checkins] r68337 - peps/trunk/genpepindex.py Message-ID: <20090105034932.4ADCC1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 5 04:49:32 2009 New Revision: 68337 Log: use python 2.5 Modified: peps/trunk/genpepindex.py Modified: peps/trunk/genpepindex.py ============================================================================== --- peps/trunk/genpepindex.py (original) +++ peps/trunk/genpepindex.py Mon Jan 5 04:49:32 2009 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2.5 """Auto-generate PEP 0 (PEP index). Generating the PEP index is a multi-step process. To begin, you must first From python-checkins at python.org Mon Jan 5 04:57:25 2009 From: python-checkins at python.org (neal.norwitz) Date: Mon, 5 Jan 2009 04:57:25 +0100 (CET) Subject: [Python-checkins] r68338 - python/trunk/Misc/build.sh Message-ID: <20090105035725.924D01E4002@bag.python.org> Author: neal.norwitz Date: Mon Jan 5 04:57:25 2009 New Revision: 68338 Log: Make sure to checkout any new packages Modified: python/trunk/Misc/build.sh Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Mon Jan 5 04:57:25 2009 @@ -266,7 +266,7 @@ echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F err=1 else - make update html >& ../build/$F + make checkout update html >& ../build/$F err=$? fi update_status "Making doc" "$F" $start From python-checkins at python.org Mon Jan 5 05:08:06 2009 From: python-checkins at python.org (neal.norwitz) Date: Mon, 5 Jan 2009 05:08:06 +0100 (CET) Subject: [Python-checkins] r68339 - python/branches/release26-maint/Misc/build.sh Message-ID: <20090105040806.8D7291E4002@bag.python.org> Author: neal.norwitz Date: Mon Jan 5 05:08:06 2009 New Revision: 68339 Log: Backport r68338: Make sure to checkout any new packages Modified: python/branches/release26-maint/Misc/build.sh Modified: python/branches/release26-maint/Misc/build.sh ============================================================================== --- python/branches/release26-maint/Misc/build.sh (original) +++ python/branches/release26-maint/Misc/build.sh Mon Jan 5 05:08:06 2009 @@ -263,7 +263,7 @@ echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F err=1 else - make update html >& ../build/$F + make checkout update html >& ../build/$F err=$? fi update_status "Making doc" "$F" $start From nnorwitz at gmail.com Mon Jan 5 05:25:41 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 4 Jan 2009 23:25:41 -0500 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20090105042541.GA14088@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-2.6.1-docs-html tar -C dist -cf dist/python-2.6.1-docs-html.tar python-2.6.1-docs-html bzip2 -9 -k dist/python-2.6.1-docs-html.tar (cd dist; zip -q -r -9 python-2.6.1-docs-html.zip python-2.6.1-docs-html) rm -r dist/python-2.6.1-docs-html rm dist/python-2.6.1-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.6 (hg), building text loading pickled environment... done building [text]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-2.6.1-docs-text tar -C dist -cf dist/python-2.6.1-docs-text.tar python-2.6.1-docs-text bzip2 -9 -k dist/python-2.6.1-docs-text.tar (cd dist; zip -q -r -9 python-2.6.1-docs-text.zip python-2.6.1-docs-text) rm -r dist/python-2.6.1-docs-text rm dist/python-2.6.1-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.6 (hg), building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: refcounting#Py_INCREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: int#PyInt_FromLong WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: refcounting#Py_INCREF WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: list#PyList_New WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: exceptions#PyErr_SetString WARNING: unusable reference target found: exceptions#PyErr_Clear WARNING: unusable reference target found: exceptions#PyErr_ExceptionMatches WARNING: unusable reference target found: exceptions#PyErr_Clear WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_GetPath WARNING: unusable reference target found: init#Py_GetPrefix WARNING: unusable reference target found: init#Py_GetExecPrefix WARNING: unusable reference target found: init#Py_GetProgramFullPath WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_IsInitialized WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: veryhigh#Py_eval_input WARNING: unusable reference target found: veryhigh#Py_file_input WARNING: unusable reference target found: veryhigh#Py_single_input WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveLoop WARNING: unusable reference target found: veryhigh#PyRun_SimpleFile WARNING: unusable reference target found: veryhigh#PyRun_SimpleStringFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleStringFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveOneFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveLoopFlags WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseFileFlags WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyRun_StringFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_StringFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#Py_CompileStringFlags WARNING: unusable reference target found: veryhigh#Py_eval_input WARNING: unusable reference target found: veryhigh#Py_file_input WARNING: unusable reference target found: veryhigh#Py_single_input WARNING: unusable reference target found: veryhigh#PyEval_EvalCodeEx WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: refcounting#Py_XINCREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XINCREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: exceptions#PyErr_Restore WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: exceptions#PyErr_ExceptionMatches WARNING: unusable reference target found: exceptions#PyErr_Fetch WARNING: unusable reference target found: exceptions#PyErr_Fetch WARNING: unusable reference target found: exceptions#PyErr_SetString WARNING: unusable reference target found: exceptions#PyErr_CheckSignals WARNING: unusable reference target found: exceptions#PyErr_SetFromErrno WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErr WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErr WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErrWithFilename WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: exceptions#PyErr_Warn WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: exceptions#PyErr_CheckSignals WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: sys#Py_AtExit WARNING: unusable reference target found: import#PyImport_ImportModuleEx WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ImportModuleNoBlock WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ImportModuleLevel WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ExecCodeModule WARNING: unusable reference target found: import#PyImport_ReloadModule WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ExtendInittab WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: import#PyImport_ExtendInittab WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: marshal#PyMarshal_ReadObjectFromFile WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: structures#METH_OLDARGS WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_UnpackTuple WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: conversion#PyOS_snprintf WARNING: unusable reference target found: conversion#PyOS_vsnprintf WARNING: unusable reference target found: conversion#PyOS_ascii_strtod WARNING: unusable reference target found: reflection#PyEval_GetFuncName WARNING: unusable reference target found: list#PyList_New WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_IsInstance WARNING: unusable reference target found: object#PyObject_IsSubclass WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: object#PyObject_CallFunctionObjArgs WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: object#PyObject_CallMethodObjArgs WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: number#PyNumber_Coerce WARNING: unusable reference target found: number#PyNumber_Index WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: sequence#PySequence_Fast_GET_ITEM WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: sequence#PySequence_Fast_GET_SIZE WARNING: unusable reference target found: dict#PyDict_Check WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLong_AsVoidPtr WARNING: unusable reference target found: long#PyLong_FromVoidPtr WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: bytearray#PyByteArray_Size WARNING: unusable reference target found: bytearray#PyByteArray_AsString WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: string#PyString_FromFormat WARNING: unusable reference target found: string#PyString_Size WARNING: unusable reference target found: string#PyString_AsString WARNING: unusable reference target found: string#PyString_AsString WARNING: unusable reference target found: string#PyString_AsStringAndSize WARNING: unusable reference target found: string#PyString_FromString WARNING: unusable reference target found: string#PyString_InternInPlace WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF8 WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF32 WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF32Stateful WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF16 WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF16Stateful WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeMBCS WARNING: unusable reference target found: unicode#PyUnicode_DecodeMBCSStateful WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: typeobj#buffer-structs WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: buffer#PyBuffer_FromObject WARNING: unusable reference target found: buffer#PyBuffer_FromReadWriteObject WARNING: unusable reference target found: buffer#PyBufferObject WARNING: unusable reference target found: buffer#PyBuffer_Type WARNING: unusable reference target found: buffer#Py_END_OF_BUFFER WARNING: unusable reference target found: buffer#PyBuffer_FromObject WARNING: unusable reference target found: buffer#Py_END_OF_BUFFER WARNING: unusable reference target found: buffer#PyBuffer_FromMemory WARNING: unusable reference target found: objbuffer#PyObject_AsWriteBuffer WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: tuple#PyTuple_GetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: list#PyList_Size WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: dict#PyDict_GetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: mapping#PyMapping_Keys WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: type#typeobjects WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: function#PyFunction_Type WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: method#PyMethod_Type WARNING: unusable reference target found: method#PyMethod_Class WARNING: unusable reference target found: method#PyMethod_Function WARNING: unusable reference target found: method#PyMethod_Self WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFile_IncUseCount WARNING: unusable reference target found: file#PyFile_DecUseCount WARNING: unusable reference target found: file#PyFile_DecUseCount WARNING: unusable reference target found: file#PyFile_AsFile WARNING: unusable reference target found: file#PyFile_IncUseCount WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: module#PyModule_Type WARNING: unusable reference target found: iterator#PySeqIter_New WARNING: unusable reference target found: iterator#PySeqIter_Type WARNING: unusable reference target found: iterator#PyCallIter_New WARNING: unusable reference target found: iterator#PyCallIter_Type WARNING: unusable reference target found: slice#PySlice_GetIndicesEx WARNING: unusable reference target found: slice#PySlice_GetIndices WARNING: unusable reference target found: weakref#PyWeakref_GetObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: gen#PyGen_New WARNING: unusable reference target found: object#PyObject_CallMethod WARNING: unusable reference target found: object#PyObject_RichCompareBool WARNING: unusable reference target found: object#PyObject_Hash WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: object#PyObject_IsTrue WARNING: unusable reference target found: object#PyObject_Print WARNING: unusable reference target found: object#PyObject_GetIter WARNING: unusable reference target found: number#PyNumber_And WARNING: unusable reference target found: number#PyNumber_Subtract WARNING: unusable reference target found: number#PyNumber_Or WARNING: unusable reference target found: number#PyNumber_Xor WARNING: unusable reference target found: number#PyNumber_InPlaceAnd WARNING: unusable reference target found: number#PyNumber_InPlaceSubtract WARNING: unusable reference target found: number#PyNumber_InPlaceOr WARNING: unusable reference target found: number#PyNumber_InPlaceXor WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: dict#PyDictObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: set#PySet_Add WARNING: unusable reference target found: set#PySet_Size WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_AcquireLock WARNING: unusable reference target found: init#PySys_SetArgv WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_NewInterpreter WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_GetPath WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: sys#Py_FatalError WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#PyEval_SaveThread WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_AcquireLock WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_NewInterpreter WARNING: unusable reference target found: init#PyInterpreterState WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_SaveThread WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: sys#PyOS_AfterFork WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#PyInterpreterState_Clear WARNING: unusable reference target found: init#PyThreadState_Clear WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyEval_SetProfile WARNING: unusable reference target found: init#PyEval_SetTrace WARNING: unusable reference target found: init#PyTrace_CALL WARNING: unusable reference target found: init#PyTrace_EXCEPTION WARNING: unusable reference target found: init#PyTrace_LINE WARNING: unusable reference target found: init#PyTrace_RETURN WARNING: unusable reference target found: init#PyTrace_C_CALL WARNING: unusable reference target found: init#PyTrace_C_EXCEPTION WARNING: unusable reference target found: init#PyTrace_C_RETURN WARNING: unusable reference target found: init#PyTrace_CALL WARNING: unusable reference target found: init#PyTrace_EXCEPTION WARNING: unusable reference target found: init#PyTrace_LINE WARNING: unusable reference target found: init#PyTrace_RETURN WARNING: unusable reference target found: init#PyTrace_C_CALL WARNING: unusable reference target found: init#PyTrace_C_EXCEPTION WARNING: unusable reference target found: init#PyTrace_C_RETURN WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#PyEval_SetProfile WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#PyInterpreterState WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: memory#memoryoverview WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: allocation#PyObject_Del WARNING: unusable reference target found: allocation#PyObject_Init WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: allocation#Py_InitModule3 WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: structures#METH_KEYWORDS WARNING: unusable reference target found: structures#METH_KEYWORDS WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: allocation#Py_InitModule4 WARNING: unusable reference target found: allocation#Py_InitModule WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_UnpackTuple WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: structures#METH_NOARGS WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#METH_O WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: type#PyType_Type WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_name WARNING: unusable reference target found: typeobj#tp_name WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyObject_VAR_HEAD WARNING: unusable reference target found: typeobj#_ob_prev WARNING: unusable reference target found: typeobj#_ob_next WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: typeobj#Py_TPFLAGS_BASETYPE WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: allocation#PyObject_Del WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: object#PyObject_Print WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: object#PyObject_GetAttrString WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: object#PyObject_SetAttrString WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: object#PyObject_Compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: typeobj#number-structs WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#sequence-structs WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#mapping-structs WARNING: unusable reference target found: typeobj#tp_as_mapping WARNING: unusable reference target found: object#PyObject_Hash WARNING: unusable reference target found: object#PyObject_HashNotImplemented WARNING: unusable reference target found: object#PyObject_HashNotImplemented WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: object#PyObject_Call WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: object#PyObject_GetAttr WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: object#PyObject_SetAttr WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#buffer-structs WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#tp_as_mapping WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: type#PyType_HasFeature WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#sq_contains WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#sq_inplace_concat WARNING: unusable reference target found: typeobj#sq_inplace_repeat WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_iter WARNING: unusable reference target found: typeobj#tp_iternext WARNING: unusable reference target found: typeobj#tp_methods WARNING: unusable reference target found: typeobj#tp_members WARNING: unusable reference target found: typeobj#tp_getset WARNING: unusable reference target found: typeobj#tp_base WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_descr_get WARNING: unusable reference target found: typeobj#tp_descr_set WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_alloc WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: typeobj#tp_is_gc WARNING: unusable reference target found: typeobj#tp_bases WARNING: unusable reference target found: typeobj#tp_mro WARNING: unusable reference target found: typeobj#tp_cache WARNING: unusable reference target found: typeobj#tp_subclasses WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GETCHARBUFFER WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_SEQUENCE_IN WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_INPLACEOPS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_WEAKREFS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_ITER WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: refcounting#Py_CLEAR WARNING: unusable reference target found: refcounting#Py_CLEAR WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: object#PyObject_RichCompare WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_WEAKREFS WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: object#PyObject_GetIter WARNING: unusable reference target found: typeobj#tp_iter WARNING: unusable reference target found: iter#PyIter_Next WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: structures#PyMethodDef WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: structures#PyMemberDef WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#ob_refcnt WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: type#PyType_GenericAlloc WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_base WARNING: unusable reference target found: type#PyType_GenericAlloc WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: type#PyType_Type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_allocs WARNING: unusable reference target found: number#number WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: typeobj#nb_coerce WARNING: unusable reference target found: number#PyNumber_CoerceEx WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: mapping#PyMapping_Length WARNING: unusable reference target found: object#PyObject_Size WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: mapping#PyMapping_Check WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: object#PyObject_Size WARNING: unusable reference target found: sequence#PySequence_Concat WARNING: unusable reference target found: sequence#PySequence_Repeat WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: sequence#PySequence_Check WARNING: unusable reference target found: typeobj#sq_length WARNING: unusable reference target found: typeobj#sq_item WARNING: unusable reference target found: typeobj#sq_length WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: sequence#PySequence_Contains WARNING: unusable reference target found: sequence#PySequence_Contains WARNING: unusable reference target found: sequence#PySequence_InPlaceConcat WARNING: unusable reference target found: sequence#PySequence_InPlaceRepeat WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: typeobj#Py_TPFLAGS_DEFAULT WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: string#PyString_Type WARNING: unusable reference target found: buffer#PyBuffer_Type WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GETCHARBUFFER WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyType_HasFeature WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: gcsupport#PyObject_GC_UnTrack WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_NewVar WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#PyObject_GC_UnTrack WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#inquiry WARNING: unusable reference target found: refcounting#Py_DECREF done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... WARNING: unusable reference target found: setupscript#setup-script WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: setupscript#meta-data WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: commandref#sdist-cmd WARNING: unusable reference target found: setupscript#setup-script WARNING: unusable reference target found: configfile#setup-config WARNING: unusable reference target found: packageindex#pypirc WARNING: unusable reference target found: packageindex#pypirc WARNING: unusable reference target found: apiref#module-distutils.cmd WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#module-distutils.version WARNING: unusable reference target found: apiref#distutils.core.Extension WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#distutils.core.Extension WARNING: unusable reference target found: apiref#module-distutils.extension WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#module-distutils.cmd WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#module-distutils.dist WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_include_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_library_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.define_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.undefine_macro WARNING: unusable reference target found: apiref#distutils.util.split_quoted WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_link_object WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_link_objects WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_library_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.create_static_lib WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.create_static_lib WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.define_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.undefine_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.util.execute WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#distutils.file_util.move_file WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.dep_util.newer WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#module-distutils.file_util WARNING: unusable reference target found: apiref#distutils.file_util.copy_file WARNING: unusable reference target found: apiref#distutils.file_util.copy_file WARNING: unusable reference target found: apiref#distutils.util.get_platform WARNING: unusable reference target found: apiref#distutils.util.check_environ WARNING: unusable reference target found: apiref#distutils.util.byte_compile WARNING: unusable reference target found: apiref#distutils.fancy_getopt.fancy_getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.sysconfig.PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.EXEC_PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.EXEC_PREFIX WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.warn WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.close WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.warn WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.finalize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.run done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex resolving references... writing... WARNING: unusable reference target found: markup#doc-ref-role done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... WARNING: unusable reference target found: building#building WARNING: unusable reference target found: windows#building-on-windows WARNING: unusable reference target found: extending#methodtable WARNING: unusable reference target found: extending#parsetuple WARNING: unusable reference target found: extending#refcounts WARNING: unusable reference target found: extending#methodtable WARNING: unusable reference target found: extending#extending-simpleexample done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... WARNING: unusable reference target found: random#module-random WARNING: unusable reference target found: objects#builtin WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#unichr WARNING: unusable reference target found: functions#staticmethod WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: stdtypes#str.replace WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: functions#setattr WARNING: unusable reference target found: stdtypes#typesmapping WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#divmod WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#globals WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: stdtypes#types-set WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: functions#id WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: fileinput#module-fileinput WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: functions#chr WARNING: unusable reference target found: functions#unichr WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: sys#sys.stdout WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: stdtypes#types-set WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: stdtypes#typesseq-mutable WARNING: unusable reference target found: functions#classmethod WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: strings#stringservices WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#isinstance WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#chr WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: strings#stringservices WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#range WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#range WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: sys#sys.modules WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#intern WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: types#types.NoneType WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: constants#__debug__ WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: math#math.trunc WARNING: unusable reference target found: math#math.floor WARNING: unusable reference target found: math#math.ceil WARNING: unusable reference target found: functions#built-in-funcs WARNING: unusable reference target found: functions#divmod WARNING: unusable reference target found: functions#abs WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stdtypes#float.hex WARNING: unusable reference target found: stdtypes#float.fromhex WARNING: unusable reference target found: stdtypes#float.hex WARNING: unusable reference target found: stdtypes#float.fromhex WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: stdtypes#typesseq-mutable WARNING: unusable reference target found: stdtypes#str.join WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codec-base-classes WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codec-base-classes WARNING: unusable reference target found: codecs#standard-encodings WARNING: unusable reference target found: string#formatstrings WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: sets#comparison-to-builtin-set WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: contextlib#contextlib.closing WARNING: unusable reference target found: fcntl#module-fcntl WARNING: unusable reference target found: os#os.read WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: decimal#decimal.localcontext WARNING: unusable reference target found: contextlib#module-contextlib WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: code#module-code WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: types#module-types WARNING: unusable reference target found: constants#Ellipsis WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: exceptions#module-exceptions WARNING: unusable reference target found: exceptions#module-exceptions WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: exceptions#exceptions.GeneratorExit WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ZeroDivisionError WARNING: unusable reference target found: exceptions#exceptions.FloatingPointError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: sys#sys.setdefaultencoding WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: stdtypes#file.read WARNING: unusable reference target found: stdtypes#file.readline WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: errno#module-errno WARNING: unusable reference target found: exceptions#exceptions.MemoryError WARNING: unusable reference target found: weakref#weakref.proxy WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: weakref#weakref.ReferenceError WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.NameError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: string#string.ascii_lowercase WARNING: unusable reference target found: string#string.ascii_uppercase WARNING: unusable reference target found: string#string.lowercase WARNING: unusable reference target found: string#string.uppercase WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.upper WARNING: unusable reference target found: string#string.swapcase WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.digits WARNING: unusable reference target found: string#string.letters WARNING: unusable reference target found: string#string.punctuation WARNING: unusable reference target found: string#string.whitespace WARNING: unusable reference target found: string#string.lower WARNING: unusable reference target found: string#string.swapcase WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.strip WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: stdtypes#str.format WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#string.Formatter.format WARNING: unusable reference target found: string#string.Formatter.format WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.parse WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.get_value WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.get_value WARNING: unusable reference target found: string#string.Formatter.get_value WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: string#string.Formatter.check_unused_args WARNING: unusable reference target found: string#string.Formatter.format_field WARNING: unusable reference target found: string#string.Formatter.format WARNING: unusable reference target found: string#string.Formatter.get_field WARNING: unusable reference target found: string#string.Formatter.parse WARNING: unusable reference target found: stdtypes#str.format WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: ../@token#grammar-token-field_name WARNING: unusable reference target found: ../@token#grammar-token-conversion WARNING: unusable reference target found: ../@token#grammar-token-format_spec WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: ../@token#grammar-token-attribute_name WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: string#formatstrings WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: ../@token#grammar-token-fill WARNING: unusable reference target found: ../@token#grammar-token-align WARNING: unusable reference target found: ../@token#grammar-token-sign WARNING: unusable reference target found: ../@token#grammar-token-width WARNING: unusable reference target found: ../@token#grammar-token-precision WARNING: unusable reference target found: ../@token#grammar-token-type WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: string#string.Template.substitute WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: string#string.Template.substitute WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#string.Template.safe_substitute WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: re#re.escape WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.capitalize WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: string#string.translate WARNING: unusable reference target found: string#string.lowercase WARNING: unusable reference target found: string#string.uppercase WARNING: unusable reference target found: string#string.lower WARNING: unusable reference target found: string#string.upper WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: string#string.atoi WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: string#string.find WARNING: unusable reference target found: string#string.find WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#string.rfind WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.splitfields WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: string#string.joinfields WARNING: unusable reference target found: string#string.joinfields WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: re#re.DOTALL WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.I WARNING: unusable reference target found: re#re.L WARNING: unusable reference target found: re#re.M WARNING: unusable reference target found: re#re.S WARNING: unusable reference target found: re#re.U WARNING: unusable reference target found: re#re.X WARNING: unusable reference target found: re#contents-of-module-re WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.split WARNING: unusable reference target found: re#re.findall WARNING: unusable reference target found: re#re.finditer WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.subn WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.split WARNING: unusable reference target found: re#re.split WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.findall WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.findall WARNING: unusable reference target found: re#re.finditer WARNING: unusable reference target found: re#re.finditer WARNING: unusable reference target found: struct#struct.pack WARNING: unusable reference target found: struct#struct.unpack WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: struct#struct.pack WARNING: unusable reference target found: struct#struct.pack_into WARNING: unusable reference target found: struct#struct.unpack WARNING: unusable reference target found: struct#struct.unpack_from WARNING: unusable reference target found: struct#struct.Struct.format WARNING: unusable reference target found: filecmp#module-filecmp WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.HtmlDiff WARNING: unusable reference target found: difflib#difflib.HtmlDiff WARNING: unusable reference target found: difflib#difflib.HtmlDiff.make_file WARNING: unusable reference target found: stdtypes#file.readlines WARNING: unusable reference target found: stdtypes#file.writelines WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: difflib#difflib-interface WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.IS_LINE_JUNK WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.IS_CHARACTER_JUNK WARNING: unusable reference target found: difflib#difflib.Differ.compare WARNING: unusable reference target found: difflib#difflib.ndiff WARNING: unusable reference target found: stdtypes#file.readlines WARNING: unusable reference target found: stdtypes#file.writelines WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: difflib#difflib-interface WARNING: unusable reference target found: difflib#difflib.ndiff WARNING: unusable reference target found: difflib#difflib.ndiff WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.set_seq2 WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.set_seq1 WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.find_longest_match WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_opcodes WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_opcodes WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_matching_blocks WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_opcodes WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.quick_ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.real_quick_ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.quick_ratio WARNING: unusable reference target found: difflib#difflib.get_close_matches WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: stringio#StringIO.StringIO.getvalue WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO.close WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stringio#module-cStringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: textwrap#module-textwrap WARNING: unusable reference target found: textwrap#textwrap.wrap WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.dedent WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.wrap WARNING: unusable reference target found: textwrap#textwrap.wrap WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.break_long_words WARNING: unusable reference target found: textwrap#textwrap.dedent WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.expand_tabs WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.replace_whitespace WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.fix_sentence_endings WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.break_long_words WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: codecs#codecs.lookup WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.UnicodeEncodeError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.UnicodeDecodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeTranslateError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.BOM_UTF16 WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_BE WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_LE WARNING: unusable reference target found: codecs#codecs.BOM WARNING: unusable reference target found: codecs#codecs.BOM_UTF16 WARNING: unusable reference target found: codecs#codecs.BOM_LE WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_LE WARNING: unusable reference target found: codecs#codecs.BOM_BE WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_BE WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder.encode WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder.decode WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.StreamWriter.write WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.StreamReader.read WARNING: unusable reference target found: codecs#codecs.StreamReader.readline WARNING: unusable reference target found: codecs#codecs.StreamReader.read WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamReaderWriter WARNING: unusable reference target found: codecs#codecs.lookup WARNING: unusable reference target found: codecs#codecs.StreamReaderWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReaderWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamRecoder WARNING: unusable reference target found: codecs#codecs.lookup WARNING: unusable reference target found: codecs#codecs.StreamRecoder WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamRecoder WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: exceptions#exceptions.UnicodeEncodeError WARNING: unusable reference target found: codecs#module-encodings.idna WARNING: unusable reference target found: stringprep#module-stringprep WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: httplib#module-httplib WARNING: unusable reference target found: ftplib#module-ftplib WARNING: unusable reference target found: httplib#module-httplib WARNING: unusable reference target found: codecs#module-encodings.idna WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stringprep#module-stringprep WARNING: unusable reference target found: stringprep#module-stringprep WARNING: unusable reference target found: fpformat#module-fpformat WARNING: unusable reference target found: fpformat#module-fpformat WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: fpformat#module-fpformat WARNING: unusable reference target found: fpformat#fpformat.fix WARNING: unusable reference target found: fpformat#fpformat.sci WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: datetime#datetime.date.year WARNING: unusable reference target found: datetime#datetime.date.month WARNING: unusable reference target found: datetime#datetime.date.day WARNING: unusable reference target found: datetime#datetime.time.hour WARNING: unusable reference target found: datetime#datetime.time.minute WARNING: unusable reference target found: datetime#datetime.time.second WARNING: unusable reference target found: datetime#datetime.time.microsecond WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.year WARNING: unusable reference target found: datetime#datetime.datetime.month WARNING: unusable reference target found: datetime#datetime.datetime.day WARNING: unusable reference target found: datetime#datetime.datetime.hour WARNING: unusable reference target found: datetime#datetime.datetime.minute WARNING: unusable reference target found: datetime#datetime.datetime.second WARNING: unusable reference target found: datetime#datetime.datetime.microsecond WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: exceptions#exceptions.ZeroDivisionError WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.date.fromtimestamp WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date.isoweekday WARNING: unusable reference target found: datetime#datetime.date.weekday WARNING: unusable reference target found: datetime#datetime.date.isocalendar WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: datetime#datetime.date.ctime WARNING: unusable reference target found: datetime#strftime-behavior WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.now WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime.today WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.today WARNING: unusable reference target found: datetime#datetime.datetime.utcnow WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.now WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime.now WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime.utcfromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.timetz WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.utcoffset WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: datetime#datetime.datetime.isoweekday WARNING: unusable reference target found: datetime#datetime.datetime.weekday WARNING: unusable reference target found: datetime#datetime.datetime.isocalendar WARNING: unusable reference target found: datetime#datetime.datetime.microsecond WARNING: unusable reference target found: datetime#datetime.datetime.utcoffset WARNING: unusable reference target found: datetime#datetime.datetime.microsecond WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: datetime#datetime.datetime.ctime WARNING: unusable reference target found: datetime#strftime-behavior WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time.utcoffset WARNING: unusable reference target found: datetime#strftime-behavior WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.datetime.timetuple WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.tzname WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: calendar#calendar.Calendar WARNING: unusable reference target found: calendar#calendar.Calendar WARNING: unusable reference target found: calendar#calendar.Calendar WARNING: unusable reference target found: calendar#calendar.firstweekday WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: calendar#calendar.Calendar.itermonthdates WARNING: unusable reference target found: calendar#calendar.Calendar.itermonthdates WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: calendar#calendar.Calendar.yeardatescalendar WARNING: unusable reference target found: calendar#calendar.Calendar.yeardatescalendar WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: calendar#calendar.TextCalendar.formatmonth WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: calendar#calendar.TextCalendar.formatyear WARNING: unusable reference target found: calendar#calendar.HTMLCalendar WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: calendar#calendar.HTMLCalendar WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: calendar#calendar.month WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: calendar#calendar.calendar WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: calendar#calendar.timegm WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: collections#collections.deque WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: collections#collections.namedtuple WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: collections#collections.namedtuple WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#bsddb.btopen WARNING: unusable reference target found: abc#module-abc WARNING: unusable reference target found: collections#collections.deque.append WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: collections#collections.deque WARNING: unusable reference target found: collections#collections.deque WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: collections#collections.defaultdict.__missing__ WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict.setdefault WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: itertools#itertools.repeat WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: keyword#module-keyword WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: heapq#heapq.heapify WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: heapq#heapq.heappush WARNING: unusable reference target found: heapq#heapq.heappop WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: heapq#heapq.heappop WARNING: unusable reference target found: heapq#heapq.heappush WARNING: unusable reference target found: functions#sorted WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: bisect#module-bisect WARNING: unusable reference target found: bisect#bisect.bisect_left WARNING: unusable reference target found: bisect#bisect.bisect_right WARNING: unusable reference target found: bisect#bisect.insort_left WARNING: unusable reference target found: bisect#bisect.insort_right WARNING: unusable reference target found: bisect#bisect.bisect WARNING: unusable reference target found: bisect#bisect.bisect WARNING: unusable reference target found: array#array.array WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: array#array.array.read WARNING: unusable reference target found: array#array.array.fromfile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: array#array.array.fromfile WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: array#array.array.read WARNING: unusable reference target found: array#array.array.tofile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: array#array.array.tofile WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: array#array.array WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#immutable-transforms WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#immutable-transforms WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#sorted WARNING: unusable reference target found: sched#module-sched WARNING: unusable reference target found: sched#sched.scheduler WARNING: unusable reference target found: sched#sched.scheduler WARNING: unusable reference target found: threading#threading.Timer WARNING: unusable reference target found: sched#sched.scheduler WARNING: unusable reference target found: sched#sched.scheduler.cancel WARNING: unusable reference target found: sched#sched.scheduler.enterabs WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: sched#sched.scheduler.run WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: mutex#mutex.mutex.lock WARNING: unusable reference target found: mutex#mutex.mutex WARNING: unusable reference target found: mutex#mutex.mutex.unlock WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: heapq#module-heapq WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.LifoQueue WARNING: unusable reference target found: queue#Queue.PriorityQueue WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Queue.get WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.join WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.put WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#hash WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: weakref#weakref.ref WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.ReferenceError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: weakref#weakref.ref WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.ref WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#module-UserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: stdtypes#typesmapping WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.IterableUserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: userdict#module-UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList.data WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.MutableString WARNING: unusable reference target found: userdict#UserString.MutableString WARNING: unusable reference target found: userdict#module-UserString WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.MutableString WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: types#module-types WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#slice WARNING: unusable reference target found: functions#slice WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: new#module-new WARNING: unusable reference target found: types#module-types WARNING: unusable reference target found: new#module-new WARNING: unusable reference target found: new#module-new WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: stdtypes#dict.copy WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pprint#module-pprint WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: pprint#module-pprint WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.saferepr WARNING: unusable reference target found: functions#id WARNING: unusable reference target found: pprint#pprint.PrettyPrinter.format WARNING: unusable reference target found: pprint#pprint.pprint WARNING: unusable reference target found: repr#module-repr WARNING: unusable reference target found: repr#module-repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: repr#repr.Repr.maxdict WARNING: unusable reference target found: repr#repr.Repr.maxarray WARNING: unusable reference target found: repr#repr.Repr.maxset WARNING: unusable reference target found: repr#repr.Repr.maxfrozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: repr#repr.Repr.maxstring WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: repr#repr.Repr.repr1 WARNING: unusable reference target found: repr#repr.Repr.repr1 WARNING: unusable reference target found: repr#repr.Repr.repr1 WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: math#module-math WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: numbers#numbers.Complex.real WARNING: unusable reference target found: numbers#numbers.Complex.imag WARNING: unusable reference target found: functions#abs WARNING: unusable reference target found: numbers#numbers.Complex.conjugate WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#round WARNING: unusable reference target found: math#math.floor WARNING: unusable reference target found: math#math.ceil WARNING: unusable reference target found: functions#divmod WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: numbers#numbers.Complex.real WARNING: unusable reference target found: numbers#numbers.Complex.imag WARNING: unusable reference target found: numbers#numbers.Complex.conjugate WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Rational.numerator WARNING: unusable reference target found: numbers#numbers.Rational.denominator WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: numbers#numbers.Rational WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: numbers#numbers.Rational.numerator WARNING: unusable reference target found: numbers#numbers.Rational.denominator WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: functions#hash WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Integral WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: constants#NotImplemented WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: math#math.fmod WARNING: unusable reference target found: math#math.frexp WARNING: unusable reference target found: math#math.frexp WARNING: unusable reference target found: math#math.modf WARNING: unusable reference target found: math#math.ceil WARNING: unusable reference target found: math#math.floor WARNING: unusable reference target found: math#math.modf WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: math#math.atan2 WARNING: unusable reference target found: math#module-math WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: cmath#cmath.phase WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: cmath#cmath.acos WARNING: unusable reference target found: cmath#cmath.log WARNING: unusable reference target found: cmath#cmath.log WARNING: unusable reference target found: math#module-math WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: decimal#decimal.Clamped WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Subnormal WARNING: unusable reference target found: decimal#decimal.Overflow WARNING: unusable reference target found: decimal#decimal.Underflow WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.BasicContext WARNING: unusable reference target found: decimal#decimal.ExtendedContext WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal.compare WARNING: unusable reference target found: decimal#decimal.Decimal.compare WARNING: unusable reference target found: decimal#decimal.Decimal.compare WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal.compare_total WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.Decimal.logical_and WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: decimal#decimal.Decimal.logical_invert WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: decimal#decimal.Decimal.logical_or WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: decimal#decimal.Decimal.logical_xor WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal.to_integral_value WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.localcontext WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Subnormal WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: decimal#decimal.DefaultContext WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Context.Etiny WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: exceptions#exceptions.ArithmeticError WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Subnormal WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.Overflow WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Context.create_decimal WARNING: unusable reference target found: fractions#module-fractions WARNING: unusable reference target found: numbers#numbers.Integral WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: exceptions#exceptions.ZeroDivisionError WARNING: unusable reference target found: numbers#numbers.Rational WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: numbers#numbers.Rational WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: random#random.random WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: random#random.random WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.getstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: random#random.getrandbits WARNING: unusable reference target found: random#random.randrange WARNING: unusable reference target found: random#random.getrandbits WARNING: unusable reference target found: random#module-random WARNING: unusable reference target found: random#random.WichmannHill WARNING: unusable reference target found: os#os.urandom WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.getstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: random#random.getrandbits WARNING: unusable reference target found: random#random.randrange WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: random#random.random WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: random#random.normalvariate WARNING: unusable reference target found: random#random.whseed WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.whseed WARNING: unusable reference target found: os#os.urandom WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: random#random.getstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.count WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: itertools#itertools.chain WARNING: unusable reference target found: itertools#itertools.combinations WARNING: unusable reference target found: itertools#itertools.permutations WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.islice WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: itertools#itertools.izip_longest WARNING: unusable reference target found: itertools#itertools.izip_longest WARNING: unusable reference target found: itertools#itertools.islice WARNING: unusable reference target found: itertools#itertools.takewhile WARNING: unusable reference target found: itertools#itertools.permutations WARNING: unusable reference target found: itertools#itertools.product WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.starmap WARNING: unusable reference target found: itertools#itertools.starmap WARNING: unusable reference target found: itertools#itertools.tee WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: itertools#itertools.tee WARNING: unusable reference target found: functools#module-functools WARNING: unusable reference target found: functools#module-functools WARNING: unusable reference target found: functions#reduce WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial.func WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: functions#cmp WARNING: unusable reference target found: operator#operator.__not__ WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: operator#operator.invert WARNING: unusable reference target found: operator#operator.__invert__ WARNING: unusable reference target found: operator#operator.__contains__ WARNING: unusable reference target found: operator#operator.delitem WARNING: unusable reference target found: operator#operator.getitem WARNING: unusable reference target found: operator#operator.contains WARNING: unusable reference target found: operator#operator.contains WARNING: unusable reference target found: operator#operator.setitem WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: operator#operator.isCallable WARNING: unusable reference target found: functions#callable WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#sorted WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#operator.itemgetter WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os.path#os.path.splitunc WARNING: unusable reference target found: os.path#os.path.ismount WARNING: unusable reference target found: os.path#os.path.basename WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os.path#os.path.exists WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: pwd#module-pwd WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os.path#os.path.islink WARNING: unusable reference target found: os.path#os.path.isfile WARNING: unusable reference target found: os.path#os.path.islink WARNING: unusable reference target found: os.path#os.path.isdir WARNING: unusable reference target found: os.path#os.path.normcase WARNING: unusable reference target found: os#os.curdir WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os.path#os.path.samefile WARNING: unusable reference target found: os.path#os.path.sameopenfile WARNING: unusable reference target found: os.path#os.path.walk WARNING: unusable reference target found: os.path#os.path.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: fileinput#fileinput.input WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.input WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.filename WARNING: unusable reference target found: fileinput#fileinput.fileno WARNING: unusable reference target found: fileinput#fileinput.lineno WARNING: unusable reference target found: fileinput#fileinput.filelineno WARNING: unusable reference target found: fileinput#fileinput.isfirstline WARNING: unusable reference target found: fileinput#fileinput.isstdin WARNING: unusable reference target found: fileinput#fileinput.nextfile WARNING: unusable reference target found: fileinput#fileinput.close WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: fileinput#fileinput.input WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: codecs#codecs.open WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: statvfs#module-statvfs WARNING: unusable reference target found: statvfs#module-statvfs WARNING: unusable reference target found: os#os.statvfs WARNING: unusable reference target found: os#os.statvfs WARNING: unusable reference target found: filecmp#module-filecmp WARNING: unusable reference target found: difflib#module-difflib WARNING: unusable reference target found: filecmp#module-filecmp WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: filecmp#filecmp.cmp WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: filecmp#filecmp.dircmp.common_dirs WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: tempfile#tempfile.NamedTemporaryFile WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: os#os.O_EXCL WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: tempfile#tempfile.NamedTemporaryFile WARNING: unusable reference target found: tempfile#tempfile.tempdir WARNING: unusable reference target found: tempfile#tempfile.gettempprefix WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: fnmatch#fnmatch.fnmatch WARNING: unusable reference target found: os.path#os.path.expanduser WARNING: unusable reference target found: os.path#os.path.expandvars WARNING: unusable reference target found: glob#glob.glob WARNING: unusable reference target found: glob#glob.glob WARNING: unusable reference target found: fnmatch#module-fnmatch WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: fnmatch#fnmatch.fnmatch WARNING: unusable reference target found: fnmatch#fnmatch.fnmatchcase WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: linecache#module-linecache WARNING: unusable reference target found: traceback#module-traceback WARNING: unusable reference target found: linecache#module-linecache WARNING: unusable reference target found: linecache#linecache.getline WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.copy2 WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.Error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.copystat WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.copystat WARNING: unusable reference target found: shutil#shutil.copy2 WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.ignore_patterns WARNING: unusable reference target found: shutil#shutil.Error WARNING: unusable reference target found: shutil#shutil.Error WARNING: unusable reference target found: shutil#shutil.copystat WARNING: unusable reference target found: os.path#os.path.islink WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: os#os.remove WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: shutil#shutil.copy2 WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.ignore_patterns WARNING: unusable reference target found: dircache#module-dircache WARNING: unusable reference target found: dircache#module-dircache WARNING: unusable reference target found: dircache#module-dircache WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: dircache#dircache.listdir WARNING: unusable reference target found: dircache#dircache.listdir WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.Pickler.clear_memo WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Pickler.clear_memo WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#pickle-protocol WARNING: unusable reference target found: pickle#pickle.Unpickler.noload WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.Unpickler.noload WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#pickle-protocol WARNING: unusable reference target found: pickle#pickle.PicklingError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: sys#sys.setrecursionlimit WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#pickle-sub WARNING: unusable reference target found: pickle#object.__getinitargs__ WARNING: unusable reference target found: pickle#object.__getinitargs__ WARNING: unusable reference target found: pickle#object.__getnewargs__ WARNING: unusable reference target found: pickle#object.__getnewargs__ WARNING: unusable reference target found: pickle#object.__getnewargs__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#pickle-inst WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#pickle-sub WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: anydbm#anydbm.open WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#bsddb.hashopen WARNING: unusable reference target found: bsddb#bsddb.btopen WARNING: unusable reference target found: bsddb#bsddb.rnopen WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: anydbm#anydbm.open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: marshal#marshal.load WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: marshal#marshal.dump WARNING: unusable reference target found: marshal#marshal.load WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: anydbm#anydbm.error WARNING: unusable reference target found: anydbm#anydbm.error WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: gdbm#gdbm.error WARNING: unusable reference target found: gdbm#gdbm.nextkey WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: dbhash#dbhash.dbhash.previous WARNING: unusable reference target found: dbhash#dbhash.dbhash.last WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: marshal#marshal.dumps WARNING: unusable reference target found: pickle#pickle.dumps WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#bsddb.btopen WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: bsddb#bsddb.hashopen WARNING: unusable reference target found: bsddb#bsddb.hashopen WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: dumbdbm#dumbdbm.dumbdbm.sync WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.fetchone WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.fetchall WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.description WARNING: unusable reference target found: sqlite3#sqlite3.Connection.isolation_level WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.register_converter WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_DECLTYPES WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_COLNAMES WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#sqlite3-types WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3-controlling-transactions WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Connection.commit WARNING: unusable reference target found: sqlite3#sqlite3.Connection.commit WARNING: unusable reference target found: sqlite3#sqlite3.Connection.commit WARNING: unusable reference target found: sqlite3#sqlite3.Connection.execute WARNING: unusable reference target found: sqlite3#sqlite3.Connection.executemany WARNING: unusable reference target found: sqlite3#sqlite3.Connection.executescript WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3.Connection.row_factory WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.executescript WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.fetchmany WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.rowcount WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.executemany WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.rowcount WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.rowcount WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.executemany WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.lastrowid WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: sqlite3#sqlite3.Connection.row_factory WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.description WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: sqlite3#sqlite3.Connection.text_factory WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.register_adapter WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3-module-contents WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_DECLTYPES WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_COLNAMES WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zlib#zlib.error WARNING: unusable reference target found: zlib#zlib.error WARNING: unusable reference target found: zlib#zlib.compress WARNING: unusable reference target found: zlib#zlib.Compress.flush WARNING: unusable reference target found: zlib#zlib.compress WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.Decompress.unused_data WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.Decompress.unconsumed_tail WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.Decompress.unconsumed_tail WARNING: unusable reference target found: zlib#zlib.Decompress.flush WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2Compressor WARNING: unusable reference target found: bz2#bz2.BZ2Decompressor WARNING: unusable reference target found: bz2#bz2.compress WARNING: unusable reference target found: bz2#bz2.decompress WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: bz2#bz2.BZ2File.close WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: bz2#bz2.BZ2File.close WARNING: unusable reference target found: bz2#bz2.BZ2Compressor WARNING: unusable reference target found: bz2#bz2.BZ2Decompressor WARNING: unusable reference target found: bz2#bz2.compress WARNING: unusable reference target found: bz2#bz2.BZ2Compressor.flush WARNING: unusable reference target found: bz2#bz2.decompress WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: bz2#bz2.compress WARNING: unusable reference target found: bz2#bz2.decompress WARNING: unusable reference target found: bz2#bz2.BZ2Compressor WARNING: unusable reference target found: bz2#bz2.BZ2Decompressor WARNING: unusable reference target found: zipfile#zipinfo-objects WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zipfile#zipfile-objects WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#zipinfo-objects WARNING: unusable reference target found: zipfile#zipfile.ZIP_STORED WARNING: unusable reference target found: zipfile#zipfile.ZIP_DEFLATED WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZIP_DEFLATED WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZIP_STORED WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#zipfile.ZipFile.close WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.getinfo WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.read WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: zipfile#zipfile.ZipFile.open WARNING: unusable reference target found: zipfile#zipfile.ZipFile.open WARNING: unusable reference target found: zipfile#zipfile.ZipFile.open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: zipfile#zipfile.ZipFile.read WARNING: unusable reference target found: zipfile#zipfile.ZipFile.extract WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.namelist WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.setpassword WARNING: unusable reference target found: zipfile#zipfile.ZipFile.read WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.testzip WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.write WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.write WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.write WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.writestr WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.writestr WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZIP_STORED WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: zipfile#zipfile.ZipFile.close WARNING: unusable reference target found: zipfile#zipfile.PyZipFile WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.PyZipFile.writepy WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile-objects WARNING: unusable reference target found: tarfile#tarfile.ReadError WARNING: unusable reference target found: tarfile#tarfile.CompressionError WARNING: unusable reference target found: tarfile#tarfile.open WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tar-examples WARNING: unusable reference target found: tarfile#tarfile.open WARNING: unusable reference target found: tarfile#tarfile-objects WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: tarfile#tarfile.TarFileCompat WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarFile.extract WARNING: unusable reference target found: tarfile#tarfile.TarInfo.frombuf WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tar-formats WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: sys#sys.getfilesystemencoding WARNING: unusable reference target found: sys#sys.getdefaultencoding WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarinfo-objects WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.USTAR_FORMAT WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarFile.extract WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: tarfile#tarfile.TarError WARNING: unusable reference target found: tarfile#tar-unicode WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: tarfile#tarfile.open WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.getmembers WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: tarfile#tarfile.TarFile.getmembers WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.extract WARNING: unusable reference target found: tarfile#tarfile.TarFile.extractall WARNING: unusable reference target found: tarfile#tarfile.TarFile.extractall WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.gettarinfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.addfile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.USTAR_FORMAT WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.HeaderError WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarInfo.isfile WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarFile.extractall WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tarfile.USTAR_FORMAT WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: sys#sys.getfilesystemencoding WARNING: unusable reference target found: sys#sys.getdefaultencoding WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: codecs#codec-base-classes WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.DictReader WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv-examples WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.list_dialects WARNING: unusable reference target found: csv#csv-fmt-params WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.list_dialects WARNING: unusable reference target found: csv#csv-fmt-params WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv-fmt-params WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.DictReader WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.excel WARNING: unusable reference target found: csv#csv.excel_tab WARNING: unusable reference target found: csv#csv.Sniffer WARNING: unusable reference target found: csv#csv.Sniffer WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: csv#csv.Sniffer WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.QUOTE_NONE WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv-contents WARNING: unusable reference target found: csv#csv.QUOTE_MINIMAL WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: csv#csv.DictReader WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: configparser#module-ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser.get WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser.items WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.MAX_INTERPOLATION_DEPTH WARNING: unusable reference target found: configparser#ConfigParser.InterpolationError WARNING: unusable reference target found: configparser#ConfigParser.InterpolationError WARNING: unusable reference target found: configparser#ConfigParser.InterpolationError WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: shlex#module-shlex WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.DuplicateSectionError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser.readfp WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser.read WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: configparser#ConfigParser.NoSectionError WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser.read WARNING: unusable reference target found: configparser#ConfigParser.NoSectionError WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser.get WARNING: unusable reference target found: configparser#ConfigParser.SafeConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.NoSectionError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.SafeConfigParser WARNING: unusable reference target found: robotparser#module-robotparser WARNING: unusable reference target found: robotparser#robotparser.RobotFileParser WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.NetrcParseError WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_string WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_string WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_farray WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.get_position WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.set_position WARNING: unusable reference target found: xdrlib#xdrlib.Error WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_float WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_string WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_string WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_farray WARNING: unusable reference target found: xdrlib#xdrlib.Error WARNING: unusable reference target found: xdrlib#xdrlib.Error WARNING: unusable reference target found: plistlib#plistlib.Data WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: plistlib#plistlib.Data WARNING: unusable reference target found: plistlib#plistlib.Data WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: hashlib#hashlib.hash.update WARNING: unusable reference target found: hashlib#hashlib.digest_size WARNING: unusable reference target found: hashlib#hashlib.hash.digest WARNING: unusable reference target found: hmac#module-hmac WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: hmac#hmac.hmac.update WARNING: unusable reference target found: hmac#hmac.hmac.digest WARNING: unusable reference target found: hashlib#module-hashlib WARNING: unusable reference target found: hashlib#module-hashlib WARNING: unusable reference target found: md5#md5.new WARNING: unusable reference target found: md5#md5.new WARNING: unusable reference target found: md5#md5.new WARNING: unusable reference target found: md5#md5.md5.update WARNING: unusable reference target found: md5#md5.md5.digest WARNING: unusable reference target found: sha#module-sha WARNING: unusable reference target found: hashlib#module-hashlib WARNING: unusable reference target found: md5#module-md5 WARNING: unusable reference target found: sha#sha.new WARNING: unusable reference target found: sha#sha.new WARNING: unusable reference target found: sha#sha.sha.update WARNING: unusable reference target found: sha#sha.sha.digest WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: fileinput#module-fileinput WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os-file-dir WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: socket#socket.gethostname WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: os#os.close WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: popen2#popen2-flow-control WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: popen2#module-popen2 WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.pipe WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: os#os.close WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: errno#errno.EINVAL WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.statvfs WARNING: unusable reference target found: os#os.SEEK_SET WARNING: unusable reference target found: os#os.SEEK_CUR WARNING: unusable reference target found: os#os.SEEK_END WARNING: unusable reference target found: os#os.O_RDONLY WARNING: unusable reference target found: os#os.O_WRONLY WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.read WARNING: unusable reference target found: os#os.write WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: pty#module-pty WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.pipe WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: sys#sys.stdin WARNING: unusable reference target found: os#os.read WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.pipe WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: sys#sys.stdout WARNING: unusable reference target found: sys#sys.stderr WARNING: unusable reference target found: os#os.write WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.lseek WARNING: unusable reference target found: os#os.F_OK WARNING: unusable reference target found: os#os.R_OK WARNING: unusable reference target found: os#os.W_OK WARNING: unusable reference target found: os#os.X_OK WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: os#os.chflags WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.unlink WARNING: unusable reference target found: os#os.mkfifo WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.makedev WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: os#os.mkdir WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.makedirs WARNING: unusable reference target found: os#os.pardir WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: errno#errno.EINVAL WARNING: unusable reference target found: os#os.pathconf WARNING: unusable reference target found: os#os.fpathconf WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: os#os.unlink WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: os#os.removedirs WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.rename WARNING: unusable reference target found: os#os.removedirs WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: statvfs#module-statvfs WARNING: unusable reference target found: os#os.tempnam WARNING: unusable reference target found: os#os.tempnam WARNING: unusable reference target found: os#os.tmpfile WARNING: unusable reference target found: os#os-newstreams WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.tmpfile WARNING: unusable reference target found: os#os-newstreams WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.remove WARNING: unusable reference target found: os#os.unlink WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: signal#signal.signal WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.fsync WARNING: unusable reference target found: os#os.execlp WARNING: unusable reference target found: os#os.execlpe WARNING: unusable reference target found: os#os.execvp WARNING: unusable reference target found: os#os.execvpe WARNING: unusable reference target found: os#os.execl WARNING: unusable reference target found: os#os.execle WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.execve WARNING: unusable reference target found: os#os.execle WARNING: unusable reference target found: os#os.execlpe WARNING: unusable reference target found: os#os.execve WARNING: unusable reference target found: os#os.execvpe WARNING: unusable reference target found: os#os.execl WARNING: unusable reference target found: os#os.execlp WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.execvp WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: pty#module-pty WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: os#os-newstreams WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: os#os.P_NOWAIT WARNING: unusable reference target found: os#os.P_WAIT WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnlpe WARNING: unusable reference target found: os#os.spawnvp WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.spawnl WARNING: unusable reference target found: os#os.spawnle WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.spawnve WARNING: unusable reference target found: os#os.spawnle WARNING: unusable reference target found: os#os.spawnlpe WARNING: unusable reference target found: os#os.spawnve WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.spawnl WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.spawnvp WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnlpe WARNING: unusable reference target found: os#os.spawnvp WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.P_DETACH WARNING: unusable reference target found: os#os.P_NOWAIT WARNING: unusable reference target found: os#os.P_OVERLAY WARNING: unusable reference target found: os#os.startfile WARNING: unusable reference target found: os.path#os.path.normpath WARNING: unusable reference target found: os#os.environ WARNING: unusable reference target found: sys#sys.stdin WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.P_NOWAIT WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: resource#module-resource WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.wait4 WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: resource#module-resource WARNING: unusable reference target found: os#os.wait4 WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: errno#errno.EINVAL WARNING: unusable reference target found: os#os.confstr WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.confstr WARNING: unusable reference target found: os#os.sysconf WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#os.path.split WARNING: unusable reference target found: os.path#os.path.join WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: io#module-io WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedRWPair WARNING: unusable reference target found: io#io.BufferedRandom WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.StringIO WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: os#os.linesep WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedRandom WARNING: unusable reference target found: io#io.StringIO WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: io#io.IOBase.seek WARNING: unusable reference target found: io#io.IOBase.tell WARNING: unusable reference target found: io#io.IOBase.truncate WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase.tell WARNING: unusable reference target found: io#io.IOBase.truncate WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedIOBase.read WARNING: unusable reference target found: io#io.BufferedIOBase.readinto WARNING: unusable reference target found: io#io.BufferedIOBase.read WARNING: unusable reference target found: io#io.BufferedIOBase.readinto WARNING: unusable reference target found: io#io.BufferedIOBase.write WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BufferedIOBase.read WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.DEFAULT_BUFFER_SIZE WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.DEFAULT_BUFFER_SIZE WARNING: unusable reference target found: io#io.BufferedRWPair WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.DEFAULT_BUFFER_SIZE WARNING: unusable reference target found: io#io.BufferedRandom WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: locale#locale.getpreferredencoding WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: os#os.linesep WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.StringIO WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.asctime WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.asctime WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: calendar#calendar.timegm WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.tzset WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: getopt#module-getopt WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-extending-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-extending-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-reference-guide WARNING: unusable reference target found: optparse#optparse-option-callbacks WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: constants#exit WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-conflicts-between-options WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-tutorial WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#optparse-option-callbacks WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-option-callbacks WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#optparse-tutorial WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-extending-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: getopt#getopt.GetoptError WARNING: unusable reference target found: getopt#getopt.getopt WARNING: unusable reference target found: getopt#getopt.getopt WARNING: unusable reference target found: getopt#getopt.GetoptError WARNING: unusable reference target found: getopt#getopt.error WARNING: unusable reference target found: getopt#getopt.GetoptError WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.log WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.Logger.setLevel WARNING: unusable reference target found: logging#logging.Logger.addFilter WARNING: unusable reference target found: logging#logging.Logger.removeFilter WARNING: unusable reference target found: logging#logging.Logger.debug WARNING: unusable reference target found: logging#logging.Logger.info WARNING: unusable reference target found: logging#logging.Logger.warning WARNING: unusable reference target found: logging#logging.Logger.error WARNING: unusable reference target found: logging#logging.Logger.critical WARNING: unusable reference target found: logging#logging.Logger.exception WARNING: unusable reference target found: logging#logging.Logger.error WARNING: unusable reference target found: logging#logging.Logger.exception WARNING: unusable reference target found: logging#logging.Logger.log WARNING: unusable reference target found: logging#logging.getLogger WARNING: unusable reference target found: logging#logging.getLogger WARNING: unusable reference target found: logging#logging.Handler.setLevel WARNING: unusable reference target found: logging#formatter-objects WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.setLoggerClass WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.addLevelName WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.Logger.getEffectiveLevel WARNING: unusable reference target found: logging#logging.Logger.setLevel WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: functions#filter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.exception WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.log WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: socketserver#module-SocketServer WARNING: unusable reference target found: logging#logging.Handler.__init__ WARNING: unusable reference target found: logging#logging.Handler.createLock WARNING: unusable reference target found: logging#logging.Handler.createLock WARNING: unusable reference target found: logging#logging.Handler.acquire WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.shutdown WARNING: unusable reference target found: logging#logging.Handler.close WARNING: unusable reference target found: logging#logging.Handler.emit WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: logging#logging.handlers.StreamHandler WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.handlers.StreamHandler WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: logging#logging.handlers.StreamHandler.flush WARNING: unusable reference target found: logging#logging.handlers.StreamHandler.flush WARNING: unusable reference target found: logging#logging.handlers.FileHandler WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.handlers.StreamHandler WARNING: unusable reference target found: logging#logging.handlers.FileHandler WARNING: unusable reference target found: logging#logging.handlers.FileHandler.emit WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.FileHandler WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler.emit WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler.emit WARNING: unusable reference target found: logging#logging.handlers.TimedRotatingFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.TimedRotatingFileHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler.emit WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: logging#logging.handlers.DatagramHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#logging.handlers.DatagramHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: logging#logging.handlers.SysLogHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SysLogHandler WARNING: unusable reference target found: logging#logging.handlers.NTEventLogHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.NTEventLogHandler WARNING: unusable reference target found: logging#logging.handlers.SMTPHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SMTPHandler WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.BufferingHandler WARNING: unusable reference target found: logging#logging.handlers.BufferingHandler.shouldFlush WARNING: unusable reference target found: logging#logging.handlers.BufferingHandler.flush WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler.setTarget WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler.flush WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.HTTPHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.HTTPHandler WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter.formatTime WARNING: unusable reference target found: logging#logging.Formatter.formatException WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter.format WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.exception WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.log WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.fileConfig WARNING: unusable reference target found: logging#logging.stopListening WARNING: unusable reference target found: logging#logging.listen WARNING: unusable reference target found: logging#logging.listen WARNING: unusable reference target found: logging#logging.fileConfig WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: getpass#module-getpass WARNING: unusable reference target found: getpass#getpass.GetPassWarning WARNING: unusable reference target found: exceptions#exceptions.UserWarning WARNING: unusable reference target found: pwd#module-pwd WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: stdtypes#str.encode WARNING: unusable reference target found: curses.ascii#module-curses.ascii WARNING: unusable reference target found: curses.panel#module-curses.panel WARNING: unusable reference target found: curses#module-curses.textpad WARNING: unusable reference target found: curses#module-curses.wrapper WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.raw WARNING: unusable reference target found: curses#curses.cbreak WARNING: unusable reference target found: curses#curses.pair_number WARNING: unusable reference target found: curses#curses.reset_prog_mode WARNING: unusable reference target found: curses#curses.reset_shell_mode WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: functions#filter WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.beep WARNING: unusable reference target found: curses#curses.nocbreak WARNING: unusable reference target found: curses#curses.init_color WARNING: unusable reference target found: curses#curses.can_change_color WARNING: unusable reference target found: curses#curses.endwin WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.noqiflush WARNING: unusable reference target found: curses#curses.color_pair WARNING: unusable reference target found: curses#curses.noqiflush WARNING: unusable reference target found: curses#curses.def_prog_mode WARNING: unusable reference target found: curses#curses.def_shell_mode WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.start_color WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.newwin WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: curses#curses.window.border WARNING: unusable reference target found: curses#curses.window.touchline WARNING: unusable reference target found: curses#curses.window.erase WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.clrtoeol WARNING: unusable reference target found: curses#curses.window.derwin WARNING: unusable reference target found: curses#curses.window.subwin WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.instr WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.error WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses#curses.window.overlay WARNING: unusable reference target found: curses#curses.window.overwrite WARNING: unusable reference target found: curses#curses.getwin WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.newpad WARNING: unusable reference target found: curses#curses.window.idlok WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.syncup WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.ERR WARNING: unusable reference target found: curses#curses.napms WARNING: unusable reference target found: curses#curses.OK WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#module-curses.textpad WARNING: unusable reference target found: curses#curses.textpad.Textbox WARNING: unusable reference target found: curses#module-curses.textpad WARNING: unusable reference target found: curses#curses.textpad.Textbox WARNING: unusable reference target found: curses#curses.textpad.Textbox.stripspaces WARNING: unusable reference target found: curses#curses.textpad.Textbox WARNING: unusable reference target found: curses#curses.textpad.Textbox.stripspaces WARNING: unusable reference target found: curses#curses.textpad.Textbox.stripspaces WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses.ascii#module-curses.ascii WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: curses.panel#module-curses.panel WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses.panel#curses.panel.new_panel WARNING: unusable reference target found: platform#platform.system_alias WARNING: unusable reference target found: platform#platform.machine WARNING: unusable reference target found: os#os.uname WARNING: unusable reference target found: platform#platform.popen WARNING: unusable reference target found: platform#platform.linux_distribution WARNING: unusable reference target found: os#os.strerror WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: ctypes#ctypes.c_wchar WARNING: unusable reference target found: ctypes#ctypes.c_byte WARNING: unusable reference target found: ctypes#ctypes.c_ubyte WARNING: unusable reference target found: ctypes#ctypes.c_short WARNING: unusable reference target found: ctypes#ctypes.c_ushort WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_uint WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_ulong WARNING: unusable reference target found: ctypes#ctypes.c_longlong WARNING: unusable reference target found: ctypes#ctypes.c_ulonglong WARNING: unusable reference target found: ctypes#ctypes.c_float WARNING: unusable reference target found: ctypes#ctypes.c_double WARNING: unusable reference target found: ctypes#ctypes.c_longdouble WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_wchar_p WARNING: unusable reference target found: ctypes#ctypes.c_void_p WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_wchar_p WARNING: unusable reference target found: ctypes#ctypes.c_void_p WARNING: unusable reference target found: ctypes#ctypes.GetLastError WARNING: unusable reference target found: ctypes#ctypes.byref WARNING: unusable reference target found: ctypes#ctypes.byref WARNING: unusable reference target found: ctypes#ctypes.Structure WARNING: unusable reference target found: ctypes#ctypes.Union WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.WinDLL WARNING: unusable reference target found: ctypes#ctypes.OleDLL WARNING: unusable reference target found: ctypes#ctypes.CDLL WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: ctypes#ctypes.get_errno WARNING: unusable reference target found: ctypes#ctypes.set_errno WARNING: unusable reference target found: ctypes#ctypes.GetLastError WARNING: unusable reference target found: ctypes#ctypes.get_last_error WARNING: unusable reference target found: ctypes#ctypes.set_last_error WARNING: unusable reference target found: ctypes#ctypes.LibraryLoader WARNING: unusable reference target found: ctypes#ctypes.CDLL WARNING: unusable reference target found: ctypes#ctypes.PyDLL WARNING: unusable reference target found: ctypes#ctypes.WinDLL WARNING: unusable reference target found: ctypes#ctypes.OleDLL WARNING: unusable reference target found: ctypes#ctypes.CDLL WARNING: unusable reference target found: ctypes#ctypes.WinDLL WARNING: unusable reference target found: ctypes#ctypes.OleDLL WARNING: unusable reference target found: ctypes#ctypes.PyDLL WARNING: unusable reference target found: ctypes#ctypes.PyDLL WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.restype WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.errcheck WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.argtypes WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.argtypes WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.restype WARNING: unusable reference target found: ctypes#ctypes.WINFUNCTYPE WARNING: unusable reference target found: ctypes#ctypes.CFUNCTYPE WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: ctypes#ctypes.c_wchar WARNING: unusable reference target found: ctypes#ctypes.FormatError WARNING: unusable reference target found: ctypes#ctypes._CData._objects WARNING: unusable reference target found: ctypes#ctypes._CData._b_base_ WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_void_p WARNING: unusable reference target found: ctypes#ctypes.c_double WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_byte WARNING: unusable reference target found: ctypes#ctypes.c_short WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_longlong WARNING: unusable reference target found: ctypes#ctypes.c_ulong WARNING: unusable reference target found: ctypes#ctypes.c_ubyte WARNING: unusable reference target found: ctypes#ctypes.c_ushort WARNING: unusable reference target found: ctypes#ctypes.c_uint WARNING: unusable reference target found: ctypes#ctypes.c_ulonglong WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._pack_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes-pointers WARNING: unusable reference target found: ctypes#ctypes-arrays WARNING: unusable reference target found: select#epoll-objects WARNING: unusable reference target found: select#poll-objects WARNING: unusable reference target found: select#kqueue-objects WARNING: unusable reference target found: select#kevent-objects WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: select#select.poll WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: select#select.poll.register WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: dummy_threading#module-dummy_threading WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.current_thread WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: threading#threading.local WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: sys#sys.setprofile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.isAlive WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.name WARNING: unusable reference target found: thread#thread.get_ident WARNING: unusable reference target found: threading#threading.Thread.start WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: threading#threading.Thread.daemon WARNING: unusable reference target found: threading#threading.Thread.start WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Condition.notify WARNING: unusable reference target found: threading#threading.Condition.notifyAll WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Condition.release WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Condition.wait WARNING: unusable reference target found: threading#threading.Condition.notify WARNING: unusable reference target found: threading#threading.Condition.notify WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: threading#threading.Semaphore.release WARNING: unusable reference target found: threading#threading.Semaphore.acquire WARNING: unusable reference target found: threading#threading.Semaphore.release WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: threading#threading.Event.wait WARNING: unusable reference target found: threading#threading.Event.wait WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: threading#threading.Timer WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Condition WARNING: unusable reference target found: threading#threading.Semaphore WARNING: unusable reference target found: threading#threading.BoundedSemaphore WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: dummy_thread#module-dummy_thread WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: thread#thread.error WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: constants#exit WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: stdtypes#file.read WARNING: unusable reference target found: select#select.select WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: dummy_thread#module-dummy_thread WARNING: unusable reference target found: dummy_threading#module-dummy_threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: multiprocessing#multiprocessing-programming WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: multiprocessing#multiprocessing-programming WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.send WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Array WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#module-multiprocessing.sharedctypes WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: multiprocessing#multiprocessing.Semaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.BoundedSemaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.Condition WARNING: unusable reference target found: multiprocessing#multiprocessing.Event WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Array WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.run WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.run WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.run WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.join WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.authkey WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.join WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.is_alive WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv_bytes_into WARNING: unusable reference target found: multiprocessing#multiprocessing.BufferTooShort WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.join WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing-managers WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.terminate WARNING: unusable reference target found: os#os.kill WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing-programming WARNING: unusable reference target found: multiprocessing#multiprocessing-examples WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.join WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.close WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.cancel_join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.join WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.get WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.put WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: threading#threading.current_thread WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: multiprocessing#multiprocessing.freeze_support WARNING: unusable reference target found: sys#sys.executable WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#threading.active_count WARNING: unusable reference target found: threading#threading.enumerate WARNING: unusable reference target found: threading#threading.settrace WARNING: unusable reference target found: threading#threading.setprofile WARNING: unusable reference target found: threading#threading.Timer WARNING: unusable reference target found: threading#threading.local WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing-listeners-clients WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.send WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: multiprocessing#multiprocessing.BufferTooShort WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.send WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#multiprocessing-managers WARNING: unusable reference target found: threading#threading.BoundedSemaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.Semaphore WARNING: unusable reference target found: threading#threading.Condition WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#threading.Event WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Semaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.BoundedSemaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: multiprocessing#multiprocessing.Semaphore WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: multiprocessing#module-multiprocessing.sharedctypes WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.Array WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.Value WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.RawArray WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.RawValue WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: ctypes#ctypes.Structure WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.SyncManager WARNING: unusable reference target found: multiprocessing#module-multiprocessing.managers WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.start WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.serve_forever WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.serve_forever WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.address WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.start WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.from_address WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager WARNING: unusable reference target found: threading#threading.BoundedSemaphore WARNING: unusable reference target found: threading#threading.Condition WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Event WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.SyncManager.Namespace WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Semaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.register WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.register WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy._callmethod WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy._callmethod WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy._callmethod WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.map WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.imap WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.imap WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.terminate WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.close WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.terminate WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.join WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.AsyncResult.get WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: multiprocessing#module-multiprocessing.connection WARNING: unusable reference target found: hmac#module-hmac WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection WARNING: unusable reference target found: multiprocessing#multiprocessing-address-formats WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: multiprocessing#multiprocessing-address-formats WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.Client WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.Listener WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.Client WARNING: unusable reference target found: hmac#module-hmac WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: os#os.urandom WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: sys#sys.stderr WARNING: unusable reference target found: multiprocessing#module-multiprocessing.dummy WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: mmap#mmap.seek WARNING: unusable reference target found: mmap#mmap.mmap WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: mmap#mmap.mmap WARNING: unusable reference target found: mmap#mmap.mmap WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: readline#readline.write_history_file WARNING: unusable reference target found: readline#readline.get_history_length WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: code#code.InteractiveConsole WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: keyword#module-keyword WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: os#os.execvp WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.STDOUT WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: subprocess#subprocess.Popen.stdout WARNING: unusable reference target found: subprocess#subprocess.Popen.stdin WARNING: unusable reference target found: subprocess#subprocess.Popen.stderr WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen.returncode WARNING: unusable reference target found: subprocess#subprocess.Popen.returncode WARNING: unusable reference target found: subprocess#subprocess.Popen.communicate WARNING: unusable reference target found: subprocess#subprocess.Popen.communicate WARNING: unusable reference target found: subprocess#subprocess.Popen.terminate WARNING: unusable reference target found: subprocess#subprocess.Popen.kill WARNING: unusable reference target found: subprocess#subprocess.Popen.terminate WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.Popen.poll WARNING: unusable reference target found: subprocess#subprocess.Popen.wait WARNING: unusable reference target found: subprocess#subprocess.Popen.communicate WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: errno#module-errno WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: socket#socket.gethostbyname_ex WARNING: unusable reference target found: socket#socket.gethostbyaddr WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.getnameinfo WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: socket#socket.getdefaulttimeout WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: socket#socket.gethostbyaddr WARNING: unusable reference target found: socket#socket.gethostname WARNING: unusable reference target found: socket#socket.gethostbyname_ex WARNING: unusable reference target found: socket#socket.gethostbyname WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.gethostbyname_ex WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.gethostname WARNING: unusable reference target found: socket#socket.getfqdn WARNING: unusable reference target found: socket#socket.gethostbyaddr WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.SOCK_RAW WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_aton WARNING: unusable reference target found: socket#socket.getnameinfo WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_ntoa WARNING: unusable reference target found: socket#socket.getnameinfo WARNING: unusable reference target found: socket#socket.inet_pton WARNING: unusable reference target found: socket#socket.inet_aton WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_ntop WARNING: unusable reference target found: socket#socket.inet_ntoa WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_ntop WARNING: unusable reference target found: socketserver#module-SocketServer WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: select#select.select WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: socket#socket.socket.ioctl WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.send WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.send WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.timeout WARNING: unusable reference target found: socket#socket.socket.setblocking WARNING: unusable reference target found: socket#socket.socket.settimeout WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: ssl#ssl.wrap_socket WARNING: unusable reference target found: ssl#ssl.SSLError WARNING: unusable reference target found: ssl#ssl-certificates WARNING: unusable reference target found: ssl#ssl.CERT_NONE WARNING: unusable reference target found: ssl#ssl.CERT_OPTIONAL WARNING: unusable reference target found: ssl#ssl.CERT_REQUIRED WARNING: unusable reference target found: ssl#ssl.CERT_NONE WARNING: unusable reference target found: ssl#ssl-certificates WARNING: unusable reference target found: ssl#ssl.SSLSocket.do_handshake WARNING: unusable reference target found: ssl#ssl.SSLSocket.do_handshake WARNING: unusable reference target found: ssl#ssl.SSLSocket.read WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: ssl#ssl.RAND_egd WARNING: unusable reference target found: ssl#ssl.RAND_add WARNING: unusable reference target found: ssl#ssl.wrap_socket WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: ssl#ssl.CERT_OPTIONAL WARNING: unusable reference target found: ssl#ssl.CERT_REQUIRED WARNING: unusable reference target found: ssl#ssl.CERT_NONE WARNING: unusable reference target found: ssl#ssl.SSLError WARNING: unusable reference target found: ssl#ssl.wrap_socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: signal#signal.signal WARNING: unusable reference target found: signal#signal.alarm WARNING: unusable reference target found: signal#signal.getsignal WARNING: unusable reference target found: signal#signal.pause WARNING: unusable reference target found: signal#signal.setitimer WARNING: unusable reference target found: signal#signal.getitimer WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#signal.setitimer WARNING: unusable reference target found: signal#signal.getitimer WARNING: unusable reference target found: signal#signal.setitimer WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#signal.SIG_IGN WARNING: unusable reference target found: signal#signal.SIG_DFL WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: signal#signal.SIG_IGN WARNING: unusable reference target found: signal#signal.SIG_DFL WARNING: unusable reference target found: signal#signal.ITIMER_REAL WARNING: unusable reference target found: signal#signal.ITIMER_VIRTUAL WARNING: unusable reference target found: signal#signal.ITIMER_PROF WARNING: unusable reference target found: signal#signal.alarm WARNING: unusable reference target found: signal#signal.ITIMER_REAL WARNING: unusable reference target found: signal#signal.ITIMER_VIRTUAL WARNING: unusable reference target found: signal#signal.ITIMER_PROF WARNING: unusable reference target found: signal#signal.ItimerError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: signal#signal.signal WARNING: unusable reference target found: signal#signal.SIG_IGN WARNING: unusable reference target found: signal#signal.SIG_DFL WARNING: unusable reference target found: signal#signal.getsignal WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: inspect#module-inspect WARNING: unusable reference target found: signal#signal.alarm WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: popen2#module-popen2 WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: popen2#popen2.popen2 WARNING: unusable reference target found: popen2#popen2.popen3 WARNING: unusable reference target found: popen2#popen2.popen4 WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: popen2#module-popen2 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.popen2 WARNING: unusable reference target found: popen2#popen2.popen3 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.popen4 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: popen2#popen2.Popen3.wait WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os-process WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os.close WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: asynchat#module-asynchat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.loop WARNING: unusable reference target found: asyncore#asyncore.loop WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#asyncore.dispatcher.readable WARNING: unusable reference target found: asyncore#asyncore.dispatcher.writable WARNING: unusable reference target found: asyncore#asyncore.dispatcher.connect WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#asyncore.file_wrapper WARNING: unusable reference target found: os#os.dup WARNING: unusable reference target found: asyncore#asyncore.file_dispatcher WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: asynchat#module-asynchat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat.collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat.handle_write WARNING: unusable reference target found: asynchat#asynchat.async_chat.set_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat.collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: asynchat#asynchat.async_chat._get_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.set_terminator WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: asynchat#asynchat.async_chat._collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.set_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.handle_read WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.refill_buffer WARNING: unusable reference target found: asynchat#asynchat.simple_producer WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.simple_producer WARNING: unusable reference target found: asynchat#asynchat.simple_producer.more WARNING: unusable reference target found: asynchat#asynchat.fifo WARNING: unusable reference target found: asynchat#asynchat.fifo WARNING: unusable reference target found: asynchat#asynchat.fifo.push WARNING: unusable reference target found: asynchat#module-asynchat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message.set_payload WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: email.message#email.message.Message.get_payload WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.message#email.message.Message.set_charset WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.message#email.message.Message.keys WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: email.message#email.message.Message.get_all WARNING: unusable reference target found: email.message#email.message.Message.__getitem__ WARNING: unusable reference target found: email.message#email.message.Message.__setitem__ WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: email.message#email.message.Message.get_default_type WARNING: unusable reference target found: email.message#email.message.Message.get_content_type WARNING: unusable reference target found: email.message#email.message.Message.get_content_type WARNING: unusable reference target found: email.message#email.message.Message.get_content_type WARNING: unusable reference target found: email.message#email.message.Message.get_param WARNING: unusable reference target found: email.message#email.message.Message.get_param WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: email.message#email.message.Message.set_boundary WARNING: unusable reference target found: email.message#email.message.Message.add_header WARNING: unusable reference target found: email.message#email.message.Message.set_boundary WARNING: unusable reference target found: email.message#email.message.Message.get_charset WARNING: unusable reference target found: email.message#email.message.Message.walk WARNING: unusable reference target found: email.message#email.message.Message.walk WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.Parser.parse WARNING: unusable reference target found: email.parser#email.parser.Parser.parse WARNING: unusable reference target found: email.parser#email.parser.Parser.parse WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator.write WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.generator#email.generator.DecodedGenerator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.mime#email.mime.base.MIMEBase WARNING: unusable reference target found: email.mime#email.mime.base.MIMEBase WARNING: unusable reference target found: email.mime#email.mime.base.MIMEBase WARNING: unusable reference target found: email.mime#email.mime.application.MIMEApplication WARNING: unusable reference target found: email.mime#email.mime.application.MIMEApplication WARNING: unusable reference target found: email.encoders#module-email.encoders WARNING: unusable reference target found: email.mime#email.mime.audio.MIMEAudio WARNING: unusable reference target found: sndhdr#module-sndhdr WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.mime#email.mime.audio.MIMEAudio WARNING: unusable reference target found: email.encoders#module-email.encoders WARNING: unusable reference target found: email.mime#email.mime.image.MIMEImage WARNING: unusable reference target found: imghdr#module-imghdr WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.mime#email.mime.image.MIMEImage WARNING: unusable reference target found: email.encoders#module-email.encoders WARNING: unusable reference target found: email.mime#email.mime.message.MIMEMessage WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.mime#email.mime.text.MIMEText WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header.encode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.decode_header WARNING: unusable reference target found: email.header#email.header.decode_header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.charset#email.charset.Charset.header_encode WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset.__str__ WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: email.charset#email.charset.Charset.convert WARNING: unusable reference target found: email.charset#email.charset.add_codec WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.encoders#email.encoders.encode_quopri WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: email.errors#email.errors.MessageError WARNING: unusable reference target found: email.errors#email.errors.MessageParseError WARNING: unusable reference target found: email.errors#email.errors.MessageParseError WARNING: unusable reference target found: email.errors#email.errors.MultipartConversionError WARNING: unusable reference target found: email.errors#email.errors.MessageError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.util#module-email.utils WARNING: unusable reference target found: email.util#email.utils.parseaddr WARNING: unusable reference target found: email.util#email.utils.parsedate WARNING: unusable reference target found: email.util#email.utils.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: email.util#email.utils.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: email.util#email.utils.parsedate_tz WARNING: unusable reference target found: email.util#email.utils.mktime_tz WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: email.util#email.utils.collapse_rfc2231_value WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email.util#email.utils.collapse_rfc2231_value WARNING: unusable reference target found: email.util#email.utils.formataddr WARNING: unusable reference target found: email.iterators#module-email.iterators WARNING: unusable reference target found: email.iterators#email.iterators.typed_subpart_iterator WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email.mime#module-email.mime WARNING: unusable reference target found: email.mime#module-email.mime WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.message_from_file WARNING: unusable reference target found: email.parser#email.message_from_string WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.message_from_string WARNING: unusable reference target found: email.parser#email.message_from_file WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.iterators#module-email.iterators WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: email.util#module-email.utils WARNING: unusable reference target found: email.iterators#module-email.iterators WARNING: unusable reference target found: json#module-json WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: json#json.JSONEncoder WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: codecs#codecs.getwriter WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: json#json.JSONEncoder WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.dump WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.loads WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: json#json.JSONDecoder WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.dump WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.JSONEncoder.default WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: mailcap#mailcap.findmatch WARNING: unusable reference target found: mailcap#mailcap.findmatch WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.add WARNING: unusable reference target found: mailbox#mailbox.Mailbox.remove WARNING: unusable reference target found: mailbox#mailbox.Mailbox.discard WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.lock WARNING: unusable reference target found: mailbox#mailbox.Mailbox.unlock WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.remove WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__delitem__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.discard WARNING: unusable reference target found: mailbox#mailbox.Mailbox.discard WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.add WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.iterkeys WARNING: unusable reference target found: mailbox#mailbox.Mailbox.keys WARNING: unusable reference target found: mailbox#mailbox.Mailbox.itervalues WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__iter__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.values WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__iter__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.iteritems WARNING: unusable reference target found: mailbox#mailbox.Mailbox.items WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.get WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__getitem__ WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__setitem__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__setitem__ WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.flush WARNING: unusable reference target found: mailbox#mailbox.ExternalClashError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.NoSuchMailboxError WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.NotEmptyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.NoSuchMailboxError WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.NotEmptyError WARNING: unusable reference target found: mailbox#mailbox.MH.get_sequences WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.MH.unlock WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Babyl WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Babyl WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MMDF WARNING: unusable reference target found: mailbox#mailbox.MMDF WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.PortableUnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.BabylMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mhlib#module-mhlib WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: mhlib#module-mhlib WARNING: unusable reference target found: mhlib#mhlib.MH WARNING: unusable reference target found: mhlib#mhlib.Folder WARNING: unusable reference target found: mhlib#mhlib.Message WARNING: unusable reference target found: mhlib#mhlib.MH WARNING: unusable reference target found: mhlib#mhlib.Folder WARNING: unusable reference target found: mhlib#mhlib.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: mhlib#mhlib.MH WARNING: unusable reference target found: mhlib#mhlib.Folder WARNING: unusable reference target found: mhlib#mhlib.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mimetools#mimetools.decode WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mimetools#mimetools.Message.getplist WARNING: unusable reference target found: mimetools#mimetools.Message.getplist WARNING: unusable reference target found: mimetypes#module-mimetypes WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.knownfiles WARNING: unusable reference target found: mimetypes#mimetypes.knownfiles WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes.read WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes.readfp WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes WARNING: unusable reference target found: mimetypes#module-mimetypes WARNING: unusable reference target found: mimetypes#mimetypes.guess_extension WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes.readfp WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimewriter#module-MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.addheader WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.startbody WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.nextpart WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.startmultipartbody WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.nextpart WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimify#module-mimify WARNING: unusable reference target found: mimify#module-mimify WARNING: unusable reference target found: mimify#mimify.MAXLEN WARNING: unusable reference target found: mimify#mimify.CHARSET WARNING: unusable reference target found: quopri#module-quopri WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile.readline WARNING: unusable reference target found: multifile#multifile.MultiFile.seek WARNING: unusable reference target found: multifile#multifile.MultiFile.tell WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile.seek WARNING: unusable reference target found: multifile#multifile.MultiFile.tell WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile.pop WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message.rewindbody WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.parseaddr WARNING: unusable reference target found: rfc822#rfc822.parsedate WARNING: unusable reference target found: rfc822#rfc822.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.parsedate_tz WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message.getheader WARNING: unusable reference target found: rfc822#rfc822.Message.getheader WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.Message.getheader WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.Message.getdate WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList.__add__ WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList.__sub__ WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: base64#base64.encode WARNING: unusable reference target found: base64#base64.encodestring WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binhex#module-binhex WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binhex#binhex.hexbin WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: uu#module-uu WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: binhex#module-binhex WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binascii#binascii.Incomplete WARNING: unusable reference target found: binascii#binascii.b2a_hex WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: binhex#module-binhex WARNING: unusable reference target found: uu#module-uu WARNING: unusable reference target found: quopri#module-quopri WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: quopri#quopri.decode WARNING: unusable reference target found: quopri#quopri.encode WARNING: unusable reference target found: quopri#quopri.encode WARNING: unusable reference target found: mimify#module-mimify WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: uu#module-uu WARNING: unusable reference target found: uu#uu.Error WARNING: unusable reference target found: uu#uu.decode WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: uu#uu.decode WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: htmlparser#module-HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.close WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.close WARNING: unusable reference target found: htmllib#module-htmlentitydefs WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.handle_starttag WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.handle_starttag WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.handle_endtag WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmlparser#module-HTMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.close WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.close WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_charref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_data WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_charref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_codepoint WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_charref WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_entityref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_data WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_entityref WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_entityref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_charref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_starttag WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_starttag WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: formatter#module-formatter WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: formatter#module-formatter WARNING: unusable reference target found: htmlparser#module-HTMLParser WARNING: unusable reference target found: htmllib#module-htmlentitydefs WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_end WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.anchor_bgn WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_end WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_bgn WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_end WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_bgn WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.nofill WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_bgn WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: htmllib#module-htmlentitydefs WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmllib#htmlentitydefs.entitydefs WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: pyexpat#expaterror-objects WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ParserCreate WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.NotationDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.UnparsedEntityDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.SetBase WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.SetBase WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ordered_attributes WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.returns_unicode WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.specified_attributes WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartDoctypeDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndDoctypeDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.Parse WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ParseFile WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.buffer_text WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.CharacterDataHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.buffer_text WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.buffer_text WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.returns_unicode WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ErrorString WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.returns_unicode WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartCdataSectionHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndCdataSectionHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ElementDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EntityDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartElementHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartNamespaceDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndElementHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndCdataSectionHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.DefaultHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.SetBase WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.DefaultHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: xml.dom#xml.dom.getDOMImplementation WARNING: unusable reference target found: xml.dom#dom-conformance WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom#dom-implementation-objects WARNING: unusable reference target found: xml.dom#dom-node-objects WARNING: unusable reference target found: xml.dom#dom-nodelist-objects WARNING: unusable reference target found: xml.dom#dom-documenttype-objects WARNING: unusable reference target found: xml.dom#dom-document-objects WARNING: unusable reference target found: xml.dom#dom-element-objects WARNING: unusable reference target found: xml.dom#dom-attr-objects WARNING: unusable reference target found: xml.dom#dom-comment-objects WARNING: unusable reference target found: xml.dom#dom-text-objects WARNING: unusable reference target found: xml.dom#dom-pi-objects WARNING: unusable reference target found: xml.dom#xml.dom.DOMImplementation.createDocumentType WARNING: unusable reference target found: xml.dom#xml.dom.Node.previousSibling WARNING: unusable reference target found: xml.dom#xml.dom.Node.nodeName WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: xml.dom#xml.dom.NotFoundErr WARNING: unusable reference target found: xml.dom#xml.dom.NotFoundErr WARNING: unusable reference target found: xml.dom#xml.dom.InuseAttributeErr WARNING: unusable reference target found: xml.dom#xml.dom.InuseAttributeErr WARNING: unusable reference target found: xml.dom#xml.dom.DOMException WARNING: unusable reference target found: xml.dom#xml.dom.DOMException WARNING: unusable reference target found: xml.dom#xml.dom.DomstringSizeErr WARNING: unusable reference target found: xml.dom#xml.dom.HierarchyRequestErr WARNING: unusable reference target found: xml.dom#xml.dom.IndexSizeErr WARNING: unusable reference target found: xml.dom#xml.dom.InuseAttributeErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidAccessErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidCharacterErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidModificationErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidStateErr WARNING: unusable reference target found: xml.dom#xml.dom.NamespaceErr WARNING: unusable reference target found: xml.dom#xml.dom.NotFoundErr WARNING: unusable reference target found: xml.dom#xml.dom.NotSupportedErr WARNING: unusable reference target found: xml.dom#xml.dom.NoDataAllowedErr WARNING: unusable reference target found: xml.dom#xml.dom.NoModificationAllowedErr WARNING: unusable reference target found: xml.dom#xml.dom.SyntaxErr WARNING: unusable reference target found: xml.dom#xml.dom.WrongDocumentErr WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parse WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parseString WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parse WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parse WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parseString WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.Node.writexml WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.Node.writexml WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.pulldom#module-xml.dom.pulldom WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler WARNING: unusable reference target found: xml.dom.pulldom#xml.dom.pulldom.parse WARNING: unusable reference target found: xml.dom.pulldom#xml.dom.pulldom.parse WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: xml.sax#xml.sax.SAXParseException WARNING: unusable reference target found: xml.sax#xml.sax.parse WARNING: unusable reference target found: xml.sax.reader#module-xml.sax.xmlreader WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.utils#module-xml.sax.saxutils WARNING: unusable reference target found: xml.sax.reader#module-xml.sax.xmlreader WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.setDocumentLocator WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startElement WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endElement WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endElement WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.reader#attributes-objects WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startElement WARNING: unusable reference target found: xml.sax.reader#attributes-ns-objects WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startElementNS WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.DTDHandler WARNING: unusable reference target found: xml.sax.utils#module-xml.sax.saxutils WARNING: unusable reference target found: xml.sax.utils#xml.sax.saxutils.escape WARNING: unusable reference target found: xml.sax.utils#xml.sax.saxutils.quoteattr WARNING: unusable reference target found: xml.sax.utils#xml.sax.saxutils.XMLGenerator WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax#xml.sax.make_parser WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader.parse WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#attributes-objects WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.AttributesImpl WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.AttributesImpl WARNING: unusable reference target found: xml.sax.reader#attributes-ns-objects WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader.parse WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.IncrementalParser WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.Locator WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#attributes-objects WARNING: unusable reference target found: xml.etree.elementtree#xml.etree.ElementTree.ElementTree WARNING: unusable reference target found: xml.etree.elementtree#xml.etree.ElementTree.iterparse WARNING: unusable reference target found: xml.etree.elementtree#xml.etree.ElementTree.QName WARNING: unusable reference target found: xml.etree.elementtree#xml.etree.ElementTree.XMLTreeBuilder.feed WARNING: unusable reference target found: xml.etree.elementtree#xml.etree.ElementTree.XMLTreeBuilder.close WARNING: unusable reference target found: xml.etree.elementtree#xml.etree.ElementTree.XMLTreeBuilder WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: webbrowser#module-webbrowser WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: webbrowser#webbrowser.open_new WARNING: unusable reference target found: webbrowser#webbrowser.get WARNING: unusable reference target found: webbrowser#webbrowser.get WARNING: unusable reference target found: webbrowser#webbrowser.get WARNING: unusable reference target found: ic#module-ic WARNING: unusable reference target found: webbrowser#webbrowser.open_new WARNING: unusable reference target found: webbrowser#webbrowser.open_new WARNING: unusable reference target found: cgitb#module-cgitb WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: urlparse#urlparse.parse_qs WARNING: unusable reference target found: urlparse#urlparse.parse_qs WARNING: unusable reference target found: urlparse#urlparse.parse_qsl WARNING: unusable reference target found: urlparse#urlparse.parse_qs WARNING: unusable reference target found: xml.sax.utils#module-xml.sax.saxutils WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: cgi#module-cgi WARNING: unusable reference target found: cgi#cgi.test WARNING: unusable reference target found: cgitb#module-cgitb WARNING: unusable reference target found: cgitb#module-cgitb WARNING: unusable reference target found: cgitb#module-cgitb WARNING: unusable reference target found: cgitb#cgitb.enable WARNING: unusable reference target found: cgitb#module-cgitb WARNING: unusable reference target found: sys#sys.excepthook WARNING: unusable reference target found: cgitb#module-cgitb WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: wsgiref#module-wsgiref WARNING: unusable reference target found: wsgiref#wsgiref.util.request_uri WARNING: unusable reference target found: wsgiref#wsgiref.util.shift_path_info WARNING: unusable reference target found: wsgiref#module-wsgiref.util WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: wsgiref#wsgiref.headers.Headers WARNING: unusable reference target found: basehttpserver#module-BaseHTTPServer WARNING: unusable reference target found: wsgiref#module-wsgiref.util WARNING: unusable reference target found: wsgiref#module-wsgiref.simple_server WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.make_server WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.HTTPServer WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer.set_app WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.make_server WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer.get_app WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.make_server WARNING: unusable reference target found: wsgiref#wsgiref.simple_server.WSGIServer WARNING: unusable reference target found: wsgiref#module-wsgiref.handlers WARNING: unusable reference target found: wsgiref#module-wsgiref.validate WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: wsgiref#module-wsgiref.simple_server WARNING: unusable reference target found: wsgiref#module-wsgiref.handlers WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseCGIHandler WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: wsgiref#wsgiref.handlers.CGIHandler WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: wsgiref#wsgiref.handlers.SimpleHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.SimpleHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseCGIHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseCGIHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler._write WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.CGIHandler WARNING: unusable reference target found: wsgiref#module-wsgiref.handlers WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.origin_server WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseCGIHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.CGIHandler WARNING: unusable reference target found: wsgiref#module-wsgiref.util WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.get_stdin WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.get_stderr WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.add_cgi_vars WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.wsgi_file_wrapper WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.origin_server WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.server_software WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.log_exception WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.error_status WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.error_headers WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.error_body WARNING: unusable reference target found: wsgiref#module-wsgiref.util WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.wsgi_file_wrapper WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler._write WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler._flush WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseCGIHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.CGIHandler WARNING: unusable reference target found: wsgiref#wsgiref.handlers.BaseHandler.origin_server WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: urllib#urllib.ContentTooShortError WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: urllib#urllib.quote WARNING: unusable reference target found: urllib#urllib.unquote WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.quote_plus WARNING: unusable reference target found: urlparse#module-urlparse WARNING: unusable reference target found: urllib#urllib.quote WARNING: unusable reference target found: urllib#urllib.unquote WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.URLopener.version WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: urllib#urllib.URLopener.open_unknown WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: urllib#urllib.URLopener WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.FancyURLopener.prompt_user_passwd WARNING: unusable reference target found: urllib#urllib.FancyURLopener WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: urllib#urllib.urlopen WARNING: unusable reference target found: urllib#urllib.urlretrieve WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: ftplib#module-ftplib WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: urlparse#module-urlparse WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: urllib2#urllib2.URLError WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.UnknownHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector.open WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.ProxyHandler WARNING: unusable reference target found: urllib2#urllib2.UnknownHandler WARNING: unusable reference target found: urllib2#urllib2.HTTPHandler WARNING: unusable reference target found: urllib2#urllib2.HTTPDefaultErrorHandler WARNING: unusable reference target found: urllib2#urllib2.HTTPRedirectHandler WARNING: unusable reference target found: urllib2#urllib2.FTPHandler WARNING: unusable reference target found: urllib2#urllib2.FileHandler WARNING: unusable reference target found: ssl#module-ssl WARNING: unusable reference target found: urllib2#urllib2.HTTPSHandler WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: urllib2#urllib2.URLError WARNING: unusable reference target found: urllib2#urllib2.HTTPError WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.responses WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: urllib2#urllib2.Request.add_header WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.HTTPError WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#http-password-mgr WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#http-password-mgr WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#http-password-mgr WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#http-password-mgr WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#http-password-mgr WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#http-password-mgr WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: urllib2#urllib2.URLError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.URLError WARNING: unusable reference target found: exceptions#exceptions.MemoryError WARNING: unusable reference target found: urllib2#urllib2.URLError WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.BaseHandler.default_open WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.BaseHandler.parent WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.BaseHandler.default_open WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.BaseHandler.http_error_default WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.BaseHandler WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib2#urllib2.HTTPError WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.HTTPError WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.HTTPRedirectHandler.http_error_301 WARNING: unusable reference target found: urllib2#urllib2.HTTPRedirectHandler.http_error_301 WARNING: unusable reference target found: urllib2#urllib2.HTTPRedirectHandler.http_error_301 WARNING: unusable reference target found: urllib2#urllib2.HTTPCookieProcessor WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: urllib2#urllib2.ProxyHandler WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgr WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgrWithDefaultRealm WARNING: unusable reference target found: urllib2#urllib2.HTTPPasswordMgrWithDefaultRealm WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.CacheFTPHandler WARNING: unusable reference target found: urllib2#urllib2.FTPHandler WARNING: unusable reference target found: urllib2#urllib2.URLError WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector.error WARNING: unusable reference target found: urllib2#urllib2.HTTPDefaultErrorHandler WARNING: unusable reference target found: urllib2#urllib2.HTTPError WARNING: unusable reference target found: urllib2#urllib2.build_opener WARNING: unusable reference target found: urllib2#urllib2.ProxyHandler WARNING: unusable reference target found: urllib2#urllib2.ProxyHandler WARNING: unusable reference target found: urllib2#urllib2.ProxyHandler WARNING: unusable reference target found: urllib2#urllib2.ProxyBasicAuthHandler WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: urllib2#urllib2.OpenerDirector.open WARNING: unusable reference target found: httplib#module-httplib WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: httplib#httplib.HTTPConnection WARNING: unusable reference target found: httplib#httplib.HTTPConnection WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.ImproperConnectionState WARNING: unusable reference target found: httplib#httplib.ImproperConnectionState WARNING: unusable reference target found: httplib#httplib.ImproperConnectionState WARNING: unusable reference target found: httplib#httplib.HTTPException WARNING: unusable reference target found: httplib#httplib.HTTPConnection WARNING: unusable reference target found: httplib#httplib.HTTPResponse WARNING: unusable reference target found: httplib#httplib.HTTPConnection.endheaders WARNING: unusable reference target found: httplib#httplib.HTTPConnection.getresponse WARNING: unusable reference target found: httplib#httplib.HTTPResponse WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: urllib#module-urllib WARNING: unusable reference target found: ftplib#module-ftplib WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: netrc#module-netrc WARNING: unusable reference target found: ftplib#module-ftplib WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: ftplib#ftplib.FTP.transfercmd WARNING: unusable reference target found: ftplib#ftplib.FTP.retrbinary WARNING: unusable reference target found: ftplib#ftplib.FTP.storbinary WARNING: unusable reference target found: ftplib#ftplib.FTP.transfercmd WARNING: unusable reference target found: ftplib#ftplib.FTP.error_reply WARNING: unusable reference target found: ftplib#ftplib.FTP.transfercmd WARNING: unusable reference target found: ftplib#ftplib.FTP.transfercmd WARNING: unusable reference target found: ftplib#ftplib.FTP.transfercmd WARNING: unusable reference target found: ftplib#ftplib.FTP.retrlines WARNING: unusable reference target found: ftplib#ftplib.error_perm WARNING: unusable reference target found: ftplib#ftplib.FTP.error_reply WARNING: unusable reference target found: ftplib#ftplib.FTP.close WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: constants#quit WARNING: unusable reference target found: ftplib#ftplib.FTP WARNING: unusable reference target found: ftplib#ftplib.FTP.close WARNING: unusable reference target found: constants#quit WARNING: unusable reference target found: ftplib#ftplib.FTP.login WARNING: unusable reference target found: poplib#poplib.POP3 WARNING: unusable reference target found: poplib#poplib.POP3 WARNING: unusable reference target found: poplib#poplib.POP3_SSL WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: poplib#module-poplib WARNING: unusable reference target found: poplib#poplib.POP3 WARNING: unusable reference target found: poplib#module-poplib WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: imaplib#module-imaplib WARNING: unusable reference target found: poplib#poplib.POP3 WARNING: unusable reference target found: constants#quit WARNING: unusable reference target found: poplib#poplib.POP3_SSL WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: imaplib#imaplib.IMAP4_SSL WARNING: unusable reference target found: imaplib#imaplib.IMAP4_stream WARNING: unusable reference target found: imaplib#module-imaplib WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: imaplib#imaplib.IMAP4.error WARNING: unusable reference target found: imaplib#imaplib.IMAP4.error WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: imaplib#imaplib.IMAP4_SSL WARNING: unusable reference target found: imaplib#imaplib.IMAP4 WARNING: unusable reference target found: nntplib#nntplib.NNTP WARNING: unusable reference target found: nntplib#nntplib.NNTP WARNING: unusable reference target found: nntplib#nntplib.NNTPPermanentError WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: nntplib#nntplib.NNTP.newgroups WARNING: unusable reference target found: nntplib#nntplib.NNTP.descriptions WARNING: unusable reference target found: nntplib#nntplib.NNTP.stat WARNING: unusable reference target found: nntplib#nntplib.NNTP.stat WARNING: unusable reference target found: nntplib#nntplib.NNTP.stat WARNING: unusable reference target found: nntplib#nntplib.NNTP.stat WARNING: unusable reference target found: nntplib#nntplib.NNTP.stat WARNING: unusable reference target found: nntplib#nntplib.NNTP.head WARNING: unusable reference target found: nntplib#nntplib.NNTP.stat WARNING: unusable reference target found: nntplib#nntplib.NNTP.head WARNING: unusable reference target found: nntplib#nntplib.NNTP.post WARNING: unusable reference target found: nntplib#nntplib.NNTP.post WARNING: unusable reference target found: nntplib#nntplib.NNTP.newnews WARNING: unusable reference target found: nntplib#nntplib.NNTP.newgroups WARNING: unusable reference target found: nntplib#nntplib.NNTP.descriptions WARNING: unusable reference target found: nntplib#nntplib.NNTP.description WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: smtplib#smtplib.SMTP WARNING: unusable reference target found: smtplib#smtplib.SMTP.connect WARNING: unusable reference target found: smtplib#smtplib.SMTPConnectError WARNING: unusable reference target found: smtplib#smtplib.SMTP.sendmail WARNING: unusable reference target found: constants#quit WARNING: unusable reference target found: smtplib#smtplib.SMTP_SSL WARNING: unusable reference target found: smtplib#smtplib.SMTP WARNING: unusable reference target found: smtplib#smtplib.SMTP_SSL WARNING: unusable reference target found: smtplib#smtplib.SMTP WARNING: unusable reference target found: smtplib#smtplib.SMTPResponseException WARNING: unusable reference target found: smtplib#smtplib.SMTP.sendmail WARNING: unusable reference target found: smtplib#smtplib.SMTP WARNING: unusable reference target found: smtplib#smtplib.SMTPServerDisconnected WARNING: unusable reference target found: smtplib#smtplib.SMTP.sendmail WARNING: unusable reference target found: smtplib#smtplib.SMTP.has_extn WARNING: unusable reference target found: smtplib#smtplib.SMTP.has_extn WARNING: unusable reference target found: smtplib#smtplib.SMTP.sendmail WARNING: unusable reference target found: smtplib#smtplib.SMTP.ehlo WARNING: unusable reference target found: smtplib#smtplib.SMTP.helo WARNING: unusable reference target found: smtplib#smtplib.SMTPHeloError WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: smtplib#smtplib.SMTPHeloError WARNING: unusable reference target found: smtplib#smtplib.SMTPAuthenticationError WARNING: unusable reference target found: smtplib#smtplib.SMTPException WARNING: unusable reference target found: smtplib#smtplib.SMTP.ehlo WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: smtplib#smtplib.SMTPHeloError WARNING: unusable reference target found: smtplib#smtplib.SMTPException WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: smtplib#smtplib.SMTP WARNING: unusable reference target found: smtplib#smtplib.SMTPRecipientsRefused WARNING: unusable reference target found: smtplib#smtplib.SMTPHeloError WARNING: unusable reference target found: smtplib#smtplib.SMTPSenderRefused WARNING: unusable reference target found: smtplib#smtplib.SMTPDataError WARNING: unusable reference target found: smtpd#smtpd.SMTPServer WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: smtpd#smtpd.SMTPServer WARNING: unusable reference target found: smtpd#smtpd.SMTPServer WARNING: unusable reference target found: smtpd#smtpd.SMTPServer WARNING: unusable reference target found: telnetlib#module-telnetlib WARNING: unusable reference target found: telnetlib#telnetlib.Telnet WARNING: unusable reference target found: telnetlib#telnetlib.Telnet WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: telnetlib#telnetlib.Telnet WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: telnetlib#telnetlib.Telnet.interact WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: uuid#uuid.UUID WARNING: unusable reference target found: uuid#uuid.UUID WARNING: unusable reference target found: uuid#uuid.uuid1 WARNING: unusable reference target found: uuid#uuid.uuid3 WARNING: unusable reference target found: uuid#uuid.uuid4 WARNING: unusable reference target found: uuid#uuid.uuid5 WARNING: unusable reference target found: uuid#uuid.uuid1 WARNING: unusable reference target found: uuid#uuid.uuid4 WARNING: unusable reference target found: uuid#uuid.uuid1 WARNING: unusable reference target found: uuid#uuid.uuid4 WARNING: unusable reference target found: uuid#uuid.UUID WARNING: unusable reference target found: uuid#uuid.RESERVED_NCS WARNING: unusable reference target found: uuid#uuid.RFC_4122 WARNING: unusable reference target found: uuid#uuid.RESERVED_MICROSOFT WARNING: unusable reference target found: uuid#uuid.RESERVED_FUTURE WARNING: unusable reference target found: uuid#uuid.RFC_4122 WARNING: unusable reference target found: uuid#module-uuid WARNING: unusable reference target found: uuid#uuid.getnode WARNING: unusable reference target found: uuid#module-uuid WARNING: unusable reference target found: uuid#uuid.uuid3 WARNING: unusable reference target found: uuid#uuid.uuid5 WARNING: unusable reference target found: uuid#module-uuid WARNING: unusable reference target found: uuid#module-uuid WARNING: unusable reference target found: urlparse#module-urlparse WARNING: unusable reference target found: urlparse#module-urlparse WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: urlparse#urlparse-result-object WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: urllib#urllib.urlencode WARNING: unusable reference target found: urlparse#urlparse.urlparse WARNING: unusable reference target found: urlparse#urlparse.urlparse WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: urlparse#urlparse-result-object WARNING: unusable reference target found: urlparse#urlparse.urlsplit WARNING: unusable reference target found: urlparse#urlparse.urlparse WARNING: unusable reference target found: urlparse#urlparse.urlsplit WARNING: unusable reference target found: urlparse#urlparse.urlunsplit WARNING: unusable reference target found: urlparse#urlparse.urlparse WARNING: unusable reference target found: urlparse#urlparse.urlsplit WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: urlparse#urlparse.urlparse WARNING: unusable reference target found: urlparse#urlparse.urlsplit WARNING: unusable reference target found: socketserver#module-SocketServer WARNING: unusable reference target found: socketserver#module-SocketServer WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.handle_request WARNING: unusable reference target found: socketserver#SocketServer.serve_forever WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: select#select.select WARNING: unusable reference target found: socketserver#SocketServer.get_request WARNING: unusable reference target found: socketserver#SocketServer.verify_request WARNING: unusable reference target found: socketserver#SocketServer.process_request WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.handle_error WARNING: unusable reference target found: socketserver#SocketServer.handle_timeout WARNING: unusable reference target found: socketserver#SocketServer.handle_request WARNING: unusable reference target found: socketserver#SocketServer.shutdown WARNING: unusable reference target found: socketserver#SocketServer.serve_forever WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: socketserver#SocketServer.request_queue_size WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: socketserver#SocketServer.handle_request WARNING: unusable reference target found: socketserver#SocketServer.handle_timeout WARNING: unusable reference target found: socketserver#SocketServer.RequestHandlerClass WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.RequestHandlerClass WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.timeout WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: socketserver#SocketServer.finish_request WARNING: unusable reference target found: socketserver#SocketServer.RequestHandlerClass WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.setup WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: socketserver#SocketServer.setup WARNING: unusable reference target found: socketserver#SocketServer.finish WARNING: unusable reference target found: socketserver#SocketServer.handle WARNING: unusable reference target found: basehttpserver#module-BaseHTTPServer WARNING: unusable reference target found: simplehttpserver#module-SimpleHTTPServer WARNING: unusable reference target found: cgihttpserver#module-CGIHTTPServer WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.HTTPServer WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.MessageClass WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.version_string WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.server_version WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.send_header WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.error_message_format WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.handle_one_request WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.error_message_format WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.version_string WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.date_time_string WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.log_message WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.log_message WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.server_version WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler.sys_version WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: cgihttpserver#module-CGIHTTPServer WARNING: unusable reference target found: simplehttpserver#module-SimpleHTTPServer WARNING: unusable reference target found: simplehttpserver#module-SimpleHTTPServer WARNING: unusable reference target found: simplehttpserver#module-SimpleHTTPServer WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: simplehttpserver#module-SimpleHTTPServer WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler.do_HEAD WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: basehttpserver#module-BaseHTTPServer WARNING: unusable reference target found: cgihttpserver#module-CGIHTTPServer WARNING: unusable reference target found: cgihttpserver#module-CGIHTTPServer WARNING: unusable reference target found: basehttpserver#BaseHTTPServer.BaseHTTPRequestHandler WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler WARNING: unusable reference target found: cgihttpserver#CGIHTTPServer.CGIHTTPRequestHandler WARNING: unusable reference target found: cgihttpserver#module-CGIHTTPServer WARNING: unusable reference target found: simplehttpserver#SimpleHTTPServer.SimpleHTTPRequestHandler WARNING: unusable reference target found: cgihttpserver#CGIHTTPServer.CGIHTTPRequestHandler WARNING: unusable reference target found: cgihttpserver#CGIHTTPServer.CGIHTTPRequestHandler WARNING: unusable reference target found: basehttpserver#module-BaseHTTPServer WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: cookielib#cookielib.LoadError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.load WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.revert WARNING: unusable reference target found: cookielib#file-cookie-jar-classes WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy.rfc2109_as_netscape WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.set_ok WARNING: unusable reference target found: urllib2#urllib2.urlopen WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: urllib2#urllib2.Request WARNING: unusable reference target found: urllib2#module-urllib2 WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.CookieJar.extract_cookies WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.load WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.revert WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.save WARNING: unusable reference target found: cookielib#cookielib.LoadError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: cookielib#cookielib.LoadError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.revert WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar.load WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar WARNING: unusable reference target found: cookielib#cookielib.FileCookieJar WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.CookieJar.extract_cookies WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.CookieJar.add_cookie_header WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.domain_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.path_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.domain_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.path_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.path_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.path_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.return_ok WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.domain_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.path_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy.domain_return_ok WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: cookielib#cookielib.CookieJar WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.CookiePolicy WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#cookielib.Cookie.version WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.Cookie.version WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#cookielib.Cookie.is_expired WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.Cookie.version WARNING: unusable reference target found: cookielib#cookielib.Cookie WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#cookielib.DefaultCookiePolicy WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: cookie#Cookie.CookieError WARNING: unusable reference target found: cookie#Cookie.CookieError WARNING: unusable reference target found: cookie#Cookie.Morsel WARNING: unusable reference target found: cookie#Cookie.Morsel WARNING: unusable reference target found: cookie#Cookie.BaseCookie.load WARNING: unusable reference target found: cookie#Cookie.BaseCookie WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: cookie#Cookie.BaseCookie WARNING: unusable reference target found: pickle#pickle.loads WARNING: unusable reference target found: pickle#pickle.dumps WARNING: unusable reference target found: cookie#Cookie.BaseCookie WARNING: unusable reference target found: pickle#pickle.loads WARNING: unusable reference target found: pickle#pickle.dumps WARNING: unusable reference target found: cookie#Cookie.SerialCookie WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: cookie#Cookie.SmartCookie WARNING: unusable reference target found: cookie#Cookie.SerialCookie WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookielib#module-cookielib WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: cookie#Cookie.BaseCookie WARNING: unusable reference target found: cookie#Cookie.BaseCookie WARNING: unusable reference target found: cookie#Cookie.BaseCookie.value_encode WARNING: unusable reference target found: cookie#Cookie.BaseCookie.value_decode WARNING: unusable reference target found: cookie#Cookie.Morsel WARNING: unusable reference target found: cookie#Cookie.BaseCookie.output WARNING: unusable reference target found: cookie#Cookie.BaseCookie.output WARNING: unusable reference target found: cookie#Cookie.Morsel WARNING: unusable reference target found: cookie#Cookie.Morsel WARNING: unusable reference target found: cookie#Cookie.Morsel.output WARNING: unusable reference target found: cookie#Cookie.Morsel.output WARNING: unusable reference target found: cookie#module-Cookie WARNING: unusable reference target found: xmlrpclib#module-xmlrpclib WARNING: unusable reference target found: xmlrpclib#xmlrpclib.ServerProxy WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: xmlrpclib#xmlrpclib.ServerProxy WARNING: unusable reference target found: xmlrpclib#xmlrpclib.boolean WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: xmlrpclib#xmlrpclib.ServerProxy WARNING: unusable reference target found: xmlrpclib#xmlrpclib.ServerProxy WARNING: unusable reference target found: xmlrpclib#xmlrpclib.ServerProxy WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: xmlrpclib#xmlrpclib.MultiCall WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: simplexmlrpcserver#simplexmlrpcserver-example WARNING: unusable reference target found: simplexmlrpcserver#module-SimpleXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#module-SimpleXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.CGIXMLRPCRequestHandler WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCRequestHandler WARNING: unusable reference target found: xmlrpclib#module-xmlrpclib WARNING: unusable reference target found: xmlrpclib#module-xmlrpclib WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCServer.register_function WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.CGIXMLRPCRequestHandler WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.CGIXMLRPCRequestHandler.register_function WARNING: unusable reference target found: docxmlrpcserver#module-DocXMLRPCServer WARNING: unusable reference target found: docxmlrpcserver#module-DocXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#module-SimpleXMLRPCServer WARNING: unusable reference target found: docxmlrpcserver#DocXMLRPCServer.DocXMLRPCServer WARNING: unusable reference target found: docxmlrpcserver#DocXMLRPCServer.DocCGIXMLRPCRequestHandler WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCServer WARNING: unusable reference target found: docxmlrpcserver#DocXMLRPCServer.DocXMLRPCRequestHandler WARNING: unusable reference target found: docxmlrpcserver#DocXMLRPCServer.DocXMLRPCServer WARNING: unusable reference target found: docxmlrpcserver#DocXMLRPCServer.DocXMLRPCServer WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.SimpleXMLRPCServer WARNING: unusable reference target found: docxmlrpcserver#DocXMLRPCServer.DocCGIXMLRPCRequestHandler WARNING: unusable reference target found: simplexmlrpcserver#SimpleXMLRPCServer.CGIXMLRPCRequestHandler WARNING: unusable reference target found: audioop#module-audioop WARNING: unusable reference target found: al#module-al WARNING: unusable reference target found: sunaudio#module-sunaudiodev WARNING: unusable reference target found: audioop#audioop.lin2adpcm WARNING: unusable reference target found: audioop#audioop.findfactor WARNING: unusable reference target found: audioop#audioop.findfactor WARNING: unusable reference target found: audioop#audioop.lin2adpcm WARNING: unusable reference target found: audioop#audioop.ratecv WARNING: unusable reference target found: audioop#audioop.mul WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: audioop#audioop.lin2adpcm WARNING: unusable reference target found: imageop#module-imageop WARNING: unusable reference target found: imageop#module-imageop WARNING: unusable reference target found: imgfile#module-imgfile WARNING: unusable reference target found: imageop#imageop.mono2grey WARNING: unusable reference target found: imageop#imageop.dither2mono WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: aifc#module-aifc WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: aifc#aifc.aifc.getmarkers WARNING: unusable reference target found: aifc#aifc.aifc.readframes WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: aifc#aifc.aifc.getparams WARNING: unusable reference target found: aifc#aifc.aifc.setparams WARNING: unusable reference target found: aifc#aifc.aifc.close WARNING: unusable reference target found: aifc#aifc.aifc.setmark WARNING: unusable reference target found: aifc#aifc.aifc.writeframes WARNING: unusable reference target found: sunau#module-sunau WARNING: unusable reference target found: aifc#module-aifc WARNING: unusable reference target found: wave#module-wave WARNING: unusable reference target found: sunau#module-sunau WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: sunau#module-sunau WARNING: unusable reference target found: sunau#module-sunau WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: sunau#sunau.AU_read.getcomptype WARNING: unusable reference target found: sunau#sunau.AU_read.tell WARNING: unusable reference target found: aifc#module-aifc WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: sunau#sunau.AU_read.tell WARNING: unusable reference target found: sunau#sunau.AU_read.setpos WARNING: unusable reference target found: wave#module-wave WARNING: unusable reference target found: wave#module-wave WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: wave#wave.Wave_read.getcomptype WARNING: unusable reference target found: aifc#module-aifc WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: wave#wave.Wave_read.tell WARNING: unusable reference target found: wave#wave.Wave_read.setpos WARNING: unusable reference target found: wave#wave.Error WARNING: unusable reference target found: chunk#chunk.Chunk WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: chunk#chunk.Chunk.read WARNING: unusable reference target found: chunk#chunk.Chunk.seek WARNING: unusable reference target found: chunk#chunk.Chunk.tell WARNING: unusable reference target found: chunk#chunk.Chunk WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: chunk#chunk.Chunk.close WARNING: unusable reference target found: chunk#chunk.Chunk.read WARNING: unusable reference target found: colorsys#module-colorsys WARNING: unusable reference target found: colorsys#module-colorsys WARNING: unusable reference target found: imghdr#module-imghdr WARNING: unusable reference target found: imghdr#module-imghdr WARNING: unusable reference target found: imghdr#imghdr.what WARNING: unusable reference target found: imghdr#module-imghdr WARNING: unusable reference target found: imghdr#imghdr.what WARNING: unusable reference target found: sndhdr#module-sndhdr WARNING: unusable reference target found: sndhdr#sndhdr.whathdr WARNING: unusable reference target found: ossaudiodev#module-ossaudiodev WARNING: unusable reference target found: ossaudiodev#module-ossaudiodev WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: ossaudiodev#module-ossaudiodev WARNING: unusable reference target found: ossaudiodev#ossaudiodev.OSSAudioError WARNING: unusable reference target found: ossaudiodev#module-ossaudiodev WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.read WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.writeall WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.write WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.writeall WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.getfmts WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.sync WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.reset WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.setfmt WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.channels WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.speed WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.setparameters WARNING: unusable reference target found: ossaudiodev#ossaudiodev.OSSAudioError WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.setfmt WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.channels WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_audio_device.speed WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_mixer_device.controls WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_mixer_device.controls WARNING: unusable reference target found: ossaudiodev#ossaudiodev.oss_mixer_device.controls WARNING: unusable reference target found: ossaudiodev#ossaudiodev.OSSAudioError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: ossaudiodev#ossaudiodev.OSSAudioError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#gettext.bindtextdomain WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.bind_textdomain_codeset WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.dgettext WARNING: unusable reference target found: gettext#gettext.bind_textdomain_codeset WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.ngettext WARNING: unusable reference target found: gettext#gettext.bind_textdomain_codeset WARNING: unusable reference target found: gettext#gettext.ngettext WARNING: unusable reference target found: gettext#gettext.dngettext WARNING: unusable reference target found: gettext#gettext.bind_textdomain_codeset WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#gettext.textdomain WARNING: unusable reference target found: gettext#gettext.bindtextdomain WARNING: unusable reference target found: gettext#gettext.find WARNING: unusable reference target found: gettext#gettext.find WARNING: unusable reference target found: gettext#gettext.find WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: gettext#gettext.NullTranslations WARNING: unusable reference target found: gettext#gettext.translation WARNING: unusable reference target found: gettext#gettext.install WARNING: unusable reference target found: gettext#gettext.install WARNING: unusable reference target found: gettext#gettext.NullTranslations WARNING: unusable reference target found: gettext#gettext.NullTranslations WARNING: unusable reference target found: gettext#gettext.NullTranslations.add_fallback WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.lgettext WARNING: unusable reference target found: gettext#gettext.NullTranslations.ugettext WARNING: unusable reference target found: gettext#gettext.ngettext WARNING: unusable reference target found: gettext#gettext.ngettext WARNING: unusable reference target found: gettext#gettext.NullTranslations.ungettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#gettext.NullTranslations WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.GNUTranslations.ugettext WARNING: unusable reference target found: gettext#gettext.ngettext WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.GNUTranslations.ungettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#gettext.translation WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#gettext.install WARNING: unusable reference target found: gettext#gettext.lgettext WARNING: unusable reference target found: gettext#gettext.gettext WARNING: unusable reference target found: gettext#gettext.lgettext WARNING: unusable reference target found: locale#locale.getpreferredencoding WARNING: unusable reference target found: gettext#gettext.lgettext WARNING: unusable reference target found: gettext#gettext.bindtextdomain WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.Error WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.LC_NUMERIC WARNING: unusable reference target found: locale#locale.CHAR_MAX WARNING: unusable reference target found: locale#locale.LC_MONETARY WARNING: unusable reference target found: locale#locale.CHAR_MAX WARNING: unusable reference target found: locale#locale.LC_ALL WARNING: unusable reference target found: locale#locale.LC_CTYPE WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.getdefaultlocale WARNING: unusable reference target found: locale#locale.LC_ALL WARNING: unusable reference target found: locale#locale.LC_COLLATE WARNING: unusable reference target found: functions#cmp WARNING: unusable reference target found: locale#locale.LC_NUMERIC WARNING: unusable reference target found: locale#locale.format_string WARNING: unusable reference target found: locale#locale.LC_MONETARY WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.LC_NUMERIC WARNING: unusable reference target found: locale#locale.LC_NUMERIC WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: locale#locale.strcoll WARNING: unusable reference target found: locale#locale.strxfrm WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: locale#locale.localeconv WARNING: unusable reference target found: os#os.strerror WARNING: unusable reference target found: locale#locale.format WARNING: unusable reference target found: locale#locale.atoi WARNING: unusable reference target found: locale#locale.atof WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: locale#locale.localeconv WARNING: unusable reference target found: locale#locale.nl_langinfo WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.lower WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.LC_CTYPE WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#locale.atof WARNING: unusable reference target found: locale#locale.atoi WARNING: unusable reference target found: locale#locale.format WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: gettext#module-gettext WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: sys#sys.stdin WARNING: unusable reference target found: sys#sys.stdout WARNING: unusable reference target found: cmd#cmd.Cmd.use_rawinput WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd.intro WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: cmd#cmd.Cmd.postcmd WARNING: unusable reference target found: cmd#cmd.Cmd.postcmd WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd.precmd WARNING: unusable reference target found: cmd#cmd.Cmd.postcmd WARNING: unusable reference target found: cmd#cmd.Cmd.default WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd.onecmd WARNING: unusable reference target found: cmd#cmd.Cmd.precmd WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd.postcmd WARNING: unusable reference target found: cmd#cmd.Cmd.onecmd WARNING: unusable reference target found: cmd#cmd.Cmd.cmdloop WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd.cmdloop WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd WARNING: unusable reference target found: cmd#cmd.Cmd.cmdloop WARNING: unusable reference target found: cmd#cmd.Cmd.cmdloop WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#module-shlex WARNING: unusable reference target found: shlex#module-shlex WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.split WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#module-shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex.infile WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: configparser#module-ConfigParser WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex.push_token WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex.source WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: shlex#shlex.shlex.push_source WARNING: unusable reference target found: shlex#shlex.shlex.pop_source WARNING: unusable reference target found: shlex#shlex.shlex.sourcehook WARNING: unusable reference target found: shlex#module-shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex.quotes WARNING: unusable reference target found: shlex#shlex.shlex.escape WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: shlex#shlex.shlex WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: othergui#other-gui-packages WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#Tkinter.Tk WARNING: unusable reference target found: tkinter#Tkinter.Tcl WARNING: unusable reference target found: tkinter#Tkinter.Tk WARNING: unusable reference target found: tkinter#Tkinter.Tcl WARNING: unusable reference target found: scrolledtext#module-ScrolledText WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#Tkinter.Tk WARNING: unusable reference target found: tkinter#tkinter-basic-mapping WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#tkinter-setting-options WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#Tix.HList WARNING: unusable reference target found: tix#Tix.ComboBox WARNING: unusable reference target found: tix#Tix.Control WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#Tix.NoteBook WARNING: unusable reference target found: tix#Tix.FileEntry WARNING: unusable reference target found: tix#Tix.PanedWindow WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#Tkinter.Tk WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#Tix.PopupMenu WARNING: unusable reference target found: tix#Tix.DirSelectBox WARNING: unusable reference target found: tix#Tix.ExFileSelectBox WARNING: unusable reference target found: tix#Tix.ComboBox WARNING: unusable reference target found: tix#Tix.TList WARNING: unusable reference target found: tix#Tix.TList WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#module-Tix WARNING: unusable reference target found: tix#Tix.tixCommand.tix_addbitmapdir WARNING: unusable reference target found: tix#Tix.tixCommand.tix_getbitmap WARNING: unusable reference target found: tix#Tix.tixCommand.tix_getimage WARNING: unusable reference target found: tix#Tix.tixCommand.tix_getbitmap WARNING: unusable reference target found: tix#Tix.tixCommand.tix_addbitmapdir WARNING: unusable reference target found: tix#Tix.tixCommand.tix_getimage WARNING: unusable reference target found: tix#Tix.tixCommand.tix_getbitmap WARNING: unusable reference target found: tix#Tix.tixCommand.tix_filedialog WARNING: unusable reference target found: tix#Tix.tixCommand.tix_addbitmapdir WARNING: unusable reference target found: tix#Tix.tixCommand.tix_getimage WARNING: unusable reference target found: tix#Tix.tixCommand.tix_resetoptions WARNING: unusable reference target found: scrolledtext#module-ScrolledText WARNING: unusable reference target found: scrolledtext#module-ScrolledText WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: turtle#turtle.TurtleScreen WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#turtle.Screen WARNING: unusable reference target found: turtle#turtle.TurtleScreen WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#turtle.RawTurtle WARNING: unusable reference target found: turtle#turtle.RawPen WARNING: unusable reference target found: turtle#turtle.TurtleScreen WARNING: unusable reference target found: turtle#turtle.Turtle WARNING: unusable reference target found: turtle#turtle.Screen WARNING: unusable reference target found: turtle#turtle.Screen WARNING: unusable reference target found: turtle#turtle.Turtle WARNING: unusable reference target found: turtle#turtle.forward WARNING: unusable reference target found: turtle#turtle.fd WARNING: unusable reference target found: turtle#turtle.backward WARNING: unusable reference target found: turtle#turtle.bk WARNING: unusable reference target found: turtle#turtle.back WARNING: unusable reference target found: turtle#turtle.right WARNING: unusable reference target found: turtle#turtle.rt WARNING: unusable reference target found: turtle#turtle.left WARNING: unusable reference target found: turtle#turtle.lt WARNING: unusable reference target found: turtle#turtle.goto WARNING: unusable reference target found: turtle#turtle.setpos WARNING: unusable reference target found: turtle#turtle.setposition WARNING: unusable reference target found: turtle#turtle.setx WARNING: unusable reference target found: turtle#turtle.sety WARNING: unusable reference target found: turtle#turtle.setheading WARNING: unusable reference target found: turtle#turtle.seth WARNING: unusable reference target found: turtle#turtle.home WARNING: unusable reference target found: turtle#turtle.circle WARNING: unusable reference target found: turtle#turtle.dot WARNING: unusable reference target found: turtle#turtle.stamp WARNING: unusable reference target found: turtle#turtle.clearstamp WARNING: unusable reference target found: turtle#turtle.clearstamps WARNING: unusable reference target found: turtle#turtle.undo WARNING: unusable reference target found: turtle#turtle.speed WARNING: unusable reference target found: turtle#turtle.position WARNING: unusable reference target found: turtle#turtle.pos WARNING: unusable reference target found: turtle#turtle.towards WARNING: unusable reference target found: turtle#turtle.xcor WARNING: unusable reference target found: turtle#turtle.ycor WARNING: unusable reference target found: turtle#turtle.heading WARNING: unusable reference target found: turtle#turtle.distance WARNING: unusable reference target found: turtle#turtle.degrees WARNING: unusable reference target found: turtle#turtle.radians WARNING: unusable reference target found: turtle#turtle.pendown WARNING: unusable reference target found: turtle#turtle.pd WARNING: unusable reference target found: turtle#turtle.down WARNING: unusable reference target found: turtle#turtle.penup WARNING: unusable reference target found: turtle#turtle.pu WARNING: unusable reference target found: turtle#turtle.up WARNING: unusable reference target found: turtle#turtle.pensize WARNING: unusable reference target found: turtle#turtle.width WARNING: unusable reference target found: turtle#turtle.pen WARNING: unusable reference target found: turtle#turtle.isdown WARNING: unusable reference target found: turtle#turtle.color WARNING: unusable reference target found: turtle#turtle.pencolor WARNING: unusable reference target found: turtle#turtle.fillcolor WARNING: unusable reference target found: turtle#turtle.fill WARNING: unusable reference target found: turtle#turtle.begin_fill WARNING: unusable reference target found: turtle#turtle.end_fill WARNING: unusable reference target found: turtle#turtle.reset WARNING: unusable reference target found: turtle#turtle.clear WARNING: unusable reference target found: turtle#turtle.write WARNING: unusable reference target found: turtle#turtle.showturtle WARNING: unusable reference target found: turtle#turtle.st WARNING: unusable reference target found: turtle#turtle.hideturtle WARNING: unusable reference target found: turtle#turtle.ht WARNING: unusable reference target found: turtle#turtle.isvisible WARNING: unusable reference target found: turtle#turtle.shape WARNING: unusable reference target found: turtle#turtle.resizemode WARNING: unusable reference target found: turtle#turtle.shapesize WARNING: unusable reference target found: turtle#turtle.settiltangle WARNING: unusable reference target found: turtle#turtle.tiltangle WARNING: unusable reference target found: turtle#turtle.tilt WARNING: unusable reference target found: turtle#turtle.onclick WARNING: unusable reference target found: turtle#turtle.onrelease WARNING: unusable reference target found: turtle#turtle.ondrag WARNING: unusable reference target found: turtle#turtle.begin_poly WARNING: unusable reference target found: turtle#turtle.end_poly WARNING: unusable reference target found: turtle#turtle.get_poly WARNING: unusable reference target found: turtle#turtle.clone WARNING: unusable reference target found: turtle#turtle.getturtle WARNING: unusable reference target found: turtle#turtle.getscreen WARNING: unusable reference target found: turtle#turtle.setundobuffer WARNING: unusable reference target found: turtle#turtle.undobufferentries WARNING: unusable reference target found: turtle#turtle.tracer WARNING: unusable reference target found: turtle#turtle.window_width WARNING: unusable reference target found: turtle#turtle.window_height WARNING: unusable reference target found: turtle#turtle.bgcolor WARNING: unusable reference target found: turtle#turtle.bgpic WARNING: unusable reference target found: turtle#turtle.clear WARNING: unusable reference target found: turtle#turtle.clearscreen WARNING: unusable reference target found: turtle#turtle.reset WARNING: unusable reference target found: turtle#turtle.resetscreen WARNING: unusable reference target found: turtle#turtle.screensize WARNING: unusable reference target found: turtle#turtle.setworldcoordinates WARNING: unusable reference target found: turtle#turtle.delay WARNING: unusable reference target found: turtle#turtle.tracer WARNING: unusable reference target found: turtle#turtle.update WARNING: unusable reference target found: turtle#turtle.listen WARNING: unusable reference target found: turtle#turtle.onkey WARNING: unusable reference target found: turtle#turtle.onclick WARNING: unusable reference target found: turtle#turtle.onscreenclick WARNING: unusable reference target found: turtle#turtle.ontimer WARNING: unusable reference target found: turtle#turtle.mode WARNING: unusable reference target found: turtle#turtle.colormode WARNING: unusable reference target found: turtle#turtle.getcanvas WARNING: unusable reference target found: turtle#turtle.getshapes WARNING: unusable reference target found: turtle#turtle.register_shape WARNING: unusable reference target found: turtle#turtle.addshape WARNING: unusable reference target found: turtle#turtle.turtles WARNING: unusable reference target found: turtle#turtle.window_height WARNING: unusable reference target found: turtle#turtle.window_width WARNING: unusable reference target found: turtle#turtle.bye WARNING: unusable reference target found: turtle#turtle.exitonclick WARNING: unusable reference target found: turtle#turtle.setup WARNING: unusable reference target found: turtle#turtle.title WARNING: unusable reference target found: turtle#turtle.degrees WARNING: unusable reference target found: turtle#turtle.radians WARNING: unusable reference target found: turtle#turtle.mode WARNING: unusable reference target found: turtle#turtle.degrees WARNING: unusable reference target found: turtle#turtle.radians WARNING: unusable reference target found: turtle#turtle.mode WARNING: unusable reference target found: turtle#turtle.Vec2D WARNING: unusable reference target found: turtle#turtle.pos WARNING: unusable reference target found: turtle#turtle.mode WARNING: unusable reference target found: turtle#turtle.stamp WARNING: unusable reference target found: turtle#turtle.Vec2D WARNING: unusable reference target found: turtle#turtle.mode WARNING: unusable reference target found: turtle#turtle.pen WARNING: unusable reference target found: turtle#turtle.colormode WARNING: unusable reference target found: turtle#turtle.colormode WARNING: unusable reference target found: turtle#turtle.pencolor WARNING: unusable reference target found: turtle#turtle.fillcolor WARNING: unusable reference target found: turtle#turtle.pencolor WARNING: unusable reference target found: turtle#turtle.colormode WARNING: unusable reference target found: turtle#turtle.begin_fill WARNING: unusable reference target found: turtle#turtle.register_shape WARNING: unusable reference target found: turtle#turtle.shapesize WARNING: unusable reference target found: turtle#turtle.shapesize WARNING: unusable reference target found: turtle#turtle.TurtleScreen WARNING: unusable reference target found: turtle#turtle.undo WARNING: unusable reference target found: turtle#turtle.Shape WARNING: unusable reference target found: turtle#turtle.Shape WARNING: unusable reference target found: turtle#turtle.register_shape WARNING: unusable reference target found: turtle#turtle.delay WARNING: unusable reference target found: turtle#turtle.speed WARNING: unusable reference target found: turtle#turtle.listen WARNING: unusable reference target found: turtle#turtle.listen WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#turtle.Shape WARNING: unusable reference target found: turtle#turtle.TurtleScreen WARNING: unusable reference target found: turtle#turtle.Screen WARNING: unusable reference target found: turtle#screenspecific WARNING: unusable reference target found: turtle#turtle.Shape.addcomponent WARNING: unusable reference target found: turtle#compoundshapes WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#turtle.exitonclick WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#module-turtle WARNING: unusable reference target found: turtle#turtle.tracer WARNING: unusable reference target found: turtle#turtle.update WARNING: unusable reference target found: turtle#turtle.ondrag WARNING: unusable reference target found: turtle#turtle.onclick WARNING: unusable reference target found: turtle#turtle.stamp WARNING: unusable reference target found: turtle#turtle.Vec2D WARNING: unusable reference target found: turtle#turtle.clone WARNING: unusable reference target found: turtle#turtle.clone WARNING: unusable reference target found: turtle#turtle.undo WARNING: unusable reference target found: turtle#turtle.circle WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: pydoc#module-pydoc WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: pydoc#module-pydoc WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: pydoc#module-pydoc WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: pydoc#module-pydoc WARNING: unusable reference target found: tkinter#module-Tkinter WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest-basic-api WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest-basic-api WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest-basic-api WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: doctest#doctest.ELLIPSIS WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: doctest#doctest.IGNORE_EXCEPTION_DETAIL WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: doctest#doctest.IGNORE_EXCEPTION_DETAIL WARNING: unusable reference target found: doctest#doctest.DONT_ACCEPT_TRUE_FOR_1 WARNING: unusable reference target found: doctest#doctest.DONT_ACCEPT_BLANKLINE WARNING: unusable reference target found: doctest#doctest.NORMALIZE_WHITESPACE WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: doctest#doctest.ELLIPSIS WARNING: unusable reference target found: doctest#doctest.IGNORE_EXCEPTION_DETAIL WARNING: unusable reference target found: doctest#doctest.IGNORE_EXCEPTION_DETAIL WARNING: unusable reference target found: doctest#doctest.REPORT_ONLY_FIRST_FAILURE WARNING: unusable reference target found: ../@token#grammar-token-directive_options WARNING: unusable reference target found: ../@token#grammar-token-directive_option WARNING: unusable reference target found: ../@token#grammar-token-directive_option WARNING: unusable reference target found: ../@token#grammar-token-on_or_off WARNING: unusable reference target found: ../@token#grammar-token-directive_option_name WARNING: unusable reference target found: doctest#doctest.DONT_ACCEPT_BLANKLINE WARNING: unusable reference target found: doctest#doctest.NORMALIZE_WHITESPACE WARNING: unusable reference target found: doctest#doctest.ELLIPSIS WARNING: unusable reference target found: doctest#doctest.IGNORE_EXCEPTION_DETAIL WARNING: unusable reference target found: doctest#doctest.REPORT_UDIFF WARNING: unusable reference target found: doctest#doctest.REPORT_CDIFF WARNING: unusable reference target found: doctest#doctest.REPORT_NDIFF WARNING: unusable reference target found: doctest#doctest.REPORT_ONLY_FIRST_FAILURE WARNING: unusable reference target found: doctest#doctest.COMPARISON_FLAGS WARNING: unusable reference target found: doctest#doctest.REPORTING_FLAGS WARNING: unusable reference target found: doctest#doctest.SKIP WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest.register_optionflag WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.register_optionflag WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest.ELLIPSIS WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest-simple-testmod WARNING: unusable reference target found: doctest#doctest-simple-testfile WARNING: unusable reference target found: stdtypes#dict.update WARNING: unusable reference target found: doctest#doctest-options WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.DocTestFinder WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest-options WARNING: unusable reference target found: doctest#doctest.set_unittest_reportflags WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#doctest.DocFileSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: doctest#doctest.DocTestFinder WARNING: unusable reference target found: doctest#doctest.DocFileSuite WARNING: unusable reference target found: doctest#doctest.testmod WARNING: unusable reference target found: doctest#doctest.DocTestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#doctest.DocFileSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest-options WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.DocTestFinder WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.DocTest.globs WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest.filename WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.Example.want WARNING: unusable reference target found: traceback#traceback.format_exception_only WARNING: unusable reference target found: doctest#doctest.Example.exc_msg WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#doctest.DocTestFinder.find WARNING: unusable reference target found: doctest#doctest.DocTestFinder.find WARNING: unusable reference target found: doctest#doctest.DocTestFinder WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest-options WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest.DocTestRunner.report_start WARNING: unusable reference target found: doctest#doctest.DocTestRunner.report_success WARNING: unusable reference target found: doctest#doctest.DocTestRunner.report_unexpected_exception WARNING: unusable reference target found: doctest#doctest.DocTestRunner.report_failure WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest-options WARNING: unusable reference target found: doctest#doctest.DocTestParser WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner.run WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner.run WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner.run WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: doctest#doctest.DocTestRunner.run WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest.OutputChecker.check_output WARNING: unusable reference target found: doctest#doctest.OutputChecker.output_difference WARNING: unusable reference target found: doctest#doctest.OutputChecker WARNING: unusable reference target found: doctest#doctest-options WARNING: unusable reference target found: pdb#module-pdb WARNING: unusable reference target found: doctest#doctest.DebugRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#doctest.DocTestSuite WARNING: unusable reference target found: doctest#doctest.debug WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: pdb#pdb.set_trace WARNING: unusable reference target found: pdb#pdb.set_trace WARNING: unusable reference target found: doctest#doctest.script_from_examples WARNING: unusable reference target found: doctest#doctest.testsource WARNING: unusable reference target found: pdb#module-pdb WARNING: unusable reference target found: pdb#pdb.post_mortem WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: pdb#pdb.run WARNING: unusable reference target found: doctest#doctest.debug WARNING: unusable reference target found: doctest#doctest.debug WARNING: unusable reference target found: doctest#doctest.DebugRunner WARNING: unusable reference target found: doctest#doctest.DebugRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.UnexpectedException WARNING: unusable reference target found: doctest#doctest.DocTestFailure WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest-advanced-api WARNING: unusable reference target found: doctest#doctest.DebugRunner WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.DocTestFailure WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: doctest#doctest.DocTestRunner WARNING: unusable reference target found: doctest#doctest.UnexpectedException WARNING: unusable reference target found: doctest#doctest.DocTest WARNING: unusable reference target found: doctest#doctest.Example WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: doctest#doctest.testfile WARNING: unusable reference target found: doctest#doctest.DocFileSuite WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.FunctionTestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.FunctionTestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TextTestRunner WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: random#module-random WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.main WARNING: unusable reference target found: unittest#unittest.main WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.FunctionTestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: functions#cmp WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.FunctionTestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: unittest#unittest.FunctionTestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase.setUp WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: unittest#unittest.TestCase.run WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: unittest#unittest.TestCase.failUnlessEqual WARNING: unusable reference target found: unittest#unittest.TestCase.failUnless WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: unittest#unittest.TestCase.failIfEqual WARNING: unusable reference target found: unittest#unittest.TestCase.failUnless WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: unittest#unittest.TestCase.assertRaises WARNING: unusable reference target found: unittest#unittest.TestCase.failUnless WARNING: unusable reference target found: unittest#unittest.TestCase.failIf WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase.run WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestSuite.addTest WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase.run WARNING: unusable reference target found: unittest#unittest.TestSuite.run WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: unittest#unittest.TextTestRunner WARNING: unusable reference target found: unittest#unittest.TestResult WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestLoader.loadTestsFromName WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: unittest#unittest.TestLoader WARNING: unusable reference target found: unittest#unittest.TestLoader.getTestCaseNames WARNING: unusable reference target found: unittest#unittest.TestLoader.getTestCaseNames WARNING: unusable reference target found: functions#cmp WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: unittest#unittest.TestSuite WARNING: unusable reference target found: 2to3#module-lib2to3 WARNING: unusable reference target found: 2to3#module-lib2to3 WARNING: unusable reference target found: 2to3#module-lib2to3 WARNING: unusable reference target found: test#module-test WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: test#module-test WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: doctest#module-doctest WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: test#module-test WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: unittest#module-unittest WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: test#test.test_support.TestFailed WARNING: unusable reference target found: test#test.test_support.TestSkipped WARNING: unusable reference target found: test#test.test_support.requires WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: test#test.test_support.ResourceDenied WARNING: unusable reference target found: test#test.test_support.ResourceDenied WARNING: unusable reference target found: unittest#unittest.TestCase WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: test#module-test.test_support WARNING: unusable reference target found: test#test.test_support.ResourceDenied WARNING: unusable reference target found: test#test.test_support.ResourceDenied WARNING: unusable reference target found: test#test.test_support.check_warnings WARNING: unusable reference target found: bdb#module-bdb WARNING: unusable reference target found: bdb#bdb.Bdb WARNING: unusable reference target found: bdb#module-bdb WARNING: unusable reference target found: bdb#bdb.Breakpoint WARNING: unusable reference target found: bdb#bdb.Breakpoint WARNING: unusable reference target found: bdb#bdb.Bdb WARNING: unusable reference target found: bdb#bdb.Bdb WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: bdb#bdb.Bdb.user_line WARNING: unusable reference target found: bdb#bdb.BdbQuit WARNING: unusable reference target found: bdb#bdb.Bdb.user_line WARNING: unusable reference target found: bdb#bdb.Bdb.trace_dispatch WARNING: unusable reference target found: bdb#bdb.Bdb.user_call WARNING: unusable reference target found: bdb#bdb.BdbQuit WARNING: unusable reference target found: bdb#bdb.Bdb.user_call WARNING: unusable reference target found: bdb#bdb.Bdb.trace_dispatch WARNING: unusable reference target found: bdb#bdb.Bdb.user_return WARNING: unusable reference target found: bdb#bdb.BdbQuit WARNING: unusable reference target found: bdb#bdb.Bdb.user_return WARNING: unusable reference target found: bdb#bdb.Bdb.trace_dispatch WARNING: unusable reference target found: bdb#bdb.Bdb.user_exception WARNING: unusable reference target found: bdb#bdb.BdbQuit WARNING: unusable reference target found: bdb#bdb.Bdb.user_exception WARNING: unusable reference target found: bdb#bdb.Bdb.trace_dispatch WARNING: unusable reference target found: bdb#bdb.Bdb.dispatch_call WARNING: unusable reference target found: bdb#bdb.Bdb.dispatch_line WARNING: unusable reference target found: bdb#bdb.Bdb.stop_here WARNING: unusable reference target found: bdb#bdb.Bdb.break_here WARNING: unusable reference target found: bdb#bdb.Bdb.dispatch_return WARNING: unusable reference target found: bdb#bdb.Bdb.stop_here WARNING: unusable reference target found: bdb#bdb.Bdb.dispatch_exception WARNING: unusable reference target found: bdb#bdb.Bdb.stop_here WARNING: unusable reference target found: bdb#bdb.BdbQuit WARNING: unusable reference target found: bdb#bdb.Bdb.canonic WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: bdb#bdb.Bdb.run WARNING: unusable reference target found: bdb#bdb.Bdb.run WARNING: unusable reference target found: bdb#bdb.Bdb WARNING: unusable reference target found: pdb#module-pdb WARNING: unusable reference target found: bdb#module-bdb WARNING: unusable reference target found: cmd#module-cmd WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: pdb#pdb.runeval WARNING: unusable reference target found: pdb#pdb.run WARNING: unusable reference target found: pdb#pdb.runcall WARNING: unusable reference target found: pprint#module-pprint WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-pstats WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: hotshot#module-hotshot WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: hotshot#module-hotshot WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-pstats WARNING: unusable reference target found: profile#cProfile.run WARNING: unusable reference target found: profile#module-pstats WARNING: unusable reference target found: cmd#module-cmd WARNING: unusable reference target found: profile#cProfile.run WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#cProfile.run WARNING: unusable reference target found: profile#module-pstats WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats.add WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats.strip_dirs WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#cProfile.run WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats.sort_stats WARNING: unusable reference target found: profile#pstats.Stats.add WARNING: unusable reference target found: profile#pstats.Stats.strip_dirs WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats.print_stats WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: profile#pstats.Stats.print_callers WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: os#os.times WARNING: unusable reference target found: os#os.times WARNING: unusable reference target found: hotshot#module-hotshot WARNING: unusable reference target found: profile#module-cProfile WARNING: unusable reference target found: hotshot#module-hotshot WARNING: unusable reference target found: hotshot#module-hotshot WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: profile#module-pstats WARNING: unusable reference target found: profile#pstats.Stats WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.repeat WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: timeit#timeit.Timer WARNING: unusable reference target found: timeit#timeit.repeat WARNING: unusable reference target found: timeit#timeit.Timer WARNING: unusable reference target found: timeit#timeit.timeit WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.clock WARNING: unusable reference target found: time#time.clock WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.clock WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.clock WARNING: unusable reference target found: functions#hasattr WARNING: unusable reference target found: timeit#module-timeit WARNING: unusable reference target found: trace#module-trace WARNING: unusable reference target found: trace#module-trace WARNING: unusable reference target found: trace#trace.Trace WARNING: unusable reference target found: fileinput#module-fileinput WARNING: unusable reference target found: traceback#module-traceback WARNING: unusable reference target found: sys#sys.exc_clear WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: sys#sys.dont_write_bytecode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: sys#sys.setcheckinterval WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sys#sys.getfilesystemencoding WARNING: unusable reference target found: sys#sys.getrefcount WARNING: unusable reference target found: sys#sys.setrecursionlimit WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: sys#sys.setprofile WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: sys#sys.gettrace WARNING: unusable reference target found: functions#hex WARNING: unusable reference target found: pdb#debugger WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: sys#sys.path WARNING: unusable reference target found: sys#sys.platform WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: profile#profile WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: sys#sys.version WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: objects#builtin WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: future_builtins#future_builtins.ascii WARNING: unusable reference target found: future_builtins#future_builtins.ascii WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: itertools#itertools.ifilter WARNING: unusable reference target found: functions#hex WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: functions#oct WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: warnings#warnings.warn WARNING: unusable reference target found: warnings#warnings.filterwarnings WARNING: unusable reference target found: warnings#warnings.resetwarnings WARNING: unusable reference target found: warnings#warnings.showwarning WARNING: unusable reference target found: warnings#warnings.formatwarning WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.UserWarning WARNING: unusable reference target found: warnings#warnings.warn WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: exceptions#exceptions.SyntaxWarning WARNING: unusable reference target found: exceptions#exceptions.RuntimeWarning WARNING: unusable reference target found: exceptions#exceptions.FutureWarning WARNING: unusable reference target found: exceptions#exceptions.PendingDeprecationWarning WARNING: unusable reference target found: exceptions#exceptions.ImportWarning WARNING: unusable reference target found: exceptions#exceptions.UnicodeWarning WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: warnings#warnings.catch_warnings WARNING: unusable reference target found: warnings#warnings.catch_warnings WARNING: unusable reference target found: warnings#warnings.showwarning WARNING: unusable reference target found: exceptions#exceptions.UserWarning WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: warnings#warnings.warn WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: warnings#warnings.warn WARNING: unusable reference target found: exceptions#exceptions.Warning WARNING: unusable reference target found: warnings#warnings.warnpy3k WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: warnings#warnings.showwarning WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: warnings#warnings.formatwarning WARNING: unusable reference target found: warnings#warnings.filterwarnings WARNING: unusable reference target found: warnings#warnings.filterwarnings WARNING: unusable reference target found: warnings#warnings.simplefilter WARNING: unusable reference target found: warnings#warnings.showwarning WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: warnings#warnings.showwarning WARNING: unusable reference target found: warnings#warnings.showwarning WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: warnings#warnings.catch_warnings WARNING: unusable reference target found: stdtypes#typecontextmanager WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#issubclass WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: abc#abc.ABCMeta WARNING: unusable reference target found: abc#abc.ABCMeta.register WARNING: unusable reference target found: abc#abc.ABCMeta.__subclasshook__ WARNING: unusable reference target found: abc#abc.ABCMeta WARNING: unusable reference target found: abc#abc.ABCMeta WARNING: unusable reference target found: abc#abc.abstractmethod WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: abc#abc.ABCMeta WARNING: unusable reference target found: abc#abc.ABCMeta WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: atexit#atexit.register WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: atexit#module-atexit WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: atexit#atexit.register WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: traceback#traceback.print_tb WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: traceback#traceback.extract_tb WARNING: unusable reference target found: traceback#traceback.print_stack WARNING: unusable reference target found: traceback#traceback.extract_tb WARNING: unusable reference target found: traceback#traceback.extract_stack WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: code#module-code WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: gc#module-gc WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: gc#gc.collect WARNING: unusable reference target found: gc#gc.get_referrers WARNING: unusable reference target found: gc#gc.get_referrers WARNING: unusable reference target found: gc#gc.get_referrers WARNING: unusable reference target found: gc#gc.DEBUG_SAVEALL WARNING: unusable reference target found: gc#gc.set_debug WARNING: unusable reference target found: gc#gc.DEBUG_COLLECTABLE WARNING: unusable reference target found: gc#gc.DEBUG_UNCOLLECTABLE WARNING: unusable reference target found: gc#gc.DEBUG_COLLECTABLE WARNING: unusable reference target found: gc#gc.DEBUG_UNCOLLECTABLE WARNING: unusable reference target found: inspect#module-inspect WARNING: unusable reference target found: inspect#inspect.getmembers WARNING: unusable reference target found: inspect#inspect.getmembers WARNING: unusable reference target found: inspect#inspect.getmembers WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: imp#module-imp WARNING: unusable reference target found: inspect#inspect.ismethod WARNING: unusable reference target found: inspect#inspect.isclass WARNING: unusable reference target found: inspect#inspect.isfunction WARNING: unusable reference target found: inspect#inspect.ismethoddescriptor WARNING: unusable reference target found: inspect#inspect.ismethod WARNING: unusable reference target found: inspect#inspect.cleandoc WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: inspect#inspect.getargspec WARNING: unusable reference target found: inspect#inspect.getargvalues WARNING: unusable reference target found: gc#gc.disable WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: user#module-user WARNING: unusable reference target found: user#module-user WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: user#module-user WARNING: unusable reference target found: user#module-user WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: fpectl#fpectl-limitations WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: fpectl#fpectl.FloatingPointError WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: fpectl#fpectl.turnon_sigfpe WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: fpectl#module-fpectl WARNING: unusable reference target found: code#module-code WARNING: unusable reference target found: codeop#module-codeop WARNING: unusable reference target found: code#code.InteractiveInterpreter WARNING: unusable reference target found: code#code.InteractiveConsole WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: code#code.InteractiveConsole WARNING: unusable reference target found: code#code.interact WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: code#code.compile_command WARNING: unusable reference target found: code#code.compile_command WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: code#code.InteractiveInterpreter.showsyntaxerror WARNING: unusable reference target found: code#code.InteractiveInterpreter.runsource WARNING: unusable reference target found: code#code.compile_command WARNING: unusable reference target found: code#code.InteractiveInterpreter.runsource WARNING: unusable reference target found: code#code.compile_command WARNING: unusable reference target found: code#code.InteractiveInterpreter.runcode WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: code#code.InteractiveInterpreter.runsource WARNING: unusable reference target found: code#code.InteractiveInterpreter.showtraceback WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: code#code.InteractiveInterpreter.write WARNING: unusable reference target found: code#code.InteractiveInterpreter.write WARNING: unusable reference target found: code#code.InteractiveConsole WARNING: unusable reference target found: code#code.InteractiveInterpreter WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: codeop#module-codeop WARNING: unusable reference target found: code#module-code WARNING: unusable reference target found: code#module-code WARNING: unusable reference target found: codeop#module-codeop WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: codeop#codeop.compile_command WARNING: unusable reference target found: codeop#codeop.Compile WARNING: unusable reference target found: codeop#codeop.CommandCompiler WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: bastion#module-Bastion WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec.r_open WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: imp#module-imp WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: rexec#rexec.RExec WARNING: unusable reference target found: bastion#module-Bastion WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: bastion#Bastion.BastionClass WARNING: unusable reference target found: bastion#Bastion.BastionClass WARNING: unusable reference target found: bastion#Bastion.Bastion WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: bastion#Bastion.BastionClass WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: imp#imp.PY_SOURCE WARNING: unusable reference target found: imp#imp.PY_COMPILED WARNING: unusable reference target found: imp#imp.C_EXTENSION WARNING: unusable reference target found: imp#imp.get_suffixes WARNING: unusable reference target found: imp#imp.C_BUILTIN WARNING: unusable reference target found: imp#imp.PY_FROZEN WARNING: unusable reference target found: imp#imp.get_suffixes WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: imp#imp.PKG_DIRECTORY WARNING: unusable reference target found: imp#imp.find_module WARNING: unusable reference target found: imp#imp.load_module WARNING: unusable reference target found: imp#imp.find_module WARNING: unusable reference target found: imp#imp.find_module WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: imp#imp.get_suffixes WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: imp#imp.find_module WARNING: unusable reference target found: imp#imp.init_frozen WARNING: unusable reference target found: imp#imp.find_module WARNING: unusable reference target found: imp#imp.load_module WARNING: unusable reference target found: imp#imp.init_builtin WARNING: unusable reference target found: imp#imp.init_frozen WARNING: unusable reference target found: imp#imp.NullImporter WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: imp#imp.NullImporter WARNING: unusable reference target found: imp#imp.find_module WARNING: unusable reference target found: imp#imp.load_module WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: imputil#module-imputil WARNING: unusable reference target found: imputil#module-imputil WARNING: unusable reference target found: imputil#imputil.Importer WARNING: unusable reference target found: zipimport#module-zipimport WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: zipimport#zipimport.zipimporter WARNING: unusable reference target found: zipimport#zipimport.ZipImportError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: zipimport#zipimport.ZipImportError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: zipimport#zipimport.ZipImportError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: zipimport#zipimport.ZipImportError WARNING: unusable reference target found: zipimport#zipimport.ZipImportError WARNING: unusable reference target found: zipimport#zipimport.zipimporter.archive WARNING: unusable reference target found: zipimport#zipimport.zipimporter.prefix WARNING: unusable reference target found: zipimport#zipimport.zipimporter WARNING: unusable reference target found: zipimport#module-zipimport WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: os.path#os.path.isdir WARNING: unusable reference target found: pkgutil#pkgutil.get_data WARNING: unusable reference target found: pkgutil#pkgutil.get_data WARNING: unusable reference target found: modulefinder#modulefinder.ModuleFinder WARNING: unusable reference target found: modulefinder#modulefinder.ModuleFinder.run_script WARNING: unusable reference target found: modulefinder#modulefinder.ModuleFinder.report WARNING: unusable reference target found: modulefinder#modulefinder-example WARNING: unusable reference target found: runpy#module-runpy WARNING: unusable reference target found: runpy#module-runpy WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: parser#parser.expr WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: parser#parser.sequence2st WARNING: unusable reference target found: parser#parser.st2list WARNING: unusable reference target found: parser#parser.st2tuple WARNING: unusable reference target found: symbol#module-symbol WARNING: unusable reference target found: token#module-token WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: symbol#module-symbol WARNING: unusable reference target found: token#module-token WARNING: unusable reference target found: parser#parser.expr WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: parser#parser.ParserError WARNING: unusable reference target found: parser#parser.compilest WARNING: unusable reference target found: exceptions#exceptions.MemoryError WARNING: unusable reference target found: parser#parser.sequence2st WARNING: unusable reference target found: parser#parser.st2tuple WARNING: unusable reference target found: parser#parser.st2list WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: parser#parser.expr WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: parser#parser.sequence2st WARNING: unusable reference target found: parser#parser.compilest WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: parser#parser.isexpr WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: parser#parser.sequence2st WARNING: unusable reference target found: parser#parser.sequence2st WARNING: unusable reference target found: parser#parser.compilest WARNING: unusable reference target found: parser#parser.expr WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: exceptions#exceptions.MemoryError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.SystemError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: parser#parser.expr WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: parser#parser.sequence2st WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: symbol#module-symbol WARNING: unusable reference target found: token#module-token WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: parser#parser.suite WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: ast#ast.parse WARNING: unusable reference target found: ast#ast.AST WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: ast#abstract-grammar WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: ast#ast.AST._fields WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: ast#ast.AST.lineno WARNING: unusable reference target found: ast#ast.AST.col_offset WARNING: unusable reference target found: ast#ast.AST.lineno WARNING: unusable reference target found: ast#ast.AST.col_offset WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: inspect#inspect.cleandoc WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: ast#ast.NodeVisitor.visit WARNING: unusable reference target found: ast#ast.NodeVisitor.generic_visit WARNING: unusable reference target found: ast#ast.NodeVisitor.visit WARNING: unusable reference target found: ast#ast.NodeVisitor.generic_visit WARNING: unusable reference target found: ast#ast.NodeVisitor WARNING: unusable reference target found: ast#ast.NodeTransformer WARNING: unusable reference target found: ast#ast.NodeVisitor WARNING: unusable reference target found: ast#ast.NodeTransformer WARNING: unusable reference target found: symtable#module-symtable WARNING: unusable reference target found: symtable#symtable.SymbolTable WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: symtable#symtable.SymbolTable.get_type WARNING: unusable reference target found: symtable#symtable.SymbolTable.get_children WARNING: unusable reference target found: symtable#symtable.Symbol WARNING: unusable reference target found: symtable#symtable.Symbol WARNING: unusable reference target found: symtable#symtable.SymbolTable WARNING: unusable reference target found: symtable#symtable.SymbolTable WARNING: unusable reference target found: symtable#symtable.SymbolTable WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: symbol#module-symbol WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: symbol#module-symbol WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: tokenize#module-tokenize WARNING: unusable reference target found: tokenize#tokenize.generate_tokens WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: tokenize#tokenize.tokenize WARNING: unusable reference target found: tokenize#tokenize.tokenize WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: tokenize#tokenize.generate_tokens WARNING: unusable reference target found: token#module-token WARNING: unusable reference target found: tokenize#module-tokenize WARNING: unusable reference target found: tokenize#tokenize.tokenize WARNING: unusable reference target found: tabnanny#tabnanny.check WARNING: unusable reference target found: tabnanny#tabnanny.tokeneater WARNING: unusable reference target found: tabnanny#tabnanny.check WARNING: unusable reference target found: tabnanny#tabnanny.check WARNING: unusable reference target found: tokenize#tokenize.tokenize WARNING: unusable reference target found: tokenize#module-tokenize WARNING: unusable reference target found: pyclbr#module-pyclbr WARNING: unusable reference target found: pyclbr#pyclbr.readmodule WARNING: unusable reference target found: pyclbr#pyclbr.readmodule WARNING: unusable reference target found: pyclbr#pyclbr.readmodule_ex WARNING: unusable reference target found: pyclbr#pyclbr.readmodule WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: pyclbr#pyclbr.readmodule_ex WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: py_compile#module-py_compile WARNING: unusable reference target found: py_compile#py_compile.PyCompileError WARNING: unusable reference target found: py_compile#py_compile.main WARNING: unusable reference target found: compileall#module-compileall WARNING: unusable reference target found: compileall#compileall.compile_dir WARNING: unusable reference target found: py_compile#module-py_compile WARNING: unusable reference target found: dis#module-dis WARNING: unusable reference target found: dis#module-dis WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#slice WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickletools#module-pickletools WARNING: unusable reference target found: distutils#module-distutils WARNING: unusable reference target found: distutils#module-distutils WARNING: unusable reference target found: compiler#module-compiler WARNING: unusable reference target found: compiler#module-compiler WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: compiler#module-compiler WARNING: unusable reference target found: compiler#module-compiler WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: compiler#module-compiler WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: compiler#module-compiler.ast WARNING: unusable reference target found: parser#module-parser WARNING: unusable reference target found: compiler#module-compiler.ast WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node.getChildren WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#module-compiler.ast WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: constants#Ellipsis WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#globals WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#iter WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#vars WARNING: unusable reference target found: compiler#compiler.ast.Node WARNING: unusable reference target found: compiler#module-compiler.ast WARNING: unusable reference target found: compiler#module-compiler WARNING: unusable reference target found: compiler#compiler.visitor.ASTVisitor WARNING: unusable reference target found: compiler#compiler.visitor.ASTVisitor.preorder WARNING: unusable reference target found: compiler#compiler.visitor.ASTVisitor.preorder WARNING: unusable reference target found: compiler#compiler.visitor.ASTVisitor WARNING: unusable reference target found: compiler#compiler.visitor.ASTVisitor.default WARNING: unusable reference target found: compiler#compiler.visitor.ASTVisitor WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: formatter#formatter.formatter.add_flowing_data WARNING: unusable reference target found: formatter#formatter.formatter.add_flowing_data WARNING: unusable reference target found: formatter#formatter.AS_IS WARNING: unusable reference target found: formatter#formatter.AS_IS WARNING: unusable reference target found: formatter#formatter.AS_IS WARNING: unusable reference target found: formatter#formatter.AS_IS WARNING: unusable reference target found: formatter#formatter.formatter.push_style WARNING: unusable reference target found: formatter#formatter.AS_IS WARNING: unusable reference target found: formatter#formatter.NullWriter WARNING: unusable reference target found: formatter#formatter.NullFormatter WARNING: unusable reference target found: formatter#formatter.AbstractFormatter WARNING: unusable reference target found: formatter#formatter.AS_IS WARNING: unusable reference target found: formatter#formatter.writer.send_line_break WARNING: unusable reference target found: formatter#formatter.writer.send_line_break WARNING: unusable reference target found: formatter#formatter.NullWriter WARNING: unusable reference target found: msilib#module-msilib WARNING: unusable reference target found: distutils#module-distutils WARNING: unusable reference target found: msilib#msilib.add_data WARNING: unusable reference target found: msilib#msilib.SummaryInformation.GetProperty WARNING: unusable reference target found: msilib#msilib.CAB WARNING: unusable reference target found: msilib#msilib.Directory.start_component WARNING: unusable reference target found: msilib#msilib.Directory WARNING: unusable reference target found: msilib#module-msilib WARNING: unusable reference target found: msilib#module-msilib WARNING: unusable reference target found: msilib#msilib.Dialog WARNING: unusable reference target found: msilib#msilib.Control WARNING: unusable reference target found: msilib#module-msilib WARNING: unusable reference target found: getpass#module-getpass WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: os#os.O_TEXT WARNING: unusable reference target found: os#os.O_BINARY WARNING: unusable reference target found: os#os.O_APPEND WARNING: unusable reference target found: os#os.O_RDONLY WARNING: unusable reference target found: os#os.O_TEXT WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: msvcrt#msvcrt.getch WARNING: unusable reference target found: msvcrt#msvcrt.getch WARNING: unusable reference target found: msvcrt#msvcrt.getche WARNING: unusable reference target found: msvcrt#msvcrt.putch WARNING: unusable reference target found: msvcrt#msvcrt.getch WARNING: unusable reference target found: msvcrt#msvcrt.getche WARNING: unusable reference target found: msvcrt#msvcrt.ungetch WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: _winreg#module-_winreg WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: _winreg#_winreg.FlushKey WARNING: unusable reference target found: _winreg#_winreg.CloseKey WARNING: unusable reference target found: _winreg#_winreg.FlushKey WARNING: unusable reference target found: _winreg#_winreg.FlushKey WARNING: unusable reference target found: _winreg#_winreg.FlushKey WARNING: unusable reference target found: _winreg#_winreg.SaveKey WARNING: unusable reference target found: _winreg#_winreg.ConnectRegistry WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: _winreg#_winreg.OpenKeyEx WARNING: unusable reference target found: _winreg#_winreg.OpenKey WARNING: unusable reference target found: _winreg#_winreg.SetValue WARNING: unusable reference target found: _winreg#_winreg.LoadKey WARNING: unusable reference target found: _winreg#_winreg.SetValueEx WARNING: unusable reference target found: _winreg#_winreg.OpenKey WARNING: unusable reference target found: _winreg#_winreg.CloseKey WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: _winreg#_winreg.PyHKEY.__enter__ WARNING: unusable reference target found: _winreg#_winreg.PyHKEY.__exit__ WARNING: unusable reference target found: winsound#module-winsound WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: winsound#winsound.SND_ALIAS WARNING: unusable reference target found: winsound#winsound.SND_NODEFAULT WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: winsound#winsound.SND_FILENAME WARNING: unusable reference target found: winsound#winsound.PlaySound WARNING: unusable reference target found: winsound#winsound.SND_ASYNC WARNING: unusable reference target found: winsound#winsound.SND_MEMORY WARNING: unusable reference target found: winsound#winsound.PlaySound WARNING: unusable reference target found: winsound#winsound.SND_ASYNC WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: posix#module-posix WARNING: unusable reference target found: posix#module-posix WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: posix#module-posix WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: posix#module-posix WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: posix#module-posix WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: crypt#module-crypt WARNING: unusable reference target found: spwd#module-spwd WARNING: unusable reference target found: grp#module-grp WARNING: unusable reference target found: spwd#module-spwd WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: grp#module-grp WARNING: unusable reference target found: pwd#module-pwd WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: pwd#module-pwd WARNING: unusable reference target found: spwd#module-spwd WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: exceptions#exceptions.SystemError WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: dl#dl.RTLD_LAZY WARNING: unusable reference target found: dl#dl.RTLD_NOW WARNING: unusable reference target found: dl#dl.RTLD_LAZY WARNING: unusable reference target found: dl#dl.RTLD_NOW WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#hasattr WARNING: unusable reference target found: dl#module-dl WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: termios#module-termios WARNING: unusable reference target found: termios#termios.tcgetattr WARNING: unusable reference target found: tty#module-tty WARNING: unusable reference target found: termios#termios.tcgetattr WARNING: unusable reference target found: tty#module-tty WARNING: unusable reference target found: termios#module-termios WARNING: unusable reference target found: tty#module-tty WARNING: unusable reference target found: termios#termios.tcsetattr WARNING: unusable reference target found: termios#termios.tcsetattr WARNING: unusable reference target found: termios#module-termios WARNING: unusable reference target found: pty#module-pty WARNING: unusable reference target found: pty#module-pty WARNING: unusable reference target found: os#os.openpty WARNING: unusable reference target found: fcntl#module-fcntl WARNING: unusable reference target found: struct#struct.pack WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: fcntl#fcntl.fcntl WARNING: unusable reference target found: termios#module-termios WARNING: unusable reference target found: fcntl#fcntl.fcntl WARNING: unusable reference target found: fcntl#fcntl.ioctl WARNING: unusable reference target found: fcntl#fcntl.ioctl WARNING: unusable reference target found: fcntl#fcntl.ioctl WARNING: unusable reference target found: fcntl#fcntl.fcntl WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: fcntl#fcntl.flock WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: fcntl#fcntl.lockf WARNING: unusable reference target found: fcntl#fcntl.flock WARNING: unusable reference target found: pipes#module-pipes WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: pipes#module-pipes WARNING: unusable reference target found: pipes#pipes.Template.append WARNING: unusable reference target found: fcntl#fcntl.lockf WARNING: unusable reference target found: fcntl#fcntl.fcntl WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: posixfile#module-posixfile WARNING: unusable reference target found: posixfile#module-posixfile WARNING: unusable reference target found: posixfile#module-posixfile WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: posixfile#posixfile.SEEK_SET WARNING: unusable reference target found: posixfile#posixfile.SEEK_CUR WARNING: unusable reference target found: posixfile#posixfile.SEEK_END WARNING: unusable reference target found: posixfile#posixfile.SEEK_SET WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: resource#resource.setrlimit WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: resource#resource.error WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: resource#resource.error WARNING: unusable reference target found: resource#resource.setrlimit WARNING: unusable reference target found: resource#resource.getrlimit WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: resource#resource.RLIMIT_NOFILE WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: resource#resource.error WARNING: unusable reference target found: resource#resource.getrusage WARNING: unusable reference target found: resource#resource.getrusage WARNING: unusable reference target found: resource#resource.RUSAGE_SELF WARNING: unusable reference target found: resource#resource.getrusage WARNING: unusable reference target found: resource#resource.getrusage WARNING: unusable reference target found: nis#module-nis WARNING: unusable reference target found: nis#module-nis WARNING: unusable reference target found: nis#nis.error WARNING: unusable reference target found: nis#module-nis WARNING: unusable reference target found: syslog#syslog.openlog WARNING: unusable reference target found: syslog#syslog.openlog WARNING: unusable reference target found: syslog#syslog.syslog WARNING: unusable reference target found: syslog#syslog.syslog WARNING: unusable reference target found: commands#module-commands WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: commands#module-commands WARNING: unusable reference target found: commands#commands.getstatus WARNING: unusable reference target found: commands#commands.getstatusoutput WARNING: unusable reference target found: commands#commands.getoutput WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: commands#module-commands WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: commands#commands.getstatusoutput WARNING: unusable reference target found: commands#commands.getoutput WARNING: unusable reference target found: commands#commands.getstatusoutput WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: macosa#mac-scripting WARNING: unusable reference target found: undoc#undoc-mac-modules WARNING: unusable reference target found: ic#module-ic WARNING: unusable reference target found: ic#ic.error WARNING: unusable reference target found: ic#module-ic WARNING: unusable reference target found: ic#module-ic WARNING: unusable reference target found: ic#ic.IC WARNING: unusable reference target found: ic#module-ic WARNING: unusable reference target found: ic#ic.IC WARNING: unusable reference target found: undoc#module-macerrors WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: macostools#module-macostools WARNING: unusable reference target found: macostools#macostools.mkalias WARNING: unusable reference target found: macostools#module-findertools WARNING: unusable reference target found: easydialogs#module-EasyDialogs WARNING: unusable reference target found: easydialogs#module-EasyDialogs WARNING: unusable reference target found: easydialogs#EasyDialogs.AskString WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: easydialogs#EasyDialogs.AskString WARNING: unusable reference target found: easydialogs#EasyDialogs.AskString WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar WARNING: unusable reference target found: getopt#getopt.getopt WARNING: unusable reference target found: getopt#getopt.getopt WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: easydialogs#module-EasyDialogs WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: easydialogs#EasyDialogs.AskFileForOpen WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: easydialogs#EasyDialogs.AskFileForOpen WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.curval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.maxval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.curval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.maxval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.maxval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.curval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.maxval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.maxval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.curval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.curval WARNING: unusable reference target found: easydialogs#EasyDialogs.ProgressBar.maxval WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: undoc#module-W WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: framework#FrameWork.Application.mainloop WARNING: unusable reference target found: framework#FrameWork.ScrolledWindow.getscrollbarvalues WARNING: unusable reference target found: framework#FrameWork.ScrolledWindow.getscrollbarvalues WARNING: unusable reference target found: autogil#module-autoGIL WARNING: unusable reference target found: autogil#autoGIL.installAutoGIL WARNING: unusable reference target found: colorpicker#module-ColorPicker WARNING: unusable reference target found: colorpicker#ColorPicker.GetColor WARNING: unusable reference target found: gensuitemodule#module-gensuitemodule WARNING: unusable reference target found: gensuitemodule#module-gensuitemodule WARNING: unusable reference target found: aetools#module-aetools WARNING: unusable reference target found: aetypes#module-aetypes WARNING: unusable reference target found: aepack#module-aepack WARNING: unusable reference target found: gensuitemodule#module-gensuitemodule WARNING: unusable reference target found: aetools#module-aetools WARNING: unusable reference target found: aetools#module-aetools WARNING: unusable reference target found: carbon#module-Carbon.AE WARNING: unusable reference target found: aetools#module-aetools WARNING: unusable reference target found: aetools#module-aetools WARNING: unusable reference target found: aepack#module-aepack WARNING: unusable reference target found: carbon#module-Carbon.AE WARNING: unusable reference target found: aepack#module-aepack WARNING: unusable reference target found: aetypes#aetypes.ObjectSpecifier WARNING: unusable reference target found: gensuitemodule#module-gensuitemodule WARNING: unusable reference target found: carbon#module-Carbon.AE WARNING: unusable reference target found: aetypes#module-aetypes WARNING: unusable reference target found: aetypes#module-aetypes WARNING: unusable reference target found: aepack#module-aepack WARNING: unusable reference target found: aetypes#module-aetypes WARNING: unusable reference target found: gensuitemodule#module-gensuitemodule WARNING: unusable reference target found: aepack#module-aepack WARNING: unusable reference target found: aetypes#module-aetypes WARNING: unusable reference target found: miniaeframe#module-MiniAEFrame WARNING: unusable reference target found: framework#module-FrameWork WARNING: unusable reference target found: miniaeframe#module-MiniAEFrame WARNING: unusable reference target found: miniaeframe#MiniAEFrame.MiniApplication WARNING: unusable reference target found: framework#FrameWork.Application WARNING: unusable reference target found: framework#FrameWork.Application WARNING: unusable reference target found: miniaeframe#MiniAEFrame.AEServer WARNING: unusable reference target found: aetools#aetools.packevent WARNING: unusable reference target found: al#module-al WARNING: unusable reference target found: al#module-AL WARNING: unusable reference target found: al#al.newconfig WARNING: unusable reference target found: al#al.queryparams WARNING: unusable reference target found: al#al.queryparams WARNING: unusable reference target found: al#al.newconfig WARNING: unusable reference target found: al#al.openport WARNING: unusable reference target found: al#module-AL WARNING: unusable reference target found: al#module-al WARNING: unusable reference target found: cd#module-cd WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: cd#cd.createparser WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: cd#module-cd WARNING: unusable reference target found: cd#cd.PAUSED WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: cd#cd.ERROR WARNING: unusable reference target found: cd#cd.NODISC WARNING: unusable reference target found: cd#cd.READY WARNING: unusable reference target found: cd#cd.PLAYING WARNING: unusable reference target found: cd#cd.PAUSED WARNING: unusable reference target found: cd#cd.STILL WARNING: unusable reference target found: cd#cd.CDROM WARNING: unusable reference target found: cd#cd.msftoframe WARNING: unusable reference target found: cd#cd.createparser WARNING: unusable reference target found: cd#module-cd WARNING: unusable reference target found: fl#module-fl WARNING: unusable reference target found: fl#module-FL WARNING: unusable reference target found: fl#fl.make_form WARNING: unusable reference target found: fl#module-fl WARNING: unusable reference target found: fl#module-fl WARNING: unusable reference target found: fl#fl.do_forms WARNING: unusable reference target found: fl#fl.show_file_selector WARNING: unusable reference target found: fl#fl.do_forms WARNING: unusable reference target found: fl#fl.qread WARNING: unusable reference target found: fl#fl.make_form WARNING: unusable reference target found: fl#fl.do_forms WARNING: unusable reference target found: fl#fl.check_forms WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: fl#module-FL WARNING: unusable reference target found: fl#module-fl WARNING: unusable reference target found: fl#module-flp WARNING: unusable reference target found: fl#module-fl WARNING: unusable reference target found: fm#module-fm WARNING: unusable reference target found: fm#module-fm WARNING: unusable reference target found: gl#module-gl WARNING: unusable reference target found: gl#module-DEVICE WARNING: unusable reference target found: gl#module-GL WARNING: unusable reference target found: imgfile#module-imgfile WARNING: unusable reference target found: imgfile#module-imgfile WARNING: unusable reference target found: imgfile#imgfile.readscaled WARNING: unusable reference target found: jpeg#module-jpeg WARNING: unusable reference target found: jpeg#module-jpeg WARNING: unusable reference target found: jpeg#module-jpeg WARNING: unusable reference target found: jpeg#jpeg.compress WARNING: unusable reference target found: jpeg#jpeg.decompress WARNING: unusable reference target found: jpeg#jpeg.compress WARNING: unusable reference target found: jpeg#jpeg.compress WARNING: unusable reference target found: jpeg#jpeg.compress WARNING: unusable reference target found: jpeg#jpeg.decompress WARNING: unusable reference target found: sunaudio#module-sunaudiodev WARNING: unusable reference target found: sunaudio#module-SUNAUDIODEV WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: sunaudio#module-SUNAUDIODEV WARNING: unusable reference target found: sunaudio#module-sunaudiodev WARNING: unusable reference target found: rexec#module-rexec WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: ossaudiodev#module-ossaudiodev WARNING: unusable reference target found: undoc#module-cfmfile WARNING: unusable reference target found: undoc#module-icopen WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: undoc#module-macerrors WARNING: unusable reference target found: undoc#module-macresource WARNING: unusable reference target found: undoc#module-PixMapWrapper WARNING: unusable reference target found: undoc#module-videoreader WARNING: unusable reference target found: undoc#module-W WARNING: unusable reference target found: time#time.clock done processing reference.tex... reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar resolving references... writing... WARNING: unusable reference target found: ../@token#grammar-token-lc_letter WARNING: unusable reference target found: ../@token#grammar-token-lc_letter WARNING: unusable reference target found: ../@token#grammar-token-letter WARNING: unusable reference target found: ../@token#grammar-token-letter WARNING: unusable reference target found: ../@token#grammar-token-digit WARNING: unusable reference target found: ../@token#grammar-token-lowercase WARNING: unusable reference target found: ../@token#grammar-token-uppercase WARNING: unusable reference target found: compound_stmts#as WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#as WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: datamodel#specialnames WARNING: unusable reference target found: expressions#atom-identifiers WARNING: unusable reference target found: ../@token#grammar-token-stringprefix WARNING: unusable reference target found: ../@token#grammar-token-shortstring WARNING: unusable reference target found: ../@token#grammar-token-longstring WARNING: unusable reference target found: ../@token#grammar-token-shortstringitem WARNING: unusable reference target found: ../@token#grammar-token-shortstringitem WARNING: unusable reference target found: ../@token#grammar-token-longstringitem WARNING: unusable reference target found: ../@token#grammar-token-longstringitem WARNING: unusable reference target found: ../@token#grammar-token-shortstringchar WARNING: unusable reference target found: ../@token#grammar-token-escapeseq WARNING: unusable reference target found: ../@token#grammar-token-longstringchar WARNING: unusable reference target found: ../@token#grammar-token-escapeseq WARNING: unusable reference target found: ../@token#grammar-token-stringprefix WARNING: unusable reference target found: lexical_analysis#encodings WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: ../@token#grammar-token-decimalinteger WARNING: unusable reference target found: ../@token#grammar-token-octinteger WARNING: unusable reference target found: ../@token#grammar-token-hexinteger WARNING: unusable reference target found: ../@token#grammar-token-bininteger WARNING: unusable reference target found: ../@token#grammar-token-nonzerodigit WARNING: unusable reference target found: ../@token#grammar-token-digit WARNING: unusable reference target found: ../@token#grammar-token-octdigit WARNING: unusable reference target found: ../@token#grammar-token-octdigit WARNING: unusable reference target found: ../@token#grammar-token-hexdigit WARNING: unusable reference target found: ../@token#grammar-token-bindigit WARNING: unusable reference target found: ../@token#grammar-token-digit WARNING: unusable reference target found: ../@token#grammar-token-pointfloat WARNING: unusable reference target found: ../@token#grammar-token-exponentfloat WARNING: unusable reference target found: ../@token#grammar-token-intpart WARNING: unusable reference target found: ../@token#grammar-token-fraction WARNING: unusable reference target found: ../@token#grammar-token-intpart WARNING: unusable reference target found: ../@token#grammar-token-intpart WARNING: unusable reference target found: ../@token#grammar-token-pointfloat WARNING: unusable reference target found: ../@token#grammar-token-exponent WARNING: unusable reference target found: ../@token#grammar-token-digit WARNING: unusable reference target found: ../@token#grammar-token-digit WARNING: unusable reference target found: ../@token#grammar-token-digit WARNING: unusable reference target found: ../@token#grammar-token-floatnumber WARNING: unusable reference target found: ../@token#grammar-token-intpart WARNING: unusable reference target found: expressions#is WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#del WARNING: unusable reference target found: simple_stmts#del WARNING: unusable reference target found: expressions#dict WARNING: unusable reference target found: expressions#calls WARNING: unusable reference target found: compound_stmts#function WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__call__ WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: compound_stmts#class WARNING: unusable reference target found: datamodel#descriptors WARNING: unusable reference target found: datamodel#descriptors WARNING: unusable reference target found: datamodel#object.__getattr__ WARNING: unusable reference target found: datamodel#object.__setattr__ WARNING: unusable reference target found: datamodel#object.__delattr__ WARNING: unusable reference target found: datamodel#specialnames WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__init__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__del__ WARNING: unusable reference target found: datamodel#object.__repr__ WARNING: unusable reference target found: datamodel#object.__str__ WARNING: unusable reference target found: datamodel#object.__repr__ WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: datamodel#object.__repr__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__ne__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__lt__ WARNING: unusable reference target found: datamodel#object.__gt__ WARNING: unusable reference target found: datamodel#object.__le__ WARNING: unusable reference target found: datamodel#object.__ge__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__ne__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__ne__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__len__ WARNING: unusable reference target found: datamodel#object.__len__ WARNING: unusable reference target found: datamodel#object.__nonzero__ WARNING: unusable reference target found: datamodel#object.__getattr__ WARNING: unusable reference target found: datamodel#object.__getattr__ WARNING: unusable reference target found: datamodel#object.__setattr__ WARNING: unusable reference target found: datamodel#object.__getattr__ WARNING: unusable reference target found: datamodel#object.__getattribute__ WARNING: unusable reference target found: datamodel#object.__setattr__ WARNING: unusable reference target found: datamodel#object.__setattr__ WARNING: unusable reference target found: datamodel#object.__getattr__ WARNING: unusable reference target found: datamodel#object.__getattribute__ WARNING: unusable reference target found: datamodel#new-style-special-lookup WARNING: unusable reference target found: datamodel#object.__get__ WARNING: unusable reference target found: datamodel#object.__set__ WARNING: unusable reference target found: datamodel#object.__delete__ WARNING: unusable reference target found: datamodel#object.__get__ WARNING: unusable reference target found: datamodel#object.__set__ WARNING: unusable reference target found: datamodel#object.__get__ WARNING: unusable reference target found: datamodel#descriptors WARNING: unusable reference target found: datamodel#object.__new__ WARNING: unusable reference target found: datamodel#object.__call__ WARNING: unusable reference target found: datamodel#object.__getslice__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__setitem__ WARNING: unusable reference target found: datamodel#object.__delitem__ WARNING: unusable reference target found: datamodel#object.__add__ WARNING: unusable reference target found: datamodel#object.__radd__ WARNING: unusable reference target found: datamodel#object.__iadd__ WARNING: unusable reference target found: datamodel#object.__mul__ WARNING: unusable reference target found: datamodel#object.__rmul__ WARNING: unusable reference target found: datamodel#object.__imul__ WARNING: unusable reference target found: datamodel#object.__coerce__ WARNING: unusable reference target found: datamodel#object.__contains__ WARNING: unusable reference target found: datamodel#object.__iter__ WARNING: unusable reference target found: datamodel#object.__iter__ WARNING: unusable reference target found: datamodel#object.__nonzero__ WARNING: unusable reference target found: datamodel#object.__len__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__reversed__ WARNING: unusable reference target found: datamodel#object.__len__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__reversed__ WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#notin WARNING: unusable reference target found: datamodel#object.__getslice__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__getslice__ WARNING: unusable reference target found: datamodel#object.__len__ WARNING: unusable reference target found: datamodel#object.__getslice__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__getslice__ WARNING: unusable reference target found: datamodel#object.__setslice__ WARNING: unusable reference target found: datamodel#object.__setitem__ WARNING: unusable reference target found: datamodel#object.__setslice__ WARNING: unusable reference target found: datamodel#object.__getslice__ WARNING: unusable reference target found: datamodel#object.__delslice__ WARNING: unusable reference target found: datamodel#object.__delitem__ WARNING: unusable reference target found: datamodel#object.__delslice__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__setitem__ WARNING: unusable reference target found: datamodel#object.__delitem__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: datamodel#object.__setitem__ WARNING: unusable reference target found: datamodel#object.__delitem__ WARNING: unusable reference target found: datamodel#object.__add__ WARNING: unusable reference target found: datamodel#object.__divmod__ WARNING: unusable reference target found: datamodel#object.__floordiv__ WARNING: unusable reference target found: datamodel#object.__mod__ WARNING: unusable reference target found: datamodel#object.__truediv__ WARNING: unusable reference target found: datamodel#object.__pow__ WARNING: unusable reference target found: datamodel#object.__truediv__ WARNING: unusable reference target found: datamodel#object.__div__ WARNING: unusable reference target found: datamodel#object.__add__ WARNING: unusable reference target found: datamodel#object.__rsub__ WARNING: unusable reference target found: datamodel#object.__rpow__ WARNING: unusable reference target found: datamodel#object.__iadd__ WARNING: unusable reference target found: datamodel#object.__iadd__ WARNING: unusable reference target found: datamodel#object.__coerce__ WARNING: unusable reference target found: datamodel#object.__coerce__ WARNING: unusable reference target found: datamodel#object.__add__ WARNING: unusable reference target found: datamodel#object.__radd__ WARNING: unusable reference target found: datamodel#object.__iadd__ WARNING: unusable reference target found: datamodel#object.__eq__ WARNING: unusable reference target found: datamodel#object.__cmp__ WARNING: unusable reference target found: datamodel#object.__coerce__ WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#as WARNING: unusable reference target found: datamodel#object.__exit__ WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#object.__hash__ WARNING: unusable reference target found: datamodel#object.__repr__ WARNING: unusable reference target found: datamodel#object.__getattribute__ WARNING: unusable reference target found: datamodel#object.__getattribute__ WARNING: unusable reference target found: datamodel#object.__get__ WARNING: unusable reference target found: datamodel#object.__set__ WARNING: unusable reference target found: datamodel#object.__delete__ WARNING: unusable reference target found: datamodel#object.__get__ WARNING: unusable reference target found: datamodel#object.__set__ WARNING: unusable reference target found: datamodel#object.__delete__ WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: simple_stmts#del WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: datamodel#coercion-rules WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-literal WARNING: unusable reference target found: ../@token#grammar-token-enclosure WARNING: unusable reference target found: ../@token#grammar-token-parenth_form WARNING: unusable reference target found: ../@token#grammar-token-list_display WARNING: unusable reference target found: ../@token#grammar-token-generator_expression WARNING: unusable reference target found: ../@token#grammar-token-dict_display WARNING: unusable reference target found: ../@token#grammar-token-string_conversion WARNING: unusable reference target found: ../@token#grammar-token-yield_atom WARNING: unusable reference target found: lexical_analysis#identifiers WARNING: unusable reference target found: executionmodel#naming WARNING: unusable reference target found: ../@token#grammar-token-stringliteral WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: ../@token#grammar-token-longinteger WARNING: unusable reference target found: ../@token#grammar-token-floatnumber WARNING: unusable reference target found: ../@token#grammar-token-imagnumber WARNING: unusable reference target found: lexical_analysis#literals WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-list_comprehension WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-list_for WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: ../@token#grammar-token-old_expression_list WARNING: unusable reference target found: ../@token#grammar-token-list_iter WARNING: unusable reference target found: ../@token#grammar-token-old_expression WARNING: unusable reference target found: ../@token#grammar-token-old_expression WARNING: unusable reference target found: ../@token#grammar-token-list_for WARNING: unusable reference target found: ../@token#grammar-token-list_if WARNING: unusable reference target found: ../@token#grammar-token-old_expression WARNING: unusable reference target found: ../@token#grammar-token-list_iter WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-genexpr_for WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: ../@token#grammar-token-or_test WARNING: unusable reference target found: ../@token#grammar-token-genexpr_iter WARNING: unusable reference target found: ../@token#grammar-token-genexpr_for WARNING: unusable reference target found: ../@token#grammar-token-genexpr_if WARNING: unusable reference target found: ../@token#grammar-token-old_expression WARNING: unusable reference target found: ../@token#grammar-token-genexpr_iter WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: expressions#calls WARNING: unusable reference target found: ../@token#grammar-token-key_datum_list WARNING: unusable reference target found: ../@token#grammar-token-key_datum WARNING: unusable reference target found: ../@token#grammar-token-key_datum WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-yield_expression WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: ../@token#grammar-token-atom WARNING: unusable reference target found: ../@token#grammar-token-attributeref WARNING: unusable reference target found: ../@token#grammar-token-subscription WARNING: unusable reference target found: ../@token#grammar-token-slicing WARNING: unusable reference target found: ../@token#grammar-token-call WARNING: unusable reference target found: ../@token#grammar-token-primary WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-primary WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#del WARNING: unusable reference target found: ../@token#grammar-token-simple_slicing WARNING: unusable reference target found: ../@token#grammar-token-extended_slicing WARNING: unusable reference target found: ../@token#grammar-token-primary WARNING: unusable reference target found: ../@token#grammar-token-short_slice WARNING: unusable reference target found: ../@token#grammar-token-primary WARNING: unusable reference target found: ../@token#grammar-token-slice_list WARNING: unusable reference target found: ../@token#grammar-token-slice_item WARNING: unusable reference target found: ../@token#grammar-token-slice_item WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-proper_slice WARNING: unusable reference target found: ../@token#grammar-token-ellipsis WARNING: unusable reference target found: ../@token#grammar-token-short_slice WARNING: unusable reference target found: ../@token#grammar-token-long_slice WARNING: unusable reference target found: ../@token#grammar-token-lower_bound WARNING: unusable reference target found: ../@token#grammar-token-upper_bound WARNING: unusable reference target found: ../@token#grammar-token-short_slice WARNING: unusable reference target found: ../@token#grammar-token-stride WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: ../@token#grammar-token-primary WARNING: unusable reference target found: ../@token#grammar-token-argument_list WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-genexpr_for WARNING: unusable reference target found: ../@token#grammar-token-positional_arguments WARNING: unusable reference target found: ../@token#grammar-token-keyword_arguments WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-keyword_arguments WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-keyword_arguments WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-keyword_item WARNING: unusable reference target found: ../@token#grammar-token-keyword_item WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: compound_stmts#function WARNING: unusable reference target found: compound_stmts#function WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: datamodel#object.__call__ WARNING: unusable reference target found: ../@token#grammar-token-primary WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-power WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-u_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-a_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-a_expr WARNING: unusable reference target found: ../@token#grammar-token-m_expr WARNING: unusable reference target found: ../@token#grammar-token-a_expr WARNING: unusable reference target found: ../@token#grammar-token-shift_expr WARNING: unusable reference target found: ../@token#grammar-token-a_expr WARNING: unusable reference target found: ../@token#grammar-token-shift_expr WARNING: unusable reference target found: ../@token#grammar-token-and_expr WARNING: unusable reference target found: ../@token#grammar-token-shift_expr WARNING: unusable reference target found: ../@token#grammar-token-and_expr WARNING: unusable reference target found: ../@token#grammar-token-xor_expr WARNING: unusable reference target found: ../@token#grammar-token-and_expr WARNING: unusable reference target found: ../@token#grammar-token-xor_expr WARNING: unusable reference target found: ../@token#grammar-token-or_expr WARNING: unusable reference target found: ../@token#grammar-token-xor_expr WARNING: unusable reference target found: ../@token#grammar-token-or_expr WARNING: unusable reference target found: ../@token#grammar-token-comp_operator WARNING: unusable reference target found: ../@token#grammar-token-or_expr WARNING: unusable reference target found: datamodel#specialnames WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#notin WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#notin WARNING: unusable reference target found: datamodel#object.__contains__ WARNING: unusable reference target found: datamodel#object.__contains__ WARNING: unusable reference target found: datamodel#object.__getitem__ WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#notin WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#is WARNING: unusable reference target found: expressions#isnot WARNING: unusable reference target found: expressions#is WARNING: unusable reference target found: ../@token#grammar-token-conditional_expression WARNING: unusable reference target found: ../@token#grammar-token-lambda_form WARNING: unusable reference target found: ../@token#grammar-token-or_test WARNING: unusable reference target found: ../@token#grammar-token-old_lambda_form WARNING: unusable reference target found: ../@token#grammar-token-or_test WARNING: unusable reference target found: ../@token#grammar-token-or_test WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-and_test WARNING: unusable reference target found: ../@token#grammar-token-or_test WARNING: unusable reference target found: ../@token#grammar-token-and_test WARNING: unusable reference target found: ../@token#grammar-token-not_test WARNING: unusable reference target found: ../@token#grammar-token-and_test WARNING: unusable reference target found: ../@token#grammar-token-not_test WARNING: unusable reference target found: ../@token#grammar-token-comparison WARNING: unusable reference target found: ../@token#grammar-token-not_test WARNING: unusable reference target found: datamodel#object.__nonzero__ WARNING: unusable reference target found: expressions#not WARNING: unusable reference target found: expressions#and WARNING: unusable reference target found: expressions#or WARNING: unusable reference target found: expressions#not WARNING: unusable reference target found: ../@token#grammar-token-parameter_list WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-parameter_list WARNING: unusable reference target found: ../@token#grammar-token-old_expression WARNING: unusable reference target found: compound_stmts#function WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: expressions#comparisons WARNING: unusable reference target found: expressions#lambda WARNING: unusable reference target found: expressions#or WARNING: unusable reference target found: expressions#and WARNING: unusable reference target found: expressions#not WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#not WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: expressions#is WARNING: unusable reference target found: expressions#isnot WARNING: unusable reference target found: ../@token#grammar-token-expression_stmt WARNING: unusable reference target found: ../@token#grammar-token-assert_stmt WARNING: unusable reference target found: ../@token#grammar-token-assignment_stmt WARNING: unusable reference target found: ../@token#grammar-token-augmented_assignment_stmt WARNING: unusable reference target found: ../@token#grammar-token-pass_stmt WARNING: unusable reference target found: ../@token#grammar-token-del_stmt WARNING: unusable reference target found: ../@token#grammar-token-print_stmt WARNING: unusable reference target found: ../@token#grammar-token-return_stmt WARNING: unusable reference target found: ../@token#grammar-token-yield_stmt WARNING: unusable reference target found: ../@token#grammar-token-raise_stmt WARNING: unusable reference target found: ../@token#grammar-token-break_stmt WARNING: unusable reference target found: ../@token#grammar-token-continue_stmt WARNING: unusable reference target found: ../@token#grammar-token-import_stmt WARNING: unusable reference target found: ../@token#grammar-token-global_stmt WARNING: unusable reference target found: ../@token#grammar-token-exec_stmt WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-yield_expression WARNING: unusable reference target found: ../@token#grammar-token-target WARNING: unusable reference target found: ../@token#grammar-token-target WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: ../@token#grammar-token-attributeref WARNING: unusable reference target found: ../@token#grammar-token-subscription WARNING: unusable reference target found: ../@token#grammar-token-slicing WARNING: unusable reference target found: expressions#primaries WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: ../@token#grammar-token-target WARNING: unusable reference target found: ../@token#grammar-token-augop WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-yield_expression WARNING: unusable reference target found: expressions#primaries WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: simple_stmts#pass WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: ../@token#grammar-token-yield_expression WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: executionmodel#exceptions WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#while WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#while WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: ../@token#grammar-token-module WARNING: unusable reference target found: ../@token#grammar-token-name WARNING: unusable reference target found: ../@token#grammar-token-module WARNING: unusable reference target found: ../@token#grammar-token-name WARNING: unusable reference target found: ../@token#grammar-token-relative_module WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-name WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-name WARNING: unusable reference target found: ../@token#grammar-token-relative_module WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-name WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-name WARNING: unusable reference target found: ../@token#grammar-token-module WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-module WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: simple_stmts#from WARNING: unusable reference target found: simple_stmts#from WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: compound_stmts#as WARNING: unusable reference target found: compound_stmts#as WARNING: unusable reference target found: simple_stmts#from WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: compound_stmts#as WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: simple_stmts#from WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#class WARNING: unusable reference target found: simple_stmts#import WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: simple_stmts#global WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: ../@token#grammar-token-or_expr WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: toplevel_components#file-input WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: simple_stmts#yield WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: expressions#in WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#while WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: simple_stmts#print WARNING: unusable reference target found: ../@token#grammar-token-if_stmt WARNING: unusable reference target found: ../@token#grammar-token-while_stmt WARNING: unusable reference target found: ../@token#grammar-token-for_stmt WARNING: unusable reference target found: ../@token#grammar-token-try_stmt WARNING: unusable reference target found: ../@token#grammar-token-with_stmt WARNING: unusable reference target found: ../@token#grammar-token-funcdef WARNING: unusable reference target found: ../@token#grammar-token-classdef WARNING: unusable reference target found: ../@token#grammar-token-decorated WARNING: unusable reference target found: ../@token#grammar-token-stmt_list WARNING: unusable reference target found: ../@token#grammar-token-statement WARNING: unusable reference target found: ../@token#grammar-token-stmt_list WARNING: unusable reference target found: ../@token#grammar-token-compound_stmt WARNING: unusable reference target found: ../@token#grammar-token-simple_stmt WARNING: unusable reference target found: ../@token#grammar-token-simple_stmt WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: expressions#booleans WARNING: unusable reference target found: compound_stmts#if WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#while WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: compound_stmts#for WARNING: unusable reference target found: ../@token#grammar-token-target_list WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-target WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#else WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: executionmodel#exceptions WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: simple_stmts#raise WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#context-managers WARNING: unusable reference target found: compound_stmts#try WARNING: unusable reference target found: compound_stmts#except WARNING: unusable reference target found: compound_stmts#finally WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-target WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#object.__enter__ WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#object.__enter__ WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#object.__enter__ WARNING: unusable reference target found: datamodel#object.__exit__ WARNING: unusable reference target found: datamodel#object.__exit__ WARNING: unusable reference target found: datamodel#object.__exit__ WARNING: unusable reference target found: datamodel#object.__exit__ WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#object.__exit__ WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: compound_stmts#with WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: ../@token#grammar-token-decorator WARNING: unusable reference target found: ../@token#grammar-token-dotted_name WARNING: unusable reference target found: ../@token#grammar-token-argument_list WARNING: unusable reference target found: ../@token#grammar-token-funcname WARNING: unusable reference target found: ../@token#grammar-token-parameter_list WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-defparameter WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-defparameter WARNING: unusable reference target found: ../@token#grammar-token-parameter WARNING: unusable reference target found: ../@token#grammar-token-expression WARNING: unusable reference target found: ../@token#grammar-token-parameter WARNING: unusable reference target found: ../@token#grammar-token-parameter WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-sublist WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: expressions#calls WARNING: unusable reference target found: expressions#lambda WARNING: unusable reference target found: compound_stmts#def WARNING: unusable reference target found: compound_stmts#def WARNING: unusable reference target found: executionmodel#naming WARNING: unusable reference target found: datamodel#types WARNING: unusable reference target found: ../@token#grammar-token-classname WARNING: unusable reference target found: ../@token#grammar-token-inheritance WARNING: unusable reference target found: ../@token#grammar-token-suite WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: executionmodel#naming WARNING: unusable reference target found: simple_stmts#return WARNING: unusable reference target found: simple_stmts#continue WARNING: unusable reference target found: simple_stmts#break WARNING: unusable reference target found: ../@token#grammar-token-statement WARNING: unusable reference target found: simple_stmts#exec WARNING: unusable reference target found: ../@token#grammar-token-stmt_list WARNING: unusable reference target found: ../@token#grammar-token-compound_stmt WARNING: unusable reference target found: ../@token#grammar-token-expression_list WARNING: unusable reference target found: ../@token#grammar-token-expression_list done processing tutorial.tex... tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint resolving references... writing... WARNING: unusable reference target found: interactive#tut-interacting WARNING: unusable reference target found: datastructures#tut-loopidioms WARNING: unusable reference target found: controlflow#tut-docstrings WARNING: unusable reference target found: datastructures#tut-tuples WARNING: unusable reference target found: classes#tut-firstclasses WARNING: unusable reference target found: controlflow#tut-unpacking-arguments WARNING: unusable reference target found: modules#tut-standardmodules WARNING: unusable reference target found: classes#tut-classes done processing using.tex... using/index using/cmdline using/unix using/windows using/mac resolving references... writing... WARNING: unusable reference target found: cmdline#cmdoption-c WARNING: unusable reference target found: cmdline#cmdoption-i WARNING: unusable reference target found: cmdline#cmdoption-i WARNING: unusable reference target found: cmdline#envvar-PYTHONDONTWRITEBYTECODE WARNING: unusable reference target found: cmdline#envvar-PYTHONDEBUG WARNING: unusable reference target found: cmdline#envvar-PYTHONPATH WARNING: unusable reference target found: cmdline#envvar-PYTHONHOME WARNING: unusable reference target found: cmdline#cmdoption-c WARNING: unusable reference target found: cmdline#envvar-PYTHONSTARTUP WARNING: unusable reference target found: cmdline#envvar-PYTHONINSPECT WARNING: unusable reference target found: cmdline#envvar-PYTHONOPTIMIZE WARNING: unusable reference target found: cmdline#cmdoption-O WARNING: unusable reference target found: cmdline#envvar-PYTHONUNBUFFERED WARNING: unusable reference target found: cmdline#envvar-PYTHONVERBOSE WARNING: unusable reference target found: cmdline#cmdoption-W WARNING: unusable reference target found: cmdline#cmdoption-W WARNING: unusable reference target found: cmdline#envvar-PYTHONHOME WARNING: unusable reference target found: cmdline#envvar-PYTHONHOME WARNING: unusable reference target found: cmdline#envvar-PYTHONPATH WARNING: unusable reference target found: cmdline#envvar-PYTHONHOME WARNING: unusable reference target found: cmdline#envvar-PYTHONPATH WARNING: unusable reference target found: cmdline#envvar-PYTHONPATH WARNING: unusable reference target found: cmdline#using-on-interface-options WARNING: unusable reference target found: cmdline#cmdoption-O WARNING: unusable reference target found: cmdline#cmdoption-O WARNING: unusable reference target found: cmdline#cmdoption-d WARNING: unusable reference target found: cmdline#cmdoption-d WARNING: unusable reference target found: cmdline#cmdoption-i WARNING: unusable reference target found: cmdline#cmdoption-u WARNING: unusable reference target found: cmdline#cmdoption-v WARNING: unusable reference target found: cmdline#cmdoption-v WARNING: unusable reference target found: cmdline#using-on-cmdline WARNING: unusable reference target found: cmdline#envvar-PYTHONPATH WARNING: unusable reference target found: cmdline#using-on-envvars WARNING: unusable reference target found: mac#ide WARNING: unusable reference target found: cmdline#envvar-PYTHONPATH WARNING: unusable reference target found: mac#mac-package-manager done processing whatsnew.tex... whatsnew/2.6 resolving references... writing... done processing howto-doanddont.tex... howto/doanddont resolving references... writing... done processing howto-advocacy.tex... howto/advocacy resolving references... writing... done processing howto-functional.tex... howto/functional resolving references... writing... done processing howto-regex.tex... howto/regex resolving references... writing... done processing howto-sockets.tex... howto/sockets resolving references... writing... done processing howto-urllib2.tex... howto/urllib2 resolving references... writing... done processing howto-webservers.tex... howto/webservers resolving references... writing... done processing howto-curses.tex... howto/curses resolving references... writing... done processing howto-cporting.tex... howto/cporting resolving references... writing... done processing howto-unicode.tex... howto/unicode resolving references... writing... done copying TeX support files... done build succeeded, 10305 warnings. Build finished; the LaTeX files are in build/latex. Run `make all-pdf' or `make all-ps' in that directory to run these through (pdf)latex. make[1]: Leaving directory `/home/neal/python/r26/Doc' (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' rm -f *.pdf *.dvi *.ps rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file c-api.idx No file c-api.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 158--159 [3] [4] [5] [6] [7] [8] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [9] [10] Chapter 2. [11] [12] [13] [14] Chapter 3. [15] [16] Chapter 4. [17] Overfull \hbox (14.2714pt too wide) in paragraph at lines 1303--1303 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 1303--1304 [][] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] Underfull \hbox (badness 5359) in paragraph at lines 2167--2176 /ptmr8t/Return a Python ob-ject from the data stream in a /pcrr8t/FILE* /ptmr8t /opened for read-ing. Un-like Overfull \hbox (0.98854pt too wide) in paragraph at lines 2218--2224 [] [28] Underfull \hbox (badness 10000) in paragraph at lines 2259--2262 [] Underfull \hbox (badness 10000) in paragraph at lines 2277--2280 [] Overfull \hbox (79.5372pt too wide) in paragraph at lines 2282--2285 [] Underfull \hbox (badness 10000) in paragraph at lines 2313--2316 [] [29] [30] [31] Underfull \hbox (badness 6125) in paragraph at lines 2562--2564 []/ptmr8t/The call to /pcrr8t/PyArg_UnpackTuple /ptmr8t/in this ex-am-ple is en -tirely equiv-a-lent to this call to [32] [33] [34] [35] [36] Chapter 6. [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 3835--3836 [49] [50] [51] [52] [53] [54] [55] Overfull \hbox (14.2714pt too wide) in paragraph at lines 4694--4694 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 4694--4695 [][] [56] [57] [58] [59] Underfull \hbox (badness 8113) in paragraph at lines 5058--5061 /ptmr8t/Shortcut for /pcrr8t/PyUnicode_FromEncodedObject(obj, NULL, "strict") / ptmr8t/which is used [60] [61] [62] [63] [64] [65] [66] Underfull \hbox (badness 10000) in paragraph at lines 5657--5662 /ptmr8t/This con-stant may be passed as the /ptmri8t/size /ptmr8t/pa-ram-e-ter to /pcrr8t/PyBuffer_FromObject /ptmr8t/or [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] Underfull \hbox (badness 10000) in paragraph at lines 6962--6964 /ptmr8t/Return true if /ptmri8t/ob /ptmr8t/is of type /pcrr8t/PyDateTime_DateTi meType /ptmr8t/or a sub-type of [81] [82] Underfull \hbox (badness 5548) in paragraph at lines 7121--7133 /pcrr8t/PyObject_CallMethod/ptmr8t/, /pcrr8t/PyObject_RichCompareBool/ptmr8t/, /pcrr8t/PyObject_Hash/ptmr8t/, /pcrr8t/PyObject_Repr/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /ptmr8t/to-col (in-clud-ing /pcrr8t/PyNumber_And/ptmr8t/, /pcrr8t/PyNumber_Subt ract/ptmr8t/, /pcrr8t/PyNumber_Or/ptmr8t/, /pcrr8t/PyNumber_Xor/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /pcrr8t/PyNumber_InPlaceAnd/ptmr8t/, /pcrr8t/PyNumber_InPlaceSubtract/ptmr8t/, /pcrr8t/PyNumber_InPlaceOr/ptmr8t/, and [83] [84] Chapter 8. [85] [86] Underfull \hbox (badness 10000) in paragraph at lines 7522--7526 []/pcrr8t/'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam' []/pt mr8t/The re- [87] [88] [89] [90] Underfull \hbox (badness 10000) in paragraph at lines 7823--7826 /ptmr8t/This macro ex-pands to /pcrr8t/PyEval_RestoreThread(_save);/ptmr8t/: it is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 7830--7833 /ptmr8t/This macro ex-pands to /pcrr8t/_save = PyEval_SaveThread();/ptmr8t/: it is equiv-a-lent to [91] [92] [93] [94] Chapter 9. [95] [96] [97] [98] Chapter 10. Underfull \hbox (badness 10000) in paragraph at lines 8407--8407 Underfull \hbox (badness 10000) in paragraph at lines 8410--8410 [99] [100] [101] [102] [103] [104] [105] Underfull \hbox (badness 10000) in paragraph at lines 9186--9196 []/ptmr8t/The print func-tion is called with the same sig-na-ture as /pcrr8t/Py Object_Print/ptmr8t/: /pcrr8t/int [106] [107] [108] Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /ptmr8t/the fields /pcrr8t/nb_inplace_add/ptmr8t/, /pcrr8t/nb_inplace_subtract/ ptmr8t/, /pcrr8t/nb_inplace_multiply/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /pcrr8t/nb_inplace_divide/ptmr8t/, /pcrr8t/nb_inplace_remainder/ptmr8t/, /pcrr8 t/nb_inplace_power/ptmr8t/, Underfull \hbox (badness 5637) in paragraph at lines 9481--9487 /ptmr8t/If this bit is set, the type ob-ject has sev-eral new fields de-fined s tart-ing in Python Underfull \hbox (badness 6300) in paragraph at lines 9532--9538 /ptmr8t/This is a bit-mask of all the bits that per-tain to the ex-is-tence of cer-tain fields in Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/the type ob-ject and its ex-ten-sion struc-tures. Cur-rently, it in-clu des the fol-low-ing Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/bits: /pcrr8t/Py_TPFLAGS_HAVE_GETCHARBUFFER/ptmr8t/, /pcrr8t/Py_TPFLAGS _HAVE_SEQUENCE_IN/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_INPLACEOPS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_RICHCOMPARE /ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_WEAKREFS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_ITER/ptmr8t/, and [109] [110] Underfull \hbox (badness 10000) in paragraph at lines 9656--9658 /ptmr8t/An op-tional pointer to the rich com-par-i-son func-tion, whose sig-na- ture is /pcrr8t/PyObject [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] Appendix A. [123] [124] [125] [126] [127] [128] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [129] [130] Appendix C. [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] Appendix D. No file modc-api.ind. No file c-api.ind. [143] (./c-api.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on c-api.pdf (147 pages, 650804 bytes). Transcript written on c-api.log. pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file c-api.idx (./c-api.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./c-api.out) (./c-api.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] (./c-api.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.75 ...rline {9}Memory Management}{95}{chapter.9} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 158--159 [3] [4] [5] [6] [7] [8] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [9] [10] Chapter 2. [11] [12] [13] [14] Chapter 3. [15] [16] Chapter 4. [17] Overfull \hbox (14.2714pt too wide) in paragraph at lines 1303--1303 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 1303--1304 [][] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] Underfull \hbox (badness 5359) in paragraph at lines 2167--2176 /ptmr8t/Return a Python ob-ject from the data stream in a /pcrr8t/FILE* /ptmr8t /opened for read-ing. Un-like Overfull \hbox (0.98854pt too wide) in paragraph at lines 2218--2224 [] [28] Underfull \hbox (badness 10000) in paragraph at lines 2259--2262 [] Underfull \hbox (badness 10000) in paragraph at lines 2277--2280 [] Overfull \hbox (79.5372pt too wide) in paragraph at lines 2282--2285 [] Underfull \hbox (badness 10000) in paragraph at lines 2313--2316 [] [29] [30] [31] Underfull \hbox (badness 6125) in paragraph at lines 2562--2564 []/ptmr8t/The call to /pcrr8t/PyArg_UnpackTuple /ptmr8t/in this ex-am-ple is en -tirely equiv-a-lent to this call to [32] [33] [34] [35] [36] Chapter 6. [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 3835--3836 [49] [50] [51] [52] [53] [54] [55] Overfull \hbox (14.2714pt too wide) in paragraph at lines 4694--4694 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 4694--4695 [][] [56] [57] [58] [59] Underfull \hbox (badness 8113) in paragraph at lines 5058--5061 /ptmr8t/Shortcut for /pcrr8t/PyUnicode_FromEncodedObject(obj, NULL, "strict") / ptmr8t/which is used [60] [61] [62] [63] [64] [65] [66] Underfull \hbox (badness 10000) in paragraph at lines 5657--5662 /ptmr8t/This con-stant may be passed as the /ptmri8t/size /ptmr8t/pa-ram-e-ter to /pcrr8t/PyBuffer_FromObject /ptmr8t/or [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] Underfull \hbox (badness 10000) in paragraph at lines 6962--6964 /ptmr8t/Return true if /ptmri8t/ob /ptmr8t/is of type /pcrr8t/PyDateTime_DateTi meType /ptmr8t/or a sub-type of [81] [82] Underfull \hbox (badness 5548) in paragraph at lines 7121--7133 /pcrr8t/PyObject_CallMethod/ptmr8t/, /pcrr8t/PyObject_RichCompareBool/ptmr8t/, /pcrr8t/PyObject_Hash/ptmr8t/, /pcrr8t/PyObject_Repr/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /ptmr8t/to-col (in-clud-ing /pcrr8t/PyNumber_And/ptmr8t/, /pcrr8t/PyNumber_Subt ract/ptmr8t/, /pcrr8t/PyNumber_Or/ptmr8t/, /pcrr8t/PyNumber_Xor/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /pcrr8t/PyNumber_InPlaceAnd/ptmr8t/, /pcrr8t/PyNumber_InPlaceSubtract/ptmr8t/, /pcrr8t/PyNumber_InPlaceOr/ptmr8t/, and [83] [84] Chapter 8. [85] [86] Underfull \hbox (badness 10000) in paragraph at lines 7522--7526 []/pcrr8t/'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam' []/pt mr8t/The re- [87] [88] [89] [90] Underfull \hbox (badness 10000) in paragraph at lines 7823--7826 /ptmr8t/This macro ex-pands to /pcrr8t/PyEval_RestoreThread(_save);/ptmr8t/: it is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 7830--7833 /ptmr8t/This macro ex-pands to /pcrr8t/_save = PyEval_SaveThread();/ptmr8t/: it is equiv-a-lent to [91] [92] [93] [94] Chapter 9. [95] [96] [97] [98] Chapter 10. Underfull \hbox (badness 10000) in paragraph at lines 8407--8407 Underfull \hbox (badness 10000) in paragraph at lines 8410--8410 [99] [100] [101] [102] [103] [104] [105] Underfull \hbox (badness 10000) in paragraph at lines 9186--9196 []/ptmr8t/The print func-tion is called with the same sig-na-ture as /pcrr8t/Py Object_Print/ptmr8t/: /pcrr8t/int [106] [107] [108] Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /ptmr8t/the fields /pcrr8t/nb_inplace_add/ptmr8t/, /pcrr8t/nb_inplace_subtract/ ptmr8t/, /pcrr8t/nb_inplace_multiply/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /pcrr8t/nb_inplace_divide/ptmr8t/, /pcrr8t/nb_inplace_remainder/ptmr8t/, /pcrr8 t/nb_inplace_power/ptmr8t/, Underfull \hbox (badness 5637) in paragraph at lines 9481--9487 /ptmr8t/If this bit is set, the type ob-ject has sev-eral new fields de-fined s tart-ing in Python Underfull \hbox (badness 6300) in paragraph at lines 9532--9538 /ptmr8t/This is a bit-mask of all the bits that per-tain to the ex-is-tence of cer-tain fields in Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/the type ob-ject and its ex-ten-sion struc-tures. Cur-rently, it in-clu des the fol-low-ing Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/bits: /pcrr8t/Py_TPFLAGS_HAVE_GETCHARBUFFER/ptmr8t/, /pcrr8t/Py_TPFLAGS _HAVE_SEQUENCE_IN/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_INPLACEOPS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_RICHCOMPARE /ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_WEAKREFS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_ITER/ptmr8t/, and [109] [110] Underfull \hbox (badness 10000) in paragraph at lines 9656--9658 /ptmr8t/An op-tional pointer to the rich com-par-i-son func-tion, whose sig-na- ture is /pcrr8t/PyObject [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] Appendix A. [123] [124] [125] [126] [127] [128] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [129] [130] Appendix C. [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] Appendix D. No file modc-api.ind. No file c-api.ind. [143] (./c-api.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on c-api.pdf (147 pages, 681267 bytes). Transcript written on c-api.log. pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file c-api.idx (./c-api.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./c-api.out) (./c-api.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] (./c-api.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.75 ...rline {9}Memory Management}{95}{chapter.9} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 158--159 [3] [4] [5] [6] [7] [8] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [9] [10] Chapter 2. [11] [12] [13] [14] Chapter 3. [15] [16] Chapter 4. [17] Overfull \hbox (14.2714pt too wide) in paragraph at lines 1303--1303 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 1303--1304 [][] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] Underfull \hbox (badness 5359) in paragraph at lines 2167--2176 /ptmr8t/Return a Python ob-ject from the data stream in a /pcrr8t/FILE* /ptmr8t /opened for read-ing. Un-like Overfull \hbox (0.98854pt too wide) in paragraph at lines 2218--2224 [] [28] Underfull \hbox (badness 10000) in paragraph at lines 2259--2262 [] Underfull \hbox (badness 10000) in paragraph at lines 2277--2280 [] Overfull \hbox (79.5372pt too wide) in paragraph at lines 2282--2285 [] Underfull \hbox (badness 10000) in paragraph at lines 2313--2316 [] [29] [30] [31] Underfull \hbox (badness 6125) in paragraph at lines 2562--2564 []/ptmr8t/The call to /pcrr8t/PyArg_UnpackTuple /ptmr8t/in this ex-am-ple is en -tirely equiv-a-lent to this call to [32] [33] [34] [35] [36] Chapter 6. [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 3835--3836 [49] [50] [51] [52] [53] [54] [55] Overfull \hbox (14.2714pt too wide) in paragraph at lines 4694--4694 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 4694--4695 [][] [56] [57] [58] [59] Underfull \hbox (badness 8113) in paragraph at lines 5058--5061 /ptmr8t/Shortcut for /pcrr8t/PyUnicode_FromEncodedObject(obj, NULL, "strict") / ptmr8t/which is used [60] [61] [62] [63] [64] [65] [66] Underfull \hbox (badness 10000) in paragraph at lines 5657--5662 /ptmr8t/This con-stant may be passed as the /ptmri8t/size /ptmr8t/pa-ram-e-ter to /pcrr8t/PyBuffer_FromObject /ptmr8t/or [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] Underfull \hbox (badness 10000) in paragraph at lines 6962--6964 /ptmr8t/Return true if /ptmri8t/ob /ptmr8t/is of type /pcrr8t/PyDateTime_DateTi meType /ptmr8t/or a sub-type of [81] [82] Underfull \hbox (badness 5548) in paragraph at lines 7121--7133 /pcrr8t/PyObject_CallMethod/ptmr8t/, /pcrr8t/PyObject_RichCompareBool/ptmr8t/, /pcrr8t/PyObject_Hash/ptmr8t/, /pcrr8t/PyObject_Repr/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /ptmr8t/to-col (in-clud-ing /pcrr8t/PyNumber_And/ptmr8t/, /pcrr8t/PyNumber_Subt ract/ptmr8t/, /pcrr8t/PyNumber_Or/ptmr8t/, /pcrr8t/PyNumber_Xor/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /pcrr8t/PyNumber_InPlaceAnd/ptmr8t/, /pcrr8t/PyNumber_InPlaceSubtract/ptmr8t/, /pcrr8t/PyNumber_InPlaceOr/ptmr8t/, and [83] [84] Chapter 8. [85] [86] Underfull \hbox (badness 10000) in paragraph at lines 7522--7526 []/pcrr8t/'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam' []/pt mr8t/The re- [87] [88] [89] [90] Underfull \hbox (badness 10000) in paragraph at lines 7823--7826 /ptmr8t/This macro ex-pands to /pcrr8t/PyEval_RestoreThread(_save);/ptmr8t/: it is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 7830--7833 /ptmr8t/This macro ex-pands to /pcrr8t/_save = PyEval_SaveThread();/ptmr8t/: it is equiv-a-lent to [91] [92] [93] [94] Chapter 9. [95] [96] [97] [98] Chapter 10. Underfull \hbox (badness 10000) in paragraph at lines 8407--8407 Underfull \hbox (badness 10000) in paragraph at lines 8410--8410 [99] [100] [101] [102] [103] [104] [105] Underfull \hbox (badness 10000) in paragraph at lines 9186--9196 []/ptmr8t/The print func-tion is called with the same sig-na-ture as /pcrr8t/Py Object_Print/ptmr8t/: /pcrr8t/int [106] [107] [108] Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /ptmr8t/the fields /pcrr8t/nb_inplace_add/ptmr8t/, /pcrr8t/nb_inplace_subtract/ ptmr8t/, /pcrr8t/nb_inplace_multiply/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /pcrr8t/nb_inplace_divide/ptmr8t/, /pcrr8t/nb_inplace_remainder/ptmr8t/, /pcrr8 t/nb_inplace_power/ptmr8t/, Underfull \hbox (badness 5637) in paragraph at lines 9481--9487 /ptmr8t/If this bit is set, the type ob-ject has sev-eral new fields de-fined s tart-ing in Python Underfull \hbox (badness 6300) in paragraph at lines 9532--9538 /ptmr8t/This is a bit-mask of all the bits that per-tain to the ex-is-tence of cer-tain fields in Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/the type ob-ject and its ex-ten-sion struc-tures. Cur-rently, it in-clu des the fol-low-ing Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/bits: /pcrr8t/Py_TPFLAGS_HAVE_GETCHARBUFFER/ptmr8t/, /pcrr8t/Py_TPFLAGS _HAVE_SEQUENCE_IN/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_INPLACEOPS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_RICHCOMPARE /ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_WEAKREFS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_ITER/ptmr8t/, and [109] [110] Underfull \hbox (badness 10000) in paragraph at lines 9656--9658 /ptmr8t/An op-tional pointer to the rich com-par-i-son func-tion, whose sig-na- ture is /pcrr8t/PyObject [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] Appendix A. [123] [124] [125] [126] [127] [128] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [129] [130] Appendix C. [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] Appendix D. No file modc-api.ind. No file c-api.ind. [143] (./c-api.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on c-api.pdf (147 pages, 681267 bytes). Transcript written on c-api.log. makeindex -s python.ist 'c-api.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file c-api.idx.....done (1292 entries accepted, 0 rejected). Sorting entries.............done (14626 comparisons). Generating output file c-api.ind.....done (1315 lines written, 0 warnings). Output written in c-api.ind. Transcript written in c-api.ilg. makeindex -s python.ist 'modc-api.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modc-api.idx...done (0 entries accepted, 0 rejected). Nothing written in modc-api.ind. Transcript written in modc-api.ilg. pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file c-api.idx (./c-api.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./c-api.out) (./c-api.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] (./c-api.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.75 ...rline {9}Memory Management}{95}{chapter.9} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 158--159 [3] [4] [5] [6] [7] [8] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [9] [10] Chapter 2. [11] [12] [13] [14] Chapter 3. [15] [16] Chapter 4. [17] Overfull \hbox (14.2714pt too wide) in paragraph at lines 1303--1303 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 1303--1304 [][] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] Underfull \hbox (badness 5359) in paragraph at lines 2167--2176 /ptmr8t/Return a Python ob-ject from the data stream in a /pcrr8t/FILE* /ptmr8t /opened for read-ing. Un-like Overfull \hbox (0.98854pt too wide) in paragraph at lines 2218--2224 [] [28] Underfull \hbox (badness 10000) in paragraph at lines 2259--2262 [] Underfull \hbox (badness 10000) in paragraph at lines 2277--2280 [] Overfull \hbox (79.5372pt too wide) in paragraph at lines 2282--2285 [] Underfull \hbox (badness 10000) in paragraph at lines 2313--2316 [] [29] [30] [31] Underfull \hbox (badness 6125) in paragraph at lines 2562--2564 []/ptmr8t/The call to /pcrr8t/PyArg_UnpackTuple /ptmr8t/in this ex-am-ple is en -tirely equiv-a-lent to this call to [32] [33] [34] [35] [36] Chapter 6. [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 3835--3836 [49] [50] [51] [52] [53] [54] [55] Overfull \hbox (14.2714pt too wide) in paragraph at lines 4694--4694 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 4694--4695 [][] [56] [57] [58] [59] Underfull \hbox (badness 8113) in paragraph at lines 5058--5061 /ptmr8t/Shortcut for /pcrr8t/PyUnicode_FromEncodedObject(obj, NULL, "strict") / ptmr8t/which is used [60] [61] [62] [63] [64] [65] [66] Underfull \hbox (badness 10000) in paragraph at lines 5657--5662 /ptmr8t/This con-stant may be passed as the /ptmri8t/size /ptmr8t/pa-ram-e-ter to /pcrr8t/PyBuffer_FromObject /ptmr8t/or [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] Underfull \hbox (badness 10000) in paragraph at lines 6962--6964 /ptmr8t/Return true if /ptmri8t/ob /ptmr8t/is of type /pcrr8t/PyDateTime_DateTi meType /ptmr8t/or a sub-type of [81] [82] Underfull \hbox (badness 5548) in paragraph at lines 7121--7133 /pcrr8t/PyObject_CallMethod/ptmr8t/, /pcrr8t/PyObject_RichCompareBool/ptmr8t/, /pcrr8t/PyObject_Hash/ptmr8t/, /pcrr8t/PyObject_Repr/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /ptmr8t/to-col (in-clud-ing /pcrr8t/PyNumber_And/ptmr8t/, /pcrr8t/PyNumber_Subt ract/ptmr8t/, /pcrr8t/PyNumber_Or/ptmr8t/, /pcrr8t/PyNumber_Xor/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /pcrr8t/PyNumber_InPlaceAnd/ptmr8t/, /pcrr8t/PyNumber_InPlaceSubtract/ptmr8t/, /pcrr8t/PyNumber_InPlaceOr/ptmr8t/, and [83] [84] Chapter 8. [85] [86] Underfull \hbox (badness 10000) in paragraph at lines 7522--7526 []/pcrr8t/'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam' []/pt mr8t/The re- [87] [88] [89] [90] Underfull \hbox (badness 10000) in paragraph at lines 7823--7826 /ptmr8t/This macro ex-pands to /pcrr8t/PyEval_RestoreThread(_save);/ptmr8t/: it is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 7830--7833 /ptmr8t/This macro ex-pands to /pcrr8t/_save = PyEval_SaveThread();/ptmr8t/: it is equiv-a-lent to [91] [92] [93] [94] Chapter 9. [95] [96] [97] [98] Chapter 10. Underfull \hbox (badness 10000) in paragraph at lines 8407--8407 Underfull \hbox (badness 10000) in paragraph at lines 8410--8410 [99] [100] [101] [102] [103] [104] [105] Underfull \hbox (badness 10000) in paragraph at lines 9186--9196 []/ptmr8t/The print func-tion is called with the same sig-na-ture as /pcrr8t/Py Object_Print/ptmr8t/: /pcrr8t/int [106] [107] [108] Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /ptmr8t/the fields /pcrr8t/nb_inplace_add/ptmr8t/, /pcrr8t/nb_inplace_subtract/ ptmr8t/, /pcrr8t/nb_inplace_multiply/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /pcrr8t/nb_inplace_divide/ptmr8t/, /pcrr8t/nb_inplace_remainder/ptmr8t/, /pcrr8 t/nb_inplace_power/ptmr8t/, Underfull \hbox (badness 5637) in paragraph at lines 9481--9487 /ptmr8t/If this bit is set, the type ob-ject has sev-eral new fields de-fined s tart-ing in Python Underfull \hbox (badness 6300) in paragraph at lines 9532--9538 /ptmr8t/This is a bit-mask of all the bits that per-tain to the ex-is-tence of cer-tain fields in Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/the type ob-ject and its ex-ten-sion struc-tures. Cur-rently, it in-clu des the fol-low-ing Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/bits: /pcrr8t/Py_TPFLAGS_HAVE_GETCHARBUFFER/ptmr8t/, /pcrr8t/Py_TPFLAGS _HAVE_SEQUENCE_IN/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_INPLACEOPS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_RICHCOMPARE /ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_WEAKREFS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_ITER/ptmr8t/, and [109] [110] Underfull \hbox (badness 10000) in paragraph at lines 9656--9658 /ptmr8t/An op-tional pointer to the rich com-par-i-son func-tion, whose sig-na- ture is /pcrr8t/PyObject [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] Appendix A. [123] [124] [125] [126] [127] [128] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [129] [130] Appendix C. [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] Appendix D. (./modc-api.ind) (./c-api.ind [143] [144] [145] [146] [147] Underfull \hbox (badness 10000) in paragraph at lines 399--400 []/ptmr8t/Py_TPFLAGS_HAVE_INPLACEOPS (built-in Underfull \hbox (badness 10000) in paragraph at lines 401--402 []/ptmr8t/Py_TPFLAGS_HAVE_RICHCOMPARE (built-in Underfull \hbox (badness 10000) in paragraph at lines 402--403 []/ptmr8t/Py_TPFLAGS_HAVE_SEQUENCE_IN (built-in [148] Underfull \hbox (badness 10000) in paragraph at lines 505--506 []/ptmr8t/PyDateTime_DATE_GET_MICROSECOND (C Underfull \hbox (badness 10000) in paragraph at lines 514--515 []/ptmr8t/PyDateTime_TIME_GET_MICROSECOND (C [149] Underfull \hbox (badness 10000) in paragraph at lines 567--568 []/ptmr8t/PyErr_SetExcFromWindowsErrWithFilename (C [150] [151] [152] [153] Underfull \hbox (badness 7273) in paragraph at lines 1128--1129 []/ptmr8t/PyUnicode_DecodeRawUnicodeEscape (C func- [154] Underfull \hbox (badness 10000) in paragraph at lines 1141--1142 []/ptmr8t/PyUnicode_EncodeRawUnicodeEscape (C func- [155] [156]) (./c-api.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on c-api.pdf (160 pages, 974766 bytes). Transcript written on c-api.log. pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file c-api.idx (./c-api.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./c-api.out) (./c-api.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] (./c-api.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.75 ...rline {9}Memory Management}{95}{chapter.9} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \hypertarget{api-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 158--159 [3] [4] [5] [6] [7] [8] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [9] [10] Chapter 2. [11] [12] [13] [14] Chapter 3. [15] [16] Chapter 4. [17] Overfull \hbox (14.2714pt too wide) in paragraph at lines 1303--1303 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 1303--1304 [][] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] Underfull \hbox (badness 5359) in paragraph at lines 2167--2176 /ptmr8t/Return a Python ob-ject from the data stream in a /pcrr8t/FILE* /ptmr8t /opened for read-ing. Un-like Overfull \hbox (0.98854pt too wide) in paragraph at lines 2218--2224 [] [28] Underfull \hbox (badness 10000) in paragraph at lines 2259--2262 [] Underfull \hbox (badness 10000) in paragraph at lines 2277--2280 [] Overfull \hbox (79.5372pt too wide) in paragraph at lines 2282--2285 [] Underfull \hbox (badness 10000) in paragraph at lines 2313--2316 [] [29] [30] [31] Underfull \hbox (badness 6125) in paragraph at lines 2562--2564 []/ptmr8t/The call to /pcrr8t/PyArg_UnpackTuple /ptmr8t/in this ex-am-ple is en -tirely equiv-a-lent to this call to [32] [33] [34] [35] [36] Chapter 6. [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 3835--3836 [49] [50] [51] [52] [53] [54] [55] Overfull \hbox (14.2714pt too wide) in paragraph at lines 4694--4694 []/ptmr8t/Py_ssize_t| Overfull \hbox (24.99997pt too wide) in paragraph at lines 4694--4695 [][] [56] [57] [58] [59] Underfull \hbox (badness 8113) in paragraph at lines 5058--5061 /ptmr8t/Shortcut for /pcrr8t/PyUnicode_FromEncodedObject(obj, NULL, "strict") / ptmr8t/which is used [60] [61] [62] [63] [64] [65] [66] Underfull \hbox (badness 10000) in paragraph at lines 5657--5662 /ptmr8t/This con-stant may be passed as the /ptmri8t/size /ptmr8t/pa-ram-e-ter to /pcrr8t/PyBuffer_FromObject /ptmr8t/or [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] Underfull \hbox (badness 10000) in paragraph at lines 6962--6964 /ptmr8t/Return true if /ptmri8t/ob /ptmr8t/is of type /pcrr8t/PyDateTime_DateTi meType /ptmr8t/or a sub-type of [81] [82] Underfull \hbox (badness 5548) in paragraph at lines 7121--7133 /pcrr8t/PyObject_CallMethod/ptmr8t/, /pcrr8t/PyObject_RichCompareBool/ptmr8t/, /pcrr8t/PyObject_Hash/ptmr8t/, /pcrr8t/PyObject_Repr/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /ptmr8t/to-col (in-clud-ing /pcrr8t/PyNumber_And/ptmr8t/, /pcrr8t/PyNumber_Subt ract/ptmr8t/, /pcrr8t/PyNumber_Or/ptmr8t/, /pcrr8t/PyNumber_Xor/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 7121--7133 /pcrr8t/PyNumber_InPlaceAnd/ptmr8t/, /pcrr8t/PyNumber_InPlaceSubtract/ptmr8t/, /pcrr8t/PyNumber_InPlaceOr/ptmr8t/, and [83] [84] Chapter 8. [85] [86] Underfull \hbox (badness 10000) in paragraph at lines 7522--7526 []/pcrr8t/'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam' []/pt mr8t/The re- [87] [88] [89] [90] Underfull \hbox (badness 10000) in paragraph at lines 7823--7826 /ptmr8t/This macro ex-pands to /pcrr8t/PyEval_RestoreThread(_save);/ptmr8t/: it is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 7830--7833 /ptmr8t/This macro ex-pands to /pcrr8t/_save = PyEval_SaveThread();/ptmr8t/: it is equiv-a-lent to [91] [92] [93] [94] Chapter 9. [95] [96] [97] [98] Chapter 10. Underfull \hbox (badness 10000) in paragraph at lines 8407--8407 Underfull \hbox (badness 10000) in paragraph at lines 8410--8410 [99] [100] [101] [102] [103] [104] [105] Underfull \hbox (badness 10000) in paragraph at lines 9186--9196 []/ptmr8t/The print func-tion is called with the same sig-na-ture as /pcrr8t/Py Object_Print/ptmr8t/: /pcrr8t/int [106] [107] [108] Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /ptmr8t/the fields /pcrr8t/nb_inplace_add/ptmr8t/, /pcrr8t/nb_inplace_subtract/ ptmr8t/, /pcrr8t/nb_inplace_multiply/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9434--9445 /pcrr8t/nb_inplace_divide/ptmr8t/, /pcrr8t/nb_inplace_remainder/ptmr8t/, /pcrr8 t/nb_inplace_power/ptmr8t/, Underfull \hbox (badness 5637) in paragraph at lines 9481--9487 /ptmr8t/If this bit is set, the type ob-ject has sev-eral new fields de-fined s tart-ing in Python Underfull \hbox (badness 6300) in paragraph at lines 9532--9538 /ptmr8t/This is a bit-mask of all the bits that per-tain to the ex-is-tence of cer-tain fields in Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/the type ob-ject and its ex-ten-sion struc-tures. Cur-rently, it in-clu des the fol-low-ing Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /ptmr8t/bits: /pcrr8t/Py_TPFLAGS_HAVE_GETCHARBUFFER/ptmr8t/, /pcrr8t/Py_TPFLAGS _HAVE_SEQUENCE_IN/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_INPLACEOPS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_RICHCOMPARE /ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 9532--9538 /pcrr8t/Py_TPFLAGS_HAVE_WEAKREFS/ptmr8t/, /pcrr8t/Py_TPFLAGS_HAVE_ITER/ptmr8t/, and [109] [110] Underfull \hbox (badness 10000) in paragraph at lines 9656--9658 /ptmr8t/An op-tional pointer to the rich com-par-i-son func-tion, whose sig-na- ture is /pcrr8t/PyObject [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] Appendix A. [123] [124] [125] [126] [127] [128] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [129] [130] Appendix C. [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] Appendix D. (./modc-api.ind) (./c-api.ind [143] [144] [145] [146] [147] Underfull \hbox (badness 10000) in paragraph at lines 399--400 []/ptmr8t/Py_TPFLAGS_HAVE_INPLACEOPS (built-in Underfull \hbox (badness 10000) in paragraph at lines 401--402 []/ptmr8t/Py_TPFLAGS_HAVE_RICHCOMPARE (built-in Underfull \hbox (badness 10000) in paragraph at lines 402--403 []/ptmr8t/Py_TPFLAGS_HAVE_SEQUENCE_IN (built-in [148] Underfull \hbox (badness 10000) in paragraph at lines 505--506 []/ptmr8t/PyDateTime_DATE_GET_MICROSECOND (C Underfull \hbox (badness 10000) in paragraph at lines 514--515 []/ptmr8t/PyDateTime_TIME_GET_MICROSECOND (C [149] Underfull \hbox (badness 10000) in paragraph at lines 567--568 []/ptmr8t/PyErr_SetExcFromWindowsErrWithFilename (C [150] [151] [152] [153] Underfull \hbox (badness 7273) in paragraph at lines 1128--1129 []/ptmr8t/PyUnicode_DecodeRawUnicodeEscape (C func- [154] Underfull \hbox (badness 10000) in paragraph at lines 1141--1142 []/ptmr8t/PyUnicode_EncodeRawUnicodeEscape (C func- [155] [156]) (./c-api.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on c-api.pdf (160 pages, 975221 bytes). Transcript written on c-api.log. pdflatex 'distutils.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./distutils.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file distutils.idx No file distutils.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] [5] [6] Chapter 2. [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Chapter 3. [17] Underfull \hbox (badness 5652) in paragraph at lines 1298--1300 []/ptmr8t/More in-for-ma-tion on [18] Chapter 4. Underfull \hbox (badness 10000) in paragraph at lines 1416--1418 []/ptmb8t/** /ptmr8t/get-ting C li-brary sources cur-rently broken---no /pcrr8t /get_source_files() /ptmr8t/method in [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] [28] Chapter 6. [29] [30] Chapter 7. [31] [32] Chapter 8. [33] [34] [35] [36] Chapter 9. [37] [38] Chapter 10. [39] [40] Chapter 11. Overfull \hbox (26.20094pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/long_description| Overfull \hbox (2.32108pt too wide) in paragraph at lines 3009--3009 /ptmri8t/thor_email| Overfull \hbox (9.54091pt too wide) in paragraph at lines 3009--3009 /ptmri8t/tainer_email| Overfull \hbox (6.19135pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/py_modules| Overfull \hbox (8.21123pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/ext_modules| Overfull \hbox (7.86113pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_name| Overfull \hbox (3.611pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_args| Overfull \hbox (24.99594pt too wide) in paragraph at lines 3009--3010 [][] [41] Underfull \hbox (badness 10000) in paragraph at lines 3015--3020 /ptmr8t/Run a setup script in a some-what con-trolled en-vi-ron-ment, and re-tu rn the Overfull \hbox (25.01404pt too wide) in paragraph at lines 3067--3068 [][] [42] Overfull \hbox (3.61392pt too wide) in paragraph at lines 3271--3271 /ptmri8t/clude_dirs| Overfull \hbox (9.92413pt too wide) in paragraph at lines 3271--3271 /ptmri8t/fine_macros| Overfull \hbox (7.70403pt too wide) in paragraph at lines 3271--3271 /ptmri8t/def_macros| Overfull \hbox (4.02397pt too wide) in paragraph at lines 3271--3271 /ptmri8t/brary_dirs| Overfull \hbox (31.80345pt too wide) in paragraph at lines 3271--3271 /ptmri8t/time_library_dirs| Overfull \hbox (6.3439pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_objects| Overfull \hbox (32.08376pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_compile_args| Overfull \hbox (15.42384pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_link_args| Overfull \hbox (15.38383pt too wide) in paragraph at lines 3271--3271 /ptmri8t/port_symbols| Overfull \hbox (24.9912pt too wide) in paragraph at lines 3271--3272 [][] [43] [44] [45] [46] Underfull \hbox (badness 10000) in paragraph at lines 3615--3620 /ptmr8t/and/or /pcrr8t/set_link_objects()/ptmr8t/, the li-braries sup-plied to /pcrr8t/add_library() /ptmr8t/and/or [47] [48] [49] [50] [51] [52] [53] [54] Underfull \hbox (badness 10000) in paragraph at lines 4400--4401 [55] Overfull \hbox (2.55481pt too wide) in paragraph at lines 4633--4633 /ptmb8t/fault| Overfull \hbox (29.12105pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/strip_comments| Overfull \hbox (2.47115pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/lstrip_ws| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (3.48116pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/rstrip_ws| Overfull \hbox (13.01132pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/skip_blanks| Overfull \hbox (5.24127pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/join_lines| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (7.46138pt too wide) in paragraph at lines 4633--4633 /ptmri8t/lapse_join| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (25.00304pt too wide) in paragraph at lines 4633--4634 [][] [56] [57] [58] [59] Overfull \vbox (269.21144pt too high) has occurred while \output is active [60] [61] [62] Appendix A. [63] [64] [65] [66] [67] [68] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [69] [70] Appendix C. [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] Appendix D. No file moddistutils.ind. No file distutils.ind. [83] (./distutils.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on distutils.pdf (87 pages, 318487 bytes). Transcript written on distutils.log. pdflatex 'distutils.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./distutils.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file distutils.idx (./distutils.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./distutils.out) (./distutils.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./distutils.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.43 ...ine {10}Command Reference}{39}{chapter.10} [1] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.101 ... otherwise using Python}{72}{section.C.2} [2]) Adding blank page after the table of contents. [3] [4] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.189 [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.281 [4] [5] [6] Chapter 2. [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Chapter 3. [17] Underfull \hbox (badness 5652) in paragraph at lines 1298--1300 []/ptmr8t/More in-for-ma-tion on [18] Chapter 4. Underfull \hbox (badness 10000) in paragraph at lines 1416--1418 []/ptmb8t/** /ptmr8t/get-ting C li-brary sources cur-rently broken---no /pcrr8t /get_source_files() /ptmr8t/method in [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] [28] Chapter 6. [29] [30] Chapter 7. [31] [32] Chapter 8. [33] [34] [35] [36] Chapter 9. [37] [38] Chapter 10. [39] [40] Chapter 11. Overfull \hbox (26.20094pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/long_description| Overfull \hbox (2.32108pt too wide) in paragraph at lines 3009--3009 /ptmri8t/thor_email| Overfull \hbox (9.54091pt too wide) in paragraph at lines 3009--3009 /ptmri8t/tainer_email| Overfull \hbox (6.19135pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/py_modules| Overfull \hbox (8.21123pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/ext_modules| Overfull \hbox (7.86113pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_name| Overfull \hbox (3.611pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_args| Overfull \hbox (24.99594pt too wide) in paragraph at lines 3009--3010 [][] [41] Underfull \hbox (badness 10000) in paragraph at lines 3015--3020 /ptmr8t/Run a setup script in a some-what con-trolled en-vi-ron-ment, and re-tu rn the Overfull \hbox (25.01404pt too wide) in paragraph at lines 3067--3068 [][] [42] Overfull \hbox (3.61392pt too wide) in paragraph at lines 3271--3271 /ptmri8t/clude_dirs| Overfull \hbox (9.92413pt too wide) in paragraph at lines 3271--3271 /ptmri8t/fine_macros| Overfull \hbox (7.70403pt too wide) in paragraph at lines 3271--3271 /ptmri8t/def_macros| Overfull \hbox (4.02397pt too wide) in paragraph at lines 3271--3271 /ptmri8t/brary_dirs| Overfull \hbox (31.80345pt too wide) in paragraph at lines 3271--3271 /ptmri8t/time_library_dirs| Overfull \hbox (6.3439pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_objects| Overfull \hbox (32.08376pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_compile_args| Overfull \hbox (15.42384pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_link_args| Overfull \hbox (15.38383pt too wide) in paragraph at lines 3271--3271 /ptmri8t/port_symbols| Overfull \hbox (24.9912pt too wide) in paragraph at lines 3271--3272 [][] [43] [44] [45] [46] Underfull \hbox (badness 10000) in paragraph at lines 3615--3620 /ptmr8t/and/or /pcrr8t/set_link_objects()/ptmr8t/, the li-braries sup-plied to /pcrr8t/add_library() /ptmr8t/and/or [47] [48] [49] [50] [51] [52] [53] [54] Underfull \hbox (badness 10000) in paragraph at lines 4400--4401 [55] Overfull \hbox (2.55481pt too wide) in paragraph at lines 4633--4633 /ptmb8t/fault| Overfull \hbox (29.12105pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/strip_comments| Overfull \hbox (2.47115pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/lstrip_ws| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (3.48116pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/rstrip_ws| Overfull \hbox (13.01132pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/skip_blanks| Overfull \hbox (5.24127pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/join_lines| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (7.46138pt too wide) in paragraph at lines 4633--4633 /ptmri8t/lapse_join| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (25.00304pt too wide) in paragraph at lines 4633--4634 [][] [56] [57] [58] [59] Overfull \vbox (269.21144pt too high) has occurred while \output is active [60] [61] [62] Appendix A. [63] [64] [65] [66] [67] [68] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [69] [70] Appendix C. [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] Appendix D. No file moddistutils.ind. No file distutils.ind. [83] (./distutils.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on distutils.pdf (89 pages, 370071 bytes). Transcript written on distutils.log. pdflatex 'distutils.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./distutils.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file distutils.idx (./distutils.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./distutils.out) (./distutils.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./distutils.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.43 ...ine {10}Command Reference}{39}{chapter.10} [1] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.101 ... otherwise using Python}{72}{section.C.2} [2]) Adding blank page after the table of contents. [3] [4] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.189 [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.281 [4] [5] [6] Chapter 2. [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Chapter 3. [17] Underfull \hbox (badness 5652) in paragraph at lines 1298--1300 []/ptmr8t/More in-for-ma-tion on [18] Chapter 4. Underfull \hbox (badness 10000) in paragraph at lines 1416--1418 []/ptmb8t/** /ptmr8t/get-ting C li-brary sources cur-rently broken---no /pcrr8t /get_source_files() /ptmr8t/method in [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] [28] Chapter 6. [29] [30] Chapter 7. [31] [32] Chapter 8. [33] [34] [35] [36] Chapter 9. [37] [38] Chapter 10. [39] [40] Chapter 11. Overfull \hbox (26.20094pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/long_description| Overfull \hbox (2.32108pt too wide) in paragraph at lines 3009--3009 /ptmri8t/thor_email| Overfull \hbox (9.54091pt too wide) in paragraph at lines 3009--3009 /ptmri8t/tainer_email| Overfull \hbox (6.19135pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/py_modules| Overfull \hbox (8.21123pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/ext_modules| Overfull \hbox (7.86113pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_name| Overfull \hbox (3.611pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_args| Overfull \hbox (24.99594pt too wide) in paragraph at lines 3009--3010 [][] [41] Underfull \hbox (badness 10000) in paragraph at lines 3015--3020 /ptmr8t/Run a setup script in a some-what con-trolled en-vi-ron-ment, and re-tu rn the Overfull \hbox (25.01404pt too wide) in paragraph at lines 3067--3068 [][] [42] Overfull \hbox (3.61392pt too wide) in paragraph at lines 3271--3271 /ptmri8t/clude_dirs| Overfull \hbox (9.92413pt too wide) in paragraph at lines 3271--3271 /ptmri8t/fine_macros| Overfull \hbox (7.70403pt too wide) in paragraph at lines 3271--3271 /ptmri8t/def_macros| Overfull \hbox (4.02397pt too wide) in paragraph at lines 3271--3271 /ptmri8t/brary_dirs| Overfull \hbox (31.80345pt too wide) in paragraph at lines 3271--3271 /ptmri8t/time_library_dirs| Overfull \hbox (6.3439pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_objects| Overfull \hbox (32.08376pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_compile_args| Overfull \hbox (15.42384pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_link_args| Overfull \hbox (15.38383pt too wide) in paragraph at lines 3271--3271 /ptmri8t/port_symbols| Overfull \hbox (24.9912pt too wide) in paragraph at lines 3271--3272 [][] [43] [44] [45] [46] Underfull \hbox (badness 10000) in paragraph at lines 3615--3620 /ptmr8t/and/or /pcrr8t/set_link_objects()/ptmr8t/, the li-braries sup-plied to /pcrr8t/add_library() /ptmr8t/and/or [47] [48] [49] [50] [51] [52] [53] [54] Underfull \hbox (badness 10000) in paragraph at lines 4400--4401 [55] Overfull \hbox (2.55481pt too wide) in paragraph at lines 4633--4633 /ptmb8t/fault| Overfull \hbox (29.12105pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/strip_comments| Overfull \hbox (2.47115pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/lstrip_ws| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (3.48116pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/rstrip_ws| Overfull \hbox (13.01132pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/skip_blanks| Overfull \hbox (5.24127pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/join_lines| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (7.46138pt too wide) in paragraph at lines 4633--4633 /ptmri8t/lapse_join| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (25.00304pt too wide) in paragraph at lines 4633--4634 [][] [56] [57] [58] [59] Overfull \vbox (269.21144pt too high) has occurred while \output is active [60] [61] [62] Appendix A. [63] [64] [65] [66] [67] [68] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [69] [70] Appendix C. [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] Appendix D. No file moddistutils.ind. No file distutils.ind. [83] (./distutils.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on distutils.pdf (89 pages, 370071 bytes). Transcript written on distutils.log. makeindex -s python.ist 'distutils.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file distutils.idx....done (224 entries accepted, 0 rejected). Sorting entries.....done (1822 comparisons). Generating output file distutils.ind....done (298 lines written, 0 warnings). Output written in distutils.ind. Transcript written in distutils.ilg. makeindex -s python.ist 'moddistutils.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file moddistutils.idx....done (46 entries accepted, 0 rejected). Sorting entries....done (256 comparisons). Generating output file moddistutils.ind....done (52 lines written, 0 warnings). Output written in moddistutils.ind. Transcript written in moddistutils.ilg. pdflatex 'distutils.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./distutils.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file distutils.idx (./distutils.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./distutils.out) (./distutils.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./distutils.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.43 ...ine {10}Command Reference}{39}{chapter.10} [1] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.101 ... otherwise using Python}{72}{section.C.2} [2]) Adding blank page after the table of contents. [3] [4] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.189 [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.281 [4] [5] [6] Chapter 2. [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Chapter 3. [17] Underfull \hbox (badness 5652) in paragraph at lines 1298--1300 []/ptmr8t/More in-for-ma-tion on [18] Chapter 4. Underfull \hbox (badness 10000) in paragraph at lines 1416--1418 []/ptmb8t/** /ptmr8t/get-ting C li-brary sources cur-rently broken---no /pcrr8t /get_source_files() /ptmr8t/method in [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] [28] Chapter 6. [29] [30] Chapter 7. [31] [32] Chapter 8. [33] [34] [35] [36] Chapter 9. [37] [38] Chapter 10. [39] [40] Chapter 11. Overfull \hbox (26.20094pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/long_description| Overfull \hbox (2.32108pt too wide) in paragraph at lines 3009--3009 /ptmri8t/thor_email| Overfull \hbox (9.54091pt too wide) in paragraph at lines 3009--3009 /ptmri8t/tainer_email| Overfull \hbox (6.19135pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/py_modules| Overfull \hbox (8.21123pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/ext_modules| Overfull \hbox (7.86113pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_name| Overfull \hbox (3.611pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_args| Overfull \hbox (24.99594pt too wide) in paragraph at lines 3009--3010 [][] [41] Underfull \hbox (badness 10000) in paragraph at lines 3015--3020 /ptmr8t/Run a setup script in a some-what con-trolled en-vi-ron-ment, and re-tu rn the Overfull \hbox (25.01404pt too wide) in paragraph at lines 3067--3068 [][] [42] Overfull \hbox (3.61392pt too wide) in paragraph at lines 3271--3271 /ptmri8t/clude_dirs| Overfull \hbox (9.92413pt too wide) in paragraph at lines 3271--3271 /ptmri8t/fine_macros| Overfull \hbox (7.70403pt too wide) in paragraph at lines 3271--3271 /ptmri8t/def_macros| Overfull \hbox (4.02397pt too wide) in paragraph at lines 3271--3271 /ptmri8t/brary_dirs| Overfull \hbox (31.80345pt too wide) in paragraph at lines 3271--3271 /ptmri8t/time_library_dirs| Overfull \hbox (6.3439pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_objects| Overfull \hbox (32.08376pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_compile_args| Overfull \hbox (15.42384pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_link_args| Overfull \hbox (15.38383pt too wide) in paragraph at lines 3271--3271 /ptmri8t/port_symbols| Overfull \hbox (24.9912pt too wide) in paragraph at lines 3271--3272 [][] [43] [44] [45] [46] Underfull \hbox (badness 10000) in paragraph at lines 3615--3620 /ptmr8t/and/or /pcrr8t/set_link_objects()/ptmr8t/, the li-braries sup-plied to /pcrr8t/add_library() /ptmr8t/and/or [47] [48] [49] [50] [51] [52] [53] [54] Underfull \hbox (badness 10000) in paragraph at lines 4400--4401 [55] Overfull \hbox (2.55481pt too wide) in paragraph at lines 4633--4633 /ptmb8t/fault| Overfull \hbox (29.12105pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/strip_comments| Overfull \hbox (2.47115pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/lstrip_ws| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (3.48116pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/rstrip_ws| Overfull \hbox (13.01132pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/skip_blanks| Overfull \hbox (5.24127pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/join_lines| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (7.46138pt too wide) in paragraph at lines 4633--4633 /ptmri8t/lapse_join| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (25.00304pt too wide) in paragraph at lines 4633--4634 [][] [56] [57] [58] [59] Overfull \vbox (269.21144pt too high) has occurred while \output is active [60] [61] [62] Appendix A. [63] [64] [65] [66] [67] [68] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [69] [70] Appendix C. [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] Appendix D. (./moddistutils.ind [83] [84] Underfull \hbox (badness 10000) in paragraph at lines 25--26 []/pcrr8t/distutils.command.install_headers/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 27--28 []/pcrr8t/distutils.command.install_scripts/ptmr8t/, [85]) (./distutils.ind [86] Underfull \hbox (badness 10000) in paragraph at lines 14--15 []/ptmr8t/add_include_dir() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 15--16 []/ptmr8t/add_library() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 16--17 []/ptmr8t/add_library_dir() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 17--18 []/ptmr8t/add_link_object() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 18--19 []/ptmr8t/add_runtime_library_dir() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 18--19 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 48--49 []/ptmr8t/create_static_lib() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 50--51 []/ptmr8t/customize_compiler() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 54--55 []/ptmr8t/debug_print() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 56--57 []/ptmr8t/define_macro() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 58--59 []/ptmr8t/detect_language() (dis-tu-tils.ccompiler.CCompiler [87] Underfull \hbox (badness 10000) in paragraph at lines 119--120 []/ptmr8t/executable_filename() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 119--120 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 131--132 []/ptmr8t/finalize_options() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 132--133 []/ptmr8t/find_library_file() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 139--140 []/ptmr8t/gen_preprocess_options() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 143--144 []/ptmr8t/get_config_h_filename() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 146--147 []/ptmr8t/get_default_compiler() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 147--148 []/ptmr8t/get_makefile_filename() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 148--149 []/ptmr8t/get_option_order() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 148--149 /ptmr8t/tils.fancy_getopt.FancyGetopt method), Underfull \hbox (badness 10000) in paragraph at lines 153--154 []/ptmr8t/getopt() (dis-tu-tils.fancy_getopt.FancyGetopt Underfull \hbox (badness 10000) in paragraph at lines 160--161 []/ptmr8t/has_function() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 168--169 []/ptmr8t/initialize_options() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 184--185 []/ptmr8t/library_filename() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 185--186 []/ptmr8t/library_option() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 187--188 []/ptmr8t/link_executable() (dis-tu-tils.ccompiler.CCompiler [88] Underfull \hbox (badness 10000) in paragraph at lines 188--189 []/ptmr8t/link_shared_lib() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 203--204 []/ptmr8t/move_file() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 221--222 []/ptmr8t/object_filenames() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 230--231 []/ptmr8t/preprocess() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 247--248 []/ptmr8t/run() (dis-tu-tils.command.register.Command Underfull \hbox (badness 10000) in paragraph at lines 249--250 []/ptmr8t/runtime_library_dir_option() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 249--250 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 254--255 []/ptmr8t/set_executables() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 255--256 []/ptmr8t/set_include_dirs() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 256--257 []/ptmr8t/set_libraries() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 257--258 []/ptmr8t/set_library_dirs() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 258--259 []/ptmr8t/set_link_objects() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 260--261 []/ptmr8t/set_runtime_library_dirs() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 260--261 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 262--263 []/ptmr8t/shared_object_filename() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 262--263 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 280--281 []/ptmr8t/undefine_macro() (dis-tu-tils.ccompiler.CCompiler [89] [90]) (./distutils.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on distutils.pdf (96 pages, 437909 bytes). Transcript written on distutils.log. pdflatex 'distutils.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./distutils.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file distutils.idx (./distutils.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./distutils.out) (./distutils.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./distutils.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.43 ...ine {10}Command Reference}{39}{chapter.10} [1] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.101 ... otherwise using Python}{72}{section.C.2} [2]) Adding blank page after the table of contents. [3] [4] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.122 \hypertarget{distutils-intro}{}\chapter {An Introduction to Distutils} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.189 [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.281 [4] [5] [6] Chapter 2. [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Chapter 3. [17] Underfull \hbox (badness 5652) in paragraph at lines 1298--1300 []/ptmr8t/More in-for-ma-tion on [18] Chapter 4. Underfull \hbox (badness 10000) in paragraph at lines 1416--1418 []/ptmb8t/** /ptmr8t/get-ting C li-brary sources cur-rently broken---no /pcrr8t /get_source_files() /ptmr8t/method in [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] [27] [28] Chapter 6. [29] [30] Chapter 7. [31] [32] Chapter 8. [33] [34] [35] [36] Chapter 9. [37] [38] Chapter 10. [39] [40] Chapter 11. Overfull \hbox (26.20094pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/long_description| Overfull \hbox (2.32108pt too wide) in paragraph at lines 3009--3009 /ptmri8t/thor_email| Overfull \hbox (9.54091pt too wide) in paragraph at lines 3009--3009 /ptmri8t/tainer_email| Overfull \hbox (6.19135pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/py_modules| Overfull \hbox (8.21123pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/ext_modules| Overfull \hbox (7.86113pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_name| Overfull \hbox (3.611pt too wide) in paragraph at lines 3009--3009 []/ptmri8t/script_args| Overfull \hbox (24.99594pt too wide) in paragraph at lines 3009--3010 [][] [41] Underfull \hbox (badness 10000) in paragraph at lines 3015--3020 /ptmr8t/Run a setup script in a some-what con-trolled en-vi-ron-ment, and re-tu rn the Overfull \hbox (25.01404pt too wide) in paragraph at lines 3067--3068 [][] [42] Overfull \hbox (3.61392pt too wide) in paragraph at lines 3271--3271 /ptmri8t/clude_dirs| Overfull \hbox (9.92413pt too wide) in paragraph at lines 3271--3271 /ptmri8t/fine_macros| Overfull \hbox (7.70403pt too wide) in paragraph at lines 3271--3271 /ptmri8t/def_macros| Overfull \hbox (4.02397pt too wide) in paragraph at lines 3271--3271 /ptmri8t/brary_dirs| Overfull \hbox (31.80345pt too wide) in paragraph at lines 3271--3271 /ptmri8t/time_library_dirs| Overfull \hbox (6.3439pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_objects| Overfull \hbox (32.08376pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_compile_args| Overfull \hbox (15.42384pt too wide) in paragraph at lines 3271--3271 /ptmri8t/tra_link_args| Overfull \hbox (15.38383pt too wide) in paragraph at lines 3271--3271 /ptmri8t/port_symbols| Overfull \hbox (24.9912pt too wide) in paragraph at lines 3271--3272 [][] [43] [44] [45] [46] Underfull \hbox (badness 10000) in paragraph at lines 3615--3620 /ptmr8t/and/or /pcrr8t/set_link_objects()/ptmr8t/, the li-braries sup-plied to /pcrr8t/add_library() /ptmr8t/and/or [47] [48] [49] [50] [51] [52] [53] [54] Underfull \hbox (badness 10000) in paragraph at lines 4400--4401 [55] Overfull \hbox (2.55481pt too wide) in paragraph at lines 4633--4633 /ptmb8t/fault| Overfull \hbox (29.12105pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/strip_comments| Overfull \hbox (2.47115pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/lstrip_ws| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (3.48116pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/rstrip_ws| Overfull \hbox (13.01132pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/skip_blanks| Overfull \hbox (5.24127pt too wide) in paragraph at lines 4633--4633 []/ptmri8t/join_lines| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (7.46138pt too wide) in paragraph at lines 4633--4633 /ptmri8t/lapse_join| Overfull \hbox (1.3347pt too wide) in paragraph at lines 4633--4633 []/ptmr8t/false| Overfull \hbox (25.00304pt too wide) in paragraph at lines 4633--4634 [][] [56] [57] [58] [59] Overfull \vbox (269.21144pt too high) has occurred while \output is active [60] [61] [62] Appendix A. [63] [64] [65] [66] [67] [68] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [69] [70] Appendix C. [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] Appendix D. (./moddistutils.ind [83] [84] Underfull \hbox (badness 10000) in paragraph at lines 25--26 []/pcrr8t/distutils.command.install_headers/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 27--28 []/pcrr8t/distutils.command.install_scripts/ptmr8t/, [85]) (./distutils.ind [86] Underfull \hbox (badness 10000) in paragraph at lines 14--15 []/ptmr8t/add_include_dir() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 15--16 []/ptmr8t/add_library() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 16--17 []/ptmr8t/add_library_dir() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 17--18 []/ptmr8t/add_link_object() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 18--19 []/ptmr8t/add_runtime_library_dir() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 18--19 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 48--49 []/ptmr8t/create_static_lib() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 50--51 []/ptmr8t/customize_compiler() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 54--55 []/ptmr8t/debug_print() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 56--57 []/ptmr8t/define_macro() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 58--59 []/ptmr8t/detect_language() (dis-tu-tils.ccompiler.CCompiler [87] Underfull \hbox (badness 10000) in paragraph at lines 119--120 []/ptmr8t/executable_filename() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 119--120 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 131--132 []/ptmr8t/finalize_options() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 132--133 []/ptmr8t/find_library_file() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 139--140 []/ptmr8t/gen_preprocess_options() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 143--144 []/ptmr8t/get_config_h_filename() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 146--147 []/ptmr8t/get_default_compiler() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 147--148 []/ptmr8t/get_makefile_filename() (in mod-ule dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 148--149 []/ptmr8t/get_option_order() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 148--149 /ptmr8t/tils.fancy_getopt.FancyGetopt method), Underfull \hbox (badness 10000) in paragraph at lines 153--154 []/ptmr8t/getopt() (dis-tu-tils.fancy_getopt.FancyGetopt Underfull \hbox (badness 10000) in paragraph at lines 160--161 []/ptmr8t/has_function() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 168--169 []/ptmr8t/initialize_options() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 184--185 []/ptmr8t/library_filename() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 185--186 []/ptmr8t/library_option() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 187--188 []/ptmr8t/link_executable() (dis-tu-tils.ccompiler.CCompiler [88] Underfull \hbox (badness 10000) in paragraph at lines 188--189 []/ptmr8t/link_shared_lib() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 203--204 []/ptmr8t/move_file() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 221--222 []/ptmr8t/object_filenames() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 230--231 []/ptmr8t/preprocess() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 247--248 []/ptmr8t/run() (dis-tu-tils.command.register.Command Underfull \hbox (badness 10000) in paragraph at lines 249--250 []/ptmr8t/runtime_library_dir_option() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 249--250 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 254--255 []/ptmr8t/set_executables() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 255--256 []/ptmr8t/set_include_dirs() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 256--257 []/ptmr8t/set_libraries() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 257--258 []/ptmr8t/set_library_dirs() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 258--259 []/ptmr8t/set_link_objects() (dis-tu-tils.ccompiler.CCompiler Underfull \hbox (badness 10000) in paragraph at lines 260--261 []/ptmr8t/set_runtime_library_dirs() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 260--261 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 262--263 []/ptmr8t/shared_object_filename() (dis-tu- Underfull \hbox (badness 10000) in paragraph at lines 262--263 /ptmr8t/tils.ccompiler.CCompiler method), Underfull \hbox (badness 10000) in paragraph at lines 280--281 []/ptmr8t/undefine_macro() (dis-tu-tils.ccompiler.CCompiler [89] [90]) (./distutils.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on distutils.pdf (96 pages, 438827 bytes). Transcript written on distutils.log. pdflatex 'documenting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./documenting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file documenting.idx No file documenting.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [2] Chapter 1. [3] [4] Chapter 2. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [5] [6] Chapter 3. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [7] [8] [9] [10] Chapter 4. [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] Appendix A. [27] [28] [29] [30] [31] [32] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [33] [34] Appendix C. [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] Appendix D. No file moddocumenting.ind. No file documenting.ind. [47] (./documenting.aux) ){/usr/share/texmf/dvips/psnfss/8r.enc} Output written on documenting.pdf (51 pages, 160428 bytes). Transcript written on documenting.log. pdflatex 'documenting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./documenting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file documenting.idx (./documenting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./documenting.out) (./documenting.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/ texmf/dvips/config/pdftex.map}] [2] (./documenting.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.54 ...{\numberline {D}Copyright}{47}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [2] Chapter 1. [3] [4] Chapter 2. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [5] [6] Chapter 3. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [7] [8] [9] [10] Chapter 4. [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] Appendix A. [27] [28] [29] [30] [31] [32] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [33] [34] Appendix C. [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] Appendix D. No file moddocumenting.ind. No file documenting.ind. [47] (./documenting.aux) ){/usr/share/texmf/dvips/psnfss/8r.enc} Output written on documenting.pdf (51 pages, 179994 bytes). Transcript written on documenting.log. pdflatex 'documenting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./documenting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file documenting.idx (./documenting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./documenting.out) (./documenting.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/ texmf/dvips/config/pdftex.map}] [2] (./documenting.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.54 ...{\numberline {D}Copyright}{47}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [2] Chapter 1. [3] [4] Chapter 2. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [5] [6] Chapter 3. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [7] [8] [9] [10] Chapter 4. [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] Appendix A. [27] [28] [29] [30] [31] [32] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [33] [34] Appendix C. [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] Appendix D. No file moddocumenting.ind. No file documenting.ind. [47] (./documenting.aux) ){/usr/share/texmf/dvips/psnfss/8r.enc} Output written on documenting.pdf (51 pages, 179994 bytes). Transcript written on documenting.log. makeindex -s python.ist 'documenting.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file documenting.idx....done (66 entries accepted, 0 rejected). Sorting entries....done (364 comparisons). Generating output file documenting.ind....done (132 lines written, 0 warnings). Output written in documenting.ind. Transcript written in documenting.ilg. makeindex -s python.ist 'moddocumenting.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file moddocumenting.idx...done (0 entries accepted, 0 rejected). Nothing written in moddocumenting.ind. Transcript written in moddocumenting.ilg. pdflatex 'documenting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./documenting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file documenting.idx (./documenting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./documenting.out) (./documenting.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/ texmf/dvips/config/pdftex.map}] [2] (./documenting.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.54 ...{\numberline {D}Copyright}{47}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [2] Chapter 1. [3] [4] Chapter 2. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [5] [6] Chapter 3. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [7] [8] [9] [10] Chapter 4. [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] Appendix A. [27] [28] [29] [30] [31] [32] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [33] [34] Appendix C. [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] Appendix D. (./moddocumenting.ind) (./documenting.ind [47] [48] [49] [50]) (./documenting.aux) ){/usr/share/texmf/dvips/psnfss/8r.enc} Output written on documenting.pdf (54 pages, 197079 bytes). Transcript written on documenting.log. pdflatex 'documenting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./documenting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file documenting.idx (./documenting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./documenting.out) (./documenting.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/ texmf/dvips/config/pdftex.map}] [2] (./documenting.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.54 ...{\numberline {D}Copyright}{47}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.116 \chapter {Introduction} [2] Chapter 1. [3] [4] Chapter 2. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [5] [6] Chapter 3. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [7] [8] [9] [10] Chapter 4. [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] Chapter 5. [23] [24] [25] [26] Appendix A. [27] [28] [29] [30] [31] [32] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [33] [34] Appendix C. [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] Appendix D. (./moddocumenting.ind) (./documenting.ind [47] [48] [49] [50]) (./documenting.aux) ){/usr/share/texmf/dvips/psnfss/8r.enc} Output written on documenting.pdf (54 pages, 197530 bytes). Transcript written on documenting.log. pdflatex 'extending.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./extending.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file extending.idx No file extending.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 178--179 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 2. [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] Chapter 3. [59] [60] Chapter 4. [61] [62] [63] [64] Chapter 5. [65] [66] [67] [68] [69] [70] Appendix A. [71] [72] [73] [74] [75] [76] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [77] [78] Appendix C. [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] Appendix D. No file modextending.ind. No file extending.ind. [91] (./extending.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on extending.pdf (95 pages, 377441 bytes). Transcript written on extending.log. pdflatex 'extending.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./extending.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file extending.idx (./extending.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./extending.out) (./extending.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./extending.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.67 ...{\numberline {D}Copyright}{91}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 178--179 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 2. [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] Chapter 3. [59] [60] Chapter 4. [61] [62] [63] [64] Chapter 5. [65] [66] [67] [68] [69] [70] Appendix A. [71] [72] [73] [74] [75] [76] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [77] [78] Appendix C. [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] Appendix D. No file modextending.ind. No file extending.ind. [91] (./extending.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on extending.pdf (95 pages, 396900 bytes). Transcript written on extending.log. pdflatex 'extending.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./extending.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file extending.idx (./extending.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./extending.out) (./extending.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./extending.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.67 ...{\numberline {D}Copyright}{91}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 178--179 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 2. [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] Chapter 3. [59] [60] Chapter 4. [61] [62] [63] [64] Chapter 5. [65] [66] [67] [68] [69] [70] Appendix A. [71] [72] [73] [74] [75] [76] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [77] [78] Appendix C. [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] Appendix D. No file modextending.ind. No file extending.ind. [91] (./extending.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on extending.pdf (95 pages, 396900 bytes). Transcript written on extending.log. makeindex -s python.ist 'extending.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file extending.idx....done (87 entries accepted, 0 rejected). Sorting entries....done (574 comparisons). Generating output file extending.ind....done (161 lines written, 0 warnings). Output written in extending.ind. Transcript written in extending.ilg. makeindex -s python.ist 'modextending.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modextending.idx...done (0 entries accepted, 0 rejected). Nothing written in modextending.ind. Transcript written in modextending.ilg. pdflatex 'extending.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./extending.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file extending.idx (./extending.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./extending.out) (./extending.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./extending.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.67 ...{\numberline {D}Copyright}{91}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 178--179 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 2. [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] Chapter 3. [59] [60] Chapter 4. [61] [62] [63] [64] Chapter 5. [65] [66] [67] [68] [69] [70] Appendix A. [71] [72] [73] [74] [75] [76] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [77] [78] Appendix C. [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] Appendix D. (./modextending.ind) (./extending.ind [91] [92] [93] [94]) (./extending.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on extending.pdf (98 pages, 418997 bytes). Transcript written on extending.log. pdflatex 'extending.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./extending.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file extending.idx (./extending.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./extending.out) (./extending.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/te xmf/dvips/config/pdftex.map}] [2] (./extending.toc ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.67 ...{\numberline {D}Copyright}{91}{appendix.D} [1]) ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.128 \hypertarget{extending-intro}{}\chapter {Extending Python with C or C++} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Underfull \hbox (badness 10000) in paragraph at lines 178--179 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 2. [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] Chapter 3. [59] [60] Chapter 4. [61] [62] [63] [64] Chapter 5. [65] [66] [67] [68] [69] [70] Appendix A. [71] [72] [73] [74] [75] [76] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [77] [78] Appendix C. [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] Appendix D. (./modextending.ind) (./extending.ind [91] [92] [93] [94]) (./extending.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on extending.pdf (98 pages, 419444 bytes). Transcript written on extending.log. pdflatex 'howto-advocacy.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-advocacy.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-advocacy.idx No file howto-advocacy.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 119--119 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [4] No file modhowto-advocacy.ind. No file howto-advocacy.ind. [5] (./howto-advocacy.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-advocacy.pdf (5 pages, 26518 bytes). Transcript written on howto-advocacy.log. pdflatex 'howto-advocacy.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-advocacy.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-advocacy.idx (./howto-advocacy.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-advocacy.out) (./howto-advocacy.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-advocacy.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 119--119 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [4] No file modhowto-advocacy.ind. No file howto-advocacy.ind. [5] (./howto-advocacy.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-advocacy.pdf (5 pages, 30071 bytes). Transcript written on howto-advocacy.log. pdflatex 'howto-advocacy.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-advocacy.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-advocacy.idx (./howto-advocacy.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-advocacy.out) (./howto-advocacy.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-advocacy.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 119--119 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [4] No file modhowto-advocacy.ind. No file howto-advocacy.ind. [5] (./howto-advocacy.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-advocacy.pdf (5 pages, 30075 bytes). Transcript written on howto-advocacy.log. makeindex -s python.ist 'howto-advocacy.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-advocacy.idx...done (0 entries accepted, 0 rejected). Nothing written in howto-advocacy.ind. Transcript written in howto-advocacy.ilg. makeindex -s python.ist 'modhowto-advocacy.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-advocacy.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-advocacy.ind. Transcript written in modhowto-advocacy.ilg. pdflatex 'howto-advocacy.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-advocacy.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-advocacy.idx (./howto-advocacy.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-advocacy.out) (./howto-advocacy.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-advocacy.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 119--119 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [4] (./modhowto-advocacy.ind) (./howto-advocacy.ind) [5] (./howto-advocacy.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-advocacy.pdf (5 pages, 30075 bytes). Transcript written on howto-advocacy.log. pdflatex 'howto-advocacy.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-advocacy.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-advocacy.idx (./howto-advocacy.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-advocacy.out) (./howto-advocacy.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-advocacy.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 119--119 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [4] (./modhowto-advocacy.ind) (./howto-advocacy.ind) [5] (./howto-advocacy.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-advocacy.pdf (5 pages, 30075 bytes). Transcript written on howto-advocacy.log. pdflatex 'howto-cporting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-cporting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-cporting.idx No file howto-cporting.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] No file modhowto-cporting.ind. No file howto-cporting.ind. [4] (./howto-cporting.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-cporting.pdf (4 pages, 17693 bytes). Transcript written on howto-cporting.log. pdflatex 'howto-cporting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-cporting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-cporting.idx (./howto-cporting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-cporting.out) (./howto-cporting.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-cporting.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] No file modhowto-cporting.ind. No file howto-cporting.ind. [4] (./howto-cporting.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-cporting.pdf (4 pages, 20772 bytes). Transcript written on howto-cporting.log. pdflatex 'howto-cporting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-cporting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-cporting.idx (./howto-cporting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-cporting.out) (./howto-cporting.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-cporting.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] No file modhowto-cporting.ind. No file howto-cporting.ind. [4] (./howto-cporting.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-cporting.pdf (4 pages, 20771 bytes). Transcript written on howto-cporting.log. makeindex -s python.ist 'howto-cporting.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-cporting.idx....done (1 entries accepted, 0 rejected). Sorting entries...done (0 comparisons). Generating output file howto-cporting.ind....done (8 lines written, 0 warnings). Output written in howto-cporting.ind. Transcript written in howto-cporting.ilg. makeindex -s python.ist 'modhowto-cporting.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-cporting.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-cporting.ind. Transcript written in modhowto-cporting.ilg. pdflatex 'howto-cporting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-cporting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-cporting.idx (./howto-cporting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-cporting.out) (./howto-cporting.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-cporting.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] (./modhowto-cporting.ind) (./howto-cporting.ind [4] [5]) (./howto-cporting.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.iii} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-cporting.pdf (5 pages, 21951 bytes). Transcript written on howto-cporting.log. pdflatex 'howto-cporting.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-cporting.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-cporting.idx (./howto-cporting.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-cporting.out) (./howto-cporting.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-cporting.toc) Overfull \hbox (29.52002pt too wide) in paragraph at lines 8--97 [][][]/ptmr8t/Index[][]v [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] (./modhowto-cporting.ind) (./howto-cporting.ind [4] [5]) (./howto-cporting.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.iii} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-cporting.pdf (5 pages, 22391 bytes). Transcript written on howto-cporting.log. pdflatex 'howto-curses.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-curses.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-curses.idx No file howto-curses.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] [4] [5] No file modhowto-curses.ind. No file howto-curses.ind. [6] (./howto-curses.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-curses.pdf (6 pages, 31321 bytes). Transcript written on howto-curses.log. pdflatex 'howto-curses.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-curses.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-curses.idx (./howto-curses.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-curses.out) (./howto-curses.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-curses.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] [4] [5] [6] No file modhowto-curses.ind. No file howto-curses.ind. [7] (./howto-curses.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-curses.pdf (7 pages, 36228 bytes). Transcript written on howto-curses.log. pdflatex 'howto-curses.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-curses.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-curses.idx (./howto-curses.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-curses.out) (./howto-curses.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-curses.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] [4] [5] [6] No file modhowto-curses.ind. No file howto-curses.ind. [7] (./howto-curses.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-curses.pdf (7 pages, 36221 bytes). Transcript written on howto-curses.log. makeindex -s python.ist 'howto-curses.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-curses.idx...done (0 entries accepted, 0 rejected). Nothing written in howto-curses.ind. Transcript written in howto-curses.ilg. makeindex -s python.ist 'modhowto-curses.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-curses.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-curses.ind. Transcript written in modhowto-curses.ilg. pdflatex 'howto-curses.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-curses.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-curses.idx (./howto-curses.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-curses.out) (./howto-curses.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-curses.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] [4] [5] [6] (./modhowto-curses.ind) (./howto-curses.ind) [7] (./howto-curses.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-curses.pdf (7 pages, 36221 bytes). Transcript written on howto-curses.log. pdflatex 'howto-curses.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-curses.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-curses.idx (./howto-curses.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-curses.out) (./howto-curses.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-curses.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] [3] [4] [5] [6] (./modhowto-curses.ind) (./howto-curses.ind) [7] (./howto-curses.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-curses.pdf (7 pages, 36221 bytes). Transcript written on howto-curses.log. pdflatex 'howto-doanddont.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-doanddont.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-doanddont.idx No file howto-doanddont.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 116--116 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] No file modhowto-doanddont.ind. No file howto-doanddont.ind. [5] (./howto-doanddont.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-doanddont.pdf (5 pages, 24585 bytes). Transcript written on howto-doanddont.log. pdflatex 'howto-doanddont.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-doanddont.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-doanddont.idx (./howto-doanddont.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-doanddont.out) (./howto-doanddont.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-doanddont.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd)) Overfull \hbox (14.79999pt too wide) in paragraph at lines 116--116 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] No file modhowto-doanddont.ind. No file howto-doanddont.ind. [6] (./howto-doanddont.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-doanddont.pdf (6 pages, 31182 bytes). Transcript written on howto-doanddont.log. pdflatex 'howto-doanddont.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-doanddont.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-doanddont.idx (./howto-doanddont.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-doanddont.out) (./howto-doanddont.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-doanddont.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd)) Overfull \hbox (14.79999pt too wide) in paragraph at lines 116--116 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] No file modhowto-doanddont.ind. No file howto-doanddont.ind. [6] (./howto-doanddont.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-doanddont.pdf (6 pages, 31183 bytes). Transcript written on howto-doanddont.log. makeindex -s python.ist 'howto-doanddont.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-doanddont.idx...done (0 entries accepted, 0 rejected). Nothing written in howto-doanddont.ind. Transcript written in howto-doanddont.ilg. makeindex -s python.ist 'modhowto-doanddont.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-doanddont.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-doanddont.ind. Transcript written in modhowto-doanddont.ilg. pdflatex 'howto-doanddont.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-doanddont.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-doanddont.idx (./howto-doanddont.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-doanddont.out) (./howto-doanddont.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-doanddont.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd)) Overfull \hbox (14.79999pt too wide) in paragraph at lines 116--116 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] (./modhowto-doanddont.ind) (./howto-doanddont.ind) [6] (./howto-doanddont.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-doanddont.pdf (6 pages, 31183 bytes). Transcript written on howto-doanddont.log. pdflatex 'howto-doanddont.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-doanddont.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-doanddont.idx (./howto-doanddont.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-doanddont.out) (./howto-doanddont.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-doanddont.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd)) Overfull \hbox (14.79999pt too wide) in paragraph at lines 116--116 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] (./modhowto-doanddont.ind) (./howto-doanddont.ind) [6] (./howto-doanddont.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-doanddont.pdf (6 pages, 31183 bytes). Transcript written on howto-doanddont.log. pdflatex 'howto-functional.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-functional.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-functional.idx No file howto-functional.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [1{/usr/share/texmf/dvips/config/ pdftex.map}] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Underfull \hbox (badness 10000) in paragraph at lines 1174--1176 []/pcrr8t/itertools.imap(f, iterA, iterB, ...) /ptmr8t/re-turns a stream con-ta in-ing /pcrr8t/f(iterA[0], [14] [15] Underfull \hbox (badness 10000) in paragraph at lines 1304--1307 []/ptmr8t/The con-struc-tor for /pcrr8t/partial /ptmr8t/takes the ar-gu-ments / pcrr8t/(function, arg1, arg2, ... [16] [17] [18] [19] No file modhowto-functional.ind. No file howto-functional.ind. [20] (./howto-functional.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-functional.pdf (20 pages, 84541 bytes). Transcript written on howto-functional.log. pdflatex 'howto-functional.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-functional.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-functional.idx (./howto-functional.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-functional.out) (./howto-functional.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-functional.toc) [1{/usr/s hare/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] Underfull \hbox (badness 10000) in paragraph at lines 1174--1176 []/pcrr8t/itertools.imap(f, iterA, iterB, ...) /ptmr8t/re-turns a stream con-ta in-ing /pcrr8t/f(iterA[0], [15] [16] Underfull \hbox (badness 10000) in paragraph at lines 1304--1307 []/ptmr8t/The con-struc-tor for /pcrr8t/partial /ptmr8t/takes the ar-gu-ments / pcrr8t/(function, arg1, arg2, ... [17] [18] [19] No file modhowto-functional.ind. No file howto-functional.ind. [20] (./howto-functional.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-functional.pdf (20 pages, 97073 bytes). Transcript written on howto-functional.log. pdflatex 'howto-functional.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-functional.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-functional.idx (./howto-functional.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-functional.out) (./howto-functional.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-functional.toc Overfull \hbox (2.83965pt too wide) detected at line 21 []/ptmr8t/xviii ) [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] Underfull \hbox (badness 10000) in paragraph at lines 1174--1176 []/pcrr8t/itertools.imap(f, iterA, iterB, ...) /ptmr8t/re-turns a stream con-ta in-ing /pcrr8t/f(iterA[0], [15] [16] Underfull \hbox (badness 10000) in paragraph at lines 1304--1307 []/ptmr8t/The con-struc-tor for /pcrr8t/partial /ptmr8t/takes the ar-gu-ments / pcrr8t/(function, arg1, arg2, ... [17] [18] [19] No file modhowto-functional.ind. No file howto-functional.ind. [20] (./howto-functional.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-functional.pdf (20 pages, 97078 bytes). Transcript written on howto-functional.log. makeindex -s python.ist 'howto-functional.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-functional.idx....done (2 entries accepted, 0 rejected). Sorting entries....done (2 comparisons). Generating output file howto-functional.ind....done (9 lines written, 0 warnings). Output written in howto-functional.ind. Transcript written in howto-functional.ilg. makeindex -s python.ist 'modhowto-functional.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-functional.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-functional.ind. Transcript written in modhowto-functional.ilg. pdflatex 'howto-functional.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-functional.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-functional.idx (./howto-functional.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-functional.out) (./howto-functional.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-functional.toc Overfull \hbox (2.83965pt too wide) detected at line 21 []/ptmr8t/xviii ) [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] Underfull \hbox (badness 10000) in paragraph at lines 1174--1176 []/pcrr8t/itertools.imap(f, iterA, iterB, ...) /ptmr8t/re-turns a stream con-ta in-ing /pcrr8t/f(iterA[0], [15] [16] Underfull \hbox (badness 10000) in paragraph at lines 1304--1307 []/ptmr8t/The con-struc-tor for /pcrr8t/partial /ptmr8t/takes the ar-gu-ments / pcrr8t/(function, arg1, arg2, ... [17] [18] [19] (./modhowto-functional.ind) (./howto-functional.ind [20] [21]) (./howto-functional.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.xx} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-functional.pdf (21 pages, 98491 bytes). Transcript written on howto-functional.log. pdflatex 'howto-functional.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-functional.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-functional.idx (./howto-functional.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-functional.out) (./howto-functional.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-functional.toc Overfull \hbox (2.83965pt too wide) detected at line 21 []/ptmr8t/xviii ) Overfull \hbox (37.29991pt too wide) in paragraph at lines 27--97 [][][]/ptmr8t/Index[][]xxi [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] Underfull \hbox (badness 10000) in paragraph at lines 1174--1176 []/pcrr8t/itertools.imap(f, iterA, iterB, ...) /ptmr8t/re-turns a stream con-ta in-ing /pcrr8t/f(iterA[0], [15] [16] Underfull \hbox (badness 10000) in paragraph at lines 1304--1307 []/ptmr8t/The con-struc-tor for /pcrr8t/partial /ptmr8t/takes the ar-gu-ments / pcrr8t/(function, arg1, arg2, ... [17] [18] [19] (./modhowto-functional.ind) (./howto-functional.ind [20] [21]) (./howto-functional.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.xx} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-functional.pdf (21 pages, 98947 bytes). Transcript written on howto-functional.log. pdflatex 'howto-regex.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-regex.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-regex.idx No file howto-regex.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 118--118 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] Overfull \hbox (5.13745pt too wide) in paragraph at lines 350--351 [][] [3] [4] [5] [6] (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [7] [8] [9] [10] [11] [12] Overfull \hbox (15.79787pt too wide) in paragraph at lines 1331--1332 [][] [13] [14] [15] [16] [17] No file modhowto-regex.ind. No file howto-regex.ind. [18] (./howto-regex.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-regex.pdf (18 pages, 87884 bytes). Transcript written on howto-regex.log. pdflatex 'howto-regex.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-regex.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-regex.idx (./howto-regex.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-regex.out) (./howto-regex.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-regex.toc) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 118--118 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] Overfull \hbox (5.13745pt too wide) in paragraph at lines 350--351 [][] [3] [4] [5] [6] [7] (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [8] [9] [10] [11] [12] [13] Overfull \hbox (15.79787pt too wide) in paragraph at lines 1331--1332 [][] [14] [15] [16] [17] No file modhowto-regex.ind. No file howto-regex.ind. [18] (./howto-regex.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-regex.pdf (18 pages, 100466 bytes). Transcript written on howto-regex.log. pdflatex 'howto-regex.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-regex.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-regex.idx (./howto-regex.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-regex.out) (./howto-regex.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-regex.toc Overfull \hbox (2.83965pt too wide) detected at line 24 []/ptmr8t/xviii ) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 118--118 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] Overfull \hbox (5.13745pt too wide) in paragraph at lines 350--351 [][] [3] [4] [5] [6] [7] (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [8] [9] [10] [11] [12] [13] Overfull \hbox (15.79787pt too wide) in paragraph at lines 1331--1332 [][] [14] [15] [16] [17] No file modhowto-regex.ind. No file howto-regex.ind. [18] (./howto-regex.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-regex.pdf (18 pages, 100475 bytes). Transcript written on howto-regex.log. makeindex -s python.ist 'howto-regex.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-regex.idx...done (0 entries accepted, 0 rejected). Nothing written in howto-regex.ind. Transcript written in howto-regex.ilg. makeindex -s python.ist 'modhowto-regex.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-regex.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-regex.ind. Transcript written in modhowto-regex.ilg. pdflatex 'howto-regex.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-regex.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-regex.idx (./howto-regex.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-regex.out) (./howto-regex.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-regex.toc Overfull \hbox (2.83965pt too wide) detected at line 24 []/ptmr8t/xviii ) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 118--118 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] Overfull \hbox (5.13745pt too wide) in paragraph at lines 350--351 [][] [3] [4] [5] [6] [7] (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [8] [9] [10] [11] [12] [13] Overfull \hbox (15.79787pt too wide) in paragraph at lines 1331--1332 [][] [14] [15] [16] [17] (./modhowto-regex.ind) (./howto-regex.ind) [18] (./howto-regex.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-regex.pdf (18 pages, 100475 bytes). Transcript written on howto-regex.log. pdflatex 'howto-regex.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-regex.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-regex.idx (./howto-regex.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-regex.out) (./howto-regex.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-regex.toc Overfull \hbox (2.83965pt too wide) detected at line 24 []/ptmr8t/xviii ) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 118--118 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] [2] Overfull \hbox (5.13745pt too wide) in paragraph at lines 350--351 [][] [3] [4] [5] [6] [7] (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [8] [9] [10] [11] [12] [13] Overfull \hbox (15.79787pt too wide) in paragraph at lines 1331--1332 [][] [14] [15] [16] [17] (./modhowto-regex.ind) (./howto-regex.ind) [18] (./howto-regex.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-regex.pdf (18 pages, 100475 bytes). Transcript written on howto-regex.log. pdflatex 'howto-sockets.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-sockets.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-sockets.idx No file howto-sockets.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] No file modhowto-sockets.ind. No file howto-sockets.ind. [6] (./howto-sockets.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-sockets.pdf (6 pages, 30776 bytes). Transcript written on howto-sockets.log. pdflatex 'howto-sockets.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-sockets.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-sockets.idx (./howto-sockets.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-sockets.out) (./howto-sockets.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-sockets.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] No file modhowto-sockets.ind. No file howto-sockets.ind. [7] (./howto-sockets.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-sockets.pdf (7 pages, 36579 bytes). Transcript written on howto-sockets.log. pdflatex 'howto-sockets.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-sockets.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-sockets.idx (./howto-sockets.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-sockets.out) (./howto-sockets.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-sockets.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] No file modhowto-sockets.ind. No file howto-sockets.ind. [7] (./howto-sockets.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-sockets.pdf (7 pages, 36573 bytes). Transcript written on howto-sockets.log. makeindex -s python.ist 'howto-sockets.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-sockets.idx...done (0 entries accepted, 0 rejected). Nothing written in howto-sockets.ind. Transcript written in howto-sockets.ilg. makeindex -s python.ist 'modhowto-sockets.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-sockets.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-sockets.ind. Transcript written in modhowto-sockets.ilg. pdflatex 'howto-sockets.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-sockets.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-sockets.idx (./howto-sockets.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-sockets.out) (./howto-sockets.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-sockets.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] (./modhowto-sockets.ind) (./howto-sockets.ind) [7] (./howto-sockets.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-sockets.pdf (7 pages, 36573 bytes). Transcript written on howto-sockets.log. pdflatex 'howto-sockets.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-sockets.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-sockets.idx (./howto-sockets.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-sockets.out) (./howto-sockets.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-sockets.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 117--117 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] (./modhowto-sockets.ind) (./howto-sockets.ind) [7] (./howto-sockets.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-sockets.pdf (7 pages, 36573 bytes). Transcript written on howto-sockets.log. pdflatex 'howto-unicode.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-unicode.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-unicode.idx No file howto-unicode.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] Underfull \hbox (badness 10000) in paragraph at lines 341--346 []/ptmr8t/Two other good in-tro-duc-tory ar-ti-cles were writ-ten by Joel Spol- sky Underfull \hbox (badness 10000) in paragraph at lines 341--346 /ptmr8t/<[][]http://www.joelonsoftware.com/articles/Unicode.html[][]> and Ja-so n Oren-dorff Underfull \hbox (badness 10000) in paragraph at lines 347--350 []/ptmr8t/Wikipedia en-tries are of-ten help-ful; see the en-tries for ``char-a c-ter en-cod-ing'' Underfull \hbox (badness 10000) in paragraph at lines 347--350 /ptmr8t/<[][]http://en.wikipedia.org/wiki/Character_encoding[][]> and UTF-8 <[] []http://en.wikipedia.org/wiki/UTF-8[][]>, for [4] [5] [6] [7] Underfull \hbox (badness 10000) in paragraph at lines 675--685 []/ptmr8t/The func-tion's pa-ram-e-ters are /pcrr8t/open(filename, mode='rb', e ncoding=None, [8] [9] No file modhowto-unicode.ind. No file howto-unicode.ind. [10] (./howto-unicode.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/f7b6d320.enc} Output written on howto-unicode.pdf (10 pages, 55303 bytes). Transcript written on howto-unicode.log. pdflatex 'howto-unicode.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-unicode.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-unicode.idx (./howto-unicode.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-unicode.out) (./howto-unicode.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-unicode.toc) (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [1{/usr/share/texmf/dvips/ config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] Underfull \hbox (badness 10000) in paragraph at lines 341--346 []/ptmr8t/Two other good in-tro-duc-tory ar-ti-cles were writ-ten by Joel Spol- sky Underfull \hbox (badness 10000) in paragraph at lines 341--346 /ptmr8t/<[][]http://www.joelonsoftware.com/articles/Unicode.html[][]> and Ja-so n Oren-dorff Underfull \hbox (badness 10000) in paragraph at lines 347--350 []/ptmr8t/Wikipedia en-tries are of-ten help-ful; see the en-tries for ``char-a c-ter en-cod-ing'' Underfull \hbox (badness 10000) in paragraph at lines 347--350 /ptmr8t/<[][]http://en.wikipedia.org/wiki/Character_encoding[][]> and UTF-8 <[] []http://en.wikipedia.org/wiki/UTF-8[][]>, for [4] [5] [6] [7] Underfull \hbox (badness 10000) in paragraph at lines 675--685 []/ptmr8t/The func-tion's pa-ram-e-ters are /pcrr8t/open(filename, mode='rb', e ncoding=None, [8] [9] [10] No file modhowto-unicode.ind. No file howto-unicode.ind. [11] (./howto-unicode.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/f7b6d320.enc} Output written on howto-unicode.pdf (11 pages, 63500 bytes). Transcript written on howto-unicode.log. pdflatex 'howto-unicode.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-unicode.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-unicode.idx (./howto-unicode.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-unicode.out) (./howto-unicode.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-unicode.toc) (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [1{/usr/share/texmf/dvips/ config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] Underfull \hbox (badness 10000) in paragraph at lines 341--346 []/ptmr8t/Two other good in-tro-duc-tory ar-ti-cles were writ-ten by Joel Spol- sky Underfull \hbox (badness 10000) in paragraph at lines 341--346 /ptmr8t/<[][]http://www.joelonsoftware.com/articles/Unicode.html[][]> and Ja-so n Oren-dorff Underfull \hbox (badness 10000) in paragraph at lines 347--350 []/ptmr8t/Wikipedia en-tries are of-ten help-ful; see the en-tries for ``char-a c-ter en-cod-ing'' Underfull \hbox (badness 10000) in paragraph at lines 347--350 /ptmr8t/<[][]http://en.wikipedia.org/wiki/Character_encoding[][]> and UTF-8 <[] []http://en.wikipedia.org/wiki/UTF-8[][]>, for [4] [5] [6] [7] Underfull \hbox (badness 10000) in paragraph at lines 675--685 []/ptmr8t/The func-tion's pa-ram-e-ters are /pcrr8t/open(filename, mode='rb', e ncoding=None, [8] [9] [10] No file modhowto-unicode.ind. No file howto-unicode.ind. [11] (./howto-unicode.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/f7b6d320.enc} Output written on howto-unicode.pdf (11 pages, 63507 bytes). Transcript written on howto-unicode.log. makeindex -s python.ist 'howto-unicode.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-unicode.idx...done (0 entries accepted, 0 rejected). Nothing written in howto-unicode.ind. Transcript written in howto-unicode.ilg. makeindex -s python.ist 'modhowto-unicode.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-unicode.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-unicode.ind. Transcript written in modhowto-unicode.ilg. pdflatex 'howto-unicode.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-unicode.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-unicode.idx (./howto-unicode.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-unicode.out) (./howto-unicode.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-unicode.toc) (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [1{/usr/share/texmf/dvips/ config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] Underfull \hbox (badness 10000) in paragraph at lines 341--346 []/ptmr8t/Two other good in-tro-duc-tory ar-ti-cles were writ-ten by Joel Spol- sky Underfull \hbox (badness 10000) in paragraph at lines 341--346 /ptmr8t/<[][]http://www.joelonsoftware.com/articles/Unicode.html[][]> and Ja-so n Oren-dorff Underfull \hbox (badness 10000) in paragraph at lines 347--350 []/ptmr8t/Wikipedia en-tries are of-ten help-ful; see the en-tries for ``char-a c-ter en-cod-ing'' Underfull \hbox (badness 10000) in paragraph at lines 347--350 /ptmr8t/<[][]http://en.wikipedia.org/wiki/Character_encoding[][]> and UTF-8 <[] []http://en.wikipedia.org/wiki/UTF-8[][]>, for [4] [5] [6] [7] Underfull \hbox (badness 10000) in paragraph at lines 675--685 []/ptmr8t/The func-tion's pa-ram-e-ters are /pcrr8t/open(filename, mode='rb', e ncoding=None, [8] [9] [10] (./modhowto-unicode.ind) (./howto-unicode.ind) [11] (./howto-unicode.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/f7b6d320.enc} Output written on howto-unicode.pdf (11 pages, 63507 bytes). Transcript written on howto-unicode.log. pdflatex 'howto-unicode.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-unicode.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-unicode.idx (./howto-unicode.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-unicode.out) (./howto-unicode.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-unicode.toc) (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [1{/usr/share/texmf/dvips/ config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] Underfull \hbox (badness 10000) in paragraph at lines 341--346 []/ptmr8t/Two other good in-tro-duc-tory ar-ti-cles were writ-ten by Joel Spol- sky Underfull \hbox (badness 10000) in paragraph at lines 341--346 /ptmr8t/<[][]http://www.joelonsoftware.com/articles/Unicode.html[][]> and Ja-so n Oren-dorff Underfull \hbox (badness 10000) in paragraph at lines 347--350 []/ptmr8t/Wikipedia en-tries are of-ten help-ful; see the en-tries for ``char-a c-ter en-cod-ing'' Underfull \hbox (badness 10000) in paragraph at lines 347--350 /ptmr8t/<[][]http://en.wikipedia.org/wiki/Character_encoding[][]> and UTF-8 <[] []http://en.wikipedia.org/wiki/UTF-8[][]>, for [4] [5] [6] [7] Underfull \hbox (badness 10000) in paragraph at lines 675--685 []/ptmr8t/The func-tion's pa-ram-e-ters are /pcrr8t/open(filename, mode='rb', e ncoding=None, [8] [9] [10] (./modhowto-unicode.ind) (./howto-unicode.ind) [11] (./howto-unicode.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/f7b6d320.enc} Output written on howto-unicode.pdf (11 pages, 63507 bytes). Transcript written on howto-unicode.log. pdflatex 'howto-urllib2.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-urllib2.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-urllib2.idx No file howto-urllib2.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 131--131 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] [3] [4] [5] [6] Underfull \hbox (badness 10000) in paragraph at lines 526--533 /ptmr8t/When you fetch a URL you use an opener (an in-stance of the per-haps co nfusingly-named Underfull \hbox (badness 10000) in paragraph at lines 538--540 []/ptmr8t/To cre-ate an opener, in-stan-ti-ate an /pcrr8t/OpenerDirector/ptmr8t /, and then call [7] Underfull \hbox (badness 10000) in paragraph at lines 616--623 /pcrr8t/HTTPDefaultErrorHandler/ptmr8t/, /pcrr8t/HTTPRedirectHandler/ptmr8t/, / pcrr8t/FTPHandler/ptmr8t/, /pcrr8t/FileHandler/ptmr8t/, [8] No file modhowto-urllib2.ind. No file howto-urllib2.ind. [9] (./howto-urllib2.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-urllib2.pdf (9 pages, 48732 bytes). Transcript written on howto-urllib2.log. pdflatex 'howto-urllib2.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-urllib2.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-urllib2.idx (./howto-urllib2.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-urllib2.out) (./howto-urllib2.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-urllib2.toc) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [1{/usr/share/texmf/dvips/config/ pdftex.map}] Overfull \hbox (14.79999pt too wide) in paragraph at lines 131--131 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] Underfull \hbox (badness 10000) in paragraph at lines 526--533 /ptmr8t/When you fetch a URL you use an opener (an in-stance of the per-haps co nfusingly-named Underfull \hbox (badness 10000) in paragraph at lines 538--540 []/ptmr8t/To cre-ate an opener, in-stan-ti-ate an /pcrr8t/OpenerDirector/ptmr8t /, and then call [7] Underfull \hbox (badness 10000) in paragraph at lines 616--623 /pcrr8t/HTTPDefaultErrorHandler/ptmr8t/, /pcrr8t/HTTPRedirectHandler/ptmr8t/, / pcrr8t/FTPHandler/ptmr8t/, /pcrr8t/FileHandler/ptmr8t/, [8] No file modhowto-urllib2.ind. No file howto-urllib2.ind. [9] [10] (./howto-urllib2.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-urllib2.pdf (10 pages, 58018 bytes). Transcript written on howto-urllib2.log. pdflatex 'howto-urllib2.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-urllib2.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-urllib2.idx (./howto-urllib2.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-urllib2.out) (./howto-urllib2.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-urllib2.toc) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [1{/usr/share/texmf/dvips/config/ pdftex.map}] Overfull \hbox (14.79999pt too wide) in paragraph at lines 131--131 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] Underfull \hbox (badness 10000) in paragraph at lines 526--533 /ptmr8t/When you fetch a URL you use an opener (an in-stance of the per-haps co nfusingly-named Underfull \hbox (badness 10000) in paragraph at lines 538--540 []/ptmr8t/To cre-ate an opener, in-stan-ti-ate an /pcrr8t/OpenerDirector/ptmr8t /, and then call [7] Underfull \hbox (badness 10000) in paragraph at lines 616--623 /pcrr8t/HTTPDefaultErrorHandler/ptmr8t/, /pcrr8t/HTTPRedirectHandler/ptmr8t/, / pcrr8t/FTPHandler/ptmr8t/, /pcrr8t/FileHandler/ptmr8t/, [8] No file modhowto-urllib2.ind. No file howto-urllib2.ind. [9] [10] (./howto-urllib2.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-urllib2.pdf (10 pages, 58022 bytes). Transcript written on howto-urllib2.log. makeindex -s python.ist 'howto-urllib2.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-urllib2.idx....done (1 entries accepted, 0 rejected). Sorting entries...done (0 comparisons). Generating output file howto-urllib2.ind....done (8 lines written, 0 warnings). Output written in howto-urllib2.ind. Transcript written in howto-urllib2.ilg. makeindex -s python.ist 'modhowto-urllib2.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-urllib2.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-urllib2.ind. Transcript written in modhowto-urllib2.ilg. pdflatex 'howto-urllib2.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-urllib2.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-urllib2.idx (./howto-urllib2.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-urllib2.out) (./howto-urllib2.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-urllib2.toc) (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [1{/usr/share/texmf/dvips/config/ pdftex.map}] Overfull \hbox (14.79999pt too wide) in paragraph at lines 131--131 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] Underfull \hbox (badness 10000) in paragraph at lines 526--533 /ptmr8t/When you fetch a URL you use an opener (an in-stance of the per-haps co nfusingly-named Underfull \hbox (badness 10000) in paragraph at lines 538--540 []/ptmr8t/To cre-ate an opener, in-stan-ti-ate an /pcrr8t/OpenerDirector/ptmr8t /, and then call [7] Underfull \hbox (badness 10000) in paragraph at lines 616--623 /pcrr8t/HTTPDefaultErrorHandler/ptmr8t/, /pcrr8t/HTTPRedirectHandler/ptmr8t/, / pcrr8t/FTPHandler/ptmr8t/, /pcrr8t/FileHandler/ptmr8t/, [8] (./modhowto-urllib2.ind) (./howto-urllib2.ind [9] [10] [11]) (./howto-urllib2.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.ii} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-urllib2.pdf (11 pages, 59182 bytes). Transcript written on howto-urllib2.log. pdflatex 'howto-urllib2.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-urllib2.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-urllib2.idx (./howto-urllib2.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-urllib2.out) (./howto-urllib2.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-urllib2.toc) Overfull \hbox (32.29991pt too wide) in paragraph at lines 19--97 [][][]/ptmr8t/Index[][]xi [] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [1{/usr/share/texmf/dvips/config/ pdftex.map}] Overfull \hbox (14.79999pt too wide) in paragraph at lines 131--131 [] (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] Underfull \hbox (badness 10000) in paragraph at lines 526--533 /ptmr8t/When you fetch a URL you use an opener (an in-stance of the per-haps co nfusingly-named Underfull \hbox (badness 10000) in paragraph at lines 538--540 []/ptmr8t/To cre-ate an opener, in-stan-ti-ate an /pcrr8t/OpenerDirector/ptmr8t /, and then call [7] Underfull \hbox (badness 10000) in paragraph at lines 616--623 /pcrr8t/HTTPDefaultErrorHandler/ptmr8t/, /pcrr8t/HTTPRedirectHandler/ptmr8t/, / pcrr8t/FTPHandler/ptmr8t/, /pcrr8t/FileHandler/ptmr8t/, [8] (./modhowto-urllib2.ind) (./howto-urllib2.ind [9] [10] [11]) (./howto-urllib2.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.ii} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-urllib2.pdf (11 pages, 59634 bytes). Transcript written on howto-urllib2.log. pdflatex 'howto-webservers.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-webservers.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-webservers.idx No file howto-webservers.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) Overfull \hbox (14.79999pt too wide) in paragraph at lines 115--115 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] [7] [8] [9] No file modhowto-webservers.ind. No file howto-webservers.ind. [10] (./howto-webservers.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-webservers.pdf (10 pages, 55470 bytes). Transcript written on howto-webservers.log. pdflatex 'howto-webservers.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-webservers.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-webservers.idx (./howto-webservers.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-webservers.out) (./howto-webservers.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-webservers.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 115--115 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] [7] [8] [9] No file modhowto-webservers.ind. No file howto-webservers.ind. [10] (./howto-webservers.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-webservers.pdf (10 pages, 66104 bytes). Transcript written on howto-webservers.log. pdflatex 'howto-webservers.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-webservers.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-webservers.idx (./howto-webservers.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-webservers.out) (./howto-webservers.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-webservers.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 115--115 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] [7] [8] [9] No file modhowto-webservers.ind. No file howto-webservers.ind. [10] (./howto-webservers.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc} Output written on howto-webservers.pdf (10 pages, 66106 bytes). Transcript written on howto-webservers.log. makeindex -s python.ist 'howto-webservers.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file howto-webservers.idx....done (1 entries accepted, 0 rejected). Sorting entries...done (0 comparisons). Generating output file howto-webservers.ind....done (8 lines written, 0 warnings). Output written in howto-webservers.ind. Transcript written in howto-webservers.ilg. makeindex -s python.ist 'modhowto-webservers.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modhowto-webservers.idx...done (0 entries accepted, 0 rejected). Nothing written in modhowto-webservers.ind. Transcript written in modhowto-webservers.ilg. pdflatex 'howto-webservers.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-webservers.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-webservers.idx (./howto-webservers.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-webservers.out) (./howto-webservers.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-webservers.toc) Overfull \hbox (14.79999pt too wide) in paragraph at lines 115--115 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] [7] [8] [9] (./modhowto-webservers.ind) (./howto-webservers.ind [10] [11]) (./howto-webservers.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.vi} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-webservers.pdf (11 pages, 67300 bytes). Transcript written on howto-webservers.log. pdflatex 'howto-webservers.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./howto-webservers.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./howto.cls Document Class: howto 2008/10/18 Document class (Sphinx HOWTO) (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file howto-webservers.idx (./howto-webservers.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./howto-webservers.out) (./howto-webservers.out) Underfull \hbox (badness 10000) in paragraph at lines 96--96 (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) (./howto-webservers.toc) Overfull \hbox (32.29991pt too wide) in paragraph at lines 23--97 [][][]/ptmr8t/Index[][]xi [] Overfull \hbox (14.79999pt too wide) in paragraph at lines 115--115 [] [1{/usr/share/texmf/dvips/config/pdftex.map}] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [2] [3] [4] [5] [6] [7] [8] [9] (./modhowto-webservers.ind) (./howto-webservers.ind [10] [11]) (./howto-webservers.aux) ) (see the transcript file for additional information) ! pdfTeX warning (dest): name{page.vi} has been referenced but does not exist, replaced by a fixed one {/usr/share/texmf/dvips/psnfss/8r.enc} Output written on howto-webservers.pdf (11 pages, 67755 bytes). Transcript written on howto-webservers.log. pdflatex 'install.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./install.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file install.idx No file install.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] Overfull \hbox (14.79999pt too wide) in paragraph at lines 122--122 [] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] Chapter 2. [5] Overfull \hbox (6.59312pt too wide) in paragraph at lines 359--359 [] /ptmb8t/Notes| Overfull \hbox (33.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| Overfull \hbox (63.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| [6] [7] [8] Chapter 3. [9] Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-purelib| Overfull \hbox (19.75232pt too wide) in paragraph at lines 570--570 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-platlib| Overfull \hbox (8.3811pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-scripts| [10] [11] [12] Chapter 4. [13] [14] Underfull \hbox (badness 6284) in paragraph at lines 847--852 /ptmr8t/ter-nate value for the pre-fix of the Python in-stal-la-tion. For ex-am -ple, if [][]/ptmb8t/PYTHON-HOME /ptmr8t/is [15] [16] Chapter 5. [17] [18] Chapter 6. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [19] [20] [21] [22] Appendix A. [23] [24] [25] [26] [27] [28] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [29] [30] Appendix C. [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] Appendix D. No file modinstall.ind. No file install.ind. [43] (./install.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on install.pdf (47 pages, 153147 bytes). Transcript written on install.log. pdflatex 'install.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./install.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file install.idx (./install.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./install.out) (./install.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./install.toc) Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] Overfull \hbox (14.79999pt too wide) in paragraph at lines 122--122 [] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] Chapter 2. [5] Overfull \hbox (6.59312pt too wide) in paragraph at lines 359--359 [] /ptmb8t/Notes| Overfull \hbox (33.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| Overfull \hbox (63.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| [6] [7] [8] Chapter 3. [9] Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-purelib| Overfull \hbox (19.75232pt too wide) in paragraph at lines 570--570 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-platlib| Overfull \hbox (8.3811pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-scripts| [10] [11] [12] Chapter 4. [13] [14] Underfull \hbox (badness 6284) in paragraph at lines 847--852 /ptmr8t/ter-nate value for the pre-fix of the Python in-stal-la-tion. For ex-am -ple, if [][]/ptmb8t/PYTHON-HOME /ptmr8t/is [15] [16] Chapter 5. [17] [18] Chapter 6. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [19] [20] [21] [22] Appendix A. [23] [24] [25] [26] [27] [28] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [29] [30] Appendix C. [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] Appendix D. No file modinstall.ind. No file install.ind. [43] (./install.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on install.pdf (47 pages, 167698 bytes). Transcript written on install.log. pdflatex 'install.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./install.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file install.idx (./install.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./install.out) (./install.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./install.toc) Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] Overfull \hbox (14.79999pt too wide) in paragraph at lines 122--122 [] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] Chapter 2. [5] Overfull \hbox (6.59312pt too wide) in paragraph at lines 359--359 [] /ptmb8t/Notes| Overfull \hbox (33.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| Overfull \hbox (63.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| [6] [7] [8] Chapter 3. [9] Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-purelib| Overfull \hbox (19.75232pt too wide) in paragraph at lines 570--570 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-platlib| Overfull \hbox (8.3811pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-scripts| [10] [11] [12] Chapter 4. [13] [14] Underfull \hbox (badness 6284) in paragraph at lines 847--852 /ptmr8t/ter-nate value for the pre-fix of the Python in-stal-la-tion. For ex-am -ple, if [][]/ptmb8t/PYTHON-HOME /ptmr8t/is [15] [16] Chapter 5. [17] [18] Chapter 6. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [19] [20] [21] [22] Appendix A. [23] [24] [25] [26] [27] [28] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [29] [30] Appendix C. [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] Appendix D. No file modinstall.ind. No file install.ind. [43] (./install.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on install.pdf (47 pages, 167698 bytes). Transcript written on install.log. makeindex -s python.ist 'install.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file install.idx....done (82 entries accepted, 0 rejected). Sorting entries....done (546 comparisons). Generating output file install.ind....done (141 lines written, 0 warnings). Output written in install.ind. Transcript written in install.ilg. makeindex -s python.ist 'modinstall.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modinstall.idx...done (0 entries accepted, 0 rejected). Nothing written in modinstall.ind. Transcript written in modinstall.ilg. pdflatex 'install.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./install.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file install.idx (./install.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./install.out) (./install.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./install.toc) Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] Overfull \hbox (14.79999pt too wide) in paragraph at lines 122--122 [] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] Chapter 2. [5] Overfull \hbox (6.59312pt too wide) in paragraph at lines 359--359 [] /ptmb8t/Notes| Overfull \hbox (33.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| Overfull \hbox (63.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| [6] [7] [8] Chapter 3. [9] Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-purelib| Overfull \hbox (19.75232pt too wide) in paragraph at lines 570--570 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-platlib| Overfull \hbox (8.3811pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-scripts| [10] [11] [12] Chapter 4. [13] [14] Underfull \hbox (badness 6284) in paragraph at lines 847--852 /ptmr8t/ter-nate value for the pre-fix of the Python in-stal-la-tion. For ex-am -ple, if [][]/ptmb8t/PYTHON-HOME /ptmr8t/is [15] [16] Chapter 5. [17] [18] Chapter 6. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [19] [20] [21] [22] Appendix A. [23] [24] [25] [26] [27] [28] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [29] [30] Appendix C. [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] Appendix D. (./modinstall.ind) (./install.ind [43] [44] [45] [46]) (./install.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on install.pdf (50 pages, 186748 bytes). Transcript written on install.log. pdflatex 'install.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./install.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file install.idx (./install.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./install.out) (./install.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./install.toc) Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] Overfull \hbox (14.79999pt too wide) in paragraph at lines 122--122 [] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.125 \hypertarget{inst-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] Chapter 2. [5] Overfull \hbox (6.59312pt too wide) in paragraph at lines 359--359 [] /ptmb8t/Notes| Overfull \hbox (33.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| Overfull \hbox (63.80585pt too wide) in paragraph at lines 359--359 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (62.1698pt too wide) in paragraph at lines 359--359 []/pcrr8t//usr/local/lib/pythonX.Y/site-packages| [6] [7] [8] Chapter 3. [9] Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-purelib| Overfull \hbox (19.75232pt too wide) in paragraph at lines 570--570 []/pcrr8t/exec-prefix/lib/pythonX.Y/site-packages| Overfull \hbox (8.63109pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-platlib| Overfull \hbox (8.3811pt too wide) in paragraph at lines 570--570 []/pcrro8t/--install-scripts| [10] [11] [12] Chapter 4. [13] [14] Underfull \hbox (badness 6284) in paragraph at lines 847--852 /ptmr8t/ter-nate value for the pre-fix of the Python in-stal-la-tion. For ex-am -ple, if [][]/ptmb8t/PYTHON-HOME /ptmr8t/is [15] [16] Chapter 5. [17] [18] Chapter 6. (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [19] [20] [21] [22] Appendix A. [23] [24] [25] [26] [27] [28] Appendix B. (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [29] [30] Appendix C. [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] Appendix D. (./modinstall.ind) (./install.ind [43] [44] [45] [46]) (./install.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc} Output written on install.pdf (50 pages, 187194 bytes). Transcript written on install.log. pdflatex 'library.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./library.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file library.idx No file library.aux. (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texmf/dvips/config/p dftex.map}] [2] Adding blank page after the table of contents. ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.96 \tableofcontents [2] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [2] Chapter 1. (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) [3] [4] Chapter 2. [5] [6] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) [7] [8] [9] Underfull \hbox (badness 10000) in paragraph at lines 658--659 [10] Underfull \hbox (badness 10000) in paragraph at lines 746--747 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 3. [21] [22] Chapter 4. [23] [24] Chapter 5. [25] [26] Chapter 6. [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] Overfull \hbox (8.3441pt too wide) in paragraph at lines 3183--3183 [] /ptmb8t/Notes| [38] Overfull \hbox (7.72594pt too wide) in paragraph at lines 3375--3375 []/ptmr8t/(7)(8)(9)(10)| [39] [40] Underfull \hbox (badness 10000) in paragraph at lines 3558--3564 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and [41] Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 []/ptmr8t/Note, the non-operator ver-sions of the /pcrr8t/update()/ptmr8t/, /pc rr8t/intersection_update()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 /pcrr8t/difference_update()/ptmr8t/, and /pcrr8t/symmetric_difference_update() /ptmr8t/meth-ods will ac-cept [42] [43] [44] [45] [46] Underfull \hbox (badness 6944) in paragraph at lines 4192--4198 []/ptmr8t/An ex-am-ple of a con-text man-ager that re-turns a re-lated ob-ject is the one re-turned by [47] [48] [49] [50] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 4492--4495 /ptmr8t/The base class for all built-in ex-cep-tions ex-cept /pcrr8t/StopIterat ion/ptmr8t/, /pcrr8t/GeneratorExit/ptmr8t/, [51] [52] [53] [54] [55] [56] Chapter 8. [57] [58] Overfull \hbox (166.23189pt too wide) in paragraph at lines 5141--5148 [][] Underfull \hbox (badness 10000) in paragraph at lines 5141--5148 [59] Overfull \hbox (172.23183pt too wide) in paragraph at lines 5252--5260 [][] Underfull \hbox (badness 10000) in paragraph at lines 5252--5260 [60] Overfull \hbox (49.99875pt too wide) in paragraph at lines 5306--5307 [][] Overfull \hbox (50.00552pt too wide) in paragraph at lines 5345--5346 [][] Overfull \hbox (2.46297pt too wide) in paragraph at lines 5426--5426 [] /ptmb8t/Type| Overfull \hbox (1.29306pt too wide) in paragraph at lines 5426--5426 []/ptmr8t/None| Overfull \hbox (49.99658pt too wide) in paragraph at lines 5426--5427 [][] Overfull \hbox (6.8293pt too wide) in paragraph at lines 5499--5499 [] /ptmb8t/Type| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'e'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'E'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'f'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'F'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'g'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'G'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'n'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'%'| Overfull \hbox (5.6594pt too wide) in paragraph at lines 5499--5499 []/ptmr8t/None| Overfull \hbox (50.00784pt too wide) in paragraph at lines 5499--5500 [][] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 []/ptmb8t/Note: /ptmr8t/The fol-low-ing ap-plies only to reg-u-lar ex-pres-sio n ob-jects like those cre-ated with Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 /pcrr8t/re.compile("pattern")/ptmr8t/, not the prim-i-tives /pcrr8t/re.match(pa ttern, string) /ptmr8t/or [78] [79] [80] [81] [82] Underfull \hbox (badness 10000) in paragraph at lines 7604--7606 /ptmr8t/Identical to the /pcrr8t/unpack_from() /ptmr8t/func-tion, us-ing the co m-piled for-mat. [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] Underfull \hbox (badness 10000) in paragraph at lines 8915--8918 []/ptmr8t/Decoding and trans-lat-ing works sim-i-lar, ex-cept /pcrr8t/UnicodeDe codeError /ptmr8t/or [97] [98] Overfull \hbox (52.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'xmlcharrefreplace'| Overfull \hbox (46.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'backslashreplace'| [99] [100] [101] [102] [103] Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jis_2004| Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jisx0213| Overfull \hbox (2.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_1| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2| Overfull \hbox (27.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2004| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_3| Overfull \hbox (19.87584pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_ext| Overfull \hbox (3.35597pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_kr| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_10| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_13| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_14| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_15| Overfull \hbox (8.19551pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_cyrillic| Overfull \hbox (2.22585pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_greek| Overfull \hbox (8.89561pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_iceland| Overfull \hbox (2.79562pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_latin2| Overfull \hbox (5.5658pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_roman| Overfull \hbox (7.79564pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_turkish| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jis_2004| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jisx0213| [104] Overfull \vbox (459.69313pt too high) has occurred while \output is active [105] Overfull \hbox (11.3528pt too wide) in paragraph at lines 10484--10484 [] /ptmb8t/Operand Overfull \hbox (18.4786pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/base64_codec| Overfull \hbox (5.14877pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/bz2_codec| Overfull \hbox (4.99887pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/hex_codec| Overfull \hbox (1.81868pt too wide) in paragraph at lines 10484--10484 /ptmr8t/pri_codec| Overfull \hbox (45.5384pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/raw_unicode_escape| Overfull \hbox (16.8183pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/string_escape| Overfull \hbox (12.91855pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_escape| Overfull \hbox (16.8184pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_internal| Overfull \hbox (0.70883pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/uu_codec| Overfull \hbox (5.70856pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/zlib_codec| (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [106] [107] [108] [109] [110] Chapter 9. [111] [112] Underfull \hbox (badness 10000) in paragraph at lines 11110--11112 /ptmr8t/The most pos-i-tive /pcrr8t/timedelta /ptmr8t/ob-ject, /pcrr8t/timedelt a(days=999999999, hours=23, Underfull \hbox (badness 10000) in paragraph at lines 11116--11118 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/timede lta /ptmr8t/ob-jects, [113] [114] Overfull \hbox (20.67915pt too wide) in paragraph at lines 11394--11395 [][] Underfull \hbox (badness 7362) in paragraph at lines 11400--11405 /pcrr8t/< 0/ptmr8t/. Af-ter-ward /pcrr8t/date2 - date1 == timedelta.days/ptmr8t /. /pcrr8t/timedelta.seconds /ptmr8t/and Underfull \hbox (badness 10000) in paragraph at lines 11443--11447 /pcrr8t/d.month, d.day, 0, 0, 0, d.weekday(), d.toordinal() - date(d.year, 1, [115] Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /ptmr8t/Return a string rep-re-sent-ing the date, for ex-am-ple /pcrr8t/date(20 02, 12, Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /pcrr8t/4).ctime() == 'Wed Dec 4 00:00:00 2002'/ptmr8t/. /pcrr8t/d.ctime() /ptm r8t/is equiv-a-lent to [116] Underfull \hbox (badness 10000) in paragraph at lines 11615--11618 /ptmr8t/Return the cur-rent lo-cal date-time, with /pcrr8t/tzinfo None/ptmr8t/. This is equiv-a-lent to [117] Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the cur-rent date Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 /ptmr8t/and time are con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this cas e the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the times- Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 /ptmr8t/tamp is con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this case the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11713--11715 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/dateti me /ptmr8t/ob-jects, [118] Underfull \hbox (badness 5652) in paragraph at lines 11796--11802 []/ptmr8t/datetime2 is a du-ra-tion of timedelta re-moved from date-time1, mov- ing for-ward in time if [119] Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /ptmr8t/equiv-a-lent to /pcrr8t/time.struct_time((d.year, d.month, d.day, d.hou r, d.minute, Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /pcrr8t/d.second, d.weekday(), d.toordinal() - date(d.year, 1, 1).toordinal() + [120] Underfull \hbox (badness 6592) in paragraph at lines 11961--11967 []/ptmr8t/If /ptmri8t/d /ptmr8t/is aware, /ptmri8t/d /ptmr8t/is nor-mal-ized to UTC time, by sub-tract-ing /pcrr8t/d.utcoffset()/ptmr8t/, and a Underfull \hbox (badness 10000) in paragraph at lines 11990--11992 /ptmr8t/Return a 3-tuple, (ISO year, ISO week num-ber, ISO week-day). The same as Underfull \hbox (badness 10000) in paragraph at lines 11996--11999 /ptmr8t/Return a string rep-re-sent-ing the date and time in ISO 8601 for-mat, YYYY-MM- Underfull \hbox (badness 7238) in paragraph at lines 12026--12031 /ptmr8t/Return a string rep-re-sent-ing the date and time, for ex-am-ple /pcrr8 t/datetime(2002, 12, 4, [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] Overfull \hbox (11.12794pt too wide) in paragraph at lines 12942--12942 [] /ptmb8t/Notes| [131] [132] [133] [134] Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Container| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Hashable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterator| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Callable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Sequence| Overfull \hbox (55.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSequence| Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSet| Overfull \hbox (7.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Mapping| Overfull \hbox (49.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableMapping| Overfull \hbox (31.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/KeysView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ItemsView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ValuesView| Overfull \hbox (11.87897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] Underfull \hbox (badness 10000) in paragraph at lines 14902--14916 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and Overfull \hbox (44.79945pt too wide) in paragraph at lines 15021--15021 []/pcrr8t/s.symmetric_difference_update(t)| [151] [152] [153] [154] [155] Underfull \hbox (badness 5637) in paragraph at lines 15375--15378 []/ptmr8t/The low-est val-ued en-tries are re-trieved first (the low-est val-ue d en-try is the one re-turned [156] [157] [158] [159] [160] Underfull \hbox (badness 7308) in paragraph at lines 15883--15885 []/ptmr8t/In ad-di-tion to the four base meth-ods, pro-gres-sively more ef-fi-c iency comes with defin-ing [161] [162] [163] [164] Underfull \hbox (badness 10000) in paragraph at lines 16238--16244 /ptmr8t/The type of ob-jects de-fined in ex-ten-sion mod-ules with /pcrr8t/PyMe mberDef/ptmr8t/, such as [165] [166] [167] [168] [169] [170] Chapter 10. [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205] [206] [207] [208] [209] [210] [211] [212] [213] [214] [215] [216] [217] [218] [219] [220] [221] [222] [223] [224] Chapter 11. [225] [226] [227] [228] Underfull \hbox (badness 10000) in paragraph at lines 22021--22022 Overfull \hbox (64.2315pt too wide) in paragraph at lines 22040--22042 []/ptmr8t/Usage ex-am-ple: /pcrr8t/fi = fileinput.FileInput(openhook=fileinput. hook_encoded("iso-8859-1")) [229] [230] [231] [232] [233] Underfull \hbox (badness 10000) in paragraph at lines 22481--22481 []/ptmri8t/[mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [dir=None, Underfull \hbox (badness 10000) in paragraph at lines 22497--22497 []/ptmri8t/[max_size=0, [mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [234] [235] [236] [237] [238] [239] [240] [241] [242] Chapter 12. [243] Underfull \hbox (badness 10000) in paragraph at lines 23276--23277 [244] [245] [246] [247] [248] [249] [250] [251] [252] [253] Underfull \hbox (badness 10000) in paragraph at lines 24198--24205 /ptmr8t/A sub-class of /pcrr8t/Shelf /ptmr8t/which ex-poses /pcrr8t/first()/ptm r8t/, /pcrr8t/next()/ptmr8t/, /pcrr8t/previous()/ptmr8t/, /pcrr8t/last() /ptmr8 t/and [254] [255] Underfull \hbox (badness 10000) in paragraph at lines 24322--24323 Underfull \hbox (badness 10000) in paragraph at lines 24342--24343 [256] [257] [258] Overfull \hbox (17.53752pt too wide) in paragraph at lines 24736--24737 [][] [259] [260] [261] [262] [263] [264] [265] [266] [267] [268] [269] [270] [271] [272] [273] [274] [275] Underfull \hbox (badness 10000) in paragraph at lines 26265--26269 []/ptmr8t/The /pcrr8t/sqlite3 /ptmr8t/mod-ule has two de-fault adapters for Pyt hon's built-in /pcrr8t/datetime.date /ptmr8t/and [276] [277] [278] Underfull \hbox (badness 5288) in paragraph at lines 26449--26456 /ptmr8t/Using the non-stan-dard /pcrr8t/execute()/ptmr8t/, /pcrr8t/executemany( ) /ptmr8t/and /pcrr8t/executescript() /ptmr8t/meth-ods of the [279] [280] Chapter 13. [281] [282] [283] [284] Underfull \hbox (badness 10000) in paragraph at lines 27001--27004 /ptmr8t/Sequential com-pres-sion and de-com-pres-sion is done us-ing the classe s /pcrr8t/BZ2Compressor /ptmr8t/and [285] [286] [287] [288] [289] [290] [291] Underfull \hbox (badness 10000) in paragraph at lines 27745--27747 /ptmr8t/Is raised for /ptmri8t/non-fatal /ptmr8t/er-rors when us-ing /pcrr8t/Ta rFile.extract()/ptmr8t/, but only if [292] [293] Underfull \hbox (badness 10000) in paragraph at lines 28009--28012 []/pcrr8t/TarInfo /ptmr8t/ob-jects are re-turned by /pcrr8t/TarFile/ptmr8t/`s m eth-ods /pcrr8t/getmember()/ptmr8t/, /pcrr8t/getmembers() /ptmr8t/and [294] [295] [296] Underfull \hbox (badness 10000) in paragraph at lines 28265--28274 []/ptmr8t/The de-fault value for /ptmri8t/en-cod-ing /ptmr8t/is the lo-cal char -ac-ter en-cod-ing. It is de-duced from [297] [298] Chapter 14. [299] [300] Underfull \hbox (badness 10000) in paragraph at lines 28460--28460 []/ptmri8t/csvfile, field-names, [rest-val='', [ex-trasac-tion='raise', [di-ale ct='excel', [*args, [301] [302] [303] [304] [305] Underfull \hbox (badness 10000) in paragraph at lines 28879--28880 [306] Underfull \hbox (badness 6526) in paragraph at lines 28976--28978 /ptmr8t/Exception raised when an op-tion ref-er-enced from a value does not ex- ist. Sub-class of [307] [308] [309] [310] [311] [312] [313] [314] Overfull \hbox (15.7865pt too wide) in paragraph at lines 29730--29731 [] [315] [316] Chapter 15. Underfull \hbox (badness 10000) in paragraph at lines 29863--29864 [317] [318] [319] [320] Chapter 16. [321] [322] [323] Underfull \hbox (badness 10000) in paragraph at lines 30607--30612 /ptmr8t/Execute /ptmri8t/cmd /ptmr8t/as a sub-process and re-turn the file ob-j ects /pcrr8t/(child_stdin, [324] [325] Underfull \hbox (badness 10000) in paragraph at lines 30725--30729 []/ptmr8t/If you're start-ing with a Python file ob-ject /ptmri8t/f/ptmr8t/, fi rst do /pcrr8t/f.flush()/ptmr8t/, and then do [326] [327] [328] [329] [330] [331] Underfull \hbox (badness 10000) in paragraph at lines 31411--31412 Underfull \hbox (badness 10000) in paragraph at lines 31427--31428 [332] [333] [334] [335] [336] [337] [338] [339] [340] Underfull \hbox (badness 5741) in paragraph at lines 32229--32235 []/pcrr8t/BufferedIOBase /ptmr8t/deals with buffer-ing on a raw byte stream (/p crr8t/RawIOBase/ptmr8t/). Its sub-classes, [341] [342] [343] [344] [345] [346] Underfull \hbox (badness 10000) in paragraph at lines 32946--32948 /ptmr8t/A helper codec that de-codes new-lines for uni-ver-sal new-lines mode. It in-her-its [347] [348] Overfull \hbox (11.12794pt too wide) in paragraph at lines 33384--33384 [] /ptmb8t/Notes| Overfull \hbox (25.01363pt too wide) in paragraph at lines 33384--33385 [][] [349] [350] [351] [352] [353] Underfull \hbox (badness 10000) in paragraph at lines 33777--33781 []/pcrr8t/"-v" /ptmr8t/and /pcrr8t/"--report" /ptmr8t/are both op-tions. As-sum -ing that /pcrro8t/--report /ptmr8t/takes one ar-gu-ment, [354] [355] [356] [357] Underfull \hbox (badness 5652) in paragraph at lines 34102--34105 []/ptmr8t/If /pcrr8t/optparse /ptmr8t/en-coun-ters ei-ther /pcrr8t/"-h" /ptmr8t /or /pcrr8t/"--help" /ptmr8t/on the command-line, or if you just call [358] [359] [360] [361] Underfull \hbox (badness 5203) in paragraph at lines 34386--34389 /ptmr8t/There are sev-eral ways to pop-u-late the parser with op-tions. The pre -ferred way is by us-ing [362] [363] [364] [365] [366] [367] Underfull \hbox (badness 10000) in paragraph at lines 34976--34977 []/ptmr8t/assume op-tion con-flicts are a pro-gram-ming er-ror and raise [368] [369] [370] [371] [372] [373] Underfull \hbox (badness 10000) in paragraph at lines 35426--35431 []/ptmr8t/Your type-checking func-tion should raise /pcrr8t/OptionValueError /p tmr8t/if it en-coun-ters any prob-lems. [374] [375] [376] [377] [378] [379] [380] Underfull \hbox (badness 10000) in paragraph at lines 35997--36006 []/pcrr8t/Logger.debug()/ptmr8t/, /pcrr8t/Logger.info()/ptmr8t/, /pcrr8t/Logger .warning()/ptmr8t/, /pcrr8t/Logger.error()/ptmr8t/, and [381] [382] [383] [384] Underfull \hbox (badness 5403) in paragraph at lines 36345--36348 []/pcrr8t/BaseRotatingHandler /ptmr8t/is the base class for han-dlers that ro-t ate log files at a cer-tain [385] [386] Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filename| Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filemode| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/format| Overfull \hbox (10.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/datefmt| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/stream| Overfull \hbox (25.01265pt too wide) in paragraph at lines 36623--36624 [][] [387] [388] [389] [390] Overfull \hbox (3.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(name)s| Overfull \hbox (33.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(levelname)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(asctime)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(message)s| [391] [392] [393] [394] [395] [396] [397] [398] Underfull \hbox (badness 6001) in paragraph at lines 37574--37574 []/ptmri8t/filename, [when, [in-ter-val, [back-up-Count, [en-cod-ing, [de-lay, [399] Underfull \hbox (badness 5245) in paragraph at lines 37722--37724 /ptmr8t/The fac-tory method of /pcrr8t/SocketHandler /ptmr8t/is here over-rid-d en to cre-ate a UDP socket [400] [401] [402] Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelno)s| Overfull \hbox (16.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(pathname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(filename)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(funcName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(created)f| Overfull \hbox (52.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(relativeCreated)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(asctime)s| Overfull \hbox (22.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(threadName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(process)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(message)s| Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/Formats the spec-i-fied ex-cep-tion in-for-ma-tion (a stan-dard ex-cep- tion tu-ple as re- Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/turned by /pcrr8t/sys.exc_info()/ptmr8t/) as a string. This de-fault im -ple-men-ta-tion just uses [403] [404] [405] [406] [407] [408] [409] [410] [411] [412] [413] [414] [415] [416] Underfull \hbox (badness 10000) in paragraph at lines 39269--39270 [417] [418] [419] [420] [421] [422] Overfull \vbox (435.69313pt too high) has occurred while \output is active [423] [424] [425] [426] [427] [428] [429] [430] [431] [432] [433] [434] [435] [436] [437] [438] [439] [440] Overfull \hbox (28.77098pt too wide) in paragraph at lines 42666--42667 [][] [441] [442] [443] [444] [445] [446] [447] [448] [449] [450] [451] [452] [453] [454] [455] [456] [457] [458] [459] [460] [461] [462] Underfull \hbox (badness 7221) in paragraph at lines 44332--44335 []/ptmr8t/The ex-act func-tion-al-ity is sys-tem de-pen-dent. Changed in ver-si on 2.6: Win-dows only: [463] [464] [465] [466] [467] [468] [469] [470] Chapter 17. [471] Overfull \hbox (14.31891pt too wide) in paragraph at lines 45106--45107 [][] [472] [473] [474] [475] [476] [477] [478] [479] [480] [481] [482] [483] [484] Underfull \hbox (badness 10000) in paragraph at lines 46585--46586 [485] [486] [487] Underfull \hbox (badness 10000) in paragraph at lines 46788--46791 []/ptmr8t/For more flex-i-bil-ity in us-ing shared mem-ory one can use the [488] [489] [490] Underfull \hbox (badness 10000) in paragraph at lines 47072--47073 Underfull \hbox (badness 10000) in paragraph at lines 47086--47087 [491] [492] [493] Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 []/ptmb8t/Note: /pcrr8t/multiprocessing /ptmr8t/con-tains no ana-logues of /pc rr8t/threading.active_count()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 /pcrr8t/threading.enumerate()/ptmr8t/, /pcrr8t/threading.settrace()/ptmr8t/, /p crr8t/threading.setprofile()/ptmr8t/, [494] Underfull \hbox (badness 10000) in paragraph at lines 47418--47419 Underfull \hbox (badness 10000) in paragraph at lines 47424--47425 [495] Underfull \hbox (badness 5417) in paragraph at lines 47485--47491 []/ptmb8t/Note: /ptmr8t/If the SIG-INT sig-nal gen-er-ated by Ctrl-C ar-rives while the main thread is blocked Underfull \hbox (badness 10000) in paragraph at lines 47485--47491 /ptmr8t/by a call to /pcrr8t/BoundedSemaphore.acquire()/ptmr8t/, /pcrr8t/Lock.a cquire()/ptmr8t/, /pcrr8t/RLock.acquire()/ptmr8t/, [496] [497] [498] [499] [500] [501] [502] [503] [504] [505] [506] Underfull \hbox (badness 8113) in paragraph at lines 48556--48563 []/ptmr8t/If au-then-ti-ca-tion is re-quested but do au-then-ti-ca-tion key is spec-i-fied then the re-turn value of [507] [508] [509] [510] [511] [512] [513] [514] [515] [516] [517] [518] [519] [520] [521] [522] [523] [524] [525] [526] [527] [528] [529] [530] [531] [532] [533] [534] [535] [536] [537] [538] [539] [540] [541] [542] Chapter 18. Underfull \hbox (badness 10000) in paragraph at lines 50912--50912 /ptmri8t/close_fds=False, shell=False, cwd=None, env=None, uni-ver-sal_newlines =False, star- [543] [544] [545] Underfull \hbox (badness 10000) in paragraph at lines 51134--51139 []/ptmb8t/Warning: /ptmr8t/Use /pcrr8t/communicate() /ptmr8t/rather than /pcrr 8t/stdin.write()/ptmr8t/, /pcrr8t/stdout.read() /ptmr8t/or [546] [547] [548] [549] [550] Underfull \hbox (badness 10000) in paragraph at lines 51621--51625 []/ptmr8t/If you want to know the cur-rent ma-chine's IP ad-dress, you may want to use [551] [552] [553] [554] [555] [556] [557] [558] Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 []/ptmri8t/sock, key-file=None, cert-file=None, server_side=False, cert_reqs=CE RT_NONE, Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 /ptmri8t/ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True, s up- [559] [560] [561] [562] [563] [564] Overfull \hbox (9.78795pt too wide) in paragraph at lines 52919--52920 [] [565] [566] Underfull \hbox (badness 6047) in paragraph at lines 53085--53090 /ptmr8t/Sets given in-ter-val timer (one of /pcrr8t/signal.ITIMER_REAL/ptmr8t/, /pcrr8t/signal.ITIMER_VIRTUAL /ptmr8t/or [567] [568] [569] [570] [571] [572] [573] [574] Overfull \hbox (13.83913pt too wide) in paragraph at lines 53859--53860 [][] [575] [576] Chapter 19. [577] [578] [579] [580] [581] [582] [583] [584] Underfull \hbox (badness 10000) in paragraph at lines 54859--54863 []/ptmr8t/As a con-ve-nience, see the meth-ods /pcrr8t/Message.as_string() /ptm r8t/and /pcrr8t/str(aMessage)/ptmr8t/, a.k.a. [585] [586] [587] [588] [589] [590] [591] [592] [593] [594] Underfull \hbox (badness 10000) in paragraph at lines 55801--55807 /ptmr8t/Changed in ver-sion 2.4: The /pcrr8t/dump_address_pair() /ptmr8t/func-t ion has been re-moved; use [595] [596] [597] [598] [599] [600] Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 []/ptmr8t/Methods that were dep-re-cated in ver-sion 3 have been re-moved. Thes e in-clude Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 /pcrr8t/Generator.__call__()/ptmr8t/, /pcrr8t/Message.get_type()/ptmr8t/, /pcrr 8t/Message.get_main_type()/ptmr8t/, [601] Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 []/ptmr8t/New /pcrr8t/DeprecationWarning/ptmr8t/s have been added to: /pcrr8t/G enerator.__call__()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 /pcrr8t/Message.get_type()/ptmr8t/, /pcrr8t/Message.get_main_type()/ptmr8t/, /p crr8t/Message.get_subtype()/ptmr8t/, and [602] Underfull \hbox (badness 10000) in paragraph at lines 56391--56395 []/ptmr8t/The fol-low-ing func-tions in the /pcrr8t/email.Utils /ptmr8t/mod-ule have been dep-re-cated: [603] [604] [605] [606] [607] [608] [609] Underfull \hbox (badness 10000) in paragraph at lines 57160--57161 [610] [611] [612] Underfull \hbox (badness 10000) in paragraph at lines 57424--57427 /ptmr8t/Return a /pcrr8t/Maildir /ptmr8t/in-stance rep-re-sent-ing the folder w hose name is /ptmri8t/folder/ptmr8t/. A [613] [614] [615] [616] [617] [618] [619] [620] [621] [622] [623] [624] [625] [626] [627] [628] [629] [630] [631] [632] [633] [634] [635] [636] Underfull \hbox (badness 10000) in paragraph at lines 60389--60393 /ptmr8t/Return a pair /pcrr8t/(full name, email address) /ptmr8t/parsed from th e string re-turned by [637] [638] [639] Overfull \hbox (207.12541pt too wide) in paragraph at lines 60684--60686 [] Underfull \hbox (badness 10000) in paragraph at lines 60705--60706 [640] [641] [642] [643] [644] Chapter 20. [645] [646] [647] [648] Underfull \hbox (badness 10000) in paragraph at lines 61446--61450 /ptmr8t/This method is called to pro-cess un-re-solv-able nu-meric char-ac-ter ref-er-ences. Re-fer to [649] [650] [651] [652] Underfull \hbox (badness 10000) in paragraph at lines 61825--61831 /ptmr8t/Calling this with a true value for /ptmri8t/flag /ptmr8t/(the de-fault) will cause Ex-pat to call the [653] [654] [655] [656] [657] [658] [659] Overfull \hbox (0.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/DOMImplementation| Overfull \hbox (24.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/ProcessingInstruction| [660] Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /ptmr8t/ob-ject: /pcrr8t/ELEMENT_NODE/ptmr8t/, /pcrr8t/ATTRIBUTE_NODE/ptmr8t/, /pcrr8t/TEXT_NODE/ptmr8t/, /pcrr8t/CDATA_SECTION_NODE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /pcrr8t/ENTITY_NODE/ptmr8t/, /pcrr8t/PROCESSING_INSTRUCTION_NODE/ptmr8t/, /pcrr 8t/COMMENT_NODE/ptmr8t/, /pcrr8t/DOCUMENT_NODE/ptmr8t/, [661] [662] [663] [664] [665] [666] Underfull \hbox (badness 10000) in paragraph at lines 63343--63346 /ptmr8t/Exception when a node does not ex-ist in the ref-er-enced con-text. For ex-am-ple, [667] [668] [669] [670] [671] Underfull \hbox (badness 10000) in paragraph at lines 63849--63851 []/pcrr8t/const /ptmr8t/dec-la-ra-tions map to vari-ables in their re-spec-tive scope (e.g. [672] [673] [674] Underfull \hbox (badness 10000) in paragraph at lines 64201--64205 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/lexical-handler" /ptmr8t/ --- data type: Underfull \hbox (badness 10000) in paragraph at lines 64209--64213 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/declaration-handler" /ptm r8t/--- data type: [675] [676] [677] [678] [679] [680] Underfull \hbox (badness 10000) in paragraph at lines 64715--64718 /ptmr8t/Return the cur-rent set-ting for fea-ture /ptmri8t/fea-ture-name/ptmr8t /. If the fea-ture is not rec-og-nized, [681] [682] [683] [684] [685] [686] [687] [688] Chapter 21. [689] [690] [691] [692] [693] [694] [695] [696] [697] [698] [699] Underfull \hbox (badness 7832) in paragraph at lines 66510--66518 []/pcrr8t/Headers /ptmr8t/ob-jects sup-port typ-i-cal map-ping op-er-a-tions in -clud-ing /pcrr8t/__getitem__()/ptmr8t/, /pcrr8t/get()/ptmr8t/, [700] [701] [702] [703] [704] [705] [706] [707] [708] Underfull \hbox (badness 10000) in paragraph at lines 67392--67396 []/ptmr8t/When per-form-ing ba-sic au-then-ti-ca-tion, a /pcrr8t/FancyURLopener /ptmr8t/in-stance calls its [709] [710] [711] Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/An HTTP sta-tus code as de-fined in [][]RFC 2616[][]. This nu-meric val ue Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/cor-re-sponds to a value found in the dic-tio-nary of codes as found in [712] [713] [714] [715] [716] [717] [718] [719] [720] [721] Overfull \hbox (21.13048pt too wide) in paragraph at lines 68986--68987 [][] [722] [723] [724] [725] [726] [727] [728] [729] [730] [731] [732] [733] [734] [735] [736] [737] [738] [739] [740] [741] [742] [743] [744] [745] [746] [747] [748] Underfull \hbox (badness 10000) in paragraph at lines 71611--71615 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type Underfull \hbox (badness 10000) in paragraph at lines 71632--71635 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type [749] [750] [751] [752] [753] [754] [755] [756] [757] [758] [759] [760] Underfull \hbox (badness 10000) in paragraph at lines 72724--72727 []/ptmr8t/A lot of the work, such as pars-ing the re-quest, is done by the base class [761] Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 []/ptmr8t/The /pcrr8t/CGIHTTPServer /ptmr8t/mod-ule de-fines a request-handler class, in-ter-face com-pat-i- Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 /ptmr8t/ble with /pcrr8t/BaseHTTPServer.BaseHTTPRequestHandler /ptmr8t/and in-h er-its be-hav-ior from [762] Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 []/ptmri8t/blocked_domains=None, al-lowed_domains=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/netscape=True, rfc2965=False, rfc2109_as_netscape=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/hide_cookie2=False, strict_domain=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_ns_domain=DefaultCookiePolicy.DomainLiberal, [763] Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /ptmr8t/meth-ods /pcrr8t/get_full_url()/ptmr8t/, /pcrr8t/get_host()/ptmr8t/, /p crr8t/get_type()/ptmr8t/, /pcrr8t/unverifiable()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /pcrr8t/get_origin_req_host()/ptmr8t/, /pcrr8t/has_header()/ptmr8t/, /pcrr8t/ge t_header()/ptmr8t/, /pcrr8t/header_items()/ptmr8t/, and Underfull \hbox (badness 10000) in paragraph at lines 73056--73061 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the meth-ods [764] [765] Underfull \hbox (badness 10000) in paragraph at lines 73206--73207 [766] [767] [768] [769] [770] [771] [772] [773] Overfull \hbox (14.07869pt too wide) in paragraph at lines 74055--74055 []/pcrr8t/floating-point Overfull \hbox (24.99854pt too wide) in paragraph at lines 74055--74056 [][] [774] [775] [776] [777] [778] [779] [780] [781] [782] Underfull \hbox (badness 10000) in paragraph at lines 74788--74788 []/ptmri8t/addr, [re-questHandler, [lo-gRe-quests, [al-low_none, [en-cod-ing, Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /ptmr8t/Create a new server in-stance. All pa-ram-e-ters have the same mean-ing as for Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /pcrr8t/SimpleXMLRPCServer.SimpleXMLRPCServer/ptmr8t/; /ptmri8t/re-questHandler /ptmr8t/de-faults to [783] Overfull \hbox (57.12117pt too wide) in paragraph at lines 74838--74845 /ptmr8t/The /pcrr8t/DocCGIXMLRPCRequestHandler /ptmr8t/class is de-rived from / pcrr8t/SimpleXMLRPCServer.CGIXMLRPCRequestHandler [784] Chapter 22. [785] [786] [787] [788] Underfull \hbox (badness 10000) in paragraph at lines 75257--75258 [789] [790] [791] Underfull \hbox (badness 10000) in paragraph at lines 75632--75634 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, [792] Underfull \hbox (badness 10000) in paragraph at lines 75710--75713 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [793] Underfull \hbox (badness 10000) in paragraph at lines 75829--75831 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, Underfull \hbox (badness 10000) in paragraph at lines 75909--75912 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [794] [795] Underfull \hbox (badness 5475) in paragraph at lines 76102--76105 []/ptmr8t/More in-for-ma-tion about color spaces can be found at [][]http://www .poynton.com/ColorFAQ.html[][] and [796] [797] [798] [799] [800] Underfull \hbox (badness 10000) in paragraph at lines 76718--76722 /ptmr8t/Returns the vol-ume of a given mixer con-trol. The re-turned vol-ume is a 2-tuple [801] [802] Chapter 23. [803] [804] [805] Underfull \hbox (badness 10000) in paragraph at lines 77113--77118 /ptmr8t/The /pcrr8t/gettext /ptmr8t/mod-ule pro-vides one ad-di-tional class de -rived from /pcrr8t/NullTranslations/ptmr8t/: [806] [807] [808] [809] [810] [811] Overfull \hbox (30.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_NUMERIC| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'decimal_point'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'thousands_sep'| Overfull \hbox (36.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_MONETARY| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_curr_symbol'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'currency_symbol'| Overfull \hbox (90.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_cs_precedes/n_cs_precedes'| Overfull \hbox (102.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sep_by_space/n_sep_by_space'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_decimal_point'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_frac_digits'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_thousands_sep'| Overfull \hbox (0.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_grouping'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'positive_sign'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'negative_sign'| Overfull \hbox (66.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sign_posn/n_sign_posn'| Overfull \hbox (24.99313pt too wide) in paragraph at lines 77686--77687 [][] [812] [813] [814] [815] [816] [817] [818] Chapter 24. [819] [820] [821] [822] [823] [824] Chapter 25. [825] [826] [827] [828] [829] [830] [831] [832] Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 []/ptmr8t/This is al-most al-ways the /pcrr8t/set() /ptmr8t/method of some scro ll-bar wid-get, Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 /ptmr8t/but can be any wid-get method that takes a sin-gle ar-gu-ment. Re-fer t o the file [833] [834] [835] [836] [837] [838] [839] [840] [841] [842] [843] [844] [845] [846] [847] [848] Underfull \hbox (badness 10000) in paragraph at lines 81034--81036 [] [849] [850] [851] [852] [853] [854] [855] [856] [857] [858] [859] [860] [861] [862] [863] Overfull \hbox (22.8553pt too wide) in paragraph at lines 82620--82620 []/ptmr8t/planet_and_moon| [864] [865] [866] [867] [868] Chapter 26. [869] [870] [871] [872] [873] [874] [875] Underfull \hbox (badness 10000) in paragraph at lines 83613--83615 /ptmr8t/Changed in ver-sion 2.4: The abil-ity to han-dle a multi-line ex-cep-ti on de-tail, and the [876] Underfull \hbox (badness 10000) in paragraph at lines 83673--83679 /ptmr8t/may go away when Python re-leases prior to 2.4 be-come un-in-ter-est-in g. Un-til then, [877] Overfull \hbox (82.23183pt too wide) in paragraph at lines 83752--83758 [][] Underfull \hbox (badness 10000) in paragraph at lines 83752--83758 [878] Underfull \hbox (badness 10000) in paragraph at lines 83811--83826 /pcrr8t/ELLIPSIS/ptmr8t/, /pcrr8t/IGNORE_EXCEPTION_DETAIL/ptmr8t/, /pcrr8t/REPO RT_UDIFF/ptmr8t/, /pcrr8t/REPORT_CDIFF/ptmr8t/, /pcrr8t/REPORT_NDIFF/ptmr8t/, Underfull \hbox (badness 7064) in paragraph at lines 83828--83833 /ptmr8t/Create a new op-tion flag with a given name, and re-turn the new flag's in-te-ger value. [879] Underfull \hbox (badness 10000) in paragraph at lines 83947--83949 []/ptmr8t/Optional ar-gu-ment /ptmri8t/name /ptmr8t/gives the name of the test; by de-fault, or if /pcrr8t/None/ptmr8t/, [880] [881] [882] [883] [884] [885] [886] [887] [888] [889] Underfull \hbox (badness 6910) in paragraph at lines 84820--84822 []/ptmr8t/For in-for-ma-tion about the con-struc-tor pa-ram-e-ters and meth-ods , see the doc-u-men-ta-tion for [890] [891] [892] [893] [894] [895] Underfull \hbox (badness 10000) in paragraph at lines 85291--85294 []/ptmr8t/will cre-ate a test suite that will run /pcrr8t/WidgetTestCase.testDe faultSize() /ptmr8t/and [896] [897] [898] [899] [900] Underfull \hbox (badness 5288) in paragraph at lines 85844--85853 []/ptmr8t/For ex-am-ple, if you have a mod-ule /pcrr8t/SampleTests /ptmr8t/con- tain-ing a /pcrr8t/TestCase/ptmr8t/-derived class [901] [902] Underfull \hbox (badness 10000) in paragraph at lines 86011--86012 [903] [904] [905] [906] [907] [908] Chapter 27. [909] [910] [911] [912] [913] [914] [915] [916] [917] [918] [919] [920] [921] [922] [923] [924] [925] [926] [927] [928] [929] [930] Chapter 28. [931] Underfull \hbox (badness 10000) in paragraph at lines 88510--88511 [932] [933] Underfull \hbox (badness 6001) in paragraph at lines 88795--88799 []/ptmr8t/On Win-dows NT+, file names are Uni-code na-tively, so no con-ver-sio n is per-formed. [934] [935] [936] [937] [938] [939] [940] Overfull \hbox (33.31012pt too wide) in paragraph at lines 89556--89556 []/pcrr8t/PendingDeprecationWarning| Overfull \hbox (22.45828pt too wide) in paragraph at lines 89625--89626 [][] [941] [942] [943] [944] [945] [946] [947] [948] Underfull \hbox (badness 10000) in paragraph at lines 90328--90332 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.exc_type, sys.exc_ value, [949] Underfull \hbox (badness 10000) in paragraph at lines 90342--90344 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.last_type, sys.las t_value, [950] [951] [952] Underfull \hbox (badness 6575) in paragraph at lines 90629--90631 []/ptmr8t/Instances of class /pcrr8t/_Feature /ptmr8t/have two cor-re-spond-ing meth-ods, /pcrr8t/getOptionalRelease() /ptmr8t/and [953] [954] Underfull \hbox (badness 5592) in paragraph at lines 90832--90835 /ptmr8t/The de-bug-ging flags nec-es-sary for the col-lec-tor to print in-for-m a-tion about a leak-ing pro- [955] Overfull \hbox (6.01671pt too wide) in paragraph at lines 91238--91238 [] /ptmb8t/Notes| Overfull \hbox (0.99947pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/method| Overfull \hbox (2.11691pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/f_exc_traceback| [956] Overfull \vbox (63.69313pt too high) has occurred while \output is active [957] [958] [959] Underfull \hbox (badness 10000) in paragraph at lines 91534--91535 [960] [961] [962] [963] Underfull \hbox (badness 6396) in paragraph at lines 91863--91868 []/ptmr8t/Conversion of an IEEE-754 ex-cep-tion to a Python ex-cep-tion re-quir es that the wrap-per macros [964] [965] [966] Chapter 29. Underfull \hbox (badness 6016) in paragraph at lines 91919--91922 /ptmr8t/Closely em-u-late the be-hav-ior of the in-ter-ac-tive Python in-ter-pr eter. This class builds on Underfull \hbox (badness 10000) in paragraph at lines 91926--91933 /ptmr8t/Convenience func-tion to run a read-eval-print loop. This cre-ates a ne w in-stance of [967] [968] [969] [970] Chapter 30. Underfull \hbox (badness 10000) in paragraph at lines 92169--92170 Overfull \hbox (85.05946pt too wide) in paragraph at lines 92219--92224 /ptmr8t/abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92219--92224 Underfull \hbox (badness 10000) in paragraph at lines 92241--92242 [971] [972] Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /ptmr8t/is /pcrr8t/('audioop', 'array', 'binascii', 'cmath', 'errno', 'imageop' , Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /pcrr8t/'marshal', 'math', 'md5', 'operator', 'parser', 'regex', 'select', Underfull \hbox (badness 10000) in paragraph at lines 92433--92438 /pcrr8t/'readlink', 'stat', 'times', 'uname', 'getpid', 'getppid', 'getcwd', [973] Overfull \hbox (98.94922pt too wide) in paragraph at lines 92499--92504 /ptmr8t/Dis-abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92499--92504 [974] [975] [976] Chapter 31. [977] [978] [979] [980] [981] [982] [983] [984] [985] [986] [987] [988] Chapter 32. [989] [990] [991] [992] [993] [994] [995] [996] [997] [998] [999] [1000] [1001] [1002] [1003] [1004] [1005] [1006] [1007] [1008] [1009] [1010] [1011] [1012] [1013] [1014] [1015] [1016] [1017] [1018] Chapter 33. [1019] [1020] [1021] Overfull \vbox (951.69313pt too high) has occurred while \output is active [1022] [1023] [1024] Chapter 34. [1025] [1026] [1027] [1028] Chapter 35. [1029] Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /ptmr8t/Modify the view, by call-ing /pcrr8t/MsiViewModify/ptmr8t/. /ptmri8t/ki nd /ptmr8t/can be one of Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_SEEK/ptmr8t/, /pcrr8t/MSIMODIFY_REFRESH/ptmr8t/, /pcrr8t/MSIM ODIFY_INSERT/ptmr8t/, /pcrr8t/MSIMODIFY_UPDATE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_ASSIGN/ptmr8t/, /pcrr8t/MSIMODIFY_REPLACE/ptmr8t/, /pcrr8t/MS IMODIFY_MERGE/ptmr8t/, /pcrr8t/MSIMODIFY_DELETE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_INSERT_TEMPORARY/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE_NEW/ptmr8t/, [1030] Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_AUTHOR/ptmr8t/, /pcrr8t/PID_KEYWORDS/ptmr8t/, /pcrr8t/PID_COMMENTS/ ptmr8t/, /pcrr8t/PID_TEMPLATE/ptmr8t/, /pcrr8t/PID_LASTAUTHOR/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_REVNUMBER/ptmr8t/, /pcrr8t/PID_LASTPRINTED/ptmr8t/, /pcrr8t/PID_CRE ATE_DTM/ptmr8t/, /pcrr8t/PID_LASTSAVE_DTM/ptmr8t/, [1031] [1032] [1033] [1034] [1035] [1036] Overfull \hbox (25.00525pt too wide) in paragraph at lines 98491--98492 [][] [1037] Overfull \hbox (43.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_LITTLE_ENDIAN| Overfull \hbox (25.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_BIG_ENDIAN| Overfull \hbox (7.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_RESOURCE_LIST| Overfull \hbox (25.01274pt too wide) in paragraph at lines 98670--98671 [][] [1038] [1039] [1040] [1041] [1042] Chapter 36. [1043] [1044] [1045] Underfull \hbox (badness 10000) in paragraph at lines 99440--99441 [1046] [1047] [1048] [1049] [1050] [1051] [1052] [1053] [1054] [1055] [1056] Underfull \hbox (badness 10000) in paragraph at lines 100685--100688 []/pcrr8t/LOG_EMERG/ptmr8t/, /pcrr8t/LOG_ALERT/ptmr8t/, /pcrr8t/LOG_CRIT/ptmr8t /, /pcrr8t/LOG_ERR/ptmr8t/, /pcrr8t/LOG_WARNING/ptmr8t/, [1057] Underfull \hbox (badness 10000) in paragraph at lines 100721--100722 [1058] Chapter 37. Underfull \hbox (badness 10000) in paragraph at lines 100788--100789 [1059] Underfull \hbox (badness 10000) in paragraph at lines 100926--100927 [1060] Underfull \hbox (badness 10000) in paragraph at lines 101050--101051 [1061] [1062] Underfull \hbox (badness 10000) in paragraph at lines 101165--101166 [1063] [1064] Underfull \hbox (badness 10000) in paragraph at lines 101393--101394 [1065] [1066] [1067] Underfull \hbox (badness 10000) in paragraph at lines 101755--101756 [1068] [1069] [1070] [1071] [1072] Chapter 38. [1073] [1074] Underfull \hbox (badness 10000) in paragraph at lines 102191--102192 Underfull \hbox (badness 10000) in paragraph at lines 102270--102271 [1075] [1076] Underfull \hbox (badness 10000) in paragraph at lines 102420--102421 [1077] [1078] Chapter 39. Underfull \hbox (badness 10000) in paragraph at lines 102638--102639 [1079] [1080] [1081] [1082] Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/audio| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/index| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ptime| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/atime| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/catalog| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ident| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/control| Overfull \hbox (24.99579pt too wide) in paragraph at lines 103137--103138 [][] [1083] [1084] [1085] Underfull \hbox (badness 10000) in paragraph at lines 103421--103425 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103429--103433 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, [1086] Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /ptmr8t/Add a po-si-tioner ob-ject to the form. --- Meth-ods: /pcrr8t/set_posit ioner_xvalue()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_yvalue()/ptmr8t/, /pcrr8t/set_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_ybounds()/ptmr8t/, /pcrr8t/get_positioner_xvalue()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/get_positioner_yvalue()/ptmr8t/, /pcrr8t/get_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103452--103455 /pcrr8t/set_counter_bounds()/ptmr8t/, /pcrr8t/set_counter_step()/ptmr8t/, /pcrr 8t/set_counter_precision()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103471--103475 /pcrr8t/addto_choice()/ptmr8t/, /pcrr8t/replace_choice()/ptmr8t/, /pcrr8t/delet e_choice()/ptmr8t/, /pcrr8t/get_choice_text()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/add_browser_line()/ptmr8t/, /pcrr8t/addto_browser()/ptmr8t/, /pcrr8t/in sert_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/delete_browser_line()/ptmr8t/, /pcrr8t/replace_browser_line()/ptmr8t/, /pcrr8t/get_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/load_browser()/ptmr8t/, /pcrr8t/get_browser_maxline()/ptmr8t/, /pcrr8t/ select_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/deselect_browser_line()/ptmr8t/, /pcrr8t/deselect_browser()/ptmr8t/, /p crr8t/isselected_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/get_browser()/ptmr8t/, /pcrr8t/set_browser_fontsize()/ptmr8t/, /pcrr8t/ set_browser_fontstyle()/ptmr8t/, [1087] [1088] [1089] Underfull \hbox (badness 10000) in paragraph at lines 103939--103940 [1090] [1091] [1092] Overfull \hbox (16.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'forcegray'| Overfull \hbox (4.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'quality'| Overfull \hbox (10.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'optimize'| Overfull \hbox (24.99864pt too wide) in paragraph at lines 104267--104268 [][] Overfull \hbox (74.97656pt too wide) in paragraph at lines 104279--104281 [] [1093] [1094] Chapter 40. [1095] [1096] Chapter 41. Underfull \hbox (badness 10000) in paragraph at lines 104464--104465 Underfull \hbox (badness 10000) in paragraph at lines 104495--104496 Underfull \hbox (badness 10000) in paragraph at lines 104503--104504 Underfull \hbox (badness 10000) in paragraph at lines 104510--104511 [1097] Underfull \hbox (badness 10000) in paragraph at lines 104518--104519 [1098] Underfull \hbox (badness 10000) in paragraph at lines 104636--104637 Underfull \hbox (badness 10000) in paragraph at lines 104654--104655 [1099] [1100] Appendix A. [1101] [1102] [1103] [1104] [1105] [1106] Appendix B. [1107] [1108] Appendix C. [1109] [1110] [1111] [1112] [1113] [1114] [1115] [1116] [1117] [1118] [1119] [1120] Appendix D. No file modlibrary.ind. No file library.ind. [1121] (./library.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc}{/usr/share/texmf/dvips/tetex/aae443f0.enc} Output written on library.pdf (1125 pages, 5620848 bytes). Transcript written on library.log. pdflatex 'library.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./library.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex) (./library.pla)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file library.idx (./library.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./library.out) (./library.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./library.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.109 ...ay bisection algorithm}{147}{section.9.5} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.240 ... with \textbf {bzip2}}{284}{section.13.3} [2] [3] [4] [5] Overfull \hbox (4.49997pt too wide) detected at line 1005 []/ptmr8t/1002 Overfull \hbox (4.49997pt too wide) detected at line 1008 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1009 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1010 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1011 []/ptmr8t/1005 Overfull \hbox (4.49997pt too wide) detected at line 1012 []/ptmr8t/1006 Overfull \hbox (4.49997pt too wide) detected at line 1013 []/ptmr8t/1006 Overfull \hbox (4.49997pt too wide) detected at line 1016 []/ptmr8t/1008 Overfull \hbox (4.49997pt too wide) detected at line 1017 []/ptmr8t/1008 Overfull \hbox (4.49997pt too wide) detected at line 1018 []/ptmr8t/1009 Overfull \hbox (4.49997pt too wide) detected at line 1020 []/ptmr8t/1016 Overfull \hbox (4.49997pt too wide) detected at line 1021 []/ptmr8t/1017 Overfull \hbox (4.49997pt too wide) detected at line 1023 []/ptmr8t/1019 Overfull \hbox (4.49997pt too wide) detected at line 1024 []/ptmr8t/1020 Overfull \hbox (4.49997pt too wide) detected at line 1025 []/ptmr8t/1020 Overfull \hbox (4.49997pt too wide) detected at line 1029 []/ptmr8t/1024 Overfull \hbox (4.49997pt too wide) detected at line 1030 []/ptmr8t/1024 Overfull \hbox (4.49997pt too wide) detected at line 1032 []/ptmr8t/1025 Overfull \hbox (4.49997pt too wide) detected at line 1038 []/ptmr8t/1029 Overfull \hbox (4.49997pt too wide) detected at line 1049 []/ptmr8t/1034 Overfull \hbox (4.49997pt too wide) detected at line 1053 []/ptmr8t/1035 Overfull \hbox (4.49997pt too wide) detected at line 1055 []/ptmr8t/1039 Overfull \hbox (4.49997pt too wide) detected at line 1057 []/ptmr8t/1043 Overfull \hbox (4.49997pt too wide) detected at line 1060 []/ptmr8t/1044 Overfull \hbox (4.49997pt too wide) detected at line 1061 []/ptmr8t/1044 Overfull \hbox (4.49997pt too wide) detected at line 1062 []/ptmr8t/1045 Overfull \hbox (4.49997pt too wide) detected at line 1063 []/ptmr8t/1046 Overfull \hbox (4.49997pt too wide) detected at line 1064 []/ptmr8t/1046 Overfull \hbox (4.49997pt too wide) detected at line 1066 []/ptmr8t/1047 Overfull \hbox (4.49997pt too wide) detected at line 1068 []/ptmr8t/1048 Overfull \hbox (4.49997pt too wide) detected at line 1069 []/ptmr8t/1049 Overfull \hbox (4.49997pt too wide) detected at line 1070 []/ptmr8t/1049 Overfull \hbox (4.49997pt too wide) detected at line 1071 []/ptmr8t/1051 [6] Overfull \hbox (4.49997pt too wide) detected at line 1073 []/ptmr8t/1052 Overfull \hbox (4.49997pt too wide) detected at line 1074 []/ptmr8t/1054 Overfull \hbox (4.49997pt too wide) detected at line 1077 []/ptmr8t/1056 Overfull \hbox (4.49997pt too wide) detected at line 1078 []/ptmr8t/1057 Overfull \hbox (4.49997pt too wide) detected at line 1079 []/ptmr8t/1057 Overfull \hbox (4.49997pt too wide) detected at line 1081 []/ptmr8t/1059 Overfull \hbox (4.49997pt too wide) detected at line 1083 []/ptmr8t/1060 Overfull \hbox (4.49997pt too wide) detected at line 1084 []/ptmr8t/1061 Overfull \hbox (4.49997pt too wide) detected at line 1085 []/ptmr8t/1062 Overfull \hbox (4.49997pt too wide) detected at line 1086 []/ptmr8t/1063 Overfull \hbox (4.49997pt too wide) detected at line 1088 []/ptmr8t/1065 Overfull \hbox (4.49997pt too wide) detected at line 1094 []/ptmr8t/1068 Overfull \hbox (4.49997pt too wide) detected at line 1095 []/ptmr8t/1068 Overfull \hbox (4.49997pt too wide) detected at line 1120 []/ptmr8t/1071 Overfull \hbox (4.49997pt too wide) detected at line 1122 []/ptmr8t/1074 Overfull \hbox (4.49997pt too wide) detected at line 1123 []/ptmr8t/1074 Overfull \hbox (4.49997pt too wide) detected at line 1124 []/ptmr8t/1075 Overfull \hbox (4.49997pt too wide) detected at line 1125 []/ptmr8t/1076 Overfull \hbox (4.49997pt too wide) detected at line 1126 []/ptmr8t/1078 Overfull \hbox (4.49997pt too wide) detected at line 1129 []/ptmr8t/1079 Overfull \hbox (4.49997pt too wide) detected at line 1132 []/ptmr8t/1081 Overfull \hbox (4.49997pt too wide) detected at line 1133 []/ptmr8t/1081 Overfull \hbox (4.49997pt too wide) detected at line 1136 []/ptmr8t/1084 Overfull \hbox (4.49997pt too wide) detected at line 1140 []/ptmr8t/1088 Overfull \hbox (4.49997pt too wide) detected at line 1141 []/ptmr8t/1089 Overfull \hbox (4.49997pt too wide) detected at line 1142 []/ptmr8t/1089 Overfull \hbox (4.49997pt too wide) detected at line 1143 []/ptmr8t/1090 Overfull \hbox (4.49997pt too wide) detected at line 1144 []/ptmr8t/1091 Overfull \hbox (4.49997pt too wide) detected at line 1145 []/ptmr8t/1091 Overfull \hbox (4.49997pt too wide) detected at line 1146 []/ptmr8t/1092 Overfull \hbox (4.49997pt too wide) detected at line 1147 []/ptmr8t/1092 Overfull \hbox (4.49997pt too wide) detected at line 1149 []/ptmr8t/1095 Overfull \hbox (4.49997pt too wide) detected at line 1151 []/ptmr8t/1096 Overfull \hbox (4.49997pt too wide) detected at line 1153 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1154 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1155 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1156 []/ptmr8t/1098 Overfull \hbox (4.49997pt too wide) detected at line 1167 []/ptmr8t/1099 Overfull \hbox (4.49997pt too wide) detected at line 1168 []/ptmr8t/1099 Overfull \hbox (4.49997pt too wide) detected at line 1171 []/ptmr8t/1107 Overfull \hbox (4.49997pt too wide) detected at line 1173 []/ptmr8t/1109 Overfull \hbox (4.49997pt too wide) detected at line 1174 []/ptmr8t/1110 Overfull \hbox (4.49997pt too wide) detected at line 1175 []/ptmr8t/1113 [7]) [8] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [2] Chapter 1. ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.188 \hypertarget{built-in-funcs}{}\chapter {Built-in Functions} [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.188 \hypertarget{built-in-funcs}{}\chapter {Built-in Functions} [4] Chapter 2. ! pdfTeX warning (ext4): destination with the same identifier (name{page.5}) ha s been already used, duplicate ignored \penalty l.267 \end{funcdesc} [5] ! pdfTeX warning (ext4): destination with the same identifier (name{page.6}) ha s been already used, duplicate ignored \penalty l.358 [6] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.7}) ha s been already used, duplicate ignored \penalty l.451 ...plex numbers is deprecated.\end{funcdesc} [7] ! pdfTeX warning (ext4): destination with the same identifier (name{page.8}) ha s been already used, duplicate ignored \penalty l.532 \end{notice} [8] [9] Underfull \hbox (badness 10000) in paragraph at lines 658--659 [10] Underfull \hbox (badness 10000) in paragraph at lines 746--747 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 3. [21] [22] Chapter 4. [23] [24] Chapter 5. [25] [26] Chapter 6. [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] Overfull \hbox (8.3441pt too wide) in paragraph at lines 3183--3183 [] /ptmb8t/Notes| [38] Overfull \hbox (7.72594pt too wide) in paragraph at lines 3375--3375 []/ptmr8t/(7)(8)(9)(10)| [39] [40] Underfull \hbox (badness 10000) in paragraph at lines 3558--3564 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and [41] Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 []/ptmr8t/Note, the non-operator ver-sions of the /pcrr8t/update()/ptmr8t/, /pc rr8t/intersection_update()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 /pcrr8t/difference_update()/ptmr8t/, and /pcrr8t/symmetric_difference_update() /ptmr8t/meth-ods will ac-cept [42] [43] [44] [45] [46] Underfull \hbox (badness 6944) in paragraph at lines 4192--4198 []/ptmr8t/An ex-am-ple of a con-text man-ager that re-turns a re-lated ob-ject is the one re-turned by [47] [48] [49] [50] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 4492--4495 /ptmr8t/The base class for all built-in ex-cep-tions ex-cept /pcrr8t/StopIterat ion/ptmr8t/, /pcrr8t/GeneratorExit/ptmr8t/, [51] [52] [53] [54] [55] [56] Chapter 8. [57] [58] Overfull \hbox (166.23189pt too wide) in paragraph at lines 5141--5148 [][] Underfull \hbox (badness 10000) in paragraph at lines 5141--5148 [59] Overfull \hbox (172.23183pt too wide) in paragraph at lines 5252--5260 [][] Underfull \hbox (badness 10000) in paragraph at lines 5252--5260 [60] Overfull \hbox (49.99875pt too wide) in paragraph at lines 5306--5307 [][] Overfull \hbox (50.00552pt too wide) in paragraph at lines 5345--5346 [][] Overfull \hbox (2.46297pt too wide) in paragraph at lines 5426--5426 [] /ptmb8t/Type| Overfull \hbox (1.29306pt too wide) in paragraph at lines 5426--5426 []/ptmr8t/None| Overfull \hbox (49.99658pt too wide) in paragraph at lines 5426--5427 [][] Overfull \hbox (6.8293pt too wide) in paragraph at lines 5499--5499 [] /ptmb8t/Type| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'e'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'E'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'f'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'F'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'g'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'G'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'n'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'%'| Overfull \hbox (5.6594pt too wide) in paragraph at lines 5499--5499 []/ptmr8t/None| Overfull \hbox (50.00784pt too wide) in paragraph at lines 5499--5500 [][] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 []/ptmb8t/Note: /ptmr8t/The fol-low-ing ap-plies only to reg-u-lar ex-pres-sio n ob-jects like those cre-ated with Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 /pcrr8t/re.compile("pattern")/ptmr8t/, not the prim-i-tives /pcrr8t/re.match(pa ttern, string) /ptmr8t/or [78] [79] [80] [81] [82] Underfull \hbox (badness 10000) in paragraph at lines 7604--7606 /ptmr8t/Identical to the /pcrr8t/unpack_from() /ptmr8t/func-tion, us-ing the co m-piled for-mat. [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] Underfull \hbox (badness 10000) in paragraph at lines 8915--8918 []/ptmr8t/Decoding and trans-lat-ing works sim-i-lar, ex-cept /pcrr8t/UnicodeDe codeError /ptmr8t/or [97] [98] Overfull \hbox (52.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'xmlcharrefreplace'| Overfull \hbox (46.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'backslashreplace'| [99] [100] [101] [102] [103] Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jis_2004| Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jisx0213| Overfull \hbox (2.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_1| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2| Overfull \hbox (27.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2004| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_3| Overfull \hbox (19.87584pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_ext| Overfull \hbox (3.35597pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_kr| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_10| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_13| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_14| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_15| Overfull \hbox (8.19551pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_cyrillic| Overfull \hbox (2.22585pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_greek| Overfull \hbox (8.89561pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_iceland| Overfull \hbox (2.79562pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_latin2| Overfull \hbox (5.5658pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_roman| Overfull \hbox (7.79564pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_turkish| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jis_2004| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jisx0213| [104] Overfull \vbox (459.69313pt too high) has occurred while \output is active [105] Overfull \hbox (11.3528pt too wide) in paragraph at lines 10484--10484 [] /ptmb8t/Operand Overfull \hbox (18.4786pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/base64_codec| Overfull \hbox (5.14877pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/bz2_codec| Overfull \hbox (4.99887pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/hex_codec| Overfull \hbox (1.81868pt too wide) in paragraph at lines 10484--10484 /ptmr8t/pri_codec| Overfull \hbox (45.5384pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/raw_unicode_escape| Overfull \hbox (16.8183pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/string_escape| Overfull \hbox (12.91855pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_escape| Overfull \hbox (16.8184pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_internal| Overfull \hbox (0.70883pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/uu_codec| Overfull \hbox (5.70856pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/zlib_codec| (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [106] [107] [108] [109] [110] Chapter 9. [111] [112] Underfull \hbox (badness 10000) in paragraph at lines 11110--11112 /ptmr8t/The most pos-i-tive /pcrr8t/timedelta /ptmr8t/ob-ject, /pcrr8t/timedelt a(days=999999999, hours=23, Underfull \hbox (badness 10000) in paragraph at lines 11116--11118 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/timede lta /ptmr8t/ob-jects, [113] [114] Overfull \hbox (20.67915pt too wide) in paragraph at lines 11394--11395 [][] Underfull \hbox (badness 7362) in paragraph at lines 11400--11405 /pcrr8t/< 0/ptmr8t/. Af-ter-ward /pcrr8t/date2 - date1 == timedelta.days/ptmr8t /. /pcrr8t/timedelta.seconds /ptmr8t/and Underfull \hbox (badness 10000) in paragraph at lines 11443--11447 /pcrr8t/d.month, d.day, 0, 0, 0, d.weekday(), d.toordinal() - date(d.year, 1, [115] Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /ptmr8t/Return a string rep-re-sent-ing the date, for ex-am-ple /pcrr8t/date(20 02, 12, Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /pcrr8t/4).ctime() == 'Wed Dec 4 00:00:00 2002'/ptmr8t/. /pcrr8t/d.ctime() /ptm r8t/is equiv-a-lent to [116] Underfull \hbox (badness 10000) in paragraph at lines 11615--11618 /ptmr8t/Return the cur-rent lo-cal date-time, with /pcrr8t/tzinfo None/ptmr8t/. This is equiv-a-lent to [117] Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the cur-rent date Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 /ptmr8t/and time are con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this cas e the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the times- Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 /ptmr8t/tamp is con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this case the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11713--11715 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/dateti me /ptmr8t/ob-jects, [118] Underfull \hbox (badness 5652) in paragraph at lines 11796--11802 []/ptmr8t/datetime2 is a du-ra-tion of timedelta re-moved from date-time1, mov- ing for-ward in time if [119] Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /ptmr8t/equiv-a-lent to /pcrr8t/time.struct_time((d.year, d.month, d.day, d.hou r, d.minute, Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /pcrr8t/d.second, d.weekday(), d.toordinal() - date(d.year, 1, 1).toordinal() + [120] Underfull \hbox (badness 6592) in paragraph at lines 11961--11967 []/ptmr8t/If /ptmri8t/d /ptmr8t/is aware, /ptmri8t/d /ptmr8t/is nor-mal-ized to UTC time, by sub-tract-ing /pcrr8t/d.utcoffset()/ptmr8t/, and a Underfull \hbox (badness 10000) in paragraph at lines 11990--11992 /ptmr8t/Return a 3-tuple, (ISO year, ISO week num-ber, ISO week-day). The same as Underfull \hbox (badness 10000) in paragraph at lines 11996--11999 /ptmr8t/Return a string rep-re-sent-ing the date and time in ISO 8601 for-mat, YYYY-MM- Underfull \hbox (badness 7238) in paragraph at lines 12026--12031 /ptmr8t/Return a string rep-re-sent-ing the date and time, for ex-am-ple /pcrr8 t/datetime(2002, 12, 4, [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] Overfull \hbox (11.12794pt too wide) in paragraph at lines 12942--12942 [] /ptmb8t/Notes| [131] [132] [133] [134] Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Container| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Hashable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterator| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Callable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Sequence| Overfull \hbox (55.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSequence| Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSet| Overfull \hbox (7.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Mapping| Overfull \hbox (49.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableMapping| Overfull \hbox (31.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/KeysView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ItemsView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ValuesView| Overfull \hbox (11.87897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] Underfull \hbox (badness 10000) in paragraph at lines 14902--14916 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and Overfull \hbox (44.79945pt too wide) in paragraph at lines 15021--15021 []/pcrr8t/s.symmetric_difference_update(t)| [151] [152] [153] [154] [155] Underfull \hbox (badness 5637) in paragraph at lines 15375--15378 []/ptmr8t/The low-est val-ued en-tries are re-trieved first (the low-est val-ue d en-try is the one re-turned [156] [157] [158] [159] [160] Underfull \hbox (badness 7308) in paragraph at lines 15883--15885 []/ptmr8t/In ad-di-tion to the four base meth-ods, pro-gres-sively more ef-fi-c iency comes with defin-ing [161] [162] [163] [164] Underfull \hbox (badness 10000) in paragraph at lines 16238--16244 /ptmr8t/The type of ob-jects de-fined in ex-ten-sion mod-ules with /pcrr8t/PyMe mberDef/ptmr8t/, such as [165] [166] [167] [168] [169] [170] Chapter 10. [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205] [206] [207] [208] [209] [210] [211] [212] [213] [214] [215] [216] [217] [218] [219] [220] [221] [222] [223] [224] Chapter 11. [225] [226] [227] [228] Underfull \hbox (badness 10000) in paragraph at lines 22021--22022 Overfull \hbox (64.2315pt too wide) in paragraph at lines 22040--22042 []/ptmr8t/Usage ex-am-ple: /pcrr8t/fi = fileinput.FileInput(openhook=fileinput. hook_encoded("iso-8859-1")) [229] [230] [231] [232] [233] Underfull \hbox (badness 10000) in paragraph at lines 22481--22481 []/ptmri8t/[mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [dir=None, Underfull \hbox (badness 10000) in paragraph at lines 22497--22497 []/ptmri8t/[max_size=0, [mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [234] [235] [236] [237] [238] [239] [240] [241] [242] Chapter 12. [243] Underfull \hbox (badness 10000) in paragraph at lines 23276--23277 [244] [245] [246] [247] [248] [249] [250] [251] [252] [253] Underfull \hbox (badness 10000) in paragraph at lines 24198--24205 /ptmr8t/A sub-class of /pcrr8t/Shelf /ptmr8t/which ex-poses /pcrr8t/first()/ptm r8t/, /pcrr8t/next()/ptmr8t/, /pcrr8t/previous()/ptmr8t/, /pcrr8t/last() /ptmr8 t/and [254] [255] Underfull \hbox (badness 10000) in paragraph at lines 24322--24323 Underfull \hbox (badness 10000) in paragraph at lines 24342--24343 [256] [257] [258] Overfull \hbox (17.53752pt too wide) in paragraph at lines 24736--24737 [][] [259] [260] [261] [262] [263] [264] [265] [266] [267] [268] [269] [270] [271] [272] [273] [274] [275] Underfull \hbox (badness 10000) in paragraph at lines 26265--26269 []/ptmr8t/The /pcrr8t/sqlite3 /ptmr8t/mod-ule has two de-fault adapters for Pyt hon's built-in /pcrr8t/datetime.date /ptmr8t/and [276] [277] [278] Underfull \hbox (badness 5288) in paragraph at lines 26449--26456 /ptmr8t/Using the non-stan-dard /pcrr8t/execute()/ptmr8t/, /pcrr8t/executemany( ) /ptmr8t/and /pcrr8t/executescript() /ptmr8t/meth-ods of the [279] [280] Chapter 13. [281] [282] [283] [284] Underfull \hbox (badness 10000) in paragraph at lines 27001--27004 /ptmr8t/Sequential com-pres-sion and de-com-pres-sion is done us-ing the classe s /pcrr8t/BZ2Compressor /ptmr8t/and [285] [286] [287] [288] [289] [290] [291] Underfull \hbox (badness 10000) in paragraph at lines 27745--27747 /ptmr8t/Is raised for /ptmri8t/non-fatal /ptmr8t/er-rors when us-ing /pcrr8t/Ta rFile.extract()/ptmr8t/, but only if [292] [293] Underfull \hbox (badness 10000) in paragraph at lines 28009--28012 []/pcrr8t/TarInfo /ptmr8t/ob-jects are re-turned by /pcrr8t/TarFile/ptmr8t/`s m eth-ods /pcrr8t/getmember()/ptmr8t/, /pcrr8t/getmembers() /ptmr8t/and [294] [295] [296] Underfull \hbox (badness 10000) in paragraph at lines 28265--28274 []/ptmr8t/The de-fault value for /ptmri8t/en-cod-ing /ptmr8t/is the lo-cal char -ac-ter en-cod-ing. It is de-duced from [297] [298] Chapter 14. [299] [300] Underfull \hbox (badness 10000) in paragraph at lines 28460--28460 []/ptmri8t/csvfile, field-names, [rest-val='', [ex-trasac-tion='raise', [di-ale ct='excel', [*args, [301] [302] [303] [304] [305] Underfull \hbox (badness 10000) in paragraph at lines 28879--28880 [306] Underfull \hbox (badness 6526) in paragraph at lines 28976--28978 /ptmr8t/Exception raised when an op-tion ref-er-enced from a value does not ex- ist. Sub-class of [307] [308] [309] [310] [311] [312] [313] [314] Overfull \hbox (15.7865pt too wide) in paragraph at lines 29730--29731 [] [315] [316] Chapter 15. Underfull \hbox (badness 10000) in paragraph at lines 29863--29864 [317] [318] [319] [320] Chapter 16. [321] [322] [323] Underfull \hbox (badness 10000) in paragraph at lines 30607--30612 /ptmr8t/Execute /ptmri8t/cmd /ptmr8t/as a sub-process and re-turn the file ob-j ects /pcrr8t/(child_stdin, [324] [325] Underfull \hbox (badness 10000) in paragraph at lines 30725--30729 []/ptmr8t/If you're start-ing with a Python file ob-ject /ptmri8t/f/ptmr8t/, fi rst do /pcrr8t/f.flush()/ptmr8t/, and then do [326] [327] [328] [329] [330] [331] Underfull \hbox (badness 10000) in paragraph at lines 31411--31412 Underfull \hbox (badness 10000) in paragraph at lines 31427--31428 [332] [333] [334] [335] [336] [337] [338] [339] [340] Underfull \hbox (badness 5741) in paragraph at lines 32229--32235 []/pcrr8t/BufferedIOBase /ptmr8t/deals with buffer-ing on a raw byte stream (/p crr8t/RawIOBase/ptmr8t/). Its sub-classes, [341] [342] [343] [344] [345] [346] Underfull \hbox (badness 10000) in paragraph at lines 32946--32948 /ptmr8t/A helper codec that de-codes new-lines for uni-ver-sal new-lines mode. It in-her-its [347] [348] Overfull \hbox (11.12794pt too wide) in paragraph at lines 33384--33384 [] /ptmb8t/Notes| Overfull \hbox (25.01363pt too wide) in paragraph at lines 33384--33385 [][] [349] [350] [351] [352] [353] Underfull \hbox (badness 10000) in paragraph at lines 33777--33781 []/pcrr8t/"-v" /ptmr8t/and /pcrr8t/"--report" /ptmr8t/are both op-tions. As-sum -ing that /pcrro8t/--report /ptmr8t/takes one ar-gu-ment, [354] [355] [356] [357] Underfull \hbox (badness 5652) in paragraph at lines 34102--34105 []/ptmr8t/If /pcrr8t/optparse /ptmr8t/en-coun-ters ei-ther /pcrr8t/"-h" /ptmr8t /or /pcrr8t/"--help" /ptmr8t/on the command-line, or if you just call [358] [359] [360] [361] Underfull \hbox (badness 5203) in paragraph at lines 34386--34389 /ptmr8t/There are sev-eral ways to pop-u-late the parser with op-tions. The pre -ferred way is by us-ing [362] [363] [364] [365] [366] [367] Underfull \hbox (badness 10000) in paragraph at lines 34976--34977 []/ptmr8t/assume op-tion con-flicts are a pro-gram-ming er-ror and raise [368] [369] [370] [371] [372] [373] Underfull \hbox (badness 10000) in paragraph at lines 35426--35431 []/ptmr8t/Your type-checking func-tion should raise /pcrr8t/OptionValueError /p tmr8t/if it en-coun-ters any prob-lems. [374] [375] [376] [377] [378] [379] [380] Underfull \hbox (badness 10000) in paragraph at lines 35997--36006 []/pcrr8t/Logger.debug()/ptmr8t/, /pcrr8t/Logger.info()/ptmr8t/, /pcrr8t/Logger .warning()/ptmr8t/, /pcrr8t/Logger.error()/ptmr8t/, and [381] [382] [383] [384] Underfull \hbox (badness 5403) in paragraph at lines 36345--36348 []/pcrr8t/BaseRotatingHandler /ptmr8t/is the base class for han-dlers that ro-t ate log files at a cer-tain [385] [386] Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filename| Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filemode| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/format| Overfull \hbox (10.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/datefmt| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/stream| Overfull \hbox (25.01265pt too wide) in paragraph at lines 36623--36624 [][] [387] [388] [389] [390] Overfull \hbox (3.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(name)s| Overfull \hbox (33.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(levelname)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(asctime)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(message)s| [391] [392] [393] [394] [395] [396] [397] [398] Underfull \hbox (badness 6001) in paragraph at lines 37574--37574 []/ptmri8t/filename, [when, [in-ter-val, [back-up-Count, [en-cod-ing, [de-lay, [399] Underfull \hbox (badness 5245) in paragraph at lines 37722--37724 /ptmr8t/The fac-tory method of /pcrr8t/SocketHandler /ptmr8t/is here over-rid-d en to cre-ate a UDP socket [400] [401] [402] Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelno)s| Overfull \hbox (16.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(pathname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(filename)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(funcName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(created)f| Overfull \hbox (52.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(relativeCreated)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(asctime)s| Overfull \hbox (22.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(threadName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(process)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(message)s| Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/Formats the spec-i-fied ex-cep-tion in-for-ma-tion (a stan-dard ex-cep- tion tu-ple as re- Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/turned by /pcrr8t/sys.exc_info()/ptmr8t/) as a string. This de-fault im -ple-men-ta-tion just uses [403] [404] [405] [406] [407] [408] [409] [410] [411] [412] [413] [414] [415] [416] Underfull \hbox (badness 10000) in paragraph at lines 39269--39270 [417] [418] [419] [420] [421] [422] Overfull \vbox (435.69313pt too high) has occurred while \output is active [423] [424] [425] [426] [427] [428] [429] [430] [431] [432] [433] [434] [435] [436] [437] [438] [439] [440] Overfull \hbox (28.77098pt too wide) in paragraph at lines 42666--42667 [][] [441] [442] [443] [444] [445] [446] [447] [448] [449] [450] [451] [452] [453] [454] [455] [456] [457] [458] [459] [460] [461] [462] Underfull \hbox (badness 7221) in paragraph at lines 44332--44335 []/ptmr8t/The ex-act func-tion-al-ity is sys-tem de-pen-dent. Changed in ver-si on 2.6: Win-dows only: [463] [464] [465] [466] [467] [468] [469] [470] Chapter 17. [471] Overfull \hbox (14.31891pt too wide) in paragraph at lines 45106--45107 [][] [472] [473] [474] [475] [476] [477] [478] [479] [480] [481] [482] [483] [484] Underfull \hbox (badness 10000) in paragraph at lines 46585--46586 [485] [486] [487] Underfull \hbox (badness 10000) in paragraph at lines 46788--46791 []/ptmr8t/For more flex-i-bil-ity in us-ing shared mem-ory one can use the [488] [489] [490] Underfull \hbox (badness 10000) in paragraph at lines 47072--47073 Underfull \hbox (badness 10000) in paragraph at lines 47086--47087 [491] [492] [493] Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 []/ptmb8t/Note: /pcrr8t/multiprocessing /ptmr8t/con-tains no ana-logues of /pc rr8t/threading.active_count()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 /pcrr8t/threading.enumerate()/ptmr8t/, /pcrr8t/threading.settrace()/ptmr8t/, /p crr8t/threading.setprofile()/ptmr8t/, [494] Underfull \hbox (badness 10000) in paragraph at lines 47418--47419 Underfull \hbox (badness 10000) in paragraph at lines 47424--47425 [495] Underfull \hbox (badness 5417) in paragraph at lines 47485--47491 []/ptmb8t/Note: /ptmr8t/If the SIG-INT sig-nal gen-er-ated by Ctrl-C ar-rives while the main thread is blocked Underfull \hbox (badness 10000) in paragraph at lines 47485--47491 /ptmr8t/by a call to /pcrr8t/BoundedSemaphore.acquire()/ptmr8t/, /pcrr8t/Lock.a cquire()/ptmr8t/, /pcrr8t/RLock.acquire()/ptmr8t/, [496] [497] [498] [499] [500] [501] [502] [503] [504] [505] [506] Underfull \hbox (badness 8113) in paragraph at lines 48556--48563 []/ptmr8t/If au-then-ti-ca-tion is re-quested but do au-then-ti-ca-tion key is spec-i-fied then the re-turn value of [507] [508] [509] [510] [511] [512] [513] [514] [515] [516] [517] [518] [519] [520] [521] [522] [523] [524] [525] [526] [527] [528] [529] [530] [531] [532] [533] [534] [535] [536] [537] [538] [539] [540] [541] [542] Chapter 18. Underfull \hbox (badness 10000) in paragraph at lines 50912--50912 /ptmri8t/close_fds=False, shell=False, cwd=None, env=None, uni-ver-sal_newlines =False, star- [543] [544] [545] Underfull \hbox (badness 10000) in paragraph at lines 51134--51139 []/ptmb8t/Warning: /ptmr8t/Use /pcrr8t/communicate() /ptmr8t/rather than /pcrr 8t/stdin.write()/ptmr8t/, /pcrr8t/stdout.read() /ptmr8t/or [546] [547] [548] [549] [550] Underfull \hbox (badness 10000) in paragraph at lines 51621--51625 []/ptmr8t/If you want to know the cur-rent ma-chine's IP ad-dress, you may want to use [551] [552] [553] [554] [555] [556] [557] [558] Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 []/ptmri8t/sock, key-file=None, cert-file=None, server_side=False, cert_reqs=CE RT_NONE, Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 /ptmri8t/ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True, s up- [559] [560] [561] [562] [563] [564] Overfull \hbox (9.78795pt too wide) in paragraph at lines 52919--52920 [] [565] [566] Underfull \hbox (badness 6047) in paragraph at lines 53085--53090 /ptmr8t/Sets given in-ter-val timer (one of /pcrr8t/signal.ITIMER_REAL/ptmr8t/, /pcrr8t/signal.ITIMER_VIRTUAL /ptmr8t/or [567] [568] [569] [570] [571] [572] [573] [574] Overfull \hbox (13.83913pt too wide) in paragraph at lines 53859--53860 [][] [575] [576] Chapter 19. [577] [578] [579] [580] [581] [582] [583] [584] Underfull \hbox (badness 10000) in paragraph at lines 54859--54863 []/ptmr8t/As a con-ve-nience, see the meth-ods /pcrr8t/Message.as_string() /ptm r8t/and /pcrr8t/str(aMessage)/ptmr8t/, a.k.a. [585] [586] [587] [588] [589] [590] [591] [592] [593] [594] Underfull \hbox (badness 10000) in paragraph at lines 55801--55807 /ptmr8t/Changed in ver-sion 2.4: The /pcrr8t/dump_address_pair() /ptmr8t/func-t ion has been re-moved; use [595] [596] [597] [598] [599] [600] Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 []/ptmr8t/Methods that were dep-re-cated in ver-sion 3 have been re-moved. Thes e in-clude Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 /pcrr8t/Generator.__call__()/ptmr8t/, /pcrr8t/Message.get_type()/ptmr8t/, /pcrr 8t/Message.get_main_type()/ptmr8t/, [601] Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 []/ptmr8t/New /pcrr8t/DeprecationWarning/ptmr8t/s have been added to: /pcrr8t/G enerator.__call__()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 /pcrr8t/Message.get_type()/ptmr8t/, /pcrr8t/Message.get_main_type()/ptmr8t/, /p crr8t/Message.get_subtype()/ptmr8t/, and [602] Underfull \hbox (badness 10000) in paragraph at lines 56391--56395 []/ptmr8t/The fol-low-ing func-tions in the /pcrr8t/email.Utils /ptmr8t/mod-ule have been dep-re-cated: [603] [604] [605] [606] [607] [608] [609] Underfull \hbox (badness 10000) in paragraph at lines 57160--57161 [610] [611] [612] Underfull \hbox (badness 10000) in paragraph at lines 57424--57427 /ptmr8t/Return a /pcrr8t/Maildir /ptmr8t/in-stance rep-re-sent-ing the folder w hose name is /ptmri8t/folder/ptmr8t/. A [613] [614] [615] [616] [617] [618] [619] [620] [621] [622] [623] [624] [625] [626] [627] [628] [629] [630] [631] [632] [633] [634] [635] [636] Underfull \hbox (badness 10000) in paragraph at lines 60389--60393 /ptmr8t/Return a pair /pcrr8t/(full name, email address) /ptmr8t/parsed from th e string re-turned by [637] [638] [639] Overfull \hbox (207.12541pt too wide) in paragraph at lines 60684--60686 [] Underfull \hbox (badness 10000) in paragraph at lines 60705--60706 [640] [641] [642] [643] [644] Chapter 20. [645] [646] [647] [648] Underfull \hbox (badness 10000) in paragraph at lines 61446--61450 /ptmr8t/This method is called to pro-cess un-re-solv-able nu-meric char-ac-ter ref-er-ences. Re-fer to [649] [650] [651] [652] Underfull \hbox (badness 10000) in paragraph at lines 61825--61831 /ptmr8t/Calling this with a true value for /ptmri8t/flag /ptmr8t/(the de-fault) will cause Ex-pat to call the [653] [654] [655] [656] [657] [658] [659] Overfull \hbox (0.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/DOMImplementation| Overfull \hbox (24.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/ProcessingInstruction| [660] Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /ptmr8t/ob-ject: /pcrr8t/ELEMENT_NODE/ptmr8t/, /pcrr8t/ATTRIBUTE_NODE/ptmr8t/, /pcrr8t/TEXT_NODE/ptmr8t/, /pcrr8t/CDATA_SECTION_NODE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /pcrr8t/ENTITY_NODE/ptmr8t/, /pcrr8t/PROCESSING_INSTRUCTION_NODE/ptmr8t/, /pcrr 8t/COMMENT_NODE/ptmr8t/, /pcrr8t/DOCUMENT_NODE/ptmr8t/, [661] [662] [663] [664] [665] [666] Underfull \hbox (badness 10000) in paragraph at lines 63343--63346 /ptmr8t/Exception when a node does not ex-ist in the ref-er-enced con-text. For ex-am-ple, [667] [668] [669] [670] [671] Underfull \hbox (badness 10000) in paragraph at lines 63849--63851 []/pcrr8t/const /ptmr8t/dec-la-ra-tions map to vari-ables in their re-spec-tive scope (e.g. [672] [673] [674] Underfull \hbox (badness 10000) in paragraph at lines 64201--64205 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/lexical-handler" /ptmr8t/ --- data type: Underfull \hbox (badness 10000) in paragraph at lines 64209--64213 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/declaration-handler" /ptm r8t/--- data type: [675] [676] [677] [678] [679] [680] Underfull \hbox (badness 10000) in paragraph at lines 64715--64718 /ptmr8t/Return the cur-rent set-ting for fea-ture /ptmri8t/fea-ture-name/ptmr8t /. If the fea-ture is not rec-og-nized, [681] [682] [683] [684] [685] [686] [687] [688] Chapter 21. [689] [690] [691] [692] [693] [694] [695] [696] [697] [698] [699] Underfull \hbox (badness 7832) in paragraph at lines 66510--66518 []/pcrr8t/Headers /ptmr8t/ob-jects sup-port typ-i-cal map-ping op-er-a-tions in -clud-ing /pcrr8t/__getitem__()/ptmr8t/, /pcrr8t/get()/ptmr8t/, [700] [701] [702] [703] [704] [705] [706] [707] [708] Underfull \hbox (badness 10000) in paragraph at lines 67392--67396 []/ptmr8t/When per-form-ing ba-sic au-then-ti-ca-tion, a /pcrr8t/FancyURLopener /ptmr8t/in-stance calls its [709] [710] [711] Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/An HTTP sta-tus code as de-fined in [][]RFC 2616[][]. This nu-meric val ue Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/cor-re-sponds to a value found in the dic-tio-nary of codes as found in [712] [713] [714] [715] [716] [717] [718] [719] [720] [721] Overfull \hbox (21.13048pt too wide) in paragraph at lines 68986--68987 [][] [722] [723] [724] [725] [726] [727] [728] [729] [730] [731] [732] [733] [734] [735] [736] [737] [738] [739] [740] [741] [742] [743] [744] [745] [746] [747] [748] Underfull \hbox (badness 10000) in paragraph at lines 71611--71615 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type Underfull \hbox (badness 10000) in paragraph at lines 71632--71635 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type [749] [750] [751] [752] [753] [754] [755] [756] [757] [758] [759] [760] Underfull \hbox (badness 10000) in paragraph at lines 72724--72727 []/ptmr8t/A lot of the work, such as pars-ing the re-quest, is done by the base class [761] Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 []/ptmr8t/The /pcrr8t/CGIHTTPServer /ptmr8t/mod-ule de-fines a request-handler class, in-ter-face com-pat-i- Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 /ptmr8t/ble with /pcrr8t/BaseHTTPServer.BaseHTTPRequestHandler /ptmr8t/and in-h er-its be-hav-ior from [762] Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 []/ptmri8t/blocked_domains=None, al-lowed_domains=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/netscape=True, rfc2965=False, rfc2109_as_netscape=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/hide_cookie2=False, strict_domain=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_ns_domain=DefaultCookiePolicy.DomainLiberal, [763] Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /ptmr8t/meth-ods /pcrr8t/get_full_url()/ptmr8t/, /pcrr8t/get_host()/ptmr8t/, /p crr8t/get_type()/ptmr8t/, /pcrr8t/unverifiable()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /pcrr8t/get_origin_req_host()/ptmr8t/, /pcrr8t/has_header()/ptmr8t/, /pcrr8t/ge t_header()/ptmr8t/, /pcrr8t/header_items()/ptmr8t/, and Underfull \hbox (badness 10000) in paragraph at lines 73056--73061 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the meth-ods [764] [765] Underfull \hbox (badness 10000) in paragraph at lines 73206--73207 [766] [767] [768] [769] [770] [771] [772] [773] Overfull \hbox (14.07869pt too wide) in paragraph at lines 74055--74055 []/pcrr8t/floating-point Overfull \hbox (24.99854pt too wide) in paragraph at lines 74055--74056 [][] [774] [775] [776] [777] [778] [779] [780] [781] [782] Underfull \hbox (badness 10000) in paragraph at lines 74788--74788 []/ptmri8t/addr, [re-questHandler, [lo-gRe-quests, [al-low_none, [en-cod-ing, Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /ptmr8t/Create a new server in-stance. All pa-ram-e-ters have the same mean-ing as for Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /pcrr8t/SimpleXMLRPCServer.SimpleXMLRPCServer/ptmr8t/; /ptmri8t/re-questHandler /ptmr8t/de-faults to [783] Overfull \hbox (57.12117pt too wide) in paragraph at lines 74838--74845 /ptmr8t/The /pcrr8t/DocCGIXMLRPCRequestHandler /ptmr8t/class is de-rived from / pcrr8t/SimpleXMLRPCServer.CGIXMLRPCRequestHandler [784] Chapter 22. [785] [786] [787] [788] Underfull \hbox (badness 10000) in paragraph at lines 75257--75258 [789] [790] [791] Underfull \hbox (badness 10000) in paragraph at lines 75632--75634 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, [792] Underfull \hbox (badness 10000) in paragraph at lines 75710--75713 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [793] Underfull \hbox (badness 10000) in paragraph at lines 75829--75831 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, Underfull \hbox (badness 10000) in paragraph at lines 75909--75912 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [794] [795] Underfull \hbox (badness 5475) in paragraph at lines 76102--76105 []/ptmr8t/More in-for-ma-tion about color spaces can be found at [][]http://www .poynton.com/ColorFAQ.html[][] and [796] [797] [798] [799] [800] Underfull \hbox (badness 10000) in paragraph at lines 76718--76722 /ptmr8t/Returns the vol-ume of a given mixer con-trol. The re-turned vol-ume is a 2-tuple [801] [802] Chapter 23. [803] [804] [805] Underfull \hbox (badness 10000) in paragraph at lines 77113--77118 /ptmr8t/The /pcrr8t/gettext /ptmr8t/mod-ule pro-vides one ad-di-tional class de -rived from /pcrr8t/NullTranslations/ptmr8t/: [806] [807] [808] [809] [810] [811] Overfull \hbox (30.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_NUMERIC| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'decimal_point'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'thousands_sep'| Overfull \hbox (36.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_MONETARY| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_curr_symbol'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'currency_symbol'| Overfull \hbox (90.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_cs_precedes/n_cs_precedes'| Overfull \hbox (102.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sep_by_space/n_sep_by_space'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_decimal_point'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_frac_digits'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_thousands_sep'| Overfull \hbox (0.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_grouping'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'positive_sign'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'negative_sign'| Overfull \hbox (66.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sign_posn/n_sign_posn'| Overfull \hbox (24.99313pt too wide) in paragraph at lines 77686--77687 [][] [812] [813] [814] [815] [816] [817] [818] Chapter 24. [819] [820] [821] [822] [823] [824] Chapter 25. [825] [826] [827] [828] [829] [830] [831] [832] Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 []/ptmr8t/This is al-most al-ways the /pcrr8t/set() /ptmr8t/method of some scro ll-bar wid-get, Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 /ptmr8t/but can be any wid-get method that takes a sin-gle ar-gu-ment. Re-fer t o the file [833] [834] [835] [836] [837] [838] [839] [840] [841] [842] [843] [844] [845] [846] [847] [848] Underfull \hbox (badness 10000) in paragraph at lines 81034--81036 [] [849] [850] [851] [852] [853] [854] [855] [856] [857] [858] [859] [860] [861] [862] [863] Overfull \hbox (22.8553pt too wide) in paragraph at lines 82620--82620 []/ptmr8t/planet_and_moon| [864] [865] [866] [867] [868] Chapter 26. [869] [870] [871] [872] [873] [874] [875] Underfull \hbox (badness 10000) in paragraph at lines 83613--83615 /ptmr8t/Changed in ver-sion 2.4: The abil-ity to han-dle a multi-line ex-cep-ti on de-tail, and the [876] Underfull \hbox (badness 10000) in paragraph at lines 83673--83679 /ptmr8t/may go away when Python re-leases prior to 2.4 be-come un-in-ter-est-in g. Un-til then, [877] Overfull \hbox (82.23183pt too wide) in paragraph at lines 83752--83758 [][] Underfull \hbox (badness 10000) in paragraph at lines 83752--83758 [878] Underfull \hbox (badness 10000) in paragraph at lines 83811--83826 /pcrr8t/ELLIPSIS/ptmr8t/, /pcrr8t/IGNORE_EXCEPTION_DETAIL/ptmr8t/, /pcrr8t/REPO RT_UDIFF/ptmr8t/, /pcrr8t/REPORT_CDIFF/ptmr8t/, /pcrr8t/REPORT_NDIFF/ptmr8t/, Underfull \hbox (badness 7064) in paragraph at lines 83828--83833 /ptmr8t/Create a new op-tion flag with a given name, and re-turn the new flag's in-te-ger value. [879] Underfull \hbox (badness 10000) in paragraph at lines 83947--83949 []/ptmr8t/Optional ar-gu-ment /ptmri8t/name /ptmr8t/gives the name of the test; by de-fault, or if /pcrr8t/None/ptmr8t/, [880] [881] [882] [883] [884] [885] [886] [887] [888] [889] Underfull \hbox (badness 6910) in paragraph at lines 84820--84822 []/ptmr8t/For in-for-ma-tion about the con-struc-tor pa-ram-e-ters and meth-ods , see the doc-u-men-ta-tion for [890] [891] [892] [893] [894] [895] Underfull \hbox (badness 10000) in paragraph at lines 85291--85294 []/ptmr8t/will cre-ate a test suite that will run /pcrr8t/WidgetTestCase.testDe faultSize() /ptmr8t/and [896] [897] [898] [899] [900] Underfull \hbox (badness 5288) in paragraph at lines 85844--85853 []/ptmr8t/For ex-am-ple, if you have a mod-ule /pcrr8t/SampleTests /ptmr8t/con- tain-ing a /pcrr8t/TestCase/ptmr8t/-derived class [901] [902] Underfull \hbox (badness 10000) in paragraph at lines 86011--86012 [903] [904] [905] [906] [907] [908] Chapter 27. [909] [910] [911] [912] [913] [914] [915] [916] [917] [918] [919] [920] [921] [922] [923] [924] [925] [926] [927] [928] [929] [930] Chapter 28. [931] Underfull \hbox (badness 10000) in paragraph at lines 88510--88511 [932] [933] Underfull \hbox (badness 6001) in paragraph at lines 88795--88799 []/ptmr8t/On Win-dows NT+, file names are Uni-code na-tively, so no con-ver-sio n is per-formed. [934] [935] [936] [937] [938] [939] [940] Overfull \hbox (33.31012pt too wide) in paragraph at lines 89556--89556 []/pcrr8t/PendingDeprecationWarning| Overfull \hbox (22.45828pt too wide) in paragraph at lines 89625--89626 [][] [941] [942] [943] [944] [945] [946] [947] [948] Underfull \hbox (badness 10000) in paragraph at lines 90328--90332 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.exc_type, sys.exc_ value, [949] Underfull \hbox (badness 10000) in paragraph at lines 90342--90344 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.last_type, sys.las t_value, [950] [951] [952] Underfull \hbox (badness 6575) in paragraph at lines 90629--90631 []/ptmr8t/Instances of class /pcrr8t/_Feature /ptmr8t/have two cor-re-spond-ing meth-ods, /pcrr8t/getOptionalRelease() /ptmr8t/and [953] [954] Underfull \hbox (badness 5592) in paragraph at lines 90832--90835 /ptmr8t/The de-bug-ging flags nec-es-sary for the col-lec-tor to print in-for-m a-tion about a leak-ing pro- [955] Overfull \hbox (6.01671pt too wide) in paragraph at lines 91238--91238 [] /ptmb8t/Notes| Overfull \hbox (0.99947pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/method| Overfull \hbox (2.11691pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/f_exc_traceback| [956] Overfull \vbox (63.69313pt too high) has occurred while \output is active [957] [958] [959] Underfull \hbox (badness 10000) in paragraph at lines 91534--91535 [960] [961] [962] [963] Underfull \hbox (badness 6396) in paragraph at lines 91863--91868 []/ptmr8t/Conversion of an IEEE-754 ex-cep-tion to a Python ex-cep-tion re-quir es that the wrap-per macros [964] [965] [966] Chapter 29. Underfull \hbox (badness 6016) in paragraph at lines 91919--91922 /ptmr8t/Closely em-u-late the be-hav-ior of the in-ter-ac-tive Python in-ter-pr eter. This class builds on Underfull \hbox (badness 10000) in paragraph at lines 91926--91933 /ptmr8t/Convenience func-tion to run a read-eval-print loop. This cre-ates a ne w in-stance of [967] [968] [969] [970] Chapter 30. Underfull \hbox (badness 10000) in paragraph at lines 92169--92170 Overfull \hbox (85.05946pt too wide) in paragraph at lines 92219--92224 /ptmr8t/abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92219--92224 Underfull \hbox (badness 10000) in paragraph at lines 92241--92242 [971] [972] Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /ptmr8t/is /pcrr8t/('audioop', 'array', 'binascii', 'cmath', 'errno', 'imageop' , Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /pcrr8t/'marshal', 'math', 'md5', 'operator', 'parser', 'regex', 'select', Underfull \hbox (badness 10000) in paragraph at lines 92433--92438 /pcrr8t/'readlink', 'stat', 'times', 'uname', 'getpid', 'getppid', 'getcwd', [973] Overfull \hbox (98.94922pt too wide) in paragraph at lines 92499--92504 /ptmr8t/Dis-abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92499--92504 [974] [975] [976] Chapter 31. [977] [978] [979] [980] [981] [982] [983] [984] [985] [986] [987] [988] Chapter 32. [989] [990] [991] [992] [993] [994] [995] [996] [997] [998] [999] [1000] [1001] [1002] [1003] [1004] [1005] [1006] [1007] [1008] [1009] [1010] [1011] [1012] [1013] [1014] [1015] [1016] [1017] [1018] Chapter 33. [1019] [1020] [1021] Overfull \vbox (951.69313pt too high) has occurred while \output is active [1022] [1023] [1024] Chapter 34. [1025] [1026] [1027] [1028] Chapter 35. [1029] Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /ptmr8t/Modify the view, by call-ing /pcrr8t/MsiViewModify/ptmr8t/. /ptmri8t/ki nd /ptmr8t/can be one of Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_SEEK/ptmr8t/, /pcrr8t/MSIMODIFY_REFRESH/ptmr8t/, /pcrr8t/MSIM ODIFY_INSERT/ptmr8t/, /pcrr8t/MSIMODIFY_UPDATE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_ASSIGN/ptmr8t/, /pcrr8t/MSIMODIFY_REPLACE/ptmr8t/, /pcrr8t/MS IMODIFY_MERGE/ptmr8t/, /pcrr8t/MSIMODIFY_DELETE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_INSERT_TEMPORARY/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE_NEW/ptmr8t/, [1030] Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_AUTHOR/ptmr8t/, /pcrr8t/PID_KEYWORDS/ptmr8t/, /pcrr8t/PID_COMMENTS/ ptmr8t/, /pcrr8t/PID_TEMPLATE/ptmr8t/, /pcrr8t/PID_LASTAUTHOR/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_REVNUMBER/ptmr8t/, /pcrr8t/PID_LASTPRINTED/ptmr8t/, /pcrr8t/PID_CRE ATE_DTM/ptmr8t/, /pcrr8t/PID_LASTSAVE_DTM/ptmr8t/, [1031] [1032] [1033] [1034] [1035] [1036] Overfull \hbox (25.00525pt too wide) in paragraph at lines 98491--98492 [][] [1037] Overfull \hbox (43.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_LITTLE_ENDIAN| Overfull \hbox (25.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_BIG_ENDIAN| Overfull \hbox (7.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_RESOURCE_LIST| Overfull \hbox (25.01274pt too wide) in paragraph at lines 98670--98671 [][] [1038] [1039] [1040] [1041] [1042] Chapter 36. [1043] [1044] [1045] Underfull \hbox (badness 10000) in paragraph at lines 99440--99441 [1046] [1047] [1048] [1049] [1050] [1051] [1052] [1053] [1054] [1055] [1056] Underfull \hbox (badness 10000) in paragraph at lines 100685--100688 []/pcrr8t/LOG_EMERG/ptmr8t/, /pcrr8t/LOG_ALERT/ptmr8t/, /pcrr8t/LOG_CRIT/ptmr8t /, /pcrr8t/LOG_ERR/ptmr8t/, /pcrr8t/LOG_WARNING/ptmr8t/, [1057] Underfull \hbox (badness 10000) in paragraph at lines 100721--100722 [1058] Chapter 37. Underfull \hbox (badness 10000) in paragraph at lines 100788--100789 [1059] Underfull \hbox (badness 10000) in paragraph at lines 100926--100927 [1060] Underfull \hbox (badness 10000) in paragraph at lines 101050--101051 [1061] [1062] Underfull \hbox (badness 10000) in paragraph at lines 101165--101166 [1063] [1064] Underfull \hbox (badness 10000) in paragraph at lines 101393--101394 [1065] [1066] [1067] Underfull \hbox (badness 10000) in paragraph at lines 101755--101756 [1068] [1069] [1070] [1071] [1072] Chapter 38. [1073] [1074] Underfull \hbox (badness 10000) in paragraph at lines 102191--102192 Underfull \hbox (badness 10000) in paragraph at lines 102270--102271 [1075] [1076] Underfull \hbox (badness 10000) in paragraph at lines 102420--102421 [1077] [1078] Chapter 39. Underfull \hbox (badness 10000) in paragraph at lines 102638--102639 [1079] [1080] [1081] [1082] Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/audio| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/index| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ptime| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/atime| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/catalog| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ident| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/control| Overfull \hbox (24.99579pt too wide) in paragraph at lines 103137--103138 [][] [1083] [1084] [1085] Underfull \hbox (badness 10000) in paragraph at lines 103421--103425 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103429--103433 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, [1086] Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /ptmr8t/Add a po-si-tioner ob-ject to the form. --- Meth-ods: /pcrr8t/set_posit ioner_xvalue()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_yvalue()/ptmr8t/, /pcrr8t/set_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_ybounds()/ptmr8t/, /pcrr8t/get_positioner_xvalue()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/get_positioner_yvalue()/ptmr8t/, /pcrr8t/get_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103452--103455 /pcrr8t/set_counter_bounds()/ptmr8t/, /pcrr8t/set_counter_step()/ptmr8t/, /pcrr 8t/set_counter_precision()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103471--103475 /pcrr8t/addto_choice()/ptmr8t/, /pcrr8t/replace_choice()/ptmr8t/, /pcrr8t/delet e_choice()/ptmr8t/, /pcrr8t/get_choice_text()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/add_browser_line()/ptmr8t/, /pcrr8t/addto_browser()/ptmr8t/, /pcrr8t/in sert_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/delete_browser_line()/ptmr8t/, /pcrr8t/replace_browser_line()/ptmr8t/, /pcrr8t/get_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/load_browser()/ptmr8t/, /pcrr8t/get_browser_maxline()/ptmr8t/, /pcrr8t/ select_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/deselect_browser_line()/ptmr8t/, /pcrr8t/deselect_browser()/ptmr8t/, /p crr8t/isselected_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/get_browser()/ptmr8t/, /pcrr8t/set_browser_fontsize()/ptmr8t/, /pcrr8t/ set_browser_fontstyle()/ptmr8t/, [1087] [1088] [1089] Underfull \hbox (badness 10000) in paragraph at lines 103939--103940 [1090] [1091] [1092] Overfull \hbox (16.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'forcegray'| Overfull \hbox (4.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'quality'| Overfull \hbox (10.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'optimize'| Overfull \hbox (24.99864pt too wide) in paragraph at lines 104267--104268 [][] Overfull \hbox (74.97656pt too wide) in paragraph at lines 104279--104281 [] [1093] [1094] Chapter 40. [1095] [1096] Chapter 41. Underfull \hbox (badness 10000) in paragraph at lines 104464--104465 Underfull \hbox (badness 10000) in paragraph at lines 104495--104496 Underfull \hbox (badness 10000) in paragraph at lines 104503--104504 Underfull \hbox (badness 10000) in paragraph at lines 104510--104511 [1097] Underfull \hbox (badness 10000) in paragraph at lines 104518--104519 [1098] Underfull \hbox (badness 10000) in paragraph at lines 104636--104637 Underfull \hbox (badness 10000) in paragraph at lines 104654--104655 [1099] [1100] Appendix A. [1101] [1102] [1103] [1104] [1105] [1106] Appendix B. [1107] [1108] Appendix C. [1109] [1110] [1111] [1112] [1113] [1114] [1115] [1116] [1117] [1118] [1119] [1120] Appendix D. No file modlibrary.ind. No file library.ind. [1121] (./library.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc}{/usr/share/texmf/dvips/tetex/aae443f0.enc} Output written on library.pdf (1131 pages, 5833609 bytes). Transcript written on library.log. pdflatex 'library.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./library.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex) (./library.pla)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file library.idx (./library.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./library.out) (./library.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./library.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.109 ...ay bisection algorithm}{147}{section.9.5} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.240 ... with \textbf {bzip2}}{284}{section.13.3} [2] [3] [4] [5] Overfull \hbox (4.49997pt too wide) detected at line 1005 []/ptmr8t/1002 Overfull \hbox (4.49997pt too wide) detected at line 1008 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1009 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1010 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1011 []/ptmr8t/1005 Overfull \hbox (4.49997pt too wide) detected at line 1012 []/ptmr8t/1006 Overfull \hbox (4.49997pt too wide) detected at line 1013 []/ptmr8t/1006 Overfull \hbox (4.49997pt too wide) detected at line 1016 []/ptmr8t/1008 Overfull \hbox (4.49997pt too wide) detected at line 1017 []/ptmr8t/1008 Overfull \hbox (4.49997pt too wide) detected at line 1018 []/ptmr8t/1009 Overfull \hbox (4.49997pt too wide) detected at line 1020 []/ptmr8t/1016 Overfull \hbox (4.49997pt too wide) detected at line 1021 []/ptmr8t/1017 Overfull \hbox (4.49997pt too wide) detected at line 1023 []/ptmr8t/1019 Overfull \hbox (4.49997pt too wide) detected at line 1024 []/ptmr8t/1020 Overfull \hbox (4.49997pt too wide) detected at line 1025 []/ptmr8t/1020 Overfull \hbox (4.49997pt too wide) detected at line 1029 []/ptmr8t/1024 Overfull \hbox (4.49997pt too wide) detected at line 1030 []/ptmr8t/1024 Overfull \hbox (4.49997pt too wide) detected at line 1032 []/ptmr8t/1025 Overfull \hbox (4.49997pt too wide) detected at line 1038 []/ptmr8t/1029 Overfull \hbox (4.49997pt too wide) detected at line 1049 []/ptmr8t/1034 Overfull \hbox (4.49997pt too wide) detected at line 1053 []/ptmr8t/1035 Overfull \hbox (4.49997pt too wide) detected at line 1055 []/ptmr8t/1039 Overfull \hbox (4.49997pt too wide) detected at line 1057 []/ptmr8t/1043 Overfull \hbox (4.49997pt too wide) detected at line 1060 []/ptmr8t/1044 Overfull \hbox (4.49997pt too wide) detected at line 1061 []/ptmr8t/1044 Overfull \hbox (4.49997pt too wide) detected at line 1062 []/ptmr8t/1045 Overfull \hbox (4.49997pt too wide) detected at line 1063 []/ptmr8t/1046 Overfull \hbox (4.49997pt too wide) detected at line 1064 []/ptmr8t/1046 Overfull \hbox (4.49997pt too wide) detected at line 1066 []/ptmr8t/1047 Overfull \hbox (4.49997pt too wide) detected at line 1068 []/ptmr8t/1048 Overfull \hbox (4.49997pt too wide) detected at line 1069 []/ptmr8t/1049 Overfull \hbox (4.49997pt too wide) detected at line 1070 []/ptmr8t/1049 Overfull \hbox (4.49997pt too wide) detected at line 1071 []/ptmr8t/1051 [6] Overfull \hbox (4.49997pt too wide) detected at line 1073 []/ptmr8t/1052 Overfull \hbox (4.49997pt too wide) detected at line 1074 []/ptmr8t/1054 Overfull \hbox (4.49997pt too wide) detected at line 1077 []/ptmr8t/1056 Overfull \hbox (4.49997pt too wide) detected at line 1078 []/ptmr8t/1057 Overfull \hbox (4.49997pt too wide) detected at line 1079 []/ptmr8t/1057 Overfull \hbox (4.49997pt too wide) detected at line 1081 []/ptmr8t/1059 Overfull \hbox (4.49997pt too wide) detected at line 1083 []/ptmr8t/1060 Overfull \hbox (4.49997pt too wide) detected at line 1084 []/ptmr8t/1061 Overfull \hbox (4.49997pt too wide) detected at line 1085 []/ptmr8t/1062 Overfull \hbox (4.49997pt too wide) detected at line 1086 []/ptmr8t/1063 Overfull \hbox (4.49997pt too wide) detected at line 1088 []/ptmr8t/1065 Overfull \hbox (4.49997pt too wide) detected at line 1094 []/ptmr8t/1068 Overfull \hbox (4.49997pt too wide) detected at line 1095 []/ptmr8t/1068 Overfull \hbox (4.49997pt too wide) detected at line 1120 []/ptmr8t/1071 Overfull \hbox (4.49997pt too wide) detected at line 1122 []/ptmr8t/1074 Overfull \hbox (4.49997pt too wide) detected at line 1123 []/ptmr8t/1074 Overfull \hbox (4.49997pt too wide) detected at line 1124 []/ptmr8t/1075 Overfull \hbox (4.49997pt too wide) detected at line 1125 []/ptmr8t/1076 Overfull \hbox (4.49997pt too wide) detected at line 1126 []/ptmr8t/1078 Overfull \hbox (4.49997pt too wide) detected at line 1129 []/ptmr8t/1079 Overfull \hbox (4.49997pt too wide) detected at line 1132 []/ptmr8t/1081 Overfull \hbox (4.49997pt too wide) detected at line 1133 []/ptmr8t/1081 Overfull \hbox (4.49997pt too wide) detected at line 1136 []/ptmr8t/1084 Overfull \hbox (4.49997pt too wide) detected at line 1140 []/ptmr8t/1088 Overfull \hbox (4.49997pt too wide) detected at line 1141 []/ptmr8t/1089 Overfull \hbox (4.49997pt too wide) detected at line 1142 []/ptmr8t/1089 Overfull \hbox (4.49997pt too wide) detected at line 1143 []/ptmr8t/1090 Overfull \hbox (4.49997pt too wide) detected at line 1144 []/ptmr8t/1091 Overfull \hbox (4.49997pt too wide) detected at line 1145 []/ptmr8t/1091 Overfull \hbox (4.49997pt too wide) detected at line 1146 []/ptmr8t/1092 Overfull \hbox (4.49997pt too wide) detected at line 1147 []/ptmr8t/1092 Overfull \hbox (4.49997pt too wide) detected at line 1149 []/ptmr8t/1095 Overfull \hbox (4.49997pt too wide) detected at line 1151 []/ptmr8t/1096 Overfull \hbox (4.49997pt too wide) detected at line 1153 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1154 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1155 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1156 []/ptmr8t/1098 Overfull \hbox (4.49997pt too wide) detected at line 1167 []/ptmr8t/1099 Overfull \hbox (4.49997pt too wide) detected at line 1168 []/ptmr8t/1099 Overfull \hbox (4.49997pt too wide) detected at line 1171 []/ptmr8t/1107 Overfull \hbox (4.49997pt too wide) detected at line 1173 []/ptmr8t/1109 Overfull \hbox (4.49997pt too wide) detected at line 1174 []/ptmr8t/1110 Overfull \hbox (4.49997pt too wide) detected at line 1175 []/ptmr8t/1113 [7]) [8] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [2] Chapter 1. ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.188 \hypertarget{built-in-funcs}{}\chapter {Built-in Functions} [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.188 \hypertarget{built-in-funcs}{}\chapter {Built-in Functions} [4] Chapter 2. ! pdfTeX warning (ext4): destination with the same identifier (name{page.5}) ha s been already used, duplicate ignored \penalty l.267 \end{funcdesc} [5] ! pdfTeX warning (ext4): destination with the same identifier (name{page.6}) ha s been already used, duplicate ignored \penalty l.358 [6] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.7}) ha s been already used, duplicate ignored \penalty l.451 ...plex numbers is deprecated.\end{funcdesc} [7] ! pdfTeX warning (ext4): destination with the same identifier (name{page.8}) ha s been already used, duplicate ignored \penalty l.532 \end{notice} [8] [9] Underfull \hbox (badness 10000) in paragraph at lines 658--659 [10] Underfull \hbox (badness 10000) in paragraph at lines 746--747 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 3. [21] [22] Chapter 4. [23] [24] Chapter 5. [25] [26] Chapter 6. [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] Overfull \hbox (8.3441pt too wide) in paragraph at lines 3183--3183 [] /ptmb8t/Notes| [38] Overfull \hbox (7.72594pt too wide) in paragraph at lines 3375--3375 []/ptmr8t/(7)(8)(9)(10)| [39] [40] Underfull \hbox (badness 10000) in paragraph at lines 3558--3564 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and [41] Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 []/ptmr8t/Note, the non-operator ver-sions of the /pcrr8t/update()/ptmr8t/, /pc rr8t/intersection_update()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 /pcrr8t/difference_update()/ptmr8t/, and /pcrr8t/symmetric_difference_update() /ptmr8t/meth-ods will ac-cept [42] [43] [44] [45] [46] Underfull \hbox (badness 6944) in paragraph at lines 4192--4198 []/ptmr8t/An ex-am-ple of a con-text man-ager that re-turns a re-lated ob-ject is the one re-turned by [47] [48] [49] [50] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 4492--4495 /ptmr8t/The base class for all built-in ex-cep-tions ex-cept /pcrr8t/StopIterat ion/ptmr8t/, /pcrr8t/GeneratorExit/ptmr8t/, [51] [52] [53] [54] [55] [56] Chapter 8. [57] [58] Overfull \hbox (166.23189pt too wide) in paragraph at lines 5141--5148 [][] Underfull \hbox (badness 10000) in paragraph at lines 5141--5148 [59] Overfull \hbox (172.23183pt too wide) in paragraph at lines 5252--5260 [][] Underfull \hbox (badness 10000) in paragraph at lines 5252--5260 [60] Overfull \hbox (49.99875pt too wide) in paragraph at lines 5306--5307 [][] Overfull \hbox (50.00552pt too wide) in paragraph at lines 5345--5346 [][] Overfull \hbox (2.46297pt too wide) in paragraph at lines 5426--5426 [] /ptmb8t/Type| Overfull \hbox (1.29306pt too wide) in paragraph at lines 5426--5426 []/ptmr8t/None| Overfull \hbox (49.99658pt too wide) in paragraph at lines 5426--5427 [][] Overfull \hbox (6.8293pt too wide) in paragraph at lines 5499--5499 [] /ptmb8t/Type| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'e'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'E'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'f'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'F'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'g'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'G'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'n'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'%'| Overfull \hbox (5.6594pt too wide) in paragraph at lines 5499--5499 []/ptmr8t/None| Overfull \hbox (50.00784pt too wide) in paragraph at lines 5499--5500 [][] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 []/ptmb8t/Note: /ptmr8t/The fol-low-ing ap-plies only to reg-u-lar ex-pres-sio n ob-jects like those cre-ated with Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 /pcrr8t/re.compile("pattern")/ptmr8t/, not the prim-i-tives /pcrr8t/re.match(pa ttern, string) /ptmr8t/or [78] [79] [80] [81] [82] Underfull \hbox (badness 10000) in paragraph at lines 7604--7606 /ptmr8t/Identical to the /pcrr8t/unpack_from() /ptmr8t/func-tion, us-ing the co m-piled for-mat. [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] Underfull \hbox (badness 10000) in paragraph at lines 8915--8918 []/ptmr8t/Decoding and trans-lat-ing works sim-i-lar, ex-cept /pcrr8t/UnicodeDe codeError /ptmr8t/or [97] [98] Overfull \hbox (52.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'xmlcharrefreplace'| Overfull \hbox (46.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'backslashreplace'| [99] [100] [101] [102] [103] Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jis_2004| Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jisx0213| Overfull \hbox (2.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_1| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2| Overfull \hbox (27.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2004| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_3| Overfull \hbox (19.87584pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_ext| Overfull \hbox (3.35597pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_kr| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_10| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_13| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_14| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_15| Overfull \hbox (8.19551pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_cyrillic| Overfull \hbox (2.22585pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_greek| Overfull \hbox (8.89561pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_iceland| Overfull \hbox (2.79562pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_latin2| Overfull \hbox (5.5658pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_roman| Overfull \hbox (7.79564pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_turkish| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jis_2004| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jisx0213| [104] Overfull \vbox (459.69313pt too high) has occurred while \output is active [105] Overfull \hbox (11.3528pt too wide) in paragraph at lines 10484--10484 [] /ptmb8t/Operand Overfull \hbox (18.4786pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/base64_codec| Overfull \hbox (5.14877pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/bz2_codec| Overfull \hbox (4.99887pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/hex_codec| Overfull \hbox (1.81868pt too wide) in paragraph at lines 10484--10484 /ptmr8t/pri_codec| Overfull \hbox (45.5384pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/raw_unicode_escape| Overfull \hbox (16.8183pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/string_escape| Overfull \hbox (12.91855pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_escape| Overfull \hbox (16.8184pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_internal| Overfull \hbox (0.70883pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/uu_codec| Overfull \hbox (5.70856pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/zlib_codec| (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [106] [107] [108] [109] [110] Chapter 9. [111] [112] Underfull \hbox (badness 10000) in paragraph at lines 11110--11112 /ptmr8t/The most pos-i-tive /pcrr8t/timedelta /ptmr8t/ob-ject, /pcrr8t/timedelt a(days=999999999, hours=23, Underfull \hbox (badness 10000) in paragraph at lines 11116--11118 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/timede lta /ptmr8t/ob-jects, [113] [114] Overfull \hbox (20.67915pt too wide) in paragraph at lines 11394--11395 [][] Underfull \hbox (badness 7362) in paragraph at lines 11400--11405 /pcrr8t/< 0/ptmr8t/. Af-ter-ward /pcrr8t/date2 - date1 == timedelta.days/ptmr8t /. /pcrr8t/timedelta.seconds /ptmr8t/and Underfull \hbox (badness 10000) in paragraph at lines 11443--11447 /pcrr8t/d.month, d.day, 0, 0, 0, d.weekday(), d.toordinal() - date(d.year, 1, [115] Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /ptmr8t/Return a string rep-re-sent-ing the date, for ex-am-ple /pcrr8t/date(20 02, 12, Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /pcrr8t/4).ctime() == 'Wed Dec 4 00:00:00 2002'/ptmr8t/. /pcrr8t/d.ctime() /ptm r8t/is equiv-a-lent to [116] Underfull \hbox (badness 10000) in paragraph at lines 11615--11618 /ptmr8t/Return the cur-rent lo-cal date-time, with /pcrr8t/tzinfo None/ptmr8t/. This is equiv-a-lent to [117] Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the cur-rent date Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 /ptmr8t/and time are con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this cas e the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the times- Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 /ptmr8t/tamp is con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this case the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11713--11715 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/dateti me /ptmr8t/ob-jects, [118] Underfull \hbox (badness 5652) in paragraph at lines 11796--11802 []/ptmr8t/datetime2 is a du-ra-tion of timedelta re-moved from date-time1, mov- ing for-ward in time if [119] Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /ptmr8t/equiv-a-lent to /pcrr8t/time.struct_time((d.year, d.month, d.day, d.hou r, d.minute, Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /pcrr8t/d.second, d.weekday(), d.toordinal() - date(d.year, 1, 1).toordinal() + [120] Underfull \hbox (badness 6592) in paragraph at lines 11961--11967 []/ptmr8t/If /ptmri8t/d /ptmr8t/is aware, /ptmri8t/d /ptmr8t/is nor-mal-ized to UTC time, by sub-tract-ing /pcrr8t/d.utcoffset()/ptmr8t/, and a Underfull \hbox (badness 10000) in paragraph at lines 11990--11992 /ptmr8t/Return a 3-tuple, (ISO year, ISO week num-ber, ISO week-day). The same as Underfull \hbox (badness 10000) in paragraph at lines 11996--11999 /ptmr8t/Return a string rep-re-sent-ing the date and time in ISO 8601 for-mat, YYYY-MM- Underfull \hbox (badness 7238) in paragraph at lines 12026--12031 /ptmr8t/Return a string rep-re-sent-ing the date and time, for ex-am-ple /pcrr8 t/datetime(2002, 12, 4, [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] Overfull \hbox (11.12794pt too wide) in paragraph at lines 12942--12942 [] /ptmb8t/Notes| [131] [132] [133] [134] Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Container| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Hashable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterator| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Callable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Sequence| Overfull \hbox (55.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSequence| Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSet| Overfull \hbox (7.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Mapping| Overfull \hbox (49.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableMapping| Overfull \hbox (31.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/KeysView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ItemsView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ValuesView| Overfull \hbox (11.87897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] Underfull \hbox (badness 10000) in paragraph at lines 14902--14916 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and Overfull \hbox (44.79945pt too wide) in paragraph at lines 15021--15021 []/pcrr8t/s.symmetric_difference_update(t)| [151] [152] [153] [154] [155] Underfull \hbox (badness 5637) in paragraph at lines 15375--15378 []/ptmr8t/The low-est val-ued en-tries are re-trieved first (the low-est val-ue d en-try is the one re-turned [156] [157] [158] [159] [160] Underfull \hbox (badness 7308) in paragraph at lines 15883--15885 []/ptmr8t/In ad-di-tion to the four base meth-ods, pro-gres-sively more ef-fi-c iency comes with defin-ing [161] [162] [163] [164] Underfull \hbox (badness 10000) in paragraph at lines 16238--16244 /ptmr8t/The type of ob-jects de-fined in ex-ten-sion mod-ules with /pcrr8t/PyMe mberDef/ptmr8t/, such as [165] [166] [167] [168] [169] [170] Chapter 10. [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205] [206] [207] [208] [209] [210] [211] [212] [213] [214] [215] [216] [217] [218] [219] [220] [221] [222] [223] [224] Chapter 11. [225] [226] [227] [228] Underfull \hbox (badness 10000) in paragraph at lines 22021--22022 Overfull \hbox (64.2315pt too wide) in paragraph at lines 22040--22042 []/ptmr8t/Usage ex-am-ple: /pcrr8t/fi = fileinput.FileInput(openhook=fileinput. hook_encoded("iso-8859-1")) [229] [230] [231] [232] [233] Underfull \hbox (badness 10000) in paragraph at lines 22481--22481 []/ptmri8t/[mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [dir=None, Underfull \hbox (badness 10000) in paragraph at lines 22497--22497 []/ptmri8t/[max_size=0, [mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [234] [235] [236] [237] [238] [239] [240] [241] [242] Chapter 12. [243] Underfull \hbox (badness 10000) in paragraph at lines 23276--23277 [244] [245] [246] [247] [248] [249] [250] [251] [252] [253] Underfull \hbox (badness 10000) in paragraph at lines 24198--24205 /ptmr8t/A sub-class of /pcrr8t/Shelf /ptmr8t/which ex-poses /pcrr8t/first()/ptm r8t/, /pcrr8t/next()/ptmr8t/, /pcrr8t/previous()/ptmr8t/, /pcrr8t/last() /ptmr8 t/and [254] [255] Underfull \hbox (badness 10000) in paragraph at lines 24322--24323 Underfull \hbox (badness 10000) in paragraph at lines 24342--24343 [256] [257] [258] Overfull \hbox (17.53752pt too wide) in paragraph at lines 24736--24737 [][] [259] [260] [261] [262] [263] [264] [265] [266] [267] [268] [269] [270] [271] [272] [273] [274] [275] Underfull \hbox (badness 10000) in paragraph at lines 26265--26269 []/ptmr8t/The /pcrr8t/sqlite3 /ptmr8t/mod-ule has two de-fault adapters for Pyt hon's built-in /pcrr8t/datetime.date /ptmr8t/and [276] [277] [278] Underfull \hbox (badness 5288) in paragraph at lines 26449--26456 /ptmr8t/Using the non-stan-dard /pcrr8t/execute()/ptmr8t/, /pcrr8t/executemany( ) /ptmr8t/and /pcrr8t/executescript() /ptmr8t/meth-ods of the [279] [280] Chapter 13. [281] [282] [283] [284] Underfull \hbox (badness 10000) in paragraph at lines 27001--27004 /ptmr8t/Sequential com-pres-sion and de-com-pres-sion is done us-ing the classe s /pcrr8t/BZ2Compressor /ptmr8t/and [285] [286] [287] [288] [289] [290] [291] Underfull \hbox (badness 10000) in paragraph at lines 27745--27747 /ptmr8t/Is raised for /ptmri8t/non-fatal /ptmr8t/er-rors when us-ing /pcrr8t/Ta rFile.extract()/ptmr8t/, but only if [292] [293] Underfull \hbox (badness 10000) in paragraph at lines 28009--28012 []/pcrr8t/TarInfo /ptmr8t/ob-jects are re-turned by /pcrr8t/TarFile/ptmr8t/`s m eth-ods /pcrr8t/getmember()/ptmr8t/, /pcrr8t/getmembers() /ptmr8t/and [294] [295] [296] Underfull \hbox (badness 10000) in paragraph at lines 28265--28274 []/ptmr8t/The de-fault value for /ptmri8t/en-cod-ing /ptmr8t/is the lo-cal char -ac-ter en-cod-ing. It is de-duced from [297] [298] Chapter 14. [299] [300] Underfull \hbox (badness 10000) in paragraph at lines 28460--28460 []/ptmri8t/csvfile, field-names, [rest-val='', [ex-trasac-tion='raise', [di-ale ct='excel', [*args, [301] [302] [303] [304] [305] Underfull \hbox (badness 10000) in paragraph at lines 28879--28880 [306] Underfull \hbox (badness 6526) in paragraph at lines 28976--28978 /ptmr8t/Exception raised when an op-tion ref-er-enced from a value does not ex- ist. Sub-class of [307] [308] [309] [310] [311] [312] [313] [314] Overfull \hbox (15.7865pt too wide) in paragraph at lines 29730--29731 [] [315] [316] Chapter 15. Underfull \hbox (badness 10000) in paragraph at lines 29863--29864 [317] [318] [319] [320] Chapter 16. [321] [322] [323] Underfull \hbox (badness 10000) in paragraph at lines 30607--30612 /ptmr8t/Execute /ptmri8t/cmd /ptmr8t/as a sub-process and re-turn the file ob-j ects /pcrr8t/(child_stdin, [324] [325] Underfull \hbox (badness 10000) in paragraph at lines 30725--30729 []/ptmr8t/If you're start-ing with a Python file ob-ject /ptmri8t/f/ptmr8t/, fi rst do /pcrr8t/f.flush()/ptmr8t/, and then do [326] [327] [328] [329] [330] [331] Underfull \hbox (badness 10000) in paragraph at lines 31411--31412 Underfull \hbox (badness 10000) in paragraph at lines 31427--31428 [332] [333] [334] [335] [336] [337] [338] [339] [340] Underfull \hbox (badness 5741) in paragraph at lines 32229--32235 []/pcrr8t/BufferedIOBase /ptmr8t/deals with buffer-ing on a raw byte stream (/p crr8t/RawIOBase/ptmr8t/). Its sub-classes, [341] [342] [343] [344] [345] [346] Underfull \hbox (badness 10000) in paragraph at lines 32946--32948 /ptmr8t/A helper codec that de-codes new-lines for uni-ver-sal new-lines mode. It in-her-its [347] [348] Overfull \hbox (11.12794pt too wide) in paragraph at lines 33384--33384 [] /ptmb8t/Notes| Overfull \hbox (25.01363pt too wide) in paragraph at lines 33384--33385 [][] [349] [350] [351] [352] [353] Underfull \hbox (badness 10000) in paragraph at lines 33777--33781 []/pcrr8t/"-v" /ptmr8t/and /pcrr8t/"--report" /ptmr8t/are both op-tions. As-sum -ing that /pcrro8t/--report /ptmr8t/takes one ar-gu-ment, [354] [355] [356] [357] Underfull \hbox (badness 5652) in paragraph at lines 34102--34105 []/ptmr8t/If /pcrr8t/optparse /ptmr8t/en-coun-ters ei-ther /pcrr8t/"-h" /ptmr8t /or /pcrr8t/"--help" /ptmr8t/on the command-line, or if you just call [358] [359] [360] [361] Underfull \hbox (badness 5203) in paragraph at lines 34386--34389 /ptmr8t/There are sev-eral ways to pop-u-late the parser with op-tions. The pre -ferred way is by us-ing [362] [363] [364] [365] [366] [367] Underfull \hbox (badness 10000) in paragraph at lines 34976--34977 []/ptmr8t/assume op-tion con-flicts are a pro-gram-ming er-ror and raise [368] [369] [370] [371] [372] [373] Underfull \hbox (badness 10000) in paragraph at lines 35426--35431 []/ptmr8t/Your type-checking func-tion should raise /pcrr8t/OptionValueError /p tmr8t/if it en-coun-ters any prob-lems. [374] [375] [376] [377] [378] [379] [380] Underfull \hbox (badness 10000) in paragraph at lines 35997--36006 []/pcrr8t/Logger.debug()/ptmr8t/, /pcrr8t/Logger.info()/ptmr8t/, /pcrr8t/Logger .warning()/ptmr8t/, /pcrr8t/Logger.error()/ptmr8t/, and [381] [382] [383] [384] Underfull \hbox (badness 5403) in paragraph at lines 36345--36348 []/pcrr8t/BaseRotatingHandler /ptmr8t/is the base class for han-dlers that ro-t ate log files at a cer-tain [385] [386] Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filename| Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filemode| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/format| Overfull \hbox (10.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/datefmt| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/stream| Overfull \hbox (25.01265pt too wide) in paragraph at lines 36623--36624 [][] [387] [388] [389] [390] Overfull \hbox (3.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(name)s| Overfull \hbox (33.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(levelname)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(asctime)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(message)s| [391] [392] [393] [394] [395] [396] [397] [398] Underfull \hbox (badness 6001) in paragraph at lines 37574--37574 []/ptmri8t/filename, [when, [in-ter-val, [back-up-Count, [en-cod-ing, [de-lay, [399] Underfull \hbox (badness 5245) in paragraph at lines 37722--37724 /ptmr8t/The fac-tory method of /pcrr8t/SocketHandler /ptmr8t/is here over-rid-d en to cre-ate a UDP socket [400] [401] [402] Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelno)s| Overfull \hbox (16.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(pathname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(filename)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(funcName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(created)f| Overfull \hbox (52.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(relativeCreated)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(asctime)s| Overfull \hbox (22.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(threadName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(process)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(message)s| Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/Formats the spec-i-fied ex-cep-tion in-for-ma-tion (a stan-dard ex-cep- tion tu-ple as re- Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/turned by /pcrr8t/sys.exc_info()/ptmr8t/) as a string. This de-fault im -ple-men-ta-tion just uses [403] [404] [405] [406] [407] [408] [409] [410] [411] [412] [413] [414] [415] [416] Underfull \hbox (badness 10000) in paragraph at lines 39269--39270 [417] [418] [419] [420] [421] [422] Overfull \vbox (435.69313pt too high) has occurred while \output is active [423] [424] [425] [426] [427] [428] [429] [430] [431] [432] [433] [434] [435] [436] [437] [438] [439] [440] Overfull \hbox (28.77098pt too wide) in paragraph at lines 42666--42667 [][] [441] [442] [443] [444] [445] [446] [447] [448] [449] [450] [451] [452] [453] [454] [455] [456] [457] [458] [459] [460] [461] [462] Underfull \hbox (badness 7221) in paragraph at lines 44332--44335 []/ptmr8t/The ex-act func-tion-al-ity is sys-tem de-pen-dent. Changed in ver-si on 2.6: Win-dows only: [463] [464] [465] [466] [467] [468] [469] [470] Chapter 17. [471] Overfull \hbox (14.31891pt too wide) in paragraph at lines 45106--45107 [][] [472] [473] [474] [475] [476] [477] [478] [479] [480] [481] [482] [483] [484] Underfull \hbox (badness 10000) in paragraph at lines 46585--46586 [485] [486] [487] Underfull \hbox (badness 10000) in paragraph at lines 46788--46791 []/ptmr8t/For more flex-i-bil-ity in us-ing shared mem-ory one can use the [488] [489] [490] Underfull \hbox (badness 10000) in paragraph at lines 47072--47073 Underfull \hbox (badness 10000) in paragraph at lines 47086--47087 [491] [492] [493] Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 []/ptmb8t/Note: /pcrr8t/multiprocessing /ptmr8t/con-tains no ana-logues of /pc rr8t/threading.active_count()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 /pcrr8t/threading.enumerate()/ptmr8t/, /pcrr8t/threading.settrace()/ptmr8t/, /p crr8t/threading.setprofile()/ptmr8t/, [494] Underfull \hbox (badness 10000) in paragraph at lines 47418--47419 Underfull \hbox (badness 10000) in paragraph at lines 47424--47425 [495] Underfull \hbox (badness 5417) in paragraph at lines 47485--47491 []/ptmb8t/Note: /ptmr8t/If the SIG-INT sig-nal gen-er-ated by Ctrl-C ar-rives while the main thread is blocked Underfull \hbox (badness 10000) in paragraph at lines 47485--47491 /ptmr8t/by a call to /pcrr8t/BoundedSemaphore.acquire()/ptmr8t/, /pcrr8t/Lock.a cquire()/ptmr8t/, /pcrr8t/RLock.acquire()/ptmr8t/, [496] [497] [498] [499] [500] [501] [502] [503] [504] [505] [506] Underfull \hbox (badness 8113) in paragraph at lines 48556--48563 []/ptmr8t/If au-then-ti-ca-tion is re-quested but do au-then-ti-ca-tion key is spec-i-fied then the re-turn value of [507] [508] [509] [510] [511] [512] [513] [514] [515] [516] [517] [518] [519] [520] [521] [522] [523] [524] [525] [526] [527] [528] [529] [530] [531] [532] [533] [534] [535] [536] [537] [538] [539] [540] [541] [542] Chapter 18. Underfull \hbox (badness 10000) in paragraph at lines 50912--50912 /ptmri8t/close_fds=False, shell=False, cwd=None, env=None, uni-ver-sal_newlines =False, star- [543] [544] [545] Underfull \hbox (badness 10000) in paragraph at lines 51134--51139 []/ptmb8t/Warning: /ptmr8t/Use /pcrr8t/communicate() /ptmr8t/rather than /pcrr 8t/stdin.write()/ptmr8t/, /pcrr8t/stdout.read() /ptmr8t/or [546] [547] [548] [549] [550] Underfull \hbox (badness 10000) in paragraph at lines 51621--51625 []/ptmr8t/If you want to know the cur-rent ma-chine's IP ad-dress, you may want to use [551] [552] [553] [554] [555] [556] [557] [558] Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 []/ptmri8t/sock, key-file=None, cert-file=None, server_side=False, cert_reqs=CE RT_NONE, Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 /ptmri8t/ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True, s up- [559] [560] [561] [562] [563] [564] Overfull \hbox (9.78795pt too wide) in paragraph at lines 52919--52920 [] [565] [566] Underfull \hbox (badness 6047) in paragraph at lines 53085--53090 /ptmr8t/Sets given in-ter-val timer (one of /pcrr8t/signal.ITIMER_REAL/ptmr8t/, /pcrr8t/signal.ITIMER_VIRTUAL /ptmr8t/or [567] [568] [569] [570] [571] [572] [573] [574] Overfull \hbox (13.83913pt too wide) in paragraph at lines 53859--53860 [][] [575] [576] Chapter 19. [577] [578] [579] [580] [581] [582] [583] [584] Underfull \hbox (badness 10000) in paragraph at lines 54859--54863 []/ptmr8t/As a con-ve-nience, see the meth-ods /pcrr8t/Message.as_string() /ptm r8t/and /pcrr8t/str(aMessage)/ptmr8t/, a.k.a. [585] [586] [587] [588] [589] [590] [591] [592] [593] [594] Underfull \hbox (badness 10000) in paragraph at lines 55801--55807 /ptmr8t/Changed in ver-sion 2.4: The /pcrr8t/dump_address_pair() /ptmr8t/func-t ion has been re-moved; use [595] [596] [597] [598] [599] [600] Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 []/ptmr8t/Methods that were dep-re-cated in ver-sion 3 have been re-moved. Thes e in-clude Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 /pcrr8t/Generator.__call__()/ptmr8t/, /pcrr8t/Message.get_type()/ptmr8t/, /pcrr 8t/Message.get_main_type()/ptmr8t/, [601] Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 []/ptmr8t/New /pcrr8t/DeprecationWarning/ptmr8t/s have been added to: /pcrr8t/G enerator.__call__()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 /pcrr8t/Message.get_type()/ptmr8t/, /pcrr8t/Message.get_main_type()/ptmr8t/, /p crr8t/Message.get_subtype()/ptmr8t/, and [602] Underfull \hbox (badness 10000) in paragraph at lines 56391--56395 []/ptmr8t/The fol-low-ing func-tions in the /pcrr8t/email.Utils /ptmr8t/mod-ule have been dep-re-cated: [603] [604] [605] [606] [607] [608] [609] Underfull \hbox (badness 10000) in paragraph at lines 57160--57161 [610] [611] [612] Underfull \hbox (badness 10000) in paragraph at lines 57424--57427 /ptmr8t/Return a /pcrr8t/Maildir /ptmr8t/in-stance rep-re-sent-ing the folder w hose name is /ptmri8t/folder/ptmr8t/. A [613] [614] [615] [616] [617] [618] [619] [620] [621] [622] [623] [624] [625] [626] [627] [628] [629] [630] [631] [632] [633] [634] [635] [636] Underfull \hbox (badness 10000) in paragraph at lines 60389--60393 /ptmr8t/Return a pair /pcrr8t/(full name, email address) /ptmr8t/parsed from th e string re-turned by [637] [638] [639] Overfull \hbox (207.12541pt too wide) in paragraph at lines 60684--60686 [] Underfull \hbox (badness 10000) in paragraph at lines 60705--60706 [640] [641] [642] [643] [644] Chapter 20. [645] [646] [647] [648] Underfull \hbox (badness 10000) in paragraph at lines 61446--61450 /ptmr8t/This method is called to pro-cess un-re-solv-able nu-meric char-ac-ter ref-er-ences. Re-fer to [649] [650] [651] [652] Underfull \hbox (badness 10000) in paragraph at lines 61825--61831 /ptmr8t/Calling this with a true value for /ptmri8t/flag /ptmr8t/(the de-fault) will cause Ex-pat to call the [653] [654] [655] [656] [657] [658] [659] Overfull \hbox (0.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/DOMImplementation| Overfull \hbox (24.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/ProcessingInstruction| [660] Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /ptmr8t/ob-ject: /pcrr8t/ELEMENT_NODE/ptmr8t/, /pcrr8t/ATTRIBUTE_NODE/ptmr8t/, /pcrr8t/TEXT_NODE/ptmr8t/, /pcrr8t/CDATA_SECTION_NODE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /pcrr8t/ENTITY_NODE/ptmr8t/, /pcrr8t/PROCESSING_INSTRUCTION_NODE/ptmr8t/, /pcrr 8t/COMMENT_NODE/ptmr8t/, /pcrr8t/DOCUMENT_NODE/ptmr8t/, [661] [662] [663] [664] [665] [666] Underfull \hbox (badness 10000) in paragraph at lines 63343--63346 /ptmr8t/Exception when a node does not ex-ist in the ref-er-enced con-text. For ex-am-ple, [667] [668] [669] [670] [671] Underfull \hbox (badness 10000) in paragraph at lines 63849--63851 []/pcrr8t/const /ptmr8t/dec-la-ra-tions map to vari-ables in their re-spec-tive scope (e.g. [672] [673] [674] Underfull \hbox (badness 10000) in paragraph at lines 64201--64205 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/lexical-handler" /ptmr8t/ --- data type: Underfull \hbox (badness 10000) in paragraph at lines 64209--64213 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/declaration-handler" /ptm r8t/--- data type: [675] [676] [677] [678] [679] [680] Underfull \hbox (badness 10000) in paragraph at lines 64715--64718 /ptmr8t/Return the cur-rent set-ting for fea-ture /ptmri8t/fea-ture-name/ptmr8t /. If the fea-ture is not rec-og-nized, [681] [682] [683] [684] [685] [686] [687] [688] Chapter 21. [689] [690] [691] [692] [693] [694] [695] [696] [697] [698] [699] Underfull \hbox (badness 7832) in paragraph at lines 66510--66518 []/pcrr8t/Headers /ptmr8t/ob-jects sup-port typ-i-cal map-ping op-er-a-tions in -clud-ing /pcrr8t/__getitem__()/ptmr8t/, /pcrr8t/get()/ptmr8t/, [700] [701] [702] [703] [704] [705] [706] [707] [708] Underfull \hbox (badness 10000) in paragraph at lines 67392--67396 []/ptmr8t/When per-form-ing ba-sic au-then-ti-ca-tion, a /pcrr8t/FancyURLopener /ptmr8t/in-stance calls its [709] [710] [711] Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/An HTTP sta-tus code as de-fined in [][]RFC 2616[][]. This nu-meric val ue Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/cor-re-sponds to a value found in the dic-tio-nary of codes as found in [712] [713] [714] [715] [716] [717] [718] [719] [720] [721] Overfull \hbox (21.13048pt too wide) in paragraph at lines 68986--68987 [][] [722] [723] [724] [725] [726] [727] [728] [729] [730] [731] [732] [733] [734] [735] [736] [737] [738] [739] [740] [741] [742] [743] [744] [745] [746] [747] [748] Underfull \hbox (badness 10000) in paragraph at lines 71611--71615 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type Underfull \hbox (badness 10000) in paragraph at lines 71632--71635 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type [749] [750] [751] [752] [753] [754] [755] [756] [757] [758] [759] [760] Underfull \hbox (badness 10000) in paragraph at lines 72724--72727 []/ptmr8t/A lot of the work, such as pars-ing the re-quest, is done by the base class [761] Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 []/ptmr8t/The /pcrr8t/CGIHTTPServer /ptmr8t/mod-ule de-fines a request-handler class, in-ter-face com-pat-i- Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 /ptmr8t/ble with /pcrr8t/BaseHTTPServer.BaseHTTPRequestHandler /ptmr8t/and in-h er-its be-hav-ior from [762] Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 []/ptmri8t/blocked_domains=None, al-lowed_domains=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/netscape=True, rfc2965=False, rfc2109_as_netscape=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/hide_cookie2=False, strict_domain=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_ns_domain=DefaultCookiePolicy.DomainLiberal, [763] Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /ptmr8t/meth-ods /pcrr8t/get_full_url()/ptmr8t/, /pcrr8t/get_host()/ptmr8t/, /p crr8t/get_type()/ptmr8t/, /pcrr8t/unverifiable()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /pcrr8t/get_origin_req_host()/ptmr8t/, /pcrr8t/has_header()/ptmr8t/, /pcrr8t/ge t_header()/ptmr8t/, /pcrr8t/header_items()/ptmr8t/, and Underfull \hbox (badness 10000) in paragraph at lines 73056--73061 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the meth-ods [764] [765] Underfull \hbox (badness 10000) in paragraph at lines 73206--73207 [766] [767] [768] [769] [770] [771] [772] [773] Overfull \hbox (14.07869pt too wide) in paragraph at lines 74055--74055 []/pcrr8t/floating-point Overfull \hbox (24.99854pt too wide) in paragraph at lines 74055--74056 [][] [774] [775] [776] [777] [778] [779] [780] [781] [782] Underfull \hbox (badness 10000) in paragraph at lines 74788--74788 []/ptmri8t/addr, [re-questHandler, [lo-gRe-quests, [al-low_none, [en-cod-ing, Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /ptmr8t/Create a new server in-stance. All pa-ram-e-ters have the same mean-ing as for Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /pcrr8t/SimpleXMLRPCServer.SimpleXMLRPCServer/ptmr8t/; /ptmri8t/re-questHandler /ptmr8t/de-faults to [783] Overfull \hbox (57.12117pt too wide) in paragraph at lines 74838--74845 /ptmr8t/The /pcrr8t/DocCGIXMLRPCRequestHandler /ptmr8t/class is de-rived from / pcrr8t/SimpleXMLRPCServer.CGIXMLRPCRequestHandler [784] Chapter 22. [785] [786] [787] [788] Underfull \hbox (badness 10000) in paragraph at lines 75257--75258 [789] [790] [791] Underfull \hbox (badness 10000) in paragraph at lines 75632--75634 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, [792] Underfull \hbox (badness 10000) in paragraph at lines 75710--75713 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [793] Underfull \hbox (badness 10000) in paragraph at lines 75829--75831 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, Underfull \hbox (badness 10000) in paragraph at lines 75909--75912 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [794] [795] Underfull \hbox (badness 5475) in paragraph at lines 76102--76105 []/ptmr8t/More in-for-ma-tion about color spaces can be found at [][]http://www .poynton.com/ColorFAQ.html[][] and [796] [797] [798] [799] [800] Underfull \hbox (badness 10000) in paragraph at lines 76718--76722 /ptmr8t/Returns the vol-ume of a given mixer con-trol. The re-turned vol-ume is a 2-tuple [801] [802] Chapter 23. [803] [804] [805] Underfull \hbox (badness 10000) in paragraph at lines 77113--77118 /ptmr8t/The /pcrr8t/gettext /ptmr8t/mod-ule pro-vides one ad-di-tional class de -rived from /pcrr8t/NullTranslations/ptmr8t/: [806] [807] [808] [809] [810] [811] Overfull \hbox (30.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_NUMERIC| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'decimal_point'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'thousands_sep'| Overfull \hbox (36.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_MONETARY| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_curr_symbol'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'currency_symbol'| Overfull \hbox (90.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_cs_precedes/n_cs_precedes'| Overfull \hbox (102.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sep_by_space/n_sep_by_space'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_decimal_point'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_frac_digits'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_thousands_sep'| Overfull \hbox (0.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_grouping'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'positive_sign'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'negative_sign'| Overfull \hbox (66.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sign_posn/n_sign_posn'| Overfull \hbox (24.99313pt too wide) in paragraph at lines 77686--77687 [][] [812] [813] [814] [815] [816] [817] [818] Chapter 24. [819] [820] [821] [822] [823] [824] Chapter 25. [825] [826] [827] [828] [829] [830] [831] [832] Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 []/ptmr8t/This is al-most al-ways the /pcrr8t/set() /ptmr8t/method of some scro ll-bar wid-get, Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 /ptmr8t/but can be any wid-get method that takes a sin-gle ar-gu-ment. Re-fer t o the file [833] [834] [835] [836] [837] [838] [839] [840] [841] [842] [843] [844] [845] [846] [847] [848] Underfull \hbox (badness 10000) in paragraph at lines 81034--81036 [] [849] [850] [851] [852] [853] [854] [855] [856] [857] [858] [859] [860] [861] [862] [863] Overfull \hbox (22.8553pt too wide) in paragraph at lines 82620--82620 []/ptmr8t/planet_and_moon| [864] [865] [866] [867] [868] Chapter 26. [869] [870] [871] [872] [873] [874] [875] Underfull \hbox (badness 10000) in paragraph at lines 83613--83615 /ptmr8t/Changed in ver-sion 2.4: The abil-ity to han-dle a multi-line ex-cep-ti on de-tail, and the [876] Underfull \hbox (badness 10000) in paragraph at lines 83673--83679 /ptmr8t/may go away when Python re-leases prior to 2.4 be-come un-in-ter-est-in g. Un-til then, [877] Overfull \hbox (82.23183pt too wide) in paragraph at lines 83752--83758 [][] Underfull \hbox (badness 10000) in paragraph at lines 83752--83758 [878] Underfull \hbox (badness 10000) in paragraph at lines 83811--83826 /pcrr8t/ELLIPSIS/ptmr8t/, /pcrr8t/IGNORE_EXCEPTION_DETAIL/ptmr8t/, /pcrr8t/REPO RT_UDIFF/ptmr8t/, /pcrr8t/REPORT_CDIFF/ptmr8t/, /pcrr8t/REPORT_NDIFF/ptmr8t/, Underfull \hbox (badness 7064) in paragraph at lines 83828--83833 /ptmr8t/Create a new op-tion flag with a given name, and re-turn the new flag's in-te-ger value. [879] Underfull \hbox (badness 10000) in paragraph at lines 83947--83949 []/ptmr8t/Optional ar-gu-ment /ptmri8t/name /ptmr8t/gives the name of the test; by de-fault, or if /pcrr8t/None/ptmr8t/, [880] [881] [882] [883] [884] [885] [886] [887] [888] [889] Underfull \hbox (badness 6910) in paragraph at lines 84820--84822 []/ptmr8t/For in-for-ma-tion about the con-struc-tor pa-ram-e-ters and meth-ods , see the doc-u-men-ta-tion for [890] [891] [892] [893] [894] [895] Underfull \hbox (badness 10000) in paragraph at lines 85291--85294 []/ptmr8t/will cre-ate a test suite that will run /pcrr8t/WidgetTestCase.testDe faultSize() /ptmr8t/and [896] [897] [898] [899] [900] Underfull \hbox (badness 5288) in paragraph at lines 85844--85853 []/ptmr8t/For ex-am-ple, if you have a mod-ule /pcrr8t/SampleTests /ptmr8t/con- tain-ing a /pcrr8t/TestCase/ptmr8t/-derived class [901] [902] Underfull \hbox (badness 10000) in paragraph at lines 86011--86012 [903] [904] [905] [906] [907] [908] Chapter 27. [909] [910] [911] [912] [913] [914] [915] [916] [917] [918] [919] [920] [921] [922] [923] [924] [925] [926] [927] [928] [929] [930] Chapter 28. [931] Underfull \hbox (badness 10000) in paragraph at lines 88510--88511 [932] [933] Underfull \hbox (badness 6001) in paragraph at lines 88795--88799 []/ptmr8t/On Win-dows NT+, file names are Uni-code na-tively, so no con-ver-sio n is per-formed. [934] [935] [936] [937] [938] [939] [940] Overfull \hbox (33.31012pt too wide) in paragraph at lines 89556--89556 []/pcrr8t/PendingDeprecationWarning| Overfull \hbox (22.45828pt too wide) in paragraph at lines 89625--89626 [][] [941] [942] [943] [944] [945] [946] [947] [948] Underfull \hbox (badness 10000) in paragraph at lines 90328--90332 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.exc_type, sys.exc_ value, [949] Underfull \hbox (badness 10000) in paragraph at lines 90342--90344 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.last_type, sys.las t_value, [950] [951] [952] Underfull \hbox (badness 6575) in paragraph at lines 90629--90631 []/ptmr8t/Instances of class /pcrr8t/_Feature /ptmr8t/have two cor-re-spond-ing meth-ods, /pcrr8t/getOptionalRelease() /ptmr8t/and [953] [954] Underfull \hbox (badness 5592) in paragraph at lines 90832--90835 /ptmr8t/The de-bug-ging flags nec-es-sary for the col-lec-tor to print in-for-m a-tion about a leak-ing pro- [955] Overfull \hbox (6.01671pt too wide) in paragraph at lines 91238--91238 [] /ptmb8t/Notes| Overfull \hbox (0.99947pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/method| Overfull \hbox (2.11691pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/f_exc_traceback| [956] Overfull \vbox (63.69313pt too high) has occurred while \output is active [957] [958] [959] Underfull \hbox (badness 10000) in paragraph at lines 91534--91535 [960] [961] [962] [963] Underfull \hbox (badness 6396) in paragraph at lines 91863--91868 []/ptmr8t/Conversion of an IEEE-754 ex-cep-tion to a Python ex-cep-tion re-quir es that the wrap-per macros [964] [965] [966] Chapter 29. Underfull \hbox (badness 6016) in paragraph at lines 91919--91922 /ptmr8t/Closely em-u-late the be-hav-ior of the in-ter-ac-tive Python in-ter-pr eter. This class builds on Underfull \hbox (badness 10000) in paragraph at lines 91926--91933 /ptmr8t/Convenience func-tion to run a read-eval-print loop. This cre-ates a ne w in-stance of [967] [968] [969] [970] Chapter 30. Underfull \hbox (badness 10000) in paragraph at lines 92169--92170 Overfull \hbox (85.05946pt too wide) in paragraph at lines 92219--92224 /ptmr8t/abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92219--92224 Underfull \hbox (badness 10000) in paragraph at lines 92241--92242 [971] [972] Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /ptmr8t/is /pcrr8t/('audioop', 'array', 'binascii', 'cmath', 'errno', 'imageop' , Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /pcrr8t/'marshal', 'math', 'md5', 'operator', 'parser', 'regex', 'select', Underfull \hbox (badness 10000) in paragraph at lines 92433--92438 /pcrr8t/'readlink', 'stat', 'times', 'uname', 'getpid', 'getppid', 'getcwd', [973] Overfull \hbox (98.94922pt too wide) in paragraph at lines 92499--92504 /ptmr8t/Dis-abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92499--92504 [974] [975] [976] Chapter 31. [977] [978] [979] [980] [981] [982] [983] [984] [985] [986] [987] [988] Chapter 32. [989] [990] [991] [992] [993] [994] [995] [996] [997] [998] [999] [1000] [1001] [1002] [1003] [1004] [1005] [1006] [1007] [1008] [1009] [1010] [1011] [1012] [1013] [1014] [1015] [1016] [1017] [1018] Chapter 33. [1019] [1020] [1021] Overfull \vbox (951.69313pt too high) has occurred while \output is active [1022] [1023] [1024] Chapter 34. [1025] [1026] [1027] [1028] Chapter 35. [1029] Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /ptmr8t/Modify the view, by call-ing /pcrr8t/MsiViewModify/ptmr8t/. /ptmri8t/ki nd /ptmr8t/can be one of Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_SEEK/ptmr8t/, /pcrr8t/MSIMODIFY_REFRESH/ptmr8t/, /pcrr8t/MSIM ODIFY_INSERT/ptmr8t/, /pcrr8t/MSIMODIFY_UPDATE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_ASSIGN/ptmr8t/, /pcrr8t/MSIMODIFY_REPLACE/ptmr8t/, /pcrr8t/MS IMODIFY_MERGE/ptmr8t/, /pcrr8t/MSIMODIFY_DELETE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_INSERT_TEMPORARY/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE_NEW/ptmr8t/, [1030] Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_AUTHOR/ptmr8t/, /pcrr8t/PID_KEYWORDS/ptmr8t/, /pcrr8t/PID_COMMENTS/ ptmr8t/, /pcrr8t/PID_TEMPLATE/ptmr8t/, /pcrr8t/PID_LASTAUTHOR/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_REVNUMBER/ptmr8t/, /pcrr8t/PID_LASTPRINTED/ptmr8t/, /pcrr8t/PID_CRE ATE_DTM/ptmr8t/, /pcrr8t/PID_LASTSAVE_DTM/ptmr8t/, [1031] [1032] [1033] [1034] [1035] [1036] Overfull \hbox (25.00525pt too wide) in paragraph at lines 98491--98492 [][] [1037] Overfull \hbox (43.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_LITTLE_ENDIAN| Overfull \hbox (25.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_BIG_ENDIAN| Overfull \hbox (7.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_RESOURCE_LIST| Overfull \hbox (25.01274pt too wide) in paragraph at lines 98670--98671 [][] [1038] [1039] [1040] [1041] [1042] Chapter 36. [1043] [1044] [1045] Underfull \hbox (badness 10000) in paragraph at lines 99440--99441 [1046] [1047] [1048] [1049] [1050] [1051] [1052] [1053] [1054] [1055] [1056] Underfull \hbox (badness 10000) in paragraph at lines 100685--100688 []/pcrr8t/LOG_EMERG/ptmr8t/, /pcrr8t/LOG_ALERT/ptmr8t/, /pcrr8t/LOG_CRIT/ptmr8t /, /pcrr8t/LOG_ERR/ptmr8t/, /pcrr8t/LOG_WARNING/ptmr8t/, [1057] Underfull \hbox (badness 10000) in paragraph at lines 100721--100722 [1058] Chapter 37. Underfull \hbox (badness 10000) in paragraph at lines 100788--100789 [1059] Underfull \hbox (badness 10000) in paragraph at lines 100926--100927 [1060] Underfull \hbox (badness 10000) in paragraph at lines 101050--101051 [1061] [1062] Underfull \hbox (badness 10000) in paragraph at lines 101165--101166 [1063] [1064] Underfull \hbox (badness 10000) in paragraph at lines 101393--101394 [1065] [1066] [1067] Underfull \hbox (badness 10000) in paragraph at lines 101755--101756 [1068] [1069] [1070] [1071] [1072] Chapter 38. [1073] [1074] Underfull \hbox (badness 10000) in paragraph at lines 102191--102192 Underfull \hbox (badness 10000) in paragraph at lines 102270--102271 [1075] [1076] Underfull \hbox (badness 10000) in paragraph at lines 102420--102421 [1077] [1078] Chapter 39. Underfull \hbox (badness 10000) in paragraph at lines 102638--102639 [1079] [1080] [1081] [1082] Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/audio| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/index| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ptime| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/atime| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/catalog| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ident| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/control| Overfull \hbox (24.99579pt too wide) in paragraph at lines 103137--103138 [][] [1083] [1084] [1085] Underfull \hbox (badness 10000) in paragraph at lines 103421--103425 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103429--103433 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, [1086] Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /ptmr8t/Add a po-si-tioner ob-ject to the form. --- Meth-ods: /pcrr8t/set_posit ioner_xvalue()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_yvalue()/ptmr8t/, /pcrr8t/set_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_ybounds()/ptmr8t/, /pcrr8t/get_positioner_xvalue()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/get_positioner_yvalue()/ptmr8t/, /pcrr8t/get_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103452--103455 /pcrr8t/set_counter_bounds()/ptmr8t/, /pcrr8t/set_counter_step()/ptmr8t/, /pcrr 8t/set_counter_precision()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103471--103475 /pcrr8t/addto_choice()/ptmr8t/, /pcrr8t/replace_choice()/ptmr8t/, /pcrr8t/delet e_choice()/ptmr8t/, /pcrr8t/get_choice_text()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/add_browser_line()/ptmr8t/, /pcrr8t/addto_browser()/ptmr8t/, /pcrr8t/in sert_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/delete_browser_line()/ptmr8t/, /pcrr8t/replace_browser_line()/ptmr8t/, /pcrr8t/get_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/load_browser()/ptmr8t/, /pcrr8t/get_browser_maxline()/ptmr8t/, /pcrr8t/ select_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/deselect_browser_line()/ptmr8t/, /pcrr8t/deselect_browser()/ptmr8t/, /p crr8t/isselected_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/get_browser()/ptmr8t/, /pcrr8t/set_browser_fontsize()/ptmr8t/, /pcrr8t/ set_browser_fontstyle()/ptmr8t/, [1087] [1088] [1089] Underfull \hbox (badness 10000) in paragraph at lines 103939--103940 [1090] [1091] [1092] Overfull \hbox (16.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'forcegray'| Overfull \hbox (4.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'quality'| Overfull \hbox (10.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'optimize'| Overfull \hbox (24.99864pt too wide) in paragraph at lines 104267--104268 [][] Overfull \hbox (74.97656pt too wide) in paragraph at lines 104279--104281 [] [1093] [1094] Chapter 40. [1095] [1096] Chapter 41. Underfull \hbox (badness 10000) in paragraph at lines 104464--104465 Underfull \hbox (badness 10000) in paragraph at lines 104495--104496 Underfull \hbox (badness 10000) in paragraph at lines 104503--104504 Underfull \hbox (badness 10000) in paragraph at lines 104510--104511 [1097] Underfull \hbox (badness 10000) in paragraph at lines 104518--104519 [1098] Underfull \hbox (badness 10000) in paragraph at lines 104636--104637 Underfull \hbox (badness 10000) in paragraph at lines 104654--104655 [1099] [1100] Appendix A. [1101] [1102] [1103] [1104] [1105] [1106] Appendix B. [1107] [1108] Appendix C. [1109] [1110] [1111] [1112] [1113] [1114] [1115] [1116] [1117] [1118] [1119] [1120] Appendix D. No file modlibrary.ind. No file library.ind. [1121] (./library.aux) ) (see the transcript file for additional information){/usr/share/texmf/dvips/psn fss/8r.enc}{/usr/share/texmf/dvips/tetex/bbad153f.enc}{/usr/share/texmf/dvips/tetex/aae443f0.enc} Output written on library.pdf (1131 pages, 5833609 bytes). Transcript written on library.log. makeindex -s python.ist 'library.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file library.idx...........done (7531 entries accepted, 2 rejected). Sorting entries...........................................................................done (107166 comparisons). Generating output file library.ind...........done (7414 lines written, 0 warnings). Output written in library.ind. Transcript written in library.ilg. makeindex -s python.ist 'modlibrary.idx' This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support). Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). Scanning input file modlibrary.idx....done (336 entries accepted, 8 rejected). Sorting entries......done (3156 comparisons). Generating output file modlibrary.ind....done (417 lines written, 0 warnings). Output written in modlibrary.ind. Transcript written in modlibrary.ilg. pdflatex 'library.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./library.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/10/18 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo))) (/usr/share/texmf/tex/latex/base/inputenc.sty (/usr/share/texmf/tex/latex/latex-unicode/utf8x.def)) (/usr/share/texmf/tex/latex/latex-unicode/ucs.sty (/usr/share/texmf/tex/latex/latex-unicode/uni-global.def)) (/usr/share/texmf/tex/latex/base/fontenc.sty (/usr/share/texmf/tex/latex/base/t1enc.def)) (/usr/share/texmf/tex/generic/babel/babel.sty (/usr/share/texmf/tex/generic/babel/english.ldf (/usr/share/texmf/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/psnfss/times.sty) (./fncychap.sty) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/base/makeidx.sty) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/misc/threeparttable.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex) (./library.pla)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) Writing index file library.idx (./library.aux) (/usr/share/texmf/tex/latex/base/ts1cmr.fd) (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (/usr/share/texmf/tex/latex/latex-unicode/ucsencs.def) (/usr/share/texmf/tex/context/base/supp-pdf.tex (/usr/share/texmf/tex/context/base/supp-mis.tex loading : Context Support Macros / Missing ) loading : Context Support Macros / PDF ) (/usr/share/texmf/tex/latex/hyperref/nameref.sty) (./library.out) (./library.out) (/usr/share/texmf/tex/latex/psnfss/t1phv.fd) [1{/usr/share/texm f/dvips/config/pdftex.map}] [2] (./library.toc (/usr/share/texmf/tex/latex/psnfss/t1pcr.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.109 ...ay bisection algorithm}{147}{section.9.5} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.240 ... with \textbf {bzip2}}{284}{section.13.3} [2] [3] [4] [5] Overfull \hbox (4.49997pt too wide) detected at line 1005 []/ptmr8t/1002 Overfull \hbox (4.49997pt too wide) detected at line 1008 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1009 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1010 []/ptmr8t/1004 Overfull \hbox (4.49997pt too wide) detected at line 1011 []/ptmr8t/1005 Overfull \hbox (4.49997pt too wide) detected at line 1012 []/ptmr8t/1006 Overfull \hbox (4.49997pt too wide) detected at line 1013 []/ptmr8t/1006 Overfull \hbox (4.49997pt too wide) detected at line 1016 []/ptmr8t/1008 Overfull \hbox (4.49997pt too wide) detected at line 1017 []/ptmr8t/1008 Overfull \hbox (4.49997pt too wide) detected at line 1018 []/ptmr8t/1009 Overfull \hbox (4.49997pt too wide) detected at line 1020 []/ptmr8t/1016 Overfull \hbox (4.49997pt too wide) detected at line 1021 []/ptmr8t/1017 Overfull \hbox (4.49997pt too wide) detected at line 1023 []/ptmr8t/1019 Overfull \hbox (4.49997pt too wide) detected at line 1024 []/ptmr8t/1020 Overfull \hbox (4.49997pt too wide) detected at line 1025 []/ptmr8t/1020 Overfull \hbox (4.49997pt too wide) detected at line 1029 []/ptmr8t/1024 Overfull \hbox (4.49997pt too wide) detected at line 1030 []/ptmr8t/1024 Overfull \hbox (4.49997pt too wide) detected at line 1032 []/ptmr8t/1025 Overfull \hbox (4.49997pt too wide) detected at line 1038 []/ptmr8t/1029 Overfull \hbox (4.49997pt too wide) detected at line 1049 []/ptmr8t/1034 Overfull \hbox (4.49997pt too wide) detected at line 1053 []/ptmr8t/1035 Overfull \hbox (4.49997pt too wide) detected at line 1055 []/ptmr8t/1039 Overfull \hbox (4.49997pt too wide) detected at line 1057 []/ptmr8t/1043 Overfull \hbox (4.49997pt too wide) detected at line 1060 []/ptmr8t/1044 Overfull \hbox (4.49997pt too wide) detected at line 1061 []/ptmr8t/1044 Overfull \hbox (4.49997pt too wide) detected at line 1062 []/ptmr8t/1045 Overfull \hbox (4.49997pt too wide) detected at line 1063 []/ptmr8t/1046 Overfull \hbox (4.49997pt too wide) detected at line 1064 []/ptmr8t/1046 Overfull \hbox (4.49997pt too wide) detected at line 1066 []/ptmr8t/1047 Overfull \hbox (4.49997pt too wide) detected at line 1068 []/ptmr8t/1048 Overfull \hbox (4.49997pt too wide) detected at line 1069 []/ptmr8t/1049 Overfull \hbox (4.49997pt too wide) detected at line 1070 []/ptmr8t/1049 Overfull \hbox (4.49997pt too wide) detected at line 1071 []/ptmr8t/1051 [6] Overfull \hbox (4.49997pt too wide) detected at line 1073 []/ptmr8t/1052 Overfull \hbox (4.49997pt too wide) detected at line 1074 []/ptmr8t/1054 Overfull \hbox (4.49997pt too wide) detected at line 1077 []/ptmr8t/1056 Overfull \hbox (4.49997pt too wide) detected at line 1078 []/ptmr8t/1057 Overfull \hbox (4.49997pt too wide) detected at line 1079 []/ptmr8t/1057 Overfull \hbox (4.49997pt too wide) detected at line 1081 []/ptmr8t/1059 Overfull \hbox (4.49997pt too wide) detected at line 1083 []/ptmr8t/1060 Overfull \hbox (4.49997pt too wide) detected at line 1084 []/ptmr8t/1061 Overfull \hbox (4.49997pt too wide) detected at line 1085 []/ptmr8t/1062 Overfull \hbox (4.49997pt too wide) detected at line 1086 []/ptmr8t/1063 Overfull \hbox (4.49997pt too wide) detected at line 1088 []/ptmr8t/1065 Overfull \hbox (4.49997pt too wide) detected at line 1094 []/ptmr8t/1068 Overfull \hbox (4.49997pt too wide) detected at line 1095 []/ptmr8t/1068 Overfull \hbox (4.49997pt too wide) detected at line 1120 []/ptmr8t/1071 Overfull \hbox (4.49997pt too wide) detected at line 1122 []/ptmr8t/1074 Overfull \hbox (4.49997pt too wide) detected at line 1123 []/ptmr8t/1074 Overfull \hbox (4.49997pt too wide) detected at line 1124 []/ptmr8t/1075 Overfull \hbox (4.49997pt too wide) detected at line 1125 []/ptmr8t/1076 Overfull \hbox (4.49997pt too wide) detected at line 1126 []/ptmr8t/1078 Overfull \hbox (4.49997pt too wide) detected at line 1129 []/ptmr8t/1079 Overfull \hbox (4.49997pt too wide) detected at line 1132 []/ptmr8t/1081 Overfull \hbox (4.49997pt too wide) detected at line 1133 []/ptmr8t/1081 Overfull \hbox (4.49997pt too wide) detected at line 1136 []/ptmr8t/1084 Overfull \hbox (4.49997pt too wide) detected at line 1140 []/ptmr8t/1088 Overfull \hbox (4.49997pt too wide) detected at line 1141 []/ptmr8t/1089 Overfull \hbox (4.49997pt too wide) detected at line 1142 []/ptmr8t/1089 Overfull \hbox (4.49997pt too wide) detected at line 1143 []/ptmr8t/1090 Overfull \hbox (4.49997pt too wide) detected at line 1144 []/ptmr8t/1091 Overfull \hbox (4.49997pt too wide) detected at line 1145 []/ptmr8t/1091 Overfull \hbox (4.49997pt too wide) detected at line 1146 []/ptmr8t/1092 Overfull \hbox (4.49997pt too wide) detected at line 1147 []/ptmr8t/1092 Overfull \hbox (4.49997pt too wide) detected at line 1149 []/ptmr8t/1095 Overfull \hbox (4.49997pt too wide) detected at line 1151 []/ptmr8t/1096 Overfull \hbox (4.49997pt too wide) detected at line 1153 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1154 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1155 []/ptmr8t/1097 Overfull \hbox (4.49997pt too wide) detected at line 1156 []/ptmr8t/1098 Overfull \hbox (4.49997pt too wide) detected at line 1167 []/ptmr8t/1099 Overfull \hbox (4.49997pt too wide) detected at line 1168 []/ptmr8t/1099 Overfull \hbox (4.49997pt too wide) detected at line 1171 []/ptmr8t/1107 Overfull \hbox (4.49997pt too wide) detected at line 1173 []/ptmr8t/1109 Overfull \hbox (4.49997pt too wide) detected at line 1174 []/ptmr8t/1110 Overfull \hbox (4.49997pt too wide) detected at line 1175 []/ptmr8t/1113 [7]) [8] ! pdfTeX warning (ext4): destination with the same identifier (name{page.1}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [1] ! pdfTeX warning (ext4): destination with the same identifier (name{page.2}) ha s been already used, duplicate ignored \penalty l.139 \hypertarget{library-intro}{}\chapter {Introduction} [2] Chapter 1. ! pdfTeX warning (ext4): destination with the same identifier (name{page.3}) ha s been already used, duplicate ignored \penalty l.188 \hypertarget{built-in-funcs}{}\chapter {Built-in Functions} [3] ! pdfTeX warning (ext4): destination with the same identifier (name{page.4}) ha s been already used, duplicate ignored \penalty l.188 \hypertarget{built-in-funcs}{}\chapter {Built-in Functions} [4] Chapter 2. ! pdfTeX warning (ext4): destination with the same identifier (name{page.5}) ha s been already used, duplicate ignored \penalty l.267 \end{funcdesc} [5] ! pdfTeX warning (ext4): destination with the same identifier (name{page.6}) ha s been already used, duplicate ignored \penalty l.358 [6] (/usr/share/texmf/tex/latex/psnfss/ts1ptm.fd) ! pdfTeX warning (ext4): destination with the same identifier (name{page.7}) ha s been already used, duplicate ignored \penalty l.451 ...plex numbers is deprecated.\end{funcdesc} [7] ! pdfTeX warning (ext4): destination with the same identifier (name{page.8}) ha s been already used, duplicate ignored \penalty l.532 \end{notice} [8] [9] Underfull \hbox (badness 10000) in paragraph at lines 658--659 [10] Underfull \hbox (badness 10000) in paragraph at lines 746--747 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Chapter 3. [21] [22] Chapter 4. [23] [24] Chapter 5. [25] [26] Chapter 6. [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] Overfull \hbox (8.3441pt too wide) in paragraph at lines 3183--3183 [] /ptmb8t/Notes| [38] Overfull \hbox (7.72594pt too wide) in paragraph at lines 3375--3375 []/ptmr8t/(7)(8)(9)(10)| [39] [40] Underfull \hbox (badness 10000) in paragraph at lines 3558--3564 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and [41] Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 []/ptmr8t/Note, the non-operator ver-sions of the /pcrr8t/update()/ptmr8t/, /pc rr8t/intersection_update()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 3645--3649 /pcrr8t/difference_update()/ptmr8t/, and /pcrr8t/symmetric_difference_update() /ptmr8t/meth-ods will ac-cept [42] [43] [44] [45] [46] Underfull \hbox (badness 6944) in paragraph at lines 4192--4198 []/ptmr8t/An ex-am-ple of a con-text man-ager that re-turns a re-lated ob-ject is the one re-turned by [47] [48] [49] [50] Chapter 7. Underfull \hbox (badness 10000) in paragraph at lines 4492--4495 /ptmr8t/The base class for all built-in ex-cep-tions ex-cept /pcrr8t/StopIterat ion/ptmr8t/, /pcrr8t/GeneratorExit/ptmr8t/, [51] [52] [53] [54] [55] [56] Chapter 8. [57] [58] Overfull \hbox (166.23189pt too wide) in paragraph at lines 5141--5148 [][] Underfull \hbox (badness 10000) in paragraph at lines 5141--5148 [59] Overfull \hbox (172.23183pt too wide) in paragraph at lines 5252--5260 [][] Underfull \hbox (badness 10000) in paragraph at lines 5252--5260 [60] Overfull \hbox (49.99875pt too wide) in paragraph at lines 5306--5307 [][] Overfull \hbox (50.00552pt too wide) in paragraph at lines 5345--5346 [][] Overfull \hbox (2.46297pt too wide) in paragraph at lines 5426--5426 [] /ptmb8t/Type| Overfull \hbox (1.29306pt too wide) in paragraph at lines 5426--5426 []/ptmr8t/None| Overfull \hbox (49.99658pt too wide) in paragraph at lines 5426--5427 [][] Overfull \hbox (6.8293pt too wide) in paragraph at lines 5499--5499 [] /ptmb8t/Type| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'e'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'E'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'f'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'F'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'g'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'G'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'n'| Overfull \hbox (1.99948pt too wide) in paragraph at lines 5499--5499 []/pcrr8t/'%'| Overfull \hbox (5.6594pt too wide) in paragraph at lines 5499--5499 []/ptmr8t/None| Overfull \hbox (50.00784pt too wide) in paragraph at lines 5499--5500 [][] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 []/ptmb8t/Note: /ptmr8t/The fol-low-ing ap-plies only to reg-u-lar ex-pres-sio n ob-jects like those cre-ated with Underfull \hbox (badness 10000) in paragraph at lines 7015--7020 /pcrr8t/re.compile("pattern")/ptmr8t/, not the prim-i-tives /pcrr8t/re.match(pa ttern, string) /ptmr8t/or [78] [79] [80] [81] [82] Underfull \hbox (badness 10000) in paragraph at lines 7604--7606 /ptmr8t/Identical to the /pcrr8t/unpack_from() /ptmr8t/func-tion, us-ing the co m-piled for-mat. [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] Underfull \hbox (badness 10000) in paragraph at lines 8915--8918 []/ptmr8t/Decoding and trans-lat-ing works sim-i-lar, ex-cept /pcrr8t/UnicodeDe codeError /ptmr8t/or [97] [98] Overfull \hbox (52.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'xmlcharrefreplace'| Overfull \hbox (46.21255pt too wide) in paragraph at lines 9098--9098 []/pcrr8t/'backslashreplace'| [99] [100] [101] [102] [103] Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jis_2004| Overfull \hbox (11.68579pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/euc_jisx0213| Overfull \hbox (2.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_1| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2| Overfull \hbox (27.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_2004| Overfull \hbox (12.80591pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_3| Overfull \hbox (19.87584pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_jp_ext| Overfull \hbox (3.35597pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso2022_kr| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_10| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_13| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_14| Overfull \hbox (5.02602pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/iso8859_15| Overfull \hbox (8.19551pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_cyrillic| Overfull \hbox (2.22585pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_greek| Overfull \hbox (8.89561pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_iceland| Overfull \hbox (2.79562pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_latin2| Overfull \hbox (5.5658pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_roman| Overfull \hbox (7.79564pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/mac_turkish| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jis_2004| Overfull \hbox (15.58554pt too wide) in paragraph at lines 10300--10300 []/ptmr8t/shift_jisx0213| [104] Overfull \vbox (459.69313pt too high) has occurred while \output is active [105] Overfull \hbox (11.3528pt too wide) in paragraph at lines 10484--10484 [] /ptmb8t/Operand Overfull \hbox (18.4786pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/base64_codec| Overfull \hbox (5.14877pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/bz2_codec| Overfull \hbox (4.99887pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/hex_codec| Overfull \hbox (1.81868pt too wide) in paragraph at lines 10484--10484 /ptmr8t/pri_codec| Overfull \hbox (45.5384pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/raw_unicode_escape| Overfull \hbox (16.8183pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/string_escape| Overfull \hbox (12.91855pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_escape| Overfull \hbox (16.8184pt too wide) in paragraph at lines 10484--10484 /ptmr8t/code_internal| Overfull \hbox (0.70883pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/uu_codec| Overfull \hbox (5.70856pt too wide) in paragraph at lines 10484--10484 []/ptmr8t/zlib_codec| (/usr/share/texmf/tex/latex/latex-unicode/uni-0.def) [106] [107] [108] [109] [110] Chapter 9. [111] [112] Underfull \hbox (badness 10000) in paragraph at lines 11110--11112 /ptmr8t/The most pos-i-tive /pcrr8t/timedelta /ptmr8t/ob-ject, /pcrr8t/timedelt a(days=999999999, hours=23, Underfull \hbox (badness 10000) in paragraph at lines 11116--11118 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/timede lta /ptmr8t/ob-jects, [113] [114] Overfull \hbox (20.67915pt too wide) in paragraph at lines 11394--11395 [][] Underfull \hbox (badness 7362) in paragraph at lines 11400--11405 /pcrr8t/< 0/ptmr8t/. Af-ter-ward /pcrr8t/date2 - date1 == timedelta.days/ptmr8t /. /pcrr8t/timedelta.seconds /ptmr8t/and Underfull \hbox (badness 10000) in paragraph at lines 11443--11447 /pcrr8t/d.month, d.day, 0, 0, 0, d.weekday(), d.toordinal() - date(d.year, 1, [115] Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /ptmr8t/Return a string rep-re-sent-ing the date, for ex-am-ple /pcrr8t/date(20 02, 12, Underfull \hbox (badness 10000) in paragraph at lines 11501--11506 /pcrr8t/4).ctime() == 'Wed Dec 4 00:00:00 2002'/ptmr8t/. /pcrr8t/d.ctime() /ptm r8t/is equiv-a-lent to [116] Underfull \hbox (badness 10000) in paragraph at lines 11615--11618 /ptmr8t/Return the cur-rent lo-cal date-time, with /pcrr8t/tzinfo None/ptmr8t/. This is equiv-a-lent to [117] Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the cur-rent date Underfull \hbox (badness 10000) in paragraph at lines 11628--11632 /ptmr8t/and time are con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this cas e the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 []/ptmr8t/Else /ptmri8t/tz /ptmr8t/must be an in-stance of a class /pcrr8t/tzin fo /ptmr8t/sub-class, and the times- Underfull \hbox (badness 10000) in paragraph at lines 11648--11652 /ptmr8t/tamp is con-verted to /ptmri8t/tz/ptmr8t/`s time zone. In this case the re-sult is equiv-a-lent to Underfull \hbox (badness 10000) in paragraph at lines 11713--11715 /ptmr8t/The small-est pos-si-ble dif-fer-ence be-tween non-equal /pcrr8t/dateti me /ptmr8t/ob-jects, [118] Underfull \hbox (badness 5652) in paragraph at lines 11796--11802 []/ptmr8t/datetime2 is a du-ra-tion of timedelta re-moved from date-time1, mov- ing for-ward in time if [119] Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /ptmr8t/equiv-a-lent to /pcrr8t/time.struct_time((d.year, d.month, d.day, d.hou r, d.minute, Underfull \hbox (badness 10000) in paragraph at lines 11945--11953 /pcrr8t/d.second, d.weekday(), d.toordinal() - date(d.year, 1, 1).toordinal() + [120] Underfull \hbox (badness 6592) in paragraph at lines 11961--11967 []/ptmr8t/If /ptmri8t/d /ptmr8t/is aware, /ptmri8t/d /ptmr8t/is nor-mal-ized to UTC time, by sub-tract-ing /pcrr8t/d.utcoffset()/ptmr8t/, and a Underfull \hbox (badness 10000) in paragraph at lines 11990--11992 /ptmr8t/Return a 3-tuple, (ISO year, ISO week num-ber, ISO week-day). The same as Underfull \hbox (badness 10000) in paragraph at lines 11996--11999 /ptmr8t/Return a string rep-re-sent-ing the date and time in ISO 8601 for-mat, YYYY-MM- Underfull \hbox (badness 7238) in paragraph at lines 12026--12031 /ptmr8t/Return a string rep-re-sent-ing the date and time, for ex-am-ple /pcrr8 t/datetime(2002, 12, 4, [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] Overfull \hbox (11.12794pt too wide) in paragraph at lines 12942--12942 [] /ptmb8t/Notes| [131] [132] [133] [134] Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Container| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Hashable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Iterator| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Callable| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Sequence| Overfull \hbox (55.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSequence| Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableSet| Overfull \hbox (7.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/Mapping| Overfull \hbox (49.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MutableMapping| Overfull \hbox (31.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| Overfull \hbox (13.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/KeysView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (19.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ItemsView| Overfull \hbox (14.37897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView/ptmr8t/, Overfull \hbox (25.54549pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/ValuesView| Overfull \hbox (11.87897pt too wide) in paragraph at lines 13473--13473 []/pcrr8t/MappingView| [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] Underfull \hbox (badness 10000) in paragraph at lines 14902--14916 []/ptmr8t/Note, the non-operator ver-sions of /pcrr8t/union()/ptmr8t/, /pcrr8t/ intersection()/ptmr8t/, /pcrr8t/difference()/ptmr8t/, and Overfull \hbox (44.79945pt too wide) in paragraph at lines 15021--15021 []/pcrr8t/s.symmetric_difference_update(t)| [151] [152] [153] [154] [155] Underfull \hbox (badness 5637) in paragraph at lines 15375--15378 []/ptmr8t/The low-est val-ued en-tries are re-trieved first (the low-est val-ue d en-try is the one re-turned [156] [157] [158] [159] [160] Underfull \hbox (badness 7308) in paragraph at lines 15883--15885 []/ptmr8t/In ad-di-tion to the four base meth-ods, pro-gres-sively more ef-fi-c iency comes with defin-ing [161] [162] [163] [164] Underfull \hbox (badness 10000) in paragraph at lines 16238--16244 /ptmr8t/The type of ob-jects de-fined in ex-ten-sion mod-ules with /pcrr8t/PyMe mberDef/ptmr8t/, such as [165] [166] [167] [168] [169] [170] Chapter 10. [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205] [206] [207] [208] [209] [210] [211] [212] [213] [214] [215] [216] [217] [218] [219] [220] [221] [222] [223] [224] Chapter 11. [225] [226] [227] [228] Underfull \hbox (badness 10000) in paragraph at lines 22021--22022 Overfull \hbox (64.2315pt too wide) in paragraph at lines 22040--22042 []/ptmr8t/Usage ex-am-ple: /pcrr8t/fi = fileinput.FileInput(openhook=fileinput. hook_encoded("iso-8859-1")) [229] [230] [231] [232] [233] Underfull \hbox (badness 10000) in paragraph at lines 22481--22481 []/ptmri8t/[mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [dir=None, Underfull \hbox (badness 10000) in paragraph at lines 22497--22497 []/ptmri8t/[max_size=0, [mode='w+b', [bufsize=-1, [suf-fix='', [pre-fix='tmp', [234] [235] [236] [237] [238] [239] [240] [241] [242] Chapter 12. [243] Underfull \hbox (badness 10000) in paragraph at lines 23276--23277 [244] [245] [246] [247] [248] [249] [250] [251] [252] [253] Underfull \hbox (badness 10000) in paragraph at lines 24198--24205 /ptmr8t/A sub-class of /pcrr8t/Shelf /ptmr8t/which ex-poses /pcrr8t/first()/ptm r8t/, /pcrr8t/next()/ptmr8t/, /pcrr8t/previous()/ptmr8t/, /pcrr8t/last() /ptmr8 t/and [254] [255] Underfull \hbox (badness 10000) in paragraph at lines 24322--24323 Underfull \hbox (badness 10000) in paragraph at lines 24342--24343 [256] [257] [258] Overfull \hbox (17.53752pt too wide) in paragraph at lines 24736--24737 [][] [259] [260] [261] [262] [263] [264] [265] [266] [267] [268] [269] [270] [271] [272] [273] [274] [275] Underfull \hbox (badness 10000) in paragraph at lines 26265--26269 []/ptmr8t/The /pcrr8t/sqlite3 /ptmr8t/mod-ule has two de-fault adapters for Pyt hon's built-in /pcrr8t/datetime.date /ptmr8t/and [276] [277] [278] Underfull \hbox (badness 5288) in paragraph at lines 26449--26456 /ptmr8t/Using the non-stan-dard /pcrr8t/execute()/ptmr8t/, /pcrr8t/executemany( ) /ptmr8t/and /pcrr8t/executescript() /ptmr8t/meth-ods of the [279] [280] Chapter 13. [281] [282] [283] [284] Underfull \hbox (badness 10000) in paragraph at lines 27001--27004 /ptmr8t/Sequential com-pres-sion and de-com-pres-sion is done us-ing the classe s /pcrr8t/BZ2Compressor /ptmr8t/and [285] [286] [287] [288] [289] [290] [291] Underfull \hbox (badness 10000) in paragraph at lines 27745--27747 /ptmr8t/Is raised for /ptmri8t/non-fatal /ptmr8t/er-rors when us-ing /pcrr8t/Ta rFile.extract()/ptmr8t/, but only if [292] [293] Underfull \hbox (badness 10000) in paragraph at lines 28009--28012 []/pcrr8t/TarInfo /ptmr8t/ob-jects are re-turned by /pcrr8t/TarFile/ptmr8t/`s m eth-ods /pcrr8t/getmember()/ptmr8t/, /pcrr8t/getmembers() /ptmr8t/and [294] [295] [296] Underfull \hbox (badness 10000) in paragraph at lines 28265--28274 []/ptmr8t/The de-fault value for /ptmri8t/en-cod-ing /ptmr8t/is the lo-cal char -ac-ter en-cod-ing. It is de-duced from [297] [298] Chapter 14. [299] [300] Underfull \hbox (badness 10000) in paragraph at lines 28460--28460 []/ptmri8t/csvfile, field-names, [rest-val='', [ex-trasac-tion='raise', [di-ale ct='excel', [*args, [301] [302] [303] [304] [305] Underfull \hbox (badness 10000) in paragraph at lines 28879--28880 [306] Underfull \hbox (badness 6526) in paragraph at lines 28976--28978 /ptmr8t/Exception raised when an op-tion ref-er-enced from a value does not ex- ist. Sub-class of [307] [308] [309] [310] [311] [312] [313] [314] Overfull \hbox (15.7865pt too wide) in paragraph at lines 29730--29731 [] [315] [316] Chapter 15. Underfull \hbox (badness 10000) in paragraph at lines 29863--29864 [317] [318] [319] [320] Chapter 16. [321] [322] [323] Underfull \hbox (badness 10000) in paragraph at lines 30607--30612 /ptmr8t/Execute /ptmri8t/cmd /ptmr8t/as a sub-process and re-turn the file ob-j ects /pcrr8t/(child_stdin, [324] [325] Underfull \hbox (badness 10000) in paragraph at lines 30725--30729 []/ptmr8t/If you're start-ing with a Python file ob-ject /ptmri8t/f/ptmr8t/, fi rst do /pcrr8t/f.flush()/ptmr8t/, and then do [326] [327] [328] [329] [330] [331] Underfull \hbox (badness 10000) in paragraph at lines 31411--31412 Underfull \hbox (badness 10000) in paragraph at lines 31427--31428 [332] [333] [334] [335] [336] [337] [338] [339] [340] Underfull \hbox (badness 5741) in paragraph at lines 32229--32235 []/pcrr8t/BufferedIOBase /ptmr8t/deals with buffer-ing on a raw byte stream (/p crr8t/RawIOBase/ptmr8t/). Its sub-classes, [341] [342] [343] [344] [345] [346] Underfull \hbox (badness 10000) in paragraph at lines 32946--32948 /ptmr8t/A helper codec that de-codes new-lines for uni-ver-sal new-lines mode. It in-her-its [347] [348] Overfull \hbox (11.12794pt too wide) in paragraph at lines 33384--33384 [] /ptmb8t/Notes| Overfull \hbox (25.01363pt too wide) in paragraph at lines 33384--33385 [][] [349] [350] [351] [352] [353] Underfull \hbox (badness 10000) in paragraph at lines 33777--33781 []/pcrr8t/"-v" /ptmr8t/and /pcrr8t/"--report" /ptmr8t/are both op-tions. As-sum -ing that /pcrro8t/--report /ptmr8t/takes one ar-gu-ment, [354] [355] [356] [357] Underfull \hbox (badness 5652) in paragraph at lines 34102--34105 []/ptmr8t/If /pcrr8t/optparse /ptmr8t/en-coun-ters ei-ther /pcrr8t/"-h" /ptmr8t /or /pcrr8t/"--help" /ptmr8t/on the command-line, or if you just call [358] [359] [360] [361] Underfull \hbox (badness 5203) in paragraph at lines 34386--34389 /ptmr8t/There are sev-eral ways to pop-u-late the parser with op-tions. The pre -ferred way is by us-ing [362] [363] [364] [365] [366] [367] Underfull \hbox (badness 10000) in paragraph at lines 34976--34977 []/ptmr8t/assume op-tion con-flicts are a pro-gram-ming er-ror and raise [368] [369] [370] [371] [372] [373] Underfull \hbox (badness 10000) in paragraph at lines 35426--35431 []/ptmr8t/Your type-checking func-tion should raise /pcrr8t/OptionValueError /p tmr8t/if it en-coun-ters any prob-lems. [374] [375] [376] [377] [378] [379] [380] Underfull \hbox (badness 10000) in paragraph at lines 35997--36006 []/pcrr8t/Logger.debug()/ptmr8t/, /pcrr8t/Logger.info()/ptmr8t/, /pcrr8t/Logger .warning()/ptmr8t/, /pcrr8t/Logger.error()/ptmr8t/, and [381] [382] [383] [384] Underfull \hbox (badness 5403) in paragraph at lines 36345--36348 []/pcrr8t/BaseRotatingHandler /ptmr8t/is the base class for han-dlers that ro-t ate log files at a cer-tain [385] [386] Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filename| Overfull \hbox (16.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/filemode| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/format| Overfull \hbox (10.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/datefmt| Overfull \hbox (4.72716pt too wide) in paragraph at lines 36623--36623 []/pcrr8t/stream| Overfull \hbox (25.01265pt too wide) in paragraph at lines 36623--36624 [][] [387] [388] [389] [390] Overfull \hbox (3.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(name)s| Overfull \hbox (33.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(levelname)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(asctime)s| Overfull \hbox (21.63922pt too wide) in paragraph at lines 36943--36943 []/pcrr8t/%(message)s| [391] [392] [393] [394] [395] [396] [397] [398] Underfull \hbox (badness 6001) in paragraph at lines 37574--37574 []/ptmri8t/filename, [when, [in-ter-val, [back-up-Count, [en-cod-ing, [de-lay, [399] Underfull \hbox (badness 5245) in paragraph at lines 37722--37724 /ptmr8t/The fac-tory method of /pcrr8t/SocketHandler /ptmr8t/is here over-rid-d en to cre-ate a UDP socket [400] [401] [402] Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelno)s| Overfull \hbox (16.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(levelname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(pathname)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(filename)s| Overfull \hbox (10.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(funcName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(created)f| Overfull \hbox (52.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(relativeCreated)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(asctime)s| Overfull \hbox (22.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(threadName)s| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(process)d| Overfull \hbox (4.21255pt too wide) in paragraph at lines 38071--38071 []/pcrr8t/%(message)s| Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/Formats the spec-i-fied ex-cep-tion in-for-ma-tion (a stan-dard ex-cep- tion tu-ple as re- Underfull \hbox (badness 10000) in paragraph at lines 38114--38118 /ptmr8t/turned by /pcrr8t/sys.exc_info()/ptmr8t/) as a string. This de-fault im -ple-men-ta-tion just uses [403] [404] [405] [406] [407] [408] [409] [410] [411] [412] [413] [414] [415] [416] Underfull \hbox (badness 10000) in paragraph at lines 39269--39270 [417] [418] [419] [420] [421] [422] Overfull \vbox (435.69313pt too high) has occurred while \output is active [423] [424] [425] [426] [427] [428] [429] [430] [431] [432] [433] [434] [435] [436] [437] [438] [439] [440] Overfull \hbox (28.77098pt too wide) in paragraph at lines 42666--42667 [][] [441] [442] [443] [444] [445] [446] [447] [448] [449] [450] [451] [452] [453] [454] [455] [456] [457] [458] [459] [460] [461] [462] Underfull \hbox (badness 7221) in paragraph at lines 44332--44335 []/ptmr8t/The ex-act func-tion-al-ity is sys-tem de-pen-dent. Changed in ver-si on 2.6: Win-dows only: [463] [464] [465] [466] [467] [468] [469] [470] Chapter 17. [471] Overfull \hbox (14.31891pt too wide) in paragraph at lines 45106--45107 [][] [472] [473] [474] [475] [476] [477] [478] [479] [480] [481] [482] [483] [484] Underfull \hbox (badness 10000) in paragraph at lines 46585--46586 [485] [486] [487] Underfull \hbox (badness 10000) in paragraph at lines 46788--46791 []/ptmr8t/For more flex-i-bil-ity in us-ing shared mem-ory one can use the [488] [489] [490] Underfull \hbox (badness 10000) in paragraph at lines 47072--47073 Underfull \hbox (badness 10000) in paragraph at lines 47086--47087 [491] [492] [493] Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 []/ptmb8t/Note: /pcrr8t/multiprocessing /ptmr8t/con-tains no ana-logues of /pc rr8t/threading.active_count()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 47296--47302 /pcrr8t/threading.enumerate()/ptmr8t/, /pcrr8t/threading.settrace()/ptmr8t/, /p crr8t/threading.setprofile()/ptmr8t/, [494] Underfull \hbox (badness 10000) in paragraph at lines 47418--47419 Underfull \hbox (badness 10000) in paragraph at lines 47424--47425 [495] Underfull \hbox (badness 5417) in paragraph at lines 47485--47491 []/ptmb8t/Note: /ptmr8t/If the SIG-INT sig-nal gen-er-ated by Ctrl-C ar-rives while the main thread is blocked Underfull \hbox (badness 10000) in paragraph at lines 47485--47491 /ptmr8t/by a call to /pcrr8t/BoundedSemaphore.acquire()/ptmr8t/, /pcrr8t/Lock.a cquire()/ptmr8t/, /pcrr8t/RLock.acquire()/ptmr8t/, [496] [497] [498] [499] [500] [501] [502] [503] [504] [505] [506] Underfull \hbox (badness 8113) in paragraph at lines 48556--48563 []/ptmr8t/If au-then-ti-ca-tion is re-quested but do au-then-ti-ca-tion key is spec-i-fied then the re-turn value of [507] [508] [509] [510] [511] [512] [513] [514] [515] [516] [517] [518] [519] [520] [521] [522] [523] [524] [525] [526] [527] [528] [529] [530] [531] [532] [533] [534] [535] [536] [537] [538] [539] [540] [541] [542] Chapter 18. Underfull \hbox (badness 10000) in paragraph at lines 50912--50912 /ptmri8t/close_fds=False, shell=False, cwd=None, env=None, uni-ver-sal_newlines =False, star- [543] [544] [545] Underfull \hbox (badness 10000) in paragraph at lines 51134--51139 []/ptmb8t/Warning: /ptmr8t/Use /pcrr8t/communicate() /ptmr8t/rather than /pcrr 8t/stdin.write()/ptmr8t/, /pcrr8t/stdout.read() /ptmr8t/or [546] [547] [548] [549] [550] Underfull \hbox (badness 10000) in paragraph at lines 51621--51625 []/ptmr8t/If you want to know the cur-rent ma-chine's IP ad-dress, you may want to use [551] [552] [553] [554] [555] [556] [557] [558] Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 []/ptmri8t/sock, key-file=None, cert-file=None, server_side=False, cert_reqs=CE RT_NONE, Underfull \hbox (badness 10000) in paragraph at lines 52302--52302 /ptmri8t/ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True, s up- [559] [560] [561] [562] [563] [564] Overfull \hbox (9.78795pt too wide) in paragraph at lines 52919--52920 [] [565] [566] Underfull \hbox (badness 6047) in paragraph at lines 53085--53090 /ptmr8t/Sets given in-ter-val timer (one of /pcrr8t/signal.ITIMER_REAL/ptmr8t/, /pcrr8t/signal.ITIMER_VIRTUAL /ptmr8t/or [567] [568] [569] [570] [571] [572] [573] [574] Overfull \hbox (13.83913pt too wide) in paragraph at lines 53859--53860 [][] [575] [576] Chapter 19. [577] [578] [579] [580] [581] [582] [583] [584] Underfull \hbox (badness 10000) in paragraph at lines 54859--54863 []/ptmr8t/As a con-ve-nience, see the meth-ods /pcrr8t/Message.as_string() /ptm r8t/and /pcrr8t/str(aMessage)/ptmr8t/, a.k.a. [585] [586] [587] [588] [589] [590] [591] [592] [593] [594] Underfull \hbox (badness 10000) in paragraph at lines 55801--55807 /ptmr8t/Changed in ver-sion 2.4: The /pcrr8t/dump_address_pair() /ptmr8t/func-t ion has been re-moved; use [595] [596] [597] [598] [599] [600] Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 []/ptmr8t/Methods that were dep-re-cated in ver-sion 3 have been re-moved. Thes e in-clude Underfull \hbox (badness 10000) in paragraph at lines 56286--56289 /pcrr8t/Generator.__call__()/ptmr8t/, /pcrr8t/Message.get_type()/ptmr8t/, /pcrr 8t/Message.get_main_type()/ptmr8t/, [601] Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 []/ptmr8t/New /pcrr8t/DeprecationWarning/ptmr8t/s have been added to: /pcrr8t/G enerator.__call__()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 56318--56323 /pcrr8t/Message.get_type()/ptmr8t/, /pcrr8t/Message.get_main_type()/ptmr8t/, /p crr8t/Message.get_subtype()/ptmr8t/, and [602] Underfull \hbox (badness 10000) in paragraph at lines 56391--56395 []/ptmr8t/The fol-low-ing func-tions in the /pcrr8t/email.Utils /ptmr8t/mod-ule have been dep-re-cated: [603] [604] [605] [606] [607] [608] [609] Underfull \hbox (badness 10000) in paragraph at lines 57160--57161 [610] [611] [612] Underfull \hbox (badness 10000) in paragraph at lines 57424--57427 /ptmr8t/Return a /pcrr8t/Maildir /ptmr8t/in-stance rep-re-sent-ing the folder w hose name is /ptmri8t/folder/ptmr8t/. A [613] [614] [615] [616] [617] [618] [619] [620] [621] [622] [623] [624] [625] [626] [627] [628] [629] [630] [631] [632] [633] [634] [635] [636] Underfull \hbox (badness 10000) in paragraph at lines 60389--60393 /ptmr8t/Return a pair /pcrr8t/(full name, email address) /ptmr8t/parsed from th e string re-turned by [637] [638] [639] Overfull \hbox (207.12541pt too wide) in paragraph at lines 60684--60686 [] Underfull \hbox (badness 10000) in paragraph at lines 60705--60706 [640] [641] [642] [643] [644] Chapter 20. [645] [646] [647] [648] Underfull \hbox (badness 10000) in paragraph at lines 61446--61450 /ptmr8t/This method is called to pro-cess un-re-solv-able nu-meric char-ac-ter ref-er-ences. Re-fer to [649] [650] [651] [652] Underfull \hbox (badness 10000) in paragraph at lines 61825--61831 /ptmr8t/Calling this with a true value for /ptmri8t/flag /ptmr8t/(the de-fault) will cause Ex-pat to call the [653] [654] [655] [656] [657] [658] [659] Overfull \hbox (0.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/DOMImplementation| Overfull \hbox (24.7234pt too wide) in paragraph at lines 62696--62696 []/pcrr8t/ProcessingInstruction| [660] Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /ptmr8t/ob-ject: /pcrr8t/ELEMENT_NODE/ptmr8t/, /pcrr8t/ATTRIBUTE_NODE/ptmr8t/, /pcrr8t/TEXT_NODE/ptmr8t/, /pcrr8t/CDATA_SECTION_NODE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 62740--62746 /pcrr8t/ENTITY_NODE/ptmr8t/, /pcrr8t/PROCESSING_INSTRUCTION_NODE/ptmr8t/, /pcrr 8t/COMMENT_NODE/ptmr8t/, /pcrr8t/DOCUMENT_NODE/ptmr8t/, [661] [662] [663] [664] [665] [666] Underfull \hbox (badness 10000) in paragraph at lines 63343--63346 /ptmr8t/Exception when a node does not ex-ist in the ref-er-enced con-text. For ex-am-ple, [667] [668] [669] [670] [671] Underfull \hbox (badness 10000) in paragraph at lines 63849--63851 []/pcrr8t/const /ptmr8t/dec-la-ra-tions map to vari-ables in their re-spec-tive scope (e.g. [672] [673] [674] Underfull \hbox (badness 10000) in paragraph at lines 64201--64205 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/lexical-handler" /ptmr8t/ --- data type: Underfull \hbox (badness 10000) in paragraph at lines 64209--64213 /ptmr8t/Value: /pcrr8t/"http://xml.org/sax/properties/declaration-handler" /ptm r8t/--- data type: [675] [676] [677] [678] [679] [680] Underfull \hbox (badness 10000) in paragraph at lines 64715--64718 /ptmr8t/Return the cur-rent set-ting for fea-ture /ptmri8t/fea-ture-name/ptmr8t /. If the fea-ture is not rec-og-nized, [681] [682] [683] [684] [685] [686] [687] [688] Chapter 21. [689] [690] [691] [692] [693] [694] [695] [696] [697] [698] [699] Underfull \hbox (badness 7832) in paragraph at lines 66510--66518 []/pcrr8t/Headers /ptmr8t/ob-jects sup-port typ-i-cal map-ping op-er-a-tions in -clud-ing /pcrr8t/__getitem__()/ptmr8t/, /pcrr8t/get()/ptmr8t/, [700] [701] [702] [703] [704] [705] [706] [707] [708] Underfull \hbox (badness 10000) in paragraph at lines 67392--67396 []/ptmr8t/When per-form-ing ba-sic au-then-ti-ca-tion, a /pcrr8t/FancyURLopener /ptmr8t/in-stance calls its [709] [710] [711] Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/An HTTP sta-tus code as de-fined in [][]RFC 2616[][]. This nu-meric val ue Underfull \hbox (badness 10000) in paragraph at lines 67635--67638 /ptmr8t/cor-re-sponds to a value found in the dic-tio-nary of codes as found in [712] [713] [714] [715] [716] [717] [718] [719] [720] [721] Overfull \hbox (21.13048pt too wide) in paragraph at lines 68986--68987 [][] [722] [723] [724] [725] [726] [727] [728] [729] [730] [731] [732] [733] [734] [735] [736] [737] [738] [739] [740] [741] [742] [743] [744] [745] [746] [747] [748] Underfull \hbox (badness 10000) in paragraph at lines 71611--71615 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type Underfull \hbox (badness 10000) in paragraph at lines 71632--71635 /ptmr8t/Parse a query string given as a string ar-gu-ment (data of type [749] [750] [751] [752] [753] [754] [755] [756] [757] [758] [759] [760] Underfull \hbox (badness 10000) in paragraph at lines 72724--72727 []/ptmr8t/A lot of the work, such as pars-ing the re-quest, is done by the base class [761] Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 []/ptmr8t/The /pcrr8t/CGIHTTPServer /ptmr8t/mod-ule de-fines a request-handler class, in-ter-face com-pat-i- Underfull \hbox (badness 10000) in paragraph at lines 72809--72813 /ptmr8t/ble with /pcrr8t/BaseHTTPServer.BaseHTTPRequestHandler /ptmr8t/and in-h er-its be-hav-ior from [762] Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 []/ptmri8t/blocked_domains=None, al-lowed_domains=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/netscape=True, rfc2965=False, rfc2109_as_netscape=None, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/hide_cookie2=False, strict_domain=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, Underfull \hbox (badness 10000) in paragraph at lines 72955--72955 /ptmri8t/strict_ns_domain=DefaultCookiePolicy.DomainLiberal, [763] Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /ptmr8t/meth-ods /pcrr8t/get_full_url()/ptmr8t/, /pcrr8t/get_host()/ptmr8t/, /p crr8t/get_type()/ptmr8t/, /pcrr8t/unverifiable()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 73035--73040 /pcrr8t/get_origin_req_host()/ptmr8t/, /pcrr8t/has_header()/ptmr8t/, /pcrr8t/ge t_header()/ptmr8t/, /pcrr8t/header_items()/ptmr8t/, and Underfull \hbox (badness 10000) in paragraph at lines 73056--73061 []/ptmr8t/The /ptmri8t/re-quest /ptmr8t/ob-ject (usu-ally a /pcrr8t/urllib2.Req uest /ptmr8t/in-stance) must sup-port the meth-ods [764] [765] Underfull \hbox (badness 10000) in paragraph at lines 73206--73207 [766] [767] [768] [769] [770] [771] [772] [773] Overfull \hbox (14.07869pt too wide) in paragraph at lines 74055--74055 []/pcrr8t/floating-point Overfull \hbox (24.99854pt too wide) in paragraph at lines 74055--74056 [][] [774] [775] [776] [777] [778] [779] [780] [781] [782] Underfull \hbox (badness 10000) in paragraph at lines 74788--74788 []/ptmri8t/addr, [re-questHandler, [lo-gRe-quests, [al-low_none, [en-cod-ing, Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /ptmr8t/Create a new server in-stance. All pa-ram-e-ters have the same mean-ing as for Underfull \hbox (badness 10000) in paragraph at lines 74789--74792 /pcrr8t/SimpleXMLRPCServer.SimpleXMLRPCServer/ptmr8t/; /ptmri8t/re-questHandler /ptmr8t/de-faults to [783] Overfull \hbox (57.12117pt too wide) in paragraph at lines 74838--74845 /ptmr8t/The /pcrr8t/DocCGIXMLRPCRequestHandler /ptmr8t/class is de-rived from / pcrr8t/SimpleXMLRPCServer.CGIXMLRPCRequestHandler [784] Chapter 22. [785] [786] [787] [788] Underfull \hbox (badness 10000) in paragraph at lines 75257--75258 [789] [790] [791] Underfull \hbox (badness 10000) in paragraph at lines 75632--75634 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, [792] Underfull \hbox (badness 10000) in paragraph at lines 75710--75713 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [793] Underfull \hbox (badness 10000) in paragraph at lines 75829--75831 /ptmr8t/Returns a tu-ple /pcrr8t/(nchannels, sampwidth, framerate, nframes, com ptype, Underfull \hbox (badness 10000) in paragraph at lines 75909--75912 /ptmr8t/The /ptmri8t/tu-ple /ptmr8t/should be /pcrr8t/(nchannels, sampwidth, fr amerate, nframes, comptype, [794] [795] Underfull \hbox (badness 5475) in paragraph at lines 76102--76105 []/ptmr8t/More in-for-ma-tion about color spaces can be found at [][]http://www .poynton.com/ColorFAQ.html[][] and [796] [797] [798] [799] [800] Underfull \hbox (badness 10000) in paragraph at lines 76718--76722 /ptmr8t/Returns the vol-ume of a given mixer con-trol. The re-turned vol-ume is a 2-tuple [801] [802] Chapter 23. [803] [804] [805] Underfull \hbox (badness 10000) in paragraph at lines 77113--77118 /ptmr8t/The /pcrr8t/gettext /ptmr8t/mod-ule pro-vides one ad-di-tional class de -rived from /pcrr8t/NullTranslations/ptmr8t/: [806] [807] [808] [809] [810] [811] Overfull \hbox (30.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_NUMERIC| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'decimal_point'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'thousands_sep'| Overfull \hbox (36.34413pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/LC_MONETARY| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_curr_symbol'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'currency_symbol'| Overfull \hbox (90.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_cs_precedes/n_cs_precedes'| Overfull \hbox (102.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sep_by_space/n_sep_by_space'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_decimal_point'| Overfull \hbox (18.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'int_frac_digits'| Overfull \hbox (30.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_thousands_sep'| Overfull \hbox (0.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'mon_grouping'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'positive_sign'| Overfull \hbox (6.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'negative_sign'| Overfull \hbox (66.9278pt too wide) in paragraph at lines 77686--77686 []/pcrr8t/'p_sign_posn/n_sign_posn'| Overfull \hbox (24.99313pt too wide) in paragraph at lines 77686--77687 [][] [812] [813] [814] [815] [816] [817] [818] Chapter 24. [819] [820] [821] [822] [823] [824] Chapter 25. [825] [826] [827] [828] [829] [830] [831] [832] Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 []/ptmr8t/This is al-most al-ways the /pcrr8t/set() /ptmr8t/method of some scro ll-bar wid-get, Underfull \hbox (badness 10000) in paragraph at lines 79417--79421 /ptmr8t/but can be any wid-get method that takes a sin-gle ar-gu-ment. Re-fer t o the file [833] [834] [835] [836] [837] [838] [839] [840] [841] [842] [843] [844] [845] [846] [847] [848] Underfull \hbox (badness 10000) in paragraph at lines 81034--81036 [] [849] [850] [851] [852] [853] [854] [855] [856] [857] [858] [859] [860] [861] [862] [863] Overfull \hbox (22.8553pt too wide) in paragraph at lines 82620--82620 []/ptmr8t/planet_and_moon| [864] [865] [866] [867] [868] Chapter 26. [869] [870] [871] [872] [873] [874] [875] Underfull \hbox (badness 10000) in paragraph at lines 83613--83615 /ptmr8t/Changed in ver-sion 2.4: The abil-ity to han-dle a multi-line ex-cep-ti on de-tail, and the [876] Underfull \hbox (badness 10000) in paragraph at lines 83673--83679 /ptmr8t/may go away when Python re-leases prior to 2.4 be-come un-in-ter-est-in g. Un-til then, [877] Overfull \hbox (82.23183pt too wide) in paragraph at lines 83752--83758 [][] Underfull \hbox (badness 10000) in paragraph at lines 83752--83758 [878] Underfull \hbox (badness 10000) in paragraph at lines 83811--83826 /pcrr8t/ELLIPSIS/ptmr8t/, /pcrr8t/IGNORE_EXCEPTION_DETAIL/ptmr8t/, /pcrr8t/REPO RT_UDIFF/ptmr8t/, /pcrr8t/REPORT_CDIFF/ptmr8t/, /pcrr8t/REPORT_NDIFF/ptmr8t/, Underfull \hbox (badness 7064) in paragraph at lines 83828--83833 /ptmr8t/Create a new op-tion flag with a given name, and re-turn the new flag's in-te-ger value. [879] Underfull \hbox (badness 10000) in paragraph at lines 83947--83949 []/ptmr8t/Optional ar-gu-ment /ptmri8t/name /ptmr8t/gives the name of the test; by de-fault, or if /pcrr8t/None/ptmr8t/, [880] [881] [882] [883] [884] [885] [886] [887] [888] [889] Underfull \hbox (badness 6910) in paragraph at lines 84820--84822 []/ptmr8t/For in-for-ma-tion about the con-struc-tor pa-ram-e-ters and meth-ods , see the doc-u-men-ta-tion for [890] [891] [892] [893] [894] [895] Underfull \hbox (badness 10000) in paragraph at lines 85291--85294 []/ptmr8t/will cre-ate a test suite that will run /pcrr8t/WidgetTestCase.testDe faultSize() /ptmr8t/and [896] [897] [898] [899] [900] Underfull \hbox (badness 5288) in paragraph at lines 85844--85853 []/ptmr8t/For ex-am-ple, if you have a mod-ule /pcrr8t/SampleTests /ptmr8t/con- tain-ing a /pcrr8t/TestCase/ptmr8t/-derived class [901] [902] Underfull \hbox (badness 10000) in paragraph at lines 86011--86012 [903] [904] [905] [906] [907] [908] Chapter 27. [909] [910] [911] [912] [913] [914] [915] [916] [917] [918] [919] [920] [921] [922] [923] [924] [925] [926] [927] [928] [929] [930] Chapter 28. [931] Underfull \hbox (badness 10000) in paragraph at lines 88510--88511 [932] [933] Underfull \hbox (badness 6001) in paragraph at lines 88795--88799 []/ptmr8t/On Win-dows NT+, file names are Uni-code na-tively, so no con-ver-sio n is per-formed. [934] [935] [936] [937] [938] [939] [940] Overfull \hbox (33.31012pt too wide) in paragraph at lines 89556--89556 []/pcrr8t/PendingDeprecationWarning| Overfull \hbox (22.45828pt too wide) in paragraph at lines 89625--89626 [][] [941] [942] [943] [944] [945] [946] [947] [948] Underfull \hbox (badness 10000) in paragraph at lines 90328--90332 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.exc_type, sys.exc_ value, [949] Underfull \hbox (badness 10000) in paragraph at lines 90342--90344 /ptmr8t/This is a short-hand for /pcrr8t/print_exception(sys.last_type, sys.las t_value, [950] [951] [952] Underfull \hbox (badness 6575) in paragraph at lines 90629--90631 []/ptmr8t/Instances of class /pcrr8t/_Feature /ptmr8t/have two cor-re-spond-ing meth-ods, /pcrr8t/getOptionalRelease() /ptmr8t/and [953] [954] Underfull \hbox (badness 5592) in paragraph at lines 90832--90835 /ptmr8t/The de-bug-ging flags nec-es-sary for the col-lec-tor to print in-for-m a-tion about a leak-ing pro- [955] Overfull \hbox (6.01671pt too wide) in paragraph at lines 91238--91238 [] /ptmb8t/Notes| Overfull \hbox (0.99947pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/method| Overfull \hbox (2.11691pt too wide) in paragraph at lines 91238--91238 []/ptmr8t/f_exc_traceback| [956] Overfull \vbox (63.69313pt too high) has occurred while \output is active [957] [958] [959] Underfull \hbox (badness 10000) in paragraph at lines 91534--91535 [960] [961] [962] [963] Underfull \hbox (badness 6396) in paragraph at lines 91863--91868 []/ptmr8t/Conversion of an IEEE-754 ex-cep-tion to a Python ex-cep-tion re-quir es that the wrap-per macros [964] [965] [966] Chapter 29. Underfull \hbox (badness 6016) in paragraph at lines 91919--91922 /ptmr8t/Closely em-u-late the be-hav-ior of the in-ter-ac-tive Python in-ter-pr eter. This class builds on Underfull \hbox (badness 10000) in paragraph at lines 91926--91933 /ptmr8t/Convenience func-tion to run a read-eval-print loop. This cre-ates a ne w in-stance of [967] [968] [969] [970] Chapter 30. Underfull \hbox (badness 10000) in paragraph at lines 92169--92170 Overfull \hbox (85.05946pt too wide) in paragraph at lines 92219--92224 /ptmr8t/abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92219--92224 Underfull \hbox (badness 10000) in paragraph at lines 92241--92242 [971] [972] Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /ptmr8t/is /pcrr8t/('audioop', 'array', 'binascii', 'cmath', 'errno', 'imageop' , Underfull \hbox (badness 10000) in paragraph at lines 92417--92422 /pcrr8t/'marshal', 'math', 'md5', 'operator', 'parser', 'regex', 'select', Underfull \hbox (badness 10000) in paragraph at lines 92433--92438 /pcrr8t/'readlink', 'stat', 'times', 'uname', 'getpid', 'getppid', 'getcwd', [973] Overfull \hbox (98.94922pt too wide) in paragraph at lines 92499--92504 /ptmr8t/Dis-abled mod-ule. [] Underfull \hbox (badness 10000) in paragraph at lines 92499--92504 [974] [975] [976] Chapter 31. [977] [978] [979] [980] [981] [982] [983] [984] [985] [986] [987] [988] Chapter 32. [989] [990] [991] [992] [993] [994] [995] [996] [997] [998] [999] [1000] [1001] [1002] [1003] [1004] [1005] [1006] [1007] [1008] [1009] [1010] [1011] [1012] [1013] [1014] [1015] [1016] [1017] [1018] Chapter 33. [1019] [1020] [1021] Overfull \vbox (951.69313pt too high) has occurred while \output is active [1022] [1023] [1024] Chapter 34. [1025] [1026] [1027] [1028] Chapter 35. [1029] Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /ptmr8t/Modify the view, by call-ing /pcrr8t/MsiViewModify/ptmr8t/. /ptmri8t/ki nd /ptmr8t/can be one of Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_SEEK/ptmr8t/, /pcrr8t/MSIMODIFY_REFRESH/ptmr8t/, /pcrr8t/MSIM ODIFY_INSERT/ptmr8t/, /pcrr8t/MSIMODIFY_UPDATE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_ASSIGN/ptmr8t/, /pcrr8t/MSIMODIFY_REPLACE/ptmr8t/, /pcrr8t/MS IMODIFY_MERGE/ptmr8t/, /pcrr8t/MSIMODIFY_DELETE/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97709--97715 /pcrr8t/MSIMODIFY_INSERT_TEMPORARY/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE/ptmr8t/, /pcrr8t/MSIMODIFY_VALIDATE_NEW/ptmr8t/, [1030] Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_AUTHOR/ptmr8t/, /pcrr8t/PID_KEYWORDS/ptmr8t/, /pcrr8t/PID_COMMENTS/ ptmr8t/, /pcrr8t/PID_TEMPLATE/ptmr8t/, /pcrr8t/PID_LASTAUTHOR/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 97741--97748 /pcrr8t/PID_REVNUMBER/ptmr8t/, /pcrr8t/PID_LASTPRINTED/ptmr8t/, /pcrr8t/PID_CRE ATE_DTM/ptmr8t/, /pcrr8t/PID_LASTSAVE_DTM/ptmr8t/, [1031] [1032] [1033] [1034] [1035] [1036] Overfull \hbox (25.00525pt too wide) in paragraph at lines 98491--98492 [][] [1037] Overfull \hbox (43.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_LITTLE_ENDIAN| Overfull \hbox (25.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_DWORD_BIG_ENDIAN| Overfull \hbox (7.37585pt too wide) in paragraph at lines 98670--98670 []/pcrr8t/REG_RESOURCE_LIST| Overfull \hbox (25.01274pt too wide) in paragraph at lines 98670--98671 [][] [1038] [1039] [1040] [1041] [1042] Chapter 36. [1043] [1044] [1045] Underfull \hbox (badness 10000) in paragraph at lines 99440--99441 [1046] [1047] [1048] [1049] [1050] [1051] [1052] [1053] [1054] [1055] [1056] Underfull \hbox (badness 10000) in paragraph at lines 100685--100688 []/pcrr8t/LOG_EMERG/ptmr8t/, /pcrr8t/LOG_ALERT/ptmr8t/, /pcrr8t/LOG_CRIT/ptmr8t /, /pcrr8t/LOG_ERR/ptmr8t/, /pcrr8t/LOG_WARNING/ptmr8t/, [1057] Underfull \hbox (badness 10000) in paragraph at lines 100721--100722 [1058] Chapter 37. Underfull \hbox (badness 10000) in paragraph at lines 100788--100789 [1059] Underfull \hbox (badness 10000) in paragraph at lines 100926--100927 [1060] Underfull \hbox (badness 10000) in paragraph at lines 101050--101051 [1061] [1062] Underfull \hbox (badness 10000) in paragraph at lines 101165--101166 [1063] [1064] Underfull \hbox (badness 10000) in paragraph at lines 101393--101394 [1065] [1066] [1067] Underfull \hbox (badness 10000) in paragraph at lines 101755--101756 [1068] [1069] [1070] [1071] [1072] Chapter 38. [1073] [1074] Underfull \hbox (badness 10000) in paragraph at lines 102191--102192 Underfull \hbox (badness 10000) in paragraph at lines 102270--102271 [1075] [1076] Underfull \hbox (badness 10000) in paragraph at lines 102420--102421 [1077] [1078] Chapter 39. Underfull \hbox (badness 10000) in paragraph at lines 102638--102639 [1079] [1080] [1081] [1082] Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/audio| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/index| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ptime| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/atime| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/catalog| Overfull \hbox (4.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/ident| Overfull \hbox (16.80948pt too wide) in paragraph at lines 103137--103137 []/pcrr8t/control| Overfull \hbox (24.99579pt too wide) in paragraph at lines 103137--103138 [][] [1083] [1084] [1085] Underfull \hbox (badness 10000) in paragraph at lines 103421--103425 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103429--103433 /pcrr8t/set_slider_bounds()/ptmr8t/, /pcrr8t/get_slider_bounds()/ptmr8t/, /pcrr 8t/set_slider_return()/ptmr8t/, [1086] Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /ptmr8t/Add a po-si-tioner ob-ject to the form. --- Meth-ods: /pcrr8t/set_posit ioner_xvalue()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_yvalue()/ptmr8t/, /pcrr8t/set_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/set_positioner_ybounds()/ptmr8t/, /pcrr8t/get_positioner_xvalue()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103443--103448 /pcrr8t/get_positioner_yvalue()/ptmr8t/, /pcrr8t/get_positioner_xbounds()/ptmr8 t/, Underfull \hbox (badness 10000) in paragraph at lines 103452--103455 /pcrr8t/set_counter_bounds()/ptmr8t/, /pcrr8t/set_counter_step()/ptmr8t/, /pcrr 8t/set_counter_precision()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103471--103475 /pcrr8t/addto_choice()/ptmr8t/, /pcrr8t/replace_choice()/ptmr8t/, /pcrr8t/delet e_choice()/ptmr8t/, /pcrr8t/get_choice_text()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/add_browser_line()/ptmr8t/, /pcrr8t/addto_browser()/ptmr8t/, /pcrr8t/in sert_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/delete_browser_line()/ptmr8t/, /pcrr8t/replace_browser_line()/ptmr8t/, /pcrr8t/get_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/load_browser()/ptmr8t/, /pcrr8t/get_browser_maxline()/ptmr8t/, /pcrr8t/ select_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/deselect_browser_line()/ptmr8t/, /pcrr8t/deselect_browser()/ptmr8t/, /p crr8t/isselected_browser_line()/ptmr8t/, Underfull \hbox (badness 10000) in paragraph at lines 103479--103488 /pcrr8t/get_browser()/ptmr8t/, /pcrr8t/set_browser_fontsize()/ptmr8t/, /pcrr8t/ set_browser_fontstyle()/ptmr8t/, [1087] [1088]make: *** [dist] Error 143 [1089] Underfull \hbox (badness 10000) in paragraph at lines 103939--103940 [1090] [1091] [1092] Overfull \hbox (16.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'forcegray'| Overfull \hbox (4.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'quality'| Overfull \hbox (10.61642pt too wide) in paragraph at lines 104267--104267 []/pcrr8t/'optimize'| Overfull \hbox (24.99864pt too wide) in paragraph at lines 104267--104268 [][] Overfull \hbox (74.97656pt too wide) in paragraph at lines 104279--104281 [] [1093] [1094] Chapter 40. [1095] [1096] Chapter 41. Underfull \hbox (badness 10000) in paragraph at lines 104464--104465 Underfull \hbox (badness 10000) in paragraph at lines 104495--104496 Underfull \hbox (badness 10000) in paragraph at lines 104503--104504 Underfull \hbox (badness 10000) in paragraph at lines 104510--104511 [1097] Underfull \hbox (badness 10000) in paragraph at lines 104518--104519 [1098] Underfull \hbox (badness 10000) in paragraph at lines 104636--104637 Underfull \hbox (badness 10000) in paragraph at lines 104654--104655 [1099] [1100] Appendix A. [1101] [1102] [1103] [1104] From python-checkins at python.org Mon Jan 5 09:11:39 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 5 Jan 2009 09:11:39 +0100 (CET) Subject: [Python-checkins] r68340 - sandbox/trunk/2to3/lib2to3/pgen2/driver.py Message-ID: <20090105081139.EA7021E4002@bag.python.org> Author: georg.brandl Date: Mon Jan 5 09:11:39 2009 New Revision: 68340 Log: Fix undefined locals in parse_tokens(). Modified: sandbox/trunk/2to3/lib2to3/pgen2/driver.py Modified: sandbox/trunk/2to3/lib2to3/pgen2/driver.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pgen2/driver.py (original) +++ sandbox/trunk/2to3/lib2to3/pgen2/driver.py Mon Jan 5 09:11:39 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): From ziade.tarek at gmail.com Mon Jan 5 10:32:06 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Mon, 5 Jan 2009 10:32:06 +0100 Subject: [Python-checkins] r68335 - peps/trunk/pep0/pep.py In-Reply-To: <20090105013806.C9C651E4002@bag.python.org> References: <20090105013806.C9C651E4002@bag.python.org> Message-ID: <94bdd2610901050132k7db58413j31093d2fc6310a2f@mail.gmail.com> On Mon, Jan 5, 2009 at 2:38 AM, benjamin. peterson wrote: > Author: benjamin.peterson > Date: Mon Jan 5 02:38:06 2009 > New Revision: 68335 > > Log: > employ a rather nasty hack to sort umlauts properly > > Modified: > peps/trunk/pep0/pep.py > > Modified: peps/trunk/pep0/pep.py > ============================================================================== > --- peps/trunk/pep0/pep.py (original) > +++ peps/trunk/pep0/pep.py Mon Jan 5 02:38:06 2009 > @@ -1,3 +1,4 @@ > +# -*- coding: utf-8 -*- > """Code for handling object representation of a PEP.""" > import re > import textwrap > @@ -94,7 +95,9 @@ > break > else: > raise ValueError("last name missing a capital letter") > - return u' '.join(name_parts[index:]) > + # This replace() hack is so people with an umlaut will sort in the right > + # letter. > + return u' '.join(name_parts[index:]).replace(u"?", u"o") FWIW, I think you could use the unicodedata module here to normalize the names, so all kind of accented characters can be replaced in the future: import unicodedata def _normalize(name): return unicode(unicodedata.normalize('NFKD', name).encode('ASCII', 'ignore')) > > def _last_name(self, full_name): > """Find the last name (or nickname) of a full name. > _______________________________________________ > 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 martin at v.loewis.de Mon Jan 5 10:55:49 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Mon, 05 Jan 2009 10:55:49 +0100 Subject: [Python-checkins] r68335 - peps/trunk/pep0/pep.py In-Reply-To: <94bdd2610901050132k7db58413j31093d2fc6310a2f@mail.gmail.com> References: <20090105013806.C9C651E4002@bag.python.org> <94bdd2610901050132k7db58413j31093d2fc6310a2f@mail.gmail.com> Message-ID: <4961D925.6040401@v.loewis.de> > FWIW, I think you could use the unicodedata module here to normalize > the names, so all kind of accented characters > can be replaced in the future: > > import unicodedata > > def _normalize(name): > return unicode(unicodedata.normalize('NFKD', name).encode('ASCII', > 'ignore')) Well, collation is a bottomless pit. To start with: how should you collate non-English letters in an English document? Whether or not ? collates like o depends on the language - in German, it does (mostly, sometimes like oe); in Swedish (IIUC), it comes after the rest of the alphabet. I think the objective is to sort me before Tony Lownds - which is nice, but I wouldn't complain if it was otherwise (and also to sort Walter D?rwald before Fred Drake) Wrt. your approach: fortunately, Atsuo Ishimoto, Jiwon Seo, Oren Tirosh, Moshe Zadka, Huaiyu Zhu (and a few other I probably didn't recognize) don't insist on having their names correctly spelled. Otherwise, this normalization would give an empty string for them. Regards, Martin From jimjjewett at gmail.com Mon Jan 5 16:12:34 2009 From: jimjjewett at gmail.com (Jim Jewett) Date: Mon, 5 Jan 2009 10:12:34 -0500 Subject: [Python-checkins] r68182 - in python/trunk: Lib/decimal.py Misc/NEWS In-Reply-To: <20090102230709.032011E4002@bag.python.org> References: <20090102230709.032011E4002@bag.python.org> Message-ID: Our of curiousity, why are these constants for internal use only? Is there concern that people might start using "is", or is it just to keep the (beyond the spec) API small, or ...? -jJ On Fri, Jan 2, 2009 at 6:07 PM, mark. dickinson wrote: > Author: mark.dickinson > Date: Sat Jan 3 00:07:08 2009 > New Revision: 68182 > > Log: > Issue #4812: add missing underscore prefix to some internal-use-only > constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) > > > > Modified: > python/trunk/Lib/decimal.py > python/trunk/Misc/NEWS > > Modified: python/trunk/Lib/decimal.py > ============================================================================== > --- python/trunk/Lib/decimal.py (original) > +++ python/trunk/Lib/decimal.py Sat Jan 3 00:07:08 2009 > @@ -216,7 +216,7 @@ > if args: > ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) > return ans._fix_nan(context) > - return NaN > + return _NaN > > class ConversionSyntax(InvalidOperation): > """Trying to convert badly formed string. > @@ -226,7 +226,7 @@ > syntax. The result is [0,qNaN]. > """ > def handle(self, context, *args): > - return NaN > + return _NaN > > class DivisionByZero(DecimalException, ZeroDivisionError): > """Division by 0. > @@ -242,7 +242,7 @@ > """ > > def handle(self, context, sign, *args): > - return Infsign[sign] > + return _Infsign[sign] > > class DivisionImpossible(InvalidOperation): > """Cannot perform the division adequately. > @@ -253,7 +253,7 @@ > """ > > def handle(self, context, *args): > - return NaN > + return _NaN > > class DivisionUndefined(InvalidOperation, ZeroDivisionError): > """Undefined result of division. > @@ -264,7 +264,7 @@ > """ > > def handle(self, context, *args): > - return NaN > + return _NaN > > class Inexact(DecimalException): > """Had to round, losing information. > @@ -290,7 +290,7 @@ > """ > > def handle(self, context, *args): > - return NaN > + return _NaN > > class Rounded(DecimalException): > """Number got rounded (not necessarily changed during rounding). > @@ -340,15 +340,15 @@ > def handle(self, context, sign, *args): > if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, > ROUND_HALF_DOWN, ROUND_UP): > - return Infsign[sign] > + return _Infsign[sign] > if sign == 0: > if context.rounding == ROUND_CEILING: > - return Infsign[sign] > + return _Infsign[sign] > return _dec_from_triple(sign, '9'*context.prec, > context.Emax-context.prec+1) > if sign == 1: > if context.rounding == ROUND_FLOOR: > - return Infsign[sign] > + return _Infsign[sign] > return _dec_from_triple(sign, '9'*context.prec, > context.Emax-context.prec+1) > > @@ -1171,12 +1171,12 @@ > if self._isinfinity(): > if not other: > return context._raise_error(InvalidOperation, '(+-)INF * 0') > - return Infsign[resultsign] > + return _Infsign[resultsign] > > if other._isinfinity(): > if not self: > return context._raise_error(InvalidOperation, '0 * (+-)INF') > - return Infsign[resultsign] > + return _Infsign[resultsign] > > resultexp = self._exp + other._exp > > @@ -1226,7 +1226,7 @@ > return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') > > if self._isinfinity(): > - return Infsign[sign] > + return _Infsign[sign] > > if other._isinfinity(): > context._raise_error(Clamped, 'Division by infinity') > @@ -1329,7 +1329,7 @@ > ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') > return ans, ans > else: > - return (Infsign[sign], > + return (_Infsign[sign], > context._raise_error(InvalidOperation, 'INF % x')) > > if not other: > @@ -1477,7 +1477,7 @@ > if other._isinfinity(): > return context._raise_error(InvalidOperation, 'INF // INF') > else: > - return Infsign[self._sign ^ other._sign] > + return _Infsign[self._sign ^ other._sign] > > if not other: > if self: > @@ -1732,12 +1732,12 @@ > if not other: > return context._raise_error(InvalidOperation, > 'INF * 0 in fma') > - product = Infsign[self._sign ^ other._sign] > + product = _Infsign[self._sign ^ other._sign] > elif other._exp == 'F': > if not self: > return context._raise_error(InvalidOperation, > '0 * INF in fma') > - product = Infsign[self._sign ^ other._sign] > + product = _Infsign[self._sign ^ other._sign] > else: > product = _dec_from_triple(self._sign ^ other._sign, > str(int(self._int) * int(other._int)), > @@ -2087,7 +2087,7 @@ > if not self: > return context._raise_error(InvalidOperation, '0 ** 0') > else: > - return Dec_p1 > + return _Dec_p1 > > # result has sign 1 iff self._sign is 1 and other is an odd integer > result_sign = 0 > @@ -2109,19 +2109,19 @@ > if other._sign == 0: > return _dec_from_triple(result_sign, '0', 0) > else: > - return Infsign[result_sign] > + return _Infsign[result_sign] > > # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 > if self._isinfinity(): > if other._sign == 0: > - return Infsign[result_sign] > + return _Infsign[result_sign] > else: > return _dec_from_triple(result_sign, '0', 0) > > # 1**other = 1, but the choice of exponent and the flags > # depend on the exponent of self, and on whether other is a > # positive integer, a negative integer, or neither > - if self == Dec_p1: > + if self == _Dec_p1: > if other._isinteger(): > # exp = max(self._exp*max(int(other), 0), > # 1-context.prec) but evaluating int(other) directly > @@ -2154,7 +2154,7 @@ > if (other._sign == 0) == (self_adj < 0): > return _dec_from_triple(result_sign, '0', 0) > else: > - return Infsign[result_sign] > + return _Infsign[result_sign] > > # from here on, the result always goes through the call > # to _fix at the end of this function. > @@ -2674,9 +2674,9 @@ > """ > # if one is negative and the other is positive, it's easy > if self._sign and not other._sign: > - return Dec_n1 > + return _Dec_n1 > if not self._sign and other._sign: > - return Dec_p1 > + return _Dec_p1 > sign = self._sign > > # let's handle both NaN types > @@ -2686,51 +2686,51 @@ > if self_nan == other_nan: > if self._int < other._int: > if sign: > - return Dec_p1 > + return _Dec_p1 > else: > - return Dec_n1 > + return _Dec_n1 > if self._int > other._int: > if sign: > - return Dec_n1 > + return _Dec_n1 > else: > - return Dec_p1 > - return Dec_0 > + return _Dec_p1 > + return _Dec_0 > > if sign: > if self_nan == 1: > - return Dec_n1 > + return _Dec_n1 > if other_nan == 1: > - return Dec_p1 > + return _Dec_p1 > if self_nan == 2: > - return Dec_n1 > + return _Dec_n1 > if other_nan == 2: > - return Dec_p1 > + return _Dec_p1 > else: > if self_nan == 1: > - return Dec_p1 > + return _Dec_p1 > if other_nan == 1: > - return Dec_n1 > + return _Dec_n1 > if self_nan == 2: > - return Dec_p1 > + return _Dec_p1 > if other_nan == 2: > - return Dec_n1 > + return _Dec_n1 > > if self < other: > - return Dec_n1 > + return _Dec_n1 > if self > other: > - return Dec_p1 > + return _Dec_p1 > > if self._exp < other._exp: > if sign: > - return Dec_p1 > + return _Dec_p1 > else: > - return Dec_n1 > + return _Dec_n1 > if self._exp > other._exp: > if sign: > - return Dec_n1 > + return _Dec_n1 > else: > - return Dec_p1 > - return Dec_0 > + return _Dec_p1 > + return _Dec_0 > > > def compare_total_mag(self, other): > @@ -2771,11 +2771,11 @@ > > # exp(-Infinity) = 0 > if self._isinfinity() == -1: > - return Dec_0 > + return _Dec_0 > > # exp(0) = 1 > if not self: > - return Dec_p1 > + return _Dec_p1 > > # exp(Infinity) = Infinity > if self._isinfinity() == 1: > @@ -2927,15 +2927,15 @@ > > # ln(0.0) == -Infinity > if not self: > - return negInf > + return _negInf > > # ln(Infinity) = Infinity > if self._isinfinity() == 1: > - return Inf > + return _Inf > > # ln(1.0) == 0.0 > - if self == Dec_p1: > - return Dec_0 > + if self == _Dec_p1: > + return _Dec_0 > > # ln(negative) raises InvalidOperation > if self._sign == 1: > @@ -3007,11 +3007,11 @@ > > # log10(0.0) == -Infinity > if not self: > - return negInf > + return _negInf > > # log10(Infinity) = Infinity > if self._isinfinity() == 1: > - return Inf > + return _Inf > > # log10(negative or -Infinity) raises InvalidOperation > if self._sign == 1: > @@ -3063,7 +3063,7 @@ > > # logb(+/-Inf) = +Inf > if self._isinfinity(): > - return Inf > + return _Inf > > # logb(0) = -Inf, DivisionByZero > if not self: > @@ -3220,7 +3220,7 @@ > return ans > > if self._isinfinity() == -1: > - return negInf > + return _negInf > if self._isinfinity() == 1: > return _dec_from_triple(0, '9'*context.prec, context.Etop()) > > @@ -3243,7 +3243,7 @@ > return ans > > if self._isinfinity() == 1: > - return Inf > + return _Inf > if self._isinfinity() == -1: > return _dec_from_triple(1, '9'*context.prec, context.Etop()) > > @@ -5490,15 +5490,15 @@ > ##### Useful Constants (internal use only) ################################ > > # Reusable defaults > -Inf = Decimal('Inf') > -negInf = Decimal('-Inf') > -NaN = Decimal('NaN') > -Dec_0 = Decimal(0) > -Dec_p1 = Decimal(1) > -Dec_n1 = Decimal(-1) > +_Inf = Decimal('Inf') > +_negInf = Decimal('-Inf') > +_NaN = Decimal('NaN') > +_Dec_0 = Decimal(0) > +_Dec_p1 = Decimal(1) > +_Dec_n1 = Decimal(-1) > > -# Infsign[sign] is infinity w/ that sign > -Infsign = (Inf, negInf) > +# _Infsign[sign] is infinity w/ that sign > +_Infsign = (_Inf, _negInf) > > > > > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Sat Jan 3 00:07:08 2009 > @@ -108,6 +108,9 @@ > Library > ------- > > +- Issue #4812: add missing underscore prefix to some internal-use-only > + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) > + > - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when > the function is not a generator. > > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From python-checkins at python.org Mon Jan 5 18:08:27 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 5 Jan 2009 18:08:27 +0100 (CET) Subject: [Python-checkins] r68341 - in python/branches/py3k: Include/pymath.h Message-ID: <20090105170827.E24481E4016@bag.python.org> Author: mark.dickinson Date: Mon Jan 5 18:08:27 2009 New Revision: 68341 Log: Merged revisions 68311 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68311 | mark.dickinson | 2009-01-04 19:53:00 +0000 (Sun, 04 Jan 2009) | 2 lines Use C99 'isfinite' macro in preference to BSD-derived 'finite' function. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/pymath.h Modified: python/branches/py3k/Include/pymath.h ============================================================================== --- python/branches/py3k/Include/pymath.h (original) +++ python/branches/py3k/Include/pymath.h Mon Jan 5 18:08:27 2009 @@ -118,7 +118,9 @@ * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE -#ifdef HAVE_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) From python-checkins at python.org Mon Jan 5 18:10:09 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 5 Jan 2009 18:10:09 +0100 (CET) Subject: [Python-checkins] r68342 - in python/branches/py3k: configure configure.in Message-ID: <20090105171009.AD7C41E4029@bag.python.org> Author: mark.dickinson Date: Mon Jan 5 18:10:09 2009 New Revision: 68342 Log: Merged revisions 68312 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68312 | mark.dickinson | 2009-01-04 20:19:41 +0000 (Sun, 04 Jan 2009) | 4 lines It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any Python/hypot.c replacement file. Use AC_CHECK_FUNCS instead. This change should be backported to 2.6 and 3.0. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/configure python/branches/py3k/configure.in Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Mon Jan 5 18:10:09 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68245 . +# From configure.in Revision: 68300 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -21379,108 +21379,6 @@ fi -for ac_func in hypot -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; 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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "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 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - -fi -done - - - @@ -21488,7 +21386,7 @@ -for ac_func in acosh asinh atanh copysign expm1 finite log1p +for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Mon Jan 5 18:10:09 2009 @@ -3120,9 +3120,7 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_REPLACE_FUNCS(hypot) - -AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite log1p]) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p]) AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE From buildbot at python.org Mon Jan 5 19:03:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 05 Jan 2009 18:03:34 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090105180334.CE7CB1E4002@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/68 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_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 python-checkins at python.org Mon Jan 5 20:41:31 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 5 Jan 2009 20:41:31 +0100 (CET) Subject: [Python-checkins] r68343 - in python/branches/release26-maint: configure configure.in Message-ID: <20090105194131.679361E4002@bag.python.org> Author: mark.dickinson Date: Mon Jan 5 20:41:31 2009 New Revision: 68343 Log: Merged revisions 68312 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68312 | mark.dickinson | 2009-01-04 20:19:41 +0000 (Sun, 04 Jan 2009) | 4 lines It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any Python/hypot.c replacement file. Use AC_CHECK_FUNCS instead. This change should be backported to 2.6 and 3.0. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/configure python/branches/release26-maint/configure.in Modified: python/branches/release26-maint/configure ============================================================================== --- python/branches/release26-maint/configure (original) +++ python/branches/release26-maint/configure Mon Jan 5 20:41:31 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67565 . +# From configure.in Revision: 68147 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -21600,108 +21600,6 @@ fi -for ac_func in hypot -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; 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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "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 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - -fi -done - - - @@ -21711,7 +21609,7 @@ -for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p +for ac_func in acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 Modified: python/branches/release26-maint/configure.in ============================================================================== --- python/branches/release26-maint/configure.in (original) +++ python/branches/release26-maint/configure.in Mon Jan 5 20:41:31 2009 @@ -3169,9 +3169,7 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_REPLACE_FUNCS(hypot) - -AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p]) LIBS=$LIBS_SAVE From python-checkins at python.org Mon Jan 5 20:43:35 2009 From: python-checkins at python.org (marc-andre.lemburg) Date: Mon, 5 Jan 2009 20:43:35 +0100 (CET) Subject: [Python-checkins] r68344 - python/trunk/Include/unicodeobject.h Message-ID: <20090105194335.DD3EE1E4002@bag.python.org> Author: marc-andre.lemburg Date: Mon Jan 5 20:43:35 2009 New Revision: 68344 Log: Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. Modified: python/trunk/Include/unicodeobject.h Modified: python/trunk/Include/unicodeobject.h ============================================================================== --- python/trunk/Include/unicodeobject.h (original) +++ python/trunk/Include/unicodeobject.h Mon Jan 5 20:43:35 2009 @@ -130,6 +130,10 @@ typedef unsigned long Py_UCS4; #endif +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + typedef PY_UNICODE_TYPE Py_UNICODE; /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ @@ -350,12 +354,12 @@ #else -/* Since splitting on whitespace is an important use case, and whitespace - in most situations is solely ASCII whitespace, we optimize for the common - case by using a quick look-up table with an inlined check. - */ -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + */ #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) @@ -389,13 +393,14 @@ #define Py_UNICODE_COPY(target, source, length) \ Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) -#define Py_UNICODE_FILL(target, value, length) do\ - {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) -/* check if substring matches at given offset. the offset must be +/* Check if substring matches at given offset. the offset must be valid, and the substring must not be empty */ + #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->str + (offset)) == *((substring)->str)) && \ ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ @@ -405,8 +410,6 @@ extern "C" { #endif -PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); - /* --- Unicode Type ------------------------------------------------------- */ typedef struct { @@ -605,6 +608,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These @@ -1323,6 +1337,10 @@ /* === Characters Type APIs =============================================== */ +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. From python-checkins at python.org Mon Jan 5 20:53:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 5 Jan 2009 20:53:37 +0100 (CET) Subject: [Python-checkins] r68345 - in python/branches/release30-maint: configure configure.in Message-ID: <20090105195337.169901E4002@bag.python.org> Author: mark.dickinson Date: Mon Jan 5 20:53:36 2009 New Revision: 68345 Log: Merged revisions 68342 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68342 | mark.dickinson | 2009-01-05 17:10:09 +0000 (Mon, 05 Jan 2009) | 11 lines Merged revisions 68312 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68312 | mark.dickinson | 2009-01-04 20:19:41 +0000 (Sun, 04 Jan 2009) | 4 lines It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any Python/hypot.c replacement file. Use AC_CHECK_FUNCS instead. This change should be backported to 2.6 and 3.0. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/configure python/branches/release30-maint/configure.in Modified: python/branches/release30-maint/configure ============================================================================== --- python/branches/release30-maint/configure (original) +++ python/branches/release30-maint/configure Mon Jan 5 20:53:36 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67100 . +# From configure.in Revision: 68280 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.0. # @@ -21291,108 +21291,6 @@ fi -for ac_func in hypot -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; 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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "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 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - -fi -done - - - @@ -21402,7 +21300,7 @@ -for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p +for ac_func in acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 Modified: python/branches/release30-maint/configure.in ============================================================================== --- python/branches/release30-maint/configure.in (original) +++ python/branches/release30-maint/configure.in Mon Jan 5 20:53:36 2009 @@ -3082,9 +3082,7 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_REPLACE_FUNCS(hypot) - -AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p]) LIBS=$LIBS_SAVE From python-checkins at python.org Mon Jan 5 20:55:28 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 5 Jan 2009 20:55:28 +0100 (CET) Subject: [Python-checkins] r68346 - sandbox/trunk/io-c/test_io.py Message-ID: <20090105195528.34C741E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 5 20:55:27 2009 New Revision: 68346 Log: More test improvements Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 5 20:55:27 2009 @@ -44,10 +44,10 @@ return True def seek(self, pos, whence): - pass + return 0 # wrong but we gotta return something def tell(self): - return -1 + return 0 # same comment as above def readinto(self, buf): max_len = len(buf) @@ -67,6 +67,9 @@ buf[:] = data[:max_len] self._read_stack[0] = data[max_len:] return max_len + + def truncate(self, pos=None): + return pos class MockFileIO(io.BytesIO): @@ -100,6 +103,12 @@ """Block when a given char is encountered.""" self._blocker_char = char + def readable(self): + return True + + def seekable(self): + return True + def writable(self): return True @@ -300,7 +309,7 @@ def test_array_writes(self): a = array.array('i', range(10)) - n = len(memoryview(a)) + n = len(a.tostring()) f = io.open(support.TESTFN, "wb", 0) self.assertEqual(f.write(a), n) f.close() @@ -394,11 +403,27 @@ EOF = "" -class BufferedReaderTest(unittest.TestCase): - +class CommonBufferedTests: + # Tests common to BufferedReader, BufferedWriter and BufferedRandom + def testFileno(self): + rawio = MockRawIO() + bufio = self.tp(rawio) + + self.assertEquals(42, bufio.fileno()) + + def testFilenoNoFileno(self): + # XXX will we always have fileno() function? If so, kill + # this test. Else, write it. + pass + + +class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): + tp = io.BufferedReader + read_mode = "rb" + def testConstructor(self): rawio = MockRawIO([b"abc"]) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) bufio.__init__(rawio) bufio.__init__(rawio, buffer_size=1024) bufio.__init__(rawio, buffer_size=16) @@ -409,15 +434,15 @@ self.assertRaises(ValueError, bufio.read) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) self.assertRaises(ValueError, bufio.read) - #self.assertRaises((OverflowError, MemoryError, ValueError), - #bufio.__init__, rawio, sys.maxsize) + self.assertRaises((OverflowError, MemoryError, ValueError), + bufio.__init__, rawio, sys.maxsize) rawio = MockRawIO([b"abc"]) bufio.__init__(rawio) self.assertEquals(b"abc", bufio.read()) def testRead(self): rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) self.assertEquals(b"abcdef", bufio.read(6)) @@ -433,7 +458,7 @@ for bufsize, buf_read_sizes, raw_read_sizes in tests: rawio = MockFileIO(data) - bufio = io.BufferedReader(rawio, buffer_size=bufsize) + bufio = self.tp(rawio, buffer_size=bufsize) pos = 0 for nbytes in buf_read_sizes: self.assertEquals(bufio.read(nbytes), data[pos:pos+nbytes]) @@ -444,7 +469,7 @@ def testReadNonBlocking(self): # Inject some None's in there to simulate EWOULDBLOCK rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None)) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) self.assertEquals(b"abcd", bufio.read(6)) self.assertEquals(b"e", bufio.read(1)) @@ -454,27 +479,16 @@ def testReadToEof(self): rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read(9000)) def testReadNoArgs(self): rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read()) - def testFileno(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) - - self.assertEquals(42, bufio.fileno()) - - def testFilenoNoFileno(self): - # XXX will we always have fileno() function? If so, kill - # this test. Else, write it. - pass - def testThreads(self): try: # Write out many bytes with exactly the same number of 0's, @@ -486,8 +500,8 @@ s = bytes(bytearray(l)) with io.open(support.TESTFN, "wb") as f: f.write(s) - with io.open(support.TESTFN, "rb", buffering=0) as raw: - bufio = io.BufferedReader(raw, 8) + with io.open(support.TESTFN, self.read_mode, buffering=0) as raw: + bufio = self.tp(raw, 8) errors = [] results = [] def f(): @@ -518,12 +532,13 @@ support.unlink(support.TESTFN) - -class BufferedWriterTest(unittest.TestCase): +class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): + tp = io.BufferedWriter + write_mode = "wb" def testConstructor(self): rawio = MockRawIO() - bufio = io.BufferedWriter(rawio) + bufio = self.tp(rawio) bufio.__init__(rawio) bufio.__init__(rawio, buffer_size=1024) bufio.__init__(rawio, buffer_size=16) @@ -545,13 +560,13 @@ def testWrite(self): # Write to the buffered IO but don't overflow the buffer. writer = MockRawIO() - bufio = io.BufferedWriter(writer, 8) + bufio = self.tp(writer, 8) bufio.write(b"abc") self.assertFalse(writer._write_stack) def testWriteOverflow(self): writer = MockRawIO() - bufio = io.BufferedWriter(writer, 8) + bufio = self.tp(writer, 8) contents = b"abcdefghijklmnop" for n in range(0, len(contents), 3): bufio.write(contents[n:n+3]) @@ -565,7 +580,7 @@ contents = bytes(range(256)) * 1000 n = 0 writer = MockRawIO() - bufio = io.BufferedWriter(writer, 13) + bufio = self.tp(writer, 13) # Generator of write sizes: repeat each N 15 times then proceed to N+1 def gen_sizes(): for size in count(1): @@ -586,12 +601,12 @@ def testWritesAndFlushes(self): self.check_writes(lambda bufio: bufio.flush()) - def testWritesAndSeeks(self): - self.check_writes(lambda bufio: bufio.seek(0, 1)) + def testWritesAndTruncates(self): + self.check_writes(lambda bufio: bufio.truncate(bufio.tell())) def testWriteNonBlocking(self): raw = MockNonBlockWriterIO() - bufio = io.BufferedWriter(raw, 8, 8) + bufio = self.tp(raw, 8, 8) self.assertEquals(bufio.write(b"abcd"), 4) self.assertEquals(bufio.write(b"efghi"), 5) @@ -616,19 +631,23 @@ # Previously buffered bytes were flushed self.assertTrue(s.startswith(b"01234567A"), s) - def testFileno(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedWriter(rawio) - - self.assertEquals(42, bufio.fileno()) - def testFlush(self): writer = MockRawIO() - bufio = io.BufferedWriter(writer, 8) + bufio = self.tp(writer, 8) bufio.write(b"abc") bufio.flush() self.assertEquals(b"abc", writer._write_stack[0]) + def testTruncate(self): + # Truncate implicitly flushes the buffer. + with io.open(support.TESTFN, self.write_mode, buffering=0) as raw: + bufio = self.tp(raw, 8) + bufio.write(b"abcdef") + self.assertEqual(bufio.truncate(3), 3) + self.assertEqual(bufio.tell(), 3) + with io.open(support.TESTFN, "rb", buffering=0) as f: + self.assertEqual(f.read(), b"abc") + def testThreads(self): try: # Write out many bytes from many threads and test they were @@ -648,8 +667,8 @@ # writing the buffer to the raw streams. This is in addition # to concurrency issues due to switching threads in the middle # of Python code. - with io.open(support.TESTFN, "wb", buffering=0) as raw: - bufio = io.BufferedWriter(raw, 8) + with io.open(support.TESTFN, self.write_mode, buffering=0) as raw: + bufio = self.tp(raw, 8) errors = [] def f(): try: @@ -690,11 +709,14 @@ # XXX More Tests -class BufferedRandomTest(unittest.TestCase): +class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest): + tp = io.BufferedRandom + read_mode = "rb+" + write_mode = "wb+" def testReadAndWrite(self): raw = MockRawIO((b"asdf", b"ghjk")) - rw = io.BufferedRandom(raw, 8, 12) + rw = self.tp(raw, 8, 12) self.assertEqual(b"as", rw.read(2)) rw.write(b"ddd") @@ -705,7 +727,7 @@ def testSeekAndTell(self): raw = io.BytesIO(b"asdfghjkl") - rw = io.BufferedRandom(raw) + rw = self.tp(raw) self.assertEquals(b"as", rw.read(2)) self.assertEquals(2, rw.tell()) @@ -722,6 +744,25 @@ self.assertEquals(7, rw.tell()) self.assertEquals(b"fl", rw.read(11)) self.assertRaises(TypeError, rw.seek, 0.0) + + def testThreads(self): + BufferedReaderTest.testThreads(self) + BufferedWriterTest.testThreads(self) + + def testWritesAndSeeks(self): + def _seekabs(bufio): + pos = bufio.tell() + bufio.seek(pos + 1, 0) + bufio.seek(pos - 1, 0) + bufio.seek(pos, 0) + self.check_writes(_seekabs) + def _seekrel(bufio): + pos = bufio.seek(0, 1) + bufio.seek(+1, 1) + bufio.seek(-1, 1) + bufio.seek(pos, 0) + self.check_writes(_seekrel) + # To fully exercise seek/tell, the StatefulIncrementalDecoder has these # properties: From python-checkins at python.org Mon Jan 5 21:03:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 5 Jan 2009 21:03:34 +0100 (CET) Subject: [Python-checkins] r68347 - sandbox/trunk/io-c/test_io.py Message-ID: <20090105200334.06D8C1E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 5 21:03:33 2009 New Revision: 68347 Log: fix BufferedRandomTest.test_constructor to call both base classes Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 5 21:03:33 2009 @@ -714,6 +714,10 @@ read_mode = "rb+" write_mode = "wb+" + def testConstructor(self): + BufferedReaderTest.testConstructor(self) + BufferedWriterTest.testConstructor(self) + def testReadAndWrite(self): raw = MockRawIO((b"asdf", b"ghjk")) rw = self.tp(raw, 8, 12) From buildbot at python.org Mon Jan 5 21:10:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 05 Jan 2009 20:10:23 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090105201023.9E0D61E4002@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/32 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,neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/bsddb/test/test_replication.py", line 134, in test01_basic_replication self.assertTrue(time.time() Author: antoine.pitrou Date: Mon Jan 5 21:31:22 2009 New Revision: 68348 Log: Again more tests. Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 5 21:31:22 2009 @@ -20,8 +20,10 @@ def __init__(self, read_stack=()): self._read_stack = list(read_stack) self._write_stack = [] + self._reads = 0 def read(self, n=None): + self._reads += 1 try: return self._read_stack.pop(0) except: @@ -50,6 +52,7 @@ return 0 # same comment as above def readinto(self, buf): + self._reads += 1 max_len = len(buf) try: data = self._read_stack[0] @@ -443,9 +446,22 @@ def testRead(self): rawio = MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) - self.assertEquals(b"abcdef", bufio.read(6)) + def testRead1(self): + rawio = 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)) + self.assertEquals(rawio._reads, 1) + self.assertEquals(b"c", bufio.read1(100)) + self.assertEquals(rawio._reads, 1) + self.assertEquals(b"d", bufio.read1(100)) + self.assertEquals(rawio._reads, 2) + self.assertEquals(b"efg", bufio.read1(100)) + self.assertEquals(rawio._reads, 3) + self.assertEquals(b"", bufio.read1(100)) + def testBuffering(self): data = b"abcdefghi" dlen = len(data) @@ -753,6 +769,35 @@ BufferedReaderTest.testThreads(self) BufferedWriterTest.testThreads(self) + def testWritesAndPeeks(self): + def _peek(bufio): + bufio.peek(1) + self.check_writes(_peek) + def _peek(bufio): + pos = bufio.tell() + bufio.seek(-1, 1) + bufio.peek(1) + bufio.seek(pos, 0) + self.check_writes(_peek) + + def testWritesAndReads(self): + def _read(bufio): + bufio.seek(-1, 1) + bufio.read(1) + self.check_writes(_read) + + def testWritesAndRead1s(self): + def _read1(bufio): + bufio.seek(-1, 1) + bufio.read1(1) + self.check_writes(_read1) + + def testWritesAndReadintos(self): + def _read(bufio): + bufio.seek(-1, 1) + bufio.readinto(bytearray(1)) + self.check_writes(_read) + def testWritesAndSeeks(self): def _seekabs(bufio): pos = bufio.tell() From buildbot at python.org Mon Jan 5 21:34:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 05 Jan 2009 20:34:13 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090105203414.0ED6F1E400C@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/657 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: marc-andre.lemburg,neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/bsddb/test/test_replication.py", line 134, in test01_basic_replication self.assertTrue(time.time() 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/34 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 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' sincerely, -The Buildbot From python-checkins at python.org Mon Jan 5 22:01:21 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 5 Jan 2009 22:01:21 +0100 (CET) Subject: [Python-checkins] r68349 - sandbox/trunk/io-c/test_io.py Message-ID: <20090105210121.E50711E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 5 22:01:21 2009 New Revision: 68349 Log: add a readinto() test to Buffered{Reader,Random} Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 5 22:01:21 2009 @@ -462,6 +462,21 @@ self.assertEquals(rawio._reads, 3) self.assertEquals(b"", bufio.read1(100)) + def testReadinto(self): + rawio = MockRawIO((b"abc", b"d", b"efg")) + bufio = self.tp(rawio) + b = bytearray(2) + self.assertEquals(bufio.readinto(b), 2) + self.assertEquals(b, b"ab") + self.assertEquals(bufio.readinto(b), 2) + self.assertEquals(b, b"cd") + self.assertEquals(bufio.readinto(b), 2) + self.assertEquals(b, b"ef") + self.assertEquals(bufio.readinto(b), 1) + self.assertEquals(b, b"gf") + self.assertEquals(bufio.readinto(b), 0) + self.assertEquals(b, b"gf") + def testBuffering(self): data = b"abcdefghi" dlen = len(data) From nnorwitz at gmail.com Mon Jan 5 22:09:58 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 5 Jan 2009 16:09:58 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090105210958.GA12342@python.psfb.org> 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_urllib2 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known 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 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [655844 refs] From nnorwitz at gmail.com Mon Jan 5 22:16:49 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 5 Jan 2009 16:16:49 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090105211649.GA13695@python.psfb.org> 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16365 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_urllib2 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known 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 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [655114 refs] From buildbot at python.org Mon Jan 5 22:39:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 05 Jan 2009 21:39:16 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 2.6 Message-ID: <20090105213916.7AA831E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%202.6/builds/28 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson,neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 5 22:44:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 5 Jan 2009 22:44:30 +0100 (CET) Subject: [Python-checkins] r68350 - sandbox/trunk/io-c/test_io.py Message-ID: <20090105214430.C9FBA1E4038@bag.python.org> Author: antoine.pitrou Date: Mon Jan 5 22:44:30 2009 New Revision: 68350 Log: Enhance and fix tests (again) Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 5 22:44:30 2009 @@ -290,15 +290,20 @@ class MyFileIO(io.FileIO): def __del__(self): record.append(1) - io.FileIO.__del__(self) + try: + f = io.FileIO.__del__ + except AttributeError: + pass + else: + f(self) def close(self): record.append(2) io.FileIO.close(self) def flush(self): record.append(3) io.FileIO.flush(self) - f = MyFileIO(support.TESTFN, "w") - f.write("xxx") + f = MyFileIO(support.TESTFN, "wb") + f.write(b"xxx") del f self.assertEqual(record, [1, 2, 3]) @@ -780,6 +785,36 @@ self.assertEquals(b"fl", rw.read(11)) self.assertRaises(TypeError, rw.seek, 0.0) + def testFlushAndRead(self): + raw = io.BytesIO(b"abcdefghi") + bufio = self.tp(raw) + + self.assertEquals(b"ab", bufio.read(2)) + bufio.write(b"12") + self.assertEquals(b"ef", bufio.read(2)) + self.assertEquals(6, bufio.tell()) + bufio.flush() + self.assertEquals(6, bufio.tell()) + self.assertEquals(b"ghi", bufio.read()) + raw.seek(0, 0) + raw.write(b"XYZ") + # flush() resets the read buffer + bufio.flush() + bufio.seek(0, 0) + self.assertEquals(b"XYZ", bufio.read(3)) + + def testFlushAndWrite(self): + raw = io.BytesIO(b"abcdefghi") + bufio = self.tp(raw) + + bufio.write(b"123") + bufio.flush() + bufio.write(b"45") + bufio.flush() + bufio.seek(0, 0) + self.assertEquals(b"12345fghi", raw.getvalue()) + self.assertEquals(b"12345fghi", bufio.read()) + def testThreads(self): BufferedReaderTest.testThreads(self) BufferedWriterTest.testThreads(self) From python-checkins at python.org Mon Jan 5 23:05:00 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 5 Jan 2009 23:05:00 +0100 (CET) Subject: [Python-checkins] r68351 - sandbox/trunk/io-c/test_io.py Message-ID: <20090105220500.9A7861E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 5 23:05:00 2009 New Revision: 68351 Log: more tests for BufferedRandom Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 5 23:05:00 2009 @@ -762,7 +762,7 @@ rw.write(b"ddd") rw.write(b"eee") self.assertFalse(raw._write_stack) # Buffer writes - self.assertEqual(b"ghjk", rw.read()) # This read forces write flush + self.assertEqual(b"ghjk", rw.read()) self.assertEquals(b"dddeee", raw._write_stack[0]) def testSeekAndTell(self): @@ -784,24 +784,45 @@ self.assertEquals(7, rw.tell()) self.assertEquals(b"fl", rw.read(11)) self.assertRaises(TypeError, rw.seek, 0.0) - - def testFlushAndRead(self): + + def check_flush_and_read(self, read_func): raw = io.BytesIO(b"abcdefghi") bufio = self.tp(raw) - self.assertEquals(b"ab", bufio.read(2)) + self.assertEquals(b"ab", read_func(bufio, 2)) bufio.write(b"12") - self.assertEquals(b"ef", bufio.read(2)) + self.assertEquals(b"ef", read_func(bufio, 2)) self.assertEquals(6, bufio.tell()) bufio.flush() self.assertEquals(6, bufio.tell()) - self.assertEquals(b"ghi", bufio.read()) + self.assertEquals(b"ghi", read_func(bufio)) raw.seek(0, 0) raw.write(b"XYZ") # flush() resets the read buffer bufio.flush() bufio.seek(0, 0) - self.assertEquals(b"XYZ", bufio.read(3)) + self.assertEquals(b"XYZ", read_func(bufio, 3)) + + def testFlushAndRead(self): + self.check_flush_and_read(lambda bufio, *args: bufio.read(*args)) + + def testFlushAndReadinto(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 _peek(bufio, n=-1): + # This relies on the fact that the buffer can contain the whole + # raw stream, otherwise peek() can return less. + b = bufio.peek(n) + if n != -1: + b = b[:n] + bufio.seek(len(b), 1) + return b + self.check_flush_and_read(_peek) def testFlushAndWrite(self): raw = io.BytesIO(b"abcdefghi") From nnorwitz at gmail.com Mon Jan 5 23:37:42 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 5 Jan 2009 17:37:42 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090105223742.GA26483@python.psfb.org> 333 tests OK. 1 test failed: test_urllib2 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-23902 test_bsddb3 still working, be patient... 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16365 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 test_urllib2 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known 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 333 tests OK. 1 test failed: test_urllib2 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [669712 refs] From python-checkins at python.org Tue Jan 6 00:45:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 00:45:23 +0100 (CET) Subject: [Python-checkins] r68352 - in sandbox/trunk/io-c: _iobase.c _iomodule.h io.c Message-ID: <20090105234523.6A9A81E403F@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 00:45:23 2009 New Revision: 68352 Log: fix destructor on raw file IO This might not be the best way to do it but somehow I fail to make it so that tp_del gets called, including in subclasses. Modified: sandbox/trunk/io-c/_iobase.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/io.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Tue Jan 6 00:45:23 2009 @@ -149,18 +149,24 @@ Py_RETURN_NONE; } -static void -IOBase_del(PyObject *self) +static PyObject * +IOBase_del(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethod(self, "flush", NULL); + PyObject *res = NULL; + res = PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); if (res == NULL) { /* At program exit time, 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. + * + * XXX: this function can be called at other times and what if the + * error is genuine? */ PyErr_Clear(); } + Py_XDECREF(res); + Py_RETURN_NONE; } /* Inquiry methods */ @@ -522,6 +528,7 @@ {"fileno", IOBase_fileno, METH_NOARGS, IOBase_fileno_doc}, {"isatty", IOBase_isatty, METH_NOARGS, IOBase_isatty_doc}, + {"__del__", IOBase_del, METH_NOARGS}, {"__enter__", IOBase_enter, METH_NOARGS}, {"__exit__", IOBase_exit, METH_VARARGS}, @@ -584,7 +591,7 @@ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ - IOBase_del, /* tp_del */ + 0, /* tp_del */ }; Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Tue Jan 6 00:45:23 2009 @@ -50,6 +50,7 @@ /* Implementation details */ +extern PyObject *_PyIO_str_close; extern PyObject *_PyIO_str_closed; extern PyObject *_PyIO_str_fileno; extern PyObject *_PyIO_str_flush; Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Tue Jan 6 00:45:23 2009 @@ -14,6 +14,7 @@ /* Various interned strings */ +PyObject *_PyIO_str_close; PyObject *_PyIO_str_closed; PyObject *_PyIO_str_fileno; PyObject *_PyIO_str_flush; @@ -622,6 +623,8 @@ PyModule_AddObject(m, "IncrementalNewlineDecoder", (PyObject *) &PyIncrementalNewlineDecoder_Type); /* Interned strings */ + if (!(_PyIO_str_close = PyUnicode_InternFromString("close"))) + goto fail; if (!(_PyIO_str_closed = PyUnicode_InternFromString("closed"))) goto fail; if (!(_PyIO_str_fileno = PyUnicode_InternFromString("fileno"))) From python-checkins at python.org Tue Jan 6 01:28:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 01:28:33 +0100 (CET) Subject: [Python-checkins] r68353 - sandbox/trunk/io-c/test_io.py Message-ID: <20090106002833.104FA1E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 01:28:32 2009 New Revision: 68353 Log: add destructor tests for Buffered*. Unfortunately one of them fails... Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Tue Jan 6 01:28:32 2009 @@ -424,6 +424,32 @@ # this test. Else, write it. pass + def testOverrideDestructor(self): + tp = self.tp + record = [] + class MyBufferedIO(tp): + def __del__(self): + record.append(1) + try: + f = tp.__del__ + except AttributeError: + pass + else: + f(self) + def close(self): + record.append(2) + tp.close(self) + def flush(self): + record.append(3) + tp.flush(self) + rawio = MockRawIO() + bufio = MyBufferedIO(rawio) + writable = bufio.writable() + del bufio + if writable: + self.assertEqual(record, [1, 2, 3]) + else: + self.assertEqual(record, [1, 2]) class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): tp = io.BufferedReader @@ -674,6 +700,13 @@ bufio.flush() self.assertEquals(b"abc", writer._write_stack[0]) + def testDestructor(self): + writer = MockRawIO() + bufio = self.tp(writer, 8) + bufio.write(b"abc") + del bufio + self.assertEquals(b"abc", writer._write_stack[0]) + def testTruncate(self): # Truncate implicitly flushes the buffer. with io.open(support.TESTFN, self.write_mode, buffering=0) as raw: From python-checkins at python.org Tue Jan 6 02:04:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 02:04:25 +0100 (CET) Subject: [Python-checkins] r68354 - in sandbox/trunk/io-c: _bufferedio.c _iomodule.h io.c Message-ID: <20090106010425.E24031E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 02:04:25 2009 New Revision: 68354 Log: Buffered{Reader,Writer,Random} overhaul: use a shared buffer and optimize mixed reads and writes by avoiding spurious flushes. Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/io.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Tue Jan 6 02:04:25 2009 @@ -39,11 +39,11 @@ if (data == NULL) goto error; - if (!PyBytes_Check(data)) { - Py_DECREF(data); - PyErr_SetString(PyExc_TypeError, "read() should return bytes"); + if (!PyBytes_Check(data)) { + Py_DECREF(data); + PyErr_SetString(PyExc_TypeError, "read() should return bytes"); goto error; - } + } len = Py_SIZE(data); memcpy(buf.buf, PyBytes_AS_STRING(data), len); @@ -110,27 +110,30 @@ PyObject *raw; int ok; /* Initialized? */ + int readable; + int writable; - /* Position inside the raw stream (-1 if unknown). */ - Py_ssize_t raw_pos; + /* Absolute position inside the raw stream (-1 if unknown). */ + Py_ssize_t abs_pos; /* A static buffer of size `buffer_size` */ - unsigned char *read_buf; - /* Current reading pos in the buffer. */ - Py_ssize_t read_pos; + char *buffer; + /* Current logical position in the buffer. */ + Py_ssize_t pos; + /* Position of the raw stream in the buffer. */ + Py_ssize_t raw_pos; + /* Just after the last buffered byte in the buffer, or -1 if the buffer - is invalid. - Should most often be equal to buffer_size for "normal" blocking I/O. */ + isn't ready for reading. */ Py_ssize_t read_end; - PyThread_type_lock read_lock; - /* A static buffer of size `buffer_size` */ - unsigned char *write_buf; /* Just after the last byte actually written */ Py_ssize_t write_pos; - /* Just after the last buffered byte */ + /* Just after the last byte waiting to be written, or -1 if the buffer + isn't ready for writing. */ Py_ssize_t write_end; - PyThread_type_lock write_lock; + + PyThread_type_lock lock; Py_ssize_t buffer_size; Py_ssize_t buffer_mask; @@ -139,23 +142,39 @@ PyObject *weakreflist; } BufferedObject; -/* These macros protect the BufferedObject against concurrent operations. */ - -#define ENTER_BUFFERED_READER(self) \ - Py_BEGIN_ALLOW_THREADS \ - PyThread_acquire_lock(self->read_lock, 1); \ - Py_END_ALLOW_THREADS +/* + Implementation notes: + + * BufferedReader, BufferedWriter and BufferedRandom try to share most + methods (this is helped by the members `readable` and `writable`, which + are initialized in the respective constructors) + * They also share a single buffer for reading and writing. This enables + interleaved reads and writes without flushing. It also makes the logic + a bit trickier to get right. + * The absolute position of the raw stream is cached, if possible, in the + `abs_pos` member. It must be updated every time an operation is done + on the raw stream. If not sure, it can be reinitialized by calling + _Buffered_raw_tell(), which queries the raw stream (_Buffered_raw_seek() + also does it). To read it, use RAW_TELL(). + * Three helpers, _BufferedReader_raw_read, _BufferedWriter_raw_write and + _BufferedWriter_flush_unlocked do a lot of useful housekeeping. + + NOTE: we should try to maintain block alignment of reads and writes to the + raw stream (according to the buffer size), but for now it is only done + in read() and friends. + + XXX: method naming is a bit messy. +*/ -#define LEAVE_BUFFERED_READER(self) \ - PyThread_release_lock(self->read_lock); +/* These macros protect the BufferedObject against concurrent operations. */ -#define ENTER_BUFFERED_WRITER(self) \ +#define ENTER_BUFFERED(self) \ Py_BEGIN_ALLOW_THREADS \ - PyThread_acquire_lock(self->write_lock, 1); \ + PyThread_acquire_lock(self->lock, 1); \ Py_END_ALLOW_THREADS -#define LEAVE_BUFFERED_WRITER(self) \ - PyThread_release_lock(self->write_lock); +#define LEAVE_BUFFERED(self) \ + PyThread_release_lock(self->lock); #define CHECK_INITIALIZED(self) \ if (self->ok <= 0) { \ @@ -172,10 +191,28 @@ } #define VALID_READ_BUFFER(self) \ - (self->read_end != -1) + (self->readable && self->read_end != -1) -#define AVAILABLE_BYTES(self) \ - (VALID_READ_BUFFER(self) ? (self->read_end - self->read_pos) : 0) +#define VALID_WRITE_BUFFER(self) \ + (self->writable && self->write_end != -1) + +#define ADJUST_POSITION(self, _new_pos) \ + do { \ + self->pos = _new_pos; \ + if (VALID_READ_BUFFER(self) && self->read_end < self->pos) \ + self->read_end = self->pos; \ + } while(0) + +#define READAHEAD(self) \ + ((self->readable && VALID_READ_BUFFER(self)) \ + ? (self->read_end - self->pos) : 0) + +#define RAW_OFFSET(self) \ + (((VALID_READ_BUFFER(self) || VALID_WRITE_BUFFER(self)) \ + && self->raw_pos >= 0) ? self->raw_pos - self->pos : 0) + +#define RAW_TELL(self) \ + (self->abs_pos != -1 ? self->abs_pos : _Buffered_raw_tell(self)) #define MINUS_LAST_BLOCK(self, size) \ (self->buffer_mask ? \ @@ -186,28 +223,38 @@ static void BufferedObject_dealloc(BufferedObject *self) { + PyObject *res; + /* XXX this is inelegant */ + if (Py_TYPE(self)->tp_del == NULL) { + /* We need to resurrect the object as calling close() can invoke + arbitrary code. */ + ((PyObject *) self)->ob_refcnt++; + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, + NULL); + if (res == NULL) { + /* XXX dump exception on terminal? + But IOBase.__del__ prefers to remain silent... */ + PyErr_Clear(); + } + Py_XDECREF(res); + if (--((PyObject *) self)->ob_refcnt != 0) + return; + } if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *)self); Py_CLEAR(self->raw); - if (self->read_buf) { - PyMem_Free(self->read_buf); - self->write_buf = NULL; - } - if (self->write_buf) { - PyMem_Free(self->write_buf); - self->write_buf = NULL; - } - if (self->read_lock) { - PyThread_free_lock(self->read_lock); - self->read_lock = NULL; - } - if (self->write_lock) { - PyThread_free_lock(self->write_lock); - self->write_lock = NULL; + if (self->buffer) { + PyMem_Free(self->buffer); + self->buffer = NULL; + } + if (self->lock) { + PyThread_free_lock(self->lock); + self->lock = NULL; } Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *)self); } - + /* * _BufferedIOMixin methods @@ -232,6 +279,8 @@ * and a flush may be necessary to synch both views of the current * file state. */ + /* FIXME: raw objects don't have flush() + */ res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); if (res == NULL) return NULL; @@ -245,7 +294,7 @@ /* XXX: Should seek() be used, instead of passing the position * XXX directly to truncate? */ - res = PyObject_CallMethod(self->raw, "truncate", "O", pos); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); Py_DECREF(pos); return res; @@ -355,6 +404,20 @@ return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_isatty, NULL); } + +/* Forward decls */ +static PyObject * +_BufferedWriter_flush_unlocked(BufferedObject *, int); +static void +_BufferedReader_reset_buf(BufferedObject *self); +static void +_BufferedWriter_reset_buf(BufferedObject *self); +static PyObject * +_BufferedReader_peek_unlocked(BufferedObject *self, Py_ssize_t); +static PyObject * +_BufferedReader_read_unlocked(BufferedObject *self, Py_ssize_t); + + /* * Helpers */ @@ -388,7 +451,7 @@ return -1; n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); - self->raw_pos = n; + self->abs_pos = n; /* TODO: sanity check (n >= 0) */ return n; } @@ -403,7 +466,7 @@ return -1; n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); - self->raw_pos = n; + self->abs_pos = n; /* TODO: sanity check (n >= 0) */ return n; } @@ -417,7 +480,20 @@ "buffer size must be strictly positive"); return -1; } + if (self->buffer) + PyMem_Free(self->buffer); + self->buffer = PyMem_Malloc(self->buffer_size); + if (self->buffer == NULL) { + PyErr_NoMemory(); + return -1; + } + self->lock = PyThread_allocate_lock(); + if (self->lock == NULL) { + PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock"); + return -1; + } /* Find out whether buffer_size is a power of 2 */ + /* XXX is this optimization useful? */ for (n = self->buffer_size - 1; n & 1; n >>= 1) ; if (n == 0) @@ -429,6 +505,264 @@ return 0; } +/* + * Shared methods and wrappers + */ + +static PyObject * +Buffered_flush(BufferedObject *self, PyObject *args) +{ + PyObject *res; + + CHECK_INITIALIZED(self) + if (BufferedIOMixin_closed(self)) { + PyErr_SetString(PyExc_ValueError, "flush of closed file"); + return NULL; + } + + ENTER_BUFFERED(self) + res = _BufferedWriter_flush_unlocked(self, 0); + if (res != NULL && self->readable) { + /* Rewind the raw stream so that its position corresponds to + the current logical position. */ + Py_ssize_t n; + n = _Buffered_raw_seek(self, -RAW_OFFSET(self), 1); + if (n == -1) + Py_CLEAR(res); + _BufferedReader_reset_buf(self); + } + LEAVE_BUFFERED(self) + + return res; +} + +static PyObject * +Buffered_peek(BufferedObject *self, PyObject *args) +{ + Py_ssize_t n = 0; + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|n:peek", &n)) { + return NULL; + } + + ENTER_BUFFERED(self) + + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + res = _BufferedReader_peek_unlocked(self, n); + +end: + LEAVE_BUFFERED(self) + return res; +} + +static PyObject * +Buffered_read(BufferedObject *self, PyObject *args) +{ + Py_ssize_t n = -1; + PyObject *res; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|n:read", &n)) { + return NULL; + } + + if (BufferedIOMixin_closed(self)) { + PyErr_SetString(PyExc_ValueError, "read of closed file"); + return NULL; + } + + ENTER_BUFFERED(self) + res = _BufferedReader_read_unlocked(self, n); + LEAVE_BUFFERED(self) + + return res; +} + +static PyObject * +Buffered_read1(BufferedObject *self, PyObject *args) +{ + Py_ssize_t n, have; + PyObject *res; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "n:read1", &n)) { + return NULL; + } + + /* TODO: n < 0 should raise an error (?) */ + if (n <= 0) + return PyBytes_FromStringAndSize(NULL, 0); + + ENTER_BUFFERED(self) + + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + + /* Return up to n bytes. If at least one byte is buffered, we + only return buffered bytes. Otherwise, we do one raw read. */ + + /* XXX: this mimicks the io.py implementation but is probably wrong. + If we need to read from the raw stream, then we could actually read + all `n` bytes asked by the caller (and possibly more, so as to fill + our buffer for the next reads). */ + + res = _BufferedReader_peek_unlocked(self, 1); + if (res == NULL) + goto end; + Py_CLEAR(res); + + have = self->read_end - self->pos; + if (n > have) + n = have; + + res = _BufferedReader_read_unlocked(self, n); + +end: + LEAVE_BUFFERED(self) + return res; +} + +static PyObject * +Buffered_readinto(BufferedObject *self, PyObject *args) +{ + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + + /* TODO: use raw.readinto() instead! */ + if (self->writable) { + ENTER_BUFFERED(self) + res = _BufferedWriter_flush_unlocked(self, 0); + LEAVE_BUFFERED(self) + if (res == NULL) + goto end; + Py_DECREF(res); + } + res = BufferedIOBase_readinto((PyObject *)self, args); + +end: + return res; +} + +static PyObject * +Buffered_tell(BufferedObject *self, PyObject *args) +{ + Py_ssize_t pos; + + CHECK_INITIALIZED(self) + pos = _Buffered_raw_tell(self); + if (pos == -1) + return NULL; + pos -= RAW_OFFSET(self); + /* TODO: sanity check (pos >= 0) */ + return PyLong_FromSsize_t(pos); +} + +static PyObject * +Buffered_seek(BufferedObject *self, PyObject *args) +{ + Py_ssize_t current, target, avail, n; + int whence = 0; + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "n|i:seek", &target, &whence)) { + return NULL; + } + /* TODO: sanity check whence value */ + + if (whence != 2 && self->readable) { + /* Check if seeking leaves us inside the current buffer, + so as to return quickly if possible. + Don't know how to do that when whence == 2, though. */ + current = RAW_TELL(self); + avail = READAHEAD(self); + if (avail > 0) { + Py_ssize_t offset; + if (whence == 0) + offset = target - (current - RAW_OFFSET(self)); + else + offset = target; + if (offset >= -self->pos && offset <= avail) { + self->pos += offset; + res = PyLong_FromSsize_t(current - avail + offset); + goto end; + } + } + } + + /* Fallback: invoke raw seek() method and clear buffer */ + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 0); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + + /* TODO: align on block boundary and read buffer if needed? */ + if (whence == 1) + target -= RAW_OFFSET(self); + n = _Buffered_raw_seek(self, target, whence); + if (n == -1) + goto end; + self->raw_pos = -1; + res = PyLong_FromSsize_t(n); + if (res != NULL) + _BufferedReader_reset_buf(self); + +end: + LEAVE_BUFFERED(self) + return res; +} + +static PyObject * +Buffered_truncate(BufferedObject *self, PyObject *args) +{ + PyObject *pos = Py_None; + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { + return NULL; + } + + if (pos != Py_None) + Py_INCREF(pos); + + ENTER_BUFFERED(self) + + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 0); + if (res == NULL) + goto end; + Py_CLEAR(res); + _BufferedWriter_reset_buf(self); + } + if (self->readable) + _BufferedReader_reset_buf(self); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); + if (res == NULL) + goto end; + /* Reset cached position */ + if (_Buffered_raw_tell(self) == -1) + PyErr_Clear(); + +end: + LEAVE_BUFFERED(self) + return res; +} + /* * class BufferedReader @@ -437,11 +771,9 @@ PyDoc_STRVAR(BufferedReader_doc, "Create a new buffered reader using the given readable raw IO object."); -static int _BufferedReader_reset_buf(BufferedObject *self) +static void _BufferedReader_reset_buf(BufferedObject *self) { self->read_end = -1; - self->read_pos = 0; - return 0; } static int @@ -465,33 +797,19 @@ Py_INCREF(raw); self->raw = raw; self->buffer_size = buffer_size; + self->readable = 1; + self->writable = 0; if (_Buffered_init(self) < 0) return -1; - - if (self->read_buf) - PyMem_Free(self->read_buf); - self->read_buf = PyMem_Malloc(self->buffer_size); - if (self->read_buf == NULL) { - PyErr_NoMemory(); - return -1; - } - - if (_BufferedReader_reset_buf(self) < 0) - return -1; - - self->read_lock = PyThread_allocate_lock(); - if (self->read_lock == NULL) { - PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock"); - return -1; - } + _BufferedReader_reset_buf(self); self->ok = 1; return 0; } static Py_ssize_t -_BufferedReader_raw_read(BufferedObject *self, unsigned char *start, Py_ssize_t len) +_BufferedReader_raw_read(BufferedObject *self, char *start, Py_ssize_t len) { Py_buffer buf; PyObject *memobj, *res; @@ -514,8 +832,25 @@ n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); /* TODO: sanity check (0 <= n <= len) */ - if (n > 0 && self->raw_pos != -1) - self->raw_pos += n; + if (n > 0 && self->abs_pos != -1) + self->abs_pos += n; + return n; +} + +static Py_ssize_t +_BufferedReader_fill_buffer(BufferedObject *self) +{ + Py_ssize_t start, len, n; + if (VALID_READ_BUFFER(self)) + start = self->read_end; + else + start = 0; + len = self->buffer_size - start; + n = _BufferedReader_raw_read(self, self->buffer + start, len); + if (n <= 0) + return n; + self->read_end = start + n; + self->raw_pos = start + n; return n; } @@ -524,7 +859,7 @@ { PyObject *data, *chunks, *res = NULL; Py_ssize_t current_size, remaining, written; - unsigned char *out; + char *out; static PyObject *sep = NULL; /* Special case for when the number of bytes to read is unspecified. */ @@ -534,19 +869,23 @@ return NULL; /* First copy what we have in the current buffer. */ - current_size = AVAILABLE_BYTES(self); + current_size = READAHEAD(self); data = NULL; if (current_size) { data = PyBytes_FromStringAndSize( - self->read_buf + self->read_pos, current_size); + self->buffer + self->pos, current_size); if (data == NULL) { Py_DECREF(chunks); return NULL; } } - if (_BufferedReader_reset_buf(self) == -1) { - Py_DECREF(chunks); - return NULL; + _BufferedReader_reset_buf(self); + /* We're going past the buffer's bounds, flush it */ + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) + return NULL; + Py_CLEAR(res); } while (1) { if (data) { @@ -590,19 +929,19 @@ } } current_size += PyBytes_GET_SIZE(data); - if (self->raw_pos != -1) - self->raw_pos += PyBytes_GET_SIZE(data); + if (self->abs_pos != -1) + self->abs_pos += PyBytes_GET_SIZE(data); } } /* The number of bytes to read is specified, return at most n bytes. */ - current_size = AVAILABLE_BYTES(self); + current_size = READAHEAD(self); if (n <= current_size) { /* Fast path: the data to read is fully buffered. */ - res = PyBytes_FromStringAndSize(self->read_buf + self->read_pos, n); + res = PyBytes_FromStringAndSize(self->buffer + self->pos, n); if (res == NULL) goto error; - self->read_pos += n; + self->pos += n; return res; } @@ -616,14 +955,13 @@ remaining = n; written = 0; if (current_size > 0) { - memcpy(out, self->read_buf + self->read_pos, current_size); + memcpy(out, self->buffer + self->pos, current_size); remaining -= current_size; written += current_size; } - if (_BufferedReader_reset_buf(self) == -1) - goto error; + _BufferedReader_reset_buf(self); while (remaining > 0) { - /* We want to read a whole block at the end into read_buf. + /* We want to read a whole block at the end into buffer. If we had readv() we could do this in one pass. */ Py_ssize_t r = MINUS_LAST_BLOCK(self, remaining); if (r == 0) @@ -646,12 +984,11 @@ written += r; } assert(remaining <= self->buffer_size); - self->read_pos = 0; + self->pos = 0; + self->raw_pos = 0; self->read_end = 0; while (self->read_end < self->buffer_size) { - Py_ssize_t r = _BufferedReader_raw_read(self, - self->read_buf + self->read_end, - self->buffer_size - self->read_end); + Py_ssize_t r = _BufferedReader_fill_buffer(self); if (r == -1) goto error; if (r == 0 || r == -2) { @@ -666,212 +1003,53 @@ return Py_None; } if (remaining > r) { - memcpy(out + written, self->read_buf + self->read_end, r); + memcpy(out + written, self->buffer + self->pos, r); written += r; - self->read_pos += r; + self->pos += r; remaining -= r; } else if (remaining > 0) { - memcpy(out + written, self->read_buf + self->read_end, remaining); + memcpy(out + written, self->buffer + self->pos, remaining); written += remaining; - self->read_pos += remaining; + self->pos += remaining; remaining = 0; } - self->read_end += r; if (remaining == 0) - /* XXX perhaps we could try again to fill the buffer instead? */ break; } return res; error: - Py_XDECREF(res); - return NULL; -} - -static PyObject * -BufferedReader_read(BufferedObject *self, PyObject *args) -{ - Py_ssize_t n = -1; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "|n:read", &n)) { - return NULL; - } - - if (BufferedIOMixin_closed(self)) { - PyErr_SetString(PyExc_ValueError, "read of closed file"); - return NULL; - } - - ENTER_BUFFERED_READER(self) - - res = _BufferedReader_read_unlocked(self, n); - - LEAVE_BUFFERED_READER(self) - - return res; -} - -static PyObject * -_BufferedReader_peek_unlocked(BufferedObject *self, Py_ssize_t n) -{ - Py_ssize_t have, r; - - have = AVAILABLE_BYTES(self); - /* 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 - to make some place. - Therefore, we either return `have` bytes (if > 0), or a full buffer. - */ - if (have > 0) { - return PyBytes_FromStringAndSize(self->read_buf + self->read_pos, have); - } - - /* Fill the buffer from the raw stream, and copy it to the result. */ - r = _BufferedReader_raw_read(self, self->read_buf, self->buffer_size); - if (r == -1) - return NULL; - if (r == -2) - r = 0; - self->read_pos = 0; - self->read_end = r; - return PyBytes_FromStringAndSize(self->read_buf, r); - -} - -static PyObject * -BufferedReader_peek(BufferedObject *self, PyObject *args) -{ - Py_ssize_t n = 0; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "|n:peek", &n)) { - return NULL; - } - - ENTER_BUFFERED_READER(self) - - res = _BufferedReader_peek_unlocked(self, n); - - LEAVE_BUFFERED_READER(self) - - return res; -} - -static PyObject * -BufferedReader_read1(BufferedObject *self, PyObject *args) -{ - Py_ssize_t n, have; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "n:read1", &n)) { - return NULL; - } - - /* TODO: n < 0 should raise an error (?) */ - if (n <= 0) - return PyBytes_FromStringAndSize(NULL, 0); - - ENTER_BUFFERED_READER(self) - - /* Return up to n bytes. If at least one byte is buffered, we - only return buffered bytes. Otherwise, we do one raw read. */ - - /* TODO: this mimicks the io.py implementation but is probably wrong. - If we need to read from the raw stream, then we should actually read - all `n` bytes asked by the caller (and possibly more, so as to fill - our buffer for the next reads). */ - - res = _BufferedReader_peek_unlocked(self, 1); - if (res == NULL) - goto end; - Py_DECREF(res); - - have = self->read_end - self->read_pos; - if (n > have) - n = have; - - res = _BufferedReader_read_unlocked(self, n); - -end: - LEAVE_BUFFERED_READER(self) - return res; -} - -static PyObject * -BufferedReader_seek(BufferedObject *self, PyObject *args) -{ - Py_ssize_t current, target, avail, n; - int whence = 0; - PyObject *res = NULL; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "n|i:seek", &target, &whence)) { - return NULL; - } - /* TODO: sanity check whence value */ - - ENTER_BUFFERED_READER(self) - - if (whence != 2) { - /* Check if seeking leaves us inside the current buffer, - so as to return quickly if possible. - Don't know how to do that when whence == 2, though. */ - current = self->raw_pos; - if (current == -1) - current = _Buffered_raw_tell(self); - if (current == -1) - goto end; - avail = AVAILABLE_BYTES(self); - if (avail > 0) { - Py_ssize_t offset; - if (whence == 0) - offset = target - (current - avail); - else - offset = target; - if (offset >= -self->read_pos && offset <= avail) { - self->read_pos += offset; - res = PyLong_FromSsize_t(current - avail + offset); - goto end; - } - } - } - - /* Fallback: invoke raw seek() method and clear buffer */ - if (whence == 1) - target -= AVAILABLE_BYTES(self); - - /* TODO: align on block boundary and read buffer if needed? */ - n = _Buffered_raw_seek(self, target, whence); - if (n == -1) - goto end; - res = PyLong_FromSsize_t(n); - if (res != NULL && _BufferedReader_reset_buf(self) < 0) - Py_CLEAR(res); - -end: - LEAVE_BUFFERED_READER(self) - return res; + Py_XDECREF(res); + return NULL; } static PyObject * -BufferedReader_tell(BufferedObject *self, PyObject *args) +_BufferedReader_peek_unlocked(BufferedObject *self, Py_ssize_t n) { - Py_ssize_t pos; + Py_ssize_t have, r; - CHECK_INITIALIZED(self) - pos = _Buffered_raw_tell(self); - if (pos == -1) + have = READAHEAD(self); + /* 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 + to make some place. + Therefore, we either return `have` bytes (if > 0), or a full buffer. + */ + if (have > 0) { + return PyBytes_FromStringAndSize(self->buffer + self->pos, have); + } + + /* Fill the buffer from the raw stream, and copy it to the result. */ + _BufferedReader_reset_buf(self); + r = _BufferedReader_fill_buffer(self); + if (r == -1) return NULL; - pos -= AVAILABLE_BYTES(self); - /* TODO: sanity check (pos >= 0) */ - return PyLong_FromSsize_t(pos); + if (r == -2) + r = 0; + self->pos = 0; + return PyBytes_FromStringAndSize(self->buffer, r); } static PyMethodDef BufferedReader_methods[] = { @@ -885,11 +1063,11 @@ {"fileno", (PyCFunction)BufferedIOMixin_fileno, METH_NOARGS}, {"isatty", (PyCFunction)BufferedIOMixin_isatty, METH_NOARGS}, - {"read", (PyCFunction)BufferedReader_read, METH_VARARGS}, - {"peek", (PyCFunction)BufferedReader_peek, METH_VARARGS}, - {"read1", (PyCFunction)BufferedReader_read1, METH_VARARGS}, - {"seek", (PyCFunction)BufferedReader_seek, METH_VARARGS}, - {"tell", (PyCFunction)BufferedReader_tell, METH_NOARGS}, + {"read", (PyCFunction)Buffered_read, METH_VARARGS}, + {"peek", (PyCFunction)Buffered_peek, METH_VARARGS}, + {"read1", (PyCFunction)Buffered_read1, METH_VARARGS}, + {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, + {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, {NULL, NULL} }; @@ -959,12 +1137,11 @@ "DEFAULT_BUFFER_SIZE. max_buffer_size isn't used anymore.\n" ); -static int +static void _BufferedWriter_reset_buf(BufferedObject *self) { self->write_pos = 0; - self->write_end = 0; - return 0; + self->write_end = -1; } static int @@ -989,33 +1166,21 @@ Py_CLEAR(self->raw); Py_INCREF(raw); self->raw = raw; + self->readable = 0; + self->writable = 1; self->buffer_size = buffer_size; if (_Buffered_init(self) < 0) return -1; - - if (self->write_buf) - PyMem_Free(self->write_buf); - self->write_buf = PyMem_Malloc(self->buffer_size); - if (self->write_buf == NULL) { - PyErr_NoMemory(); - return -1; - } - if (_BufferedWriter_reset_buf(self) < 0) - return -1; - - self->write_lock = PyThread_allocate_lock(); - if (self->write_lock == NULL) { - PyErr_SetString(PyExc_RuntimeError, "can't allocate write lock"); - return -1; - } + _BufferedWriter_reset_buf(self); + self->pos = 0; self->ok = 1; return 0; } static Py_ssize_t -_BufferedWriter_raw_write(BufferedObject *self, unsigned char *start, Py_ssize_t len) +_BufferedWriter_raw_write(BufferedObject *self, char *start, Py_ssize_t len) { Py_buffer buf; PyObject *memobj, *res; @@ -1033,24 +1198,39 @@ n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); /* TODO: sanity check (0 <= n <= len) */ + if (n > 0 && self->abs_pos != -1) + self->abs_pos += n; return n; } +/* `restore_pos` is 1 if we need to restore the raw stream position at + the end, 0 otherwise. */ static PyObject * -_BufferedWriter_flush_unlocked(BufferedObject *self) +_BufferedWriter_flush_unlocked(BufferedObject *self, int restore_pos) { - Py_ssize_t written = 0, n; - PyObject *res = NULL; + Py_ssize_t written = 0, n, rewind; + if (!VALID_WRITE_BUFFER(self) || self->write_pos == self->write_end) + goto end; + /* First, rewind */ + rewind = RAW_OFFSET(self) + (self->pos - self->write_pos); + if (rewind != 0) { + n = _Buffered_raw_seek(self, -rewind, 1); + if (n < 0) { + goto error; + } + self->raw_pos -= rewind; + } while (self->write_pos < self->write_end) { n = _BufferedWriter_raw_write(self, - self->write_buf + self->write_pos, + self->buffer + self->write_pos, self->write_end - self->write_pos); - if (n == -1 && PyErr_Occurred()) { + if (n == -1) { Py_ssize_t *w = _Buffered_check_blocking_error(); if (w == NULL) goto error; self->write_pos += *w; + self->raw_pos = self->write_pos; written += *w; *w = written; /* Already re-raised */ @@ -1058,15 +1238,26 @@ } /* TODO: sanity check with a macro */ self->write_pos += n; + self->raw_pos = self->write_pos; written += n; } - if (_BufferedWriter_reset_buf(self) < 0) - goto error; + if (restore_pos) { + Py_ssize_t forward = rewind - written; + if (forward != 0) { + n = _Buffered_raw_seek(self, forward, 1); + if (n < 0) { + goto error; + } + self->raw_pos += forward; + } + } + _BufferedWriter_reset_buf(self); + +end: Py_RETURN_NONE; error: - Py_XDECREF(res); return NULL; } @@ -1088,48 +1279,61 @@ return NULL; } - ENTER_BUFFERED_WRITER(self) + ENTER_BUFFERED(self) /* Fast path: the data to write can be fully buffered. */ - avail = self->buffer_size - self->write_end; + if (!VALID_READ_BUFFER(self) && !VALID_WRITE_BUFFER(self)) { + self->pos = 0; + self->raw_pos = 0; + } + avail = self->buffer_size - self->pos; if (buf.len <= avail) { - memcpy(self->write_buf + self->write_end, buf.buf, buf.len); - self->write_end += buf.len; + memcpy(self->buffer + self->pos, buf.buf, buf.len); + if (!VALID_WRITE_BUFFER(self)) { + self->write_pos = self->pos; + } + ADJUST_POSITION(self, self->pos + buf.len); + if (self->pos > self->write_end) + self->write_end = self->pos; written = buf.len; goto end; } /* First write the current buffer */ - res = _BufferedWriter_flush_unlocked(self); + res = _BufferedWriter_flush_unlocked(self, 0); if (res == NULL) { Py_ssize_t *w = _Buffered_check_blocking_error(); if (w == NULL) goto error; + if (self->readable) + _BufferedReader_reset_buf(self); /* Make some place by shifting the buffer. */ - memmove(self->write_buf, self->write_buf + self->write_pos, + assert(VALID_WRITE_BUFFER(self)); + memmove(self->buffer, self->buffer + self->write_pos, self->write_end - self->write_pos); 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; if (buf.len <= avail) { /* Everything can be buffered */ PyErr_Clear(); - memcpy(self->write_buf + self->write_end, buf.buf, buf.len); + memcpy(self->buffer + self->write_end, buf.buf, buf.len); self->write_end += buf.len; written = buf.len; goto end; } /* Buffer as much as possible. */ - memcpy(self->write_buf + self->write_end, buf.buf, avail); + memcpy(self->buffer + self->write_end, buf.buf, avail); self->write_end += avail; /* Already re-raised */ *w = avail; - res = NULL; goto error; } Py_CLEAR(res); - /* Then write buf itself. At this point write_buf has been emptied. */ + /* Then write buf itself. At this point the buffer has been emptied. */ remaining = buf.len; written = 0; while (remaining > self->buffer_size) { @@ -1143,8 +1347,10 @@ remaining -= *w; if (remaining > self->buffer_size) { /* Can't buffer everything, still buffer as much as possible */ - memcpy(self->write_buf, + memcpy(self->buffer, (char *) buf.buf + written, self->buffer_size); + self->raw_pos = 0; + ADJUST_POSITION(self, self->buffer_size); self->write_end = self->buffer_size; *w = written + self->buffer_size; /* Already re-raised */ @@ -1156,123 +1362,27 @@ written += n; remaining -= n; } + if (self->readable) + _BufferedReader_reset_buf(self); if (remaining > 0) { - memcpy(self->write_buf, (char *) buf.buf + written, remaining); + memcpy(self->buffer, (char *) buf.buf + written, remaining); written += remaining; } self->write_pos = 0; /* TODO: sanity check (remaining >= 0) */ self->write_end = remaining; + ADJUST_POSITION(self, remaining); + self->raw_pos = 0; end: res = PyLong_FromSsize_t(written); error: - LEAVE_BUFFERED_WRITER(self) + LEAVE_BUFFERED(self) PyBuffer_Release(&buf); return res; } -static PyObject * -BufferedWriter_truncate(BufferedObject *self, PyObject *args) -{ - PyObject *pos = NULL; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { - return NULL; - } - /* will be parsed again by BufferedIOMixin_truncate */ - Py_XDECREF(pos); - - if (BufferedIOMixin_closed(self)) { - PyErr_SetString(PyExc_ValueError, "truncate of closed file"); - return NULL; - } - - ENTER_BUFFERED_WRITER(self) - - res = _BufferedWriter_flush_unlocked(self); - if (res == NULL) - goto end; - Py_DECREF(res); - - res = BufferedIOMixin_truncate(self, args); - - end: - LEAVE_BUFFERED_WRITER(self) - return res; -} - -static PyObject * -BufferedWriter_flush(BufferedObject *self, PyObject *args) -{ - PyObject *res; - - CHECK_INITIALIZED(self) - if (BufferedIOMixin_closed(self)) { - PyErr_SetString(PyExc_ValueError, "flush of closed file"); - return NULL; - } - - ENTER_BUFFERED_WRITER(self) - - res = _BufferedWriter_flush_unlocked(self); - - LEAVE_BUFFERED_WRITER(self) - - return res; -} - -static PyObject * -BufferedWriter_tell(BufferedObject *self, PyObject *args) -{ - PyObject *op1, *op2, *res; - - CHECK_INITIALIZED(self) - op1 = PyObject_CallMethod(self->raw, "tell", NULL); - op2 = PyLong_FromSsize_t(self->write_end - self->write_pos); - if (op2 == NULL) { - Py_DECREF(op1); - return NULL; - } - - res = PyNumber_Add(op1, op2); - Py_DECREF(op1); - Py_DECREF(op2); - return res; -} - -static PyObject * -BufferedWriter_seek(BufferedObject *self, PyObject *args) -{ - Py_ssize_t pos; - int whence = 0; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "n|i:seek", &pos, &whence)) { - return NULL; - } - if (BufferedIOMixin_closed(self)) { - PyErr_SetString(PyExc_ValueError, "seek of closed file"); - return NULL; - } - - ENTER_BUFFERED_WRITER(self) - - res = _BufferedWriter_flush_unlocked(self); - if (res == NULL) - goto end; - - res = PyObject_CallMethod(self->raw, "seek", "ni", pos, whence); - - end: - LEAVE_BUFFERED_WRITER(self) - return res; -} - static PyMethodDef BufferedWriter_methods[] = { /* BufferedIOMixin methods */ {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, @@ -1283,10 +1393,10 @@ {"isatty", (PyCFunction)BufferedIOMixin_isatty, METH_NOARGS}, {"write", (PyCFunction)BufferedWriter_write, METH_VARARGS}, - {"truncate", (PyCFunction)BufferedWriter_truncate, METH_VARARGS}, - {"flush", (PyCFunction)BufferedWriter_flush, METH_NOARGS}, - {"seek", (PyCFunction)BufferedWriter_seek, METH_VARARGS}, - {"tell", (PyCFunction)BufferedWriter_tell, METH_NOARGS}, + {"truncate", (PyCFunction)Buffered_truncate, METH_VARARGS}, + {"flush", (PyCFunction)Buffered_flush, METH_NOARGS}, + {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, + {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, {NULL, NULL} }; @@ -1513,6 +1623,7 @@ {"read", (PyCFunction)BufferedRWPair_read, METH_VARARGS}, {"peek", (PyCFunction)BufferedRWPair_peek, METH_VARARGS}, {"read1", (PyCFunction)BufferedRWPair_read1, METH_VARARGS}, + {"readinto", (PyCFunction)Buffered_readinto, METH_VARARGS}, {"write", (PyCFunction)BufferedRWPair_write, METH_VARARGS}, {"flush", (PyCFunction)BufferedRWPair_flush, METH_NOARGS}, @@ -1607,211 +1718,19 @@ Py_INCREF(raw); self->raw = raw; self->buffer_size = buffer_size; + self->readable = 1; + self->writable = 1; if (_Buffered_init(self) < 0) return -1; - Py_CLEAR(self->read_buf); - self->read_buf = PyMem_Malloc(self->buffer_size); - if (self->read_buf == NULL) { - PyErr_NoMemory(); - return -1; - } - if (_BufferedReader_reset_buf(self) < 0) - return -1; - - self->read_lock = PyThread_allocate_lock(); - if (self->read_lock == NULL) { - PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock"); - return -1; - } - - Py_CLEAR(self->write_buf); - self->write_buf = PyMem_Malloc(self->buffer_size); - if (self->write_buf == NULL) { - PyErr_NoMemory(); - return -1; - } - if (_BufferedWriter_reset_buf(self) < 0) - return -1; - - self->write_lock = PyThread_allocate_lock(); - if (self->write_lock == NULL) { - PyErr_SetString(PyExc_RuntimeError, "can't allocate write lock"); - return -1; - } + _BufferedReader_reset_buf(self); + _BufferedWriter_reset_buf(self); + self->pos = 0; self->ok = 1; return 0; } -static PyObject * -BufferedRandom_tell(BufferedObject *self, PyObject *args) -{ - CHECK_INITIALIZED(self) - if (self->write_end > self->write_pos) - return BufferedWriter_tell(self, args); - else - return BufferedReader_tell(self, args); -} - -static PyObject * -BufferedRandom_seek(BufferedObject *self, PyObject *args) -{ - Py_ssize_t pos; - int whence = 0; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "n|i:seek", &pos, &whence)) { - return NULL; - } - - res = PyObject_CallMethod((PyObject *)self, "flush", NULL); - if (res == NULL) - return NULL; - - /* First do the raw seek, then empty the read buffer, so that - * if the raw seek fails, we don't lose buffered data forever. - */ - - ENTER_BUFFERED_READER(self) - - pos = _Buffered_raw_seek(self, pos, whence); - if (pos == -1) - goto end; - res = PyLong_FromSsize_t(pos); - if (res == NULL) - goto end; - - if (_BufferedReader_reset_buf(self) < 0 - || _BufferedWriter_reset_buf(self) < 0) - Py_CLEAR(res); - -end: - LEAVE_BUFFERED_READER(self) - return res; -} - -static PyObject * -BufferedRandom_truncate(BufferedObject *self, PyObject *args) -{ - PyObject *pos = Py_None; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { - return NULL; - } - - if (pos == Py_None) - pos = PyObject_CallMethod(self->raw, "tell", NULL); - else - Py_INCREF(pos); - - /* Use seek to flush the read buffer. */ - res = PyObject_CallMethod((PyObject *)self, "seek", "O", pos); - Py_DECREF(pos); - if (res == NULL) - return NULL; - Py_DECREF(res); - - args = PyTuple_New(0); - if (args == NULL) - return NULL; - res = BufferedWriter_truncate(self, args); - Py_DECREF(args); - - return res; -} - -static PyObject * -BufferedRandom_read(BufferedObject *self, PyObject *args) -{ - Py_ssize_t n = -1; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "|n:read", &n)) { - return NULL; - } - - res = BufferedWriter_flush(self, Py_None); - if (res == NULL) - return NULL; - - return BufferedReader_read(self, args); -} - -static PyObject * -BufferedRandom_readinto(BufferedObject *self, PyObject *args) -{ - PyObject *res; - - CHECK_INITIALIZED(self) - res = BufferedWriter_flush(self, Py_None); - if (res == NULL) - return NULL; - Py_DECREF(res); - - return BufferedIOBase_readinto((PyObject *)self, args); -} - -static PyObject * -BufferedRandom_peek(BufferedObject *self, PyObject *args) -{ - PyObject *res; - CHECK_INITIALIZED(self) - res = BufferedWriter_flush(self, Py_None); - if (res == NULL) - return NULL; - Py_DECREF(res); - - return BufferedReader_peek(self, args); -} - -static PyObject * -BufferedRandom_read1(BufferedObject *self, PyObject *args) -{ - PyObject *res; - CHECK_INITIALIZED(self) - res = BufferedWriter_flush(self, Py_None); - if (res == NULL) - return NULL; - Py_DECREF(res); - - return BufferedReader_read1(self, args); -} - -static PyObject * -BufferedRandom_write(BufferedObject *self, PyObject *args) -{ - Py_ssize_t readahead; - CHECK_INITIALIZED(self) - readahead = AVAILABLE_BYTES(self); - if (readahead > 0) { - PyObject *res; - /* Undo readahead */ - - ENTER_BUFFERED_READER(self) - - res = PyObject_CallMethod(self->raw, "seek", "ni", - -readahead, 1); - Py_XDECREF(res); - if (res != NULL) { - if (_BufferedReader_reset_buf(self) < 0) - res = NULL; - } - - LEAVE_BUFFERED_READER(self) - - if (res == NULL) - return NULL; - } - - return BufferedWriter_write(self, args); -} - - static PyMethodDef BufferedRandom_methods[] = { /* BufferedIOMixin methods */ {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, @@ -1821,16 +1740,16 @@ {"fileno", (PyCFunction)BufferedIOMixin_fileno, METH_NOARGS}, {"isatty", (PyCFunction)BufferedIOMixin_isatty, METH_NOARGS}, - {"flush", (PyCFunction)BufferedWriter_flush, METH_NOARGS}, + {"flush", (PyCFunction)Buffered_flush, METH_NOARGS}, - {"seek", (PyCFunction)BufferedRandom_seek, METH_VARARGS}, - {"tell", (PyCFunction)BufferedRandom_tell, METH_NOARGS}, - {"truncate", (PyCFunction)BufferedRandom_truncate, METH_VARARGS}, - {"read", (PyCFunction)BufferedRandom_read, METH_VARARGS}, - {"readinto", (PyCFunction)BufferedRandom_readinto, METH_VARARGS}, - {"peek", (PyCFunction)BufferedRandom_peek, METH_VARARGS}, - {"read1", (PyCFunction)BufferedRandom_read1, METH_VARARGS}, - {"write", (PyCFunction)BufferedRandom_write, METH_VARARGS}, + {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, + {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, + {"truncate", (PyCFunction)Buffered_truncate, METH_VARARGS}, + {"read", (PyCFunction)Buffered_read, METH_VARARGS}, + {"read1", (PyCFunction)Buffered_read1, METH_VARARGS}, + {"readinto", (PyCFunction)Buffered_readinto, METH_VARARGS}, + {"peek", (PyCFunction)Buffered_peek, METH_VARARGS}, + {"write", (PyCFunction)BufferedWriter_write, METH_VARARGS}, {NULL, NULL} }; Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Tue Jan 6 02:04:25 2009 @@ -60,5 +60,6 @@ extern PyObject *_PyIO_str_readinto; 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: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Tue Jan 6 02:04:25 2009 @@ -24,6 +24,7 @@ PyObject *_PyIO_str_readinto; PyObject *_PyIO_str_seekable; PyObject *_PyIO_str_tell; +PyObject *_PyIO_str_truncate; PyObject *_PyIO_str_writable; PyObject *_PyIO_str_write; @@ -643,6 +644,8 @@ goto fail; if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) goto fail; + if (!(_PyIO_str_truncate = PyUnicode_InternFromString("truncate"))) + goto fail; if (!(_PyIO_str_write = PyUnicode_InternFromString("write"))) goto fail; if (!(_PyIO_str_writable = PyUnicode_InternFromString("writable"))) From buildbot at python.org Tue Jan 6 02:07:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 01:07:38 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20090106010738.2F44F1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/26 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc 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_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 6 02:22:16 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 02:22:16 +0100 (CET) Subject: [Python-checkins] r68355 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090106012216.9A4C41E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 02:22:15 2009 New Revision: 68355 Log: fix a failure in test_file.py Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Tue Jan 6 02:22:15 2009 @@ -747,10 +747,16 @@ if (res == NULL) goto end; Py_CLEAR(res); - _BufferedWriter_reset_buf(self); } - if (self->readable) + if (self->readable) { + if (pos == Py_None) { + /* Rewind the raw stream so that its position corresponds to + the current logical position. */ + if (_Buffered_raw_seek(self, -RAW_OFFSET(self), 1) == -1) + goto end; + } _BufferedReader_reset_buf(self); + } res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); if (res == NULL) goto end; From python-checkins at python.org Tue Jan 6 03:29:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 03:29:30 +0100 (CET) Subject: [Python-checkins] r68356 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090106022930.D95BE1E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 03:29:30 2009 New Revision: 68356 Log: fix test_zipfile Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Tue Jan 6 03:29:30 2009 @@ -708,6 +708,7 @@ if (res == NULL) goto end; Py_CLEAR(res); + _BufferedWriter_reset_buf(self); } /* TODO: align on block boundary and read buffer if needed? */ @@ -718,7 +719,7 @@ goto end; self->raw_pos = -1; res = PyLong_FromSsize_t(n); - if (res != NULL) + if (res != NULL && self->readable) _BufferedReader_reset_buf(self); end: From python-checkins at python.org Tue Jan 6 03:31:46 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 03:31:46 +0100 (CET) Subject: [Python-checkins] r68357 - sandbox/trunk/io-c/test_io.py Message-ID: <20090106023146.0E1671E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 03:31:45 2009 New Revision: 68357 Log: seeks are supposed to work on BufferedWriter, test it as well Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Tue Jan 6 03:31:45 2009 @@ -663,6 +663,20 @@ def testWritesAndFlushes(self): self.check_writes(lambda bufio: bufio.flush()) + def testWritesAndSeeks(self): + def _seekabs(bufio): + pos = bufio.tell() + bufio.seek(pos + 1, 0) + bufio.seek(pos - 1, 0) + bufio.seek(pos, 0) + self.check_writes(_seekabs) + def _seekrel(bufio): + pos = bufio.seek(0, 1) + bufio.seek(+1, 1) + bufio.seek(-1, 1) + bufio.seek(pos, 0) + self.check_writes(_seekrel) + def testWritesAndTruncates(self): self.check_writes(lambda bufio: bufio.truncate(bufio.tell())) @@ -693,6 +707,19 @@ # Previously buffered bytes were flushed self.assertTrue(s.startswith(b"01234567A"), s) + def testWriteAndRewind(self): + raw = io.BytesIO() + bufio = self.tp(raw, 4) + self.assertEqual(bufio.write(b"abcdef"), 6) + self.assertEqual(bufio.tell(), 6) + bufio.seek(0, 0) + self.assertEqual(bufio.write(b"XY"), 2) + bufio.seek(6, 0) + self.assertEqual(raw.getvalue(), b"XYcdef") + self.assertEqual(bufio.write(b"123456"), 6) + bufio.flush() + self.assertEqual(raw.getvalue(), b"XYcdef123456") + def testFlush(self): writer = MockRawIO() bufio = self.tp(writer, 8) @@ -902,20 +929,6 @@ bufio.readinto(bytearray(1)) self.check_writes(_read) - def testWritesAndSeeks(self): - def _seekabs(bufio): - pos = bufio.tell() - bufio.seek(pos + 1, 0) - bufio.seek(pos - 1, 0) - bufio.seek(pos, 0) - self.check_writes(_seekabs) - def _seekrel(bufio): - pos = bufio.seek(0, 1) - bufio.seek(+1, 1) - bufio.seek(-1, 1) - bufio.seek(pos, 0) - self.check_writes(_seekrel) - # To fully exercise seek/tell, the StatefulIncrementalDecoder has these # properties: From python-checkins at python.org Tue Jan 6 03:59:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 03:59:11 +0100 (CET) Subject: [Python-checkins] r68358 - in sandbox/trunk/io-c: _iobase.c _iomodule.h io.c Message-ID: <20090106025911.980491E402A@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 03:59:11 2009 New Revision: 68358 Log: More interned strings. Modified: sandbox/trunk/io-c/_iobase.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/io.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Tue Jan 6 03:59:11 2009 @@ -138,7 +138,7 @@ PyObject_SetAttrString(self, "__IOBase_closed", Py_True); - res = PyObject_CallMethod(self, "flush", NULL); + res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL); if (res == NULL) { /* If flush() fails, just give up */ if (PyErr_ExceptionMatches(PyExc_IOError)) @@ -186,7 +186,7 @@ PyObject * _PyIOBase_checkSeekable(PyObject *self, PyObject *unused) { - PyObject *res = PyObject_CallMethod(self, "seekable", NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_seekable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -211,7 +211,7 @@ PyObject * _PyIOBase_checkReadable(PyObject *self, PyObject *unused) { - PyObject *res = PyObject_CallMethod(self, "readable", NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_readable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -236,7 +236,7 @@ PyObject * _PyIOBase_checkWritable(PyObject *self, PyObject *unused) { - PyObject *res = PyObject_CallMethod(self, "writable", NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_writable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -261,7 +261,7 @@ static PyObject * IOBase_exit(PyObject *self, PyObject *args) { - return PyObject_CallMethod(self, "close", NULL); + return PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); } /* Lower-level APIs */ @@ -399,7 +399,7 @@ static PyObject * IOBase_iternext(PyObject *self) { - PyObject *line = PyObject_CallMethod(self, "readline", NULL); + PyObject *line = PyObject_CallMethodObjArgs(self, _PyIO_str_readline, NULL); if (line == NULL) return NULL; @@ -498,7 +498,7 @@ break; /* Stop Iteration */ } - res = PyObject_CallMethod(self, "write", "O", line); + res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); Py_DECREF(line); if (res == NULL) { Py_DECREF(iter); @@ -627,11 +627,13 @@ if (n < 0) return PyObject_CallMethod(self, "readall", NULL); + /* TODO: allocate a bytes object directly instead and manually construct + a writable memoryview pointing to it. */ b = PyByteArray_FromStringAndSize(NULL, n); if (b == NULL) return NULL; - res = PyObject_CallMethod(self, "readinto", "O", b); + res = PyObject_CallMethodObjArgs(self, _PyIO_str_readinto, b, NULL); if (res == NULL) { Py_DECREF(b); return NULL; Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Tue Jan 6 03:59:11 2009 @@ -58,6 +58,7 @@ extern PyObject *_PyIO_str_read; extern PyObject *_PyIO_str_readable; extern PyObject *_PyIO_str_readinto; +extern PyObject *_PyIO_str_readline; extern PyObject *_PyIO_str_seekable; extern PyObject *_PyIO_str_tell; extern PyObject *_PyIO_str_truncate; Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Tue Jan 6 03:59:11 2009 @@ -22,6 +22,7 @@ PyObject *_PyIO_str_read; PyObject *_PyIO_str_readable; PyObject *_PyIO_str_readinto; +PyObject *_PyIO_str_readline; PyObject *_PyIO_str_seekable; PyObject *_PyIO_str_tell; PyObject *_PyIO_str_truncate; @@ -640,6 +641,8 @@ goto fail; if (!(_PyIO_str_readinto = PyUnicode_InternFromString("readinto"))) goto fail; + if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) + goto fail; if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) goto fail; if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) From nnorwitz at gmail.com Tue Jan 6 10:15:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 6 Jan 2009 04:15:09 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090106091509.GA8987@python.psfb.org> 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_urllib2 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known 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 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [655114 refs] From python-checkins at python.org Tue Jan 6 10:37:13 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 6 Jan 2009 10:37:13 +0100 (CET) Subject: [Python-checkins] r68359 - python/branches/py3k/Python/bltinmodule.c Message-ID: <20090106093713.AEC911E4026@bag.python.org> Author: raymond.hettinger Date: Tue Jan 6 10:37:13 2009 New Revision: 68359 Log: Mini-optimization: use pack/unpack functions for argument tuples. Modified: python/branches/py3k/Python/bltinmodule.c Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Tue Jan 6 10:37:13 2009 @@ -112,7 +112,7 @@ ns = PyDict_New(); } else { - PyObject *pargs = Py_BuildValue("OO", name, bases); + PyObject *pargs = PyTuple_Pack(2, name, bases); if (pargs == NULL) { Py_DECREF(prep); Py_DECREF(meta); @@ -133,7 +133,7 @@ cell = PyObject_CallFunctionObjArgs(func, ns, NULL); if (cell != NULL) { PyObject *margs; - margs = Py_BuildValue("OOO", name, bases, ns); + margs = PyTuple_Pack(3, name, bases, ns); if (margs != NULL) { cls = PyEval_CallObjectWithKeywords(meta, margs, mkw); Py_DECREF(margs); @@ -754,7 +754,7 @@ PyObject *prog, *globals = Py_None, *locals = Py_None; int plain = 0; - if (!PyArg_ParseTuple(args, "O|OO:exec", &prog, &globals, &locals)) + if (!PyArg_UnpackTuple(args, "exec", 1, 3, &prog, &globals, &locals)) return NULL; if (globals == Py_None) { From dickinsm at gmail.com Tue Jan 6 11:26:13 2009 From: dickinsm at gmail.com (Mark Dickinson) Date: Tue, 6 Jan 2009 10:26:13 +0000 Subject: [Python-checkins] r68182 - in python/trunk: Lib/decimal.py Misc/NEWS In-Reply-To: References: <20090102230709.032011E4002@bag.python.org> Message-ID: <5c6f2a5d0901060226x29df4c40i3da447c88a9df404@mail.gmail.com> On Mon, Jan 5, 2009 at 3:12 PM, Jim Jewett wrote: > Our of curiousity, why are these constants for internal use only? I don't think anyone ever thought about deliberately making them public---I suspect they were introduced as a speed optimization. I can see that having things like NaN = Decimal('NaN') might be handy for some users (though I actually suspect that the intersection between Decimal users and those who care about NaNs is rather small...), but they don't belong in the decimal module, which is supposed to be kept very close to the standard and, exactly as you say, keep the beyond-the-spec API small. Maybe it's time for the "Add a decimal_utils module" PEP, which could contain such constants? There are many other definitions and conveniences that could go into such a module. One thing in particular that I miss is a sqrt() *function* (as opposed to Decimal method) that takes a Decimal, int or long and returns a Decimal; similarly for exp, log, log10, ... Another thing that has been requested recently on c.l.p. is good implementations of trig functions for Decimal, which are quite hard to do properly. Mark From buildbot at python.org Tue Jan 6 12:13:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 11:13:00 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.x Message-ID: <20090106111300.738EC1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.x/builds/42 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc 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_tarfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 12:13:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 11:13:38 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.x Message-ID: <20090106111338.8EFF01E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.x/builds/56 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc 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_tarfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 6 19:10:47 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 19:10:47 +0100 (CET) Subject: [Python-checkins] r68360 - in python/trunk: Lib/test/test_import.py Misc/NEWS Python/import.c Message-ID: <20090106181047.863F41E404E@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 19:10:47 2009 New Revision: 68360 Log: Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. Modified: python/trunk/Lib/test/test_import.py python/trunk/Misc/NEWS python/trunk/Python/import.c Modified: python/trunk/Lib/test/test_import.py ============================================================================== --- python/trunk/Lib/test/test_import.py (original) +++ python/trunk/Lib/test/test_import.py Tue Jan 6 19:10:47 2009 @@ -5,6 +5,7 @@ import sys import py_compile import warnings +import marshal from test.test_support import unlink, TESTFN, unload, run_unittest, check_warnings @@ -231,6 +232,97 @@ else: self.fail("import by path didn't raise an exception") +class TestPycRewriting(unittest.TestCase): + # Test that the `co_filename` attribute on code objects always points + # to the right file, even when various things happen (e.g. both the .py + # and the .pyc file are renamed). + + module_name = "unlikely_module_name" + module_source = """ +import sys +code_filename = sys._getframe().f_code.co_filename +module_filename = __file__ +constant = 1 +def func(): + pass +func_filename = func.func_code.co_filename +""" + dir_name = os.path.abspath(TESTFN) + file_name = os.path.join(dir_name, module_name) + os.extsep + "py" + compiled_name = file_name + ("c" if __debug__ else "o") + + def setUp(self): + self.sys_path = sys.path[:] + self.orig_module = sys.modules.pop(self.module_name, None) + os.mkdir(self.dir_name) + with open(self.file_name, "w") as f: + f.write(self.module_source) + sys.path.insert(0, self.dir_name) + + def tearDown(self): + sys.path[:] = self.sys_path + if self.orig_module is not None: + sys.modules[self.module_name] = self.orig_module + else: + del sys.modules[self.module_name] + for file_name in self.file_name, self.compiled_name: + if os.path.exists(file_name): + os.remove(file_name) + if os.path.exists(self.dir_name): + os.rmdir(self.dir_name) + + def import_module(self): + ns = globals() + __import__(self.module_name, ns, ns) + return sys.modules[self.module_name] + + def test_basics(self): + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + del sys.modules[self.module_name] + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_incorrect_code_name(self): + py_compile.compile(self.file_name, dfile="another_module.py") + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_module_without_source(self): + target = "another_module.py" + py_compile.compile(self.file_name, dfile=target) + os.remove(self.file_name) + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, target) + self.assertEqual(mod.func_filename, target) + + def test_foreign_code(self): + py_compile.compile(self.file_name) + with open(self.compiled_name, "rb") as f: + header = f.read(8) + code = marshal.load(f) + constants = list(code.co_consts) + foreign_code = test_main.func_code + pos = constants.index(1) + constants[pos] = foreign_code + code = type(code)(code.co_argcount, code.co_nlocals, code.co_stacksize, + code.co_flags, code.co_code, tuple(constants), + code.co_names, code.co_varnames, code.co_filename, + code.co_name, code.co_firstlineno, code.co_lnotab, + code.co_freevars, code.co_cellvars) + with open(self.compiled_name, "wb") as f: + f.write(header) + marshal.dump(code, f) + mod = self.import_module() + self.assertEqual(mod.constant.co_filename, foreign_code.co_filename) + class PathsTests(unittest.TestCase): path = TESTFN @@ -297,7 +389,7 @@ self.assertRaises(ValueError, check_relative) def test_main(verbose=None): - run_unittest(ImportTest, PathsTests, RelativeImport) + run_unittest(ImportTest, TestPycRewriting, PathsTests, RelativeImport) if __name__ == '__main__': # test needs to be a package, so we can do relative import Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 6 19:10:47 2009 @@ -12,6 +12,12 @@ Core and Builtins ----------------- +- Issue #1180193: When importing a module from a .pyc (or .pyo) file with + an existing .py counterpart, override the co_filename attributes of all + code objects if the original filename is obsolete (which can happen if the + file has been renamed, moved, or if it is accessed through different paths). + Patch by Ziga Seilnacht and Jean-Paul Calderone. + - Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Tue Jan 6 19:10:47 2009 @@ -909,6 +909,49 @@ PySys_WriteStderr("# wrote %s\n", cpathname); } +static void +update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname) +{ + PyObject *constants, *tmp; + Py_ssize_t i, n; + + if (!_PyString_Eq(co->co_filename, oldname)) + return; + + tmp = co->co_filename; + co->co_filename = newname; + Py_INCREF(co->co_filename); + Py_DECREF(tmp); + + constants = co->co_consts; + n = PyTuple_GET_SIZE(constants); + for (i = 0; i < n; i++) { + tmp = PyTuple_GET_ITEM(constants, i); + if (PyCode_Check(tmp)) + update_code_filenames((PyCodeObject *)tmp, + oldname, newname); + } +} + +static int +update_compiled_module(PyCodeObject *co, char *pathname) +{ + PyObject *oldname, *newname; + + if (strcmp(PyString_AsString(co->co_filename), pathname) == 0) + return 0; + + newname = PyString_FromString(pathname); + if (newname == NULL) + return -1; + + oldname = co->co_filename; + Py_INCREF(oldname); + update_code_filenames(co, oldname, newname); + Py_DECREF(oldname); + Py_DECREF(newname); + return 1; +} /* Load a source module from a given file and return its module object WITH INCREMENTED REFERENCE COUNT. If there's a matching @@ -949,6 +992,8 @@ fclose(fpc); if (co == NULL) return NULL; + if (update_compiled_module(co, pathname) < 0) + return NULL; if (Py_VerboseFlag) PySys_WriteStderr("import %s # precompiled from %s\n", name, cpathname); From python-checkins at python.org Tue Jan 6 19:34:09 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 19:34:09 +0100 (CET) Subject: [Python-checkins] r68361 - python/trunk/Lib/test/test_import.py Message-ID: <20090106183409.068331E4024@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 19:34:08 2009 New Revision: 68361 Log: Use shutil.rmtree rather than os.rmdir. Modified: python/trunk/Lib/test/test_import.py Modified: python/trunk/Lib/test/test_import.py ============================================================================== --- python/trunk/Lib/test/test_import.py (original) +++ python/trunk/Lib/test/test_import.py Tue Jan 6 19:34:08 2009 @@ -269,7 +269,7 @@ if os.path.exists(file_name): os.remove(file_name) if os.path.exists(self.dir_name): - os.rmdir(self.dir_name) + shutil.rmtree(self.dir_name) def import_module(self): ns = globals() From python-checkins at python.org Tue Jan 6 20:00:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 20:00:59 +0100 (CET) Subject: [Python-checkins] r68362 - in python/branches/release26-maint: Lib/test/test_import.py Misc/NEWS Python/import.c Message-ID: <20090106190059.7CB261E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 20:00:59 2009 New Revision: 68362 Log: Merged revisions 68360 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68360 | antoine.pitrou | 2009-01-06 19:10:47 +0100 (mar., 06 janv. 2009) | 7 lines Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_import.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Python/import.c Modified: python/branches/release26-maint/Lib/test/test_import.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_import.py (original) +++ python/branches/release26-maint/Lib/test/test_import.py Tue Jan 6 20:00:59 2009 @@ -5,6 +5,7 @@ import sys import py_compile import warnings +import marshal from test.test_support import unlink, TESTFN, unload, run_unittest, check_warnings @@ -231,6 +232,97 @@ else: self.fail("import by path didn't raise an exception") +class TestPycRewriting(unittest.TestCase): + # Test that the `co_filename` attribute on code objects always points + # to the right file, even when various things happen (e.g. both the .py + # and the .pyc file are renamed). + + module_name = "unlikely_module_name" + module_source = """ +import sys +code_filename = sys._getframe().f_code.co_filename +module_filename = __file__ +constant = 1 +def func(): + pass +func_filename = func.func_code.co_filename +""" + dir_name = os.path.abspath(TESTFN) + file_name = os.path.join(dir_name, module_name) + os.extsep + "py" + compiled_name = file_name + ("c" if __debug__ else "o") + + def setUp(self): + self.sys_path = sys.path[:] + self.orig_module = sys.modules.pop(self.module_name, None) + os.mkdir(self.dir_name) + with open(self.file_name, "w") as f: + f.write(self.module_source) + sys.path.insert(0, self.dir_name) + + def tearDown(self): + sys.path[:] = self.sys_path + if self.orig_module is not None: + sys.modules[self.module_name] = self.orig_module + else: + del sys.modules[self.module_name] + for file_name in self.file_name, self.compiled_name: + if os.path.exists(file_name): + os.remove(file_name) + if os.path.exists(self.dir_name): + os.rmdir(self.dir_name) + + def import_module(self): + ns = globals() + __import__(self.module_name, ns, ns) + return sys.modules[self.module_name] + + def test_basics(self): + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + del sys.modules[self.module_name] + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_incorrect_code_name(self): + py_compile.compile(self.file_name, dfile="another_module.py") + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_module_without_source(self): + target = "another_module.py" + py_compile.compile(self.file_name, dfile=target) + os.remove(self.file_name) + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, target) + self.assertEqual(mod.func_filename, target) + + def test_foreign_code(self): + py_compile.compile(self.file_name) + with open(self.compiled_name, "rb") as f: + header = f.read(8) + code = marshal.load(f) + constants = list(code.co_consts) + foreign_code = test_main.func_code + pos = constants.index(1) + constants[pos] = foreign_code + code = type(code)(code.co_argcount, code.co_nlocals, code.co_stacksize, + code.co_flags, code.co_code, tuple(constants), + code.co_names, code.co_varnames, code.co_filename, + code.co_name, code.co_firstlineno, code.co_lnotab, + code.co_freevars, code.co_cellvars) + with open(self.compiled_name, "wb") as f: + f.write(header) + marshal.dump(code, f) + mod = self.import_module() + self.assertEqual(mod.constant.co_filename, foreign_code.co_filename) + class PathsTests(unittest.TestCase): path = TESTFN @@ -297,7 +389,7 @@ self.assertRaises(ValueError, check_relative) def test_main(verbose=None): - run_unittest(ImportTest, PathsTests, RelativeImport) + run_unittest(ImportTest, TestPycRewriting, PathsTests, RelativeImport) if __name__ == '__main__': # test needs to be a package, so we can do relative import Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Jan 6 20:00:59 2009 @@ -12,6 +12,12 @@ Core and Builtins ----------------- +- Issue #1180193: When importing a module from a .pyc (or .pyo) file with + an existing .py counterpart, override the co_filename attributes of all + code objects if the original filename is obsolete (which can happen if the + file has been renamed, moved, or if it is accessed through different paths). + Patch by Ziga Seilnacht and Jean-Paul Calderone. + - Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open Modified: python/branches/release26-maint/Python/import.c ============================================================================== --- python/branches/release26-maint/Python/import.c (original) +++ python/branches/release26-maint/Python/import.c Tue Jan 6 20:00:59 2009 @@ -910,6 +910,49 @@ PySys_WriteStderr("# wrote %s\n", cpathname); } +static void +update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname) +{ + PyObject *constants, *tmp; + Py_ssize_t i, n; + + if (!_PyString_Eq(co->co_filename, oldname)) + return; + + tmp = co->co_filename; + co->co_filename = newname; + Py_INCREF(co->co_filename); + Py_DECREF(tmp); + + constants = co->co_consts; + n = PyTuple_GET_SIZE(constants); + for (i = 0; i < n; i++) { + tmp = PyTuple_GET_ITEM(constants, i); + if (PyCode_Check(tmp)) + update_code_filenames((PyCodeObject *)tmp, + oldname, newname); + } +} + +static int +update_compiled_module(PyCodeObject *co, char *pathname) +{ + PyObject *oldname, *newname; + + if (strcmp(PyString_AsString(co->co_filename), pathname) == 0) + return 0; + + newname = PyString_FromString(pathname); + if (newname == NULL) + return -1; + + oldname = co->co_filename; + Py_INCREF(oldname); + update_code_filenames(co, oldname, newname); + Py_DECREF(oldname); + Py_DECREF(newname); + return 1; +} /* Load a source module from a given file and return its module object WITH INCREMENTED REFERENCE COUNT. If there's a matching @@ -950,6 +993,8 @@ fclose(fpc); if (co == NULL) return NULL; + if (update_compiled_module(co, pathname) < 0) + return NULL; if (Py_VerboseFlag) PySys_WriteStderr("import %s # precompiled from %s\n", name, cpathname); From buildbot at python.org Tue Jan 6 20:02:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 19:02:08 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090106190208.2D79A1E4002@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/486 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: 1 test failed: test_urllib2 ====================================================================== ERROR: test_file (test.test_urllib2.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno 8] nodename nor servname provided, or not known make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 6 20:02:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 20:02:24 +0100 (CET) Subject: [Python-checkins] r68363 - in python/branches/py3k: Lib/test/test_import.py Misc/NEWS Python/import.c Message-ID: <20090106190224.D8DCF1E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 20:02:24 2009 New Revision: 68363 Log: Merged revisions 68360-68361 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68360 | antoine.pitrou | 2009-01-06 19:10:47 +0100 (mar., 06 janv. 2009) | 7 lines Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. ........ r68361 | antoine.pitrou | 2009-01-06 19:34:08 +0100 (mar., 06 janv. 2009) | 3 lines Use shutil.rmtree rather than os.rmdir. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_import.py python/branches/py3k/Misc/NEWS python/branches/py3k/Python/import.c Modified: python/branches/py3k/Lib/test/test_import.py ============================================================================== --- python/branches/py3k/Lib/test/test_import.py (original) +++ python/branches/py3k/Lib/test/test_import.py Tue Jan 6 20:02:24 2009 @@ -6,6 +6,7 @@ import py_compile import warnings import imp +import marshal from test.support import unlink, TESTFN, unload, run_unittest @@ -230,6 +231,98 @@ else: self.fail("import by path didn't raise an exception") +class TestPycRewriting(unittest.TestCase): + # Test that the `co_filename` attribute on code objects always points + # to the right file, even when various things happen (e.g. both the .py + # and the .pyc file are renamed). + + module_name = "unlikely_module_name" + module_source = """ +import sys +code_filename = sys._getframe().f_code.co_filename +module_filename = __file__ +constant = 1 +def func(): + pass +func_filename = func.__code__.co_filename +""" + dir_name = os.path.abspath(TESTFN) + file_name = os.path.join(dir_name, module_name) + os.extsep + "py" + compiled_name = file_name + ("c" if __debug__ else "o") + + def setUp(self): + self.sys_path = sys.path[:] + self.orig_module = sys.modules.pop(self.module_name, None) + os.mkdir(self.dir_name) + with open(self.file_name, "w") as f: + f.write(self.module_source) + sys.path.insert(0, self.dir_name) + + def tearDown(self): + sys.path[:] = self.sys_path + if self.orig_module is not None: + sys.modules[self.module_name] = self.orig_module + else: + del sys.modules[self.module_name] + for file_name in self.file_name, self.compiled_name: + if os.path.exists(file_name): + os.remove(file_name) + if os.path.exists(self.dir_name): + shutil.rmtree(self.dir_name) + + def import_module(self): + ns = globals() + __import__(self.module_name, ns, ns) + return sys.modules[self.module_name] + + def test_basics(self): + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + del sys.modules[self.module_name] + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_incorrect_code_name(self): + py_compile.compile(self.file_name, dfile="another_module.py") + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_module_without_source(self): + target = "another_module.py" + py_compile.compile(self.file_name, dfile=target) + os.remove(self.file_name) + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, target) + self.assertEqual(mod.func_filename, target) + + def test_foreign_code(self): + py_compile.compile(self.file_name) + with open(self.compiled_name, "rb") as f: + header = f.read(8) + code = marshal.load(f) + constants = list(code.co_consts) + foreign_code = test_main.__code__ + pos = constants.index(1) + constants[pos] = foreign_code + code = type(code)(code.co_argcount, code.co_kwonlyargcount, + code.co_nlocals, code.co_stacksize, + code.co_flags, code.co_code, tuple(constants), + code.co_names, code.co_varnames, code.co_filename, + code.co_name, code.co_firstlineno, code.co_lnotab, + code.co_freevars, code.co_cellvars) + with open(self.compiled_name, "wb") as f: + f.write(header) + marshal.dump(code, f) + mod = self.import_module() + self.assertEqual(mod.constant.co_filename, foreign_code.co_filename) + class PathsTests(unittest.TestCase): SAMPLES = ('test', 'test\u00e4\u00f6\u00fc\u00df', 'test\u00e9\u00e8', 'test\u00b0\u00b3\u00b2') @@ -288,7 +381,7 @@ self.assertRaises(ValueError, check_relative) def test_main(verbose=None): - run_unittest(ImportTest, PathsTests, RelativeImport) + run_unittest(ImportTest, TestPycRewriting, PathsTests, RelativeImport) if __name__ == '__main__': # test needs to be a package, so we can do relative import Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 6 20:02:24 2009 @@ -12,6 +12,12 @@ Core and Builtins ----------------- +- Issue #1180193: When importing a module from a .pyc (or .pyo) file with + an existing .py counterpart, override the co_filename attributes of all + code objects if the original filename is obsolete (which can happen if the + file has been renamed, moved, or if it is accessed through different paths). + Patch by Ziga Seilnacht and Jean-Paul Calderone. + - Issue #4580: Fix slicing of memoryviews when the item size is greater than one byte. Also fixes the meaning of len() so that it returns the number of items, rather than the size in bytes. Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Tue Jan 6 20:02:24 2009 @@ -959,6 +959,49 @@ PySys_WriteStderr("# wrote %s\n", cpathname); } +static void +update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname) +{ + PyObject *constants, *tmp; + Py_ssize_t i, n; + + if (PyUnicode_Compare(co->co_filename, oldname)) + return; + + tmp = co->co_filename; + co->co_filename = newname; + Py_INCREF(co->co_filename); + Py_DECREF(tmp); + + constants = co->co_consts; + n = PyTuple_GET_SIZE(constants); + for (i = 0; i < n; i++) { + tmp = PyTuple_GET_ITEM(constants, i); + if (PyCode_Check(tmp)) + update_code_filenames((PyCodeObject *)tmp, + oldname, newname); + } +} + +static int +update_compiled_module(PyCodeObject *co, char *pathname) +{ + PyObject *oldname, *newname; + + if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname)) + return 0; + + newname = PyUnicode_FromString(pathname); + if (newname == NULL) + return -1; + + oldname = co->co_filename; + Py_INCREF(oldname); + update_code_filenames(co, oldname, newname); + Py_DECREF(oldname); + Py_DECREF(newname); + return 1; +} /* Load a source module from a given file and return its module object WITH INCREMENTED REFERENCE COUNT. If there's a matching @@ -999,6 +1042,8 @@ fclose(fpc); if (co == NULL) return NULL; + if (update_compiled_module(co, pathname) < 0) + return NULL; if (Py_VerboseFlag) PySys_WriteStderr("import %s # precompiled from %s\n", name, cpathname); From python-checkins at python.org Tue Jan 6 20:08:18 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 6 Jan 2009 20:08:18 +0100 (CET) Subject: [Python-checkins] r68364 - in python/branches/release30-maint: Lib/test/test_import.py Misc/NEWS Python/import.c Message-ID: <20090106190818.ABFD31E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 6 20:08:18 2009 New Revision: 68364 Log: Merged revisions 68363 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68363 | antoine.pitrou | 2009-01-06 20:02:24 +0100 (mar., 06 janv. 2009) | 17 lines Merged revisions 68360-68361 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68360 | antoine.pitrou | 2009-01-06 19:10:47 +0100 (mar., 06 janv. 2009) | 7 lines Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. ........ r68361 | antoine.pitrou | 2009-01-06 19:34:08 +0100 (mar., 06 janv. 2009) | 3 lines Use shutil.rmtree rather than os.rmdir. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_import.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Python/import.c Modified: python/branches/release30-maint/Lib/test/test_import.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_import.py (original) +++ python/branches/release30-maint/Lib/test/test_import.py Tue Jan 6 20:08:18 2009 @@ -6,6 +6,7 @@ import py_compile import warnings import imp +import marshal from test.support import unlink, TESTFN, unload, run_unittest @@ -230,6 +231,98 @@ else: self.fail("import by path didn't raise an exception") +class TestPycRewriting(unittest.TestCase): + # Test that the `co_filename` attribute on code objects always points + # to the right file, even when various things happen (e.g. both the .py + # and the .pyc file are renamed). + + module_name = "unlikely_module_name" + module_source = """ +import sys +code_filename = sys._getframe().f_code.co_filename +module_filename = __file__ +constant = 1 +def func(): + pass +func_filename = func.__code__.co_filename +""" + dir_name = os.path.abspath(TESTFN) + file_name = os.path.join(dir_name, module_name) + os.extsep + "py" + compiled_name = file_name + ("c" if __debug__ else "o") + + def setUp(self): + self.sys_path = sys.path[:] + self.orig_module = sys.modules.pop(self.module_name, None) + os.mkdir(self.dir_name) + with open(self.file_name, "w") as f: + f.write(self.module_source) + sys.path.insert(0, self.dir_name) + + def tearDown(self): + sys.path[:] = self.sys_path + if self.orig_module is not None: + sys.modules[self.module_name] = self.orig_module + else: + del sys.modules[self.module_name] + for file_name in self.file_name, self.compiled_name: + if os.path.exists(file_name): + os.remove(file_name) + if os.path.exists(self.dir_name): + shutil.rmtree(self.dir_name) + + def import_module(self): + ns = globals() + __import__(self.module_name, ns, ns) + return sys.modules[self.module_name] + + def test_basics(self): + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + del sys.modules[self.module_name] + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_incorrect_code_name(self): + py_compile.compile(self.file_name, dfile="another_module.py") + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_module_without_source(self): + target = "another_module.py" + py_compile.compile(self.file_name, dfile=target) + os.remove(self.file_name) + mod = self.import_module() + self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.code_filename, target) + self.assertEqual(mod.func_filename, target) + + def test_foreign_code(self): + py_compile.compile(self.file_name) + with open(self.compiled_name, "rb") as f: + header = f.read(8) + code = marshal.load(f) + constants = list(code.co_consts) + foreign_code = test_main.__code__ + pos = constants.index(1) + constants[pos] = foreign_code + code = type(code)(code.co_argcount, code.co_kwonlyargcount, + code.co_nlocals, code.co_stacksize, + code.co_flags, code.co_code, tuple(constants), + code.co_names, code.co_varnames, code.co_filename, + code.co_name, code.co_firstlineno, code.co_lnotab, + code.co_freevars, code.co_cellvars) + with open(self.compiled_name, "wb") as f: + f.write(header) + marshal.dump(code, f) + mod = self.import_module() + self.assertEqual(mod.constant.co_filename, foreign_code.co_filename) + class PathsTests(unittest.TestCase): SAMPLES = ('test', 'test\u00e4\u00f6\u00fc\u00df', 'test\u00e9\u00e8', 'test\u00b0\u00b3\u00b2') @@ -288,7 +381,7 @@ self.assertRaises(ValueError, check_relative) def test_main(verbose=None): - run_unittest(ImportTest, PathsTests, RelativeImport) + run_unittest(ImportTest, TestPycRewriting, PathsTests, RelativeImport) if __name__ == '__main__': # test needs to be a package, so we can do relative import Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Jan 6 20:08:18 2009 @@ -12,6 +12,12 @@ Core and Builtins ----------------- +- Issue #1180193: When importing a module from a .pyc (or .pyo) file with + an existing .py counterpart, override the co_filename attributes of all + code objects if the original filename is obsolete (which can happen if the + file has been renamed, moved, or if it is accessed through different paths). + Patch by Ziga Seilnacht and Jean-Paul Calderone. + - Issue #4580: Fix slicing of memoryviews when the item size is greater than one byte. Also fixes the meaning of len() so that it returns the number of items, rather than the size in bytes. Modified: python/branches/release30-maint/Python/import.c ============================================================================== --- python/branches/release30-maint/Python/import.c (original) +++ python/branches/release30-maint/Python/import.c Tue Jan 6 20:08:18 2009 @@ -959,6 +959,49 @@ PySys_WriteStderr("# wrote %s\n", cpathname); } +static void +update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname) +{ + PyObject *constants, *tmp; + Py_ssize_t i, n; + + if (PyUnicode_Compare(co->co_filename, oldname)) + return; + + tmp = co->co_filename; + co->co_filename = newname; + Py_INCREF(co->co_filename); + Py_DECREF(tmp); + + constants = co->co_consts; + n = PyTuple_GET_SIZE(constants); + for (i = 0; i < n; i++) { + tmp = PyTuple_GET_ITEM(constants, i); + if (PyCode_Check(tmp)) + update_code_filenames((PyCodeObject *)tmp, + oldname, newname); + } +} + +static int +update_compiled_module(PyCodeObject *co, char *pathname) +{ + PyObject *oldname, *newname; + + if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname)) + return 0; + + newname = PyUnicode_FromString(pathname); + if (newname == NULL) + return -1; + + oldname = co->co_filename; + Py_INCREF(oldname); + update_code_filenames(co, oldname, newname); + Py_DECREF(oldname); + Py_DECREF(newname); + return 1; +} /* Load a source module from a given file and return its module object WITH INCREMENTED REFERENCE COUNT. If there's a matching @@ -999,6 +1042,8 @@ fclose(fpc); if (co == NULL) return NULL; + if (update_compiled_module(co, pathname) < 0) + return NULL; if (Py_VerboseFlag) PySys_WriteStderr("import %s # precompiled from %s\n", name, cpathname); From buildbot at python.org Tue Jan 6 20:09:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 19:09:06 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090106190906.1E1701E4002@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/34 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: antoine.pitrou BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 20:11:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 19:11:28 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090106191128.9EDA41E4002@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/80 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 svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 20:14:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 19:14:03 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20090106191403.7351F1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/31 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 20:15:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 19:15:53 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090106191553.AD7201E4002@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/38 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: antoine.pitrou BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 20:54:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 19:54:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090106195440.927B11E4002@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/70 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 ncoghlan at gmail.com Tue Jan 6 21:07:59 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Wed, 07 Jan 2009 06:07:59 +1000 Subject: [Python-checkins] r68360 - in python/trunk: Lib/test/test_import.py Misc/NEWS Python/import.c In-Reply-To: <20090106181047.863F41E404E@bag.python.org> References: <20090106181047.863F41E404E@bag.python.org> Message-ID: <4963BA1F.3030801@gmail.com> antoine.pitrou wrote: > Author: antoine.pitrou > Date: Tue Jan 6 19:10:47 2009 > New Revision: 68360 > > Log: > Issue #1180193: When importing a module from a .pyc (or .pyo) file with > an existing .py counterpart, override the co_filename attributes of all > code objects if the original filename is obsolete (which can happen if the > file has been renamed, moved, or if it is accessed through different paths). > Patch by Ziga Seilnacht and Jean-Paul Calderone. Ah, great fix. I ran into this problem when working on incorporating the recent changes to get zipimport to play nicely with runpy. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From buildbot at python.org Tue Jan 6 21:29:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 20:29:54 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090106202954.9F5CA1E4014@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/861 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_ssl test_timeout test_urllib2 test_urllib2net test_urllibnet ====================================================================== ERROR: testSSLconnect (test.test_ssl.BasicTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_ssl.py", line 60, in testSSLconnect s.connect(("svn.python.org", 443)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/ssl.py", line 304, in connect socket.connect(self, addr) File "", line 1, in connect gaierror: [Errno -2] Name or service not known ====================================================================== ERROR: testConnect (test.test_ssl.NetworkedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_ssl.py", line 121, in testConnect s.connect(("svn.python.org", 443)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/ssl.py", line 304, in connect socket.connect(self, addr) File "", line 1, in connect gaierror: [Errno -2] Name or service not known ====================================================================== ERROR: testFetchServerCert (test.test_ssl.NetworkedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_ssl.py", line 175, in testFetchServerCert pem = ssl.get_server_certificate(("svn.python.org", 443)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/ssl.py", line 411, in get_server_certificate s.connect(addr) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/ssl.py", line 304, in connect socket.connect(self, addr) File "", line 1, in connect gaierror: [Errno -2] Name or service not known ====================================================================== ERROR: testNonBlockingHandshake (test.test_ssl.NetworkedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_ssl.py", line 151, in testNonBlockingHandshake s.connect(("svn.python.org", 443)) File "", line 1, in connect gaierror: [Errno -2] Name or service not known ====================================================================== ERROR: testRecvTimeout (test.test_timeout.TimeoutTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_timeout.py", line 133, in testRecvTimeout self.sock.connect(self.addr_remote) File "", line 1, in connect gaierror: [Errno -2] Name or service not known ====================================================================== ERROR: test_file (test.test_urllib2.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known ====================================================================== ERROR: test_close (test.test_urllib2net.CloseSocketTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 82, in test_close response = _urlopen_with_retry("http://www.python.org/") File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_ftp_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 230, in test_ftp_basic u = _urlopen_with_retry(self.FTP_HOST) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_ftp_default_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 237, in test_ftp_default_timeout u = _urlopen_with_retry(self.FTP_HOST) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_ftp_no_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 246, in test_ftp_no_timeout u = _urlopen_with_retry(self.FTP_HOST, timeout=None) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_ftp_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 252, in test_ftp_timeout u = _urlopen_with_retry(self.FTP_HOST, timeout=60) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_http_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 201, in test_http_basic u = _urlopen_with_retry("http://www.python.org") File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_http_default_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 208, in test_http_default_timeout u = _urlopen_with_retry("http://www.python.org") File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_http_no_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 217, in test_http_no_timeout u = _urlopen_with_retry("http://www.python.org", timeout=None) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: ====================================================================== ERROR: test_http_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 223, in test_http_timeout u = _urlopen_with_retry("http://www.python.org", timeout=120) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 26, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 22, in _retry_thrice raise last_exc URLError: make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 21:33:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 20:33:29 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20090106203329.72FB91E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/945 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test_ssl test_timeout test_urllib2 test_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 6 22:18:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 06 Jan 2009 21:18:03 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090106211803.A58D11E4002@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/33 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 6 22:39:32 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Tue, 6 Jan 2009 22:39:32 +0100 (CET) Subject: [Python-checkins] r68365 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090106213932.8F4A51E4002@bag.python.org> Author: amaury.forgeotdarc Date: Tue Jan 6 22:39:32 2009 New Revision: 68365 Log: Remove unmatched LEAVE_BUFFERED call which blocks on Windows. Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Tue Jan 6 22:39:32 2009 @@ -723,7 +723,6 @@ _BufferedReader_reset_buf(self); end: - LEAVE_BUFFERED(self) return res; } From python-checkins at python.org Wed Jan 7 00:30:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 00:30:30 +0100 (CET) Subject: [Python-checkins] r68366 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090106233030.798C41E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 00:30:30 2009 New Revision: 68366 Log: Really protected Buffered_seek :) Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Wed Jan 7 00:30:30 2009 @@ -682,6 +682,8 @@ } /* TODO: sanity check whence value */ + ENTER_BUFFERED(self) + if (whence != 2 && self->readable) { /* Check if seeking leaves us inside the current buffer, so as to return quickly if possible. @@ -723,6 +725,7 @@ _BufferedReader_reset_buf(self); end: + LEAVE_BUFFERED(self) return res; } From python-checkins at python.org Wed Jan 7 00:48:08 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 00:48:08 +0100 (CET) Subject: [Python-checkins] r68367 - sandbox/trunk/io-c/_textio.c Message-ID: <20090106234808.8FA9C1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 00:48:08 2009 New Revision: 68367 Log: Add a deallocator to TextIOWrapper and make it call the close() method. Fixes test_distutils. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Wed Jan 7 00:48:08 2009 @@ -546,6 +546,39 @@ return -1; } +static void +TextIOWrapper_dealloc(PyTextIOWrapperObject *self) +{ + PyObject *res; + /* XXX this is inelegant */ + if (Py_TYPE(self)->tp_del == NULL) { + /* We need to resurrect the object as calling close() can invoke + arbitrary code. */ + ((PyObject *) self)->ob_refcnt++; + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, + NULL); + if (res == NULL) { + /* XXX dump exception on terminal? + But IOBase.__del__ prefers to remain silent... */ + PyErr_Clear(); + } + Py_XDECREF(res); + if (--((PyObject *) self)->ob_refcnt != 0) + return; + } + Py_CLEAR(self->buffer); + Py_CLEAR(self->encoding); + Py_CLEAR(self->encoder); + Py_CLEAR(self->decoder); + Py_CLEAR(self->readnl); + Py_CLEAR(self->decoded_chars); + Py_CLEAR(self->snapshot); + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *)self); + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *)self); +} + Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) { @@ -1548,7 +1581,7 @@ "TextIOWrapper", /*tp_name*/ sizeof(PyTextIOWrapperObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ - 0, /*tp_dealloc*/ + (destructor)TextIOWrapper_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ From python-checkins at python.org Wed Jan 7 00:56:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 7 Jan 2009 00:56:10 +0100 (CET) Subject: [Python-checkins] r68368 - sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Message-ID: <20090106235610.D0C381E4002@bag.python.org> Author: benjamin.peterson Date: Wed Jan 7 00:56:10 2009 New Revision: 68368 Log: fix typo (thanks to Robert Lehmann) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Wed Jan 7 00:56:10 2009 @@ -15,7 +15,7 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname', 'splitattr', + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', 'splithost', 'splitnport', 'splitpasswd', 'splitport', 'splitquery', 'splittag', 'splittype', 'splituser', 'splitvalue', ]), From python-checkins at python.org Wed Jan 7 00:58:38 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 00:58:38 +0100 (CET) Subject: [Python-checkins] r68369 - sandbox/trunk/io-c/test_io.py Message-ID: <20090106235838.9AAC01E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 00:58:38 2009 New Revision: 68369 Log: Add tests for the destructor behaviour of TextIOWrapper Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Wed Jan 7 00:58:38 2009 @@ -1257,6 +1257,40 @@ finally: os.linesep = save_linesep + def testDestructor(self): + l = [] + class MyBytesIO(io.BytesIO): + def close(self): + l.append(self.getvalue()) + io.BytesIO.close(self) + b = MyBytesIO() + t = io.TextIOWrapper(b, encoding="ascii") + t.write("abc") + del t + self.assertEquals([b"abc"], l) + + def testOverrideDestructor(self): + record = [] + class MyTextIO(io.TextIOWrapper): + def __del__(self): + record.append(1) + try: + f = io.TextIOWrapper.__del__ + except AttributeError: + pass + else: + f(self) + def close(self): + record.append(2) + io.TextIOWrapper.close(self) + def flush(self): + record.append(3) + io.TextIOWrapper.flush(self) + b = io.BytesIO() + t = MyTextIO(b, encoding="ascii") + del t + self.assertEqual(record, [1, 2, 3]) + # Systematic tests of the text I/O API def testBasicIO(self): From python-checkins at python.org Wed Jan 7 01:08:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 01:08:45 +0100 (CET) Subject: [Python-checkins] r68370 - sandbox/trunk/io-c/io.py Message-ID: <20090107000845.67C9E1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 01:08:45 2009 New Revision: 68370 Log: Alias _BytesIO to BytesIO and _StringIO to StringIO. Modified: sandbox/trunk/io-c/io.py Modified: sandbox/trunk/io-c/io.py ============================================================================== --- sandbox/trunk/io-c/io.py (original) +++ sandbox/trunk/io-c/io.py Wed Jan 7 01:08:45 2009 @@ -2152,3 +2152,7 @@ except ImportError: StringIO = _StringIO + +# make test_memoryio happy! +_BytesIO = BytesIO +_StringIO = StringIO From python-checkins at python.org Wed Jan 7 01:20:04 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 01:20:04 +0100 (CET) Subject: [Python-checkins] r68371 - sandbox/trunk/io-c/_iobase.c Message-ID: <20090107002004.70D4E1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 01:20:04 2009 New Revision: 68371 Log: accept None as explicit parameter to IOBase.readlines(), which fixes the remaining failures in test_memoryio Modified: sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Wed Jan 7 01:20:04 2009 @@ -425,11 +425,16 @@ IOBase_readlines(PyObject *self, PyObject *args) { Py_ssize_t hint = -1, length = 0; - PyObject *line, *result; + PyObject *hintobj = Py_None, *line, *result; - if (!PyArg_ParseTuple(args, "|n:readlines", &hint)) { + if (!PyArg_ParseTuple(args, "|O:readlines", &hintobj)) { return NULL; } + if (hintobj != Py_None) { + hint = PyNumber_AsSsize_t(hintobj, PyExc_ValueError); + if (hint == -1 && PyErr_Occurred()) + return NULL; + } result = PyList_New(0); if (result == NULL) From buildbot at python.org Wed Jan 7 01:28:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 00:28:16 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090107002816.D3E5F1E4002@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/27 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: antoine.pitrou BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Wed Jan 7 02:03:52 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 02:03:52 +0100 (CET) Subject: [Python-checkins] r68372 - in sandbox/trunk/io-c: _bufferedio.c _iobase.c test_io.py Message-ID: <20090107010352.E4D2F1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 02:03:52 2009 New Revision: 68372 Log: Ensure we can't use a closed file as a context manager. This fixes one test in test_tempfile. Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iobase.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Wed Jan 7 02:03:52 2009 @@ -333,22 +333,36 @@ static PyObject * BufferedIOMixin_close(BufferedObject *self, PyObject *args) { - PyObject *res; + PyObject *res = NULL; + int r; CHECK_INITIALIZED(self) - if (BufferedIOMixin_closed(self)) - Py_RETURN_NONE; + ENTER_BUFFERED(self) + r = BufferedIOMixin_closed(self); + if (r < 0) + goto end; + if (r > 0) { + res = Py_None; + Py_INCREF(res); + goto end; + } + /* flush() will most probably re-take the lock, so drop it first */ + LEAVE_BUFFERED(self) res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + ENTER_BUFFERED(self) if (res == NULL) { /* If flush() fails, just give up */ if (PyErr_ExceptionMatches(PyExc_IOError)) PyErr_Clear(); else - return NULL; + goto end; } + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL); - return PyObject_CallMethod(self->raw, "close", NULL); +end: + LEAVE_BUFFERED(self) + return res; } /* Inquiries */ Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Wed Jan 7 02:03:52 2009 @@ -36,6 +36,13 @@ "with open('spam.txt', 'r') as fp:\n" " fp.write('Spam and eggs!')\n"); +/* Use this macro whenever you want to check the internal `closed` status + of the IOBase object rather than the virtual `closed` attribute as returned + by whatever subclass. */ + +#define IS_CLOSED(self) \ + PyObject_HasAttrString(self, "__IOBase_closed") + /* Internal methods */ static PyObject * IOBase_unsupported(const char *message) @@ -108,13 +115,20 @@ static int IOBase_closed(PyObject *self) { - return PyObject_HasAttrString(self, "__IOBase_closed"); + PyObject *res; + int closed; + /* This gets the derived attribute, which is *not* __IOBase_closed + in most cases! */ + res = PyObject_GetAttr(self, _PyIO_str_closed); + closed = PyObject_IsTrue(res); + Py_DECREF(res); + return closed; } static PyObject * IOBase_closed_get(PyObject *self, void *context) { - return PyBool_FromLong(IOBase_closed(self)); + return PyBool_FromLong(IS_CLOSED(self)); } @@ -128,17 +142,20 @@ Py_RETURN_NONE; } +/* XXX: IOBase thinks it has to maintain its own internal state in + `__IOBase_closed` and call flush() by itself, but it is redundant with + whatever behaviour a non-trivial derived class will implement. */ + static PyObject * IOBase_close(PyObject *self, PyObject *args) { PyObject *res; - if (IOBase_closed(self)) + if (IS_CLOSED(self)) Py_RETURN_NONE; - PyObject_SetAttrString(self, "__IOBase_closed", Py_True); - res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL); + PyObject_SetAttrString(self, "__IOBase_closed", Py_True); if (res == NULL) { /* If flush() fails, just give up */ if (PyErr_ExceptionMatches(PyExc_IOError)) Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Wed Jan 7 02:03:52 2009 @@ -450,6 +450,18 @@ self.assertEqual(record, [1, 2, 3]) else: self.assertEqual(record, [1, 2]) + + def testContext(self): + # Test usability as a context manager + rawio = MockRawIO() + bufio = self.tp(rawio) + def _with(): + with bufio: + pass + _with() + # bufio should now be closed, and using it a second time should raise + # a ValueError. + self.assertRaises(ValueError, _with) class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): tp = io.BufferedReader From nnorwitz at gmail.com Wed Jan 7 10:08:36 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 7 Jan 2009 04:08:36 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090107090836.GA9905@python.psfb.org> 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_urllib2 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/tmp/python-test/local/lib/python2.7/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known 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 328 tests OK. 1 test failed: test_urllib2 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [656152 refs] From python-checkins at python.org Wed Jan 7 10:42:28 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 7 Jan 2009 10:42:28 +0100 (CET) Subject: [Python-checkins] r68373 - python/trunk/Lib/distutils/tests/test_msvc9compiler.py Message-ID: <20090107094228.A91661E4002@bag.python.org> Author: hirokazu.yamamoto Date: Wed Jan 7 10:42:28 2009 New Revision: 68373 Log: Issue #4864: test_msvc9compiler failed on VC6/7. Reviewed by Amaury Forgeot d'Arc. Modified: python/trunk/Lib/distutils/tests/test_msvc9compiler.py Modified: python/trunk/Lib/distutils/tests/test_msvc9compiler.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_msvc9compiler.py (original) +++ python/trunk/Lib/distutils/tests/test_msvc9compiler.py Wed Jan 7 10:42:28 2009 @@ -13,6 +13,10 @@ if sys.platform != 'win32': # this test is only for win32 return + from distutils.msvccompiler import get_build_version + if get_build_version() < 8.0: + # this test is only for MSVC8.0 or above + return from distutils.msvc9compiler import query_vcvarsall def _find_vcvarsall(version): return None From python-checkins at python.org Wed Jan 7 10:53:36 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 7 Jan 2009 10:53:36 +0100 (CET) Subject: [Python-checkins] r68374 - in python/branches/release26-maint: Lib/distutils/tests/test_msvc9compiler.py Message-ID: <20090107095336.36C8B1E4023@bag.python.org> Author: hirokazu.yamamoto Date: Wed Jan 7 10:53:35 2009 New Revision: 68374 Log: Merged revisions 68373 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68373 | hirokazu.yamamoto | 2009-01-07 18:42:28 +0900 | 2 lines Issue #4864: test_msvc9compiler failed on VC6/7. Reviewed by Amaury Forgeot d'Arc. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_msvc9compiler.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_msvc9compiler.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_msvc9compiler.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_msvc9compiler.py Wed Jan 7 10:53:35 2009 @@ -13,6 +13,10 @@ if sys.platform != 'win32': # this test is only for win32 return + from distutils.msvccompiler import get_build_version + if get_build_version() < 8.0: + # this test is only for MSVC8.0 or above + return from distutils.msvc9compiler import query_vcvarsall def _find_vcvarsall(version): return None From python-checkins at python.org Wed Jan 7 11:11:18 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 7 Jan 2009 11:11:18 +0100 (CET) Subject: [Python-checkins] r68375 - in python/branches/py3k: Lib/distutils/tests/test_msvc9compiler.py Message-ID: <20090107101118.0558F1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Wed Jan 7 11:11:17 2009 New Revision: 68375 Log: Merged revisions 68373 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68373 | hirokazu.yamamoto | 2009-01-07 18:42:28 +0900 | 2 lines Issue #4864: test_msvc9compiler failed on VC6/7. Reviewed by Amaury Forgeot d'Arc. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py Modified: python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py Wed Jan 7 11:11:17 2009 @@ -13,6 +13,10 @@ if sys.platform != 'win32': # this test is only for win32 return + from distutils.msvccompiler import get_build_version + if get_build_version() < 8.0: + # this test is only for MSVC8.0 or above + return from distutils.msvc9compiler import query_vcvarsall def _find_vcvarsall(version): return None From python-checkins at python.org Wed Jan 7 11:31:11 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 7 Jan 2009 11:31:11 +0100 (CET) Subject: [Python-checkins] r68376 - in python/branches/release30-maint: Lib/distutils/tests/test_msvc9compiler.py Message-ID: <20090107103111.5264B1E400C@bag.python.org> Author: hirokazu.yamamoto Date: Wed Jan 7 11:31:11 2009 New Revision: 68376 Log: Merged revisions 68375 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68375 | hirokazu.yamamoto | 2009-01-07 19:11:17 +0900 | 10 lines Merged revisions 68373 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68373 | hirokazu.yamamoto | 2009-01-07 18:42:28 +0900 | 2 lines Issue #4864: test_msvc9compiler failed on VC6/7. Reviewed by Amaury Forgeot d'Arc. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/tests/test_msvc9compiler.py Modified: python/branches/release30-maint/Lib/distutils/tests/test_msvc9compiler.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_msvc9compiler.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_msvc9compiler.py Wed Jan 7 11:31:11 2009 @@ -13,6 +13,10 @@ if sys.platform != 'win32': # this test is only for win32 return + from distutils.msvccompiler import get_build_version + if get_build_version() < 8.0: + # this test is only for MSVC8.0 or above + return from distutils.msvc9compiler import query_vcvarsall def _find_vcvarsall(version): return None From buildbot at python.org Wed Jan 7 11:33:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 10:33:25 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090107103325.3777B1E4002@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/34 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: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 ====================================================================== ERROR: test_file (test.test_urllib2.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 7 12:38:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 11:38:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090107113819.328A91E4002@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/36 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_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 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' sincerely, -The Buildbot From python-checkins at python.org Wed Jan 7 16:03:16 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 16:03:16 +0100 (CET) Subject: [Python-checkins] r68377 - sandbox/trunk/iobench/iobench.py Message-ID: <20090107150316.36A0A1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 16:03:14 2009 New Revision: 68377 Log: Add an option to run text IO tests with a different encoding than utf8 Modified: sandbox/trunk/iobench/iobench.py Modified: sandbox/trunk/iobench/iobench.py ============================================================================== --- sandbox/trunk/iobench/iobench.py (original) +++ sandbox/trunk/iobench/iobench.py Wed Jan 7 16:03:14 2009 @@ -11,6 +11,7 @@ out = sys.stdout +TEXT_ENCODING = 'utf8' # Compatibility try: @@ -18,9 +19,9 @@ except NameError: xrange = range -def text_open(fn, mode): +def text_open(fn, mode, encoding=None): try: - return open(fn, mode, encoding="utf-8") + return open(fn, mode, encoding=encoding or TEXT_ENCODING) except TypeError: return open(fn, mode) @@ -30,6 +31,13 @@ size = int(size) * {'KB': 1024, 'MB': 1024 ** 2}[unit] yield s.replace(' ', ''), size +def get_binary_files(): + return ((name + ".bin", size) for name, size in get_file_sizes()) + +def get_text_files(): + return ((name + "-" + TEXT_ENCODING + ".txt", size) + for name, size in get_file_sizes()) + def with_open_mode(mode): def decorate(f): f.file_open_mode = mode @@ -88,7 +96,7 @@ @with_open_mode("r") @with_sizes("medium") def seek_forward_bytewise(f): - """ seek forward one byte at a time """ + """ seek forward one unit at a time """ f.seek(0, 2) size = f.tell() f.seek(0, 0) @@ -98,7 +106,7 @@ @with_open_mode("r") @with_sizes("medium") def seek_forward_blockwise(f): - """ seek forward 1000 bytes at a time """ + """ seek forward 1000 units at a time """ f.seek(0, 2) size = f.tell() f.seek(0, 0) @@ -252,10 +260,11 @@ def run_all_tests(options): - def print_label(name, func): + def print_label(filename, func): + name = re.split(r'[-.]', filename)[0] out.write( ("[%s] %s... " - % (name.center(9), func.__doc__.strip()) + % (name.center(7), func.__doc__.strip()) ).ljust(52)) out.flush() @@ -276,7 +285,7 @@ n, real, cpu = run_during(1.5, lambda: test_func(f, *args)) print_results(size, n, real, cpu) - def run_test_family(tests, mode_filter, file_ext, open_func, *make_args): + def run_test_family(tests, mode_filter, files, open_func, *make_args): for test_func in tests: if test_func is None: out.write("\n") @@ -284,8 +293,8 @@ if mode_filter in test_func.file_open_mode: continue for s in test_func.file_sizes: - name, size = file_sizes[size_names[s]] - name += file_ext + name, size = files[size_names[s]] + #name += file_ext args = tuple(f(name, size) for f in make_args) run_one_test(name, size, open_func, test_func, *args) @@ -295,21 +304,23 @@ "medium": 1, "large": 2, } - file_sizes = list(get_file_sizes()) + binary_files = list(get_binary_files()) + text_files = list(get_text_files()) if "b" in options: print("Binary unit = one byte") if "t" in options: - print("Text unit = one character") + print("Text unit = one character (%s-decoded)" % TEXT_ENCODING) + # Binary reads if "b" in options and "r" in options: print("\n** Binary input **\n") - run_test_family(read_tests, "t", ".bin", lambda fn: open(fn, "rb")) + run_test_family(read_tests, "t", binary_files, lambda fn: open(fn, "rb")) # Text reads if "t" in options and "r" in options: print("\n** Text input **\n") - run_test_family(read_tests, "b", ".txt", lambda fn: text_open(fn, "r")) + run_test_family(read_tests, "b", text_files, lambda fn: text_open(fn, "r")) # Binary writes if "b" in options and "w" in options: @@ -317,7 +328,7 @@ def make_test_source(name, size): with open(name, "rb") as f: return f.read() - run_test_family(write_tests, "t", ".bin", + run_test_family(write_tests, "t", binary_files, lambda fn: open(os.devnull, "wb"), make_test_source) # Text writes @@ -326,7 +337,7 @@ def make_test_source(name, size): with text_open(name, "r") as f: return f.read() - run_test_family(write_tests, "b", ".txt", + run_test_family(write_tests, "b", text_files, lambda fn: text_open(os.devnull, "w"), make_test_source) # Binary overwrites @@ -335,7 +346,7 @@ def make_test_source(name, size): with open(name, "rb") as f: return f.read() - run_test_family(modify_tests, "t", ".bin", + run_test_family(modify_tests, "t", binary_files, lambda fn: open(fn, "r+b"), make_test_source) # Text overwrites @@ -344,22 +355,21 @@ def make_test_source(name, size): with text_open(name, "r") as f: return f.read() - run_test_family(modify_tests, "b", ".txt", + run_test_family(modify_tests, "b", text_files, lambda fn: open(fn, "r+"), make_test_source) def prepare_files(): print("Preparing files...") # Binary files - for name, size in get_file_sizes(): - name += ".bin" + for name, size in get_binary_files(): if os.path.isfile(name) and os.path.getsize(name) == size: continue with open(name, "wb") as f: f.write(os.urandom(size)) # Text files chunk = [] - with text_open(__file__, "r") as f: + with text_open(__file__, "r", encoding='utf8') as f: for line in f: if line.startswith("# "): break @@ -367,16 +377,10 @@ raise RuntimeError( "Couldn't find chunk marker in %s !" % __file__) chunk = "".join(f) - if not isinstance(chunk, bytes): - chunk = chunk.encode('utf-8') - h = hashlib.sha1(chunk).hexdigest() - expected = "6a8b36cf5e86905965d3bd0e67bd647c92eaa285" - if h != expected: - raise RuntimeError( - "Wrong hash for text content, expected %s, got %s" - % (expected, h)) - for name, size in get_file_sizes(): - name += ".txt" + if isinstance(chunk, bytes): + chunk = chunk.decode('utf8') + chunk = chunk.encode(TEXT_ENCODING) + for name, size in get_text_files(): if os.path.isfile(name) and os.path.getsize(name) == size: continue head = chunk * (size // len(chunk)) @@ -384,7 +388,7 @@ # Adjust tail to end on a character boundary while True: try: - tail.decode('utf-8') + tail.decode(TEXT_ENCODING) break except UnicodeDecodeError: tail = tail[:-1] @@ -393,6 +397,8 @@ f.write(tail) def main(): + global TEXT_ENCODING + usage = "usage: %prog [-h|--help] [options]" parser = OptionParser(usage=usage) parser.add_option("-b", "--binary", @@ -407,10 +413,13 @@ parser.add_option("-w", "--write", action="store_true", dest="write", default=False, help="run write & modify tests") + parser.add_option("-E", "--encoding", + action="store", dest="encoding", default=None, + help="encoding for text tests (default: %s)" % TEXT_ENCODING) options, args = parser.parse_args() if args: parser.error("unexpected arguments") - + test_options = "" if options.read: test_options += "r" @@ -425,6 +434,9 @@ elif not options.text: test_options += "tb" + if options.encoding: + TEXT_ENCODING = options.encoding + prepare_files() run_all_tests(test_options) From python-checkins at python.org Wed Jan 7 18:48:33 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 7 Jan 2009 18:48:33 +0100 (CET) Subject: [Python-checkins] r68378 - in python/trunk: Doc/library/random.rst Lib/random.py Message-ID: <20090107174833.9CCA91E4002@bag.python.org> Author: mark.dickinson Date: Wed Jan 7 18:48:33 2009 New Revision: 68378 Log: Issue #4869: clarify documentation for random.expovariate. Modified: python/trunk/Doc/library/random.rst python/trunk/Lib/random.py Modified: python/trunk/Doc/library/random.rst ============================================================================== --- python/trunk/Doc/library/random.rst (original) +++ python/trunk/Doc/library/random.rst Wed Jan 7 18:48:33 2009 @@ -210,9 +210,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) Modified: python/trunk/Lib/random.py ============================================================================== --- python/trunk/Lib/random.py (original) +++ python/trunk/Lib/random.py Wed Jan 7 18:48:33 2009 @@ -413,9 +413,11 @@ def expovariate(self, 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. + 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. """ # lambd: rate lambd = 1/mean From python-checkins at python.org Wed Jan 7 18:54:08 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 7 Jan 2009 18:54:08 +0100 (CET) Subject: [Python-checkins] r68379 - in python/branches/py3k: Doc/library/random.rst Lib/random.py Message-ID: <20090107175408.38FC11E4014@bag.python.org> Author: mark.dickinson Date: Wed Jan 7 18:54:07 2009 New Revision: 68379 Log: Merged revisions 68378 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68378 | mark.dickinson | 2009-01-07 17:48:33 +0000 (Wed, 07 Jan 2009) | 2 lines Issue #4869: clarify documentation for random.expovariate. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/random.rst python/branches/py3k/Lib/random.py Modified: python/branches/py3k/Doc/library/random.rst ============================================================================== --- python/branches/py3k/Doc/library/random.rst (original) +++ python/branches/py3k/Doc/library/random.rst Wed Jan 7 18:54:07 2009 @@ -169,9 +169,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) Modified: python/branches/py3k/Lib/random.py ============================================================================== --- python/branches/py3k/Lib/random.py (original) +++ python/branches/py3k/Lib/random.py Wed Jan 7 18:54:07 2009 @@ -396,9 +396,11 @@ def expovariate(self, 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. + 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. """ # lambd: rate lambd = 1/mean From python-checkins at python.org Wed Jan 7 18:56:18 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 7 Jan 2009 18:56:18 +0100 (CET) Subject: [Python-checkins] r68380 - sandbox/trunk/iobench/iobench.py Message-ID: <20090107175618.71BF41E4024@bag.python.org> Author: antoine.pitrou Date: Wed Jan 7 18:56:17 2009 New Revision: 68380 Log: Sprinkle some non-UNIX newlines in text test files to exercise newline translation. Modified: sandbox/trunk/iobench/iobench.py Modified: sandbox/trunk/iobench/iobench.py ============================================================================== --- sandbox/trunk/iobench/iobench.py (original) +++ sandbox/trunk/iobench/iobench.py Wed Jan 7 18:56:17 2009 @@ -7,6 +7,7 @@ import sys import hashlib import functools +import itertools from optparse import OptionParser out = sys.stdout @@ -369,14 +370,16 @@ f.write(os.urandom(size)) # Text files chunk = [] - with text_open(__file__, "r", encoding='utf8') as f: + with text_open(__file__, "rU", encoding='utf8') as f: for line in f: if line.startswith("# "): break else: raise RuntimeError( "Couldn't find chunk marker in %s !" % __file__) - chunk = "".join(f) + # Change some newlines to exercise newlines translation (in 3.x) + newlines = itertools.cycle(["\n", "\r", "\r\n"]) + chunk = "".join(line.replace("\n", next(newlines)) for line in f) if isinstance(chunk, bytes): chunk = chunk.decode('utf8') chunk = chunk.encode(TEXT_ENCODING) From buildbot at python.org Wed Jan 7 19:13:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 18:13:35 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090107181335.BFA911E4002@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/4433 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 ====================================================================== ERROR: test_file (test.test_urllib2.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_urllib2.py", line 653, in test_file h.file_open, Request(url)) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/urllib2.py", line 1226, in file_open return self.open_local_file(req) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/urllib2.py", line 1257, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -2] Name or service not known make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 7 19:40:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 18:40:01 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090107184001.EF94D1E4002@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/72 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 7 19:40:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 18:40:37 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090107184038.144411E400C@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/85 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 Wed Jan 7 19:40:40 2009 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 7 Jan 2009 19:40:40 +0100 (CET) Subject: [Python-checkins] r68381 - in python/trunk: Misc/NEWS Objects/intobject.c Objects/object.c Objects/stringobject.c Objects/tupleobject.c Message-ID: <20090107184040.84BBA1E401F@bag.python.org> Author: martin.v.loewis Date: Wed Jan 7 19:40:40 2009 New Revision: 68381 Log: Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. Modified: python/trunk/Misc/NEWS python/trunk/Objects/intobject.c python/trunk/Objects/object.c python/trunk/Objects/stringobject.c python/trunk/Objects/tupleobject.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 7 19:40:40 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. + - Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the Modified: python/trunk/Objects/intobject.c ============================================================================== --- python/trunk/Objects/intobject.c (original) +++ python/trunk/Objects/intobject.c Wed Jan 7 19:40:40 2009 @@ -78,7 +78,8 @@ static PyIntObject *small_ints[NSMALLNEGINTS + NSMALLPOSINTS]; #endif #ifdef COUNT_ALLOCS -int quick_int_allocs, quick_neg_int_allocs; +Py_ssize_t quick_int_allocs; +Py_ssize_t quick_neg_int_allocs; #endif PyObject * Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Wed Jan 7 19:40:40 2009 @@ -81,24 +81,29 @@ garbage itself. If unlist_types_without_objects is set, they will be removed from the type_list once the last object is deallocated. */ -int unlist_types_without_objects; -extern int tuple_zero_allocs, fast_tuple_allocs; -extern int quick_int_allocs, quick_neg_int_allocs; -extern int null_strings, one_strings; +static int unlist_types_without_objects; +extern Py_ssize_t tuple_zero_allocs, fast_tuple_allocs; +extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs; +extern Py_ssize_t null_strings, one_strings; void dump_counts(FILE* f) { PyTypeObject *tp; for (tp = type_list; tp; tp = tp->tp_next) - fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n", + fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, " + "freed: %" PY_FORMAT_SIZE_T "d, " + "max in use: %" PY_FORMAT_SIZE_T "d\n", tp->tp_name, tp->tp_allocs, tp->tp_frees, tp->tp_maxalloc); - fprintf(f, "fast tuple allocs: %d, empty: %d\n", + fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, " + "empty: %" PY_FORMAT_SIZE_T "d\n", fast_tuple_allocs, tuple_zero_allocs); - fprintf(f, "fast int allocs: pos: %d, neg: %d\n", + fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, " + "neg: %" PY_FORMAT_SIZE_T "d\n", quick_int_allocs, quick_neg_int_allocs); - fprintf(f, "null strings: %d, 1-strings: %d\n", + fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, " + "1-strings: %" PY_FORMAT_SIZE_T "d\n", null_strings, one_strings); } Modified: python/trunk/Objects/stringobject.c ============================================================================== --- python/trunk/Objects/stringobject.c (original) +++ python/trunk/Objects/stringobject.c Wed Jan 7 19:40:40 2009 @@ -7,7 +7,7 @@ #include #ifdef COUNT_ALLOCS -int null_strings, one_strings; +Py_ssize_t null_strings, one_strings; #endif static PyStringObject *characters[UCHAR_MAX + 1]; Modified: python/trunk/Objects/tupleobject.c ============================================================================== --- python/trunk/Objects/tupleobject.c (original) +++ python/trunk/Objects/tupleobject.c Wed Jan 7 19:40:40 2009 @@ -19,8 +19,8 @@ static int numfree[PyTuple_MAXSAVESIZE]; #endif #ifdef COUNT_ALLOCS -int fast_tuple_allocs; -int tuple_zero_allocs; +Py_ssize_t fast_tuple_allocs; +Py_ssize_t tuple_zero_allocs; #endif PyObject * From buildbot at python.org Wed Jan 7 20:08:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 07 Jan 2009 19:08:34 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090107190834.DD7DD1E4002@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/489 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_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 8 00:31:02 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 00:31:02 +0100 (CET) Subject: [Python-checkins] r68385 - sandbox/trunk/io-c/_textio.c Message-ID: <20090107233102.35CF11E402C@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 00:31:01 2009 New Revision: 68385 Log: Make newline translation much faster. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 00:31:01 2009 @@ -103,7 +103,7 @@ char *kwlist[] = {"input", "final", NULL}; PyObject *input, *output; int final = 0; - Py_ssize_t cr=0, lf=0, crlf=0; + Py_ssize_t output_len; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i:IncrementalNewlineDecoder", kwlist, &input, &final)) @@ -126,102 +126,125 @@ goto error; } - if (self->pendingcr && (final || PyUnicode_GET_SIZE(output) > 0)) { - PyObject *modified; - - modified = PyUnicode_FromOrdinal('\r'); + output_len = PyUnicode_GET_SIZE(output); + if (self->pendingcr && (final || output_len > 0)) { + Py_UNICODE *out; + PyObject *modified = PyUnicode_FromUnicode(NULL, output_len + 1); if (modified == NULL) goto error; - - PyUnicode_Append(&modified, output); - if (modified == NULL) - goto error; - + out = PyUnicode_AS_UNICODE(modified); + out[0] = '\r'; + memcpy(out + 1, PyUnicode_AS_UNICODE(output), + output_len * sizeof(Py_UNICODE)); Py_DECREF(output); output = modified; self->pendingcr = 0; + output_len++; } /* retain last \r even when not translating data: * then readline() is sure to get \r\n in one pass */ if (!final) { - Py_ssize_t output_len = PyUnicode_GET_SIZE(output); - if (output_len > 0 && PyUnicode_AS_UNICODE(output)[output_len - 1] == '\r') { - PyObject *modified = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(output), - output_len - 1); - if (modified == NULL) - goto error; - - Py_DECREF(output); - output = modified; + if (Py_REFCNT(output) == 1) { + if (PyUnicode_Resize(&output, output_len - 1) < 0) + goto error; + } + else { + PyObject *modified = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(output), + output_len - 1); + if (modified == NULL) + goto error; + Py_DECREF(output); + output = modified; + } self->pendingcr = 1; } - } - /* Record which newlines are read */ + /* Record which newlines are read and do newline translation if desired, + all in one pass. */ { - Py_UNICODE c; - Py_ssize_t index, previous; - int pendingcr = 0; - - previous = '\0'; - - for(index = 0; index < PyUnicode_GET_SIZE(output); index++) { - c = PyUnicode_AS_UNICODE(output)[index]; - - switch (c) { - case '\r': - cr++; - pendingcr = 1; - break; - - case '\n': - if (pendingcr) { - cr--; - crlf++; - pendingcr = 0; + Py_UNICODE *in_str; + Py_ssize_t in, len; + int seennl = 0; + + in_str = PyUnicode_AS_UNICODE(output); + len = PyUnicode_GET_SIZE(output); + if (!self->translate) { + for (in = 0; in < len;) { + Py_UNICODE c = in_str[in++]; + if (c >= 0x20) + continue; + if (c == '\n') + seennl |= SEEN_LF; + else if (c == '\r') { + if (in_str[in] == '\n') { + seennl |= SEEN_CRLF; + in++; + } + else + seennl |= SEEN_CR; } - else - lf++; - break; - - default: - pendingcr = 0; - break; } } - - if (cr) - self->seennl |= SEEN_CR; - if (lf) - self->seennl |= SEEN_LF; - if (crlf) - self->seennl |= SEEN_CRLF; - } - - if (self->translate) { - PyObject *modified; - - if (crlf) { - modified = PyObject_CallMethod(output, "replace", "ss", "\r\n", "\n"); - if (modified == NULL) - goto error; - Py_DECREF(output); - output = modified; - } - if (cr) { - modified = PyObject_CallMethod(output, "replace", "ss", "\r", "\n"); - if (modified == NULL) - goto error; - Py_DECREF(output); - output = modified; + else { + PyObject *translated = NULL; + Py_UNICODE *out_str; + Py_ssize_t out; + if (Py_REFCNT(output) != 1 || len < 2) { + /* We could try to optimize this so that we only do a copy + when there is something to translate. On the other hand, + most decoders should only output non-shared strings, i.e. + translation is done in place. */ + translated = PyUnicode_FromUnicode(NULL, len); + if (translated == NULL) + goto error; + memcpy(PyUnicode_AS_UNICODE(translated), + PyUnicode_AS_UNICODE(output), + len * sizeof(Py_UNICODE)); + } + else { + translated = output; + } + out_str = PyUnicode_AS_UNICODE(translated); + for (in = 0, out = 0; in < len;) { + Py_UNICODE c = in_str[in++]; + if (c >= 0x20) { + out_str[out++] = c; + continue; + } + if (c == '\n') { + out_str[out++] = c; + seennl |= SEEN_LF; + continue; + } + if (c != '\r') { + out_str[out++] = c; + continue; + } + if (in_str[in] == '\n') { + in++; + seennl |= SEEN_CRLF; + } + else + seennl |= SEEN_CR; + out_str[out++] = '\n'; + } + if (translated != output) { + Py_DECREF(output); + output = translated; + } + if (out != in) { + if (PyUnicode_Resize(&output, out) < 0) + goto error; + } } + self->seennl |= seennl; } return output; From python-checkins at python.org Thu Jan 8 00:40:51 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 00:40:51 +0100 (CET) Subject: [Python-checkins] r68386 - in sandbox/trunk/io-c: _iomodule.h _textio.c io.c Message-ID: <20090107234051.D8B7D1E4024@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 00:40:51 2009 New Revision: 68386 Log: Intern some more method names. Modified: sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/io.c Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Thu Jan 8 00:40:51 2009 @@ -52,8 +52,11 @@ 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_read; extern PyObject *_PyIO_str_readable; Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 00:40:51 2009 @@ -116,7 +116,8 @@ } /* decode input (with the eventual \r from a previous pass) */ - output = PyObject_CallMethod(self->decoder, "decode", "Oi", input, final); + output = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, + input, final ? Py_True : Py_False, NULL); if (output == NULL) return NULL; @@ -257,7 +258,8 @@ static PyObject * IncrementalNewlineDecoder_getstate(PyNewLineDecoderObject *self, PyObject *args) { - PyObject *state = PyObject_CallMethod(self->decoder, "getstate", NULL); + PyObject *state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); PyObject *buffer; unsigned PY_LONG_LONG flag; @@ -771,7 +773,8 @@ * where the decoder's input buffer is empty. */ - PyObject *state = PyObject_CallMethod(self->decoder, "getstate", NULL); + PyObject *state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); if (state == NULL) return -1; /* Given this, we know there was a valid snapshot point @@ -1372,7 +1375,8 @@ /* Starting from the snapshot position, we will walk the decoder * forward until it gives us enough decoded characters. */ - saved_state = PyObject_CallMethod(self->decoder, "getstate", NULL); + saved_state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); if (saved_state == NULL) goto fail; @@ -1407,7 +1411,8 @@ cookie.bytes_to_feed += 1; - state = PyObject_CallMethod(self->decoder, "getstate", NULL); + state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); if (state == NULL) goto fail; if (!PyArg_Parse(state, "(y#i)", &dec_buffer, &dec_buffer_len, &dec_flags)) { Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Thu Jan 8 00:40:51 2009 @@ -16,8 +16,11 @@ 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_read; PyObject *_PyIO_str_readable; @@ -629,10 +632,16 @@ goto fail; if (!(_PyIO_str_closed = PyUnicode_InternFromString("closed"))) goto fail; + if (!(_PyIO_str_decode = PyUnicode_InternFromString("decode"))) + goto fail; + if (!(_PyIO_str_encode = PyUnicode_InternFromString("encode"))) + goto fail; if (!(_PyIO_str_fileno = PyUnicode_InternFromString("fileno"))) goto fail; if (!(_PyIO_str_flush = PyUnicode_InternFromString("flush"))) goto fail; + if (!(_PyIO_str_getstate = PyUnicode_InternFromString("getstate"))) + goto fail; if (!(_PyIO_str_isatty = PyUnicode_InternFromString("isatty"))) goto fail; if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) From python-checkins at python.org Thu Jan 8 01:13:39 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 01:13:39 +0100 (CET) Subject: [Python-checkins] r68387 - in sandbox/trunk/io-c: _iomodule.h _textio.c io.c Message-ID: <20090108001339.C5F491E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 01:13:39 2009 New Revision: 68387 Log: Add a newlines attribute to TextIOWrapper, so that test_univnewlines isn't skipped (but then there are some failures) Modified: sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/io.c Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Thu Jan 8 01:13:39 2009 @@ -58,6 +58,7 @@ 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_readable; extern PyObject *_PyIO_str_readinto; Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 01:13:39 2009 @@ -1564,7 +1564,21 @@ static PyObject * TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context) { - return PyObject_GetAttrString(self->buffer, "closed"); + return PyObject_GetAttr(self->buffer, _PyIO_str_closed); +} + +static PyObject * +TextIOWrapper_newlines_get(PyTextIOWrapperObject *self, void *context) +{ + PyObject *res; + if (self->decoder == NULL) + Py_RETURN_NONE; + res = PyObject_GetAttr(self->decoder, _PyIO_str_newlines); + if (res == NULL) { + PyErr_Clear(); + Py_RETURN_NONE; + } + return res; } static PyMethodDef TextIOWrapper_methods[] = { @@ -1601,6 +1615,7 @@ {"closed", (getter)TextIOWrapper_closed_get, NULL, NULL}, /* {"mode", (getter)TextIOWrapper_mode_get, NULL, NULL}, */ + {"newlines", (getter)TextIOWrapper_newlines_get, NULL, NULL}, {0} }; Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Thu Jan 8 01:13:39 2009 @@ -22,6 +22,7 @@ PyObject *_PyIO_str_flush; PyObject *_PyIO_str_getstate; PyObject *_PyIO_str_isatty; +PyObject *_PyIO_str_newlines; PyObject *_PyIO_str_read; PyObject *_PyIO_str_readable; PyObject *_PyIO_str_readinto; @@ -644,6 +645,8 @@ goto fail; if (!(_PyIO_str_isatty = PyUnicode_InternFromString("isatty"))) goto fail; + if (!(_PyIO_str_newlines = PyUnicode_InternFromString("newlines"))) + goto fail; if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) goto fail; if (!(_PyIO_str_readable = PyUnicode_InternFromString("readable"))) From benjamin at python.org Thu Jan 8 02:38:26 2009 From: benjamin at python.org (Benjamin Peterson) Date: Wed, 7 Jan 2009 19:38:26 -0600 Subject: [Python-checkins] r68335 - peps/trunk/pep0/pep.py In-Reply-To: <4961D925.6040401@v.loewis.de> References: <20090105013806.C9C651E4002@bag.python.org> <94bdd2610901050132k7db58413j31093d2fc6310a2f@mail.gmail.com> <4961D925.6040401@v.loewis.de> Message-ID: <1afaf6160901071738j46615691u6cbe04547477245c@mail.gmail.com> On Mon, Jan 5, 2009 at 3:55 AM, "Martin v. L?wis" wrote: > Well, collation is a bottomless pit. To start with: how should you > collate non-English letters in an English document? Whether or not > ? collates like o depends on the language - in German, it does > (mostly, sometimes like oe); in Swedish (IIUC), it comes after the > rest of the alphabet. I think the objective is to sort me before > Tony Lownds - which is nice, but I wouldn't complain if it was > otherwise (and also to sort Walter D?rwald before Fred Drake) > > Wrt. your approach: fortunately, Atsuo Ishimoto, Jiwon Seo, Oren Tirosh, > Moshe Zadka, Huaiyu Zhu (and a few other I probably didn't recognize) > don't insist on having their names correctly spelled. Otherwise, > this normalization would give an empty string for them. For the moment, I think I'd like to stick with the current "fix". It's the simplest tool for the job, and I don't really want to dive into the dangerous waters of normalization quite yet. If more cases need to be fixed in the future, I will reconsider. -- Regards, Benjamin From python-checkins at python.org Thu Jan 8 04:39:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 8 Jan 2009 04:39:47 +0100 (CET) Subject: [Python-checkins] r68388 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20090108033947.25D101E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 8 04:39:46 2009 New Revision: 68388 Log: string exceptions are gone 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 Thu Jan 8 04:39:46 2009 @@ -3213,6 +3213,9 @@ set ``__hash__ = None`` in their definitions to indicate the fact. +* String exceptions have been removed. Attempting to use them raises a + :exc:`TypeError`. + * The :meth:`__init__` method of :class:`collections.deque` now clears any existing contents of the deque before adding elements from the iterable. This change makes the From python-checkins at python.org Thu Jan 8 04:44:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 8 Jan 2009 04:44:48 +0100 (CET) Subject: [Python-checkins] r68389 - in peps/trunk: pep-0101.txt pep0/constants.py Message-ID: <20090108034448.8BBBA1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 8 04:44:48 2009 New Revision: 68389 Log: normalize Barry's name Modified: peps/trunk/pep-0101.txt peps/trunk/pep0/constants.py Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Jan 8 04:44:48 2009 @@ -2,7 +2,7 @@ Title: Doing Python Releases 101 Version: $Revision$ Last-Modified: $Date$ -Author: barry at python.org (Barry A. Warsaw), guido at python.org (Guido van Rossum) +Author: barry at python.org (Barry Warsaw), guido at python.org (Guido van Rossum) Status: Active Type: Informational Created: 22-Aug-2001 Modified: peps/trunk/pep0/constants.py ============================================================================== --- peps/trunk/pep0/constants.py (original) +++ peps/trunk/pep0/constants.py Thu Jan 8 04:44:48 2009 @@ -8,7 +8,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: David Goodger , - Barry A. Warsaw + Barry Warsaw Status: Active Type: Informational Created: 13-Jul-2000 From python-checkins at python.org Thu Jan 8 04:49:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 8 Jan 2009 04:49:25 +0100 (CET) Subject: [Python-checkins] r68390 - peps/trunk/pep0/pep.py Message-ID: <20090108034925.559831E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 8 04:49:25 2009 New Revision: 68390 Log: use a more robust form of normalization to make sorting correct Modified: peps/trunk/pep0/pep.py Modified: peps/trunk/pep0/pep.py ============================================================================== --- peps/trunk/pep0/pep.py (original) +++ peps/trunk/pep0/pep.py Thu Jan 8 04:49:25 2009 @@ -2,6 +2,7 @@ """Code for handling object representation of a PEP.""" import re import textwrap +import unicodedata from email.parser import HeaderParser @@ -88,17 +89,14 @@ @property def sort_by(self): - if u' ' not in self.last: - return self.last name_parts = self.last.split() for index, part in enumerate(name_parts): if part[0].isupper(): break else: raise ValueError("last name missing a capital letter") - # This replace() hack is so people with an umlaut will sort in the right - # letter. - return u' '.join(name_parts[index:]).replace(u"?", u"o") + base = u' '.join(name_parts[index:]).lower() + return unicodedata.normalize('NFKD', base).encode('ASCII', 'ignore') def _last_name(self, full_name): """Find the last name (or nickname) of a full name. From python-checkins at python.org Thu Jan 8 04:53:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 8 Jan 2009 04:53:19 +0100 (CET) Subject: [Python-checkins] r68391 - in peps/trunk: Makefile pep-0000.txt Message-ID: <20090108035319.EDE351E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 8 04:53:19 2009 New Revision: 68391 Log: generate the PEP index automatically Removed: peps/trunk/pep-0000.txt Modified: peps/trunk/Makefile Modified: peps/trunk/Makefile ============================================================================== --- peps/trunk/Makefile (original) +++ peps/trunk/Makefile Thu Jan 8 04:53:19 2009 @@ -10,16 +10,20 @@ .txt.html: $(PEP2HTML) $< -TARGETS=$(patsubst %.txt,%.html,$(wildcard pep-*.txt)) +TARGETS=$(patsubst %.txt,%.html,$(wildcard pep-????.txt)) -all: $(TARGETS) +all: pep-0000.txt $(TARGETS) $(TARGETS): pep2html.py +pep-0000.txt: $(wildcard pep-???[1-9].txt) + ./genpepindex.py . + install: echo "Installing is not necessary anymore. It will be done in post-commit." clean: + -rm pep-0000.txt -rm *.html update: Deleted: peps/trunk/pep-0000.txt ============================================================================== --- peps/trunk/pep-0000.txt Thu Jan 8 04:53:19 2009 +++ (empty file) @@ -1,678 +0,0 @@ -PEP: 0 -Title: Index of Python Enhancement Proposals (PEPs) -Version: $Revision$ -Last-Modified: $Date$ -Author: David Goodger , - Barry Warsaw -Status: Active -Type: Process -Created: 13-Jul-2000 -Post-History: - - -Introduction - - The PEP contains the index of all Python Enhancement Proposals, - known as PEPs. PEP numbers are assigned by the PEP Editor, and - once assigned are never changed. The SVN history[1] of the PEP - texts represent their historical record. - - -Index by Category - - num title owner - --- ----- ----- - - Meta-PEPs (PEPs about PEPs or Process) - - P 0 Index of Python Enhancement Proposals Goodger, Warsaw - P 1 PEP Purpose and Guidelines Warsaw, Hylton, Goodger - P 2 Procedure for Adding New Modules Faassen - P 3 Guidelines for Handling Bug Reports Hylton - P 4 Deprecation of Standard Modules von Loewis - P 5 Guidelines for Language Evolution Prescod - P 6 Bug Fix Releases Aahz - P 7 Style Guide for C Code GvR - P 8 Style Guide for Python Code GvR, Warsaw - P 9 Sample Plaintext PEP Template Warsaw - P 10 Voting Guidelines Warsaw - P 11 Removing support for little used platforms von Loewis - P 12 Sample reStructuredText PEP Template Goodger, Warsaw - P 347 Migrating the Python CVS to Subversion von L?wis - P 374 Migrating from svn to a distributed VCS Cannon - P 3000 Python 3000 GvR - P 3001 Reviewing and improving stdlib modules Brandl - P 3002 Procedure for Backwards-Incompatible Changes Bethard - P 3099 Things that will Not Change in Python 3000 Brandl - - Other Informational PEPs - - I 20 The Zen of Python Peters - I 42 Feature Requests Hylton - I 101 Doing Python Releases 101 Warsaw, GvR - I 102 Doing Python Micro Releases Baxter, Warsaw, GvR - IF 160 Python 1.6 Release Schedule Drake - IF 200 Python 2.0 Release Schedule Hylton - IF 226 Python 2.1 Release Schedule Hylton - IF 247 API for Cryptographic Hash Functions Kuchling - IF 248 Python Database API Specification v1.0 Lemburg - IF 249 Python Database API Specification v2.0 Lemburg - IF 251 Python 2.2 Release Schedule Warsaw, GvR - I 257 Docstring Conventions Goodger, GvR - IF 272 API for Block Encryption Algorithms v1.0 Kuchling - IF 283 Python 2.3 Release Schedule GvR - I 287 reStructuredText Docstring Format Goodger - I 290 Code Migration and Modernization Hettinger - I 291 Backward Compatibility for Standard Library Norwitz - I 306 How to Change Python's Grammar Hudson, Diederich, Coghlan, Peterson - IF 320 Python 2.4 Release Schedule Warsaw, et al - I 333 Python Web Server Gateway Interface v1.0 Eby - I 339 Design of the CPython Compiler Cannon - IF 356 Python 2.5 Release Schedule Norwitz, et al - I 360 Externally Maintained Packages Cannon - I 361 Python 2.6 and 3.0 Release Schedule Norwitz, et al - I 373 Python 2.7 Release Schedule Peterson - I 3100 Python 3.0 Plans Cannon - - Accepted PEPs (accepted; may not be completely implemented yet) - - SA 358 The "bytes" Object Schemenauer, GvR - SA 370 Per user site-packages directory Heimes - SA 371 Addition of the multiprocessing package Noller, Oudkerk - SA 3101 Advanced String Formatting Talin - SA 3106 Revamping dict.keys(), .values() & .items() GvR - SA 3108 Standard Library Reorganization Cannon - SA 3116 New I/O Stutzbach, Verdone, GvR - SA 3118 Revising the buffer protocol Oliphant, Banks - SA 3119 Introducing Abstract Base Classes GvR, Talin - SA 3121 Extension Module Initialization & Finalization von L?wis - SA 3134 Exception Chaining and Embedded Tracebacks Yee - SA 3137 Immutable Bytes and Mutable Buffer GvR - SA 3141 A Type Hierarchy for Numbers Yasskin - - Open PEPs (under consideration) - - S 286 Enhanced Argument Tuples von Loewis - S 335 Overloadable Boolean Operators Ewing - S 337 Logging Usage in the Standard Library Dubner - S 345 Metadata for Python Software Packages 1.2 Jones - S 362 Function Signature Object Cannon, Seo - S 368 Standard image protocol and class Mastrodomenico - S 369 Post import hooks Heimes - S 372 Adding an ordered dictionary to collections Ronacher - S 3135 New Super Spealman, Delaney - - Finished PEPs (done, implemented in Subversion) - - SF 100 Python Unicode Integration Lemburg - SF 201 Lockstep Iteration Warsaw - SF 202 List Comprehensions Warsaw - SF 203 Augmented Assignments Wouters - SF 205 Weak References Drake - SF 207 Rich Comparisons GvR, Ascher - SF 208 Reworking the Coercion Model Schemenauer, Lemburg - SF 214 Extended Print Statement Warsaw - SF 217 Display Hook for Interactive Use Zadka - SF 218 Adding a Built-In Set Object Type Wilson, Hettinger - SF 221 Import As Wouters - SF 223 Change the Meaning of \x Escapes Peters - SF 227 Statically Nested Scopes Hylton - SF 229 Using Distutils to Build Python Kuchling - SF 230 Warning Framework GvR - SF 232 Function Attributes Warsaw - SF 234 Iterators Yee, GvR - SF 235 Import on Case-Insensitive Platforms Peters - SF 236 Back to the __future__ Peters - SF 237 Unifying Long Integers and Integers Zadka, GvR - SF 238 Changing the Division Operator Zadka, GvR - SF 241 Metadata for Python Software Packages Kuchling - SF 250 Using site-packages on Windows Moore - SF 252 Making Types Look More Like Classes GvR - SF 253 Subtyping Built-in Types GvR - SF 255 Simple Generators Schemenauer, et al - SF 260 Simplify xrange() GvR - SF 261 Support for "wide" Unicode characters Prescod - SF 263 Defining Python Source Code Encodings Lemburg - SF 264 Future statements in simulated shells Hudson - SF 273 Import Modules from Zip Archives Ahlstrom - SF 277 Unicode file name support for Windows NT Hodgson - SF 278 Universal Newline Support Jansen - SF 279 The enumerate() built-in function Hettinger - SF 282 A Logging System Sajip, Mick - SF 285 Adding a bool type GvR - SF 289 Generator Expressions Hettinger - SF 292 Simpler String Substitutions Warsaw - SF 293 Codec Error Handling Callbacks D?rwald - SF 301 Package Index and Metadata for Distutils Jones - SF 302 New Import Hooks JvR, Moore - SF 305 CSV File API Montanaro, et al - SF 307 Extensions to the pickle protocol GvR, Peters - SF 308 Conditional Expressions GvR, Hettinger - SF 309 Partial Function Application Harris - SF 311 Simplified GIL Acquisition for Extensions Hammond - SF 314 Metadata for Python Software Packages v1.1 Kuchling, Jones - SF 318 Decorators for Functions and Methods Smith, et al - SF 322 Reverse Iteration Hettinger - SF 324 subprocess - New process module Astrand - SF 327 Decimal Data Type Batista - SF 328 Imports: Multi-Line and Absolute/Relative Aahz - SF 331 Locale-Independent Float/String Conversions Reis - SF 338 Executing Modules as Scripts Coghlan - SF 341 Unifying try-except and try-finally Brandl - SF 342 Coroutines via Enhanced Generators GvR, Eby - SF 343 The "with" Statement GvR, Coghlan - SF 352 Required Superclass for Exceptions GvR, Cannon - SF 353 Using ssize_t as the index type von Loewis - SF 357 Allowing Any Object to be Used for Slicing Oliphant - SF 366 Main module explicit relative imports Coghlan - SF 3102 Keyword-Only Arguments Talin - SF 3104 Access to Names in Outer Scopes Yee - SF 3105 Make print a function Brandl - SF 3107 Function Annotations Winter, Lownds - SF 3109 Raising Exceptions in Python 3000 Winter - SF 3110 Catching Exceptions in Python 3000 Winter - SF 3111 Simple input built-in in Python 3000 Roberge - SF 3112 Bytes literals in Python 3000 Orendorff - SF 3113 Removal of Tuple Parameter Unpacking Cannon - SF 3114 Renaming iterator.next() to .__next__() Yee - SF 3115 Metaclasses in Python 3000 Talin - SF 3120 Using UTF-8 as the default source encoding von L?wis - SF 3123 Making PyObject_HEAD conform to standard C von L?wis - SF 3127 Integer Literal Support and Syntax Maupin - SF 3129 Class Decorators Winter - SF 3131 Supporting Non-ASCII Identifiers von L?wis - SF 3132 Extended Iterable Unpacking Brandl - SF 3138 String representation in Python 3000 Ishimoto - - Deferred, Abandoned, Withdrawn, and Rejected PEPs - - SR 204 Range Literals Wouters - IW 206 Python Advanced Library Kuchling - SW 209 Adding Multidimensional Arrays Barrett, Oliphant - SR 210 Decoupling the Interpreter Loop Ascher - SD 211 Adding A New Outer Product Operator Wilson - SD 212 Loop Counter Iteration Schneider-Kamp - SD 213 Attribute Access Handlers Prescod - SR 215 String Interpolation Yee - IR 216 Docstring Format Zadka - SD 219 Stackless Python McMillan - IR 220 Coroutines, Generators, Continuations McMillan - SD 222 Web Library Enhancements Kuchling - SR 224 Attribute Docstrings Lemburg - SD 225 Elementwise/Objectwise Operators Zhu, Lielens - SW 228 Reworking Python's Numeric Model Zadka, GvR - SR 231 __findattr__() Warsaw - SD 233 Python Online Help Prescod - SR 239 Adding a Rational Type to Python Craig, Zadka - SR 240 Adding a Rational Literal to Python Craig, Zadka - SR 242 Numeric Kinds Dubois - SW 243 Module Repository Upload Mechanism Reifschneider - SR 244 The `directive' Statement von Loewis - SR 245 Python Interface Syntax Pelletier - SR 246 Object Adaptation Evans - SR 254 Making Classes Look More Like Types GvR - SR 256 Docstring Processing System Framework Goodger - SR 258 Docutils Design Specification Goodger - SR 259 Omit printing newline after newline GvR - SD 262 Database of Installed Python Packages Kuchling - SR 265 Sorting Dictionaries by Value Griffin - SW 266 Optimizing Global Variable/Attribute Access Montanaro - SD 267 Optimized Access to Module Namespaces Hylton - SR 268 Extended HTTP functionality and WebDAV Stein - SD 269 Pgen Module for Python Riehl - SR 270 uniq method for list objects Petrone - SR 271 Prefixing sys.path by command line option Giacometti - SW 274 Dict Comprehensions Warsaw - SR 275 Switching on Multiple Values Lemburg - SR 276 Simple Iterator for ints Althoff - SD 280 Optimizing access to globals GvR - SR 281 Loop Counter Iteration with range & xrange Hetland - SR 284 Integer for-loops Eppstein, Ewing - SW 288 Generators Attributes and Exceptions Hettinger - SR 294 Type Names in the types Module Tirosh - SR 295 Interpretation of multiline string constants Koltsov - SW 296 Adding a bytes Object Type Gilbert - SR 297 Support for System Upgrades Lemburg - SW 298 The Locked Buffer Interface Heller - SR 299 Special __main__() function in modules Epler - SR 303 Extend divmod() for Multiple Divisors Bellman - SW 304 Controlling Generation of Bytecode Files Montanaro - SR 310 Reliable Acquisition/Release Pairs Hudson, Moore - SD 312 Simple Implicit Lambda Suzi, Martelli - SR 313 Adding Roman Numeral Literals to Python Meyer - SD 315 Enhanced While Loop Carroll, Hettinger - SD 316 Programming by Contract for Python Way - SR 317 Eliminate Implicit Exception Instantiation Taschuk - SR 319 Python Synchronize/Asynchronize Block Pelletier - SW 321 Date/Time Parsing and Formatting Kuchling - SD 323 Copyable Iterators Martelli - SR 325 Resource-Release Support for Generators Pedroni - SR 326 A Case for Top and Bottom Values Carlson, Reedy - SR 329 Treating Builtins as Constants in the StdLib Hettinger - SR 330 Python Bytecode Verification Pelletier - SR 332 Byte vectors and String/Unicode Unification Montanaro - SW 334 Simple Coroutines via SuspendIteration Evans - SR 336 Make None Callable McClelland - SR 340 Anonymous Block Statements GvR - SR 344 Exception Chaining and Embedded Tracebacks Yee - SW 346 User Defined ("with") Statements Coghlan - SR 348 Exception Reorganization for Python 3.0 Cannon - SD 349 Allow str() to return unicode strings Schemenauer - IR 350 Codetags Elliott - SR 351 The freeze protocol Warsaw - SR 354 Enumerations in Python Finney - SR 355 Path - Object oriented filesystem paths Lindqvist - SW 359 The "make" Statement Bethard - SR 363 Syntax For Dynamic Attribute Access North - SW 364 Transitioning to the Py3K Standard Library Warsaw - SR 365 Adding the pkg_resources module Eby - SR 367 New Super Spealman, Delaney - SR 666 Reject Foolish Indentation Creighton - SR 754 IEEE 754 Floating Point Special Values Warnes - SR 3103 A Switch/Case Statement GvR - SR 3117 Postfix Type Declarations Brandl - SR 3122 Delineation of the main module Cannon - SD 3124 Overloading, Generic Functions, Interfaces Eby - SR 3125 Remove Backslash Continuation Jewett - SR 3126 Remove Implicit String Concatenation Jewett - SR 3128 BList: A Faster List-like Type Stutzbach - SR 3130 Access to Current Module/Class/Function Jewett - SR 3133 Introducing Roles Winter - SR 3136 Labeled break and continue Chisholm - SR 3139 Cleaning out sys and the "interpreter" module Peterson - SR 3140 str(container) should call str(item), not repr(item) Broytmann, Jewett - - -Numerical Index - - num title owner - --- ----- ----- - I 0 Index of Python Enhancement Proposals Goodger, Warsaw - P 1 PEP Purpose and Guidelines Warsaw, Hylton, Goodger - I 2 Procedure for Adding New Modules Faassen - I 3 Guidelines for Handling Bug Reports Hylton - I 4 Deprecation of Standard Modules von Loewis - I 5 Guidelines for Language Evolution Prescod - P 6 Bug Fix Releases Aahz - I 7 Style Guide for C Code GvR - I 8 Style Guide for Python Code GvR, Warsaw - I 9 Sample Plaintext PEP Template Warsaw - I 10 Voting Guidelines Warsaw - I 11 Removing support for little used platforms von Loewis - I 12 Sample reStructuredText PEP Template Goodger, Warsaw - I 20 The Zen of Python Peters - I 42 Feature Requests Hylton - - SF 100 Python Unicode Integration Lemburg - I 101 Doing Python Releases 101 Warsaw, GvR - I 102 Doing Python Micro Releases Baxter, Warsaw, GvR - IF 160 Python 1.6 Release Schedule Drake - - IF 200 Python 2.0 Release Schedule Hylton - SF 201 Lockstep Iteration Warsaw - SF 202 List Comprehensions Warsaw - SF 203 Augmented Assignments Wouters - SR 204 Range Literals Wouters - S 205 Weak References Drake - IW 206 Python Advanced Library Kuchling - SF 207 Rich Comparisons GvR, Ascher - SF 208 Reworking the Coercion Model Schemenauer, Lemburg - SW 209 Adding Multidimensional Arrays Barrett, Oliphant - SR 210 Decoupling the Interpreter Loop Ascher - SD 211 Adding A New Outer Product Operator Wilson - SD 212 Loop Counter Iteration Schneider-Kamp - SD 213 Attribute Access Handlers Prescod - SF 214 Extended Print Statement Warsaw - SR 215 String Interpolation Yee - IR 216 Docstring Format Zadka - SF 217 Display Hook for Interactive Use Zadka - SF 218 Adding a Built-In Set Object Type Wilson, Hettinger - SD 219 Stackless Python McMillan - IR 220 Coroutines, Generators, Continuations McMillan - SF 221 Import As Wouters - SD 222 Web Library Enhancements Kuchling - SF 223 Change the Meaning of \x Escapes Peters - SR 224 Attribute Docstrings Lemburg - SD 225 Elementwise/Objectwise Operators Zhu, Lielens - IF 226 Python 2.1 Release Schedule Hylton - S 227 Statically Nested Scopes Hylton - SW 228 Reworking Python's Numeric Model Zadka, GvR - SF 229 Using Distutils to Build Python Kuchling - SF 230 Warning Framework GvR - SR 231 __findattr__() Warsaw - SF 232 Function Attributes Warsaw - SD 233 Python Online Help Prescod - SF 234 Iterators Yee, GvR - SF 235 Import on Case-Insensitive Platforms Peters - SF 236 Back to the __future__ Peters - SF 237 Unifying Long Integers and Integers Zadka, GvR - SF 238 Changing the Division Operator Zadka, GvR - SR 239 Adding a Rational Type to Python Craig, Zadka - SR 240 Adding a Rational Literal to Python Craig, Zadka - SF 241 Metadata for Python Software Packages Kuchling - SR 242 Numeric Kinds Dubois - SW 243 Module Repository Upload Mechanism Reifschneider - SR 244 The `directive' Statement von Loewis - SR 245 Python Interface Syntax Pelletier - SR 246 Object Adaptation Evans - IF 247 API for Cryptographic Hash Functions Kuchling - IF 248 Python Database API Specification v1.0 Lemburg - IF 249 Python Database API Specification v2.0 Lemburg - SF 250 Using site-packages on Windows Moore - IF 251 Python 2.2 Release Schedule Warsaw, GvR - SF 252 Making Types Look More Like Classes GvR - SF 253 Subtyping Built-in Types GvR - SR 254 Making Classes Look More Like Types GvR - SF 255 Simple Generators Schemenauer, et al - S 256 Docstring Processing System Framework Goodger - I 257 Docstring Conventions Goodger, GvR - SR 258 Docutils Design Specification Goodger - SR 259 Omit printing newline after newline GvR - SF 260 Simplify xrange() GvR - SF 261 Support for "wide" Unicode characters Prescod - SD 262 Database of Installed Python Packages Kuchling - SF 263 Defining Python Source Code Encodings Lemburg - SF 264 Future statements in simulated shells Hudson - SR 265 Sorting Dictionaries by Value Griffin - SW 266 Optimizing Global Variable/Attribute Access Montanaro - SD 267 Optimized Access to Module Namespaces Hylton - SR 268 Extended HTTP functionality and WebDAV Stein - SD 269 Pgen Module for Python Riehl - SR 270 uniq method for list objects Petrone - SR 271 Prefixing sys.path by command line option Giacometti - IF 272 API for Block Encryption Algorithms v1.0 Kuchling - SF 273 Import Modules from Zip Archives Ahlstrom - SW 274 Dict Comprehensions Warsaw - SR 275 Switching on Multiple Values Lemburg - SR 276 Simple Iterator for ints Althoff - SF 277 Unicode file name support for Windows NT Hodgson - SF 278 Universal Newline Support Jansen - SF 279 The enumerate() built-in function Hettinger - SD 280 Optimizing access to globals GvR - SR 281 Loop Counter Iteration with range & xrange Hetland - SF 282 A Logging System Sajip, Mick - IF 283 Python 2.3 Release Schedule GvR - SR 284 Integer for-loops Eppstein, Ewing - SF 285 Adding a bool type GvR - S 286 Enhanced Argument Tuples von Loewis - I 287 reStructuredText Docstring Format Goodger - SW 288 Generators Attributes and Exceptions Hettinger - SF 289 Generator Expressions Hettinger - I 290 Code Migration and Modernization Hettinger - I 291 Backward Compatibility for Standard Library Norwitz - SF 292 Simpler String Substitutions Warsaw - SF 293 Codec Error Handling Callbacks D?rwald - SR 294 Type Names in the types Module Tirosh - SR 295 Interpretation of multiline string constants Koltsov - SW 296 Adding a bytes Object Type Gilbert - SR 297 Support for System Upgrades Lemburg - SW 298 The Locked Buffer Interface Heller - SR 299 Special __main__() function in modules Epler - SF 301 Package Index and Metadata for Distutils Jones - SF 302 New Import Hooks JvR, Moore - SR 303 Extend divmod() for Multiple Divisors Bellman - SW 304 Controlling Generation of Bytecode Files Montanaro - SF 305 CSV File API Montanaro, et al - I 306 How to Change Python's Grammar Hudson, Diederich, Coghlan, Peterson - SF 307 Extensions to the pickle protocol GvR, Peters - SF 308 Conditional Expressions GvR, Hettinger - SF 309 Partial Function Application Harris - SR 310 Reliable Acquisition/Release Pairs Hudson, Moore - SF 311 Simplified GIL Acquisition for Extensions Hammond - SD 312 Simple Implicit Lambda Suzi, Martelli - SR 313 Adding Roman Numeral Literals to Python Meyer - SF 314 Metadata for Python Software Packages v1.1 Kuchling, Jones - SD 315 Enhanced While Loop Carroll, Hettinger - SD 316 Programming by Contract for Python Way - SR 317 Eliminate Implicit Exception Instantiation Taschuk - SF 318 Decorators for Functions and Methods Smith, et al - SR 319 Python Synchronize/Asynchronize Block Pelletier - IF 320 Python 2.4 Release Schedule Warsaw, et al - SW 321 Date/Time Parsing and Formatting Kuchling - SF 322 Reverse Iteration Hettinger - SD 323 Copyable Iterators Martelli - SF 324 subprocess - New POSIX process module Astrand - SR 325 Resource-Release Support for Generators Pedroni - SR 326 A Case for Top and Bottom Values Carlson, Reedy - SF 327 Decimal Data Type Batista - SF 328 Imports: Multi-Line and Absolute/Relative Aahz - SR 329 Treating Builtins as Constants in the StdLib Hettinger - SR 330 Python Bytecode Verification Pelletier - SF 331 Locale-Independent Float/String Conversions Reis - SR 332 Byte vectors and String/Unicode Unification Montanaro - I 333 Python Web Server Gateway Interface v1.0 Eby - SW 334 Simple Coroutines via SuspendIteration Evans - S 335 Overloadable Boolean Operators Ewing - SR 336 Make None Callable McClelland - S 337 Logging Usage in the Standard Library Dubner - SF 338 Executing Modules as Scripts Coghlan - I 339 Design of the CPython Compiler Cannon - SR 340 Anonymous Block Statements GvR - SF 341 Unifying try-except and try-finally Brandl - SF 342 Coroutines via Enhanced Generators GvR, Eby - SF 343 Anonymous Block Redux and Generator Enhancements GvR - SR 344 Exception Chaining and Embedded Tracebacks Yee - S 345 Metadata for Python Software Packages 1.2 Jones - SW 346 User Defined ("with") Statements Coghlan - PA 347 Migrating the Python CVS to Subversion von L?wis - SR 348 Exception Reorganization for Python 3.0 Cannon - SD 349 Allow str() to return unicode strings Schemenauer - IR 350 Codetags Elliott - SR 351 The freeze protocol Warsaw - SF 352 Required Superclass for Exceptions GvR, Cannon - SA 353 Using ssize_t as the index type von Loewis - SR 354 Enumerations in Python Finney - SR 355 Path - Object oriented filesystem paths Lindqvist - IF 356 Python 2.5 Release Schedule Norwitz, et al - SF 357 Allowing Any Object to be Used for Slicing Oliphant - SA 358 The "bytes" Object Schemenauer, GvR - SW 359 The "make" Statement Bethard - I 360 Externally Maintained Packages Cannon - I 361 Python 2.6 and 3.0 Release Schedule Norwitz, et al - S 362 Function Signature Object Cannon, Seo - SR 363 Syntax For Dynamic Attribute Access North - SW 364 Transitioning to the Py3K Standard Library Warsaw - SR 365 Adding the pkg_resources module Eby - SF 366 Main module explicit relative imports Coghlan - SR 367 New Super Spealman, Delaney - S 368 Standard image protocol and class Mastrodomenico - S 369 Post import hooks Heimes - SA 370 Per user site-packages directory Heimes - SA 371 Addition of the multiprocessing package Noller, Oudkerk - S 372 Adding an ordered dictionary to collections Ronacher - I 373 Python 2.7 Release Schedule Peterson - P 374 Migrating from svn to a distributed VCS Cannon - SR 666 Reject Foolish Indentation Creighton - SR 754 IEEE 754 Floating Point Special Values Warnes - P 3000 Python 3000 GvR - P 3001 Reviewing and improving stdlib modules Brandl - P 3002 Procedure for Backwards-Incompatible Changes Bethard - I 3099 Things that will Not Change in Python 3000 Brandl - I 3100 Python 3.0 Plans Cannon - SA 3101 Advanced String Formatting Talin - SF 3102 Keyword-Only Arguments Talin - SR 3103 A Switch/Case Statement GvR - SF 3104 Access to Names in Outer Scopes Yee - SF 3105 Make print a function Brandl - SA 3106 Revamping dict.keys(), .values() & .items() GvR - SF 3107 Function Annotations Winter, Lownds - SA 3108 Standard Library Reorganization Cannon - SF 3109 Raising Exceptions in Python 3000 Winter - SF 3110 Catching Exceptions in Python 3000 Winter - SF 3111 Simple input built-in in Python 3000 Roberge - SF 3112 Bytes literals in Python 3000 Orendorff - SF 3113 Removal of Tuple Parameter Unpacking Cannon - SF 3114 Renaming iterator.next() to .__next__() Yee - SF 3115 Metaclasses in Python 3000 Talin - SA 3116 New I/O Stutzbach, Verdone, GvR - SR 3117 Postfix Type Declarations Brandl - SA 3118 Revising the buffer protocol Oliphant, Banks - SA 3119 Introducing Abstract Base Classes GvR, Talin - SF 3120 Using UTF-8 as the default source encoding von L?wis - SA 3121 Extension Module Initialization & Finalization von L?wis - SR 3122 Delineation of the main module Cannon - SF 3123 Making PyObject_HEAD conform to standard C von L?wis - SD 3124 Overloading, Generic Functions, Interfaces Eby - SR 3125 Remove Backslash Continuation Jewett - SR 3126 Remove Implicit String Concatenation Jewett - SF 3127 Integer Literal Support and Syntax Maupin - SR 3128 BList: A Faster List-like Type Stutzbach - SF 3129 Class Decorators Winter - SR 3130 Access to Current Module/Class/Function Jewett - SF 3131 Supporting Non-ASCII Identifiers von L?wis - SF 3132 Extended Iterable Unpacking Brandl - SR 3133 Introducing Roles Winter - SA 3134 Exception Chaining and Embedded Tracebacks Yee - S 3135 New Super Spealman, Delaney - SR 3136 Labeled break and continue Chisholm - SA 3137 Immutable Bytes and Mutable Buffer GvR - SF 3138 String representation in Python 3000 Ishimoto - SR 3139 Cleaning out sys and the "interpreter" module Peterson - SR 3140 str(container) should call str(item), not repr(item) Broytmann, Jewett - SA 3141 A Type Hierarchy for Numbers Yasskin - - -Key - - S - Standards Track PEP - I - Informational PEP - P - Process PEP - - A - Accepted proposal - R - Rejected proposal - W - Withdrawn proposal - D - Deferred proposal - F - Final proposal - - -Owners - - name email address - ---------------- ------------- - Aahz aahz at pythoncraft.com - Ahlstrom, James C. jim at interet.com - Althoff, Jim james_althoff at i2.com - Altis, Kevin altis at semi-retired.com - Ascher, David davida at activestate.com - Astrand, Peter astrand at lysator.liu.se - Banks, Carl pythondev at aerojockey.com - Barrett, Paul barrett at stsci.edu - Batista, Facundo facundo at taniquetil.com.ar - Baxter, Anthony anthony at interlink.com.au - Bellman, Thomas bellman+pep-divmod at lysator.liu.se - Bethard, Steven steven.bethard at gmail.com - Brandl, Georg georg at python.org - Broytmann, Oleg phd at phd.pp.ru - Cannon, Brett brett at python.org - Carlson, Josiah jcarlson at uci.edu - Carroll, W Isaac icarroll at pobox.com - Chisholm, Matt matt-python at theory.org - Coghlan, Nick ncoghlan at gmail.com - Cole, Dave djc at object-craft.com.au - Craig, Christopher python-pep at ccraig.org - Creighton, Laura lac at strakt.com - Delaney, Tim timothy.c.delaney at gmail.com - D?rwald, Walter - Drake, Fred fdrake at acm.org - Dubner, Michael P. dubnerm at mindless.com - Dubois, Paul F. paul at pfdubois.com - Eby, Phillip J. pje at telecommunity.com - Elliott, Micah mde at tracos.org - Epler, Jeff jepler at unpythonic.net - Eppstein, David eppstein at ics.uci.edu - Evans, Clark C. cce at clarkevans.com - Ewing, Gregory greg at cosc.canterbury.ac.nz - Faassen, Martijn faassen at infrae.com - Finney, Ben ben+python at benfinney.id.au - Giacometti, Fr?d?ric B. fred at arakne.com - Gilbert, Scott xscottg at yahoo.com - Goodger, David goodger at python.org - Griffin, Grant g2 at iowegian.com - Hammond, Mark mhammond at skippinet.com.au - Harris, Peter scav at blueyonder.co.uk - Heimes, Christian christian at cheimes.de - Heller, Thomas theller at python.net - Hetland, Magnus Lie magnus at hetland.org - Hettinger, Raymond python at rcn.com - Hodgson, Neil neilh at scintilla.org - Hudson, Michael mwh at python.net - Hylton, Jeremy jeremy at alum.mit.edu - Ishimoto, Atsuo ishimoto at gembook.org - Jansen, Jack jack at cwi.nl - Jewett, Jim J. jimjjewett at users.sourceforge.net - Jones, Richard richard at python.org - Koltsov, Stepan yozh at mx1.ru - Kuchling, A.M. amk at amk.ca - Lemburg, Marc-Andr? mal at lemburg.com - Lielens, Gregory gregory.lielens at fft.be - Lindqvist, Bj?rn bjourne at gmail.com - von L?wis, Martin martin at v.loewis.de - Lownds, Tony tony at pagedna.com - Martelli, Alex aleaxit at gmail.com - Mastrodomenico, Lino l.mastrodomenico at gmail.com - Maupin, Patrick pmaupin at gmail.com - McClelland, Andrew eternalsquire at comcast.net - McMillan, Gordon gmcm at hypernet.com - McNamara, Andrew andrewm at object-craft.com.au - Mick, Trent trentm at activestate.com - Meyer, Mike mwm at mired.org - Montanaro, Skip skip at pobox.com - Moore, Paul gustav at morpheus.demon.co.uk - Noller, Jesse jnoller at gmail.com - North, Ben ben at redfrontdoor.org - Norwitz, Neal nnorwitz at gmail.com - Oliphant, Travis oliphant at ee.byu.edu - Orendorff, Jason jason.orendorff at gmail.com - Oudkerk, Richard r.m.oudkerk at googlemail.com - Pedroni, Samuele pedronis at python.org - Pelletier, Michel michel at users.sourceforge.net - Peters, Tim tim at zope.com - Peterson, Benjamin benjamin at python.org - Petrone, Jason jp at demonseed.net - Prescod, Paul paul at prescod.net - Reedy, Terry tjreedy at udel.edu - Reifschneider, Sean jafo-pep at tummy.com - Reis, Christian R. kiko at async.com.br - Riehl, Jonathan jriehl at spaceship.com - Roberge, Andr? andre.roberge at gmail.com - Ronacher, Armin armin.ronacher at active-4.com - van Rossum, Guido (GvR) guido at python.org - van Rossum, Just (JvR) just at letterror.com - Sajip, Vinay vinay_sajip at red-dove.com - Schemenauer, Neil nas at arctrix.com - Schneider-Kamp, Peter nowonder at nowonder.de - Seo, Jiwon seojiwon at gmail.com - Smith, Kevin D. Kevin.Smith at theMorgue.org - Spealman, Calvin ironfroggy at gmail.com - Stein, Greg gstein at lyra.org - Stutzbach, Daniel daniel.stutzbach at gmail.com - Suzi, Roman rnd at onego.ru - Talin talin at acm.org - Taschuk, Steven staschuk at telusplanet.net - Tirosh, Oren oren at hishome.net - Verdone, Mike mike.verdone at gmail.com - Warnes, Gregory R. warnes at users.sourceforge.net - Warsaw, Barry barry at python.org - Way, Terence terry at wayforward.net - Wells, Cliff LogiplexSoftware at earthlink.net - Wilson, Greg gvwilson at ddj.com - Winter, Collin collinw at gmail.com - Wouters, Thomas thomas at python.org - Yee, Ka-Ping ping at zesty.ca - Zadka, Moshe moshez at zadka.site.co.il - Zhu, Huaiyu hzhu at users.sourceforge.net - - -References - - [1] View PEP history online - http://svn.python.org/projects/peps/trunk/ - - -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 Thu Jan 8 04:56:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 8 Jan 2009 04:56:28 +0100 (CET) Subject: [Python-checkins] r68392 - peps/trunk Message-ID: <20090108035628.640331E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 8 04:56:28 2009 New Revision: 68392 Log: ignore pep-0000.txt now Modified: peps/trunk/ (props changed) From python-checkins at python.org Thu Jan 8 05:01:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 8 Jan 2009 05:01:02 +0100 (CET) Subject: [Python-checkins] r68393 - in python/trunk/Doc/tools/sphinxext: pyspecific.py suspicious.py Message-ID: <20090108040102.4C6891E4024@bag.python.org> Author: benjamin.peterson Date: Thu Jan 8 05:01:00 2009 New Revision: 68393 Log: use new sphinx modules Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py python/trunk/Doc/tools/sphinxext/suspicious.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 Jan 8 05:01:00 2009 @@ -48,15 +48,9 @@ from docutils.io import StringOutput from docutils.utils import new_document -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 +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + class PydocTopicsBuilder(Builder): name = 'pydoc-topics' Modified: python/trunk/Doc/tools/sphinxext/suspicious.py ============================================================================== --- python/trunk/Doc/tools/sphinxext/suspicious.py (original) +++ python/trunk/Doc/tools/sphinxext/suspicious.py Thu Jan 8 05:01:00 2009 @@ -45,7 +45,7 @@ import csv import re from docutils import nodes -from sphinx.builder import Builder +from sphinx.builders import Builder detect_all = re.compile(ur''' ::(?=[^=])| # two :: (but NOT ::=) From python-checkins at python.org Thu Jan 8 06:20:20 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 8 Jan 2009 06:20:20 +0100 (CET) Subject: [Python-checkins] r68394 - in python/branches/release26-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090108052020.100021E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 8 06:20:19 2009 New Revision: 68394 Log: - Issue 4816: itertools.combinations() and itertools.product were raising a ValueError for values of *r* larger than the input iterable. They now correctly return an empty iterator. Modified: python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Lib/test/test_itertools.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/itertoolsmodule.c 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 Jan 8 06:20:19 2009 @@ -108,6 +108,8 @@ # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) + if r > n: + return indices = range(r) yield tuple(pool[i] for i in indices) while 1: @@ -132,6 +134,9 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. + .. versionadded:: 2.6 .. function:: count([n]) @@ -399,6 +404,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) @@ -428,6 +435,9 @@ if len(set(indices)) == r: yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. + .. versionadded:: 2.6 .. function:: product(*iterables[, repeat]) @@ -674,7 +684,8 @@ return (d for d, s in izip(data, selectors) if s) def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) indices = [0] * r 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 Jan 8 06:20:19 2009 @@ -71,11 +71,11 @@ self.assertRaises(TypeError, list, chain.from_iterable([2, 3])) def test_combinations(self): - self.assertRaises(TypeError, combinations, 'abc') # missing r argument + self.assertRaises(TypeError, combinations, 'abc') # missing r argument self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, combinations, None) # pool is not iterable self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative - self.assertRaises(ValueError, combinations, 'abc', 32) # r is too big + self.assertEqual(list(combinations('abc', 32)), []) # r > n self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) @@ -83,6 +83,8 @@ 'Pure python version shown in the docs' pool = tuple(iterable) n = len(pool) + if r > n: + return indices = range(r) yield tuple(pool[i] for i in indices) while 1: @@ -106,9 +108,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(combinations(values, r)) - self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for c in result: @@ -119,7 +121,7 @@ self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version - self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version + self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -130,7 +132,7 @@ self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, permutations, None) # pool is not iterable self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative - self.assertRaises(ValueError, permutations, 'abc', 32) # r is too big + self.assertEqual(list(permutations('abc', 32)), []) # r > n self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None self.assertEqual(list(permutations(range(3), 2)), [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)]) @@ -140,6 +142,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) @@ -168,9 +172,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(permutations(values, r)) - self.assertEqual(len(result), fact(n) / fact(n-r)) # right number of perms + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r)) # right number of perms self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for p in result: @@ -178,7 +182,7 @@ self.assertEqual(len(set(p)), r) # no duplicate elements self.assert_(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version - self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version + self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: self.assertEqual(result, list(permutations(values, None))) # test r as None self.assertEqual(result, list(permutations(values))) # test default r @@ -1363,6 +1367,26 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(combinations_with_replacement('01', 3)) +[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] + +>>> def combinations_with_replacement2(iterable, r): +... 'Alternate version that filters from product()' +... pool = tuple(iterable) +... n = len(pool) +... for indices in product(range(n), repeat=r): +... if sorted(indices) == list(indices): +... yield tuple(pool[i] for i in indices) + +>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) +True + +>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +True + +>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +True + >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Jan 8 06:20:19 2009 @@ -67,6 +67,10 @@ Library ------- +- Issue 4816: itertools.combinations() and itertools.product were raising + a ValueError for values of *r* larger than the input iterable. They now + correctly return an empty iterator. + - Fractions.from_float() no longer loses precision for integers too big to cast as floats. Modified: python/branches/release26-maint/Modules/itertoolsmodule.c ============================================================================== --- python/branches/release26-maint/Modules/itertoolsmodule.c (original) +++ python/branches/release26-maint/Modules/itertoolsmodule.c Thu Jan 8 06:20:19 2009 @@ -2059,10 +2059,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); if (indices == NULL) { @@ -2082,7 +2078,7 @@ co->indices = indices; co->result = NULL; co->r = r; - co->stopped = 0; + co->stopped = r > n ? 1 : 0; return (PyObject *)co; @@ -2318,10 +2314,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(n * sizeof(Py_ssize_t)); cycles = PyMem_Malloc(r * sizeof(Py_ssize_t)); @@ -2345,7 +2337,7 @@ po->cycles = cycles; po->result = NULL; po->r = r; - po->stopped = 0; + po->stopped = r > n ? 1 : 0; return (PyObject *)po; From buildbot at python.org Thu Jan 8 07:12:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 08 Jan 2009 06:12:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090108061229.9AAC81E4002@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/35 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: raymond.hettinger 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 Jan 8 07:39:05 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 8 Jan 2009 07:39:05 +0100 (CET) Subject: [Python-checkins] r68395 - in python/trunk: Doc/library/itertools.rst Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090108063905.6C1151E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 8 07:39:04 2009 New Revision: 68395 Log: Forward port r68394 for issue 4816. 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 Thu Jan 8 07:39:04 2009 @@ -108,6 +108,8 @@ # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) + if r > n: + return indices = range(r) yield tuple(pool[i] for i in indices) while 1: @@ -132,6 +134,9 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. + .. versionadded:: 2.6 .. function:: count([n]) @@ -399,6 +404,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) @@ -428,6 +435,9 @@ if len(set(indices)) == r: yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. + .. versionadded:: 2.6 .. function:: product(*iterables[, repeat]) @@ -674,7 +684,8 @@ return (d for d, s in izip(data, selectors) if s) def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) indices = [0] * r Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Jan 8 07:39:04 2009 @@ -71,11 +71,11 @@ self.assertRaises(TypeError, list, chain.from_iterable([2, 3])) def test_combinations(self): - self.assertRaises(TypeError, combinations, 'abc') # missing r argument + self.assertRaises(TypeError, combinations, 'abc') # missing r argument self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, combinations, None) # pool is not iterable self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative - self.assertRaises(ValueError, combinations, 'abc', 32) # r is too big + self.assertEqual(list(combinations('abc', 32)), []) # r > n self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) @@ -83,6 +83,8 @@ 'Pure python version shown in the docs' pool = tuple(iterable) n = len(pool) + if r > n: + return indices = range(r) yield tuple(pool[i] for i in indices) while 1: @@ -106,9 +108,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(combinations(values, r)) - self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for c in result: @@ -119,7 +121,7 @@ self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version - self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version + self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -130,7 +132,7 @@ self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, permutations, None) # pool is not iterable self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative - self.assertRaises(ValueError, permutations, 'abc', 32) # r is too big + self.assertEqual(list(permutations('abc', 32)), []) # r > n self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None self.assertEqual(list(permutations(range(3), 2)), [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)]) @@ -140,6 +142,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) @@ -168,9 +172,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(permutations(values, r)) - self.assertEqual(len(result), fact(n) / fact(n-r)) # right number of perms + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r)) # right number of perms self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for p in result: @@ -178,7 +182,7 @@ self.assertEqual(len(set(p)), r) # no duplicate elements self.assert_(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version - self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version + self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: self.assertEqual(result, list(permutations(values, None))) # test r as None self.assertEqual(result, list(permutations(values))) # test default r @@ -1363,6 +1367,26 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(combinations_with_replacement('01', 3)) +[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] + +>>> def combinations_with_replacement2(iterable, r): +... 'Alternate version that filters from product()' +... pool = tuple(iterable) +... n = len(pool) +... for indices in product(range(n), repeat=r): +... if sorted(indices) == list(indices): +... yield tuple(pool[i] for i in indices) + +>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) +True + +>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +True + +>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +True + >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Jan 8 07:39:04 2009 @@ -2059,10 +2059,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); if (indices == NULL) { @@ -2082,7 +2078,7 @@ co->indices = indices; co->result = NULL; co->r = r; - co->stopped = 0; + co->stopped = r > n ? 1 : 0; return (PyObject *)co; @@ -2318,10 +2314,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(n * sizeof(Py_ssize_t)); cycles = PyMem_Malloc(r * sizeof(Py_ssize_t)); @@ -2345,7 +2337,7 @@ po->cycles = cycles; po->result = NULL; po->r = r; - po->stopped = 0; + po->stopped = r > n ? 1 : 0; return (PyObject *)po; From buildbot at python.org Thu Jan 8 08:05:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 08 Jan 2009 07:05:26 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090108070527.12D691E4002@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/4435 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 8 10:34:21 2009 From: python-checkins at python.org (thomas.heller) Date: Thu, 8 Jan 2009 10:34:21 +0100 (CET) Subject: [Python-checkins] r68401 - in python/branches/py3k: Misc/NEWS Modules/_ctypes/callproc.c Message-ID: <20090108093421.CFDB81E4002@bag.python.org> Author: thomas.heller Date: Thu Jan 8 10:34:20 2009 New Revision: 68401 Log: Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false. Fixes issue #4867. Modified: 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 Thu Jan 8 10:34:20 2009 @@ -88,6 +88,9 @@ Library ------- +- Issue #4867: Fixed a crash in ctypes when passing a string to a + function without defining argtypes. + - Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. The default value remains the current time. The information can be used by e.g. gunzip when decompressing. Patch by Modified: python/branches/py3k/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/callproc.c (original) +++ python/branches/py3k/Modules/_ctypes/callproc.c Thu Jan 8 10:34:20 2009 @@ -645,8 +645,8 @@ #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { -#ifdef HAVE_USABLE_WCHAR_T pa->ffi_type = &ffi_type_pointer; +#ifdef HAVE_USABLE_WCHAR_T pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; From python-checkins at python.org Thu Jan 8 10:55:38 2009 From: python-checkins at python.org (thomas.heller) Date: Thu, 8 Jan 2009 10:55:38 +0100 (CET) Subject: [Python-checkins] r68402 - in python/branches/release30-maint: Misc/NEWS Modules/_ctypes/callproc.c Message-ID: <20090108095538.A873A1E4002@bag.python.org> Author: thomas.heller Date: Thu Jan 8 10:55:38 2009 New Revision: 68402 Log: Merged revisions 68401 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68401 | thomas.heller | 2009-01-08 10:34:20 +0100 (Do, 08 Jan 2009) | 2 lines Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false. Fixes issue #4867. ........ 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 Thu Jan 8 10:55:38 2009 @@ -70,6 +70,9 @@ Library ------- +- Issue #4867: Fixed a crash in ctypes when passing a string to a + function without defining argtypes. + - Restore Python 2.3 compatibility for decimal.py. - Issue #3638: Remove functions from _tkinter module level that depend on 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 Thu Jan 8 10:55:38 2009 @@ -645,8 +645,8 @@ #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { -#ifdef HAVE_USABLE_WCHAR_T pa->ffi_type = &ffi_type_pointer; +#ifdef HAVE_USABLE_WCHAR_T pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; From buildbot at python.org Thu Jan 8 11:11:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 08 Jan 2009 10:11:31 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090108101131.C3ED81E4002@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/39 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: thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 8 16:54:38 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 16:54:38 +0100 (CET) Subject: [Python-checkins] r68406 - sandbox/trunk/io-c/_textio.c Message-ID: <20090108155438.A83C81E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 16:54:38 2009 New Revision: 68406 Log: Consistent improvements in IncrementalNewlineDecoder speed, especially the \n-only case. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 16:54:38 2009 @@ -94,7 +94,8 @@ #define SEEN_CR 1 #define SEEN_LF 2 -#define SEEN_CRLF 4 +#define SEEN_CRLF 4 +#define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF) static PyObject * IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, @@ -172,11 +173,23 @@ { Py_UNICODE *in_str; Py_ssize_t in, len; - int seennl = 0; + int seennl = self->seennl; + int only_lf; in_str = PyUnicode_AS_UNICODE(output); len = PyUnicode_GET_SIZE(output); + + /* If, up to now, newlines are consistently \n, do a quick check + for the \r *byte* with the libc's optimized memchr. + */ + only_lf = ((seennl == SEEN_LF) + && !memchr(in_str, '\r', len * sizeof(Py_UNICODE))); + if (!self->translate) { + if (seennl == SEEN_ALL) + goto endscan; + if (only_lf) + goto endscan; for (in = 0; in < len;) { Py_UNICODE c = in_str[in++]; if (c >= 0x20) @@ -191,9 +204,13 @@ else seennl |= SEEN_CR; } + if (seennl == SEEN_ALL) + goto endscan; } + endscan: + ; } - else { + else if (!only_lf) { PyObject *translated = NULL; Py_UNICODE *out_str; Py_ssize_t out; From python-checkins at python.org Thu Jan 8 17:02:54 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 17:02:54 +0100 (CET) Subject: [Python-checkins] r68407 - sandbox/trunk/io-c/_textio.c Message-ID: <20090108160254.D84521E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 17:02:54 2009 New Revision: 68407 Log: Change chunk size so that it is >= buffer size of the buffered IO layer (which itself is equal to the filesystem block size by default) Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 17:02:54 2009 @@ -517,7 +517,7 @@ if (errors == NULL) errors = "strict"; - self->chunk_size = 2048; + self->chunk_size = 8192; self->readuniversal = (newline == NULL || newline[0] == '\0'); self->line_buffering = line_buffering; self->readtranslate = (newline == NULL); From python-checkins at python.org Thu Jan 8 20:53:19 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 20:53:19 +0100 (CET) Subject: [Python-checkins] r68408 - sandbox/trunk/iobench/iobench.py Message-ID: <20090108195319.F144F1E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 20:53:19 2009 New Revision: 68408 Log: Add an option to choose line endings in text tests Modified: sandbox/trunk/iobench/iobench.py Modified: sandbox/trunk/iobench/iobench.py ============================================================================== --- sandbox/trunk/iobench/iobench.py (original) +++ sandbox/trunk/iobench/iobench.py Thu Jan 8 20:53:19 2009 @@ -13,6 +13,7 @@ out = sys.stdout TEXT_ENCODING = 'utf8' +NEWLINES = 'lf' # Compatibility try: @@ -36,7 +37,7 @@ return ((name + ".bin", size) for name, size in get_file_sizes()) def get_text_files(): - return ((name + "-" + TEXT_ENCODING + ".txt", size) + return (("%s-%s-%s.txt" % (name, TEXT_ENCODING, NEWLINES), size) for name, size in get_file_sizes()) def with_open_mode(mode): @@ -377,9 +378,12 @@ else: raise RuntimeError( "Couldn't find chunk marker in %s !" % __file__) - # Change some newlines to exercise newlines translation (in 3.x) - newlines = itertools.cycle(["\n", "\r", "\r\n"]) - chunk = "".join(line.replace("\n", next(newlines)) for line in f) + if NEWLINES == "all": + it = itertools.cycle(["\n", "\r", "\r\n"]) + else: + it = itertools.repeat( + {"cr": "\r", "lf": "\n", "crlf": "\r\n"}[NEWLINES]) + chunk = "".join(line.replace("\n", next(it)) for line in f) if isinstance(chunk, bytes): chunk = chunk.decode('utf8') chunk = chunk.encode(TEXT_ENCODING) @@ -400,7 +404,7 @@ f.write(tail) def main(): - global TEXT_ENCODING + global TEXT_ENCODING, NEWLINES usage = "usage: %prog [-h|--help] [options]" parser = OptionParser(usage=usage) @@ -419,9 +423,16 @@ parser.add_option("-E", "--encoding", action="store", dest="encoding", default=None, help="encoding for text tests (default: %s)" % TEXT_ENCODING) + parser.add_option("-N", "--newlines", + action="store", dest="newlines", default='lf', + help="line endings for text tests " + "(one of: {lf (default), cr, crlf, all})") options, args = parser.parse_args() if args: parser.error("unexpected arguments") + NEWLINES = options.newlines.lower() + if NEWLINES not in ('lf', 'cr', 'crlf', 'all'): + parser.error("invalid 'newlines' option: %r" % NEWLINES) test_options = "" if options.read: From python-checkins at python.org Thu Jan 8 22:01:54 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 8 Jan 2009 22:01:54 +0100 (CET) Subject: [Python-checkins] r68409 - in python/branches/py3k: Doc/library/itertools.rst Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090108210154.CB4AF1E400C@bag.python.org> Author: raymond.hettinger Date: Thu Jan 8 22:01:54 2009 New Revision: 68409 Log: Merge in r68394 fixing itertools.permutations() and combinations(). 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 Thu Jan 8 22:01:54 2009 @@ -104,7 +104,9 @@ # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) - indices = range(r) + if r > n: + return + indices = list(range(r)) yield tuple(pool[i] for i in indices) while 1: for i in reversed(range(r)): @@ -128,6 +130,8 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. .. function:: count([n]) @@ -325,7 +329,9 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r - indices = range(n) + if r > n: + return + indices = list(range(n)) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) while n: @@ -354,6 +360,8 @@ if len(set(indices)) == r: yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. .. function:: product(*iterables[, repeat]) @@ -593,7 +601,8 @@ return (d for d, s in zip(data, selectors) if s) def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) indices = [0] * r 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 Jan 8 22:01:54 2009 @@ -75,11 +75,11 @@ self.assertRaises(TypeError, list, chain.from_iterable([2, 3])) def test_combinations(self): - self.assertRaises(TypeError, combinations, 'abc') # missing r argument + self.assertRaises(TypeError, combinations, 'abc') # missing r argument self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, combinations, None) # pool is not iterable self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative - self.assertRaises(ValueError, combinations, 'abc', 32) # r is too big + self.assertEqual(list(combinations('abc', 32)), []) # r > n self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) @@ -87,6 +87,8 @@ 'Pure python version shown in the docs' pool = tuple(iterable) n = len(pool) + if r > n: + return indices = list(range(r)) yield tuple(pool[i] for i in indices) while 1: @@ -110,9 +112,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(combinations(values, r)) - self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for c in result: @@ -123,7 +125,7 @@ self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version - self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version + self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -134,7 +136,7 @@ self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, permutations, None) # pool is not iterable self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative - self.assertRaises(ValueError, permutations, 'abc', 32) # r is too big + self.assertEqual(list(permutations('abc', 32)), []) # r > n self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None self.assertEqual(list(permutations(range(3), 2)), [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)]) @@ -144,6 +146,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = list(range(n)) cycles = list(range(n-r+1, n+1))[::-1] yield tuple(pool[i] for i in indices[:r]) @@ -172,9 +176,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(permutations(values, r)) - self.assertEqual(len(result), fact(n) / fact(n-r)) # right number of perms + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r)) # right number of perms self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for p in result: @@ -182,7 +186,7 @@ self.assertEqual(len(set(p)), r) # no duplicate elements self.assert_(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version - self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version + self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: self.assertEqual(result, list(permutations(values, None))) # test r as None self.assertEqual(result, list(permutations(values))) # test default r @@ -1384,6 +1388,26 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(combinations_with_replacement('01', 3)) +[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] + +>>> def combinations_with_replacement2(iterable, r): +... 'Alternate version that filters from product()' +... pool = tuple(iterable) +... n = len(pool) +... for indices in product(range(n), repeat=r): +... if sorted(indices) == list(indices): +... yield tuple(pool[i] for i in indices) + +>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) +True + +>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +True + +>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +True + >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Thu Jan 8 22:01:54 2009 @@ -1880,10 +1880,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); if (indices == NULL) { @@ -1903,7 +1899,7 @@ co->indices = indices; co->result = NULL; co->r = r; - co->stopped = 0; + co->stopped = r > n ? 1 : 0; return (PyObject *)co; @@ -2143,10 +2139,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(n * sizeof(Py_ssize_t)); cycles = PyMem_Malloc(r * sizeof(Py_ssize_t)); @@ -2170,7 +2162,7 @@ po->cycles = cycles; po->result = NULL; po->r = r; - po->stopped = 0; + po->stopped = r > n ? 1 : 0; return (PyObject *)po; From python-checkins at python.org Thu Jan 8 22:07:00 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 8 Jan 2009 22:07:00 +0100 (CET) Subject: [Python-checkins] r68410 - in python/branches/release30-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090108210700.57FC11E403B@bag.python.org> Author: raymond.hettinger Date: Thu Jan 8 22:07:00 2009 New Revision: 68410 Log: Backport r68409 fixing itertools.permutations() and combinations(). Modified: python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Lib/test/test_itertools.py python/branches/release30-maint/Modules/itertoolsmodule.c 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 Jan 8 22:07:00 2009 @@ -104,7 +104,9 @@ # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) - indices = range(r) + if r > n: + return + indices = list(range(r)) yield tuple(pool[i] for i in indices) while 1: for i in reversed(range(r)): @@ -128,6 +130,8 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. .. function:: count([n]) @@ -325,7 +329,9 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r - indices = range(n) + if r > n: + return + indices = list(range(n)) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) while n: @@ -354,6 +360,8 @@ if len(set(indices)) == r: yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. .. function:: product(*iterables[, repeat]) @@ -593,7 +601,8 @@ return (d for d, s in zip(data, selectors) if s) def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) indices = [0] * r 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 Jan 8 22:07:00 2009 @@ -75,11 +75,11 @@ self.assertRaises(TypeError, list, chain.from_iterable([2, 3])) def test_combinations(self): - self.assertRaises(TypeError, combinations, 'abc') # missing r argument + self.assertRaises(TypeError, combinations, 'abc') # missing r argument self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, combinations, None) # pool is not iterable self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative - self.assertRaises(ValueError, combinations, 'abc', 32) # r is too big + self.assertEqual(list(combinations('abc', 32)), []) # r > n self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) @@ -87,6 +87,8 @@ 'Pure python version shown in the docs' pool = tuple(iterable) n = len(pool) + if r > n: + return indices = list(range(r)) yield tuple(pool[i] for i in indices) while 1: @@ -110,9 +112,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(combinations(values, r)) - self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for c in result: @@ -123,7 +125,7 @@ self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version - self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version + self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -134,7 +136,7 @@ self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, permutations, None) # pool is not iterable self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative - self.assertRaises(ValueError, permutations, 'abc', 32) # r is too big + self.assertEqual(list(permutations('abc', 32)), []) # r > n self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None self.assertEqual(list(permutations(range(3), 2)), [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)]) @@ -144,6 +146,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = list(range(n)) cycles = list(range(n-r+1, n+1))[::-1] yield tuple(pool[i] for i in indices[:r]) @@ -172,9 +176,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(permutations(values, r)) - self.assertEqual(len(result), fact(n) / fact(n-r)) # right number of perms + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r)) # right number of perms self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for p in result: @@ -182,7 +186,7 @@ self.assertEqual(len(set(p)), r) # no duplicate elements self.assert_(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version - self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version + self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: self.assertEqual(result, list(permutations(values, None))) # test r as None self.assertEqual(result, list(permutations(values))) # test default r @@ -1384,6 +1388,26 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(combinations_with_replacement('01', 3)) +[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] + +>>> def combinations_with_replacement2(iterable, r): +... 'Alternate version that filters from product()' +... pool = tuple(iterable) +... n = len(pool) +... for indices in product(range(n), repeat=r): +... if sorted(indices) == list(indices): +... yield tuple(pool[i] for i in indices) + +>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) +True + +>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +True + +>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +True + >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] Modified: python/branches/release30-maint/Modules/itertoolsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/itertoolsmodule.c (original) +++ python/branches/release30-maint/Modules/itertoolsmodule.c Thu Jan 8 22:07:00 2009 @@ -1880,10 +1880,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); if (indices == NULL) { @@ -1903,7 +1899,7 @@ co->indices = indices; co->result = NULL; co->r = r; - co->stopped = 0; + co->stopped = r > n ? 1 : 0; return (PyObject *)co; @@ -2143,10 +2139,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(n * sizeof(Py_ssize_t)); cycles = PyMem_Malloc(r * sizeof(Py_ssize_t)); @@ -2170,7 +2162,7 @@ po->cycles = cycles; po->result = NULL; po->r = r; - po->stopped = 0; + po->stopped = r > n ? 1 : 0; return (PyObject *)po; From python-checkins at python.org Thu Jan 8 22:17:17 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 8 Jan 2009 22:17:17 +0100 (CET) Subject: [Python-checkins] r68411 - in python/branches/py3k: Doc/library/hashlib.rst Lib/test/test_hashlib.py Misc/NEWS Modules/_hashopenssl.c Message-ID: <20090108211717.420DF1E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 8 22:17:16 2009 New Revision: 68411 Log: Issue #4751: hashlib now releases the GIL when hashing large buffers (with a hardwired threshold of 2048 bytes), allowing better parallelization on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner. Modified: python/branches/py3k/Doc/library/hashlib.rst python/branches/py3k/Lib/test/test_hashlib.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_hashopenssl.c Modified: python/branches/py3k/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k/Doc/library/hashlib.rst (original) +++ python/branches/py3k/Doc/library/hashlib.rst Thu Jan 8 22:17:16 2009 @@ -37,6 +37,11 @@ .. note:: + For better multithreading performance, the Python GIL is released for + strings of more than 2047 bytes at object creation or on update. + +.. note:: + Feeding string objects is to :meth:`update` is not supported, as hashes work on bytes, not on characters. 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 Jan 8 22:17:16 2009 @@ -198,6 +198,19 @@ "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+ "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b") + def test_gil(self): + # Check things work fine with an input larger than the size required + # for multithreaded operation (which is hardwired to 2048). + gil_minsize = 2048 + + m = hashlib.md5() + m.update(b'1') + m.update(b'#' * gil_minsize) + m.update(b'1') + self.assertEquals(m.hexdigest(), 'cb1e1a2cbc80be75e19935d621fb9b21') + + m = hashlib.md5(b'x' * gil_minsize) + self.assertEquals(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958') def test_main(): support.run_unittest(HashLibTestCase) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 8 22:17:16 2009 @@ -256,6 +256,10 @@ Extension Modules ----------------- +- Issue #4751: hashlib now releases the GIL when hashing large buffers + (with a hardwired threshold of 2048 bytes), allowing better parallelization + on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner. + - Issue #4051: Prevent conflict of UNICODE macros in cPickle. - Issue #4738: Each zlib object now has a separate lock, allowing to compress Modified: python/branches/py3k/Modules/_hashopenssl.c ============================================================================== --- python/branches/py3k/Modules/_hashopenssl.c (original) +++ python/branches/py3k/Modules/_hashopenssl.c Thu Jan 8 22:17:16 2009 @@ -26,15 +26,35 @@ #define HASH_OBJ_CONSTRUCTOR 0 #endif +#define HASHLIB_GIL_MINSIZE 2048 + +#ifdef WITH_THREAD + #include "pythread.h" + + #define ENTER_HASHLIB(obj) \ + if ((obj)->lock) { \ + if (!PyThread_acquire_lock((obj)->lock, 0)) { \ + Py_BEGIN_ALLOW_THREADS \ + PyThread_acquire_lock((obj)->lock, 1); \ + Py_END_ALLOW_THREADS \ + } \ + } + #define LEAVE_HASHLIB(obj) \ + if ((obj)->lock) { \ + PyThread_release_lock((obj)->lock); \ + } +#else + #define ENTER_HASHLIB(obj) + #define LEAVE_HASHLIB(obj) +#endif + typedef struct { PyObject_HEAD PyObject *name; /* name of this hash algorithm */ - EVP_MD_CTX ctx; /* OpenSSL message digest context */ - /* - * TODO investigate performance impact of including a lock for this object - * here and releasing the Python GIL while hash updates are in progress. - * (perhaps only release GIL if input length will take long to process?) - */ + EVP_MD_CTX ctx; /* OpenSSL message digest context */ +#ifdef WITH_THREAD + PyThread_type_lock lock; /* OpenSSL context lock */ +#endif } EVPobject; @@ -63,19 +83,42 @@ if (retval != NULL) { Py_INCREF(name); retval->name = name; +#ifdef WITH_THREAD + retval->lock = NULL; +#endif } return retval; } +static void +EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len) +{ + unsigned int process; + const unsigned char *cp = (const unsigned char *)vp; + while (0 < len) { + if (len > (Py_ssize_t)MUNCH_SIZE) + process = MUNCH_SIZE; + else + process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int); + EVP_DigestUpdate(&self->ctx, (const void*)cp, process); + len -= process; + cp += process; + } +} + /* Internal methods for a hash object */ static void -EVP_dealloc(PyObject *ptr) +EVP_dealloc(EVPobject *self) { - EVP_MD_CTX_cleanup(&((EVPobject *)ptr)->ctx); - Py_XDECREF(((EVPobject *)ptr)->name); - PyObject_Del(ptr); +#ifdef WITH_THREAD + if (self->lock != NULL) + PyThread_free_lock(self->lock); +#endif + EVP_MD_CTX_cleanup(&self->ctx); + Py_XDECREF(self->name); + PyObject_Del(self); } @@ -91,7 +134,9 @@ if ( (newobj = newEVPobject(self->name))==NULL) return NULL; + ENTER_HASHLIB(self); EVP_MD_CTX_copy(&newobj->ctx, &self->ctx); + LEAVE_HASHLIB(self); return (PyObject *)newobj; } @@ -106,7 +151,9 @@ PyObject *retval; unsigned int digest_size; + ENTER_HASHLIB(self); EVP_MD_CTX_copy(&temp_ctx, &self->ctx); + LEAVE_HASHLIB(self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -128,7 +175,9 @@ unsigned int i, j, digest_size; /* Get the raw (binary) digest value */ + ENTER_HASHLIB(self); EVP_MD_CTX_copy(&temp_ctx, &self->ctx); + LEAVE_HASHLIB(self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -137,16 +186,16 @@ /* Allocate a new buffer */ hex_digest = PyMem_Malloc(digest_size * 2 + 1); if (!hex_digest) - return PyErr_NoMemory(); + return PyErr_NoMemory(); /* Make hex version of the digest */ for(i=j=0; i> 4) & 0xf; - c = (c>9) ? c+'a'-10 : c + '0'; + c = (c>9) ? c+'a'-10 : c + '0'; hex_digest[j++] = c; c = (digest[i] & 0xf); - c = (c>9) ? c+'a'-10 : c + '0'; + c = (c>9) ? c+'a'-10 : c + '0'; hex_digest[j++] = c; } retval = PyUnicode_FromStringAndSize(hex_digest, digest_size * 2); @@ -155,21 +204,26 @@ } #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); + 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."); @@ -184,41 +238,60 @@ return NULL; MY_GET_BUFFER_VIEW_OR_ERROUT(obj, &view); - if (view.len > 0 && view.len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, view.buf, view.len); - } else { - Py_ssize_t offset = 0, len = view.len; - while (len) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf + offset, process); - len -= process; - offset += process; + +#ifdef WITH_THREAD + if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) { + self->lock = PyThread_allocate_lock(); + if (self->lock == NULL) { + PyBuffer_Release(&view); + PyErr_SetString(PyExc_MemoryError, "unable to allocate lock"); + return NULL; } } - PyBuffer_Release(&view); - Py_INCREF(Py_None); - return Py_None; + if (self->lock != NULL) { + Py_BEGIN_ALLOW_THREADS + PyThread_acquire_lock(self->lock, 1); + EVP_hash(self, view.buf, view.len); + PyThread_release_lock(self->lock); + Py_END_ALLOW_THREADS + } else { + EVP_hash(self, view.buf, view.len); + } +#else + EVP_hash(self, view.buf, view.len); +#endif + + PyBuffer_Release(&view); + Py_RETURN_NONE; } static PyMethodDef EVP_methods[] = { - {"update", (PyCFunction)EVP_update, METH_VARARGS, EVP_update__doc__}, - {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__}, + {"update", (PyCFunction)EVP_update, METH_VARARGS, EVP_update__doc__}, + {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__}, {"hexdigest", (PyCFunction)EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__}, - {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__}, - {NULL, NULL} /* sentinel */ + {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__}, + {NULL, NULL} /* sentinel */ }; static PyObject * EVP_get_block_size(EVPobject *self, void *closure) { - return PyLong_FromLong(EVP_MD_CTX_block_size(&((EVPobject *)self)->ctx)); + long block_size; + ENTER_HASHLIB(self); + block_size = EVP_MD_CTX_block_size(&self->ctx); + LEAVE_HASHLIB(self); + return PyLong_FromLong(block_size); } static PyObject * EVP_get_digest_size(EVPobject *self, void *closure) { - return PyLong_FromLong(EVP_MD_CTX_size(&((EVPobject *)self)->ctx)); + long size; + ENTER_HASHLIB(self); + size = EVP_MD_CTX_size(&self->ctx); + LEAVE_HASHLIB(self); + return PyLong_FromLong(size); } static PyMemberDef EVP_members[] = { @@ -246,11 +319,11 @@ static PyObject * -EVP_repr(PyObject *self) +EVP_repr(EVPobject *self) { char buf[100]; PyOS_snprintf(buf, sizeof(buf), "<%s HASH object @ %p>", - _PyUnicode_AsString(((EVPobject *)self)->name), self); + _PyUnicode_AsString(self->name), self); return PyUnicode_FromString(buf); } @@ -293,21 +366,16 @@ Py_INCREF(self->name); if (data_obj) { - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + if (view.len >= HASHLIB_GIL_MINSIZE) { + Py_BEGIN_ALLOW_THREADS + EVP_hash(self, view.buf, view.len); + Py_END_ALLOW_THREADS } else { - Py_ssize_t offset = 0, len = view.len; - while (len) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf + offset, process); - len -= process; - offset += process; - } + EVP_hash(self, view.buf, view.len); } PyBuffer_Release(&view); } - + return 0; } #endif @@ -332,15 +400,15 @@ static PyTypeObject EVPtype = { PyVarObject_HEAD_INIT(NULL, 0) "_hashlib.HASH", /*tp_name*/ - sizeof(EVPobject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + sizeof(EVPobject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - EVP_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ + (destructor)EVP_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ - EVP_repr, /*tp_repr*/ + (reprfunc)EVP_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ @@ -353,13 +421,13 @@ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ hashtype_doc, /*tp_doc*/ 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - EVP_methods, /* tp_methods */ - EVP_members, /* tp_members */ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + EVP_methods, /* tp_methods */ + EVP_members, /* tp_members */ EVP_getseters, /* tp_getset */ #if 1 0, /* tp_base */ @@ -395,17 +463,12 @@ } if (cp && len) { - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + if (len >= HASHLIB_GIL_MINSIZE) { + Py_BEGIN_ALLOW_THREADS + EVP_hash(self, cp, len); + Py_END_ALLOW_THREADS } else { - Py_ssize_t offset = 0; - while (len) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, cp + offset, process); - len -= process; - offset += process; - } + EVP_hash(self, cp, len); } } @@ -522,7 +585,7 @@ CONSTRUCTOR_METH_DEF(sha256), CONSTRUCTOR_METH_DEF(sha384), CONSTRUCTOR_METH_DEF(sha512), - {NULL, NULL} /* Sentinel */ + {NULL, NULL} /* Sentinel */ }; @@ -530,15 +593,15 @@ static struct PyModuleDef _hashlibmodule = { - PyModuleDef_HEAD_INIT, - "_hashlib", - NULL, - -1, - EVP_functions, - NULL, - NULL, - NULL, - NULL + PyModuleDef_HEAD_INIT, + "_hashlib", + NULL, + -1, + EVP_functions, + NULL, + NULL, + NULL, + NULL }; PyMODINIT_FUNC From python-checkins at python.org Thu Jan 8 22:20:46 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Thu, 8 Jan 2009 22:20:46 +0100 (CET) Subject: [Python-checkins] r68412 - in sandbox/trunk/io-c: _fileio.c _textio.c Message-ID: <20090108212046.69AA11E4039@bag.python.org> Author: amaury.forgeotdarc Date: Thu Jan 8 22:20:46 2009 New Revision: 68412 Log: Correct some reference leaks Modified: sandbox/trunk/io-c/_fileio.c sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_fileio.c ============================================================================== --- sandbox/trunk/io-c/_fileio.c (original) +++ sandbox/trunk/io-c/_fileio.c Thu Jan 8 22:20:46 2009 @@ -337,6 +337,8 @@ } } + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *)self); } Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 22:20:46 2009 @@ -92,6 +92,14 @@ return 0; } +static void +IncrementalNewlineDecoder_dealloc(PyNewLineDecoderObject *self) +{ + Py_CLEAR(self->decoder); + Py_CLEAR(self->errors); + Py_TYPE(self)->tp_free((PyObject *)self); +} + #define SEEN_CR 1 #define SEEN_LF 2 #define SEEN_CRLF 4 @@ -357,7 +365,7 @@ "IncrementalNewlineDecoder", /*tp_name*/ sizeof(PyNewLineDecoderObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ - 0, /*tp_dealloc*/ + (destructor)IncrementalNewlineDecoder_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ From python-checkins at python.org Thu Jan 8 22:45:04 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Thu, 8 Jan 2009 22:45:04 +0100 (CET) Subject: [Python-checkins] r68413 - in sandbox/trunk/io-c: _bufferedio.c _iobase.c _iomodule.h _textio.c Message-ID: <20090108214504.236991E4022@bag.python.org> Author: amaury.forgeotdarc Date: Thu Jan 8 22:45:03 2009 New Revision: 68413 Log: Probably a hack: when calling _PyIOBase_checkClosed &co from C code, return a borrowed reference, since all that matters is the comparition to NULL. Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iobase.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Thu Jan 8 22:45:03 2009 @@ -813,7 +813,7 @@ return -1; } - if (_PyIOBase_checkReadable(raw, NULL) == NULL) + if (_PyIOBase_checkReadable(raw, Py_True) == NULL) return -1; Py_CLEAR(self->raw); @@ -1183,7 +1183,7 @@ return -1; } - if (_PyIOBase_checkWritable(raw, NULL) == NULL) + if (_PyIOBase_checkWritable(raw, Py_True) == NULL) return -1; Py_CLEAR(self->raw); @@ -1520,9 +1520,9 @@ return -1; } - if (_PyIOBase_checkReadable(reader, NULL) == NULL) + if (_PyIOBase_checkReadable(reader, Py_True) == NULL) return -1; - if (_PyIOBase_checkWritable(writer, NULL) == NULL) + if (_PyIOBase_checkWritable(writer, Py_True) == NULL) return -1; args = Py_BuildValue("(n)", buffer_size); @@ -1730,11 +1730,11 @@ return -1; } - if (_PyIOBase_checkSeekable(raw, NULL) == NULL) + if (_PyIOBase_checkSeekable(raw, Py_True) == NULL) return -1; - if (_PyIOBase_checkReadable(raw, NULL) == NULL) + if (_PyIOBase_checkReadable(raw, Py_True) == NULL) return -1; - if (_PyIOBase_checkWritable(raw, NULL) == NULL) + if (_PyIOBase_checkWritable(raw, Py_True) == NULL) return -1; Py_CLEAR(self->raw); Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Thu Jan 8 22:45:03 2009 @@ -133,13 +133,16 @@ PyObject * -_PyIOBase_checkClosed(PyObject *self, PyObject *unused) +_PyIOBase_checkClosed(PyObject *self, PyObject *args) { if (IOBase_closed(self)) { PyErr_SetString(PyExc_ValueError, "I/O operation on closed file."); return NULL; } - Py_RETURN_NONE; + if (args == Py_True) + return Py_None; + else + Py_RETURN_NONE; } /* XXX: IOBase thinks it has to maintain its own internal state in @@ -201,7 +204,7 @@ } PyObject * -_PyIOBase_checkSeekable(PyObject *self, PyObject *unused) +_PyIOBase_checkSeekable(PyObject *self, PyObject *args) { PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_seekable, NULL); if (res == NULL) @@ -210,6 +213,8 @@ Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not seekable."); } + if (args == Py_True) + Py_DECREF(res); return res; } @@ -226,7 +231,7 @@ /* May be called with any object */ PyObject * -_PyIOBase_checkReadable(PyObject *self, PyObject *unused) +_PyIOBase_checkReadable(PyObject *self, PyObject *args) { PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_readable, NULL); if (res == NULL) @@ -235,6 +240,8 @@ Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not readable."); } + if (args == Py_True) + Py_DECREF(res); return res; } @@ -251,7 +258,7 @@ /* May be called with any object */ PyObject * -_PyIOBase_checkWritable(PyObject *self, PyObject *unused) +_PyIOBase_checkWritable(PyObject *self, PyObject *args) { PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_writable, NULL); if (res == NULL) @@ -260,6 +267,8 @@ Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not writable."); } + if (args == Py_True) + Py_DECREF(res); return res; } @@ -268,7 +277,7 @@ static PyObject * IOBase_enter(PyObject *self, PyObject *args) { - if (_PyIOBase_checkClosed(self, NULL) == NULL) + if (_PyIOBase_checkClosed(self, Py_True) == NULL) return NULL; Py_INCREF(self); @@ -304,7 +313,7 @@ static PyObject * IOBase_isatty(PyObject *self, PyObject *args) { - if (_PyIOBase_checkClosed(self, NULL) == NULL) + if (_PyIOBase_checkClosed(self, Py_True) == NULL) return NULL; Py_RETURN_FALSE; } @@ -334,7 +343,7 @@ return NULL; } - if (_PyIOBase_checkClosed(self, NULL) == NULL) + if (_PyIOBase_checkClosed(self, Py_True) == NULL) return NULL; if (PyObject_HasAttrString(self, "peek")) @@ -406,7 +415,7 @@ static PyObject * IOBase_iter(PyObject *self) { - if (_PyIOBase_checkClosed(self, NULL) == NULL) + if (_PyIOBase_checkClosed(self, Py_True) == NULL) return NULL; Py_INCREF(self); @@ -502,7 +511,7 @@ return NULL; } - if (_PyIOBase_checkClosed(self, NULL) == NULL) + if (_PyIOBase_checkClosed(self, Py_True) == NULL) return NULL; iter = PyObject_GetIter(lines); Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Thu Jan 8 22:45:03 2009 @@ -30,10 +30,14 @@ extern PyTypeObject PyTextIOWrapper_Type; extern PyTypeObject PyIncrementalNewlineDecoder_Type; -extern PyObject* _PyIOBase_checkReadable(PyObject *self, PyObject *unused); -extern PyObject* _PyIOBase_checkWritable(PyObject *self, PyObject *unused); -extern PyObject* _PyIOBase_checkSeekable(PyObject *self, PyObject *unused); -extern PyObject* _PyIOBase_checkClosed(PyObject *self, PyObject *unused); +/* These functions are used as METH_NOARGS methods, are normally called + * with args=NULL, and return a new reference. + * BUT when args=Py_True is passed, they return a borrowed reference. + */ +extern PyObject* _PyIOBase_checkReadable(PyObject *self, PyObject *args); +extern PyObject* _PyIOBase_checkWritable(PyObject *self, PyObject *args); +extern PyObject* _PyIOBase_checkSeekable(PyObject *self, PyObject *args); +extern PyObject* _PyIOBase_checkClosed(PyObject *self, PyObject *args); extern PyObject* PyIOExc_UnsupportedOperation; Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 8 22:45:03 2009 @@ -655,7 +655,7 @@ return NULL; } - if (_PyIOBase_checkClosed((PyObject *)self, NULL) == NULL) + if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) return NULL; Py_INCREF(text); @@ -928,7 +928,7 @@ return NULL; } - if (_PyIOBase_checkClosed((PyObject *)self, NULL) == NULL) + if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) return NULL; /* Grab all the decoded text (we will rewind any extra bits later). */ @@ -1192,7 +1192,7 @@ return NULL; Py_INCREF(cookieObj); - if (_PyIOBase_checkClosed((PyObject *)self, NULL) == NULL) + if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) goto fail; if (!self->seekable) { From buildbot at python.org Thu Jan 8 22:46:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 08 Jan 2009 21:46:55 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090108214655.3F6D31E4002@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/74 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 Thu Jan 8 22:59:05 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Thu, 8 Jan 2009 22:59:05 +0100 (CET) Subject: [Python-checkins] r68414 - in sandbox/trunk/io-c: _bufferedio.c _iobase.c Message-ID: <20090108215905.4FCDE1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Thu Jan 8 22:59:05 2009 New Revision: 68414 Log: kill two more causes of ref leaks Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Thu Jan 8 22:59:05 2009 @@ -358,6 +358,8 @@ else goto end; } + Py_XDECREF(res); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL); end: Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Thu Jan 8 22:59:05 2009 @@ -166,6 +166,7 @@ else return NULL; } + Py_XDECREF(res); Py_RETURN_NONE; } From buildbot at python.org Thu Jan 8 23:27:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 08 Jan 2009 22:27:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090108222758.E30631E4002@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/38 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: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 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' sincerely, -The Buildbot From buildbot at python.org Thu Jan 8 23:46:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 08 Jan 2009 22:46:30 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090108224630.71E001E4002@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/66 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 python-checkins at python.org Fri Jan 9 00:56:31 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 9 Jan 2009 00:56:31 +0100 (CET) Subject: [Python-checkins] r68415 - in python/trunk: Doc/distutils/packageindex.rst Doc/distutils/uploading.rst Doc/whatsnew/2.7.rst Lib/distutils/command/register.py Lib/distutils/command/upload.py Lib/distutils/config.py Lib/distutils/dist.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_upload.py Message-ID: <20090108235631.AAD441E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 9 00:56:31 2009 New Revision: 68415 Log: fixed #4394 make the storage of the password optional in .pypirc Modified: python/trunk/Doc/distutils/packageindex.rst python/trunk/Doc/distutils/uploading.rst python/trunk/Doc/whatsnew/2.7.rst python/trunk/Lib/distutils/command/register.py python/trunk/Lib/distutils/command/upload.py python/trunk/Lib/distutils/config.py python/trunk/Lib/distutils/dist.py python/trunk/Lib/distutils/tests/test_register.py python/trunk/Lib/distutils/tests/test_upload.py Modified: python/trunk/Doc/distutils/packageindex.rst ============================================================================== --- python/trunk/Doc/distutils/packageindex.rst (original) +++ python/trunk/Doc/distutils/packageindex.rst Fri Jan 9 00:56:31 2009 @@ -8,17 +8,17 @@ packaged with distutils. The distutils command :command:`register` is used to submit your distribution's meta-data to the index. It is invoked as follows:: - python setup.py register + python setup.py register Distutils will respond with the following prompt:: - running register - We need to know who you are, so please choose either: - 1. use your existing login, - 2. register as a new user, - 3. have the server generate a new password for you (and email it to you), or - 4. quit - Your selection [default 1]: + running register + We need to know who you are, so please choose either: + 1. use your existing login, + 2. register as a new user, + 3. have the server generate a new password for you (and email it to you), or + 4. quit + Your selection [default 1]: Note: if your username and password are saved locally, you will not see this menu. @@ -55,40 +55,50 @@ The format of the :file:`.pypirc` file is as follows:: - [distutils] - index-servers = - pypi + [distutils] + index-servers = + pypi - [pypi] - repository: - username: - password: + [pypi] + repository: + username: + password: -*repository* can be omitted and defaults to ``http://www.python.org/pypi``. +The *distutils* section defines a *index-servers* variable that lists the +name of all sections describing a repository. -If you want to define another server a new section can be created:: +Each section describing a repository defines three variables: - [distutils] - index-servers = - pypi - other +- *repository*, that defines the url of the PyPI server. Defaults to + ``http://www.python.org/pypi``. +- *username*, which is the registered username on the PyPI server. +- *password*, that will be used to authenticate. If omitted the user + will be prompt to type it when needed. - [pypi] - repository: - username: - password: +If you want to define another server a new section can be created and +listed in the *index-servers* variable:: - [other] - repository: http://example.com/pypi - username: - password: + [distutils] + index-servers = + pypi + other -The command can then be called with the -r option:: + [pypi] + repository: + username: + password: - python setup.py register -r http://example.com/pypi + [other] + repository: http://example.com/pypi + username: + password: -Or even with the section name:: +:command:`register` can then be called with the -r option to point the +repository to work with:: - python setup.py register -r other + python setup.py register -r http://example.com/pypi +The name of the section that describes the repository may also be used +for conveniency:: + python setup.py register -r other Modified: python/trunk/Doc/distutils/uploading.rst ============================================================================== --- python/trunk/Doc/distutils/uploading.rst (original) +++ python/trunk/Doc/distutils/uploading.rst Fri Jan 9 00:56:31 2009 @@ -13,7 +13,7 @@ The command is invoked immediately after building one or more distribution files. For example, the command :: - python setup.py sdist bdist_wininst upload + python setup.py sdist bdist_wininst upload will cause the source distribution and the Windows installer to be uploaded to PyPI. Note that these will be uploaded even if they are built using an earlier @@ -22,11 +22,14 @@ The :command:`upload` command uses the username, password, and repository URL from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this -file). +file). If a :command:`register` command was previously called in the same command, +and if the password was entered in the prompt, :command:`upload` will reuse the +entered password. This is useful if you do not want to store a clear text +password in the :file:`$HOME/.pypirc` file. You can specify another PyPI server with the :option:`--repository=*url*` option:: - python setup.py sdist bdist_wininst upload -r http://example.com/pypi + python setup.py sdist bdist_wininst upload -r http://example.com/pypi See section :ref:`pypirc` for more on defining several servers. @@ -40,4 +43,3 @@ *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). - Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Fri Jan 9 00:56:31 2009 @@ -120,6 +120,12 @@ (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`.) .. ====================================================================== .. whole new modules get described in subsections here Modified: python/trunk/Lib/distutils/command/register.py ============================================================================== --- python/trunk/Lib/distutils/command/register.py (original) +++ python/trunk/Lib/distutils/command/register.py Fri Jan 9 00:56:31 2009 @@ -173,19 +173,23 @@ log.INFO) # possibly save the login - if not self.has_config and code == 200: - self.announce(('I can store your PyPI login so future ' - 'submissions will be faster.'), log.INFO) - self.announce('(the login will be stored in %s)' % \ - self._get_rc_file(), log.INFO) - - choice = 'X' - while choice.lower() not in 'yn': - choice = raw_input('Save your login (y/N)?') - if not choice: - choice = 'n' - if choice.lower() == 'y': - self._store_pypirc(username, password) + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = raw_input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} Modified: python/trunk/Lib/distutils/command/upload.py ============================================================================== --- python/trunk/Lib/distutils/command/upload.py (original) +++ python/trunk/Lib/distutils/command/upload.py Fri Jan 9 00:56:31 2009 @@ -50,6 +50,11 @@ self.repository = config['repository'] self.realm = config['realm'] + # getting the password from the distribution + # if previously set by the register command + if not self.password and self.distribution.password: + self.password = self.distribution.password + def run(self): if not self.distribution.dist_files: raise DistutilsOptionError("No dist file created in earlier command") Modified: python/trunk/Lib/distutils/config.py ============================================================================== --- python/trunk/Lib/distutils/config.py (original) +++ python/trunk/Lib/distutils/config.py Fri Jan 9 00:56:31 2009 @@ -82,12 +82,12 @@ for server in _servers: current = {'server': server} current['username'] = config.get(server, 'username') - current['password'] = config.get(server, 'password') # optional params for key, default in (('repository', self.DEFAULT_REPOSITORY), - ('realm', self.DEFAULT_REALM)): + ('realm', self.DEFAULT_REALM), + ('password', None)): if config.has_option(server, key): current[key] = config.get(server, key) else: Modified: python/trunk/Lib/distutils/dist.py ============================================================================== --- python/trunk/Lib/distutils/dist.py (original) +++ python/trunk/Lib/distutils/dist.py Fri Jan 9 00:56:31 2009 @@ -206,6 +206,7 @@ self.extra_path = None self.scripts = None self.data_files = None + self.password = '' # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to Modified: python/trunk/Lib/distutils/tests/test_register.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_register.py (original) +++ python/trunk/Lib/distutils/tests/test_register.py Fri Jan 9 00:56:31 2009 @@ -2,6 +2,7 @@ import sys import os import unittest +import getpass from distutils.command.register import register from distutils.core import Distribution @@ -9,6 +10,26 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + +WANTED_PYPIRC = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:password +""" + class RawInputs(object): """Fakes user inputs.""" def __init__(self, *answers): @@ -21,18 +42,33 @@ finally: self.index += 1 -WANTED_PYPIRC = """\ -[distutils] -index-servers = - pypi - -[pypi] -username:tarek -password:xxx -""" +class FakeServer(object): + """Fakes a PyPI server""" + def __init__(self): + self.calls = [] + + def __call__(self, *args): + # we want to compare them, so let's store + # something comparable + els = args[0].items() + els.sort() + self.calls.append(tuple(els)) + return 200, 'OK' class registerTestCase(PyPIRCCommandTestCase): + def setUp(self): + PyPIRCCommandTestCase.setUp(self) + # patching the password prompt + self._old_getpass = getpass.getpass + def _getpass(prompt): + return 'password' + getpass.getpass = _getpass + + def tearDown(self): + getpass.getpass = self._old_getpass + PyPIRCCommandTestCase.tearDown(self) + def test_create_pypirc(self): # this test makes sure a .pypirc file # is created when requested. @@ -56,25 +92,11 @@ # Here's what we are faking : # use your existing login (choice 1.) # Username : 'tarek' - # Password : 'xxx' + # Password : 'password' # Save your login (y/N)? : 'y' inputs = RawInputs('1', 'tarek', 'y') from distutils.command import register as register_module register_module.raw_input = inputs.__call__ - def _getpass(prompt): - return 'xxx' - register_module.getpass.getpass = _getpass - class FakeServer(object): - def __init__(self): - self.calls = [] - - def __call__(self, *args): - # we want to compare them, so let's store - # something comparable - els = args[0].items() - els.sort() - self.calls.append(tuple(els)) - return 200, 'OK' cmd.post_to_server = pypi_server = FakeServer() @@ -102,6 +124,24 @@ self.assert_(len(pypi_server.calls), 2) self.assert_(pypi_server.calls[0], pypi_server.calls[1]) + def test_password_not_in_file(self): + + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + dist = Distribution() + cmd = register(dist) + cmd.post_to_server = FakeServer() + + cmd._set_config() + cmd.finalize_options() + cmd.send_metadata() + + # dist.password should be set + # therefore used afterwards by other commands + self.assertEquals(dist.password, 'password') + def test_suite(): return unittest.makeSuite(registerTestCase) Modified: python/trunk/Lib/distutils/tests/test_upload.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_upload.py (original) +++ python/trunk/Lib/distutils/tests/test_upload.py Fri Jan 9 00:56:31 2009 @@ -9,6 +9,17 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + + class uploadTestCase(PyPIRCCommandTestCase): def test_finalize_options(self): @@ -26,6 +37,24 @@ ('repository', 'http://pypi.python.org/pypi')): self.assertEquals(getattr(cmd, attr), waited) + def test_saved_password(self): + # file with no password + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + # make sure it passes + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, None) + + # make sure we get it as well, if another command + # initialized it at the dist level + dist.password = 'xxx' + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, 'xxx') def test_suite(): return unittest.makeSuite(uploadTestCase) From python-checkins at python.org Fri Jan 9 00:58:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 9 Jan 2009 00:58:52 +0100 (CET) Subject: [Python-checkins] r68416 - python/branches/release26-maint Message-ID: <20090108235852.0FF571E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 9 00:58:51 2009 New Revision: 68416 Log: Blocked revisions 68415 via svnmerge ........ r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line fixed #4394 make the storage of the password optional in .pypirc ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Fri Jan 9 01:04:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 00:04:23 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090109000424.05CE61E4002@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/35 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Jan 9 01:15:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 9 Jan 2009 01:15:46 +0100 (CET) Subject: [Python-checkins] r68417 - in python/branches/py3k: Doc/distutils/packageindex.rst Doc/distutils/uploading.rst Doc/whatsnew/2.7.rst Lib/distutils/command/register.py Lib/distutils/command/upload.py Lib/distutils/config.py Lib/distutils/dist.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_upload.py Message-ID: <20090109001546.2B7711E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 9 01:15:45 2009 New Revision: 68417 Log: Merged revisions 68415 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line fixed #4394 make the storage of the password optional in .pypirc ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/packageindex.rst python/branches/py3k/Doc/distutils/uploading.rst python/branches/py3k/Doc/whatsnew/2.7.rst python/branches/py3k/Lib/distutils/command/register.py python/branches/py3k/Lib/distutils/command/upload.py python/branches/py3k/Lib/distutils/config.py python/branches/py3k/Lib/distutils/dist.py python/branches/py3k/Lib/distutils/tests/test_register.py python/branches/py3k/Lib/distutils/tests/test_upload.py Modified: python/branches/py3k/Doc/distutils/packageindex.rst ============================================================================== --- python/branches/py3k/Doc/distutils/packageindex.rst (original) +++ python/branches/py3k/Doc/distutils/packageindex.rst Fri Jan 9 01:15:45 2009 @@ -8,17 +8,17 @@ packaged with distutils. The distutils command :command:`register` is used to submit your distribution's meta-data to the index. It is invoked as follows:: - python setup.py register + python setup.py register Distutils will respond with the following prompt:: - running register - We need to know who you are, so please choose either: - 1. use your existing login, - 2. register as a new user, - 3. have the server generate a new password for you (and email it to you), or - 4. quit - Your selection [default 1]: + running register + We need to know who you are, so please choose either: + 1. use your existing login, + 2. register as a new user, + 3. have the server generate a new password for you (and email it to you), or + 4. quit + Your selection [default 1]: Note: if your username and password are saved locally, you will not see this menu. @@ -55,40 +55,50 @@ The format of the :file:`.pypirc` file is as follows:: - [distutils] - index-servers = - pypi + [distutils] + index-servers = + pypi - [pypi] - repository: - username: - password: + [pypi] + repository: + username: + password: -*repository* can be omitted and defaults to ``http://www.python.org/pypi``. +The *distutils* section defines a *index-servers* variable that lists the +name of all sections describing a repository. -If you want to define another server a new section can be created:: +Each section describing a repository defines three variables: - [distutils] - index-servers = - pypi - other +- *repository*, that defines the url of the PyPI server. Defaults to + ``http://www.python.org/pypi``. +- *username*, which is the registered username on the PyPI server. +- *password*, that will be used to authenticate. If omitted the user + will be prompt to type it when needed. - [pypi] - repository: - username: - password: +If you want to define another server a new section can be created and +listed in the *index-servers* variable:: - [other] - repository: http://example.com/pypi - username: - password: + [distutils] + index-servers = + pypi + other -The command can then be called with the -r option:: + [pypi] + repository: + username: + password: - python setup.py register -r http://example.com/pypi + [other] + repository: http://example.com/pypi + username: + password: -Or even with the section name:: +:command:`register` can then be called with the -r option to point the +repository to work with:: - python setup.py register -r other + python setup.py register -r http://example.com/pypi +The name of the section that describes the repository may also be used +for conveniency:: + python setup.py register -r other Modified: python/branches/py3k/Doc/distutils/uploading.rst ============================================================================== --- python/branches/py3k/Doc/distutils/uploading.rst (original) +++ python/branches/py3k/Doc/distutils/uploading.rst Fri Jan 9 01:15:45 2009 @@ -11,7 +11,7 @@ The command is invoked immediately after building one or more distribution files. For example, the command :: - python setup.py sdist bdist_wininst upload + python setup.py sdist bdist_wininst upload will cause the source distribution and the Windows installer to be uploaded to PyPI. Note that these will be uploaded even if they are built using an earlier @@ -20,11 +20,14 @@ The :command:`upload` command uses the username, password, and repository URL from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this -file). +file). If a :command:`register` command was previously called in the same command, +and if the password was entered in the prompt, :command:`upload` will reuse the +entered password. This is useful if you do not want to store a clear text +password in the :file:`$HOME/.pypirc` file. You can specify another PyPI server with the :option:`--repository=*url*` option:: - python setup.py sdist bdist_wininst upload -r http://example.com/pypi + python setup.py sdist bdist_wininst upload -r http://example.com/pypi See section :ref:`pypirc` for more on defining several servers. @@ -38,4 +41,3 @@ *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). - 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 Jan 9 01:15:45 2009 @@ -120,6 +120,12 @@ (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`.) .. ====================================================================== .. whole new modules get described in subsections here Modified: python/branches/py3k/Lib/distutils/command/register.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/register.py (original) +++ python/branches/py3k/Lib/distutils/command/register.py Fri Jan 9 01:15:45 2009 @@ -174,19 +174,23 @@ log.INFO) # possibly save the login - if not self.has_config and code == 200: - self.announce(('I can store your PyPI login so future ' - 'submissions will be faster.'), log.INFO) - self.announce('(the login will be stored in %s)' % \ - self._get_rc_file(), log.INFO) - - choice = 'X' - while choice.lower() not in 'yn': - choice = input('Save your login (y/N)?') - if not choice: - choice = 'n' - if choice.lower() == 'y': - self._store_pypirc(username, password) + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} 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 Jan 9 01:15:45 2009 @@ -48,6 +48,11 @@ self.repository = config['repository'] self.realm = config['realm'] + # getting the password from the distribution + # if previously set by the register command + if not self.password and self.distribution.password: + self.password = self.distribution.password + def run(self): if not self.distribution.dist_files: raise DistutilsOptionError("No dist file created in earlier command") Modified: python/branches/py3k/Lib/distutils/config.py ============================================================================== --- python/branches/py3k/Lib/distutils/config.py (original) +++ python/branches/py3k/Lib/distutils/config.py Fri Jan 9 01:15:45 2009 @@ -82,12 +82,12 @@ for server in _servers: current = {'server': server} current['username'] = config.get(server, 'username') - current['password'] = config.get(server, 'password') # optional params for key, default in (('repository', self.DEFAULT_REPOSITORY), - ('realm', self.DEFAULT_REALM)): + ('realm', self.DEFAULT_REALM), + ('password', None)): if config.has_option(server, key): current[key] = config.get(server, key) else: Modified: python/branches/py3k/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/dist.py (original) +++ python/branches/py3k/Lib/distutils/dist.py Fri Jan 9 01:15:45 2009 @@ -199,6 +199,7 @@ self.extra_path = None self.scripts = None self.data_files = None + self.password = '' # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to Modified: python/branches/py3k/Lib/distutils/tests/test_register.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_register.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_register.py Fri Jan 9 01:15:45 2009 @@ -2,6 +2,7 @@ import sys import os import unittest +import getpass from distutils.command.register import register from distutils.core import Distribution @@ -9,7 +10,27 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase -class RawInputs(object): +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + +WANTED_PYPIRC = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:password +""" + +class Inputs(object): """Fakes user inputs.""" def __init__(self, *answers): self.answers = answers @@ -21,18 +42,33 @@ finally: self.index += 1 -WANTED_PYPIRC = """\ -[distutils] -index-servers = - pypi - -[pypi] -username:tarek -password:xxx -""" +class FakeServer(object): + """Fakes a PyPI server""" + def __init__(self): + self.calls = [] + + def __call__(self, *args): + # we want to compare them, so let's store + # something comparable + els = list(args[0].items()) + els.sort() + self.calls.append(tuple(els)) + return 200, 'OK' class registerTestCase(PyPIRCCommandTestCase): + def setUp(self): + PyPIRCCommandTestCase.setUp(self) + # patching the password prompt + self._old_getpass = getpass.getpass + def _getpass(prompt): + return 'password' + getpass.getpass = _getpass + + def tearDown(self): + getpass.getpass = self._old_getpass + PyPIRCCommandTestCase.tearDown(self) + def test_create_pypirc(self): # this test makes sure a .pypirc file # is created when requested. @@ -50,30 +86,17 @@ # we shouldn't have a .pypirc file yet self.assert_(not os.path.exists(self.rc)) - # patching raw_input and getpass.getpass + # patching input and getpass.getpass # so register gets happy # # Here's what we are faking : # use your existing login (choice 1.) # Username : 'tarek' - # Password : 'xxx' + # Password : 'password' # Save your login (y/N)? : 'y' - inputs = RawInputs('1', 'tarek', 'y') + inputs = Inputs('1', 'tarek', 'y') from distutils.command import register as register_module register_module.input = inputs.__call__ - def _getpass(prompt): - return 'xxx' - register_module.getpass.getpass = _getpass - class FakeServer(object): - def __init__(self): - self.calls = [] - - def __call__(self, *args): - # we want to compare them, so let's store - # something comparable - els = sorted(args[0].items()) - self.calls.append(tuple(els)) - return 200, 'OK' cmd.post_to_server = pypi_server = FakeServer() @@ -101,6 +124,24 @@ self.assert_(len(pypi_server.calls), 2) self.assert_(pypi_server.calls[0], pypi_server.calls[1]) + def test_password_not_in_file(self): + + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + dist = Distribution() + cmd = register(dist) + cmd.post_to_server = FakeServer() + + cmd._set_config() + cmd.finalize_options() + cmd.send_metadata() + + # dist.password should be set + # therefore used afterwards by other commands + self.assertEquals(dist.password, 'password') + def test_suite(): return unittest.makeSuite(registerTestCase) Modified: python/branches/py3k/Lib/distutils/tests/test_upload.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_upload.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_upload.py Fri Jan 9 01:15:45 2009 @@ -9,6 +9,17 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + + class uploadTestCase(PyPIRCCommandTestCase): def test_finalize_options(self): @@ -26,6 +37,24 @@ ('repository', 'http://pypi.python.org/pypi')): self.assertEquals(getattr(cmd, attr), waited) + def test_saved_password(self): + # file with no password + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + # make sure it passes + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, None) + + # make sure we get it as well, if another command + # initialized it at the dist level + dist.password = 'xxx' + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, 'xxx') def test_suite(): return unittest.makeSuite(uploadTestCase) From python-checkins at python.org Fri Jan 9 01:17:40 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 9 Jan 2009 01:17:40 +0100 (CET) Subject: [Python-checkins] r68418 - python/branches/release30-maint Message-ID: <20090109001740.53DA71E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 9 01:17:40 2009 New Revision: 68418 Log: Blocked revisions 68417 via svnmerge ................ r68417 | tarek.ziade | 2009-01-09 01:15:45 +0100 (Fri, 09 Jan 2009) | 9 lines Merged revisions 68415 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line fixed #4394 make the storage of the password optional in .pypirc ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Jan 9 01:21:30 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 9 Jan 2009 01:21:30 +0100 (CET) Subject: [Python-checkins] r68419 - in sandbox/trunk/io-c: _bufferedio.c _iobase.c _textio.c Message-ID: <20090109002130.C47AF1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Jan 9 01:21:30 2009 New Revision: 68419 Log: Kill more reference leaks Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iobase.c sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Fri Jan 9 01:21:30 2009 @@ -882,14 +882,14 @@ static PyObject * _BufferedReader_read_unlocked(BufferedObject *self, Py_ssize_t n) { - PyObject *data, *chunks, *res = NULL; + PyObject *data, *res = NULL; Py_ssize_t current_size, remaining, written; char *out; static PyObject *sep = NULL; /* Special case for when the number of bytes to read is unspecified. */ if (n == -1) { - chunks = PyList_New(0); + PyObject *chunks = PyList_New(0); if (chunks == NULL) return NULL; @@ -908,8 +908,10 @@ /* We're going past the buffer's bounds, flush it */ if (self->writable) { res = _BufferedWriter_flush_unlocked(self, 1); - if (res == NULL) + if (res == NULL) { + Py_DECREF(chunks); return NULL; + } Py_CLEAR(res); } while (1) { @@ -949,6 +951,7 @@ } } res =_PyBytes_Join(sep, chunks); + Py_DECREF(data); Py_DECREF(chunks); return res; } @@ -1533,7 +1536,7 @@ return -1; } self->reader = (BufferedObject *)PyType_GenericNew( - &PyBufferedReader_Type, args, NULL); + &PyBufferedReader_Type, args, NULL); Py_DECREF(args); if (self->reader == NULL) return -1; @@ -1544,7 +1547,7 @@ return -1; } self->writer = (BufferedObject *)PyType_GenericNew( - &PyBufferedWriter_Type, args, NULL); + &PyBufferedWriter_Type, args, NULL); Py_DECREF(args); if (self->writer == NULL) { Py_CLEAR(self->reader); Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Fri Jan 9 01:21:30 2009 @@ -391,8 +391,10 @@ if (b == NULL) goto fail; assert(PyBytes_Check(b)); - if (Py_SIZE(b) == 0) + if (Py_SIZE(b) == 0) { + Py_DECREF(b); break; + } old_size = Py_SIZE(buffer); PyByteArray_Resize(buffer, old_size + Py_SIZE(b)); @@ -452,7 +454,7 @@ IOBase_readlines(PyObject *self, PyObject *args) { Py_ssize_t hint = -1, length = 0; - PyObject *hintobj = Py_None, *line, *result; + PyObject *hintobj = Py_None, *result; if (!PyArg_ParseTuple(args, "|O:readlines", &hintobj)) { return NULL; @@ -478,7 +480,7 @@ } while (1) { - line = PyObject_CallMethod(self, "__next__", NULL); + PyObject *line = PyIter_Next(self, "__next__"); if (line == NULL) { if (PyErr_Occurred()) { Py_DECREF(result); @@ -487,7 +489,6 @@ else break; /* SopIteration raised */ } - assert (PyBytes_Check(line)); if (PyList_Append(result, line) < 0) { Py_DECREF(line); Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 9 01:21:30 2009 @@ -291,12 +291,16 @@ if (state == NULL) return NULL; - if (!PyArg_Parse(state, "(OK)", &buffer, &flag)) + if (!PyArg_Parse(state, "(OK)", &buffer, &flag)) { + Py_DECREF(state); return NULL; + } + Py_INCREF(buffer); + Py_DECREF(state); flag <<= 1; if (self->pendingcr) flag |= 1; - return Py_BuildValue("OK", buffer, flag); + return Py_BuildValue("NK", buffer, flag); } static PyObject * @@ -871,6 +875,7 @@ goto fail; decoded = PyObject_CallMethod(self->decoder, "decode", "Oi", bytes, /*final=*/1); + Py_DECREF(bytes); if (decoded == NULL) goto fail; @@ -1481,6 +1486,7 @@ Py_DECREF(saved_state); if (res == NULL) return NULL; + Py_DECREF(res); /* The returned cookie corresponds to the last safe start point. */ cookie.chars_to_skip = Py_SAFE_DOWNCAST(chars_to_skip, Py_ssize_t, int); From python-checkins at python.org Fri Jan 9 01:33:43 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 9 Jan 2009 01:33:43 +0100 (CET) Subject: [Python-checkins] r68420 - sandbox/trunk/io-c/_textio.c Message-ID: <20090109003343.5642B1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Jan 9 01:33:43 2009 New Revision: 68420 Log: PyUnicode_FromUnicode(NULL, 0) always return the same object... this caused a reference leak. Make sure we really creates a fresh object. Skip the whole block if the string is empty. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 9 01:33:43 2009 @@ -187,6 +187,9 @@ in_str = PyUnicode_AS_UNICODE(output); len = PyUnicode_GET_SIZE(output); + if (len == 0) + return output; + /* If, up to now, newlines are consistently \n, do a quick check for the \r *byte* with the libc's optimized memchr. */ @@ -222,7 +225,7 @@ PyObject *translated = NULL; Py_UNICODE *out_str; Py_ssize_t out; - if (Py_REFCNT(output) != 1 || len < 2) { + if (Py_REFCNT(output) != 1) { /* We could try to optimize this so that we only do a copy when there is something to translate. On the other hand, most decoders should only output non-shared strings, i.e. @@ -230,6 +233,7 @@ translated = PyUnicode_FromUnicode(NULL, len); if (translated == NULL) goto error; + assert(Py_REFCNT(translated) == 1); memcpy(PyUnicode_AS_UNICODE(translated), PyUnicode_AS_UNICODE(output), len * sizeof(Py_UNICODE)); @@ -292,7 +296,7 @@ return NULL; if (!PyArg_Parse(state, "(OK)", &buffer, &flag)) { - Py_DECREF(state); + Py_DECREF(state); return NULL; } Py_INCREF(buffer); @@ -875,7 +879,7 @@ goto fail; decoded = PyObject_CallMethod(self->decoder, "decode", "Oi", bytes, /*final=*/1); - Py_DECREF(bytes); + Py_DECREF(bytes); if (decoded == NULL) goto fail; From python-checkins at python.org Fri Jan 9 01:46:57 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 9 Jan 2009 01:46:57 +0100 (CET) Subject: [Python-checkins] r68421 - sandbox/trunk/io-c/_iobase.c Message-ID: <20090109004657.AF7ED1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Jan 9 01:46:57 2009 New Revision: 68421 Log: Don't crash when iterating over a StringIO Modified: sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Fri Jan 9 01:46:57 2009 @@ -433,9 +433,7 @@ if (line == NULL) return NULL; - assert (PyBytes_Check(line)); - - if (PyBytes_GET_SIZE(line) == 0) { + if (PyObject_Size(line) == 0) { Py_DECREF(line); return NULL; } @@ -495,7 +493,7 @@ Py_DECREF(result); return NULL; } - length += Py_SIZE(line); + length += PyObject_Size(line); Py_DECREF(line); if (length > hint) From buildbot at python.org Fri Jan 9 02:08:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 01:08:04 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090109010804.D10A91E4002@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/76 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 python-checkins at python.org Fri Jan 9 03:01:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 03:01:04 +0100 (CET) Subject: [Python-checkins] r68422 - in sandbox/trunk/2to3/lib2to3/fixes: fix_imports.py fix_imports2.py Message-ID: <20090109020104.2A5DC1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 03:01:03 2009 New Revision: 68422 Log: run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py sandbox/trunk/2to3/lib2to3/fixes/fix_imports2.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Fri Jan 9 03:01:03 2009 @@ -88,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports2.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports2.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports2.py Fri Jan 9 03:01:03 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - run_order = 6 + run_order = 7 mapping = MAPPING From python-checkins at python.org Fri Jan 9 03:13:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 03:13:35 +0100 (CET) Subject: [Python-checkins] r68423 - in python/trunk/Lib/lib2to3: fixes/fix_imports.py fixes/fix_imports2.py fixes/fix_urllib.py pgen2/driver.py Message-ID: <20090109021335.1848D1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 03:13:34 2009 New Revision: 68423 Log: Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ Modified: python/trunk/Lib/lib2to3/ (props changed) python/trunk/Lib/lib2to3/fixes/fix_imports.py python/trunk/Lib/lib2to3/fixes/fix_imports2.py python/trunk/Lib/lib2to3/fixes/fix_urllib.py python/trunk/Lib/lib2to3/pgen2/driver.py Modified: python/trunk/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_imports.py Fri Jan 9 03:13:34 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', @@ -89,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) Modified: python/trunk/Lib/lib2to3/fixes/fix_imports2.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_imports2.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_imports2.py Fri Jan 9 03:13:34 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - run_order = 6 + run_order = 7 mapping = MAPPING Modified: python/trunk/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_urllib.py Fri Jan 9 03:13:34 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -34,12 +37,12 @@ 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } - -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) def build_pattern(): Modified: python/trunk/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/trunk/Lib/lib2to3/pgen2/driver.py (original) +++ python/trunk/Lib/lib2to3/pgen2/driver.py Fri Jan 9 03:13:34 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): From python-checkins at python.org Fri Jan 9 03:53:36 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 03:53:36 +0100 (CET) Subject: [Python-checkins] r68424 - python/trunk/Doc/using/cmdline.rst Message-ID: <20090109025336.23BF71E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 03:53:35 2009 New Revision: 68424 Log: specify what -3 warnings are about Modified: python/trunk/Doc/using/cmdline.rst Modified: python/trunk/Doc/using/cmdline.rst ============================================================================== --- python/trunk/Doc/using/cmdline.rst (original) +++ python/trunk/Doc/using/cmdline.rst Fri Jan 9 03:53:35 2009 @@ -356,7 +356,8 @@ .. cmdoption:: -3 - Warn about Python 3.x incompatibilities. Among these are: + Warn about Python 3.x incompatibilities which cannot be fixed trivally by + :ref:`2to3 <2to3-reference>`. Among these are: * :meth:`dict.has_key` * :func:`apply` From python-checkins at python.org Fri Jan 9 03:56:32 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 03:56:32 +0100 (CET) Subject: [Python-checkins] r68425 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090109025632.997301E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 03:56:32 2009 New Revision: 68425 Log: fix markup Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Fri Jan 9 03:56:32 2009 @@ -121,11 +121,10 @@ (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`.) + :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`.) .. ====================================================================== .. whole new modules get described in subsections here From python-checkins at python.org Fri Jan 9 04:03:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:03:05 +0100 (CET) Subject: [Python-checkins] r68426 - python/trunk/Doc/using/cmdline.rst Message-ID: <20090109030305.E84CF1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:03:05 2009 New Revision: 68426 Log: fix spelling Modified: python/trunk/Doc/using/cmdline.rst Modified: python/trunk/Doc/using/cmdline.rst ============================================================================== --- python/trunk/Doc/using/cmdline.rst (original) +++ python/trunk/Doc/using/cmdline.rst Fri Jan 9 04:03:05 2009 @@ -356,7 +356,7 @@ .. cmdoption:: -3 - Warn about Python 3.x incompatibilities which cannot be fixed trivally by + Warn about Python 3.x incompatibilities which cannot be fixed trivially by :ref:`2to3 <2to3-reference>`. Among these are: * :meth:`dict.has_key` From python-checkins at python.org Fri Jan 9 04:03:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:03:23 +0100 (CET) Subject: [Python-checkins] r68427 - in python/branches/py3k: Doc/Makefile Doc/library/ctypes.rst Doc/library/ftplib.rst Doc/library/multiprocessing.rst Doc/library/stdtypes.rst Doc/make.bat Doc/tools Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/whatsnew/2.6.rst Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/pgen2/driver.py Misc/build.sh Message-ID: <20090109030323.BD7511E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:03:23 2009 New Revision: 68427 Log: Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line only check the actual compile() call for a SyntaxError ................ r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines Test commit. ................ r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. ................ r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines Fix two issues found by the suspicious builder. ................ r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line use Jinja 2.1.1 ................ r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines Update make.bat. ................ r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line Make sure to checkout any new packages ................ r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line string exceptions are gone ................ r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line use new sphinx modules ................ r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ ................ Added: python/branches/py3k/Doc/tools/sphinxext/susp-ignored.csv - copied unchanged from r68291, /python/trunk/Doc/tools/sphinxext/susp-ignored.csv python/branches/py3k/Doc/tools/sphinxext/suspicious.py - copied, changed from r68291, /python/trunk/Doc/tools/sphinxext/suspicious.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/Makefile python/branches/py3k/Doc/library/ctypes.rst python/branches/py3k/Doc/library/ftplib.rst python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Doc/make.bat python/branches/py3k/Doc/tools/ (props changed) python/branches/py3k/Doc/tools/rstlint.py python/branches/py3k/Doc/tools/sphinxext/pyspecific.py python/branches/py3k/Doc/whatsnew/2.6.rst python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py python/branches/py3k/Lib/lib2to3/pgen2/driver.py python/branches/py3k/Misc/build.sh Modified: python/branches/py3k/Doc/Makefile ============================================================================== --- python/branches/py3k/Doc/Makefile (original) +++ python/branches/py3k/Doc/Makefile Fri Jan 9 04:03:23 2009 @@ -24,6 +24,7 @@ @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" + @echo " suspicious to check for suspicious markup in output text" @echo " coverage to check documentation coverage for library and C API" @echo " dist to create a \"dist\" directory with archived docs for download" @@ -36,9 +37,9 @@ echo "Checking out Docutils..."; \ svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \ fi - @if [ ! -d tools/jinja ]; then \ + @if [ ! -d tools/jinja2 ]; then \ echo "Checking out Jinja..."; \ - svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \ + svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \ fi @if [ ! -d tools/pygments ]; then \ echo "Checking out Pygments..."; \ @@ -48,7 +49,7 @@ update: checkout svn update tools/sphinx svn update tools/docutils - svn update tools/jinja + svn update tools/jinja2 svn update tools/pygments build: checkout @@ -84,6 +85,11 @@ @echo "Link check complete; look for any errors in the above output " \ "or in build/$(BUILDER)/output.txt" +suspicious: BUILDER = suspicious +suspicious: build + @echo "Suspicious check complete; look for any errors in the above output " \ + "or in build/$(BUILDER)/suspicious.txt" + coverage: BUILDER = coverage coverage: build @echo "Coverage finished; see c.txt and python.txt in build/coverage" Modified: python/branches/py3k/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k/Doc/library/ctypes.rst (original) +++ python/branches/py3k/Doc/library/ctypes.rst Fri Jan 9 04:03:23 2009 @@ -1853,7 +1853,7 @@ :module: ctypes.util Try to find a library and return a pathname. *name* is the library name - without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix linker option :option:`-l`). If no library can be found, returns ``None``. Modified: python/branches/py3k/Doc/library/ftplib.rst ============================================================================== --- python/branches/py3k/Doc/library/ftplib.rst (original) +++ python/branches/py3k/Doc/library/ftplib.rst Fri Jan 9 04:03:23 2009 @@ -1,4 +1,3 @@ - :mod:`ftplib` --- FTP protocol client ===================================== Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Fri Jan 9 04:03:23 2009 @@ -1810,7 +1810,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the - form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Fri Jan 9 04:03:23 2009 @@ -322,6 +322,7 @@ module: math single: floor() (in module math) single: ceil() (in module math) + single: trunc() (in module math) pair: numeric; conversions pair: C; language Modified: python/branches/py3k/Doc/make.bat ============================================================================== --- python/branches/py3k/Doc/make.bat (original) +++ python/branches/py3k/Doc/make.bat Fri Jan 9 04:03:23 2009 @@ -8,34 +8,41 @@ if "%1" EQU "" goto help if "%1" EQU "html" goto build if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun +if "%1" EQU "latex" goto build +if "%1" EQU "text" goto build +if "%1" EQU "suspicious" goto build +if "%1" EQU "linkcheck" goto build +if "%1" EQU "changes" goto build if "%1" EQU "checkout" goto checkout if "%1" EQU "update" goto update :help +set this=%~n0 echo HELP echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun +echo %this% checkout +echo %this% update +echo %this% html +echo %this% htmlhelp +echo %this% latex +echo %this% text +echo %this% suspicious +echo %this% linkcheck +echo %this% changes echo. goto end :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments +svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils +svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2 +svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update svn update tools/sphinx svn update tools/docutils -svn update tools/jinja +svn update tools/jinja2 svn update tools/pygments goto end @@ -43,13 +50,8 @@ if not exist build mkdir build if not exist build\%1 mkdir build\%1 if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 +cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%* if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - :end Modified: python/branches/py3k/Doc/tools/rstlint.py ============================================================================== --- python/branches/py3k/Doc/tools/rstlint.py (original) +++ python/branches/py3k/Doc/tools/rstlint.py Fri Jan 9 04:03:23 2009 @@ -62,12 +62,12 @@ @checker('.py', severity=4) def check_syntax(fn, lines): """Check Python examples for valid syntax.""" + code = ''.join(lines) + if '\r' in code: + if os.name != 'nt': + yield 0, '\\r in code file' + code = code.replace('\r', '') try: - code = ''.join(lines) - if '\r' in code: - if os.name != 'nt': - yield 0, '\\r in code file' - code = code.replace('\r', '') compile(code, fn, 'exec') except SyntaxError as err: yield err.lineno, 'not compilable: %s' % err 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 Jan 9 04:03:23 2009 @@ -46,15 +46,9 @@ from docutils.io import StringOutput from docutils.utils import new_document -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 +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + class PydocTopicsBuilder(Builder): name = 'pydoc-topics' @@ -90,6 +84,9 @@ finally: f.close() +# Support for checking for suspicious markup + +import suspicious # Support for documenting Opcodes @@ -114,5 +111,6 @@ def setup(app): app.add_role('issue', issue_role) app.add_builder(PydocTopicsBuilder) + app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) Copied: python/branches/py3k/Doc/tools/sphinxext/suspicious.py (from r68291, /python/trunk/Doc/tools/sphinxext/suspicious.py) ============================================================================== --- /python/trunk/Doc/tools/sphinxext/suspicious.py (original) +++ python/branches/py3k/Doc/tools/sphinxext/suspicious.py Fri Jan 9 04:03:23 2009 @@ -45,7 +45,7 @@ import csv import re from docutils import nodes -from sphinx.builder import Builder +from sphinx.builders import Builder detect_all = re.compile(ur''' ::(?=[^=])| # two :: (but NOT ::=) Modified: python/branches/py3k/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.6.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.6.rst Fri Jan 9 04:03:23 2009 @@ -3217,6 +3217,9 @@ set ``__hash__ = None`` in their definitions to indicate the fact. +* String exceptions have been removed. Attempting to use them raises a + :exc:`TypeError`. + * The :meth:`__init__` method of :class:`collections.deque` now clears any existing contents of the deque before adding elements from the iterable. This change makes the Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py Fri Jan 9 04:03:23 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', @@ -89,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py Fri Jan 9 04:03:23 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - run_order = 6 + run_order = 7 mapping = MAPPING Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py Fri Jan 9 04:03:23 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -34,12 +37,12 @@ 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } - -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) def build_pattern(): Modified: python/branches/py3k/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/pgen2/driver.py (original) +++ python/branches/py3k/Lib/lib2to3/pgen2/driver.py Fri Jan 9 04:03:23 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): Modified: python/branches/py3k/Misc/build.sh ============================================================================== --- python/branches/py3k/Misc/build.sh (original) +++ python/branches/py3k/Misc/build.sh Fri Jan 9 04:03:23 2009 @@ -264,7 +264,7 @@ echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F err=1 else - make update html >& ../build/$F + make checkout update html >& ../build/$F err=$? fi update_status "Making doc" "$F" $start From python-checkins at python.org Fri Jan 9 04:04:01 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:04:01 +0100 (CET) Subject: [Python-checkins] r68428 - in python/branches/release26-maint: Doc/Makefile Doc/library/ctypes.rst Doc/library/ftplib.rst Doc/library/multiprocessing.rst Doc/library/stdtypes.rst Doc/make.bat Doc/tools Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/whatsnew/2.6.rst Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/pgen2/driver.py Message-ID: <20090109030401.A7D7C1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:04:01 2009 New Revision: 68428 Log: Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line only check the actual compile() call for a SyntaxError ................ r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines Test commit. ................ r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. ................ r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines Fix two issues found by the suspicious builder. ................ r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line use Jinja 2.1.1 ................ r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines Update make.bat. ................ r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line Make sure to checkout any new packages ................ r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line string exceptions are gone ................ r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line use new sphinx modules ................ r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ ................ Added: python/branches/release26-maint/Doc/tools/sphinxext/susp-ignored.csv - copied unchanged from r68291, /python/trunk/Doc/tools/sphinxext/susp-ignored.csv python/branches/release26-maint/Doc/tools/sphinxext/suspicious.py - copied, changed from r68291, /python/trunk/Doc/tools/sphinxext/suspicious.py Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/Makefile python/branches/release26-maint/Doc/library/ctypes.rst python/branches/release26-maint/Doc/library/ftplib.rst python/branches/release26-maint/Doc/library/multiprocessing.rst python/branches/release26-maint/Doc/library/stdtypes.rst python/branches/release26-maint/Doc/make.bat python/branches/release26-maint/Doc/tools/ (props changed) python/branches/release26-maint/Doc/tools/rstlint.py python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py python/branches/release26-maint/Doc/whatsnew/2.6.rst python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports2.py python/branches/release26-maint/Lib/lib2to3/fixes/fix_urllib.py python/branches/release26-maint/Lib/lib2to3/pgen2/driver.py Modified: python/branches/release26-maint/Doc/Makefile ============================================================================== --- python/branches/release26-maint/Doc/Makefile (original) +++ python/branches/release26-maint/Doc/Makefile Fri Jan 9 04:04:01 2009 @@ -24,6 +24,7 @@ @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" + @echo " suspicious to check for suspicious markup in output text" @echo " coverage to check documentation coverage for library and C API" @echo " dist to create a \"dist\" directory with archived docs for download" @@ -36,9 +37,9 @@ echo "Checking out Docutils..."; \ svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \ fi - @if [ ! -d tools/jinja ]; then \ + @if [ ! -d tools/jinja2 ]; then \ echo "Checking out Jinja..."; \ - svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \ + svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \ fi @if [ ! -d tools/pygments ]; then \ echo "Checking out Pygments..."; \ @@ -48,7 +49,7 @@ update: checkout svn update tools/sphinx svn update tools/docutils - svn update tools/jinja + svn update tools/jinja2 svn update tools/pygments build: checkout @@ -84,6 +85,11 @@ @echo "Link check complete; look for any errors in the above output " \ "or in build/$(BUILDER)/output.txt" +suspicious: BUILDER = suspicious +suspicious: build + @echo "Suspicious check complete; look for any errors in the above output " \ + "or in build/$(BUILDER)/suspicious.txt" + coverage: BUILDER = coverage coverage: build @echo "Coverage finished; see c.txt and python.txt in build/coverage" 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 Fri Jan 9 04:04:01 2009 @@ -1864,7 +1864,7 @@ :module: ctypes.util Try to find a library and return a pathname. *name* is the library name - without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix linker option :option:`-l`). If no library can be found, returns ``None``. Modified: python/branches/release26-maint/Doc/library/ftplib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ftplib.rst (original) +++ python/branches/release26-maint/Doc/library/ftplib.rst Fri Jan 9 04:04:01 2009 @@ -1,4 +1,3 @@ - :mod:`ftplib` --- FTP protocol client ===================================== Modified: python/branches/release26-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release26-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release26-maint/Doc/library/multiprocessing.rst Fri Jan 9 04:04:01 2009 @@ -1812,7 +1812,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the - form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. 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 Fri Jan 9 04:04:01 2009 @@ -338,7 +338,7 @@ module: math single: floor() (in module math) single: ceil() (in module math) - single: trunc() (in module math) + single: trunc() (in module math) pair: numeric; conversions Conversion from floats using :func:`int` or :func:`long` truncates toward Modified: python/branches/release26-maint/Doc/make.bat ============================================================================== --- python/branches/release26-maint/Doc/make.bat (original) +++ python/branches/release26-maint/Doc/make.bat Fri Jan 9 04:04:01 2009 @@ -8,34 +8,41 @@ if "%1" EQU "" goto help if "%1" EQU "html" goto build if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun +if "%1" EQU "latex" goto build +if "%1" EQU "text" goto build +if "%1" EQU "suspicious" goto build +if "%1" EQU "linkcheck" goto build +if "%1" EQU "changes" goto build if "%1" EQU "checkout" goto checkout if "%1" EQU "update" goto update :help +set this=%~n0 echo HELP echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun +echo %this% checkout +echo %this% update +echo %this% html +echo %this% htmlhelp +echo %this% latex +echo %this% text +echo %this% suspicious +echo %this% linkcheck +echo %this% changes echo. goto end :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments +svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils +svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2 +svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update svn update tools/sphinx svn update tools/docutils -svn update tools/jinja +svn update tools/jinja2 svn update tools/pygments goto end @@ -43,13 +50,8 @@ if not exist build mkdir build if not exist build\%1 mkdir build\%1 if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 +cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%* if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - :end 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 Fri Jan 9 04:04:01 2009 @@ -62,12 +62,12 @@ @checker('.py', severity=4) def check_syntax(fn, lines): """Check Python examples for valid syntax.""" + code = ''.join(lines) + if '\r' in code: + if os.name != 'nt': + yield 0, '\\r in code file' + code = code.replace('\r', '') try: - code = ''.join(lines) - if '\r' in code: - if os.name != 'nt': - yield 0, '\\r in code file' - code = code.replace('\r', '') compile(code, fn, 'exec') except SyntaxError, err: yield err.lineno, 'not compilable: %s' % err 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 Fri Jan 9 04:04:01 2009 @@ -48,15 +48,9 @@ from docutils.io import StringOutput from docutils.utils import new_document -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 +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + class PydocTopicsBuilder(Builder): name = 'pydoc-topics' @@ -92,6 +86,9 @@ finally: f.close() +# Support for checking for suspicious markup + +import suspicious # Support for documenting Opcodes @@ -116,5 +113,6 @@ def setup(app): app.add_role('issue', issue_role) app.add_builder(PydocTopicsBuilder) + app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) Copied: python/branches/release26-maint/Doc/tools/sphinxext/suspicious.py (from r68291, /python/trunk/Doc/tools/sphinxext/suspicious.py) ============================================================================== --- /python/trunk/Doc/tools/sphinxext/suspicious.py (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/suspicious.py Fri Jan 9 04:04:01 2009 @@ -45,7 +45,7 @@ import csv import re from docutils import nodes -from sphinx.builder import Builder +from sphinx.builders import Builder detect_all = re.compile(ur''' ::(?=[^=])| # two :: (but NOT ::=) Modified: python/branches/release26-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.6.rst Fri Jan 9 04:04:01 2009 @@ -3213,6 +3213,9 @@ set ``__hash__ = None`` in their definitions to indicate the fact. +* String exceptions have been removed. Attempting to use them raises a + :exc:`TypeError`. + * The :meth:`__init__` method of :class:`collections.deque` now clears any existing contents of the deque before adding elements from the iterable. This change makes the Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports.py Fri Jan 9 04:04:01 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', @@ -89,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports2.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports2.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_imports2.py Fri Jan 9 04:04:01 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - run_order = 6 + run_order = 7 mapping = MAPPING Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_urllib.py Fri Jan 9 04:04:01 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -34,12 +37,12 @@ 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } - -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) def build_pattern(): Modified: python/branches/release26-maint/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/pgen2/driver.py (original) +++ python/branches/release26-maint/Lib/lib2to3/pgen2/driver.py Fri Jan 9 04:04:01 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): From python-checkins at python.org Fri Jan 9 04:05:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:05:15 +0100 (CET) Subject: [Python-checkins] r68429 - python/trunk/Misc/python.man Message-ID: <20090109030515.249EA1E4020@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:05:14 2009 New Revision: 68429 Log: add -3 to manpage Modified: python/trunk/Misc/python.man Modified: python/trunk/Misc/python.man ============================================================================== --- python/trunk/Misc/python.man (original) +++ python/trunk/Misc/python.man Fri Jan 9 04:05:14 2009 @@ -54,6 +54,9 @@ [ .B \-x ] +[ +.B \-3 +] .br [ .B \-c @@ -236,6 +239,9 @@ Skip the first line of the source. This is intended for a DOS specific hack only. Warning: the line numbers in error messages will be off by one! +.TP +.B \-3 +Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix. .SH INTERPRETER INTERFACE The interpreter interface resembles that of the UNIX shell: when called with standard input connected to a tty device, it prompts for From python-checkins at python.org Fri Jan 9 04:07:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:07:27 +0100 (CET) Subject: [Python-checkins] r68430 - python/trunk/Modules/main.c Message-ID: <20090109030727.CCD7C1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:07:27 2009 New Revision: 68430 Log: be more specific in -3 option help Modified: python/trunk/Modules/main.c Modified: python/trunk/Modules/main.c ============================================================================== --- python/trunk/Modules/main.c (original) +++ python/trunk/Modules/main.c Fri Jan 9 04:07:27 2009 @@ -86,7 +86,7 @@ -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ "; static char *usage_4 = "\ --3 : warn about Python 3.x incompatibilities\n\ +-3 : warn about Python 3.x incompatibilities that 2to3 cannot trivially fix\n\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ arg ...: arguments passed to program in sys.argv[1:]\n\n\ From python-checkins at python.org Fri Jan 9 04:12:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:12:39 +0100 (CET) Subject: [Python-checkins] r68431 - in python/branches/release30-maint: Doc/Makefile Doc/library/ctypes.rst Doc/library/ftplib.rst Doc/library/multiprocessing.rst Doc/library/stdtypes.rst Doc/make.bat Doc/tools Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/whatsnew/2.6.rst Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/pgen2/driver.py Misc/build.sh Message-ID: <20090109031239.ABD5A1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:12:39 2009 New Revision: 68431 Log: Merged revisions 68427 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68427 | benjamin.peterson | 2009-01-08 21:03:23 -0600 (Thu, 08 Jan 2009) | 74 lines Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line only check the actual compile() call for a SyntaxError ................ r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines Test commit. ................ r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. ................ r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines Fix two issues found by the suspicious builder. ................ r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line use Jinja 2.1.1 ................ r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines Update make.bat. ................ r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line Make sure to checkout any new packages ................ r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line string exceptions are gone ................ r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line use new sphinx modules ................ r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ ................ ................ Added: python/branches/release30-maint/Doc/tools/sphinxext/susp-ignored.csv - copied unchanged from r68427, /python/branches/py3k/Doc/tools/sphinxext/susp-ignored.csv python/branches/release30-maint/Doc/tools/sphinxext/suspicious.py - copied unchanged from r68427, /python/branches/py3k/Doc/tools/sphinxext/suspicious.py Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/Makefile python/branches/release30-maint/Doc/library/ctypes.rst python/branches/release30-maint/Doc/library/ftplib.rst python/branches/release30-maint/Doc/library/multiprocessing.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/make.bat python/branches/release30-maint/Doc/tools/ (props changed) python/branches/release30-maint/Doc/tools/rstlint.py python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py python/branches/release30-maint/Doc/whatsnew/2.6.rst python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports2.py python/branches/release30-maint/Lib/lib2to3/fixes/fix_urllib.py python/branches/release30-maint/Lib/lib2to3/pgen2/driver.py python/branches/release30-maint/Misc/build.sh Modified: python/branches/release30-maint/Doc/Makefile ============================================================================== --- python/branches/release30-maint/Doc/Makefile (original) +++ python/branches/release30-maint/Doc/Makefile Fri Jan 9 04:12:39 2009 @@ -24,6 +24,7 @@ @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" + @echo " suspicious to check for suspicious markup in output text" @echo " coverage to check documentation coverage for library and C API" @echo " dist to create a \"dist\" directory with archived docs for download" @@ -36,9 +37,9 @@ echo "Checking out Docutils..."; \ svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \ fi - @if [ ! -d tools/jinja ]; then \ + @if [ ! -d tools/jinja2 ]; then \ echo "Checking out Jinja..."; \ - svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \ + svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \ fi @if [ ! -d tools/pygments ]; then \ echo "Checking out Pygments..."; \ @@ -48,7 +49,7 @@ update: checkout svn update tools/sphinx svn update tools/docutils - svn update tools/jinja + svn update tools/jinja2 svn update tools/pygments build: checkout @@ -84,6 +85,11 @@ @echo "Link check complete; look for any errors in the above output " \ "or in build/$(BUILDER)/output.txt" +suspicious: BUILDER = suspicious +suspicious: build + @echo "Suspicious check complete; look for any errors in the above output " \ + "or in build/$(BUILDER)/suspicious.txt" + coverage: BUILDER = coverage coverage: build @echo "Coverage finished; see c.txt and python.txt in build/coverage" 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 Jan 9 04:12:39 2009 @@ -1853,7 +1853,7 @@ :module: ctypes.util Try to find a library and return a pathname. *name* is the library name - without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version + without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix linker option :option:`-l`). If no library can be found, returns ``None``. Modified: python/branches/release30-maint/Doc/library/ftplib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/ftplib.rst (original) +++ python/branches/release30-maint/Doc/library/ftplib.rst Fri Jan 9 04:12:39 2009 @@ -1,4 +1,3 @@ - :mod:`ftplib` --- FTP protocol client ===================================== Modified: python/branches/release30-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release30-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release30-maint/Doc/library/multiprocessing.rst Fri Jan 9 04:12:39 2009 @@ -1810,7 +1810,7 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the - form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. 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 Fri Jan 9 04:12:39 2009 @@ -322,6 +322,7 @@ module: math single: floor() (in module math) single: ceil() (in module math) + single: trunc() (in module math) pair: numeric; conversions pair: C; language Modified: python/branches/release30-maint/Doc/make.bat ============================================================================== --- python/branches/release30-maint/Doc/make.bat (original) +++ python/branches/release30-maint/Doc/make.bat Fri Jan 9 04:12:39 2009 @@ -8,34 +8,41 @@ if "%1" EQU "" goto help if "%1" EQU "html" goto build if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun +if "%1" EQU "latex" goto build +if "%1" EQU "text" goto build +if "%1" EQU "suspicious" goto build +if "%1" EQU "linkcheck" goto build +if "%1" EQU "changes" goto build if "%1" EQU "checkout" goto checkout if "%1" EQU "update" goto update :help +set this=%~n0 echo HELP echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun +echo %this% checkout +echo %this% update +echo %this% html +echo %this% htmlhelp +echo %this% latex +echo %this% text +echo %this% suspicious +echo %this% linkcheck +echo %this% changes echo. goto end :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments +svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils +svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2 +svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update svn update tools/sphinx svn update tools/docutils -svn update tools/jinja +svn update tools/jinja2 svn update tools/pygments goto end @@ -43,13 +50,8 @@ if not exist build mkdir build if not exist build\%1 mkdir build\%1 if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 +cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%* if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - :end Modified: python/branches/release30-maint/Doc/tools/rstlint.py ============================================================================== --- python/branches/release30-maint/Doc/tools/rstlint.py (original) +++ python/branches/release30-maint/Doc/tools/rstlint.py Fri Jan 9 04:12:39 2009 @@ -62,12 +62,12 @@ @checker('.py', severity=4) def check_syntax(fn, lines): """Check Python examples for valid syntax.""" + code = ''.join(lines) + if '\r' in code: + if os.name != 'nt': + yield 0, '\\r in code file' + code = code.replace('\r', '') try: - code = ''.join(lines) - if '\r' in code: - if os.name != 'nt': - yield 0, '\\r in code file' - code = code.replace('\r', '') compile(code, fn, 'exec') except SyntaxError as err: yield err.lineno, 'not compilable: %s' % err 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 Jan 9 04:12:39 2009 @@ -46,15 +46,9 @@ from docutils.io import StringOutput from docutils.utils import new_document -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 +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + class PydocTopicsBuilder(Builder): name = 'pydoc-topics' @@ -90,6 +84,9 @@ finally: f.close() +# Support for checking for suspicious markup + +import suspicious # Support for documenting Opcodes @@ -114,5 +111,6 @@ def setup(app): app.add_role('issue', issue_role) app.add_builder(PydocTopicsBuilder) + app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) Modified: python/branches/release30-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.6.rst Fri Jan 9 04:12:39 2009 @@ -3217,6 +3217,9 @@ set ``__hash__ = None`` in their definitions to indicate the fact. +* String exceptions have been removed. Attempting to use them raises a + :exc:`TypeError`. + * The :meth:`__init__` method of :class:`collections.deque` now clears any existing contents of the deque before adding elements from the iterable. This change makes the Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports.py Fri Jan 9 04:12:39 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', @@ -89,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports2.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports2.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_imports2.py Fri Jan 9 04:12:39 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - run_order = 6 + run_order = 7 mapping = MAPPING Modified: python/branches/release30-maint/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/branches/release30-maint/Lib/lib2to3/fixes/fix_urllib.py Fri Jan 9 04:12:39 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -34,12 +37,12 @@ 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } - -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) def build_pattern(): Modified: python/branches/release30-maint/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/branches/release30-maint/Lib/lib2to3/pgen2/driver.py (original) +++ python/branches/release30-maint/Lib/lib2to3/pgen2/driver.py Fri Jan 9 04:12:39 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): Modified: python/branches/release30-maint/Misc/build.sh ============================================================================== --- python/branches/release30-maint/Misc/build.sh (original) +++ python/branches/release30-maint/Misc/build.sh Fri Jan 9 04:12:39 2009 @@ -264,7 +264,7 @@ echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F err=1 else - make update html >& ../build/$F + make checkout update html >& ../build/$F err=$? fi update_status "Making doc" "$F" $start From python-checkins at python.org Fri Jan 9 04:15:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:15:00 +0100 (CET) Subject: [Python-checkins] r68432 - python/trunk/Misc/build.sh Message-ID: <20090109031500.B760B1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:15:00 2009 New Revision: 68432 Log: remove temporary code now Modified: python/trunk/Misc/build.sh Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Fri Jan 9 04:15:00 2009 @@ -247,10 +247,6 @@ cd $DIR/Doc F="make-doc.out" start=`current_time` - -# Temporary measure to fix build problem -rm -rf tools/sphinx/jinja - # XXX(nnorwitz): For now, keep the code that checks for a conflicted file until # after the first release of 2.6a1 or 3.0a1. At that point, it will be clear # if there will be a similar problem with the new doc system. From python-checkins at python.org Fri Jan 9 04:16:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:16:55 +0100 (CET) Subject: [Python-checkins] r68433 - python/branches/py3k Message-ID: <20090109031655.AA7391E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:16:55 2009 New Revision: 68433 Log: Blocked revisions 68424-68426,68429-68430 via svnmerge ........ r68424 | benjamin.peterson | 2009-01-08 20:53:35 -0600 (Thu, 08 Jan 2009) | 1 line specify what -3 warnings are about ........ r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line fix markup ........ r68426 | benjamin.peterson | 2009-01-08 21:03:05 -0600 (Thu, 08 Jan 2009) | 1 line fix spelling ........ r68429 | benjamin.peterson | 2009-01-08 21:05:14 -0600 (Thu, 08 Jan 2009) | 1 line add -3 to manpage ........ r68430 | benjamin.peterson | 2009-01-08 21:07:27 -0600 (Thu, 08 Jan 2009) | 1 line be more specific in -3 option help ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Jan 9 04:24:30 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:24:30 +0100 (CET) Subject: [Python-checkins] r68434 - python/branches/py3k Message-ID: <20090109032430.111DF1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:24:29 2009 New Revision: 68434 Log: Blocked revisions 68243,68395,68432 via svnmerge ........ r68243 | georg.brandl | 2009-01-03 16:15:42 -0600 (Sat, 03 Jan 2009) | 2 lines Add temporary code to fix the automatic doc build failure. ........ r68395 | raymond.hettinger | 2009-01-08 00:39:04 -0600 (Thu, 08 Jan 2009) | 1 line Forward port r68394 for issue 4816. ........ r68432 | benjamin.peterson | 2009-01-08 21:15:00 -0600 (Thu, 08 Jan 2009) | 1 line remove temporary code now ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Jan 9 04:32:46 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 9 Jan 2009 04:32:46 +0100 (CET) Subject: [Python-checkins] r68435 - in python/trunk/PC/VC6: bz2.dsp readme.txt Message-ID: <20090109033246.B99841E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 9 04:32:46 2009 New Revision: 68435 Log: Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5) Modified: python/trunk/PC/VC6/bz2.dsp python/trunk/PC/VC6/readme.txt Modified: python/trunk/PC/VC6/bz2.dsp ============================================================================== --- python/trunk/PC/VC6/bz2.dsp (original) +++ python/trunk/PC/VC6/bz2.dsp Fri Jan 9 04:32:46 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/trunk/PC/VC6/readme.txt ============================================================================== --- python/trunk/PC/VC6/readme.txt (original) +++ python/trunk/PC/VC6/readme.txt Fri Jan 9 04:32:46 2009 @@ -109,18 +109,18 @@ bz2 Python wrapper for the libbz2 compression library. Homepage - http://sources.redhat.com/bzip2/ + http://www.bzip.org/ Download the source from the python.org copy into the dist directory: - svn export http://svn.python.org/projects/external/bzip2-1.0.3 + svn export http://svn.python.org/projects/external/bzip2-1.0.5 And requires building bz2 first. - cd dist\bzip2-1.0.3 + cd dist\bzip2-1.0.5 nmake -f makefile.msc - All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python + All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python project links in. From python-checkins at python.org Fri Jan 9 04:42:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 04:42:38 +0100 (CET) Subject: [Python-checkins] r68436 - in python/branches/py3k: Lib/unittest.py Message-ID: <20090109034238.3B2001E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 04:42:38 2009 New Revision: 68436 Log: Merged revisions 67985 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67985 | antoine.pitrou | 2008-12-28 10:01:11 -0600 (Sun, 28 Dec 2008) | 4 lines Issue #2153: modernize coding style of unittest.py, remove obsolete compatibility stuff. Patch by Virgil Dupras. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/unittest.py Modified: python/branches/py3k/Lib/unittest.py ============================================================================== --- python/branches/py3k/Lib/unittest.py (original) +++ python/branches/py3k/Lib/unittest.py Fri Jan 9 04:42:38 2009 @@ -73,7 +73,7 @@ __unittest = 1 -class TestResult: +class TestResult(object): """Holder for test result information. Test results are automatically managed by the TestCase and TestSuite @@ -149,7 +149,7 @@ (_strclass(self.__class__), self.testsRun, len(self.errors), len(self.failures)) -class AssertRaisesContext: +class AssertRaisesContext(object): def __init__(self, expected, test_case, callable_obj=None): self.expected = expected self.failureException = test_case.failureException @@ -179,7 +179,7 @@ # Let unexpected exceptions skip through return False -class TestCase: +class TestCase(object): """A class whose instances are single test cases. By default, the test code itself should be placed in a method named @@ -217,8 +217,8 @@ testMethod = getattr(self, methodName) self._testMethodDoc = testMethod.__doc__ except AttributeError: - raise ValueError("no such test method in %s: %s" - % (self.__class__, methodName)) + raise ValueError("no such test method in %s: %s" % \ + (self.__class__, methodName)) def setUp(self): "Hook method for setting up the test fixture before exercising it." @@ -273,9 +273,7 @@ try: try: self.setUp() - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) return @@ -285,16 +283,12 @@ ok = True except self.failureException: result.addFailure(self, self._exc_info()) - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) try: self.tearDown() - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) ok = False if ok: result.addSuccess(self) @@ -372,8 +366,8 @@ as significant digits (measured from the most signficant digit). """ if round(abs(second-first), places) != 0: - raise self.failureException(msg or '%r != %r within %r places' - % (first, second, places)) + raise self.failureException( + msg or '%r != %r within %r places' % (first, second, places)) def failIfAlmostEqual(self, first, second, *, places=7, msg=None): """Fail if the two objects are equal as determined by their @@ -384,8 +378,8 @@ as significant digits (measured from the most signficant digit). """ if round(abs(second-first), places) == 0: - raise self.failureException(msg or '%r == %r within %r places' - % (first, second, places)) + raise self.failureException( + msg or '%r == %r within %r places' % (first, second, places)) # Synonyms for assertion methods @@ -405,7 +399,7 @@ -class TestSuite: +class TestSuite(object): """A test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. @@ -545,7 +539,7 @@ return mycmp(self.obj, other.obj) == -1 return K -class TestLoader: +class TestLoader(object): """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ @@ -596,7 +590,7 @@ for part in parts: parent, obj = obj, getattr(obj, part) - if type(obj) == types.ModuleType: + if isinstance(obj, types.ModuleType): return self.loadTestsFromModule(obj) elif isinstance(obj, type) and issubclass(obj, TestCase): return self.loadTestsFromTestCase(obj) @@ -672,7 +666,7 @@ # Text UI ############################################################################## -class _WritelnDecorator: +class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream @@ -751,7 +745,7 @@ self.stream.writeln("%s" % err) -class TextTestRunner: +class TextTestRunner(object): """A test runner class that displays results in textual form. It prints out the names of tests as they are run, errors as they @@ -797,7 +791,7 @@ # Facilities for running tests from the command line ############################################################################## -class TestProgram: +class TestProgram(object): """A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. """ @@ -819,7 +813,7 @@ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=defaultTestLoader): - if type(module) == type(''): + if isinstance(module, basestring): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) From buildbot at python.org Fri Jan 9 04:53:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 03:53:45 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090109035345.569231E4002@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/37 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket ====================================================================== ERROR: testShutdown (test.test_socket.BasicTCPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_socket.py", line 120, in _tearDown self.fail(msg) AssertionError: [Errno 57] Socket is not connected make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 9 04:56:58 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 9 Jan 2009 04:56:58 +0100 (CET) Subject: [Python-checkins] r68437 - in python/branches/release26-maint: PC/VC6/bz2.dsp PC/VC6/readme.txt Message-ID: <20090109035658.49F8C1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 9 04:56:58 2009 New Revision: 68437 Log: Merged revisions 68435 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68435 | hirokazu.yamamoto | 2009-01-09 12:32:46 +0900 | 1 line Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/PC/VC6/bz2.dsp python/branches/release26-maint/PC/VC6/readme.txt Modified: python/branches/release26-maint/PC/VC6/bz2.dsp ============================================================================== --- python/branches/release26-maint/PC/VC6/bz2.dsp (original) +++ python/branches/release26-maint/PC/VC6/bz2.dsp Fri Jan 9 04:56:58 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/release26-maint/PC/VC6/readme.txt ============================================================================== --- python/branches/release26-maint/PC/VC6/readme.txt (original) +++ python/branches/release26-maint/PC/VC6/readme.txt Fri Jan 9 04:56:58 2009 @@ -109,18 +109,18 @@ bz2 Python wrapper for the libbz2 compression library. Homepage - http://sources.redhat.com/bzip2/ + http://www.bzip.org/ Download the source from the python.org copy into the dist directory: - svn export http://svn.python.org/projects/external/bzip2-1.0.3 + svn export http://svn.python.org/projects/external/bzip2-1.0.5 And requires building bz2 first. - cd dist\bzip2-1.0.3 + cd dist\bzip2-1.0.5 nmake -f makefile.msc - All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python + All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python project links in. From python-checkins at python.org Fri Jan 9 04:58:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 9 Jan 2009 04:58:09 +0100 (CET) Subject: [Python-checkins] r68438 - in python/branches/py3k: Include/longobject.h Misc/NEWS Objects/longobject.c Message-ID: <20090109035809.747441E400C@bag.python.org> Author: raymond.hettinger Date: Fri Jan 9 04:58:09 2009 New Revision: 68438 Log: Reduce the size of the _PyLong_DigitValue table. Modified: python/branches/py3k/Include/longobject.h python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Include/longobject.h ============================================================================== --- python/branches/py3k/Include/longobject.h (original) +++ python/branches/py3k/Include/longobject.h Fri Jan 9 04:58:09 2009 @@ -41,7 +41,7 @@ #endif /* For use by intobject.c only */ -PyAPI_DATA(int) _PyLong_DigitValue[256]; +PyAPI_DATA(unsigned char) _PyLong_DigitValue[256]; /* _PyLong_AsScaledDouble returns a double x and an exponent e such that the true value is approximately equal to x * 2**(SHIFT*e). e is >= 0. Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 9 04:58:09 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- The internal table, _PyLong_DigitValue, is now an array of unsigned chars + instead of ints (reducing its size from 4 to 8 times thereby reducing + Python's overall memory). + - Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Fri Jan 9 04:58:09 2009 @@ -1646,7 +1646,7 @@ * Note that when converting a base B string, a char c is a legitimate * base B digit iff _PyLong_DigitValue[Py_CHARPyLong_MASK(c)] < B. */ -int _PyLong_DigitValue[256] = { +unsigned char _PyLong_DigitValue[256] = { 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, @@ -1710,7 +1710,7 @@ bits_in_accum = 0; pdigit = z->ob_digit; while (--p >= start) { - int k = _PyLong_DigitValue[Py_CHARMASK(*p)]; + int k = (int)_PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); accum |= (twodigits)(k << bits_in_accum); bits_in_accum += bits_per_char; @@ -1926,7 +1926,7 @@ c = (digit)_PyLong_DigitValue[Py_CHARMASK(*str++)]; for (i = 1; i < convwidth && str != scan; ++i, ++str) { c = (twodigits)(c * base + - _PyLong_DigitValue[Py_CHARMASK(*str)]); + (int)_PyLong_DigitValue[Py_CHARMASK(*str)]); assert(c < PyLong_BASE); } From buildbot at python.org Fri Jan 9 05:08:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 04:08:33 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090109040833.A3B091E4002@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/666 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/bsddb/test/test_replication.py", line 134, in test01_basic_replication self.assertTrue(time.time() Author: hirokazu.yamamoto Date: Fri Jan 9 05:10:40 2009 New Revision: 68439 Log: Bump up bsddb version on VC6. (db-4.4.20 -> db-4.7.25) Modified: python/trunk/PC/VC6/_bsddb.dsp python/trunk/PC/VC6/readme.txt Modified: python/trunk/PC/VC6/_bsddb.dsp ============================================================================== --- python/trunk/PC/VC6/_bsddb.dsp (original) +++ python/trunk/PC/VC6/_bsddb.dsp Fri Jan 9 05:10:40 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\db-4.4.20\build_win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\db-4.7.25\build_windows" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\db-4.4.20\build_win32\Release\libdb44s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /out:"./_bsddb.pyd" +# 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 ..\..\..\db-4.7.25\build_windows\Release\libdb47s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /out:"./_bsddb.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_bsddb - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\db-4.4.20\build_win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\db-4.7.25\build_windows" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\db-4.4.20\build_win32\Release\libdb44s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /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 ..\..\..\db-4.7.25\build_windows\Release\libdb47s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/trunk/PC/VC6/readme.txt ============================================================================== --- python/trunk/PC/VC6/readme.txt (original) +++ python/trunk/PC/VC6/readme.txt Fri Jan 9 05:10:40 2009 @@ -128,23 +128,23 @@ To use the version of bsddb that Python is built with by default, invoke (in the dist directory) - svn export http://svn.python.org/projects/external/db-4.4.20 + svn export http://svn.python.org/projects/external/db-4.7.25.0 db-4.7.25 - Then open db-4.4.20\build_win32\Berkeley_DB.dsw and build the "db_static" - project for "Release" mode. + Then open db-4.7.25\build_windows\Berkeley_DB.dsw and build the + "db_static" project for "Release" mode. Alternatively, if you want to start with the original sources, - go to Sleepycat's download page: - http://www.sleepycat.com/downloads/releasehistorybdb.html + go to Oracle's download page: + http://www.oracle.com/technology/software/products/berkeley-db/db/ - and download version 4.4.20. + and download version 4.7.25. With or without strong cryptography? You can choose either with or without strong cryptography, as per the instructions below. By default, Python is built and distributed WITHOUT strong crypto. Unpack the sources; if you downloaded the non-crypto version, rename - the directory from db-4.4.20.NC to db-4.4.20. + the directory from db-4.7.25.NC to db-4.7.25. Now apply any patches that apply to your version. From python-checkins at python.org Fri Jan 9 05:11:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 05:11:45 +0100 (CET) Subject: [Python-checkins] r68440 - in python/branches/py3k: Doc/library/logging.rst Include/unicodeobject.h Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py configure.in Message-ID: <20090109041145.0B7AC1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 05:11:44 2009 New Revision: 68440 Log: Merged revisions 68167,68276,68292-68293,68344 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68167 | vinay.sajip | 2009-01-02 12:53:04 -0600 (Fri, 02 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ........ r68276 | tarek.ziade | 2009-01-03 18:04:49 -0600 (Sat, 03 Jan 2009) | 1 line fixed #1702551: distutils sdist was not pruning VCS directories under win32 ........ r68292 | skip.montanaro | 2009-01-04 04:36:58 -0600 (Sun, 04 Jan 2009) | 3 lines If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". ........ r68293 | tarek.ziade | 2009-01-04 04:37:52 -0600 (Sun, 04 Jan 2009) | 1 line using clearer syntax ........ r68344 | marc-andre.lemburg | 2009-01-05 13:43:35 -0600 (Mon, 05 Jan 2009) | 7 lines Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. ........ Added: python/branches/py3k/Lib/distutils/tests/test_sdist.py - copied unchanged from r68276, /python/trunk/Lib/distutils/tests/test_sdist.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/logging.rst python/branches/py3k/Include/unicodeobject.h python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/configure.in Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Fri Jan 9 05:11:44 2009 @@ -1608,11 +1608,15 @@ This method does nothing. + + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ .. module:: logging.handlers +.. module:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. @@ -2286,7 +2290,7 @@ .. function:: fileConfig(fname[, defaults]) Reads the logging configuration from a :mod:`configparser`\-format file named - *fname*. This function can be called several times from an application, + *fname*. This function can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). Defaults to be passed to the ConfigParser @@ -2320,20 +2324,18 @@ Configuration file format ^^^^^^^^^^^^^^^^^^^^^^^^^ -The configuration file format understood by :func:`fileConfig` is -based on :mod:`configparser` functionality. The file must contain -sections called ``[loggers]``, ``[handlers]`` and ``[formatters]`` -which identify by name the entities of each type which are defined in -the file. For each such entity, there is a separate section which -identifies how that entity is configured. Thus, for a logger named -``log01`` in the ``[loggers]`` section, the relevant configuration -details are held in a section ``[logger_log01]``. Similarly, a handler -called ``hand01`` in the ``[handlers]`` section will have its -configuration held in a section called ``[handler_hand01]``, while a -formatter called ``form01`` in the ``[formatters]`` section will have -its configuration specified in a section called -``[formatter_form01]``. The root logger configuration must be -specified in a section called ``[logger_root]``. +The configuration file format understood by :func:`fileConfig` is based on +:mod:`configparser` functionality. The file must contain sections called +``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the +entities of each type which are defined in the file. For each such entity, there +is a separate section which identifies how that entity is configured. Thus, for +a logger named ``log01`` in the ``[loggers]`` section, the relevant +configuration details are held in a section ``[logger_log01]``. Similarly, a +handler called ``hand01`` in the ``[handlers]`` section will have its +configuration held in a section called ``[handler_hand01]``, while a formatter +called ``form01`` in the ``[formatters]`` section will have its configuration +specified in a section called ``[formatter_form01]``. The root logger +configuration must be specified in a section called ``[logger_root]``. Examples of these sections in the file are given below. :: Modified: python/branches/py3k/Include/unicodeobject.h ============================================================================== --- python/branches/py3k/Include/unicodeobject.h (original) +++ python/branches/py3k/Include/unicodeobject.h Fri Jan 9 05:11:44 2009 @@ -126,6 +126,10 @@ typedef unsigned long Py_UCS4; #endif +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + typedef PY_UNICODE_TYPE Py_UNICODE; /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ @@ -369,12 +373,12 @@ #else -/* Since splitting on whitespace is an important use case, and whitespace - in most situations is solely ASCII whitespace, we optimize for the common - case by using a quick look-up table with an inlined check. - */ -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + */ #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) @@ -409,13 +413,14 @@ #define Py_UNICODE_COPY(target, source, length) \ Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) -#define Py_UNICODE_FILL(target, value, length) do\ - {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) -/* check if substring matches at given offset. the offset must be +/* Check if substring matches at given offset. the offset must be valid, and the substring must not be empty */ + #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->str + (offset)) == *((substring)->str)) && \ ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ @@ -425,8 +430,6 @@ extern "C" { #endif -PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); - /* --- Unicode Type ------------------------------------------------------- */ typedef struct { @@ -641,6 +644,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These @@ -1477,6 +1491,10 @@ /* === Characters Type APIs =============================================== */ +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. 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 Fri Jan 9 05:11:44 2009 @@ -4,7 +4,10 @@ __revision__ = "$Id$" -import sys, os +import os +import string +import sys +from types import * from glob import glob from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util @@ -332,9 +335,18 @@ self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) - def write_manifest(self): + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) + + def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Fri Jan 9 05:11:44 2009 @@ -387,7 +387,7 @@ AC_HELP_STRING(--without-gcc,never use gcc), [ case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; From python-checkins at python.org Fri Jan 9 05:14:14 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 9 Jan 2009 05:14:14 +0100 (CET) Subject: [Python-checkins] r68441 - in python/branches/release26-maint: PC/VC6/_bsddb.dsp PC/VC6/readme.txt Message-ID: <20090109041414.25AF11E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 9 05:14:13 2009 New Revision: 68441 Log: Merged revisions 68439 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68439 | hirokazu.yamamoto | 2009-01-09 13:10:40 +0900 | 1 line Bump up bsddb version on VC6. (db-4.4.20 -> db-4.7.25) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/PC/VC6/_bsddb.dsp python/branches/release26-maint/PC/VC6/readme.txt Modified: python/branches/release26-maint/PC/VC6/_bsddb.dsp ============================================================================== --- python/branches/release26-maint/PC/VC6/_bsddb.dsp (original) +++ python/branches/release26-maint/PC/VC6/_bsddb.dsp Fri Jan 9 05:14:13 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\db-4.4.20\build_win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\db-4.7.25\build_windows" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\db-4.4.20\build_win32\Release\libdb44s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /out:"./_bsddb.pyd" +# 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 ..\..\..\db-4.7.25\build_windows\Release\libdb47s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /out:"./_bsddb.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_bsddb - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\db-4.4.20\build_win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\db-4.7.25\build_windows" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\db-4.4.20\build_win32\Release\libdb44s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /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 ..\..\..\db-4.7.25\build_windows\Release\libdb47s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/release26-maint/PC/VC6/readme.txt ============================================================================== --- python/branches/release26-maint/PC/VC6/readme.txt (original) +++ python/branches/release26-maint/PC/VC6/readme.txt Fri Jan 9 05:14:13 2009 @@ -128,23 +128,23 @@ To use the version of bsddb that Python is built with by default, invoke (in the dist directory) - svn export http://svn.python.org/projects/external/db-4.4.20 + svn export http://svn.python.org/projects/external/db-4.7.25.0 db-4.7.25 - Then open db-4.4.20\build_win32\Berkeley_DB.dsw and build the "db_static" - project for "Release" mode. + Then open db-4.7.25\build_windows\Berkeley_DB.dsw and build the + "db_static" project for "Release" mode. Alternatively, if you want to start with the original sources, - go to Sleepycat's download page: - http://www.sleepycat.com/downloads/releasehistorybdb.html + go to Oracle's download page: + http://www.oracle.com/technology/software/products/berkeley-db/db/ - and download version 4.4.20. + and download version 4.7.25. With or without strong cryptography? You can choose either with or without strong cryptography, as per the instructions below. By default, Python is built and distributed WITHOUT strong crypto. Unpack the sources; if you downloaded the non-crypto version, rename - the directory from db-4.4.20.NC to db-4.4.20. + the directory from db-4.7.25.NC to db-4.7.25. Now apply any patches that apply to your version. From python-checkins at python.org Fri Jan 9 05:17:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 9 Jan 2009 05:17:34 +0100 (CET) Subject: [Python-checkins] r68442 - in python/branches/release30-maint: Doc/library/logging.rst Include/unicodeobject.h Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py configure.in Message-ID: <20090109041734.E9A5A1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 9 05:17:34 2009 New Revision: 68442 Log: Merged revisions 68440 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68440 | benjamin.peterson | 2009-01-08 22:11:44 -0600 (Thu, 08 Jan 2009) | 30 lines Merged revisions 68167,68276,68292-68293,68344 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68167 | vinay.sajip | 2009-01-02 12:53:04 -0600 (Fri, 02 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ........ r68276 | tarek.ziade | 2009-01-03 18:04:49 -0600 (Sat, 03 Jan 2009) | 1 line fixed #1702551: distutils sdist was not pruning VCS directories under win32 ........ r68292 | skip.montanaro | 2009-01-04 04:36:58 -0600 (Sun, 04 Jan 2009) | 3 lines If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". ........ r68293 | tarek.ziade | 2009-01-04 04:37:52 -0600 (Sun, 04 Jan 2009) | 1 line using clearer syntax ........ r68344 | marc-andre.lemburg | 2009-01-05 13:43:35 -0600 (Mon, 05 Jan 2009) | 7 lines Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. ........ ................ Added: python/branches/release30-maint/Lib/distutils/tests/test_sdist.py - copied unchanged from r68440, /python/branches/py3k/Lib/distutils/tests/test_sdist.py Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/logging.rst python/branches/release30-maint/Include/unicodeobject.h python/branches/release30-maint/Lib/distutils/command/sdist.py python/branches/release30-maint/configure.in Modified: python/branches/release30-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release30-maint/Doc/library/logging.rst (original) +++ python/branches/release30-maint/Doc/library/logging.rst Fri Jan 9 05:17:34 2009 @@ -1576,9 +1576,13 @@ Outputs the record to the file. + + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ +.. module:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. @@ -2252,7 +2256,7 @@ .. function:: fileConfig(fname[, defaults]) Reads the logging configuration from a :mod:`configparser`\-format file named - *fname*. This function can be called several times from an application, + *fname*. This function can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). Defaults to be passed to the ConfigParser @@ -2286,20 +2290,18 @@ Configuration file format ^^^^^^^^^^^^^^^^^^^^^^^^^ -The configuration file format understood by :func:`fileConfig` is -based on :mod:`configparser` functionality. The file must contain -sections called ``[loggers]``, ``[handlers]`` and ``[formatters]`` -which identify by name the entities of each type which are defined in -the file. For each such entity, there is a separate section which -identified how that entity is configured. Thus, for a logger named -``log01`` in the ``[loggers]`` section, the relevant configuration -details are held in a section ``[logger_log01]``. Similarly, a handler -called ``hand01`` in the ``[handlers]`` section will have its -configuration held in a section called ``[handler_hand01]``, while a -formatter called ``form01`` in the ``[formatters]`` section will have -its configuration specified in a section called -``[formatter_form01]``. The root logger configuration must be -specified in a section called ``[logger_root]``. +The configuration file format understood by :func:`fileConfig` is based on +:mod:`configparser` functionality. The file must contain sections called +``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the +entities of each type which are defined in the file. For each such entity, there +is a separate section which identifies how that entity is configured. Thus, for +a logger named ``log01`` in the ``[loggers]`` section, the relevant +configuration details are held in a section ``[logger_log01]``. Similarly, a +handler called ``hand01`` in the ``[handlers]`` section will have its +configuration held in a section called ``[handler_hand01]``, while a formatter +called ``form01`` in the ``[formatters]`` section will have its configuration +specified in a section called ``[formatter_form01]``. The root logger +configuration must be specified in a section called ``[logger_root]``. Examples of these sections in the file are given below. :: Modified: python/branches/release30-maint/Include/unicodeobject.h ============================================================================== --- python/branches/release30-maint/Include/unicodeobject.h (original) +++ python/branches/release30-maint/Include/unicodeobject.h Fri Jan 9 05:17:34 2009 @@ -126,6 +126,10 @@ typedef unsigned long Py_UCS4; #endif +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + typedef PY_UNICODE_TYPE Py_UNICODE; /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ @@ -369,12 +373,12 @@ #else -/* Since splitting on whitespace is an important use case, and whitespace - in most situations is solely ASCII whitespace, we optimize for the common - case by using a quick look-up table with an inlined check. - */ -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + */ #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) @@ -409,13 +413,14 @@ #define Py_UNICODE_COPY(target, source, length) \ Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) -#define Py_UNICODE_FILL(target, value, length) do\ - {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) -/* check if substring matches at given offset. the offset must be +/* Check if substring matches at given offset. the offset must be valid, and the substring must not be empty */ + #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->str + (offset)) == *((substring)->str)) && \ ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ @@ -425,8 +430,6 @@ extern "C" { #endif -PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); - /* --- Unicode Type ------------------------------------------------------- */ typedef struct { @@ -641,6 +644,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These @@ -1477,6 +1491,10 @@ /* === Characters Type APIs =============================================== */ +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. Modified: python/branches/release30-maint/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/sdist.py (original) +++ python/branches/release30-maint/Lib/distutils/command/sdist.py Fri Jan 9 05:17:34 2009 @@ -4,7 +4,10 @@ __revision__ = "$Id$" -import sys, os +import os +import string +import sys +from types import * from glob import glob from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util @@ -332,9 +335,18 @@ self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) - def write_manifest(self): + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) + + def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. Modified: python/branches/release30-maint/configure.in ============================================================================== --- python/branches/release30-maint/configure.in (original) +++ python/branches/release30-maint/configure.in Fri Jan 9 05:17:34 2009 @@ -387,7 +387,7 @@ AC_HELP_STRING(--without-gcc,never use gcc), [ case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; From buildbot at python.org Fri Jan 9 05:37:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 04:37:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090109043756.CB1F21E4002@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/40 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 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 Fri Jan 9 05:41:03 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 9 Jan 2009 05:41:03 +0100 (CET) Subject: [Python-checkins] r68443 - in python/branches/py3k: PC/VC6/bz2.dsp PC/VC6/readme.txt Message-ID: <20090109044103.C38571E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 9 05:41:03 2009 New Revision: 68443 Log: Merged revisions 68435 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68435 | hirokazu.yamamoto | 2009-01-09 12:32:46 +0900 | 1 line Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/PC/VC6/bz2.dsp python/branches/py3k/PC/VC6/readme.txt Modified: python/branches/py3k/PC/VC6/bz2.dsp ============================================================================== --- python/branches/py3k/PC/VC6/bz2.dsp (original) +++ python/branches/py3k/PC/VC6/bz2.dsp Fri Jan 9 05:41:03 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/py3k/PC/VC6/readme.txt ============================================================================== --- python/branches/py3k/PC/VC6/readme.txt (original) +++ python/branches/py3k/PC/VC6/readme.txt Fri Jan 9 05:41:03 2009 @@ -110,18 +110,18 @@ bz2 Python wrapper for the libbz2 compression library. Homepage - http://sources.redhat.com/bzip2/ + http://www.bzip.org/ Download the source from the python.org copy into the dist directory: - svn export http://svn.python.org/projects/external/bzip2-1.0.3 + svn export http://svn.python.org/projects/external/bzip2-1.0.5 And requires building bz2 first. - cd dist\bzip2-1.0.3 + cd dist\bzip2-1.0.5 nmake -f makefile.msc - All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python + All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python project links in. From python-checkins at python.org Fri Jan 9 05:45:48 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 9 Jan 2009 05:45:48 +0100 (CET) Subject: [Python-checkins] r68444 - in python/branches/release30-maint: PC/VC6/bz2.dsp PC/VC6/readme.txt Message-ID: <20090109044548.86AEE1E4048@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 9 05:45:48 2009 New Revision: 68444 Log: Merged revisions 68443 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68443 | hirokazu.yamamoto | 2009-01-09 13:41:03 +0900 | 9 lines Merged revisions 68435 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68435 | hirokazu.yamamoto | 2009-01-09 12:32:46 +0900 | 1 line Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5) ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/PC/VC6/bz2.dsp python/branches/release30-maint/PC/VC6/readme.txt Modified: python/branches/release30-maint/PC/VC6/bz2.dsp ============================================================================== --- python/branches/release30-maint/PC/VC6/bz2.dsp (original) +++ python/branches/release30-maint/PC/VC6/bz2.dsp Fri Jan 9 05:45:48 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/release30-maint/PC/VC6/readme.txt ============================================================================== --- python/branches/release30-maint/PC/VC6/readme.txt (original) +++ python/branches/release30-maint/PC/VC6/readme.txt Fri Jan 9 05:45:48 2009 @@ -110,18 +110,18 @@ bz2 Python wrapper for the libbz2 compression library. Homepage - http://sources.redhat.com/bzip2/ + http://www.bzip.org/ Download the source from the python.org copy into the dist directory: - svn export http://svn.python.org/projects/external/bzip2-1.0.3 + svn export http://svn.python.org/projects/external/bzip2-1.0.5 And requires building bz2 first. - cd dist\bzip2-1.0.3 + cd dist\bzip2-1.0.5 nmake -f makefile.msc - All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python + All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python project links in. From python-checkins at python.org Fri Jan 9 05:48:20 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 9 Jan 2009 05:48:20 +0100 (CET) Subject: [Python-checkins] r68445 - python/branches/py3k Message-ID: <20090109044820.0E2121E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 9 05:48:19 2009 New Revision: 68445 Log: Blocked revisions 68439 via svnmerge ........ r68439 | hirokazu.yamamoto | 2009-01-09 13:10:40 +0900 | 1 line Bump up bsddb version on VC6. (db-4.4.20 -> db-4.7.25) ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Fri Jan 9 06:19:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 05:19:00 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090109051900.8E2111E4002@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/78 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 Fri Jan 9 06:28:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 05:28:06 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090109052806.9DB3F1E4002@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/39 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 svn sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 06:34:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 05:34:18 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090109053418.72FC31E4002@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/44 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_ssl make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 08:27:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 07:27:17 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090109072717.6886D1E4002@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/42 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: 4 tests failed: test_distutils test_io test_posix test_traceback ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 683, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 615, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 928, in testBasicIO self.assertEquals(f.write("abc"), 3) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1488, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 763, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1721, in read decoder.decode(self.buffer.read(), final=True)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 781, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1488, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 889, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 534, in readlines return list(self) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1736, in __next__ line = self.readline() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1810, in readline while self._read_chunk(): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 914, in testNewlinesOutput txt.write(data) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1488, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 1150, in test_issue1395_1 c = txt.read(1) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1730, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 1162, in test_issue1395_2 c = txt.read(4) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1730, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 1172, in test_issue1395_3 reads = txt.read(4) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1730, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 1183, in test_issue1395_4 reads = txt.read(4) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1730, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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 "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_io.py", line 1191, in test_issue1395_5 reads = txt.read(4) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1730, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1559, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1292, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.0.loewis-sun/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_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' ====================================================================== ERROR: test_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 1488, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 10:00:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 09:00:26 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090109090027.1781E1E4010@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/48 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_profilehooks sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 12:38:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 11:38:13 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090109113813.CEA4A1E4002@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/70 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,hirokazu.yamamoto,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Jan 9 12:55:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 12:55:34 +0100 (CET) Subject: [Python-checkins] r68446 - sandbox/trunk/io-c/_iobase.c Message-ID: <20090109115534.E5C151E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 12:55:34 2009 New Revision: 68446 Log: Fix compilation error Modified: sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Fri Jan 9 12:55:34 2009 @@ -478,7 +478,7 @@ } while (1) { - PyObject *line = PyIter_Next(self, "__next__"); + PyObject *line = PyIter_Next(self); if (line == NULL) { if (PyErr_Occurred()) { Py_DECREF(result); From python-checkins at python.org Fri Jan 9 13:05:09 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 13:05:09 +0100 (CET) Subject: [Python-checkins] r68448 - sandbox/trunk/io-c/_textio.c Message-ID: <20090109120509.D51031E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 13:05:09 2009 New Revision: 68448 Log: Be sure we really unshare 1-char strings (better safe than sorry) Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 9 13:05:09 2009 @@ -225,7 +225,9 @@ PyObject *translated = NULL; Py_UNICODE *out_str; Py_ssize_t out; - if (Py_REFCNT(output) != 1) { + /* 1-character strings may be shared, and we may be the first + to receive a reference (although unlikely). */ + if (Py_REFCNT(output) != 1 || len < 2) { /* We could try to optimize this so that we only do a copy when there is something to translate. On the other hand, most decoders should only output non-shared strings, i.e. From python-checkins at python.org Fri Jan 9 13:14:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 13:14:23 +0100 (CET) Subject: [Python-checkins] r68449 - sandbox/trunk/io-c/_textio.c Message-ID: <20090109121423.9B9BC1E400C@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 13:14:23 2009 New Revision: 68449 Log: Revert last commit, it was useless (shared strings always has a refcount > 1) Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 9 13:14:23 2009 @@ -225,9 +225,7 @@ PyObject *translated = NULL; Py_UNICODE *out_str; Py_ssize_t out; - /* 1-character strings may be shared, and we may be the first - to receive a reference (although unlikely). */ - if (Py_REFCNT(output) != 1 || len < 2) { + if (Py_REFCNT(output) != 1) { /* We could try to optimize this so that we only do a copy when there is something to translate. On the other hand, most decoders should only output non-shared strings, i.e. From nnorwitz at gmail.com Fri Jan 9 14:40:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 9 Jan 2009 08:40:17 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090109134017.GA25638@python.psfb.org> svn update tools/sphinx At revision 68449. svn update tools/docutils At revision 68449. svn update tools/jinja2 At revision 68449. svn update tools/pygments At revision 68449. mkdir -p build/html build/doctrees python2.5 tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 6 source files that are out of date updating environment: 0 added, 6 changed, 0 removed reading sources... library/ctypes library/ftplib library/logging reST markup error: /home/neal/python/py3k/Doc/library/logging.rst:: (SEVERE/4) Duplicate ID: "module-logging.handlers". make: *** [build] Error 1 From python-checkins at python.org Fri Jan 9 17:47:08 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Fri, 9 Jan 2009 17:47:08 +0100 (CET) Subject: [Python-checkins] r68450 - in python/trunk: Include/pyport.h Modules/socketmodule.c Message-ID: <20090109164708.1A5931E4002@bag.python.org> Author: jeffrey.yasskin Date: Fri Jan 9 17:47:07 2009 New Revision: 68450 Log: Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. Modified: python/trunk/Include/pyport.h python/trunk/Modules/socketmodule.c Modified: python/trunk/Include/pyport.h ============================================================================== --- python/trunk/Include/pyport.h (original) +++ python/trunk/Include/pyport.h Fri Jan 9 17:47:07 2009 @@ -709,6 +709,15 @@ #define Py_FORMAT_PARSETUPLE(func,p1,p2) #endif +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ Modified: python/trunk/Modules/socketmodule.c ============================================================================== --- python/trunk/Modules/socketmodule.c (original) +++ python/trunk/Modules/socketmodule.c Fri Jan 9 17:47:07 2009 @@ -3334,7 +3334,11 @@ #ifdef HAVE_GETHOSTBYNAME_R_3_ARG struct hostent_data data; #else - char buf[16384]; + /* glibcs up to 2.10 assume that the buf argument to + gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc + does not ensure. The attribute below instructs the compiler + to maintain this alignment. */ + char buf[16384] Py_ALIGNED(8); int buf_len = (sizeof buf) - 1; int errnop; #endif From nnorwitz at gmail.com Fri Jan 9 18:30:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 9 Jan 2009 12:30:17 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090109173017.GA8722@python.psfb.org> svn update tools/sphinx At revision 68450. svn update tools/docutils At revision 68450. svn update tools/jinja2 At revision 68450. svn update tools/pygments At revision 68450. mkdir -p build/html build/doctrees python2.5 tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 7 source files that are out of date updating environment: 0 added, 7 changed, 0 removed reading sources... library/ctypes library/ftplib library/itertools library/logging reST markup error: /home/neal/python/r30/Doc/library/logging.rst:: (SEVERE/4) Duplicate ID: "module-logging.handlers". make: *** [build] Error 1 From python-checkins at python.org Fri Jan 9 19:53:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 19:53:14 +0100 (CET) Subject: [Python-checkins] r68451 - in python/branches/py3k: Include/pydebug.h Lib/test/test_cmd_line.py Misc/NEWS Modules/main.c Python/pythonrun.c Message-ID: <20090109185314.7DA7E1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 19:53:14 2009 New Revision: 68451 Log: Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being to buffer arbitrary chunks of data). Patch by Victor Stinner, test by me. Modified: python/branches/py3k/Include/pydebug.h python/branches/py3k/Lib/test/test_cmd_line.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/main.c python/branches/py3k/Python/pythonrun.c Modified: python/branches/py3k/Include/pydebug.h ============================================================================== --- python/branches/py3k/Include/pydebug.h (original) +++ python/branches/py3k/Include/pydebug.h Fri Jan 9 19:53:14 2009 @@ -18,6 +18,7 @@ PyAPI_DATA(int) Py_DivisionWarningFlag; PyAPI_DATA(int) Py_DontWriteBytecodeFlag; PyAPI_DATA(int) Py_NoUserSiteDirectory; +PyAPI_DATA(int) Py_UnbufferedStdioFlag; /* this is a wrapper around getenv() that pays attention to Py_IgnoreEnvironmentFlag. It should be used for getting variables like Modified: python/branches/py3k/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/py3k/Lib/test/test_cmd_line.py (original) +++ python/branches/py3k/Lib/test/test_cmd_line.py Fri Jan 9 19:53:14 2009 @@ -142,6 +142,23 @@ self.exit_code('-c', command), 0) + def test_unbuffered_output(self): + # Test expected operation of the '-u' switch + for stream in ('stdout', 'stderr'): + # Binary is unbuffered + code = ("import os, sys; sys.%s.buffer.write(b'x'); os._exit(0)" + % stream) + data, rc = self.start_python_and_exit_code('-u', '-c', code) + self.assertEqual(rc, 0) + self.assertEqual(data, b'x', "binary %s not unbuffered" % stream) + # Text is line-buffered + code = ("import os, sys; sys.%s.write('x\\n'); os._exit(0)" + % stream) + data, rc = self.start_python_and_exit_code('-u', '-c', code) + self.assertEqual(rc, 0) + self.assertEqual(data.strip(), b'x', + "text %s not line-buffered" % stream) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 9 19:53:14 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line + flag to work properly. Furthermore, when specifying -u, the text stdout + and stderr streams have line-by-line buffering enabled (the default being + to buffer arbitrary chunks of data). + - The internal table, _PyLong_DigitValue, is now an array of unsigned chars instead of ints (reducing its size from 4 to 8 times thereby reducing Python's overall memory). Modified: python/branches/py3k/Modules/main.c ============================================================================== --- python/branches/py3k/Modules/main.c (original) +++ python/branches/py3k/Modules/main.c Fri Jan 9 19:53:14 2009 @@ -292,7 +292,6 @@ wchar_t *module = NULL; FILE *fp = stdin; char *p; - int unbuffered = 0; int skipfirstline = 0; int stdin_is_interactive = 0; int help = 0; @@ -374,7 +373,7 @@ break; case 'u': - unbuffered++; + Py_UnbufferedStdioFlag = 1; saw_unbuffered_flag = 1; break; @@ -423,7 +422,7 @@ Py_InspectFlag = 1; if (!saw_unbuffered_flag && (p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0') - unbuffered = 1; + Py_UnbufferedStdioFlag = 1; if (!Py_NoUserSiteDirectory && (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0') @@ -444,7 +443,7 @@ stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); - if (unbuffered) { + if (Py_UnbufferedStdioFlag) { #if defined(MS_WINDOWS) || defined(__CYGWIN__) _setmode(fileno(stdin), O_BINARY); _setmode(fileno(stdout), O_BINARY); Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Fri Jan 9 19:53:14 2009 @@ -88,6 +88,7 @@ int Py_FrozenFlag; /* Needed by getpath.c */ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ +int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */ /* PyModule_GetWarningsModule is no longer necessary as of 2.6 since _warnings is builtin. This API should not be used. */ @@ -728,6 +729,75 @@ } } +static PyObject* +create_stdio(PyObject* io, + int fd, int write_mode, char* name, + char* encoding, char* errors) +{ + PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL; + const char* mode; + const PyObject *line_buffering; + int buffering; + + if (Py_UnbufferedStdioFlag) + buffering = 0; + else + buffering = -1; + if (write_mode) + mode = "wb"; + else + mode = "rb"; + buf = PyObject_CallMethod(io, "open", "isiOOOi", + fd, mode, buffering, + Py_None, Py_None, Py_None, 0); + if (buf == NULL) + goto error; + + if (!Py_UnbufferedStdioFlag) { + raw = PyObject_GetAttrString(buf, "raw"); + if (raw == NULL) + goto error; + } + else { + raw = buf; + Py_INCREF(raw); + } + + text = PyUnicode_FromString(name); + if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0) + goto error; + Py_CLEAR(raw); + Py_CLEAR(text); + + if (Py_UnbufferedStdioFlag) + line_buffering = Py_True; + else + line_buffering = Py_False; + stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO", + buf, encoding, errors, + "\n", line_buffering); + Py_CLEAR(buf); + if (stream == NULL) + goto error; + + if (write_mode) + mode = "w"; + else + mode = "r"; + text = PyUnicode_FromString(mode); + if (!text || PyObject_SetAttrString(stream, "mode", text) < 0) + goto error; + Py_CLEAR(text); + return stream; + +error: + Py_XDECREF(buf); + Py_XDECREF(stream); + Py_XDECREF(text); + Py_XDECREF(raw); + return NULL; +} + /* Initialize sys.stdin, stdout, stderr and builtins.open */ static int initstdio(void) @@ -794,10 +864,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "r", -1, encoding, - errors, "\n", 0))) { + std = create_stdio(iomod, fd, 0, "", encoding, errors); + if (std == NULL) goto error; - } } /* if (fd < 0) */ PySys_SetObject("__stdin__", std); PySys_SetObject("stdin", std); @@ -814,10 +883,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "w", -1, encoding, - errors, "\n", 0))) { + std = create_stdio(iomod, fd, 1, "", encoding, errors); + if (std == NULL) goto error; - } } /* if (fd < 0) */ PySys_SetObject("__stdout__", std); PySys_SetObject("stdout", std); @@ -835,10 +903,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "w", -1, encoding, - "backslashreplace", "\n", 0))) { + std = create_stdio(iomod, fd, 1, "", encoding, "backslashreplace"); + if (std == NULL) goto error; - } } /* if (fd < 0) */ /* Same as hack above, pre-import stderr's codec to avoid recursion From python-checkins at python.org Fri Jan 9 20:14:56 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 20:14:56 +0100 (CET) Subject: [Python-checkins] r68452 - in python/branches/release30-maint: Include/pydebug.h Lib/test/test_cmd_line.py Misc/NEWS Modules/main.c Python/pythonrun.c Message-ID: <20090109191456.6FF7B1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 20:14:56 2009 New Revision: 68452 Log: Merged revisions 68451 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68451 | antoine.pitrou | 2009-01-09 19:53:14 +0100 (ven., 09 janv. 2009) | 6 lines Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being to buffer arbitrary chunks of data). Patch by Victor Stinner, test by me. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/pydebug.h python/branches/release30-maint/Lib/test/test_cmd_line.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/main.c python/branches/release30-maint/Python/pythonrun.c Modified: python/branches/release30-maint/Include/pydebug.h ============================================================================== --- python/branches/release30-maint/Include/pydebug.h (original) +++ python/branches/release30-maint/Include/pydebug.h Fri Jan 9 20:14:56 2009 @@ -18,6 +18,7 @@ PyAPI_DATA(int) Py_DivisionWarningFlag; PyAPI_DATA(int) Py_DontWriteBytecodeFlag; PyAPI_DATA(int) Py_NoUserSiteDirectory; +PyAPI_DATA(int) Py_UnbufferedStdioFlag; /* this is a wrapper around getenv() that pays attention to Py_IgnoreEnvironmentFlag. It should be used for getting variables like Modified: python/branches/release30-maint/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_cmd_line.py (original) +++ python/branches/release30-maint/Lib/test/test_cmd_line.py Fri Jan 9 20:14:56 2009 @@ -142,6 +142,23 @@ self.exit_code('-c', command), 0) + def test_unbuffered_output(self): + # Test expected operation of the '-u' switch + for stream in ('stdout', 'stderr'): + # Binary is unbuffered + code = ("import os, sys; sys.%s.buffer.write(b'x'); os._exit(0)" + % stream) + data, rc = self.start_python_and_exit_code('-u', '-c', code) + self.assertEqual(rc, 0) + self.assertEqual(data, b'x', "binary %s not unbuffered" % stream) + # Text is line-buffered + code = ("import os, sys; sys.%s.write('x\\n'); os._exit(0)" + % stream) + data, rc = self.start_python_and_exit_code('-u', '-c', code) + self.assertEqual(rc, 0) + self.assertEqual(data.strip(), b'x', + "text %s not line-buffered" % stream) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Jan 9 20:14:56 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line + flag to work properly. Furthermore, when specifying -u, the text stdout + and stderr streams have line-by-line buffering enabled (the default being + to buffer arbitrary chunks of data). + - Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the Modified: python/branches/release30-maint/Modules/main.c ============================================================================== --- python/branches/release30-maint/Modules/main.c (original) +++ python/branches/release30-maint/Modules/main.c Fri Jan 9 20:14:56 2009 @@ -292,7 +292,6 @@ wchar_t *module = NULL; FILE *fp = stdin; char *p; - int unbuffered = 0; int skipfirstline = 0; int stdin_is_interactive = 0; int help = 0; @@ -374,7 +373,7 @@ break; case 'u': - unbuffered++; + Py_UnbufferedStdioFlag = 1; saw_unbuffered_flag = 1; break; @@ -423,7 +422,7 @@ Py_InspectFlag = 1; if (!saw_unbuffered_flag && (p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0') - unbuffered = 1; + Py_UnbufferedStdioFlag = 1; if (!Py_NoUserSiteDirectory && (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0') @@ -444,7 +443,7 @@ stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); - if (unbuffered) { + if (Py_UnbufferedStdioFlag) { #if defined(MS_WINDOWS) || defined(__CYGWIN__) _setmode(fileno(stdin), O_BINARY); _setmode(fileno(stdout), O_BINARY); Modified: python/branches/release30-maint/Python/pythonrun.c ============================================================================== --- python/branches/release30-maint/Python/pythonrun.c (original) +++ python/branches/release30-maint/Python/pythonrun.c Fri Jan 9 20:14:56 2009 @@ -88,6 +88,7 @@ int Py_FrozenFlag; /* Needed by getpath.c */ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ +int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */ /* PyModule_GetWarningsModule is no longer necessary as of 2.6 since _warnings is builtin. This API should not be used. */ @@ -728,6 +729,75 @@ } } +static PyObject* +create_stdio(PyObject* io, + int fd, int write_mode, char* name, + char* encoding, char* errors) +{ + PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL; + const char* mode; + const PyObject *line_buffering; + int buffering; + + if (Py_UnbufferedStdioFlag) + buffering = 0; + else + buffering = -1; + if (write_mode) + mode = "wb"; + else + mode = "rb"; + buf = PyObject_CallMethod(io, "open", "isiOOOi", + fd, mode, buffering, + Py_None, Py_None, Py_None, 0); + if (buf == NULL) + goto error; + + if (!Py_UnbufferedStdioFlag) { + raw = PyObject_GetAttrString(buf, "raw"); + if (raw == NULL) + goto error; + } + else { + raw = buf; + Py_INCREF(raw); + } + + text = PyUnicode_FromString(name); + if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0) + goto error; + Py_CLEAR(raw); + Py_CLEAR(text); + + if (Py_UnbufferedStdioFlag) + line_buffering = Py_True; + else + line_buffering = Py_False; + stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO", + buf, encoding, errors, + "\n", line_buffering); + Py_CLEAR(buf); + if (stream == NULL) + goto error; + + if (write_mode) + mode = "w"; + else + mode = "r"; + text = PyUnicode_FromString(mode); + if (!text || PyObject_SetAttrString(stream, "mode", text) < 0) + goto error; + Py_CLEAR(text); + return stream; + +error: + Py_XDECREF(buf); + Py_XDECREF(stream); + Py_XDECREF(text); + Py_XDECREF(raw); + return NULL; +} + /* Initialize sys.stdin, stdout, stderr and builtins.open */ static int initstdio(void) @@ -794,10 +864,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "r", -1, encoding, - errors, "\n", 0))) { + std = create_stdio(iomod, fd, 0, "", encoding, errors); + if (std == NULL) goto error; - } } /* if (fd < 0) */ PySys_SetObject("__stdin__", std); PySys_SetObject("stdin", std); @@ -814,10 +883,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "w", -1, encoding, - errors, "\n", 0))) { + std = create_stdio(iomod, fd, 1, "", encoding, errors); + if (std == NULL) goto error; - } } /* if (fd < 0) */ PySys_SetObject("__stdout__", std); PySys_SetObject("stdout", std); @@ -835,10 +903,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "w", -1, encoding, - "backslashreplace", "\n", 0))) { + std = create_stdio(iomod, fd, 1, "", encoding, "backslashreplace"); + if (std == NULL) goto error; - } } /* if (fd < 0) */ /* Same as hack above, pre-import stderr's codec to avoid recursion From buildbot at python.org Fri Jan 9 20:20:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 19:20:06 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090109192006.D077D1E4002@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/91 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 python-checkins at python.org Fri Jan 9 20:29:16 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 20:29:16 +0100 (CET) Subject: [Python-checkins] r68453 - python/branches/py3k/Lib/unittest.py Message-ID: <20090109192916.493981E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 20:29:16 2009 New Revision: 68453 Log: Buglet: fix unittest.main() Modified: python/branches/py3k/Lib/unittest.py Modified: python/branches/py3k/Lib/unittest.py ============================================================================== --- python/branches/py3k/Lib/unittest.py (original) +++ python/branches/py3k/Lib/unittest.py Fri Jan 9 20:29:16 2009 @@ -813,7 +813,7 @@ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=defaultTestLoader): - if isinstance(module, basestring): + if isinstance(module, str): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) From buildbot at python.org Fri Jan 9 20:39:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 19:39:59 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090109193959.251A71E4002@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/80 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_doctest 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 Jan 9 20:54:29 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 20:54:29 +0100 (CET) Subject: [Python-checkins] r68454 - in python/branches/py3k: Lib/io.py Lib/test/test_io.py Misc/NEWS Message-ID: <20090109195429.EE0DD1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 20:54:29 2009 New Revision: 68454 Log: Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. Modified: python/branches/py3k/Lib/io.py python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/io.py ============================================================================== --- python/branches/py3k/Lib/io.py (original) +++ python/branches/py3k/Lib/io.py Fri Jan 9 20:54:29 2009 @@ -340,6 +340,7 @@ def tell(self) -> int: """Return current stream position.""" + self._checkClosed() return self.seek(0, 1) def truncate(self, pos: int = None) -> int: @@ -358,6 +359,8 @@ This is not implemented for read-only and non-blocking streams. """ # XXX Should this return the number of bytes written??? + if self.__closed: + raise ValueError("I/O operation on closed file.") __closed = False @@ -530,6 +533,7 @@ 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 @@ -567,6 +571,7 @@ Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read. """ + self._checkClosed() if n is None: n = -1 if n < 0: @@ -578,6 +583,7 @@ def readall(self): """Read until EOF, using multiple read() call.""" + self._checkClosed() res = bytearray() while True: data = self.read(DEFAULT_BUFFER_SIZE) @@ -673,6 +679,7 @@ data at the moment. """ # XXX This ought to work with anything that supports the buffer API + self._checkClosed() data = self.read(len(b)) n = len(data) try: @@ -787,13 +794,11 @@ def getvalue(self): """Return the bytes value (contents) of the buffer """ - if self.closed: - raise ValueError("getvalue on closed file") + self._checkClosed() return bytes(self._buffer) def read(self, n=None): - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if n is None: n = -1 if n < 0: @@ -811,8 +816,7 @@ return self.read(n) def write(self, b): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if isinstance(b, str): raise TypeError("can't write str to binary stream") n = len(b) @@ -829,8 +833,7 @@ return n def seek(self, pos, whence=0): - if self.closed: - raise ValueError("seek on closed file") + self._checkClosed() try: pos = pos.__index__() except AttributeError as err: @@ -848,13 +851,11 @@ return self._pos def tell(self): - if self.closed: - raise ValueError("tell on closed file") + self._checkClosed() return self._pos def truncate(self, pos=None): - if self.closed: - raise ValueError("truncate on closed file") + self._checkClosed() if pos is None: pos = self._pos elif pos < 0: @@ -914,6 +915,7 @@ mode. If n is negative, read until EOF or until read() would block. """ + self._checkClosed() with self._read_lock: return self._read_unlocked(n) @@ -970,6 +972,7 @@ do at most one raw read to satisfy it. We never return more than self.buffer_size. """ + self._checkClosed() with self._read_lock: return self._peek_unlocked(n) @@ -988,6 +991,7 @@ """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. + self._checkClosed() if n <= 0: return b"" with self._read_lock: @@ -996,9 +1000,11 @@ min(n, len(self._read_buf) - self._read_pos)) def tell(self): + self._checkClosed() return self.raw.tell() - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): + self._checkClosed() with self._read_lock: if whence == 1: pos -= len(self._read_buf) - self._read_pos @@ -1029,8 +1035,7 @@ self._write_lock = Lock() def write(self, b): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if isinstance(b, str): raise TypeError("can't write str to binary stream") with self._write_lock: @@ -1060,6 +1065,7 @@ return written def truncate(self, pos=None): + self._checkClosed() with self._write_lock: self._flush_unlocked() if pos is None: @@ -1067,12 +1073,11 @@ return self.raw.truncate(pos) def flush(self): + self._checkClosed() 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: @@ -1086,9 +1091,11 @@ raise BlockingIOError(e.errno, e.strerror, written) def tell(self): + self._checkClosed() return self.raw.tell() + len(self._write_buf) def seek(self, pos, whence=0): + self._checkClosed() with self._write_lock: self._flush_unlocked() return self.raw.seek(pos, whence) @@ -1186,6 +1193,7 @@ return pos def tell(self): + self._checkClosed() if self._write_buf: return self.raw.tell() + len(self._write_buf) else: @@ -1217,6 +1225,7 @@ return BufferedReader.read1(self, n) def write(self, b): + self._checkClosed() if self._read_buf: # Undo readahead with self._read_lock: @@ -1474,8 +1483,7 @@ return self.buffer.isatty() def write(self, s: str): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if not isinstance(s, str): raise TypeError("can't write %s to text stream" % s.__class__.__name__) @@ -1583,6 +1591,7 @@ return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip def tell(self): + self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if not self._telling: @@ -1653,8 +1662,7 @@ return self.buffer.truncate() def seek(self, cookie, whence=0): - if self.closed: - raise ValueError("tell on closed file") + self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if whence == 1: # seek relative to current position @@ -1712,6 +1720,7 @@ return cookie def read(self, n=None): + self._checkClosed() if n is None: n = -1 decoder = self._decoder or self._get_decoder() @@ -1732,6 +1741,7 @@ return result def __next__(self): + self._checkClosed() self._telling = False line = self.readline() if not line: @@ -1741,8 +1751,7 @@ return line def readline(self, limit=None): - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if limit is None: limit = -1 @@ -1963,8 +1972,7 @@ def getvalue(self) -> str: """Retrieve the entire contents of the object.""" - if self.closed: - raise ValueError("read on closed file") + self._checkClosed() return self._getvalue() def write(self, s: str) -> int: @@ -1972,8 +1980,7 @@ Returns the number of characters written. """ - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if not isinstance(s, str): raise TypeError("can't write %s to text stream" % s.__class__.__name__) @@ -1990,8 +1997,7 @@ 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") + self._checkClosed() if n is None: n = -1 res = self._pending @@ -2006,8 +2012,7 @@ def tell(self) -> int: """Tell the current file position.""" - if self.closed: - raise ValueError("tell from closed file") + self._checkClosed() if self._pending: return self._tell() - len(self._pending) else: @@ -2022,8 +2027,7 @@ 2 End of stream - pos must be 0. Returns the new absolute position. """ - if self.closed: - raise ValueError("seek from closed file") + self._checkClosed() self._pending = "" return self._seek(pos, whence) @@ -2034,14 +2038,12 @@ returned by tell(). Imply an absolute seek to pos. Returns the new absolute position. """ - if self.closed: - raise ValueError("truncate from closed file") + self._checkClosed() self._pending = "" return self._truncate(pos) def readline(self, limit: int = None) -> str: - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if limit is None: limit = -1 if limit >= 0: Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Fri Jan 9 20:54:29 2009 @@ -1324,6 +1324,45 @@ f.close() g.close() + def test_io_after_close(self): + for kwargs in [ + {"mode": "w"}, + {"mode": "wb"}, + {"mode": "w", "buffering": 1}, + {"mode": "w", "buffering": 2}, + {"mode": "wb", "buffering": 0}, + {"mode": "r"}, + {"mode": "rb"}, + {"mode": "r", "buffering": 1}, + {"mode": "r", "buffering": 2}, + {"mode": "rb", "buffering": 0}, + {"mode": "w+"}, + {"mode": "w+b"}, + {"mode": "w+", "buffering": 1}, + {"mode": "w+", "buffering": 2}, + {"mode": "w+b", "buffering": 0}, + ]: + f = io.open(support.TESTFN, **kwargs) + f.close() + self.assertRaises(ValueError, f.flush) + self.assertRaises(ValueError, f.fileno) + self.assertRaises(ValueError, f.isatty) + self.assertRaises(ValueError, f.__iter__) + if hasattr(f, "peek"): + self.assertRaises(ValueError, f.peek, 1) + self.assertRaises(ValueError, f.read) + if hasattr(f, "read1"): + self.assertRaises(ValueError, f.read1, 1024) + if hasattr(f, "readinto"): + self.assertRaises(ValueError, f.readinto, bytearray(1024)) + self.assertRaises(ValueError, f.readline) + self.assertRaises(ValueError, f.readlines) + self.assertRaises(ValueError, f.seek, 0) + self.assertRaises(ValueError, f.tell) + self.assertRaises(ValueError, f.truncate) + self.assertRaises(ValueError, f.write, "") + self.assertRaises(ValueError, f.writelines, []) + def test_main(): support.run_unittest(IOTest, BytesIOTest, StringIOTest, Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 9 20:54:29 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4604: Some objects of the I/O library could still be used after + having been closed (for instance, a read() call could return some + previously buffered data). Patch by Dmitry Vasiliev. + - Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being From python-checkins at python.org Fri Jan 9 21:03:27 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 9 Jan 2009 21:03:27 +0100 (CET) Subject: [Python-checkins] r68455 - python/trunk/Python/thread_nt.h Message-ID: <20090109200327.DAD7F1E4002@bag.python.org> Author: kristjan.jonsson Date: Fri Jan 9 21:03:27 2009 New Revision: 68455 Log: Issue 3582. Improved thread support and TLS for Windows Modified: python/trunk/Python/thread_nt.h Modified: python/trunk/Python/thread_nt.h ============================================================================== --- python/trunk/Python/thread_nt.h (original) +++ python/trunk/Python/thread_nt.h Fri Jan 9 21:03:27 2009 @@ -104,20 +104,16 @@ typedef struct { void (*func)(void*); void *arg; - long id; - HANDLE done; } callobj; -static int +/* thunker to call a __cdecl function instead of a __stdcall */ +static unsigned __stdcall bootstrap(void *call) { callobj *obj = (callobj*)call; - /* copy callobj since other thread might free it before we're done */ void (*func)(void*) = obj->func; void *arg = obj->arg; - - obj->id = PyThread_get_thread_ident(); - ReleaseSemaphore(obj->done, 1, NULL); + HeapFree(GetProcessHeap(), 0, obj); func(arg); return 0; } @@ -125,42 +121,41 @@ long PyThread_start_new_thread(void (*func)(void *), void *arg) { - Py_uintptr_t rv; - callobj obj; - + HANDLE hThread; + unsigned threadID; + callobj *obj; + dprintf(("%ld: PyThread_start_new_thread called\n", PyThread_get_thread_ident())); if (!initialized) PyThread_init_thread(); - obj.id = -1; /* guilty until proved innocent */ - obj.func = func; - obj.arg = arg; - obj.done = CreateSemaphore(NULL, 0, 1, NULL); - if (obj.done == NULL) + obj = (callobj*)HeapAlloc(GetProcessHeap(), 0, sizeof(*obj)); + if (!obj) return -1; - - rv = _beginthread(bootstrap, + obj->func = func; + obj->arg = arg; + hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(_pythread_stacksize, - Py_ssize_t, int), - &obj); - if (rv == (Py_uintptr_t)-1) { + Py_ssize_t, unsigned int), + bootstrap, obj, + 0, &threadID); + if (hThread == 0) { /* I've seen errno == EAGAIN here, which means "there are * too many threads". */ - dprintf(("%ld: PyThread_start_new_thread failed: %p errno %d\n", - PyThread_get_thread_ident(), (void*)rv, errno)); - obj.id = -1; + dprintf(("%ld: PyThread_start_new_thread failed, errno %d\n", + PyThread_get_thread_ident(), errno)); + threadID = (unsigned)-1; + HeapFree(GetProcessHeap(), 0, obj); } else { dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", - PyThread_get_thread_ident(), (void*)rv)); + PyThread_get_thread_ident(), (void*)hThread)); /* wait for thread to initialize, so we can get its id */ - WaitForSingleObject(obj.done, INFINITE); - assert(obj.id != -1); + CloseHandle(hThread); } - CloseHandle((HANDLE)obj.done); - return obj.id; + return (long) threadID; } /* @@ -176,52 +171,22 @@ return GetCurrentThreadId(); } -static void -do_PyThread_exit_thread(int no_cleanup) -{ - dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); - if (!initialized) - if (no_cleanup) - _exit(0); - else - exit(0); - _endthread(); -} - void PyThread_exit_thread(void) { - do_PyThread_exit_thread(0); -} - -void -PyThread__exit_thread(void) -{ - do_PyThread_exit_thread(1); -} - -#ifndef NO_EXIT_PROG -static void -do_PyThread_exit_prog(int status, int no_cleanup) -{ - dprintf(("PyThread_exit_prog(%d) called\n", status)); + dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); if (!initialized) - if (no_cleanup) - _exit(status); - else - exit(status); + exit(0); + _endthreadex(0); } +#ifndef NO_EXIT_PROG void PyThread_exit_prog(int status) { - do_PyThread_exit_prog(status, 0); -} - -void -PyThread__exit_prog(int status) -{ - do_PyThread_exit_prog(status, 1); + dprintf(("PyThread_exit_prog(%d) called\n", status)); + if (!initialized) + exit(status); } #endif /* NO_EXIT_PROG */ @@ -309,3 +274,64 @@ } #define THREAD_SET_STACKSIZE(x) _pythread_nt_set_stacksize(x) + + +/* use native Windows TLS functions */ +#define Py_HAVE_NATIVE_TLS + +#ifdef Py_HAVE_NATIVE_TLS +int +PyThread_create_key(void) +{ + return (int) TlsAlloc(); +} + +void +PyThread_delete_key(int key) +{ + TlsFree(key); +} + +/* We must be careful to emulate the strange semantics implemented in thread.c, + * where the value is only set if it hasn't been set before. + */ +int +PyThread_set_key_value(int key, void *value) +{ + BOOL ok; + void *oldvalue; + + assert(value != NULL); + oldvalue = TlsGetValue(key); + if (oldvalue != NULL) + /* ignore value if already set */ + return 0; + ok = TlsSetValue(key, value); + if (!ok) + return -1; + return 0; +} + +void * +PyThread_get_key_value(int key) +{ + return TlsGetValue(key); +} + +void +PyThread_delete_key_value(int key) +{ + /* NULL is used as "key missing", and it is also the default + * given by TlsGetValue() if nothing has been set yet. + */ + TlsSetValue(key, NULL); +} + +/* reinitialization of TLS is not necessary after fork when using + * the native TLS functions. And forking isn't supported on Windows either. + */ +void +PyThread_ReInitTLS(void) +{} + +#endif From python-checkins at python.org Fri Jan 9 21:08:07 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 21:08:07 +0100 (CET) Subject: [Python-checkins] r68456 - in python/branches/release30-maint: Lib/io.py Lib/test/test_io.py Misc/NEWS Message-ID: <20090109200807.DB7E61E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 21:08:07 2009 New Revision: 68456 Log: Merged revisions 68454 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68454 | antoine.pitrou | 2009-01-09 20:54:29 +0100 (ven., 09 janv. 2009) | 5 lines Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/io.py python/branches/release30-maint/Lib/test/test_io.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/io.py ============================================================================== --- python/branches/release30-maint/Lib/io.py (original) +++ python/branches/release30-maint/Lib/io.py Fri Jan 9 21:08:07 2009 @@ -340,6 +340,7 @@ def tell(self) -> int: """Return current stream position.""" + self._checkClosed() return self.seek(0, 1) def truncate(self, pos: int = None) -> int: @@ -358,6 +359,8 @@ This is not implemented for read-only and non-blocking streams. """ # XXX Should this return the number of bytes written??? + if self.__closed: + raise ValueError("I/O operation on closed file.") __closed = False @@ -530,6 +533,7 @@ 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 @@ -567,6 +571,7 @@ Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read. """ + self._checkClosed() if n is None: n = -1 if n < 0: @@ -578,6 +583,7 @@ def readall(self): """Read until EOF, using multiple read() call.""" + self._checkClosed() res = bytearray() while True: data = self.read(DEFAULT_BUFFER_SIZE) @@ -673,6 +679,7 @@ data at the moment. """ # XXX This ought to work with anything that supports the buffer API + self._checkClosed() data = self.read(len(b)) n = len(data) try: @@ -787,13 +794,11 @@ def getvalue(self): """Return the bytes value (contents) of the buffer """ - if self.closed: - raise ValueError("getvalue on closed file") + self._checkClosed() return bytes(self._buffer) def read(self, n=None): - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if n is None: n = -1 if n < 0: @@ -811,8 +816,7 @@ return self.read(n) def write(self, b): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if isinstance(b, str): raise TypeError("can't write str to binary stream") n = len(b) @@ -829,8 +833,7 @@ return n def seek(self, pos, whence=0): - if self.closed: - raise ValueError("seek on closed file") + self._checkClosed() try: pos = pos.__index__() except AttributeError as err: @@ -848,13 +851,11 @@ return self._pos def tell(self): - if self.closed: - raise ValueError("tell on closed file") + self._checkClosed() return self._pos def truncate(self, pos=None): - if self.closed: - raise ValueError("truncate on closed file") + self._checkClosed() if pos is None: pos = self._pos elif pos < 0: @@ -914,6 +915,7 @@ mode. If n is negative, read until EOF or until read() would block. """ + self._checkClosed() with self._read_lock: return self._read_unlocked(n) @@ -970,6 +972,7 @@ do at most one raw read to satisfy it. We never return more than self.buffer_size. """ + self._checkClosed() with self._read_lock: return self._peek_unlocked(n) @@ -988,6 +991,7 @@ """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. + self._checkClosed() if n <= 0: return b"" with self._read_lock: @@ -996,9 +1000,11 @@ min(n, len(self._read_buf) - self._read_pos)) def tell(self): + self._checkClosed() return self.raw.tell() - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): + self._checkClosed() with self._read_lock: if whence == 1: pos -= len(self._read_buf) - self._read_pos @@ -1029,8 +1035,7 @@ self._write_lock = Lock() def write(self, b): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if isinstance(b, str): raise TypeError("can't write str to binary stream") with self._write_lock: @@ -1060,6 +1065,7 @@ return written def truncate(self, pos=None): + self._checkClosed() with self._write_lock: self._flush_unlocked() if pos is None: @@ -1067,12 +1073,11 @@ return self.raw.truncate(pos) def flush(self): + self._checkClosed() 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: @@ -1086,9 +1091,11 @@ raise BlockingIOError(e.errno, e.strerror, written) def tell(self): + self._checkClosed() return self.raw.tell() + len(self._write_buf) def seek(self, pos, whence=0): + self._checkClosed() with self._write_lock: self._flush_unlocked() return self.raw.seek(pos, whence) @@ -1186,6 +1193,7 @@ return pos def tell(self): + self._checkClosed() if self._write_buf: return self.raw.tell() + len(self._write_buf) else: @@ -1217,6 +1225,7 @@ return BufferedReader.read1(self, n) def write(self, b): + self._checkClosed() if self._read_buf: # Undo readahead with self._read_lock: @@ -1474,8 +1483,7 @@ return self.buffer.isatty() def write(self, s: str): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if not isinstance(s, str): raise TypeError("can't write %s to text stream" % s.__class__.__name__) @@ -1583,6 +1591,7 @@ return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip def tell(self): + self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if not self._telling: @@ -1653,8 +1662,7 @@ return self.buffer.truncate() def seek(self, cookie, whence=0): - if self.closed: - raise ValueError("tell on closed file") + self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if whence == 1: # seek relative to current position @@ -1712,6 +1720,7 @@ return cookie def read(self, n=None): + self._checkClosed() if n is None: n = -1 decoder = self._decoder or self._get_decoder() @@ -1732,6 +1741,7 @@ return result def __next__(self): + self._checkClosed() self._telling = False line = self.readline() if not line: @@ -1741,8 +1751,7 @@ return line def readline(self, limit=None): - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if limit is None: limit = -1 @@ -1963,8 +1972,7 @@ def getvalue(self) -> str: """Retrieve the entire contents of the object.""" - if self.closed: - raise ValueError("read on closed file") + self._checkClosed() return self._getvalue() def write(self, s: str) -> int: @@ -1972,8 +1980,7 @@ Returns the number of characters written. """ - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if not isinstance(s, str): raise TypeError("can't write %s to text stream" % s.__class__.__name__) @@ -1990,8 +1997,7 @@ 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") + self._checkClosed() if n is None: n = -1 res = self._pending @@ -2006,8 +2012,7 @@ def tell(self) -> int: """Tell the current file position.""" - if self.closed: - raise ValueError("tell from closed file") + self._checkClosed() if self._pending: return self._tell() - len(self._pending) else: @@ -2022,8 +2027,7 @@ 2 End of stream - pos must be 0. Returns the new absolute position. """ - if self.closed: - raise ValueError("seek from closed file") + self._checkClosed() self._pending = "" return self._seek(pos, whence) @@ -2034,14 +2038,12 @@ returned by tell(). Imply an absolute seek to pos. Returns the new absolute position. """ - if self.closed: - raise ValueError("truncate from closed file") + self._checkClosed() self._pending = "" return self._truncate(pos) def readline(self, limit: int = None) -> str: - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if limit is None: limit = -1 if limit >= 0: 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 Fri Jan 9 21:08:07 2009 @@ -1324,6 +1324,45 @@ f.close() g.close() + def test_io_after_close(self): + for kwargs in [ + {"mode": "w"}, + {"mode": "wb"}, + {"mode": "w", "buffering": 1}, + {"mode": "w", "buffering": 2}, + {"mode": "wb", "buffering": 0}, + {"mode": "r"}, + {"mode": "rb"}, + {"mode": "r", "buffering": 1}, + {"mode": "r", "buffering": 2}, + {"mode": "rb", "buffering": 0}, + {"mode": "w+"}, + {"mode": "w+b"}, + {"mode": "w+", "buffering": 1}, + {"mode": "w+", "buffering": 2}, + {"mode": "w+b", "buffering": 0}, + ]: + f = io.open(support.TESTFN, **kwargs) + f.close() + self.assertRaises(ValueError, f.flush) + self.assertRaises(ValueError, f.fileno) + self.assertRaises(ValueError, f.isatty) + self.assertRaises(ValueError, f.__iter__) + if hasattr(f, "peek"): + self.assertRaises(ValueError, f.peek, 1) + self.assertRaises(ValueError, f.read) + if hasattr(f, "read1"): + self.assertRaises(ValueError, f.read1, 1024) + if hasattr(f, "readinto"): + self.assertRaises(ValueError, f.readinto, bytearray(1024)) + self.assertRaises(ValueError, f.readline) + self.assertRaises(ValueError, f.readlines) + self.assertRaises(ValueError, f.seek, 0) + self.assertRaises(ValueError, f.tell) + self.assertRaises(ValueError, f.truncate) + self.assertRaises(ValueError, f.write, "") + self.assertRaises(ValueError, f.writelines, []) + def test_main(): support.run_unittest(IOTest, BytesIOTest, StringIOTest, Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Jan 9 21:08:07 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4604: Some objects of the I/O library could still be used after + having been closed (for instance, a read() call could return some + previously buffered data). Patch by Dmitry Vasiliev. + - Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being From python-checkins at python.org Fri Jan 9 21:11:00 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 9 Jan 2009 21:11:00 +0100 (CET) Subject: [Python-checkins] r68457 - python/trunk/Python/import.c Message-ID: <20090109201100.31DE91E4047@bag.python.org> Author: kristjan.jonsson Date: Fri Jan 9 21:10:59 2009 New Revision: 68457 Log: Issue 3677: Fix import from UNC paths on Windows. Modified: python/trunk/Python/import.c Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Fri Jan 9 21:10:59 2009 @@ -3198,24 +3198,11 @@ return -1; } else { #ifndef RISCOS +#ifndef MS_WINDOWS struct stat statbuf; int rv; rv = stat(path, &statbuf); -#ifdef MS_WINDOWS - /* MS Windows stat() chokes on paths like C:\path\. Try to - * recover *one* time by stripping off a trailing slash or - * backslash. http://bugs.python.org/issue1293 - */ - if (rv != 0 && pathlen <= MAXPATHLEN && - (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { - char mangled[MAXPATHLEN+1]; - - strcpy(mangled, path); - mangled[pathlen-1] = '\0'; - rv = stat(mangled, &statbuf); - } -#endif if (rv == 0) { /* it exists */ if (S_ISDIR(statbuf.st_mode)) { @@ -3225,7 +3212,24 @@ return -1; } } -#else +#else /* MS_WINDOWS */ + DWORD rv; + /* see issue1293 and issue3677: + * stat() on Windows doesn't recognise paths like + * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. + */ + rv = GetFileAttributesA(path); + if (rv != INVALID_FILE_ATTRIBUTES) { + /* it exists */ + if (rv & FILE_ATTRIBUTE_DIRECTORY) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif +#else /* RISCOS */ if (object_exists(path)) { /* it exists */ if (isdir(path)) { From python-checkins at python.org Fri Jan 9 21:23:17 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 9 Jan 2009 21:23:17 +0100 (CET) Subject: [Python-checkins] r68458 - python/trunk/Lib/httplib.py Message-ID: <20090109202317.50F041E4002@bag.python.org> Author: kristjan.jonsson Date: Fri Jan 9 21:23:16 2009 New Revision: 68458 Log: Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. Modified: python/trunk/Lib/httplib.py Modified: python/trunk/Lib/httplib.py ============================================================================== --- python/trunk/Lib/httplib.py (original) +++ python/trunk/Lib/httplib.py Fri Jan 9 21:23:16 2009 @@ -738,6 +738,7 @@ """Send the currently buffered request and clear the buffer. Appends an extra \\r\\n to the buffer. + A message_body may be specified, to be appended to the request. """ self._buffer.extend(("", "")) msg = "\r\n".join(self._buffer) @@ -745,9 +746,14 @@ # If msg and message_body are sent in a single send() call, # it will avoid performance problems caused by the interaction # between delayed ack and the Nagle algorithim. - if message_body is not None: + if isinstance(message_body, str): msg += message_body + message_body = None self.send(msg) + if message_body is not None: + #message_body was not a string (i.e. it is a file) and + #we must run the risk of Nagle + self.send(message_body) def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): """Send a request to the server. @@ -927,12 +933,7 @@ self._set_content_length(body) for hdr, value in headers.iteritems(): self.putheader(hdr, value) - if isinstance(body, str): - self.endheaders(body) - else: - self.endheaders() - if body: # when body is a file rather than a string - self.send(body) + self.endheaders(body) def getresponse(self): "Get the response from the server." From python-checkins at python.org Fri Jan 9 21:27:17 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 9 Jan 2009 21:27:17 +0100 (CET) Subject: [Python-checkins] r68459 - in python/trunk/Lib: logging/handlers.py urllib.py Message-ID: <20090109202717.6F8681E4002@bag.python.org> Author: kristjan.jonsson Date: Fri Jan 9 21:27:16 2009 New Revision: 68459 Log: Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. Modified: python/trunk/Lib/logging/handlers.py python/trunk/Lib/urllib.py Modified: python/trunk/Lib/logging/handlers.py ============================================================================== --- python/trunk/Lib/logging/handlers.py (original) +++ python/trunk/Lib/logging/handlers.py Fri Jan 9 21:27:16 2009 @@ -1027,9 +1027,7 @@ h.putheader("Content-type", "application/x-www-form-urlencoded") h.putheader("Content-length", str(len(data))) - h.endheaders() - if self.method == "POST": - h.send(data) + h.endheaders(data if self.method == "POST" else None) h.getreply() #can't do anything with the result except (KeyboardInterrupt, SystemExit): raise Modified: python/trunk/Lib/urllib.py ============================================================================== --- python/trunk/Lib/urllib.py (original) +++ python/trunk/Lib/urllib.py Fri Jan 9 21:27:16 2009 @@ -335,9 +335,7 @@ if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) - h.endheaders() - if data is not None: - h.send(data) + h.endheaders(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == -1: @@ -430,9 +428,7 @@ if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) - h.endheaders() - if data is not None: - h.send(data) + h.endheaders(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == -1: From buildbot at python.org Fri Jan 9 21:29:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 20:29:25 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090109202926.137CF1E4022@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/4442 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: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 9 21:31:28 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 9 Jan 2009 21:31:28 +0100 (CET) Subject: [Python-checkins] r68460 - python/trunk/Python/ceval.c Message-ID: <20090109203128.483841E4017@bag.python.org> Author: kristjan.jonsson Date: Fri Jan 9 21:31:26 2009 New Revision: 68460 Log: Issue 4293: Make Py_AddPendingCall() thread safe Modified: python/trunk/Python/ceval.c Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Fri Jan 9 21:31:26 2009 @@ -213,6 +213,7 @@ #include "pythread.h" static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */ +static PyThread_type_lock pending_lock = 0; /* for pending calls */ static long main_thread = 0; int @@ -284,6 +285,7 @@ adding a new function to each thread_*.h. Instead, just create a new lock and waste a little bit of memory */ interpreter_lock = PyThread_allocate_lock(); + pending_lock = PyThread_allocate_lock(); PyThread_acquire_lock(interpreter_lock, 1); main_thread = PyThread_get_thread_ident(); @@ -356,19 +358,145 @@ #ifdef WITH_THREAD Any thread can schedule pending calls, but only the main thread will execute them. + There is no facility to schedule calls to a particular thread, but + that should be easy to change, should that ever be required. In + that case, the static variables here should go into the python + threadstate. #endif +*/ + +#ifdef WITH_THREAD + +/* The WITH_THREAD implementation is thread-safe. It allows + scheduling to be made from any thread, and even from an executing + callback. + */ + +#define NPENDINGCALLS 32 +static struct { + int (*func)(void *); + void *arg; +} pendingcalls[NPENDINGCALLS]; +static int pendingfirst = 0; +static int pendinglast = 0; +static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */ +static char pendingbusy = 0; + +int +Py_AddPendingCall(int (*func)(void *), void *arg) +{ + int i, j, result=0; + PyThread_type_lock lock = pending_lock; + + /* try a few times for the lock. Since this mechanism is used + * for signal handling (on the main thread), there is a (slim) + * chance that a signal is delivered on the same thread while we + * hold the lock during the Py_MakePendingCalls() function. + * This avoids a deadlock in that case. + * Note that signals can be delivered on any thread. In particular, + * on Windows, a SIGINT is delivered on a system-created worker + * thread. + * We also check for lock being NULL, in the unlikely case that + * this function is called before any bytecode evaluation takes place. + */ + if (lock != NULL) { + for (i = 0; i<100; i++) { + if (PyThread_acquire_lock(lock, NOWAIT_LOCK)) + break; + } + if (i == 100) + return -1; + } - XXX WARNING! ASYNCHRONOUSLY EXECUTING CODE! + i = pendinglast; + j = (i + 1) % NPENDINGCALLS; + if (j == pendingfirst) { + result = -1; /* Queue full */ + } else { + pendingcalls[i].func = func; + pendingcalls[i].arg = arg; + pendinglast = j; + } + /* signal main loop */ + _Py_Ticker = 0; + pendingcalls_to_do = 1; + if (lock != NULL) + PyThread_release_lock(lock); + return result; +} + +int +Py_MakePendingCalls(void) +{ + int i; + int r = 0; + + if (!pending_lock) { + /* initial allocation of the lock */ + pending_lock = PyThread_allocate_lock(); + if (pending_lock == NULL) + return -1; + } + + /* only service pending calls on main thread */ + if (main_thread && PyThread_get_thread_ident() != main_thread) + return 0; + /* don't perform recursive pending calls */ + if (pendingbusy) + return 0; + pendingbusy = 1; + /* perform a bounded number of calls, in case of recursion */ + for (i=0; i The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/50 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_httpservers ====================================================================== FAIL: test_post (test.test_httpservers.CGIHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_httpservers.py", line 330, in test_post self.assertEquals(res.read(), b'1, python, 123456\n') AssertionError: b'' != b'1, python, 123456\n' sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 22:20:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 21:20:59 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090109212100.394201E4002@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/25 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: 3 tests failed: test_email test_mailbox test_socket ====================================================================== ERROR: testShutdown (test.test_socket.BasicTCPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_socket.py", line 121, in _tearDown self.fail(msg) AssertionError: [Errno 57] Socket is not connected make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 9 22:35:16 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 9 Jan 2009 22:35:16 +0100 (CET) Subject: [Python-checkins] r68461 - in python/trunk: Doc/c-api/init.rst Doc/whatsnew/2.7.rst Lib/test/test_capi.py Modules/_testcapimodule.c Message-ID: <20090109213516.B25E11E4002@bag.python.org> Author: kristjan.jonsson Date: Fri Jan 9 22:35:16 2009 New Revision: 68461 Log: Issue 4293: Make Py_AddPendingCall() thread safe Add test cases and documentation Modified: python/trunk/Doc/c-api/init.rst python/trunk/Doc/whatsnew/2.7.rst python/trunk/Lib/test/test_capi.py python/trunk/Modules/_testcapimodule.c Modified: python/trunk/Doc/c-api/init.rst ============================================================================== --- python/trunk/Doc/c-api/init.rst (original) +++ python/trunk/Doc/c-api/init.rst Fri Jan 9 22:35:16 2009 @@ -780,6 +780,50 @@ .. versionadded:: 2.3 + +Asynchronous Notifications +========================== + +A mechanism is provided to make asynchronous notifications to the the main +interpreter thread. These notifications take the form of a function +pointer and a void argument. + +.. index:: single: setcheckinterval() (in module sys) + +Every check interval, when the interpreter lock is released and reacquired, +python will also call any such provided functions. This can be used for +example by asynchronous IO handlers. The notification can be scheduled +from a worker thread and the actual call than made at the earliest +convenience by the main thread where it has possession of the global +interpreter lock and can perform any Python API calls. + +.. cfunction:: void Py_AddPendingCall( int (*func)(void *), void *arg) ) + + .. index:: single: Py_AddPendingCall() + + Post a notification to the Python main thread. If successful, + \*:attr`func` will be called with the argument :attr:`arg` at the earliest + convenience. \*:attr:`func` will be called having the global interpreter + lock held and can thus use the full Python API and can take any + action such as setting object attributes to signal IO completion. + It must return 0 on success, or -1 signalling an exception. + The notification function won't be interrupted to perform another + asynchronous notification recursively, + but it can still be interrupted to switch threads if the interpreter + lock is released, for example, if it calls back into python code. + + This function returns 0 on success in which case the notification has been + scheduled. Otherwise, for example if the notification buffer is full, + it returns -1 without setting any exception. + + This function can be called on any thread, be it a Python thread or + some other system thread. If it is a Python thread, it doesen't matter if + it holds the global interpreter lock or not. + + .. versionadded:: 2.7 + + + .. _profiling: Profiling and Tracing Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Fri Jan 9 22:35:16 2009 @@ -60,6 +60,11 @@ .. ======================================================================== +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 ====================== Modified: python/trunk/Lib/test/test_capi.py ============================================================================== --- python/trunk/Lib/test/test_capi.py (original) +++ python/trunk/Lib/test/test_capi.py Fri Jan 9 22:35:16 2009 @@ -2,9 +2,74 @@ # these are all functions _testcapi exports whose name begins with 'test_'. import sys +import time +import random +import unittest +import threading from test import test_support import _testcapi +class TestPendingCalls(unittest.TestCase): + + def pendingcalls_submit(self, l, n): + def callback(): + #this function can be interrupted by thread switching so let's + #use an atomic operation + l.append(None) + + for i in range(n): + time.sleep(random.random()*0.02) #0.01 secs on average + #try submitting callback until successful. + #rely on regular interrupt to flush queue if we are + #unsuccessful. + while True: + if _testcapi._pending_threadfunc(callback): + break; + + def pendingcalls_wait(self, l, n): + #now, stick around until l[0] has grown to 10 + count = 0; + while len(l) != n: + #this busy loop is where we expect to be interrupted to + #run our callbacks. Note that callbacks are only run on the + #main thread + if False and test_support.verbose: + print "(%i)"%(len(l),), + for i in xrange(1000): + a = i*i + count += 1 + self.failUnless(count < 10000, + "timeout waiting for %i callbacks, got %i"%(n, len(l))) + if False and test_support.verbose: + print "(%i)"%(len(l),) + + def test_pendingcalls_threaded(self): + l = [] + + #do every callback on a separate thread + n = 32 + threads = [] + for i in range(n): + t = threading.Thread(target=self.pendingcalls_submit, args = (l, 1)) + t.start() + threads.append(t) + + self.pendingcalls_wait(l, n) + + for t in threads: + t.join() + + def test_pendingcalls_non_threaded(self): + #again, just using the main thread, likely they will all be dispathced at + #once. It is ok to ask for too many, because we loop until we find a slot. + #the loop can be interrupted to dispatch. + #there are only 32 dispatch slots, so we go for twice that! + l = [] + n = 64 + self.pendingcalls_submit(l, n) + self.pendingcalls_wait(l, n) + + def test_main(): for name in dir(_testcapi): @@ -50,5 +115,7 @@ t.start() t.join() + test_support.run_unittest(TestPendingCalls) + if __name__ == "__main__": test_main() Modified: python/trunk/Modules/_testcapimodule.c ============================================================================== --- python/trunk/Modules/_testcapimodule.c (original) +++ python/trunk/Modules/_testcapimodule.c Fri Jan 9 22:35:16 2009 @@ -837,6 +837,43 @@ return NULL; Py_RETURN_NONE; } + +/* test Py_AddPendingCalls using threads */ +static int _pending_callback(void *arg) +{ + /* we assume the argument is callable object to which we own a reference */ + PyObject *callable = (PyObject *)arg; + PyObject *r = PyObject_CallObject(callable, NULL); + Py_DECREF(callable); + Py_XDECREF(r); + return r != NULL ? 0 : -1; +} + +/* The following requests n callbacks to _pending_callback. It can be + * run from any python thread. + */ +PyObject *pending_threadfunc(PyObject *self, PyObject *arg) +{ + PyObject *callable; + int r; + if (PyArg_ParseTuple(arg, "O", &callable) == 0) + return NULL; + + /* create the reference for the callbackwhile we hold the lock */ + Py_INCREF(callable); + + Py_BEGIN_ALLOW_THREADS + r = Py_AddPendingCall(&_pending_callback, callable); + Py_END_ALLOW_THREADS + + if (r<0) { + Py_DECREF(callable); /* unsuccessful add, destroy the extra reference */ + Py_INCREF(Py_False); + return Py_False; + } + Py_INCREF(Py_True); + return Py_True; +} #endif /* Some tests of PyString_FromFormat(). This needs more tests. */ @@ -941,6 +978,7 @@ #endif #ifdef WITH_THREAD {"_test_thread_state", test_thread_state, METH_VARARGS}, + {"_pending_threadfunc", pending_threadfunc, METH_VARARGS}, #endif {"traceback_print", traceback_print, METH_VARARGS}, {NULL, NULL} /* sentinel */ From python-checkins at python.org Fri Jan 9 22:40:55 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 22:40:55 +0100 (CET) Subject: [Python-checkins] r68462 - in python/trunk: Misc/NEWS Modules/gcmodule.c Message-ID: <20090109214055.B444C1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 22:40:55 2009 New Revision: 68462 Log: 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. Modified: python/trunk/Misc/NEWS python/trunk/Modules/gcmodule.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 9 22:40:55 2009 @@ -12,6 +12,12 @@ Core and Builtins ----------------- +- 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. + - Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. - Issue #1180193: When importing a module from a .pyc (or .pyo) file with Modified: python/trunk/Modules/gcmodule.c ============================================================================== --- python/trunk/Modules/gcmodule.c (original) +++ python/trunk/Modules/gcmodule.c Fri Jan 9 22:40:55 2009 @@ -63,6 +63,55 @@ /* Python string used to look for __del__ attribute. */ static PyObject *delstr = NULL; +/* This is the number of objects who survived the last full collection. It + approximates the number of long lived objects tracked by the GC. + + (by "full collection", we mean a collection of the oldest generation). +*/ +static Py_ssize_t long_lived_total = 0; + +/* This is the number of objects who survived all "non-full" collections, + and are awaiting to undergo a full collection for the first time. + +*/ +static Py_ssize_t long_lived_pending = 0; + +/* + NOTE: about the counting of long-lived objects. + + To limit the cost of garbage collection, there are two strategies; + - make each collection faster, e.g. by scanning fewer objects + - do less collections + This heuristic is about the latter strategy. + + In addition to the various configurable thresholds, we only trigger a + full collection if the ratio + long_lived_pending / long_lived_total + is above a given value (hardwired to 25%). + + The reason is that, while "non-full" collections (i.e., collections of + the young and middle generations) will always examine roughly the same + number of objects -- determined by the aforementioned thresholds --, + the cost of a full collection is proportional to the total number of + long-lived objects, which is virtually unbounded. + + Indeed, it has been remarked that doing a full collection every + of object creations entails a dramatic performance + degradation in workloads which consist in creating and storing lots of + long-lived objects (e.g. building a large list of GC-tracked objects would + show quadratic performance, instead of linear as expected: see issue #4074). + + Using the above ratio, instead, yields amortized linear performance in + the total number of objects (the effect of which can be summarized + thusly: "each full garbage collection is more and more costly as the + number of objects grows, but we do fewer and fewer of them"). + + This heuristic was suggested by Martin von L?wis on python-dev in + June 2008. His original analysis and proposal can be found at: + http://mail.python.org/pipermail/python-dev/2008-June/080579.html +*/ + + /* set for debugging information */ #define DEBUG_STATS (1<<0) /* print collection statistics */ #define DEBUG_COLLECTABLE (1<<1) /* print collectable objects */ @@ -826,8 +875,16 @@ move_unreachable(young, &unreachable); /* Move reachable objects to next generation. */ - if (young != old) + if (young != old) { + if (generation == NUM_GENERATIONS - 2) { + long_lived_pending += gc_list_size(young); + } gc_list_merge(young, old); + } + else { + long_lived_pending = 0; + long_lived_total = gc_list_size(young); + } /* All objects in unreachable are trash, but objects reachable from * finalizers can't safely be deleted. Python programmers should take @@ -921,6 +978,13 @@ * generations younger than it will be collected. */ for (i = NUM_GENERATIONS-1; i >= 0; i--) { if (generations[i].count > generations[i].threshold) { + /* Avoid quadratic performance degradation in number + of tracked objects. See comments at the beginning + of this file, and issue #4074. + */ + if (i == NUM_GENERATIONS - 1 + && long_lived_pending < long_lived_total / 4) + continue; n = collect(i); break; } From buildbot at python.org Fri Jan 9 22:43:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 21:43:32 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090109214332.8840C1E4002@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/44 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 buildbot at python.org Fri Jan 9 23:02:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 22:02:37 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090109220237.2CEAC1E4002@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/33 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_httpservers ====================================================================== FAIL: test_post (test.test_httpservers.CGIHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_httpservers.py", line 330, in test_post self.assertEquals(res.read(), b'1, python, 123456\n') AssertionError: b'' != b'1, python, 123456\n' sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 23:07:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 22:07:45 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090109220746.784821E400C@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/673 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: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Jan 9 23:08:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 22:08:37 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090109220837.ECA161E4002@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/498 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: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket ====================================================================== ERROR: testShutdown (test.test_socket.BasicTCPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_socket.py", line 120, in _tearDown self.fail(msg) AssertionError: [Errno 57] Socket is not connected make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Jan 9 23:12:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 23:12:30 +0100 (CET) Subject: [Python-checkins] r68463 - python/branches/py3k/Python/pythonrun.c Message-ID: <20090109221230.C592E1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 23:12:30 2009 New Revision: 68463 Log: Fix bug introduced in r68451: stdio must always be opened in line-buffered mode if isatty() is true. Modified: python/branches/py3k/Python/pythonrun.c Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Fri Jan 9 23:12:30 2009 @@ -734,10 +734,10 @@ int fd, int write_mode, char* name, char* encoding, char* errors) { - PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL; + PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL, *res; const char* mode; - const PyObject *line_buffering; - int buffering; + PyObject *line_buffering; + int buffering, isatty; if (Py_UnbufferedStdioFlag) buffering = 0; @@ -766,13 +766,21 @@ text = PyUnicode_FromString(name); if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0) goto error; - Py_CLEAR(raw); - Py_CLEAR(text); - - if (Py_UnbufferedStdioFlag) + res = PyObject_CallMethod(raw, "isatty", ""); + if (res == NULL) + goto error; + isatty = PyObject_IsTrue(res); + Py_DECREF(res); + if (isatty == -1) + goto error; + if (isatty || Py_UnbufferedStdioFlag) line_buffering = Py_True; else line_buffering = Py_False; + + Py_CLEAR(raw); + Py_CLEAR(text); + stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO", buf, encoding, errors, "\n", line_buffering); From buildbot at python.org Fri Jan 9 23:25:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 09 Jan 2009 22:25:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090109222553.094341E401C@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/82 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 9 23:26:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 23:26:34 +0100 (CET) Subject: [Python-checkins] r68464 - in python/branches/release30-maint: Python/pythonrun.c Message-ID: <20090109222634.C43E61E4049@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 23:26:34 2009 New Revision: 68464 Log: Merged revisions 68463 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68463 | antoine.pitrou | 2009-01-09 23:12:30 +0100 (ven., 09 janv. 2009) | 4 lines Fix bug introduced in r68451: stdio must always be opened in line-buffered mode if isatty() is true. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Python/pythonrun.c Modified: python/branches/release30-maint/Python/pythonrun.c ============================================================================== --- python/branches/release30-maint/Python/pythonrun.c (original) +++ python/branches/release30-maint/Python/pythonrun.c Fri Jan 9 23:26:34 2009 @@ -734,10 +734,10 @@ int fd, int write_mode, char* name, char* encoding, char* errors) { - PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL; + PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL, *res; const char* mode; - const PyObject *line_buffering; - int buffering; + PyObject *line_buffering; + int buffering, isatty; if (Py_UnbufferedStdioFlag) buffering = 0; @@ -766,13 +766,21 @@ text = PyUnicode_FromString(name); if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0) goto error; - Py_CLEAR(raw); - Py_CLEAR(text); - - if (Py_UnbufferedStdioFlag) + res = PyObject_CallMethod(raw, "isatty", ""); + if (res == NULL) + goto error; + isatty = PyObject_IsTrue(res); + Py_DECREF(res); + if (isatty == -1) + goto error; + if (isatty || Py_UnbufferedStdioFlag) line_buffering = Py_True; else line_buffering = Py_False; + + Py_CLEAR(raw); + Py_CLEAR(text); + stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO", buf, encoding, errors, "\n", line_buffering); From python-checkins at python.org Fri Jan 9 23:27:08 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 9 Jan 2009 23:27:08 +0100 (CET) Subject: [Python-checkins] r68465 - in python/branches/py3k: Misc/NEWS Modules/gcmodule.c Message-ID: <20090109222708.D41EF1E4013@bag.python.org> Author: antoine.pitrou Date: Fri Jan 9 23:27:08 2009 New Revision: 68465 Log: Merged revisions 68462 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68462 | antoine.pitrou | 2009-01-09 22:40:55 +0100 (ven., 09 janv. 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. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/gcmodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 9 23:27:08 2009 @@ -12,6 +12,12 @@ Core and Builtins ----------------- +- 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. + - Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. Modified: python/branches/py3k/Modules/gcmodule.c ============================================================================== --- python/branches/py3k/Modules/gcmodule.c (original) +++ python/branches/py3k/Modules/gcmodule.c Fri Jan 9 23:27:08 2009 @@ -68,6 +68,55 @@ /* Python string used to look for __del__ attribute. */ static PyObject *delstr = NULL; +/* This is the number of objects who survived the last full collection. It + approximates the number of long lived objects tracked by the GC. + + (by "full collection", we mean a collection of the oldest generation). +*/ +static Py_ssize_t long_lived_total = 0; + +/* This is the number of objects who survived all "non-full" collections, + and are awaiting to undergo a full collection for the first time. + +*/ +static Py_ssize_t long_lived_pending = 0; + +/* + NOTE: about the counting of long-lived objects. + + To limit the cost of garbage collection, there are two strategies; + - make each collection faster, e.g. by scanning fewer objects + - do less collections + This heuristic is about the latter strategy. + + In addition to the various configurable thresholds, we only trigger a + full collection if the ratio + long_lived_pending / long_lived_total + is above a given value (hardwired to 25%). + + The reason is that, while "non-full" collections (i.e., collections of + the young and middle generations) will always examine roughly the same + number of objects -- determined by the aforementioned thresholds --, + the cost of a full collection is proportional to the total number of + long-lived objects, which is virtually unbounded. + + Indeed, it has been remarked that doing a full collection every + of object creations entails a dramatic performance + degradation in workloads which consist in creating and storing lots of + long-lived objects (e.g. building a large list of GC-tracked objects would + show quadratic performance, instead of linear as expected: see issue #4074). + + Using the above ratio, instead, yields amortized linear performance in + the total number of objects (the effect of which can be summarized + thusly: "each full garbage collection is more and more costly as the + number of objects grows, but we do fewer and fewer of them"). + + This heuristic was suggested by Martin von L?wis on python-dev in + June 2008. His original analysis and proposal can be found at: + http://mail.python.org/pipermail/python-dev/2008-June/080579.html +*/ + + /* set for debugging information */ #define DEBUG_STATS (1<<0) /* print collection statistics */ #define DEBUG_COLLECTABLE (1<<1) /* print collectable objects */ @@ -795,8 +844,16 @@ move_unreachable(young, &unreachable); /* Move reachable objects to next generation. */ - if (young != old) + if (young != old) { + if (generation == NUM_GENERATIONS - 2) { + long_lived_pending += gc_list_size(young); + } gc_list_merge(young, old); + } + else { + long_lived_pending = 0; + long_lived_total = gc_list_size(young); + } /* All objects in unreachable are trash, but objects reachable from * finalizers can't safely be deleted. Python programmers should take @@ -890,6 +947,13 @@ * generations younger than it will be collected. */ for (i = NUM_GENERATIONS-1; i >= 0; i--) { if (generations[i].count > generations[i].threshold) { + /* Avoid quadratic performance degradation in number + of tracked objects. See comments at the beginning + of this file, and issue #4074. + */ + if (i == NUM_GENERATIONS - 1 + && long_lived_pending < long_lived_total / 4) + continue; n = collect(i); break; } From buildbot at python.org Sat Jan 10 01:29:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 00:29:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090110002939.C00DD1E4002@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/84 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 nnorwitz at gmail.com Sat Jan 10 02:40:16 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 9 Jan 2009 20:40:16 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090110014016.GA16058@python.psfb.org> svn update tools/sphinx At revision 68465. svn update tools/docutils At revision 68465. svn update tools/jinja2 At revision 68465. svn update tools/pygments At revision 68465. mkdir -p build/html build/doctrees python2.5 tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 6 source files that are out of date updating environment: 0 added, 6 changed, 0 removed reading sources... library/ctypes library/ftplib library/logging reST markup error: /home/neal/python/py3k/Doc/library/logging.rst:: (SEVERE/4) Duplicate ID: "module-logging.handlers". make: *** [build] Error 1 From python-checkins at python.org Sat Jan 10 04:37:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 04:37:09 +0100 (CET) Subject: [Python-checkins] r68466 - python/branches/release30-maint/Doc/library/logging.rst Message-ID: <20090110033709.12E2C1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 04:37:08 2009 New Revision: 68466 Log: fix markup Modified: python/branches/release30-maint/Doc/library/logging.rst Modified: python/branches/release30-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release30-maint/Doc/library/logging.rst (original) +++ python/branches/release30-maint/Doc/library/logging.rst Sat Jan 10 04:37:08 2009 @@ -1581,8 +1581,6 @@ WatchedFileHandler ^^^^^^^^^^^^^^^^^^ -.. module:: logging.handlers - The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. From python-checkins at python.org Sat Jan 10 05:11:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 05:11:21 +0100 (CET) Subject: [Python-checkins] r68467 - python/branches/py3k Message-ID: <20090110041121.E23CE1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 05:11:21 2009 New Revision: 68467 Log: Unblocked revisions 68425 via svnmerge ........ r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line fix markup ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 10 09:09:43 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 09:09:43 +0100 (CET) Subject: [Python-checkins] r68468 - in python/trunk/PC/VC6: _tkinter.dsp readme.txt tcl852.patch Message-ID: <20090110080943.E1AB01E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 09:09:43 2009 New Revision: 68468 Log: Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3) Added: python/trunk/PC/VC6/tcl852.patch Modified: python/trunk/PC/VC6/_tkinter.dsp python/trunk/PC/VC6/readme.txt Modified: python/trunk/PC/VC6/_tkinter.dsp ============================================================================== --- python/trunk/PC/VC6/_tkinter.dsp (original) +++ python/trunk/PC/VC6/_tkinter.dsp Sat Jan 10 09:09:43 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" @@ -82,7 +82,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/trunk/PC/VC6/readme.txt ============================================================================== --- python/trunk/PC/VC6/readme.txt (original) +++ python/trunk/PC/VC6/readme.txt Sat Jan 10 09:09:43 2009 @@ -63,18 +63,21 @@ _tkinter Python wrapper for the Tk windowing system. Requires building - Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.12. + Tcl/Tk first. Following are instructions for Tcl/Tk 8.5.2. Get source ---------- In the dist directory, run - svn export http://svn.python.org/projects/external/tcl8.4.12 - svn export http://svn.python.org/projects/external/tk8.4.12 - svn export http://svn.python.org/projects/external/tix-8.4.0 + svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2 + svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 + svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- - cd dist\tcl8.4.12\win + If your environment doesn't have struct _stat64, you need to apply + tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h. + + cd dist\tcl8.5.2\win run vcvars32.bat nmake -f makefile.vc nmake -f makefile.vc INSTALLDIR=..\..\tcltk install @@ -84,16 +87,16 @@ Optional: run tests, via nmake -f makefile.vc test - all.tcl: Total 10835 Passed 10096 Skipped 732 Failed 7 - Sourced 129 Test Files. - Files with failing tests: exec.test expr.test io.test main.test string.test stri + all.tcl: Total 24242 Passed 23358 Skipped 877 Failed 7 + Sourced 137 Test Files. + Files with failing tests: exec.test http.test io.test main.test string.test stri ngObj.test Build Tk -------- - cd dist\tk8.4.12\win - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd dist\tk8.5.2\win + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install XXX Should we compile with OPTS=threads? @@ -101,11 +104,11 @@ XXX failed. It popped up tons of little windows, and did lots of XXX stuff, and nothing blew up. - Built Tix - --------- - cd dist\tix-8.4.0\win - nmake -f python.mak - nmake -f python.mak install + Build Tix + --------- + cd dist\tix8.4.3\win + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install bz2 Python wrapper for the libbz2 compression library. Homepage Added: python/trunk/PC/VC6/tcl852.patch ============================================================================== --- (empty file) +++ python/trunk/PC/VC6/tcl852.patch Sat Jan 10 09:09:43 2009 @@ -0,0 +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; From python-checkins at python.org Sat Jan 10 09:12:09 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 09:12:09 +0100 (CET) Subject: [Python-checkins] r68469 - in python/trunk/PC/VC6: _tkinter.dsp readme.txt Message-ID: <20090110081209.87BC21E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 09:12:09 2009 New Revision: 68469 Log: Link to debug version of Tcl/Tk when python is built as debug version. Modified: python/trunk/PC/VC6/_tkinter.dsp python/trunk/PC/VC6/readme.txt Modified: python/trunk/PC/VC6/_tkinter.dsp ============================================================================== --- python/trunk/PC/VC6/_tkinter.dsp (original) +++ python/trunk/PC/VC6/_tkinter.dsp Sat Jan 10 09:12:09 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" Modified: python/trunk/PC/VC6/readme.txt ============================================================================== --- python/trunk/PC/VC6/readme.txt (original) +++ python/trunk/PC/VC6/readme.txt Sat Jan 10 09:12:09 2009 @@ -72,6 +72,10 @@ svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 + Debug Build + ----------- + To build debug version, add DEBUG=1 to all nmake call bellow. + Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- If your environment doesn't have struct _stat64, you need to apply From buildbot at python.org Sat Jan 10 10:04:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 09:04:22 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090110090422.C9B251E4002@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/500 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 nnorwitz at gmail.com Sat Jan 10 10:08:15 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 10 Jan 2009 04:08:15 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090110090815.GA23894@python.psfb.org> 328 tests OK. 1 test failed: test_smtplib 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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_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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 328 tests OK. 1 test failed: test_smtplib 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [656510 refs] From python-checkins at python.org Sat Jan 10 10:18:16 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 10:18:16 +0100 (CET) Subject: [Python-checkins] r68470 - python/trunk/PC/VC6/build_tkinter.py Message-ID: <20090110091816.3AAD71E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 10:18:16 2009 New Revision: 68470 Log: Added helper script to build Tcl/Tk. Added: python/trunk/PC/VC6/build_tkinter.py Added: python/trunk/PC/VC6/build_tkinter.py ============================================================================== --- (empty file) +++ python/trunk/PC/VC6/build_tkinter.py Sat Jan 10 10:18:16 2009 @@ -0,0 +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() From python-checkins at python.org Sat Jan 10 10:24:48 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 10:24:48 +0100 (CET) Subject: [Python-checkins] r68471 - in python/branches/release26-maint: PC/VC6/_tkinter.dsp PC/VC6/readme.txt PC/VC6/tcl852.patch Message-ID: <20090110092448.26B9F1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 10:24:47 2009 New Revision: 68471 Log: Merged revisions 68468 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68468 | hirokazu.yamamoto | 2009-01-10 17:09:43 +0900 | 1 line Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3) ........ Added: python/branches/release26-maint/PC/VC6/tcl852.patch - copied unchanged from r68468, /python/trunk/PC/VC6/tcl852.patch Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/PC/VC6/_tkinter.dsp python/branches/release26-maint/PC/VC6/readme.txt Modified: python/branches/release26-maint/PC/VC6/_tkinter.dsp ============================================================================== --- python/branches/release26-maint/PC/VC6/_tkinter.dsp (original) +++ python/branches/release26-maint/PC/VC6/_tkinter.dsp Sat Jan 10 10:24:47 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" @@ -82,7 +82,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/release26-maint/PC/VC6/readme.txt ============================================================================== --- python/branches/release26-maint/PC/VC6/readme.txt (original) +++ python/branches/release26-maint/PC/VC6/readme.txt Sat Jan 10 10:24:47 2009 @@ -63,18 +63,21 @@ _tkinter Python wrapper for the Tk windowing system. Requires building - Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.12. + Tcl/Tk first. Following are instructions for Tcl/Tk 8.5.2. Get source ---------- In the dist directory, run - svn export http://svn.python.org/projects/external/tcl8.4.12 - svn export http://svn.python.org/projects/external/tk8.4.12 - svn export http://svn.python.org/projects/external/tix-8.4.0 + svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2 + svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 + svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- - cd dist\tcl8.4.12\win + If your environment doesn't have struct _stat64, you need to apply + tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h. + + cd dist\tcl8.5.2\win run vcvars32.bat nmake -f makefile.vc nmake -f makefile.vc INSTALLDIR=..\..\tcltk install @@ -84,16 +87,16 @@ Optional: run tests, via nmake -f makefile.vc test - all.tcl: Total 10835 Passed 10096 Skipped 732 Failed 7 - Sourced 129 Test Files. - Files with failing tests: exec.test expr.test io.test main.test string.test stri + all.tcl: Total 24242 Passed 23358 Skipped 877 Failed 7 + Sourced 137 Test Files. + Files with failing tests: exec.test http.test io.test main.test string.test stri ngObj.test Build Tk -------- - cd dist\tk8.4.12\win - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd dist\tk8.5.2\win + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install XXX Should we compile with OPTS=threads? @@ -101,11 +104,11 @@ XXX failed. It popped up tons of little windows, and did lots of XXX stuff, and nothing blew up. - Built Tix - --------- - cd dist\tix-8.4.0\win - nmake -f python.mak - nmake -f python.mak install + Build Tix + --------- + cd dist\tix8.4.3\win + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install bz2 Python wrapper for the libbz2 compression library. Homepage From python-checkins at python.org Sat Jan 10 10:28:57 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 10:28:57 +0100 (CET) Subject: [Python-checkins] r68472 - in python/branches/release26-maint: PC/VC6/_tkinter.dsp PC/VC6/readme.txt Message-ID: <20090110092857.3BAFA1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 10:28:57 2009 New Revision: 68472 Log: Merged revisions 68469 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68469 | hirokazu.yamamoto | 2009-01-10 17:12:09 +0900 | 1 line Link to debug version of Tcl/Tk when python is built as debug version. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/PC/VC6/_tkinter.dsp python/branches/release26-maint/PC/VC6/readme.txt Modified: python/branches/release26-maint/PC/VC6/_tkinter.dsp ============================================================================== --- python/branches/release26-maint/PC/VC6/_tkinter.dsp (original) +++ python/branches/release26-maint/PC/VC6/_tkinter.dsp Sat Jan 10 10:28:57 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" Modified: python/branches/release26-maint/PC/VC6/readme.txt ============================================================================== --- python/branches/release26-maint/PC/VC6/readme.txt (original) +++ python/branches/release26-maint/PC/VC6/readme.txt Sat Jan 10 10:28:57 2009 @@ -72,6 +72,10 @@ svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 + Debug Build + ----------- + To build debug version, add DEBUG=1 to all nmake call bellow. + Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- If your environment doesn't have struct _stat64, you need to apply From python-checkins at python.org Sat Jan 10 10:35:47 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 10:35:47 +0100 (CET) Subject: [Python-checkins] r68473 - in python/branches/release26-maint: PC/VC6/build_tkinter.py Message-ID: <20090110093547.711631E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 10:35:47 2009 New Revision: 68473 Log: Merged revisions 68470 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68470 | hirokazu.yamamoto | 2009-01-10 18:18:16 +0900 | 1 line Added helper script to build Tcl/Tk. ........ Added: python/branches/release26-maint/PC/VC6/build_tkinter.py - copied unchanged from r68470, /python/trunk/PC/VC6/build_tkinter.py Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Sat Jan 10 11:36:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 10:36:49 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090110103649.D943A1E4002@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/41 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: 1 test failed: test_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 10 12:48:27 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 12:48:27 +0100 (CET) Subject: [Python-checkins] r68474 - in python/branches/py3k: Lib/tkinter/tix.py PC/VC6/_tkinter.dsp PC/VC6/build_tkinter.py PC/VC6/readme.txt PC/VC6/tcl852.patch Message-ID: <20090110114827.A9F301E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 12:48:27 2009 New Revision: 68474 Log: Merged revisions 68468-68470 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68468 | hirokazu.yamamoto | 2009-01-10 17:09:43 +0900 | 1 line Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3) ........ r68469 | hirokazu.yamamoto | 2009-01-10 17:12:09 +0900 | 1 line Link to debug version of Tcl/Tk when python is built as debug version. ........ r68470 | hirokazu.yamamoto | 2009-01-10 18:18:16 +0900 | 1 line Added helper script to build Tcl/Tk. ........ Added: python/branches/py3k/PC/VC6/build_tkinter.py - copied unchanged from r68470, /python/trunk/PC/VC6/build_tkinter.py python/branches/py3k/PC/VC6/tcl852.patch - copied unchanged from r68470, /python/trunk/PC/VC6/tcl852.patch Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/tkinter/tix.py python/branches/py3k/PC/VC6/_tkinter.dsp python/branches/py3k/PC/VC6/readme.txt Modified: python/branches/py3k/Lib/tkinter/tix.py ============================================================================== --- python/branches/py3k/Lib/tkinter/tix.py (original) +++ python/branches/py3k/Lib/tkinter/tix.py Sat Jan 10 12:48:27 2009 @@ -293,7 +293,7 @@ else: static_options = ['options'] - for k,v in cnf.items()[:]: + for k,v in list(cnf.items()): if k in static_options: extra = extra + ('-' + k, v) del cnf[k] @@ -448,7 +448,7 @@ # we must be careful not to destroy the frame widget since this # also destroys the parent NoteBook thus leading to an exception # in Tkinter when it finally calls Tcl to destroy the NoteBook - for c in self.children.values(): c.destroy() + for c in list(self.children.values()): c.destroy() if self._name in self.master.children: del self.master.children[self._name] if self._name in self.master.subwidget_list: Modified: python/branches/py3k/PC/VC6/_tkinter.dsp ============================================================================== --- python/branches/py3k/PC/VC6/_tkinter.dsp (original) +++ python/branches/py3k/PC/VC6/_tkinter.dsp Sat Jan 10 12:48:27 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" @@ -82,7 +82,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/py3k/PC/VC6/readme.txt ============================================================================== --- python/branches/py3k/PC/VC6/readme.txt (original) +++ python/branches/py3k/PC/VC6/readme.txt Sat Jan 10 12:48:27 2009 @@ -64,18 +64,25 @@ _tkinter Python wrapper for the Tk windowing system. Requires building - Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.12. + Tcl/Tk first. Following are instructions for Tcl/Tk 8.5.2. Get source ---------- In the dist directory, run - svn export http://svn.python.org/projects/external/tcl8.4.12 - svn export http://svn.python.org/projects/external/tk8.4.12 - svn export http://svn.python.org/projects/external/tix-8.4.0 + svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2 + svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 + svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 + + Debug Build + ----------- + To build debug version, add DEBUG=1 to all nmake call bellow. Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- - cd dist\tcl8.4.12\win + If your environment doesn't have struct _stat64, you need to apply + tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h. + + cd dist\tcl8.5.2\win run vcvars32.bat nmake -f makefile.vc nmake -f makefile.vc INSTALLDIR=..\..\tcltk install @@ -85,16 +92,16 @@ Optional: run tests, via nmake -f makefile.vc test - all.tcl: Total 10835 Passed 10096 Skipped 732 Failed 7 - Sourced 129 Test Files. - Files with failing tests: exec.test expr.test io.test main.test string.test stri + all.tcl: Total 24242 Passed 23358 Skipped 877 Failed 7 + Sourced 137 Test Files. + Files with failing tests: exec.test http.test io.test main.test string.test stri ngObj.test Build Tk -------- - cd dist\tk8.4.12\win - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd dist\tk8.5.2\win + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install XXX Should we compile with OPTS=threads? @@ -102,11 +109,11 @@ XXX failed. It popped up tons of little windows, and did lots of XXX stuff, and nothing blew up. - Built Tix - --------- - cd dist\tix-8.4.0\win - nmake -f python.mak - nmake -f python.mak install + Build Tix + --------- + cd dist\tix8.4.3\win + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install bz2 Python wrapper for the libbz2 compression library. Homepage From python-checkins at python.org Sat Jan 10 12:55:57 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 12:55:57 +0100 (CET) Subject: [Python-checkins] r68475 - python/branches/py3k/Lib/tkinter/tix.py Message-ID: <20090110115557.4CFB31E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 12:55:57 2009 New Revision: 68475 Log: Commit miss. Modified: python/branches/py3k/Lib/tkinter/tix.py Modified: python/branches/py3k/Lib/tkinter/tix.py ============================================================================== --- python/branches/py3k/Lib/tkinter/tix.py (original) +++ python/branches/py3k/Lib/tkinter/tix.py Sat Jan 10 12:55:57 2009 @@ -293,7 +293,7 @@ else: static_options = ['options'] - for k,v in list(cnf.items()): + for k,v in cnf.items()[:]: if k in static_options: extra = extra + ('-' + k, v) del cnf[k] @@ -448,7 +448,7 @@ # we must be careful not to destroy the frame widget since this # also destroys the parent NoteBook thus leading to an exception # in Tkinter when it finally calls Tcl to destroy the NoteBook - for c in list(self.children.values()): c.destroy() + for c in self.children.values(): c.destroy() if self._name in self.master.children: del self.master.children[self._name] if self._name in self.master.subwidget_list: From python-checkins at python.org Sat Jan 10 13:14:31 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Sat, 10 Jan 2009 13:14:31 +0100 (CET) Subject: [Python-checkins] r68476 - python/trunk/Python/thread_nt.h Message-ID: <20090110121431.5B7161E4010@bag.python.org> Author: kristjan.jonsson Date: Sat Jan 10 13:14:31 2009 New Revision: 68476 Log: Issue 4906: Preserve windows error state across PyThread_get_key_value Modified: python/trunk/Python/thread_nt.h Modified: python/trunk/Python/thread_nt.h ============================================================================== --- python/trunk/Python/thread_nt.h (original) +++ python/trunk/Python/thread_nt.h Sat Jan 10 13:14:31 2009 @@ -315,7 +315,16 @@ void * PyThread_get_key_value(int key) { - return TlsGetValue(key); + /* because TLS is used in the Py_END_ALLOW_THREAD macro, + * it is necessary to preserve the windows error state, because + * it is assumed to be preserved across the call to the macro. + * Ideally, the macro should be fixed, but it is simpler to + * do it here. + */ + DWORD error = GetLastError(); + void *result = TlsGetValue(key); + SetLastError(error); + return result; } void From python-checkins at python.org Sat Jan 10 13:15:23 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 13:15:23 +0100 (CET) Subject: [Python-checkins] r68477 - python/branches/py3k/Lib/tkinter/tix.py Message-ID: <20090110121523.CCE1D1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 13:15:23 2009 New Revision: 68477 Log: Fixed 2to3 issue on tix module. Modified: python/branches/py3k/Lib/tkinter/tix.py Modified: python/branches/py3k/Lib/tkinter/tix.py ============================================================================== --- python/branches/py3k/Lib/tkinter/tix.py (original) +++ python/branches/py3k/Lib/tkinter/tix.py Sat Jan 10 13:15:23 2009 @@ -293,7 +293,7 @@ else: static_options = ['options'] - for k,v in cnf.items()[:]: + for k,v in list(cnf.items()): if k in static_options: extra = extra + ('-' + k, v) del cnf[k] @@ -448,7 +448,7 @@ # we must be careful not to destroy the frame widget since this # also destroys the parent NoteBook thus leading to an exception # in Tkinter when it finally calls Tcl to destroy the NoteBook - for c in self.children.values(): c.destroy() + for c in list(self.children.values()): c.destroy() if self._name in self.master.children: del self.master.children[self._name] if self._name in self.master.subwidget_list: From python-checkins at python.org Sat Jan 10 13:16:42 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 10 Jan 2009 13:16:42 +0100 (CET) Subject: [Python-checkins] r68478 - in python/branches/release30-maint: PC/VC6/_tkinter.dsp PC/VC6/build_tkinter.py PC/VC6/readme.txt PC/VC6/tcl852.patch Message-ID: <20090110121642.36DB81E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Jan 10 13:16:41 2009 New Revision: 68478 Log: Merged revisions 68474-68475 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68474 | hirokazu.yamamoto | 2009-01-10 20:48:27 +0900 | 17 lines Merged revisions 68468-68470 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68468 | hirokazu.yamamoto | 2009-01-10 17:09:43 +0900 | 1 line Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3) ........ r68469 | hirokazu.yamamoto | 2009-01-10 17:12:09 +0900 | 1 line Link to debug version of Tcl/Tk when python is built as debug version. ........ r68470 | hirokazu.yamamoto | 2009-01-10 18:18:16 +0900 | 1 line Added helper script to build Tcl/Tk. ........ ................ r68475 | hirokazu.yamamoto | 2009-01-10 20:55:57 +0900 | 1 line Commit miss. ................ Added: python/branches/release30-maint/PC/VC6/build_tkinter.py - copied unchanged from r68475, /python/branches/py3k/PC/VC6/build_tkinter.py python/branches/release30-maint/PC/VC6/tcl852.patch - copied unchanged from r68475, /python/branches/py3k/PC/VC6/tcl852.patch Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/PC/VC6/_tkinter.dsp python/branches/release30-maint/PC/VC6/readme.txt Modified: python/branches/release30-maint/PC/VC6/_tkinter.dsp ============================================================================== --- python/branches/release30-maint/PC/VC6/_tkinter.dsp (original) +++ python/branches/release30-maint/PC/VC6/_tkinter.dsp Sat Jan 10 13:16:41 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" @@ -82,7 +82,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/release30-maint/PC/VC6/readme.txt ============================================================================== --- python/branches/release30-maint/PC/VC6/readme.txt (original) +++ python/branches/release30-maint/PC/VC6/readme.txt Sat Jan 10 13:16:41 2009 @@ -64,18 +64,25 @@ _tkinter Python wrapper for the Tk windowing system. Requires building - Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.12. + Tcl/Tk first. Following are instructions for Tcl/Tk 8.5.2. Get source ---------- In the dist directory, run - svn export http://svn.python.org/projects/external/tcl8.4.12 - svn export http://svn.python.org/projects/external/tk8.4.12 - svn export http://svn.python.org/projects/external/tix-8.4.0 + svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2 + svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 + svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 + + Debug Build + ----------- + To build debug version, add DEBUG=1 to all nmake call bellow. Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- - cd dist\tcl8.4.12\win + If your environment doesn't have struct _stat64, you need to apply + tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h. + + cd dist\tcl8.5.2\win run vcvars32.bat nmake -f makefile.vc nmake -f makefile.vc INSTALLDIR=..\..\tcltk install @@ -85,16 +92,16 @@ Optional: run tests, via nmake -f makefile.vc test - all.tcl: Total 10835 Passed 10096 Skipped 732 Failed 7 - Sourced 129 Test Files. - Files with failing tests: exec.test expr.test io.test main.test string.test stri + all.tcl: Total 24242 Passed 23358 Skipped 877 Failed 7 + Sourced 137 Test Files. + Files with failing tests: exec.test http.test io.test main.test string.test stri ngObj.test Build Tk -------- - cd dist\tk8.4.12\win - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd dist\tk8.5.2\win + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install XXX Should we compile with OPTS=threads? @@ -102,11 +109,11 @@ XXX failed. It popped up tons of little windows, and did lots of XXX stuff, and nothing blew up. - Built Tix - --------- - cd dist\tix-8.4.0\win - nmake -f python.mak - nmake -f python.mak install + Build Tix + --------- + cd dist\tix8.4.3\win + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install bz2 Python wrapper for the libbz2 compression library. Homepage From buildbot at python.org Sat Jan 10 13:33:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 12:33:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090110123319.2DE861E4002@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/86 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: 2 tests failed: test_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Sat Jan 10 14:00:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 13:00:19 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090110130019.C8CEB1E4002@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/502 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: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 10 14:14:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 13:14:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090110131452.1CF1A1E4002@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/46 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,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.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 Jan 10 14:37:26 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 10 Jan 2009 14:37:26 +0100 (CET) Subject: [Python-checkins] r68479 - python/branches/py3k/Doc/library/logging.rst Message-ID: <20090110133726.557AD1E4002@bag.python.org> Author: vinay.sajip Date: Sat Jan 10 14:37:26 2009 New Revision: 68479 Log: Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. Modified: python/branches/py3k/Doc/library/logging.rst Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Sat Jan 10 14:37:26 2009 @@ -420,6 +420,7 @@ code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties. +.. _library-config: Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -463,6 +464,7 @@ The :class:`NullHandler` class was not present in previous versions, but is now included, so that it need not be defined in library code. +See :ref:`library-config` for more information. @@ -560,7 +562,8 @@ #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if - the library user has not configured logging. + the library user has not configured logging. See :ref:`library-config` for + more information. .. versionadded:: 3.1 @@ -1608,7 +1611,8 @@ This method does nothing. - +See :ref:`library-config` for more information on how to use +:class:`NullHandler`. WatchedFileHandler ^^^^^^^^^^^^^^^^^^ From python-checkins at python.org Sat Jan 10 14:38:04 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 10 Jan 2009 14:38:04 +0100 (CET) Subject: [Python-checkins] r68480 - python/trunk/Doc/library/logging.rst Message-ID: <20090110133804.B4F1F1E4002@bag.python.org> Author: vinay.sajip Date: Sat Jan 10 14:38:04 2009 New Revision: 68480 Log: Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Sat Jan 10 14:38:04 2009 @@ -422,6 +422,8 @@ code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties. +.. _library-config: + Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -465,6 +467,7 @@ The :class:`NullHandler` class was not present in previous versions, but is now included, so that it need not be defined in library code. +See :ref:`library-config` for more information. @@ -562,7 +565,8 @@ #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if - the library user has not configured logging. + the library user has not configured logging. See :ref:`library-config` for + more information. .. versionadded:: 2.7 @@ -1633,6 +1637,9 @@ This method does nothing. +See :ref:`library-config` for more information on how to use +:class:`NullHandler`. + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ From python-checkins at python.org Sat Jan 10 14:42:05 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 10 Jan 2009 14:42:05 +0100 (CET) Subject: [Python-checkins] r68481 - python/trunk/Doc/library/logging.rst Message-ID: <20090110134205.04E011E4002@bag.python.org> Author: vinay.sajip Date: Sat Jan 10 14:42:04 2009 New Revision: 68481 Log: Corrected an incorrect self-reference. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Sat Jan 10 14:42:04 2009 @@ -467,7 +467,6 @@ The :class:`NullHandler` class was not present in previous versions, but is now included, so that it need not be defined in library code. -See :ref:`library-config` for more information. From python-checkins at python.org Sat Jan 10 14:42:24 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 10 Jan 2009 14:42:24 +0100 (CET) Subject: [Python-checkins] r68482 - python/branches/py3k/Doc/library/logging.rst Message-ID: <20090110134224.1CD081E4002@bag.python.org> Author: vinay.sajip Date: Sat Jan 10 14:42:23 2009 New Revision: 68482 Log: Corrected an incorrect self-reference. Modified: python/branches/py3k/Doc/library/logging.rst Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Sat Jan 10 14:42:23 2009 @@ -464,7 +464,6 @@ The :class:`NullHandler` class was not present in previous versions, but is now included, so that it need not be defined in library code. -See :ref:`library-config` for more information. From nnorwitz at gmail.com Sat Jan 10 14:40:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 10 Jan 2009 08:40:17 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090110134017.GA18445@python.psfb.org> svn update tools/sphinx At revision 68480. svn update tools/docutils At revision 68480. svn update tools/jinja2 At revision 68480. svn update tools/pygments At revision 68480. mkdir -p build/html build/doctrees python2.5 tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 6 source files that are out of date updating environment: 0 added, 6 changed, 0 removed reading sources... library/ctypes library/ftplib library/logging reST markup error: /home/neal/python/py3k/Doc/library/logging.rst:: (SEVERE/4) Duplicate ID: "module-logging.handlers". make: *** [build] Error 1 From buildbot at python.org Sat Jan 10 15:36:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 14:36:41 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090110143641.6C3781E4002@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/77 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: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 10 16:40:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 16:40:25 +0100 (CET) Subject: [Python-checkins] r68483 - in python/branches/py3k: Misc/NEWS Objects/unicodeobject.c Message-ID: <20090110154025.EF1A21E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 16:40:25 2009 New Revision: 68483 Log: Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The common cases are optimized thanks to a dedicated fast path and a moderate amount of loop unrolling. This will especially help text I/O (we already register a 30% speedup on large reads on the io-c branch). Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 10 16:40:25 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The + common cases are optimized thanks to a dedicated fast path and a moderate + amount of loop unrolling. + - 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 Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat Jan 10 16:40:25 2009 @@ -2001,6 +2001,19 @@ return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL); } +/* Mask to check or force alignment of a pointer to C 'long' boundaries */ +#define LONG_PTR_MASK (size_t) (SIZEOF_LONG - 1) + +/* Mask to quickly check whether a C 'long' contains a + non-ASCII, UTF8-encoded char. */ +#if (SIZEOF_LONG == 8) +# define ASCII_CHAR_MASK 0x8080808080808080L +#elif (SIZEOF_LONG == 4) +# define ASCII_CHAR_MASK 0x80808080L +#else +# error C 'long' size should be either 4 or 8! +#endif + PyObject *PyUnicode_DecodeUTF8Stateful(const char *s, Py_ssize_t size, const char *errors, @@ -2011,7 +2024,7 @@ Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; - const char *e; + const char *e, *aligned_end; PyUnicodeObject *unicode; Py_UNICODE *p; const char *errmsg = ""; @@ -2032,11 +2045,52 @@ /* Unpack UTF-8 encoded data */ p = unicode->str; e = s + size; + aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK); while (s < e) { Py_UCS4 ch = (unsigned char)*s; if (ch < 0x80) { + /* Fast path for runs of ASCII characters. Given that common UTF-8 + input will consist of an overwhelming majority of ASCII + characters, we try to optimize for this case by checking + as many characters as a C 'long' can contain. + First, check if we can do an aligned read, as most CPUs have + a penalty for unaligned reads. + */ + if (!((size_t) s & LONG_PTR_MASK)) { + /* Help register allocation */ + register const char *_s = s; + register Py_UNICODE *_p = p; + while (_s < aligned_end) { + /* Read a whole long at a time (either 4 or 8 bytes), + and do a fast unrolled copy if it only contains ASCII + characters. */ + unsigned long data = *(unsigned long *) _s; + if (data & ASCII_CHAR_MASK) + break; + _p[0] = (unsigned char) _s[0]; + _p[1] = (unsigned char) _s[1]; + _p[2] = (unsigned char) _s[2]; + _p[3] = (unsigned char) _s[3]; +#if (SIZEOF_LONG == 8) + _p[4] = (unsigned char) _s[4]; + _p[5] = (unsigned char) _s[5]; + _p[6] = (unsigned char) _s[6]; + _p[7] = (unsigned char) _s[7]; +#endif + _s += SIZEOF_LONG; + _p += SIZEOF_LONG; + } + s = _s; + p = _p; + if (s == e) + break; + ch = (unsigned char)*s; + } + } + + if (ch < 0x80) { *p++ = (Py_UNICODE)ch; s++; continue; @@ -2169,6 +2223,7 @@ &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; @@ -2188,6 +2243,9 @@ return NULL; } +#undef ASCII_CHAR_MASK + + /* Allocation strategy: if the string is short, convert into a stack buffer and allocate exactly as much space needed at the end. Else allocate the maximum possible needed (4 result bytes per Unicode character), and return @@ -2582,6 +2640,23 @@ return PyUnicode_DecodeUTF16Stateful(s, size, errors, byteorder, NULL); } +/* Two masks for fast checking of whether a C 'long' may contain + UTF16-encoded surrogate characters. This is an efficient heuristic, + assuming that non-surrogate characters with a code point >= 0x8000 are + 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 +#elif (SIZEOF_LONG == 4) +# define FAST_CHAR_MASK 0x80008000L +# define SWAPPED_FAST_CHAR_MASK 0x00800080L +#else +# error C 'long' size should be either 4 or 8! +#endif + PyObject * PyUnicode_DecodeUTF16Stateful(const char *s, Py_ssize_t size, @@ -2595,8 +2670,9 @@ Py_ssize_t outpos; PyUnicodeObject *unicode; Py_UNICODE *p; - const unsigned char *q, *e; + const unsigned char *q, *e, *aligned_end; int bo = 0; /* assume native ordering by default */ + int native_ordering = 0; const char *errmsg = ""; /* Offsets from q for retrieving byte pairs in the right order. */ #ifdef BYTEORDER_IS_LITTLE_ENDIAN @@ -2618,7 +2694,7 @@ /* Unpack UTF-16 encoded data */ p = unicode->str; q = (unsigned char *)s; - e = q + size; + e = q + size - 1; if (byteorder) bo = *byteorder; @@ -2662,20 +2738,78 @@ ihi = 0; ilo = 1; } +#ifdef BYTEORDER_IS_LITTLE_ENDIAN + native_ordering = ilo < ihi; +#else + native_ordering = ilo > ihi; +#endif + aligned_end = (const unsigned char *) ((size_t) e & ~LONG_PTR_MASK); while (q < e) { Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } + /* 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)) { + /* Fast path for runs of non-surrogate chars. */ + register const unsigned char *_q = q; + Py_UNICODE *_p = p; + if (native_ordering) { + /* Native ordering is simple: as long as the input cannot + possibly contain a surrogate char, do an unrolled copy + of several 16-bit code points to the target object. + The non-surrogate check is done on several input bytes + at a time (as many as a C 'long' can contain). */ + while (_q < aligned_end) { + unsigned long data = * (unsigned long *) _q; + if (data & FAST_CHAR_MASK) + break; + _p[0] = ((unsigned short *) _q)[0]; + _p[1] = ((unsigned short *) _q)[1]; +#if (SIZEOF_LONG == 8) + _p[2] = ((unsigned short *) _q)[2]; + _p[3] = ((unsigned short *) _q)[3]; +#endif + _q += SIZEOF_LONG; + _p += SIZEOF_LONG / 2; + } + } + else { + /* Byteswapped ordering is similar, but we must decompose + the copy bytewise, and take care of zero'ing out the + upper bytes if the target object is in 32-bit units + (that is, in UCS-4 builds). */ + while (_q < aligned_end) { + unsigned long data = * (unsigned long *) _q; + if (data & SWAPPED_FAST_CHAR_MASK) + break; + /* Zero upper bytes in UCS-4 builds */ +#if (Py_UNICODE_SIZE > 2) + _p[0] = 0; + _p[1] = 0; +#if (SIZEOF_LONG == 8) + _p[2] = 0; + _p[3] = 0; +#endif +#endif + ((unsigned char *) _p)[1] = _q[0]; + ((unsigned char *) _p)[0] = _q[1]; + ((unsigned char *) _p)[1 + Py_UNICODE_SIZE] = _q[2]; + ((unsigned char *) _p)[0 + Py_UNICODE_SIZE] = _q[3]; +#if (SIZEOF_LONG == 8) + ((unsigned char *) _p)[1 + 2 * Py_UNICODE_SIZE] = _q[4]; + ((unsigned char *) _p)[0 + 2 * Py_UNICODE_SIZE] = _q[5]; + ((unsigned char *) _p)[1 + 3 * Py_UNICODE_SIZE] = _q[6]; + ((unsigned char *) _p)[0 + 3 * Py_UNICODE_SIZE] = _q[7]; +#endif + _q += SIZEOF_LONG; + _p += SIZEOF_LONG / 2; + } + } + p = _p; + q = _q; + if (q >= e) + break; + } ch = (q[ihi] << 8) | q[ilo]; q += 2; @@ -2686,10 +2820,10 @@ } /* UTF-16 code pair: */ - if (q >= e) { + if (q > e) { errmsg = "unexpected end of data"; - startinpos = (((const char *)q)-2)-starts; - endinpos = ((const char *)e)-starts; + startinpos = (((const char *)q) - 2) - starts; + endinpos = ((const char *)e) + 1 - starts; goto utf16Error; } if (0xD800 <= ch && ch <= 0xDBFF) { @@ -2718,14 +2852,47 @@ /* Fall through to report the error */ utf16Error: - outpos = p-PyUnicode_AS_UNICODE(unicode); + outpos = p - PyUnicode_AS_UNICODE(unicode); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf16", errmsg, - &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) + errors, + &errorHandler, + "utf16", errmsg, + &starts, + (const char **)&e, + &startinpos, + &endinpos, + &exc, + (const char **)&q, + &unicode, + &outpos, + &p)) goto onError; } + /* remaining byte at the end? (size should be even) */ + if (e == q) { + if (!consumed) { + errmsg = "truncated data"; + startinpos = ((const char *)q) - starts; + endinpos = ((const char *)e) + 1 - starts; + outpos = p - PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, + &errorHandler, + "utf16", errmsg, + &starts, + (const char **)&e, + &startinpos, + &endinpos, + &exc, + (const char **)&q, + &unicode, + &outpos, + &p)) + goto onError; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + } if (byteorder) *byteorder = bo; @@ -2748,6 +2915,9 @@ return NULL; } +#undef FAST_CHAR_MASK +#undef SWAPPED_FAST_CHAR_MASK + PyObject * PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, @@ -3571,6 +3741,7 @@ { PyUnicodeObject *v; Py_UNICODE *p; + const char *e, *unrolled_end; /* Latin-1 is equivalent to the first 256 ordinals in Unicode. */ if (size == 1) { @@ -3584,8 +3755,20 @@ if (size == 0) return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); - while (size-- > 0) - *p++ = (unsigned char)*s++; + e = s + size; + /* Unrolling the copy makes it much faster by reducing the looping + overhead. This is similar to what many memcpy() implementations do. */ + unrolled_end = e - 4; + while (s < unrolled_end) { + p[0] = (unsigned char) s[0]; + p[1] = (unsigned char) s[1]; + p[2] = (unsigned char) s[2]; + p[3] = (unsigned char) s[3]; + s += 4; + p += 4; + } + while (s < e) + *p++ = (unsigned char) *s++; return (PyObject *)v; onError: From python-checkins at python.org Sat Jan 10 17:13:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 17:13:45 +0100 (CET) Subject: [Python-checkins] r68484 - in python/trunk: Lib/gzip.py Lib/test/test_bz2.py Lib/test/test_gzip.py Modules/bz2module.c Message-ID: <20090110161345.91A061E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 17:13:45 2009 New Revision: 68484 Log: Issue #3860: GzipFile and BZ2File now support the context manager protocol. Modified: python/trunk/Lib/gzip.py python/trunk/Lib/test/test_bz2.py python/trunk/Lib/test/test_gzip.py python/trunk/Modules/bz2module.c Modified: python/trunk/Lib/gzip.py ============================================================================== --- python/trunk/Lib/gzip.py (original) +++ python/trunk/Lib/gzip.py Sat Jan 10 17:13:45 2009 @@ -454,6 +454,14 @@ else: raise StopIteration + def __enter__(self): + if self.fileobj is None: + raise ValueError("I/O operation on closed GzipFile object") + return self + + def __exit__(self, *args): + self.close() + def _test(): # Act like gzip; with -d, act like gunzip. Modified: python/trunk/Lib/test/test_bz2.py ============================================================================== --- python/trunk/Lib/test/test_bz2.py (original) +++ python/trunk/Lib/test/test_bz2.py Sat Jan 10 17:13:45 2009 @@ -284,6 +284,28 @@ bz2f.close() self.assertEqual(xlines, ['Test']) + def testContextProtocol(self): + # BZ2File supports the context management protocol + f = None + with BZ2File(self.filename, "wb") as f: + f.write(b"xxx") + f = BZ2File(self.filename, "rb") + f.close() + try: + with f: + pass + except ValueError: + pass + else: + self.fail("__enter__ on a closed file didn't raise an exception") + try: + with BZ2File(self.filename, "wb") as f: + 1/0 + except ZeroDivisionError: + pass + else: + self.fail("1/0 didn't raise an exception") + class BZ2CompressorTest(BaseTest): def testCompress(self): Modified: python/trunk/Lib/test/test_gzip.py ============================================================================== --- python/trunk/Lib/test/test_gzip.py (original) +++ python/trunk/Lib/test/test_gzip.py Sat Jan 10 17:13:45 2009 @@ -166,7 +166,6 @@ fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) fWrite.write(data1) fWrite.close() - fRead = gzip.GzipFile(self.filename) dataRead = fRead.read() self.assertEqual(dataRead, data1) @@ -222,6 +221,27 @@ fRead.close() + def test_with_open(self): + # GzipFile supports the context management protocol + with gzip.GzipFile(self.filename, "wb") as f: + f.write(b"xxx") + f = gzip.GzipFile(self.filename, "rb") + f.close() + try: + with f: + pass + except ValueError: + pass + else: + self.fail("__enter__ on a closed file didn't raise an exception") + try: + with gzip.GzipFile(self.filename, "wb") as f: + 1/0 + except ZeroDivisionError: + pass + else: + self.fail("1/0 didn't raise an exception") + def test_main(verbose=None): test_support.run_unittest(TestGzip) Modified: python/trunk/Modules/bz2module.c ============================================================================== --- python/trunk/Modules/bz2module.c (original) +++ python/trunk/Modules/bz2module.c Sat Jan 10 17:13:45 2009 @@ -1201,6 +1201,36 @@ return ret; } +PyDoc_STRVAR(BZ2File_enter_doc, +"__enter__() -> self."); + +static PyObject * +BZ2File_enter(BZ2FileObject *self) +{ + if (self->mode == MODE_CLOSED) { + PyErr_SetString(PyExc_ValueError, + "I/O operation on closed file"); + return NULL; + } + Py_INCREF(self); + return (PyObject *) self; +} + +PyDoc_STRVAR(BZ2File_exit_doc, +"__exit__(*excinfo) -> None. Closes the file."); + +static PyObject * +BZ2File_exit(BZ2FileObject *self, PyObject *args) +{ + PyObject *ret = PyObject_CallMethod((PyObject *) self, "close", NULL); + if (!ret) + /* If error occurred, pass through */ + return NULL; + Py_DECREF(ret); + Py_RETURN_NONE; +} + + static PyObject *BZ2File_getiter(BZ2FileObject *self); static PyMethodDef BZ2File_methods[] = { @@ -1213,6 +1243,8 @@ {"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__}, {"tell", (PyCFunction)BZ2File_tell, METH_NOARGS, BZ2File_tell__doc__}, {"close", (PyCFunction)BZ2File_close, METH_NOARGS, BZ2File_close__doc__}, + {"__enter__", (PyCFunction)BZ2File_enter, METH_NOARGS, BZ2File_enter_doc}, + {"__exit__", (PyCFunction)BZ2File_exit, METH_VARARGS, BZ2File_exit_doc}, {NULL, NULL} /* sentinel */ }; From python-checkins at python.org Sat Jan 10 17:15:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 17:15:25 +0100 (CET) Subject: [Python-checkins] r68485 - python/trunk/Misc/NEWS Message-ID: <20090110161525.0EF291E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 17:15:24 2009 New Revision: 68485 Log: Add NEWS entry for r68484. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 10 17:15:24 2009 @@ -122,6 +122,8 @@ Library ------- +- Issue #3860: GzipFile and BZ2File now support the context manager protocol. + - Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. The default value remains the current time. The information can be used by e.g. gunzip when decompressing. Patch by From python-checkins at python.org Sat Jan 10 17:22:52 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 17:22:52 +0100 (CET) Subject: [Python-checkins] r68486 - in python/branches/py3k: Lib/gzip.py Lib/test/test_bz2.py Lib/test/test_gzip.py Misc/NEWS Modules/bz2module.c Message-ID: <20090110162252.0AC401E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 17:22:51 2009 New Revision: 68486 Log: Merged revisions 68484-68485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68484 | antoine.pitrou | 2009-01-10 17:13:45 +0100 (sam., 10 janv. 2009) | 3 lines Issue #3860: GzipFile and BZ2File now support the context manager protocol. ........ r68485 | antoine.pitrou | 2009-01-10 17:15:24 +0100 (sam., 10 janv. 2009) | 1 line Add NEWS entry for r68484. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/gzip.py python/branches/py3k/Lib/test/test_bz2.py python/branches/py3k/Lib/test/test_gzip.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/bz2module.c Modified: python/branches/py3k/Lib/gzip.py ============================================================================== --- python/branches/py3k/Lib/gzip.py (original) +++ python/branches/py3k/Lib/gzip.py Sat Jan 10 17:22:51 2009 @@ -472,6 +472,14 @@ else: raise StopIteration + def __enter__(self): + if self.fileobj is None: + raise ValueError("I/O operation on closed GzipFile object") + return self + + def __exit__(self, *args): + self.close() + def _test(): # Act like gzip; with -d, act like gunzip. Modified: python/branches/py3k/Lib/test/test_bz2.py ============================================================================== --- python/branches/py3k/Lib/test/test_bz2.py (original) +++ python/branches/py3k/Lib/test/test_bz2.py Sat Jan 10 17:22:51 2009 @@ -258,6 +258,28 @@ bz2f.close() self.assertEqual(xlines, [b'Test']) + def testContextProtocol(self): + # BZ2File supports the context management protocol + f = None + with BZ2File(self.filename, "wb") as f: + f.write(b"xxx") + f = BZ2File(self.filename, "rb") + f.close() + try: + with f: + pass + except ValueError: + pass + else: + self.fail("__enter__ on a closed file didn't raise an exception") + try: + with BZ2File(self.filename, "wb") as f: + 1/0 + except ZeroDivisionError: + pass + else: + self.fail("1/0 didn't raise an exception") + class BZ2CompressorTest(BaseTest): def testCompress(self): Modified: python/branches/py3k/Lib/test/test_gzip.py ============================================================================== --- python/branches/py3k/Lib/test/test_gzip.py (original) +++ python/branches/py3k/Lib/test/test_gzip.py Sat Jan 10 17:22:51 2009 @@ -166,7 +166,6 @@ fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) fWrite.write(data1) fWrite.close() - fRead = gzip.GzipFile(self.filename) dataRead = fRead.read() self.assertEqual(dataRead, data1) @@ -223,6 +222,27 @@ fRead.close() + def test_with_open(self): + # GzipFile supports the context management protocol + with gzip.GzipFile(self.filename, "wb") as f: + f.write(b"xxx") + f = gzip.GzipFile(self.filename, "rb") + f.close() + try: + with f: + pass + except ValueError: + pass + else: + self.fail("__enter__ on a closed file didn't raise an exception") + try: + with gzip.GzipFile(self.filename, "wb") as f: + 1/0 + except ZeroDivisionError: + pass + else: + self.fail("1/0 didn't raise an exception") + def test_main(verbose=None): support.run_unittest(TestGzip) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 10 17:22:51 2009 @@ -111,6 +111,8 @@ Library ------- +- Issue #3860: GzipFile and BZ2File now support the context manager protocol. + - Issue #4867: Fixed a crash in ctypes when passing a string to a function without defining argtypes. Modified: python/branches/py3k/Modules/bz2module.c ============================================================================== --- python/branches/py3k/Modules/bz2module.c (original) +++ python/branches/py3k/Modules/bz2module.c Sat Jan 10 17:22:51 2009 @@ -1086,6 +1086,36 @@ return ret; } +PyDoc_STRVAR(BZ2File_enter_doc, +"__enter__() -> self."); + +static PyObject * +BZ2File_enter(BZ2FileObject *self) +{ + if (self->mode == MODE_CLOSED) { + PyErr_SetString(PyExc_ValueError, + "I/O operation on closed file"); + return NULL; + } + Py_INCREF(self); + return (PyObject *) self; +} + +PyDoc_STRVAR(BZ2File_exit_doc, +"__exit__(*excinfo) -> None. Closes the file."); + +static PyObject * +BZ2File_exit(BZ2FileObject *self, PyObject *args) +{ + PyObject *ret = PyObject_CallMethod((PyObject *) self, "close", NULL); + if (!ret) + /* If error occurred, pass through */ + return NULL; + Py_DECREF(ret); + Py_RETURN_NONE; +} + + static PyObject *BZ2File_getiter(BZ2FileObject *self); static PyMethodDef BZ2File_methods[] = { @@ -1097,6 +1127,8 @@ {"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__}, {"tell", (PyCFunction)BZ2File_tell, METH_NOARGS, BZ2File_tell__doc__}, {"close", (PyCFunction)BZ2File_close, METH_NOARGS, BZ2File_close__doc__}, + {"__enter__", (PyCFunction)BZ2File_enter, METH_NOARGS, BZ2File_enter_doc}, + {"__exit__", (PyCFunction)BZ2File_exit, METH_VARARGS, BZ2File_exit_doc}, {NULL, NULL} /* sentinel */ }; From buildbot at python.org Sat Jan 10 17:27:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 16:27:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090110162722.ECDC21E4002@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/88 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,vinay.sajip 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 Jan 10 18:00:42 2009 From: python-checkins at python.org (matthias.klose) Date: Sat, 10 Jan 2009 18:00:42 +0100 (CET) Subject: [Python-checkins] r68487 - in python/trunk: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090110170042.3EAD21E4002@bag.python.org> Author: matthias.klose Date: Sat Jan 10 18:00:42 2009 New Revision: 68487 Log: - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. Modified: python/trunk/Lib/ctypes/util.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/ctypes/util.py ============================================================================== --- python/trunk/Lib/ctypes/util.py (original) +++ python/trunk/Lib/ctypes/util.py Sat Jan 10 18:00:42 2009 @@ -92,18 +92,20 @@ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) - cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ + cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) trace = f.read() - f.close() + rv = f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise + if rv == 10: + raise OSError, 'gcc or cc command not found' res = re.search(expr, trace) if not res: return None @@ -125,7 +127,13 @@ # assuming GNU binutils / ELF if not f: return None - cmd = "objdump -p -j .dynamic 2>/dev/null " + f + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ + "objdump -p -j .dynamic 2>/dev/null " + f + f = os.popen(cmd) + dump = f.read() + rv = f.close() + if rv == 10: + raise OSError, 'objdump command not found' res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: return None @@ -171,8 +179,32 @@ return None return res.group(0) + def _findSoname_ldconfig(name): + import struct + if struct.calcsize('l') == 4: + machine = os.uname()[4] + '-32' + else: + machine = os.uname()[4] + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', + } + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) + expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ + % (abi_type, re.escape(name)) + res = re.search(expr, + os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + if not res: + return None + return res.group(1) + def find_library(name): - return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name)) + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 10 18:00:42 2009 @@ -286,6 +286,9 @@ - Issue #841800: bundlebuilder now works with 'python -O' +- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on + biarch systems. Try to rely on ldconfig only, without using objdump and gcc. + Tools/Demos ----------- From python-checkins at python.org Sat Jan 10 18:05:44 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 18:05:44 +0100 (CET) Subject: [Python-checkins] r68488 - python/branches/py3k/Lib/pickle.py Message-ID: <20090110170544.E5D061E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 18:05:44 2009 New Revision: 68488 Log: fix typo #4904 Modified: python/branches/py3k/Lib/pickle.py Modified: python/branches/py3k/Lib/pickle.py ============================================================================== --- python/branches/py3k/Lib/pickle.py (original) +++ python/branches/py3k/Lib/pickle.py Sat Jan 10 18:05:44 2009 @@ -830,7 +830,7 @@ return k def persistent_load(self, pid): - raise UnpickingError("unsupported persistent id encountered") + raise UnpicklingError("unsupported persistent id encountered") dispatch = {} From python-checkins at python.org Sat Jan 10 18:08:25 2009 From: python-checkins at python.org (matthias.klose) Date: Sat, 10 Jan 2009 18:08:25 +0100 (CET) Subject: [Python-checkins] r68489 - in python/branches/py3k: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090110170825.9E2FC1E4002@bag.python.org> Author: matthias.klose Date: Sat Jan 10 18:08:25 2009 New Revision: 68489 Log: Merge r68487 from svn+ssh://pythondev at svn.python.org/python/trunk: - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. Modified: python/branches/py3k/Lib/ctypes/util.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/ctypes/util.py ============================================================================== --- python/branches/py3k/Lib/ctypes/util.py (original) +++ python/branches/py3k/Lib/ctypes/util.py Sat Jan 10 18:08:25 2009 @@ -89,20 +89,22 @@ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) - cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ + cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) try: trace = f.read() finally: - f.close() + rv = f.close() finally: try: os.unlink(ccout) except OSError as e: if e.errno != errno.ENOENT: raise + if rv == 10: + raise OSError, 'gcc or cc command not found' res = re.search(expr, trace) if not res: return None @@ -129,7 +131,13 @@ # assuming GNU binutils / ELF if not f: return None - cmd = "objdump -p -j .dynamic 2>/dev/null " + f + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ + "objdump -p -j .dynamic 2>/dev/null " + f + f = os.popen(cmd) + dump = f.read() + rv = f.close() + if rv == 10: + raise OSError, 'objdump command not found' f = os.popen(cmd) try: data = f.read() @@ -193,8 +201,32 @@ return None return res.group(0) + def _findSoname_ldconfig(name): + import struct + if struct.calcsize('l') == 4: + machine = os.uname()[4] + '-32' + else: + machine = os.uname()[4] + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', + } + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) + expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ + % (abi_type, re.escape(name)) + res = re.search(expr, + os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + if not res: + return None + return res.group(1) + def find_library(name): - return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name)) + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 10 18:08:25 2009 @@ -236,6 +236,9 @@ support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. +- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on + biarch systems. Try to rely on ldconfig only, without using objdump and gcc. + Tools/Demos ----------- From python-checkins at python.org Sat Jan 10 18:11:12 2009 From: python-checkins at python.org (matthias.klose) Date: Sat, 10 Jan 2009 18:11:12 +0100 (CET) Subject: [Python-checkins] r68490 - in python/branches/release26-maint: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090110171112.24CE21E400C@bag.python.org> Author: matthias.klose Date: Sat Jan 10 18:11:11 2009 New Revision: 68490 Log: Merge r68487 from svn+ssh://pythondev at svn.python.org/python/trunk: - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. Modified: python/branches/release26-maint/Lib/ctypes/util.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/ctypes/util.py ============================================================================== --- python/branches/release26-maint/Lib/ctypes/util.py (original) +++ python/branches/release26-maint/Lib/ctypes/util.py Sat Jan 10 18:11:11 2009 @@ -92,18 +92,20 @@ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) - cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ + cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) trace = f.read() - f.close() + rv = f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise + if rv == 10: + raise OSError, 'gcc or cc command not found' res = re.search(expr, trace) if not res: return None @@ -125,7 +127,13 @@ # assuming GNU binutils / ELF if not f: return None - cmd = "objdump -p -j .dynamic 2>/dev/null " + f + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ + "objdump -p -j .dynamic 2>/dev/null " + f + f = os.popen(cmd) + dump = f.read() + rv = f.close() + if rv == 10: + raise OSError, 'objdump command not found' res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: return None @@ -171,8 +179,32 @@ return None return res.group(0) + def _findSoname_ldconfig(name): + import struct + if struct.calcsize('l') == 4: + machine = os.uname()[4] + '-32' + else: + machine = os.uname()[4] + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', + } + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) + expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ + % (abi_type, re.escape(name)) + res = re.search(expr, + os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + if not res: + return None + return res.group(1) + def find_library(name): - return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name)) + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 10 18:11:11 2009 @@ -114,6 +114,9 @@ - FileIO's mode attribute now always includes ``"b"``. +- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on + biarch systems. Try to rely on ldconfig only, without using objdump and gcc. + Extension Modules ----------------- From python-checkins at python.org Sat Jan 10 18:14:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 18:14:05 +0100 (CET) Subject: [Python-checkins] r68491 - python/branches/py3k Message-ID: <20090110171405.1508C1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 18:14:04 2009 New Revision: 68491 Log: Blocked revisions 68487 via svnmerge ........ r68487 | matthias.klose | 2009-01-10 11:00:42 -0600 (Sat, 10 Jan 2009) | 3 lines - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 10 18:17:29 2009 From: python-checkins at python.org (matthias.klose) Date: Sat, 10 Jan 2009 18:17:29 +0100 (CET) Subject: [Python-checkins] r68492 - in python/branches/release30-maint: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090110171729.B270E1E4002@bag.python.org> Author: matthias.klose Date: Sat Jan 10 18:17:29 2009 New Revision: 68492 Log: Merge r68489 from svn+ssh://pythondev at svn.python.org/python/branches/py3k: - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. Modified: python/branches/release30-maint/Lib/ctypes/util.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/ctypes/util.py ============================================================================== --- python/branches/release30-maint/Lib/ctypes/util.py (original) +++ python/branches/release30-maint/Lib/ctypes/util.py Sat Jan 10 18:17:29 2009 @@ -89,20 +89,22 @@ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) - cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ + cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) try: trace = f.read() finally: - f.close() + rv = f.close() finally: try: os.unlink(ccout) except OSError as e: if e.errno != errno.ENOENT: raise + if rv == 10: + raise OSError, 'gcc or cc command not found' res = re.search(expr, trace) if not res: return None @@ -129,7 +131,13 @@ # assuming GNU binutils / ELF if not f: return None - cmd = "objdump -p -j .dynamic 2>/dev/null " + f + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ + "objdump -p -j .dynamic 2>/dev/null " + f + f = os.popen(cmd) + dump = f.read() + rv = f.close() + if rv == 10: + raise OSError, 'objdump command not found' f = os.popen(cmd) try: data = f.read() @@ -193,8 +201,32 @@ return None return res.group(0) + def _findSoname_ldconfig(name): + import struct + if struct.calcsize('l') == 4: + machine = os.uname()[4] + '-32' + else: + machine = os.uname()[4] + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', + } + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) + expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ + % (abi_type, re.escape(name)) + res = re.search(expr, + os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + if not res: + return None + return res.group(1) + def find_library(name): - return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name)) + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 10 18:17:29 2009 @@ -169,6 +169,9 @@ support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. +- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on + biarch systems. Try to rely on ldconfig only, without using objdump and gcc. + Tools/Demos ----------- From python-checkins at python.org Sat Jan 10 18:18:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 18:18:55 +0100 (CET) Subject: [Python-checkins] r68493 - python/trunk/Tools/scripts/patchcheck.py Message-ID: <20090110171855.8B4391E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 18:18:55 2009 New Revision: 68493 Log: rewrite verbose conditionals Modified: python/trunk/Tools/scripts/patchcheck.py Modified: python/trunk/Tools/scripts/patchcheck.py ============================================================================== --- python/trunk/Tools/scripts/patchcheck.py (original) +++ python/trunk/Tools/scripts/patchcheck.py Sat Jan 10 18:18:55 2009 @@ -62,12 +62,12 @@ @status("Misc/ACKS updated", modal=True) def credit_given(file_paths): """Check if Misc/ACKS has been changed.""" - return True if 'Misc/ACKS' in file_paths else False + return 'Misc/ACKS' in file_paths @status("Misc/NEWS updated", modal=True) def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" - return True if 'Misc/NEWS' in file_paths else False + return 'Misc/NEWS' in file_paths def main(): From python-checkins at python.org Sat Jan 10 18:22:35 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 10 Jan 2009 18:22:35 +0100 (CET) Subject: [Python-checkins] r68494 - in sandbox/trunk/decimal/decimal_in_c: CHANGES Makefile README TODO configure configure.ac deccoeff.c deccoeff_config.h.in decimal.py decimaltestdata decimaltestdata/abs.decTest decimaltestdata/add.decTest decimaltestdata/and.decTest decimaltestdata/base.decTest decimaltestdata/clamp.decTest decimaltestdata/class.decTest decimaltestdata/compare.decTest decimaltestdata/comparetotal.decTest decimaltestdata/comparetotmag.decTest decimaltestdata/copy.decTest decimaltestdata/copyabs.decTest decimaltestdata/copynegate.decTest decimaltestdata/copysign.decTest decimaltestdata/ddAbs.decTest decimaltestdata/ddAdd.decTest decimaltestdata/ddAnd.decTest decimaltestdata/ddBase.decTest decimaltestdata/ddCanonical.decTest decimaltestdata/ddClass.decTest decimaltestdata/ddCompare.decTest decimaltestdata/ddCompareSig.decTest decimaltestdata/ddCompareTotal.decTest decimaltestdata/ddCompareTotalMag.decTest decimaltestdata/ddCopy.decTest decimaltestdata/ddCopyAbs.decTest decimaltestdata/ddCopyNegate.decTest decimaltestdata/ddCopySign.decTest decimaltestdata/ddDivide.decTest decimaltestdata/ddDivideInt.decTest decimaltestdata/ddEncode.decTest decimaltestdata/ddFMA.decTest decimaltestdata/ddInvert.decTest decimaltestdata/ddLogB.decTest decimaltestdata/ddMax.decTest decimaltestdata/ddMaxMag.decTest decimaltestdata/ddMin.decTest decimaltestdata/ddMinMag.decTest decimaltestdata/ddMinus.decTest decimaltestdata/ddMultiply.decTest decimaltestdata/ddNextMinus.decTest decimaltestdata/ddNextPlus.decTest decimaltestdata/ddNextToward.decTest decimaltestdata/ddOr.decTest decimaltestdata/ddPlus.decTest decimaltestdata/ddQuantize.decTest decimaltestdata/ddReduce.decTest decimaltestdata/ddRemainder.decTest decimaltestdata/ddRemainderNear.decTest decimaltestdata/ddRotate.decTest decimaltestdata/ddSameQuantum.decTest decimaltestdata/ddScaleB.decTest decimaltestdata/ddShift.decTest decimaltestdata/ddSubtract.decTest decimaltestdata/ddToIntegral.decTest decimaltestdata/ddXor.decTest decimaltestdata/decDouble.decTest decimaltestdata/decQuad.decTest decimaltestdata/decSingle.decTest decimaltestdata/divide.decTest decimaltestdata/divideint.decTest decimaltestdata/dqAbs.decTest decimaltestdata/dqAdd.decTest decimaltestdata/dqAnd.decTest decimaltestdata/dqBase.decTest decimaltestdata/dqCanonical.decTest decimaltestdata/dqClass.decTest decimaltestdata/dqCompare.decTest decimaltestdata/dqCompareSig.decTest decimaltestdata/dqCompareTotal.decTest decimaltestdata/dqCompareTotalMag.decTest decimaltestdata/dqCopy.decTest decimaltestdata/dqCopyAbs.decTest decimaltestdata/dqCopyNegate.decTest decimaltestdata/dqCopySign.decTest decimaltestdata/dqDivide.decTest decimaltestdata/dqDivideInt.decTest decimaltestdata/dqEncode.decTest decimaltestdata/dqFMA.decTest decimaltestdata/dqInvert.decTest decimaltestdata/dqLogB.decTest decimaltestdata/dqMax.decTest decimaltestdata/dqMaxMag.decTest decimaltestdata/dqMin.decTest decimaltestdata/dqMinMag.decTest decimaltestdata/dqMinus.decTest decimaltestdata/dqMultiply.decTest decimaltestdata/dqNextMinus.decTest decimaltestdata/dqNextPlus.decTest decimaltestdata/dqNextToward.decTest decimaltestdata/dqOr.decTest decimaltestdata/dqPlus.decTest decimaltestdata/dqQuantize.decTest decimaltestdata/dqReduce.decTest decimaltestdata/dqRemainder.decTest decimaltestdata/dqRemainderNear.decTest decimaltestdata/dqRotate.decTest decimaltestdata/dqSameQuantum.decTest decimaltestdata/dqScaleB.decTest decimaltestdata/dqShift.decTest decimaltestdata/dqSubtract.decTest decimaltestdata/dqToIntegral.decTest decimaltestdata/dqXor.decTest decimaltestdata/dsBase.decTest decimaltestdata/dsEncode.decTest decimaltestdata/exp.decTest decimaltestdata/extra.decTest decimaltestdata/fma.decTest decimaltestdata/inexact.decTest decimaltestdata/invert.decTest decimaltestdata/ln.decTest decimaltestdata/log10.decTest decimaltestdata/logb.decTest decimaltestdata/max.decTest decimaltestdata/maxmag.decTest decimaltestdata/min.decTest decimaltestdata/minmag.decTest decimaltestdata/minus.decTest decimaltestdata/multiply.decTest decimaltestdata/nextminus.decTest decimaltestdata/nextplus.decTest decimaltestdata/nexttoward.decTest decimaltestdata/or.decTest decimaltestdata/plus.decTest decimaltestdata/power.decTest decimaltestdata/powersqrt.decTest decimaltestdata/quantize.decTest decimaltestdata/randomBound32.decTest decimaltestdata/randoms.decTest decimaltestdata/reduce.decTest decimaltestdata/remainder.decTest decimaltestdata/remainderNear.decTest decimaltestdata/rescale.decTest decimaltestdata/rotate.decTest decimaltestdata/rounding.decTest decimaltestdata/samequantum.decTest decimaltestdata/scaleb.decTest decimaltestdata/shift.decTest decimaltestdata/squareroot.decTest decimaltestdata/subtract.decTest decimaltestdata/testall.decTest decimaltestdata/tointegral.decTest decimaltestdata/tointegralx.decTest decimaltestdata/xor.decTest profile.py run.py setup.py test_deccoeff.py test_decimal.py Message-ID: <20090110172235.DA2641E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 10 18:22:25 2009 New Revision: 68494 Log: First steps towards implementing Decimal in C. This is a hybrid Python and C implementation: the C part is a Python extension module that implements base-10 multiple precision arithmetic and a skeletal _Decimal class. The Python part consists of the old decimal.py, fixed up to use the base-10 integer type instead of string for the coefficient. At this stage, only a very few methods have been moved from decimal.py to the C module. Nevertheless, the current hybrid is fully functional: the entire decimal test-suite can be run (and should pass, of course!). Added: sandbox/trunk/decimal/decimal_in_c/ sandbox/trunk/decimal/decimal_in_c/CHANGES sandbox/trunk/decimal/decimal_in_c/Makefile sandbox/trunk/decimal/decimal_in_c/README sandbox/trunk/decimal/decimal_in_c/TODO sandbox/trunk/decimal/decimal_in_c/configure (contents, props changed) sandbox/trunk/decimal/decimal_in_c/configure.ac sandbox/trunk/decimal/decimal_in_c/deccoeff.c sandbox/trunk/decimal/decimal_in_c/deccoeff_config.h.in sandbox/trunk/decimal/decimal_in_c/decimal.py sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/abs.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/add.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/and.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/base.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/clamp.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/class.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/compare.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/comparetotal.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/comparetotmag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copy.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copyabs.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copynegate.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copysign.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAbs.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAdd.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAnd.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddBase.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCanonical.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddClass.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompare.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareSig.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareTotal.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareTotalMag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopy.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopyAbs.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopyNegate.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopySign.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddDivide.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddDivideInt.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddEncode.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddFMA.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddInvert.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddLogB.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMax.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMaxMag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMin.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMinMag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMinus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMultiply.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextMinus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextPlus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextToward.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddOr.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddPlus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddQuantize.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddReduce.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRemainder.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRemainderNear.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRotate.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddSameQuantum.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddScaleB.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddShift.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddSubtract.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddToIntegral.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddXor.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decDouble.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decQuad.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decSingle.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/divide.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/divideint.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAbs.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAdd.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAnd.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqBase.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCanonical.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqClass.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompare.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareSig.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareTotal.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareTotalMag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopy.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopyAbs.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopyNegate.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopySign.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqDivide.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqDivideInt.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqEncode.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqFMA.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqInvert.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqLogB.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMax.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMaxMag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMin.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMinMag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMinus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMultiply.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextMinus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextPlus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextToward.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqOr.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqPlus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqQuantize.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqReduce.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRemainder.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRemainderNear.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRotate.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqSameQuantum.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqScaleB.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqShift.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqSubtract.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqToIntegral.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqXor.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dsBase.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dsEncode.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/exp.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/extra.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/fma.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/inexact.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/invert.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ln.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/log10.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/logb.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/max.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/maxmag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/min.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/minmag.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/minus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/multiply.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nextminus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nextplus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nexttoward.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/or.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/plus.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/power.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/powersqrt.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/quantize.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/randomBound32.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/randoms.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/reduce.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/remainder.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/remainderNear.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rescale.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rotate.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rounding.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/samequantum.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/scaleb.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/shift.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/squareroot.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/subtract.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/testall.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/tointegral.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/tointegralx.decTest sandbox/trunk/decimal/decimal_in_c/decimaltestdata/xor.decTest sandbox/trunk/decimal/decimal_in_c/profile.py sandbox/trunk/decimal/decimal_in_c/run.py sandbox/trunk/decimal/decimal_in_c/setup.py sandbox/trunk/decimal/decimal_in_c/test_deccoeff.py sandbox/trunk/decimal/decimal_in_c/test_decimal.py Added: sandbox/trunk/decimal/decimal_in_c/CHANGES ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/CHANGES Sat Jan 10 18:22:25 2009 @@ -0,0 +1,36 @@ +Changes since version 0.2 +------------------------- + +Creation of a Deccoeff from a Python 3.0 str (i.e. unicode) instance +no longer goes through an intermediate bytes stage. + +Add skeleton _Decimal class, to serve as base for Decimal, and +modify decimal.py to use it. + +Make hash produce 64-bit values for 64-bit builds. + +Convert source code to 4-space indent, no tabs + +Use faster algorithm for basecase multiplication, minimizing the +number of divisions. + +Add Karatsuba multiplication. + +Add some profiling code for multiplication. + +Add code to use 64-bit limbs (with 18 digits to a limb), if an +unsigned 128-bit type is available. + +Fix bug in base conversion constants: constants were swapped around +when LIMB_DIGITS == 4. + +Fix bug in limb_getdigit: it checks that n < 9; should have been +n < LIMB_DIGITS + +Fix rich comparisons to do type conversion. + +Test-suite for deccoeff module added + +Make limb types unsigned integers instead of signed integers. + +Add telco benchmarking code. \ No newline at end of file Added: sandbox/trunk/decimal/decimal_in_c/Makefile ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/Makefile Sat Jan 10 18:22:25 2009 @@ -0,0 +1,34 @@ +PYTHON = ../../py3k/python.exe + +all: deccoeff.so +module: + $(PYTHON) setup.py build + cp build/lib*/deccoeff.so . +clean: + -rm -fr build/ + -rm deccoeff.o deccoeff.so + -rm *.pyc + -rm config.status config.log deccoeff_config.h + -rm -fr autom4te.cache/ + -rm telco/telco.out + +distclean: clean + -rm deccoeff_config.h.in + -rm configure + +test: deccoeff.so + $(PYTHON) test_deccoeff.py + $(PYTHON) test_decimal.py + +run: deccoeff.so + $(PYTHON) -i run.py + +profile: deccoeff.so + $(PYTHON) profile.py + +install: all + $(PYTHON) setup.py install + +deccoeff.so: deccoeff.c + $(PYTHON) setup.py build + cp build/lib*/deccoeff.so . Added: sandbox/trunk/decimal/decimal_in_c/README ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/README Sat Jan 10 18:22:25 2009 @@ -0,0 +1,131 @@ +Deccoeff is an extension type for Python 3.0 that implements +nonnegative decimal integers. These integers can be used in +arithmetic in the usual way and also treated as strings of decimal +digits. The main purpose of Deccoeff is to act as the coefficient +type for Decimal instances. + +Questions, comments, suggestions, etc., should go to Mark +Dickinson at dickinsm at gmail.com. + +This distribution also contains a version of decimal.py that's adapted +to use the Deccoeff type, along with all the decimal tests for testing +purposes. + + +Installation instructions (unix) +-------------------------------- + +(1) Edit the top line of the Makefile to point to a Python 3.x +executable. + +(2) ./configure && make + +(3) make install + +(4) make test (runs the entire decimal test-suite) + +To use a 64-bit limb on 64-bit platforms, you'll probably need to set +CFLAGS or CPPFLAGS when running configure. For example, on my Core 2 +Duo MacBook, with a 64-bit version of Python 3 already installed, I +type: + +CFLAGS='-arch x86_64' ./configure + +This lets the configure script find the __uint128_t type provided by +gcc. + +Usage +----- + +To get started, just import Deccoeff from deccoeff +(or type 'make run'). + +dickinsm$ python3.0 +Python 3.0rc1+ (py3k:66550M, Sep 22 2008, 14:47:17) +[GCC 4.0.1 (Apple Inc. build 5484)] on darwin +Type "help", "copyright", "credits" or "license" for more information. +>>> from deccoeff import * +>>> D = Deccoeff + +Deccoeffs can be created from integers, strings, or other Deccoeffs: + +>>> D(2) +Deccoeff('2') +>>> D('1234') +Deccoeff('1234') +>>> D() +Deccoeff('0') +>>> D(D(314159)) +Deccoeff('314159') + +Arithmetic works as expected, except that if the result of an +arithmetic operation would be negative then OverflowError is raised. + +>>> D(23)**D(12) +Deccoeff('21914624432020321') +>>> D(1729) - D(729) +Deccoeff('1000') +>>> D(729) - D(1729) +Traceback (most recent call last): + File "", line 1, in +OverflowError: difference is negative + +Deccoeff instances play nicely with other integer types, giving +a Deccoeff result. + +>>> D(1234567) % 100 +Deccoeff('67') + +There's an upper bound on the number of decimal digits a Deccoeff +can have; it's made available to Python as deccoeff.MAX_DIGITS. + +>>> print(MAX_DIGITS) +1000000000 +>>> x = D(1) << (MAX_DIGITS - 1) # fine +>>> y = D(1) << MAX_DIGITS +Traceback (most recent call last): + File "", line 1, in +OverflowError: Deccoeff instance has too many digits +[32860 refs] + +A Deccoeff instance can be indexed and sliced to give an easy way to +extract a subset of its digits. Note that indexing works from a +mathematical perspective: x[0] refers to the units digit of x, x[1] +refers to the tens digit, and so on. Thus in the usual representation +of a nonnegative integer as a decimal string, x[0] is the *last* digit +printed, not the first. The builtin function len, when applied to a +Deccoeff, gives the number of decimal digits needed to print that +Deccoeff, or 0 if the Deccoeff instance is zero. + +>>> x = D(314159265357989323) +>>> x +Deccoeff('314159265357989323') +>>> x[10:] +Deccoeff('31415926') +>>> x[1] +Deccoeff('2') +>>> x[:5] +Deccoeff('89323') +>>> x[5:] +Deccoeff('3141592653579') +>>> len(x) +18 + +Note however that the start and stop arguments to the slice must be +nonnegative, and that the step argument is not supported. + +As you'd expect for a decimal type, the shift operators multiply and +divide by powers of 10, not 2. + +>>> x >> 10 +Deccoeff('31415926') +>>> x << 10 +Deccoeff('3141592653579893230000000000') + +Internally, a Deccoeff instance is stored as an array of coefficients +in base 10**LIMB_DIGITS, for some value of LIMB_DIGITS. While there's +little reason for the user to care about the value of LIMB_DIGITS, it +can be accessed as deccoeff.LIMB_DIGITS. + +>>> LIMB_DIGITS +9 Added: sandbox/trunk/decimal/decimal_in_c/TODO ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/TODO Sat Jan 10 18:22:25 2009 @@ -0,0 +1,70 @@ +To do (or consider) +=================== + +Deccoeff type +------------- + +* Add check that MAX_DIGITS/LIMB_DIGITS is small enough; twice that + value should fit into a Py_ssize_t. + +* relax MAX_DIGITS on 64-bit platforms? + +* make it possible to choose LIMB_DIGITS at configure time? if so, + add LIMB_DIGITS = 8 option, for purposes of experimentation. + +* change default choice of LIMB_DIGITS: it's probably not wise to + automatically use LIMB_DIGITS = 18 when the 128-bit unsigned type is + available, since LIMB_DIGITS = 9 can be faster, even on a 64-bit + machine. + +* expand Deccoeff-specific tests + +* improve and correct documentation; remove outdated deccoeff.txt; ReST! + +* fast recursive algorithms for division, base conversion + +* (fast recursive) square root + +* implement div_nearest and sqrt_nearest: they're bottlenecks + +* make scale_Py_ssize_t safer: use deccoeff instead of Py_ssize_t for + high-precision case + +* minor optimization opportunities: + + - in Karatsuba, accumulate all additions for middle term without + propagating carry + + - make limb_error checks only for debug build + + - limbs_lshift and limbs_rshift could be faster when the shift count + is a multiple of LIMB_DIGITS. + + - when LIMB_DIGITS == 9, base conversion could be a factor of 2 faster + (asymptotically) by operating on two PyLong_Digits at a time instead of + one. + +_Decimal type +------------- + +* recode the various Decimal operations in C. str and cmp are + particularly high priority. C version of __str__ should write + unicode directly, rather than writing bytes and then converting from + bytes to unicode. + +* fill in missing docstrings + +* make exponent a Deccoeff (first requires making Deccoeff signed). + this should offer improvements in parsing and printing of Decimal. + OR: + +* make exponent a C Py_ssize_t (or long? or int64_t?), for speed. Would + require some thinking about exponent and coefficient length + constraints, with reference to the IBM specification. Unless + there's a huge speed advantage from this, I'm more inclined to leave + exponents being arbitrary precision integers. + +_Context type +------------- + +To do in its entirety. \ No newline at end of file Added: sandbox/trunk/decimal/decimal_in_c/configure ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/configure Sat Jan 10 18:22:25 2009 @@ -0,0 +1,4670 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61 for deccoeff 0.2. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 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. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + 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+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf at gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='deccoeff' +PACKAGE_TARNAME='deccoeff' +PACKAGE_VERSION='0.2' +PACKAGE_STRING='deccoeff 0.2' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + 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- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + 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 + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures deccoeff 0.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +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/deccoeff] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of deccoeff 0.2:";; + esac + cat <<\_ACEOF + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + 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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +deccoeff configure 0.2 +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +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 + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by deccoeff $as_me 0.2, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + 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 && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { 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) + { 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 + { 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=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_config_headers="$ac_config_headers deccoeff_config.h" + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ 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 + 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. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + 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. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +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. +{ 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 | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + 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' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# 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 + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +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. +{ 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; } + +{ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+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. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +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>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+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. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.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_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.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_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +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 +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + 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_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ 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 + 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" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_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 "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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + 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 "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 + 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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ 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 + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_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 "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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + 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 "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 + 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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "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` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +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 + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for 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 + 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 +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.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_header_stdc=yes +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#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 + + +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +if test "${ac_cv_header_stdbool_h+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 +#ifndef bool + "error: bool is not defined" +#endif +#ifndef false + "error: false is not defined" +#endif +#if false + "error: false is not 0" +#endif +#ifndef true + "error: true is not defined" +#endif +#if true != 1 + "error: true is not 1" +#endif +#ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +# if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a runtime + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); +# endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + 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_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdbool_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } +{ echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef _Bool ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type__Bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Bool=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + + +for ac_header in stdint.h +do +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 + { 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 +fi +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? +{ 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 +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 + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ 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 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_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 "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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ 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 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +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 + + + + + { echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_uint32_t=no + for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + 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 () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; +test_array [0] = 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 + case $ac_type in + uint32_t) ac_cv_c_uint32_t=yes ;; + *) ac_cv_c_uint32_t=$ac_type ;; +esac + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint32_t" != no && break + done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } + case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT32_T 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + + + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_uint64_t=no + for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + 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 () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> (64 - 1) == 1)]; +test_array [0] = 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 + case $ac_type in + uint64_t) ac_cv_c_uint64_t=yes ;; + *) ac_cv_c_uint64_t=$ac_type ;; +esac + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint64_t" != no && break + done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } + case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT64_T 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + + + +{ echo "$as_me:$LINENO: checking for __uint128_t" >&5 +echo $ECHO_N "checking for __uint128_t... $ECHO_C" >&6; } +if test "${ac_cv_type___uint128_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 __uint128_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___uint128_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type___uint128_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type___uint128_t" >&5 +echo "${ECHO_T}$ac_cv_type___uint128_t" >&6; } +if test $ac_cv_type___uint128_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE___UINT128_T 1 +_ACEOF + + +fi + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 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" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by deccoeff $as_me 0.2, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration headers: +$config_headers + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +deccoeff config.status 0.2 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +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' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "deccoeff_config.h") CONFIG_HEADERS="$CONFIG_HEADERS deccoeff_config.h" ;; + + *) { { 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 + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + + +for ac_tag in :H $CONFIG_HEADERS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + 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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" + ;; + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + Added: sandbox/trunk/decimal/decimal_in_c/configure.ac ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/configure.ac Sat Jan 10 18:22:25 2009 @@ -0,0 +1,26 @@ +AC_PREREQ(2.61) +AC_INIT(deccoeff, 0.2) + +AC_CONFIG_HEADERS(deccoeff_config.h) + +dnl checks for header files + +AC_HEADER_STDBOOL +AC_CHECK_HEADERS(stdint.h) + +dnl ideally, we'd like to use uint32_t for our Deccoeff limbs, which +dnl means that we also need uint64_t to hold intermediate results when +dnl doing multiplications and divisions. But these types aren't part +dnl of C89, so we need to check for them (and provide fallbacks if +dnl they don't exist). + +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T + +dnl check for 128-bit unsigned integer type; gcc makes it available as +dnl __uint128_t on x86-64. + +AC_CHECK_TYPES([__uint128_t]) + +AC_OUTPUT + Added: sandbox/trunk/decimal/decimal_in_c/deccoeff.c ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/deccoeff.c Sat Jan 10 18:22:25 2009 @@ -0,0 +1,3154 @@ +/* + * 'deccoeff' is a Python extension module that exports two classes: + * _Decimal and Deccoeff. + * + * deccoeff._Decimal is a skeletal base class for the decimal.Decimal class. + * As time goes on, the aim is to move more and more code from the Python + * decimal.py file to the _Decimal class, and eventually rename _Decimal + * to Decimal. + * + * deccoeff.Deccoeff is a class implementing arbitrary-precision unsigned + * integer arithmetic in a decimal base. In addition to the usual arithmetic + * operations, Deccoeff instances support slicing and element access, for + * retrieving individual digits or sequences of digits. As the name suggests, + * Deccoeff instances are intended to be used as the coefficients for _Decimal + * instances. + * + * Author: Mark Dickinson (dickinsm at gmail.com). + * Licensed to the PSF under a Contributor Agreement. + */ + +#include "Python.h" +#include "longintrepr.h" +#include "deccoeff_config.h" +#include /* for offsetof */ + +/* We use the C99 'bool' type for carries, so we need to include stdbool.h if + present, else define substitutes for bool, true and false. We also need to + include stdint.h and inttypes.h for uint32_t and the like. */ + +#if defined(HAVE_STDINT_H) +#include +#endif +#if defined(HAVE_INTTYPES_H) +#include +#endif +#if defined(HAVE_STDBOOL_H) +# include +#else +# ifndef HAVE__BOOL +# define _Bool signed char; +# endif +# define bool _Bool; +# define false 0; +# define true 1; +#endif + +/* + Platform-specific defines + + A Deccoeff instance is stored in base LIMB_BASE = 10**LIMB_DIGITS as an + array of limbs (least significant first). The value of LIMB_DIGITS + depends on what C types are available. + + limb_t is an integer type that can hold any integer in the range [0, + LIMB_BASE); LIMB_BASE itself should also be representable. double_limb_t + can hold any integer in [0, LIMB_BASE*LIMB_BASE). Type digit_limb_t is used + for Deccoeff <-> PyLong conversions and should be able to hold any integer + in [0, LIMB_BASE * PyLong_BASE). +*/ + +#if (defined(UINT64_MAX) || defined(uint64_t)) && \ + (defined(HAVE___UINT128_T)) + +/* if a 128-bit unsigned integer type is available, use a 64-bit limb with 18 + digits to a limb. It *is* possible to squeeze 19 decimal digits into a + 128-bit unsigned integer type, but that leaves little room for maneuver. + Using 18 decimal digits instead makes the basic multiplication algorithm + significantly faster, by saving on the number of divisions necessary. */ + +typedef uint64_t limb_t; +typedef __uint128_t double_limb_t; +typedef __uint128_t digit_limb_t; +#define LIMB_DIGITS 18 +#define LIMB_MAX ((limb_t)999999999999999999) /* 10**LIMB_DIGITS - 1 */ + +#elif (defined(UINT32_MAX) || defined(uint32_t)) && \ + (defined(UINT64_MAX) || defined(uint64_t)) + +/* ... else if uint32_t and uint64_t are available, use those, + with 9 digits to a limb ... */ + +typedef uint32_t limb_t; +typedef uint64_t double_limb_t; +typedef uint64_t digit_limb_t; +#define LIMB_DIGITS 9 +#define LIMB_MAX ((limb_t)999999999) /* 10**LIMB_DIGITS - 1 */ + +#else + +/* ... else fall back to short and long, and make LIMB_DIGITS 4. */ + +typedef unsigned short limb_t; +typedef unsigned long double_limb_t; +typedef unsigned long digit_limb_t; +#define LIMB_DIGITS 4 +#define LIMB_MAX ((limb_t)9999) + +#endif + +/* powers_of_ten contains 10**0 through 10**(LIMB_DIGITS-1). + It's filled during module initialization. */ + +static limb_t powers_of_ten[LIMB_DIGITS]; + +/* + The Deccoeff part of this file is organized in three parts. First we have + primitive operations on single limbs (arithmetic, shifts, + etc.)---e.g. limb_adc, limb_fmaa, .... This is followed by functions + defining operations on arrays of limbs (limbs_add, limbs_mul, ...); these + functions contain the necessary mathematical algorithms, but know nothing + about Python stuff like allocating memory, raising exceptions, converting + types, etc. Lastly we have functions providing the deccoeff operations + themselves. +*/ + +/********************************* + * Primitive operations on limbs * + *********************************/ + +/* The idea behind this section is that it should be easy to change the + underlying representation of a limb without greatly affecting the rest of + the code. For example, one might want to use alternative encodings like + binary-coded decimal or densely packed decimal. In that case, only this + section should have to be changed, provided that all following code uses + only these primitive operations to operate on limbs. + + Ideally, later code should not assume that limbs can be operated on using + the usual arithmetic operators, or that they are comparable with < or == + (some encodings may not be monotonic, or may have redundant encodings of + the same integer, or may not even be encoded as a C integer type). +*/ + +#define LIMB_ZERO ((limb_t)0) +#define LIMB_ONE ((limb_t)1) +#define LIMB_BASE (LIMB_MAX+LIMB_ONE) + +/* limb_error is called for internal errors */ + +static void +limb_error(const char *msg) +{ + fprintf(stderr, "limb_error: %s. Please report.\n", msg); + abort(); +} + +/* add with carry: compute a + b + c; put sum in *r and return new carry. */ + +static bool +limb_adc(limb_t *r, limb_t a, limb_t b, bool c) +{ + limb_t sum; + sum = a + b + (c ? LIMB_ONE : LIMB_ZERO); + if (sum >= LIMB_BASE || sum < a) { + *r = sum - LIMB_BASE; + return true; + } + else { + *r = sum; + return false; + } +} + +/* subtract with borrow: compute a - b - c; put result in *r and return the + carry (true if a - b - c < 0, false otherwise). */ + +static bool +limb_sbb(limb_t *r, limb_t a, limb_t b, bool c) +{ + limb_t diff; + diff = a - b - (c ? LIMB_ONE : LIMB_ZERO); + if (diff > a) { + *r = diff + LIMB_BASE; + return true; + } + else { + *r = diff; + return false; + } +} + +/* multiply and add with two addends; useful for long multiplication. Store + the low part of the result in *low, and return the high part. */ + +static limb_t +limb_fmaa(limb_t *low, limb_t a, limb_t b, limb_t c, limb_t d) { + double_limb_t hilo; + hilo = (double_limb_t)a * b + c + d; + *low = (limb_t)(hilo%LIMB_BASE); + return (limb_t)(hilo/LIMB_BASE); +} + +/* division: divide high*BASE+low by c. Return the quotient and stored + remainder in *rem. Requires that high < c. */ + +static limb_t +limb_div(limb_t *rem, limb_t high, limb_t low, limb_t c) { + double_limb_t hilo; + if (high >= c) + limb_error("limb_div: invalid division"); + hilo = (double_limb_t)high * LIMB_BASE + low; + *rem = (limb_t)(hilo%c); + return (limb_t)(hilo/c); +} + +/* return true if the limb is nonzero, else false */ + +static bool +limb_bool(limb_t a) +{ + return a != 0; +} + +/* The following two functions are the primitive operations needed for base + conversion. Any value n in the range [0, LIMB_BASE * PyLong_BASE) can be + written either in the form + + n = a * LIMB_BASE + b 'digit-limb' + + with 0 <= a < PyLong_BASE, 0 <= b < LIMB_BASE, or in the form + + n = c * PyLong_BASE + d 'limb-digit' + + with 0 <= c < LIMB_BASE, 0 <= d < PyLong_BASE. digit_limb_swap converts + from the first form to the second, limb_digit_swap does the reverse. */ + +static digit +digit_limb_swap(limb_t *c, digit a, limb_t b) +{ + digit_limb_t hilo; + hilo = (digit_limb_t)a * LIMB_BASE + b; + *c = (limb_t)(hilo >> PyLong_SHIFT); + return (digit)(hilo & PyLong_MASK); +} + +static limb_t +limb_digit_swap(digit *a, limb_t c, digit d) +{ + digit_limb_t hilo; + hilo = ((digit_limb_t)c << PyLong_SHIFT) + d; + *a = (digit)(hilo / LIMB_BASE); + return (limb_t)(hilo % LIMB_BASE); +} + +/* get a hash value from a limb */ + +static long +limb_hash(limb_t x) { + return (long)x; +} + +/* smallest nonnegative i such that x < 10**i; undefined if x == 0 */ + +static Py_ssize_t +limb_len(limb_t x) { + Py_ssize_t i; + if (x == 0) + limb_error("limb_len: zero argument"); + i = 0; + while (i < LIMB_DIGITS && powers_of_ten[i] <= x) + i++; + return i; +} + +/******************************* + * Derived operations on limbs * + *******************************/ + +/* These limb operations are derived from the primitive operations above, and + are provided for convenience. There is no need to change these if/when the + representation of a limb_t changes. */ + +/* comparison: -1 if a < b, 0 if a == b, 1 if a > b */ + +static int +limb_cmp(limb_t a, limb_t b) +{ + bool carry; + limb_t diff; + carry = limb_sbb(&diff, a, b, false); + if (limb_bool(diff)) + return carry ? -1 : 1; + else + return 0; +} + +/* true if a == b, else false */ + +static bool +limb_eq(limb_t a, limb_t b) +{ + /* a == b iff a - b is zero */ + limb_t diff; + limb_sbb(&diff, a, b, false); + return !limb_bool(diff); +} + +/* true if a < b, else false */ + +static bool +limb_lt(limb_t a, limb_t b) +{ + /* a < b iff a - b overflows */ + limb_t dummy; + return limb_sbb(&dummy, a, b, false); +} + +/* true if a <= b, else false */ + +static bool +limb_le(limb_t a, limb_t b) +{ + /* a <= b iff a - b - 1 overflows */ + limb_t dummy; + return limb_sbb(&dummy, a, b, true); +} + +/* extract bottom n digits of a limb */ + +static limb_t +limb_mask(limb_t a, Py_ssize_t n) +{ + if (!(0 <= n && n <= LIMB_DIGITS)) + limb_error("limb_mask: invalid count"); + if (n < LIMB_DIGITS) + limb_div(&a, LIMB_ZERO, a, powers_of_ten[n]); + return a; +} + +/* *res = a << n + b, b < 10**n. Returns part shifted out. */ + +static limb_t +limb_lshift(limb_t *res, limb_t a, Py_ssize_t n, limb_t b) { + if (!(0 <= n && n <= LIMB_DIGITS)) + limb_error("limb_lshift: invalid shift index"); + if (LIMB_DIGITS == n) { + *res = b; + return a; + } + else + return limb_fmaa(res, a, powers_of_ten[n], b, LIMB_ZERO); +} + +/* *res = (a + b*LIMB_BASE) >> n, b < 10**n. Returns part shifted out. */ + +static limb_t +limb_rshift(limb_t *res, limb_t a, Py_ssize_t n, limb_t b) { + limb_t rem; + if (!(0 <= n && n <= LIMB_DIGITS)) + limb_error("limb_lshift: invalid shift index"); + if (LIMB_DIGITS == n) { + *res = b; + return a; + } + else { + *res = limb_div(&rem, b, a, powers_of_ten[n]); + return rem; + } +} + +/* retrieve the value of a particular digit, as a limb_t */ + +static limb_t +limb_getdigit(limb_t x, Py_ssize_t n) +{ + limb_t q, dummy; + if (!(0 <= n && n < LIMB_DIGITS)) + limb_error("invalid digit in limb_getdigit"); + q = limb_div(&dummy, LIMB_ZERO, x, powers_of_ten[n]); + return limb_mask(q, 1); +} + +/* convert a character in the range '0' through '9' into a limb and back */ + +static limb_t +wdigit_to_limb(Py_UNICODE d) +{ + digit dummy; + return limb_digit_swap(&dummy, LIMB_ZERO, (digit)(d - (Py_UNICODE)'0')); +} + +static Py_UNICODE +limb_to_wdigit(limb_t b) +{ + limb_t dummy; + return (Py_UNICODE)'0' + (Py_UNICODE)digit_limb_swap(&dummy, 0, b); +} + +/********************************** + * Faster basecase multiplication * + **********************************/ + +/* Here's a simple optimization for basecase multiplication, that achieves + over 5x speedups on some 64-bit platforms. It uses the fact that LIMB_BASE + * LIMB_BASE is significantly smaller than the maximum possible value stored + by a double_limb_t, by accumulating the sum of several partial products at + a time. This saves drastically on the number of divisions required. It + also reduces the number of additions and stores/loads. + + The algorithm breaks the rules about only using the primitive limb + operations above; it would need to be changed or removed for other + representations. */ + +/* The largest number of partials that we can accumulate at once is + floor(2**(16*sizeof(limb_t)) / 10**(2*MAX_DIGITS)). */ +#if LIMB_DIGITS == 4 +#define MAX_PARTIALS 42 /* floor(2^32 / 10^8) */ +#elif LIMB_DIGITS == 9 +#define MAX_PARTIALS 18 /* floor(2^64 / 10^18) */ +#elif LIMB_DIGITS == 18 +#define MAX_PARTIALS 340 /* floor(2^128 / 10^36) */ +#else +#error "unrecognised value for LIMB_DIGITS" +#endif + +/* res[0:a_size+b_size] := a*b, assuming b_size <= MIN(MAX_PARTIALS, a_size). + This is a dropin replacement for limbs_mul. */ + +static void +limbs_fastmultiply_init(limb_t *res, const limb_t *a, Py_ssize_t a_size, + const limb_t *b, Py_ssize_t b_size) +{ + double_limb_t acc = 0; + Py_ssize_t j, k; + assert(b_size <= MAX_PARTIALS && b_size <= a_size); + for (k=0; k= b_size */ + if (a_size < b_size) { + const limb_t *temp; + Py_ssize_t temp_size; + temp = a; a = b; b = temp; + temp_size = a_size; a_size = b_size; b_size = temp_size; + } + + assert(b_size <= a_size); + if (b_size < MAX_PARTIALS) + limbs_fastmultiply_init(res, a, a_size, b, b_size); + else { + limbs_fastmultiply_init(res, a, a_size, b, MAX_PARTIALS); + b_size -= MAX_PARTIALS; + b += MAX_PARTIALS; + res += MAX_PARTIALS; + while (b_size >= MAX_PARTIALS) { + limbs_fastmultiply_add(res, a, a_size, b, MAX_PARTIALS); + b_size -= MAX_PARTIALS; + b += MAX_PARTIALS; + res += MAX_PARTIALS; + } + limbs_fastmultiply_add(res, a, a_size, b, b_size); + } +} + +#undef LIMB_BASE + + +/********************************* + * Arithmetic on arrays of limbs * + *********************************/ + +/* Low-level functions for operating on arrays of limbs. These functions + don't take care of memory allocation; they all assume that sufficient space + is provided for their results. */ + +/* Rational approximations to log(10)/log(2), used for base conversion: + 485/146 = 3.321917808219... + log2(10) = 3.321928094887... + 2136/643 = 3.321928460342... + + Note that for correctness of scale_Py_ssize_t, it's required that LOG2_10UP + * LOG2_10UQ * LIMB_DIGITS * PyLong_SHIFT and LOG2_10LP * LOG2_10LQ * + LIMB_DIGITS * PyLong_SHIFT both fit into a Py_ssize_t. The values below + are okay even if LIMB_DIGITS = 19 and PyLong_SHIFT = 64. +*/ + +#define LOG2_10LP 485 +#define LOG2_10LQ 146 +#define LOG2_10UP 2136 +#define LOG2_10UQ 643 + +/* add n-limb numbers a and b, producing an n-limb result res and a carry */ + +static bool +limbs_add(limb_t *res, const limb_t *a, const limb_t *b, Py_ssize_t n) +{ + Py_ssize_t i; + bool carry; + carry = false; + for (i=0; i < n; i++) + carry = limb_adc(res+i, a[i], b[i], carry); + return carry; +} + +/* subtract n-limb numbers a and b, giving n-limb difference res and a + carry */ + +static bool +limbs_sub(limb_t *res, const limb_t *a, const limb_t *b, Py_ssize_t n) +{ + Py_ssize_t i; + bool carry; + carry = false; + for (i=0; i < n; i++) + carry = limb_sbb(res+i, a[i], b[i], carry); + return carry; +} + +/* increment a_size-limb number a if carry is true, else just copy it; gives + a_size-limb result and returns a carry */ + +static bool +limbs_incc(limb_t *res, const limb_t *a, Py_ssize_t a_size, bool carry) +{ + Py_ssize_t i; + for (i=0; i < a_size; i++) + carry = limb_adc(res+i, a[i], LIMB_ZERO, carry); + return carry; +} + +/* decrement a_size-limb number a if carry is true, else just copy it; gives + a_size-limb result and returns a carry */ + +static bool +limbs_decc(limb_t *res, const limb_t *a, Py_ssize_t a_size, bool carry) +{ + Py_ssize_t i; + for (i=0; i < a_size; i++) + carry = limb_sbb(res+i, a[i], LIMB_ZERO, carry); + return carry; +} + +/* subtract limbs from zero, with borrow. Equivalent to the nines' complement + of a if carry == true on input, and the ten's complement otherwise. */ + +static bool +limbs_cmpl(limb_t *res, const limb_t *a, Py_ssize_t a_size, bool carry) +{ + Py_ssize_t i; + for (i=0; i < a_size; i++) + carry = limb_sbb(res+i, LIMB_ZERO, a[i], carry); + return carry; +} + +/* copy limbs */ + +static void +limbs_copy(limb_t *res, const limb_t *a, Py_ssize_t a_size) +{ + Py_ssize_t i; + for (i=0; i < a_size; i++) + res[i] = a[i]; +} + +/* write zero to a set of limbs */ + +static void +limbs_zero(limb_t *res, Py_ssize_t n) +{ + Py_ssize_t i; + for (i=0; i < n; i++) + res[i] = LIMB_ZERO; +} + +/* take the absolute value of the difference between n-limb numbers a and b, + returning true if a < b, false if a >= b. */ + +static bool +limbs_diff(limb_t *res, const limb_t *a, const limb_t *b, Py_ssize_t n) +{ + Py_ssize_t i; + bool carry, neg; + + /* reduce to case where top limbs differ */ + while (n > 0 && limb_eq(a[n-1], b[n-1])) { + res[n-1] = LIMB_ZERO; + n--; + } + if (n == 0) + return false; + + /* now reduce to case a > b */ + neg = limb_lt(a[n-1], b[n-1]); + if (neg) { + const limb_t *temp; + temp = a; a = b; b = temp; + } + + /* subtract */ + carry = false; + for (i=0; i < n; i++) + carry = limb_sbb(res+i, a[i], b[i], carry); + assert(!carry); + return neg; +} + +/* multiply a_size-limb number a by single limb x, getting a_size-limb result + res and returning the high limb. */ + +static limb_t +limbs_mul1(limb_t *res, const limb_t *a, Py_ssize_t a_size, limb_t x) +{ + limb_t high; + Py_ssize_t i; + high = LIMB_ZERO; + for (i=0; i < a_size; i++) + high = limb_fmaa(res+i, a[i], x, high, LIMB_ZERO); + return high; +} + +/* multiply a by b, getting (a_size + b_size)-limb result res. This is the + usual algorithm, now redundant: we use the faster limbs_fastmultiply + instead. This code left in for testing and debugging purposes. */ + +static void +limbs_mul(limb_t *res, const limb_t *a, Py_ssize_t a_size, + const limb_t *b, Py_ssize_t b_size) +{ + Py_ssize_t i, j; + limb_t hiword; + for (j=0; j < b_size; j++) + res[j] = LIMB_ZERO; + for (i=0; i < a_size; i++) { + hiword = LIMB_ZERO; + for (j=0; j < b_size; j++) + hiword = limb_fmaa(res+i+j, a[i], b[j], res[i+j], hiword); + res[i+j] = hiword; + } +} + +/* divide a_size-limb number a by single limb x, giving a_size-limb quotient + res and returning the (single limb) remainder. If the input high is + nonzero, it's treated as digit a_size of a. */ + +static limb_t +limbs_div1(limb_t *res, const limb_t *a, Py_ssize_t a_size, + limb_t high, limb_t x) +{ + Py_ssize_t i; + for (i = a_size-1; i >= 0; i--) + res[i] = limb_div(&high, high, a[i], x); + return high; +} + +/* divide a by b, giving an (a_size-b_size+1)-limb quotient and b_size-limb + remainder. Assumes that the top limb of b is nonzero and that a_size >= + b_size. w provides a_size+b_size+1 limbs of workspace. The algorithm is + standard: see Knuth, TAOCP, Volume 4. */ + +static void +limbs_div(limb_t *quot, limb_t *rem, const limb_t *a, Py_ssize_t a_size, + const limb_t *b, Py_ssize_t b_size, limb_t *w) +{ + limb_t scale, top, a_top, b_top, q, dummy; + limb_t *aa, *bb; + bool carry; + Py_ssize_t j; + + /* top limb of b should be nonzero; a should contain at least as many + limbs as b */ + assert(a_size >= b_size && b_size > 0 && limb_bool(b[b_size-1])); + + /* compute scale factor for normalization: floor(LIMB_BASE / + (b_top+1)) */ + carry = limb_adc(&scale, b[b_size-1], LIMB_ONE, false); + if (carry) + scale = LIMB_ONE; + else + scale = limb_div(&dummy, LIMB_ONE, LIMB_ZERO, scale); + + /* scale a and b */ + top = limbs_mul1(w, b, b_size, scale); + bb = w; + assert(!limb_bool(top)); + + top = limbs_mul1(w+b_size, a, a_size, scale); + aa = w+b_size; + + /* catch most cases where quotient only needs a_size-b_size limbs */ + if (!limb_bool(top) && limb_lt(aa[a_size-1], bb[b_size-1])) + quot[a_size-b_size] = LIMB_ZERO; + else { + aa[a_size] = top; + a_size++; + } + + b_top = bb[b_size-1]; + aa += a_size-b_size; + for (j = a_size-b_size-1; j >= 0; j--) { + aa--; + a_top = aa[b_size]; + assert(limb_le(a_top, b_top)); + /* quotient q = aa / bb; may be overestimate */ + if (limb_lt(a_top, b_top)) + q = limb_div(&dummy, a_top, aa[b_size-1], b_top); + else + q = LIMB_MAX; + /* compute bottom b_size limbs of aa[j:] - q*bb */ + top = limbs_mul1(rem, bb, b_size, q); + carry = limbs_sub(aa, aa, rem, b_size); + carry = limb_adc(&top, top, LIMB_ZERO, carry); + assert(!carry); + assert(limb_le(a_top, top)); + /* correct if necessary */ + while (limb_lt(a_top, top)) { + carry = limbs_add(aa, aa, bb, b_size); + carry = limb_adc(&a_top, a_top, LIMB_ZERO, carry); + assert(!carry); + carry = limb_sbb(&q, q, LIMB_ONE, false); + assert(!carry); + } + quot[j] = q; + } + top = limbs_div1(rem, aa, b_size, LIMB_ZERO, scale); + assert(!limb_bool(top)); +} + +/* shift a_size-limb number left n digits (shifting zeros in); i.e., multiply + by 10**n. Fills the first a_size + ceiling(n/LIMB_DIGITS) limbs of res. */ + +static void +limbs_lshift(limb_t *res, const limb_t *a, Py_ssize_t a_size, Py_ssize_t n) +{ + Py_ssize_t n_limbs, n_digits, i; + limb_t high; + assert(n >= 0); + n_limbs = n / LIMB_DIGITS; + n_digits = n % LIMB_DIGITS; + for (i = 0; i < n_limbs; i++) + res[i] = LIMB_ZERO; + high = limbs_mul1(res+n_limbs, a, a_size, powers_of_ten[n_digits]); + assert(limb_lt(high, powers_of_ten[n_digits])); + if (n_digits != 0) + res[n_limbs + a_size] = high; +} + +/* shift a_size-limb number a right n *digits* (not limbs!). i.e., divide by + 10**n. n should satisfy 0 <= n <= LIMB_DIGITS*a_size, and the result res + has a_size - n/LIMB_DIGITS limbs. */ + +static void +limbs_rshift(limb_t *res, const limb_t *a, Py_ssize_t a_size, Py_ssize_t n) +{ + Py_ssize_t n_limbs, n_digits; + assert(0 <= n && n <= a_size*LIMB_DIGITS); + n_limbs = n / LIMB_DIGITS; + n_digits = n % LIMB_DIGITS; + limbs_div1(res, a+n_limbs, a_size-n_limbs, LIMB_ZERO, + powers_of_ten[n_digits]); +} + +/* get slice a[m:n] of (the decimal digits of) an integer a, from digit m up + to (but not including) digit n, giving a result res with + ceiling((n-m)/LIMB_DIGITS) limbs. Assumes that 0 <= m < n and that a has + at least 1+(n-1)/LIMB_DIGITS limbs. */ + +static void +limbs_slice(limb_t *res, const limb_t *a, Py_ssize_t m, Py_ssize_t n) +{ + Py_ssize_t mlimbs, mdigits, reslimbs, resdigits, diff; + limb_t high; + mlimbs = m / LIMB_DIGITS; + mdigits = m % LIMB_DIGITS; + reslimbs = (n-1-m) / LIMB_DIGITS; + resdigits = (n-1-m) % LIMB_DIGITS; + diff = (mdigits + resdigits - LIMB_DIGITS); + if (diff < 0) { + limbs_div1(res, a + mlimbs, reslimbs + 1, + LIMB_ZERO, powers_of_ten[mdigits]); + res[reslimbs] = limb_mask(res[reslimbs], resdigits+1); + } + else { + high = limb_mask(a[mlimbs + reslimbs + 1], diff+1); + limbs_div1(res, a + mlimbs, reslimbs + 1, + high, powers_of_ten[mdigits]); + } +} + +/* get a particular digit from an array of limbs. assumes that 0 <= n < + a_size * LIMB_DIGITS */ + +static limb_t +limbs_getdigit(limb_t *a, Py_ssize_t n) +{ + return limb_getdigit(a[n/LIMB_DIGITS], n%LIMB_DIGITS); +} + +/* Conversion to and from strings */ + +/* Fill a character array from an array of limbs */ + +static void +limbs_as_unicode(Py_UNICODE *s, Py_ssize_t s_len, const limb_t *a) +{ + Py_UNICODE *s_store; + limb_t limb; + Py_ssize_t nlimbs, ndigits, i, j; + if (s_len == 0) + return; + + /* s_len == nlimbs*LIMB_DIGITS + ndigits, 0 < ndigits <= LIMB_DIGITS */ + nlimbs = (s_len-1)/LIMB_DIGITS; + ndigits = (s_len-1)%LIMB_DIGITS + 1; + + /* fill in digits from right to left */ + s_store = s; + s += s_len; + for (j=0; j < nlimbs; j++) { + limb = a[j]; + for (i=0; i < LIMB_DIGITS; i++) + *--s = limb_to_wdigit(limb_rshift(&limb, limb, 1, LIMB_ZERO)); + } + /* most significant limb */ + limb = a[nlimbs]; + for (i=0; i < ndigits; i++) + *--s = limb_to_wdigit(limb_rshift(&limb, limb, 1, LIMB_ZERO)); + + assert(s == s_store); +} + + +/* Convert a character array to an array of limbs. Returns false on success, + true if any of the characters was not a valid digit; in the latter case, + the contents of a are undefined. a should provide ceiling(slen / + LIMB_DIGITS) limbs. */ + +static bool +limbs_from_unicode(limb_t *a, const Py_UNICODE *s, Py_ssize_t s_len) +{ + Py_ssize_t i, k, digits_in_limb; + limb_t acc; + Py_UNICODE c; + + k = (s_len+LIMB_DIGITS-1) / LIMB_DIGITS; + digits_in_limb = (s_len+LIMB_DIGITS-1) % LIMB_DIGITS + 1; + acc = LIMB_ZERO; + for (i = 0; i < s_len; i++) { + c = s[i]; + if (c < '0' || c > '9') + return true; + limb_lshift(&acc, acc, 1, wdigit_to_limb(c)); + digits_in_limb--; + if (digits_in_limb == 0) { + digits_in_limb = LIMB_DIGITS; + a[--k] = acc; + acc = LIMB_ZERO; + } + } + assert(digits_in_limb == LIMB_DIGITS); + return false; +} + +/* + variant of limbs_from_string that accepts a string where all but one of the + characters is a decimal digit, and ignores the specified character. + (Typically, the character to be ignored is a decimal point.) + + On entry, s is a pointer to a character array of length s_len + 1, 0 <= + int_len <= s_len, s[0] through s[int_len-1] and s[int_len+1] through + s[s_len] contain decimal digits. The result is then identical to + limbs_from_string applied to the concatenation of s[:int_len] and + s[int_len+1:]. No checking is performed, and there is no return value. + + This function is used when parsing _Decimal instances. + */ + +static void +limbs_from_pointed_unicode(limb_t *a, const Py_UNICODE *s, Py_ssize_t s_len, + Py_ssize_t int_len) +{ + Py_ssize_t i, k, digits_in_limb; + limb_t acc; + Py_UNICODE c; + +#define GET_DIGIT(i) ((i) < int_len ? s[(i)] : s[(i)+1]) + + k = (s_len+LIMB_DIGITS-1) / LIMB_DIGITS; + digits_in_limb = (s_len+LIMB_DIGITS-1) % LIMB_DIGITS + 1; + acc = LIMB_ZERO; + for (i = 0; i < s_len; i++) { + c = GET_DIGIT(i); + limb_lshift(&acc, acc, 1, wdigit_to_limb(c)); + digits_in_limb--; + if (digits_in_limb == 0) { + digits_in_limb = LIMB_DIGITS; + a[--k] = acc; + acc = LIMB_ZERO; + } + } + assert(digits_in_limb == LIMB_DIGITS); +} + +/* Base conversion, from base 2**15 to base LIMB_BASE. + + Convert an array of (base 2**15) digits for a Python long to an + array of limbs representing the same number. Returns the number of + limbs of a filled. The result is normalized, in the sense that if + the returned size a_size is nonzero then a[a_size-1] is nonzero. + + a should have at least: + + ceiling(b_size * log(2**15)/log(LIMB_BASE)) + + limbs available. +*/ + +static Py_ssize_t +limbs_from_longdigits(limb_t *a, const digit *b, Py_ssize_t b_size) +{ + Py_ssize_t i, j, a_size; + digit high; + a_size = 0; + for (j = b_size-1; j >= 0; j--) { + high = b[j]; + for (i=0; i < a_size; i++) + a[i] = limb_digit_swap(&high, a[i], high); + while (high != 0) + a[a_size++] = limb_digit_swap(&high, LIMB_ZERO, high); + } + return a_size; +} + +/* base conversion, from base LIMB_BASE to base 2**30. */ + +static Py_ssize_t +limbs_to_longdigits(digit *b, const limb_t *a, Py_ssize_t a_size) +{ + Py_ssize_t i, j, b_size; + limb_t high; + b_size = 0; + for (i = a_size-1; i >= 0; i--) { + high = a[i]; + for (j = 0; j < b_size; j++) + b[j] = digit_limb_swap(&high, b[j], high); + while (limb_bool(high)) + b[b_size++] = digit_limb_swap(&high, 0, high); + } + return b_size; +} + +/* print a limb array; debugging aid */ + +static void +limbs_printf(const char *name, const limb_t *a, Py_ssize_t a_size) +{ + Py_ssize_t i; + printf("%s = [", name); + + for (i=0; i z2 + (2) b0 - b1 -> z3 + (3) a0 * b0 -> z0 z1 + (4) b1 -> a0 + (5) z2 * z3 -> b0 b1 + (6) a0 * a1 -> z2 z3 + (7) +*/ + + +/* Unbalanced karatsuba multiplication: multiply a and b, putting result (of + size a_size + b_size) in res. w provides workspace. + + Preconditions: 1 <= k < a_size <= b_size <= 2*k, and k is a + power of 2. + + Algorithm + --------- + Write m for a_size, n for b_size, B for LIMB_BASE. Then we're assuming + that + + k < m <= 2*k, k < n <= 2*k + + and so in particular, 0 < m-k <= k, 0 < n-k <= k. + + Let a0, a1 = a[:k], a[k:] + Let b0, b1 = b[:n-k], b[n-k:] + Then a = a0 + a1*B**k, b = b0 + b1*B**(n-k) + + Let c = a0 - a1, d = b1 - b0*B**(2k-n) + Then + + ab = a0*b0 + (c*d + a1*b1 + a0*b0*B**(2k-n))*B**(n-k) + a1*b1*B**n. + + +---+---+---+ + + a0 |a1 + + +---+---+---+ + 0 m-k k m + + +-----+-+-----+ + | b0 | b1 | + +-----+-+-----+ + 0 n-k k n + + Sizes: + a0 k + a1 m-k + b0 n-k + b1 k + c k + d k + a0*b0 n + a1*b1 m + c*d 2*k +*/ + + +/* notes: + + (1) there's no real need to pass w_size around, but it helps guard + against errors + (2) slice notation in the comments below is as in Python: + res[2n:4n] means the number represented by res[2*n] through + res[4*n-1], inclusive. +*/ + +/* decide how to handle a particular size of multiplication, and + dispatch to the appropriate function to do the computation */ + +/* strategy: wlog suppose 1 <= m <= n. + + (1) if m == 1, do a basecase multiplication. + + Otherwise, let k be the largest power of 2 strictly less than m + (so k < m <= 2*k). Then: + + (2) If n <= 2*k, do a Karatsuba multiplication. Else + + (3) Otherwise, split n as n[:2k] and n[2k:], and do an m*(2k) Karatsuba + multiplication and a m * (n-2k) multiplication (via a recursive call to + limbs_mul_dispatch). Add the results. + + Question: how much workspace do we need for this? + + Write W(m, n) for the amount of workspace needed; assume 1 <= m <= n. + + Case 0: W(1, n). No workspace required. + + Case 1: W(k, k), k a power of 2: + W(k, k) = 2k+max(1, W(k/2, k/2)); W(1, 1) = 0. So W(k, k) = 2k-1. + + Case 2: W(m, n), k < m <= n <= 2k, k a power of 2: + W(m, n) = 4k-2, assuming that W(m, k) <= 2k-2 for all m < k... + + Case 3: W(m, k), m <= k, k a power of 2: + Case 3a: if k/2 < m <= k then by Case 2, W(m, k) = 2k-2. + Case 3b: if k/4 < m <= k/2 we'll end up doing 2 m-by-k/2 Karatsubas, + needing a total of k-2 (workspace for Karatsubas) + plus (m+k/2) for storage of result of 2nd Karatsuba + giving 3k/2 -2 + m <= 2k-2. + ... and so on. In all cases, 2k-2 should be sufficient. + + Case 4: W(m, n), k < m <= 2k < n, k a power of 2. Then + we do a number of m-by-2k multiplications; for the second + and subsequent of these, we need to store the result in + the workspace as well, so workspace required is at most + W(m, 2k) + m + 2k = 6k-2 + m <= 8k-2. + + Conclusion: let k < m <= 2k, l < n <= 2l, k and l powers of 2. + Then for l == k, 4k-2 limbs are enough + for l >= 2k, 8k-2 limbs are enough + In all cases, 4l-2 limbs are enough. +*/ + +#define KARATSUBA_CUTOFF 72 + +/* limbs_kmul and limbs_mul_dispatch call each other recursively, + so we need a forward declaration */ + +static void +limbs_mul_dispatch(limb_t *res, const limb_t *a, Py_ssize_t a_size, + const limb_t *b, Py_ssize_t b_size, + limb_t *w, Py_ssize_t w_size); + +/* Karatsuba multiplication. On input, k is an integer satisfying k < a_size + <= 2*k and k < b_size <= 2*k. w provides workspace of size w_size. The + amount of workspace required is 2k + max(1, W), where W is the workspace + required by the recursive calls.*/ + +static void +limbs_kmul(limb_t *res, const limb_t *a, Py_ssize_t a_size, + const limb_t *b, Py_ssize_t b_size, Py_ssize_t k, + limb_t *w, Py_ssize_t w_size) +{ + bool carry, sign; + + /* check preconditions */ + assert(k < a_size && a_size <= 2*k && k < b_size && b_size <= 2*k); + + /* abs(a0 - a1) */ + limbs_copy(res, a+k, a_size-k); + limbs_zero(res+a_size-k, 2*k-a_size); + sign = limbs_diff(res, a, res, k); + + /* abs(b1 - b0*B**(2k-n)) */ + limbs_zero(res+k, 2*k-b_size); + limbs_copy(res+k+(2*k-b_size), b, b_size-k); + sign ^= limbs_diff(res+k, b+b_size-k, res+k, k); + + /* need 2k+1 limbs to store central product */ + assert(w_size >= 2*k+1); + limbs_mul_dispatch(w, res, k, res+k, k, w+2*k, w_size-2*k); + /* products a0*b0 and a1*b1 are placed directly into res */ + limbs_mul_dispatch(res, b, b_size-k, a, k, w+2*k, w_size-2*k); + limbs_mul_dispatch(res+b_size, a+k, a_size-k, b+b_size-k, k, + w+2*k, w_size-2*k); + if (sign) { + carry = limbs_sub(w, res+b_size, w, a_size); + carry = limbs_cmpl(w+a_size, w+a_size, 2*k-a_size, carry); + } + else { + carry = limbs_add(w, res+b_size, w, a_size); + carry = limbs_incc(w+a_size, w+a_size, 2*k-a_size, carry); + } + carry ^= limbs_add(w+2*k-b_size, w+2*k-b_size, res, b_size); + w[2*k] = carry ? LIMB_ONE : LIMB_ZERO; + /* add central term in */ + carry = limbs_add(res+b_size-k, res+b_size-k, w, 2*k+1); + carry = limbs_incc(res+b_size+k+1, res+b_size+k+1, a_size-k-1, carry); + assert(!carry); +} + +/* decide how to handle a particular size of multiplication, and + dispatch to the appropriate function to do the computation. + Assumes that 1 <= a_size <= b_size on input. */ + +static void +limbs_mul_dispatch(limb_t *res, const limb_t *a, Py_ssize_t a_size, + const limb_t *b, Py_ssize_t b_size, + limb_t *w, Py_ssize_t w_size) +{ + Py_ssize_t k; + bool carry; + assert(1 <= a_size && a_size <= b_size); + + if (a_size <= KARATSUBA_CUTOFF) { + /* basecase multiplication */ + limbs_fastmultiply(res, a, a_size, b, b_size); + return; + } + + /* find k, the smallest number of the form 2**i * KARATSUBA_CUTOFF + such that a_size <= k. */ + k = KARATSUBA_CUTOFF; + while (k < a_size) + k *= 2; + assert(k/2 < a_size && a_size <= k); + /* if sizes are balanced, do a single Karatsuba multiplication */ + if (b_size <= k) { + limbs_kmul(res, a, a_size, b, b_size, k/2, w, w_size); + return; + } + /* otherwise, while b_size > k, split off a k-by-a_size chunk and + compute using Karatsuba. The result from the first chunk goes + straight into res; results from subsequent chunks go into the + workspace and are then added into res */ + limbs_kmul(res, a, a_size, b, k, k/2, w, w_size); + b += k; b_size -= k; res += k; + while (b_size > k) { + assert(w_size >= a_size+k); + limbs_kmul(w, a, a_size, b, k, k/2, + w+a_size+k, w_size-a_size-k); + carry = limbs_add(res, res, w, a_size); + carry = limbs_incc(res+a_size, w+a_size, k, carry); + assert(!carry); + b += k; b_size -= k; res += k; + } + /* last chunk */ + assert(w_size >= a_size+b_size); + if (b_size > k/2) + limbs_kmul(w, a, a_size, b, b_size, k/2, + w+a_size+b_size, w_size-a_size-b_size); + else + limbs_mul_dispatch(w, b, b_size, a, a_size, + w+a_size+b_size, w_size-a_size-b_size); + carry = limbs_add(res, res, w, a_size); + carry = limbs_incc(res+a_size, w+a_size, b_size, carry); + assert(!carry); +} + +/************************** + * deccoeff : definitions * + **************************/ + +#define MODULE_NAME "deccoeff" +#define CLASS_NAME "Deccoeff" + +/* We place an upper bound MAX_DIGITS on the number of decimal digits (*not* + the number of limbs) in a deccoeff. MAX_DIGITS should fit into a + Py_ssize_t, so that length and indexing always make sense. Here we take + MAX_DIGITS = 10**9; then assuming that a Py_ssize_t is at least 32 bits + we're safe from overflow even when adding two digit counts. */ + +#define MAX_DIGITS 1000000000 + +/* We really want ob_limbs[0] in the definition of deccoeff, but that's not + standards-compliant C. Use offsetof to get tp_basicsize. */ + +typedef struct { + PyObject_VAR_HEAD + limb_t ob_limbs[1]; +} deccoeff; + +#define DECCOEFF_ITEMSIZE sizeof(limb_t) +#define DECCOEFF_BASICSIZE (offsetof(deccoeff, ob_limbs)) + +static PyTypeObject deccoeff_DeccoeffType; + +/* allocate a new decimal integer with 'size' limbs */ + +static deccoeff * +_deccoeff_new(Py_ssize_t size) +{ + /* XXX check for overflow */ + return PyObject_NEW_VAR(deccoeff, &deccoeff_DeccoeffType, size); +} + +/* normalize a deccoeff, by setting the size correctly. */ + +static deccoeff * +deccoeff_normalize(deccoeff *v) +{ + Py_ssize_t v_size; + v_size = Py_SIZE(v); + while (v_size > 0 && !limb_bool(v->ob_limbs[v_size-1])) + --v_size; + Py_SIZE(v) = v_size; + return v; +} + +/* returns its argument (with reference count unaffected) if the argument has + MAX_DIGITS or fewer digits. Otherwise it decrements the reference count + for its argument, sets OverflowError, and returns NULL. */ + +static deccoeff * +deccoeff_checksize(deccoeff *v) +{ + Py_ssize_t v_size, topdigits; + bool small; + v_size = Py_SIZE(v); + + /* something with MAX_DIGITS digits has exactly + (MAX_DIGITS-1)/LIMB_DIGITS+1 limbs; its top limb has + (MAX_DIGITS-1)%LIMB_DIGITS+1 digits */ + if (v_size < (MAX_DIGITS-1)/LIMB_DIGITS+1) + small = true; + else if (v_size == (MAX_DIGITS-1)/LIMB_DIGITS+1) { + topdigits = limb_len(v->ob_limbs[v_size-1]); + small = topdigits <= (MAX_DIGITS-1)%LIMB_DIGITS+1; + } + else + small = false; + + if (small) + return v; + Py_DECREF(v); + PyErr_SetString(PyExc_OverflowError, + CLASS_NAME " instance has too many digits"); + return NULL; +} + +static deccoeff * +_deccoeff_copy(deccoeff *a) +{ + Py_ssize_t a_size, i; + deccoeff *z; + + a_size = Py_SIZE(a); + z = _deccoeff_new(a_size); + if (z != NULL) + for (i=0; i < a_size; i++) + z->ob_limbs[i] = a->ob_limbs[i]; + return z; +} + +/* return zero */ + +static deccoeff * +deccoeff_zero(void) +{ + return _deccoeff_new(0); +} + +/* return one */ + +static deccoeff * +deccoeff_one(void) +{ + deccoeff *z; + z = _deccoeff_new(1); + if (z != NULL) + z->ob_limbs[0] = LIMB_ONE; + return z; +} + +static deccoeff * +_deccoeff_from_unicode_and_size(const Py_UNICODE *s, Py_ssize_t s_len) { + Py_ssize_t z_size; + deccoeff *z; + bool invalid; + + if (s_len > MAX_DIGITS) { + PyErr_SetString(PyExc_OverflowError, + "too many digits"); + return NULL; + } + + z_size = (s_len + LIMB_DIGITS - 1) / LIMB_DIGITS; + z = _deccoeff_new(z_size); + if (z == NULL) + return NULL; + + invalid = limbs_from_unicode(z->ob_limbs, s, s_len); + if (invalid) { + Py_DECREF(z); + PyErr_SetString(PyExc_ValueError, + "nondigit character in input"); + return NULL; + } + return deccoeff_normalize(z); +} + +static deccoeff * +_deccoeff_from_pointed_unicode_and_size(const Py_UNICODE *s, Py_ssize_t s_len, + Py_ssize_t int_len) { + Py_ssize_t z_size; + deccoeff *z; + + if (s_len > MAX_DIGITS) { + PyErr_SetString(PyExc_OverflowError, + "too many digits"); + return NULL; + } + + z_size = (s_len + LIMB_DIGITS - 1) / LIMB_DIGITS; + z = _deccoeff_new(z_size); + if (z == NULL) + return NULL; + + limbs_from_pointed_unicode(z->ob_limbs, s, s_len, int_len); + return deccoeff_normalize(z); +} + + + +/*************************** + * Arithmetic on deccoeffs * + ***************************/ + +/* General rules: if the result of any arithmetic operation falls + outside the range [0, 10**MAX_DIGITS) then OverflowError is raised. + Results are always normalized. */ + +/* determine whether another Python object is compatible with deccoeff, in the + sense that it can be used in mixed-type arithmetic with deccoeff */ + +static bool +compatible_with_deccoeff(PyObject *v) +{ + return (v->ob_type == &deccoeff_DeccoeffType || PyIndex_Check(v)); +} + +/* convert an arbitrary PyObject to a deccoeff. If conversion is implemented + for this type, return false and put the result of the attempted conversion + (which may be NULL on failure) in *z. Otherwise, return true. */ + +static deccoeff *deccoeff_from_PyLong(PyLongObject *a); + +static deccoeff * +convert_to_deccoeff(PyObject *v) +{ + PyLongObject *w; + deccoeff *z; + + if (v->ob_type == &deccoeff_DeccoeffType) { + Py_INCREF(v); + return (deccoeff *)v; + } + else if (PyIndex_Check(v)) { + w = (PyLongObject *)PyNumber_Index(v); + if (w == NULL) + return NULL; + z = deccoeff_from_PyLong(w); + Py_DECREF(w); + return z; + } + else { + PyErr_SetString(PyExc_TypeError, + "invalid type in deccoeff coercion"); + return NULL; + } +} + +#define DECCOEFF_WRAP_BINOP(PO_func, DC_func) \ + static PyObject * \ + PO_func(PyObject *v, PyObject *w) \ + { \ + deccoeff *a, *b; \ + PyObject *z = NULL; \ + if (!compatible_with_deccoeff(v)) { \ + Py_INCREF(Py_NotImplemented); \ + z = Py_NotImplemented; \ + } \ + 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 = (PyObject *)(DC_func(a, b)); \ + Py_DECREF(b); \ + } \ + Py_DECREF(a); \ + } \ + return z; \ + } + +/* addition */ + +static deccoeff * +_deccoeff_add(deccoeff *a, deccoeff *b) +{ + Py_ssize_t a_size, b_size; + deccoeff *z; + bool carry; + a_size = Py_SIZE(a); + b_size = Py_SIZE(b); + if (a_size < b_size) { + deccoeff *temp; + Py_ssize_t temp_size; + temp = a; a = b; b = temp; + temp_size = a_size; a_size = b_size; b_size = temp_size; + } + z = _deccoeff_new(a_size+1); + if (z == NULL) + return z; + carry = limbs_add(z->ob_limbs, a->ob_limbs, b->ob_limbs, b_size); + carry = limbs_incc(z->ob_limbs+b_size, a->ob_limbs+b_size, + a_size-b_size, carry); + z->ob_limbs[a_size] = carry ? LIMB_ONE : LIMB_ZERO; + return deccoeff_checksize(deccoeff_normalize(z)); +} + +/* subtraction */ + +static deccoeff * +_deccoeff_subtract(deccoeff *a, deccoeff *b) +{ + Py_ssize_t a_size, b_size; + deccoeff *z; + bool carry; + a_size = Py_SIZE(a); + b_size = Py_SIZE(b); + if (a_size < b_size) + goto Overflow; + z = _deccoeff_new(a_size); + if (z==NULL) + return NULL; + carry = limbs_sub(z->ob_limbs, a->ob_limbs, b->ob_limbs, b_size); + carry = limbs_decc(z->ob_limbs+b_size, a->ob_limbs+b_size, + a_size-b_size, carry); + if (!carry) + return deccoeff_normalize(z); + Py_DECREF(z); + Overflow: + PyErr_SetString(PyExc_OverflowError, "difference is negative"); + return NULL; +} + +/* multiplication */ + +static deccoeff * +_deccoeff_multiply(deccoeff *a, deccoeff *b) +{ + Py_ssize_t a_size, b_size, w_size; + deccoeff *z, *w; + + a_size = Py_SIZE(a); + b_size = Py_SIZE(b); + if (a_size == 0 || b_size == 0) + return deccoeff_zero(); + + z = _deccoeff_new(a_size + b_size); + if (z == NULL) + return NULL; + + /* try out Karatsuba multiplication */ + + /* swap so that a_size <= b_size */ + if (a_size > b_size) { + Py_ssize_t temp_size; + deccoeff *temp; + temp = a; a = b; b = temp; + temp_size = a_size; a_size = b_size; b_size = temp_size; + } + + /* figure out how much workspace we need */ + /* find next power of 2 after a_size */ + w_size = 1; + while (w_size < b_size) + w_size *= 2; + + w_size = 2*w_size - 1; + w = _deccoeff_new(w_size); + if (w == NULL) { + Py_DECREF(z); + return NULL; + } + limbs_mul_dispatch(z->ob_limbs, + a->ob_limbs, a_size, + b->ob_limbs, b_size, + w->ob_limbs, w_size); + + Py_DECREF(w); + return deccoeff_checksize(deccoeff_normalize(z)); +} + +/* division of a by b: returns quotient and puts remainder in *r. On + failure, both the quotient and the remainder are NULL. Raises + ZeroDivisionError on division by zero. */ + +static deccoeff * +_deccoeff_division(deccoeff **r, deccoeff *a, deccoeff *b) { + deccoeff *w, *rem, *quot; + Py_ssize_t a_size, b_size; + a_size = Py_SIZE(a); + b_size = Py_SIZE(b); + /* special cases b == 0, a_size < b_size */ + if (b_size == 0) { + PyErr_SetString(PyExc_ZeroDivisionError, + "division by zero"); + *r = NULL; + return NULL; + } + if (a_size < b_size) { + Py_INCREF(a); + *r = a; + return deccoeff_zero(); + } + quot = _deccoeff_new(a_size + 1 - b_size); + if (quot == NULL) { + *r = NULL; + return NULL; + } + rem = _deccoeff_new(b_size); + if (rem == NULL) { + Py_DECREF(quot); + *r = NULL; + return NULL; + } + if (b_size == 1) + /* fast path for division by a single limb */ + rem->ob_limbs[0] = limbs_div1(quot->ob_limbs, a->ob_limbs, + a_size, LIMB_ZERO, b->ob_limbs[0]); + else { + /* long division */ + w = _deccoeff_new(a_size + 1 + b_size); + if (w == NULL) { + Py_DECREF(rem); + Py_DECREF(quot); + *r = NULL; + return NULL; + } + limbs_div(quot->ob_limbs, rem->ob_limbs, a->ob_limbs, a_size, + b->ob_limbs, b_size, w->ob_limbs); + Py_DECREF(w); + } + *r = deccoeff_normalize(rem); + return deccoeff_normalize(quot); +} + +/* remainder: raises ZeroDivisionError if b is zero */ + +static deccoeff * +_deccoeff_remainder(deccoeff *a, deccoeff *b) { + deccoeff *quot, *rem; + quot = _deccoeff_division(&rem, a, b); + if (rem == NULL) + return NULL; + Py_DECREF(quot); + return rem; +} + +/* a*b % c; assumes that a < c and b < c. */ + +static deccoeff * +_deccoeff_multiply_and_reduce(deccoeff *a, deccoeff *b, deccoeff *c) +{ + Py_ssize_t a_size, b_size; + deccoeff *z, *w; + + a_size = Py_SIZE(a); + b_size = Py_SIZE(b); + z = _deccoeff_new(a_size + b_size); + if (z == NULL) + return NULL; + limbs_fastmultiply(z->ob_limbs, a->ob_limbs, a_size, b->ob_limbs, b_size); + /* w = z % c */ + w = _deccoeff_remainder(z, c); + Py_DECREF(z); + return w; +} + +/* divmod: raises ZeroDivisionError if b is zero */ + +static PyObject * +_deccoeff_divmod(deccoeff *a, deccoeff *b) { + deccoeff *quot, *rem; + + quot = _deccoeff_division(&rem, a, b); + if (quot == NULL) + return NULL; + return Py_BuildValue("OO", (PyObject *)quot, (PyObject *)rem); +} + + +/* this version of power is naive and slow */ + +static deccoeff * +_deccoeff_power(deccoeff *a, deccoeff *bb, deccoeff *c) +{ + deccoeff *acc=NULL, *temp, *apow, *b; + limb_t lowbit, *b_limbs; + Py_ssize_t b_size; + /* make a copy b of bb, which we'll modify in-place */ + b = _deccoeff_copy(bb); + if (b == NULL) + goto fail0; + b_size = Py_SIZE(b); + b_limbs = b->ob_limbs; + /* apow keeps a power of a; starts as a (or a % c) */ + if (c == NULL) { + apow = a; + Py_INCREF(apow); + } + else + apow = _deccoeff_remainder(a, c); + if (apow == NULL) + goto fail1; + /* result accumulates in acc, which starts out as 1 (or 0 if c == 1) */ + acc = deccoeff_one(); + if (acc != NULL && c != NULL) { + /* acc %= c */ + temp = _deccoeff_remainder(acc, c); + Py_DECREF(acc); + acc = temp; + } + if (acc == NULL || b_size == 0) + goto fail2; + while (true) { + /* invariant quantity: apow**b*acc == a**bb. */ + lowbit = limbs_div1(b_limbs, b_limbs, b_size, LIMB_ZERO, 2); + if (!limb_bool(b_limbs[b_size-1])) + b_size--; + if (limb_bool(lowbit)) { + /* acc *= apow */ + if (c == NULL) + temp = _deccoeff_multiply(apow, acc); + else + temp = _deccoeff_multiply_and_reduce(apow, + acc, c); + Py_DECREF(acc); + acc = temp; + } + if (acc == NULL || b_size == 0) + break; + + /* apow *= apow */ + if (c == NULL) + temp = _deccoeff_multiply(apow, apow); + else + temp = _deccoeff_multiply_and_reduce(apow, apow, c); + Py_DECREF(apow); + apow = temp; + if (apow == NULL) { + Py_DECREF(acc); + acc = NULL; + goto fail1; + } + } + fail2: + Py_DECREF(apow); + fail1: + Py_DECREF(b); + fail0: + return acc; +} + +/* wrap _deccoeff_power */ + +static PyObject * +deccoeff_power(PyObject *v, PyObject *w, PyObject *x) +{ + deccoeff *a, *b, *c; + PyObject *z; + if (!compatible_with_deccoeff(v)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + a = convert_to_deccoeff(v); + if (a == NULL) + return NULL; + + if (!compatible_with_deccoeff(w)) { + Py_DECREF(a); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + b = convert_to_deccoeff(w); + if (b == NULL) { + Py_DECREF(a); + return NULL; + } + + if (x == Py_None) + c = NULL; + else if (compatible_with_deccoeff(x)) { + c = convert_to_deccoeff(x); + if (c == NULL) { + Py_DECREF(b); + Py_DECREF(a); + return NULL; + } + } + else { + Py_DECREF(b); + Py_DECREF(a); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + + z = (PyObject *)_deccoeff_power(a, b, c); + + Py_XDECREF(c); + Py_DECREF(b); + Py_DECREF(a); + return z; +} + + +/* negation: succeeds only for a == 0; for anything else, OverflowError is + raised */ + +static deccoeff * +deccoeff_negative(deccoeff *a) +{ + Py_ssize_t a_size; + + a_size = Py_SIZE(a); + if (a_size == 0) + return deccoeff_zero(); + PyErr_SetString(PyExc_OverflowError, "negation is negative"); + return NULL; +} + +/* unary plus: does nothing */ + +static deccoeff * +deccoeff_positive(deccoeff *a) +{ + Py_INCREF(a); + return a; +} + +/* bool: return True if a is nonzero, else False */ + +static int +deccoeff_bool(deccoeff *a) +{ + return Py_SIZE(a) != 0; +} + +/* left shift; second operand is a Python integer, not a + deccoeff. raises ValueError if second operand is negative */ + +/* how should this behave with respect to other types? + i.e., should 2 << DI('3') be an error? + For now, yes: can't see much value in 2 << DI('3'). + + So: first argument should be a Deccoeff. Second argument + may be a decoeff, may be something else that can be interpreted as + an index. +*/ + +static PyObject * +deccoeff_lshift(PyObject *v, PyObject *b) { + Py_ssize_t n, a_size; + deccoeff *z, *a; + + /* shifting another type by a deccoeff is not supported */ + if (v->ob_type != &deccoeff_DeccoeffType || !PyIndex_Check(b)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + a = (deccoeff *)v; + + /* attempt to interpret b as a nonnegative index */ + n = PyNumber_AsSsize_t(b, NULL); + if (n == -1 && PyErr_Occurred()) + return NULL; + else if (n < 0) { + PyErr_SetString(PyExc_ValueError, "negative shift count"); + return NULL; + } + + a_size = Py_SIZE(a); + if (a_size == 0) + return (PyObject *)deccoeff_zero(); + if (n >= MAX_DIGITS) { + PyErr_SetString(PyExc_OverflowError, + CLASS_NAME " instance has too many digits"); + return NULL; + } + z = _deccoeff_new(a_size + (n+LIMB_DIGITS-1) / LIMB_DIGITS); + if (z==NULL) + return NULL; + limbs_lshift(z->ob_limbs, a->ob_limbs, a_size, n); + return (PyObject *)deccoeff_checksize(deccoeff_normalize(z)); +} + +/* right shift; second operand is a Python integer, not a deccoeff. + Raises ValueError if second operand is negative. */ + +static PyObject * +deccoeff_rshift(PyObject *v, PyObject *b) { + Py_ssize_t n, a_size, shift; + deccoeff *z, *a; + + /* shifting another type by a deccoeff is not supported */ + if (v->ob_type != &deccoeff_DeccoeffType || !PyIndex_Check(b)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + a = (deccoeff *)v; + + /* attempt to interpret b as a nonnegative index */ + n = PyNumber_AsSsize_t(b, NULL); + if (n == -1 && PyErr_Occurred()) + return NULL; + else if (n < 0) { + PyErr_SetString(PyExc_ValueError, "negative shift count"); + return NULL; + } + + a_size = Py_SIZE(a); + shift = n / LIMB_DIGITS; + if (shift >= a_size) + return (PyObject *)deccoeff_zero(); + z = _deccoeff_new(a_size - shift); + if (z==NULL) + return NULL; + limbs_rshift(z->ob_limbs, a->ob_limbs, a_size, n); + return (PyObject *)deccoeff_normalize(z); +} + +/* slice: the slice indices should be nonnegative integers; the step + argument is not supported and is expected to be None. */ + +static deccoeff * +deccoeff_subscript(deccoeff *a, PyObject *b) +{ + PySliceObject *slice; + Py_ssize_t a_size, start, stop, defstop; + deccoeff *z; + + a_size = Py_SIZE(a); + defstop = a_size * LIMB_DIGITS; + if (PySlice_Check(b)) { + /* for a slice, extract start, stop and step. We'd like to + use PySlice_GetIndicesEx here, but we can't supply a sensible + length. So we imitate it instead, which is a little bit + naughty since it involves using the private function + _PyEval_SliceIndex. */ + slice = (PySliceObject *)b; + if (slice->step != Py_None) { + PyErr_SetString(PyExc_ValueError, + "step unsupported in deccoeff slice"); + return NULL; + } + if (slice->start == Py_None) + start = 0; + else { + if (!_PyEval_SliceIndex(slice->start, &start)) + return NULL; + if (start < 0) { + PyErr_SetString(PyExc_ValueError, + "start should be nonnegative"); + return NULL; + } + } + defstop = a_size * LIMB_DIGITS; + if (slice->stop == Py_None) + stop = defstop; + else { + if (!_PyEval_SliceIndex(slice->stop, &stop)) + return NULL; + if (stop < 0) { + PyErr_SetString(PyExc_ValueError, + "stop should be nonnegative"); + return NULL; + } + } + /* reduce to case 0 <= start < stop <= a_size * LIMB_DIGITS */ + if (stop > defstop) + stop = defstop; + if (stop <= start) + return deccoeff_zero(); + + /* allocate space for result */ + z = _deccoeff_new((stop-start-1)/LIMB_DIGITS + 1); + if (z==NULL) + return NULL; + limbs_slice(z->ob_limbs, a->ob_limbs, start, stop); + return deccoeff_normalize(z); + + } + else { + start = PyNumber_AsSsize_t(b, NULL); + if (start == -1 && PyErr_Occurred()) + return NULL; + else if (start < 0) { + PyErr_SetString(PyExc_ValueError, + "index should be nonnegative"); + return NULL; + } + if (start >= defstop) + return deccoeff_zero(); + + z = _deccoeff_new(1); + if (z == NULL) + return NULL; + z->ob_limbs[0] = limbs_getdigit(a->ob_limbs, start); + return deccoeff_normalize(z); + } +} + +/* floor division: raise ZeroDivisionError if b is 0 */ + +static deccoeff * +_deccoeff_floor_divide(deccoeff *a, deccoeff *b) { + deccoeff *quot, *rem; + quot = _deccoeff_division(&rem, a, b); + if (quot == NULL) + return NULL; + Py_DECREF(rem); + return quot; +} + +/* compare: return -1 if a < b, 0 if a == b, 1 if a > b. Always + succeeds. */ + +static int +_deccoeff_compare(deccoeff *a, deccoeff *b) +{ + int c; + Py_ssize_t a_size, b_size, i; + a_size = Py_SIZE(a); + b_size = Py_SIZE(b); + if (a_size != b_size) + return a_size < b_size ? -1 : 1; + for (i = a_size-1; i >= 0; i--) { + c = limb_cmp(a->ob_limbs[i], b->ob_limbs[i]); + if (c != 0) + return c; + } + return 0; +} + +/* Python 3.x only understands rich comparisons; deccoeff_richcompare wraps + _deccoeff_compare. */ + +static PyObject * +deccoeff_richcompare(PyObject *v, PyObject *w, int op) +{ + deccoeff *a, *b; + PyObject *z = NULL; + if (!compatible_with_deccoeff(v)) { + Py_INCREF(Py_NotImplemented); + z = Py_NotImplemented; + } + 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); + } + Py_DECREF(a); + } + return z; +} + +/* Compute ceiling(n*p/q) without intermediate overflow. If the result + would be larger than PY_SSIZE_T_MAX, return -1. Assumes that + n is nonnegative, and that (q-1)*(p+1) <= PY_SSIZE_T_MAX. */ + +static Py_ssize_t +scale_Py_ssize_t(Py_ssize_t n, int p, int q) { + Py_ssize_t hi, low; + assert (n >= 0); + hi = n/q; + if (hi > PY_SSIZE_T_MAX/p) + return -1; + hi *= p; + low = (n%q*p+q-1)/q; + if (hi > PY_SSIZE_T_MAX-low) + return -1; + return hi+low; +} + +/* Create a deccoeff from a Python integer. */ + +static deccoeff * +deccoeff_from_PyLong(PyLongObject *a) +{ + Py_ssize_t a_size, z_size; + deccoeff *z; + + a_size = Py_SIZE(a); + if (a_size < 0) { + PyErr_SetString(PyExc_OverflowError, + "Can't convert negative integer to " CLASS_NAME); + return NULL; + } + z_size = scale_Py_ssize_t(a_size, + LOG2_10LQ * PyLong_SHIFT, + LOG2_10LP * LIMB_DIGITS); + if (z_size == -1) + PyErr_SetString(PyExc_OverflowError, + "Overflow in int to " CLASS_NAME " conversion\n"); + z = _deccoeff_new(z_size); + if (z==NULL) + return NULL; + Py_SIZE(z) = limbs_from_longdigits(z->ob_limbs, a->ob_digit, a_size); + return deccoeff_checksize(z); +} + +static PyLongObject * +deccoeff_long(deccoeff *a) +{ + Py_ssize_t a_size, z_size; + PyLongObject *z; + + a_size = Py_SIZE(a); + z_size = scale_Py_ssize_t(a_size, + LOG2_10UP * LIMB_DIGITS, + LOG2_10UQ * PyLong_SHIFT); + if (z_size == -1) + PyErr_SetString(PyExc_OverflowError, + "Overflow in " CLASS_NAME " to int conversion\n"); + z = _PyLong_New(z_size); + if (z == NULL) + return NULL; + Py_SIZE(z) = limbs_to_longdigits(z->ob_digit, a->ob_limbs, a_size); + return z; +} + +static PyObject * +deccoeff_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyObject *x, *n, *result; + static char *kwlist[] = {"x", 0}; + + /* not allowing subtypes */ + assert(type == &deccoeff_DeccoeffType); + x = NULL; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:" CLASS_NAME, + kwlist, &x)) + return NULL; + + if (x == NULL) + return (PyObject *)deccoeff_zero(); + else if (PyUnicode_Check(x)) { + Py_UNICODE *s; + Py_ssize_t s_len; + s = PyUnicode_AS_UNICODE(x); + s_len = PyUnicode_GET_SIZE(x); + return (PyObject *)_deccoeff_from_unicode_and_size(s, s_len); + } + else if (PyIndex_Check(x)) { + n = PyNumber_Index(x); + if (n == NULL) + return NULL; + result = (PyObject *)deccoeff_from_PyLong((PyLongObject *)n); + Py_DECREF(n); + return result; + } + else if (PyObject_TypeCheck(x, &deccoeff_DeccoeffType)) { + /* we're not allowing subtypes, so it should + be safe just to return x itself here. */ + Py_INCREF(x); + return x; + } + else { + PyErr_SetString(PyExc_TypeError, + "unable to create a deccoeff from this type"); + return NULL; + } +} + + +/* number of digits of a deccoeff, or 0 if that deccoeff is zero. */ + +static Py_ssize_t +_deccoeff_length(deccoeff *v) +{ + Py_ssize_t v_size; + v_size = Py_SIZE(v); + if (v_size == 0) + return 0; + return limb_len(v->ob_limbs[v_size-1]) + (v_size-1) * LIMB_DIGITS; +} + +static PyObject * +deccoeff_digit_length(deccoeff *v) +{ + return PyLong_FromSsize_t(_deccoeff_length(v)); +} + +static void +deccoeff_dealloc(PyObject *v) +{ + Py_TYPE(v)->tp_free(v); +} + +#if SIZEOF_LONG == 4 +#define HASH_BITS 32 +#define HASH_SHIFT 13 +#define HASH_MASK ((1UL<ob_limbs; + v_top = v_start + Py_SIZE(v); + x = HASH_START; + while (v_top > v_start) { + x = ((x & ~HASH_MASK) >> HASH_SHIFT) | + ((x & HASH_MASK) << (HASH_BITS-HASH_SHIFT)); + x ^= (unsigned long)limb_hash(*--v_top); + } + + y = (long)x; + return (y == -1) ? -2 : y; +} + +DECCOEFF_WRAP_BINOP(deccoeff_add, _deccoeff_add) +DECCOEFF_WRAP_BINOP(deccoeff_subtract, _deccoeff_subtract) +DECCOEFF_WRAP_BINOP(deccoeff_multiply, _deccoeff_multiply) +DECCOEFF_WRAP_BINOP(deccoeff_remainder, _deccoeff_remainder) +DECCOEFF_WRAP_BINOP(deccoeff_divmod, _deccoeff_divmod) +DECCOEFF_WRAP_BINOP(deccoeff_floor_divide, _deccoeff_floor_divide) + +static PyMethodDef deccoeff_methods[] = { + {"digit_length", (PyCFunction)deccoeff_digit_length, METH_NOARGS, + "Number of digits."}, + {NULL, NULL} +}; + +static PyMappingMethods deccoeff_as_mapping = { + 0, /*mp_length*/ + (binaryfunc)deccoeff_subscript, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyNumberMethods deccoeff_as_number = { + deccoeff_add, /*nb_add*/ + deccoeff_subtract, /*nb_subtract*/ + deccoeff_multiply, /*nb_multiply*/ + deccoeff_remainder, /*nb_remainder*/ + deccoeff_divmod, /*nb_divmod*/ + deccoeff_power, /*nb_power*/ + (unaryfunc) deccoeff_negative, /*nb_negative*/ + (unaryfunc) deccoeff_positive, /*nb_positive*/ + (unaryfunc) deccoeff_positive, /*nb_absolute*/ + (inquiry) deccoeff_bool, /*nb_bool*/ + 0, /*nb_invert*/ + deccoeff_lshift, /*nb_lshift*/ + deccoeff_rshift, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + (unaryfunc) deccoeff_long, /*nb_int*/ + (unaryfunc) deccoeff_long, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + deccoeff_floor_divide, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + (unaryfunc) deccoeff_long, /*nb_index*/ +}; + +static PyObject * +deccoeff_str(deccoeff *v) +{ + Py_ssize_t sz, nlimbs; + limb_t *limb_pointer, *last_limb, limb_value; + PyObject *str; + int i; + Py_UNICODE *p; + + nlimbs = Py_SIZE(v); + if (nlimbs == 0) { + /* return empty string */ + str = PyUnicode_FromUnicode(NULL, 1); + if (str == NULL) + return NULL; + p = PyUnicode_AS_UNICODE(str) + 1; + *p = '\0'; + *--p = '0'; + return str; + } + + sz = _deccoeff_length(v); + + str = PyUnicode_FromUnicode(NULL, sz); + if (str == NULL) + return NULL; + p = PyUnicode_AS_UNICODE(str) + sz; + *p = '\0'; + + /* fill in digits from right to left; start with the least + significant limb_t */ + limb_pointer = v -> ob_limbs; + last_limb = limb_pointer + nlimbs - 1; + while (limb_pointer < last_limb) { + limb_value = *limb_pointer++; + for (i=0; i < LIMB_DIGITS; i++) + *--p = limb_to_wdigit( + limb_rshift(&limb_value, + limb_value, 1, LIMB_ZERO)); + } + /* most significant limb_t */ + limb_value = *limb_pointer; + assert(limb_bool(limb_value)); + while (limb_bool(limb_value)) + *--p = limb_to_wdigit( + limb_rshift(&limb_value, limb_value, 1, LIMB_ZERO)); + return str; +} + +static PyObject * +deccoeff_repr(deccoeff *v) +{ + PyObject *strv; + PyObject *result; + strv = deccoeff_str(v); + if (strv == NULL) + return NULL; + result = PyUnicode_FromFormat(CLASS_NAME "('%U')", strv); + Py_DECREF(strv); + return result; +} + +static PyTypeObject deccoeff_DeccoeffType = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + MODULE_NAME "." CLASS_NAME, /* tp_name */ + DECCOEFF_BASICSIZE, /* tp_basicsize */ + DECCOEFF_ITEMSIZE, /* tp_itemsize */ + deccoeff_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + (reprfunc)deccoeff_repr, /* tp_repr */ + &deccoeff_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + &deccoeff_as_mapping, /* tp_as_mapping */ + (hashfunc)deccoeff_hash, /* tp_hash */ + 0, /* tp_call */ + (reprfunc)deccoeff_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "Decimal integers", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)deccoeff_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + deccoeff_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 */ + deccoeff_new, /* tp_new */ + PyObject_Del, /* tp_free */ +}; + + +/***************** + * _Decimal type * + *****************/ + +/* class name */ +#define DECIMAL_NAME "_Decimal" + +/* A finite decimal object needs a sign, a coefficient and an exponent. An + infinity has a sign and nothing more; the coefficient and exponent are + ignored. A (quiet or signalling) nan has a sign, and may carry additional + information in the coefficient. The exponent is not used. */ + +#define DEC_FLAGS_NEG (1<<0) +#define DEC_FLAGS_NONZERO (1<<1) /* currently unused, but may want this later */ +#define DEC_FLAGS_SPECIAL (1<<2) +#define DEC_FLAGS_INF (1<<3) +#define DEC_FLAGS_NAN (1<<4) +#define DEC_FLAGS_SNAN (1<<5) +#define DEC_FLAGS_QNAN (1<<6) + +#define FINITE_FLAGS 0 +#define INF_FLAGS (DEC_FLAGS_SPECIAL | DEC_FLAGS_INF) +#define QNAN_FLAGS (DEC_FLAGS_SPECIAL | DEC_FLAGS_NAN | DEC_FLAGS_QNAN) +#define SNAN_FLAGS (DEC_FLAGS_SPECIAL | DEC_FLAGS_NAN | DEC_FLAGS_SNAN) + +/* note that FINITE_FLAGS < INF_FLAGS < SNAN_FLAGS < QNAN_FLAGS, + corresponding to the standard total ordering of Decimals */ + +typedef int dec_flag_t; +typedef Py_ssize_t exp_t; + +typedef struct { + PyObject_HEAD + deccoeff *dec_coeff; /* coefficient, or NaN payload; NULL for infinity */ + PyLongObject *dec_exp; /* exponent: NULL for an infinity or NaN */ + dec_flag_t dec_flags; /* flags describing sign and number class */ +} _Decimal; + +static PyTypeObject deccoeff__DecimalType; + +/* create new _Decimal (or instance of a subclass of _Decimal); no + validation or conversion---just allocate memory and fill the slots */ + +static _Decimal * +__Decimal_new(PyTypeObject *type, dec_flag_t flags, deccoeff *coeff, + PyLongObject *exp) +{ + _Decimal *self; + + /* sanity checks */ + assert( + ((flags | 1) == (FINITE_FLAGS | 1)) || /* finite (poss. zero) */ + ((flags | 1) == (INF_FLAGS | 1)) || /* infinity */ + ((flags | 1) == (QNAN_FLAGS | 1)) || /* quiet nan */ + ((flags | 1) == (SNAN_FLAGS | 1))); /* signaling nan */ + + /* incref coefficient and exponent, but only if they're non-NULL */ + if (flags & DEC_FLAGS_INF) + assert(coeff == NULL); + else { + assert(coeff != NULL); + Py_INCREF(coeff); + } + if (flags & DEC_FLAGS_SPECIAL) + assert(exp == NULL); + else { + assert(exp != NULL); + Py_INCREF(exp); + } + + self = (_Decimal *)type->tp_alloc(type, 0); + if (self == NULL) + return NULL; + self->dec_flags = flags; + self->dec_coeff = coeff; + self->dec_exp = exp; + return self; +} + +/* deallocate _Decimal instance */ + +static void +_Decimal_dealloc(PyObject *self) +{ + _Decimal *dec; + dec = (_Decimal *)self; + /* coefficient should be present iff decimal instance is not infinite */ + if (dec->dec_flags & DEC_FLAGS_INF) + assert(dec->dec_coeff == NULL); + else { + assert(dec->dec_coeff != NULL); + Py_DECREF(dec->dec_coeff); + } + /* exponent is present only for finite numbers */ + if (dec->dec_flags & DEC_FLAGS_SPECIAL) + assert(dec->dec_exp == NULL); + else { + assert(dec->dec_exp != NULL); + Py_DECREF(dec->dec_exp); + } + self->ob_type->tp_free(self); +} + +/* Macros to create finite, infinite, qnan, and snan _Decimal instances */ + +#define FINITE_DECIMAL(type, sign, coeff, exp) (__Decimal_new(type, sign, coeff, exp)) +#define INF_DECIMAL(type, sign) (__Decimal_new(type, sign | INF_FLAGS, NULL, NULL)) +#define QNAN_DECIMAL(type, sign, payload) (__Decimal_new(type, sign | QNAN_FLAGS, payload, NULL)) +#define SNAN_DECIMAL(type, sign, payload) (__Decimal_new(type, sign | SNAN_FLAGS, payload, NULL)) + +/* create a new finite _Decimal instance */ + +static PyObject * +_Decimal_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + /* create a new finite _Decimal instance, given a sequence consisting + of its sign (an integer), coefficient and exponent */ + + PyObject *ocoeff, *oexp; + deccoeff *coeff; + PyLongObject *exp; + int sign; + static char *kwlist[] = {"sign", "coeff", "exp", 0}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "iOO:" DECIMAL_NAME, kwlist, + &sign, &ocoeff, &oexp)) + return NULL; + if (!(sign == 0 || sign == 1)) { + PyErr_SetString(PyExc_ValueError, "sign should be 0 or 1"); + return NULL; + } + if (ocoeff->ob_type != &deccoeff_DeccoeffType) { + PyErr_SetString(PyExc_TypeError, "coeff should have type " CLASS_NAME); + return NULL; + } + coeff = (deccoeff *)ocoeff; + if (oexp->ob_type != &PyLong_Type) { + PyErr_SetString(PyExc_TypeError, "exp should have type int"); + return NULL; + } + exp = (PyLongObject *)oexp; + return (PyObject *)FINITE_DECIMAL(type, sign, coeff, exp); +} + +/* Create a _Decimal instance directly from a string; classmethod */ + +static PyObject * +_Decimal_from_str(PyTypeObject *cls, PyObject *arg) +{ + PyObject *result=NULL; + deccoeff *coeff; + Py_ssize_t ndigits; + Py_UNICODE *coeff_start, *coeff_end, *s_end, *int_end, *exp_start, *s; + int sign = 0, exp_sign = 0; + PyObject *exp, *temp, *frac_digits; + deccoeff *duexp; + + if (!PyUnicode_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "Expected str instance"); + return NULL; + } + s = PyUnicode_AS_UNICODE(arg); + s_end = s + PyUnicode_GET_SIZE(arg); + + /* Stage 1: parse and validate the string, identifying the points + where the coefficients and exponent start and stop */ + + /* optional sign */ + if (*s == '+') + s++; + else if (*s == '-') { + s++; + sign = 1; + } + + switch(*s) { + case 'n': + case 'N': + /* nan */ + s++; + if (*s == 'a' || *s == 'A') + s++; + else + goto parse_error; + if (*s == 'n' || *s == 'N') + s++; + else + goto parse_error; + coeff_start = s; + while ('0' <= *s && *s <= '9') + s++; + if (s != s_end) + goto parse_error; + + coeff = _deccoeff_from_unicode_and_size(coeff_start, s-coeff_start); + if (coeff != NULL) { + result = (PyObject *)QNAN_DECIMAL(cls, sign, coeff); + Py_DECREF(coeff); + } + break; + case 's': + case 'S': + /* snan */ + s++; + if (*s == 'n' || *s == 'N') + s++; + else + goto parse_error; + if (*s == 'a' || *s == 'A') + s++; + else + goto parse_error; + if (*s == 'n' || *s == 'N') + s++; + else + goto parse_error; + coeff_start = s; + while ('0' <= *s && *s <= '9') + s++; + if (s != s_end) + goto parse_error; + + coeff = _deccoeff_from_unicode_and_size(coeff_start, s-coeff_start); + if (coeff != NULL) { + result = (PyObject *)SNAN_DECIMAL(cls, sign, coeff); + Py_DECREF(coeff); + } + break; + case 'i': + case 'I': + /* inf[inity] */ + s++; + if (*s == 'n' || *s == 'N') + s++; + else + goto parse_error; + if (*s == 'f' || *s == 'F') + s++; + else + goto parse_error; + if (*s == 'i' || *s == 'I') { + s++; + if (*s == 'n' || *s == 'N') + s++; + else + goto parse_error; + if (*s == 'i' || *s == 'I') + s++; + else + goto parse_error; + if (*s == 't' || *s == 'T') + s++; + else + goto parse_error; + if (*s == 'y' || *s == 'Y') + s++; + else + goto parse_error; + } + /* end of string */ + if (s != s_end) + goto parse_error; + + result = (PyObject *)INF_DECIMAL(cls, sign); + break; + default: + /* numeric part: at least one digit, with an optional decimal point */ + coeff_start = s; + while ('0' <= *s && *s <= '9') + s++; + int_end = s; + if (*s == '.') { + s++; + while ('0' <= *s && *s <= '9') + s++; + coeff_end = s-1; + } + else + coeff_end= s; + + ndigits = coeff_end - coeff_start; + if (ndigits == 0) + goto parse_error; + + /* [e ] */ + if (*s == 'e' || *s == 'E') { + s++; + if (*s == '+') + s++; + else if (*s == '-') { + s++; + exp_sign = 1; + } + exp_start = s; + if (!('0' <= *s && *s <= '9')) + goto parse_error; + s++; + while ('0' <= *s && *s <= '9') + s++; + } + else + exp_start = s; + + /* end of string */ + if (s != s_end) + goto parse_error; + + /* parse exponent (without sign), returning a deccoeff */ + duexp = _deccoeff_from_unicode_and_size(exp_start, s-exp_start); + if (duexp == NULL) + return NULL; + + /* REF: duexp */ + + /* Later we'll allow negative deccoeffs, and have the exponent + be a deccoeff. Later :) + For now we have to convert this to a Python long */ + exp = (PyObject *)deccoeff_long(duexp); + Py_DECREF(duexp); + if (exp == NULL) + return NULL; + + /* REF: exp */ + + /* adjust exponent: include sign, and adjust by length + of fractional part of input */ + if (exp_sign == 1) { + /* negate exp */ + temp = PyNumber_Negative(exp); + Py_DECREF(exp); + exp = temp; + if (exp == NULL) + return NULL; + } + + /* REF: exp */ + + /* subtract frac_digits */ + frac_digits = PyLong_FromSize_t(coeff_end - int_end); + if (frac_digits == NULL) { + Py_DECREF(exp); + return NULL; + } + + /* REF: exp, frac_digits */ + + temp = PyNumber_Subtract(exp, frac_digits); + Py_DECREF(frac_digits); + Py_DECREF(exp); + exp = temp; + if (exp == NULL) + return NULL; + + /* REF: exp */ + + /* get coefficient */ + coeff = _deccoeff_from_pointed_unicode_and_size(coeff_start, + coeff_end - coeff_start, int_end - coeff_start); + + if (coeff == NULL) { + Py_DECREF(exp); + return NULL; + } + + result = (PyObject *)FINITE_DECIMAL(cls, sign, coeff, + (PyLongObject *)exp); + Py_DECREF(coeff); + Py_DECREF(exp); + } + return result; + + parse_error: + PyErr_SetString(PyExc_ValueError, + "invalid numeric string"); + return NULL; + +} + +/* Create a new finite _Decimal instance; classmethod */ + +static PyObject * +_Decimal_finite(PyTypeObject *cls, PyObject *args) +{ + PyObject *ocoeff, *oexp; + deccoeff *coeff; + PyLongObject *exp; + int sign; + + if (!PyArg_ParseTuple(args, "iOO:" DECIMAL_NAME, &sign, &ocoeff, &oexp)) + return NULL; + if (ocoeff->ob_type != &deccoeff_DeccoeffType) { + PyErr_SetString(PyExc_TypeError, "coeff should have type " CLASS_NAME); + return NULL; + } + coeff = (deccoeff *)ocoeff; + if (oexp->ob_type != &PyLong_Type) { + PyErr_SetString(PyExc_TypeError, "exp should have type int"); + return NULL; + } + exp = (PyLongObject *)oexp; + if (!(sign == 0 || sign == 1)) { + PyErr_SetString(PyExc_ValueError, "sign should be 0 or 1"); + return NULL; + } + return (PyObject *)FINITE_DECIMAL(cls, sign, coeff, exp); +} + +/* Create a qNaN; classmethod */ + +static PyObject * +_Decimal_qNaN(PyTypeObject *cls, PyObject *args) { + PyObject *opayload; + deccoeff *payload; + int sign; + + if (!PyArg_ParseTuple(args, "iO:" DECIMAL_NAME, &sign, &opayload)) + return NULL; + if (opayload->ob_type != &deccoeff_DeccoeffType) { + PyErr_SetString(PyExc_TypeError, "payload should have type " CLASS_NAME); + return NULL; + } + payload = (deccoeff *)opayload; + if (!(sign == 0 || sign == 1)) { + PyErr_SetString(PyExc_ValueError, "sign should be 0 or 1"); + return NULL; + } + return (PyObject *)QNAN_DECIMAL(cls, sign, payload); +} + +/* Create an sNaN; classmethod */ + +static PyObject * +_Decimal_sNaN(PyTypeObject *cls, PyObject *args) { + PyObject *opayload; + deccoeff *payload; + int sign; + + if (!PyArg_ParseTuple(args, "iO:" DECIMAL_NAME, &sign, &opayload)) + return NULL; + if (opayload->ob_type != &deccoeff_DeccoeffType) { + PyErr_SetString(PyExc_TypeError, "payload should have type " CLASS_NAME); + return NULL; + } + payload = (deccoeff *)opayload; + if (!(sign == 0 || sign == 1)) { + PyErr_SetString(PyExc_ValueError, "sign should be 0 or 1"); + return NULL; + } + return (PyObject *)SNAN_DECIMAL(cls, sign, payload); +} + +/* Create an infinity; classmethod */ + +static PyObject * +_Decimal_inf(PyTypeObject *cls, PyObject *args) { + int sign; + + if (!PyArg_ParseTuple(args, "i:" DECIMAL_NAME, &sign)) + return NULL; + if (!(sign == 0 || sign == 1)) { + PyErr_SetString(PyExc_ValueError, "sign should be 0 or 1"); + return NULL; + } + return (PyObject *)INF_DECIMAL(cls, sign); +} + +/* Return the sign of any _Decimal instance */ + +static PyObject * +_Decimal_getsign(_Decimal *self, void *closure) +{ + long sign; + sign = (long)(self->dec_flags) & DEC_FLAGS_NEG; + return PyLong_FromLong(sign); +} + +/* Return the coefficient of a finite _Decimal */ + +static PyObject * +_Decimal_getcoeff(_Decimal *self, void *closure) +{ + if (self->dec_flags & DEC_FLAGS_SPECIAL) { + PyErr_SetString(PyExc_ValueError, + "infinity or NaN has no coefficient"); + return NULL; + } + Py_INCREF(self->dec_coeff); + return (PyObject *)self->dec_coeff; +} + +/* Return the payload of a NaN */ + +static PyObject * +_Decimal_getpayload(_Decimal *self, void *closure) +{ + if (self->dec_flags & DEC_FLAGS_NAN) { + Py_INCREF(self->dec_coeff); + return (PyObject *)self->dec_coeff; + } + else { + PyErr_SetString(PyExc_ValueError, + "argument is not a NaN"); + return NULL; + } +} + +/* Return the exponent of a finite _Decimal instance */ + +static PyObject * +_Decimal_getexp(_Decimal *self, void *closure) +{ + if (self->dec_flags & DEC_FLAGS_SPECIAL) { + PyErr_SetString(PyExc_ValueError, + "infinity or NaN has no exponent"); + return NULL; + } + Py_INCREF(self->dec_exp); + return (PyObject *)(self->dec_exp); +} + +/* Return True if the given Decimal is special (an infinity or NaN), + False otherwise. */ + +static PyObject * +_Decimal_getspecial(_Decimal *self, void *closure) +{ + if (self->dec_flags & DEC_FLAGS_SPECIAL) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + + +static PyObject * +_Decimal_is_finite(_Decimal *self) +{ + if (self->dec_flags & DEC_FLAGS_SPECIAL) + Py_RETURN_FALSE; + else + Py_RETURN_TRUE; +} + +static PyObject * +_Decimal_is_infinite(_Decimal *self) +{ + if (self->dec_flags & DEC_FLAGS_INF) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject * +_Decimal_is_nan(_Decimal *self) +{ + if (self->dec_flags & DEC_FLAGS_NAN) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject * +_Decimal_is_qnan(_Decimal *self) +{ + if (self->dec_flags & DEC_FLAGS_QNAN) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject * +_Decimal_is_snan(_Decimal *self) +{ + if (self->dec_flags & DEC_FLAGS_SNAN) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject * +_Decimal_is_signed(_Decimal *self) +{ + if (self->dec_flags & DEC_FLAGS_NEG) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject * +_Decimal_is_zero(_Decimal *self) +{ + if ((self->dec_flags & DEC_FLAGS_SPECIAL) || + deccoeff_bool(self->dec_coeff)) + Py_RETURN_FALSE; + else + Py_RETURN_TRUE; +} + +static _Decimal * +_Decimal_copy(_Decimal *self) +{ + return __Decimal_new(&deccoeff__DecimalType, self->dec_flags, + self->dec_coeff, self->dec_exp); +} + +static _Decimal * +_Decimal_copy_negate(_Decimal *self) +{ + return __Decimal_new(&deccoeff__DecimalType, self->dec_flags ^ 1, + self->dec_coeff, self->dec_exp); +} + +static _Decimal * +_Decimal_copy_abs(_Decimal *self) +{ + return __Decimal_new(&deccoeff__DecimalType, self->dec_flags & (~1), + self->dec_coeff, self->dec_exp); +} + +static PyMethodDef _Decimal_methods[] = { + {"_finite", (PyCFunction)_Decimal_finite, METH_VARARGS|METH_CLASS, " "}, + {"_qnan", (PyCFunction)_Decimal_qNaN, METH_VARARGS|METH_CLASS, " "}, + {"_snan", (PyCFunction)_Decimal_sNaN, METH_VARARGS|METH_CLASS, " "}, + {"_inf", (PyCFunction)_Decimal_inf, METH_VARARGS|METH_CLASS, " "}, + {"from_str", (PyCFunction)_Decimal_from_str, METH_O|METH_CLASS, " "}, + {"is_finite", (PyCFunction)_Decimal_is_finite, METH_NOARGS, " "}, + {"is_infinite", (PyCFunction)_Decimal_is_infinite, METH_NOARGS, " "}, + {"is_nan", (PyCFunction)_Decimal_is_nan, METH_NOARGS, " "}, + {"is_qnan", (PyCFunction)_Decimal_is_qnan, METH_NOARGS, " "}, + {"is_snan", (PyCFunction)_Decimal_is_snan, METH_NOARGS, " "}, + {"is_signed", (PyCFunction)_Decimal_is_signed, METH_NOARGS, " "}, + {"is_zero", (PyCFunction)_Decimal_is_zero, METH_NOARGS, " "}, + {"copy", (PyCFunction)_Decimal_copy, METH_NOARGS, " "}, + {"copy_negate", (PyCFunction)_Decimal_copy_negate, METH_NOARGS, " "}, + {"copy_abs", (PyCFunction)_Decimal_copy_abs, METH_NOARGS, " "}, + {NULL, NULL} +}; + +static PyGetSetDef _Decimal_getsetters[] = { + {"_sign", (getter)_Decimal_getsign, NULL, "sign", NULL}, + {"_int", (getter)_Decimal_getcoeff, NULL, + "coefficient (invalid for NaNs and infinites)", NULL}, + {"_exp", (getter)_Decimal_getexp, NULL, + "exponent (invalid for NaNs and infinities)", NULL}, + {"_payload", (getter)_Decimal_getpayload, NULL, + "payload of a NaN (invalid for non-NaNs)", NULL}, + {"_is_special", (getter)_Decimal_getspecial, NULL, + "True for infinities and NaNs, false otherwise", NULL}, + {NULL} +}; + +static PyTypeObject deccoeff__DecimalType = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + MODULE_NAME "." DECIMAL_NAME, /* tp_name */ + sizeof(_Decimal), /* tp_basicsize */ + 0, /* tp_itemsize */ + _Decimal_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 | Py_TPFLAGS_BASETYPE, /* tp_flags */ + "support for Decimal type", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + _Decimal_methods, /* tp_methods */ + 0, /* tp_members */ + _Decimal_getsetters, /* 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 */ + _Decimal_new, /* tp_new */ + PyObject_Del, /* tp_free */ +}; + +static PyMethodDef deccoeff_module_methods[] = { + {NULL, NULL} +}; + +static struct PyModuleDef deccoeff_module = { + PyModuleDef_HEAD_INIT, + "deccoeff", + "class for decimal integer arithmetic; support for decimal module", + -1, + deccoeff_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC +PyInit_deccoeff(void) +{ + PyObject *m; + int check, i; + limb_t power_of_ten; + + /* initialize powers_of_ten array */ + power_of_ten = 1; + for (i = 0; i < LIMB_DIGITS; i++) { + powers_of_ten[i] = power_of_ten; + power_of_ten *= 10; + } + + if (PyType_Ready(&deccoeff_DeccoeffType) < 0) + return NULL; + + if (PyType_Ready(&deccoeff__DecimalType) < 0) + return NULL; + + m = PyModule_Create(&deccoeff_module); + if (m == NULL) + return NULL; + + Py_INCREF(&deccoeff_DeccoeffType); + check = PyModule_AddObject(m, CLASS_NAME, + (PyObject *) &deccoeff_DeccoeffType); + if (check == -1) + return NULL; + + Py_INCREF(&deccoeff__DecimalType); + check = PyModule_AddObject(m, DECIMAL_NAME, + (PyObject *) &deccoeff__DecimalType); + if (check == -1) + return NULL; + check = PyModule_AddIntMacro(m, LIMB_DIGITS); + if (check == -1) + return NULL; + check = PyModule_AddIntMacro(m, MAX_DIGITS); + if (check == -1) + return NULL; + return m; +} Added: sandbox/trunk/decimal/decimal_in_c/deccoeff_config.h.in ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/deccoeff_config.h.in Sat Jan 10 18:22:25 2009 @@ -0,0 +1,73 @@ +/* deccoeff_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if the system has the type `__uint128_t'. */ +#undef HAVE___UINT128_T + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef was allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef was allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t Added: sandbox/trunk/decimal/decimal_in_c/decimal.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimal.py Sat Jan 10 18:22:25 2009 @@ -0,0 +1,5574 @@ +# Copyright (c) 2004 Python Software Foundation. +# All rights reserved. + +# Written by Eric Price +# and Facundo Batista +# and Raymond Hettinger +# 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 +# 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 +the General Decimal Arithmetic Specification: + + www2.hursley.ibm.com/decimal/decarith.html + +and IEEE standard 854-1987: + + www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html + +Decimal floating point has finite precision with arbitrarily large bounds. + +The purpose of this module is to support arithmetic using familiar +"schoolhouse" rules and to avoid some of the tricky representation +issues associated with binary floating point. The package is especially +useful for financial applications or for contexts where users have +expectations that are at odds with binary floating point (for instance, +in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead +of the expected Decimal('0.00') returned by decimal floating point). + +Here are some examples of using the decimal module: + +>>> from decimal import * +>>> setcontext(ExtendedContext) +>>> Decimal(0) +Decimal('0') +>>> Decimal('1') +Decimal('1') +>>> Decimal('-.0123') +Decimal('-0.0123') +>>> Decimal(123456) +Decimal('123456') +>>> Decimal('1.33') + Decimal('1.27') +Decimal('2.60') +>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41') +Decimal('-2.20') +>>> dig = Decimal(1) +>>> print(dig / Decimal(3)) +0.333333333 +>>> getcontext().prec = 18 +>>> print(dig / Decimal(3)) +0.333333333333333333 +>>> print(dig.sqrt()) +1 +>>> print(Decimal(3).sqrt()) +1.73205080756887729 +>>> print(Decimal(3) ** 123) +4.85192780976896427E+58 +>>> inf = Decimal(1) / Decimal(0) +>>> print(inf) +Infinity +>>> neginf = Decimal(-1) / Decimal(0) +>>> print(neginf) +-Infinity +>>> print(neginf + inf) +NaN +>>> print(neginf * inf) +-Infinity +>>> print(dig / 0) +Infinity +>>> getcontext().traps[DivisionByZero] = 1 +>>> print(dig / 0) +Traceback (most recent call last): + ... + ... + ... +decimal.DivisionByZero: x / 0 +>>> c = Context() +>>> c.traps[InvalidOperation] = 0 +>>> print(c.flags[InvalidOperation]) +0 +>>> c.divide(Decimal(0), Decimal(0)) +Decimal('NaN') +>>> c.traps[InvalidOperation] = 1 +>>> print(c.flags[InvalidOperation]) +1 +>>> c.flags[InvalidOperation] = 0 +>>> print(c.flags[InvalidOperation]) +0 +>>> print(c.divide(Decimal(0), Decimal(0))) +Traceback (most recent call last): + ... + ... + ... +decimal.InvalidOperation: 0 / 0 +>>> print(c.flags[InvalidOperation]) +1 +>>> c.flags[InvalidOperation] = 0 +>>> c.traps[InvalidOperation] = 0 +>>> print(c.divide(Decimal(0), Decimal(0))) +NaN +>>> print(c.flags[InvalidOperation]) +1 +>>> +""" + +__all__ = [ + # Two major classes + 'Decimal', 'Context', + + # Contexts + 'DefaultContext', 'BasicContext', 'ExtendedContext', + + # Exceptions + 'DecimalException', 'Clamped', 'InvalidOperation', 'DivisionByZero', + 'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow', + + # Constants for use in setting up contexts + 'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING', + 'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', 'ROUND_05UP', + + # Functions for manipulating contexts + 'setcontext', 'getcontext', 'localcontext' +] + +from deccoeff import Deccoeff, _Decimal + +import numbers as _numbers +import copy as _copy +import math as _math + +try: + from collections import namedtuple as _namedtuple + DecimalTuple = _namedtuple('DecimalTuple', 'sign digits exponent') +except ImportError: + DecimalTuple = lambda *args: args + +# Rounding +ROUND_DOWN = 'ROUND_DOWN' +ROUND_HALF_UP = 'ROUND_HALF_UP' +ROUND_HALF_EVEN = 'ROUND_HALF_EVEN' +ROUND_CEILING = 'ROUND_CEILING' +ROUND_FLOOR = 'ROUND_FLOOR' +ROUND_UP = 'ROUND_UP' +ROUND_HALF_DOWN = 'ROUND_HALF_DOWN' +ROUND_05UP = 'ROUND_05UP' + +# Errors + +class DecimalException(ArithmeticError): + """Base exception class. + + Used exceptions derive from this. + If an exception derives from another exception besides this (such as + Underflow (Inexact, Rounded, Subnormal) that indicates that it is only + called if the others are present. This isn't actually used for + anything, though. + + handle -- Called when context._raise_error is called and the + trap_enabler is set. First argument is self, second is the + context. More arguments can be given, those being after + the explanation in _raise_error (For example, + context._raise_error(NewError, '(-x)!', self._sign) would + call NewError().handle(context, self._sign).) + + To define a new exception, it should be sufficient to have it derive + from DecimalException. + """ + def handle(self, context, *args): + pass + + +class Clamped(DecimalException): + """Exponent of a 0 changed to fit bounds. + + This occurs and signals clamped if the exponent of a result has been + altered in order to fit the constraints of a specific concrete + representation. This may occur when the exponent of a zero result would + be outside the bounds of a representation, or when a large normal + number would have an encoded exponent that cannot be represented. In + this latter case, the exponent is reduced to fit and the corresponding + number of zero digits are appended to the coefficient ("fold-down"). + """ + +class InvalidOperation(DecimalException): + """An invalid operation was performed. + + Various bad things cause this: + + Something creates a signaling NaN + -INF + INF + 0 * (+-)INF + (+-)INF / (+-)INF + x % 0 + (+-)INF % x + x._rescale( non-integer ) + sqrt(-x) , x > 0 + 0 ** 0 + x ** (non-integer) + x ** (+-)INF + An operand is invalid + + The result of the operation after these is a quiet positive NaN, + except when the cause is a signaling NaN, in which case the result is + also a quiet NaN, but with the original sign, and an optional + diagnostic information. + """ + def handle(self, context, *args): + if args: + ans = Decimal._qnan(args[0]._sign, args[0]._payload) + return ans._fix_nan(context) + return NaN + +class ConversionSyntax(InvalidOperation): + """Trying to convert badly formed string. + + This occurs and signals invalid-operation if an string is being + converted to a number and it does not conform to the numeric string + syntax. The result is [0,qNaN]. + """ + def handle(self, context, *args): + return NaN + +class DivisionByZero(DecimalException, ZeroDivisionError): + """Division by 0. + + This occurs and signals division-by-zero if division of a finite number + by zero was attempted (during a divide-integer or divide operation, or a + power operation with negative right-hand operand), and the dividend was + not zero. + + The result of the operation is [sign,inf], where sign is the exclusive + or of the signs of the operands for divide, or is 1 for an odd power of + -0, for power. + """ + + def handle(self, context, sign, *args): + return Infsign[sign] + +class DivisionImpossible(InvalidOperation): + """Cannot perform the division adequately. + + This occurs and signals invalid-operation if the integer result of a + divide-integer or remainder operation had too many digits (would be + longer than precision). The result is [0,qNaN]. + """ + + def handle(self, context, *args): + return NaN + +class DivisionUndefined(InvalidOperation, ZeroDivisionError): + """Undefined result of division. + + This occurs and signals invalid-operation if division by zero was + attempted (during a divide-integer, divide, or remainder operation), and + the dividend is also zero. The result is [0,qNaN]. + """ + + def handle(self, context, *args): + return NaN + +class Inexact(DecimalException): + """Had to round, losing information. + + This occurs and signals inexact whenever the result of an operation is + not exact (that is, it needed to be rounded and any discarded digits + were non-zero), or if an overflow or underflow condition occurs. The + result in all cases is unchanged. + + The inexact signal may be tested (or trapped) to determine if a given + operation (or sequence of operations) was inexact. + """ + +class InvalidContext(InvalidOperation): + """Invalid context. Unknown rounding, for example. + + This occurs and signals invalid-operation if an invalid context was + detected during an operation. This can occur if contexts are not checked + on creation and either the precision exceeds the capability of the + underlying concrete representation or an unknown or unsupported rounding + was specified. These aspects of the context need only be checked when + the values are required to be used. The result is [0,qNaN]. + """ + + def handle(self, context, *args): + return NaN + +class Rounded(DecimalException): + """Number got rounded (not necessarily changed during rounding). + + This occurs and signals rounded whenever the result of an operation is + rounded (that is, some zero or non-zero digits were discarded from the + coefficient), or if an overflow or underflow condition occurs. The + result in all cases is unchanged. + + The rounded signal may be tested (or trapped) to determine if a given + operation (or sequence of operations) caused a loss of precision. + """ + +class Subnormal(DecimalException): + """Exponent < Emin before rounding. + + This occurs and signals subnormal whenever the result of a conversion or + operation is subnormal (that is, its adjusted exponent is less than + Emin, before any rounding). The result in all cases is unchanged. + + The subnormal signal may be tested (or trapped) to determine if a given + or operation (or sequence of operations) yielded a subnormal result. + """ + +class Overflow(Inexact, Rounded): + """Numerical overflow. + + This occurs and signals overflow if the adjusted exponent of a result + (from a conversion or from an operation that is not an attempt to divide + by zero), after rounding, would be greater than the largest value that + can be handled by the implementation (the value Emax). + + The result depends on the rounding mode: + + For round-half-up and round-half-even (and for round-half-down and + round-up, if implemented), the result of the operation is [sign,inf], + where sign is the sign of the intermediate result. For round-down, the + result is the largest finite number that can be represented in the + current precision, with the sign of the intermediate result. For + round-ceiling, the result is the same as for round-down if the sign of + the intermediate result is 1, or is [0,inf] otherwise. For round-floor, + the result is the same as for round-down if the sign of the intermediate + result is 0, or is [1,inf] otherwise. In all cases, Inexact and Rounded + will also be raised. + """ + + def handle(self, context, sign, *args): + if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, + ROUND_HALF_DOWN, ROUND_UP): + return Infsign[sign] + if sign == 0: + if context.rounding == ROUND_CEILING: + return Infsign[sign] + return context._max_normal(sign) + if sign == 1: + if context.rounding == ROUND_FLOOR: + return Infsign[sign] + return context._max_normal(sign) + + +class Underflow(Inexact, Rounded, Subnormal): + """Numerical underflow with result rounded to 0. + + This occurs and signals underflow if a result is inexact and the + adjusted exponent of the result would be smaller (more negative) than + the smallest value that can be handled by the implementation (the value + Emin). That is, the result is both inexact and subnormal. + + The result after an underflow will be a subnormal number rounded, if + necessary, so that its exponent is not less than Etiny. This may result + in 0 with the sign of the intermediate result and an exponent of Etiny. + + In all cases, Inexact, Rounded, and Subnormal will also be raised. + """ + +# List of public traps and flags +_signals = [Clamped, DivisionByZero, Inexact, Overflow, Rounded, + Underflow, InvalidOperation, Subnormal] + +# Map conditions (per the spec) to signals +_condition_map = {ConversionSyntax:InvalidOperation, + DivisionImpossible:InvalidOperation, + DivisionUndefined:InvalidOperation, + InvalidContext:InvalidOperation} + +##### Context Functions ################################################## + +# The getcontext() and setcontext() function manage access to a thread-local +# current context. Py2.4 offers direct support for thread locals. If that +# is not available, use threading.current_thread() which is slower but will +# work for older Pythons. If threads are not part of the build, create a +# mock threading object with threading.local() returning the module namespace. + +try: + import threading +except ImportError: + # Python was compiled without threads; create a mock object instead + import sys + class MockThreading(object): + def local(self, sys=sys): + return sys.modules[__name__] + threading = MockThreading() + del sys, MockThreading + +try: + threading.local + +except AttributeError: + + # To fix reloading, force it to create a new context + # Old contexts have different exceptions in their dicts, making problems. + if hasattr(threading.current_thread(), '__decimal_context__'): + del threading.current_thread().__decimal_context__ + + def setcontext(context): + """Set this thread's context to context.""" + if context in (DefaultContext, BasicContext, ExtendedContext): + context = context.copy() + context.clear_flags() + threading.current_thread().__decimal_context__ = context + + def getcontext(): + """Returns this thread's context. + + If this thread does not yet have a context, returns + a new context and sets this thread's context. + New contexts are copies of DefaultContext. + """ + try: + return threading.current_thread().__decimal_context__ + except AttributeError: + context = Context() + threading.current_thread().__decimal_context__ = context + return context + +else: + + local = threading.local() + if hasattr(local, '__decimal_context__'): + del local.__decimal_context__ + + def getcontext(_local=local): + """Returns this thread's context. + + If this thread does not yet have a context, returns + a new context and sets this thread's context. + New contexts are copies of DefaultContext. + """ + try: + return _local.__decimal_context__ + except AttributeError: + context = Context() + _local.__decimal_context__ = context + return context + + def setcontext(context, _local=local): + """Set this thread's context to context.""" + if context in (DefaultContext, BasicContext, ExtendedContext): + context = context.copy() + context.clear_flags() + _local.__decimal_context__ = context + + del threading, local # Don't contaminate the namespace + +def localcontext(ctx=None): + """Return a context manager for a copy of the supplied context + + Uses a copy of the current context if no context is specified + The returned context manager creates a local decimal context + in a with statement: + def sin(x): + with localcontext() as ctx: + ctx.prec += 2 + # Rest of sin calculation algorithm + # uses a precision 2 greater than normal + return +s # Convert result to normal precision + + def sin(x): + with localcontext(ExtendedContext): + # Rest of sin calculation algorithm + # uses the Extended Context from the + # General Decimal Arithmetic Specification + return +s # Convert result to normal context + + """ + # The string below can't be included in the docstring until Python 2.6 + # as the doctest module doesn't understand __future__ statements + """ + >>> from __future__ import with_statement + >>> print(getcontext().prec) + 28 + >>> with localcontext(): + ... ctx = getcontext() + ... ctx.prec += 2 + ... print(ctx.prec) + ... + 30 + >>> with localcontext(ExtendedContext): + ... print(getcontext().prec) + ... + 9 + >>> print(getcontext().prec) + 28 + """ + if ctx is None: ctx = getcontext() + return _ContextManager(ctx) + +##### Operations on decimal coefficients ###################################### + +# These functions are prime candidates for recoding in C. + +def _fix05(x): + """Return x+1 if the units digits of x is 0 or 5, and x otherwise.""" + return x + deccoeff_one if x[0] in half_digits else x + +def _rounds(x, shift, rounding_mode): + if shift <= 0: + raise ValueError("shift should be positive") + + # half is true if part shifted away begins with a digit >= 5 + half = x[shift-1] >= deccoeff_five + # inexact is true unless part shifted away is exactly zero or + # exactly 500...00 + inexact = x[shift-1] not in half_digits or x[:shift-1] != deccoeff_zero + + if rounding_mode == ROUND_DOWN: + increment = False + elif rounding_mode == ROUND_UP: + increment = half or inexact + elif rounding_mode == ROUND_HALF_DOWN: + increment = half and inexact + elif rounding_mode == ROUND_HALF_EVEN: + increment = half and (inexact or x[shift] in odd_digits) + elif rounding_mode == ROUND_HALF_UP: + increment = half + elif rounding_mode == ROUND_05UP: + increment = (half or inexact) and x[shift] in half_digits + return ((x >> shift) + deccoeff_one if increment else (x >> shift)), half or inexact + +def _count_zeros(x): + """Return number of trailing zeros on x.""" + if not x: + raise ValueError("argument to _count_zeros should be nonzero") + + count = 0 + while x and not x[0]: + x >>= 1 + count += 1 + return count + +##### Decimal class ####################################################### + +class Decimal(_Decimal, _numbers.Real): + """Floating point class for decimal arithmetic.""" + + # Generally, the value of the Decimal instance is given by + # (-1)**_sign * _int * 10**_exp + # Special values are signified by _is_special == True + + # We're immutable, so use __new__ not __init__ + def __new__(cls, value="0", context=None): + """Create a decimal point instance. + + >>> Decimal('3.14') # string input + Decimal('3.14') + >>> Decimal((0, (3, 1, 4), -2)) # tuple (sign, digit_tuple, exponent) + Decimal('3.14') + >>> Decimal(314) # int or long + Decimal('314') + >>> Decimal(Decimal(314)) # another decimal instance + Decimal('314') + >>> Decimal(' 3.14 \\n') # leading and trailing whitespace okay + Decimal('3.14') + """ + + # From a string + # REs insist on real strings, so we can too. + if isinstance(value, str): + try: + m = cls.from_str(value.strip()) + except ValueError: + if context is None: + context = getcontext() + return context._raise_error(ConversionSyntax, + "Invalid literal for Decimal: %r" % value) + return m + + # From another decimal + if isinstance(value, _Decimal): + if value._is_special: + if value.is_infinite(): + return cls._inf(value._sign) + elif value.is_qnan(): + return cls._qnan(value._sign, value._payload) + elif value.is_snan(): + return cls._snan(value._sign, value._payload) + else: + assert False, "never get here" + else: + return cls._finite(value._sign, value._int, value._exp) + + # From an integer + if isinstance(value, int): + if value >= 0: + _sign = 0 + else: + _sign = 1 + _int = Deccoeff(abs(value)) + return cls._finite(_sign, _int, 0) + + # tuple/list conversion (possibly from as_tuple()) + if isinstance(value, (list,tuple)): + if len(value) != 3: + raise ValueError('Invalid tuple size in creation of Decimal ' + 'from list or tuple. The list or tuple ' + 'should have exactly three elements.') + # process sign. The isinstance test rejects floats + if not (isinstance(value[0], int) and value[0] in (0,1)): + raise ValueError("Invalid sign. The first value in the tuple " + "should be an integer; either 0 for a " + "positive number or 1 for a negative number.") + _sign = value[0] + if value[2] == 'F': + # infinity: value[1] is ignored + return cls._inf(_sign) + else: + # process and validate the digits in value[1] + digits = [] + for digit in value[1]: + if isinstance(digit, int) and 0 <= digit <= 9: + digits.append(str(digit)) + else: + raise ValueError("The second value in the tuple must " + "be composed of integers in the range " + "0 through 9.") + _int = Deccoeff(''.join(digits)) + if value[2] == 'n': + return cls._qnan(_sign, _int) + elif value[2] == 'N': + return cls._snan(_sign, _int) + elif isinstance(value[2], int): + return cls._finite(_sign, _int, value[2]) + else: + raise ValueError("The third value in the tuple must " + "be an integer, or one of the " + "strings 'F', 'n', 'N'.") + + if isinstance(value, float): + raise TypeError("Cannot convert float to Decimal. " + + "First convert the float to a string") + + raise TypeError("Cannot convert %r to Decimal" % value) + + @classmethod + def from_float(cls, f): + """Converts a float to a decimal number, exactly. + + Note that Decimal.from_float(0.1) is not the same as Decimal('0.1'). + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + 0x1.999999999999ap-4. The exact equivalent of the value in decimal + is 0.1000000000000000055511151231257827021181583404541015625. + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(-float('inf')) + Decimal('-Infinity') + >>> Decimal.from_float(-0.0) + Decimal('-0') + + """ + if isinstance(f, int): # handle integer inputs + return cls(f) + if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float + return cls(repr(f)) + if _math.copysign(1.0, f) == 1.0: + sign = 0 + else: + sign = 1 + n, d = abs(f).as_integer_ratio() + k = d.bit_length() - 1 + result = _dec_from_triple(sign, Deccoeff(n*5**k), -k) + if cls is Decimal: + return result + else: + return cls(result) + + def _check_nan(self, context): + if self.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', self) + elif self.is_qnan(): + return self._fix_nan(context) + else: + return None + + def _check_nans(self, other, context): + """Returns whether the number is not actually one. + + if self, other are sNaN, signal + if self, other are NaN return nan + return None + + Done before operations. + """ + if self.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', self) + elif other.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', other) + elif self.is_qnan(): + return self._fix_nan(context) + elif other.is_qnan(): + return other._fix_nan(context) + else: + return None + + def _compare_check_nans(self, other, context): + """Version of _check_nans used for the signaling comparisons + compare_signal, __le__, __lt__, __ge__, __gt__. + + Signal InvalidOperation if either self or other is a (quiet + or signaling) NaN. Signaling NaNs take precedence over quiet + NaNs. + + Return 0 if neither operand is a NaN. + + """ + if context is None: + context = getcontext() + + if self._is_special or other._is_special: + if self.is_snan(): + return context._raise_error(InvalidOperation, + 'comparison involving sNaN', + self) + elif other.is_snan(): + return context._raise_error(InvalidOperation, + 'comparison involving sNaN', + other) + elif self.is_qnan(): + return context._raise_error(InvalidOperation, + 'comparison involving NaN', + self) + elif other.is_qnan(): + return context._raise_error(InvalidOperation, + 'comparison involving NaN', + other) + return 0 + + def __bool__(self): + """Return True if self is nonzero; otherwise return False. + + NaNs and infinities are considered nonzero. + """ + return self._is_special or bool(self._int) + + def _cmp(self, other): + """Compare the two non-NaN decimal instances self and other. + + Returns -1 if self < other, 0 if self == other and 1 + if self > other. This routine is for internal use only.""" + + if self.is_infinite(): + if other.is_infinite(): + return other.is_signed() - self.is_signed() + elif self.is_signed(): + return -1 + else: + return 1 + + if other.is_infinite(): + if other.is_signed(): + return 1 + else: + return -1 + + # check for zeros; note that cmp(0, -0) should return 0 + if not self: + if not other: + return 0 + else: + return -((-1)**other._sign) + 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 + + # signs are the same; if both arguments are negative, + # swap them and treat as positive. + if self._sign == 1: + self, other = other, self + + self_adjusted = self.adjusted() + other_adjusted = other.adjusted() + + if self_adjusted != other_adjusted: + return [1, -1][self_adjusted < other_adjusted] + + 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])) + + # Note: The Decimal standard doesn't cover rich comparisons for + # Decimals. In particular, the specification is silent on the + # subject of what should happen for a comparison involving a NaN. + # We take the following approach: + # + # == comparisons involving a NaN always return False + # != comparisons involving a NaN always return True + # <, >, <= and >= comparisons involving a (quiet or signaling) + # NaN signal InvalidOperation, and return False if the + # InvalidOperation is not trapped. + # + # This behavior is designed to conform as closely as possible to + # that specified by IEEE 854. + + def __eq__(self, other): + other = _convert_other(other) + if other is NotImplemented: + return other + if self.is_nan() or other.is_nan(): + return False + return self._cmp(other) == 0 + + def __ne__(self, other): + other = _convert_other(other) + if other is NotImplemented: + return other + if self.is_nan() or other.is_nan(): + return True + return self._cmp(other) != 0 + + def __lt__(self, other, context=None): + other = _convert_other(other) + if other is NotImplemented: + return other + ans = self._compare_check_nans(other, context) + if ans: + return False + return self._cmp(other) < 0 + + def __le__(self, other, context=None): + other = _convert_other(other) + if other is NotImplemented: + return other + ans = self._compare_check_nans(other, context) + if ans: + return False + return self._cmp(other) <= 0 + + def __gt__(self, other, context=None): + other = _convert_other(other) + if other is NotImplemented: + return other + ans = self._compare_check_nans(other, context) + if ans: + return False + return self._cmp(other) > 0 + + def __ge__(self, other, context=None): + other = _convert_other(other) + if other is NotImplemented: + return other + ans = self._compare_check_nans(other, context) + if ans: + return False + return self._cmp(other) >= 0 + + def compare(self, other, context=None): + """Compares one to another. + + -1 => a < b + 0 => a = b + 1 => a > b + NaN => one is NaN + Like __cmp__, but returns Decimal instances. + """ + other = _convert_other(other, raiseit=True) + + # Compare(NaN, NaN) = NaN + if self._is_special or other._is_special: + ans = self._check_nans(other, context) + if ans: + return ans + + return [Dec_0, Dec_p1, Dec_n1][self._cmp(other)] + + def __hash__(self): + """x.__hash__() <==> hash(x)""" + # Decimal integers must hash the same as the ints + # + # The hash of a nonspecial noninteger Decimal must depend only + # on the value of that Decimal, and not on its representation. + # For example: hash(Decimal('100E-1')) == hash(Decimal('10')). + if self._is_special: + if self.is_nan(): + raise TypeError('Cannot hash a NaN value.') + return hash(str(self)) + if not self: + return 0 + if self._isinteger(): + op = _WorkRep(self.to_integral_value()) + # to make computation feasible for Decimals with large + # exponent, we use the fact that hash(n) == hash(m) for + # any two nonzero integers n and m such that (i) n and m + # have the same sign, and (ii) n is congruent to m modulo + # 2**64-1. So we can replace hash((-1)**s*c*10**e) with + # hash((-1)**s*c*pow(10, e, 2**64-1). + return hash((-1)**op.sign*op.int*pow(10, op.exp, 2**64-1)) + # The value of a nonzero nonspecial Decimal instance is + # faithfully represented by the triple consisting of its sign, + # its adjusted exponent, and its coefficient with trailing + # zeros removed. + return hash((self._sign, + self._exp+self._int.digit_length(), + self._int >> _count_zeros(self._int))) + + def as_tuple(self): + """Represents the number as a triple tuple. + + To show the internals exactly as they are. + """ + # backwards compatibility requires some effort here + + if self._is_special: + if self.is_infinite(): + coeff = (0,) + exp = 'F' + else: # NaN + if self._payload: + coeff = tuple(int(x) for x in str(self._payload)) + else: + coeff = () + if self.is_qnan(): + exp = 'n' + else: + exp = 'N' + + elif not self: + coeff = (0,) + exp = self._exp + else: + coeff = tuple(int(x) for x in str(self._int)) + exp = self._exp + + return DecimalTuple(self._sign, coeff, exp) + + def __repr__(self): + """Represents the number as an instance of Decimal.""" + # Invariant: eval(repr(d)) == d + return "Decimal('%s')" % str(self) + + def __str__(self): + """Return string representation of the number in scientific notation. + + Captures all of the information in the underlying representation. + """ + + sign = ['', '-'][self._sign] + if self._is_special: + if self.is_infinite(): + return sign + 'Infinity' + elif self.is_qnan(): + if not self._payload: + return sign + 'NaN' + else: + return sign + 'NaN' + str(self._payload) + else: + if not self._payload: + return sign + 'sNaN' + else: + return sign + 'sNaN' + str(self._payload) + + # number of digits of self._int to left of decimal point + si = str(self._int) + ls = len(si) + leftdigits = self._exp + ls + + # dotplace is number of digits of self._int to the left of the + # decimal point in the mantissa of the output string (that is, + # after adjusting the exponent) + if self._exp <= 0 and leftdigits > -6: + # no exponent required + dotplace = leftdigits + else: + # usual scientific notation: 1 digit on left of the point + dotplace = 1 + + if dotplace <= 0: + intpart = '0' + fracpart = '.' + '0'*(-dotplace) + si + elif dotplace >= (ls if self._int else 0): + intpart = si+'0'*(dotplace-ls) + fracpart = '' + else: + intpart = si[:dotplace] + fracpart = '.' + si[dotplace:] + if leftdigits == dotplace: + exp = '' + else: + exp = "E%+d" % (leftdigits-dotplace) + + return sign + intpart + fracpart + exp + + def to_eng_string(self, context=None): + """Convert to engineering-type string. + + Engineering notation has an exponent which is a multiple of 3, so there + are up to 3 digits left of the decimal place. + + Same rules for when in exponential and when as a value as in __str__. + """ + + sign = ['', '-'][self._sign] + if self._is_special: + if self.is_infinite(): + return sign + 'Infinity' + elif self.is_qnan(): + if not self._payload: + return sign + 'NaN' + else: + return sign + 'NaN' + str(self._payload) + else: # self.is_snan() + if not self._payload: + return sign + 'sNaN' + else: + return sign + 'sNaN' + str(self._payload) + + # deal independently with case of 0 + if self._int: + si = str(self._int) + ls = len(si) + else: + si = '' + ls = 0 + + leftdigits = self._exp + ls + + # dotplace is number of digits of self._int to the left of the + # decimal point in the mantissa of the output string (that is, + # after adjusting the exponent) + if not self: + if self._exp <= 0 and leftdigits >= -6: + dotplace = leftdigits + else: + dotplace = (leftdigits-1) % 3 - 2 + else: + if self._exp <= 0 and leftdigits > -6: + # no exponent required + dotplace = leftdigits + else: + # engineering notation, nonzero + dotplace = (leftdigits - 1) % 3 + 1 + + if dotplace >= ls: + intpart = si + '0'*(dotplace-ls) + fracpart = '' + if intpart == '': + intpart = '0' + elif dotplace <= 0: + intpart = '0' + fracpart = '.' + '0'*(-dotplace) + si + else: + intpart = si[:dotplace] + fracpart = '.' + si[dotplace:] + + if leftdigits == dotplace: + exp = '' + else: + if context is None: + context = getcontext() + exp = ['e', 'E'][context.capitals] + "%+d" % (leftdigits-dotplace) + + return sign + intpart + fracpart + exp + + def __neg__(self, context=None): + """Returns a copy with the sign switched. + + Rounds, if it has reason. + """ + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + + if not self: + # -Decimal('0') is Decimal('0'), not Decimal('-0') + ans = self.copy_abs() + else: + ans = self.copy_negate() + + if context is None: + context = getcontext() + return ans._fix(context) + + def __pos__(self, context=None): + """Returns a copy, unless it is a sNaN. + + Rounds the number (if more then precision digits) + """ + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + + if not self: + # + (-0) = 0 + ans = self.copy_abs() + else: + ans = Decimal(self) + + if context is None: + context = getcontext() + return ans._fix(context) + + def __abs__(self, round=True, context=None): + """Returns the absolute value of self. + + If the keyword argument 'round' is false, do not round. The + expression self.__abs__(round=False) is equivalent to + self.copy_abs(). + """ + if not round: + return self.copy_abs() + + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + + if self._sign: + ans = self.__neg__(context=context) + else: + ans = self.__pos__(context=context) + + return ans + + def __add__(self, other, context=None): + """Returns self + other. + + -INF + INF (or the reverse) cause InvalidOperation errors. + """ + other = _convert_other(other) + if other is NotImplemented: + return other + + if context is None: + context = getcontext() + + if self._is_special or other._is_special: + ans = self._check_nans(other, context) + if ans: + return ans + + if self.is_infinite(): + # If both INF, same sign => same as both, opposite => error. + if self._sign != other._sign and other.is_infinite(): + return context._raise_error(InvalidOperation, '-INF + INF') + return Decimal(self) + if other.is_infinite(): + return Decimal(other) # Can't both be infinity here + + # exchange if necessary to make sure that self._exp >= other._exp + if self._exp < other._exp: + self, other = other, self + + if self._int: + self._exp + exp = min(self._exp, + self._exp + self._int.digit_length() - context.prec - 2) + if not other: + if other._exp <= exp: + other = _dec_from_triple(other._sign, deccoeff_zero, exp) + elif other._int.digit_length() + other._exp <= exp: + # here other is insignificant compared with self; + # the result should be the result of rounding self + tiny + + + other = _dec_from_triple(other._sign, deccoeff_one, exp-1) + # would be better to use next_plus or next_minus as appropriate here. + + expdiff = self._exp - other._exp + assert expdiff >= 0 + self = _dec_from_triple(self._sign, self._int << expdiff, other._exp) + + exp = other._exp + if self._sign == other._sign: + coeff = self._int + other._int + sign = self._sign + elif self._int > other._int: + coeff = self._int - other._int + sign = self._sign + elif self._int < other._int: + coeff = other._int - self._int + sign = other._sign + else: + coeff = deccoeff_zero + sign = 1 if context.rounding == ROUND_FLOOR else 0 + ans = _dec_from_triple(sign, coeff, exp) + return ans._fix(context) + + __radd__ = __add__ + + def __sub__(self, other, context=None): + """Return self - other""" + other = _convert_other(other) + if other is NotImplemented: + return other + + if self._is_special or other._is_special: + ans = self._check_nans(other, context) + if ans: + return ans + + # self - other is computed as self + other.copy_negate() + return self.__add__(other.copy_negate(), context=context) + + def __rsub__(self, other, context=None): + """Return other - self""" + other = _convert_other(other) + if other is NotImplemented: + return other + + return other.__sub__(self, context=context) + + def __mul__(self, other, context=None): + """Return self * other. + + (+-) INF * 0 (or its reverse) raise InvalidOperation. + """ + other = _convert_other(other) + if other is NotImplemented: + return other + + if context is None: + context = getcontext() + + resultsign = self._sign ^ other._sign + + if self._is_special or other._is_special: + ans = self._check_nans(other, context) + if ans: + return ans + + if self.is_infinite(): + if not other: + return context._raise_error(InvalidOperation, '(+-)INF * 0') + return Infsign[resultsign] + + if other.is_infinite(): + if not self: + return context._raise_error(InvalidOperation, '0 * (+-)INF') + return Infsign[resultsign] + + resultexp = self._exp + other._exp + + # Special case for multiplying by zero + if not self or not other: + ans = _dec_from_triple(resultsign, deccoeff_zero, resultexp) + # Fixing in case the exponent is out of bounds + ans = ans._fix(context) + return ans + + ans = _dec_from_triple(resultsign, self._int*other._int, resultexp) + ans = ans._fix(context) + + return ans + __rmul__ = __mul__ + + def __div__(self, other, context=None): + """Return self / other.""" + other = _convert_other(other) + if other is NotImplemented: + return NotImplemented + + if context is None: + context = getcontext() + + sign = self._sign ^ other._sign + + if self._is_special or other._is_special: + ans = self._check_nans(other, context) + if ans: + return ans + + if self.is_infinite() and other.is_infinite(): + return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') + + if self.is_infinite(): + return Infsign[sign] + + if other.is_infinite(): + context._raise_error(Clamped, 'Division by infinity') + return _dec_from_triple(sign, deccoeff_zero, context.Etiny()) + + # Special cases for zeroes + if not other: + if not self: + return context._raise_error(DivisionUndefined, '0 / 0') + return context._raise_error(DivisionByZero, 'x / 0', sign) + + if not self: + exp = self._exp - other._exp + coeff = deccoeff_zero + else: + shift = (other._int.digit_length() - self._int.digit_length() + + context.prec + 1) + exp = self._exp - other._exp - shift + if shift >= 0: + coeff, remainder = divmod(self._int << shift, other._int) + else: + coeff, remainder = divmod(self._int, other._int << -shift) + if remainder: + # result not exact: adjust to ensure correct rounding + coeff = _fix05(coeff) + else: + # result is exact (and nonzero); get as close to ideal + # exponent as possible. + ideal_exp = self._exp - other._exp + + # if ideal_exp > actual exponent, remove as + # many zeros as possible...; if ideal_exp <= exp, + # there's nothing we can do. + zeros = min(ideal_exp - exp, _count_zeros(coeff)) + if zeros > 0: + coeff = coeff[zeros:] + exp += zeros + + ans = _dec_from_triple(sign, coeff, exp) + return ans._fix(context) + + __truediv__ = __div__ + + def _divide(self, other, context): + """Return (self // other, self % other), to context.prec precision. + + Assumes that neither self nor other is a NaN, that self is not + infinite and that other is nonzero. + """ + sign = self._sign ^ other._sign + if other.is_infinite(): + ideal_exp = self._exp + else: + ideal_exp = min(self._exp, other._exp) + + if not self or other.is_infinite(): + return (_dec_from_triple(sign, deccoeff_zero, 0), + self._rescale(ideal_exp, context.rounding)) + + expdiff = self.adjusted() - other.adjusted() + if expdiff <= -2: + return (_dec_from_triple(sign, deccoeff_zero, 0), + self._rescale(ideal_exp, context.rounding)) + if expdiff <= context.prec: + expdiff = self._exp - other._exp + if expdiff >= 0: + aint = self._int << expdiff + bint = other._int + else: + aint = self._int + bint = other._int << -expdiff + q, r = divmod(aint, bint) + if q.digit_length() <= context.prec: + return (_dec_from_triple(sign, q, 0), + _dec_from_triple(self._sign, r, ideal_exp)) + + # Here the quotient is too large to be representable + ans = context._raise_error(DivisionImpossible, + 'quotient too large in //, % or divmod') + return ans, ans + + def __rdiv__(self, other, context=None): + """Swaps self/other and returns __div__.""" + other = _convert_other(other) + if other is NotImplemented: + return other + return other.__div__(self, context=context) + __rtruediv__ = __rdiv__ + + def __divmod__(self, other, context=None): + """ + Return (self // other, self % other) + """ + other = _convert_other(other) + if other is NotImplemented: + return other + + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return (ans, ans) + + sign = self._sign ^ other._sign + if self.is_infinite(): + if other.is_infinite(): + ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') + return ans, ans + else: + return (Infsign[sign], + context._raise_error(InvalidOperation, 'INF % x')) + + if not other: + if not self: + ans = context._raise_error(DivisionUndefined, 'divmod(0, 0)') + return ans, ans + else: + return (context._raise_error(DivisionByZero, 'x // 0', sign), + context._raise_error(InvalidOperation, 'x % 0')) + + quotient, remainder = self._divide(other, context) + remainder = remainder._fix(context) + return quotient, remainder + + def __rdivmod__(self, other, context=None): + """Swaps self/other and returns __divmod__.""" + other = _convert_other(other) + if other is NotImplemented: + return other + return other.__divmod__(self, context=context) + + def __mod__(self, other, context=None): + """ + self % other + """ + other = _convert_other(other) + if other is NotImplemented: + return other + + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return ans + + if self.is_infinite(): + return context._raise_error(InvalidOperation, 'INF % x') + elif not other: + if self: + return context._raise_error(InvalidOperation, 'x % 0') + else: + return context._raise_error(DivisionUndefined, '0 % 0') + + remainder = self._divide(other, context)[1] + remainder = remainder._fix(context) + return remainder + + def __rmod__(self, other, context=None): + """Swaps self/other and returns __mod__.""" + other = _convert_other(other) + if other is NotImplemented: + return other + return other.__mod__(self, context=context) + + def remainder_near(self, other, context=None): + """ + Remainder nearest to 0- abs(remainder-near) <= other/2 + """ + if context is None: + context = getcontext() + + other = _convert_other(other, raiseit=True) + + ans = self._check_nans(other, context) + if ans: + return ans + + # self == +/-infinity -> InvalidOperation + if self.is_infinite(): + return context._raise_error(InvalidOperation, + 'remainder_near(infinity, x)') + + # other == 0 -> either InvalidOperation or DivisionUndefined + if not other: + if self: + return context._raise_error(InvalidOperation, + 'remainder_near(x, 0)') + else: + return context._raise_error(DivisionUndefined, + 'remainder_near(0, 0)') + + # other = +/-infinity -> remainder = self + if other.is_infinite(): + ans = Decimal(self) + return ans._fix(context) + + # self = 0 -> remainder = self, with ideal exponent + ideal_exponent = min(self._exp, other._exp) + if not self: + ans = _dec_from_triple(self._sign, deccoeff_zero, ideal_exponent) + return ans._fix(context) + + # catch most cases of large or small quotient + expdiff = self.adjusted() - other.adjusted() + if expdiff >= context.prec + 1: + # expdiff >= prec+1 => abs(self/other) > 10**prec + return context._raise_error(DivisionImpossible) + if expdiff <= -2: + # expdiff <= -2 => abs(self/other) < 0.1 + ans = self._rescale(ideal_exponent, context.rounding) + return ans._fix(context) + + # adjust both arguments to have the same exponent, then divide + if self._exp >= other._exp: + a = self._int << (self._exp - other._exp) + b = other._int + else: + a = self._int + b = other._int << (other._exp - self._exp) + + q, r = divmod(a, b) + sign = self._sign + if deccoeff_two*r + [deccoeff_zero, deccoeff_one][q[0] in odd_digits] > b: + # result has same sign as self unless r is negative + if r < b: + r = b - r + sign = 1-sign + else: + r = r - b + q = q + deccoeff_one + + if q.digit_length() > context.prec: + return context._raise_error(DivisionImpossible) + + ans = _dec_from_triple(sign, r, ideal_exponent) + return ans._fix(context) + + def __floordiv__(self, other, context=None): + """self // other""" + other = _convert_other(other) + if other is NotImplemented: + return other + + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return ans + + if self.is_infinite(): + if other.is_infinite(): + return context._raise_error(InvalidOperation, 'INF // INF') + else: + return Infsign[self._sign ^ other._sign] + + if not other: + if self: + return context._raise_error(DivisionByZero, 'x // 0', + self._sign ^ other._sign) + else: + return context._raise_error(DivisionUndefined, '0 // 0') + + return self._divide(other, context)[0] + + def __rfloordiv__(self, other, context=None): + """Swaps self/other and returns __floordiv__.""" + other = _convert_other(other) + if other is NotImplemented: + return other + return other.__floordiv__(self, context=context) + + def __float__(self): + """Float representation.""" + return float(str(self)) + + def __int__(self): + """Converts self to an int, truncating if necessary.""" + if self._is_special: + if self.is_nan(): + context = getcontext() + # XXX this makes no sense: why InvalidContext? + return context._raise_error(InvalidContext) + elif self.is_infinite(): + raise OverflowError("Cannot convert infinity to long") + if not self: + return 0 + s = (-1)**self._sign + if self._exp >= 0: + return s*int(str(self._int) or '0')*10**self._exp + else: + return s*int(str(self._int)[:self._exp] or '0') + + __trunc__ = __int__ + + @property + def real(self): + return self + + @property + def imag(self): + return Decimal(0) + + def conjugate(self): + return self + + def __complex__(self): + return complex(float(self)) + + def _fix_nan(self, context): + """Decapitate the payload of a NaN to fit the context""" + assert self.is_nan() + + payload = self._payload + + # maximum length of payload is precision if _clamp=0, + # precision-1 if _clamp=1. + max_payload_len = context.prec - context._clamp + if payload.digit_length() > max_payload_len: + # if payload is too long, take *low order* digits + payload = payload[:max_payload_len] + if self.is_qnan(): + return Decimal._qnan(self._sign, payload) + else: + return Decimal._snan(self._sign, payload) + + return Decimal(self) + + def _fix(self, context, rounding=None): + """Round if it is necessary to keep self within prec precision. + + Rounds and fixes the exponent. Does not raise on a sNaN. + + Arguments: + self - Decimal instance + context - context used. + rounding - rounding mode; overrides context rounding mode if given + """ + + if rounding is None: + rounding = context.rounding + + if self._is_special: + if self.is_nan(): + # decapitate payload if necessary + return self._fix_nan(context) + else: + # self is +/-Infinity; return unaltered + return Decimal(self) + + # if self is zero then exponent should be between Etiny and + # Emax if _clamp==0, and between Etiny and Etop if _clamp==1. + Etiny = context.Etiny() + Etop = context.Etop() + if not self: + exp_max = [context.Emax, Etop][context._clamp] + new_exp = min(max(self._exp, Etiny), exp_max) + if new_exp != self._exp: + context._raise_error(Clamped) + return _dec_from_triple(self._sign, deccoeff_zero, new_exp) + else: + return Decimal(self) + + # exp_min is the smallest allowable exponent of the result, + # equal to max(self.adjusted()-context.prec+1, Etiny) + exp_min = self._int.digit_length() + self._exp - context.prec + if exp_min > Etop: + # overflow: exp_min > Etop iff self.adjusted() > Emax + context._raise_error(Inexact) + context._raise_error(Rounded) + return context._raise_error(Overflow, 'above Emax', self._sign) + self_is_subnormal = exp_min < Etiny + if self_is_subnormal: + context._raise_error(Subnormal) + exp_min = Etiny + + # round if self has too many digits + if self._exp < exp_min: + context._raise_error(Rounded) + this_function = getattr(self, self._pick_rounding_function[rounding]) + coeff, changed = this_function(exp_min - self._exp) + ans = _dec_from_triple(self._sign, coeff, exp_min) + + if changed: + context._raise_error(Inexact) + if self_is_subnormal: + context._raise_error(Underflow) + if not ans: + # raise Clamped on underflow to 0 + context._raise_error(Clamped) + elif ans._int.digit_length() == context.prec+1: + # we get here only if rescaling rounds the + # cofficient up to exactly 10**context.prec + if ans._exp < Etop: + ans = _dec_from_triple(ans._sign, + ans._int[1:], + ans._exp+1) + else: + # Inexact and Rounded have already been raised + ans = context._raise_error(Overflow, 'above Emax', + self._sign) + return ans + + # fold down if _clamp == 1 and self has too few digits + if context._clamp == 1 and self._exp > Etop: + context._raise_error(Clamped) + self_padded = self._int << (self._exp - Etop) + return _dec_from_triple(self._sign, self_padded, Etop) + + # here self was representable to begin with; return unchanged + return Decimal(self) + + _pick_rounding_function = {} + + # for each of the rounding functions below: + # self is a finite, nonzero Decimal + # prec is an integer satisfying 0 <= prec < len(self._int) + # + # each function returns either -1, 0, or 1, as follows: + # 1 indicates that self should be rounded up (away from zero) + # 0 indicates that self should be truncated, and that all the + # digits to be truncated are zeros (so the value is unchanged) + # -1 indicates that there are nonzero digits to be truncated + + def _round_down(self, prec): + """Also known as round-towards-0, truncate.""" + return _rounds(self._int, prec, ROUND_DOWN) + + def _round_up(self, prec): + """Rounds away from 0.""" + return _rounds(self._int, prec, ROUND_UP) + + def _round_half_up(self, prec): + """Rounds 5 up (away from 0)""" + return _rounds(self._int, prec, ROUND_HALF_UP) + + def _round_half_down(self, prec): + """Round 5 down""" + return _rounds(self._int, prec, ROUND_HALF_DOWN) + + def _round_half_even(self, prec): + """Round 5 to even, rest to nearest.""" + return _rounds(self._int, prec, ROUND_HALF_EVEN) + + def _round_05up(self, prec): + """Round down unless digit prec-1 is 0 or 5.""" + return _rounds(self._int, prec, ROUND_05UP) + + def _round_ceiling(self, prec): + """Rounds up (not away from 0 if negative.)""" + if self._sign: + return self._round_down(prec) + else: + return self._round_up(prec) + + def _round_floor(self, prec): + """Rounds down (not towards 0 if negative)""" + if not self._sign: + return self._round_down(prec) + else: + return self._round_up(prec) + + def __round__(self, n=None): + """Round self to the nearest integer, or to a given precision. + + If only one argument is supplied, round a finite Decimal + instance self to the nearest integer. If self is infinite or + a NaN then a Python exception is raised. If self is finite + and lies exactly halfway between two integers then it is + rounded to the integer with even last digit. + + >>> round(Decimal('123.456')) + 123 + >>> round(Decimal('-456.789')) + -457 + >>> round(Decimal('-3.0')) + -3 + >>> round(Decimal('2.5')) + 2 + >>> round(Decimal('3.5')) + 4 + >>> round(Decimal('Inf')) + Traceback (most recent call last): + ... + ... + ... + OverflowError: cannot round an infinity + >>> round(Decimal('NaN')) + Traceback (most recent call last): + ... + ... + ... + ValueError: cannot round a NaN + + If a second argument n is supplied, self is rounded to n + decimal places using the rounding mode for the current + context. + + For an integer n, round(self, -n) is exactly equivalent to + self.quantize(Decimal('1En')). + + >>> round(Decimal('123.456'), 0) + Decimal('123') + >>> round(Decimal('123.456'), 2) + Decimal('123.46') + >>> round(Decimal('123.456'), -2) + Decimal('1E+2') + >>> round(Decimal('-Infinity'), 37) + Decimal('NaN') + >>> round(Decimal('sNaN123'), 0) + Decimal('NaN123') + + """ + if n is not None: + # two-argument form: use the equivalent quantize call + if not isinstance(n, int): + raise TypeError('Second argument to round should be integral') + exp = _dec_from_triple(0, deccoeff_one, -n) + return self.quantize(exp) + + # one-argument form + if self._is_special: + if self.is_nan(): + raise ValueError("cannot round a NaN") + else: + raise OverflowError("cannot round an infinity") + return int(self._rescale(0, ROUND_HALF_EVEN)) + + def __floor__(self): + """Return the floor of self, as an integer. + + For a finite Decimal instance self, return the greatest + integer n such that n <= self. If self is infinite or a NaN + then a Python exception is raised. + + """ + if self._is_special: + if self.is_nan(): + raise ValueError("cannot round a NaN") + else: + raise OverflowError("cannot round an infinity") + return int(self._rescale(0, ROUND_FLOOR)) + + def __ceil__(self): + """Return the ceiling of self, as an integer. + + For a finite Decimal instance self, return the least integer n + such that n >= self. If self is infinite or a NaN then a + Python exception is raised. + + """ + if self._is_special: + if self.is_nan(): + raise ValueError("cannot round a NaN") + else: + raise OverflowError("cannot round an infinity") + return int(self._rescale(0, ROUND_CEILING)) + + def fma(self, other, third, context=None): + """Fused multiply-add. + + Returns self*other+third with no rounding of the intermediate + product self*other. + + self and other are multiplied together, with no rounding of + the result. The third operand is then added to the result, + and a single final rounding is performed. + """ + + other = _convert_other(other, raiseit=True) + + # compute product; raise InvalidOperation if either operand is + # a signaling NaN or if the product is zero times infinity. + if self._is_special or other._is_special: + if context is None: + context = getcontext() + if self.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', self) + if other.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', other) + if self.is_qnan(): + product = self + elif other.is_qnan(): + product = other + elif self.is_infinite(): + if not other: + return context._raise_error(InvalidOperation, + 'INF * 0 in fma') + product = Infsign[self._sign ^ other._sign] + elif other.is_infinite(): + if not self: + return context._raise_error(InvalidOperation, + '0 * INF in fma') + product = Infsign[self._sign ^ other._sign] + else: + product = _dec_from_triple(self._sign ^ other._sign, + self._int * other._int, + self._exp + other._exp) + + third = _convert_other(third, raiseit=True) + return product.__add__(third, context) + + def _power_modulo(self, other, modulo, context=None): + """Three argument version of __pow__""" + + # if can't convert other and modulo to Decimal, raise + # TypeError; there's no point returning NotImplemented (no + # equivalent of __rpow__ for three argument pow) + other = _convert_other(other, raiseit=True) + modulo = _convert_other(modulo, raiseit=True) + + if context is None: + context = getcontext() + + # deal with NaNs: same pattern as _check_nans, but with 3 args + if self._is_special or other._is_special or modulo._is_special: + if self.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', self) + elif other.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', other) + elif modulo.is_snan(): + return context._raise_error(InvalidOperation, 'sNaN', modulo) + elif self.is_qnan(): + return self._fix_nan(context) + elif other.is_qnan(): + return other._fix_nan(context) + elif modulo.is_qnan(): + return modulo._fix_nan(context) + + # check inputs: we apply same restrictions as Python's pow() + if not (self._isinteger() and + other._isinteger() and + modulo._isinteger()): + return context._raise_error(InvalidOperation, + 'pow() 3rd argument not allowed ' + 'unless all arguments are integers') + if other < 0: + return context._raise_error(InvalidOperation, + 'pow() 2nd argument cannot be ' + 'negative when 3rd argument specified') + if not modulo: + return context._raise_error(InvalidOperation, + 'pow() 3rd argument cannot be 0') + + # additional restriction for decimal: the modulus must be less + # than 10**prec in absolute value + if modulo.adjusted() >= context.prec: + return context._raise_error(InvalidOperation, + 'insufficient precision: pow() 3rd ' + 'argument must not have more than ' + 'precision digits') + + # define 0**0 == NaN, for consistency with two-argument pow + # (even though it hurts!) + if not other and not self: + return context._raise_error(InvalidOperation, + 'at least one of pow() 1st argument ' + 'and 2nd argument must be nonzero ;' + '0**0 is not defined') + + # compute sign of result + if other._iseven(): + sign = 0 + else: + sign = self._sign + + # convert modulo to a Python integer, and self and other to + # Decimal integers (i.e. force their exponents to be >= 0) + modulo = abs(int(modulo)) + base = _WorkRep(self.to_integral_value()) + exponent = _WorkRep(other.to_integral_value()) + + # compute result using integer pow() + base = (base.int % modulo * pow(10, base.exp, modulo)) % modulo + for i in range(exponent.exp): + base = pow(base, 10, modulo) + base = pow(base, exponent.int, modulo) + + return _dec_from_triple(sign, Deccoeff(base), 0) + + def _power_exact(self, other, p): + """Attempt to compute self**other exactly. + + Given Decimals self and other and an integer p, attempt to + compute an exact result for the power self**other, with p + digits of precision. Return None if self**other is not + exactly representable in p digits. + + Assumes that elimination of special cases has already been + performed: self and other must both be nonspecial; self must + be positive and not numerically equal to 1; other must be + nonzero. For efficiency, other._exp should not be too large, + so that 10**abs(other._exp) is a feasible calculation.""" + + # In the comments below, we write x for the value of self and + # y for the value of other. Write x = xc*10**xe and y = + # yc*10**ye. + + # The main purpose of this method is to identify the *failure* + # of x**y to be exactly representable with as little effort as + # possible. So we look for cheap and easy tests that + # eliminate the possibility of x**y being exact. Only if all + # these tests are passed do we go on to actually compute x**y. + + # Here's the main idea. First normalize both x and y. We + # express y as a rational m/n, with m and n relatively prime + # and n>0. Then for x**y to be exactly representable (at + # *any* precision), xc must be the nth power of a positive + # integer and xe must be divisible by n. If m is negative + # then additionally xc must be a power of either 2 or 5, hence + # a power of 2**n or 5**n. + # + # There's a limit to how small |y| can be: if y=m/n as above + # then: + # + # (1) if xc != 1 then for the result to be representable we + # need xc**(1/n) >= 2, and hence also xc**|y| >= 2. So + # if |y| <= 1/nbits(xc) then xc < 2**nbits(xc) <= + # 2**(1/|y|), hence xc**|y| < 2 and the result is not + # representable. + # + # (2) if xe != 0, |xe|*(1/n) >= 1, so |xe|*|y| >= 1. Hence if + # |y| < 1/|xe| then the result is not representable. + # + # Note that since x is not equal to 1, at least one of (1) and + # (2) must apply. Now |y| < 1/nbits(xc) iff |yc|*nbits(xc) < + # 10**-ye iff len(str(|yc|*nbits(xc)) <= -ye. + # + # There's also a limit to how large y can be, at least if it's + # positive: the normalized result will have coefficient xc**y, + # so if it's representable then xc**y < 10**p, and y < + # p/log10(xc). Hence if y*log10(xc) >= p then the result is + # not exactly representable. + + # if len(str(abs(yc*xe)) <= -ye then abs(yc*xe) < 10**-ye, + # so |y| < 1/xe and the result is not representable. + # Similarly, len(str(abs(yc)*xc_bits)) <= -ye implies |y| + # < 1/nbits(xc). + + x = _WorkRep(self) + xc, xe = x.int, x.exp + while xc % 10 == 0: + xc //= 10 + xe += 1 + + y = _WorkRep(other) + yc, ye = y.int, y.exp + while yc % 10 == 0: + yc //= 10 + ye += 1 + + # case where xc == 1: result is 10**(xe*y), with xe*y + # required to be an integer + if xc == 1: + if ye >= 0: + exponent = xe*yc*10**ye + else: + exponent, remainder = divmod(xe*yc, 10**-ye) + if remainder: + return None + if y.sign == 1: + exponent = -exponent + # if other is a nonnegative integer, use ideal exponent + if other._isinteger() and other._sign == 0: + ideal_exponent = self._exp*int(other) + zeros = min(exponent-ideal_exponent, p-1) + else: + zeros = 0 + return _dec_from_triple(0, Deccoeff('1' + '0'*zeros), exponent-zeros) + + # case where y is negative: xc must be either a power + # of 2 or a power of 5. + if y.sign == 1: + last_digit = xc % 10 + if last_digit in (2,4,6,8): + # quick test for power of 2 + if xc & -xc != xc: + return None + # now xc is a power of 2; e is its exponent + e = _nbits(xc)-1 + # find e*y and xe*y; both must be integers + if ye >= 0: + y_as_int = yc*10**ye + e = e*y_as_int + xe = xe*y_as_int + else: + ten_pow = 10**-ye + e, remainder = divmod(e*yc, ten_pow) + if remainder: + return None + xe, remainder = divmod(xe*yc, ten_pow) + if remainder: + return None + + if e*65 >= p*93: # 93/65 > log(10)/log(5) + return None + xc = 5**e + + elif last_digit == 5: + # e >= log_5(xc) if xc is a power of 5; we have + # equality all the way up to xc=5**2658 + e = _nbits(xc)*28//65 + xc, remainder = divmod(5**e, xc) + if remainder: + return None + while xc % 5 == 0: + xc //= 5 + e -= 1 + if ye >= 0: + y_as_integer = yc*10**ye + e = e*y_as_integer + xe = xe*y_as_integer + else: + ten_pow = 10**-ye + e, remainder = divmod(e*yc, ten_pow) + if remainder: + return None + xe, remainder = divmod(xe*yc, ten_pow) + if remainder: + return None + if e*3 >= p*10: # 10/3 > log(10)/log(2) + return None + xc = 2**e + else: + return None + + if xc >= 10**p: + return None + xe = -e-xe + return _dec_from_triple(0, Deccoeff(xc), xe) + + # now y is positive; find m and n such that y = m/n + if ye >= 0: + m, n = yc*10**ye, 1 + else: + if xe != 0 and len(str(abs(yc*xe))) <= -ye: + return None + xc_bits = _nbits(xc) + if xc != 1 and len(str(abs(yc)*xc_bits)) <= -ye: + return None + m, n = yc, 10**(-ye) + while m % 2 == n % 2 == 0: + m //= 2 + n //= 2 + while m % 5 == n % 5 == 0: + m //= 5 + n //= 5 + + # compute nth root of xc*10**xe + if n > 1: + # if 1 < xc < 2**n then xc isn't an nth power + if xc != 1 and xc_bits <= n: + return None + + xe, rem = divmod(xe, n) + if rem != 0: + return None + + # compute nth root of xc using Newton's method + a = 1 << -(-_nbits(xc)//n) # initial estimate + while True: + q, r = divmod(xc, a**(n-1)) + if a <= q: + break + else: + a = (a*(n-1) + q)//n + if not (a == q and r == 0): + return None + xc = a + + # now xc*10**xe is the nth root of the original xc*10**xe + # compute mth power of xc*10**xe + + # if m > p*100//_log10_lb(xc) then m > p/log10(xc), hence xc**m > + # 10**p and the result is not representable. + if xc > 1 and m > p*100//_log10_lb(xc): + return None + xc = xc**m + xe *= m + if xc > 10**p: + return None + + # by this point the result *is* exactly representable + # adjust the exponent to get as close as possible to the ideal + # exponent, if necessary + str_xc = str(xc) + if other._isinteger() and other._sign == 0: + ideal_exponent = self._exp*int(other) + zeros = min(xe-ideal_exponent, p-len(str_xc)) + else: + zeros = 0 + return _dec_from_triple(0, Deccoeff(str_xc+'0'*zeros), xe-zeros) + + def __pow__(self, other, modulo=None, context=None): + """Return self ** other [ % modulo]. + + With two arguments, compute self**other. + + With three arguments, compute (self**other) % modulo. For the + three argument form, the following restrictions on the + arguments hold: + + - all three arguments must be integral + - other must be nonnegative + - either self or other (or both) must be nonzero + - modulo must be nonzero and must have at most p digits, + where p is the context precision. + + If any of these restrictions is violated the InvalidOperation + flag is raised. + + The result of pow(self, other, modulo) is identical to the + result that would be obtained by computing (self**other) % + modulo with unbounded precision, but is computed more + efficiently. It is always exact. + """ + + if modulo is not None: + return self._power_modulo(other, modulo, context) + + other = _convert_other(other) + if other is NotImplemented: + return other + + if context is None: + context = getcontext() + + # either argument is a NaN => result is NaN + ans = self._check_nans(other, context) + if ans: + return ans + + # 0**0 = NaN (!), x**0 = 1 for nonzero x (including +/-Infinity) + if not other: + if not self: + return context._raise_error(InvalidOperation, '0 ** 0') + else: + return Dec_p1 + + # result has sign 1 iff self._sign is 1 and other is an odd integer + result_sign = 0 + if self._sign == 1: + if other._isinteger(): + if not other._iseven(): + result_sign = 1 + else: + # -ve**noninteger = NaN + # (-0)**noninteger = 0**noninteger + if self: + return context._raise_error(InvalidOperation, + 'x ** y with x negative and y not an integer') + # negate self, without doing any unwanted rounding + self = self.copy_negate() + + # 0**(+ve or Inf)= 0; 0**(-ve or -Inf) = Infinity + if not self: + if other._sign == 0: + return _dec_from_triple(result_sign, deccoeff_zero, 0) + else: + return Infsign[result_sign] + + # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 + if self.is_infinite(): + if other._sign == 0: + return Infsign[result_sign] + else: + return _dec_from_triple(result_sign, deccoeff_zero, 0) + + # 1**other = 1, but the choice of exponent and the flags + # depend on the exponent of self, and on whether other is a + # positive integer, a negative integer, or neither + if self == Dec_p1: + if other._isinteger(): + # exp = max(self._exp*max(int(other), 0), + # 1-context.prec) but evaluating int(other) directly + # is dangerous until we know other is small (other + # could be 1e999999999) + if other._sign == 1: + multiplier = 0 + elif other > context.prec: + multiplier = context.prec + else: + multiplier = int(other) + + exp = self._exp * multiplier + if exp < 1-context.prec: + exp = 1-context.prec + context._raise_error(Rounded) + else: + context._raise_error(Inexact) + context._raise_error(Rounded) + exp = 1-context.prec + + return _dec_from_triple(result_sign, Deccoeff('1'+'0'*-exp), exp) + + # compute adjusted exponent of self + self_adj = self.adjusted() + + # self ** infinity is infinity if self > 1, 0 if self < 1 + # self ** -infinity is infinity if self < 1, 0 if self > 1 + if other.is_infinite(): + if (other._sign == 0) == (self_adj < 0): + return _dec_from_triple(result_sign, deccoeff_zero, 0) + else: + return Infsign[result_sign] + + # from here on, the result always goes through the call + # to _fix at the end of this function. + ans = None + + # crude test to catch cases of extreme overflow/underflow. If + # log10(self)*other >= 10**bound and bound >= len(str(Emax)) + # then 10**bound >= 10**len(str(Emax)) >= Emax+1 and hence + # self**other >= 10**(Emax+1), so overflow occurs. The test + # for underflow is similar. + bound = self._log10_exp_bound() + other.adjusted() + if (self_adj >= 0) == (other._sign == 0): + # self > 1 and other +ve, or self < 1 and other -ve + # possibility of overflow + if bound >= len(str(context.Emax)): + # force overflow + ans = _dec_from_triple(result_sign, deccoeff_one, context.Emax+1) + else: + # self > 1 and other -ve, or self < 1 and other +ve + # possibility of underflow to 0 + Etiny = context.Etiny() + if bound >= len(str(-Etiny)): + ans = _dec_from_triple(result_sign, deccoeff_one, Etiny-1) + + # try for an exact result with precision +1 + if ans is None: + ans = self._power_exact(other, context.prec + 1) + if ans is not None and result_sign == 1: + ans = _dec_from_triple(1, ans._int, ans._exp) + + # usual case: inexact result, x**y computed directly as exp(y*log(x)) + if ans is None: + p = context.prec + x = _WorkRep(self) + xc, xe = x.int, x.exp + y = _WorkRep(other) + yc, ye = y.int, y.exp + if y.sign == 1: + yc = -yc + + # compute correctly rounded result: start with precision +3, + # then increase precision until result is unambiguously roundable + extra = 3 + while True: + coeff, exp = _dpower(xc, xe, yc, ye, p+extra) + if coeff % (5*10**(len(str(coeff))-p-1)): + break + extra += 3 + + ans = _dec_from_triple(result_sign, Deccoeff(coeff), exp) + + # the specification says that for non-integer other we need to + # raise Inexact, even when the result is actually exact. In + # the same way, we need to raise Underflow here if the result + # is subnormal. (The call to _fix will take care of raising + # Rounded and Subnormal, as usual.) + if not other._isinteger(): + context._raise_error(Inexact) + # pad with zeros up to length context.prec+1 if necessary + if ans._int.digit_length() <= context.prec: + expdiff = context.prec+1 - ans._int.digit_length() + ans = _dec_from_triple(ans._sign, Deccoeff(str(ans._int)+'0'*expdiff), + ans._exp-expdiff) + if ans.adjusted() < context.Emin: + context._raise_error(Underflow) + + # unlike exp, ln and log10, the power function respects the + # rounding mode; no need to use ROUND_HALF_EVEN here + ans = ans._fix(context) + return ans + + def __rpow__(self, other, context=None): + """Swaps self/other and returns __pow__.""" + other = _convert_other(other) + if other is NotImplemented: + return other + return other.__pow__(self, context=context) + + def normalize(self, context=None): + """Normalize- strip trailing 0s, change anything equal to 0 to 0e0""" + + if context is None: + context = getcontext() + + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + + dup = self._fix(context) + + if dup.is_infinite(): + return dup + if not dup: + return _dec_from_triple(dup._sign, deccoeff_zero, 0) + + # number of trailing zeros to remove + if context._clamp == 0: + zeros = _count_zeros(dup._int) + else: + zeros = min(_count_zeros(dup._int), context.Etop() - dup._exp) + return _dec_from_triple(dup._sign, dup._int[zeros:], dup._exp+zeros) + + def quantize(self, exp, rounding=None, context=None, watchexp=True): + """Quantize self so its exponent is the same as that of exp. + + Similar to self._rescale(exp._exp) but with error checking. + """ + exp = _convert_other(exp, raiseit=True) + + if context is None: + context = getcontext() + if rounding is None: + rounding = context.rounding + + if self._is_special or exp._is_special: + ans = self._check_nans(exp, context) + if ans: + return ans + + if exp.is_infinite() or self.is_infinite(): + if exp.is_infinite() and self.is_infinite(): + return Decimal(self) # if both are inf, it is OK + return context._raise_error(InvalidOperation, + 'quantize with one INF') + + # if we're not watching exponents, do a simple rescale + if not watchexp: + ans = self._rescale(exp._exp, rounding) + # raise Inexact and Rounded where appropriate + if ans._exp > self._exp: + context._raise_error(Rounded) + if ans != self: + context._raise_error(Inexact) + return ans + + # exp._exp should be between Etiny and Emax + if not (context.Etiny() <= exp._exp <= context.Emax): + return context._raise_error(InvalidOperation, + 'target exponent out of bounds in quantize') + + if not self: + ans = _dec_from_triple(self._sign, deccoeff_zero, exp._exp) + return ans._fix(context) + + self_adjusted = self.adjusted() + if self_adjusted > context.Emax: + return context._raise_error(InvalidOperation, + 'exponent of quantize result too large for current context') + if self_adjusted - exp._exp + 1 > context.prec: + return context._raise_error(InvalidOperation, + 'quantize result has too many digits for current context') + + ans = self._rescale(exp._exp, rounding) + if ans.adjusted() > context.Emax: + return context._raise_error(InvalidOperation, + 'exponent of quantize result too large for current context') + if ans._int.digit_length() > context.prec: + return context._raise_error(InvalidOperation, + 'quantize result has too many digits for current context') + + # raise appropriate flags + if ans._exp > self._exp: + context._raise_error(Rounded) + if ans != self: + context._raise_error(Inexact) + if ans and ans.adjusted() < context.Emin: + context._raise_error(Subnormal) + + # call to fix takes care of any necessary folddown + ans = ans._fix(context) + return ans + + def same_quantum(self, other): + """Return True if self and other have the same exponent; otherwise + return False. + + If either operand is a special value, the following rules are used: + * return True if both operands are infinities + * return True if both operands are NaNs + * otherwise, return False. + """ + other = _convert_other(other, raiseit=True) + if self._is_special or other._is_special: + return (self.is_nan() and other.is_nan() or + self.is_infinite() and other.is_infinite()) + return self._exp == other._exp + + def _rescale(self, exp, rounding): + """Rescale self so that the exponent is exp, either by padding with zeros + or by truncating digits, using the given rounding mode. + + Specials are returned without change. This operation is + quiet: it raises no flags, and uses no information from the + context. + + exp = exp to scale to (an integer) + rounding = rounding mode + """ + if self._is_special: + return Decimal(self) + if not self: + return _dec_from_triple(self._sign, deccoeff_zero, exp) + + if self._exp >= exp: + # pad answer with zeros if necessary + return _dec_from_triple(self._sign, + self._int << (self._exp - exp), exp) + + # too many digits; round and lose data. + this_function = getattr(self, self._pick_rounding_function[rounding]) + coeff, changed = this_function(exp - self._exp) + return _dec_from_triple(self._sign, coeff, exp) + + def _round(self, places, rounding): + """Round a nonzero, nonspecial Decimal to a fixed number of + significant figures, using the given rounding mode. + + Infinities, NaNs and zeros are returned unaltered. + + This operation is quiet: it raises no flags, and uses no + information from the context. + + """ + if places <= 0: + raise ValueError("argument should be at least 1 in _round") + if self._is_special or not self: + return Decimal(self) + ans = self._rescale(self.adjusted()+1-places, rounding) + # it can happen that the rescale alters the adjusted exponent; + # for example when rounding 99.97 to 3 significant figures. + # When this happens we end up with an extra 0 at the end of + # the number; a second rescale fixes this. + if ans.adjusted() != self.adjusted(): + ans = ans._rescale(ans.adjusted()+1-places, rounding) + return ans + + def to_integral_exact(self, rounding=None, context=None): + """Rounds to a nearby integer. + + If no rounding mode is specified, take the rounding mode from + the context. This method raises the Rounded and Inexact flags + when appropriate. + + See also: to_integral_value, which does exactly the same as + this method except that it doesn't raise Inexact or Rounded. + """ + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + return Decimal(self) + if self._exp >= 0: + return Decimal(self) + if not self: + return _dec_from_triple(self._sign, deccoeff_zero, 0) + if context is None: + context = getcontext() + if rounding is None: + rounding = context.rounding + context._raise_error(Rounded) + ans = self._rescale(0, rounding) + if ans != self: + context._raise_error(Inexact) + return ans + + def to_integral_value(self, rounding=None, context=None): + """Rounds to the nearest integer, without raising inexact, rounded.""" + if context is None: + context = getcontext() + if rounding is None: + rounding = context.rounding + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + return Decimal(self) + if self._exp >= 0: + return Decimal(self) + else: + return self._rescale(0, rounding) + + # the method name changed, but we provide also the old one, for compatibility + to_integral = to_integral_value + + def sqrt(self, context=None): + """Return the square root of self.""" + + # To find the square root of a positive number: Let p be the + # desired precision and express self in the form c*100**e with + # c a positive real number and e an integer, c and e being + # chosen so that 100**(p-1) <= c < 100**p. Then the (exact) + # square root of self is sqrt(c)*10**e, and 10**(p-1) <= + # sqrt(c) < 10**p, so the closest representable Decimal at + # precision p is n*10**e where n = round_half_even(sqrt(c)), + # the closest integer to sqrt(c) with the even integer chosen + # in the case of a tie. + # + # To ensure correct rounding in all cases, we use the + # following trick: we compute the square root to an extra + # place (precision p+1 instead of precision p), rounding down. + # Then, if the result is inexact and its last digit is 0 or 5, + # we increase the last digit to 1 or 6 respectively; if it's + # exact we leave the last digit alone. Now the final round to + # p places (or fewer in the case of underflow) will round + # correctly and raise the appropriate flags. + + if context is None: + context = getcontext() + + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + if self._sign == 0: + return Decimal(self) + + if not self: + # exponent = self._exp // 2. sqrt(-0) = -0 + ans = _dec_from_triple(self._sign, deccoeff_zero, self._exp >> 1) + elif self._sign == 1: + return context._raise_error(InvalidOperation, 'sqrt(-x), x > 0') + else: + # shift to make exponent even, number of digits == 2p or 2p-1 + p = context.prec+1 + l = self._int.digit_length() + shift = l - 2*p + (self._exp & 1 != l & 1) + if shift >= 0: + c = self._int >> shift + else: + c = self._int << -shift + + # Newton's method, with starting guess of 10**p + n = deccoeff_one << p + while True: + q = c//n + if n <= q: + break + else: + n = (n + q) // deccoeff_two + + if (shift <= 0 or not self._int[:shift]) and n*n == c: + # result is exact; use ideal exponent + if shift >= 0: + ans = _dec_from_triple(0, n << -(-shift >> 1), self._exp >> 1) + else: + ans = _dec_from_triple(0, n[-shift >> 1:], self._exp >> 1) + else: + # result is inexact; fix last digit as described above + ans = _dec_from_triple(0, _fix05(n), self._exp + shift >> 1) + return ans._fix(context, rounding=ROUND_HALF_EVEN) + + def max(self, other, context=None): + """Returns the larger value. + + Like max(self, other) except if one is not a number, returns + NaN (and signals if one is sNaN). Also rounds. + """ + other = _convert_other(other, raiseit=True) + if context is None: + context = getcontext() + + # Special case: max(qNaN, number) = number + if self.is_nan() or other.is_nan(): + if self.is_qnan() and not other.is_nan(): + return other._fix(context) + elif other.is_qnan() and not self.is_nan(): + return self._fix(context) + else: + return self._check_nans(other, context) + + if self._cmp_total(other) == -1: + ans = other + else: + ans = self + return ans._fix(context) + + def min(self, other, context=None): + """Returns the smaller value. + + Like min(self, other) except if one is not a number, returns + NaN (and signals if one is sNaN). Also rounds. + """ + other = _convert_other(other, raiseit=True) + if context is None: + context = getcontext() + + # Special case: min(qNaN, number) = number + if self.is_nan() or other.is_nan(): + if self.is_qnan() and not other.is_nan(): + return other._fix(context) + elif other.is_qnan() and not self.is_nan(): + return self._fix(context) + else: + return self._check_nans(other, context) + + if self._cmp_total(other) == -1: + ans = self + else: + ans = other + return ans._fix(context) + + def _isinteger(self): + """Returns whether self is an integer""" + if self._is_special: + return False + elif not self: + return True + else: + return self._exp + _count_zeros(self._int) >= 0 + + def _iseven(self): + """Returns True if self is even. Assumes self is an integer.""" + if not self or self._exp > 0: + return True + assert self._isinteger() + return self._int[-self._exp] in even_digits + + #return str(self._int)[-1+self._exp] in '02468' + + def adjusted(self): + """Return the adjusted exponent of self""" + if self._is_special: + raise ValueError("Cannot compute adjusted exponent of an infinity or NaN") + + if self._int: + return self._exp + self._int.digit_length() - 1 + else: + # define adjusted exponent of 0 to be whatever the exponent is + return self._exp + + def canonical(self, context=None): + """Returns the same Decimal object. + + As we do not have different encodings for the same number, the + received object already is in its canonical form. + """ + return self + + def compare_signal(self, other, context=None): + """Compares self to the other operand numerically. + + It's pretty much like compare(), but all NaNs signal, with signaling + NaNs taking precedence over quiet NaNs. + """ + other = _convert_other(other, raiseit = True) + ans = self._compare_check_nans(other, context) + if ans: + return ans + return self.compare(other, context=context) + + def _cmp_total(self, other): + """Internal version of compare_total, returning integer instead of + Decimal.""" + + # compare signs; if both values are -ve, reverse and compare + # as though +ve + if self._sign != other._sign: + return [1, -1][self._sign] + elif self._sign: + self, other = other.copy_negate(), self.copy_negate() + + # classify types: finite < Inf < sNaN < qNaN + if not self._is_special: + self_type = 0 + elif self.is_infinite(): + self_type = 1 + elif self.is_snan(): + self_type = 2 + else: #self.is_qnan(): + self_type = 3 + + if not other._is_special: + other_type = 0 + elif other.is_infinite(): + other_type = 1 + elif other.is_snan(): + other_type = 2 + else: #other.is_qnan(): + other_type = 3 + + if self_type != other_type: + if self_type < other_type: + return -1 + else: + return 1 + + if self_type == 0: + # finite values: compare values, then exponents + if self != other: + return [1, -1][self < other] + elif self._exp != other._exp: + return [1, -1][self._exp < other._exp] + else: + return 0 + elif self_type == 1: + # infinities of the same sign are always equal + return 0 + else: #self_type in (2, 3): + # nans are ordered by payload + if self._payload != other._payload: + return [1, -1][self._payload < other._payload] + else: + return 0 + + def compare_total(self, other): + """Compares self to other using the abstract representations. + + This is not like the standard compare, which use their numerical + value. Note that a total ordering is defined for all possible abstract + representations. + """ + return [Dec_0, Dec_p1, Dec_n1][self._cmp_total(other)] + + def compare_total_mag(self, other): + """Compares self to other using abstract repr., ignoring sign. + + Like compare_total, but with operand's sign ignored and assumed to be 0. + """ + s = self.copy_abs() + o = other.copy_abs() + return s.compare_total(o) + + def _copy(self): + """Return a copy of self.""" + return Decimal(_Decimal.copy(self)) + + def copy_abs(self): + """Returns a copy with the sign set to 0. """ + return Decimal(_Decimal.copy_abs(self)) + + def copy_negate(self): + """Returns a copy with the sign inverted.""" + return Decimal(_Decimal.copy_negate(self)) + + def copy_sign(self, other): + """Returns self with the sign of other.""" + if other._sign == self._sign: + return self._copy() + else: + return self.copy_negate() + + def exp(self, context=None): + """Returns e ** self.""" + + if context is None: + context = getcontext() + + # exp(NaN) = NaN + ans = self._check_nan(context) + if ans: + return ans + + # exp(-Infinity) = 0; exp(Infinity) = Infinity + if self.is_infinite(): + return Dec_0 if self.is_signed() else Inf + + # exp(0) = 1 + if not self: + return Dec_p1 + + # the result is now guaranteed to be inexact (the true + # mathematical result is transcendental). There's no need to + # raise Rounded and Inexact here---they'll always be raised as + # a result of the call to _fix. + p = context.prec + adj = self.adjusted() + + # we only need to do any computation for quite a small range + # of adjusted exponents---for example, -29 <= adj <= 10 for + # the default context. For smaller exponent the result is + # indistinguishable from 1 at the given precision, while for + # larger exponent the result either overflows or underflows. + if self._sign == 0 and adj > len(str((context.Emax+1)*3)): + # overflow + ans = _dec_from_triple(0, deccoeff_one, context.Emax+1) + elif self._sign == 1 and adj > len(str((-context.Etiny()+1)*3)): + # underflow to 0 + ans = _dec_from_triple(0, deccoeff_one, context.Etiny()-1) + elif self._sign == 0 and adj < -p: + # p+1 digits; final round will raise correct flags + ans = _dec_from_triple(0, Deccoeff('1' + '0'*(p-1) + '1'), -p) + elif self._sign == 1 and adj < -p-1: + # p+1 digits; final round will raise correct flags + ans = _dec_from_triple(0, Deccoeff('9'*(p+1)), -p-1) + # general case + else: + op = _WorkRep(self) + c, e = op.int, op.exp + if op.sign == 1: + c = -c + + # compute correctly rounded result: increase precision by + # 3 digits at a time until we get an unambiguously + # roundable result + extra = 3 + while True: + coeff, exp = _dexp(c, e, p+extra) + if coeff % (5*10**(len(str(coeff))-p-1)): + break + extra += 3 + + ans = _dec_from_triple(0, Deccoeff(coeff), exp) + + # at this stage, ans should round correctly with *any* + # rounding mode, not just with ROUND_HALF_EVEN + context = context._shallow_copy() + rounding = context._set_rounding(ROUND_HALF_EVEN) + ans = ans._fix(context) + context.rounding = rounding + + return ans + + def is_canonical(self): + """Return True if self is canonical; otherwise return False. + + Currently, the encoding of a Decimal instance is always + canonical, so this method returns True for any Decimal. + """ + return True + + def is_normal(self, context=None): + """Return True if self is a normal number; otherwise return False.""" + if self._is_special or not self: + return False + if context is None: + context = getcontext() + return context.Emin <= self.adjusted() <= context.Emax + + def is_subnormal(self, context=None): + """Return True if self is subnormal; otherwise return False.""" + if self._is_special or not self: + return False + if context is None: + context = getcontext() + return self.adjusted() < context.Emin + + def _ln_exp_bound(self): + """Compute a lower bound for the adjusted exponent of self.ln(). + In other words, compute r such that self.ln() >= 10**r. Assumes + that self is finite and positive and that self != 1. + """ + + # for 0.1 <= x <= 10 we use the inequalities 1-1/x <= ln(x) <= x-1 + adj = self._exp + self._int.digit_length() - 1 + if adj >= 1: + # argument >= 10; we use 23/10 = 2.3 as a lower bound for ln(10) + return len(str(adj*23//10)) - 1 + if adj <= -2: + # argument <= 0.1 + return len(str((-1-adj)*23//10)) - 1 + op = _WorkRep(self) + c, e = op.int, op.exp + if adj == 0: + # 1 < self < 10 + num = str(c-10**-e) + den = str(c) + return len(num) - len(den) - (num < den) + # adj == -1, 0.1 <= self < 1 + return e + len(str(10**-e - c)) - 1 + + + def ln(self, context=None): + """Returns the natural (base e) logarithm of self.""" + + if context is None: + context = getcontext() + + # ln(NaN) = NaN + ans = self._check_nan(context) + if ans: + return ans + + # ln(0.0) == -Infinity + if not self: + return negInf + + # ln(1.0) == 0.0 + if self == Dec_p1: + return Dec_0 + + # ln(negative) raises InvalidOperation + if self.is_signed(): + return context._raise_error(InvalidOperation, + 'ln of a negative value') + + # ln(Infinity) = Infinity + if self.is_infinite(): + return Inf + + # result is irrational, so necessarily inexact + op = _WorkRep(self) + c, e = op.int, op.exp + p = context.prec + + # correctly rounded result: repeatedly increase precision by 3 + # until we get an unambiguously roundable result + places = p - self._ln_exp_bound() + 2 # at least p+3 places + while True: + coeff = _dlog(c, e, places) + # assert len(str(abs(coeff)))-p >= 1 + if coeff % (5*10**(len(str(abs(coeff)))-p-1)): + break + places += 3 + ans = _dec_from_triple(int(coeff<0), Deccoeff(abs(coeff)), -places) + + context = context._shallow_copy() + rounding = context._set_rounding(ROUND_HALF_EVEN) + ans = ans._fix(context) + context.rounding = rounding + return ans + + def _log10_exp_bound(self): + """Compute a lower bound for the adjusted exponent of self.log10(). + In other words, find r such that self.log10() >= 10**r. + Assumes that self is finite and positive and that self != 1. + """ + + # For x >= 10 or x < 0.1 we only need a bound on the integer + # part of log10(self), and this comes directly from the + # exponent of x. For 0.1 <= x <= 10 we use the inequalities + # 1-1/x <= log(x) <= x-1. If x > 1 we have |log10(x)| > + # (1-1/x)/2.31 > 0. If x < 1 then |log10(x)| > (1-x)/2.31 > 0 + + adj = self._exp + self._int.digit_length() - 1 + if adj >= 1: + # self >= 10 + return len(str(adj))-1 + if adj <= -2: + # self < 0.1 + return len(str(-1-adj))-1 + op = _WorkRep(self) + c, e = op.int, op.exp + if adj == 0: + # 1 < self < 10 + num = str(c-10**-e) + den = str(231*c) + return len(num) - len(den) - (num < den) + 2 + # adj == -1, 0.1 <= self < 1 + num = str(10**-e-c) + return len(num) + e - (num < "231") - 1 + + def log10(self, context=None): + """Returns the base 10 logarithm of self.""" + + if context is None: + context = getcontext() + + # log10(NaN) = NaN + ans = self._check_nan(context) + if ans: + return ans + + # log10(0.0) == -Infinity + if not self: + return negInf + + # log10(negative or -Infinity) raises InvalidOperation + if self._sign == 1: + return context._raise_error(InvalidOperation, + 'log10 of a negative value') + + # log10(Infinity) = Infinity + if self.is_infinite(): + return Inf + + # log10(10**n) = n + if (self._int >> _count_zeros(self._int)) == deccoeff_one: + # answer may need rounding + ans = Decimal(self._exp + self._int.digit_length() - 1) + else: + # result is irrational, so necessarily inexact + op = _WorkRep(self) + c, e = op.int, op.exp + p = context.prec + + # correctly rounded result: repeatedly increase precision + # until result is unambiguously roundable + places = p-self._log10_exp_bound()+2 + while True: + coeff = _dlog10(c, e, places) + # assert len(str(abs(coeff)))-p >= 1 + if coeff % (5*10**(len(str(abs(coeff)))-p-1)): + break + places += 3 + ans = _dec_from_triple(int(coeff<0), Deccoeff(abs(coeff)), -places) + + context = context._shallow_copy() + rounding = context._set_rounding(ROUND_HALF_EVEN) + ans = ans._fix(context) + context.rounding = rounding + return ans + + def logb(self, context=None): + """ Returns the exponent of the magnitude of self's MSD. + + The result is the integer which is the exponent of the magnitude + of the most significant digit of self (as though it were truncated + to a single digit while maintaining the value of that digit and + without limiting the resulting exponent). + """ + # logb(NaN) = NaN + ans = self._check_nan(context) + if ans: + return ans + + if context is None: + context = getcontext() + + # logb(+/-Inf) = +Inf + if self.is_infinite(): + return Inf + + # logb(0) = -Inf, DivisionByZero + if not self: + return context._raise_error(DivisionByZero, 'logb(0)', 1) + + # otherwise, simply return the adjusted exponent of self, as a + # Decimal. Note that no attempt is made to fit the result + # into the current context. + return Decimal(self.adjusted()) + + def _is_logical(self): + if self._is_special: + return False + if not(self._sign == self._exp == 0): + return False + coeff = self._int + for i in range(coeff.digit_length()): + if coeff[i] not in (deccoeff_zero, deccoeff_one): + return False + return True + + def logical_and(self, other, context=None): + """Applies an 'and' operation between self and other's digits.""" + if context is None: + context = getcontext() + if not self._is_logical() or not other._is_logical(): + return context._raise_error(InvalidOperation) + acc = deccoeff_zero + for i in range(context.prec): + if self._int[i] and other._int[i]: + acc += deccoeff_one << i + return _dec_from_triple(0, acc, 0); + + def logical_invert(self, context=None): + """Invert all its digits.""" + if context is None: + context = getcontext() + if not self._is_logical(): + return context._raise_error(InvalidOperation) + acc = deccoeff_zero + for i in range(context.prec): + if not self._int[i]: + acc += deccoeff_one << i + return _dec_from_triple(0, acc, 0) + + def logical_or(self, other, context=None): + """Applies an 'or' operation between self and other's digits.""" + if context is None: + context = getcontext() + if not self._is_logical() or not other._is_logical(): + return context._raise_error(InvalidOperation) + acc = deccoeff_zero + for i in range(context.prec): + if self._int[i] or other._int[i]: + acc += deccoeff_one << i + return _dec_from_triple(0, acc, 0); + + def logical_xor(self, other, context=None): + """Applies an 'xor' operation between self and other's digits.""" + if context is None: + context = getcontext() + if not self._is_logical() or not other._is_logical(): + return context._raise_error(InvalidOperation) + acc = deccoeff_zero + for i in range(context.prec): + if (self._int[i] and not other._int[i] or + not self._int[i] and other._int[i]): + acc += deccoeff_one << i + return _dec_from_triple(0, acc, 0); + + def max_mag(self, other, context=None): + """Compares the values numerically with their sign ignored.""" + other = _convert_other(other, raiseit=True) + if context is None: + context = getcontext() + + if self.is_nan() or other.is_nan(): + if self.is_qnan() and not other.is_nan(): + return other._fix(context) + elif other.is_qnan() and not self.is_nan(): + return self._fix(context) + else: + return self._check_nans(other, context) + + c = self.copy_abs()._cmp(other.copy_abs()) or self._cmp_total(other) + if c == -1: + ans = other + else: + ans = self + return ans._fix(context) + + def min_mag(self, other, context=None): + """Compares the values numerically with their sign ignored.""" + other = _convert_other(other, raiseit=True) + + if context is None: + context = getcontext() + + if self.is_nan() or other.is_nan(): + if self.is_qnan() and not other.is_nan(): + return other._fix(context) + elif other.is_qnan() and not self.is_nan(): + return self._fix(context) + else: + return self._check_nans(other, context) + + c = self.copy_abs()._cmp(other.copy_abs()) or self._cmp_total(other) + if c == -1: + ans = self + else: + ans = other + return ans._fix(context) + + def _next_up(self, context): + """Returns the next higher (i.e. further away from 0) Decimal + that's representable in the given context. + + Assumes that self is nonzero and nonspecial. + """ + p = context.prec + Etiny = context.Etiny() + exp = max(self._exp + self._int.digit_length() - p, Etiny) + if exp > self._exp: + coeff = (self._int >> (exp - self._exp)) + deccoeff_one + else: + coeff = (self._int << (self._exp - exp)) + deccoeff_one + if coeff.digit_length() > p: + coeff = coeff[1:] + exp += 1 + if exp > context.Etop(): + return Infsign[self._sign] + return _dec_from_triple(self._sign, coeff, exp) + + def _next_down(self, context): + """Return the next lower (i.e. closer to 0) Decimal + that's representable in the given context. + + Assumes that self is nonzero and nonspecial.""" + # assumes that self is nonzero and nonspecial + p = context.prec + Etiny = context.Etiny() + exp = max(self._exp + self._int.digit_length() - p, Etiny) + if exp > context.Etop(): + return context._max_normal(self._sign) + + # truncate to nearest representable decimal + expdiff = exp - self._exp + if expdiff > 0: + coeff = self._int >> expdiff + else: + coeff = self._int << -expdiff + + # if truncation didn't change the value, decrement the coefficient + if expdiff <= 0 or not self._int[:expdiff]: + coeff = coeff - deccoeff_one + if exp > Etiny and coeff.digit_length() < p: + coeff = (coeff << 1) + deccoeff_nine + exp -= 1 + + return _dec_from_triple(self._sign, coeff, exp) + + def next_minus(self, context=None): + """Returns the largest representable number smaller than itself.""" + if context is None: + context = getcontext() + + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + if self._sign == 1: + return negInf + else: + return context._max_normal(0) + elif not self: + return context._min_subnormal(1) + elif self._sign == 1: + return self._next_up(context) + else: + return self._next_down(context) + + def next_plus(self, context=None): + """Returns the smallest representable number larger than itself.""" + if context is None: + context = getcontext() + + if self._is_special: + ans = self._check_nan(context) + if ans: + return ans + if self._sign == 0: + return Inf + return context._max_normal(1) + elif not self: + return context._min_subnormal(0) + elif self._sign == 0: + return self._next_up(context) + else: + return self._next_down(context) + + def next_toward(self, other, context=None): + """Returns the number closest to self, in the direction towards other. + + The result is the closest representable number to self + (excluding self) that is in the direction towards other, + unless both have the same value. If the two operands are + numerically equal, then the result is a copy of self with the + sign set to be the same as the sign of other. + """ + other = _convert_other(other, raiseit=True) + + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return ans + + comparison = self._cmp(other) + if comparison == 0: + return self.copy_sign(other) + + if comparison == -1: + ans = self.next_plus(context) + else: # comparison == 1 + ans = self.next_minus(context) + + # decide which flags to raise using value of ans + if ans.is_infinite(): + context._raise_error(Overflow, + 'Infinite result from next_toward', + ans._sign) + context._raise_error(Rounded) + context._raise_error(Inexact) + elif ans.adjusted() < context.Emin: + context._raise_error(Underflow) + context._raise_error(Subnormal) + context._raise_error(Rounded) + context._raise_error(Inexact) + # if precision == 1 then we don't raise Clamped for a + # result 0E-Etiny. + if not ans: + context._raise_error(Clamped) + + return ans + + def number_class(self, context=None): + """Returns an indication of the class of self. + + The class is one of the following strings: + sNaN + NaN + -Infinity + -Normal + -Subnormal + -Zero + +Zero + +Subnormal + +Normal + +Infinity + """ + if self.is_nan(): + if self.is_snan(): + return "sNaN" + else: + return "NaN" + if self.is_infinite(): + if self.is_signed(): + return "-Infinity" + else: + return "+Infinity" + if self.is_zero(): + if self.is_signed(): + return "-Zero" + else: + return "+Zero" + if context is None: + context = getcontext() + if self.is_subnormal(context=context): + if self.is_signed(): + return "-Subnormal" + else: + return "+Subnormal" + # just a normal, regular, boring number, :) + if self.is_signed(): + return "-Normal" + else: + return "+Normal" + + def radix(self): + """Just returns 10, as this is Decimal, :)""" + return Decimal(10) + + def rotate(self, other, context=None): + """Returns a rotated copy of self, value-of-other times.""" + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return ans + + if other._is_special or other._exp != 0: + return context._raise_error(InvalidOperation) + + torot = int(other) + if not (-context.prec <= torot <= context.prec): + return context._raise_error(InvalidOperation) + + if self.is_infinite(): + return Decimal(self) + + if torot < 0: + torot += context.prec + + rotated_high = self._int[:context.prec-torot] << torot + rotated_low = self._int[context.prec-torot:context.prec] + return _dec_from_triple(self._sign, rotated_high + rotated_low, self._exp) + + def scaleb (self, other, context=None): + """Returns self operand after adding the second value to its exp.""" + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return ans + + if other._is_special or other._exp != 0: + return context._raise_error(InvalidOperation) + liminf = -2 * (context.Emax + context.prec) + limsup = 2 * (context.Emax + context.prec) + if not (liminf <= int(other) <= limsup): + return context._raise_error(InvalidOperation) + + if self.is_infinite(): + return Decimal(self) + + d = _dec_from_triple(self._sign, self._int, self._exp + int(other)) + d = d._fix(context) + return d + + def shift(self, other, context=None): + """Returns a shifted copy of self, value-of-other times.""" + if context is None: + context = getcontext() + + ans = self._check_nans(other, context) + if ans: + return ans + + if other._is_special or other._exp != 0: + return context._raise_error(InvalidOperation) + toshift = int(other) + if not (-context.prec <= toshift <= context.prec): + return context._raise_error(InvalidOperation) + + if self.is_infinite(): + return Decimal(self) + + if toshift < 0: + shifted = self._int[-toshift:context.prec] + else: + shifted = self._int[:context.prec-toshift] << toshift + + return _dec_from_triple(self._sign, shifted, self._exp) + + # Support for pickling, copy, and deepcopy + def __reduce__(self): + return (self.__class__, (str(self),)) + + def __copy__(self): + if type(self) == Decimal: + return self # I'm immutable; therefore I am my own clone + return self.__class__(str(self)) + + def __deepcopy__(self, memo): + if type(self) == Decimal: + return self # My components are also immutable + return self.__class__(str(self)) + + # PEP 3101 support. See also _parse_format_specifier and _format_align + def __format__(self, specifier, context=None): + """Format a Decimal instance according to the given specifier. + + The specifier should be a standard format specifier, with the + form described in PEP 3101. Formatting types 'e', 'E', 'f', + 'F', 'g', 'G', and '%' are supported. If the formatting type + is omitted it defaults to 'g' or 'G', depending on the value + of context.capitals. + + At this time the 'n' format specifier type (which is supposed + to use the current locale) is not supported. + """ + + # Note: PEP 3101 says that if the type is not present then + # there should be at least one digit after the decimal point. + # We take the liberty of ignoring this requirement for + # Decimal---it's presumably there to make sure that + # format(float, '') behaves similarly to str(float). + if context is None: + context = getcontext() + + spec = _parse_format_specifier(specifier) + + # special values don't care about the type or precision... + if self._is_special: + return _format_align(str(self), spec) + + # a type of None defaults to 'g' or 'G', depending on context + # if type is '%', adjust exponent of self accordingly + if spec['type'] is None: + spec['type'] = ['g', 'G'][context.capitals] + elif spec['type'] == '%': + self = _dec_from_triple(self._sign, self._int, self._exp+2) + + # round if necessary, taking rounding mode from the context + rounding = context.rounding + precision = spec['precision'] + if precision is not None: + if spec['type'] in 'eE': + self = self._round(precision+1, rounding) + elif spec['type'] in 'gG': + if self._int.digit_length() > precision: + self = self._round(precision, rounding) + elif spec['type'] in 'fF%': + self = self._rescale(-precision, rounding) + # special case: zeros with a positive exponent can't be + # represented in fixed point; rescale them to 0e0. + elif not self and self._exp > 0 and spec['type'] in 'fF%': + self = self._rescale(0, rounding) + + # figure out placement of the decimal point + if self._int: + coeff = str(self._int) + else: + coeff = '0' + leftdigits = self._exp + len(coeff) + if spec['type'] in 'fF%': + dotplace = leftdigits + elif spec['type'] in 'eE': + if not self and precision is not None: + dotplace = 1 - precision + else: + dotplace = 1 + elif spec['type'] in 'gG': + if self._exp <= 0 and leftdigits > -6: + dotplace = leftdigits + else: + dotplace = 1 + + # figure out main part of numeric string... + if dotplace <= 0: + num = '0.' + '0'*(-dotplace) + coeff + elif dotplace >= len(coeff): + # make sure we're not padding a '0' with extra zeros on the right + assert dotplace==len(coeff) or coeff != '0' + num = coeff + '0'*(dotplace-len(coeff)) + else: + num = coeff[:dotplace] + '.' + coeff[dotplace:] + + # ...then the trailing exponent, or trailing '%' + if leftdigits != dotplace or spec['type'] in 'eE': + echar = {'E': 'E', 'e': 'e', 'G': 'E', 'g': 'e'}[spec['type']] + num = num + "{0}{1:+}".format(echar, leftdigits-dotplace) + elif spec['type'] == '%': + num = num + '%' + + # add sign + if self._sign == 1: + num = '-' + num + return _format_align(num, spec) + + +def _dec_from_triple(sign, coefficient, exponent, special=False): + """Create a decimal instance directly, without any validation, + normalization (e.g. removal of leading zeros) or argument + conversion. + + This function is for *internal use only*. + """ + + assert type(coefficient) is Deccoeff + assert not special + return Decimal._finite(sign, coefficient, exponent) + +##### Context class ####################################################### + + +# get rounding method function: +rounding_functions = [name for name in Decimal.__dict__.keys() + if name.startswith('_round_')] +for name in rounding_functions: + # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value. + globalname = name[1:].upper() + val = globals()[globalname] + Decimal._pick_rounding_function[val] = name + +del name, val, globalname, rounding_functions + +class _ContextManager(object): + """Context manager class to support localcontext(). + + Sets a copy of the supplied context in __enter__() and restores + the previous decimal context in __exit__() + """ + def __init__(self, new_context): + self.new_context = new_context.copy() + def __enter__(self): + self.saved_context = getcontext() + setcontext(self.new_context) + return self.new_context + def __exit__(self, t, v, tb): + setcontext(self.saved_context) + +class Context(object): + """Contains the context for a Decimal instance. + + Contains: + prec - precision (for use in rounding, division, square roots..) + rounding - rounding type (how you round) + traps - If traps[exception] = 1, then the exception is + raised when it is caused. Otherwise, a value is + substituted in. + flags - When an exception is caused, flags[exception] is set. + (Whether or not the trap_enabler is set) + Should be reset by user of Decimal instance. + Emin - Minimum exponent + Emax - Maximum exponent + capitals - If 1, 1*10^1 is printed as 1E+1. + If 0, printed as 1e1 + _clamp - If 1, change exponents if too high (Default 0) + """ + + def __init__(self, prec=None, rounding=None, + traps=None, flags=None, + Emin=None, Emax=None, + capitals=None, _clamp=0): + if flags is None: + flags = [] + if not isinstance(flags, dict): + flags = dict([(s, int(s in flags)) for s in _signals]) + if traps is not None and not isinstance(traps, dict): + traps = dict([(s, int(s in traps)) for s in _signals]) + for name, val in locals().items(): + if val is None: + setattr(self, name, _copy.copy(getattr(DefaultContext, name))) + else: + setattr(self, name, val) + del self.self + + def __repr__(self): + """Show the current context.""" + s = [] + s.append('Context(prec=%(prec)d, rounding=%(rounding)s, ' + 'Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d' + % vars(self)) + names = [f.__name__ for f, v in self.flags.items() if v] + s.append('flags=[' + ', '.join(names) + ']') + names = [t.__name__ for t, v in self.traps.items() if v] + s.append('traps=[' + ', '.join(names) + ']') + return ', '.join(s) + ')' + + def clear_flags(self): + """Reset all flags to zero""" + for flag in self.flags: + self.flags[flag] = 0 + + def _shallow_copy(self): + """Returns a shallow copy from self.""" + nc = Context(self.prec, self.rounding, self.traps, + self.flags, self.Emin, self.Emax, + self.capitals, self._clamp) + return nc + + def copy(self): + """Returns a deep copy from self.""" + nc = Context(self.prec, self.rounding, self.traps.copy(), + self.flags.copy(), self.Emin, self.Emax, + self.capitals, self._clamp) + return nc + __copy__ = copy + + def _raise_error(self, condition, explanation = None, *args): + """Handles an error + + Sets the flag, then, if the corresponding trap_enabler is set, + it raises the exception. Otherwise, it returns the default + value after setting the flag. + """ + error = _condition_map.get(condition, condition) + self.flags[error] = 1 + if not self.traps[error]: + # The errors define how to handle themselves. + return condition().handle(self, *args) + + # Errors should only be risked on copies of the context + raise error(explanation) + + # We inherit object.__hash__, so we must deny this explicitly + __hash__ = None + + def Etiny(self): + """Returns Etiny (= Emin - prec + 1)""" + return int(self.Emin - self.prec + 1) + + def Etop(self): + """Returns maximum exponent (= Emax - prec + 1)""" + return int(self.Emax - self.prec + 1) + + def _max_normal(self, sign=0): + """Return the maximum normal number representable in this context.""" + coeff = (deccoeff_one << self.prec) - deccoeff_one + return _dec_from_triple(sign, coeff, self.Emax - self.prec + 1) + + def _min_normal(self, sign=0): + """Return the minimum positive normal number in this context.""" + return _dec_from_triple(sign, deccoeff_one, self.Emin) + + def _min_subnormal(self, sign=0): + """Return the minimum positive subnormal number in this context.""" + return _dec_from_triple(sign, deccoeff_one, self.Emin - self.prec + 1) + + def _set_rounding(self, type): + """Sets the rounding type. + + Sets the rounding type, and returns the current (previous) + rounding type. Often used like: + + context = context.copy() + # so you don't change the calling context + # if an error occurs in the middle. + rounding = context._set_rounding(ROUND_UP) + val = self.__sub__(other, context=context) + context._set_rounding(rounding) + + This will make it round up for that operation. + """ + rounding = self.rounding + self.rounding= type + return rounding + + def create_decimal(self, num='0'): + """Creates a new Decimal instance but using self as context. + + This method implements the to-number operation of the + IBM Decimal specification.""" + + if isinstance(num, str) and num != num.strip(): + return self._raise_error(ConversionSyntax, + "no trailing or leading whitespace is " + "permitted.") + d = Decimal(num, context=self) + if d.is_nan() and d._payload.digit_length() + self._clamp > self.prec: + return self._raise_error(ConversionSyntax, + "diagnostic info too long in NaN") + return d._fix(self) + + def create_decimal_from_float(self, f): + """Creates a new Decimal instance from a float but rounding using self + as the context. + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(3.1415926535897932) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(3.1415926535897932) + Traceback (most recent call last): + ... + decimal.Inexact: None + + """ + d = Decimal.from_float(f) # An exact conversion + return d._fix(self) # Apply the context rounding + + # Methods + def abs(self, a): + """Returns the absolute value of the operand. + + If the operand is negative, the result is the same as using the minus + operation on the operand. Otherwise, the result is the same as using + the plus operation on the operand. + + >>> ExtendedContext.abs(Decimal('2.1')) + Decimal('2.1') + >>> ExtendedContext.abs(Decimal('-100')) + Decimal('100') + >>> ExtendedContext.abs(Decimal('101.5')) + Decimal('101.5') + >>> ExtendedContext.abs(Decimal('-101.5')) + Decimal('101.5') + """ + return a.__abs__(context=self) + + def add(self, a, b): + """Return the sum of the two operands. + + >>> ExtendedContext.add(Decimal('12'), Decimal('7.00')) + Decimal('19.00') + >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4')) + Decimal('1.02E+4') + """ + return a.__add__(b, context=self) + + def _apply(self, a): + return str(a._fix(self)) + + def canonical(self, a): + """Returns the same Decimal object. + + As we do not have different encodings for the same number, the + received object already is in its canonical form. + + >>> ExtendedContext.canonical(Decimal('2.50')) + Decimal('2.50') + """ + return a.canonical(context=self) + + def compare(self, a, b): + """Compares values numerically. + + If the signs of the operands differ, a value representing each operand + ('-1' if the operand is less than zero, '0' if the operand is zero or + negative zero, or '1' if the operand is greater than zero) is used in + place of that operand for the comparison instead of the actual + operand. + + The comparison is then effected by subtracting the second operand from + the first and then returning a value according to the result of the + subtraction: '-1' if the result is less than zero, '0' if the result is + zero or negative zero, or '1' if the result is greater than zero. + + >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3')) + Decimal('-1') + >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1')) + Decimal('0') + >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10')) + Decimal('0') + >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1')) + Decimal('1') + >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3')) + Decimal('1') + >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1')) + Decimal('-1') + """ + return a.compare(b, context=self) + + def compare_signal(self, a, b): + """Compares the values of the two operands numerically. + + It's pretty much like compare(), but all NaNs signal, with signaling + NaNs taking precedence over quiet NaNs. + + >>> c = ExtendedContext + >>> c.compare_signal(Decimal('2.1'), Decimal('3')) + Decimal('-1') + >>> c.compare_signal(Decimal('2.1'), Decimal('2.1')) + Decimal('0') + >>> c.flags[InvalidOperation] = 0 + >>> print(c.flags[InvalidOperation]) + 0 + >>> c.compare_signal(Decimal('NaN'), Decimal('2.1')) + Decimal('NaN') + >>> print(c.flags[InvalidOperation]) + 1 + >>> c.flags[InvalidOperation] = 0 + >>> print(c.flags[InvalidOperation]) + 0 + >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1')) + Decimal('NaN') + >>> print(c.flags[InvalidOperation]) + 1 + """ + return a.compare_signal(b, context=self) + + def compare_total(self, a, b): + """Compares two operands using their abstract representation. + + This is not like the standard compare, which use their numerical + value. Note that a total ordering is defined for all possible abstract + representations. + + >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9')) + Decimal('-1') + >>> ExtendedContext.compare_total(Decimal('-127'), Decimal('12')) + Decimal('-1') + >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3')) + Decimal('-1') + >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30')) + Decimal('0') + >>> ExtendedContext.compare_total(Decimal('12.3'), Decimal('12.300')) + Decimal('1') + >>> ExtendedContext.compare_total(Decimal('12.3'), Decimal('NaN')) + Decimal('-1') + """ + return a.compare_total(b) + + def compare_total_mag(self, a, b): + """Compares two operands using their abstract representation ignoring sign. + + Like compare_total, but with operand's sign ignored and assumed to be 0. + """ + return a.compare_total_mag(b) + + def copy_abs(self, a): + """Returns a copy of the operand with the sign set to 0. + + >>> ExtendedContext.copy_abs(Decimal('2.1')) + Decimal('2.1') + >>> ExtendedContext.copy_abs(Decimal('-100')) + Decimal('100') + """ + return a.copy_abs() + + def copy_decimal(self, a): + """Returns a copy of the decimal objet. + + >>> ExtendedContext.copy_decimal(Decimal('2.1')) + Decimal('2.1') + >>> ExtendedContext.copy_decimal(Decimal('-1.00')) + Decimal('-1.00') + """ + return Decimal(a) + + def copy_negate(self, a): + """Returns a copy of the operand with the sign inverted. + + >>> ExtendedContext.copy_negate(Decimal('101.5')) + Decimal('-101.5') + >>> ExtendedContext.copy_negate(Decimal('-101.5')) + Decimal('101.5') + """ + return a.copy_negate() + + def copy_sign(self, a, b): + """Copies the second operand's sign to the first one. + + In detail, it returns a copy of the first operand with the sign + equal to the sign of the second operand. + + >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33')) + Decimal('1.50') + >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33')) + Decimal('1.50') + >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33')) + Decimal('-1.50') + >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33')) + Decimal('-1.50') + """ + return a.copy_sign(b) + + def divide(self, a, b): + """Decimal division in a specified context. + + >>> ExtendedContext.divide(Decimal('1'), Decimal('3')) + Decimal('0.333333333') + >>> ExtendedContext.divide(Decimal('2'), Decimal('3')) + Decimal('0.666666667') + >>> ExtendedContext.divide(Decimal('5'), Decimal('2')) + Decimal('2.5') + >>> ExtendedContext.divide(Decimal('1'), Decimal('10')) + Decimal('0.1') + >>> ExtendedContext.divide(Decimal('12'), Decimal('12')) + Decimal('1') + >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2')) + Decimal('4.00') + >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0')) + Decimal('1.20') + >>> ExtendedContext.divide(Decimal('1000'), Decimal('100')) + Decimal('10') + >>> ExtendedContext.divide(Decimal('1000'), Decimal('1')) + Decimal('1000') + >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2')) + Decimal('1.20E+6') + """ + return a.__div__(b, context=self) + + def divide_int(self, a, b): + """Divides two numbers and returns the integer part of the result. + + >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3')) + Decimal('0') + >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3')) + Decimal('3') + >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3')) + Decimal('3') + """ + return a.__floordiv__(b, context=self) + + def divmod(self, a, b): + return a.__divmod__(b, context=self) + + def exp(self, a): + """Returns e ** a. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.exp(Decimal('-Infinity')) + Decimal('0') + >>> c.exp(Decimal('-1')) + Decimal('0.367879441') + >>> c.exp(Decimal('0')) + Decimal('1') + >>> c.exp(Decimal('1')) + Decimal('2.71828183') + >>> c.exp(Decimal('0.693147181')) + Decimal('2.00000000') + >>> c.exp(Decimal('+Infinity')) + Decimal('Infinity') + """ + return a.exp(context=self) + + def fma(self, a, b, c): + """Returns a multiplied by b, plus c. + + The first two operands are multiplied together, using multiply, + the third operand is then added to the result of that + multiplication, using add, all with only one final rounding. + + >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7')) + Decimal('22') + >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7')) + Decimal('-8') + >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578')) + Decimal('1.38435736E+12') + """ + return a.fma(b, c, context=self) + + def is_canonical(self, a): + """Return True if the operand is canonical; otherwise return False. + + Currently, the encoding of a Decimal instance is always + canonical, so this method returns True for any Decimal. + + >>> ExtendedContext.is_canonical(Decimal('2.50')) + True + """ + return a.is_canonical() + + def is_finite(self, a): + """Return True if the operand is finite; otherwise return False. + + A Decimal instance is considered finite if it is neither + infinite nor a NaN. + + >>> ExtendedContext.is_finite(Decimal('2.50')) + True + >>> ExtendedContext.is_finite(Decimal('-0.3')) + True + >>> ExtendedContext.is_finite(Decimal('0')) + True + >>> ExtendedContext.is_finite(Decimal('Inf')) + False + >>> ExtendedContext.is_finite(Decimal('NaN')) + False + """ + return a.is_finite() + + def is_infinite(self, a): + """Return True if the operand is infinite; otherwise return False. + + >>> ExtendedContext.is_infinite(Decimal('2.50')) + False + >>> ExtendedContext.is_infinite(Decimal('-Inf')) + True + >>> ExtendedContext.is_infinite(Decimal('NaN')) + False + """ + return a.is_infinite() + + def is_nan(self, a): + """Return True if the operand is a qNaN or sNaN; + otherwise return False. + + >>> ExtendedContext.is_nan(Decimal('2.50')) + False + >>> ExtendedContext.is_nan(Decimal('NaN')) + True + >>> ExtendedContext.is_nan(Decimal('-sNaN')) + True + """ + return a.is_nan() + + def is_normal(self, a): + """Return True if the operand is a normal number; + otherwise return False. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.is_normal(Decimal('2.50')) + True + >>> c.is_normal(Decimal('0.1E-999')) + False + >>> c.is_normal(Decimal('0.00')) + False + >>> c.is_normal(Decimal('-Inf')) + False + >>> c.is_normal(Decimal('NaN')) + False + """ + return a.is_normal(context=self) + + def is_qnan(self, a): + """Return True if the operand is a quiet NaN; otherwise return False. + + >>> ExtendedContext.is_qnan(Decimal('2.50')) + False + >>> ExtendedContext.is_qnan(Decimal('NaN')) + True + >>> ExtendedContext.is_qnan(Decimal('sNaN')) + False + """ + return a.is_qnan() + + def is_signed(self, a): + """Return True if the operand is negative; otherwise return False. + + >>> ExtendedContext.is_signed(Decimal('2.50')) + False + >>> ExtendedContext.is_signed(Decimal('-12')) + True + >>> ExtendedContext.is_signed(Decimal('-0')) + True + """ + return a.is_signed() + + def is_snan(self, a): + """Return True if the operand is a signaling NaN; + otherwise return False. + + >>> ExtendedContext.is_snan(Decimal('2.50')) + False + >>> ExtendedContext.is_snan(Decimal('NaN')) + False + >>> ExtendedContext.is_snan(Decimal('sNaN')) + True + """ + return a.is_snan() + + def is_subnormal(self, a): + """Return True if the operand is subnormal; otherwise return False. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.is_subnormal(Decimal('2.50')) + False + >>> c.is_subnormal(Decimal('0.1E-999')) + True + >>> c.is_subnormal(Decimal('0.00')) + False + >>> c.is_subnormal(Decimal('-Inf')) + False + >>> c.is_subnormal(Decimal('NaN')) + False + """ + return a.is_subnormal(context=self) + + def is_zero(self, a): + """Return True if the operand is a zero; otherwise return False. + + >>> ExtendedContext.is_zero(Decimal('0')) + True + >>> ExtendedContext.is_zero(Decimal('2.50')) + False + >>> ExtendedContext.is_zero(Decimal('-0E+2')) + True + """ + return a.is_zero() + + def ln(self, a): + """Returns the natural (base e) logarithm of the operand. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.ln(Decimal('0')) + Decimal('-Infinity') + >>> c.ln(Decimal('1.000')) + Decimal('0') + >>> c.ln(Decimal('2.71828183')) + Decimal('1.00000000') + >>> c.ln(Decimal('10')) + Decimal('2.30258509') + >>> c.ln(Decimal('+Infinity')) + Decimal('Infinity') + """ + return a.ln(context=self) + + def log10(self, a): + """Returns the base 10 logarithm of the operand. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.log10(Decimal('0')) + Decimal('-Infinity') + >>> c.log10(Decimal('0.001')) + Decimal('-3') + >>> c.log10(Decimal('1.000')) + Decimal('0') + >>> c.log10(Decimal('2')) + Decimal('0.301029996') + >>> c.log10(Decimal('10')) + Decimal('1') + >>> c.log10(Decimal('70')) + Decimal('1.84509804') + >>> c.log10(Decimal('+Infinity')) + Decimal('Infinity') + """ + return a.log10(context=self) + + def logb(self, a): + """ Returns the exponent of the magnitude of the operand's MSD. + + The result is the integer which is the exponent of the magnitude + of the most significant digit of the operand (as though the + operand were truncated to a single digit while maintaining the + value of that digit and without limiting the resulting exponent). + + >>> ExtendedContext.logb(Decimal('250')) + Decimal('2') + >>> ExtendedContext.logb(Decimal('2.50')) + Decimal('0') + >>> ExtendedContext.logb(Decimal('0.03')) + Decimal('-2') + >>> ExtendedContext.logb(Decimal('0')) + Decimal('-Infinity') + """ + return a.logb(context=self) + + def logical_and(self, a, b): + """Applies the logical operation 'and' between each operand's digits. + + The operands must be both logical numbers. + + >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0')) + Decimal('0') + >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1')) + Decimal('0') + >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0')) + Decimal('0') + >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1')) + Decimal('1') + >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010')) + Decimal('1000') + >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10')) + Decimal('10') + """ + return a.logical_and(b, context=self) + + def logical_invert(self, a): + """Invert all the digits in the operand. + + The operand must be a logical number. + + >>> ExtendedContext.logical_invert(Decimal('0')) + Decimal('111111111') + >>> ExtendedContext.logical_invert(Decimal('1')) + Decimal('111111110') + >>> ExtendedContext.logical_invert(Decimal('111111111')) + Decimal('0') + >>> ExtendedContext.logical_invert(Decimal('101010101')) + Decimal('10101010') + """ + return a.logical_invert(context=self) + + def logical_or(self, a, b): + """Applies the logical operation 'or' between each operand's digits. + + The operands must be both logical numbers. + + >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0')) + Decimal('0') + >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1')) + Decimal('1') + >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0')) + Decimal('1') + >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1')) + Decimal('1') + >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010')) + Decimal('1110') + >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10')) + Decimal('1110') + """ + return a.logical_or(b, context=self) + + def logical_xor(self, a, b): + """Applies the logical operation 'xor' between each operand's digits. + + The operands must be both logical numbers. + + >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0')) + Decimal('0') + >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1')) + Decimal('1') + >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0')) + Decimal('1') + >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1')) + Decimal('0') + >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010')) + Decimal('110') + >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10')) + Decimal('1101') + """ + return a.logical_xor(b, context=self) + + def max(self, a,b): + """max compares two values numerically and returns the maximum. + + If either operand is a NaN then the general rules apply. + Otherwise, the operands are compared as though by the compare + operation. If they are numerically equal then the left-hand operand + is chosen as the result. Otherwise the maximum (closer to positive + infinity) of the two operands is chosen as the result. + + >>> ExtendedContext.max(Decimal('3'), Decimal('2')) + Decimal('3') + >>> ExtendedContext.max(Decimal('-10'), Decimal('3')) + Decimal('3') + >>> ExtendedContext.max(Decimal('1.0'), Decimal('1')) + Decimal('1') + >>> ExtendedContext.max(Decimal('7'), Decimal('NaN')) + Decimal('7') + """ + return a.max(b, context=self) + + def max_mag(self, a, b): + """Compares the values numerically with their sign ignored.""" + return a.max_mag(b, context=self) + + def min(self, a,b): + """min compares two values numerically and returns the minimum. + + If either operand is a NaN then the general rules apply. + Otherwise, the operands are compared as though by the compare + operation. If they are numerically equal then the left-hand operand + is chosen as the result. Otherwise the minimum (closer to negative + infinity) of the two operands is chosen as the result. + + >>> ExtendedContext.min(Decimal('3'), Decimal('2')) + Decimal('2') + >>> ExtendedContext.min(Decimal('-10'), Decimal('3')) + Decimal('-10') + >>> ExtendedContext.min(Decimal('1.0'), Decimal('1')) + Decimal('1.0') + >>> ExtendedContext.min(Decimal('7'), Decimal('NaN')) + Decimal('7') + """ + return a.min(b, context=self) + + def min_mag(self, a, b): + """Compares the values numerically with their sign ignored.""" + return a.min_mag(b, context=self) + + def minus(self, a): + """Minus corresponds to unary prefix minus in Python. + + The operation is evaluated using the same rules as subtract; the + operation minus(a) is calculated as subtract('0', a) where the '0' + has the same exponent as the operand. + + >>> ExtendedContext.minus(Decimal('1.3')) + Decimal('-1.3') + >>> ExtendedContext.minus(Decimal('-1.3')) + Decimal('1.3') + """ + return a.__neg__(context=self) + + def multiply(self, a, b): + """multiply multiplies two operands. + + If either operand is a special value then the general rules apply. + Otherwise, the operands are multiplied together ('long multiplication'), + resulting in a number which may be as long as the sum of the lengths + of the two operands. + + >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3')) + Decimal('3.60') + >>> ExtendedContext.multiply(Decimal('7'), Decimal('3')) + Decimal('21') + >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8')) + Decimal('0.72') + >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0')) + Decimal('-0.0') + >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321')) + Decimal('4.28135971E+11') + """ + return a.__mul__(b, context=self) + + def next_minus(self, a): + """Returns the largest representable number smaller than a. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> ExtendedContext.next_minus(Decimal('1')) + Decimal('0.999999999') + >>> c.next_minus(Decimal('1E-1007')) + Decimal('0E-1007') + >>> ExtendedContext.next_minus(Decimal('-1.00000003')) + Decimal('-1.00000004') + >>> c.next_minus(Decimal('Infinity')) + Decimal('9.99999999E+999') + """ + return a.next_minus(context=self) + + def next_plus(self, a): + """Returns the smallest representable number larger than a. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> ExtendedContext.next_plus(Decimal('1')) + Decimal('1.00000001') + >>> c.next_plus(Decimal('-1E-1007')) + Decimal('-0E-1007') + >>> ExtendedContext.next_plus(Decimal('-1.00000003')) + Decimal('-1.00000002') + >>> c.next_plus(Decimal('-Infinity')) + Decimal('-9.99999999E+999') + """ + return a.next_plus(context=self) + + def next_toward(self, a, b): + """Returns the number closest to a, in direction towards b. + + The result is the closest representable number from the first + operand (but not the first operand) that is in the direction + towards the second operand, unless the operands have the same + value. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.next_toward(Decimal('1'), Decimal('2')) + Decimal('1.00000001') + >>> c.next_toward(Decimal('-1E-1007'), Decimal('1')) + Decimal('-0E-1007') + >>> c.next_toward(Decimal('-1.00000003'), Decimal('0')) + Decimal('-1.00000002') + >>> c.next_toward(Decimal('1'), Decimal('0')) + Decimal('0.999999999') + >>> c.next_toward(Decimal('1E-1007'), Decimal('-100')) + Decimal('0E-1007') + >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10')) + Decimal('-1.00000004') + >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000')) + Decimal('-0.00') + """ + return a.next_toward(b, context=self) + + def normalize(self, a): + """normalize reduces an operand to its simplest form. + + Essentially a plus operation with all trailing zeros removed from the + result. + + >>> ExtendedContext.normalize(Decimal('2.1')) + Decimal('2.1') + >>> ExtendedContext.normalize(Decimal('-2.0')) + Decimal('-2') + >>> ExtendedContext.normalize(Decimal('1.200')) + Decimal('1.2') + >>> ExtendedContext.normalize(Decimal('-120')) + Decimal('-1.2E+2') + >>> ExtendedContext.normalize(Decimal('120.00')) + Decimal('1.2E+2') + >>> ExtendedContext.normalize(Decimal('0.00')) + Decimal('0') + """ + return a.normalize(context=self) + + def number_class(self, a): + """Returns an indication of the class of the operand. + + The class is one of the following strings: + -sNaN + -NaN + -Infinity + -Normal + -Subnormal + -Zero + +Zero + +Subnormal + +Normal + +Infinity + + >>> c = Context(ExtendedContext) + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.number_class(Decimal('Infinity')) + '+Infinity' + >>> c.number_class(Decimal('1E-10')) + '+Normal' + >>> c.number_class(Decimal('2.50')) + '+Normal' + >>> c.number_class(Decimal('0.1E-999')) + '+Subnormal' + >>> c.number_class(Decimal('0')) + '+Zero' + >>> c.number_class(Decimal('-0')) + '-Zero' + >>> c.number_class(Decimal('-0.1E-999')) + '-Subnormal' + >>> c.number_class(Decimal('-1E-10')) + '-Normal' + >>> c.number_class(Decimal('-2.50')) + '-Normal' + >>> c.number_class(Decimal('-Infinity')) + '-Infinity' + >>> c.number_class(Decimal('NaN')) + 'NaN' + >>> c.number_class(Decimal('-NaN')) + 'NaN' + >>> c.number_class(Decimal('sNaN')) + 'sNaN' + """ + return a.number_class(context=self) + + def plus(self, a): + """Plus corresponds to unary prefix plus in Python. + + The operation is evaluated using the same rules as add; the + operation plus(a) is calculated as add('0', a) where the '0' + has the same exponent as the operand. + + >>> ExtendedContext.plus(Decimal('1.3')) + Decimal('1.3') + >>> ExtendedContext.plus(Decimal('-1.3')) + Decimal('-1.3') + """ + return a.__pos__(context=self) + + def power(self, a, b, modulo=None): + """Raises a to the power of b, to modulo if given. + + With two arguments, compute a**b. If a is negative then b + must be integral. The result will be inexact unless b is + integral and the result is finite and can be expressed exactly + in 'precision' digits. + + With three arguments, compute (a**b) % modulo. For the + three argument form, the following restrictions on the + arguments hold: + + - all three arguments must be integral + - b must be nonnegative + - at least one of a or b must be nonzero + - modulo must be nonzero and have at most 'precision' digits + + The result of pow(a, b, modulo) is identical to the result + that would be obtained by computing (a**b) % modulo with + unbounded precision, but is computed more efficiently. It is + always exact. + + >>> c = ExtendedContext.copy() + >>> c.Emin = -999 + >>> c.Emax = 999 + >>> c.power(Decimal('2'), Decimal('3')) + Decimal('8') + >>> c.power(Decimal('-2'), Decimal('3')) + Decimal('-8') + >>> c.power(Decimal('2'), Decimal('-3')) + Decimal('0.125') + >>> c.power(Decimal('1.7'), Decimal('8')) + Decimal('69.7575744') + >>> c.power(Decimal('10'), Decimal('0.301029996')) + Decimal('2.00000000') + >>> c.power(Decimal('Infinity'), Decimal('-1')) + Decimal('0') + >>> c.power(Decimal('Infinity'), Decimal('0')) + Decimal('1') + >>> c.power(Decimal('Infinity'), Decimal('1')) + Decimal('Infinity') + >>> c.power(Decimal('-Infinity'), Decimal('-1')) + Decimal('-0') + >>> c.power(Decimal('-Infinity'), Decimal('0')) + Decimal('1') + >>> c.power(Decimal('-Infinity'), Decimal('1')) + Decimal('-Infinity') + >>> c.power(Decimal('-Infinity'), Decimal('2')) + Decimal('Infinity') + >>> c.power(Decimal('0'), Decimal('0')) + Decimal('NaN') + + >>> c.power(Decimal('3'), Decimal('7'), Decimal('16')) + Decimal('11') + >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16')) + Decimal('-11') + >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16')) + Decimal('1') + >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16')) + Decimal('11') + >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789')) + Decimal('11729830') + >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729')) + Decimal('-0') + >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537')) + Decimal('1') + """ + return a.__pow__(b, modulo, context=self) + + def quantize(self, a, b): + """Returns a value equal to 'a' (rounded), having the exponent of 'b'. + + The coefficient of the result is derived from that of the left-hand + operand. It may be rounded using the current rounding setting (if the + exponent is being increased), multiplied by a positive power of ten (if + the exponent is being decreased), or is unchanged (if the exponent is + already equal to that of the right-hand operand). + + Unlike other operations, if the length of the coefficient after the + quantize operation would be greater than precision then an Invalid + operation condition is raised. This guarantees that, unless there is + an error condition, the exponent of the result of a quantize is always + equal to that of the right-hand operand. + + Also unlike other operations, quantize will never raise Underflow, even + if the result is subnormal and inexact. + + >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001')) + Decimal('2.170') + >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01')) + Decimal('2.17') + >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1')) + Decimal('2.2') + >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0')) + Decimal('2') + >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1')) + Decimal('0E+1') + >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity')) + Decimal('-Infinity') + >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity')) + Decimal('NaN') + >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1')) + Decimal('-0') + >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5')) + Decimal('-0E+5') + >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2')) + Decimal('NaN') + >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2')) + Decimal('NaN') + >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1')) + Decimal('217.0') + >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0')) + Decimal('217') + >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1')) + Decimal('2.2E+2') + >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2')) + Decimal('2E+2') + """ + return a.quantize(b, context=self) + + def radix(self): + """Just returns 10, as this is Decimal, :) + + >>> ExtendedContext.radix() + Decimal('10') + """ + return Decimal(10) + + def remainder(self, a, b): + """Returns the remainder from integer division. + + The result is the residue of the dividend after the operation of + calculating integer division as described for divide-integer, rounded + to precision digits if necessary. The sign of the result, if + non-zero, is the same as that of the original dividend. + + This operation will fail under the same conditions as integer division + (that is, if integer division on the same two operands would fail, the + remainder cannot be calculated). + + >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3')) + Decimal('2.1') + >>> ExtendedContext.remainder(Decimal('10'), Decimal('3')) + Decimal('1') + >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3')) + Decimal('-1') + >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1')) + Decimal('0.2') + >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3')) + Decimal('0.1') + >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3')) + Decimal('1.0') + """ + return a.__mod__(b, context=self) + + def remainder_near(self, a, b): + """Returns to be "a - b * n", where n is the integer nearest the exact + value of "x / b" (if two integers are equally near then the even one + is chosen). If the result is equal to 0 then its sign will be the + sign of a. + + This operation will fail under the same conditions as integer division + (that is, if integer division on the same two operands would fail, the + remainder cannot be calculated). + + >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3')) + Decimal('-0.9') + >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6')) + Decimal('-2') + >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3')) + Decimal('1') + >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3')) + Decimal('-1') + >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1')) + Decimal('0.2') + >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3')) + Decimal('0.1') + >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3')) + Decimal('-0.3') + """ + return a.remainder_near(b, context=self) + + def rotate(self, a, b): + """Returns a rotated copy of a, b times. + + The coefficient of the result is a rotated copy of the digits in + the coefficient of the first operand. The number of places of + rotation is taken from the absolute value of the second operand, + with the rotation being to the left if the second operand is + positive or to the right otherwise. + + >>> ExtendedContext.rotate(Decimal('34'), Decimal('8')) + Decimal('400000003') + >>> ExtendedContext.rotate(Decimal('12'), Decimal('9')) + Decimal('12') + >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2')) + Decimal('891234567') + >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0')) + Decimal('123456789') + >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2')) + Decimal('345678912') + """ + return a.rotate(b, context=self) + + def same_quantum(self, a, b): + """Returns True if the two operands have the same exponent. + + The result is never affected by either the sign or the coefficient of + either operand. + + >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001')) + False + >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01')) + True + >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1')) + False + >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf')) + True + """ + return a.same_quantum(b) + + def scaleb (self, a, b): + """Returns the first operand after adding the second value its exp. + + >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2')) + Decimal('0.0750') + >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0')) + Decimal('7.50') + >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3')) + Decimal('7.50E+3') + """ + return a.scaleb (b, context=self) + + def shift(self, a, b): + """Returns a shifted copy of a, b times. + + The coefficient of the result is a shifted copy of the digits + in the coefficient of the first operand. The number of places + to shift is taken from the absolute value of the second operand, + with the shift being to the left if the second operand is + positive or to the right otherwise. Digits shifted into the + coefficient are zeros. + + >>> ExtendedContext.shift(Decimal('34'), Decimal('8')) + Decimal('400000000') + >>> ExtendedContext.shift(Decimal('12'), Decimal('9')) + Decimal('0') + >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2')) + Decimal('1234567') + >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0')) + Decimal('123456789') + >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2')) + Decimal('345678900') + """ + return a.shift(b, context=self) + + def sqrt(self, a): + """Square root of a non-negative number to context precision. + + If the result must be inexact, it is rounded using the round-half-even + algorithm. + + >>> ExtendedContext.sqrt(Decimal('0')) + Decimal('0') + >>> ExtendedContext.sqrt(Decimal('-0')) + Decimal('-0') + >>> ExtendedContext.sqrt(Decimal('0.39')) + Decimal('0.624499800') + >>> ExtendedContext.sqrt(Decimal('100')) + Decimal('10') + >>> ExtendedContext.sqrt(Decimal('1')) + Decimal('1') + >>> ExtendedContext.sqrt(Decimal('1.0')) + Decimal('1.0') + >>> ExtendedContext.sqrt(Decimal('1.00')) + Decimal('1.0') + >>> ExtendedContext.sqrt(Decimal('7')) + Decimal('2.64575131') + >>> ExtendedContext.sqrt(Decimal('10')) + Decimal('3.16227766') + >>> ExtendedContext.prec + 9 + """ + return a.sqrt(context=self) + + def subtract(self, a, b): + """Return the difference between the two operands. + + >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07')) + Decimal('0.23') + >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30')) + Decimal('0.00') + >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07')) + Decimal('-0.77') + """ + return a.__sub__(b, context=self) + + def to_eng_string(self, a): + """Converts a number to a string, using scientific notation. + + The operation is not affected by the context. + """ + return a.to_eng_string(context=self) + + def to_sci_string(self, a): + """Converts a number to a string, using scientific notation. + + The operation is not affected by the context. + """ + return a.__str__() + + def to_integral_exact(self, a): + """Rounds to an integer. + + When the operand has a negative exponent, the result is the same + as using the quantize() operation using the given operand as the + left-hand-operand, 1E+0 as the right-hand-operand, and the precision + of the operand as the precision setting; Inexact and Rounded flags + are allowed in this operation. The rounding mode is taken from the + context. + + >>> ExtendedContext.to_integral_exact(Decimal('2.1')) + Decimal('2') + >>> ExtendedContext.to_integral_exact(Decimal('100')) + Decimal('100') + >>> ExtendedContext.to_integral_exact(Decimal('100.0')) + Decimal('100') + >>> ExtendedContext.to_integral_exact(Decimal('101.5')) + Decimal('102') + >>> ExtendedContext.to_integral_exact(Decimal('-101.5')) + Decimal('-102') + >>> ExtendedContext.to_integral_exact(Decimal('10E+5')) + Decimal('1.0E+6') + >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77')) + Decimal('7.89E+77') + >>> ExtendedContext.to_integral_exact(Decimal('-Inf')) + Decimal('-Infinity') + """ + return a.to_integral_exact(context=self) + + def to_integral_value(self, a): + """Rounds to an integer. + + When the operand has a negative exponent, the result is the same + as using the quantize() operation using the given operand as the + left-hand-operand, 1E+0 as the right-hand-operand, and the precision + of the operand as the precision setting, except that no flags will + be set. The rounding mode is taken from the context. + + >>> ExtendedContext.to_integral_value(Decimal('2.1')) + Decimal('2') + >>> ExtendedContext.to_integral_value(Decimal('100')) + Decimal('100') + >>> ExtendedContext.to_integral_value(Decimal('100.0')) + Decimal('100') + >>> ExtendedContext.to_integral_value(Decimal('101.5')) + Decimal('102') + >>> ExtendedContext.to_integral_value(Decimal('-101.5')) + Decimal('-102') + >>> ExtendedContext.to_integral_value(Decimal('10E+5')) + Decimal('1.0E+6') + >>> ExtendedContext.to_integral_value(Decimal('7.89E+77')) + Decimal('7.89E+77') + >>> ExtendedContext.to_integral_value(Decimal('-Inf')) + Decimal('-Infinity') + """ + return a.to_integral_value(context=self) + + # the method name changed, but we provide also the old one, for compatibility + to_integral = to_integral_value + +class _WorkRep(object): + __slots__ = ('sign','int','exp') + # sign: 0 or 1 + # int: int or long + # exp: None, int, or string + + def __init__(self, value): + self.sign = value._sign + if value._int: + self.int = int(str(value._int)) + else: + self.int = 0 + self.exp = value._exp + +##### Integer arithmetic functions used by ln, log10, exp and __pow__ ##### + +# This function from Tim Peters was taken from here: +# http://mail.python.org/pipermail/python-list/1999-July/007758.html +# The correction being in the function definition is for speed, and +# the whole function is not resolved with math.log because of avoiding +# the use of floats. +def _nbits(n, correction = { + '0': 4, '1': 3, '2': 2, '3': 2, + '4': 1, '5': 1, '6': 1, '7': 1, + '8': 0, '9': 0, 'a': 0, 'b': 0, + 'c': 0, 'd': 0, 'e': 0, 'f': 0}): + """Number of bits in binary representation of the positive integer n, + or 0 if n == 0. + """ + if n < 0: + raise ValueError("The argument to _nbits should be nonnegative.") + hex_n = "%x" % n + return 4*len(hex_n) - correction[hex_n[0]] + +def _sqrt_nearest(n, a): + """Closest integer to the square root of the positive integer n. a is + an initial approximation to the square root. Any positive integer + will do for a, but the closer a is to the square root of n the + faster convergence will be. + + """ + if n <= 0 or a <= 0: + raise ValueError("Both arguments to _sqrt_nearest should be positive.") + + b=0 + while a != b: + b, a = a, a--n//a>>1 + return a + +def _rshift_nearest(x, shift): + """Given an integer x and a nonnegative integer shift, return closest + integer to x / 2**shift; use round-to-even in case of a tie. + + """ + b, q = 1 << shift, x >> shift + return q + (2*(x & (b-1)) + (q&1) > b) + +def _div_nearest(a, b): + """Closest integer to a/b, a and b positive integers; rounds to even + in the case of a tie. + + """ + q, r = divmod(a, b) + return q + (2*r + (q&1) > b) + +def _ilog(x, M): + """Integer approximation to M*log(x/M), with absolute error boundable + in terms only of x/M. + + Given positive integers x and M, return an integer approximation + to M * log(x/M). For 0.1 <= x/M <= 10 the difference between the + approximation and the exact result is at most 22. For L = 8 and + 1.0 <= x/M <= 10.0 the difference is at most 15. In both cases + these are upper bounds on the error; it will usually be much + smaller.""" + + # The basic algorithm is the following: let log1p be the function + # log1p(x) = log(1+x). Then log(x/M) = log1p((x-M)/M). We use + # the reduction + # + # log1p(y) = 2*log1p(y/(1+sqrt(1+y))) + # + # repeatedly until the argument to log1p is small (< 2**-L in + # absolute value). For small y we can use the Taylor series + # expansion + # + # log1p(y) ~ y - y**2/2 + y**3/3 - ... - (-y)**T/T + # + # truncating at T such that y**T is small enough. The whole + # computation is carried out in a form of fixed-point arithmetic, + # with a real number z being represented by an integer + # approximation to z*M. + + y = x-M + # argument reduction; R = number of reductions performed + R = 0 + while (256*abs(y) > M): + y = _div_nearest(M*y, M + _sqrt_nearest(M*(M+y), M)) + R += 1 + + # Taylor series with T terms + T = -int(-10*len(str(M))//24) + w = _div_nearest(M, T) + for k in range(T-1, 0, -1): + w = _div_nearest(M, k) - _div_nearest(y*w, M) + + return _div_nearest(2**R*w*y, M) + +def _ilog2(x, M): + """Find integer approximation to M*log(x/M), where + M is a power of 10 and M <= x <= 10*M. + + Forward Error Analysis + ====================== + + Stage 1: Reduction + ------------------ + Each square root introduces an error of up to 1/2 ulp; each square + root multiplies existing error by at most 1/2. So total error + from reduction step is 1ulp. (We could do significantly better + here.) + + Stage 2: Taylor series + ---------------------- + Assume that x has already been reduced: 1 <= x <= 1.1. Let u = + x-1, so 0.0 <= u <= 0.1 + + Let n be the number of terms involved in the Taylor series. Define + real numbers y[i], 0 <= i <= n, by: + + y[n] = 0, + y[i] = 1/(i+1) - y[i+1]*u for 0 <= i < n. + + Then the truncated Taylor series approximation to log(x) = log(1+u) + is u*y[0]. + + Lemma: each y[i] has an error of <= 10/9 ulps. + + Proof: (by induction on n-i): clear for y[n]. For y[i], we get an + error of 1/2 ulp from the first division and 1/2 ulp from the + second multiplication. We're treating u as exact, and the error + in y[i+1] is at most 10/9, so the total error is bounded by 1/2 + + 1/2 + 0.1 * 10/9 = 10/9. + + Corollary: y[0] has an error of <= 11/18 ulps. + Proof: As above, except that there's no error in computing 1/1. + + Now in the final multiplication, u*2**R is exact, error in y is + <= 11/18 ulps, result has an error of at most + + 1/2 ulp + 11/18 * 0.1 * 32 ulps < 3 ulps. + + Total error + ----------- + 1 ulp from stage 1. + Derivative of 32*log(1+u) is 32/(1+u), bounded by 32. So we + get an error of up to 32 ulps here. Adding the error from stage 2 + gives a total error of up to 35 ulps. + + """ + + # on input, 1.0 <= x/M <= 10.0; M should be a power of 10. + assert x >= 0 and M <= x <= 10*M + assert M == 1 or M > 1 and len(str(M)) != len(str(M-1)) + + # reduce to 1.0 <= x/M <= 1.1 by repeated square roots + # could take up to 5 reductions. + R = 0 + while 10*x > 11*M: + x = _sqrt_nearest(x*M, M) + R += 1 + + # Taylor series + u = x-M + L = taylor_logbound(u, M) + y = 0 + for term in reversed(xrange(1, L)): + y = _div_nearest(M, term) - _div_nearest(u*y, M) + return _div_nearest(u*y*2**R, M) + +def _dlog10(c, e, p): + """Given integers c, e and p with c > 0, p >= 0, compute an integer + approximation to 10**p * log10(c*10**e), with an absolute error of + at most 1. Assumes that c*10**e is not exactly 1.""" + + # increase precision by 2; compensate for this by dividing + # final result by 100 + p += 2 + + # write c*10**e as d*10**f with either: + # f >= 0 and 1 <= d <= 10, or + # f <= 0 and 0.1 <= d <= 1. + # Thus for c*10**e close to 1, f = 0 + l = len(str(c)) + f = e+l - (e+l >= 1) + + if p > 0: + M = 10**p + k = e+p-f + if k >= 0: + c *= 10**k + else: + c = _div_nearest(c, 10**-k) + + log_d = _ilog(c, M) # error < 5 + 22 = 27 + log_10 = _log10_digits(p) # error < 1 + log_d = _div_nearest(log_d*M, log_10) + log_tenpower = f*M # exact + else: + log_d = 0 # error < 2.31 + log_tenpower = _div_nearest(f, 10**-p) # error < 0.5 + + return _div_nearest(log_tenpower+log_d, 100) + +def _dlog(c, e, p): + """Given integers c, e and p with c > 0, compute an integer + approximation to 10**p * log(c*10**e), with an absolute error of + at most 1. Assumes that c*10**e is not exactly 1.""" + + # Increase precision by 2. The precision increase is compensated + # for at the end with a division by 100. + p += 2 + + # rewrite c*10**e as d*10**f with either f >= 0 and 1 <= d <= 10, + # or f <= 0 and 0.1 <= d <= 1. Then we can compute 10**p * log(c*10**e) + # as 10**p * log(d) + 10**p*f * log(10). + l = len(str(c)) + f = e+l - (e+l >= 1) + + # compute approximation to 10**p*log(d), with error < 27 + if p > 0: + k = e+p-f + if k >= 0: + c *= 10**k + else: + c = _div_nearest(c, 10**-k) # error of <= 0.5 in c + + # _ilog magnifies existing error in c by a factor of at most 10 + log_d = _ilog(c, 10**p) # error < 5 + 22 = 27 + else: + # p <= 0: just approximate the whole thing by 0; error < 2.31 + log_d = 0 + + # compute approximation to f*10**p*log(10), with error < 11. + if f: + extra = len(str(abs(f)))-1 + if p + extra >= 0: + # error in f * _log10_digits(p+extra) < |f| * 1 = |f| + # after division, error < |f|/10**extra + 0.5 < 10 + 0.5 < 11 + f_log_ten = _div_nearest(f*_log10_digits(p+extra), 10**extra) + else: + f_log_ten = 0 + else: + f_log_ten = 0 + + # error in sum < 11+27 = 38; error after division < 0.38 + 0.5 < 1 + return _div_nearest(f_log_ten + log_d, 100) + +class _Log10Memoize(object): + """Class to compute, store, and allow retrieval of, digits of the + constant log(10) = 2.302585.... This constant is needed by + Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.""" + def __init__(self): + self.digits = "23025850929940456840179914546843642076011014886" + + def getdigits(self, p): + """Given an integer p >= 0, return floor(10**p)*log(10). + + For example, self.getdigits(3) returns 2302. + """ + # digits are stored as a string, for quick conversion to + # integer in the case that we've already computed enough + # digits; the stored digits should always be correct + # (truncated, not rounded to nearest). + if p < 0: + raise ValueError("p should be nonnegative") + + if p >= len(self.digits): + # compute p+3, p+6, p+9, ... digits; continue until at + # least one of the extra digits is nonzero + extra = 3 + while True: + # compute p+extra digits, correct to within 1ulp + M = 10**(p+extra+2) + digits = str(_div_nearest(_ilog(10*M, M), 100)) + if digits[-extra:] != '0'*extra: + break + extra += 3 + # keep all reliable digits so far; remove trailing zeros + # and next nonzero digit + self.digits = digits.rstrip('0')[:-1] + return int(self.digits[:p+1]) + +_log10_digits = _Log10Memoize().getdigits + +def _iexp(x, M, L=8): + """Given integers x and M, M > 0, such that x/M is small in absolute + value, compute an integer approximation to M*exp(x/M). For 0 <= + x/M <= 2.4, the absolute error in the result is bounded by 60 (and + is usually much smaller).""" + + # Algorithm: to compute exp(z) for a real number z, first divide z + # by a suitable power R of 2 so that |z/2**R| < 2**-L. Then + # compute expm1(z/2**R) = exp(z/2**R) - 1 using the usual Taylor + # series + # + # expm1(x) = x + x**2/2! + x**3/3! + ... + # + # Now use the identity + # + # expm1(2x) = expm1(x)*(expm1(x)+2) + # + # R times to compute the sequence expm1(z/2**R), + # expm1(z/2**(R-1)), ... , exp(z/2), exp(z). + + # Find R such that x/2**R/M <= 2**-L + R = _nbits((x< M + T = -int(-10*len(str(M))//(3*L)) + y = _div_nearest(x, T) + Mshift = M<= 0: + cshift = c*10**shift + else: + cshift = c//10**-shift + quot, rem = divmod(cshift, _log10_digits(q)) + + # reduce remainder back to original precision + rem = _div_nearest(rem, 10**extra) + + # error in result of _iexp < 120; error after division < 0.62 + return _div_nearest(_iexp(rem, 10**p), 1000), quot - p + 3 + +def _dpower(xc, xe, yc, ye, p): + """Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and + y = yc*10**ye, compute x**y. Returns a pair of integers (c, e) such that: + + 10**(p-1) <= c <= 10**p, and + (c-1)*10**e < x**y < (c+1)*10**e + + in other words, c*10**e is an approximation to x**y with p digits + of precision, and with an error in c of at most 1. (This is + almost, but not quite, the same as the error being < 1ulp: when c + == 10**(p-1) we can only guarantee error < 10ulp.) + + We assume that: x is positive and not equal to 1, and y is nonzero. + """ + + # Find b such that 10**(b-1) <= |y| <= 10**b + b = len(str(abs(yc))) + ye + + # log(x) = lxc*10**(-p-b-1), to p+b+1 places after the decimal point + lxc = _dlog(xc, xe, p+b+1) + + # compute product y*log(x) = yc*lxc*10**(-p-b-1+ye) = pc*10**(-p-1) + shift = ye-b + if shift >= 0: + pc = lxc*yc*10**shift + else: + pc = _div_nearest(lxc*yc, 10**-shift) + + if pc == 0: + # we prefer a result that isn't exactly 1; this makes it + # easier to compute a correctly rounded result in __pow__ + if ((len(str(xc)) + xe >= 1) == (yc > 0)): # if x**y > 1: + coeff, exp = 10**(p-1)+1, 1-p + else: + coeff, exp = 10**p-1, -p + else: + coeff, exp = _dexp(pc, -(p+1), p+1) + coeff = _div_nearest(coeff, 10) + exp += 1 + + return coeff, exp + +def _log10_lb(c, correction = { + '1': 100, '2': 70, '3': 53, '4': 40, '5': 31, + '6': 23, '7': 16, '8': 10, '9': 5}): + """Compute a lower bound for 100*log10(c) for a positive integer c.""" + if c <= 0: + raise ValueError("The argument to _log10_lb should be nonnegative.") + str_c = str(c) + return 100*len(str_c) - correction[str_c[0]] + +##### Helper Functions #################################################### + +def _convert_other(other, raiseit=False): + """Convert other to Decimal. + + Verifies that it's ok to use in an implicit construction. + """ + if isinstance(other, Decimal): + return other + if isinstance(other, int): + return Decimal(other) + if raiseit: + raise TypeError("Unable to convert %s to Decimal" % other) + return NotImplemented + +def _logical_to_int(x): + if not (x._sign == x._exp == 0): + raise ValueError("not a logical operand in _logical_to_int") + return int(str(x._int) or '0', 2) + +def _int_to_logical(l, hex_to_bin = { + '0' : '0000', '1' : '0001', '2' : '0010', '3' : '0011', + '4' : '0100', '5' : '0101', '6' : '0110', '7' : '0111', + '8' : '1000', '9' : '1001', 'a' : '1010', 'b' : '1011', + 'c' : '1100', 'd' : '1101', 'e' : '1110', 'f' : '1111'}): + coeff = Deccoeff(''.join(hex_to_bin[c] for c in '%x' % l)) + return _dec_from_triple(0, coeff, 0) + +##### Setup Specific Contexts ############################################ + +# The default context prototype used by Context() +# Is mutable, so that new contexts can have different default values + +DefaultContext = Context( + prec=28, rounding=ROUND_HALF_EVEN, + traps=[DivisionByZero, Overflow, InvalidOperation], + flags=[], + Emax=999999999, + Emin=-999999999, + capitals=1 +) + +# Pre-made alternate contexts offered by the specification +# Don't change these; the user should be able to select these +# contexts and be able to reproduce results from other implementations +# of the spec. + +BasicContext = Context( + prec=9, rounding=ROUND_HALF_UP, + traps=[DivisionByZero, Overflow, InvalidOperation, Clamped, Underflow], + flags=[], +) + +ExtendedContext = Context( + prec=9, rounding=ROUND_HALF_EVEN, + traps=[], + flags=[], +) + + +##### crud for parsing strings ############################################# +# +# Regular expression used for parsing numeric strings. Additional +# comments: +# +# 1. Uncomment the two '\s*' lines to allow leading and/or trailing +# whitespace. But note that the specification disallows whitespace in +# a numeric string. +# +# 2. For finite numbers (not infinities and NaNs) the body of the +# number between the optional sign and the optional exponent must have +# at least one decimal digit, possibly after the decimal point. The +# lookahead expression '(?=[0-9]|\.[0-9])' checks this. +# +# As the flag UNICODE is not enabled here, we're explicitly avoiding any +# other meaning for \d than the numbers [0-9]. + +##### PEP3101 support functions ############################################## +# The functions parse_format_specifier and format_align have little to do +# with the Decimal class, and could potentially be reused for other pure +# Python numeric classes that want to implement __format__ +# +# A format specifier for Decimal looks like: +# +# [[fill]align][sign][0][minimumwidth][.precision][type] +# + +import re + +_parse_format_specifier_regex = re.compile(r"""\A +(?: + (?P.)? + (?P[<>=^]) +)? +(?P[-+ ])? +(?P0)? +(?P(?!0)\d+)? +(?:\.(?P0|(?!0)\d+))? +(?P[eEfFgG%])? +\Z +""", re.VERBOSE) + +del re + +def _parse_format_specifier(format_spec): + """Parse and validate a format specifier. + + Turns a standard numeric format specifier into a dict, with the + following entries: + + fill: fill character to pad field to minimum width + align: alignment type, either '<', '>', '=' or '^' + sign: either '+', '-' or ' ' + minimumwidth: nonnegative integer giving minimum width + precision: nonnegative integer giving precision, or None + type: one of the characters 'eEfFgG%', or None + unicode: either True or False (always True for Python 3.x) + + """ + m = _parse_format_specifier_regex.match(format_spec) + if m is None: + raise ValueError("Invalid format specifier: " + format_spec) + + # get the dictionary + format_dict = m.groupdict() + + # defaults for fill and alignment + fill = format_dict['fill'] + align = format_dict['align'] + if format_dict.pop('zeropad') is not None: + # in the face of conflict, refuse the temptation to guess + if fill is not None and fill != '0': + raise ValueError("Fill character conflicts with '0'" + " in format specifier: " + format_spec) + if align is not None and align != '=': + raise ValueError("Alignment conflicts with '0' in " + "format specifier: " + format_spec) + fill = '0' + align = '=' + format_dict['fill'] = fill or ' ' + format_dict['align'] = align or '<' + + if format_dict['sign'] is None: + format_dict['sign'] = '-' + + # turn minimumwidth and precision entries into integers. + # minimumwidth defaults to 0; precision remains None if not given + format_dict['minimumwidth'] = int(format_dict['minimumwidth'] or '0') + if format_dict['precision'] is not None: + format_dict['precision'] = int(format_dict['precision']) + + # if format type is 'g' or 'G' then a precision of 0 makes little + # sense; convert it to 1. Same if format type is unspecified. + if format_dict['precision'] == 0: + if format_dict['type'] in 'gG' or format_dict['type'] is None: + format_dict['precision'] = 1 + + return format_dict + +def _format_align(body, spec_dict): + """Given an unpadded, non-aligned numeric string, add padding and + aligment to conform with the given format specifier dictionary (as + output from parse_format_specifier). + + It's assumed that if body is negative then it starts with '-'. + Any leading sign ('-' or '+') is stripped from the body before + applying the alignment and padding rules, and replaced in the + appropriate position. + + """ + # figure out the sign; we only examine the first character, so if + # body has leading whitespace the results may be surprising. + if len(body) > 0 and body[0] in '-+': + sign = body[0] + body = body[1:] + else: + sign = '' + + if sign != '-': + if spec_dict['sign'] in ' +': + sign = spec_dict['sign'] + else: + sign = '' + + # how much extra space do we have to play with? + minimumwidth = spec_dict['minimumwidth'] + fill = spec_dict['fill'] + padding = fill*(max(minimumwidth - (len(sign+body)), 0)) + + align = spec_dict['align'] + if align == '<': + result = padding + sign + body + elif align == '>': + result = sign + body + padding + elif align == '=': + result = sign + padding + body + else: #align == '^' + half = len(padding)//2 + result = padding[:half] + sign + body + padding[half:] + + return result + +##### Useful Constants (internal use only) ################################ + +# Reusable defaults +deccoeff_zero = Deccoeff('') +deccoeff_one = Deccoeff('1') +deccoeff_two = Deccoeff('2') +deccoeff_five = Deccoeff('5') +deccoeff_nine = Deccoeff('9') +half_digits = [Deccoeff('0'), Deccoeff('5')] +odd_digits = [Deccoeff('1'), Deccoeff('3'), Deccoeff('5'), Deccoeff('7'), Deccoeff('9')] +even_digits = [Deccoeff('0'), Deccoeff('2'), Deccoeff('4'), Deccoeff('6'), Deccoeff('8')] + +Inf = Decimal('Inf') +negInf = Decimal('-Inf') +NaN = Decimal('NaN') +Dec_0 = Decimal(0) +Dec_n0 = Decimal('-0') +Dec_p1 = Decimal(1) +Dec_n1 = Decimal(-1) + +# Infsign[sign] is infinity w/ that sign +Infsign = (Inf, negInf) + + + +#if __name__ == '__main__': +# import doctest, sys +# doctest.testmod(sys.modules[__name__]) Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/abs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/abs.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,161 @@ +------------------------------------------------------------------------ +-- abs.decTest -- decimal absolute value -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests primarily tests the existence of the operator. +-- Additon, subtraction, rounding, and more overflows are tested +-- elsewhere. + +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 +extended: 1 + +absx001 abs '1' -> '1' +absx002 abs '-1' -> '1' +absx003 abs '1.00' -> '1.00' +absx004 abs '-1.00' -> '1.00' +absx005 abs '0' -> '0' +absx006 abs '0.00' -> '0.00' +absx007 abs '00.0' -> '0.0' +absx008 abs '00.00' -> '0.00' +absx009 abs '00' -> '0' + +absx010 abs '-2' -> '2' +absx011 abs '2' -> '2' +absx012 abs '-2.00' -> '2.00' +absx013 abs '2.00' -> '2.00' +absx014 abs '-0' -> '0' +absx015 abs '-0.00' -> '0.00' +absx016 abs '-00.0' -> '0.0' +absx017 abs '-00.00' -> '0.00' +absx018 abs '-00' -> '0' + +absx020 abs '-2000000' -> '2000000' +absx021 abs '2000000' -> '2000000' +precision: 7 +absx022 abs '-2000000' -> '2000000' +absx023 abs '2000000' -> '2000000' +precision: 6 +absx024 abs '-2000000' -> '2.00000E+6' Rounded +absx025 abs '2000000' -> '2.00000E+6' Rounded +precision: 3 +absx026 abs '-2000000' -> '2.00E+6' Rounded +absx027 abs '2000000' -> '2.00E+6' Rounded + +absx030 abs '+0.1' -> '0.1' +absx031 abs '-0.1' -> '0.1' +absx032 abs '+0.01' -> '0.01' +absx033 abs '-0.01' -> '0.01' +absx034 abs '+0.001' -> '0.001' +absx035 abs '-0.001' -> '0.001' +absx036 abs '+0.000001' -> '0.000001' +absx037 abs '-0.000001' -> '0.000001' +absx038 abs '+0.000000000001' -> '1E-12' +absx039 abs '-0.000000000001' -> '1E-12' + +-- examples from decArith +precision: 9 +absx040 abs '2.1' -> '2.1' +absx041 abs '-100' -> '100' +absx042 abs '101.5' -> '101.5' +absx043 abs '-101.5' -> '101.5' + +-- more fixed, potential LHS swaps/overlays if done by subtract 0 +precision: 9 +absx060 abs '-56267E-10' -> '0.0000056267' +absx061 abs '-56267E-5' -> '0.56267' +absx062 abs '-56267E-2' -> '562.67' +absx063 abs '-56267E-1' -> '5626.7' +absx065 abs '-56267E-0' -> '56267' + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +absx120 abs 9.999E+999999999 -> Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +absx210 abs 1.00E-999 -> 1.00E-999 +absx211 abs 0.1E-999 -> 1E-1000 Subnormal +absx212 abs 0.10E-999 -> 1.0E-1000 Subnormal +absx213 abs 0.100E-999 -> 1.0E-1000 Subnormal Rounded +absx214 abs 0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +absx215 abs 0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +absx216 abs 0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +absx217 abs 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +absx218 abs 0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx219 abs 0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx220 abs 0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +absx230 abs -1.00E-999 -> 1.00E-999 +absx231 abs -0.1E-999 -> 1E-1000 Subnormal +absx232 abs -0.10E-999 -> 1.0E-1000 Subnormal +absx233 abs -0.100E-999 -> 1.0E-1000 Subnormal Rounded +absx234 abs -0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +absx235 abs -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +absx236 abs -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +absx237 abs -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +absx238 abs -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx239 abs -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx240 abs -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- long operand tests +maxexponent: 999 +minexponent: -999 +precision: 9 +absx301 abs 12345678000 -> 1.23456780E+10 Rounded +absx302 abs 1234567800 -> 1.23456780E+9 Rounded +absx303 abs 1234567890 -> 1.23456789E+9 Rounded +absx304 abs 1234567891 -> 1.23456789E+9 Inexact Rounded +absx305 abs 12345678901 -> 1.23456789E+10 Inexact Rounded +absx306 abs 1234567896 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +absx321 abs 12345678000 -> 12345678000 +absx322 abs 1234567800 -> 1234567800 +absx323 abs 1234567890 -> 1234567890 +absx324 abs 1234567891 -> 1234567891 +absx325 abs 12345678901 -> 12345678901 +absx326 abs 1234567896 -> 1234567896 + + +-- Specials +precision: 9 + +-- specials +absx520 abs 'Inf' -> 'Infinity' +absx521 abs '-Inf' -> 'Infinity' +absx522 abs NaN -> NaN +absx523 abs sNaN -> NaN Invalid_operation +absx524 abs NaN22 -> NaN22 +absx525 abs sNaN33 -> NaN33 Invalid_operation +absx526 abs -NaN22 -> -NaN22 +absx527 abs -sNaN33 -> -NaN33 Invalid_operation + +-- Null tests +absx900 abs # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/add.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/add.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,2716 @@ +------/cancell---------------------------------------------------------- +-- add.decTest -- decimal addition -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 +extended: 1 + +-- [first group are 'quick confidence check'] +addx001 add 1 1 -> 2 +addx002 add 2 3 -> 5 +addx003 add '5.75' '3.3' -> 9.05 +addx004 add '5' '-3' -> 2 +addx005 add '-5' '-3' -> -8 +addx006 add '-7' '2.5' -> -4.5 +addx007 add '0.7' '0.3' -> 1.0 +addx008 add '1.25' '1.25' -> 2.50 +addx009 add '1.23456789' '1.00000000' -> '2.23456789' +addx010 add '1.23456789' '1.00000011' -> '2.23456800' + +addx011 add '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded +addx012 add '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded +addx013 add '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded +addx014 add '0.44444444449' '0' -> '0.444444444' Inexact Rounded +addx015 add '0.444444444499' '0' -> '0.444444444' Inexact Rounded +addx016 add '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +addx017 add '0.4444444445000' '0' -> '0.444444445' Inexact Rounded +addx018 add '0.4444444445001' '0' -> '0.444444445' Inexact Rounded +addx019 add '0.444444444501' '0' -> '0.444444445' Inexact Rounded +addx020 add '0.44444444451' '0' -> '0.444444445' Inexact Rounded + +addx021 add 0 1 -> 1 +addx022 add 1 1 -> 2 +addx023 add 2 1 -> 3 +addx024 add 3 1 -> 4 +addx025 add 4 1 -> 5 +addx026 add 5 1 -> 6 +addx027 add 6 1 -> 7 +addx028 add 7 1 -> 8 +addx029 add 8 1 -> 9 +addx030 add 9 1 -> 10 + +-- some carrying effects +addx031 add '0.9998' '0.0000' -> '0.9998' +addx032 add '0.9998' '0.0001' -> '0.9999' +addx033 add '0.9998' '0.0002' -> '1.0000' +addx034 add '0.9998' '0.0003' -> '1.0001' + +addx035 add '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded +addx036 add '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded +addx037 add '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded +addx038 add '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded +addx039 add '700000' '10000e+9' -> '1.00000007E+13' Rounded + +-- symmetry: +addx040 add '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +addx041 add '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +addx042 add '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded +addx044 add '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded +addx045 add '10000e+9' '700000' -> '1.00000007E+13' Rounded + +-- same, higher precision +precision: 15 +addx046 add '10000e+9' '7' -> '10000000000007' +addx047 add '10000e+9' '70' -> '10000000000070' +addx048 add '10000e+9' '700' -> '10000000000700' +addx049 add '10000e+9' '7000' -> '10000000007000' +addx050 add '10000e+9' '70000' -> '10000000070000' +addx051 add '10000e+9' '700000' -> '10000000700000' +addx052 add '10000e+9' '7000000' -> '10000007000000' + +-- examples from decarith +addx053 add '12' '7.00' -> '19.00' +addx054 add '1.3' '-1.07' -> '0.23' +addx055 add '1.3' '-1.30' -> '0.00' +addx056 add '1.3' '-2.07' -> '-0.77' +addx057 add '1E+2' '1E+4' -> '1.01E+4' + +-- zero preservation +precision: 6 +addx060 add '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +addx061 add 1 '0.0001' -> '1.0001' +addx062 add 1 '0.00001' -> '1.00001' +addx063 add 1 '0.000001' -> '1.00000' Inexact Rounded +addx064 add 1 '0.0000001' -> '1.00000' Inexact Rounded +addx065 add 1 '0.00000001' -> '1.00000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +addx070 add 1 0 -> 1 +addx071 add 1 0. -> 1 +addx072 add 1 .0 -> 1.0 +addx073 add 1 0.0 -> 1.0 +addx074 add 1 0.00 -> 1.00 +addx075 add 0 1 -> 1 +addx076 add 0. 1 -> 1 +addx077 add .0 1 -> 1.0 +addx078 add 0.0 1 -> 1.0 +addx079 add 0.00 1 -> 1.00 + +precision: 9 + +-- some carries +addx080 add 999999998 1 -> 999999999 +addx081 add 999999999 1 -> 1.00000000E+9 Rounded +addx082 add 99999999 1 -> 100000000 +addx083 add 9999999 1 -> 10000000 +addx084 add 999999 1 -> 1000000 +addx085 add 99999 1 -> 100000 +addx086 add 9999 1 -> 10000 +addx087 add 999 1 -> 1000 +addx088 add 99 1 -> 100 +addx089 add 9 1 -> 10 + + +-- more LHS swaps +addx090 add '-56267E-10' 0 -> '-0.0000056267' +addx091 add '-56267E-6' 0 -> '-0.056267' +addx092 add '-56267E-5' 0 -> '-0.56267' +addx093 add '-56267E-4' 0 -> '-5.6267' +addx094 add '-56267E-3' 0 -> '-56.267' +addx095 add '-56267E-2' 0 -> '-562.67' +addx096 add '-56267E-1' 0 -> '-5626.7' +addx097 add '-56267E-0' 0 -> '-56267' +addx098 add '-5E-10' 0 -> '-5E-10' +addx099 add '-5E-7' 0 -> '-5E-7' +addx100 add '-5E-6' 0 -> '-0.000005' +addx101 add '-5E-5' 0 -> '-0.00005' +addx102 add '-5E-4' 0 -> '-0.0005' +addx103 add '-5E-1' 0 -> '-0.5' +addx104 add '-5E0' 0 -> '-5' +addx105 add '-5E1' 0 -> '-50' +addx106 add '-5E5' 0 -> '-500000' +addx107 add '-5E8' 0 -> '-500000000' +addx108 add '-5E9' 0 -> '-5.00000000E+9' Rounded +addx109 add '-5E10' 0 -> '-5.00000000E+10' Rounded +addx110 add '-5E11' 0 -> '-5.00000000E+11' Rounded +addx111 add '-5E100' 0 -> '-5.00000000E+100' Rounded + +-- more RHS swaps +addx113 add 0 '-56267E-10' -> '-0.0000056267' +addx114 add 0 '-56267E-6' -> '-0.056267' +addx116 add 0 '-56267E-5' -> '-0.56267' +addx117 add 0 '-56267E-4' -> '-5.6267' +addx119 add 0 '-56267E-3' -> '-56.267' +addx120 add 0 '-56267E-2' -> '-562.67' +addx121 add 0 '-56267E-1' -> '-5626.7' +addx122 add 0 '-56267E-0' -> '-56267' +addx123 add 0 '-5E-10' -> '-5E-10' +addx124 add 0 '-5E-7' -> '-5E-7' +addx125 add 0 '-5E-6' -> '-0.000005' +addx126 add 0 '-5E-5' -> '-0.00005' +addx127 add 0 '-5E-4' -> '-0.0005' +addx128 add 0 '-5E-1' -> '-0.5' +addx129 add 0 '-5E0' -> '-5' +addx130 add 0 '-5E1' -> '-50' +addx131 add 0 '-5E5' -> '-500000' +addx132 add 0 '-5E8' -> '-500000000' +addx133 add 0 '-5E9' -> '-5.00000000E+9' Rounded +addx134 add 0 '-5E10' -> '-5.00000000E+10' Rounded +addx135 add 0 '-5E11' -> '-5.00000000E+11' Rounded +addx136 add 0 '-5E100' -> '-5.00000000E+100' Rounded + +-- related +addx137 add 1 '0E-12' -> '1.00000000' Rounded +addx138 add -1 '0E-12' -> '-1.00000000' Rounded +addx139 add '0E-12' 1 -> '1.00000000' Rounded +addx140 add '0E-12' -1 -> '-1.00000000' Rounded +addx141 add 1E+4 0.0000 -> '10000.0000' +addx142 add 1E+4 0.00000 -> '10000.0000' Rounded +addx143 add 0.000 1E+5 -> '100000.000' +addx144 add 0.0000 1E+5 -> '100000.000' Rounded + +-- [some of the next group are really constructor tests] +addx146 add '00.0' 0 -> '0.0' +addx147 add '0.00' 0 -> '0.00' +addx148 add 0 '0.00' -> '0.00' +addx149 add 0 '00.0' -> '0.0' +addx150 add '00.0' '0.00' -> '0.00' +addx151 add '0.00' '00.0' -> '0.00' +addx152 add '3' '.3' -> '3.3' +addx153 add '3.' '.3' -> '3.3' +addx154 add '3.0' '.3' -> '3.3' +addx155 add '3.00' '.3' -> '3.30' +addx156 add '3' '3' -> '6' +addx157 add '3' '+3' -> '6' +addx158 add '3' '-3' -> '0' +addx159 add '0.3' '-0.3' -> '0.0' +addx160 add '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +precision: 15 +addx161 add '1E+12' '-1' -> '999999999999' +addx162 add '1E+12' '1.11' -> '1000000000001.11' +addx163 add '1.11' '1E+12' -> '1000000000001.11' +addx164 add '-1' '1E+12' -> '999999999999' +addx165 add '7E+12' '-1' -> '6999999999999' +addx166 add '7E+12' '1.11' -> '7000000000001.11' +addx167 add '1.11' '7E+12' -> '7000000000001.11' +addx168 add '-1' '7E+12' -> '6999999999999' + +-- 123456789012345 123456789012345 1 23456789012345 +addx170 add '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded +addx171 add '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded +addx172 add '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded +addx173 add '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded +addx174 add '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded +addx175 add '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded +addx176 add '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded +addx177 add '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded +addx178 add '0.444444444444444' '0.555555555555555' -> '0.999999999999999' +addx179 add '0.444444444444444' '0.555555555555554' -> '0.999999999999998' +addx180 add '0.444444444444444' '0.555555555555553' -> '0.999999999999997' +addx181 add '0.444444444444444' '0.555555555555552' -> '0.999999999999996' +addx182 add '0.444444444444444' '0.555555555555551' -> '0.999999999999995' +addx183 add '0.444444444444444' '0.555555555555550' -> '0.999999999999994' + +-- and some more, including residue effects and different roundings +precision: 9 +rounding: half_up +addx200 add '123456789' 0 -> '123456789' +addx201 add '123456789' 0.000000001 -> '123456789' Inexact Rounded +addx202 add '123456789' 0.000001 -> '123456789' Inexact Rounded +addx203 add '123456789' 0.1 -> '123456789' Inexact Rounded +addx204 add '123456789' 0.4 -> '123456789' Inexact Rounded +addx205 add '123456789' 0.49 -> '123456789' Inexact Rounded +addx206 add '123456789' 0.499999 -> '123456789' Inexact Rounded +addx207 add '123456789' 0.499999999 -> '123456789' Inexact Rounded +addx208 add '123456789' 0.5 -> '123456790' Inexact Rounded +addx209 add '123456789' 0.500000001 -> '123456790' Inexact Rounded +addx210 add '123456789' 0.500001 -> '123456790' Inexact Rounded +addx211 add '123456789' 0.51 -> '123456790' Inexact Rounded +addx212 add '123456789' 0.6 -> '123456790' Inexact Rounded +addx213 add '123456789' 0.9 -> '123456790' Inexact Rounded +addx214 add '123456789' 0.99999 -> '123456790' Inexact Rounded +addx215 add '123456789' 0.999999999 -> '123456790' Inexact Rounded +addx216 add '123456789' 1 -> '123456790' +addx217 add '123456789' 1.000000001 -> '123456790' Inexact Rounded +addx218 add '123456789' 1.00001 -> '123456790' Inexact Rounded +addx219 add '123456789' 1.1 -> '123456790' Inexact Rounded + +rounding: half_even +addx220 add '123456789' 0 -> '123456789' +addx221 add '123456789' 0.000000001 -> '123456789' Inexact Rounded +addx222 add '123456789' 0.000001 -> '123456789' Inexact Rounded +addx223 add '123456789' 0.1 -> '123456789' Inexact Rounded +addx224 add '123456789' 0.4 -> '123456789' Inexact Rounded +addx225 add '123456789' 0.49 -> '123456789' Inexact Rounded +addx226 add '123456789' 0.499999 -> '123456789' Inexact Rounded +addx227 add '123456789' 0.499999999 -> '123456789' Inexact Rounded +addx228 add '123456789' 0.5 -> '123456790' Inexact Rounded +addx229 add '123456789' 0.500000001 -> '123456790' Inexact Rounded +addx230 add '123456789' 0.500001 -> '123456790' Inexact Rounded +addx231 add '123456789' 0.51 -> '123456790' Inexact Rounded +addx232 add '123456789' 0.6 -> '123456790' Inexact Rounded +addx233 add '123456789' 0.9 -> '123456790' Inexact Rounded +addx234 add '123456789' 0.99999 -> '123456790' Inexact Rounded +addx235 add '123456789' 0.999999999 -> '123456790' Inexact Rounded +addx236 add '123456789' 1 -> '123456790' +addx237 add '123456789' 1.00000001 -> '123456790' Inexact Rounded +addx238 add '123456789' 1.00001 -> '123456790' Inexact Rounded +addx239 add '123456789' 1.1 -> '123456790' Inexact Rounded +-- critical few with even bottom digit... +addx240 add '123456788' 0.499999999 -> '123456788' Inexact Rounded +addx241 add '123456788' 0.5 -> '123456788' Inexact Rounded +addx242 add '123456788' 0.500000001 -> '123456789' Inexact Rounded + +rounding: down +addx250 add '123456789' 0 -> '123456789' +addx251 add '123456789' 0.000000001 -> '123456789' Inexact Rounded +addx252 add '123456789' 0.000001 -> '123456789' Inexact Rounded +addx253 add '123456789' 0.1 -> '123456789' Inexact Rounded +addx254 add '123456789' 0.4 -> '123456789' Inexact Rounded +addx255 add '123456789' 0.49 -> '123456789' Inexact Rounded +addx256 add '123456789' 0.499999 -> '123456789' Inexact Rounded +addx257 add '123456789' 0.499999999 -> '123456789' Inexact Rounded +addx258 add '123456789' 0.5 -> '123456789' Inexact Rounded +addx259 add '123456789' 0.500000001 -> '123456789' Inexact Rounded +addx260 add '123456789' 0.500001 -> '123456789' Inexact Rounded +addx261 add '123456789' 0.51 -> '123456789' Inexact Rounded +addx262 add '123456789' 0.6 -> '123456789' Inexact Rounded +addx263 add '123456789' 0.9 -> '123456789' Inexact Rounded +addx264 add '123456789' 0.99999 -> '123456789' Inexact Rounded +addx265 add '123456789' 0.999999999 -> '123456789' Inexact Rounded +addx266 add '123456789' 1 -> '123456790' +addx267 add '123456789' 1.00000001 -> '123456790' Inexact Rounded +addx268 add '123456789' 1.00001 -> '123456790' Inexact Rounded +addx269 add '123456789' 1.1 -> '123456790' Inexact Rounded + +-- input preparation tests (operands should not be rounded) +precision: 3 +rounding: half_up + +addx270 add '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded +addx271 add '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded + +addx272 add '12E+3' '3444' -> '1.54E+4' Inexact Rounded +addx273 add '12E+3' '3446' -> '1.54E+4' Inexact Rounded +addx274 add '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded +addx275 add '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded +addx276 add '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded +addx277 add '12E+3' '3454' -> '1.55E+4' Inexact Rounded +addx278 add '12E+3' '3456' -> '1.55E+4' Inexact Rounded + +addx281 add '3444' '12E+3' -> '1.54E+4' Inexact Rounded +addx282 add '3446' '12E+3' -> '1.54E+4' Inexact Rounded +addx283 add '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded +addx284 add '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded +addx285 add '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded +addx286 add '3454' '12E+3' -> '1.55E+4' Inexact Rounded +addx287 add '3456' '12E+3' -> '1.55E+4' Inexact Rounded + +rounding: half_down +addx291 add '3444' '12E+3' -> '1.54E+4' Inexact Rounded +addx292 add '3446' '12E+3' -> '1.54E+4' Inexact Rounded +addx293 add '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded +addx294 add '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded +addx295 add '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded +addx296 add '3454' '12E+3' -> '1.55E+4' Inexact Rounded +addx297 add '3456' '12E+3' -> '1.55E+4' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +addx301 add -1 1 -> 0 +addx302 add 0 1 -> 1 +addx303 add 1 1 -> 2 +addx304 add 12 1 -> 13 +addx305 add 98 1 -> 99 +addx306 add 99 1 -> 100 +addx307 add 100 1 -> 101 +addx308 add 101 1 -> 102 +addx309 add -1 -1 -> -2 +addx310 add 0 -1 -> -1 +addx311 add 1 -1 -> 0 +addx312 add 12 -1 -> 11 +addx313 add 98 -1 -> 97 +addx314 add 99 -1 -> 98 +addx315 add 100 -1 -> 99 +addx316 add 101 -1 -> 100 + +addx321 add -0.01 0.01 -> 0.00 +addx322 add 0.00 0.01 -> 0.01 +addx323 add 0.01 0.01 -> 0.02 +addx324 add 0.12 0.01 -> 0.13 +addx325 add 0.98 0.01 -> 0.99 +addx326 add 0.99 0.01 -> 1.00 +addx327 add 1.00 0.01 -> 1.01 +addx328 add 1.01 0.01 -> 1.02 +addx329 add -0.01 -0.01 -> -0.02 +addx330 add 0.00 -0.01 -> -0.01 +addx331 add 0.01 -0.01 -> 0.00 +addx332 add 0.12 -0.01 -> 0.11 +addx333 add 0.98 -0.01 -> 0.97 +addx334 add 0.99 -0.01 -> 0.98 +addx335 add 1.00 -0.01 -> 0.99 +addx336 add 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +precision: 9 +addx340 add 1E+3 0 -> 1000 +addx341 add 1E+8 0 -> 100000000 +addx342 add 1E+9 0 -> 1.00000000E+9 Rounded +addx343 add 1E+10 0 -> 1.00000000E+10 Rounded +-- which simply follow from these cases ... +addx344 add 1E+3 1 -> 1001 +addx345 add 1E+8 1 -> 100000001 +addx346 add 1E+9 1 -> 1.00000000E+9 Inexact Rounded +addx347 add 1E+10 1 -> 1.00000000E+10 Inexact Rounded +addx348 add 1E+3 7 -> 1007 +addx349 add 1E+8 7 -> 100000007 +addx350 add 1E+9 7 -> 1.00000001E+9 Inexact Rounded +addx351 add 1E+10 7 -> 1.00000000E+10 Inexact Rounded + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +addx361 add 0E+50 10000E+1 -> 1.0000E+5 +addx362 add 10000E+1 0E-50 -> 100000.0 Rounded +addx363 add 10000E+1 10000E-50 -> 100000.0 Rounded Inexact +addx364 add 9.999999E+92 -9.999999E+92 -> 0E+86 + +-- a curiosity from JSR 13 testing +rounding: half_down +precision: 10 +addx370 add 99999999 81512 -> 100081511 +precision: 6 +addx371 add 99999999 81512 -> 1.00082E+8 Rounded Inexact +rounding: half_up +precision: 10 +addx372 add 99999999 81512 -> 100081511 +precision: 6 +addx373 add 99999999 81512 -> 1.00082E+8 Rounded Inexact +rounding: half_even +precision: 10 +addx374 add 99999999 81512 -> 100081511 +precision: 6 +addx375 add 99999999 81512 -> 1.00082E+8 Rounded Inexact + +-- ulp replacement tests +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +addx400 add 1 77e-7 -> 1.0000077 +addx401 add 1 77e-8 -> 1.00000077 +addx402 add 1 77e-9 -> 1.00000008 Inexact Rounded +addx403 add 1 77e-10 -> 1.00000001 Inexact Rounded +addx404 add 1 77e-11 -> 1.00000000 Inexact Rounded +addx405 add 1 77e-12 -> 1.00000000 Inexact Rounded +addx406 add 1 77e-999 -> 1.00000000 Inexact Rounded +addx407 add 1 77e-9999999 -> 1.00000000 Inexact Rounded + +addx410 add 10 77e-7 -> 10.0000077 +addx411 add 10 77e-8 -> 10.0000008 Inexact Rounded +addx412 add 10 77e-9 -> 10.0000001 Inexact Rounded +addx413 add 10 77e-10 -> 10.0000000 Inexact Rounded +addx414 add 10 77e-11 -> 10.0000000 Inexact Rounded +addx415 add 10 77e-12 -> 10.0000000 Inexact Rounded +addx416 add 10 77e-999 -> 10.0000000 Inexact Rounded +addx417 add 10 77e-9999999 -> 10.0000000 Inexact Rounded + +addx420 add 77e-7 1 -> 1.0000077 +addx421 add 77e-8 1 -> 1.00000077 +addx422 add 77e-9 1 -> 1.00000008 Inexact Rounded +addx423 add 77e-10 1 -> 1.00000001 Inexact Rounded +addx424 add 77e-11 1 -> 1.00000000 Inexact Rounded +addx425 add 77e-12 1 -> 1.00000000 Inexact Rounded +addx426 add 77e-999 1 -> 1.00000000 Inexact Rounded +addx427 add 77e-9999999 1 -> 1.00000000 Inexact Rounded + +addx430 add 77e-7 10 -> 10.0000077 +addx431 add 77e-8 10 -> 10.0000008 Inexact Rounded +addx432 add 77e-9 10 -> 10.0000001 Inexact Rounded +addx433 add 77e-10 10 -> 10.0000000 Inexact Rounded +addx434 add 77e-11 10 -> 10.0000000 Inexact Rounded +addx435 add 77e-12 10 -> 10.0000000 Inexact Rounded +addx436 add 77e-999 10 -> 10.0000000 Inexact Rounded +addx437 add 77e-9999999 10 -> 10.0000000 Inexact Rounded + +-- negative ulps +addx440 add 1 -77e-7 -> 0.9999923 +addx441 add 1 -77e-8 -> 0.99999923 +addx442 add 1 -77e-9 -> 0.999999923 +addx443 add 1 -77e-10 -> 0.999999992 Inexact Rounded +addx444 add 1 -77e-11 -> 0.999999999 Inexact Rounded +addx445 add 1 -77e-12 -> 1.00000000 Inexact Rounded +addx446 add 1 -77e-999 -> 1.00000000 Inexact Rounded +addx447 add 1 -77e-9999999 -> 1.00000000 Inexact Rounded + +addx450 add 10 -77e-7 -> 9.9999923 +addx451 add 10 -77e-8 -> 9.99999923 +addx452 add 10 -77e-9 -> 9.99999992 Inexact Rounded +addx453 add 10 -77e-10 -> 9.99999999 Inexact Rounded +addx454 add 10 -77e-11 -> 10.0000000 Inexact Rounded +addx455 add 10 -77e-12 -> 10.0000000 Inexact Rounded +addx456 add 10 -77e-999 -> 10.0000000 Inexact Rounded +addx457 add 10 -77e-9999999 -> 10.0000000 Inexact Rounded + +addx460 add -77e-7 1 -> 0.9999923 +addx461 add -77e-8 1 -> 0.99999923 +addx462 add -77e-9 1 -> 0.999999923 +addx463 add -77e-10 1 -> 0.999999992 Inexact Rounded +addx464 add -77e-11 1 -> 0.999999999 Inexact Rounded +addx465 add -77e-12 1 -> 1.00000000 Inexact Rounded +addx466 add -77e-999 1 -> 1.00000000 Inexact Rounded +addx467 add -77e-9999999 1 -> 1.00000000 Inexact Rounded + +addx470 add -77e-7 10 -> 9.9999923 +addx471 add -77e-8 10 -> 9.99999923 +addx472 add -77e-9 10 -> 9.99999992 Inexact Rounded +addx473 add -77e-10 10 -> 9.99999999 Inexact Rounded +addx474 add -77e-11 10 -> 10.0000000 Inexact Rounded +addx475 add -77e-12 10 -> 10.0000000 Inexact Rounded +addx476 add -77e-999 10 -> 10.0000000 Inexact Rounded +addx477 add -77e-9999999 10 -> 10.0000000 Inexact Rounded + +-- negative ulps +addx480 add -1 77e-7 -> -0.9999923 +addx481 add -1 77e-8 -> -0.99999923 +addx482 add -1 77e-9 -> -0.999999923 +addx483 add -1 77e-10 -> -0.999999992 Inexact Rounded +addx484 add -1 77e-11 -> -0.999999999 Inexact Rounded +addx485 add -1 77e-12 -> -1.00000000 Inexact Rounded +addx486 add -1 77e-999 -> -1.00000000 Inexact Rounded +addx487 add -1 77e-9999999 -> -1.00000000 Inexact Rounded + +addx490 add -10 77e-7 -> -9.9999923 +addx491 add -10 77e-8 -> -9.99999923 +addx492 add -10 77e-9 -> -9.99999992 Inexact Rounded +addx493 add -10 77e-10 -> -9.99999999 Inexact Rounded +addx494 add -10 77e-11 -> -10.0000000 Inexact Rounded +addx495 add -10 77e-12 -> -10.0000000 Inexact Rounded +addx496 add -10 77e-999 -> -10.0000000 Inexact Rounded +addx497 add -10 77e-9999999 -> -10.0000000 Inexact Rounded + +addx500 add 77e-7 -1 -> -0.9999923 +addx501 add 77e-8 -1 -> -0.99999923 +addx502 add 77e-9 -1 -> -0.999999923 +addx503 add 77e-10 -1 -> -0.999999992 Inexact Rounded +addx504 add 77e-11 -1 -> -0.999999999 Inexact Rounded +addx505 add 77e-12 -1 -> -1.00000000 Inexact Rounded +addx506 add 77e-999 -1 -> -1.00000000 Inexact Rounded +addx507 add 77e-9999999 -1 -> -1.00000000 Inexact Rounded + +addx510 add 77e-7 -10 -> -9.9999923 +addx511 add 77e-8 -10 -> -9.99999923 +addx512 add 77e-9 -10 -> -9.99999992 Inexact Rounded +addx513 add 77e-10 -10 -> -9.99999999 Inexact Rounded +addx514 add 77e-11 -10 -> -10.0000000 Inexact Rounded +addx515 add 77e-12 -10 -> -10.0000000 Inexact Rounded +addx516 add 77e-999 -10 -> -10.0000000 Inexact Rounded +addx517 add 77e-9999999 -10 -> -10.0000000 Inexact Rounded + + +-- long operands +maxexponent: 999 +minexponent: -999 +precision: 9 +addx521 add 12345678000 0 -> 1.23456780E+10 Rounded +addx522 add 0 12345678000 -> 1.23456780E+10 Rounded +addx523 add 1234567800 0 -> 1.23456780E+9 Rounded +addx524 add 0 1234567800 -> 1.23456780E+9 Rounded +addx525 add 1234567890 0 -> 1.23456789E+9 Rounded +addx526 add 0 1234567890 -> 1.23456789E+9 Rounded +addx527 add 1234567891 0 -> 1.23456789E+9 Inexact Rounded +addx528 add 0 1234567891 -> 1.23456789E+9 Inexact Rounded +addx529 add 12345678901 0 -> 1.23456789E+10 Inexact Rounded +addx530 add 0 12345678901 -> 1.23456789E+10 Inexact Rounded +addx531 add 1234567896 0 -> 1.23456790E+9 Inexact Rounded +addx532 add 0 1234567896 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +addx541 add 12345678000 0 -> 12345678000 +addx542 add 0 12345678000 -> 12345678000 +addx543 add 1234567800 0 -> 1234567800 +addx544 add 0 1234567800 -> 1234567800 +addx545 add 1234567890 0 -> 1234567890 +addx546 add 0 1234567890 -> 1234567890 +addx547 add 1234567891 0 -> 1234567891 +addx548 add 0 1234567891 -> 1234567891 +addx549 add 12345678901 0 -> 12345678901 +addx550 add 0 12345678901 -> 12345678901 +addx551 add 1234567896 0 -> 1234567896 +addx552 add 0 1234567896 -> 1234567896 + +-- verify a query +precision: 16 +maxExponent: +394 +minExponent: -393 +rounding: down +addx561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +addx562 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +-- and using decimal64 bounds (see also ddadd.decTest) +precision: 16 +maxExponent: +384 +minExponent: -383 +rounding: down +addx563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +addx564 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + + +-- some more residue effects with extreme rounding +precision: 9 +rounding: half_up +addx601 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: half_even +addx602 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: half_down +addx603 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: floor +addx604 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: ceiling +addx605 add 123456789 0.000001 -> 123456790 Inexact Rounded +rounding: up +addx606 add 123456789 0.000001 -> 123456790 Inexact Rounded +rounding: down +addx607 add 123456789 0.000001 -> 123456789 Inexact Rounded + +rounding: half_up +addx611 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: half_even +addx612 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: half_down +addx613 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: floor +addx614 add 123456789 -0.000001 -> 123456788 Inexact Rounded +rounding: ceiling +addx615 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: up +addx616 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: down +addx617 add 123456789 -0.000001 -> 123456788 Inexact Rounded + +rounding: half_up +addx621 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: half_even +addx622 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: half_down +addx623 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: floor +addx624 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: ceiling +addx625 add 123456789 0.499999 -> 123456790 Inexact Rounded +rounding: up +addx626 add 123456789 0.499999 -> 123456790 Inexact Rounded +rounding: down +addx627 add 123456789 0.499999 -> 123456789 Inexact Rounded + +rounding: half_up +addx631 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: half_even +addx632 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: half_down +addx633 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: floor +addx634 add 123456789 -0.499999 -> 123456788 Inexact Rounded +rounding: ceiling +addx635 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: up +addx636 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: down +addx637 add 123456789 -0.499999 -> 123456788 Inexact Rounded + +rounding: half_up +addx641 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: half_even +addx642 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: half_down +addx643 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: floor +addx644 add 123456789 0.500001 -> 123456789 Inexact Rounded +rounding: ceiling +addx645 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: up +addx646 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: down +addx647 add 123456789 0.500001 -> 123456789 Inexact Rounded + +rounding: half_up +addx651 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: half_even +addx652 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: half_down +addx653 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: floor +addx654 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: ceiling +addx655 add 123456789 -0.500001 -> 123456789 Inexact Rounded +rounding: up +addx656 add 123456789 -0.500001 -> 123456789 Inexact Rounded +rounding: down +addx657 add 123456789 -0.500001 -> 123456788 Inexact Rounded + +-- long operand triangle +rounding: half_up +precision: 37 +addx660 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538 +precision: 36 +addx661 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded +precision: 35 +addx662 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded +precision: 34 +addx663 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded +precision: 33 +addx664 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded +precision: 32 +addx665 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded +precision: 31 +addx666 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded +precision: 30 +addx667 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded +precision: 29 +addx668 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded +precision: 28 +addx669 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded +precision: 27 +addx670 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded +precision: 26 +addx671 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded +precision: 25 +addx672 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded +precision: 24 +addx673 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded +precision: 23 +addx674 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded +precision: 22 +addx675 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded +precision: 21 +addx676 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded +precision: 20 +addx677 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded +precision: 19 +addx678 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded +precision: 18 +addx679 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded +precision: 17 +addx680 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded +precision: 16 +addx681 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded +precision: 15 +addx682 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded +precision: 14 +addx683 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded +precision: 13 +addx684 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded +precision: 12 +addx685 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded +precision: 11 +addx686 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded +precision: 10 +addx687 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded +precision: 9 +addx688 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded +precision: 8 +addx689 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded +precision: 7 +addx690 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded +precision: 6 +addx691 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded +precision: 5 +addx692 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded +precision: 4 +addx693 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded +precision: 3 +addx694 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded +precision: 2 +addx695 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded +precision: 1 +addx696 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded + +-- more zeros, etc. +rounding: half_up +precision: 9 + +addx701 add 5.00 1.00E-3 -> 5.00100 +addx702 add 00.00 0.000 -> 0.000 +addx703 add 00.00 0E-3 -> 0.000 +addx704 add 0E-3 00.00 -> 0.000 + +addx710 add 0E+3 00.00 -> 0.00 +addx711 add 0E+3 00.0 -> 0.0 +addx712 add 0E+3 00. -> 0 +addx713 add 0E+3 00.E+1 -> 0E+1 +addx714 add 0E+3 00.E+2 -> 0E+2 +addx715 add 0E+3 00.E+3 -> 0E+3 +addx716 add 0E+3 00.E+4 -> 0E+3 +addx717 add 0E+3 00.E+5 -> 0E+3 +addx718 add 0E+3 -00.0 -> 0.0 +addx719 add 0E+3 -00. -> 0 +addx731 add 0E+3 -00.E+1 -> 0E+1 + +addx720 add 00.00 0E+3 -> 0.00 +addx721 add 00.0 0E+3 -> 0.0 +addx722 add 00. 0E+3 -> 0 +addx723 add 00.E+1 0E+3 -> 0E+1 +addx724 add 00.E+2 0E+3 -> 0E+2 +addx725 add 00.E+3 0E+3 -> 0E+3 +addx726 add 00.E+4 0E+3 -> 0E+3 +addx727 add 00.E+5 0E+3 -> 0E+3 +addx728 add -00.00 0E+3 -> 0.00 +addx729 add -00.0 0E+3 -> 0.0 +addx730 add -00. 0E+3 -> 0 + +addx732 add 0 0 -> 0 +addx733 add 0 -0 -> 0 +addx734 add -0 0 -> 0 +addx735 add -0 -0 -> -0 -- IEEE 854 special case + +addx736 add 1 -1 -> 0 +addx737 add -1 -1 -> -2 +addx738 add 1 1 -> 2 +addx739 add -1 1 -> 0 + +addx741 add 0 -1 -> -1 +addx742 add -0 -1 -> -1 +addx743 add 0 1 -> 1 +addx744 add -0 1 -> 1 +addx745 add -1 0 -> -1 +addx746 add -1 -0 -> -1 +addx747 add 1 0 -> 1 +addx748 add 1 -0 -> 1 + +addx751 add 0.0 -1 -> -1.0 +addx752 add -0.0 -1 -> -1.0 +addx753 add 0.0 1 -> 1.0 +addx754 add -0.0 1 -> 1.0 +addx755 add -1.0 0 -> -1.0 +addx756 add -1.0 -0 -> -1.0 +addx757 add 1.0 0 -> 1.0 +addx758 add 1.0 -0 -> 1.0 + +addx761 add 0 -1.0 -> -1.0 +addx762 add -0 -1.0 -> -1.0 +addx763 add 0 1.0 -> 1.0 +addx764 add -0 1.0 -> 1.0 +addx765 add -1 0.0 -> -1.0 +addx766 add -1 -0.0 -> -1.0 +addx767 add 1 0.0 -> 1.0 +addx768 add 1 -0.0 -> 1.0 + +addx771 add 0.0 -1.0 -> -1.0 +addx772 add -0.0 -1.0 -> -1.0 +addx773 add 0.0 1.0 -> 1.0 +addx774 add -0.0 1.0 -> 1.0 +addx775 add -1.0 0.0 -> -1.0 +addx776 add -1.0 -0.0 -> -1.0 +addx777 add 1.0 0.0 -> 1.0 +addx778 add 1.0 -0.0 -> 1.0 + +-- Specials +addx780 add -Inf -Inf -> -Infinity +addx781 add -Inf -1000 -> -Infinity +addx782 add -Inf -1 -> -Infinity +addx783 add -Inf -0 -> -Infinity +addx784 add -Inf 0 -> -Infinity +addx785 add -Inf 1 -> -Infinity +addx786 add -Inf 1000 -> -Infinity +addx787 add -1000 -Inf -> -Infinity +addx788 add -Inf -Inf -> -Infinity +addx789 add -1 -Inf -> -Infinity +addx790 add -0 -Inf -> -Infinity +addx791 add 0 -Inf -> -Infinity +addx792 add 1 -Inf -> -Infinity +addx793 add 1000 -Inf -> -Infinity +addx794 add Inf -Inf -> NaN Invalid_operation + +addx800 add Inf -Inf -> NaN Invalid_operation +addx801 add Inf -1000 -> Infinity +addx802 add Inf -1 -> Infinity +addx803 add Inf -0 -> Infinity +addx804 add Inf 0 -> Infinity +addx805 add Inf 1 -> Infinity +addx806 add Inf 1000 -> Infinity +addx807 add Inf Inf -> Infinity +addx808 add -1000 Inf -> Infinity +addx809 add -Inf Inf -> NaN Invalid_operation +addx810 add -1 Inf -> Infinity +addx811 add -0 Inf -> Infinity +addx812 add 0 Inf -> Infinity +addx813 add 1 Inf -> Infinity +addx814 add 1000 Inf -> Infinity +addx815 add Inf Inf -> Infinity + +addx821 add NaN -Inf -> NaN +addx822 add NaN -1000 -> NaN +addx823 add NaN -1 -> NaN +addx824 add NaN -0 -> NaN +addx825 add NaN 0 -> NaN +addx826 add NaN 1 -> NaN +addx827 add NaN 1000 -> NaN +addx828 add NaN Inf -> NaN +addx829 add NaN NaN -> NaN +addx830 add -Inf NaN -> NaN +addx831 add -1000 NaN -> NaN +addx832 add -1 NaN -> NaN +addx833 add -0 NaN -> NaN +addx834 add 0 NaN -> NaN +addx835 add 1 NaN -> NaN +addx836 add 1000 NaN -> NaN +addx837 add Inf NaN -> NaN + +addx841 add sNaN -Inf -> NaN Invalid_operation +addx842 add sNaN -1000 -> NaN Invalid_operation +addx843 add sNaN -1 -> NaN Invalid_operation +addx844 add sNaN -0 -> NaN Invalid_operation +addx845 add sNaN 0 -> NaN Invalid_operation +addx846 add sNaN 1 -> NaN Invalid_operation +addx847 add sNaN 1000 -> NaN Invalid_operation +addx848 add sNaN NaN -> NaN Invalid_operation +addx849 add sNaN sNaN -> NaN Invalid_operation +addx850 add NaN sNaN -> NaN Invalid_operation +addx851 add -Inf sNaN -> NaN Invalid_operation +addx852 add -1000 sNaN -> NaN Invalid_operation +addx853 add -1 sNaN -> NaN Invalid_operation +addx854 add -0 sNaN -> NaN Invalid_operation +addx855 add 0 sNaN -> NaN Invalid_operation +addx856 add 1 sNaN -> NaN Invalid_operation +addx857 add 1000 sNaN -> NaN Invalid_operation +addx858 add Inf sNaN -> NaN Invalid_operation +addx859 add NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +addx861 add NaN1 -Inf -> NaN1 +addx862 add +NaN2 -1000 -> NaN2 +addx863 add NaN3 1000 -> NaN3 +addx864 add NaN4 Inf -> NaN4 +addx865 add NaN5 +NaN6 -> NaN5 +addx866 add -Inf NaN7 -> NaN7 +addx867 add -1000 NaN8 -> NaN8 +addx868 add 1000 NaN9 -> NaN9 +addx869 add Inf +NaN10 -> NaN10 +addx871 add sNaN11 -Inf -> NaN11 Invalid_operation +addx872 add sNaN12 -1000 -> NaN12 Invalid_operation +addx873 add sNaN13 1000 -> NaN13 Invalid_operation +addx874 add sNaN14 NaN17 -> NaN14 Invalid_operation +addx875 add sNaN15 sNaN18 -> NaN15 Invalid_operation +addx876 add NaN16 sNaN19 -> NaN19 Invalid_operation +addx877 add -Inf +sNaN20 -> NaN20 Invalid_operation +addx878 add -1000 sNaN21 -> NaN21 Invalid_operation +addx879 add 1000 sNaN22 -> NaN22 Invalid_operation +addx880 add Inf sNaN23 -> NaN23 Invalid_operation +addx881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation +addx882 add -NaN26 NaN28 -> -NaN26 +addx883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation +addx884 add 1000 -NaN30 -> -NaN30 +addx885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- overflow, underflow and subnormal tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +addx890 add 1E+999999999 9E+999999999 -> Infinity Overflow Inexact Rounded +addx891 add 9E+999999999 1E+999999999 -> Infinity Overflow Inexact Rounded +addx892 add -1.1E-999999999 1E-999999999 -> -1E-1000000000 Subnormal +addx893 add 1E-999999999 -1.1e-999999999 -> -1E-1000000000 Subnormal +addx894 add -1.0001E-999999999 1E-999999999 -> -1E-1000000003 Subnormal +addx895 add 1E-999999999 -1.0001e-999999999 -> -1E-1000000003 Subnormal +addx896 add -1E+999999999 -9E+999999999 -> -Infinity Overflow Inexact Rounded +addx897 add -9E+999999999 -1E+999999999 -> -Infinity Overflow Inexact Rounded +addx898 add +1.1E-999999999 -1E-999999999 -> 1E-1000000000 Subnormal +addx899 add -1E-999999999 +1.1e-999999999 -> 1E-1000000000 Subnormal +addx900 add +1.0001E-999999999 -1E-999999999 -> 1E-1000000003 Subnormal +addx901 add -1E-999999999 +1.0001e-999999999 -> 1E-1000000003 Subnormal +addx902 add -1E+999999999 +9E+999999999 -> 8E+999999999 +addx903 add -9E+999999999 +1E+999999999 -> -8E+999999999 + +precision: 3 +addx904 add 0 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded +addx905 add -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded +addx906 add 0 9.999E+999999999 -> Infinity Inexact Overflow Rounded +addx907 add 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded + +precision: 3 +maxexponent: 999 +minexponent: -999 +addx910 add 1.00E-999 0 -> 1.00E-999 +addx911 add 0.1E-999 0 -> 1E-1000 Subnormal +addx912 add 0.10E-999 0 -> 1.0E-1000 Subnormal +addx913 add 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded +addx914 add 0.01E-999 0 -> 1E-1001 Subnormal +-- next is rounded to Nmin +addx915 add 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow +addx916 add 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +addx917 add 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow +addx918 add 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx919 add 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx920 add 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +addx930 add -1.00E-999 0 -> -1.00E-999 +addx931 add -0.1E-999 0 -> -1E-1000 Subnormal +addx932 add -0.10E-999 0 -> -1.0E-1000 Subnormal +addx933 add -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded +addx934 add -0.01E-999 0 -> -1E-1001 Subnormal +-- next is rounded to Nmin +addx935 add -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow +addx936 add -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +addx937 add -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow +addx938 add -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx939 add -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx940 add -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- some non-zero subnormal adds +addx950 add 1.00E-999 0.1E-999 -> 1.10E-999 +addx951 add 0.1E-999 0.1E-999 -> 2E-1000 Subnormal +addx952 add 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal +addx953 add 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded +addx954 add 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal +addx955 add 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded +addx956 add 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow +addx957 add 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow +addx958 add 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +addx959 add 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +addx960 add 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +-- negatives... +addx961 add 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal +addx962 add 0.1E-999 -0.1E-999 -> 0E-1000 +addx963 add 0.10E-999 -0.1E-999 -> 0E-1001 +addx964 add 0.100E-999 -0.1E-999 -> 0E-1001 Clamped +addx965 add 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal +addx966 add 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow +addx967 add 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx968 add 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow +addx969 add 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +addx970 add 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +addx971 add 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow + +-- some 'real' numbers +maxExponent: 384 +minExponent: -383 +precision: 8 +addx566 add 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal +precision: 7 +addx567 add 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal +precision: 6 +addx568 add 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal + +-- now the case where we can get underflow but the result is normal +-- [note this can't happen if the operands are also bounded, as we +-- cannot represent 1E-399, for example] +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +addx571 add 1E-383 0 -> 1E-383 +addx572 add 1E-384 0 -> 1E-384 Subnormal +addx573 add 1E-383 1E-384 -> 1.1E-383 +addx574 subtract 1E-383 1E-384 -> 9E-384 Subnormal + +-- Here we explore the boundary of rounding a subnormal to Nmin +addx575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- check overflow edge case +precision: 7 +rounding: half_up +maxExponent: 96 +minExponent: -95 +addx972 apply 9.999999E+96 -> 9.999999E+96 +addx973 add 9.999999E+96 1 -> 9.999999E+96 Inexact Rounded +addx974 add 9999999E+90 1 -> 9.999999E+96 Inexact Rounded +addx975 add 9999999E+90 1E+90 -> Infinity Overflow Inexact Rounded +addx976 add 9999999E+90 9E+89 -> Infinity Overflow Inexact Rounded +addx977 add 9999999E+90 8E+89 -> Infinity Overflow Inexact Rounded +addx978 add 9999999E+90 7E+89 -> Infinity Overflow Inexact Rounded +addx979 add 9999999E+90 6E+89 -> Infinity Overflow Inexact Rounded +addx980 add 9999999E+90 5E+89 -> Infinity Overflow Inexact Rounded +addx981 add 9999999E+90 4E+89 -> 9.999999E+96 Inexact Rounded +addx982 add 9999999E+90 3E+89 -> 9.999999E+96 Inexact Rounded +addx983 add 9999999E+90 2E+89 -> 9.999999E+96 Inexact Rounded +addx984 add 9999999E+90 1E+89 -> 9.999999E+96 Inexact Rounded + +addx985 apply -9.999999E+96 -> -9.999999E+96 +addx986 add -9.999999E+96 -1 -> -9.999999E+96 Inexact Rounded +addx987 add -9999999E+90 -1 -> -9.999999E+96 Inexact Rounded +addx988 add -9999999E+90 -1E+90 -> -Infinity Overflow Inexact Rounded +addx989 add -9999999E+90 -9E+89 -> -Infinity Overflow Inexact Rounded +addx990 add -9999999E+90 -8E+89 -> -Infinity Overflow Inexact Rounded +addx991 add -9999999E+90 -7E+89 -> -Infinity Overflow Inexact Rounded +addx992 add -9999999E+90 -6E+89 -> -Infinity Overflow Inexact Rounded +addx993 add -9999999E+90 -5E+89 -> -Infinity Overflow Inexact Rounded +addx994 add -9999999E+90 -4E+89 -> -9.999999E+96 Inexact Rounded +addx995 add -9999999E+90 -3E+89 -> -9.999999E+96 Inexact Rounded +addx996 add -9999999E+90 -2E+89 -> -9.999999E+96 Inexact Rounded +addx997 add -9999999E+90 -1E+89 -> -9.999999E+96 Inexact Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +-- Add: lhs and rhs 0 +addx1001 add 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1002 add 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1003 add 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1004 add 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1005 add 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1006 add 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Add: lhs >> rhs and vice versa +addx1011 add 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1012 add 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1013 add 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1014 add 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1015 add 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1016 add 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Add: lhs + rhs addition carried out +addx1021 add 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1022 add 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1023 add 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1024 add 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1025 add 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1026 add 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow + +-- And for round down full and subnormal results +precision: 16 +maxExponent: +384 +minExponent: -383 +rounding: down + +addx1100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +addx1101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +addx1103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +addx1104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +addx1105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +addx1106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +addx1107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +addx1108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +addx1109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +addx1110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +addx1111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +addx1113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +addx1114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +addx1115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +addx1116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +addx1117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +addx1118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +addx1119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact +addx1120 add +1e-383 -1e+2 -> -99.99999999999999 Rounded Inexact +addx1121 add +1e-383 -1e+1 -> -9.999999999999999 Rounded Inexact +addx1123 add +1e-383 -1 -> -0.9999999999999999 Rounded Inexact +addx1124 add +1e-383 -1e-1 -> -0.09999999999999999 Rounded Inexact +addx1125 add +1e-383 -1e-2 -> -0.009999999999999999 Rounded Inexact +addx1126 add +1e-383 -1e-3 -> -0.0009999999999999999 Rounded Inexact +addx1127 add +1e-383 -1e-4 -> -0.00009999999999999999 Rounded Inexact +addx1128 add +1e-383 -1e-5 -> -0.000009999999999999999 Rounded Inexact +addx1129 add +1e-383 -1e-6 -> -9.999999999999999E-7 Rounded Inexact + +rounding: down +precision: 7 +maxExponent: +96 +minExponent: -95 +addx1130 add 1 -1e-200 -> 0.9999999 Rounded Inexact +-- subnormal boundary +addx1131 add 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact +addx1132 add 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact +addx1133 add 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow +addx1134 add 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow +addx1135 add 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow +addx1136 add 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow +addx1137 add 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal +addx1138 add 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow +addx1139 add 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow +addx1140 add 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow +addx1141 add 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow +addx1142 add 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1143 add 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1144 add 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +addx1151 add 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow +addx1152 add 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow +addx1153 add 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow +addx1154 add 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1155 add 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1156 add 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1157 add 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +addx1160 add 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1161 add 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +-- tests based on Gunnar Degnbol's edge case +precision: 15 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +addx1200 add 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded +addx1201 add 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded +addx1210 add 1E15 -0.51 -> 999999999999999 Inexact Rounded +addx1211 add 1E15 -0.501 -> 999999999999999 Inexact Rounded +addx1212 add 1E15 -0.5001 -> 999999999999999 Inexact Rounded +addx1213 add 1E15 -0.50001 -> 999999999999999 Inexact Rounded +addx1214 add 1E15 -0.500001 -> 999999999999999 Inexact Rounded +addx1215 add 1E15 -0.5000001 -> 999999999999999 Inexact Rounded +addx1216 add 1E15 -0.50000001 -> 999999999999999 Inexact Rounded +addx1217 add 1E15 -0.500000001 -> 999999999999999 Inexact Rounded +addx1218 add 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded +addx1219 add 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded +addx1220 add 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded +addx1221 add 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded +addx1222 add 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded +addx1223 add 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded +addx1224 add 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded +addx1225 add 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded +addx1230 add 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded + +precision: 16 + +addx1300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +addx1310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded +addx1311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded +addx1312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +addx1313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +addx1314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +addx1315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +addx1316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +addx1317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +addx1318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +addx1319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +addx1320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +addx1321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +addx1322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +addx1323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +addx1324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +addx1325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx1333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx1334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx1335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx1336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx1337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx1338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +addx1339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +addx1340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +addx1341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +addx1349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +addx1350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +addx1351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +addx1352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +addx1353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +addx1354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +addx1355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +addx1356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +addx1357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +addx1358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +addx1359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +addx1360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +addx1361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +addx1362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +addx1363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +addx1364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +addx1365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx1374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx1375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx1376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx1377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx1378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx1379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +addx1380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +addx1381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +addx1382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +addx1390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +addx1391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +addx1392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +addx1393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +addx1394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +addx1395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +addx1396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +precision: 15 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +addx1400 add 0 1.23456789012345 -> 1.23456789012345 +addx1401 add 0 1.23456789012345E-1 -> 0.123456789012345 +addx1402 add 0 1.23456789012345E-2 -> 0.0123456789012345 +addx1403 add 0 1.23456789012345E-3 -> 0.00123456789012345 +addx1404 add 0 1.23456789012345E-4 -> 0.000123456789012345 +addx1405 add 0 1.23456789012345E-5 -> 0.0000123456789012345 +addx1406 add 0 1.23456789012345E-6 -> 0.00000123456789012345 +addx1407 add 0 1.23456789012345E-7 -> 1.23456789012345E-7 +addx1408 add 0 1.23456789012345E-8 -> 1.23456789012345E-8 +addx1409 add 0 1.23456789012345E-9 -> 1.23456789012345E-9 +addx1410 add 0 1.23456789012345E-10 -> 1.23456789012345E-10 +addx1411 add 0 1.23456789012345E-11 -> 1.23456789012345E-11 +addx1412 add 0 1.23456789012345E-12 -> 1.23456789012345E-12 +addx1413 add 0 1.23456789012345E-13 -> 1.23456789012345E-13 +addx1414 add 0 1.23456789012345E-14 -> 1.23456789012345E-14 +addx1415 add 0 1.23456789012345E-15 -> 1.23456789012345E-15 +addx1416 add 0 1.23456789012345E-16 -> 1.23456789012345E-16 +addx1417 add 0 1.23456789012345E-17 -> 1.23456789012345E-17 +addx1418 add 0 1.23456789012345E-18 -> 1.23456789012345E-18 +addx1419 add 0 1.23456789012345E-19 -> 1.23456789012345E-19 + +-- same, precision 16.. +precision: 16 +addx1420 add 0 1.123456789012345 -> 1.123456789012345 +addx1421 add 0 1.123456789012345E-1 -> 0.1123456789012345 +addx1422 add 0 1.123456789012345E-2 -> 0.01123456789012345 +addx1423 add 0 1.123456789012345E-3 -> 0.001123456789012345 +addx1424 add 0 1.123456789012345E-4 -> 0.0001123456789012345 +addx1425 add 0 1.123456789012345E-5 -> 0.00001123456789012345 +addx1426 add 0 1.123456789012345E-6 -> 0.000001123456789012345 +addx1427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7 +addx1428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8 +addx1429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9 +addx1430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10 +addx1431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11 +addx1432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12 +addx1433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13 +addx1434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14 +addx1435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15 +addx1436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16 +addx1437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17 +addx1438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18 +addx1439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +addx1440 add 1.123456789012345 0 -> 1.123456789012345 +addx1441 add 1.123456789012345E-1 0 -> 0.1123456789012345 +addx1442 add 1.123456789012345E-2 0 -> 0.01123456789012345 +addx1443 add 1.123456789012345E-3 0 -> 0.001123456789012345 +addx1444 add 1.123456789012345E-4 0 -> 0.0001123456789012345 +addx1445 add 1.123456789012345E-5 0 -> 0.00001123456789012345 +addx1446 add 1.123456789012345E-6 0 -> 0.000001123456789012345 +addx1447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7 +addx1448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8 +addx1449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9 +addx1450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10 +addx1451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11 +addx1452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12 +addx1453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13 +addx1454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14 +addx1455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15 +addx1456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16 +addx1457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17 +addx1458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18 +addx1459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +addx1460 add 1.123456789012345 0E-0 -> 1.123456789012345 +addx1461 add 1.123456789012345 0E-1 -> 1.123456789012345 +addx1462 add 1.123456789012345 0E-2 -> 1.123456789012345 +addx1463 add 1.123456789012345 0E-3 -> 1.123456789012345 +addx1464 add 1.123456789012345 0E-4 -> 1.123456789012345 +addx1465 add 1.123456789012345 0E-5 -> 1.123456789012345 +addx1466 add 1.123456789012345 0E-6 -> 1.123456789012345 +addx1467 add 1.123456789012345 0E-7 -> 1.123456789012345 +addx1468 add 1.123456789012345 0E-8 -> 1.123456789012345 +addx1469 add 1.123456789012345 0E-9 -> 1.123456789012345 +addx1470 add 1.123456789012345 0E-10 -> 1.123456789012345 +addx1471 add 1.123456789012345 0E-11 -> 1.123456789012345 +addx1472 add 1.123456789012345 0E-12 -> 1.123456789012345 +addx1473 add 1.123456789012345 0E-13 -> 1.123456789012345 +addx1474 add 1.123456789012345 0E-14 -> 1.123456789012345 +addx1475 add 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded because the 0 extends the result +addx1476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +addx1477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +addx1478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +addx1479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +precision: 16 +maxExponent: 384 +minexponent: -383 + +rounding: half_up +-- exact zeros from zeros +addx1500 add 0 0E-19 -> 0E-19 +addx1501 add -0 0E-19 -> 0E-19 +addx1502 add 0 -0E-19 -> 0E-19 +addx1503 add -0 -0E-19 -> -0E-19 +addx1504 add 0E-400 0E-19 -> 0E-398 Clamped +addx1505 add -0E-400 0E-19 -> 0E-398 Clamped +addx1506 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1507 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1511 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1512 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1513 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1514 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1515 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1516 add -1E-401 1E-401 -> 0E-398 Clamped +addx1517 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1518 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_down +-- exact zeros from zeros +addx1520 add 0 0E-19 -> 0E-19 +addx1521 add -0 0E-19 -> 0E-19 +addx1522 add 0 -0E-19 -> 0E-19 +addx1523 add -0 -0E-19 -> -0E-19 +addx1524 add 0E-400 0E-19 -> 0E-398 Clamped +addx1525 add -0E-400 0E-19 -> 0E-398 Clamped +addx1526 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1527 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1531 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1532 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1533 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1534 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1535 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1536 add -1E-401 1E-401 -> 0E-398 Clamped +addx1537 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1538 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_even +-- exact zeros from zeros +addx1540 add 0 0E-19 -> 0E-19 +addx1541 add -0 0E-19 -> 0E-19 +addx1542 add 0 -0E-19 -> 0E-19 +addx1543 add -0 -0E-19 -> -0E-19 +addx1544 add 0E-400 0E-19 -> 0E-398 Clamped +addx1545 add -0E-400 0E-19 -> 0E-398 Clamped +addx1546 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1547 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1551 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1552 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1553 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1554 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1555 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1556 add -1E-401 1E-401 -> 0E-398 Clamped +addx1557 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1558 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: up +-- exact zeros from zeros +addx1560 add 0 0E-19 -> 0E-19 +addx1561 add -0 0E-19 -> 0E-19 +addx1562 add 0 -0E-19 -> 0E-19 +addx1563 add -0 -0E-19 -> -0E-19 +addx1564 add 0E-400 0E-19 -> 0E-398 Clamped +addx1565 add -0E-400 0E-19 -> 0E-398 Clamped +addx1566 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1567 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1571 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1572 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1573 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx1574 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx1575 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1576 add -1E-401 1E-401 -> 0E-398 Clamped +addx1577 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1578 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +rounding: down +-- exact zeros from zeros +addx1580 add 0 0E-19 -> 0E-19 +addx1581 add -0 0E-19 -> 0E-19 +addx1582 add 0 -0E-19 -> 0E-19 +addx1583 add -0 -0E-19 -> -0E-19 +addx1584 add 0E-400 0E-19 -> 0E-398 Clamped +addx1585 add -0E-400 0E-19 -> 0E-398 Clamped +addx1586 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1587 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1591 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1592 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1593 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1594 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1595 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1596 add -1E-401 1E-401 -> 0E-398 Clamped +addx1597 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1598 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: ceiling +-- exact zeros from zeros +addx1600 add 0 0E-19 -> 0E-19 +addx1601 add -0 0E-19 -> 0E-19 +addx1602 add 0 -0E-19 -> 0E-19 +addx1603 add -0 -0E-19 -> -0E-19 +addx1604 add 0E-400 0E-19 -> 0E-398 Clamped +addx1605 add -0E-400 0E-19 -> 0E-398 Clamped +addx1606 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1607 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1611 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1612 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1613 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1614 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1615 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1616 add -1E-401 1E-401 -> 0E-398 Clamped +addx1617 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1618 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +addx1620 add 0 0E-19 -> 0E-19 +addx1621 add -0 0E-19 -> -0E-19 -- * +addx1622 add 0 -0E-19 -> -0E-19 -- * +addx1623 add -0 -0E-19 -> -0E-19 +addx1624 add 0E-400 0E-19 -> 0E-398 Clamped +addx1625 add -0E-400 0E-19 -> -0E-398 Clamped -- * +addx1626 add 0E-400 -0E-19 -> -0E-398 Clamped -- * +addx1627 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1631 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1632 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1633 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx1634 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx1635 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1636 add -1E-401 1E-401 -> -0E-398 Clamped -- * +addx1637 add 1E-401 -1E-401 -> -0E-398 Clamped -- * +addx1638 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +-- BigDecimal problem testcases 2006.01.23 +precision: 16 +maxExponent: 384 +minexponent: -383 + +rounding: down +precision: 7 +addx1651 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +addx1652 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +addx1653 add 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded +precision: 4 +addx1654 add 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded +precision: 3 +addx1655 add 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded +precision: 2 +addx1656 add 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded +precision: 1 +addx1657 add 10001E+2 -2E+1 -> 1E+6 Inexact Rounded + +rounding: half_even +precision: 7 +addx1661 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +addx1662 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +addx1663 add 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded +precision: 4 +addx1664 add 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded +precision: 3 +addx1665 add 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded +precision: 2 +addx1666 add 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded +precision: 1 +addx1667 add 10001E+2 -2E+1 -> 1E+6 Inexact Rounded + +rounding: up +precision: 7 +addx1671 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +addx1672 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +addx1673 add 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded +precision: 4 +addx1674 add 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded +precision: 3 +addx1675 add 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded +precision: 2 +addx1676 add 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded +precision: 1 +addx1677 add 10001E+2 -2E+1 -> 2E+6 Inexact Rounded + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Examples from SQL proposal (Krishna Kulkarni) +addx1701 add 130E-2 120E-2 -> 2.50 +addx1702 add 130E-2 12E-1 -> 2.50 +addx1703 add 130E-2 1E0 -> 2.30 +addx1704 add 1E2 1E4 -> 1.01E+4 +addx1705 subtract 130E-2 120E-2 -> 0.10 +addx1706 subtract 130E-2 12E-1 -> 0.10 +addx1707 subtract 130E-2 1E0 -> 0.30 +addx1708 subtract 1E2 1E4 -> -9.9E+3 + +------------------------------------------------------------------------ +-- Same as above, using decimal64 default parameters -- +------------------------------------------------------------------------ +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- [first group are 'quick confidence check'] +addx6001 add 1 1 -> 2 +addx6002 add 2 3 -> 5 +addx6003 add '5.75' '3.3' -> 9.05 +addx6004 add '5' '-3' -> 2 +addx6005 add '-5' '-3' -> -8 +addx6006 add '-7' '2.5' -> -4.5 +addx6007 add '0.7' '0.3' -> 1.0 +addx6008 add '1.25' '1.25' -> 2.50 +addx6009 add '1.23456789' '1.00000000' -> '2.23456789' +addx6010 add '1.23456789' '1.00000011' -> '2.23456800' + +addx6011 add '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded +addx6012 add '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded +addx6013 add '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded +addx6014 add '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded +addx6015 add '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded +addx6016 add '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded +addx6017 add '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded +addx6018 add '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded +addx6019 add '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded +addx6020 add '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded + +addx6021 add 0 1 -> 1 +addx6022 add 1 1 -> 2 +addx6023 add 2 1 -> 3 +addx6024 add 3 1 -> 4 +addx6025 add 4 1 -> 5 +addx6026 add 5 1 -> 6 +addx6027 add 6 1 -> 7 +addx6028 add 7 1 -> 8 +addx6029 add 8 1 -> 9 +addx6030 add 9 1 -> 10 + +-- some carrying effects +addx6031 add '0.9998' '0.0000' -> '0.9998' +addx6032 add '0.9998' '0.0001' -> '0.9999' +addx6033 add '0.9998' '0.0002' -> '1.0000' +addx6034 add '0.9998' '0.0003' -> '1.0001' + +addx6035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +addx6036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +addx6037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +addx6038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded +addx6039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded + +-- symmetry: +addx6040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded +addx6041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded +addx6042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded +addx6044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded +addx6045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded + +addx6046 add '10000e+9' '7' -> '10000000000007' +addx6047 add '10000e+9' '70' -> '10000000000070' +addx6048 add '10000e+9' '700' -> '10000000000700' +addx6049 add '10000e+9' '7000' -> '10000000007000' +addx6050 add '10000e+9' '70000' -> '10000000070000' +addx6051 add '10000e+9' '700000' -> '10000000700000' + +-- examples from decarith +addx6053 add '12' '7.00' -> '19.00' +addx6054 add '1.3' '-1.07' -> '0.23' +addx6055 add '1.3' '-1.30' -> '0.00' +addx6056 add '1.3' '-2.07' -> '-0.77' +addx6057 add '1E+2' '1E+4' -> '1.01E+4' + +-- from above +addx6060 add 1 '0.1' -> '1.1' +addx6061 add 1 '0.01' -> '1.01' +addx6062 add 1 '0.001' -> '1.001' +addx6063 add 1 '0.0001' -> '1.0001' +addx6064 add 1 '0.00001' -> '1.00001' +addx6065 add 1 '0.000001' -> '1.000001' +addx6066 add 1 '0.0000001' -> '1.0000001' +addx6067 add 1 '0.00000001' -> '1.00000001' + +-- cancellation to integer +addx6068 add 99999999999999123456789 -99999999999999E+9 -> 123456789 +-- similar from FMA fun +addx6069 add "-1234567890123455.234567890123454" "1234567890123456" -> 0.765432109876546 + +-- some funny zeros [in case of bad signum] +addx6070 add 1 0 -> 1 +addx6071 add 1 0. -> 1 +addx6072 add 1 .0 -> 1.0 +addx6073 add 1 0.0 -> 1.0 +addx6074 add 1 0.00 -> 1.00 +addx6075 add 0 1 -> 1 +addx6076 add 0. 1 -> 1 +addx6077 add .0 1 -> 1.0 +addx6078 add 0.0 1 -> 1.0 +addx6079 add 0.00 1 -> 1.00 + +-- some carries +addx6080 add 9999999999999998 1 -> 9999999999999999 +addx6081 add 9999999999999999 1 -> 1.000000000000000E+16 Rounded +addx6082 add 999999999999999 1 -> 1000000000000000 +addx6083 add 9999999999999 1 -> 10000000000000 +addx6084 add 99999999999 1 -> 100000000000 +addx6085 add 999999999 1 -> 1000000000 +addx6086 add 9999999 1 -> 10000000 +addx6087 add 99999 1 -> 100000 +addx6088 add 999 1 -> 1000 +addx6089 add 9 1 -> 10 + + +-- more LHS swaps +addx6090 add '-56267E-10' 0 -> '-0.0000056267' +addx6091 add '-56267E-6' 0 -> '-0.056267' +addx6092 add '-56267E-5' 0 -> '-0.56267' +addx6093 add '-56267E-4' 0 -> '-5.6267' +addx6094 add '-56267E-3' 0 -> '-56.267' +addx6095 add '-56267E-2' 0 -> '-562.67' +addx6096 add '-56267E-1' 0 -> '-5626.7' +addx6097 add '-56267E-0' 0 -> '-56267' +addx6098 add '-5E-10' 0 -> '-5E-10' +addx6099 add '-5E-7' 0 -> '-5E-7' +addx6100 add '-5E-6' 0 -> '-0.000005' +addx6101 add '-5E-5' 0 -> '-0.00005' +addx6102 add '-5E-4' 0 -> '-0.0005' +addx6103 add '-5E-1' 0 -> '-0.5' +addx6104 add '-5E0' 0 -> '-5' +addx6105 add '-5E1' 0 -> '-50' +addx6106 add '-5E5' 0 -> '-500000' +addx6107 add '-5E15' 0 -> '-5000000000000000' +addx6108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded +addx6109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded +addx6110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded +addx6111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded + +-- more RHS swaps +addx6113 add 0 '-56267E-10' -> '-0.0000056267' +addx6114 add 0 '-56267E-6' -> '-0.056267' +addx6116 add 0 '-56267E-5' -> '-0.56267' +addx6117 add 0 '-56267E-4' -> '-5.6267' +addx6119 add 0 '-56267E-3' -> '-56.267' +addx6120 add 0 '-56267E-2' -> '-562.67' +addx6121 add 0 '-56267E-1' -> '-5626.7' +addx6122 add 0 '-56267E-0' -> '-56267' +addx6123 add 0 '-5E-10' -> '-5E-10' +addx6124 add 0 '-5E-7' -> '-5E-7' +addx6125 add 0 '-5E-6' -> '-0.000005' +addx6126 add 0 '-5E-5' -> '-0.00005' +addx6127 add 0 '-5E-4' -> '-0.0005' +addx6128 add 0 '-5E-1' -> '-0.5' +addx6129 add 0 '-5E0' -> '-5' +addx6130 add 0 '-5E1' -> '-50' +addx6131 add 0 '-5E5' -> '-500000' +addx6132 add 0 '-5E15' -> '-5000000000000000' +addx6133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded +addx6134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded +addx6135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded +addx6136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded + +-- related +addx6137 add 1 '0E-19' -> '1.000000000000000' Rounded +addx6138 add -1 '0E-19' -> '-1.000000000000000' Rounded +addx6139 add '0E-19' 1 -> '1.000000000000000' Rounded +addx6140 add '0E-19' -1 -> '-1.000000000000000' Rounded +addx6141 add 1E+11 0.0000 -> '100000000000.0000' +addx6142 add 1E+11 0.00000 -> '100000000000.0000' Rounded +addx6143 add 0.000 1E+12 -> '1000000000000.000' +addx6144 add 0.0000 1E+12 -> '1000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +addx6146 add '00.0' 0 -> '0.0' +addx6147 add '0.00' 0 -> '0.00' +addx6148 add 0 '0.00' -> '0.00' +addx6149 add 0 '00.0' -> '0.0' +addx6150 add '00.0' '0.00' -> '0.00' +addx6151 add '0.00' '00.0' -> '0.00' +addx6152 add '3' '.3' -> '3.3' +addx6153 add '3.' '.3' -> '3.3' +addx6154 add '3.0' '.3' -> '3.3' +addx6155 add '3.00' '.3' -> '3.30' +addx6156 add '3' '3' -> '6' +addx6157 add '3' '+3' -> '6' +addx6158 add '3' '-3' -> '0' +addx6159 add '0.3' '-0.3' -> '0.0' +addx6160 add '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +addx6161 add '1E+13' '-1' -> '9999999999999' +addx6162 add '1E+13' '1.11' -> '10000000000001.11' +addx6163 add '1.11' '1E+13' -> '10000000000001.11' +addx6164 add '-1' '1E+13' -> '9999999999999' +addx6165 add '7E+13' '-1' -> '69999999999999' +addx6166 add '7E+13' '1.11' -> '70000000000001.11' +addx6167 add '1.11' '7E+13' -> '70000000000001.11' +addx6168 add '-1' '7E+13' -> '69999999999999' + +-- 1234567890123456 1234567890123456 1 234567890123456 +addx6170 add '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded +addx6171 add '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded +addx6172 add '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded +addx6173 add '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded +addx6174 add '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded +addx6175 add '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded +addx6176 add '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded +addx6177 add '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded +addx6178 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999' +addx6179 add '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998' +addx6180 add '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997' +addx6181 add '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996' +addx6182 add '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995' +addx6183 add '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994' + +-- and some more, including residue effects and different roundings +rounding: half_up +addx6200 add '6543210123456789' 0 -> '6543210123456789' +addx6201 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +addx6202 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +addx6203 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +addx6204 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +addx6205 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +addx6206 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +addx6207 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +addx6208 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +addx6209 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +addx6210 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +addx6211 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +addx6212 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +addx6213 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +addx6214 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +addx6215 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +addx6216 add '6543210123456789' 1 -> '6543210123456790' +addx6217 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded +addx6218 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +addx6219 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +rounding: half_even +addx6220 add '6543210123456789' 0 -> '6543210123456789' +addx6221 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +addx6222 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +addx6223 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +addx6224 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +addx6225 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +addx6226 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +addx6227 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +addx6228 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +addx6229 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +addx6230 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +addx6231 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +addx6232 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +addx6233 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +addx6234 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +addx6235 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +addx6236 add '6543210123456789' 1 -> '6543210123456790' +addx6237 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +addx6238 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +addx6239 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded +-- critical few with even bottom digit... +addx6240 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded +addx6241 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded +addx6242 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded + +rounding: down +addx6250 add '6543210123456789' 0 -> '6543210123456789' +addx6251 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +addx6252 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +addx6253 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +addx6254 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +addx6255 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +addx6256 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +addx6257 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +addx6258 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded +addx6259 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded +addx6260 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded +addx6261 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded +addx6262 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded +addx6263 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded +addx6264 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded +addx6265 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded +addx6266 add '6543210123456789' 1 -> '6543210123456790' +addx6267 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +addx6268 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +addx6269 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_even +addx6301 add -1 1 -> 0 +addx6302 add 0 1 -> 1 +addx6303 add 1 1 -> 2 +addx6304 add 12 1 -> 13 +addx6305 add 98 1 -> 99 +addx6306 add 99 1 -> 100 +addx6307 add 100 1 -> 101 +addx6308 add 101 1 -> 102 +addx6309 add -1 -1 -> -2 +addx6310 add 0 -1 -> -1 +addx6311 add 1 -1 -> 0 +addx6312 add 12 -1 -> 11 +addx6313 add 98 -1 -> 97 +addx6314 add 99 -1 -> 98 +addx6315 add 100 -1 -> 99 +addx6316 add 101 -1 -> 100 + +addx6321 add -0.01 0.01 -> 0.00 +addx6322 add 0.00 0.01 -> 0.01 +addx6323 add 0.01 0.01 -> 0.02 +addx6324 add 0.12 0.01 -> 0.13 +addx6325 add 0.98 0.01 -> 0.99 +addx6326 add 0.99 0.01 -> 1.00 +addx6327 add 1.00 0.01 -> 1.01 +addx6328 add 1.01 0.01 -> 1.02 +addx6329 add -0.01 -0.01 -> -0.02 +addx6330 add 0.00 -0.01 -> -0.01 +addx6331 add 0.01 -0.01 -> 0.00 +addx6332 add 0.12 -0.01 -> 0.11 +addx6333 add 0.98 -0.01 -> 0.97 +addx6334 add 0.99 -0.01 -> 0.98 +addx6335 add 1.00 -0.01 -> 0.99 +addx6336 add 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +addx6340 add 1E+3 0 -> 1000 +addx6341 add 1E+15 0 -> 1000000000000000 +addx6342 add 1E+16 0 -> 1.000000000000000E+16 Rounded +addx6343 add 1E+17 0 -> 1.000000000000000E+17 Rounded +-- which simply follow from these cases ... +addx6344 add 1E+3 1 -> 1001 +addx6345 add 1E+15 1 -> 1000000000000001 +addx6346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded +addx6347 add 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded +addx6348 add 1E+3 7 -> 1007 +addx6349 add 1E+15 7 -> 1000000000000007 +addx6350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded +addx6351 add 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded + +-- tryzeros cases +addx6361 add 0E+50 10000E+1 -> 1.0000E+5 +addx6362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded +addx6363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact +addx6364 add 12.34 0e-398 -> 12.34000000000000 Rounded + +-- ulp replacement tests +addx6400 add 1 77e-14 -> 1.00000000000077 +addx6401 add 1 77e-15 -> 1.000000000000077 +addx6402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded +addx6403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded +addx6404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded +addx6405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded +addx6406 add 1 77e-99 -> 1.000000000000000 Inexact Rounded + +addx6410 add 10 77e-14 -> 10.00000000000077 +addx6411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded +addx6412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded +addx6413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded +addx6414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded +addx6415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded +addx6416 add 10 77e-99 -> 10.00000000000000 Inexact Rounded + +addx6420 add 77e-14 1 -> 1.00000000000077 +addx6421 add 77e-15 1 -> 1.000000000000077 +addx6422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded +addx6423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded +addx6424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded +addx6425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded +addx6426 add 77e-99 1 -> 1.000000000000000 Inexact Rounded + +addx6430 add 77e-14 10 -> 10.00000000000077 +addx6431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded +addx6432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded +addx6433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded +addx6434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded +addx6435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded +addx6436 add 77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +addx6440 add 1 -77e-14 -> 0.99999999999923 +addx6441 add 1 -77e-15 -> 0.999999999999923 +addx6442 add 1 -77e-16 -> 0.9999999999999923 +addx6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded +addx6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded +addx6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded +addx6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded + +addx6450 add 10 -77e-14 -> 9.99999999999923 +addx6451 add 10 -77e-15 -> 9.999999999999923 +addx6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded +addx6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded +addx6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded +addx6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded +addx6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded + +addx6460 add -77e-14 1 -> 0.99999999999923 +addx6461 add -77e-15 1 -> 0.999999999999923 +addx6462 add -77e-16 1 -> 0.9999999999999923 +addx6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded +addx6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded +addx6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded +addx6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded + +addx6470 add -77e-14 10 -> 9.99999999999923 +addx6471 add -77e-15 10 -> 9.999999999999923 +addx6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded +addx6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded +addx6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded +addx6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded +addx6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +addx6480 add -1 77e-14 -> -0.99999999999923 +addx6481 add -1 77e-15 -> -0.999999999999923 +addx6482 add -1 77e-16 -> -0.9999999999999923 +addx6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded +addx6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded +addx6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded +addx6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded + +addx6490 add -10 77e-14 -> -9.99999999999923 +addx6491 add -10 77e-15 -> -9.999999999999923 +addx6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded +addx6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded +addx6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded +addx6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded +addx6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded + +addx6500 add 77e-14 -1 -> -0.99999999999923 +addx6501 add 77e-15 -1 -> -0.999999999999923 +addx6502 add 77e-16 -1 -> -0.9999999999999923 +addx6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded +addx6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded +addx6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded +addx6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded + +addx6510 add 77e-14 -10 -> -9.99999999999923 +addx6511 add 77e-15 -10 -> -9.999999999999923 +addx6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded +addx6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded +addx6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded +addx6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded +addx6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded + + +-- long operands +addx6521 add 101234562345678000 0 -> 1.012345623456780E+17 Rounded +addx6522 add 0 101234562345678000 -> 1.012345623456780E+17 Rounded +addx6523 add 10123456234567800 0 -> 1.012345623456780E+16 Rounded +addx6524 add 0 10123456234567800 -> 1.012345623456780E+16 Rounded +addx6525 add 10123456234567890 0 -> 1.012345623456789E+16 Rounded +addx6526 add 0 10123456234567890 -> 1.012345623456789E+16 Rounded +addx6527 add 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded +addx6528 add 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded +addx6529 add 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded +addx6530 add 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded +addx6531 add 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded +addx6532 add 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded + +-- verify a query +rounding: down +addx6561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +addx6562 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +-- and using decimal64 bounds... +rounding: down +addx6563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +addx6564 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + +-- more zeros, etc. +rounding: half_even + +addx6701 add 5.00 1.00E-3 -> 5.00100 +addx6702 add 00.00 0.000 -> 0.000 +addx6703 add 00.00 0E-3 -> 0.000 +addx6704 add 0E-3 00.00 -> 0.000 + +addx6710 add 0E+3 00.00 -> 0.00 +addx6711 add 0E+3 00.0 -> 0.0 +addx6712 add 0E+3 00. -> 0 +addx6713 add 0E+3 00.E+1 -> 0E+1 +addx6714 add 0E+3 00.E+2 -> 0E+2 +addx6715 add 0E+3 00.E+3 -> 0E+3 +addx6716 add 0E+3 00.E+4 -> 0E+3 +addx6717 add 0E+3 00.E+5 -> 0E+3 +addx6718 add 0E+3 -00.0 -> 0.0 +addx6719 add 0E+3 -00. -> 0 +addx6731 add 0E+3 -00.E+1 -> 0E+1 + +addx6720 add 00.00 0E+3 -> 0.00 +addx6721 add 00.0 0E+3 -> 0.0 +addx6722 add 00. 0E+3 -> 0 +addx6723 add 00.E+1 0E+3 -> 0E+1 +addx6724 add 00.E+2 0E+3 -> 0E+2 +addx6725 add 00.E+3 0E+3 -> 0E+3 +addx6726 add 00.E+4 0E+3 -> 0E+3 +addx6727 add 00.E+5 0E+3 -> 0E+3 +addx6728 add -00.00 0E+3 -> 0.00 +addx6729 add -00.0 0E+3 -> 0.0 +addx6730 add -00. 0E+3 -> 0 + +addx6732 add 0 0 -> 0 +addx6733 add 0 -0 -> 0 +addx6734 add -0 0 -> 0 +addx6735 add -0 -0 -> -0 -- IEEE 854 special case + +addx6736 add 1 -1 -> 0 +addx6737 add -1 -1 -> -2 +addx6738 add 1 1 -> 2 +addx6739 add -1 1 -> 0 + +addx6741 add 0 -1 -> -1 +addx6742 add -0 -1 -> -1 +addx6743 add 0 1 -> 1 +addx6744 add -0 1 -> 1 +addx6745 add -1 0 -> -1 +addx6746 add -1 -0 -> -1 +addx6747 add 1 0 -> 1 +addx6748 add 1 -0 -> 1 + +addx6751 add 0.0 -1 -> -1.0 +addx6752 add -0.0 -1 -> -1.0 +addx6753 add 0.0 1 -> 1.0 +addx6754 add -0.0 1 -> 1.0 +addx6755 add -1.0 0 -> -1.0 +addx6756 add -1.0 -0 -> -1.0 +addx6757 add 1.0 0 -> 1.0 +addx6758 add 1.0 -0 -> 1.0 + +addx6761 add 0 -1.0 -> -1.0 +addx6762 add -0 -1.0 -> -1.0 +addx6763 add 0 1.0 -> 1.0 +addx6764 add -0 1.0 -> 1.0 +addx6765 add -1 0.0 -> -1.0 +addx6766 add -1 -0.0 -> -1.0 +addx6767 add 1 0.0 -> 1.0 +addx6768 add 1 -0.0 -> 1.0 + +addx6771 add 0.0 -1.0 -> -1.0 +addx6772 add -0.0 -1.0 -> -1.0 +addx6773 add 0.0 1.0 -> 1.0 +addx6774 add -0.0 1.0 -> 1.0 +addx6775 add -1.0 0.0 -> -1.0 +addx6776 add -1.0 -0.0 -> -1.0 +addx6777 add 1.0 0.0 -> 1.0 +addx6778 add 1.0 -0.0 -> 1.0 + +-- Specials +addx6780 add -Inf -Inf -> -Infinity +addx6781 add -Inf -1000 -> -Infinity +addx6782 add -Inf -1 -> -Infinity +addx6783 add -Inf -0 -> -Infinity +addx6784 add -Inf 0 -> -Infinity +addx6785 add -Inf 1 -> -Infinity +addx6786 add -Inf 1000 -> -Infinity +addx6787 add -1000 -Inf -> -Infinity +addx6788 add -Inf -Inf -> -Infinity +addx6789 add -1 -Inf -> -Infinity +addx6790 add -0 -Inf -> -Infinity +addx6791 add 0 -Inf -> -Infinity +addx6792 add 1 -Inf -> -Infinity +addx6793 add 1000 -Inf -> -Infinity +addx6794 add Inf -Inf -> NaN Invalid_operation + +addx6800 add Inf -Inf -> NaN Invalid_operation +addx6801 add Inf -1000 -> Infinity +addx6802 add Inf -1 -> Infinity +addx6803 add Inf -0 -> Infinity +addx6804 add Inf 0 -> Infinity +addx6805 add Inf 1 -> Infinity +addx6806 add Inf 1000 -> Infinity +addx6807 add Inf Inf -> Infinity +addx6808 add -1000 Inf -> Infinity +addx6809 add -Inf Inf -> NaN Invalid_operation +addx6810 add -1 Inf -> Infinity +addx6811 add -0 Inf -> Infinity +addx6812 add 0 Inf -> Infinity +addx6813 add 1 Inf -> Infinity +addx6814 add 1000 Inf -> Infinity +addx6815 add Inf Inf -> Infinity + +addx6821 add NaN -Inf -> NaN +addx6822 add NaN -1000 -> NaN +addx6823 add NaN -1 -> NaN +addx6824 add NaN -0 -> NaN +addx6825 add NaN 0 -> NaN +addx6826 add NaN 1 -> NaN +addx6827 add NaN 1000 -> NaN +addx6828 add NaN Inf -> NaN +addx6829 add NaN NaN -> NaN +addx6830 add -Inf NaN -> NaN +addx6831 add -1000 NaN -> NaN +addx6832 add -1 NaN -> NaN +addx6833 add -0 NaN -> NaN +addx6834 add 0 NaN -> NaN +addx6835 add 1 NaN -> NaN +addx6836 add 1000 NaN -> NaN +addx6837 add Inf NaN -> NaN + +addx6841 add sNaN -Inf -> NaN Invalid_operation +addx6842 add sNaN -1000 -> NaN Invalid_operation +addx6843 add sNaN -1 -> NaN Invalid_operation +addx6844 add sNaN -0 -> NaN Invalid_operation +addx6845 add sNaN 0 -> NaN Invalid_operation +addx6846 add sNaN 1 -> NaN Invalid_operation +addx6847 add sNaN 1000 -> NaN Invalid_operation +addx6848 add sNaN NaN -> NaN Invalid_operation +addx6849 add sNaN sNaN -> NaN Invalid_operation +addx6850 add NaN sNaN -> NaN Invalid_operation +addx6851 add -Inf sNaN -> NaN Invalid_operation +addx6852 add -1000 sNaN -> NaN Invalid_operation +addx6853 add -1 sNaN -> NaN Invalid_operation +addx6854 add -0 sNaN -> NaN Invalid_operation +addx6855 add 0 sNaN -> NaN Invalid_operation +addx6856 add 1 sNaN -> NaN Invalid_operation +addx6857 add 1000 sNaN -> NaN Invalid_operation +addx6858 add Inf sNaN -> NaN Invalid_operation +addx6859 add NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +addx6861 add NaN1 -Inf -> NaN1 +addx6862 add +NaN2 -1000 -> NaN2 +addx6863 add NaN3 1000 -> NaN3 +addx6864 add NaN4 Inf -> NaN4 +addx6865 add NaN5 +NaN6 -> NaN5 +addx6866 add -Inf NaN7 -> NaN7 +addx6867 add -1000 NaN8 -> NaN8 +addx6868 add 1000 NaN9 -> NaN9 +addx6869 add Inf +NaN10 -> NaN10 +addx6871 add sNaN11 -Inf -> NaN11 Invalid_operation +addx6872 add sNaN12 -1000 -> NaN12 Invalid_operation +addx6873 add sNaN13 1000 -> NaN13 Invalid_operation +addx6874 add sNaN14 NaN17 -> NaN14 Invalid_operation +addx6875 add sNaN15 sNaN18 -> NaN15 Invalid_operation +addx6876 add NaN16 sNaN19 -> NaN19 Invalid_operation +addx6877 add -Inf +sNaN20 -> NaN20 Invalid_operation +addx6878 add -1000 sNaN21 -> NaN21 Invalid_operation +addx6879 add 1000 sNaN22 -> NaN22 Invalid_operation +addx6880 add Inf sNaN23 -> NaN23 Invalid_operation +addx6881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation +addx6882 add -NaN26 NaN28 -> -NaN26 +addx6883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation +addx6884 add 1000 -NaN30 -> -NaN30 +addx6885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- now the case where we can get underflow but the result is normal +-- [note this can't happen if the operands are also bounded, as we +-- cannot represent 1E-399, for example] + +addx6571 add 1E-383 0 -> 1E-383 +addx6572 add 1E-384 0 -> 1E-384 Subnormal +addx6573 add 1E-383 1E-384 -> 1.1E-383 +addx6574 subtract 1E-383 1E-384 -> 9E-384 Subnormal + +-- Here we explore the boundary of rounding a subnormal to Nmin +addx6575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx6576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx6577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx6578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx6579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx6580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- check overflow edge case +-- 1234567890123456 +addx6972 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +addx6973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded +addx6974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded +addx6975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded +addx6976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded +addx6977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded +addx6978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded +addx6979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded +addx6980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded +addx6981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded +addx6982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded +addx6983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded +addx6984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded + +addx6985 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +addx6986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded +addx6987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded +addx6988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded +addx6989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded +addx6990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded +addx6991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded +addx6992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded +addx6993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded +addx6994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded +addx6995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded +addx6996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded +addx6997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +addx61100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +addx61101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +addx61103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +addx61104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +addx61105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +addx61106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +addx61107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +addx61108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +addx61109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +addx61110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +addx61111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +addx61113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +addx61114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +addx61115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +addx61116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +addx61117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +addx61118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +addx61119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +addx61300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +addx61310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded +addx61311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded +addx61312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +addx61313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +addx61314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +addx61315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +addx61316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +addx61317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +addx61318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +addx61319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +addx61320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +addx61321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +addx61322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +addx61323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +addx61324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +addx61325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx61333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx61334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx61335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx61336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx61337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx61338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +addx61339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +addx61340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +addx61341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +addx61349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +addx61350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +addx61351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +addx61352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +addx61353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +addx61354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +addx61355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +addx61356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +addx61357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +addx61358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +addx61359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +addx61360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +addx61361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +addx61362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +addx61363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +addx61364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +addx61365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx61374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx61375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx61376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx61377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx61378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx61379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +addx61380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +addx61381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +addx61382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +addx61390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +addx61391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +addx61392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +addx61393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +addx61394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +addx61395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +addx61396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +addx61420 add 0 1.123456789012345 -> 1.123456789012345 +addx61421 add 0 1.123456789012345E-1 -> 0.1123456789012345 +addx61422 add 0 1.123456789012345E-2 -> 0.01123456789012345 +addx61423 add 0 1.123456789012345E-3 -> 0.001123456789012345 +addx61424 add 0 1.123456789012345E-4 -> 0.0001123456789012345 +addx61425 add 0 1.123456789012345E-5 -> 0.00001123456789012345 +addx61426 add 0 1.123456789012345E-6 -> 0.000001123456789012345 +addx61427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7 +addx61428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8 +addx61429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9 +addx61430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10 +addx61431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11 +addx61432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12 +addx61433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13 +addx61434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14 +addx61435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15 +addx61436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16 +addx61437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17 +addx61438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18 +addx61439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +addx61440 add 1.123456789012345 0 -> 1.123456789012345 +addx61441 add 1.123456789012345E-1 0 -> 0.1123456789012345 +addx61442 add 1.123456789012345E-2 0 -> 0.01123456789012345 +addx61443 add 1.123456789012345E-3 0 -> 0.001123456789012345 +addx61444 add 1.123456789012345E-4 0 -> 0.0001123456789012345 +addx61445 add 1.123456789012345E-5 0 -> 0.00001123456789012345 +addx61446 add 1.123456789012345E-6 0 -> 0.000001123456789012345 +addx61447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7 +addx61448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8 +addx61449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9 +addx61450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10 +addx61451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11 +addx61452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12 +addx61453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13 +addx61454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14 +addx61455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15 +addx61456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16 +addx61457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17 +addx61458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18 +addx61459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +addx61460 add 1.123456789012345 0E-0 -> 1.123456789012345 +addx61461 add 1.123456789012345 0E-1 -> 1.123456789012345 +addx61462 add 1.123456789012345 0E-2 -> 1.123456789012345 +addx61463 add 1.123456789012345 0E-3 -> 1.123456789012345 +addx61464 add 1.123456789012345 0E-4 -> 1.123456789012345 +addx61465 add 1.123456789012345 0E-5 -> 1.123456789012345 +addx61466 add 1.123456789012345 0E-6 -> 1.123456789012345 +addx61467 add 1.123456789012345 0E-7 -> 1.123456789012345 +addx61468 add 1.123456789012345 0E-8 -> 1.123456789012345 +addx61469 add 1.123456789012345 0E-9 -> 1.123456789012345 +addx61470 add 1.123456789012345 0E-10 -> 1.123456789012345 +addx61471 add 1.123456789012345 0E-11 -> 1.123456789012345 +addx61472 add 1.123456789012345 0E-12 -> 1.123456789012345 +addx61473 add 1.123456789012345 0E-13 -> 1.123456789012345 +addx61474 add 1.123456789012345 0E-14 -> 1.123456789012345 +addx61475 add 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded because the 0 extends the result +addx61476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +addx61477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +addx61478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +addx61479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +addx61500 add 0 0E-19 -> 0E-19 +addx61501 add -0 0E-19 -> 0E-19 +addx61502 add 0 -0E-19 -> 0E-19 +addx61503 add -0 -0E-19 -> -0E-19 +addx61504 add 0E-400 0E-19 -> 0E-398 Clamped +addx61505 add -0E-400 0E-19 -> 0E-398 Clamped +addx61506 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61507 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61511 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61512 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61513 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61514 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61515 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61516 add -1E-401 1E-401 -> 0E-398 Clamped +addx61517 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61518 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_down +-- exact zeros from zeros +addx61520 add 0 0E-19 -> 0E-19 +addx61521 add -0 0E-19 -> 0E-19 +addx61522 add 0 -0E-19 -> 0E-19 +addx61523 add -0 -0E-19 -> -0E-19 +addx61524 add 0E-400 0E-19 -> 0E-398 Clamped +addx61525 add -0E-400 0E-19 -> 0E-398 Clamped +addx61526 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61527 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61531 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61532 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61533 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61534 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61535 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61536 add -1E-401 1E-401 -> 0E-398 Clamped +addx61537 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61538 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_even +-- exact zeros from zeros +addx61540 add 0 0E-19 -> 0E-19 +addx61541 add -0 0E-19 -> 0E-19 +addx61542 add 0 -0E-19 -> 0E-19 +addx61543 add -0 -0E-19 -> -0E-19 +addx61544 add 0E-400 0E-19 -> 0E-398 Clamped +addx61545 add -0E-400 0E-19 -> 0E-398 Clamped +addx61546 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61547 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61551 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61552 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61553 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61554 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61555 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61556 add -1E-401 1E-401 -> 0E-398 Clamped +addx61557 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61558 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: up +-- exact zeros from zeros +addx61560 add 0 0E-19 -> 0E-19 +addx61561 add -0 0E-19 -> 0E-19 +addx61562 add 0 -0E-19 -> 0E-19 +addx61563 add -0 -0E-19 -> -0E-19 +addx61564 add 0E-400 0E-19 -> 0E-398 Clamped +addx61565 add -0E-400 0E-19 -> 0E-398 Clamped +addx61566 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61567 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61571 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61572 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61573 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx61574 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx61575 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61576 add -1E-401 1E-401 -> 0E-398 Clamped +addx61577 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61578 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +rounding: down +-- exact zeros from zeros +addx61580 add 0 0E-19 -> 0E-19 +addx61581 add -0 0E-19 -> 0E-19 +addx61582 add 0 -0E-19 -> 0E-19 +addx61583 add -0 -0E-19 -> -0E-19 +addx61584 add 0E-400 0E-19 -> 0E-398 Clamped +addx61585 add -0E-400 0E-19 -> 0E-398 Clamped +addx61586 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61587 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61591 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61592 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61593 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61594 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61595 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61596 add -1E-401 1E-401 -> 0E-398 Clamped +addx61597 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61598 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: ceiling +-- exact zeros from zeros +addx61600 add 0 0E-19 -> 0E-19 +addx61601 add -0 0E-19 -> 0E-19 +addx61602 add 0 -0E-19 -> 0E-19 +addx61603 add -0 -0E-19 -> -0E-19 +addx61604 add 0E-400 0E-19 -> 0E-398 Clamped +addx61605 add -0E-400 0E-19 -> 0E-398 Clamped +addx61606 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61607 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61611 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61612 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61613 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61614 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61615 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61616 add -1E-401 1E-401 -> 0E-398 Clamped +addx61617 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61618 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +addx61620 add 0 0E-19 -> 0E-19 +addx61621 add -0 0E-19 -> -0E-19 -- * +addx61622 add 0 -0E-19 -> -0E-19 -- * +addx61623 add -0 -0E-19 -> -0E-19 +addx61624 add 0E-400 0E-19 -> 0E-398 Clamped +addx61625 add -0E-400 0E-19 -> -0E-398 Clamped -- * +addx61626 add 0E-400 -0E-19 -> -0E-398 Clamped -- * +addx61627 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61631 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61632 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61633 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx61634 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx61635 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61636 add -1E-401 1E-401 -> -0E-398 Clamped -- * +addx61637 add 1E-401 -1E-401 -> -0E-398 Clamped -- * +addx61638 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +-- Examples from SQL proposal (Krishna Kulkarni) +addx61701 add 130E-2 120E-2 -> 2.50 +addx61702 add 130E-2 12E-1 -> 2.50 +addx61703 add 130E-2 1E0 -> 2.30 +addx61704 add 1E2 1E4 -> 1.01E+4 +addx61705 subtract 130E-2 120E-2 -> 0.10 +addx61706 subtract 130E-2 12E-1 -> 0.10 +addx61707 subtract 130E-2 1E0 -> 0.30 +addx61708 subtract 1E2 1E4 -> -9.9E+3 + +-- Gappy coefficients; check residue handling even with full coefficient gap +rounding: half_even + +addx62001 add 1234567890123456 1 -> 1234567890123457 +addx62002 add 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded +addx62003 add 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded +addx62004 add 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded +addx62005 add 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded +addx62006 add 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded +addx62007 add 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded +addx62008 add 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded +addx62009 add 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded +addx62010 add 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded +addx62011 add 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded +addx62012 add 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded +addx62013 add 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded +addx62014 add 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded +addx62015 add 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded +addx62016 add 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded +addx62017 add 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded +addx62018 add 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded +addx62019 add 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded +addx62020 add 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded +addx62021 add 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded + +-- widening second argument at gap +addx62030 add 12345678 1 -> 12345679 +addx62031 add 12345678 0.1 -> 12345678.1 +addx62032 add 12345678 0.12 -> 12345678.12 +addx62033 add 12345678 0.123 -> 12345678.123 +addx62034 add 12345678 0.1234 -> 12345678.1234 +addx62035 add 12345678 0.12345 -> 12345678.12345 +addx62036 add 12345678 0.123456 -> 12345678.123456 +addx62037 add 12345678 0.1234567 -> 12345678.1234567 +addx62038 add 12345678 0.12345678 -> 12345678.12345678 +addx62039 add 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded +addx62040 add 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded +addx62041 add 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded +addx62042 add 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded +addx62043 add 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded +addx62044 add 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded +addx62045 add 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded +addx62046 add 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded +addx62047 add 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded +addx62048 add 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded +addx62049 add 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded +-- 90123456 +rounding: half_even +addx62050 add 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded +addx62051 add 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded +addx62052 add 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded +addx62053 add 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded +addx62054 add 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded +addx62055 add 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded +addx62056 add 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded +addx62057 add 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded +addx62060 add 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded +addx62061 add 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded +addx62062 add 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded +addx62063 add 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded +addx62064 add 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded +addx62065 add 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded +addx62066 add 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded +addx62067 add 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded +-- far-out residues (full coefficient gap is 16+15 digits) +rounding: up +addx62070 add 12345678 1E-8 -> 12345678.00000001 +addx62071 add 12345678 1E-9 -> 12345678.00000001 Inexact Rounded +addx62072 add 12345678 1E-10 -> 12345678.00000001 Inexact Rounded +addx62073 add 12345678 1E-11 -> 12345678.00000001 Inexact Rounded +addx62074 add 12345678 1E-12 -> 12345678.00000001 Inexact Rounded +addx62075 add 12345678 1E-13 -> 12345678.00000001 Inexact Rounded +addx62076 add 12345678 1E-14 -> 12345678.00000001 Inexact Rounded +addx62077 add 12345678 1E-15 -> 12345678.00000001 Inexact Rounded +addx62078 add 12345678 1E-16 -> 12345678.00000001 Inexact Rounded +addx62079 add 12345678 1E-17 -> 12345678.00000001 Inexact Rounded +addx62080 add 12345678 1E-18 -> 12345678.00000001 Inexact Rounded +addx62081 add 12345678 1E-19 -> 12345678.00000001 Inexact Rounded +addx62082 add 12345678 1E-20 -> 12345678.00000001 Inexact Rounded +addx62083 add 12345678 1E-25 -> 12345678.00000001 Inexact Rounded +addx62084 add 12345678 1E-30 -> 12345678.00000001 Inexact Rounded +addx62085 add 12345678 1E-31 -> 12345678.00000001 Inexact Rounded +addx62086 add 12345678 1E-32 -> 12345678.00000001 Inexact Rounded +addx62087 add 12345678 1E-33 -> 12345678.00000001 Inexact Rounded +addx62088 add 12345678 1E-34 -> 12345678.00000001 Inexact Rounded +addx62089 add 12345678 1E-35 -> 12345678.00000001 Inexact Rounded + +-- payload decapitate +precision: 5 +addx62100 add 11 sNaN123456789 -> NaN56789 Invalid_operation +addx62101 add -11 -sNaN123456789 -> -NaN56789 Invalid_operation +addx62102 add 11 NaN123456789 -> NaN56789 +addx62103 add -11 -NaN123456789 -> -NaN56789 + +-- Null tests +addx9990 add 10 # -> NaN Invalid_operation +addx9991 add # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/and.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/and.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,338 @@ +------------------------------------------------------------------------ +-- and.decTest -- digitwise logical AND -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check (truth table) +andx001 and 0 0 -> 0 +andx002 and 0 1 -> 0 +andx003 and 1 0 -> 0 +andx004 and 1 1 -> 1 +andx005 and 1100 1010 -> 1000 +andx006 and 1111 10 -> 10 +andx007 and 1111 1010 -> 1010 + +-- and at msd and msd-1 +andx010 and 000000000 000000000 -> 0 +andx011 and 000000000 100000000 -> 0 +andx012 and 100000000 000000000 -> 0 +andx013 and 100000000 100000000 -> 100000000 +andx014 and 000000000 000000000 -> 0 +andx015 and 000000000 010000000 -> 0 +andx016 and 010000000 000000000 -> 0 +andx017 and 010000000 010000000 -> 10000000 + +-- Various lengths +-- 123456789 123456789 123456789 +andx021 and 111111111 111111111 -> 111111111 +andx022 and 111111111111 111111111 -> 111111111 +andx023 and 111111111111 11111111 -> 11111111 +andx024 and 111111111 11111111 -> 11111111 +andx025 and 111111111 1111111 -> 1111111 +andx026 and 111111111111 111111 -> 111111 +andx027 and 111111111111 11111 -> 11111 +andx028 and 111111111111 1111 -> 1111 +andx029 and 111111111111 111 -> 111 +andx031 and 111111111111 11 -> 11 +andx032 and 111111111111 1 -> 1 +andx033 and 111111111111 1111111111 -> 111111111 +andx034 and 11111111111 11111111111 -> 111111111 +andx035 and 1111111111 111111111111 -> 111111111 +andx036 and 111111111 1111111111111 -> 111111111 + +andx040 and 111111111 111111111111 -> 111111111 +andx041 and 11111111 111111111111 -> 11111111 +andx042 and 11111111 111111111 -> 11111111 +andx043 and 1111111 111111111 -> 1111111 +andx044 and 111111 111111111 -> 111111 +andx045 and 11111 111111111 -> 11111 +andx046 and 1111 111111111 -> 1111 +andx047 and 111 111111111 -> 111 +andx048 and 11 111111111 -> 11 +andx049 and 1 111111111 -> 1 + +andx050 and 1111111111 1 -> 1 +andx051 and 111111111 1 -> 1 +andx052 and 11111111 1 -> 1 +andx053 and 1111111 1 -> 1 +andx054 and 111111 1 -> 1 +andx055 and 11111 1 -> 1 +andx056 and 1111 1 -> 1 +andx057 and 111 1 -> 1 +andx058 and 11 1 -> 1 +andx059 and 1 1 -> 1 + +andx060 and 1111111111 0 -> 0 +andx061 and 111111111 0 -> 0 +andx062 and 11111111 0 -> 0 +andx063 and 1111111 0 -> 0 +andx064 and 111111 0 -> 0 +andx065 and 11111 0 -> 0 +andx066 and 1111 0 -> 0 +andx067 and 111 0 -> 0 +andx068 and 11 0 -> 0 +andx069 and 1 0 -> 0 + +andx070 and 1 1111111111 -> 1 +andx071 and 1 111111111 -> 1 +andx072 and 1 11111111 -> 1 +andx073 and 1 1111111 -> 1 +andx074 and 1 111111 -> 1 +andx075 and 1 11111 -> 1 +andx076 and 1 1111 -> 1 +andx077 and 1 111 -> 1 +andx078 and 1 11 -> 1 +andx079 and 1 1 -> 1 + +andx080 and 0 1111111111 -> 0 +andx081 and 0 111111111 -> 0 +andx082 and 0 11111111 -> 0 +andx083 and 0 1111111 -> 0 +andx084 and 0 111111 -> 0 +andx085 and 0 11111 -> 0 +andx086 and 0 1111 -> 0 +andx087 and 0 111 -> 0 +andx088 and 0 11 -> 0 +andx089 and 0 1 -> 0 + +andx090 and 011111111 111111111 -> 11111111 +andx091 and 101111111 111111111 -> 101111111 +andx092 and 110111111 111111111 -> 110111111 +andx093 and 111011111 111111111 -> 111011111 +andx094 and 111101111 111111111 -> 111101111 +andx095 and 111110111 111111111 -> 111110111 +andx096 and 111111011 111111111 -> 111111011 +andx097 and 111111101 111111111 -> 111111101 +andx098 and 111111110 111111111 -> 111111110 + +andx100 and 111111111 011111111 -> 11111111 +andx101 and 111111111 101111111 -> 101111111 +andx102 and 111111111 110111111 -> 110111111 +andx103 and 111111111 111011111 -> 111011111 +andx104 and 111111111 111101111 -> 111101111 +andx105 and 111111111 111110111 -> 111110111 +andx106 and 111111111 111111011 -> 111111011 +andx107 and 111111111 111111101 -> 111111101 +andx108 and 111111111 111111110 -> 111111110 + +-- non-0/1 should not be accepted, nor should signs +andx220 and 111111112 111111111 -> NaN Invalid_operation +andx221 and 333333333 333333333 -> NaN Invalid_operation +andx222 and 555555555 555555555 -> NaN Invalid_operation +andx223 and 777777777 777777777 -> NaN Invalid_operation +andx224 and 999999999 999999999 -> NaN Invalid_operation +andx225 and 222222222 999999999 -> NaN Invalid_operation +andx226 and 444444444 999999999 -> NaN Invalid_operation +andx227 and 666666666 999999999 -> NaN Invalid_operation +andx228 and 888888888 999999999 -> NaN Invalid_operation +andx229 and 999999999 222222222 -> NaN Invalid_operation +andx230 and 999999999 444444444 -> NaN Invalid_operation +andx231 and 999999999 666666666 -> NaN Invalid_operation +andx232 and 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +andx240 and 567468689 -934981942 -> NaN Invalid_operation +andx241 and 567367689 934981942 -> NaN Invalid_operation +andx242 and -631917772 -706014634 -> NaN Invalid_operation +andx243 and -756253257 138579234 -> NaN Invalid_operation +andx244 and 835590149 567435400 -> NaN Invalid_operation +-- test MSD +andx250 and 200000000 100000000 -> NaN Invalid_operation +andx251 and 700000000 100000000 -> NaN Invalid_operation +andx252 and 800000000 100000000 -> NaN Invalid_operation +andx253 and 900000000 100000000 -> NaN Invalid_operation +andx254 and 200000000 000000000 -> NaN Invalid_operation +andx255 and 700000000 000000000 -> NaN Invalid_operation +andx256 and 800000000 000000000 -> NaN Invalid_operation +andx257 and 900000000 000000000 -> NaN Invalid_operation +andx258 and 100000000 200000000 -> NaN Invalid_operation +andx259 and 100000000 700000000 -> NaN Invalid_operation +andx260 and 100000000 800000000 -> NaN Invalid_operation +andx261 and 100000000 900000000 -> NaN Invalid_operation +andx262 and 000000000 200000000 -> NaN Invalid_operation +andx263 and 000000000 700000000 -> NaN Invalid_operation +andx264 and 000000000 800000000 -> NaN Invalid_operation +andx265 and 000000000 900000000 -> NaN Invalid_operation +-- test MSD-1 +andx270 and 020000000 100000000 -> NaN Invalid_operation +andx271 and 070100000 100000000 -> NaN Invalid_operation +andx272 and 080010000 100000001 -> NaN Invalid_operation +andx273 and 090001000 100000010 -> NaN Invalid_operation +andx274 and 100000100 020010100 -> NaN Invalid_operation +andx275 and 100000000 070001000 -> NaN Invalid_operation +andx276 and 100000010 080010100 -> NaN Invalid_operation +andx277 and 100000000 090000010 -> NaN Invalid_operation +-- test LSD +andx280 and 001000002 100000000 -> NaN Invalid_operation +andx281 and 000000007 100000000 -> NaN Invalid_operation +andx282 and 000000008 100000000 -> NaN Invalid_operation +andx283 and 000000009 100000000 -> NaN Invalid_operation +andx284 and 100000000 000100002 -> NaN Invalid_operation +andx285 and 100100000 001000007 -> NaN Invalid_operation +andx286 and 100010000 010000008 -> NaN Invalid_operation +andx287 and 100001000 100000009 -> NaN Invalid_operation +-- test Middie +andx288 and 001020000 100000000 -> NaN Invalid_operation +andx289 and 000070001 100000000 -> NaN Invalid_operation +andx290 and 000080000 100010000 -> NaN Invalid_operation +andx291 and 000090000 100001000 -> NaN Invalid_operation +andx292 and 100000010 000020100 -> NaN Invalid_operation +andx293 and 100100000 000070010 -> NaN Invalid_operation +andx294 and 100010100 000080001 -> NaN Invalid_operation +andx295 and 100001000 000090000 -> NaN Invalid_operation +-- signs +andx296 and -100001000 -000000000 -> NaN Invalid_operation +andx297 and -100001000 000010000 -> NaN Invalid_operation +andx298 and 100001000 -000000000 -> NaN Invalid_operation +andx299 and 100001000 000011000 -> 1000 + +-- Nmax, Nmin, Ntiny +andx331 and 2 9.99999999E+999 -> NaN Invalid_operation +andx332 and 3 1E-999 -> NaN Invalid_operation +andx333 and 4 1.00000000E-999 -> NaN Invalid_operation +andx334 and 5 1E-1007 -> NaN Invalid_operation +andx335 and 6 -1E-1007 -> NaN Invalid_operation +andx336 and 7 -1.00000000E-999 -> NaN Invalid_operation +andx337 and 8 -1E-999 -> NaN Invalid_operation +andx338 and 9 -9.99999999E+999 -> NaN Invalid_operation +andx341 and 9.99999999E+999 -18 -> NaN Invalid_operation +andx342 and 1E-999 01 -> NaN Invalid_operation +andx343 and 1.00000000E-999 -18 -> NaN Invalid_operation +andx344 and 1E-1007 18 -> NaN Invalid_operation +andx345 and -1E-1007 -10 -> NaN Invalid_operation +andx346 and -1.00000000E-999 18 -> NaN Invalid_operation +andx347 and -1E-999 10 -> NaN Invalid_operation +andx348 and -9.99999999E+999 -18 -> NaN Invalid_operation + +-- A few other non-integers +andx361 and 1.0 1 -> NaN Invalid_operation +andx362 and 1E+1 1 -> NaN Invalid_operation +andx363 and 0.0 1 -> NaN Invalid_operation +andx364 and 0E+1 1 -> NaN Invalid_operation +andx365 and 9.9 1 -> NaN Invalid_operation +andx366 and 9E+1 1 -> NaN Invalid_operation +andx371 and 0 1.0 -> NaN Invalid_operation +andx372 and 0 1E+1 -> NaN Invalid_operation +andx373 and 0 0.0 -> NaN Invalid_operation +andx374 and 0 0E+1 -> NaN Invalid_operation +andx375 and 0 9.9 -> NaN Invalid_operation +andx376 and 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +andx780 and -Inf -Inf -> NaN Invalid_operation +andx781 and -Inf -1000 -> NaN Invalid_operation +andx782 and -Inf -1 -> NaN Invalid_operation +andx783 and -Inf -0 -> NaN Invalid_operation +andx784 and -Inf 0 -> NaN Invalid_operation +andx785 and -Inf 1 -> NaN Invalid_operation +andx786 and -Inf 1000 -> NaN Invalid_operation +andx787 and -1000 -Inf -> NaN Invalid_operation +andx788 and -Inf -Inf -> NaN Invalid_operation +andx789 and -1 -Inf -> NaN Invalid_operation +andx790 and -0 -Inf -> NaN Invalid_operation +andx791 and 0 -Inf -> NaN Invalid_operation +andx792 and 1 -Inf -> NaN Invalid_operation +andx793 and 1000 -Inf -> NaN Invalid_operation +andx794 and Inf -Inf -> NaN Invalid_operation + +andx800 and Inf -Inf -> NaN Invalid_operation +andx801 and Inf -1000 -> NaN Invalid_operation +andx802 and Inf -1 -> NaN Invalid_operation +andx803 and Inf -0 -> NaN Invalid_operation +andx804 and Inf 0 -> NaN Invalid_operation +andx805 and Inf 1 -> NaN Invalid_operation +andx806 and Inf 1000 -> NaN Invalid_operation +andx807 and Inf Inf -> NaN Invalid_operation +andx808 and -1000 Inf -> NaN Invalid_operation +andx809 and -Inf Inf -> NaN Invalid_operation +andx810 and -1 Inf -> NaN Invalid_operation +andx811 and -0 Inf -> NaN Invalid_operation +andx812 and 0 Inf -> NaN Invalid_operation +andx813 and 1 Inf -> NaN Invalid_operation +andx814 and 1000 Inf -> NaN Invalid_operation +andx815 and Inf Inf -> NaN Invalid_operation + +andx821 and NaN -Inf -> NaN Invalid_operation +andx822 and NaN -1000 -> NaN Invalid_operation +andx823 and NaN -1 -> NaN Invalid_operation +andx824 and NaN -0 -> NaN Invalid_operation +andx825 and NaN 0 -> NaN Invalid_operation +andx826 and NaN 1 -> NaN Invalid_operation +andx827 and NaN 1000 -> NaN Invalid_operation +andx828 and NaN Inf -> NaN Invalid_operation +andx829 and NaN NaN -> NaN Invalid_operation +andx830 and -Inf NaN -> NaN Invalid_operation +andx831 and -1000 NaN -> NaN Invalid_operation +andx832 and -1 NaN -> NaN Invalid_operation +andx833 and -0 NaN -> NaN Invalid_operation +andx834 and 0 NaN -> NaN Invalid_operation +andx835 and 1 NaN -> NaN Invalid_operation +andx836 and 1000 NaN -> NaN Invalid_operation +andx837 and Inf NaN -> NaN Invalid_operation + +andx841 and sNaN -Inf -> NaN Invalid_operation +andx842 and sNaN -1000 -> NaN Invalid_operation +andx843 and sNaN -1 -> NaN Invalid_operation +andx844 and sNaN -0 -> NaN Invalid_operation +andx845 and sNaN 0 -> NaN Invalid_operation +andx846 and sNaN 1 -> NaN Invalid_operation +andx847 and sNaN 1000 -> NaN Invalid_operation +andx848 and sNaN NaN -> NaN Invalid_operation +andx849 and sNaN sNaN -> NaN Invalid_operation +andx850 and NaN sNaN -> NaN Invalid_operation +andx851 and -Inf sNaN -> NaN Invalid_operation +andx852 and -1000 sNaN -> NaN Invalid_operation +andx853 and -1 sNaN -> NaN Invalid_operation +andx854 and -0 sNaN -> NaN Invalid_operation +andx855 and 0 sNaN -> NaN Invalid_operation +andx856 and 1 sNaN -> NaN Invalid_operation +andx857 and 1000 sNaN -> NaN Invalid_operation +andx858 and Inf sNaN -> NaN Invalid_operation +andx859 and NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +andx861 and NaN1 -Inf -> NaN Invalid_operation +andx862 and +NaN2 -1000 -> NaN Invalid_operation +andx863 and NaN3 1000 -> NaN Invalid_operation +andx864 and NaN4 Inf -> NaN Invalid_operation +andx865 and NaN5 +NaN6 -> NaN Invalid_operation +andx866 and -Inf NaN7 -> NaN Invalid_operation +andx867 and -1000 NaN8 -> NaN Invalid_operation +andx868 and 1000 NaN9 -> NaN Invalid_operation +andx869 and Inf +NaN10 -> NaN Invalid_operation +andx871 and sNaN11 -Inf -> NaN Invalid_operation +andx872 and sNaN12 -1000 -> NaN Invalid_operation +andx873 and sNaN13 1000 -> NaN Invalid_operation +andx874 and sNaN14 NaN17 -> NaN Invalid_operation +andx875 and sNaN15 sNaN18 -> NaN Invalid_operation +andx876 and NaN16 sNaN19 -> NaN Invalid_operation +andx877 and -Inf +sNaN20 -> NaN Invalid_operation +andx878 and -1000 sNaN21 -> NaN Invalid_operation +andx879 and 1000 sNaN22 -> NaN Invalid_operation +andx880 and Inf sNaN23 -> NaN Invalid_operation +andx881 and +NaN25 +sNaN24 -> NaN Invalid_operation +andx882 and -NaN26 NaN28 -> NaN Invalid_operation +andx883 and -sNaN27 sNaN29 -> NaN Invalid_operation +andx884 and 1000 -NaN30 -> NaN Invalid_operation +andx885 and 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/base.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/base.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1411 @@ +------------------------------------------------------------------------ +-- base.decTest -- base decimal <--> string conversions -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 +extended: 1 + +-- This file tests base conversions from string to a decimal number +-- and back to a string (in either Scientific or Engineering form) + +-- Note that unlike other operations the operand is subject to rounding +-- to conform to emax and precision settings (that is, numbers will +-- conform to rules and exponent will be in permitted range). + +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +basx001 toSci 0 -> 0 +basx002 toSci 1 -> 1 +basx003 toSci 1.0 -> 1.0 +basx004 toSci 1.00 -> 1.00 +basx005 toSci 10 -> 10 +basx006 toSci 1000 -> 1000 +basx007 toSci 10.0 -> 10.0 +basx008 toSci 10.1 -> 10.1 +basx009 toSci 10.4 -> 10.4 +basx010 toSci 10.5 -> 10.5 +basx011 toSci 10.6 -> 10.6 +basx012 toSci 10.9 -> 10.9 +basx013 toSci 11.0 -> 11.0 +basx014 toSci 1.234 -> 1.234 +basx015 toSci 0.123 -> 0.123 +basx016 toSci 0.012 -> 0.012 +basx017 toSci -0 -> -0 +basx018 toSci -0.0 -> -0.0 +basx019 toSci -00.00 -> -0.00 + +basx021 toSci -1 -> -1 +basx022 toSci -1.0 -> -1.0 +basx023 toSci -0.1 -> -0.1 +basx024 toSci -9.1 -> -9.1 +basx025 toSci -9.11 -> -9.11 +basx026 toSci -9.119 -> -9.119 +basx027 toSci -9.999 -> -9.999 + +basx030 toSci '123456789.123456' -> '123456789.123456' +basx031 toSci '123456789.000000' -> '123456789.000000' +basx032 toSci '123456789123456' -> '123456789123456' +basx033 toSci '0.0000123456789' -> '0.0000123456789' +basx034 toSci '0.00000123456789' -> '0.00000123456789' +basx035 toSci '0.000000123456789' -> '1.23456789E-7' +basx036 toSci '0.0000000123456789' -> '1.23456789E-8' + +basx037 toSci '0.123456789012344' -> '0.123456789012344' +basx038 toSci '0.123456789012345' -> '0.123456789012345' + +-- String [many more examples are implicitly tested elsewhere] +-- strings without E cannot generate E in result +basx040 toSci "12" -> '12' +basx041 toSci "-76" -> '-76' +basx042 toSci "12.76" -> '12.76' +basx043 toSci "+12.76" -> '12.76' +basx044 toSci "012.76" -> '12.76' +basx045 toSci "+0.003" -> '0.003' +basx046 toSci "17." -> '17' +basx047 toSci ".5" -> '0.5' +basx048 toSci "044" -> '44' +basx049 toSci "0044" -> '44' +basx050 toSci "0.0005" -> '0.0005' +basx051 toSci "00.00005" -> '0.00005' +basx052 toSci "0.000005" -> '0.000005' +basx053 toSci "0.0000050" -> '0.0000050' +basx054 toSci "0.0000005" -> '5E-7' +basx055 toSci "0.00000005" -> '5E-8' +basx056 toSci "12345678.543210" -> '12345678.543210' +basx057 toSci "2345678.543210" -> '2345678.543210' +basx058 toSci "345678.543210" -> '345678.543210' +basx059 toSci "0345678.54321" -> '345678.54321' +basx060 toSci "345678.5432" -> '345678.5432' +basx061 toSci "+345678.5432" -> '345678.5432' +basx062 toSci "+0345678.5432" -> '345678.5432' +basx063 toSci "+00345678.5432" -> '345678.5432' +basx064 toSci "-345678.5432" -> '-345678.5432' +basx065 toSci "-0345678.5432" -> '-345678.5432' +basx066 toSci "-00345678.5432" -> '-345678.5432' +-- examples +basx067 toSci "5E-6" -> '0.000005' +basx068 toSci "50E-7" -> '0.0000050' +basx069 toSci "5E-7" -> '5E-7' + +-- [No exotics as no Unicode] + +-- rounded with dots in all (including edge) places +basx071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded +basx072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded +basx073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded +basx074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded +basx075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded +basx076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded +basx077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded +basx078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded +basx079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded +basx080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded +basx081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded +basx082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded +basx083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded +basx084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded +basx085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded +basx086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded +basx087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded +basx088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded +basx089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded +basx090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded + +-- Numbers with E +basx130 toSci "0.000E-1" -> '0.0000' +basx131 toSci "0.000E-2" -> '0.00000' +basx132 toSci "0.000E-3" -> '0.000000' +basx133 toSci "0.000E-4" -> '0E-7' +basx134 toSci "0.00E-2" -> '0.0000' +basx135 toSci "0.00E-3" -> '0.00000' +basx136 toSci "0.00E-4" -> '0.000000' +basx137 toSci "0.00E-5" -> '0E-7' +basx138 toSci "+0E+9" -> '0E+9' +basx139 toSci "-0E+9" -> '-0E+9' +basx140 toSci "1E+9" -> '1E+9' +basx141 toSci "1e+09" -> '1E+9' +basx142 toSci "1E+90" -> '1E+90' +basx143 toSci "+1E+009" -> '1E+9' +basx144 toSci "0E+9" -> '0E+9' +basx145 toSci "1E+9" -> '1E+9' +basx146 toSci "1E+09" -> '1E+9' +basx147 toSci "1e+90" -> '1E+90' +basx148 toSci "1E+009" -> '1E+9' +basx149 toSci "000E+9" -> '0E+9' +basx150 toSci "1E9" -> '1E+9' +basx151 toSci "1e09" -> '1E+9' +basx152 toSci "1E90" -> '1E+90' +basx153 toSci "1E009" -> '1E+9' +basx154 toSci "0E9" -> '0E+9' +basx155 toSci "0.000e+0" -> '0.000' +basx156 toSci "0.000E-1" -> '0.0000' +basx157 toSci "4E+9" -> '4E+9' +basx158 toSci "44E+9" -> '4.4E+10' +basx159 toSci "0.73e-7" -> '7.3E-8' +basx160 toSci "00E+9" -> '0E+9' +basx161 toSci "00E-9" -> '0E-9' +basx162 toSci "10E+9" -> '1.0E+10' +basx163 toSci "10E+09" -> '1.0E+10' +basx164 toSci "10e+90" -> '1.0E+91' +basx165 toSci "10E+009" -> '1.0E+10' +basx166 toSci "100e+9" -> '1.00E+11' +basx167 toSci "100e+09" -> '1.00E+11' +basx168 toSci "100E+90" -> '1.00E+92' +basx169 toSci "100e+009" -> '1.00E+11' + +basx170 toSci "1.265" -> '1.265' +basx171 toSci "1.265E-20" -> '1.265E-20' +basx172 toSci "1.265E-8" -> '1.265E-8' +basx173 toSci "1.265E-4" -> '0.0001265' +basx174 toSci "1.265E-3" -> '0.001265' +basx175 toSci "1.265E-2" -> '0.01265' +basx176 toSci "1.265E-1" -> '0.1265' +basx177 toSci "1.265E-0" -> '1.265' +basx178 toSci "1.265E+1" -> '12.65' +basx179 toSci "1.265E+2" -> '126.5' +basx180 toSci "1.265E+3" -> '1265' +basx181 toSci "1.265E+4" -> '1.265E+4' +basx182 toSci "1.265E+8" -> '1.265E+8' +basx183 toSci "1.265E+20" -> '1.265E+20' + +basx190 toSci "12.65" -> '12.65' +basx191 toSci "12.65E-20" -> '1.265E-19' +basx192 toSci "12.65E-8" -> '1.265E-7' +basx193 toSci "12.65E-4" -> '0.001265' +basx194 toSci "12.65E-3" -> '0.01265' +basx195 toSci "12.65E-2" -> '0.1265' +basx196 toSci "12.65E-1" -> '1.265' +basx197 toSci "12.65E-0" -> '12.65' +basx198 toSci "12.65E+1" -> '126.5' +basx199 toSci "12.65E+2" -> '1265' +basx200 toSci "12.65E+3" -> '1.265E+4' +basx201 toSci "12.65E+4" -> '1.265E+5' +basx202 toSci "12.65E+8" -> '1.265E+9' +basx203 toSci "12.65E+20" -> '1.265E+21' + +basx210 toSci "126.5" -> '126.5' +basx211 toSci "126.5E-20" -> '1.265E-18' +basx212 toSci "126.5E-8" -> '0.000001265' +basx213 toSci "126.5E-4" -> '0.01265' +basx214 toSci "126.5E-3" -> '0.1265' +basx215 toSci "126.5E-2" -> '1.265' +basx216 toSci "126.5E-1" -> '12.65' +basx217 toSci "126.5E-0" -> '126.5' +basx218 toSci "126.5E+1" -> '1265' +basx219 toSci "126.5E+2" -> '1.265E+4' +basx220 toSci "126.5E+3" -> '1.265E+5' +basx221 toSci "126.5E+4" -> '1.265E+6' +basx222 toSci "126.5E+8" -> '1.265E+10' +basx223 toSci "126.5E+20" -> '1.265E+22' + +basx230 toSci "1265" -> '1265' +basx231 toSci "1265E-20" -> '1.265E-17' +basx232 toSci "1265E-8" -> '0.00001265' +basx233 toSci "1265E-4" -> '0.1265' +basx234 toSci "1265E-3" -> '1.265' +basx235 toSci "1265E-2" -> '12.65' +basx236 toSci "1265E-1" -> '126.5' +basx237 toSci "1265E-0" -> '1265' +basx238 toSci "1265E+1" -> '1.265E+4' +basx239 toSci "1265E+2" -> '1.265E+5' +basx240 toSci "1265E+3" -> '1.265E+6' +basx241 toSci "1265E+4" -> '1.265E+7' +basx242 toSci "1265E+8" -> '1.265E+11' +basx243 toSci "1265E+20" -> '1.265E+23' + +basx250 toSci "0.1265" -> '0.1265' +basx251 toSci "0.1265E-20" -> '1.265E-21' +basx252 toSci "0.1265E-8" -> '1.265E-9' +basx253 toSci "0.1265E-4" -> '0.00001265' +basx254 toSci "0.1265E-3" -> '0.0001265' +basx255 toSci "0.1265E-2" -> '0.001265' +basx256 toSci "0.1265E-1" -> '0.01265' +basx257 toSci "0.1265E-0" -> '0.1265' +basx258 toSci "0.1265E+1" -> '1.265' +basx259 toSci "0.1265E+2" -> '12.65' +basx260 toSci "0.1265E+3" -> '126.5' +basx261 toSci "0.1265E+4" -> '1265' +basx262 toSci "0.1265E+8" -> '1.265E+7' +basx263 toSci "0.1265E+20" -> '1.265E+19' + +-- some more negative zeros [systematic tests below] +basx290 toSci "-0.000E-1" -> '-0.0000' +basx291 toSci "-0.000E-2" -> '-0.00000' +basx292 toSci "-0.000E-3" -> '-0.000000' +basx293 toSci "-0.000E-4" -> '-0E-7' +basx294 toSci "-0.00E-2" -> '-0.0000' +basx295 toSci "-0.00E-3" -> '-0.00000' +basx296 toSci "-0.0E-2" -> '-0.000' +basx297 toSci "-0.0E-3" -> '-0.0000' +basx298 toSci "-0E-2" -> '-0.00' +basx299 toSci "-0E-3" -> '-0.000' + +-- Engineering notation tests +basx301 toSci 10e12 -> 1.0E+13 +basx302 toEng 10e12 -> 10E+12 +basx303 toSci 10e11 -> 1.0E+12 +basx304 toEng 10e11 -> 1.0E+12 +basx305 toSci 10e10 -> 1.0E+11 +basx306 toEng 10e10 -> 100E+9 +basx307 toSci 10e9 -> 1.0E+10 +basx308 toEng 10e9 -> 10E+9 +basx309 toSci 10e8 -> 1.0E+9 +basx310 toEng 10e8 -> 1.0E+9 +basx311 toSci 10e7 -> 1.0E+8 +basx312 toEng 10e7 -> 100E+6 +basx313 toSci 10e6 -> 1.0E+7 +basx314 toEng 10e6 -> 10E+6 +basx315 toSci 10e5 -> 1.0E+6 +basx316 toEng 10e5 -> 1.0E+6 +basx317 toSci 10e4 -> 1.0E+5 +basx318 toEng 10e4 -> 100E+3 +basx319 toSci 10e3 -> 1.0E+4 +basx320 toEng 10e3 -> 10E+3 +basx321 toSci 10e2 -> 1.0E+3 +basx322 toEng 10e2 -> 1.0E+3 +basx323 toSci 10e1 -> 1.0E+2 +basx324 toEng 10e1 -> 100 +basx325 toSci 10e0 -> 10 +basx326 toEng 10e0 -> 10 +basx327 toSci 10e-1 -> 1.0 +basx328 toEng 10e-1 -> 1.0 +basx329 toSci 10e-2 -> 0.10 +basx330 toEng 10e-2 -> 0.10 +basx331 toSci 10e-3 -> 0.010 +basx332 toEng 10e-3 -> 0.010 +basx333 toSci 10e-4 -> 0.0010 +basx334 toEng 10e-4 -> 0.0010 +basx335 toSci 10e-5 -> 0.00010 +basx336 toEng 10e-5 -> 0.00010 +basx337 toSci 10e-6 -> 0.000010 +basx338 toEng 10e-6 -> 0.000010 +basx339 toSci 10e-7 -> 0.0000010 +basx340 toEng 10e-7 -> 0.0000010 +basx341 toSci 10e-8 -> 1.0E-7 +basx342 toEng 10e-8 -> 100E-9 +basx343 toSci 10e-9 -> 1.0E-8 +basx344 toEng 10e-9 -> 10E-9 +basx345 toSci 10e-10 -> 1.0E-9 +basx346 toEng 10e-10 -> 1.0E-9 +basx347 toSci 10e-11 -> 1.0E-10 +basx348 toEng 10e-11 -> 100E-12 +basx349 toSci 10e-12 -> 1.0E-11 +basx350 toEng 10e-12 -> 10E-12 +basx351 toSci 10e-13 -> 1.0E-12 +basx352 toEng 10e-13 -> 1.0E-12 + +basx361 toSci 7E12 -> 7E+12 +basx362 toEng 7E12 -> 7E+12 +basx363 toSci 7E11 -> 7E+11 +basx364 toEng 7E11 -> 700E+9 +basx365 toSci 7E10 -> 7E+10 +basx366 toEng 7E10 -> 70E+9 +basx367 toSci 7E9 -> 7E+9 +basx368 toEng 7E9 -> 7E+9 +basx369 toSci 7E8 -> 7E+8 +basx370 toEng 7E8 -> 700E+6 +basx371 toSci 7E7 -> 7E+7 +basx372 toEng 7E7 -> 70E+6 +basx373 toSci 7E6 -> 7E+6 +basx374 toEng 7E6 -> 7E+6 +basx375 toSci 7E5 -> 7E+5 +basx376 toEng 7E5 -> 700E+3 +basx377 toSci 7E4 -> 7E+4 +basx378 toEng 7E4 -> 70E+3 +basx379 toSci 7E3 -> 7E+3 +basx380 toEng 7E3 -> 7E+3 +basx381 toSci 7E2 -> 7E+2 +basx382 toEng 7E2 -> 700 +basx383 toSci 7E1 -> 7E+1 +basx384 toEng 7E1 -> 70 +basx385 toSci 7E0 -> 7 +basx386 toEng 7E0 -> 7 +basx387 toSci 7E-1 -> 0.7 +basx388 toEng 7E-1 -> 0.7 +basx389 toSci 7E-2 -> 0.07 +basx390 toEng 7E-2 -> 0.07 +basx391 toSci 7E-3 -> 0.007 +basx392 toEng 7E-3 -> 0.007 +basx393 toSci 7E-4 -> 0.0007 +basx394 toEng 7E-4 -> 0.0007 +basx395 toSci 7E-5 -> 0.00007 +basx396 toEng 7E-5 -> 0.00007 +basx397 toSci 7E-6 -> 0.000007 +basx398 toEng 7E-6 -> 0.000007 +basx399 toSci 7E-7 -> 7E-7 +basx400 toEng 7E-7 -> 700E-9 +basx401 toSci 7E-8 -> 7E-8 +basx402 toEng 7E-8 -> 70E-9 +basx403 toSci 7E-9 -> 7E-9 +basx404 toEng 7E-9 -> 7E-9 +basx405 toSci 7E-10 -> 7E-10 +basx406 toEng 7E-10 -> 700E-12 +basx407 toSci 7E-11 -> 7E-11 +basx408 toEng 7E-11 -> 70E-12 +basx409 toSci 7E-12 -> 7E-12 +basx410 toEng 7E-12 -> 7E-12 +basx411 toSci 7E-13 -> 7E-13 +basx412 toEng 7E-13 -> 700E-15 + +-- Exacts remain exact up to precision .. +precision: 9 +basx420 toSci 100 -> 100 +basx421 toEng 100 -> 100 +basx422 toSci 1000 -> 1000 +basx423 toEng 1000 -> 1000 +basx424 toSci 999.9 -> 999.9 +basx425 toEng 999.9 -> 999.9 +basx426 toSci 1000.0 -> 1000.0 +basx427 toEng 1000.0 -> 1000.0 +basx428 toSci 1000.1 -> 1000.1 +basx429 toEng 1000.1 -> 1000.1 +basx430 toSci 10000 -> 10000 +basx431 toEng 10000 -> 10000 +basx432 toSci 100000 -> 100000 +basx433 toEng 100000 -> 100000 +basx434 toSci 1000000 -> 1000000 +basx435 toEng 1000000 -> 1000000 +basx436 toSci 10000000 -> 10000000 +basx437 toEng 10000000 -> 10000000 +basx438 toSci 100000000 -> 100000000 +basx439 toEng 100000000 -> 100000000 +basx440 toSci 1000000000 -> 1.00000000E+9 Rounded +basx441 toEng 1000000000 -> 1.00000000E+9 Rounded +basx442 toSci 1000000000 -> 1.00000000E+9 Rounded +basx443 toEng 1000000000 -> 1.00000000E+9 Rounded +basx444 toSci 1000000003 -> 1.00000000E+9 Rounded Inexact +basx445 toEng 1000000003 -> 1.00000000E+9 Rounded Inexact +basx446 toSci 1000000005 -> 1.00000001E+9 Rounded Inexact +basx447 toEng 1000000005 -> 1.00000001E+9 Rounded Inexact +basx448 toSci 10000000050 -> 1.00000001E+10 Rounded Inexact +basx449 toEng 10000000050 -> 10.0000001E+9 Rounded Inexact +basx450 toSci 1000000009 -> 1.00000001E+9 Rounded Inexact +basx451 toEng 1000000009 -> 1.00000001E+9 Rounded Inexact +basx452 toSci 10000000000 -> 1.00000000E+10 Rounded +basx453 toEng 10000000000 -> 10.0000000E+9 Rounded +basx454 toSci 10000000003 -> 1.00000000E+10 Rounded Inexact +basx455 toEng 10000000003 -> 10.0000000E+9 Rounded Inexact +basx456 toSci 10000000005 -> 1.00000000E+10 Rounded Inexact +basx457 toEng 10000000005 -> 10.0000000E+9 Rounded Inexact +basx458 toSci 10000000009 -> 1.00000000E+10 Rounded Inexact +basx459 toEng 10000000009 -> 10.0000000E+9 Rounded Inexact +basx460 toSci 100000000000 -> 1.00000000E+11 Rounded +basx461 toEng 100000000000 -> 100.000000E+9 Rounded +basx462 toSci 100000000300 -> 1.00000000E+11 Rounded Inexact +basx463 toEng 100000000300 -> 100.000000E+9 Rounded Inexact +basx464 toSci 100000000500 -> 1.00000001E+11 Rounded Inexact +basx465 toEng 100000000500 -> 100.000001E+9 Rounded Inexact +basx466 toSci 100000000900 -> 1.00000001E+11 Rounded Inexact +basx467 toEng 100000000900 -> 100.000001E+9 Rounded Inexact +basx468 toSci 1000000000000 -> 1.00000000E+12 Rounded +basx469 toEng 1000000000000 -> 1.00000000E+12 Rounded +basx470 toSci 1000000003000 -> 1.00000000E+12 Rounded Inexact +basx471 toEng 1000000003000 -> 1.00000000E+12 Rounded Inexact +basx472 toSci 1000000005000 -> 1.00000001E+12 Rounded Inexact +basx473 toEng 1000000005000 -> 1.00000001E+12 Rounded Inexact +basx474 toSci 1000000009000 -> 1.00000001E+12 Rounded Inexact +basx475 toEng 1000000009000 -> 1.00000001E+12 Rounded Inexact + +-- all-nines rounding +precision: 9 +rounding: half_up +basx270 toSci 999999999 -> 999999999 +basx271 toSci 9999999990 -> 9.99999999E+9 Rounded +basx272 toSci 9999999991 -> 9.99999999E+9 Rounded Inexact +basx273 toSci 9999999992 -> 9.99999999E+9 Rounded Inexact +basx274 toSci 9999999993 -> 9.99999999E+9 Rounded Inexact +basx275 toSci 9999999994 -> 9.99999999E+9 Rounded Inexact +basx276 toSci 9999999995 -> 1.00000000E+10 Rounded Inexact +basx277 toSci 9999999996 -> 1.00000000E+10 Rounded Inexact +basx278 toSci 9999999997 -> 1.00000000E+10 Rounded Inexact +basx279 toSci 9999999998 -> 1.00000000E+10 Rounded Inexact +basx280 toSci 9999999999 -> 1.00000000E+10 Rounded Inexact +basx281 toSci 9999999999999999 -> 1.00000000E+16 Rounded Inexact + +-- check rounding modes heeded +precision: 5 +rounding: ceiling +bsrx401 toSci 1.23450 -> 1.2345 Rounded +bsrx402 toSci 1.234549 -> 1.2346 Rounded Inexact +bsrx403 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx404 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: up +bsrx405 toSci 1.23450 -> 1.2345 Rounded +bsrx406 toSci 1.234549 -> 1.2346 Rounded Inexact +bsrx407 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx408 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: floor +bsrx410 toSci 1.23450 -> 1.2345 Rounded +bsrx411 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx412 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx413 toSci 1.234551 -> 1.2345 Rounded Inexact +rounding: half_down +bsrx415 toSci 1.23450 -> 1.2345 Rounded +bsrx416 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx417 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx418 toSci 1.234650 -> 1.2346 Rounded Inexact +bsrx419 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: half_even +bsrx421 toSci 1.23450 -> 1.2345 Rounded +bsrx422 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx423 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx424 toSci 1.234650 -> 1.2346 Rounded Inexact +bsrx425 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: down +bsrx426 toSci 1.23450 -> 1.2345 Rounded +bsrx427 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx428 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx429 toSci 1.234551 -> 1.2345 Rounded Inexact +rounding: half_up +bsrx431 toSci 1.23450 -> 1.2345 Rounded +bsrx432 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx433 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx434 toSci 1.234650 -> 1.2347 Rounded Inexact +bsrx435 toSci 1.234551 -> 1.2346 Rounded Inexact +-- negatives +rounding: ceiling +bsrx501 toSci -1.23450 -> -1.2345 Rounded +bsrx502 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx503 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx504 toSci -1.234551 -> -1.2345 Rounded Inexact +rounding: up +bsrx505 toSci -1.23450 -> -1.2345 Rounded +bsrx506 toSci -1.234549 -> -1.2346 Rounded Inexact +bsrx507 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx508 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: floor +bsrx510 toSci -1.23450 -> -1.2345 Rounded +bsrx511 toSci -1.234549 -> -1.2346 Rounded Inexact +bsrx512 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx513 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: half_down +bsrx515 toSci -1.23450 -> -1.2345 Rounded +bsrx516 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx517 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx518 toSci -1.234650 -> -1.2346 Rounded Inexact +bsrx519 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: half_even +bsrx521 toSci -1.23450 -> -1.2345 Rounded +bsrx522 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx523 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx524 toSci -1.234650 -> -1.2346 Rounded Inexact +bsrx525 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: down +bsrx526 toSci -1.23450 -> -1.2345 Rounded +bsrx527 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx528 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx529 toSci -1.234551 -> -1.2345 Rounded Inexact +rounding: half_up +bsrx531 toSci -1.23450 -> -1.2345 Rounded +bsrx532 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx533 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx534 toSci -1.234650 -> -1.2347 Rounded Inexact +bsrx535 toSci -1.234551 -> -1.2346 Rounded Inexact + +-- a few larger exponents +maxExponent: 999999999 +minExponent: -999999999 +basx480 toSci "0.09e999" -> '9E+997' +basx481 toSci "0.9e999" -> '9E+998' +basx482 toSci "9e999" -> '9E+999' +basx483 toSci "9.9e999" -> '9.9E+999' +basx484 toSci "9.99e999" -> '9.99E+999' +basx485 toSci "9.99e-999" -> '9.99E-999' +basx486 toSci "9.9e-999" -> '9.9E-999' +basx487 toSci "9e-999" -> '9E-999' +basx489 toSci "99e-999" -> '9.9E-998' +basx490 toSci "999e-999" -> '9.99E-997' +basx491 toSci '0.9e-998' -> '9E-999' +basx492 toSci '0.09e-997' -> '9E-999' +basx493 toSci '0.1e1000' -> '1E+999' +basx494 toSci '10e-1000' -> '1.0E-999' + +rounding: half_up +precision: 9 + +-- The 'baddies' tests from DiagBigDecimal, plus some new ones +basx500 toSci '1..2' -> NaN Conversion_syntax +basx501 toSci '.' -> NaN Conversion_syntax +basx502 toSci '..' -> NaN Conversion_syntax +basx503 toSci '++1' -> NaN Conversion_syntax +basx504 toSci '--1' -> NaN Conversion_syntax +basx505 toSci '-+1' -> NaN Conversion_syntax +basx506 toSci '+-1' -> NaN Conversion_syntax +basx507 toSci '12e' -> NaN Conversion_syntax +basx508 toSci '12e++' -> NaN Conversion_syntax +basx509 toSci '12f4' -> NaN Conversion_syntax +basx510 toSci ' +1' -> NaN Conversion_syntax +basx511 toSci '+ 1' -> NaN Conversion_syntax +basx512 toSci '12 ' -> NaN Conversion_syntax +basx513 toSci ' + 1' -> NaN Conversion_syntax +basx514 toSci ' - 1 ' -> NaN Conversion_syntax +basx515 toSci 'x' -> NaN Conversion_syntax +basx516 toSci '-1-' -> NaN Conversion_syntax +basx517 toSci '12-' -> NaN Conversion_syntax +basx518 toSci '3+' -> NaN Conversion_syntax +basx519 toSci '' -> NaN Conversion_syntax +basx520 toSci '1e-' -> NaN Conversion_syntax +basx521 toSci '7e99999a' -> NaN Conversion_syntax +basx522 toSci '7e123567890x' -> NaN Conversion_syntax +basx523 toSci '7e12356789012x' -> NaN Conversion_syntax +basx524 toSci '' -> NaN Conversion_syntax +basx525 toSci 'e100' -> NaN Conversion_syntax +basx526 toSci '\u0e5a' -> NaN Conversion_syntax +basx527 toSci '\u0b65' -> NaN Conversion_syntax +basx528 toSci '123,65' -> NaN Conversion_syntax +basx529 toSci '1.34.5' -> NaN Conversion_syntax +basx530 toSci '.123.5' -> NaN Conversion_syntax +basx531 toSci '01.35.' -> NaN Conversion_syntax +basx532 toSci '01.35-' -> NaN Conversion_syntax +basx533 toSci '0000..' -> NaN Conversion_syntax +basx534 toSci '.0000.' -> NaN Conversion_syntax +basx535 toSci '00..00' -> NaN Conversion_syntax +basx536 toSci '111e*123' -> NaN Conversion_syntax +basx537 toSci '111e123-' -> NaN Conversion_syntax +basx538 toSci '111e+12+' -> NaN Conversion_syntax +basx539 toSci '111e1-3-' -> NaN Conversion_syntax +basx540 toSci '111e1*23' -> NaN Conversion_syntax +basx541 toSci '111e1e+3' -> NaN Conversion_syntax +basx542 toSci '1e1.0' -> NaN Conversion_syntax +basx543 toSci '1e123e' -> NaN Conversion_syntax +basx544 toSci 'ten' -> NaN Conversion_syntax +basx545 toSci 'ONE' -> NaN Conversion_syntax +basx546 toSci '1e.1' -> NaN Conversion_syntax +basx547 toSci '1e1.' -> NaN Conversion_syntax +basx548 toSci '1ee' -> NaN Conversion_syntax +basx549 toSci 'e+1' -> NaN Conversion_syntax +basx550 toSci '1.23.4' -> NaN Conversion_syntax +basx551 toSci '1.2.1' -> NaN Conversion_syntax +basx552 toSci '1E+1.2' -> NaN Conversion_syntax +basx553 toSci '1E+1.2.3' -> NaN Conversion_syntax +basx554 toSci '1E++1' -> NaN Conversion_syntax +basx555 toSci '1E--1' -> NaN Conversion_syntax +basx556 toSci '1E+-1' -> NaN Conversion_syntax +basx557 toSci '1E-+1' -> NaN Conversion_syntax +basx558 toSci '1E''1' -> NaN Conversion_syntax +basx559 toSci "1E""1" -> NaN Conversion_syntax +basx560 toSci "1E""""" -> NaN Conversion_syntax +-- Near-specials +basx561 toSci "qNaN" -> NaN Conversion_syntax +basx562 toSci "NaNq" -> NaN Conversion_syntax +basx563 toSci "NaNs" -> NaN Conversion_syntax +basx564 toSci "Infi" -> NaN Conversion_syntax +basx565 toSci "Infin" -> NaN Conversion_syntax +basx566 toSci "Infini" -> NaN Conversion_syntax +basx567 toSci "Infinit" -> NaN Conversion_syntax +basx568 toSci "-Infinit" -> NaN Conversion_syntax +basx569 toSci "0Inf" -> NaN Conversion_syntax +basx570 toSci "9Inf" -> NaN Conversion_syntax +basx571 toSci "-0Inf" -> NaN Conversion_syntax +basx572 toSci "-9Inf" -> NaN Conversion_syntax +basx573 toSci "-sNa" -> NaN Conversion_syntax +basx574 toSci "xNaN" -> NaN Conversion_syntax +basx575 toSci "0sNaN" -> NaN Conversion_syntax + +-- some baddies with dots and Es and dots and specials +basx576 toSci 'e+1' -> NaN Conversion_syntax +basx577 toSci '.e+1' -> NaN Conversion_syntax +basx578 toSci '+.e+1' -> NaN Conversion_syntax +basx579 toSci '-.e+' -> NaN Conversion_syntax +basx580 toSci '-.e' -> NaN Conversion_syntax +basx581 toSci 'E+1' -> NaN Conversion_syntax +basx582 toSci '.E+1' -> NaN Conversion_syntax +basx583 toSci '+.E+1' -> NaN Conversion_syntax +basx584 toSci '-.E+' -> NaN Conversion_syntax +basx585 toSci '-.E' -> NaN Conversion_syntax + +basx586 toSci '.NaN' -> NaN Conversion_syntax +basx587 toSci '-.NaN' -> NaN Conversion_syntax +basx588 toSci '+.sNaN' -> NaN Conversion_syntax +basx589 toSci '+.Inf' -> NaN Conversion_syntax +basx590 toSci '.Infinity' -> NaN Conversion_syntax + +-- Zeros +basx601 toSci 0.000000000 -> 0E-9 +basx602 toSci 0.00000000 -> 0E-8 +basx603 toSci 0.0000000 -> 0E-7 +basx604 toSci 0.000000 -> 0.000000 +basx605 toSci 0.00000 -> 0.00000 +basx606 toSci 0.0000 -> 0.0000 +basx607 toSci 0.000 -> 0.000 +basx608 toSci 0.00 -> 0.00 +basx609 toSci 0.0 -> 0.0 +basx610 toSci .0 -> 0.0 +basx611 toSci 0. -> 0 +basx612 toSci -.0 -> -0.0 +basx613 toSci -0. -> -0 +basx614 toSci -0.0 -> -0.0 +basx615 toSci -0.00 -> -0.00 +basx616 toSci -0.000 -> -0.000 +basx617 toSci -0.0000 -> -0.0000 +basx618 toSci -0.00000 -> -0.00000 +basx619 toSci -0.000000 -> -0.000000 +basx620 toSci -0.0000000 -> -0E-7 +basx621 toSci -0.00000000 -> -0E-8 +basx622 toSci -0.000000000 -> -0E-9 + +basx630 toSci 0.00E+0 -> 0.00 +basx631 toSci 0.00E+1 -> 0.0 +basx632 toSci 0.00E+2 -> 0 +basx633 toSci 0.00E+3 -> 0E+1 +basx634 toSci 0.00E+4 -> 0E+2 +basx635 toSci 0.00E+5 -> 0E+3 +basx636 toSci 0.00E+6 -> 0E+4 +basx637 toSci 0.00E+7 -> 0E+5 +basx638 toSci 0.00E+8 -> 0E+6 +basx639 toSci 0.00E+9 -> 0E+7 + +basx640 toSci 0.0E+0 -> 0.0 +basx641 toSci 0.0E+1 -> 0 +basx642 toSci 0.0E+2 -> 0E+1 +basx643 toSci 0.0E+3 -> 0E+2 +basx644 toSci 0.0E+4 -> 0E+3 +basx645 toSci 0.0E+5 -> 0E+4 +basx646 toSci 0.0E+6 -> 0E+5 +basx647 toSci 0.0E+7 -> 0E+6 +basx648 toSci 0.0E+8 -> 0E+7 +basx649 toSci 0.0E+9 -> 0E+8 + +basx650 toSci 0E+0 -> 0 +basx651 toSci 0E+1 -> 0E+1 +basx652 toSci 0E+2 -> 0E+2 +basx653 toSci 0E+3 -> 0E+3 +basx654 toSci 0E+4 -> 0E+4 +basx655 toSci 0E+5 -> 0E+5 +basx656 toSci 0E+6 -> 0E+6 +basx657 toSci 0E+7 -> 0E+7 +basx658 toSci 0E+8 -> 0E+8 +basx659 toSci 0E+9 -> 0E+9 + +basx660 toSci 0.0E-0 -> 0.0 +basx661 toSci 0.0E-1 -> 0.00 +basx662 toSci 0.0E-2 -> 0.000 +basx663 toSci 0.0E-3 -> 0.0000 +basx664 toSci 0.0E-4 -> 0.00000 +basx665 toSci 0.0E-5 -> 0.000000 +basx666 toSci 0.0E-6 -> 0E-7 +basx667 toSci 0.0E-7 -> 0E-8 +basx668 toSci 0.0E-8 -> 0E-9 +basx669 toSci 0.0E-9 -> 0E-10 + +basx670 toSci 0.00E-0 -> 0.00 +basx671 toSci 0.00E-1 -> 0.000 +basx672 toSci 0.00E-2 -> 0.0000 +basx673 toSci 0.00E-3 -> 0.00000 +basx674 toSci 0.00E-4 -> 0.000000 +basx675 toSci 0.00E-5 -> 0E-7 +basx676 toSci 0.00E-6 -> 0E-8 +basx677 toSci 0.00E-7 -> 0E-9 +basx678 toSci 0.00E-8 -> 0E-10 +basx679 toSci 0.00E-9 -> 0E-11 + +basx680 toSci 000000. -> 0 +basx681 toSci 00000. -> 0 +basx682 toSci 0000. -> 0 +basx683 toSci 000. -> 0 +basx684 toSci 00. -> 0 +basx685 toSci 0. -> 0 +basx686 toSci +00000. -> 0 +basx687 toSci -00000. -> -0 +basx688 toSci +0. -> 0 +basx689 toSci -0. -> -0 + +-- Specials +precision: 4 +basx700 toSci "NaN" -> NaN +basx701 toSci "nan" -> NaN +basx702 toSci "nAn" -> NaN +basx703 toSci "NAN" -> NaN +basx704 toSci "+NaN" -> NaN +basx705 toSci "+nan" -> NaN +basx706 toSci "+nAn" -> NaN +basx707 toSci "+NAN" -> NaN +basx708 toSci "-NaN" -> -NaN +basx709 toSci "-nan" -> -NaN +basx710 toSci "-nAn" -> -NaN +basx711 toSci "-NAN" -> -NaN +basx712 toSci 'NaN0' -> NaN +basx713 toSci 'NaN1' -> NaN1 +basx714 toSci 'NaN12' -> NaN12 +basx715 toSci 'NaN123' -> NaN123 +basx716 toSci 'NaN1234' -> NaN1234 +basx717 toSci 'NaN01' -> NaN1 +basx718 toSci 'NaN012' -> NaN12 +basx719 toSci 'NaN0123' -> NaN123 +basx720 toSci 'NaN01234' -> NaN1234 +basx721 toSci 'NaN001' -> NaN1 +basx722 toSci 'NaN0012' -> NaN12 +basx723 toSci 'NaN00123' -> NaN123 +basx724 toSci 'NaN001234' -> NaN1234 +basx725 toSci 'NaN12345' -> NaN Conversion_syntax +basx726 toSci 'NaN123e+1' -> NaN Conversion_syntax +basx727 toSci 'NaN12.45' -> NaN Conversion_syntax +basx728 toSci 'NaN-12' -> NaN Conversion_syntax +basx729 toSci 'NaN+12' -> NaN Conversion_syntax + +basx730 toSci "sNaN" -> sNaN +basx731 toSci "snan" -> sNaN +basx732 toSci "SnAn" -> sNaN +basx733 toSci "SNAN" -> sNaN +basx734 toSci "+sNaN" -> sNaN +basx735 toSci "+snan" -> sNaN +basx736 toSci "+SnAn" -> sNaN +basx737 toSci "+SNAN" -> sNaN +basx738 toSci "-sNaN" -> -sNaN +basx739 toSci "-snan" -> -sNaN +basx740 toSci "-SnAn" -> -sNaN +basx741 toSci "-SNAN" -> -sNaN +basx742 toSci 'sNaN0000' -> sNaN +basx743 toSci 'sNaN7' -> sNaN7 +basx744 toSci 'sNaN007234' -> sNaN7234 +basx745 toSci 'sNaN72345' -> NaN Conversion_syntax +basx746 toSci 'sNaN72.45' -> NaN Conversion_syntax +basx747 toSci 'sNaN-72' -> NaN Conversion_syntax + +basx748 toSci "Inf" -> Infinity +basx749 toSci "inf" -> Infinity +basx750 toSci "iNf" -> Infinity +basx751 toSci "INF" -> Infinity +basx752 toSci "+Inf" -> Infinity +basx753 toSci "+inf" -> Infinity +basx754 toSci "+iNf" -> Infinity +basx755 toSci "+INF" -> Infinity +basx756 toSci "-Inf" -> -Infinity +basx757 toSci "-inf" -> -Infinity +basx758 toSci "-iNf" -> -Infinity +basx759 toSci "-INF" -> -Infinity + +basx760 toSci "Infinity" -> Infinity +basx761 toSci "infinity" -> Infinity +basx762 toSci "iNfInItY" -> Infinity +basx763 toSci "INFINITY" -> Infinity +basx764 toSci "+Infinity" -> Infinity +basx765 toSci "+infinity" -> Infinity +basx766 toSci "+iNfInItY" -> Infinity +basx767 toSci "+INFINITY" -> Infinity +basx768 toSci "-Infinity" -> -Infinity +basx769 toSci "-infinity" -> -Infinity +basx770 toSci "-iNfInItY" -> -Infinity +basx771 toSci "-INFINITY" -> -Infinity + +-- Specials and zeros for toEng +basx772 toEng "NaN" -> NaN +basx773 toEng "-Infinity" -> -Infinity +basx774 toEng "-sNaN" -> -sNaN +basx775 toEng "-NaN" -> -NaN +basx776 toEng "+Infinity" -> Infinity +basx778 toEng "+sNaN" -> sNaN +basx779 toEng "+NaN" -> NaN +basx780 toEng "INFINITY" -> Infinity +basx781 toEng "SNAN" -> sNaN +basx782 toEng "NAN" -> NaN +basx783 toEng "infinity" -> Infinity +basx784 toEng "snan" -> sNaN +basx785 toEng "nan" -> NaN +basx786 toEng "InFINITY" -> Infinity +basx787 toEng "SnAN" -> sNaN +basx788 toEng "nAN" -> NaN +basx789 toEng "iNfinity" -> Infinity +basx790 toEng "sNan" -> sNaN +basx791 toEng "Nan" -> NaN +basx792 toEng "Infinity" -> Infinity +basx793 toEng "sNaN" -> sNaN + +-- Zero toEng, etc. +basx800 toEng 0e+1 -> "0.00E+3" -- doc example + +basx801 toEng 0.000000000 -> 0E-9 +basx802 toEng 0.00000000 -> 0.00E-6 +basx803 toEng 0.0000000 -> 0.0E-6 +basx804 toEng 0.000000 -> 0.000000 +basx805 toEng 0.00000 -> 0.00000 +basx806 toEng 0.0000 -> 0.0000 +basx807 toEng 0.000 -> 0.000 +basx808 toEng 0.00 -> 0.00 +basx809 toEng 0.0 -> 0.0 +basx810 toEng .0 -> 0.0 +basx811 toEng 0. -> 0 +basx812 toEng -.0 -> -0.0 +basx813 toEng -0. -> -0 +basx814 toEng -0.0 -> -0.0 +basx815 toEng -0.00 -> -0.00 +basx816 toEng -0.000 -> -0.000 +basx817 toEng -0.0000 -> -0.0000 +basx818 toEng -0.00000 -> -0.00000 +basx819 toEng -0.000000 -> -0.000000 +basx820 toEng -0.0000000 -> -0.0E-6 +basx821 toEng -0.00000000 -> -0.00E-6 +basx822 toEng -0.000000000 -> -0E-9 + +basx830 toEng 0.00E+0 -> 0.00 +basx831 toEng 0.00E+1 -> 0.0 +basx832 toEng 0.00E+2 -> 0 +basx833 toEng 0.00E+3 -> 0.00E+3 +basx834 toEng 0.00E+4 -> 0.0E+3 +basx835 toEng 0.00E+5 -> 0E+3 +basx836 toEng 0.00E+6 -> 0.00E+6 +basx837 toEng 0.00E+7 -> 0.0E+6 +basx838 toEng 0.00E+8 -> 0E+6 +basx839 toEng 0.00E+9 -> 0.00E+9 + +basx840 toEng 0.0E+0 -> 0.0 +basx841 toEng 0.0E+1 -> 0 +basx842 toEng 0.0E+2 -> 0.00E+3 +basx843 toEng 0.0E+3 -> 0.0E+3 +basx844 toEng 0.0E+4 -> 0E+3 +basx845 toEng 0.0E+5 -> 0.00E+6 +basx846 toEng 0.0E+6 -> 0.0E+6 +basx847 toEng 0.0E+7 -> 0E+6 +basx848 toEng 0.0E+8 -> 0.00E+9 +basx849 toEng 0.0E+9 -> 0.0E+9 + +basx850 toEng 0E+0 -> 0 +basx851 toEng 0E+1 -> 0.00E+3 +basx852 toEng 0E+2 -> 0.0E+3 +basx853 toEng 0E+3 -> 0E+3 +basx854 toEng 0E+4 -> 0.00E+6 +basx855 toEng 0E+5 -> 0.0E+6 +basx856 toEng 0E+6 -> 0E+6 +basx857 toEng 0E+7 -> 0.00E+9 +basx858 toEng 0E+8 -> 0.0E+9 +basx859 toEng 0E+9 -> 0E+9 + +basx860 toEng 0.0E-0 -> 0.0 +basx861 toEng 0.0E-1 -> 0.00 +basx862 toEng 0.0E-2 -> 0.000 +basx863 toEng 0.0E-3 -> 0.0000 +basx864 toEng 0.0E-4 -> 0.00000 +basx865 toEng 0.0E-5 -> 0.000000 +basx866 toEng 0.0E-6 -> 0.0E-6 +basx867 toEng 0.0E-7 -> 0.00E-6 +basx868 toEng 0.0E-8 -> 0E-9 +basx869 toEng 0.0E-9 -> 0.0E-9 + +basx870 toEng 0.00E-0 -> 0.00 +basx871 toEng 0.00E-1 -> 0.000 +basx872 toEng 0.00E-2 -> 0.0000 +basx873 toEng 0.00E-3 -> 0.00000 +basx874 toEng 0.00E-4 -> 0.000000 +basx875 toEng 0.00E-5 -> 0.0E-6 +basx876 toEng 0.00E-6 -> 0.00E-6 +basx877 toEng 0.00E-7 -> 0E-9 +basx878 toEng 0.00E-8 -> 0.0E-9 +basx879 toEng 0.00E-9 -> 0.00E-9 + + +rounding: half_up +precision: 9 +-- subnormals and overflows +basx906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded +basx907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded +basx908 toSci '0.9e-999999999' -> 9E-1000000000 Subnormal +basx909 toSci '0.09e-999999999' -> 9E-1000000001 Subnormal +basx910 toSci '0.1e1000000000' -> 1E+999999999 +basx911 toSci '10e-1000000000' -> 1.0E-999999999 +basx912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded +basx913 toSci '99e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded +basx915 toSci '1111e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx916 toSci '1111e-99999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +-- negatives the same +basx918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded +basx919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded +basx920 toSci '-0.9e-999999999' -> -9E-1000000000 Subnormal +basx921 toSci '-0.09e-999999999' -> -9E-1000000001 Subnormal +basx922 toSci '-0.1e1000000000' -> -1E+999999999 +basx923 toSci '-10e-1000000000' -> -1.0E-999999999 +basx924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded +basx925 toSci '-99e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded +basx927 toSci '-1111e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx928 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +rounding: ceiling +basx930 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +basx931 toSci '-7e1000000000' -> -9.99999999E+999999999 Overflow Inexact Rounded +rounding: up +basx932 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +basx933 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded +rounding: down +basx934 toSci '7e1000000000' -> 9.99999999E+999999999 Overflow Inexact Rounded +basx935 toSci '-7e1000000000' -> -9.99999999E+999999999 Overflow Inexact Rounded +rounding: floor +basx936 toSci '7e1000000000' -> 9.99999999E+999999999 Overflow Inexact Rounded +basx937 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +rounding: half_up +basx938 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +basx939 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded +rounding: half_even +basx940 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +basx941 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded +rounding: half_down +basx942 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +basx943 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +rounding: half_even + + +-- Giga exponent initial tests +maxExponent: 999999999 +minExponent: -999999999 + +basx951 toSci '99e999' -> '9.9E+1000' +basx952 toSci '999e999' -> '9.99E+1001' +basx953 toSci '0.9e-999' -> '9E-1000' +basx954 toSci '0.09e-999' -> '9E-1001' +basx955 toSci '0.1e1001' -> '1E+1000' +basx956 toSci '10e-1001' -> '1.0E-1000' +basx957 toSci '0.9e9999' -> '9E+9998' +basx958 toSci '99e-9999' -> '9.9E-9998' +basx959 toSci '111e9997' -> '1.11E+9999' +basx960 toSci '1111e-9999' -> '1.111E-9996' +basx961 toSci '99e9999' -> '9.9E+10000' +basx962 toSci '999e9999' -> '9.99E+10001' +basx963 toSci '0.9e-9999' -> '9E-10000' +basx964 toSci '0.09e-9999' -> '9E-10001' +basx965 toSci '0.1e10001' -> '1E+10000' +basx966 toSci '10e-10001' -> '1.0E-10000' +basx967 toSci '0.9e99999' -> '9E+99998' +basx968 toSci '99e-99999' -> '9.9E-99998' +basx969 toSci '111e99999' -> '1.11E+100001' +basx970 toSci '1111e-99999' -> '1.111E-99996' +basx971 toSci "0.09e999999999" -> '9E+999999997' +basx972 toSci "0.9e999999999" -> '9E+999999998' +basx973 toSci "9e999999999" -> '9E+999999999' +basx974 toSci "9.9e999999999" -> '9.9E+999999999' +basx975 toSci "9.99e999999999" -> '9.99E+999999999' +basx976 toSci "9.99e-999999999" -> '9.99E-999999999' +basx977 toSci "9.9e-999999999" -> '9.9E-999999999' +basx978 toSci "9e-999999999" -> '9E-999999999' +basx979 toSci "99e-999999999" -> '9.9E-999999998' +basx980 toSci "999e-999999999" -> '9.99E-999999997' + +-- Varying exponent maximums +precision: 5 +maxexponent: 0 +minexponent: 0 +emax001 toSci -1E+2 -> -Infinity Overflow Inexact Rounded +emax002 toSci -100 -> -Infinity Overflow Inexact Rounded +emax003 toSci -10 -> -Infinity Overflow Inexact Rounded +emax004 toSci -9.9 -> -9.9 +emax005 toSci -9 -> -9 +emax006 toSci -1 -> -1 +emax007 toSci 0 -> 0 +emax008 toSci 1 -> 1 +emax009 toSci 9 -> 9 +emax010 toSci 9.9 -> 9.9 +emax011 toSci 10 -> Infinity Overflow Inexact Rounded +emax012 toSci 100 -> Infinity Overflow Inexact Rounded +emax013 toSci 1E+2 -> Infinity Overflow Inexact Rounded +emax014 toSci 0.99 -> 0.99 Subnormal +emax015 toSci 0.1 -> 0.1 Subnormal +emax016 toSci 0.01 -> 0.01 Subnormal +emax017 toSci 1E-1 -> 0.1 Subnormal +emax018 toSci 1E-2 -> 0.01 Subnormal + +maxexponent: 1 +minexponent: -1 +emax100 toSci -1E+3 -> -Infinity Overflow Inexact Rounded +emax101 toSci -1E+2 -> -Infinity Overflow Inexact Rounded +emax102 toSci -100 -> -Infinity Overflow Inexact Rounded +emax103 toSci -10 -> -10 +emax104 toSci -9.9 -> -9.9 +emax105 toSci -9 -> -9 +emax106 toSci -1 -> -1 +emax107 toSci 0 -> 0 +emax108 toSci 1 -> 1 +emax109 toSci 9 -> 9 +emax110 toSci 9.9 -> 9.9 +emax111 toSci 10 -> 10 +emax112 toSci 100 -> Infinity Overflow Inexact Rounded +emax113 toSci 1E+2 -> Infinity Overflow Inexact Rounded +emax114 toSci 1E+3 -> Infinity Overflow Inexact Rounded +emax115 toSci 0.99 -> 0.99 +emax116 toSci 0.1 -> 0.1 +emax117 toSci 0.01 -> 0.01 Subnormal +emax118 toSci 1E-1 -> 0.1 +emax119 toSci 1E-2 -> 0.01 Subnormal +emax120 toSci 1E-3 -> 0.001 Subnormal +emax121 toSci 1.1E-3 -> 0.0011 Subnormal +emax122 toSci 1.11E-3 -> 0.00111 Subnormal +emax123 toSci 1.111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded +emax124 toSci 1.1111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded +emax125 toSci 1.11111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded + +maxexponent: 2 +minexponent: -2 +precision: 9 +emax200 toSci -1E+3 -> -Infinity Overflow Inexact Rounded +emax201 toSci -1E+2 -> -1E+2 +emax202 toSci -100 -> -100 +emax203 toSci -10 -> -10 +emax204 toSci -9.9 -> -9.9 +emax205 toSci -9 -> -9 +emax206 toSci -1 -> -1 +emax207 toSci 0 -> 0 +emax208 toSci 1 -> 1 +emax209 toSci 9 -> 9 +emax210 toSci 9.9 -> 9.9 +emax211 toSci 10 -> 10 +emax212 toSci 100 -> 100 +emax213 toSci 1E+2 -> 1E+2 +emax214 toSci 1E+3 -> Infinity Overflow Inexact Rounded +emax215 toSci 0.99 -> 0.99 +emax216 toSci 0.1 -> 0.1 +emax217 toSci 0.01 -> 0.01 +emax218 toSci 0.001 -> 0.001 Subnormal +emax219 toSci 1E-1 -> 0.1 +emax220 toSci 1E-2 -> 0.01 +emax221 toSci 1E-3 -> 0.001 Subnormal +emax222 toSci 1E-4 -> 0.0001 Subnormal +emax223 toSci 1E-5 -> 0.00001 Subnormal +emax224 toSci 1E-6 -> 0.000001 Subnormal +emax225 toSci 1E-7 -> 1E-7 Subnormal +emax226 toSci 1E-8 -> 1E-8 Subnormal +emax227 toSci 1E-9 -> 1E-9 Subnormal +emax228 toSci 1E-10 -> 1E-10 Subnormal +emax229 toSci 1E-11 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped +emax230 toSci 1E-12 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped + +maxexponent: 7 +minexponent: -7 +emax231 toSci 1E-8 -> 1E-8 Subnormal +emax232 toSci 1E-7 -> 1E-7 +emax233 toSci 1E-6 -> 0.000001 +emax234 toSci 1E-5 -> 0.00001 +emax235 toSci 1E+5 -> 1E+5 +emax236 toSci 1E+6 -> 1E+6 +emax237 toSci 1E+7 -> 1E+7 +emax238 toSci 1E+8 -> Infinity Overflow Inexact Rounded + +maxexponent: 9 +minexponent: -9 +emax240 toSci 1E-21 -> 0E-17 Subnormal Underflow Inexact Rounded Clamped +emax241 toSci 1E-10 -> 1E-10 Subnormal +emax242 toSci 1E-9 -> 1E-9 +emax243 toSci 1E-8 -> 1E-8 +emax244 toSci 1E-7 -> 1E-7 +emax245 toSci 1E+7 -> 1E+7 +emax246 toSci 1E+8 -> 1E+8 +emax247 toSci 1E+9 -> 1E+9 +emax248 toSci 1E+10 -> Infinity Overflow Inexact Rounded + +maxexponent: 10 -- boundary +minexponent: -10 +emax250 toSci 1E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped +emax251 toSci 1E-11 -> 1E-11 Subnormal +emax252 toSci 1E-10 -> 1E-10 +emax253 toSci 1E-9 -> 1E-9 +emax254 toSci 1E-8 -> 1E-8 +emax255 toSci 1E+8 -> 1E+8 +emax256 toSci 1E+9 -> 1E+9 +emax257 toSci 1E+10 -> 1E+10 +emax258 toSci 1E+11 -> Infinity Overflow Inexact Rounded + +emax260 toSci 1.00E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped +emax261 toSci 1.00E-11 -> 1.00E-11 Subnormal +emax262 toSci 1.00E-10 -> 1.00E-10 +emax263 toSci 1.00E-9 -> 1.00E-9 +emax264 toSci 1.00E-8 -> 1.00E-8 +emax265 toSci 1.00E+8 -> 1.00E+8 +emax266 toSci 1.00E+9 -> 1.00E+9 +emax267 toSci 1.00E+10 -> 1.00E+10 +emax268 toSci 1.00E+11 -> Infinity Overflow Inexact Rounded +emax270 toSci 9.99E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped +emax271 toSci 9.99E-11 -> 9.99E-11 Subnormal +emax272 toSci 9.99E-10 -> 9.99E-10 +emax273 toSci 9.99E-9 -> 9.99E-9 +emax274 toSci 9.99E-8 -> 9.99E-8 +emax275 toSci 9.99E+8 -> 9.99E+8 +emax276 toSci 9.99E+9 -> 9.99E+9 +emax277 toSci 9.99E+10 -> 9.99E+10 +emax278 toSci 9.99E+11 -> Infinity Overflow Inexact Rounded + +maxexponent: 99 +minexponent: -99 +emax280 toSci 1E-120 -> 0E-107 Underflow Subnormal Inexact Rounded Clamped +emax281 toSci 1E-100 -> 1E-100 Subnormal +emax282 toSci 1E-99 -> 1E-99 +emax283 toSci 1E-98 -> 1E-98 +emax284 toSci 1E+98 -> 1E+98 +emax285 toSci 1E+99 -> 1E+99 +emax286 toSci 1E+100 -> Infinity Overflow Inexact Rounded + +maxexponent: 999 +minexponent: -999 +emax291 toSci 1E-1000 -> 1E-1000 Subnormal +emax292 toSci 1E-999 -> 1E-999 +emax293 toSci 1E+999 -> 1E+999 +emax294 toSci 1E+1000 -> Infinity Overflow Inexact Rounded +maxexponent: 9999 +minexponent: -9999 +emax301 toSci 1E-10000 -> 1E-10000 Subnormal +emax302 toSci 1E-9999 -> 1E-9999 +emax303 toSci 1E+9999 -> 1E+9999 +emax304 toSci 1E+10000 -> Infinity Overflow Inexact Rounded +maxexponent: 99999 +minexponent: -99999 +emax311 toSci 1E-100000 -> 1E-100000 Subnormal +emax312 toSci 1E-99999 -> 1E-99999 +emax313 toSci 1E+99999 -> 1E+99999 +emax314 toSci 1E+100000 -> Infinity Overflow Inexact Rounded +maxexponent: 999999 +minexponent: -999999 +emax321 toSci 1E-1000000 -> 1E-1000000 Subnormal +emax322 toSci 1E-999999 -> 1E-999999 +emax323 toSci 1E+999999 -> 1E+999999 +emax324 toSci 1E+1000000 -> Infinity Overflow Inexact Rounded +maxexponent: 9999999 +minexponent: -9999999 +emax331 toSci 1E-10000000 -> 1E-10000000 Subnormal +emax332 toSci 1E-9999999 -> 1E-9999999 +emax333 toSci 1E+9999999 -> 1E+9999999 +emax334 toSci 1E+10000000 -> Infinity Overflow Inexact Rounded +maxexponent: 99999999 +minexponent: -99999999 +emax341 toSci 1E-100000000 -> 1E-100000000 Subnormal +emax342 toSci 1E-99999999 -> 1E-99999999 +emax343 toSci 1E+99999999 -> 1E+99999999 +emax344 toSci 1E+100000000 -> Infinity Overflow Inexact Rounded + +maxexponent: 999999999 +minexponent: -999999999 +emax347 toSci 1E-1000000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax348 toSci 1E-1000000007 -> 1E-1000000007 Subnormal +emax349 toSci 1E-1000000000 -> 1E-1000000000 Subnormal +emax350 toSci 1E-999999999 -> 1E-999999999 +emax351 toSci 1E+999999999 -> 1E+999999999 +emax352 toSci 1E+1000000000 -> Infinity Overflow Inexact Rounded +emax353 toSci 1.000E-1000000000 -> 1.000E-1000000000 Subnormal +emax354 toSci 1.000E-999999999 -> 1.000E-999999999 +emax355 toSci 1.000E+999999999 -> 1.000E+999999999 +emax356 toSci 1.000E+1000000000 -> Infinity Overflow Inexact Rounded +emax357 toSci 1.001E-1000000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax358 toSci 1.001E-1000000007 -> 1E-1000000007 Subnormal Inexact Rounded Underflow +emax359 toSci 1.001E-1000000000 -> 1.001E-1000000000 Subnormal +emax360 toSci 1.001E-999999999 -> 1.001E-999999999 +emax361 toSci 1.001E+999999999 -> 1.001E+999999999 +emax362 toSci 1.001E+1000000000 -> Infinity Overflow Inexact Rounded +emax363 toSci 9.000E-1000000000 -> 9.000E-1000000000 Subnormal +emax364 toSci 9.000E-999999999 -> 9.000E-999999999 +emax365 toSci 9.000E+999999999 -> 9.000E+999999999 +emax366 toSci 9.000E+1000000000 -> Infinity Overflow Inexact Rounded +emax367 toSci 9.999E-1000000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax368 toSci 9.999E-1000000008 -> 1E-1000000007 Underflow Subnormal Inexact Rounded +emax369 toSci 9.999E-1000000007 -> 1.0E-1000000006 Underflow Subnormal Inexact Rounded +emax370 toSci 9.999E-1000000000 -> 9.999E-1000000000 Subnormal +emax371 toSci 9.999E-999999999 -> 9.999E-999999999 +emax372 toSci 9.999E+999999999 -> 9.999E+999999999 + +emax373 toSci 9.999E+1000000000 -> Infinity Overflow Inexact Rounded +emax374 toSci -1E-1000000000 -> -1E-1000000000 Subnormal +emax375 toSci -1E-999999999 -> -1E-999999999 +emax376 toSci -1E+999999999 -> -1E+999999999 +emax377 toSci -1E+1000000000 -> -Infinity Overflow Inexact Rounded +emax378 toSci -1.000E-1000000000 -> -1.000E-1000000000 Subnormal +emax379 toSci -1.000E-999999999 -> -1.000E-999999999 +emax380 toSci -1.000E+999999999 -> -1.000E+999999999 +emax381 toSci -1.000E+1000000000 -> -Infinity Overflow Inexact Rounded +emax382 toSci -1.001E-1000000008 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax383 toSci -1.001E-999999999 -> -1.001E-999999999 +emax384 toSci -1.001E+999999999 -> -1.001E+999999999 +emax385 toSci -1.001E+1000000000 -> -Infinity Overflow Inexact Rounded +emax386 toSci -9.000E-1000000123 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax387 toSci -9.000E-999999999 -> -9.000E-999999999 +emax388 toSci -9.000E+999999999 -> -9.000E+999999999 +emax389 toSci -9.000E+1000000000 -> -Infinity Overflow Inexact Rounded +emax390 toSci -9.999E-1000000008 -> -1E-1000000007 Underflow Subnormal Inexact Rounded +emax391 toSci -9.999E-999999999 -> -9.999E-999999999 +emax392 toSci -9.999E+999999999 -> -9.999E+999999999 +emax393 toSci -9.999E+1000000000 -> -Infinity Overflow Inexact Rounded + +-- Now check 854 rounding of subnormals and proper underflow to 0 +precision: 5 +maxExponent: 999 +minexponent: -999 +rounding: half_even + +emax400 toSci 1.0000E-999 -> 1.0000E-999 +emax401 toSci 0.1E-999 -> 1E-1000 Subnormal +emax402 toSci 0.1000E-999 -> 1.000E-1000 Subnormal +emax403 toSci 0.0100E-999 -> 1.00E-1001 Subnormal +emax404 toSci 0.0010E-999 -> 1.0E-1002 Subnormal +emax405 toSci 0.0001E-999 -> 1E-1003 Subnormal +emax406 toSci 0.00010E-999 -> 1E-1003 Subnormal Rounded +emax407 toSci 0.00013E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax408 toSci 0.00015E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax409 toSci 0.00017E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax410 toSci 0.00023E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax411 toSci 0.00025E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax412 toSci 0.00027E-999 -> 3E-1003 Underflow Subnormal Inexact Rounded +emax413 toSci 0.000149E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax414 toSci 0.000150E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax415 toSci 0.000151E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax416 toSci 0.000249E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax417 toSci 0.000250E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax418 toSci 0.000251E-999 -> 3E-1003 Underflow Subnormal Inexact Rounded +emax419 toSci 0.00009E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax420 toSci 0.00005E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax421 toSci 0.00003E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax422 toSci 0.000009E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax423 toSci 0.000005E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax424 toSci 0.000003E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +emax425 toSci 0.001049E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded +emax426 toSci 0.001050E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded +emax427 toSci 0.001051E-999 -> 1.1E-1002 Underflow Subnormal Inexact Rounded +emax428 toSci 0.001149E-999 -> 1.1E-1002 Underflow Subnormal Inexact Rounded +emax429 toSci 0.001150E-999 -> 1.2E-1002 Underflow Subnormal Inexact Rounded +emax430 toSci 0.001151E-999 -> 1.2E-1002 Underflow Subnormal Inexact Rounded + +emax432 toSci 0.010049E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded +emax433 toSci 0.010050E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded +emax434 toSci 0.010051E-999 -> 1.01E-1001 Underflow Subnormal Inexact Rounded +emax435 toSci 0.010149E-999 -> 1.01E-1001 Underflow Subnormal Inexact Rounded +emax436 toSci 0.010150E-999 -> 1.02E-1001 Underflow Subnormal Inexact Rounded +emax437 toSci 0.010151E-999 -> 1.02E-1001 Underflow Subnormal Inexact Rounded + +emax440 toSci 0.10103E-999 -> 1.010E-1000 Underflow Subnormal Inexact Rounded +emax441 toSci 0.10105E-999 -> 1.010E-1000 Underflow Subnormal Inexact Rounded +emax442 toSci 0.10107E-999 -> 1.011E-1000 Underflow Subnormal Inexact Rounded +emax443 toSci 0.10113E-999 -> 1.011E-1000 Underflow Subnormal Inexact Rounded +emax444 toSci 0.10115E-999 -> 1.012E-1000 Underflow Subnormal Inexact Rounded +emax445 toSci 0.10117E-999 -> 1.012E-1000 Underflow Subnormal Inexact Rounded + +emax450 toSci 1.10730E-1000 -> 1.107E-1000 Underflow Subnormal Inexact Rounded +emax451 toSci 1.10750E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax452 toSci 1.10770E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax453 toSci 1.10830E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax454 toSci 1.10850E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax455 toSci 1.10870E-1000 -> 1.109E-1000 Underflow Subnormal Inexact Rounded + +-- make sure sign OK +emax456 toSci -0.10103E-999 -> -1.010E-1000 Underflow Subnormal Inexact Rounded +emax457 toSci -0.10105E-999 -> -1.010E-1000 Underflow Subnormal Inexact Rounded +emax458 toSci -0.10107E-999 -> -1.011E-1000 Underflow Subnormal Inexact Rounded +emax459 toSci -0.10113E-999 -> -1.011E-1000 Underflow Subnormal Inexact Rounded +emax460 toSci -0.10115E-999 -> -1.012E-1000 Underflow Subnormal Inexact Rounded +emax461 toSci -0.10117E-999 -> -1.012E-1000 Underflow Subnormal Inexact Rounded + +-- '999s' cases +emax464 toSci 999999E-999 -> 1.0000E-993 Inexact Rounded +emax465 toSci 99999.0E-999 -> 9.9999E-995 Rounded +emax466 toSci 99999.E-999 -> 9.9999E-995 +emax467 toSci 9999.9E-999 -> 9.9999E-996 +emax468 toSci 999.99E-999 -> 9.9999E-997 +emax469 toSci 99.999E-999 -> 9.9999E-998 +emax470 toSci 9.9999E-999 -> 9.9999E-999 +emax471 toSci 0.99999E-999 -> 1.0000E-999 Underflow Subnormal Inexact Rounded +emax472 toSci 0.099999E-999 -> 1.000E-1000 Underflow Subnormal Inexact Rounded +emax473 toSci 0.0099999E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded +emax474 toSci 0.00099999E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded +emax475 toSci 0.000099999E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax476 toSci 0.0000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax477 toSci 0.00000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax478 toSci 0.000000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +-- Exponents with insignificant leading zeros +precision: 16 +maxExponent: 999999999 +minexponent: -999999999 +basx1001 toSci 1e999999999 -> 1E+999999999 +basx1002 toSci 1e0999999999 -> 1E+999999999 +basx1003 toSci 1e00999999999 -> 1E+999999999 +basx1004 toSci 1e000999999999 -> 1E+999999999 +basx1005 toSci 1e000000000000999999999 -> 1E+999999999 +basx1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded +basx1007 toSci 1e-999999999 -> 1E-999999999 +basx1008 toSci 1e-0999999999 -> 1E-999999999 +basx1009 toSci 1e-00999999999 -> 1E-999999999 +basx1010 toSci 1e-000999999999 -> 1E-999999999 +basx1011 toSci 1e-000000000000999999999 -> 1E-999999999 +basx1012 toSci 1e-000000000001000000007 -> 1E-1000000007 Subnormal + +-- Edge cases for int32 exponents... +basx1021 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded +basx1022 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded +basx1023 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded +basx1024 tosci 1e-2147483647 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped +basx1025 tosci 1e-2147483648 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped +basx1026 tosci 1e-2147483649 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped +-- same unbalanced +precision: 7 +maxExponent: 96 +minexponent: -95 +basx1031 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded +basx1032 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded +basx1033 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded +basx1034 tosci 1e-2147483647 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +basx1035 tosci 1e-2147483648 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +basx1036 tosci 1e-2147483649 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +basx1041 toSci 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +basx1042 toSci 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +basx1043 toSci 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- clamped zeros [see also clamp.decTest] +precision: 34 +maxExponent: 6144 +minExponent: -6143 + +basx1061 apply 0e+10000 -> 0E+6144 Clamped +basx1062 apply 0e-10000 -> 0E-6176 Clamped +basx1063 apply -0e+10000 -> -0E+6144 Clamped +basx1064 apply -0e-10000 -> -0E-6176 Clamped + +precision: 16 +maxExponent: 384 +minExponent: -383 + +basx1065 apply 0e+10000 -> 0E+384 Clamped +basx1066 apply 0e-10000 -> 0E-398 Clamped +basx1067 apply -0e+10000 -> -0E+384 Clamped +basx1068 apply -0e-10000 -> -0E-398 Clamped + +-- same with IEEE clamping +clamp: 1 + +precision: 34 +maxExponent: 6144 +minExponent: -6143 + +basx1071 apply 0e+10000 -> 0E+6111 Clamped +basx1072 apply 0e-10000 -> 0E-6176 Clamped +basx1073 apply -0e+10000 -> -0E+6111 Clamped +basx1074 apply -0e-10000 -> -0E-6176 Clamped + +precision: 16 +maxExponent: 384 +minExponent: -383 + +basx1075 apply 0e+10000 -> 0E+369 Clamped +basx1076 apply 0e-10000 -> 0E-398 Clamped +basx1077 apply -0e+10000 -> -0E+369 Clamped +basx1078 apply -0e-10000 -> -0E-398 Clamped + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/clamp.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/clamp.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,211 @@ +------------------------------------------------------------------------ +-- clamp.decTest -- clamped exponent tests (format-independent) -- +-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests uses the same limits as the 8-byte concrete +-- representation, but applies clamping without using format-specific +-- conversions. + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 +clamp: 1 + +-- General testcases + +-- Normality +clam010 apply 1234567890123456 -> 1234567890123456 +clam011 apply 1234567890123456.0 -> 1234567890123456 Rounded +clam012 apply 1234567890123456.1 -> 1234567890123456 Rounded Inexact +clam013 apply -1234567890123456 -> -1234567890123456 +clam014 apply -1234567890123456.0 -> -1234567890123456 Rounded +clam015 apply -1234567890123456.1 -> -1234567890123456 Rounded Inexact + + +-- Nmax and similar +clam022 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +clam024 apply 1.234567890123456E+384 -> 1.234567890123456E+384 +-- fold-downs (more below) +clam030 apply 1.23E+384 -> 1.230000000000000E+384 Clamped +clam032 apply 1E+384 -> 1.000000000000000E+384 Clamped + +clam051 apply 12345 -> 12345 +clam053 apply 1234 -> 1234 +clam055 apply 123 -> 123 +clam057 apply 12 -> 12 +clam059 apply 1 -> 1 +clam061 apply 1.23 -> 1.23 +clam063 apply 123.45 -> 123.45 + +-- Nmin and below +clam071 apply 1E-383 -> 1E-383 +clam073 apply 1.000000000000000E-383 -> 1.000000000000000E-383 +clam075 apply 1.000000000000001E-383 -> 1.000000000000001E-383 + +clam077 apply 0.100000000000000E-383 -> 1.00000000000000E-384 Subnormal +clam079 apply 0.000000000000010E-383 -> 1.0E-397 Subnormal +clam081 apply 0.00000000000001E-383 -> 1E-397 Subnormal +clam083 apply 0.000000000000001E-383 -> 1E-398 Subnormal + +-- underflows +clam090 apply 1e-398 -> #0000000000000001 Subnormal +clam091 apply 1.9e-398 -> #0000000000000002 Subnormal Underflow Inexact Rounded +clam092 apply 1.1e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam093 apply 1.00000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam094 apply 1.00000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam095 apply 1.000000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam096 apply 0.1e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam097 apply 0.00000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam098 apply 0.00000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam099 apply 0.000000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped + +-- Same again, negatives +-- Nmax and similar +clam122 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +clam124 apply -1.234567890123456E+384 -> -1.234567890123456E+384 +-- fold-downs (more below) +clam130 apply -1.23E+384 -> -1.230000000000000E+384 Clamped +clam132 apply -1E+384 -> -1.000000000000000E+384 Clamped + +clam151 apply -12345 -> -12345 +clam153 apply -1234 -> -1234 +clam155 apply -123 -> -123 +clam157 apply -12 -> -12 +clam159 apply -1 -> -1 +clam161 apply -1.23 -> -1.23 +clam163 apply -123.45 -> -123.45 + +-- Nmin and below +clam171 apply -1E-383 -> -1E-383 +clam173 apply -1.000000000000000E-383 -> -1.000000000000000E-383 +clam175 apply -1.000000000000001E-383 -> -1.000000000000001E-383 + +clam177 apply -0.100000000000000E-383 -> -1.00000000000000E-384 Subnormal +clam179 apply -0.000000000000010E-383 -> -1.0E-397 Subnormal +clam181 apply -0.00000000000001E-383 -> -1E-397 Subnormal +clam183 apply -0.000000000000001E-383 -> -1E-398 Subnormal + +-- underflows +clam189 apply -1e-398 -> #8000000000000001 Subnormal +clam190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded +clam191 apply -1.9e-398 -> #8000000000000002 Subnormal Underflow Inexact Rounded +clam192 apply -1.1e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam193 apply -1.00000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam194 apply -1.00000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam195 apply -1.000000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam196 apply -0.1e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam197 apply -0.00000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam198 apply -0.00000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam199 apply -0.000000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped + +-- zeros +clam401 apply 0E-500 -> 0E-398 Clamped +clam402 apply 0E-400 -> 0E-398 Clamped +clam403 apply 0E-398 -> 0E-398 +clam404 apply 0.000000000000000E-383 -> 0E-398 +clam405 apply 0E-2 -> 0.00 +clam406 apply 0 -> 0 +clam407 apply 0E+3 -> 0E+3 +clam408 apply 0E+369 -> 0E+369 +-- clamped zeros... +clam410 apply 0E+370 -> 0E+369 Clamped +clam411 apply 0E+384 -> 0E+369 Clamped +clam412 apply 0E+400 -> 0E+369 Clamped +clam413 apply 0E+500 -> 0E+369 Clamped + +-- negative zeros +clam420 apply -0E-500 -> -0E-398 Clamped +clam421 apply -0E-400 -> -0E-398 Clamped +clam422 apply -0E-398 -> -0E-398 +clam423 apply -0.000000000000000E-383 -> -0E-398 +clam424 apply -0E-2 -> -0.00 +clam425 apply -0 -> -0 +clam426 apply -0E+3 -> -0E+3 +clam427 apply -0E+369 -> -0E+369 +-- clamped zeros... +clam431 apply -0E+370 -> -0E+369 Clamped +clam432 apply -0E+384 -> -0E+369 Clamped +clam433 apply -0E+400 -> -0E+369 Clamped +clam434 apply -0E+500 -> -0E+369 Clamped + +-- fold-down full sequence +clam601 apply 1E+384 -> 1.000000000000000E+384 Clamped +clam603 apply 1E+383 -> 1.00000000000000E+383 Clamped +clam605 apply 1E+382 -> 1.0000000000000E+382 Clamped +clam607 apply 1E+381 -> 1.000000000000E+381 Clamped +clam609 apply 1E+380 -> 1.00000000000E+380 Clamped +clam611 apply 1E+379 -> 1.0000000000E+379 Clamped +clam613 apply 1E+378 -> 1.000000000E+378 Clamped +clam615 apply 1E+377 -> 1.00000000E+377 Clamped +clam617 apply 1E+376 -> 1.0000000E+376 Clamped +clam619 apply 1E+375 -> 1.000000E+375 Clamped +clam621 apply 1E+374 -> 1.00000E+374 Clamped +clam623 apply 1E+373 -> 1.0000E+373 Clamped +clam625 apply 1E+372 -> 1.000E+372 Clamped +clam627 apply 1E+371 -> 1.00E+371 Clamped +clam629 apply 1E+370 -> 1.0E+370 Clamped +clam631 apply 1E+369 -> 1E+369 +clam633 apply 1E+368 -> 1E+368 +-- same with 9s +clam641 apply 9E+384 -> 9.000000000000000E+384 Clamped +clam643 apply 9E+383 -> 9.00000000000000E+383 Clamped +clam645 apply 9E+382 -> 9.0000000000000E+382 Clamped +clam647 apply 9E+381 -> 9.000000000000E+381 Clamped +clam649 apply 9E+380 -> 9.00000000000E+380 Clamped +clam651 apply 9E+379 -> 9.0000000000E+379 Clamped +clam653 apply 9E+378 -> 9.000000000E+378 Clamped +clam655 apply 9E+377 -> 9.00000000E+377 Clamped +clam657 apply 9E+376 -> 9.0000000E+376 Clamped +clam659 apply 9E+375 -> 9.000000E+375 Clamped +clam661 apply 9E+374 -> 9.00000E+374 Clamped +clam663 apply 9E+373 -> 9.0000E+373 Clamped +clam665 apply 9E+372 -> 9.000E+372 Clamped +clam667 apply 9E+371 -> 9.00E+371 Clamped +clam669 apply 9E+370 -> 9.0E+370 Clamped +clam671 apply 9E+369 -> 9E+369 +clam673 apply 9E+368 -> 9E+368 + +-- subnormals clamped to 0-Etiny +precision: 16 +maxExponent: 384 +minExponent: -383 +clam681 apply 7E-398 -> 7E-398 Subnormal +clam682 apply 0E-398 -> 0E-398 +clam683 apply 7E-399 -> 1E-398 Subnormal Underflow Inexact Rounded +clam684 apply 4E-399 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +clam685 apply 7E-400 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +clam686 apply 7E-401 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +clam687 apply 0E-399 -> 0E-398 Clamped +clam688 apply 0E-400 -> 0E-398 Clamped +clam689 apply 0E-401 -> 0E-398 Clamped + +-- example from documentation +precision: 7 +rounding: half_even +maxExponent: +96 +minExponent: -95 + +clamp: 0 +clam700 apply 1.23E+96 -> 1.23E+96 + +clamp: 1 +clam701 apply 1.23E+96 -> 1.230000E+96 Clamped Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/class.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/class.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,131 @@ +------------------------------------------------------------------------ +-- class.decTest -- Class operations -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- [New 2006.11.27] + +precision: 9 +maxExponent: 999 +minExponent: -999 +extended: 1 +clamp: 1 +rounding: half_even + +clasx001 class 0 -> +Zero +clasx002 class 0.00 -> +Zero +clasx003 class 0E+5 -> +Zero +clasx004 class 1E-1007 -> +Subnormal +clasx005 class 0.1E-999 -> +Subnormal +clasx006 class 0.99999999E-999 -> +Subnormal +clasx007 class 1.00000000E-999 -> +Normal +clasx008 class 1E-999 -> +Normal +clasx009 class 1E-100 -> +Normal +clasx010 class 1E-10 -> +Normal +clasx012 class 1E-1 -> +Normal +clasx013 class 1 -> +Normal +clasx014 class 2.50 -> +Normal +clasx015 class 100.100 -> +Normal +clasx016 class 1E+30 -> +Normal +clasx017 class 1E+999 -> +Normal +clasx018 class 9.99999999E+999 -> +Normal +clasx019 class Inf -> +Infinity + +clasx021 class -0 -> -Zero +clasx022 class -0.00 -> -Zero +clasx023 class -0E+5 -> -Zero +clasx024 class -1E-1007 -> -Subnormal +clasx025 class -0.1E-999 -> -Subnormal +clasx026 class -0.99999999E-999 -> -Subnormal +clasx027 class -1.00000000E-999 -> -Normal +clasx028 class -1E-999 -> -Normal +clasx029 class -1E-100 -> -Normal +clasx030 class -1E-10 -> -Normal +clasx032 class -1E-1 -> -Normal +clasx033 class -1 -> -Normal +clasx034 class -2.50 -> -Normal +clasx035 class -100.100 -> -Normal +clasx036 class -1E+30 -> -Normal +clasx037 class -1E+999 -> -Normal +clasx038 class -9.99999999E+999 -> -Normal +clasx039 class -Inf -> -Infinity + +clasx041 class NaN -> NaN +clasx042 class -NaN -> NaN +clasx043 class +NaN12345 -> NaN +clasx044 class sNaN -> sNaN +clasx045 class -sNaN -> sNaN +clasx046 class +sNaN12345 -> sNaN + + +-- decimal64 bounds + +precision: 16 +maxExponent: 384 +minExponent: -383 +clamp: 1 +rounding: half_even + +clasx201 class 0 -> +Zero +clasx202 class 0.00 -> +Zero +clasx203 class 0E+5 -> +Zero +clasx204 class 1E-396 -> +Subnormal +clasx205 class 0.1E-383 -> +Subnormal +clasx206 class 0.999999999999999E-383 -> +Subnormal +clasx207 class 1.000000000000000E-383 -> +Normal +clasx208 class 1E-383 -> +Normal +clasx209 class 1E-100 -> +Normal +clasx210 class 1E-10 -> +Normal +clasx212 class 1E-1 -> +Normal +clasx213 class 1 -> +Normal +clasx214 class 2.50 -> +Normal +clasx215 class 100.100 -> +Normal +clasx216 class 1E+30 -> +Normal +clasx217 class 1E+384 -> +Normal +clasx218 class 9.999999999999999E+384 -> +Normal +clasx219 class Inf -> +Infinity + +clasx221 class -0 -> -Zero +clasx222 class -0.00 -> -Zero +clasx223 class -0E+5 -> -Zero +clasx224 class -1E-396 -> -Subnormal +clasx225 class -0.1E-383 -> -Subnormal +clasx226 class -0.999999999999999E-383 -> -Subnormal +clasx227 class -1.000000000000000E-383 -> -Normal +clasx228 class -1E-383 -> -Normal +clasx229 class -1E-100 -> -Normal +clasx230 class -1E-10 -> -Normal +clasx232 class -1E-1 -> -Normal +clasx233 class -1 -> -Normal +clasx234 class -2.50 -> -Normal +clasx235 class -100.100 -> -Normal +clasx236 class -1E+30 -> -Normal +clasx237 class -1E+384 -> -Normal +clasx238 class -9.999999999999999E+384 -> -Normal +clasx239 class -Inf -> -Infinity + +clasx241 class NaN -> NaN +clasx242 class -NaN -> NaN +clasx243 class +NaN12345 -> NaN +clasx244 class sNaN -> sNaN +clasx245 class -sNaN -> sNaN +clasx246 class +sNaN12345 -> sNaN + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/compare.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/compare.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,758 @@ +------------------------------------------------------------------------ +-- compare.decTest -- decimal comparison that allows quiet NaNs -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). + +extended: 1 + +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- sanity checks +comx001 compare -2 -2 -> 0 +comx002 compare -2 -1 -> -1 +comx003 compare -2 0 -> -1 +comx004 compare -2 1 -> -1 +comx005 compare -2 2 -> -1 +comx006 compare -1 -2 -> 1 +comx007 compare -1 -1 -> 0 +comx008 compare -1 0 -> -1 +comx009 compare -1 1 -> -1 +comx010 compare -1 2 -> -1 +comx011 compare 0 -2 -> 1 +comx012 compare 0 -1 -> 1 +comx013 compare 0 0 -> 0 +comx014 compare 0 1 -> -1 +comx015 compare 0 2 -> -1 +comx016 compare 1 -2 -> 1 +comx017 compare 1 -1 -> 1 +comx018 compare 1 0 -> 1 +comx019 compare 1 1 -> 0 +comx020 compare 1 2 -> -1 +comx021 compare 2 -2 -> 1 +comx022 compare 2 -1 -> 1 +comx023 compare 2 0 -> 1 +comx025 compare 2 1 -> 1 +comx026 compare 2 2 -> 0 + +comx031 compare -20 -20 -> 0 +comx032 compare -20 -10 -> -1 +comx033 compare -20 00 -> -1 +comx034 compare -20 10 -> -1 +comx035 compare -20 20 -> -1 +comx036 compare -10 -20 -> 1 +comx037 compare -10 -10 -> 0 +comx038 compare -10 00 -> -1 +comx039 compare -10 10 -> -1 +comx040 compare -10 20 -> -1 +comx041 compare 00 -20 -> 1 +comx042 compare 00 -10 -> 1 +comx043 compare 00 00 -> 0 +comx044 compare 00 10 -> -1 +comx045 compare 00 20 -> -1 +comx046 compare 10 -20 -> 1 +comx047 compare 10 -10 -> 1 +comx048 compare 10 00 -> 1 +comx049 compare 10 10 -> 0 +comx050 compare 10 20 -> -1 +comx051 compare 20 -20 -> 1 +comx052 compare 20 -10 -> 1 +comx053 compare 20 00 -> 1 +comx055 compare 20 10 -> 1 +comx056 compare 20 20 -> 0 + +comx061 compare -2.0 -2.0 -> 0 +comx062 compare -2.0 -1.0 -> -1 +comx063 compare -2.0 0.0 -> -1 +comx064 compare -2.0 1.0 -> -1 +comx065 compare -2.0 2.0 -> -1 +comx066 compare -1.0 -2.0 -> 1 +comx067 compare -1.0 -1.0 -> 0 +comx068 compare -1.0 0.0 -> -1 +comx069 compare -1.0 1.0 -> -1 +comx070 compare -1.0 2.0 -> -1 +comx071 compare 0.0 -2.0 -> 1 +comx072 compare 0.0 -1.0 -> 1 +comx073 compare 0.0 0.0 -> 0 +comx074 compare 0.0 1.0 -> -1 +comx075 compare 0.0 2.0 -> -1 +comx076 compare 1.0 -2.0 -> 1 +comx077 compare 1.0 -1.0 -> 1 +comx078 compare 1.0 0.0 -> 1 +comx079 compare 1.0 1.0 -> 0 +comx080 compare 1.0 2.0 -> -1 +comx081 compare 2.0 -2.0 -> 1 +comx082 compare 2.0 -1.0 -> 1 +comx083 compare 2.0 0.0 -> 1 +comx085 compare 2.0 1.0 -> 1 +comx086 compare 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +maxexponent: 999999999 +minexponent: -999999999 +comx095 compare 9.99999999E+999999999 9.99999999E+999999999 -> 0 +comx096 compare -9.99999999E+999999999 9.99999999E+999999999 -> -1 +comx097 compare 9.99999999E+999999999 -9.99999999E+999999999 -> 1 +comx098 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0 + +-- some differing length/exponent cases +comx100 compare 7.0 7.0 -> 0 +comx101 compare 7.0 7 -> 0 +comx102 compare 7 7.0 -> 0 +comx103 compare 7E+0 7.0 -> 0 +comx104 compare 70E-1 7.0 -> 0 +comx105 compare 0.7E+1 7 -> 0 +comx106 compare 70E-1 7 -> 0 +comx107 compare 7.0 7E+0 -> 0 +comx108 compare 7.0 70E-1 -> 0 +comx109 compare 7 0.7E+1 -> 0 +comx110 compare 7 70E-1 -> 0 + +comx120 compare 8.0 7.0 -> 1 +comx121 compare 8.0 7 -> 1 +comx122 compare 8 7.0 -> 1 +comx123 compare 8E+0 7.0 -> 1 +comx124 compare 80E-1 7.0 -> 1 +comx125 compare 0.8E+1 7 -> 1 +comx126 compare 80E-1 7 -> 1 +comx127 compare 8.0 7E+0 -> 1 +comx128 compare 8.0 70E-1 -> 1 +comx129 compare 8 0.7E+1 -> 1 +comx130 compare 8 70E-1 -> 1 + +comx140 compare 8.0 9.0 -> -1 +comx141 compare 8.0 9 -> -1 +comx142 compare 8 9.0 -> -1 +comx143 compare 8E+0 9.0 -> -1 +comx144 compare 80E-1 9.0 -> -1 +comx145 compare 0.8E+1 9 -> -1 +comx146 compare 80E-1 9 -> -1 +comx147 compare 8.0 9E+0 -> -1 +comx148 compare 8.0 90E-1 -> -1 +comx149 compare 8 0.9E+1 -> -1 +comx150 compare 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +comx200 compare -7.0 7.0 -> -1 +comx201 compare -7.0 7 -> -1 +comx202 compare -7 7.0 -> -1 +comx203 compare -7E+0 7.0 -> -1 +comx204 compare -70E-1 7.0 -> -1 +comx205 compare -0.7E+1 7 -> -1 +comx206 compare -70E-1 7 -> -1 +comx207 compare -7.0 7E+0 -> -1 +comx208 compare -7.0 70E-1 -> -1 +comx209 compare -7 0.7E+1 -> -1 +comx210 compare -7 70E-1 -> -1 + +comx220 compare -8.0 7.0 -> -1 +comx221 compare -8.0 7 -> -1 +comx222 compare -8 7.0 -> -1 +comx223 compare -8E+0 7.0 -> -1 +comx224 compare -80E-1 7.0 -> -1 +comx225 compare -0.8E+1 7 -> -1 +comx226 compare -80E-1 7 -> -1 +comx227 compare -8.0 7E+0 -> -1 +comx228 compare -8.0 70E-1 -> -1 +comx229 compare -8 0.7E+1 -> -1 +comx230 compare -8 70E-1 -> -1 + +comx240 compare -8.0 9.0 -> -1 +comx241 compare -8.0 9 -> -1 +comx242 compare -8 9.0 -> -1 +comx243 compare -8E+0 9.0 -> -1 +comx244 compare -80E-1 9.0 -> -1 +comx245 compare -0.8E+1 9 -> -1 +comx246 compare -80E-1 9 -> -1 +comx247 compare -8.0 9E+0 -> -1 +comx248 compare -8.0 90E-1 -> -1 +comx249 compare -8 0.9E+1 -> -1 +comx250 compare -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +comx300 compare 7.0 -7.0 -> 1 +comx301 compare 7.0 -7 -> 1 +comx302 compare 7 -7.0 -> 1 +comx303 compare 7E+0 -7.0 -> 1 +comx304 compare 70E-1 -7.0 -> 1 +comx305 compare .7E+1 -7 -> 1 +comx306 compare 70E-1 -7 -> 1 +comx307 compare 7.0 -7E+0 -> 1 +comx308 compare 7.0 -70E-1 -> 1 +comx309 compare 7 -.7E+1 -> 1 +comx310 compare 7 -70E-1 -> 1 + +comx320 compare 8.0 -7.0 -> 1 +comx321 compare 8.0 -7 -> 1 +comx322 compare 8 -7.0 -> 1 +comx323 compare 8E+0 -7.0 -> 1 +comx324 compare 80E-1 -7.0 -> 1 +comx325 compare .8E+1 -7 -> 1 +comx326 compare 80E-1 -7 -> 1 +comx327 compare 8.0 -7E+0 -> 1 +comx328 compare 8.0 -70E-1 -> 1 +comx329 compare 8 -.7E+1 -> 1 +comx330 compare 8 -70E-1 -> 1 + +comx340 compare 8.0 -9.0 -> 1 +comx341 compare 8.0 -9 -> 1 +comx342 compare 8 -9.0 -> 1 +comx343 compare 8E+0 -9.0 -> 1 +comx344 compare 80E-1 -9.0 -> 1 +comx345 compare .8E+1 -9 -> 1 +comx346 compare 80E-1 -9 -> 1 +comx347 compare 8.0 -9E+0 -> 1 +comx348 compare 8.0 -90E-1 -> 1 +comx349 compare 8 -.9E+1 -> 1 +comx350 compare 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +comx400 compare -7.0 -7.0 -> 0 +comx401 compare -7.0 -7 -> 0 +comx402 compare -7 -7.0 -> 0 +comx403 compare -7E+0 -7.0 -> 0 +comx404 compare -70E-1 -7.0 -> 0 +comx405 compare -.7E+1 -7 -> 0 +comx406 compare -70E-1 -7 -> 0 +comx407 compare -7.0 -7E+0 -> 0 +comx408 compare -7.0 -70E-1 -> 0 +comx409 compare -7 -.7E+1 -> 0 +comx410 compare -7 -70E-1 -> 0 + +comx420 compare -8.0 -7.0 -> -1 +comx421 compare -8.0 -7 -> -1 +comx422 compare -8 -7.0 -> -1 +comx423 compare -8E+0 -7.0 -> -1 +comx424 compare -80E-1 -7.0 -> -1 +comx425 compare -.8E+1 -7 -> -1 +comx426 compare -80E-1 -7 -> -1 +comx427 compare -8.0 -7E+0 -> -1 +comx428 compare -8.0 -70E-1 -> -1 +comx429 compare -8 -.7E+1 -> -1 +comx430 compare -8 -70E-1 -> -1 + +comx440 compare -8.0 -9.0 -> 1 +comx441 compare -8.0 -9 -> 1 +comx442 compare -8 -9.0 -> 1 +comx443 compare -8E+0 -9.0 -> 1 +comx444 compare -80E-1 -9.0 -> 1 +comx445 compare -.8E+1 -9 -> 1 +comx446 compare -80E-1 -9 -> 1 +comx447 compare -8.0 -9E+0 -> 1 +comx448 compare -8.0 -90E-1 -> 1 +comx449 compare -8 -.9E+1 -> 1 +comx450 compare -8 -90E-1 -> 1 + +-- misalignment traps for little-endian +comx451 compare 1.0 0.1 -> 1 +comx452 compare 0.1 1.0 -> -1 +comx453 compare 10.0 0.1 -> 1 +comx454 compare 0.1 10.0 -> -1 +comx455 compare 100 1.0 -> 1 +comx456 compare 1.0 100 -> -1 +comx457 compare 1000 10.0 -> 1 +comx458 compare 10.0 1000 -> -1 +comx459 compare 10000 100.0 -> 1 +comx460 compare 100.0 10000 -> -1 +comx461 compare 100000 1000.0 -> 1 +comx462 compare 1000.0 100000 -> -1 +comx463 compare 1000000 10000.0 -> 1 +comx464 compare 10000.0 1000000 -> -1 + +-- testcases that subtract to lots of zeros at boundaries [pgr] +precision: 40 +comx470 compare 123.4560000000000000E789 123.456E789 -> 0 +comx471 compare 123.456000000000000E-89 123.456E-89 -> 0 +comx472 compare 123.45600000000000E789 123.456E789 -> 0 +comx473 compare 123.4560000000000E-89 123.456E-89 -> 0 +comx474 compare 123.456000000000E789 123.456E789 -> 0 +comx475 compare 123.45600000000E-89 123.456E-89 -> 0 +comx476 compare 123.4560000000E789 123.456E789 -> 0 +comx477 compare 123.456000000E-89 123.456E-89 -> 0 +comx478 compare 123.45600000E789 123.456E789 -> 0 +comx479 compare 123.4560000E-89 123.456E-89 -> 0 +comx480 compare 123.456000E789 123.456E789 -> 0 +comx481 compare 123.45600E-89 123.456E-89 -> 0 +comx482 compare 123.4560E789 123.456E789 -> 0 +comx483 compare 123.456E-89 123.456E-89 -> 0 +comx484 compare 123.456E-89 123.4560000000000000E-89 -> 0 +comx485 compare 123.456E789 123.456000000000000E789 -> 0 +comx486 compare 123.456E-89 123.45600000000000E-89 -> 0 +comx487 compare 123.456E789 123.4560000000000E789 -> 0 +comx488 compare 123.456E-89 123.456000000000E-89 -> 0 +comx489 compare 123.456E789 123.45600000000E789 -> 0 +comx490 compare 123.456E-89 123.4560000000E-89 -> 0 +comx491 compare 123.456E789 123.456000000E789 -> 0 +comx492 compare 123.456E-89 123.45600000E-89 -> 0 +comx493 compare 123.456E789 123.4560000E789 -> 0 +comx494 compare 123.456E-89 123.456000E-89 -> 0 +comx495 compare 123.456E789 123.45600E789 -> 0 +comx496 compare 123.456E-89 123.4560E-89 -> 0 +comx497 compare 123.456E789 123.456E789 -> 0 + +-- wide-ranging, around precision; signs equal +precision: 9 +comx500 compare 1 1E-15 -> 1 +comx501 compare 1 1E-14 -> 1 +comx502 compare 1 1E-13 -> 1 +comx503 compare 1 1E-12 -> 1 +comx504 compare 1 1E-11 -> 1 +comx505 compare 1 1E-10 -> 1 +comx506 compare 1 1E-9 -> 1 +comx507 compare 1 1E-8 -> 1 +comx508 compare 1 1E-7 -> 1 +comx509 compare 1 1E-6 -> 1 +comx510 compare 1 1E-5 -> 1 +comx511 compare 1 1E-4 -> 1 +comx512 compare 1 1E-3 -> 1 +comx513 compare 1 1E-2 -> 1 +comx514 compare 1 1E-1 -> 1 +comx515 compare 1 1E-0 -> 0 +comx516 compare 1 1E+1 -> -1 +comx517 compare 1 1E+2 -> -1 +comx518 compare 1 1E+3 -> -1 +comx519 compare 1 1E+4 -> -1 +comx521 compare 1 1E+5 -> -1 +comx522 compare 1 1E+6 -> -1 +comx523 compare 1 1E+7 -> -1 +comx524 compare 1 1E+8 -> -1 +comx525 compare 1 1E+9 -> -1 +comx526 compare 1 1E+10 -> -1 +comx527 compare 1 1E+11 -> -1 +comx528 compare 1 1E+12 -> -1 +comx529 compare 1 1E+13 -> -1 +comx530 compare 1 1E+14 -> -1 +comx531 compare 1 1E+15 -> -1 +-- LR swap +comx540 compare 1E-15 1 -> -1 +comx541 compare 1E-14 1 -> -1 +comx542 compare 1E-13 1 -> -1 +comx543 compare 1E-12 1 -> -1 +comx544 compare 1E-11 1 -> -1 +comx545 compare 1E-10 1 -> -1 +comx546 compare 1E-9 1 -> -1 +comx547 compare 1E-8 1 -> -1 +comx548 compare 1E-7 1 -> -1 +comx549 compare 1E-6 1 -> -1 +comx550 compare 1E-5 1 -> -1 +comx551 compare 1E-4 1 -> -1 +comx552 compare 1E-3 1 -> -1 +comx553 compare 1E-2 1 -> -1 +comx554 compare 1E-1 1 -> -1 +comx555 compare 1E-0 1 -> 0 +comx556 compare 1E+1 1 -> 1 +comx557 compare 1E+2 1 -> 1 +comx558 compare 1E+3 1 -> 1 +comx559 compare 1E+4 1 -> 1 +comx561 compare 1E+5 1 -> 1 +comx562 compare 1E+6 1 -> 1 +comx563 compare 1E+7 1 -> 1 +comx564 compare 1E+8 1 -> 1 +comx565 compare 1E+9 1 -> 1 +comx566 compare 1E+10 1 -> 1 +comx567 compare 1E+11 1 -> 1 +comx568 compare 1E+12 1 -> 1 +comx569 compare 1E+13 1 -> 1 +comx570 compare 1E+14 1 -> 1 +comx571 compare 1E+15 1 -> 1 +-- similar with a useful coefficient, one side only +comx580 compare 0.000000987654321 1E-15 -> 1 +comx581 compare 0.000000987654321 1E-14 -> 1 +comx582 compare 0.000000987654321 1E-13 -> 1 +comx583 compare 0.000000987654321 1E-12 -> 1 +comx584 compare 0.000000987654321 1E-11 -> 1 +comx585 compare 0.000000987654321 1E-10 -> 1 +comx586 compare 0.000000987654321 1E-9 -> 1 +comx587 compare 0.000000987654321 1E-8 -> 1 +comx588 compare 0.000000987654321 1E-7 -> 1 +comx589 compare 0.000000987654321 1E-6 -> -1 +comx590 compare 0.000000987654321 1E-5 -> -1 +comx591 compare 0.000000987654321 1E-4 -> -1 +comx592 compare 0.000000987654321 1E-3 -> -1 +comx593 compare 0.000000987654321 1E-2 -> -1 +comx594 compare 0.000000987654321 1E-1 -> -1 +comx595 compare 0.000000987654321 1E-0 -> -1 +comx596 compare 0.000000987654321 1E+1 -> -1 +comx597 compare 0.000000987654321 1E+2 -> -1 +comx598 compare 0.000000987654321 1E+3 -> -1 +comx599 compare 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +precision: 20 +comx600 compare 12 12.2345 -> -1 +comx601 compare 12.0 12.2345 -> -1 +comx602 compare 12.00 12.2345 -> -1 +comx603 compare 12.000 12.2345 -> -1 +comx604 compare 12.0000 12.2345 -> -1 +comx605 compare 12.00000 12.2345 -> -1 +comx606 compare 12.000000 12.2345 -> -1 +comx607 compare 12.0000000 12.2345 -> -1 +comx608 compare 12.00000000 12.2345 -> -1 +comx609 compare 12.000000000 12.2345 -> -1 +comx610 compare 12.1234 12 -> 1 +comx611 compare 12.1234 12.0 -> 1 +comx612 compare 12.1234 12.00 -> 1 +comx613 compare 12.1234 12.000 -> 1 +comx614 compare 12.1234 12.0000 -> 1 +comx615 compare 12.1234 12.00000 -> 1 +comx616 compare 12.1234 12.000000 -> 1 +comx617 compare 12.1234 12.0000000 -> 1 +comx618 compare 12.1234 12.00000000 -> 1 +comx619 compare 12.1234 12.000000000 -> 1 +comx620 compare -12 -12.2345 -> 1 +comx621 compare -12.0 -12.2345 -> 1 +comx622 compare -12.00 -12.2345 -> 1 +comx623 compare -12.000 -12.2345 -> 1 +comx624 compare -12.0000 -12.2345 -> 1 +comx625 compare -12.00000 -12.2345 -> 1 +comx626 compare -12.000000 -12.2345 -> 1 +comx627 compare -12.0000000 -12.2345 -> 1 +comx628 compare -12.00000000 -12.2345 -> 1 +comx629 compare -12.000000000 -12.2345 -> 1 +comx630 compare -12.1234 -12 -> -1 +comx631 compare -12.1234 -12.0 -> -1 +comx632 compare -12.1234 -12.00 -> -1 +comx633 compare -12.1234 -12.000 -> -1 +comx634 compare -12.1234 -12.0000 -> -1 +comx635 compare -12.1234 -12.00000 -> -1 +comx636 compare -12.1234 -12.000000 -> -1 +comx637 compare -12.1234 -12.0000000 -> -1 +comx638 compare -12.1234 -12.00000000 -> -1 +comx639 compare -12.1234 -12.000000000 -> -1 +precision: 9 + +-- extended zeros +comx640 compare 0 0 -> 0 +comx641 compare 0 -0 -> 0 +comx642 compare 0 -0.0 -> 0 +comx643 compare 0 0.0 -> 0 +comx644 compare -0 0 -> 0 +comx645 compare -0 -0 -> 0 +comx646 compare -0 -0.0 -> 0 +comx647 compare -0 0.0 -> 0 +comx648 compare 0.0 0 -> 0 +comx649 compare 0.0 -0 -> 0 +comx650 compare 0.0 -0.0 -> 0 +comx651 compare 0.0 0.0 -> 0 +comx652 compare -0.0 0 -> 0 +comx653 compare -0.0 -0 -> 0 +comx654 compare -0.0 -0.0 -> 0 +comx655 compare -0.0 0.0 -> 0 + +comx656 compare -0E1 0.0 -> 0 +comx657 compare -0E2 0.0 -> 0 +comx658 compare 0E1 0.0 -> 0 +comx659 compare 0E2 0.0 -> 0 +comx660 compare -0E1 0 -> 0 +comx661 compare -0E2 0 -> 0 +comx662 compare 0E1 0 -> 0 +comx663 compare 0E2 0 -> 0 +comx664 compare -0E1 -0E1 -> 0 +comx665 compare -0E2 -0E1 -> 0 +comx666 compare 0E1 -0E1 -> 0 +comx667 compare 0E2 -0E1 -> 0 +comx668 compare -0E1 -0E2 -> 0 +comx669 compare -0E2 -0E2 -> 0 +comx670 compare 0E1 -0E2 -> 0 +comx671 compare 0E2 -0E2 -> 0 +comx672 compare -0E1 0E1 -> 0 +comx673 compare -0E2 0E1 -> 0 +comx674 compare 0E1 0E1 -> 0 +comx675 compare 0E2 0E1 -> 0 +comx676 compare -0E1 0E2 -> 0 +comx677 compare -0E2 0E2 -> 0 +comx678 compare 0E1 0E2 -> 0 +comx679 compare 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +precision: 20 +comx680 compare 12 12 -> 0 +comx681 compare 12 12.0 -> 0 +comx682 compare 12 12.00 -> 0 +comx683 compare 12 12.000 -> 0 +comx684 compare 12 12.0000 -> 0 +comx685 compare 12 12.00000 -> 0 +comx686 compare 12 12.000000 -> 0 +comx687 compare 12 12.0000000 -> 0 +comx688 compare 12 12.00000000 -> 0 +comx689 compare 12 12.000000000 -> 0 +comx690 compare 12 12 -> 0 +comx691 compare 12.0 12 -> 0 +comx692 compare 12.00 12 -> 0 +comx693 compare 12.000 12 -> 0 +comx694 compare 12.0000 12 -> 0 +comx695 compare 12.00000 12 -> 0 +comx696 compare 12.000000 12 -> 0 +comx697 compare 12.0000000 12 -> 0 +comx698 compare 12.00000000 12 -> 0 +comx699 compare 12.000000000 12 -> 0 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +comx701 compare 12345678000 1 -> 1 +comx702 compare 1 12345678000 -> -1 +comx703 compare 1234567800 1 -> 1 +comx704 compare 1 1234567800 -> -1 +comx705 compare 1234567890 1 -> 1 +comx706 compare 1 1234567890 -> -1 +comx707 compare 1234567891 1 -> 1 +comx708 compare 1 1234567891 -> -1 +comx709 compare 12345678901 1 -> 1 +comx710 compare 1 12345678901 -> -1 +comx711 compare 1234567896 1 -> 1 +comx712 compare 1 1234567896 -> -1 +comx713 compare -1234567891 1 -> -1 +comx714 compare 1 -1234567891 -> 1 +comx715 compare -12345678901 1 -> -1 +comx716 compare 1 -12345678901 -> 1 +comx717 compare -1234567896 1 -> -1 +comx718 compare 1 -1234567896 -> 1 + +precision: 15 +-- same with plenty of precision +comx721 compare 12345678000 1 -> 1 +comx722 compare 1 12345678000 -> -1 +comx723 compare 1234567800 1 -> 1 +comx724 compare 1 1234567800 -> -1 +comx725 compare 1234567890 1 -> 1 +comx726 compare 1 1234567890 -> -1 +comx727 compare 1234567891 1 -> 1 +comx728 compare 1 1234567891 -> -1 +comx729 compare 12345678901 1 -> 1 +comx730 compare 1 12345678901 -> -1 +comx731 compare 1234567896 1 -> 1 +comx732 compare 1 1234567896 -> -1 + +-- residue cases +precision: 5 +comx740 compare 1 0.9999999 -> 1 +comx741 compare 1 0.999999 -> 1 +comx742 compare 1 0.99999 -> 1 +comx743 compare 1 1.0000 -> 0 +comx744 compare 1 1.00001 -> -1 +comx745 compare 1 1.000001 -> -1 +comx746 compare 1 1.0000001 -> -1 +comx750 compare 0.9999999 1 -> -1 +comx751 compare 0.999999 1 -> -1 +comx752 compare 0.99999 1 -> -1 +comx753 compare 1.0000 1 -> 0 +comx754 compare 1.00001 1 -> 1 +comx755 compare 1.000001 1 -> 1 +comx756 compare 1.0000001 1 -> 1 + +-- a selection of longies +comx760 compare -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1 +comx761 compare -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0 +comx762 compare -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1 +comx763 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +-- precisions above or below the difference should have no effect +precision: 11 +comx764 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 10 +comx765 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 9 +comx766 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 8 +comx767 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 7 +comx768 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 6 +comx769 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 5 +comx770 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 4 +comx771 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 3 +comx772 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 2 +comx773 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 1 +comx774 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 + +-- Specials +precision: 9 +comx780 compare Inf -Inf -> 1 +comx781 compare Inf -1000 -> 1 +comx782 compare Inf -1 -> 1 +comx783 compare Inf -0 -> 1 +comx784 compare Inf 0 -> 1 +comx785 compare Inf 1 -> 1 +comx786 compare Inf 1000 -> 1 +comx787 compare Inf Inf -> 0 +comx788 compare -1000 Inf -> -1 +comx789 compare -Inf Inf -> -1 +comx790 compare -1 Inf -> -1 +comx791 compare -0 Inf -> -1 +comx792 compare 0 Inf -> -1 +comx793 compare 1 Inf -> -1 +comx794 compare 1000 Inf -> -1 +comx795 compare Inf Inf -> 0 + +comx800 compare -Inf -Inf -> 0 +comx801 compare -Inf -1000 -> -1 +comx802 compare -Inf -1 -> -1 +comx803 compare -Inf -0 -> -1 +comx804 compare -Inf 0 -> -1 +comx805 compare -Inf 1 -> -1 +comx806 compare -Inf 1000 -> -1 +comx807 compare -Inf Inf -> -1 +comx808 compare -Inf -Inf -> 0 +comx809 compare -1000 -Inf -> 1 +comx810 compare -1 -Inf -> 1 +comx811 compare -0 -Inf -> 1 +comx812 compare 0 -Inf -> 1 +comx813 compare 1 -Inf -> 1 +comx814 compare 1000 -Inf -> 1 +comx815 compare Inf -Inf -> 1 + +comx821 compare NaN -Inf -> NaN +comx822 compare NaN -1000 -> NaN +comx823 compare NaN -1 -> NaN +comx824 compare NaN -0 -> NaN +comx825 compare NaN 0 -> NaN +comx826 compare NaN 1 -> NaN +comx827 compare NaN 1000 -> NaN +comx828 compare NaN Inf -> NaN +comx829 compare NaN NaN -> NaN +comx830 compare -Inf NaN -> NaN +comx831 compare -1000 NaN -> NaN +comx832 compare -1 NaN -> NaN +comx833 compare -0 NaN -> NaN +comx834 compare 0 NaN -> NaN +comx835 compare 1 NaN -> NaN +comx836 compare 1000 NaN -> NaN +comx837 compare Inf NaN -> NaN +comx838 compare -NaN -NaN -> -NaN +comx839 compare +NaN -NaN -> NaN +comx840 compare -NaN +NaN -> -NaN + +comx841 compare sNaN -Inf -> NaN Invalid_operation +comx842 compare sNaN -1000 -> NaN Invalid_operation +comx843 compare sNaN -1 -> NaN Invalid_operation +comx844 compare sNaN -0 -> NaN Invalid_operation +comx845 compare sNaN 0 -> NaN Invalid_operation +comx846 compare sNaN 1 -> NaN Invalid_operation +comx847 compare sNaN 1000 -> NaN Invalid_operation +comx848 compare sNaN NaN -> NaN Invalid_operation +comx849 compare sNaN sNaN -> NaN Invalid_operation +comx850 compare NaN sNaN -> NaN Invalid_operation +comx851 compare -Inf sNaN -> NaN Invalid_operation +comx852 compare -1000 sNaN -> NaN Invalid_operation +comx853 compare -1 sNaN -> NaN Invalid_operation +comx854 compare -0 sNaN -> NaN Invalid_operation +comx855 compare 0 sNaN -> NaN Invalid_operation +comx856 compare 1 sNaN -> NaN Invalid_operation +comx857 compare 1000 sNaN -> NaN Invalid_operation +comx858 compare Inf sNaN -> NaN Invalid_operation +comx859 compare NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +comx860 compare NaN9 -Inf -> NaN9 +comx861 compare NaN8 999 -> NaN8 +comx862 compare NaN77 Inf -> NaN77 +comx863 compare -NaN67 NaN5 -> -NaN67 +comx864 compare -Inf -NaN4 -> -NaN4 +comx865 compare -999 -NaN33 -> -NaN33 +comx866 compare Inf NaN2 -> NaN2 +comx867 compare -NaN41 -NaN42 -> -NaN41 +comx868 compare +NaN41 -NaN42 -> NaN41 +comx869 compare -NaN41 +NaN42 -> -NaN41 +comx870 compare +NaN41 +NaN42 -> NaN41 + +comx871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation +comx872 compare sNaN98 -11 -> NaN98 Invalid_operation +comx873 compare sNaN97 NaN -> NaN97 Invalid_operation +comx874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation +comx875 compare NaN85 sNaN83 -> NaN83 Invalid_operation +comx876 compare -Inf sNaN92 -> NaN92 Invalid_operation +comx877 compare 088 sNaN81 -> NaN81 Invalid_operation +comx878 compare Inf sNaN90 -> NaN90 Invalid_operation +comx879 compare NaN -sNaN89 -> -NaN89 Invalid_operation + +-- overflow and underflow tests .. subnormal results now allowed +maxExponent: 999999999 +minexponent: -999999999 +comx880 compare +1.23456789012345E-0 9E+999999999 -> -1 +comx881 compare 9E+999999999 +1.23456789012345E-0 -> 1 +comx882 compare +0.100 9E-999999999 -> 1 +comx883 compare 9E-999999999 +0.100 -> -1 +comx885 compare -1.23456789012345E-0 9E+999999999 -> -1 +comx886 compare 9E+999999999 -1.23456789012345E-0 -> 1 +comx887 compare -0.100 9E-999999999 -> -1 +comx888 compare 9E-999999999 -0.100 -> 1 + +comx889 compare 1e-599999999 1e-400000001 -> -1 +comx890 compare 1e-599999999 1e-400000000 -> -1 +comx891 compare 1e-600000000 1e-400000000 -> -1 +comx892 compare 9e-999999998 0.01 -> -1 +comx893 compare 9e-999999998 0.1 -> -1 +comx894 compare 0.01 9e-999999998 -> 1 +comx895 compare 1e599999999 1e400000001 -> 1 +comx896 compare 1e599999999 1e400000000 -> 1 +comx897 compare 1e600000000 1e400000000 -> 1 +comx898 compare 9e999999998 100 -> 1 +comx899 compare 9e999999998 10 -> 1 +comx900 compare 100 9e999999998 -> -1 +-- signs +comx901 compare 1e+777777777 1e+411111111 -> 1 +comx902 compare 1e+777777777 -1e+411111111 -> 1 +comx903 compare -1e+777777777 1e+411111111 -> -1 +comx904 compare -1e+777777777 -1e+411111111 -> -1 +comx905 compare 1e-777777777 1e-411111111 -> -1 +comx906 compare 1e-777777777 -1e-411111111 -> 1 +comx907 compare -1e-777777777 1e-411111111 -> -1 +comx908 compare -1e-777777777 -1e-411111111 -> 1 + +-- spread zeros +comx910 compare 0E-383 0 -> 0 +comx911 compare 0E-383 -0 -> 0 +comx912 compare -0E-383 0 -> 0 +comx913 compare -0E-383 -0 -> 0 +comx914 compare 0E-383 0E+384 -> 0 +comx915 compare 0E-383 -0E+384 -> 0 +comx916 compare -0E-383 0E+384 -> 0 +comx917 compare -0E-383 -0E+384 -> 0 +comx918 compare 0 0E+384 -> 0 +comx919 compare 0 -0E+384 -> 0 +comx920 compare -0 0E+384 -> 0 +comx921 compare -0 -0E+384 -> 0 +comx930 compare 0E+384 0 -> 0 +comx931 compare 0E+384 -0 -> 0 +comx932 compare -0E+384 0 -> 0 +comx933 compare -0E+384 -0 -> 0 +comx934 compare 0E+384 0E-383 -> 0 +comx935 compare 0E+384 -0E-383 -> 0 +comx936 compare -0E+384 0E-383 -> 0 +comx937 compare -0E+384 -0E-383 -> 0 +comx938 compare 0 0E-383 -> 0 +comx939 compare 0 -0E-383 -> 0 +comx940 compare -0 0E-383 -> 0 +comx941 compare -0 -0E-383 -> 0 + +-- Null tests +comx990 compare 10 # -> NaN Invalid_operation +comx991 compare # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/comparetotal.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/comparetotal.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,798 @@ +------------------------------------------------------------------------ +-- comparetotal.decTest -- decimal comparison using total ordering -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). +-- Similarly, comparetotal will have some radically different paths +-- than compare. + +extended: 1 +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +-- sanity checks +cotx001 comparetotal -2 -2 -> 0 +cotx002 comparetotal -2 -1 -> -1 +cotx003 comparetotal -2 0 -> -1 +cotx004 comparetotal -2 1 -> -1 +cotx005 comparetotal -2 2 -> -1 +cotx006 comparetotal -1 -2 -> 1 +cotx007 comparetotal -1 -1 -> 0 +cotx008 comparetotal -1 0 -> -1 +cotx009 comparetotal -1 1 -> -1 +cotx010 comparetotal -1 2 -> -1 +cotx011 comparetotal 0 -2 -> 1 +cotx012 comparetotal 0 -1 -> 1 +cotx013 comparetotal 0 0 -> 0 +cotx014 comparetotal 0 1 -> -1 +cotx015 comparetotal 0 2 -> -1 +cotx016 comparetotal 1 -2 -> 1 +cotx017 comparetotal 1 -1 -> 1 +cotx018 comparetotal 1 0 -> 1 +cotx019 comparetotal 1 1 -> 0 +cotx020 comparetotal 1 2 -> -1 +cotx021 comparetotal 2 -2 -> 1 +cotx022 comparetotal 2 -1 -> 1 +cotx023 comparetotal 2 0 -> 1 +cotx025 comparetotal 2 1 -> 1 +cotx026 comparetotal 2 2 -> 0 + +cotx031 comparetotal -20 -20 -> 0 +cotx032 comparetotal -20 -10 -> -1 +cotx033 comparetotal -20 00 -> -1 +cotx034 comparetotal -20 10 -> -1 +cotx035 comparetotal -20 20 -> -1 +cotx036 comparetotal -10 -20 -> 1 +cotx037 comparetotal -10 -10 -> 0 +cotx038 comparetotal -10 00 -> -1 +cotx039 comparetotal -10 10 -> -1 +cotx040 comparetotal -10 20 -> -1 +cotx041 comparetotal 00 -20 -> 1 +cotx042 comparetotal 00 -10 -> 1 +cotx043 comparetotal 00 00 -> 0 +cotx044 comparetotal 00 10 -> -1 +cotx045 comparetotal 00 20 -> -1 +cotx046 comparetotal 10 -20 -> 1 +cotx047 comparetotal 10 -10 -> 1 +cotx048 comparetotal 10 00 -> 1 +cotx049 comparetotal 10 10 -> 0 +cotx050 comparetotal 10 20 -> -1 +cotx051 comparetotal 20 -20 -> 1 +cotx052 comparetotal 20 -10 -> 1 +cotx053 comparetotal 20 00 -> 1 +cotx055 comparetotal 20 10 -> 1 +cotx056 comparetotal 20 20 -> 0 + +cotx061 comparetotal -2.0 -2.0 -> 0 +cotx062 comparetotal -2.0 -1.0 -> -1 +cotx063 comparetotal -2.0 0.0 -> -1 +cotx064 comparetotal -2.0 1.0 -> -1 +cotx065 comparetotal -2.0 2.0 -> -1 +cotx066 comparetotal -1.0 -2.0 -> 1 +cotx067 comparetotal -1.0 -1.0 -> 0 +cotx068 comparetotal -1.0 0.0 -> -1 +cotx069 comparetotal -1.0 1.0 -> -1 +cotx070 comparetotal -1.0 2.0 -> -1 +cotx071 comparetotal 0.0 -2.0 -> 1 +cotx072 comparetotal 0.0 -1.0 -> 1 +cotx073 comparetotal 0.0 0.0 -> 0 +cotx074 comparetotal 0.0 1.0 -> -1 +cotx075 comparetotal 0.0 2.0 -> -1 +cotx076 comparetotal 1.0 -2.0 -> 1 +cotx077 comparetotal 1.0 -1.0 -> 1 +cotx078 comparetotal 1.0 0.0 -> 1 +cotx079 comparetotal 1.0 1.0 -> 0 +cotx080 comparetotal 1.0 2.0 -> -1 +cotx081 comparetotal 2.0 -2.0 -> 1 +cotx082 comparetotal 2.0 -1.0 -> 1 +cotx083 comparetotal 2.0 0.0 -> 1 +cotx085 comparetotal 2.0 1.0 -> 1 +cotx086 comparetotal 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +maxexponent: 999999999 +minexponent: -999999999 +cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0 +cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1 +cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1 +cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0 + +-- Examples +cotx094 comparetotal 12.73 127.9 -> -1 +cotx095 comparetotal -127 12 -> -1 +cotx096 comparetotal 12.30 12.3 -> -1 +cotx097 comparetotal 12.30 12.30 -> 0 +cotx098 comparetotal 12.3 12.300 -> 1 +cotx099 comparetotal 12.3 NaN -> -1 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +cotx100 comparetotal 7.0 7.0 -> 0 +cotx101 comparetotal 7.0 7 -> -1 +cotx102 comparetotal 7 7.0 -> 1 +cotx103 comparetotal 7E+0 7.0 -> 1 +cotx104 comparetotal 70E-1 7.0 -> 0 +cotx105 comparetotal 0.7E+1 7 -> 0 +cotx106 comparetotal 70E-1 7 -> -1 +cotx107 comparetotal 7.0 7E+0 -> -1 +cotx108 comparetotal 7.0 70E-1 -> 0 +cotx109 comparetotal 7 0.7E+1 -> 0 +cotx110 comparetotal 7 70E-1 -> 1 + +cotx120 comparetotal 8.0 7.0 -> 1 +cotx121 comparetotal 8.0 7 -> 1 +cotx122 comparetotal 8 7.0 -> 1 +cotx123 comparetotal 8E+0 7.0 -> 1 +cotx124 comparetotal 80E-1 7.0 -> 1 +cotx125 comparetotal 0.8E+1 7 -> 1 +cotx126 comparetotal 80E-1 7 -> 1 +cotx127 comparetotal 8.0 7E+0 -> 1 +cotx128 comparetotal 8.0 70E-1 -> 1 +cotx129 comparetotal 8 0.7E+1 -> 1 +cotx130 comparetotal 8 70E-1 -> 1 + +cotx140 comparetotal 8.0 9.0 -> -1 +cotx141 comparetotal 8.0 9 -> -1 +cotx142 comparetotal 8 9.0 -> -1 +cotx143 comparetotal 8E+0 9.0 -> -1 +cotx144 comparetotal 80E-1 9.0 -> -1 +cotx145 comparetotal 0.8E+1 9 -> -1 +cotx146 comparetotal 80E-1 9 -> -1 +cotx147 comparetotal 8.0 9E+0 -> -1 +cotx148 comparetotal 8.0 90E-1 -> -1 +cotx149 comparetotal 8 0.9E+1 -> -1 +cotx150 comparetotal 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +cotx200 comparetotal -7.0 7.0 -> -1 +cotx201 comparetotal -7.0 7 -> -1 +cotx202 comparetotal -7 7.0 -> -1 +cotx203 comparetotal -7E+0 7.0 -> -1 +cotx204 comparetotal -70E-1 7.0 -> -1 +cotx205 comparetotal -0.7E+1 7 -> -1 +cotx206 comparetotal -70E-1 7 -> -1 +cotx207 comparetotal -7.0 7E+0 -> -1 +cotx208 comparetotal -7.0 70E-1 -> -1 +cotx209 comparetotal -7 0.7E+1 -> -1 +cotx210 comparetotal -7 70E-1 -> -1 + +cotx220 comparetotal -8.0 7.0 -> -1 +cotx221 comparetotal -8.0 7 -> -1 +cotx222 comparetotal -8 7.0 -> -1 +cotx223 comparetotal -8E+0 7.0 -> -1 +cotx224 comparetotal -80E-1 7.0 -> -1 +cotx225 comparetotal -0.8E+1 7 -> -1 +cotx226 comparetotal -80E-1 7 -> -1 +cotx227 comparetotal -8.0 7E+0 -> -1 +cotx228 comparetotal -8.0 70E-1 -> -1 +cotx229 comparetotal -8 0.7E+1 -> -1 +cotx230 comparetotal -8 70E-1 -> -1 + +cotx240 comparetotal -8.0 9.0 -> -1 +cotx241 comparetotal -8.0 9 -> -1 +cotx242 comparetotal -8 9.0 -> -1 +cotx243 comparetotal -8E+0 9.0 -> -1 +cotx244 comparetotal -80E-1 9.0 -> -1 +cotx245 comparetotal -0.8E+1 9 -> -1 +cotx246 comparetotal -80E-1 9 -> -1 +cotx247 comparetotal -8.0 9E+0 -> -1 +cotx248 comparetotal -8.0 90E-1 -> -1 +cotx249 comparetotal -8 0.9E+1 -> -1 +cotx250 comparetotal -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +cotx300 comparetotal 7.0 -7.0 -> 1 +cotx301 comparetotal 7.0 -7 -> 1 +cotx302 comparetotal 7 -7.0 -> 1 +cotx303 comparetotal 7E+0 -7.0 -> 1 +cotx304 comparetotal 70E-1 -7.0 -> 1 +cotx305 comparetotal .7E+1 -7 -> 1 +cotx306 comparetotal 70E-1 -7 -> 1 +cotx307 comparetotal 7.0 -7E+0 -> 1 +cotx308 comparetotal 7.0 -70E-1 -> 1 +cotx309 comparetotal 7 -.7E+1 -> 1 +cotx310 comparetotal 7 -70E-1 -> 1 + +cotx320 comparetotal 8.0 -7.0 -> 1 +cotx321 comparetotal 8.0 -7 -> 1 +cotx322 comparetotal 8 -7.0 -> 1 +cotx323 comparetotal 8E+0 -7.0 -> 1 +cotx324 comparetotal 80E-1 -7.0 -> 1 +cotx325 comparetotal .8E+1 -7 -> 1 +cotx326 comparetotal 80E-1 -7 -> 1 +cotx327 comparetotal 8.0 -7E+0 -> 1 +cotx328 comparetotal 8.0 -70E-1 -> 1 +cotx329 comparetotal 8 -.7E+1 -> 1 +cotx330 comparetotal 8 -70E-1 -> 1 + +cotx340 comparetotal 8.0 -9.0 -> 1 +cotx341 comparetotal 8.0 -9 -> 1 +cotx342 comparetotal 8 -9.0 -> 1 +cotx343 comparetotal 8E+0 -9.0 -> 1 +cotx344 comparetotal 80E-1 -9.0 -> 1 +cotx345 comparetotal .8E+1 -9 -> 1 +cotx346 comparetotal 80E-1 -9 -> 1 +cotx347 comparetotal 8.0 -9E+0 -> 1 +cotx348 comparetotal 8.0 -90E-1 -> 1 +cotx349 comparetotal 8 -.9E+1 -> 1 +cotx350 comparetotal 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +cotx400 comparetotal -7.0 -7.0 -> 0 +cotx401 comparetotal -7.0 -7 -> 1 +cotx402 comparetotal -7 -7.0 -> -1 +cotx403 comparetotal -7E+0 -7.0 -> -1 +cotx404 comparetotal -70E-1 -7.0 -> 0 +cotx405 comparetotal -.7E+1 -7 -> 0 +cotx406 comparetotal -70E-1 -7 -> 1 +cotx407 comparetotal -7.0 -7E+0 -> 1 +cotx408 comparetotal -7.0 -70E-1 -> 0 +cotx409 comparetotal -7 -.7E+1 -> 0 +cotx410 comparetotal -7 -70E-1 -> -1 + +cotx420 comparetotal -8.0 -7.0 -> -1 +cotx421 comparetotal -8.0 -7 -> -1 +cotx422 comparetotal -8 -7.0 -> -1 +cotx423 comparetotal -8E+0 -7.0 -> -1 +cotx424 comparetotal -80E-1 -7.0 -> -1 +cotx425 comparetotal -.8E+1 -7 -> -1 +cotx426 comparetotal -80E-1 -7 -> -1 +cotx427 comparetotal -8.0 -7E+0 -> -1 +cotx428 comparetotal -8.0 -70E-1 -> -1 +cotx429 comparetotal -8 -.7E+1 -> -1 +cotx430 comparetotal -8 -70E-1 -> -1 + +cotx440 comparetotal -8.0 -9.0 -> 1 +cotx441 comparetotal -8.0 -9 -> 1 +cotx442 comparetotal -8 -9.0 -> 1 +cotx443 comparetotal -8E+0 -9.0 -> 1 +cotx444 comparetotal -80E-1 -9.0 -> 1 +cotx445 comparetotal -.8E+1 -9 -> 1 +cotx446 comparetotal -80E-1 -9 -> 1 +cotx447 comparetotal -8.0 -9E+0 -> 1 +cotx448 comparetotal -8.0 -90E-1 -> 1 +cotx449 comparetotal -8 -.9E+1 -> 1 +cotx450 comparetotal -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +precision: 40 +cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1 +cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1 +cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1 +cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1 +cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1 +cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1 +cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1 +cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1 +cotx478 comparetotal 123.45600000E789 123.456E789 -> -1 +cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1 +cotx480 comparetotal 123.456000E789 123.456E789 -> -1 +cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1 +cotx482 comparetotal 123.4560E789 123.456E789 -> -1 +cotx483 comparetotal 123.456E-89 123.456E-89 -> 0 +cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1 +cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1 +cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1 +cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1 +cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1 +cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1 +cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1 +cotx491 comparetotal 123.456E789 123.456000000E789 -> 1 +cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1 +cotx493 comparetotal 123.456E789 123.4560000E789 -> 1 +cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1 +cotx495 comparetotal 123.456E789 123.45600E789 -> 1 +cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1 +cotx497 comparetotal 123.456E789 123.456E789 -> 0 + +-- wide-ranging, around precision; signs equal +precision: 9 +cotx500 comparetotal 1 1E-15 -> 1 +cotx501 comparetotal 1 1E-14 -> 1 +cotx502 comparetotal 1 1E-13 -> 1 +cotx503 comparetotal 1 1E-12 -> 1 +cotx504 comparetotal 1 1E-11 -> 1 +cotx505 comparetotal 1 1E-10 -> 1 +cotx506 comparetotal 1 1E-9 -> 1 +cotx507 comparetotal 1 1E-8 -> 1 +cotx508 comparetotal 1 1E-7 -> 1 +cotx509 comparetotal 1 1E-6 -> 1 +cotx510 comparetotal 1 1E-5 -> 1 +cotx511 comparetotal 1 1E-4 -> 1 +cotx512 comparetotal 1 1E-3 -> 1 +cotx513 comparetotal 1 1E-2 -> 1 +cotx514 comparetotal 1 1E-1 -> 1 +cotx515 comparetotal 1 1E-0 -> 0 +cotx516 comparetotal 1 1E+1 -> -1 +cotx517 comparetotal 1 1E+2 -> -1 +cotx518 comparetotal 1 1E+3 -> -1 +cotx519 comparetotal 1 1E+4 -> -1 +cotx521 comparetotal 1 1E+5 -> -1 +cotx522 comparetotal 1 1E+6 -> -1 +cotx523 comparetotal 1 1E+7 -> -1 +cotx524 comparetotal 1 1E+8 -> -1 +cotx525 comparetotal 1 1E+9 -> -1 +cotx526 comparetotal 1 1E+10 -> -1 +cotx527 comparetotal 1 1E+11 -> -1 +cotx528 comparetotal 1 1E+12 -> -1 +cotx529 comparetotal 1 1E+13 -> -1 +cotx530 comparetotal 1 1E+14 -> -1 +cotx531 comparetotal 1 1E+15 -> -1 +-- LR swap +cotx540 comparetotal 1E-15 1 -> -1 +cotx541 comparetotal 1E-14 1 -> -1 +cotx542 comparetotal 1E-13 1 -> -1 +cotx543 comparetotal 1E-12 1 -> -1 +cotx544 comparetotal 1E-11 1 -> -1 +cotx545 comparetotal 1E-10 1 -> -1 +cotx546 comparetotal 1E-9 1 -> -1 +cotx547 comparetotal 1E-8 1 -> -1 +cotx548 comparetotal 1E-7 1 -> -1 +cotx549 comparetotal 1E-6 1 -> -1 +cotx550 comparetotal 1E-5 1 -> -1 +cotx551 comparetotal 1E-4 1 -> -1 +cotx552 comparetotal 1E-3 1 -> -1 +cotx553 comparetotal 1E-2 1 -> -1 +cotx554 comparetotal 1E-1 1 -> -1 +cotx555 comparetotal 1E-0 1 -> 0 +cotx556 comparetotal 1E+1 1 -> 1 +cotx557 comparetotal 1E+2 1 -> 1 +cotx558 comparetotal 1E+3 1 -> 1 +cotx559 comparetotal 1E+4 1 -> 1 +cotx561 comparetotal 1E+5 1 -> 1 +cotx562 comparetotal 1E+6 1 -> 1 +cotx563 comparetotal 1E+7 1 -> 1 +cotx564 comparetotal 1E+8 1 -> 1 +cotx565 comparetotal 1E+9 1 -> 1 +cotx566 comparetotal 1E+10 1 -> 1 +cotx567 comparetotal 1E+11 1 -> 1 +cotx568 comparetotal 1E+12 1 -> 1 +cotx569 comparetotal 1E+13 1 -> 1 +cotx570 comparetotal 1E+14 1 -> 1 +cotx571 comparetotal 1E+15 1 -> 1 +-- similar with an useful coefficient, one side only +cotx580 comparetotal 0.000000987654321 1E-15 -> 1 +cotx581 comparetotal 0.000000987654321 1E-14 -> 1 +cotx582 comparetotal 0.000000987654321 1E-13 -> 1 +cotx583 comparetotal 0.000000987654321 1E-12 -> 1 +cotx584 comparetotal 0.000000987654321 1E-11 -> 1 +cotx585 comparetotal 0.000000987654321 1E-10 -> 1 +cotx586 comparetotal 0.000000987654321 1E-9 -> 1 +cotx587 comparetotal 0.000000987654321 1E-8 -> 1 +cotx588 comparetotal 0.000000987654321 1E-7 -> 1 +cotx589 comparetotal 0.000000987654321 1E-6 -> -1 +cotx590 comparetotal 0.000000987654321 1E-5 -> -1 +cotx591 comparetotal 0.000000987654321 1E-4 -> -1 +cotx592 comparetotal 0.000000987654321 1E-3 -> -1 +cotx593 comparetotal 0.000000987654321 1E-2 -> -1 +cotx594 comparetotal 0.000000987654321 1E-1 -> -1 +cotx595 comparetotal 0.000000987654321 1E-0 -> -1 +cotx596 comparetotal 0.000000987654321 1E+1 -> -1 +cotx597 comparetotal 0.000000987654321 1E+2 -> -1 +cotx598 comparetotal 0.000000987654321 1E+3 -> -1 +cotx599 comparetotal 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +precision: 20 +cotx600 comparetotal 12 12.2345 -> -1 +cotx601 comparetotal 12.0 12.2345 -> -1 +cotx602 comparetotal 12.00 12.2345 -> -1 +cotx603 comparetotal 12.000 12.2345 -> -1 +cotx604 comparetotal 12.0000 12.2345 -> -1 +cotx605 comparetotal 12.00000 12.2345 -> -1 +cotx606 comparetotal 12.000000 12.2345 -> -1 +cotx607 comparetotal 12.0000000 12.2345 -> -1 +cotx608 comparetotal 12.00000000 12.2345 -> -1 +cotx609 comparetotal 12.000000000 12.2345 -> -1 +cotx610 comparetotal 12.1234 12 -> 1 +cotx611 comparetotal 12.1234 12.0 -> 1 +cotx612 comparetotal 12.1234 12.00 -> 1 +cotx613 comparetotal 12.1234 12.000 -> 1 +cotx614 comparetotal 12.1234 12.0000 -> 1 +cotx615 comparetotal 12.1234 12.00000 -> 1 +cotx616 comparetotal 12.1234 12.000000 -> 1 +cotx617 comparetotal 12.1234 12.0000000 -> 1 +cotx618 comparetotal 12.1234 12.00000000 -> 1 +cotx619 comparetotal 12.1234 12.000000000 -> 1 +cotx620 comparetotal -12 -12.2345 -> 1 +cotx621 comparetotal -12.0 -12.2345 -> 1 +cotx622 comparetotal -12.00 -12.2345 -> 1 +cotx623 comparetotal -12.000 -12.2345 -> 1 +cotx624 comparetotal -12.0000 -12.2345 -> 1 +cotx625 comparetotal -12.00000 -12.2345 -> 1 +cotx626 comparetotal -12.000000 -12.2345 -> 1 +cotx627 comparetotal -12.0000000 -12.2345 -> 1 +cotx628 comparetotal -12.00000000 -12.2345 -> 1 +cotx629 comparetotal -12.000000000 -12.2345 -> 1 +cotx630 comparetotal -12.1234 -12 -> -1 +cotx631 comparetotal -12.1234 -12.0 -> -1 +cotx632 comparetotal -12.1234 -12.00 -> -1 +cotx633 comparetotal -12.1234 -12.000 -> -1 +cotx634 comparetotal -12.1234 -12.0000 -> -1 +cotx635 comparetotal -12.1234 -12.00000 -> -1 +cotx636 comparetotal -12.1234 -12.000000 -> -1 +cotx637 comparetotal -12.1234 -12.0000000 -> -1 +cotx638 comparetotal -12.1234 -12.00000000 -> -1 +cotx639 comparetotal -12.1234 -12.000000000 -> -1 +precision: 9 + +-- extended zeros +cotx640 comparetotal 0 0 -> 0 +cotx641 comparetotal 0 -0 -> 1 +cotx642 comparetotal 0 -0.0 -> 1 +cotx643 comparetotal 0 0.0 -> 1 +cotx644 comparetotal -0 0 -> -1 +cotx645 comparetotal -0 -0 -> 0 +cotx646 comparetotal -0 -0.0 -> -1 +cotx647 comparetotal -0 0.0 -> -1 +cotx648 comparetotal 0.0 0 -> -1 +cotx649 comparetotal 0.0 -0 -> 1 +cotx650 comparetotal 0.0 -0.0 -> 1 +cotx651 comparetotal 0.0 0.0 -> 0 +cotx652 comparetotal -0.0 0 -> -1 +cotx653 comparetotal -0.0 -0 -> 1 +cotx654 comparetotal -0.0 -0.0 -> 0 +cotx655 comparetotal -0.0 0.0 -> -1 + +cotx656 comparetotal -0E1 0.0 -> -1 +cotx657 comparetotal -0E2 0.0 -> -1 +cotx658 comparetotal 0E1 0.0 -> 1 +cotx659 comparetotal 0E2 0.0 -> 1 +cotx660 comparetotal -0E1 0 -> -1 +cotx661 comparetotal -0E2 0 -> -1 +cotx662 comparetotal 0E1 0 -> 1 +cotx663 comparetotal 0E2 0 -> 1 +cotx664 comparetotal -0E1 -0E1 -> 0 +cotx665 comparetotal -0E2 -0E1 -> -1 +cotx666 comparetotal 0E1 -0E1 -> 1 +cotx667 comparetotal 0E2 -0E1 -> 1 +cotx668 comparetotal -0E1 -0E2 -> 1 +cotx669 comparetotal -0E2 -0E2 -> 0 +cotx670 comparetotal 0E1 -0E2 -> 1 +cotx671 comparetotal 0E2 -0E2 -> 1 +cotx672 comparetotal -0E1 0E1 -> -1 +cotx673 comparetotal -0E2 0E1 -> -1 +cotx674 comparetotal 0E1 0E1 -> 0 +cotx675 comparetotal 0E2 0E1 -> 1 +cotx676 comparetotal -0E1 0E2 -> -1 +cotx677 comparetotal -0E2 0E2 -> -1 +cotx678 comparetotal 0E1 0E2 -> -1 +cotx679 comparetotal 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +precision: 20 +cotx680 comparetotal 12 12 -> 0 +cotx681 comparetotal 12 12.0 -> 1 +cotx682 comparetotal 12 12.00 -> 1 +cotx683 comparetotal 12 12.000 -> 1 +cotx684 comparetotal 12 12.0000 -> 1 +cotx685 comparetotal 12 12.00000 -> 1 +cotx686 comparetotal 12 12.000000 -> 1 +cotx687 comparetotal 12 12.0000000 -> 1 +cotx688 comparetotal 12 12.00000000 -> 1 +cotx689 comparetotal 12 12.000000000 -> 1 +cotx690 comparetotal 12 12 -> 0 +cotx691 comparetotal 12.0 12 -> -1 +cotx692 comparetotal 12.00 12 -> -1 +cotx693 comparetotal 12.000 12 -> -1 +cotx694 comparetotal 12.0000 12 -> -1 +cotx695 comparetotal 12.00000 12 -> -1 +cotx696 comparetotal 12.000000 12 -> -1 +cotx697 comparetotal 12.0000000 12 -> -1 +cotx698 comparetotal 12.00000000 12 -> -1 +cotx699 comparetotal 12.000000000 12 -> -1 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +cotx701 comparetotal 12345678000 1 -> 1 +cotx702 comparetotal 1 12345678000 -> -1 +cotx703 comparetotal 1234567800 1 -> 1 +cotx704 comparetotal 1 1234567800 -> -1 +cotx705 comparetotal 1234567890 1 -> 1 +cotx706 comparetotal 1 1234567890 -> -1 +cotx707 comparetotal 1234567891 1 -> 1 +cotx708 comparetotal 1 1234567891 -> -1 +cotx709 comparetotal 12345678901 1 -> 1 +cotx710 comparetotal 1 12345678901 -> -1 +cotx711 comparetotal 1234567896 1 -> 1 +cotx712 comparetotal 1 1234567896 -> -1 +cotx713 comparetotal -1234567891 1 -> -1 +cotx714 comparetotal 1 -1234567891 -> 1 +cotx715 comparetotal -12345678901 1 -> -1 +cotx716 comparetotal 1 -12345678901 -> 1 +cotx717 comparetotal -1234567896 1 -> -1 +cotx718 comparetotal 1 -1234567896 -> 1 + +precision: 15 +-- same with plenty of precision +cotx721 comparetotal 12345678000 1 -> 1 +cotx722 comparetotal 1 12345678000 -> -1 +cotx723 comparetotal 1234567800 1 -> 1 +cotx724 comparetotal 1 1234567800 -> -1 +cotx725 comparetotal 1234567890 1 -> 1 +cotx726 comparetotal 1 1234567890 -> -1 +cotx727 comparetotal 1234567891 1 -> 1 +cotx728 comparetotal 1 1234567891 -> -1 +cotx729 comparetotal 12345678901 1 -> 1 +cotx730 comparetotal 1 12345678901 -> -1 +cotx731 comparetotal 1234567896 1 -> 1 +cotx732 comparetotal 1 1234567896 -> -1 + +-- residue cases +precision: 5 +cotx740 comparetotal 1 0.9999999 -> 1 +cotx741 comparetotal 1 0.999999 -> 1 +cotx742 comparetotal 1 0.99999 -> 1 +cotx743 comparetotal 1 1.0000 -> 1 +cotx744 comparetotal 1 1.00001 -> -1 +cotx745 comparetotal 1 1.000001 -> -1 +cotx746 comparetotal 1 1.0000001 -> -1 +cotx750 comparetotal 0.9999999 1 -> -1 +cotx751 comparetotal 0.999999 1 -> -1 +cotx752 comparetotal 0.99999 1 -> -1 +cotx753 comparetotal 1.0000 1 -> -1 +cotx754 comparetotal 1.00001 1 -> 1 +cotx755 comparetotal 1.000001 1 -> 1 +cotx756 comparetotal 1.0000001 1 -> 1 + +-- a selection of longies +cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1 +cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0 +cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1 +cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +-- precisions above or below the difference should have no effect +precision: 11 +cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 10 +cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 9 +cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 8 +cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 7 +cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 6 +cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 5 +cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 4 +cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 3 +cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 2 +cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 1 +cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 + +-- Specials +precision: 9 +cotx780 comparetotal Inf -Inf -> 1 +cotx781 comparetotal Inf -1000 -> 1 +cotx782 comparetotal Inf -1 -> 1 +cotx783 comparetotal Inf -0 -> 1 +cotx784 comparetotal Inf 0 -> 1 +cotx785 comparetotal Inf 1 -> 1 +cotx786 comparetotal Inf 1000 -> 1 +cotx787 comparetotal Inf Inf -> 0 +cotx788 comparetotal -1000 Inf -> -1 +cotx789 comparetotal -Inf Inf -> -1 +cotx790 comparetotal -1 Inf -> -1 +cotx791 comparetotal -0 Inf -> -1 +cotx792 comparetotal 0 Inf -> -1 +cotx793 comparetotal 1 Inf -> -1 +cotx794 comparetotal 1000 Inf -> -1 +cotx795 comparetotal Inf Inf -> 0 + +cotx800 comparetotal -Inf -Inf -> 0 +cotx801 comparetotal -Inf -1000 -> -1 +cotx802 comparetotal -Inf -1 -> -1 +cotx803 comparetotal -Inf -0 -> -1 +cotx804 comparetotal -Inf 0 -> -1 +cotx805 comparetotal -Inf 1 -> -1 +cotx806 comparetotal -Inf 1000 -> -1 +cotx807 comparetotal -Inf Inf -> -1 +cotx808 comparetotal -Inf -Inf -> 0 +cotx809 comparetotal -1000 -Inf -> 1 +cotx810 comparetotal -1 -Inf -> 1 +cotx811 comparetotal -0 -Inf -> 1 +cotx812 comparetotal 0 -Inf -> 1 +cotx813 comparetotal 1 -Inf -> 1 +cotx814 comparetotal 1000 -Inf -> 1 +cotx815 comparetotal Inf -Inf -> 1 + +cotx821 comparetotal NaN -Inf -> 1 +cotx822 comparetotal NaN -1000 -> 1 +cotx823 comparetotal NaN -1 -> 1 +cotx824 comparetotal NaN -0 -> 1 +cotx825 comparetotal NaN 0 -> 1 +cotx826 comparetotal NaN 1 -> 1 +cotx827 comparetotal NaN 1000 -> 1 +cotx828 comparetotal NaN Inf -> 1 +cotx829 comparetotal NaN NaN -> 0 +cotx830 comparetotal -Inf NaN -> -1 +cotx831 comparetotal -1000 NaN -> -1 +cotx832 comparetotal -1 NaN -> -1 +cotx833 comparetotal -0 NaN -> -1 +cotx834 comparetotal 0 NaN -> -1 +cotx835 comparetotal 1 NaN -> -1 +cotx836 comparetotal 1000 NaN -> -1 +cotx837 comparetotal Inf NaN -> -1 +cotx838 comparetotal -NaN -NaN -> 0 +cotx839 comparetotal +NaN -NaN -> 1 +cotx840 comparetotal -NaN +NaN -> -1 + +cotx841 comparetotal sNaN -sNaN -> 1 +cotx842 comparetotal sNaN -NaN -> 1 +cotx843 comparetotal sNaN -Inf -> 1 +cotx844 comparetotal sNaN -1000 -> 1 +cotx845 comparetotal sNaN -1 -> 1 +cotx846 comparetotal sNaN -0 -> 1 +cotx847 comparetotal sNaN 0 -> 1 +cotx848 comparetotal sNaN 1 -> 1 +cotx849 comparetotal sNaN 1000 -> 1 +cotx850 comparetotal sNaN NaN -> -1 +cotx851 comparetotal sNaN sNaN -> 0 + +cotx852 comparetotal -sNaN sNaN -> -1 +cotx853 comparetotal -NaN sNaN -> -1 +cotx854 comparetotal -Inf sNaN -> -1 +cotx855 comparetotal -1000 sNaN -> -1 +cotx856 comparetotal -1 sNaN -> -1 +cotx857 comparetotal -0 sNaN -> -1 +cotx858 comparetotal 0 sNaN -> -1 +cotx859 comparetotal 1 sNaN -> -1 +cotx860 comparetotal 1000 sNaN -> -1 +cotx861 comparetotal Inf sNaN -> -1 +cotx862 comparetotal NaN sNaN -> 1 +cotx863 comparetotal sNaN sNaN -> 0 + +cotx871 comparetotal -sNaN -sNaN -> 0 +cotx872 comparetotal -sNaN -NaN -> 1 +cotx873 comparetotal -sNaN -Inf -> -1 +cotx874 comparetotal -sNaN -1000 -> -1 +cotx875 comparetotal -sNaN -1 -> -1 +cotx876 comparetotal -sNaN -0 -> -1 +cotx877 comparetotal -sNaN 0 -> -1 +cotx878 comparetotal -sNaN 1 -> -1 +cotx879 comparetotal -sNaN 1000 -> -1 +cotx880 comparetotal -sNaN NaN -> -1 +cotx881 comparetotal -sNaN sNaN -> -1 + +cotx882 comparetotal -sNaN -sNaN -> 0 +cotx883 comparetotal -NaN -sNaN -> -1 +cotx884 comparetotal -Inf -sNaN -> 1 +cotx885 comparetotal -1000 -sNaN -> 1 +cotx886 comparetotal -1 -sNaN -> 1 +cotx887 comparetotal -0 -sNaN -> 1 +cotx888 comparetotal 0 -sNaN -> 1 +cotx889 comparetotal 1 -sNaN -> 1 +cotx890 comparetotal 1000 -sNaN -> 1 +cotx891 comparetotal Inf -sNaN -> 1 +cotx892 comparetotal NaN -sNaN -> 1 +cotx893 comparetotal sNaN -sNaN -> 1 + +-- NaNs with payload +cotx960 comparetotal NaN9 -Inf -> 1 +cotx961 comparetotal NaN8 999 -> 1 +cotx962 comparetotal NaN77 Inf -> 1 +cotx963 comparetotal -NaN67 NaN5 -> -1 +cotx964 comparetotal -Inf -NaN4 -> 1 +cotx965 comparetotal -999 -NaN33 -> 1 +cotx966 comparetotal Inf NaN2 -> -1 + +cotx970 comparetotal -NaN41 -NaN42 -> 1 +cotx971 comparetotal +NaN41 -NaN42 -> 1 +cotx972 comparetotal -NaN41 +NaN42 -> -1 +cotx973 comparetotal +NaN41 +NaN42 -> -1 +cotx974 comparetotal -NaN42 -NaN01 -> -1 +cotx975 comparetotal +NaN42 -NaN01 -> 1 +cotx976 comparetotal -NaN42 +NaN01 -> -1 +cotx977 comparetotal +NaN42 +NaN01 -> 1 + +cotx980 comparetotal -sNaN771 -sNaN772 -> 1 +cotx981 comparetotal +sNaN771 -sNaN772 -> 1 +cotx982 comparetotal -sNaN771 +sNaN772 -> -1 +cotx983 comparetotal +sNaN771 +sNaN772 -> -1 +cotx984 comparetotal -sNaN772 -sNaN771 -> -1 +cotx985 comparetotal +sNaN772 -sNaN771 -> 1 +cotx986 comparetotal -sNaN772 +sNaN771 -> -1 +cotx987 comparetotal +sNaN772 +sNaN771 -> 1 + +cotx991 comparetotal -sNaN99 -Inf -> -1 +cotx992 comparetotal sNaN98 -11 -> 1 +cotx993 comparetotal sNaN97 NaN -> -1 +cotx994 comparetotal sNaN16 sNaN94 -> -1 +cotx995 comparetotal NaN85 sNaN83 -> 1 +cotx996 comparetotal -Inf sNaN92 -> -1 +cotx997 comparetotal 088 sNaN81 -> -1 +cotx998 comparetotal Inf sNaN90 -> -1 +cotx999 comparetotal NaN -sNaN89 -> 1 + +-- overflow and underflow tests .. subnormal results now allowed +maxExponent: 999999999 +minexponent: -999999999 +cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1 +cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1 +cotx1082 comparetotal +0.100 9E-999999999 -> 1 +cotx1083 comparetotal 9E-999999999 +0.100 -> -1 +cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1 +cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1 +cotx1087 comparetotal -0.100 9E-999999999 -> -1 +cotx1088 comparetotal 9E-999999999 -0.100 -> 1 + +cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1 +cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1 +cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1 +cotx1092 comparetotal 9e-999999998 0.01 -> -1 +cotx1093 comparetotal 9e-999999998 0.1 -> -1 +cotx1094 comparetotal 0.01 9e-999999998 -> 1 +cotx1095 comparetotal 1e599999999 1e400000001 -> 1 +cotx1096 comparetotal 1e599999999 1e400000000 -> 1 +cotx1097 comparetotal 1e600000000 1e400000000 -> 1 +cotx1098 comparetotal 9e999999998 100 -> 1 +cotx1099 comparetotal 9e999999998 10 -> 1 +cotx1100 comparetotal 100 9e999999998 -> -1 +-- signs +cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1 +cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1 +cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1 +cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1 +cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1 +cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1 +cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1 +cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1 + +-- spread zeros +cotx1110 comparetotal 0E-383 0 -> -1 +cotx1111 comparetotal 0E-383 -0 -> 1 +cotx1112 comparetotal -0E-383 0 -> -1 +cotx1113 comparetotal -0E-383 -0 -> 1 +cotx1114 comparetotal 0E-383 0E+384 -> -1 +cotx1115 comparetotal 0E-383 -0E+384 -> 1 +cotx1116 comparetotal -0E-383 0E+384 -> -1 +cotx1117 comparetotal -0E-383 -0E+384 -> 1 +cotx1118 comparetotal 0 0E+384 -> -1 +cotx1119 comparetotal 0 -0E+384 -> 1 +cotx1120 comparetotal -0 0E+384 -> -1 +cotx1121 comparetotal -0 -0E+384 -> 1 + +cotx1130 comparetotal 0E+384 0 -> 1 +cotx1131 comparetotal 0E+384 -0 -> 1 +cotx1132 comparetotal -0E+384 0 -> -1 +cotx1133 comparetotal -0E+384 -0 -> -1 +cotx1134 comparetotal 0E+384 0E-383 -> 1 +cotx1135 comparetotal 0E+384 -0E-383 -> 1 +cotx1136 comparetotal -0E+384 0E-383 -> -1 +cotx1137 comparetotal -0E+384 -0E-383 -> -1 +cotx1138 comparetotal 0 0E-383 -> 1 +cotx1139 comparetotal 0 -0E-383 -> 1 +cotx1140 comparetotal -0 0E-383 -> -1 +cotx1141 comparetotal -0 -0E-383 -> -1 + +-- Null tests +cotx9990 comparetotal 10 # -> NaN Invalid_operation +cotx9991 comparetotal # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/comparetotmag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/comparetotmag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,790 @@ +------------------------------------------------------------------------ +-- comparetotmag.decTest -- decimal comparison, abs. total ordering -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that it cannot be assumed that add/subtract tests cover paths +-- for this operation adequately, here, because the code might be +-- quite different (comparison cannot overflow or underflow, so +-- actual subtractions are not necessary). Similarly, comparetotal +-- will have some radically different paths than compare. + +extended: 1 +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +-- sanity checks +ctmx001 comparetotmag -2 -2 -> 0 +ctmx002 comparetotmag -2 -1 -> 1 +ctmx003 comparetotmag -2 0 -> 1 +ctmx004 comparetotmag -2 1 -> 1 +ctmx005 comparetotmag -2 2 -> 0 +ctmx006 comparetotmag -1 -2 -> -1 +ctmx007 comparetotmag -1 -1 -> 0 +ctmx008 comparetotmag -1 0 -> 1 +ctmx009 comparetotmag -1 1 -> 0 +ctmx010 comparetotmag -1 2 -> -1 +ctmx011 comparetotmag 0 -2 -> -1 +ctmx012 comparetotmag 0 -1 -> -1 +ctmx013 comparetotmag 0 0 -> 0 +ctmx014 comparetotmag 0 1 -> -1 +ctmx015 comparetotmag 0 2 -> -1 +ctmx016 comparetotmag 1 -2 -> -1 +ctmx017 comparetotmag 1 -1 -> 0 +ctmx018 comparetotmag 1 0 -> 1 +ctmx019 comparetotmag 1 1 -> 0 +ctmx020 comparetotmag 1 2 -> -1 +ctmx021 comparetotmag 2 -2 -> 0 +ctmx022 comparetotmag 2 -1 -> 1 +ctmx023 comparetotmag 2 0 -> 1 +ctmx025 comparetotmag 2 1 -> 1 +ctmx026 comparetotmag 2 2 -> 0 + +ctmx031 comparetotmag -20 -20 -> 0 +ctmx032 comparetotmag -20 -10 -> 1 +ctmx033 comparetotmag -20 00 -> 1 +ctmx034 comparetotmag -20 10 -> 1 +ctmx035 comparetotmag -20 20 -> 0 +ctmx036 comparetotmag -10 -20 -> -1 +ctmx037 comparetotmag -10 -10 -> 0 +ctmx038 comparetotmag -10 00 -> 1 +ctmx039 comparetotmag -10 10 -> 0 +ctmx040 comparetotmag -10 20 -> -1 +ctmx041 comparetotmag 00 -20 -> -1 +ctmx042 comparetotmag 00 -10 -> -1 +ctmx043 comparetotmag 00 00 -> 0 +ctmx044 comparetotmag 00 10 -> -1 +ctmx045 comparetotmag 00 20 -> -1 +ctmx046 comparetotmag 10 -20 -> -1 +ctmx047 comparetotmag 10 -10 -> 0 +ctmx048 comparetotmag 10 00 -> 1 +ctmx049 comparetotmag 10 10 -> 0 +ctmx050 comparetotmag 10 20 -> -1 +ctmx051 comparetotmag 20 -20 -> 0 +ctmx052 comparetotmag 20 -10 -> 1 +ctmx053 comparetotmag 20 00 -> 1 +ctmx055 comparetotmag 20 10 -> 1 +ctmx056 comparetotmag 20 20 -> 0 + +ctmx061 comparetotmag -2.0 -2.0 -> 0 +ctmx062 comparetotmag -2.0 -1.0 -> 1 +ctmx063 comparetotmag -2.0 0.0 -> 1 +ctmx064 comparetotmag -2.0 1.0 -> 1 +ctmx065 comparetotmag -2.0 2.0 -> 0 +ctmx066 comparetotmag -1.0 -2.0 -> -1 +ctmx067 comparetotmag -1.0 -1.0 -> 0 +ctmx068 comparetotmag -1.0 0.0 -> 1 +ctmx069 comparetotmag -1.0 1.0 -> 0 +ctmx070 comparetotmag -1.0 2.0 -> -1 +ctmx071 comparetotmag 0.0 -2.0 -> -1 +ctmx072 comparetotmag 0.0 -1.0 -> -1 +ctmx073 comparetotmag 0.0 0.0 -> 0 +ctmx074 comparetotmag 0.0 1.0 -> -1 +ctmx075 comparetotmag 0.0 2.0 -> -1 +ctmx076 comparetotmag 1.0 -2.0 -> -1 +ctmx077 comparetotmag 1.0 -1.0 -> 0 +ctmx078 comparetotmag 1.0 0.0 -> 1 +ctmx079 comparetotmag 1.0 1.0 -> 0 +ctmx080 comparetotmag 1.0 2.0 -> -1 +ctmx081 comparetotmag 2.0 -2.0 -> 0 +ctmx082 comparetotmag 2.0 -1.0 -> 1 +ctmx083 comparetotmag 2.0 0.0 -> 1 +ctmx085 comparetotmag 2.0 1.0 -> 1 +ctmx086 comparetotmag 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +maxexponent: 999999999 +minexponent: -999999999 +ctmx090 comparetotmag 9.99999999E+999999999 9.99999999E+999999999 -> 0 +ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999 -> 0 +ctmx092 comparetotmag 9.99999999E+999999999 -9.99999999E+999999999 -> 0 +ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999 -> 0 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +ctmx100 comparetotmag 7.0 7.0 -> 0 +ctmx101 comparetotmag 7.0 7 -> -1 +ctmx102 comparetotmag 7 7.0 -> 1 +ctmx103 comparetotmag 7E+0 7.0 -> 1 +ctmx104 comparetotmag 70E-1 7.0 -> 0 +ctmx105 comparetotmag 0.7E+1 7 -> 0 +ctmx106 comparetotmag 70E-1 7 -> -1 +ctmx107 comparetotmag 7.0 7E+0 -> -1 +ctmx108 comparetotmag 7.0 70E-1 -> 0 +ctmx109 comparetotmag 7 0.7E+1 -> 0 +ctmx110 comparetotmag 7 70E-1 -> 1 + +ctmx120 comparetotmag 8.0 7.0 -> 1 +ctmx121 comparetotmag 8.0 7 -> 1 +ctmx122 comparetotmag 8 7.0 -> 1 +ctmx123 comparetotmag 8E+0 7.0 -> 1 +ctmx124 comparetotmag 80E-1 7.0 -> 1 +ctmx125 comparetotmag 0.8E+1 7 -> 1 +ctmx126 comparetotmag 80E-1 7 -> 1 +ctmx127 comparetotmag 8.0 7E+0 -> 1 +ctmx128 comparetotmag 8.0 70E-1 -> 1 +ctmx129 comparetotmag 8 0.7E+1 -> 1 +ctmx130 comparetotmag 8 70E-1 -> 1 + +ctmx140 comparetotmag 8.0 9.0 -> -1 +ctmx141 comparetotmag 8.0 9 -> -1 +ctmx142 comparetotmag 8 9.0 -> -1 +ctmx143 comparetotmag 8E+0 9.0 -> -1 +ctmx144 comparetotmag 80E-1 9.0 -> -1 +ctmx145 comparetotmag 0.8E+1 9 -> -1 +ctmx146 comparetotmag 80E-1 9 -> -1 +ctmx147 comparetotmag 8.0 9E+0 -> -1 +ctmx148 comparetotmag 8.0 90E-1 -> -1 +ctmx149 comparetotmag 8 0.9E+1 -> -1 +ctmx150 comparetotmag 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +ctmx200 comparetotmag -7.0 7.0 -> 0 +ctmx201 comparetotmag -7.0 7 -> -1 +ctmx202 comparetotmag -7 7.0 -> 1 +ctmx203 comparetotmag -7E+0 7.0 -> 1 +ctmx204 comparetotmag -70E-1 7.0 -> 0 +ctmx205 comparetotmag -0.7E+1 7 -> 0 +ctmx206 comparetotmag -70E-1 7 -> -1 +ctmx207 comparetotmag -7.0 7E+0 -> -1 +ctmx208 comparetotmag -7.0 70E-1 -> 0 +ctmx209 comparetotmag -7 0.7E+1 -> 0 +ctmx210 comparetotmag -7 70E-1 -> 1 + +ctmx220 comparetotmag -8.0 7.0 -> 1 +ctmx221 comparetotmag -8.0 7 -> 1 +ctmx222 comparetotmag -8 7.0 -> 1 +ctmx223 comparetotmag -8E+0 7.0 -> 1 +ctmx224 comparetotmag -80E-1 7.0 -> 1 +ctmx225 comparetotmag -0.8E+1 7 -> 1 +ctmx226 comparetotmag -80E-1 7 -> 1 +ctmx227 comparetotmag -8.0 7E+0 -> 1 +ctmx228 comparetotmag -8.0 70E-1 -> 1 +ctmx229 comparetotmag -8 0.7E+1 -> 1 +ctmx230 comparetotmag -8 70E-1 -> 1 + +ctmx240 comparetotmag -8.0 9.0 -> -1 +ctmx241 comparetotmag -8.0 9 -> -1 +ctmx242 comparetotmag -8 9.0 -> -1 +ctmx243 comparetotmag -8E+0 9.0 -> -1 +ctmx244 comparetotmag -80E-1 9.0 -> -1 +ctmx245 comparetotmag -0.8E+1 9 -> -1 +ctmx246 comparetotmag -80E-1 9 -> -1 +ctmx247 comparetotmag -8.0 9E+0 -> -1 +ctmx248 comparetotmag -8.0 90E-1 -> -1 +ctmx249 comparetotmag -8 0.9E+1 -> -1 +ctmx250 comparetotmag -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +ctmx300 comparetotmag 7.0 -7.0 -> 0 +ctmx301 comparetotmag 7.0 -7 -> -1 +ctmx302 comparetotmag 7 -7.0 -> 1 +ctmx303 comparetotmag 7E+0 -7.0 -> 1 +ctmx304 comparetotmag 70E-1 -7.0 -> 0 +ctmx305 comparetotmag .7E+1 -7 -> 0 +ctmx306 comparetotmag 70E-1 -7 -> -1 +ctmx307 comparetotmag 7.0 -7E+0 -> -1 +ctmx308 comparetotmag 7.0 -70E-1 -> 0 +ctmx309 comparetotmag 7 -.7E+1 -> 0 +ctmx310 comparetotmag 7 -70E-1 -> 1 + +ctmx320 comparetotmag 8.0 -7.0 -> 1 +ctmx321 comparetotmag 8.0 -7 -> 1 +ctmx322 comparetotmag 8 -7.0 -> 1 +ctmx323 comparetotmag 8E+0 -7.0 -> 1 +ctmx324 comparetotmag 80E-1 -7.0 -> 1 +ctmx325 comparetotmag .8E+1 -7 -> 1 +ctmx326 comparetotmag 80E-1 -7 -> 1 +ctmx327 comparetotmag 8.0 -7E+0 -> 1 +ctmx328 comparetotmag 8.0 -70E-1 -> 1 +ctmx329 comparetotmag 8 -.7E+1 -> 1 +ctmx330 comparetotmag 8 -70E-1 -> 1 + +ctmx340 comparetotmag 8.0 -9.0 -> -1 +ctmx341 comparetotmag 8.0 -9 -> -1 +ctmx342 comparetotmag 8 -9.0 -> -1 +ctmx343 comparetotmag 8E+0 -9.0 -> -1 +ctmx344 comparetotmag 80E-1 -9.0 -> -1 +ctmx345 comparetotmag .8E+1 -9 -> -1 +ctmx346 comparetotmag 80E-1 -9 -> -1 +ctmx347 comparetotmag 8.0 -9E+0 -> -1 +ctmx348 comparetotmag 8.0 -90E-1 -> -1 +ctmx349 comparetotmag 8 -.9E+1 -> -1 +ctmx350 comparetotmag 8 -90E-1 -> -1 + +-- and again, with sign changes -- .. +ctmx400 comparetotmag -7.0 -7.0 -> 0 +ctmx401 comparetotmag -7.0 -7 -> -1 +ctmx402 comparetotmag -7 -7.0 -> 1 +ctmx403 comparetotmag -7E+0 -7.0 -> 1 +ctmx404 comparetotmag -70E-1 -7.0 -> 0 +ctmx405 comparetotmag -.7E+1 -7 -> 0 +ctmx406 comparetotmag -70E-1 -7 -> -1 +ctmx407 comparetotmag -7.0 -7E+0 -> -1 +ctmx408 comparetotmag -7.0 -70E-1 -> 0 +ctmx409 comparetotmag -7 -.7E+1 -> 0 +ctmx410 comparetotmag -7 -70E-1 -> 1 + +ctmx420 comparetotmag -8.0 -7.0 -> 1 +ctmx421 comparetotmag -8.0 -7 -> 1 +ctmx422 comparetotmag -8 -7.0 -> 1 +ctmx423 comparetotmag -8E+0 -7.0 -> 1 +ctmx424 comparetotmag -80E-1 -7.0 -> 1 +ctmx425 comparetotmag -.8E+1 -7 -> 1 +ctmx426 comparetotmag -80E-1 -7 -> 1 +ctmx427 comparetotmag -8.0 -7E+0 -> 1 +ctmx428 comparetotmag -8.0 -70E-1 -> 1 +ctmx429 comparetotmag -8 -.7E+1 -> 1 +ctmx430 comparetotmag -8 -70E-1 -> 1 + +ctmx440 comparetotmag -8.0 -9.0 -> -1 +ctmx441 comparetotmag -8.0 -9 -> -1 +ctmx442 comparetotmag -8 -9.0 -> -1 +ctmx443 comparetotmag -8E+0 -9.0 -> -1 +ctmx444 comparetotmag -80E-1 -9.0 -> -1 +ctmx445 comparetotmag -.8E+1 -9 -> -1 +ctmx446 comparetotmag -80E-1 -9 -> -1 +ctmx447 comparetotmag -8.0 -9E+0 -> -1 +ctmx448 comparetotmag -8.0 -90E-1 -> -1 +ctmx449 comparetotmag -8 -.9E+1 -> -1 +ctmx450 comparetotmag -8 -90E-1 -> -1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +precision: 40 +ctmx470 comparetotmag 123.4560000000000000E789 123.456E789 -> -1 +ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89 -> -1 +ctmx472 comparetotmag 123.45600000000000E789 123.456E789 -> -1 +ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1 +ctmx474 comparetotmag 123.456000000000E789 123.456E789 -> -1 +ctmx475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1 +ctmx476 comparetotmag 123.4560000000E789 123.456E789 -> -1 +ctmx477 comparetotmag 123.456000000E-89 123.456E-89 -> -1 +ctmx478 comparetotmag 123.45600000E789 123.456E789 -> -1 +ctmx479 comparetotmag 123.4560000E-89 123.456E-89 -> -1 +ctmx480 comparetotmag 123.456000E789 123.456E789 -> -1 +ctmx481 comparetotmag 123.45600E-89 123.456E-89 -> -1 +ctmx482 comparetotmag 123.4560E789 123.456E789 -> -1 +ctmx483 comparetotmag 123.456E-89 123.456E-89 -> 0 +ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89 -> 1 +ctmx485 comparetotmag 123.456E789 123.456000000000000E789 -> 1 +ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89 -> 1 +ctmx487 comparetotmag 123.456E789 123.4560000000000E789 -> 1 +ctmx488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1 +ctmx489 comparetotmag 123.456E789 123.45600000000E789 -> 1 +ctmx490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1 +ctmx491 comparetotmag 123.456E789 123.456000000E789 -> 1 +ctmx492 comparetotmag 123.456E-89 123.45600000E-89 -> 1 +ctmx493 comparetotmag 123.456E789 123.4560000E789 -> 1 +ctmx494 comparetotmag 123.456E-89 123.456000E-89 -> 1 +ctmx495 comparetotmag 123.456E789 123.45600E789 -> 1 +ctmx496 comparetotmag 123.456E-89 123.4560E-89 -> 1 +ctmx497 comparetotmag 123.456E789 123.456E789 -> 0 + +-- wide-ranging, around precision; signs equal +precision: 9 +ctmx500 comparetotmag 1 1E-15 -> 1 +ctmx501 comparetotmag 1 1E-14 -> 1 +ctmx502 comparetotmag 1 1E-13 -> 1 +ctmx503 comparetotmag 1 1E-12 -> 1 +ctmx504 comparetotmag 1 1E-11 -> 1 +ctmx505 comparetotmag 1 1E-10 -> 1 +ctmx506 comparetotmag 1 1E-9 -> 1 +ctmx507 comparetotmag 1 1E-8 -> 1 +ctmx508 comparetotmag 1 1E-7 -> 1 +ctmx509 comparetotmag 1 1E-6 -> 1 +ctmx510 comparetotmag 1 1E-5 -> 1 +ctmx511 comparetotmag 1 1E-4 -> 1 +ctmx512 comparetotmag 1 1E-3 -> 1 +ctmx513 comparetotmag 1 1E-2 -> 1 +ctmx514 comparetotmag 1 1E-1 -> 1 +ctmx515 comparetotmag 1 1E-0 -> 0 +ctmx516 comparetotmag 1 1E+1 -> -1 +ctmx517 comparetotmag 1 1E+2 -> -1 +ctmx518 comparetotmag 1 1E+3 -> -1 +ctmx519 comparetotmag 1 1E+4 -> -1 +ctmx521 comparetotmag 1 1E+5 -> -1 +ctmx522 comparetotmag 1 1E+6 -> -1 +ctmx523 comparetotmag 1 1E+7 -> -1 +ctmx524 comparetotmag 1 1E+8 -> -1 +ctmx525 comparetotmag 1 1E+9 -> -1 +ctmx526 comparetotmag 1 1E+10 -> -1 +ctmx527 comparetotmag 1 1E+11 -> -1 +ctmx528 comparetotmag 1 1E+12 -> -1 +ctmx529 comparetotmag 1 1E+13 -> -1 +ctmx530 comparetotmag 1 1E+14 -> -1 +ctmx531 comparetotmag 1 1E+15 -> -1 +-- LR swap +ctmx540 comparetotmag 1E-15 1 -> -1 +ctmx541 comparetotmag 1E-14 1 -> -1 +ctmx542 comparetotmag 1E-13 1 -> -1 +ctmx543 comparetotmag 1E-12 1 -> -1 +ctmx544 comparetotmag 1E-11 1 -> -1 +ctmx545 comparetotmag 1E-10 1 -> -1 +ctmx546 comparetotmag 1E-9 1 -> -1 +ctmx547 comparetotmag 1E-8 1 -> -1 +ctmx548 comparetotmag 1E-7 1 -> -1 +ctmx549 comparetotmag 1E-6 1 -> -1 +ctmx550 comparetotmag 1E-5 1 -> -1 +ctmx551 comparetotmag 1E-4 1 -> -1 +ctmx552 comparetotmag 1E-3 1 -> -1 +ctmx553 comparetotmag 1E-2 1 -> -1 +ctmx554 comparetotmag 1E-1 1 -> -1 +ctmx555 comparetotmag 1E-0 1 -> 0 +ctmx556 comparetotmag 1E+1 1 -> 1 +ctmx557 comparetotmag 1E+2 1 -> 1 +ctmx558 comparetotmag 1E+3 1 -> 1 +ctmx559 comparetotmag 1E+4 1 -> 1 +ctmx561 comparetotmag 1E+5 1 -> 1 +ctmx562 comparetotmag 1E+6 1 -> 1 +ctmx563 comparetotmag 1E+7 1 -> 1 +ctmx564 comparetotmag 1E+8 1 -> 1 +ctmx565 comparetotmag 1E+9 1 -> 1 +ctmx566 comparetotmag 1E+10 1 -> 1 +ctmx567 comparetotmag 1E+11 1 -> 1 +ctmx568 comparetotmag 1E+12 1 -> 1 +ctmx569 comparetotmag 1E+13 1 -> 1 +ctmx570 comparetotmag 1E+14 1 -> 1 +ctmx571 comparetotmag 1E+15 1 -> 1 +-- similar with an useful coefficient, one side only +ctmx580 comparetotmag 0.000000987654321 1E-15 -> 1 +ctmx581 comparetotmag 0.000000987654321 1E-14 -> 1 +ctmx582 comparetotmag 0.000000987654321 1E-13 -> 1 +ctmx583 comparetotmag 0.000000987654321 1E-12 -> 1 +ctmx584 comparetotmag 0.000000987654321 1E-11 -> 1 +ctmx585 comparetotmag 0.000000987654321 1E-10 -> 1 +ctmx586 comparetotmag 0.000000987654321 1E-9 -> 1 +ctmx587 comparetotmag 0.000000987654321 1E-8 -> 1 +ctmx588 comparetotmag 0.000000987654321 1E-7 -> 1 +ctmx589 comparetotmag 0.000000987654321 1E-6 -> -1 +ctmx590 comparetotmag 0.000000987654321 1E-5 -> -1 +ctmx591 comparetotmag 0.000000987654321 1E-4 -> -1 +ctmx592 comparetotmag 0.000000987654321 1E-3 -> -1 +ctmx593 comparetotmag 0.000000987654321 1E-2 -> -1 +ctmx594 comparetotmag 0.000000987654321 1E-1 -> -1 +ctmx595 comparetotmag 0.000000987654321 1E-0 -> -1 +ctmx596 comparetotmag 0.000000987654321 1E+1 -> -1 +ctmx597 comparetotmag 0.000000987654321 1E+2 -> -1 +ctmx598 comparetotmag 0.000000987654321 1E+3 -> -1 +ctmx599 comparetotmag 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +precision: 20 +ctmx600 comparetotmag 12 12.2345 -> -1 +ctmx601 comparetotmag 12.0 12.2345 -> -1 +ctmx602 comparetotmag 12.00 12.2345 -> -1 +ctmx603 comparetotmag 12.000 12.2345 -> -1 +ctmx604 comparetotmag 12.0000 12.2345 -> -1 +ctmx605 comparetotmag 12.00000 12.2345 -> -1 +ctmx606 comparetotmag 12.000000 12.2345 -> -1 +ctmx607 comparetotmag 12.0000000 12.2345 -> -1 +ctmx608 comparetotmag 12.00000000 12.2345 -> -1 +ctmx609 comparetotmag 12.000000000 12.2345 -> -1 +ctmx610 comparetotmag 12.1234 12 -> 1 +ctmx611 comparetotmag 12.1234 12.0 -> 1 +ctmx612 comparetotmag 12.1234 12.00 -> 1 +ctmx613 comparetotmag 12.1234 12.000 -> 1 +ctmx614 comparetotmag 12.1234 12.0000 -> 1 +ctmx615 comparetotmag 12.1234 12.00000 -> 1 +ctmx616 comparetotmag 12.1234 12.000000 -> 1 +ctmx617 comparetotmag 12.1234 12.0000000 -> 1 +ctmx618 comparetotmag 12.1234 12.00000000 -> 1 +ctmx619 comparetotmag 12.1234 12.000000000 -> 1 +ctmx620 comparetotmag -12 -12.2345 -> -1 +ctmx621 comparetotmag -12.0 -12.2345 -> -1 +ctmx622 comparetotmag -12.00 -12.2345 -> -1 +ctmx623 comparetotmag -12.000 -12.2345 -> -1 +ctmx624 comparetotmag -12.0000 -12.2345 -> -1 +ctmx625 comparetotmag -12.00000 -12.2345 -> -1 +ctmx626 comparetotmag -12.000000 -12.2345 -> -1 +ctmx627 comparetotmag -12.0000000 -12.2345 -> -1 +ctmx628 comparetotmag -12.00000000 -12.2345 -> -1 +ctmx629 comparetotmag -12.000000000 -12.2345 -> -1 +ctmx630 comparetotmag -12.1234 -12 -> 1 +ctmx631 comparetotmag -12.1234 -12.0 -> 1 +ctmx632 comparetotmag -12.1234 -12.00 -> 1 +ctmx633 comparetotmag -12.1234 -12.000 -> 1 +ctmx634 comparetotmag -12.1234 -12.0000 -> 1 +ctmx635 comparetotmag -12.1234 -12.00000 -> 1 +ctmx636 comparetotmag -12.1234 -12.000000 -> 1 +ctmx637 comparetotmag -12.1234 -12.0000000 -> 1 +ctmx638 comparetotmag -12.1234 -12.00000000 -> 1 +ctmx639 comparetotmag -12.1234 -12.000000000 -> 1 +precision: 9 + +-- extended zeros +ctmx640 comparetotmag 0 0 -> 0 +ctmx641 comparetotmag 0 -0 -> 0 +ctmx642 comparetotmag 0 -0.0 -> 1 +ctmx643 comparetotmag 0 0.0 -> 1 +ctmx644 comparetotmag -0 0 -> 0 +ctmx645 comparetotmag -0 -0 -> 0 +ctmx646 comparetotmag -0 -0.0 -> 1 +ctmx647 comparetotmag -0 0.0 -> 1 +ctmx648 comparetotmag 0.0 0 -> -1 +ctmx649 comparetotmag 0.0 -0 -> -1 +ctmx650 comparetotmag 0.0 -0.0 -> 0 +ctmx651 comparetotmag 0.0 0.0 -> 0 +ctmx652 comparetotmag -0.0 0 -> -1 +ctmx653 comparetotmag -0.0 -0 -> -1 +ctmx654 comparetotmag -0.0 -0.0 -> 0 +ctmx655 comparetotmag -0.0 0.0 -> 0 + +ctmx656 comparetotmag -0E1 0.0 -> 1 +ctmx657 comparetotmag -0E2 0.0 -> 1 +ctmx658 comparetotmag 0E1 0.0 -> 1 +ctmx659 comparetotmag 0E2 0.0 -> 1 +ctmx660 comparetotmag -0E1 0 -> 1 +ctmx661 comparetotmag -0E2 0 -> 1 +ctmx662 comparetotmag 0E1 0 -> 1 +ctmx663 comparetotmag 0E2 0 -> 1 +ctmx664 comparetotmag -0E1 -0E1 -> 0 +ctmx665 comparetotmag -0E2 -0E1 -> 1 +ctmx666 comparetotmag 0E1 -0E1 -> 0 +ctmx667 comparetotmag 0E2 -0E1 -> 1 +ctmx668 comparetotmag -0E1 -0E2 -> -1 +ctmx669 comparetotmag -0E2 -0E2 -> 0 +ctmx670 comparetotmag 0E1 -0E2 -> -1 +ctmx671 comparetotmag 0E2 -0E2 -> 0 +ctmx672 comparetotmag -0E1 0E1 -> 0 +ctmx673 comparetotmag -0E2 0E1 -> 1 +ctmx674 comparetotmag 0E1 0E1 -> 0 +ctmx675 comparetotmag 0E2 0E1 -> 1 +ctmx676 comparetotmag -0E1 0E2 -> -1 +ctmx677 comparetotmag -0E2 0E2 -> 0 +ctmx678 comparetotmag 0E1 0E2 -> -1 +ctmx679 comparetotmag 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +precision: 20 +ctmx680 comparetotmag 12 12 -> 0 +ctmx681 comparetotmag 12 12.0 -> 1 +ctmx682 comparetotmag 12 12.00 -> 1 +ctmx683 comparetotmag 12 12.000 -> 1 +ctmx684 comparetotmag 12 12.0000 -> 1 +ctmx685 comparetotmag 12 12.00000 -> 1 +ctmx686 comparetotmag 12 12.000000 -> 1 +ctmx687 comparetotmag 12 12.0000000 -> 1 +ctmx688 comparetotmag 12 12.00000000 -> 1 +ctmx689 comparetotmag 12 12.000000000 -> 1 +ctmx690 comparetotmag 12 12 -> 0 +ctmx691 comparetotmag 12.0 12 -> -1 +ctmx692 comparetotmag 12.00 12 -> -1 +ctmx693 comparetotmag 12.000 12 -> -1 +ctmx694 comparetotmag 12.0000 12 -> -1 +ctmx695 comparetotmag 12.00000 12 -> -1 +ctmx696 comparetotmag 12.000000 12 -> -1 +ctmx697 comparetotmag 12.0000000 12 -> -1 +ctmx698 comparetotmag 12.00000000 12 -> -1 +ctmx699 comparetotmag 12.000000000 12 -> -1 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +ctmx701 comparetotmag 12345678000 1 -> 1 +ctmx702 comparetotmag 1 12345678000 -> -1 +ctmx703 comparetotmag 1234567800 1 -> 1 +ctmx704 comparetotmag 1 1234567800 -> -1 +ctmx705 comparetotmag 1234567890 1 -> 1 +ctmx706 comparetotmag 1 1234567890 -> -1 +ctmx707 comparetotmag 1234567891 1 -> 1 +ctmx708 comparetotmag 1 1234567891 -> -1 +ctmx709 comparetotmag 12345678901 1 -> 1 +ctmx710 comparetotmag 1 12345678901 -> -1 +ctmx711 comparetotmag 1234567896 1 -> 1 +ctmx712 comparetotmag 1 1234567896 -> -1 +ctmx713 comparetotmag -1234567891 1 -> 1 +ctmx714 comparetotmag 1 -1234567891 -> -1 +ctmx715 comparetotmag -12345678901 1 -> 1 +ctmx716 comparetotmag 1 -12345678901 -> -1 +ctmx717 comparetotmag -1234567896 1 -> 1 +ctmx718 comparetotmag 1 -1234567896 -> -1 + +precision: 15 +-- same with plenty of precision +ctmx721 comparetotmag 12345678000 1 -> 1 +ctmx722 comparetotmag 1 12345678000 -> -1 +ctmx723 comparetotmag 1234567800 1 -> 1 +ctmx724 comparetotmag 1 1234567800 -> -1 +ctmx725 comparetotmag 1234567890 1 -> 1 +ctmx726 comparetotmag 1 1234567890 -> -1 +ctmx727 comparetotmag 1234567891 1 -> 1 +ctmx728 comparetotmag 1 1234567891 -> -1 +ctmx729 comparetotmag 12345678901 1 -> 1 +ctmx730 comparetotmag 1 12345678901 -> -1 +ctmx731 comparetotmag 1234567896 1 -> 1 +ctmx732 comparetotmag 1 1234567896 -> -1 + +-- residue cases +precision: 5 +ctmx740 comparetotmag 1 0.9999999 -> 1 +ctmx741 comparetotmag 1 0.999999 -> 1 +ctmx742 comparetotmag 1 0.99999 -> 1 +ctmx743 comparetotmag 1 1.0000 -> 1 +ctmx744 comparetotmag 1 1.00001 -> -1 +ctmx745 comparetotmag 1 1.000001 -> -1 +ctmx746 comparetotmag 1 1.0000001 -> -1 +ctmx750 comparetotmag 0.9999999 1 -> -1 +ctmx751 comparetotmag 0.999999 1 -> -1 +ctmx752 comparetotmag 0.99999 1 -> -1 +ctmx753 comparetotmag 1.0000 1 -> -1 +ctmx754 comparetotmag 1.00001 1 -> 1 +ctmx755 comparetotmag 1.000001 1 -> 1 +ctmx756 comparetotmag 1.0000001 1 -> 1 + +-- a selection of longies +ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> 1 +ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0 +ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> 1 +ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +-- precisions above or below the difference should have no effect +precision: 11 +ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 10 +ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 9 +ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 8 +ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 7 +ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 6 +ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 5 +ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 4 +ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 3 +ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 2 +ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 +precision: 1 +ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1 + +-- Specials +precision: 9 +ctmx780 comparetotmag Inf -Inf -> 0 +ctmx781 comparetotmag Inf -1000 -> 1 +ctmx782 comparetotmag Inf -1 -> 1 +ctmx783 comparetotmag Inf -0 -> 1 +ctmx784 comparetotmag Inf 0 -> 1 +ctmx785 comparetotmag Inf 1 -> 1 +ctmx786 comparetotmag Inf 1000 -> 1 +ctmx787 comparetotmag Inf Inf -> 0 +ctmx788 comparetotmag -1000 Inf -> -1 +ctmx789 comparetotmag -Inf Inf -> 0 +ctmx790 comparetotmag -1 Inf -> -1 +ctmx791 comparetotmag -0 Inf -> -1 +ctmx792 comparetotmag 0 Inf -> -1 +ctmx793 comparetotmag 1 Inf -> -1 +ctmx794 comparetotmag 1000 Inf -> -1 +ctmx795 comparetotmag Inf Inf -> 0 + +ctmx800 comparetotmag -Inf -Inf -> 0 +ctmx801 comparetotmag -Inf -1000 -> 1 +ctmx802 comparetotmag -Inf -1 -> 1 +ctmx803 comparetotmag -Inf -0 -> 1 +ctmx804 comparetotmag -Inf 0 -> 1 +ctmx805 comparetotmag -Inf 1 -> 1 +ctmx806 comparetotmag -Inf 1000 -> 1 +ctmx807 comparetotmag -Inf Inf -> 0 +ctmx808 comparetotmag -Inf -Inf -> 0 +ctmx809 comparetotmag -1000 -Inf -> -1 +ctmx810 comparetotmag -1 -Inf -> -1 +ctmx811 comparetotmag -0 -Inf -> -1 +ctmx812 comparetotmag 0 -Inf -> -1 +ctmx813 comparetotmag 1 -Inf -> -1 +ctmx814 comparetotmag 1000 -Inf -> -1 +ctmx815 comparetotmag Inf -Inf -> 0 + +ctmx821 comparetotmag NaN -Inf -> 1 +ctmx822 comparetotmag NaN -1000 -> 1 +ctmx823 comparetotmag NaN -1 -> 1 +ctmx824 comparetotmag NaN -0 -> 1 +ctmx825 comparetotmag NaN 0 -> 1 +ctmx826 comparetotmag NaN 1 -> 1 +ctmx827 comparetotmag NaN 1000 -> 1 +ctmx828 comparetotmag NaN Inf -> 1 +ctmx829 comparetotmag NaN NaN -> 0 +ctmx830 comparetotmag -Inf NaN -> -1 +ctmx831 comparetotmag -1000 NaN -> -1 +ctmx832 comparetotmag -1 NaN -> -1 +ctmx833 comparetotmag -0 NaN -> -1 +ctmx834 comparetotmag 0 NaN -> -1 +ctmx835 comparetotmag 1 NaN -> -1 +ctmx836 comparetotmag 1000 NaN -> -1 +ctmx837 comparetotmag Inf NaN -> -1 +ctmx838 comparetotmag -NaN -NaN -> 0 +ctmx839 comparetotmag +NaN -NaN -> 0 +ctmx840 comparetotmag -NaN +NaN -> 0 + +ctmx841 comparetotmag sNaN -sNaN -> 0 +ctmx842 comparetotmag sNaN -NaN -> -1 +ctmx843 comparetotmag sNaN -Inf -> 1 +ctmx844 comparetotmag sNaN -1000 -> 1 +ctmx845 comparetotmag sNaN -1 -> 1 +ctmx846 comparetotmag sNaN -0 -> 1 +ctmx847 comparetotmag sNaN 0 -> 1 +ctmx848 comparetotmag sNaN 1 -> 1 +ctmx849 comparetotmag sNaN 1000 -> 1 +ctmx850 comparetotmag sNaN NaN -> -1 +ctmx851 comparetotmag sNaN sNaN -> 0 + +ctmx852 comparetotmag -sNaN sNaN -> 0 +ctmx853 comparetotmag -NaN sNaN -> 1 +ctmx854 comparetotmag -Inf sNaN -> -1 +ctmx855 comparetotmag -1000 sNaN -> -1 +ctmx856 comparetotmag -1 sNaN -> -1 +ctmx857 comparetotmag -0 sNaN -> -1 +ctmx858 comparetotmag 0 sNaN -> -1 +ctmx859 comparetotmag 1 sNaN -> -1 +ctmx860 comparetotmag 1000 sNaN -> -1 +ctmx861 comparetotmag Inf sNaN -> -1 +ctmx862 comparetotmag NaN sNaN -> 1 +ctmx863 comparetotmag sNaN sNaN -> 0 + +ctmx871 comparetotmag -sNaN -sNaN -> 0 +ctmx872 comparetotmag -sNaN -NaN -> -1 +ctmx873 comparetotmag -sNaN -Inf -> 1 +ctmx874 comparetotmag -sNaN -1000 -> 1 +ctmx875 comparetotmag -sNaN -1 -> 1 +ctmx876 comparetotmag -sNaN -0 -> 1 +ctmx877 comparetotmag -sNaN 0 -> 1 +ctmx878 comparetotmag -sNaN 1 -> 1 +ctmx879 comparetotmag -sNaN 1000 -> 1 +ctmx880 comparetotmag -sNaN NaN -> -1 +ctmx881 comparetotmag -sNaN sNaN -> 0 + +ctmx882 comparetotmag -sNaN -sNaN -> 0 +ctmx883 comparetotmag -NaN -sNaN -> 1 +ctmx884 comparetotmag -Inf -sNaN -> -1 +ctmx885 comparetotmag -1000 -sNaN -> -1 +ctmx886 comparetotmag -1 -sNaN -> -1 +ctmx887 comparetotmag -0 -sNaN -> -1 +ctmx888 comparetotmag 0 -sNaN -> -1 +ctmx889 comparetotmag 1 -sNaN -> -1 +ctmx890 comparetotmag 1000 -sNaN -> -1 +ctmx891 comparetotmag Inf -sNaN -> -1 +ctmx892 comparetotmag NaN -sNaN -> 1 +ctmx893 comparetotmag sNaN -sNaN -> 0 + +-- NaNs with payload +ctmx960 comparetotmag NaN9 -Inf -> 1 +ctmx961 comparetotmag NaN8 999 -> 1 +ctmx962 comparetotmag NaN77 Inf -> 1 +ctmx963 comparetotmag -NaN67 NaN5 -> 1 +ctmx964 comparetotmag -Inf -NaN4 -> -1 +ctmx965 comparetotmag -999 -NaN33 -> -1 +ctmx966 comparetotmag Inf NaN2 -> -1 + +ctmx970 comparetotmag -NaN41 -NaN42 -> -1 +ctmx971 comparetotmag +NaN41 -NaN42 -> -1 +ctmx972 comparetotmag -NaN41 +NaN42 -> -1 +ctmx973 comparetotmag +NaN41 +NaN42 -> -1 +ctmx974 comparetotmag -NaN42 -NaN01 -> 1 +ctmx975 comparetotmag +NaN42 -NaN01 -> 1 +ctmx976 comparetotmag -NaN42 +NaN01 -> 1 +ctmx977 comparetotmag +NaN42 +NaN01 -> 1 + +ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1 +ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1 +ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1 +ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1 +ctmx984 comparetotmag -sNaN772 -sNaN771 -> 1 +ctmx985 comparetotmag +sNaN772 -sNaN771 -> 1 +ctmx986 comparetotmag -sNaN772 +sNaN771 -> 1 +ctmx987 comparetotmag +sNaN772 +sNaN771 -> 1 + +ctmx991 comparetotmag -sNaN99 -Inf -> 1 +ctmx992 comparetotmag sNaN98 -11 -> 1 +ctmx993 comparetotmag sNaN97 NaN -> -1 +ctmx994 comparetotmag sNaN16 sNaN94 -> -1 +ctmx995 comparetotmag NaN85 sNaN83 -> 1 +ctmx996 comparetotmag -Inf sNaN92 -> -1 +ctmx997 comparetotmag 088 sNaN81 -> -1 +ctmx998 comparetotmag Inf sNaN90 -> -1 +ctmx999 comparetotmag NaN -sNaN89 -> 1 + +-- overflow and underflow tests .. subnormal results now allowed +maxExponent: 999999999 +minexponent: -999999999 +ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999 -> -1 +ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0 -> 1 +ctmx1082 comparetotmag +0.100 9E-999999999 -> 1 +ctmx1083 comparetotmag 9E-999999999 +0.100 -> -1 +ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999 -> -1 +ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0 -> 1 +ctmx1087 comparetotmag -0.100 9E-999999999 -> 1 +ctmx1088 comparetotmag 9E-999999999 -0.100 -> -1 + +ctmx1089 comparetotmag 1e-599999999 1e-400000001 -> -1 +ctmx1090 comparetotmag 1e-599999999 1e-400000000 -> -1 +ctmx1091 comparetotmag 1e-600000000 1e-400000000 -> -1 +ctmx1092 comparetotmag 9e-999999998 0.01 -> -1 +ctmx1093 comparetotmag 9e-999999998 0.1 -> -1 +ctmx1094 comparetotmag 0.01 9e-999999998 -> 1 +ctmx1095 comparetotmag 1e599999999 1e400000001 -> 1 +ctmx1096 comparetotmag 1e599999999 1e400000000 -> 1 +ctmx1097 comparetotmag 1e600000000 1e400000000 -> 1 +ctmx1098 comparetotmag 9e999999998 100 -> 1 +ctmx1099 comparetotmag 9e999999998 10 -> 1 +ctmx1100 comparetotmag 100 9e999999998 -> -1 +-- signs +ctmx1101 comparetotmag 1e+777777777 1e+411111111 -> 1 +ctmx1102 comparetotmag 1e+777777777 -1e+411111111 -> 1 +ctmx1103 comparetotmag -1e+777777777 1e+411111111 -> 1 +ctmx1104 comparetotmag -1e+777777777 -1e+411111111 -> 1 +ctmx1105 comparetotmag 1e-777777777 1e-411111111 -> -1 +ctmx1106 comparetotmag 1e-777777777 -1e-411111111 -> -1 +ctmx1107 comparetotmag -1e-777777777 1e-411111111 -> -1 +ctmx1108 comparetotmag -1e-777777777 -1e-411111111 -> -1 + +-- spread zeros +ctmx1110 comparetotmag 0E-383 0 -> -1 +ctmx1111 comparetotmag 0E-383 -0 -> -1 +ctmx1112 comparetotmag -0E-383 0 -> -1 +ctmx1113 comparetotmag -0E-383 -0 -> -1 +ctmx1114 comparetotmag 0E-383 0E+384 -> -1 +ctmx1115 comparetotmag 0E-383 -0E+384 -> -1 +ctmx1116 comparetotmag -0E-383 0E+384 -> -1 +ctmx1117 comparetotmag -0E-383 -0E+384 -> -1 +ctmx1118 comparetotmag 0 0E+384 -> -1 +ctmx1119 comparetotmag 0 -0E+384 -> -1 +ctmx1120 comparetotmag -0 0E+384 -> -1 +ctmx1121 comparetotmag -0 -0E+384 -> -1 + +ctmx1130 comparetotmag 0E+384 0 -> 1 +ctmx1131 comparetotmag 0E+384 -0 -> 1 +ctmx1132 comparetotmag -0E+384 0 -> 1 +ctmx1133 comparetotmag -0E+384 -0 -> 1 +ctmx1134 comparetotmag 0E+384 0E-383 -> 1 +ctmx1135 comparetotmag 0E+384 -0E-383 -> 1 +ctmx1136 comparetotmag -0E+384 0E-383 -> 1 +ctmx1137 comparetotmag -0E+384 -0E-383 -> 1 +ctmx1138 comparetotmag 0 0E-383 -> 1 +ctmx1139 comparetotmag 0 -0E-383 -> 1 +ctmx1140 comparetotmag -0 0E-383 -> 1 +ctmx1141 comparetotmag -0 -0E-383 -> 1 + +-- Null tests +ctmx9990 comparetotmag 10 # -> NaN Invalid_operation +ctmx9991 comparetotmag # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copy.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copy.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,86 @@ +------------------------------------------------------------------------ +-- copy.decTest -- quiet copy -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check +cpyx001 copy +7.50 -> 7.50 + +-- Infinities +cpyx011 copy Infinity -> Infinity +cpyx012 copy -Infinity -> -Infinity + +-- NaNs, 0 payload +cpyx021 copy NaN -> NaN +cpyx022 copy -NaN -> -NaN +cpyx023 copy sNaN -> sNaN +cpyx024 copy -sNaN -> -sNaN + +-- NaNs, non-0 payload +cpyx031 copy NaN10 -> NaN10 +cpyx032 copy -NaN10 -> -NaN10 +cpyx033 copy sNaN10 -> sNaN10 +cpyx034 copy -sNaN10 -> -sNaN10 +cpyx035 copy NaN7 -> NaN7 +cpyx036 copy -NaN7 -> -NaN7 +cpyx037 copy sNaN101 -> sNaN101 +cpyx038 copy -sNaN101 -> -sNaN101 + +-- finites +cpyx101 copy 7 -> 7 +cpyx102 copy -7 -> -7 +cpyx103 copy 75 -> 75 +cpyx104 copy -75 -> -75 +cpyx105 copy 7.50 -> 7.50 +cpyx106 copy -7.50 -> -7.50 +cpyx107 copy 7.500 -> 7.500 +cpyx108 copy -7.500 -> -7.500 + +-- zeros +cpyx111 copy 0 -> 0 +cpyx112 copy -0 -> -0 +cpyx113 copy 0E+4 -> 0E+4 +cpyx114 copy -0E+4 -> -0E+4 +cpyx115 copy 0.0000 -> 0.0000 +cpyx116 copy -0.0000 -> -0.0000 +cpyx117 copy 0E-141 -> 0E-141 +cpyx118 copy -0E-141 -> -0E-141 + +-- full coefficients, alternating bits +cpyx121 copy 268268268 -> 268268268 +cpyx122 copy -268268268 -> -268268268 +cpyx123 copy 134134134 -> 134134134 +cpyx124 copy -134134134 -> -134134134 + +-- Nmax, Nmin, Ntiny +cpyx131 copy 9.99999999E+999 -> 9.99999999E+999 +cpyx132 copy 1E-999 -> 1E-999 +cpyx133 copy 1.00000000E-999 -> 1.00000000E-999 +cpyx134 copy 1E-1007 -> 1E-1007 + +cpyx135 copy -1E-1007 -> -1E-1007 +cpyx136 copy -1.00000000E-999 -> -1.00000000E-999 +cpyx137 copy -1E-999 -> -1E-999 +cpyx138 copy -9.99999999E+999 -> -9.99999999E+999 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copyabs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copyabs.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,86 @@ +------------------------------------------------------------------------ +-- copyAbs.decTest -- quiet copy and set sign to zero -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check +cpax001 copyabs +7.50 -> 7.50 + +-- Infinities +cpax011 copyabs Infinity -> Infinity +cpax012 copyabs -Infinity -> Infinity + +-- NaNs, 0 payload +cpax021 copyabs NaN -> NaN +cpax022 copyabs -NaN -> NaN +cpax023 copyabs sNaN -> sNaN +cpax024 copyabs -sNaN -> sNaN + +-- NaNs, non-0 payload +cpax031 copyabs NaN10 -> NaN10 +cpax032 copyabs -NaN15 -> NaN15 +cpax033 copyabs sNaN15 -> sNaN15 +cpax034 copyabs -sNaN10 -> sNaN10 +cpax035 copyabs NaN7 -> NaN7 +cpax036 copyabs -NaN7 -> NaN7 +cpax037 copyabs sNaN101 -> sNaN101 +cpax038 copyabs -sNaN101 -> sNaN101 + +-- finites +cpax101 copyabs 7 -> 7 +cpax102 copyabs -7 -> 7 +cpax103 copyabs 75 -> 75 +cpax104 copyabs -75 -> 75 +cpax105 copyabs 7.10 -> 7.10 +cpax106 copyabs -7.10 -> 7.10 +cpax107 copyabs 7.500 -> 7.500 +cpax108 copyabs -7.500 -> 7.500 + +-- zeros +cpax111 copyabs 0 -> 0 +cpax112 copyabs -0 -> 0 +cpax113 copyabs 0E+6 -> 0E+6 +cpax114 copyabs -0E+6 -> 0E+6 +cpax115 copyabs 0.0000 -> 0.0000 +cpax116 copyabs -0.0000 -> 0.0000 +cpax117 copyabs 0E-141 -> 0E-141 +cpax118 copyabs -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +cpax121 copyabs 268268268 -> 268268268 +cpax122 copyabs -268268268 -> 268268268 +cpax123 copyabs 134134134 -> 134134134 +cpax124 copyabs -134134134 -> 134134134 + +-- Nmax, Nmin, Ntiny +cpax131 copyabs 9.99999999E+999 -> 9.99999999E+999 +cpax132 copyabs 1E-999 -> 1E-999 +cpax133 copyabs 1.00000000E-999 -> 1.00000000E-999 +cpax134 copyabs 1E-1007 -> 1E-1007 + +cpax135 copyabs -1E-1007 -> 1E-1007 +cpax136 copyabs -1.00000000E-999 -> 1.00000000E-999 +cpax137 copyabs -1E-999 -> 1E-999 +cpax199 copyabs -9.99999999E+999 -> 9.99999999E+999 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copynegate.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copynegate.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,86 @@ +------------------------------------------------------------------------ +-- copyNegate.decTest -- quiet copy and negate -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check +cpnx001 copynegate +7.50 -> -7.50 + +-- Infinities +cpnx011 copynegate Infinity -> -Infinity +cpnx012 copynegate -Infinity -> Infinity + +-- NaNs, 0 payload +cpnx021 copynegate NaN -> -NaN +cpnx022 copynegate -NaN -> NaN +cpnx023 copynegate sNaN -> -sNaN +cpnx024 copynegate -sNaN -> sNaN + +-- NaNs, non-0 payload +cpnx031 copynegate NaN13 -> -NaN13 +cpnx032 copynegate -NaN13 -> NaN13 +cpnx033 copynegate sNaN13 -> -sNaN13 +cpnx034 copynegate -sNaN13 -> sNaN13 +cpnx035 copynegate NaN70 -> -NaN70 +cpnx036 copynegate -NaN70 -> NaN70 +cpnx037 copynegate sNaN101 -> -sNaN101 +cpnx038 copynegate -sNaN101 -> sNaN101 + +-- finites +cpnx101 copynegate 7 -> -7 +cpnx102 copynegate -7 -> 7 +cpnx103 copynegate 75 -> -75 +cpnx104 copynegate -75 -> 75 +cpnx105 copynegate 7.50 -> -7.50 +cpnx106 copynegate -7.50 -> 7.50 +cpnx107 copynegate 7.500 -> -7.500 +cpnx108 copynegate -7.500 -> 7.500 + +-- zeros +cpnx111 copynegate 0 -> -0 +cpnx112 copynegate -0 -> 0 +cpnx113 copynegate 0E+4 -> -0E+4 +cpnx114 copynegate -0E+4 -> 0E+4 +cpnx115 copynegate 0.0000 -> -0.0000 +cpnx116 copynegate -0.0000 -> 0.0000 +cpnx117 copynegate 0E-141 -> -0E-141 +cpnx118 copynegate -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +cpnx121 copynegate 268268268 -> -268268268 +cpnx122 copynegate -268268268 -> 268268268 +cpnx123 copynegate 134134134 -> -134134134 +cpnx124 copynegate -134134134 -> 134134134 + +-- Nmax, Nmin, Ntiny +cpnx131 copynegate 9.99999999E+999 -> -9.99999999E+999 +cpnx132 copynegate 1E-999 -> -1E-999 +cpnx133 copynegate 1.00000000E-999 -> -1.00000000E-999 +cpnx134 copynegate 1E-1007 -> -1E-1007 + +cpnx135 copynegate -1E-1007 -> 1E-1007 +cpnx136 copynegate -1.00000000E-999 -> 1.00000000E-999 +cpnx137 copynegate -1E-999 -> 1E-999 +cpnx138 copynegate -9.99999999E+999 -> 9.99999999E+999 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copysign.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/copysign.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,177 @@ +------------------------------------------------------------------------ +-- copysign.decTest -- quiet copy with sign from rhs -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check, and examples from decArith +cpsx001 copysign +7.50 11 -> 7.50 +cpsx002 copysign '1.50' '7.33' -> 1.50 +cpsx003 copysign '-1.50' '7.33' -> 1.50 +cpsx004 copysign '1.50' '-7.33' -> -1.50 +cpsx005 copysign '-1.50' '-7.33' -> -1.50 + +-- Infinities +cpsx011 copysign Infinity 11 -> Infinity +cpsx012 copysign -Infinity 11 -> Infinity + +-- NaNs, 0 payload +cpsx021 copysign NaN 11 -> NaN +cpsx022 copysign -NaN 11 -> NaN +cpsx023 copysign sNaN 11 -> sNaN +cpsx024 copysign -sNaN 11 -> sNaN + +-- NaNs, non-0 payload +cpsx031 copysign NaN10 11 -> NaN10 +cpsx032 copysign -NaN10 11 -> NaN10 +cpsx033 copysign sNaN10 11 -> sNaN10 +cpsx034 copysign -sNaN10 11 -> sNaN10 +cpsx035 copysign NaN7 11 -> NaN7 +cpsx036 copysign -NaN7 11 -> NaN7 +cpsx037 copysign sNaN101 11 -> sNaN101 +cpsx038 copysign -sNaN101 11 -> sNaN101 + +-- finites +cpsx101 copysign 7 11 -> 7 +cpsx102 copysign -7 11 -> 7 +cpsx103 copysign 75 11 -> 75 +cpsx104 copysign -75 11 -> 75 +cpsx105 copysign 7.50 11 -> 7.50 +cpsx106 copysign -7.50 11 -> 7.50 +cpsx107 copysign 7.500 11 -> 7.500 +cpsx108 copysign -7.500 11 -> 7.500 + +-- zeros +cpsx111 copysign 0 11 -> 0 +cpsx112 copysign -0 11 -> 0 +cpsx113 copysign 0E+4 11 -> 0E+4 +cpsx114 copysign -0E+4 11 -> 0E+4 +cpsx115 copysign 0.0000 11 -> 0.0000 +cpsx116 copysign -0.0000 11 -> 0.0000 +cpsx117 copysign 0E-141 11 -> 0E-141 +cpsx118 copysign -0E-141 11 -> 0E-141 + +-- full coefficients, alternating bits +cpsx121 copysign 268268268 11 -> 268268268 +cpsx122 copysign -268268268 11 -> 268268268 +cpsx123 copysign 134134134 11 -> 134134134 +cpsx124 copysign -134134134 11 -> 134134134 + +-- Nmax, Nmin, Ntiny +cpsx131 copysign 9.99999999E+999 11 -> 9.99999999E+999 +cpsx132 copysign 1E-999 11 -> 1E-999 +cpsx133 copysign 1.00000000E-999 11 -> 1.00000000E-999 +cpsx134 copysign 1E-1007 11 -> 1E-1007 + +cpsx135 copysign -1E-1007 11 -> 1E-1007 +cpsx136 copysign -1.00000000E-999 11 -> 1.00000000E-999 +cpsx137 copysign -1E-999 11 -> 1E-999 +cpsx138 copysign -9.99999999E+999 11 -> 9.99999999E+999 + +-- repeat with negative RHS + +-- Infinities +cpsx211 copysign Infinity -34 -> -Infinity +cpsx212 copysign -Infinity -34 -> -Infinity + +-- NaNs, 0 payload +cpsx221 copysign NaN -34 -> -NaN +cpsx222 copysign -NaN -34 -> -NaN +cpsx223 copysign sNaN -34 -> -sNaN +cpsx224 copysign -sNaN -34 -> -sNaN + +-- NaNs, non-0 payload +cpsx231 copysign NaN10 -34 -> -NaN10 +cpsx232 copysign -NaN10 -34 -> -NaN10 +cpsx233 copysign sNaN10 -34 -> -sNaN10 +cpsx234 copysign -sNaN10 -34 -> -sNaN10 +cpsx235 copysign NaN7 -34 -> -NaN7 +cpsx236 copysign -NaN7 -34 -> -NaN7 +cpsx237 copysign sNaN101 -34 -> -sNaN101 +cpsx238 copysign -sNaN101 -34 -> -sNaN101 + +-- finites +cpsx301 copysign 7 -34 -> -7 +cpsx302 copysign -7 -34 -> -7 +cpsx303 copysign 75 -34 -> -75 +cpsx304 copysign -75 -34 -> -75 +cpsx305 copysign 7.50 -34 -> -7.50 +cpsx306 copysign -7.50 -34 -> -7.50 +cpsx307 copysign 7.500 -34 -> -7.500 +cpsx308 copysign -7.500 -34 -> -7.500 + +-- zeros +cpsx311 copysign 0 -34 -> -0 +cpsx312 copysign -0 -34 -> -0 +cpsx313 copysign 0E+4 -34 -> -0E+4 +cpsx314 copysign -0E+4 -34 -> -0E+4 +cpsx315 copysign 0.0000 -34 -> -0.0000 +cpsx316 copysign -0.0000 -34 -> -0.0000 +cpsx317 copysign 0E-141 -34 -> -0E-141 +cpsx318 copysign -0E-141 -34 -> -0E-141 + +-- full coefficients, alternating bits +cpsx321 copysign 268268268 -18 -> -268268268 +cpsx322 copysign -268268268 -18 -> -268268268 +cpsx323 copysign 134134134 -18 -> -134134134 +cpsx324 copysign -134134134 -18 -> -134134134 + +-- Nmax, Nmin, Ntiny +cpsx331 copysign 9.99999999E+999 -18 -> -9.99999999E+999 +cpsx332 copysign 1E-999 -18 -> -1E-999 +cpsx333 copysign 1.00000000E-999 -18 -> -1.00000000E-999 +cpsx334 copysign 1E-1007 -18 -> -1E-1007 + +cpsx335 copysign -1E-1007 -18 -> -1E-1007 +cpsx336 copysign -1.00000000E-999 -18 -> -1.00000000E-999 +cpsx337 copysign -1E-999 -18 -> -1E-999 +cpsx338 copysign -9.99999999E+999 -18 -> -9.99999999E+999 + +-- Other kinds of RHS +cpsx401 copysign 701 -34 -> -701 +cpsx402 copysign -720 -34 -> -720 +cpsx403 copysign 701 -0 -> -701 +cpsx404 copysign -720 -0 -> -720 +cpsx405 copysign 701 +0 -> 701 +cpsx406 copysign -720 +0 -> 720 +cpsx407 copysign 701 +34 -> 701 +cpsx408 copysign -720 +34 -> 720 + +cpsx413 copysign 701 -Inf -> -701 +cpsx414 copysign -720 -Inf -> -720 +cpsx415 copysign 701 +Inf -> 701 +cpsx416 copysign -720 +Inf -> 720 + +cpsx420 copysign 701 -NaN -> -701 +cpsx421 copysign -720 -NaN -> -720 +cpsx422 copysign 701 +NaN -> 701 +cpsx423 copysign -720 +NaN -> 720 +cpsx425 copysign -720 +NaN8 -> 720 + +cpsx426 copysign 701 -sNaN -> -701 +cpsx427 copysign -720 -sNaN -> -720 +cpsx428 copysign 701 +sNaN -> 701 +cpsx429 copysign -720 +sNaN -> 720 +cpsx430 copysign -720 +sNaN3 -> 720 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAbs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAbs.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,126 @@ +------------------------------------------------------------------------ +-- ddAbs.decTest -- decDouble absolute value, heeding sNaN -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddabs001 abs '1' -> '1' +ddabs002 abs '-1' -> '1' +ddabs003 abs '1.00' -> '1.00' +ddabs004 abs '-1.00' -> '1.00' +ddabs005 abs '0' -> '0' +ddabs006 abs '0.00' -> '0.00' +ddabs007 abs '00.0' -> '0.0' +ddabs008 abs '00.00' -> '0.00' +ddabs009 abs '00' -> '0' + +ddabs010 abs '-2' -> '2' +ddabs011 abs '2' -> '2' +ddabs012 abs '-2.00' -> '2.00' +ddabs013 abs '2.00' -> '2.00' +ddabs014 abs '-0' -> '0' +ddabs015 abs '-0.00' -> '0.00' +ddabs016 abs '-00.0' -> '0.0' +ddabs017 abs '-00.00' -> '0.00' +ddabs018 abs '-00' -> '0' + +ddabs020 abs '-2000000' -> '2000000' +ddabs021 abs '2000000' -> '2000000' + +ddabs030 abs '+0.1' -> '0.1' +ddabs031 abs '-0.1' -> '0.1' +ddabs032 abs '+0.01' -> '0.01' +ddabs033 abs '-0.01' -> '0.01' +ddabs034 abs '+0.001' -> '0.001' +ddabs035 abs '-0.001' -> '0.001' +ddabs036 abs '+0.000001' -> '0.000001' +ddabs037 abs '-0.000001' -> '0.000001' +ddabs038 abs '+0.000000000001' -> '1E-12' +ddabs039 abs '-0.000000000001' -> '1E-12' + +-- examples from decArith +ddabs040 abs '2.1' -> '2.1' +ddabs041 abs '-100' -> '100' +ddabs042 abs '101.5' -> '101.5' +ddabs043 abs '-101.5' -> '101.5' + +-- more fixed, potential LHS swaps/overlays if done by subtract 0 +ddabs060 abs '-56267E-10' -> '0.0000056267' +ddabs061 abs '-56267E-5' -> '0.56267' +ddabs062 abs '-56267E-2' -> '562.67' +ddabs063 abs '-56267E-1' -> '5626.7' +ddabs065 abs '-56267E-0' -> '56267' + +-- subnormals and underflow + +-- long operand tests +ddabs321 abs 1234567890123456 -> 1234567890123456 +ddabs322 abs 12345678000 -> 12345678000 +ddabs323 abs 1234567800 -> 1234567800 +ddabs324 abs 1234567890 -> 1234567890 +ddabs325 abs 1234567891 -> 1234567891 +ddabs326 abs 12345678901 -> 12345678901 +ddabs327 abs 1234567896 -> 1234567896 + +-- zeros +ddabs111 abs 0 -> 0 +ddabs112 abs -0 -> 0 +ddabs113 abs 0E+6 -> 0E+6 +ddabs114 abs -0E+6 -> 0E+6 +ddabs115 abs 0.0000 -> 0.0000 +ddabs116 abs -0.0000 -> 0.0000 +ddabs117 abs 0E-141 -> 0E-141 +ddabs118 abs -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +ddabs121 abs 2682682682682682 -> 2682682682682682 +ddabs122 abs -2682682682682682 -> 2682682682682682 +ddabs123 abs 1341341341341341 -> 1341341341341341 +ddabs124 abs -1341341341341341 -> 1341341341341341 + +-- Nmax, Nmin, Ntiny +ddabs131 abs 9.999999999999999E+384 -> 9.999999999999999E+384 +ddabs132 abs 1E-383 -> 1E-383 +ddabs133 abs 1.000000000000000E-383 -> 1.000000000000000E-383 +ddabs134 abs 1E-398 -> 1E-398 Subnormal + +ddabs135 abs -1E-398 -> 1E-398 Subnormal +ddabs136 abs -1.000000000000000E-383 -> 1.000000000000000E-383 +ddabs137 abs -1E-383 -> 1E-383 +ddabs138 abs -9.999999999999999E+384 -> 9.999999999999999E+384 + +-- specials +ddabs520 abs 'Inf' -> 'Infinity' +ddabs521 abs '-Inf' -> 'Infinity' +ddabs522 abs NaN -> NaN +ddabs523 abs sNaN -> NaN Invalid_operation +ddabs524 abs NaN22 -> NaN22 +ddabs525 abs sNaN33 -> NaN33 Invalid_operation +ddabs526 abs -NaN22 -> -NaN22 +ddabs527 abs -sNaN33 -> -NaN33 Invalid_operation + +-- Null tests +ddabs900 abs # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAdd.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAdd.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1328 @@ +------------------------------------------------------------------------ +-- ddAdd.decTest -- decDouble addition -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests are for decDoubles only; all arguments are +-- representable in a decDouble +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- [first group are 'quick confidence check'] +ddadd001 add 1 1 -> 2 +ddadd002 add 2 3 -> 5 +ddadd003 add '5.75' '3.3' -> 9.05 +ddadd004 add '5' '-3' -> 2 +ddadd005 add '-5' '-3' -> -8 +ddadd006 add '-7' '2.5' -> -4.5 +ddadd007 add '0.7' '0.3' -> 1.0 +ddadd008 add '1.25' '1.25' -> 2.50 +ddadd009 add '1.23456789' '1.00000000' -> '2.23456789' +ddadd010 add '1.23456789' '1.00000011' -> '2.23456800' + +-- 1234567890123456 1234567890123456 +ddadd011 add '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded +ddadd012 add '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded +ddadd013 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999' +ddadd014 add '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded +ddadd015 add '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded +ddadd016 add '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded +ddadd017 add '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded +ddadd018 add '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded +ddadd019 add '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded +ddadd020 add '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded + +ddadd021 add 0 1 -> 1 +ddadd022 add 1 1 -> 2 +ddadd023 add 2 1 -> 3 +ddadd024 add 3 1 -> 4 +ddadd025 add 4 1 -> 5 +ddadd026 add 5 1 -> 6 +ddadd027 add 6 1 -> 7 +ddadd028 add 7 1 -> 8 +ddadd029 add 8 1 -> 9 +ddadd030 add 9 1 -> 10 + +-- some carrying effects +ddadd031 add '0.9998' '0.0000' -> '0.9998' +ddadd032 add '0.9998' '0.0001' -> '0.9999' +ddadd033 add '0.9998' '0.0002' -> '1.0000' +ddadd034 add '0.9998' '0.0003' -> '1.0001' + +ddadd035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +ddadd036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +ddadd037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +ddadd038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded +ddadd039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded + +-- symmetry: +ddadd040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded +ddadd041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded +ddadd042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded +ddadd044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded +ddadd045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded + +-- same, without rounding +ddadd046 add '10000e+9' '7' -> '10000000000007' +ddadd047 add '10000e+9' '70' -> '10000000000070' +ddadd048 add '10000e+9' '700' -> '10000000000700' +ddadd049 add '10000e+9' '7000' -> '10000000007000' +ddadd050 add '10000e+9' '70000' -> '10000000070000' +ddadd051 add '10000e+9' '700000' -> '10000000700000' +ddadd052 add '10000e+9' '7000000' -> '10000007000000' + +-- examples from decarith +ddadd053 add '12' '7.00' -> '19.00' +ddadd054 add '1.3' '-1.07' -> '0.23' +ddadd055 add '1.3' '-1.30' -> '0.00' +ddadd056 add '1.3' '-2.07' -> '-0.77' +ddadd057 add '1E+2' '1E+4' -> '1.01E+4' + +-- leading zero preservation +ddadd061 add 1 '0.0001' -> '1.0001' +ddadd062 add 1 '0.00001' -> '1.00001' +ddadd063 add 1 '0.000001' -> '1.000001' +ddadd064 add 1 '0.0000001' -> '1.0000001' +ddadd065 add 1 '0.00000001' -> '1.00000001' + +-- some funny zeros [in case of bad signum] +ddadd070 add 1 0 -> 1 +ddadd071 add 1 0. -> 1 +ddadd072 add 1 .0 -> 1.0 +ddadd073 add 1 0.0 -> 1.0 +ddadd074 add 1 0.00 -> 1.00 +ddadd075 add 0 1 -> 1 +ddadd076 add 0. 1 -> 1 +ddadd077 add .0 1 -> 1.0 +ddadd078 add 0.0 1 -> 1.0 +ddadd079 add 0.00 1 -> 1.00 + +-- some carries +ddadd080 add 999999998 1 -> 999999999 +ddadd081 add 999999999 1 -> 1000000000 +ddadd082 add 99999999 1 -> 100000000 +ddadd083 add 9999999 1 -> 10000000 +ddadd084 add 999999 1 -> 1000000 +ddadd085 add 99999 1 -> 100000 +ddadd086 add 9999 1 -> 10000 +ddadd087 add 999 1 -> 1000 +ddadd088 add 99 1 -> 100 +ddadd089 add 9 1 -> 10 + + +-- more LHS swaps +ddadd090 add '-56267E-10' 0 -> '-0.0000056267' +ddadd091 add '-56267E-6' 0 -> '-0.056267' +ddadd092 add '-56267E-5' 0 -> '-0.56267' +ddadd093 add '-56267E-4' 0 -> '-5.6267' +ddadd094 add '-56267E-3' 0 -> '-56.267' +ddadd095 add '-56267E-2' 0 -> '-562.67' +ddadd096 add '-56267E-1' 0 -> '-5626.7' +ddadd097 add '-56267E-0' 0 -> '-56267' +ddadd098 add '-5E-10' 0 -> '-5E-10' +ddadd099 add '-5E-7' 0 -> '-5E-7' +ddadd100 add '-5E-6' 0 -> '-0.000005' +ddadd101 add '-5E-5' 0 -> '-0.00005' +ddadd102 add '-5E-4' 0 -> '-0.0005' +ddadd103 add '-5E-1' 0 -> '-0.5' +ddadd104 add '-5E0' 0 -> '-5' +ddadd105 add '-5E1' 0 -> '-50' +ddadd106 add '-5E5' 0 -> '-500000' +ddadd107 add '-5E15' 0 -> '-5000000000000000' +ddadd108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded +ddadd109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded +ddadd110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded +ddadd111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded + +-- more RHS swaps +ddadd113 add 0 '-56267E-10' -> '-0.0000056267' +ddadd114 add 0 '-56267E-6' -> '-0.056267' +ddadd116 add 0 '-56267E-5' -> '-0.56267' +ddadd117 add 0 '-56267E-4' -> '-5.6267' +ddadd119 add 0 '-56267E-3' -> '-56.267' +ddadd120 add 0 '-56267E-2' -> '-562.67' +ddadd121 add 0 '-56267E-1' -> '-5626.7' +ddadd122 add 0 '-56267E-0' -> '-56267' +ddadd123 add 0 '-5E-10' -> '-5E-10' +ddadd124 add 0 '-5E-7' -> '-5E-7' +ddadd125 add 0 '-5E-6' -> '-0.000005' +ddadd126 add 0 '-5E-5' -> '-0.00005' +ddadd127 add 0 '-5E-4' -> '-0.0005' +ddadd128 add 0 '-5E-1' -> '-0.5' +ddadd129 add 0 '-5E0' -> '-5' +ddadd130 add 0 '-5E1' -> '-50' +ddadd131 add 0 '-5E5' -> '-500000' +ddadd132 add 0 '-5E15' -> '-5000000000000000' +ddadd133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded +ddadd134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded +ddadd135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded +ddadd136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded + +-- related +ddadd137 add 1 '0E-19' -> '1.000000000000000' Rounded +ddadd138 add -1 '0E-19' -> '-1.000000000000000' Rounded +ddadd139 add '0E-19' 1 -> '1.000000000000000' Rounded +ddadd140 add '0E-19' -1 -> '-1.000000000000000' Rounded +ddadd141 add 1E+11 0.0000 -> '100000000000.0000' +ddadd142 add 1E+11 0.00000 -> '100000000000.0000' Rounded +ddadd143 add 0.000 1E+12 -> '1000000000000.000' +ddadd144 add 0.0000 1E+12 -> '1000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +ddadd146 add '00.0' 0 -> '0.0' +ddadd147 add '0.00' 0 -> '0.00' +ddadd148 add 0 '0.00' -> '0.00' +ddadd149 add 0 '00.0' -> '0.0' +ddadd150 add '00.0' '0.00' -> '0.00' +ddadd151 add '0.00' '00.0' -> '0.00' +ddadd152 add '3' '.3' -> '3.3' +ddadd153 add '3.' '.3' -> '3.3' +ddadd154 add '3.0' '.3' -> '3.3' +ddadd155 add '3.00' '.3' -> '3.30' +ddadd156 add '3' '3' -> '6' +ddadd157 add '3' '+3' -> '6' +ddadd158 add '3' '-3' -> '0' +ddadd159 add '0.3' '-0.3' -> '0.0' +ddadd160 add '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +ddadd161 add '1E+12' '-1' -> '999999999999' +ddadd162 add '1E+12' '1.11' -> '1000000000001.11' +ddadd163 add '1.11' '1E+12' -> '1000000000001.11' +ddadd164 add '-1' '1E+12' -> '999999999999' +ddadd165 add '7E+12' '-1' -> '6999999999999' +ddadd166 add '7E+12' '1.11' -> '7000000000001.11' +ddadd167 add '1.11' '7E+12' -> '7000000000001.11' +ddadd168 add '-1' '7E+12' -> '6999999999999' + +rounding: half_up +-- 1.234567890123456 1234567890123456 1 234567890123456 +ddadd170 add '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded +ddadd171 add '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded +ddadd172 add '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded +ddadd173 add '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded +ddadd174 add '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded +ddadd175 add '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded +ddadd176 add '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded +ddadd177 add '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded +ddadd178 add '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded +ddadd179 add '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded +ddadd180 add '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded +ddadd181 add '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded +ddadd182 add '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded +ddadd183 add '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded + +-- and some more, including residue effects and different roundings +rounding: half_up +ddadd200 add '1234560123456789' 0 -> '1234560123456789' +ddadd201 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded +ddadd202 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded +ddadd203 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded +ddadd204 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded +ddadd205 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded +ddadd206 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded +ddadd207 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded +ddadd208 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded +ddadd209 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded +ddadd210 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded +ddadd211 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded +ddadd212 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded +ddadd213 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded +ddadd214 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded +ddadd215 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded +ddadd216 add '1234560123456789' 1 -> '1234560123456790' +ddadd217 add '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded +ddadd218 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded +ddadd219 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded + +rounding: half_even +ddadd220 add '1234560123456789' 0 -> '1234560123456789' +ddadd221 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded +ddadd222 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded +ddadd223 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded +ddadd224 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded +ddadd225 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded +ddadd226 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded +ddadd227 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded +ddadd228 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded +ddadd229 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded +ddadd230 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded +ddadd231 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded +ddadd232 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded +ddadd233 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded +ddadd234 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded +ddadd235 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded +ddadd236 add '1234560123456789' 1 -> '1234560123456790' +ddadd237 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded +ddadd238 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded +ddadd239 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded +-- critical few with even bottom digit... +ddadd240 add '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded +ddadd241 add '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded +ddadd242 add '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded + +rounding: down +ddadd250 add '1234560123456789' 0 -> '1234560123456789' +ddadd251 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded +ddadd252 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded +ddadd253 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded +ddadd254 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded +ddadd255 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded +ddadd256 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded +ddadd257 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded +ddadd258 add '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded +ddadd259 add '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded +ddadd260 add '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded +ddadd261 add '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded +ddadd262 add '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded +ddadd263 add '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded +ddadd264 add '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded +ddadd265 add '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded +ddadd266 add '1234560123456789' 1 -> '1234560123456790' +ddadd267 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded +ddadd268 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded +ddadd269 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +ddadd301 add -1 1 -> 0 +ddadd302 add 0 1 -> 1 +ddadd303 add 1 1 -> 2 +ddadd304 add 12 1 -> 13 +ddadd305 add 98 1 -> 99 +ddadd306 add 99 1 -> 100 +ddadd307 add 100 1 -> 101 +ddadd308 add 101 1 -> 102 +ddadd309 add -1 -1 -> -2 +ddadd310 add 0 -1 -> -1 +ddadd311 add 1 -1 -> 0 +ddadd312 add 12 -1 -> 11 +ddadd313 add 98 -1 -> 97 +ddadd314 add 99 -1 -> 98 +ddadd315 add 100 -1 -> 99 +ddadd316 add 101 -1 -> 100 + +ddadd321 add -0.01 0.01 -> 0.00 +ddadd322 add 0.00 0.01 -> 0.01 +ddadd323 add 0.01 0.01 -> 0.02 +ddadd324 add 0.12 0.01 -> 0.13 +ddadd325 add 0.98 0.01 -> 0.99 +ddadd326 add 0.99 0.01 -> 1.00 +ddadd327 add 1.00 0.01 -> 1.01 +ddadd328 add 1.01 0.01 -> 1.02 +ddadd329 add -0.01 -0.01 -> -0.02 +ddadd330 add 0.00 -0.01 -> -0.01 +ddadd331 add 0.01 -0.01 -> 0.00 +ddadd332 add 0.12 -0.01 -> 0.11 +ddadd333 add 0.98 -0.01 -> 0.97 +ddadd334 add 0.99 -0.01 -> 0.98 +ddadd335 add 1.00 -0.01 -> 0.99 +ddadd336 add 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +ddadd340 add 1E+3 0 -> 1000 +ddadd341 add 1E+15 0 -> 1000000000000000 +ddadd342 add 1E+16 0 -> 1.000000000000000E+16 Rounded +ddadd343 add 1E+20 0 -> 1.000000000000000E+20 Rounded +-- which simply follow from these cases ... +ddadd344 add 1E+3 1 -> 1001 +ddadd345 add 1E+15 1 -> 1000000000000001 +ddadd346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded +ddadd347 add 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded +ddadd348 add 1E+3 7 -> 1007 +ddadd349 add 1E+15 7 -> 1000000000000007 +ddadd350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded +ddadd351 add 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded + +-- tryzeros cases +rounding: half_up +ddadd360 add 0E+50 10000E+1 -> 1.0000E+5 +ddadd361 add 0E-50 10000E+1 -> 100000.0000000000 Rounded +ddadd362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded +ddadd363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact +ddadd364 add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369 + +-- a curiosity from JSR 13 testing +rounding: half_down +ddadd370 add 999999999999999 815 -> 1000000000000814 +ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact +rounding: half_up +ddadd372 add 999999999999999 815 -> 1000000000000814 +ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact +rounding: half_even +ddadd374 add 999999999999999 815 -> 1000000000000814 +ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact + +-- operands folded +ddadd380 add 1E+384 1E+384 -> 2.000000000000000E+384 Clamped +ddadd381 add 1E+380 1E+380 -> 2.00000000000E+380 Clamped +ddadd382 add 1E+376 1E+376 -> 2.0000000E+376 Clamped +ddadd383 add 1E+372 1E+372 -> 2.000E+372 Clamped +ddadd384 add 1E+370 1E+370 -> 2.0E+370 Clamped +ddadd385 add 1E+369 1E+369 -> 2E+369 +ddadd386 add 1E+368 1E+368 -> 2E+368 + +-- ulp replacement tests +ddadd400 add 1 77e-14 -> 1.00000000000077 +ddadd401 add 1 77e-15 -> 1.000000000000077 +ddadd402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded +ddadd403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded +ddadd404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded +ddadd405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded +ddadd406 add 1 77e-299 -> 1.000000000000000 Inexact Rounded + +ddadd410 add 10 77e-14 -> 10.00000000000077 +ddadd411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded +ddadd412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded +ddadd413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded +ddadd414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded +ddadd415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded +ddadd416 add 10 77e-299 -> 10.00000000000000 Inexact Rounded + +ddadd420 add 77e-14 1 -> 1.00000000000077 +ddadd421 add 77e-15 1 -> 1.000000000000077 +ddadd422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded +ddadd423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded +ddadd424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded +ddadd425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded +ddadd426 add 77e-299 1 -> 1.000000000000000 Inexact Rounded + +ddadd430 add 77e-14 10 -> 10.00000000000077 +ddadd431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded +ddadd432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded +ddadd433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded +ddadd434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded +ddadd435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded +ddadd436 add 77e-299 10 -> 10.00000000000000 Inexact Rounded + +-- fastpath boundary (more in dqadd) +-- 1234567890123456 +ddadd539 add '4444444444444444' '3333333333333333' -> '7777777777777777' +ddadd540 add '4444444444444444' '4444444444444444' -> '8888888888888888' +ddadd541 add '4444444444444444' '5555555555555555' -> '9999999999999999' +ddadd542 add '3333333333333333' '4444444444444444' -> '7777777777777777' +ddadd543 add '4444444444444444' '4444444444444444' -> '8888888888888888' +ddadd544 add '5555555555555555' '4444444444444444' -> '9999999999999999' +ddadd545 add '3000004000000000' '3000000000000040' -> '6000004000000040' +ddadd546 add '3000000400000000' '4000000000000400' -> '7000000400000400' +ddadd547 add '3000000040000000' '5000000000004000' -> '8000000040004000' +ddadd548 add '4000000004000000' '3000000000040000' -> '7000000004040000' +ddadd549 add '4000000000400000' '4000000000400000' -> '8000000000800000' +ddadd550 add '4000000000040000' '5000000004000000' -> '9000000004040000' +ddadd551 add '5000000000004000' '3000000040000000' -> '8000000040004000' +ddadd552 add '5000000000000400' '4000000400000000' -> '9000000400000400' +ddadd553 add '5000000000000040' '5000004000000000' -> 1.000000400000004E+16 Rounded +-- check propagation +ddadd554 add '8999999999999999' '0000000000000001' -> 9000000000000000 +ddadd555 add '0000000000000001' '8999999999999999' -> 9000000000000000 +ddadd556 add '0999999999999999' '0000000000000001' -> 1000000000000000 +ddadd557 add '0000000000000001' '0999999999999999' -> 1000000000000000 +ddadd558 add '4444444444444444' '4555555555555556' -> 9000000000000000 +ddadd559 add '4555555555555556' '4444444444444444' -> 9000000000000000 + +-- negative ulps +ddadd6440 add 1 -77e-14 -> 0.99999999999923 +ddadd6441 add 1 -77e-15 -> 0.999999999999923 +ddadd6442 add 1 -77e-16 -> 0.9999999999999923 +ddadd6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded +ddadd6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded +ddadd6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded +ddadd6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded + +ddadd6450 add 10 -77e-14 -> 9.99999999999923 +ddadd6451 add 10 -77e-15 -> 9.999999999999923 +ddadd6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded +ddadd6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded +ddadd6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded +ddadd6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded +ddadd6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded + +ddadd6460 add -77e-14 1 -> 0.99999999999923 +ddadd6461 add -77e-15 1 -> 0.999999999999923 +ddadd6462 add -77e-16 1 -> 0.9999999999999923 +ddadd6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded +ddadd6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded +ddadd6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded +ddadd6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded + +ddadd6470 add -77e-14 10 -> 9.99999999999923 +ddadd6471 add -77e-15 10 -> 9.999999999999923 +ddadd6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded +ddadd6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded +ddadd6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded +ddadd6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded +ddadd6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +ddadd6480 add -1 77e-14 -> -0.99999999999923 +ddadd6481 add -1 77e-15 -> -0.999999999999923 +ddadd6482 add -1 77e-16 -> -0.9999999999999923 +ddadd6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded +ddadd6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded +ddadd6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded +ddadd6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded + +ddadd6490 add -10 77e-14 -> -9.99999999999923 +ddadd6491 add -10 77e-15 -> -9.999999999999923 +ddadd6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded +ddadd6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded +ddadd6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded +ddadd6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded +ddadd6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded + +ddadd6500 add 77e-14 -1 -> -0.99999999999923 +ddadd6501 add 77e-15 -1 -> -0.999999999999923 +ddadd6502 add 77e-16 -1 -> -0.9999999999999923 +ddadd6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded +ddadd6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded +ddadd6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded +ddadd6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded + +ddadd6510 add 77e-14 -10 -> -9.99999999999923 +ddadd6511 add 77e-15 -10 -> -9.999999999999923 +ddadd6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded +ddadd6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded +ddadd6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded +ddadd6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded +ddadd6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded + +-- and some more residue effects and different roundings +rounding: half_up +ddadd6540 add '6543210123456789' 0 -> '6543210123456789' +ddadd6541 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +ddadd6542 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +ddadd6543 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +ddadd6544 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +ddadd6545 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +ddadd6546 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +ddadd6547 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +ddadd6548 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +ddadd6549 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +ddadd6550 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +ddadd6551 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +ddadd6552 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +ddadd6553 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +ddadd6554 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +ddadd6555 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +ddadd6556 add '6543210123456789' 1 -> '6543210123456790' +ddadd6557 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded +ddadd6558 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +ddadd6559 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +rounding: half_even +ddadd6560 add '6543210123456789' 0 -> '6543210123456789' +ddadd6561 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +ddadd6562 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +ddadd6563 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +ddadd6564 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +ddadd6565 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +ddadd6566 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +ddadd6567 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +ddadd6568 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +ddadd6569 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +ddadd6570 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +ddadd6571 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +ddadd6572 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +ddadd6573 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +ddadd6574 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +ddadd6575 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +ddadd6576 add '6543210123456789' 1 -> '6543210123456790' +ddadd6577 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +ddadd6578 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +ddadd6579 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +-- critical few with even bottom digit... +ddadd7540 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded +ddadd7541 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded +ddadd7542 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded + +rounding: down +ddadd7550 add '6543210123456789' 0 -> '6543210123456789' +ddadd7551 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +ddadd7552 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +ddadd7553 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +ddadd7554 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +ddadd7555 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +ddadd7556 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +ddadd7557 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +ddadd7558 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded +ddadd7559 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded +ddadd7560 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded +ddadd7561 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded +ddadd7562 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded +ddadd7563 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded +ddadd7564 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded +ddadd7565 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded +ddadd7566 add '6543210123456789' 1 -> '6543210123456790' +ddadd7567 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +ddadd7568 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +ddadd7569 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +-- verify a query +rounding: down +ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +ddadd7662 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +ddadd7664 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + +-- more zeros, etc. +rounding: half_even + +ddadd7701 add 5.00 1.00E-3 -> 5.00100 +ddadd7702 add 00.00 0.000 -> 0.000 +ddadd7703 add 00.00 0E-3 -> 0.000 +ddadd7704 add 0E-3 00.00 -> 0.000 + +ddadd7710 add 0E+3 00.00 -> 0.00 +ddadd7711 add 0E+3 00.0 -> 0.0 +ddadd7712 add 0E+3 00. -> 0 +ddadd7713 add 0E+3 00.E+1 -> 0E+1 +ddadd7714 add 0E+3 00.E+2 -> 0E+2 +ddadd7715 add 0E+3 00.E+3 -> 0E+3 +ddadd7716 add 0E+3 00.E+4 -> 0E+3 +ddadd7717 add 0E+3 00.E+5 -> 0E+3 +ddadd7718 add 0E+3 -00.0 -> 0.0 +ddadd7719 add 0E+3 -00. -> 0 +ddadd7731 add 0E+3 -00.E+1 -> 0E+1 + +ddadd7720 add 00.00 0E+3 -> 0.00 +ddadd7721 add 00.0 0E+3 -> 0.0 +ddadd7722 add 00. 0E+3 -> 0 +ddadd7723 add 00.E+1 0E+3 -> 0E+1 +ddadd7724 add 00.E+2 0E+3 -> 0E+2 +ddadd7725 add 00.E+3 0E+3 -> 0E+3 +ddadd7726 add 00.E+4 0E+3 -> 0E+3 +ddadd7727 add 00.E+5 0E+3 -> 0E+3 +ddadd7728 add -00.00 0E+3 -> 0.00 +ddadd7729 add -00.0 0E+3 -> 0.0 +ddadd7730 add -00. 0E+3 -> 0 + +ddadd7732 add 0 0 -> 0 +ddadd7733 add 0 -0 -> 0 +ddadd7734 add -0 0 -> 0 +ddadd7735 add -0 -0 -> -0 -- IEEE 854 special case + +ddadd7736 add 1 -1 -> 0 +ddadd7737 add -1 -1 -> -2 +ddadd7738 add 1 1 -> 2 +ddadd7739 add -1 1 -> 0 + +ddadd7741 add 0 -1 -> -1 +ddadd7742 add -0 -1 -> -1 +ddadd7743 add 0 1 -> 1 +ddadd7744 add -0 1 -> 1 +ddadd7745 add -1 0 -> -1 +ddadd7746 add -1 -0 -> -1 +ddadd7747 add 1 0 -> 1 +ddadd7748 add 1 -0 -> 1 + +ddadd7751 add 0.0 -1 -> -1.0 +ddadd7752 add -0.0 -1 -> -1.0 +ddadd7753 add 0.0 1 -> 1.0 +ddadd7754 add -0.0 1 -> 1.0 +ddadd7755 add -1.0 0 -> -1.0 +ddadd7756 add -1.0 -0 -> -1.0 +ddadd7757 add 1.0 0 -> 1.0 +ddadd7758 add 1.0 -0 -> 1.0 + +ddadd7761 add 0 -1.0 -> -1.0 +ddadd7762 add -0 -1.0 -> -1.0 +ddadd7763 add 0 1.0 -> 1.0 +ddadd7764 add -0 1.0 -> 1.0 +ddadd7765 add -1 0.0 -> -1.0 +ddadd7766 add -1 -0.0 -> -1.0 +ddadd7767 add 1 0.0 -> 1.0 +ddadd7768 add 1 -0.0 -> 1.0 + +ddadd7771 add 0.0 -1.0 -> -1.0 +ddadd7772 add -0.0 -1.0 -> -1.0 +ddadd7773 add 0.0 1.0 -> 1.0 +ddadd7774 add -0.0 1.0 -> 1.0 +ddadd7775 add -1.0 0.0 -> -1.0 +ddadd7776 add -1.0 -0.0 -> -1.0 +ddadd7777 add 1.0 0.0 -> 1.0 +ddadd7778 add 1.0 -0.0 -> 1.0 + +-- Specials +ddadd7780 add -Inf -Inf -> -Infinity +ddadd7781 add -Inf -1000 -> -Infinity +ddadd7782 add -Inf -1 -> -Infinity +ddadd7783 add -Inf -0 -> -Infinity +ddadd7784 add -Inf 0 -> -Infinity +ddadd7785 add -Inf 1 -> -Infinity +ddadd7786 add -Inf 1000 -> -Infinity +ddadd7787 add -1000 -Inf -> -Infinity +ddadd7788 add -Inf -Inf -> -Infinity +ddadd7789 add -1 -Inf -> -Infinity +ddadd7790 add -0 -Inf -> -Infinity +ddadd7791 add 0 -Inf -> -Infinity +ddadd7792 add 1 -Inf -> -Infinity +ddadd7793 add 1000 -Inf -> -Infinity +ddadd7794 add Inf -Inf -> NaN Invalid_operation + +ddadd7800 add Inf -Inf -> NaN Invalid_operation +ddadd7801 add Inf -1000 -> Infinity +ddadd7802 add Inf -1 -> Infinity +ddadd7803 add Inf -0 -> Infinity +ddadd7804 add Inf 0 -> Infinity +ddadd7805 add Inf 1 -> Infinity +ddadd7806 add Inf 1000 -> Infinity +ddadd7807 add Inf Inf -> Infinity +ddadd7808 add -1000 Inf -> Infinity +ddadd7809 add -Inf Inf -> NaN Invalid_operation +ddadd7810 add -1 Inf -> Infinity +ddadd7811 add -0 Inf -> Infinity +ddadd7812 add 0 Inf -> Infinity +ddadd7813 add 1 Inf -> Infinity +ddadd7814 add 1000 Inf -> Infinity +ddadd7815 add Inf Inf -> Infinity + +ddadd7821 add NaN -Inf -> NaN +ddadd7822 add NaN -1000 -> NaN +ddadd7823 add NaN -1 -> NaN +ddadd7824 add NaN -0 -> NaN +ddadd7825 add NaN 0 -> NaN +ddadd7826 add NaN 1 -> NaN +ddadd7827 add NaN 1000 -> NaN +ddadd7828 add NaN Inf -> NaN +ddadd7829 add NaN NaN -> NaN +ddadd7830 add -Inf NaN -> NaN +ddadd7831 add -1000 NaN -> NaN +ddadd7832 add -1 NaN -> NaN +ddadd7833 add -0 NaN -> NaN +ddadd7834 add 0 NaN -> NaN +ddadd7835 add 1 NaN -> NaN +ddadd7836 add 1000 NaN -> NaN +ddadd7837 add Inf NaN -> NaN + +ddadd7841 add sNaN -Inf -> NaN Invalid_operation +ddadd7842 add sNaN -1000 -> NaN Invalid_operation +ddadd7843 add sNaN -1 -> NaN Invalid_operation +ddadd7844 add sNaN -0 -> NaN Invalid_operation +ddadd7845 add sNaN 0 -> NaN Invalid_operation +ddadd7846 add sNaN 1 -> NaN Invalid_operation +ddadd7847 add sNaN 1000 -> NaN Invalid_operation +ddadd7848 add sNaN NaN -> NaN Invalid_operation +ddadd7849 add sNaN sNaN -> NaN Invalid_operation +ddadd7850 add NaN sNaN -> NaN Invalid_operation +ddadd7851 add -Inf sNaN -> NaN Invalid_operation +ddadd7852 add -1000 sNaN -> NaN Invalid_operation +ddadd7853 add -1 sNaN -> NaN Invalid_operation +ddadd7854 add -0 sNaN -> NaN Invalid_operation +ddadd7855 add 0 sNaN -> NaN Invalid_operation +ddadd7856 add 1 sNaN -> NaN Invalid_operation +ddadd7857 add 1000 sNaN -> NaN Invalid_operation +ddadd7858 add Inf sNaN -> NaN Invalid_operation +ddadd7859 add NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddadd7861 add NaN1 -Inf -> NaN1 +ddadd7862 add +NaN2 -1000 -> NaN2 +ddadd7863 add NaN3 1000 -> NaN3 +ddadd7864 add NaN4 Inf -> NaN4 +ddadd7865 add NaN5 +NaN6 -> NaN5 +ddadd7866 add -Inf NaN7 -> NaN7 +ddadd7867 add -1000 NaN8 -> NaN8 +ddadd7868 add 1000 NaN9 -> NaN9 +ddadd7869 add Inf +NaN10 -> NaN10 +ddadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation +ddadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation +ddadd7873 add sNaN13 1000 -> NaN13 Invalid_operation +ddadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation +ddadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation +ddadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation +ddadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation +ddadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation +ddadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation +ddadd7880 add Inf sNaN23 -> NaN23 Invalid_operation +ddadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation +ddadd7882 add -NaN26 NaN28 -> -NaN26 +ddadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation +ddadd7884 add 1000 -NaN30 -> -NaN30 +ddadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Here we explore near the boundary of rounding a subnormal to Nmin +ddadd7575 add 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal +ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal + +-- and another curious case +ddadd7577 add 7.000000000000E-385 -1.00000E-391 -> 6.999999000000E-385 Subnormal + +-- check overflow edge case +-- 1234567890123456 +ddadd7972 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +ddadd7973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded +ddadd7974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded +ddadd7975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded +ddadd7976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded +ddadd7977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded +ddadd7978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded +ddadd7979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded +ddadd7980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded +ddadd7981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded +ddadd7982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded +ddadd7983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded +ddadd7984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded + +ddadd7985 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +ddadd7986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded +ddadd7987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded +ddadd7988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded +ddadd7989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded +ddadd7990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded +ddadd7991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded +ddadd7992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded +ddadd7993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded +ddadd7994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded +ddadd7995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded +ddadd7996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded +ddadd7997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +ddadd71100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +ddadd71101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +ddadd71103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +ddadd71104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +ddadd71105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +ddadd71106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +ddadd71107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +ddadd71108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +ddadd71109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +ddadd71110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +ddadd71111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +ddadd71113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +ddadd71114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +ddadd71115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +ddadd71116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +ddadd71117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +ddadd71118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +ddadd71119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +ddadd71300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +ddadd71310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded +ddadd71311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded +ddadd71312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +ddadd71313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +ddadd71314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +ddadd71315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +ddadd71316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +ddadd71317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +ddadd71318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +ddadd71319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +ddadd71320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +ddadd71321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +ddadd71322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +ddadd71323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +ddadd71324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +ddadd71325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +ddadd71339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +ddadd71340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +ddadd71341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +ddadd71349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +ddadd71350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +ddadd71351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +ddadd71352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +ddadd71353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +ddadd71354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +ddadd71355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +ddadd71356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +ddadd71357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +ddadd71358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +ddadd71359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +ddadd71360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +ddadd71361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +ddadd71362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +ddadd71363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +ddadd71364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +ddadd71365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +ddadd71379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +ddadd71380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +ddadd71381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +ddadd71382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +ddadd71395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +ddadd71396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +ddadd71420 add 0 1.123456789012345 -> 1.123456789012345 +ddadd71421 add 0 1.123456789012345E-1 -> 0.1123456789012345 +ddadd71422 add 0 1.123456789012345E-2 -> 0.01123456789012345 +ddadd71423 add 0 1.123456789012345E-3 -> 0.001123456789012345 +ddadd71424 add 0 1.123456789012345E-4 -> 0.0001123456789012345 +ddadd71425 add 0 1.123456789012345E-5 -> 0.00001123456789012345 +ddadd71426 add 0 1.123456789012345E-6 -> 0.000001123456789012345 +ddadd71427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7 +ddadd71428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8 +ddadd71429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9 +ddadd71430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10 +ddadd71431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11 +ddadd71432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12 +ddadd71433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13 +ddadd71434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14 +ddadd71435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15 +ddadd71436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16 +ddadd71437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17 +ddadd71438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18 +ddadd71439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +ddadd71440 add 1.123456789012345 0 -> 1.123456789012345 +ddadd71441 add 1.123456789012345E-1 0 -> 0.1123456789012345 +ddadd71442 add 1.123456789012345E-2 0 -> 0.01123456789012345 +ddadd71443 add 1.123456789012345E-3 0 -> 0.001123456789012345 +ddadd71444 add 1.123456789012345E-4 0 -> 0.0001123456789012345 +ddadd71445 add 1.123456789012345E-5 0 -> 0.00001123456789012345 +ddadd71446 add 1.123456789012345E-6 0 -> 0.000001123456789012345 +ddadd71447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7 +ddadd71448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8 +ddadd71449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9 +ddadd71450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10 +ddadd71451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11 +ddadd71452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12 +ddadd71453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13 +ddadd71454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14 +ddadd71455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15 +ddadd71456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16 +ddadd71457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17 +ddadd71458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18 +ddadd71459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +ddadd71460 add 1.123456789012345 0E-0 -> 1.123456789012345 +ddadd71461 add 1.123456789012345 0E-1 -> 1.123456789012345 +ddadd71462 add 1.123456789012345 0E-2 -> 1.123456789012345 +ddadd71463 add 1.123456789012345 0E-3 -> 1.123456789012345 +ddadd71464 add 1.123456789012345 0E-4 -> 1.123456789012345 +ddadd71465 add 1.123456789012345 0E-5 -> 1.123456789012345 +ddadd71466 add 1.123456789012345 0E-6 -> 1.123456789012345 +ddadd71467 add 1.123456789012345 0E-7 -> 1.123456789012345 +ddadd71468 add 1.123456789012345 0E-8 -> 1.123456789012345 +ddadd71469 add 1.123456789012345 0E-9 -> 1.123456789012345 +ddadd71470 add 1.123456789012345 0E-10 -> 1.123456789012345 +ddadd71471 add 1.123456789012345 0E-11 -> 1.123456789012345 +ddadd71472 add 1.123456789012345 0E-12 -> 1.123456789012345 +ddadd71473 add 1.123456789012345 0E-13 -> 1.123456789012345 +ddadd71474 add 1.123456789012345 0E-14 -> 1.123456789012345 +ddadd71475 add 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded because the 0 extends the result +ddadd71476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +ddadd71477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +ddadd71478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +ddadd71479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +ddadd71500 add 0 0E-19 -> 0E-19 +ddadd71501 add -0 0E-19 -> 0E-19 +ddadd71502 add 0 -0E-19 -> 0E-19 +ddadd71503 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71511 add -11 11 -> 0 +ddadd71512 add 11 -11 -> 0 + +rounding: half_down +-- exact zeros from zeros +ddadd71520 add 0 0E-19 -> 0E-19 +ddadd71521 add -0 0E-19 -> 0E-19 +ddadd71522 add 0 -0E-19 -> 0E-19 +ddadd71523 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71531 add -11 11 -> 0 +ddadd71532 add 11 -11 -> 0 + +rounding: half_even +-- exact zeros from zeros +ddadd71540 add 0 0E-19 -> 0E-19 +ddadd71541 add -0 0E-19 -> 0E-19 +ddadd71542 add 0 -0E-19 -> 0E-19 +ddadd71543 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71551 add -11 11 -> 0 +ddadd71552 add 11 -11 -> 0 + +rounding: up +-- exact zeros from zeros +ddadd71560 add 0 0E-19 -> 0E-19 +ddadd71561 add -0 0E-19 -> 0E-19 +ddadd71562 add 0 -0E-19 -> 0E-19 +ddadd71563 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71571 add -11 11 -> 0 +ddadd71572 add 11 -11 -> 0 + +rounding: down +-- exact zeros from zeros +ddadd71580 add 0 0E-19 -> 0E-19 +ddadd71581 add -0 0E-19 -> 0E-19 +ddadd71582 add 0 -0E-19 -> 0E-19 +ddadd71583 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71591 add -11 11 -> 0 +ddadd71592 add 11 -11 -> 0 + +rounding: ceiling +-- exact zeros from zeros +ddadd71600 add 0 0E-19 -> 0E-19 +ddadd71601 add -0 0E-19 -> 0E-19 +ddadd71602 add 0 -0E-19 -> 0E-19 +ddadd71603 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71611 add -11 11 -> 0 +ddadd71612 add 11 -11 -> 0 + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +ddadd71620 add 0 0E-19 -> 0E-19 +ddadd71621 add -0 0E-19 -> -0E-19 -- * +ddadd71622 add 0 -0E-19 -> -0E-19 -- * +ddadd71623 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddadd71631 add -11 11 -> -0 -- * +ddadd71632 add 11 -11 -> -0 -- * + +-- Examples from SQL proposal (Krishna Kulkarni) +ddadd71701 add 130E-2 120E-2 -> 2.50 +ddadd71702 add 130E-2 12E-1 -> 2.50 +ddadd71703 add 130E-2 1E0 -> 2.30 +ddadd71704 add 1E2 1E4 -> 1.01E+4 +ddadd71705 add 130E-2 -120E-2 -> 0.10 +ddadd71706 add 130E-2 -12E-1 -> 0.10 +ddadd71707 add 130E-2 -1E0 -> 0.30 +ddadd71708 add 1E2 -1E4 -> -9.9E+3 + +-- query from Vincent Kulandaisamy +rounding: ceiling +ddadd71801 add 7.8822773805862E+277 -5.1757503820663E-21 -> 7.882277380586200E+277 Inexact Rounded +ddadd71802 add 7.882277380586200E+277 12.341 -> 7.882277380586201E+277 Inexact Rounded +ddadd71803 add 7.882277380586201E+277 2.7270545046613E-31 -> 7.882277380586202E+277 Inexact Rounded + +ddadd71811 add 12.341 -5.1757503820663E-21 -> 12.34100000000000 Inexact Rounded +ddadd71812 add 12.34100000000000 2.7270545046613E-31 -> 12.34100000000001 Inexact Rounded +ddadd71813 add 12.34100000000001 7.8822773805862E+277 -> 7.882277380586201E+277 Inexact Rounded + +-- Gappy coefficients; check residue handling even with full coefficient gap +rounding: half_even + +ddadd75001 add 1234567890123456 1 -> 1234567890123457 +ddadd75002 add 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded +ddadd75003 add 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded +ddadd75004 add 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded +ddadd75005 add 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded +ddadd75006 add 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded +ddadd75007 add 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded +ddadd75008 add 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded +ddadd75009 add 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded +ddadd75010 add 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded +ddadd75011 add 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded +ddadd75012 add 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded +ddadd75013 add 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded +ddadd75014 add 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded +ddadd75015 add 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded +ddadd75016 add 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded +ddadd75017 add 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded +ddadd75018 add 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded +ddadd75019 add 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded +ddadd75020 add 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded +ddadd75021 add 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded + +-- widening second argument at gap +ddadd75030 add 12345678 1 -> 12345679 +ddadd75031 add 12345678 0.1 -> 12345678.1 +ddadd75032 add 12345678 0.12 -> 12345678.12 +ddadd75033 add 12345678 0.123 -> 12345678.123 +ddadd75034 add 12345678 0.1234 -> 12345678.1234 +ddadd75035 add 12345678 0.12345 -> 12345678.12345 +ddadd75036 add 12345678 0.123456 -> 12345678.123456 +ddadd75037 add 12345678 0.1234567 -> 12345678.1234567 +ddadd75038 add 12345678 0.12345678 -> 12345678.12345678 +ddadd75039 add 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded +ddadd75040 add 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded +ddadd75041 add 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded +ddadd75042 add 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded +ddadd75043 add 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded +ddadd75044 add 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded +ddadd75045 add 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded +ddadd75046 add 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded +ddadd75047 add 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded +ddadd75048 add 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded +ddadd75049 add 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded +-- 90123456 +rounding: half_even +ddadd75050 add 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded +ddadd75051 add 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded +ddadd75052 add 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded +ddadd75053 add 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded +ddadd75054 add 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded +ddadd75055 add 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded +ddadd75056 add 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded +ddadd75057 add 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded +ddadd75060 add 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded +ddadd75061 add 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded +ddadd75062 add 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded +ddadd75063 add 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded +ddadd75064 add 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded +ddadd75065 add 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded +ddadd75066 add 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded +ddadd75067 add 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded +-- far-out residues (full coefficient gap is 16+15 digits) +rounding: up +ddadd75070 add 12345678 1E-8 -> 12345678.00000001 +ddadd75071 add 12345678 1E-9 -> 12345678.00000001 Inexact Rounded +ddadd75072 add 12345678 1E-10 -> 12345678.00000001 Inexact Rounded +ddadd75073 add 12345678 1E-11 -> 12345678.00000001 Inexact Rounded +ddadd75074 add 12345678 1E-12 -> 12345678.00000001 Inexact Rounded +ddadd75075 add 12345678 1E-13 -> 12345678.00000001 Inexact Rounded +ddadd75076 add 12345678 1E-14 -> 12345678.00000001 Inexact Rounded +ddadd75077 add 12345678 1E-15 -> 12345678.00000001 Inexact Rounded +ddadd75078 add 12345678 1E-16 -> 12345678.00000001 Inexact Rounded +ddadd75079 add 12345678 1E-17 -> 12345678.00000001 Inexact Rounded +ddadd75080 add 12345678 1E-18 -> 12345678.00000001 Inexact Rounded +ddadd75081 add 12345678 1E-19 -> 12345678.00000001 Inexact Rounded +ddadd75082 add 12345678 1E-20 -> 12345678.00000001 Inexact Rounded +ddadd75083 add 12345678 1E-25 -> 12345678.00000001 Inexact Rounded +ddadd75084 add 12345678 1E-30 -> 12345678.00000001 Inexact Rounded +ddadd75085 add 12345678 1E-31 -> 12345678.00000001 Inexact Rounded +ddadd75086 add 12345678 1E-32 -> 12345678.00000001 Inexact Rounded +ddadd75087 add 12345678 1E-33 -> 12345678.00000001 Inexact Rounded +ddadd75088 add 12345678 1E-34 -> 12345678.00000001 Inexact Rounded +ddadd75089 add 12345678 1E-35 -> 12345678.00000001 Inexact Rounded + +-- Punit's +ddadd75100 add 1.000 -200.000 -> -199.000 + +-- Rounding swathe +rounding: half_even +ddadd81100 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81101 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81102 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81103 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81104 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81105 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81106 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81107 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81108 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81109 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81120 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded +ddadd81121 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded + +rounding: half_up +ddadd81200 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81201 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81202 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81203 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81204 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81205 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81206 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81207 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81208 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81209 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81220 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded +ddadd81221 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded + +rounding: half_down +ddadd81300 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81301 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81302 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81303 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81304 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81305 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81306 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81307 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81308 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81309 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81320 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded +ddadd81321 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded + +rounding: up +ddadd81400 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81401 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81402 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81403 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81404 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81405 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81406 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81407 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81408 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81409 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81411 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded +ddadd81420 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded +ddadd81421 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded + +rounding: down +ddadd81500 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81501 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81502 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81503 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81504 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81505 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81506 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81507 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81508 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81509 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81511 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded +ddadd81520 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded +ddadd81521 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded + +rounding: ceiling +ddadd81600 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81601 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81602 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81603 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81604 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81605 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81606 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded +ddadd81607 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81608 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81609 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81611 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded +ddadd81620 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded +ddadd81621 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded + +rounding: floor +ddadd81700 add .2300 12345678901234.00 -> 12345678901234.23 Rounded +ddadd81701 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81702 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81703 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81704 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81705 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81706 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd81707 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81708 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81709 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded +ddadd81711 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded +ddadd81720 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded +ddadd81721 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded + +rounding: 05up +ddadd81800 add .2000 12345678901234.00 -> 12345678901234.20 Rounded +ddadd81801 add .2001 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81802 add .2010 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81803 add .2050 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81804 add .2051 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81807 add .2060 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81808 add .2070 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81809 add .2099 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81811 add -.2099 -12345678901234.00 -> -12345678901234.21 Inexact Rounded +ddadd81820 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded +ddadd81821 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded + +ddadd81900 add .2100 12345678901234.00 -> 12345678901234.21 Rounded +ddadd81901 add .2101 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81902 add .2110 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81903 add .2150 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81904 add .2151 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81907 add .2160 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81908 add .2170 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81909 add .2199 12345678901234.00 -> 12345678901234.21 Inexact Rounded +ddadd81911 add -.2199 -12345678901234.00 -> -12345678901234.21 Inexact Rounded + +ddadd82000 add .2400 12345678901234.00 -> 12345678901234.24 Rounded +ddadd82001 add .2401 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82002 add .2410 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82003 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82004 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82007 add .2460 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82008 add .2470 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82009 add .2499 12345678901234.00 -> 12345678901234.24 Inexact Rounded +ddadd82011 add -.2499 -12345678901234.00 -> -12345678901234.24 Inexact Rounded + +ddadd82100 add .2500 12345678901234.00 -> 12345678901234.25 Rounded +ddadd82101 add .2501 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82102 add .2510 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82103 add .2550 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82104 add .2551 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82107 add .2560 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82108 add .2570 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82109 add .2599 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82111 add -.2599 -12345678901234.00 -> -12345678901234.26 Inexact Rounded + +ddadd82200 add .2600 12345678901234.00 -> 12345678901234.26 Rounded +ddadd82201 add .2601 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82202 add .2610 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82203 add .2650 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82204 add .2651 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82207 add .2660 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82208 add .2670 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82209 add .2699 12345678901234.00 -> 12345678901234.26 Inexact Rounded +ddadd82211 add -.2699 -12345678901234.00 -> -12345678901234.26 Inexact Rounded + +ddadd82300 add .2900 12345678901234.00 -> 12345678901234.29 Rounded +ddadd82301 add .2901 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82302 add .2910 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82303 add .2950 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82304 add .2951 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82307 add .2960 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82308 add .2970 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82309 add .2999 12345678901234.00 -> 12345678901234.29 Inexact Rounded +ddadd82311 add -.2999 -12345678901234.00 -> -12345678901234.29 Inexact Rounded + +-- Null tests +ddadd9990 add 10 # -> NaN Invalid_operation +ddadd9991 add # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAnd.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddAnd.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,347 @@ +------------------------------------------------------------------------ +-- ddAnd.decTest -- digitwise logical AND for decDoubles -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check (truth table) +ddand001 and 0 0 -> 0 +ddand002 and 0 1 -> 0 +ddand003 and 1 0 -> 0 +ddand004 and 1 1 -> 1 +ddand005 and 1100 1010 -> 1000 +-- and at msd and msd-1 +-- 1234567890123456 1234567890123456 1234567890123456 +ddand006 and 0000000000000000 0000000000000000 -> 0 +ddand007 and 0000000000000000 1000000000000000 -> 0 +ddand008 and 1000000000000000 0000000000000000 -> 0 +ddand009 and 1000000000000000 1000000000000000 -> 1000000000000000 +ddand010 and 0000000000000000 0000000000000000 -> 0 +ddand011 and 0000000000000000 0100000000000000 -> 0 +ddand012 and 0100000000000000 0000000000000000 -> 0 +ddand013 and 0100000000000000 0100000000000000 -> 100000000000000 + +-- Various lengths +-- 1234567890123456 1234567890123456 1234567890123456 +ddand021 and 1111111111111111 1111111111111111 -> 1111111111111111 +ddand024 and 1111111111111111 111111111111111 -> 111111111111111 +ddand025 and 1111111111111111 11111111111111 -> 11111111111111 +ddand026 and 1111111111111111 1111111111111 -> 1111111111111 +ddand027 and 1111111111111111 111111111111 -> 111111111111 +ddand028 and 1111111111111111 11111111111 -> 11111111111 +ddand029 and 1111111111111111 1111111111 -> 1111111111 +ddand030 and 1111111111111111 111111111 -> 111111111 +ddand031 and 1111111111111111 11111111 -> 11111111 +ddand032 and 1111111111111111 1111111 -> 1111111 +ddand033 and 1111111111111111 111111 -> 111111 +ddand034 and 1111111111111111 11111 -> 11111 +ddand035 and 1111111111111111 1111 -> 1111 +ddand036 and 1111111111111111 111 -> 111 +ddand037 and 1111111111111111 11 -> 11 +ddand038 and 1111111111111111 1 -> 1 +ddand039 and 1111111111111111 0 -> 0 + +ddand040 and 1111111111111111 1111111111111111 -> 1111111111111111 +ddand041 and 111111111111111 1111111111111111 -> 111111111111111 +ddand042 and 111111111111111 1111111111111111 -> 111111111111111 +ddand043 and 11111111111111 1111111111111111 -> 11111111111111 +ddand044 and 1111111111111 1111111111111111 -> 1111111111111 +ddand045 and 111111111111 1111111111111111 -> 111111111111 +ddand046 and 11111111111 1111111111111111 -> 11111111111 +ddand047 and 1111111111 1111111111111111 -> 1111111111 +ddand048 and 111111111 1111111111111111 -> 111111111 +ddand049 and 11111111 1111111111111111 -> 11111111 +ddand050 and 1111111 1111111111111111 -> 1111111 +ddand051 and 111111 1111111111111111 -> 111111 +ddand052 and 11111 1111111111111111 -> 11111 +ddand053 and 1111 1111111111111111 -> 1111 +ddand054 and 111 1111111111111111 -> 111 +ddand055 and 11 1111111111111111 -> 11 +ddand056 and 1 1111111111111111 -> 1 +ddand057 and 0 1111111111111111 -> 0 + +ddand150 and 1111111111 1 -> 1 +ddand151 and 111111111 1 -> 1 +ddand152 and 11111111 1 -> 1 +ddand153 and 1111111 1 -> 1 +ddand154 and 111111 1 -> 1 +ddand155 and 11111 1 -> 1 +ddand156 and 1111 1 -> 1 +ddand157 and 111 1 -> 1 +ddand158 and 11 1 -> 1 +ddand159 and 1 1 -> 1 + +ddand160 and 1111111111 0 -> 0 +ddand161 and 111111111 0 -> 0 +ddand162 and 11111111 0 -> 0 +ddand163 and 1111111 0 -> 0 +ddand164 and 111111 0 -> 0 +ddand165 and 11111 0 -> 0 +ddand166 and 1111 0 -> 0 +ddand167 and 111 0 -> 0 +ddand168 and 11 0 -> 0 +ddand169 and 1 0 -> 0 + +ddand170 and 1 1111111111 -> 1 +ddand171 and 1 111111111 -> 1 +ddand172 and 1 11111111 -> 1 +ddand173 and 1 1111111 -> 1 +ddand174 and 1 111111 -> 1 +ddand175 and 1 11111 -> 1 +ddand176 and 1 1111 -> 1 +ddand177 and 1 111 -> 1 +ddand178 and 1 11 -> 1 +ddand179 and 1 1 -> 1 + +ddand180 and 0 1111111111 -> 0 +ddand181 and 0 111111111 -> 0 +ddand182 and 0 11111111 -> 0 +ddand183 and 0 1111111 -> 0 +ddand184 and 0 111111 -> 0 +ddand185 and 0 11111 -> 0 +ddand186 and 0 1111 -> 0 +ddand187 and 0 111 -> 0 +ddand188 and 0 11 -> 0 +ddand189 and 0 1 -> 0 + +ddand090 and 011111111 111111111 -> 11111111 +ddand091 and 101111111 111111111 -> 101111111 +ddand092 and 110111111 111111111 -> 110111111 +ddand093 and 111011111 111111111 -> 111011111 +ddand094 and 111101111 111111111 -> 111101111 +ddand095 and 111110111 111111111 -> 111110111 +ddand096 and 111111011 111111111 -> 111111011 +ddand097 and 111111101 111111111 -> 111111101 +ddand098 and 111111110 111111111 -> 111111110 + +ddand100 and 111111111 011111111 -> 11111111 +ddand101 and 111111111 101111111 -> 101111111 +ddand102 and 111111111 110111111 -> 110111111 +ddand103 and 111111111 111011111 -> 111011111 +ddand104 and 111111111 111101111 -> 111101111 +ddand105 and 111111111 111110111 -> 111110111 +ddand106 and 111111111 111111011 -> 111111011 +ddand107 and 111111111 111111101 -> 111111101 +ddand108 and 111111111 111111110 -> 111111110 + +-- non-0/1 should not be accepted, nor should signs +ddand220 and 111111112 111111111 -> NaN Invalid_operation +ddand221 and 333333333 333333333 -> NaN Invalid_operation +ddand222 and 555555555 555555555 -> NaN Invalid_operation +ddand223 and 777777777 777777777 -> NaN Invalid_operation +ddand224 and 999999999 999999999 -> NaN Invalid_operation +ddand225 and 222222222 999999999 -> NaN Invalid_operation +ddand226 and 444444444 999999999 -> NaN Invalid_operation +ddand227 and 666666666 999999999 -> NaN Invalid_operation +ddand228 and 888888888 999999999 -> NaN Invalid_operation +ddand229 and 999999999 222222222 -> NaN Invalid_operation +ddand230 and 999999999 444444444 -> NaN Invalid_operation +ddand231 and 999999999 666666666 -> NaN Invalid_operation +ddand232 and 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +ddand240 and 567468689 -934981942 -> NaN Invalid_operation +ddand241 and 567367689 934981942 -> NaN Invalid_operation +ddand242 and -631917772 -706014634 -> NaN Invalid_operation +ddand243 and -756253257 138579234 -> NaN Invalid_operation +ddand244 and 835590149 567435400 -> NaN Invalid_operation +-- test MSD +ddand250 and 2000000000000000 1000000000000000 -> NaN Invalid_operation +ddand251 and 7000000000000000 1000000000000000 -> NaN Invalid_operation +ddand252 and 8000000000000000 1000000000000000 -> NaN Invalid_operation +ddand253 and 9000000000000000 1000000000000000 -> NaN Invalid_operation +ddand254 and 2000000000000000 0000000000000000 -> NaN Invalid_operation +ddand255 and 7000000000000000 0000000000000000 -> NaN Invalid_operation +ddand256 and 8000000000000000 0000000000000000 -> NaN Invalid_operation +ddand257 and 9000000000000000 0000000000000000 -> NaN Invalid_operation +ddand258 and 1000000000000000 2000000000000000 -> NaN Invalid_operation +ddand259 and 1000000000000000 7000000000000000 -> NaN Invalid_operation +ddand260 and 1000000000000000 8000000000000000 -> NaN Invalid_operation +ddand261 and 1000000000000000 9000000000000000 -> NaN Invalid_operation +ddand262 and 0000000000000000 2000000000000000 -> NaN Invalid_operation +ddand263 and 0000000000000000 7000000000000000 -> NaN Invalid_operation +ddand264 and 0000000000000000 8000000000000000 -> NaN Invalid_operation +ddand265 and 0000000000000000 9000000000000000 -> NaN Invalid_operation +-- test MSD-1 +ddand270 and 0200001000000000 1000100000000010 -> NaN Invalid_operation +ddand271 and 0700000100000000 1000010000000100 -> NaN Invalid_operation +ddand272 and 0800000010000000 1000001000001000 -> NaN Invalid_operation +ddand273 and 0900000001000000 1000000100010000 -> NaN Invalid_operation +ddand274 and 1000000000100000 0200000010100000 -> NaN Invalid_operation +ddand275 and 1000000000010000 0700000001000000 -> NaN Invalid_operation +ddand276 and 1000000000001000 0800000010100000 -> NaN Invalid_operation +ddand277 and 1000000000000100 0900000000010000 -> NaN Invalid_operation +-- test LSD +ddand280 and 0010000000000002 1000000100000001 -> NaN Invalid_operation +ddand281 and 0001000000000007 1000001000000011 -> NaN Invalid_operation +ddand282 and 0000100000000008 1000010000000001 -> NaN Invalid_operation +ddand283 and 0000010000000009 1000100000000001 -> NaN Invalid_operation +ddand284 and 1000001000000000 0001000000000002 -> NaN Invalid_operation +ddand285 and 1000000100000000 0010000000000007 -> NaN Invalid_operation +ddand286 and 1000000010000000 0100000000000008 -> NaN Invalid_operation +ddand287 and 1000000001000000 1000000000000009 -> NaN Invalid_operation +-- test Middie +ddand288 and 0010000020000000 1000001000000000 -> NaN Invalid_operation +ddand289 and 0001000070000001 1000000100000000 -> NaN Invalid_operation +ddand290 and 0000100080000010 1000000010000000 -> NaN Invalid_operation +ddand291 and 0000010090000100 1000000001000000 -> NaN Invalid_operation +ddand292 and 1000001000001000 0000000020100000 -> NaN Invalid_operation +ddand293 and 1000000100010000 0000000070010000 -> NaN Invalid_operation +ddand294 and 1000000010100000 0000000080001000 -> NaN Invalid_operation +ddand295 and 1000000001000000 0000000090000100 -> NaN Invalid_operation +-- signs +ddand296 and -1000000001000000 -0000010000000100 -> NaN Invalid_operation +ddand297 and -1000000001000000 0000000010000100 -> NaN Invalid_operation +ddand298 and 1000000001000000 -0000001000000100 -> NaN Invalid_operation +ddand299 and 1000000001000000 0000000011000100 -> 1000000 + +-- Nmax, Nmin, Ntiny-like +ddand331 and 2 9.99999999E+199 -> NaN Invalid_operation +ddand332 and 3 1E-199 -> NaN Invalid_operation +ddand333 and 4 1.00000000E-199 -> NaN Invalid_operation +ddand334 and 5 1E-100 -> NaN Invalid_operation +ddand335 and 6 -1E-100 -> NaN Invalid_operation +ddand336 and 7 -1.00000000E-199 -> NaN Invalid_operation +ddand337 and 8 -1E-199 -> NaN Invalid_operation +ddand338 and 9 -9.99999999E+199 -> NaN Invalid_operation +ddand341 and 9.99999999E+199 -18 -> NaN Invalid_operation +ddand342 and 1E-199 01 -> NaN Invalid_operation +ddand343 and 1.00000000E-199 -18 -> NaN Invalid_operation +ddand344 and 1E-100 18 -> NaN Invalid_operation +ddand345 and -1E-100 -10 -> NaN Invalid_operation +ddand346 and -1.00000000E-199 18 -> NaN Invalid_operation +ddand347 and -1E-199 10 -> NaN Invalid_operation +ddand348 and -9.99999999E+199 -18 -> NaN Invalid_operation + +-- A few other non-integers +ddand361 and 1.0 1 -> NaN Invalid_operation +ddand362 and 1E+1 1 -> NaN Invalid_operation +ddand363 and 0.0 1 -> NaN Invalid_operation +ddand364 and 0E+1 1 -> NaN Invalid_operation +ddand365 and 9.9 1 -> NaN Invalid_operation +ddand366 and 9E+1 1 -> NaN Invalid_operation +ddand371 and 0 1.0 -> NaN Invalid_operation +ddand372 and 0 1E+1 -> NaN Invalid_operation +ddand373 and 0 0.0 -> NaN Invalid_operation +ddand374 and 0 0E+1 -> NaN Invalid_operation +ddand375 and 0 9.9 -> NaN Invalid_operation +ddand376 and 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +ddand780 and -Inf -Inf -> NaN Invalid_operation +ddand781 and -Inf -1000 -> NaN Invalid_operation +ddand782 and -Inf -1 -> NaN Invalid_operation +ddand783 and -Inf -0 -> NaN Invalid_operation +ddand784 and -Inf 0 -> NaN Invalid_operation +ddand785 and -Inf 1 -> NaN Invalid_operation +ddand786 and -Inf 1000 -> NaN Invalid_operation +ddand787 and -1000 -Inf -> NaN Invalid_operation +ddand788 and -Inf -Inf -> NaN Invalid_operation +ddand789 and -1 -Inf -> NaN Invalid_operation +ddand790 and -0 -Inf -> NaN Invalid_operation +ddand791 and 0 -Inf -> NaN Invalid_operation +ddand792 and 1 -Inf -> NaN Invalid_operation +ddand793 and 1000 -Inf -> NaN Invalid_operation +ddand794 and Inf -Inf -> NaN Invalid_operation + +ddand800 and Inf -Inf -> NaN Invalid_operation +ddand801 and Inf -1000 -> NaN Invalid_operation +ddand802 and Inf -1 -> NaN Invalid_operation +ddand803 and Inf -0 -> NaN Invalid_operation +ddand804 and Inf 0 -> NaN Invalid_operation +ddand805 and Inf 1 -> NaN Invalid_operation +ddand806 and Inf 1000 -> NaN Invalid_operation +ddand807 and Inf Inf -> NaN Invalid_operation +ddand808 and -1000 Inf -> NaN Invalid_operation +ddand809 and -Inf Inf -> NaN Invalid_operation +ddand810 and -1 Inf -> NaN Invalid_operation +ddand811 and -0 Inf -> NaN Invalid_operation +ddand812 and 0 Inf -> NaN Invalid_operation +ddand813 and 1 Inf -> NaN Invalid_operation +ddand814 and 1000 Inf -> NaN Invalid_operation +ddand815 and Inf Inf -> NaN Invalid_operation + +ddand821 and NaN -Inf -> NaN Invalid_operation +ddand822 and NaN -1000 -> NaN Invalid_operation +ddand823 and NaN -1 -> NaN Invalid_operation +ddand824 and NaN -0 -> NaN Invalid_operation +ddand825 and NaN 0 -> NaN Invalid_operation +ddand826 and NaN 1 -> NaN Invalid_operation +ddand827 and NaN 1000 -> NaN Invalid_operation +ddand828 and NaN Inf -> NaN Invalid_operation +ddand829 and NaN NaN -> NaN Invalid_operation +ddand830 and -Inf NaN -> NaN Invalid_operation +ddand831 and -1000 NaN -> NaN Invalid_operation +ddand832 and -1 NaN -> NaN Invalid_operation +ddand833 and -0 NaN -> NaN Invalid_operation +ddand834 and 0 NaN -> NaN Invalid_operation +ddand835 and 1 NaN -> NaN Invalid_operation +ddand836 and 1000 NaN -> NaN Invalid_operation +ddand837 and Inf NaN -> NaN Invalid_operation + +ddand841 and sNaN -Inf -> NaN Invalid_operation +ddand842 and sNaN -1000 -> NaN Invalid_operation +ddand843 and sNaN -1 -> NaN Invalid_operation +ddand844 and sNaN -0 -> NaN Invalid_operation +ddand845 and sNaN 0 -> NaN Invalid_operation +ddand846 and sNaN 1 -> NaN Invalid_operation +ddand847 and sNaN 1000 -> NaN Invalid_operation +ddand848 and sNaN NaN -> NaN Invalid_operation +ddand849 and sNaN sNaN -> NaN Invalid_operation +ddand850 and NaN sNaN -> NaN Invalid_operation +ddand851 and -Inf sNaN -> NaN Invalid_operation +ddand852 and -1000 sNaN -> NaN Invalid_operation +ddand853 and -1 sNaN -> NaN Invalid_operation +ddand854 and -0 sNaN -> NaN Invalid_operation +ddand855 and 0 sNaN -> NaN Invalid_operation +ddand856 and 1 sNaN -> NaN Invalid_operation +ddand857 and 1000 sNaN -> NaN Invalid_operation +ddand858 and Inf sNaN -> NaN Invalid_operation +ddand859 and NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddand861 and NaN1 -Inf -> NaN Invalid_operation +ddand862 and +NaN2 -1000 -> NaN Invalid_operation +ddand863 and NaN3 1000 -> NaN Invalid_operation +ddand864 and NaN4 Inf -> NaN Invalid_operation +ddand865 and NaN5 +NaN6 -> NaN Invalid_operation +ddand866 and -Inf NaN7 -> NaN Invalid_operation +ddand867 and -1000 NaN8 -> NaN Invalid_operation +ddand868 and 1000 NaN9 -> NaN Invalid_operation +ddand869 and Inf +NaN10 -> NaN Invalid_operation +ddand871 and sNaN11 -Inf -> NaN Invalid_operation +ddand872 and sNaN12 -1000 -> NaN Invalid_operation +ddand873 and sNaN13 1000 -> NaN Invalid_operation +ddand874 and sNaN14 NaN17 -> NaN Invalid_operation +ddand875 and sNaN15 sNaN18 -> NaN Invalid_operation +ddand876 and NaN16 sNaN19 -> NaN Invalid_operation +ddand877 and -Inf +sNaN20 -> NaN Invalid_operation +ddand878 and -1000 sNaN21 -> NaN Invalid_operation +ddand879 and 1000 sNaN22 -> NaN Invalid_operation +ddand880 and Inf sNaN23 -> NaN Invalid_operation +ddand881 and +NaN25 +sNaN24 -> NaN Invalid_operation +ddand882 and -NaN26 NaN28 -> NaN Invalid_operation +ddand883 and -sNaN27 sNaN29 -> NaN Invalid_operation +ddand884 and 1000 -NaN30 -> NaN Invalid_operation +ddand885 and 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddBase.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddBase.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1104 @@ +------------------------------------------------------------------------ +-- ddBase.decTest -- base decDouble <--> string conversions -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This file tests base conversions from string to a decimal number +-- and back to a string (in Scientific form) + +-- Note that unlike other operations the operand is subject to rounding +-- to conform to emax and precision settings (that is, numbers will +-- conform to rules and exponent will be in permitted range). The +-- 'left hand side', therefore, may have numbers that cannot be +-- represented in a decDouble. Some testcases go to the limit of the +-- next-wider format, and hence these testcases may also be used to +-- test narrowing and widening operations. + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddbas001 toSci 0 -> 0 +ddbas002 toSci 1 -> 1 +ddbas003 toSci 1.0 -> 1.0 +ddbas004 toSci 1.00 -> 1.00 +ddbas005 toSci 10 -> 10 +ddbas006 toSci 1000 -> 1000 +ddbas007 toSci 10.0 -> 10.0 +ddbas008 toSci 10.1 -> 10.1 +ddbas009 toSci 10.4 -> 10.4 +ddbas010 toSci 10.5 -> 10.5 +ddbas011 toSci 10.6 -> 10.6 +ddbas012 toSci 10.9 -> 10.9 +ddbas013 toSci 11.0 -> 11.0 +ddbas014 toSci 1.234 -> 1.234 +ddbas015 toSci 0.123 -> 0.123 +ddbas016 toSci 0.012 -> 0.012 +ddbas017 toSci -0 -> -0 +ddbas018 toSci -0.0 -> -0.0 +ddbas019 toSci -00.00 -> -0.00 + +ddbas021 toSci -1 -> -1 +ddbas022 toSci -1.0 -> -1.0 +ddbas023 toSci -0.1 -> -0.1 +ddbas024 toSci -9.1 -> -9.1 +ddbas025 toSci -9.11 -> -9.11 +ddbas026 toSci -9.119 -> -9.119 +ddbas027 toSci -9.999 -> -9.999 + +ddbas030 toSci '123456789.123456' -> '123456789.123456' +ddbas031 toSci '123456789.000000' -> '123456789.000000' +ddbas032 toSci '123456789123456' -> '123456789123456' +ddbas033 toSci '0.0000123456789' -> '0.0000123456789' +ddbas034 toSci '0.00000123456789' -> '0.00000123456789' +ddbas035 toSci '0.000000123456789' -> '1.23456789E-7' +ddbas036 toSci '0.0000000123456789' -> '1.23456789E-8' + +ddbas037 toSci '0.123456789012344' -> '0.123456789012344' +ddbas038 toSci '0.123456789012345' -> '0.123456789012345' + +-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax) +ddbsn001 toSci -9.999999999999999E+384 -> -9.999999999999999E+384 +ddbsn002 toSci -1E-383 -> -1E-383 +ddbsn003 toSci -1E-398 -> -1E-398 Subnormal +ddbsn004 toSci -0 -> -0 +ddbsn005 toSci +0 -> 0 +ddbsn006 toSci +1E-398 -> 1E-398 Subnormal +ddbsn007 toSci +1E-383 -> 1E-383 +ddbsn008 toSci +9.999999999999999E+384 -> 9.999999999999999E+384 + +-- String [many more examples are implicitly tested elsewhere] +-- strings without E cannot generate E in result +ddbas040 toSci "12" -> '12' +ddbas041 toSci "-76" -> '-76' +ddbas042 toSci "12.76" -> '12.76' +ddbas043 toSci "+12.76" -> '12.76' +ddbas044 toSci "012.76" -> '12.76' +ddbas045 toSci "+0.003" -> '0.003' +ddbas046 toSci "17." -> '17' +ddbas047 toSci ".5" -> '0.5' +ddbas048 toSci "044" -> '44' +ddbas049 toSci "0044" -> '44' +ddbas050 toSci "0.0005" -> '0.0005' +ddbas051 toSci "00.00005" -> '0.00005' +ddbas052 toSci "0.000005" -> '0.000005' +ddbas053 toSci "0.0000050" -> '0.0000050' +ddbas054 toSci "0.0000005" -> '5E-7' +ddbas055 toSci "0.00000005" -> '5E-8' +ddbas056 toSci "12345678.543210" -> '12345678.543210' +ddbas057 toSci "2345678.543210" -> '2345678.543210' +ddbas058 toSci "345678.543210" -> '345678.543210' +ddbas059 toSci "0345678.54321" -> '345678.54321' +ddbas060 toSci "345678.5432" -> '345678.5432' +ddbas061 toSci "+345678.5432" -> '345678.5432' +ddbas062 toSci "+0345678.5432" -> '345678.5432' +ddbas063 toSci "+00345678.5432" -> '345678.5432' +ddbas064 toSci "-345678.5432" -> '-345678.5432' +ddbas065 toSci "-0345678.5432" -> '-345678.5432' +ddbas066 toSci "-00345678.5432" -> '-345678.5432' +-- examples +ddbas067 toSci "5E-6" -> '0.000005' +ddbas068 toSci "50E-7" -> '0.0000050' +ddbas069 toSci "5E-7" -> '5E-7' + +-- [No exotics as no Unicode] + +-- rounded with dots in all (including edge) places +ddbas071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded +ddbas072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded +ddbas073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded +ddbas074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded +ddbas075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded +ddbas076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded +ddbas077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded +ddbas078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded +ddbas079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded +ddbas080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded +ddbas081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded +ddbas082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded +ddbas083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded +ddbas084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded +ddbas085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded +ddbas086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded +ddbas087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded +ddbas088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded +ddbas089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded +ddbas090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded + + +-- Numbers with E +ddbas130 toSci "0.000E-1" -> '0.0000' +ddbas131 toSci "0.000E-2" -> '0.00000' +ddbas132 toSci "0.000E-3" -> '0.000000' +ddbas133 toSci "0.000E-4" -> '0E-7' +ddbas134 toSci "0.00E-2" -> '0.0000' +ddbas135 toSci "0.00E-3" -> '0.00000' +ddbas136 toSci "0.00E-4" -> '0.000000' +ddbas137 toSci "0.00E-5" -> '0E-7' +ddbas138 toSci "+0E+9" -> '0E+9' +ddbas139 toSci "-0E+9" -> '-0E+9' +ddbas140 toSci "1E+9" -> '1E+9' +ddbas141 toSci "1e+09" -> '1E+9' +ddbas142 toSci "1E+90" -> '1E+90' +ddbas143 toSci "+1E+009" -> '1E+9' +ddbas144 toSci "0E+9" -> '0E+9' +ddbas145 toSci "1E+9" -> '1E+9' +ddbas146 toSci "1E+09" -> '1E+9' +ddbas147 toSci "1e+90" -> '1E+90' +ddbas148 toSci "1E+009" -> '1E+9' +ddbas149 toSci "000E+9" -> '0E+9' +ddbas150 toSci "1E9" -> '1E+9' +ddbas151 toSci "1e09" -> '1E+9' +ddbas152 toSci "1E90" -> '1E+90' +ddbas153 toSci "1E009" -> '1E+9' +ddbas154 toSci "0E9" -> '0E+9' +ddbas155 toSci "0.000e+0" -> '0.000' +ddbas156 toSci "0.000E-1" -> '0.0000' +ddbas157 toSci "4E+9" -> '4E+9' +ddbas158 toSci "44E+9" -> '4.4E+10' +ddbas159 toSci "0.73e-7" -> '7.3E-8' +ddbas160 toSci "00E+9" -> '0E+9' +ddbas161 toSci "00E-9" -> '0E-9' +ddbas162 toSci "10E+9" -> '1.0E+10' +ddbas163 toSci "10E+09" -> '1.0E+10' +ddbas164 toSci "10e+90" -> '1.0E+91' +ddbas165 toSci "10E+009" -> '1.0E+10' +ddbas166 toSci "100e+9" -> '1.00E+11' +ddbas167 toSci "100e+09" -> '1.00E+11' +ddbas168 toSci "100E+90" -> '1.00E+92' +ddbas169 toSci "100e+009" -> '1.00E+11' + +ddbas170 toSci "1.265" -> '1.265' +ddbas171 toSci "1.265E-20" -> '1.265E-20' +ddbas172 toSci "1.265E-8" -> '1.265E-8' +ddbas173 toSci "1.265E-4" -> '0.0001265' +ddbas174 toSci "1.265E-3" -> '0.001265' +ddbas175 toSci "1.265E-2" -> '0.01265' +ddbas176 toSci "1.265E-1" -> '0.1265' +ddbas177 toSci "1.265E-0" -> '1.265' +ddbas178 toSci "1.265E+1" -> '12.65' +ddbas179 toSci "1.265E+2" -> '126.5' +ddbas180 toSci "1.265E+3" -> '1265' +ddbas181 toSci "1.265E+4" -> '1.265E+4' +ddbas182 toSci "1.265E+8" -> '1.265E+8' +ddbas183 toSci "1.265E+20" -> '1.265E+20' + +ddbas190 toSci "12.65" -> '12.65' +ddbas191 toSci "12.65E-20" -> '1.265E-19' +ddbas192 toSci "12.65E-8" -> '1.265E-7' +ddbas193 toSci "12.65E-4" -> '0.001265' +ddbas194 toSci "12.65E-3" -> '0.01265' +ddbas195 toSci "12.65E-2" -> '0.1265' +ddbas196 toSci "12.65E-1" -> '1.265' +ddbas197 toSci "12.65E-0" -> '12.65' +ddbas198 toSci "12.65E+1" -> '126.5' +ddbas199 toSci "12.65E+2" -> '1265' +ddbas200 toSci "12.65E+3" -> '1.265E+4' +ddbas201 toSci "12.65E+4" -> '1.265E+5' +ddbas202 toSci "12.65E+8" -> '1.265E+9' +ddbas203 toSci "12.65E+20" -> '1.265E+21' + +ddbas210 toSci "126.5" -> '126.5' +ddbas211 toSci "126.5E-20" -> '1.265E-18' +ddbas212 toSci "126.5E-8" -> '0.000001265' +ddbas213 toSci "126.5E-4" -> '0.01265' +ddbas214 toSci "126.5E-3" -> '0.1265' +ddbas215 toSci "126.5E-2" -> '1.265' +ddbas216 toSci "126.5E-1" -> '12.65' +ddbas217 toSci "126.5E-0" -> '126.5' +ddbas218 toSci "126.5E+1" -> '1265' +ddbas219 toSci "126.5E+2" -> '1.265E+4' +ddbas220 toSci "126.5E+3" -> '1.265E+5' +ddbas221 toSci "126.5E+4" -> '1.265E+6' +ddbas222 toSci "126.5E+8" -> '1.265E+10' +ddbas223 toSci "126.5E+20" -> '1.265E+22' + +ddbas230 toSci "1265" -> '1265' +ddbas231 toSci "1265E-20" -> '1.265E-17' +ddbas232 toSci "1265E-8" -> '0.00001265' +ddbas233 toSci "1265E-4" -> '0.1265' +ddbas234 toSci "1265E-3" -> '1.265' +ddbas235 toSci "1265E-2" -> '12.65' +ddbas236 toSci "1265E-1" -> '126.5' +ddbas237 toSci "1265E-0" -> '1265' +ddbas238 toSci "1265E+1" -> '1.265E+4' +ddbas239 toSci "1265E+2" -> '1.265E+5' +ddbas240 toSci "1265E+3" -> '1.265E+6' +ddbas241 toSci "1265E+4" -> '1.265E+7' +ddbas242 toSci "1265E+8" -> '1.265E+11' +ddbas243 toSci "1265E+20" -> '1.265E+23' +ddbas244 toSci "1265E-9" -> '0.000001265' +ddbas245 toSci "1265E-10" -> '1.265E-7' +ddbas246 toSci "1265E-11" -> '1.265E-8' +ddbas247 toSci "1265E-12" -> '1.265E-9' + +ddbas250 toSci "0.1265" -> '0.1265' +ddbas251 toSci "0.1265E-20" -> '1.265E-21' +ddbas252 toSci "0.1265E-8" -> '1.265E-9' +ddbas253 toSci "0.1265E-4" -> '0.00001265' +ddbas254 toSci "0.1265E-3" -> '0.0001265' +ddbas255 toSci "0.1265E-2" -> '0.001265' +ddbas256 toSci "0.1265E-1" -> '0.01265' +ddbas257 toSci "0.1265E-0" -> '0.1265' +ddbas258 toSci "0.1265E+1" -> '1.265' +ddbas259 toSci "0.1265E+2" -> '12.65' +ddbas260 toSci "0.1265E+3" -> '126.5' +ddbas261 toSci "0.1265E+4" -> '1265' +ddbas262 toSci "0.1265E+8" -> '1.265E+7' +ddbas263 toSci "0.1265E+20" -> '1.265E+19' + +-- some more negative zeros [systematic tests below] +ddbas290 toSci "-0.000E-1" -> '-0.0000' +ddbas291 toSci "-0.000E-2" -> '-0.00000' +ddbas292 toSci "-0.000E-3" -> '-0.000000' +ddbas293 toSci "-0.000E-4" -> '-0E-7' +ddbas294 toSci "-0.00E-2" -> '-0.0000' +ddbas295 toSci "-0.00E-3" -> '-0.00000' +ddbas296 toSci "-0.0E-2" -> '-0.000' +ddbas297 toSci "-0.0E-3" -> '-0.0000' +ddbas298 toSci "-0E-2" -> '-0.00' +ddbas299 toSci "-0E-3" -> '-0.000' + +-- Engineering notation tests +ddbas301 toSci 10e12 -> 1.0E+13 +ddbas302 toEng 10e12 -> 10E+12 +ddbas303 toSci 10e11 -> 1.0E+12 +ddbas304 toEng 10e11 -> 1.0E+12 +ddbas305 toSci 10e10 -> 1.0E+11 +ddbas306 toEng 10e10 -> 100E+9 +ddbas307 toSci 10e9 -> 1.0E+10 +ddbas308 toEng 10e9 -> 10E+9 +ddbas309 toSci 10e8 -> 1.0E+9 +ddbas310 toEng 10e8 -> 1.0E+9 +ddbas311 toSci 10e7 -> 1.0E+8 +ddbas312 toEng 10e7 -> 100E+6 +ddbas313 toSci 10e6 -> 1.0E+7 +ddbas314 toEng 10e6 -> 10E+6 +ddbas315 toSci 10e5 -> 1.0E+6 +ddbas316 toEng 10e5 -> 1.0E+6 +ddbas317 toSci 10e4 -> 1.0E+5 +ddbas318 toEng 10e4 -> 100E+3 +ddbas319 toSci 10e3 -> 1.0E+4 +ddbas320 toEng 10e3 -> 10E+3 +ddbas321 toSci 10e2 -> 1.0E+3 +ddbas322 toEng 10e2 -> 1.0E+3 +ddbas323 toSci 10e1 -> 1.0E+2 +ddbas324 toEng 10e1 -> 100 +ddbas325 toSci 10e0 -> 10 +ddbas326 toEng 10e0 -> 10 +ddbas327 toSci 10e-1 -> 1.0 +ddbas328 toEng 10e-1 -> 1.0 +ddbas329 toSci 10e-2 -> 0.10 +ddbas330 toEng 10e-2 -> 0.10 +ddbas331 toSci 10e-3 -> 0.010 +ddbas332 toEng 10e-3 -> 0.010 +ddbas333 toSci 10e-4 -> 0.0010 +ddbas334 toEng 10e-4 -> 0.0010 +ddbas335 toSci 10e-5 -> 0.00010 +ddbas336 toEng 10e-5 -> 0.00010 +ddbas337 toSci 10e-6 -> 0.000010 +ddbas338 toEng 10e-6 -> 0.000010 +ddbas339 toSci 10e-7 -> 0.0000010 +ddbas340 toEng 10e-7 -> 0.0000010 +ddbas341 toSci 10e-8 -> 1.0E-7 +ddbas342 toEng 10e-8 -> 100E-9 +ddbas343 toSci 10e-9 -> 1.0E-8 +ddbas344 toEng 10e-9 -> 10E-9 +ddbas345 toSci 10e-10 -> 1.0E-9 +ddbas346 toEng 10e-10 -> 1.0E-9 +ddbas347 toSci 10e-11 -> 1.0E-10 +ddbas348 toEng 10e-11 -> 100E-12 +ddbas349 toSci 10e-12 -> 1.0E-11 +ddbas350 toEng 10e-12 -> 10E-12 +ddbas351 toSci 10e-13 -> 1.0E-12 +ddbas352 toEng 10e-13 -> 1.0E-12 + +ddbas361 toSci 7E12 -> 7E+12 +ddbas362 toEng 7E12 -> 7E+12 +ddbas363 toSci 7E11 -> 7E+11 +ddbas364 toEng 7E11 -> 700E+9 +ddbas365 toSci 7E10 -> 7E+10 +ddbas366 toEng 7E10 -> 70E+9 +ddbas367 toSci 7E9 -> 7E+9 +ddbas368 toEng 7E9 -> 7E+9 +ddbas369 toSci 7E8 -> 7E+8 +ddbas370 toEng 7E8 -> 700E+6 +ddbas371 toSci 7E7 -> 7E+7 +ddbas372 toEng 7E7 -> 70E+6 +ddbas373 toSci 7E6 -> 7E+6 +ddbas374 toEng 7E6 -> 7E+6 +ddbas375 toSci 7E5 -> 7E+5 +ddbas376 toEng 7E5 -> 700E+3 +ddbas377 toSci 7E4 -> 7E+4 +ddbas378 toEng 7E4 -> 70E+3 +ddbas379 toSci 7E3 -> 7E+3 +ddbas380 toEng 7E3 -> 7E+3 +ddbas381 toSci 7E2 -> 7E+2 +ddbas382 toEng 7E2 -> 700 +ddbas383 toSci 7E1 -> 7E+1 +ddbas384 toEng 7E1 -> 70 +ddbas385 toSci 7E0 -> 7 +ddbas386 toEng 7E0 -> 7 +ddbas387 toSci 7E-1 -> 0.7 +ddbas388 toEng 7E-1 -> 0.7 +ddbas389 toSci 7E-2 -> 0.07 +ddbas390 toEng 7E-2 -> 0.07 +ddbas391 toSci 7E-3 -> 0.007 +ddbas392 toEng 7E-3 -> 0.007 +ddbas393 toSci 7E-4 -> 0.0007 +ddbas394 toEng 7E-4 -> 0.0007 +ddbas395 toSci 7E-5 -> 0.00007 +ddbas396 toEng 7E-5 -> 0.00007 +ddbas397 toSci 7E-6 -> 0.000007 +ddbas398 toEng 7E-6 -> 0.000007 +ddbas399 toSci 7E-7 -> 7E-7 +ddbas400 toEng 7E-7 -> 700E-9 +ddbas401 toSci 7E-8 -> 7E-8 +ddbas402 toEng 7E-8 -> 70E-9 +ddbas403 toSci 7E-9 -> 7E-9 +ddbas404 toEng 7E-9 -> 7E-9 +ddbas405 toSci 7E-10 -> 7E-10 +ddbas406 toEng 7E-10 -> 700E-12 +ddbas407 toSci 7E-11 -> 7E-11 +ddbas408 toEng 7E-11 -> 70E-12 +ddbas409 toSci 7E-12 -> 7E-12 +ddbas410 toEng 7E-12 -> 7E-12 +ddbas411 toSci 7E-13 -> 7E-13 +ddbas412 toEng 7E-13 -> 700E-15 + +-- Exacts remain exact up to precision .. +rounding: half_up +ddbas420 toSci 100 -> 100 +ddbas421 toEng 100 -> 100 +ddbas422 toSci 1000 -> 1000 +ddbas423 toEng 1000 -> 1000 +ddbas424 toSci 999.9 -> 999.9 +ddbas425 toEng 999.9 -> 999.9 +ddbas426 toSci 1000.0 -> 1000.0 +ddbas427 toEng 1000.0 -> 1000.0 +ddbas428 toSci 1000.1 -> 1000.1 +ddbas429 toEng 1000.1 -> 1000.1 +ddbas430 toSci 10000 -> 10000 +ddbas431 toEng 10000 -> 10000 +ddbas432 toSci 100000 -> 100000 +ddbas433 toEng 100000 -> 100000 +ddbas434 toSci 1000000 -> 1000000 +ddbas435 toEng 1000000 -> 1000000 +ddbas436 toSci 10000000 -> 10000000 +ddbas437 toEng 10000000 -> 10000000 +ddbas438 toSci 100000000 -> 100000000 +ddbas439 toEng 1000000000000000 -> 1000000000000000 +ddbas440 toSci 10000000000000000 -> 1.000000000000000E+16 Rounded +ddbas441 toEng 10000000000000000 -> 10.00000000000000E+15 Rounded +ddbas442 toSci 10000000000000001 -> 1.000000000000000E+16 Rounded Inexact +ddbas443 toEng 10000000000000001 -> 10.00000000000000E+15 Rounded Inexact +ddbas444 toSci 10000000000000003 -> 1.000000000000000E+16 Rounded Inexact +ddbas445 toEng 10000000000000003 -> 10.00000000000000E+15 Rounded Inexact +ddbas446 toSci 10000000000000005 -> 1.000000000000001E+16 Rounded Inexact +ddbas447 toEng 10000000000000005 -> 10.00000000000001E+15 Rounded Inexact +ddbas448 toSci 100000000000000050 -> 1.000000000000001E+17 Rounded Inexact +ddbas449 toEng 100000000000000050 -> 100.0000000000001E+15 Rounded Inexact +ddbas450 toSci 10000000000000009 -> 1.000000000000001E+16 Rounded Inexact +ddbas451 toEng 10000000000000009 -> 10.00000000000001E+15 Rounded Inexact +ddbas452 toSci 100000000000000000 -> 1.000000000000000E+17 Rounded +ddbas453 toEng 100000000000000000 -> 100.0000000000000E+15 Rounded +ddbas454 toSci 100000000000000003 -> 1.000000000000000E+17 Rounded Inexact +ddbas455 toEng 100000000000000003 -> 100.0000000000000E+15 Rounded Inexact +ddbas456 toSci 100000000000000005 -> 1.000000000000000E+17 Rounded Inexact +ddbas457 toEng 100000000000000005 -> 100.0000000000000E+15 Rounded Inexact +ddbas458 toSci 100000000000000009 -> 1.000000000000000E+17 Rounded Inexact +ddbas459 toEng 100000000000000009 -> 100.0000000000000E+15 Rounded Inexact +ddbas460 toSci 1000000000000000000 -> 1.000000000000000E+18 Rounded +ddbas461 toEng 1000000000000000000 -> 1.000000000000000E+18 Rounded +ddbas462 toSci 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact +ddbas463 toEng 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact +ddbas464 toSci 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact +ddbas465 toEng 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact +ddbas466 toSci 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact +ddbas467 toEng 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact +ddbas468 toSci 10000000000000000000 -> 1.000000000000000E+19 Rounded +ddbas469 toEng 10000000000000000000 -> 10.00000000000000E+18 Rounded +ddbas470 toSci 10000000000000003000 -> 1.000000000000000E+19 Rounded Inexact +ddbas471 toEng 10000000000000003000 -> 10.00000000000000E+18 Rounded Inexact +ddbas472 toSci 10000000000000005000 -> 1.000000000000001E+19 Rounded Inexact +ddbas473 toEng 10000000000000005000 -> 10.00000000000001E+18 Rounded Inexact +ddbas474 toSci 10000000000000009000 -> 1.000000000000001E+19 Rounded Inexact +ddbas475 toEng 10000000000000009000 -> 10.00000000000001E+18 Rounded Inexact + +-- check rounding modes heeded +rounding: ceiling +ddbsr401 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr402 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact +ddbsr403 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact +ddbsr404 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact +rounding: up +ddbsr405 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr406 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact +ddbsr407 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact +ddbsr408 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact +rounding: floor +ddbsr410 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr411 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact +ddbsr412 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact +ddbsr413 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact +rounding: half_down +ddbsr415 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr416 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact +ddbsr417 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact +ddbsr418 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact +ddbsr419 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact +rounding: half_even +ddbsr421 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr422 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact +ddbsr423 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact +ddbsr424 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact +ddbsr425 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact +rounding: down +ddbsr426 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr427 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact +ddbsr428 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact +ddbsr429 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact +rounding: half_up +ddbsr431 toSci 1.1111111111123450 -> 1.111111111112345 Rounded +ddbsr432 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact +ddbsr433 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact +ddbsr434 toSci 1.11111111111234650 -> 1.111111111112347 Rounded Inexact +ddbsr435 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact +-- negatives +rounding: ceiling +ddbsr501 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr502 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact +ddbsr503 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact +ddbsr504 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact +rounding: up +ddbsr505 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr506 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact +ddbsr507 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact +ddbsr508 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact +rounding: floor +ddbsr510 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr511 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact +ddbsr512 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact +ddbsr513 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact +rounding: half_down +ddbsr515 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr516 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact +ddbsr517 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact +ddbsr518 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact +ddbsr519 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact +rounding: half_even +ddbsr521 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr522 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact +ddbsr523 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact +ddbsr524 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact +ddbsr525 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact +rounding: down +ddbsr526 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr527 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact +ddbsr528 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact +ddbsr529 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact +rounding: half_up +ddbsr531 toSci -1.1111111111123450 -> -1.111111111112345 Rounded +ddbsr532 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact +ddbsr533 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact +ddbsr534 toSci -1.11111111111234650 -> -1.111111111112347 Rounded Inexact +ddbsr535 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact + +rounding: half_even + +-- The 'baddies' tests from DiagBigDecimal, plus some new ones +ddbas500 toSci '1..2' -> NaN Conversion_syntax +ddbas501 toSci '.' -> NaN Conversion_syntax +ddbas502 toSci '..' -> NaN Conversion_syntax +ddbas503 toSci '++1' -> NaN Conversion_syntax +ddbas504 toSci '--1' -> NaN Conversion_syntax +ddbas505 toSci '-+1' -> NaN Conversion_syntax +ddbas506 toSci '+-1' -> NaN Conversion_syntax +ddbas507 toSci '12e' -> NaN Conversion_syntax +ddbas508 toSci '12e++' -> NaN Conversion_syntax +ddbas509 toSci '12f4' -> NaN Conversion_syntax +ddbas510 toSci ' +1' -> NaN Conversion_syntax +ddbas511 toSci '+ 1' -> NaN Conversion_syntax +ddbas512 toSci '12 ' -> NaN Conversion_syntax +ddbas513 toSci ' + 1' -> NaN Conversion_syntax +ddbas514 toSci ' - 1 ' -> NaN Conversion_syntax +ddbas515 toSci 'x' -> NaN Conversion_syntax +ddbas516 toSci '-1-' -> NaN Conversion_syntax +ddbas517 toSci '12-' -> NaN Conversion_syntax +ddbas518 toSci '3+' -> NaN Conversion_syntax +ddbas519 toSci '' -> NaN Conversion_syntax +ddbas520 toSci '1e-' -> NaN Conversion_syntax +ddbas521 toSci '7e99999a' -> NaN Conversion_syntax +ddbas522 toSci '7e123567890x' -> NaN Conversion_syntax +ddbas523 toSci '7e12356789012x' -> NaN Conversion_syntax +ddbas524 toSci '' -> NaN Conversion_syntax +ddbas525 toSci 'e100' -> NaN Conversion_syntax +ddbas526 toSci '\u0e5a' -> NaN Conversion_syntax +ddbas527 toSci '\u0b65' -> NaN Conversion_syntax +ddbas528 toSci '123,65' -> NaN Conversion_syntax +ddbas529 toSci '1.34.5' -> NaN Conversion_syntax +ddbas530 toSci '.123.5' -> NaN Conversion_syntax +ddbas531 toSci '01.35.' -> NaN Conversion_syntax +ddbas532 toSci '01.35-' -> NaN Conversion_syntax +ddbas533 toSci '0000..' -> NaN Conversion_syntax +ddbas534 toSci '.0000.' -> NaN Conversion_syntax +ddbas535 toSci '00..00' -> NaN Conversion_syntax +ddbas536 toSci '111e*123' -> NaN Conversion_syntax +ddbas537 toSci '111e123-' -> NaN Conversion_syntax +ddbas538 toSci '111e+12+' -> NaN Conversion_syntax +ddbas539 toSci '111e1-3-' -> NaN Conversion_syntax +ddbas540 toSci '111e1*23' -> NaN Conversion_syntax +ddbas541 toSci '111e1e+3' -> NaN Conversion_syntax +ddbas542 toSci '1e1.0' -> NaN Conversion_syntax +ddbas543 toSci '1e123e' -> NaN Conversion_syntax +ddbas544 toSci 'ten' -> NaN Conversion_syntax +ddbas545 toSci 'ONE' -> NaN Conversion_syntax +ddbas546 toSci '1e.1' -> NaN Conversion_syntax +ddbas547 toSci '1e1.' -> NaN Conversion_syntax +ddbas548 toSci '1ee' -> NaN Conversion_syntax +ddbas549 toSci 'e+1' -> NaN Conversion_syntax +ddbas550 toSci '1.23.4' -> NaN Conversion_syntax +ddbas551 toSci '1.2.1' -> NaN Conversion_syntax +ddbas552 toSci '1E+1.2' -> NaN Conversion_syntax +ddbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax +ddbas554 toSci '1E++1' -> NaN Conversion_syntax +ddbas555 toSci '1E--1' -> NaN Conversion_syntax +ddbas556 toSci '1E+-1' -> NaN Conversion_syntax +ddbas557 toSci '1E-+1' -> NaN Conversion_syntax +ddbas558 toSci '1E''1' -> NaN Conversion_syntax +ddbas559 toSci "1E""1" -> NaN Conversion_syntax +ddbas560 toSci "1E""""" -> NaN Conversion_syntax +-- Near-specials +ddbas561 toSci "qNaN" -> NaN Conversion_syntax +ddbas562 toSci "NaNq" -> NaN Conversion_syntax +ddbas563 toSci "NaNs" -> NaN Conversion_syntax +ddbas564 toSci "Infi" -> NaN Conversion_syntax +ddbas565 toSci "Infin" -> NaN Conversion_syntax +ddbas566 toSci "Infini" -> NaN Conversion_syntax +ddbas567 toSci "Infinit" -> NaN Conversion_syntax +ddbas568 toSci "-Infinit" -> NaN Conversion_syntax +ddbas569 toSci "0Inf" -> NaN Conversion_syntax +ddbas570 toSci "9Inf" -> NaN Conversion_syntax +ddbas571 toSci "-0Inf" -> NaN Conversion_syntax +ddbas572 toSci "-9Inf" -> NaN Conversion_syntax +ddbas573 toSci "-sNa" -> NaN Conversion_syntax +ddbas574 toSci "xNaN" -> NaN Conversion_syntax +ddbas575 toSci "0sNaN" -> NaN Conversion_syntax + +-- some baddies with dots and Es and dots and specials +ddbas576 toSci 'e+1' -> NaN Conversion_syntax +ddbas577 toSci '.e+1' -> NaN Conversion_syntax +ddbas578 toSci '+.e+1' -> NaN Conversion_syntax +ddbas579 toSci '-.e+' -> NaN Conversion_syntax +ddbas580 toSci '-.e' -> NaN Conversion_syntax +ddbas581 toSci 'E+1' -> NaN Conversion_syntax +ddbas582 toSci '.E+1' -> NaN Conversion_syntax +ddbas583 toSci '+.E+1' -> NaN Conversion_syntax +ddbas584 toSci '-.E+' -> NaN Conversion_syntax +ddbas585 toSci '-.E' -> NaN Conversion_syntax + +ddbas586 toSci '.NaN' -> NaN Conversion_syntax +ddbas587 toSci '-.NaN' -> NaN Conversion_syntax +ddbas588 toSci '+.sNaN' -> NaN Conversion_syntax +ddbas589 toSci '+.Inf' -> NaN Conversion_syntax +ddbas590 toSci '.Infinity' -> NaN Conversion_syntax + +-- Zeros +ddbas601 toSci 0.000000000 -> 0E-9 +ddbas602 toSci 0.00000000 -> 0E-8 +ddbas603 toSci 0.0000000 -> 0E-7 +ddbas604 toSci 0.000000 -> 0.000000 +ddbas605 toSci 0.00000 -> 0.00000 +ddbas606 toSci 0.0000 -> 0.0000 +ddbas607 toSci 0.000 -> 0.000 +ddbas608 toSci 0.00 -> 0.00 +ddbas609 toSci 0.0 -> 0.0 +ddbas610 toSci .0 -> 0.0 +ddbas611 toSci 0. -> 0 +ddbas612 toSci -.0 -> -0.0 +ddbas613 toSci -0. -> -0 +ddbas614 toSci -0.0 -> -0.0 +ddbas615 toSci -0.00 -> -0.00 +ddbas616 toSci -0.000 -> -0.000 +ddbas617 toSci -0.0000 -> -0.0000 +ddbas618 toSci -0.00000 -> -0.00000 +ddbas619 toSci -0.000000 -> -0.000000 +ddbas620 toSci -0.0000000 -> -0E-7 +ddbas621 toSci -0.00000000 -> -0E-8 +ddbas622 toSci -0.000000000 -> -0E-9 + +ddbas630 toSci 0.00E+0 -> 0.00 +ddbas631 toSci 0.00E+1 -> 0.0 +ddbas632 toSci 0.00E+2 -> 0 +ddbas633 toSci 0.00E+3 -> 0E+1 +ddbas634 toSci 0.00E+4 -> 0E+2 +ddbas635 toSci 0.00E+5 -> 0E+3 +ddbas636 toSci 0.00E+6 -> 0E+4 +ddbas637 toSci 0.00E+7 -> 0E+5 +ddbas638 toSci 0.00E+8 -> 0E+6 +ddbas639 toSci 0.00E+9 -> 0E+7 + +ddbas640 toSci 0.0E+0 -> 0.0 +ddbas641 toSci 0.0E+1 -> 0 +ddbas642 toSci 0.0E+2 -> 0E+1 +ddbas643 toSci 0.0E+3 -> 0E+2 +ddbas644 toSci 0.0E+4 -> 0E+3 +ddbas645 toSci 0.0E+5 -> 0E+4 +ddbas646 toSci 0.0E+6 -> 0E+5 +ddbas647 toSci 0.0E+7 -> 0E+6 +ddbas648 toSci 0.0E+8 -> 0E+7 +ddbas649 toSci 0.0E+9 -> 0E+8 + +ddbas650 toSci 0E+0 -> 0 +ddbas651 toSci 0E+1 -> 0E+1 +ddbas652 toSci 0E+2 -> 0E+2 +ddbas653 toSci 0E+3 -> 0E+3 +ddbas654 toSci 0E+4 -> 0E+4 +ddbas655 toSci 0E+5 -> 0E+5 +ddbas656 toSci 0E+6 -> 0E+6 +ddbas657 toSci 0E+7 -> 0E+7 +ddbas658 toSci 0E+8 -> 0E+8 +ddbas659 toSci 0E+9 -> 0E+9 + +ddbas660 toSci 0.0E-0 -> 0.0 +ddbas661 toSci 0.0E-1 -> 0.00 +ddbas662 toSci 0.0E-2 -> 0.000 +ddbas663 toSci 0.0E-3 -> 0.0000 +ddbas664 toSci 0.0E-4 -> 0.00000 +ddbas665 toSci 0.0E-5 -> 0.000000 +ddbas666 toSci 0.0E-6 -> 0E-7 +ddbas667 toSci 0.0E-7 -> 0E-8 +ddbas668 toSci 0.0E-8 -> 0E-9 +ddbas669 toSci 0.0E-9 -> 0E-10 + +ddbas670 toSci 0.00E-0 -> 0.00 +ddbas671 toSci 0.00E-1 -> 0.000 +ddbas672 toSci 0.00E-2 -> 0.0000 +ddbas673 toSci 0.00E-3 -> 0.00000 +ddbas674 toSci 0.00E-4 -> 0.000000 +ddbas675 toSci 0.00E-5 -> 0E-7 +ddbas676 toSci 0.00E-6 -> 0E-8 +ddbas677 toSci 0.00E-7 -> 0E-9 +ddbas678 toSci 0.00E-8 -> 0E-10 +ddbas679 toSci 0.00E-9 -> 0E-11 + +ddbas680 toSci 000000. -> 0 +ddbas681 toSci 00000. -> 0 +ddbas682 toSci 0000. -> 0 +ddbas683 toSci 000. -> 0 +ddbas684 toSci 00. -> 0 +ddbas685 toSci 0. -> 0 +ddbas686 toSci +00000. -> 0 +ddbas687 toSci -00000. -> -0 +ddbas688 toSci +0. -> 0 +ddbas689 toSci -0. -> -0 + +-- Specials +ddbas700 toSci "NaN" -> NaN +ddbas701 toSci "nan" -> NaN +ddbas702 toSci "nAn" -> NaN +ddbas703 toSci "NAN" -> NaN +ddbas704 toSci "+NaN" -> NaN +ddbas705 toSci "+nan" -> NaN +ddbas706 toSci "+nAn" -> NaN +ddbas707 toSci "+NAN" -> NaN +ddbas708 toSci "-NaN" -> -NaN +ddbas709 toSci "-nan" -> -NaN +ddbas710 toSci "-nAn" -> -NaN +ddbas711 toSci "-NAN" -> -NaN +ddbas712 toSci 'NaN0' -> NaN +ddbas713 toSci 'NaN1' -> NaN1 +ddbas714 toSci 'NaN12' -> NaN12 +ddbas715 toSci 'NaN123' -> NaN123 +ddbas716 toSci 'NaN1234' -> NaN1234 +ddbas717 toSci 'NaN01' -> NaN1 +ddbas718 toSci 'NaN012' -> NaN12 +ddbas719 toSci 'NaN0123' -> NaN123 +ddbas720 toSci 'NaN01234' -> NaN1234 +ddbas721 toSci 'NaN001' -> NaN1 +ddbas722 toSci 'NaN0012' -> NaN12 +ddbas723 toSci 'NaN00123' -> NaN123 +ddbas724 toSci 'NaN001234' -> NaN1234 +ddbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax +ddbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax +ddbas727 toSci 'NaN12.45' -> NaN Conversion_syntax +ddbas728 toSci 'NaN-12' -> NaN Conversion_syntax +ddbas729 toSci 'NaN+12' -> NaN Conversion_syntax + +ddbas730 toSci "sNaN" -> sNaN +ddbas731 toSci "snan" -> sNaN +ddbas732 toSci "SnAn" -> sNaN +ddbas733 toSci "SNAN" -> sNaN +ddbas734 toSci "+sNaN" -> sNaN +ddbas735 toSci "+snan" -> sNaN +ddbas736 toSci "+SnAn" -> sNaN +ddbas737 toSci "+SNAN" -> sNaN +ddbas738 toSci "-sNaN" -> -sNaN +ddbas739 toSci "-snan" -> -sNaN +ddbas740 toSci "-SnAn" -> -sNaN +ddbas741 toSci "-SNAN" -> -sNaN +ddbas742 toSci 'sNaN0000' -> sNaN +ddbas743 toSci 'sNaN7' -> sNaN7 +ddbas744 toSci 'sNaN007234' -> sNaN7234 +ddbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax +ddbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax +ddbas747 toSci 'sNaN-72' -> NaN Conversion_syntax + +ddbas748 toSci "Inf" -> Infinity +ddbas749 toSci "inf" -> Infinity +ddbas750 toSci "iNf" -> Infinity +ddbas751 toSci "INF" -> Infinity +ddbas752 toSci "+Inf" -> Infinity +ddbas753 toSci "+inf" -> Infinity +ddbas754 toSci "+iNf" -> Infinity +ddbas755 toSci "+INF" -> Infinity +ddbas756 toSci "-Inf" -> -Infinity +ddbas757 toSci "-inf" -> -Infinity +ddbas758 toSci "-iNf" -> -Infinity +ddbas759 toSci "-INF" -> -Infinity + +ddbas760 toSci "Infinity" -> Infinity +ddbas761 toSci "infinity" -> Infinity +ddbas762 toSci "iNfInItY" -> Infinity +ddbas763 toSci "INFINITY" -> Infinity +ddbas764 toSci "+Infinity" -> Infinity +ddbas765 toSci "+infinity" -> Infinity +ddbas766 toSci "+iNfInItY" -> Infinity +ddbas767 toSci "+INFINITY" -> Infinity +ddbas768 toSci "-Infinity" -> -Infinity +ddbas769 toSci "-infinity" -> -Infinity +ddbas770 toSci "-iNfInItY" -> -Infinity +ddbas771 toSci "-INFINITY" -> -Infinity + +-- Specials and zeros for toEng +ddbast772 toEng "NaN" -> NaN +ddbast773 toEng "-Infinity" -> -Infinity +ddbast774 toEng "-sNaN" -> -sNaN +ddbast775 toEng "-NaN" -> -NaN +ddbast776 toEng "+Infinity" -> Infinity +ddbast778 toEng "+sNaN" -> sNaN +ddbast779 toEng "+NaN" -> NaN +ddbast780 toEng "INFINITY" -> Infinity +ddbast781 toEng "SNAN" -> sNaN +ddbast782 toEng "NAN" -> NaN +ddbast783 toEng "infinity" -> Infinity +ddbast784 toEng "snan" -> sNaN +ddbast785 toEng "nan" -> NaN +ddbast786 toEng "InFINITY" -> Infinity +ddbast787 toEng "SnAN" -> sNaN +ddbast788 toEng "nAN" -> NaN +ddbast789 toEng "iNfinity" -> Infinity +ddbast790 toEng "sNan" -> sNaN +ddbast791 toEng "Nan" -> NaN +ddbast792 toEng "Infinity" -> Infinity +ddbast793 toEng "sNaN" -> sNaN + +-- Zero toEng, etc. +ddbast800 toEng 0e+1 -> "0.00E+3" -- doc example + +ddbast801 toEng 0.000000000 -> 0E-9 +ddbast802 toEng 0.00000000 -> 0.00E-6 +ddbast803 toEng 0.0000000 -> 0.0E-6 +ddbast804 toEng 0.000000 -> 0.000000 +ddbast805 toEng 0.00000 -> 0.00000 +ddbast806 toEng 0.0000 -> 0.0000 +ddbast807 toEng 0.000 -> 0.000 +ddbast808 toEng 0.00 -> 0.00 +ddbast809 toEng 0.0 -> 0.0 +ddbast810 toEng .0 -> 0.0 +ddbast811 toEng 0. -> 0 +ddbast812 toEng -.0 -> -0.0 +ddbast813 toEng -0. -> -0 +ddbast814 toEng -0.0 -> -0.0 +ddbast815 toEng -0.00 -> -0.00 +ddbast816 toEng -0.000 -> -0.000 +ddbast817 toEng -0.0000 -> -0.0000 +ddbast818 toEng -0.00000 -> -0.00000 +ddbast819 toEng -0.000000 -> -0.000000 +ddbast820 toEng -0.0000000 -> -0.0E-6 +ddbast821 toEng -0.00000000 -> -0.00E-6 +ddbast822 toEng -0.000000000 -> -0E-9 + +ddbast830 toEng 0.00E+0 -> 0.00 +ddbast831 toEng 0.00E+1 -> 0.0 +ddbast832 toEng 0.00E+2 -> 0 +ddbast833 toEng 0.00E+3 -> 0.00E+3 +ddbast834 toEng 0.00E+4 -> 0.0E+3 +ddbast835 toEng 0.00E+5 -> 0E+3 +ddbast836 toEng 0.00E+6 -> 0.00E+6 +ddbast837 toEng 0.00E+7 -> 0.0E+6 +ddbast838 toEng 0.00E+8 -> 0E+6 +ddbast839 toEng 0.00E+9 -> 0.00E+9 + +ddbast840 toEng 0.0E+0 -> 0.0 +ddbast841 toEng 0.0E+1 -> 0 +ddbast842 toEng 0.0E+2 -> 0.00E+3 +ddbast843 toEng 0.0E+3 -> 0.0E+3 +ddbast844 toEng 0.0E+4 -> 0E+3 +ddbast845 toEng 0.0E+5 -> 0.00E+6 +ddbast846 toEng 0.0E+6 -> 0.0E+6 +ddbast847 toEng 0.0E+7 -> 0E+6 +ddbast848 toEng 0.0E+8 -> 0.00E+9 +ddbast849 toEng 0.0E+9 -> 0.0E+9 + +ddbast850 toEng 0E+0 -> 0 +ddbast851 toEng 0E+1 -> 0.00E+3 +ddbast852 toEng 0E+2 -> 0.0E+3 +ddbast853 toEng 0E+3 -> 0E+3 +ddbast854 toEng 0E+4 -> 0.00E+6 +ddbast855 toEng 0E+5 -> 0.0E+6 +ddbast856 toEng 0E+6 -> 0E+6 +ddbast857 toEng 0E+7 -> 0.00E+9 +ddbast858 toEng 0E+8 -> 0.0E+9 +ddbast859 toEng 0E+9 -> 0E+9 + +ddbast860 toEng 0.0E-0 -> 0.0 +ddbast861 toEng 0.0E-1 -> 0.00 +ddbast862 toEng 0.0E-2 -> 0.000 +ddbast863 toEng 0.0E-3 -> 0.0000 +ddbast864 toEng 0.0E-4 -> 0.00000 +ddbast865 toEng 0.0E-5 -> 0.000000 +ddbast866 toEng 0.0E-6 -> 0.0E-6 +ddbast867 toEng 0.0E-7 -> 0.00E-6 +ddbast868 toEng 0.0E-8 -> 0E-9 +ddbast869 toEng 0.0E-9 -> 0.0E-9 + +ddbast870 toEng 0.00E-0 -> 0.00 +ddbast871 toEng 0.00E-1 -> 0.000 +ddbast872 toEng 0.00E-2 -> 0.0000 +ddbast873 toEng 0.00E-3 -> 0.00000 +ddbast874 toEng 0.00E-4 -> 0.000000 +ddbast875 toEng 0.00E-5 -> 0.0E-6 +ddbast876 toEng 0.00E-6 -> 0.00E-6 +ddbast877 toEng 0.00E-7 -> 0E-9 +ddbast878 toEng 0.00E-8 -> 0.0E-9 +ddbast879 toEng 0.00E-9 -> 0.00E-9 + +-- long input strings +ddbas801 tosci '01234567890123456' -> 1234567890123456 +ddbas802 tosci '001234567890123456' -> 1234567890123456 +ddbas803 tosci '0001234567890123456' -> 1234567890123456 +ddbas804 tosci '00001234567890123456' -> 1234567890123456 +ddbas805 tosci '000001234567890123456' -> 1234567890123456 +ddbas806 tosci '0000001234567890123456' -> 1234567890123456 +ddbas807 tosci '00000001234567890123456' -> 1234567890123456 +ddbas808 tosci '000000001234567890123456' -> 1234567890123456 +ddbas809 tosci '0000000001234567890123456' -> 1234567890123456 +ddbas810 tosci '00000000001234567890123456' -> 1234567890123456 + +ddbas811 tosci '0.1234567890123456' -> 0.1234567890123456 +ddbas812 tosci '0.01234567890123456' -> 0.01234567890123456 +ddbas813 tosci '0.001234567890123456' -> 0.001234567890123456 +ddbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456 +ddbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456 +ddbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456 +ddbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7 +ddbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8 +ddbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9 +ddbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10 + +ddbas821 tosci '12345678901234567890' -> 1.234567890123457E+19 Inexact Rounded +ddbas822 tosci '123456789012345678901' -> 1.234567890123457E+20 Inexact Rounded +ddbas823 tosci '1234567890123456789012' -> 1.234567890123457E+21 Inexact Rounded +ddbas824 tosci '12345678901234567890123' -> 1.234567890123457E+22 Inexact Rounded +ddbas825 tosci '123456789012345678901234' -> 1.234567890123457E+23 Inexact Rounded +ddbas826 tosci '1234567890123456789012345' -> 1.234567890123457E+24 Inexact Rounded +ddbas827 tosci '12345678901234567890123456' -> 1.234567890123457E+25 Inexact Rounded +ddbas828 tosci '123456789012345678901234567' -> 1.234567890123457E+26 Inexact Rounded +ddbas829 tosci '1234567890123456789012345678' -> 1.234567890123457E+27 Inexact Rounded + +-- subnormals and overflows +ddbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded +ddbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded +ddbas908 toSci '0.9e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas909 toSci '0.09e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded +ddbas911 toSci '10e-1000000000' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded +ddbas913 toSci '99e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded +ddbas915 toSci '1111e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas916 toSci '1111e-99999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +-- negatives the same +ddbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded +ddbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded +ddbas920 toSci '-0.9e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas921 toSci '-0.09e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded +ddbas923 toSci '-10e-1000000000' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded +ddbas925 toSci '-99e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded +ddbas927 toSci '-1111e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas928 toSci '-1111e-99999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +-- overflow results at different rounding modes +rounding: ceiling +ddbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded +ddbas931 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded +rounding: up +ddbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded +ddbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: down +ddbas934 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded +ddbas935 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded +rounding: floor +ddbas936 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded +ddbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded + +rounding: half_up +ddbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded +ddbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: half_even +ddbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded +ddbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: half_down +ddbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded +ddbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded + +rounding: half_even + +-- Now check 854/754r some subnormals and underflow to 0 +ddbem400 toSci 1.0000E-383 -> 1.0000E-383 +ddbem401 toSci 0.1E-394 -> 1E-395 Subnormal +ddbem402 toSci 0.1000E-394 -> 1.000E-395 Subnormal +ddbem403 toSci 0.0100E-394 -> 1.00E-396 Subnormal +ddbem404 toSci 0.0010E-394 -> 1.0E-397 Subnormal +ddbem405 toSci 0.0001E-394 -> 1E-398 Subnormal +ddbem406 toSci 0.00010E-394 -> 1E-398 Subnormal Rounded +ddbem407 toSci 0.00013E-394 -> 1E-398 Underflow Subnormal Inexact Rounded +ddbem408 toSci 0.00015E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem409 toSci 0.00017E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem410 toSci 0.00023E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem411 toSci 0.00025E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem412 toSci 0.00027E-394 -> 3E-398 Underflow Subnormal Inexact Rounded +ddbem413 toSci 0.000149E-394 -> 1E-398 Underflow Subnormal Inexact Rounded +ddbem414 toSci 0.000150E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem415 toSci 0.000151E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem416 toSci 0.000249E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem417 toSci 0.000250E-394 -> 2E-398 Underflow Subnormal Inexact Rounded +ddbem418 toSci 0.000251E-394 -> 3E-398 Underflow Subnormal Inexact Rounded +ddbem419 toSci 0.00009E-394 -> 1E-398 Underflow Subnormal Inexact Rounded +ddbem420 toSci 0.00005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbem421 toSci 0.00003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbem422 toSci 0.000009E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbem423 toSci 0.000005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbem424 toSci 0.000003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +ddbem425 toSci 0.001049E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded +ddbem426 toSci 0.001050E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded +ddbem427 toSci 0.001051E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded +ddbem428 toSci 0.001149E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded +ddbem429 toSci 0.001150E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded +ddbem430 toSci 0.001151E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded + +ddbem432 toSci 0.010049E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded +ddbem433 toSci 0.010050E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded +ddbem434 toSci 0.010051E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded +ddbem435 toSci 0.010149E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded +ddbem436 toSci 0.010150E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded +ddbem437 toSci 0.010151E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded + +ddbem440 toSci 0.10103E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded +ddbem441 toSci 0.10105E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded +ddbem442 toSci 0.10107E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded +ddbem443 toSci 0.10113E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded +ddbem444 toSci 0.10115E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded +ddbem445 toSci 0.10117E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded + +ddbem450 toSci 1.10730E-395 -> 1.107E-395 Underflow Subnormal Inexact Rounded +ddbem451 toSci 1.10750E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded +ddbem452 toSci 1.10770E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded +ddbem453 toSci 1.10830E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded +ddbem454 toSci 1.10850E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded +ddbem455 toSci 1.10870E-395 -> 1.109E-395 Underflow Subnormal Inexact Rounded + +-- make sure sign OK +ddbem456 toSci -0.10103E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded +ddbem457 toSci -0.10105E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded +ddbem458 toSci -0.10107E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded +ddbem459 toSci -0.10113E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded +ddbem460 toSci -0.10115E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded +ddbem461 toSci -0.10117E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded + +-- '999s' cases +ddbem464 toSci 999999E-395 -> 9.99999E-390 Subnormal +ddbem465 toSci 99999.0E-394 -> 9.99990E-390 Subnormal +ddbem466 toSci 99999.E-394 -> 9.9999E-390 Subnormal +ddbem467 toSci 9999.9E-394 -> 9.9999E-391 Subnormal +ddbem468 toSci 999.99E-394 -> 9.9999E-392 Subnormal +ddbem469 toSci 99.999E-394 -> 9.9999E-393 Subnormal +ddbem470 toSci 9.9999E-394 -> 9.9999E-394 Subnormal +ddbem471 toSci 0.99999E-394 -> 1.0000E-394 Underflow Subnormal Inexact Rounded +ddbem472 toSci 0.099999E-394 -> 1.000E-395 Underflow Subnormal Inexact Rounded +ddbem473 toSci 0.0099999E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded +ddbem474 toSci 0.00099999E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded +ddbem475 toSci 0.000099999E-394 -> 1E-398 Underflow Subnormal Inexact Rounded +ddbem476 toSci 0.0000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbem477 toSci 0.00000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbem478 toSci 0.000000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +-- Exponents with insignificant leading zeros +ddbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded +ddbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded +ddbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded +ddbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded +ddbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded +ddbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded +ddbas1007 toSci 1e-999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas1008 toSci 1e-0999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas1009 toSci 1e-00999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas1010 toSci 1e-000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas1011 toSci 1e-000000000000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddbas1012 toSci 1e-000000000001000000007 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +-- check for double-rounded subnormals +ddbas1041 toSci 1.1111111111152444E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow +ddbas1042 toSci 1.1111111111152445E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow +ddbas1043 toSci 1.1111111111152446E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow + +-- clamped large normals +ddbas1070 toSci 1E+369 -> 1E+369 +ddbas1071 toSci 1E+370 -> 1.0E+370 Clamped +ddbas1072 toSci 1E+378 -> 1.000000000E+378 Clamped +ddbas1073 toSci 1E+384 -> 1.000000000000000E+384 Clamped +ddbas1074 toSci 1E+385 -> Infinity Overflow Inexact Rounded + + +-- clamped zeros [see also clamp.decTest] +ddbas1075 toSci 0e+10000 -> 0E+369 Clamped +ddbas1076 toSci 0e-10000 -> 0E-398 Clamped +ddbas1077 toSci -0e+10000 -> -0E+369 Clamped +ddbas1078 toSci -0e-10000 -> -0E-398 Clamped + +-- extreme values from next-wider +ddbas1101 toSci -9.99999999999999999999999999999999E+6144 -> -Infinity Overflow Inexact Rounded +ddbas1102 toSci -1E-6143 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped +ddbas1103 toSci -1E-6176 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped +ddbas1104 toSci -0 -> -0 +ddbas1105 toSci +0 -> 0 +ddbas1106 toSci +1E-6176 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped +ddbas1107 toSci +1E-6173 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped +ddbas1108 toSci +9.99999999999999999999999999999999E+6144 -> Infinity Overflow Inexact Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCanonical.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCanonical.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,357 @@ +------------------------------------------------------------------------ +-- ddCanonical.decTest -- test decDouble canonical results -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This file tests that copy operations leave uncanonical operands +-- unchanged, and vice versa +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Uncanonical declets are: abc, where: +-- a=1,2,3 +-- b=6,7,e,f +-- c=e,f + +-- assert some standard (canonical) values; this tests that FromString +-- produces canonical results (many more in decimalNN) +ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff +ddcan002 apply 0 -> #2238000000000000 +ddcan003 apply 1 -> #2238000000000001 +ddcan004 apply -1 -> #a238000000000001 +ddcan005 apply Infinity -> #7800000000000000 +ddcan006 apply -Infinity -> #f800000000000000 +ddcan007 apply -NaN -> #fc00000000000000 +ddcan008 apply -sNaN -> #fe00000000000000 +ddcan009 apply NaN999999999999999 -> #7c00ff3fcff3fcff +ddcan010 apply sNaN999999999999999 -> #7e00ff3fcff3fcff +decan011 apply 9999999999999999 -> #6e38ff3fcff3fcff +ddcan012 apply 7.50 -> #22300000000003d0 +ddcan013 apply 9.99 -> #22300000000000ff + +-- Base tests for canonical encodings (individual operator +-- propagation is tested later) + +-- Finites: declets in coefficient +ddcan021 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff +ddcan022 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff +ddcan023 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff +ddcan024 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff +ddcan025 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff +ddcan026 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff +ddcan027 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff +ddcan028 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff +ddcan030 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff +ddcan031 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff +ddcan032 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff +ddcan033 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff +ddcan035 canonical #77fcff3fdff3fcff -> #77fcff3fcff3fcff +ddcan036 canonical #77fcff3feff3fcff -> #77fcff3fcff3fcff + +-- NaN: declets in payload +ddcan100 canonical NaN999999999999999 -> #7c00ff3fcff3fcff +ddcan101 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan102 canonical #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan103 canonical #7c00ffffcff3fcff -> #7c00ff3fcff3fcff +ddcan104 canonical #7c00ff3ffff3fcff -> #7c00ff3fcff3fcff +ddcan105 canonical #7c00ff3fcffffcff -> #7c00ff3fcff3fcff +ddcan106 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff +ddcan107 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +ddcan110 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan112 canonical #7d00ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan113 canonical #7c80ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan114 canonical #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan115 canonical #7c20ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan116 canonical #7c10ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan117 canonical #7c08ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan118 canonical #7c04ff3fcff3fcff -> #7c00ff3fcff3fcff + +-- sNaN: declets in payload +ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff +ddcan121 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan122 canonical #7e03ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan123 canonical #7e00ffffcff3fcff -> #7e00ff3fcff3fcff +ddcan124 canonical #7e00ff3ffff3fcff -> #7e00ff3fcff3fcff +ddcan125 canonical #7e00ff3fcffffcff -> #7e00ff3fcff3fcff +ddcan126 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff +ddcan127 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff +-- sNaN: exponent continuation bits [excluding sNaN selector] +ddcan130 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan132 canonical #7f00ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan133 canonical #7e80ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan134 canonical #7e40ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan135 canonical #7e20ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan136 canonical #7e10ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan137 canonical #7e08ff3fcff3fcff -> #7e00ff3fcff3fcff +ddcan138 canonical #7e04ff3fcff3fcff -> #7e00ff3fcff3fcff + +-- Inf: exponent continuation bits +ddcan140 canonical #7800000000000000 -> #7800000000000000 +ddcan141 canonical #7900000000000000 -> #7800000000000000 +ddcan142 canonical #7a00000000000000 -> #7800000000000000 +ddcan143 canonical #7880000000000000 -> #7800000000000000 +ddcan144 canonical #7840000000000000 -> #7800000000000000 +ddcan145 canonical #7820000000000000 -> #7800000000000000 +ddcan146 canonical #7810000000000000 -> #7800000000000000 +ddcan147 canonical #7808000000000000 -> #7800000000000000 +ddcan148 canonical #7804000000000000 -> #7800000000000000 + +-- Inf: coefficient continuation bits (first, last, and a few others) +ddcan150 canonical #7800000000000000 -> #7800000000000000 +ddcan151 canonical #7802000000000000 -> #7800000000000000 +ddcan152 canonical #7800000000000001 -> #7800000000000000 +ddcan153 canonical #7801000000000000 -> #7800000000000000 +ddcan154 canonical #7800200000000000 -> #7800000000000000 +ddcan155 canonical #7800080000000000 -> #7800000000000000 +ddcan156 canonical #7800002000000000 -> #7800000000000000 +ddcan157 canonical #7800000400000000 -> #7800000000000000 +ddcan158 canonical #7800000040000000 -> #7800000000000000 +ddcan159 canonical #7800000008000000 -> #7800000000000000 +ddcan160 canonical #7800000000400000 -> #7800000000000000 +ddcan161 canonical #7800000000020000 -> #7800000000000000 +ddcan162 canonical #7800000000008000 -> #7800000000000000 +ddcan163 canonical #7800000000000200 -> #7800000000000000 +ddcan164 canonical #7800000000000040 -> #7800000000000000 +ddcan165 canonical #7800000000000008 -> #7800000000000000 + + +-- Now the operators -- trying to check paths that might fail to +-- canonicalize propagated operands + +----- Add: +-- Finites: neutral 0 +ddcan202 add 0E+384 #77ffff3fcff3fcff -> #77fcff3fcff3fcff +ddcan203 add #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff +-- tiny zero +ddcan204 add 0E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Rounded +ddcan205 add #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded +-- tiny non zero +ddcan206 add -1E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Inexact Rounded +ddcan207 add #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded +-- NaN: declets in payload +ddcan211 add 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan212 add #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +ddcan213 add 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan214 add #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff +-- sNaN: declets in payload +ddcan215 add 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan216 add #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation +-- sNaN: exponent continuation bits [excluding sNaN selector] +ddcan217 add 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan218 add #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation +-- Inf: exponent continuation bits +ddcan220 add 0 #7880000000000000 -> #7800000000000000 +ddcan221 add #7880000000000000 0 -> #7800000000000000 +-- Inf: coefficient continuation bits +ddcan222 add 0 #7802000000000000 -> #7800000000000000 +ddcan223 add #7802000000000000 0 -> #7800000000000000 +ddcan224 add 0 #7800000000000001 -> #7800000000000000 +ddcan225 add #7800000000000001 0 -> #7800000000000000 +ddcan226 add 0 #7800002000000000 -> #7800000000000000 +ddcan227 add #7800002000000000 0 -> #7800000000000000 + +----- Class: [does not return encoded] + +----- Compare: +ddcan231 compare -Inf 1 -> #a238000000000001 +ddcan232 compare -Inf -Inf -> #2238000000000000 +ddcan233 compare 1 -Inf -> #2238000000000001 +ddcan234 compare #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff +ddcan235 compare #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation + +----- CompareSig: +ddcan241 comparesig -Inf 1 -> #a238000000000001 +ddcan242 comparesig -Inf -Inf -> #2238000000000000 +ddcan243 comparesig 1 -Inf -> #2238000000000001 +ddcan244 comparesig #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation +ddcan245 comparesig #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation + +----- Copy: [does not usually canonicalize] +-- finites +ddcan250 copy #77ffff3fcff3fcff -> #77ffff3fcff3fcff +ddcan251 copy #77fcff3fdff3fcff -> #77fcff3fdff3fcff +-- NaNs +ddcan252 copy #7c03ff3fcff3fcff -> #7c03ff3fcff3fcff +ddcan253 copy #7c00ff3fcff3ffff -> #7c00ff3fcff3ffff +ddcan254 copy #7d00ff3fcff3fcff -> #7d00ff3fcff3fcff +ddcan255 copy #7c04ff3fcff3fcff -> #7c04ff3fcff3fcff +-- sNaN +ddcan256 copy #7e00ff3fcffffcff -> #7e00ff3fcffffcff +ddcan257 copy #7e40ff3fcff3fcff -> #7e40ff3fcff3fcff +-- Inf +ddcan258 copy #7a00000000000000 -> #7a00000000000000 +ddcan259 copy #7800200000000000 -> #7800200000000000 + +----- CopyAbs: [does not usually canonicalize] +-- finites +ddcan260 copyabs #f7ffff3fcff3fcff -> #77ffff3fcff3fcff +ddcan261 copyabs #f7fcff3fdff3fcff -> #77fcff3fdff3fcff +-- NaNs +ddcan262 copyabs #fc03ff3fcff3fcff -> #7c03ff3fcff3fcff +ddcan263 copyabs #fc00ff3fcff3ffff -> #7c00ff3fcff3ffff +ddcan264 copyabs #fd00ff3fcff3fcff -> #7d00ff3fcff3fcff +ddcan265 copyabs #fc04ff3fcff3fcff -> #7c04ff3fcff3fcff +-- sNaN +ddcan266 copyabs #fe00ff3fcffffcff -> #7e00ff3fcffffcff +ddcan267 copyabs #fe40ff3fcff3fcff -> #7e40ff3fcff3fcff +-- Inf +ddcan268 copyabs #fa00000000000000 -> #7a00000000000000 +ddcan269 copyabs #f800200000000000 -> #7800200000000000 + +----- CopyNegate: [does not usually canonicalize] +-- finites +ddcan270 copynegate #77ffff3fcff3fcff -> #f7ffff3fcff3fcff +ddcan271 copynegate #77fcff3fdff3fcff -> #f7fcff3fdff3fcff +-- NaNs +ddcan272 copynegate #7c03ff3fcff3fcff -> #fc03ff3fcff3fcff +ddcan273 copynegate #7c00ff3fcff3ffff -> #fc00ff3fcff3ffff +ddcan274 copynegate #7d00ff3fcff3fcff -> #fd00ff3fcff3fcff +ddcan275 copynegate #7c04ff3fcff3fcff -> #fc04ff3fcff3fcff +-- sNaN +ddcan276 copynegate #7e00ff3fcffffcff -> #fe00ff3fcffffcff +ddcan277 copynegate #7e40ff3fcff3fcff -> #fe40ff3fcff3fcff +-- Inf +ddcan278 copynegate #7a00000000000000 -> #fa00000000000000 +ddcan279 copynegate #7800200000000000 -> #f800200000000000 + +----- CopySign: [does not usually canonicalize] +-- finites +ddcan280 copysign #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff +ddcan281 copysign #77fcff3fdff3fcff 1 -> #77fcff3fdff3fcff +-- NaNs +ddcan282 copysign #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff +ddcan283 copysign #7c00ff3fcff3ffff 1 -> #7c00ff3fcff3ffff +ddcan284 copysign #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff +ddcan285 copysign #7c04ff3fcff3fcff 1 -> #7c04ff3fcff3fcff +-- sNaN +ddcan286 copysign #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff +ddcan287 copysign #7e40ff3fcff3fcff 1 -> #7e40ff3fcff3fcff +-- Inf +ddcan288 copysign #7a00000000000000 -1 -> #fa00000000000000 +ddcan289 copysign #7800200000000000 1 -> #7800200000000000 + +----- Multiply: +-- Finites: neutral 0 +ddcan302 multiply 1 #77ffff3fcff3fcff -> #77fcff3fcff3fcff +ddcan303 multiply #77fcffffcff3fcff 1 -> #77fcff3fcff3fcff +-- negative +ddcan306 multiply -1 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff +ddcan307 multiply #77fcffffcff3fcff -1 -> #f7fcff3fcff3fcff +-- NaN: declets in payload +ddcan311 multiply 1 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan312 multiply #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +ddcan313 multiply 1 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan314 multiply #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff +-- sNaN: declets in payload +ddcan315 multiply 1 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan316 multiply #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation +-- sNaN: exponent continuation bits [excluding sNaN selector] +ddcan317 multiply 1 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan318 multiply #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation +-- Inf: exponent continuation bits +ddcan320 multiply 1 #7880000000000000 -> #7800000000000000 +ddcan321 multiply #7880000000000000 1 -> #7800000000000000 +-- Inf: coefficient continuation bits +ddcan322 multiply 1 #7802000000000000 -> #7800000000000000 +ddcan323 multiply #7802000000000000 1 -> #7800000000000000 +ddcan324 multiply 1 #7800000000000001 -> #7800000000000000 +ddcan325 multiply #7800000000000001 1 -> #7800000000000000 +ddcan326 multiply 1 #7800002000000000 -> #7800000000000000 +ddcan327 multiply #7800002000000000 1 -> #7800000000000000 + +----- Quantize: +ddcan401 quantize #6e38ff3ffff3fcff 1 -> #6e38ff3fcff3fcff +ddcan402 quantize #6e38ff3fcff3fdff 0 -> #6e38ff3fcff3fcff +ddcan403 quantize #7880000000000000 Inf -> #7800000000000000 +ddcan404 quantize #7802000000000000 -Inf -> #7800000000000000 +ddcan410 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff +ddcan411 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff +ddcan412 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff +ddcan413 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff +ddcan414 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation +ddcan415 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation +ddcan416 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation +ddcan417 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation + +----- Subtract: +-- Finites: neutral 0 +ddcan502 subtract 0E+384 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff +ddcan503 subtract #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff +-- tiny zero +ddcan504 subtract 0E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Rounded +ddcan505 subtract #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded +-- tiny non zero +ddcan506 subtract -1E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Inexact Rounded +ddcan507 subtract #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded +-- NaN: declets in payload +ddcan511 subtract 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan512 subtract #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +ddcan513 subtract 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan514 subtract #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff +-- sNaN: declets in payload +ddcan515 subtract 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan516 subtract #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation +-- sNaN: exponent continuation bits [excluding sNaN selector] +ddcan517 subtract 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan518 subtract #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation +-- Inf: exponent continuation bits +ddcan520 subtract 0 #7880000000000000 -> #f800000000000000 +ddcan521 subtract #7880000000000000 0 -> #7800000000000000 +-- Inf: coefficient continuation bits +ddcan522 subtract 0 #7802000000000000 -> #f800000000000000 +ddcan523 subtract #7802000000000000 0 -> #7800000000000000 +ddcan524 subtract 0 #7800000000000001 -> #f800000000000000 +ddcan525 subtract #7800000000000001 0 -> #7800000000000000 +ddcan526 subtract 0 #7800002000000000 -> #f800000000000000 +ddcan527 subtract #7800002000000000 0 -> #7800000000000000 + +----- ToIntegral: +ddcan601 tointegralx #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff +ddcan602 tointegralx #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff +ddcan603 tointegralx #7880000000000000 -> #7800000000000000 +ddcan604 tointegralx #7802000000000000 -> #7800000000000000 +ddcan610 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan611 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan612 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan613 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff +ddcan614 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan615 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan616 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +ddcan617 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation +-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives +ddcan618 tointegralx #2238000000000fff -> #2238000000000cff +ddcan619 tointegralx #2230000000000fff -> #2238000000000040 Inexact Rounded +ddcan620 tointegralx #222c000000000fff -> #2238000000000004 Inexact Rounded +ddcan621 tointegralx #2228000000000fff -> #2238000000000000 Inexact Rounded +ddcan622 tointegralx #a238000000000fff -> #a238000000000cff +ddcan623 tointegralx #a230000000000fff -> #a238000000000040 Inexact Rounded +ddcan624 tointegralx #a22c000000000fff -> #a238000000000004 Inexact Rounded +ddcan625 tointegralx #a228000000000fff -> #a238000000000000 Inexact Rounded + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddClass.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddClass.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,76 @@ +------------------------------------------------------------------------ +-- ddClass.decTest -- decDouble Class operations -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- [New 2006.11.27] +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddcla001 class 0 -> +Zero +ddcla002 class 0.00 -> +Zero +ddcla003 class 0E+5 -> +Zero +ddcla004 class 1E-396 -> +Subnormal +ddcla005 class 0.1E-383 -> +Subnormal +ddcla006 class 0.999999999999999E-383 -> +Subnormal +ddcla007 class 1.000000000000000E-383 -> +Normal +ddcla008 class 1E-383 -> +Normal +ddcla009 class 1E-100 -> +Normal +ddcla010 class 1E-10 -> +Normal +ddcla012 class 1E-1 -> +Normal +ddcla013 class 1 -> +Normal +ddcla014 class 2.50 -> +Normal +ddcla015 class 100.100 -> +Normal +ddcla016 class 1E+30 -> +Normal +ddcla017 class 1E+384 -> +Normal +ddcla018 class 9.999999999999999E+384 -> +Normal +ddcla019 class Inf -> +Infinity + +ddcla021 class -0 -> -Zero +ddcla022 class -0.00 -> -Zero +ddcla023 class -0E+5 -> -Zero +ddcla024 class -1E-396 -> -Subnormal +ddcla025 class -0.1E-383 -> -Subnormal +ddcla026 class -0.999999999999999E-383 -> -Subnormal +ddcla027 class -1.000000000000000E-383 -> -Normal +ddcla028 class -1E-383 -> -Normal +ddcla029 class -1E-100 -> -Normal +ddcla030 class -1E-10 -> -Normal +ddcla032 class -1E-1 -> -Normal +ddcla033 class -1 -> -Normal +ddcla034 class -2.50 -> -Normal +ddcla035 class -100.100 -> -Normal +ddcla036 class -1E+30 -> -Normal +ddcla037 class -1E+384 -> -Normal +ddcla038 class -9.999999999999999E+384 -> -Normal +ddcla039 class -Inf -> -Infinity + +ddcla041 class NaN -> NaN +ddcla042 class -NaN -> NaN +ddcla043 class +NaN12345 -> NaN +ddcla044 class sNaN -> sNaN +ddcla045 class -sNaN -> sNaN +ddcla046 class +sNaN12345 -> sNaN + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompare.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompare.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,744 @@ +------------------------------------------------------------------------ +-- ddCompare.decTest -- decDouble comparison that allows quiet NaNs -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddcom001 compare -2 -2 -> 0 +ddcom002 compare -2 -1 -> -1 +ddcom003 compare -2 0 -> -1 +ddcom004 compare -2 1 -> -1 +ddcom005 compare -2 2 -> -1 +ddcom006 compare -1 -2 -> 1 +ddcom007 compare -1 -1 -> 0 +ddcom008 compare -1 0 -> -1 +ddcom009 compare -1 1 -> -1 +ddcom010 compare -1 2 -> -1 +ddcom011 compare 0 -2 -> 1 +ddcom012 compare 0 -1 -> 1 +ddcom013 compare 0 0 -> 0 +ddcom014 compare 0 1 -> -1 +ddcom015 compare 0 2 -> -1 +ddcom016 compare 1 -2 -> 1 +ddcom017 compare 1 -1 -> 1 +ddcom018 compare 1 0 -> 1 +ddcom019 compare 1 1 -> 0 +ddcom020 compare 1 2 -> -1 +ddcom021 compare 2 -2 -> 1 +ddcom022 compare 2 -1 -> 1 +ddcom023 compare 2 0 -> 1 +ddcom025 compare 2 1 -> 1 +ddcom026 compare 2 2 -> 0 + +ddcom031 compare -20 -20 -> 0 +ddcom032 compare -20 -10 -> -1 +ddcom033 compare -20 00 -> -1 +ddcom034 compare -20 10 -> -1 +ddcom035 compare -20 20 -> -1 +ddcom036 compare -10 -20 -> 1 +ddcom037 compare -10 -10 -> 0 +ddcom038 compare -10 00 -> -1 +ddcom039 compare -10 10 -> -1 +ddcom040 compare -10 20 -> -1 +ddcom041 compare 00 -20 -> 1 +ddcom042 compare 00 -10 -> 1 +ddcom043 compare 00 00 -> 0 +ddcom044 compare 00 10 -> -1 +ddcom045 compare 00 20 -> -1 +ddcom046 compare 10 -20 -> 1 +ddcom047 compare 10 -10 -> 1 +ddcom048 compare 10 00 -> 1 +ddcom049 compare 10 10 -> 0 +ddcom050 compare 10 20 -> -1 +ddcom051 compare 20 -20 -> 1 +ddcom052 compare 20 -10 -> 1 +ddcom053 compare 20 00 -> 1 +ddcom055 compare 20 10 -> 1 +ddcom056 compare 20 20 -> 0 + +ddcom061 compare -2.0 -2.0 -> 0 +ddcom062 compare -2.0 -1.0 -> -1 +ddcom063 compare -2.0 0.0 -> -1 +ddcom064 compare -2.0 1.0 -> -1 +ddcom065 compare -2.0 2.0 -> -1 +ddcom066 compare -1.0 -2.0 -> 1 +ddcom067 compare -1.0 -1.0 -> 0 +ddcom068 compare -1.0 0.0 -> -1 +ddcom069 compare -1.0 1.0 -> -1 +ddcom070 compare -1.0 2.0 -> -1 +ddcom071 compare 0.0 -2.0 -> 1 +ddcom072 compare 0.0 -1.0 -> 1 +ddcom073 compare 0.0 0.0 -> 0 +ddcom074 compare 0.0 1.0 -> -1 +ddcom075 compare 0.0 2.0 -> -1 +ddcom076 compare 1.0 -2.0 -> 1 +ddcom077 compare 1.0 -1.0 -> 1 +ddcom078 compare 1.0 0.0 -> 1 +ddcom079 compare 1.0 1.0 -> 0 +ddcom080 compare 1.0 2.0 -> -1 +ddcom081 compare 2.0 -2.0 -> 1 +ddcom082 compare 2.0 -1.0 -> 1 +ddcom083 compare 2.0 0.0 -> 1 +ddcom085 compare 2.0 1.0 -> 1 +ddcom086 compare 2.0 2.0 -> 0 +ddcom087 compare 1.0 0.1 -> 1 +ddcom088 compare 0.1 1.0 -> -1 + +-- now some cases which might overflow if subtract were used +ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0 +ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1 +ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1 +ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0 + +-- some differing length/exponent cases +ddcom100 compare 7.0 7.0 -> 0 +ddcom101 compare 7.0 7 -> 0 +ddcom102 compare 7 7.0 -> 0 +ddcom103 compare 7E+0 7.0 -> 0 +ddcom104 compare 70E-1 7.0 -> 0 +ddcom105 compare 0.7E+1 7 -> 0 +ddcom106 compare 70E-1 7 -> 0 +ddcom107 compare 7.0 7E+0 -> 0 +ddcom108 compare 7.0 70E-1 -> 0 +ddcom109 compare 7 0.7E+1 -> 0 +ddcom110 compare 7 70E-1 -> 0 + +ddcom120 compare 8.0 7.0 -> 1 +ddcom121 compare 8.0 7 -> 1 +ddcom122 compare 8 7.0 -> 1 +ddcom123 compare 8E+0 7.0 -> 1 +ddcom124 compare 80E-1 7.0 -> 1 +ddcom125 compare 0.8E+1 7 -> 1 +ddcom126 compare 80E-1 7 -> 1 +ddcom127 compare 8.0 7E+0 -> 1 +ddcom128 compare 8.0 70E-1 -> 1 +ddcom129 compare 8 0.7E+1 -> 1 +ddcom130 compare 8 70E-1 -> 1 + +ddcom140 compare 8.0 9.0 -> -1 +ddcom141 compare 8.0 9 -> -1 +ddcom142 compare 8 9.0 -> -1 +ddcom143 compare 8E+0 9.0 -> -1 +ddcom144 compare 80E-1 9.0 -> -1 +ddcom145 compare 0.8E+1 9 -> -1 +ddcom146 compare 80E-1 9 -> -1 +ddcom147 compare 8.0 9E+0 -> -1 +ddcom148 compare 8.0 90E-1 -> -1 +ddcom149 compare 8 0.9E+1 -> -1 +ddcom150 compare 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +ddcom200 compare -7.0 7.0 -> -1 +ddcom201 compare -7.0 7 -> -1 +ddcom202 compare -7 7.0 -> -1 +ddcom203 compare -7E+0 7.0 -> -1 +ddcom204 compare -70E-1 7.0 -> -1 +ddcom205 compare -0.7E+1 7 -> -1 +ddcom206 compare -70E-1 7 -> -1 +ddcom207 compare -7.0 7E+0 -> -1 +ddcom208 compare -7.0 70E-1 -> -1 +ddcom209 compare -7 0.7E+1 -> -1 +ddcom210 compare -7 70E-1 -> -1 + +ddcom220 compare -8.0 7.0 -> -1 +ddcom221 compare -8.0 7 -> -1 +ddcom222 compare -8 7.0 -> -1 +ddcom223 compare -8E+0 7.0 -> -1 +ddcom224 compare -80E-1 7.0 -> -1 +ddcom225 compare -0.8E+1 7 -> -1 +ddcom226 compare -80E-1 7 -> -1 +ddcom227 compare -8.0 7E+0 -> -1 +ddcom228 compare -8.0 70E-1 -> -1 +ddcom229 compare -8 0.7E+1 -> -1 +ddcom230 compare -8 70E-1 -> -1 + +ddcom240 compare -8.0 9.0 -> -1 +ddcom241 compare -8.0 9 -> -1 +ddcom242 compare -8 9.0 -> -1 +ddcom243 compare -8E+0 9.0 -> -1 +ddcom244 compare -80E-1 9.0 -> -1 +ddcom245 compare -0.8E+1 9 -> -1 +ddcom246 compare -80E-1 9 -> -1 +ddcom247 compare -8.0 9E+0 -> -1 +ddcom248 compare -8.0 90E-1 -> -1 +ddcom249 compare -8 0.9E+1 -> -1 +ddcom250 compare -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +ddcom300 compare 7.0 -7.0 -> 1 +ddcom301 compare 7.0 -7 -> 1 +ddcom302 compare 7 -7.0 -> 1 +ddcom303 compare 7E+0 -7.0 -> 1 +ddcom304 compare 70E-1 -7.0 -> 1 +ddcom305 compare .7E+1 -7 -> 1 +ddcom306 compare 70E-1 -7 -> 1 +ddcom307 compare 7.0 -7E+0 -> 1 +ddcom308 compare 7.0 -70E-1 -> 1 +ddcom309 compare 7 -.7E+1 -> 1 +ddcom310 compare 7 -70E-1 -> 1 + +ddcom320 compare 8.0 -7.0 -> 1 +ddcom321 compare 8.0 -7 -> 1 +ddcom322 compare 8 -7.0 -> 1 +ddcom323 compare 8E+0 -7.0 -> 1 +ddcom324 compare 80E-1 -7.0 -> 1 +ddcom325 compare .8E+1 -7 -> 1 +ddcom326 compare 80E-1 -7 -> 1 +ddcom327 compare 8.0 -7E+0 -> 1 +ddcom328 compare 8.0 -70E-1 -> 1 +ddcom329 compare 8 -.7E+1 -> 1 +ddcom330 compare 8 -70E-1 -> 1 + +ddcom340 compare 8.0 -9.0 -> 1 +ddcom341 compare 8.0 -9 -> 1 +ddcom342 compare 8 -9.0 -> 1 +ddcom343 compare 8E+0 -9.0 -> 1 +ddcom344 compare 80E-1 -9.0 -> 1 +ddcom345 compare .8E+1 -9 -> 1 +ddcom346 compare 80E-1 -9 -> 1 +ddcom347 compare 8.0 -9E+0 -> 1 +ddcom348 compare 8.0 -90E-1 -> 1 +ddcom349 compare 8 -.9E+1 -> 1 +ddcom350 compare 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +ddcom400 compare -7.0 -7.0 -> 0 +ddcom401 compare -7.0 -7 -> 0 +ddcom402 compare -7 -7.0 -> 0 +ddcom403 compare -7E+0 -7.0 -> 0 +ddcom404 compare -70E-1 -7.0 -> 0 +ddcom405 compare -.7E+1 -7 -> 0 +ddcom406 compare -70E-1 -7 -> 0 +ddcom407 compare -7.0 -7E+0 -> 0 +ddcom408 compare -7.0 -70E-1 -> 0 +ddcom409 compare -7 -.7E+1 -> 0 +ddcom410 compare -7 -70E-1 -> 0 + +ddcom420 compare -8.0 -7.0 -> -1 +ddcom421 compare -8.0 -7 -> -1 +ddcom422 compare -8 -7.0 -> -1 +ddcom423 compare -8E+0 -7.0 -> -1 +ddcom424 compare -80E-1 -7.0 -> -1 +ddcom425 compare -.8E+1 -7 -> -1 +ddcom426 compare -80E-1 -7 -> -1 +ddcom427 compare -8.0 -7E+0 -> -1 +ddcom428 compare -8.0 -70E-1 -> -1 +ddcom429 compare -8 -.7E+1 -> -1 +ddcom430 compare -8 -70E-1 -> -1 + +ddcom440 compare -8.0 -9.0 -> 1 +ddcom441 compare -8.0 -9 -> 1 +ddcom442 compare -8 -9.0 -> 1 +ddcom443 compare -8E+0 -9.0 -> 1 +ddcom444 compare -80E-1 -9.0 -> 1 +ddcom445 compare -.8E+1 -9 -> 1 +ddcom446 compare -80E-1 -9 -> 1 +ddcom447 compare -8.0 -9E+0 -> 1 +ddcom448 compare -8.0 -90E-1 -> 1 +ddcom449 compare -8 -.9E+1 -> 1 +ddcom450 compare -8 -90E-1 -> 1 + +-- misalignment traps for little-endian +ddcom451 compare 1.0 0.1 -> 1 +ddcom452 compare 0.1 1.0 -> -1 +ddcom453 compare 10.0 0.1 -> 1 +ddcom454 compare 0.1 10.0 -> -1 +ddcom455 compare 100 1.0 -> 1 +ddcom456 compare 1.0 100 -> -1 +ddcom457 compare 1000 10.0 -> 1 +ddcom458 compare 10.0 1000 -> -1 +ddcom459 compare 10000 100.0 -> 1 +ddcom460 compare 100.0 10000 -> -1 +ddcom461 compare 100000 1000.0 -> 1 +ddcom462 compare 1000.0 100000 -> -1 +ddcom463 compare 1000000 10000.0 -> 1 +ddcom464 compare 10000.0 1000000 -> -1 + +-- testcases that subtract to lots of zeros at boundaries [pgr] +ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0 +ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0 +ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0 +ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0 +ddcom477 compare 123.456000000E-89 123.456E-89 -> 0 +ddcom478 compare 123.45600000E+89 123.456E+89 -> 0 +ddcom479 compare 123.4560000E-89 123.456E-89 -> 0 +ddcom480 compare 123.456000E+89 123.456E+89 -> 0 +ddcom481 compare 123.45600E-89 123.456E-89 -> 0 +ddcom482 compare 123.4560E+89 123.456E+89 -> 0 +ddcom483 compare 123.456E-89 123.456E-89 -> 0 +ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0 +ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0 +ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0 +ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0 +ddcom491 compare 123.456E+89 123.456000000E+89 -> 0 +ddcom492 compare 123.456E-89 123.45600000E-89 -> 0 +ddcom493 compare 123.456E+89 123.4560000E+89 -> 0 +ddcom494 compare 123.456E-89 123.456000E-89 -> 0 +ddcom495 compare 123.456E+89 123.45600E+89 -> 0 +ddcom496 compare 123.456E-89 123.4560E-89 -> 0 +ddcom497 compare 123.456E+89 123.456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +ddcom500 compare 1 1E-15 -> 1 +ddcom501 compare 1 1E-14 -> 1 +ddcom502 compare 1 1E-13 -> 1 +ddcom503 compare 1 1E-12 -> 1 +ddcom504 compare 1 1E-11 -> 1 +ddcom505 compare 1 1E-10 -> 1 +ddcom506 compare 1 1E-9 -> 1 +ddcom507 compare 1 1E-8 -> 1 +ddcom508 compare 1 1E-7 -> 1 +ddcom509 compare 1 1E-6 -> 1 +ddcom510 compare 1 1E-5 -> 1 +ddcom511 compare 1 1E-4 -> 1 +ddcom512 compare 1 1E-3 -> 1 +ddcom513 compare 1 1E-2 -> 1 +ddcom514 compare 1 1E-1 -> 1 +ddcom515 compare 1 1E-0 -> 0 +ddcom516 compare 1 1E+1 -> -1 +ddcom517 compare 1 1E+2 -> -1 +ddcom518 compare 1 1E+3 -> -1 +ddcom519 compare 1 1E+4 -> -1 +ddcom521 compare 1 1E+5 -> -1 +ddcom522 compare 1 1E+6 -> -1 +ddcom523 compare 1 1E+7 -> -1 +ddcom524 compare 1 1E+8 -> -1 +ddcom525 compare 1 1E+9 -> -1 +ddcom526 compare 1 1E+10 -> -1 +ddcom527 compare 1 1E+11 -> -1 +ddcom528 compare 1 1E+12 -> -1 +ddcom529 compare 1 1E+13 -> -1 +ddcom530 compare 1 1E+14 -> -1 +ddcom531 compare 1 1E+15 -> -1 +-- LR swap +ddcom540 compare 1E-15 1 -> -1 +ddcom541 compare 1E-14 1 -> -1 +ddcom542 compare 1E-13 1 -> -1 +ddcom543 compare 1E-12 1 -> -1 +ddcom544 compare 1E-11 1 -> -1 +ddcom545 compare 1E-10 1 -> -1 +ddcom546 compare 1E-9 1 -> -1 +ddcom547 compare 1E-8 1 -> -1 +ddcom548 compare 1E-7 1 -> -1 +ddcom549 compare 1E-6 1 -> -1 +ddcom550 compare 1E-5 1 -> -1 +ddcom551 compare 1E-4 1 -> -1 +ddcom552 compare 1E-3 1 -> -1 +ddcom553 compare 1E-2 1 -> -1 +ddcom554 compare 1E-1 1 -> -1 +ddcom555 compare 1E-0 1 -> 0 +ddcom556 compare 1E+1 1 -> 1 +ddcom557 compare 1E+2 1 -> 1 +ddcom558 compare 1E+3 1 -> 1 +ddcom559 compare 1E+4 1 -> 1 +ddcom561 compare 1E+5 1 -> 1 +ddcom562 compare 1E+6 1 -> 1 +ddcom563 compare 1E+7 1 -> 1 +ddcom564 compare 1E+8 1 -> 1 +ddcom565 compare 1E+9 1 -> 1 +ddcom566 compare 1E+10 1 -> 1 +ddcom567 compare 1E+11 1 -> 1 +ddcom568 compare 1E+12 1 -> 1 +ddcom569 compare 1E+13 1 -> 1 +ddcom570 compare 1E+14 1 -> 1 +ddcom571 compare 1E+15 1 -> 1 +-- similar with a useful coefficient, one side only +ddcom580 compare 0.000000987654321 1E-15 -> 1 +ddcom581 compare 0.000000987654321 1E-14 -> 1 +ddcom582 compare 0.000000987654321 1E-13 -> 1 +ddcom583 compare 0.000000987654321 1E-12 -> 1 +ddcom584 compare 0.000000987654321 1E-11 -> 1 +ddcom585 compare 0.000000987654321 1E-10 -> 1 +ddcom586 compare 0.000000987654321 1E-9 -> 1 +ddcom587 compare 0.000000987654321 1E-8 -> 1 +ddcom588 compare 0.000000987654321 1E-7 -> 1 +ddcom589 compare 0.000000987654321 1E-6 -> -1 +ddcom590 compare 0.000000987654321 1E-5 -> -1 +ddcom591 compare 0.000000987654321 1E-4 -> -1 +ddcom592 compare 0.000000987654321 1E-3 -> -1 +ddcom593 compare 0.000000987654321 1E-2 -> -1 +ddcom594 compare 0.000000987654321 1E-1 -> -1 +ddcom595 compare 0.000000987654321 1E-0 -> -1 +ddcom596 compare 0.000000987654321 1E+1 -> -1 +ddcom597 compare 0.000000987654321 1E+2 -> -1 +ddcom598 compare 0.000000987654321 1E+3 -> -1 +ddcom599 compare 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +ddcom600 compare 12 12.2345 -> -1 +ddcom601 compare 12.0 12.2345 -> -1 +ddcom602 compare 12.00 12.2345 -> -1 +ddcom603 compare 12.000 12.2345 -> -1 +ddcom604 compare 12.0000 12.2345 -> -1 +ddcom605 compare 12.00000 12.2345 -> -1 +ddcom606 compare 12.000000 12.2345 -> -1 +ddcom607 compare 12.0000000 12.2345 -> -1 +ddcom608 compare 12.00000000 12.2345 -> -1 +ddcom609 compare 12.000000000 12.2345 -> -1 +ddcom610 compare 12.1234 12 -> 1 +ddcom611 compare 12.1234 12.0 -> 1 +ddcom612 compare 12.1234 12.00 -> 1 +ddcom613 compare 12.1234 12.000 -> 1 +ddcom614 compare 12.1234 12.0000 -> 1 +ddcom615 compare 12.1234 12.00000 -> 1 +ddcom616 compare 12.1234 12.000000 -> 1 +ddcom617 compare 12.1234 12.0000000 -> 1 +ddcom618 compare 12.1234 12.00000000 -> 1 +ddcom619 compare 12.1234 12.000000000 -> 1 +ddcom620 compare -12 -12.2345 -> 1 +ddcom621 compare -12.0 -12.2345 -> 1 +ddcom622 compare -12.00 -12.2345 -> 1 +ddcom623 compare -12.000 -12.2345 -> 1 +ddcom624 compare -12.0000 -12.2345 -> 1 +ddcom625 compare -12.00000 -12.2345 -> 1 +ddcom626 compare -12.000000 -12.2345 -> 1 +ddcom627 compare -12.0000000 -12.2345 -> 1 +ddcom628 compare -12.00000000 -12.2345 -> 1 +ddcom629 compare -12.000000000 -12.2345 -> 1 +ddcom630 compare -12.1234 -12 -> -1 +ddcom631 compare -12.1234 -12.0 -> -1 +ddcom632 compare -12.1234 -12.00 -> -1 +ddcom633 compare -12.1234 -12.000 -> -1 +ddcom634 compare -12.1234 -12.0000 -> -1 +ddcom635 compare -12.1234 -12.00000 -> -1 +ddcom636 compare -12.1234 -12.000000 -> -1 +ddcom637 compare -12.1234 -12.0000000 -> -1 +ddcom638 compare -12.1234 -12.00000000 -> -1 +ddcom639 compare -12.1234 -12.000000000 -> -1 + +-- extended zeros +ddcom640 compare 0 0 -> 0 +ddcom641 compare 0 -0 -> 0 +ddcom642 compare 0 -0.0 -> 0 +ddcom643 compare 0 0.0 -> 0 +ddcom644 compare -0 0 -> 0 +ddcom645 compare -0 -0 -> 0 +ddcom646 compare -0 -0.0 -> 0 +ddcom647 compare -0 0.0 -> 0 +ddcom648 compare 0.0 0 -> 0 +ddcom649 compare 0.0 -0 -> 0 +ddcom650 compare 0.0 -0.0 -> 0 +ddcom651 compare 0.0 0.0 -> 0 +ddcom652 compare -0.0 0 -> 0 +ddcom653 compare -0.0 -0 -> 0 +ddcom654 compare -0.0 -0.0 -> 0 +ddcom655 compare -0.0 0.0 -> 0 + +ddcom656 compare -0E1 0.0 -> 0 +ddcom657 compare -0E2 0.0 -> 0 +ddcom658 compare 0E1 0.0 -> 0 +ddcom659 compare 0E2 0.0 -> 0 +ddcom660 compare -0E1 0 -> 0 +ddcom661 compare -0E2 0 -> 0 +ddcom662 compare 0E1 0 -> 0 +ddcom663 compare 0E2 0 -> 0 +ddcom664 compare -0E1 -0E1 -> 0 +ddcom665 compare -0E2 -0E1 -> 0 +ddcom666 compare 0E1 -0E1 -> 0 +ddcom667 compare 0E2 -0E1 -> 0 +ddcom668 compare -0E1 -0E2 -> 0 +ddcom669 compare -0E2 -0E2 -> 0 +ddcom670 compare 0E1 -0E2 -> 0 +ddcom671 compare 0E2 -0E2 -> 0 +ddcom672 compare -0E1 0E1 -> 0 +ddcom673 compare -0E2 0E1 -> 0 +ddcom674 compare 0E1 0E1 -> 0 +ddcom675 compare 0E2 0E1 -> 0 +ddcom676 compare -0E1 0E2 -> 0 +ddcom677 compare -0E2 0E2 -> 0 +ddcom678 compare 0E1 0E2 -> 0 +ddcom679 compare 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +ddcom680 compare 12 12 -> 0 +ddcom681 compare 12 12.0 -> 0 +ddcom682 compare 12 12.00 -> 0 +ddcom683 compare 12 12.000 -> 0 +ddcom684 compare 12 12.0000 -> 0 +ddcom685 compare 12 12.00000 -> 0 +ddcom686 compare 12 12.000000 -> 0 +ddcom687 compare 12 12.0000000 -> 0 +ddcom688 compare 12 12.00000000 -> 0 +ddcom689 compare 12 12.000000000 -> 0 +ddcom690 compare 12 12 -> 0 +ddcom691 compare 12.0 12 -> 0 +ddcom692 compare 12.00 12 -> 0 +ddcom693 compare 12.000 12 -> 0 +ddcom694 compare 12.0000 12 -> 0 +ddcom695 compare 12.00000 12 -> 0 +ddcom696 compare 12.000000 12 -> 0 +ddcom697 compare 12.0000000 12 -> 0 +ddcom698 compare 12.00000000 12 -> 0 +ddcom699 compare 12.000000000 12 -> 0 + +-- first, second, & last digit +ddcom700 compare 1234567890123456 1234567890123455 -> 1 +ddcom701 compare 1234567890123456 1234567890123456 -> 0 +ddcom702 compare 1234567890123456 1234567890123457 -> -1 +ddcom703 compare 1234567890123456 0234567890123456 -> 1 +ddcom704 compare 1234567890123456 1234567890123456 -> 0 +ddcom705 compare 1234567890123456 2234567890123456 -> -1 +ddcom706 compare 1134567890123456 1034567890123456 -> 1 +ddcom707 compare 1134567890123456 1134567890123456 -> 0 +ddcom708 compare 1134567890123456 1234567890123456 -> -1 + +-- miscellaneous +ddcom721 compare 12345678000 1 -> 1 +ddcom722 compare 1 12345678000 -> -1 +ddcom723 compare 1234567800 1 -> 1 +ddcom724 compare 1 1234567800 -> -1 +ddcom725 compare 1234567890 1 -> 1 +ddcom726 compare 1 1234567890 -> -1 +ddcom727 compare 1234567891 1 -> 1 +ddcom728 compare 1 1234567891 -> -1 +ddcom729 compare 12345678901 1 -> 1 +ddcom730 compare 1 12345678901 -> -1 +ddcom731 compare 1234567896 1 -> 1 +ddcom732 compare 1 1234567896 -> -1 + +-- residue cases at lower precision +ddcom740 compare 1 0.9999999 -> 1 +ddcom741 compare 1 0.999999 -> 1 +ddcom742 compare 1 0.99999 -> 1 +ddcom743 compare 1 1.0000 -> 0 +ddcom744 compare 1 1.00001 -> -1 +ddcom745 compare 1 1.000001 -> -1 +ddcom746 compare 1 1.0000001 -> -1 +ddcom750 compare 0.9999999 1 -> -1 +ddcom751 compare 0.999999 1 -> -1 +ddcom752 compare 0.99999 1 -> -1 +ddcom753 compare 1.0000 1 -> 0 +ddcom754 compare 1.00001 1 -> 1 +ddcom755 compare 1.000001 1 -> 1 +ddcom756 compare 1.0000001 1 -> 1 + +-- Specials +ddcom780 compare Inf -Inf -> 1 +ddcom781 compare Inf -1000 -> 1 +ddcom782 compare Inf -1 -> 1 +ddcom783 compare Inf -0 -> 1 +ddcom784 compare Inf 0 -> 1 +ddcom785 compare Inf 1 -> 1 +ddcom786 compare Inf 1000 -> 1 +ddcom787 compare Inf Inf -> 0 +ddcom788 compare -1000 Inf -> -1 +ddcom789 compare -Inf Inf -> -1 +ddcom790 compare -1 Inf -> -1 +ddcom791 compare -0 Inf -> -1 +ddcom792 compare 0 Inf -> -1 +ddcom793 compare 1 Inf -> -1 +ddcom794 compare 1000 Inf -> -1 +ddcom795 compare Inf Inf -> 0 + +ddcom800 compare -Inf -Inf -> 0 +ddcom801 compare -Inf -1000 -> -1 +ddcom802 compare -Inf -1 -> -1 +ddcom803 compare -Inf -0 -> -1 +ddcom804 compare -Inf 0 -> -1 +ddcom805 compare -Inf 1 -> -1 +ddcom806 compare -Inf 1000 -> -1 +ddcom807 compare -Inf Inf -> -1 +ddcom808 compare -Inf -Inf -> 0 +ddcom809 compare -1000 -Inf -> 1 +ddcom810 compare -1 -Inf -> 1 +ddcom811 compare -0 -Inf -> 1 +ddcom812 compare 0 -Inf -> 1 +ddcom813 compare 1 -Inf -> 1 +ddcom814 compare 1000 -Inf -> 1 +ddcom815 compare Inf -Inf -> 1 + +ddcom821 compare NaN -Inf -> NaN +ddcom822 compare NaN -1000 -> NaN +ddcom823 compare NaN -1 -> NaN +ddcom824 compare NaN -0 -> NaN +ddcom825 compare NaN 0 -> NaN +ddcom826 compare NaN 1 -> NaN +ddcom827 compare NaN 1000 -> NaN +ddcom828 compare NaN Inf -> NaN +ddcom829 compare NaN NaN -> NaN +ddcom830 compare -Inf NaN -> NaN +ddcom831 compare -1000 NaN -> NaN +ddcom832 compare -1 NaN -> NaN +ddcom833 compare -0 NaN -> NaN +ddcom834 compare 0 NaN -> NaN +ddcom835 compare 1 NaN -> NaN +ddcom836 compare 1000 NaN -> NaN +ddcom837 compare Inf NaN -> NaN +ddcom838 compare -NaN -NaN -> -NaN +ddcom839 compare +NaN -NaN -> NaN +ddcom840 compare -NaN +NaN -> -NaN + +ddcom841 compare sNaN -Inf -> NaN Invalid_operation +ddcom842 compare sNaN -1000 -> NaN Invalid_operation +ddcom843 compare sNaN -1 -> NaN Invalid_operation +ddcom844 compare sNaN -0 -> NaN Invalid_operation +ddcom845 compare sNaN 0 -> NaN Invalid_operation +ddcom846 compare sNaN 1 -> NaN Invalid_operation +ddcom847 compare sNaN 1000 -> NaN Invalid_operation +ddcom848 compare sNaN NaN -> NaN Invalid_operation +ddcom849 compare sNaN sNaN -> NaN Invalid_operation +ddcom850 compare NaN sNaN -> NaN Invalid_operation +ddcom851 compare -Inf sNaN -> NaN Invalid_operation +ddcom852 compare -1000 sNaN -> NaN Invalid_operation +ddcom853 compare -1 sNaN -> NaN Invalid_operation +ddcom854 compare -0 sNaN -> NaN Invalid_operation +ddcom855 compare 0 sNaN -> NaN Invalid_operation +ddcom856 compare 1 sNaN -> NaN Invalid_operation +ddcom857 compare 1000 sNaN -> NaN Invalid_operation +ddcom858 compare Inf sNaN -> NaN Invalid_operation +ddcom859 compare NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddcom860 compare NaN9 -Inf -> NaN9 +ddcom861 compare NaN8 999 -> NaN8 +ddcom862 compare NaN77 Inf -> NaN77 +ddcom863 compare -NaN67 NaN5 -> -NaN67 +ddcom864 compare -Inf -NaN4 -> -NaN4 +ddcom865 compare -999 -NaN33 -> -NaN33 +ddcom866 compare Inf NaN2 -> NaN2 +ddcom867 compare -NaN41 -NaN42 -> -NaN41 +ddcom868 compare +NaN41 -NaN42 -> NaN41 +ddcom869 compare -NaN41 +NaN42 -> -NaN41 +ddcom870 compare +NaN41 +NaN42 -> NaN41 + +ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation +ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation +ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation +ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation +ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation +ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation +ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation +ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation +ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation + +-- wide range +ddcom880 compare +1.23456789012345E-0 9E+384 -> -1 +ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1 +ddcom882 compare +0.100 9E-383 -> 1 +ddcom883 compare 9E-383 +0.100 -> -1 +ddcom885 compare -1.23456789012345E-0 9E+384 -> -1 +ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1 +ddcom887 compare -0.100 9E-383 -> -1 +ddcom888 compare 9E-383 -0.100 -> 1 + +-- spread zeros +ddcom900 compare 0E-383 0 -> 0 +ddcom901 compare 0E-383 -0 -> 0 +ddcom902 compare -0E-383 0 -> 0 +ddcom903 compare -0E-383 -0 -> 0 +ddcom904 compare 0E-383 0E+384 -> 0 +ddcom905 compare 0E-383 -0E+384 -> 0 +ddcom906 compare -0E-383 0E+384 -> 0 +ddcom907 compare -0E-383 -0E+384 -> 0 +ddcom908 compare 0 0E+384 -> 0 +ddcom909 compare 0 -0E+384 -> 0 +ddcom910 compare -0 0E+384 -> 0 +ddcom911 compare -0 -0E+384 -> 0 +ddcom930 compare 0E+384 0 -> 0 +ddcom931 compare 0E+384 -0 -> 0 +ddcom932 compare -0E+384 0 -> 0 +ddcom933 compare -0E+384 -0 -> 0 +ddcom934 compare 0E+384 0E-383 -> 0 +ddcom935 compare 0E+384 -0E-383 -> 0 +ddcom936 compare -0E+384 0E-383 -> 0 +ddcom937 compare -0E+384 -0E-383 -> 0 +ddcom938 compare 0 0E-383 -> 0 +ddcom939 compare 0 -0E-383 -> 0 +ddcom940 compare -0 0E-383 -> 0 +ddcom941 compare -0 -0E-383 -> 0 + +-- signs +ddcom961 compare 1e+77 1e+11 -> 1 +ddcom962 compare 1e+77 -1e+11 -> 1 +ddcom963 compare -1e+77 1e+11 -> -1 +ddcom964 compare -1e+77 -1e+11 -> -1 +ddcom965 compare 1e-77 1e-11 -> -1 +ddcom966 compare 1e-77 -1e-11 -> 1 +ddcom967 compare -1e-77 1e-11 -> -1 +ddcom968 compare -1e-77 -1e-11 -> 1 + +-- full alignment range, both ways +ddcomp1001 compare 1 1.000000000000000 -> 0 +ddcomp1002 compare 1 1.00000000000000 -> 0 +ddcomp1003 compare 1 1.0000000000000 -> 0 +ddcomp1004 compare 1 1.000000000000 -> 0 +ddcomp1005 compare 1 1.00000000000 -> 0 +ddcomp1006 compare 1 1.0000000000 -> 0 +ddcomp1007 compare 1 1.000000000 -> 0 +ddcomp1008 compare 1 1.00000000 -> 0 +ddcomp1009 compare 1 1.0000000 -> 0 +ddcomp1010 compare 1 1.000000 -> 0 +ddcomp1011 compare 1 1.00000 -> 0 +ddcomp1012 compare 1 1.0000 -> 0 +ddcomp1013 compare 1 1.000 -> 0 +ddcomp1014 compare 1 1.00 -> 0 +ddcomp1015 compare 1 1.0 -> 0 +ddcomp1021 compare 1.000000000000000 1 -> 0 +ddcomp1022 compare 1.00000000000000 1 -> 0 +ddcomp1023 compare 1.0000000000000 1 -> 0 +ddcomp1024 compare 1.000000000000 1 -> 0 +ddcomp1025 compare 1.00000000000 1 -> 0 +ddcomp1026 compare 1.0000000000 1 -> 0 +ddcomp1027 compare 1.000000000 1 -> 0 +ddcomp1028 compare 1.00000000 1 -> 0 +ddcomp1029 compare 1.0000000 1 -> 0 +ddcomp1030 compare 1.000000 1 -> 0 +ddcomp1031 compare 1.00000 1 -> 0 +ddcomp1032 compare 1.0000 1 -> 0 +ddcomp1033 compare 1.000 1 -> 0 +ddcomp1034 compare 1.00 1 -> 0 +ddcomp1035 compare 1.0 1 -> 0 + +-- check MSD always detected non-zero +ddcomp1040 compare 0 0.000000000000000 -> 0 +ddcomp1041 compare 0 1.000000000000000 -> -1 +ddcomp1042 compare 0 2.000000000000000 -> -1 +ddcomp1043 compare 0 3.000000000000000 -> -1 +ddcomp1044 compare 0 4.000000000000000 -> -1 +ddcomp1045 compare 0 5.000000000000000 -> -1 +ddcomp1046 compare 0 6.000000000000000 -> -1 +ddcomp1047 compare 0 7.000000000000000 -> -1 +ddcomp1048 compare 0 8.000000000000000 -> -1 +ddcomp1049 compare 0 9.000000000000000 -> -1 +ddcomp1050 compare 0.000000000000000 0 -> 0 +ddcomp1051 compare 1.000000000000000 0 -> 1 +ddcomp1052 compare 2.000000000000000 0 -> 1 +ddcomp1053 compare 3.000000000000000 0 -> 1 +ddcomp1054 compare 4.000000000000000 0 -> 1 +ddcomp1055 compare 5.000000000000000 0 -> 1 +ddcomp1056 compare 6.000000000000000 0 -> 1 +ddcomp1057 compare 7.000000000000000 0 -> 1 +ddcomp1058 compare 8.000000000000000 0 -> 1 +ddcomp1059 compare 9.000000000000000 0 -> 1 + +-- Null tests +ddcom9990 compare 10 # -> NaN Invalid_operation +ddcom9991 compare # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareSig.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareSig.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,647 @@ +------------------------------------------------------------------------ +-- ddCompareSig.decTest -- decDouble comparison; all NaNs signal -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddcms001 comparesig -2 -2 -> 0 +ddcms002 comparesig -2 -1 -> -1 +ddcms003 comparesig -2 0 -> -1 +ddcms004 comparesig -2 1 -> -1 +ddcms005 comparesig -2 2 -> -1 +ddcms006 comparesig -1 -2 -> 1 +ddcms007 comparesig -1 -1 -> 0 +ddcms008 comparesig -1 0 -> -1 +ddcms009 comparesig -1 1 -> -1 +ddcms010 comparesig -1 2 -> -1 +ddcms011 comparesig 0 -2 -> 1 +ddcms012 comparesig 0 -1 -> 1 +ddcms013 comparesig 0 0 -> 0 +ddcms014 comparesig 0 1 -> -1 +ddcms015 comparesig 0 2 -> -1 +ddcms016 comparesig 1 -2 -> 1 +ddcms017 comparesig 1 -1 -> 1 +ddcms018 comparesig 1 0 -> 1 +ddcms019 comparesig 1 1 -> 0 +ddcms020 comparesig 1 2 -> -1 +ddcms021 comparesig 2 -2 -> 1 +ddcms022 comparesig 2 -1 -> 1 +ddcms023 comparesig 2 0 -> 1 +ddcms025 comparesig 2 1 -> 1 +ddcms026 comparesig 2 2 -> 0 + +ddcms031 comparesig -20 -20 -> 0 +ddcms032 comparesig -20 -10 -> -1 +ddcms033 comparesig -20 00 -> -1 +ddcms034 comparesig -20 10 -> -1 +ddcms035 comparesig -20 20 -> -1 +ddcms036 comparesig -10 -20 -> 1 +ddcms037 comparesig -10 -10 -> 0 +ddcms038 comparesig -10 00 -> -1 +ddcms039 comparesig -10 10 -> -1 +ddcms040 comparesig -10 20 -> -1 +ddcms041 comparesig 00 -20 -> 1 +ddcms042 comparesig 00 -10 -> 1 +ddcms043 comparesig 00 00 -> 0 +ddcms044 comparesig 00 10 -> -1 +ddcms045 comparesig 00 20 -> -1 +ddcms046 comparesig 10 -20 -> 1 +ddcms047 comparesig 10 -10 -> 1 +ddcms048 comparesig 10 00 -> 1 +ddcms049 comparesig 10 10 -> 0 +ddcms050 comparesig 10 20 -> -1 +ddcms051 comparesig 20 -20 -> 1 +ddcms052 comparesig 20 -10 -> 1 +ddcms053 comparesig 20 00 -> 1 +ddcms055 comparesig 20 10 -> 1 +ddcms056 comparesig 20 20 -> 0 + +ddcms061 comparesig -2.0 -2.0 -> 0 +ddcms062 comparesig -2.0 -1.0 -> -1 +ddcms063 comparesig -2.0 0.0 -> -1 +ddcms064 comparesig -2.0 1.0 -> -1 +ddcms065 comparesig -2.0 2.0 -> -1 +ddcms066 comparesig -1.0 -2.0 -> 1 +ddcms067 comparesig -1.0 -1.0 -> 0 +ddcms068 comparesig -1.0 0.0 -> -1 +ddcms069 comparesig -1.0 1.0 -> -1 +ddcms070 comparesig -1.0 2.0 -> -1 +ddcms071 comparesig 0.0 -2.0 -> 1 +ddcms072 comparesig 0.0 -1.0 -> 1 +ddcms073 comparesig 0.0 0.0 -> 0 +ddcms074 comparesig 0.0 1.0 -> -1 +ddcms075 comparesig 0.0 2.0 -> -1 +ddcms076 comparesig 1.0 -2.0 -> 1 +ddcms077 comparesig 1.0 -1.0 -> 1 +ddcms078 comparesig 1.0 0.0 -> 1 +ddcms079 comparesig 1.0 1.0 -> 0 +ddcms080 comparesig 1.0 2.0 -> -1 +ddcms081 comparesig 2.0 -2.0 -> 1 +ddcms082 comparesig 2.0 -1.0 -> 1 +ddcms083 comparesig 2.0 0.0 -> 1 +ddcms085 comparesig 2.0 1.0 -> 1 +ddcms086 comparesig 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +ddcms090 comparesig 9.999999999999999E+384 9.999999999999999E+384 -> 0 +ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384 -> -1 +ddcms092 comparesig 9.999999999999999E+384 -9.999999999999999E+384 -> 1 +ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0 + +-- some differing length/exponent cases +ddcms100 comparesig 7.0 7.0 -> 0 +ddcms101 comparesig 7.0 7 -> 0 +ddcms102 comparesig 7 7.0 -> 0 +ddcms103 comparesig 7E+0 7.0 -> 0 +ddcms104 comparesig 70E-1 7.0 -> 0 +ddcms105 comparesig 0.7E+1 7 -> 0 +ddcms106 comparesig 70E-1 7 -> 0 +ddcms107 comparesig 7.0 7E+0 -> 0 +ddcms108 comparesig 7.0 70E-1 -> 0 +ddcms109 comparesig 7 0.7E+1 -> 0 +ddcms110 comparesig 7 70E-1 -> 0 + +ddcms120 comparesig 8.0 7.0 -> 1 +ddcms121 comparesig 8.0 7 -> 1 +ddcms122 comparesig 8 7.0 -> 1 +ddcms123 comparesig 8E+0 7.0 -> 1 +ddcms124 comparesig 80E-1 7.0 -> 1 +ddcms125 comparesig 0.8E+1 7 -> 1 +ddcms126 comparesig 80E-1 7 -> 1 +ddcms127 comparesig 8.0 7E+0 -> 1 +ddcms128 comparesig 8.0 70E-1 -> 1 +ddcms129 comparesig 8 0.7E+1 -> 1 +ddcms130 comparesig 8 70E-1 -> 1 + +ddcms140 comparesig 8.0 9.0 -> -1 +ddcms141 comparesig 8.0 9 -> -1 +ddcms142 comparesig 8 9.0 -> -1 +ddcms143 comparesig 8E+0 9.0 -> -1 +ddcms144 comparesig 80E-1 9.0 -> -1 +ddcms145 comparesig 0.8E+1 9 -> -1 +ddcms146 comparesig 80E-1 9 -> -1 +ddcms147 comparesig 8.0 9E+0 -> -1 +ddcms148 comparesig 8.0 90E-1 -> -1 +ddcms149 comparesig 8 0.9E+1 -> -1 +ddcms150 comparesig 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +ddcms200 comparesig -7.0 7.0 -> -1 +ddcms201 comparesig -7.0 7 -> -1 +ddcms202 comparesig -7 7.0 -> -1 +ddcms203 comparesig -7E+0 7.0 -> -1 +ddcms204 comparesig -70E-1 7.0 -> -1 +ddcms205 comparesig -0.7E+1 7 -> -1 +ddcms206 comparesig -70E-1 7 -> -1 +ddcms207 comparesig -7.0 7E+0 -> -1 +ddcms208 comparesig -7.0 70E-1 -> -1 +ddcms209 comparesig -7 0.7E+1 -> -1 +ddcms210 comparesig -7 70E-1 -> -1 + +ddcms220 comparesig -8.0 7.0 -> -1 +ddcms221 comparesig -8.0 7 -> -1 +ddcms222 comparesig -8 7.0 -> -1 +ddcms223 comparesig -8E+0 7.0 -> -1 +ddcms224 comparesig -80E-1 7.0 -> -1 +ddcms225 comparesig -0.8E+1 7 -> -1 +ddcms226 comparesig -80E-1 7 -> -1 +ddcms227 comparesig -8.0 7E+0 -> -1 +ddcms228 comparesig -8.0 70E-1 -> -1 +ddcms229 comparesig -8 0.7E+1 -> -1 +ddcms230 comparesig -8 70E-1 -> -1 + +ddcms240 comparesig -8.0 9.0 -> -1 +ddcms241 comparesig -8.0 9 -> -1 +ddcms242 comparesig -8 9.0 -> -1 +ddcms243 comparesig -8E+0 9.0 -> -1 +ddcms244 comparesig -80E-1 9.0 -> -1 +ddcms245 comparesig -0.8E+1 9 -> -1 +ddcms246 comparesig -80E-1 9 -> -1 +ddcms247 comparesig -8.0 9E+0 -> -1 +ddcms248 comparesig -8.0 90E-1 -> -1 +ddcms249 comparesig -8 0.9E+1 -> -1 +ddcms250 comparesig -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +ddcms300 comparesig 7.0 -7.0 -> 1 +ddcms301 comparesig 7.0 -7 -> 1 +ddcms302 comparesig 7 -7.0 -> 1 +ddcms303 comparesig 7E+0 -7.0 -> 1 +ddcms304 comparesig 70E-1 -7.0 -> 1 +ddcms305 comparesig .7E+1 -7 -> 1 +ddcms306 comparesig 70E-1 -7 -> 1 +ddcms307 comparesig 7.0 -7E+0 -> 1 +ddcms308 comparesig 7.0 -70E-1 -> 1 +ddcms309 comparesig 7 -.7E+1 -> 1 +ddcms310 comparesig 7 -70E-1 -> 1 + +ddcms320 comparesig 8.0 -7.0 -> 1 +ddcms321 comparesig 8.0 -7 -> 1 +ddcms322 comparesig 8 -7.0 -> 1 +ddcms323 comparesig 8E+0 -7.0 -> 1 +ddcms324 comparesig 80E-1 -7.0 -> 1 +ddcms325 comparesig .8E+1 -7 -> 1 +ddcms326 comparesig 80E-1 -7 -> 1 +ddcms327 comparesig 8.0 -7E+0 -> 1 +ddcms328 comparesig 8.0 -70E-1 -> 1 +ddcms329 comparesig 8 -.7E+1 -> 1 +ddcms330 comparesig 8 -70E-1 -> 1 + +ddcms340 comparesig 8.0 -9.0 -> 1 +ddcms341 comparesig 8.0 -9 -> 1 +ddcms342 comparesig 8 -9.0 -> 1 +ddcms343 comparesig 8E+0 -9.0 -> 1 +ddcms344 comparesig 80E-1 -9.0 -> 1 +ddcms345 comparesig .8E+1 -9 -> 1 +ddcms346 comparesig 80E-1 -9 -> 1 +ddcms347 comparesig 8.0 -9E+0 -> 1 +ddcms348 comparesig 8.0 -90E-1 -> 1 +ddcms349 comparesig 8 -.9E+1 -> 1 +ddcms350 comparesig 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +ddcms400 comparesig -7.0 -7.0 -> 0 +ddcms401 comparesig -7.0 -7 -> 0 +ddcms402 comparesig -7 -7.0 -> 0 +ddcms403 comparesig -7E+0 -7.0 -> 0 +ddcms404 comparesig -70E-1 -7.0 -> 0 +ddcms405 comparesig -.7E+1 -7 -> 0 +ddcms406 comparesig -70E-1 -7 -> 0 +ddcms407 comparesig -7.0 -7E+0 -> 0 +ddcms408 comparesig -7.0 -70E-1 -> 0 +ddcms409 comparesig -7 -.7E+1 -> 0 +ddcms410 comparesig -7 -70E-1 -> 0 + +ddcms420 comparesig -8.0 -7.0 -> -1 +ddcms421 comparesig -8.0 -7 -> -1 +ddcms422 comparesig -8 -7.0 -> -1 +ddcms423 comparesig -8E+0 -7.0 -> -1 +ddcms424 comparesig -80E-1 -7.0 -> -1 +ddcms425 comparesig -.8E+1 -7 -> -1 +ddcms426 comparesig -80E-1 -7 -> -1 +ddcms427 comparesig -8.0 -7E+0 -> -1 +ddcms428 comparesig -8.0 -70E-1 -> -1 +ddcms429 comparesig -8 -.7E+1 -> -1 +ddcms430 comparesig -8 -70E-1 -> -1 + +ddcms440 comparesig -8.0 -9.0 -> 1 +ddcms441 comparesig -8.0 -9 -> 1 +ddcms442 comparesig -8 -9.0 -> 1 +ddcms443 comparesig -8E+0 -9.0 -> 1 +ddcms444 comparesig -80E-1 -9.0 -> 1 +ddcms445 comparesig -.8E+1 -9 -> 1 +ddcms446 comparesig -80E-1 -9 -> 1 +ddcms447 comparesig -8.0 -9E+0 -> 1 +ddcms448 comparesig -8.0 -90E-1 -> 1 +ddcms449 comparesig -8 -.9E+1 -> 1 +ddcms450 comparesig -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0 +ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0 +ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0 +ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0 +ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0 +ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0 +ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0 +ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0 +ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0 +ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0 +ddcms483 comparesig 123.456E-89 123.456E-89 -> 0 +ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0 +ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0 +ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0 +ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0 +ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0 +ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0 +ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0 +ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0 +ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0 +ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0 +ddcms497 comparesig 123.456E+89 123.456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +ddcms500 comparesig 1 1E-15 -> 1 +ddcms501 comparesig 1 1E-14 -> 1 +ddcms502 comparesig 1 1E-13 -> 1 +ddcms503 comparesig 1 1E-12 -> 1 +ddcms504 comparesig 1 1E-11 -> 1 +ddcms505 comparesig 1 1E-10 -> 1 +ddcms506 comparesig 1 1E-9 -> 1 +ddcms507 comparesig 1 1E-8 -> 1 +ddcms508 comparesig 1 1E-7 -> 1 +ddcms509 comparesig 1 1E-6 -> 1 +ddcms510 comparesig 1 1E-5 -> 1 +ddcms511 comparesig 1 1E-4 -> 1 +ddcms512 comparesig 1 1E-3 -> 1 +ddcms513 comparesig 1 1E-2 -> 1 +ddcms514 comparesig 1 1E-1 -> 1 +ddcms515 comparesig 1 1E-0 -> 0 +ddcms516 comparesig 1 1E+1 -> -1 +ddcms517 comparesig 1 1E+2 -> -1 +ddcms518 comparesig 1 1E+3 -> -1 +ddcms519 comparesig 1 1E+4 -> -1 +ddcms521 comparesig 1 1E+5 -> -1 +ddcms522 comparesig 1 1E+6 -> -1 +ddcms523 comparesig 1 1E+7 -> -1 +ddcms524 comparesig 1 1E+8 -> -1 +ddcms525 comparesig 1 1E+9 -> -1 +ddcms526 comparesig 1 1E+10 -> -1 +ddcms527 comparesig 1 1E+11 -> -1 +ddcms528 comparesig 1 1E+12 -> -1 +ddcms529 comparesig 1 1E+13 -> -1 +ddcms530 comparesig 1 1E+14 -> -1 +ddcms531 comparesig 1 1E+15 -> -1 +-- LR swap +ddcms540 comparesig 1E-15 1 -> -1 +ddcms541 comparesig 1E-14 1 -> -1 +ddcms542 comparesig 1E-13 1 -> -1 +ddcms543 comparesig 1E-12 1 -> -1 +ddcms544 comparesig 1E-11 1 -> -1 +ddcms545 comparesig 1E-10 1 -> -1 +ddcms546 comparesig 1E-9 1 -> -1 +ddcms547 comparesig 1E-8 1 -> -1 +ddcms548 comparesig 1E-7 1 -> -1 +ddcms549 comparesig 1E-6 1 -> -1 +ddcms550 comparesig 1E-5 1 -> -1 +ddcms551 comparesig 1E-4 1 -> -1 +ddcms552 comparesig 1E-3 1 -> -1 +ddcms553 comparesig 1E-2 1 -> -1 +ddcms554 comparesig 1E-1 1 -> -1 +ddcms555 comparesig 1E-0 1 -> 0 +ddcms556 comparesig 1E+1 1 -> 1 +ddcms557 comparesig 1E+2 1 -> 1 +ddcms558 comparesig 1E+3 1 -> 1 +ddcms559 comparesig 1E+4 1 -> 1 +ddcms561 comparesig 1E+5 1 -> 1 +ddcms562 comparesig 1E+6 1 -> 1 +ddcms563 comparesig 1E+7 1 -> 1 +ddcms564 comparesig 1E+8 1 -> 1 +ddcms565 comparesig 1E+9 1 -> 1 +ddcms566 comparesig 1E+10 1 -> 1 +ddcms567 comparesig 1E+11 1 -> 1 +ddcms568 comparesig 1E+12 1 -> 1 +ddcms569 comparesig 1E+13 1 -> 1 +ddcms570 comparesig 1E+14 1 -> 1 +ddcms571 comparesig 1E+15 1 -> 1 +-- similar with a useful coefficient, one side only +ddcms580 comparesig 0.000000987654321 1E-15 -> 1 +ddcms581 comparesig 0.000000987654321 1E-14 -> 1 +ddcms582 comparesig 0.000000987654321 1E-13 -> 1 +ddcms583 comparesig 0.000000987654321 1E-12 -> 1 +ddcms584 comparesig 0.000000987654321 1E-11 -> 1 +ddcms585 comparesig 0.000000987654321 1E-10 -> 1 +ddcms586 comparesig 0.000000987654321 1E-9 -> 1 +ddcms587 comparesig 0.000000987654321 1E-8 -> 1 +ddcms588 comparesig 0.000000987654321 1E-7 -> 1 +ddcms589 comparesig 0.000000987654321 1E-6 -> -1 +ddcms590 comparesig 0.000000987654321 1E-5 -> -1 +ddcms591 comparesig 0.000000987654321 1E-4 -> -1 +ddcms592 comparesig 0.000000987654321 1E-3 -> -1 +ddcms593 comparesig 0.000000987654321 1E-2 -> -1 +ddcms594 comparesig 0.000000987654321 1E-1 -> -1 +ddcms595 comparesig 0.000000987654321 1E-0 -> -1 +ddcms596 comparesig 0.000000987654321 1E+1 -> -1 +ddcms597 comparesig 0.000000987654321 1E+2 -> -1 +ddcms598 comparesig 0.000000987654321 1E+3 -> -1 +ddcms599 comparesig 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +ddcms600 comparesig 12 12.2345 -> -1 +ddcms601 comparesig 12.0 12.2345 -> -1 +ddcms602 comparesig 12.00 12.2345 -> -1 +ddcms603 comparesig 12.000 12.2345 -> -1 +ddcms604 comparesig 12.0000 12.2345 -> -1 +ddcms605 comparesig 12.00000 12.2345 -> -1 +ddcms606 comparesig 12.000000 12.2345 -> -1 +ddcms607 comparesig 12.0000000 12.2345 -> -1 +ddcms608 comparesig 12.00000000 12.2345 -> -1 +ddcms609 comparesig 12.000000000 12.2345 -> -1 +ddcms610 comparesig 12.1234 12 -> 1 +ddcms611 comparesig 12.1234 12.0 -> 1 +ddcms612 comparesig 12.1234 12.00 -> 1 +ddcms613 comparesig 12.1234 12.000 -> 1 +ddcms614 comparesig 12.1234 12.0000 -> 1 +ddcms615 comparesig 12.1234 12.00000 -> 1 +ddcms616 comparesig 12.1234 12.000000 -> 1 +ddcms617 comparesig 12.1234 12.0000000 -> 1 +ddcms618 comparesig 12.1234 12.00000000 -> 1 +ddcms619 comparesig 12.1234 12.000000000 -> 1 +ddcms620 comparesig -12 -12.2345 -> 1 +ddcms621 comparesig -12.0 -12.2345 -> 1 +ddcms622 comparesig -12.00 -12.2345 -> 1 +ddcms623 comparesig -12.000 -12.2345 -> 1 +ddcms624 comparesig -12.0000 -12.2345 -> 1 +ddcms625 comparesig -12.00000 -12.2345 -> 1 +ddcms626 comparesig -12.000000 -12.2345 -> 1 +ddcms627 comparesig -12.0000000 -12.2345 -> 1 +ddcms628 comparesig -12.00000000 -12.2345 -> 1 +ddcms629 comparesig -12.000000000 -12.2345 -> 1 +ddcms630 comparesig -12.1234 -12 -> -1 +ddcms631 comparesig -12.1234 -12.0 -> -1 +ddcms632 comparesig -12.1234 -12.00 -> -1 +ddcms633 comparesig -12.1234 -12.000 -> -1 +ddcms634 comparesig -12.1234 -12.0000 -> -1 +ddcms635 comparesig -12.1234 -12.00000 -> -1 +ddcms636 comparesig -12.1234 -12.000000 -> -1 +ddcms637 comparesig -12.1234 -12.0000000 -> -1 +ddcms638 comparesig -12.1234 -12.00000000 -> -1 +ddcms639 comparesig -12.1234 -12.000000000 -> -1 + +-- extended zeros +ddcms640 comparesig 0 0 -> 0 +ddcms641 comparesig 0 -0 -> 0 +ddcms642 comparesig 0 -0.0 -> 0 +ddcms643 comparesig 0 0.0 -> 0 +ddcms644 comparesig -0 0 -> 0 +ddcms645 comparesig -0 -0 -> 0 +ddcms646 comparesig -0 -0.0 -> 0 +ddcms647 comparesig -0 0.0 -> 0 +ddcms648 comparesig 0.0 0 -> 0 +ddcms649 comparesig 0.0 -0 -> 0 +ddcms650 comparesig 0.0 -0.0 -> 0 +ddcms651 comparesig 0.0 0.0 -> 0 +ddcms652 comparesig -0.0 0 -> 0 +ddcms653 comparesig -0.0 -0 -> 0 +ddcms654 comparesig -0.0 -0.0 -> 0 +ddcms655 comparesig -0.0 0.0 -> 0 + +ddcms656 comparesig -0E1 0.0 -> 0 +ddcms657 comparesig -0E2 0.0 -> 0 +ddcms658 comparesig 0E1 0.0 -> 0 +ddcms659 comparesig 0E2 0.0 -> 0 +ddcms660 comparesig -0E1 0 -> 0 +ddcms661 comparesig -0E2 0 -> 0 +ddcms662 comparesig 0E1 0 -> 0 +ddcms663 comparesig 0E2 0 -> 0 +ddcms664 comparesig -0E1 -0E1 -> 0 +ddcms665 comparesig -0E2 -0E1 -> 0 +ddcms666 comparesig 0E1 -0E1 -> 0 +ddcms667 comparesig 0E2 -0E1 -> 0 +ddcms668 comparesig -0E1 -0E2 -> 0 +ddcms669 comparesig -0E2 -0E2 -> 0 +ddcms670 comparesig 0E1 -0E2 -> 0 +ddcms671 comparesig 0E2 -0E2 -> 0 +ddcms672 comparesig -0E1 0E1 -> 0 +ddcms673 comparesig -0E2 0E1 -> 0 +ddcms674 comparesig 0E1 0E1 -> 0 +ddcms675 comparesig 0E2 0E1 -> 0 +ddcms676 comparesig -0E1 0E2 -> 0 +ddcms677 comparesig -0E2 0E2 -> 0 +ddcms678 comparesig 0E1 0E2 -> 0 +ddcms679 comparesig 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +ddcms680 comparesig 12 12 -> 0 +ddcms681 comparesig 12 12.0 -> 0 +ddcms682 comparesig 12 12.00 -> 0 +ddcms683 comparesig 12 12.000 -> 0 +ddcms684 comparesig 12 12.0000 -> 0 +ddcms685 comparesig 12 12.00000 -> 0 +ddcms686 comparesig 12 12.000000 -> 0 +ddcms687 comparesig 12 12.0000000 -> 0 +ddcms688 comparesig 12 12.00000000 -> 0 +ddcms689 comparesig 12 12.000000000 -> 0 +ddcms690 comparesig 12 12 -> 0 +ddcms691 comparesig 12.0 12 -> 0 +ddcms692 comparesig 12.00 12 -> 0 +ddcms693 comparesig 12.000 12 -> 0 +ddcms694 comparesig 12.0000 12 -> 0 +ddcms695 comparesig 12.00000 12 -> 0 +ddcms696 comparesig 12.000000 12 -> 0 +ddcms697 comparesig 12.0000000 12 -> 0 +ddcms698 comparesig 12.00000000 12 -> 0 +ddcms699 comparesig 12.000000000 12 -> 0 + +-- first, second, & last digit +ddcms700 comparesig 1234567890123456 1234567890123455 -> 1 +ddcms701 comparesig 1234567890123456 1234567890123456 -> 0 +ddcms702 comparesig 1234567890123456 1234567890123457 -> -1 +ddcms703 comparesig 1234567890123456 0234567890123456 -> 1 +ddcms704 comparesig 1234567890123456 1234567890123456 -> 0 +ddcms705 comparesig 1234567890123456 2234567890123456 -> -1 +ddcms706 comparesig 1134567890123456 1034567890123456 -> 1 +ddcms707 comparesig 1134567890123456 1134567890123456 -> 0 +ddcms708 comparesig 1134567890123456 1234567890123456 -> -1 + +-- miscellaneous +ddcms721 comparesig 12345678000 1 -> 1 +ddcms722 comparesig 1 12345678000 -> -1 +ddcms723 comparesig 1234567800 1 -> 1 +ddcms724 comparesig 1 1234567800 -> -1 +ddcms725 comparesig 1234567890 1 -> 1 +ddcms726 comparesig 1 1234567890 -> -1 +ddcms727 comparesig 1234567891 1 -> 1 +ddcms728 comparesig 1 1234567891 -> -1 +ddcms729 comparesig 12345678901 1 -> 1 +ddcms730 comparesig 1 12345678901 -> -1 +ddcms731 comparesig 1234567896 1 -> 1 +ddcms732 comparesig 1 1234567896 -> -1 + +-- residue cases at lower precision +ddcms740 comparesig 1 0.9999999 -> 1 +ddcms741 comparesig 1 0.999999 -> 1 +ddcms742 comparesig 1 0.99999 -> 1 +ddcms743 comparesig 1 1.0000 -> 0 +ddcms744 comparesig 1 1.00001 -> -1 +ddcms745 comparesig 1 1.000001 -> -1 +ddcms746 comparesig 1 1.0000001 -> -1 +ddcms750 comparesig 0.9999999 1 -> -1 +ddcms751 comparesig 0.999999 1 -> -1 +ddcms752 comparesig 0.99999 1 -> -1 +ddcms753 comparesig 1.0000 1 -> 0 +ddcms754 comparesig 1.00001 1 -> 1 +ddcms755 comparesig 1.000001 1 -> 1 +ddcms756 comparesig 1.0000001 1 -> 1 + +-- Specials +ddcms780 comparesig Inf -Inf -> 1 +ddcms781 comparesig Inf -1000 -> 1 +ddcms782 comparesig Inf -1 -> 1 +ddcms783 comparesig Inf -0 -> 1 +ddcms784 comparesig Inf 0 -> 1 +ddcms785 comparesig Inf 1 -> 1 +ddcms786 comparesig Inf 1000 -> 1 +ddcms787 comparesig Inf Inf -> 0 +ddcms788 comparesig -1000 Inf -> -1 +ddcms789 comparesig -Inf Inf -> -1 +ddcms790 comparesig -1 Inf -> -1 +ddcms791 comparesig -0 Inf -> -1 +ddcms792 comparesig 0 Inf -> -1 +ddcms793 comparesig 1 Inf -> -1 +ddcms794 comparesig 1000 Inf -> -1 +ddcms795 comparesig Inf Inf -> 0 + +ddcms800 comparesig -Inf -Inf -> 0 +ddcms801 comparesig -Inf -1000 -> -1 +ddcms802 comparesig -Inf -1 -> -1 +ddcms803 comparesig -Inf -0 -> -1 +ddcms804 comparesig -Inf 0 -> -1 +ddcms805 comparesig -Inf 1 -> -1 +ddcms806 comparesig -Inf 1000 -> -1 +ddcms807 comparesig -Inf Inf -> -1 +ddcms808 comparesig -Inf -Inf -> 0 +ddcms809 comparesig -1000 -Inf -> 1 +ddcms810 comparesig -1 -Inf -> 1 +ddcms811 comparesig -0 -Inf -> 1 +ddcms812 comparesig 0 -Inf -> 1 +ddcms813 comparesig 1 -Inf -> 1 +ddcms814 comparesig 1000 -Inf -> 1 +ddcms815 comparesig Inf -Inf -> 1 + +ddcms821 comparesig NaN -Inf -> NaN Invalid_operation +ddcms822 comparesig NaN -1000 -> NaN Invalid_operation +ddcms823 comparesig NaN -1 -> NaN Invalid_operation +ddcms824 comparesig NaN -0 -> NaN Invalid_operation +ddcms825 comparesig NaN 0 -> NaN Invalid_operation +ddcms826 comparesig NaN 1 -> NaN Invalid_operation +ddcms827 comparesig NaN 1000 -> NaN Invalid_operation +ddcms828 comparesig NaN Inf -> NaN Invalid_operation +ddcms829 comparesig NaN NaN -> NaN Invalid_operation +ddcms830 comparesig -Inf NaN -> NaN Invalid_operation +ddcms831 comparesig -1000 NaN -> NaN Invalid_operation +ddcms832 comparesig -1 NaN -> NaN Invalid_operation +ddcms833 comparesig -0 NaN -> NaN Invalid_operation +ddcms834 comparesig 0 NaN -> NaN Invalid_operation +ddcms835 comparesig 1 NaN -> NaN Invalid_operation +ddcms836 comparesig 1000 NaN -> NaN Invalid_operation +ddcms837 comparesig Inf NaN -> NaN Invalid_operation +ddcms838 comparesig -NaN -NaN -> -NaN Invalid_operation +ddcms839 comparesig +NaN -NaN -> NaN Invalid_operation +ddcms840 comparesig -NaN +NaN -> -NaN Invalid_operation + +ddcms841 comparesig sNaN -Inf -> NaN Invalid_operation +ddcms842 comparesig sNaN -1000 -> NaN Invalid_operation +ddcms843 comparesig sNaN -1 -> NaN Invalid_operation +ddcms844 comparesig sNaN -0 -> NaN Invalid_operation +ddcms845 comparesig sNaN 0 -> NaN Invalid_operation +ddcms846 comparesig sNaN 1 -> NaN Invalid_operation +ddcms847 comparesig sNaN 1000 -> NaN Invalid_operation +ddcms848 comparesig sNaN NaN -> NaN Invalid_operation +ddcms849 comparesig sNaN sNaN -> NaN Invalid_operation +ddcms850 comparesig NaN sNaN -> NaN Invalid_operation +ddcms851 comparesig -Inf sNaN -> NaN Invalid_operation +ddcms852 comparesig -1000 sNaN -> NaN Invalid_operation +ddcms853 comparesig -1 sNaN -> NaN Invalid_operation +ddcms854 comparesig -0 sNaN -> NaN Invalid_operation +ddcms855 comparesig 0 sNaN -> NaN Invalid_operation +ddcms856 comparesig 1 sNaN -> NaN Invalid_operation +ddcms857 comparesig 1000 sNaN -> NaN Invalid_operation +ddcms858 comparesig Inf sNaN -> NaN Invalid_operation +ddcms859 comparesig NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation +ddcms861 comparesig NaN8 999 -> NaN8 Invalid_operation +ddcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation +ddcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation +ddcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation +ddcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation +ddcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation +ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation +ddcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation +ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation +ddcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation + +ddcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation +ddcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation +ddcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation +ddcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation +ddcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation +ddcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation +ddcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation +ddcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation +ddcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation + +-- wide range +ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1 +ddcms881 comparesig 9E+384 +1.23456789012345E-0 -> 1 +ddcms882 comparesig +0.100 9E-383 -> 1 +ddcms883 comparesig 9E-383 +0.100 -> -1 +ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1 +ddcms886 comparesig 9E+384 -1.23456789012345E-0 -> 1 +ddcms887 comparesig -0.100 9E-383 -> -1 +ddcms888 comparesig 9E-383 -0.100 -> 1 + +-- signs +ddcms901 comparesig 1e+77 1e+11 -> 1 +ddcms902 comparesig 1e+77 -1e+11 -> 1 +ddcms903 comparesig -1e+77 1e+11 -> -1 +ddcms904 comparesig -1e+77 -1e+11 -> -1 +ddcms905 comparesig 1e-77 1e-11 -> -1 +ddcms906 comparesig 1e-77 -1e-11 -> 1 +ddcms907 comparesig -1e-77 1e-11 -> -1 +ddcms908 comparesig -1e-77 -1e-11 -> 1 + +-- Null tests +ddcms990 comparesig 10 # -> NaN Invalid_operation +ddcms991 comparesig # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareTotal.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareTotal.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,706 @@ +------------------------------------------------------------------------ +-- ddCompareTotal.decTest -- decDouble comparison using total ordering-- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). +-- Similarly, comparetotal will have some radically different paths +-- than compare. + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddcot001 comparetotal -2 -2 -> 0 +ddcot002 comparetotal -2 -1 -> -1 +ddcot003 comparetotal -2 0 -> -1 +ddcot004 comparetotal -2 1 -> -1 +ddcot005 comparetotal -2 2 -> -1 +ddcot006 comparetotal -1 -2 -> 1 +ddcot007 comparetotal -1 -1 -> 0 +ddcot008 comparetotal -1 0 -> -1 +ddcot009 comparetotal -1 1 -> -1 +ddcot010 comparetotal -1 2 -> -1 +ddcot011 comparetotal 0 -2 -> 1 +ddcot012 comparetotal 0 -1 -> 1 +ddcot013 comparetotal 0 0 -> 0 +ddcot014 comparetotal 0 1 -> -1 +ddcot015 comparetotal 0 2 -> -1 +ddcot016 comparetotal 1 -2 -> 1 +ddcot017 comparetotal 1 -1 -> 1 +ddcot018 comparetotal 1 0 -> 1 +ddcot019 comparetotal 1 1 -> 0 +ddcot020 comparetotal 1 2 -> -1 +ddcot021 comparetotal 2 -2 -> 1 +ddcot022 comparetotal 2 -1 -> 1 +ddcot023 comparetotal 2 0 -> 1 +ddcot025 comparetotal 2 1 -> 1 +ddcot026 comparetotal 2 2 -> 0 + +ddcot031 comparetotal -20 -20 -> 0 +ddcot032 comparetotal -20 -10 -> -1 +ddcot033 comparetotal -20 00 -> -1 +ddcot034 comparetotal -20 10 -> -1 +ddcot035 comparetotal -20 20 -> -1 +ddcot036 comparetotal -10 -20 -> 1 +ddcot037 comparetotal -10 -10 -> 0 +ddcot038 comparetotal -10 00 -> -1 +ddcot039 comparetotal -10 10 -> -1 +ddcot040 comparetotal -10 20 -> -1 +ddcot041 comparetotal 00 -20 -> 1 +ddcot042 comparetotal 00 -10 -> 1 +ddcot043 comparetotal 00 00 -> 0 +ddcot044 comparetotal 00 10 -> -1 +ddcot045 comparetotal 00 20 -> -1 +ddcot046 comparetotal 10 -20 -> 1 +ddcot047 comparetotal 10 -10 -> 1 +ddcot048 comparetotal 10 00 -> 1 +ddcot049 comparetotal 10 10 -> 0 +ddcot050 comparetotal 10 20 -> -1 +ddcot051 comparetotal 20 -20 -> 1 +ddcot052 comparetotal 20 -10 -> 1 +ddcot053 comparetotal 20 00 -> 1 +ddcot055 comparetotal 20 10 -> 1 +ddcot056 comparetotal 20 20 -> 0 + +ddcot061 comparetotal -2.0 -2.0 -> 0 +ddcot062 comparetotal -2.0 -1.0 -> -1 +ddcot063 comparetotal -2.0 0.0 -> -1 +ddcot064 comparetotal -2.0 1.0 -> -1 +ddcot065 comparetotal -2.0 2.0 -> -1 +ddcot066 comparetotal -1.0 -2.0 -> 1 +ddcot067 comparetotal -1.0 -1.0 -> 0 +ddcot068 comparetotal -1.0 0.0 -> -1 +ddcot069 comparetotal -1.0 1.0 -> -1 +ddcot070 comparetotal -1.0 2.0 -> -1 +ddcot071 comparetotal 0.0 -2.0 -> 1 +ddcot072 comparetotal 0.0 -1.0 -> 1 +ddcot073 comparetotal 0.0 0.0 -> 0 +ddcot074 comparetotal 0.0 1.0 -> -1 +ddcot075 comparetotal 0.0 2.0 -> -1 +ddcot076 comparetotal 1.0 -2.0 -> 1 +ddcot077 comparetotal 1.0 -1.0 -> 1 +ddcot078 comparetotal 1.0 0.0 -> 1 +ddcot079 comparetotal 1.0 1.0 -> 0 +ddcot080 comparetotal 1.0 2.0 -> -1 +ddcot081 comparetotal 2.0 -2.0 -> 1 +ddcot082 comparetotal 2.0 -1.0 -> 1 +ddcot083 comparetotal 2.0 0.0 -> 1 +ddcot085 comparetotal 2.0 1.0 -> 1 +ddcot086 comparetotal 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +ddcot090 comparetotal 9.99999999E+384 9.99999999E+384 -> 0 +ddcot091 comparetotal -9.99999999E+384 9.99999999E+384 -> -1 +ddcot092 comparetotal 9.99999999E+384 -9.99999999E+384 -> 1 +ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +ddcot100 comparetotal 7.0 7.0 -> 0 +ddcot101 comparetotal 7.0 7 -> -1 +ddcot102 comparetotal 7 7.0 -> 1 +ddcot103 comparetotal 7E+0 7.0 -> 1 +ddcot104 comparetotal 70E-1 7.0 -> 0 +ddcot105 comparetotal 0.7E+1 7 -> 0 +ddcot106 comparetotal 70E-1 7 -> -1 +ddcot107 comparetotal 7.0 7E+0 -> -1 +ddcot108 comparetotal 7.0 70E-1 -> 0 +ddcot109 comparetotal 7 0.7E+1 -> 0 +ddcot110 comparetotal 7 70E-1 -> 1 + +ddcot120 comparetotal 8.0 7.0 -> 1 +ddcot121 comparetotal 8.0 7 -> 1 +ddcot122 comparetotal 8 7.0 -> 1 +ddcot123 comparetotal 8E+0 7.0 -> 1 +ddcot124 comparetotal 80E-1 7.0 -> 1 +ddcot125 comparetotal 0.8E+1 7 -> 1 +ddcot126 comparetotal 80E-1 7 -> 1 +ddcot127 comparetotal 8.0 7E+0 -> 1 +ddcot128 comparetotal 8.0 70E-1 -> 1 +ddcot129 comparetotal 8 0.7E+1 -> 1 +ddcot130 comparetotal 8 70E-1 -> 1 + +ddcot140 comparetotal 8.0 9.0 -> -1 +ddcot141 comparetotal 8.0 9 -> -1 +ddcot142 comparetotal 8 9.0 -> -1 +ddcot143 comparetotal 8E+0 9.0 -> -1 +ddcot144 comparetotal 80E-1 9.0 -> -1 +ddcot145 comparetotal 0.8E+1 9 -> -1 +ddcot146 comparetotal 80E-1 9 -> -1 +ddcot147 comparetotal 8.0 9E+0 -> -1 +ddcot148 comparetotal 8.0 90E-1 -> -1 +ddcot149 comparetotal 8 0.9E+1 -> -1 +ddcot150 comparetotal 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +ddcot200 comparetotal -7.0 7.0 -> -1 +ddcot201 comparetotal -7.0 7 -> -1 +ddcot202 comparetotal -7 7.0 -> -1 +ddcot203 comparetotal -7E+0 7.0 -> -1 +ddcot204 comparetotal -70E-1 7.0 -> -1 +ddcot205 comparetotal -0.7E+1 7 -> -1 +ddcot206 comparetotal -70E-1 7 -> -1 +ddcot207 comparetotal -7.0 7E+0 -> -1 +ddcot208 comparetotal -7.0 70E-1 -> -1 +ddcot209 comparetotal -7 0.7E+1 -> -1 +ddcot210 comparetotal -7 70E-1 -> -1 + +ddcot220 comparetotal -8.0 7.0 -> -1 +ddcot221 comparetotal -8.0 7 -> -1 +ddcot222 comparetotal -8 7.0 -> -1 +ddcot223 comparetotal -8E+0 7.0 -> -1 +ddcot224 comparetotal -80E-1 7.0 -> -1 +ddcot225 comparetotal -0.8E+1 7 -> -1 +ddcot226 comparetotal -80E-1 7 -> -1 +ddcot227 comparetotal -8.0 7E+0 -> -1 +ddcot228 comparetotal -8.0 70E-1 -> -1 +ddcot229 comparetotal -8 0.7E+1 -> -1 +ddcot230 comparetotal -8 70E-1 -> -1 + +ddcot240 comparetotal -8.0 9.0 -> -1 +ddcot241 comparetotal -8.0 9 -> -1 +ddcot242 comparetotal -8 9.0 -> -1 +ddcot243 comparetotal -8E+0 9.0 -> -1 +ddcot244 comparetotal -80E-1 9.0 -> -1 +ddcot245 comparetotal -0.8E+1 9 -> -1 +ddcot246 comparetotal -80E-1 9 -> -1 +ddcot247 comparetotal -8.0 9E+0 -> -1 +ddcot248 comparetotal -8.0 90E-1 -> -1 +ddcot249 comparetotal -8 0.9E+1 -> -1 +ddcot250 comparetotal -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +ddcot300 comparetotal 7.0 -7.0 -> 1 +ddcot301 comparetotal 7.0 -7 -> 1 +ddcot302 comparetotal 7 -7.0 -> 1 +ddcot303 comparetotal 7E+0 -7.0 -> 1 +ddcot304 comparetotal 70E-1 -7.0 -> 1 +ddcot305 comparetotal .7E+1 -7 -> 1 +ddcot306 comparetotal 70E-1 -7 -> 1 +ddcot307 comparetotal 7.0 -7E+0 -> 1 +ddcot308 comparetotal 7.0 -70E-1 -> 1 +ddcot309 comparetotal 7 -.7E+1 -> 1 +ddcot310 comparetotal 7 -70E-1 -> 1 + +ddcot320 comparetotal 8.0 -7.0 -> 1 +ddcot321 comparetotal 8.0 -7 -> 1 +ddcot322 comparetotal 8 -7.0 -> 1 +ddcot323 comparetotal 8E+0 -7.0 -> 1 +ddcot324 comparetotal 80E-1 -7.0 -> 1 +ddcot325 comparetotal .8E+1 -7 -> 1 +ddcot326 comparetotal 80E-1 -7 -> 1 +ddcot327 comparetotal 8.0 -7E+0 -> 1 +ddcot328 comparetotal 8.0 -70E-1 -> 1 +ddcot329 comparetotal 8 -.7E+1 -> 1 +ddcot330 comparetotal 8 -70E-1 -> 1 + +ddcot340 comparetotal 8.0 -9.0 -> 1 +ddcot341 comparetotal 8.0 -9 -> 1 +ddcot342 comparetotal 8 -9.0 -> 1 +ddcot343 comparetotal 8E+0 -9.0 -> 1 +ddcot344 comparetotal 80E-1 -9.0 -> 1 +ddcot345 comparetotal .8E+1 -9 -> 1 +ddcot346 comparetotal 80E-1 -9 -> 1 +ddcot347 comparetotal 8.0 -9E+0 -> 1 +ddcot348 comparetotal 8.0 -90E-1 -> 1 +ddcot349 comparetotal 8 -.9E+1 -> 1 +ddcot350 comparetotal 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +ddcot400 comparetotal -7.0 -7.0 -> 0 +ddcot401 comparetotal -7.0 -7 -> 1 +ddcot402 comparetotal -7 -7.0 -> -1 +ddcot403 comparetotal -7E+0 -7.0 -> -1 +ddcot404 comparetotal -70E-1 -7.0 -> 0 +ddcot405 comparetotal -.7E+1 -7 -> 0 +ddcot406 comparetotal -70E-1 -7 -> 1 +ddcot407 comparetotal -7.0 -7E+0 -> 1 +ddcot408 comparetotal -7.0 -70E-1 -> 0 +ddcot409 comparetotal -7 -.7E+1 -> 0 +ddcot410 comparetotal -7 -70E-1 -> -1 + +ddcot420 comparetotal -8.0 -7.0 -> -1 +ddcot421 comparetotal -8.0 -7 -> -1 +ddcot422 comparetotal -8 -7.0 -> -1 +ddcot423 comparetotal -8E+0 -7.0 -> -1 +ddcot424 comparetotal -80E-1 -7.0 -> -1 +ddcot425 comparetotal -.8E+1 -7 -> -1 +ddcot426 comparetotal -80E-1 -7 -> -1 +ddcot427 comparetotal -8.0 -7E+0 -> -1 +ddcot428 comparetotal -8.0 -70E-1 -> -1 +ddcot429 comparetotal -8 -.7E+1 -> -1 +ddcot430 comparetotal -8 -70E-1 -> -1 + +ddcot440 comparetotal -8.0 -9.0 -> 1 +ddcot441 comparetotal -8.0 -9 -> 1 +ddcot442 comparetotal -8 -9.0 -> 1 +ddcot443 comparetotal -8E+0 -9.0 -> 1 +ddcot444 comparetotal -80E-1 -9.0 -> 1 +ddcot445 comparetotal -.8E+1 -9 -> 1 +ddcot446 comparetotal -80E-1 -9 -> 1 +ddcot447 comparetotal -8.0 -9E+0 -> 1 +ddcot448 comparetotal -8.0 -90E-1 -> 1 +ddcot449 comparetotal -8 -.9E+1 -> 1 +ddcot450 comparetotal -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1 +ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1 +ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1 +ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1 +ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1 +ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1 +ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1 +ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1 +ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1 +ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1 +ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0 +ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1 +ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1 +ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1 +ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1 +ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1 +ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1 +ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1 +ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1 +ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1 +ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1 +ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +ddcot498 comparetotal 1 1E-17 -> 1 +ddcot499 comparetotal 1 1E-16 -> 1 +ddcot500 comparetotal 1 1E-15 -> 1 +ddcot501 comparetotal 1 1E-14 -> 1 +ddcot502 comparetotal 1 1E-13 -> 1 +ddcot503 comparetotal 1 1E-12 -> 1 +ddcot504 comparetotal 1 1E-11 -> 1 +ddcot505 comparetotal 1 1E-10 -> 1 +ddcot506 comparetotal 1 1E-9 -> 1 +ddcot507 comparetotal 1 1E-8 -> 1 +ddcot508 comparetotal 1 1E-7 -> 1 +ddcot509 comparetotal 1 1E-6 -> 1 +ddcot510 comparetotal 1 1E-5 -> 1 +ddcot511 comparetotal 1 1E-4 -> 1 +ddcot512 comparetotal 1 1E-3 -> 1 +ddcot513 comparetotal 1 1E-2 -> 1 +ddcot514 comparetotal 1 1E-1 -> 1 +ddcot515 comparetotal 1 1E-0 -> 0 +ddcot516 comparetotal 1 1E+1 -> -1 +ddcot517 comparetotal 1 1E+2 -> -1 +ddcot518 comparetotal 1 1E+3 -> -1 +ddcot519 comparetotal 1 1E+4 -> -1 +ddcot521 comparetotal 1 1E+5 -> -1 +ddcot522 comparetotal 1 1E+6 -> -1 +ddcot523 comparetotal 1 1E+7 -> -1 +ddcot524 comparetotal 1 1E+8 -> -1 +ddcot525 comparetotal 1 1E+9 -> -1 +ddcot526 comparetotal 1 1E+10 -> -1 +ddcot527 comparetotal 1 1E+11 -> -1 +ddcot528 comparetotal 1 1E+12 -> -1 +ddcot529 comparetotal 1 1E+13 -> -1 +ddcot530 comparetotal 1 1E+14 -> -1 +ddcot531 comparetotal 1 1E+15 -> -1 +ddcot532 comparetotal 1 1E+16 -> -1 +ddcot533 comparetotal 1 1E+17 -> -1 +-- LR swap +ddcot538 comparetotal 1E-17 1 -> -1 +ddcot539 comparetotal 1E-16 1 -> -1 +ddcot540 comparetotal 1E-15 1 -> -1 +ddcot541 comparetotal 1E-14 1 -> -1 +ddcot542 comparetotal 1E-13 1 -> -1 +ddcot543 comparetotal 1E-12 1 -> -1 +ddcot544 comparetotal 1E-11 1 -> -1 +ddcot545 comparetotal 1E-10 1 -> -1 +ddcot546 comparetotal 1E-9 1 -> -1 +ddcot547 comparetotal 1E-8 1 -> -1 +ddcot548 comparetotal 1E-7 1 -> -1 +ddcot549 comparetotal 1E-6 1 -> -1 +ddcot550 comparetotal 1E-5 1 -> -1 +ddcot551 comparetotal 1E-4 1 -> -1 +ddcot552 comparetotal 1E-3 1 -> -1 +ddcot553 comparetotal 1E-2 1 -> -1 +ddcot554 comparetotal 1E-1 1 -> -1 +ddcot555 comparetotal 1E-0 1 -> 0 +ddcot556 comparetotal 1E+1 1 -> 1 +ddcot557 comparetotal 1E+2 1 -> 1 +ddcot558 comparetotal 1E+3 1 -> 1 +ddcot559 comparetotal 1E+4 1 -> 1 +ddcot561 comparetotal 1E+5 1 -> 1 +ddcot562 comparetotal 1E+6 1 -> 1 +ddcot563 comparetotal 1E+7 1 -> 1 +ddcot564 comparetotal 1E+8 1 -> 1 +ddcot565 comparetotal 1E+9 1 -> 1 +ddcot566 comparetotal 1E+10 1 -> 1 +ddcot567 comparetotal 1E+11 1 -> 1 +ddcot568 comparetotal 1E+12 1 -> 1 +ddcot569 comparetotal 1E+13 1 -> 1 +ddcot570 comparetotal 1E+14 1 -> 1 +ddcot571 comparetotal 1E+15 1 -> 1 +ddcot572 comparetotal 1E+16 1 -> 1 +ddcot573 comparetotal 1E+17 1 -> 1 +-- similar with a useful coefficient, one side only +ddcot578 comparetotal 0.000000987654321 1E-17 -> 1 +ddcot579 comparetotal 0.000000987654321 1E-16 -> 1 +ddcot580 comparetotal 0.000000987654321 1E-15 -> 1 +ddcot581 comparetotal 0.000000987654321 1E-14 -> 1 +ddcot582 comparetotal 0.000000987654321 1E-13 -> 1 +ddcot583 comparetotal 0.000000987654321 1E-12 -> 1 +ddcot584 comparetotal 0.000000987654321 1E-11 -> 1 +ddcot585 comparetotal 0.000000987654321 1E-10 -> 1 +ddcot586 comparetotal 0.000000987654321 1E-9 -> 1 +ddcot587 comparetotal 0.000000987654321 1E-8 -> 1 +ddcot588 comparetotal 0.000000987654321 1E-7 -> 1 +ddcot589 comparetotal 0.000000987654321 1E-6 -> -1 +ddcot590 comparetotal 0.000000987654321 1E-5 -> -1 +ddcot591 comparetotal 0.000000987654321 1E-4 -> -1 +ddcot592 comparetotal 0.000000987654321 1E-3 -> -1 +ddcot593 comparetotal 0.000000987654321 1E-2 -> -1 +ddcot594 comparetotal 0.000000987654321 1E-1 -> -1 +ddcot595 comparetotal 0.000000987654321 1E-0 -> -1 +ddcot596 comparetotal 0.000000987654321 1E+1 -> -1 +ddcot597 comparetotal 0.000000987654321 1E+2 -> -1 +ddcot598 comparetotal 0.000000987654321 1E+3 -> -1 +ddcot599 comparetotal 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +ddcot600 comparetotal 12 12.2345 -> -1 +ddcot601 comparetotal 12.0 12.2345 -> -1 +ddcot602 comparetotal 12.00 12.2345 -> -1 +ddcot603 comparetotal 12.000 12.2345 -> -1 +ddcot604 comparetotal 12.0000 12.2345 -> -1 +ddcot605 comparetotal 12.00000 12.2345 -> -1 +ddcot606 comparetotal 12.000000 12.2345 -> -1 +ddcot607 comparetotal 12.0000000 12.2345 -> -1 +ddcot608 comparetotal 12.00000000 12.2345 -> -1 +ddcot609 comparetotal 12.000000000 12.2345 -> -1 +ddcot610 comparetotal 12.1234 12 -> 1 +ddcot611 comparetotal 12.1234 12.0 -> 1 +ddcot612 comparetotal 12.1234 12.00 -> 1 +ddcot613 comparetotal 12.1234 12.000 -> 1 +ddcot614 comparetotal 12.1234 12.0000 -> 1 +ddcot615 comparetotal 12.1234 12.00000 -> 1 +ddcot616 comparetotal 12.1234 12.000000 -> 1 +ddcot617 comparetotal 12.1234 12.0000000 -> 1 +ddcot618 comparetotal 12.1234 12.00000000 -> 1 +ddcot619 comparetotal 12.1234 12.000000000 -> 1 +ddcot620 comparetotal -12 -12.2345 -> 1 +ddcot621 comparetotal -12.0 -12.2345 -> 1 +ddcot622 comparetotal -12.00 -12.2345 -> 1 +ddcot623 comparetotal -12.000 -12.2345 -> 1 +ddcot624 comparetotal -12.0000 -12.2345 -> 1 +ddcot625 comparetotal -12.00000 -12.2345 -> 1 +ddcot626 comparetotal -12.000000 -12.2345 -> 1 +ddcot627 comparetotal -12.0000000 -12.2345 -> 1 +ddcot628 comparetotal -12.00000000 -12.2345 -> 1 +ddcot629 comparetotal -12.000000000 -12.2345 -> 1 +ddcot630 comparetotal -12.1234 -12 -> -1 +ddcot631 comparetotal -12.1234 -12.0 -> -1 +ddcot632 comparetotal -12.1234 -12.00 -> -1 +ddcot633 comparetotal -12.1234 -12.000 -> -1 +ddcot634 comparetotal -12.1234 -12.0000 -> -1 +ddcot635 comparetotal -12.1234 -12.00000 -> -1 +ddcot636 comparetotal -12.1234 -12.000000 -> -1 +ddcot637 comparetotal -12.1234 -12.0000000 -> -1 +ddcot638 comparetotal -12.1234 -12.00000000 -> -1 +ddcot639 comparetotal -12.1234 -12.000000000 -> -1 + +-- extended zeros +ddcot640 comparetotal 0 0 -> 0 +ddcot641 comparetotal 0 -0 -> 1 +ddcot642 comparetotal 0 -0.0 -> 1 +ddcot643 comparetotal 0 0.0 -> 1 +ddcot644 comparetotal -0 0 -> -1 +ddcot645 comparetotal -0 -0 -> 0 +ddcot646 comparetotal -0 -0.0 -> -1 +ddcot647 comparetotal -0 0.0 -> -1 +ddcot648 comparetotal 0.0 0 -> -1 +ddcot649 comparetotal 0.0 -0 -> 1 +ddcot650 comparetotal 0.0 -0.0 -> 1 +ddcot651 comparetotal 0.0 0.0 -> 0 +ddcot652 comparetotal -0.0 0 -> -1 +ddcot653 comparetotal -0.0 -0 -> 1 +ddcot654 comparetotal -0.0 -0.0 -> 0 +ddcot655 comparetotal -0.0 0.0 -> -1 + +ddcot656 comparetotal -0E1 0.0 -> -1 +ddcot657 comparetotal -0E2 0.0 -> -1 +ddcot658 comparetotal 0E1 0.0 -> 1 +ddcot659 comparetotal 0E2 0.0 -> 1 +ddcot660 comparetotal -0E1 0 -> -1 +ddcot661 comparetotal -0E2 0 -> -1 +ddcot662 comparetotal 0E1 0 -> 1 +ddcot663 comparetotal 0E2 0 -> 1 +ddcot664 comparetotal -0E1 -0E1 -> 0 +ddcot665 comparetotal -0E2 -0E1 -> -1 +ddcot666 comparetotal 0E1 -0E1 -> 1 +ddcot667 comparetotal 0E2 -0E1 -> 1 +ddcot668 comparetotal -0E1 -0E2 -> 1 +ddcot669 comparetotal -0E2 -0E2 -> 0 +ddcot670 comparetotal 0E1 -0E2 -> 1 +ddcot671 comparetotal 0E2 -0E2 -> 1 +ddcot672 comparetotal -0E1 0E1 -> -1 +ddcot673 comparetotal -0E2 0E1 -> -1 +ddcot674 comparetotal 0E1 0E1 -> 0 +ddcot675 comparetotal 0E2 0E1 -> 1 +ddcot676 comparetotal -0E1 0E2 -> -1 +ddcot677 comparetotal -0E2 0E2 -> -1 +ddcot678 comparetotal 0E1 0E2 -> -1 +ddcot679 comparetotal 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +ddcot680 comparetotal 12 12 -> 0 +ddcot681 comparetotal 12 12.0 -> 1 +ddcot682 comparetotal 12 12.00 -> 1 +ddcot683 comparetotal 12 12.000 -> 1 +ddcot684 comparetotal 12 12.0000 -> 1 +ddcot685 comparetotal 12 12.00000 -> 1 +ddcot686 comparetotal 12 12.000000 -> 1 +ddcot687 comparetotal 12 12.0000000 -> 1 +ddcot688 comparetotal 12 12.00000000 -> 1 +ddcot689 comparetotal 12 12.000000000 -> 1 +ddcot690 comparetotal 12 12 -> 0 +ddcot691 comparetotal 12.0 12 -> -1 +ddcot692 comparetotal 12.00 12 -> -1 +ddcot693 comparetotal 12.000 12 -> -1 +ddcot694 comparetotal 12.0000 12 -> -1 +ddcot695 comparetotal 12.00000 12 -> -1 +ddcot696 comparetotal 12.000000 12 -> -1 +ddcot697 comparetotal 12.0000000 12 -> -1 +ddcot698 comparetotal 12.00000000 12 -> -1 +ddcot699 comparetotal 12.000000000 12 -> -1 + +-- old long operand checks +ddcot701 comparetotal 12345678000 1 -> 1 +ddcot702 comparetotal 1 12345678000 -> -1 +ddcot703 comparetotal 1234567800 1 -> 1 +ddcot704 comparetotal 1 1234567800 -> -1 +ddcot705 comparetotal 1234567890 1 -> 1 +ddcot706 comparetotal 1 1234567890 -> -1 +ddcot707 comparetotal 1234567891 1 -> 1 +ddcot708 comparetotal 1 1234567891 -> -1 +ddcot709 comparetotal 12345678901 1 -> 1 +ddcot710 comparetotal 1 12345678901 -> -1 +ddcot711 comparetotal 1234567896 1 -> 1 +ddcot712 comparetotal 1 1234567896 -> -1 +ddcot713 comparetotal -1234567891 1 -> -1 +ddcot714 comparetotal 1 -1234567891 -> 1 +ddcot715 comparetotal -12345678901 1 -> -1 +ddcot716 comparetotal 1 -12345678901 -> 1 +ddcot717 comparetotal -1234567896 1 -> -1 +ddcot718 comparetotal 1 -1234567896 -> 1 + +-- old residue cases +ddcot740 comparetotal 1 0.9999999 -> 1 +ddcot741 comparetotal 1 0.999999 -> 1 +ddcot742 comparetotal 1 0.99999 -> 1 +ddcot743 comparetotal 1 1.0000 -> 1 +ddcot744 comparetotal 1 1.00001 -> -1 +ddcot745 comparetotal 1 1.000001 -> -1 +ddcot746 comparetotal 1 1.0000001 -> -1 +ddcot750 comparetotal 0.9999999 1 -> -1 +ddcot751 comparetotal 0.999999 1 -> -1 +ddcot752 comparetotal 0.99999 1 -> -1 +ddcot753 comparetotal 1.0000 1 -> -1 +ddcot754 comparetotal 1.00001 1 -> 1 +ddcot755 comparetotal 1.000001 1 -> 1 +ddcot756 comparetotal 1.0000001 1 -> 1 + +-- Specials +ddcot780 comparetotal Inf -Inf -> 1 +ddcot781 comparetotal Inf -1000 -> 1 +ddcot782 comparetotal Inf -1 -> 1 +ddcot783 comparetotal Inf -0 -> 1 +ddcot784 comparetotal Inf 0 -> 1 +ddcot785 comparetotal Inf 1 -> 1 +ddcot786 comparetotal Inf 1000 -> 1 +ddcot787 comparetotal Inf Inf -> 0 +ddcot788 comparetotal -1000 Inf -> -1 +ddcot789 comparetotal -Inf Inf -> -1 +ddcot790 comparetotal -1 Inf -> -1 +ddcot791 comparetotal -0 Inf -> -1 +ddcot792 comparetotal 0 Inf -> -1 +ddcot793 comparetotal 1 Inf -> -1 +ddcot794 comparetotal 1000 Inf -> -1 +ddcot795 comparetotal Inf Inf -> 0 + +ddcot800 comparetotal -Inf -Inf -> 0 +ddcot801 comparetotal -Inf -1000 -> -1 +ddcot802 comparetotal -Inf -1 -> -1 +ddcot803 comparetotal -Inf -0 -> -1 +ddcot804 comparetotal -Inf 0 -> -1 +ddcot805 comparetotal -Inf 1 -> -1 +ddcot806 comparetotal -Inf 1000 -> -1 +ddcot807 comparetotal -Inf Inf -> -1 +ddcot808 comparetotal -Inf -Inf -> 0 +ddcot809 comparetotal -1000 -Inf -> 1 +ddcot810 comparetotal -1 -Inf -> 1 +ddcot811 comparetotal -0 -Inf -> 1 +ddcot812 comparetotal 0 -Inf -> 1 +ddcot813 comparetotal 1 -Inf -> 1 +ddcot814 comparetotal 1000 -Inf -> 1 +ddcot815 comparetotal Inf -Inf -> 1 + +ddcot821 comparetotal NaN -Inf -> 1 +ddcot822 comparetotal NaN -1000 -> 1 +ddcot823 comparetotal NaN -1 -> 1 +ddcot824 comparetotal NaN -0 -> 1 +ddcot825 comparetotal NaN 0 -> 1 +ddcot826 comparetotal NaN 1 -> 1 +ddcot827 comparetotal NaN 1000 -> 1 +ddcot828 comparetotal NaN Inf -> 1 +ddcot829 comparetotal NaN NaN -> 0 +ddcot830 comparetotal -Inf NaN -> -1 +ddcot831 comparetotal -1000 NaN -> -1 +ddcot832 comparetotal -1 NaN -> -1 +ddcot833 comparetotal -0 NaN -> -1 +ddcot834 comparetotal 0 NaN -> -1 +ddcot835 comparetotal 1 NaN -> -1 +ddcot836 comparetotal 1000 NaN -> -1 +ddcot837 comparetotal Inf NaN -> -1 +ddcot838 comparetotal -NaN -NaN -> 0 +ddcot839 comparetotal +NaN -NaN -> 1 +ddcot840 comparetotal -NaN +NaN -> -1 + +ddcot841 comparetotal sNaN -sNaN -> 1 +ddcot842 comparetotal sNaN -NaN -> 1 +ddcot843 comparetotal sNaN -Inf -> 1 +ddcot844 comparetotal sNaN -1000 -> 1 +ddcot845 comparetotal sNaN -1 -> 1 +ddcot846 comparetotal sNaN -0 -> 1 +ddcot847 comparetotal sNaN 0 -> 1 +ddcot848 comparetotal sNaN 1 -> 1 +ddcot849 comparetotal sNaN 1000 -> 1 +ddcot850 comparetotal sNaN NaN -> -1 +ddcot851 comparetotal sNaN sNaN -> 0 + +ddcot852 comparetotal -sNaN sNaN -> -1 +ddcot853 comparetotal -NaN sNaN -> -1 +ddcot854 comparetotal -Inf sNaN -> -1 +ddcot855 comparetotal -1000 sNaN -> -1 +ddcot856 comparetotal -1 sNaN -> -1 +ddcot857 comparetotal -0 sNaN -> -1 +ddcot858 comparetotal 0 sNaN -> -1 +ddcot859 comparetotal 1 sNaN -> -1 +ddcot860 comparetotal 1000 sNaN -> -1 +ddcot861 comparetotal Inf sNaN -> -1 +ddcot862 comparetotal NaN sNaN -> 1 +ddcot863 comparetotal sNaN sNaN -> 0 + +ddcot871 comparetotal -sNaN -sNaN -> 0 +ddcot872 comparetotal -sNaN -NaN -> 1 +ddcot873 comparetotal -sNaN -Inf -> -1 +ddcot874 comparetotal -sNaN -1000 -> -1 +ddcot875 comparetotal -sNaN -1 -> -1 +ddcot876 comparetotal -sNaN -0 -> -1 +ddcot877 comparetotal -sNaN 0 -> -1 +ddcot878 comparetotal -sNaN 1 -> -1 +ddcot879 comparetotal -sNaN 1000 -> -1 +ddcot880 comparetotal -sNaN NaN -> -1 +ddcot881 comparetotal -sNaN sNaN -> -1 + +ddcot882 comparetotal -sNaN -sNaN -> 0 +ddcot883 comparetotal -NaN -sNaN -> -1 +ddcot884 comparetotal -Inf -sNaN -> 1 +ddcot885 comparetotal -1000 -sNaN -> 1 +ddcot886 comparetotal -1 -sNaN -> 1 +ddcot887 comparetotal -0 -sNaN -> 1 +ddcot888 comparetotal 0 -sNaN -> 1 +ddcot889 comparetotal 1 -sNaN -> 1 +ddcot890 comparetotal 1000 -sNaN -> 1 +ddcot891 comparetotal Inf -sNaN -> 1 +ddcot892 comparetotal NaN -sNaN -> 1 +ddcot893 comparetotal sNaN -sNaN -> 1 + +-- NaNs with payload +ddcot960 comparetotal NaN9 -Inf -> 1 +ddcot961 comparetotal NaN8 999 -> 1 +ddcot962 comparetotal NaN77 Inf -> 1 +ddcot963 comparetotal -NaN67 NaN5 -> -1 +ddcot964 comparetotal -Inf -NaN4 -> 1 +ddcot965 comparetotal -999 -NaN33 -> 1 +ddcot966 comparetotal Inf NaN2 -> -1 + +ddcot970 comparetotal -NaN41 -NaN42 -> 1 +ddcot971 comparetotal +NaN41 -NaN42 -> 1 +ddcot972 comparetotal -NaN41 +NaN42 -> -1 +ddcot973 comparetotal +NaN41 +NaN42 -> -1 +ddcot974 comparetotal -NaN42 -NaN01 -> -1 +ddcot975 comparetotal +NaN42 -NaN01 -> 1 +ddcot976 comparetotal -NaN42 +NaN01 -> -1 +ddcot977 comparetotal +NaN42 +NaN01 -> 1 + +ddcot980 comparetotal -sNaN771 -sNaN772 -> 1 +ddcot981 comparetotal +sNaN771 -sNaN772 -> 1 +ddcot982 comparetotal -sNaN771 +sNaN772 -> -1 +ddcot983 comparetotal +sNaN771 +sNaN772 -> -1 +ddcot984 comparetotal -sNaN772 -sNaN771 -> -1 +ddcot985 comparetotal +sNaN772 -sNaN771 -> 1 +ddcot986 comparetotal -sNaN772 +sNaN771 -> -1 +ddcot987 comparetotal +sNaN772 +sNaN771 -> 1 + +ddcot991 comparetotal -sNaN99 -Inf -> -1 +ddcot992 comparetotal sNaN98 -11 -> 1 +ddcot993 comparetotal sNaN97 NaN -> -1 +ddcot994 comparetotal sNaN16 sNaN94 -> -1 +ddcot995 comparetotal NaN85 sNaN83 -> 1 +ddcot996 comparetotal -Inf sNaN92 -> -1 +ddcot997 comparetotal 088 sNaN81 -> -1 +ddcot998 comparetotal Inf sNaN90 -> -1 +ddcot999 comparetotal NaN -sNaN89 -> 1 + +-- spread zeros +ddcot1110 comparetotal 0E-383 0 -> -1 +ddcot1111 comparetotal 0E-383 -0 -> 1 +ddcot1112 comparetotal -0E-383 0 -> -1 +ddcot1113 comparetotal -0E-383 -0 -> 1 +ddcot1114 comparetotal 0E-383 0E+384 -> -1 +ddcot1115 comparetotal 0E-383 -0E+384 -> 1 +ddcot1116 comparetotal -0E-383 0E+384 -> -1 +ddcot1117 comparetotal -0E-383 -0E+384 -> 1 +ddcot1118 comparetotal 0 0E+384 -> -1 +ddcot1119 comparetotal 0 -0E+384 -> 1 +ddcot1120 comparetotal -0 0E+384 -> -1 +ddcot1121 comparetotal -0 -0E+384 -> 1 + +ddcot1130 comparetotal 0E+384 0 -> 1 +ddcot1131 comparetotal 0E+384 -0 -> 1 +ddcot1132 comparetotal -0E+384 0 -> -1 +ddcot1133 comparetotal -0E+384 -0 -> -1 +ddcot1134 comparetotal 0E+384 0E-383 -> 1 +ddcot1135 comparetotal 0E+384 -0E-383 -> 1 +ddcot1136 comparetotal -0E+384 0E-383 -> -1 +ddcot1137 comparetotal -0E+384 -0E-383 -> -1 +ddcot1138 comparetotal 0 0E-383 -> 1 +ddcot1139 comparetotal 0 -0E-383 -> 1 +ddcot1140 comparetotal -0 0E-383 -> -1 +ddcot1141 comparetotal -0 -0E-383 -> -1 + +-- Null tests +ddcot9990 comparetotal 10 # -> NaN Invalid_operation +ddcot9991 comparetotal # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareTotalMag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCompareTotalMag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,706 @@ +------------------------------------------------------------------------ +-- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order-- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). +-- Similarly, comparetotal will have some radically different paths +-- than compare. + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddctm001 comparetotmag -2 -2 -> 0 +ddctm002 comparetotmag -2 -1 -> 1 +ddctm003 comparetotmag -2 0 -> 1 +ddctm004 comparetotmag -2 1 -> 1 +ddctm005 comparetotmag -2 2 -> 0 +ddctm006 comparetotmag -1 -2 -> -1 +ddctm007 comparetotmag -1 -1 -> 0 +ddctm008 comparetotmag -1 0 -> 1 +ddctm009 comparetotmag -1 1 -> 0 +ddctm010 comparetotmag -1 2 -> -1 +ddctm011 comparetotmag 0 -2 -> -1 +ddctm012 comparetotmag 0 -1 -> -1 +ddctm013 comparetotmag 0 0 -> 0 +ddctm014 comparetotmag 0 1 -> -1 +ddctm015 comparetotmag 0 2 -> -1 +ddctm016 comparetotmag 1 -2 -> -1 +ddctm017 comparetotmag 1 -1 -> 0 +ddctm018 comparetotmag 1 0 -> 1 +ddctm019 comparetotmag 1 1 -> 0 +ddctm020 comparetotmag 1 2 -> -1 +ddctm021 comparetotmag 2 -2 -> 0 +ddctm022 comparetotmag 2 -1 -> 1 +ddctm023 comparetotmag 2 0 -> 1 +ddctm025 comparetotmag 2 1 -> 1 +ddctm026 comparetotmag 2 2 -> 0 + +ddctm031 comparetotmag -20 -20 -> 0 +ddctm032 comparetotmag -20 -10 -> 1 +ddctm033 comparetotmag -20 00 -> 1 +ddctm034 comparetotmag -20 10 -> 1 +ddctm035 comparetotmag -20 20 -> 0 +ddctm036 comparetotmag -10 -20 -> -1 +ddctm037 comparetotmag -10 -10 -> 0 +ddctm038 comparetotmag -10 00 -> 1 +ddctm039 comparetotmag -10 10 -> 0 +ddctm040 comparetotmag -10 20 -> -1 +ddctm041 comparetotmag 00 -20 -> -1 +ddctm042 comparetotmag 00 -10 -> -1 +ddctm043 comparetotmag 00 00 -> 0 +ddctm044 comparetotmag 00 10 -> -1 +ddctm045 comparetotmag 00 20 -> -1 +ddctm046 comparetotmag 10 -20 -> -1 +ddctm047 comparetotmag 10 -10 -> 0 +ddctm048 comparetotmag 10 00 -> 1 +ddctm049 comparetotmag 10 10 -> 0 +ddctm050 comparetotmag 10 20 -> -1 +ddctm051 comparetotmag 20 -20 -> 0 +ddctm052 comparetotmag 20 -10 -> 1 +ddctm053 comparetotmag 20 00 -> 1 +ddctm055 comparetotmag 20 10 -> 1 +ddctm056 comparetotmag 20 20 -> 0 + +ddctm061 comparetotmag -2.0 -2.0 -> 0 +ddctm062 comparetotmag -2.0 -1.0 -> 1 +ddctm063 comparetotmag -2.0 0.0 -> 1 +ddctm064 comparetotmag -2.0 1.0 -> 1 +ddctm065 comparetotmag -2.0 2.0 -> 0 +ddctm066 comparetotmag -1.0 -2.0 -> -1 +ddctm067 comparetotmag -1.0 -1.0 -> 0 +ddctm068 comparetotmag -1.0 0.0 -> 1 +ddctm069 comparetotmag -1.0 1.0 -> 0 +ddctm070 comparetotmag -1.0 2.0 -> -1 +ddctm071 comparetotmag 0.0 -2.0 -> -1 +ddctm072 comparetotmag 0.0 -1.0 -> -1 +ddctm073 comparetotmag 0.0 0.0 -> 0 +ddctm074 comparetotmag 0.0 1.0 -> -1 +ddctm075 comparetotmag 0.0 2.0 -> -1 +ddctm076 comparetotmag 1.0 -2.0 -> -1 +ddctm077 comparetotmag 1.0 -1.0 -> 0 +ddctm078 comparetotmag 1.0 0.0 -> 1 +ddctm079 comparetotmag 1.0 1.0 -> 0 +ddctm080 comparetotmag 1.0 2.0 -> -1 +ddctm081 comparetotmag 2.0 -2.0 -> 0 +ddctm082 comparetotmag 2.0 -1.0 -> 1 +ddctm083 comparetotmag 2.0 0.0 -> 1 +ddctm085 comparetotmag 2.0 1.0 -> 1 +ddctm086 comparetotmag 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +ddctm090 comparetotmag 9.99999999E+384 9.99999999E+384 -> 0 +ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384 -> 0 +ddctm092 comparetotmag 9.99999999E+384 -9.99999999E+384 -> 0 +ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384 -> 0 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +ddctm100 comparetotmag 7.0 7.0 -> 0 +ddctm101 comparetotmag 7.0 7 -> -1 +ddctm102 comparetotmag 7 7.0 -> 1 +ddctm103 comparetotmag 7E+0 7.0 -> 1 +ddctm104 comparetotmag 70E-1 7.0 -> 0 +ddctm105 comparetotmag 0.7E+1 7 -> 0 +ddctm106 comparetotmag 70E-1 7 -> -1 +ddctm107 comparetotmag 7.0 7E+0 -> -1 +ddctm108 comparetotmag 7.0 70E-1 -> 0 +ddctm109 comparetotmag 7 0.7E+1 -> 0 +ddctm110 comparetotmag 7 70E-1 -> 1 + +ddctm120 comparetotmag 8.0 7.0 -> 1 +ddctm121 comparetotmag 8.0 7 -> 1 +ddctm122 comparetotmag 8 7.0 -> 1 +ddctm123 comparetotmag 8E+0 7.0 -> 1 +ddctm124 comparetotmag 80E-1 7.0 -> 1 +ddctm125 comparetotmag 0.8E+1 7 -> 1 +ddctm126 comparetotmag 80E-1 7 -> 1 +ddctm127 comparetotmag 8.0 7E+0 -> 1 +ddctm128 comparetotmag 8.0 70E-1 -> 1 +ddctm129 comparetotmag 8 0.7E+1 -> 1 +ddctm130 comparetotmag 8 70E-1 -> 1 + +ddctm140 comparetotmag 8.0 9.0 -> -1 +ddctm141 comparetotmag 8.0 9 -> -1 +ddctm142 comparetotmag 8 9.0 -> -1 +ddctm143 comparetotmag 8E+0 9.0 -> -1 +ddctm144 comparetotmag 80E-1 9.0 -> -1 +ddctm145 comparetotmag 0.8E+1 9 -> -1 +ddctm146 comparetotmag 80E-1 9 -> -1 +ddctm147 comparetotmag 8.0 9E+0 -> -1 +ddctm148 comparetotmag 8.0 90E-1 -> -1 +ddctm149 comparetotmag 8 0.9E+1 -> -1 +ddctm150 comparetotmag 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +ddctm200 comparetotmag -7.0 7.0 -> 0 +ddctm201 comparetotmag -7.0 7 -> -1 +ddctm202 comparetotmag -7 7.0 -> 1 +ddctm203 comparetotmag -7E+0 7.0 -> 1 +ddctm204 comparetotmag -70E-1 7.0 -> 0 +ddctm205 comparetotmag -0.7E+1 7 -> 0 +ddctm206 comparetotmag -70E-1 7 -> -1 +ddctm207 comparetotmag -7.0 7E+0 -> -1 +ddctm208 comparetotmag -7.0 70E-1 -> 0 +ddctm209 comparetotmag -7 0.7E+1 -> 0 +ddctm210 comparetotmag -7 70E-1 -> 1 + +ddctm220 comparetotmag -8.0 7.0 -> 1 +ddctm221 comparetotmag -8.0 7 -> 1 +ddctm222 comparetotmag -8 7.0 -> 1 +ddctm223 comparetotmag -8E+0 7.0 -> 1 +ddctm224 comparetotmag -80E-1 7.0 -> 1 +ddctm225 comparetotmag -0.8E+1 7 -> 1 +ddctm226 comparetotmag -80E-1 7 -> 1 +ddctm227 comparetotmag -8.0 7E+0 -> 1 +ddctm228 comparetotmag -8.0 70E-1 -> 1 +ddctm229 comparetotmag -8 0.7E+1 -> 1 +ddctm230 comparetotmag -8 70E-1 -> 1 + +ddctm240 comparetotmag -8.0 9.0 -> -1 +ddctm241 comparetotmag -8.0 9 -> -1 +ddctm242 comparetotmag -8 9.0 -> -1 +ddctm243 comparetotmag -8E+0 9.0 -> -1 +ddctm244 comparetotmag -80E-1 9.0 -> -1 +ddctm245 comparetotmag -0.8E+1 9 -> -1 +ddctm246 comparetotmag -80E-1 9 -> -1 +ddctm247 comparetotmag -8.0 9E+0 -> -1 +ddctm248 comparetotmag -8.0 90E-1 -> -1 +ddctm249 comparetotmag -8 0.9E+1 -> -1 +ddctm250 comparetotmag -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +ddctm300 comparetotmag 7.0 -7.0 -> 0 +ddctm301 comparetotmag 7.0 -7 -> -1 +ddctm302 comparetotmag 7 -7.0 -> 1 +ddctm303 comparetotmag 7E+0 -7.0 -> 1 +ddctm304 comparetotmag 70E-1 -7.0 -> 0 +ddctm305 comparetotmag .7E+1 -7 -> 0 +ddctm306 comparetotmag 70E-1 -7 -> -1 +ddctm307 comparetotmag 7.0 -7E+0 -> -1 +ddctm308 comparetotmag 7.0 -70E-1 -> 0 +ddctm309 comparetotmag 7 -.7E+1 -> 0 +ddctm310 comparetotmag 7 -70E-1 -> 1 + +ddctm320 comparetotmag 8.0 -7.0 -> 1 +ddctm321 comparetotmag 8.0 -7 -> 1 +ddctm322 comparetotmag 8 -7.0 -> 1 +ddctm323 comparetotmag 8E+0 -7.0 -> 1 +ddctm324 comparetotmag 80E-1 -7.0 -> 1 +ddctm325 comparetotmag .8E+1 -7 -> 1 +ddctm326 comparetotmag 80E-1 -7 -> 1 +ddctm327 comparetotmag 8.0 -7E+0 -> 1 +ddctm328 comparetotmag 8.0 -70E-1 -> 1 +ddctm329 comparetotmag 8 -.7E+1 -> 1 +ddctm330 comparetotmag 8 -70E-1 -> 1 + +ddctm340 comparetotmag 8.0 -9.0 -> -1 +ddctm341 comparetotmag 8.0 -9 -> -1 +ddctm342 comparetotmag 8 -9.0 -> -1 +ddctm343 comparetotmag 8E+0 -9.0 -> -1 +ddctm344 comparetotmag 80E-1 -9.0 -> -1 +ddctm345 comparetotmag .8E+1 -9 -> -1 +ddctm346 comparetotmag 80E-1 -9 -> -1 +ddctm347 comparetotmag 8.0 -9E+0 -> -1 +ddctm348 comparetotmag 8.0 -90E-1 -> -1 +ddctm349 comparetotmag 8 -.9E+1 -> -1 +ddctm350 comparetotmag 8 -90E-1 -> -1 + +-- and again, with sign changes -- .. +ddctm400 comparetotmag -7.0 -7.0 -> 0 +ddctm401 comparetotmag -7.0 -7 -> -1 +ddctm402 comparetotmag -7 -7.0 -> 1 +ddctm403 comparetotmag -7E+0 -7.0 -> 1 +ddctm404 comparetotmag -70E-1 -7.0 -> 0 +ddctm405 comparetotmag -.7E+1 -7 -> 0 +ddctm406 comparetotmag -70E-1 -7 -> -1 +ddctm407 comparetotmag -7.0 -7E+0 -> -1 +ddctm408 comparetotmag -7.0 -70E-1 -> 0 +ddctm409 comparetotmag -7 -.7E+1 -> 0 +ddctm410 comparetotmag -7 -70E-1 -> 1 + +ddctm420 comparetotmag -8.0 -7.0 -> 1 +ddctm421 comparetotmag -8.0 -7 -> 1 +ddctm422 comparetotmag -8 -7.0 -> 1 +ddctm423 comparetotmag -8E+0 -7.0 -> 1 +ddctm424 comparetotmag -80E-1 -7.0 -> 1 +ddctm425 comparetotmag -.8E+1 -7 -> 1 +ddctm426 comparetotmag -80E-1 -7 -> 1 +ddctm427 comparetotmag -8.0 -7E+0 -> 1 +ddctm428 comparetotmag -8.0 -70E-1 -> 1 +ddctm429 comparetotmag -8 -.7E+1 -> 1 +ddctm430 comparetotmag -8 -70E-1 -> 1 + +ddctm440 comparetotmag -8.0 -9.0 -> -1 +ddctm441 comparetotmag -8.0 -9 -> -1 +ddctm442 comparetotmag -8 -9.0 -> -1 +ddctm443 comparetotmag -8E+0 -9.0 -> -1 +ddctm444 comparetotmag -80E-1 -9.0 -> -1 +ddctm445 comparetotmag -.8E+1 -9 -> -1 +ddctm446 comparetotmag -80E-1 -9 -> -1 +ddctm447 comparetotmag -8.0 -9E+0 -> -1 +ddctm448 comparetotmag -8.0 -90E-1 -> -1 +ddctm449 comparetotmag -8 -.9E+1 -> -1 +ddctm450 comparetotmag -8 -90E-1 -> -1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1 +ddctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1 +ddctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1 +ddctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1 +ddctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1 +ddctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1 +ddctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1 +ddctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1 +ddctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1 +ddctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1 +ddctm483 comparetotmag 123.456E-89 123.456E-89 -> 0 +ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1 +ddctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1 +ddctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1 +ddctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1 +ddctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1 +ddctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1 +ddctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1 +ddctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1 +ddctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1 +ddctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1 +ddctm497 comparetotmag 123.456E+89 123.456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +ddctm498 comparetotmag 1 1E-17 -> 1 +ddctm499 comparetotmag 1 1E-16 -> 1 +ddctm500 comparetotmag 1 1E-15 -> 1 +ddctm501 comparetotmag 1 1E-14 -> 1 +ddctm502 comparetotmag 1 1E-13 -> 1 +ddctm503 comparetotmag 1 1E-12 -> 1 +ddctm504 comparetotmag 1 1E-11 -> 1 +ddctm505 comparetotmag 1 1E-10 -> 1 +ddctm506 comparetotmag 1 1E-9 -> 1 +ddctm507 comparetotmag 1 1E-8 -> 1 +ddctm508 comparetotmag 1 1E-7 -> 1 +ddctm509 comparetotmag 1 1E-6 -> 1 +ddctm510 comparetotmag 1 1E-5 -> 1 +ddctm511 comparetotmag 1 1E-4 -> 1 +ddctm512 comparetotmag 1 1E-3 -> 1 +ddctm513 comparetotmag 1 1E-2 -> 1 +ddctm514 comparetotmag 1 1E-1 -> 1 +ddctm515 comparetotmag 1 1E-0 -> 0 +ddctm516 comparetotmag 1 1E+1 -> -1 +ddctm517 comparetotmag 1 1E+2 -> -1 +ddctm518 comparetotmag 1 1E+3 -> -1 +ddctm519 comparetotmag 1 1E+4 -> -1 +ddctm521 comparetotmag 1 1E+5 -> -1 +ddctm522 comparetotmag 1 1E+6 -> -1 +ddctm523 comparetotmag 1 1E+7 -> -1 +ddctm524 comparetotmag 1 1E+8 -> -1 +ddctm525 comparetotmag 1 1E+9 -> -1 +ddctm526 comparetotmag 1 1E+10 -> -1 +ddctm527 comparetotmag 1 1E+11 -> -1 +ddctm528 comparetotmag 1 1E+12 -> -1 +ddctm529 comparetotmag 1 1E+13 -> -1 +ddctm530 comparetotmag 1 1E+14 -> -1 +ddctm531 comparetotmag 1 1E+15 -> -1 +ddctm532 comparetotmag 1 1E+16 -> -1 +ddctm533 comparetotmag 1 1E+17 -> -1 +-- LR swap +ddctm538 comparetotmag 1E-17 1 -> -1 +ddctm539 comparetotmag 1E-16 1 -> -1 +ddctm540 comparetotmag 1E-15 1 -> -1 +ddctm541 comparetotmag 1E-14 1 -> -1 +ddctm542 comparetotmag 1E-13 1 -> -1 +ddctm543 comparetotmag 1E-12 1 -> -1 +ddctm544 comparetotmag 1E-11 1 -> -1 +ddctm545 comparetotmag 1E-10 1 -> -1 +ddctm546 comparetotmag 1E-9 1 -> -1 +ddctm547 comparetotmag 1E-8 1 -> -1 +ddctm548 comparetotmag 1E-7 1 -> -1 +ddctm549 comparetotmag 1E-6 1 -> -1 +ddctm550 comparetotmag 1E-5 1 -> -1 +ddctm551 comparetotmag 1E-4 1 -> -1 +ddctm552 comparetotmag 1E-3 1 -> -1 +ddctm553 comparetotmag 1E-2 1 -> -1 +ddctm554 comparetotmag 1E-1 1 -> -1 +ddctm555 comparetotmag 1E-0 1 -> 0 +ddctm556 comparetotmag 1E+1 1 -> 1 +ddctm557 comparetotmag 1E+2 1 -> 1 +ddctm558 comparetotmag 1E+3 1 -> 1 +ddctm559 comparetotmag 1E+4 1 -> 1 +ddctm561 comparetotmag 1E+5 1 -> 1 +ddctm562 comparetotmag 1E+6 1 -> 1 +ddctm563 comparetotmag 1E+7 1 -> 1 +ddctm564 comparetotmag 1E+8 1 -> 1 +ddctm565 comparetotmag 1E+9 1 -> 1 +ddctm566 comparetotmag 1E+10 1 -> 1 +ddctm567 comparetotmag 1E+11 1 -> 1 +ddctm568 comparetotmag 1E+12 1 -> 1 +ddctm569 comparetotmag 1E+13 1 -> 1 +ddctm570 comparetotmag 1E+14 1 -> 1 +ddctm571 comparetotmag 1E+15 1 -> 1 +ddctm572 comparetotmag 1E+16 1 -> 1 +ddctm573 comparetotmag 1E+17 1 -> 1 +-- similar with a useful coefficient, one side only +ddctm578 comparetotmag 0.000000987654321 1E-17 -> 1 +ddctm579 comparetotmag 0.000000987654321 1E-16 -> 1 +ddctm580 comparetotmag 0.000000987654321 1E-15 -> 1 +ddctm581 comparetotmag 0.000000987654321 1E-14 -> 1 +ddctm582 comparetotmag 0.000000987654321 1E-13 -> 1 +ddctm583 comparetotmag 0.000000987654321 1E-12 -> 1 +ddctm584 comparetotmag 0.000000987654321 1E-11 -> 1 +ddctm585 comparetotmag 0.000000987654321 1E-10 -> 1 +ddctm586 comparetotmag 0.000000987654321 1E-9 -> 1 +ddctm587 comparetotmag 0.000000987654321 1E-8 -> 1 +ddctm588 comparetotmag 0.000000987654321 1E-7 -> 1 +ddctm589 comparetotmag 0.000000987654321 1E-6 -> -1 +ddctm590 comparetotmag 0.000000987654321 1E-5 -> -1 +ddctm591 comparetotmag 0.000000987654321 1E-4 -> -1 +ddctm592 comparetotmag 0.000000987654321 1E-3 -> -1 +ddctm593 comparetotmag 0.000000987654321 1E-2 -> -1 +ddctm594 comparetotmag 0.000000987654321 1E-1 -> -1 +ddctm595 comparetotmag 0.000000987654321 1E-0 -> -1 +ddctm596 comparetotmag 0.000000987654321 1E+1 -> -1 +ddctm597 comparetotmag 0.000000987654321 1E+2 -> -1 +ddctm598 comparetotmag 0.000000987654321 1E+3 -> -1 +ddctm599 comparetotmag 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +ddctm600 comparetotmag 12 12.2345 -> -1 +ddctm601 comparetotmag 12.0 12.2345 -> -1 +ddctm602 comparetotmag 12.00 12.2345 -> -1 +ddctm603 comparetotmag 12.000 12.2345 -> -1 +ddctm604 comparetotmag 12.0000 12.2345 -> -1 +ddctm605 comparetotmag 12.00000 12.2345 -> -1 +ddctm606 comparetotmag 12.000000 12.2345 -> -1 +ddctm607 comparetotmag 12.0000000 12.2345 -> -1 +ddctm608 comparetotmag 12.00000000 12.2345 -> -1 +ddctm609 comparetotmag 12.000000000 12.2345 -> -1 +ddctm610 comparetotmag 12.1234 12 -> 1 +ddctm611 comparetotmag 12.1234 12.0 -> 1 +ddctm612 comparetotmag 12.1234 12.00 -> 1 +ddctm613 comparetotmag 12.1234 12.000 -> 1 +ddctm614 comparetotmag 12.1234 12.0000 -> 1 +ddctm615 comparetotmag 12.1234 12.00000 -> 1 +ddctm616 comparetotmag 12.1234 12.000000 -> 1 +ddctm617 comparetotmag 12.1234 12.0000000 -> 1 +ddctm618 comparetotmag 12.1234 12.00000000 -> 1 +ddctm619 comparetotmag 12.1234 12.000000000 -> 1 +ddctm620 comparetotmag -12 -12.2345 -> -1 +ddctm621 comparetotmag -12.0 -12.2345 -> -1 +ddctm622 comparetotmag -12.00 -12.2345 -> -1 +ddctm623 comparetotmag -12.000 -12.2345 -> -1 +ddctm624 comparetotmag -12.0000 -12.2345 -> -1 +ddctm625 comparetotmag -12.00000 -12.2345 -> -1 +ddctm626 comparetotmag -12.000000 -12.2345 -> -1 +ddctm627 comparetotmag -12.0000000 -12.2345 -> -1 +ddctm628 comparetotmag -12.00000000 -12.2345 -> -1 +ddctm629 comparetotmag -12.000000000 -12.2345 -> -1 +ddctm630 comparetotmag -12.1234 -12 -> 1 +ddctm631 comparetotmag -12.1234 -12.0 -> 1 +ddctm632 comparetotmag -12.1234 -12.00 -> 1 +ddctm633 comparetotmag -12.1234 -12.000 -> 1 +ddctm634 comparetotmag -12.1234 -12.0000 -> 1 +ddctm635 comparetotmag -12.1234 -12.00000 -> 1 +ddctm636 comparetotmag -12.1234 -12.000000 -> 1 +ddctm637 comparetotmag -12.1234 -12.0000000 -> 1 +ddctm638 comparetotmag -12.1234 -12.00000000 -> 1 +ddctm639 comparetotmag -12.1234 -12.000000000 -> 1 + +-- extended zeros +ddctm640 comparetotmag 0 0 -> 0 +ddctm641 comparetotmag 0 -0 -> 0 +ddctm642 comparetotmag 0 -0.0 -> 1 +ddctm643 comparetotmag 0 0.0 -> 1 +ddctm644 comparetotmag -0 0 -> 0 +ddctm645 comparetotmag -0 -0 -> 0 +ddctm646 comparetotmag -0 -0.0 -> 1 +ddctm647 comparetotmag -0 0.0 -> 1 +ddctm648 comparetotmag 0.0 0 -> -1 +ddctm649 comparetotmag 0.0 -0 -> -1 +ddctm650 comparetotmag 0.0 -0.0 -> 0 +ddctm651 comparetotmag 0.0 0.0 -> 0 +ddctm652 comparetotmag -0.0 0 -> -1 +ddctm653 comparetotmag -0.0 -0 -> -1 +ddctm654 comparetotmag -0.0 -0.0 -> 0 +ddctm655 comparetotmag -0.0 0.0 -> 0 + +ddctm656 comparetotmag -0E1 0.0 -> 1 +ddctm657 comparetotmag -0E2 0.0 -> 1 +ddctm658 comparetotmag 0E1 0.0 -> 1 +ddctm659 comparetotmag 0E2 0.0 -> 1 +ddctm660 comparetotmag -0E1 0 -> 1 +ddctm661 comparetotmag -0E2 0 -> 1 +ddctm662 comparetotmag 0E1 0 -> 1 +ddctm663 comparetotmag 0E2 0 -> 1 +ddctm664 comparetotmag -0E1 -0E1 -> 0 +ddctm665 comparetotmag -0E2 -0E1 -> 1 +ddctm666 comparetotmag 0E1 -0E1 -> 0 +ddctm667 comparetotmag 0E2 -0E1 -> 1 +ddctm668 comparetotmag -0E1 -0E2 -> -1 +ddctm669 comparetotmag -0E2 -0E2 -> 0 +ddctm670 comparetotmag 0E1 -0E2 -> -1 +ddctm671 comparetotmag 0E2 -0E2 -> 0 +ddctm672 comparetotmag -0E1 0E1 -> 0 +ddctm673 comparetotmag -0E2 0E1 -> 1 +ddctm674 comparetotmag 0E1 0E1 -> 0 +ddctm675 comparetotmag 0E2 0E1 -> 1 +ddctm676 comparetotmag -0E1 0E2 -> -1 +ddctm677 comparetotmag -0E2 0E2 -> 0 +ddctm678 comparetotmag 0E1 0E2 -> -1 +ddctm679 comparetotmag 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +ddctm680 comparetotmag 12 12 -> 0 +ddctm681 comparetotmag 12 12.0 -> 1 +ddctm682 comparetotmag 12 12.00 -> 1 +ddctm683 comparetotmag 12 12.000 -> 1 +ddctm684 comparetotmag 12 12.0000 -> 1 +ddctm685 comparetotmag 12 12.00000 -> 1 +ddctm686 comparetotmag 12 12.000000 -> 1 +ddctm687 comparetotmag 12 12.0000000 -> 1 +ddctm688 comparetotmag 12 12.00000000 -> 1 +ddctm689 comparetotmag 12 12.000000000 -> 1 +ddctm690 comparetotmag 12 12 -> 0 +ddctm691 comparetotmag 12.0 12 -> -1 +ddctm692 comparetotmag 12.00 12 -> -1 +ddctm693 comparetotmag 12.000 12 -> -1 +ddctm694 comparetotmag 12.0000 12 -> -1 +ddctm695 comparetotmag 12.00000 12 -> -1 +ddctm696 comparetotmag 12.000000 12 -> -1 +ddctm697 comparetotmag 12.0000000 12 -> -1 +ddctm698 comparetotmag 12.00000000 12 -> -1 +ddctm699 comparetotmag 12.000000000 12 -> -1 + +-- old long operand checks +ddctm701 comparetotmag 12345678000 1 -> 1 +ddctm702 comparetotmag 1 12345678000 -> -1 +ddctm703 comparetotmag 1234567800 1 -> 1 +ddctm704 comparetotmag 1 1234567800 -> -1 +ddctm705 comparetotmag 1234567890 1 -> 1 +ddctm706 comparetotmag 1 1234567890 -> -1 +ddctm707 comparetotmag 1234567891 1 -> 1 +ddctm708 comparetotmag 1 1234567891 -> -1 +ddctm709 comparetotmag 12345678901 1 -> 1 +ddctm710 comparetotmag 1 12345678901 -> -1 +ddctm711 comparetotmag 1234567896 1 -> 1 +ddctm712 comparetotmag 1 1234567896 -> -1 +ddctm713 comparetotmag -1234567891 1 -> 1 +ddctm714 comparetotmag 1 -1234567891 -> -1 +ddctm715 comparetotmag -12345678901 1 -> 1 +ddctm716 comparetotmag 1 -12345678901 -> -1 +ddctm717 comparetotmag -1234567896 1 -> 1 +ddctm718 comparetotmag 1 -1234567896 -> -1 + +-- old residue cases +ddctm740 comparetotmag 1 0.9999999 -> 1 +ddctm741 comparetotmag 1 0.999999 -> 1 +ddctm742 comparetotmag 1 0.99999 -> 1 +ddctm743 comparetotmag 1 1.0000 -> 1 +ddctm744 comparetotmag 1 1.00001 -> -1 +ddctm745 comparetotmag 1 1.000001 -> -1 +ddctm746 comparetotmag 1 1.0000001 -> -1 +ddctm750 comparetotmag 0.9999999 1 -> -1 +ddctm751 comparetotmag 0.999999 1 -> -1 +ddctm752 comparetotmag 0.99999 1 -> -1 +ddctm753 comparetotmag 1.0000 1 -> -1 +ddctm754 comparetotmag 1.00001 1 -> 1 +ddctm755 comparetotmag 1.000001 1 -> 1 +ddctm756 comparetotmag 1.0000001 1 -> 1 + +-- Specials +ddctm780 comparetotmag Inf -Inf -> 0 +ddctm781 comparetotmag Inf -1000 -> 1 +ddctm782 comparetotmag Inf -1 -> 1 +ddctm783 comparetotmag Inf -0 -> 1 +ddctm784 comparetotmag Inf 0 -> 1 +ddctm785 comparetotmag Inf 1 -> 1 +ddctm786 comparetotmag Inf 1000 -> 1 +ddctm787 comparetotmag Inf Inf -> 0 +ddctm788 comparetotmag -1000 Inf -> -1 +ddctm789 comparetotmag -Inf Inf -> 0 +ddctm790 comparetotmag -1 Inf -> -1 +ddctm791 comparetotmag -0 Inf -> -1 +ddctm792 comparetotmag 0 Inf -> -1 +ddctm793 comparetotmag 1 Inf -> -1 +ddctm794 comparetotmag 1000 Inf -> -1 +ddctm795 comparetotmag Inf Inf -> 0 + +ddctm800 comparetotmag -Inf -Inf -> 0 +ddctm801 comparetotmag -Inf -1000 -> 1 +ddctm802 comparetotmag -Inf -1 -> 1 +ddctm803 comparetotmag -Inf -0 -> 1 +ddctm804 comparetotmag -Inf 0 -> 1 +ddctm805 comparetotmag -Inf 1 -> 1 +ddctm806 comparetotmag -Inf 1000 -> 1 +ddctm807 comparetotmag -Inf Inf -> 0 +ddctm808 comparetotmag -Inf -Inf -> 0 +ddctm809 comparetotmag -1000 -Inf -> -1 +ddctm810 comparetotmag -1 -Inf -> -1 +ddctm811 comparetotmag -0 -Inf -> -1 +ddctm812 comparetotmag 0 -Inf -> -1 +ddctm813 comparetotmag 1 -Inf -> -1 +ddctm814 comparetotmag 1000 -Inf -> -1 +ddctm815 comparetotmag Inf -Inf -> 0 + +ddctm821 comparetotmag NaN -Inf -> 1 +ddctm822 comparetotmag NaN -1000 -> 1 +ddctm823 comparetotmag NaN -1 -> 1 +ddctm824 comparetotmag NaN -0 -> 1 +ddctm825 comparetotmag NaN 0 -> 1 +ddctm826 comparetotmag NaN 1 -> 1 +ddctm827 comparetotmag NaN 1000 -> 1 +ddctm828 comparetotmag NaN Inf -> 1 +ddctm829 comparetotmag NaN NaN -> 0 +ddctm830 comparetotmag -Inf NaN -> -1 +ddctm831 comparetotmag -1000 NaN -> -1 +ddctm832 comparetotmag -1 NaN -> -1 +ddctm833 comparetotmag -0 NaN -> -1 +ddctm834 comparetotmag 0 NaN -> -1 +ddctm835 comparetotmag 1 NaN -> -1 +ddctm836 comparetotmag 1000 NaN -> -1 +ddctm837 comparetotmag Inf NaN -> -1 +ddctm838 comparetotmag -NaN -NaN -> 0 +ddctm839 comparetotmag +NaN -NaN -> 0 +ddctm840 comparetotmag -NaN +NaN -> 0 + +ddctm841 comparetotmag sNaN -sNaN -> 0 +ddctm842 comparetotmag sNaN -NaN -> -1 +ddctm843 comparetotmag sNaN -Inf -> 1 +ddctm844 comparetotmag sNaN -1000 -> 1 +ddctm845 comparetotmag sNaN -1 -> 1 +ddctm846 comparetotmag sNaN -0 -> 1 +ddctm847 comparetotmag sNaN 0 -> 1 +ddctm848 comparetotmag sNaN 1 -> 1 +ddctm849 comparetotmag sNaN 1000 -> 1 +ddctm850 comparetotmag sNaN NaN -> -1 +ddctm851 comparetotmag sNaN sNaN -> 0 + +ddctm852 comparetotmag -sNaN sNaN -> 0 +ddctm853 comparetotmag -NaN sNaN -> 1 +ddctm854 comparetotmag -Inf sNaN -> -1 +ddctm855 comparetotmag -1000 sNaN -> -1 +ddctm856 comparetotmag -1 sNaN -> -1 +ddctm857 comparetotmag -0 sNaN -> -1 +ddctm858 comparetotmag 0 sNaN -> -1 +ddctm859 comparetotmag 1 sNaN -> -1 +ddctm860 comparetotmag 1000 sNaN -> -1 +ddctm861 comparetotmag Inf sNaN -> -1 +ddctm862 comparetotmag NaN sNaN -> 1 +ddctm863 comparetotmag sNaN sNaN -> 0 + +ddctm871 comparetotmag -sNaN -sNaN -> 0 +ddctm872 comparetotmag -sNaN -NaN -> -1 +ddctm873 comparetotmag -sNaN -Inf -> 1 +ddctm874 comparetotmag -sNaN -1000 -> 1 +ddctm875 comparetotmag -sNaN -1 -> 1 +ddctm876 comparetotmag -sNaN -0 -> 1 +ddctm877 comparetotmag -sNaN 0 -> 1 +ddctm878 comparetotmag -sNaN 1 -> 1 +ddctm879 comparetotmag -sNaN 1000 -> 1 +ddctm880 comparetotmag -sNaN NaN -> -1 +ddctm881 comparetotmag -sNaN sNaN -> 0 + +ddctm882 comparetotmag -sNaN -sNaN -> 0 +ddctm883 comparetotmag -NaN -sNaN -> 1 +ddctm884 comparetotmag -Inf -sNaN -> -1 +ddctm885 comparetotmag -1000 -sNaN -> -1 +ddctm886 comparetotmag -1 -sNaN -> -1 +ddctm887 comparetotmag -0 -sNaN -> -1 +ddctm888 comparetotmag 0 -sNaN -> -1 +ddctm889 comparetotmag 1 -sNaN -> -1 +ddctm890 comparetotmag 1000 -sNaN -> -1 +ddctm891 comparetotmag Inf -sNaN -> -1 +ddctm892 comparetotmag NaN -sNaN -> 1 +ddctm893 comparetotmag sNaN -sNaN -> 0 + +-- NaNs with payload +ddctm960 comparetotmag NaN9 -Inf -> 1 +ddctm961 comparetotmag NaN8 999 -> 1 +ddctm962 comparetotmag NaN77 Inf -> 1 +ddctm963 comparetotmag -NaN67 NaN5 -> 1 +ddctm964 comparetotmag -Inf -NaN4 -> -1 +ddctm965 comparetotmag -999 -NaN33 -> -1 +ddctm966 comparetotmag Inf NaN2 -> -1 + +ddctm970 comparetotmag -NaN41 -NaN42 -> -1 +ddctm971 comparetotmag +NaN41 -NaN42 -> -1 +ddctm972 comparetotmag -NaN41 +NaN42 -> -1 +ddctm973 comparetotmag +NaN41 +NaN42 -> -1 +ddctm974 comparetotmag -NaN42 -NaN01 -> 1 +ddctm975 comparetotmag +NaN42 -NaN01 -> 1 +ddctm976 comparetotmag -NaN42 +NaN01 -> 1 +ddctm977 comparetotmag +NaN42 +NaN01 -> 1 + +ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1 +ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1 +ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1 +ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1 +ddctm984 comparetotmag -sNaN772 -sNaN771 -> 1 +ddctm985 comparetotmag +sNaN772 -sNaN771 -> 1 +ddctm986 comparetotmag -sNaN772 +sNaN771 -> 1 +ddctm987 comparetotmag +sNaN772 +sNaN771 -> 1 + +ddctm991 comparetotmag -sNaN99 -Inf -> 1 +ddctm992 comparetotmag sNaN98 -11 -> 1 +ddctm993 comparetotmag sNaN97 NaN -> -1 +ddctm994 comparetotmag sNaN16 sNaN94 -> -1 +ddctm995 comparetotmag NaN85 sNaN83 -> 1 +ddctm996 comparetotmag -Inf sNaN92 -> -1 +ddctm997 comparetotmag 088 sNaN81 -> -1 +ddctm998 comparetotmag Inf sNaN90 -> -1 +ddctm999 comparetotmag NaN -sNaN89 -> 1 + +-- spread zeros +ddctm1110 comparetotmag 0E-383 0 -> -1 +ddctm1111 comparetotmag 0E-383 -0 -> -1 +ddctm1112 comparetotmag -0E-383 0 -> -1 +ddctm1113 comparetotmag -0E-383 -0 -> -1 +ddctm1114 comparetotmag 0E-383 0E+384 -> -1 +ddctm1115 comparetotmag 0E-383 -0E+384 -> -1 +ddctm1116 comparetotmag -0E-383 0E+384 -> -1 +ddctm1117 comparetotmag -0E-383 -0E+384 -> -1 +ddctm1118 comparetotmag 0 0E+384 -> -1 +ddctm1119 comparetotmag 0 -0E+384 -> -1 +ddctm1120 comparetotmag -0 0E+384 -> -1 +ddctm1121 comparetotmag -0 -0E+384 -> -1 + +ddctm1130 comparetotmag 0E+384 0 -> 1 +ddctm1131 comparetotmag 0E+384 -0 -> 1 +ddctm1132 comparetotmag -0E+384 0 -> 1 +ddctm1133 comparetotmag -0E+384 -0 -> 1 +ddctm1134 comparetotmag 0E+384 0E-383 -> 1 +ddctm1135 comparetotmag 0E+384 -0E-383 -> 1 +ddctm1136 comparetotmag -0E+384 0E-383 -> 1 +ddctm1137 comparetotmag -0E+384 -0E-383 -> 1 +ddctm1138 comparetotmag 0 0E-383 -> 1 +ddctm1139 comparetotmag 0 -0E-383 -> 1 +ddctm1140 comparetotmag -0 0E-383 -> 1 +ddctm1141 comparetotmag -0 -0E-383 -> 1 + +-- Null tests +ddctm9990 comparetotmag 10 # -> NaN Invalid_operation +ddctm9991 comparetotmag # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopy.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopy.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- ddCopy.decTest -- quiet decDouble copy -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddcpy001 copy +7.50 -> 7.50 + +-- Infinities +ddcpy011 copy Infinity -> Infinity +ddcpy012 copy -Infinity -> -Infinity + +-- NaNs, 0 payload +ddcpy021 copy NaN -> NaN +ddcpy022 copy -NaN -> -NaN +ddcpy023 copy sNaN -> sNaN +ddcpy024 copy -sNaN -> -sNaN + +-- NaNs, non-0 payload +ddcpy031 copy NaN10 -> NaN10 +ddcpy032 copy -NaN10 -> -NaN10 +ddcpy033 copy sNaN10 -> sNaN10 +ddcpy034 copy -sNaN10 -> -sNaN10 +ddcpy035 copy NaN7 -> NaN7 +ddcpy036 copy -NaN7 -> -NaN7 +ddcpy037 copy sNaN101 -> sNaN101 +ddcpy038 copy -sNaN101 -> -sNaN101 + +-- finites +ddcpy101 copy 7 -> 7 +ddcpy102 copy -7 -> -7 +ddcpy103 copy 75 -> 75 +ddcpy104 copy -75 -> -75 +ddcpy105 copy 7.50 -> 7.50 +ddcpy106 copy -7.50 -> -7.50 +ddcpy107 copy 7.500 -> 7.500 +ddcpy108 copy -7.500 -> -7.500 + +-- zeros +ddcpy111 copy 0 -> 0 +ddcpy112 copy -0 -> -0 +ddcpy113 copy 0E+4 -> 0E+4 +ddcpy114 copy -0E+4 -> -0E+4 +ddcpy115 copy 0.0000 -> 0.0000 +ddcpy116 copy -0.0000 -> -0.0000 +ddcpy117 copy 0E-141 -> 0E-141 +ddcpy118 copy -0E-141 -> -0E-141 + +-- full coefficients, alternating bits +ddcpy121 copy 2682682682682682 -> 2682682682682682 +ddcpy122 copy -2682682682682682 -> -2682682682682682 +ddcpy123 copy 1341341341341341 -> 1341341341341341 +ddcpy124 copy -1341341341341341 -> -1341341341341341 + +-- Nmax, Nmin, Ntiny +ddcpy131 copy 9.999999999999999E+384 -> 9.999999999999999E+384 +ddcpy132 copy 1E-383 -> 1E-383 +ddcpy133 copy 1.000000000000000E-383 -> 1.000000000000000E-383 +ddcpy134 copy 1E-398 -> 1E-398 + +ddcpy135 copy -1E-398 -> -1E-398 +ddcpy136 copy -1.000000000000000E-383 -> -1.000000000000000E-383 +ddcpy137 copy -1E-383 -> -1E-383 +ddcpy138 copy -9.999999999999999E+384 -> -9.999999999999999E+384 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopyAbs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopyAbs.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddcpa001 copyabs +7.50 -> 7.50 + +-- Infinities +ddcpa011 copyabs Infinity -> Infinity +ddcpa012 copyabs -Infinity -> Infinity + +-- NaNs, 0 payload +ddcpa021 copyabs NaN -> NaN +ddcpa022 copyabs -NaN -> NaN +ddcpa023 copyabs sNaN -> sNaN +ddcpa024 copyabs -sNaN -> sNaN + +-- NaNs, non-0 payload +ddcpa031 copyabs NaN10 -> NaN10 +ddcpa032 copyabs -NaN15 -> NaN15 +ddcpa033 copyabs sNaN15 -> sNaN15 +ddcpa034 copyabs -sNaN10 -> sNaN10 +ddcpa035 copyabs NaN7 -> NaN7 +ddcpa036 copyabs -NaN7 -> NaN7 +ddcpa037 copyabs sNaN101 -> sNaN101 +ddcpa038 copyabs -sNaN101 -> sNaN101 + +-- finites +ddcpa101 copyabs 7 -> 7 +ddcpa102 copyabs -7 -> 7 +ddcpa103 copyabs 75 -> 75 +ddcpa104 copyabs -75 -> 75 +ddcpa105 copyabs 7.10 -> 7.10 +ddcpa106 copyabs -7.10 -> 7.10 +ddcpa107 copyabs 7.500 -> 7.500 +ddcpa108 copyabs -7.500 -> 7.500 + +-- zeros +ddcpa111 copyabs 0 -> 0 +ddcpa112 copyabs -0 -> 0 +ddcpa113 copyabs 0E+6 -> 0E+6 +ddcpa114 copyabs -0E+6 -> 0E+6 +ddcpa115 copyabs 0.0000 -> 0.0000 +ddcpa116 copyabs -0.0000 -> 0.0000 +ddcpa117 copyabs 0E-141 -> 0E-141 +ddcpa118 copyabs -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +ddcpa121 copyabs 2682682682682682 -> 2682682682682682 +ddcpa122 copyabs -2682682682682682 -> 2682682682682682 +ddcpa123 copyabs 1341341341341341 -> 1341341341341341 +ddcpa124 copyabs -1341341341341341 -> 1341341341341341 + +-- Nmax, Nmin, Ntiny +ddcpa131 copyabs 9.999999999999999E+384 -> 9.999999999999999E+384 +ddcpa132 copyabs 1E-383 -> 1E-383 +ddcpa133 copyabs 1.000000000000000E-383 -> 1.000000000000000E-383 +ddcpa134 copyabs 1E-398 -> 1E-398 + +ddcpa135 copyabs -1E-398 -> 1E-398 +ddcpa136 copyabs -1.000000000000000E-383 -> 1.000000000000000E-383 +ddcpa137 copyabs -1E-383 -> 1E-383 +ddcpa138 copyabs -9.999999999999999E+384 -> 9.999999999999999E+384 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopyNegate.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopyNegate.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- ddCopyNegate.decTest -- quiet decDouble copy and negate -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddcpn001 copynegate +7.50 -> -7.50 + +-- Infinities +ddcpn011 copynegate Infinity -> -Infinity +ddcpn012 copynegate -Infinity -> Infinity + +-- NaNs, 0 payload +ddcpn021 copynegate NaN -> -NaN +ddcpn022 copynegate -NaN -> NaN +ddcpn023 copynegate sNaN -> -sNaN +ddcpn024 copynegate -sNaN -> sNaN + +-- NaNs, non-0 payload +ddcpn031 copynegate NaN13 -> -NaN13 +ddcpn032 copynegate -NaN13 -> NaN13 +ddcpn033 copynegate sNaN13 -> -sNaN13 +ddcpn034 copynegate -sNaN13 -> sNaN13 +ddcpn035 copynegate NaN70 -> -NaN70 +ddcpn036 copynegate -NaN70 -> NaN70 +ddcpn037 copynegate sNaN101 -> -sNaN101 +ddcpn038 copynegate -sNaN101 -> sNaN101 + +-- finites +ddcpn101 copynegate 7 -> -7 +ddcpn102 copynegate -7 -> 7 +ddcpn103 copynegate 75 -> -75 +ddcpn104 copynegate -75 -> 75 +ddcpn105 copynegate 7.50 -> -7.50 +ddcpn106 copynegate -7.50 -> 7.50 +ddcpn107 copynegate 7.500 -> -7.500 +ddcpn108 copynegate -7.500 -> 7.500 + +-- zeros +ddcpn111 copynegate 0 -> -0 +ddcpn112 copynegate -0 -> 0 +ddcpn113 copynegate 0E+4 -> -0E+4 +ddcpn114 copynegate -0E+4 -> 0E+4 +ddcpn115 copynegate 0.0000 -> -0.0000 +ddcpn116 copynegate -0.0000 -> 0.0000 +ddcpn117 copynegate 0E-141 -> -0E-141 +ddcpn118 copynegate -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +ddcpn121 copynegate 2682682682682682 -> -2682682682682682 +ddcpn122 copynegate -2682682682682682 -> 2682682682682682 +ddcpn123 copynegate 1341341341341341 -> -1341341341341341 +ddcpn124 copynegate -1341341341341341 -> 1341341341341341 + +-- Nmax, Nmin, Ntiny +ddcpn131 copynegate 9.999999999999999E+384 -> -9.999999999999999E+384 +ddcpn132 copynegate 1E-383 -> -1E-383 +ddcpn133 copynegate 1.000000000000000E-383 -> -1.000000000000000E-383 +ddcpn134 copynegate 1E-398 -> -1E-398 + +ddcpn135 copynegate -1E-398 -> 1E-398 +ddcpn136 copynegate -1.000000000000000E-383 -> 1.000000000000000E-383 +ddcpn137 copynegate -1E-383 -> 1E-383 +ddcpn138 copynegate -9.999999999999999E+384 -> 9.999999999999999E+384 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopySign.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddCopySign.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,175 @@ +------------------------------------------------------------------------ +-- ddCopySign.decTest -- quiet decDouble copy with sign from rhs -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddcps001 copysign +7.50 11 -> 7.50 + +-- Infinities +ddcps011 copysign Infinity 11 -> Infinity +ddcps012 copysign -Infinity 11 -> Infinity + +-- NaNs, 0 payload +ddcps021 copysign NaN 11 -> NaN +ddcps022 copysign -NaN 11 -> NaN +ddcps023 copysign sNaN 11 -> sNaN +ddcps024 copysign -sNaN 11 -> sNaN + +-- NaNs, non-0 payload +ddcps031 copysign NaN10 11 -> NaN10 +ddcps032 copysign -NaN10 11 -> NaN10 +ddcps033 copysign sNaN10 11 -> sNaN10 +ddcps034 copysign -sNaN10 11 -> sNaN10 +ddcps035 copysign NaN7 11 -> NaN7 +ddcps036 copysign -NaN7 11 -> NaN7 +ddcps037 copysign sNaN101 11 -> sNaN101 +ddcps038 copysign -sNaN101 11 -> sNaN101 + +-- finites +ddcps101 copysign 7 11 -> 7 +ddcps102 copysign -7 11 -> 7 +ddcps103 copysign 75 11 -> 75 +ddcps104 copysign -75 11 -> 75 +ddcps105 copysign 7.50 11 -> 7.50 +ddcps106 copysign -7.50 11 -> 7.50 +ddcps107 copysign 7.500 11 -> 7.500 +ddcps108 copysign -7.500 11 -> 7.500 + +-- zeros +ddcps111 copysign 0 11 -> 0 +ddcps112 copysign -0 11 -> 0 +ddcps113 copysign 0E+4 11 -> 0E+4 +ddcps114 copysign -0E+4 11 -> 0E+4 +ddcps115 copysign 0.0000 11 -> 0.0000 +ddcps116 copysign -0.0000 11 -> 0.0000 +ddcps117 copysign 0E-141 11 -> 0E-141 +ddcps118 copysign -0E-141 11 -> 0E-141 + +-- full coefficients, alternating bits +ddcps121 copysign 2682682682682682 11 -> 2682682682682682 +ddcps122 copysign -2682682682682682 11 -> 2682682682682682 +ddcps123 copysign 1341341341341341 11 -> 1341341341341341 +ddcps124 copysign -1341341341341341 11 -> 1341341341341341 + +-- Nmax, Nmin, Ntiny +ddcps131 copysign 9.999999999999999E+384 11 -> 9.999999999999999E+384 +ddcps132 copysign 1E-383 11 -> 1E-383 +ddcps133 copysign 1.000000000000000E-383 11 -> 1.000000000000000E-383 +ddcps134 copysign 1E-398 11 -> 1E-398 + +ddcps135 copysign -1E-398 11 -> 1E-398 +ddcps136 copysign -1.000000000000000E-383 11 -> 1.000000000000000E-383 +ddcps137 copysign -1E-383 11 -> 1E-383 +ddcps138 copysign -9.999999999999999E+384 11 -> 9.999999999999999E+384 + +-- repeat with negative RHS + +-- Infinities +ddcps211 copysign Infinity -34 -> -Infinity +ddcps212 copysign -Infinity -34 -> -Infinity + +-- NaNs, 0 payload +ddcps221 copysign NaN -34 -> -NaN +ddcps222 copysign -NaN -34 -> -NaN +ddcps223 copysign sNaN -34 -> -sNaN +ddcps224 copysign -sNaN -34 -> -sNaN + +-- NaNs, non-0 payload +ddcps231 copysign NaN10 -34 -> -NaN10 +ddcps232 copysign -NaN10 -34 -> -NaN10 +ddcps233 copysign sNaN10 -34 -> -sNaN10 +ddcps234 copysign -sNaN10 -34 -> -sNaN10 +ddcps235 copysign NaN7 -34 -> -NaN7 +ddcps236 copysign -NaN7 -34 -> -NaN7 +ddcps237 copysign sNaN101 -34 -> -sNaN101 +ddcps238 copysign -sNaN101 -34 -> -sNaN101 + +-- finites +ddcps301 copysign 7 -34 -> -7 +ddcps302 copysign -7 -34 -> -7 +ddcps303 copysign 75 -34 -> -75 +ddcps304 copysign -75 -34 -> -75 +ddcps305 copysign 7.50 -34 -> -7.50 +ddcps306 copysign -7.50 -34 -> -7.50 +ddcps307 copysign 7.500 -34 -> -7.500 +ddcps308 copysign -7.500 -34 -> -7.500 + +-- zeros +ddcps311 copysign 0 -34 -> -0 +ddcps312 copysign -0 -34 -> -0 +ddcps313 copysign 0E+4 -34 -> -0E+4 +ddcps314 copysign -0E+4 -34 -> -0E+4 +ddcps315 copysign 0.0000 -34 -> -0.0000 +ddcps316 copysign -0.0000 -34 -> -0.0000 +ddcps317 copysign 0E-141 -34 -> -0E-141 +ddcps318 copysign -0E-141 -34 -> -0E-141 + +-- full coefficients, alternating bits +ddcps321 copysign 2682682682682682 -34 -> -2682682682682682 +ddcps322 copysign -2682682682682682 -34 -> -2682682682682682 +ddcps323 copysign 1341341341341341 -34 -> -1341341341341341 +ddcps324 copysign -1341341341341341 -34 -> -1341341341341341 + +-- Nmax, Nmin, Ntiny +ddcps331 copysign 9.999999999999999E+384 -34 -> -9.999999999999999E+384 +ddcps332 copysign 1E-383 -34 -> -1E-383 +ddcps333 copysign 1.000000000000000E-383 -34 -> -1.000000000000000E-383 +ddcps334 copysign 1E-398 -34 -> -1E-398 + +ddcps335 copysign -1E-398 -34 -> -1E-398 +ddcps336 copysign -1.000000000000000E-383 -34 -> -1.000000000000000E-383 +ddcps337 copysign -1E-383 -34 -> -1E-383 +ddcps338 copysign -9.999999999999999E+384 -34 -> -9.999999999999999E+384 + +-- Other kinds of RHS +ddcps401 copysign 701 -34 -> -701 +ddcps402 copysign -720 -34 -> -720 +ddcps403 copysign 701 -0 -> -701 +ddcps404 copysign -720 -0 -> -720 +ddcps405 copysign 701 +0 -> 701 +ddcps406 copysign -720 +0 -> 720 +ddcps407 copysign 701 +34 -> 701 +ddcps408 copysign -720 +34 -> 720 + +ddcps413 copysign 701 -Inf -> -701 +ddcps414 copysign -720 -Inf -> -720 +ddcps415 copysign 701 +Inf -> 701 +ddcps416 copysign -720 +Inf -> 720 + +ddcps420 copysign 701 -NaN -> -701 +ddcps421 copysign -720 -NaN -> -720 +ddcps422 copysign 701 +NaN -> 701 +ddcps423 copysign -720 +NaN -> 720 +ddcps425 copysign -720 +NaN8 -> 720 + +ddcps426 copysign 701 -sNaN -> -701 +ddcps427 copysign -720 -sNaN -> -720 +ddcps428 copysign 701 +sNaN -> 701 +ddcps429 copysign -720 +sNaN -> 720 +ddcps430 copysign -720 +sNaN3 -> 720 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddDivide.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddDivide.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,854 @@ +------------------------------------------------------------------------ +-- ddDivide.decTest -- decDouble division -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +dddiv001 divide 1 1 -> 1 +dddiv002 divide 2 1 -> 2 +dddiv003 divide 1 2 -> 0.5 +dddiv004 divide 2 2 -> 1 +dddiv005 divide 0 1 -> 0 +dddiv006 divide 0 2 -> 0 +dddiv007 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv008 divide 2 3 -> 0.6666666666666667 Inexact Rounded +dddiv009 divide 3 3 -> 1 + +dddiv010 divide 2.4 1 -> 2.4 +dddiv011 divide 2.4 -1 -> -2.4 +dddiv012 divide -2.4 1 -> -2.4 +dddiv013 divide -2.4 -1 -> 2.4 +dddiv014 divide 2.40 1 -> 2.40 +dddiv015 divide 2.400 1 -> 2.400 +dddiv016 divide 2.4 2 -> 1.2 +dddiv017 divide 2.400 2 -> 1.200 +dddiv018 divide 2. 2 -> 1 +dddiv019 divide 20 20 -> 1 + +dddiv020 divide 187 187 -> 1 +dddiv021 divide 5 2 -> 2.5 +dddiv022 divide 50 20 -> 2.5 +dddiv023 divide 500 200 -> 2.5 +dddiv024 divide 50.0 20.0 -> 2.5 +dddiv025 divide 5.00 2.00 -> 2.5 +dddiv026 divide 5 2.0 -> 2.5 +dddiv027 divide 5 2.000 -> 2.5 +dddiv028 divide 5 0.20 -> 25 +dddiv029 divide 5 0.200 -> 25 +dddiv030 divide 10 1 -> 10 +dddiv031 divide 100 1 -> 100 +dddiv032 divide 1000 1 -> 1000 +dddiv033 divide 1000 100 -> 10 + +dddiv035 divide 1 2 -> 0.5 +dddiv036 divide 1 4 -> 0.25 +dddiv037 divide 1 8 -> 0.125 +dddiv038 divide 1 16 -> 0.0625 +dddiv039 divide 1 32 -> 0.03125 +dddiv040 divide 1 64 -> 0.015625 +dddiv041 divide 1 -2 -> -0.5 +dddiv042 divide 1 -4 -> -0.25 +dddiv043 divide 1 -8 -> -0.125 +dddiv044 divide 1 -16 -> -0.0625 +dddiv045 divide 1 -32 -> -0.03125 +dddiv046 divide 1 -64 -> -0.015625 +dddiv047 divide -1 2 -> -0.5 +dddiv048 divide -1 4 -> -0.25 +dddiv049 divide -1 8 -> -0.125 +dddiv050 divide -1 16 -> -0.0625 +dddiv051 divide -1 32 -> -0.03125 +dddiv052 divide -1 64 -> -0.015625 +dddiv053 divide -1 -2 -> 0.5 +dddiv054 divide -1 -4 -> 0.25 +dddiv055 divide -1 -8 -> 0.125 +dddiv056 divide -1 -16 -> 0.0625 +dddiv057 divide -1 -32 -> 0.03125 +dddiv058 divide -1 -64 -> 0.015625 + +-- bcdTime +dddiv060 divide 1 7 -> 0.1428571428571429 Inexact Rounded +dddiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717 Inexact Rounded + +-- 1234567890123456 +dddiv071 divide 9999999999999999 1 -> 9999999999999999 +dddiv072 divide 999999999999999 1 -> 999999999999999 +dddiv073 divide 99999999999999 1 -> 99999999999999 +dddiv074 divide 9999999999999 1 -> 9999999999999 +dddiv075 divide 999999999999 1 -> 999999999999 +dddiv076 divide 99999999999 1 -> 99999999999 +dddiv077 divide 9999999999 1 -> 9999999999 +dddiv078 divide 999999999 1 -> 999999999 +dddiv079 divide 99999999 1 -> 99999999 +dddiv080 divide 9999999 1 -> 9999999 +dddiv081 divide 999999 1 -> 999999 +dddiv082 divide 99999 1 -> 99999 +dddiv083 divide 9999 1 -> 9999 +dddiv084 divide 999 1 -> 999 +dddiv085 divide 99 1 -> 99 +dddiv086 divide 9 1 -> 9 + +dddiv090 divide 0. 1 -> 0 +dddiv091 divide .0 1 -> 0.0 +dddiv092 divide 0.00 1 -> 0.00 +dddiv093 divide 0.00E+9 1 -> 0E+7 +dddiv094 divide 0.0000E-50 1 -> 0E-54 + +dddiv095 divide 1 1E-8 -> 1E+8 +dddiv096 divide 1 1E-9 -> 1E+9 +dddiv097 divide 1 1E-10 -> 1E+10 +dddiv098 divide 1 1E-11 -> 1E+11 +dddiv099 divide 1 1E-12 -> 1E+12 + +dddiv100 divide 1 1 -> 1 +dddiv101 divide 1 2 -> 0.5 +dddiv102 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv103 divide 1 4 -> 0.25 +dddiv104 divide 1 5 -> 0.2 +dddiv105 divide 1 6 -> 0.1666666666666667 Inexact Rounded +dddiv106 divide 1 7 -> 0.1428571428571429 Inexact Rounded +dddiv107 divide 1 8 -> 0.125 +dddiv108 divide 1 9 -> 0.1111111111111111 Inexact Rounded +dddiv109 divide 1 10 -> 0.1 +dddiv110 divide 1 1 -> 1 +dddiv111 divide 2 1 -> 2 +dddiv112 divide 3 1 -> 3 +dddiv113 divide 4 1 -> 4 +dddiv114 divide 5 1 -> 5 +dddiv115 divide 6 1 -> 6 +dddiv116 divide 7 1 -> 7 +dddiv117 divide 8 1 -> 8 +dddiv118 divide 9 1 -> 9 +dddiv119 divide 10 1 -> 10 + +dddiv120 divide 3E+1 0.001 -> 3E+4 +dddiv121 divide 2.200 2 -> 1.100 + +dddiv130 divide 12345 4.999 -> 2469.493898779756 Inexact Rounded +dddiv131 divide 12345 4.99 -> 2473.947895791583 Inexact Rounded +dddiv132 divide 12345 4.9 -> 2519.387755102041 Inexact Rounded +dddiv133 divide 12345 5 -> 2469 +dddiv134 divide 12345 5.1 -> 2420.588235294118 Inexact Rounded +dddiv135 divide 12345 5.01 -> 2464.071856287425 Inexact Rounded +dddiv136 divide 12345 5.001 -> 2468.506298740252 Inexact Rounded + +-- test possibly imprecise results +dddiv220 divide 391 597 -> 0.6549413735343384 Inexact Rounded +dddiv221 divide 391 -597 -> -0.6549413735343384 Inexact Rounded +dddiv222 divide -391 597 -> -0.6549413735343384 Inexact Rounded +dddiv223 divide -391 -597 -> 0.6549413735343384 Inexact Rounded + +-- test some cases that are close to exponent overflow +dddiv270 divide 1 1e384 -> 1E-384 Subnormal +dddiv271 divide 1 0.9e384 -> 1.11111111111111E-384 Rounded Inexact Subnormal Underflow +dddiv272 divide 1 0.99e384 -> 1.01010101010101E-384 Rounded Inexact Subnormal Underflow +dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384 Rounded Inexact Subnormal Underflow +dddiv274 divide 9e384 1 -> 9.000000000000000E+384 Clamped +dddiv275 divide 9.9e384 1 -> 9.900000000000000E+384 Clamped +dddiv276 divide 9.99e384 1 -> 9.990000000000000E+384 Clamped +dddiv277 divide 9.999999999999999e384 1 -> 9.999999999999999E+384 + +-- Divide into 0 tests +dddiv301 divide 0 7 -> 0 +dddiv302 divide 0 7E-5 -> 0E+5 +dddiv303 divide 0 7E-1 -> 0E+1 +dddiv304 divide 0 7E+1 -> 0.0 +dddiv305 divide 0 7E+5 -> 0.00000 +dddiv306 divide 0 7E+6 -> 0.000000 +dddiv307 divide 0 7E+7 -> 0E-7 +dddiv308 divide 0 70E-5 -> 0E+5 +dddiv309 divide 0 70E-1 -> 0E+1 +dddiv310 divide 0 70E+0 -> 0 +dddiv311 divide 0 70E+1 -> 0.0 +dddiv312 divide 0 70E+5 -> 0.00000 +dddiv313 divide 0 70E+6 -> 0.000000 +dddiv314 divide 0 70E+7 -> 0E-7 +dddiv315 divide 0 700E-5 -> 0E+5 +dddiv316 divide 0 700E-1 -> 0E+1 +dddiv317 divide 0 700E+0 -> 0 +dddiv318 divide 0 700E+1 -> 0.0 +dddiv319 divide 0 700E+5 -> 0.00000 +dddiv320 divide 0 700E+6 -> 0.000000 +dddiv321 divide 0 700E+7 -> 0E-7 +dddiv322 divide 0 700E+77 -> 0E-77 + +dddiv331 divide 0E-3 7E-5 -> 0E+2 +dddiv332 divide 0E-3 7E-1 -> 0.00 +dddiv333 divide 0E-3 7E+1 -> 0.0000 +dddiv334 divide 0E-3 7E+5 -> 0E-8 +dddiv335 divide 0E-1 7E-5 -> 0E+4 +dddiv336 divide 0E-1 7E-1 -> 0 +dddiv337 divide 0E-1 7E+1 -> 0.00 +dddiv338 divide 0E-1 7E+5 -> 0.000000 +dddiv339 divide 0E+1 7E-5 -> 0E+6 +dddiv340 divide 0E+1 7E-1 -> 0E+2 +dddiv341 divide 0E+1 7E+1 -> 0 +dddiv342 divide 0E+1 7E+5 -> 0.0000 +dddiv343 divide 0E+3 7E-5 -> 0E+8 +dddiv344 divide 0E+3 7E-1 -> 0E+4 +dddiv345 divide 0E+3 7E+1 -> 0E+2 +dddiv346 divide 0E+3 7E+5 -> 0.00 + +-- These were 'input rounding' +dddiv441 divide 12345678000 1 -> 12345678000 +dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded +dddiv443 divide 1234567800 1 -> 1234567800 +dddiv444 divide 1 1234567800 -> 8.100000664200054E-10 Inexact Rounded +dddiv445 divide 1234567890 1 -> 1234567890 +dddiv446 divide 1 1234567890 -> 8.100000073710001E-10 Inexact Rounded +dddiv447 divide 1234567891 1 -> 1234567891 +dddiv448 divide 1 1234567891 -> 8.100000067149001E-10 Inexact Rounded +dddiv449 divide 12345678901 1 -> 12345678901 +dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded +dddiv451 divide 1234567896 1 -> 1234567896 +dddiv452 divide 1 1234567896 -> 8.100000034344000E-10 Inexact Rounded + +-- high-lows +dddiv453 divide 1e+1 1 -> 1E+1 +dddiv454 divide 1e+1 1.0 -> 1E+1 +dddiv455 divide 1e+1 1.00 -> 1E+1 +dddiv456 divide 1e+2 2 -> 5E+1 +dddiv457 divide 1e+2 2.0 -> 5E+1 +dddiv458 divide 1e+2 2.00 -> 5E+1 + +-- some from IEEE discussions +dddiv460 divide 3e0 2e0 -> 1.5 +dddiv461 divide 30e-1 2e0 -> 1.5 +dddiv462 divide 300e-2 2e0 -> 1.50 +dddiv464 divide 3000e-3 2e0 -> 1.500 +dddiv465 divide 3e0 20e-1 -> 1.5 +dddiv466 divide 30e-1 20e-1 -> 1.5 +dddiv467 divide 300e-2 20e-1 -> 1.5 +dddiv468 divide 3000e-3 20e-1 -> 1.50 +dddiv469 divide 3e0 200e-2 -> 1.5 +dddiv470 divide 30e-1 200e-2 -> 1.5 +dddiv471 divide 300e-2 200e-2 -> 1.5 +dddiv472 divide 3000e-3 200e-2 -> 1.5 +dddiv473 divide 3e0 2000e-3 -> 1.5 +dddiv474 divide 30e-1 2000e-3 -> 1.5 +dddiv475 divide 300e-2 2000e-3 -> 1.5 +dddiv476 divide 3000e-3 2000e-3 -> 1.5 + +-- some reciprocals +dddiv480 divide 1 1.0E+33 -> 1E-33 +dddiv481 divide 1 10E+33 -> 1E-34 +dddiv482 divide 1 1.0E-33 -> 1E+33 +dddiv483 divide 1 10E-33 -> 1E+32 + +-- RMS discussion table +dddiv484 divide 0e5 1e3 -> 0E+2 +dddiv485 divide 0e5 2e3 -> 0E+2 +dddiv486 divide 0e5 10e2 -> 0E+3 +dddiv487 divide 0e5 20e2 -> 0E+3 +dddiv488 divide 0e5 100e1 -> 0E+4 +dddiv489 divide 0e5 200e1 -> 0E+4 + +dddiv491 divide 1e5 1e3 -> 1E+2 +dddiv492 divide 1e5 2e3 -> 5E+1 +dddiv493 divide 1e5 10e2 -> 1E+2 +dddiv494 divide 1e5 20e2 -> 5E+1 +dddiv495 divide 1e5 100e1 -> 1E+2 +dddiv496 divide 1e5 200e1 -> 5E+1 + +-- tryzeros cases +rounding: half_up +dddiv497 divide 0E+380 1000E-13 -> 0E+369 Clamped +dddiv498 divide 0E-390 1000E+13 -> 0E-398 Clamped + +rounding: half_up + +-- focus on trailing zeros issues +dddiv500 divide 1 9.9 -> 0.1010101010101010 Inexact Rounded +dddiv501 divide 1 9.09 -> 0.1100110011001100 Inexact Rounded +dddiv502 divide 1 9.009 -> 0.1110001110001110 Inexact Rounded + +dddiv511 divide 1 2 -> 0.5 +dddiv512 divide 1.0 2 -> 0.5 +dddiv513 divide 1.00 2 -> 0.50 +dddiv514 divide 1.000 2 -> 0.500 +dddiv515 divide 1.0000 2 -> 0.5000 +dddiv516 divide 1.00000 2 -> 0.50000 +dddiv517 divide 1.000000 2 -> 0.500000 +dddiv518 divide 1.0000000 2 -> 0.5000000 +dddiv519 divide 1.00 2.00 -> 0.5 + +dddiv521 divide 2 1 -> 2 +dddiv522 divide 2 1.0 -> 2 +dddiv523 divide 2 1.00 -> 2 +dddiv524 divide 2 1.000 -> 2 +dddiv525 divide 2 1.0000 -> 2 +dddiv526 divide 2 1.00000 -> 2 +dddiv527 divide 2 1.000000 -> 2 +dddiv528 divide 2 1.0000000 -> 2 +dddiv529 divide 2.00 1.00 -> 2 + +dddiv530 divide 2.40 2 -> 1.20 +dddiv531 divide 2.40 4 -> 0.60 +dddiv532 divide 2.40 10 -> 0.24 +dddiv533 divide 2.40 2.0 -> 1.2 +dddiv534 divide 2.40 4.0 -> 0.6 +dddiv535 divide 2.40 10.0 -> 0.24 +dddiv536 divide 2.40 2.00 -> 1.2 +dddiv537 divide 2.40 4.00 -> 0.6 +dddiv538 divide 2.40 10.00 -> 0.24 +dddiv539 divide 0.9 0.1 -> 9 +dddiv540 divide 0.9 0.01 -> 9E+1 +dddiv541 divide 0.9 0.001 -> 9E+2 +dddiv542 divide 5 2 -> 2.5 +dddiv543 divide 5 2.0 -> 2.5 +dddiv544 divide 5 2.00 -> 2.5 +dddiv545 divide 5 20 -> 0.25 +dddiv546 divide 5 20.0 -> 0.25 +dddiv547 divide 2.400 2 -> 1.200 +dddiv548 divide 2.400 2.0 -> 1.20 +dddiv549 divide 2.400 2.400 -> 1 + +dddiv550 divide 240 1 -> 240 +dddiv551 divide 240 10 -> 24 +dddiv552 divide 240 100 -> 2.4 +dddiv553 divide 240 1000 -> 0.24 +dddiv554 divide 2400 1 -> 2400 +dddiv555 divide 2400 10 -> 240 +dddiv556 divide 2400 100 -> 24 +dddiv557 divide 2400 1000 -> 2.4 + +-- +ve exponent +dddiv600 divide 2.4E+9 2 -> 1.2E+9 +dddiv601 divide 2.40E+9 2 -> 1.20E+9 +dddiv602 divide 2.400E+9 2 -> 1.200E+9 +dddiv603 divide 2.4000E+9 2 -> 1.2000E+9 +dddiv604 divide 24E+8 2 -> 1.2E+9 +dddiv605 divide 240E+7 2 -> 1.20E+9 +dddiv606 divide 2400E+6 2 -> 1.200E+9 +dddiv607 divide 24000E+5 2 -> 1.2000E+9 + +-- more zeros, etc. +dddiv731 divide 5.00 1E-3 -> 5.00E+3 +dddiv732 divide 00.00 0.000 -> NaN Division_undefined +dddiv733 divide 00.00 0E-3 -> NaN Division_undefined +dddiv734 divide 0 -0 -> NaN Division_undefined +dddiv735 divide -0 0 -> NaN Division_undefined +dddiv736 divide -0 -0 -> NaN Division_undefined + +dddiv741 divide 0 -1 -> -0 +dddiv742 divide -0 -1 -> 0 +dddiv743 divide 0 1 -> 0 +dddiv744 divide -0 1 -> -0 +dddiv745 divide -1 0 -> -Infinity Division_by_zero +dddiv746 divide -1 -0 -> Infinity Division_by_zero +dddiv747 divide 1 0 -> Infinity Division_by_zero +dddiv748 divide 1 -0 -> -Infinity Division_by_zero + +dddiv751 divide 0.0 -1 -> -0.0 +dddiv752 divide -0.0 -1 -> 0.0 +dddiv753 divide 0.0 1 -> 0.0 +dddiv754 divide -0.0 1 -> -0.0 +dddiv755 divide -1.0 0 -> -Infinity Division_by_zero +dddiv756 divide -1.0 -0 -> Infinity Division_by_zero +dddiv757 divide 1.0 0 -> Infinity Division_by_zero +dddiv758 divide 1.0 -0 -> -Infinity Division_by_zero + +dddiv761 divide 0 -1.0 -> -0E+1 +dddiv762 divide -0 -1.0 -> 0E+1 +dddiv763 divide 0 1.0 -> 0E+1 +dddiv764 divide -0 1.0 -> -0E+1 +dddiv765 divide -1 0.0 -> -Infinity Division_by_zero +dddiv766 divide -1 -0.0 -> Infinity Division_by_zero +dddiv767 divide 1 0.0 -> Infinity Division_by_zero +dddiv768 divide 1 -0.0 -> -Infinity Division_by_zero + +dddiv771 divide 0.0 -1.0 -> -0 +dddiv772 divide -0.0 -1.0 -> 0 +dddiv773 divide 0.0 1.0 -> 0 +dddiv774 divide -0.0 1.0 -> -0 +dddiv775 divide -1.0 0.0 -> -Infinity Division_by_zero +dddiv776 divide -1.0 -0.0 -> Infinity Division_by_zero +dddiv777 divide 1.0 0.0 -> Infinity Division_by_zero +dddiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +dddiv780 divide Inf -Inf -> NaN Invalid_operation +dddiv781 divide Inf -1000 -> -Infinity +dddiv782 divide Inf -1 -> -Infinity +dddiv783 divide Inf -0 -> -Infinity +dddiv784 divide Inf 0 -> Infinity +dddiv785 divide Inf 1 -> Infinity +dddiv786 divide Inf 1000 -> Infinity +dddiv787 divide Inf Inf -> NaN Invalid_operation +dddiv788 divide -1000 Inf -> -0E-398 Clamped +dddiv789 divide -Inf Inf -> NaN Invalid_operation +dddiv790 divide -1 Inf -> -0E-398 Clamped +dddiv791 divide -0 Inf -> -0E-398 Clamped +dddiv792 divide 0 Inf -> 0E-398 Clamped +dddiv793 divide 1 Inf -> 0E-398 Clamped +dddiv794 divide 1000 Inf -> 0E-398 Clamped +dddiv795 divide Inf Inf -> NaN Invalid_operation + +dddiv800 divide -Inf -Inf -> NaN Invalid_operation +dddiv801 divide -Inf -1000 -> Infinity +dddiv802 divide -Inf -1 -> Infinity +dddiv803 divide -Inf -0 -> Infinity +dddiv804 divide -Inf 0 -> -Infinity +dddiv805 divide -Inf 1 -> -Infinity +dddiv806 divide -Inf 1000 -> -Infinity +dddiv807 divide -Inf Inf -> NaN Invalid_operation +dddiv808 divide -1000 Inf -> -0E-398 Clamped +dddiv809 divide -Inf -Inf -> NaN Invalid_operation +dddiv810 divide -1 -Inf -> 0E-398 Clamped +dddiv811 divide -0 -Inf -> 0E-398 Clamped +dddiv812 divide 0 -Inf -> -0E-398 Clamped +dddiv813 divide 1 -Inf -> -0E-398 Clamped +dddiv814 divide 1000 -Inf -> -0E-398 Clamped +dddiv815 divide Inf -Inf -> NaN Invalid_operation + +dddiv821 divide NaN -Inf -> NaN +dddiv822 divide NaN -1000 -> NaN +dddiv823 divide NaN -1 -> NaN +dddiv824 divide NaN -0 -> NaN +dddiv825 divide NaN 0 -> NaN +dddiv826 divide NaN 1 -> NaN +dddiv827 divide NaN 1000 -> NaN +dddiv828 divide NaN Inf -> NaN +dddiv829 divide NaN NaN -> NaN +dddiv830 divide -Inf NaN -> NaN +dddiv831 divide -1000 NaN -> NaN +dddiv832 divide -1 NaN -> NaN +dddiv833 divide -0 NaN -> NaN +dddiv834 divide 0 NaN -> NaN +dddiv835 divide 1 NaN -> NaN +dddiv836 divide 1000 NaN -> NaN +dddiv837 divide Inf NaN -> NaN + +dddiv841 divide sNaN -Inf -> NaN Invalid_operation +dddiv842 divide sNaN -1000 -> NaN Invalid_operation +dddiv843 divide sNaN -1 -> NaN Invalid_operation +dddiv844 divide sNaN -0 -> NaN Invalid_operation +dddiv845 divide sNaN 0 -> NaN Invalid_operation +dddiv846 divide sNaN 1 -> NaN Invalid_operation +dddiv847 divide sNaN 1000 -> NaN Invalid_operation +dddiv848 divide sNaN NaN -> NaN Invalid_operation +dddiv849 divide sNaN sNaN -> NaN Invalid_operation +dddiv850 divide NaN sNaN -> NaN Invalid_operation +dddiv851 divide -Inf sNaN -> NaN Invalid_operation +dddiv852 divide -1000 sNaN -> NaN Invalid_operation +dddiv853 divide -1 sNaN -> NaN Invalid_operation +dddiv854 divide -0 sNaN -> NaN Invalid_operation +dddiv855 divide 0 sNaN -> NaN Invalid_operation +dddiv856 divide 1 sNaN -> NaN Invalid_operation +dddiv857 divide 1000 sNaN -> NaN Invalid_operation +dddiv858 divide Inf sNaN -> NaN Invalid_operation +dddiv859 divide NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dddiv861 divide NaN9 -Inf -> NaN9 +dddiv862 divide NaN8 1000 -> NaN8 +dddiv863 divide NaN7 Inf -> NaN7 +dddiv864 divide NaN6 NaN5 -> NaN6 +dddiv865 divide -Inf NaN4 -> NaN4 +dddiv866 divide -1000 NaN3 -> NaN3 +dddiv867 divide Inf NaN2 -> NaN2 + +dddiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation +dddiv872 divide sNaN98 -1 -> NaN98 Invalid_operation +dddiv873 divide sNaN97 NaN -> NaN97 Invalid_operation +dddiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation +dddiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation +dddiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation +dddiv877 divide 0 sNaN91 -> NaN91 Invalid_operation +dddiv878 divide Inf sNaN90 -> NaN90 Invalid_operation +dddiv879 divide NaN sNaN89 -> NaN89 Invalid_operation + +dddiv881 divide -NaN9 -Inf -> -NaN9 +dddiv882 divide -NaN8 1000 -> -NaN8 +dddiv883 divide -NaN7 Inf -> -NaN7 +dddiv884 divide -NaN6 -NaN5 -> -NaN6 +dddiv885 divide -Inf -NaN4 -> -NaN4 +dddiv886 divide -1000 -NaN3 -> -NaN3 +dddiv887 divide Inf -NaN2 -> -NaN2 + +dddiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation +dddiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation +dddiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation +dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation +dddiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation +dddiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation +dddiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation +dddiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation +dddiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation + +-- Various flavours of divide by 0 +dddiv901 divide 0 0 -> NaN Division_undefined +dddiv902 divide 0.0E5 0 -> NaN Division_undefined +dddiv903 divide 0.000 0 -> NaN Division_undefined +dddiv904 divide 0.0001 0 -> Infinity Division_by_zero +dddiv905 divide 0.01 0 -> Infinity Division_by_zero +dddiv906 divide 0.1 0 -> Infinity Division_by_zero +dddiv907 divide 1 0 -> Infinity Division_by_zero +dddiv908 divide 1 0.0 -> Infinity Division_by_zero +dddiv909 divide 10 0.0 -> Infinity Division_by_zero +dddiv910 divide 1E+100 0.0 -> Infinity Division_by_zero +dddiv911 divide 1E+100 0 -> Infinity Division_by_zero + +dddiv921 divide -0.0001 0 -> -Infinity Division_by_zero +dddiv922 divide -0.01 0 -> -Infinity Division_by_zero +dddiv923 divide -0.1 0 -> -Infinity Division_by_zero +dddiv924 divide -1 0 -> -Infinity Division_by_zero +dddiv925 divide -1 0.0 -> -Infinity Division_by_zero +dddiv926 divide -10 0.0 -> -Infinity Division_by_zero +dddiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero +dddiv928 divide -1E+100 0 -> -Infinity Division_by_zero + +dddiv931 divide 0.0001 -0 -> -Infinity Division_by_zero +dddiv932 divide 0.01 -0 -> -Infinity Division_by_zero +dddiv933 divide 0.1 -0 -> -Infinity Division_by_zero +dddiv934 divide 1 -0 -> -Infinity Division_by_zero +dddiv935 divide 1 -0.0 -> -Infinity Division_by_zero +dddiv936 divide 10 -0.0 -> -Infinity Division_by_zero +dddiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero +dddiv938 divide 1E+100 -0 -> -Infinity Division_by_zero + +dddiv941 divide -0.0001 -0 -> Infinity Division_by_zero +dddiv942 divide -0.01 -0 -> Infinity Division_by_zero +dddiv943 divide -0.1 -0 -> Infinity Division_by_zero +dddiv944 divide -1 -0 -> Infinity Division_by_zero +dddiv945 divide -1 -0.0 -> Infinity Division_by_zero +dddiv946 divide -10 -0.0 -> Infinity Division_by_zero +dddiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero +dddiv948 divide -1E+100 -0 -> Infinity Division_by_zero + +-- Examples from SQL proposal (Krishna Kulkarni) +dddiv1021 divide 1E0 1E0 -> 1 +dddiv1022 divide 1E0 2E0 -> 0.5 +dddiv1023 divide 1E0 3E0 -> 0.3333333333333333 Inexact Rounded +dddiv1024 divide 100E-2 1000E-3 -> 1 +dddiv1025 divide 24E-1 2E0 -> 1.2 +dddiv1026 divide 2400E-3 2E0 -> 1.200 +dddiv1027 divide 5E0 2E0 -> 2.5 +dddiv1028 divide 5E0 20E-1 -> 2.5 +dddiv1029 divide 5E0 2000E-3 -> 2.5 +dddiv1030 divide 5E0 2E-1 -> 25 +dddiv1031 divide 5E0 20E-2 -> 25 +dddiv1032 divide 480E-2 3E0 -> 1.60 +dddiv1033 divide 47E-1 2E0 -> 2.35 + +-- ECMAScript bad examples +rounding: half_down +dddiv1040 divide 5 9 -> 0.5555555555555556 Inexact Rounded +rounding: half_even +dddiv1041 divide 6 11 -> 0.5454545454545455 Inexact Rounded + +-- overflow and underflow tests .. note subnormal results +-- signs +dddiv1051 divide 1e+277 1e-311 -> Infinity Overflow Inexact Rounded +dddiv1052 divide 1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded +dddiv1053 divide -1e+277 1e-311 -> -Infinity Overflow Inexact Rounded +dddiv1054 divide -1e+277 -1e-311 -> Infinity Overflow Inexact Rounded +dddiv1055 divide 1e-277 1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1056 divide 1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1057 divide -1e-277 1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1058 divide -1e-277 -1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal +dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal +dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal +dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal +dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal +dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal +dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal +dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381 Clamped +dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382 Clamped +dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383 Clamped +dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384 Clamped +dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded +dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded +dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded +dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded +dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded +dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded + +dddiv1101 divide 1.0000E-394 1 -> 1.0000E-394 Subnormal +dddiv1102 divide 1.000E-394 1e+1 -> 1.000E-395 Subnormal +dddiv1103 divide 1.00E-394 1e+2 -> 1.00E-396 Subnormal +dddiv1104 divide 1.0E-394 1e+3 -> 1.0E-397 Subnormal +dddiv1105 divide 1.0E-394 1e+4 -> 1E-398 Subnormal Rounded +dddiv1106 divide 1.3E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded +dddiv1107 divide 1.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1108 divide 1.7E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1109 divide 2.3E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1110 divide 2.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1111 divide 2.7E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded +dddiv1112 divide 1.49E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded +dddiv1113 divide 1.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1114 divide 1.51E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1115 divide 2.49E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1116 divide 2.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded +dddiv1117 divide 2.51E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded + +dddiv1118 divide 1E-394 1e+4 -> 1E-398 Subnormal +dddiv1119 divide 3E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1120 divide 5E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1121 divide 7E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded +dddiv1122 divide 9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded +dddiv1123 divide 9.9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded + +dddiv1124 divide 1E-394 -1e+4 -> -1E-398 Subnormal +dddiv1125 divide 3E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1126 divide -5E-394 1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1127 divide 7E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded +dddiv1128 divide -9E-394 1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded +dddiv1129 divide 9.9E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded +dddiv1130 divide 3.0E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped + +dddiv1131 divide 1.0E-199 1e+200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +dddiv1132 divide 1.0E-199 1e+199 -> 1E-398 Subnormal Rounded +dddiv1133 divide 1.0E-199 1e+198 -> 1.0E-397 Subnormal +dddiv1134 divide 2.0E-199 2e+198 -> 1.0E-397 Subnormal +dddiv1135 divide 4.0E-199 4e+198 -> 1.0E-397 Subnormal +dddiv1136 divide 10.0E-199 10e+198 -> 1.0E-397 Subnormal +dddiv1137 divide 30.0E-199 30e+198 -> 1.0E-397 Subnormal + +-- randoms +dddiv2010 divide -3.303226714900711E-35 8.796578842713183E+73 -> -3.755126594058783E-109 Inexact Rounded +dddiv2011 divide 933153327821073.6 68782181090246.25 -> 13.56678885475763 Inexact Rounded +dddiv2012 divide 5.04752436057906E-72 -8.179481771238642E+64 -> -6.170958627632835E-137 Inexact Rounded +dddiv2013 divide -3707613309582318 3394911196503.048 -> -1092.109070010836 Inexact Rounded +dddiv2014 divide 99689.0555190461 -4.735208553891464 -> -21052.72753765411 Inexact Rounded +dddiv2015 divide -1447915775613329 269750797.8184875 -> -5367605.164925653 Inexact Rounded +dddiv2016 divide -9.394881304225258E-19 -830585.0252671636 -> 1.131116143251358E-24 Inexact Rounded +dddiv2017 divide -1.056283432738934 88.58754555124013 -> -0.01192361100159352 Inexact Rounded +dddiv2018 divide 5763220933343.081 689089567025052.1 -> 0.008363529516524456 Inexact Rounded +dddiv2019 divide 873819.122103216 9.740612494523300E-49 -> 8.970884763093948E+53 Inexact Rounded +dddiv2020 divide 8022914.838533576 6178.566801742713 -> 1298.507420243583 Inexact Rounded +dddiv2021 divide 203982.7605650363 -2158.283639053435 -> -94.51156320422168 Inexact Rounded +dddiv2022 divide 803.6310547013030 7101143795399.238 -> 1.131692411611166E-10 Inexact Rounded +dddiv2023 divide 9.251697842123399E-82 -1.342350220606119E-7 -> -6.892163982321936E-75 Inexact Rounded +dddiv2024 divide -1.980600645637992E-53 -5.474262753214457E+77 -> 3.618022617703168E-131 Inexact Rounded +dddiv2025 divide -210.0322996351690 -8.580951835872843E+80 -> 2.447657365434971E-79 Inexact Rounded +dddiv2026 divide -1.821980314020370E+85 -3.018915267138165 -> 6.035215144503042E+84 Inexact Rounded +dddiv2027 divide -772264503601.1047 5.158258271408988E-86 -> -1.497141986630614E+97 Inexact Rounded +dddiv2028 divide -767.0532415847106 2.700027228028939E-59 -> -2.840909282772941E+61 Inexact Rounded +dddiv2029 divide 496724.8548250093 7.32700588163100E+66 -> 6.779370220929013E-62 Inexact Rounded +dddiv2030 divide -304232651447703.9 -108.9730808657440 -> 2791814721862.565 Inexact Rounded +dddiv2031 divide -7.233817192699405E+42 -5711302004.149411 -> 1.266579352211430E+33 Inexact Rounded +dddiv2032 divide -9.999221444912745E+96 4010569406446197 -> -2.493217404202250E+81 Inexact Rounded +dddiv2033 divide -1837272.061937622 8.356322838066762 -> -219866.0939196882 Inexact Rounded +dddiv2034 divide 2168.517555606529 209.1910258615061 -> 10.36620737756784 Inexact Rounded +dddiv2035 divide -1.884389790576371E+88 2.95181953870583E+20 -> -6.383824505079828E+67 Inexact Rounded +dddiv2036 divide 732263.6037438196 961222.3634446889 -> 0.7618045850698269 Inexact Rounded +dddiv2037 divide -813461419.0348336 5.376293753809143E+84 -> -1.513052404285927E-76 Inexact Rounded +dddiv2038 divide -45562133508108.50 -9.776843494690107E+51 -> 4.660208945029519E-39 Inexact Rounded +dddiv2039 divide -6.489393172441016E+80 -9101965.097852113 -> 7.129661674897421E+73 Inexact Rounded +dddiv2040 divide 3.694576237117349E+93 6683512.012622003 -> 5.527896456443912E+86 Inexact Rounded +dddiv2041 divide -2.252877726403272E+19 -7451913256.181367 -> 3023220546.125531 Inexact Rounded +dddiv2042 divide 518303.1989111842 50.01587020474133 -> 10362.77479107123 Inexact Rounded +dddiv2043 divide 2.902087881880103E+24 33.32400992305702 -> 8.708699488989578E+22 Inexact Rounded +dddiv2044 divide 549619.4559510557 1660824845196338 -> 3.309316196351104E-10 Inexact Rounded +dddiv2045 divide -6775670774684043 8292152023.077262 -> -817118.4941891062 Inexact Rounded +dddiv2046 divide -77.50923921524079 -5.636882655425815E+74 -> 1.375037302588405E-73 Inexact Rounded +dddiv2047 divide -2.984889459605149E-10 -88106156784122.99 -> 3.387833005721384E-24 Inexact Rounded +dddiv2048 divide 0.949517293997085 44767115.96450998 -> 2.121015110175589E-8 Inexact Rounded +dddiv2049 divide -2760937211.084521 -1087015876975408 -> 0.000002539923537057024 Inexact Rounded +dddiv2050 divide 28438351.85030536 -4.209397904088624E-47 -> -6.755919135770688E+53 Inexact Rounded +dddiv2051 divide -85562731.6820956 -7.166045442530185E+45 -> 1.194002080621542E-38 Inexact Rounded +dddiv2052 divide 2533802852165.25 7154.119606235955 -> 354173957.3317501 Inexact Rounded +dddiv2053 divide -8858831346851.474 97.59734208801716 -> -90769186509.83577 Inexact Rounded +dddiv2054 divide 176783629801387.5 840073263.3109817 -> 210438.3480848206 Inexact Rounded +dddiv2055 divide -493506471796175.6 79733894790822.03 -> -6.189418854940746 Inexact Rounded +dddiv2056 divide 790.1682542103445 829.9449370367435 -> 0.9520731062371214 Inexact Rounded +dddiv2057 divide -8920459838.583164 -4767.889187899214 -> 1870945.294035581 Inexact Rounded +dddiv2058 divide 53536687164422.1 53137.5007032689 -> 1007512330.385698 Inexact Rounded +dddiv2059 divide 4.051532311146561E-74 -2.343089768972261E+94 -> -1.729140882606332E-168 Inexact Rounded +dddiv2060 divide -14847758778636.88 3.062543516383807E-43 -> -4.848178874587497E+55 Inexact Rounded + +-- Division probably has pre-rounding, so need to test rounding +-- explicitly rather than assume included through other tests; +-- tests include simple rounding and also the tricky cases of sticky +-- bits following two zeros +-- +-- 1/99999 gives 0.0000100001000010000100001000010000100001 +-- 1234567890123456 +-- +-- 1/999999 gives 0.000001000001000001000001000001000001000001 +-- 1234567890123456 + +rounding: ceiling +dddiv3001 divide 1 3 -> 0.3333333333333334 Inexact Rounded +dddiv3002 divide 2 3 -> 0.6666666666666667 Inexact Rounded +dddiv3003 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded +dddiv3004 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded + +rounding: floor +dddiv3011 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv3012 divide 2 3 -> 0.6666666666666666 Inexact Rounded +dddiv3013 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded +dddiv3014 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded + +rounding: up +dddiv3021 divide 1 3 -> 0.3333333333333334 Inexact Rounded +dddiv3022 divide 2 3 -> 0.6666666666666667 Inexact Rounded +dddiv3023 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded +dddiv3024 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded + +rounding: down +dddiv3031 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv3032 divide 2 3 -> 0.6666666666666666 Inexact Rounded +dddiv3033 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded +dddiv3034 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded + +rounding: half_up +dddiv3041 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv3042 divide 2 3 -> 0.6666666666666667 Inexact Rounded +dddiv3043 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded +dddiv3044 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded + +rounding: half_down +dddiv3051 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv3052 divide 2 3 -> 0.6666666666666667 Inexact Rounded +dddiv3053 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded +dddiv3054 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded + +rounding: half_even +dddiv3061 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv3062 divide 2 3 -> 0.6666666666666667 Inexact Rounded +dddiv3063 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded +dddiv3064 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded + +rounding: 05up +dddiv3071 divide 1 3 -> 0.3333333333333333 Inexact Rounded +dddiv3072 divide 2 3 -> 0.6666666666666666 Inexact Rounded +dddiv3073 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded +dddiv3074 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded + +-- random divide tests with result near 1 +rounding: half_even +dddiv4001 divide 3195385192916917 3195385192946695 -> 0.9999999999906809 Inexact Rounded +dddiv4002 divide 1393723067526993 1393723067519475 -> 1.000000000005394 Inexact Rounded +dddiv4003 divide 759985543702302 759985543674015 -> 1.000000000037220 Inexact Rounded +dddiv4004 divide 9579158456027302 9579158456036864 -> 0.9999999999990018 Inexact Rounded +dddiv4005 divide 7079398299143569 7079398299156904 -> 0.9999999999981164 Inexact Rounded +dddiv4006 divide 6636169255366598 6636169255336386 -> 1.000000000004553 Inexact Rounded +dddiv4007 divide 6964813971340090 6964813971321554 -> 1.000000000002661 Inexact Rounded +dddiv4008 divide 4182275225480784 4182275225454009 -> 1.000000000006402 Inexact Rounded +dddiv4009 divide 9228325124938029 9228325124918730 -> 1.000000000002091 Inexact Rounded +dddiv4010 divide 3428346338630192 3428346338609843 -> 1.000000000005936 Inexact Rounded +dddiv4011 divide 2143511550722893 2143511550751754 -> 0.9999999999865356 Inexact Rounded +dddiv4012 divide 1672732924396785 1672732924401811 -> 0.9999999999969953 Inexact Rounded +dddiv4013 divide 4190714611948216 4190714611948664 -> 0.9999999999998931 Inexact Rounded +dddiv4014 divide 3942254800848877 3942254800814556 -> 1.000000000008706 Inexact Rounded +dddiv4015 divide 2854459826952334 2854459826960762 -> 0.9999999999970474 Inexact Rounded +dddiv4016 divide 2853258953664731 2853258953684471 -> 0.9999999999930816 Inexact Rounded +dddiv4017 divide 9453512638125978 9453512638146425 -> 0.9999999999978371 Inexact Rounded +dddiv4018 divide 339476633940369 339476633912887 -> 1.000000000080954 Inexact Rounded +dddiv4019 divide 4542181492688467 4542181492697735 -> 0.9999999999979596 Inexact Rounded +dddiv4020 divide 7312600192399197 7312600192395424 -> 1.000000000000516 Inexact Rounded +dddiv4021 divide 1811674985570111 1811674985603935 -> 0.9999999999813300 Inexact Rounded +dddiv4022 divide 1706462639003481 1706462639017740 -> 0.9999999999916441 Inexact Rounded +dddiv4023 divide 6697052654940368 6697052654934110 -> 1.000000000000934 Inexact Rounded +dddiv4024 divide 5015283664277539 5015283664310719 -> 0.9999999999933842 Inexact Rounded +dddiv4025 divide 2359501561537464 2359501561502464 -> 1.000000000014834 Inexact Rounded +dddiv4026 divide 2669850227909157 2669850227901548 -> 1.000000000002850 Inexact Rounded +dddiv4027 divide 9329725546974648 9329725547002445 -> 0.9999999999970206 Inexact Rounded +dddiv4028 divide 3228562867071248 3228562867106206 -> 0.9999999999891723 Inexact Rounded +dddiv4029 divide 4862226644921175 4862226644909380 -> 1.000000000002426 Inexact Rounded +dddiv4030 divide 1022267997054529 1022267997071329 -> 0.9999999999835660 Inexact Rounded +dddiv4031 divide 1048777482023719 1048777482000948 -> 1.000000000021712 Inexact Rounded +dddiv4032 divide 9980113777337098 9980113777330539 -> 1.000000000000657 Inexact Rounded +dddiv4033 divide 7506839167963908 7506839167942901 -> 1.000000000002798 Inexact Rounded +dddiv4034 divide 231119751977860 231119751962453 -> 1.000000000066662 Inexact Rounded +dddiv4035 divide 4034903664762962 4034903664795526 -> 0.9999999999919294 Inexact Rounded +dddiv4036 divide 5700122152274696 5700122152251386 -> 1.000000000004089 Inexact Rounded +dddiv4037 divide 6869599590293110 6869599590293495 -> 0.9999999999999440 Inexact Rounded +dddiv4038 divide 5576281960092797 5576281960105579 -> 0.9999999999977078 Inexact Rounded +dddiv4039 divide 2304844888381318 2304844888353073 -> 1.000000000012255 Inexact Rounded +dddiv4040 divide 3265933651656452 3265933651682779 -> 0.9999999999919389 Inexact Rounded +dddiv4041 divide 5235714985079914 5235714985066131 -> 1.000000000002632 Inexact Rounded +dddiv4042 divide 5578481572827551 5578481572822945 -> 1.000000000000826 Inexact Rounded +dddiv4043 divide 4909616081396134 4909616081373076 -> 1.000000000004696 Inexact Rounded +dddiv4044 divide 636447224349537 636447224338757 -> 1.000000000016938 Inexact Rounded +dddiv4045 divide 1539373428396640 1539373428364727 -> 1.000000000020731 Inexact Rounded +dddiv4046 divide 2028786707377893 2028786707378866 -> 0.9999999999995204 Inexact Rounded +dddiv4047 divide 137643260486222 137643260487419 -> 0.9999999999913036 Inexact Rounded +dddiv4048 divide 247451519746765 247451519752267 -> 0.9999999999777653 Inexact Rounded +dddiv4049 divide 7877858475022054 7877858474999794 -> 1.000000000002826 Inexact Rounded +dddiv4050 divide 7333242694766258 7333242694744628 -> 1.000000000002950 Inexact Rounded +dddiv4051 divide 124051503698592 124051503699397 -> 0.9999999999935108 Inexact Rounded +dddiv4052 divide 8944737432385188 8944737432406860 -> 0.9999999999975771 Inexact Rounded +dddiv4053 divide 9883948923406874 9883948923424843 -> 0.9999999999981820 Inexact Rounded +dddiv4054 divide 6829178741654284 6829178741671973 -> 0.9999999999974098 Inexact Rounded +dddiv4055 divide 7342752479768122 7342752479793385 -> 0.9999999999965595 Inexact Rounded +dddiv4056 divide 8066426579008783 8066426578977563 -> 1.000000000003870 Inexact Rounded +dddiv4057 divide 8992775071383295 8992775071352712 -> 1.000000000003401 Inexact Rounded +dddiv4058 divide 5485011755545641 5485011755543611 -> 1.000000000000370 Inexact Rounded +dddiv4059 divide 5779983054353918 5779983054365300 -> 0.9999999999980308 Inexact Rounded +dddiv4060 divide 9502265102713774 9502265102735208 -> 0.9999999999977443 Inexact Rounded +dddiv4061 divide 2109558399130981 2109558399116281 -> 1.000000000006968 Inexact Rounded +dddiv4062 divide 5296182636350471 5296182636351521 -> 0.9999999999998017 Inexact Rounded +dddiv4063 divide 1440019225591883 1440019225601844 -> 0.9999999999930827 Inexact Rounded +dddiv4064 divide 8182110791881341 8182110791847174 -> 1.000000000004176 Inexact Rounded +dddiv4065 divide 489098235512060 489098235534516 -> 0.9999999999540869 Inexact Rounded +dddiv4066 divide 6475687084782038 6475687084756089 -> 1.000000000004007 Inexact Rounded +dddiv4067 divide 8094348555736948 8094348555759236 -> 0.9999999999972465 Inexact Rounded +dddiv4068 divide 1982766816291543 1982766816309463 -> 0.9999999999909621 Inexact Rounded +dddiv4069 divide 9277314300113251 9277314300084467 -> 1.000000000003103 Inexact Rounded +dddiv4070 divide 4335532959318934 4335532959293167 -> 1.000000000005943 Inexact Rounded +dddiv4071 divide 7767113032981348 7767113032968132 -> 1.000000000001702 Inexact Rounded +dddiv4072 divide 1578548053342868 1578548053370448 -> 0.9999999999825282 Inexact Rounded +dddiv4073 divide 3790420686666898 3790420686636315 -> 1.000000000008068 Inexact Rounded +dddiv4074 divide 871682421955147 871682421976441 -> 0.9999999999755714 Inexact Rounded +dddiv4075 divide 744141054479940 744141054512329 -> 0.9999999999564746 Inexact Rounded +dddiv4076 divide 8956824183670735 8956824183641741 -> 1.000000000003237 Inexact Rounded +dddiv4077 divide 8337291694485682 8337291694451193 -> 1.000000000004137 Inexact Rounded +dddiv4078 divide 4107775944683669 4107775944657097 -> 1.000000000006469 Inexact Rounded +dddiv4079 divide 8691900057964648 8691900057997555 -> 0.9999999999962141 Inexact Rounded +dddiv4080 divide 2229528520536462 2229528520502337 -> 1.000000000015306 Inexact Rounded +dddiv4081 divide 398442083774322 398442083746273 -> 1.000000000070397 Inexact Rounded +dddiv4082 divide 5319819776808759 5319819776838313 -> 0.9999999999944445 Inexact Rounded +dddiv4083 divide 7710491299066855 7710491299041858 -> 1.000000000003242 Inexact Rounded +dddiv4084 divide 9083231296087266 9083231296058160 -> 1.000000000003204 Inexact Rounded +dddiv4085 divide 3566873574904559 3566873574890328 -> 1.000000000003990 Inexact Rounded +dddiv4086 divide 596343290550525 596343290555614 -> 0.9999999999914663 Inexact Rounded +dddiv4087 divide 278227925093192 278227925068104 -> 1.000000000090171 Inexact Rounded +dddiv4088 divide 3292902958490649 3292902958519881 -> 0.9999999999911227 Inexact Rounded +dddiv4089 divide 5521871364245881 5521871364229536 -> 1.000000000002960 Inexact Rounded +dddiv4090 divide 2406505602883617 2406505602857997 -> 1.000000000010646 Inexact Rounded +dddiv4091 divide 7741146984869208 7741146984867255 -> 1.000000000000252 Inexact Rounded +dddiv4092 divide 4576041832414909 4576041832405102 -> 1.000000000002143 Inexact Rounded +dddiv4093 divide 9183756982878057 9183756982901934 -> 0.9999999999974001 Inexact Rounded +dddiv4094 divide 6215736513855159 6215736513870342 -> 0.9999999999975573 Inexact Rounded +dddiv4095 divide 248554968534533 248554968551417 -> 0.9999999999320714 Inexact Rounded +dddiv4096 divide 376314165668645 376314165659755 -> 1.000000000023624 Inexact Rounded +dddiv4097 divide 5513569249809718 5513569249808906 -> 1.000000000000147 Inexact Rounded +dddiv4098 divide 3367992242167904 3367992242156228 -> 1.000000000003467 Inexact Rounded +dddiv4099 divide 6134869538966967 6134869538985986 -> 0.9999999999968999 Inexact Rounded + +-- Null tests +dddiv9998 divide 10 # -> NaN Invalid_operation +dddiv9999 divide # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddDivideInt.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddDivideInt.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,449 @@ +------------------------------------------------------------------------ +-- ddDivideInt.decTest -- decDouble integer division -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +dddvi001 divideint 1 1 -> 1 +dddvi002 divideint 2 1 -> 2 +dddvi003 divideint 1 2 -> 0 +dddvi004 divideint 2 2 -> 1 +dddvi005 divideint 0 1 -> 0 +dddvi006 divideint 0 2 -> 0 +dddvi007 divideint 1 3 -> 0 +dddvi008 divideint 2 3 -> 0 +dddvi009 divideint 3 3 -> 1 + +dddvi010 divideint 2.4 1 -> 2 +dddvi011 divideint 2.4 -1 -> -2 +dddvi012 divideint -2.4 1 -> -2 +dddvi013 divideint -2.4 -1 -> 2 +dddvi014 divideint 2.40 1 -> 2 +dddvi015 divideint 2.400 1 -> 2 +dddvi016 divideint 2.4 2 -> 1 +dddvi017 divideint 2.400 2 -> 1 +dddvi018 divideint 2. 2 -> 1 +dddvi019 divideint 20 20 -> 1 + +dddvi020 divideint 187 187 -> 1 +dddvi021 divideint 5 2 -> 2 +dddvi022 divideint 5 2.0 -> 2 +dddvi023 divideint 5 2.000 -> 2 +dddvi024 divideint 5 0.200 -> 25 +dddvi025 divideint 5 0.200 -> 25 + +dddvi030 divideint 1 2 -> 0 +dddvi031 divideint 1 4 -> 0 +dddvi032 divideint 1 8 -> 0 +dddvi033 divideint 1 16 -> 0 +dddvi034 divideint 1 32 -> 0 +dddvi035 divideint 1 64 -> 0 +dddvi040 divideint 1 -2 -> -0 +dddvi041 divideint 1 -4 -> -0 +dddvi042 divideint 1 -8 -> -0 +dddvi043 divideint 1 -16 -> -0 +dddvi044 divideint 1 -32 -> -0 +dddvi045 divideint 1 -64 -> -0 +dddvi050 divideint -1 2 -> -0 +dddvi051 divideint -1 4 -> -0 +dddvi052 divideint -1 8 -> -0 +dddvi053 divideint -1 16 -> -0 +dddvi054 divideint -1 32 -> -0 +dddvi055 divideint -1 64 -> -0 +dddvi060 divideint -1 -2 -> 0 +dddvi061 divideint -1 -4 -> 0 +dddvi062 divideint -1 -8 -> 0 +dddvi063 divideint -1 -16 -> 0 +dddvi064 divideint -1 -32 -> 0 +dddvi065 divideint -1 -64 -> 0 + +-- similar with powers of ten +dddvi160 divideint 1 1 -> 1 +dddvi161 divideint 1 10 -> 0 +dddvi162 divideint 1 100 -> 0 +dddvi163 divideint 1 1000 -> 0 +dddvi164 divideint 1 10000 -> 0 +dddvi165 divideint 1 100000 -> 0 +dddvi166 divideint 1 1000000 -> 0 +dddvi167 divideint 1 10000000 -> 0 +dddvi168 divideint 1 100000000 -> 0 +dddvi170 divideint 1 -1 -> -1 +dddvi171 divideint 1 -10 -> -0 +dddvi172 divideint 1 -100 -> -0 +dddvi173 divideint 1 -1000 -> -0 +dddvi174 divideint 1 -10000 -> -0 +dddvi175 divideint 1 -100000 -> -0 +dddvi176 divideint 1 -1000000 -> -0 +dddvi177 divideint 1 -10000000 -> -0 +dddvi178 divideint 1 -100000000 -> -0 +dddvi180 divideint -1 1 -> -1 +dddvi181 divideint -1 10 -> -0 +dddvi182 divideint -1 100 -> -0 +dddvi183 divideint -1 1000 -> -0 +dddvi184 divideint -1 10000 -> -0 +dddvi185 divideint -1 100000 -> -0 +dddvi186 divideint -1 1000000 -> -0 +dddvi187 divideint -1 10000000 -> -0 +dddvi188 divideint -1 100000000 -> -0 +dddvi190 divideint -1 -1 -> 1 +dddvi191 divideint -1 -10 -> 0 +dddvi192 divideint -1 -100 -> 0 +dddvi193 divideint -1 -1000 -> 0 +dddvi194 divideint -1 -10000 -> 0 +dddvi195 divideint -1 -100000 -> 0 +dddvi196 divideint -1 -1000000 -> 0 +dddvi197 divideint -1 -10000000 -> 0 +dddvi198 divideint -1 -100000000 -> 0 + +-- some long operand (at p=9) cases +dddvi070 divideint 999999999 1 -> 999999999 +dddvi071 divideint 999999999.4 1 -> 999999999 +dddvi072 divideint 999999999.5 1 -> 999999999 +dddvi073 divideint 999999999.9 1 -> 999999999 +dddvi074 divideint 999999999.999 1 -> 999999999 + +dddvi090 divideint 0. 1 -> 0 +dddvi091 divideint .0 1 -> 0 +dddvi092 divideint 0.00 1 -> 0 +dddvi093 divideint 0.00E+9 1 -> 0 +dddvi094 divideint 0.0000E-50 1 -> 0 + +dddvi100 divideint 1 1 -> 1 +dddvi101 divideint 1 2 -> 0 +dddvi102 divideint 1 3 -> 0 +dddvi103 divideint 1 4 -> 0 +dddvi104 divideint 1 5 -> 0 +dddvi105 divideint 1 6 -> 0 +dddvi106 divideint 1 7 -> 0 +dddvi107 divideint 1 8 -> 0 +dddvi108 divideint 1 9 -> 0 +dddvi109 divideint 1 10 -> 0 +dddvi110 divideint 1 1 -> 1 +dddvi111 divideint 2 1 -> 2 +dddvi112 divideint 3 1 -> 3 +dddvi113 divideint 4 1 -> 4 +dddvi114 divideint 5 1 -> 5 +dddvi115 divideint 6 1 -> 6 +dddvi116 divideint 7 1 -> 7 +dddvi117 divideint 8 1 -> 8 +dddvi118 divideint 9 1 -> 9 +dddvi119 divideint 10 1 -> 10 + +-- from DiagBigDecimal +dddvi131 divideint 101.3 1 -> 101 +dddvi132 divideint 101.0 1 -> 101 +dddvi133 divideint 101.3 3 -> 33 +dddvi134 divideint 101.0 3 -> 33 +dddvi135 divideint 2.4 1 -> 2 +dddvi136 divideint 2.400 1 -> 2 +dddvi137 divideint 18 18 -> 1 +dddvi138 divideint 1120 1000 -> 1 +dddvi139 divideint 2.4 2 -> 1 +dddvi140 divideint 2.400 2 -> 1 +dddvi141 divideint 0.5 2.000 -> 0 +dddvi142 divideint 8.005 7 -> 1 +dddvi143 divideint 5 2 -> 2 +dddvi144 divideint 0 2 -> 0 +dddvi145 divideint 0.00 2 -> 0 + +-- Others +dddvi150 divideint 12345 4.999 -> 2469 +dddvi151 divideint 12345 4.99 -> 2473 +dddvi152 divideint 12345 4.9 -> 2519 +dddvi153 divideint 12345 5 -> 2469 +dddvi154 divideint 12345 5.1 -> 2420 +dddvi155 divideint 12345 5.01 -> 2464 +dddvi156 divideint 12345 5.001 -> 2468 +dddvi157 divideint 101 7.6 -> 13 + +-- Various flavours of divideint by 0 +dddvi201 divideint 0 0 -> NaN Division_undefined +dddvi202 divideint 0.0E5 0 -> NaN Division_undefined +dddvi203 divideint 0.000 0 -> NaN Division_undefined +dddvi204 divideint 0.0001 0 -> Infinity Division_by_zero +dddvi205 divideint 0.01 0 -> Infinity Division_by_zero +dddvi206 divideint 0.1 0 -> Infinity Division_by_zero +dddvi207 divideint 1 0 -> Infinity Division_by_zero +dddvi208 divideint 1 0.0 -> Infinity Division_by_zero +dddvi209 divideint 10 0.0 -> Infinity Division_by_zero +dddvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero +dddvi211 divideint 1E+380 0 -> Infinity Division_by_zero +dddvi214 divideint -0.0001 0 -> -Infinity Division_by_zero +dddvi215 divideint -0.01 0 -> -Infinity Division_by_zero +dddvi216 divideint -0.1 0 -> -Infinity Division_by_zero +dddvi217 divideint -1 0 -> -Infinity Division_by_zero +dddvi218 divideint -1 0.0 -> -Infinity Division_by_zero +dddvi219 divideint -10 0.0 -> -Infinity Division_by_zero +dddvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero +dddvi221 divideint -1E+380 0 -> -Infinity Division_by_zero + +-- test some cases that are close to exponent overflow +dddvi270 divideint 1 1e384 -> 0 +dddvi271 divideint 1 0.9e384 -> 0 +dddvi272 divideint 1 0.99e384 -> 0 +dddvi273 divideint 1 0.9999999999999999e384 -> 0 +dddvi274 divideint 9e384 1 -> NaN Division_impossible +dddvi275 divideint 9.9e384 1 -> NaN Division_impossible +dddvi276 divideint 9.99e384 1 -> NaN Division_impossible +dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible + +dddvi280 divideint 0.1 9e-383 -> NaN Division_impossible +dddvi281 divideint 0.1 99e-383 -> NaN Division_impossible +dddvi282 divideint 0.1 999e-383 -> NaN Division_impossible +dddvi283 divideint 0.1 9e-382 -> NaN Division_impossible +dddvi284 divideint 0.1 99e-382 -> NaN Division_impossible + +-- GD edge cases: lhs smaller than rhs but more digits +dddvi301 divideint 0.9 2 -> 0 +dddvi302 divideint 0.9 2.0 -> 0 +dddvi303 divideint 0.9 2.1 -> 0 +dddvi304 divideint 0.9 2.00 -> 0 +dddvi305 divideint 0.9 2.01 -> 0 +dddvi306 divideint 0.12 1 -> 0 +dddvi307 divideint 0.12 1.0 -> 0 +dddvi308 divideint 0.12 1.00 -> 0 +dddvi309 divideint 0.12 1.0 -> 0 +dddvi310 divideint 0.12 1.00 -> 0 +dddvi311 divideint 0.12 2 -> 0 +dddvi312 divideint 0.12 2.0 -> 0 +dddvi313 divideint 0.12 2.1 -> 0 +dddvi314 divideint 0.12 2.00 -> 0 +dddvi315 divideint 0.12 2.01 -> 0 + +-- edge cases of impossible +dddvi330 divideint 1234567890123456 10 -> 123456789012345 +dddvi331 divideint 1234567890123456 1 -> 1234567890123456 +dddvi332 divideint 1234567890123456 0.1 -> NaN Division_impossible +dddvi333 divideint 1234567890123456 0.01 -> NaN Division_impossible + +-- overflow and underflow tests [from divide] +dddvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible +dddvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible +dddvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible +dddvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible +dddvi1055 divideint 1e-277 1e+311 -> 0 +dddvi1056 divideint 1e-277 -1e+311 -> -0 +dddvi1057 divideint -1e-277 1e+311 -> -0 +dddvi1058 divideint -1e-277 -1e+311 -> 0 + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +dddvi1060 divideint 1e-291 1e+101 -> 0 +dddvi1061 divideint 1e-291 1e+102 -> 0 +dddvi1062 divideint 1e-291 1e+103 -> 0 +dddvi1063 divideint 1e-291 1e+104 -> 0 +dddvi1064 divideint 1e-291 1e+105 -> 0 +dddvi1065 divideint 1e-291 1e+106 -> 0 +dddvi1066 divideint 1e-291 1e+107 -> 0 +dddvi1067 divideint 1e-291 1e+108 -> 0 +dddvi1068 divideint 1e-291 1e+109 -> 0 +dddvi1069 divideint 1e-291 1e+110 -> 0 + +dddvi1101 divideint 1.0000E-394 1 -> 0 +dddvi1102 divideint 1.000E-394 1e+1 -> 0 +dddvi1103 divideint 1.00E-394 1e+2 -> 0 + +dddvi1118 divideint 1E-394 1e+4 -> 0 +dddvi1119 divideint 3E-394 -1e+5 -> -0 +dddvi1120 divideint 5E-394 1e+5 -> 0 + +dddvi1124 divideint 1E-394 -1e+4 -> -0 +dddvi1130 divideint 3.0E-394 -1e+5 -> -0 + +dddvi1131 divideint 1.0E-199 1e+200 -> 0 +dddvi1132 divideint 1.0E-199 1e+199 -> 0 +dddvi1133 divideint 1.0E-199 1e+198 -> 0 +dddvi1134 divideint 2.0E-199 2e+198 -> 0 +dddvi1135 divideint 4.0E-199 4e+198 -> 0 + +-- long operand checks +dddvi401 divideint 12345678000 100 -> 123456780 +dddvi402 divideint 1 12345678000 -> 0 +dddvi403 divideint 1234567800 10 -> 123456780 +dddvi404 divideint 1 1234567800 -> 0 +dddvi405 divideint 1234567890 10 -> 123456789 +dddvi406 divideint 1 1234567890 -> 0 +dddvi407 divideint 1234567891 10 -> 123456789 +dddvi408 divideint 1 1234567891 -> 0 +dddvi409 divideint 12345678901 100 -> 123456789 +dddvi410 divideint 1 12345678901 -> 0 +dddvi411 divideint 1234567896 10 -> 123456789 +dddvi412 divideint 1 1234567896 -> 0 +dddvi413 divideint 12345678948 100 -> 123456789 +dddvi414 divideint 12345678949 100 -> 123456789 +dddvi415 divideint 12345678950 100 -> 123456789 +dddvi416 divideint 12345678951 100 -> 123456789 +dddvi417 divideint 12345678999 100 -> 123456789 +dddvi441 divideint 12345678000 1 -> 12345678000 +dddvi442 divideint 1 12345678000 -> 0 +dddvi443 divideint 1234567800 1 -> 1234567800 +dddvi444 divideint 1 1234567800 -> 0 +dddvi445 divideint 1234567890 1 -> 1234567890 +dddvi446 divideint 1 1234567890 -> 0 +dddvi447 divideint 1234567891 1 -> 1234567891 +dddvi448 divideint 1 1234567891 -> 0 +dddvi449 divideint 12345678901 1 -> 12345678901 +dddvi450 divideint 1 12345678901 -> 0 +dddvi451 divideint 1234567896 1 -> 1234567896 +dddvi452 divideint 1 1234567896 -> 0 + +-- more zeros, etc. +dddvi531 divideint 5.00 1E-3 -> 5000 +dddvi532 divideint 00.00 0.000 -> NaN Division_undefined +dddvi533 divideint 00.00 0E-3 -> NaN Division_undefined +dddvi534 divideint 0 -0 -> NaN Division_undefined +dddvi535 divideint -0 0 -> NaN Division_undefined +dddvi536 divideint -0 -0 -> NaN Division_undefined + +dddvi541 divideint 0 -1 -> -0 +dddvi542 divideint -0 -1 -> 0 +dddvi543 divideint 0 1 -> 0 +dddvi544 divideint -0 1 -> -0 +dddvi545 divideint -1 0 -> -Infinity Division_by_zero +dddvi546 divideint -1 -0 -> Infinity Division_by_zero +dddvi547 divideint 1 0 -> Infinity Division_by_zero +dddvi548 divideint 1 -0 -> -Infinity Division_by_zero + +dddvi551 divideint 0.0 -1 -> -0 +dddvi552 divideint -0.0 -1 -> 0 +dddvi553 divideint 0.0 1 -> 0 +dddvi554 divideint -0.0 1 -> -0 +dddvi555 divideint -1.0 0 -> -Infinity Division_by_zero +dddvi556 divideint -1.0 -0 -> Infinity Division_by_zero +dddvi557 divideint 1.0 0 -> Infinity Division_by_zero +dddvi558 divideint 1.0 -0 -> -Infinity Division_by_zero + +dddvi561 divideint 0 -1.0 -> -0 +dddvi562 divideint -0 -1.0 -> 0 +dddvi563 divideint 0 1.0 -> 0 +dddvi564 divideint -0 1.0 -> -0 +dddvi565 divideint -1 0.0 -> -Infinity Division_by_zero +dddvi566 divideint -1 -0.0 -> Infinity Division_by_zero +dddvi567 divideint 1 0.0 -> Infinity Division_by_zero +dddvi568 divideint 1 -0.0 -> -Infinity Division_by_zero + +dddvi571 divideint 0.0 -1.0 -> -0 +dddvi572 divideint -0.0 -1.0 -> 0 +dddvi573 divideint 0.0 1.0 -> 0 +dddvi574 divideint -0.0 1.0 -> -0 +dddvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero +dddvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero +dddvi577 divideint 1.0 0.0 -> Infinity Division_by_zero +dddvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +dddvi580 divideint Inf -Inf -> NaN Invalid_operation +dddvi581 divideint Inf -1000 -> -Infinity +dddvi582 divideint Inf -1 -> -Infinity +dddvi583 divideint Inf -0 -> -Infinity +dddvi584 divideint Inf 0 -> Infinity +dddvi585 divideint Inf 1 -> Infinity +dddvi586 divideint Inf 1000 -> Infinity +dddvi587 divideint Inf Inf -> NaN Invalid_operation +dddvi588 divideint -1000 Inf -> -0 +dddvi589 divideint -Inf Inf -> NaN Invalid_operation +dddvi590 divideint -1 Inf -> -0 +dddvi591 divideint -0 Inf -> -0 +dddvi592 divideint 0 Inf -> 0 +dddvi593 divideint 1 Inf -> 0 +dddvi594 divideint 1000 Inf -> 0 +dddvi595 divideint Inf Inf -> NaN Invalid_operation + +dddvi600 divideint -Inf -Inf -> NaN Invalid_operation +dddvi601 divideint -Inf -1000 -> Infinity +dddvi602 divideint -Inf -1 -> Infinity +dddvi603 divideint -Inf -0 -> Infinity +dddvi604 divideint -Inf 0 -> -Infinity +dddvi605 divideint -Inf 1 -> -Infinity +dddvi606 divideint -Inf 1000 -> -Infinity +dddvi607 divideint -Inf Inf -> NaN Invalid_operation +dddvi608 divideint -1000 Inf -> -0 +dddvi609 divideint -Inf -Inf -> NaN Invalid_operation +dddvi610 divideint -1 -Inf -> 0 +dddvi611 divideint -0 -Inf -> 0 +dddvi612 divideint 0 -Inf -> -0 +dddvi613 divideint 1 -Inf -> -0 +dddvi614 divideint 1000 -Inf -> -0 +dddvi615 divideint Inf -Inf -> NaN Invalid_operation + +dddvi621 divideint NaN -Inf -> NaN +dddvi622 divideint NaN -1000 -> NaN +dddvi623 divideint NaN -1 -> NaN +dddvi624 divideint NaN -0 -> NaN +dddvi625 divideint NaN 0 -> NaN +dddvi626 divideint NaN 1 -> NaN +dddvi627 divideint NaN 1000 -> NaN +dddvi628 divideint NaN Inf -> NaN +dddvi629 divideint NaN NaN -> NaN +dddvi630 divideint -Inf NaN -> NaN +dddvi631 divideint -1000 NaN -> NaN +dddvi632 divideint -1 NaN -> NaN +dddvi633 divideint -0 NaN -> NaN +dddvi634 divideint 0 NaN -> NaN +dddvi635 divideint 1 NaN -> NaN +dddvi636 divideint 1000 NaN -> NaN +dddvi637 divideint Inf NaN -> NaN + +dddvi641 divideint sNaN -Inf -> NaN Invalid_operation +dddvi642 divideint sNaN -1000 -> NaN Invalid_operation +dddvi643 divideint sNaN -1 -> NaN Invalid_operation +dddvi644 divideint sNaN -0 -> NaN Invalid_operation +dddvi645 divideint sNaN 0 -> NaN Invalid_operation +dddvi646 divideint sNaN 1 -> NaN Invalid_operation +dddvi647 divideint sNaN 1000 -> NaN Invalid_operation +dddvi648 divideint sNaN NaN -> NaN Invalid_operation +dddvi649 divideint sNaN sNaN -> NaN Invalid_operation +dddvi650 divideint NaN sNaN -> NaN Invalid_operation +dddvi651 divideint -Inf sNaN -> NaN Invalid_operation +dddvi652 divideint -1000 sNaN -> NaN Invalid_operation +dddvi653 divideint -1 sNaN -> NaN Invalid_operation +dddvi654 divideint -0 sNaN -> NaN Invalid_operation +dddvi655 divideint 0 sNaN -> NaN Invalid_operation +dddvi656 divideint 1 sNaN -> NaN Invalid_operation +dddvi657 divideint 1000 sNaN -> NaN Invalid_operation +dddvi658 divideint Inf sNaN -> NaN Invalid_operation +dddvi659 divideint NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dddvi661 divideint NaN9 -Inf -> NaN9 +dddvi662 divideint NaN8 1000 -> NaN8 +dddvi663 divideint NaN7 Inf -> NaN7 +dddvi664 divideint -NaN6 NaN5 -> -NaN6 +dddvi665 divideint -Inf NaN4 -> NaN4 +dddvi666 divideint -1000 NaN3 -> NaN3 +dddvi667 divideint Inf -NaN2 -> -NaN2 + +dddvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation +dddvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation +dddvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation +dddvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation +dddvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation +dddvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation +dddvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation +dddvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation +dddvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation + +-- Null tests +dddvi900 divideint 10 # -> NaN Invalid_operation +dddvi901 divideint # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddEncode.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddEncode.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,495 @@ +------------------------------------------------------------------------ +-- ddEncode.decTest -- decimal eight-byte format testcases -- +-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +-- [Previously called decimal64.decTest] +version: 2.58 + +-- This set of tests is for the eight-byte concrete representation. +-- Its characteristics are: +-- +-- 1 bit sign +-- 5 bits combination field +-- 8 bits exponent continuation +-- 50 bits coefficient continuation +-- +-- Total exponent length 10 bits +-- Total coefficient length 54 bits (16 digits) +-- +-- Elimit = 767 (maximum encoded exponent) +-- Emax = 384 (largest exponent value) +-- Emin = -383 (smallest exponent value) +-- bias = 398 (subtracted from encoded exponent) = -Etiny + +-- The testcases here have only exactly representable data on the +-- 'left-hand-side'; rounding from strings is tested in 'base' +-- testcase groups. + +extended: 1 +clamp: 1 +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +-- General testcases +-- (mostly derived from the Strawman 4 document and examples) +dece001 apply #A2300000000003D0 -> -7.50 +dece002 apply -7.50 -> #A2300000000003D0 +-- derivative canonical plain strings +dece003 apply #A23c0000000003D0 -> -7.50E+3 +dece004 apply -7.50E+3 -> #A23c0000000003D0 +dece005 apply #A2380000000003D0 -> -750 +dece006 apply -750 -> #A2380000000003D0 +dece007 apply #A2340000000003D0 -> -75.0 +dece008 apply -75.0 -> #A2340000000003D0 +dece009 apply #A22c0000000003D0 -> -0.750 +dece010 apply -0.750 -> #A22c0000000003D0 +dece011 apply #A2280000000003D0 -> -0.0750 +dece012 apply -0.0750 -> #A2280000000003D0 +dece013 apply #A2200000000003D0 -> -0.000750 +dece014 apply -0.000750 -> #A2200000000003D0 +dece015 apply #A2180000000003D0 -> -0.00000750 +dece016 apply -0.00000750 -> #A2180000000003D0 +dece017 apply #A2140000000003D0 -> -7.50E-7 +dece018 apply -7.50E-7 -> #A2140000000003D0 + +-- Normality +dece020 apply 1234567890123456 -> #263934b9c1e28e56 +dece021 apply -1234567890123456 -> #a63934b9c1e28e56 +dece022 apply 1234.567890123456 -> #260934b9c1e28e56 +dece023 apply #260934b9c1e28e56 -> 1234.567890123456 +dece024 apply 1111111111111111 -> #2638912449124491 +dece025 apply 9999999999999999 -> #6e38ff3fcff3fcff + +-- Nmax and similar +dece031 apply 9999999999999999E+369 -> #77fcff3fcff3fcff +dece032 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff +dece033 apply #77fcff3fcff3fcff -> 9.999999999999999E+384 +dece034 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56 +dece035 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384 +-- fold-downs (more below) +dece036 apply 1.23E+384 -> #47fd300000000000 Clamped +dece037 apply #47fd300000000000 -> 1.230000000000000E+384 +decd038 apply 1E+384 -> #47fc000000000000 Clamped +decd039 apply #47fc000000000000 -> 1.000000000000000E+384 + +decd051 apply 12345 -> #22380000000049c5 +decd052 apply #22380000000049c5 -> 12345 +decd053 apply 1234 -> #2238000000000534 +decd054 apply #2238000000000534 -> 1234 +decd055 apply 123 -> #22380000000000a3 +decd056 apply #22380000000000a3 -> 123 +decd057 apply 12 -> #2238000000000012 +decd058 apply #2238000000000012 -> 12 +decd059 apply 1 -> #2238000000000001 +decd060 apply #2238000000000001 -> 1 +decd061 apply 1.23 -> #22300000000000a3 +decd062 apply #22300000000000a3 -> 1.23 +decd063 apply 123.45 -> #22300000000049c5 +decd064 apply #22300000000049c5 -> 123.45 + +-- Nmin and below +decd071 apply 1E-383 -> #003c000000000001 +decd072 apply #003c000000000001 -> 1E-383 +decd073 apply 1.000000000000000E-383 -> #0400000000000000 +decd074 apply #0400000000000000 -> 1.000000000000000E-383 +decd075 apply 1.000000000000001E-383 -> #0400000000000001 +decd076 apply #0400000000000001 -> 1.000000000000001E-383 + +decd077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal +decd078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal +decd079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal +decd080 apply #0000000000000010 -> 1.0E-397 Subnormal +decd081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal +decd082 apply #0004000000000001 -> 1E-397 Subnormal +decd083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal +decd084 apply #0000000000000001 -> 1E-398 Subnormal +-- next is smallest all-nines +decd085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff +decd086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383 +-- and a problematic divide result +decd088 apply 1.111111111111111E-383 -> #0400912449124491 +decd089 apply #0400912449124491 -> 1.111111111111111E-383 + +-- forties +decd090 apply 40 -> #2238000000000040 +decd091 apply 39.99 -> #2230000000000cff + +-- underflows cannot be tested as all LHS exact + +-- Same again, negatives +-- Nmax and similar +decd122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff +decd123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384 +decd124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56 +decd125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384 +-- fold-downs (more below) +decd130 apply -1.23E+384 -> #c7fd300000000000 Clamped +decd131 apply #c7fd300000000000 -> -1.230000000000000E+384 +decd132 apply -1E+384 -> #c7fc000000000000 Clamped +decd133 apply #c7fc000000000000 -> -1.000000000000000E+384 + +-- overflows +decd151 apply -12345 -> #a2380000000049c5 +decd152 apply #a2380000000049c5 -> -12345 +decd153 apply -1234 -> #a238000000000534 +decd154 apply #a238000000000534 -> -1234 +decd155 apply -123 -> #a2380000000000a3 +decd156 apply #a2380000000000a3 -> -123 +decd157 apply -12 -> #a238000000000012 +decd158 apply #a238000000000012 -> -12 +decd159 apply -1 -> #a238000000000001 +decd160 apply #a238000000000001 -> -1 +decd161 apply -1.23 -> #a2300000000000a3 +decd162 apply #a2300000000000a3 -> -1.23 +decd163 apply -123.45 -> #a2300000000049c5 +decd164 apply #a2300000000049c5 -> -123.45 + +-- Nmin and below +decd171 apply -1E-383 -> #803c000000000001 +decd172 apply #803c000000000001 -> -1E-383 +decd173 apply -1.000000000000000E-383 -> #8400000000000000 +decd174 apply #8400000000000000 -> -1.000000000000000E-383 +decd175 apply -1.000000000000001E-383 -> #8400000000000001 +decd176 apply #8400000000000001 -> -1.000000000000001E-383 + +decd177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal +decd178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal +decd179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal +decd180 apply #8000000000000010 -> -1.0E-397 Subnormal +decd181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal +decd182 apply #8004000000000001 -> -1E-397 Subnormal +decd183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal +decd184 apply #8000000000000001 -> -1E-398 Subnormal +-- next is smallest all-nines +decd185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff +decd186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383 +-- and a tricky subnormal +decd187 apply 1.11111111111524E-384 -> #00009124491246a4 Subnormal +decd188 apply #00009124491246a4 -> 1.11111111111524E-384 Subnormal + +-- near-underflows +decd189 apply -1e-398 -> #8000000000000001 Subnormal +decd190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded + +-- zeros +decd401 apply 0E-500 -> #0000000000000000 Clamped +decd402 apply 0E-400 -> #0000000000000000 Clamped +decd403 apply 0E-398 -> #0000000000000000 +decd404 apply #0000000000000000 -> 0E-398 +decd405 apply 0.000000000000000E-383 -> #0000000000000000 +decd406 apply #0000000000000000 -> 0E-398 +decd407 apply 0E-2 -> #2230000000000000 +decd408 apply #2230000000000000 -> 0.00 +decd409 apply 0 -> #2238000000000000 +decd410 apply #2238000000000000 -> 0 +decd411 apply 0E+3 -> #2244000000000000 +decd412 apply #2244000000000000 -> 0E+3 +decd413 apply 0E+369 -> #43fc000000000000 +decd414 apply #43fc000000000000 -> 0E+369 +-- clamped zeros... +decd415 apply 0E+370 -> #43fc000000000000 Clamped +decd416 apply #43fc000000000000 -> 0E+369 +decd417 apply 0E+384 -> #43fc000000000000 Clamped +decd418 apply #43fc000000000000 -> 0E+369 +decd419 apply 0E+400 -> #43fc000000000000 Clamped +decd420 apply #43fc000000000000 -> 0E+369 +decd421 apply 0E+500 -> #43fc000000000000 Clamped +decd422 apply #43fc000000000000 -> 0E+369 + +-- negative zeros +decd431 apply -0E-400 -> #8000000000000000 Clamped +decd432 apply -0E-400 -> #8000000000000000 Clamped +decd433 apply -0E-398 -> #8000000000000000 +decd434 apply #8000000000000000 -> -0E-398 +decd435 apply -0.000000000000000E-383 -> #8000000000000000 +decd436 apply #8000000000000000 -> -0E-398 +decd437 apply -0E-2 -> #a230000000000000 +decd438 apply #a230000000000000 -> -0.00 +decd439 apply -0 -> #a238000000000000 +decd440 apply #a238000000000000 -> -0 +decd441 apply -0E+3 -> #a244000000000000 +decd442 apply #a244000000000000 -> -0E+3 +decd443 apply -0E+369 -> #c3fc000000000000 +decd444 apply #c3fc000000000000 -> -0E+369 +-- clamped zeros... +decd445 apply -0E+370 -> #c3fc000000000000 Clamped +decd446 apply #c3fc000000000000 -> -0E+369 +decd447 apply -0E+384 -> #c3fc000000000000 Clamped +decd448 apply #c3fc000000000000 -> -0E+369 +decd449 apply -0E+400 -> #c3fc000000000000 Clamped +decd450 apply #c3fc000000000000 -> -0E+369 +decd451 apply -0E+500 -> #c3fc000000000000 Clamped +decd452 apply #c3fc000000000000 -> -0E+369 + +-- exponents +decd460 apply #225c000000000007 -> 7E+9 +decd461 apply 7E+9 -> #225c000000000007 +decd462 apply #23c4000000000007 -> 7E+99 +decd463 apply 7E+99 -> #23c4000000000007 + +-- Specials +decd500 apply Infinity -> #7800000000000000 +decd501 apply #7878787878787878 -> #7800000000000000 +decd502 apply #7800000000000000 -> Infinity +decd503 apply #7979797979797979 -> #7800000000000000 +decd504 apply #7900000000000000 -> Infinity +decd505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000 +decd506 apply #7a00000000000000 -> Infinity +decd507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000 +decd508 apply #7b00000000000000 -> Infinity + +decd509 apply NaN -> #7c00000000000000 +decd510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c +decd511 apply #7c00000000000000 -> NaN +decd512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d +decd513 apply #7d00000000000000 -> NaN +decd514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e +decd515 apply #7e00000000000000 -> sNaN +decd516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f +decd517 apply #7f00000000000000 -> sNaN +decd518 apply #7fffffffffffffff -> sNaN999999999999999 +decd519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff + +decd520 apply -Infinity -> #f800000000000000 +decd521 apply #f878787878787878 -> #f800000000000000 +decd522 apply #f800000000000000 -> -Infinity +decd523 apply #f979797979797979 -> #f800000000000000 +decd524 apply #f900000000000000 -> -Infinity +decd525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000 +decd526 apply #fa00000000000000 -> -Infinity +decd527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000 +decd528 apply #fb00000000000000 -> -Infinity + +decd529 apply -NaN -> #fc00000000000000 +decd530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c +decd531 apply #fc00000000000000 -> -NaN +decd532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d +decd533 apply #fd00000000000000 -> -NaN +decd534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e +decd535 apply #fe00000000000000 -> -sNaN +decd536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f +decd537 apply #ff00000000000000 -> -sNaN +decd538 apply #ffffffffffffffff -> -sNaN999999999999999 +decd539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff + +-- diagnostic NaNs +decd540 apply NaN -> #7c00000000000000 +decd541 apply NaN0 -> #7c00000000000000 +decd542 apply NaN1 -> #7c00000000000001 +decd543 apply NaN12 -> #7c00000000000012 +decd544 apply NaN79 -> #7c00000000000079 +decd545 apply NaN12345 -> #7c000000000049c5 +decd546 apply NaN123456 -> #7c00000000028e56 +decd547 apply NaN799799 -> #7c000000000f7fdf +decd548 apply NaN799799799799799 -> #7c03dff7fdff7fdf +decd549 apply NaN999999999999999 -> #7c00ff3fcff3fcff +-- too many digits + +-- fold-down full sequence +decd601 apply 1E+384 -> #47fc000000000000 Clamped +decd602 apply #47fc000000000000 -> 1.000000000000000E+384 +decd603 apply 1E+383 -> #43fc800000000000 Clamped +decd604 apply #43fc800000000000 -> 1.00000000000000E+383 +decd605 apply 1E+382 -> #43fc100000000000 Clamped +decd606 apply #43fc100000000000 -> 1.0000000000000E+382 +decd607 apply 1E+381 -> #43fc010000000000 Clamped +decd608 apply #43fc010000000000 -> 1.000000000000E+381 +decd609 apply 1E+380 -> #43fc002000000000 Clamped +decd610 apply #43fc002000000000 -> 1.00000000000E+380 +decd611 apply 1E+379 -> #43fc000400000000 Clamped +decd612 apply #43fc000400000000 -> 1.0000000000E+379 +decd613 apply 1E+378 -> #43fc000040000000 Clamped +decd614 apply #43fc000040000000 -> 1.000000000E+378 +decd615 apply 1E+377 -> #43fc000008000000 Clamped +decd616 apply #43fc000008000000 -> 1.00000000E+377 +decd617 apply 1E+376 -> #43fc000001000000 Clamped +decd618 apply #43fc000001000000 -> 1.0000000E+376 +decd619 apply 1E+375 -> #43fc000000100000 Clamped +decd620 apply #43fc000000100000 -> 1.000000E+375 +decd621 apply 1E+374 -> #43fc000000020000 Clamped +decd622 apply #43fc000000020000 -> 1.00000E+374 +decd623 apply 1E+373 -> #43fc000000004000 Clamped +decd624 apply #43fc000000004000 -> 1.0000E+373 +decd625 apply 1E+372 -> #43fc000000000400 Clamped +decd626 apply #43fc000000000400 -> 1.000E+372 +decd627 apply 1E+371 -> #43fc000000000080 Clamped +decd628 apply #43fc000000000080 -> 1.00E+371 +decd629 apply 1E+370 -> #43fc000000000010 Clamped +decd630 apply #43fc000000000010 -> 1.0E+370 +decd631 apply 1E+369 -> #43fc000000000001 +decd632 apply #43fc000000000001 -> 1E+369 +decd633 apply 1E+368 -> #43f8000000000001 +decd634 apply #43f8000000000001 -> 1E+368 +-- same with 9s +decd641 apply 9E+384 -> #77fc000000000000 Clamped +decd642 apply #77fc000000000000 -> 9.000000000000000E+384 +decd643 apply 9E+383 -> #43fc8c0000000000 Clamped +decd644 apply #43fc8c0000000000 -> 9.00000000000000E+383 +decd645 apply 9E+382 -> #43fc1a0000000000 Clamped +decd646 apply #43fc1a0000000000 -> 9.0000000000000E+382 +decd647 apply 9E+381 -> #43fc090000000000 Clamped +decd648 apply #43fc090000000000 -> 9.000000000000E+381 +decd649 apply 9E+380 -> #43fc002300000000 Clamped +decd650 apply #43fc002300000000 -> 9.00000000000E+380 +decd651 apply 9E+379 -> #43fc000680000000 Clamped +decd652 apply #43fc000680000000 -> 9.0000000000E+379 +decd653 apply 9E+378 -> #43fc000240000000 Clamped +decd654 apply #43fc000240000000 -> 9.000000000E+378 +decd655 apply 9E+377 -> #43fc000008c00000 Clamped +decd656 apply #43fc000008c00000 -> 9.00000000E+377 +decd657 apply 9E+376 -> #43fc000001a00000 Clamped +decd658 apply #43fc000001a00000 -> 9.0000000E+376 +decd659 apply 9E+375 -> #43fc000000900000 Clamped +decd660 apply #43fc000000900000 -> 9.000000E+375 +decd661 apply 9E+374 -> #43fc000000023000 Clamped +decd662 apply #43fc000000023000 -> 9.00000E+374 +decd663 apply 9E+373 -> #43fc000000006800 Clamped +decd664 apply #43fc000000006800 -> 9.0000E+373 +decd665 apply 9E+372 -> #43fc000000002400 Clamped +decd666 apply #43fc000000002400 -> 9.000E+372 +decd667 apply 9E+371 -> #43fc00000000008c Clamped +decd668 apply #43fc00000000008c -> 9.00E+371 +decd669 apply 9E+370 -> #43fc00000000001a Clamped +decd670 apply #43fc00000000001a -> 9.0E+370 +decd671 apply 9E+369 -> #43fc000000000009 +decd672 apply #43fc000000000009 -> 9E+369 +decd673 apply 9E+368 -> #43f8000000000009 +decd674 apply #43f8000000000009 -> 9E+368 + + +-- Selected DPD codes +decd700 apply #2238000000000000 -> 0 +decd701 apply #2238000000000009 -> 9 +decd702 apply #2238000000000010 -> 10 +decd703 apply #2238000000000019 -> 19 +decd704 apply #2238000000000020 -> 20 +decd705 apply #2238000000000029 -> 29 +decd706 apply #2238000000000030 -> 30 +decd707 apply #2238000000000039 -> 39 +decd708 apply #2238000000000040 -> 40 +decd709 apply #2238000000000049 -> 49 +decd710 apply #2238000000000050 -> 50 +decd711 apply #2238000000000059 -> 59 +decd712 apply #2238000000000060 -> 60 +decd713 apply #2238000000000069 -> 69 +decd714 apply #2238000000000070 -> 70 +decd715 apply #2238000000000071 -> 71 +decd716 apply #2238000000000072 -> 72 +decd717 apply #2238000000000073 -> 73 +decd718 apply #2238000000000074 -> 74 +decd719 apply #2238000000000075 -> 75 +decd720 apply #2238000000000076 -> 76 +decd721 apply #2238000000000077 -> 77 +decd722 apply #2238000000000078 -> 78 +decd723 apply #2238000000000079 -> 79 + +decd725 apply #223800000000029e -> 994 +decd726 apply #223800000000029f -> 995 +decd727 apply #22380000000002a0 -> 520 +decd728 apply #22380000000002a1 -> 521 +-- from telco test data +decd730 apply #2238000000000188 -> 308 +decd731 apply #22380000000001a3 -> 323 +decd732 apply #223800000000002a -> 82 +decd733 apply #22380000000001a9 -> 329 +decd734 apply #2238000000000081 -> 101 +decd735 apply #22380000000002a2 -> 522 + +-- DPD: one of each of the huffman groups +decd740 apply #22380000000003f7 -> 777 +decd741 apply #22380000000003f8 -> 778 +decd742 apply #22380000000003eb -> 787 +decd743 apply #223800000000037d -> 877 +decd744 apply #223800000000039f -> 997 +decd745 apply #22380000000003bf -> 979 +decd746 apply #22380000000003df -> 799 +decd747 apply #223800000000006e -> 888 + +-- DPD all-highs cases (includes the 24 redundant codes) +decd750 apply #223800000000006e -> 888 +decd751 apply #223800000000016e -> 888 +decd752 apply #223800000000026e -> 888 +decd753 apply #223800000000036e -> 888 +decd754 apply #223800000000006f -> 889 +decd755 apply #223800000000016f -> 889 +decd756 apply #223800000000026f -> 889 +decd757 apply #223800000000036f -> 889 + +decd760 apply #223800000000007e -> 898 +decd761 apply #223800000000017e -> 898 +decd762 apply #223800000000027e -> 898 +decd763 apply #223800000000037e -> 898 +decd764 apply #223800000000007f -> 899 +decd765 apply #223800000000017f -> 899 +decd766 apply #223800000000027f -> 899 +decd767 apply #223800000000037f -> 899 + +decd770 apply #22380000000000ee -> 988 +decd771 apply #22380000000001ee -> 988 +decd772 apply #22380000000002ee -> 988 +decd773 apply #22380000000003ee -> 988 +decd774 apply #22380000000000ef -> 989 +decd775 apply #22380000000001ef -> 989 +decd776 apply #22380000000002ef -> 989 +decd777 apply #22380000000003ef -> 989 + +decd780 apply #22380000000000fe -> 998 +decd781 apply #22380000000001fe -> 998 +decd782 apply #22380000000002fe -> 998 +decd783 apply #22380000000003fe -> 998 +decd784 apply #22380000000000ff -> 999 +decd785 apply #22380000000001ff -> 999 +decd786 apply #22380000000002ff -> 999 +decd787 apply #22380000000003ff -> 999 + +-- values around [u]int32 edges (zeros done earlier) +decd800 apply -2147483646 -> #a23800008c78af46 +decd801 apply -2147483647 -> #a23800008c78af47 +decd802 apply -2147483648 -> #a23800008c78af48 +decd803 apply -2147483649 -> #a23800008c78af49 +decd804 apply 2147483646 -> #223800008c78af46 +decd805 apply 2147483647 -> #223800008c78af47 +decd806 apply 2147483648 -> #223800008c78af48 +decd807 apply 2147483649 -> #223800008c78af49 +decd808 apply 4294967294 -> #2238000115afb55a +decd809 apply 4294967295 -> #2238000115afb55b +decd810 apply 4294967296 -> #2238000115afb57a +decd811 apply 4294967297 -> #2238000115afb57b + +decd820 apply #a23800008c78af46 -> -2147483646 +decd821 apply #a23800008c78af47 -> -2147483647 +decd822 apply #a23800008c78af48 -> -2147483648 +decd823 apply #a23800008c78af49 -> -2147483649 +decd824 apply #223800008c78af46 -> 2147483646 +decd825 apply #223800008c78af47 -> 2147483647 +decd826 apply #223800008c78af48 -> 2147483648 +decd827 apply #223800008c78af49 -> 2147483649 +decd828 apply #2238000115afb55a -> 4294967294 +decd829 apply #2238000115afb55b -> 4294967295 +decd830 apply #2238000115afb57a -> 4294967296 +decd831 apply #2238000115afb57b -> 4294967297 + +-- for narrowing +decd840 apply #2870000000000000 -> 2.000000000000000E-99 + +-- some miscellaneous +decd850 apply #0004070000000000 -> 7.000000000000E-385 Subnormal +decd851 apply #0008000000020000 -> 1.00000E-391 Subnormal + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddFMA.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddFMA.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1698 @@ +------------------------------------------------------------------------ +-- ddFMA.decTest -- decDouble Fused Multiply Add -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- These tests comprese three parts: +-- 1. Sanity checks and other three-operand tests (especially those +-- where the fused operation makes a difference) +-- 2. Multiply tests (third operand is neutral zero [0E+emax]) +-- 3. Addition tests (first operand is 1) +-- The multiply and addition tests are extensive because FMA may have +-- its own dedicated multiplication or addition routine(s), and they +-- also inherently check the left-to-right properties. + +-- Sanity checks +ddfma0001 fma 1 1 1 -> 2 +ddfma0002 fma 1 1 2 -> 3 +ddfma0003 fma 2 2 3 -> 7 +ddfma0004 fma 9 9 9 -> 90 +ddfma0005 fma -1 1 1 -> 0 +ddfma0006 fma -1 1 2 -> 1 +ddfma0007 fma -2 2 3 -> -1 +ddfma0008 fma -9 9 9 -> -72 +ddfma0011 fma 1 -1 1 -> 0 +ddfma0012 fma 1 -1 2 -> 1 +ddfma0013 fma 2 -2 3 -> -1 +ddfma0014 fma 9 -9 9 -> -72 +ddfma0015 fma 1 1 -1 -> 0 +ddfma0016 fma 1 1 -2 -> -1 +ddfma0017 fma 2 2 -3 -> 1 +ddfma0018 fma 9 9 -9 -> 72 + +-- non-integer exacts +ddfma0100 fma 25.2 63.6 -438 -> 1164.72 +ddfma0101 fma 0.301 0.380 334 -> 334.114380 +ddfma0102 fma 49.2 -4.8 23.3 -> -212.86 +ddfma0103 fma 4.22 0.079 -94.6 -> -94.26662 +ddfma0104 fma 903 0.797 0.887 -> 720.578 +ddfma0105 fma 6.13 -161 65.9 -> -921.03 +ddfma0106 fma 28.2 727 5.45 -> 20506.85 +ddfma0107 fma 4 605 688 -> 3108 +ddfma0108 fma 93.3 0.19 0.226 -> 17.953 +ddfma0109 fma 0.169 -341 5.61 -> -52.019 +ddfma0110 fma -72.2 30 -51.2 -> -2217.2 +ddfma0111 fma -0.409 13 20.4 -> 15.083 +ddfma0112 fma 317 77.0 19.0 -> 24428.0 +ddfma0113 fma 47 6.58 1.62 -> 310.88 +ddfma0114 fma 1.36 0.984 0.493 -> 1.83124 +ddfma0115 fma 72.7 274 1.56 -> 19921.36 +ddfma0116 fma 335 847 83 -> 283828 +ddfma0117 fma 666 0.247 25.4 -> 189.902 +ddfma0118 fma -3.87 3.06 78.0 -> 66.1578 +ddfma0119 fma 0.742 192 35.6 -> 178.064 +ddfma0120 fma -91.6 5.29 0.153 -> -484.411 + +-- cases where result is different from separate multiply + add; each +-- is preceded by the result of unfused multiply and add +-- [this is about 20% of all similar cases in general] +-- -> 7.123356429257969E+16 +ddfma0201 fma 27583489.6645 2582471078.04 2593183.42371 -> 7.123356429257970E+16 Inexact Rounded +-- -> 22813275328.80506 +ddfma0208 fma 24280.355566 939577.397653 2032.013252 -> 22813275328.80507 Inexact Rounded +-- -> -2.030397734278062E+16 +ddfma0209 fma 7848976432 -2586831.2281 137903.517909 -> -2.030397734278061E+16 Inexact Rounded +-- -> 2040774094814.077 +ddfma0217 fma 56890.388731 35872030.4255 339337.123410 -> 2040774094814.078 Inexact Rounded +-- -> 2.714469575205049E+18 +ddfma0220 fma 7533543.57445 360317763928 5073392.31638 -> 2.714469575205050E+18 Inexact Rounded +-- -> 1.011676297716716E+19 +ddfma0223 fma 739945255.563 13672312784.1 -994381.53572 -> 1.011676297716715E+19 Inexact Rounded +-- -> -2.914135721455315E+23 +ddfma0224 fma -413510957218 704729988550 9234162614.0 -> -2.914135721455314E+23 Inexact Rounded +-- -> 2.620119863365786E+17 +ddfma0226 fma 437484.00601 598906432790 894450638.442 -> 2.620119863365787E+17 Inexact Rounded +-- -> 1.272647995808178E+19 +ddfma0253 fma 73287556929 173651305.784 -358312568.389 -> 1.272647995808177E+19 Inexact Rounded +-- -> -1.753769320861851E+18 +ddfma0257 fma 203258304486 -8628278.8066 153127.446727 -> -1.753769320861850E+18 Inexact Rounded +-- -> -1.550737835263346E+17 +ddfma0260 fma 42560533.1774 -3643605282.86 178277.96377 -> -1.550737835263347E+17 Inexact Rounded +-- -> 2.897624620576005E+22 +ddfma0269 fma 142656587375 203118879670 604576103991 -> 2.897624620576004E+22 Inexact Rounded + +-- Cases where multiply would overflow or underflow if separate +fma0300 fma 9e+384 10 0 -> Infinity Overflow Inexact Rounded +fma0301 fma 1e+384 10 0 -> Infinity Overflow Inexact Rounded +fma0302 fma 1e+384 10 -1e+384 -> 9.000000000000000E+384 Clamped +fma0303 fma 1e+384 10 -9e+384 -> 1.000000000000000E+384 Clamped +-- subnormal etc. +fma0305 fma 1e-398 0.1 0 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +fma0306 fma 1e-398 0.1 1 -> 1.000000000000000 Inexact Rounded +fma0307 fma 1e-398 0.1 1e-398 -> 1E-398 Underflow Subnormal Inexact Rounded + +-- Infinite combinations +ddfma0800 fma Inf Inf Inf -> Infinity +ddfma0801 fma Inf Inf -Inf -> NaN Invalid_operation +ddfma0802 fma Inf -Inf Inf -> NaN Invalid_operation +ddfma0803 fma Inf -Inf -Inf -> -Infinity +ddfma0804 fma -Inf Inf Inf -> NaN Invalid_operation +ddfma0805 fma -Inf Inf -Inf -> -Infinity +ddfma0806 fma -Inf -Inf Inf -> Infinity +ddfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation + +-- Triple NaN propagation +ddfma0900 fma NaN2 NaN3 NaN5 -> NaN2 +ddfma0901 fma 0 NaN3 NaN5 -> NaN3 +ddfma0902 fma 0 0 NaN5 -> NaN5 +-- first sNaN wins (consider qNaN from earlier sNaN being +-- overridden by an sNaN in third operand) +ddfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +ddfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation +ddfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation +ddfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +ddfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation +ddfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation + +-- MULTIPLICATION TESTS ------------------------------------------------ + +-- sanity checks +ddfma2000 fma 2 2 0e+384 -> 4 +ddfma2001 fma 2 3 0e+384 -> 6 +ddfma2002 fma 5 1 0e+384 -> 5 +ddfma2003 fma 5 2 0e+384 -> 10 +ddfma2004 fma 1.20 2 0e+384 -> 2.40 +ddfma2005 fma 1.20 0 0e+384 -> 0.00 +ddfma2006 fma 1.20 -2 0e+384 -> -2.40 +ddfma2007 fma -1.20 2 0e+384 -> -2.40 +ddfma2008 fma -1.20 0 0e+384 -> 0.00 +ddfma2009 fma -1.20 -2 0e+384 -> 2.40 +ddfma2010 fma 5.09 7.1 0e+384 -> 36.139 +ddfma2011 fma 2.5 4 0e+384 -> 10.0 +ddfma2012 fma 2.50 4 0e+384 -> 10.00 +ddfma2013 fma 1.23456789 1.00000000 0e+384 -> 1.234567890000000 Rounded +ddfma2015 fma 2.50 4 0e+384 -> 10.00 +ddfma2016 fma 9.999999999 9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded +ddfma2017 fma 9.999999999 -9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded +ddfma2018 fma -9.999999999 9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded +ddfma2019 fma -9.999999999 -9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded + +-- zeros, etc. +ddfma2021 fma 0 0 0e+384 -> 0 +ddfma2022 fma 0 -0 0e+384 -> 0 +ddfma2023 fma -0 0 0e+384 -> 0 +ddfma2024 fma -0 -0 0e+384 -> 0 +ddfma2025 fma -0.0 -0.0 0e+384 -> 0.00 +ddfma2026 fma -0.0 -0.0 0e+384 -> 0.00 +ddfma2027 fma -0.0 -0.0 0e+384 -> 0.00 +ddfma2028 fma -0.0 -0.0 0e+384 -> 0.00 +ddfma2030 fma 5.00 1E-3 0e+384 -> 0.00500 +ddfma2031 fma 00.00 0.000 0e+384 -> 0.00000 +ddfma2032 fma 00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0 +ddfma2033 fma 0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0 +ddfma2034 fma -5.00 1E-3 0e+384 -> -0.00500 +ddfma2035 fma -00.00 0.000 0e+384 -> 0.00000 +ddfma2036 fma -00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0 +ddfma2037 fma -0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0 +ddfma2038 fma 5.00 -1E-3 0e+384 -> -0.00500 +ddfma2039 fma 00.00 -0.000 0e+384 -> 0.00000 +ddfma2040 fma 00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0 +ddfma2041 fma 0E-3 -00.00 0e+384 -> 0.00000 -- lhs is 0 +ddfma2042 fma -5.00 -1E-3 0e+384 -> 0.00500 +ddfma2043 fma -00.00 -0.000 0e+384 -> 0.00000 +ddfma2044 fma -00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0 +ddfma2045 fma -0E-3 -00.00 -0e+384 -> 0.00000 -- lhs is 0 +ddfma2046 fma -0E-3 00.00 -0e+384 -> -0.00000 +ddfma2047 fma 0E-3 -00.00 -0e+384 -> -0.00000 +ddfma2048 fma 0E-3 00.00 -0e+384 -> 0.00000 + +-- examples from decarith +ddfma2050 fma 1.20 3 0e+384 -> 3.60 +ddfma2051 fma 7 3 0e+384 -> 21 +ddfma2052 fma 0.9 0.8 0e+384 -> 0.72 +ddfma2053 fma 0.9 -0 0e+384 -> 0.0 +ddfma2054 fma 654321 654321 0e+384 -> 428135971041 + +ddfma2060 fma 123.45 1e7 0e+384 -> 1.2345E+9 +ddfma2061 fma 123.45 1e8 0e+384 -> 1.2345E+10 +ddfma2062 fma 123.45 1e+9 0e+384 -> 1.2345E+11 +ddfma2063 fma 123.45 1e10 0e+384 -> 1.2345E+12 +ddfma2064 fma 123.45 1e11 0e+384 -> 1.2345E+13 +ddfma2065 fma 123.45 1e12 0e+384 -> 1.2345E+14 +ddfma2066 fma 123.45 1e13 0e+384 -> 1.2345E+15 + + +-- test some intermediate lengths +-- 1234567890123456 +ddfma2080 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9 +ddfma2084 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9 +ddfma2090 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9 +ddfma2094 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9 + +-- test some more edge cases and carries +ddfma2101 fma 9 9 0e+384 -> 81 +ddfma2102 fma 9 90 0e+384 -> 810 +ddfma2103 fma 9 900 0e+384 -> 8100 +ddfma2104 fma 9 9000 0e+384 -> 81000 +ddfma2105 fma 9 90000 0e+384 -> 810000 +ddfma2106 fma 9 900000 0e+384 -> 8100000 +ddfma2107 fma 9 9000000 0e+384 -> 81000000 +ddfma2108 fma 9 90000000 0e+384 -> 810000000 +ddfma2109 fma 9 900000000 0e+384 -> 8100000000 +ddfma2110 fma 9 9000000000 0e+384 -> 81000000000 +ddfma2111 fma 9 90000000000 0e+384 -> 810000000000 +ddfma2112 fma 9 900000000000 0e+384 -> 8100000000000 +ddfma2113 fma 9 9000000000000 0e+384 -> 81000000000000 +ddfma2114 fma 9 90000000000000 0e+384 -> 810000000000000 +ddfma2115 fma 9 900000000000000 0e+384 -> 8100000000000000 +--ddfma2116 fma 9 9000000000000000 0e+384 -> 81000000000000000 +--ddfma2117 fma 9 90000000000000000 0e+384 -> 810000000000000000 +--ddfma2118 fma 9 900000000000000000 0e+384 -> 8100000000000000000 +--ddfma2119 fma 9 9000000000000000000 0e+384 -> 81000000000000000000 +--ddfma2120 fma 9 90000000000000000000 0e+384 -> 810000000000000000000 +--ddfma2121 fma 9 900000000000000000000 0e+384 -> 8100000000000000000000 +--ddfma2122 fma 9 9000000000000000000000 0e+384 -> 81000000000000000000000 +--ddfma2123 fma 9 90000000000000000000000 0e+384 -> 810000000000000000000000 +-- test some more edge cases without carries +ddfma2131 fma 3 3 0e+384 -> 9 +ddfma2132 fma 3 30 0e+384 -> 90 +ddfma2133 fma 3 300 0e+384 -> 900 +ddfma2134 fma 3 3000 0e+384 -> 9000 +ddfma2135 fma 3 30000 0e+384 -> 90000 +ddfma2136 fma 3 300000 0e+384 -> 900000 +ddfma2137 fma 3 3000000 0e+384 -> 9000000 +ddfma2138 fma 3 30000000 0e+384 -> 90000000 +ddfma2139 fma 3 300000000 0e+384 -> 900000000 +ddfma2140 fma 3 3000000000 0e+384 -> 9000000000 +ddfma2141 fma 3 30000000000 0e+384 -> 90000000000 +ddfma2142 fma 3 300000000000 0e+384 -> 900000000000 +ddfma2143 fma 3 3000000000000 0e+384 -> 9000000000000 +ddfma2144 fma 3 30000000000000 0e+384 -> 90000000000000 +ddfma2145 fma 3 300000000000000 0e+384 -> 900000000000000 + +-- test some edge cases with exact rounding +ddfma2301 fma 9 9 0e+384 -> 81 +ddfma2302 fma 9 90 0e+384 -> 810 +ddfma2303 fma 9 900 0e+384 -> 8100 +ddfma2304 fma 9 9000 0e+384 -> 81000 +ddfma2305 fma 9 90000 0e+384 -> 810000 +ddfma2306 fma 9 900000 0e+384 -> 8100000 +ddfma2307 fma 9 9000000 0e+384 -> 81000000 +ddfma2308 fma 9 90000000 0e+384 -> 810000000 +ddfma2309 fma 9 900000000 0e+384 -> 8100000000 +ddfma2310 fma 9 9000000000 0e+384 -> 81000000000 +ddfma2311 fma 9 90000000000 0e+384 -> 810000000000 +ddfma2312 fma 9 900000000000 0e+384 -> 8100000000000 +ddfma2313 fma 9 9000000000000 0e+384 -> 81000000000000 +ddfma2314 fma 9 90000000000000 0e+384 -> 810000000000000 +ddfma2315 fma 9 900000000000000 0e+384 -> 8100000000000000 +ddfma2316 fma 9 9000000000000000 0e+384 -> 8.100000000000000E+16 Rounded +ddfma2317 fma 90 9000000000000000 0e+384 -> 8.100000000000000E+17 Rounded +ddfma2318 fma 900 9000000000000000 0e+384 -> 8.100000000000000E+18 Rounded +ddfma2319 fma 9000 9000000000000000 0e+384 -> 8.100000000000000E+19 Rounded +ddfma2320 fma 90000 9000000000000000 0e+384 -> 8.100000000000000E+20 Rounded +ddfma2321 fma 900000 9000000000000000 0e+384 -> 8.100000000000000E+21 Rounded +ddfma2322 fma 9000000 9000000000000000 0e+384 -> 8.100000000000000E+22 Rounded +ddfma2323 fma 90000000 9000000000000000 0e+384 -> 8.100000000000000E+23 Rounded + +-- tryzeros cases +ddfma2504 fma 0E-260 1000E-260 0e+384 -> 0E-398 Clamped +ddfma2505 fma 100E+260 0E+260 0e+384 -> 0E+369 Clamped + +-- mixed with zeros +ddfma2541 fma 0 -1 0e+384 -> 0 +ddfma2542 fma -0 -1 0e+384 -> 0 +ddfma2543 fma 0 1 0e+384 -> 0 +ddfma2544 fma -0 1 0e+384 -> 0 +ddfma2545 fma -1 0 0e+384 -> 0 +ddfma2546 fma -1 -0 0e+384 -> 0 +ddfma2547 fma 1 0 0e+384 -> 0 +ddfma2548 fma 1 -0 0e+384 -> 0 + +ddfma2551 fma 0.0 -1 0e+384 -> 0.0 +ddfma2552 fma -0.0 -1 0e+384 -> 0.0 +ddfma2553 fma 0.0 1 0e+384 -> 0.0 +ddfma2554 fma -0.0 1 0e+384 -> 0.0 +ddfma2555 fma -1.0 0 0e+384 -> 0.0 +ddfma2556 fma -1.0 -0 0e+384 -> 0.0 +ddfma2557 fma 1.0 0 0e+384 -> 0.0 +ddfma2558 fma 1.0 -0 0e+384 -> 0.0 + +ddfma2561 fma 0 -1.0 0e+384 -> 0.0 +ddfma2562 fma -0 -1.0 0e+384 -> 0.0 +ddfma2563 fma 0 1.0 0e+384 -> 0.0 +ddfma2564 fma -0 1.0 0e+384 -> 0.0 +ddfma2565 fma -1 0.0 0e+384 -> 0.0 +ddfma2566 fma -1 -0.0 0e+384 -> 0.0 +ddfma2567 fma 1 0.0 0e+384 -> 0.0 +ddfma2568 fma 1 -0.0 0e+384 -> 0.0 + +ddfma2571 fma 0.0 -1.0 0e+384 -> 0.00 +ddfma2572 fma -0.0 -1.0 0e+384 -> 0.00 +ddfma2573 fma 0.0 1.0 0e+384 -> 0.00 +ddfma2574 fma -0.0 1.0 0e+384 -> 0.00 +ddfma2575 fma -1.0 0.0 0e+384 -> 0.00 +ddfma2576 fma -1.0 -0.0 0e+384 -> 0.00 +ddfma2577 fma 1.0 0.0 0e+384 -> 0.00 +ddfma2578 fma 1.0 -0.0 0e+384 -> 0.00 + +-- Specials +ddfma2580 fma Inf -Inf 0e+384 -> -Infinity +ddfma2581 fma Inf -1000 0e+384 -> -Infinity +ddfma2582 fma Inf -1 0e+384 -> -Infinity +ddfma2583 fma Inf -0 0e+384 -> NaN Invalid_operation +ddfma2584 fma Inf 0 0e+384 -> NaN Invalid_operation +ddfma2585 fma Inf 1 0e+384 -> Infinity +ddfma2586 fma Inf 1000 0e+384 -> Infinity +ddfma2587 fma Inf Inf 0e+384 -> Infinity +ddfma2588 fma -1000 Inf 0e+384 -> -Infinity +ddfma2589 fma -Inf Inf 0e+384 -> -Infinity +ddfma2590 fma -1 Inf 0e+384 -> -Infinity +ddfma2591 fma -0 Inf 0e+384 -> NaN Invalid_operation +ddfma2592 fma 0 Inf 0e+384 -> NaN Invalid_operation +ddfma2593 fma 1 Inf 0e+384 -> Infinity +ddfma2594 fma 1000 Inf 0e+384 -> Infinity +ddfma2595 fma Inf Inf 0e+384 -> Infinity + +ddfma2600 fma -Inf -Inf 0e+384 -> Infinity +ddfma2601 fma -Inf -1000 0e+384 -> Infinity +ddfma2602 fma -Inf -1 0e+384 -> Infinity +ddfma2603 fma -Inf -0 0e+384 -> NaN Invalid_operation +ddfma2604 fma -Inf 0 0e+384 -> NaN Invalid_operation +ddfma2605 fma -Inf 1 0e+384 -> -Infinity +ddfma2606 fma -Inf 1000 0e+384 -> -Infinity +ddfma2607 fma -Inf Inf 0e+384 -> -Infinity +ddfma2608 fma -1000 Inf 0e+384 -> -Infinity +ddfma2609 fma -Inf -Inf 0e+384 -> Infinity +ddfma2610 fma -1 -Inf 0e+384 -> Infinity +ddfma2611 fma -0 -Inf 0e+384 -> NaN Invalid_operation +ddfma2612 fma 0 -Inf 0e+384 -> NaN Invalid_operation +ddfma2613 fma 1 -Inf 0e+384 -> -Infinity +ddfma2614 fma 1000 -Inf 0e+384 -> -Infinity +ddfma2615 fma Inf -Inf 0e+384 -> -Infinity + +ddfma2621 fma NaN -Inf 0e+384 -> NaN +ddfma2622 fma NaN -1000 0e+384 -> NaN +ddfma2623 fma NaN -1 0e+384 -> NaN +ddfma2624 fma NaN -0 0e+384 -> NaN +ddfma2625 fma NaN 0 0e+384 -> NaN +ddfma2626 fma NaN 1 0e+384 -> NaN +ddfma2627 fma NaN 1000 0e+384 -> NaN +ddfma2628 fma NaN Inf 0e+384 -> NaN +ddfma2629 fma NaN NaN 0e+384 -> NaN +ddfma2630 fma -Inf NaN 0e+384 -> NaN +ddfma2631 fma -1000 NaN 0e+384 -> NaN +ddfma2632 fma -1 NaN 0e+384 -> NaN +ddfma2633 fma -0 NaN 0e+384 -> NaN +ddfma2634 fma 0 NaN 0e+384 -> NaN +ddfma2635 fma 1 NaN 0e+384 -> NaN +ddfma2636 fma 1000 NaN 0e+384 -> NaN +ddfma2637 fma Inf NaN 0e+384 -> NaN + +ddfma2641 fma sNaN -Inf 0e+384 -> NaN Invalid_operation +ddfma2642 fma sNaN -1000 0e+384 -> NaN Invalid_operation +ddfma2643 fma sNaN -1 0e+384 -> NaN Invalid_operation +ddfma2644 fma sNaN -0 0e+384 -> NaN Invalid_operation +ddfma2645 fma sNaN 0 0e+384 -> NaN Invalid_operation +ddfma2646 fma sNaN 1 0e+384 -> NaN Invalid_operation +ddfma2647 fma sNaN 1000 0e+384 -> NaN Invalid_operation +ddfma2648 fma sNaN NaN 0e+384 -> NaN Invalid_operation +ddfma2649 fma sNaN sNaN 0e+384 -> NaN Invalid_operation +ddfma2650 fma NaN sNaN 0e+384 -> NaN Invalid_operation +ddfma2651 fma -Inf sNaN 0e+384 -> NaN Invalid_operation +ddfma2652 fma -1000 sNaN 0e+384 -> NaN Invalid_operation +ddfma2653 fma -1 sNaN 0e+384 -> NaN Invalid_operation +ddfma2654 fma -0 sNaN 0e+384 -> NaN Invalid_operation +ddfma2655 fma 0 sNaN 0e+384 -> NaN Invalid_operation +ddfma2656 fma 1 sNaN 0e+384 -> NaN Invalid_operation +ddfma2657 fma 1000 sNaN 0e+384 -> NaN Invalid_operation +ddfma2658 fma Inf sNaN 0e+384 -> NaN Invalid_operation +ddfma2659 fma NaN sNaN 0e+384 -> NaN Invalid_operation + +-- propagating NaNs +ddfma2661 fma NaN9 -Inf 0e+384 -> NaN9 +ddfma2662 fma NaN8 999 0e+384 -> NaN8 +ddfma2663 fma NaN71 Inf 0e+384 -> NaN71 +ddfma2664 fma NaN6 NaN5 0e+384 -> NaN6 +ddfma2665 fma -Inf NaN4 0e+384 -> NaN4 +ddfma2666 fma -999 NaN33 0e+384 -> NaN33 +ddfma2667 fma Inf NaN2 0e+384 -> NaN2 + +ddfma2671 fma sNaN99 -Inf 0e+384 -> NaN99 Invalid_operation +ddfma2672 fma sNaN98 -11 0e+384 -> NaN98 Invalid_operation +ddfma2673 fma sNaN97 NaN 0e+384 -> NaN97 Invalid_operation +ddfma2674 fma sNaN16 sNaN94 0e+384 -> NaN16 Invalid_operation +ddfma2675 fma NaN95 sNaN93 0e+384 -> NaN93 Invalid_operation +ddfma2676 fma -Inf sNaN92 0e+384 -> NaN92 Invalid_operation +ddfma2677 fma 088 sNaN91 0e+384 -> NaN91 Invalid_operation +ddfma2678 fma Inf sNaN90 0e+384 -> NaN90 Invalid_operation +ddfma2679 fma NaN sNaN89 0e+384 -> NaN89 Invalid_operation + +ddfma2681 fma -NaN9 -Inf 0e+384 -> -NaN9 +ddfma2682 fma -NaN8 999 0e+384 -> -NaN8 +ddfma2683 fma -NaN71 Inf 0e+384 -> -NaN71 +ddfma2684 fma -NaN6 -NaN5 0e+384 -> -NaN6 +ddfma2685 fma -Inf -NaN4 0e+384 -> -NaN4 +ddfma2686 fma -999 -NaN33 0e+384 -> -NaN33 +ddfma2687 fma Inf -NaN2 0e+384 -> -NaN2 + +ddfma2691 fma -sNaN99 -Inf 0e+384 -> -NaN99 Invalid_operation +ddfma2692 fma -sNaN98 -11 0e+384 -> -NaN98 Invalid_operation +ddfma2693 fma -sNaN97 NaN 0e+384 -> -NaN97 Invalid_operation +ddfma2694 fma -sNaN16 -sNaN94 0e+384 -> -NaN16 Invalid_operation +ddfma2695 fma -NaN95 -sNaN93 0e+384 -> -NaN93 Invalid_operation +ddfma2696 fma -Inf -sNaN92 0e+384 -> -NaN92 Invalid_operation +ddfma2697 fma 088 -sNaN91 0e+384 -> -NaN91 Invalid_operation +ddfma2698 fma Inf -sNaN90 0e+384 -> -NaN90 Invalid_operation +ddfma2699 fma -NaN -sNaN89 0e+384 -> -NaN89 Invalid_operation + +ddfma2701 fma -NaN -Inf 0e+384 -> -NaN +ddfma2702 fma -NaN 999 0e+384 -> -NaN +ddfma2703 fma -NaN Inf 0e+384 -> -NaN +ddfma2704 fma -NaN -NaN 0e+384 -> -NaN +ddfma2705 fma -Inf -NaN0 0e+384 -> -NaN +ddfma2706 fma -999 -NaN 0e+384 -> -NaN +ddfma2707 fma Inf -NaN 0e+384 -> -NaN + +ddfma2711 fma -sNaN -Inf 0e+384 -> -NaN Invalid_operation +ddfma2712 fma -sNaN -11 0e+384 -> -NaN Invalid_operation +ddfma2713 fma -sNaN00 NaN 0e+384 -> -NaN Invalid_operation +ddfma2714 fma -sNaN -sNaN 0e+384 -> -NaN Invalid_operation +ddfma2715 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation +ddfma2716 fma -Inf -sNaN 0e+384 -> -NaN Invalid_operation +ddfma2717 fma 088 -sNaN 0e+384 -> -NaN Invalid_operation +ddfma2718 fma Inf -sNaN 0e+384 -> -NaN Invalid_operation +ddfma2719 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +-- signs +ddfma2751 fma 1e+277 1e+311 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2752 fma 1e+277 -1e+311 0e+384 -> -Infinity Overflow Inexact Rounded +ddfma2753 fma -1e+277 1e+311 0e+384 -> -Infinity Overflow Inexact Rounded +ddfma2754 fma -1e+277 -1e+311 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2755 fma 1e-277 1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2756 fma 1e-277 -1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2757 fma -1e-277 1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2758 fma -1e-277 -1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +ddfma2760 fma 1e-291 1e-101 0e+384 -> 1E-392 Subnormal +ddfma2761 fma 1e-291 1e-102 0e+384 -> 1E-393 Subnormal +ddfma2762 fma 1e-291 1e-103 0e+384 -> 1E-394 Subnormal +ddfma2763 fma 1e-291 1e-104 0e+384 -> 1E-395 Subnormal +ddfma2764 fma 1e-291 1e-105 0e+384 -> 1E-396 Subnormal +ddfma2765 fma 1e-291 1e-106 0e+384 -> 1E-397 Subnormal +ddfma2766 fma 1e-291 1e-107 0e+384 -> 1E-398 Subnormal +ddfma2767 fma 1e-291 1e-108 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2768 fma 1e-291 1e-109 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2769 fma 1e-291 1e-110 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +ddfma2770 fma 1e+60 1e+321 0e+384 -> 1.000000000000E+381 Clamped +ddfma2771 fma 1e+60 1e+322 0e+384 -> 1.0000000000000E+382 Clamped +ddfma2772 fma 1e+60 1e+323 0e+384 -> 1.00000000000000E+383 Clamped +ddfma2773 fma 1e+60 1e+324 0e+384 -> 1.000000000000000E+384 Clamped +ddfma2774 fma 1e+60 1e+325 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2775 fma 1e+60 1e+326 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2776 fma 1e+60 1e+327 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2777 fma 1e+60 1e+328 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2778 fma 1e+60 1e+329 0e+384 -> Infinity Overflow Inexact Rounded +ddfma2779 fma 1e+60 1e+330 0e+384 -> Infinity Overflow Inexact Rounded + +ddfma2801 fma 1.0000E-394 1 0e+384 -> 1.0000E-394 Subnormal +ddfma2802 fma 1.000E-394 1e-1 0e+384 -> 1.000E-395 Subnormal +ddfma2803 fma 1.00E-394 1e-2 0e+384 -> 1.00E-396 Subnormal +ddfma2804 fma 1.0E-394 1e-3 0e+384 -> 1.0E-397 Subnormal +ddfma2805 fma 1.0E-394 1e-4 0e+384 -> 1E-398 Subnormal Rounded +ddfma2806 fma 1.3E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded +ddfma2807 fma 1.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2808 fma 1.7E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2809 fma 2.3E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2810 fma 2.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2811 fma 2.7E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded +ddfma2812 fma 1.49E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded +ddfma2813 fma 1.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2814 fma 1.51E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2815 fma 2.49E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2816 fma 2.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded +ddfma2817 fma 2.51E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded + +ddfma2818 fma 1E-394 1e-4 0e+384 -> 1E-398 Subnormal +ddfma2819 fma 3E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2820 fma 5E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2821 fma 7E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded +ddfma2822 fma 9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded +ddfma2823 fma 9.9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded + +ddfma2824 fma 1E-394 -1e-4 0e+384 -> -1E-398 Subnormal +ddfma2825 fma 3E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2826 fma -5E-394 1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2827 fma 7E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded +ddfma2828 fma -9E-394 1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded +ddfma2829 fma 9.9E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded +ddfma2830 fma 3.0E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped + +ddfma2831 fma 1.0E-199 1e-200 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddfma2832 fma 1.0E-199 1e-199 0e+384 -> 1E-398 Subnormal Rounded +ddfma2833 fma 1.0E-199 1e-198 0e+384 -> 1.0E-397 Subnormal +ddfma2834 fma 2.0E-199 2e-198 0e+384 -> 4.0E-397 Subnormal +ddfma2835 fma 4.0E-199 4e-198 0e+384 -> 1.60E-396 Subnormal +ddfma2836 fma 10.0E-199 10e-198 0e+384 -> 1.000E-395 Subnormal +ddfma2837 fma 30.0E-199 30e-198 0e+384 -> 9.000E-395 Subnormal +ddfma2838 fma 40.0E-199 40e-188 0e+384 -> 1.6000E-384 Subnormal +ddfma2839 fma 40.0E-199 40e-187 0e+384 -> 1.6000E-383 +ddfma2840 fma 40.0E-199 40e-186 0e+384 -> 1.6000E-382 + +-- Long operand overflow may be a different path +ddfma2870 fma 100 9.999E+383 0e+384 -> Infinity Inexact Overflow Rounded +ddfma2871 fma 100 -9.999E+383 0e+384 -> -Infinity Inexact Overflow Rounded +ddfma2872 fma 9.999E+383 100 0e+384 -> Infinity Inexact Overflow Rounded +ddfma2873 fma -9.999E+383 100 0e+384 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +ddfma2881 fma 1.2347E-355 1.2347E-40 0e+384 -> 1.524E-395 Inexact Rounded Subnormal Underflow +ddfma2882 fma 1.234E-355 1.234E-40 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow +ddfma2883 fma 1.23E-355 1.23E-40 0e+384 -> 1.513E-395 Inexact Rounded Subnormal Underflow +ddfma2884 fma 1.2E-355 1.2E-40 0e+384 -> 1.44E-395 Subnormal +ddfma2885 fma 1.2E-355 1.2E-41 0e+384 -> 1.44E-396 Subnormal +ddfma2886 fma 1.2E-355 1.2E-42 0e+384 -> 1.4E-397 Subnormal Inexact Rounded Underflow +ddfma2887 fma 1.2E-355 1.3E-42 0e+384 -> 1.6E-397 Subnormal Inexact Rounded Underflow +ddfma2888 fma 1.3E-355 1.3E-42 0e+384 -> 1.7E-397 Subnormal Inexact Rounded Underflow +ddfma2889 fma 1.3E-355 1.3E-43 0e+384 -> 2E-398 Subnormal Inexact Rounded Underflow +ddfma2890 fma 1.3E-356 1.3E-43 0e+384 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow + +ddfma2891 fma 1.2345E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow +ddfma2892 fma 1.23456E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow +ddfma2893 fma 1.2345E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow +ddfma2894 fma 1.23456E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow +ddfma2895 fma 1.2345E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow +ddfma2896 fma 1.23456E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +ddfma2900 fma 0.3000000000E-191 0.3000000000E-191 0e+384 -> 9.00000000000000E-384 Subnormal Rounded +ddfma2901 fma 0.3000000001E-191 0.3000000001E-191 0e+384 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded +ddfma2902 fma 9.999999999999999E-383 0.0999999999999 0e+384 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded +ddfma2903 fma 9.999999999999999E-383 0.09999999999999 0e+384 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded +ddfma2904 fma 9.999999999999999E-383 0.099999999999999 0e+384 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded +ddfma2905 fma 9.999999999999999E-383 0.0999999999999999 0e+384 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded +-- prove operands are exact +ddfma2906 fma 9.999999999999999E-383 1 0e+384 -> 9.999999999999999E-383 +ddfma2907 fma 1 0.09999999999999999 0e+384 -> 0.09999999999999999 +-- the next rounds to Nmin +ddfma2908 fma 9.999999999999999E-383 0.09999999999999999 0e+384 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- hugest +ddfma2909 fma 9999999999999999 9999999999999999 0e+384 -> 9.999999999999998E+31 Inexact Rounded + +-- Null tests +ddfma2990 fma 10 # 0e+384 -> NaN Invalid_operation +ddfma2991 fma # 10 0e+384 -> NaN Invalid_operation + + +-- ADDITION TESTS ------------------------------------------------------ + +-- [first group are 'quick confidence check'] +ddfma3001 fma 1 1 1 -> 2 +ddfma3002 fma 1 2 3 -> 5 +ddfma3003 fma 1 '5.75' '3.3' -> 9.05 +ddfma3004 fma 1 '5' '-3' -> 2 +ddfma3005 fma 1 '-5' '-3' -> -8 +ddfma3006 fma 1 '-7' '2.5' -> -4.5 +ddfma3007 fma 1 '0.7' '0.3' -> 1.0 +ddfma3008 fma 1 '1.25' '1.25' -> 2.50 +ddfma3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789' +ddfma3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800' + +-- 1234567890123456 1234567890123456 +ddfma3011 fma 1 '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded +ddfma3012 fma 1 '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded +ddfma3013 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999' +ddfma3014 fma 1 '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded +ddfma3015 fma 1 '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded +ddfma3016 fma 1 '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded +ddfma3017 fma 1 '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded +ddfma3018 fma 1 '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded +ddfma3019 fma 1 '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded +ddfma3020 fma 1 '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded + +ddfma3021 fma 1 0 1 -> 1 +ddfma3022 fma 1 1 1 -> 2 +ddfma3023 fma 1 2 1 -> 3 +ddfma3024 fma 1 3 1 -> 4 +ddfma3025 fma 1 4 1 -> 5 +ddfma3026 fma 1 5 1 -> 6 +ddfma3027 fma 1 6 1 -> 7 +ddfma3028 fma 1 7 1 -> 8 +ddfma3029 fma 1 8 1 -> 9 +ddfma3030 fma 1 9 1 -> 10 + +-- some carrying effects +ddfma3031 fma 1 '0.9998' '0.0000' -> '0.9998' +ddfma3032 fma 1 '0.9998' '0.0001' -> '0.9999' +ddfma3033 fma 1 '0.9998' '0.0002' -> '1.0000' +ddfma3034 fma 1 '0.9998' '0.0003' -> '1.0001' + +ddfma3035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +ddfma3036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +ddfma3037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +ddfma3038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded +ddfma3039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded + +-- symmetry: +ddfma3040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded +ddfma3041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded +ddfma3042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded +ddfma3044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded +ddfma3045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded + +-- same, without rounding +ddfma3046 fma 1 '10000e+9' '7' -> '10000000000007' +ddfma3047 fma 1 '10000e+9' '70' -> '10000000000070' +ddfma3048 fma 1 '10000e+9' '700' -> '10000000000700' +ddfma3049 fma 1 '10000e+9' '7000' -> '10000000007000' +ddfma3050 fma 1 '10000e+9' '70000' -> '10000000070000' +ddfma3051 fma 1 '10000e+9' '700000' -> '10000000700000' +ddfma3052 fma 1 '10000e+9' '7000000' -> '10000007000000' + +-- examples from decarith +ddfma3053 fma 1 '12' '7.00' -> '19.00' +ddfma3054 fma 1 '1.3' '-1.07' -> '0.23' +ddfma3055 fma 1 '1.3' '-1.30' -> '0.00' +ddfma3056 fma 1 '1.3' '-2.07' -> '-0.77' +ddfma3057 fma 1 '1E+2' '1E+4' -> '1.01E+4' + +-- leading zero preservation +ddfma3061 fma 1 1 '0.0001' -> '1.0001' +ddfma3062 fma 1 1 '0.00001' -> '1.00001' +ddfma3063 fma 1 1 '0.000001' -> '1.000001' +ddfma3064 fma 1 1 '0.0000001' -> '1.0000001' +ddfma3065 fma 1 1 '0.00000001' -> '1.00000001' + +-- some funny zeros [in case of bad signum] +ddfma3070 fma 1 1 0 -> 1 +ddfma3071 fma 1 1 0. -> 1 +ddfma3072 fma 1 1 .0 -> 1.0 +ddfma3073 fma 1 1 0.0 -> 1.0 +ddfma3074 fma 1 1 0.00 -> 1.00 +ddfma3075 fma 1 0 1 -> 1 +ddfma3076 fma 1 0. 1 -> 1 +ddfma3077 fma 1 .0 1 -> 1.0 +ddfma3078 fma 1 0.0 1 -> 1.0 +ddfma3079 fma 1 0.00 1 -> 1.00 + +-- some carries +ddfma3080 fma 1 999999998 1 -> 999999999 +ddfma3081 fma 1 999999999 1 -> 1000000000 +ddfma3082 fma 1 99999999 1 -> 100000000 +ddfma3083 fma 1 9999999 1 -> 10000000 +ddfma3084 fma 1 999999 1 -> 1000000 +ddfma3085 fma 1 99999 1 -> 100000 +ddfma3086 fma 1 9999 1 -> 10000 +ddfma3087 fma 1 999 1 -> 1000 +ddfma3088 fma 1 99 1 -> 100 +ddfma3089 fma 1 9 1 -> 10 + + +-- more LHS swaps +ddfma3090 fma 1 '-56267E-10' 0 -> '-0.0000056267' +ddfma3091 fma 1 '-56267E-6' 0 -> '-0.056267' +ddfma3092 fma 1 '-56267E-5' 0 -> '-0.56267' +ddfma3093 fma 1 '-56267E-4' 0 -> '-5.6267' +ddfma3094 fma 1 '-56267E-3' 0 -> '-56.267' +ddfma3095 fma 1 '-56267E-2' 0 -> '-562.67' +ddfma3096 fma 1 '-56267E-1' 0 -> '-5626.7' +ddfma3097 fma 1 '-56267E-0' 0 -> '-56267' +ddfma3098 fma 1 '-5E-10' 0 -> '-5E-10' +ddfma3099 fma 1 '-5E-7' 0 -> '-5E-7' +ddfma3100 fma 1 '-5E-6' 0 -> '-0.000005' +ddfma3101 fma 1 '-5E-5' 0 -> '-0.00005' +ddfma3102 fma 1 '-5E-4' 0 -> '-0.0005' +ddfma3103 fma 1 '-5E-1' 0 -> '-0.5' +ddfma3104 fma 1 '-5E0' 0 -> '-5' +ddfma3105 fma 1 '-5E1' 0 -> '-50' +ddfma3106 fma 1 '-5E5' 0 -> '-500000' +ddfma3107 fma 1 '-5E15' 0 -> '-5000000000000000' +ddfma3108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded +ddfma3109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded +ddfma3110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded +ddfma3111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded + +-- more RHS swaps +ddfma3113 fma 1 0 '-56267E-10' -> '-0.0000056267' +ddfma3114 fma 1 0 '-56267E-6' -> '-0.056267' +ddfma3116 fma 1 0 '-56267E-5' -> '-0.56267' +ddfma3117 fma 1 0 '-56267E-4' -> '-5.6267' +ddfma3119 fma 1 0 '-56267E-3' -> '-56.267' +ddfma3120 fma 1 0 '-56267E-2' -> '-562.67' +ddfma3121 fma 1 0 '-56267E-1' -> '-5626.7' +ddfma3122 fma 1 0 '-56267E-0' -> '-56267' +ddfma3123 fma 1 0 '-5E-10' -> '-5E-10' +ddfma3124 fma 1 0 '-5E-7' -> '-5E-7' +ddfma3125 fma 1 0 '-5E-6' -> '-0.000005' +ddfma3126 fma 1 0 '-5E-5' -> '-0.00005' +ddfma3127 fma 1 0 '-5E-4' -> '-0.0005' +ddfma3128 fma 1 0 '-5E-1' -> '-0.5' +ddfma3129 fma 1 0 '-5E0' -> '-5' +ddfma3130 fma 1 0 '-5E1' -> '-50' +ddfma3131 fma 1 0 '-5E5' -> '-500000' +ddfma3132 fma 1 0 '-5E15' -> '-5000000000000000' +ddfma3133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded +ddfma3134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded +ddfma3135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded +ddfma3136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded + +-- related +ddfma3137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded +ddfma3138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded +ddfma3139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded +ddfma3140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded +ddfma3141 fma 1 1E+11 0.0000 -> '100000000000.0000' +ddfma3142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded +ddfma3143 fma 1 0.000 1E+12 -> '1000000000000.000' +ddfma3144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +ddfma3146 fma 1 '00.0' 0 -> '0.0' +ddfma3147 fma 1 '0.00' 0 -> '0.00' +ddfma3148 fma 1 0 '0.00' -> '0.00' +ddfma3149 fma 1 0 '00.0' -> '0.0' +ddfma3150 fma 1 '00.0' '0.00' -> '0.00' +ddfma3151 fma 1 '0.00' '00.0' -> '0.00' +ddfma3152 fma 1 '3' '.3' -> '3.3' +ddfma3153 fma 1 '3.' '.3' -> '3.3' +ddfma3154 fma 1 '3.0' '.3' -> '3.3' +ddfma3155 fma 1 '3.00' '.3' -> '3.30' +ddfma3156 fma 1 '3' '3' -> '6' +ddfma3157 fma 1 '3' '+3' -> '6' +ddfma3158 fma 1 '3' '-3' -> '0' +ddfma3159 fma 1 '0.3' '-0.3' -> '0.0' +ddfma3160 fma 1 '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +ddfma3161 fma 1 '1E+12' '-1' -> '999999999999' +ddfma3162 fma 1 '1E+12' '1.11' -> '1000000000001.11' +ddfma3163 fma 1 '1.11' '1E+12' -> '1000000000001.11' +ddfma3164 fma 1 '-1' '1E+12' -> '999999999999' +ddfma3165 fma 1 '7E+12' '-1' -> '6999999999999' +ddfma3166 fma 1 '7E+12' '1.11' -> '7000000000001.11' +ddfma3167 fma 1 '1.11' '7E+12' -> '7000000000001.11' +ddfma3168 fma 1 '-1' '7E+12' -> '6999999999999' + +rounding: half_up +-- 1.234567890123456 1234567890123456 1 234567890123456 +ddfma3170 fma 1 '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded +ddfma3171 fma 1 '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded +ddfma3172 fma 1 '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded +ddfma3173 fma 1 '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded +ddfma3174 fma 1 '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded +ddfma3175 fma 1 '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded +ddfma3176 fma 1 '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded +ddfma3177 fma 1 '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded +ddfma3178 fma 1 '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded +ddfma3179 fma 1 '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded +ddfma3180 fma 1 '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded +ddfma3181 fma 1 '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded +ddfma3182 fma 1 '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded +ddfma3183 fma 1 '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded + +-- and some more, including residue effects and different roundings +rounding: half_up +ddfma3200 fma 1 '1234560123456789' 0 -> '1234560123456789' +ddfma3201 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded +ddfma3202 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded +ddfma3203 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded +ddfma3204 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded +ddfma3205 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded +ddfma3206 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded +ddfma3207 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded +ddfma3208 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded +ddfma3209 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded +ddfma3210 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded +ddfma3211 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded +ddfma3212 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded +ddfma3213 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded +ddfma3214 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded +ddfma3215 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded +ddfma3216 fma 1 '1234560123456789' 1 -> '1234560123456790' +ddfma3217 fma 1 '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded +ddfma3218 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded +ddfma3219 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded + +rounding: half_even +ddfma3220 fma 1 '1234560123456789' 0 -> '1234560123456789' +ddfma3221 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded +ddfma3222 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded +ddfma3223 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded +ddfma3224 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded +ddfma3225 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded +ddfma3226 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded +ddfma3227 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded +ddfma3228 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded +ddfma3229 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded +ddfma3230 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded +ddfma3231 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded +ddfma3232 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded +ddfma3233 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded +ddfma3234 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded +ddfma3235 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded +ddfma3236 fma 1 '1234560123456789' 1 -> '1234560123456790' +ddfma3237 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded +ddfma3238 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded +ddfma3239 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded +-- critical few with even bottom digit... +ddfma3240 fma 1 '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded +ddfma3241 fma 1 '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded +ddfma3242 fma 1 '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded + +rounding: down +ddfma3250 fma 1 '1234560123456789' 0 -> '1234560123456789' +ddfma3251 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded +ddfma3252 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded +ddfma3253 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded +ddfma3254 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded +ddfma3255 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded +ddfma3256 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded +ddfma3257 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded +ddfma3258 fma 1 '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded +ddfma3259 fma 1 '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded +ddfma3260 fma 1 '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded +ddfma3261 fma 1 '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded +ddfma3262 fma 1 '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded +ddfma3263 fma 1 '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded +ddfma3264 fma 1 '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded +ddfma3265 fma 1 '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded +ddfma3266 fma 1 '1234560123456789' 1 -> '1234560123456790' +ddfma3267 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded +ddfma3268 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded +ddfma3269 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +ddfma3301 fma 1 -1 1 -> 0 +ddfma3302 fma 1 0 1 -> 1 +ddfma3303 fma 1 1 1 -> 2 +ddfma3304 fma 1 12 1 -> 13 +ddfma3305 fma 1 98 1 -> 99 +ddfma3306 fma 1 99 1 -> 100 +ddfma3307 fma 1 100 1 -> 101 +ddfma3308 fma 1 101 1 -> 102 +ddfma3309 fma 1 -1 -1 -> -2 +ddfma3310 fma 1 0 -1 -> -1 +ddfma3311 fma 1 1 -1 -> 0 +ddfma3312 fma 1 12 -1 -> 11 +ddfma3313 fma 1 98 -1 -> 97 +ddfma3314 fma 1 99 -1 -> 98 +ddfma3315 fma 1 100 -1 -> 99 +ddfma3316 fma 1 101 -1 -> 100 + +ddfma3321 fma 1 -0.01 0.01 -> 0.00 +ddfma3322 fma 1 0.00 0.01 -> 0.01 +ddfma3323 fma 1 0.01 0.01 -> 0.02 +ddfma3324 fma 1 0.12 0.01 -> 0.13 +ddfma3325 fma 1 0.98 0.01 -> 0.99 +ddfma3326 fma 1 0.99 0.01 -> 1.00 +ddfma3327 fma 1 1.00 0.01 -> 1.01 +ddfma3328 fma 1 1.01 0.01 -> 1.02 +ddfma3329 fma 1 -0.01 -0.01 -> -0.02 +ddfma3330 fma 1 0.00 -0.01 -> -0.01 +ddfma3331 fma 1 0.01 -0.01 -> 0.00 +ddfma3332 fma 1 0.12 -0.01 -> 0.11 +ddfma3333 fma 1 0.98 -0.01 -> 0.97 +ddfma3334 fma 1 0.99 -0.01 -> 0.98 +ddfma3335 fma 1 1.00 -0.01 -> 0.99 +ddfma3336 fma 1 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +ddfma3340 fma 1 1E+3 0 -> 1000 +ddfma3341 fma 1 1E+15 0 -> 1000000000000000 +ddfma3342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded +ddfma3343 fma 1 1E+20 0 -> 1.000000000000000E+20 Rounded +-- which simply follow from these cases ... +ddfma3344 fma 1 1E+3 1 -> 1001 +ddfma3345 fma 1 1E+15 1 -> 1000000000000001 +ddfma3346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded +ddfma3347 fma 1 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded +ddfma3348 fma 1 1E+3 7 -> 1007 +ddfma3349 fma 1 1E+15 7 -> 1000000000000007 +ddfma3350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded +ddfma3351 fma 1 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded + +-- tryzeros cases +rounding: half_up +ddfma3360 fma 1 0E+50 10000E+1 -> 1.0000E+5 +ddfma3361 fma 1 0E-50 10000E+1 -> 100000.0000000000 Rounded +ddfma3362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded +ddfma3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact +ddfma3364 fma 1 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369 + +-- a curiosity from JSR 13 testing +rounding: half_down +ddfma3370 fma 1 999999999999999 815 -> 1000000000000814 +ddfma3371 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact +rounding: half_up +ddfma3372 fma 1 999999999999999 815 -> 1000000000000814 +ddfma3373 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact +rounding: half_even +ddfma3374 fma 1 999999999999999 815 -> 1000000000000814 +ddfma3375 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact + +-- ulp replacement tests +ddfma3400 fma 1 1 77e-14 -> 1.00000000000077 +ddfma3401 fma 1 1 77e-15 -> 1.000000000000077 +ddfma3402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded +ddfma3403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded +ddfma3404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded +ddfma3405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded +ddfma3406 fma 1 1 77e-299 -> 1.000000000000000 Inexact Rounded + +ddfma3410 fma 1 10 77e-14 -> 10.00000000000077 +ddfma3411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded +ddfma3412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded +ddfma3413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded +ddfma3414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded +ddfma3415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded +ddfma3416 fma 1 10 77e-299 -> 10.00000000000000 Inexact Rounded + +ddfma3420 fma 1 77e-14 1 -> 1.00000000000077 +ddfma3421 fma 1 77e-15 1 -> 1.000000000000077 +ddfma3422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded +ddfma3423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded +ddfma3424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded +ddfma3425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded +ddfma3426 fma 1 77e-299 1 -> 1.000000000000000 Inexact Rounded + +ddfma3430 fma 1 77e-14 10 -> 10.00000000000077 +ddfma3431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded +ddfma3432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded +ddfma3433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded +ddfma3434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded +ddfma3435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded +ddfma3436 fma 1 77e-299 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +ddfma36440 fma 1 1 -77e-14 -> 0.99999999999923 +ddfma36441 fma 1 1 -77e-15 -> 0.999999999999923 +ddfma36442 fma 1 1 -77e-16 -> 0.9999999999999923 +ddfma36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded +ddfma36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded +ddfma36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded +ddfma36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded + +ddfma36450 fma 1 10 -77e-14 -> 9.99999999999923 +ddfma36451 fma 1 10 -77e-15 -> 9.999999999999923 +ddfma36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded +ddfma36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded +ddfma36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded +ddfma36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded +ddfma36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded + +ddfma36460 fma 1 -77e-14 1 -> 0.99999999999923 +ddfma36461 fma 1 -77e-15 1 -> 0.999999999999923 +ddfma36462 fma 1 -77e-16 1 -> 0.9999999999999923 +ddfma36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded +ddfma36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded +ddfma36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded +ddfma36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded + +ddfma36470 fma 1 -77e-14 10 -> 9.99999999999923 +ddfma36471 fma 1 -77e-15 10 -> 9.999999999999923 +ddfma36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded +ddfma36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded +ddfma36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded +ddfma36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded +ddfma36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +ddfma36480 fma 1 -1 77e-14 -> -0.99999999999923 +ddfma36481 fma 1 -1 77e-15 -> -0.999999999999923 +ddfma36482 fma 1 -1 77e-16 -> -0.9999999999999923 +ddfma36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded +ddfma36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded +ddfma36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded +ddfma36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded + +ddfma36490 fma 1 -10 77e-14 -> -9.99999999999923 +ddfma36491 fma 1 -10 77e-15 -> -9.999999999999923 +ddfma36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded +ddfma36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded +ddfma36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded +ddfma36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded +ddfma36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded + +ddfma36500 fma 1 77e-14 -1 -> -0.99999999999923 +ddfma36501 fma 1 77e-15 -1 -> -0.999999999999923 +ddfma36502 fma 1 77e-16 -1 -> -0.9999999999999923 +ddfma36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded +ddfma36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded +ddfma36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded +ddfma36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded + +ddfma36510 fma 1 77e-14 -10 -> -9.99999999999923 +ddfma36511 fma 1 77e-15 -10 -> -9.999999999999923 +ddfma36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded +ddfma36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded +ddfma36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded +ddfma36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded +ddfma36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded + +-- and a couple more with longer RHS +ddfma36520 fma 1 1 -7777e-16 -> 0.9999999999992223 +ddfma36521 fma 1 1 -7777e-17 -> 0.9999999999999222 Inexact Rounded +ddfma36522 fma 1 1 -7777e-18 -> 0.9999999999999922 Inexact Rounded +ddfma36523 fma 1 1 -7777e-19 -> 0.9999999999999992 Inexact Rounded +ddfma36524 fma 1 1 -7777e-20 -> 0.9999999999999999 Inexact Rounded +ddfma36525 fma 1 1 -7777e-21 -> 1.000000000000000 Inexact Rounded +ddfma36526 fma 1 1 -7777e-22 -> 1.000000000000000 Inexact Rounded + + +-- and some more residue effects and different roundings +rounding: half_up +ddfma36540 fma 1 '6543210123456789' 0 -> '6543210123456789' +ddfma36541 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +ddfma36542 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +ddfma36543 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +ddfma36544 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +ddfma36545 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +ddfma36546 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +ddfma36547 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +ddfma36548 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +ddfma36549 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +ddfma36550 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +ddfma36551 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +ddfma36552 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +ddfma36553 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +ddfma36554 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +ddfma36555 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +ddfma36556 fma 1 '6543210123456789' 1 -> '6543210123456790' +ddfma36557 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded +ddfma36558 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +ddfma36559 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +rounding: half_even +ddfma36560 fma 1 '6543210123456789' 0 -> '6543210123456789' +ddfma36561 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +ddfma36562 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +ddfma36563 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +ddfma36564 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +ddfma36565 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +ddfma36566 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +ddfma36567 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +ddfma36568 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +ddfma36569 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +ddfma36570 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +ddfma36571 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +ddfma36572 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +ddfma36573 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +ddfma36574 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +ddfma36575 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +ddfma36576 fma 1 '6543210123456789' 1 -> '6543210123456790' +ddfma36577 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +ddfma36578 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +ddfma36579 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +-- critical few with even bottom digit... +ddfma37540 fma 1 '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded +ddfma37541 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded +ddfma37542 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded + +rounding: down +ddfma37550 fma 1 '6543210123456789' 0 -> '6543210123456789' +ddfma37551 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +ddfma37552 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +ddfma37553 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +ddfma37554 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +ddfma37555 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +ddfma37556 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +ddfma37557 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +ddfma37558 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded +ddfma37559 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded +ddfma37560 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded +ddfma37561 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded +ddfma37562 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded +ddfma37563 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded +ddfma37564 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded +ddfma37565 fma 1 '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded +ddfma37566 fma 1 '6543210123456789' 1 -> '6543210123456790' +ddfma37567 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +ddfma37568 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +ddfma37569 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + + +-- verify a query +rounding: down +ddfma37661 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +ddfma37662 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +ddfma37663 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +ddfma37664 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + +-- more zeros, etc. +rounding: half_even + +ddfma37701 fma 1 5.00 1.00E-3 -> 5.00100 +ddfma37702 fma 1 00.00 0.000 -> 0.000 +ddfma37703 fma 1 00.00 0E-3 -> 0.000 +ddfma37704 fma 1 0E-3 00.00 -> 0.000 + +ddfma37710 fma 1 0E+3 00.00 -> 0.00 +ddfma37711 fma 1 0E+3 00.0 -> 0.0 +ddfma37712 fma 1 0E+3 00. -> 0 +ddfma37713 fma 1 0E+3 00.E+1 -> 0E+1 +ddfma37714 fma 1 0E+3 00.E+2 -> 0E+2 +ddfma37715 fma 1 0E+3 00.E+3 -> 0E+3 +ddfma37716 fma 1 0E+3 00.E+4 -> 0E+3 +ddfma37717 fma 1 0E+3 00.E+5 -> 0E+3 +ddfma37718 fma 1 0E+3 -00.0 -> 0.0 +ddfma37719 fma 1 0E+3 -00. -> 0 +ddfma37731 fma 1 0E+3 -00.E+1 -> 0E+1 + +ddfma37720 fma 1 00.00 0E+3 -> 0.00 +ddfma37721 fma 1 00.0 0E+3 -> 0.0 +ddfma37722 fma 1 00. 0E+3 -> 0 +ddfma37723 fma 1 00.E+1 0E+3 -> 0E+1 +ddfma37724 fma 1 00.E+2 0E+3 -> 0E+2 +ddfma37725 fma 1 00.E+3 0E+3 -> 0E+3 +ddfma37726 fma 1 00.E+4 0E+3 -> 0E+3 +ddfma37727 fma 1 00.E+5 0E+3 -> 0E+3 +ddfma37728 fma 1 -00.00 0E+3 -> 0.00 +ddfma37729 fma 1 -00.0 0E+3 -> 0.0 +ddfma37730 fma 1 -00. 0E+3 -> 0 + +ddfma37732 fma 1 0 0 -> 0 +ddfma37733 fma 1 0 -0 -> 0 +ddfma37734 fma 1 -0 0 -> 0 +ddfma37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case + +ddfma37736 fma 1 1 -1 -> 0 +ddfma37737 fma 1 -1 -1 -> -2 +ddfma37738 fma 1 1 1 -> 2 +ddfma37739 fma 1 -1 1 -> 0 + +ddfma37741 fma 1 0 -1 -> -1 +ddfma37742 fma 1 -0 -1 -> -1 +ddfma37743 fma 1 0 1 -> 1 +ddfma37744 fma 1 -0 1 -> 1 +ddfma37745 fma 1 -1 0 -> -1 +ddfma37746 fma 1 -1 -0 -> -1 +ddfma37747 fma 1 1 0 -> 1 +ddfma37748 fma 1 1 -0 -> 1 + +ddfma37751 fma 1 0.0 -1 -> -1.0 +ddfma37752 fma 1 -0.0 -1 -> -1.0 +ddfma37753 fma 1 0.0 1 -> 1.0 +ddfma37754 fma 1 -0.0 1 -> 1.0 +ddfma37755 fma 1 -1.0 0 -> -1.0 +ddfma37756 fma 1 -1.0 -0 -> -1.0 +ddfma37757 fma 1 1.0 0 -> 1.0 +ddfma37758 fma 1 1.0 -0 -> 1.0 + +ddfma37761 fma 1 0 -1.0 -> -1.0 +ddfma37762 fma 1 -0 -1.0 -> -1.0 +ddfma37763 fma 1 0 1.0 -> 1.0 +ddfma37764 fma 1 -0 1.0 -> 1.0 +ddfma37765 fma 1 -1 0.0 -> -1.0 +ddfma37766 fma 1 -1 -0.0 -> -1.0 +ddfma37767 fma 1 1 0.0 -> 1.0 +ddfma37768 fma 1 1 -0.0 -> 1.0 + +ddfma37771 fma 1 0.0 -1.0 -> -1.0 +ddfma37772 fma 1 -0.0 -1.0 -> -1.0 +ddfma37773 fma 1 0.0 1.0 -> 1.0 +ddfma37774 fma 1 -0.0 1.0 -> 1.0 +ddfma37775 fma 1 -1.0 0.0 -> -1.0 +ddfma37776 fma 1 -1.0 -0.0 -> -1.0 +ddfma37777 fma 1 1.0 0.0 -> 1.0 +ddfma37778 fma 1 1.0 -0.0 -> 1.0 + +-- Specials +ddfma37780 fma 1 -Inf -Inf -> -Infinity +ddfma37781 fma 1 -Inf -1000 -> -Infinity +ddfma37782 fma 1 -Inf -1 -> -Infinity +ddfma37783 fma 1 -Inf -0 -> -Infinity +ddfma37784 fma 1 -Inf 0 -> -Infinity +ddfma37785 fma 1 -Inf 1 -> -Infinity +ddfma37786 fma 1 -Inf 1000 -> -Infinity +ddfma37787 fma 1 -1000 -Inf -> -Infinity +ddfma37788 fma 1 -Inf -Inf -> -Infinity +ddfma37789 fma 1 -1 -Inf -> -Infinity +ddfma37790 fma 1 -0 -Inf -> -Infinity +ddfma37791 fma 1 0 -Inf -> -Infinity +ddfma37792 fma 1 1 -Inf -> -Infinity +ddfma37793 fma 1 1000 -Inf -> -Infinity +ddfma37794 fma 1 Inf -Inf -> NaN Invalid_operation + +ddfma37800 fma 1 Inf -Inf -> NaN Invalid_operation +ddfma37801 fma 1 Inf -1000 -> Infinity +ddfma37802 fma 1 Inf -1 -> Infinity +ddfma37803 fma 1 Inf -0 -> Infinity +ddfma37804 fma 1 Inf 0 -> Infinity +ddfma37805 fma 1 Inf 1 -> Infinity +ddfma37806 fma 1 Inf 1000 -> Infinity +ddfma37807 fma 1 Inf Inf -> Infinity +ddfma37808 fma 1 -1000 Inf -> Infinity +ddfma37809 fma 1 -Inf Inf -> NaN Invalid_operation +ddfma37810 fma 1 -1 Inf -> Infinity +ddfma37811 fma 1 -0 Inf -> Infinity +ddfma37812 fma 1 0 Inf -> Infinity +ddfma37813 fma 1 1 Inf -> Infinity +ddfma37814 fma 1 1000 Inf -> Infinity +ddfma37815 fma 1 Inf Inf -> Infinity + +ddfma37821 fma 1 NaN -Inf -> NaN +ddfma37822 fma 1 NaN -1000 -> NaN +ddfma37823 fma 1 NaN -1 -> NaN +ddfma37824 fma 1 NaN -0 -> NaN +ddfma37825 fma 1 NaN 0 -> NaN +ddfma37826 fma 1 NaN 1 -> NaN +ddfma37827 fma 1 NaN 1000 -> NaN +ddfma37828 fma 1 NaN Inf -> NaN +ddfma37829 fma 1 NaN NaN -> NaN +ddfma37830 fma 1 -Inf NaN -> NaN +ddfma37831 fma 1 -1000 NaN -> NaN +ddfma37832 fma 1 -1 NaN -> NaN +ddfma37833 fma 1 -0 NaN -> NaN +ddfma37834 fma 1 0 NaN -> NaN +ddfma37835 fma 1 1 NaN -> NaN +ddfma37836 fma 1 1000 NaN -> NaN +ddfma37837 fma 1 Inf NaN -> NaN + +ddfma37841 fma 1 sNaN -Inf -> NaN Invalid_operation +ddfma37842 fma 1 sNaN -1000 -> NaN Invalid_operation +ddfma37843 fma 1 sNaN -1 -> NaN Invalid_operation +ddfma37844 fma 1 sNaN -0 -> NaN Invalid_operation +ddfma37845 fma 1 sNaN 0 -> NaN Invalid_operation +ddfma37846 fma 1 sNaN 1 -> NaN Invalid_operation +ddfma37847 fma 1 sNaN 1000 -> NaN Invalid_operation +ddfma37848 fma 1 sNaN NaN -> NaN Invalid_operation +ddfma37849 fma 1 sNaN sNaN -> NaN Invalid_operation +ddfma37850 fma 1 NaN sNaN -> NaN Invalid_operation +ddfma37851 fma 1 -Inf sNaN -> NaN Invalid_operation +ddfma37852 fma 1 -1000 sNaN -> NaN Invalid_operation +ddfma37853 fma 1 -1 sNaN -> NaN Invalid_operation +ddfma37854 fma 1 -0 sNaN -> NaN Invalid_operation +ddfma37855 fma 1 0 sNaN -> NaN Invalid_operation +ddfma37856 fma 1 1 sNaN -> NaN Invalid_operation +ddfma37857 fma 1 1000 sNaN -> NaN Invalid_operation +ddfma37858 fma 1 Inf sNaN -> NaN Invalid_operation +ddfma37859 fma 1 NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddfma37861 fma 1 NaN1 -Inf -> NaN1 +ddfma37862 fma 1 +NaN2 -1000 -> NaN2 +ddfma37863 fma 1 NaN3 1000 -> NaN3 +ddfma37864 fma 1 NaN4 Inf -> NaN4 +ddfma37865 fma 1 NaN5 +NaN6 -> NaN5 +ddfma37866 fma 1 -Inf NaN7 -> NaN7 +ddfma37867 fma 1 -1000 NaN8 -> NaN8 +ddfma37868 fma 1 1000 NaN9 -> NaN9 +ddfma37869 fma 1 Inf +NaN10 -> NaN10 +ddfma37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation +ddfma37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation +ddfma37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation +ddfma37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation +ddfma37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation +ddfma37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation +ddfma37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation +ddfma37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation +ddfma37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation +ddfma37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation +ddfma37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation +ddfma37882 fma 1 -NaN26 NaN28 -> -NaN26 +ddfma37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation +ddfma37884 fma 1 1000 -NaN30 -> -NaN30 +ddfma37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Here we explore near the boundary of rounding a subnormal to Nmin +ddfma37575 fma 1 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal +ddfma37576 fma 1 -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal + +-- check overflow edge case +-- 1234567890123456 +ddfma37972 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +ddfma37973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded +ddfma37974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded +ddfma37975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded +ddfma37976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded +ddfma37977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded +ddfma37978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded +ddfma37979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded +ddfma37980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded +ddfma37981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded +ddfma37982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded +ddfma37983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded +ddfma37984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded + +ddfma37985 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +ddfma37986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded +ddfma37987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded +ddfma37988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded +ddfma37989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded +ddfma37990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded +ddfma37991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded +ddfma37992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded +ddfma37993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded +ddfma37994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded +ddfma37995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded +ddfma37996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded +ddfma37997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +ddfma371100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +ddfma371101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +ddfma371103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +ddfma371104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +ddfma371105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +ddfma371106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +ddfma371107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +ddfma371108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +ddfma371109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +ddfma371110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +ddfma371111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +ddfma371113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +ddfma371114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +ddfma371115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +ddfma371116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +ddfma371117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +ddfma371118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +ddfma371119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +ddfma371300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +ddfma371310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded +ddfma371311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded +ddfma371312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +ddfma371313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +ddfma371314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +ddfma371315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +ddfma371316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +ddfma371317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +ddfma371318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +ddfma371319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +ddfma371320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +ddfma371321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +ddfma371322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +ddfma371323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +ddfma371324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +ddfma371325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +ddfma371339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +ddfma371340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +ddfma371341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +ddfma371349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +ddfma371350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +ddfma371351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +ddfma371352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +ddfma371353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +ddfma371354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +ddfma371355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +ddfma371356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +ddfma371357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +ddfma371358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +ddfma371359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +ddfma371360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +ddfma371361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +ddfma371362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +ddfma371363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +ddfma371364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +ddfma371365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +ddfma371379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +ddfma371380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +ddfma371381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +ddfma371382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +ddfma371395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +ddfma371396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +ddfma371420 fma 1 0 1.123456789012345 -> 1.123456789012345 +ddfma371421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345 +ddfma371422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345 +ddfma371423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345 +ddfma371424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345 +ddfma371425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345 +ddfma371426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345 +ddfma371427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7 +ddfma371428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8 +ddfma371429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9 +ddfma371430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10 +ddfma371431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11 +ddfma371432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12 +ddfma371433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13 +ddfma371434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14 +ddfma371435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15 +ddfma371436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16 +ddfma371437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17 +ddfma371438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18 +ddfma371439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +ddfma371440 fma 1 1.123456789012345 0 -> 1.123456789012345 +ddfma371441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345 +ddfma371442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345 +ddfma371443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345 +ddfma371444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345 +ddfma371445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345 +ddfma371446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345 +ddfma371447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7 +ddfma371448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8 +ddfma371449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9 +ddfma371450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10 +ddfma371451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11 +ddfma371452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12 +ddfma371453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13 +ddfma371454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14 +ddfma371455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15 +ddfma371456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16 +ddfma371457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17 +ddfma371458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18 +ddfma371459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +ddfma371460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345 +ddfma371461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345 +ddfma371462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345 +ddfma371463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345 +ddfma371464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345 +ddfma371465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345 +ddfma371466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345 +ddfma371467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345 +ddfma371468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345 +ddfma371469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345 +ddfma371470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345 +ddfma371471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345 +ddfma371472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345 +ddfma371473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345 +ddfma371474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345 +ddfma371475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded because the 0 extends the result +ddfma371476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +ddfma371477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +ddfma371478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +ddfma371479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +ddfma371500 fma 1 0 0E-19 -> 0E-19 +ddfma371501 fma 1 -0 0E-19 -> 0E-19 +ddfma371502 fma 1 0 -0E-19 -> 0E-19 +ddfma371503 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371511 fma 1 -11 11 -> 0 +ddfma371512 fma 1 11 -11 -> 0 + +rounding: half_down +-- exact zeros from zeros +ddfma371520 fma 1 0 0E-19 -> 0E-19 +ddfma371521 fma 1 -0 0E-19 -> 0E-19 +ddfma371522 fma 1 0 -0E-19 -> 0E-19 +ddfma371523 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371531 fma 1 -11 11 -> 0 +ddfma371532 fma 1 11 -11 -> 0 + +rounding: half_even +-- exact zeros from zeros +ddfma371540 fma 1 0 0E-19 -> 0E-19 +ddfma371541 fma 1 -0 0E-19 -> 0E-19 +ddfma371542 fma 1 0 -0E-19 -> 0E-19 +ddfma371543 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371551 fma 1 -11 11 -> 0 +ddfma371552 fma 1 11 -11 -> 0 + +rounding: up +-- exact zeros from zeros +ddfma371560 fma 1 0 0E-19 -> 0E-19 +ddfma371561 fma 1 -0 0E-19 -> 0E-19 +ddfma371562 fma 1 0 -0E-19 -> 0E-19 +ddfma371563 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371571 fma 1 -11 11 -> 0 +ddfma371572 fma 1 11 -11 -> 0 + +rounding: down +-- exact zeros from zeros +ddfma371580 fma 1 0 0E-19 -> 0E-19 +ddfma371581 fma 1 -0 0E-19 -> 0E-19 +ddfma371582 fma 1 0 -0E-19 -> 0E-19 +ddfma371583 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371591 fma 1 -11 11 -> 0 +ddfma371592 fma 1 11 -11 -> 0 + +rounding: ceiling +-- exact zeros from zeros +ddfma371600 fma 1 0 0E-19 -> 0E-19 +ddfma371601 fma 1 -0 0E-19 -> 0E-19 +ddfma371602 fma 1 0 -0E-19 -> 0E-19 +ddfma371603 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371611 fma 1 -11 11 -> 0 +ddfma371612 fma 1 11 -11 -> 0 + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +ddfma371620 fma 1 0 0E-19 -> 0E-19 +ddfma371621 fma 1 -0 0E-19 -> -0E-19 -- * +ddfma371622 fma 1 0 -0E-19 -> -0E-19 -- * +ddfma371623 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +ddfma371631 fma 1 -11 11 -> -0 -- * +ddfma371632 fma 1 11 -11 -> -0 -- * + +-- Examples from SQL proposal (Krishna Kulkarni) +ddfma371701 fma 1 130E-2 120E-2 -> 2.50 +ddfma371702 fma 1 130E-2 12E-1 -> 2.50 +ddfma371703 fma 1 130E-2 1E0 -> 2.30 +ddfma371704 fma 1 1E2 1E4 -> 1.01E+4 +ddfma371705 fma 1 130E-2 -120E-2 -> 0.10 +ddfma371706 fma 1 130E-2 -12E-1 -> 0.10 +ddfma371707 fma 1 130E-2 -1E0 -> 0.30 +ddfma371708 fma 1 1E2 -1E4 -> -9.9E+3 + +-- Gappy coefficients; check residue handling even with full coefficient gap +rounding: half_even + +ddfma375001 fma 1 1234567890123456 1 -> 1234567890123457 +ddfma375002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded +ddfma375003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded +ddfma375004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded +ddfma375005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded +ddfma375006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded +ddfma375007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded +ddfma375008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded +ddfma375009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded +ddfma375010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded +ddfma375011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded +ddfma375012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded +ddfma375013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded +ddfma375014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded +ddfma375015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded +ddfma375016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded +ddfma375017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded +ddfma375018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded +ddfma375019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded +ddfma375020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded +ddfma375021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded + +-- widening second argument at gap +ddfma375030 fma 1 12345678 1 -> 12345679 +ddfma375031 fma 1 12345678 0.1 -> 12345678.1 +ddfma375032 fma 1 12345678 0.12 -> 12345678.12 +ddfma375033 fma 1 12345678 0.123 -> 12345678.123 +ddfma375034 fma 1 12345678 0.1234 -> 12345678.1234 +ddfma375035 fma 1 12345678 0.12345 -> 12345678.12345 +ddfma375036 fma 1 12345678 0.123456 -> 12345678.123456 +ddfma375037 fma 1 12345678 0.1234567 -> 12345678.1234567 +ddfma375038 fma 1 12345678 0.12345678 -> 12345678.12345678 +ddfma375039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded +ddfma375040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded +ddfma375041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded +ddfma375042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded +ddfma375043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded +ddfma375044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded +ddfma375045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded +ddfma375046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded +ddfma375047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded +ddfma375048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded +ddfma375049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded +-- 90123456 +rounding: half_even +ddfma375050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded +ddfma375051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded +ddfma375052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded +ddfma375053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded +ddfma375054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded +ddfma375055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded +ddfma375056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded +ddfma375057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded +ddfma375060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded +ddfma375061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded +ddfma375062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded +ddfma375063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded +ddfma375064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded +ddfma375065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded +ddfma375066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded +ddfma375067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded +-- far-out residues (full coefficient gap is 16+15 digits) +rounding: up +ddfma375070 fma 1 12345678 1E-8 -> 12345678.00000001 +ddfma375071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded +ddfma375072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded +ddfma375073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded +ddfma375074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded +ddfma375075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded +ddfma375076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded +ddfma375077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded +ddfma375078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded +ddfma375079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded +ddfma375080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded +ddfma375081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded +ddfma375082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded +ddfma375083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded +ddfma375084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded +ddfma375085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded +ddfma375086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded +ddfma375087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded +ddfma375088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded +ddfma375089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded + +-- desctructive subtraction (from remainder tests) + +-- +++ some of these will be off-by-one remainder vs remainderNear + +ddfma4000 fma -1234567890123454 1.000000000000001 1234567890123456 -> 0.765432109876546 +ddfma4001 fma -1234567890123443 1.00000000000001 1234567890123456 -> 0.65432109876557 +ddfma4002 fma -1234567890123332 1.0000000000001 1234567890123456 -> 0.5432109876668 +ddfma4003 fma -308641972530863 4.000000000000001 1234567890123455 -> 2.691358027469137 +ddfma4004 fma -308641972530863 4.000000000000001 1234567890123456 -> 3.691358027469137 +ddfma4005 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696 +ddfma4006 fma -246913578024691 4.99999999999999 1234567890123456 -> 3.46913578024691 +ddfma4007 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691 +ddfma4008 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309 +ddfma4009 fma -246913578024690 5.00000000000001 1234567890123456 -> 3.53086421975310 +ddfma4010 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314 +ddfma4011 fma -1234567890123455 1.000000000000001 1234567890123456 -> -0.234567890123455 +ddfma4012 fma -1234567890123444 1.00000000000001 1234567890123456 -> -0.34567890123444 +ddfma4013 fma -1234567890123333 1.0000000000001 1234567890123456 -> -0.4567890123333 +ddfma4014 fma -308641972530864 4.000000000000001 1234567890123455 -> -1.308641972530864 +ddfma4015 fma -308641972530864 4.000000000000001 1234567890123456 -> -0.308641972530864 +ddfma4016 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696 +ddfma4017 fma -246913578024692 4.99999999999999 1234567890123456 -> -1.53086421975308 +ddfma4018 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691 +ddfma4019 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309 +ddfma4020 fma -246913578024691 5.00000000000001 1234567890123456 -> -1.46913578024691 +ddfma4021 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314 + + +-- Null tests +ddfma39990 fma 1 10 # -> NaN Invalid_operation +ddfma39991 fma 1 # 10 -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddInvert.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddInvert.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,202 @@ +------------------------------------------------------------------------ +-- ddInvert.decTest -- digitwise logical INVERT for decDoubles -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check (truth table) +ddinv001 invert 0 -> 1111111111111111 +ddinv002 invert 1 -> 1111111111111110 +ddinv003 invert 10 -> 1111111111111101 +ddinv004 invert 111111111 -> 1111111000000000 +ddinv005 invert 000000000 -> 1111111111111111 +-- and at msd and msd-1 +ddinv007 invert 0000000000000000 -> 1111111111111111 +ddinv008 invert 1000000000000000 -> 111111111111111 +ddinv009 invert 0000000000000000 -> 1111111111111111 +ddinv010 invert 0100000000000000 -> 1011111111111111 +ddinv011 invert 0111111111111111 -> 1000000000000000 +ddinv012 invert 1111111111111111 -> 0 +ddinv013 invert 0011111111111111 -> 1100000000000000 +ddinv014 invert 0111111111111111 -> 1000000000000000 + +-- Various lengths +-- 123456789 1234567890123456 +ddinv021 invert 111111111 -> 1111111000000000 +ddinv022 invert 111111111111 -> 1111000000000000 +ddinv023 invert 11111111 -> 1111111100000000 +ddinv025 invert 1111111 -> 1111111110000000 +ddinv026 invert 111111 -> 1111111111000000 +ddinv027 invert 11111 -> 1111111111100000 +ddinv028 invert 1111 -> 1111111111110000 +ddinv029 invert 111 -> 1111111111111000 +ddinv031 invert 11 -> 1111111111111100 +ddinv032 invert 1 -> 1111111111111110 +ddinv033 invert 111111111111 -> 1111000000000000 +ddinv034 invert 11111111111 -> 1111100000000000 +ddinv035 invert 1111111111 -> 1111110000000000 +ddinv036 invert 111111111 -> 1111111000000000 + +ddinv040 invert 011111111 -> 1111111100000000 +ddinv041 invert 101111111 -> 1111111010000000 +ddinv042 invert 110111111 -> 1111111001000000 +ddinv043 invert 111011111 -> 1111111000100000 +ddinv044 invert 111101111 -> 1111111000010000 +ddinv045 invert 111110111 -> 1111111000001000 +ddinv046 invert 111111011 -> 1111111000000100 +ddinv047 invert 111111101 -> 1111111000000010 +ddinv048 invert 111111110 -> 1111111000000001 +ddinv049 invert 011111011 -> 1111111100000100 +ddinv050 invert 101111101 -> 1111111010000010 +ddinv051 invert 110111110 -> 1111111001000001 +ddinv052 invert 111011101 -> 1111111000100010 +ddinv053 invert 111101011 -> 1111111000010100 +ddinv054 invert 111110111 -> 1111111000001000 +ddinv055 invert 111101011 -> 1111111000010100 +ddinv056 invert 111011101 -> 1111111000100010 +ddinv057 invert 110111110 -> 1111111001000001 +ddinv058 invert 101111101 -> 1111111010000010 +ddinv059 invert 011111011 -> 1111111100000100 + +ddinv080 invert 1000000011111111 -> 111111100000000 +ddinv081 invert 0100000101111111 -> 1011111010000000 +ddinv082 invert 0010000110111111 -> 1101111001000000 +ddinv083 invert 0001000111011111 -> 1110111000100000 +ddinv084 invert 0000100111101111 -> 1111011000010000 +ddinv085 invert 0000010111110111 -> 1111101000001000 +ddinv086 invert 0000001111111011 -> 1111110000000100 +ddinv087 invert 0000010111111101 -> 1111101000000010 +ddinv088 invert 0000100111111110 -> 1111011000000001 +ddinv089 invert 0001000011111011 -> 1110111100000100 +ddinv090 invert 0010000101111101 -> 1101111010000010 +ddinv091 invert 0100000110111110 -> 1011111001000001 +ddinv092 invert 1000000111011101 -> 111111000100010 +ddinv093 invert 0100000111101011 -> 1011111000010100 +ddinv094 invert 0010000111110111 -> 1101111000001000 +ddinv095 invert 0001000111101011 -> 1110111000010100 +ddinv096 invert 0000100111011101 -> 1111011000100010 +ddinv097 invert 0000010110111110 -> 1111101001000001 +ddinv098 invert 0000001101111101 -> 1111110010000010 +ddinv099 invert 0000010011111011 -> 1111101100000100 + +-- non-0/1 should not be accepted, nor should signs +ddinv220 invert 111111112 -> NaN Invalid_operation +ddinv221 invert 333333333 -> NaN Invalid_operation +ddinv222 invert 555555555 -> NaN Invalid_operation +ddinv223 invert 777777777 -> NaN Invalid_operation +ddinv224 invert 999999999 -> NaN Invalid_operation +ddinv225 invert 222222222 -> NaN Invalid_operation +ddinv226 invert 444444444 -> NaN Invalid_operation +ddinv227 invert 666666666 -> NaN Invalid_operation +ddinv228 invert 888888888 -> NaN Invalid_operation +ddinv229 invert 999999999 -> NaN Invalid_operation +ddinv230 invert 999999999 -> NaN Invalid_operation +ddinv231 invert 999999999 -> NaN Invalid_operation +ddinv232 invert 999999999 -> NaN Invalid_operation +-- a few randoms +ddinv240 invert 567468689 -> NaN Invalid_operation +ddinv241 invert 567367689 -> NaN Invalid_operation +ddinv242 invert -631917772 -> NaN Invalid_operation +ddinv243 invert -756253257 -> NaN Invalid_operation +ddinv244 invert 835590149 -> NaN Invalid_operation +-- test MSD +ddinv250 invert 2000000000000000 -> NaN Invalid_operation +ddinv251 invert 3000000000000000 -> NaN Invalid_operation +ddinv252 invert 4000000000000000 -> NaN Invalid_operation +ddinv253 invert 5000000000000000 -> NaN Invalid_operation +ddinv254 invert 6000000000000000 -> NaN Invalid_operation +ddinv255 invert 7000000000000000 -> NaN Invalid_operation +ddinv256 invert 8000000000000000 -> NaN Invalid_operation +ddinv257 invert 9000000000000000 -> NaN Invalid_operation +-- test MSD-1 +ddinv270 invert 0200001000000000 -> NaN Invalid_operation +ddinv271 invert 0300000100000000 -> NaN Invalid_operation +ddinv272 invert 0400000010000000 -> NaN Invalid_operation +ddinv273 invert 0500000001000000 -> NaN Invalid_operation +ddinv274 invert 1600000000100000 -> NaN Invalid_operation +ddinv275 invert 1700000000010000 -> NaN Invalid_operation +ddinv276 invert 1800000000001000 -> NaN Invalid_operation +ddinv277 invert 1900000000000100 -> NaN Invalid_operation +-- test LSD +ddinv280 invert 0010000000000002 -> NaN Invalid_operation +ddinv281 invert 0001000000000003 -> NaN Invalid_operation +ddinv282 invert 0000100000000004 -> NaN Invalid_operation +ddinv283 invert 0000010000000005 -> NaN Invalid_operation +ddinv284 invert 1000001000000006 -> NaN Invalid_operation +ddinv285 invert 1000000100000007 -> NaN Invalid_operation +ddinv286 invert 1000000010000008 -> NaN Invalid_operation +ddinv287 invert 1000000001000009 -> NaN Invalid_operation +-- test Middie +ddinv288 invert 0010000020000000 -> NaN Invalid_operation +ddinv289 invert 0001000030000001 -> NaN Invalid_operation +ddinv290 invert 0000100040000010 -> NaN Invalid_operation +ddinv291 invert 0000010050000100 -> NaN Invalid_operation +ddinv292 invert 1000001060001000 -> NaN Invalid_operation +ddinv293 invert 1000000170010000 -> NaN Invalid_operation +ddinv294 invert 1000000080100000 -> NaN Invalid_operation +ddinv295 invert 1000000091000000 -> NaN Invalid_operation +-- sign +ddinv296 invert -1000000001000000 -> NaN Invalid_operation +ddinv299 invert 1000000001000000 -> 111111110111111 + + +-- Nmax, Nmin, Ntiny-like +ddinv341 invert 9.99999999E+299 -> NaN Invalid_operation +ddinv342 invert 1E-299 -> NaN Invalid_operation +ddinv343 invert 1.00000000E-299 -> NaN Invalid_operation +ddinv344 invert 1E-207 -> NaN Invalid_operation +ddinv345 invert -1E-207 -> NaN Invalid_operation +ddinv346 invert -1.00000000E-299 -> NaN Invalid_operation +ddinv347 invert -1E-299 -> NaN Invalid_operation +ddinv348 invert -9.99999999E+299 -> NaN Invalid_operation + +-- A few other non-integers +ddinv361 invert 1.0 -> NaN Invalid_operation +ddinv362 invert 1E+1 -> NaN Invalid_operation +ddinv363 invert 0.0 -> NaN Invalid_operation +ddinv364 invert 0E+1 -> NaN Invalid_operation +ddinv365 invert 9.9 -> NaN Invalid_operation +ddinv366 invert 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +ddinv788 invert -Inf -> NaN Invalid_operation +ddinv794 invert Inf -> NaN Invalid_operation +ddinv821 invert NaN -> NaN Invalid_operation +ddinv841 invert sNaN -> NaN Invalid_operation +-- propagating NaNs +ddinv861 invert NaN1 -> NaN Invalid_operation +ddinv862 invert +NaN2 -> NaN Invalid_operation +ddinv863 invert NaN3 -> NaN Invalid_operation +ddinv864 invert NaN4 -> NaN Invalid_operation +ddinv865 invert NaN5 -> NaN Invalid_operation +ddinv871 invert sNaN11 -> NaN Invalid_operation +ddinv872 invert sNaN12 -> NaN Invalid_operation +ddinv873 invert sNaN13 -> NaN Invalid_operation +ddinv874 invert sNaN14 -> NaN Invalid_operation +ddinv875 invert sNaN15 -> NaN Invalid_operation +ddinv876 invert NaN16 -> NaN Invalid_operation +ddinv881 invert +NaN25 -> NaN Invalid_operation +ddinv882 invert -NaN26 -> NaN Invalid_operation +ddinv883 invert -sNaN27 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddLogB.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddLogB.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,159 @@ +------------------------------------------------------------------------ +-- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles -- +-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- basics +ddlogb000 logb 0 -> -Infinity Division_by_zero +ddlogb001 logb 1E-398 -> -398 +ddlogb002 logb 1E-383 -> -383 +ddlogb003 logb 0.001 -> -3 +ddlogb004 logb 0.03 -> -2 +ddlogb005 logb 1 -> 0 +ddlogb006 logb 2 -> 0 +ddlogb007 logb 2.5 -> 0 +ddlogb008 logb 2.500 -> 0 +ddlogb009 logb 10 -> 1 +ddlogb010 logb 70 -> 1 +ddlogb011 logb 100 -> 2 +ddlogb012 logb 333 -> 2 +ddlogb013 logb 9E+384 -> 384 +ddlogb014 logb +Infinity -> Infinity + +-- negatives appear to be treated as positives +ddlogb021 logb -0 -> -Infinity Division_by_zero +ddlogb022 logb -1E-398 -> -398 +ddlogb023 logb -9E-383 -> -383 +ddlogb024 logb -0.001 -> -3 +ddlogb025 logb -1 -> 0 +ddlogb026 logb -2 -> 0 +ddlogb027 logb -10 -> 1 +ddlogb028 logb -70 -> 1 +ddlogb029 logb -100 -> 2 +ddlogb030 logb -9E+384 -> 384 +ddlogb031 logb -Infinity -> Infinity + +-- zeros +ddlogb111 logb 0 -> -Infinity Division_by_zero +ddlogb112 logb -0 -> -Infinity Division_by_zero +ddlogb113 logb 0E+4 -> -Infinity Division_by_zero +ddlogb114 logb -0E+4 -> -Infinity Division_by_zero +ddlogb115 logb 0.0000 -> -Infinity Division_by_zero +ddlogb116 logb -0.0000 -> -Infinity Division_by_zero +ddlogb117 logb 0E-141 -> -Infinity Division_by_zero +ddlogb118 logb -0E-141 -> -Infinity Division_by_zero + +-- full coefficients, alternating bits +ddlogb121 logb 268268268 -> 8 +ddlogb122 logb -268268268 -> 8 +ddlogb123 logb 134134134 -> 8 +ddlogb124 logb -134134134 -> 8 + +-- Nmax, Nmin, Ntiny +ddlogb131 logb 9.999999999999999E+384 -> 384 +ddlogb132 logb 1E-383 -> -383 +ddlogb133 logb 1.000000000000000E-383 -> -383 +ddlogb134 logb 1E-398 -> -398 + +ddlogb135 logb -1E-398 -> -398 +ddlogb136 logb -1.000000000000000E-383 -> -383 +ddlogb137 logb -1E-383 -> -383 +ddlogb138 logb -9.999999999999999E+384 -> 384 + +-- ones +ddlogb0061 logb 1 -> 0 +ddlogb0062 logb 1.0 -> 0 +ddlogb0063 logb 1.000000000000000 -> 0 + +-- notable cases -- exact powers of 10 +ddlogb1100 logb 1 -> 0 +ddlogb1101 logb 10 -> 1 +ddlogb1102 logb 100 -> 2 +ddlogb1103 logb 1000 -> 3 +ddlogb1104 logb 10000 -> 4 +ddlogb1105 logb 100000 -> 5 +ddlogb1106 logb 1000000 -> 6 +ddlogb1107 logb 10000000 -> 7 +ddlogb1108 logb 100000000 -> 8 +ddlogb1109 logb 1000000000 -> 9 +ddlogb1110 logb 10000000000 -> 10 +ddlogb1111 logb 100000000000 -> 11 +ddlogb1112 logb 1000000000000 -> 12 +ddlogb1113 logb 0.00000000001 -> -11 +ddlogb1114 logb 0.0000000001 -> -10 +ddlogb1115 logb 0.000000001 -> -9 +ddlogb1116 logb 0.00000001 -> -8 +ddlogb1117 logb 0.0000001 -> -7 +ddlogb1118 logb 0.000001 -> -6 +ddlogb1119 logb 0.00001 -> -5 +ddlogb1120 logb 0.0001 -> -4 +ddlogb1121 logb 0.001 -> -3 +ddlogb1122 logb 0.01 -> -2 +ddlogb1123 logb 0.1 -> -1 +ddlogb1124 logb 1E-99 -> -99 +ddlogb1125 logb 1E-100 -> -100 +ddlogb1127 logb 1E-299 -> -299 +ddlogb1126 logb 1E-383 -> -383 + +-- suggestions from Ilan Nehama +ddlogb1400 logb 10E-3 -> -2 +ddlogb1401 logb 10E-2 -> -1 +ddlogb1402 logb 100E-2 -> 0 +ddlogb1403 logb 1000E-2 -> 1 +ddlogb1404 logb 10000E-2 -> 2 +ddlogb1405 logb 10E-1 -> 0 +ddlogb1406 logb 100E-1 -> 1 +ddlogb1407 logb 1000E-1 -> 2 +ddlogb1408 logb 10000E-1 -> 3 +ddlogb1409 logb 10E0 -> 1 +ddlogb1410 logb 100E0 -> 2 +ddlogb1411 logb 1000E0 -> 3 +ddlogb1412 logb 10000E0 -> 4 +ddlogb1413 logb 10E1 -> 2 +ddlogb1414 logb 100E1 -> 3 +ddlogb1415 logb 1000E1 -> 4 +ddlogb1416 logb 10000E1 -> 5 +ddlogb1417 logb 10E2 -> 3 +ddlogb1418 logb 100E2 -> 4 +ddlogb1419 logb 1000E2 -> 5 +ddlogb1420 logb 10000E2 -> 6 + +-- special values +ddlogb820 logb Infinity -> Infinity +ddlogb821 logb 0 -> -Infinity Division_by_zero +ddlogb822 logb NaN -> NaN +ddlogb823 logb sNaN -> NaN Invalid_operation +-- propagating NaNs +ddlogb824 logb sNaN123 -> NaN123 Invalid_operation +ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation +ddlogb826 logb NaN456 -> NaN456 +ddlogb827 logb -NaN654 -> -NaN654 +ddlogb828 logb NaN1 -> NaN1 + +-- Null test +ddlogb900 logb # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMax.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMax.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,322 @@ +------------------------------------------------------------------------ +-- ddMax.decTest -- decDouble maxnum -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddmax001 max -2 -2 -> -2 +ddmax002 max -2 -1 -> -1 +ddmax003 max -2 0 -> 0 +ddmax004 max -2 1 -> 1 +ddmax005 max -2 2 -> 2 +ddmax006 max -1 -2 -> -1 +ddmax007 max -1 -1 -> -1 +ddmax008 max -1 0 -> 0 +ddmax009 max -1 1 -> 1 +ddmax010 max -1 2 -> 2 +ddmax011 max 0 -2 -> 0 +ddmax012 max 0 -1 -> 0 +ddmax013 max 0 0 -> 0 +ddmax014 max 0 1 -> 1 +ddmax015 max 0 2 -> 2 +ddmax016 max 1 -2 -> 1 +ddmax017 max 1 -1 -> 1 +ddmax018 max 1 0 -> 1 +ddmax019 max 1 1 -> 1 +ddmax020 max 1 2 -> 2 +ddmax021 max 2 -2 -> 2 +ddmax022 max 2 -1 -> 2 +ddmax023 max 2 0 -> 2 +ddmax025 max 2 1 -> 2 +ddmax026 max 2 2 -> 2 + +-- extended zeros +ddmax030 max 0 0 -> 0 +ddmax031 max 0 -0 -> 0 +ddmax032 max 0 -0.0 -> 0 +ddmax033 max 0 0.0 -> 0 +ddmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen +ddmax035 max -0 -0 -> -0 +ddmax036 max -0 -0.0 -> -0.0 +ddmax037 max -0 0.0 -> 0.0 +ddmax038 max 0.0 0 -> 0 +ddmax039 max 0.0 -0 -> 0.0 +ddmax040 max 0.0 -0.0 -> 0.0 +ddmax041 max 0.0 0.0 -> 0.0 +ddmax042 max -0.0 0 -> 0 +ddmax043 max -0.0 -0 -> -0.0 +ddmax044 max -0.0 -0.0 -> -0.0 +ddmax045 max -0.0 0.0 -> 0.0 + +ddmax050 max -0E1 0E1 -> 0E+1 +ddmax051 max -0E2 0E2 -> 0E+2 +ddmax052 max -0E2 0E1 -> 0E+1 +ddmax053 max -0E1 0E2 -> 0E+2 +ddmax054 max 0E1 -0E1 -> 0E+1 +ddmax055 max 0E2 -0E2 -> 0E+2 +ddmax056 max 0E2 -0E1 -> 0E+2 +ddmax057 max 0E1 -0E2 -> 0E+1 + +ddmax058 max 0E1 0E1 -> 0E+1 +ddmax059 max 0E2 0E2 -> 0E+2 +ddmax060 max 0E2 0E1 -> 0E+2 +ddmax061 max 0E1 0E2 -> 0E+2 +ddmax062 max -0E1 -0E1 -> -0E+1 +ddmax063 max -0E2 -0E2 -> -0E+2 +ddmax064 max -0E2 -0E1 -> -0E+1 +ddmax065 max -0E1 -0E2 -> -0E+1 + +-- Specials +ddmax090 max Inf -Inf -> Infinity +ddmax091 max Inf -1000 -> Infinity +ddmax092 max Inf -1 -> Infinity +ddmax093 max Inf -0 -> Infinity +ddmax094 max Inf 0 -> Infinity +ddmax095 max Inf 1 -> Infinity +ddmax096 max Inf 1000 -> Infinity +ddmax097 max Inf Inf -> Infinity +ddmax098 max -1000 Inf -> Infinity +ddmax099 max -Inf Inf -> Infinity +ddmax100 max -1 Inf -> Infinity +ddmax101 max -0 Inf -> Infinity +ddmax102 max 0 Inf -> Infinity +ddmax103 max 1 Inf -> Infinity +ddmax104 max 1000 Inf -> Infinity +ddmax105 max Inf Inf -> Infinity + +ddmax120 max -Inf -Inf -> -Infinity +ddmax121 max -Inf -1000 -> -1000 +ddmax122 max -Inf -1 -> -1 +ddmax123 max -Inf -0 -> -0 +ddmax124 max -Inf 0 -> 0 +ddmax125 max -Inf 1 -> 1 +ddmax126 max -Inf 1000 -> 1000 +ddmax127 max -Inf Inf -> Infinity +ddmax128 max -Inf -Inf -> -Infinity +ddmax129 max -1000 -Inf -> -1000 +ddmax130 max -1 -Inf -> -1 +ddmax131 max -0 -Inf -> -0 +ddmax132 max 0 -Inf -> 0 +ddmax133 max 1 -Inf -> 1 +ddmax134 max 1000 -Inf -> 1000 +ddmax135 max Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +ddmax141 max NaN -Inf -> -Infinity +ddmax142 max NaN -1000 -> -1000 +ddmax143 max NaN -1 -> -1 +ddmax144 max NaN -0 -> -0 +ddmax145 max NaN 0 -> 0 +ddmax146 max NaN 1 -> 1 +ddmax147 max NaN 1000 -> 1000 +ddmax148 max NaN Inf -> Infinity +ddmax149 max NaN NaN -> NaN +ddmax150 max -Inf NaN -> -Infinity +ddmax151 max -1000 NaN -> -1000 +ddmax152 max -1 NaN -> -1 +ddmax153 max -0 NaN -> -0 +ddmax154 max 0 NaN -> 0 +ddmax155 max 1 NaN -> 1 +ddmax156 max 1000 NaN -> 1000 +ddmax157 max Inf NaN -> Infinity + +ddmax161 max sNaN -Inf -> NaN Invalid_operation +ddmax162 max sNaN -1000 -> NaN Invalid_operation +ddmax163 max sNaN -1 -> NaN Invalid_operation +ddmax164 max sNaN -0 -> NaN Invalid_operation +ddmax165 max sNaN 0 -> NaN Invalid_operation +ddmax166 max sNaN 1 -> NaN Invalid_operation +ddmax167 max sNaN 1000 -> NaN Invalid_operation +ddmax168 max sNaN NaN -> NaN Invalid_operation +ddmax169 max sNaN sNaN -> NaN Invalid_operation +ddmax170 max NaN sNaN -> NaN Invalid_operation +ddmax171 max -Inf sNaN -> NaN Invalid_operation +ddmax172 max -1000 sNaN -> NaN Invalid_operation +ddmax173 max -1 sNaN -> NaN Invalid_operation +ddmax174 max -0 sNaN -> NaN Invalid_operation +ddmax175 max 0 sNaN -> NaN Invalid_operation +ddmax176 max 1 sNaN -> NaN Invalid_operation +ddmax177 max 1000 sNaN -> NaN Invalid_operation +ddmax178 max Inf sNaN -> NaN Invalid_operation +ddmax179 max NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddmax181 max NaN9 -Inf -> -Infinity +ddmax182 max NaN8 9 -> 9 +ddmax183 max -NaN7 Inf -> Infinity + +ddmax184 max -NaN1 NaN11 -> -NaN1 +ddmax185 max NaN2 NaN12 -> NaN2 +ddmax186 max -NaN13 -NaN7 -> -NaN13 +ddmax187 max NaN14 -NaN5 -> NaN14 + +ddmax188 max -Inf NaN4 -> -Infinity +ddmax189 max -9 -NaN3 -> -9 +ddmax190 max Inf NaN2 -> Infinity + +ddmax191 max sNaN99 -Inf -> NaN99 Invalid_operation +ddmax192 max sNaN98 -1 -> NaN98 Invalid_operation +ddmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation +ddmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation +ddmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation +ddmax196 max -Inf sNaN92 -> NaN92 Invalid_operation +ddmax197 max 0 sNaN91 -> NaN91 Invalid_operation +ddmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation +ddmax199 max NaN sNaN89 -> NaN89 Invalid_operation + +-- old rounding checks +ddmax221 max 12345678000 1 -> 12345678000 +ddmax222 max 1 12345678000 -> 12345678000 +ddmax223 max 1234567800 1 -> 1234567800 +ddmax224 max 1 1234567800 -> 1234567800 +ddmax225 max 1234567890 1 -> 1234567890 +ddmax226 max 1 1234567890 -> 1234567890 +ddmax227 max 1234567891 1 -> 1234567891 +ddmax228 max 1 1234567891 -> 1234567891 +ddmax229 max 12345678901 1 -> 12345678901 +ddmax230 max 1 12345678901 -> 12345678901 +ddmax231 max 1234567896 1 -> 1234567896 +ddmax232 max 1 1234567896 -> 1234567896 +ddmax233 max -1234567891 1 -> 1 +ddmax234 max 1 -1234567891 -> 1 +ddmax235 max -12345678901 1 -> 1 +ddmax236 max 1 -12345678901 -> 1 +ddmax237 max -1234567896 1 -> 1 +ddmax238 max 1 -1234567896 -> 1 + +-- from examples +ddmax280 max '3' '2' -> '3' +ddmax281 max '-10' '3' -> '3' +ddmax282 max '1.0' '1' -> '1' +ddmax283 max '1' '1.0' -> '1' +ddmax284 max '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +ddmax401 max Inf 1.1 -> Infinity +ddmax402 max 1.1 1 -> 1.1 +ddmax403 max 1 1.0 -> 1 +ddmax404 max 1.0 0.1 -> 1.0 +ddmax405 max 0.1 0.10 -> 0.1 +ddmax406 max 0.10 0.100 -> 0.10 +ddmax407 max 0.10 0 -> 0.10 +ddmax408 max 0 0.0 -> 0 +ddmax409 max 0.0 -0 -> 0.0 +ddmax410 max 0.0 -0.0 -> 0.0 +ddmax411 max 0.00 -0.0 -> 0.00 +ddmax412 max 0.0 -0.00 -> 0.0 +ddmax413 max 0 -0.0 -> 0 +ddmax414 max 0 -0 -> 0 +ddmax415 max -0.0 -0 -> -0.0 +ddmax416 max -0 -0.100 -> -0 +ddmax417 max -0.100 -0.10 -> -0.100 +ddmax418 max -0.10 -0.1 -> -0.10 +ddmax419 max -0.1 -1.0 -> -0.1 +ddmax420 max -1.0 -1 -> -1.0 +ddmax421 max -1 -1.1 -> -1 +ddmax423 max -1.1 -Inf -> -1.1 +-- same with operands reversed +ddmax431 max 1.1 Inf -> Infinity +ddmax432 max 1 1.1 -> 1.1 +ddmax433 max 1.0 1 -> 1 +ddmax434 max 0.1 1.0 -> 1.0 +ddmax435 max 0.10 0.1 -> 0.1 +ddmax436 max 0.100 0.10 -> 0.10 +ddmax437 max 0 0.10 -> 0.10 +ddmax438 max 0.0 0 -> 0 +ddmax439 max -0 0.0 -> 0.0 +ddmax440 max -0.0 0.0 -> 0.0 +ddmax441 max -0.0 0.00 -> 0.00 +ddmax442 max -0.00 0.0 -> 0.0 +ddmax443 max -0.0 0 -> 0 +ddmax444 max -0 0 -> 0 +ddmax445 max -0 -0.0 -> -0.0 +ddmax446 max -0.100 -0 -> -0 +ddmax447 max -0.10 -0.100 -> -0.100 +ddmax448 max -0.1 -0.10 -> -0.10 +ddmax449 max -1.0 -0.1 -> -0.1 +ddmax450 max -1 -1.0 -> -1.0 +ddmax451 max -1.1 -1 -> -1 +ddmax453 max -Inf -1.1 -> -1.1 +-- largies +ddmax460 max 1000 1E+3 -> 1E+3 +ddmax461 max 1E+3 1000 -> 1E+3 +ddmax462 max 1000 -1E+3 -> 1000 +ddmax463 max 1E+3 -1000 -> 1E+3 +ddmax464 max -1000 1E+3 -> 1E+3 +ddmax465 max -1E+3 1000 -> 1000 +ddmax466 max -1000 -1E+3 -> -1000 +ddmax467 max -1E+3 -1000 -> -1000 + +-- misalignment traps for little-endian +ddmax471 max 1.0 0.1 -> 1.0 +ddmax472 max 0.1 1.0 -> 1.0 +ddmax473 max 10.0 0.1 -> 10.0 +ddmax474 max 0.1 10.0 -> 10.0 +ddmax475 max 100 1.0 -> 100 +ddmax476 max 1.0 100 -> 100 +ddmax477 max 1000 10.0 -> 1000 +ddmax478 max 10.0 1000 -> 1000 +ddmax479 max 10000 100.0 -> 10000 +ddmax480 max 100.0 10000 -> 10000 +ddmax481 max 100000 1000.0 -> 100000 +ddmax482 max 1000.0 100000 -> 100000 +ddmax483 max 1000000 10000.0 -> 1000000 +ddmax484 max 10000.0 1000000 -> 1000000 + +-- subnormals +ddmax510 max 1.00E-383 0 -> 1.00E-383 +ddmax511 max 0.1E-383 0 -> 1E-384 Subnormal +ddmax512 max 0.10E-383 0 -> 1.0E-384 Subnormal +ddmax513 max 0.100E-383 0 -> 1.00E-384 Subnormal +ddmax514 max 0.01E-383 0 -> 1E-385 Subnormal +ddmax515 max 0.999E-383 0 -> 9.99E-384 Subnormal +ddmax516 max 0.099E-383 0 -> 9.9E-385 Subnormal +ddmax517 max 0.009E-383 0 -> 9E-386 Subnormal +ddmax518 max 0.001E-383 0 -> 1E-386 Subnormal +ddmax519 max 0.0009E-383 0 -> 9E-387 Subnormal +ddmax520 max 0.0001E-383 0 -> 1E-387 Subnormal + +ddmax530 max -1.00E-383 0 -> 0 +ddmax531 max -0.1E-383 0 -> 0 +ddmax532 max -0.10E-383 0 -> 0 +ddmax533 max -0.100E-383 0 -> 0 +ddmax534 max -0.01E-383 0 -> 0 +ddmax535 max -0.999E-383 0 -> 0 +ddmax536 max -0.099E-383 0 -> 0 +ddmax537 max -0.009E-383 0 -> 0 +ddmax538 max -0.001E-383 0 -> 0 +ddmax539 max -0.0009E-383 0 -> 0 +ddmax540 max -0.0001E-383 0 -> 0 + +-- Null tests +ddmax900 max 10 # -> NaN Invalid_operation +ddmax901 max # 10 -> NaN Invalid_operation + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMaxMag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMaxMag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,304 @@ +------------------------------------------------------------------------ +-- ddMaxMag.decTest -- decDouble maxnummag -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddmxg001 maxmag -2 -2 -> -2 +ddmxg002 maxmag -2 -1 -> -2 +ddmxg003 maxmag -2 0 -> -2 +ddmxg004 maxmag -2 1 -> -2 +ddmxg005 maxmag -2 2 -> 2 +ddmxg006 maxmag -1 -2 -> -2 +ddmxg007 maxmag -1 -1 -> -1 +ddmxg008 maxmag -1 0 -> -1 +ddmxg009 maxmag -1 1 -> 1 +ddmxg010 maxmag -1 2 -> 2 +ddmxg011 maxmag 0 -2 -> -2 +ddmxg012 maxmag 0 -1 -> -1 +ddmxg013 maxmag 0 0 -> 0 +ddmxg014 maxmag 0 1 -> 1 +ddmxg015 maxmag 0 2 -> 2 +ddmxg016 maxmag 1 -2 -> -2 +ddmxg017 maxmag 1 -1 -> 1 +ddmxg018 maxmag 1 0 -> 1 +ddmxg019 maxmag 1 1 -> 1 +ddmxg020 maxmag 1 2 -> 2 +ddmxg021 maxmag 2 -2 -> 2 +ddmxg022 maxmag 2 -1 -> 2 +ddmxg023 maxmag 2 0 -> 2 +ddmxg025 maxmag 2 1 -> 2 +ddmxg026 maxmag 2 2 -> 2 + +-- extended zeros +ddmxg030 maxmag 0 0 -> 0 +ddmxg031 maxmag 0 -0 -> 0 +ddmxg032 maxmag 0 -0.0 -> 0 +ddmxg033 maxmag 0 0.0 -> 0 +ddmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen +ddmxg035 maxmag -0 -0 -> -0 +ddmxg036 maxmag -0 -0.0 -> -0.0 +ddmxg037 maxmag -0 0.0 -> 0.0 +ddmxg038 maxmag 0.0 0 -> 0 +ddmxg039 maxmag 0.0 -0 -> 0.0 +ddmxg040 maxmag 0.0 -0.0 -> 0.0 +ddmxg041 maxmag 0.0 0.0 -> 0.0 +ddmxg042 maxmag -0.0 0 -> 0 +ddmxg043 maxmag -0.0 -0 -> -0.0 +ddmxg044 maxmag -0.0 -0.0 -> -0.0 +ddmxg045 maxmag -0.0 0.0 -> 0.0 + +ddmxg050 maxmag -0E1 0E1 -> 0E+1 +ddmxg051 maxmag -0E2 0E2 -> 0E+2 +ddmxg052 maxmag -0E2 0E1 -> 0E+1 +ddmxg053 maxmag -0E1 0E2 -> 0E+2 +ddmxg054 maxmag 0E1 -0E1 -> 0E+1 +ddmxg055 maxmag 0E2 -0E2 -> 0E+2 +ddmxg056 maxmag 0E2 -0E1 -> 0E+2 +ddmxg057 maxmag 0E1 -0E2 -> 0E+1 + +ddmxg058 maxmag 0E1 0E1 -> 0E+1 +ddmxg059 maxmag 0E2 0E2 -> 0E+2 +ddmxg060 maxmag 0E2 0E1 -> 0E+2 +ddmxg061 maxmag 0E1 0E2 -> 0E+2 +ddmxg062 maxmag -0E1 -0E1 -> -0E+1 +ddmxg063 maxmag -0E2 -0E2 -> -0E+2 +ddmxg064 maxmag -0E2 -0E1 -> -0E+1 +ddmxg065 maxmag -0E1 -0E2 -> -0E+1 + +-- Specials +ddmxg090 maxmag Inf -Inf -> Infinity +ddmxg091 maxmag Inf -1000 -> Infinity +ddmxg092 maxmag Inf -1 -> Infinity +ddmxg093 maxmag Inf -0 -> Infinity +ddmxg094 maxmag Inf 0 -> Infinity +ddmxg095 maxmag Inf 1 -> Infinity +ddmxg096 maxmag Inf 1000 -> Infinity +ddmxg097 maxmag Inf Inf -> Infinity +ddmxg098 maxmag -1000 Inf -> Infinity +ddmxg099 maxmag -Inf Inf -> Infinity +ddmxg100 maxmag -1 Inf -> Infinity +ddmxg101 maxmag -0 Inf -> Infinity +ddmxg102 maxmag 0 Inf -> Infinity +ddmxg103 maxmag 1 Inf -> Infinity +ddmxg104 maxmag 1000 Inf -> Infinity +ddmxg105 maxmag Inf Inf -> Infinity + +ddmxg120 maxmag -Inf -Inf -> -Infinity +ddmxg121 maxmag -Inf -1000 -> -Infinity +ddmxg122 maxmag -Inf -1 -> -Infinity +ddmxg123 maxmag -Inf -0 -> -Infinity +ddmxg124 maxmag -Inf 0 -> -Infinity +ddmxg125 maxmag -Inf 1 -> -Infinity +ddmxg126 maxmag -Inf 1000 -> -Infinity +ddmxg127 maxmag -Inf Inf -> Infinity +ddmxg128 maxmag -Inf -Inf -> -Infinity +ddmxg129 maxmag -1000 -Inf -> -Infinity +ddmxg130 maxmag -1 -Inf -> -Infinity +ddmxg131 maxmag -0 -Inf -> -Infinity +ddmxg132 maxmag 0 -Inf -> -Infinity +ddmxg133 maxmag 1 -Inf -> -Infinity +ddmxg134 maxmag 1000 -Inf -> -Infinity +ddmxg135 maxmag Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +ddmxg141 maxmag NaN -Inf -> -Infinity +ddmxg142 maxmag NaN -1000 -> -1000 +ddmxg143 maxmag NaN -1 -> -1 +ddmxg144 maxmag NaN -0 -> -0 +ddmxg145 maxmag NaN 0 -> 0 +ddmxg146 maxmag NaN 1 -> 1 +ddmxg147 maxmag NaN 1000 -> 1000 +ddmxg148 maxmag NaN Inf -> Infinity +ddmxg149 maxmag NaN NaN -> NaN +ddmxg150 maxmag -Inf NaN -> -Infinity +ddmxg151 maxmag -1000 NaN -> -1000 +ddmxg152 maxmag -1 NaN -> -1 +ddmxg153 maxmag -0 NaN -> -0 +ddmxg154 maxmag 0 NaN -> 0 +ddmxg155 maxmag 1 NaN -> 1 +ddmxg156 maxmag 1000 NaN -> 1000 +ddmxg157 maxmag Inf NaN -> Infinity + +ddmxg161 maxmag sNaN -Inf -> NaN Invalid_operation +ddmxg162 maxmag sNaN -1000 -> NaN Invalid_operation +ddmxg163 maxmag sNaN -1 -> NaN Invalid_operation +ddmxg164 maxmag sNaN -0 -> NaN Invalid_operation +ddmxg165 maxmag sNaN 0 -> NaN Invalid_operation +ddmxg166 maxmag sNaN 1 -> NaN Invalid_operation +ddmxg167 maxmag sNaN 1000 -> NaN Invalid_operation +ddmxg168 maxmag sNaN NaN -> NaN Invalid_operation +ddmxg169 maxmag sNaN sNaN -> NaN Invalid_operation +ddmxg170 maxmag NaN sNaN -> NaN Invalid_operation +ddmxg171 maxmag -Inf sNaN -> NaN Invalid_operation +ddmxg172 maxmag -1000 sNaN -> NaN Invalid_operation +ddmxg173 maxmag -1 sNaN -> NaN Invalid_operation +ddmxg174 maxmag -0 sNaN -> NaN Invalid_operation +ddmxg175 maxmag 0 sNaN -> NaN Invalid_operation +ddmxg176 maxmag 1 sNaN -> NaN Invalid_operation +ddmxg177 maxmag 1000 sNaN -> NaN Invalid_operation +ddmxg178 maxmag Inf sNaN -> NaN Invalid_operation +ddmxg179 maxmag NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddmxg181 maxmag NaN9 -Inf -> -Infinity +ddmxg182 maxmag NaN8 9 -> 9 +ddmxg183 maxmag -NaN7 Inf -> Infinity + +ddmxg184 maxmag -NaN1 NaN11 -> -NaN1 +ddmxg185 maxmag NaN2 NaN12 -> NaN2 +ddmxg186 maxmag -NaN13 -NaN7 -> -NaN13 +ddmxg187 maxmag NaN14 -NaN5 -> NaN14 + +ddmxg188 maxmag -Inf NaN4 -> -Infinity +ddmxg189 maxmag -9 -NaN3 -> -9 +ddmxg190 maxmag Inf NaN2 -> Infinity + +ddmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation +ddmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation +ddmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation +ddmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation +ddmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation +ddmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation +ddmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation +ddmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation +ddmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation + +-- old rounding checks +ddmxg221 maxmag 12345678000 1 -> 12345678000 +ddmxg222 maxmag 1 12345678000 -> 12345678000 +ddmxg223 maxmag 1234567800 1 -> 1234567800 +ddmxg224 maxmag 1 1234567800 -> 1234567800 +ddmxg225 maxmag 1234567890 1 -> 1234567890 +ddmxg226 maxmag 1 1234567890 -> 1234567890 +ddmxg227 maxmag 1234567891 1 -> 1234567891 +ddmxg228 maxmag 1 1234567891 -> 1234567891 +ddmxg229 maxmag 12345678901 1 -> 12345678901 +ddmxg230 maxmag 1 12345678901 -> 12345678901 +ddmxg231 maxmag 1234567896 1 -> 1234567896 +ddmxg232 maxmag 1 1234567896 -> 1234567896 +ddmxg233 maxmag -1234567891 1 -> -1234567891 +ddmxg234 maxmag 1 -1234567891 -> -1234567891 +ddmxg235 maxmag -12345678901 1 -> -12345678901 +ddmxg236 maxmag 1 -12345678901 -> -12345678901 +ddmxg237 maxmag -1234567896 1 -> -1234567896 +ddmxg238 maxmag 1 -1234567896 -> -1234567896 + +-- from examples +ddmxg280 maxmag '3' '2' -> '3' +ddmxg281 maxmag '-10' '3' -> '-10' +ddmxg282 maxmag '1.0' '1' -> '1' +ddmxg283 maxmag '1' '1.0' -> '1' +ddmxg284 maxmag '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +ddmxg401 maxmag Inf 1.1 -> Infinity +ddmxg402 maxmag 1.1 1 -> 1.1 +ddmxg403 maxmag 1 1.0 -> 1 +ddmxg404 maxmag 1.0 0.1 -> 1.0 +ddmxg405 maxmag 0.1 0.10 -> 0.1 +ddmxg406 maxmag 0.10 0.100 -> 0.10 +ddmxg407 maxmag 0.10 0 -> 0.10 +ddmxg408 maxmag 0 0.0 -> 0 +ddmxg409 maxmag 0.0 -0 -> 0.0 +ddmxg410 maxmag 0.0 -0.0 -> 0.0 +ddmxg411 maxmag 0.00 -0.0 -> 0.00 +ddmxg412 maxmag 0.0 -0.00 -> 0.0 +ddmxg413 maxmag 0 -0.0 -> 0 +ddmxg414 maxmag 0 -0 -> 0 +ddmxg415 maxmag -0.0 -0 -> -0.0 +ddmxg416 maxmag -0 -0.100 -> -0.100 +ddmxg417 maxmag -0.100 -0.10 -> -0.100 +ddmxg418 maxmag -0.10 -0.1 -> -0.10 +ddmxg419 maxmag -0.1 -1.0 -> -1.0 +ddmxg420 maxmag -1.0 -1 -> -1.0 +ddmxg421 maxmag -1 -1.1 -> -1.1 +ddmxg423 maxmag -1.1 -Inf -> -Infinity +-- same with operands reversed +ddmxg431 maxmag 1.1 Inf -> Infinity +ddmxg432 maxmag 1 1.1 -> 1.1 +ddmxg433 maxmag 1.0 1 -> 1 +ddmxg434 maxmag 0.1 1.0 -> 1.0 +ddmxg435 maxmag 0.10 0.1 -> 0.1 +ddmxg436 maxmag 0.100 0.10 -> 0.10 +ddmxg437 maxmag 0 0.10 -> 0.10 +ddmxg438 maxmag 0.0 0 -> 0 +ddmxg439 maxmag -0 0.0 -> 0.0 +ddmxg440 maxmag -0.0 0.0 -> 0.0 +ddmxg441 maxmag -0.0 0.00 -> 0.00 +ddmxg442 maxmag -0.00 0.0 -> 0.0 +ddmxg443 maxmag -0.0 0 -> 0 +ddmxg444 maxmag -0 0 -> 0 +ddmxg445 maxmag -0 -0.0 -> -0.0 +ddmxg446 maxmag -0.100 -0 -> -0.100 +ddmxg447 maxmag -0.10 -0.100 -> -0.100 +ddmxg448 maxmag -0.1 -0.10 -> -0.10 +ddmxg449 maxmag -1.0 -0.1 -> -1.0 +ddmxg450 maxmag -1 -1.0 -> -1.0 +ddmxg451 maxmag -1.1 -1 -> -1.1 +ddmxg453 maxmag -Inf -1.1 -> -Infinity +-- largies +ddmxg460 maxmag 1000 1E+3 -> 1E+3 +ddmxg461 maxmag 1E+3 1000 -> 1E+3 +ddmxg462 maxmag 1000 -1E+3 -> 1000 +ddmxg463 maxmag 1E+3 -1000 -> 1E+3 +ddmxg464 maxmag -1000 1E+3 -> 1E+3 +ddmxg465 maxmag -1E+3 1000 -> 1000 +ddmxg466 maxmag -1000 -1E+3 -> -1000 +ddmxg467 maxmag -1E+3 -1000 -> -1000 + +-- subnormals +ddmxg510 maxmag 1.00E-383 0 -> 1.00E-383 +ddmxg511 maxmag 0.1E-383 0 -> 1E-384 Subnormal +ddmxg512 maxmag 0.10E-383 0 -> 1.0E-384 Subnormal +ddmxg513 maxmag 0.100E-383 0 -> 1.00E-384 Subnormal +ddmxg514 maxmag 0.01E-383 0 -> 1E-385 Subnormal +ddmxg515 maxmag 0.999E-383 0 -> 9.99E-384 Subnormal +ddmxg516 maxmag 0.099E-383 0 -> 9.9E-385 Subnormal +ddmxg517 maxmag 0.009E-383 0 -> 9E-386 Subnormal +ddmxg518 maxmag 0.001E-383 0 -> 1E-386 Subnormal +ddmxg519 maxmag 0.0009E-383 0 -> 9E-387 Subnormal +ddmxg520 maxmag 0.0001E-383 0 -> 1E-387 Subnormal + +ddmxg530 maxmag -1.00E-383 0 -> -1.00E-383 +ddmxg531 maxmag -0.1E-383 0 -> -1E-384 Subnormal +ddmxg532 maxmag -0.10E-383 0 -> -1.0E-384 Subnormal +ddmxg533 maxmag -0.100E-383 0 -> -1.00E-384 Subnormal +ddmxg534 maxmag -0.01E-383 0 -> -1E-385 Subnormal +ddmxg535 maxmag -0.999E-383 0 -> -9.99E-384 Subnormal +ddmxg536 maxmag -0.099E-383 0 -> -9.9E-385 Subnormal +ddmxg537 maxmag -0.009E-383 0 -> -9E-386 Subnormal +ddmxg538 maxmag -0.001E-383 0 -> -1E-386 Subnormal +ddmxg539 maxmag -0.0009E-383 0 -> -9E-387 Subnormal +ddmxg540 maxmag -0.0001E-383 0 -> -1E-387 Subnormal + +-- Null tests +ddmxg900 maxmag 10 # -> NaN Invalid_operation +ddmxg901 maxmag # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMin.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMin.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,309 @@ +------------------------------------------------------------------------ +-- ddMin.decTest -- decDouble minnum -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddmin001 min -2 -2 -> -2 +ddmin002 min -2 -1 -> -2 +ddmin003 min -2 0 -> -2 +ddmin004 min -2 1 -> -2 +ddmin005 min -2 2 -> -2 +ddmin006 min -1 -2 -> -2 +ddmin007 min -1 -1 -> -1 +ddmin008 min -1 0 -> -1 +ddmin009 min -1 1 -> -1 +ddmin010 min -1 2 -> -1 +ddmin011 min 0 -2 -> -2 +ddmin012 min 0 -1 -> -1 +ddmin013 min 0 0 -> 0 +ddmin014 min 0 1 -> 0 +ddmin015 min 0 2 -> 0 +ddmin016 min 1 -2 -> -2 +ddmin017 min 1 -1 -> -1 +ddmin018 min 1 0 -> 0 +ddmin019 min 1 1 -> 1 +ddmin020 min 1 2 -> 1 +ddmin021 min 2 -2 -> -2 +ddmin022 min 2 -1 -> -1 +ddmin023 min 2 0 -> 0 +ddmin025 min 2 1 -> 1 +ddmin026 min 2 2 -> 2 + +-- extended zeros +ddmin030 min 0 0 -> 0 +ddmin031 min 0 -0 -> -0 +ddmin032 min 0 -0.0 -> -0.0 +ddmin033 min 0 0.0 -> 0.0 +ddmin034 min -0 0 -> -0 +ddmin035 min -0 -0 -> -0 +ddmin036 min -0 -0.0 -> -0 +ddmin037 min -0 0.0 -> -0 +ddmin038 min 0.0 0 -> 0.0 +ddmin039 min 0.0 -0 -> -0 +ddmin040 min 0.0 -0.0 -> -0.0 +ddmin041 min 0.0 0.0 -> 0.0 +ddmin042 min -0.0 0 -> -0.0 +ddmin043 min -0.0 -0 -> -0 +ddmin044 min -0.0 -0.0 -> -0.0 +ddmin045 min -0.0 0.0 -> -0.0 + +ddmin046 min 0E1 -0E1 -> -0E+1 +ddmin047 min -0E1 0E2 -> -0E+1 +ddmin048 min 0E2 0E1 -> 0E+1 +ddmin049 min 0E1 0E2 -> 0E+1 +ddmin050 min -0E3 -0E2 -> -0E+3 +ddmin051 min -0E2 -0E3 -> -0E+3 + +-- Specials +ddmin090 min Inf -Inf -> -Infinity +ddmin091 min Inf -1000 -> -1000 +ddmin092 min Inf -1 -> -1 +ddmin093 min Inf -0 -> -0 +ddmin094 min Inf 0 -> 0 +ddmin095 min Inf 1 -> 1 +ddmin096 min Inf 1000 -> 1000 +ddmin097 min Inf Inf -> Infinity +ddmin098 min -1000 Inf -> -1000 +ddmin099 min -Inf Inf -> -Infinity +ddmin100 min -1 Inf -> -1 +ddmin101 min -0 Inf -> -0 +ddmin102 min 0 Inf -> 0 +ddmin103 min 1 Inf -> 1 +ddmin104 min 1000 Inf -> 1000 +ddmin105 min Inf Inf -> Infinity + +ddmin120 min -Inf -Inf -> -Infinity +ddmin121 min -Inf -1000 -> -Infinity +ddmin122 min -Inf -1 -> -Infinity +ddmin123 min -Inf -0 -> -Infinity +ddmin124 min -Inf 0 -> -Infinity +ddmin125 min -Inf 1 -> -Infinity +ddmin126 min -Inf 1000 -> -Infinity +ddmin127 min -Inf Inf -> -Infinity +ddmin128 min -Inf -Inf -> -Infinity +ddmin129 min -1000 -Inf -> -Infinity +ddmin130 min -1 -Inf -> -Infinity +ddmin131 min -0 -Inf -> -Infinity +ddmin132 min 0 -Inf -> -Infinity +ddmin133 min 1 -Inf -> -Infinity +ddmin134 min 1000 -Inf -> -Infinity +ddmin135 min Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +ddmin141 min NaN -Inf -> -Infinity +ddmin142 min NaN -1000 -> -1000 +ddmin143 min NaN -1 -> -1 +ddmin144 min NaN -0 -> -0 +ddmin145 min NaN 0 -> 0 +ddmin146 min NaN 1 -> 1 +ddmin147 min NaN 1000 -> 1000 +ddmin148 min NaN Inf -> Infinity +ddmin149 min NaN NaN -> NaN +ddmin150 min -Inf NaN -> -Infinity +ddmin151 min -1000 NaN -> -1000 +ddmin152 min -1 -NaN -> -1 +ddmin153 min -0 NaN -> -0 +ddmin154 min 0 -NaN -> 0 +ddmin155 min 1 NaN -> 1 +ddmin156 min 1000 NaN -> 1000 +ddmin157 min Inf NaN -> Infinity + +ddmin161 min sNaN -Inf -> NaN Invalid_operation +ddmin162 min sNaN -1000 -> NaN Invalid_operation +ddmin163 min sNaN -1 -> NaN Invalid_operation +ddmin164 min sNaN -0 -> NaN Invalid_operation +ddmin165 min -sNaN 0 -> -NaN Invalid_operation +ddmin166 min -sNaN 1 -> -NaN Invalid_operation +ddmin167 min sNaN 1000 -> NaN Invalid_operation +ddmin168 min sNaN NaN -> NaN Invalid_operation +ddmin169 min sNaN sNaN -> NaN Invalid_operation +ddmin170 min NaN sNaN -> NaN Invalid_operation +ddmin171 min -Inf sNaN -> NaN Invalid_operation +ddmin172 min -1000 sNaN -> NaN Invalid_operation +ddmin173 min -1 sNaN -> NaN Invalid_operation +ddmin174 min -0 sNaN -> NaN Invalid_operation +ddmin175 min 0 sNaN -> NaN Invalid_operation +ddmin176 min 1 sNaN -> NaN Invalid_operation +ddmin177 min 1000 sNaN -> NaN Invalid_operation +ddmin178 min Inf sNaN -> NaN Invalid_operation +ddmin179 min NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddmin181 min NaN9 -Inf -> -Infinity +ddmin182 min -NaN8 9990 -> 9990 +ddmin183 min NaN71 Inf -> Infinity + +ddmin184 min NaN1 NaN54 -> NaN1 +ddmin185 min NaN22 -NaN53 -> NaN22 +ddmin186 min -NaN3 NaN6 -> -NaN3 +ddmin187 min -NaN44 NaN7 -> -NaN44 + +ddmin188 min -Inf NaN41 -> -Infinity +ddmin189 min -9999 -NaN33 -> -9999 +ddmin190 min Inf NaN2 -> Infinity + +ddmin191 min sNaN99 -Inf -> NaN99 Invalid_operation +ddmin192 min sNaN98 -11 -> NaN98 Invalid_operation +ddmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation +ddmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation +ddmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation +ddmin196 min -Inf sNaN92 -> NaN92 Invalid_operation +ddmin197 min 088 sNaN91 -> NaN91 Invalid_operation +ddmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation +ddmin199 min NaN sNaN86 -> NaN86 Invalid_operation + +-- old rounding checks +ddmin221 min -12345678000 1 -> -12345678000 +ddmin222 min 1 -12345678000 -> -12345678000 +ddmin223 min -1234567800 1 -> -1234567800 +ddmin224 min 1 -1234567800 -> -1234567800 +ddmin225 min -1234567890 1 -> -1234567890 +ddmin226 min 1 -1234567890 -> -1234567890 +ddmin227 min -1234567891 1 -> -1234567891 +ddmin228 min 1 -1234567891 -> -1234567891 +ddmin229 min -12345678901 1 -> -12345678901 +ddmin230 min 1 -12345678901 -> -12345678901 +ddmin231 min -1234567896 1 -> -1234567896 +ddmin232 min 1 -1234567896 -> -1234567896 +ddmin233 min 1234567891 1 -> 1 +ddmin234 min 1 1234567891 -> 1 +ddmin235 min 12345678901 1 -> 1 +ddmin236 min 1 12345678901 -> 1 +ddmin237 min 1234567896 1 -> 1 +ddmin238 min 1 1234567896 -> 1 + +-- from examples +ddmin280 min '3' '2' -> '2' +ddmin281 min '-10' '3' -> '-10' +ddmin282 min '1.0' '1' -> '1.0' +ddmin283 min '1' '1.0' -> '1.0' +ddmin284 min '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +ddmin401 min Inf 1.1 -> 1.1 +ddmin402 min 1.1 1 -> 1 +ddmin403 min 1 1.0 -> 1.0 +ddmin404 min 1.0 0.1 -> 0.1 +ddmin405 min 0.1 0.10 -> 0.10 +ddmin406 min 0.10 0.100 -> 0.100 +ddmin407 min 0.10 0 -> 0 +ddmin408 min 0 0.0 -> 0.0 +ddmin409 min 0.0 -0 -> -0 +ddmin410 min 0.0 -0.0 -> -0.0 +ddmin411 min 0.00 -0.0 -> -0.0 +ddmin412 min 0.0 -0.00 -> -0.00 +ddmin413 min 0 -0.0 -> -0.0 +ddmin414 min 0 -0 -> -0 +ddmin415 min -0.0 -0 -> -0 +ddmin416 min -0 -0.100 -> -0.100 +ddmin417 min -0.100 -0.10 -> -0.10 +ddmin418 min -0.10 -0.1 -> -0.1 +ddmin419 min -0.1 -1.0 -> -1.0 +ddmin420 min -1.0 -1 -> -1 +ddmin421 min -1 -1.1 -> -1.1 +ddmin423 min -1.1 -Inf -> -Infinity +-- same with operands reversed +ddmin431 min 1.1 Inf -> 1.1 +ddmin432 min 1 1.1 -> 1 +ddmin433 min 1.0 1 -> 1.0 +ddmin434 min 0.1 1.0 -> 0.1 +ddmin435 min 0.10 0.1 -> 0.10 +ddmin436 min 0.100 0.10 -> 0.100 +ddmin437 min 0 0.10 -> 0 +ddmin438 min 0.0 0 -> 0.0 +ddmin439 min -0 0.0 -> -0 +ddmin440 min -0.0 0.0 -> -0.0 +ddmin441 min -0.0 0.00 -> -0.0 +ddmin442 min -0.00 0.0 -> -0.00 +ddmin443 min -0.0 0 -> -0.0 +ddmin444 min -0 0 -> -0 +ddmin445 min -0 -0.0 -> -0 +ddmin446 min -0.100 -0 -> -0.100 +ddmin447 min -0.10 -0.100 -> -0.10 +ddmin448 min -0.1 -0.10 -> -0.1 +ddmin449 min -1.0 -0.1 -> -1.0 +ddmin450 min -1 -1.0 -> -1 +ddmin451 min -1.1 -1 -> -1.1 +ddmin453 min -Inf -1.1 -> -Infinity +-- largies +ddmin460 min 1000 1E+3 -> 1000 +ddmin461 min 1E+3 1000 -> 1000 +ddmin462 min 1000 -1E+3 -> -1E+3 +ddmin463 min 1E+3 -384 -> -384 +ddmin464 min -384 1E+3 -> -384 +ddmin465 min -1E+3 1000 -> -1E+3 +ddmin466 min -384 -1E+3 -> -1E+3 +ddmin467 min -1E+3 -384 -> -1E+3 + +-- misalignment traps for little-endian +ddmin471 min 1.0 0.1 -> 0.1 +ddmin472 min 0.1 1.0 -> 0.1 +ddmin473 min 10.0 0.1 -> 0.1 +ddmin474 min 0.1 10.0 -> 0.1 +ddmin475 min 100 1.0 -> 1.0 +ddmin476 min 1.0 100 -> 1.0 +ddmin477 min 1000 10.0 -> 10.0 +ddmin478 min 10.0 1000 -> 10.0 +ddmin479 min 10000 100.0 -> 100.0 +ddmin480 min 100.0 10000 -> 100.0 +ddmin481 min 100000 1000.0 -> 1000.0 +ddmin482 min 1000.0 100000 -> 1000.0 +ddmin483 min 1000000 10000.0 -> 10000.0 +ddmin484 min 10000.0 1000000 -> 10000.0 + +-- subnormals +ddmin510 min 1.00E-383 0 -> 0 +ddmin511 min 0.1E-383 0 -> 0 +ddmin512 min 0.10E-383 0 -> 0 +ddmin513 min 0.100E-383 0 -> 0 +ddmin514 min 0.01E-383 0 -> 0 +ddmin515 min 0.999E-383 0 -> 0 +ddmin516 min 0.099E-383 0 -> 0 +ddmin517 min 0.009E-383 0 -> 0 +ddmin518 min 0.001E-383 0 -> 0 +ddmin519 min 0.0009E-383 0 -> 0 +ddmin520 min 0.0001E-383 0 -> 0 + +ddmin530 min -1.00E-383 0 -> -1.00E-383 +ddmin531 min -0.1E-383 0 -> -1E-384 Subnormal +ddmin532 min -0.10E-383 0 -> -1.0E-384 Subnormal +ddmin533 min -0.100E-383 0 -> -1.00E-384 Subnormal +ddmin534 min -0.01E-383 0 -> -1E-385 Subnormal +ddmin535 min -0.999E-383 0 -> -9.99E-384 Subnormal +ddmin536 min -0.099E-383 0 -> -9.9E-385 Subnormal +ddmin537 min -0.009E-383 0 -> -9E-386 Subnormal +ddmin538 min -0.001E-383 0 -> -1E-386 Subnormal +ddmin539 min -0.0009E-383 0 -> -9E-387 Subnormal +ddmin540 min -0.0001E-383 0 -> -1E-387 Subnormal + + +-- Null tests +ddmin900 min 10 # -> NaN Invalid_operation +ddmin901 min # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMinMag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMinMag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,293 @@ +------------------------------------------------------------------------ +-- ddMinMag.decTest -- decDouble minnummag -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddmng001 minmag -2 -2 -> -2 +ddmng002 minmag -2 -1 -> -1 +ddmng003 minmag -2 0 -> 0 +ddmng004 minmag -2 1 -> 1 +ddmng005 minmag -2 2 -> -2 +ddmng006 minmag -1 -2 -> -1 +ddmng007 minmag -1 -1 -> -1 +ddmng008 minmag -1 0 -> 0 +ddmng009 minmag -1 1 -> -1 +ddmng010 minmag -1 2 -> -1 +ddmng011 minmag 0 -2 -> 0 +ddmng012 minmag 0 -1 -> 0 +ddmng013 minmag 0 0 -> 0 +ddmng014 minmag 0 1 -> 0 +ddmng015 minmag 0 2 -> 0 +ddmng016 minmag 1 -2 -> 1 +ddmng017 minmag 1 -1 -> -1 +ddmng018 minmag 1 0 -> 0 +ddmng019 minmag 1 1 -> 1 +ddmng020 minmag 1 2 -> 1 +ddmng021 minmag 2 -2 -> -2 +ddmng022 minmag 2 -1 -> -1 +ddmng023 minmag 2 0 -> 0 +ddmng025 minmag 2 1 -> 1 +ddmng026 minmag 2 2 -> 2 + +-- extended zeros +ddmng030 minmag 0 0 -> 0 +ddmng031 minmag 0 -0 -> -0 +ddmng032 minmag 0 -0.0 -> -0.0 +ddmng033 minmag 0 0.0 -> 0.0 +ddmng034 minmag -0 0 -> -0 +ddmng035 minmag -0 -0 -> -0 +ddmng036 minmag -0 -0.0 -> -0 +ddmng037 minmag -0 0.0 -> -0 +ddmng038 minmag 0.0 0 -> 0.0 +ddmng039 minmag 0.0 -0 -> -0 +ddmng040 minmag 0.0 -0.0 -> -0.0 +ddmng041 minmag 0.0 0.0 -> 0.0 +ddmng042 minmag -0.0 0 -> -0.0 +ddmng043 minmag -0.0 -0 -> -0 +ddmng044 minmag -0.0 -0.0 -> -0.0 +ddmng045 minmag -0.0 0.0 -> -0.0 + +ddmng046 minmag 0E1 -0E1 -> -0E+1 +ddmng047 minmag -0E1 0E2 -> -0E+1 +ddmng048 minmag 0E2 0E1 -> 0E+1 +ddmng049 minmag 0E1 0E2 -> 0E+1 +ddmng050 minmag -0E3 -0E2 -> -0E+3 +ddmng051 minmag -0E2 -0E3 -> -0E+3 + +-- Specials +ddmng090 minmag Inf -Inf -> -Infinity +ddmng091 minmag Inf -1000 -> -1000 +ddmng092 minmag Inf -1 -> -1 +ddmng093 minmag Inf -0 -> -0 +ddmng094 minmag Inf 0 -> 0 +ddmng095 minmag Inf 1 -> 1 +ddmng096 minmag Inf 1000 -> 1000 +ddmng097 minmag Inf Inf -> Infinity +ddmng098 minmag -1000 Inf -> -1000 +ddmng099 minmag -Inf Inf -> -Infinity +ddmng100 minmag -1 Inf -> -1 +ddmng101 minmag -0 Inf -> -0 +ddmng102 minmag 0 Inf -> 0 +ddmng103 minmag 1 Inf -> 1 +ddmng104 minmag 1000 Inf -> 1000 +ddmng105 minmag Inf Inf -> Infinity + +ddmng120 minmag -Inf -Inf -> -Infinity +ddmng121 minmag -Inf -1000 -> -1000 +ddmng122 minmag -Inf -1 -> -1 +ddmng123 minmag -Inf -0 -> -0 +ddmng124 minmag -Inf 0 -> 0 +ddmng125 minmag -Inf 1 -> 1 +ddmng126 minmag -Inf 1000 -> 1000 +ddmng127 minmag -Inf Inf -> -Infinity +ddmng128 minmag -Inf -Inf -> -Infinity +ddmng129 minmag -1000 -Inf -> -1000 +ddmng130 minmag -1 -Inf -> -1 +ddmng131 minmag -0 -Inf -> -0 +ddmng132 minmag 0 -Inf -> 0 +ddmng133 minmag 1 -Inf -> 1 +ddmng134 minmag 1000 -Inf -> 1000 +ddmng135 minmag Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +ddmng141 minmag NaN -Inf -> -Infinity +ddmng142 minmag NaN -1000 -> -1000 +ddmng143 minmag NaN -1 -> -1 +ddmng144 minmag NaN -0 -> -0 +ddmng145 minmag NaN 0 -> 0 +ddmng146 minmag NaN 1 -> 1 +ddmng147 minmag NaN 1000 -> 1000 +ddmng148 minmag NaN Inf -> Infinity +ddmng149 minmag NaN NaN -> NaN +ddmng150 minmag -Inf NaN -> -Infinity +ddmng151 minmag -1000 NaN -> -1000 +ddmng152 minmag -1 -NaN -> -1 +ddmng153 minmag -0 NaN -> -0 +ddmng154 minmag 0 -NaN -> 0 +ddmng155 minmag 1 NaN -> 1 +ddmng156 minmag 1000 NaN -> 1000 +ddmng157 minmag Inf NaN -> Infinity + +ddmng161 minmag sNaN -Inf -> NaN Invalid_operation +ddmng162 minmag sNaN -1000 -> NaN Invalid_operation +ddmng163 minmag sNaN -1 -> NaN Invalid_operation +ddmng164 minmag sNaN -0 -> NaN Invalid_operation +ddmng165 minmag -sNaN 0 -> -NaN Invalid_operation +ddmng166 minmag -sNaN 1 -> -NaN Invalid_operation +ddmng167 minmag sNaN 1000 -> NaN Invalid_operation +ddmng168 minmag sNaN NaN -> NaN Invalid_operation +ddmng169 minmag sNaN sNaN -> NaN Invalid_operation +ddmng170 minmag NaN sNaN -> NaN Invalid_operation +ddmng171 minmag -Inf sNaN -> NaN Invalid_operation +ddmng172 minmag -1000 sNaN -> NaN Invalid_operation +ddmng173 minmag -1 sNaN -> NaN Invalid_operation +ddmng174 minmag -0 sNaN -> NaN Invalid_operation +ddmng175 minmag 0 sNaN -> NaN Invalid_operation +ddmng176 minmag 1 sNaN -> NaN Invalid_operation +ddmng177 minmag 1000 sNaN -> NaN Invalid_operation +ddmng178 minmag Inf sNaN -> NaN Invalid_operation +ddmng179 minmag NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddmng181 minmag NaN9 -Inf -> -Infinity +ddmng182 minmag -NaN8 9990 -> 9990 +ddmng183 minmag NaN71 Inf -> Infinity + +ddmng184 minmag NaN1 NaN54 -> NaN1 +ddmng185 minmag NaN22 -NaN53 -> NaN22 +ddmng186 minmag -NaN3 NaN6 -> -NaN3 +ddmng187 minmag -NaN44 NaN7 -> -NaN44 + +ddmng188 minmag -Inf NaN41 -> -Infinity +ddmng189 minmag -9999 -NaN33 -> -9999 +ddmng190 minmag Inf NaN2 -> Infinity + +ddmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation +ddmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation +ddmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation +ddmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation +ddmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation +ddmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation +ddmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation +ddmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation +ddmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation + +-- old rounding checks +ddmng221 minmag -12345678000 1 -> 1 +ddmng222 minmag 1 -12345678000 -> 1 +ddmng223 minmag -1234567800 1 -> 1 +ddmng224 minmag 1 -1234567800 -> 1 +ddmng225 minmag -1234567890 1 -> 1 +ddmng226 minmag 1 -1234567890 -> 1 +ddmng227 minmag -1234567891 1 -> 1 +ddmng228 minmag 1 -1234567891 -> 1 +ddmng229 minmag -12345678901 1 -> 1 +ddmng230 minmag 1 -12345678901 -> 1 +ddmng231 minmag -1234567896 1 -> 1 +ddmng232 minmag 1 -1234567896 -> 1 +ddmng233 minmag 1234567891 1 -> 1 +ddmng234 minmag 1 1234567891 -> 1 +ddmng235 minmag 12345678901 1 -> 1 +ddmng236 minmag 1 12345678901 -> 1 +ddmng237 minmag 1234567896 1 -> 1 +ddmng238 minmag 1 1234567896 -> 1 + +-- from examples +ddmng280 minmag '3' '2' -> '2' +ddmng281 minmag '-10' '3' -> '3' +ddmng282 minmag '1.0' '1' -> '1.0' +ddmng283 minmag '1' '1.0' -> '1.0' +ddmng284 minmag '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +ddmng401 minmag Inf 1.1 -> 1.1 +ddmng402 minmag 1.1 1 -> 1 +ddmng403 minmag 1 1.0 -> 1.0 +ddmng404 minmag 1.0 0.1 -> 0.1 +ddmng405 minmag 0.1 0.10 -> 0.10 +ddmng406 minmag 0.10 0.100 -> 0.100 +ddmng407 minmag 0.10 0 -> 0 +ddmng408 minmag 0 0.0 -> 0.0 +ddmng409 minmag 0.0 -0 -> -0 +ddmng410 minmag 0.0 -0.0 -> -0.0 +ddmng411 minmag 0.00 -0.0 -> -0.0 +ddmng412 minmag 0.0 -0.00 -> -0.00 +ddmng413 minmag 0 -0.0 -> -0.0 +ddmng414 minmag 0 -0 -> -0 +ddmng415 minmag -0.0 -0 -> -0 +ddmng416 minmag -0 -0.100 -> -0 +ddmng417 minmag -0.100 -0.10 -> -0.10 +ddmng418 minmag -0.10 -0.1 -> -0.1 +ddmng419 minmag -0.1 -1.0 -> -0.1 +ddmng420 minmag -1.0 -1 -> -1 +ddmng421 minmag -1 -1.1 -> -1 +ddmng423 minmag -1.1 -Inf -> -1.1 +-- same with operands reversed +ddmng431 minmag 1.1 Inf -> 1.1 +ddmng432 minmag 1 1.1 -> 1 +ddmng433 minmag 1.0 1 -> 1.0 +ddmng434 minmag 0.1 1.0 -> 0.1 +ddmng435 minmag 0.10 0.1 -> 0.10 +ddmng436 minmag 0.100 0.10 -> 0.100 +ddmng437 minmag 0 0.10 -> 0 +ddmng438 minmag 0.0 0 -> 0.0 +ddmng439 minmag -0 0.0 -> -0 +ddmng440 minmag -0.0 0.0 -> -0.0 +ddmng441 minmag -0.0 0.00 -> -0.0 +ddmng442 minmag -0.00 0.0 -> -0.00 +ddmng443 minmag -0.0 0 -> -0.0 +ddmng444 minmag -0 0 -> -0 +ddmng445 minmag -0 -0.0 -> -0 +ddmng446 minmag -0.100 -0 -> -0 +ddmng447 minmag -0.10 -0.100 -> -0.10 +ddmng448 minmag -0.1 -0.10 -> -0.1 +ddmng449 minmag -1.0 -0.1 -> -0.1 +ddmng450 minmag -1 -1.0 -> -1 +ddmng451 minmag -1.1 -1 -> -1 +ddmng453 minmag -Inf -1.1 -> -1.1 +-- largies +ddmng460 minmag 1000 1E+3 -> 1000 +ddmng461 minmag 1E+3 1000 -> 1000 +ddmng462 minmag 1000 -1E+3 -> -1E+3 +ddmng463 minmag 1E+3 -384 -> -384 +ddmng464 minmag -384 1E+3 -> -384 +ddmng465 minmag -1E+3 1000 -> -1E+3 +ddmng466 minmag -384 -1E+3 -> -384 +ddmng467 minmag -1E+3 -384 -> -384 + +-- subnormals +ddmng510 minmag 1.00E-383 0 -> 0 +ddmng511 minmag 0.1E-383 0 -> 0 +ddmng512 minmag 0.10E-383 0 -> 0 +ddmng513 minmag 0.100E-383 0 -> 0 +ddmng514 minmag 0.01E-383 0 -> 0 +ddmng515 minmag 0.999E-383 0 -> 0 +ddmng516 minmag 0.099E-383 0 -> 0 +ddmng517 minmag 0.009E-383 0 -> 0 +ddmng518 minmag 0.001E-383 0 -> 0 +ddmng519 minmag 0.0009E-383 0 -> 0 +ddmng520 minmag 0.0001E-383 0 -> 0 + +ddmng530 minmag -1.00E-383 0 -> 0 +ddmng531 minmag -0.1E-383 0 -> 0 +ddmng532 minmag -0.10E-383 0 -> 0 +ddmng533 minmag -0.100E-383 0 -> 0 +ddmng534 minmag -0.01E-383 0 -> 0 +ddmng535 minmag -0.999E-383 0 -> 0 +ddmng536 minmag -0.099E-383 0 -> 0 +ddmng537 minmag -0.009E-383 0 -> 0 +ddmng538 minmag -0.001E-383 0 -> 0 +ddmng539 minmag -0.0009E-383 0 -> 0 +ddmng540 minmag -0.0001E-383 0 -> 0 + + +-- Null tests +ddmng900 minmag 10 # -> NaN Invalid_operation +ddmng901 minmag # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMinus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMinus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- ddMinus.decTest -- decDouble 0-x -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddmns001 minus +7.50 -> -7.50 + +-- Infinities +ddmns011 minus Infinity -> -Infinity +ddmns012 minus -Infinity -> Infinity + +-- NaNs, 0 payload +ddmns021 minus NaN -> NaN +ddmns022 minus -NaN -> -NaN +ddmns023 minus sNaN -> NaN Invalid_operation +ddmns024 minus -sNaN -> -NaN Invalid_operation + +-- NaNs, non-0 payload +ddmns031 minus NaN13 -> NaN13 +ddmns032 minus -NaN13 -> -NaN13 +ddmns033 minus sNaN13 -> NaN13 Invalid_operation +ddmns034 minus -sNaN13 -> -NaN13 Invalid_operation +ddmns035 minus NaN70 -> NaN70 +ddmns036 minus -NaN70 -> -NaN70 +ddmns037 minus sNaN101 -> NaN101 Invalid_operation +ddmns038 minus -sNaN101 -> -NaN101 Invalid_operation + +-- finites +ddmns101 minus 7 -> -7 +ddmns102 minus -7 -> 7 +ddmns103 minus 75 -> -75 +ddmns104 minus -75 -> 75 +ddmns105 minus 7.50 -> -7.50 +ddmns106 minus -7.50 -> 7.50 +ddmns107 minus 7.500 -> -7.500 +ddmns108 minus -7.500 -> 7.500 + +-- zeros +ddmns111 minus 0 -> 0 +ddmns112 minus -0 -> 0 +ddmns113 minus 0E+4 -> 0E+4 +ddmns114 minus -0E+4 -> 0E+4 +ddmns115 minus 0.0000 -> 0.0000 +ddmns116 minus -0.0000 -> 0.0000 +ddmns117 minus 0E-141 -> 0E-141 +ddmns118 minus -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +ddmns121 minus 2682682682682682 -> -2682682682682682 +ddmns122 minus -2682682682682682 -> 2682682682682682 +ddmns123 minus 1341341341341341 -> -1341341341341341 +ddmns124 minus -1341341341341341 -> 1341341341341341 + +-- Nmax, Nmin, Ntiny +ddmns131 minus 9.999999999999999E+384 -> -9.999999999999999E+384 +ddmns132 minus 1E-383 -> -1E-383 +ddmns133 minus 1.000000000000000E-383 -> -1.000000000000000E-383 +ddmns134 minus 1E-398 -> -1E-398 Subnormal + +ddmns135 minus -1E-398 -> 1E-398 Subnormal +ddmns136 minus -1.000000000000000E-383 -> 1.000000000000000E-383 +ddmns137 minus -1E-383 -> 1E-383 +ddmns138 minus -9.999999999999999E+384 -> 9.999999999999999E+384 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMultiply.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddMultiply.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,553 @@ +------------------------------------------------------------------------ +-- ddMultiply.decTest -- decDouble multiplication -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests are for decDoubles only; all arguments are +-- representable in a decDouble +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddmul000 multiply 2 2 -> 4 +ddmul001 multiply 2 3 -> 6 +ddmul002 multiply 5 1 -> 5 +ddmul003 multiply 5 2 -> 10 +ddmul004 multiply 1.20 2 -> 2.40 +ddmul005 multiply 1.20 0 -> 0.00 +ddmul006 multiply 1.20 -2 -> -2.40 +ddmul007 multiply -1.20 2 -> -2.40 +ddmul008 multiply -1.20 0 -> -0.00 +ddmul009 multiply -1.20 -2 -> 2.40 +ddmul010 multiply 5.09 7.1 -> 36.139 +ddmul011 multiply 2.5 4 -> 10.0 +ddmul012 multiply 2.50 4 -> 10.00 +ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded +ddmul015 multiply 2.50 4 -> 10.00 +ddmul016 multiply 9.999999999 9.999999999 -> 99.99999998000000 Inexact Rounded +ddmul017 multiply 9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded +ddmul018 multiply -9.999999999 9.999999999 -> -99.99999998000000 Inexact Rounded +ddmul019 multiply -9.999999999 -9.999999999 -> 99.99999998000000 Inexact Rounded + +-- zeros, etc. +ddmul021 multiply 0 0 -> 0 +ddmul022 multiply 0 -0 -> -0 +ddmul023 multiply -0 0 -> -0 +ddmul024 multiply -0 -0 -> 0 +ddmul025 multiply -0.0 -0.0 -> 0.00 +ddmul026 multiply -0.0 -0.0 -> 0.00 +ddmul027 multiply -0.0 -0.0 -> 0.00 +ddmul028 multiply -0.0 -0.0 -> 0.00 +ddmul030 multiply 5.00 1E-3 -> 0.00500 +ddmul031 multiply 00.00 0.000 -> 0.00000 +ddmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0 +ddmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0 +ddmul034 multiply -5.00 1E-3 -> -0.00500 +ddmul035 multiply -00.00 0.000 -> -0.00000 +ddmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0 +ddmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0 +ddmul038 multiply 5.00 -1E-3 -> -0.00500 +ddmul039 multiply 00.00 -0.000 -> -0.00000 +ddmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0 +ddmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0 +ddmul042 multiply -5.00 -1E-3 -> 0.00500 +ddmul043 multiply -00.00 -0.000 -> 0.00000 +ddmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0 +ddmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0 + +-- examples from decarith +ddmul050 multiply 1.20 3 -> 3.60 +ddmul051 multiply 7 3 -> 21 +ddmul052 multiply 0.9 0.8 -> 0.72 +ddmul053 multiply 0.9 -0 -> -0.0 +ddmul054 multiply 654321 654321 -> 428135971041 + +ddmul060 multiply 123.45 1e7 -> 1.2345E+9 +ddmul061 multiply 123.45 1e8 -> 1.2345E+10 +ddmul062 multiply 123.45 1e+9 -> 1.2345E+11 +ddmul063 multiply 123.45 1e10 -> 1.2345E+12 +ddmul064 multiply 123.45 1e11 -> 1.2345E+13 +ddmul065 multiply 123.45 1e12 -> 1.2345E+14 +ddmul066 multiply 123.45 1e13 -> 1.2345E+15 + + +-- test some intermediate lengths +-- 1234567890123456 +ddmul080 multiply 0.1 1230123456456789 -> 123012345645678.9 +ddmul084 multiply 0.1 1230123456456789 -> 123012345645678.9 +ddmul090 multiply 1230123456456789 0.1 -> 123012345645678.9 +ddmul094 multiply 1230123456456789 0.1 -> 123012345645678.9 + +-- test some more edge cases and carries +ddmul101 multiply 9 9 -> 81 +ddmul102 multiply 9 90 -> 810 +ddmul103 multiply 9 900 -> 8100 +ddmul104 multiply 9 9000 -> 81000 +ddmul105 multiply 9 90000 -> 810000 +ddmul106 multiply 9 900000 -> 8100000 +ddmul107 multiply 9 9000000 -> 81000000 +ddmul108 multiply 9 90000000 -> 810000000 +ddmul109 multiply 9 900000000 -> 8100000000 +ddmul110 multiply 9 9000000000 -> 81000000000 +ddmul111 multiply 9 90000000000 -> 810000000000 +ddmul112 multiply 9 900000000000 -> 8100000000000 +ddmul113 multiply 9 9000000000000 -> 81000000000000 +ddmul114 multiply 9 90000000000000 -> 810000000000000 +ddmul115 multiply 9 900000000000000 -> 8100000000000000 +--ddmul116 multiply 9 9000000000000000 -> 81000000000000000 +--ddmul117 multiply 9 90000000000000000 -> 810000000000000000 +--ddmul118 multiply 9 900000000000000000 -> 8100000000000000000 +--ddmul119 multiply 9 9000000000000000000 -> 81000000000000000000 +--ddmul120 multiply 9 90000000000000000000 -> 810000000000000000000 +--ddmul121 multiply 9 900000000000000000000 -> 8100000000000000000000 +--ddmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000 +--ddmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000 +-- test some more edge cases without carries +ddmul131 multiply 3 3 -> 9 +ddmul132 multiply 3 30 -> 90 +ddmul133 multiply 3 300 -> 900 +ddmul134 multiply 3 3000 -> 9000 +ddmul135 multiply 3 30000 -> 90000 +ddmul136 multiply 3 300000 -> 900000 +ddmul137 multiply 3 3000000 -> 9000000 +ddmul138 multiply 3 30000000 -> 90000000 +ddmul139 multiply 3 300000000 -> 900000000 +ddmul140 multiply 3 3000000000 -> 9000000000 +ddmul141 multiply 3 30000000000 -> 90000000000 +ddmul142 multiply 3 300000000000 -> 900000000000 +ddmul143 multiply 3 3000000000000 -> 9000000000000 +ddmul144 multiply 3 30000000000000 -> 90000000000000 +ddmul145 multiply 3 300000000000000 -> 900000000000000 + +-- test some edge cases with exact rounding +ddmul301 multiply 9 9 -> 81 +ddmul302 multiply 9 90 -> 810 +ddmul303 multiply 9 900 -> 8100 +ddmul304 multiply 9 9000 -> 81000 +ddmul305 multiply 9 90000 -> 810000 +ddmul306 multiply 9 900000 -> 8100000 +ddmul307 multiply 9 9000000 -> 81000000 +ddmul308 multiply 9 90000000 -> 810000000 +ddmul309 multiply 9 900000000 -> 8100000000 +ddmul310 multiply 9 9000000000 -> 81000000000 +ddmul311 multiply 9 90000000000 -> 810000000000 +ddmul312 multiply 9 900000000000 -> 8100000000000 +ddmul313 multiply 9 9000000000000 -> 81000000000000 +ddmul314 multiply 9 90000000000000 -> 810000000000000 +ddmul315 multiply 9 900000000000000 -> 8100000000000000 +ddmul316 multiply 9 9000000000000000 -> 8.100000000000000E+16 Rounded +ddmul317 multiply 90 9000000000000000 -> 8.100000000000000E+17 Rounded +ddmul318 multiply 900 9000000000000000 -> 8.100000000000000E+18 Rounded +ddmul319 multiply 9000 9000000000000000 -> 8.100000000000000E+19 Rounded +ddmul320 multiply 90000 9000000000000000 -> 8.100000000000000E+20 Rounded +ddmul321 multiply 900000 9000000000000000 -> 8.100000000000000E+21 Rounded +ddmul322 multiply 9000000 9000000000000000 -> 8.100000000000000E+22 Rounded +ddmul323 multiply 90000000 9000000000000000 -> 8.100000000000000E+23 Rounded + +-- tryzeros cases +ddmul504 multiply 0E-260 1000E-260 -> 0E-398 Clamped +ddmul505 multiply 100E+260 0E+260 -> 0E+369 Clamped +-- 65K-1 case +ddmul506 multiply 77.1 850 -> 65535.0 + +-- mixed with zeros +ddmul541 multiply 0 -1 -> -0 +ddmul542 multiply -0 -1 -> 0 +ddmul543 multiply 0 1 -> 0 +ddmul544 multiply -0 1 -> -0 +ddmul545 multiply -1 0 -> -0 +ddmul546 multiply -1 -0 -> 0 +ddmul547 multiply 1 0 -> 0 +ddmul548 multiply 1 -0 -> -0 + +ddmul551 multiply 0.0 -1 -> -0.0 +ddmul552 multiply -0.0 -1 -> 0.0 +ddmul553 multiply 0.0 1 -> 0.0 +ddmul554 multiply -0.0 1 -> -0.0 +ddmul555 multiply -1.0 0 -> -0.0 +ddmul556 multiply -1.0 -0 -> 0.0 +ddmul557 multiply 1.0 0 -> 0.0 +ddmul558 multiply 1.0 -0 -> -0.0 + +ddmul561 multiply 0 -1.0 -> -0.0 +ddmul562 multiply -0 -1.0 -> 0.0 +ddmul563 multiply 0 1.0 -> 0.0 +ddmul564 multiply -0 1.0 -> -0.0 +ddmul565 multiply -1 0.0 -> -0.0 +ddmul566 multiply -1 -0.0 -> 0.0 +ddmul567 multiply 1 0.0 -> 0.0 +ddmul568 multiply 1 -0.0 -> -0.0 + +ddmul571 multiply 0.0 -1.0 -> -0.00 +ddmul572 multiply -0.0 -1.0 -> 0.00 +ddmul573 multiply 0.0 1.0 -> 0.00 +ddmul574 multiply -0.0 1.0 -> -0.00 +ddmul575 multiply -1.0 0.0 -> -0.00 +ddmul576 multiply -1.0 -0.0 -> 0.00 +ddmul577 multiply 1.0 0.0 -> 0.00 +ddmul578 multiply 1.0 -0.0 -> -0.00 + + +-- Specials +ddmul580 multiply Inf -Inf -> -Infinity +ddmul581 multiply Inf -1000 -> -Infinity +ddmul582 multiply Inf -1 -> -Infinity +ddmul583 multiply Inf -0 -> NaN Invalid_operation +ddmul584 multiply Inf 0 -> NaN Invalid_operation +ddmul585 multiply Inf 1 -> Infinity +ddmul586 multiply Inf 1000 -> Infinity +ddmul587 multiply Inf Inf -> Infinity +ddmul588 multiply -1000 Inf -> -Infinity +ddmul589 multiply -Inf Inf -> -Infinity +ddmul590 multiply -1 Inf -> -Infinity +ddmul591 multiply -0 Inf -> NaN Invalid_operation +ddmul592 multiply 0 Inf -> NaN Invalid_operation +ddmul593 multiply 1 Inf -> Infinity +ddmul594 multiply 1000 Inf -> Infinity +ddmul595 multiply Inf Inf -> Infinity + +ddmul600 multiply -Inf -Inf -> Infinity +ddmul601 multiply -Inf -1000 -> Infinity +ddmul602 multiply -Inf -1 -> Infinity +ddmul603 multiply -Inf -0 -> NaN Invalid_operation +ddmul604 multiply -Inf 0 -> NaN Invalid_operation +ddmul605 multiply -Inf 1 -> -Infinity +ddmul606 multiply -Inf 1000 -> -Infinity +ddmul607 multiply -Inf Inf -> -Infinity +ddmul608 multiply -1000 Inf -> -Infinity +ddmul609 multiply -Inf -Inf -> Infinity +ddmul610 multiply -1 -Inf -> Infinity +ddmul611 multiply -0 -Inf -> NaN Invalid_operation +ddmul612 multiply 0 -Inf -> NaN Invalid_operation +ddmul613 multiply 1 -Inf -> -Infinity +ddmul614 multiply 1000 -Inf -> -Infinity +ddmul615 multiply Inf -Inf -> -Infinity + +ddmul621 multiply NaN -Inf -> NaN +ddmul622 multiply NaN -1000 -> NaN +ddmul623 multiply NaN -1 -> NaN +ddmul624 multiply NaN -0 -> NaN +ddmul625 multiply NaN 0 -> NaN +ddmul626 multiply NaN 1 -> NaN +ddmul627 multiply NaN 1000 -> NaN +ddmul628 multiply NaN Inf -> NaN +ddmul629 multiply NaN NaN -> NaN +ddmul630 multiply -Inf NaN -> NaN +ddmul631 multiply -1000 NaN -> NaN +ddmul632 multiply -1 NaN -> NaN +ddmul633 multiply -0 NaN -> NaN +ddmul634 multiply 0 NaN -> NaN +ddmul635 multiply 1 NaN -> NaN +ddmul636 multiply 1000 NaN -> NaN +ddmul637 multiply Inf NaN -> NaN + +ddmul641 multiply sNaN -Inf -> NaN Invalid_operation +ddmul642 multiply sNaN -1000 -> NaN Invalid_operation +ddmul643 multiply sNaN -1 -> NaN Invalid_operation +ddmul644 multiply sNaN -0 -> NaN Invalid_operation +ddmul645 multiply sNaN 0 -> NaN Invalid_operation +ddmul646 multiply sNaN 1 -> NaN Invalid_operation +ddmul647 multiply sNaN 1000 -> NaN Invalid_operation +ddmul648 multiply sNaN NaN -> NaN Invalid_operation +ddmul649 multiply sNaN sNaN -> NaN Invalid_operation +ddmul650 multiply NaN sNaN -> NaN Invalid_operation +ddmul651 multiply -Inf sNaN -> NaN Invalid_operation +ddmul652 multiply -1000 sNaN -> NaN Invalid_operation +ddmul653 multiply -1 sNaN -> NaN Invalid_operation +ddmul654 multiply -0 sNaN -> NaN Invalid_operation +ddmul655 multiply 0 sNaN -> NaN Invalid_operation +ddmul656 multiply 1 sNaN -> NaN Invalid_operation +ddmul657 multiply 1000 sNaN -> NaN Invalid_operation +ddmul658 multiply Inf sNaN -> NaN Invalid_operation +ddmul659 multiply NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddmul661 multiply NaN9 -Inf -> NaN9 +ddmul662 multiply NaN8 999 -> NaN8 +ddmul663 multiply NaN71 Inf -> NaN71 +ddmul664 multiply NaN6 NaN5 -> NaN6 +ddmul665 multiply -Inf NaN4 -> NaN4 +ddmul666 multiply -999 NaN33 -> NaN33 +ddmul667 multiply Inf NaN2 -> NaN2 + +ddmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation +ddmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation +ddmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation +ddmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation +ddmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation +ddmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation +ddmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation +ddmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation +ddmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation + +ddmul681 multiply -NaN9 -Inf -> -NaN9 +ddmul682 multiply -NaN8 999 -> -NaN8 +ddmul683 multiply -NaN71 Inf -> -NaN71 +ddmul684 multiply -NaN6 -NaN5 -> -NaN6 +ddmul685 multiply -Inf -NaN4 -> -NaN4 +ddmul686 multiply -999 -NaN33 -> -NaN33 +ddmul687 multiply Inf -NaN2 -> -NaN2 + +ddmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation +ddmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation +ddmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation +ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation +ddmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation +ddmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation +ddmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation +ddmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation +ddmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation + +ddmul701 multiply -NaN -Inf -> -NaN +ddmul702 multiply -NaN 999 -> -NaN +ddmul703 multiply -NaN Inf -> -NaN +ddmul704 multiply -NaN -NaN -> -NaN +ddmul705 multiply -Inf -NaN0 -> -NaN +ddmul706 multiply -999 -NaN -> -NaN +ddmul707 multiply Inf -NaN -> -NaN + +ddmul711 multiply -sNaN -Inf -> -NaN Invalid_operation +ddmul712 multiply -sNaN -11 -> -NaN Invalid_operation +ddmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation +ddmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation +ddmul715 multiply -NaN -sNaN -> -NaN Invalid_operation +ddmul716 multiply -Inf -sNaN -> -NaN Invalid_operation +ddmul717 multiply 088 -sNaN -> -NaN Invalid_operation +ddmul718 multiply Inf -sNaN -> -NaN Invalid_operation +ddmul719 multiply -NaN -sNaN -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +-- signs +ddmul751 multiply 1e+277 1e+311 -> Infinity Overflow Inexact Rounded +ddmul752 multiply 1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded +ddmul753 multiply -1e+277 1e+311 -> -Infinity Overflow Inexact Rounded +ddmul754 multiply -1e+277 -1e+311 -> Infinity Overflow Inexact Rounded +ddmul755 multiply 1e-277 1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul756 multiply 1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul757 multiply -1e-277 1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul758 multiply -1e-277 -1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal +ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal +ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal +ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal +ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal +ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal +ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal +ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381 Clamped +ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382 Clamped +ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383 Clamped +ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384 Clamped +ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded +ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded +ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded +ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded +ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded +ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded + +ddmul801 multiply 1.0000E-394 1 -> 1.0000E-394 Subnormal +ddmul802 multiply 1.000E-394 1e-1 -> 1.000E-395 Subnormal +ddmul803 multiply 1.00E-394 1e-2 -> 1.00E-396 Subnormal +ddmul804 multiply 1.0E-394 1e-3 -> 1.0E-397 Subnormal +ddmul805 multiply 1.0E-394 1e-4 -> 1E-398 Subnormal Rounded +ddmul806 multiply 1.3E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded +ddmul807 multiply 1.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul808 multiply 1.7E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul809 multiply 2.3E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul810 multiply 2.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul811 multiply 2.7E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded +ddmul812 multiply 1.49E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded +ddmul813 multiply 1.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul814 multiply 1.51E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul815 multiply 2.49E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul816 multiply 2.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded +ddmul817 multiply 2.51E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded + +ddmul818 multiply 1E-394 1e-4 -> 1E-398 Subnormal +ddmul819 multiply 3E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul820 multiply 5E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul821 multiply 7E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded +ddmul822 multiply 9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded +ddmul823 multiply 9.9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded + +ddmul824 multiply 1E-394 -1e-4 -> -1E-398 Subnormal +ddmul825 multiply 3E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul826 multiply -5E-394 1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul827 multiply 7E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded +ddmul828 multiply -9E-394 1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded +ddmul829 multiply 9.9E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded +ddmul830 multiply 3.0E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped + +ddmul831 multiply 1.0E-199 1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddmul832 multiply 1.0E-199 1e-199 -> 1E-398 Subnormal Rounded +ddmul833 multiply 1.0E-199 1e-198 -> 1.0E-397 Subnormal +ddmul834 multiply 2.0E-199 2e-198 -> 4.0E-397 Subnormal +ddmul835 multiply 4.0E-199 4e-198 -> 1.60E-396 Subnormal +ddmul836 multiply 10.0E-199 10e-198 -> 1.000E-395 Subnormal +ddmul837 multiply 30.0E-199 30e-198 -> 9.000E-395 Subnormal +ddmul838 multiply 40.0E-199 40e-188 -> 1.6000E-384 Subnormal +ddmul839 multiply 40.0E-199 40e-187 -> 1.6000E-383 +ddmul840 multiply 40.0E-199 40e-186 -> 1.6000E-382 + +-- Long operand overflow may be a different path +ddmul870 multiply 100 9.999E+383 -> Infinity Inexact Overflow Rounded +ddmul871 multiply 100 -9.999E+383 -> -Infinity Inexact Overflow Rounded +ddmul872 multiply 9.999E+383 100 -> Infinity Inexact Overflow Rounded +ddmul873 multiply -9.999E+383 100 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +ddmul881 multiply 1.2347E-355 1.2347E-40 -> 1.524E-395 Inexact Rounded Subnormal Underflow +ddmul882 multiply 1.234E-355 1.234E-40 -> 1.523E-395 Inexact Rounded Subnormal Underflow +ddmul883 multiply 1.23E-355 1.23E-40 -> 1.513E-395 Inexact Rounded Subnormal Underflow +ddmul884 multiply 1.2E-355 1.2E-40 -> 1.44E-395 Subnormal +ddmul885 multiply 1.2E-355 1.2E-41 -> 1.44E-396 Subnormal +ddmul886 multiply 1.2E-355 1.2E-42 -> 1.4E-397 Subnormal Inexact Rounded Underflow +ddmul887 multiply 1.2E-355 1.3E-42 -> 1.6E-397 Subnormal Inexact Rounded Underflow +ddmul888 multiply 1.3E-355 1.3E-42 -> 1.7E-397 Subnormal Inexact Rounded Underflow +ddmul889 multiply 1.3E-355 1.3E-43 -> 2E-398 Subnormal Inexact Rounded Underflow +ddmul890 multiply 1.3E-356 1.3E-43 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow + +ddmul891 multiply 1.2345E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow +ddmul892 multiply 1.23456E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow +ddmul893 multiply 1.2345E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow +ddmul894 multiply 1.23456E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow +ddmul895 multiply 1.2345E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow +ddmul896 multiply 1.23456E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +-- 1 234567890123456 +ddmul900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded +ddmul901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded +ddmul902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded +ddmul903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded +ddmul904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded +ddmul905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded +-- The next rounds to Nmin (b**emin); this is the distinguishing case +-- for detecting tininess (before or after rounding) -- if after +-- rounding then the result would be the same, but the Underflow flag +-- would not be set +ddmul906 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +-- prove those operands were exact +ddmul907 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383 +ddmul908 multiply 1 0.09999999999999999 -> 0.09999999999999999 + +-- reducing tiniest +ddmul910 multiply 1e-398 0.99 -> 1E-398 Subnormal Inexact Rounded Underflow +ddmul911 multiply 1e-398 0.75 -> 1E-398 Subnormal Inexact Rounded Underflow +ddmul912 multiply 1e-398 0.5 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +ddmul913 multiply 1e-398 0.25 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +ddmul914 multiply 1e-398 0.01 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- hugest +ddmul920 multiply 9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded + +-- power-of-ten edge cases +ddmul1001 multiply 1 10 -> 10 +ddmul1002 multiply 1 100 -> 100 +ddmul1003 multiply 1 1000 -> 1000 +ddmul1004 multiply 1 10000 -> 10000 +ddmul1005 multiply 1 100000 -> 100000 +ddmul1006 multiply 1 1000000 -> 1000000 +ddmul1007 multiply 1 10000000 -> 10000000 +ddmul1008 multiply 1 100000000 -> 100000000 +ddmul1009 multiply 1 1000000000 -> 1000000000 +ddmul1010 multiply 1 10000000000 -> 10000000000 +ddmul1011 multiply 1 100000000000 -> 100000000000 +ddmul1012 multiply 1 1000000000000 -> 1000000000000 +ddmul1013 multiply 1 10000000000000 -> 10000000000000 +ddmul1014 multiply 1 100000000000000 -> 100000000000000 +ddmul1015 multiply 1 1000000000000000 -> 1000000000000000 +ddmul1021 multiply 10 1 -> 10 +ddmul1022 multiply 10 10 -> 100 +ddmul1023 multiply 10 100 -> 1000 +ddmul1024 multiply 10 1000 -> 10000 +ddmul1025 multiply 10 10000 -> 100000 +ddmul1026 multiply 10 100000 -> 1000000 +ddmul1027 multiply 10 1000000 -> 10000000 +ddmul1028 multiply 10 10000000 -> 100000000 +ddmul1029 multiply 10 100000000 -> 1000000000 +ddmul1030 multiply 10 1000000000 -> 10000000000 +ddmul1031 multiply 10 10000000000 -> 100000000000 +ddmul1032 multiply 10 100000000000 -> 1000000000000 +ddmul1033 multiply 10 1000000000000 -> 10000000000000 +ddmul1034 multiply 10 10000000000000 -> 100000000000000 +ddmul1035 multiply 10 100000000000000 -> 1000000000000000 +ddmul1041 multiply 100 0.1 -> 10.0 +ddmul1042 multiply 100 1 -> 100 +ddmul1043 multiply 100 10 -> 1000 +ddmul1044 multiply 100 100 -> 10000 +ddmul1045 multiply 100 1000 -> 100000 +ddmul1046 multiply 100 10000 -> 1000000 +ddmul1047 multiply 100 100000 -> 10000000 +ddmul1048 multiply 100 1000000 -> 100000000 +ddmul1049 multiply 100 10000000 -> 1000000000 +ddmul1050 multiply 100 100000000 -> 10000000000 +ddmul1051 multiply 100 1000000000 -> 100000000000 +ddmul1052 multiply 100 10000000000 -> 1000000000000 +ddmul1053 multiply 100 100000000000 -> 10000000000000 +ddmul1054 multiply 100 1000000000000 -> 100000000000000 +ddmul1055 multiply 100 10000000000000 -> 1000000000000000 +ddmul1061 multiply 1000 0.01 -> 10.00 +ddmul1062 multiply 1000 0.1 -> 100.0 +ddmul1063 multiply 1000 1 -> 1000 +ddmul1064 multiply 1000 10 -> 10000 +ddmul1065 multiply 1000 100 -> 100000 +ddmul1066 multiply 1000 1000 -> 1000000 +ddmul1067 multiply 1000 10000 -> 10000000 +ddmul1068 multiply 1000 100000 -> 100000000 +ddmul1069 multiply 1000 1000000 -> 1000000000 +ddmul1070 multiply 1000 10000000 -> 10000000000 +ddmul1071 multiply 1000 100000000 -> 100000000000 +ddmul1072 multiply 1000 1000000000 -> 1000000000000 +ddmul1073 multiply 1000 10000000000 -> 10000000000000 +ddmul1074 multiply 1000 100000000000 -> 100000000000000 +ddmul1075 multiply 1000 1000000000000 -> 1000000000000000 +ddmul1081 multiply 10000 0.001 -> 10.000 +ddmul1082 multiply 10000 0.01 -> 100.00 +ddmul1083 multiply 10000 0.1 -> 1000.0 +ddmul1084 multiply 10000 1 -> 10000 +ddmul1085 multiply 10000 10 -> 100000 +ddmul1086 multiply 10000 100 -> 1000000 +ddmul1087 multiply 10000 1000 -> 10000000 +ddmul1088 multiply 10000 10000 -> 100000000 +ddmul1089 multiply 10000 100000 -> 1000000000 +ddmul1090 multiply 10000 1000000 -> 10000000000 +ddmul1091 multiply 10000 10000000 -> 100000000000 +ddmul1092 multiply 10000 100000000 -> 1000000000000 +ddmul1093 multiply 10000 1000000000 -> 10000000000000 +ddmul1094 multiply 10000 10000000000 -> 100000000000000 +ddmul1095 multiply 10000 100000000000 -> 1000000000000000 + +ddmul1097 multiply 10000 99999999999 -> 999999999990000 +ddmul1098 multiply 10000 99999999999 -> 999999999990000 + + +-- Null tests +ddmul9990 multiply 10 # -> NaN Invalid_operation +ddmul9991 multiply # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextMinus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextMinus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,126 @@ +------------------------------------------------------------------------ +-- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddnextm001 nextminus 0.9999999999999995 -> 0.9999999999999994 +ddnextm002 nextminus 0.9999999999999996 -> 0.9999999999999995 +ddnextm003 nextminus 0.9999999999999997 -> 0.9999999999999996 +ddnextm004 nextminus 0.9999999999999998 -> 0.9999999999999997 +ddnextm005 nextminus 0.9999999999999999 -> 0.9999999999999998 +ddnextm006 nextminus 1.000000000000000 -> 0.9999999999999999 +ddnextm007 nextminus 1.0 -> 0.9999999999999999 +ddnextm008 nextminus 1 -> 0.9999999999999999 +ddnextm009 nextminus 1.000000000000001 -> 1.000000000000000 +ddnextm010 nextminus 1.000000000000002 -> 1.000000000000001 +ddnextm011 nextminus 1.000000000000003 -> 1.000000000000002 +ddnextm012 nextminus 1.000000000000004 -> 1.000000000000003 +ddnextm013 nextminus 1.000000000000005 -> 1.000000000000004 +ddnextm014 nextminus 1.000000000000006 -> 1.000000000000005 +ddnextm015 nextminus 1.000000000000007 -> 1.000000000000006 +ddnextm016 nextminus 1.000000000000008 -> 1.000000000000007 +ddnextm017 nextminus 1.000000000000009 -> 1.000000000000008 +ddnextm018 nextminus 1.000000000000010 -> 1.000000000000009 +ddnextm019 nextminus 1.000000000000011 -> 1.000000000000010 +ddnextm020 nextminus 1.000000000000012 -> 1.000000000000011 + +ddnextm021 nextminus -0.9999999999999995 -> -0.9999999999999996 +ddnextm022 nextminus -0.9999999999999996 -> -0.9999999999999997 +ddnextm023 nextminus -0.9999999999999997 -> -0.9999999999999998 +ddnextm024 nextminus -0.9999999999999998 -> -0.9999999999999999 +ddnextm025 nextminus -0.9999999999999999 -> -1.000000000000000 +ddnextm026 nextminus -1.000000000000000 -> -1.000000000000001 +ddnextm027 nextminus -1.0 -> -1.000000000000001 +ddnextm028 nextminus -1 -> -1.000000000000001 +ddnextm029 nextminus -1.000000000000001 -> -1.000000000000002 +ddnextm030 nextminus -1.000000000000002 -> -1.000000000000003 +ddnextm031 nextminus -1.000000000000003 -> -1.000000000000004 +ddnextm032 nextminus -1.000000000000004 -> -1.000000000000005 +ddnextm033 nextminus -1.000000000000005 -> -1.000000000000006 +ddnextm034 nextminus -1.000000000000006 -> -1.000000000000007 +ddnextm035 nextminus -1.000000000000007 -> -1.000000000000008 +ddnextm036 nextminus -1.000000000000008 -> -1.000000000000009 +ddnextm037 nextminus -1.000000000000009 -> -1.000000000000010 +ddnextm038 nextminus -1.000000000000010 -> -1.000000000000011 +ddnextm039 nextminus -1.000000000000011 -> -1.000000000000012 + +-- ultra-tiny inputs +ddnextm062 nextminus 1E-398 -> 0E-398 +ddnextm065 nextminus -1E-398 -> -2E-398 + +-- Zeros +ddnextm100 nextminus -0 -> -1E-398 +ddnextm101 nextminus 0 -> -1E-398 +ddnextm102 nextminus 0.00 -> -1E-398 +ddnextm103 nextminus -0.00 -> -1E-398 +ddnextm104 nextminus 0E-300 -> -1E-398 +ddnextm105 nextminus 0E+300 -> -1E-398 +ddnextm106 nextminus 0E+30000 -> -1E-398 +ddnextm107 nextminus -0E+30000 -> -1E-398 + +-- specials +ddnextm150 nextminus Inf -> 9.999999999999999E+384 +ddnextm151 nextminus -Inf -> -Infinity +ddnextm152 nextminus NaN -> NaN +ddnextm153 nextminus sNaN -> NaN Invalid_operation +ddnextm154 nextminus NaN77 -> NaN77 +ddnextm155 nextminus sNaN88 -> NaN88 Invalid_operation +ddnextm156 nextminus -NaN -> -NaN +ddnextm157 nextminus -sNaN -> -NaN Invalid_operation +ddnextm158 nextminus -NaN77 -> -NaN77 +ddnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +ddnextm170 nextminus 9.999999999999999E+384 -> 9.999999999999998E+384 +ddnextm171 nextminus 9.999999999999998E+384 -> 9.999999999999997E+384 +ddnextm172 nextminus 1E-383 -> 9.99999999999999E-384 +ddnextm173 nextminus 1.000000000000000E-383 -> 9.99999999999999E-384 +ddnextm174 nextminus 9E-398 -> 8E-398 +ddnextm175 nextminus 9.9E-397 -> 9.8E-397 +ddnextm176 nextminus 9.99999999999E-387 -> 9.99999999998E-387 +ddnextm177 nextminus 9.99999999999999E-384 -> 9.99999999999998E-384 +ddnextm178 nextminus 9.99999999999998E-384 -> 9.99999999999997E-384 +ddnextm179 nextminus 9.99999999999997E-384 -> 9.99999999999996E-384 +ddnextm180 nextminus 0E-398 -> -1E-398 +ddnextm181 nextminus 1E-398 -> 0E-398 +ddnextm182 nextminus 2E-398 -> 1E-398 + +ddnextm183 nextminus -0E-398 -> -1E-398 +ddnextm184 nextminus -1E-398 -> -2E-398 +ddnextm185 nextminus -2E-398 -> -3E-398 +ddnextm186 nextminus -10E-398 -> -1.1E-397 +ddnextm187 nextminus -100E-398 -> -1.01E-396 +ddnextm188 nextminus -100000E-398 -> -1.00001E-393 +ddnextm189 nextminus -1.00000000000E-383 -> -1.000000000000001E-383 +ddnextm190 nextminus -1.000000000000000E-383 -> -1.000000000000001E-383 +ddnextm191 nextminus -1E-383 -> -1.000000000000001E-383 +ddnextm192 nextminus -9.999999999999998E+384 -> -9.999999999999999E+384 +ddnextm193 nextminus -9.999999999999999E+384 -> -Infinity + +-- Null tests +ddnextm900 nextminus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextPlus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextPlus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,124 @@ +------------------------------------------------------------------------ +-- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddnextp001 nextplus 0.9999999999999995 -> 0.9999999999999996 +ddnextp002 nextplus 0.9999999999999996 -> 0.9999999999999997 +ddnextp003 nextplus 0.9999999999999997 -> 0.9999999999999998 +ddnextp004 nextplus 0.9999999999999998 -> 0.9999999999999999 +ddnextp005 nextplus 0.9999999999999999 -> 1.000000000000000 +ddnextp006 nextplus 1.000000000000000 -> 1.000000000000001 +ddnextp007 nextplus 1.0 -> 1.000000000000001 +ddnextp008 nextplus 1 -> 1.000000000000001 +ddnextp009 nextplus 1.000000000000001 -> 1.000000000000002 +ddnextp010 nextplus 1.000000000000002 -> 1.000000000000003 +ddnextp011 nextplus 1.000000000000003 -> 1.000000000000004 +ddnextp012 nextplus 1.000000000000004 -> 1.000000000000005 +ddnextp013 nextplus 1.000000000000005 -> 1.000000000000006 +ddnextp014 nextplus 1.000000000000006 -> 1.000000000000007 +ddnextp015 nextplus 1.000000000000007 -> 1.000000000000008 +ddnextp016 nextplus 1.000000000000008 -> 1.000000000000009 +ddnextp017 nextplus 1.000000000000009 -> 1.000000000000010 +ddnextp018 nextplus 1.000000000000010 -> 1.000000000000011 +ddnextp019 nextplus 1.000000000000011 -> 1.000000000000012 + +ddnextp021 nextplus -0.9999999999999995 -> -0.9999999999999994 +ddnextp022 nextplus -0.9999999999999996 -> -0.9999999999999995 +ddnextp023 nextplus -0.9999999999999997 -> -0.9999999999999996 +ddnextp024 nextplus -0.9999999999999998 -> -0.9999999999999997 +ddnextp025 nextplus -0.9999999999999999 -> -0.9999999999999998 +ddnextp026 nextplus -1.000000000000000 -> -0.9999999999999999 +ddnextp027 nextplus -1.0 -> -0.9999999999999999 +ddnextp028 nextplus -1 -> -0.9999999999999999 +ddnextp029 nextplus -1.000000000000001 -> -1.000000000000000 +ddnextp030 nextplus -1.000000000000002 -> -1.000000000000001 +ddnextp031 nextplus -1.000000000000003 -> -1.000000000000002 +ddnextp032 nextplus -1.000000000000004 -> -1.000000000000003 +ddnextp033 nextplus -1.000000000000005 -> -1.000000000000004 +ddnextp034 nextplus -1.000000000000006 -> -1.000000000000005 +ddnextp035 nextplus -1.000000000000007 -> -1.000000000000006 +ddnextp036 nextplus -1.000000000000008 -> -1.000000000000007 +ddnextp037 nextplus -1.000000000000009 -> -1.000000000000008 +ddnextp038 nextplus -1.000000000000010 -> -1.000000000000009 +ddnextp039 nextplus -1.000000000000011 -> -1.000000000000010 +ddnextp040 nextplus -1.000000000000012 -> -1.000000000000011 + +-- Zeros +ddnextp100 nextplus 0 -> 1E-398 +ddnextp101 nextplus 0.00 -> 1E-398 +ddnextp102 nextplus 0E-300 -> 1E-398 +ddnextp103 nextplus 0E+300 -> 1E-398 +ddnextp104 nextplus 0E+30000 -> 1E-398 +ddnextp105 nextplus -0 -> 1E-398 +ddnextp106 nextplus -0.00 -> 1E-398 +ddnextp107 nextplus -0E-300 -> 1E-398 +ddnextp108 nextplus -0E+300 -> 1E-398 +ddnextp109 nextplus -0E+30000 -> 1E-398 + +-- specials +ddnextp150 nextplus Inf -> Infinity +ddnextp151 nextplus -Inf -> -9.999999999999999E+384 +ddnextp152 nextplus NaN -> NaN +ddnextp153 nextplus sNaN -> NaN Invalid_operation +ddnextp154 nextplus NaN77 -> NaN77 +ddnextp155 nextplus sNaN88 -> NaN88 Invalid_operation +ddnextp156 nextplus -NaN -> -NaN +ddnextp157 nextplus -sNaN -> -NaN Invalid_operation +ddnextp158 nextplus -NaN77 -> -NaN77 +ddnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +ddnextp170 nextplus -9.999999999999999E+384 -> -9.999999999999998E+384 +ddnextp171 nextplus -9.999999999999998E+384 -> -9.999999999999997E+384 +ddnextp172 nextplus -1E-383 -> -9.99999999999999E-384 +ddnextp173 nextplus -1.000000000000000E-383 -> -9.99999999999999E-384 +ddnextp174 nextplus -9E-398 -> -8E-398 +ddnextp175 nextplus -9.9E-397 -> -9.8E-397 +ddnextp176 nextplus -9.99999999999E-387 -> -9.99999999998E-387 +ddnextp177 nextplus -9.99999999999999E-384 -> -9.99999999999998E-384 +ddnextp178 nextplus -9.99999999999998E-384 -> -9.99999999999997E-384 +ddnextp179 nextplus -9.99999999999997E-384 -> -9.99999999999996E-384 +ddnextp180 nextplus -0E-398 -> 1E-398 +ddnextp181 nextplus -1E-398 -> -0E-398 +ddnextp182 nextplus -2E-398 -> -1E-398 + +ddnextp183 nextplus 0E-398 -> 1E-398 +ddnextp184 nextplus 1E-398 -> 2E-398 +ddnextp185 nextplus 2E-398 -> 3E-398 +ddnextp186 nextplus 10E-398 -> 1.1E-397 +ddnextp187 nextplus 100E-398 -> 1.01E-396 +ddnextp188 nextplus 100000E-398 -> 1.00001E-393 +ddnextp189 nextplus 1.00000000000E-383 -> 1.000000000000001E-383 +ddnextp190 nextplus 1.000000000000000E-383 -> 1.000000000000001E-383 +ddnextp191 nextplus 1E-383 -> 1.000000000000001E-383 +ddnextp192 nextplus 9.999999999999998E+384 -> 9.999999999999999E+384 +ddnextp193 nextplus 9.999999999999999E+384 -> Infinity + +-- Null tests +ddnextp900 nextplus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextToward.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddNextToward.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,374 @@ +------------------------------------------------------------------------ +-- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check with a scattering of numerics +ddnextt001 nexttoward 10 10 -> 10 +ddnextt002 nexttoward -10 -10 -> -10 +ddnextt003 nexttoward 1 10 -> 1.000000000000001 +ddnextt004 nexttoward 1 -10 -> 0.9999999999999999 +ddnextt005 nexttoward -1 10 -> -0.9999999999999999 +ddnextt006 nexttoward -1 -10 -> -1.000000000000001 +ddnextt007 nexttoward 0 10 -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt008 nexttoward 0 -10 -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt009 nexttoward 9.999999999999999E+384 +Infinity -> Infinity Overflow Inexact Rounded +ddnextt010 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded +ddnextt011 nexttoward 9.999999999999999 10 -> 10.00000000000000 +ddnextt012 nexttoward 10 9.999999999999999 -> 9.999999999999999 +ddnextt013 nexttoward -9.999999999999999 -10 -> -10.00000000000000 +ddnextt014 nexttoward -10 -9.999999999999999 -> -9.999999999999999 +ddnextt015 nexttoward 9.999999999999998 10 -> 9.999999999999999 +ddnextt016 nexttoward 10 9.999999999999998 -> 9.999999999999999 +ddnextt017 nexttoward -9.999999999999998 -10 -> -9.999999999999999 +ddnextt018 nexttoward -10 -9.999999999999998 -> -9.999999999999999 + +------- lhs=rhs +-- finites +ddnextt101 nexttoward 7 7 -> 7 +ddnextt102 nexttoward -7 -7 -> -7 +ddnextt103 nexttoward 75 75 -> 75 +ddnextt104 nexttoward -75 -75 -> -75 +ddnextt105 nexttoward 7.50 7.5 -> 7.50 +ddnextt106 nexttoward -7.50 -7.50 -> -7.50 +ddnextt107 nexttoward 7.500 7.5000 -> 7.500 +ddnextt108 nexttoward -7.500 -7.5 -> -7.500 + +-- zeros +ddnextt111 nexttoward 0 0 -> 0 +ddnextt112 nexttoward -0 -0 -> -0 +ddnextt113 nexttoward 0E+4 0 -> 0E+4 +ddnextt114 nexttoward -0E+4 -0 -> -0E+4 +ddnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11 +ddnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11 +ddnextt117 nexttoward 0E-141 0 -> 0E-141 +ddnextt118 nexttoward -0E-141 -000 -> -0E-141 + +-- full coefficients, alternating bits +ddnextt121 nexttoward 268268268 268268268 -> 268268268 +ddnextt122 nexttoward -268268268 -268268268 -> -268268268 +ddnextt123 nexttoward 134134134 134134134 -> 134134134 +ddnextt124 nexttoward -134134134 -134134134 -> -134134134 + +-- Nmax, Nmin, Ntiny +ddnextt131 nexttoward 9.999999999999999E+384 9.999999999999999E+384 -> 9.999999999999999E+384 +ddnextt132 nexttoward 1E-383 1E-383 -> 1E-383 +ddnextt133 nexttoward 1.000000000000000E-383 1.000000000000000E-383 -> 1.000000000000000E-383 +ddnextt134 nexttoward 1E-398 1E-398 -> 1E-398 + +ddnextt135 nexttoward -1E-398 -1E-398 -> -1E-398 +ddnextt136 nexttoward -1.000000000000000E-383 -1.000000000000000E-383 -> -1.000000000000000E-383 +ddnextt137 nexttoward -1E-383 -1E-383 -> -1E-383 +ddnextt138 nexttoward -9.999999999999999E+384 -9.999999999999999E+384 -> -9.999999999999999E+384 + +------- lhs 0.9999999999999996 +ddnextt202 nexttoward 0.9999999999999996 Infinity -> 0.9999999999999997 +ddnextt203 nexttoward 0.9999999999999997 Infinity -> 0.9999999999999998 +ddnextt204 nexttoward 0.9999999999999998 Infinity -> 0.9999999999999999 +ddnextt205 nexttoward 0.9999999999999999 Infinity -> 1.000000000000000 +ddnextt206 nexttoward 1.000000000000000 Infinity -> 1.000000000000001 +ddnextt207 nexttoward 1.0 Infinity -> 1.000000000000001 +ddnextt208 nexttoward 1 Infinity -> 1.000000000000001 +ddnextt209 nexttoward 1.000000000000001 Infinity -> 1.000000000000002 +ddnextt210 nexttoward 1.000000000000002 Infinity -> 1.000000000000003 +ddnextt211 nexttoward 1.000000000000003 Infinity -> 1.000000000000004 +ddnextt212 nexttoward 1.000000000000004 Infinity -> 1.000000000000005 +ddnextt213 nexttoward 1.000000000000005 Infinity -> 1.000000000000006 +ddnextt214 nexttoward 1.000000000000006 Infinity -> 1.000000000000007 +ddnextt215 nexttoward 1.000000000000007 Infinity -> 1.000000000000008 +ddnextt216 nexttoward 1.000000000000008 Infinity -> 1.000000000000009 +ddnextt217 nexttoward 1.000000000000009 Infinity -> 1.000000000000010 +ddnextt218 nexttoward 1.000000000000010 Infinity -> 1.000000000000011 +ddnextt219 nexttoward 1.000000000000011 Infinity -> 1.000000000000012 + +ddnextt221 nexttoward -0.9999999999999995 Infinity -> -0.9999999999999994 +ddnextt222 nexttoward -0.9999999999999996 Infinity -> -0.9999999999999995 +ddnextt223 nexttoward -0.9999999999999997 Infinity -> -0.9999999999999996 +ddnextt224 nexttoward -0.9999999999999998 Infinity -> -0.9999999999999997 +ddnextt225 nexttoward -0.9999999999999999 Infinity -> -0.9999999999999998 +ddnextt226 nexttoward -1.000000000000000 Infinity -> -0.9999999999999999 +ddnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999 +ddnextt228 nexttoward -1 Infinity -> -0.9999999999999999 +ddnextt229 nexttoward -1.000000000000001 Infinity -> -1.000000000000000 +ddnextt230 nexttoward -1.000000000000002 Infinity -> -1.000000000000001 +ddnextt231 nexttoward -1.000000000000003 Infinity -> -1.000000000000002 +ddnextt232 nexttoward -1.000000000000004 Infinity -> -1.000000000000003 +ddnextt233 nexttoward -1.000000000000005 Infinity -> -1.000000000000004 +ddnextt234 nexttoward -1.000000000000006 Infinity -> -1.000000000000005 +ddnextt235 nexttoward -1.000000000000007 Infinity -> -1.000000000000006 +ddnextt236 nexttoward -1.000000000000008 Infinity -> -1.000000000000007 +ddnextt237 nexttoward -1.000000000000009 Infinity -> -1.000000000000008 +ddnextt238 nexttoward -1.000000000000010 Infinity -> -1.000000000000009 +ddnextt239 nexttoward -1.000000000000011 Infinity -> -1.000000000000010 +ddnextt240 nexttoward -1.000000000000012 Infinity -> -1.000000000000011 + +-- Zeros +ddnextt300 nexttoward 0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt301 nexttoward 0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt302 nexttoward 0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt303 nexttoward 0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt304 nexttoward 0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt305 nexttoward -0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt306 nexttoward -0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt307 nexttoward -0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt308 nexttoward -0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt309 nexttoward -0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded + +-- specials +ddnextt350 nexttoward Inf Infinity -> Infinity +ddnextt351 nexttoward -Inf Infinity -> -9.999999999999999E+384 +ddnextt352 nexttoward NaN Infinity -> NaN +ddnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation +ddnextt354 nexttoward NaN77 Infinity -> NaN77 +ddnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation +ddnextt356 nexttoward -NaN Infinity -> -NaN +ddnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation +ddnextt358 nexttoward -NaN77 Infinity -> -NaN77 +ddnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +ddnextt370 nexttoward -9.999999999999999E+384 Infinity -> -9.999999999999998E+384 +ddnextt371 nexttoward -9.999999999999998E+384 Infinity -> -9.999999999999997E+384 +ddnextt372 nexttoward -1E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded +ddnextt373 nexttoward -1.000000000000000E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded +ddnextt374 nexttoward -9E-398 Infinity -> -8E-398 Underflow Subnormal Inexact Rounded +ddnextt375 nexttoward -9.9E-397 Infinity -> -9.8E-397 Underflow Subnormal Inexact Rounded +ddnextt376 nexttoward -9.99999999999E-387 Infinity -> -9.99999999998E-387 Underflow Subnormal Inexact Rounded +ddnextt377 nexttoward -9.99999999999999E-384 Infinity -> -9.99999999999998E-384 Underflow Subnormal Inexact Rounded +ddnextt378 nexttoward -9.99999999999998E-384 Infinity -> -9.99999999999997E-384 Underflow Subnormal Inexact Rounded +ddnextt379 nexttoward -9.99999999999997E-384 Infinity -> -9.99999999999996E-384 Underflow Subnormal Inexact Rounded +ddnextt380 nexttoward -0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt381 nexttoward -1E-398 Infinity -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddnextt382 nexttoward -2E-398 Infinity -> -1E-398 Underflow Subnormal Inexact Rounded + +ddnextt383 nexttoward 0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt384 nexttoward 1E-398 Infinity -> 2E-398 Underflow Subnormal Inexact Rounded +ddnextt385 nexttoward 2E-398 Infinity -> 3E-398 Underflow Subnormal Inexact Rounded +ddnextt386 nexttoward 10E-398 Infinity -> 1.1E-397 Underflow Subnormal Inexact Rounded +ddnextt387 nexttoward 100E-398 Infinity -> 1.01E-396 Underflow Subnormal Inexact Rounded +ddnextt388 nexttoward 100000E-398 Infinity -> 1.00001E-393 Underflow Subnormal Inexact Rounded +ddnextt389 nexttoward 1.00000000000E-383 Infinity -> 1.000000000000001E-383 +ddnextt390 nexttoward 1.000000000000000E-383 Infinity -> 1.000000000000001E-383 +ddnextt391 nexttoward 1E-383 Infinity -> 1.000000000000001E-383 +ddnextt392 nexttoward 9.999999999999997E+384 Infinity -> 9.999999999999998E+384 +ddnextt393 nexttoward 9.999999999999998E+384 Infinity -> 9.999999999999999E+384 +ddnextt394 nexttoward 9.999999999999999E+384 Infinity -> Infinity Overflow Inexact Rounded + +------- lhs>rhs +ddnextt401 nexttoward 0.9999999999999995 -Infinity -> 0.9999999999999994 +ddnextt402 nexttoward 0.9999999999999996 -Infinity -> 0.9999999999999995 +ddnextt403 nexttoward 0.9999999999999997 -Infinity -> 0.9999999999999996 +ddnextt404 nexttoward 0.9999999999999998 -Infinity -> 0.9999999999999997 +ddnextt405 nexttoward 0.9999999999999999 -Infinity -> 0.9999999999999998 +ddnextt406 nexttoward 1.000000000000000 -Infinity -> 0.9999999999999999 +ddnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999 +ddnextt408 nexttoward 1 -Infinity -> 0.9999999999999999 +ddnextt409 nexttoward 1.000000000000001 -Infinity -> 1.000000000000000 +ddnextt410 nexttoward 1.000000000000002 -Infinity -> 1.000000000000001 +ddnextt411 nexttoward 1.000000000000003 -Infinity -> 1.000000000000002 +ddnextt412 nexttoward 1.000000000000004 -Infinity -> 1.000000000000003 +ddnextt413 nexttoward 1.000000000000005 -Infinity -> 1.000000000000004 +ddnextt414 nexttoward 1.000000000000006 -Infinity -> 1.000000000000005 +ddnextt415 nexttoward 1.000000000000007 -Infinity -> 1.000000000000006 +ddnextt416 nexttoward 1.000000000000008 -Infinity -> 1.000000000000007 +ddnextt417 nexttoward 1.000000000000009 -Infinity -> 1.000000000000008 +ddnextt418 nexttoward 1.000000000000010 -Infinity -> 1.000000000000009 +ddnextt419 nexttoward 1.000000000000011 -Infinity -> 1.000000000000010 +ddnextt420 nexttoward 1.000000000000012 -Infinity -> 1.000000000000011 + +ddnextt421 nexttoward -0.9999999999999995 -Infinity -> -0.9999999999999996 +ddnextt422 nexttoward -0.9999999999999996 -Infinity -> -0.9999999999999997 +ddnextt423 nexttoward -0.9999999999999997 -Infinity -> -0.9999999999999998 +ddnextt424 nexttoward -0.9999999999999998 -Infinity -> -0.9999999999999999 +ddnextt425 nexttoward -0.9999999999999999 -Infinity -> -1.000000000000000 +ddnextt426 nexttoward -1.000000000000000 -Infinity -> -1.000000000000001 +ddnextt427 nexttoward -1.0 -Infinity -> -1.000000000000001 +ddnextt428 nexttoward -1 -Infinity -> -1.000000000000001 +ddnextt429 nexttoward -1.000000000000001 -Infinity -> -1.000000000000002 +ddnextt430 nexttoward -1.000000000000002 -Infinity -> -1.000000000000003 +ddnextt431 nexttoward -1.000000000000003 -Infinity -> -1.000000000000004 +ddnextt432 nexttoward -1.000000000000004 -Infinity -> -1.000000000000005 +ddnextt433 nexttoward -1.000000000000005 -Infinity -> -1.000000000000006 +ddnextt434 nexttoward -1.000000000000006 -Infinity -> -1.000000000000007 +ddnextt435 nexttoward -1.000000000000007 -Infinity -> -1.000000000000008 +ddnextt436 nexttoward -1.000000000000008 -Infinity -> -1.000000000000009 +ddnextt437 nexttoward -1.000000000000009 -Infinity -> -1.000000000000010 +ddnextt438 nexttoward -1.000000000000010 -Infinity -> -1.000000000000011 +ddnextt439 nexttoward -1.000000000000011 -Infinity -> -1.000000000000012 + +-- Zeros +ddnextt500 nexttoward -0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt501 nexttoward 0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt502 nexttoward 0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt503 nexttoward -0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt504 nexttoward 0E-300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt505 nexttoward 0E+300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt506 nexttoward 0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt507 nexttoward -0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded + +-- specials +ddnextt550 nexttoward Inf -Infinity -> 9.999999999999999E+384 +ddnextt551 nexttoward -Inf -Infinity -> -Infinity +ddnextt552 nexttoward NaN -Infinity -> NaN +ddnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation +ddnextt554 nexttoward NaN77 -Infinity -> NaN77 +ddnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation +ddnextt556 nexttoward -NaN -Infinity -> -NaN +ddnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation +ddnextt558 nexttoward -NaN77 -Infinity -> -NaN77 +ddnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +ddnextt670 nexttoward 9.999999999999999E+384 -Infinity -> 9.999999999999998E+384 +ddnextt671 nexttoward 9.999999999999998E+384 -Infinity -> 9.999999999999997E+384 +ddnextt672 nexttoward 1E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded +ddnextt673 nexttoward 1.000000000000000E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded +ddnextt674 nexttoward 9E-398 -Infinity -> 8E-398 Underflow Subnormal Inexact Rounded +ddnextt675 nexttoward 9.9E-397 -Infinity -> 9.8E-397 Underflow Subnormal Inexact Rounded +ddnextt676 nexttoward 9.99999999999E-387 -Infinity -> 9.99999999998E-387 Underflow Subnormal Inexact Rounded +ddnextt677 nexttoward 9.99999999999999E-384 -Infinity -> 9.99999999999998E-384 Underflow Subnormal Inexact Rounded +ddnextt678 nexttoward 9.99999999999998E-384 -Infinity -> 9.99999999999997E-384 Underflow Subnormal Inexact Rounded +ddnextt679 nexttoward 9.99999999999997E-384 -Infinity -> 9.99999999999996E-384 Underflow Subnormal Inexact Rounded +ddnextt680 nexttoward 0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt681 nexttoward 1E-398 -Infinity -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddnextt682 nexttoward 2E-398 -Infinity -> 1E-398 Underflow Subnormal Inexact Rounded + +ddnextt683 nexttoward -0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt684 nexttoward -1E-398 -Infinity -> -2E-398 Underflow Subnormal Inexact Rounded +ddnextt685 nexttoward -2E-398 -Infinity -> -3E-398 Underflow Subnormal Inexact Rounded +ddnextt686 nexttoward -10E-398 -Infinity -> -1.1E-397 Underflow Subnormal Inexact Rounded +ddnextt687 nexttoward -100E-398 -Infinity -> -1.01E-396 Underflow Subnormal Inexact Rounded +ddnextt688 nexttoward -100000E-398 -Infinity -> -1.00001E-393 Underflow Subnormal Inexact Rounded +ddnextt689 nexttoward -1.00000000000E-383 -Infinity -> -1.000000000000001E-383 +ddnextt690 nexttoward -1.000000000000000E-383 -Infinity -> -1.000000000000001E-383 +ddnextt691 nexttoward -1E-383 -Infinity -> -1.000000000000001E-383 +ddnextt692 nexttoward -9.999999999999998E+384 -Infinity -> -9.999999999999999E+384 +ddnextt693 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded + +------- Specials +ddnextt780 nexttoward -Inf -Inf -> -Infinity +ddnextt781 nexttoward -Inf -1000 -> -9.999999999999999E+384 +ddnextt782 nexttoward -Inf -1 -> -9.999999999999999E+384 +ddnextt783 nexttoward -Inf -0 -> -9.999999999999999E+384 +ddnextt784 nexttoward -Inf 0 -> -9.999999999999999E+384 +ddnextt785 nexttoward -Inf 1 -> -9.999999999999999E+384 +ddnextt786 nexttoward -Inf 1000 -> -9.999999999999999E+384 +ddnextt787 nexttoward -1000 -Inf -> -1000.000000000001 +ddnextt788 nexttoward -Inf -Inf -> -Infinity +ddnextt789 nexttoward -1 -Inf -> -1.000000000000001 +ddnextt790 nexttoward -0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt791 nexttoward 0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded +ddnextt792 nexttoward 1 -Inf -> 0.9999999999999999 +ddnextt793 nexttoward 1000 -Inf -> 999.9999999999999 +ddnextt794 nexttoward Inf -Inf -> 9.999999999999999E+384 + +ddnextt800 nexttoward Inf -Inf -> 9.999999999999999E+384 +ddnextt801 nexttoward Inf -1000 -> 9.999999999999999E+384 +ddnextt802 nexttoward Inf -1 -> 9.999999999999999E+384 +ddnextt803 nexttoward Inf -0 -> 9.999999999999999E+384 +ddnextt804 nexttoward Inf 0 -> 9.999999999999999E+384 +ddnextt805 nexttoward Inf 1 -> 9.999999999999999E+384 +ddnextt806 nexttoward Inf 1000 -> 9.999999999999999E+384 +ddnextt807 nexttoward Inf Inf -> Infinity +ddnextt808 nexttoward -1000 Inf -> -999.9999999999999 +ddnextt809 nexttoward -Inf Inf -> -9.999999999999999E+384 +ddnextt810 nexttoward -1 Inf -> -0.9999999999999999 +ddnextt811 nexttoward -0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt812 nexttoward 0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded +ddnextt813 nexttoward 1 Inf -> 1.000000000000001 +ddnextt814 nexttoward 1000 Inf -> 1000.000000000001 +ddnextt815 nexttoward Inf Inf -> Infinity + +ddnextt821 nexttoward NaN -Inf -> NaN +ddnextt822 nexttoward NaN -1000 -> NaN +ddnextt823 nexttoward NaN -1 -> NaN +ddnextt824 nexttoward NaN -0 -> NaN +ddnextt825 nexttoward NaN 0 -> NaN +ddnextt826 nexttoward NaN 1 -> NaN +ddnextt827 nexttoward NaN 1000 -> NaN +ddnextt828 nexttoward NaN Inf -> NaN +ddnextt829 nexttoward NaN NaN -> NaN +ddnextt830 nexttoward -Inf NaN -> NaN +ddnextt831 nexttoward -1000 NaN -> NaN +ddnextt832 nexttoward -1 NaN -> NaN +ddnextt833 nexttoward -0 NaN -> NaN +ddnextt834 nexttoward 0 NaN -> NaN +ddnextt835 nexttoward 1 NaN -> NaN +ddnextt836 nexttoward 1000 NaN -> NaN +ddnextt837 nexttoward Inf NaN -> NaN + +ddnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation +ddnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation +ddnextt843 nexttoward sNaN -1 -> NaN Invalid_operation +ddnextt844 nexttoward sNaN -0 -> NaN Invalid_operation +ddnextt845 nexttoward sNaN 0 -> NaN Invalid_operation +ddnextt846 nexttoward sNaN 1 -> NaN Invalid_operation +ddnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation +ddnextt848 nexttoward sNaN NaN -> NaN Invalid_operation +ddnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation +ddnextt850 nexttoward NaN sNaN -> NaN Invalid_operation +ddnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation +ddnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation +ddnextt853 nexttoward -1 sNaN -> NaN Invalid_operation +ddnextt854 nexttoward -0 sNaN -> NaN Invalid_operation +ddnextt855 nexttoward 0 sNaN -> NaN Invalid_operation +ddnextt856 nexttoward 1 sNaN -> NaN Invalid_operation +ddnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation +ddnextt858 nexttoward Inf sNaN -> NaN Invalid_operation +ddnextt859 nexttoward NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddnextt861 nexttoward NaN1 -Inf -> NaN1 +ddnextt862 nexttoward +NaN2 -1000 -> NaN2 +ddnextt863 nexttoward NaN3 1000 -> NaN3 +ddnextt864 nexttoward NaN4 Inf -> NaN4 +ddnextt865 nexttoward NaN5 +NaN6 -> NaN5 +ddnextt866 nexttoward -Inf NaN7 -> NaN7 +ddnextt867 nexttoward -1000 NaN8 -> NaN8 +ddnextt868 nexttoward 1000 NaN9 -> NaN9 +ddnextt869 nexttoward Inf +NaN10 -> NaN10 +ddnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation +ddnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation +ddnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation +ddnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation +ddnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation +ddnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation +ddnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation +ddnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation +ddnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation +ddnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation +ddnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation +ddnextt882 nexttoward -NaN26 NaN28 -> -NaN26 +ddnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation +ddnextt884 nexttoward 1000 -NaN30 -> -NaN30 +ddnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Null tests +ddnextt900 nexttoward 1 # -> NaN Invalid_operation +ddnextt901 nexttoward # 1 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddOr.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddOr.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,292 @@ +------------------------------------------------------------------------ +-- ddOr.decTest -- digitwise logical OR for decDoubles -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check (truth table) +ddor001 or 0 0 -> 0 +ddor002 or 0 1 -> 1 +ddor003 or 1 0 -> 1 +ddor004 or 1 1 -> 1 +ddor005 or 1100 1010 -> 1110 +-- and at msd and msd-1 +ddor006 or 0000000000000000 0000000000000000 -> 0 +ddor007 or 0000000000000000 1000000000000000 -> 1000000000000000 +ddor008 or 1000000000000000 0000000000000000 -> 1000000000000000 +ddor009 or 1000000000000000 1000000000000000 -> 1000000000000000 +ddor010 or 0000000000000000 0000000000000000 -> 0 +ddor011 or 0000000000000000 0100000000000000 -> 100000000000000 +ddor012 or 0100000000000000 0000000000000000 -> 100000000000000 +ddor013 or 0100000000000000 0100000000000000 -> 100000000000000 + +-- Various lengths +-- 1234567890123456 1234567890123456 1234567890123456 +ddor020 or 1111111111111111 1111111111111111 -> 1111111111111111 +ddor021 or 111111111111111 111111111111111 -> 111111111111111 +ddor022 or 11111111111111 11111111111111 -> 11111111111111 +ddor023 or 1111111111111 1111111111111 -> 1111111111111 +ddor024 or 111111111111 111111111111 -> 111111111111 +ddor025 or 11111111111 11111111111 -> 11111111111 +ddor026 or 1111111111 1111111111 -> 1111111111 +ddor027 or 111111111 111111111 -> 111111111 +ddor028 or 11111111 11111111 -> 11111111 +ddor029 or 1111111 1111111 -> 1111111 +ddor030 or 111111 111111 -> 111111 +ddor031 or 11111 11111 -> 11111 +ddor032 or 1111 1111 -> 1111 +ddor033 or 111 111 -> 111 +ddor034 or 11 11 -> 11 +ddor035 or 1 1 -> 1 +ddor036 or 0 0 -> 0 + +ddor042 or 111111110000000 1111111110000000 -> 1111111110000000 +ddor043 or 11111110000000 1000000100000000 -> 1011111110000000 +ddor044 or 1111110000000 1000001000000000 -> 1001111110000000 +ddor045 or 111110000000 1000010000000000 -> 1000111110000000 +ddor046 or 11110000000 1000100000000000 -> 1000111110000000 +ddor047 or 1110000000 1001000000000000 -> 1001001110000000 +ddor048 or 110000000 1010000000000000 -> 1010000110000000 +ddor049 or 10000000 1100000000000000 -> 1100000010000000 + +ddor090 or 011111111 111101111 -> 111111111 +ddor091 or 101111111 111101111 -> 111111111 +ddor092 or 110111111 111101111 -> 111111111 +ddor093 or 111011111 111101111 -> 111111111 +ddor094 or 111101111 111101111 -> 111101111 +ddor095 or 111110111 111101111 -> 111111111 +ddor096 or 111111011 111101111 -> 111111111 +ddor097 or 111111101 111101111 -> 111111111 +ddor098 or 111111110 111101111 -> 111111111 + +ddor100 or 111101111 011111111 -> 111111111 +ddor101 or 111101111 101111111 -> 111111111 +ddor102 or 111101111 110111111 -> 111111111 +ddor103 or 111101111 111011111 -> 111111111 +ddor104 or 111101111 111101111 -> 111101111 +ddor105 or 111101111 111110111 -> 111111111 +ddor106 or 111101111 111111011 -> 111111111 +ddor107 or 111101111 111111101 -> 111111111 +ddor108 or 111101111 111111110 -> 111111111 + +-- non-0/1 should not be accepted, nor should signs +ddor220 or 111111112 111111111 -> NaN Invalid_operation +ddor221 or 333333333 333333333 -> NaN Invalid_operation +ddor222 or 555555555 555555555 -> NaN Invalid_operation +ddor223 or 777777777 777777777 -> NaN Invalid_operation +ddor224 or 999999999 999999999 -> NaN Invalid_operation +ddor225 or 222222222 999999999 -> NaN Invalid_operation +ddor226 or 444444444 999999999 -> NaN Invalid_operation +ddor227 or 666666666 999999999 -> NaN Invalid_operation +ddor228 or 888888888 999999999 -> NaN Invalid_operation +ddor229 or 999999999 222222222 -> NaN Invalid_operation +ddor230 or 999999999 444444444 -> NaN Invalid_operation +ddor231 or 999999999 666666666 -> NaN Invalid_operation +ddor232 or 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +ddor240 or 567468689 -934981942 -> NaN Invalid_operation +ddor241 or 567367689 934981942 -> NaN Invalid_operation +ddor242 or -631917772 -706014634 -> NaN Invalid_operation +ddor243 or -756253257 138579234 -> NaN Invalid_operation +ddor244 or 835590149 567435400 -> NaN Invalid_operation +-- test MSD +ddor250 or 2000000000000000 1000000000000000 -> NaN Invalid_operation +ddor251 or 7000000000000000 1000000000000000 -> NaN Invalid_operation +ddor252 or 8000000000000000 1000000000000000 -> NaN Invalid_operation +ddor253 or 9000000000000000 1000000000000000 -> NaN Invalid_operation +ddor254 or 2000000000000000 0000000000000000 -> NaN Invalid_operation +ddor255 or 7000000000000000 0000000000000000 -> NaN Invalid_operation +ddor256 or 8000000000000000 0000000000000000 -> NaN Invalid_operation +ddor257 or 9000000000000000 0000000000000000 -> NaN Invalid_operation +ddor258 or 1000000000000000 2000000000000000 -> NaN Invalid_operation +ddor259 or 1000000000000000 7000000000000000 -> NaN Invalid_operation +ddor260 or 1000000000000000 8000000000000000 -> NaN Invalid_operation +ddor261 or 1000000000000000 9000000000000000 -> NaN Invalid_operation +ddor262 or 0000000000000000 2000000000000000 -> NaN Invalid_operation +ddor263 or 0000000000000000 7000000000000000 -> NaN Invalid_operation +ddor264 or 0000000000000000 8000000000000000 -> NaN Invalid_operation +ddor265 or 0000000000000000 9000000000000000 -> NaN Invalid_operation +-- test MSD-1 +ddor270 or 0200001000000000 1000100000000010 -> NaN Invalid_operation +ddor271 or 0700000100000000 1000010000000100 -> NaN Invalid_operation +ddor272 or 0800000010000000 1000001000001000 -> NaN Invalid_operation +ddor273 or 0900000001000000 1000000100010000 -> NaN Invalid_operation +ddor274 or 1000000000100000 0200000010100000 -> NaN Invalid_operation +ddor275 or 1000000000010000 0700000001000000 -> NaN Invalid_operation +ddor276 or 1000000000001000 0800000010100000 -> NaN Invalid_operation +ddor277 or 1000000000000100 0900000000010000 -> NaN Invalid_operation +-- test LSD +ddor280 or 0010000000000002 1000000100000001 -> NaN Invalid_operation +ddor281 or 0001000000000007 1000001000000011 -> NaN Invalid_operation +ddor282 or 0000100000000008 1000010000000001 -> NaN Invalid_operation +ddor283 or 0000010000000009 1000100000000001 -> NaN Invalid_operation +ddor284 or 1000001000000000 0001000000000002 -> NaN Invalid_operation +ddor285 or 1000000100000000 0010000000000007 -> NaN Invalid_operation +ddor286 or 1000000010000000 0100000000000008 -> NaN Invalid_operation +ddor287 or 1000000001000000 1000000000000009 -> NaN Invalid_operation +-- test Middie +ddor288 or 0010000020000000 1000001000000000 -> NaN Invalid_operation +ddor289 or 0001000070000001 1000000100000000 -> NaN Invalid_operation +ddor290 or 0000100080000010 1000000010000000 -> NaN Invalid_operation +ddor291 or 0000010090000100 1000000001000000 -> NaN Invalid_operation +ddor292 or 1000001000001000 0000000020100000 -> NaN Invalid_operation +ddor293 or 1000000100010000 0000000070010000 -> NaN Invalid_operation +ddor294 or 1000000010100000 0000000080001000 -> NaN Invalid_operation +ddor295 or 1000000001000000 0000000090000100 -> NaN Invalid_operation +-- signs +ddor296 or -1000000001000000 -0000010000000100 -> NaN Invalid_operation +ddor297 or -1000000001000000 0000000010000100 -> NaN Invalid_operation +ddor298 or 1000000001000000 -0000001000000100 -> NaN Invalid_operation +ddor299 or 1000000001000000 0000000011000100 -> 1000000011000100 + +-- Nmax, Nmin, Ntiny-like +ddor331 or 2 9.99999999E+199 -> NaN Invalid_operation +ddor332 or 3 1E-199 -> NaN Invalid_operation +ddor333 or 4 1.00000000E-199 -> NaN Invalid_operation +ddor334 or 5 1E-100 -> NaN Invalid_operation +ddor335 or 6 -1E-100 -> NaN Invalid_operation +ddor336 or 7 -1.00000000E-199 -> NaN Invalid_operation +ddor337 or 8 -1E-199 -> NaN Invalid_operation +ddor338 or 9 -9.99999999E+199 -> NaN Invalid_operation +ddor341 or 9.99999999E+299 -18 -> NaN Invalid_operation +ddor342 or 1E-299 01 -> NaN Invalid_operation +ddor343 or 1.00000000E-299 -18 -> NaN Invalid_operation +ddor344 or 1E-100 18 -> NaN Invalid_operation +ddor345 or -1E-100 -10 -> NaN Invalid_operation +ddor346 or -1.00000000E-299 18 -> NaN Invalid_operation +ddor347 or -1E-299 10 -> NaN Invalid_operation +ddor348 or -9.99999999E+299 -18 -> NaN Invalid_operation + +-- A few other non-integers +ddor361 or 1.0 1 -> NaN Invalid_operation +ddor362 or 1E+1 1 -> NaN Invalid_operation +ddor363 or 0.0 1 -> NaN Invalid_operation +ddor364 or 0E+1 1 -> NaN Invalid_operation +ddor365 or 9.9 1 -> NaN Invalid_operation +ddor366 or 9E+1 1 -> NaN Invalid_operation +ddor371 or 0 1.0 -> NaN Invalid_operation +ddor372 or 0 1E+1 -> NaN Invalid_operation +ddor373 or 0 0.0 -> NaN Invalid_operation +ddor374 or 0 0E+1 -> NaN Invalid_operation +ddor375 or 0 9.9 -> NaN Invalid_operation +ddor376 or 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +ddor780 or -Inf -Inf -> NaN Invalid_operation +ddor781 or -Inf -1000 -> NaN Invalid_operation +ddor782 or -Inf -1 -> NaN Invalid_operation +ddor783 or -Inf -0 -> NaN Invalid_operation +ddor784 or -Inf 0 -> NaN Invalid_operation +ddor785 or -Inf 1 -> NaN Invalid_operation +ddor786 or -Inf 1000 -> NaN Invalid_operation +ddor787 or -1000 -Inf -> NaN Invalid_operation +ddor788 or -Inf -Inf -> NaN Invalid_operation +ddor789 or -1 -Inf -> NaN Invalid_operation +ddor790 or -0 -Inf -> NaN Invalid_operation +ddor791 or 0 -Inf -> NaN Invalid_operation +ddor792 or 1 -Inf -> NaN Invalid_operation +ddor793 or 1000 -Inf -> NaN Invalid_operation +ddor794 or Inf -Inf -> NaN Invalid_operation + +ddor800 or Inf -Inf -> NaN Invalid_operation +ddor801 or Inf -1000 -> NaN Invalid_operation +ddor802 or Inf -1 -> NaN Invalid_operation +ddor803 or Inf -0 -> NaN Invalid_operation +ddor804 or Inf 0 -> NaN Invalid_operation +ddor805 or Inf 1 -> NaN Invalid_operation +ddor806 or Inf 1000 -> NaN Invalid_operation +ddor807 or Inf Inf -> NaN Invalid_operation +ddor808 or -1000 Inf -> NaN Invalid_operation +ddor809 or -Inf Inf -> NaN Invalid_operation +ddor810 or -1 Inf -> NaN Invalid_operation +ddor811 or -0 Inf -> NaN Invalid_operation +ddor812 or 0 Inf -> NaN Invalid_operation +ddor813 or 1 Inf -> NaN Invalid_operation +ddor814 or 1000 Inf -> NaN Invalid_operation +ddor815 or Inf Inf -> NaN Invalid_operation + +ddor821 or NaN -Inf -> NaN Invalid_operation +ddor822 or NaN -1000 -> NaN Invalid_operation +ddor823 or NaN -1 -> NaN Invalid_operation +ddor824 or NaN -0 -> NaN Invalid_operation +ddor825 or NaN 0 -> NaN Invalid_operation +ddor826 or NaN 1 -> NaN Invalid_operation +ddor827 or NaN 1000 -> NaN Invalid_operation +ddor828 or NaN Inf -> NaN Invalid_operation +ddor829 or NaN NaN -> NaN Invalid_operation +ddor830 or -Inf NaN -> NaN Invalid_operation +ddor831 or -1000 NaN -> NaN Invalid_operation +ddor832 or -1 NaN -> NaN Invalid_operation +ddor833 or -0 NaN -> NaN Invalid_operation +ddor834 or 0 NaN -> NaN Invalid_operation +ddor835 or 1 NaN -> NaN Invalid_operation +ddor836 or 1000 NaN -> NaN Invalid_operation +ddor837 or Inf NaN -> NaN Invalid_operation + +ddor841 or sNaN -Inf -> NaN Invalid_operation +ddor842 or sNaN -1000 -> NaN Invalid_operation +ddor843 or sNaN -1 -> NaN Invalid_operation +ddor844 or sNaN -0 -> NaN Invalid_operation +ddor845 or sNaN 0 -> NaN Invalid_operation +ddor846 or sNaN 1 -> NaN Invalid_operation +ddor847 or sNaN 1000 -> NaN Invalid_operation +ddor848 or sNaN NaN -> NaN Invalid_operation +ddor849 or sNaN sNaN -> NaN Invalid_operation +ddor850 or NaN sNaN -> NaN Invalid_operation +ddor851 or -Inf sNaN -> NaN Invalid_operation +ddor852 or -1000 sNaN -> NaN Invalid_operation +ddor853 or -1 sNaN -> NaN Invalid_operation +ddor854 or -0 sNaN -> NaN Invalid_operation +ddor855 or 0 sNaN -> NaN Invalid_operation +ddor856 or 1 sNaN -> NaN Invalid_operation +ddor857 or 1000 sNaN -> NaN Invalid_operation +ddor858 or Inf sNaN -> NaN Invalid_operation +ddor859 or NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddor861 or NaN1 -Inf -> NaN Invalid_operation +ddor862 or +NaN2 -1000 -> NaN Invalid_operation +ddor863 or NaN3 1000 -> NaN Invalid_operation +ddor864 or NaN4 Inf -> NaN Invalid_operation +ddor865 or NaN5 +NaN6 -> NaN Invalid_operation +ddor866 or -Inf NaN7 -> NaN Invalid_operation +ddor867 or -1000 NaN8 -> NaN Invalid_operation +ddor868 or 1000 NaN9 -> NaN Invalid_operation +ddor869 or Inf +NaN10 -> NaN Invalid_operation +ddor871 or sNaN11 -Inf -> NaN Invalid_operation +ddor872 or sNaN12 -1000 -> NaN Invalid_operation +ddor873 or sNaN13 1000 -> NaN Invalid_operation +ddor874 or sNaN14 NaN17 -> NaN Invalid_operation +ddor875 or sNaN15 sNaN18 -> NaN Invalid_operation +ddor876 or NaN16 sNaN19 -> NaN Invalid_operation +ddor877 or -Inf +sNaN20 -> NaN Invalid_operation +ddor878 or -1000 sNaN21 -> NaN Invalid_operation +ddor879 or 1000 sNaN22 -> NaN Invalid_operation +ddor880 or Inf sNaN23 -> NaN Invalid_operation +ddor881 or +NaN25 +sNaN24 -> NaN Invalid_operation +ddor882 or -NaN26 NaN28 -> NaN Invalid_operation +ddor883 or -sNaN27 sNaN29 -> NaN Invalid_operation +ddor884 or 1000 -NaN30 -> NaN Invalid_operation +ddor885 or 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddPlus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddPlus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- ddPlus.decTest -- decDouble 0+x -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddpls001 plus +7.50 -> 7.50 + +-- Infinities +ddpls011 plus Infinity -> Infinity +ddpls012 plus -Infinity -> -Infinity + +-- NaNs, 0 payload +ddpls021 plus NaN -> NaN +ddpls022 plus -NaN -> -NaN +ddpls023 plus sNaN -> NaN Invalid_operation +ddpls024 plus -sNaN -> -NaN Invalid_operation + +-- NaNs, non-0 payload +ddpls031 plus NaN13 -> NaN13 +ddpls032 plus -NaN13 -> -NaN13 +ddpls033 plus sNaN13 -> NaN13 Invalid_operation +ddpls034 plus -sNaN13 -> -NaN13 Invalid_operation +ddpls035 plus NaN70 -> NaN70 +ddpls036 plus -NaN70 -> -NaN70 +ddpls037 plus sNaN101 -> NaN101 Invalid_operation +ddpls038 plus -sNaN101 -> -NaN101 Invalid_operation + +-- finites +ddpls101 plus 7 -> 7 +ddpls102 plus -7 -> -7 +ddpls103 plus 75 -> 75 +ddpls104 plus -75 -> -75 +ddpls105 plus 7.50 -> 7.50 +ddpls106 plus -7.50 -> -7.50 +ddpls107 plus 7.500 -> 7.500 +ddpls108 plus -7.500 -> -7.500 + +-- zeros +ddpls111 plus 0 -> 0 +ddpls112 plus -0 -> 0 +ddpls113 plus 0E+4 -> 0E+4 +ddpls114 plus -0E+4 -> 0E+4 +ddpls115 plus 0.0000 -> 0.0000 +ddpls116 plus -0.0000 -> 0.0000 +ddpls117 plus 0E-141 -> 0E-141 +ddpls118 plus -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +ddpls121 plus 2682682682682682 -> 2682682682682682 +ddpls122 plus -2682682682682682 -> -2682682682682682 +ddpls123 plus 1341341341341341 -> 1341341341341341 +ddpls124 plus -1341341341341341 -> -1341341341341341 + +-- Nmax, Nmin, Ntiny +ddpls131 plus 9.999999999999999E+384 -> 9.999999999999999E+384 +ddpls132 plus 1E-383 -> 1E-383 +ddpls133 plus 1.000000000000000E-383 -> 1.000000000000000E-383 +ddpls134 plus 1E-398 -> 1E-398 Subnormal + +ddpls135 plus -1E-398 -> -1E-398 Subnormal +ddpls136 plus -1.000000000000000E-383 -> -1.000000000000000E-383 +ddpls137 plus -1E-383 -> -1E-383 +ddpls138 plus -9.999999999999999E+384 -> -9.999999999999999E+384 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddQuantize.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddQuantize.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,833 @@ +------------------------------------------------------------------------ +-- ddQuantize.decTest -- decDouble quantize operation -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Most of the tests here assume a "regular pattern", where the +-- sign and coefficient are +1. +-- 2004.03.15 Underflow for quantize is suppressed +-- 2005.06.08 More extensive tests for 'does not fit' +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks +ddqua001 quantize 0 1e0 -> 0 +ddqua002 quantize 1 1e0 -> 1 +ddqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded +ddqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded +ddqua006 quantize 0.1 1e0 -> 0 Inexact Rounded +ddqua007 quantize 0.1 1e-1 -> 0.1 +ddqua008 quantize 0.1 1e-2 -> 0.10 +ddqua009 quantize 0.1 1e-3 -> 0.100 +ddqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded +ddqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded +ddqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded +ddqua013 quantize 0.9 1e-1 -> 0.9 +ddqua014 quantize 0.9 1e-2 -> 0.90 +ddqua015 quantize 0.9 1e-3 -> 0.900 +-- negatives +ddqua021 quantize -0 1e0 -> -0 +ddqua022 quantize -1 1e0 -> -1 +ddqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded +ddqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded +ddqua026 quantize -0.1 1e0 -> -0 Inexact Rounded +ddqua027 quantize -0.1 1e-1 -> -0.1 +ddqua028 quantize -0.1 1e-2 -> -0.10 +ddqua029 quantize -0.1 1e-3 -> -0.100 +ddqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +ddqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +ddqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded +ddqua033 quantize -0.9 1e-1 -> -0.9 +ddqua034 quantize -0.9 1e-2 -> -0.90 +ddqua035 quantize -0.9 1e-3 -> -0.900 +ddqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded +ddqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded +ddqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded +ddqua039 quantize -0.5 1e-1 -> -0.5 +ddqua040 quantize -0.5 1e-2 -> -0.50 +ddqua041 quantize -0.5 1e-3 -> -0.500 +ddqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +ddqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +ddqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded +ddqua045 quantize -0.9 1e-1 -> -0.9 +ddqua046 quantize -0.9 1e-2 -> -0.90 +ddqua047 quantize -0.9 1e-3 -> -0.900 + +-- examples from Specification +ddqua060 quantize 2.17 0.001 -> 2.170 +ddqua061 quantize 2.17 0.01 -> 2.17 +ddqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded +ddqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded +ddqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded +ddqua065 quantize -Inf Inf -> -Infinity +ddqua066 quantize 2 Inf -> NaN Invalid_operation +ddqua067 quantize -0.1 1 -> -0 Inexact Rounded +ddqua068 quantize -0 1e+5 -> -0E+5 +ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation +ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation +ddqua071 quantize 217 1e-1 -> 217.0 +ddqua072 quantize 217 1e+0 -> 217 +ddqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded +ddqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded + +-- general tests .. +ddqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded +ddqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded +ddqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded +ddqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded +ddqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded +ddqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded +ddqua095 quantize 1.2345 1e-6 -> 1.234500 +ddqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded +ddqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded +ddqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded +ddqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded +ddqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded + +ddqua101 quantize -1 1e0 -> -1 +ddqua102 quantize -1 1e-1 -> -1.0 +ddqua103 quantize -1 1e-2 -> -1.00 +ddqua104 quantize 0 1e0 -> 0 +ddqua105 quantize 0 1e-1 -> 0.0 +ddqua106 quantize 0 1e-2 -> 0.00 +ddqua107 quantize 0.00 1e0 -> 0 +ddqua108 quantize 0 1e+1 -> 0E+1 +ddqua109 quantize 0 1e+2 -> 0E+2 +ddqua110 quantize +1 1e0 -> 1 +ddqua111 quantize +1 1e-1 -> 1.0 +ddqua112 quantize +1 1e-2 -> 1.00 + +ddqua120 quantize 1.04 1e-3 -> 1.040 +ddqua121 quantize 1.04 1e-2 -> 1.04 +ddqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded +ddqua123 quantize 1.04 1e0 -> 1 Inexact Rounded +ddqua124 quantize 1.05 1e-3 -> 1.050 +ddqua125 quantize 1.05 1e-2 -> 1.05 +ddqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded +ddqua131 quantize 1.05 1e0 -> 1 Inexact Rounded +ddqua132 quantize 1.06 1e-3 -> 1.060 +ddqua133 quantize 1.06 1e-2 -> 1.06 +ddqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded +ddqua135 quantize 1.06 1e0 -> 1 Inexact Rounded + +ddqua140 quantize -10 1e-2 -> -10.00 +ddqua141 quantize +1 1e-2 -> 1.00 +ddqua142 quantize +10 1e-2 -> 10.00 +ddqua143 quantize 1E+17 1e-2 -> NaN Invalid_operation +ddqua144 quantize 1E-17 1e-2 -> 0.00 Inexact Rounded +ddqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded +ddqua146 quantize 1E-2 1e-2 -> 0.01 +ddqua147 quantize 1E-1 1e-2 -> 0.10 +ddqua148 quantize 0E-17 1e-2 -> 0.00 + +ddqua150 quantize 1.0600 1e-5 -> 1.06000 +ddqua151 quantize 1.0600 1e-4 -> 1.0600 +ddqua152 quantize 1.0600 1e-3 -> 1.060 Rounded +ddqua153 quantize 1.0600 1e-2 -> 1.06 Rounded +ddqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded +ddqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded + +-- a couple where rounding was different in base tests +rounding: half_up +ddqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded +ddqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded +ddqua159 quantize 1.06 1e0 -> 1 Inexact Rounded +rounding: half_even + +-- base tests with non-1 coefficients +ddqua161 quantize 0 -9e0 -> 0 +ddqua162 quantize 1 -7e0 -> 1 +ddqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded +ddqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded +ddqua166 quantize 0.1 2e0 -> 0 Inexact Rounded +ddqua167 quantize 0.1 3e-1 -> 0.1 +ddqua168 quantize 0.1 44e-2 -> 0.10 +ddqua169 quantize 0.1 555e-3 -> 0.100 +ddqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded +ddqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded +ddqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded +ddqua173 quantize 0.9 -9e-1 -> 0.9 +ddqua174 quantize 0.9 0e-2 -> 0.90 +ddqua175 quantize 0.9 1.1e-3 -> 0.9000 +-- negatives +ddqua181 quantize -0 1.1e0 -> -0.0 +ddqua182 quantize -1 -1e0 -> -1 +ddqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded +ddqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded +ddqua186 quantize -0.1 71e0 -> -0 Inexact Rounded +ddqua187 quantize -0.1 -91e-1 -> -0.1 +ddqua188 quantize -0.1 -.1e-2 -> -0.100 +ddqua189 quantize -0.1 -1e-3 -> -0.100 +ddqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded +ddqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded +ddqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded +ddqua193 quantize -0.9 100e-1 -> -0.9 +ddqua194 quantize -0.9 999e-2 -> -0.90 + +-- +ve exponents .. +ddqua201 quantize -1 1e+0 -> -1 +ddqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded +ddqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded +ddqua204 quantize 0 1e+0 -> 0 +ddqua205 quantize 0 1e+1 -> 0E+1 +ddqua206 quantize 0 1e+2 -> 0E+2 +ddqua207 quantize +1 1e+0 -> 1 +ddqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded +ddqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded + +ddqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded +ddqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded +ddqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded +ddqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded +ddqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +ddqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +ddqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +ddqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded +ddqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +ddqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +ddqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +ddqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded +ddqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded +ddqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded +ddqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded +ddqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded + +ddqua240 quantize -10 1e+1 -> -1E+1 Rounded +ddqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded +ddqua242 quantize +10 1e+1 -> 1E+1 Rounded +ddqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1 +ddqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1 +ddqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1 +ddqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1 +ddqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1 +ddqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1 +ddqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1 +ddqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1 +ddqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1 +-- next one tries to add 9 zeros +ddqua252 quantize 1E+17 1e+1 -> NaN Invalid_operation +ddqua253 quantize 1E-17 1e+1 -> 0E+1 Inexact Rounded +ddqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded +ddqua255 quantize 0E-17 1e+1 -> 0E+1 +ddqua256 quantize -0E-17 1e+1 -> -0E+1 +ddqua257 quantize -0E-1 1e+1 -> -0E+1 +ddqua258 quantize -0 1e+1 -> -0E+1 +ddqua259 quantize -0E+1 1e+1 -> -0E+1 + +ddqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded +ddqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded +ddqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded +ddqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded +ddqua264 quantize 1E+2 1e+2 -> 1E+2 +ddqua265 quantize 1E+3 1e+2 -> 1.0E+3 +ddqua266 quantize 1E+4 1e+2 -> 1.00E+4 +ddqua267 quantize 1E+5 1e+2 -> 1.000E+5 +ddqua268 quantize 1E+6 1e+2 -> 1.0000E+6 +ddqua269 quantize 1E+7 1e+2 -> 1.00000E+7 +ddqua270 quantize 1E+8 1e+2 -> 1.000000E+8 +ddqua271 quantize 1E+9 1e+2 -> 1.0000000E+9 +ddqua272 quantize 1E+10 1e+2 -> 1.00000000E+10 +ddqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded +ddqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded +ddqua275 quantize 0E-10 1e+2 -> 0E+2 + +ddqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded +ddqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded +ddqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded +ddqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded +ddqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded +ddqua285 quantize 1E+3 1e+3 -> 1E+3 +ddqua286 quantize 1E+4 1e+3 -> 1.0E+4 +ddqua287 quantize 1E+5 1e+3 -> 1.00E+5 +ddqua288 quantize 1E+6 1e+3 -> 1.000E+6 +ddqua289 quantize 1E+7 1e+3 -> 1.0000E+7 +ddqua290 quantize 1E+8 1e+3 -> 1.00000E+8 +ddqua291 quantize 1E+9 1e+3 -> 1.000000E+9 +ddqua292 quantize 1E+10 1e+3 -> 1.0000000E+10 +ddqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded +ddqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded +ddqua295 quantize 0E-10 1e+3 -> 0E+3 + +-- round up from below [sign wrong in JIT compiler once] +ddqua300 quantize 0.0078 1e-5 -> 0.00780 +ddqua301 quantize 0.0078 1e-4 -> 0.0078 +ddqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded +ddqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded +ddqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded +ddqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded +ddqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded +ddqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded + +ddqua310 quantize -0.0078 1e-5 -> -0.00780 +ddqua311 quantize -0.0078 1e-4 -> -0.0078 +ddqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded +ddqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded +ddqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded +ddqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded +ddqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded +ddqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded + +ddqua320 quantize 0.078 1e-5 -> 0.07800 +ddqua321 quantize 0.078 1e-4 -> 0.0780 +ddqua322 quantize 0.078 1e-3 -> 0.078 +ddqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded +ddqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded +ddqua325 quantize 0.078 1e0 -> 0 Inexact Rounded +ddqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded +ddqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded + +ddqua330 quantize -0.078 1e-5 -> -0.07800 +ddqua331 quantize -0.078 1e-4 -> -0.0780 +ddqua332 quantize -0.078 1e-3 -> -0.078 +ddqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded +ddqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded +ddqua335 quantize -0.078 1e0 -> -0 Inexact Rounded +ddqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded +ddqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded + +ddqua340 quantize 0.78 1e-5 -> 0.78000 +ddqua341 quantize 0.78 1e-4 -> 0.7800 +ddqua342 quantize 0.78 1e-3 -> 0.780 +ddqua343 quantize 0.78 1e-2 -> 0.78 +ddqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded +ddqua345 quantize 0.78 1e0 -> 1 Inexact Rounded +ddqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded +ddqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded + +ddqua350 quantize -0.78 1e-5 -> -0.78000 +ddqua351 quantize -0.78 1e-4 -> -0.7800 +ddqua352 quantize -0.78 1e-3 -> -0.780 +ddqua353 quantize -0.78 1e-2 -> -0.78 +ddqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded +ddqua355 quantize -0.78 1e0 -> -1 Inexact Rounded +ddqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded +ddqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded + +ddqua360 quantize 7.8 1e-5 -> 7.80000 +ddqua361 quantize 7.8 1e-4 -> 7.8000 +ddqua362 quantize 7.8 1e-3 -> 7.800 +ddqua363 quantize 7.8 1e-2 -> 7.80 +ddqua364 quantize 7.8 1e-1 -> 7.8 +ddqua365 quantize 7.8 1e0 -> 8 Inexact Rounded +ddqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded +ddqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded +ddqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded + +ddqua370 quantize -7.8 1e-5 -> -7.80000 +ddqua371 quantize -7.8 1e-4 -> -7.8000 +ddqua372 quantize -7.8 1e-3 -> -7.800 +ddqua373 quantize -7.8 1e-2 -> -7.80 +ddqua374 quantize -7.8 1e-1 -> -7.8 +ddqua375 quantize -7.8 1e0 -> -8 Inexact Rounded +ddqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded +ddqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded +ddqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded + +-- some individuals +ddqua380 quantize 1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded +ddqua381 quantize 12345673523645.06 1e-2 -> 12345673523645.06 +ddqua382 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation +ddqua383 quantize 1234567352364506 1e-2 -> NaN Invalid_operation +ddqua384 quantize -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded +ddqua385 quantize -12345673523645.06 1e-2 -> -12345673523645.06 +ddqua386 quantize -123456735236450.6 1e-2 -> NaN Invalid_operation +ddqua387 quantize -1234567352364506 1e-2 -> NaN Invalid_operation + +rounding: down +ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation +-- ? should that one instead have been: +-- ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation +rounding: half_up + +-- and a few more from e-mail discussions +ddqua391 quantize 12345678912.34567 1e-3 -> 12345678912.346 Inexact Rounded +ddqua392 quantize 123456789123.4567 1e-3 -> 123456789123.457 Inexact Rounded +ddqua393 quantize 1234567891234.567 1e-3 -> 1234567891234.567 +ddqua394 quantize 12345678912345.67 1e-3 -> NaN Invalid_operation +ddqua395 quantize 123456789123456.7 1e-3 -> NaN Invalid_operation +ddqua396 quantize 1234567891234567. 1e-3 -> NaN Invalid_operation + +-- some 9999 round-up cases +ddqua400 quantize 9.999 1e-5 -> 9.99900 +ddqua401 quantize 9.999 1e-4 -> 9.9990 +ddqua402 quantize 9.999 1e-3 -> 9.999 +ddqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded +ddqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded +ddqua405 quantize 9.999 1e0 -> 10 Inexact Rounded +ddqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded +ddqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded + +ddqua410 quantize 0.999 1e-5 -> 0.99900 +ddqua411 quantize 0.999 1e-4 -> 0.9990 +ddqua412 quantize 0.999 1e-3 -> 0.999 +ddqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded +ddqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded +ddqua415 quantize 0.999 1e0 -> 1 Inexact Rounded +ddqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded + +ddqua420 quantize 0.0999 1e-5 -> 0.09990 +ddqua421 quantize 0.0999 1e-4 -> 0.0999 +ddqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded +ddqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded +ddqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded +ddqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded +ddqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded + +ddqua430 quantize 0.00999 1e-5 -> 0.00999 +ddqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded +ddqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded +ddqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded +ddqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded +ddqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded +ddqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded + +ddqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded +ddqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded +ddqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded +ddqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded +ddqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded +ddqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded +ddqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded + +ddqua1001 quantize 0.000 0.001 -> 0.000 +ddqua1002 quantize 0.001 0.001 -> 0.001 +ddqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded +ddqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded +ddqua1005 quantize 0.501 0.001 -> 0.501 +ddqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded +ddqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded +ddqua1008 quantize 0.999 0.001 -> 0.999 + +ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +ddqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +ddqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +ddqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +ddqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +-- a potential double-round +ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +ddqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +ddqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +ddqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +ddqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +-- Zeros +ddqua500 quantize 0 1e1 -> 0E+1 +ddqua501 quantize 0 1e0 -> 0 +ddqua502 quantize 0 1e-1 -> 0.0 +ddqua503 quantize 0.0 1e-1 -> 0.0 +ddqua504 quantize 0.0 1e0 -> 0 +ddqua505 quantize 0.0 1e+1 -> 0E+1 +ddqua506 quantize 0E+1 1e-1 -> 0.0 +ddqua507 quantize 0E+1 1e0 -> 0 +ddqua508 quantize 0E+1 1e+1 -> 0E+1 +ddqua509 quantize -0 1e1 -> -0E+1 +ddqua510 quantize -0 1e0 -> -0 +ddqua511 quantize -0 1e-1 -> -0.0 +ddqua512 quantize -0.0 1e-1 -> -0.0 +ddqua513 quantize -0.0 1e0 -> -0 +ddqua514 quantize -0.0 1e+1 -> -0E+1 +ddqua515 quantize -0E+1 1e-1 -> -0.0 +ddqua516 quantize -0E+1 1e0 -> -0 +ddqua517 quantize -0E+1 1e+1 -> -0E+1 + +-- Suspicious RHS values +ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded +ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded +ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded +ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded +-- next four are "won't fit" overfl +ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation +ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation +ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation +ddqua529 quantize 123.456 1e-299 -> NaN Invalid_operation + +ddqua532 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded +ddqua533 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded +ddqua534 quantize 1.234 1e299 -> 0E+299 Inexact Rounded +ddqua537 quantize 0 1e-299 -> 0E-299 +-- next two are "won't fit" overflows +ddqua538 quantize 1.234 1e-299 -> NaN Invalid_operation +ddqua539 quantize 1.234 1e-300 -> NaN Invalid_operation +-- [more below] + +-- Specials +ddqua580 quantize Inf -Inf -> Infinity +ddqua581 quantize Inf 1e-299 -> NaN Invalid_operation +ddqua582 quantize Inf 1e-1 -> NaN Invalid_operation +ddqua583 quantize Inf 1e0 -> NaN Invalid_operation +ddqua584 quantize Inf 1e1 -> NaN Invalid_operation +ddqua585 quantize Inf 1e299 -> NaN Invalid_operation +ddqua586 quantize Inf Inf -> Infinity +ddqua587 quantize -1000 Inf -> NaN Invalid_operation +ddqua588 quantize -Inf Inf -> -Infinity +ddqua589 quantize -1 Inf -> NaN Invalid_operation +ddqua590 quantize 0 Inf -> NaN Invalid_operation +ddqua591 quantize 1 Inf -> NaN Invalid_operation +ddqua592 quantize 1000 Inf -> NaN Invalid_operation +ddqua593 quantize Inf Inf -> Infinity +ddqua594 quantize Inf 1e-0 -> NaN Invalid_operation +ddqua595 quantize -0 Inf -> NaN Invalid_operation + +ddqua600 quantize -Inf -Inf -> -Infinity +ddqua601 quantize -Inf 1e-299 -> NaN Invalid_operation +ddqua602 quantize -Inf 1e-1 -> NaN Invalid_operation +ddqua603 quantize -Inf 1e0 -> NaN Invalid_operation +ddqua604 quantize -Inf 1e1 -> NaN Invalid_operation +ddqua605 quantize -Inf 1e299 -> NaN Invalid_operation +ddqua606 quantize -Inf Inf -> -Infinity +ddqua607 quantize -1000 Inf -> NaN Invalid_operation +ddqua608 quantize -Inf -Inf -> -Infinity +ddqua609 quantize -1 -Inf -> NaN Invalid_operation +ddqua610 quantize 0 -Inf -> NaN Invalid_operation +ddqua611 quantize 1 -Inf -> NaN Invalid_operation +ddqua612 quantize 1000 -Inf -> NaN Invalid_operation +ddqua613 quantize Inf -Inf -> Infinity +ddqua614 quantize -Inf 1e-0 -> NaN Invalid_operation +ddqua615 quantize -0 -Inf -> NaN Invalid_operation + +ddqua621 quantize NaN -Inf -> NaN +ddqua622 quantize NaN 1e-299 -> NaN +ddqua623 quantize NaN 1e-1 -> NaN +ddqua624 quantize NaN 1e0 -> NaN +ddqua625 quantize NaN 1e1 -> NaN +ddqua626 quantize NaN 1e299 -> NaN +ddqua627 quantize NaN Inf -> NaN +ddqua628 quantize NaN NaN -> NaN +ddqua629 quantize -Inf NaN -> NaN +ddqua630 quantize -1000 NaN -> NaN +ddqua631 quantize -1 NaN -> NaN +ddqua632 quantize 0 NaN -> NaN +ddqua633 quantize 1 NaN -> NaN +ddqua634 quantize 1000 NaN -> NaN +ddqua635 quantize Inf NaN -> NaN +ddqua636 quantize NaN 1e-0 -> NaN +ddqua637 quantize -0 NaN -> NaN + +ddqua641 quantize sNaN -Inf -> NaN Invalid_operation +ddqua642 quantize sNaN 1e-299 -> NaN Invalid_operation +ddqua643 quantize sNaN 1e-1 -> NaN Invalid_operation +ddqua644 quantize sNaN 1e0 -> NaN Invalid_operation +ddqua645 quantize sNaN 1e1 -> NaN Invalid_operation +ddqua646 quantize sNaN 1e299 -> NaN Invalid_operation +ddqua647 quantize sNaN NaN -> NaN Invalid_operation +ddqua648 quantize sNaN sNaN -> NaN Invalid_operation +ddqua649 quantize NaN sNaN -> NaN Invalid_operation +ddqua650 quantize -Inf sNaN -> NaN Invalid_operation +ddqua651 quantize -1000 sNaN -> NaN Invalid_operation +ddqua652 quantize -1 sNaN -> NaN Invalid_operation +ddqua653 quantize 0 sNaN -> NaN Invalid_operation +ddqua654 quantize 1 sNaN -> NaN Invalid_operation +ddqua655 quantize 1000 sNaN -> NaN Invalid_operation +ddqua656 quantize Inf sNaN -> NaN Invalid_operation +ddqua657 quantize NaN sNaN -> NaN Invalid_operation +ddqua658 quantize sNaN 1e-0 -> NaN Invalid_operation +ddqua659 quantize -0 sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddqua661 quantize NaN9 -Inf -> NaN9 +ddqua662 quantize NaN8 919 -> NaN8 +ddqua663 quantize NaN71 Inf -> NaN71 +ddqua664 quantize NaN6 NaN5 -> NaN6 +ddqua665 quantize -Inf NaN4 -> NaN4 +ddqua666 quantize -919 NaN31 -> NaN31 +ddqua667 quantize Inf NaN2 -> NaN2 + +ddqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation +ddqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation +ddqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation +ddqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation +ddqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation +ddqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation +ddqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation +ddqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation +ddqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation + +ddqua681 quantize -NaN9 -Inf -> -NaN9 +ddqua682 quantize -NaN8 919 -> -NaN8 +ddqua683 quantize -NaN71 Inf -> -NaN71 +ddqua684 quantize -NaN6 -NaN5 -> -NaN6 +ddqua685 quantize -Inf -NaN4 -> -NaN4 +ddqua686 quantize -919 -NaN31 -> -NaN31 +ddqua687 quantize Inf -NaN2 -> -NaN2 + +ddqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation +ddqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation +ddqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation +ddqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation +ddqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation +ddqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation +ddqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation +ddqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation +ddqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation + +-- subnormals and underflow +ddqua710 quantize 1.00E-383 1e-383 -> 1E-383 Rounded +ddqua711 quantize 0.1E-383 2e-384 -> 1E-384 Subnormal +ddqua712 quantize 0.10E-383 3e-384 -> 1E-384 Subnormal Rounded +ddqua713 quantize 0.100E-383 4e-384 -> 1E-384 Subnormal Rounded +ddqua714 quantize 0.01E-383 5e-385 -> 1E-385 Subnormal +-- next is rounded to Emin +ddqua715 quantize 0.999E-383 1e-383 -> 1E-383 Inexact Rounded +ddqua716 quantize 0.099E-383 10e-384 -> 1E-384 Inexact Rounded Subnormal + +ddqua717 quantize 0.009E-383 1e-385 -> 1E-385 Inexact Rounded Subnormal +ddqua718 quantize 0.001E-383 1e-385 -> 0E-385 Inexact Rounded +ddqua719 quantize 0.0009E-383 1e-385 -> 0E-385 Inexact Rounded +ddqua720 quantize 0.0001E-383 1e-385 -> 0E-385 Inexact Rounded + +ddqua730 quantize -1.00E-383 1e-383 -> -1E-383 Rounded +ddqua731 quantize -0.1E-383 1e-383 -> -0E-383 Rounded Inexact +ddqua732 quantize -0.10E-383 1e-383 -> -0E-383 Rounded Inexact +ddqua733 quantize -0.100E-383 1e-383 -> -0E-383 Rounded Inexact +ddqua734 quantize -0.01E-383 1e-383 -> -0E-383 Inexact Rounded +-- next is rounded to Emin +ddqua735 quantize -0.999E-383 90e-383 -> -1E-383 Inexact Rounded +ddqua736 quantize -0.099E-383 -1e-383 -> -0E-383 Inexact Rounded +ddqua737 quantize -0.009E-383 -1e-383 -> -0E-383 Inexact Rounded +ddqua738 quantize -0.001E-383 -0e-383 -> -0E-383 Inexact Rounded +ddqua739 quantize -0.0001E-383 0e-383 -> -0E-383 Inexact Rounded + +ddqua740 quantize -1.00E-383 1e-384 -> -1.0E-383 Rounded +ddqua741 quantize -0.1E-383 1e-384 -> -1E-384 Subnormal +ddqua742 quantize -0.10E-383 1e-384 -> -1E-384 Subnormal Rounded +ddqua743 quantize -0.100E-383 1e-384 -> -1E-384 Subnormal Rounded +ddqua744 quantize -0.01E-383 1e-384 -> -0E-384 Inexact Rounded +-- next is rounded to Emin +ddqua745 quantize -0.999E-383 1e-384 -> -1.0E-383 Inexact Rounded +ddqua746 quantize -0.099E-383 1e-384 -> -1E-384 Inexact Rounded Subnormal +ddqua747 quantize -0.009E-383 1e-384 -> -0E-384 Inexact Rounded +ddqua748 quantize -0.001E-383 1e-384 -> -0E-384 Inexact Rounded +ddqua749 quantize -0.0001E-383 1e-384 -> -0E-384 Inexact Rounded + +ddqua750 quantize -1.00E-383 1e-385 -> -1.00E-383 +ddqua751 quantize -0.1E-383 1e-385 -> -1.0E-384 Subnormal +ddqua752 quantize -0.10E-383 1e-385 -> -1.0E-384 Subnormal +ddqua753 quantize -0.100E-383 1e-385 -> -1.0E-384 Subnormal Rounded +ddqua754 quantize -0.01E-383 1e-385 -> -1E-385 Subnormal +-- next is rounded to Emin +ddqua755 quantize -0.999E-383 1e-385 -> -1.00E-383 Inexact Rounded +ddqua756 quantize -0.099E-383 1e-385 -> -1.0E-384 Inexact Rounded Subnormal +ddqua757 quantize -0.009E-383 1e-385 -> -1E-385 Inexact Rounded Subnormal +ddqua758 quantize -0.001E-383 1e-385 -> -0E-385 Inexact Rounded +ddqua759 quantize -0.0001E-383 1e-385 -> -0E-385 Inexact Rounded + +ddqua760 quantize -1.00E-383 1e-386 -> -1.000E-383 +ddqua761 quantize -0.1E-383 1e-386 -> -1.00E-384 Subnormal +ddqua762 quantize -0.10E-383 1e-386 -> -1.00E-384 Subnormal +ddqua763 quantize -0.100E-383 1e-386 -> -1.00E-384 Subnormal +ddqua764 quantize -0.01E-383 1e-386 -> -1.0E-385 Subnormal +ddqua765 quantize -0.999E-383 1e-386 -> -9.99E-384 Subnormal +ddqua766 quantize -0.099E-383 1e-386 -> -9.9E-385 Subnormal +ddqua767 quantize -0.009E-383 1e-386 -> -9E-386 Subnormal +ddqua768 quantize -0.001E-383 1e-386 -> -1E-386 Subnormal +ddqua769 quantize -0.0001E-383 1e-386 -> -0E-386 Inexact Rounded + +-- More from Fung Lee +ddqua1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384 +ddqua1022 quantize -8.666666666666000E+384 1.000000000000000E+384 -> -8.666666666666000E+384 +ddqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation +ddqua1029 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded + + +--ddqua1030 quantize 8.666666666666000E+384 1E+384 -> 9.000000000000000E+384 Rounded Inexact +--ddqua1031 quantize 8.666666666666000E+384 1E+384 -> 8.666666666666000E+384 Rounded +--ddqua1032 quantize 8.666666666666000E+384 1E+383 -> 8.666666666666000E+384 Rounded +--ddqua1033 quantize 8.666666666666000E+384 1E+382 -> 8.666666666666000E+384 Rounded +--ddqua1034 quantize 8.666666666666000E+384 1E+381 -> 8.666666666666000E+384 Rounded +--ddqua1035 quantize 8.666666666666000E+384 1E+380 -> 8.666666666666000E+384 Rounded + +-- Int and uInt32 edge values for testing conversions +ddqua1040 quantize -2147483646 0 -> -2147483646 +ddqua1041 quantize -2147483647 0 -> -2147483647 +ddqua1042 quantize -2147483648 0 -> -2147483648 +ddqua1043 quantize -2147483649 0 -> -2147483649 +ddqua1044 quantize 2147483646 0 -> 2147483646 +ddqua1045 quantize 2147483647 0 -> 2147483647 +ddqua1046 quantize 2147483648 0 -> 2147483648 +ddqua1047 quantize 2147483649 0 -> 2147483649 +ddqua1048 quantize 4294967294 0 -> 4294967294 +ddqua1049 quantize 4294967295 0 -> 4294967295 +ddqua1050 quantize 4294967296 0 -> 4294967296 +ddqua1051 quantize 4294967297 0 -> 4294967297 + +-- Rounding swathe +rounding: half_even +ddqua1100 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +ddqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +ddqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +ddqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +ddqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +ddqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +ddqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +ddqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +ddqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded + +rounding: half_up +ddqua1200 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +ddqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +ddqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +ddqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +ddqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded +ddqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +ddqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +ddqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +ddqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded + +rounding: half_down +ddqua1300 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +ddqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +ddqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded +ddqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +ddqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +ddqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +ddqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +ddqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +ddqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded + +rounding: up +ddqua1400 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded +ddqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded +ddqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +ddqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +ddqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded +ddqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +ddqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +ddqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +ddqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded +ddqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded + +rounding: down +ddqua1500 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +ddqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +ddqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded +ddqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded +ddqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +ddqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded +ddqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded +ddqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded +ddqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded +ddqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded + +rounding: ceiling +ddqua1600 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded +ddqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded +ddqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +ddqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +ddqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded +ddqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +ddqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +ddqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +ddqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded +ddqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded + +rounding: floor +ddqua1700 quantize 1.2300 1.00 -> 1.23 Rounded +ddqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +ddqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +ddqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded +ddqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded +ddqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +ddqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded +ddqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded +ddqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded +ddqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded +ddqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded + +rounding: 05up +ddqua1800 quantize 1.2000 1.00 -> 1.20 Rounded +ddqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded +ddqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded +ddqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded +ddqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded +ddqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded +ddqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded +ddqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded +ddqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded + +ddqua1900 quantize 1.2100 1.00 -> 1.21 Rounded +ddqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded +ddqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded +ddqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded +ddqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded +ddqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded +ddqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded +ddqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded +ddqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded + +ddqua2000 quantize 1.2400 1.00 -> 1.24 Rounded +ddqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded +ddqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded +ddqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +ddqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded +ddqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded +ddqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded +ddqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded +ddqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded + +ddqua2100 quantize 1.2500 1.00 -> 1.25 Rounded +ddqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded +ddqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded +ddqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded +ddqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded +ddqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded +ddqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded +ddqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded +ddqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded + +ddqua2200 quantize 1.2600 1.00 -> 1.26 Rounded +ddqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded +ddqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded +ddqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded +ddqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded +ddqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded +ddqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded +ddqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded +ddqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded + +ddqua2300 quantize 1.2900 1.00 -> 1.29 Rounded +ddqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded +ddqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded +ddqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded +ddqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded +ddqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded +ddqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded +ddqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded +ddqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded + +-- Null tests +rounding: half_even +ddqua998 quantize 10 # -> NaN Invalid_operation +ddqua999 quantize # 1e10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddReduce.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddReduce.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,182 @@ +------------------------------------------------------------------------ +-- ddReduce.decTest -- remove trailing zeros from a decDouble -- +-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddred001 reduce '1' -> '1' +ddred002 reduce '-1' -> '-1' +ddred003 reduce '1.00' -> '1' +ddred004 reduce '-1.00' -> '-1' +ddred005 reduce '0' -> '0' +ddred006 reduce '0.00' -> '0' +ddred007 reduce '00.0' -> '0' +ddred008 reduce '00.00' -> '0' +ddred009 reduce '00' -> '0' +ddred010 reduce '0E+1' -> '0' +ddred011 reduce '0E+5' -> '0' + +ddred012 reduce '-2' -> '-2' +ddred013 reduce '2' -> '2' +ddred014 reduce '-2.00' -> '-2' +ddred015 reduce '2.00' -> '2' +ddred016 reduce '-0' -> '-0' +ddred017 reduce '-0.00' -> '-0' +ddred018 reduce '-00.0' -> '-0' +ddred019 reduce '-00.00' -> '-0' +ddred020 reduce '-00' -> '-0' +ddred021 reduce '-0E+5' -> '-0' +ddred022 reduce '-0E+1' -> '-0' + +ddred030 reduce '+0.1' -> '0.1' +ddred031 reduce '-0.1' -> '-0.1' +ddred032 reduce '+0.01' -> '0.01' +ddred033 reduce '-0.01' -> '-0.01' +ddred034 reduce '+0.001' -> '0.001' +ddred035 reduce '-0.001' -> '-0.001' +ddred036 reduce '+0.000001' -> '0.000001' +ddred037 reduce '-0.000001' -> '-0.000001' +ddred038 reduce '+0.000000000001' -> '1E-12' +ddred039 reduce '-0.000000000001' -> '-1E-12' + +ddred041 reduce 1.1 -> 1.1 +ddred042 reduce 1.10 -> 1.1 +ddred043 reduce 1.100 -> 1.1 +ddred044 reduce 1.110 -> 1.11 +ddred045 reduce -1.1 -> -1.1 +ddred046 reduce -1.10 -> -1.1 +ddred047 reduce -1.100 -> -1.1 +ddred048 reduce -1.110 -> -1.11 +ddred049 reduce 9.9 -> 9.9 +ddred050 reduce 9.90 -> 9.9 +ddred051 reduce 9.900 -> 9.9 +ddred052 reduce 9.990 -> 9.99 +ddred053 reduce -9.9 -> -9.9 +ddred054 reduce -9.90 -> -9.9 +ddred055 reduce -9.900 -> -9.9 +ddred056 reduce -9.990 -> -9.99 + +-- some trailing fractional zeros with zeros in units +ddred060 reduce 10.0 -> 1E+1 +ddred061 reduce 10.00 -> 1E+1 +ddred062 reduce 100.0 -> 1E+2 +ddred063 reduce 100.00 -> 1E+2 +ddred064 reduce 1.1000E+3 -> 1.1E+3 +ddred065 reduce 1.10000E+3 -> 1.1E+3 +ddred066 reduce -10.0 -> -1E+1 +ddred067 reduce -10.00 -> -1E+1 +ddred068 reduce -100.0 -> -1E+2 +ddred069 reduce -100.00 -> -1E+2 +ddred070 reduce -1.1000E+3 -> -1.1E+3 +ddred071 reduce -1.10000E+3 -> -1.1E+3 + +-- some insignificant trailing zeros with positive exponent +ddred080 reduce 10E+1 -> 1E+2 +ddred081 reduce 100E+1 -> 1E+3 +ddred082 reduce 1.0E+2 -> 1E+2 +ddred083 reduce 1.0E+3 -> 1E+3 +ddred084 reduce 1.1E+3 -> 1.1E+3 +ddred085 reduce 1.00E+3 -> 1E+3 +ddred086 reduce 1.10E+3 -> 1.1E+3 +ddred087 reduce -10E+1 -> -1E+2 +ddred088 reduce -100E+1 -> -1E+3 +ddred089 reduce -1.0E+2 -> -1E+2 +ddred090 reduce -1.0E+3 -> -1E+3 +ddred091 reduce -1.1E+3 -> -1.1E+3 +ddred092 reduce -1.00E+3 -> -1E+3 +ddred093 reduce -1.10E+3 -> -1.1E+3 + +-- some significant trailing zeros, were we to be trimming +ddred100 reduce 11 -> 11 +ddred101 reduce 10 -> 1E+1 +ddred102 reduce 10. -> 1E+1 +ddred103 reduce 1.1E+1 -> 11 +ddred104 reduce 1.0E+1 -> 1E+1 +ddred105 reduce 1.10E+2 -> 1.1E+2 +ddred106 reduce 1.00E+2 -> 1E+2 +ddred107 reduce 1.100E+3 -> 1.1E+3 +ddred108 reduce 1.000E+3 -> 1E+3 +ddred109 reduce 1.000000E+6 -> 1E+6 +ddred110 reduce -11 -> -11 +ddred111 reduce -10 -> -1E+1 +ddred112 reduce -10. -> -1E+1 +ddred113 reduce -1.1E+1 -> -11 +ddred114 reduce -1.0E+1 -> -1E+1 +ddred115 reduce -1.10E+2 -> -1.1E+2 +ddred116 reduce -1.00E+2 -> -1E+2 +ddred117 reduce -1.100E+3 -> -1.1E+3 +ddred118 reduce -1.000E+3 -> -1E+3 +ddred119 reduce -1.00000E+5 -> -1E+5 +ddred120 reduce -1.000000E+6 -> -1E+6 +ddred121 reduce -10.00000E+6 -> -1E+7 +ddred122 reduce -100.0000E+6 -> -1E+8 +ddred123 reduce -1000.000E+6 -> -1E+9 +ddred124 reduce -10000.00E+6 -> -1E+10 +ddred125 reduce -100000.0E+6 -> -1E+11 +ddred126 reduce -1000000.E+6 -> -1E+12 + +-- examples from decArith +ddred140 reduce '2.1' -> '2.1' +ddred141 reduce '-2.0' -> '-2' +ddred142 reduce '1.200' -> '1.2' +ddred143 reduce '-120' -> '-1.2E+2' +ddred144 reduce '120.00' -> '1.2E+2' +ddred145 reduce '0.00' -> '0' + +-- Nmax, Nmin, Ntiny +-- note origami effect on some of these +ddred151 reduce 9.999999999999999E+384 -> 9.999999999999999E+384 +ddred152 reduce 9.999999000000000E+380 -> 9.99999900000E+380 +ddred153 reduce 9.999999999990000E+384 -> 9.999999999990000E+384 +ddred154 reduce 1E-383 -> 1E-383 +ddred155 reduce 1.000000000000000E-383 -> 1E-383 +ddred156 reduce 2.000E-395 -> 2E-395 Subnormal +ddred157 reduce 1E-398 -> 1E-398 Subnormal + +ddred161 reduce -1E-398 -> -1E-398 Subnormal +ddred162 reduce -2.000E-395 -> -2E-395 Subnormal +ddred163 reduce -1.000000000000000E-383 -> -1E-383 +ddred164 reduce -1E-383 -> -1E-383 +ddred165 reduce -9.999999000000000E+380 -> -9.99999900000E+380 +ddred166 reduce -9.999999999990000E+384 -> -9.999999999990000E+384 +ddred167 reduce -9.999999999999990E+384 -> -9.999999999999990E+384 +ddred168 reduce -9.999999999999999E+384 -> -9.999999999999999E+384 +ddred169 reduce -9.999999999999990E+384 -> -9.999999999999990E+384 + + +-- specials (reduce does not affect payload) +ddred820 reduce 'Inf' -> 'Infinity' +ddred821 reduce '-Inf' -> '-Infinity' +ddred822 reduce NaN -> NaN +ddred823 reduce sNaN -> NaN Invalid_operation +ddred824 reduce NaN101 -> NaN101 +ddred825 reduce sNaN010 -> NaN10 Invalid_operation +ddred827 reduce -NaN -> -NaN +ddred828 reduce -sNaN -> -NaN Invalid_operation +ddred829 reduce -NaN101 -> -NaN101 +ddred830 reduce -sNaN010 -> -NaN10 Invalid_operation + +-- Null test +ddred900 reduce # -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRemainder.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRemainder.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,600 @@ +------------------------------------------------------------------------ +-- ddRemainder.decTest -- decDouble remainder -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks (as base, above) +ddrem001 remainder 1 1 -> 0 +ddrem002 remainder 2 1 -> 0 +ddrem003 remainder 1 2 -> 1 +ddrem004 remainder 2 2 -> 0 +ddrem005 remainder 0 1 -> 0 +ddrem006 remainder 0 2 -> 0 +ddrem007 remainder 1 3 -> 1 +ddrem008 remainder 2 3 -> 2 +ddrem009 remainder 3 3 -> 0 + +ddrem010 remainder 2.4 1 -> 0.4 +ddrem011 remainder 2.4 -1 -> 0.4 +ddrem012 remainder -2.4 1 -> -0.4 +ddrem013 remainder -2.4 -1 -> -0.4 +ddrem014 remainder 2.40 1 -> 0.40 +ddrem015 remainder 2.400 1 -> 0.400 +ddrem016 remainder 2.4 2 -> 0.4 +ddrem017 remainder 2.400 2 -> 0.400 +ddrem018 remainder 2. 2 -> 0 +ddrem019 remainder 20 20 -> 0 + +ddrem020 remainder 187 187 -> 0 +ddrem021 remainder 5 2 -> 1 +ddrem022 remainder 5 2.0 -> 1.0 +ddrem023 remainder 5 2.000 -> 1.000 +ddrem024 remainder 5 0.200 -> 0.000 +ddrem025 remainder 5 0.200 -> 0.000 + +ddrem030 remainder 1 2 -> 1 +ddrem031 remainder 1 4 -> 1 +ddrem032 remainder 1 8 -> 1 + +ddrem033 remainder 1 16 -> 1 +ddrem034 remainder 1 32 -> 1 +ddrem035 remainder 1 64 -> 1 +ddrem040 remainder 1 -2 -> 1 +ddrem041 remainder 1 -4 -> 1 +ddrem042 remainder 1 -8 -> 1 +ddrem043 remainder 1 -16 -> 1 +ddrem044 remainder 1 -32 -> 1 +ddrem045 remainder 1 -64 -> 1 +ddrem050 remainder -1 2 -> -1 +ddrem051 remainder -1 4 -> -1 +ddrem052 remainder -1 8 -> -1 +ddrem053 remainder -1 16 -> -1 +ddrem054 remainder -1 32 -> -1 +ddrem055 remainder -1 64 -> -1 +ddrem060 remainder -1 -2 -> -1 +ddrem061 remainder -1 -4 -> -1 +ddrem062 remainder -1 -8 -> -1 +ddrem063 remainder -1 -16 -> -1 +ddrem064 remainder -1 -32 -> -1 +ddrem065 remainder -1 -64 -> -1 + +ddrem066 remainder 999999999 1 -> 0 +ddrem067 remainder 999999999.4 1 -> 0.4 +ddrem068 remainder 999999999.5 1 -> 0.5 +ddrem069 remainder 999999999.9 1 -> 0.9 +ddrem070 remainder 999999999.999 1 -> 0.999 +ddrem071 remainder 999999.999999 1 -> 0.999999 +ddrem072 remainder 9 1 -> 0 +ddrem073 remainder 9999999999999999 1 -> 0 +ddrem074 remainder 9999999999999999 2 -> 1 +ddrem075 remainder 9999999999999999 3 -> 0 +ddrem076 remainder 9999999999999999 4 -> 3 + +ddrem080 remainder 0. 1 -> 0 +ddrem081 remainder .0 1 -> 0.0 +ddrem082 remainder 0.00 1 -> 0.00 +ddrem083 remainder 0.00E+9 1 -> 0 +ddrem084 remainder 0.00E+3 1 -> 0 +ddrem085 remainder 0.00E+2 1 -> 0 +ddrem086 remainder 0.00E+1 1 -> 0.0 +ddrem087 remainder 0.00E+0 1 -> 0.00 +ddrem088 remainder 0.00E-0 1 -> 0.00 +ddrem089 remainder 0.00E-1 1 -> 0.000 +ddrem090 remainder 0.00E-2 1 -> 0.0000 +ddrem091 remainder 0.00E-3 1 -> 0.00000 +ddrem092 remainder 0.00E-4 1 -> 0.000000 +ddrem093 remainder 0.00E-5 1 -> 0E-7 +ddrem094 remainder 0.00E-6 1 -> 0E-8 +ddrem095 remainder 0.0000E-50 1 -> 0E-54 + +-- Various flavours of remainder by 0 +ddrem101 remainder 0 0 -> NaN Division_undefined +ddrem102 remainder 0 -0 -> NaN Division_undefined +ddrem103 remainder -0 0 -> NaN Division_undefined +ddrem104 remainder -0 -0 -> NaN Division_undefined +ddrem105 remainder 0.0E5 0 -> NaN Division_undefined +ddrem106 remainder 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, but +-- IEEE 854 is explicit that it is Invalid operation .. for +-- remainder-near, anyway] +ddrem107 remainder 0.0001 0 -> NaN Invalid_operation +ddrem108 remainder 0.01 0 -> NaN Invalid_operation +ddrem109 remainder 0.1 0 -> NaN Invalid_operation +ddrem110 remainder 1 0 -> NaN Invalid_operation +ddrem111 remainder 1 0.0 -> NaN Invalid_operation +ddrem112 remainder 10 0.0 -> NaN Invalid_operation +ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation +ddrem114 remainder 1E+380 0 -> NaN Invalid_operation +ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation +ddrem116 remainder 0.01 -0 -> NaN Invalid_operation +ddrem119 remainder 0.1 -0 -> NaN Invalid_operation +ddrem120 remainder 1 -0 -> NaN Invalid_operation +ddrem121 remainder 1 -0.0 -> NaN Invalid_operation +ddrem122 remainder 10 -0.0 -> NaN Invalid_operation +ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation +ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation +-- and zeros on left +ddrem130 remainder 0 1 -> 0 +ddrem131 remainder 0 -1 -> 0 +ddrem132 remainder 0.0 1 -> 0.0 +ddrem133 remainder 0.0 -1 -> 0.0 +ddrem134 remainder -0 1 -> -0 +ddrem135 remainder -0 -1 -> -0 +ddrem136 remainder -0.0 1 -> -0.0 +ddrem137 remainder -0.0 -1 -> -0.0 + +-- 0.5ers +ddrem143 remainder 0.5 2 -> 0.5 +ddrem144 remainder 0.5 2.1 -> 0.5 +ddrem145 remainder 0.5 2.01 -> 0.50 +ddrem146 remainder 0.5 2.001 -> 0.500 +ddrem147 remainder 0.50 2 -> 0.50 +ddrem148 remainder 0.50 2.01 -> 0.50 +ddrem149 remainder 0.50 2.001 -> 0.500 + +-- steadies +ddrem150 remainder 1 1 -> 0 +ddrem151 remainder 1 2 -> 1 +ddrem152 remainder 1 3 -> 1 +ddrem153 remainder 1 4 -> 1 +ddrem154 remainder 1 5 -> 1 +ddrem155 remainder 1 6 -> 1 +ddrem156 remainder 1 7 -> 1 +ddrem157 remainder 1 8 -> 1 +ddrem158 remainder 1 9 -> 1 +ddrem159 remainder 1 10 -> 1 +ddrem160 remainder 1 1 -> 0 +ddrem161 remainder 2 1 -> 0 +ddrem162 remainder 3 1 -> 0 +ddrem163 remainder 4 1 -> 0 +ddrem164 remainder 5 1 -> 0 +ddrem165 remainder 6 1 -> 0 +ddrem166 remainder 7 1 -> 0 +ddrem167 remainder 8 1 -> 0 +ddrem168 remainder 9 1 -> 0 +ddrem169 remainder 10 1 -> 0 + +-- some differences from remainderNear +ddrem171 remainder 0.4 1.020 -> 0.400 +ddrem172 remainder 0.50 1.020 -> 0.500 +ddrem173 remainder 0.51 1.020 -> 0.510 +ddrem174 remainder 0.52 1.020 -> 0.520 +ddrem175 remainder 0.6 1.020 -> 0.600 + +-- More flavours of remainder by 0 +ddrem201 remainder 0 0 -> NaN Division_undefined +ddrem202 remainder 0.0E5 0 -> NaN Division_undefined +ddrem203 remainder 0.000 0 -> NaN Division_undefined +ddrem204 remainder 0.0001 0 -> NaN Invalid_operation +ddrem205 remainder 0.01 0 -> NaN Invalid_operation +ddrem206 remainder 0.1 0 -> NaN Invalid_operation +ddrem207 remainder 1 0 -> NaN Invalid_operation +ddrem208 remainder 1 0.0 -> NaN Invalid_operation +ddrem209 remainder 10 0.0 -> NaN Invalid_operation +ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation +ddrem211 remainder 1E+380 0 -> NaN Invalid_operation + +-- some differences from remainderNear +ddrem231 remainder -0.4 1.020 -> -0.400 +ddrem232 remainder -0.50 1.020 -> -0.500 +ddrem233 remainder -0.51 1.020 -> -0.510 +ddrem234 remainder -0.52 1.020 -> -0.520 +ddrem235 remainder -0.6 1.020 -> -0.600 + +-- high Xs +ddrem240 remainder 1E+2 1.00 -> 0.00 + +-- ddrem3xx are from DiagBigDecimal +ddrem301 remainder 1 3 -> 1 +ddrem302 remainder 5 5 -> 0 +ddrem303 remainder 13 10 -> 3 +ddrem304 remainder 13 50 -> 13 +ddrem305 remainder 13 100 -> 13 +ddrem306 remainder 13 1000 -> 13 +ddrem307 remainder .13 1 -> 0.13 +ddrem308 remainder 0.133 1 -> 0.133 +ddrem309 remainder 0.1033 1 -> 0.1033 +ddrem310 remainder 1.033 1 -> 0.033 +ddrem311 remainder 10.33 1 -> 0.33 +ddrem312 remainder 10.33 10 -> 0.33 +ddrem313 remainder 103.3 1 -> 0.3 +ddrem314 remainder 133 10 -> 3 +ddrem315 remainder 1033 10 -> 3 +ddrem316 remainder 1033 50 -> 33 +ddrem317 remainder 101.0 3 -> 2.0 +ddrem318 remainder 102.0 3 -> 0.0 +ddrem319 remainder 103.0 3 -> 1.0 +ddrem320 remainder 2.40 1 -> 0.40 +ddrem321 remainder 2.400 1 -> 0.400 +ddrem322 remainder 2.4 1 -> 0.4 +ddrem323 remainder 2.4 2 -> 0.4 +ddrem324 remainder 2.400 2 -> 0.400 +ddrem325 remainder 1 0.3 -> 0.1 +ddrem326 remainder 1 0.30 -> 0.10 +ddrem327 remainder 1 0.300 -> 0.100 +ddrem328 remainder 1 0.3000 -> 0.1000 +ddrem329 remainder 1.0 0.3 -> 0.1 +ddrem330 remainder 1.00 0.3 -> 0.10 +ddrem331 remainder 1.000 0.3 -> 0.100 +ddrem332 remainder 1.0000 0.3 -> 0.1000 +ddrem333 remainder 0.5 2 -> 0.5 +ddrem334 remainder 0.5 2.1 -> 0.5 +ddrem335 remainder 0.5 2.01 -> 0.50 +ddrem336 remainder 0.5 2.001 -> 0.500 +ddrem337 remainder 0.50 2 -> 0.50 +ddrem338 remainder 0.50 2.01 -> 0.50 +ddrem339 remainder 0.50 2.001 -> 0.500 + +ddrem340 remainder 0.5 0.5000001 -> 0.5000000 +ddrem341 remainder 0.5 0.50000001 -> 0.50000000 +ddrem342 remainder 0.5 0.500000001 -> 0.500000000 +ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000 +ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000 +ddrem345 remainder 0.5 0.4999999 -> 1E-7 +ddrem346 remainder 0.5 0.49999999 -> 1E-8 +ddrem347 remainder 0.5 0.499999999 -> 1E-9 +ddrem348 remainder 0.5 0.4999999999 -> 1E-10 +ddrem349 remainder 0.5 0.49999999999 -> 1E-11 +ddrem350 remainder 0.5 0.499999999999 -> 1E-12 + +ddrem351 remainder 0.03 7 -> 0.03 +ddrem352 remainder 5 2 -> 1 +ddrem353 remainder 4.1 2 -> 0.1 +ddrem354 remainder 4.01 2 -> 0.01 +ddrem355 remainder 4.001 2 -> 0.001 +ddrem356 remainder 4.0001 2 -> 0.0001 +ddrem357 remainder 4.00001 2 -> 0.00001 +ddrem358 remainder 4.000001 2 -> 0.000001 +ddrem359 remainder 4.0000001 2 -> 1E-7 + +ddrem360 remainder 1.2 0.7345 -> 0.4655 +ddrem361 remainder 0.8 12 -> 0.8 +ddrem362 remainder 0.8 0.2 -> 0.0 +ddrem363 remainder 0.8 0.3 -> 0.2 +ddrem364 remainder 0.800 12 -> 0.800 +ddrem365 remainder 0.800 1.7 -> 0.800 +ddrem366 remainder 2.400 2 -> 0.400 + +ddrem371 remainder 2.400 2 -> 0.400 + +ddrem381 remainder 12345 1 -> 0 +ddrem382 remainder 12345 1.0001 -> 0.7657 +ddrem383 remainder 12345 1.001 -> 0.668 +ddrem384 remainder 12345 1.01 -> 0.78 +ddrem385 remainder 12345 1.1 -> 0.8 +ddrem386 remainder 12355 4 -> 3 +ddrem387 remainder 12345 4 -> 1 +ddrem388 remainder 12355 4.0001 -> 2.6912 +ddrem389 remainder 12345 4.0001 -> 0.6914 +ddrem390 remainder 12345 4.9 -> 1.9 +ddrem391 remainder 12345 4.99 -> 4.73 +ddrem392 remainder 12345 4.999 -> 2.469 +ddrem393 remainder 12345 4.9999 -> 0.2469 +ddrem394 remainder 12345 5 -> 0 +ddrem395 remainder 12345 5.0001 -> 4.7532 +ddrem396 remainder 12345 5.001 -> 2.532 +ddrem397 remainder 12345 5.01 -> 0.36 +ddrem398 remainder 12345 5.1 -> 3.0 + +-- the nasty division-by-1 cases +ddrem401 remainder 0.5 1 -> 0.5 +ddrem402 remainder 0.55 1 -> 0.55 +ddrem403 remainder 0.555 1 -> 0.555 +ddrem404 remainder 0.5555 1 -> 0.5555 +ddrem405 remainder 0.55555 1 -> 0.55555 +ddrem406 remainder 0.555555 1 -> 0.555555 +ddrem407 remainder 0.5555555 1 -> 0.5555555 +ddrem408 remainder 0.55555555 1 -> 0.55555555 +ddrem409 remainder 0.555555555 1 -> 0.555555555 + +-- folddowns +ddrem421 remainder 1E+384 1 -> NaN Division_impossible +ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped +ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped +ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped +ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped +ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped +ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped +ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped +ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped +ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped +-- tinies +ddrem431 remainder 1E-397 1E-398 -> 0E-398 +ddrem432 remainder 1E-397 2E-398 -> 0E-398 +ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal +ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal +ddrem435 remainder 1E-397 5E-398 -> 0E-398 +ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal +ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal +ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal +ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal +ddrem440 remainder 1E-397 10E-398 -> 0E-398 +ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal +ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal +ddrem443 remainder 100E-397 20E-398 -> 0E-398 +ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal +ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal + +-- zero signs +ddrem650 remainder 1 1 -> 0 +ddrem651 remainder -1 1 -> -0 +ddrem652 remainder 1 -1 -> 0 +ddrem653 remainder -1 -1 -> -0 +ddrem654 remainder 0 1 -> 0 +ddrem655 remainder -0 1 -> -0 +ddrem656 remainder 0 -1 -> 0 +ddrem657 remainder -0 -1 -> -0 +ddrem658 remainder 0.00 1 -> 0.00 +ddrem659 remainder -0.00 1 -> -0.00 + +-- Specials +ddrem680 remainder Inf -Inf -> NaN Invalid_operation +ddrem681 remainder Inf -1000 -> NaN Invalid_operation +ddrem682 remainder Inf -1 -> NaN Invalid_operation +ddrem683 remainder Inf 0 -> NaN Invalid_operation +ddrem684 remainder Inf -0 -> NaN Invalid_operation +ddrem685 remainder Inf 1 -> NaN Invalid_operation +ddrem686 remainder Inf 1000 -> NaN Invalid_operation +ddrem687 remainder Inf Inf -> NaN Invalid_operation +ddrem688 remainder -1000 Inf -> -1000 +ddrem689 remainder -Inf Inf -> NaN Invalid_operation +ddrem691 remainder -1 Inf -> -1 +ddrem692 remainder 0 Inf -> 0 +ddrem693 remainder -0 Inf -> -0 +ddrem694 remainder 1 Inf -> 1 +ddrem695 remainder 1000 Inf -> 1000 +ddrem696 remainder Inf Inf -> NaN Invalid_operation + +ddrem700 remainder -Inf -Inf -> NaN Invalid_operation +ddrem701 remainder -Inf -1000 -> NaN Invalid_operation +ddrem702 remainder -Inf -1 -> NaN Invalid_operation +ddrem703 remainder -Inf -0 -> NaN Invalid_operation +ddrem704 remainder -Inf 0 -> NaN Invalid_operation +ddrem705 remainder -Inf 1 -> NaN Invalid_operation +ddrem706 remainder -Inf 1000 -> NaN Invalid_operation +ddrem707 remainder -Inf Inf -> NaN Invalid_operation +ddrem708 remainder -Inf -Inf -> NaN Invalid_operation +ddrem709 remainder -1000 Inf -> -1000 +ddrem710 remainder -1 -Inf -> -1 +ddrem711 remainder -0 -Inf -> -0 +ddrem712 remainder 0 -Inf -> 0 +ddrem713 remainder 1 -Inf -> 1 +ddrem714 remainder 1000 -Inf -> 1000 +ddrem715 remainder Inf -Inf -> NaN Invalid_operation + +ddrem721 remainder NaN -Inf -> NaN +ddrem722 remainder NaN -1000 -> NaN +ddrem723 remainder NaN -1 -> NaN +ddrem724 remainder NaN -0 -> NaN +ddrem725 remainder -NaN 0 -> -NaN +ddrem726 remainder NaN 1 -> NaN +ddrem727 remainder NaN 1000 -> NaN +ddrem728 remainder NaN Inf -> NaN +ddrem729 remainder NaN -NaN -> NaN +ddrem730 remainder -Inf NaN -> NaN +ddrem731 remainder -1000 NaN -> NaN +ddrem732 remainder -1 NaN -> NaN +ddrem733 remainder -0 -NaN -> -NaN +ddrem734 remainder 0 NaN -> NaN +ddrem735 remainder 1 -NaN -> -NaN +ddrem736 remainder 1000 NaN -> NaN +ddrem737 remainder Inf NaN -> NaN + +ddrem741 remainder sNaN -Inf -> NaN Invalid_operation +ddrem742 remainder sNaN -1000 -> NaN Invalid_operation +ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation +ddrem744 remainder sNaN -0 -> NaN Invalid_operation +ddrem745 remainder sNaN 0 -> NaN Invalid_operation +ddrem746 remainder sNaN 1 -> NaN Invalid_operation +ddrem747 remainder sNaN 1000 -> NaN Invalid_operation +ddrem749 remainder sNaN NaN -> NaN Invalid_operation +ddrem750 remainder sNaN sNaN -> NaN Invalid_operation +ddrem751 remainder NaN sNaN -> NaN Invalid_operation +ddrem752 remainder -Inf sNaN -> NaN Invalid_operation +ddrem753 remainder -1000 sNaN -> NaN Invalid_operation +ddrem754 remainder -1 sNaN -> NaN Invalid_operation +ddrem755 remainder -0 sNaN -> NaN Invalid_operation +ddrem756 remainder 0 sNaN -> NaN Invalid_operation +ddrem757 remainder 1 sNaN -> NaN Invalid_operation +ddrem758 remainder 1000 sNaN -> NaN Invalid_operation +ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation + +-- propaging NaNs +ddrem760 remainder NaN1 NaN7 -> NaN1 +ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation +ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation +ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation +ddrem764 remainder 15 NaN11 -> NaN11 +ddrem765 remainder NaN6 NaN12 -> NaN6 +ddrem766 remainder Inf NaN13 -> NaN13 +ddrem767 remainder NaN14 -Inf -> NaN14 +ddrem768 remainder 0 NaN15 -> NaN15 +ddrem769 remainder NaN16 -0 -> NaN16 + +-- edge cases of impossible +ddrem770 remainder 1234567890123456 10 -> 6 +ddrem771 remainder 1234567890123456 1 -> 0 +ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible +ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible + +-- long operand checks +ddrem801 remainder 12345678000 100 -> 0 +ddrem802 remainder 1 12345678000 -> 1 +ddrem803 remainder 1234567800 10 -> 0 +ddrem804 remainder 1 1234567800 -> 1 +ddrem805 remainder 1234567890 10 -> 0 +ddrem806 remainder 1 1234567890 -> 1 +ddrem807 remainder 1234567891 10 -> 1 +ddrem808 remainder 1 1234567891 -> 1 +ddrem809 remainder 12345678901 100 -> 1 +ddrem810 remainder 1 12345678901 -> 1 +ddrem811 remainder 1234567896 10 -> 6 +ddrem812 remainder 1 1234567896 -> 1 + +ddrem821 remainder 12345678000 100 -> 0 +ddrem822 remainder 1 12345678000 -> 1 +ddrem823 remainder 1234567800 10 -> 0 +ddrem824 remainder 1 1234567800 -> 1 +ddrem825 remainder 1234567890 10 -> 0 +ddrem826 remainder 1 1234567890 -> 1 +ddrem827 remainder 1234567891 10 -> 1 +ddrem828 remainder 1 1234567891 -> 1 +ddrem829 remainder 12345678901 100 -> 1 +ddrem830 remainder 1 12345678901 -> 1 +ddrem831 remainder 1234567896 10 -> 6 +ddrem832 remainder 1 1234567896 -> 1 + +-- from divideint +ddrem840 remainder 100000000.0 1 -> 0.0 +ddrem841 remainder 100000000.4 1 -> 0.4 +ddrem842 remainder 100000000.5 1 -> 0.5 +ddrem843 remainder 100000000.9 1 -> 0.9 +ddrem844 remainder 100000000.999 1 -> 0.999 +ddrem850 remainder 100000003 5 -> 3 +ddrem851 remainder 10000003 5 -> 3 +ddrem852 remainder 1000003 5 -> 3 +ddrem853 remainder 100003 5 -> 3 +ddrem854 remainder 10003 5 -> 3 +ddrem855 remainder 1003 5 -> 3 +ddrem856 remainder 103 5 -> 3 +ddrem857 remainder 13 5 -> 3 +ddrem858 remainder 1 5 -> 1 + +-- Vladimir's cases 1234567890123456 +ddrem860 remainder 123.0e1 1000000000000000 -> 1230 +ddrem861 remainder 1230 1000000000000000 -> 1230 +ddrem862 remainder 12.3e2 1000000000000000 -> 1230 +ddrem863 remainder 1.23e3 1000000000000000 -> 1230 +ddrem864 remainder 123e1 1000000000000000 -> 1230 +ddrem870 remainder 123e1 1000000000000000 -> 1230 +ddrem871 remainder 123e1 100000000000000 -> 1230 +ddrem872 remainder 123e1 10000000000000 -> 1230 +ddrem873 remainder 123e1 1000000000000 -> 1230 +ddrem874 remainder 123e1 100000000000 -> 1230 +ddrem875 remainder 123e1 10000000000 -> 1230 +ddrem876 remainder 123e1 1000000000 -> 1230 +ddrem877 remainder 123e1 100000000 -> 1230 +ddrem878 remainder 1230 100000000 -> 1230 +ddrem879 remainder 123e1 10000000 -> 1230 +ddrem880 remainder 123e1 1000000 -> 1230 +ddrem881 remainder 123e1 100000 -> 1230 +ddrem882 remainder 123e1 10000 -> 1230 +ddrem883 remainder 123e1 1000 -> 230 +ddrem884 remainder 123e1 100 -> 30 +ddrem885 remainder 123e1 10 -> 0 +ddrem886 remainder 123e1 1 -> 0 + +ddrem890 remainder 123e1 2000000000000000 -> 1230 +ddrem891 remainder 123e1 200000000000000 -> 1230 +ddrem892 remainder 123e1 20000000000000 -> 1230 +ddrem893 remainder 123e1 2000000000000 -> 1230 +ddrem894 remainder 123e1 200000000000 -> 1230 +ddrem895 remainder 123e1 20000000000 -> 1230 +ddrem896 remainder 123e1 2000000000 -> 1230 +ddrem897 remainder 123e1 200000000 -> 1230 +ddrem899 remainder 123e1 20000000 -> 1230 +ddrem900 remainder 123e1 2000000 -> 1230 +ddrem901 remainder 123e1 200000 -> 1230 +ddrem902 remainder 123e1 20000 -> 1230 +ddrem903 remainder 123e1 2000 -> 1230 +ddrem904 remainder 123e1 200 -> 30 +ddrem905 remainder 123e1 20 -> 10 +ddrem906 remainder 123e1 2 -> 0 + +ddrem910 remainder 123e1 5000000000000000 -> 1230 +ddrem911 remainder 123e1 500000000000000 -> 1230 +ddrem912 remainder 123e1 50000000000000 -> 1230 +ddrem913 remainder 123e1 5000000000000 -> 1230 +ddrem914 remainder 123e1 500000000000 -> 1230 +ddrem915 remainder 123e1 50000000000 -> 1230 +ddrem916 remainder 123e1 5000000000 -> 1230 +ddrem917 remainder 123e1 500000000 -> 1230 +ddrem919 remainder 123e1 50000000 -> 1230 +ddrem920 remainder 123e1 5000000 -> 1230 +ddrem921 remainder 123e1 500000 -> 1230 +ddrem922 remainder 123e1 50000 -> 1230 +ddrem923 remainder 123e1 5000 -> 1230 +ddrem924 remainder 123e1 500 -> 230 +ddrem925 remainder 123e1 50 -> 30 +ddrem926 remainder 123e1 5 -> 0 + +ddrem930 remainder 123e1 9000000000000000 -> 1230 +ddrem931 remainder 123e1 900000000000000 -> 1230 +ddrem932 remainder 123e1 90000000000000 -> 1230 +ddrem933 remainder 123e1 9000000000000 -> 1230 +ddrem934 remainder 123e1 900000000000 -> 1230 +ddrem935 remainder 123e1 90000000000 -> 1230 +ddrem936 remainder 123e1 9000000000 -> 1230 +ddrem937 remainder 123e1 900000000 -> 1230 +ddrem939 remainder 123e1 90000000 -> 1230 +ddrem940 remainder 123e1 9000000 -> 1230 +ddrem941 remainder 123e1 900000 -> 1230 +ddrem942 remainder 123e1 90000 -> 1230 +ddrem943 remainder 123e1 9000 -> 1230 +ddrem944 remainder 123e1 900 -> 330 +ddrem945 remainder 123e1 90 -> 60 +ddrem946 remainder 123e1 9 -> 6 + +ddrem950 remainder 123e1 1000000000000000 -> 1230 +ddrem961 remainder 123e1 2999999999999999 -> 1230 +ddrem962 remainder 123e1 3999999999999999 -> 1230 +ddrem963 remainder 123e1 4999999999999999 -> 1230 +ddrem964 remainder 123e1 5999999999999999 -> 1230 +ddrem965 remainder 123e1 6999999999999999 -> 1230 +ddrem966 remainder 123e1 7999999999999999 -> 1230 +ddrem967 remainder 123e1 8999999999999999 -> 1230 +ddrem968 remainder 123e1 9999999999999999 -> 1230 +ddrem969 remainder 123e1 9876543210987654 -> 1230 + +ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally + +-- overflow and underflow tests [from divide] +ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible +ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible +ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible +ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible +ddrem1055 remainder 1e-277 1e+311 -> 1E-277 +ddrem1056 remainder 1e-277 -1e+311 -> 1E-277 +ddrem1057 remainder -1e-277 1e+311 -> -1E-277 +ddrem1058 remainder -1e-277 -1e+311 -> -1E-277 + +-- destructive subtract +ddrem1101 remainder 1234567890123456 1.000000000000001 -> 0.765432109876546 +ddrem1102 remainder 1234567890123456 1.00000000000001 -> 0.65432109876557 +ddrem1103 remainder 1234567890123456 1.0000000000001 -> 0.5432109876668 +ddrem1104 remainder 1234567890123455 4.000000000000001 -> 2.691358027469137 +ddrem1105 remainder 1234567890123456 4.000000000000001 -> 3.691358027469137 +ddrem1106 remainder 1234567890123456 4.9999999999999 -> 0.6913578024696 +ddrem1107 remainder 1234567890123456 4.99999999999999 -> 3.46913578024691 +ddrem1108 remainder 1234567890123456 4.999999999999999 -> 1.246913578024691 +ddrem1109 remainder 1234567890123456 5.000000000000001 -> 0.753086421975309 +ddrem1110 remainder 1234567890123456 5.00000000000001 -> 3.53086421975310 +ddrem1111 remainder 1234567890123456 5.0000000000001 -> 1.3086421975314 + +-- Null tests +ddrem1000 remainder 10 # -> NaN Invalid_operation +ddrem1001 remainder # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRemainderNear.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRemainderNear.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,629 @@ +------------------------------------------------------------------------ +-- ddRemainderNear.decTest -- decDouble remainder-near -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- sanity checks (as base, above) +ddrmn001 remaindernear 1 1 -> 0 +ddrmn002 remaindernear 2 1 -> 0 +ddrmn003 remaindernear 1 2 -> 1 +ddrmn004 remaindernear 2 2 -> 0 +ddrmn005 remaindernear 0 1 -> 0 +ddrmn006 remaindernear 0 2 -> 0 +ddrmn007 remaindernear 1 3 -> 1 +ddrmn008 remaindernear 2 3 -> -1 +ddrmn009 remaindernear 3 3 -> 0 + +ddrmn010 remaindernear 2.4 1 -> 0.4 +ddrmn011 remaindernear 2.4 -1 -> 0.4 +ddrmn012 remaindernear -2.4 1 -> -0.4 +ddrmn013 remaindernear -2.4 -1 -> -0.4 +ddrmn014 remaindernear 2.40 1 -> 0.40 +ddrmn015 remaindernear 2.400 1 -> 0.400 +ddrmn016 remaindernear 2.4 2 -> 0.4 +ddrmn017 remaindernear 2.400 2 -> 0.400 +ddrmn018 remaindernear 2. 2 -> 0 +ddrmn019 remaindernear 20 20 -> 0 + +ddrmn020 remaindernear 187 187 -> 0 +ddrmn021 remaindernear 5 2 -> 1 +ddrmn022 remaindernear 5 2.0 -> 1.0 +ddrmn023 remaindernear 5 2.000 -> 1.000 +ddrmn024 remaindernear 5 0.200 -> 0.000 +ddrmn025 remaindernear 5 0.200 -> 0.000 + +ddrmn030 remaindernear 1 2 -> 1 +ddrmn031 remaindernear 1 4 -> 1 +ddrmn032 remaindernear 1 8 -> 1 + +ddrmn033 remaindernear 1 16 -> 1 +ddrmn034 remaindernear 1 32 -> 1 +ddrmn035 remaindernear 1 64 -> 1 +ddrmn040 remaindernear 1 -2 -> 1 +ddrmn041 remaindernear 1 -4 -> 1 +ddrmn042 remaindernear 1 -8 -> 1 +ddrmn043 remaindernear 1 -16 -> 1 +ddrmn044 remaindernear 1 -32 -> 1 +ddrmn045 remaindernear 1 -64 -> 1 +ddrmn050 remaindernear -1 2 -> -1 +ddrmn051 remaindernear -1 4 -> -1 +ddrmn052 remaindernear -1 8 -> -1 +ddrmn053 remaindernear -1 16 -> -1 +ddrmn054 remaindernear -1 32 -> -1 +ddrmn055 remaindernear -1 64 -> -1 +ddrmn060 remaindernear -1 -2 -> -1 +ddrmn061 remaindernear -1 -4 -> -1 +ddrmn062 remaindernear -1 -8 -> -1 +ddrmn063 remaindernear -1 -16 -> -1 +ddrmn064 remaindernear -1 -32 -> -1 +ddrmn065 remaindernear -1 -64 -> -1 + +ddrmn066 remaindernear 9.9 1 -> -0.1 +ddrmn067 remaindernear 99.7 1 -> -0.3 +ddrmn068 remaindernear 999999999 1 -> 0 +ddrmn069 remaindernear 999999999.4 1 -> 0.4 +ddrmn070 remaindernear 999999999.5 1 -> -0.5 +ddrmn071 remaindernear 999999999.9 1 -> -0.1 +ddrmn072 remaindernear 999999999.999 1 -> -0.001 +ddrmn073 remaindernear 999999.999999 1 -> -0.000001 +ddrmn074 remaindernear 9 1 -> 0 +ddrmn075 remaindernear 9999999999999999 1 -> 0 +ddrmn076 remaindernear 9999999999999999 2 -> -1 +ddrmn077 remaindernear 9999999999999999 3 -> 0 +ddrmn078 remaindernear 9999999999999999 4 -> -1 + +ddrmn080 remaindernear 0. 1 -> 0 +ddrmn081 remaindernear .0 1 -> 0.0 +ddrmn082 remaindernear 0.00 1 -> 0.00 +ddrmn083 remaindernear 0.00E+9 1 -> 0 +ddrmn084 remaindernear 0.00E+3 1 -> 0 +ddrmn085 remaindernear 0.00E+2 1 -> 0 +ddrmn086 remaindernear 0.00E+1 1 -> 0.0 +ddrmn087 remaindernear 0.00E+0 1 -> 0.00 +ddrmn088 remaindernear 0.00E-0 1 -> 0.00 +ddrmn089 remaindernear 0.00E-1 1 -> 0.000 +ddrmn090 remaindernear 0.00E-2 1 -> 0.0000 +ddrmn091 remaindernear 0.00E-3 1 -> 0.00000 +ddrmn092 remaindernear 0.00E-4 1 -> 0.000000 +ddrmn093 remaindernear 0.00E-5 1 -> 0E-7 +ddrmn094 remaindernear 0.00E-6 1 -> 0E-8 +ddrmn095 remaindernear 0.0000E-50 1 -> 0E-54 + +-- Various flavours of remaindernear by 0 +ddrmn101 remaindernear 0 0 -> NaN Division_undefined +ddrmn102 remaindernear 0 -0 -> NaN Division_undefined +ddrmn103 remaindernear -0 0 -> NaN Division_undefined +ddrmn104 remaindernear -0 -0 -> NaN Division_undefined +ddrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined +ddrmn106 remaindernear 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, but +-- IEEE 854 is explicit that it is Invalid operation .. for +-- remainder-near, anyway] +ddrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation +ddrmn108 remaindernear 0.01 0 -> NaN Invalid_operation +ddrmn109 remaindernear 0.1 0 -> NaN Invalid_operation +ddrmn110 remaindernear 1 0 -> NaN Invalid_operation +ddrmn111 remaindernear 1 0.0 -> NaN Invalid_operation +ddrmn112 remaindernear 10 0.0 -> NaN Invalid_operation +ddrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation +ddrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation +ddrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation +ddrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation +ddrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation +ddrmn120 remaindernear 1 -0 -> NaN Invalid_operation +ddrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation +ddrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation +ddrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation +ddrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation +-- and zeros on left +ddrmn130 remaindernear 0 1 -> 0 +ddrmn131 remaindernear 0 -1 -> 0 +ddrmn132 remaindernear 0.0 1 -> 0.0 +ddrmn133 remaindernear 0.0 -1 -> 0.0 +ddrmn134 remaindernear -0 1 -> -0 +ddrmn135 remaindernear -0 -1 -> -0 +ddrmn136 remaindernear -0.0 1 -> -0.0 +ddrmn137 remaindernear -0.0 -1 -> -0.0 + +-- 0.5ers +ddrmn143 remaindernear 0.5 2 -> 0.5 +ddrmn144 remaindernear 0.5 2.1 -> 0.5 +ddrmn145 remaindernear 0.5 2.01 -> 0.50 +ddrmn146 remaindernear 0.5 2.001 -> 0.500 +ddrmn147 remaindernear 0.50 2 -> 0.50 +ddrmn148 remaindernear 0.50 2.01 -> 0.50 +ddrmn149 remaindernear 0.50 2.001 -> 0.500 + +-- steadies +ddrmn150 remaindernear 1 1 -> 0 +ddrmn151 remaindernear 1 2 -> 1 +ddrmn152 remaindernear 1 3 -> 1 +ddrmn153 remaindernear 1 4 -> 1 +ddrmn154 remaindernear 1 5 -> 1 +ddrmn155 remaindernear 1 6 -> 1 +ddrmn156 remaindernear 1 7 -> 1 +ddrmn157 remaindernear 1 8 -> 1 +ddrmn158 remaindernear 1 9 -> 1 +ddrmn159 remaindernear 1 10 -> 1 +ddrmn160 remaindernear 1 1 -> 0 +ddrmn161 remaindernear 2 1 -> 0 +ddrmn162 remaindernear 3 1 -> 0 +ddrmn163 remaindernear 4 1 -> 0 +ddrmn164 remaindernear 5 1 -> 0 +ddrmn165 remaindernear 6 1 -> 0 +ddrmn166 remaindernear 7 1 -> 0 +ddrmn167 remaindernear 8 1 -> 0 +ddrmn168 remaindernear 9 1 -> 0 +ddrmn169 remaindernear 10 1 -> 0 + +-- some differences from remainder +ddrmn171 remaindernear 0.4 1.020 -> 0.400 +ddrmn172 remaindernear 0.50 1.020 -> 0.500 +ddrmn173 remaindernear 0.51 1.020 -> 0.510 +ddrmn174 remaindernear 0.52 1.020 -> -0.500 +ddrmn175 remaindernear 0.6 1.020 -> -0.420 + +-- More flavours of remaindernear by 0 +ddrmn201 remaindernear 0 0 -> NaN Division_undefined +ddrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined +ddrmn203 remaindernear 0.000 0 -> NaN Division_undefined +ddrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation +ddrmn205 remaindernear 0.01 0 -> NaN Invalid_operation +ddrmn206 remaindernear 0.1 0 -> NaN Invalid_operation +ddrmn207 remaindernear 1 0 -> NaN Invalid_operation +ddrmn208 remaindernear 1 0.0 -> NaN Invalid_operation +ddrmn209 remaindernear 10 0.0 -> NaN Invalid_operation +ddrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation +ddrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation + +-- tests from the extended specification +ddrmn221 remaindernear 2.1 3 -> -0.9 +ddrmn222 remaindernear 10 6 -> -2 +ddrmn223 remaindernear 10 3 -> 1 +ddrmn224 remaindernear -10 3 -> -1 +ddrmn225 remaindernear 10.2 1 -> 0.2 +ddrmn226 remaindernear 10 0.3 -> 0.1 +ddrmn227 remaindernear 3.6 1.3 -> -0.3 + +-- some differences from remainder +ddrmn231 remaindernear -0.4 1.020 -> -0.400 +ddrmn232 remaindernear -0.50 1.020 -> -0.500 +ddrmn233 remaindernear -0.51 1.020 -> -0.510 +ddrmn234 remaindernear -0.52 1.020 -> 0.500 +ddrmn235 remaindernear -0.6 1.020 -> 0.420 + +-- high Xs +ddrmn240 remaindernear 1E+2 1.00 -> 0.00 + +-- ddrmn3xx are from DiagBigDecimal +ddrmn301 remaindernear 1 3 -> 1 +ddrmn302 remaindernear 5 5 -> 0 +ddrmn303 remaindernear 13 10 -> 3 +ddrmn304 remaindernear 13 50 -> 13 +ddrmn305 remaindernear 13 100 -> 13 +ddrmn306 remaindernear 13 1000 -> 13 +ddrmn307 remaindernear .13 1 -> 0.13 +ddrmn308 remaindernear 0.133 1 -> 0.133 +ddrmn309 remaindernear 0.1033 1 -> 0.1033 +ddrmn310 remaindernear 1.033 1 -> 0.033 +ddrmn311 remaindernear 10.33 1 -> 0.33 +ddrmn312 remaindernear 10.33 10 -> 0.33 +ddrmn313 remaindernear 103.3 1 -> 0.3 +ddrmn314 remaindernear 133 10 -> 3 +ddrmn315 remaindernear 1033 10 -> 3 +ddrmn316 remaindernear 1033 50 -> -17 +ddrmn317 remaindernear 101.0 3 -> -1.0 +ddrmn318 remaindernear 102.0 3 -> 0.0 +ddrmn319 remaindernear 103.0 3 -> 1.0 +ddrmn320 remaindernear 2.40 1 -> 0.40 +ddrmn321 remaindernear 2.400 1 -> 0.400 +ddrmn322 remaindernear 2.4 1 -> 0.4 +ddrmn323 remaindernear 2.4 2 -> 0.4 +ddrmn324 remaindernear 2.400 2 -> 0.400 +ddrmn325 remaindernear 1 0.3 -> 0.1 +ddrmn326 remaindernear 1 0.30 -> 0.10 +ddrmn327 remaindernear 1 0.300 -> 0.100 +ddrmn328 remaindernear 1 0.3000 -> 0.1000 +ddrmn329 remaindernear 1.0 0.3 -> 0.1 +ddrmn330 remaindernear 1.00 0.3 -> 0.10 +ddrmn331 remaindernear 1.000 0.3 -> 0.100 +ddrmn332 remaindernear 1.0000 0.3 -> 0.1000 +ddrmn333 remaindernear 0.5 2 -> 0.5 +ddrmn334 remaindernear 0.5 2.1 -> 0.5 +ddrmn335 remaindernear 0.5 2.01 -> 0.50 +ddrmn336 remaindernear 0.5 2.001 -> 0.500 +ddrmn337 remaindernear 0.50 2 -> 0.50 +ddrmn338 remaindernear 0.50 2.01 -> 0.50 +ddrmn339 remaindernear 0.50 2.001 -> 0.500 + +ddrmn340 remaindernear 0.5 0.5000001 -> -1E-7 +ddrmn341 remaindernear 0.5 0.50000001 -> -1E-8 +ddrmn342 remaindernear 0.5 0.500000001 -> -1E-9 +ddrmn343 remaindernear 0.5 0.5000000001 -> -1E-10 +ddrmn344 remaindernear 0.5 0.50000000001 -> -1E-11 +ddrmn345 remaindernear 0.5 0.4999999 -> 1E-7 +ddrmn346 remaindernear 0.5 0.49999999 -> 1E-8 +ddrmn347 remaindernear 0.5 0.499999999 -> 1E-9 +ddrmn348 remaindernear 0.5 0.4999999999 -> 1E-10 +ddrmn349 remaindernear 0.5 0.49999999999 -> 1E-11 +ddrmn350 remaindernear 0.5 0.499999999999 -> 1E-12 + +ddrmn351 remaindernear 0.03 7 -> 0.03 +ddrmn352 remaindernear 5 2 -> 1 +ddrmn353 remaindernear 4.1 2 -> 0.1 +ddrmn354 remaindernear 4.01 2 -> 0.01 +ddrmn355 remaindernear 4.001 2 -> 0.001 +ddrmn356 remaindernear 4.0001 2 -> 0.0001 +ddrmn357 remaindernear 4.00001 2 -> 0.00001 +ddrmn358 remaindernear 4.000001 2 -> 0.000001 +ddrmn359 remaindernear 4.0000001 2 -> 1E-7 + +ddrmn360 remaindernear 1.2 0.7345 -> -0.2690 +ddrmn361 remaindernear 0.8 12 -> 0.8 +ddrmn362 remaindernear 0.8 0.2 -> 0.0 +ddrmn363 remaindernear 0.8 0.3 -> -0.1 +ddrmn364 remaindernear 0.800 12 -> 0.800 +ddrmn365 remaindernear 0.800 1.7 -> 0.800 +ddrmn366 remaindernear 2.400 2 -> 0.400 + +-- round to even +ddrmn371 remaindernear 121 2 -> 1 +ddrmn372 remaindernear 122 2 -> 0 +ddrmn373 remaindernear 123 2 -> -1 +ddrmn374 remaindernear 124 2 -> 0 +ddrmn375 remaindernear 125 2 -> 1 +ddrmn376 remaindernear 126 2 -> 0 +ddrmn377 remaindernear 127 2 -> -1 + +ddrmn381 remaindernear 12345 1 -> 0 +ddrmn382 remaindernear 12345 1.0001 -> -0.2344 +ddrmn383 remaindernear 12345 1.001 -> -0.333 +ddrmn384 remaindernear 12345 1.01 -> -0.23 +ddrmn385 remaindernear 12345 1.1 -> -0.3 +ddrmn386 remaindernear 12355 4 -> -1 +ddrmn387 remaindernear 12345 4 -> 1 +ddrmn388 remaindernear 12355 4.0001 -> -1.3089 +ddrmn389 remaindernear 12345 4.0001 -> 0.6914 +ddrmn390 remaindernear 12345 4.9 -> 1.9 +ddrmn391 remaindernear 12345 4.99 -> -0.26 +ddrmn392 remaindernear 12345 4.999 -> 2.469 +ddrmn393 remaindernear 12345 4.9999 -> 0.2469 +ddrmn394 remaindernear 12345 5 -> 0 +ddrmn395 remaindernear 12345 5.0001 -> -0.2469 +ddrmn396 remaindernear 12345 5.001 -> -2.469 +ddrmn397 remaindernear 12345 5.01 -> 0.36 +ddrmn398 remaindernear 12345 5.1 -> -2.1 + +-- the nasty division-by-1 cases +ddrmn401 remaindernear 0.4 1 -> 0.4 +ddrmn402 remaindernear 0.45 1 -> 0.45 +ddrmn403 remaindernear 0.455 1 -> 0.455 +ddrmn404 remaindernear 0.4555 1 -> 0.4555 +ddrmn405 remaindernear 0.45555 1 -> 0.45555 +ddrmn406 remaindernear 0.455555 1 -> 0.455555 +ddrmn407 remaindernear 0.4555555 1 -> 0.4555555 +ddrmn408 remaindernear 0.45555555 1 -> 0.45555555 +ddrmn409 remaindernear 0.455555555 1 -> 0.455555555 +-- with spill... [412 exercises sticktab loop] +ddrmn411 remaindernear 0.5 1 -> 0.5 +ddrmn412 remaindernear 0.55 1 -> -0.45 +ddrmn413 remaindernear 0.555 1 -> -0.445 +ddrmn414 remaindernear 0.5555 1 -> -0.4445 +ddrmn415 remaindernear 0.55555 1 -> -0.44445 +ddrmn416 remaindernear 0.555555 1 -> -0.444445 +ddrmn417 remaindernear 0.5555555 1 -> -0.4444445 +ddrmn418 remaindernear 0.55555555 1 -> -0.44444445 +ddrmn419 remaindernear 0.555555555 1 -> -0.444444445 + +-- folddowns +ddrmn421 remaindernear 1E+384 1 -> NaN Division_impossible +ddrmn422 remaindernear 1E+384 1E+383 -> 0E+369 Clamped +ddrmn423 remaindernear 1E+384 2E+383 -> 0E+369 Clamped +ddrmn424 remaindernear 1E+384 3E+383 -> 1.00000000000000E+383 Clamped +ddrmn425 remaindernear 1E+384 4E+383 -> 2.00000000000000E+383 Clamped +ddrmn426 remaindernear 1E+384 5E+383 -> 0E+369 Clamped +ddrmn427 remaindernear 1E+384 6E+383 -> -2.00000000000000E+383 Clamped +ddrmn428 remaindernear 1E+384 7E+383 -> 3.00000000000000E+383 Clamped +ddrmn429 remaindernear 1E+384 8E+383 -> 2.00000000000000E+383 Clamped +ddrmn430 remaindernear 1E+384 9E+383 -> 1.00000000000000E+383 Clamped +-- tinies +ddrmn431 remaindernear 1E-397 1E-398 -> 0E-398 +ddrmn432 remaindernear 1E-397 2E-398 -> 0E-398 +ddrmn433 remaindernear 1E-397 3E-398 -> 1E-398 Subnormal +ddrmn434 remaindernear 1E-397 4E-398 -> 2E-398 Subnormal +ddrmn435 remaindernear 1E-397 5E-398 -> 0E-398 +ddrmn436 remaindernear 1E-397 6E-398 -> -2E-398 Subnormal +ddrmn437 remaindernear 1E-397 7E-398 -> 3E-398 Subnormal +ddrmn438 remaindernear 1E-397 8E-398 -> 2E-398 Subnormal +ddrmn439 remaindernear 1E-397 9E-398 -> 1E-398 Subnormal +ddrmn440 remaindernear 1E-397 10E-398 -> 0E-398 +ddrmn441 remaindernear 1E-397 11E-398 -> -1E-398 Subnormal +ddrmn442 remaindernear 100E-397 11E-398 -> -1E-398 Subnormal +ddrmn443 remaindernear 100E-397 20E-398 -> 0E-398 +ddrmn444 remaindernear 100E-397 21E-398 -> -8E-398 Subnormal +ddrmn445 remaindernear 100E-397 30E-398 -> 1.0E-397 Subnormal + +-- zero signs +ddrmn650 remaindernear 1 1 -> 0 +ddrmn651 remaindernear -1 1 -> -0 +ddrmn652 remaindernear 1 -1 -> 0 +ddrmn653 remaindernear -1 -1 -> -0 +ddrmn654 remaindernear 0 1 -> 0 +ddrmn655 remaindernear -0 1 -> -0 +ddrmn656 remaindernear 0 -1 -> 0 +ddrmn657 remaindernear -0 -1 -> -0 +ddrmn658 remaindernear 0.00 1 -> 0.00 +ddrmn659 remaindernear -0.00 1 -> -0.00 + +-- Specials +ddrmn680 remaindernear Inf -Inf -> NaN Invalid_operation +ddrmn681 remaindernear Inf -1000 -> NaN Invalid_operation +ddrmn682 remaindernear Inf -1 -> NaN Invalid_operation +ddrmn683 remaindernear Inf 0 -> NaN Invalid_operation +ddrmn684 remaindernear Inf -0 -> NaN Invalid_operation +ddrmn685 remaindernear Inf 1 -> NaN Invalid_operation +ddrmn686 remaindernear Inf 1000 -> NaN Invalid_operation +ddrmn687 remaindernear Inf Inf -> NaN Invalid_operation +ddrmn688 remaindernear -1000 Inf -> -1000 +ddrmn689 remaindernear -Inf Inf -> NaN Invalid_operation +ddrmn691 remaindernear -1 Inf -> -1 +ddrmn692 remaindernear 0 Inf -> 0 +ddrmn693 remaindernear -0 Inf -> -0 +ddrmn694 remaindernear 1 Inf -> 1 +ddrmn695 remaindernear 1000 Inf -> 1000 +ddrmn696 remaindernear Inf Inf -> NaN Invalid_operation + +ddrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation +ddrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation +ddrmn702 remaindernear -Inf -1 -> NaN Invalid_operation +ddrmn703 remaindernear -Inf -0 -> NaN Invalid_operation +ddrmn704 remaindernear -Inf 0 -> NaN Invalid_operation +ddrmn705 remaindernear -Inf 1 -> NaN Invalid_operation +ddrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation +ddrmn707 remaindernear -Inf Inf -> NaN Invalid_operation +ddrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation +ddrmn709 remaindernear -1000 Inf -> -1000 +ddrmn710 remaindernear -1 -Inf -> -1 +ddrmn711 remaindernear -0 -Inf -> -0 +ddrmn712 remaindernear 0 -Inf -> 0 +ddrmn713 remaindernear 1 -Inf -> 1 +ddrmn714 remaindernear 1000 -Inf -> 1000 +ddrmn715 remaindernear Inf -Inf -> NaN Invalid_operation + +ddrmn721 remaindernear NaN -Inf -> NaN +ddrmn722 remaindernear NaN -1000 -> NaN +ddrmn723 remaindernear NaN -1 -> NaN +ddrmn724 remaindernear NaN -0 -> NaN +ddrmn725 remaindernear -NaN 0 -> -NaN +ddrmn726 remaindernear NaN 1 -> NaN +ddrmn727 remaindernear NaN 1000 -> NaN +ddrmn728 remaindernear NaN Inf -> NaN +ddrmn729 remaindernear NaN -NaN -> NaN +ddrmn730 remaindernear -Inf NaN -> NaN +ddrmn731 remaindernear -1000 NaN -> NaN +ddrmn732 remaindernear -1 NaN -> NaN +ddrmn733 remaindernear -0 -NaN -> -NaN +ddrmn734 remaindernear 0 NaN -> NaN +ddrmn735 remaindernear 1 -NaN -> -NaN +ddrmn736 remaindernear 1000 NaN -> NaN +ddrmn737 remaindernear Inf NaN -> NaN + +ddrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation +ddrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation +ddrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation +ddrmn744 remaindernear sNaN -0 -> NaN Invalid_operation +ddrmn745 remaindernear sNaN 0 -> NaN Invalid_operation +ddrmn746 remaindernear sNaN 1 -> NaN Invalid_operation +ddrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation +ddrmn749 remaindernear sNaN NaN -> NaN Invalid_operation +ddrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation +ddrmn751 remaindernear NaN sNaN -> NaN Invalid_operation +ddrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation +ddrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation +ddrmn754 remaindernear -1 sNaN -> NaN Invalid_operation +ddrmn755 remaindernear -0 sNaN -> NaN Invalid_operation +ddrmn756 remaindernear 0 sNaN -> NaN Invalid_operation +ddrmn757 remaindernear 1 sNaN -> NaN Invalid_operation +ddrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation +ddrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation + +-- propaging NaNs +ddrmn760 remaindernear NaN1 NaN7 -> NaN1 +ddrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation +ddrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation +ddrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation +ddrmn764 remaindernear 15 NaN11 -> NaN11 +ddrmn765 remaindernear NaN6 NaN12 -> NaN6 +ddrmn766 remaindernear Inf NaN13 -> NaN13 +ddrmn767 remaindernear NaN14 -Inf -> NaN14 +ddrmn768 remaindernear 0 NaN15 -> NaN15 +ddrmn769 remaindernear NaN16 -0 -> NaN16 + +-- edge cases of impossible +ddrmn770 remaindernear 1234567890123456 10 -> -4 +ddrmn771 remaindernear 1234567890123456 1 -> 0 +ddrmn772 remaindernear 1234567890123456 0.1 -> NaN Division_impossible +ddrmn773 remaindernear 1234567890123456 0.01 -> NaN Division_impossible + +-- long operand checks +ddrmn801 remaindernear 12345678000 100 -> 0 +ddrmn802 remaindernear 1 12345678000 -> 1 +ddrmn803 remaindernear 1234567800 10 -> 0 +ddrmn804 remaindernear 1 1234567800 -> 1 +ddrmn805 remaindernear 1234567890 10 -> 0 +ddrmn806 remaindernear 1 1234567890 -> 1 +ddrmn807 remaindernear 1234567891 10 -> 1 +ddrmn808 remaindernear 1 1234567891 -> 1 +ddrmn809 remaindernear 12345678901 100 -> 1 +ddrmn810 remaindernear 1 12345678901 -> 1 +ddrmn811 remaindernear 1234567896 10 -> -4 +ddrmn812 remaindernear 1 1234567896 -> 1 + +ddrmn821 remaindernear 12345678000 100 -> 0 +ddrmn822 remaindernear 1 12345678000 -> 1 +ddrmn823 remaindernear 1234567800 10 -> 0 +ddrmn824 remaindernear 1 1234567800 -> 1 +ddrmn825 remaindernear 1234567890 10 -> 0 +ddrmn826 remaindernear 1 1234567890 -> 1 +ddrmn827 remaindernear 1234567891 10 -> 1 +ddrmn828 remaindernear 1 1234567891 -> 1 +ddrmn829 remaindernear 12345678901 100 -> 1 +ddrmn830 remaindernear 1 12345678901 -> 1 +ddrmn831 remaindernear 1234567896 10 -> -4 +ddrmn832 remaindernear 1 1234567896 -> 1 + +-- from divideint +ddrmn840 remaindernear 100000000.0 1 -> 0.0 +ddrmn841 remaindernear 100000000.4 1 -> 0.4 +ddrmn842 remaindernear 100000000.5 1 -> 0.5 +ddrmn843 remaindernear 100000000.9 1 -> -0.1 +ddrmn844 remaindernear 100000000.999 1 -> -0.001 +ddrmn850 remaindernear 100000003 5 -> -2 +ddrmn851 remaindernear 10000003 5 -> -2 +ddrmn852 remaindernear 1000003 5 -> -2 +ddrmn853 remaindernear 100003 5 -> -2 +ddrmn854 remaindernear 10003 5 -> -2 +ddrmn855 remaindernear 1003 5 -> -2 +ddrmn856 remaindernear 103 5 -> -2 +ddrmn857 remaindernear 13 5 -> -2 +ddrmn858 remaindernear 1 5 -> 1 + +-- Vladimir's cases 1234567890123456 +ddrmn860 remaindernear 123.0e1 1000000000000000 -> 1230 +ddrmn861 remaindernear 1230 1000000000000000 -> 1230 +ddrmn862 remaindernear 12.3e2 1000000000000000 -> 1230 +ddrmn863 remaindernear 1.23e3 1000000000000000 -> 1230 +ddrmn864 remaindernear 123e1 1000000000000000 -> 1230 +ddrmn870 remaindernear 123e1 1000000000000000 -> 1230 +ddrmn871 remaindernear 123e1 100000000000000 -> 1230 +ddrmn872 remaindernear 123e1 10000000000000 -> 1230 +ddrmn873 remaindernear 123e1 1000000000000 -> 1230 +ddrmn874 remaindernear 123e1 100000000000 -> 1230 +ddrmn875 remaindernear 123e1 10000000000 -> 1230 +ddrmn876 remaindernear 123e1 1000000000 -> 1230 +ddrmn877 remaindernear 123e1 100000000 -> 1230 +ddrmn878 remaindernear 1230 100000000 -> 1230 +ddrmn879 remaindernear 123e1 10000000 -> 1230 +ddrmn880 remaindernear 123e1 1000000 -> 1230 +ddrmn881 remaindernear 123e1 100000 -> 1230 +ddrmn882 remaindernear 123e1 10000 -> 1230 +ddrmn883 remaindernear 123e1 1000 -> 230 +ddrmn884 remaindernear 123e1 100 -> 30 +ddrmn885 remaindernear 123e1 10 -> 0 +ddrmn886 remaindernear 123e1 1 -> 0 + +ddrmn890 remaindernear 123e1 2000000000000000 -> 1230 +ddrmn891 remaindernear 123e1 200000000000000 -> 1230 +ddrmn892 remaindernear 123e1 20000000000000 -> 1230 +ddrmn893 remaindernear 123e1 2000000000000 -> 1230 +ddrmn894 remaindernear 123e1 200000000000 -> 1230 +ddrmn895 remaindernear 123e1 20000000000 -> 1230 +ddrmn896 remaindernear 123e1 2000000000 -> 1230 +ddrmn897 remaindernear 123e1 200000000 -> 1230 +ddrmn899 remaindernear 123e1 20000000 -> 1230 +ddrmn900 remaindernear 123e1 2000000 -> 1230 +ddrmn901 remaindernear 123e1 200000 -> 1230 +ddrmn902 remaindernear 123e1 20000 -> 1230 +ddrmn903 remaindernear 123e1 2000 -> -770 +ddrmn904 remaindernear 123e1 200 -> 30 +ddrmn905 remaindernear 123e1 20 -> -10 +ddrmn906 remaindernear 123e1 2 -> 0 + +ddrmn910 remaindernear 123e1 5000000000000000 -> 1230 +ddrmn911 remaindernear 123e1 500000000000000 -> 1230 +ddrmn912 remaindernear 123e1 50000000000000 -> 1230 +ddrmn913 remaindernear 123e1 5000000000000 -> 1230 +ddrmn914 remaindernear 123e1 500000000000 -> 1230 +ddrmn915 remaindernear 123e1 50000000000 -> 1230 +ddrmn916 remaindernear 123e1 5000000000 -> 1230 +ddrmn917 remaindernear 123e1 500000000 -> 1230 +ddrmn919 remaindernear 123e1 50000000 -> 1230 +ddrmn920 remaindernear 123e1 5000000 -> 1230 +ddrmn921 remaindernear 123e1 500000 -> 1230 +ddrmn922 remaindernear 123e1 50000 -> 1230 +ddrmn923 remaindernear 123e1 5000 -> 1230 +ddrmn924 remaindernear 123e1 500 -> 230 +ddrmn925 remaindernear 123e1 50 -> -20 +ddrmn926 remaindernear 123e1 5 -> 0 + +ddrmn930 remaindernear 123e1 9000000000000000 -> 1230 +ddrmn931 remaindernear 123e1 900000000000000 -> 1230 +ddrmn932 remaindernear 123e1 90000000000000 -> 1230 +ddrmn933 remaindernear 123e1 9000000000000 -> 1230 +ddrmn934 remaindernear 123e1 900000000000 -> 1230 +ddrmn935 remaindernear 123e1 90000000000 -> 1230 +ddrmn936 remaindernear 123e1 9000000000 -> 1230 +ddrmn937 remaindernear 123e1 900000000 -> 1230 +ddrmn939 remaindernear 123e1 90000000 -> 1230 +ddrmn940 remaindernear 123e1 9000000 -> 1230 +ddrmn941 remaindernear 123e1 900000 -> 1230 +ddrmn942 remaindernear 123e1 90000 -> 1230 +ddrmn943 remaindernear 123e1 9000 -> 1230 +ddrmn944 remaindernear 123e1 900 -> 330 +ddrmn945 remaindernear 123e1 90 -> -30 +ddrmn946 remaindernear 123e1 9 -> -3 + +ddrmn950 remaindernear 123e1 1000000000000000 -> 1230 +ddrmn961 remaindernear 123e1 2999999999999999 -> 1230 +ddrmn962 remaindernear 123e1 3999999999999999 -> 1230 +ddrmn963 remaindernear 123e1 4999999999999999 -> 1230 +ddrmn964 remaindernear 123e1 5999999999999999 -> 1230 +ddrmn965 remaindernear 123e1 6999999999999999 -> 1230 +ddrmn966 remaindernear 123e1 7999999999999999 -> 1230 +ddrmn967 remaindernear 123e1 8999999999999999 -> 1230 +ddrmn968 remaindernear 123e1 9999999999999999 -> 1230 +ddrmn969 remaindernear 123e1 9876543210987654 -> 1230 + +ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally + + +-- overflow and underflow tests [from divide] +ddrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible +ddrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible +ddrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible +ddrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible +ddrmn1055 remaindernear 1e-277 1e+311 -> 1E-277 +ddrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277 +ddrmn1057 remaindernear -1e-277 1e+311 -> -1E-277 +ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277 + +-- destructive subtract +ddrmn1100 remainderNear 1234567890123456 1.000000000000001 -> -0.234567890123455 +ddrmn1101 remainderNear 1234567890123456 1.00000000000001 -> -0.34567890123444 +ddrmn1102 remainderNear 1234567890123456 1.0000000000001 -> -0.4567890123333 +ddrmn1103 remainderNear 1234567890123455 4.000000000000001 -> -1.308641972530864 +ddrmn1104 remainderNear 1234567890123456 4.000000000000001 -> -0.308641972530864 +ddrmn1115 remainderNear 1234567890123456 4.9999999999999 -> 0.6913578024696 +ddrmn1116 remainderNear 1234567890123456 4.99999999999999 -> -1.53086421975308 +ddrmn1117 remainderNear 1234567890123456 4.999999999999999 -> 1.246913578024691 +ddrmn1118 remainderNear 1234567890123456 5.000000000000001 -> 0.753086421975309 +ddrmn1119 remainderNear 1234567890123456 5.00000000000001 -> -1.46913578024691 +ddrmn1110 remainderNear 1234567890123456 5.0000000000001 -> 1.3086421975314 + +-- Null tests +ddrmn1000 remaindernear 10 # -> NaN Invalid_operation +ddrmn1001 remaindernear # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRotate.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddRotate.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,262 @@ +------------------------------------------------------------------------ +-- ddRotate.decTest -- rotate a decDouble coefficient left or right -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddrot001 rotate 0 0 -> 0 +ddrot002 rotate 0 2 -> 0 +ddrot003 rotate 1 2 -> 100 +ddrot004 rotate 1 15 -> 1000000000000000 +ddrot005 rotate 1 16 -> 1 +ddrot006 rotate 1 -1 -> 1000000000000000 +ddrot007 rotate 0 -2 -> 0 +ddrot008 rotate 1234567890123456 -1 -> 6123456789012345 +ddrot009 rotate 1234567890123456 -15 -> 2345678901234561 +ddrot010 rotate 1234567890123456 -16 -> 1234567890123456 +ddrot011 rotate 9934567890123456 -15 -> 9345678901234569 +ddrot012 rotate 9934567890123456 -16 -> 9934567890123456 + +-- rhs must be an integer +ddrot015 rotate 1 1.5 -> NaN Invalid_operation +ddrot016 rotate 1 1.0 -> NaN Invalid_operation +ddrot017 rotate 1 0.1 -> NaN Invalid_operation +ddrot018 rotate 1 0.0 -> NaN Invalid_operation +ddrot019 rotate 1 1E+1 -> NaN Invalid_operation +ddrot020 rotate 1 1E+99 -> NaN Invalid_operation +ddrot021 rotate 1 Inf -> NaN Invalid_operation +ddrot022 rotate 1 -Inf -> NaN Invalid_operation +-- and |rhs| <= precision +ddrot025 rotate 1 -1000 -> NaN Invalid_operation +ddrot026 rotate 1 -17 -> NaN Invalid_operation +ddrot027 rotate 1 17 -> NaN Invalid_operation +ddrot028 rotate 1 1000 -> NaN Invalid_operation + +-- full pattern +ddrot030 rotate 1234567890123456 -16 -> 1234567890123456 +ddrot031 rotate 1234567890123456 -15 -> 2345678901234561 +ddrot032 rotate 1234567890123456 -14 -> 3456789012345612 +ddrot033 rotate 1234567890123456 -13 -> 4567890123456123 +ddrot034 rotate 1234567890123456 -12 -> 5678901234561234 +ddrot035 rotate 1234567890123456 -11 -> 6789012345612345 +ddrot036 rotate 1234567890123456 -10 -> 7890123456123456 +ddrot037 rotate 1234567890123456 -9 -> 8901234561234567 +ddrot038 rotate 1234567890123456 -8 -> 9012345612345678 +ddrot039 rotate 1234567890123456 -7 -> 123456123456789 +ddrot040 rotate 1234567890123456 -6 -> 1234561234567890 +ddrot041 rotate 1234567890123456 -5 -> 2345612345678901 +ddrot042 rotate 1234567890123456 -4 -> 3456123456789012 +ddrot043 rotate 1234567890123456 -3 -> 4561234567890123 +ddrot044 rotate 1234567890123456 -2 -> 5612345678901234 +ddrot045 rotate 1234567890123456 -1 -> 6123456789012345 +ddrot046 rotate 1234567890123456 -0 -> 1234567890123456 + +ddrot047 rotate 1234567890123456 +0 -> 1234567890123456 +ddrot048 rotate 1234567890123456 +1 -> 2345678901234561 +ddrot049 rotate 1234567890123456 +2 -> 3456789012345612 +ddrot050 rotate 1234567890123456 +3 -> 4567890123456123 +ddrot051 rotate 1234567890123456 +4 -> 5678901234561234 +ddrot052 rotate 1234567890123456 +5 -> 6789012345612345 +ddrot053 rotate 1234567890123456 +6 -> 7890123456123456 +ddrot054 rotate 1234567890123456 +7 -> 8901234561234567 +ddrot055 rotate 1234567890123456 +8 -> 9012345612345678 +ddrot056 rotate 1234567890123456 +9 -> 123456123456789 +ddrot057 rotate 1234567890123456 +10 -> 1234561234567890 +ddrot058 rotate 1234567890123456 +11 -> 2345612345678901 +ddrot059 rotate 1234567890123456 +12 -> 3456123456789012 +ddrot060 rotate 1234567890123456 +13 -> 4561234567890123 +ddrot061 rotate 1234567890123456 +14 -> 5612345678901234 +ddrot062 rotate 1234567890123456 +15 -> 6123456789012345 +ddrot063 rotate 1234567890123456 +16 -> 1234567890123456 + +-- zeros +ddrot070 rotate 0E-10 +9 -> 0E-10 +ddrot071 rotate 0E-10 -9 -> 0E-10 +ddrot072 rotate 0.000 +9 -> 0.000 +ddrot073 rotate 0.000 -9 -> 0.000 +ddrot074 rotate 0E+10 +9 -> 0E+10 +ddrot075 rotate 0E+10 -9 -> 0E+10 +ddrot076 rotate -0E-10 +9 -> -0E-10 +ddrot077 rotate -0E-10 -9 -> -0E-10 +ddrot078 rotate -0.000 +9 -> -0.000 +ddrot079 rotate -0.000 -9 -> -0.000 +ddrot080 rotate -0E+10 +9 -> -0E+10 +ddrot081 rotate -0E+10 -9 -> -0E+10 + +-- Nmax, Nmin, Ntiny +ddrot141 rotate 9.999999999999999E+384 -1 -> 9.999999999999999E+384 +ddrot142 rotate 9.999999999999999E+384 -15 -> 9.999999999999999E+384 +ddrot143 rotate 9.999999999999999E+384 1 -> 9.999999999999999E+384 +ddrot144 rotate 9.999999999999999E+384 15 -> 9.999999999999999E+384 +ddrot145 rotate 1E-383 -1 -> 1.000000000000000E-368 +ddrot146 rotate 1E-383 -15 -> 1.0E-382 +ddrot147 rotate 1E-383 1 -> 1.0E-382 +ddrot148 rotate 1E-383 15 -> 1.000000000000000E-368 +ddrot151 rotate 1.000000000000000E-383 -1 -> 1.00000000000000E-384 +ddrot152 rotate 1.000000000000000E-383 -15 -> 1E-398 +ddrot153 rotate 1.000000000000000E-383 1 -> 1E-398 +ddrot154 rotate 1.000000000000000E-383 15 -> 1.00000000000000E-384 +ddrot155 rotate 9.000000000000000E-383 -1 -> 9.00000000000000E-384 +ddrot156 rotate 9.000000000000000E-383 -15 -> 9E-398 +ddrot157 rotate 9.000000000000000E-383 1 -> 9E-398 +ddrot158 rotate 9.000000000000000E-383 15 -> 9.00000000000000E-384 +ddrot160 rotate 1E-398 -1 -> 1.000000000000000E-383 +ddrot161 rotate 1E-398 -15 -> 1.0E-397 +ddrot162 rotate 1E-398 1 -> 1.0E-397 +ddrot163 rotate 1E-398 15 -> 1.000000000000000E-383 +-- negatives +ddrot171 rotate -9.999999999999999E+384 -1 -> -9.999999999999999E+384 +ddrot172 rotate -9.999999999999999E+384 -15 -> -9.999999999999999E+384 +ddrot173 rotate -9.999999999999999E+384 1 -> -9.999999999999999E+384 +ddrot174 rotate -9.999999999999999E+384 15 -> -9.999999999999999E+384 +ddrot175 rotate -1E-383 -1 -> -1.000000000000000E-368 +ddrot176 rotate -1E-383 -15 -> -1.0E-382 +ddrot177 rotate -1E-383 1 -> -1.0E-382 +ddrot178 rotate -1E-383 15 -> -1.000000000000000E-368 +ddrot181 rotate -1.000000000000000E-383 -1 -> -1.00000000000000E-384 +ddrot182 rotate -1.000000000000000E-383 -15 -> -1E-398 +ddrot183 rotate -1.000000000000000E-383 1 -> -1E-398 +ddrot184 rotate -1.000000000000000E-383 15 -> -1.00000000000000E-384 +ddrot185 rotate -9.000000000000000E-383 -1 -> -9.00000000000000E-384 +ddrot186 rotate -9.000000000000000E-383 -15 -> -9E-398 +ddrot187 rotate -9.000000000000000E-383 1 -> -9E-398 +ddrot188 rotate -9.000000000000000E-383 15 -> -9.00000000000000E-384 +ddrot190 rotate -1E-398 -1 -> -1.000000000000000E-383 +ddrot191 rotate -1E-398 -15 -> -1.0E-397 +ddrot192 rotate -1E-398 1 -> -1.0E-397 +ddrot193 rotate -1E-398 15 -> -1.000000000000000E-383 + +-- more negatives (of sanities) +ddrot201 rotate -0 0 -> -0 +ddrot202 rotate -0 2 -> -0 +ddrot203 rotate -1 2 -> -100 +ddrot204 rotate -1 15 -> -1000000000000000 +ddrot205 rotate -1 16 -> -1 +ddrot206 rotate -1 -1 -> -1000000000000000 +ddrot207 rotate -0 -2 -> -0 +ddrot208 rotate -1234567890123456 -1 -> -6123456789012345 +ddrot209 rotate -1234567890123456 -15 -> -2345678901234561 +ddrot210 rotate -1234567890123456 -16 -> -1234567890123456 +ddrot211 rotate -9934567890123456 -15 -> -9345678901234569 +ddrot212 rotate -9934567890123456 -16 -> -9934567890123456 + + +-- Specials; NaNs are handled as usual +ddrot781 rotate -Inf -8 -> -Infinity +ddrot782 rotate -Inf -1 -> -Infinity +ddrot783 rotate -Inf -0 -> -Infinity +ddrot784 rotate -Inf 0 -> -Infinity +ddrot785 rotate -Inf 1 -> -Infinity +ddrot786 rotate -Inf 8 -> -Infinity +ddrot787 rotate -1000 -Inf -> NaN Invalid_operation +ddrot788 rotate -Inf -Inf -> NaN Invalid_operation +ddrot789 rotate -1 -Inf -> NaN Invalid_operation +ddrot790 rotate -0 -Inf -> NaN Invalid_operation +ddrot791 rotate 0 -Inf -> NaN Invalid_operation +ddrot792 rotate 1 -Inf -> NaN Invalid_operation +ddrot793 rotate 1000 -Inf -> NaN Invalid_operation +ddrot794 rotate Inf -Inf -> NaN Invalid_operation + +ddrot800 rotate Inf -Inf -> NaN Invalid_operation +ddrot801 rotate Inf -8 -> Infinity +ddrot802 rotate Inf -1 -> Infinity +ddrot803 rotate Inf -0 -> Infinity +ddrot804 rotate Inf 0 -> Infinity +ddrot805 rotate Inf 1 -> Infinity +ddrot806 rotate Inf 8 -> Infinity +ddrot807 rotate Inf Inf -> NaN Invalid_operation +ddrot808 rotate -1000 Inf -> NaN Invalid_operation +ddrot809 rotate -Inf Inf -> NaN Invalid_operation +ddrot810 rotate -1 Inf -> NaN Invalid_operation +ddrot811 rotate -0 Inf -> NaN Invalid_operation +ddrot812 rotate 0 Inf -> NaN Invalid_operation +ddrot813 rotate 1 Inf -> NaN Invalid_operation +ddrot814 rotate 1000 Inf -> NaN Invalid_operation +ddrot815 rotate Inf Inf -> NaN Invalid_operation + +ddrot821 rotate NaN -Inf -> NaN +ddrot822 rotate NaN -1000 -> NaN +ddrot823 rotate NaN -1 -> NaN +ddrot824 rotate NaN -0 -> NaN +ddrot825 rotate NaN 0 -> NaN +ddrot826 rotate NaN 1 -> NaN +ddrot827 rotate NaN 1000 -> NaN +ddrot828 rotate NaN Inf -> NaN +ddrot829 rotate NaN NaN -> NaN +ddrot830 rotate -Inf NaN -> NaN +ddrot831 rotate -1000 NaN -> NaN +ddrot832 rotate -1 NaN -> NaN +ddrot833 rotate -0 NaN -> NaN +ddrot834 rotate 0 NaN -> NaN +ddrot835 rotate 1 NaN -> NaN +ddrot836 rotate 1000 NaN -> NaN +ddrot837 rotate Inf NaN -> NaN + +ddrot841 rotate sNaN -Inf -> NaN Invalid_operation +ddrot842 rotate sNaN -1000 -> NaN Invalid_operation +ddrot843 rotate sNaN -1 -> NaN Invalid_operation +ddrot844 rotate sNaN -0 -> NaN Invalid_operation +ddrot845 rotate sNaN 0 -> NaN Invalid_operation +ddrot846 rotate sNaN 1 -> NaN Invalid_operation +ddrot847 rotate sNaN 1000 -> NaN Invalid_operation +ddrot848 rotate sNaN NaN -> NaN Invalid_operation +ddrot849 rotate sNaN sNaN -> NaN Invalid_operation +ddrot850 rotate NaN sNaN -> NaN Invalid_operation +ddrot851 rotate -Inf sNaN -> NaN Invalid_operation +ddrot852 rotate -1000 sNaN -> NaN Invalid_operation +ddrot853 rotate -1 sNaN -> NaN Invalid_operation +ddrot854 rotate -0 sNaN -> NaN Invalid_operation +ddrot855 rotate 0 sNaN -> NaN Invalid_operation +ddrot856 rotate 1 sNaN -> NaN Invalid_operation +ddrot857 rotate 1000 sNaN -> NaN Invalid_operation +ddrot858 rotate Inf sNaN -> NaN Invalid_operation +ddrot859 rotate NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddrot861 rotate NaN1 -Inf -> NaN1 +ddrot862 rotate +NaN2 -1000 -> NaN2 +ddrot863 rotate NaN3 1000 -> NaN3 +ddrot864 rotate NaN4 Inf -> NaN4 +ddrot865 rotate NaN5 +NaN6 -> NaN5 +ddrot866 rotate -Inf NaN7 -> NaN7 +ddrot867 rotate -1000 NaN8 -> NaN8 +ddrot868 rotate 1000 NaN9 -> NaN9 +ddrot869 rotate Inf +NaN10 -> NaN10 +ddrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation +ddrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation +ddrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation +ddrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation +ddrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation +ddrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation +ddrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation +ddrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation +ddrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation +ddrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation +ddrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation +ddrot882 rotate -NaN26 NaN28 -> -NaN26 +ddrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation +ddrot884 rotate 1000 -NaN30 -> -NaN30 +ddrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddSameQuantum.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddSameQuantum.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,389 @@ +------------------------------------------------------------------------ +-- ddSameQuantum.decTest -- check decDouble quantums match -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decDoubles. +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddsamq001 samequantum 0 0 -> 1 +ddsamq002 samequantum 0 1 -> 1 +ddsamq003 samequantum 1 0 -> 1 +ddsamq004 samequantum 1 1 -> 1 + +ddsamq011 samequantum 10 1E+1 -> 0 +ddsamq012 samequantum 10E+1 10E+1 -> 1 +ddsamq013 samequantum 100 10E+1 -> 0 +ddsamq014 samequantum 100 1E+2 -> 0 +ddsamq015 samequantum 0.1 1E-2 -> 0 +ddsamq016 samequantum 0.1 1E-1 -> 1 +ddsamq017 samequantum 0.1 1E-0 -> 0 +ddsamq018 samequantum 999 999 -> 1 +ddsamq019 samequantum 999E-1 99.9 -> 1 +ddsamq020 samequantum 111E-1 22.2 -> 1 +ddsamq021 samequantum 111E-1 1234.2 -> 1 + +-- zeros +ddsamq030 samequantum 0.0 1.1 -> 1 +ddsamq031 samequantum 0.0 1.11 -> 0 +ddsamq032 samequantum 0.0 0 -> 0 +ddsamq033 samequantum 0.0 0.0 -> 1 +ddsamq034 samequantum 0.0 0.00 -> 0 +ddsamq035 samequantum 0E+1 0E+0 -> 0 +ddsamq036 samequantum 0E+1 0E+1 -> 1 +ddsamq037 samequantum 0E+1 0E+2 -> 0 +ddsamq038 samequantum 0E-17 0E-16 -> 0 +ddsamq039 samequantum 0E-17 0E-17 -> 1 +ddsamq040 samequantum 0E-17 0E-18 -> 0 +ddsamq041 samequantum 0E-17 0.0E-15 -> 0 +ddsamq042 samequantum 0E-17 0.0E-16 -> 1 +ddsamq043 samequantum 0E-17 0.0E-17 -> 0 +ddsamq044 samequantum -0E-17 0.0E-16 -> 1 +ddsamq045 samequantum 0E-17 -0.0E-17 -> 0 +ddsamq046 samequantum 0E-17 -0.0E-16 -> 1 +ddsamq047 samequantum -0E-17 0.0E-17 -> 0 +ddsamq048 samequantum -0E-17 -0.0E-16 -> 1 +ddsamq049 samequantum -0E-17 -0.0E-17 -> 0 + +-- Nmax, Nmin, Ntiny +ddsamq051 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1 +ddsamq052 samequantum 1E-383 1E-383 -> 1 +ddsamq053 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1 +ddsamq054 samequantum 1E-398 1E-398 -> 1 +ddsamq055 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1 +ddsamq056 samequantum 1E-383 1E-383 -> 1 +ddsamq057 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1 +ddsamq058 samequantum 1E-398 1E-398 -> 1 + +ddsamq061 samequantum -1E-398 -1E-398 -> 1 +ddsamq062 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1 +ddsamq063 samequantum -1E-383 -1E-383 -> 1 +ddsamq064 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1 +ddsamq065 samequantum -1E-398 -1E-398 -> 1 +ddsamq066 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1 +ddsamq067 samequantum -1E-383 -1E-383 -> 1 +ddsamq068 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1 + +ddsamq071 samequantum -4E-398 -1E-398 -> 1 +ddsamq072 samequantum -4.000000000000000E-383 -1.000040000000000E-383 -> 1 +ddsamq073 samequantum -4E-383 -1E-383 -> 1 +ddsamq074 samequantum -4.999999999999999E+384 -9.999999999949999E+384 -> 1 +ddsamq075 samequantum -4E-398 -1E-398 -> 1 +ddsamq076 samequantum -4.000000000000000E-383 -1.004000000000000E-383 -> 1 +ddsamq077 samequantum -4E-383 -1E-383 -> 1 +ddsamq078 samequantum -4.999999999999999E+384 -9.949999999999999E+384 -> 1 + +ddsamq081 samequantum -4E-397 -1E-398 -> 0 +ddsamq082 samequantum -4.000000000000000E-383 -1.000040000000000E-336 -> 0 +ddsamq083 samequantum -4E-346 -1E-383 -> 0 +ddsamq084 samequantum -4.999999999999999E+384 -9.999499999999999E+336 -> 0 +ddsamq085 samequantum -4E-397 -1E-398 -> 0 +ddsamq086 samequantum -4.000000000000000E-383 -1.004000000000000E-336 -> 0 +ddsamq087 samequantum -4E-346 -1E-383 -> 0 +ddsamq088 samequantum -4.999999999999999E+384 -9.949999999999999E+336 -> 0 + +-- specials & combinations +ddsamq0110 samequantum -Inf -Inf -> 1 +ddsamq0111 samequantum -Inf Inf -> 1 +ddsamq0112 samequantum -Inf NaN -> 0 +ddsamq0113 samequantum -Inf -7E+3 -> 0 +ddsamq0114 samequantum -Inf -7 -> 0 +ddsamq0115 samequantum -Inf -7E-3 -> 0 +ddsamq0116 samequantum -Inf -0E-3 -> 0 +ddsamq0117 samequantum -Inf -0 -> 0 +ddsamq0118 samequantum -Inf -0E+3 -> 0 +ddsamq0119 samequantum -Inf 0E-3 -> 0 +ddsamq0120 samequantum -Inf 0 -> 0 +ddsamq0121 samequantum -Inf 0E+3 -> 0 +ddsamq0122 samequantum -Inf 7E-3 -> 0 +ddsamq0123 samequantum -Inf 7 -> 0 +ddsamq0124 samequantum -Inf 7E+3 -> 0 +ddsamq0125 samequantum -Inf sNaN -> 0 + +ddsamq0210 samequantum Inf -Inf -> 1 +ddsamq0211 samequantum Inf Inf -> 1 +ddsamq0212 samequantum Inf NaN -> 0 +ddsamq0213 samequantum Inf -7E+3 -> 0 +ddsamq0214 samequantum Inf -7 -> 0 +ddsamq0215 samequantum Inf -7E-3 -> 0 +ddsamq0216 samequantum Inf -0E-3 -> 0 +ddsamq0217 samequantum Inf -0 -> 0 +ddsamq0218 samequantum Inf -0E+3 -> 0 +ddsamq0219 samequantum Inf 0E-3 -> 0 +ddsamq0220 samequantum Inf 0 -> 0 +ddsamq0221 samequantum Inf 0E+3 -> 0 +ddsamq0222 samequantum Inf 7E-3 -> 0 +ddsamq0223 samequantum Inf 7 -> 0 +ddsamq0224 samequantum Inf 7E+3 -> 0 +ddsamq0225 samequantum Inf sNaN -> 0 + +ddsamq0310 samequantum NaN -Inf -> 0 +ddsamq0311 samequantum NaN Inf -> 0 +ddsamq0312 samequantum NaN NaN -> 1 +ddsamq0313 samequantum NaN -7E+3 -> 0 +ddsamq0314 samequantum NaN -7 -> 0 +ddsamq0315 samequantum NaN -7E-3 -> 0 +ddsamq0316 samequantum NaN -0E-3 -> 0 +ddsamq0317 samequantum NaN -0 -> 0 +ddsamq0318 samequantum NaN -0E+3 -> 0 +ddsamq0319 samequantum NaN 0E-3 -> 0 +ddsamq0320 samequantum NaN 0 -> 0 +ddsamq0321 samequantum NaN 0E+3 -> 0 +ddsamq0322 samequantum NaN 7E-3 -> 0 +ddsamq0323 samequantum NaN 7 -> 0 +ddsamq0324 samequantum NaN 7E+3 -> 0 +ddsamq0325 samequantum NaN sNaN -> 1 + +ddsamq0410 samequantum -7E+3 -Inf -> 0 +ddsamq0411 samequantum -7E+3 Inf -> 0 +ddsamq0412 samequantum -7E+3 NaN -> 0 +ddsamq0413 samequantum -7E+3 -7E+3 -> 1 +ddsamq0414 samequantum -7E+3 -7 -> 0 +ddsamq0415 samequantum -7E+3 -7E-3 -> 0 +ddsamq0416 samequantum -7E+3 -0E-3 -> 0 +ddsamq0417 samequantum -7E+3 -0 -> 0 +ddsamq0418 samequantum -7E+3 -0E+3 -> 1 +ddsamq0419 samequantum -7E+3 0E-3 -> 0 +ddsamq0420 samequantum -7E+3 0 -> 0 +ddsamq0421 samequantum -7E+3 0E+3 -> 1 +ddsamq0422 samequantum -7E+3 7E-3 -> 0 +ddsamq0423 samequantum -7E+3 7 -> 0 +ddsamq0424 samequantum -7E+3 7E+3 -> 1 +ddsamq0425 samequantum -7E+3 sNaN -> 0 + +ddsamq0510 samequantum -7 -Inf -> 0 +ddsamq0511 samequantum -7 Inf -> 0 +ddsamq0512 samequantum -7 NaN -> 0 +ddsamq0513 samequantum -7 -7E+3 -> 0 +ddsamq0514 samequantum -7 -7 -> 1 +ddsamq0515 samequantum -7 -7E-3 -> 0 +ddsamq0516 samequantum -7 -0E-3 -> 0 +ddsamq0517 samequantum -7 -0 -> 1 +ddsamq0518 samequantum -7 -0E+3 -> 0 +ddsamq0519 samequantum -7 0E-3 -> 0 +ddsamq0520 samequantum -7 0 -> 1 +ddsamq0521 samequantum -7 0E+3 -> 0 +ddsamq0522 samequantum -7 7E-3 -> 0 +ddsamq0523 samequantum -7 7 -> 1 +ddsamq0524 samequantum -7 7E+3 -> 0 +ddsamq0525 samequantum -7 sNaN -> 0 + +ddsamq0610 samequantum -7E-3 -Inf -> 0 +ddsamq0611 samequantum -7E-3 Inf -> 0 +ddsamq0612 samequantum -7E-3 NaN -> 0 +ddsamq0613 samequantum -7E-3 -7E+3 -> 0 +ddsamq0614 samequantum -7E-3 -7 -> 0 +ddsamq0615 samequantum -7E-3 -7E-3 -> 1 +ddsamq0616 samequantum -7E-3 -0E-3 -> 1 +ddsamq0617 samequantum -7E-3 -0 -> 0 +ddsamq0618 samequantum -7E-3 -0E+3 -> 0 +ddsamq0619 samequantum -7E-3 0E-3 -> 1 +ddsamq0620 samequantum -7E-3 0 -> 0 +ddsamq0621 samequantum -7E-3 0E+3 -> 0 +ddsamq0622 samequantum -7E-3 7E-3 -> 1 +ddsamq0623 samequantum -7E-3 7 -> 0 +ddsamq0624 samequantum -7E-3 7E+3 -> 0 +ddsamq0625 samequantum -7E-3 sNaN -> 0 + +ddsamq0710 samequantum -0E-3 -Inf -> 0 +ddsamq0711 samequantum -0E-3 Inf -> 0 +ddsamq0712 samequantum -0E-3 NaN -> 0 +ddsamq0713 samequantum -0E-3 -7E+3 -> 0 +ddsamq0714 samequantum -0E-3 -7 -> 0 +ddsamq0715 samequantum -0E-3 -7E-3 -> 1 +ddsamq0716 samequantum -0E-3 -0E-3 -> 1 +ddsamq0717 samequantum -0E-3 -0 -> 0 +ddsamq0718 samequantum -0E-3 -0E+3 -> 0 +ddsamq0719 samequantum -0E-3 0E-3 -> 1 +ddsamq0720 samequantum -0E-3 0 -> 0 +ddsamq0721 samequantum -0E-3 0E+3 -> 0 +ddsamq0722 samequantum -0E-3 7E-3 -> 1 +ddsamq0723 samequantum -0E-3 7 -> 0 +ddsamq0724 samequantum -0E-3 7E+3 -> 0 +ddsamq0725 samequantum -0E-3 sNaN -> 0 + +ddsamq0810 samequantum -0 -Inf -> 0 +ddsamq0811 samequantum -0 Inf -> 0 +ddsamq0812 samequantum -0 NaN -> 0 +ddsamq0813 samequantum -0 -7E+3 -> 0 +ddsamq0814 samequantum -0 -7 -> 1 +ddsamq0815 samequantum -0 -7E-3 -> 0 +ddsamq0816 samequantum -0 -0E-3 -> 0 +ddsamq0817 samequantum -0 -0 -> 1 +ddsamq0818 samequantum -0 -0E+3 -> 0 +ddsamq0819 samequantum -0 0E-3 -> 0 +ddsamq0820 samequantum -0 0 -> 1 +ddsamq0821 samequantum -0 0E+3 -> 0 +ddsamq0822 samequantum -0 7E-3 -> 0 +ddsamq0823 samequantum -0 7 -> 1 +ddsamq0824 samequantum -0 7E+3 -> 0 +ddsamq0825 samequantum -0 sNaN -> 0 + +ddsamq0910 samequantum -0E+3 -Inf -> 0 +ddsamq0911 samequantum -0E+3 Inf -> 0 +ddsamq0912 samequantum -0E+3 NaN -> 0 +ddsamq0913 samequantum -0E+3 -7E+3 -> 1 +ddsamq0914 samequantum -0E+3 -7 -> 0 +ddsamq0915 samequantum -0E+3 -7E-3 -> 0 +ddsamq0916 samequantum -0E+3 -0E-3 -> 0 +ddsamq0917 samequantum -0E+3 -0 -> 0 +ddsamq0918 samequantum -0E+3 -0E+3 -> 1 +ddsamq0919 samequantum -0E+3 0E-3 -> 0 +ddsamq0920 samequantum -0E+3 0 -> 0 +ddsamq0921 samequantum -0E+3 0E+3 -> 1 +ddsamq0922 samequantum -0E+3 7E-3 -> 0 +ddsamq0923 samequantum -0E+3 7 -> 0 +ddsamq0924 samequantum -0E+3 7E+3 -> 1 +ddsamq0925 samequantum -0E+3 sNaN -> 0 + +ddsamq1110 samequantum 0E-3 -Inf -> 0 +ddsamq1111 samequantum 0E-3 Inf -> 0 +ddsamq1112 samequantum 0E-3 NaN -> 0 +ddsamq1113 samequantum 0E-3 -7E+3 -> 0 +ddsamq1114 samequantum 0E-3 -7 -> 0 +ddsamq1115 samequantum 0E-3 -7E-3 -> 1 +ddsamq1116 samequantum 0E-3 -0E-3 -> 1 +ddsamq1117 samequantum 0E-3 -0 -> 0 +ddsamq1118 samequantum 0E-3 -0E+3 -> 0 +ddsamq1119 samequantum 0E-3 0E-3 -> 1 +ddsamq1120 samequantum 0E-3 0 -> 0 +ddsamq1121 samequantum 0E-3 0E+3 -> 0 +ddsamq1122 samequantum 0E-3 7E-3 -> 1 +ddsamq1123 samequantum 0E-3 7 -> 0 +ddsamq1124 samequantum 0E-3 7E+3 -> 0 +ddsamq1125 samequantum 0E-3 sNaN -> 0 + +ddsamq1210 samequantum 0 -Inf -> 0 +ddsamq1211 samequantum 0 Inf -> 0 +ddsamq1212 samequantum 0 NaN -> 0 +ddsamq1213 samequantum 0 -7E+3 -> 0 +ddsamq1214 samequantum 0 -7 -> 1 +ddsamq1215 samequantum 0 -7E-3 -> 0 +ddsamq1216 samequantum 0 -0E-3 -> 0 +ddsamq1217 samequantum 0 -0 -> 1 +ddsamq1218 samequantum 0 -0E+3 -> 0 +ddsamq1219 samequantum 0 0E-3 -> 0 +ddsamq1220 samequantum 0 0 -> 1 +ddsamq1221 samequantum 0 0E+3 -> 0 +ddsamq1222 samequantum 0 7E-3 -> 0 +ddsamq1223 samequantum 0 7 -> 1 +ddsamq1224 samequantum 0 7E+3 -> 0 +ddsamq1225 samequantum 0 sNaN -> 0 + +ddsamq1310 samequantum 0E+3 -Inf -> 0 +ddsamq1311 samequantum 0E+3 Inf -> 0 +ddsamq1312 samequantum 0E+3 NaN -> 0 +ddsamq1313 samequantum 0E+3 -7E+3 -> 1 +ddsamq1314 samequantum 0E+3 -7 -> 0 +ddsamq1315 samequantum 0E+3 -7E-3 -> 0 +ddsamq1316 samequantum 0E+3 -0E-3 -> 0 +ddsamq1317 samequantum 0E+3 -0 -> 0 +ddsamq1318 samequantum 0E+3 -0E+3 -> 1 +ddsamq1319 samequantum 0E+3 0E-3 -> 0 +ddsamq1320 samequantum 0E+3 0 -> 0 +ddsamq1321 samequantum 0E+3 0E+3 -> 1 +ddsamq1322 samequantum 0E+3 7E-3 -> 0 +ddsamq1323 samequantum 0E+3 7 -> 0 +ddsamq1324 samequantum 0E+3 7E+3 -> 1 +ddsamq1325 samequantum 0E+3 sNaN -> 0 + +ddsamq1410 samequantum 7E-3 -Inf -> 0 +ddsamq1411 samequantum 7E-3 Inf -> 0 +ddsamq1412 samequantum 7E-3 NaN -> 0 +ddsamq1413 samequantum 7E-3 -7E+3 -> 0 +ddsamq1414 samequantum 7E-3 -7 -> 0 +ddsamq1415 samequantum 7E-3 -7E-3 -> 1 +ddsamq1416 samequantum 7E-3 -0E-3 -> 1 +ddsamq1417 samequantum 7E-3 -0 -> 0 +ddsamq1418 samequantum 7E-3 -0E+3 -> 0 +ddsamq1419 samequantum 7E-3 0E-3 -> 1 +ddsamq1420 samequantum 7E-3 0 -> 0 +ddsamq1421 samequantum 7E-3 0E+3 -> 0 +ddsamq1422 samequantum 7E-3 7E-3 -> 1 +ddsamq1423 samequantum 7E-3 7 -> 0 +ddsamq1424 samequantum 7E-3 7E+3 -> 0 +ddsamq1425 samequantum 7E-3 sNaN -> 0 + +ddsamq1510 samequantum 7 -Inf -> 0 +ddsamq1511 samequantum 7 Inf -> 0 +ddsamq1512 samequantum 7 NaN -> 0 +ddsamq1513 samequantum 7 -7E+3 -> 0 +ddsamq1514 samequantum 7 -7 -> 1 +ddsamq1515 samequantum 7 -7E-3 -> 0 +ddsamq1516 samequantum 7 -0E-3 -> 0 +ddsamq1517 samequantum 7 -0 -> 1 +ddsamq1518 samequantum 7 -0E+3 -> 0 +ddsamq1519 samequantum 7 0E-3 -> 0 +ddsamq1520 samequantum 7 0 -> 1 +ddsamq1521 samequantum 7 0E+3 -> 0 +ddsamq1522 samequantum 7 7E-3 -> 0 +ddsamq1523 samequantum 7 7 -> 1 +ddsamq1524 samequantum 7 7E+3 -> 0 +ddsamq1525 samequantum 7 sNaN -> 0 + +ddsamq1610 samequantum 7E+3 -Inf -> 0 +ddsamq1611 samequantum 7E+3 Inf -> 0 +ddsamq1612 samequantum 7E+3 NaN -> 0 +ddsamq1613 samequantum 7E+3 -7E+3 -> 1 +ddsamq1614 samequantum 7E+3 -7 -> 0 +ddsamq1615 samequantum 7E+3 -7E-3 -> 0 +ddsamq1616 samequantum 7E+3 -0E-3 -> 0 +ddsamq1617 samequantum 7E+3 -0 -> 0 +ddsamq1618 samequantum 7E+3 -0E+3 -> 1 +ddsamq1619 samequantum 7E+3 0E-3 -> 0 +ddsamq1620 samequantum 7E+3 0 -> 0 +ddsamq1621 samequantum 7E+3 0E+3 -> 1 +ddsamq1622 samequantum 7E+3 7E-3 -> 0 +ddsamq1623 samequantum 7E+3 7 -> 0 +ddsamq1624 samequantum 7E+3 7E+3 -> 1 +ddsamq1625 samequantum 7E+3 sNaN -> 0 + +ddsamq1710 samequantum sNaN -Inf -> 0 +ddsamq1711 samequantum sNaN Inf -> 0 +ddsamq1712 samequantum sNaN NaN -> 1 +ddsamq1713 samequantum sNaN -7E+3 -> 0 +ddsamq1714 samequantum sNaN -7 -> 0 +ddsamq1715 samequantum sNaN -7E-3 -> 0 +ddsamq1716 samequantum sNaN -0E-3 -> 0 +ddsamq1717 samequantum sNaN -0 -> 0 +ddsamq1718 samequantum sNaN -0E+3 -> 0 +ddsamq1719 samequantum sNaN 0E-3 -> 0 +ddsamq1720 samequantum sNaN 0 -> 0 +ddsamq1721 samequantum sNaN 0E+3 -> 0 +ddsamq1722 samequantum sNaN 7E-3 -> 0 +ddsamq1723 samequantum sNaN 7 -> 0 +ddsamq1724 samequantum sNaN 7E+3 -> 0 +ddsamq1725 samequantum sNaN sNaN -> 1 +-- noisy NaNs +ddsamq1730 samequantum sNaN3 sNaN3 -> 1 +ddsamq1731 samequantum sNaN3 sNaN4 -> 1 +ddsamq1732 samequantum NaN3 NaN3 -> 1 +ddsamq1733 samequantum NaN3 NaN4 -> 1 +ddsamq1734 samequantum sNaN3 3 -> 0 +ddsamq1735 samequantum NaN3 3 -> 0 +ddsamq1736 samequantum 4 sNaN4 -> 0 +ddsamq1737 samequantum 3 NaN3 -> 0 +ddsamq1738 samequantum Inf sNaN4 -> 0 +ddsamq1739 samequantum -Inf NaN3 -> 0 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddScaleB.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddScaleB.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,243 @@ +------------------------------------------------------------------------ +-- ddScalebB.decTest -- scale a decDouble by powers of 10 -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Max |rhs| is 2*(384+16) = 800 + +-- Sanity checks +ddscb001 scaleb 7.50 10 -> 7.50E+10 +ddscb002 scaleb 7.50 3 -> 7.50E+3 +ddscb003 scaleb 7.50 2 -> 750 +ddscb004 scaleb 7.50 1 -> 75.0 +ddscb005 scaleb 7.50 0 -> 7.50 +ddscb006 scaleb 7.50 -1 -> 0.750 +ddscb007 scaleb 7.50 -2 -> 0.0750 +ddscb008 scaleb 7.50 -10 -> 7.50E-10 +ddscb009 scaleb -7.50 3 -> -7.50E+3 +ddscb010 scaleb -7.50 2 -> -750 +ddscb011 scaleb -7.50 1 -> -75.0 +ddscb012 scaleb -7.50 0 -> -7.50 +ddscb013 scaleb -7.50 -1 -> -0.750 + +-- Infinities +ddscb014 scaleb Infinity 1 -> Infinity +ddscb015 scaleb -Infinity 2 -> -Infinity +ddscb016 scaleb Infinity -1 -> Infinity +ddscb017 scaleb -Infinity -2 -> -Infinity + +-- Next two are somewhat undefined in 754r; treat as non-integer +ddscb018 scaleb 10 Infinity -> NaN Invalid_operation +ddscb019 scaleb 10 -Infinity -> NaN Invalid_operation + +-- NaNs are undefined in 754r; assume usual processing +-- NaNs, 0 payload +ddscb021 scaleb NaN 1 -> NaN +ddscb022 scaleb -NaN -1 -> -NaN +ddscb023 scaleb sNaN 1 -> NaN Invalid_operation +ddscb024 scaleb -sNaN 1 -> -NaN Invalid_operation +ddscb025 scaleb 4 NaN -> NaN +ddscb026 scaleb -Inf -NaN -> -NaN +ddscb027 scaleb 4 sNaN -> NaN Invalid_operation +ddscb028 scaleb Inf -sNaN -> -NaN Invalid_operation + +-- non-integer RHS +ddscb030 scaleb 1.23 1 -> 12.3 +ddscb031 scaleb 1.23 1.00 -> NaN Invalid_operation +ddscb032 scaleb 1.23 1.1 -> NaN Invalid_operation +ddscb033 scaleb 1.23 1.01 -> NaN Invalid_operation +ddscb034 scaleb 1.23 0.01 -> NaN Invalid_operation +ddscb035 scaleb 1.23 0.11 -> NaN Invalid_operation +ddscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation +ddscb037 scaleb 1.23 -1 -> 0.123 +ddscb038 scaleb 1.23 -1.00 -> NaN Invalid_operation +ddscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation +ddscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation +ddscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation +ddscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation +ddscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation +ddscb044 scaleb 1.23 0.1 -> NaN Invalid_operation +ddscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation +ddscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation +ddscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation + +-- out-of range RHS +ddscb120 scaleb 1.23 799 -> Infinity Overflow Inexact Rounded +ddscb121 scaleb 1.23 800 -> Infinity Overflow Inexact Rounded +ddscb122 scaleb 1.23 801 -> NaN Invalid_operation +ddscb123 scaleb 1.23 802 -> NaN Invalid_operation +ddscb124 scaleb 1.23 -799 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddscb125 scaleb 1.23 -800 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddscb126 scaleb 1.23 -801 -> NaN Invalid_operation +ddscb127 scaleb 1.23 -802 -> NaN Invalid_operation + +-- NaNs, non-0 payload +-- propagating NaNs +ddscb861 scaleb NaN01 -Inf -> NaN1 +ddscb862 scaleb -NaN02 -1000 -> -NaN2 +ddscb863 scaleb NaN03 1000 -> NaN3 +ddscb864 scaleb NaN04 Inf -> NaN4 +ddscb865 scaleb NaN05 NaN61 -> NaN5 +ddscb866 scaleb -Inf -NaN71 -> -NaN71 +ddscb867 scaleb -1000 NaN81 -> NaN81 +ddscb868 scaleb 1000 NaN91 -> NaN91 +ddscb869 scaleb Inf NaN101 -> NaN101 +ddscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation +ddscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation +ddscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation +ddscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation +ddscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation +ddscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation +ddscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation +ddscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation +ddscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation +ddscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation +ddscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation + +-- finites +ddscb051 scaleb 7 -2 -> 0.07 +ddscb052 scaleb -7 -2 -> -0.07 +ddscb053 scaleb 75 -2 -> 0.75 +ddscb054 scaleb -75 -2 -> -0.75 +ddscb055 scaleb 7.50 -2 -> 0.0750 +ddscb056 scaleb -7.50 -2 -> -0.0750 +ddscb057 scaleb 7.500 -2 -> 0.07500 +ddscb058 scaleb -7.500 -2 -> -0.07500 +ddscb061 scaleb 7 -1 -> 0.7 +ddscb062 scaleb -7 -1 -> -0.7 +ddscb063 scaleb 75 -1 -> 7.5 +ddscb064 scaleb -75 -1 -> -7.5 +ddscb065 scaleb 7.50 -1 -> 0.750 +ddscb066 scaleb -7.50 -1 -> -0.750 +ddscb067 scaleb 7.500 -1 -> 0.7500 +ddscb068 scaleb -7.500 -1 -> -0.7500 +ddscb071 scaleb 7 0 -> 7 +ddscb072 scaleb -7 0 -> -7 +ddscb073 scaleb 75 0 -> 75 +ddscb074 scaleb -75 0 -> -75 +ddscb075 scaleb 7.50 0 -> 7.50 +ddscb076 scaleb -7.50 0 -> -7.50 +ddscb077 scaleb 7.500 0 -> 7.500 +ddscb078 scaleb -7.500 0 -> -7.500 +ddscb081 scaleb 7 1 -> 7E+1 +ddscb082 scaleb -7 1 -> -7E+1 +ddscb083 scaleb 75 1 -> 7.5E+2 +ddscb084 scaleb -75 1 -> -7.5E+2 +ddscb085 scaleb 7.50 1 -> 75.0 +ddscb086 scaleb -7.50 1 -> -75.0 +ddscb087 scaleb 7.500 1 -> 75.00 +ddscb088 scaleb -7.500 1 -> -75.00 +ddscb091 scaleb 7 2 -> 7E+2 +ddscb092 scaleb -7 2 -> -7E+2 +ddscb093 scaleb 75 2 -> 7.5E+3 +ddscb094 scaleb -75 2 -> -7.5E+3 +ddscb095 scaleb 7.50 2 -> 750 +ddscb096 scaleb -7.50 2 -> -750 +ddscb097 scaleb 7.500 2 -> 750.0 +ddscb098 scaleb -7.500 2 -> -750.0 + +-- zeros +ddscb111 scaleb 0 1 -> 0E+1 +ddscb112 scaleb -0 2 -> -0E+2 +ddscb113 scaleb 0E+4 3 -> 0E+7 +ddscb114 scaleb -0E+4 4 -> -0E+8 +ddscb115 scaleb 0.0000 5 -> 0E+1 +ddscb116 scaleb -0.0000 6 -> -0E+2 +ddscb117 scaleb 0E-141 7 -> 0E-134 +ddscb118 scaleb -0E-141 8 -> -0E-133 + +-- Nmax, Nmin, Ntiny +ddscb132 scaleb 9.999999999999999E+384 +384 -> Infinity Overflow Inexact Rounded +ddscb133 scaleb 9.999999999999999E+384 +10 -> Infinity Overflow Inexact Rounded +ddscb134 scaleb 9.999999999999999E+384 +1 -> Infinity Overflow Inexact Rounded +ddscb135 scaleb 9.999999999999999E+384 0 -> 9.999999999999999E+384 +ddscb136 scaleb 9.999999999999999E+384 -1 -> 9.999999999999999E+383 +ddscb137 scaleb 1E-383 +1 -> 1E-382 +ddscb138 scaleb 1E-383 -0 -> 1E-383 +ddscb139 scaleb 1E-383 -1 -> 1E-384 Subnormal +ddscb140 scaleb 1.000000000000000E-383 +1 -> 1.000000000000000E-382 +ddscb141 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383 +ddscb142 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded +ddscb143 scaleb 1E-398 +1 -> 1E-397 Subnormal +ddscb144 scaleb 1E-398 -0 -> 1E-398 Subnormal +ddscb145 scaleb 1E-398 -1 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + +ddscb150 scaleb -1E-398 +1 -> -1E-397 Subnormal +ddscb151 scaleb -1E-398 -0 -> -1E-398 Subnormal +ddscb152 scaleb -1E-398 -1 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped +ddscb153 scaleb -1.000000000000000E-383 +1 -> -1.000000000000000E-382 +ddscb154 scaleb -1.000000000000000E-383 +0 -> -1.000000000000000E-383 +ddscb155 scaleb -1.000000000000000E-383 -1 -> -1.00000000000000E-384 Subnormal Rounded +ddscb156 scaleb -1E-383 +1 -> -1E-382 +ddscb157 scaleb -1E-383 -0 -> -1E-383 +ddscb158 scaleb -1E-383 -1 -> -1E-384 Subnormal +ddscb159 scaleb -9.999999999999999E+384 +1 -> -Infinity Overflow Inexact Rounded +ddscb160 scaleb -9.999999999999999E+384 +0 -> -9.999999999999999E+384 +ddscb161 scaleb -9.999999999999999E+384 -1 -> -9.999999999999999E+383 +ddscb162 scaleb -9E+384 +1 -> -Infinity Overflow Inexact Rounded +ddscb163 scaleb -1E+384 +1 -> -Infinity Overflow Inexact Rounded + +-- some Origami +-- (these check that overflow is being done correctly) +ddscb171 scaleb 1000E+365 +1 -> 1.000E+369 +ddscb172 scaleb 1000E+366 +1 -> 1.000E+370 +ddscb173 scaleb 1000E+367 +1 -> 1.000E+371 +ddscb174 scaleb 1000E+368 +1 -> 1.000E+372 +ddscb175 scaleb 1000E+369 +1 -> 1.0000E+373 Clamped +ddscb176 scaleb 1000E+370 +1 -> 1.00000E+374 Clamped +ddscb177 scaleb 1000E+371 +1 -> 1.000000E+375 Clamped +ddscb178 scaleb 1000E+372 +1 -> 1.0000000E+376 Clamped +ddscb179 scaleb 1000E+373 +1 -> 1.00000000E+377 Clamped +ddscb180 scaleb 1000E+374 +1 -> 1.000000000E+378 Clamped +ddscb181 scaleb 1000E+375 +1 -> 1.0000000000E+379 Clamped +ddscb182 scaleb 1000E+376 +1 -> 1.00000000000E+380 Clamped +ddscb183 scaleb 1000E+377 +1 -> 1.000000000000E+381 Clamped +ddscb184 scaleb 1000E+378 +1 -> 1.0000000000000E+382 Clamped +ddscb185 scaleb 1000E+379 +1 -> 1.00000000000000E+383 Clamped +ddscb186 scaleb 1000E+380 +1 -> 1.000000000000000E+384 Clamped +ddscb187 scaleb 1000E+381 +1 -> Infinity Overflow Inexact Rounded + +-- and a few more subnormal truncations +-- (these check that underflow is being done correctly) +ddscb201 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383 +ddscb202 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded +ddscb203 scaleb 1.000000000000000E-383 -2 -> 1.0000000000000E-385 Subnormal Rounded +ddscb204 scaleb 1.000000000000000E-383 -3 -> 1.000000000000E-386 Subnormal Rounded +ddscb205 scaleb 1.000000000000000E-383 -4 -> 1.00000000000E-387 Subnormal Rounded +ddscb206 scaleb 1.000000000000000E-383 -5 -> 1.0000000000E-388 Subnormal Rounded +ddscb207 scaleb 1.000000000000000E-383 -6 -> 1.000000000E-389 Subnormal Rounded +ddscb208 scaleb 1.000000000000000E-383 -7 -> 1.00000000E-390 Subnormal Rounded +ddscb209 scaleb 1.000000000000000E-383 -8 -> 1.0000000E-391 Subnormal Rounded +ddscb210 scaleb 1.000000000000000E-383 -9 -> 1.000000E-392 Subnormal Rounded +ddscb211 scaleb 1.000000000000000E-383 -10 -> 1.00000E-393 Subnormal Rounded +ddscb212 scaleb 1.000000000000000E-383 -11 -> 1.0000E-394 Subnormal Rounded +ddscb213 scaleb 1.000000000000000E-383 -12 -> 1.000E-395 Subnormal Rounded +ddscb214 scaleb 1.000000000000000E-383 -13 -> 1.00E-396 Subnormal Rounded +ddscb215 scaleb 1.000000000000000E-383 -14 -> 1.0E-397 Subnormal Rounded +ddscb216 scaleb 1.000000000000000E-383 -15 -> 1E-398 Subnormal Rounded +ddscb217 scaleb 1.000000000000000E-383 -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped +ddscb218 scaleb 1.000000000000000E-383 -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddShift.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddShift.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,262 @@ +------------------------------------------------------------------------ +-- ddShift.decTest -- shift decDouble coefficient left or right -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check +ddshi001 shift 0 0 -> 0 +ddshi002 shift 0 2 -> 0 +ddshi003 shift 1 2 -> 100 +ddshi004 shift 1 15 -> 1000000000000000 +ddshi005 shift 1 16 -> 0 +ddshi006 shift 1 -1 -> 0 +ddshi007 shift 0 -2 -> 0 +ddshi008 shift 1234567890123456 -1 -> 123456789012345 +ddshi009 shift 1234567890123456 -15 -> 1 +ddshi010 shift 1234567890123456 -16 -> 0 +ddshi011 shift 9934567890123456 -15 -> 9 +ddshi012 shift 9934567890123456 -16 -> 0 + +-- rhs must be an integer +ddshi015 shift 1 1.5 -> NaN Invalid_operation +ddshi016 shift 1 1.0 -> NaN Invalid_operation +ddshi017 shift 1 0.1 -> NaN Invalid_operation +ddshi018 shift 1 0.0 -> NaN Invalid_operation +ddshi019 shift 1 1E+1 -> NaN Invalid_operation +ddshi020 shift 1 1E+99 -> NaN Invalid_operation +ddshi021 shift 1 Inf -> NaN Invalid_operation +ddshi022 shift 1 -Inf -> NaN Invalid_operation +-- and |rhs| <= precision +ddshi025 shift 1 -1000 -> NaN Invalid_operation +ddshi026 shift 1 -17 -> NaN Invalid_operation +ddshi027 shift 1 17 -> NaN Invalid_operation +ddshi028 shift 1 1000 -> NaN Invalid_operation + +-- full shifting pattern +ddshi030 shift 1234567890123456 -16 -> 0 +ddshi031 shift 1234567890123456 -15 -> 1 +ddshi032 shift 1234567890123456 -14 -> 12 +ddshi033 shift 1234567890123456 -13 -> 123 +ddshi034 shift 1234567890123456 -12 -> 1234 +ddshi035 shift 1234567890123456 -11 -> 12345 +ddshi036 shift 1234567890123456 -10 -> 123456 +ddshi037 shift 1234567890123456 -9 -> 1234567 +ddshi038 shift 1234567890123456 -8 -> 12345678 +ddshi039 shift 1234567890123456 -7 -> 123456789 +ddshi040 shift 1234567890123456 -6 -> 1234567890 +ddshi041 shift 1234567890123456 -5 -> 12345678901 +ddshi042 shift 1234567890123456 -4 -> 123456789012 +ddshi043 shift 1234567890123456 -3 -> 1234567890123 +ddshi044 shift 1234567890123456 -2 -> 12345678901234 +ddshi045 shift 1234567890123456 -1 -> 123456789012345 +ddshi046 shift 1234567890123456 -0 -> 1234567890123456 + +ddshi047 shift 1234567890123456 +0 -> 1234567890123456 +ddshi048 shift 1234567890123456 +1 -> 2345678901234560 +ddshi049 shift 1234567890123456 +2 -> 3456789012345600 +ddshi050 shift 1234567890123456 +3 -> 4567890123456000 +ddshi051 shift 1234567890123456 +4 -> 5678901234560000 +ddshi052 shift 1234567890123456 +5 -> 6789012345600000 +ddshi053 shift 1234567890123456 +6 -> 7890123456000000 +ddshi054 shift 1234567890123456 +7 -> 8901234560000000 +ddshi055 shift 1234567890123456 +8 -> 9012345600000000 +ddshi056 shift 1234567890123456 +9 -> 123456000000000 +ddshi057 shift 1234567890123456 +10 -> 1234560000000000 +ddshi058 shift 1234567890123456 +11 -> 2345600000000000 +ddshi059 shift 1234567890123456 +12 -> 3456000000000000 +ddshi060 shift 1234567890123456 +13 -> 4560000000000000 +ddshi061 shift 1234567890123456 +14 -> 5600000000000000 +ddshi062 shift 1234567890123456 +15 -> 6000000000000000 +ddshi063 shift 1234567890123456 +16 -> 0 + +-- zeros +ddshi070 shift 0E-10 +9 -> 0E-10 +ddshi071 shift 0E-10 -9 -> 0E-10 +ddshi072 shift 0.000 +9 -> 0.000 +ddshi073 shift 0.000 -9 -> 0.000 +ddshi074 shift 0E+10 +9 -> 0E+10 +ddshi075 shift 0E+10 -9 -> 0E+10 +ddshi076 shift -0E-10 +9 -> -0E-10 +ddshi077 shift -0E-10 -9 -> -0E-10 +ddshi078 shift -0.000 +9 -> -0.000 +ddshi079 shift -0.000 -9 -> -0.000 +ddshi080 shift -0E+10 +9 -> -0E+10 +ddshi081 shift -0E+10 -9 -> -0E+10 + +-- Nmax, Nmin, Ntiny +ddshi141 shift 9.999999999999999E+384 -1 -> 9.99999999999999E+383 +ddshi142 shift 9.999999999999999E+384 -15 -> 9E+369 +ddshi143 shift 9.999999999999999E+384 1 -> 9.999999999999990E+384 +ddshi144 shift 9.999999999999999E+384 15 -> 9.000000000000000E+384 +ddshi145 shift 1E-383 -1 -> 0E-383 +ddshi146 shift 1E-383 -15 -> 0E-383 +ddshi147 shift 1E-383 1 -> 1.0E-382 +ddshi148 shift 1E-383 15 -> 1.000000000000000E-368 +ddshi151 shift 1.000000000000000E-383 -1 -> 1.00000000000000E-384 +ddshi152 shift 1.000000000000000E-383 -15 -> 1E-398 +ddshi153 shift 1.000000000000000E-383 1 -> 0E-398 +ddshi154 shift 1.000000000000000E-383 15 -> 0E-398 +ddshi155 shift 9.000000000000000E-383 -1 -> 9.00000000000000E-384 +ddshi156 shift 9.000000000000000E-383 -15 -> 9E-398 +ddshi157 shift 9.000000000000000E-383 1 -> 0E-398 +ddshi158 shift 9.000000000000000E-383 15 -> 0E-398 +ddshi160 shift 1E-398 -1 -> 0E-398 +ddshi161 shift 1E-398 -15 -> 0E-398 +ddshi162 shift 1E-398 1 -> 1.0E-397 +ddshi163 shift 1E-398 15 -> 1.000000000000000E-383 +-- negatives +ddshi171 shift -9.999999999999999E+384 -1 -> -9.99999999999999E+383 +ddshi172 shift -9.999999999999999E+384 -15 -> -9E+369 +ddshi173 shift -9.999999999999999E+384 1 -> -9.999999999999990E+384 +ddshi174 shift -9.999999999999999E+384 15 -> -9.000000000000000E+384 +ddshi175 shift -1E-383 -1 -> -0E-383 +ddshi176 shift -1E-383 -15 -> -0E-383 +ddshi177 shift -1E-383 1 -> -1.0E-382 +ddshi178 shift -1E-383 15 -> -1.000000000000000E-368 +ddshi181 shift -1.000000000000000E-383 -1 -> -1.00000000000000E-384 +ddshi182 shift -1.000000000000000E-383 -15 -> -1E-398 +ddshi183 shift -1.000000000000000E-383 1 -> -0E-398 +ddshi184 shift -1.000000000000000E-383 15 -> -0E-398 +ddshi185 shift -9.000000000000000E-383 -1 -> -9.00000000000000E-384 +ddshi186 shift -9.000000000000000E-383 -15 -> -9E-398 +ddshi187 shift -9.000000000000000E-383 1 -> -0E-398 +ddshi188 shift -9.000000000000000E-383 15 -> -0E-398 +ddshi190 shift -1E-398 -1 -> -0E-398 +ddshi191 shift -1E-398 -15 -> -0E-398 +ddshi192 shift -1E-398 1 -> -1.0E-397 +ddshi193 shift -1E-398 15 -> -1.000000000000000E-383 + +-- more negatives (of sanities) +ddshi201 shift -0 0 -> -0 +ddshi202 shift -0 2 -> -0 +ddshi203 shift -1 2 -> -100 +ddshi204 shift -1 15 -> -1000000000000000 +ddshi205 shift -1 16 -> -0 +ddshi206 shift -1 -1 -> -0 +ddshi207 shift -0 -2 -> -0 +ddshi208 shift -1234567890123456 -1 -> -123456789012345 +ddshi209 shift -1234567890123456 -15 -> -1 +ddshi210 shift -1234567890123456 -16 -> -0 +ddshi211 shift -9934567890123456 -15 -> -9 +ddshi212 shift -9934567890123456 -16 -> -0 + + +-- Specials; NaNs are handled as usual +ddshi781 shift -Inf -8 -> -Infinity +ddshi782 shift -Inf -1 -> -Infinity +ddshi783 shift -Inf -0 -> -Infinity +ddshi784 shift -Inf 0 -> -Infinity +ddshi785 shift -Inf 1 -> -Infinity +ddshi786 shift -Inf 8 -> -Infinity +ddshi787 shift -1000 -Inf -> NaN Invalid_operation +ddshi788 shift -Inf -Inf -> NaN Invalid_operation +ddshi789 shift -1 -Inf -> NaN Invalid_operation +ddshi790 shift -0 -Inf -> NaN Invalid_operation +ddshi791 shift 0 -Inf -> NaN Invalid_operation +ddshi792 shift 1 -Inf -> NaN Invalid_operation +ddshi793 shift 1000 -Inf -> NaN Invalid_operation +ddshi794 shift Inf -Inf -> NaN Invalid_operation + +ddshi800 shift Inf -Inf -> NaN Invalid_operation +ddshi801 shift Inf -8 -> Infinity +ddshi802 shift Inf -1 -> Infinity +ddshi803 shift Inf -0 -> Infinity +ddshi804 shift Inf 0 -> Infinity +ddshi805 shift Inf 1 -> Infinity +ddshi806 shift Inf 8 -> Infinity +ddshi807 shift Inf Inf -> NaN Invalid_operation +ddshi808 shift -1000 Inf -> NaN Invalid_operation +ddshi809 shift -Inf Inf -> NaN Invalid_operation +ddshi810 shift -1 Inf -> NaN Invalid_operation +ddshi811 shift -0 Inf -> NaN Invalid_operation +ddshi812 shift 0 Inf -> NaN Invalid_operation +ddshi813 shift 1 Inf -> NaN Invalid_operation +ddshi814 shift 1000 Inf -> NaN Invalid_operation +ddshi815 shift Inf Inf -> NaN Invalid_operation + +ddshi821 shift NaN -Inf -> NaN +ddshi822 shift NaN -1000 -> NaN +ddshi823 shift NaN -1 -> NaN +ddshi824 shift NaN -0 -> NaN +ddshi825 shift NaN 0 -> NaN +ddshi826 shift NaN 1 -> NaN +ddshi827 shift NaN 1000 -> NaN +ddshi828 shift NaN Inf -> NaN +ddshi829 shift NaN NaN -> NaN +ddshi830 shift -Inf NaN -> NaN +ddshi831 shift -1000 NaN -> NaN +ddshi832 shift -1 NaN -> NaN +ddshi833 shift -0 NaN -> NaN +ddshi834 shift 0 NaN -> NaN +ddshi835 shift 1 NaN -> NaN +ddshi836 shift 1000 NaN -> NaN +ddshi837 shift Inf NaN -> NaN + +ddshi841 shift sNaN -Inf -> NaN Invalid_operation +ddshi842 shift sNaN -1000 -> NaN Invalid_operation +ddshi843 shift sNaN -1 -> NaN Invalid_operation +ddshi844 shift sNaN -0 -> NaN Invalid_operation +ddshi845 shift sNaN 0 -> NaN Invalid_operation +ddshi846 shift sNaN 1 -> NaN Invalid_operation +ddshi847 shift sNaN 1000 -> NaN Invalid_operation +ddshi848 shift sNaN NaN -> NaN Invalid_operation +ddshi849 shift sNaN sNaN -> NaN Invalid_operation +ddshi850 shift NaN sNaN -> NaN Invalid_operation +ddshi851 shift -Inf sNaN -> NaN Invalid_operation +ddshi852 shift -1000 sNaN -> NaN Invalid_operation +ddshi853 shift -1 sNaN -> NaN Invalid_operation +ddshi854 shift -0 sNaN -> NaN Invalid_operation +ddshi855 shift 0 sNaN -> NaN Invalid_operation +ddshi856 shift 1 sNaN -> NaN Invalid_operation +ddshi857 shift 1000 sNaN -> NaN Invalid_operation +ddshi858 shift Inf sNaN -> NaN Invalid_operation +ddshi859 shift NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddshi861 shift NaN1 -Inf -> NaN1 +ddshi862 shift +NaN2 -1000 -> NaN2 +ddshi863 shift NaN3 1000 -> NaN3 +ddshi864 shift NaN4 Inf -> NaN4 +ddshi865 shift NaN5 +NaN6 -> NaN5 +ddshi866 shift -Inf NaN7 -> NaN7 +ddshi867 shift -1000 NaN8 -> NaN8 +ddshi868 shift 1000 NaN9 -> NaN9 +ddshi869 shift Inf +NaN10 -> NaN10 +ddshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation +ddshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation +ddshi873 shift sNaN13 1000 -> NaN13 Invalid_operation +ddshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation +ddshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation +ddshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation +ddshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation +ddshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation +ddshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation +ddshi880 shift Inf sNaN23 -> NaN23 Invalid_operation +ddshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation +ddshi882 shift -NaN26 NaN28 -> -NaN26 +ddshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation +ddshi884 shift 1000 -NaN30 -> -NaN30 +ddshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddSubtract.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddSubtract.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,629 @@ +------------------------------------------------------------------------ +-- ddSubtract.decTest -- decDouble subtraction -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests are for decDoubles only; all arguments are +-- representable in a decDouble +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- [first group are 'quick confidence check'] +ddsub001 subtract 0 0 -> '0' +ddsub002 subtract 1 1 -> '0' +ddsub003 subtract 1 2 -> '-1' +ddsub004 subtract 2 1 -> '1' +ddsub005 subtract 2 2 -> '0' +ddsub006 subtract 3 2 -> '1' +ddsub007 subtract 2 3 -> '-1' + +ddsub011 subtract -0 0 -> '-0' +ddsub012 subtract -1 1 -> '-2' +ddsub013 subtract -1 2 -> '-3' +ddsub014 subtract -2 1 -> '-3' +ddsub015 subtract -2 2 -> '-4' +ddsub016 subtract -3 2 -> '-5' +ddsub017 subtract -2 3 -> '-5' + +ddsub021 subtract 0 -0 -> '0' +ddsub022 subtract 1 -1 -> '2' +ddsub023 subtract 1 -2 -> '3' +ddsub024 subtract 2 -1 -> '3' +ddsub025 subtract 2 -2 -> '4' +ddsub026 subtract 3 -2 -> '5' +ddsub027 subtract 2 -3 -> '5' + +ddsub030 subtract 11 1 -> 10 +ddsub031 subtract 10 1 -> 9 +ddsub032 subtract 9 1 -> 8 +ddsub033 subtract 1 1 -> 0 +ddsub034 subtract 0 1 -> -1 +ddsub035 subtract -1 1 -> -2 +ddsub036 subtract -9 1 -> -10 +ddsub037 subtract -10 1 -> -11 +ddsub038 subtract -11 1 -> -12 + +ddsub040 subtract '5.75' '3.3' -> '2.45' +ddsub041 subtract '5' '-3' -> '8' +ddsub042 subtract '-5' '-3' -> '-2' +ddsub043 subtract '-7' '2.5' -> '-9.5' +ddsub044 subtract '0.7' '0.3' -> '0.4' +ddsub045 subtract '1.3' '0.3' -> '1.0' +ddsub046 subtract '1.25' '1.25' -> '0.00' + +ddsub050 subtract '1.23456789' '1.00000000' -> '0.23456789' +ddsub051 subtract '1.23456789' '1.00000089' -> '0.23456700' + +ddsub060 subtract '70' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded +ddsub061 subtract '700' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded +ddsub062 subtract '7000' '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded +ddsub063 subtract '70000' '10000e+16' -> '-9.999999999999993E+19' Rounded +ddsub064 subtract '700000' '10000e+16' -> '-9.999999999999930E+19' Rounded + -- symmetry: +ddsub065 subtract '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded +ddsub066 subtract '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded +ddsub067 subtract '10000e+16' '7000' -> '9.999999999999999E+19' Inexact Rounded +ddsub068 subtract '10000e+16' '70000' -> '9.999999999999993E+19' Rounded +ddsub069 subtract '10000e+16' '700000' -> '9.999999999999930E+19' Rounded + + -- some of the next group are really constructor tests +ddsub090 subtract '00.0' '0.0' -> '0.0' +ddsub091 subtract '00.0' '0.00' -> '0.00' +ddsub092 subtract '0.00' '00.0' -> '0.00' +ddsub093 subtract '00.0' '0.00' -> '0.00' +ddsub094 subtract '0.00' '00.0' -> '0.00' +ddsub095 subtract '3' '.3' -> '2.7' +ddsub096 subtract '3.' '.3' -> '2.7' +ddsub097 subtract '3.0' '.3' -> '2.7' +ddsub098 subtract '3.00' '.3' -> '2.70' +ddsub099 subtract '3' '3' -> '0' +ddsub100 subtract '3' '+3' -> '0' +ddsub101 subtract '3' '-3' -> '6' +ddsub102 subtract '3' '0.3' -> '2.7' +ddsub103 subtract '3.' '0.3' -> '2.7' +ddsub104 subtract '3.0' '0.3' -> '2.7' +ddsub105 subtract '3.00' '0.3' -> '2.70' +ddsub106 subtract '3' '3.0' -> '0.0' +ddsub107 subtract '3' '+3.0' -> '0.0' +ddsub108 subtract '3' '-3.0' -> '6.0' + +-- the above all from add; massaged and extended. Now some new ones... +-- [particularly important for comparisons] +-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7 +-- with input rounding. +ddsub120 subtract '10.23456784' '10.23456789' -> '-5E-8' +ddsub121 subtract '10.23456785' '10.23456789' -> '-4E-8' +ddsub122 subtract '10.23456786' '10.23456789' -> '-3E-8' +ddsub123 subtract '10.23456787' '10.23456789' -> '-2E-8' +ddsub124 subtract '10.23456788' '10.23456789' -> '-1E-8' +ddsub125 subtract '10.23456789' '10.23456789' -> '0E-8' +ddsub126 subtract '10.23456790' '10.23456789' -> '1E-8' +ddsub127 subtract '10.23456791' '10.23456789' -> '2E-8' +ddsub128 subtract '10.23456792' '10.23456789' -> '3E-8' +ddsub129 subtract '10.23456793' '10.23456789' -> '4E-8' +ddsub130 subtract '10.23456794' '10.23456789' -> '5E-8' +ddsub131 subtract '10.23456781' '10.23456786' -> '-5E-8' +ddsub132 subtract '10.23456782' '10.23456786' -> '-4E-8' +ddsub133 subtract '10.23456783' '10.23456786' -> '-3E-8' +ddsub134 subtract '10.23456784' '10.23456786' -> '-2E-8' +ddsub135 subtract '10.23456785' '10.23456786' -> '-1E-8' +ddsub136 subtract '10.23456786' '10.23456786' -> '0E-8' +ddsub137 subtract '10.23456787' '10.23456786' -> '1E-8' +ddsub138 subtract '10.23456788' '10.23456786' -> '2E-8' +ddsub139 subtract '10.23456789' '10.23456786' -> '3E-8' +ddsub140 subtract '10.23456790' '10.23456786' -> '4E-8' +ddsub141 subtract '10.23456791' '10.23456786' -> '5E-8' +ddsub142 subtract '1' '0.999999999' -> '1E-9' +ddsub143 subtract '0.999999999' '1' -> '-1E-9' +ddsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8' +ddsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8' +ddsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8' + +-- additional scaled arithmetic tests [0.97 problem] +ddsub160 subtract '0' '.1' -> '-0.1' +ddsub161 subtract '00' '.97983' -> '-0.97983' +ddsub162 subtract '0' '.9' -> '-0.9' +ddsub163 subtract '0' '0.102' -> '-0.102' +ddsub164 subtract '0' '.4' -> '-0.4' +ddsub165 subtract '0' '.307' -> '-0.307' +ddsub166 subtract '0' '.43822' -> '-0.43822' +ddsub167 subtract '0' '.911' -> '-0.911' +ddsub168 subtract '.0' '.02' -> '-0.02' +ddsub169 subtract '00' '.392' -> '-0.392' +ddsub170 subtract '0' '.26' -> '-0.26' +ddsub171 subtract '0' '0.51' -> '-0.51' +ddsub172 subtract '0' '.2234' -> '-0.2234' +ddsub173 subtract '0' '.2' -> '-0.2' +ddsub174 subtract '.0' '.0008' -> '-0.0008' +-- 0. on left +ddsub180 subtract '0.0' '-.1' -> '0.1' +ddsub181 subtract '0.00' '-.97983' -> '0.97983' +ddsub182 subtract '0.0' '-.9' -> '0.9' +ddsub183 subtract '0.0' '-0.102' -> '0.102' +ddsub184 subtract '0.0' '-.4' -> '0.4' +ddsub185 subtract '0.0' '-.307' -> '0.307' +ddsub186 subtract '0.0' '-.43822' -> '0.43822' +ddsub187 subtract '0.0' '-.911' -> '0.911' +ddsub188 subtract '0.0' '-.02' -> '0.02' +ddsub189 subtract '0.00' '-.392' -> '0.392' +ddsub190 subtract '0.0' '-.26' -> '0.26' +ddsub191 subtract '0.0' '-0.51' -> '0.51' +ddsub192 subtract '0.0' '-.2234' -> '0.2234' +ddsub193 subtract '0.0' '-.2' -> '0.2' +ddsub194 subtract '0.0' '-.0008' -> '0.0008' +-- negatives of same +ddsub200 subtract '0' '-.1' -> '0.1' +ddsub201 subtract '00' '-.97983' -> '0.97983' +ddsub202 subtract '0' '-.9' -> '0.9' +ddsub203 subtract '0' '-0.102' -> '0.102' +ddsub204 subtract '0' '-.4' -> '0.4' +ddsub205 subtract '0' '-.307' -> '0.307' +ddsub206 subtract '0' '-.43822' -> '0.43822' +ddsub207 subtract '0' '-.911' -> '0.911' +ddsub208 subtract '.0' '-.02' -> '0.02' +ddsub209 subtract '00' '-.392' -> '0.392' +ddsub210 subtract '0' '-.26' -> '0.26' +ddsub211 subtract '0' '-0.51' -> '0.51' +ddsub212 subtract '0' '-.2234' -> '0.2234' +ddsub213 subtract '0' '-.2' -> '0.2' +ddsub214 subtract '.0' '-.0008' -> '0.0008' + +-- more fixed, LHS swaps [really the same as testcases under add] +ddsub220 subtract '-56267E-12' 0 -> '-5.6267E-8' +ddsub221 subtract '-56267E-11' 0 -> '-5.6267E-7' +ddsub222 subtract '-56267E-10' 0 -> '-0.0000056267' +ddsub223 subtract '-56267E-9' 0 -> '-0.000056267' +ddsub224 subtract '-56267E-8' 0 -> '-0.00056267' +ddsub225 subtract '-56267E-7' 0 -> '-0.0056267' +ddsub226 subtract '-56267E-6' 0 -> '-0.056267' +ddsub227 subtract '-56267E-5' 0 -> '-0.56267' +ddsub228 subtract '-56267E-2' 0 -> '-562.67' +ddsub229 subtract '-56267E-1' 0 -> '-5626.7' +ddsub230 subtract '-56267E-0' 0 -> '-56267' +-- symmetry ... +ddsub240 subtract 0 '-56267E-12' -> '5.6267E-8' +ddsub241 subtract 0 '-56267E-11' -> '5.6267E-7' +ddsub242 subtract 0 '-56267E-10' -> '0.0000056267' +ddsub243 subtract 0 '-56267E-9' -> '0.000056267' +ddsub244 subtract 0 '-56267E-8' -> '0.00056267' +ddsub245 subtract 0 '-56267E-7' -> '0.0056267' +ddsub246 subtract 0 '-56267E-6' -> '0.056267' +ddsub247 subtract 0 '-56267E-5' -> '0.56267' +ddsub248 subtract 0 '-56267E-2' -> '562.67' +ddsub249 subtract 0 '-56267E-1' -> '5626.7' +ddsub250 subtract 0 '-56267E-0' -> '56267' + +-- now some more from the 'new' add +ddsub301 subtract '1.23456789' '1.00000000' -> '0.23456789' +ddsub302 subtract '1.23456789' '1.00000011' -> '0.23456778' + +-- some carrying effects +ddsub321 subtract '0.9998' '0.0000' -> '0.9998' +ddsub322 subtract '0.9998' '0.0001' -> '0.9997' +ddsub323 subtract '0.9998' '0.0002' -> '0.9996' +ddsub324 subtract '0.9998' '0.0003' -> '0.9995' +ddsub325 subtract '0.9998' '-0.0000' -> '0.9998' +ddsub326 subtract '0.9998' '-0.0001' -> '0.9999' +ddsub327 subtract '0.9998' '-0.0002' -> '1.0000' +ddsub328 subtract '0.9998' '-0.0003' -> '1.0001' + +-- internal boundaries +ddsub346 subtract '10000e+9' '7' -> '9999999999993' +ddsub347 subtract '10000e+9' '70' -> '9999999999930' +ddsub348 subtract '10000e+9' '700' -> '9999999999300' +ddsub349 subtract '10000e+9' '7000' -> '9999999993000' +ddsub350 subtract '10000e+9' '70000' -> '9999999930000' +ddsub351 subtract '10000e+9' '700000' -> '9999999300000' +ddsub352 subtract '7' '10000e+9' -> '-9999999999993' +ddsub353 subtract '70' '10000e+9' -> '-9999999999930' +ddsub354 subtract '700' '10000e+9' -> '-9999999999300' +ddsub355 subtract '7000' '10000e+9' -> '-9999999993000' +ddsub356 subtract '70000' '10000e+9' -> '-9999999930000' +ddsub357 subtract '700000' '10000e+9' -> '-9999999300000' + +-- zero preservation +ddsub361 subtract 1 '0.0001' -> '0.9999' +ddsub362 subtract 1 '0.00001' -> '0.99999' +ddsub363 subtract 1 '0.000001' -> '0.999999' +ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999' +ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded +ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +ddsub370 subtract 1 0 -> 1 +ddsub371 subtract 1 0. -> 1 +ddsub372 subtract 1 .0 -> 1.0 +ddsub373 subtract 1 0.0 -> 1.0 +ddsub374 subtract 0 1 -> -1 +ddsub375 subtract 0. 1 -> -1 +ddsub376 subtract .0 1 -> -1.0 +ddsub377 subtract 0.0 1 -> -1.0 + +-- leading 0 digit before round +ddsub910 subtract -103519362 -51897955.3 -> -51621406.7 +ddsub911 subtract 159579.444 89827.5229 -> 69751.9211 + +ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded +ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded +ddsub922 subtract 133.0000000123456 33.00000001234565 -> 99.99999999999995 +ddsub923 subtract 133.0000000123456 33.00000001234564 -> 99.99999999999996 +ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded +ddsub925 subtract 133.0000000123456 43.00000001234560 -> 90.00000000000000 +ddsub926 subtract 133.0000000123456 43.00000001234561 -> 89.99999999999999 +ddsub927 subtract 133.0000000123456 43.00000001234566 -> 89.99999999999994 +ddsub928 subtract 101.0000000123456 91.00000001234566 -> 9.99999999999994 +ddsub929 subtract 101.0000000123456 99.00000001234566 -> 1.99999999999994 + +-- more LHS swaps [were fixed] +ddsub390 subtract '-56267E-10' 0 -> '-0.0000056267' +ddsub391 subtract '-56267E-6' 0 -> '-0.056267' +ddsub392 subtract '-56267E-5' 0 -> '-0.56267' +ddsub393 subtract '-56267E-4' 0 -> '-5.6267' +ddsub394 subtract '-56267E-3' 0 -> '-56.267' +ddsub395 subtract '-56267E-2' 0 -> '-562.67' +ddsub396 subtract '-56267E-1' 0 -> '-5626.7' +ddsub397 subtract '-56267E-0' 0 -> '-56267' +ddsub398 subtract '-5E-10' 0 -> '-5E-10' +ddsub399 subtract '-5E-7' 0 -> '-5E-7' +ddsub400 subtract '-5E-6' 0 -> '-0.000005' +ddsub401 subtract '-5E-5' 0 -> '-0.00005' +ddsub402 subtract '-5E-4' 0 -> '-0.0005' +ddsub403 subtract '-5E-1' 0 -> '-0.5' +ddsub404 subtract '-5E0' 0 -> '-5' +ddsub405 subtract '-5E1' 0 -> '-50' +ddsub406 subtract '-5E5' 0 -> '-500000' +ddsub407 subtract '-5E15' 0 -> '-5000000000000000' +ddsub408 subtract '-5E16' 0 -> '-5.000000000000000E+16' Rounded +ddsub409 subtract '-5E17' 0 -> '-5.000000000000000E+17' Rounded +ddsub410 subtract '-5E18' 0 -> '-5.000000000000000E+18' Rounded +ddsub411 subtract '-5E100' 0 -> '-5.000000000000000E+100' Rounded + +-- more RHS swaps [were fixed] +ddsub420 subtract 0 '-56267E-10' -> '0.0000056267' +ddsub421 subtract 0 '-56267E-6' -> '0.056267' +ddsub422 subtract 0 '-56267E-5' -> '0.56267' +ddsub423 subtract 0 '-56267E-4' -> '5.6267' +ddsub424 subtract 0 '-56267E-3' -> '56.267' +ddsub425 subtract 0 '-56267E-2' -> '562.67' +ddsub426 subtract 0 '-56267E-1' -> '5626.7' +ddsub427 subtract 0 '-56267E-0' -> '56267' +ddsub428 subtract 0 '-5E-10' -> '5E-10' +ddsub429 subtract 0 '-5E-7' -> '5E-7' +ddsub430 subtract 0 '-5E-6' -> '0.000005' +ddsub431 subtract 0 '-5E-5' -> '0.00005' +ddsub432 subtract 0 '-5E-4' -> '0.0005' +ddsub433 subtract 0 '-5E-1' -> '0.5' +ddsub434 subtract 0 '-5E0' -> '5' +ddsub435 subtract 0 '-5E1' -> '50' +ddsub436 subtract 0 '-5E5' -> '500000' +ddsub437 subtract 0 '-5E15' -> '5000000000000000' +ddsub438 subtract 0 '-5E16' -> '5.000000000000000E+16' Rounded +ddsub439 subtract 0 '-5E17' -> '5.000000000000000E+17' Rounded +ddsub440 subtract 0 '-5E18' -> '5.000000000000000E+18' Rounded +ddsub441 subtract 0 '-5E100' -> '5.000000000000000E+100' Rounded + + +-- try borderline precision, with carries, etc. +ddsub461 subtract '1E+16' '1' -> '9999999999999999' +ddsub462 subtract '1E+12' '-1.111' -> '1000000000001.111' +ddsub463 subtract '1.111' '-1E+12' -> '1000000000001.111' +ddsub464 subtract '-1' '-1E+16' -> '9999999999999999' +ddsub465 subtract '7E+15' '1' -> '6999999999999999' +ddsub466 subtract '7E+12' '-1.111' -> '7000000000001.111' +ddsub467 subtract '1.111' '-7E+12' -> '7000000000001.111' +ddsub468 subtract '-1' '-7E+15' -> '6999999999999999' + +-- 1234567890123456 1234567890123456 1 23456789012345 +ddsub470 subtract '0.4444444444444444' '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded +ddsub471 subtract '0.4444444444444444' '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded +ddsub472 subtract '0.4444444444444444' '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded +ddsub473 subtract '0.4444444444444444' '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded +ddsub474 subtract '0.4444444444444444' '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded +ddsub475 subtract '0.4444444444444444' '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded +ddsub476 subtract '0.4444444444444444' '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded +ddsub477 subtract '0.4444444444444444' '-0.5555555555555556' -> '1.000000000000000' Rounded +ddsub478 subtract '0.4444444444444444' '-0.5555555555555555' -> '0.9999999999999999' +ddsub479 subtract '0.4444444444444444' '-0.5555555555555554' -> '0.9999999999999998' +ddsub480 subtract '0.4444444444444444' '-0.5555555555555553' -> '0.9999999999999997' +ddsub481 subtract '0.4444444444444444' '-0.5555555555555552' -> '0.9999999999999996' +ddsub482 subtract '0.4444444444444444' '-0.5555555555555551' -> '0.9999999999999995' +ddsub483 subtract '0.4444444444444444' '-0.5555555555555550' -> '0.9999999999999994' + +-- and some more, including residue effects and different roundings +rounding: half_up +ddsub500 subtract '1231234567456789' 0 -> '1231234567456789' +ddsub501 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded +ddsub502 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded +ddsub503 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded +ddsub504 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded +ddsub505 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded +ddsub506 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded +ddsub507 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded +ddsub508 subtract '1231234567456789' 0.5 -> '1231234567456789' Inexact Rounded +ddsub509 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded +ddsub510 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded +ddsub511 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded +ddsub512 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded +ddsub513 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded +ddsub514 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded +ddsub515 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded +ddsub516 subtract '1231234567456789' 1 -> '1231234567456788' +ddsub517 subtract '1231234567456789' 1.000000001 -> '1231234567456788' Inexact Rounded +ddsub518 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded +ddsub519 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded + +rounding: half_even +ddsub520 subtract '1231234567456789' 0 -> '1231234567456789' +ddsub521 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded +ddsub522 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded +ddsub523 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded +ddsub524 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded +ddsub525 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded +ddsub526 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded +ddsub527 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded +ddsub528 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded +ddsub529 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded +ddsub530 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded +ddsub531 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded +ddsub532 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded +ddsub533 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded +ddsub534 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded +ddsub535 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded +ddsub536 subtract '1231234567456789' 1 -> '1231234567456788' +ddsub537 subtract '1231234567456789' 1.00000001 -> '1231234567456788' Inexact Rounded +ddsub538 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded +ddsub539 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded +-- critical few with even bottom digit... +ddsub540 subtract '1231234567456788' 0.499999999 -> '1231234567456788' Inexact Rounded +ddsub541 subtract '1231234567456788' 0.5 -> '1231234567456788' Inexact Rounded +ddsub542 subtract '1231234567456788' 0.500000001 -> '1231234567456787' Inexact Rounded + +rounding: down +ddsub550 subtract '1231234567456789' 0 -> '1231234567456789' +ddsub551 subtract '1231234567456789' 0.000000001 -> '1231234567456788' Inexact Rounded +ddsub552 subtract '1231234567456789' 0.000001 -> '1231234567456788' Inexact Rounded +ddsub553 subtract '1231234567456789' 0.1 -> '1231234567456788' Inexact Rounded +ddsub554 subtract '1231234567456789' 0.4 -> '1231234567456788' Inexact Rounded +ddsub555 subtract '1231234567456789' 0.49 -> '1231234567456788' Inexact Rounded +ddsub556 subtract '1231234567456789' 0.499999 -> '1231234567456788' Inexact Rounded +ddsub557 subtract '1231234567456789' 0.499999999 -> '1231234567456788' Inexact Rounded +ddsub558 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded +ddsub559 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded +ddsub560 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded +ddsub561 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded +ddsub562 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded +ddsub563 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded +ddsub564 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded +ddsub565 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded +ddsub566 subtract '1231234567456789' 1 -> '1231234567456788' +ddsub567 subtract '1231234567456789' 1.00000001 -> '1231234567456787' Inexact Rounded +ddsub568 subtract '1231234567456789' 1.00001 -> '1231234567456787' Inexact Rounded +ddsub569 subtract '1231234567456789' 1.1 -> '1231234567456787' Inexact Rounded + +-- symmetry... +rounding: half_up +ddsub600 subtract 0 '1231234567456789' -> '-1231234567456789' +ddsub601 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub602 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub603 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub604 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub605 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub606 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub607 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub608 subtract 0.5 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub609 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub610 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub611 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub612 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub613 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub614 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub615 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub616 subtract 1 '1231234567456789' -> '-1231234567456788' +ddsub617 subtract 1.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub618 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub619 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded + +rounding: half_even +ddsub620 subtract 0 '1231234567456789' -> '-1231234567456789' +ddsub621 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub622 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub623 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub624 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub625 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub626 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub627 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded +ddsub628 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub629 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub630 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub631 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub632 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub633 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub634 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub635 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub636 subtract 1 '1231234567456789' -> '-1231234567456788' +ddsub637 subtract 1.00000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub638 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub639 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded +-- critical few with even bottom digit... +ddsub640 subtract 0.499999999 '1231234567456788' -> '-1231234567456788' Inexact Rounded +ddsub641 subtract 0.5 '1231234567456788' -> '-1231234567456788' Inexact Rounded +ddsub642 subtract 0.500000001 '1231234567456788' -> '-1231234567456787' Inexact Rounded + +rounding: down +ddsub650 subtract 0 '1231234567456789' -> '-1231234567456789' +ddsub651 subtract 0.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub652 subtract 0.000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub653 subtract 0.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub654 subtract 0.4 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub655 subtract 0.49 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub656 subtract 0.499999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub657 subtract 0.499999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub658 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub659 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub660 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub661 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub662 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub663 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub664 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub665 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded +ddsub666 subtract 1 '1231234567456789' -> '-1231234567456788' +ddsub667 subtract 1.00000001 '1231234567456789' -> '-1231234567456787' Inexact Rounded +ddsub668 subtract 1.00001 '1231234567456789' -> '-1231234567456787' Inexact Rounded +ddsub669 subtract 1.1 '1231234567456789' -> '-1231234567456787' Inexact Rounded + + +-- lots of leading zeros in intermediate result, and showing effects of +-- input rounding would have affected the following +rounding: half_up +ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9 +ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1 +ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1 +ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5 +ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9 + +rounding: half_even +ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9 +ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1 +ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1 +ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5 +ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9 + +ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9 +ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1 +ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1 +ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5 +ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9 + +rounding: down +ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9 +ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1 +ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1 +ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5 +ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9 + +-- Specials +ddsub780 subtract -Inf Inf -> -Infinity +ddsub781 subtract -Inf 1000 -> -Infinity +ddsub782 subtract -Inf 1 -> -Infinity +ddsub783 subtract -Inf -0 -> -Infinity +ddsub784 subtract -Inf -1 -> -Infinity +ddsub785 subtract -Inf -1000 -> -Infinity +ddsub787 subtract -1000 Inf -> -Infinity +ddsub788 subtract -Inf Inf -> -Infinity +ddsub789 subtract -1 Inf -> -Infinity +ddsub790 subtract 0 Inf -> -Infinity +ddsub791 subtract 1 Inf -> -Infinity +ddsub792 subtract 1000 Inf -> -Infinity + +ddsub800 subtract Inf Inf -> NaN Invalid_operation +ddsub801 subtract Inf 1000 -> Infinity +ddsub802 subtract Inf 1 -> Infinity +ddsub803 subtract Inf 0 -> Infinity +ddsub804 subtract Inf -0 -> Infinity +ddsub805 subtract Inf -1 -> Infinity +ddsub806 subtract Inf -1000 -> Infinity +ddsub807 subtract Inf -Inf -> Infinity +ddsub808 subtract -1000 -Inf -> Infinity +ddsub809 subtract -Inf -Inf -> NaN Invalid_operation +ddsub810 subtract -1 -Inf -> Infinity +ddsub811 subtract -0 -Inf -> Infinity +ddsub812 subtract 0 -Inf -> Infinity +ddsub813 subtract 1 -Inf -> Infinity +ddsub814 subtract 1000 -Inf -> Infinity +ddsub815 subtract Inf -Inf -> Infinity + +ddsub821 subtract NaN Inf -> NaN +ddsub822 subtract -NaN 1000 -> -NaN +ddsub823 subtract NaN 1 -> NaN +ddsub824 subtract NaN 0 -> NaN +ddsub825 subtract NaN -0 -> NaN +ddsub826 subtract NaN -1 -> NaN +ddsub827 subtract NaN -1000 -> NaN +ddsub828 subtract NaN -Inf -> NaN +ddsub829 subtract -NaN NaN -> -NaN +ddsub830 subtract -Inf NaN -> NaN +ddsub831 subtract -1000 NaN -> NaN +ddsub832 subtract -1 NaN -> NaN +ddsub833 subtract -0 NaN -> NaN +ddsub834 subtract 0 NaN -> NaN +ddsub835 subtract 1 NaN -> NaN +ddsub836 subtract 1000 -NaN -> -NaN +ddsub837 subtract Inf NaN -> NaN + +ddsub841 subtract sNaN Inf -> NaN Invalid_operation +ddsub842 subtract -sNaN 1000 -> -NaN Invalid_operation +ddsub843 subtract sNaN 1 -> NaN Invalid_operation +ddsub844 subtract sNaN 0 -> NaN Invalid_operation +ddsub845 subtract sNaN -0 -> NaN Invalid_operation +ddsub846 subtract sNaN -1 -> NaN Invalid_operation +ddsub847 subtract sNaN -1000 -> NaN Invalid_operation +ddsub848 subtract sNaN NaN -> NaN Invalid_operation +ddsub849 subtract sNaN sNaN -> NaN Invalid_operation +ddsub850 subtract NaN sNaN -> NaN Invalid_operation +ddsub851 subtract -Inf -sNaN -> -NaN Invalid_operation +ddsub852 subtract -1000 sNaN -> NaN Invalid_operation +ddsub853 subtract -1 sNaN -> NaN Invalid_operation +ddsub854 subtract -0 sNaN -> NaN Invalid_operation +ddsub855 subtract 0 sNaN -> NaN Invalid_operation +ddsub856 subtract 1 sNaN -> NaN Invalid_operation +ddsub857 subtract 1000 sNaN -> NaN Invalid_operation +ddsub858 subtract Inf sNaN -> NaN Invalid_operation +ddsub859 subtract NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddsub861 subtract NaN01 -Inf -> NaN1 +ddsub862 subtract -NaN02 -1000 -> -NaN2 +ddsub863 subtract NaN03 1000 -> NaN3 +ddsub864 subtract NaN04 Inf -> NaN4 +ddsub865 subtract NaN05 NaN61 -> NaN5 +ddsub866 subtract -Inf -NaN71 -> -NaN71 +ddsub867 subtract -1000 NaN81 -> NaN81 +ddsub868 subtract 1000 NaN91 -> NaN91 +ddsub869 subtract Inf NaN101 -> NaN101 +ddsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation +ddsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation +ddsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation +ddsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation +ddsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation +ddsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation +ddsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation +ddsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation +ddsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation +ddsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation +ddsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation + +-- edge case spills +ddsub901 subtract 2.E-3 1.002 -> -1.000 +ddsub902 subtract 2.0E-3 1.002 -> -1.0000 +ddsub903 subtract 2.00E-3 1.0020 -> -1.00000 +ddsub904 subtract 2.000E-3 1.00200 -> -1.000000 +ddsub905 subtract 2.0000E-3 1.002000 -> -1.0000000 +ddsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000 +ddsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000 +ddsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000 + +-- subnormals and overflows covered under Add + +-- Null tests +ddsub9990 subtract 10 # -> NaN Invalid_operation +ddsub9991 subtract # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddToIntegral.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddToIntegral.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,257 @@ +------------------------------------------------------------------------ +-- ddToIntegral.decTest -- round Double to integral value -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests tests the extended specification 'round-to-integral +-- value-exact' operations (from IEEE 854, later modified in 754r). +-- All non-zero results are defined as being those from either copy or +-- quantize, so those are assumed to have been tested extensively +-- elsewhere; the tests here are for integrity, rounding mode, etc. +-- Also, it is assumed the test harness will use these tests for both +-- ToIntegralExact (which does set Inexact) and the fixed-name +-- functions (which do not set Inexact). + +-- Note that decNumber implements an earlier definition of toIntegral +-- which never sets Inexact; the decTest operator for that is called +-- 'tointegral' instead of 'tointegralx'. + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +ddintx001 tointegralx 0 -> 0 +ddintx002 tointegralx 0.0 -> 0 +ddintx003 tointegralx 0.1 -> 0 Inexact Rounded +ddintx004 tointegralx 0.2 -> 0 Inexact Rounded +ddintx005 tointegralx 0.3 -> 0 Inexact Rounded +ddintx006 tointegralx 0.4 -> 0 Inexact Rounded +ddintx007 tointegralx 0.5 -> 0 Inexact Rounded +ddintx008 tointegralx 0.6 -> 1 Inexact Rounded +ddintx009 tointegralx 0.7 -> 1 Inexact Rounded +ddintx010 tointegralx 0.8 -> 1 Inexact Rounded +ddintx011 tointegralx 0.9 -> 1 Inexact Rounded +ddintx012 tointegralx 1 -> 1 +ddintx013 tointegralx 1.0 -> 1 Rounded +ddintx014 tointegralx 1.1 -> 1 Inexact Rounded +ddintx015 tointegralx 1.2 -> 1 Inexact Rounded +ddintx016 tointegralx 1.3 -> 1 Inexact Rounded +ddintx017 tointegralx 1.4 -> 1 Inexact Rounded +ddintx018 tointegralx 1.5 -> 2 Inexact Rounded +ddintx019 tointegralx 1.6 -> 2 Inexact Rounded +ddintx020 tointegralx 1.7 -> 2 Inexact Rounded +ddintx021 tointegralx 1.8 -> 2 Inexact Rounded +ddintx022 tointegralx 1.9 -> 2 Inexact Rounded +-- negatives +ddintx031 tointegralx -0 -> -0 +ddintx032 tointegralx -0.0 -> -0 +ddintx033 tointegralx -0.1 -> -0 Inexact Rounded +ddintx034 tointegralx -0.2 -> -0 Inexact Rounded +ddintx035 tointegralx -0.3 -> -0 Inexact Rounded +ddintx036 tointegralx -0.4 -> -0 Inexact Rounded +ddintx037 tointegralx -0.5 -> -0 Inexact Rounded +ddintx038 tointegralx -0.6 -> -1 Inexact Rounded +ddintx039 tointegralx -0.7 -> -1 Inexact Rounded +ddintx040 tointegralx -0.8 -> -1 Inexact Rounded +ddintx041 tointegralx -0.9 -> -1 Inexact Rounded +ddintx042 tointegralx -1 -> -1 +ddintx043 tointegralx -1.0 -> -1 Rounded +ddintx044 tointegralx -1.1 -> -1 Inexact Rounded +ddintx045 tointegralx -1.2 -> -1 Inexact Rounded +ddintx046 tointegralx -1.3 -> -1 Inexact Rounded +ddintx047 tointegralx -1.4 -> -1 Inexact Rounded +ddintx048 tointegralx -1.5 -> -2 Inexact Rounded +ddintx049 tointegralx -1.6 -> -2 Inexact Rounded +ddintx050 tointegralx -1.7 -> -2 Inexact Rounded +ddintx051 tointegralx -1.8 -> -2 Inexact Rounded +ddintx052 tointegralx -1.9 -> -2 Inexact Rounded +-- next two would be NaN using quantize(x, 0) +ddintx053 tointegralx 10E+60 -> 1.0E+61 +ddintx054 tointegralx -10E+60 -> -1.0E+61 + +-- numbers around precision +ddintx060 tointegralx '56267E-17' -> '0' Inexact Rounded +ddintx061 tointegralx '56267E-5' -> '1' Inexact Rounded +ddintx062 tointegralx '56267E-2' -> '563' Inexact Rounded +ddintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded +ddintx065 tointegralx '56267E-0' -> '56267' +ddintx066 tointegralx '56267E+0' -> '56267' +ddintx067 tointegralx '56267E+1' -> '5.6267E+5' +ddintx068 tointegralx '56267E+9' -> '5.6267E+13' +ddintx069 tointegralx '56267E+10' -> '5.6267E+14' +ddintx070 tointegralx '56267E+11' -> '5.6267E+15' +ddintx071 tointegralx '56267E+12' -> '5.6267E+16' +ddintx072 tointegralx '56267E+13' -> '5.6267E+17' +ddintx073 tointegralx '1.23E+96' -> '1.23E+96' +ddintx074 tointegralx '1.23E+384' -> #47fd300000000000 Clamped + +ddintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded +ddintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded +ddintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded +ddintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded +ddintx085 tointegralx '-56267E-0' -> '-56267' +ddintx086 tointegralx '-56267E+0' -> '-56267' +ddintx087 tointegralx '-56267E+1' -> '-5.6267E+5' +ddintx088 tointegralx '-56267E+9' -> '-5.6267E+13' +ddintx089 tointegralx '-56267E+10' -> '-5.6267E+14' +ddintx090 tointegralx '-56267E+11' -> '-5.6267E+15' +ddintx091 tointegralx '-56267E+12' -> '-5.6267E+16' +ddintx092 tointegralx '-56267E+13' -> '-5.6267E+17' +ddintx093 tointegralx '-1.23E+96' -> '-1.23E+96' +ddintx094 tointegralx '-1.23E+384' -> #c7fd300000000000 Clamped + +-- subnormal inputs +ddintx100 tointegralx 1E-299 -> 0 Inexact Rounded +ddintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded +ddintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded +ddintx103 tointegralx 0E-299 -> 0 + +-- specials and zeros +ddintx120 tointegralx 'Inf' -> Infinity +ddintx121 tointegralx '-Inf' -> -Infinity +ddintx122 tointegralx NaN -> NaN +ddintx123 tointegralx sNaN -> NaN Invalid_operation +ddintx124 tointegralx 0 -> 0 +ddintx125 tointegralx -0 -> -0 +ddintx126 tointegralx 0.000 -> 0 +ddintx127 tointegralx 0.00 -> 0 +ddintx128 tointegralx 0.0 -> 0 +ddintx129 tointegralx 0 -> 0 +ddintx130 tointegralx 0E-3 -> 0 +ddintx131 tointegralx 0E-2 -> 0 +ddintx132 tointegralx 0E-1 -> 0 +ddintx133 tointegralx 0E-0 -> 0 +ddintx134 tointegralx 0E+1 -> 0E+1 +ddintx135 tointegralx 0E+2 -> 0E+2 +ddintx136 tointegralx 0E+3 -> 0E+3 +ddintx137 tointegralx 0E+4 -> 0E+4 +ddintx138 tointegralx 0E+5 -> 0E+5 +ddintx139 tointegralx -0.000 -> -0 +ddintx140 tointegralx -0.00 -> -0 +ddintx141 tointegralx -0.0 -> -0 +ddintx142 tointegralx -0 -> -0 +ddintx143 tointegralx -0E-3 -> -0 +ddintx144 tointegralx -0E-2 -> -0 +ddintx145 tointegralx -0E-1 -> -0 +ddintx146 tointegralx -0E-0 -> -0 +ddintx147 tointegralx -0E+1 -> -0E+1 +ddintx148 tointegralx -0E+2 -> -0E+2 +ddintx149 tointegralx -0E+3 -> -0E+3 +ddintx150 tointegralx -0E+4 -> -0E+4 +ddintx151 tointegralx -0E+5 -> -0E+5 +-- propagating NaNs +ddintx152 tointegralx NaN808 -> NaN808 +ddintx153 tointegralx sNaN080 -> NaN80 Invalid_operation +ddintx154 tointegralx -NaN808 -> -NaN808 +ddintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation +ddintx156 tointegralx -NaN -> -NaN +ddintx157 tointegralx -sNaN -> -NaN Invalid_operation + +-- examples +rounding: half_up +ddintx200 tointegralx 2.1 -> 2 Inexact Rounded +ddintx201 tointegralx 100 -> 100 +ddintx202 tointegralx 100.0 -> 100 Rounded +ddintx203 tointegralx 101.5 -> 102 Inexact Rounded +ddintx204 tointegralx -101.5 -> -102 Inexact Rounded +ddintx205 tointegralx 10E+5 -> 1.0E+6 +ddintx206 tointegralx 7.89E+77 -> 7.89E+77 +ddintx207 tointegralx -Inf -> -Infinity + + +-- all rounding modes +rounding: half_even +ddintx210 tointegralx 55.5 -> 56 Inexact Rounded +ddintx211 tointegralx 56.5 -> 56 Inexact Rounded +ddintx212 tointegralx 57.5 -> 58 Inexact Rounded +ddintx213 tointegralx -55.5 -> -56 Inexact Rounded +ddintx214 tointegralx -56.5 -> -56 Inexact Rounded +ddintx215 tointegralx -57.5 -> -58 Inexact Rounded + +rounding: half_up + +ddintx220 tointegralx 55.5 -> 56 Inexact Rounded +ddintx221 tointegralx 56.5 -> 57 Inexact Rounded +ddintx222 tointegralx 57.5 -> 58 Inexact Rounded +ddintx223 tointegralx -55.5 -> -56 Inexact Rounded +ddintx224 tointegralx -56.5 -> -57 Inexact Rounded +ddintx225 tointegralx -57.5 -> -58 Inexact Rounded + +rounding: half_down + +ddintx230 tointegralx 55.5 -> 55 Inexact Rounded +ddintx231 tointegralx 56.5 -> 56 Inexact Rounded +ddintx232 tointegralx 57.5 -> 57 Inexact Rounded +ddintx233 tointegralx -55.5 -> -55 Inexact Rounded +ddintx234 tointegralx -56.5 -> -56 Inexact Rounded +ddintx235 tointegralx -57.5 -> -57 Inexact Rounded + +rounding: up + +ddintx240 tointegralx 55.3 -> 56 Inexact Rounded +ddintx241 tointegralx 56.3 -> 57 Inexact Rounded +ddintx242 tointegralx 57.3 -> 58 Inexact Rounded +ddintx243 tointegralx -55.3 -> -56 Inexact Rounded +ddintx244 tointegralx -56.3 -> -57 Inexact Rounded +ddintx245 tointegralx -57.3 -> -58 Inexact Rounded + +rounding: down + +ddintx250 tointegralx 55.7 -> 55 Inexact Rounded +ddintx251 tointegralx 56.7 -> 56 Inexact Rounded +ddintx252 tointegralx 57.7 -> 57 Inexact Rounded +ddintx253 tointegralx -55.7 -> -55 Inexact Rounded +ddintx254 tointegralx -56.7 -> -56 Inexact Rounded +ddintx255 tointegralx -57.7 -> -57 Inexact Rounded + +rounding: ceiling + +ddintx260 tointegralx 55.3 -> 56 Inexact Rounded +ddintx261 tointegralx 56.3 -> 57 Inexact Rounded +ddintx262 tointegralx 57.3 -> 58 Inexact Rounded +ddintx263 tointegralx -55.3 -> -55 Inexact Rounded +ddintx264 tointegralx -56.3 -> -56 Inexact Rounded +ddintx265 tointegralx -57.3 -> -57 Inexact Rounded + +rounding: floor + +ddintx270 tointegralx 55.7 -> 55 Inexact Rounded +ddintx271 tointegralx 56.7 -> 56 Inexact Rounded +ddintx272 tointegralx 57.7 -> 57 Inexact Rounded +ddintx273 tointegralx -55.7 -> -56 Inexact Rounded +ddintx274 tointegralx -56.7 -> -57 Inexact Rounded +ddintx275 tointegralx -57.7 -> -58 Inexact Rounded + +-- Int and uInt32 edge values for testing conversions +ddintx300 tointegralx -2147483646 -> -2147483646 +ddintx301 tointegralx -2147483647 -> -2147483647 +ddintx302 tointegralx -2147483648 -> -2147483648 +ddintx303 tointegralx -2147483649 -> -2147483649 +ddintx304 tointegralx 2147483646 -> 2147483646 +ddintx305 tointegralx 2147483647 -> 2147483647 +ddintx306 tointegralx 2147483648 -> 2147483648 +ddintx307 tointegralx 2147483649 -> 2147483649 +ddintx308 tointegralx 4294967294 -> 4294967294 +ddintx309 tointegralx 4294967295 -> 4294967295 +ddintx310 tointegralx 4294967296 -> 4294967296 +ddintx311 tointegralx 4294967297 -> 4294967297 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddXor.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ddXor.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,337 @@ +------------------------------------------------------------------------ +-- ddXor.decTest -- digitwise logical XOR for decDoubles -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +precision: 16 +maxExponent: 384 +minExponent: -383 +extended: 1 +clamp: 1 +rounding: half_even + +-- Sanity check (truth table) +ddxor001 xor 0 0 -> 0 +ddxor002 xor 0 1 -> 1 +ddxor003 xor 1 0 -> 1 +ddxor004 xor 1 1 -> 0 +ddxor005 xor 1100 1010 -> 110 +-- and at msd and msd-1 +ddxor006 xor 0000000000000000 0000000000000000 -> 0 +ddxor007 xor 0000000000000000 1000000000000000 -> 1000000000000000 +ddxor008 xor 1000000000000000 0000000000000000 -> 1000000000000000 +ddxor009 xor 1000000000000000 1000000000000000 -> 0 +ddxor010 xor 0000000000000000 0000000000000000 -> 0 +ddxor011 xor 0000000000000000 0100000000000000 -> 100000000000000 +ddxor012 xor 0100000000000000 0000000000000000 -> 100000000000000 +ddxor013 xor 0100000000000000 0100000000000000 -> 0 + +-- Various lengths +-- 1234567890123456 1234567890123456 1234567890123456 +ddxor021 xor 1111111110000000 1111111110000000 -> 0 +ddxor022 xor 111111110000000 111111110000000 -> 0 +ddxor023 xor 11111110000000 11111110000000 -> 0 +ddxor024 xor 1111110000000 1111110000000 -> 0 +ddxor025 xor 111110000000 111110000000 -> 0 +ddxor026 xor 11110000000 11110000000 -> 0 +ddxor027 xor 1110000000 1110000000 -> 0 +ddxor028 xor 110000000 110000000 -> 0 +ddxor029 xor 10000000 10000000 -> 0 +ddxor030 xor 1000000 1000000 -> 0 +ddxor031 xor 100000 100000 -> 0 +ddxor032 xor 10000 10000 -> 0 +ddxor033 xor 1000 1000 -> 0 +ddxor034 xor 100 100 -> 0 +ddxor035 xor 10 10 -> 0 +ddxor036 xor 1 1 -> 0 + +ddxor040 xor 111111111 111111111111 -> 111000000000 +ddxor041 xor 11111111 111111111111 -> 111100000000 +ddxor042 xor 11111111 111111111 -> 100000000 +ddxor043 xor 1111111 100000010 -> 101111101 +ddxor044 xor 111111 100000100 -> 100111011 +ddxor045 xor 11111 100001000 -> 100010111 +ddxor046 xor 1111 100010000 -> 100011111 +ddxor047 xor 111 100100000 -> 100100111 +ddxor048 xor 11 101000000 -> 101000011 +ddxor049 xor 1 110000000 -> 110000001 + +ddxor050 xor 1111111111 1 -> 1111111110 +ddxor051 xor 111111111 1 -> 111111110 +ddxor052 xor 11111111 1 -> 11111110 +ddxor053 xor 1111111 1 -> 1111110 +ddxor054 xor 111111 1 -> 111110 +ddxor055 xor 11111 1 -> 11110 +ddxor056 xor 1111 1 -> 1110 +ddxor057 xor 111 1 -> 110 +ddxor058 xor 11 1 -> 10 +ddxor059 xor 1 1 -> 0 + +ddxor060 xor 1111111111 0 -> 1111111111 +ddxor061 xor 111111111 0 -> 111111111 +ddxor062 xor 11111111 0 -> 11111111 +ddxor063 xor 1111111 0 -> 1111111 +ddxor064 xor 111111 0 -> 111111 +ddxor065 xor 11111 0 -> 11111 +ddxor066 xor 1111 0 -> 1111 +ddxor067 xor 111 0 -> 111 +ddxor068 xor 11 0 -> 11 +ddxor069 xor 1 0 -> 1 + +ddxor070 xor 1 1111111111 -> 1111111110 +ddxor071 xor 1 111111111 -> 111111110 +ddxor072 xor 1 11111111 -> 11111110 +ddxor073 xor 1 1111111 -> 1111110 +ddxor074 xor 1 111111 -> 111110 +ddxor075 xor 1 11111 -> 11110 +ddxor076 xor 1 1111 -> 1110 +ddxor077 xor 1 111 -> 110 +ddxor078 xor 1 11 -> 10 +ddxor079 xor 1 1 -> 0 + +ddxor080 xor 0 1111111111 -> 1111111111 +ddxor081 xor 0 111111111 -> 111111111 +ddxor082 xor 0 11111111 -> 11111111 +ddxor083 xor 0 1111111 -> 1111111 +ddxor084 xor 0 111111 -> 111111 +ddxor085 xor 0 11111 -> 11111 +ddxor086 xor 0 1111 -> 1111 +ddxor087 xor 0 111 -> 111 +ddxor088 xor 0 11 -> 11 +ddxor089 xor 0 1 -> 1 + +ddxor090 xor 011111111 111101111 -> 100010000 +ddxor091 xor 101111111 111101111 -> 10010000 +ddxor092 xor 110111111 111101111 -> 1010000 +ddxor093 xor 111011111 111101111 -> 110000 +ddxor094 xor 111101111 111101111 -> 0 +ddxor095 xor 111110111 111101111 -> 11000 +ddxor096 xor 111111011 111101111 -> 10100 +ddxor097 xor 111111101 111101111 -> 10010 +ddxor098 xor 111111110 111101111 -> 10001 + +ddxor100 xor 111101111 011111111 -> 100010000 +ddxor101 xor 111101111 101111111 -> 10010000 +ddxor102 xor 111101111 110111111 -> 1010000 +ddxor103 xor 111101111 111011111 -> 110000 +ddxor104 xor 111101111 111101111 -> 0 +ddxor105 xor 111101111 111110111 -> 11000 +ddxor106 xor 111101111 111111011 -> 10100 +ddxor107 xor 111101111 111111101 -> 10010 +ddxor108 xor 111101111 111111110 -> 10001 + +-- non-0/1 should not be accepted, nor should signs +ddxor220 xor 111111112 111111111 -> NaN Invalid_operation +ddxor221 xor 333333333 333333333 -> NaN Invalid_operation +ddxor222 xor 555555555 555555555 -> NaN Invalid_operation +ddxor223 xor 777777777 777777777 -> NaN Invalid_operation +ddxor224 xor 999999999 999999999 -> NaN Invalid_operation +ddxor225 xor 222222222 999999999 -> NaN Invalid_operation +ddxor226 xor 444444444 999999999 -> NaN Invalid_operation +ddxor227 xor 666666666 999999999 -> NaN Invalid_operation +ddxor228 xor 888888888 999999999 -> NaN Invalid_operation +ddxor229 xor 999999999 222222222 -> NaN Invalid_operation +ddxor230 xor 999999999 444444444 -> NaN Invalid_operation +ddxor231 xor 999999999 666666666 -> NaN Invalid_operation +ddxor232 xor 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +ddxor240 xor 567468689 -934981942 -> NaN Invalid_operation +ddxor241 xor 567367689 934981942 -> NaN Invalid_operation +ddxor242 xor -631917772 -706014634 -> NaN Invalid_operation +ddxor243 xor -756253257 138579234 -> NaN Invalid_operation +ddxor244 xor 835590149 567435400 -> NaN Invalid_operation +-- test MSD +ddxor250 xor 2000000000000000 1000000000000000 -> NaN Invalid_operation +ddxor251 xor 7000000000000000 1000000000000000 -> NaN Invalid_operation +ddxor252 xor 8000000000000000 1000000000000000 -> NaN Invalid_operation +ddxor253 xor 9000000000000000 1000000000000000 -> NaN Invalid_operation +ddxor254 xor 2000000000000000 0000000000000000 -> NaN Invalid_operation +ddxor255 xor 7000000000000000 0000000000000000 -> NaN Invalid_operation +ddxor256 xor 8000000000000000 0000000000000000 -> NaN Invalid_operation +ddxor257 xor 9000000000000000 0000000000000000 -> NaN Invalid_operation +ddxor258 xor 1000000000000000 2000000000000000 -> NaN Invalid_operation +ddxor259 xor 1000000000000000 7000000000000000 -> NaN Invalid_operation +ddxor260 xor 1000000000000000 8000000000000000 -> NaN Invalid_operation +ddxor261 xor 1000000000000000 9000000000000000 -> NaN Invalid_operation +ddxor262 xor 0000000000000000 2000000000000000 -> NaN Invalid_operation +ddxor263 xor 0000000000000000 7000000000000000 -> NaN Invalid_operation +ddxor264 xor 0000000000000000 8000000000000000 -> NaN Invalid_operation +ddxor265 xor 0000000000000000 9000000000000000 -> NaN Invalid_operation +-- test MSD-1 +ddxor270 xor 0200001000000000 1000100000000010 -> NaN Invalid_operation +ddxor271 xor 0700000100000000 1000010000000100 -> NaN Invalid_operation +ddxor272 xor 0800000010000000 1000001000001000 -> NaN Invalid_operation +ddxor273 xor 0900000001000000 1000000100010000 -> NaN Invalid_operation +ddxor274 xor 1000000000100000 0200000010100000 -> NaN Invalid_operation +ddxor275 xor 1000000000010000 0700000001000000 -> NaN Invalid_operation +ddxor276 xor 1000000000001000 0800000010100000 -> NaN Invalid_operation +ddxor277 xor 1000000000000100 0900000000010000 -> NaN Invalid_operation +-- test LSD +ddxor280 xor 0010000000000002 1000000100000001 -> NaN Invalid_operation +ddxor281 xor 0001000000000007 1000001000000011 -> NaN Invalid_operation +ddxor282 xor 0000100000000008 1000010000000001 -> NaN Invalid_operation +ddxor283 xor 0000010000000009 1000100000000001 -> NaN Invalid_operation +ddxor284 xor 1000001000000000 0001000000000002 -> NaN Invalid_operation +ddxor285 xor 1000000100000000 0010000000000007 -> NaN Invalid_operation +ddxor286 xor 1000000010000000 0100000000000008 -> NaN Invalid_operation +ddxor287 xor 1000000001000000 1000000000000009 -> NaN Invalid_operation +-- test Middie +ddxor288 xor 0010000020000000 1000001000000000 -> NaN Invalid_operation +ddxor289 xor 0001000070000001 1000000100000000 -> NaN Invalid_operation +ddxor290 xor 0000100080000010 1000000010000000 -> NaN Invalid_operation +ddxor291 xor 0000010090000100 1000000001000000 -> NaN Invalid_operation +ddxor292 xor 1000001000001000 0000000020100000 -> NaN Invalid_operation +ddxor293 xor 1000000100010000 0000000070010000 -> NaN Invalid_operation +ddxor294 xor 1000000010100000 0000000080001000 -> NaN Invalid_operation +ddxor295 xor 1000000001000000 0000000090000100 -> NaN Invalid_operation +-- signs +ddxor296 xor -1000000001000000 -0000010000000100 -> NaN Invalid_operation +ddxor297 xor -1000000001000000 0000000010000100 -> NaN Invalid_operation +ddxor298 xor 1000000001000000 -0000001000000100 -> NaN Invalid_operation +ddxor299 xor 1000000001000000 0000000011000100 -> 1000000010000100 + +-- Nmax, Nmin, Ntiny-like +ddxor331 xor 2 9.99999999E+299 -> NaN Invalid_operation +ddxor332 xor 3 1E-299 -> NaN Invalid_operation +ddxor333 xor 4 1.00000000E-299 -> NaN Invalid_operation +ddxor334 xor 5 1E-200 -> NaN Invalid_operation +ddxor335 xor 6 -1E-200 -> NaN Invalid_operation +ddxor336 xor 7 -1.00000000E-299 -> NaN Invalid_operation +ddxor337 xor 8 -1E-299 -> NaN Invalid_operation +ddxor338 xor 9 -9.99999999E+299 -> NaN Invalid_operation +ddxor341 xor 9.99999999E+299 -18 -> NaN Invalid_operation +ddxor342 xor 1E-299 01 -> NaN Invalid_operation +ddxor343 xor 1.00000000E-299 -18 -> NaN Invalid_operation +ddxor344 xor 1E-208 18 -> NaN Invalid_operation +ddxor345 xor -1E-207 -10 -> NaN Invalid_operation +ddxor346 xor -1.00000000E-299 18 -> NaN Invalid_operation +ddxor347 xor -1E-299 10 -> NaN Invalid_operation +ddxor348 xor -9.99999999E+299 -18 -> NaN Invalid_operation + +-- A few other non-integers +ddxor361 xor 1.0 1 -> NaN Invalid_operation +ddxor362 xor 1E+1 1 -> NaN Invalid_operation +ddxor363 xor 0.0 1 -> NaN Invalid_operation +ddxor364 xor 0E+1 1 -> NaN Invalid_operation +ddxor365 xor 9.9 1 -> NaN Invalid_operation +ddxor366 xor 9E+1 1 -> NaN Invalid_operation +ddxor371 xor 0 1.0 -> NaN Invalid_operation +ddxor372 xor 0 1E+1 -> NaN Invalid_operation +ddxor373 xor 0 0.0 -> NaN Invalid_operation +ddxor374 xor 0 0E+1 -> NaN Invalid_operation +ddxor375 xor 0 9.9 -> NaN Invalid_operation +ddxor376 xor 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +ddxor780 xor -Inf -Inf -> NaN Invalid_operation +ddxor781 xor -Inf -1000 -> NaN Invalid_operation +ddxor782 xor -Inf -1 -> NaN Invalid_operation +ddxor783 xor -Inf -0 -> NaN Invalid_operation +ddxor784 xor -Inf 0 -> NaN Invalid_operation +ddxor785 xor -Inf 1 -> NaN Invalid_operation +ddxor786 xor -Inf 1000 -> NaN Invalid_operation +ddxor787 xor -1000 -Inf -> NaN Invalid_operation +ddxor788 xor -Inf -Inf -> NaN Invalid_operation +ddxor789 xor -1 -Inf -> NaN Invalid_operation +ddxor790 xor -0 -Inf -> NaN Invalid_operation +ddxor791 xor 0 -Inf -> NaN Invalid_operation +ddxor792 xor 1 -Inf -> NaN Invalid_operation +ddxor793 xor 1000 -Inf -> NaN Invalid_operation +ddxor794 xor Inf -Inf -> NaN Invalid_operation + +ddxor800 xor Inf -Inf -> NaN Invalid_operation +ddxor801 xor Inf -1000 -> NaN Invalid_operation +ddxor802 xor Inf -1 -> NaN Invalid_operation +ddxor803 xor Inf -0 -> NaN Invalid_operation +ddxor804 xor Inf 0 -> NaN Invalid_operation +ddxor805 xor Inf 1 -> NaN Invalid_operation +ddxor806 xor Inf 1000 -> NaN Invalid_operation +ddxor807 xor Inf Inf -> NaN Invalid_operation +ddxor808 xor -1000 Inf -> NaN Invalid_operation +ddxor809 xor -Inf Inf -> NaN Invalid_operation +ddxor810 xor -1 Inf -> NaN Invalid_operation +ddxor811 xor -0 Inf -> NaN Invalid_operation +ddxor812 xor 0 Inf -> NaN Invalid_operation +ddxor813 xor 1 Inf -> NaN Invalid_operation +ddxor814 xor 1000 Inf -> NaN Invalid_operation +ddxor815 xor Inf Inf -> NaN Invalid_operation + +ddxor821 xor NaN -Inf -> NaN Invalid_operation +ddxor822 xor NaN -1000 -> NaN Invalid_operation +ddxor823 xor NaN -1 -> NaN Invalid_operation +ddxor824 xor NaN -0 -> NaN Invalid_operation +ddxor825 xor NaN 0 -> NaN Invalid_operation +ddxor826 xor NaN 1 -> NaN Invalid_operation +ddxor827 xor NaN 1000 -> NaN Invalid_operation +ddxor828 xor NaN Inf -> NaN Invalid_operation +ddxor829 xor NaN NaN -> NaN Invalid_operation +ddxor830 xor -Inf NaN -> NaN Invalid_operation +ddxor831 xor -1000 NaN -> NaN Invalid_operation +ddxor832 xor -1 NaN -> NaN Invalid_operation +ddxor833 xor -0 NaN -> NaN Invalid_operation +ddxor834 xor 0 NaN -> NaN Invalid_operation +ddxor835 xor 1 NaN -> NaN Invalid_operation +ddxor836 xor 1000 NaN -> NaN Invalid_operation +ddxor837 xor Inf NaN -> NaN Invalid_operation + +ddxor841 xor sNaN -Inf -> NaN Invalid_operation +ddxor842 xor sNaN -1000 -> NaN Invalid_operation +ddxor843 xor sNaN -1 -> NaN Invalid_operation +ddxor844 xor sNaN -0 -> NaN Invalid_operation +ddxor845 xor sNaN 0 -> NaN Invalid_operation +ddxor846 xor sNaN 1 -> NaN Invalid_operation +ddxor847 xor sNaN 1000 -> NaN Invalid_operation +ddxor848 xor sNaN NaN -> NaN Invalid_operation +ddxor849 xor sNaN sNaN -> NaN Invalid_operation +ddxor850 xor NaN sNaN -> NaN Invalid_operation +ddxor851 xor -Inf sNaN -> NaN Invalid_operation +ddxor852 xor -1000 sNaN -> NaN Invalid_operation +ddxor853 xor -1 sNaN -> NaN Invalid_operation +ddxor854 xor -0 sNaN -> NaN Invalid_operation +ddxor855 xor 0 sNaN -> NaN Invalid_operation +ddxor856 xor 1 sNaN -> NaN Invalid_operation +ddxor857 xor 1000 sNaN -> NaN Invalid_operation +ddxor858 xor Inf sNaN -> NaN Invalid_operation +ddxor859 xor NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +ddxor861 xor NaN1 -Inf -> NaN Invalid_operation +ddxor862 xor +NaN2 -1000 -> NaN Invalid_operation +ddxor863 xor NaN3 1000 -> NaN Invalid_operation +ddxor864 xor NaN4 Inf -> NaN Invalid_operation +ddxor865 xor NaN5 +NaN6 -> NaN Invalid_operation +ddxor866 xor -Inf NaN7 -> NaN Invalid_operation +ddxor867 xor -1000 NaN8 -> NaN Invalid_operation +ddxor868 xor 1000 NaN9 -> NaN Invalid_operation +ddxor869 xor Inf +NaN10 -> NaN Invalid_operation +ddxor871 xor sNaN11 -Inf -> NaN Invalid_operation +ddxor872 xor sNaN12 -1000 -> NaN Invalid_operation +ddxor873 xor sNaN13 1000 -> NaN Invalid_operation +ddxor874 xor sNaN14 NaN17 -> NaN Invalid_operation +ddxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation +ddxor876 xor NaN16 sNaN19 -> NaN Invalid_operation +ddxor877 xor -Inf +sNaN20 -> NaN Invalid_operation +ddxor878 xor -1000 sNaN21 -> NaN Invalid_operation +ddxor879 xor 1000 sNaN22 -> NaN Invalid_operation +ddxor880 xor Inf sNaN23 -> NaN Invalid_operation +ddxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation +ddxor882 xor -NaN26 NaN28 -> NaN Invalid_operation +ddxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation +ddxor884 xor 1000 -NaN30 -> NaN Invalid_operation +ddxor885 xor 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decDouble.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decDouble.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,65 @@ +------------------------------------------------------------------------ +-- decDouble.decTest -- run all decDouble decimal arithmetic tests -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- decDouble tests +dectest: ddAbs +dectest: ddAdd +dectest: ddAnd +dectest: ddBase +dectest: ddCanonical +dectest: ddClass +dectest: ddCompare +dectest: ddCompareSig +dectest: ddCompareTotal +dectest: ddCompareTotalMag +dectest: ddCopy +dectest: ddCopyAbs +dectest: ddCopyNegate +dectest: ddCopySign +dectest: ddDivide +dectest: ddDivideInt +dectest: ddEncode +dectest: ddFMA +dectest: ddInvert +dectest: ddLogB +dectest: ddMax +dectest: ddMaxMag +dectest: ddMin +dectest: ddMinMag +dectest: ddMinus +dectest: ddMultiply +dectest: ddNextMinus +dectest: ddNextPlus +dectest: ddNextToward +dectest: ddOr +dectest: ddPlus +dectest: ddQuantize +dectest: ddReduce +dectest: ddRemainder +dectest: ddRemainderNear +dectest: ddRotate +dectest: ddSameQuantum +dectest: ddScaleB +dectest: ddShift +dectest: ddSubtract +dectest: ddToIntegral +dectest: ddXor + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decQuad.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decQuad.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,65 @@ +------------------------------------------------------------------------ +-- decQuad.decTest -- run all decQuad decimal arithmetic tests -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- decQuad tests +dectest: dqAbs +dectest: dqAdd +dectest: dqAnd +dectest: dqBase +dectest: dqCanonical +dectest: dqClass +dectest: dqCompare +dectest: dqCompareSig +dectest: dqCompareTotal +dectest: dqCompareTotalMag +dectest: dqCopy +dectest: dqCopyAbs +dectest: dqCopyNegate +dectest: dqCopySign +dectest: dqDivide +dectest: dqDivideInt +dectest: dqEncode +dectest: dqFMA +dectest: dqInvert +dectest: dqLogB +dectest: dqMax +dectest: dqMaxMag +dectest: dqMin +dectest: dqMinMag +dectest: dqMinus +dectest: dqMultiply +dectest: dqNextMinus +dectest: dqNextPlus +dectest: dqNextToward +dectest: dqOr +dectest: dqPlus +dectest: dqQuantize +dectest: dqReduce +dectest: dqRemainder +dectest: dqRemainderNear +dectest: dqRotate +dectest: dqSameQuantum +dectest: dqScaleB +dectest: dqShift +dectest: dqSubtract +dectest: dqToIntegral +dectest: dqXor + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decSingle.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/decSingle.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,25 @@ +------------------------------------------------------------------------ +-- decSingle.decTest -- run all decSingle decimal arithmetic tests -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- decSingle tests +dectest: dsBase +dectest: dsEncode + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/divide.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/divide.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,854 @@ +------------------------------------------------------------------------ +-- divide.decTest -- decimal division -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +divx001 divide 1 1 -> 1 +divx002 divide 2 1 -> 2 +divx003 divide 1 2 -> 0.5 +divx004 divide 2 2 -> 1 +divx005 divide 0 1 -> 0 +divx006 divide 0 2 -> 0 +divx007 divide 1 3 -> 0.333333333 Inexact Rounded +divx008 divide 2 3 -> 0.666666667 Inexact Rounded +divx009 divide 3 3 -> 1 + +divx010 divide 2.4 1 -> 2.4 +divx011 divide 2.4 -1 -> -2.4 +divx012 divide -2.4 1 -> -2.4 +divx013 divide -2.4 -1 -> 2.4 +divx014 divide 2.40 1 -> 2.40 +divx015 divide 2.400 1 -> 2.400 +divx016 divide 2.4 2 -> 1.2 +divx017 divide 2.400 2 -> 1.200 +divx018 divide 2. 2 -> 1 +divx019 divide 20 20 -> 1 + +divx020 divide 187 187 -> 1 +divx021 divide 5 2 -> 2.5 +divx022 divide 50 20 -> 2.5 +divx023 divide 500 200 -> 2.5 +divx024 divide 50.0 20.0 -> 2.5 +divx025 divide 5.00 2.00 -> 2.5 +divx026 divide 5 2.0 -> 2.5 +divx027 divide 5 2.000 -> 2.5 +divx028 divide 5 0.20 -> 25 +divx029 divide 5 0.200 -> 25 +divx030 divide 10 1 -> 10 +divx031 divide 100 1 -> 100 +divx032 divide 1000 1 -> 1000 +divx033 divide 1000 100 -> 10 + +divx035 divide 1 2 -> 0.5 +divx036 divide 1 4 -> 0.25 +divx037 divide 1 8 -> 0.125 +divx038 divide 1 16 -> 0.0625 +divx039 divide 1 32 -> 0.03125 +divx040 divide 1 64 -> 0.015625 +divx041 divide 1 -2 -> -0.5 +divx042 divide 1 -4 -> -0.25 +divx043 divide 1 -8 -> -0.125 +divx044 divide 1 -16 -> -0.0625 +divx045 divide 1 -32 -> -0.03125 +divx046 divide 1 -64 -> -0.015625 +divx047 divide -1 2 -> -0.5 +divx048 divide -1 4 -> -0.25 +divx049 divide -1 8 -> -0.125 +divx050 divide -1 16 -> -0.0625 +divx051 divide -1 32 -> -0.03125 +divx052 divide -1 64 -> -0.015625 +divx053 divide -1 -2 -> 0.5 +divx054 divide -1 -4 -> 0.25 +divx055 divide -1 -8 -> 0.125 +divx056 divide -1 -16 -> 0.0625 +divx057 divide -1 -32 -> 0.03125 +divx058 divide -1 -64 -> 0.015625 + +divx070 divide 999999999 1 -> 999999999 +divx071 divide 999999999.4 1 -> 999999999 Inexact Rounded +divx072 divide 999999999.5 1 -> 1.00000000E+9 Inexact Rounded +divx073 divide 999999999.9 1 -> 1.00000000E+9 Inexact Rounded +divx074 divide 999999999.999 1 -> 1.00000000E+9 Inexact Rounded +precision: 6 +divx080 divide 999999999 1 -> 1.00000E+9 Inexact Rounded +divx081 divide 99999999 1 -> 1.00000E+8 Inexact Rounded +divx082 divide 9999999 1 -> 1.00000E+7 Inexact Rounded +divx083 divide 999999 1 -> 999999 +divx084 divide 99999 1 -> 99999 +divx085 divide 9999 1 -> 9999 +divx086 divide 999 1 -> 999 +divx087 divide 99 1 -> 99 +divx088 divide 9 1 -> 9 + +precision: 9 +divx090 divide 0. 1 -> 0 +divx091 divide .0 1 -> 0.0 +divx092 divide 0.00 1 -> 0.00 +divx093 divide 0.00E+9 1 -> 0E+7 +divx094 divide 0.0000E-50 1 -> 0E-54 + +divx095 divide 1 1E-8 -> 1E+8 +divx096 divide 1 1E-9 -> 1E+9 +divx097 divide 1 1E-10 -> 1E+10 +divx098 divide 1 1E-11 -> 1E+11 +divx099 divide 1 1E-12 -> 1E+12 + +divx100 divide 1 1 -> 1 +divx101 divide 1 2 -> 0.5 +divx102 divide 1 3 -> 0.333333333 Inexact Rounded +divx103 divide 1 4 -> 0.25 +divx104 divide 1 5 -> 0.2 +divx105 divide 1 6 -> 0.166666667 Inexact Rounded +divx106 divide 1 7 -> 0.142857143 Inexact Rounded +divx107 divide 1 8 -> 0.125 +divx108 divide 1 9 -> 0.111111111 Inexact Rounded +divx109 divide 1 10 -> 0.1 +divx110 divide 1 1 -> 1 +divx111 divide 2 1 -> 2 +divx112 divide 3 1 -> 3 +divx113 divide 4 1 -> 4 +divx114 divide 5 1 -> 5 +divx115 divide 6 1 -> 6 +divx116 divide 7 1 -> 7 +divx117 divide 8 1 -> 8 +divx118 divide 9 1 -> 9 +divx119 divide 10 1 -> 10 + +divx120 divide 3E+1 0.001 -> 3E+4 +divx121 divide 2.200 2 -> 1.100 + +divx130 divide 12345 4.999 -> 2469.49390 Inexact Rounded +divx131 divide 12345 4.99 -> 2473.94790 Inexact Rounded +divx132 divide 12345 4.9 -> 2519.38776 Inexact Rounded +divx133 divide 12345 5 -> 2469 +divx134 divide 12345 5.1 -> 2420.58824 Inexact Rounded +divx135 divide 12345 5.01 -> 2464.07186 Inexact Rounded +divx136 divide 12345 5.001 -> 2468.50630 Inexact Rounded + +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 + +-- test possibly imprecise results +divx220 divide 391 597 -> 0.654941374 Inexact Rounded +divx221 divide 391 -597 -> -0.654941374 Inexact Rounded +divx222 divide -391 597 -> -0.654941374 Inexact Rounded +divx223 divide -391 -597 -> 0.654941374 Inexact Rounded + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +divx270 divide 1 1e999999999 -> 1E-999999999 +divx271 divide 1 0.9e999999999 -> 1.11111111E-999999999 Inexact Rounded +divx272 divide 1 0.99e999999999 -> 1.01010101E-999999999 Inexact Rounded +divx273 divide 1 0.999999999e999999999 -> 1.00000000E-999999999 Inexact Rounded +divx274 divide 9e999999999 1 -> 9E+999999999 +divx275 divide 9.9e999999999 1 -> 9.9E+999999999 +divx276 divide 9.99e999999999 1 -> 9.99E+999999999 +divx277 divide 9.99999999e999999999 1 -> 9.99999999E+999999999 + +divx280 divide 0.1 9e-999999999 -> 1.11111111E+999999997 Inexact Rounded +divx281 divide 0.1 99e-999999999 -> 1.01010101E+999999996 Inexact Rounded +divx282 divide 0.1 999e-999999999 -> 1.00100100E+999999995 Inexact Rounded + +divx283 divide 0.1 9e-999999998 -> 1.11111111E+999999996 Inexact Rounded +divx284 divide 0.1 99e-999999998 -> 1.01010101E+999999995 Inexact Rounded +divx285 divide 0.1 999e-999999998 -> 1.00100100E+999999994 Inexact Rounded +divx286 divide 0.1 999e-999999997 -> 1.00100100E+999999993 Inexact Rounded +divx287 divide 0.1 9999e-999999997 -> 1.00010001E+999999992 Inexact Rounded +divx288 divide 0.1 99999e-999999997 -> 1.00001000E+999999991 Inexact Rounded + +-- Divide into 0 tests + +divx301 divide 0 7 -> 0 +divx302 divide 0 7E-5 -> 0E+5 +divx303 divide 0 7E-1 -> 0E+1 +divx304 divide 0 7E+1 -> 0.0 +divx305 divide 0 7E+5 -> 0.00000 +divx306 divide 0 7E+6 -> 0.000000 +divx307 divide 0 7E+7 -> 0E-7 +divx308 divide 0 70E-5 -> 0E+5 +divx309 divide 0 70E-1 -> 0E+1 +divx310 divide 0 70E+0 -> 0 +divx311 divide 0 70E+1 -> 0.0 +divx312 divide 0 70E+5 -> 0.00000 +divx313 divide 0 70E+6 -> 0.000000 +divx314 divide 0 70E+7 -> 0E-7 +divx315 divide 0 700E-5 -> 0E+5 +divx316 divide 0 700E-1 -> 0E+1 +divx317 divide 0 700E+0 -> 0 +divx318 divide 0 700E+1 -> 0.0 +divx319 divide 0 700E+5 -> 0.00000 +divx320 divide 0 700E+6 -> 0.000000 +divx321 divide 0 700E+7 -> 0E-7 +divx322 divide 0 700E+77 -> 0E-77 + +divx331 divide 0E-3 7E-5 -> 0E+2 +divx332 divide 0E-3 7E-1 -> 0.00 +divx333 divide 0E-3 7E+1 -> 0.0000 +divx334 divide 0E-3 7E+5 -> 0E-8 +divx335 divide 0E-1 7E-5 -> 0E+4 +divx336 divide 0E-1 7E-1 -> 0 +divx337 divide 0E-1 7E+1 -> 0.00 +divx338 divide 0E-1 7E+5 -> 0.000000 +divx339 divide 0E+1 7E-5 -> 0E+6 +divx340 divide 0E+1 7E-1 -> 0E+2 +divx341 divide 0E+1 7E+1 -> 0 +divx342 divide 0E+1 7E+5 -> 0.0000 +divx343 divide 0E+3 7E-5 -> 0E+8 +divx344 divide 0E+3 7E-1 -> 0E+4 +divx345 divide 0E+3 7E+1 -> 0E+2 +divx346 divide 0E+3 7E+5 -> 0.00 + +maxexponent: 92 +minexponent: -92 +precision: 7 +divx351 divide 0E-92 7E-1 -> 0E-91 +divx352 divide 0E-92 7E+1 -> 0E-93 +divx353 divide 0E-92 7E+5 -> 0E-97 +divx354 divide 0E-92 7E+6 -> 0E-98 +divx355 divide 0E-92 7E+7 -> 0E-98 Clamped +divx356 divide 0E-92 777E-1 -> 0E-91 +divx357 divide 0E-92 777E+1 -> 0E-93 +divx358 divide 0E-92 777E+3 -> 0E-95 +divx359 divide 0E-92 777E+4 -> 0E-96 +divx360 divide 0E-92 777E+5 -> 0E-97 +divx361 divide 0E-92 777E+6 -> 0E-98 +divx362 divide 0E-92 777E+7 -> 0E-98 Clamped +divx363 divide 0E-92 7E+92 -> 0E-98 Clamped + +divx371 divide 0E-92 700E-1 -> 0E-91 +divx372 divide 0E-92 700E+1 -> 0E-93 +divx373 divide 0E-92 700E+3 -> 0E-95 +divx374 divide 0E-92 700E+4 -> 0E-96 +divx375 divide 0E-92 700E+5 -> 0E-97 +divx376 divide 0E-92 700E+6 -> 0E-98 +divx377 divide 0E-92 700E+7 -> 0E-98 Clamped + +divx381 divide 0E+92 7E+1 -> 0E+91 +divx382 divide 0E+92 7E+0 -> 0E+92 +divx383 divide 0E+92 7E-1 -> 0E+92 Clamped +divx384 divide 0E+90 777E+1 -> 0E+89 +divx385 divide 0E+90 777E-1 -> 0E+91 +divx386 divide 0E+90 777E-2 -> 0E+92 +divx387 divide 0E+90 777E-3 -> 0E+92 Clamped +divx388 divide 0E+90 777E-4 -> 0E+92 Clamped + +divx391 divide 0E+90 700E+1 -> 0E+89 +divx392 divide 0E+90 700E-1 -> 0E+91 +divx393 divide 0E+90 700E-2 -> 0E+92 +divx394 divide 0E+90 700E-3 -> 0E+92 Clamped +divx395 divide 0E+90 700E-4 -> 0E+92 Clamped + +-- input rounding checks +maxexponent: 999 +minexponent: -999 +precision: 9 +divx401 divide 12345678000 1 -> 1.23456780E+10 Rounded +divx402 divide 1 12345678000 -> 8.10000066E-11 Inexact Rounded +divx403 divide 1234567800 1 -> 1.23456780E+9 Rounded +divx404 divide 1 1234567800 -> 8.10000066E-10 Inexact Rounded +divx405 divide 1234567890 1 -> 1.23456789E+9 Rounded +divx406 divide 1 1234567890 -> 8.10000007E-10 Inexact Rounded +divx407 divide 1234567891 1 -> 1.23456789E+9 Inexact Rounded +divx408 divide 1 1234567891 -> 8.10000007E-10 Inexact Rounded +divx409 divide 12345678901 1 -> 1.23456789E+10 Inexact Rounded +divx410 divide 1 12345678901 -> 8.10000007E-11 Inexact Rounded +divx411 divide 1234567896 1 -> 1.23456790E+9 Inexact Rounded +divx412 divide 1 1234567896 -> 8.10000003E-10 Inexact Rounded +divx413 divide 1 1234567897 -> 8.10000003E-10 Inexact Rounded +divx414 divide 1 1234567898 -> 8.10000002E-10 Inexact Rounded +divx415 divide 1 1234567899 -> 8.10000001E-10 Inexact Rounded +divx416 divide 1 1234567900 -> 8.10000001E-10 Inexact Rounded +divx417 divide 1 1234567901 -> 8.10000000E-10 Inexact Rounded +divx418 divide 1 1234567902 -> 8.09999999E-10 Inexact Rounded +-- some longies +divx421 divide 1234567896.000000000000 1 -> 1.23456790E+9 Inexact Rounded +divx422 divide 1 1234567896.000000000000 -> 8.10000003E-10 Inexact Rounded +divx423 divide 1234567896.000000000001 1 -> 1.23456790E+9 Inexact Rounded +divx424 divide 1 1234567896.000000000001 -> 8.10000003E-10 Inexact Rounded +divx425 divide 1234567896.000000000000000000000000000000000000000009 1 -> 1.23456790E+9 Inexact Rounded +divx426 divide 1 1234567896.000000000000000000000000000000000000000009 -> 8.10000003E-10 Inexact Rounded +divx427 divide 1234567897.900010000000000000000000000000000000000009 1 -> 1.23456790E+9 Inexact Rounded +divx428 divide 1 1234567897.900010000000000000000000000000000000000009 -> 8.10000002E-10 Inexact Rounded + +precision: 15 +-- still checking... +divx441 divide 12345678000 1 -> 12345678000 +divx442 divide 1 12345678000 -> 8.10000066420005E-11 Inexact Rounded +divx443 divide 1234567800 1 -> 1234567800 +divx444 divide 1 1234567800 -> 8.10000066420005E-10 Inexact Rounded +divx445 divide 1234567890 1 -> 1234567890 +divx446 divide 1 1234567890 -> 8.10000007371000E-10 Inexact Rounded +divx447 divide 1234567891 1 -> 1234567891 +divx448 divide 1 1234567891 -> 8.10000006714900E-10 Inexact Rounded +divx449 divide 12345678901 1 -> 12345678901 +divx450 divide 1 12345678901 -> 8.10000007305390E-11 Inexact Rounded +divx451 divide 1234567896 1 -> 1234567896 +divx452 divide 1 1234567896 -> 8.10000003434400E-10 Inexact Rounded + +-- high-lows +divx453 divide 1e+1 1 -> 1E+1 +divx454 divide 1e+1 1.0 -> 1E+1 +divx455 divide 1e+1 1.00 -> 1E+1 +divx456 divide 1e+2 2 -> 5E+1 +divx457 divide 1e+2 2.0 -> 5E+1 +divx458 divide 1e+2 2.00 -> 5E+1 + +-- some from IEEE discussions +divx460 divide 3e0 2e0 -> 1.5 +divx461 divide 30e-1 2e0 -> 1.5 +divx462 divide 300e-2 2e0 -> 1.50 +divx464 divide 3000e-3 2e0 -> 1.500 +divx465 divide 3e0 20e-1 -> 1.5 +divx466 divide 30e-1 20e-1 -> 1.5 +divx467 divide 300e-2 20e-1 -> 1.5 +divx468 divide 3000e-3 20e-1 -> 1.50 +divx469 divide 3e0 200e-2 -> 1.5 +divx470 divide 30e-1 200e-2 -> 1.5 +divx471 divide 300e-2 200e-2 -> 1.5 +divx472 divide 3000e-3 200e-2 -> 1.5 +divx473 divide 3e0 2000e-3 -> 1.5 +divx474 divide 30e-1 2000e-3 -> 1.5 +divx475 divide 300e-2 2000e-3 -> 1.5 +divx476 divide 3000e-3 2000e-3 -> 1.5 + +-- some reciprocals +divx480 divide 1 1.0E+33 -> 1E-33 +divx481 divide 1 10E+33 -> 1E-34 +divx482 divide 1 1.0E-33 -> 1E+33 +divx483 divide 1 10E-33 -> 1E+32 + +-- RMS discussion table +maxexponent: 96 +minexponent: -95 +precision: 7 + +divx484 divide 0e5 1e3 -> 0E+2 +divx485 divide 0e5 2e3 -> 0E+2 +divx486 divide 0e5 10e2 -> 0E+3 +divx487 divide 0e5 20e2 -> 0E+3 +divx488 divide 0e5 100e1 -> 0E+4 +divx489 divide 0e5 200e1 -> 0E+4 + +divx491 divide 1e5 1e3 -> 1E+2 +divx492 divide 1e5 2e3 -> 5E+1 +divx493 divide 1e5 10e2 -> 1E+2 +divx494 divide 1e5 20e2 -> 5E+1 +divx495 divide 1e5 100e1 -> 1E+2 +divx496 divide 1e5 200e1 -> 5E+1 + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +divx497 divide 0E+86 1000E-13 -> 0E+92 Clamped +divx498 divide 0E-98 1000E+13 -> 0E-98 Clamped + +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- focus on trailing zeros issues +precision: 9 +divx500 divide 1 9.9 -> 0.101010101 Inexact Rounded +precision: 8 +divx501 divide 1 9.9 -> 0.10101010 Inexact Rounded +precision: 7 +divx502 divide 1 9.9 -> 0.1010101 Inexact Rounded +precision: 6 +divx503 divide 1 9.9 -> 0.101010 Inexact Rounded +precision: 9 + +divx511 divide 1 2 -> 0.5 +divx512 divide 1.0 2 -> 0.5 +divx513 divide 1.00 2 -> 0.50 +divx514 divide 1.000 2 -> 0.500 +divx515 divide 1.0000 2 -> 0.5000 +divx516 divide 1.00000 2 -> 0.50000 +divx517 divide 1.000000 2 -> 0.500000 +divx518 divide 1.0000000 2 -> 0.5000000 +divx519 divide 1.00 2.00 -> 0.5 + +divx521 divide 2 1 -> 2 +divx522 divide 2 1.0 -> 2 +divx523 divide 2 1.00 -> 2 +divx524 divide 2 1.000 -> 2 +divx525 divide 2 1.0000 -> 2 +divx526 divide 2 1.00000 -> 2 +divx527 divide 2 1.000000 -> 2 +divx528 divide 2 1.0000000 -> 2 +divx529 divide 2.00 1.00 -> 2 + +divx530 divide 2.40 2 -> 1.20 +divx531 divide 2.40 4 -> 0.60 +divx532 divide 2.40 10 -> 0.24 +divx533 divide 2.40 2.0 -> 1.2 +divx534 divide 2.40 4.0 -> 0.6 +divx535 divide 2.40 10.0 -> 0.24 +divx536 divide 2.40 2.00 -> 1.2 +divx537 divide 2.40 4.00 -> 0.6 +divx538 divide 2.40 10.00 -> 0.24 +divx539 divide 0.9 0.1 -> 9 +divx540 divide 0.9 0.01 -> 9E+1 +divx541 divide 0.9 0.001 -> 9E+2 +divx542 divide 5 2 -> 2.5 +divx543 divide 5 2.0 -> 2.5 +divx544 divide 5 2.00 -> 2.5 +divx545 divide 5 20 -> 0.25 +divx546 divide 5 20.0 -> 0.25 +divx547 divide 2.400 2 -> 1.200 +divx548 divide 2.400 2.0 -> 1.20 +divx549 divide 2.400 2.400 -> 1 + +divx550 divide 240 1 -> 240 +divx551 divide 240 10 -> 24 +divx552 divide 240 100 -> 2.4 +divx553 divide 240 1000 -> 0.24 +divx554 divide 2400 1 -> 2400 +divx555 divide 2400 10 -> 240 +divx556 divide 2400 100 -> 24 +divx557 divide 2400 1000 -> 2.4 + +-- +ve exponent +precision: 5 +divx570 divide 2.4E+6 2 -> 1.2E+6 +divx571 divide 2.40E+6 2 -> 1.20E+6 +divx572 divide 2.400E+6 2 -> 1.200E+6 +divx573 divide 2.4000E+6 2 -> 1.2000E+6 +divx574 divide 24E+5 2 -> 1.2E+6 +divx575 divide 240E+4 2 -> 1.20E+6 +divx576 divide 2400E+3 2 -> 1.200E+6 +divx577 divide 24000E+2 2 -> 1.2000E+6 +precision: 6 +divx580 divide 2.4E+6 2 -> 1.2E+6 +divx581 divide 2.40E+6 2 -> 1.20E+6 +divx582 divide 2.400E+6 2 -> 1.200E+6 +divx583 divide 2.4000E+6 2 -> 1.2000E+6 +divx584 divide 24E+5 2 -> 1.2E+6 +divx585 divide 240E+4 2 -> 1.20E+6 +divx586 divide 2400E+3 2 -> 1.200E+6 +divx587 divide 24000E+2 2 -> 1.2000E+6 +precision: 7 +divx590 divide 2.4E+6 2 -> 1.2E+6 +divx591 divide 2.40E+6 2 -> 1.20E+6 +divx592 divide 2.400E+6 2 -> 1.200E+6 +divx593 divide 2.4000E+6 2 -> 1.2000E+6 +divx594 divide 24E+5 2 -> 1.2E+6 +divx595 divide 240E+4 2 -> 1.20E+6 +divx596 divide 2400E+3 2 -> 1.200E+6 +divx597 divide 24000E+2 2 -> 1.2000E+6 +precision: 9 +divx600 divide 2.4E+9 2 -> 1.2E+9 +divx601 divide 2.40E+9 2 -> 1.20E+9 +divx602 divide 2.400E+9 2 -> 1.200E+9 +divx603 divide 2.4000E+9 2 -> 1.2000E+9 +divx604 divide 24E+8 2 -> 1.2E+9 +divx605 divide 240E+7 2 -> 1.20E+9 +divx606 divide 2400E+6 2 -> 1.200E+9 +divx607 divide 24000E+5 2 -> 1.2000E+9 + +-- long operand triangle +precision: 33 +divx610 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131097703792 Inexact Rounded +precision: 32 +divx611 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813109770379 Inexact Rounded +precision: 31 +divx612 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977038 Inexact Rounded +precision: 30 +divx613 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131097704 Inexact Rounded +precision: 29 +divx614 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813109770 Inexact Rounded +precision: 28 +divx615 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977 Inexact Rounded +precision: 27 +divx616 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131098 Inexact Rounded +precision: 26 +divx617 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813110 Inexact Rounded +precision: 25 +divx618 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81311 Inexact Rounded +precision: 24 +divx619 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131 Inexact Rounded +precision: 23 +divx620 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813 Inexact Rounded +precision: 22 +divx621 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81 Inexact Rounded +precision: 21 +divx622 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8 Inexact Rounded +precision: 20 +divx623 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817798 Inexact Rounded +precision: 19 +divx624 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888379681780E+19 Inexact Rounded +precision: 18 +divx625 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088837968178E+19 Inexact Rounded +precision: 17 +divx626 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408883796818E+19 Inexact Rounded +precision: 16 +divx627 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888379682E+19 Inexact Rounded +precision: 15 +divx628 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088837968E+19 Inexact Rounded +precision: 14 +divx629 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408883797E+19 Inexact Rounded +precision: 13 +divx630 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888380E+19 Inexact Rounded +precision: 12 +divx631 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088838E+19 Inexact Rounded +precision: 11 +divx632 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408884E+19 Inexact Rounded +precision: 10 +divx633 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888E+19 Inexact Rounded +precision: 9 +divx634 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114089E+19 Inexact Rounded +precision: 8 +divx635 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011409E+19 Inexact Rounded +precision: 7 +divx636 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101141E+19 Inexact Rounded +precision: 6 +divx637 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114E+19 Inexact Rounded +precision: 5 +divx638 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011E+19 Inexact Rounded +precision: 4 +divx639 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101E+19 Inexact Rounded +precision: 3 +divx640 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10E+19 Inexact Rounded +precision: 2 +divx641 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1E+19 Inexact Rounded +precision: 1 +divx642 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4E+19 Inexact Rounded + +-- more zeros, etc. +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +divx731 divide 5.00 1E-3 -> 5.00E+3 +divx732 divide 00.00 0.000 -> NaN Division_undefined +divx733 divide 00.00 0E-3 -> NaN Division_undefined +divx734 divide 0 -0 -> NaN Division_undefined +divx735 divide -0 0 -> NaN Division_undefined +divx736 divide -0 -0 -> NaN Division_undefined + +divx741 divide 0 -1 -> -0 +divx742 divide -0 -1 -> 0 +divx743 divide 0 1 -> 0 +divx744 divide -0 1 -> -0 +divx745 divide -1 0 -> -Infinity Division_by_zero +divx746 divide -1 -0 -> Infinity Division_by_zero +divx747 divide 1 0 -> Infinity Division_by_zero +divx748 divide 1 -0 -> -Infinity Division_by_zero + +divx751 divide 0.0 -1 -> -0.0 +divx752 divide -0.0 -1 -> 0.0 +divx753 divide 0.0 1 -> 0.0 +divx754 divide -0.0 1 -> -0.0 +divx755 divide -1.0 0 -> -Infinity Division_by_zero +divx756 divide -1.0 -0 -> Infinity Division_by_zero +divx757 divide 1.0 0 -> Infinity Division_by_zero +divx758 divide 1.0 -0 -> -Infinity Division_by_zero + +divx761 divide 0 -1.0 -> -0E+1 +divx762 divide -0 -1.0 -> 0E+1 +divx763 divide 0 1.0 -> 0E+1 +divx764 divide -0 1.0 -> -0E+1 +divx765 divide -1 0.0 -> -Infinity Division_by_zero +divx766 divide -1 -0.0 -> Infinity Division_by_zero +divx767 divide 1 0.0 -> Infinity Division_by_zero +divx768 divide 1 -0.0 -> -Infinity Division_by_zero + +divx771 divide 0.0 -1.0 -> -0 +divx772 divide -0.0 -1.0 -> 0 +divx773 divide 0.0 1.0 -> 0 +divx774 divide -0.0 1.0 -> -0 +divx775 divide -1.0 0.0 -> -Infinity Division_by_zero +divx776 divide -1.0 -0.0 -> Infinity Division_by_zero +divx777 divide 1.0 0.0 -> Infinity Division_by_zero +divx778 divide 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +divx780 divide Inf -Inf -> NaN Invalid_operation +divx781 divide Inf -1000 -> -Infinity +divx782 divide Inf -1 -> -Infinity +divx783 divide Inf -0 -> -Infinity +divx784 divide Inf 0 -> Infinity +divx785 divide Inf 1 -> Infinity +divx786 divide Inf 1000 -> Infinity +divx787 divide Inf Inf -> NaN Invalid_operation +divx788 divide -1000 Inf -> -0E-398 Clamped +divx789 divide -Inf Inf -> NaN Invalid_operation +divx790 divide -1 Inf -> -0E-398 Clamped +divx791 divide -0 Inf -> -0E-398 Clamped +divx792 divide 0 Inf -> 0E-398 Clamped +divx793 divide 1 Inf -> 0E-398 Clamped +divx794 divide 1000 Inf -> 0E-398 Clamped +divx795 divide Inf Inf -> NaN Invalid_operation + +divx800 divide -Inf -Inf -> NaN Invalid_operation +divx801 divide -Inf -1000 -> Infinity +divx802 divide -Inf -1 -> Infinity +divx803 divide -Inf -0 -> Infinity +divx804 divide -Inf 0 -> -Infinity +divx805 divide -Inf 1 -> -Infinity +divx806 divide -Inf 1000 -> -Infinity +divx807 divide -Inf Inf -> NaN Invalid_operation +divx808 divide -1000 Inf -> -0E-398 Clamped +divx809 divide -Inf -Inf -> NaN Invalid_operation +divx810 divide -1 -Inf -> 0E-398 Clamped +divx811 divide -0 -Inf -> 0E-398 Clamped +divx812 divide 0 -Inf -> -0E-398 Clamped +divx813 divide 1 -Inf -> -0E-398 Clamped +divx814 divide 1000 -Inf -> -0E-398 Clamped +divx815 divide Inf -Inf -> NaN Invalid_operation + +divx821 divide NaN -Inf -> NaN +divx822 divide NaN -1000 -> NaN +divx823 divide NaN -1 -> NaN +divx824 divide NaN -0 -> NaN +divx825 divide NaN 0 -> NaN +divx826 divide NaN 1 -> NaN +divx827 divide NaN 1000 -> NaN +divx828 divide NaN Inf -> NaN +divx829 divide NaN NaN -> NaN +divx830 divide -Inf NaN -> NaN +divx831 divide -1000 NaN -> NaN +divx832 divide -1 NaN -> NaN +divx833 divide -0 NaN -> NaN +divx834 divide 0 NaN -> NaN +divx835 divide 1 NaN -> NaN +divx836 divide 1000 NaN -> NaN +divx837 divide Inf NaN -> NaN + +divx841 divide sNaN -Inf -> NaN Invalid_operation +divx842 divide sNaN -1000 -> NaN Invalid_operation +divx843 divide sNaN -1 -> NaN Invalid_operation +divx844 divide sNaN -0 -> NaN Invalid_operation +divx845 divide sNaN 0 -> NaN Invalid_operation +divx846 divide sNaN 1 -> NaN Invalid_operation +divx847 divide sNaN 1000 -> NaN Invalid_operation +divx848 divide sNaN NaN -> NaN Invalid_operation +divx849 divide sNaN sNaN -> NaN Invalid_operation +divx850 divide NaN sNaN -> NaN Invalid_operation +divx851 divide -Inf sNaN -> NaN Invalid_operation +divx852 divide -1000 sNaN -> NaN Invalid_operation +divx853 divide -1 sNaN -> NaN Invalid_operation +divx854 divide -0 sNaN -> NaN Invalid_operation +divx855 divide 0 sNaN -> NaN Invalid_operation +divx856 divide 1 sNaN -> NaN Invalid_operation +divx857 divide 1000 sNaN -> NaN Invalid_operation +divx858 divide Inf sNaN -> NaN Invalid_operation +divx859 divide NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +divx861 divide NaN9 -Inf -> NaN9 +divx862 divide NaN8 1000 -> NaN8 +divx863 divide NaN7 Inf -> NaN7 +divx864 divide NaN6 NaN5 -> NaN6 +divx865 divide -Inf NaN4 -> NaN4 +divx866 divide -1000 NaN3 -> NaN3 +divx867 divide Inf NaN2 -> NaN2 + +divx871 divide sNaN99 -Inf -> NaN99 Invalid_operation +divx872 divide sNaN98 -1 -> NaN98 Invalid_operation +divx873 divide sNaN97 NaN -> NaN97 Invalid_operation +divx874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation +divx875 divide NaN95 sNaN93 -> NaN93 Invalid_operation +divx876 divide -Inf sNaN92 -> NaN92 Invalid_operation +divx877 divide 0 sNaN91 -> NaN91 Invalid_operation +divx878 divide Inf sNaN90 -> NaN90 Invalid_operation +divx879 divide NaN sNaN89 -> NaN89 Invalid_operation + +divx881 divide -NaN9 -Inf -> -NaN9 +divx882 divide -NaN8 1000 -> -NaN8 +divx883 divide -NaN7 Inf -> -NaN7 +divx884 divide -NaN6 -NaN5 -> -NaN6 +divx885 divide -Inf -NaN4 -> -NaN4 +divx886 divide -1000 -NaN3 -> -NaN3 +divx887 divide Inf -NaN2 -> -NaN2 + +divx891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation +divx892 divide -sNaN98 -1 -> -NaN98 Invalid_operation +divx893 divide -sNaN97 NaN -> -NaN97 Invalid_operation +divx894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation +divx895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation +divx896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation +divx897 divide 0 -sNaN91 -> -NaN91 Invalid_operation +divx898 divide Inf -sNaN90 -> -NaN90 Invalid_operation +divx899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation + +maxexponent: 999999999 +minexponent: -999999999 + +-- Various flavours of divide by 0 +divx901 divide 0 0 -> NaN Division_undefined +divx902 divide 0.0E5 0 -> NaN Division_undefined +divx903 divide 0.000 0 -> NaN Division_undefined +divx904 divide 0.0001 0 -> Infinity Division_by_zero +divx905 divide 0.01 0 -> Infinity Division_by_zero +divx906 divide 0.1 0 -> Infinity Division_by_zero +divx907 divide 1 0 -> Infinity Division_by_zero +divx908 divide 1 0.0 -> Infinity Division_by_zero +divx909 divide 10 0.0 -> Infinity Division_by_zero +divx910 divide 1E+100 0.0 -> Infinity Division_by_zero +divx911 divide 1E+1000 0 -> Infinity Division_by_zero + +divx921 divide -0.0001 0 -> -Infinity Division_by_zero +divx922 divide -0.01 0 -> -Infinity Division_by_zero +divx923 divide -0.1 0 -> -Infinity Division_by_zero +divx924 divide -1 0 -> -Infinity Division_by_zero +divx925 divide -1 0.0 -> -Infinity Division_by_zero +divx926 divide -10 0.0 -> -Infinity Division_by_zero +divx927 divide -1E+100 0.0 -> -Infinity Division_by_zero +divx928 divide -1E+1000 0 -> -Infinity Division_by_zero + +divx931 divide 0.0001 -0 -> -Infinity Division_by_zero +divx932 divide 0.01 -0 -> -Infinity Division_by_zero +divx933 divide 0.1 -0 -> -Infinity Division_by_zero +divx934 divide 1 -0 -> -Infinity Division_by_zero +divx935 divide 1 -0.0 -> -Infinity Division_by_zero +divx936 divide 10 -0.0 -> -Infinity Division_by_zero +divx937 divide 1E+100 -0.0 -> -Infinity Division_by_zero +divx938 divide 1E+1000 -0 -> -Infinity Division_by_zero + +divx941 divide -0.0001 -0 -> Infinity Division_by_zero +divx942 divide -0.01 -0 -> Infinity Division_by_zero +divx943 divide -0.1 -0 -> Infinity Division_by_zero +divx944 divide -1 -0 -> Infinity Division_by_zero +divx945 divide -1 -0.0 -> Infinity Division_by_zero +divx946 divide -10 -0.0 -> Infinity Division_by_zero +divx947 divide -1E+100 -0.0 -> Infinity Division_by_zero +divx948 divide -1E+1000 -0 -> Infinity Division_by_zero + +-- overflow and underflow tests +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +divx951 divide 9E+999999999 +0.23456789012345E-0 -> Infinity Inexact Overflow Rounded +divx952 divide +0.100 9E+999999999 -> 1.111111E-1000000001 Inexact Rounded Underflow Subnormal +divx953 divide 9E-999999999 +9.100 -> 9.8901099E-1000000000 Inexact Rounded Underflow Subnormal +divx954 divide -1.23456789 9E+999999999 -> -1.3717421E-1000000000 Subnormal +divx955 divide -1.23456789012345E-0 9E+999999999 -> -1.3717421E-1000000000 Underflow Subnormal Rounded Inexact +divx956 divide -1.23456789012345E-0 7E+999999999 -> -1.7636684E-1000000000 Inexact Rounded Underflow Subnormal +divx957 divide 9E+999999999 -0.83456789012345E-0 -> -Infinity Inexact Overflow Rounded +divx958 divide -0.100 9E+999999999 -> -1.111111E-1000000001 Subnormal Inexact Rounded Underflow +divx959 divide 9E-999999999 -9.100 -> -9.8901099E-1000000000 Inexact Rounded Underflow Subnormal + +-- overflow and underflow (additional edge tests in multiply.decTest) +-- 'subnormal' results now possible (all hard underflow or overflow in +-- base arithemtic) +divx960 divide 1e-600000000 1e+400000001 -> 1E-1000000001 Subnormal +divx961 divide 1e-600000000 1e+400000002 -> 1E-1000000002 Subnormal +divx962 divide 1e-600000000 1e+400000003 -> 1E-1000000003 Subnormal +divx963 divide 1e-600000000 1e+400000004 -> 1E-1000000004 Subnormal +divx964 divide 1e-600000000 1e+400000005 -> 1E-1000000005 Subnormal +divx965 divide 1e-600000000 1e+400000006 -> 1E-1000000006 Subnormal +divx966 divide 1e-600000000 1e+400000007 -> 1E-1000000007 Subnormal +divx967 divide 1e-600000000 1e+400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx968 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx969 divide 1e-600000000 1e+400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +divx970 divide 1e+600000000 1e-400000001 -> Infinity Overflow Inexact Rounded +divx971 divide 1e+600000000 1e-400000002 -> Infinity Overflow Inexact Rounded +divx972 divide 1e+600000000 1e-400000003 -> Infinity Overflow Inexact Rounded +divx973 divide 1e+600000000 1e-400000004 -> Infinity Overflow Inexact Rounded +divx974 divide 1e+600000000 1e-400000005 -> Infinity Overflow Inexact Rounded +divx975 divide 1e+600000000 1e-400000006 -> Infinity Overflow Inexact Rounded +divx976 divide 1e+600000000 1e-400000007 -> Infinity Overflow Inexact Rounded +divx977 divide 1e+600000000 1e-400000008 -> Infinity Overflow Inexact Rounded +divx978 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded +divx979 divide 1e+600000000 1e-400000010 -> Infinity Overflow Inexact Rounded + +-- Sign after overflow and underflow +divx980 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx981 divide 1e-600000000 -1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx982 divide -1e-600000000 1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx983 divide -1e-600000000 -1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx984 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded +divx985 divide 1e+600000000 -1e-400000009 -> -Infinity Overflow Inexact Rounded +divx986 divide -1e+600000000 1e-400000009 -> -Infinity Overflow Inexact Rounded +divx987 divide -1e+600000000 -1e-400000009 -> Infinity Overflow Inexact Rounded + +-- Long operand overflow may be a different path +precision: 3 +divx990 divide 1000 9.999E-999999999 -> Infinity Inexact Overflow Rounded +divx991 divide 1000 -9.999E-999999999 -> -Infinity Inexact Overflow Rounded +divx992 divide 9.999E+999999999 0.01 -> Infinity Inexact Overflow Rounded +divx993 divide -9.999E+999999999 0.01 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +divx1001 divide 1.52444E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow +divx1002 divide 1.52445E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow +divx1003 divide 1.52446E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- a rounding problem in one implementation +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Unbounded answer to 40 digits: +-- 1.465811965811965811965811965811965811966E+7000 +divx1010 divide 343E6000 234E-1000 -> Infinity Overflow Inexact Rounded + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 7 +divx1021 divide 1E0 1E0 -> 1 +divx1022 divide 1E0 2E0 -> 0.5 +divx1023 divide 1E0 3E0 -> 0.3333333 Inexact Rounded +divx1024 divide 100E-2 1000E-3 -> 1 +divx1025 divide 24E-1 2E0 -> 1.2 +divx1026 divide 2400E-3 2E0 -> 1.200 +divx1027 divide 5E0 2E0 -> 2.5 +divx1028 divide 5E0 20E-1 -> 2.5 +divx1029 divide 5E0 2000E-3 -> 2.5 +divx1030 divide 5E0 2E-1 -> 25 +divx1031 divide 5E0 20E-2 -> 25 +divx1032 divide 480E-2 3E0 -> 1.60 +divx1033 divide 47E-1 2E0 -> 2.35 + +-- ECMAScript bad examples +rounding: half_down +precision: 7 +divx1050 divide 5 9 -> 0.5555556 Inexact Rounded +rounding: half_even +divx1051 divide 5 11 -> 0.4545455 Inexact Rounded + +-- payload decapitate +precision: 5 +divx1055 divide sNaN987654321 1 -> NaN54321 Invalid_operation + +-- Null tests +divx9998 divide 10 # -> NaN Invalid_operation +divx9999 divide # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/divideint.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/divideint.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,486 @@ +------------------------------------------------------------------------ +-- divideint.decTest -- decimal integer division -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +dvix001 divideint 1 1 -> 1 +dvix002 divideint 2 1 -> 2 +dvix003 divideint 1 2 -> 0 +dvix004 divideint 2 2 -> 1 +dvix005 divideint 0 1 -> 0 +dvix006 divideint 0 2 -> 0 +dvix007 divideint 1 3 -> 0 +dvix008 divideint 2 3 -> 0 +dvix009 divideint 3 3 -> 1 + +dvix010 divideint 2.4 1 -> 2 +dvix011 divideint 2.4 -1 -> -2 +dvix012 divideint -2.4 1 -> -2 +dvix013 divideint -2.4 -1 -> 2 +dvix014 divideint 2.40 1 -> 2 +dvix015 divideint 2.400 1 -> 2 +dvix016 divideint 2.4 2 -> 1 +dvix017 divideint 2.400 2 -> 1 +dvix018 divideint 2. 2 -> 1 +dvix019 divideint 20 20 -> 1 + +dvix020 divideint 187 187 -> 1 +dvix021 divideint 5 2 -> 2 +dvix022 divideint 5 2.0 -> 2 +dvix023 divideint 5 2.000 -> 2 +dvix024 divideint 5 0.200 -> 25 +dvix025 divideint 5 0.200 -> 25 + +dvix030 divideint 1 2 -> 0 +dvix031 divideint 1 4 -> 0 +dvix032 divideint 1 8 -> 0 +dvix033 divideint 1 16 -> 0 +dvix034 divideint 1 32 -> 0 +dvix035 divideint 1 64 -> 0 +dvix040 divideint 1 -2 -> -0 +dvix041 divideint 1 -4 -> -0 +dvix042 divideint 1 -8 -> -0 +dvix043 divideint 1 -16 -> -0 +dvix044 divideint 1 -32 -> -0 +dvix045 divideint 1 -64 -> -0 +dvix050 divideint -1 2 -> -0 +dvix051 divideint -1 4 -> -0 +dvix052 divideint -1 8 -> -0 +dvix053 divideint -1 16 -> -0 +dvix054 divideint -1 32 -> -0 +dvix055 divideint -1 64 -> -0 +dvix060 divideint -1 -2 -> 0 +dvix061 divideint -1 -4 -> 0 +dvix062 divideint -1 -8 -> 0 +dvix063 divideint -1 -16 -> 0 +dvix064 divideint -1 -32 -> 0 +dvix065 divideint -1 -64 -> 0 + +-- similar with powers of ten +dvix160 divideint 1 1 -> 1 +dvix161 divideint 1 10 -> 0 +dvix162 divideint 1 100 -> 0 +dvix163 divideint 1 1000 -> 0 +dvix164 divideint 1 10000 -> 0 +dvix165 divideint 1 100000 -> 0 +dvix166 divideint 1 1000000 -> 0 +dvix167 divideint 1 10000000 -> 0 +dvix168 divideint 1 100000000 -> 0 +dvix170 divideint 1 -1 -> -1 +dvix171 divideint 1 -10 -> -0 +dvix172 divideint 1 -100 -> -0 +dvix173 divideint 1 -1000 -> -0 +dvix174 divideint 1 -10000 -> -0 +dvix175 divideint 1 -100000 -> -0 +dvix176 divideint 1 -1000000 -> -0 +dvix177 divideint 1 -10000000 -> -0 +dvix178 divideint 1 -100000000 -> -0 +dvix180 divideint -1 1 -> -1 +dvix181 divideint -1 10 -> -0 +dvix182 divideint -1 100 -> -0 +dvix183 divideint -1 1000 -> -0 +dvix184 divideint -1 10000 -> -0 +dvix185 divideint -1 100000 -> -0 +dvix186 divideint -1 1000000 -> -0 +dvix187 divideint -1 10000000 -> -0 +dvix188 divideint -1 100000000 -> -0 +dvix190 divideint -1 -1 -> 1 +dvix191 divideint -1 -10 -> 0 +dvix192 divideint -1 -100 -> 0 +dvix193 divideint -1 -1000 -> 0 +dvix194 divideint -1 -10000 -> 0 +dvix195 divideint -1 -100000 -> 0 +dvix196 divideint -1 -1000000 -> 0 +dvix197 divideint -1 -10000000 -> 0 +dvix198 divideint -1 -100000000 -> 0 + +-- some long operand cases here +dvix070 divideint 999999999 1 -> 999999999 +dvix071 divideint 999999999.4 1 -> 999999999 +dvix072 divideint 999999999.5 1 -> 999999999 +dvix073 divideint 999999999.9 1 -> 999999999 +dvix074 divideint 999999999.999 1 -> 999999999 +precision: 6 +dvix080 divideint 999999999 1 -> NaN Division_impossible +dvix081 divideint 99999999 1 -> NaN Division_impossible +dvix082 divideint 9999999 1 -> NaN Division_impossible +dvix083 divideint 999999 1 -> 999999 +dvix084 divideint 99999 1 -> 99999 +dvix085 divideint 9999 1 -> 9999 +dvix086 divideint 999 1 -> 999 +dvix087 divideint 99 1 -> 99 +dvix088 divideint 9 1 -> 9 + +precision: 9 +dvix090 divideint 0. 1 -> 0 +dvix091 divideint .0 1 -> 0 +dvix092 divideint 0.00 1 -> 0 +dvix093 divideint 0.00E+9 1 -> 0 +dvix094 divideint 0.0000E-50 1 -> 0 + +dvix100 divideint 1 1 -> 1 +dvix101 divideint 1 2 -> 0 +dvix102 divideint 1 3 -> 0 +dvix103 divideint 1 4 -> 0 +dvix104 divideint 1 5 -> 0 +dvix105 divideint 1 6 -> 0 +dvix106 divideint 1 7 -> 0 +dvix107 divideint 1 8 -> 0 +dvix108 divideint 1 9 -> 0 +dvix109 divideint 1 10 -> 0 +dvix110 divideint 1 1 -> 1 +dvix111 divideint 2 1 -> 2 +dvix112 divideint 3 1 -> 3 +dvix113 divideint 4 1 -> 4 +dvix114 divideint 5 1 -> 5 +dvix115 divideint 6 1 -> 6 +dvix116 divideint 7 1 -> 7 +dvix117 divideint 8 1 -> 8 +dvix118 divideint 9 1 -> 9 +dvix119 divideint 10 1 -> 10 + +-- from DiagBigDecimal +dvix131 divideint 101.3 1 -> 101 +dvix132 divideint 101.0 1 -> 101 +dvix133 divideint 101.3 3 -> 33 +dvix134 divideint 101.0 3 -> 33 +dvix135 divideint 2.4 1 -> 2 +dvix136 divideint 2.400 1 -> 2 +dvix137 divideint 18 18 -> 1 +dvix138 divideint 1120 1000 -> 1 +dvix139 divideint 2.4 2 -> 1 +dvix140 divideint 2.400 2 -> 1 +dvix141 divideint 0.5 2.000 -> 0 +dvix142 divideint 8.005 7 -> 1 +dvix143 divideint 5 2 -> 2 +dvix144 divideint 0 2 -> 0 +dvix145 divideint 0.00 2 -> 0 + +-- Others +dvix150 divideint 12345 4.999 -> 2469 +dvix151 divideint 12345 4.99 -> 2473 +dvix152 divideint 12345 4.9 -> 2519 +dvix153 divideint 12345 5 -> 2469 +dvix154 divideint 12345 5.1 -> 2420 +dvix155 divideint 12345 5.01 -> 2464 +dvix156 divideint 12345 5.001 -> 2468 +dvix157 divideint 101 7.6 -> 13 + +-- Various flavours of divideint by 0 +maxexponent: 999999999 +minexponent: -999999999 +dvix201 divideint 0 0 -> NaN Division_undefined +dvix202 divideint 0.0E5 0 -> NaN Division_undefined +dvix203 divideint 0.000 0 -> NaN Division_undefined +dvix204 divideint 0.0001 0 -> Infinity Division_by_zero +dvix205 divideint 0.01 0 -> Infinity Division_by_zero +dvix206 divideint 0.1 0 -> Infinity Division_by_zero +dvix207 divideint 1 0 -> Infinity Division_by_zero +dvix208 divideint 1 0.0 -> Infinity Division_by_zero +dvix209 divideint 10 0.0 -> Infinity Division_by_zero +dvix210 divideint 1E+100 0.0 -> Infinity Division_by_zero +dvix211 divideint 1E+1000 0 -> Infinity Division_by_zero +dvix214 divideint -0.0001 0 -> -Infinity Division_by_zero +dvix215 divideint -0.01 0 -> -Infinity Division_by_zero +dvix216 divideint -0.1 0 -> -Infinity Division_by_zero +dvix217 divideint -1 0 -> -Infinity Division_by_zero +dvix218 divideint -1 0.0 -> -Infinity Division_by_zero +dvix219 divideint -10 0.0 -> -Infinity Division_by_zero +dvix220 divideint -1E+100 0.0 -> -Infinity Division_by_zero +dvix221 divideint -1E+1000 0 -> -Infinity Division_by_zero + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +dvix270 divideint 1 1e999999999 -> 0 +dvix271 divideint 1 0.9e999999999 -> 0 +dvix272 divideint 1 0.99e999999999 -> 0 +dvix273 divideint 1 0.999999999e999999999 -> 0 +dvix274 divideint 9e999999999 1 -> NaN Division_impossible +dvix275 divideint 9.9e999999999 1 -> NaN Division_impossible +dvix276 divideint 9.99e999999999 1 -> NaN Division_impossible +dvix277 divideint 9.99999999e999999999 1 -> NaN Division_impossible + +dvix280 divideint 0.1 9e-999999999 -> NaN Division_impossible +dvix281 divideint 0.1 99e-999999999 -> NaN Division_impossible +dvix282 divideint 0.1 999e-999999999 -> NaN Division_impossible + +dvix283 divideint 0.1 9e-999999998 -> NaN Division_impossible +dvix284 divideint 0.1 99e-999999998 -> NaN Division_impossible +dvix285 divideint 0.1 999e-999999998 -> NaN Division_impossible +dvix286 divideint 0.1 999e-999999997 -> NaN Division_impossible +dvix287 divideint 0.1 9999e-999999997 -> NaN Division_impossible +dvix288 divideint 0.1 99999e-999999997 -> NaN Division_impossible + +-- GD edge cases: lhs smaller than rhs but more digits +dvix301 divideint 0.9 2 -> 0 +dvix302 divideint 0.9 2.0 -> 0 +dvix303 divideint 0.9 2.1 -> 0 +dvix304 divideint 0.9 2.00 -> 0 +dvix305 divideint 0.9 2.01 -> 0 +dvix306 divideint 0.12 1 -> 0 +dvix307 divideint 0.12 1.0 -> 0 +dvix308 divideint 0.12 1.00 -> 0 +dvix309 divideint 0.12 1.0 -> 0 +dvix310 divideint 0.12 1.00 -> 0 +dvix311 divideint 0.12 2 -> 0 +dvix312 divideint 0.12 2.0 -> 0 +dvix313 divideint 0.12 2.1 -> 0 +dvix314 divideint 0.12 2.00 -> 0 +dvix315 divideint 0.12 2.01 -> 0 + +-- overflow and underflow tests [from divide] +maxexponent: 999999999 +minexponent: -999999999 +dvix330 divideint +1.23456789012345E-0 9E+999999999 -> 0 +dvix331 divideint 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +dvix332 divideint +0.100 9E+999999999 -> 0 +dvix333 divideint 9E-999999999 +9.100 -> 0 +dvix335 divideint -1.23456789012345E-0 9E+999999999 -> -0 +dvix336 divideint 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +dvix337 divideint -0.100 9E+999999999 -> -0 +dvix338 divideint 9E-999999999 -9.100 -> -0 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +dvix401 divideint 12345678000 100 -> 123456780 +dvix402 divideint 1 12345678000 -> 0 +dvix403 divideint 1234567800 10 -> 123456780 +dvix404 divideint 1 1234567800 -> 0 +dvix405 divideint 1234567890 10 -> 123456789 +dvix406 divideint 1 1234567890 -> 0 +dvix407 divideint 1234567891 10 -> 123456789 +dvix408 divideint 1 1234567891 -> 0 +dvix409 divideint 12345678901 100 -> 123456789 +dvix410 divideint 1 12345678901 -> 0 +dvix411 divideint 1234567896 10 -> 123456789 +dvix412 divideint 1 1234567896 -> 0 +dvix413 divideint 12345678948 100 -> 123456789 +dvix414 divideint 12345678949 100 -> 123456789 +dvix415 divideint 12345678950 100 -> 123456789 +dvix416 divideint 12345678951 100 -> 123456789 +dvix417 divideint 12345678999 100 -> 123456789 + +precision: 15 +dvix441 divideint 12345678000 1 -> 12345678000 +dvix442 divideint 1 12345678000 -> 0 +dvix443 divideint 1234567800 1 -> 1234567800 +dvix444 divideint 1 1234567800 -> 0 +dvix445 divideint 1234567890 1 -> 1234567890 +dvix446 divideint 1 1234567890 -> 0 +dvix447 divideint 1234567891 1 -> 1234567891 +dvix448 divideint 1 1234567891 -> 0 +dvix449 divideint 12345678901 1 -> 12345678901 +dvix450 divideint 1 12345678901 -> 0 +dvix451 divideint 1234567896 1 -> 1234567896 +dvix452 divideint 1 1234567896 -> 0 + +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- more zeros, etc. +dvix531 divideint 5.00 1E-3 -> 5000 +dvix532 divideint 00.00 0.000 -> NaN Division_undefined +dvix533 divideint 00.00 0E-3 -> NaN Division_undefined +dvix534 divideint 0 -0 -> NaN Division_undefined +dvix535 divideint -0 0 -> NaN Division_undefined +dvix536 divideint -0 -0 -> NaN Division_undefined + +dvix541 divideint 0 -1 -> -0 +dvix542 divideint -0 -1 -> 0 +dvix543 divideint 0 1 -> 0 +dvix544 divideint -0 1 -> -0 +dvix545 divideint -1 0 -> -Infinity Division_by_zero +dvix546 divideint -1 -0 -> Infinity Division_by_zero +dvix547 divideint 1 0 -> Infinity Division_by_zero +dvix548 divideint 1 -0 -> -Infinity Division_by_zero + +dvix551 divideint 0.0 -1 -> -0 +dvix552 divideint -0.0 -1 -> 0 +dvix553 divideint 0.0 1 -> 0 +dvix554 divideint -0.0 1 -> -0 +dvix555 divideint -1.0 0 -> -Infinity Division_by_zero +dvix556 divideint -1.0 -0 -> Infinity Division_by_zero +dvix557 divideint 1.0 0 -> Infinity Division_by_zero +dvix558 divideint 1.0 -0 -> -Infinity Division_by_zero + +dvix561 divideint 0 -1.0 -> -0 +dvix562 divideint -0 -1.0 -> 0 +dvix563 divideint 0 1.0 -> 0 +dvix564 divideint -0 1.0 -> -0 +dvix565 divideint -1 0.0 -> -Infinity Division_by_zero +dvix566 divideint -1 -0.0 -> Infinity Division_by_zero +dvix567 divideint 1 0.0 -> Infinity Division_by_zero +dvix568 divideint 1 -0.0 -> -Infinity Division_by_zero + +dvix571 divideint 0.0 -1.0 -> -0 +dvix572 divideint -0.0 -1.0 -> 0 +dvix573 divideint 0.0 1.0 -> 0 +dvix574 divideint -0.0 1.0 -> -0 +dvix575 divideint -1.0 0.0 -> -Infinity Division_by_zero +dvix576 divideint -1.0 -0.0 -> Infinity Division_by_zero +dvix577 divideint 1.0 0.0 -> Infinity Division_by_zero +dvix578 divideint 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +dvix580 divideint Inf -Inf -> NaN Invalid_operation +dvix581 divideint Inf -1000 -> -Infinity +dvix582 divideint Inf -1 -> -Infinity +dvix583 divideint Inf -0 -> -Infinity +dvix584 divideint Inf 0 -> Infinity +dvix585 divideint Inf 1 -> Infinity +dvix586 divideint Inf 1000 -> Infinity +dvix587 divideint Inf Inf -> NaN Invalid_operation +dvix588 divideint -1000 Inf -> -0 +dvix589 divideint -Inf Inf -> NaN Invalid_operation +dvix590 divideint -1 Inf -> -0 +dvix591 divideint -0 Inf -> -0 +dvix592 divideint 0 Inf -> 0 +dvix593 divideint 1 Inf -> 0 +dvix594 divideint 1000 Inf -> 0 +dvix595 divideint Inf Inf -> NaN Invalid_operation + +dvix600 divideint -Inf -Inf -> NaN Invalid_operation +dvix601 divideint -Inf -1000 -> Infinity +dvix602 divideint -Inf -1 -> Infinity +dvix603 divideint -Inf -0 -> Infinity +dvix604 divideint -Inf 0 -> -Infinity +dvix605 divideint -Inf 1 -> -Infinity +dvix606 divideint -Inf 1000 -> -Infinity +dvix607 divideint -Inf Inf -> NaN Invalid_operation +dvix608 divideint -1000 Inf -> -0 +dvix609 divideint -Inf -Inf -> NaN Invalid_operation +dvix610 divideint -1 -Inf -> 0 +dvix611 divideint -0 -Inf -> 0 +dvix612 divideint 0 -Inf -> -0 +dvix613 divideint 1 -Inf -> -0 +dvix614 divideint 1000 -Inf -> -0 +dvix615 divideint Inf -Inf -> NaN Invalid_operation + +dvix621 divideint NaN -Inf -> NaN +dvix622 divideint NaN -1000 -> NaN +dvix623 divideint NaN -1 -> NaN +dvix624 divideint NaN -0 -> NaN +dvix625 divideint NaN 0 -> NaN +dvix626 divideint NaN 1 -> NaN +dvix627 divideint NaN 1000 -> NaN +dvix628 divideint NaN Inf -> NaN +dvix629 divideint NaN NaN -> NaN +dvix630 divideint -Inf NaN -> NaN +dvix631 divideint -1000 NaN -> NaN +dvix632 divideint -1 NaN -> NaN +dvix633 divideint -0 NaN -> NaN +dvix634 divideint 0 NaN -> NaN +dvix635 divideint 1 NaN -> NaN +dvix636 divideint 1000 NaN -> NaN +dvix637 divideint Inf NaN -> NaN + +dvix641 divideint sNaN -Inf -> NaN Invalid_operation +dvix642 divideint sNaN -1000 -> NaN Invalid_operation +dvix643 divideint sNaN -1 -> NaN Invalid_operation +dvix644 divideint sNaN -0 -> NaN Invalid_operation +dvix645 divideint sNaN 0 -> NaN Invalid_operation +dvix646 divideint sNaN 1 -> NaN Invalid_operation +dvix647 divideint sNaN 1000 -> NaN Invalid_operation +dvix648 divideint sNaN NaN -> NaN Invalid_operation +dvix649 divideint sNaN sNaN -> NaN Invalid_operation +dvix650 divideint NaN sNaN -> NaN Invalid_operation +dvix651 divideint -Inf sNaN -> NaN Invalid_operation +dvix652 divideint -1000 sNaN -> NaN Invalid_operation +dvix653 divideint -1 sNaN -> NaN Invalid_operation +dvix654 divideint -0 sNaN -> NaN Invalid_operation +dvix655 divideint 0 sNaN -> NaN Invalid_operation +dvix656 divideint 1 sNaN -> NaN Invalid_operation +dvix657 divideint 1000 sNaN -> NaN Invalid_operation +dvix658 divideint Inf sNaN -> NaN Invalid_operation +dvix659 divideint NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dvix661 divideint NaN9 -Inf -> NaN9 +dvix662 divideint NaN8 1000 -> NaN8 +dvix663 divideint NaN7 Inf -> NaN7 +dvix664 divideint -NaN6 NaN5 -> -NaN6 +dvix665 divideint -Inf NaN4 -> NaN4 +dvix666 divideint -1000 NaN3 -> NaN3 +dvix667 divideint Inf -NaN2 -> -NaN2 + +dvix671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation +dvix672 divideint sNaN98 -1 -> NaN98 Invalid_operation +dvix673 divideint sNaN97 NaN -> NaN97 Invalid_operation +dvix674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation +dvix675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation +dvix676 divideint -Inf sNaN92 -> NaN92 Invalid_operation +dvix677 divideint 0 sNaN91 -> NaN91 Invalid_operation +dvix678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation +dvix679 divideint NaN sNaN89 -> NaN89 Invalid_operation + +-- some long operand cases again +precision: 8 +dvix710 divideint 100000001 1 -> NaN Division_impossible +dvix711 divideint 100000000.4 1 -> NaN Division_impossible +dvix712 divideint 100000000.5 1 -> NaN Division_impossible +dvix713 divideint 100000000.9 1 -> NaN Division_impossible +dvix714 divideint 100000000.999 1 -> NaN Division_impossible +precision: 6 +dvix720 divideint 100000000 1 -> NaN Division_impossible +dvix721 divideint 10000000 1 -> NaN Division_impossible +dvix722 divideint 1000000 1 -> NaN Division_impossible +dvix723 divideint 100000 1 -> 100000 +dvix724 divideint 10000 1 -> 10000 +dvix725 divideint 1000 1 -> 1000 +dvix726 divideint 100 1 -> 100 +dvix727 divideint 10 1 -> 10 +dvix728 divideint 1 1 -> 1 +dvix729 divideint 1 10 -> 0 + +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +dvix732 divideint 1 0.99e999999999 -> 0 +dvix733 divideint 1 0.999999999e999999999 -> 0 +dvix734 divideint 9e999999999 1 -> NaN Division_impossible +dvix735 divideint 9.9e999999999 1 -> NaN Division_impossible +dvix736 divideint 9.99e999999999 1 -> NaN Division_impossible +dvix737 divideint 9.99999999e999999999 1 -> NaN Division_impossible + +dvix740 divideint 0.1 9e-999999999 -> NaN Division_impossible +dvix741 divideint 0.1 99e-999999999 -> NaN Division_impossible +dvix742 divideint 0.1 999e-999999999 -> NaN Division_impossible + +dvix743 divideint 0.1 9e-999999998 -> NaN Division_impossible +dvix744 divideint 0.1 99e-999999998 -> NaN Division_impossible +dvix745 divideint 0.1 999e-999999998 -> NaN Division_impossible +dvix746 divideint 0.1 999e-999999997 -> NaN Division_impossible +dvix747 divideint 0.1 9999e-999999997 -> NaN Division_impossible +dvix748 divideint 0.1 99999e-999999997 -> NaN Division_impossible + + +-- Null tests +dvix900 divideint 10 # -> NaN Invalid_operation +dvix901 divideint # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAbs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAbs.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,126 @@ +------------------------------------------------------------------------ +-- dqAbs.decTest -- decQuad absolute value, heeding sNaN -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqabs001 abs '1' -> '1' +dqabs002 abs '-1' -> '1' +dqabs003 abs '1.00' -> '1.00' +dqabs004 abs '-1.00' -> '1.00' +dqabs005 abs '0' -> '0' +dqabs006 abs '0.00' -> '0.00' +dqabs007 abs '00.0' -> '0.0' +dqabs008 abs '00.00' -> '0.00' +dqabs009 abs '00' -> '0' + +dqabs010 abs '-2' -> '2' +dqabs011 abs '2' -> '2' +dqabs012 abs '-2.00' -> '2.00' +dqabs013 abs '2.00' -> '2.00' +dqabs014 abs '-0' -> '0' +dqabs015 abs '-0.00' -> '0.00' +dqabs016 abs '-00.0' -> '0.0' +dqabs017 abs '-00.00' -> '0.00' +dqabs018 abs '-00' -> '0' + +dqabs020 abs '-2000000' -> '2000000' +dqabs021 abs '2000000' -> '2000000' + +dqabs030 abs '+0.1' -> '0.1' +dqabs031 abs '-0.1' -> '0.1' +dqabs032 abs '+0.01' -> '0.01' +dqabs033 abs '-0.01' -> '0.01' +dqabs034 abs '+0.001' -> '0.001' +dqabs035 abs '-0.001' -> '0.001' +dqabs036 abs '+0.000001' -> '0.000001' +dqabs037 abs '-0.000001' -> '0.000001' +dqabs038 abs '+0.000000000001' -> '1E-12' +dqabs039 abs '-0.000000000001' -> '1E-12' + +-- examples from decArith +dqabs040 abs '2.1' -> '2.1' +dqabs041 abs '-100' -> '100' +dqabs042 abs '101.5' -> '101.5' +dqabs043 abs '-101.5' -> '101.5' + +-- more fixed, potential LHS swaps/overlays if done by subtract 0 +dqabs060 abs '-56267E-10' -> '0.0000056267' +dqabs061 abs '-56267E-5' -> '0.56267' +dqabs062 abs '-56267E-2' -> '562.67' +dqabs063 abs '-56267E-1' -> '5626.7' +dqabs065 abs '-56267E-0' -> '56267' + +-- subnormals and underflow + +-- long operand tests +dqabs321 abs 1234567890123456 -> 1234567890123456 +dqabs322 abs 12345678000 -> 12345678000 +dqabs323 abs 1234567800 -> 1234567800 +dqabs324 abs 1234567890 -> 1234567890 +dqabs325 abs 1234567891 -> 1234567891 +dqabs326 abs 12345678901 -> 12345678901 +dqabs327 abs 1234567896 -> 1234567896 + +-- zeros +dqabs111 abs 0 -> 0 +dqabs112 abs -0 -> 0 +dqabs113 abs 0E+6 -> 0E+6 +dqabs114 abs -0E+6 -> 0E+6 +dqabs115 abs 0.0000 -> 0.0000 +dqabs116 abs -0.0000 -> 0.0000 +dqabs117 abs 0E-141 -> 0E-141 +dqabs118 abs -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +dqabs121 abs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqabs122 abs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqabs123 abs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341 +dqabs124 abs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqabs131 abs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqabs132 abs 1E-6143 -> 1E-6143 +dqabs133 abs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqabs134 abs 1E-6176 -> 1E-6176 Subnormal + +dqabs135 abs -1E-6176 -> 1E-6176 Subnormal +dqabs136 abs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqabs137 abs -1E-6143 -> 1E-6143 +dqabs138 abs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 + +-- specials +dqabs520 abs 'Inf' -> 'Infinity' +dqabs521 abs '-Inf' -> 'Infinity' +dqabs522 abs NaN -> NaN +dqabs523 abs sNaN -> NaN Invalid_operation +dqabs524 abs NaN22 -> NaN22 +dqabs525 abs sNaN33 -> NaN33 Invalid_operation +dqabs526 abs -NaN22 -> -NaN22 +dqabs527 abs -sNaN33 -> -NaN33 Invalid_operation + +-- Null tests +dqabs900 abs # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAdd.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAdd.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1215 @@ +------------------------------------------------------------------------ +-- dqAdd.decTest -- decQuad addition -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests are for decQuads only; all arguments are +-- representable in a decQuad +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- [first group are 'quick confidence check'] +dqadd001 add 1 1 -> 2 +dqadd002 add 2 3 -> 5 +dqadd003 add '5.75' '3.3' -> 9.05 +dqadd004 add '5' '-3' -> 2 +dqadd005 add '-5' '-3' -> -8 +dqadd006 add '-7' '2.5' -> -4.5 +dqadd007 add '0.7' '0.3' -> 1.0 +dqadd008 add '1.25' '1.25' -> 2.50 +dqadd009 add '1.23456789' '1.00000000' -> '2.23456789' +dqadd010 add '1.23456789' '1.00000011' -> '2.23456800' + +-- 1234567890123456 1234567890123456 +dqadd011 add '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded +dqadd012 add '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded +dqadd013 add '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999' +dqadd014 add '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd015 add '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd016 add '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd017 add '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd018 add '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded +dqadd019 add '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded +dqadd020 add '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded + +dqadd021 add 0 1 -> 1 +dqadd022 add 1 1 -> 2 +dqadd023 add 2 1 -> 3 +dqadd024 add 3 1 -> 4 +dqadd025 add 4 1 -> 5 +dqadd026 add 5 1 -> 6 +dqadd027 add 6 1 -> 7 +dqadd028 add 7 1 -> 8 +dqadd029 add 8 1 -> 9 +dqadd030 add 9 1 -> 10 + +-- some carrying effects +dqadd031 add '0.9998' '0.0000' -> '0.9998' +dqadd032 add '0.9998' '0.0001' -> '0.9999' +dqadd033 add '0.9998' '0.0002' -> '1.0000' +dqadd034 add '0.9998' '0.0003' -> '1.0001' + +dqadd035 add '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd036 add '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd037 add '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd038 add '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded +dqadd039 add '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded + +-- symmetry: +dqadd040 add '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd041 add '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd042 add '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd044 add '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded +dqadd045 add '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded + +-- same, without rounding +dqadd046 add '10000e+9' '7' -> '10000000000007' +dqadd047 add '10000e+9' '70' -> '10000000000070' +dqadd048 add '10000e+9' '700' -> '10000000000700' +dqadd049 add '10000e+9' '7000' -> '10000000007000' +dqadd050 add '10000e+9' '70000' -> '10000000070000' +dqadd051 add '10000e+9' '700000' -> '10000000700000' +dqadd052 add '10000e+9' '7000000' -> '10000007000000' + +-- examples from decarith +dqadd053 add '12' '7.00' -> '19.00' +dqadd054 add '1.3' '-1.07' -> '0.23' +dqadd055 add '1.3' '-1.30' -> '0.00' +dqadd056 add '1.3' '-2.07' -> '-0.77' +dqadd057 add '1E+2' '1E+4' -> '1.01E+4' + +-- leading zero preservation +dqadd061 add 1 '0.0001' -> '1.0001' +dqadd062 add 1 '0.00001' -> '1.00001' +dqadd063 add 1 '0.000001' -> '1.000001' +dqadd064 add 1 '0.0000001' -> '1.0000001' +dqadd065 add 1 '0.00000001' -> '1.00000001' + +-- some funny zeros [in case of bad signum] +dqadd070 add 1 0 -> 1 +dqadd071 add 1 0. -> 1 +dqadd072 add 1 .0 -> 1.0 +dqadd073 add 1 0.0 -> 1.0 +dqadd074 add 1 0.00 -> 1.00 +dqadd075 add 0 1 -> 1 +dqadd076 add 0. 1 -> 1 +dqadd077 add .0 1 -> 1.0 +dqadd078 add 0.0 1 -> 1.0 +dqadd079 add 0.00 1 -> 1.00 + +-- some carries +dqadd080 add 999999998 1 -> 999999999 +dqadd081 add 999999999 1 -> 1000000000 +dqadd082 add 99999999 1 -> 100000000 +dqadd083 add 9999999 1 -> 10000000 +dqadd084 add 999999 1 -> 1000000 +dqadd085 add 99999 1 -> 100000 +dqadd086 add 9999 1 -> 10000 +dqadd087 add 999 1 -> 1000 +dqadd088 add 99 1 -> 100 +dqadd089 add 9 1 -> 10 + + +-- more LHS swaps +dqadd090 add '-56267E-10' 0 -> '-0.0000056267' +dqadd091 add '-56267E-6' 0 -> '-0.056267' +dqadd092 add '-56267E-5' 0 -> '-0.56267' +dqadd093 add '-56267E-4' 0 -> '-5.6267' +dqadd094 add '-56267E-3' 0 -> '-56.267' +dqadd095 add '-56267E-2' 0 -> '-562.67' +dqadd096 add '-56267E-1' 0 -> '-5626.7' +dqadd097 add '-56267E-0' 0 -> '-56267' +dqadd098 add '-5E-10' 0 -> '-5E-10' +dqadd099 add '-5E-7' 0 -> '-5E-7' +dqadd100 add '-5E-6' 0 -> '-0.000005' +dqadd101 add '-5E-5' 0 -> '-0.00005' +dqadd102 add '-5E-4' 0 -> '-0.0005' +dqadd103 add '-5E-1' 0 -> '-0.5' +dqadd104 add '-5E0' 0 -> '-5' +dqadd105 add '-5E1' 0 -> '-50' +dqadd106 add '-5E5' 0 -> '-500000' +dqadd107 add '-5E33' 0 -> '-5000000000000000000000000000000000' +dqadd108 add '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded +dqadd109 add '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded +dqadd110 add '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded +dqadd111 add '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded + +-- more RHS swaps +dqadd113 add 0 '-56267E-10' -> '-0.0000056267' +dqadd114 add 0 '-56267E-6' -> '-0.056267' +dqadd116 add 0 '-56267E-5' -> '-0.56267' +dqadd117 add 0 '-56267E-4' -> '-5.6267' +dqadd119 add 0 '-56267E-3' -> '-56.267' +dqadd120 add 0 '-56267E-2' -> '-562.67' +dqadd121 add 0 '-56267E-1' -> '-5626.7' +dqadd122 add 0 '-56267E-0' -> '-56267' +dqadd123 add 0 '-5E-10' -> '-5E-10' +dqadd124 add 0 '-5E-7' -> '-5E-7' +dqadd125 add 0 '-5E-6' -> '-0.000005' +dqadd126 add 0 '-5E-5' -> '-0.00005' +dqadd127 add 0 '-5E-4' -> '-0.0005' +dqadd128 add 0 '-5E-1' -> '-0.5' +dqadd129 add 0 '-5E0' -> '-5' +dqadd130 add 0 '-5E1' -> '-50' +dqadd131 add 0 '-5E5' -> '-500000' +dqadd132 add 0 '-5E33' -> '-5000000000000000000000000000000000' +dqadd133 add 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded +dqadd134 add 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded +dqadd135 add 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded +dqadd136 add 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded + +-- related +dqadd137 add 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded +dqadd138 add -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded +dqadd139 add '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded +dqadd140 add '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded +dqadd141 add 1E+29 0.0000 -> '100000000000000000000000000000.0000' +dqadd142 add 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded +dqadd143 add 0.000 1E+30 -> '1000000000000000000000000000000.000' +dqadd144 add 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +dqadd146 add '00.0' 0 -> '0.0' +dqadd147 add '0.00' 0 -> '0.00' +dqadd148 add 0 '0.00' -> '0.00' +dqadd149 add 0 '00.0' -> '0.0' +dqadd150 add '00.0' '0.00' -> '0.00' +dqadd151 add '0.00' '00.0' -> '0.00' +dqadd152 add '3' '.3' -> '3.3' +dqadd153 add '3.' '.3' -> '3.3' +dqadd154 add '3.0' '.3' -> '3.3' +dqadd155 add '3.00' '.3' -> '3.30' +dqadd156 add '3' '3' -> '6' +dqadd157 add '3' '+3' -> '6' +dqadd158 add '3' '-3' -> '0' +dqadd159 add '0.3' '-0.3' -> '0.0' +dqadd160 add '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +dqadd161 add '1E+12' '-1' -> '999999999999' +dqadd162 add '1E+12' '1.11' -> '1000000000001.11' +dqadd163 add '1.11' '1E+12' -> '1000000000001.11' +dqadd164 add '-1' '1E+12' -> '999999999999' +dqadd165 add '7E+12' '-1' -> '6999999999999' +dqadd166 add '7E+12' '1.11' -> '7000000000001.11' +dqadd167 add '1.11' '7E+12' -> '7000000000001.11' +dqadd168 add '-1' '7E+12' -> '6999999999999' + +rounding: half_up +dqadd170 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded +dqadd171 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded +dqadd172 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded +dqadd173 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded +dqadd174 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd175 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd176 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd177 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded +dqadd178 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd179 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd180 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd181 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd182 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd183 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded + +-- and some more, including residue effects and different roundings +rounding: half_up +dqadd200 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789' +dqadd201 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd202 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd203 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd204 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd205 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd206 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd207 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd208 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd209 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd210 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd211 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd212 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd213 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd214 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd215 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd216 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790' +dqadd217 add '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd218 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd219 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded + +rounding: half_even +dqadd220 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789' +dqadd221 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd222 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd223 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd224 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd225 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd226 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd227 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd228 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd229 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd230 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd231 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd232 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd233 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd234 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd235 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd236 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790' +dqadd237 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd238 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd239 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded +-- critical few with even bottom digit... +dqadd240 add '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded +dqadd241 add '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded +dqadd242 add '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded + +rounding: down +dqadd250 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789' +dqadd251 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd252 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd253 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd254 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd255 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd256 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd257 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd258 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd259 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd260 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd261 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd262 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd263 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd264 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd265 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd266 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790' +dqadd267 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd268 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd269 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +dqadd301 add -1 1 -> 0 +dqadd302 add 0 1 -> 1 +dqadd303 add 1 1 -> 2 +dqadd304 add 12 1 -> 13 +dqadd305 add 98 1 -> 99 +dqadd306 add 99 1 -> 100 +dqadd307 add 100 1 -> 101 +dqadd308 add 101 1 -> 102 +dqadd309 add -1 -1 -> -2 +dqadd310 add 0 -1 -> -1 +dqadd311 add 1 -1 -> 0 +dqadd312 add 12 -1 -> 11 +dqadd313 add 98 -1 -> 97 +dqadd314 add 99 -1 -> 98 +dqadd315 add 100 -1 -> 99 +dqadd316 add 101 -1 -> 100 + +dqadd321 add -0.01 0.01 -> 0.00 +dqadd322 add 0.00 0.01 -> 0.01 +dqadd323 add 0.01 0.01 -> 0.02 +dqadd324 add 0.12 0.01 -> 0.13 +dqadd325 add 0.98 0.01 -> 0.99 +dqadd326 add 0.99 0.01 -> 1.00 +dqadd327 add 1.00 0.01 -> 1.01 +dqadd328 add 1.01 0.01 -> 1.02 +dqadd329 add -0.01 -0.01 -> -0.02 +dqadd330 add 0.00 -0.01 -> -0.01 +dqadd331 add 0.01 -0.01 -> 0.00 +dqadd332 add 0.12 -0.01 -> 0.11 +dqadd333 add 0.98 -0.01 -> 0.97 +dqadd334 add 0.99 -0.01 -> 0.98 +dqadd335 add 1.00 -0.01 -> 0.99 +dqadd336 add 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +dqadd340 add 1E+3 0 -> 1000 +dqadd341 add 1E+33 0 -> 1000000000000000000000000000000000 +dqadd342 add 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded +dqadd343 add 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded +-- which simply follow from these cases ... +dqadd344 add 1E+3 1 -> 1001 +dqadd345 add 1E+33 1 -> 1000000000000000000000000000000001 +dqadd346 add 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd347 add 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded +dqadd348 add 1E+3 7 -> 1007 +dqadd349 add 1E+33 7 -> 1000000000000000000000000000000007 +dqadd350 add 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded +dqadd351 add 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded + +-- tryzeros cases +rounding: half_up +dqadd360 add 0E+50 10000E+1 -> 1.0000E+5 +dqadd361 add 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded +dqadd362 add 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded +dqadd363 add 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact +dqadd364 add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111 +-- 1 234567890123456789012345678901234 + +-- a curiosity from JSR 13 testing +rounding: half_down +dqadd370 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814 +dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact +rounding: half_up +dqadd372 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814 +dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact +rounding: half_even +dqadd374 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814 +dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact + +-- ulp replacement tests +dqadd400 add 1 77e-32 -> 1.00000000000000000000000000000077 +dqadd401 add 1 77e-33 -> 1.000000000000000000000000000000077 +dqadd402 add 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded +dqadd403 add 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded +dqadd404 add 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd405 add 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd406 add 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd410 add 10 77e-32 -> 10.00000000000000000000000000000077 +dqadd411 add 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded +dqadd412 add 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded +dqadd413 add 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd414 add 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd415 add 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd416 add 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded + +dqadd420 add 77e-32 1 -> 1.00000000000000000000000000000077 +dqadd421 add 77e-33 1 -> 1.000000000000000000000000000000077 +dqadd422 add 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded +dqadd423 add 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded +dqadd424 add 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd425 add 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd426 add 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd430 add 77e-32 10 -> 10.00000000000000000000000000000077 +dqadd431 add 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded +dqadd432 add 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded +dqadd433 add 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd434 add 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd435 add 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd436 add 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded + +-- fastpath boundaries +-- 1234567890123456789012345678901234 +dqadd501 add '4444444444444444444444444444444444' '5555555555555555555555555555555555' -> '9999999999999999999999999999999999' +dqadd502 add '4444444444444444444444444444444444' '4555555555555555555555555555555555' -> '8999999999999999999999999999999999' +dqadd503 add '4444444444444444444444444444444444' '3555555555555555555055555555555555' -> '7999999999999999999499999999999999' +dqadd504 add '4444444444444444444444444444444444' '3955555555555555555555555555555555' -> '8399999999999999999999999999999999' +dqadd505 add '4444444444444444444444444444444444' '4955555555555555555555555555555555' -> '9399999999999999999999999999999999' +dqadd506 add '4444444444444444444444444444444444' '5955555555555555555555555555555555' -> 1.040000000000000000000000000000000E+34 Inexact Rounded +dqadd511 add '344444444444444444444444444444444' '555555555555555555555555555555555' -> '899999999999999999999999999999999' +dqadd512 add '34444444444444444444444444444444' '55555555555555555555555555555555' -> '89999999999999999999999999999999' +dqadd513 add '3444444444444444444444444444444' '5555555555555555555555555555555' -> '8999999999999999999999999999999' +dqadd514 add '344444444444444444444444444444' '555555555555555555555555555555' -> '899999999999999999999999999999' +dqadd515 add '34444444444444444444444444444' '55555555555555555555555555555' -> '89999999999999999999999999999' +dqadd516 add '3444444444444444444444444444' '5555555555555555555555555555' -> '8999999999999999999999999999' +dqadd517 add '344444444444444444444444444' '555555555555555555555555555' -> '899999999999999999999999999' +dqadd518 add '34444444444444444444444444' '55555555555555555555555555' -> '89999999999999999999999999' +dqadd519 add '3444444444444444444444444' '5555555555555555555555555' -> '8999999999999999999999999' +dqadd520 add '344444444444444444444444' '555555555555555555555555' -> '899999999999999999999999' +dqadd521 add '34444444444444444444444' '55555555555555555555555' -> '89999999999999999999999' +dqadd522 add '3444444444444444444444' '5555555555555555555555' -> '8999999999999999999999' +dqadd523 add '4444444444444444444444' '3333333333333333333333' -> '7777777777777777777777' +dqadd524 add '344444444444444444444' '555555555555555555555' -> '899999999999999999999' +dqadd525 add '34444444444444444444' '55555555555555555555' -> '89999999999999999999' +dqadd526 add '3444444444444444444' '5555555555555555555' -> '8999999999999999999' +dqadd527 add '344444444444444444' '555555555555555555' -> '899999999999999999' +dqadd528 add '34444444444444444' '55555555555555555' -> '89999999999999999' +dqadd529 add '3444444444444444' '5555555555555555' -> '8999999999999999' +dqadd530 add '344444444444444' '555555555555555' -> '899999999999999' +dqadd531 add '34444444444444' '55555555555555' -> '89999999999999' +dqadd532 add '3444444444444' '5555555555555' -> '8999999999999' +dqadd533 add '344444444444' '555555555555' -> '899999999999' +dqadd534 add '34444444444' '55555555555' -> '89999999999' +dqadd535 add '3444444444' '5555555555' -> '8999999999' +dqadd536 add '344444444' '555555555' -> '899999999' +dqadd537 add '34444444' '55555555' -> '89999999' +dqadd538 add '3444444' '5555555' -> '8999999' +dqadd539 add '344444' '555555' -> '899999' +dqadd540 add '34444' '55555' -> '89999' +dqadd541 add '3444' '5555' -> '8999' +dqadd542 add '344' '555' -> '899' +dqadd543 add '34' '55' -> '89' +dqadd544 add '3' '5' -> '8' + +dqadd545 add '3000004000000000000000000000000000' '3000000000000040000000000000000000' -> '6000004000000040000000000000000000' +dqadd546 add '3000000400000000000000000000000000' '4000000000000400000000000000000000' -> '7000000400000400000000000000000000' +dqadd547 add '3000000040000000000000000000000000' '5000000000004000000000000000000000' -> '8000000040004000000000000000000000' +dqadd548 add '4000000004000000000000000000000000' '3000000000040000000000000000000000' -> '7000000004040000000000000000000000' +dqadd549 add '4000000000400000000000000000000000' '4000000000400000000000000000000000' -> '8000000000800000000000000000000000' +dqadd550 add '4000000000040000000000000000000000' '5000000004000000000000000000000000' -> '9000000004040000000000000000000000' +dqadd551 add '5000000000004000000000000000000000' '3000000040000000000000000000000000' -> '8000000040004000000000000000000000' +dqadd552 add '5000000000000400000000000000000000' '4000000400000000000000000000000000' -> '9000000400000400000000000000000000' +dqadd553 add '5000000000000040000000000000000000' '5000004000000000000000000000000000' -> 1.000000400000004000000000000000000E+34 Rounded +-- check propagation +dqadd554 add '8999999999999999999999999999999999' '0000000000000000000000000000000001' -> 9000000000000000000000000000000000 +dqadd555 add '0000000000000000000000000000000001' '8999999999999999999999999999999999' -> 9000000000000000000000000000000000 +dqadd556 add '4444444444444444444444444444444444' '4555555555555555555555555555555556' -> 9000000000000000000000000000000000 +dqadd557 add '4555555555555555555555555555555556' '4444444444444444444444444444444444' -> 9000000000000000000000000000000000 + +-- negative ulps +dqadd6440 add 1 -77e-32 -> 0.99999999999999999999999999999923 +dqadd6441 add 1 -77e-33 -> 0.999999999999999999999999999999923 +dqadd6442 add 1 -77e-34 -> 0.9999999999999999999999999999999923 +dqadd6443 add 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded +dqadd6444 add 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded +dqadd6445 add 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd6446 add 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd6450 add 10 -77e-32 -> 9.99999999999999999999999999999923 +dqadd6451 add 10 -77e-33 -> 9.999999999999999999999999999999923 +dqadd6452 add 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded +dqadd6453 add 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded +dqadd6454 add 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd6455 add 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd6456 add 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded + +dqadd6460 add -77e-32 1 -> 0.99999999999999999999999999999923 +dqadd6461 add -77e-33 1 -> 0.999999999999999999999999999999923 +dqadd6462 add -77e-34 1 -> 0.9999999999999999999999999999999923 +dqadd6463 add -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded +dqadd6464 add -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded +dqadd6465 add -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd6466 add -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd6470 add -77e-32 10 -> 9.99999999999999999999999999999923 +dqadd6471 add -77e-33 10 -> 9.999999999999999999999999999999923 +dqadd6472 add -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded +dqadd6473 add -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded +dqadd6474 add -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd6475 add -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd6476 add -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded + +-- negative ulps +dqadd6480 add -1 77e-32 -> -0.99999999999999999999999999999923 +dqadd6481 add -1 77e-33 -> -0.999999999999999999999999999999923 +dqadd6482 add -1 77e-34 -> -0.9999999999999999999999999999999923 +dqadd6483 add -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded +dqadd6484 add -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded +dqadd6485 add -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded +dqadd6486 add -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded + +dqadd6490 add -10 77e-32 -> -9.99999999999999999999999999999923 +dqadd6491 add -10 77e-33 -> -9.999999999999999999999999999999923 +dqadd6492 add -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded +dqadd6493 add -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded +dqadd6494 add -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd6495 add -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd6496 add -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded + +dqadd6500 add 77e-32 -1 -> -0.99999999999999999999999999999923 +dqadd6501 add 77e-33 -1 -> -0.999999999999999999999999999999923 +dqadd6502 add 77e-34 -1 -> -0.9999999999999999999999999999999923 +dqadd6503 add 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded +dqadd6504 add 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded +dqadd6505 add 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded +dqadd6506 add 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded + +dqadd6510 add 77e-32 -10 -> -9.99999999999999999999999999999923 +dqadd6511 add 77e-33 -10 -> -9.999999999999999999999999999999923 +dqadd6512 add 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded +dqadd6513 add 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded +dqadd6514 add 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd6515 add 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd6516 add 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded + +-- and some more residue effects and different roundings +rounding: half_up +dqadd6540 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789' +dqadd6541 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6542 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6543 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6544 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6545 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6546 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6547 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6548 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6549 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6550 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6551 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6552 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6553 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6554 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6555 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6556 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790' +dqadd6557 add '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6558 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6559 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded + +rounding: half_even +dqadd6560 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789' +dqadd6561 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6562 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6563 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6564 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6565 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6566 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6567 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd6568 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6569 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6570 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6571 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6572 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6573 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6574 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6575 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6576 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790' +dqadd6577 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6578 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd6579 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded + +-- critical few with even bottom digit... +dqadd7540 add '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded +dqadd7541 add '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded +dqadd7542 add '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded + +rounding: down +dqadd7550 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789' +dqadd7551 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7552 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7553 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7554 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7555 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7556 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7557 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7558 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7559 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7560 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7561 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7562 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7563 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7564 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7565 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd7566 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790' +dqadd7567 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd7568 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd7569 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded + +-- more zeros, etc. +rounding: half_even + +dqadd7701 add 5.00 1.00E-3 -> 5.00100 +dqadd7702 add 00.00 0.000 -> 0.000 +dqadd7703 add 00.00 0E-3 -> 0.000 +dqadd7704 add 0E-3 00.00 -> 0.000 + +dqadd7710 add 0E+3 00.00 -> 0.00 +dqadd7711 add 0E+3 00.0 -> 0.0 +dqadd7712 add 0E+3 00. -> 0 +dqadd7713 add 0E+3 00.E+1 -> 0E+1 +dqadd7714 add 0E+3 00.E+2 -> 0E+2 +dqadd7715 add 0E+3 00.E+3 -> 0E+3 +dqadd7716 add 0E+3 00.E+4 -> 0E+3 +dqadd7717 add 0E+3 00.E+5 -> 0E+3 +dqadd7718 add 0E+3 -00.0 -> 0.0 +dqadd7719 add 0E+3 -00. -> 0 +dqadd7731 add 0E+3 -00.E+1 -> 0E+1 + +dqadd7720 add 00.00 0E+3 -> 0.00 +dqadd7721 add 00.0 0E+3 -> 0.0 +dqadd7722 add 00. 0E+3 -> 0 +dqadd7723 add 00.E+1 0E+3 -> 0E+1 +dqadd7724 add 00.E+2 0E+3 -> 0E+2 +dqadd7725 add 00.E+3 0E+3 -> 0E+3 +dqadd7726 add 00.E+4 0E+3 -> 0E+3 +dqadd7727 add 00.E+5 0E+3 -> 0E+3 +dqadd7728 add -00.00 0E+3 -> 0.00 +dqadd7729 add -00.0 0E+3 -> 0.0 +dqadd7730 add -00. 0E+3 -> 0 + +dqadd7732 add 0 0 -> 0 +dqadd7733 add 0 -0 -> 0 +dqadd7734 add -0 0 -> 0 +dqadd7735 add -0 -0 -> -0 -- IEEE 854 special case + +dqadd7736 add 1 -1 -> 0 +dqadd7737 add -1 -1 -> -2 +dqadd7738 add 1 1 -> 2 +dqadd7739 add -1 1 -> 0 + +dqadd7741 add 0 -1 -> -1 +dqadd7742 add -0 -1 -> -1 +dqadd7743 add 0 1 -> 1 +dqadd7744 add -0 1 -> 1 +dqadd7745 add -1 0 -> -1 +dqadd7746 add -1 -0 -> -1 +dqadd7747 add 1 0 -> 1 +dqadd7748 add 1 -0 -> 1 + +dqadd7751 add 0.0 -1 -> -1.0 +dqadd7752 add -0.0 -1 -> -1.0 +dqadd7753 add 0.0 1 -> 1.0 +dqadd7754 add -0.0 1 -> 1.0 +dqadd7755 add -1.0 0 -> -1.0 +dqadd7756 add -1.0 -0 -> -1.0 +dqadd7757 add 1.0 0 -> 1.0 +dqadd7758 add 1.0 -0 -> 1.0 + +dqadd7761 add 0 -1.0 -> -1.0 +dqadd7762 add -0 -1.0 -> -1.0 +dqadd7763 add 0 1.0 -> 1.0 +dqadd7764 add -0 1.0 -> 1.0 +dqadd7765 add -1 0.0 -> -1.0 +dqadd7766 add -1 -0.0 -> -1.0 +dqadd7767 add 1 0.0 -> 1.0 +dqadd7768 add 1 -0.0 -> 1.0 + +dqadd7771 add 0.0 -1.0 -> -1.0 +dqadd7772 add -0.0 -1.0 -> -1.0 +dqadd7773 add 0.0 1.0 -> 1.0 +dqadd7774 add -0.0 1.0 -> 1.0 +dqadd7775 add -1.0 0.0 -> -1.0 +dqadd7776 add -1.0 -0.0 -> -1.0 +dqadd7777 add 1.0 0.0 -> 1.0 +dqadd7778 add 1.0 -0.0 -> 1.0 + +-- Specials +dqadd7780 add -Inf -Inf -> -Infinity +dqadd7781 add -Inf -1000 -> -Infinity +dqadd7782 add -Inf -1 -> -Infinity +dqadd7783 add -Inf -0 -> -Infinity +dqadd7784 add -Inf 0 -> -Infinity +dqadd7785 add -Inf 1 -> -Infinity +dqadd7786 add -Inf 1000 -> -Infinity +dqadd7787 add -1000 -Inf -> -Infinity +dqadd7788 add -Inf -Inf -> -Infinity +dqadd7789 add -1 -Inf -> -Infinity +dqadd7790 add -0 -Inf -> -Infinity +dqadd7791 add 0 -Inf -> -Infinity +dqadd7792 add 1 -Inf -> -Infinity +dqadd7793 add 1000 -Inf -> -Infinity +dqadd7794 add Inf -Inf -> NaN Invalid_operation + +dqadd7800 add Inf -Inf -> NaN Invalid_operation +dqadd7801 add Inf -1000 -> Infinity +dqadd7802 add Inf -1 -> Infinity +dqadd7803 add Inf -0 -> Infinity +dqadd7804 add Inf 0 -> Infinity +dqadd7805 add Inf 1 -> Infinity +dqadd7806 add Inf 1000 -> Infinity +dqadd7807 add Inf Inf -> Infinity +dqadd7808 add -1000 Inf -> Infinity +dqadd7809 add -Inf Inf -> NaN Invalid_operation +dqadd7810 add -1 Inf -> Infinity +dqadd7811 add -0 Inf -> Infinity +dqadd7812 add 0 Inf -> Infinity +dqadd7813 add 1 Inf -> Infinity +dqadd7814 add 1000 Inf -> Infinity +dqadd7815 add Inf Inf -> Infinity + +dqadd7821 add NaN -Inf -> NaN +dqadd7822 add NaN -1000 -> NaN +dqadd7823 add NaN -1 -> NaN +dqadd7824 add NaN -0 -> NaN +dqadd7825 add NaN 0 -> NaN +dqadd7826 add NaN 1 -> NaN +dqadd7827 add NaN 1000 -> NaN +dqadd7828 add NaN Inf -> NaN +dqadd7829 add NaN NaN -> NaN +dqadd7830 add -Inf NaN -> NaN +dqadd7831 add -1000 NaN -> NaN +dqadd7832 add -1 NaN -> NaN +dqadd7833 add -0 NaN -> NaN +dqadd7834 add 0 NaN -> NaN +dqadd7835 add 1 NaN -> NaN +dqadd7836 add 1000 NaN -> NaN +dqadd7837 add Inf NaN -> NaN + +dqadd7841 add sNaN -Inf -> NaN Invalid_operation +dqadd7842 add sNaN -1000 -> NaN Invalid_operation +dqadd7843 add sNaN -1 -> NaN Invalid_operation +dqadd7844 add sNaN -0 -> NaN Invalid_operation +dqadd7845 add sNaN 0 -> NaN Invalid_operation +dqadd7846 add sNaN 1 -> NaN Invalid_operation +dqadd7847 add sNaN 1000 -> NaN Invalid_operation +dqadd7848 add sNaN NaN -> NaN Invalid_operation +dqadd7849 add sNaN sNaN -> NaN Invalid_operation +dqadd7850 add NaN sNaN -> NaN Invalid_operation +dqadd7851 add -Inf sNaN -> NaN Invalid_operation +dqadd7852 add -1000 sNaN -> NaN Invalid_operation +dqadd7853 add -1 sNaN -> NaN Invalid_operation +dqadd7854 add -0 sNaN -> NaN Invalid_operation +dqadd7855 add 0 sNaN -> NaN Invalid_operation +dqadd7856 add 1 sNaN -> NaN Invalid_operation +dqadd7857 add 1000 sNaN -> NaN Invalid_operation +dqadd7858 add Inf sNaN -> NaN Invalid_operation +dqadd7859 add NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqadd7861 add NaN1 -Inf -> NaN1 +dqadd7862 add +NaN2 -1000 -> NaN2 +dqadd7863 add NaN3 1000 -> NaN3 +dqadd7864 add NaN4 Inf -> NaN4 +dqadd7865 add NaN5 +NaN6 -> NaN5 +dqadd7866 add -Inf NaN7 -> NaN7 +dqadd7867 add -1000 NaN8 -> NaN8 +dqadd7868 add 1000 NaN9 -> NaN9 +dqadd7869 add Inf +NaN10 -> NaN10 +dqadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation +dqadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation +dqadd7873 add sNaN13 1000 -> NaN13 Invalid_operation +dqadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation +dqadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation +dqadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation +dqadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation +dqadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation +dqadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation +dqadd7880 add Inf sNaN23 -> NaN23 Invalid_operation +dqadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation +dqadd7882 add -NaN26 NaN28 -> -NaN26 +dqadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation +dqadd7884 add 1000 -NaN30 -> -NaN30 +dqadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Here we explore near the boundary of rounding a subnormal to Nmin +dqadd7575 add 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal +dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal + +-- check overflow edge case +-- 1234567890123456 +dqadd7972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqadd7973 add 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7974 add 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7975 add 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded +dqadd7976 add 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded +dqadd7977 add 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded +dqadd7978 add 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded +dqadd7979 add 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded +dqadd7980 add 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded +dqadd7981 add 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7982 add 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7983 add 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7984 add 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded + +dqadd7985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 +dqadd7986 add -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7987 add -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7988 add -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded +dqadd7989 add -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded +dqadd7990 add -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded +dqadd7991 add -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded +dqadd7992 add -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded +dqadd7993 add -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded +dqadd7994 add -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7995 add -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7996 add -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd7997 add -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +dqadd71100 add 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact +dqadd71101 add 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact +dqadd71103 add +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact +dqadd71104 add 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact +dqadd71105 add 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact +dqadd71106 add 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact +dqadd71107 add 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact +dqadd71108 add 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact +dqadd71109 add 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact + +rounding: ceiling +dqadd71110 add -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact +dqadd71111 add -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact +dqadd71113 add -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact +dqadd71114 add -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact +dqadd71115 add -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact +dqadd71116 add -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact +dqadd71117 add -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact +dqadd71118 add -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact +dqadd71119 add -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +dqadd71300 add 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71310 add 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71311 add 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71312 add 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71313 add 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71314 add 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71315 add 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71316 add 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71317 add 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71318 add 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71319 add 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71320 add 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71321 add 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71322 add 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71323 add 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71324 add 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71325 add 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71326 add 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71327 add 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71328 add 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71329 add 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71330 add 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71331 add 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71332 add 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71333 add 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71334 add 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71335 add 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71336 add 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71337 add 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71338 add 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71339 add 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded + +dqadd71340 add 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded +dqadd71341 add 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded + +dqadd71349 add 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71350 add 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71351 add 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71352 add 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71353 add 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71354 add 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71355 add 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71356 add 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71357 add 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71358 add 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71359 add 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71360 add 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71361 add 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71362 add 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71363 add 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71367 add 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71368 add 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71369 add 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71370 add 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71371 add 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71372 add 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71373 add 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71374 add 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71375 add 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71376 add 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71377 add 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71378 add 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71379 add 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71380 add 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71381 add 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71383 add 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71384 add 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71385 add 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71386 add 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71387 add 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71388 add 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71389 add 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71390 add 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71391 add 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71392 add 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71393 add 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71394 add 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71395 add 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd71396 add 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +dqadd71420 add 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345 +dqadd71421 add 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345 +dqadd71422 add 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345 +dqadd71423 add 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345 +dqadd71424 add 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345 +dqadd71425 add 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345 +dqadd71426 add 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345 +dqadd71427 add 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7 +dqadd71428 add 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8 +dqadd71429 add 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9 +dqadd71430 add 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10 +dqadd71431 add 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11 +dqadd71432 add 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12 +dqadd71433 add 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13 +dqadd71434 add 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14 +dqadd71435 add 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15 +dqadd71436 add 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16 +dqadd71437 add 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17 +dqadd71438 add 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18 +dqadd71439 add 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19 +dqadd71440 add 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20 +dqadd71441 add 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21 +dqadd71442 add 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22 +dqadd71443 add 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23 +dqadd71444 add 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24 +dqadd71445 add 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25 +dqadd71446 add 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26 +dqadd71447 add 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27 +dqadd71448 add 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28 +dqadd71449 add 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29 +dqadd71450 add 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30 +dqadd71451 add 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31 +dqadd71452 add 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32 +dqadd71453 add 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33 +dqadd71454 add 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34 +dqadd71455 add 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35 +dqadd71456 add 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36 + +-- same, reversed 0 +dqadd71460 add 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345 +dqadd71461 add 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345 +dqadd71462 add 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345 +dqadd71463 add 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345 +dqadd71464 add 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345 +dqadd71465 add 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345 +dqadd71466 add 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345 +dqadd71467 add 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7 +dqadd71468 add 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8 +dqadd71469 add 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9 +dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10 +dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11 +dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12 +dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13 +dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14 +dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15 +dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16 +dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17 +dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18 +dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19 +dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20 +dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21 +dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22 +dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23 +dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24 +dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25 +dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26 +dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27 +dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28 +dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29 +dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30 +dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31 +dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32 +dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33 +dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34 +dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35 +dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36 + +-- same, Es on the 0 +dqadd71500 add 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345 +dqadd71501 add 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345 +dqadd71502 add 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345 +dqadd71503 add 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345 +dqadd71504 add 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345 +dqadd71505 add 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345 +dqadd71506 add 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345 +dqadd71507 add 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345 +dqadd71508 add 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345 +dqadd71509 add 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345 +dqadd71510 add 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345 +dqadd71511 add 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345 +dqadd71512 add 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345 +dqadd71513 add 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345 +dqadd71514 add 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345 +dqadd71515 add 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345 +dqadd71516 add 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345 +dqadd71517 add 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345 +dqadd71518 add 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345 +dqadd71519 add 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345 +dqadd71520 add 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345 +dqadd71521 add 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345 +dqadd71522 add 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345 +dqadd71523 add 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345 +dqadd71524 add 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345 +dqadd71525 add 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345 +dqadd71526 add 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345 +dqadd71527 add 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345 +dqadd71528 add 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345 +dqadd71529 add 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345 +dqadd71530 add 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345 +dqadd71531 add 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345 +dqadd71532 add 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345 +dqadd71533 add 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345 +-- next four flag Rounded because the 0 extends the result +dqadd71534 add 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded +dqadd71535 add 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded +dqadd71536 add 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded +dqadd71537 add 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +dqadd71600 add 0 0E-19 -> 0E-19 +dqadd71601 add -0 0E-19 -> 0E-19 +dqadd71602 add 0 -0E-19 -> 0E-19 +dqadd71603 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71611 add -11 11 -> 0 +dqadd71612 add 11 -11 -> 0 + +rounding: half_down +-- exact zeros from zeros +dqadd71620 add 0 0E-19 -> 0E-19 +dqadd71621 add -0 0E-19 -> 0E-19 +dqadd71622 add 0 -0E-19 -> 0E-19 +dqadd71623 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71631 add -11 11 -> 0 +dqadd71632 add 11 -11 -> 0 + +rounding: half_even +-- exact zeros from zeros +dqadd71640 add 0 0E-19 -> 0E-19 +dqadd71641 add -0 0E-19 -> 0E-19 +dqadd71642 add 0 -0E-19 -> 0E-19 +dqadd71643 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71651 add -11 11 -> 0 +dqadd71652 add 11 -11 -> 0 + +rounding: up +-- exact zeros from zeros +dqadd71660 add 0 0E-19 -> 0E-19 +dqadd71661 add -0 0E-19 -> 0E-19 +dqadd71662 add 0 -0E-19 -> 0E-19 +dqadd71663 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71671 add -11 11 -> 0 +dqadd71672 add 11 -11 -> 0 + +rounding: down +-- exact zeros from zeros +dqadd71680 add 0 0E-19 -> 0E-19 +dqadd71681 add -0 0E-19 -> 0E-19 +dqadd71682 add 0 -0E-19 -> 0E-19 +dqadd71683 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71691 add -11 11 -> 0 +dqadd71692 add 11 -11 -> 0 + +rounding: ceiling +-- exact zeros from zeros +dqadd71700 add 0 0E-19 -> 0E-19 +dqadd71701 add -0 0E-19 -> 0E-19 +dqadd71702 add 0 -0E-19 -> 0E-19 +dqadd71703 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71711 add -11 11 -> 0 +dqadd71712 add 11 -11 -> 0 + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +dqadd71720 add 0 0E-19 -> 0E-19 +dqadd71721 add -0 0E-19 -> -0E-19 -- * +dqadd71722 add 0 -0E-19 -> -0E-19 -- * +dqadd71723 add -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd71731 add -11 11 -> -0 -- * +dqadd71732 add 11 -11 -> -0 -- * + +-- Examples from SQL proposal (Krishna Kulkarni) +dqadd71741 add 130E-2 120E-2 -> 2.50 +dqadd71742 add 130E-2 12E-1 -> 2.50 +dqadd71743 add 130E-2 1E0 -> 2.30 +dqadd71744 add 1E2 1E4 -> 1.01E+4 +dqadd71745 add 130E-2 -120E-2 -> 0.10 +dqadd71746 add 130E-2 -12E-1 -> 0.10 +dqadd71747 add 130E-2 -1E0 -> 0.30 +dqadd71748 add 1E2 -1E4 -> -9.9E+3 + +-- Gappy coefficients; check residue handling even with full coefficient gap +rounding: half_even + +dqadd75001 add 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457 +dqadd75002 add 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded +dqadd75003 add 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75004 add 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75005 add 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75006 add 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75007 add 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75008 add 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75009 add 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75010 add 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75011 add 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75012 add 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75013 add 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75014 add 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75015 add 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75016 add 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75017 add 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75018 add 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75019 add 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75020 add 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd75021 add 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded + +-- widening second argument at gap +dqadd75030 add 12398765432112345678945678 1 -> 12398765432112345678945679 +dqadd75031 add 12398765432112345678945678 0.1 -> 12398765432112345678945678.1 +dqadd75032 add 12398765432112345678945678 0.12 -> 12398765432112345678945678.12 +dqadd75033 add 12398765432112345678945678 0.123 -> 12398765432112345678945678.123 +dqadd75034 add 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234 +dqadd75035 add 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345 +dqadd75036 add 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456 +dqadd75037 add 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567 +dqadd75038 add 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678 +dqadd75039 add 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75040 add 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded +dqadd75041 add 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded +dqadd75042 add 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75043 add 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75044 add 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75045 add 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75046 add 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75047 add 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75048 add 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd75049 add 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded +-- 90123456 +rounding: half_even +dqadd75050 add 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded +dqadd75051 add 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded +dqadd75052 add 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded +dqadd75053 add 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded +dqadd75054 add 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded +dqadd75055 add 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded +dqadd75056 add 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded +dqadd75057 add 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded +dqadd75060 add 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded +dqadd75061 add 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded +dqadd75062 add 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded +dqadd75063 add 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded +dqadd75064 add 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded +dqadd75065 add 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded +dqadd75066 add 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded +dqadd75067 add 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded +-- far-out residues (full coefficient gap is 16+15 digits) +rounding: up +dqadd75070 add 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001 +dqadd75071 add 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75072 add 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75073 add 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75074 add 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75075 add 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75076 add 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75077 add 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75078 add 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75079 add 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75080 add 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75081 add 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75082 add 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75083 add 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75084 add 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75085 add 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75086 add 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75087 add 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75088 add 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd75089 add 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded + +-- Null tests +dqadd9990 add 10 # -> NaN Invalid_operation +dqadd9991 add # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAnd.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqAnd.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,420 @@ +------------------------------------------------------------------------ +-- dqAnd.decTest -- digitwise logical AND for decQuads -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check (truth table) +dqand001 and 0 0 -> 0 +dqand002 and 0 1 -> 0 +dqand003 and 1 0 -> 0 +dqand004 and 1 1 -> 1 +dqand005 and 1100 1010 -> 1000 +-- and at msd and msd-1 +-- 1234567890123456789012345678901234 +dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 0 +dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 0 +dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000 + +-- Various lengths +-- 1234567890123456789012345678901234 + +dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 111111111111111111111111111111111 +dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 1011111111111111111111111111111111 +dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 1101111111111111111111111111111111 +dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1110111111111111111111111111111111 +dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 1111011111111111111111111111111111 +dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 1111101111111111111111111111111111 +dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1111110111111111111111111111111111 +dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 1111111011111111111111111111111111 +dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 1111111101111111111111111111111111 +dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1111111110111111111111111111111111 +dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 1111111111011111111111111111111111 +dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 1111111111101111111111111111111111 +dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1111111111110111111111111111111111 +dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 1111111111111011111111111111111111 +dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 1111111111111101111111111111111111 +dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1111111111111110111111111111111111 +dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 1111111111111111011111111111111111 +dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 1111111111111111101111111111111111 +dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1111111111111111110111111111111111 +dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 1111111111111111111011111111111111 +dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 1111111111111111111101111111111111 +dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1111111111111111111110111111111111 +dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 1111111111111111111111011111111111 +dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 1111111111111111111111101111111111 +dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1111111111111111111111110111111111 +dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 1111111111111111111111111011111111 +dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 1111111111111111111111111101111111 +dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1111111111111111111111111110111111 +dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 1111111111111111111111111111011111 +dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 1111111111111111111111111111101111 +dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1111111111111111111111111111110111 +dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 1111111111111111111111111111111011 +dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 1111111111111111111111111111111101 +dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1111111111111111111111111111111110 + +dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 111111111111111111111111111111111 +dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 1011111111111111111111111111111111 +dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 1101111111111111111111111111111111 +dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1110111111111111111111111111111111 +dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 1111011111111111111111111111111111 +dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 1111101111111111111111111111111111 +dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1111110111111111111111111111111111 +dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 1111111011111111111111111111111111 +dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 1111111101111111111111111111111111 +dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1111111110111111111111111111111111 +dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 1111111111011111111111111111111111 +dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 1111111111101111111111111111111111 +dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1111111111110111111111111111111111 +dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 1111111111111011111111111111111111 +dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 1111111111111101111111111111111111 +dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1111111111111110111111111111111111 +dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 1111111111111111011111111111111111 +dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 1111111111111111101111111111111111 +dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1111111111111111110111111111111111 +dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111011111111111111 +dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111101111111111111 +dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111110111111111111 +dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111011111111111 +dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111101111111111 +dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111110111111111 +dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111011111111 +dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111101111111 +dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111110111111 +dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111011111 +dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111101111 +dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111110111 +dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111011 +dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111101 +dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110 +dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 111111111111111111111111111111110 +dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110 + +dqand021 and 1111111111111111 1111111111111111 -> 1111111111111111 +dqand024 and 1111111111111111 111111111111111 -> 111111111111111 +dqand025 and 1111111111111111 11111111111111 -> 11111111111111 +dqand026 and 1111111111111111 1111111111111 -> 1111111111111 +dqand027 and 1111111111111111 111111111111 -> 111111111111 +dqand028 and 1111111111111111 11111111111 -> 11111111111 +dqand029 and 1111111111111111 1111111111 -> 1111111111 +dqand030 and 1111111111111111 111111111 -> 111111111 +dqand031 and 1111111111111111 11111111 -> 11111111 +dqand032 and 1111111111111111 1111111 -> 1111111 +dqand033 and 1111111111111111 111111 -> 111111 +dqand034 and 1111111111111111 11111 -> 11111 +dqand035 and 1111111111111111 1111 -> 1111 +dqand036 and 1111111111111111 111 -> 111 +dqand037 and 1111111111111111 11 -> 11 +dqand038 and 1111111111111111 1 -> 1 +dqand039 and 1111111111111111 0 -> 0 + +dqand040 and 1111111111111111 1111111111111111 -> 1111111111111111 +dqand041 and 111111111111111 1111111111111111 -> 111111111111111 +dqand042 and 111111111111111 1111111111111111 -> 111111111111111 +dqand043 and 11111111111111 1111111111111111 -> 11111111111111 +dqand044 and 1111111111111 1111111111111111 -> 1111111111111 +dqand045 and 111111111111 1111111111111111 -> 111111111111 +dqand046 and 11111111111 1111111111111111 -> 11111111111 +dqand047 and 1111111111 1111111111111111 -> 1111111111 +dqand048 and 111111111 1111111111111111 -> 111111111 +dqand049 and 11111111 1111111111111111 -> 11111111 +dqand050 and 1111111 1111111111111111 -> 1111111 +dqand051 and 111111 1111111111111111 -> 111111 +dqand052 and 11111 1111111111111111 -> 11111 +dqand053 and 1111 1111111111111111 -> 1111 +dqand054 and 111 1111111111111111 -> 111 +dqand055 and 11 1111111111111111 -> 11 +dqand056 and 1 1111111111111111 -> 1 +dqand057 and 0 1111111111111111 -> 0 + +dqand150 and 1111111111 1 -> 1 +dqand151 and 111111111 1 -> 1 +dqand152 and 11111111 1 -> 1 +dqand153 and 1111111 1 -> 1 +dqand154 and 111111 1 -> 1 +dqand155 and 11111 1 -> 1 +dqand156 and 1111 1 -> 1 +dqand157 and 111 1 -> 1 +dqand158 and 11 1 -> 1 +dqand159 and 1 1 -> 1 + +dqand160 and 1111111111 0 -> 0 +dqand161 and 111111111 0 -> 0 +dqand162 and 11111111 0 -> 0 +dqand163 and 1111111 0 -> 0 +dqand164 and 111111 0 -> 0 +dqand165 and 11111 0 -> 0 +dqand166 and 1111 0 -> 0 +dqand167 and 111 0 -> 0 +dqand168 and 11 0 -> 0 +dqand169 and 1 0 -> 0 + +dqand170 and 1 1111111111 -> 1 +dqand171 and 1 111111111 -> 1 +dqand172 and 1 11111111 -> 1 +dqand173 and 1 1111111 -> 1 +dqand174 and 1 111111 -> 1 +dqand175 and 1 11111 -> 1 +dqand176 and 1 1111 -> 1 +dqand177 and 1 111 -> 1 +dqand178 and 1 11 -> 1 +dqand179 and 1 1 -> 1 + +dqand180 and 0 1111111111 -> 0 +dqand181 and 0 111111111 -> 0 +dqand182 and 0 11111111 -> 0 +dqand183 and 0 1111111 -> 0 +dqand184 and 0 111111 -> 0 +dqand185 and 0 11111 -> 0 +dqand186 and 0 1111 -> 0 +dqand187 and 0 111 -> 0 +dqand188 and 0 11 -> 0 +dqand189 and 0 1 -> 0 + +dqand090 and 011111111 111111111 -> 11111111 +dqand091 and 101111111 111111111 -> 101111111 +dqand092 and 110111111 111111111 -> 110111111 +dqand093 and 111011111 111111111 -> 111011111 +dqand094 and 111101111 111111111 -> 111101111 +dqand095 and 111110111 111111111 -> 111110111 +dqand096 and 111111011 111111111 -> 111111011 +dqand097 and 111111101 111111111 -> 111111101 +dqand098 and 111111110 111111111 -> 111111110 + +dqand100 and 111111111 011111111 -> 11111111 +dqand101 and 111111111 101111111 -> 101111111 +dqand102 and 111111111 110111111 -> 110111111 +dqand103 and 111111111 111011111 -> 111011111 +dqand104 and 111111111 111101111 -> 111101111 +dqand105 and 111111111 111110111 -> 111110111 +dqand106 and 111111111 111111011 -> 111111011 +dqand107 and 111111111 111111101 -> 111111101 +dqand108 and 111111111 111111110 -> 111111110 + +-- non-0/1 should not be accepted, nor should signs +dqand220 and 111111112 111111111 -> NaN Invalid_operation +dqand221 and 333333333 333333333 -> NaN Invalid_operation +dqand222 and 555555555 555555555 -> NaN Invalid_operation +dqand223 and 777777777 777777777 -> NaN Invalid_operation +dqand224 and 999999999 999999999 -> NaN Invalid_operation +dqand225 and 222222222 999999999 -> NaN Invalid_operation +dqand226 and 444444444 999999999 -> NaN Invalid_operation +dqand227 and 666666666 999999999 -> NaN Invalid_operation +dqand228 and 888888888 999999999 -> NaN Invalid_operation +dqand229 and 999999999 222222222 -> NaN Invalid_operation +dqand230 and 999999999 444444444 -> NaN Invalid_operation +dqand231 and 999999999 666666666 -> NaN Invalid_operation +dqand232 and 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +dqand240 and 567468689 -934981942 -> NaN Invalid_operation +dqand241 and 567367689 934981942 -> NaN Invalid_operation +dqand242 and -631917772 -706014634 -> NaN Invalid_operation +dqand243 and -756253257 138579234 -> NaN Invalid_operation +dqand244 and 835590149 567435400 -> NaN Invalid_operation +-- test MSD +dqand250 and 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqand251 and 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqand252 and 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqand253 and 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqand254 and 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqand255 and 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqand256 and 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqand257 and 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqand258 and 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation +dqand259 and 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation +dqand260 and 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation +dqand261 and 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation +dqand262 and 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation +dqand263 and 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation +dqand264 and 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation +dqand265 and 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation +-- test MSD-1 +dqand270 and 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation +dqand271 and 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation +dqand272 and 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation +dqand273 and 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation +dqand274 and 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation +dqand275 and 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation +dqand276 and 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation +dqand277 and 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation +-- test LSD +dqand280 and 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation +dqand281 and 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation +dqand282 and 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation +dqand283 and 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation +dqand284 and 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation +dqand285 and 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation +dqand286 and 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation +dqand287 and 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation +-- test Middie +dqand288 and 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation +dqand289 and 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation +dqand290 and 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation +dqand291 and 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation +dqand292 and 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation +dqand293 and 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation +dqand294 and 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation +dqand295 and 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation +-- signs +dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation +dqand297 and -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation +dqand298 and 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation +dqand299 and 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 110000110000110000001000000 + +-- Nmax, Nmin, Ntiny-like +dqand331 and 2 9.99999999E+999 -> NaN Invalid_operation +dqand332 and 3 1E-999 -> NaN Invalid_operation +dqand333 and 4 1.00000000E-999 -> NaN Invalid_operation +dqand334 and 5 1E-900 -> NaN Invalid_operation +dqand335 and 6 -1E-900 -> NaN Invalid_operation +dqand336 and 7 -1.00000000E-999 -> NaN Invalid_operation +dqand337 and 8 -1E-999 -> NaN Invalid_operation +dqand338 and 9 -9.99999999E+999 -> NaN Invalid_operation +dqand341 and 9.99999999E+999 -18 -> NaN Invalid_operation +dqand342 and 1E-999 01 -> NaN Invalid_operation +dqand343 and 1.00000000E-999 -18 -> NaN Invalid_operation +dqand344 and 1E-900 18 -> NaN Invalid_operation +dqand345 and -1E-900 -10 -> NaN Invalid_operation +dqand346 and -1.00000000E-999 18 -> NaN Invalid_operation +dqand347 and -1E-999 10 -> NaN Invalid_operation +dqand348 and -9.99999999E+999 -18 -> NaN Invalid_operation + +-- A few other non-integers +dqand361 and 1.0 1 -> NaN Invalid_operation +dqand362 and 1E+1 1 -> NaN Invalid_operation +dqand363 and 0.0 1 -> NaN Invalid_operation +dqand364 and 0E+1 1 -> NaN Invalid_operation +dqand365 and 9.9 1 -> NaN Invalid_operation +dqand366 and 9E+1 1 -> NaN Invalid_operation +dqand371 and 0 1.0 -> NaN Invalid_operation +dqand372 and 0 1E+1 -> NaN Invalid_operation +dqand373 and 0 0.0 -> NaN Invalid_operation +dqand374 and 0 0E+1 -> NaN Invalid_operation +dqand375 and 0 9.9 -> NaN Invalid_operation +dqand376 and 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +dqand780 and -Inf -Inf -> NaN Invalid_operation +dqand781 and -Inf -1000 -> NaN Invalid_operation +dqand782 and -Inf -1 -> NaN Invalid_operation +dqand783 and -Inf -0 -> NaN Invalid_operation +dqand784 and -Inf 0 -> NaN Invalid_operation +dqand785 and -Inf 1 -> NaN Invalid_operation +dqand786 and -Inf 1000 -> NaN Invalid_operation +dqand787 and -1000 -Inf -> NaN Invalid_operation +dqand788 and -Inf -Inf -> NaN Invalid_operation +dqand789 and -1 -Inf -> NaN Invalid_operation +dqand790 and -0 -Inf -> NaN Invalid_operation +dqand791 and 0 -Inf -> NaN Invalid_operation +dqand792 and 1 -Inf -> NaN Invalid_operation +dqand793 and 1000 -Inf -> NaN Invalid_operation +dqand794 and Inf -Inf -> NaN Invalid_operation + +dqand800 and Inf -Inf -> NaN Invalid_operation +dqand801 and Inf -1000 -> NaN Invalid_operation +dqand802 and Inf -1 -> NaN Invalid_operation +dqand803 and Inf -0 -> NaN Invalid_operation +dqand804 and Inf 0 -> NaN Invalid_operation +dqand805 and Inf 1 -> NaN Invalid_operation +dqand806 and Inf 1000 -> NaN Invalid_operation +dqand807 and Inf Inf -> NaN Invalid_operation +dqand808 and -1000 Inf -> NaN Invalid_operation +dqand809 and -Inf Inf -> NaN Invalid_operation +dqand810 and -1 Inf -> NaN Invalid_operation +dqand811 and -0 Inf -> NaN Invalid_operation +dqand812 and 0 Inf -> NaN Invalid_operation +dqand813 and 1 Inf -> NaN Invalid_operation +dqand814 and 1000 Inf -> NaN Invalid_operation +dqand815 and Inf Inf -> NaN Invalid_operation + +dqand821 and NaN -Inf -> NaN Invalid_operation +dqand822 and NaN -1000 -> NaN Invalid_operation +dqand823 and NaN -1 -> NaN Invalid_operation +dqand824 and NaN -0 -> NaN Invalid_operation +dqand825 and NaN 0 -> NaN Invalid_operation +dqand826 and NaN 1 -> NaN Invalid_operation +dqand827 and NaN 1000 -> NaN Invalid_operation +dqand828 and NaN Inf -> NaN Invalid_operation +dqand829 and NaN NaN -> NaN Invalid_operation +dqand830 and -Inf NaN -> NaN Invalid_operation +dqand831 and -1000 NaN -> NaN Invalid_operation +dqand832 and -1 NaN -> NaN Invalid_operation +dqand833 and -0 NaN -> NaN Invalid_operation +dqand834 and 0 NaN -> NaN Invalid_operation +dqand835 and 1 NaN -> NaN Invalid_operation +dqand836 and 1000 NaN -> NaN Invalid_operation +dqand837 and Inf NaN -> NaN Invalid_operation + +dqand841 and sNaN -Inf -> NaN Invalid_operation +dqand842 and sNaN -1000 -> NaN Invalid_operation +dqand843 and sNaN -1 -> NaN Invalid_operation +dqand844 and sNaN -0 -> NaN Invalid_operation +dqand845 and sNaN 0 -> NaN Invalid_operation +dqand846 and sNaN 1 -> NaN Invalid_operation +dqand847 and sNaN 1000 -> NaN Invalid_operation +dqand848 and sNaN NaN -> NaN Invalid_operation +dqand849 and sNaN sNaN -> NaN Invalid_operation +dqand850 and NaN sNaN -> NaN Invalid_operation +dqand851 and -Inf sNaN -> NaN Invalid_operation +dqand852 and -1000 sNaN -> NaN Invalid_operation +dqand853 and -1 sNaN -> NaN Invalid_operation +dqand854 and -0 sNaN -> NaN Invalid_operation +dqand855 and 0 sNaN -> NaN Invalid_operation +dqand856 and 1 sNaN -> NaN Invalid_operation +dqand857 and 1000 sNaN -> NaN Invalid_operation +dqand858 and Inf sNaN -> NaN Invalid_operation +dqand859 and NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqand861 and NaN1 -Inf -> NaN Invalid_operation +dqand862 and +NaN2 -1000 -> NaN Invalid_operation +dqand863 and NaN3 1000 -> NaN Invalid_operation +dqand864 and NaN4 Inf -> NaN Invalid_operation +dqand865 and NaN5 +NaN6 -> NaN Invalid_operation +dqand866 and -Inf NaN7 -> NaN Invalid_operation +dqand867 and -1000 NaN8 -> NaN Invalid_operation +dqand868 and 1000 NaN9 -> NaN Invalid_operation +dqand869 and Inf +NaN10 -> NaN Invalid_operation +dqand871 and sNaN11 -Inf -> NaN Invalid_operation +dqand872 and sNaN12 -1000 -> NaN Invalid_operation +dqand873 and sNaN13 1000 -> NaN Invalid_operation +dqand874 and sNaN14 NaN17 -> NaN Invalid_operation +dqand875 and sNaN15 sNaN18 -> NaN Invalid_operation +dqand876 and NaN16 sNaN19 -> NaN Invalid_operation +dqand877 and -Inf +sNaN20 -> NaN Invalid_operation +dqand878 and -1000 sNaN21 -> NaN Invalid_operation +dqand879 and 1000 sNaN22 -> NaN Invalid_operation +dqand880 and Inf sNaN23 -> NaN Invalid_operation +dqand881 and +NaN25 +sNaN24 -> NaN Invalid_operation +dqand882 and -NaN26 NaN28 -> NaN Invalid_operation +dqand883 and -sNaN27 sNaN29 -> NaN Invalid_operation +dqand884 and 1000 -NaN30 -> NaN Invalid_operation +dqand885 and 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqBase.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqBase.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1081 @@ +------------------------------------------------------------------------ +-- dqBase.decTest -- base decQuad <--> string conversions -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This file tests base conversions from string to a decimal number +-- and back to a string (in Scientific form) + +-- Note that unlike other operations the operand is subject to rounding +-- to conform to emax and precision settings (that is, numbers will +-- conform to rules and exponent will be in permitted range). The +-- 'left hand side', therefore, may have numbers that cannot be +-- represented in a decQuad. Some testcases go to the limit of the +-- next-wider format, and hence these testcases may also be used to +-- test narrowing and widening operations. + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqbas001 toSci 0 -> 0 +dqbas002 toSci 1 -> 1 +dqbas003 toSci 1.0 -> 1.0 +dqbas004 toSci 1.00 -> 1.00 +dqbas005 toSci 10 -> 10 +dqbas006 toSci 1000 -> 1000 +dqbas007 toSci 10.0 -> 10.0 +dqbas008 toSci 10.1 -> 10.1 +dqbas009 toSci 10.4 -> 10.4 +dqbas010 toSci 10.5 -> 10.5 +dqbas011 toSci 10.6 -> 10.6 +dqbas012 toSci 10.9 -> 10.9 +dqbas013 toSci 11.0 -> 11.0 +dqbas014 toSci 1.234 -> 1.234 +dqbas015 toSci 0.123 -> 0.123 +dqbas016 toSci 0.012 -> 0.012 +dqbas017 toSci -0 -> -0 +dqbas018 toSci -0.0 -> -0.0 +dqbas019 toSci -00.00 -> -0.00 + +dqbas021 toSci -1 -> -1 +dqbas022 toSci -1.0 -> -1.0 +dqbas023 toSci -0.1 -> -0.1 +dqbas024 toSci -9.1 -> -9.1 +dqbas025 toSci -9.11 -> -9.11 +dqbas026 toSci -9.119 -> -9.119 +dqbas027 toSci -9.999 -> -9.999 + +dqbas030 toSci '123456789.123456' -> '123456789.123456' +dqbas031 toSci '123456789.000000' -> '123456789.000000' +dqbas032 toSci '123456789123456' -> '123456789123456' +dqbas033 toSci '0.0000123456789' -> '0.0000123456789' +dqbas034 toSci '0.00000123456789' -> '0.00000123456789' +dqbas035 toSci '0.000000123456789' -> '1.23456789E-7' +dqbas036 toSci '0.0000000123456789' -> '1.23456789E-8' + +dqbas037 toSci '0.123456789012344' -> '0.123456789012344' +dqbas038 toSci '0.123456789012345' -> '0.123456789012345' + +-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax) +dqbsn001 toSci -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 +dqbsn002 toSci -1E-6143 -> -1E-6143 +dqbsn003 toSci -1E-6176 -> -1E-6176 Subnormal +dqbsn004 toSci -0 -> -0 +dqbsn005 toSci +0 -> 0 +dqbsn006 toSci +1E-6176 -> 1E-6176 Subnormal +dqbsn007 toSci +1E-6143 -> 1E-6143 +dqbsn008 toSci +9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 + +-- String [many more examples are implicitly tested elsewhere] +-- strings without E cannot generate E in result +dqbas040 toSci "12" -> '12' +dqbas041 toSci "-76" -> '-76' +dqbas042 toSci "12.76" -> '12.76' +dqbas043 toSci "+12.76" -> '12.76' +dqbas044 toSci "012.76" -> '12.76' +dqbas045 toSci "+0.003" -> '0.003' +dqbas046 toSci "17." -> '17' +dqbas047 toSci ".5" -> '0.5' +dqbas048 toSci "044" -> '44' +dqbas049 toSci "0044" -> '44' +dqbas050 toSci "0.0005" -> '0.0005' +dqbas051 toSci "00.00005" -> '0.00005' +dqbas052 toSci "0.000005" -> '0.000005' +dqbas053 toSci "0.0000050" -> '0.0000050' +dqbas054 toSci "0.0000005" -> '5E-7' +dqbas055 toSci "0.00000005" -> '5E-8' +dqbas056 toSci "12345678.543210" -> '12345678.543210' +dqbas057 toSci "2345678.543210" -> '2345678.543210' +dqbas058 toSci "345678.543210" -> '345678.543210' +dqbas059 toSci "0345678.54321" -> '345678.54321' +dqbas060 toSci "345678.5432" -> '345678.5432' +dqbas061 toSci "+345678.5432" -> '345678.5432' +dqbas062 toSci "+0345678.5432" -> '345678.5432' +dqbas063 toSci "+00345678.5432" -> '345678.5432' +dqbas064 toSci "-345678.5432" -> '-345678.5432' +dqbas065 toSci "-0345678.5432" -> '-345678.5432' +dqbas066 toSci "-00345678.5432" -> '-345678.5432' +-- examples +dqbas067 toSci "5E-6" -> '0.000005' +dqbas068 toSci "50E-7" -> '0.0000050' +dqbas069 toSci "5E-7" -> '5E-7' + +-- [No exotics as no Unicode] + +-- rounded with dots in all (including edge) places +dqbas071 toSci .1234567891234567890123456780123456123 -> 0.1234567891234567890123456780123456 Inexact Rounded +dqbas072 toSci 1.234567891234567890123456780123456123 -> 1.234567891234567890123456780123456 Inexact Rounded +dqbas073 toSci 12.34567891234567890123456780123456123 -> 12.34567891234567890123456780123456 Inexact Rounded +dqbas074 toSci 123.4567891234567890123456780123456123 -> 123.4567891234567890123456780123456 Inexact Rounded +dqbas075 toSci 1234.567891234567890123456780123456123 -> 1234.567891234567890123456780123456 Inexact Rounded +dqbas076 toSci 12345.67891234567890123456780123456123 -> 12345.67891234567890123456780123456 Inexact Rounded +dqbas077 toSci 123456.7891234567890123456780123456123 -> 123456.7891234567890123456780123456 Inexact Rounded +dqbas078 toSci 1234567.891234567890123456780123456123 -> 1234567.891234567890123456780123456 Inexact Rounded +dqbas079 toSci 12345678.91234567890123456780123456123 -> 12345678.91234567890123456780123456 Inexact Rounded +dqbas080 toSci 123456789.1234567890123456780123456123 -> 123456789.1234567890123456780123456 Inexact Rounded +dqbas081 toSci 1234567891.234567890123456780123456123 -> 1234567891.234567890123456780123456 Inexact Rounded +dqbas082 toSci 12345678912.34567890123456780123456123 -> 12345678912.34567890123456780123456 Inexact Rounded +dqbas083 toSci 123456789123.4567890123456780123456123 -> 123456789123.4567890123456780123456 Inexact Rounded +dqbas084 toSci 1234567891234.567890123456780123456123 -> 1234567891234.567890123456780123456 Inexact Rounded +dqbas085 toSci 12345678912345.67890123456780123456123 -> 12345678912345.67890123456780123456 Inexact Rounded +dqbas086 toSci 123456789123456.7890123456780123456123 -> 123456789123456.7890123456780123456 Inexact Rounded +dqbas087 toSci 1234567891234567.890123456780123456123 -> 1234567891234567.890123456780123456 Inexact Rounded +dqbas088 toSci 12345678912345678.90123456780123456123 -> 12345678912345678.90123456780123456 Inexact Rounded +dqbas089 toSci 123456789123456789.0123456780123456123 -> 123456789123456789.0123456780123456 Inexact Rounded +dqbas090 toSci 1234567891234567890.123456780123456123 -> 1234567891234567890.123456780123456 Inexact Rounded +dqbas091 toSci 12345678912345678901.23456780123456123 -> 12345678912345678901.23456780123456 Inexact Rounded +dqbas092 toSci 123456789123456789012.3456780123456123 -> 123456789123456789012.3456780123456 Inexact Rounded +dqbas093 toSci 1234567891234567890123.456780123456123 -> 1234567891234567890123.456780123456 Inexact Rounded +dqbas094 toSci 12345678912345678901234.56780123456123 -> 12345678912345678901234.56780123456 Inexact Rounded +dqbas095 toSci 123456789123456789012345.6780123456123 -> 123456789123456789012345.6780123456 Inexact Rounded +dqbas096 toSci 1234567891234567890123456.780123456123 -> 1234567891234567890123456.780123456 Inexact Rounded +dqbas097 toSci 12345678912345678901234567.80123456123 -> 12345678912345678901234567.80123456 Inexact Rounded +dqbas098 toSci 123456789123456789012345678.0123456123 -> 123456789123456789012345678.0123456 Inexact Rounded +dqbas099 toSci 1234567891234567890123456780.123456123 -> 1234567891234567890123456780.123456 Inexact Rounded +dqbas100 toSci 12345678912345678901234567801.23456123 -> 12345678912345678901234567801.23456 Inexact Rounded +dqbas101 toSci 123456789123456789012345678012.3456123 -> 123456789123456789012345678012.3456 Inexact Rounded +dqbas102 toSci 1234567891234567890123456780123.456123 -> 1234567891234567890123456780123.456 Inexact Rounded +dqbas103 toSci 12345678912345678901234567801234.56123 -> 12345678912345678901234567801234.56 Inexact Rounded +dqbas104 toSci 123456789123456789012345678012345.6123 -> 123456789123456789012345678012345.6 Inexact Rounded +dqbas105 toSci 1234567891234567890123456780123456.123 -> 1234567891234567890123456780123456 Inexact Rounded +dqbas106 toSci 12345678912345678901234567801234561.23 -> 1.234567891234567890123456780123456E+34 Inexact Rounded +dqbas107 toSci 123456789123456789012345678012345612.3 -> 1.234567891234567890123456780123456E+35 Inexact Rounded +dqbas108 toSci 1234567891234567890123456780123456123. -> 1.234567891234567890123456780123456E+36 Inexact Rounded +-- 123456789012345678 + +-- Numbers with E +dqbas130 toSci "0.000E-1" -> '0.0000' +dqbas131 toSci "0.000E-2" -> '0.00000' +dqbas132 toSci "0.000E-3" -> '0.000000' +dqbas133 toSci "0.000E-4" -> '0E-7' +dqbas134 toSci "0.00E-2" -> '0.0000' +dqbas135 toSci "0.00E-3" -> '0.00000' +dqbas136 toSci "0.00E-4" -> '0.000000' +dqbas137 toSci "0.00E-5" -> '0E-7' +dqbas138 toSci "+0E+9" -> '0E+9' +dqbas139 toSci "-0E+9" -> '-0E+9' +dqbas140 toSci "1E+9" -> '1E+9' +dqbas141 toSci "1e+09" -> '1E+9' +dqbas142 toSci "1E+90" -> '1E+90' +dqbas143 toSci "+1E+009" -> '1E+9' +dqbas144 toSci "0E+9" -> '0E+9' +dqbas145 toSci "1E+9" -> '1E+9' +dqbas146 toSci "1E+09" -> '1E+9' +dqbas147 toSci "1e+90" -> '1E+90' +dqbas148 toSci "1E+009" -> '1E+9' +dqbas149 toSci "000E+9" -> '0E+9' +dqbas150 toSci "1E9" -> '1E+9' +dqbas151 toSci "1e09" -> '1E+9' +dqbas152 toSci "1E90" -> '1E+90' +dqbas153 toSci "1E009" -> '1E+9' +dqbas154 toSci "0E9" -> '0E+9' +dqbas155 toSci "0.000e+0" -> '0.000' +dqbas156 toSci "0.000E-1" -> '0.0000' +dqbas157 toSci "4E+9" -> '4E+9' +dqbas158 toSci "44E+9" -> '4.4E+10' +dqbas159 toSci "0.73e-7" -> '7.3E-8' +dqbas160 toSci "00E+9" -> '0E+9' +dqbas161 toSci "00E-9" -> '0E-9' +dqbas162 toSci "10E+9" -> '1.0E+10' +dqbas163 toSci "10E+09" -> '1.0E+10' +dqbas164 toSci "10e+90" -> '1.0E+91' +dqbas165 toSci "10E+009" -> '1.0E+10' +dqbas166 toSci "100e+9" -> '1.00E+11' +dqbas167 toSci "100e+09" -> '1.00E+11' +dqbas168 toSci "100E+90" -> '1.00E+92' +dqbas169 toSci "100e+009" -> '1.00E+11' + +dqbas170 toSci "1.265" -> '1.265' +dqbas171 toSci "1.265E-20" -> '1.265E-20' +dqbas172 toSci "1.265E-8" -> '1.265E-8' +dqbas173 toSci "1.265E-4" -> '0.0001265' +dqbas174 toSci "1.265E-3" -> '0.001265' +dqbas175 toSci "1.265E-2" -> '0.01265' +dqbas176 toSci "1.265E-1" -> '0.1265' +dqbas177 toSci "1.265E-0" -> '1.265' +dqbas178 toSci "1.265E+1" -> '12.65' +dqbas179 toSci "1.265E+2" -> '126.5' +dqbas180 toSci "1.265E+3" -> '1265' +dqbas181 toSci "1.265E+4" -> '1.265E+4' +dqbas182 toSci "1.265E+8" -> '1.265E+8' +dqbas183 toSci "1.265E+20" -> '1.265E+20' + +dqbas190 toSci "12.65" -> '12.65' +dqbas191 toSci "12.65E-20" -> '1.265E-19' +dqbas192 toSci "12.65E-8" -> '1.265E-7' +dqbas193 toSci "12.65E-4" -> '0.001265' +dqbas194 toSci "12.65E-3" -> '0.01265' +dqbas195 toSci "12.65E-2" -> '0.1265' +dqbas196 toSci "12.65E-1" -> '1.265' +dqbas197 toSci "12.65E-0" -> '12.65' +dqbas198 toSci "12.65E+1" -> '126.5' +dqbas199 toSci "12.65E+2" -> '1265' +dqbas200 toSci "12.65E+3" -> '1.265E+4' +dqbas201 toSci "12.65E+4" -> '1.265E+5' +dqbas202 toSci "12.65E+8" -> '1.265E+9' +dqbas203 toSci "12.65E+20" -> '1.265E+21' + +dqbas210 toSci "126.5" -> '126.5' +dqbas211 toSci "126.5E-20" -> '1.265E-18' +dqbas212 toSci "126.5E-8" -> '0.000001265' +dqbas213 toSci "126.5E-4" -> '0.01265' +dqbas214 toSci "126.5E-3" -> '0.1265' +dqbas215 toSci "126.5E-2" -> '1.265' +dqbas216 toSci "126.5E-1" -> '12.65' +dqbas217 toSci "126.5E-0" -> '126.5' +dqbas218 toSci "126.5E+1" -> '1265' +dqbas219 toSci "126.5E+2" -> '1.265E+4' +dqbas220 toSci "126.5E+3" -> '1.265E+5' +dqbas221 toSci "126.5E+4" -> '1.265E+6' +dqbas222 toSci "126.5E+8" -> '1.265E+10' +dqbas223 toSci "126.5E+20" -> '1.265E+22' + +dqbas230 toSci "1265" -> '1265' +dqbas231 toSci "1265E-20" -> '1.265E-17' +dqbas232 toSci "1265E-8" -> '0.00001265' +dqbas233 toSci "1265E-4" -> '0.1265' +dqbas234 toSci "1265E-3" -> '1.265' +dqbas235 toSci "1265E-2" -> '12.65' +dqbas236 toSci "1265E-1" -> '126.5' +dqbas237 toSci "1265E-0" -> '1265' +dqbas238 toSci "1265E+1" -> '1.265E+4' +dqbas239 toSci "1265E+2" -> '1.265E+5' +dqbas240 toSci "1265E+3" -> '1.265E+6' +dqbas241 toSci "1265E+4" -> '1.265E+7' +dqbas242 toSci "1265E+8" -> '1.265E+11' +dqbas243 toSci "1265E+20" -> '1.265E+23' + +dqbas250 toSci "0.1265" -> '0.1265' +dqbas251 toSci "0.1265E-20" -> '1.265E-21' +dqbas252 toSci "0.1265E-8" -> '1.265E-9' +dqbas253 toSci "0.1265E-4" -> '0.00001265' +dqbas254 toSci "0.1265E-3" -> '0.0001265' +dqbas255 toSci "0.1265E-2" -> '0.001265' +dqbas256 toSci "0.1265E-1" -> '0.01265' +dqbas257 toSci "0.1265E-0" -> '0.1265' +dqbas258 toSci "0.1265E+1" -> '1.265' +dqbas259 toSci "0.1265E+2" -> '12.65' +dqbas260 toSci "0.1265E+3" -> '126.5' +dqbas261 toSci "0.1265E+4" -> '1265' +dqbas262 toSci "0.1265E+8" -> '1.265E+7' +dqbas263 toSci "0.1265E+20" -> '1.265E+19' + +-- some more negative zeros [systematic tests below] +dqbas290 toSci "-0.000E-1" -> '-0.0000' +dqbas291 toSci "-0.000E-2" -> '-0.00000' +dqbas292 toSci "-0.000E-3" -> '-0.000000' +dqbas293 toSci "-0.000E-4" -> '-0E-7' +dqbas294 toSci "-0.00E-2" -> '-0.0000' +dqbas295 toSci "-0.00E-3" -> '-0.00000' +dqbas296 toSci "-0.0E-2" -> '-0.000' +dqbas297 toSci "-0.0E-3" -> '-0.0000' +dqbas298 toSci "-0E-2" -> '-0.00' +dqbas299 toSci "-0E-3" -> '-0.000' + +-- Engineering notation tests +dqbas301 toSci 10e12 -> 1.0E+13 +dqbas302 toEng 10e12 -> 10E+12 +dqbas303 toSci 10e11 -> 1.0E+12 +dqbas304 toEng 10e11 -> 1.0E+12 +dqbas305 toSci 10e10 -> 1.0E+11 +dqbas306 toEng 10e10 -> 100E+9 +dqbas307 toSci 10e9 -> 1.0E+10 +dqbas308 toEng 10e9 -> 10E+9 +dqbas309 toSci 10e8 -> 1.0E+9 +dqbas310 toEng 10e8 -> 1.0E+9 +dqbas311 toSci 10e7 -> 1.0E+8 +dqbas312 toEng 10e7 -> 100E+6 +dqbas313 toSci 10e6 -> 1.0E+7 +dqbas314 toEng 10e6 -> 10E+6 +dqbas315 toSci 10e5 -> 1.0E+6 +dqbas316 toEng 10e5 -> 1.0E+6 +dqbas317 toSci 10e4 -> 1.0E+5 +dqbas318 toEng 10e4 -> 100E+3 +dqbas319 toSci 10e3 -> 1.0E+4 +dqbas320 toEng 10e3 -> 10E+3 +dqbas321 toSci 10e2 -> 1.0E+3 +dqbas322 toEng 10e2 -> 1.0E+3 +dqbas323 toSci 10e1 -> 1.0E+2 +dqbas324 toEng 10e1 -> 100 +dqbas325 toSci 10e0 -> 10 +dqbas326 toEng 10e0 -> 10 +dqbas327 toSci 10e-1 -> 1.0 +dqbas328 toEng 10e-1 -> 1.0 +dqbas329 toSci 10e-2 -> 0.10 +dqbas330 toEng 10e-2 -> 0.10 +dqbas331 toSci 10e-3 -> 0.010 +dqbas332 toEng 10e-3 -> 0.010 +dqbas333 toSci 10e-4 -> 0.0010 +dqbas334 toEng 10e-4 -> 0.0010 +dqbas335 toSci 10e-5 -> 0.00010 +dqbas336 toEng 10e-5 -> 0.00010 +dqbas337 toSci 10e-6 -> 0.000010 +dqbas338 toEng 10e-6 -> 0.000010 +dqbas339 toSci 10e-7 -> 0.0000010 +dqbas340 toEng 10e-7 -> 0.0000010 +dqbas341 toSci 10e-8 -> 1.0E-7 +dqbas342 toEng 10e-8 -> 100E-9 +dqbas343 toSci 10e-9 -> 1.0E-8 +dqbas344 toEng 10e-9 -> 10E-9 +dqbas345 toSci 10e-10 -> 1.0E-9 +dqbas346 toEng 10e-10 -> 1.0E-9 +dqbas347 toSci 10e-11 -> 1.0E-10 +dqbas348 toEng 10e-11 -> 100E-12 +dqbas349 toSci 10e-12 -> 1.0E-11 +dqbas350 toEng 10e-12 -> 10E-12 +dqbas351 toSci 10e-13 -> 1.0E-12 +dqbas352 toEng 10e-13 -> 1.0E-12 + +dqbas361 toSci 7E12 -> 7E+12 +dqbas362 toEng 7E12 -> 7E+12 +dqbas363 toSci 7E11 -> 7E+11 +dqbas364 toEng 7E11 -> 700E+9 +dqbas365 toSci 7E10 -> 7E+10 +dqbas366 toEng 7E10 -> 70E+9 +dqbas367 toSci 7E9 -> 7E+9 +dqbas368 toEng 7E9 -> 7E+9 +dqbas369 toSci 7E8 -> 7E+8 +dqbas370 toEng 7E8 -> 700E+6 +dqbas371 toSci 7E7 -> 7E+7 +dqbas372 toEng 7E7 -> 70E+6 +dqbas373 toSci 7E6 -> 7E+6 +dqbas374 toEng 7E6 -> 7E+6 +dqbas375 toSci 7E5 -> 7E+5 +dqbas376 toEng 7E5 -> 700E+3 +dqbas377 toSci 7E4 -> 7E+4 +dqbas378 toEng 7E4 -> 70E+3 +dqbas379 toSci 7E3 -> 7E+3 +dqbas380 toEng 7E3 -> 7E+3 +dqbas381 toSci 7E2 -> 7E+2 +dqbas382 toEng 7E2 -> 700 +dqbas383 toSci 7E1 -> 7E+1 +dqbas384 toEng 7E1 -> 70 +dqbas385 toSci 7E0 -> 7 +dqbas386 toEng 7E0 -> 7 +dqbas387 toSci 7E-1 -> 0.7 +dqbas388 toEng 7E-1 -> 0.7 +dqbas389 toSci 7E-2 -> 0.07 +dqbas390 toEng 7E-2 -> 0.07 +dqbas391 toSci 7E-3 -> 0.007 +dqbas392 toEng 7E-3 -> 0.007 +dqbas393 toSci 7E-4 -> 0.0007 +dqbas394 toEng 7E-4 -> 0.0007 +dqbas395 toSci 7E-5 -> 0.00007 +dqbas396 toEng 7E-5 -> 0.00007 +dqbas397 toSci 7E-6 -> 0.000007 +dqbas398 toEng 7E-6 -> 0.000007 +dqbas399 toSci 7E-7 -> 7E-7 +dqbas400 toEng 7E-7 -> 700E-9 +dqbas401 toSci 7E-8 -> 7E-8 +dqbas402 toEng 7E-8 -> 70E-9 +dqbas403 toSci 7E-9 -> 7E-9 +dqbas404 toEng 7E-9 -> 7E-9 +dqbas405 toSci 7E-10 -> 7E-10 +dqbas406 toEng 7E-10 -> 700E-12 +dqbas407 toSci 7E-11 -> 7E-11 +dqbas408 toEng 7E-11 -> 70E-12 +dqbas409 toSci 7E-12 -> 7E-12 +dqbas410 toEng 7E-12 -> 7E-12 +dqbas411 toSci 7E-13 -> 7E-13 +dqbas412 toEng 7E-13 -> 700E-15 + +-- Exacts remain exact up to precision .. +dqbas420 toSci 100 -> 100 +dqbas422 toSci 1000 -> 1000 +dqbas424 toSci 999.9 -> 999.9 +dqbas426 toSci 1000.0 -> 1000.0 +dqbas428 toSci 1000.1 -> 1000.1 +dqbas430 toSci 10000 -> 10000 +dqbas432 toSci 1000000000000000000000000000000 -> 1000000000000000000000000000000 +dqbas434 toSci 10000000000000000000000000000000 -> 10000000000000000000000000000000 +dqbas436 toSci 100000000000000000000000000000000 -> 100000000000000000000000000000000 +dqbas438 toSci 1000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqbas440 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded +dqbas442 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded +dqbas444 toSci 10000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+34 Rounded Inexact +dqbas446 toSci 10000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+34 Rounded Inexact +dqbas448 toSci 100000000000000000000000000000000050 -> 1.000000000000000000000000000000000E+35 Rounded Inexact +dqbas450 toSci 10000000000000000000000000000000009 -> 1.000000000000000000000000000000001E+34 Rounded Inexact +dqbas452 toSci 100000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+35 Rounded +dqbas454 toSci 100000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+35 Rounded Inexact +dqbas456 toSci 100000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+35 Rounded Inexact +dqbas458 toSci 100000000000000000000000000000000009 -> 1.000000000000000000000000000000000E+35 Rounded Inexact +dqbas460 toSci 1000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+36 Rounded +dqbas462 toSci 1000000000000000000000000000000000300 -> 1.000000000000000000000000000000000E+36 Rounded Inexact +dqbas464 toSci 1000000000000000000000000000000000500 -> 1.000000000000000000000000000000000E+36 Rounded Inexact +dqbas466 toSci 1000000000000000000000000000000000900 -> 1.000000000000000000000000000000001E+36 Rounded Inexact +dqbas468 toSci 10000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+37 Rounded +dqbas470 toSci 10000000000000000000000000000000003000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact +dqbas472 toSci 10000000000000000000000000000000005000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact +dqbas474 toSci 10000000000000000000000000000000009000 -> 1.000000000000000000000000000000001E+37 Rounded Inexact + +-- check rounding modes heeded +rounding: ceiling +dqbsr401 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr402 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr403 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr404 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact +rounding: up +dqbsr405 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr406 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr407 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr408 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact +rounding: floor +dqbsr410 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr411 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr412 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr413 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact +rounding: half_down +dqbsr415 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr416 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr417 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr418 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr419 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact +rounding: half_even +dqbsr421 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr422 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr423 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr424 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr425 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact +rounding: down +dqbsr426 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr427 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr428 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr429 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact +rounding: half_up +dqbsr431 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded +dqbsr432 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact +dqbsr433 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact +dqbsr434 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112347 Rounded Inexact +dqbsr435 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact +-- negatives +rounding: ceiling +dqbsr501 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr502 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr503 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr504 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact +rounding: up +dqbsr505 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr506 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr507 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr508 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact +rounding: floor +dqbsr510 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr511 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr512 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr513 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact +rounding: half_down +dqbsr515 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr516 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr517 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr518 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr519 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact +rounding: half_even +dqbsr521 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr522 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr523 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr524 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr525 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact +rounding: down +dqbsr526 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr527 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr528 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr529 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact +rounding: half_up +dqbsr531 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded +dqbsr532 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact +dqbsr533 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact +dqbsr534 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112347 Rounded Inexact +dqbsr535 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact + +rounding: half_even + +-- The 'baddies' tests from DiagBigDecimal, plus some new ones +dqbas500 toSci '1..2' -> NaN Conversion_syntax +dqbas501 toSci '.' -> NaN Conversion_syntax +dqbas502 toSci '..' -> NaN Conversion_syntax +dqbas503 toSci '++1' -> NaN Conversion_syntax +dqbas504 toSci '--1' -> NaN Conversion_syntax +dqbas505 toSci '-+1' -> NaN Conversion_syntax +dqbas506 toSci '+-1' -> NaN Conversion_syntax +dqbas507 toSci '12e' -> NaN Conversion_syntax +dqbas508 toSci '12e++' -> NaN Conversion_syntax +dqbas509 toSci '12f4' -> NaN Conversion_syntax +dqbas510 toSci ' +1' -> NaN Conversion_syntax +dqbas511 toSci '+ 1' -> NaN Conversion_syntax +dqbas512 toSci '12 ' -> NaN Conversion_syntax +dqbas513 toSci ' + 1' -> NaN Conversion_syntax +dqbas514 toSci ' - 1 ' -> NaN Conversion_syntax +dqbas515 toSci 'x' -> NaN Conversion_syntax +dqbas516 toSci '-1-' -> NaN Conversion_syntax +dqbas517 toSci '12-' -> NaN Conversion_syntax +dqbas518 toSci '3+' -> NaN Conversion_syntax +dqbas519 toSci '' -> NaN Conversion_syntax +dqbas520 toSci '1e-' -> NaN Conversion_syntax +dqbas521 toSci '7e99999a' -> NaN Conversion_syntax +dqbas522 toSci '7e123567890x' -> NaN Conversion_syntax +dqbas523 toSci '7e12356789012x' -> NaN Conversion_syntax +dqbas524 toSci '' -> NaN Conversion_syntax +dqbas525 toSci 'e100' -> NaN Conversion_syntax +dqbas526 toSci '\u0e5a' -> NaN Conversion_syntax +dqbas527 toSci '\u0b65' -> NaN Conversion_syntax +dqbas528 toSci '123,65' -> NaN Conversion_syntax +dqbas529 toSci '1.34.5' -> NaN Conversion_syntax +dqbas530 toSci '.123.5' -> NaN Conversion_syntax +dqbas531 toSci '01.35.' -> NaN Conversion_syntax +dqbas532 toSci '01.35-' -> NaN Conversion_syntax +dqbas533 toSci '0000..' -> NaN Conversion_syntax +dqbas534 toSci '.0000.' -> NaN Conversion_syntax +dqbas535 toSci '00..00' -> NaN Conversion_syntax +dqbas536 toSci '111e*123' -> NaN Conversion_syntax +dqbas537 toSci '111e123-' -> NaN Conversion_syntax +dqbas538 toSci '111e+12+' -> NaN Conversion_syntax +dqbas539 toSci '111e1-3-' -> NaN Conversion_syntax +dqbas540 toSci '111e1*23' -> NaN Conversion_syntax +dqbas541 toSci '111e1e+3' -> NaN Conversion_syntax +dqbas542 toSci '1e1.0' -> NaN Conversion_syntax +dqbas543 toSci '1e123e' -> NaN Conversion_syntax +dqbas544 toSci 'ten' -> NaN Conversion_syntax +dqbas545 toSci 'ONE' -> NaN Conversion_syntax +dqbas546 toSci '1e.1' -> NaN Conversion_syntax +dqbas547 toSci '1e1.' -> NaN Conversion_syntax +dqbas548 toSci '1ee' -> NaN Conversion_syntax +dqbas549 toSci 'e+1' -> NaN Conversion_syntax +dqbas550 toSci '1.23.4' -> NaN Conversion_syntax +dqbas551 toSci '1.2.1' -> NaN Conversion_syntax +dqbas552 toSci '1E+1.2' -> NaN Conversion_syntax +dqbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax +dqbas554 toSci '1E++1' -> NaN Conversion_syntax +dqbas555 toSci '1E--1' -> NaN Conversion_syntax +dqbas556 toSci '1E+-1' -> NaN Conversion_syntax +dqbas557 toSci '1E-+1' -> NaN Conversion_syntax +dqbas558 toSci '1E''1' -> NaN Conversion_syntax +dqbas559 toSci "1E""1" -> NaN Conversion_syntax +dqbas560 toSci "1E""""" -> NaN Conversion_syntax +-- Near-specials +dqbas561 toSci "qNaN" -> NaN Conversion_syntax +dqbas562 toSci "NaNq" -> NaN Conversion_syntax +dqbas563 toSci "NaNs" -> NaN Conversion_syntax +dqbas564 toSci "Infi" -> NaN Conversion_syntax +dqbas565 toSci "Infin" -> NaN Conversion_syntax +dqbas566 toSci "Infini" -> NaN Conversion_syntax +dqbas567 toSci "Infinit" -> NaN Conversion_syntax +dqbas568 toSci "-Infinit" -> NaN Conversion_syntax +dqbas569 toSci "0Inf" -> NaN Conversion_syntax +dqbas570 toSci "9Inf" -> NaN Conversion_syntax +dqbas571 toSci "-0Inf" -> NaN Conversion_syntax +dqbas572 toSci "-9Inf" -> NaN Conversion_syntax +dqbas573 toSci "-sNa" -> NaN Conversion_syntax +dqbas574 toSci "xNaN" -> NaN Conversion_syntax +dqbas575 toSci "0sNaN" -> NaN Conversion_syntax + +-- some baddies with dots and Es and dots and specials +dqbas576 toSci 'e+1' -> NaN Conversion_syntax +dqbas577 toSci '.e+1' -> NaN Conversion_syntax +dqbas578 toSci '+.e+1' -> NaN Conversion_syntax +dqbas579 toSci '-.e+' -> NaN Conversion_syntax +dqbas580 toSci '-.e' -> NaN Conversion_syntax +dqbas581 toSci 'E+1' -> NaN Conversion_syntax +dqbas582 toSci '.E+1' -> NaN Conversion_syntax +dqbas583 toSci '+.E+1' -> NaN Conversion_syntax +dqbas584 toSci '-.E+' -> NaN Conversion_syntax +dqbas585 toSci '-.E' -> NaN Conversion_syntax + +dqbas586 toSci '.NaN' -> NaN Conversion_syntax +dqbas587 toSci '-.NaN' -> NaN Conversion_syntax +dqbas588 toSci '+.sNaN' -> NaN Conversion_syntax +dqbas589 toSci '+.Inf' -> NaN Conversion_syntax +dqbas590 toSci '.Infinity' -> NaN Conversion_syntax + +-- Zeros +dqbas601 toSci 0.000000000 -> 0E-9 +dqbas602 toSci 0.00000000 -> 0E-8 +dqbas603 toSci 0.0000000 -> 0E-7 +dqbas604 toSci 0.000000 -> 0.000000 +dqbas605 toSci 0.00000 -> 0.00000 +dqbas606 toSci 0.0000 -> 0.0000 +dqbas607 toSci 0.000 -> 0.000 +dqbas608 toSci 0.00 -> 0.00 +dqbas609 toSci 0.0 -> 0.0 +dqbas610 toSci .0 -> 0.0 +dqbas611 toSci 0. -> 0 +dqbas612 toSci -.0 -> -0.0 +dqbas613 toSci -0. -> -0 +dqbas614 toSci -0.0 -> -0.0 +dqbas615 toSci -0.00 -> -0.00 +dqbas616 toSci -0.000 -> -0.000 +dqbas617 toSci -0.0000 -> -0.0000 +dqbas618 toSci -0.00000 -> -0.00000 +dqbas619 toSci -0.000000 -> -0.000000 +dqbas620 toSci -0.0000000 -> -0E-7 +dqbas621 toSci -0.00000000 -> -0E-8 +dqbas622 toSci -0.000000000 -> -0E-9 + +dqbas630 toSci 0.00E+0 -> 0.00 +dqbas631 toSci 0.00E+1 -> 0.0 +dqbas632 toSci 0.00E+2 -> 0 +dqbas633 toSci 0.00E+3 -> 0E+1 +dqbas634 toSci 0.00E+4 -> 0E+2 +dqbas635 toSci 0.00E+5 -> 0E+3 +dqbas636 toSci 0.00E+6 -> 0E+4 +dqbas637 toSci 0.00E+7 -> 0E+5 +dqbas638 toSci 0.00E+8 -> 0E+6 +dqbas639 toSci 0.00E+9 -> 0E+7 + +dqbas640 toSci 0.0E+0 -> 0.0 +dqbas641 toSci 0.0E+1 -> 0 +dqbas642 toSci 0.0E+2 -> 0E+1 +dqbas643 toSci 0.0E+3 -> 0E+2 +dqbas644 toSci 0.0E+4 -> 0E+3 +dqbas645 toSci 0.0E+5 -> 0E+4 +dqbas646 toSci 0.0E+6 -> 0E+5 +dqbas647 toSci 0.0E+7 -> 0E+6 +dqbas648 toSci 0.0E+8 -> 0E+7 +dqbas649 toSci 0.0E+9 -> 0E+8 + +dqbas650 toSci 0E+0 -> 0 +dqbas651 toSci 0E+1 -> 0E+1 +dqbas652 toSci 0E+2 -> 0E+2 +dqbas653 toSci 0E+3 -> 0E+3 +dqbas654 toSci 0E+4 -> 0E+4 +dqbas655 toSci 0E+5 -> 0E+5 +dqbas656 toSci 0E+6 -> 0E+6 +dqbas657 toSci 0E+7 -> 0E+7 +dqbas658 toSci 0E+8 -> 0E+8 +dqbas659 toSci 0E+9 -> 0E+9 + +dqbas660 toSci 0.0E-0 -> 0.0 +dqbas661 toSci 0.0E-1 -> 0.00 +dqbas662 toSci 0.0E-2 -> 0.000 +dqbas663 toSci 0.0E-3 -> 0.0000 +dqbas664 toSci 0.0E-4 -> 0.00000 +dqbas665 toSci 0.0E-5 -> 0.000000 +dqbas666 toSci 0.0E-6 -> 0E-7 +dqbas667 toSci 0.0E-7 -> 0E-8 +dqbas668 toSci 0.0E-8 -> 0E-9 +dqbas669 toSci 0.0E-9 -> 0E-10 + +dqbas670 toSci 0.00E-0 -> 0.00 +dqbas671 toSci 0.00E-1 -> 0.000 +dqbas672 toSci 0.00E-2 -> 0.0000 +dqbas673 toSci 0.00E-3 -> 0.00000 +dqbas674 toSci 0.00E-4 -> 0.000000 +dqbas675 toSci 0.00E-5 -> 0E-7 +dqbas676 toSci 0.00E-6 -> 0E-8 +dqbas677 toSci 0.00E-7 -> 0E-9 +dqbas678 toSci 0.00E-8 -> 0E-10 +dqbas679 toSci 0.00E-9 -> 0E-11 + +dqbas680 toSci 000000. -> 0 +dqbas681 toSci 00000. -> 0 +dqbas682 toSci 0000. -> 0 +dqbas683 toSci 000. -> 0 +dqbas684 toSci 00. -> 0 +dqbas685 toSci 0. -> 0 +dqbas686 toSci +00000. -> 0 +dqbas687 toSci -00000. -> -0 +dqbas688 toSci +0. -> 0 +dqbas689 toSci -0. -> -0 + +-- Specials +dqbas700 toSci "NaN" -> NaN +dqbas701 toSci "nan" -> NaN +dqbas702 toSci "nAn" -> NaN +dqbas703 toSci "NAN" -> NaN +dqbas704 toSci "+NaN" -> NaN +dqbas705 toSci "+nan" -> NaN +dqbas706 toSci "+nAn" -> NaN +dqbas707 toSci "+NAN" -> NaN +dqbas708 toSci "-NaN" -> -NaN +dqbas709 toSci "-nan" -> -NaN +dqbas710 toSci "-nAn" -> -NaN +dqbas711 toSci "-NAN" -> -NaN +dqbas712 toSci 'NaN0' -> NaN +dqbas713 toSci 'NaN1' -> NaN1 +dqbas714 toSci 'NaN12' -> NaN12 +dqbas715 toSci 'NaN123' -> NaN123 +dqbas716 toSci 'NaN1234' -> NaN1234 +dqbas717 toSci 'NaN01' -> NaN1 +dqbas718 toSci 'NaN012' -> NaN12 +dqbas719 toSci 'NaN0123' -> NaN123 +dqbas720 toSci 'NaN01234' -> NaN1234 +dqbas721 toSci 'NaN001' -> NaN1 +dqbas722 toSci 'NaN0012' -> NaN12 +dqbas723 toSci 'NaN00123' -> NaN123 +dqbas724 toSci 'NaN001234' -> NaN1234 +dqbas725 toSci 'NaN1234567890123456781234567890123456' -> NaN Conversion_syntax +dqbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax +dqbas727 toSci 'NaN12.45' -> NaN Conversion_syntax +dqbas728 toSci 'NaN-12' -> NaN Conversion_syntax +dqbas729 toSci 'NaN+12' -> NaN Conversion_syntax + +dqbas730 toSci "sNaN" -> sNaN +dqbas731 toSci "snan" -> sNaN +dqbas732 toSci "SnAn" -> sNaN +dqbas733 toSci "SNAN" -> sNaN +dqbas734 toSci "+sNaN" -> sNaN +dqbas735 toSci "+snan" -> sNaN +dqbas736 toSci "+SnAn" -> sNaN +dqbas737 toSci "+SNAN" -> sNaN +dqbas738 toSci "-sNaN" -> -sNaN +dqbas739 toSci "-snan" -> -sNaN +dqbas740 toSci "-SnAn" -> -sNaN +dqbas741 toSci "-SNAN" -> -sNaN +dqbas742 toSci 'sNaN0000' -> sNaN +dqbas743 toSci 'sNaN7' -> sNaN7 +dqbas744 toSci 'sNaN007234' -> sNaN7234 +dqbas745 toSci 'sNaN1234567890123456787234561234567890' -> NaN Conversion_syntax +dqbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax +dqbas747 toSci 'sNaN-72' -> NaN Conversion_syntax + +dqbas748 toSci "Inf" -> Infinity +dqbas749 toSci "inf" -> Infinity +dqbas750 toSci "iNf" -> Infinity +dqbas751 toSci "INF" -> Infinity +dqbas752 toSci "+Inf" -> Infinity +dqbas753 toSci "+inf" -> Infinity +dqbas754 toSci "+iNf" -> Infinity +dqbas755 toSci "+INF" -> Infinity +dqbas756 toSci "-Inf" -> -Infinity +dqbas757 toSci "-inf" -> -Infinity +dqbas758 toSci "-iNf" -> -Infinity +dqbas759 toSci "-INF" -> -Infinity + +dqbas760 toSci "Infinity" -> Infinity +dqbas761 toSci "infinity" -> Infinity +dqbas762 toSci "iNfInItY" -> Infinity +dqbas763 toSci "INFINITY" -> Infinity +dqbas764 toSci "+Infinity" -> Infinity +dqbas765 toSci "+infinity" -> Infinity +dqbas766 toSci "+iNfInItY" -> Infinity +dqbas767 toSci "+INFINITY" -> Infinity +dqbas768 toSci "-Infinity" -> -Infinity +dqbas769 toSci "-infinity" -> -Infinity +dqbas770 toSci "-iNfInItY" -> -Infinity +dqbas771 toSci "-INFINITY" -> -Infinity + +-- Specials and zeros for toEng +dqbast772 toEng "NaN" -> NaN +dqbast773 toEng "-Infinity" -> -Infinity +dqbast774 toEng "-sNaN" -> -sNaN +dqbast775 toEng "-NaN" -> -NaN +dqbast776 toEng "+Infinity" -> Infinity +dqbast778 toEng "+sNaN" -> sNaN +dqbast779 toEng "+NaN" -> NaN +dqbast780 toEng "INFINITY" -> Infinity +dqbast781 toEng "SNAN" -> sNaN +dqbast782 toEng "NAN" -> NaN +dqbast783 toEng "infinity" -> Infinity +dqbast784 toEng "snan" -> sNaN +dqbast785 toEng "nan" -> NaN +dqbast786 toEng "InFINITY" -> Infinity +dqbast787 toEng "SnAN" -> sNaN +dqbast788 toEng "nAN" -> NaN +dqbast789 toEng "iNfinity" -> Infinity +dqbast790 toEng "sNan" -> sNaN +dqbast791 toEng "Nan" -> NaN +dqbast792 toEng "Infinity" -> Infinity +dqbast793 toEng "sNaN" -> sNaN + +-- Zero toEng, etc. +dqbast800 toEng 0e+1 -> "0.00E+3" -- doc example + +dqbast801 toEng 0.000000000 -> 0E-9 +dqbast802 toEng 0.00000000 -> 0.00E-6 +dqbast803 toEng 0.0000000 -> 0.0E-6 +dqbast804 toEng 0.000000 -> 0.000000 +dqbast805 toEng 0.00000 -> 0.00000 +dqbast806 toEng 0.0000 -> 0.0000 +dqbast807 toEng 0.000 -> 0.000 +dqbast808 toEng 0.00 -> 0.00 +dqbast809 toEng 0.0 -> 0.0 +dqbast810 toEng .0 -> 0.0 +dqbast811 toEng 0. -> 0 +dqbast812 toEng -.0 -> -0.0 +dqbast813 toEng -0. -> -0 +dqbast814 toEng -0.0 -> -0.0 +dqbast815 toEng -0.00 -> -0.00 +dqbast816 toEng -0.000 -> -0.000 +dqbast817 toEng -0.0000 -> -0.0000 +dqbast818 toEng -0.00000 -> -0.00000 +dqbast819 toEng -0.000000 -> -0.000000 +dqbast820 toEng -0.0000000 -> -0.0E-6 +dqbast821 toEng -0.00000000 -> -0.00E-6 +dqbast822 toEng -0.000000000 -> -0E-9 + +dqbast830 toEng 0.00E+0 -> 0.00 +dqbast831 toEng 0.00E+1 -> 0.0 +dqbast832 toEng 0.00E+2 -> 0 +dqbast833 toEng 0.00E+3 -> 0.00E+3 +dqbast834 toEng 0.00E+4 -> 0.0E+3 +dqbast835 toEng 0.00E+5 -> 0E+3 +dqbast836 toEng 0.00E+6 -> 0.00E+6 +dqbast837 toEng 0.00E+7 -> 0.0E+6 +dqbast838 toEng 0.00E+8 -> 0E+6 +dqbast839 toEng 0.00E+9 -> 0.00E+9 + +dqbast840 toEng 0.0E+0 -> 0.0 +dqbast841 toEng 0.0E+1 -> 0 +dqbast842 toEng 0.0E+2 -> 0.00E+3 +dqbast843 toEng 0.0E+3 -> 0.0E+3 +dqbast844 toEng 0.0E+4 -> 0E+3 +dqbast845 toEng 0.0E+5 -> 0.00E+6 +dqbast846 toEng 0.0E+6 -> 0.0E+6 +dqbast847 toEng 0.0E+7 -> 0E+6 +dqbast848 toEng 0.0E+8 -> 0.00E+9 +dqbast849 toEng 0.0E+9 -> 0.0E+9 + +dqbast850 toEng 0E+0 -> 0 +dqbast851 toEng 0E+1 -> 0.00E+3 +dqbast852 toEng 0E+2 -> 0.0E+3 +dqbast853 toEng 0E+3 -> 0E+3 +dqbast854 toEng 0E+4 -> 0.00E+6 +dqbast855 toEng 0E+5 -> 0.0E+6 +dqbast856 toEng 0E+6 -> 0E+6 +dqbast857 toEng 0E+7 -> 0.00E+9 +dqbast858 toEng 0E+8 -> 0.0E+9 +dqbast859 toEng 0E+9 -> 0E+9 + +dqbast860 toEng 0.0E-0 -> 0.0 +dqbast861 toEng 0.0E-1 -> 0.00 +dqbast862 toEng 0.0E-2 -> 0.000 +dqbast863 toEng 0.0E-3 -> 0.0000 +dqbast864 toEng 0.0E-4 -> 0.00000 +dqbast865 toEng 0.0E-5 -> 0.000000 +dqbast866 toEng 0.0E-6 -> 0.0E-6 +dqbast867 toEng 0.0E-7 -> 0.00E-6 +dqbast868 toEng 0.0E-8 -> 0E-9 +dqbast869 toEng 0.0E-9 -> 0.0E-9 + +dqbast870 toEng 0.00E-0 -> 0.00 +dqbast871 toEng 0.00E-1 -> 0.000 +dqbast872 toEng 0.00E-2 -> 0.0000 +dqbast873 toEng 0.00E-3 -> 0.00000 +dqbast874 toEng 0.00E-4 -> 0.000000 +dqbast875 toEng 0.00E-5 -> 0.0E-6 +dqbast876 toEng 0.00E-6 -> 0.00E-6 +dqbast877 toEng 0.00E-7 -> 0E-9 +dqbast878 toEng 0.00E-8 -> 0.0E-9 +dqbast879 toEng 0.00E-9 -> 0.00E-9 + +-- long input strings +dqbas801 tosci '01234567890123456' -> 1234567890123456 +dqbas802 tosci '001234567890123456' -> 1234567890123456 +dqbas803 tosci '0001234567890123456' -> 1234567890123456 +dqbas804 tosci '00001234567890123456' -> 1234567890123456 +dqbas805 tosci '000001234567890123456' -> 1234567890123456 +dqbas806 tosci '0000001234567890123456' -> 1234567890123456 +dqbas807 tosci '00000001234567890123456' -> 1234567890123456 +dqbas808 tosci '000000001234567890123456' -> 1234567890123456 +dqbas809 tosci '0000000001234567890123456' -> 1234567890123456 +dqbas810 tosci '00000000001234567890123456' -> 1234567890123456 + +dqbas811 tosci '0.1234567890123456' -> 0.1234567890123456 +dqbas812 tosci '0.01234567890123456' -> 0.01234567890123456 +dqbas813 tosci '0.001234567890123456' -> 0.001234567890123456 +dqbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456 +dqbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456 +dqbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456 +dqbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7 +dqbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8 +dqbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9 +dqbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10 + +dqbas821 tosci '12345678912345678901234567801234567890' -> 1.234567891234567890123456780123457E+37 Inexact Rounded +dqbas822 tosci '123456789123456789012345678012345678901' -> 1.234567891234567890123456780123457E+38 Inexact Rounded +dqbas823 tosci '1234567891234567890123456780123456789012' -> 1.234567891234567890123456780123457E+39 Inexact Rounded +dqbas824 tosci '12345678912345678901234567801234567890123' -> 1.234567891234567890123456780123457E+40 Inexact Rounded +dqbas825 tosci '123456789123456789012345678012345678901234' -> 1.234567891234567890123456780123457E+41 Inexact Rounded +dqbas826 tosci '1234567891234567890123456780123456789012345' -> 1.234567891234567890123456780123457E+42 Inexact Rounded +dqbas827 tosci '12345678912345678901234567801234567890123456' -> 1.234567891234567890123456780123457E+43 Inexact Rounded +dqbas828 tosci '123456789123456789012345678012345678901234567' -> 1.234567891234567890123456780123457E+44 Inexact Rounded +dqbas829 tosci '1234567891234567890123456780123456789012345678' -> 1.234567891234567890123456780123457E+45 Inexact Rounded + +-- subnormals and overflows +dqbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded +dqbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded +dqbas908 toSci '0.9e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas909 toSci '0.09e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded +dqbas911 toSci '10e-1000000000' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded +dqbas913 toSci '99e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded +dqbas915 toSci '1111e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas916 toSci '1111e-99999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +-- negatives the same +dqbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded +dqbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded +dqbas920 toSci '-0.9e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas921 toSci '-0.09e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded +dqbas923 toSci '-10e-1000000000' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded +dqbas925 toSci '-99e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded +dqbas927 toSci '-1111e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas928 toSci '-1111e-99999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +-- overflow results at different rounding modes +rounding: ceiling +dqbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dqbas931 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +rounding: up +dqbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dqbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: down +dqbas934 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +dqbas935 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +rounding: floor +dqbas936 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +dqbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded + +rounding: half_up +dqbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dqbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: half_even +dqbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dqbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: half_down +dqbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dqbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded + +rounding: half_even + +-- Now check 854/754r some subnormals and underflow to 0 +dqbem400 toSci 1.0000E-383 -> 1.0000E-383 +dqbem401 toSci 0.1E-6172 -> 1E-6173 Subnormal +dqbem402 toSci 0.1000E-6172 -> 1.000E-6173 Subnormal +dqbem403 toSci 0.0100E-6172 -> 1.00E-6174 Subnormal +dqbem404 toSci 0.0010E-6172 -> 1.0E-6175 Subnormal +dqbem405 toSci 0.0001E-6172 -> 1E-6176 Subnormal +dqbem406 toSci 0.00010E-6172 -> 1E-6176 Subnormal Rounded +dqbem407 toSci 0.00013E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqbem408 toSci 0.00015E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem409 toSci 0.00017E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem410 toSci 0.00023E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem411 toSci 0.00025E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem412 toSci 0.00027E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded +dqbem413 toSci 0.000149E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqbem414 toSci 0.000150E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem415 toSci 0.000151E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem416 toSci 0.000249E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem417 toSci 0.000250E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqbem418 toSci 0.000251E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded +dqbem419 toSci 0.00009E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqbem420 toSci 0.00005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbem421 toSci 0.00003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbem422 toSci 0.000009E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbem423 toSci 0.000005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbem424 toSci 0.000003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +dqbem425 toSci 0.001049E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded +dqbem426 toSci 0.001050E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded +dqbem427 toSci 0.001051E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded +dqbem428 toSci 0.001149E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded +dqbem429 toSci 0.001150E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded +dqbem430 toSci 0.001151E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded + +dqbem432 toSci 0.010049E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded +dqbem433 toSci 0.010050E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded +dqbem434 toSci 0.010051E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded +dqbem435 toSci 0.010149E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded +dqbem436 toSci 0.010150E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded +dqbem437 toSci 0.010151E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded + +dqbem440 toSci 0.10103E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded +dqbem441 toSci 0.10105E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded +dqbem442 toSci 0.10107E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded +dqbem443 toSci 0.10113E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded +dqbem444 toSci 0.10115E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded +dqbem445 toSci 0.10117E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded + +dqbem450 toSci 1.10730E-6173 -> 1.107E-6173 Underflow Subnormal Inexact Rounded +dqbem451 toSci 1.10750E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded +dqbem452 toSci 1.10770E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded +dqbem453 toSci 1.10830E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded +dqbem454 toSci 1.10850E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded +dqbem455 toSci 1.10870E-6173 -> 1.109E-6173 Underflow Subnormal Inexact Rounded + +-- make sure sign OK +dqbem456 toSci -0.10103E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded +dqbem457 toSci -0.10105E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded +dqbem458 toSci -0.10107E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded +dqbem459 toSci -0.10113E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded +dqbem460 toSci -0.10115E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded +dqbem461 toSci -0.10117E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded + +-- '999s' cases +dqbem464 toSci 999999E-6173 -> 9.99999E-6168 Subnormal +dqbem465 toSci 99999.0E-6172 -> 9.99990E-6168 Subnormal +dqbem466 toSci 99999.E-6172 -> 9.9999E-6168 Subnormal +dqbem467 toSci 9999.9E-6172 -> 9.9999E-6169 Subnormal +dqbem468 toSci 999.99E-6172 -> 9.9999E-6170 Subnormal +dqbem469 toSci 99.999E-6172 -> 9.9999E-6171 Subnormal +dqbem470 toSci 9.9999E-6172 -> 9.9999E-6172 Subnormal +dqbem471 toSci 0.99999E-6172 -> 1.0000E-6172 Underflow Subnormal Inexact Rounded +dqbem472 toSci 0.099999E-6172 -> 1.000E-6173 Underflow Subnormal Inexact Rounded +dqbem473 toSci 0.0099999E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded +dqbem474 toSci 0.00099999E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded +dqbem475 toSci 0.000099999E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqbem476 toSci 0.0000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbem477 toSci 0.00000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbem478 toSci 0.000000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +-- Exponents with insignificant leading zeros +dqbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded +dqbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded +dqbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded +dqbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded +dqbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded +dqbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded +dqbas1007 toSci 1e-999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas1008 toSci 1e-0999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas1009 toSci 1e-00999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas1010 toSci 1e-000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas1011 toSci 1e-000000000000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqbas1012 toSci 1e-000000000001000000007 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +-- check for double-rounded subnormals +dqbas1041 toSci 1.1111111111111111111111111111152444E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow +dqbas1042 toSci 1.1111111111111111111111111111152445E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow +dqbas1043 toSci 1.1111111111111111111111111111152446E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow + +-- clamped zeros [see also clamp.decTest] +dqbas1075 toSci 0e+10000 -> 0E+6111 Clamped +dqbas1076 toSci 0e-10000 -> 0E-6176 Clamped +dqbas1077 toSci -0e+10000 -> -0E+6111 Clamped +dqbas1078 toSci -0e-10000 -> -0E-6176 Clamped + +-- extreme values from next-wider +dqbas1101 toSci -9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> -Infinity Overflow Inexact Rounded +dqbas1102 toSci -1E-1572863 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped +dqbas1103 toSci -1E-1572932 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped +dqbas1104 toSci -0 -> -0 +dqbas1105 toSci +0 -> 0 +dqbas1106 toSci +1E-1572932 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped +dqbas1107 toSci +1E-1572863 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped +dqbas1108 toSci +9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> Infinity Overflow Inexact Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCanonical.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCanonical.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,372 @@ +------------------------------------------------------------------------ +-- dqCanonical.decTest -- test decQuad canonical results -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This file tests that copy operations leave uncanonical operands +-- unchanged, and vice versa + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Uncanonical declets are: abc, where: +-- a=1,2,3 +-- b=6,7,e,f +-- c=e,f + +-- assert some standard (canonical) values; this tests that FromString +-- produces canonical results (many more in decimalNN) +dqcan001 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan002 apply 0 -> #22080000000000000000000000000000 +dqcan003 apply 1 -> #22080000000000000000000000000001 +dqcan004 apply -1 -> #a2080000000000000000000000000001 +dqcan005 apply Infinity -> #78000000000000000000000000000000 +dqcan006 apply -Infinity -> #f8000000000000000000000000000000 +dqcan007 apply -NaN -> #fc000000000000000000000000000000 +dqcan008 apply -sNaN -> #fe000000000000000000000000000000 +dqcan009 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan010 apply sNaN999999999999999999999999999999999 -> #7e000ff3fcff3fcff3fcff3fcff3fcff +decan011 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff +dqcan012 apply 7.50 -> #220780000000000000000000000003d0 +dqcan013 apply 9.99 -> #220780000000000000000000000000ff + +-- Base tests for canonical encodings (individual operator +-- propagation is tested later) + +-- Finites: declets in coefficient +dqcan021 canonical #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan022 canonical #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan023 canonical #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan024 canonical #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan025 canonical #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan026 canonical #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan027 canonical #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan028 canonical #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan029 canonical #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan030 canonical #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan031 canonical #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan032 canonical #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff + +-- NaN: declets in payload +dqcan061 canonical #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan062 canonical #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan063 canonical #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan064 canonical #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan065 canonical #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan066 canonical #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan067 canonical #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan068 canonical #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan069 canonical #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan070 canonical #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan071 canonical #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +dqcan081 canonical #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan082 canonical #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan083 canonical #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan084 canonical #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan085 canonical #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan086 canonical #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan087 canonical #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan088 canonical #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan089 canonical #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan090 canonical #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan091 canonical #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff + +-- sNaN: declets in payload +dqcan101 canonical #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan102 canonical #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan103 canonical #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan104 canonical #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan105 canonical #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan106 canonical #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan107 canonical #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan108 canonical #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan109 canonical #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan100 canonical #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan111 canonical #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +-- sNaN: exponent continuation bits [excluding sNaN selector] +dqcan121 canonical #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan122 canonical #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan123 canonical #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan124 canonical #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan125 canonical #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan126 canonical #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan127 canonical #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan128 canonical #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan129 canonical #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan130 canonical #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff +dqcan131 canonical #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff + +-- Inf: exponent continuation bits +dqcan137 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan138 canonical #79000000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan139 canonical #7a000000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan140 canonical #78800000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan141 canonical #78400000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan142 canonical #78200000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan143 canonical #78100000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan144 canonical #78080000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan145 canonical #78040000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan146 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan147 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan148 canonical #78008000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan149 canonical #78004000000000000000000000000000 -> #78000000000000000000000000000000 + +-- Inf: coefficient continuation bits (first, last, and a few others) +dqcan150 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan151 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan152 canonical #78000000000000000000000000000001 -> #78000000000000000000000000000000 +dqcan153 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan154 canonical #78002000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan155 canonical #78000800000000000000000000000000 -> #78000000000000000000000000000000 +dqcan156 canonical #78000020000000000000000000000000 -> #78000000000000000000000000000000 +dqcan157 canonical #78000004000000000000000000000000 -> #78000000000000000000000000000000 +dqcan158 canonical #78000000400000000000000000000000 -> #78000000000000000000000000000000 +dqcan159 canonical #78000000080000000000000000000000 -> #78000000000000000000000000000000 +dqcan160 canonical #78000000004000000000000000000000 -> #78000000000000000000000000000000 +dqcan161 canonical #78000000000200000000000000000000 -> #78000000000000000000000000000000 +dqcan162 canonical #78000000000080000000000000000000 -> #78000000000000000000000000000000 +dqcan163 canonical #78000000000002000000000000000000 -> #78000000000000000000000000000000 +dqcan164 canonical #78000000000000400000000000000000 -> #78000000000000000000000000000000 +dqcan165 canonical #78000000000000080000000000000000 -> #78000000000000000000000000000000 +dqcan166 canonical #78000000000000001000000000000000 -> #78000000000000000000000000000000 +dqcan167 canonical #78000000000000000200000000000000 -> #78000000000000000000000000000000 +dqcan168 canonical #78000000000000000080000000000000 -> #78000000000000000000000000000000 +dqcan169 canonical #78000000000000000004000000000000 -> #78000000000000000000000000000000 +dqcan170 canonical #78000000000000000000400000000000 -> #78000000000000000000000000000000 +dqcan171 canonical #78000000000000000000010000000000 -> #78000000000000000000000000000000 +dqcan172 canonical #78000000000000000000002000000000 -> #78000000000000000000000000000000 +dqcan173 canonical #78000000000000000000000400000000 -> #78000000000000000000000000000000 +dqcan174 canonical #78000000000000000000000080000000 -> #78000000000000000000000000000000 +dqcan175 canonical #78000000000000000000000002000000 -> #78000000000000000000000000000000 +dqcan176 canonical #78000000000000000000000000400000 -> #78000000000000000000000000000000 +dqcan177 canonical #78000000000000000000000000020000 -> #78000000000000000000000000000000 +dqcan178 canonical #78000000000000000000000000001000 -> #78000000000000000000000000000000 +dqcan179 canonical #78000000000000000000000000000400 -> #78000000000000000000000000000000 +dqcan180 canonical #78000000000000000000000000000020 -> #78000000000000000000000000000000 +dqcan181 canonical #78000000000000000000000000000008 -> #78000000000000000000000000000000 + + +-- Now the operators -- trying to check paths that might fail to +-- canonicalize propagated operands + +----- Add: +-- Finites: neutral 0 +dqcan202 add 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff +dqcan203 add #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff +-- tiny zero +dqcan204 add 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded +dqcan205 add #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded +-- tiny non zero +dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded +dqcan207 add #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded +-- NaN: declets in payload +dqcan211 add 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan212 add #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +dqcan213 add 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan214 add #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +-- sNaN: declets in payload +dqcan215 add 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan216 add #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +-- sNaN: exponent continuation bits [excluding sNaN selector] +dqcan217 add 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan218 add #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +-- Inf: exponent continuation bits +dqcan220 add 0 #78010000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan221 add #78680000000000000000000000000000 0 -> #78000000000000000000000000000000 +-- Inf: coefficient continuation bits +dqcan222 add 0 #78002000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan223 add #78000000000000000000000000000001 0 -> #78000000000000000000000000000000 +dqcan224 add 0 #78000002000000000000000000000000 -> #78000000000000000000000000000000 +dqcan225 add #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000 +dqcan226 add 0 #78000000000000000005000000000000 -> #78000000000000000000000000000000 +dqcan227 add #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000 + +----- Class: [does not return encoded] + +----- Compare: +dqcan231 compare -Inf 1 -> #a2080000000000000000000000000001 +dqcan232 compare -Inf -Inf -> #22080000000000000000000000000000 +dqcan233 compare 1 -Inf -> #22080000000000000000000000000001 +dqcan234 compare #7c010ff3fcff3fcff3fcff3ffffffcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan235 compare #7e004ff3fcff3fcff3ffffffcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation + +----- CompareSig: +dqcan241 comparesig -Inf 1 -> #a2080000000000000000000000000001 +dqcan242 comparesig -Inf -Inf -> #22080000000000000000000000000000 +dqcan243 comparesig 1 -Inf -> #22080000000000000000000000000001 +dqcan244 comparesig #7c400ff3ffff3fcff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan245 comparesig #7e050ff3fcfffffff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation + +----- Copy: [does not usually canonicalize] +-- finites +dqcan250 copy #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff +dqcan251 copy #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff +-- NaNs +dqcan252 copy #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff +dqcan253 copy #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff +-- sNaN +dqcan254 copy #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff +dqcan255 copy #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff +-- Inf +dqcan258 copy #78002000000000000000000000000000 -> #78002000000000000000000000000000 +dqcan259 copy #78000000000010000000000000100000 -> #78000000000010000000000000100000 + +----- CopyAbs: [does not usually canonicalize] +-- finites +dqcan260 copyabs #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff +dqcan261 copyabs #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff +-- NaNs +dqcan262 copyabs #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff +dqcan263 copyabs #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff +-- sNaN +dqcan264 copyabs #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff +dqcan265 copyabs #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff +-- Inf +dqcan268 copyabs #f8002000000000000000000000000000 -> #78002000000000000000000000000000 +dqcan269 copyabs #f8000000000000700700700000000000 -> #78000000000000700700700000000000 + +----- CopyNegate: [does not usually canonicalize] +-- finites +dqcan270 copynegate #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff +dqcan271 copynegate #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff +-- NaNs +dqcan272 copynegate #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff +dqcan273 copynegate #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff +-- sNaN +dqcan274 copynegate #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff +dqcan275 copynegate #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff +-- Inf +dqcan278 copynegate #78002000000000000000000000000000 -> #f8002000000000000000000000000000 +dqcan279 copynegate #78000000000010000000000000100000 -> #f8000000000010000000000000100000 + +----- CopySign: [does not usually canonicalize] +-- finites +dqcan280 copysign #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff +dqcan281 copysign #ee080ff3fcff3ffff3fcff3ffff3fcff 1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff +-- NaNs +dqcan282 copysign #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff +dqcan283 copysign #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff +-- sNaN +dqcan284 copysign #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff +dqcan285 copysign #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff +-- Inf +dqcan288 copysign #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000 +dqcan289 copysign #78000000000010000000000000100000 1 -> #78000000000010000000000000100000 + +----- Multiply: +-- Finites: neutral 0 +dqcan302 multiply 1 #77ffff3fcff3fcff0000000000000000 -> #77ffff3fcff3fcff0000000000000000 +dqcan303 multiply #77fcffffcff3fcff0000000000000000 1 -> #77fccfffcff3fcff0000000000000000 +-- negative +dqcan306 multiply -1 #77ffff3fcff3fcff0000000000000000 -> #f7ffff3fcff3fcff0000000000000000 +dqcan307 multiply #77fcffffcff3fcff0000000000000000 -1 -> #f7fccfffcff3fcff0000000000000000 +-- NaN: declets in payload +dqcan311 multiply 1 #7c03ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 +dqcan312 multiply #7c03ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 +-- NaN: exponent continuation bits [excluding sNaN selector] +dqcan313 multiply 1 #7c40ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 +dqcan314 multiply #7c40ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 +-- sNaN: declets in payload +dqcan315 multiply 1 #7e00ffffcff3fcff0000000000000000 -> #7c000fffcff3fcff0000000000000000 Invalid_operation +dqcan316 multiply #7e00ffffcff3fcff0000000000000000 1 -> #7c000fffcff3fcff0000000000000000 Invalid_operation +-- sNaN: exponent continuation bits [excluding sNaN selector] +dqcan317 multiply 1 #7e80ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation +dqcan318 multiply #7e80ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation +-- Inf: exponent continuation bits +dqcan320 multiply 1 #78800000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan321 multiply #78800000000000000000000000000000 1 -> #78000000000000000000000000000000 +-- Inf: coefficient continuation bits +dqcan322 multiply 1 #78020000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan323 multiply #78020000000000000000000000000000 1 -> #78000000000000000000000000000000 +dqcan324 multiply 1 #78000000000000010000000000000000 -> #78000000000000000000000000000000 +dqcan325 multiply #78000000000000010000000000000000 1 -> #78000000000000000000000000000000 +dqcan326 multiply 1 #78000020000000000000000000000000 -> #78000000000000000000000000000000 +dqcan327 multiply #78000020000000000000000000000000 1 -> #78000000000000000000000000000000 + +----- Quantize: +dqcan401 quantize #ee080ff3fcff3fcff3fffffffff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff +dqcan402 quantize #ee080ff3fffffffffffcff3fcff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff +dqcan403 quantize #78800000000000000000000000000000 Inf -> #78000000000000000000000000000000 +dqcan404 quantize #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000 +dqcan410 quantize #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan411 quantize #fc000ff3fcfffffff3fcff3fcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff +dqcan412 quantize #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan413 quantize #fe000ff3fcff3fcff3ffffffcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation + +----- Subtract: +-- Finites: neutral 0 +dqcan502 subtract 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff +dqcan503 subtract #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff +-- tiny zero +dqcan504 subtract 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded +dqcan505 subtract #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded +-- tiny non zero +dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded +dqcan507 subtract #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded +-- NaN: declets in payload +dqcan511 subtract 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan512 subtract #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +-- NaN: exponent continuation bits [excluding sNaN selector] +dqcan513 subtract 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan514 subtract #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +-- sNaN: declets in payload +dqcan515 subtract 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan516 subtract #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +-- sNaN: exponent continuation bits [excluding sNaN selector] +dqcan517 subtract 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan518 subtract #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +-- Inf: exponent continuation bits +dqcan520 subtract 0 #78010000000000000000000000000000 -> #f8000000000000000000000000000000 +dqcan521 subtract #78680000000000000000000000000000 0 -> #78000000000000000000000000000000 +-- Inf: coefficient continuation bits +dqcan522 subtract 0 #78002000000000000000000000000000 -> #f8000000000000000000000000000000 +dqcan523 subtract #78000000000000000000000000000001 0 -> #78000000000000000000000000000000 +dqcan524 subtract 0 #78000002000000000000000000000000 -> #f8000000000000000000000000000000 +dqcan525 subtract #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000 +dqcan526 subtract 0 #78000000000000000005000000000000 -> #f8000000000000000000000000000000 +dqcan527 subtract #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000 + +----- ToIntegral: +dqcan601 tointegralx #6e080ff3fdff3fcff3fcff3fcff3fcff -> #6e080ff3fcff3fcff3fcff3fcff3fcff +dqcan602 tointegralx #ee080ff3fcff3ffff3fcff3fcff3fcff -> #ee080ff3fcff3fcff3fcff3fcff3fcff +dqcan603 tointegralx #78800000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan604 tointegralx #78020000000000000000000000000000 -> #78000000000000000000000000000000 +dqcan614 tointegralx #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff +dqcan615 tointegralx #fc000ff3fcff3fcff3fcffffcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff +dqcan616 tointegralx #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +dqcan617 tointegralx #fe000ff3fcff3fcff3fdff3fcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation +-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives +dqcan618 tointegralx #22080000000000000000000000000fff -> #22080000000000000000000000000cff +dqcan619 tointegralx #22078000000000000000000000000fff -> #22080000000000000000000000000040 Inexact Rounded +dqcan620 tointegralx #22074000000000000000000000000fff -> #22080000000000000000000000000004 Inexact Rounded +dqcan621 tointegralx #22070000000000000000000000000fff -> #22080000000000000000000000000000 Inexact Rounded +dqcan622 tointegralx #a2080000000000000000000000000fff -> #a2080000000000000000000000000cff +dqcan623 tointegralx #a2078000000000000000000000000fff -> #a2080000000000000000000000000040 Inexact Rounded +dqcan624 tointegralx #a2074000000000000000000000000fff -> #a2080000000000000000000000000004 Inexact Rounded +dqcan625 tointegralx #a2070000000000000000000000000fff -> #a2080000000000000000000000000000 Inexact Rounded + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqClass.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqClass.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,77 @@ +------------------------------------------------------------------------ +-- dqClass.decTest -- decQuad Class operations -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- [New 2006.11.27] + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqcla001 class 0 -> +Zero +dqcla002 class 0.00 -> +Zero +dqcla003 class 0E+5 -> +Zero +dqcla004 class 1E-6176 -> +Subnormal +dqcla005 class 0.1E-6143 -> +Subnormal +dqcla006 class 0.99999999999999999999999999999999E-6143 -> +Subnormal +dqcla007 class 1.00000000000000000000000000000000E-6143 -> +Normal +dqcla008 class 1E-6143 -> +Normal +dqcla009 class 1E-100 -> +Normal +dqcla010 class 1E-10 -> +Normal +dqcla012 class 1E-1 -> +Normal +dqcla013 class 1 -> +Normal +dqcla014 class 2.50 -> +Normal +dqcla015 class 100.100 -> +Normal +dqcla016 class 1E+30 -> +Normal +dqcla017 class 1E+6144 -> +Normal +dqcla018 class 9.99999999999999999999999999999999E+6144 -> +Normal +dqcla019 class Inf -> +Infinity + +dqcla021 class -0 -> -Zero +dqcla022 class -0.00 -> -Zero +dqcla023 class -0E+5 -> -Zero +dqcla024 class -1E-6176 -> -Subnormal +dqcla025 class -0.1E-6143 -> -Subnormal +dqcla026 class -0.99999999999999999999999999999999E-6143 -> -Subnormal +dqcla027 class -1.00000000000000000000000000000000E-6143 -> -Normal +dqcla028 class -1E-6143 -> -Normal +dqcla029 class -1E-100 -> -Normal +dqcla030 class -1E-10 -> -Normal +dqcla032 class -1E-1 -> -Normal +dqcla033 class -1 -> -Normal +dqcla034 class -2.50 -> -Normal +dqcla035 class -100.100 -> -Normal +dqcla036 class -1E+30 -> -Normal +dqcla037 class -1E+6144 -> -Normal +dqcla0614 class -9.99999999999999999999999999999999E+6144 -> -Normal +dqcla039 class -Inf -> -Infinity + +dqcla041 class NaN -> NaN +dqcla042 class -NaN -> NaN +dqcla043 class +NaN12345 -> NaN +dqcla044 class sNaN -> sNaN +dqcla045 class -sNaN -> sNaN +dqcla046 class +sNaN12345 -> sNaN + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompare.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompare.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,753 @@ +------------------------------------------------------------------------ +-- dqCompare.decTest -- decQuad comparison that allows quiet NaNs -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqcom001 compare -2 -2 -> 0 +dqcom002 compare -2 -1 -> -1 +dqcom003 compare -2 0 -> -1 +dqcom004 compare -2 1 -> -1 +dqcom005 compare -2 2 -> -1 +dqcom006 compare -1 -2 -> 1 +dqcom007 compare -1 -1 -> 0 +dqcom008 compare -1 0 -> -1 +dqcom009 compare -1 1 -> -1 +dqcom010 compare -1 2 -> -1 +dqcom011 compare 0 -2 -> 1 +dqcom012 compare 0 -1 -> 1 +dqcom013 compare 0 0 -> 0 +dqcom014 compare 0 1 -> -1 +dqcom015 compare 0 2 -> -1 +dqcom016 compare 1 -2 -> 1 +dqcom017 compare 1 -1 -> 1 +dqcom018 compare 1 0 -> 1 +dqcom019 compare 1 1 -> 0 +dqcom020 compare 1 2 -> -1 +dqcom021 compare 2 -2 -> 1 +dqcom022 compare 2 -1 -> 1 +dqcom023 compare 2 0 -> 1 +dqcom025 compare 2 1 -> 1 +dqcom026 compare 2 2 -> 0 + +dqcom031 compare -20 -20 -> 0 +dqcom032 compare -20 -10 -> -1 +dqcom033 compare -20 00 -> -1 +dqcom034 compare -20 10 -> -1 +dqcom035 compare -20 20 -> -1 +dqcom036 compare -10 -20 -> 1 +dqcom037 compare -10 -10 -> 0 +dqcom038 compare -10 00 -> -1 +dqcom039 compare -10 10 -> -1 +dqcom040 compare -10 20 -> -1 +dqcom041 compare 00 -20 -> 1 +dqcom042 compare 00 -10 -> 1 +dqcom043 compare 00 00 -> 0 +dqcom044 compare 00 10 -> -1 +dqcom045 compare 00 20 -> -1 +dqcom046 compare 10 -20 -> 1 +dqcom047 compare 10 -10 -> 1 +dqcom048 compare 10 00 -> 1 +dqcom049 compare 10 10 -> 0 +dqcom050 compare 10 20 -> -1 +dqcom051 compare 20 -20 -> 1 +dqcom052 compare 20 -10 -> 1 +dqcom053 compare 20 00 -> 1 +dqcom055 compare 20 10 -> 1 +dqcom056 compare 20 20 -> 0 + +dqcom061 compare -2.0 -2.0 -> 0 +dqcom062 compare -2.0 -1.0 -> -1 +dqcom063 compare -2.0 0.0 -> -1 +dqcom064 compare -2.0 1.0 -> -1 +dqcom065 compare -2.0 2.0 -> -1 +dqcom066 compare -1.0 -2.0 -> 1 +dqcom067 compare -1.0 -1.0 -> 0 +dqcom068 compare -1.0 0.0 -> -1 +dqcom069 compare -1.0 1.0 -> -1 +dqcom070 compare -1.0 2.0 -> -1 +dqcom071 compare 0.0 -2.0 -> 1 +dqcom072 compare 0.0 -1.0 -> 1 +dqcom073 compare 0.0 0.0 -> 0 +dqcom074 compare 0.0 1.0 -> -1 +dqcom075 compare 0.0 2.0 -> -1 +dqcom076 compare 1.0 -2.0 -> 1 +dqcom077 compare 1.0 -1.0 -> 1 +dqcom078 compare 1.0 0.0 -> 1 +dqcom079 compare 1.0 1.0 -> 0 +dqcom080 compare 1.0 2.0 -> -1 +dqcom081 compare 2.0 -2.0 -> 1 +dqcom082 compare 2.0 -1.0 -> 1 +dqcom083 compare 2.0 0.0 -> 1 +dqcom085 compare 2.0 1.0 -> 1 +dqcom086 compare 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +dqcom090 compare 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0 +dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1 +dqcom092 compare 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1 +dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0 + +-- some differing length/exponent cases +dqcom100 compare 7.0 7.0 -> 0 +dqcom101 compare 7.0 7 -> 0 +dqcom102 compare 7 7.0 -> 0 +dqcom103 compare 7E+0 7.0 -> 0 +dqcom104 compare 70E-1 7.0 -> 0 +dqcom105 compare 0.7E+1 7 -> 0 +dqcom106 compare 70E-1 7 -> 0 +dqcom107 compare 7.0 7E+0 -> 0 +dqcom108 compare 7.0 70E-1 -> 0 +dqcom109 compare 7 0.7E+1 -> 0 +dqcom110 compare 7 70E-1 -> 0 + +dqcom120 compare 8.0 7.0 -> 1 +dqcom121 compare 8.0 7 -> 1 +dqcom122 compare 8 7.0 -> 1 +dqcom123 compare 8E+0 7.0 -> 1 +dqcom124 compare 80E-1 7.0 -> 1 +dqcom125 compare 0.8E+1 7 -> 1 +dqcom126 compare 80E-1 7 -> 1 +dqcom127 compare 8.0 7E+0 -> 1 +dqcom128 compare 8.0 70E-1 -> 1 +dqcom129 compare 8 0.7E+1 -> 1 +dqcom130 compare 8 70E-1 -> 1 + +dqcom140 compare 8.0 9.0 -> -1 +dqcom141 compare 8.0 9 -> -1 +dqcom142 compare 8 9.0 -> -1 +dqcom143 compare 8E+0 9.0 -> -1 +dqcom144 compare 80E-1 9.0 -> -1 +dqcom145 compare 0.8E+1 9 -> -1 +dqcom146 compare 80E-1 9 -> -1 +dqcom147 compare 8.0 9E+0 -> -1 +dqcom148 compare 8.0 90E-1 -> -1 +dqcom149 compare 8 0.9E+1 -> -1 +dqcom150 compare 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +dqcom200 compare -7.0 7.0 -> -1 +dqcom201 compare -7.0 7 -> -1 +dqcom202 compare -7 7.0 -> -1 +dqcom203 compare -7E+0 7.0 -> -1 +dqcom204 compare -70E-1 7.0 -> -1 +dqcom205 compare -0.7E+1 7 -> -1 +dqcom206 compare -70E-1 7 -> -1 +dqcom207 compare -7.0 7E+0 -> -1 +dqcom208 compare -7.0 70E-1 -> -1 +dqcom209 compare -7 0.7E+1 -> -1 +dqcom210 compare -7 70E-1 -> -1 + +dqcom220 compare -8.0 7.0 -> -1 +dqcom221 compare -8.0 7 -> -1 +dqcom222 compare -8 7.0 -> -1 +dqcom223 compare -8E+0 7.0 -> -1 +dqcom224 compare -80E-1 7.0 -> -1 +dqcom225 compare -0.8E+1 7 -> -1 +dqcom226 compare -80E-1 7 -> -1 +dqcom227 compare -8.0 7E+0 -> -1 +dqcom228 compare -8.0 70E-1 -> -1 +dqcom229 compare -8 0.7E+1 -> -1 +dqcom230 compare -8 70E-1 -> -1 + +dqcom240 compare -8.0 9.0 -> -1 +dqcom241 compare -8.0 9 -> -1 +dqcom242 compare -8 9.0 -> -1 +dqcom243 compare -8E+0 9.0 -> -1 +dqcom244 compare -80E-1 9.0 -> -1 +dqcom245 compare -0.8E+1 9 -> -1 +dqcom246 compare -80E-1 9 -> -1 +dqcom247 compare -8.0 9E+0 -> -1 +dqcom248 compare -8.0 90E-1 -> -1 +dqcom249 compare -8 0.9E+1 -> -1 +dqcom250 compare -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +dqcom300 compare 7.0 -7.0 -> 1 +dqcom301 compare 7.0 -7 -> 1 +dqcom302 compare 7 -7.0 -> 1 +dqcom303 compare 7E+0 -7.0 -> 1 +dqcom304 compare 70E-1 -7.0 -> 1 +dqcom305 compare .7E+1 -7 -> 1 +dqcom306 compare 70E-1 -7 -> 1 +dqcom307 compare 7.0 -7E+0 -> 1 +dqcom308 compare 7.0 -70E-1 -> 1 +dqcom309 compare 7 -.7E+1 -> 1 +dqcom310 compare 7 -70E-1 -> 1 + +dqcom320 compare 8.0 -7.0 -> 1 +dqcom321 compare 8.0 -7 -> 1 +dqcom322 compare 8 -7.0 -> 1 +dqcom323 compare 8E+0 -7.0 -> 1 +dqcom324 compare 80E-1 -7.0 -> 1 +dqcom325 compare .8E+1 -7 -> 1 +dqcom326 compare 80E-1 -7 -> 1 +dqcom327 compare 8.0 -7E+0 -> 1 +dqcom328 compare 8.0 -70E-1 -> 1 +dqcom329 compare 8 -.7E+1 -> 1 +dqcom330 compare 8 -70E-1 -> 1 + +dqcom340 compare 8.0 -9.0 -> 1 +dqcom341 compare 8.0 -9 -> 1 +dqcom342 compare 8 -9.0 -> 1 +dqcom343 compare 8E+0 -9.0 -> 1 +dqcom344 compare 80E-1 -9.0 -> 1 +dqcom345 compare .8E+1 -9 -> 1 +dqcom346 compare 80E-1 -9 -> 1 +dqcom347 compare 8.0 -9E+0 -> 1 +dqcom348 compare 8.0 -90E-1 -> 1 +dqcom349 compare 8 -.9E+1 -> 1 +dqcom350 compare 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +dqcom400 compare -7.0 -7.0 -> 0 +dqcom401 compare -7.0 -7 -> 0 +dqcom402 compare -7 -7.0 -> 0 +dqcom403 compare -7E+0 -7.0 -> 0 +dqcom404 compare -70E-1 -7.0 -> 0 +dqcom405 compare -.7E+1 -7 -> 0 +dqcom406 compare -70E-1 -7 -> 0 +dqcom407 compare -7.0 -7E+0 -> 0 +dqcom408 compare -7.0 -70E-1 -> 0 +dqcom409 compare -7 -.7E+1 -> 0 +dqcom410 compare -7 -70E-1 -> 0 + +dqcom420 compare -8.0 -7.0 -> -1 +dqcom421 compare -8.0 -7 -> -1 +dqcom422 compare -8 -7.0 -> -1 +dqcom423 compare -8E+0 -7.0 -> -1 +dqcom424 compare -80E-1 -7.0 -> -1 +dqcom425 compare -.8E+1 -7 -> -1 +dqcom426 compare -80E-1 -7 -> -1 +dqcom427 compare -8.0 -7E+0 -> -1 +dqcom428 compare -8.0 -70E-1 -> -1 +dqcom429 compare -8 -.7E+1 -> -1 +dqcom430 compare -8 -70E-1 -> -1 + +dqcom440 compare -8.0 -9.0 -> 1 +dqcom441 compare -8.0 -9 -> 1 +dqcom442 compare -8 -9.0 -> 1 +dqcom443 compare -8E+0 -9.0 -> 1 +dqcom444 compare -80E-1 -9.0 -> 1 +dqcom445 compare -.8E+1 -9 -> 1 +dqcom446 compare -80E-1 -9 -> 1 +dqcom447 compare -8.0 -9E+0 -> 1 +dqcom448 compare -8.0 -90E-1 -> 1 +dqcom449 compare -8 -.9E+1 -> 1 +dqcom450 compare -8 -90E-1 -> 1 + +-- misalignment traps for little-endian +dqcom451 compare 1.0 0.1 -> 1 +dqcom452 compare 0.1 1.0 -> -1 +dqcom453 compare 10.0 0.1 -> 1 +dqcom454 compare 0.1 10.0 -> -1 +dqcom455 compare 100 1.0 -> 1 +dqcom456 compare 1.0 100 -> -1 +dqcom457 compare 1000 10.0 -> 1 +dqcom458 compare 10.0 1000 -> -1 +dqcom459 compare 10000 100.0 -> 1 +dqcom460 compare 100.0 10000 -> -1 +dqcom461 compare 100000 1000.0 -> 1 +dqcom462 compare 1000.0 100000 -> -1 +dqcom463 compare 1000000 10000.0 -> 1 +dqcom464 compare 10000.0 1000000 -> -1 + +-- testcases that subtract to lots of zeros at boundaries [pgr] +dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0 +dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0 +dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0 +dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0 +dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0 +dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0 +dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0 +dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0 +dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0 +dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0 +dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0 +dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0 +dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0 +dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0 +dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0 +dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0 +dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0 +dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0 +dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0 +dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0 +dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0 +dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +dqcom500 compare 1 1E-15 -> 1 +dqcom501 compare 1 1E-14 -> 1 +dqcom502 compare 1 1E-13 -> 1 +dqcom503 compare 1 1E-12 -> 1 +dqcom504 compare 1 1E-11 -> 1 +dqcom505 compare 1 1E-10 -> 1 +dqcom506 compare 1 1E-9 -> 1 +dqcom507 compare 1 1E-8 -> 1 +dqcom508 compare 1 1E-7 -> 1 +dqcom509 compare 1 1E-6 -> 1 +dqcom510 compare 1 1E-5 -> 1 +dqcom511 compare 1 1E-4 -> 1 +dqcom512 compare 1 1E-3 -> 1 +dqcom513 compare 1 1E-2 -> 1 +dqcom514 compare 1 1E-1 -> 1 +dqcom515 compare 1 1E-0 -> 0 +dqcom516 compare 1 1E+1 -> -1 +dqcom517 compare 1 1E+2 -> -1 +dqcom518 compare 1 1E+3 -> -1 +dqcom519 compare 1 1E+4 -> -1 +dqcom521 compare 1 1E+5 -> -1 +dqcom522 compare 1 1E+6 -> -1 +dqcom523 compare 1 1E+7 -> -1 +dqcom524 compare 1 1E+8 -> -1 +dqcom525 compare 1 1E+9 -> -1 +dqcom526 compare 1 1E+10 -> -1 +dqcom527 compare 1 1E+11 -> -1 +dqcom528 compare 1 1E+12 -> -1 +dqcom529 compare 1 1E+13 -> -1 +dqcom530 compare 1 1E+14 -> -1 +dqcom531 compare 1 1E+15 -> -1 +-- LR swap +dqcom540 compare 1E-15 1 -> -1 +dqcom541 compare 1E-14 1 -> -1 +dqcom542 compare 1E-13 1 -> -1 +dqcom543 compare 1E-12 1 -> -1 +dqcom544 compare 1E-11 1 -> -1 +dqcom545 compare 1E-10 1 -> -1 +dqcom546 compare 1E-9 1 -> -1 +dqcom547 compare 1E-8 1 -> -1 +dqcom548 compare 1E-7 1 -> -1 +dqcom549 compare 1E-6 1 -> -1 +dqcom550 compare 1E-5 1 -> -1 +dqcom551 compare 1E-4 1 -> -1 +dqcom552 compare 1E-3 1 -> -1 +dqcom553 compare 1E-2 1 -> -1 +dqcom554 compare 1E-1 1 -> -1 +dqcom555 compare 1E-0 1 -> 0 +dqcom556 compare 1E+1 1 -> 1 +dqcom557 compare 1E+2 1 -> 1 +dqcom558 compare 1E+3 1 -> 1 +dqcom559 compare 1E+4 1 -> 1 +dqcom561 compare 1E+5 1 -> 1 +dqcom562 compare 1E+6 1 -> 1 +dqcom563 compare 1E+7 1 -> 1 +dqcom564 compare 1E+8 1 -> 1 +dqcom565 compare 1E+9 1 -> 1 +dqcom566 compare 1E+10 1 -> 1 +dqcom567 compare 1E+11 1 -> 1 +dqcom568 compare 1E+12 1 -> 1 +dqcom569 compare 1E+13 1 -> 1 +dqcom570 compare 1E+14 1 -> 1 +dqcom571 compare 1E+15 1 -> 1 +-- similar with a useful coefficient, one side only +dqcom580 compare 0.000000987654321 1E-15 -> 1 +dqcom581 compare 0.000000987654321 1E-14 -> 1 +dqcom582 compare 0.000000987654321 1E-13 -> 1 +dqcom583 compare 0.000000987654321 1E-12 -> 1 +dqcom584 compare 0.000000987654321 1E-11 -> 1 +dqcom585 compare 0.000000987654321 1E-10 -> 1 +dqcom586 compare 0.000000987654321 1E-9 -> 1 +dqcom587 compare 0.000000987654321 1E-8 -> 1 +dqcom588 compare 0.000000987654321 1E-7 -> 1 +dqcom589 compare 0.000000987654321 1E-6 -> -1 +dqcom590 compare 0.000000987654321 1E-5 -> -1 +dqcom591 compare 0.000000987654321 1E-4 -> -1 +dqcom592 compare 0.000000987654321 1E-3 -> -1 +dqcom593 compare 0.000000987654321 1E-2 -> -1 +dqcom594 compare 0.000000987654321 1E-1 -> -1 +dqcom595 compare 0.000000987654321 1E-0 -> -1 +dqcom596 compare 0.000000987654321 1E+1 -> -1 +dqcom597 compare 0.000000987654321 1E+2 -> -1 +dqcom598 compare 0.000000987654321 1E+3 -> -1 +dqcom599 compare 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +dqcom600 compare 12 12.2345 -> -1 +dqcom601 compare 12.0 12.2345 -> -1 +dqcom602 compare 12.00 12.2345 -> -1 +dqcom603 compare 12.000 12.2345 -> -1 +dqcom604 compare 12.0000 12.2345 -> -1 +dqcom605 compare 12.00000 12.2345 -> -1 +dqcom606 compare 12.000000 12.2345 -> -1 +dqcom607 compare 12.0000000 12.2345 -> -1 +dqcom608 compare 12.00000000 12.2345 -> -1 +dqcom609 compare 12.000000000 12.2345 -> -1 +dqcom610 compare 12.1234 12 -> 1 +dqcom611 compare 12.1234 12.0 -> 1 +dqcom612 compare 12.1234 12.00 -> 1 +dqcom613 compare 12.1234 12.000 -> 1 +dqcom614 compare 12.1234 12.0000 -> 1 +dqcom615 compare 12.1234 12.00000 -> 1 +dqcom616 compare 12.1234 12.000000 -> 1 +dqcom617 compare 12.1234 12.0000000 -> 1 +dqcom618 compare 12.1234 12.00000000 -> 1 +dqcom619 compare 12.1234 12.000000000 -> 1 +dqcom620 compare -12 -12.2345 -> 1 +dqcom621 compare -12.0 -12.2345 -> 1 +dqcom622 compare -12.00 -12.2345 -> 1 +dqcom623 compare -12.000 -12.2345 -> 1 +dqcom624 compare -12.0000 -12.2345 -> 1 +dqcom625 compare -12.00000 -12.2345 -> 1 +dqcom626 compare -12.000000 -12.2345 -> 1 +dqcom627 compare -12.0000000 -12.2345 -> 1 +dqcom628 compare -12.00000000 -12.2345 -> 1 +dqcom629 compare -12.000000000 -12.2345 -> 1 +dqcom630 compare -12.1234 -12 -> -1 +dqcom631 compare -12.1234 -12.0 -> -1 +dqcom632 compare -12.1234 -12.00 -> -1 +dqcom633 compare -12.1234 -12.000 -> -1 +dqcom634 compare -12.1234 -12.0000 -> -1 +dqcom635 compare -12.1234 -12.00000 -> -1 +dqcom636 compare -12.1234 -12.000000 -> -1 +dqcom637 compare -12.1234 -12.0000000 -> -1 +dqcom638 compare -12.1234 -12.00000000 -> -1 +dqcom639 compare -12.1234 -12.000000000 -> -1 + +-- extended zeros +dqcom640 compare 0 0 -> 0 +dqcom641 compare 0 -0 -> 0 +dqcom642 compare 0 -0.0 -> 0 +dqcom643 compare 0 0.0 -> 0 +dqcom644 compare -0 0 -> 0 +dqcom645 compare -0 -0 -> 0 +dqcom646 compare -0 -0.0 -> 0 +dqcom647 compare -0 0.0 -> 0 +dqcom648 compare 0.0 0 -> 0 +dqcom649 compare 0.0 -0 -> 0 +dqcom650 compare 0.0 -0.0 -> 0 +dqcom651 compare 0.0 0.0 -> 0 +dqcom652 compare -0.0 0 -> 0 +dqcom653 compare -0.0 -0 -> 0 +dqcom654 compare -0.0 -0.0 -> 0 +dqcom655 compare -0.0 0.0 -> 0 + +dqcom656 compare -0E1 0.0 -> 0 +dqcom657 compare -0E2 0.0 -> 0 +dqcom658 compare 0E1 0.0 -> 0 +dqcom659 compare 0E2 0.0 -> 0 +dqcom660 compare -0E1 0 -> 0 +dqcom661 compare -0E2 0 -> 0 +dqcom662 compare 0E1 0 -> 0 +dqcom663 compare 0E2 0 -> 0 +dqcom664 compare -0E1 -0E1 -> 0 +dqcom665 compare -0E2 -0E1 -> 0 +dqcom666 compare 0E1 -0E1 -> 0 +dqcom667 compare 0E2 -0E1 -> 0 +dqcom668 compare -0E1 -0E2 -> 0 +dqcom669 compare -0E2 -0E2 -> 0 +dqcom670 compare 0E1 -0E2 -> 0 +dqcom671 compare 0E2 -0E2 -> 0 +dqcom672 compare -0E1 0E1 -> 0 +dqcom673 compare -0E2 0E1 -> 0 +dqcom674 compare 0E1 0E1 -> 0 +dqcom675 compare 0E2 0E1 -> 0 +dqcom676 compare -0E1 0E2 -> 0 +dqcom677 compare -0E2 0E2 -> 0 +dqcom678 compare 0E1 0E2 -> 0 +dqcom679 compare 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +dqcom680 compare 12 12 -> 0 +dqcom681 compare 12 12.0 -> 0 +dqcom682 compare 12 12.00 -> 0 +dqcom683 compare 12 12.000 -> 0 +dqcom684 compare 12 12.0000 -> 0 +dqcom685 compare 12 12.00000 -> 0 +dqcom686 compare 12 12.000000 -> 0 +dqcom687 compare 12 12.0000000 -> 0 +dqcom688 compare 12 12.00000000 -> 0 +dqcom689 compare 12 12.000000000 -> 0 +dqcom690 compare 12 12 -> 0 +dqcom691 compare 12.0 12 -> 0 +dqcom692 compare 12.00 12 -> 0 +dqcom693 compare 12.000 12 -> 0 +dqcom694 compare 12.0000 12 -> 0 +dqcom695 compare 12.00000 12 -> 0 +dqcom696 compare 12.000000 12 -> 0 +dqcom697 compare 12.0000000 12 -> 0 +dqcom698 compare 12.00000000 12 -> 0 +dqcom699 compare 12.000000000 12 -> 0 + +-- first, second, & last digit +dqcom700 compare 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1 +dqcom701 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0 +dqcom702 compare 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1 +dqcom703 compare 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1 +dqcom704 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0 +dqcom705 compare 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1 +dqcom706 compare 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1 +dqcom707 compare 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0 +dqcom708 compare 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1 + +-- miscellaneous +dqcom721 compare 12345678000 1 -> 1 +dqcom722 compare 1 12345678000 -> -1 +dqcom723 compare 1234567800 1 -> 1 +dqcom724 compare 1 1234567800 -> -1 +dqcom725 compare 1234567890 1 -> 1 +dqcom726 compare 1 1234567890 -> -1 +dqcom727 compare 1234567891 1 -> 1 +dqcom728 compare 1 1234567891 -> -1 +dqcom729 compare 12345678901 1 -> 1 +dqcom730 compare 1 12345678901 -> -1 +dqcom731 compare 1234567896 1 -> 1 +dqcom732 compare 1 1234567896 -> -1 + +-- residue cases at lower precision +dqcom740 compare 1 0.9999999 -> 1 +dqcom741 compare 1 0.999999 -> 1 +dqcom742 compare 1 0.99999 -> 1 +dqcom743 compare 1 1.0000 -> 0 +dqcom744 compare 1 1.00001 -> -1 +dqcom745 compare 1 1.000001 -> -1 +dqcom746 compare 1 1.0000001 -> -1 +dqcom750 compare 0.9999999 1 -> -1 +dqcom751 compare 0.999999 1 -> -1 +dqcom752 compare 0.99999 1 -> -1 +dqcom753 compare 1.0000 1 -> 0 +dqcom754 compare 1.00001 1 -> 1 +dqcom755 compare 1.000001 1 -> 1 +dqcom756 compare 1.0000001 1 -> 1 + +-- Specials +dqcom780 compare Inf -Inf -> 1 +dqcom781 compare Inf -1000 -> 1 +dqcom782 compare Inf -1 -> 1 +dqcom783 compare Inf -0 -> 1 +dqcom784 compare Inf 0 -> 1 +dqcom785 compare Inf 1 -> 1 +dqcom786 compare Inf 1000 -> 1 +dqcom787 compare Inf Inf -> 0 +dqcom788 compare -1000 Inf -> -1 +dqcom789 compare -Inf Inf -> -1 +dqcom790 compare -1 Inf -> -1 +dqcom791 compare -0 Inf -> -1 +dqcom792 compare 0 Inf -> -1 +dqcom793 compare 1 Inf -> -1 +dqcom794 compare 1000 Inf -> -1 +dqcom795 compare Inf Inf -> 0 + +dqcom800 compare -Inf -Inf -> 0 +dqcom801 compare -Inf -1000 -> -1 +dqcom802 compare -Inf -1 -> -1 +dqcom803 compare -Inf -0 -> -1 +dqcom804 compare -Inf 0 -> -1 +dqcom805 compare -Inf 1 -> -1 +dqcom806 compare -Inf 1000 -> -1 +dqcom807 compare -Inf Inf -> -1 +dqcom808 compare -Inf -Inf -> 0 +dqcom809 compare -1000 -Inf -> 1 +dqcom810 compare -1 -Inf -> 1 +dqcom811 compare -0 -Inf -> 1 +dqcom812 compare 0 -Inf -> 1 +dqcom813 compare 1 -Inf -> 1 +dqcom814 compare 1000 -Inf -> 1 +dqcom815 compare Inf -Inf -> 1 + +dqcom821 compare NaN -Inf -> NaN +dqcom822 compare NaN -1000 -> NaN +dqcom823 compare NaN -1 -> NaN +dqcom824 compare NaN -0 -> NaN +dqcom825 compare NaN 0 -> NaN +dqcom826 compare NaN 1 -> NaN +dqcom827 compare NaN 1000 -> NaN +dqcom828 compare NaN Inf -> NaN +dqcom829 compare NaN NaN -> NaN +dqcom830 compare -Inf NaN -> NaN +dqcom831 compare -1000 NaN -> NaN +dqcom832 compare -1 NaN -> NaN +dqcom833 compare -0 NaN -> NaN +dqcom834 compare 0 NaN -> NaN +dqcom835 compare 1 NaN -> NaN +dqcom836 compare 1000 NaN -> NaN +dqcom837 compare Inf NaN -> NaN +dqcom838 compare -NaN -NaN -> -NaN +dqcom839 compare +NaN -NaN -> NaN +dqcom840 compare -NaN +NaN -> -NaN + +dqcom841 compare sNaN -Inf -> NaN Invalid_operation +dqcom842 compare sNaN -1000 -> NaN Invalid_operation +dqcom843 compare sNaN -1 -> NaN Invalid_operation +dqcom844 compare sNaN -0 -> NaN Invalid_operation +dqcom845 compare sNaN 0 -> NaN Invalid_operation +dqcom846 compare sNaN 1 -> NaN Invalid_operation +dqcom847 compare sNaN 1000 -> NaN Invalid_operation +dqcom848 compare sNaN NaN -> NaN Invalid_operation +dqcom849 compare sNaN sNaN -> NaN Invalid_operation +dqcom850 compare NaN sNaN -> NaN Invalid_operation +dqcom851 compare -Inf sNaN -> NaN Invalid_operation +dqcom852 compare -1000 sNaN -> NaN Invalid_operation +dqcom853 compare -1 sNaN -> NaN Invalid_operation +dqcom854 compare -0 sNaN -> NaN Invalid_operation +dqcom855 compare 0 sNaN -> NaN Invalid_operation +dqcom856 compare 1 sNaN -> NaN Invalid_operation +dqcom857 compare 1000 sNaN -> NaN Invalid_operation +dqcom858 compare Inf sNaN -> NaN Invalid_operation +dqcom859 compare NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqcom860 compare NaN9 -Inf -> NaN9 +dqcom861 compare NaN8 999 -> NaN8 +dqcom862 compare NaN77 Inf -> NaN77 +dqcom863 compare -NaN67 NaN5 -> -NaN67 +dqcom864 compare -Inf -NaN4 -> -NaN4 +dqcom865 compare -999 -NaN33 -> -NaN33 +dqcom866 compare Inf NaN2 -> NaN2 +dqcom867 compare -NaN41 -NaN42 -> -NaN41 +dqcom868 compare +NaN41 -NaN42 -> NaN41 +dqcom869 compare -NaN41 +NaN42 -> -NaN41 +dqcom870 compare +NaN41 +NaN42 -> NaN41 + +dqcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation +dqcom872 compare sNaN98 -11 -> NaN98 Invalid_operation +dqcom873 compare sNaN97 NaN -> NaN97 Invalid_operation +dqcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation +dqcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation +dqcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation +dqcom877 compare 088 sNaN81 -> NaN81 Invalid_operation +dqcom878 compare Inf sNaN90 -> NaN90 Invalid_operation +dqcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation + +-- wide range +dqcom880 compare +1.23456789012345E-0 9E+6144 -> -1 +dqcom881 compare 9E+6144 +1.23456789012345E-0 -> 1 +dqcom882 compare +0.100 9E-6143 -> 1 +dqcom883 compare 9E-6143 +0.100 -> -1 +dqcom885 compare -1.23456789012345E-0 9E+6144 -> -1 +dqcom886 compare 9E+6144 -1.23456789012345E-0 -> 1 +dqcom887 compare -0.100 9E-6143 -> -1 +dqcom888 compare 9E-6143 -0.100 -> 1 + +-- signs +dqcom901 compare 1e+77 1e+11 -> 1 +dqcom902 compare 1e+77 -1e+11 -> 1 +dqcom903 compare -1e+77 1e+11 -> -1 +dqcom904 compare -1e+77 -1e+11 -> -1 +dqcom905 compare 1e-77 1e-11 -> -1 +dqcom906 compare 1e-77 -1e-11 -> 1 +dqcom907 compare -1e-77 1e-11 -> -1 +dqcom908 compare -1e-77 -1e-11 -> 1 + +-- full alignment range, both ways +dqcomp1001 compare 1 1.000000000000000000000000000000000 -> 0 +dqcomp1002 compare 1 1.00000000000000000000000000000000 -> 0 +dqcomp1003 compare 1 1.0000000000000000000000000000000 -> 0 +dqcomp1004 compare 1 1.000000000000000000000000000000 -> 0 +dqcomp1005 compare 1 1.00000000000000000000000000000 -> 0 +dqcomp1006 compare 1 1.0000000000000000000000000000 -> 0 +dqcomp1007 compare 1 1.000000000000000000000000000 -> 0 +dqcomp1008 compare 1 1.00000000000000000000000000 -> 0 +dqcomp1009 compare 1 1.0000000000000000000000000 -> 0 +dqcomp1010 compare 1 1.000000000000000000000000 -> 0 +dqcomp1011 compare 1 1.00000000000000000000000 -> 0 +dqcomp1012 compare 1 1.0000000000000000000000 -> 0 +dqcomp1013 compare 1 1.000000000000000000000 -> 0 +dqcomp1014 compare 1 1.00000000000000000000 -> 0 +dqcomp1015 compare 1 1.0000000000000000000 -> 0 +dqcomp1016 compare 1 1.000000000000000000 -> 0 +dqcomp1017 compare 1 1.00000000000000000 -> 0 +dqcomp1018 compare 1 1.0000000000000000 -> 0 +dqcomp1019 compare 1 1.000000000000000 -> 0 +dqcomp1020 compare 1 1.00000000000000 -> 0 +dqcomp1021 compare 1 1.0000000000000 -> 0 +dqcomp1022 compare 1 1.000000000000 -> 0 +dqcomp1023 compare 1 1.00000000000 -> 0 +dqcomp1024 compare 1 1.0000000000 -> 0 +dqcomp1025 compare 1 1.000000000 -> 0 +dqcomp1026 compare 1 1.00000000 -> 0 +dqcomp1027 compare 1 1.0000000 -> 0 +dqcomp1028 compare 1 1.000000 -> 0 +dqcomp1029 compare 1 1.00000 -> 0 +dqcomp1030 compare 1 1.0000 -> 0 +dqcomp1031 compare 1 1.000 -> 0 +dqcomp1032 compare 1 1.00 -> 0 +dqcomp1033 compare 1 1.0 -> 0 + +dqcomp1041 compare 1.000000000000000000000000000000000 1 -> 0 +dqcomp1042 compare 1.00000000000000000000000000000000 1 -> 0 +dqcomp1043 compare 1.0000000000000000000000000000000 1 -> 0 +dqcomp1044 compare 1.000000000000000000000000000000 1 -> 0 +dqcomp1045 compare 1.00000000000000000000000000000 1 -> 0 +dqcomp1046 compare 1.0000000000000000000000000000 1 -> 0 +dqcomp1047 compare 1.000000000000000000000000000 1 -> 0 +dqcomp1048 compare 1.00000000000000000000000000 1 -> 0 +dqcomp1049 compare 1.0000000000000000000000000 1 -> 0 +dqcomp1050 compare 1.000000000000000000000000 1 -> 0 +dqcomp1051 compare 1.00000000000000000000000 1 -> 0 +dqcomp1052 compare 1.0000000000000000000000 1 -> 0 +dqcomp1053 compare 1.000000000000000000000 1 -> 0 +dqcomp1054 compare 1.00000000000000000000 1 -> 0 +dqcomp1055 compare 1.0000000000000000000 1 -> 0 +dqcomp1056 compare 1.000000000000000000 1 -> 0 +dqcomp1057 compare 1.00000000000000000 1 -> 0 +dqcomp1058 compare 1.0000000000000000 1 -> 0 +dqcomp1059 compare 1.000000000000000 1 -> 0 +dqcomp1060 compare 1.00000000000000 1 -> 0 +dqcomp1061 compare 1.0000000000000 1 -> 0 +dqcomp1062 compare 1.000000000000 1 -> 0 +dqcomp1063 compare 1.00000000000 1 -> 0 +dqcomp1064 compare 1.0000000000 1 -> 0 +dqcomp1065 compare 1.000000000 1 -> 0 +dqcomp1066 compare 1.00000000 1 -> 0 +dqcomp1067 compare 1.0000000 1 -> 0 +dqcomp1068 compare 1.000000 1 -> 0 +dqcomp1069 compare 1.00000 1 -> 0 +dqcomp1070 compare 1.0000 1 -> 0 +dqcomp1071 compare 1.000 1 -> 0 +dqcomp1072 compare 1.00 1 -> 0 +dqcomp1073 compare 1.0 1 -> 0 + +-- check MSD always detected non-zero +dqcomp1080 compare 0 0.000000000000000000000000000000000 -> 0 +dqcomp1081 compare 0 1.000000000000000000000000000000000 -> -1 +dqcomp1082 compare 0 2.000000000000000000000000000000000 -> -1 +dqcomp1083 compare 0 3.000000000000000000000000000000000 -> -1 +dqcomp1084 compare 0 4.000000000000000000000000000000000 -> -1 +dqcomp1085 compare 0 5.000000000000000000000000000000000 -> -1 +dqcomp1086 compare 0 6.000000000000000000000000000000000 -> -1 +dqcomp1087 compare 0 7.000000000000000000000000000000000 -> -1 +dqcomp1088 compare 0 8.000000000000000000000000000000000 -> -1 +dqcomp1089 compare 0 9.000000000000000000000000000000000 -> -1 +dqcomp1090 compare 0.000000000000000000000000000000000 0 -> 0 +dqcomp1091 compare 1.000000000000000000000000000000000 0 -> 1 +dqcomp1092 compare 2.000000000000000000000000000000000 0 -> 1 +dqcomp1093 compare 3.000000000000000000000000000000000 0 -> 1 +dqcomp1094 compare 4.000000000000000000000000000000000 0 -> 1 +dqcomp1095 compare 5.000000000000000000000000000000000 0 -> 1 +dqcomp1096 compare 6.000000000000000000000000000000000 0 -> 1 +dqcomp1097 compare 7.000000000000000000000000000000000 0 -> 1 +dqcomp1098 compare 8.000000000000000000000000000000000 0 -> 1 +dqcomp1099 compare 9.000000000000000000000000000000000 0 -> 1 + +-- Null tests +dqcom990 compare 10 # -> NaN Invalid_operation +dqcom991 compare # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareSig.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareSig.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,647 @@ +------------------------------------------------------------------------ +-- dqCompareSig.decTest -- decQuad comparison; all NaNs signal -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqcms001 comparesig -2 -2 -> 0 +dqcms002 comparesig -2 -1 -> -1 +dqcms003 comparesig -2 0 -> -1 +dqcms004 comparesig -2 1 -> -1 +dqcms005 comparesig -2 2 -> -1 +dqcms006 comparesig -1 -2 -> 1 +dqcms007 comparesig -1 -1 -> 0 +dqcms008 comparesig -1 0 -> -1 +dqcms009 comparesig -1 1 -> -1 +dqcms010 comparesig -1 2 -> -1 +dqcms011 comparesig 0 -2 -> 1 +dqcms012 comparesig 0 -1 -> 1 +dqcms013 comparesig 0 0 -> 0 +dqcms014 comparesig 0 1 -> -1 +dqcms015 comparesig 0 2 -> -1 +dqcms016 comparesig 1 -2 -> 1 +dqcms017 comparesig 1 -1 -> 1 +dqcms018 comparesig 1 0 -> 1 +dqcms019 comparesig 1 1 -> 0 +dqcms020 comparesig 1 2 -> -1 +dqcms021 comparesig 2 -2 -> 1 +dqcms022 comparesig 2 -1 -> 1 +dqcms023 comparesig 2 0 -> 1 +dqcms025 comparesig 2 1 -> 1 +dqcms026 comparesig 2 2 -> 0 + +dqcms031 comparesig -20 -20 -> 0 +dqcms032 comparesig -20 -10 -> -1 +dqcms033 comparesig -20 00 -> -1 +dqcms034 comparesig -20 10 -> -1 +dqcms035 comparesig -20 20 -> -1 +dqcms036 comparesig -10 -20 -> 1 +dqcms037 comparesig -10 -10 -> 0 +dqcms038 comparesig -10 00 -> -1 +dqcms039 comparesig -10 10 -> -1 +dqcms040 comparesig -10 20 -> -1 +dqcms041 comparesig 00 -20 -> 1 +dqcms042 comparesig 00 -10 -> 1 +dqcms043 comparesig 00 00 -> 0 +dqcms044 comparesig 00 10 -> -1 +dqcms045 comparesig 00 20 -> -1 +dqcms046 comparesig 10 -20 -> 1 +dqcms047 comparesig 10 -10 -> 1 +dqcms048 comparesig 10 00 -> 1 +dqcms049 comparesig 10 10 -> 0 +dqcms050 comparesig 10 20 -> -1 +dqcms051 comparesig 20 -20 -> 1 +dqcms052 comparesig 20 -10 -> 1 +dqcms053 comparesig 20 00 -> 1 +dqcms055 comparesig 20 10 -> 1 +dqcms056 comparesig 20 20 -> 0 + +dqcms061 comparesig -2.0 -2.0 -> 0 +dqcms062 comparesig -2.0 -1.0 -> -1 +dqcms063 comparesig -2.0 0.0 -> -1 +dqcms064 comparesig -2.0 1.0 -> -1 +dqcms065 comparesig -2.0 2.0 -> -1 +dqcms066 comparesig -1.0 -2.0 -> 1 +dqcms067 comparesig -1.0 -1.0 -> 0 +dqcms068 comparesig -1.0 0.0 -> -1 +dqcms069 comparesig -1.0 1.0 -> -1 +dqcms070 comparesig -1.0 2.0 -> -1 +dqcms071 comparesig 0.0 -2.0 -> 1 +dqcms072 comparesig 0.0 -1.0 -> 1 +dqcms073 comparesig 0.0 0.0 -> 0 +dqcms074 comparesig 0.0 1.0 -> -1 +dqcms075 comparesig 0.0 2.0 -> -1 +dqcms076 comparesig 1.0 -2.0 -> 1 +dqcms077 comparesig 1.0 -1.0 -> 1 +dqcms078 comparesig 1.0 0.0 -> 1 +dqcms079 comparesig 1.0 1.0 -> 0 +dqcms080 comparesig 1.0 2.0 -> -1 +dqcms081 comparesig 2.0 -2.0 -> 1 +dqcms082 comparesig 2.0 -1.0 -> 1 +dqcms083 comparesig 2.0 0.0 -> 1 +dqcms085 comparesig 2.0 1.0 -> 1 +dqcms086 comparesig 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +dqcms090 comparesig 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0 +dqcms091 comparesig -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1 +dqcms092 comparesig 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1 +dqcms093 comparesig -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0 + +-- some differing length/exponent cases +dqcms100 comparesig 7.0 7.0 -> 0 +dqcms101 comparesig 7.0 7 -> 0 +dqcms102 comparesig 7 7.0 -> 0 +dqcms103 comparesig 7E+0 7.0 -> 0 +dqcms104 comparesig 70E-1 7.0 -> 0 +dqcms105 comparesig 0.7E+1 7 -> 0 +dqcms106 comparesig 70E-1 7 -> 0 +dqcms107 comparesig 7.0 7E+0 -> 0 +dqcms108 comparesig 7.0 70E-1 -> 0 +dqcms109 comparesig 7 0.7E+1 -> 0 +dqcms110 comparesig 7 70E-1 -> 0 + +dqcms120 comparesig 8.0 7.0 -> 1 +dqcms121 comparesig 8.0 7 -> 1 +dqcms122 comparesig 8 7.0 -> 1 +dqcms123 comparesig 8E+0 7.0 -> 1 +dqcms124 comparesig 80E-1 7.0 -> 1 +dqcms125 comparesig 0.8E+1 7 -> 1 +dqcms126 comparesig 80E-1 7 -> 1 +dqcms127 comparesig 8.0 7E+0 -> 1 +dqcms128 comparesig 8.0 70E-1 -> 1 +dqcms129 comparesig 8 0.7E+1 -> 1 +dqcms130 comparesig 8 70E-1 -> 1 + +dqcms140 comparesig 8.0 9.0 -> -1 +dqcms141 comparesig 8.0 9 -> -1 +dqcms142 comparesig 8 9.0 -> -1 +dqcms143 comparesig 8E+0 9.0 -> -1 +dqcms144 comparesig 80E-1 9.0 -> -1 +dqcms145 comparesig 0.8E+1 9 -> -1 +dqcms146 comparesig 80E-1 9 -> -1 +dqcms147 comparesig 8.0 9E+0 -> -1 +dqcms148 comparesig 8.0 90E-1 -> -1 +dqcms149 comparesig 8 0.9E+1 -> -1 +dqcms150 comparesig 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +dqcms200 comparesig -7.0 7.0 -> -1 +dqcms201 comparesig -7.0 7 -> -1 +dqcms202 comparesig -7 7.0 -> -1 +dqcms203 comparesig -7E+0 7.0 -> -1 +dqcms204 comparesig -70E-1 7.0 -> -1 +dqcms205 comparesig -0.7E+1 7 -> -1 +dqcms206 comparesig -70E-1 7 -> -1 +dqcms207 comparesig -7.0 7E+0 -> -1 +dqcms208 comparesig -7.0 70E-1 -> -1 +dqcms209 comparesig -7 0.7E+1 -> -1 +dqcms210 comparesig -7 70E-1 -> -1 + +dqcms220 comparesig -8.0 7.0 -> -1 +dqcms221 comparesig -8.0 7 -> -1 +dqcms222 comparesig -8 7.0 -> -1 +dqcms223 comparesig -8E+0 7.0 -> -1 +dqcms224 comparesig -80E-1 7.0 -> -1 +dqcms225 comparesig -0.8E+1 7 -> -1 +dqcms226 comparesig -80E-1 7 -> -1 +dqcms227 comparesig -8.0 7E+0 -> -1 +dqcms228 comparesig -8.0 70E-1 -> -1 +dqcms229 comparesig -8 0.7E+1 -> -1 +dqcms230 comparesig -8 70E-1 -> -1 + +dqcms240 comparesig -8.0 9.0 -> -1 +dqcms241 comparesig -8.0 9 -> -1 +dqcms242 comparesig -8 9.0 -> -1 +dqcms243 comparesig -8E+0 9.0 -> -1 +dqcms244 comparesig -80E-1 9.0 -> -1 +dqcms245 comparesig -0.8E+1 9 -> -1 +dqcms246 comparesig -80E-1 9 -> -1 +dqcms247 comparesig -8.0 9E+0 -> -1 +dqcms248 comparesig -8.0 90E-1 -> -1 +dqcms249 comparesig -8 0.9E+1 -> -1 +dqcms250 comparesig -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +dqcms300 comparesig 7.0 -7.0 -> 1 +dqcms301 comparesig 7.0 -7 -> 1 +dqcms302 comparesig 7 -7.0 -> 1 +dqcms303 comparesig 7E+0 -7.0 -> 1 +dqcms304 comparesig 70E-1 -7.0 -> 1 +dqcms305 comparesig .7E+1 -7 -> 1 +dqcms306 comparesig 70E-1 -7 -> 1 +dqcms307 comparesig 7.0 -7E+0 -> 1 +dqcms308 comparesig 7.0 -70E-1 -> 1 +dqcms309 comparesig 7 -.7E+1 -> 1 +dqcms310 comparesig 7 -70E-1 -> 1 + +dqcms320 comparesig 8.0 -7.0 -> 1 +dqcms321 comparesig 8.0 -7 -> 1 +dqcms322 comparesig 8 -7.0 -> 1 +dqcms323 comparesig 8E+0 -7.0 -> 1 +dqcms324 comparesig 80E-1 -7.0 -> 1 +dqcms325 comparesig .8E+1 -7 -> 1 +dqcms326 comparesig 80E-1 -7 -> 1 +dqcms327 comparesig 8.0 -7E+0 -> 1 +dqcms328 comparesig 8.0 -70E-1 -> 1 +dqcms329 comparesig 8 -.7E+1 -> 1 +dqcms330 comparesig 8 -70E-1 -> 1 + +dqcms340 comparesig 8.0 -9.0 -> 1 +dqcms341 comparesig 8.0 -9 -> 1 +dqcms342 comparesig 8 -9.0 -> 1 +dqcms343 comparesig 8E+0 -9.0 -> 1 +dqcms344 comparesig 80E-1 -9.0 -> 1 +dqcms345 comparesig .8E+1 -9 -> 1 +dqcms346 comparesig 80E-1 -9 -> 1 +dqcms347 comparesig 8.0 -9E+0 -> 1 +dqcms348 comparesig 8.0 -90E-1 -> 1 +dqcms349 comparesig 8 -.9E+1 -> 1 +dqcms350 comparesig 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +dqcms400 comparesig -7.0 -7.0 -> 0 +dqcms401 comparesig -7.0 -7 -> 0 +dqcms402 comparesig -7 -7.0 -> 0 +dqcms403 comparesig -7E+0 -7.0 -> 0 +dqcms404 comparesig -70E-1 -7.0 -> 0 +dqcms405 comparesig -.7E+1 -7 -> 0 +dqcms406 comparesig -70E-1 -7 -> 0 +dqcms407 comparesig -7.0 -7E+0 -> 0 +dqcms408 comparesig -7.0 -70E-1 -> 0 +dqcms409 comparesig -7 -.7E+1 -> 0 +dqcms410 comparesig -7 -70E-1 -> 0 + +dqcms420 comparesig -8.0 -7.0 -> -1 +dqcms421 comparesig -8.0 -7 -> -1 +dqcms422 comparesig -8 -7.0 -> -1 +dqcms423 comparesig -8E+0 -7.0 -> -1 +dqcms424 comparesig -80E-1 -7.0 -> -1 +dqcms425 comparesig -.8E+1 -7 -> -1 +dqcms426 comparesig -80E-1 -7 -> -1 +dqcms427 comparesig -8.0 -7E+0 -> -1 +dqcms428 comparesig -8.0 -70E-1 -> -1 +dqcms429 comparesig -8 -.7E+1 -> -1 +dqcms430 comparesig -8 -70E-1 -> -1 + +dqcms440 comparesig -8.0 -9.0 -> 1 +dqcms441 comparesig -8.0 -9 -> 1 +dqcms442 comparesig -8 -9.0 -> 1 +dqcms443 comparesig -8E+0 -9.0 -> 1 +dqcms444 comparesig -80E-1 -9.0 -> 1 +dqcms445 comparesig -.8E+1 -9 -> 1 +dqcms446 comparesig -80E-1 -9 -> 1 +dqcms447 comparesig -8.0 -9E+0 -> 1 +dqcms448 comparesig -8.0 -90E-1 -> 1 +dqcms449 comparesig -8 -.9E+1 -> 1 +dqcms450 comparesig -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +dqcms473 comparesig 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0 +dqcms474 comparesig 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0 +dqcms475 comparesig 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0 +dqcms476 comparesig 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0 +dqcms477 comparesig 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0 +dqcms478 comparesig 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0 +dqcms479 comparesig 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0 +dqcms480 comparesig 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0 +dqcms481 comparesig 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0 +dqcms482 comparesig 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0 +dqcms483 comparesig 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0 +dqcms487 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0 +dqcms488 comparesig 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0 +dqcms489 comparesig 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0 +dqcms490 comparesig 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0 +dqcms491 comparesig 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0 +dqcms492 comparesig 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0 +dqcms493 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0 +dqcms494 comparesig 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0 +dqcms495 comparesig 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0 +dqcms496 comparesig 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0 +dqcms497 comparesig 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +dqcms500 comparesig 1 1E-15 -> 1 +dqcms501 comparesig 1 1E-14 -> 1 +dqcms502 comparesig 1 1E-13 -> 1 +dqcms503 comparesig 1 1E-12 -> 1 +dqcms504 comparesig 1 1E-11 -> 1 +dqcms505 comparesig 1 1E-10 -> 1 +dqcms506 comparesig 1 1E-9 -> 1 +dqcms507 comparesig 1 1E-8 -> 1 +dqcms508 comparesig 1 1E-7 -> 1 +dqcms509 comparesig 1 1E-6 -> 1 +dqcms510 comparesig 1 1E-5 -> 1 +dqcms511 comparesig 1 1E-4 -> 1 +dqcms512 comparesig 1 1E-3 -> 1 +dqcms513 comparesig 1 1E-2 -> 1 +dqcms514 comparesig 1 1E-1 -> 1 +dqcms515 comparesig 1 1E-0 -> 0 +dqcms516 comparesig 1 1E+1 -> -1 +dqcms517 comparesig 1 1E+2 -> -1 +dqcms518 comparesig 1 1E+3 -> -1 +dqcms519 comparesig 1 1E+4 -> -1 +dqcms521 comparesig 1 1E+5 -> -1 +dqcms522 comparesig 1 1E+6 -> -1 +dqcms523 comparesig 1 1E+7 -> -1 +dqcms524 comparesig 1 1E+8 -> -1 +dqcms525 comparesig 1 1E+9 -> -1 +dqcms526 comparesig 1 1E+10 -> -1 +dqcms527 comparesig 1 1E+11 -> -1 +dqcms528 comparesig 1 1E+12 -> -1 +dqcms529 comparesig 1 1E+13 -> -1 +dqcms530 comparesig 1 1E+14 -> -1 +dqcms531 comparesig 1 1E+15 -> -1 +-- LR swap +dqcms540 comparesig 1E-15 1 -> -1 +dqcms541 comparesig 1E-14 1 -> -1 +dqcms542 comparesig 1E-13 1 -> -1 +dqcms543 comparesig 1E-12 1 -> -1 +dqcms544 comparesig 1E-11 1 -> -1 +dqcms545 comparesig 1E-10 1 -> -1 +dqcms546 comparesig 1E-9 1 -> -1 +dqcms547 comparesig 1E-8 1 -> -1 +dqcms548 comparesig 1E-7 1 -> -1 +dqcms549 comparesig 1E-6 1 -> -1 +dqcms550 comparesig 1E-5 1 -> -1 +dqcms551 comparesig 1E-4 1 -> -1 +dqcms552 comparesig 1E-3 1 -> -1 +dqcms553 comparesig 1E-2 1 -> -1 +dqcms554 comparesig 1E-1 1 -> -1 +dqcms555 comparesig 1E-0 1 -> 0 +dqcms556 comparesig 1E+1 1 -> 1 +dqcms557 comparesig 1E+2 1 -> 1 +dqcms558 comparesig 1E+3 1 -> 1 +dqcms559 comparesig 1E+4 1 -> 1 +dqcms561 comparesig 1E+5 1 -> 1 +dqcms562 comparesig 1E+6 1 -> 1 +dqcms563 comparesig 1E+7 1 -> 1 +dqcms564 comparesig 1E+8 1 -> 1 +dqcms565 comparesig 1E+9 1 -> 1 +dqcms566 comparesig 1E+10 1 -> 1 +dqcms567 comparesig 1E+11 1 -> 1 +dqcms568 comparesig 1E+12 1 -> 1 +dqcms569 comparesig 1E+13 1 -> 1 +dqcms570 comparesig 1E+14 1 -> 1 +dqcms571 comparesig 1E+15 1 -> 1 +-- similar with a useful coefficient, one side only +dqcms580 comparesig 0.000000987654321 1E-15 -> 1 +dqcms581 comparesig 0.000000987654321 1E-14 -> 1 +dqcms582 comparesig 0.000000987654321 1E-13 -> 1 +dqcms583 comparesig 0.000000987654321 1E-12 -> 1 +dqcms584 comparesig 0.000000987654321 1E-11 -> 1 +dqcms585 comparesig 0.000000987654321 1E-10 -> 1 +dqcms586 comparesig 0.000000987654321 1E-9 -> 1 +dqcms587 comparesig 0.000000987654321 1E-8 -> 1 +dqcms588 comparesig 0.000000987654321 1E-7 -> 1 +dqcms589 comparesig 0.000000987654321 1E-6 -> -1 +dqcms590 comparesig 0.000000987654321 1E-5 -> -1 +dqcms591 comparesig 0.000000987654321 1E-4 -> -1 +dqcms592 comparesig 0.000000987654321 1E-3 -> -1 +dqcms593 comparesig 0.000000987654321 1E-2 -> -1 +dqcms594 comparesig 0.000000987654321 1E-1 -> -1 +dqcms595 comparesig 0.000000987654321 1E-0 -> -1 +dqcms596 comparesig 0.000000987654321 1E+1 -> -1 +dqcms597 comparesig 0.000000987654321 1E+2 -> -1 +dqcms598 comparesig 0.000000987654321 1E+3 -> -1 +dqcms599 comparesig 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +dqcms600 comparesig 12 12.2345 -> -1 +dqcms601 comparesig 12.0 12.2345 -> -1 +dqcms602 comparesig 12.00 12.2345 -> -1 +dqcms603 comparesig 12.000 12.2345 -> -1 +dqcms604 comparesig 12.0000 12.2345 -> -1 +dqcms605 comparesig 12.00000 12.2345 -> -1 +dqcms606 comparesig 12.000000 12.2345 -> -1 +dqcms607 comparesig 12.0000000 12.2345 -> -1 +dqcms608 comparesig 12.00000000 12.2345 -> -1 +dqcms609 comparesig 12.000000000 12.2345 -> -1 +dqcms610 comparesig 12.1234 12 -> 1 +dqcms611 comparesig 12.1234 12.0 -> 1 +dqcms612 comparesig 12.1234 12.00 -> 1 +dqcms613 comparesig 12.1234 12.000 -> 1 +dqcms614 comparesig 12.1234 12.0000 -> 1 +dqcms615 comparesig 12.1234 12.00000 -> 1 +dqcms616 comparesig 12.1234 12.000000 -> 1 +dqcms617 comparesig 12.1234 12.0000000 -> 1 +dqcms618 comparesig 12.1234 12.00000000 -> 1 +dqcms619 comparesig 12.1234 12.000000000 -> 1 +dqcms620 comparesig -12 -12.2345 -> 1 +dqcms621 comparesig -12.0 -12.2345 -> 1 +dqcms622 comparesig -12.00 -12.2345 -> 1 +dqcms623 comparesig -12.000 -12.2345 -> 1 +dqcms624 comparesig -12.0000 -12.2345 -> 1 +dqcms625 comparesig -12.00000 -12.2345 -> 1 +dqcms626 comparesig -12.000000 -12.2345 -> 1 +dqcms627 comparesig -12.0000000 -12.2345 -> 1 +dqcms628 comparesig -12.00000000 -12.2345 -> 1 +dqcms629 comparesig -12.000000000 -12.2345 -> 1 +dqcms630 comparesig -12.1234 -12 -> -1 +dqcms631 comparesig -12.1234 -12.0 -> -1 +dqcms632 comparesig -12.1234 -12.00 -> -1 +dqcms633 comparesig -12.1234 -12.000 -> -1 +dqcms634 comparesig -12.1234 -12.0000 -> -1 +dqcms635 comparesig -12.1234 -12.00000 -> -1 +dqcms636 comparesig -12.1234 -12.000000 -> -1 +dqcms637 comparesig -12.1234 -12.0000000 -> -1 +dqcms638 comparesig -12.1234 -12.00000000 -> -1 +dqcms639 comparesig -12.1234 -12.000000000 -> -1 + +-- extended zeros +dqcms640 comparesig 0 0 -> 0 +dqcms641 comparesig 0 -0 -> 0 +dqcms642 comparesig 0 -0.0 -> 0 +dqcms643 comparesig 0 0.0 -> 0 +dqcms644 comparesig -0 0 -> 0 +dqcms645 comparesig -0 -0 -> 0 +dqcms646 comparesig -0 -0.0 -> 0 +dqcms647 comparesig -0 0.0 -> 0 +dqcms648 comparesig 0.0 0 -> 0 +dqcms649 comparesig 0.0 -0 -> 0 +dqcms650 comparesig 0.0 -0.0 -> 0 +dqcms651 comparesig 0.0 0.0 -> 0 +dqcms652 comparesig -0.0 0 -> 0 +dqcms653 comparesig -0.0 -0 -> 0 +dqcms654 comparesig -0.0 -0.0 -> 0 +dqcms655 comparesig -0.0 0.0 -> 0 + +dqcms656 comparesig -0E1 0.0 -> 0 +dqcms657 comparesig -0E2 0.0 -> 0 +dqcms658 comparesig 0E1 0.0 -> 0 +dqcms659 comparesig 0E2 0.0 -> 0 +dqcms660 comparesig -0E1 0 -> 0 +dqcms661 comparesig -0E2 0 -> 0 +dqcms662 comparesig 0E1 0 -> 0 +dqcms663 comparesig 0E2 0 -> 0 +dqcms664 comparesig -0E1 -0E1 -> 0 +dqcms665 comparesig -0E2 -0E1 -> 0 +dqcms666 comparesig 0E1 -0E1 -> 0 +dqcms667 comparesig 0E2 -0E1 -> 0 +dqcms668 comparesig -0E1 -0E2 -> 0 +dqcms669 comparesig -0E2 -0E2 -> 0 +dqcms670 comparesig 0E1 -0E2 -> 0 +dqcms671 comparesig 0E2 -0E2 -> 0 +dqcms672 comparesig -0E1 0E1 -> 0 +dqcms673 comparesig -0E2 0E1 -> 0 +dqcms674 comparesig 0E1 0E1 -> 0 +dqcms675 comparesig 0E2 0E1 -> 0 +dqcms676 comparesig -0E1 0E2 -> 0 +dqcms677 comparesig -0E2 0E2 -> 0 +dqcms678 comparesig 0E1 0E2 -> 0 +dqcms679 comparesig 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +dqcms680 comparesig 12 12 -> 0 +dqcms681 comparesig 12 12.0 -> 0 +dqcms682 comparesig 12 12.00 -> 0 +dqcms683 comparesig 12 12.000 -> 0 +dqcms684 comparesig 12 12.0000 -> 0 +dqcms685 comparesig 12 12.00000 -> 0 +dqcms686 comparesig 12 12.000000 -> 0 +dqcms687 comparesig 12 12.0000000 -> 0 +dqcms688 comparesig 12 12.00000000 -> 0 +dqcms689 comparesig 12 12.000000000 -> 0 +dqcms690 comparesig 12 12 -> 0 +dqcms691 comparesig 12.0 12 -> 0 +dqcms692 comparesig 12.00 12 -> 0 +dqcms693 comparesig 12.000 12 -> 0 +dqcms694 comparesig 12.0000 12 -> 0 +dqcms695 comparesig 12.00000 12 -> 0 +dqcms696 comparesig 12.000000 12 -> 0 +dqcms697 comparesig 12.0000000 12 -> 0 +dqcms698 comparesig 12.00000000 12 -> 0 +dqcms699 comparesig 12.000000000 12 -> 0 + +-- first, second, & last digit +dqcms700 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1 +dqcms701 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0 +dqcms702 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1 +dqcms703 comparesig 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1 +dqcms704 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0 +dqcms705 comparesig 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1 +dqcms706 comparesig 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1 +dqcms707 comparesig 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0 +dqcms708 comparesig 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1 + +-- miscellaneous +dqcms721 comparesig 12345678000 1 -> 1 +dqcms722 comparesig 1 12345678000 -> -1 +dqcms723 comparesig 1234567800 1 -> 1 +dqcms724 comparesig 1 1234567800 -> -1 +dqcms725 comparesig 1234567890 1 -> 1 +dqcms726 comparesig 1 1234567890 -> -1 +dqcms727 comparesig 1234567891 1 -> 1 +dqcms728 comparesig 1 1234567891 -> -1 +dqcms729 comparesig 12345678901 1 -> 1 +dqcms730 comparesig 1 12345678901 -> -1 +dqcms731 comparesig 1234567896 1 -> 1 +dqcms732 comparesig 1 1234567896 -> -1 + +-- residue cases at lower precision +dqcms740 comparesig 1 0.9999999 -> 1 +dqcms741 comparesig 1 0.999999 -> 1 +dqcms742 comparesig 1 0.99999 -> 1 +dqcms743 comparesig 1 1.0000 -> 0 +dqcms744 comparesig 1 1.00001 -> -1 +dqcms745 comparesig 1 1.000001 -> -1 +dqcms746 comparesig 1 1.0000001 -> -1 +dqcms750 comparesig 0.9999999 1 -> -1 +dqcms751 comparesig 0.999999 1 -> -1 +dqcms752 comparesig 0.99999 1 -> -1 +dqcms753 comparesig 1.0000 1 -> 0 +dqcms754 comparesig 1.00001 1 -> 1 +dqcms755 comparesig 1.000001 1 -> 1 +dqcms756 comparesig 1.0000001 1 -> 1 + +-- Specials +dqcms780 comparesig Inf -Inf -> 1 +dqcms781 comparesig Inf -1000 -> 1 +dqcms782 comparesig Inf -1 -> 1 +dqcms783 comparesig Inf -0 -> 1 +dqcms784 comparesig Inf 0 -> 1 +dqcms785 comparesig Inf 1 -> 1 +dqcms786 comparesig Inf 1000 -> 1 +dqcms787 comparesig Inf Inf -> 0 +dqcms788 comparesig -1000 Inf -> -1 +dqcms789 comparesig -Inf Inf -> -1 +dqcms790 comparesig -1 Inf -> -1 +dqcms791 comparesig -0 Inf -> -1 +dqcms792 comparesig 0 Inf -> -1 +dqcms793 comparesig 1 Inf -> -1 +dqcms794 comparesig 1000 Inf -> -1 +dqcms795 comparesig Inf Inf -> 0 + +dqcms800 comparesig -Inf -Inf -> 0 +dqcms801 comparesig -Inf -1000 -> -1 +dqcms802 comparesig -Inf -1 -> -1 +dqcms803 comparesig -Inf -0 -> -1 +dqcms804 comparesig -Inf 0 -> -1 +dqcms805 comparesig -Inf 1 -> -1 +dqcms806 comparesig -Inf 1000 -> -1 +dqcms807 comparesig -Inf Inf -> -1 +dqcms808 comparesig -Inf -Inf -> 0 +dqcms809 comparesig -1000 -Inf -> 1 +dqcms810 comparesig -1 -Inf -> 1 +dqcms811 comparesig -0 -Inf -> 1 +dqcms812 comparesig 0 -Inf -> 1 +dqcms813 comparesig 1 -Inf -> 1 +dqcms814 comparesig 1000 -Inf -> 1 +dqcms815 comparesig Inf -Inf -> 1 + +dqcms821 comparesig NaN -Inf -> NaN Invalid_operation +dqcms822 comparesig NaN -1000 -> NaN Invalid_operation +dqcms823 comparesig NaN -1 -> NaN Invalid_operation +dqcms824 comparesig NaN -0 -> NaN Invalid_operation +dqcms825 comparesig NaN 0 -> NaN Invalid_operation +dqcms826 comparesig NaN 1 -> NaN Invalid_operation +dqcms827 comparesig NaN 1000 -> NaN Invalid_operation +dqcms828 comparesig NaN Inf -> NaN Invalid_operation +dqcms829 comparesig NaN NaN -> NaN Invalid_operation +dqcms830 comparesig -Inf NaN -> NaN Invalid_operation +dqcms831 comparesig -1000 NaN -> NaN Invalid_operation +dqcms832 comparesig -1 NaN -> NaN Invalid_operation +dqcms833 comparesig -0 NaN -> NaN Invalid_operation +dqcms834 comparesig 0 NaN -> NaN Invalid_operation +dqcms835 comparesig 1 NaN -> NaN Invalid_operation +dqcms836 comparesig 1000 NaN -> NaN Invalid_operation +dqcms837 comparesig Inf NaN -> NaN Invalid_operation +dqcms838 comparesig -NaN -NaN -> -NaN Invalid_operation +dqcms839 comparesig +NaN -NaN -> NaN Invalid_operation +dqcms840 comparesig -NaN +NaN -> -NaN Invalid_operation + +dqcms841 comparesig sNaN -Inf -> NaN Invalid_operation +dqcms842 comparesig sNaN -1000 -> NaN Invalid_operation +dqcms843 comparesig sNaN -1 -> NaN Invalid_operation +dqcms844 comparesig sNaN -0 -> NaN Invalid_operation +dqcms845 comparesig sNaN 0 -> NaN Invalid_operation +dqcms846 comparesig sNaN 1 -> NaN Invalid_operation +dqcms847 comparesig sNaN 1000 -> NaN Invalid_operation +dqcms848 comparesig sNaN NaN -> NaN Invalid_operation +dqcms849 comparesig sNaN sNaN -> NaN Invalid_operation +dqcms850 comparesig NaN sNaN -> NaN Invalid_operation +dqcms851 comparesig -Inf sNaN -> NaN Invalid_operation +dqcms852 comparesig -1000 sNaN -> NaN Invalid_operation +dqcms853 comparesig -1 sNaN -> NaN Invalid_operation +dqcms854 comparesig -0 sNaN -> NaN Invalid_operation +dqcms855 comparesig 0 sNaN -> NaN Invalid_operation +dqcms856 comparesig 1 sNaN -> NaN Invalid_operation +dqcms857 comparesig 1000 sNaN -> NaN Invalid_operation +dqcms858 comparesig Inf sNaN -> NaN Invalid_operation +dqcms859 comparesig NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation +dqcms861 comparesig NaN8 999 -> NaN8 Invalid_operation +dqcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation +dqcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation +dqcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation +dqcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation +dqcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation +dqcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation +dqcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation +dqcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation +dqcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation + +dqcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation +dqcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation +dqcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation +dqcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation +dqcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation +dqcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation +dqcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation +dqcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation +dqcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation + +-- wide range +dqcms880 comparesig +1.23456789012345E-0 9E+6144 -> -1 +dqcms881 comparesig 9E+6144 +1.23456789012345E-0 -> 1 +dqcms882 comparesig +0.100 9E-6143 -> 1 +dqcms883 comparesig 9E-6143 +0.100 -> -1 +dqcms885 comparesig -1.23456789012345E-0 9E+6144 -> -1 +dqcms886 comparesig 9E+6144 -1.23456789012345E-0 -> 1 +dqcms887 comparesig -0.100 9E-6143 -> -1 +dqcms888 comparesig 9E-6143 -0.100 -> 1 + +-- signs +dqcms901 comparesig 1e+77 1e+11 -> 1 +dqcms902 comparesig 1e+77 -1e+11 -> 1 +dqcms903 comparesig -1e+77 1e+11 -> -1 +dqcms904 comparesig -1e+77 -1e+11 -> -1 +dqcms905 comparesig 1e-77 1e-11 -> -1 +dqcms906 comparesig 1e-77 -1e-11 -> 1 +dqcms907 comparesig -1e-77 1e-11 -> -1 +dqcms908 comparesig -1e-77 -1e-11 -> 1 + +-- Null tests +dqcms990 comparesig 10 # -> NaN Invalid_operation +dqcms991 comparesig # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareTotal.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareTotal.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,706 @@ +------------------------------------------------------------------------ +-- dqCompareTotal.decTest -- decQuad comparison using total ordering -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). +-- Similarly, comparetotal will have some radically different paths +-- than compare. + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqcot001 comparetotal -2 -2 -> 0 +dqcot002 comparetotal -2 -1 -> -1 +dqcot003 comparetotal -2 0 -> -1 +dqcot004 comparetotal -2 1 -> -1 +dqcot005 comparetotal -2 2 -> -1 +dqcot006 comparetotal -1 -2 -> 1 +dqcot007 comparetotal -1 -1 -> 0 +dqcot008 comparetotal -1 0 -> -1 +dqcot009 comparetotal -1 1 -> -1 +dqcot010 comparetotal -1 2 -> -1 +dqcot011 comparetotal 0 -2 -> 1 +dqcot012 comparetotal 0 -1 -> 1 +dqcot013 comparetotal 0 0 -> 0 +dqcot014 comparetotal 0 1 -> -1 +dqcot015 comparetotal 0 2 -> -1 +dqcot016 comparetotal 1 -2 -> 1 +dqcot017 comparetotal 1 -1 -> 1 +dqcot018 comparetotal 1 0 -> 1 +dqcot019 comparetotal 1 1 -> 0 +dqcot020 comparetotal 1 2 -> -1 +dqcot021 comparetotal 2 -2 -> 1 +dqcot022 comparetotal 2 -1 -> 1 +dqcot023 comparetotal 2 0 -> 1 +dqcot025 comparetotal 2 1 -> 1 +dqcot026 comparetotal 2 2 -> 0 + +dqcot031 comparetotal -20 -20 -> 0 +dqcot032 comparetotal -20 -10 -> -1 +dqcot033 comparetotal -20 00 -> -1 +dqcot034 comparetotal -20 10 -> -1 +dqcot035 comparetotal -20 20 -> -1 +dqcot036 comparetotal -10 -20 -> 1 +dqcot037 comparetotal -10 -10 -> 0 +dqcot038 comparetotal -10 00 -> -1 +dqcot039 comparetotal -10 10 -> -1 +dqcot040 comparetotal -10 20 -> -1 +dqcot041 comparetotal 00 -20 -> 1 +dqcot042 comparetotal 00 -10 -> 1 +dqcot043 comparetotal 00 00 -> 0 +dqcot044 comparetotal 00 10 -> -1 +dqcot045 comparetotal 00 20 -> -1 +dqcot046 comparetotal 10 -20 -> 1 +dqcot047 comparetotal 10 -10 -> 1 +dqcot048 comparetotal 10 00 -> 1 +dqcot049 comparetotal 10 10 -> 0 +dqcot050 comparetotal 10 20 -> -1 +dqcot051 comparetotal 20 -20 -> 1 +dqcot052 comparetotal 20 -10 -> 1 +dqcot053 comparetotal 20 00 -> 1 +dqcot055 comparetotal 20 10 -> 1 +dqcot056 comparetotal 20 20 -> 0 + +dqcot061 comparetotal -2.0 -2.0 -> 0 +dqcot062 comparetotal -2.0 -1.0 -> -1 +dqcot063 comparetotal -2.0 0.0 -> -1 +dqcot064 comparetotal -2.0 1.0 -> -1 +dqcot065 comparetotal -2.0 2.0 -> -1 +dqcot066 comparetotal -1.0 -2.0 -> 1 +dqcot067 comparetotal -1.0 -1.0 -> 0 +dqcot068 comparetotal -1.0 0.0 -> -1 +dqcot069 comparetotal -1.0 1.0 -> -1 +dqcot070 comparetotal -1.0 2.0 -> -1 +dqcot071 comparetotal 0.0 -2.0 -> 1 +dqcot072 comparetotal 0.0 -1.0 -> 1 +dqcot073 comparetotal 0.0 0.0 -> 0 +dqcot074 comparetotal 0.0 1.0 -> -1 +dqcot075 comparetotal 0.0 2.0 -> -1 +dqcot076 comparetotal 1.0 -2.0 -> 1 +dqcot077 comparetotal 1.0 -1.0 -> 1 +dqcot078 comparetotal 1.0 0.0 -> 1 +dqcot079 comparetotal 1.0 1.0 -> 0 +dqcot080 comparetotal 1.0 2.0 -> -1 +dqcot081 comparetotal 2.0 -2.0 -> 1 +dqcot082 comparetotal 2.0 -1.0 -> 1 +dqcot083 comparetotal 2.0 0.0 -> 1 +dqcot085 comparetotal 2.0 1.0 -> 1 +dqcot086 comparetotal 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +dqcot090 comparetotal 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0 +dqcot091 comparetotal -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> -1 +dqcot092 comparetotal 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 1 +dqcot093 comparetotal -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +dqcot100 comparetotal 7.0 7.0 -> 0 +dqcot101 comparetotal 7.0 7 -> -1 +dqcot102 comparetotal 7 7.0 -> 1 +dqcot103 comparetotal 7E+0 7.0 -> 1 +dqcot104 comparetotal 70E-1 7.0 -> 0 +dqcot105 comparetotal 0.7E+1 7 -> 0 +dqcot106 comparetotal 70E-1 7 -> -1 +dqcot107 comparetotal 7.0 7E+0 -> -1 +dqcot108 comparetotal 7.0 70E-1 -> 0 +dqcot109 comparetotal 7 0.7E+1 -> 0 +dqcot110 comparetotal 7 70E-1 -> 1 + +dqcot120 comparetotal 8.0 7.0 -> 1 +dqcot121 comparetotal 8.0 7 -> 1 +dqcot122 comparetotal 8 7.0 -> 1 +dqcot123 comparetotal 8E+0 7.0 -> 1 +dqcot124 comparetotal 80E-1 7.0 -> 1 +dqcot125 comparetotal 0.8E+1 7 -> 1 +dqcot126 comparetotal 80E-1 7 -> 1 +dqcot127 comparetotal 8.0 7E+0 -> 1 +dqcot128 comparetotal 8.0 70E-1 -> 1 +dqcot129 comparetotal 8 0.7E+1 -> 1 +dqcot130 comparetotal 8 70E-1 -> 1 + +dqcot140 comparetotal 8.0 9.0 -> -1 +dqcot141 comparetotal 8.0 9 -> -1 +dqcot142 comparetotal 8 9.0 -> -1 +dqcot143 comparetotal 8E+0 9.0 -> -1 +dqcot144 comparetotal 80E-1 9.0 -> -1 +dqcot145 comparetotal 0.8E+1 9 -> -1 +dqcot146 comparetotal 80E-1 9 -> -1 +dqcot147 comparetotal 8.0 9E+0 -> -1 +dqcot148 comparetotal 8.0 90E-1 -> -1 +dqcot149 comparetotal 8 0.9E+1 -> -1 +dqcot150 comparetotal 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +dqcot200 comparetotal -7.0 7.0 -> -1 +dqcot201 comparetotal -7.0 7 -> -1 +dqcot202 comparetotal -7 7.0 -> -1 +dqcot203 comparetotal -7E+0 7.0 -> -1 +dqcot204 comparetotal -70E-1 7.0 -> -1 +dqcot205 comparetotal -0.7E+1 7 -> -1 +dqcot206 comparetotal -70E-1 7 -> -1 +dqcot207 comparetotal -7.0 7E+0 -> -1 +dqcot208 comparetotal -7.0 70E-1 -> -1 +dqcot209 comparetotal -7 0.7E+1 -> -1 +dqcot210 comparetotal -7 70E-1 -> -1 + +dqcot220 comparetotal -8.0 7.0 -> -1 +dqcot221 comparetotal -8.0 7 -> -1 +dqcot222 comparetotal -8 7.0 -> -1 +dqcot223 comparetotal -8E+0 7.0 -> -1 +dqcot224 comparetotal -80E-1 7.0 -> -1 +dqcot225 comparetotal -0.8E+1 7 -> -1 +dqcot226 comparetotal -80E-1 7 -> -1 +dqcot227 comparetotal -8.0 7E+0 -> -1 +dqcot228 comparetotal -8.0 70E-1 -> -1 +dqcot229 comparetotal -8 0.7E+1 -> -1 +dqcot230 comparetotal -8 70E-1 -> -1 + +dqcot240 comparetotal -8.0 9.0 -> -1 +dqcot241 comparetotal -8.0 9 -> -1 +dqcot242 comparetotal -8 9.0 -> -1 +dqcot243 comparetotal -8E+0 9.0 -> -1 +dqcot244 comparetotal -80E-1 9.0 -> -1 +dqcot245 comparetotal -0.8E+1 9 -> -1 +dqcot246 comparetotal -80E-1 9 -> -1 +dqcot247 comparetotal -8.0 9E+0 -> -1 +dqcot248 comparetotal -8.0 90E-1 -> -1 +dqcot249 comparetotal -8 0.9E+1 -> -1 +dqcot250 comparetotal -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +dqcot300 comparetotal 7.0 -7.0 -> 1 +dqcot301 comparetotal 7.0 -7 -> 1 +dqcot302 comparetotal 7 -7.0 -> 1 +dqcot303 comparetotal 7E+0 -7.0 -> 1 +dqcot304 comparetotal 70E-1 -7.0 -> 1 +dqcot305 comparetotal .7E+1 -7 -> 1 +dqcot306 comparetotal 70E-1 -7 -> 1 +dqcot307 comparetotal 7.0 -7E+0 -> 1 +dqcot308 comparetotal 7.0 -70E-1 -> 1 +dqcot309 comparetotal 7 -.7E+1 -> 1 +dqcot310 comparetotal 7 -70E-1 -> 1 + +dqcot320 comparetotal 8.0 -7.0 -> 1 +dqcot321 comparetotal 8.0 -7 -> 1 +dqcot322 comparetotal 8 -7.0 -> 1 +dqcot323 comparetotal 8E+0 -7.0 -> 1 +dqcot324 comparetotal 80E-1 -7.0 -> 1 +dqcot325 comparetotal .8E+1 -7 -> 1 +dqcot326 comparetotal 80E-1 -7 -> 1 +dqcot327 comparetotal 8.0 -7E+0 -> 1 +dqcot328 comparetotal 8.0 -70E-1 -> 1 +dqcot329 comparetotal 8 -.7E+1 -> 1 +dqcot330 comparetotal 8 -70E-1 -> 1 + +dqcot340 comparetotal 8.0 -9.0 -> 1 +dqcot341 comparetotal 8.0 -9 -> 1 +dqcot342 comparetotal 8 -9.0 -> 1 +dqcot343 comparetotal 8E+0 -9.0 -> 1 +dqcot344 comparetotal 80E-1 -9.0 -> 1 +dqcot345 comparetotal .8E+1 -9 -> 1 +dqcot346 comparetotal 80E-1 -9 -> 1 +dqcot347 comparetotal 8.0 -9E+0 -> 1 +dqcot348 comparetotal 8.0 -90E-1 -> 1 +dqcot349 comparetotal 8 -.9E+1 -> 1 +dqcot350 comparetotal 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +dqcot400 comparetotal -7.0 -7.0 -> 0 +dqcot401 comparetotal -7.0 -7 -> 1 +dqcot402 comparetotal -7 -7.0 -> -1 +dqcot403 comparetotal -7E+0 -7.0 -> -1 +dqcot404 comparetotal -70E-1 -7.0 -> 0 +dqcot405 comparetotal -.7E+1 -7 -> 0 +dqcot406 comparetotal -70E-1 -7 -> 1 +dqcot407 comparetotal -7.0 -7E+0 -> 1 +dqcot408 comparetotal -7.0 -70E-1 -> 0 +dqcot409 comparetotal -7 -.7E+1 -> 0 +dqcot410 comparetotal -7 -70E-1 -> -1 + +dqcot420 comparetotal -8.0 -7.0 -> -1 +dqcot421 comparetotal -8.0 -7 -> -1 +dqcot422 comparetotal -8 -7.0 -> -1 +dqcot423 comparetotal -8E+0 -7.0 -> -1 +dqcot424 comparetotal -80E-1 -7.0 -> -1 +dqcot425 comparetotal -.8E+1 -7 -> -1 +dqcot426 comparetotal -80E-1 -7 -> -1 +dqcot427 comparetotal -8.0 -7E+0 -> -1 +dqcot428 comparetotal -8.0 -70E-1 -> -1 +dqcot429 comparetotal -8 -.7E+1 -> -1 +dqcot430 comparetotal -8 -70E-1 -> -1 + +dqcot440 comparetotal -8.0 -9.0 -> 1 +dqcot441 comparetotal -8.0 -9 -> 1 +dqcot442 comparetotal -8 -9.0 -> 1 +dqcot443 comparetotal -8E+0 -9.0 -> 1 +dqcot444 comparetotal -80E-1 -9.0 -> 1 +dqcot445 comparetotal -.8E+1 -9 -> 1 +dqcot446 comparetotal -80E-1 -9 -> 1 +dqcot447 comparetotal -8.0 -9E+0 -> 1 +dqcot448 comparetotal -8.0 -90E-1 -> 1 +dqcot449 comparetotal -8 -.9E+1 -> 1 +dqcot450 comparetotal -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +dqcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1 +dqcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1 +dqcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1 +dqcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1 +dqcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1 +dqcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1 +dqcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1 +dqcot480 comparetotal 123.456000E+89 123.456E+89 -> -1 +dqcot481 comparetotal 123.45600E-89 123.456E-89 -> -1 +dqcot482 comparetotal 123.4560E+89 123.456E+89 -> -1 +dqcot483 comparetotal 123.456E-89 123.456E-89 -> 0 +dqcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1 +dqcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1 +dqcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1 +dqcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1 +dqcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1 +dqcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1 +dqcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1 +dqcot494 comparetotal 123.456E-89 123.456000E-89 -> 1 +dqcot495 comparetotal 123.456E+89 123.45600E+89 -> 1 +dqcot496 comparetotal 123.456E-89 123.4560E-89 -> 1 +dqcot497 comparetotal 123.456E+89 123.456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +dqcot498 comparetotal 1 1E-17 -> 1 +dqcot499 comparetotal 1 1E-16 -> 1 +dqcot500 comparetotal 1 1E-15 -> 1 +dqcot501 comparetotal 1 1E-14 -> 1 +dqcot502 comparetotal 1 1E-13 -> 1 +dqcot503 comparetotal 1 1E-12 -> 1 +dqcot504 comparetotal 1 1E-11 -> 1 +dqcot505 comparetotal 1 1E-10 -> 1 +dqcot506 comparetotal 1 1E-9 -> 1 +dqcot507 comparetotal 1 1E-8 -> 1 +dqcot508 comparetotal 1 1E-7 -> 1 +dqcot509 comparetotal 1 1E-6 -> 1 +dqcot510 comparetotal 1 1E-5 -> 1 +dqcot511 comparetotal 1 1E-4 -> 1 +dqcot512 comparetotal 1 1E-3 -> 1 +dqcot513 comparetotal 1 1E-2 -> 1 +dqcot514 comparetotal 1 1E-1 -> 1 +dqcot515 comparetotal 1 1E-0 -> 0 +dqcot516 comparetotal 1 1E+1 -> -1 +dqcot517 comparetotal 1 1E+2 -> -1 +dqcot518 comparetotal 1 1E+3 -> -1 +dqcot519 comparetotal 1 1E+4 -> -1 +dqcot521 comparetotal 1 1E+5 -> -1 +dqcot522 comparetotal 1 1E+6 -> -1 +dqcot523 comparetotal 1 1E+7 -> -1 +dqcot524 comparetotal 1 1E+8 -> -1 +dqcot525 comparetotal 1 1E+9 -> -1 +dqcot526 comparetotal 1 1E+10 -> -1 +dqcot527 comparetotal 1 1E+11 -> -1 +dqcot528 comparetotal 1 1E+12 -> -1 +dqcot529 comparetotal 1 1E+13 -> -1 +dqcot530 comparetotal 1 1E+14 -> -1 +dqcot531 comparetotal 1 1E+15 -> -1 +dqcot532 comparetotal 1 1E+16 -> -1 +dqcot533 comparetotal 1 1E+17 -> -1 +-- LR swap +dqcot538 comparetotal 1E-17 1 -> -1 +dqcot539 comparetotal 1E-16 1 -> -1 +dqcot540 comparetotal 1E-15 1 -> -1 +dqcot541 comparetotal 1E-14 1 -> -1 +dqcot542 comparetotal 1E-13 1 -> -1 +dqcot543 comparetotal 1E-12 1 -> -1 +dqcot544 comparetotal 1E-11 1 -> -1 +dqcot545 comparetotal 1E-10 1 -> -1 +dqcot546 comparetotal 1E-9 1 -> -1 +dqcot547 comparetotal 1E-8 1 -> -1 +dqcot548 comparetotal 1E-7 1 -> -1 +dqcot549 comparetotal 1E-6 1 -> -1 +dqcot550 comparetotal 1E-5 1 -> -1 +dqcot551 comparetotal 1E-4 1 -> -1 +dqcot552 comparetotal 1E-3 1 -> -1 +dqcot553 comparetotal 1E-2 1 -> -1 +dqcot554 comparetotal 1E-1 1 -> -1 +dqcot555 comparetotal 1E-0 1 -> 0 +dqcot556 comparetotal 1E+1 1 -> 1 +dqcot557 comparetotal 1E+2 1 -> 1 +dqcot558 comparetotal 1E+3 1 -> 1 +dqcot559 comparetotal 1E+4 1 -> 1 +dqcot561 comparetotal 1E+5 1 -> 1 +dqcot562 comparetotal 1E+6 1 -> 1 +dqcot563 comparetotal 1E+7 1 -> 1 +dqcot564 comparetotal 1E+8 1 -> 1 +dqcot565 comparetotal 1E+9 1 -> 1 +dqcot566 comparetotal 1E+10 1 -> 1 +dqcot567 comparetotal 1E+11 1 -> 1 +dqcot568 comparetotal 1E+12 1 -> 1 +dqcot569 comparetotal 1E+13 1 -> 1 +dqcot570 comparetotal 1E+14 1 -> 1 +dqcot571 comparetotal 1E+15 1 -> 1 +dqcot572 comparetotal 1E+16 1 -> 1 +dqcot573 comparetotal 1E+17 1 -> 1 +-- similar with a useful coefficient, one side only +dqcot578 comparetotal 0.000000987654321 1E-17 -> 1 +dqcot579 comparetotal 0.000000987654321 1E-16 -> 1 +dqcot580 comparetotal 0.000000987654321 1E-15 -> 1 +dqcot581 comparetotal 0.000000987654321 1E-14 -> 1 +dqcot582 comparetotal 0.000000987654321 1E-13 -> 1 +dqcot583 comparetotal 0.000000987654321 1E-12 -> 1 +dqcot584 comparetotal 0.000000987654321 1E-11 -> 1 +dqcot585 comparetotal 0.000000987654321 1E-10 -> 1 +dqcot586 comparetotal 0.000000987654321 1E-9 -> 1 +dqcot587 comparetotal 0.000000987654321 1E-8 -> 1 +dqcot588 comparetotal 0.000000987654321 1E-7 -> 1 +dqcot589 comparetotal 0.000000987654321 1E-6 -> -1 +dqcot590 comparetotal 0.000000987654321 1E-5 -> -1 +dqcot591 comparetotal 0.000000987654321 1E-4 -> -1 +dqcot592 comparetotal 0.000000987654321 1E-3 -> -1 +dqcot593 comparetotal 0.000000987654321 1E-2 -> -1 +dqcot594 comparetotal 0.000000987654321 1E-1 -> -1 +dqcot595 comparetotal 0.000000987654321 1E-0 -> -1 +dqcot596 comparetotal 0.000000987654321 1E+1 -> -1 +dqcot597 comparetotal 0.000000987654321 1E+2 -> -1 +dqcot598 comparetotal 0.000000987654321 1E+3 -> -1 +dqcot599 comparetotal 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +dqcot600 comparetotal 12 12.2345 -> -1 +dqcot601 comparetotal 12.0 12.2345 -> -1 +dqcot602 comparetotal 12.00 12.2345 -> -1 +dqcot603 comparetotal 12.000 12.2345 -> -1 +dqcot604 comparetotal 12.0000 12.2345 -> -1 +dqcot605 comparetotal 12.00000 12.2345 -> -1 +dqcot606 comparetotal 12.000000 12.2345 -> -1 +dqcot607 comparetotal 12.0000000 12.2345 -> -1 +dqcot608 comparetotal 12.00000000 12.2345 -> -1 +dqcot609 comparetotal 12.000000000 12.2345 -> -1 +dqcot610 comparetotal 12.1234 12 -> 1 +dqcot611 comparetotal 12.1234 12.0 -> 1 +dqcot612 comparetotal 12.1234 12.00 -> 1 +dqcot613 comparetotal 12.1234 12.000 -> 1 +dqcot614 comparetotal 12.1234 12.0000 -> 1 +dqcot615 comparetotal 12.1234 12.00000 -> 1 +dqcot616 comparetotal 12.1234 12.000000 -> 1 +dqcot617 comparetotal 12.1234 12.0000000 -> 1 +dqcot618 comparetotal 12.1234 12.00000000 -> 1 +dqcot619 comparetotal 12.1234 12.000000000 -> 1 +dqcot620 comparetotal -12 -12.2345 -> 1 +dqcot621 comparetotal -12.0 -12.2345 -> 1 +dqcot622 comparetotal -12.00 -12.2345 -> 1 +dqcot623 comparetotal -12.000 -12.2345 -> 1 +dqcot624 comparetotal -12.0000 -12.2345 -> 1 +dqcot625 comparetotal -12.00000 -12.2345 -> 1 +dqcot626 comparetotal -12.000000 -12.2345 -> 1 +dqcot627 comparetotal -12.0000000 -12.2345 -> 1 +dqcot628 comparetotal -12.00000000 -12.2345 -> 1 +dqcot629 comparetotal -12.000000000 -12.2345 -> 1 +dqcot630 comparetotal -12.1234 -12 -> -1 +dqcot631 comparetotal -12.1234 -12.0 -> -1 +dqcot632 comparetotal -12.1234 -12.00 -> -1 +dqcot633 comparetotal -12.1234 -12.000 -> -1 +dqcot634 comparetotal -12.1234 -12.0000 -> -1 +dqcot635 comparetotal -12.1234 -12.00000 -> -1 +dqcot636 comparetotal -12.1234 -12.000000 -> -1 +dqcot637 comparetotal -12.1234 -12.0000000 -> -1 +dqcot638 comparetotal -12.1234 -12.00000000 -> -1 +dqcot639 comparetotal -12.1234 -12.000000000 -> -1 + +-- extended zeros +dqcot640 comparetotal 0 0 -> 0 +dqcot641 comparetotal 0 -0 -> 1 +dqcot642 comparetotal 0 -0.0 -> 1 +dqcot643 comparetotal 0 0.0 -> 1 +dqcot644 comparetotal -0 0 -> -1 +dqcot645 comparetotal -0 -0 -> 0 +dqcot646 comparetotal -0 -0.0 -> -1 +dqcot647 comparetotal -0 0.0 -> -1 +dqcot648 comparetotal 0.0 0 -> -1 +dqcot649 comparetotal 0.0 -0 -> 1 +dqcot650 comparetotal 0.0 -0.0 -> 1 +dqcot651 comparetotal 0.0 0.0 -> 0 +dqcot652 comparetotal -0.0 0 -> -1 +dqcot653 comparetotal -0.0 -0 -> 1 +dqcot654 comparetotal -0.0 -0.0 -> 0 +dqcot655 comparetotal -0.0 0.0 -> -1 + +dqcot656 comparetotal -0E1 0.0 -> -1 +dqcot657 comparetotal -0E2 0.0 -> -1 +dqcot658 comparetotal 0E1 0.0 -> 1 +dqcot659 comparetotal 0E2 0.0 -> 1 +dqcot660 comparetotal -0E1 0 -> -1 +dqcot661 comparetotal -0E2 0 -> -1 +dqcot662 comparetotal 0E1 0 -> 1 +dqcot663 comparetotal 0E2 0 -> 1 +dqcot664 comparetotal -0E1 -0E1 -> 0 +dqcot665 comparetotal -0E2 -0E1 -> -1 +dqcot666 comparetotal 0E1 -0E1 -> 1 +dqcot667 comparetotal 0E2 -0E1 -> 1 +dqcot668 comparetotal -0E1 -0E2 -> 1 +dqcot669 comparetotal -0E2 -0E2 -> 0 +dqcot670 comparetotal 0E1 -0E2 -> 1 +dqcot671 comparetotal 0E2 -0E2 -> 1 +dqcot672 comparetotal -0E1 0E1 -> -1 +dqcot673 comparetotal -0E2 0E1 -> -1 +dqcot674 comparetotal 0E1 0E1 -> 0 +dqcot675 comparetotal 0E2 0E1 -> 1 +dqcot676 comparetotal -0E1 0E2 -> -1 +dqcot677 comparetotal -0E2 0E2 -> -1 +dqcot678 comparetotal 0E1 0E2 -> -1 +dqcot679 comparetotal 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +dqcot680 comparetotal 12 12 -> 0 +dqcot681 comparetotal 12 12.0 -> 1 +dqcot682 comparetotal 12 12.00 -> 1 +dqcot683 comparetotal 12 12.000 -> 1 +dqcot684 comparetotal 12 12.0000 -> 1 +dqcot685 comparetotal 12 12.00000 -> 1 +dqcot686 comparetotal 12 12.000000 -> 1 +dqcot687 comparetotal 12 12.0000000 -> 1 +dqcot688 comparetotal 12 12.00000000 -> 1 +dqcot689 comparetotal 12 12.000000000 -> 1 +dqcot690 comparetotal 12 12 -> 0 +dqcot691 comparetotal 12.0 12 -> -1 +dqcot692 comparetotal 12.00 12 -> -1 +dqcot693 comparetotal 12.000 12 -> -1 +dqcot694 comparetotal 12.0000 12 -> -1 +dqcot695 comparetotal 12.00000 12 -> -1 +dqcot696 comparetotal 12.000000 12 -> -1 +dqcot697 comparetotal 12.0000000 12 -> -1 +dqcot698 comparetotal 12.00000000 12 -> -1 +dqcot699 comparetotal 12.000000000 12 -> -1 + +-- old long operand checks +dqcot701 comparetotal 12345678000 1 -> 1 +dqcot702 comparetotal 1 12345678000 -> -1 +dqcot703 comparetotal 1234567800 1 -> 1 +dqcot704 comparetotal 1 1234567800 -> -1 +dqcot705 comparetotal 1234567890 1 -> 1 +dqcot706 comparetotal 1 1234567890 -> -1 +dqcot707 comparetotal 1234567891 1 -> 1 +dqcot708 comparetotal 1 1234567891 -> -1 +dqcot709 comparetotal 12345678901 1 -> 1 +dqcot710 comparetotal 1 12345678901 -> -1 +dqcot711 comparetotal 1234567896 1 -> 1 +dqcot712 comparetotal 1 1234567896 -> -1 +dqcot713 comparetotal -1234567891 1 -> -1 +dqcot714 comparetotal 1 -1234567891 -> 1 +dqcot715 comparetotal -12345678901 1 -> -1 +dqcot716 comparetotal 1 -12345678901 -> 1 +dqcot717 comparetotal -1234567896 1 -> -1 +dqcot718 comparetotal 1 -1234567896 -> 1 + +-- old residue cases +dqcot740 comparetotal 1 0.9999999 -> 1 +dqcot741 comparetotal 1 0.999999 -> 1 +dqcot742 comparetotal 1 0.99999 -> 1 +dqcot743 comparetotal 1 1.0000 -> 1 +dqcot744 comparetotal 1 1.00001 -> -1 +dqcot745 comparetotal 1 1.000001 -> -1 +dqcot746 comparetotal 1 1.0000001 -> -1 +dqcot750 comparetotal 0.9999999 1 -> -1 +dqcot751 comparetotal 0.999999 1 -> -1 +dqcot752 comparetotal 0.99999 1 -> -1 +dqcot753 comparetotal 1.0000 1 -> -1 +dqcot754 comparetotal 1.00001 1 -> 1 +dqcot755 comparetotal 1.000001 1 -> 1 +dqcot756 comparetotal 1.0000001 1 -> 1 + +-- Specials +dqcot780 comparetotal Inf -Inf -> 1 +dqcot781 comparetotal Inf -1000 -> 1 +dqcot782 comparetotal Inf -1 -> 1 +dqcot783 comparetotal Inf -0 -> 1 +dqcot784 comparetotal Inf 0 -> 1 +dqcot785 comparetotal Inf 1 -> 1 +dqcot786 comparetotal Inf 1000 -> 1 +dqcot787 comparetotal Inf Inf -> 0 +dqcot788 comparetotal -1000 Inf -> -1 +dqcot789 comparetotal -Inf Inf -> -1 +dqcot790 comparetotal -1 Inf -> -1 +dqcot791 comparetotal -0 Inf -> -1 +dqcot792 comparetotal 0 Inf -> -1 +dqcot793 comparetotal 1 Inf -> -1 +dqcot794 comparetotal 1000 Inf -> -1 +dqcot795 comparetotal Inf Inf -> 0 + +dqcot800 comparetotal -Inf -Inf -> 0 +dqcot801 comparetotal -Inf -1000 -> -1 +dqcot802 comparetotal -Inf -1 -> -1 +dqcot803 comparetotal -Inf -0 -> -1 +dqcot804 comparetotal -Inf 0 -> -1 +dqcot805 comparetotal -Inf 1 -> -1 +dqcot806 comparetotal -Inf 1000 -> -1 +dqcot807 comparetotal -Inf Inf -> -1 +dqcot808 comparetotal -Inf -Inf -> 0 +dqcot809 comparetotal -1000 -Inf -> 1 +dqcot810 comparetotal -1 -Inf -> 1 +dqcot811 comparetotal -0 -Inf -> 1 +dqcot812 comparetotal 0 -Inf -> 1 +dqcot813 comparetotal 1 -Inf -> 1 +dqcot814 comparetotal 1000 -Inf -> 1 +dqcot815 comparetotal Inf -Inf -> 1 + +dqcot821 comparetotal NaN -Inf -> 1 +dqcot822 comparetotal NaN -1000 -> 1 +dqcot823 comparetotal NaN -1 -> 1 +dqcot824 comparetotal NaN -0 -> 1 +dqcot825 comparetotal NaN 0 -> 1 +dqcot826 comparetotal NaN 1 -> 1 +dqcot827 comparetotal NaN 1000 -> 1 +dqcot828 comparetotal NaN Inf -> 1 +dqcot829 comparetotal NaN NaN -> 0 +dqcot830 comparetotal -Inf NaN -> -1 +dqcot831 comparetotal -1000 NaN -> -1 +dqcot832 comparetotal -1 NaN -> -1 +dqcot833 comparetotal -0 NaN -> -1 +dqcot834 comparetotal 0 NaN -> -1 +dqcot835 comparetotal 1 NaN -> -1 +dqcot836 comparetotal 1000 NaN -> -1 +dqcot837 comparetotal Inf NaN -> -1 +dqcot838 comparetotal -NaN -NaN -> 0 +dqcot839 comparetotal +NaN -NaN -> 1 +dqcot840 comparetotal -NaN +NaN -> -1 + +dqcot841 comparetotal sNaN -sNaN -> 1 +dqcot842 comparetotal sNaN -NaN -> 1 +dqcot843 comparetotal sNaN -Inf -> 1 +dqcot844 comparetotal sNaN -1000 -> 1 +dqcot845 comparetotal sNaN -1 -> 1 +dqcot846 comparetotal sNaN -0 -> 1 +dqcot847 comparetotal sNaN 0 -> 1 +dqcot848 comparetotal sNaN 1 -> 1 +dqcot849 comparetotal sNaN 1000 -> 1 +dqcot850 comparetotal sNaN NaN -> -1 +dqcot851 comparetotal sNaN sNaN -> 0 + +dqcot852 comparetotal -sNaN sNaN -> -1 +dqcot853 comparetotal -NaN sNaN -> -1 +dqcot854 comparetotal -Inf sNaN -> -1 +dqcot855 comparetotal -1000 sNaN -> -1 +dqcot856 comparetotal -1 sNaN -> -1 +dqcot857 comparetotal -0 sNaN -> -1 +dqcot858 comparetotal 0 sNaN -> -1 +dqcot859 comparetotal 1 sNaN -> -1 +dqcot860 comparetotal 1000 sNaN -> -1 +dqcot861 comparetotal Inf sNaN -> -1 +dqcot862 comparetotal NaN sNaN -> 1 +dqcot863 comparetotal sNaN sNaN -> 0 + +dqcot871 comparetotal -sNaN -sNaN -> 0 +dqcot872 comparetotal -sNaN -NaN -> 1 +dqcot873 comparetotal -sNaN -Inf -> -1 +dqcot874 comparetotal -sNaN -1000 -> -1 +dqcot875 comparetotal -sNaN -1 -> -1 +dqcot876 comparetotal -sNaN -0 -> -1 +dqcot877 comparetotal -sNaN 0 -> -1 +dqcot878 comparetotal -sNaN 1 -> -1 +dqcot879 comparetotal -sNaN 1000 -> -1 +dqcot880 comparetotal -sNaN NaN -> -1 +dqcot881 comparetotal -sNaN sNaN -> -1 + +dqcot882 comparetotal -sNaN -sNaN -> 0 +dqcot883 comparetotal -NaN -sNaN -> -1 +dqcot884 comparetotal -Inf -sNaN -> 1 +dqcot885 comparetotal -1000 -sNaN -> 1 +dqcot886 comparetotal -1 -sNaN -> 1 +dqcot887 comparetotal -0 -sNaN -> 1 +dqcot888 comparetotal 0 -sNaN -> 1 +dqcot889 comparetotal 1 -sNaN -> 1 +dqcot890 comparetotal 1000 -sNaN -> 1 +dqcot891 comparetotal Inf -sNaN -> 1 +dqcot892 comparetotal NaN -sNaN -> 1 +dqcot893 comparetotal sNaN -sNaN -> 1 + +-- NaNs with payload +dqcot960 comparetotal NaN9 -Inf -> 1 +dqcot961 comparetotal NaN8 999 -> 1 +dqcot962 comparetotal NaN77 Inf -> 1 +dqcot963 comparetotal -NaN67 NaN5 -> -1 +dqcot964 comparetotal -Inf -NaN4 -> 1 +dqcot965 comparetotal -999 -NaN33 -> 1 +dqcot966 comparetotal Inf NaN2 -> -1 + +dqcot970 comparetotal -NaN41 -NaN42 -> 1 +dqcot971 comparetotal +NaN41 -NaN42 -> 1 +dqcot972 comparetotal -NaN41 +NaN42 -> -1 +dqcot973 comparetotal +NaN41 +NaN42 -> -1 +dqcot974 comparetotal -NaN42 -NaN01 -> -1 +dqcot975 comparetotal +NaN42 -NaN01 -> 1 +dqcot976 comparetotal -NaN42 +NaN01 -> -1 +dqcot977 comparetotal +NaN42 +NaN01 -> 1 + +dqcot980 comparetotal -sNaN771 -sNaN772 -> 1 +dqcot981 comparetotal +sNaN771 -sNaN772 -> 1 +dqcot982 comparetotal -sNaN771 +sNaN772 -> -1 +dqcot983 comparetotal +sNaN771 +sNaN772 -> -1 +dqcot984 comparetotal -sNaN772 -sNaN771 -> -1 +dqcot985 comparetotal +sNaN772 -sNaN771 -> 1 +dqcot986 comparetotal -sNaN772 +sNaN771 -> -1 +dqcot987 comparetotal +sNaN772 +sNaN771 -> 1 + +dqcot991 comparetotal -sNaN99 -Inf -> -1 +dqcot992 comparetotal sNaN98 -11 -> 1 +dqcot993 comparetotal sNaN97 NaN -> -1 +dqcot994 comparetotal sNaN16 sNaN94 -> -1 +dqcot995 comparetotal NaN85 sNaN83 -> 1 +dqcot996 comparetotal -Inf sNaN92 -> -1 +dqcot997 comparetotal 088 sNaN81 -> -1 +dqcot998 comparetotal Inf sNaN90 -> -1 +dqcot999 comparetotal NaN -sNaN89 -> 1 + +-- spread zeros +dqcot1110 comparetotal 0E-6143 0 -> -1 +dqcot1111 comparetotal 0E-6143 -0 -> 1 +dqcot1112 comparetotal -0E-6143 0 -> -1 +dqcot1113 comparetotal -0E-6143 -0 -> 1 +dqcot1114 comparetotal 0E-6143 0E+6144 -> -1 +dqcot1115 comparetotal 0E-6143 -0E+6144 -> 1 +dqcot1116 comparetotal -0E-6143 0E+6144 -> -1 +dqcot1117 comparetotal -0E-6143 -0E+6144 -> 1 +dqcot1118 comparetotal 0 0E+6144 -> -1 +dqcot1119 comparetotal 0 -0E+6144 -> 1 +dqcot1120 comparetotal -0 0E+6144 -> -1 +dqcot1121 comparetotal -0 -0E+6144 -> 1 + +dqcot1130 comparetotal 0E+6144 0 -> 1 +dqcot1131 comparetotal 0E+6144 -0 -> 1 +dqcot1132 comparetotal -0E+6144 0 -> -1 +dqcot1133 comparetotal -0E+6144 -0 -> -1 +dqcot1134 comparetotal 0E+6144 0E-6143 -> 1 +dqcot1135 comparetotal 0E+6144 -0E-6143 -> 1 +dqcot1136 comparetotal -0E+6144 0E-6143 -> -1 +dqcot1137 comparetotal -0E+6144 -0E-6143 -> -1 +dqcot1138 comparetotal 0 0E-6143 -> 1 +dqcot1139 comparetotal 0 -0E-6143 -> 1 +dqcot1140 comparetotal -0 0E-6143 -> -1 +dqcot1141 comparetotal -0 -0E-6143 -> -1 + +-- Null tests +dqcot9990 comparetotal 10 # -> NaN Invalid_operation +dqcot9991 comparetotal # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareTotalMag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCompareTotalMag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,706 @@ +------------------------------------------------------------------------ +-- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). +-- Similarly, comparetotal will have some radically different paths +-- than compare. + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqctm001 comparetotmag -2 -2 -> 0 +dqctm002 comparetotmag -2 -1 -> 1 +dqctm003 comparetotmag -2 0 -> 1 +dqctm004 comparetotmag -2 1 -> 1 +dqctm005 comparetotmag -2 2 -> 0 +dqctm006 comparetotmag -1 -2 -> -1 +dqctm007 comparetotmag -1 -1 -> 0 +dqctm008 comparetotmag -1 0 -> 1 +dqctm009 comparetotmag -1 1 -> 0 +dqctm010 comparetotmag -1 2 -> -1 +dqctm011 comparetotmag 0 -2 -> -1 +dqctm012 comparetotmag 0 -1 -> -1 +dqctm013 comparetotmag 0 0 -> 0 +dqctm014 comparetotmag 0 1 -> -1 +dqctm015 comparetotmag 0 2 -> -1 +dqctm016 comparetotmag 1 -2 -> -1 +dqctm017 comparetotmag 1 -1 -> 0 +dqctm018 comparetotmag 1 0 -> 1 +dqctm019 comparetotmag 1 1 -> 0 +dqctm020 comparetotmag 1 2 -> -1 +dqctm021 comparetotmag 2 -2 -> 0 +dqctm022 comparetotmag 2 -1 -> 1 +dqctm023 comparetotmag 2 0 -> 1 +dqctm025 comparetotmag 2 1 -> 1 +dqctm026 comparetotmag 2 2 -> 0 + +dqctm031 comparetotmag -20 -20 -> 0 +dqctm032 comparetotmag -20 -10 -> 1 +dqctm033 comparetotmag -20 00 -> 1 +dqctm034 comparetotmag -20 10 -> 1 +dqctm035 comparetotmag -20 20 -> 0 +dqctm036 comparetotmag -10 -20 -> -1 +dqctm037 comparetotmag -10 -10 -> 0 +dqctm038 comparetotmag -10 00 -> 1 +dqctm039 comparetotmag -10 10 -> 0 +dqctm040 comparetotmag -10 20 -> -1 +dqctm041 comparetotmag 00 -20 -> -1 +dqctm042 comparetotmag 00 -10 -> -1 +dqctm043 comparetotmag 00 00 -> 0 +dqctm044 comparetotmag 00 10 -> -1 +dqctm045 comparetotmag 00 20 -> -1 +dqctm046 comparetotmag 10 -20 -> -1 +dqctm047 comparetotmag 10 -10 -> 0 +dqctm048 comparetotmag 10 00 -> 1 +dqctm049 comparetotmag 10 10 -> 0 +dqctm050 comparetotmag 10 20 -> -1 +dqctm051 comparetotmag 20 -20 -> 0 +dqctm052 comparetotmag 20 -10 -> 1 +dqctm053 comparetotmag 20 00 -> 1 +dqctm055 comparetotmag 20 10 -> 1 +dqctm056 comparetotmag 20 20 -> 0 + +dqctm061 comparetotmag -2.0 -2.0 -> 0 +dqctm062 comparetotmag -2.0 -1.0 -> 1 +dqctm063 comparetotmag -2.0 0.0 -> 1 +dqctm064 comparetotmag -2.0 1.0 -> 1 +dqctm065 comparetotmag -2.0 2.0 -> 0 +dqctm066 comparetotmag -1.0 -2.0 -> -1 +dqctm067 comparetotmag -1.0 -1.0 -> 0 +dqctm068 comparetotmag -1.0 0.0 -> 1 +dqctm069 comparetotmag -1.0 1.0 -> 0 +dqctm070 comparetotmag -1.0 2.0 -> -1 +dqctm071 comparetotmag 0.0 -2.0 -> -1 +dqctm072 comparetotmag 0.0 -1.0 -> -1 +dqctm073 comparetotmag 0.0 0.0 -> 0 +dqctm074 comparetotmag 0.0 1.0 -> -1 +dqctm075 comparetotmag 0.0 2.0 -> -1 +dqctm076 comparetotmag 1.0 -2.0 -> -1 +dqctm077 comparetotmag 1.0 -1.0 -> 0 +dqctm078 comparetotmag 1.0 0.0 -> 1 +dqctm079 comparetotmag 1.0 1.0 -> 0 +dqctm080 comparetotmag 1.0 2.0 -> -1 +dqctm081 comparetotmag 2.0 -2.0 -> 0 +dqctm082 comparetotmag 2.0 -1.0 -> 1 +dqctm083 comparetotmag 2.0 0.0 -> 1 +dqctm085 comparetotmag 2.0 1.0 -> 1 +dqctm086 comparetotmag 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +dqctm090 comparetotmag 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0 +dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0 +dqctm092 comparetotmag 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0 +dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +dqctm100 comparetotmag 7.0 7.0 -> 0 +dqctm101 comparetotmag 7.0 7 -> -1 +dqctm102 comparetotmag 7 7.0 -> 1 +dqctm103 comparetotmag 7E+0 7.0 -> 1 +dqctm104 comparetotmag 70E-1 7.0 -> 0 +dqctm105 comparetotmag 0.7E+1 7 -> 0 +dqctm106 comparetotmag 70E-1 7 -> -1 +dqctm107 comparetotmag 7.0 7E+0 -> -1 +dqctm108 comparetotmag 7.0 70E-1 -> 0 +dqctm109 comparetotmag 7 0.7E+1 -> 0 +dqctm110 comparetotmag 7 70E-1 -> 1 + +dqctm120 comparetotmag 8.0 7.0 -> 1 +dqctm121 comparetotmag 8.0 7 -> 1 +dqctm122 comparetotmag 8 7.0 -> 1 +dqctm123 comparetotmag 8E+0 7.0 -> 1 +dqctm124 comparetotmag 80E-1 7.0 -> 1 +dqctm125 comparetotmag 0.8E+1 7 -> 1 +dqctm126 comparetotmag 80E-1 7 -> 1 +dqctm127 comparetotmag 8.0 7E+0 -> 1 +dqctm128 comparetotmag 8.0 70E-1 -> 1 +dqctm129 comparetotmag 8 0.7E+1 -> 1 +dqctm130 comparetotmag 8 70E-1 -> 1 + +dqctm140 comparetotmag 8.0 9.0 -> -1 +dqctm141 comparetotmag 8.0 9 -> -1 +dqctm142 comparetotmag 8 9.0 -> -1 +dqctm143 comparetotmag 8E+0 9.0 -> -1 +dqctm144 comparetotmag 80E-1 9.0 -> -1 +dqctm145 comparetotmag 0.8E+1 9 -> -1 +dqctm146 comparetotmag 80E-1 9 -> -1 +dqctm147 comparetotmag 8.0 9E+0 -> -1 +dqctm148 comparetotmag 8.0 90E-1 -> -1 +dqctm149 comparetotmag 8 0.9E+1 -> -1 +dqctm150 comparetotmag 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +dqctm200 comparetotmag -7.0 7.0 -> 0 +dqctm201 comparetotmag -7.0 7 -> -1 +dqctm202 comparetotmag -7 7.0 -> 1 +dqctm203 comparetotmag -7E+0 7.0 -> 1 +dqctm204 comparetotmag -70E-1 7.0 -> 0 +dqctm205 comparetotmag -0.7E+1 7 -> 0 +dqctm206 comparetotmag -70E-1 7 -> -1 +dqctm207 comparetotmag -7.0 7E+0 -> -1 +dqctm208 comparetotmag -7.0 70E-1 -> 0 +dqctm209 comparetotmag -7 0.7E+1 -> 0 +dqctm210 comparetotmag -7 70E-1 -> 1 + +dqctm220 comparetotmag -8.0 7.0 -> 1 +dqctm221 comparetotmag -8.0 7 -> 1 +dqctm222 comparetotmag -8 7.0 -> 1 +dqctm223 comparetotmag -8E+0 7.0 -> 1 +dqctm224 comparetotmag -80E-1 7.0 -> 1 +dqctm225 comparetotmag -0.8E+1 7 -> 1 +dqctm226 comparetotmag -80E-1 7 -> 1 +dqctm227 comparetotmag -8.0 7E+0 -> 1 +dqctm228 comparetotmag -8.0 70E-1 -> 1 +dqctm229 comparetotmag -8 0.7E+1 -> 1 +dqctm230 comparetotmag -8 70E-1 -> 1 + +dqctm240 comparetotmag -8.0 9.0 -> -1 +dqctm241 comparetotmag -8.0 9 -> -1 +dqctm242 comparetotmag -8 9.0 -> -1 +dqctm243 comparetotmag -8E+0 9.0 -> -1 +dqctm244 comparetotmag -80E-1 9.0 -> -1 +dqctm245 comparetotmag -0.8E+1 9 -> -1 +dqctm246 comparetotmag -80E-1 9 -> -1 +dqctm247 comparetotmag -8.0 9E+0 -> -1 +dqctm248 comparetotmag -8.0 90E-1 -> -1 +dqctm249 comparetotmag -8 0.9E+1 -> -1 +dqctm250 comparetotmag -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +dqctm300 comparetotmag 7.0 -7.0 -> 0 +dqctm301 comparetotmag 7.0 -7 -> -1 +dqctm302 comparetotmag 7 -7.0 -> 1 +dqctm303 comparetotmag 7E+0 -7.0 -> 1 +dqctm304 comparetotmag 70E-1 -7.0 -> 0 +dqctm305 comparetotmag .7E+1 -7 -> 0 +dqctm306 comparetotmag 70E-1 -7 -> -1 +dqctm307 comparetotmag 7.0 -7E+0 -> -1 +dqctm308 comparetotmag 7.0 -70E-1 -> 0 +dqctm309 comparetotmag 7 -.7E+1 -> 0 +dqctm310 comparetotmag 7 -70E-1 -> 1 + +dqctm320 comparetotmag 8.0 -7.0 -> 1 +dqctm321 comparetotmag 8.0 -7 -> 1 +dqctm322 comparetotmag 8 -7.0 -> 1 +dqctm323 comparetotmag 8E+0 -7.0 -> 1 +dqctm324 comparetotmag 80E-1 -7.0 -> 1 +dqctm325 comparetotmag .8E+1 -7 -> 1 +dqctm326 comparetotmag 80E-1 -7 -> 1 +dqctm327 comparetotmag 8.0 -7E+0 -> 1 +dqctm328 comparetotmag 8.0 -70E-1 -> 1 +dqctm329 comparetotmag 8 -.7E+1 -> 1 +dqctm330 comparetotmag 8 -70E-1 -> 1 + +dqctm340 comparetotmag 8.0 -9.0 -> -1 +dqctm341 comparetotmag 8.0 -9 -> -1 +dqctm342 comparetotmag 8 -9.0 -> -1 +dqctm343 comparetotmag 8E+0 -9.0 -> -1 +dqctm344 comparetotmag 80E-1 -9.0 -> -1 +dqctm345 comparetotmag .8E+1 -9 -> -1 +dqctm346 comparetotmag 80E-1 -9 -> -1 +dqctm347 comparetotmag 8.0 -9E+0 -> -1 +dqctm348 comparetotmag 8.0 -90E-1 -> -1 +dqctm349 comparetotmag 8 -.9E+1 -> -1 +dqctm350 comparetotmag 8 -90E-1 -> -1 + +-- and again, with sign changes -- .. +dqctm400 comparetotmag -7.0 -7.0 -> 0 +dqctm401 comparetotmag -7.0 -7 -> -1 +dqctm402 comparetotmag -7 -7.0 -> 1 +dqctm403 comparetotmag -7E+0 -7.0 -> 1 +dqctm404 comparetotmag -70E-1 -7.0 -> 0 +dqctm405 comparetotmag -.7E+1 -7 -> 0 +dqctm406 comparetotmag -70E-1 -7 -> -1 +dqctm407 comparetotmag -7.0 -7E+0 -> -1 +dqctm408 comparetotmag -7.0 -70E-1 -> 0 +dqctm409 comparetotmag -7 -.7E+1 -> 0 +dqctm410 comparetotmag -7 -70E-1 -> 1 + +dqctm420 comparetotmag -8.0 -7.0 -> 1 +dqctm421 comparetotmag -8.0 -7 -> 1 +dqctm422 comparetotmag -8 -7.0 -> 1 +dqctm423 comparetotmag -8E+0 -7.0 -> 1 +dqctm424 comparetotmag -80E-1 -7.0 -> 1 +dqctm425 comparetotmag -.8E+1 -7 -> 1 +dqctm426 comparetotmag -80E-1 -7 -> 1 +dqctm427 comparetotmag -8.0 -7E+0 -> 1 +dqctm428 comparetotmag -8.0 -70E-1 -> 1 +dqctm429 comparetotmag -8 -.7E+1 -> 1 +dqctm430 comparetotmag -8 -70E-1 -> 1 + +dqctm440 comparetotmag -8.0 -9.0 -> -1 +dqctm441 comparetotmag -8.0 -9 -> -1 +dqctm442 comparetotmag -8 -9.0 -> -1 +dqctm443 comparetotmag -8E+0 -9.0 -> -1 +dqctm444 comparetotmag -80E-1 -9.0 -> -1 +dqctm445 comparetotmag -.8E+1 -9 -> -1 +dqctm446 comparetotmag -80E-1 -9 -> -1 +dqctm447 comparetotmag -8.0 -9E+0 -> -1 +dqctm448 comparetotmag -8.0 -90E-1 -> -1 +dqctm449 comparetotmag -8 -.9E+1 -> -1 +dqctm450 comparetotmag -8 -90E-1 -> -1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1 +dqctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1 +dqctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1 +dqctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1 +dqctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1 +dqctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1 +dqctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1 +dqctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1 +dqctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1 +dqctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1 +dqctm483 comparetotmag 123.456E-89 123.456E-89 -> 0 +dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1 +dqctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1 +dqctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1 +dqctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1 +dqctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1 +dqctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1 +dqctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1 +dqctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1 +dqctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1 +dqctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1 +dqctm497 comparetotmag 123.456E+89 123.456E+89 -> 0 + +-- wide-ranging, around precision; signs equal +dqctm498 comparetotmag 1 1E-17 -> 1 +dqctm499 comparetotmag 1 1E-16 -> 1 +dqctm500 comparetotmag 1 1E-15 -> 1 +dqctm501 comparetotmag 1 1E-14 -> 1 +dqctm502 comparetotmag 1 1E-13 -> 1 +dqctm503 comparetotmag 1 1E-12 -> 1 +dqctm504 comparetotmag 1 1E-11 -> 1 +dqctm505 comparetotmag 1 1E-10 -> 1 +dqctm506 comparetotmag 1 1E-9 -> 1 +dqctm507 comparetotmag 1 1E-8 -> 1 +dqctm508 comparetotmag 1 1E-7 -> 1 +dqctm509 comparetotmag 1 1E-6 -> 1 +dqctm510 comparetotmag 1 1E-5 -> 1 +dqctm511 comparetotmag 1 1E-4 -> 1 +dqctm512 comparetotmag 1 1E-3 -> 1 +dqctm513 comparetotmag 1 1E-2 -> 1 +dqctm514 comparetotmag 1 1E-1 -> 1 +dqctm515 comparetotmag 1 1E-0 -> 0 +dqctm516 comparetotmag 1 1E+1 -> -1 +dqctm517 comparetotmag 1 1E+2 -> -1 +dqctm518 comparetotmag 1 1E+3 -> -1 +dqctm519 comparetotmag 1 1E+4 -> -1 +dqctm521 comparetotmag 1 1E+5 -> -1 +dqctm522 comparetotmag 1 1E+6 -> -1 +dqctm523 comparetotmag 1 1E+7 -> -1 +dqctm524 comparetotmag 1 1E+8 -> -1 +dqctm525 comparetotmag 1 1E+9 -> -1 +dqctm526 comparetotmag 1 1E+10 -> -1 +dqctm527 comparetotmag 1 1E+11 -> -1 +dqctm528 comparetotmag 1 1E+12 -> -1 +dqctm529 comparetotmag 1 1E+13 -> -1 +dqctm530 comparetotmag 1 1E+14 -> -1 +dqctm531 comparetotmag 1 1E+15 -> -1 +dqctm532 comparetotmag 1 1E+16 -> -1 +dqctm533 comparetotmag 1 1E+17 -> -1 +-- LR swap +dqctm538 comparetotmag 1E-17 1 -> -1 +dqctm539 comparetotmag 1E-16 1 -> -1 +dqctm540 comparetotmag 1E-15 1 -> -1 +dqctm541 comparetotmag 1E-14 1 -> -1 +dqctm542 comparetotmag 1E-13 1 -> -1 +dqctm543 comparetotmag 1E-12 1 -> -1 +dqctm544 comparetotmag 1E-11 1 -> -1 +dqctm545 comparetotmag 1E-10 1 -> -1 +dqctm546 comparetotmag 1E-9 1 -> -1 +dqctm547 comparetotmag 1E-8 1 -> -1 +dqctm548 comparetotmag 1E-7 1 -> -1 +dqctm549 comparetotmag 1E-6 1 -> -1 +dqctm550 comparetotmag 1E-5 1 -> -1 +dqctm551 comparetotmag 1E-4 1 -> -1 +dqctm552 comparetotmag 1E-3 1 -> -1 +dqctm553 comparetotmag 1E-2 1 -> -1 +dqctm554 comparetotmag 1E-1 1 -> -1 +dqctm555 comparetotmag 1E-0 1 -> 0 +dqctm556 comparetotmag 1E+1 1 -> 1 +dqctm557 comparetotmag 1E+2 1 -> 1 +dqctm558 comparetotmag 1E+3 1 -> 1 +dqctm559 comparetotmag 1E+4 1 -> 1 +dqctm561 comparetotmag 1E+5 1 -> 1 +dqctm562 comparetotmag 1E+6 1 -> 1 +dqctm563 comparetotmag 1E+7 1 -> 1 +dqctm564 comparetotmag 1E+8 1 -> 1 +dqctm565 comparetotmag 1E+9 1 -> 1 +dqctm566 comparetotmag 1E+10 1 -> 1 +dqctm567 comparetotmag 1E+11 1 -> 1 +dqctm568 comparetotmag 1E+12 1 -> 1 +dqctm569 comparetotmag 1E+13 1 -> 1 +dqctm570 comparetotmag 1E+14 1 -> 1 +dqctm571 comparetotmag 1E+15 1 -> 1 +dqctm572 comparetotmag 1E+16 1 -> 1 +dqctm573 comparetotmag 1E+17 1 -> 1 +-- similar with a useful coefficient, one side only +dqctm578 comparetotmag 0.000000987654321 1E-17 -> 1 +dqctm579 comparetotmag 0.000000987654321 1E-16 -> 1 +dqctm580 comparetotmag 0.000000987654321 1E-15 -> 1 +dqctm581 comparetotmag 0.000000987654321 1E-14 -> 1 +dqctm582 comparetotmag 0.000000987654321 1E-13 -> 1 +dqctm583 comparetotmag 0.000000987654321 1E-12 -> 1 +dqctm584 comparetotmag 0.000000987654321 1E-11 -> 1 +dqctm585 comparetotmag 0.000000987654321 1E-10 -> 1 +dqctm586 comparetotmag 0.000000987654321 1E-9 -> 1 +dqctm587 comparetotmag 0.000000987654321 1E-8 -> 1 +dqctm588 comparetotmag 0.000000987654321 1E-7 -> 1 +dqctm589 comparetotmag 0.000000987654321 1E-6 -> -1 +dqctm590 comparetotmag 0.000000987654321 1E-5 -> -1 +dqctm591 comparetotmag 0.000000987654321 1E-4 -> -1 +dqctm592 comparetotmag 0.000000987654321 1E-3 -> -1 +dqctm593 comparetotmag 0.000000987654321 1E-2 -> -1 +dqctm594 comparetotmag 0.000000987654321 1E-1 -> -1 +dqctm595 comparetotmag 0.000000987654321 1E-0 -> -1 +dqctm596 comparetotmag 0.000000987654321 1E+1 -> -1 +dqctm597 comparetotmag 0.000000987654321 1E+2 -> -1 +dqctm598 comparetotmag 0.000000987654321 1E+3 -> -1 +dqctm599 comparetotmag 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +dqctm600 comparetotmag 12 12.2345 -> -1 +dqctm601 comparetotmag 12.0 12.2345 -> -1 +dqctm602 comparetotmag 12.00 12.2345 -> -1 +dqctm603 comparetotmag 12.000 12.2345 -> -1 +dqctm604 comparetotmag 12.0000 12.2345 -> -1 +dqctm605 comparetotmag 12.00000 12.2345 -> -1 +dqctm606 comparetotmag 12.000000 12.2345 -> -1 +dqctm607 comparetotmag 12.0000000 12.2345 -> -1 +dqctm608 comparetotmag 12.00000000 12.2345 -> -1 +dqctm609 comparetotmag 12.000000000 12.2345 -> -1 +dqctm610 comparetotmag 12.1234 12 -> 1 +dqctm611 comparetotmag 12.1234 12.0 -> 1 +dqctm612 comparetotmag 12.1234 12.00 -> 1 +dqctm613 comparetotmag 12.1234 12.000 -> 1 +dqctm614 comparetotmag 12.1234 12.0000 -> 1 +dqctm615 comparetotmag 12.1234 12.00000 -> 1 +dqctm616 comparetotmag 12.1234 12.000000 -> 1 +dqctm617 comparetotmag 12.1234 12.0000000 -> 1 +dqctm618 comparetotmag 12.1234 12.00000000 -> 1 +dqctm619 comparetotmag 12.1234 12.000000000 -> 1 +dqctm620 comparetotmag -12 -12.2345 -> -1 +dqctm621 comparetotmag -12.0 -12.2345 -> -1 +dqctm622 comparetotmag -12.00 -12.2345 -> -1 +dqctm623 comparetotmag -12.000 -12.2345 -> -1 +dqctm624 comparetotmag -12.0000 -12.2345 -> -1 +dqctm625 comparetotmag -12.00000 -12.2345 -> -1 +dqctm626 comparetotmag -12.000000 -12.2345 -> -1 +dqctm627 comparetotmag -12.0000000 -12.2345 -> -1 +dqctm628 comparetotmag -12.00000000 -12.2345 -> -1 +dqctm629 comparetotmag -12.000000000 -12.2345 -> -1 +dqctm630 comparetotmag -12.1234 -12 -> 1 +dqctm631 comparetotmag -12.1234 -12.0 -> 1 +dqctm632 comparetotmag -12.1234 -12.00 -> 1 +dqctm633 comparetotmag -12.1234 -12.000 -> 1 +dqctm634 comparetotmag -12.1234 -12.0000 -> 1 +dqctm635 comparetotmag -12.1234 -12.00000 -> 1 +dqctm636 comparetotmag -12.1234 -12.000000 -> 1 +dqctm637 comparetotmag -12.1234 -12.0000000 -> 1 +dqctm638 comparetotmag -12.1234 -12.00000000 -> 1 +dqctm639 comparetotmag -12.1234 -12.000000000 -> 1 + +-- extended zeros +dqctm640 comparetotmag 0 0 -> 0 +dqctm641 comparetotmag 0 -0 -> 0 +dqctm642 comparetotmag 0 -0.0 -> 1 +dqctm643 comparetotmag 0 0.0 -> 1 +dqctm644 comparetotmag -0 0 -> 0 +dqctm645 comparetotmag -0 -0 -> 0 +dqctm646 comparetotmag -0 -0.0 -> 1 +dqctm647 comparetotmag -0 0.0 -> 1 +dqctm648 comparetotmag 0.0 0 -> -1 +dqctm649 comparetotmag 0.0 -0 -> -1 +dqctm650 comparetotmag 0.0 -0.0 -> 0 +dqctm651 comparetotmag 0.0 0.0 -> 0 +dqctm652 comparetotmag -0.0 0 -> -1 +dqctm653 comparetotmag -0.0 -0 -> -1 +dqctm654 comparetotmag -0.0 -0.0 -> 0 +dqctm655 comparetotmag -0.0 0.0 -> 0 + +dqctm656 comparetotmag -0E1 0.0 -> 1 +dqctm657 comparetotmag -0E2 0.0 -> 1 +dqctm658 comparetotmag 0E1 0.0 -> 1 +dqctm659 comparetotmag 0E2 0.0 -> 1 +dqctm660 comparetotmag -0E1 0 -> 1 +dqctm661 comparetotmag -0E2 0 -> 1 +dqctm662 comparetotmag 0E1 0 -> 1 +dqctm663 comparetotmag 0E2 0 -> 1 +dqctm664 comparetotmag -0E1 -0E1 -> 0 +dqctm665 comparetotmag -0E2 -0E1 -> 1 +dqctm666 comparetotmag 0E1 -0E1 -> 0 +dqctm667 comparetotmag 0E2 -0E1 -> 1 +dqctm668 comparetotmag -0E1 -0E2 -> -1 +dqctm669 comparetotmag -0E2 -0E2 -> 0 +dqctm670 comparetotmag 0E1 -0E2 -> -1 +dqctm671 comparetotmag 0E2 -0E2 -> 0 +dqctm672 comparetotmag -0E1 0E1 -> 0 +dqctm673 comparetotmag -0E2 0E1 -> 1 +dqctm674 comparetotmag 0E1 0E1 -> 0 +dqctm675 comparetotmag 0E2 0E1 -> 1 +dqctm676 comparetotmag -0E1 0E2 -> -1 +dqctm677 comparetotmag -0E2 0E2 -> 0 +dqctm678 comparetotmag 0E1 0E2 -> -1 +dqctm679 comparetotmag 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +dqctm680 comparetotmag 12 12 -> 0 +dqctm681 comparetotmag 12 12.0 -> 1 +dqctm682 comparetotmag 12 12.00 -> 1 +dqctm683 comparetotmag 12 12.000 -> 1 +dqctm684 comparetotmag 12 12.0000 -> 1 +dqctm685 comparetotmag 12 12.00000 -> 1 +dqctm686 comparetotmag 12 12.000000 -> 1 +dqctm687 comparetotmag 12 12.0000000 -> 1 +dqctm688 comparetotmag 12 12.00000000 -> 1 +dqctm689 comparetotmag 12 12.000000000 -> 1 +dqctm690 comparetotmag 12 12 -> 0 +dqctm691 comparetotmag 12.0 12 -> -1 +dqctm692 comparetotmag 12.00 12 -> -1 +dqctm693 comparetotmag 12.000 12 -> -1 +dqctm694 comparetotmag 12.0000 12 -> -1 +dqctm695 comparetotmag 12.00000 12 -> -1 +dqctm696 comparetotmag 12.000000 12 -> -1 +dqctm697 comparetotmag 12.0000000 12 -> -1 +dqctm698 comparetotmag 12.00000000 12 -> -1 +dqctm699 comparetotmag 12.000000000 12 -> -1 + +-- old long operand checks +dqctm701 comparetotmag 12345678000 1 -> 1 +dqctm702 comparetotmag 1 12345678000 -> -1 +dqctm703 comparetotmag 1234567800 1 -> 1 +dqctm704 comparetotmag 1 1234567800 -> -1 +dqctm705 comparetotmag 1234567890 1 -> 1 +dqctm706 comparetotmag 1 1234567890 -> -1 +dqctm707 comparetotmag 1234567891 1 -> 1 +dqctm708 comparetotmag 1 1234567891 -> -1 +dqctm709 comparetotmag 12345678901 1 -> 1 +dqctm710 comparetotmag 1 12345678901 -> -1 +dqctm711 comparetotmag 1234567896 1 -> 1 +dqctm712 comparetotmag 1 1234567896 -> -1 +dqctm713 comparetotmag -1234567891 1 -> 1 +dqctm714 comparetotmag 1 -1234567891 -> -1 +dqctm715 comparetotmag -12345678901 1 -> 1 +dqctm716 comparetotmag 1 -12345678901 -> -1 +dqctm717 comparetotmag -1234567896 1 -> 1 +dqctm718 comparetotmag 1 -1234567896 -> -1 + +-- old residue cases +dqctm740 comparetotmag 1 0.9999999 -> 1 +dqctm741 comparetotmag 1 0.999999 -> 1 +dqctm742 comparetotmag 1 0.99999 -> 1 +dqctm743 comparetotmag 1 1.0000 -> 1 +dqctm744 comparetotmag 1 1.00001 -> -1 +dqctm745 comparetotmag 1 1.000001 -> -1 +dqctm746 comparetotmag 1 1.0000001 -> -1 +dqctm750 comparetotmag 0.9999999 1 -> -1 +dqctm751 comparetotmag 0.999999 1 -> -1 +dqctm752 comparetotmag 0.99999 1 -> -1 +dqctm753 comparetotmag 1.0000 1 -> -1 +dqctm754 comparetotmag 1.00001 1 -> 1 +dqctm755 comparetotmag 1.000001 1 -> 1 +dqctm756 comparetotmag 1.0000001 1 -> 1 + +-- Specials +dqctm780 comparetotmag Inf -Inf -> 0 +dqctm781 comparetotmag Inf -1000 -> 1 +dqctm782 comparetotmag Inf -1 -> 1 +dqctm783 comparetotmag Inf -0 -> 1 +dqctm784 comparetotmag Inf 0 -> 1 +dqctm785 comparetotmag Inf 1 -> 1 +dqctm786 comparetotmag Inf 1000 -> 1 +dqctm787 comparetotmag Inf Inf -> 0 +dqctm788 comparetotmag -1000 Inf -> -1 +dqctm789 comparetotmag -Inf Inf -> 0 +dqctm790 comparetotmag -1 Inf -> -1 +dqctm791 comparetotmag -0 Inf -> -1 +dqctm792 comparetotmag 0 Inf -> -1 +dqctm793 comparetotmag 1 Inf -> -1 +dqctm794 comparetotmag 1000 Inf -> -1 +dqctm795 comparetotmag Inf Inf -> 0 + +dqctm800 comparetotmag -Inf -Inf -> 0 +dqctm801 comparetotmag -Inf -1000 -> 1 +dqctm802 comparetotmag -Inf -1 -> 1 +dqctm803 comparetotmag -Inf -0 -> 1 +dqctm804 comparetotmag -Inf 0 -> 1 +dqctm805 comparetotmag -Inf 1 -> 1 +dqctm806 comparetotmag -Inf 1000 -> 1 +dqctm807 comparetotmag -Inf Inf -> 0 +dqctm808 comparetotmag -Inf -Inf -> 0 +dqctm809 comparetotmag -1000 -Inf -> -1 +dqctm810 comparetotmag -1 -Inf -> -1 +dqctm811 comparetotmag -0 -Inf -> -1 +dqctm812 comparetotmag 0 -Inf -> -1 +dqctm813 comparetotmag 1 -Inf -> -1 +dqctm814 comparetotmag 1000 -Inf -> -1 +dqctm815 comparetotmag Inf -Inf -> 0 + +dqctm821 comparetotmag NaN -Inf -> 1 +dqctm822 comparetotmag NaN -1000 -> 1 +dqctm823 comparetotmag NaN -1 -> 1 +dqctm824 comparetotmag NaN -0 -> 1 +dqctm825 comparetotmag NaN 0 -> 1 +dqctm826 comparetotmag NaN 1 -> 1 +dqctm827 comparetotmag NaN 1000 -> 1 +dqctm828 comparetotmag NaN Inf -> 1 +dqctm829 comparetotmag NaN NaN -> 0 +dqctm830 comparetotmag -Inf NaN -> -1 +dqctm831 comparetotmag -1000 NaN -> -1 +dqctm832 comparetotmag -1 NaN -> -1 +dqctm833 comparetotmag -0 NaN -> -1 +dqctm834 comparetotmag 0 NaN -> -1 +dqctm835 comparetotmag 1 NaN -> -1 +dqctm836 comparetotmag 1000 NaN -> -1 +dqctm837 comparetotmag Inf NaN -> -1 +dqctm838 comparetotmag -NaN -NaN -> 0 +dqctm839 comparetotmag +NaN -NaN -> 0 +dqctm840 comparetotmag -NaN +NaN -> 0 + +dqctm841 comparetotmag sNaN -sNaN -> 0 +dqctm842 comparetotmag sNaN -NaN -> -1 +dqctm843 comparetotmag sNaN -Inf -> 1 +dqctm844 comparetotmag sNaN -1000 -> 1 +dqctm845 comparetotmag sNaN -1 -> 1 +dqctm846 comparetotmag sNaN -0 -> 1 +dqctm847 comparetotmag sNaN 0 -> 1 +dqctm848 comparetotmag sNaN 1 -> 1 +dqctm849 comparetotmag sNaN 1000 -> 1 +dqctm850 comparetotmag sNaN NaN -> -1 +dqctm851 comparetotmag sNaN sNaN -> 0 + +dqctm852 comparetotmag -sNaN sNaN -> 0 +dqctm853 comparetotmag -NaN sNaN -> 1 +dqctm854 comparetotmag -Inf sNaN -> -1 +dqctm855 comparetotmag -1000 sNaN -> -1 +dqctm856 comparetotmag -1 sNaN -> -1 +dqctm857 comparetotmag -0 sNaN -> -1 +dqctm858 comparetotmag 0 sNaN -> -1 +dqctm859 comparetotmag 1 sNaN -> -1 +dqctm860 comparetotmag 1000 sNaN -> -1 +dqctm861 comparetotmag Inf sNaN -> -1 +dqctm862 comparetotmag NaN sNaN -> 1 +dqctm863 comparetotmag sNaN sNaN -> 0 + +dqctm871 comparetotmag -sNaN -sNaN -> 0 +dqctm872 comparetotmag -sNaN -NaN -> -1 +dqctm873 comparetotmag -sNaN -Inf -> 1 +dqctm874 comparetotmag -sNaN -1000 -> 1 +dqctm875 comparetotmag -sNaN -1 -> 1 +dqctm876 comparetotmag -sNaN -0 -> 1 +dqctm877 comparetotmag -sNaN 0 -> 1 +dqctm878 comparetotmag -sNaN 1 -> 1 +dqctm879 comparetotmag -sNaN 1000 -> 1 +dqctm880 comparetotmag -sNaN NaN -> -1 +dqctm881 comparetotmag -sNaN sNaN -> 0 + +dqctm882 comparetotmag -sNaN -sNaN -> 0 +dqctm883 comparetotmag -NaN -sNaN -> 1 +dqctm884 comparetotmag -Inf -sNaN -> -1 +dqctm885 comparetotmag -1000 -sNaN -> -1 +dqctm886 comparetotmag -1 -sNaN -> -1 +dqctm887 comparetotmag -0 -sNaN -> -1 +dqctm888 comparetotmag 0 -sNaN -> -1 +dqctm889 comparetotmag 1 -sNaN -> -1 +dqctm890 comparetotmag 1000 -sNaN -> -1 +dqctm891 comparetotmag Inf -sNaN -> -1 +dqctm892 comparetotmag NaN -sNaN -> 1 +dqctm893 comparetotmag sNaN -sNaN -> 0 + +-- NaNs with payload +dqctm960 comparetotmag NaN9 -Inf -> 1 +dqctm961 comparetotmag NaN8 999 -> 1 +dqctm962 comparetotmag NaN77 Inf -> 1 +dqctm963 comparetotmag -NaN67 NaN5 -> 1 +dqctm964 comparetotmag -Inf -NaN4 -> -1 +dqctm965 comparetotmag -999 -NaN33 -> -1 +dqctm966 comparetotmag Inf NaN2 -> -1 + +dqctm970 comparetotmag -NaN41 -NaN42 -> -1 +dqctm971 comparetotmag +NaN41 -NaN42 -> -1 +dqctm972 comparetotmag -NaN41 +NaN42 -> -1 +dqctm973 comparetotmag +NaN41 +NaN42 -> -1 +dqctm974 comparetotmag -NaN42 -NaN01 -> 1 +dqctm975 comparetotmag +NaN42 -NaN01 -> 1 +dqctm976 comparetotmag -NaN42 +NaN01 -> 1 +dqctm977 comparetotmag +NaN42 +NaN01 -> 1 + +dqctm980 comparetotmag -sNaN771 -sNaN772 -> -1 +dqctm981 comparetotmag +sNaN771 -sNaN772 -> -1 +dqctm982 comparetotmag -sNaN771 +sNaN772 -> -1 +dqctm983 comparetotmag +sNaN771 +sNaN772 -> -1 +dqctm984 comparetotmag -sNaN772 -sNaN771 -> 1 +dqctm985 comparetotmag +sNaN772 -sNaN771 -> 1 +dqctm986 comparetotmag -sNaN772 +sNaN771 -> 1 +dqctm987 comparetotmag +sNaN772 +sNaN771 -> 1 + +dqctm991 comparetotmag -sNaN99 -Inf -> 1 +dqctm992 comparetotmag sNaN98 -11 -> 1 +dqctm993 comparetotmag sNaN97 NaN -> -1 +dqctm994 comparetotmag sNaN16 sNaN94 -> -1 +dqctm995 comparetotmag NaN85 sNaN83 -> 1 +dqctm996 comparetotmag -Inf sNaN92 -> -1 +dqctm997 comparetotmag 088 sNaN81 -> -1 +dqctm998 comparetotmag Inf sNaN90 -> -1 +dqctm999 comparetotmag NaN -sNaN89 -> 1 + +-- spread zeros +dqctm1110 comparetotmag 0E-6143 0 -> -1 +dqctm1111 comparetotmag 0E-6143 -0 -> -1 +dqctm1112 comparetotmag -0E-6143 0 -> -1 +dqctm1113 comparetotmag -0E-6143 -0 -> -1 +dqctm1114 comparetotmag 0E-6143 0E+6144 -> -1 +dqctm1115 comparetotmag 0E-6143 -0E+6144 -> -1 +dqctm1116 comparetotmag -0E-6143 0E+6144 -> -1 +dqctm1117 comparetotmag -0E-6143 -0E+6144 -> -1 +dqctm1118 comparetotmag 0 0E+6144 -> -1 +dqctm1119 comparetotmag 0 -0E+6144 -> -1 +dqctm1120 comparetotmag -0 0E+6144 -> -1 +dqctm1121 comparetotmag -0 -0E+6144 -> -1 + +dqctm1130 comparetotmag 0E+6144 0 -> 1 +dqctm1131 comparetotmag 0E+6144 -0 -> 1 +dqctm1132 comparetotmag -0E+6144 0 -> 1 +dqctm1133 comparetotmag -0E+6144 -0 -> 1 +dqctm1134 comparetotmag 0E+6144 0E-6143 -> 1 +dqctm1135 comparetotmag 0E+6144 -0E-6143 -> 1 +dqctm1136 comparetotmag -0E+6144 0E-6143 -> 1 +dqctm1137 comparetotmag -0E+6144 -0E-6143 -> 1 +dqctm1138 comparetotmag 0 0E-6143 -> 1 +dqctm1139 comparetotmag 0 -0E-6143 -> 1 +dqctm1140 comparetotmag -0 0E-6143 -> 1 +dqctm1141 comparetotmag -0 -0E-6143 -> 1 + +-- Null tests +dqctm9990 comparetotmag 10 # -> NaN Invalid_operation +dqctm9991 comparetotmag # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopy.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopy.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- dqCopy.decTest -- quiet decQuad copy -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqcpy001 copy +7.50 -> 7.50 + +-- Infinities +dqcpy011 copy Infinity -> Infinity +dqcpy012 copy -Infinity -> -Infinity + +-- NaNs, 0 payload +dqcpy021 copy NaN -> NaN +dqcpy022 copy -NaN -> -NaN +dqcpy023 copy sNaN -> sNaN +dqcpy024 copy -sNaN -> -sNaN + +-- NaNs, non-0 payload +dqcpy031 copy NaN10 -> NaN10 +dqcpy032 copy -NaN10 -> -NaN10 +dqcpy033 copy sNaN10 -> sNaN10 +dqcpy034 copy -sNaN10 -> -sNaN10 +dqcpy035 copy NaN7 -> NaN7 +dqcpy036 copy -NaN7 -> -NaN7 +dqcpy037 copy sNaN101 -> sNaN101 +dqcpy038 copy -sNaN101 -> -sNaN101 + +-- finites +dqcpy101 copy 7 -> 7 +dqcpy102 copy -7 -> -7 +dqcpy103 copy 75 -> 75 +dqcpy104 copy -75 -> -75 +dqcpy105 copy 7.50 -> 7.50 +dqcpy106 copy -7.50 -> -7.50 +dqcpy107 copy 7.500 -> 7.500 +dqcpy108 copy -7.500 -> -7.500 + +-- zeros +dqcpy111 copy 0 -> 0 +dqcpy112 copy -0 -> -0 +dqcpy113 copy 0E+4 -> 0E+4 +dqcpy114 copy -0E+4 -> -0E+4 +dqcpy115 copy 0.0000 -> 0.0000 +dqcpy116 copy -0.0000 -> -0.0000 +dqcpy117 copy 0E-141 -> 0E-141 +dqcpy118 copy -0E-141 -> -0E-141 + +-- full coefficients, alternating bits +dqcpy121 copy 2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqcpy122 copy -2682682682682682682682682682682682 -> -2682682682682682682682682682682682 +dqcpy123 copy 1341341341341341341341341341341341 -> 1341341341341341341341341341341341 +dqcpy124 copy -1341341341341341341341341341341341 -> -1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqcpy131 copy 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqcpy132 copy 1E-6143 -> 1E-6143 +dqcpy133 copy 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqcpy134 copy 1E-6176 -> 1E-6176 + +dqcpy135 copy -1E-6176 -> -1E-6176 +dqcpy136 copy -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143 +dqcpy137 copy -1E-6143 -> -1E-6143 +dqcpy138 copy -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopyAbs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopyAbs.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- dqCopyAbs.decTest -- quiet decQuad copy and set sign to zero -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqcpa001 copyabs +7.50 -> 7.50 + +-- Infinities +dqcpa011 copyabs Infinity -> Infinity +dqcpa012 copyabs -Infinity -> Infinity + +-- NaNs, 0 payload +dqcpa021 copyabs NaN -> NaN +dqcpa022 copyabs -NaN -> NaN +dqcpa023 copyabs sNaN -> sNaN +dqcpa024 copyabs -sNaN -> sNaN + +-- NaNs, non-0 payload +dqcpa031 copyabs NaN10 -> NaN10 +dqcpa032 copyabs -NaN15 -> NaN15 +dqcpa033 copyabs sNaN15 -> sNaN15 +dqcpa034 copyabs -sNaN10 -> sNaN10 +dqcpa035 copyabs NaN7 -> NaN7 +dqcpa036 copyabs -NaN7 -> NaN7 +dqcpa037 copyabs sNaN101 -> sNaN101 +dqcpa038 copyabs -sNaN101 -> sNaN101 + +-- finites +dqcpa101 copyabs 7 -> 7 +dqcpa102 copyabs -7 -> 7 +dqcpa103 copyabs 75 -> 75 +dqcpa104 copyabs -75 -> 75 +dqcpa105 copyabs 7.10 -> 7.10 +dqcpa106 copyabs -7.10 -> 7.10 +dqcpa107 copyabs 7.500 -> 7.500 +dqcpa108 copyabs -7.500 -> 7.500 + +-- zeros +dqcpa111 copyabs 0 -> 0 +dqcpa112 copyabs -0 -> 0 +dqcpa113 copyabs 0E+6 -> 0E+6 +dqcpa114 copyabs -0E+6 -> 0E+6 +dqcpa115 copyabs 0.0000 -> 0.0000 +dqcpa116 copyabs -0.0000 -> 0.0000 +dqcpa117 copyabs 0E-141 -> 0E-141 +dqcpa118 copyabs -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +dqcpa121 copyabs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqcpa122 copyabs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqcpa123 copyabs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341 +dqcpa124 copyabs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqcpa131 copyabs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqcpa132 copyabs 1E-6143 -> 1E-6143 +dqcpa133 copyabs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqcpa134 copyabs 1E-6176 -> 1E-6176 + +dqcpa135 copyabs -1E-6176 -> 1E-6176 +dqcpa136 copyabs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqcpa137 copyabs -1E-6143 -> 1E-6143 +dqcpa138 copyabs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopyNegate.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopyNegate.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- dqCopyNegate.decTest -- quiet decQuad copy and negate -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqcpn001 copynegate +7.50 -> -7.50 + +-- Infinities +dqcpn011 copynegate Infinity -> -Infinity +dqcpn012 copynegate -Infinity -> Infinity + +-- NaNs, 0 payload +dqcpn021 copynegate NaN -> -NaN +dqcpn022 copynegate -NaN -> NaN +dqcpn023 copynegate sNaN -> -sNaN +dqcpn024 copynegate -sNaN -> sNaN + +-- NaNs, non-0 payload +dqcpn031 copynegate NaN13 -> -NaN13 +dqcpn032 copynegate -NaN13 -> NaN13 +dqcpn033 copynegate sNaN13 -> -sNaN13 +dqcpn034 copynegate -sNaN13 -> sNaN13 +dqcpn035 copynegate NaN70 -> -NaN70 +dqcpn036 copynegate -NaN70 -> NaN70 +dqcpn037 copynegate sNaN101 -> -sNaN101 +dqcpn038 copynegate -sNaN101 -> sNaN101 + +-- finites +dqcpn101 copynegate 7 -> -7 +dqcpn102 copynegate -7 -> 7 +dqcpn103 copynegate 75 -> -75 +dqcpn104 copynegate -75 -> 75 +dqcpn105 copynegate 7.50 -> -7.50 +dqcpn106 copynegate -7.50 -> 7.50 +dqcpn107 copynegate 7.500 -> -7.500 +dqcpn108 copynegate -7.500 -> 7.500 + +-- zeros +dqcpn111 copynegate 0 -> -0 +dqcpn112 copynegate -0 -> 0 +dqcpn113 copynegate 0E+4 -> -0E+4 +dqcpn114 copynegate -0E+4 -> 0E+4 +dqcpn115 copynegate 0.0000 -> -0.0000 +dqcpn116 copynegate -0.0000 -> 0.0000 +dqcpn117 copynegate 0E-141 -> -0E-141 +dqcpn118 copynegate -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +dqcpn121 copynegate 2682682682682682682682682682682682 -> -2682682682682682682682682682682682 +dqcpn122 copynegate -2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqcpn123 copynegate 1341341341341341341341341341341341 -> -1341341341341341341341341341341341 +dqcpn124 copynegate -1341341341341341341341341341341341 -> 1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqcpn131 copynegate 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 +dqcpn132 copynegate 1E-6143 -> -1E-6143 +dqcpn133 copynegate 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143 +dqcpn134 copynegate 1E-6176 -> -1E-6176 + +dqcpn135 copynegate -1E-6176 -> 1E-6176 +dqcpn136 copynegate -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqcpn137 copynegate -1E-6143 -> 1E-6143 +dqcpn138 copynegate -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopySign.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqCopySign.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,175 @@ +------------------------------------------------------------------------ +-- dqCopySign.decTest -- quiet decQuad copy with sign from rhs -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqcps001 copysign +7.50 11 -> 7.50 + +-- Infinities +dqcps011 copysign Infinity 11 -> Infinity +dqcps012 copysign -Infinity 11 -> Infinity + +-- NaNs, 0 payload +dqcps021 copysign NaN 11 -> NaN +dqcps022 copysign -NaN 11 -> NaN +dqcps023 copysign sNaN 11 -> sNaN +dqcps024 copysign -sNaN 11 -> sNaN + +-- NaNs, non-0 payload +dqcps031 copysign NaN10 11 -> NaN10 +dqcps032 copysign -NaN10 11 -> NaN10 +dqcps033 copysign sNaN10 11 -> sNaN10 +dqcps034 copysign -sNaN10 11 -> sNaN10 +dqcps035 copysign NaN7 11 -> NaN7 +dqcps036 copysign -NaN7 11 -> NaN7 +dqcps037 copysign sNaN101 11 -> sNaN101 +dqcps038 copysign -sNaN101 11 -> sNaN101 + +-- finites +dqcps101 copysign 7 11 -> 7 +dqcps102 copysign -7 11 -> 7 +dqcps103 copysign 75 11 -> 75 +dqcps104 copysign -75 11 -> 75 +dqcps105 copysign 7.50 11 -> 7.50 +dqcps106 copysign -7.50 11 -> 7.50 +dqcps107 copysign 7.500 11 -> 7.500 +dqcps108 copysign -7.500 11 -> 7.500 + +-- zeros +dqcps111 copysign 0 11 -> 0 +dqcps112 copysign -0 11 -> 0 +dqcps113 copysign 0E+4 11 -> 0E+4 +dqcps114 copysign -0E+4 11 -> 0E+4 +dqcps115 copysign 0.0000 11 -> 0.0000 +dqcps116 copysign -0.0000 11 -> 0.0000 +dqcps117 copysign 0E-141 11 -> 0E-141 +dqcps118 copysign -0E-141 11 -> 0E-141 + +-- full coefficients, alternating bits +dqcps121 copysign 2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682 +dqcps122 copysign -2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682 +dqcps123 copysign 1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341 +dqcps124 copysign -1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqcps131 copysign 9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144 +dqcps132 copysign 1E-6143 8 -> 1E-6143 +dqcps133 copysign 1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143 +dqcps134 copysign 1E-6176 8 -> 1E-6176 + +dqcps135 copysign -1E-6176 8 -> 1E-6176 +dqcps136 copysign -1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143 +dqcps137 copysign -1E-6143 8 -> 1E-6143 +dqcps138 copysign -9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144 + +-- repeat with negative RHS + +-- Infinities +dqcps211 copysign Infinity -34 -> -Infinity +dqcps212 copysign -Infinity -34 -> -Infinity + +-- NaNs, 0 payload +dqcps221 copysign NaN -34 -> -NaN +dqcps222 copysign -NaN -34 -> -NaN +dqcps223 copysign sNaN -34 -> -sNaN +dqcps224 copysign -sNaN -34 -> -sNaN + +-- NaNs, non-0 payload +dqcps231 copysign NaN10 -34 -> -NaN10 +dqcps232 copysign -NaN10 -34 -> -NaN10 +dqcps233 copysign sNaN10 -34 -> -sNaN10 +dqcps234 copysign -sNaN10 -34 -> -sNaN10 +dqcps235 copysign NaN7 -34 -> -NaN7 +dqcps236 copysign -NaN7 -34 -> -NaN7 +dqcps237 copysign sNaN101 -34 -> -sNaN101 +dqcps238 copysign -sNaN101 -34 -> -sNaN101 + +-- finites +dqcps301 copysign 7 -34 -> -7 +dqcps302 copysign -7 -34 -> -7 +dqcps303 copysign 75 -34 -> -75 +dqcps304 copysign -75 -34 -> -75 +dqcps305 copysign 7.50 -34 -> -7.50 +dqcps306 copysign -7.50 -34 -> -7.50 +dqcps307 copysign 7.500 -34 -> -7.500 +dqcps308 copysign -7.500 -34 -> -7.500 + +-- zeros +dqcps311 copysign 0 -34 -> -0 +dqcps312 copysign -0 -34 -> -0 +dqcps313 copysign 0E+4 -34 -> -0E+4 +dqcps314 copysign -0E+4 -34 -> -0E+4 +dqcps315 copysign 0.0000 -34 -> -0.0000 +dqcps316 copysign -0.0000 -34 -> -0.0000 +dqcps317 copysign 0E-141 -34 -> -0E-141 +dqcps318 copysign -0E-141 -34 -> -0E-141 + +-- full coefficients, alternating bits +dqcps321 copysign 2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682 +dqcps322 copysign -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682 +dqcps323 copysign 1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341 +dqcps324 copysign -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqcps331 copysign 9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 +dqcps332 copysign 1E-6143 -1 -> -1E-6143 +dqcps333 copysign 1.000000000000000000000000000000000E-6143 -1 -> -1.000000000000000000000000000000000E-6143 +dqcps334 copysign 1E-6176 -1 -> -1E-6176 + +dqcps335 copysign -1E-6176 -3 -> -1E-6176 +dqcps336 copysign -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143 +dqcps337 copysign -1E-6143 -3 -> -1E-6143 +dqcps338 copysign -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144 + +-- Other kinds of RHS +dqcps401 copysign 701 -34 -> -701 +dqcps402 copysign -720 -34 -> -720 +dqcps403 copysign 701 -0 -> -701 +dqcps404 copysign -720 -0 -> -720 +dqcps405 copysign 701 +0 -> 701 +dqcps406 copysign -720 +0 -> 720 +dqcps407 copysign 701 +34 -> 701 +dqcps408 copysign -720 +34 -> 720 + +dqcps413 copysign 701 -Inf -> -701 +dqcps414 copysign -720 -Inf -> -720 +dqcps415 copysign 701 +Inf -> 701 +dqcps416 copysign -720 +Inf -> 720 + +dqcps420 copysign 701 -NaN -> -701 +dqcps421 copysign -720 -NaN -> -720 +dqcps422 copysign 701 +NaN -> 701 +dqcps423 copysign -720 +NaN -> 720 +dqcps425 copysign -720 +NaN8 -> 720 + +dqcps426 copysign 701 -sNaN -> -701 +dqcps427 copysign -720 -sNaN -> -720 +dqcps428 copysign 701 +sNaN -> 701 +dqcps429 copysign -720 +sNaN -> 720 +dqcps430 copysign -720 +sNaN3 -> 720 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqDivide.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqDivide.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,808 @@ +------------------------------------------------------------------------ +-- dqDivide.decTest -- decQuad division -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqdiv001 divide 1 1 -> 1 +dqdiv002 divide 2 1 -> 2 +dqdiv003 divide 1 2 -> 0.5 +dqdiv004 divide 2 2 -> 1 +dqdiv005 divide 0 1 -> 0 +dqdiv006 divide 0 2 -> 0 +dqdiv007 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded +dqdiv008 divide 2 3 -> 0.6666666666666666666666666666666667 Inexact Rounded +dqdiv009 divide 3 3 -> 1 + +dqdiv010 divide 2.4 1 -> 2.4 +dqdiv011 divide 2.4 -1 -> -2.4 +dqdiv012 divide -2.4 1 -> -2.4 +dqdiv013 divide -2.4 -1 -> 2.4 +dqdiv014 divide 2.40 1 -> 2.40 +dqdiv015 divide 2.400 1 -> 2.400 +dqdiv016 divide 2.4 2 -> 1.2 +dqdiv017 divide 2.400 2 -> 1.200 +dqdiv018 divide 2. 2 -> 1 +dqdiv019 divide 20 20 -> 1 + +dqdiv020 divide 187 187 -> 1 +dqdiv021 divide 5 2 -> 2.5 +dqdiv022 divide 50 20 -> 2.5 +dqdiv023 divide 500 200 -> 2.5 +dqdiv024 divide 50.0 20.0 -> 2.5 +dqdiv025 divide 5.00 2.00 -> 2.5 +dqdiv026 divide 5 2.0 -> 2.5 +dqdiv027 divide 5 2.000 -> 2.5 +dqdiv028 divide 5 0.20 -> 25 +dqdiv029 divide 5 0.200 -> 25 +dqdiv030 divide 10 1 -> 10 +dqdiv031 divide 100 1 -> 100 +dqdiv032 divide 1000 1 -> 1000 +dqdiv033 divide 1000 100 -> 10 + +dqdiv035 divide 1 2 -> 0.5 +dqdiv036 divide 1 4 -> 0.25 +dqdiv037 divide 1 8 -> 0.125 +dqdiv038 divide 1 16 -> 0.0625 +dqdiv039 divide 1 32 -> 0.03125 +dqdiv040 divide 1 64 -> 0.015625 +dqdiv041 divide 1 -2 -> -0.5 +dqdiv042 divide 1 -4 -> -0.25 +dqdiv043 divide 1 -8 -> -0.125 +dqdiv044 divide 1 -16 -> -0.0625 +dqdiv045 divide 1 -32 -> -0.03125 +dqdiv046 divide 1 -64 -> -0.015625 +dqdiv047 divide -1 2 -> -0.5 +dqdiv048 divide -1 4 -> -0.25 +dqdiv049 divide -1 8 -> -0.125 +dqdiv050 divide -1 16 -> -0.0625 +dqdiv051 divide -1 32 -> -0.03125 +dqdiv052 divide -1 64 -> -0.015625 +dqdiv053 divide -1 -2 -> 0.5 +dqdiv054 divide -1 -4 -> 0.25 +dqdiv055 divide -1 -8 -> 0.125 +dqdiv056 divide -1 -16 -> 0.0625 +dqdiv057 divide -1 -32 -> 0.03125 +dqdiv058 divide -1 -64 -> 0.015625 + +-- bcdTime +dqdiv060 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded +dqdiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717123193907511985359 Inexact Rounded + +-- 1234567890123456 +dqdiv067 divide 9999999999999999999999999999999999 1 -> 9999999999999999999999999999999999 +dqdiv068 divide 999999999999999999999999999999999 1 -> 999999999999999999999999999999999 +dqdiv069 divide 99999999999999999999999999999999 1 -> 99999999999999999999999999999999 +dqdiv070 divide 99999999999999999 1 -> 99999999999999999 +dqdiv071 divide 9999999999999999 1 -> 9999999999999999 +dqdiv072 divide 999999999999999 1 -> 999999999999999 +dqdiv073 divide 99999999999999 1 -> 99999999999999 +dqdiv074 divide 9999999999999 1 -> 9999999999999 +dqdiv075 divide 999999999999 1 -> 999999999999 +dqdiv076 divide 99999999999 1 -> 99999999999 +dqdiv077 divide 9999999999 1 -> 9999999999 +dqdiv078 divide 999999999 1 -> 999999999 +dqdiv079 divide 99999999 1 -> 99999999 +dqdiv080 divide 9999999 1 -> 9999999 +dqdiv081 divide 999999 1 -> 999999 +dqdiv082 divide 99999 1 -> 99999 +dqdiv083 divide 9999 1 -> 9999 +dqdiv084 divide 999 1 -> 999 +dqdiv085 divide 99 1 -> 99 +dqdiv086 divide 9 1 -> 9 + +dqdiv090 divide 0. 1 -> 0 +dqdiv091 divide .0 1 -> 0.0 +dqdiv092 divide 0.00 1 -> 0.00 +dqdiv093 divide 0.00E+9 1 -> 0E+7 +dqdiv094 divide 0.0000E-50 1 -> 0E-54 + +dqdiv095 divide 1 1E-8 -> 1E+8 +dqdiv096 divide 1 1E-9 -> 1E+9 +dqdiv097 divide 1 1E-10 -> 1E+10 +dqdiv098 divide 1 1E-11 -> 1E+11 +dqdiv099 divide 1 1E-12 -> 1E+12 + +dqdiv100 divide 1 1 -> 1 +dqdiv101 divide 1 2 -> 0.5 +dqdiv102 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded +dqdiv103 divide 1 4 -> 0.25 +dqdiv104 divide 1 5 -> 0.2 +dqdiv105 divide 1 6 -> 0.1666666666666666666666666666666667 Inexact Rounded +dqdiv106 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded +dqdiv107 divide 1 8 -> 0.125 +dqdiv108 divide 1 9 -> 0.1111111111111111111111111111111111 Inexact Rounded +dqdiv109 divide 1 10 -> 0.1 +dqdiv110 divide 1 1 -> 1 +dqdiv111 divide 2 1 -> 2 +dqdiv112 divide 3 1 -> 3 +dqdiv113 divide 4 1 -> 4 +dqdiv114 divide 5 1 -> 5 +dqdiv115 divide 6 1 -> 6 +dqdiv116 divide 7 1 -> 7 +dqdiv117 divide 8 1 -> 8 +dqdiv118 divide 9 1 -> 9 +dqdiv119 divide 10 1 -> 10 + +dqdiv120 divide 3E+1 0.001 -> 3E+4 +dqdiv121 divide 2.200 2 -> 1.100 + +dqdiv130 divide 12345 4.999 -> 2469.493898779755951190238047609522 Inexact Rounded +dqdiv131 divide 12345 4.99 -> 2473.947895791583166332665330661323 Inexact Rounded +dqdiv132 divide 12345 4.9 -> 2519.387755102040816326530612244898 Inexact Rounded +dqdiv133 divide 12345 5 -> 2469 +dqdiv134 divide 12345 5.1 -> 2420.588235294117647058823529411765 Inexact Rounded +dqdiv135 divide 12345 5.01 -> 2464.071856287425149700598802395210 Inexact Rounded +dqdiv136 divide 12345 5.001 -> 2468.506298740251949610077984403119 Inexact Rounded + +-- test possibly imprecise results +dqdiv220 divide 391 597 -> 0.6549413735343383584589614740368509 Inexact Rounded +dqdiv221 divide 391 -597 -> -0.6549413735343383584589614740368509 Inexact Rounded +dqdiv222 divide -391 597 -> -0.6549413735343383584589614740368509 Inexact Rounded +dqdiv223 divide -391 -597 -> 0.6549413735343383584589614740368509 Inexact Rounded + +-- test some cases that are close to exponent overflow +dqdiv270 divide 1 1e6144 -> 1E-6144 Subnormal +dqdiv271 divide 1 0.9e6144 -> 1.11111111111111111111111111111111E-6144 Rounded Inexact Subnormal Underflow +dqdiv272 divide 1 0.99e6144 -> 1.01010101010101010101010101010101E-6144 Rounded Inexact Subnormal Underflow +dqdiv273 divide 1 0.9999999999999999e6144 -> 1.00000000000000010000000000000001E-6144 Rounded Inexact Subnormal Underflow +dqdiv274 divide 9e6144 1 -> 9.000000000000000000000000000000000E+6144 Clamped +dqdiv275 divide 9.9e6144 1 -> 9.900000000000000000000000000000000E+6144 Clamped +dqdiv276 divide 9.99e6144 1 -> 9.990000000000000000000000000000000E+6144 Clamped +dqdiv277 divide 9.999999999999999e6144 1 -> 9.999999999999999000000000000000000E+6144 Clamped + +dqdiv278 divide 1 0.9999999999999999999999999999999999e6144 -> 1.00000000000000000000000000000000E-6144 Rounded Inexact Subnormal Underflow +dqdiv279 divide 9.999999999999999999999999999999999e6144 1 -> 9.999999999999999999999999999999999E+6144 + +-- Divide into 0 tests +dqdiv301 divide 0 7 -> 0 +dqdiv302 divide 0 7E-5 -> 0E+5 +dqdiv303 divide 0 7E-1 -> 0E+1 +dqdiv304 divide 0 7E+1 -> 0.0 +dqdiv305 divide 0 7E+5 -> 0.00000 +dqdiv306 divide 0 7E+6 -> 0.000000 +dqdiv307 divide 0 7E+7 -> 0E-7 +dqdiv308 divide 0 70E-5 -> 0E+5 +dqdiv309 divide 0 70E-1 -> 0E+1 +dqdiv310 divide 0 70E+0 -> 0 +dqdiv311 divide 0 70E+1 -> 0.0 +dqdiv312 divide 0 70E+5 -> 0.00000 +dqdiv313 divide 0 70E+6 -> 0.000000 +dqdiv314 divide 0 70E+7 -> 0E-7 +dqdiv315 divide 0 700E-5 -> 0E+5 +dqdiv316 divide 0 700E-1 -> 0E+1 +dqdiv317 divide 0 700E+0 -> 0 +dqdiv318 divide 0 700E+1 -> 0.0 +dqdiv319 divide 0 700E+5 -> 0.00000 +dqdiv320 divide 0 700E+6 -> 0.000000 +dqdiv321 divide 0 700E+7 -> 0E-7 +dqdiv322 divide 0 700E+77 -> 0E-77 + +dqdiv331 divide 0E-3 7E-5 -> 0E+2 +dqdiv332 divide 0E-3 7E-1 -> 0.00 +dqdiv333 divide 0E-3 7E+1 -> 0.0000 +dqdiv334 divide 0E-3 7E+5 -> 0E-8 +dqdiv335 divide 0E-1 7E-5 -> 0E+4 +dqdiv336 divide 0E-1 7E-1 -> 0 +dqdiv337 divide 0E-1 7E+1 -> 0.00 +dqdiv338 divide 0E-1 7E+5 -> 0.000000 +dqdiv339 divide 0E+1 7E-5 -> 0E+6 +dqdiv340 divide 0E+1 7E-1 -> 0E+2 +dqdiv341 divide 0E+1 7E+1 -> 0 +dqdiv342 divide 0E+1 7E+5 -> 0.0000 +dqdiv343 divide 0E+3 7E-5 -> 0E+8 +dqdiv344 divide 0E+3 7E-1 -> 0E+4 +dqdiv345 divide 0E+3 7E+1 -> 0E+2 +dqdiv346 divide 0E+3 7E+5 -> 0.00 + +-- These were 'input rounding' +dqdiv441 divide 12345678000 1 -> 12345678000 +dqdiv442 divide 1 12345678000 -> 8.100000664200054464404466081166219E-11 Inexact Rounded +dqdiv443 divide 1234567800 1 -> 1234567800 +dqdiv444 divide 1 1234567800 -> 8.100000664200054464404466081166219E-10 Inexact Rounded +dqdiv445 divide 1234567890 1 -> 1234567890 +dqdiv446 divide 1 1234567890 -> 8.100000073710000670761006103925156E-10 Inexact Rounded +dqdiv447 divide 1234567891 1 -> 1234567891 +dqdiv448 divide 1 1234567891 -> 8.100000067149000556665214614754629E-10 Inexact Rounded +dqdiv449 divide 12345678901 1 -> 12345678901 +dqdiv450 divide 1 12345678901 -> 8.100000073053900658873130042376760E-11 Inexact Rounded +dqdiv451 divide 1234567896 1 -> 1234567896 +dqdiv452 divide 1 1234567896 -> 8.100000034344000145618560617422697E-10 Inexact Rounded + +-- high-lows +dqdiv453 divide 1e+1 1 -> 1E+1 +dqdiv454 divide 1e+1 1.0 -> 1E+1 +dqdiv455 divide 1e+1 1.00 -> 1E+1 +dqdiv456 divide 1e+2 2 -> 5E+1 +dqdiv457 divide 1e+2 2.0 -> 5E+1 +dqdiv458 divide 1e+2 2.00 -> 5E+1 + +-- some from IEEE discussions +dqdiv460 divide 3e0 2e0 -> 1.5 +dqdiv461 divide 30e-1 2e0 -> 1.5 +dqdiv462 divide 300e-2 2e0 -> 1.50 +dqdiv464 divide 3000e-3 2e0 -> 1.500 +dqdiv465 divide 3e0 20e-1 -> 1.5 +dqdiv466 divide 30e-1 20e-1 -> 1.5 +dqdiv467 divide 300e-2 20e-1 -> 1.5 +dqdiv468 divide 3000e-3 20e-1 -> 1.50 +dqdiv469 divide 3e0 200e-2 -> 1.5 +dqdiv470 divide 30e-1 200e-2 -> 1.5 +dqdiv471 divide 300e-2 200e-2 -> 1.5 +dqdiv472 divide 3000e-3 200e-2 -> 1.5 +dqdiv473 divide 3e0 2000e-3 -> 1.5 +dqdiv474 divide 30e-1 2000e-3 -> 1.5 +dqdiv475 divide 300e-2 2000e-3 -> 1.5 +dqdiv476 divide 3000e-3 2000e-3 -> 1.5 + +-- some reciprocals +dqdiv480 divide 1 1.0E+33 -> 1E-33 +dqdiv481 divide 1 10E+33 -> 1E-34 +dqdiv482 divide 1 1.0E-33 -> 1E+33 +dqdiv483 divide 1 10E-33 -> 1E+32 + +-- RMS discussion table +dqdiv484 divide 0e5 1e3 -> 0E+2 +dqdiv485 divide 0e5 2e3 -> 0E+2 +dqdiv486 divide 0e5 10e2 -> 0E+3 +dqdiv487 divide 0e5 20e2 -> 0E+3 +dqdiv488 divide 0e5 100e1 -> 0E+4 +dqdiv489 divide 0e5 200e1 -> 0E+4 + +dqdiv491 divide 1e5 1e3 -> 1E+2 +dqdiv492 divide 1e5 2e3 -> 5E+1 +dqdiv493 divide 1e5 10e2 -> 1E+2 +dqdiv494 divide 1e5 20e2 -> 5E+1 +dqdiv495 divide 1e5 100e1 -> 1E+2 +dqdiv496 divide 1e5 200e1 -> 5E+1 + +-- tryzeros cases +rounding: half_up +dqdiv497 divide 0E+6108 1000E-33 -> 0E+6111 Clamped +dqdiv498 divide 0E-6170 1000E+33 -> 0E-6176 Clamped + +rounding: half_up + +-- focus on trailing zeros issues +dqdiv500 divide 1 9.9 -> 0.1010101010101010101010101010101010 Inexact Rounded +dqdiv501 divide 1 9.09 -> 0.1100110011001100110011001100110011 Inexact Rounded +dqdiv502 divide 1 9.009 -> 0.1110001110001110001110001110001110 Inexact Rounded + +dqdiv511 divide 1 2 -> 0.5 +dqdiv512 divide 1.0 2 -> 0.5 +dqdiv513 divide 1.00 2 -> 0.50 +dqdiv514 divide 1.000 2 -> 0.500 +dqdiv515 divide 1.0000 2 -> 0.5000 +dqdiv516 divide 1.00000 2 -> 0.50000 +dqdiv517 divide 1.000000 2 -> 0.500000 +dqdiv518 divide 1.0000000 2 -> 0.5000000 +dqdiv519 divide 1.00 2.00 -> 0.5 + +dqdiv521 divide 2 1 -> 2 +dqdiv522 divide 2 1.0 -> 2 +dqdiv523 divide 2 1.00 -> 2 +dqdiv524 divide 2 1.000 -> 2 +dqdiv525 divide 2 1.0000 -> 2 +dqdiv526 divide 2 1.00000 -> 2 +dqdiv527 divide 2 1.000000 -> 2 +dqdiv528 divide 2 1.0000000 -> 2 +dqdiv529 divide 2.00 1.00 -> 2 + +dqdiv530 divide 2.40 2 -> 1.20 +dqdiv531 divide 2.40 4 -> 0.60 +dqdiv532 divide 2.40 10 -> 0.24 +dqdiv533 divide 2.40 2.0 -> 1.2 +dqdiv534 divide 2.40 4.0 -> 0.6 +dqdiv535 divide 2.40 10.0 -> 0.24 +dqdiv536 divide 2.40 2.00 -> 1.2 +dqdiv537 divide 2.40 4.00 -> 0.6 +dqdiv538 divide 2.40 10.00 -> 0.24 +dqdiv539 divide 0.9 0.1 -> 9 +dqdiv540 divide 0.9 0.01 -> 9E+1 +dqdiv541 divide 0.9 0.001 -> 9E+2 +dqdiv542 divide 5 2 -> 2.5 +dqdiv543 divide 5 2.0 -> 2.5 +dqdiv544 divide 5 2.00 -> 2.5 +dqdiv545 divide 5 20 -> 0.25 +dqdiv546 divide 5 20.0 -> 0.25 +dqdiv547 divide 2.400 2 -> 1.200 +dqdiv548 divide 2.400 2.0 -> 1.20 +dqdiv549 divide 2.400 2.400 -> 1 + +dqdiv550 divide 240 1 -> 240 +dqdiv551 divide 240 10 -> 24 +dqdiv552 divide 240 100 -> 2.4 +dqdiv553 divide 240 1000 -> 0.24 +dqdiv554 divide 2400 1 -> 2400 +dqdiv555 divide 2400 10 -> 240 +dqdiv556 divide 2400 100 -> 24 +dqdiv557 divide 2400 1000 -> 2.4 + +-- +ve exponent +dqdiv600 divide 2.4E+9 2 -> 1.2E+9 +dqdiv601 divide 2.40E+9 2 -> 1.20E+9 +dqdiv602 divide 2.400E+9 2 -> 1.200E+9 +dqdiv603 divide 2.4000E+9 2 -> 1.2000E+9 +dqdiv604 divide 24E+8 2 -> 1.2E+9 +dqdiv605 divide 240E+7 2 -> 1.20E+9 +dqdiv606 divide 2400E+6 2 -> 1.200E+9 +dqdiv607 divide 24000E+5 2 -> 1.2000E+9 + +-- more zeros, etc. +dqdiv731 divide 5.00 1E-3 -> 5.00E+3 +dqdiv732 divide 00.00 0.000 -> NaN Division_undefined +dqdiv733 divide 00.00 0E-3 -> NaN Division_undefined +dqdiv734 divide 0 -0 -> NaN Division_undefined +dqdiv735 divide -0 0 -> NaN Division_undefined +dqdiv736 divide -0 -0 -> NaN Division_undefined + +dqdiv741 divide 0 -1 -> -0 +dqdiv742 divide -0 -1 -> 0 +dqdiv743 divide 0 1 -> 0 +dqdiv744 divide -0 1 -> -0 +dqdiv745 divide -1 0 -> -Infinity Division_by_zero +dqdiv746 divide -1 -0 -> Infinity Division_by_zero +dqdiv747 divide 1 0 -> Infinity Division_by_zero +dqdiv748 divide 1 -0 -> -Infinity Division_by_zero + +dqdiv751 divide 0.0 -1 -> -0.0 +dqdiv752 divide -0.0 -1 -> 0.0 +dqdiv753 divide 0.0 1 -> 0.0 +dqdiv754 divide -0.0 1 -> -0.0 +dqdiv755 divide -1.0 0 -> -Infinity Division_by_zero +dqdiv756 divide -1.0 -0 -> Infinity Division_by_zero +dqdiv757 divide 1.0 0 -> Infinity Division_by_zero +dqdiv758 divide 1.0 -0 -> -Infinity Division_by_zero + +dqdiv761 divide 0 -1.0 -> -0E+1 +dqdiv762 divide -0 -1.0 -> 0E+1 +dqdiv763 divide 0 1.0 -> 0E+1 +dqdiv764 divide -0 1.0 -> -0E+1 +dqdiv765 divide -1 0.0 -> -Infinity Division_by_zero +dqdiv766 divide -1 -0.0 -> Infinity Division_by_zero +dqdiv767 divide 1 0.0 -> Infinity Division_by_zero +dqdiv768 divide 1 -0.0 -> -Infinity Division_by_zero + +dqdiv771 divide 0.0 -1.0 -> -0 +dqdiv772 divide -0.0 -1.0 -> 0 +dqdiv773 divide 0.0 1.0 -> 0 +dqdiv774 divide -0.0 1.0 -> -0 +dqdiv775 divide -1.0 0.0 -> -Infinity Division_by_zero +dqdiv776 divide -1.0 -0.0 -> Infinity Division_by_zero +dqdiv777 divide 1.0 0.0 -> Infinity Division_by_zero +dqdiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +dqdiv780 divide Inf -Inf -> NaN Invalid_operation +dqdiv781 divide Inf -1000 -> -Infinity +dqdiv782 divide Inf -1 -> -Infinity +dqdiv783 divide Inf -0 -> -Infinity +dqdiv784 divide Inf 0 -> Infinity +dqdiv785 divide Inf 1 -> Infinity +dqdiv786 divide Inf 1000 -> Infinity +dqdiv787 divide Inf Inf -> NaN Invalid_operation +dqdiv788 divide -1000 Inf -> -0E-6176 Clamped +dqdiv789 divide -Inf Inf -> NaN Invalid_operation +dqdiv790 divide -1 Inf -> -0E-6176 Clamped +dqdiv791 divide -0 Inf -> -0E-6176 Clamped +dqdiv792 divide 0 Inf -> 0E-6176 Clamped +dqdiv793 divide 1 Inf -> 0E-6176 Clamped +dqdiv794 divide 1000 Inf -> 0E-6176 Clamped +dqdiv795 divide Inf Inf -> NaN Invalid_operation + +dqdiv800 divide -Inf -Inf -> NaN Invalid_operation +dqdiv801 divide -Inf -1000 -> Infinity +dqdiv802 divide -Inf -1 -> Infinity +dqdiv803 divide -Inf -0 -> Infinity +dqdiv804 divide -Inf 0 -> -Infinity +dqdiv805 divide -Inf 1 -> -Infinity +dqdiv806 divide -Inf 1000 -> -Infinity +dqdiv807 divide -Inf Inf -> NaN Invalid_operation +dqdiv808 divide -1000 Inf -> -0E-6176 Clamped +dqdiv809 divide -Inf -Inf -> NaN Invalid_operation +dqdiv810 divide -1 -Inf -> 0E-6176 Clamped +dqdiv811 divide -0 -Inf -> 0E-6176 Clamped +dqdiv812 divide 0 -Inf -> -0E-6176 Clamped +dqdiv813 divide 1 -Inf -> -0E-6176 Clamped +dqdiv814 divide 1000 -Inf -> -0E-6176 Clamped +dqdiv815 divide Inf -Inf -> NaN Invalid_operation + +dqdiv821 divide NaN -Inf -> NaN +dqdiv822 divide NaN -1000 -> NaN +dqdiv823 divide NaN -1 -> NaN +dqdiv824 divide NaN -0 -> NaN +dqdiv825 divide NaN 0 -> NaN +dqdiv826 divide NaN 1 -> NaN +dqdiv827 divide NaN 1000 -> NaN +dqdiv828 divide NaN Inf -> NaN +dqdiv829 divide NaN NaN -> NaN +dqdiv830 divide -Inf NaN -> NaN +dqdiv831 divide -1000 NaN -> NaN +dqdiv832 divide -1 NaN -> NaN +dqdiv833 divide -0 NaN -> NaN +dqdiv834 divide 0 NaN -> NaN +dqdiv835 divide 1 NaN -> NaN +dqdiv836 divide 1000 NaN -> NaN +dqdiv837 divide Inf NaN -> NaN + +dqdiv841 divide sNaN -Inf -> NaN Invalid_operation +dqdiv842 divide sNaN -1000 -> NaN Invalid_operation +dqdiv843 divide sNaN -1 -> NaN Invalid_operation +dqdiv844 divide sNaN -0 -> NaN Invalid_operation +dqdiv845 divide sNaN 0 -> NaN Invalid_operation +dqdiv846 divide sNaN 1 -> NaN Invalid_operation +dqdiv847 divide sNaN 1000 -> NaN Invalid_operation +dqdiv848 divide sNaN NaN -> NaN Invalid_operation +dqdiv849 divide sNaN sNaN -> NaN Invalid_operation +dqdiv850 divide NaN sNaN -> NaN Invalid_operation +dqdiv851 divide -Inf sNaN -> NaN Invalid_operation +dqdiv852 divide -1000 sNaN -> NaN Invalid_operation +dqdiv853 divide -1 sNaN -> NaN Invalid_operation +dqdiv854 divide -0 sNaN -> NaN Invalid_operation +dqdiv855 divide 0 sNaN -> NaN Invalid_operation +dqdiv856 divide 1 sNaN -> NaN Invalid_operation +dqdiv857 divide 1000 sNaN -> NaN Invalid_operation +dqdiv858 divide Inf sNaN -> NaN Invalid_operation +dqdiv859 divide NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqdiv861 divide NaN9 -Inf -> NaN9 +dqdiv862 divide NaN8 1000 -> NaN8 +dqdiv863 divide NaN7 Inf -> NaN7 +dqdiv864 divide NaN6 NaN5 -> NaN6 +dqdiv865 divide -Inf NaN4 -> NaN4 +dqdiv866 divide -1000 NaN3 -> NaN3 +dqdiv867 divide Inf NaN2 -> NaN2 + +dqdiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation +dqdiv872 divide sNaN98 -1 -> NaN98 Invalid_operation +dqdiv873 divide sNaN97 NaN -> NaN97 Invalid_operation +dqdiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation +dqdiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation +dqdiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation +dqdiv877 divide 0 sNaN91 -> NaN91 Invalid_operation +dqdiv878 divide Inf sNaN90 -> NaN90 Invalid_operation +dqdiv879 divide NaN sNaN89 -> NaN89 Invalid_operation + +dqdiv881 divide -NaN9 -Inf -> -NaN9 +dqdiv882 divide -NaN8 1000 -> -NaN8 +dqdiv883 divide -NaN7 Inf -> -NaN7 +dqdiv884 divide -NaN6 -NaN5 -> -NaN6 +dqdiv885 divide -Inf -NaN4 -> -NaN4 +dqdiv886 divide -1000 -NaN3 -> -NaN3 +dqdiv887 divide Inf -NaN2 -> -NaN2 + +dqdiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation +dqdiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation +dqdiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation +dqdiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation +dqdiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation +dqdiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation +dqdiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation +dqdiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation +dqdiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation + +-- Various flavours of divide by 0 +dqdiv901 divide 0 0 -> NaN Division_undefined +dqdiv902 divide 0.0E5 0 -> NaN Division_undefined +dqdiv903 divide 0.000 0 -> NaN Division_undefined +dqdiv904 divide 0.0001 0 -> Infinity Division_by_zero +dqdiv905 divide 0.01 0 -> Infinity Division_by_zero +dqdiv906 divide 0.1 0 -> Infinity Division_by_zero +dqdiv907 divide 1 0 -> Infinity Division_by_zero +dqdiv908 divide 1 0.0 -> Infinity Division_by_zero +dqdiv909 divide 10 0.0 -> Infinity Division_by_zero +dqdiv910 divide 1E+100 0.0 -> Infinity Division_by_zero +dqdiv911 divide 1E+100 0 -> Infinity Division_by_zero + +dqdiv921 divide -0.0001 0 -> -Infinity Division_by_zero +dqdiv922 divide -0.01 0 -> -Infinity Division_by_zero +dqdiv923 divide -0.1 0 -> -Infinity Division_by_zero +dqdiv924 divide -1 0 -> -Infinity Division_by_zero +dqdiv925 divide -1 0.0 -> -Infinity Division_by_zero +dqdiv926 divide -10 0.0 -> -Infinity Division_by_zero +dqdiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero +dqdiv928 divide -1E+100 0 -> -Infinity Division_by_zero + +dqdiv931 divide 0.0001 -0 -> -Infinity Division_by_zero +dqdiv932 divide 0.01 -0 -> -Infinity Division_by_zero +dqdiv933 divide 0.1 -0 -> -Infinity Division_by_zero +dqdiv934 divide 1 -0 -> -Infinity Division_by_zero +dqdiv935 divide 1 -0.0 -> -Infinity Division_by_zero +dqdiv936 divide 10 -0.0 -> -Infinity Division_by_zero +dqdiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero +dqdiv938 divide 1E+100 -0 -> -Infinity Division_by_zero + +dqdiv941 divide -0.0001 -0 -> Infinity Division_by_zero +dqdiv942 divide -0.01 -0 -> Infinity Division_by_zero +dqdiv943 divide -0.1 -0 -> Infinity Division_by_zero +dqdiv944 divide -1 -0 -> Infinity Division_by_zero +dqdiv945 divide -1 -0.0 -> Infinity Division_by_zero +dqdiv946 divide -10 -0.0 -> Infinity Division_by_zero +dqdiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero +dqdiv948 divide -1E+100 -0 -> Infinity Division_by_zero + +-- Examples from SQL proposal (Krishna Kulkarni) +dqdiv1021 divide 1E0 1E0 -> 1 +dqdiv1022 divide 1E0 2E0 -> 0.5 +dqdiv1023 divide 1E0 3E0 -> 0.3333333333333333333333333333333333 Inexact Rounded +dqdiv1024 divide 100E-2 1000E-3 -> 1 +dqdiv1025 divide 24E-1 2E0 -> 1.2 +dqdiv1026 divide 2400E-3 2E0 -> 1.200 +dqdiv1027 divide 5E0 2E0 -> 2.5 +dqdiv1028 divide 5E0 20E-1 -> 2.5 +dqdiv1029 divide 5E0 2000E-3 -> 2.5 +dqdiv1030 divide 5E0 2E-1 -> 25 +dqdiv1031 divide 5E0 20E-2 -> 25 +dqdiv1032 divide 480E-2 3E0 -> 1.60 +dqdiv1033 divide 47E-1 2E0 -> 2.35 + +-- ECMAScript bad examples +rounding: half_down +dqdiv1040 divide 5 9 -> 0.5555555555555555555555555555555556 Inexact Rounded +rounding: half_even +dqdiv1041 divide 6 11 -> 0.5454545454545454545454545454545455 Inexact Rounded + +-- Gyuris example +dqdiv1050 divide 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0.9999999999999999999999999999991254 Inexact Rounded + +-- overflow and underflow tests .. note subnormal results +-- signs +dqdiv1751 divide 1e+4277 1e-3311 -> Infinity Overflow Inexact Rounded +dqdiv1752 divide 1e+4277 -1e-3311 -> -Infinity Overflow Inexact Rounded +dqdiv1753 divide -1e+4277 1e-3311 -> -Infinity Overflow Inexact Rounded +dqdiv1754 divide -1e+4277 -1e-3311 -> Infinity Overflow Inexact Rounded +dqdiv1755 divide 1e-4277 1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1756 divide 1e-4277 -1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1757 divide -1e-4277 1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1758 divide -1e-4277 -1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +dqdiv1760 divide 1e-6069 1e+101 -> 1E-6170 Subnormal +dqdiv1761 divide 1e-6069 1e+102 -> 1E-6171 Subnormal +dqdiv1762 divide 1e-6069 1e+103 -> 1E-6172 Subnormal +dqdiv1763 divide 1e-6069 1e+104 -> 1E-6173 Subnormal +dqdiv1764 divide 1e-6069 1e+105 -> 1E-6174 Subnormal +dqdiv1765 divide 1e-6069 1e+106 -> 1E-6175 Subnormal +dqdiv1766 divide 1e-6069 1e+107 -> 1E-6176 Subnormal +dqdiv1767 divide 1e-6069 1e+108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1768 divide 1e-6069 1e+109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1769 divide 1e-6069 1e+110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +dqdiv1770 divide 1e+40 1e-6101 -> 1.000000000000000000000000000000E+6141 Clamped +dqdiv1771 divide 1e+40 1e-6102 -> 1.0000000000000000000000000000000E+6142 Clamped +dqdiv1772 divide 1e+40 1e-6103 -> 1.00000000000000000000000000000000E+6143 Clamped +dqdiv1773 divide 1e+40 1e-6104 -> 1.000000000000000000000000000000000E+6144 Clamped +dqdiv1774 divide 1e+40 1e-6105 -> Infinity Overflow Inexact Rounded +dqdiv1775 divide 1e+40 1e-6106 -> Infinity Overflow Inexact Rounded +dqdiv1776 divide 1e+40 1e-6107 -> Infinity Overflow Inexact Rounded +dqdiv1777 divide 1e+40 1e-6108 -> Infinity Overflow Inexact Rounded +dqdiv1778 divide 1e+40 1e-6109 -> Infinity Overflow Inexact Rounded +dqdiv1779 divide 1e+40 1e-6110 -> Infinity Overflow Inexact Rounded + +dqdiv1801 divide 1.0000E-6172 1 -> 1.0000E-6172 Subnormal +dqdiv1802 divide 1.000E-6172 1e+1 -> 1.000E-6173 Subnormal +dqdiv1803 divide 1.00E-6172 1e+2 -> 1.00E-6174 Subnormal +dqdiv1804 divide 1.0E-6172 1e+3 -> 1.0E-6175 Subnormal +dqdiv1805 divide 1.0E-6172 1e+4 -> 1E-6176 Subnormal Rounded +dqdiv1806 divide 1.3E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1807 divide 1.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1808 divide 1.7E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1809 divide 2.3E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1810 divide 2.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1811 divide 2.7E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded +dqdiv1812 divide 1.49E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1813 divide 1.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1814 divide 1.51E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1815 divide 2.49E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1816 divide 2.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqdiv1817 divide 2.51E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded + +dqdiv1818 divide 1E-6172 1e+4 -> 1E-6176 Subnormal +dqdiv1819 divide 3E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1820 divide 5E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1821 divide 7E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1822 divide 9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1823 divide 9.9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded + +dqdiv1824 divide 1E-6172 -1e+4 -> -1E-6176 Subnormal +dqdiv1825 divide 3E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1826 divide -5E-6172 1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1827 divide 7E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1828 divide -9E-6172 1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1829 divide 9.9E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqdiv1830 divide 3.0E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped + +dqdiv1831 divide 1.0E-5977 1e+200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqdiv1832 divide 1.0E-5977 1e+199 -> 1E-6176 Subnormal Rounded +dqdiv1833 divide 1.0E-5977 1e+198 -> 1.0E-6175 Subnormal +dqdiv1834 divide 2.0E-5977 2e+198 -> 1.0E-6175 Subnormal +dqdiv1835 divide 4.0E-5977 4e+198 -> 1.0E-6175 Subnormal +dqdiv1836 divide 10.0E-5977 10e+198 -> 1.0E-6175 Subnormal +dqdiv1837 divide 30.0E-5977 30e+198 -> 1.0E-6175 Subnormal +dqdiv1838 divide 40.0E-5982 40e+166 -> 1.0E-6148 Subnormal +dqdiv1839 divide 40.0E-5982 40e+165 -> 1.0E-6147 Subnormal +dqdiv1840 divide 40.0E-5982 40e+164 -> 1.0E-6146 Subnormal + +-- randoms +rounding: half_even +dqdiv2010 divide -5231195652931651968034356117118850 -7243718664422548573203260970.34995 -> 722169.9095831284624736051460550680 Inexact Rounded +dqdiv2011 divide -89584669773927.82711237350022515352 -42077943728529635884.21142627532985 -> 0.000002129017291146471565928125887527266 Inexact Rounded +dqdiv2012 divide -2.828201693360723203806974891946180E-232 812596541221823960386384403089240.9 -> -3.480450075640521320040055759125120E-265 Inexact Rounded +dqdiv2013 divide -6442775372761069267502937539408720 24904085056.69185465145182606089196 -> -258703556388226463687701.4884719589 Inexact Rounded +dqdiv2014 divide 5.535520011272625629610079879714705 -44343664650.57203052003068113531208 -> -1.248322630728089308975940533493562E-10 Inexact Rounded +dqdiv2015 divide 65919273712517865964325.99419625010 -314733354141381737378622515.7789054 -> -0.0002094448295521490616379784758911632 Inexact Rounded +dqdiv2016 divide -7.779172568193197107115275140431129E+759 -140453015639.3988987652895178782143 -> 5.538629792161641534962774244238115E+748 Inexact Rounded +dqdiv2017 divide 644314832597569.0181226067518178797 -115024585257425.1635759521565201075 -> -5.601540150356479257367687450922795 Inexact Rounded +dqdiv2018 divide 6.898640941579611450676592553286870E-47 -11272429881407851485163914999.25943 -> -6.119923578285338689371137648319280E-75 Inexact Rounded +dqdiv2019 divide -3591344544888727133.30819750163254 5329395.423792795661446561090331037 -> -673874662941.1968525589460533725290 Inexact Rounded +dqdiv2020 divide -7.682356781384631313156462724425838E+747 -6.60375855512219057281922141809940E+703 -> 1.163330960279556016678379128875149E+44 Inexact Rounded +dqdiv2021 divide -4511495596596941820863224.274679699 3365395017.263329795449661616090724 -> -1340554548115304.904166888018346299 Inexact Rounded +dqdiv2022 divide 5.211164127840931517263639608151299 164.5566381356276567012533847006453 -> 0.03166790587655228864478260157156510 Inexact Rounded +dqdiv2023 divide -49891.2243893458830384077684620383 -47179.9312961860747554053371171530 -> 1.057467084386767291602189656430268 Inexact Rounded +dqdiv2024 divide 15065477.47214268488077415462413353 4366211.120892953261309529740552596 -> 3.450469309661227984244545513441359 Inexact Rounded +dqdiv2025 divide 1.575670269440761846109602429612644E+370 653199649324740300.006185482643439 -> 2.412233795700359170904588548041481E+352 Inexact Rounded +dqdiv2026 divide -2112422311733448924573432192.620145 -80067206.03590693153848215848613406 -> 26383115089417660175.20102646756574 Inexact Rounded +dqdiv2027 divide -67096536051279809.32218611548721839 -869685412881941081664251990181.1049 -> 7.715035236584805921278566365231168E-14 Inexact Rounded +dqdiv2028 divide -58612908548962047.21866913425488972 -978449597531.3873665583475633831644 -> 59903.86085991703091236507859837023 Inexact Rounded +dqdiv2029 divide -133032412010942.1476864138213319796 -7.882059293498670705446528648201359E-428 -> 1.687787506504433064549515681693715E+441 Inexact Rounded +dqdiv2030 divide 1.83746698338966029492299716360513E+977 -9.897926608979649951672839879128603E+154 -> -1.856416051542212552042390218062458E+822 Inexact Rounded +dqdiv2031 divide -113742475841399236307128962.1507063 8298602.203049834732657567965262989 -> -13706221006665137826.16557393919929 Inexact Rounded +dqdiv2032 divide 196.4787574650754152995941808331862 929.6553388472318094427422117172394 -> 0.2113458066176526651006917922814018 Inexact Rounded +dqdiv2033 divide 71931221465.43867996282803628130350 3838685934206426257090718.402248853 -> 1.873850132527423413607199513324021E-14 Inexact Rounded +dqdiv2034 divide 488.4282502289651653783596246312885 -80.68940956806634280078706577953188 -> -6.053189047280693318844801899473272 Inexact Rounded +dqdiv2035 divide 9.001764344963921754981762913247394E-162 -8.585540973667205753734967645386919E-729 -> -1.048479574271827326396012573232934E+567 Inexact Rounded +dqdiv2036 divide -7.404133959409894743706402857145471E-828 -51.38159929460289711134684843086265 -> 1.441008855516029461032061785219773E-829 Inexact Rounded +dqdiv2037 divide 2.967520235574419794048994436040717E-613 -6252513855.91394894949879262731889 -> -4.746123405656409127572998751885338E-623 Inexact Rounded +dqdiv2038 divide -18826852654824040505.83920366765051 -6336924877942437992590557460147340 -> 2.970976146546494669807886278519194E-15 Inexact Rounded +dqdiv2039 divide -8.101406784809197604949584001735949E+561 4.823300306948942821076681658771635E+361 -> -1.679639721610839204738445747238987E+200 Inexact Rounded +dqdiv2040 divide -6.11981977773094052331062585191723E+295 1.507610253755339328302779005586534E+238 -> -4.059285058911577244044418416044763E+57 Inexact Rounded +dqdiv2041 divide 6.472638850046815880599220534274055E-596 -4.475233712083047516933911786159972 -> -1.446324207062261745520496475778879E-596 Inexact Rounded +dqdiv2042 divide -84438593330.71277839631144509397112 -586684596204401664208947.4054879633 -> 1.439250218550041228759983937772504E-13 Inexact Rounded +dqdiv2043 divide 9.354533233294022616695815656704369E-24 405.500390626135304252144163591746 -> 2.306911028827774549740571229736198E-26 Inexact Rounded +dqdiv2044 divide 985606423350210.7374876650149957881 -36811563697.41925681866694859828794 -> -26774.36990864119445335813354717711 Inexact Rounded +dqdiv2045 divide -8.187280774177715706278002247766311E-123 -38784124393.91212870828430001300068 -> 2.110987653356139147357240727794365E-133 Inexact Rounded +dqdiv2046 divide -4.612203126350070903459245798371657E+912 7.971562182727956290901984736800519E+64 -> -5.785820922708683237098826662769748E+847 Inexact Rounded +dqdiv2047 divide 4.661015909421485298247928967977089E+888 -6.360911253323922338737311563845581E+388 -> -7.327591478321365980156654539638836E+499 Inexact Rounded +dqdiv2048 divide 9156078172903.257500003260710833030 7.189796653262147139071634237964074E-90 -> 1.273482215766000994365201545096026E+102 Inexact Rounded +dqdiv2049 divide -1.710722303327476586373477781276586E-311 -3167561628260156837329323.729380695 -> 5.400754599578613984875752958645655E-336 Inexact Rounded +dqdiv2050 divide -4.647935210881806238321616345413021E-878 209388.5431867744648177308460639582 -> -2.219765771394593733140494297388140E-883 Inexact Rounded +dqdiv2051 divide 5958.694728395760992719084781582700 4.541510156564315632536353171846096E-746 -> 1.312051393253638664947852693005480E+749 Inexact Rounded +dqdiv2052 divide -7.935732544649702175256699886872093E-489 -7.433329073664793138998765647467971E+360 -> 1.067587949626076917672271619664656E-849 Inexact Rounded +dqdiv2053 divide -2746650864601157.863589959939901350 7.016684945507647528907184694359598E+548 -> -3.914456593009309529351254950429932E-534 Inexact Rounded +dqdiv2054 divide 3605149408631197365447953.994569178 -75614025825649082.78264864428237833 -> -47678315.88472693507060063188020532 Inexact Rounded +dqdiv2055 divide 788194320921798404906375214.196349 -6.222718148433247384932573401976337E-418 -> -1.266639918634671803982222244977287E+444 Inexact Rounded +dqdiv2056 divide 5620722730534752.758208943447603211 6.843552841168538319123000917657759E-139 -> 8.213164800485434666629970443739554E+153 Inexact Rounded +dqdiv2057 divide 7304534676713703938102.403949019402 -576169.3685010935108153023803590835 -> -12677756014201995.31969237144394772 Inexact Rounded +dqdiv2058 divide 8067918762.134621639254916786945547 -8.774771480055536009105596163864758E+954 -> -9.194448858836332156766764605125245E-946 Inexact Rounded +dqdiv2059 divide 8.702093454123046507578256899537563E-324 -5.875399733016018404580201176576293E-401 -> -1.481106622452052581470443526957335E+77 Inexact Rounded +dqdiv2060 divide -41426.01662518451861386352415092356 90.00146621684478300510769802013464 -> -460.2815750287318692732067709176200 Inexact Rounded + +-- random divide tests with result near 1 +dqdiv4001 divide 2003100352770753969878925664524900 2003100352770753969878925664497824 -> 1.000000000000000000000000000013517 Inexact Rounded +dqdiv4002 divide 4817785793916490652579552318371645 4817785793916490652579552318362097 -> 1.000000000000000000000000000001982 Inexact Rounded +dqdiv4003 divide 8299187410920067325648068439560282 8299187410920067325648068439591159 -> 0.9999999999999999999999999999962795 Inexact Rounded +dqdiv4004 divide 5641088455897407044544461785365899 5641088455897407044544461785389965 -> 0.9999999999999999999999999999957338 Inexact Rounded +dqdiv4005 divide 5752274694706545359326361313490424 5752274694706545359326361313502723 -> 0.9999999999999999999999999999978619 Inexact Rounded +dqdiv4006 divide 6762079477373670594829319346099665 6762079477373670594829319346132579 -> 0.9999999999999999999999999999951326 Inexact Rounded +dqdiv4007 divide 7286425153691890341633023222602916 7286425153691890341633023222606556 -> 0.9999999999999999999999999999995004 Inexact Rounded +dqdiv4008 divide 9481233991901305727648306421946655 9481233991901305727648306421919124 -> 1.000000000000000000000000000002904 Inexact Rounded +dqdiv4009 divide 4282053941893951742029444065614311 4282053941893951742029444065583077 -> 1.000000000000000000000000000007294 Inexact Rounded +dqdiv4010 divide 626888225441250639741781850338695 626888225441250639741781850327299 -> 1.000000000000000000000000000018179 Inexact Rounded +dqdiv4011 divide 3860973649222028009456598604468547 3860973649222028009456598604476849 -> 0.9999999999999999999999999999978498 Inexact Rounded +dqdiv4012 divide 4753157080127468127908060607821839 4753157080127468127908060607788379 -> 1.000000000000000000000000000007040 Inexact Rounded +dqdiv4013 divide 552448546203754062805706277880419 552448546203754062805706277881903 -> 0.9999999999999999999999999999973138 Inexact Rounded +dqdiv4014 divide 8405954527952158455323713728917395 8405954527952158455323713728933866 -> 0.9999999999999999999999999999980406 Inexact Rounded +dqdiv4015 divide 7554096502235321142555802238016116 7554096502235321142555802238026546 -> 0.9999999999999999999999999999986193 Inexact Rounded +dqdiv4016 divide 4053257674127518606871054934746782 4053257674127518606871054934767355 -> 0.9999999999999999999999999999949243 Inexact Rounded +dqdiv4017 divide 7112419420755090454716888844011582 7112419420755090454716888844038105 -> 0.9999999999999999999999999999962709 Inexact Rounded +dqdiv4018 divide 3132302137520072728164549730911846 3132302137520072728164549730908416 -> 1.000000000000000000000000000001095 Inexact Rounded +dqdiv4019 divide 4788374045841416355706715048161013 4788374045841416355706715048190077 -> 0.9999999999999999999999999999939303 Inexact Rounded +dqdiv4020 divide 9466021636047630218238075099510597 9466021636047630218238075099484053 -> 1.000000000000000000000000000002804 Inexact Rounded +dqdiv4021 divide 912742745646765625597399692138650 912742745646765625597399692139042 -> 0.9999999999999999999999999999995705 Inexact Rounded +dqdiv4022 divide 9508402742933643208806264897188504 9508402742933643208806264897195973 -> 0.9999999999999999999999999999992145 Inexact Rounded +dqdiv4023 divide 1186956795727233704962361914360895 1186956795727233704962361914329577 -> 1.000000000000000000000000000026385 Inexact Rounded +dqdiv4024 divide 5972210268839014812696916170967938 5972210268839014812696916170954974 -> 1.000000000000000000000000000002171 Inexact Rounded +dqdiv4025 divide 2303801625521619930894460139793140 2303801625521619930894460139799643 -> 0.9999999999999999999999999999971773 Inexact Rounded +dqdiv4026 divide 6022231560002898264777393473966595 6022231560002898264777393473947198 -> 1.000000000000000000000000000003221 Inexact Rounded +dqdiv4027 divide 8426148335801396199969346032210893 8426148335801396199969346032203179 -> 1.000000000000000000000000000000915 Inexact Rounded +dqdiv4028 divide 8812278947028784637382847098411749 8812278947028784637382847098385317 -> 1.000000000000000000000000000002999 Inexact Rounded +dqdiv4029 divide 8145282002348367383264197170116146 8145282002348367383264197170083988 -> 1.000000000000000000000000000003948 Inexact Rounded +dqdiv4030 divide 6821577571876840153123510107387026 6821577571876840153123510107418008 -> 0.9999999999999999999999999999954582 Inexact Rounded +dqdiv4031 divide 9018555319518966970480565482023720 9018555319518966970480565482013346 -> 1.000000000000000000000000000001150 Inexact Rounded +dqdiv4032 divide 4602155712998228449640717252788864 4602155712998228449640717252818502 -> 0.9999999999999999999999999999935600 Inexact Rounded +dqdiv4033 divide 6675607481522785614506828292264472 6675607481522785614506828292277100 -> 0.9999999999999999999999999999981083 Inexact Rounded +dqdiv4034 divide 4015881516871833897766945836264472 4015881516871833897766945836262645 -> 1.000000000000000000000000000000455 Inexact Rounded +dqdiv4035 divide 1415580205933411837595459716910365 1415580205933411837595459716880139 -> 1.000000000000000000000000000021352 Inexact Rounded +dqdiv4036 divide 9432968297069542816752035276361552 9432968297069542816752035276353054 -> 1.000000000000000000000000000000901 Inexact Rounded +dqdiv4037 divide 4799319591303848500532766682140658 4799319591303848500532766682172655 -> 0.9999999999999999999999999999933330 Inexact Rounded +dqdiv4038 divide 316854270732839529790584284987472 316854270732839529790584285004832 -> 0.9999999999999999999999999999452114 Inexact Rounded +dqdiv4039 divide 3598981300592490427826027975697415 3598981300592490427826027975686712 -> 1.000000000000000000000000000002974 Inexact Rounded +dqdiv4040 divide 1664315435694461371155800682196520 1664315435694461371155800682195617 -> 1.000000000000000000000000000000543 Inexact Rounded +dqdiv4041 divide 1680872316531128890102855316510581 1680872316531128890102855316495545 -> 1.000000000000000000000000000008945 Inexact Rounded +dqdiv4042 divide 9881274879566405475755499281644730 9881274879566405475755499281615743 -> 1.000000000000000000000000000002934 Inexact Rounded +dqdiv4043 divide 4737225957717466960447204232279216 4737225957717466960447204232277452 -> 1.000000000000000000000000000000372 Inexact Rounded +dqdiv4044 divide 2482097379414867061213319346418288 2482097379414867061213319346387936 -> 1.000000000000000000000000000012228 Inexact Rounded +dqdiv4045 divide 7406977595233762723576434122161868 7406977595233762723576434122189042 -> 0.9999999999999999999999999999963313 Inexact Rounded +dqdiv4046 divide 228782057757566047086593281773577 228782057757566047086593281769727 -> 1.000000000000000000000000000016828 Inexact Rounded +dqdiv4047 divide 2956594270240579648823270540367653 2956594270240579648823270540368556 -> 0.9999999999999999999999999999996946 Inexact Rounded +dqdiv4048 divide 6326964098897620620534136767634340 6326964098897620620534136767619339 -> 1.000000000000000000000000000002371 Inexact Rounded +dqdiv4049 divide 414586440456590215247002678327800 414586440456590215247002678316922 -> 1.000000000000000000000000000026238 Inexact Rounded +dqdiv4050 divide 7364552208570039386220505636779125 7364552208570039386220505636803548 -> 0.9999999999999999999999999999966837 Inexact Rounded +dqdiv4051 divide 5626266749902369710022824950590056 5626266749902369710022824950591008 -> 0.9999999999999999999999999999998308 Inexact Rounded +dqdiv4052 divide 4863278293916197454987481343460484 4863278293916197454987481343442522 -> 1.000000000000000000000000000003693 Inexact Rounded +dqdiv4053 divide 1170713582030637359713249796835483 1170713582030637359713249796823345 -> 1.000000000000000000000000000010368 Inexact Rounded +dqdiv4054 divide 9838062494725965667776326556052931 9838062494725965667776326556061002 -> 0.9999999999999999999999999999991796 Inexact Rounded +dqdiv4055 divide 4071388731298861093005687091498922 4071388731298861093005687091498278 -> 1.000000000000000000000000000000158 Inexact Rounded +dqdiv4056 divide 8753155722324706795855038590272526 8753155722324706795855038590276656 -> 0.9999999999999999999999999999995282 Inexact Rounded +dqdiv4057 divide 4399941911533273418844742658240485 4399941911533273418844742658219891 -> 1.000000000000000000000000000004681 Inexact Rounded +dqdiv4058 divide 4127884159949503677776430620050269 4127884159949503677776430620026091 -> 1.000000000000000000000000000005857 Inexact Rounded +dqdiv4059 divide 5536160822360800067042528317438808 5536160822360800067042528317450687 -> 0.9999999999999999999999999999978543 Inexact Rounded +dqdiv4060 divide 3973234998468664936671088237710246 3973234998468664936671088237741886 -> 0.9999999999999999999999999999920367 Inexact Rounded +dqdiv4061 divide 9824855935638263593410444142327358 9824855935638263593410444142328576 -> 0.9999999999999999999999999999998760 Inexact Rounded +dqdiv4062 divide 5917078517340218131867327300814867 5917078517340218131867327300788701 -> 1.000000000000000000000000000004422 Inexact Rounded +dqdiv4063 divide 4354236601830544882286139612521362 4354236601830544882286139612543223 -> 0.9999999999999999999999999999949794 Inexact Rounded +dqdiv4064 divide 8058474772375259017342110013891294 8058474772375259017342110013906792 -> 0.9999999999999999999999999999980768 Inexact Rounded +dqdiv4065 divide 5519604020981748170517093746166328 5519604020981748170517093746181763 -> 0.9999999999999999999999999999972036 Inexact Rounded +dqdiv4066 divide 1502130966879805458831323782443139 1502130966879805458831323782412213 -> 1.000000000000000000000000000020588 Inexact Rounded +dqdiv4067 divide 562795633719481212915159787980270 562795633719481212915159788007066 -> 0.9999999999999999999999999999523877 Inexact Rounded +dqdiv4068 divide 6584743324494664273941281557268878 6584743324494664273941281557258945 -> 1.000000000000000000000000000001508 Inexact Rounded +dqdiv4069 divide 3632000327285743997976431109416500 3632000327285743997976431109408107 -> 1.000000000000000000000000000002311 Inexact Rounded +dqdiv4070 divide 1145827237315430089388953838561450 1145827237315430089388953838527332 -> 1.000000000000000000000000000029776 Inexact Rounded +dqdiv4071 divide 8874431010357691869725372317350380 8874431010357691869725372317316472 -> 1.000000000000000000000000000003821 Inexact Rounded +dqdiv4072 divide 992948718902804648119753141202196 992948718902804648119753141235222 -> 0.9999999999999999999999999999667395 Inexact Rounded +dqdiv4073 divide 2522735183374218505142417265439989 2522735183374218505142417265453779 -> 0.9999999999999999999999999999945337 Inexact Rounded +dqdiv4074 divide 2668419161912936508006872303501052 2668419161912936508006872303471036 -> 1.000000000000000000000000000011249 Inexact Rounded +dqdiv4075 divide 3036169085665186712590941111775092 3036169085665186712590941111808846 -> 0.9999999999999999999999999999888827 Inexact Rounded +dqdiv4076 divide 9441634604917231638508898934006147 9441634604917231638508898934000288 -> 1.000000000000000000000000000000621 Inexact Rounded +dqdiv4077 divide 2677301353164377091111458811839190 2677301353164377091111458811867722 -> 0.9999999999999999999999999999893430 Inexact Rounded +dqdiv4078 divide 6844979203112066166583765857171426 6844979203112066166583765857189682 -> 0.9999999999999999999999999999973329 Inexact Rounded +dqdiv4079 divide 2220337435141796724323783960231661 2220337435141796724323783960208778 -> 1.000000000000000000000000000010306 Inexact Rounded +dqdiv4080 divide 6447424700019783931569996989561380 6447424700019783931569996989572454 -> 0.9999999999999999999999999999982824 Inexact Rounded +dqdiv4081 divide 7512856762696607119847092195587180 7512856762696607119847092195557346 -> 1.000000000000000000000000000003971 Inexact Rounded +dqdiv4082 divide 7395261981193960399087819077237482 7395261981193960399087819077242487 -> 0.9999999999999999999999999999993232 Inexact Rounded +dqdiv4083 divide 2253442467682584035792724884376735 2253442467682584035792724884407178 -> 0.9999999999999999999999999999864904 Inexact Rounded +dqdiv4084 divide 8153138680300213135577336466190997 8153138680300213135577336466220607 -> 0.9999999999999999999999999999963683 Inexact Rounded +dqdiv4085 divide 4668731252254148074041022681801390 4668731252254148074041022681778101 -> 1.000000000000000000000000000004988 Inexact Rounded +dqdiv4086 divide 6078404557993669696040425501815056 6078404557993669696040425501797612 -> 1.000000000000000000000000000002870 Inexact Rounded +dqdiv4087 divide 2306352359874261623223356878316278 2306352359874261623223356878335612 -> 0.9999999999999999999999999999916171 Inexact Rounded +dqdiv4088 divide 3264842186668480362900909564091908 3264842186668480362900909564058658 -> 1.000000000000000000000000000010184 Inexact Rounded +dqdiv4089 divide 6971985047279636878957959608612204 6971985047279636878957959608615088 -> 0.9999999999999999999999999999995863 Inexact Rounded +dqdiv4090 divide 5262810889952721235466445973816257 5262810889952721235466445973783077 -> 1.000000000000000000000000000006305 Inexact Rounded +dqdiv4091 divide 7947944731035267178548357070080288 7947944731035267178548357070061339 -> 1.000000000000000000000000000002384 Inexact Rounded +dqdiv4092 divide 5071808908395375108383035800443229 5071808908395375108383035800412429 -> 1.000000000000000000000000000006073 Inexact Rounded +dqdiv4093 divide 2043146542084503655511507209262969 2043146542084503655511507209249263 -> 1.000000000000000000000000000006708 Inexact Rounded +dqdiv4094 divide 4097632735384534181661959731264802 4097632735384534181661959731234499 -> 1.000000000000000000000000000007395 Inexact Rounded +dqdiv4095 divide 3061477642831387489729464587044430 3061477642831387489729464587059452 -> 0.9999999999999999999999999999950932 Inexact Rounded +dqdiv4096 divide 3429854941039776159498802936252638 3429854941039776159498802936246415 -> 1.000000000000000000000000000001814 Inexact Rounded +dqdiv4097 divide 4874324979578599700024133278284545 4874324979578599700024133278262131 -> 1.000000000000000000000000000004598 Inexact Rounded +dqdiv4098 divide 5701652369691833541455978515820882 5701652369691833541455978515834854 -> 0.9999999999999999999999999999975495 Inexact Rounded +dqdiv4099 divide 2928205728402945266953255632343113 2928205728402945266953255632373794 -> 0.9999999999999999999999999999895223 Inexact Rounded + +-- Null tests +dqdiv9998 divide 10 # -> NaN Invalid_operation +dqdiv9999 divide # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqDivideInt.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqDivideInt.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,453 @@ +------------------------------------------------------------------------ +-- dqDivideInt.decTest -- decQuad integer division -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + + +dqdvi001 divideint 1 1 -> 1 +dqdvi002 divideint 2 1 -> 2 +dqdvi003 divideint 1 2 -> 0 +dqdvi004 divideint 2 2 -> 1 +dqdvi005 divideint 0 1 -> 0 +dqdvi006 divideint 0 2 -> 0 +dqdvi007 divideint 1 3 -> 0 +dqdvi008 divideint 2 3 -> 0 +dqdvi009 divideint 3 3 -> 1 + +dqdvi010 divideint 2.4 1 -> 2 +dqdvi011 divideint 2.4 -1 -> -2 +dqdvi012 divideint -2.4 1 -> -2 +dqdvi013 divideint -2.4 -1 -> 2 +dqdvi014 divideint 2.40 1 -> 2 +dqdvi015 divideint 2.400 1 -> 2 +dqdvi016 divideint 2.4 2 -> 1 +dqdvi017 divideint 2.400 2 -> 1 +dqdvi018 divideint 2. 2 -> 1 +dqdvi019 divideint 20 20 -> 1 + +dqdvi020 divideint 187 187 -> 1 +dqdvi021 divideint 5 2 -> 2 +dqdvi022 divideint 5 2.0 -> 2 +dqdvi023 divideint 5 2.000 -> 2 +dqdvi024 divideint 5 0.200 -> 25 +dqdvi025 divideint 5 0.200 -> 25 + +dqdvi030 divideint 1 2 -> 0 +dqdvi031 divideint 1 4 -> 0 +dqdvi032 divideint 1 8 -> 0 +dqdvi033 divideint 1 16 -> 0 +dqdvi034 divideint 1 32 -> 0 +dqdvi035 divideint 1 64 -> 0 +dqdvi040 divideint 1 -2 -> -0 +dqdvi041 divideint 1 -4 -> -0 +dqdvi042 divideint 1 -8 -> -0 +dqdvi043 divideint 1 -16 -> -0 +dqdvi044 divideint 1 -32 -> -0 +dqdvi045 divideint 1 -64 -> -0 +dqdvi050 divideint -1 2 -> -0 +dqdvi051 divideint -1 4 -> -0 +dqdvi052 divideint -1 8 -> -0 +dqdvi053 divideint -1 16 -> -0 +dqdvi054 divideint -1 32 -> -0 +dqdvi055 divideint -1 64 -> -0 +dqdvi060 divideint -1 -2 -> 0 +dqdvi061 divideint -1 -4 -> 0 +dqdvi062 divideint -1 -8 -> 0 +dqdvi063 divideint -1 -16 -> 0 +dqdvi064 divideint -1 -32 -> 0 +dqdvi065 divideint -1 -64 -> 0 + +-- similar with powers of ten +dqdvi160 divideint 1 1 -> 1 +dqdvi161 divideint 1 10 -> 0 +dqdvi162 divideint 1 100 -> 0 +dqdvi163 divideint 1 1000 -> 0 +dqdvi164 divideint 1 10000 -> 0 +dqdvi165 divideint 1 100000 -> 0 +dqdvi166 divideint 1 1000000 -> 0 +dqdvi167 divideint 1 10000000 -> 0 +dqdvi168 divideint 1 100000000 -> 0 +dqdvi170 divideint 1 -1 -> -1 +dqdvi171 divideint 1 -10 -> -0 +dqdvi172 divideint 1 -100 -> -0 +dqdvi173 divideint 1 -1000 -> -0 +dqdvi174 divideint 1 -10000 -> -0 +dqdvi175 divideint 1 -100000 -> -0 +dqdvi176 divideint 1 -1000000 -> -0 +dqdvi177 divideint 1 -10000000 -> -0 +dqdvi178 divideint 1 -100000000 -> -0 +dqdvi180 divideint -1 1 -> -1 +dqdvi181 divideint -1 10 -> -0 +dqdvi182 divideint -1 100 -> -0 +dqdvi183 divideint -1 1000 -> -0 +dqdvi184 divideint -1 10000 -> -0 +dqdvi185 divideint -1 100000 -> -0 +dqdvi186 divideint -1 1000000 -> -0 +dqdvi187 divideint -1 10000000 -> -0 +dqdvi188 divideint -1 100000000 -> -0 +dqdvi190 divideint -1 -1 -> 1 +dqdvi191 divideint -1 -10 -> 0 +dqdvi192 divideint -1 -100 -> 0 +dqdvi193 divideint -1 -1000 -> 0 +dqdvi194 divideint -1 -10000 -> 0 +dqdvi195 divideint -1 -100000 -> 0 +dqdvi196 divideint -1 -1000000 -> 0 +dqdvi197 divideint -1 -10000000 -> 0 +dqdvi198 divideint -1 -100000000 -> 0 + +-- some long operand (at p=9) cases +dqdvi070 divideint 999999999 1 -> 999999999 +dqdvi071 divideint 999999999.4 1 -> 999999999 +dqdvi072 divideint 999999999.5 1 -> 999999999 +dqdvi073 divideint 999999999.9 1 -> 999999999 +dqdvi074 divideint 999999999.999 1 -> 999999999 + +dqdvi090 divideint 0. 1 -> 0 +dqdvi091 divideint .0 1 -> 0 +dqdvi092 divideint 0.00 1 -> 0 +dqdvi093 divideint 0.00E+9 1 -> 0 +dqdvi094 divideint 0.0000E-50 1 -> 0 + +dqdvi100 divideint 1 1 -> 1 +dqdvi101 divideint 1 2 -> 0 +dqdvi102 divideint 1 3 -> 0 +dqdvi103 divideint 1 4 -> 0 +dqdvi104 divideint 1 5 -> 0 +dqdvi105 divideint 1 6 -> 0 +dqdvi106 divideint 1 7 -> 0 +dqdvi107 divideint 1 8 -> 0 +dqdvi108 divideint 1 9 -> 0 +dqdvi109 divideint 1 10 -> 0 +dqdvi110 divideint 1 1 -> 1 +dqdvi111 divideint 2 1 -> 2 +dqdvi112 divideint 3 1 -> 3 +dqdvi113 divideint 4 1 -> 4 +dqdvi114 divideint 5 1 -> 5 +dqdvi115 divideint 6 1 -> 6 +dqdvi116 divideint 7 1 -> 7 +dqdvi117 divideint 8 1 -> 8 +dqdvi118 divideint 9 1 -> 9 +dqdvi119 divideint 10 1 -> 10 + +-- from DiagBigDecimal +dqdvi131 divideint 101.3 1 -> 101 +dqdvi132 divideint 101.0 1 -> 101 +dqdvi133 divideint 101.3 3 -> 33 +dqdvi134 divideint 101.0 3 -> 33 +dqdvi135 divideint 2.4 1 -> 2 +dqdvi136 divideint 2.400 1 -> 2 +dqdvi137 divideint 18 18 -> 1 +dqdvi138 divideint 1120 1000 -> 1 +dqdvi139 divideint 2.4 2 -> 1 +dqdvi140 divideint 2.400 2 -> 1 +dqdvi141 divideint 0.5 2.000 -> 0 +dqdvi142 divideint 8.005 7 -> 1 +dqdvi143 divideint 5 2 -> 2 +dqdvi144 divideint 0 2 -> 0 +dqdvi145 divideint 0.00 2 -> 0 + +-- Others +dqdvi150 divideint 12345 4.999 -> 2469 +dqdvi151 divideint 12345 4.99 -> 2473 +dqdvi152 divideint 12345 4.9 -> 2519 +dqdvi153 divideint 12345 5 -> 2469 +dqdvi154 divideint 12345 5.1 -> 2420 +dqdvi155 divideint 12345 5.01 -> 2464 +dqdvi156 divideint 12345 5.001 -> 2468 +dqdvi157 divideint 101 7.6 -> 13 + +-- Various flavours of divideint by 0 +dqdvi201 divideint 0 0 -> NaN Division_undefined +dqdvi202 divideint 0.0E5 0 -> NaN Division_undefined +dqdvi203 divideint 0.000 0 -> NaN Division_undefined +dqdvi204 divideint 0.0001 0 -> Infinity Division_by_zero +dqdvi205 divideint 0.01 0 -> Infinity Division_by_zero +dqdvi206 divideint 0.1 0 -> Infinity Division_by_zero +dqdvi207 divideint 1 0 -> Infinity Division_by_zero +dqdvi208 divideint 1 0.0 -> Infinity Division_by_zero +dqdvi209 divideint 10 0.0 -> Infinity Division_by_zero +dqdvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero +dqdvi211 divideint 1E+380 0 -> Infinity Division_by_zero +dqdvi214 divideint -0.0001 0 -> -Infinity Division_by_zero +dqdvi215 divideint -0.01 0 -> -Infinity Division_by_zero +dqdvi216 divideint -0.1 0 -> -Infinity Division_by_zero +dqdvi217 divideint -1 0 -> -Infinity Division_by_zero +dqdvi218 divideint -1 0.0 -> -Infinity Division_by_zero +dqdvi219 divideint -10 0.0 -> -Infinity Division_by_zero +dqdvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero +dqdvi221 divideint -1E+380 0 -> -Infinity Division_by_zero + +-- test some cases that are close to exponent overflow +dqdvi270 divideint 1 1e384 -> 0 +dqdvi271 divideint 1 0.9e384 -> 0 +dqdvi272 divideint 1 0.99e384 -> 0 +dqdvi273 divideint 1 0.9999999999999999e384 -> 0 +dqdvi274 divideint 9e384 1 -> NaN Division_impossible +dqdvi275 divideint 9.9e384 1 -> NaN Division_impossible +dqdvi276 divideint 9.99e384 1 -> NaN Division_impossible +dqdvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible + +dqdvi280 divideint 0.1 9e-383 -> NaN Division_impossible +dqdvi281 divideint 0.1 99e-383 -> NaN Division_impossible +dqdvi282 divideint 0.1 999e-383 -> NaN Division_impossible +dqdvi283 divideint 0.1 9e-382 -> NaN Division_impossible +dqdvi284 divideint 0.1 99e-382 -> NaN Division_impossible + +-- GD edge cases: lhs smaller than rhs but more digits +dqdvi301 divideint 0.9 2 -> 0 +dqdvi302 divideint 0.9 2.0 -> 0 +dqdvi303 divideint 0.9 2.1 -> 0 +dqdvi304 divideint 0.9 2.00 -> 0 +dqdvi305 divideint 0.9 2.01 -> 0 +dqdvi306 divideint 0.12 1 -> 0 +dqdvi307 divideint 0.12 1.0 -> 0 +dqdvi308 divideint 0.12 1.00 -> 0 +dqdvi309 divideint 0.12 1.0 -> 0 +dqdvi310 divideint 0.12 1.00 -> 0 +dqdvi311 divideint 0.12 2 -> 0 +dqdvi312 divideint 0.12 2.0 -> 0 +dqdvi313 divideint 0.12 2.1 -> 0 +dqdvi314 divideint 0.12 2.00 -> 0 +dqdvi315 divideint 0.12 2.01 -> 0 + +-- edge cases of impossible +dqdvi330 divideint 1234567987654321987654321890123456 10 -> 123456798765432198765432189012345 +dqdvi331 divideint 1234567987654321987654321890123456 1 -> 1234567987654321987654321890123456 +dqdvi332 divideint 1234567987654321987654321890123456 0.1 -> NaN Division_impossible +dqdvi333 divideint 1234567987654321987654321890123456 0.01 -> NaN Division_impossible + +-- overflow and underflow tests [from divide] +dqdvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible +dqdvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible +dqdvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible +dqdvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible +dqdvi1055 divideint 1e-277 1e+311 -> 0 +dqdvi1056 divideint 1e-277 -1e+311 -> -0 +dqdvi1057 divideint -1e-277 1e+311 -> -0 +dqdvi1058 divideint -1e-277 -1e+311 -> 0 + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +dqdvi1060 divideint 1e-291 1e+101 -> 0 +dqdvi1061 divideint 1e-291 1e+102 -> 0 +dqdvi1062 divideint 1e-291 1e+103 -> 0 +dqdvi1063 divideint 1e-291 1e+104 -> 0 +dqdvi1064 divideint 1e-291 1e+105 -> 0 +dqdvi1065 divideint 1e-291 1e+106 -> 0 +dqdvi1066 divideint 1e-291 1e+107 -> 0 +dqdvi1067 divideint 1e-291 1e+108 -> 0 +dqdvi1068 divideint 1e-291 1e+109 -> 0 +dqdvi1069 divideint 1e-291 1e+110 -> 0 + +dqdvi1101 divideint 1.0000E-394 1 -> 0 +dqdvi1102 divideint 1.000E-394 1e+1 -> 0 +dqdvi1103 divideint 1.00E-394 1e+2 -> 0 + +dqdvi1118 divideint 1E-394 1e+4 -> 0 +dqdvi1119 divideint 3E-394 -1e+5 -> -0 +dqdvi1120 divideint 5E-394 1e+5 -> 0 + +dqdvi1124 divideint 1E-394 -1e+4 -> -0 +dqdvi1130 divideint 3.0E-394 -1e+5 -> -0 + +dqdvi1131 divideint 1.0E-199 1e+200 -> 0 +dqdvi1132 divideint 1.0E-199 1e+199 -> 0 +dqdvi1133 divideint 1.0E-199 1e+198 -> 0 +dqdvi1134 divideint 2.0E-199 2e+198 -> 0 +dqdvi1135 divideint 4.0E-199 4e+198 -> 0 + +-- long operand checks +dqdvi401 divideint 12345678000 100 -> 123456780 +dqdvi402 divideint 1 12345678000 -> 0 +dqdvi403 divideint 1234567800 10 -> 123456780 +dqdvi404 divideint 1 1234567800 -> 0 +dqdvi405 divideint 1234567890 10 -> 123456789 +dqdvi406 divideint 1 1234567890 -> 0 +dqdvi407 divideint 1234567891 10 -> 123456789 +dqdvi408 divideint 1 1234567891 -> 0 +dqdvi409 divideint 12345678901 100 -> 123456789 +dqdvi410 divideint 1 12345678901 -> 0 +dqdvi411 divideint 1234567896 10 -> 123456789 +dqdvi412 divideint 1 1234567896 -> 0 +dqdvi413 divideint 12345678948 100 -> 123456789 +dqdvi414 divideint 12345678949 100 -> 123456789 +dqdvi415 divideint 12345678950 100 -> 123456789 +dqdvi416 divideint 12345678951 100 -> 123456789 +dqdvi417 divideint 12345678999 100 -> 123456789 +dqdvi441 divideint 12345678000 1 -> 12345678000 +dqdvi442 divideint 1 12345678000 -> 0 +dqdvi443 divideint 1234567800 1 -> 1234567800 +dqdvi444 divideint 1 1234567800 -> 0 +dqdvi445 divideint 1234567890 1 -> 1234567890 +dqdvi446 divideint 1 1234567890 -> 0 +dqdvi447 divideint 1234567891 1 -> 1234567891 +dqdvi448 divideint 1 1234567891 -> 0 +dqdvi449 divideint 12345678901 1 -> 12345678901 +dqdvi450 divideint 1 12345678901 -> 0 +dqdvi451 divideint 1234567896 1 -> 1234567896 +dqdvi452 divideint 1 1234567896 -> 0 + +-- more zeros, etc. +dqdvi531 divideint 5.00 1E-3 -> 5000 +dqdvi532 divideint 00.00 0.000 -> NaN Division_undefined +dqdvi533 divideint 00.00 0E-3 -> NaN Division_undefined +dqdvi534 divideint 0 -0 -> NaN Division_undefined +dqdvi535 divideint -0 0 -> NaN Division_undefined +dqdvi536 divideint -0 -0 -> NaN Division_undefined + +dqdvi541 divideint 0 -1 -> -0 +dqdvi542 divideint -0 -1 -> 0 +dqdvi543 divideint 0 1 -> 0 +dqdvi544 divideint -0 1 -> -0 +dqdvi545 divideint -1 0 -> -Infinity Division_by_zero +dqdvi546 divideint -1 -0 -> Infinity Division_by_zero +dqdvi547 divideint 1 0 -> Infinity Division_by_zero +dqdvi548 divideint 1 -0 -> -Infinity Division_by_zero + +dqdvi551 divideint 0.0 -1 -> -0 +dqdvi552 divideint -0.0 -1 -> 0 +dqdvi553 divideint 0.0 1 -> 0 +dqdvi554 divideint -0.0 1 -> -0 +dqdvi555 divideint -1.0 0 -> -Infinity Division_by_zero +dqdvi556 divideint -1.0 -0 -> Infinity Division_by_zero +dqdvi557 divideint 1.0 0 -> Infinity Division_by_zero +dqdvi558 divideint 1.0 -0 -> -Infinity Division_by_zero + +dqdvi561 divideint 0 -1.0 -> -0 +dqdvi562 divideint -0 -1.0 -> 0 +dqdvi563 divideint 0 1.0 -> 0 +dqdvi564 divideint -0 1.0 -> -0 +dqdvi565 divideint -1 0.0 -> -Infinity Division_by_zero +dqdvi566 divideint -1 -0.0 -> Infinity Division_by_zero +dqdvi567 divideint 1 0.0 -> Infinity Division_by_zero +dqdvi568 divideint 1 -0.0 -> -Infinity Division_by_zero + +dqdvi571 divideint 0.0 -1.0 -> -0 +dqdvi572 divideint -0.0 -1.0 -> 0 +dqdvi573 divideint 0.0 1.0 -> 0 +dqdvi574 divideint -0.0 1.0 -> -0 +dqdvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero +dqdvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero +dqdvi577 divideint 1.0 0.0 -> Infinity Division_by_zero +dqdvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +dqdvi580 divideint Inf -Inf -> NaN Invalid_operation +dqdvi581 divideint Inf -1000 -> -Infinity +dqdvi582 divideint Inf -1 -> -Infinity +dqdvi583 divideint Inf -0 -> -Infinity +dqdvi584 divideint Inf 0 -> Infinity +dqdvi585 divideint Inf 1 -> Infinity +dqdvi586 divideint Inf 1000 -> Infinity +dqdvi587 divideint Inf Inf -> NaN Invalid_operation +dqdvi588 divideint -1000 Inf -> -0 +dqdvi589 divideint -Inf Inf -> NaN Invalid_operation +dqdvi590 divideint -1 Inf -> -0 +dqdvi591 divideint -0 Inf -> -0 +dqdvi592 divideint 0 Inf -> 0 +dqdvi593 divideint 1 Inf -> 0 +dqdvi594 divideint 1000 Inf -> 0 +dqdvi595 divideint Inf Inf -> NaN Invalid_operation + +dqdvi600 divideint -Inf -Inf -> NaN Invalid_operation +dqdvi601 divideint -Inf -1000 -> Infinity +dqdvi602 divideint -Inf -1 -> Infinity +dqdvi603 divideint -Inf -0 -> Infinity +dqdvi604 divideint -Inf 0 -> -Infinity +dqdvi605 divideint -Inf 1 -> -Infinity +dqdvi606 divideint -Inf 1000 -> -Infinity +dqdvi607 divideint -Inf Inf -> NaN Invalid_operation +dqdvi608 divideint -1000 Inf -> -0 +dqdvi609 divideint -Inf -Inf -> NaN Invalid_operation +dqdvi610 divideint -1 -Inf -> 0 +dqdvi611 divideint -0 -Inf -> 0 +dqdvi612 divideint 0 -Inf -> -0 +dqdvi613 divideint 1 -Inf -> -0 +dqdvi614 divideint 1000 -Inf -> -0 +dqdvi615 divideint Inf -Inf -> NaN Invalid_operation + +dqdvi621 divideint NaN -Inf -> NaN +dqdvi622 divideint NaN -1000 -> NaN +dqdvi623 divideint NaN -1 -> NaN +dqdvi624 divideint NaN -0 -> NaN +dqdvi625 divideint NaN 0 -> NaN +dqdvi626 divideint NaN 1 -> NaN +dqdvi627 divideint NaN 1000 -> NaN +dqdvi628 divideint NaN Inf -> NaN +dqdvi629 divideint NaN NaN -> NaN +dqdvi630 divideint -Inf NaN -> NaN +dqdvi631 divideint -1000 NaN -> NaN +dqdvi632 divideint -1 NaN -> NaN +dqdvi633 divideint -0 NaN -> NaN +dqdvi634 divideint 0 NaN -> NaN +dqdvi635 divideint 1 NaN -> NaN +dqdvi636 divideint 1000 NaN -> NaN +dqdvi637 divideint Inf NaN -> NaN + +dqdvi641 divideint sNaN -Inf -> NaN Invalid_operation +dqdvi642 divideint sNaN -1000 -> NaN Invalid_operation +dqdvi643 divideint sNaN -1 -> NaN Invalid_operation +dqdvi644 divideint sNaN -0 -> NaN Invalid_operation +dqdvi645 divideint sNaN 0 -> NaN Invalid_operation +dqdvi646 divideint sNaN 1 -> NaN Invalid_operation +dqdvi647 divideint sNaN 1000 -> NaN Invalid_operation +dqdvi648 divideint sNaN NaN -> NaN Invalid_operation +dqdvi649 divideint sNaN sNaN -> NaN Invalid_operation +dqdvi650 divideint NaN sNaN -> NaN Invalid_operation +dqdvi651 divideint -Inf sNaN -> NaN Invalid_operation +dqdvi652 divideint -1000 sNaN -> NaN Invalid_operation +dqdvi653 divideint -1 sNaN -> NaN Invalid_operation +dqdvi654 divideint -0 sNaN -> NaN Invalid_operation +dqdvi655 divideint 0 sNaN -> NaN Invalid_operation +dqdvi656 divideint 1 sNaN -> NaN Invalid_operation +dqdvi657 divideint 1000 sNaN -> NaN Invalid_operation +dqdvi658 divideint Inf sNaN -> NaN Invalid_operation +dqdvi659 divideint NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqdvi661 divideint NaN9 -Inf -> NaN9 +dqdvi662 divideint NaN8 1000 -> NaN8 +dqdvi663 divideint NaN7 Inf -> NaN7 +dqdvi664 divideint -NaN6 NaN5 -> -NaN6 +dqdvi665 divideint -Inf NaN4 -> NaN4 +dqdvi666 divideint -1000 NaN3 -> NaN3 +dqdvi667 divideint Inf -NaN2 -> -NaN2 + +dqdvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation +dqdvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation +dqdvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation +dqdvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation +dqdvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation +dqdvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation +dqdvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation +dqdvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation +dqdvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation + +-- Gyuris example +dqdvi700 divideint 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0 + +-- Null tests +dqdvi900 divideint 10 # -> NaN Invalid_operation +dqdvi901 divideint # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqEncode.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqEncode.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,477 @@ +------------------------------------------------------------------------ +-- dqEncode.decTest -- decimal sixteen-byte format testcases -- +-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +-- [Previously called decimal128.decTest] +version: 2.58 + +-- This set of tests is for the sixteen-byte concrete representation. +-- Its characteristics are: +-- +-- 1 bit sign +-- 5 bits combination field +-- 12 bits exponent continuation +-- 110 bits coefficient continuation +-- +-- Total exponent length 14 bits +-- Total coefficient length 114 bits (34 digits) +-- +-- Elimit = 12287 (maximum encoded exponent) +-- Emax = 6144 (largest exponent value) +-- Emin = -6143 (smallest exponent value) +-- bias = 6176 (subtracted from encoded exponent) = -Etiny + +-- The testcases here have only exactly representable data on the +-- 'left-hand-side'; rounding from strings is tested in 'base' +-- testcase groups. + +extended: 1 +clamp: 1 +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 + +-- General testcases +-- (mostly derived from the Strawman 4 document and examples) +decq001 apply #A20780000000000000000000000003D0 -> -7.50 +decq002 apply -7.50 -> #A20780000000000000000000000003D0 +-- derivative canonical plain strings +decq003 apply #A20840000000000000000000000003D0 -> -7.50E+3 +decq004 apply -7.50E+3 -> #A20840000000000000000000000003D0 +decq005 apply #A20800000000000000000000000003D0 -> -750 +decq006 apply -750 -> #A20800000000000000000000000003D0 +decq007 apply #A207c0000000000000000000000003D0 -> -75.0 +decq008 apply -75.0 -> #A207c0000000000000000000000003D0 +decq009 apply #A20740000000000000000000000003D0 -> -0.750 +decq010 apply -0.750 -> #A20740000000000000000000000003D0 +decq011 apply #A20700000000000000000000000003D0 -> -0.0750 +decq012 apply -0.0750 -> #A20700000000000000000000000003D0 +decq013 apply #A20680000000000000000000000003D0 -> -0.000750 +decq014 apply -0.000750 -> #A20680000000000000000000000003D0 +decq015 apply #A20600000000000000000000000003D0 -> -0.00000750 +decq016 apply -0.00000750 -> #A20600000000000000000000000003D0 +decq017 apply #A205c0000000000000000000000003D0 -> -7.50E-7 +decq018 apply -7.50E-7 -> #A205c0000000000000000000000003D0 + +-- Normality +decq020 apply 1234567890123456789012345678901234 -> #2608134b9c1e28e56f3c127177823534 +decq021 apply -1234567890123456789012345678901234 -> #a608134b9c1e28e56f3c127177823534 +decq022 apply 1111111111111111111111111111111111 -> #26080912449124491244912449124491 + +-- Nmax and similar +decq031 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff +decq032 apply #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144 +decq033 apply 1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534 +decq034 apply #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144 +-- fold-downs (more below) +decq035 apply 1.23E+6144 -> #47ffd300000000000000000000000000 Clamped +decq036 apply #47ffd300000000000000000000000000 -> 1.230000000000000000000000000000000E+6144 +decq037 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped +decq038 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144 + +decq051 apply 12345 -> #220800000000000000000000000049c5 +decq052 apply #220800000000000000000000000049c5 -> 12345 +decq053 apply 1234 -> #22080000000000000000000000000534 +decq054 apply #22080000000000000000000000000534 -> 1234 +decq055 apply 123 -> #220800000000000000000000000000a3 +decq056 apply #220800000000000000000000000000a3 -> 123 +decq057 apply 12 -> #22080000000000000000000000000012 +decq058 apply #22080000000000000000000000000012 -> 12 +decq059 apply 1 -> #22080000000000000000000000000001 +decq060 apply #22080000000000000000000000000001 -> 1 +decq061 apply 1.23 -> #220780000000000000000000000000a3 +decq062 apply #220780000000000000000000000000a3 -> 1.23 +decq063 apply 123.45 -> #220780000000000000000000000049c5 +decq064 apply #220780000000000000000000000049c5 -> 123.45 + +-- Nmin and below +decq071 apply 1E-6143 -> #00084000000000000000000000000001 +decq072 apply #00084000000000000000000000000001 -> 1E-6143 +decq073 apply 1.000000000000000000000000000000000E-6143 -> #04000000000000000000000000000000 +decq074 apply #04000000000000000000000000000000 -> 1.000000000000000000000000000000000E-6143 +decq075 apply 1.000000000000000000000000000000001E-6143 -> #04000000000000000000000000000001 +decq076 apply #04000000000000000000000000000001 -> 1.000000000000000000000000000000001E-6143 + +decq077 apply 0.100000000000000000000000000000000E-6143 -> #00000800000000000000000000000000 Subnormal +decq078 apply #00000800000000000000000000000000 -> 1.00000000000000000000000000000000E-6144 Subnormal +decq079 apply 0.000000000000000000000000000000010E-6143 -> #00000000000000000000000000000010 Subnormal +decq080 apply #00000000000000000000000000000010 -> 1.0E-6175 Subnormal +decq081 apply 0.00000000000000000000000000000001E-6143 -> #00004000000000000000000000000001 Subnormal +decq082 apply #00004000000000000000000000000001 -> 1E-6175 Subnormal +decq083 apply 0.000000000000000000000000000000001E-6143 -> #00000000000000000000000000000001 Subnormal +decq084 apply #00000000000000000000000000000001 -> 1E-6176 Subnormal + +-- underflows cannot be tested for simple copies, check edge cases +decq090 apply 1e-6176 -> #00000000000000000000000000000001 Subnormal +decq100 apply 999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff Subnormal + +-- same again, negatives +-- Nmax and similar +decq122 apply -9.999999999999999999999999999999999E+6144 -> #f7ffcff3fcff3fcff3fcff3fcff3fcff +decq123 apply #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144 +decq124 apply -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534 +decq125 apply #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144 +-- fold-downs (more below) +decq130 apply -1.23E+6144 -> #c7ffd300000000000000000000000000 Clamped +decq131 apply #c7ffd300000000000000000000000000 -> -1.230000000000000000000000000000000E+6144 +decq132 apply -1E+6144 -> #c7ffc000000000000000000000000000 Clamped +decq133 apply #c7ffc000000000000000000000000000 -> -1.000000000000000000000000000000000E+6144 + +decq151 apply -12345 -> #a20800000000000000000000000049c5 +decq152 apply #a20800000000000000000000000049c5 -> -12345 +decq153 apply -1234 -> #a2080000000000000000000000000534 +decq154 apply #a2080000000000000000000000000534 -> -1234 +decq155 apply -123 -> #a20800000000000000000000000000a3 +decq156 apply #a20800000000000000000000000000a3 -> -123 +decq157 apply -12 -> #a2080000000000000000000000000012 +decq158 apply #a2080000000000000000000000000012 -> -12 +decq159 apply -1 -> #a2080000000000000000000000000001 +decq160 apply #a2080000000000000000000000000001 -> -1 +decq161 apply -1.23 -> #a20780000000000000000000000000a3 +decq162 apply #a20780000000000000000000000000a3 -> -1.23 +decq163 apply -123.45 -> #a20780000000000000000000000049c5 +decq164 apply #a20780000000000000000000000049c5 -> -123.45 + +-- Nmin and below +decq171 apply -1E-6143 -> #80084000000000000000000000000001 +decq172 apply #80084000000000000000000000000001 -> -1E-6143 +decq173 apply -1.000000000000000000000000000000000E-6143 -> #84000000000000000000000000000000 +decq174 apply #84000000000000000000000000000000 -> -1.000000000000000000000000000000000E-6143 +decq175 apply -1.000000000000000000000000000000001E-6143 -> #84000000000000000000000000000001 +decq176 apply #84000000000000000000000000000001 -> -1.000000000000000000000000000000001E-6143 + +decq177 apply -0.100000000000000000000000000000000E-6143 -> #80000800000000000000000000000000 Subnormal +decq178 apply #80000800000000000000000000000000 -> -1.00000000000000000000000000000000E-6144 Subnormal +decq179 apply -0.000000000000000000000000000000010E-6143 -> #80000000000000000000000000000010 Subnormal +decq180 apply #80000000000000000000000000000010 -> -1.0E-6175 Subnormal +decq181 apply -0.00000000000000000000000000000001E-6143 -> #80004000000000000000000000000001 Subnormal +decq182 apply #80004000000000000000000000000001 -> -1E-6175 Subnormal +decq183 apply -0.000000000000000000000000000000001E-6143 -> #80000000000000000000000000000001 Subnormal +decq184 apply #80000000000000000000000000000001 -> -1E-6176 Subnormal + +-- underflow edge cases +decq190 apply -1e-6176 -> #80000000000000000000000000000001 Subnormal +decq200 apply -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff Subnormal + +-- zeros +decq400 apply 0E-8000 -> #00000000000000000000000000000000 Clamped +decq401 apply 0E-6177 -> #00000000000000000000000000000000 Clamped +decq402 apply 0E-6176 -> #00000000000000000000000000000000 +decq403 apply #00000000000000000000000000000000 -> 0E-6176 +decq404 apply 0.000000000000000000000000000000000E-6143 -> #00000000000000000000000000000000 +decq405 apply #00000000000000000000000000000000 -> 0E-6176 +decq406 apply 0E-2 -> #22078000000000000000000000000000 +decq407 apply #22078000000000000000000000000000 -> 0.00 +decq408 apply 0 -> #22080000000000000000000000000000 +decq409 apply #22080000000000000000000000000000 -> 0 +decq410 apply 0E+3 -> #2208c000000000000000000000000000 +decq411 apply #2208c000000000000000000000000000 -> 0E+3 +decq412 apply 0E+6111 -> #43ffc000000000000000000000000000 +decq413 apply #43ffc000000000000000000000000000 -> 0E+6111 +-- clamped zeros... +decq414 apply 0E+6112 -> #43ffc000000000000000000000000000 Clamped +decq415 apply #43ffc000000000000000000000000000 -> 0E+6111 +decq416 apply 0E+6144 -> #43ffc000000000000000000000000000 Clamped +decq417 apply #43ffc000000000000000000000000000 -> 0E+6111 +decq418 apply 0E+8000 -> #43ffc000000000000000000000000000 Clamped +decq419 apply #43ffc000000000000000000000000000 -> 0E+6111 + +-- negative zeros +decq420 apply -0E-8000 -> #80000000000000000000000000000000 Clamped +decq421 apply -0E-6177 -> #80000000000000000000000000000000 Clamped +decq422 apply -0E-6176 -> #80000000000000000000000000000000 +decq423 apply #80000000000000000000000000000000 -> -0E-6176 +decq424 apply -0.000000000000000000000000000000000E-6143 -> #80000000000000000000000000000000 +decq425 apply #80000000000000000000000000000000 -> -0E-6176 +decq426 apply -0E-2 -> #a2078000000000000000000000000000 +decq427 apply #a2078000000000000000000000000000 -> -0.00 +decq428 apply -0 -> #a2080000000000000000000000000000 +decq429 apply #a2080000000000000000000000000000 -> -0 +decq430 apply -0E+3 -> #a208c000000000000000000000000000 +decq431 apply #a208c000000000000000000000000000 -> -0E+3 +decq432 apply -0E+6111 -> #c3ffc000000000000000000000000000 +decq433 apply #c3ffc000000000000000000000000000 -> -0E+6111 +-- clamped zeros... +decq434 apply -0E+6112 -> #c3ffc000000000000000000000000000 Clamped +decq435 apply #c3ffc000000000000000000000000000 -> -0E+6111 +decq436 apply -0E+6144 -> #c3ffc000000000000000000000000000 Clamped +decq437 apply #c3ffc000000000000000000000000000 -> -0E+6111 +decq438 apply -0E+8000 -> #c3ffc000000000000000000000000000 Clamped +decq439 apply #c3ffc000000000000000000000000000 -> -0E+6111 + +-- exponent lengths +decq440 apply #22080000000000000000000000000007 -> 7 +decq441 apply 7 -> #22080000000000000000000000000007 +decq442 apply #220a4000000000000000000000000007 -> 7E+9 +decq443 apply 7E+9 -> #220a4000000000000000000000000007 +decq444 apply #2220c000000000000000000000000007 -> 7E+99 +decq445 apply 7E+99 -> #2220c000000000000000000000000007 +decq446 apply #2301c000000000000000000000000007 -> 7E+999 +decq447 apply 7E+999 -> #2301c000000000000000000000000007 +decq448 apply #43e3c000000000000000000000000007 -> 7E+5999 +decq449 apply 7E+5999 -> #43e3c000000000000000000000000007 + +-- Specials +decq500 apply Infinity -> #78000000000000000000000000000000 +decq501 apply #78787878787878787878787878787878 -> #78000000000000000000000000000000 +decq502 apply #78000000000000000000000000000000 -> Infinity +decq503 apply #79797979797979797979797979797979 -> #78000000000000000000000000000000 +decq504 apply #79000000000000000000000000000000 -> Infinity +decq505 apply #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000 +decq506 apply #7a000000000000000000000000000000 -> Infinity +decq507 apply #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000 +decq508 apply #7b000000000000000000000000000000 -> Infinity + +decq509 apply NaN -> #7c000000000000000000000000000000 +decq510 apply #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c +decq511 apply #7c000000000000000000000000000000 -> NaN +decq512 apply #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d +decq513 apply #7d000000000000000000000000000000 -> NaN +decq514 apply #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e +decq515 apply #7e000000000000000000000000000000 -> sNaN +decq516 apply #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f +decq517 apply #7f000000000000000000000000000000 -> sNaN +decq518 apply #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999 +decq519 apply #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff + +decq520 apply -Infinity -> #f8000000000000000000000000000000 +decq521 apply #f8787878787878787878787878787878 -> #f8000000000000000000000000000000 +decq522 apply #f8000000000000000000000000000000 -> -Infinity +decq523 apply #f9797979797979797979797979797979 -> #f8000000000000000000000000000000 +decq524 apply #f9000000000000000000000000000000 -> -Infinity +decq525 apply #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000 +decq526 apply #fa000000000000000000000000000000 -> -Infinity +decq527 apply #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000 +decq528 apply #fb000000000000000000000000000000 -> -Infinity + +decq529 apply -NaN -> #fc000000000000000000000000000000 +decq530 apply #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c +decq531 apply #fc000000000000000000000000000000 -> -NaN +decq532 apply #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d +decq533 apply #fd000000000000000000000000000000 -> -NaN +decq534 apply #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e +decq535 apply #fe000000000000000000000000000000 -> -sNaN +decq536 apply #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f +decq537 apply #ff000000000000000000000000000000 -> -sNaN +decq538 apply #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999 +decq539 apply #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff + +decq540 apply NaN -> #7c000000000000000000000000000000 +decq541 apply NaN0 -> #7c000000000000000000000000000000 +decq542 apply NaN1 -> #7c000000000000000000000000000001 +decq543 apply NaN12 -> #7c000000000000000000000000000012 +decq544 apply NaN79 -> #7c000000000000000000000000000079 +decq545 apply NaN12345 -> #7c0000000000000000000000000049c5 +decq546 apply NaN123456 -> #7c000000000000000000000000028e56 +decq547 apply NaN799799 -> #7c0000000000000000000000000f7fdf +decq548 apply NaN799799799799799799799799799799799 -> #7c003dff7fdff7fdff7fdff7fdff7fdf +decq549 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +decq550 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff + +-- fold-down full sequence +decq601 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped +decq602 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144 +decq603 apply 1E+6143 -> #43ffc800000000000000000000000000 Clamped +decq604 apply #43ffc800000000000000000000000000 -> 1.00000000000000000000000000000000E+6143 +decq605 apply 1E+6142 -> #43ffc100000000000000000000000000 Clamped +decq606 apply #43ffc100000000000000000000000000 -> 1.0000000000000000000000000000000E+6142 +decq607 apply 1E+6141 -> #43ffc010000000000000000000000000 Clamped +decq608 apply #43ffc010000000000000000000000000 -> 1.000000000000000000000000000000E+6141 +decq609 apply 1E+6140 -> #43ffc002000000000000000000000000 Clamped +decq610 apply #43ffc002000000000000000000000000 -> 1.00000000000000000000000000000E+6140 +decq611 apply 1E+6139 -> #43ffc000400000000000000000000000 Clamped +decq612 apply #43ffc000400000000000000000000000 -> 1.0000000000000000000000000000E+6139 +decq613 apply 1E+6138 -> #43ffc000040000000000000000000000 Clamped +decq614 apply #43ffc000040000000000000000000000 -> 1.000000000000000000000000000E+6138 +decq615 apply 1E+6137 -> #43ffc000008000000000000000000000 Clamped +decq616 apply #43ffc000008000000000000000000000 -> 1.00000000000000000000000000E+6137 +decq617 apply 1E+6136 -> #43ffc000001000000000000000000000 Clamped +decq618 apply #43ffc000001000000000000000000000 -> 1.0000000000000000000000000E+6136 +decq619 apply 1E+6135 -> #43ffc000000100000000000000000000 Clamped +decq620 apply #43ffc000000100000000000000000000 -> 1.000000000000000000000000E+6135 +decq621 apply 1E+6134 -> #43ffc000000020000000000000000000 Clamped +decq622 apply #43ffc000000020000000000000000000 -> 1.00000000000000000000000E+6134 +decq623 apply 1E+6133 -> #43ffc000000004000000000000000000 Clamped +decq624 apply #43ffc000000004000000000000000000 -> 1.0000000000000000000000E+6133 +decq625 apply 1E+6132 -> #43ffc000000000400000000000000000 Clamped +decq626 apply #43ffc000000000400000000000000000 -> 1.000000000000000000000E+6132 +decq627 apply 1E+6131 -> #43ffc000000000080000000000000000 Clamped +decq628 apply #43ffc000000000080000000000000000 -> 1.00000000000000000000E+6131 +decq629 apply 1E+6130 -> #43ffc000000000010000000000000000 Clamped +decq630 apply #43ffc000000000010000000000000000 -> 1.0000000000000000000E+6130 +decq631 apply 1E+6129 -> #43ffc000000000001000000000000000 Clamped +decq632 apply #43ffc000000000001000000000000000 -> 1.000000000000000000E+6129 +decq633 apply 1E+6128 -> #43ffc000000000000200000000000000 Clamped +decq634 apply #43ffc000000000000200000000000000 -> 1.00000000000000000E+6128 +decq635 apply 1E+6127 -> #43ffc000000000000040000000000000 Clamped +decq636 apply #43ffc000000000000040000000000000 -> 1.0000000000000000E+6127 +decq637 apply 1E+6126 -> #43ffc000000000000004000000000000 Clamped +decq638 apply #43ffc000000000000004000000000000 -> 1.000000000000000E+6126 +decq639 apply 1E+6125 -> #43ffc000000000000000800000000000 Clamped +decq640 apply #43ffc000000000000000800000000000 -> 1.00000000000000E+6125 +decq641 apply 1E+6124 -> #43ffc000000000000000100000000000 Clamped +decq642 apply #43ffc000000000000000100000000000 -> 1.0000000000000E+6124 +decq643 apply 1E+6123 -> #43ffc000000000000000010000000000 Clamped +decq644 apply #43ffc000000000000000010000000000 -> 1.000000000000E+6123 +decq645 apply 1E+6122 -> #43ffc000000000000000002000000000 Clamped +decq646 apply #43ffc000000000000000002000000000 -> 1.00000000000E+6122 +decq647 apply 1E+6121 -> #43ffc000000000000000000400000000 Clamped +decq648 apply #43ffc000000000000000000400000000 -> 1.0000000000E+6121 +decq649 apply 1E+6120 -> #43ffc000000000000000000040000000 Clamped +decq650 apply #43ffc000000000000000000040000000 -> 1.000000000E+6120 +decq651 apply 1E+6119 -> #43ffc000000000000000000008000000 Clamped +decq652 apply #43ffc000000000000000000008000000 -> 1.00000000E+6119 +decq653 apply 1E+6118 -> #43ffc000000000000000000001000000 Clamped +decq654 apply #43ffc000000000000000000001000000 -> 1.0000000E+6118 +decq655 apply 1E+6117 -> #43ffc000000000000000000000100000 Clamped +decq656 apply #43ffc000000000000000000000100000 -> 1.000000E+6117 +decq657 apply 1E+6116 -> #43ffc000000000000000000000020000 Clamped +decq658 apply #43ffc000000000000000000000020000 -> 1.00000E+6116 +decq659 apply 1E+6115 -> #43ffc000000000000000000000004000 Clamped +decq660 apply #43ffc000000000000000000000004000 -> 1.0000E+6115 +decq661 apply 1E+6114 -> #43ffc000000000000000000000000400 Clamped +decq662 apply #43ffc000000000000000000000000400 -> 1.000E+6114 +decq663 apply 1E+6113 -> #43ffc000000000000000000000000080 Clamped +decq664 apply #43ffc000000000000000000000000080 -> 1.00E+6113 +decq665 apply 1E+6112 -> #43ffc000000000000000000000000010 Clamped +decq666 apply #43ffc000000000000000000000000010 -> 1.0E+6112 +decq667 apply 1E+6111 -> #43ffc000000000000000000000000001 +decq668 apply #43ffc000000000000000000000000001 -> 1E+6111 +decq669 apply 1E+6110 -> #43ff8000000000000000000000000001 +decq670 apply #43ff8000000000000000000000000001 -> 1E+6110 + +-- Selected DPD codes +decq700 apply #22080000000000000000000000000000 -> 0 +decq701 apply #22080000000000000000000000000009 -> 9 +decq702 apply #22080000000000000000000000000010 -> 10 +decq703 apply #22080000000000000000000000000019 -> 19 +decq704 apply #22080000000000000000000000000020 -> 20 +decq705 apply #22080000000000000000000000000029 -> 29 +decq706 apply #22080000000000000000000000000030 -> 30 +decq707 apply #22080000000000000000000000000039 -> 39 +decq708 apply #22080000000000000000000000000040 -> 40 +decq709 apply #22080000000000000000000000000049 -> 49 +decq710 apply #22080000000000000000000000000050 -> 50 +decq711 apply #22080000000000000000000000000059 -> 59 +decq712 apply #22080000000000000000000000000060 -> 60 +decq713 apply #22080000000000000000000000000069 -> 69 +decq714 apply #22080000000000000000000000000070 -> 70 +decq715 apply #22080000000000000000000000000071 -> 71 +decq716 apply #22080000000000000000000000000072 -> 72 +decq717 apply #22080000000000000000000000000073 -> 73 +decq718 apply #22080000000000000000000000000074 -> 74 +decq719 apply #22080000000000000000000000000075 -> 75 +decq720 apply #22080000000000000000000000000076 -> 76 +decq721 apply #22080000000000000000000000000077 -> 77 +decq722 apply #22080000000000000000000000000078 -> 78 +decq723 apply #22080000000000000000000000000079 -> 79 + +decq730 apply #2208000000000000000000000000029e -> 994 +decq731 apply #2208000000000000000000000000029f -> 995 +decq732 apply #220800000000000000000000000002a0 -> 520 +decq733 apply #220800000000000000000000000002a1 -> 521 + +-- DPD: one of each of the huffman groups +decq740 apply #220800000000000000000000000003f7 -> 777 +decq741 apply #220800000000000000000000000003f8 -> 778 +decq742 apply #220800000000000000000000000003eb -> 787 +decq743 apply #2208000000000000000000000000037d -> 877 +decq744 apply #2208000000000000000000000000039f -> 997 +decq745 apply #220800000000000000000000000003bf -> 979 +decq746 apply #220800000000000000000000000003df -> 799 +decq747 apply #2208000000000000000000000000006e -> 888 + + +-- DPD all-highs cases (includes the 24 redundant codes) +decq750 apply #2208000000000000000000000000006e -> 888 +decq751 apply #2208000000000000000000000000016e -> 888 +decq752 apply #2208000000000000000000000000026e -> 888 +decq753 apply #2208000000000000000000000000036e -> 888 +decq754 apply #2208000000000000000000000000006f -> 889 +decq755 apply #2208000000000000000000000000016f -> 889 +decq756 apply #2208000000000000000000000000026f -> 889 +decq757 apply #2208000000000000000000000000036f -> 889 + +decq760 apply #2208000000000000000000000000007e -> 898 +decq761 apply #2208000000000000000000000000017e -> 898 +decq762 apply #2208000000000000000000000000027e -> 898 +decq763 apply #2208000000000000000000000000037e -> 898 +decq764 apply #2208000000000000000000000000007f -> 899 +decq765 apply #2208000000000000000000000000017f -> 899 +decq766 apply #2208000000000000000000000000027f -> 899 +decq767 apply #2208000000000000000000000000037f -> 899 + +decq770 apply #220800000000000000000000000000ee -> 988 +decq771 apply #220800000000000000000000000001ee -> 988 +decq772 apply #220800000000000000000000000002ee -> 988 +decq773 apply #220800000000000000000000000003ee -> 988 +decq774 apply #220800000000000000000000000000ef -> 989 +decq775 apply #220800000000000000000000000001ef -> 989 +decq776 apply #220800000000000000000000000002ef -> 989 +decq777 apply #220800000000000000000000000003ef -> 989 + +decq780 apply #220800000000000000000000000000fe -> 998 +decq781 apply #220800000000000000000000000001fe -> 998 +decq782 apply #220800000000000000000000000002fe -> 998 +decq783 apply #220800000000000000000000000003fe -> 998 +decq784 apply #220800000000000000000000000000ff -> 999 +decq785 apply #220800000000000000000000000001ff -> 999 +decq786 apply #220800000000000000000000000002ff -> 999 +decq787 apply #220800000000000000000000000003ff -> 999 + +-- Miscellaneous (testers' queries, etc.) + +decq790 apply #2208000000000000000000000000c000 -> 30000 +decq791 apply #22080000000000000000000000007800 -> 890000 +decq792 apply 30000 -> #2208000000000000000000000000c000 +decq793 apply 890000 -> #22080000000000000000000000007800 + +-- values around [u]int32 edges (zeros done earlier) +decq800 apply -2147483646 -> #a208000000000000000000008c78af46 +decq801 apply -2147483647 -> #a208000000000000000000008c78af47 +decq802 apply -2147483648 -> #a208000000000000000000008c78af48 +decq803 apply -2147483649 -> #a208000000000000000000008c78af49 +decq804 apply 2147483646 -> #2208000000000000000000008c78af46 +decq805 apply 2147483647 -> #2208000000000000000000008c78af47 +decq806 apply 2147483648 -> #2208000000000000000000008c78af48 +decq807 apply 2147483649 -> #2208000000000000000000008c78af49 +decq808 apply 4294967294 -> #22080000000000000000000115afb55a +decq809 apply 4294967295 -> #22080000000000000000000115afb55b +decq810 apply 4294967296 -> #22080000000000000000000115afb57a +decq811 apply 4294967297 -> #22080000000000000000000115afb57b + +decq820 apply #a208000000000000000000008c78af46 -> -2147483646 +decq821 apply #a208000000000000000000008c78af47 -> -2147483647 +decq822 apply #a208000000000000000000008c78af48 -> -2147483648 +decq823 apply #a208000000000000000000008c78af49 -> -2147483649 +decq824 apply #2208000000000000000000008c78af46 -> 2147483646 +decq825 apply #2208000000000000000000008c78af47 -> 2147483647 +decq826 apply #2208000000000000000000008c78af48 -> 2147483648 +decq827 apply #2208000000000000000000008c78af49 -> 2147483649 +decq828 apply #22080000000000000000000115afb55a -> 4294967294 +decq829 apply #22080000000000000000000115afb55b -> 4294967295 +decq830 apply #22080000000000000000000115afb57a -> 4294967296 +decq831 apply #22080000000000000000000115afb57b -> 4294967297 + +-- VG testcase +decq840 apply #2080000000000000F294000000172636 -> 8.81125000000001349436E-1548 +decq841 apply #20800000000000008000000000000000 -> 8.000000000000000000E-1550 +decq842 apply #1EF98490000000010F6E4E0000000000 -> 7.049000000000010795488000000000000E-3097 +decq843 multiply #20800000000000008000000000000000 #2080000000000000F294000000172636 -> #1EF98490000000010F6E4E0000000000 Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqFMA.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqFMA.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1786 @@ +------------------------------------------------------------------------ +-- dqFMA.decTest -- decQuad Fused Multiply Add -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- These tests comprese three parts: +-- 1. Sanity checks and other three-operand tests (especially those +-- where the fused operation makes a difference) +-- 2. Multiply tests (third operand is neutral zero [0E+emax]) +-- 3. Addition tests (first operand is 1) +-- The multiply and addition tests are extensive because FMA may have +-- its own dedicated multiplication or addition routine(s), and they +-- also inherently check the left-to-right properties. + +-- Sanity checks +dqfma0001 fma 1 1 1 -> 2 +dqfma0002 fma 1 1 2 -> 3 +dqfma0003 fma 2 2 3 -> 7 +dqfma0004 fma 9 9 9 -> 90 +dqfma0005 fma -1 1 1 -> 0 +dqfma0006 fma -1 1 2 -> 1 +dqfma0007 fma -2 2 3 -> -1 +dqfma0008 fma -9 9 9 -> -72 +dqfma0011 fma 1 -1 1 -> 0 +dqfma0012 fma 1 -1 2 -> 1 +dqfma0013 fma 2 -2 3 -> -1 +dqfma0014 fma 9 -9 9 -> -72 +dqfma0015 fma 1 1 -1 -> 0 +dqfma0016 fma 1 1 -2 -> -1 +dqfma0017 fma 2 2 -3 -> 1 +dqfma0018 fma 9 9 -9 -> 72 + +-- non-integer exacts +dqfma0100 fma 25.2 63.6 -438 -> 1164.72 +dqfma0101 fma 0.301 0.380 334 -> 334.114380 +dqfma0102 fma 49.2 -4.8 23.3 -> -212.86 +dqfma0103 fma 4.22 0.079 -94.6 -> -94.26662 +dqfma0104 fma 903 0.797 0.887 -> 720.578 +dqfma0105 fma 6.13 -161 65.9 -> -921.03 +dqfma0106 fma 28.2 727 5.45 -> 20506.85 +dqfma0107 fma 4 605 688 -> 3108 +dqfma0108 fma 93.3 0.19 0.226 -> 17.953 +dqfma0109 fma 0.169 -341 5.61 -> -52.019 +dqfma0110 fma -72.2 30 -51.2 -> -2217.2 +dqfma0111 fma -0.409 13 20.4 -> 15.083 +dqfma0112 fma 317 77.0 19.0 -> 24428.0 +dqfma0113 fma 47 6.58 1.62 -> 310.88 +dqfma0114 fma 1.36 0.984 0.493 -> 1.83124 +dqfma0115 fma 72.7 274 1.56 -> 19921.36 +dqfma0116 fma 335 847 83 -> 283828 +dqfma0117 fma 666 0.247 25.4 -> 189.902 +dqfma0118 fma -3.87 3.06 78.0 -> 66.1578 +dqfma0119 fma 0.742 192 35.6 -> 178.064 +dqfma0120 fma -91.6 5.29 0.153 -> -484.411 + +-- cases where result is different from separate multiply + add; each +-- is preceded by the result of unfused multiply and add +-- [this is about 20% of all similar cases in general] +-- -> 4.500119002100000209469729375698778E+38 +dqfma0202 fma 68537985861355864457.5694 6565875762972086605.85969 35892634447236753.172812 -> 4.500119002100000209469729375698779E+38 Inexact Rounded +-- -> 5.996248469584594346858881620185514E+41 +dqfma0208 fma 89261822344727628571.9 6717595845654131383336.89 5061036497288796076266.11 -> 5.996248469584594346858881620185513E+41 Inexact Rounded +-- -> 1.899242968678256924021594770874070E+34 +dqfma0210 fma 320506237232448685.495971 59257597764017967.984448 3205615239077711589912.85 -> 1.899242968678256924021594770874071E+34 Inexact Rounded +-- -> 7.078596978842809537929699954860309E+37 +dqfma0215 fma 220247843259112263.17995 321392340287987979002.80 47533279819997167655440 -> 7.078596978842809537929699954860308E+37 Inexact Rounded +-- -> 1.224955667581427559754106862350743E+37 +dqfma0226 fma 23880729790368880412.1449 512947333827064719.55407 217117438419590824502.963 -> 1.224955667581427559754106862350744E+37 Inexact Rounded +-- -> -2.530094043253148806272276368579144E+42 +dqfma0229 fma 2539892357016099706.4126 -996142232667504817717435 53682082598315949425.937 -> -2.530094043253148806272276368579143E+42 Inexact Rounded +-- -> 1.713387085759711954319391412788454E+37 +dqfma0233 fma 4546339491341624464.0804 3768717864169205581 83578980278690395184.620 -> 1.713387085759711954319391412788453E+37 Inexact Rounded +-- -> 4.062275663405823716411579117771547E+35 +dqfma0235 fma 409242119433816131.42253 992633815166741501.477249 70179636544416756129546 -> 4.062275663405823716411579117771548E+35 Inexact Rounded +-- -> 6.002604327732568490562249875306823E+47 +dqfma0258 fma 817941336593541742159684 733867339769310729266598 78563844650942419311830.8 -> 6.002604327732568490562249875306822E+47 Inexact Rounded +-- -> -2.027022514381452197510103395283874E+39 +dqfma0264 fma 387617310169161270.737532 -5229442703414956061216.62 57665666816652967150473.5 -> -2.027022514381452197510103395283873E+39 Inexact Rounded +-- -> -7.856525039803554001144089842730361E+37 +dqfma0267 fma -847655845720565274701.210 92685316564117739.83984 22780950041376424429.5686 -> -7.856525039803554001144089842730360E+37 Inexact Rounded +-- -> 1.695515562011520746125607502237559E+38 +dqfma0268 fma 21590290365127685.3675 7853139227576541379426.8 -3275859437236180.761544 -> 1.695515562011520746125607502237558E+38 Inexact Rounded +-- -> -8.448422935783289219748115038014710E+38 +dqfma0269 fma -974320636272862697.971586 867109103641860247440.756 -9775170775902454762.98 -> -8.448422935783289219748115038014709E+38 Inexact Rounded + +-- Cases where multiply would overflow or underflow if separate +dqfma0300 fma 9e+6144 10 0 -> Infinity Overflow Inexact Rounded +dqfma0301 fma 1e+6144 10 0 -> Infinity Overflow Inexact Rounded +dqfma0302 fma 1e+6144 10 -1e+6144 -> 9.000000000000000000000000000000000E+6144 Clamped +dqfma0303 fma 1e+6144 10 -9e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped +-- subnormal etc. +dqfma0305 fma 1e-6176 0.1 0 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma0306 fma 1e-6176 0.1 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqfma0307 fma 1e-6176 0.1 1e-6176 -> 1E-6176 Underflow Subnormal Inexact Rounded + +-- Infinite combinations +dqfma0800 fma Inf Inf Inf -> Infinity +dqfma0801 fma Inf Inf -Inf -> NaN Invalid_operation +dqfma0802 fma Inf -Inf Inf -> NaN Invalid_operation +dqfma0803 fma Inf -Inf -Inf -> -Infinity +dqfma0804 fma -Inf Inf Inf -> NaN Invalid_operation +dqfma0805 fma -Inf Inf -Inf -> -Infinity +dqfma0806 fma -Inf -Inf Inf -> Infinity +dqfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation + +-- Triple NaN propagation +dqfma0900 fma NaN2 NaN3 NaN5 -> NaN2 +dqfma0901 fma 0 NaN3 NaN5 -> NaN3 +dqfma0902 fma 0 0 NaN5 -> NaN5 +-- first sNaN wins (consider qNaN from earlier sNaN being +-- overridden by an sNaN in third operand) +dqfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +dqfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation +dqfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation +dqfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +dqfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation +dqfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation + +-- MULTIPLICATION TESTS ------------------------------------------------ +rounding: half_even + +-- sanity checks +dqfma2000 fma 2 2 0e+6144 -> 4 +dqfma2001 fma 2 3 0e+6144 -> 6 +dqfma2002 fma 5 1 0e+6144 -> 5 +dqfma2003 fma 5 2 0e+6144 -> 10 +dqfma2004 fma 1.20 2 0e+6144 -> 2.40 +dqfma2005 fma 1.20 0 0e+6144 -> 0.00 +dqfma2006 fma 1.20 -2 0e+6144 -> -2.40 +dqfma2007 fma -1.20 2 0e+6144 -> -2.40 +dqfma2008 fma -1.20 0 0e+6144 -> 0.00 +dqfma2009 fma -1.20 -2 0e+6144 -> 2.40 +dqfma2010 fma 5.09 7.1 0e+6144 -> 36.139 +dqfma2011 fma 2.5 4 0e+6144 -> 10.0 +dqfma2012 fma 2.50 4 0e+6144 -> 10.00 +dqfma2013 fma 1.23456789 1.0000000000000000000000000000 0e+6144 -> 1.234567890000000000000000000000000 Rounded +dqfma2015 fma 2.50 4 0e+6144 -> 10.00 +dqfma2016 fma 9.99999999999999999 9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded +dqfma2017 fma 9.99999999999999999 -9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded +dqfma2018 fma -9.99999999999999999 9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded +dqfma2019 fma -9.99999999999999999 -9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded + +-- zeros, etc. +dqfma2021 fma 0 0 0e+6144 -> 0 +dqfma2022 fma 0 -0 0e+6144 -> 0 +dqfma2023 fma -0 0 0e+6144 -> 0 +dqfma2024 fma -0 -0 0e+6144 -> 0 +dqfma2025 fma -0.0 -0.0 0e+6144 -> 0.00 +dqfma2026 fma -0.0 -0.0 0e+6144 -> 0.00 +dqfma2027 fma -0.0 -0.0 0e+6144 -> 0.00 +dqfma2028 fma -0.0 -0.0 0e+6144 -> 0.00 +dqfma2030 fma 5.00 1E-3 0e+6144 -> 0.00500 +dqfma2031 fma 00.00 0.000 0e+6144 -> 0.00000 +dqfma2032 fma 00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0 +dqfma2033 fma 0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0 +dqfma2034 fma -5.00 1E-3 0e+6144 -> -0.00500 +dqfma2035 fma -00.00 0.000 0e+6144 -> 0.00000 +dqfma2036 fma -00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0 +dqfma2037 fma -0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0 +dqfma2038 fma 5.00 -1E-3 0e+6144 -> -0.00500 +dqfma2039 fma 00.00 -0.000 0e+6144 -> 0.00000 +dqfma2040 fma 00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0 +dqfma2041 fma 0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0 +dqfma2042 fma -5.00 -1E-3 0e+6144 -> 0.00500 +dqfma2043 fma -00.00 -0.000 0e+6144 -> 0.00000 +dqfma2044 fma -00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0 +dqfma2045 fma -0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0 + +-- examples from decarith +dqfma2050 fma 1.20 3 0e+6144 -> 3.60 +dqfma2051 fma 7 3 0e+6144 -> 21 +dqfma2052 fma 0.9 0.8 0e+6144 -> 0.72 +dqfma2053 fma 0.9 -0 0e+6144 -> 0.0 +dqfma2054 fma 654321 654321 0e+6144 -> 428135971041 + +dqfma2060 fma 123.45 1e7 0e+6144 -> 1.2345E+9 +dqfma2061 fma 123.45 1e8 0e+6144 -> 1.2345E+10 +dqfma2062 fma 123.45 1e+9 0e+6144 -> 1.2345E+11 +dqfma2063 fma 123.45 1e10 0e+6144 -> 1.2345E+12 +dqfma2064 fma 123.45 1e11 0e+6144 -> 1.2345E+13 +dqfma2065 fma 123.45 1e12 0e+6144 -> 1.2345E+14 +dqfma2066 fma 123.45 1e13 0e+6144 -> 1.2345E+15 + + +-- test some intermediate lengths +-- 1234567890123456 +dqfma2080 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9 +dqfma2084 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9 +dqfma2090 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9 +dqfma2094 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9 + +-- test some more edge cases and carries +dqfma2101 fma 9 9 0e+6144 -> 81 +dqfma2102 fma 9 90 0e+6144 -> 810 +dqfma2103 fma 9 900 0e+6144 -> 8100 +dqfma2104 fma 9 9000 0e+6144 -> 81000 +dqfma2105 fma 9 90000 0e+6144 -> 810000 +dqfma2106 fma 9 900000 0e+6144 -> 8100000 +dqfma2107 fma 9 9000000 0e+6144 -> 81000000 +dqfma2108 fma 9 90000000 0e+6144 -> 810000000 +dqfma2109 fma 9 900000000 0e+6144 -> 8100000000 +dqfma2110 fma 9 9000000000 0e+6144 -> 81000000000 +dqfma2111 fma 9 90000000000 0e+6144 -> 810000000000 +dqfma2112 fma 9 900000000000 0e+6144 -> 8100000000000 +dqfma2113 fma 9 9000000000000 0e+6144 -> 81000000000000 +dqfma2114 fma 9 90000000000000 0e+6144 -> 810000000000000 +dqfma2115 fma 9 900000000000000 0e+6144 -> 8100000000000000 +--dqfma2116 fma 9 9000000000000000 0e+6144 -> 81000000000000000 +--dqfma2117 fma 9 90000000000000000 0e+6144 -> 810000000000000000 +--dqfma2118 fma 9 900000000000000000 0e+6144 -> 8100000000000000000 +--dqfma2119 fma 9 9000000000000000000 0e+6144 -> 81000000000000000000 +--dqfma2120 fma 9 90000000000000000000 0e+6144 -> 810000000000000000000 +--dqfma2121 fma 9 900000000000000000000 0e+6144 -> 8100000000000000000000 +--dqfma2122 fma 9 9000000000000000000000 0e+6144 -> 81000000000000000000000 +--dqfma2123 fma 9 90000000000000000000000 0e+6144 -> 810000000000000000000000 +-- test some more edge cases without carries +dqfma2131 fma 3 3 0e+6144 -> 9 +dqfma2132 fma 3 30 0e+6144 -> 90 +dqfma2133 fma 3 300 0e+6144 -> 900 +dqfma2134 fma 3 3000 0e+6144 -> 9000 +dqfma2135 fma 3 30000 0e+6144 -> 90000 +dqfma2136 fma 3 300000 0e+6144 -> 900000 +dqfma2137 fma 3 3000000 0e+6144 -> 9000000 +dqfma2138 fma 3 30000000 0e+6144 -> 90000000 +dqfma2139 fma 3 300000000 0e+6144 -> 900000000 +dqfma2140 fma 3 3000000000 0e+6144 -> 9000000000 +dqfma2141 fma 3 30000000000 0e+6144 -> 90000000000 +dqfma2142 fma 3 300000000000 0e+6144 -> 900000000000 +dqfma2143 fma 3 3000000000000 0e+6144 -> 9000000000000 +dqfma2144 fma 3 30000000000000 0e+6144 -> 90000000000000 +dqfma2145 fma 3 300000000000000 0e+6144 -> 900000000000000 +dqfma2146 fma 3 3000000000000000 0e+6144 -> 9000000000000000 +dqfma2147 fma 3 30000000000000000 0e+6144 -> 90000000000000000 +dqfma2148 fma 3 300000000000000000 0e+6144 -> 900000000000000000 +dqfma2149 fma 3 3000000000000000000 0e+6144 -> 9000000000000000000 +dqfma2150 fma 3 30000000000000000000 0e+6144 -> 90000000000000000000 +dqfma2151 fma 3 300000000000000000000 0e+6144 -> 900000000000000000000 +dqfma2152 fma 3 3000000000000000000000 0e+6144 -> 9000000000000000000000 +dqfma2153 fma 3 30000000000000000000000 0e+6144 -> 90000000000000000000000 + +dqfma2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0e+6144 -> 145433.2908011933696719165119928296 Inexact Rounded + +-- test some edge cases with exact rounding +dqfma2301 fma 900000000000000000 9 0e+6144 -> 8100000000000000000 +dqfma2302 fma 900000000000000000 90 0e+6144 -> 81000000000000000000 +dqfma2303 fma 900000000000000000 900 0e+6144 -> 810000000000000000000 +dqfma2304 fma 900000000000000000 9000 0e+6144 -> 8100000000000000000000 +dqfma2305 fma 900000000000000000 90000 0e+6144 -> 81000000000000000000000 +dqfma2306 fma 900000000000000000 900000 0e+6144 -> 810000000000000000000000 +dqfma2307 fma 900000000000000000 9000000 0e+6144 -> 8100000000000000000000000 +dqfma2308 fma 900000000000000000 90000000 0e+6144 -> 81000000000000000000000000 +dqfma2309 fma 900000000000000000 900000000 0e+6144 -> 810000000000000000000000000 +dqfma2310 fma 900000000000000000 9000000000 0e+6144 -> 8100000000000000000000000000 +dqfma2311 fma 900000000000000000 90000000000 0e+6144 -> 81000000000000000000000000000 +dqfma2312 fma 900000000000000000 900000000000 0e+6144 -> 810000000000000000000000000000 +dqfma2313 fma 900000000000000000 9000000000000 0e+6144 -> 8100000000000000000000000000000 +dqfma2314 fma 900000000000000000 90000000000000 0e+6144 -> 81000000000000000000000000000000 +dqfma2315 fma 900000000000000000 900000000000000 0e+6144 -> 810000000000000000000000000000000 +dqfma2316 fma 900000000000000000 9000000000000000 0e+6144 -> 8100000000000000000000000000000000 +dqfma2317 fma 9000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+34 Rounded +dqfma2318 fma 90000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+35 Rounded +dqfma2319 fma 900000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+36 Rounded +dqfma2320 fma 9000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+37 Rounded +dqfma2321 fma 90000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+38 Rounded +dqfma2322 fma 900000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+39 Rounded +dqfma2323 fma 9000000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+40 Rounded + +-- tryzeros cases +dqfma2504 fma 0E-4260 1000E-4260 0e+6144 -> 0E-6176 Clamped +dqfma2505 fma 100E+4260 0E+4260 0e+6144 -> 0E+6111 Clamped + +-- mixed with zeros +dqfma2541 fma 0 -1 0e+6144 -> 0 +dqfma2542 fma -0 -1 0e+6144 -> 0 +dqfma2543 fma 0 1 0e+6144 -> 0 +dqfma2544 fma -0 1 0e+6144 -> 0 +dqfma2545 fma -1 0 0e+6144 -> 0 +dqfma2546 fma -1 -0 0e+6144 -> 0 +dqfma2547 fma 1 0 0e+6144 -> 0 +dqfma2548 fma 1 -0 0e+6144 -> 0 + +dqfma2551 fma 0.0 -1 0e+6144 -> 0.0 +dqfma2552 fma -0.0 -1 0e+6144 -> 0.0 +dqfma2553 fma 0.0 1 0e+6144 -> 0.0 +dqfma2554 fma -0.0 1 0e+6144 -> 0.0 +dqfma2555 fma -1.0 0 0e+6144 -> 0.0 +dqfma2556 fma -1.0 -0 0e+6144 -> 0.0 +dqfma2557 fma 1.0 0 0e+6144 -> 0.0 +dqfma2558 fma 1.0 -0 0e+6144 -> 0.0 + +dqfma2561 fma 0 -1.0 0e+6144 -> 0.0 +dqfma2562 fma -0 -1.0 0e+6144 -> 0.0 +dqfma2563 fma 0 1.0 0e+6144 -> 0.0 +dqfma2564 fma -0 1.0 0e+6144 -> 0.0 +dqfma2565 fma -1 0.0 0e+6144 -> 0.0 +dqfma2566 fma -1 -0.0 0e+6144 -> 0.0 +dqfma2567 fma 1 0.0 0e+6144 -> 0.0 +dqfma2568 fma 1 -0.0 0e+6144 -> 0.0 + +dqfma2571 fma 0.0 -1.0 0e+6144 -> 0.00 +dqfma2572 fma -0.0 -1.0 0e+6144 -> 0.00 +dqfma2573 fma 0.0 1.0 0e+6144 -> 0.00 +dqfma2574 fma -0.0 1.0 0e+6144 -> 0.00 +dqfma2575 fma -1.0 0.0 0e+6144 -> 0.00 +dqfma2576 fma -1.0 -0.0 0e+6144 -> 0.00 +dqfma2577 fma 1.0 0.0 0e+6144 -> 0.00 +dqfma2578 fma 1.0 -0.0 0e+6144 -> 0.00 +dqfma2579 fma 1.0 0.0 0e+6144 -> 0.00 +dqfma2530 fma -1.0 -0.0 0e+6144 -> 0.00 +dqfma2531 fma -1.0 0.0 0e+6144 -> 0.00 +dqfma2532 fma 1.0 -0.0 -0e+6144 -> -0.00 +dqfma2533 fma 1.0 0.0 -0e+6144 -> 0.00 +dqfma2534 fma -1.0 -0.0 -0e+6144 -> 0.00 +dqfma2535 fma -1.0 0.0 -0e+6144 -> -0.00 + + +-- Specials +dqfma2580 fma Inf -Inf 0e+6144 -> -Infinity +dqfma2581 fma Inf -1000 0e+6144 -> -Infinity +dqfma2582 fma Inf -1 0e+6144 -> -Infinity +dqfma2583 fma Inf -0 0e+6144 -> NaN Invalid_operation +dqfma2584 fma Inf 0 0e+6144 -> NaN Invalid_operation +dqfma2585 fma Inf 1 0e+6144 -> Infinity +dqfma2586 fma Inf 1000 0e+6144 -> Infinity +dqfma2587 fma Inf Inf 0e+6144 -> Infinity +dqfma2588 fma -1000 Inf 0e+6144 -> -Infinity +dqfma2589 fma -Inf Inf 0e+6144 -> -Infinity +dqfma2590 fma -1 Inf 0e+6144 -> -Infinity +dqfma2591 fma -0 Inf 0e+6144 -> NaN Invalid_operation +dqfma2592 fma 0 Inf 0e+6144 -> NaN Invalid_operation +dqfma2593 fma 1 Inf 0e+6144 -> Infinity +dqfma2594 fma 1000 Inf 0e+6144 -> Infinity +dqfma2595 fma Inf Inf 0e+6144 -> Infinity + +dqfma2600 fma -Inf -Inf 0e+6144 -> Infinity +dqfma2601 fma -Inf -1000 0e+6144 -> Infinity +dqfma2602 fma -Inf -1 0e+6144 -> Infinity +dqfma2603 fma -Inf -0 0e+6144 -> NaN Invalid_operation +dqfma2604 fma -Inf 0 0e+6144 -> NaN Invalid_operation +dqfma2605 fma -Inf 1 0e+6144 -> -Infinity +dqfma2606 fma -Inf 1000 0e+6144 -> -Infinity +dqfma2607 fma -Inf Inf 0e+6144 -> -Infinity +dqfma2608 fma -1000 Inf 0e+6144 -> -Infinity +dqfma2609 fma -Inf -Inf 0e+6144 -> Infinity +dqfma2610 fma -1 -Inf 0e+6144 -> Infinity +dqfma2611 fma -0 -Inf 0e+6144 -> NaN Invalid_operation +dqfma2612 fma 0 -Inf 0e+6144 -> NaN Invalid_operation +dqfma2613 fma 1 -Inf 0e+6144 -> -Infinity +dqfma2614 fma 1000 -Inf 0e+6144 -> -Infinity +dqfma2615 fma Inf -Inf 0e+6144 -> -Infinity + +dqfma2621 fma NaN -Inf 0e+6144 -> NaN +dqfma2622 fma NaN -1000 0e+6144 -> NaN +dqfma2623 fma NaN -1 0e+6144 -> NaN +dqfma2624 fma NaN -0 0e+6144 -> NaN +dqfma2625 fma NaN 0 0e+6144 -> NaN +dqfma2626 fma NaN 1 0e+6144 -> NaN +dqfma2627 fma NaN 1000 0e+6144 -> NaN +dqfma2628 fma NaN Inf 0e+6144 -> NaN +dqfma2629 fma NaN NaN 0e+6144 -> NaN +dqfma2630 fma -Inf NaN 0e+6144 -> NaN +dqfma2631 fma -1000 NaN 0e+6144 -> NaN +dqfma2632 fma -1 NaN 0e+6144 -> NaN +dqfma2633 fma -0 NaN 0e+6144 -> NaN +dqfma2634 fma 0 NaN 0e+6144 -> NaN +dqfma2635 fma 1 NaN 0e+6144 -> NaN +dqfma2636 fma 1000 NaN 0e+6144 -> NaN +dqfma2637 fma Inf NaN 0e+6144 -> NaN + +dqfma2641 fma sNaN -Inf 0e+6144 -> NaN Invalid_operation +dqfma2642 fma sNaN -1000 0e+6144 -> NaN Invalid_operation +dqfma2643 fma sNaN -1 0e+6144 -> NaN Invalid_operation +dqfma2644 fma sNaN -0 0e+6144 -> NaN Invalid_operation +dqfma2645 fma sNaN 0 0e+6144 -> NaN Invalid_operation +dqfma2646 fma sNaN 1 0e+6144 -> NaN Invalid_operation +dqfma2647 fma sNaN 1000 0e+6144 -> NaN Invalid_operation +dqfma2648 fma sNaN NaN 0e+6144 -> NaN Invalid_operation +dqfma2649 fma sNaN sNaN 0e+6144 -> NaN Invalid_operation +dqfma2650 fma NaN sNaN 0e+6144 -> NaN Invalid_operation +dqfma2651 fma -Inf sNaN 0e+6144 -> NaN Invalid_operation +dqfma2652 fma -1000 sNaN 0e+6144 -> NaN Invalid_operation +dqfma2653 fma -1 sNaN 0e+6144 -> NaN Invalid_operation +dqfma2654 fma -0 sNaN 0e+6144 -> NaN Invalid_operation +dqfma2655 fma 0 sNaN 0e+6144 -> NaN Invalid_operation +dqfma2656 fma 1 sNaN 0e+6144 -> NaN Invalid_operation +dqfma2657 fma 1000 sNaN 0e+6144 -> NaN Invalid_operation +dqfma2658 fma Inf sNaN 0e+6144 -> NaN Invalid_operation +dqfma2659 fma NaN sNaN 0e+6144 -> NaN Invalid_operation + +-- propagating NaNs +dqfma2661 fma NaN9 -Inf 0e+6144 -> NaN9 +dqfma2662 fma NaN8 999 0e+6144 -> NaN8 +dqfma2663 fma NaN71 Inf 0e+6144 -> NaN71 +dqfma2664 fma NaN6 NaN5 0e+6144 -> NaN6 +dqfma2665 fma -Inf NaN4 0e+6144 -> NaN4 +dqfma2666 fma -999 NaN33 0e+6144 -> NaN33 +dqfma2667 fma Inf NaN2 0e+6144 -> NaN2 + +dqfma2671 fma sNaN99 -Inf 0e+6144 -> NaN99 Invalid_operation +dqfma2672 fma sNaN98 -11 0e+6144 -> NaN98 Invalid_operation +dqfma2673 fma sNaN97 NaN 0e+6144 -> NaN97 Invalid_operation +dqfma2674 fma sNaN16 sNaN94 0e+6144 -> NaN16 Invalid_operation +dqfma2675 fma NaN95 sNaN93 0e+6144 -> NaN93 Invalid_operation +dqfma2676 fma -Inf sNaN92 0e+6144 -> NaN92 Invalid_operation +dqfma2677 fma 088 sNaN91 0e+6144 -> NaN91 Invalid_operation +dqfma2678 fma Inf sNaN90 0e+6144 -> NaN90 Invalid_operation +dqfma2679 fma NaN sNaN89 0e+6144 -> NaN89 Invalid_operation + +dqfma2681 fma -NaN9 -Inf 0e+6144 -> -NaN9 +dqfma2682 fma -NaN8 999 0e+6144 -> -NaN8 +dqfma2683 fma -NaN71 Inf 0e+6144 -> -NaN71 +dqfma2684 fma -NaN6 -NaN5 0e+6144 -> -NaN6 +dqfma2685 fma -Inf -NaN4 0e+6144 -> -NaN4 +dqfma2686 fma -999 -NaN33 0e+6144 -> -NaN33 +dqfma2687 fma Inf -NaN2 0e+6144 -> -NaN2 + +dqfma2691 fma -sNaN99 -Inf 0e+6144 -> -NaN99 Invalid_operation +dqfma2692 fma -sNaN98 -11 0e+6144 -> -NaN98 Invalid_operation +dqfma2693 fma -sNaN97 NaN 0e+6144 -> -NaN97 Invalid_operation +dqfma2694 fma -sNaN16 -sNaN94 0e+6144 -> -NaN16 Invalid_operation +dqfma2695 fma -NaN95 -sNaN93 0e+6144 -> -NaN93 Invalid_operation +dqfma2696 fma -Inf -sNaN92 0e+6144 -> -NaN92 Invalid_operation +dqfma2697 fma 088 -sNaN91 0e+6144 -> -NaN91 Invalid_operation +dqfma2698 fma Inf -sNaN90 0e+6144 -> -NaN90 Invalid_operation +dqfma2699 fma -NaN -sNaN89 0e+6144 -> -NaN89 Invalid_operation + +dqfma2701 fma -NaN -Inf 0e+6144 -> -NaN +dqfma2702 fma -NaN 999 0e+6144 -> -NaN +dqfma2703 fma -NaN Inf 0e+6144 -> -NaN +dqfma2704 fma -NaN -NaN 0e+6144 -> -NaN +dqfma2705 fma -Inf -NaN0 0e+6144 -> -NaN +dqfma2706 fma -999 -NaN 0e+6144 -> -NaN +dqfma2707 fma Inf -NaN 0e+6144 -> -NaN + +dqfma2711 fma -sNaN -Inf 0e+6144 -> -NaN Invalid_operation +dqfma2712 fma -sNaN -11 0e+6144 -> -NaN Invalid_operation +dqfma2713 fma -sNaN00 NaN 0e+6144 -> -NaN Invalid_operation +dqfma2714 fma -sNaN -sNaN 0e+6144 -> -NaN Invalid_operation +dqfma2715 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation +dqfma2716 fma -Inf -sNaN 0e+6144 -> -NaN Invalid_operation +dqfma2717 fma 088 -sNaN 0e+6144 -> -NaN Invalid_operation +dqfma2718 fma Inf -sNaN 0e+6144 -> -NaN Invalid_operation +dqfma2719 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +-- signs +dqfma2751 fma 1e+4277 1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2752 fma 1e+4277 -1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded +dqfma2753 fma -1e+4277 1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded +dqfma2754 fma -1e+4277 -1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2755 fma 1e-4277 1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2756 fma 1e-4277 -1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2757 fma -1e-4277 1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2758 fma -1e-4277 -1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +dqfma2760 fma 1e-6069 1e-101 0e+6144 -> 1E-6170 Subnormal +dqfma2761 fma 1e-6069 1e-102 0e+6144 -> 1E-6171 Subnormal +dqfma2762 fma 1e-6069 1e-103 0e+6144 -> 1E-6172 Subnormal +dqfma2763 fma 1e-6069 1e-104 0e+6144 -> 1E-6173 Subnormal +dqfma2764 fma 1e-6069 1e-105 0e+6144 -> 1E-6174 Subnormal +dqfma2765 fma 1e-6069 1e-106 0e+6144 -> 1E-6175 Subnormal +dqfma2766 fma 1e-6069 1e-107 0e+6144 -> 1E-6176 Subnormal +dqfma2767 fma 1e-6069 1e-108 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2768 fma 1e-6069 1e-109 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2769 fma 1e-6069 1e-110 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +dqfma2770 fma 1e+40 1e+6101 0e+6144 -> 1.000000000000000000000000000000E+6141 Clamped +dqfma2771 fma 1e+40 1e+6102 0e+6144 -> 1.0000000000000000000000000000000E+6142 Clamped +dqfma2772 fma 1e+40 1e+6103 0e+6144 -> 1.00000000000000000000000000000000E+6143 Clamped +dqfma2773 fma 1e+40 1e+6104 0e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped +dqfma2774 fma 1e+40 1e+6105 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2775 fma 1e+40 1e+6106 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2776 fma 1e+40 1e+6107 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2777 fma 1e+40 1e+6108 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2778 fma 1e+40 1e+6109 0e+6144 -> Infinity Overflow Inexact Rounded +dqfma2779 fma 1e+40 1e+6110 0e+6144 -> Infinity Overflow Inexact Rounded + +dqfma2801 fma 1.0000E-6172 1 0e+6144 -> 1.0000E-6172 Subnormal +dqfma2802 fma 1.000E-6172 1e-1 0e+6144 -> 1.000E-6173 Subnormal +dqfma2803 fma 1.00E-6172 1e-2 0e+6144 -> 1.00E-6174 Subnormal +dqfma2804 fma 1.0E-6172 1e-3 0e+6144 -> 1.0E-6175 Subnormal +dqfma2805 fma 1.0E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal Rounded +dqfma2806 fma 1.3E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqfma2807 fma 1.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2808 fma 1.7E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2809 fma 2.3E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2810 fma 2.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2811 fma 2.7E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded +dqfma2812 fma 1.49E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqfma2813 fma 1.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2814 fma 1.51E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2815 fma 2.49E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2816 fma 2.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqfma2817 fma 2.51E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded + +dqfma2818 fma 1E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal +dqfma2819 fma 3E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2820 fma 5E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2821 fma 7E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqfma2822 fma 9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqfma2823 fma 9.9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded + +dqfma2824 fma 1E-6172 -1e-4 0e+6144 -> -1E-6176 Subnormal +dqfma2825 fma 3E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2826 fma -5E-6172 1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2827 fma 7E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqfma2828 fma -9E-6172 1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqfma2829 fma 9.9E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqfma2830 fma 3.0E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped + +dqfma2831 fma 1.0E-5977 1e-200 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqfma2832 fma 1.0E-5977 1e-199 0e+6144 -> 1E-6176 Subnormal Rounded +dqfma2833 fma 1.0E-5977 1e-198 0e+6144 -> 1.0E-6175 Subnormal +dqfma2834 fma 2.0E-5977 2e-198 0e+6144 -> 4.0E-6175 Subnormal +dqfma2835 fma 4.0E-5977 4e-198 0e+6144 -> 1.60E-6174 Subnormal +dqfma2836 fma 10.0E-5977 10e-198 0e+6144 -> 1.000E-6173 Subnormal +dqfma2837 fma 30.0E-5977 30e-198 0e+6144 -> 9.000E-6173 Subnormal +dqfma2838 fma 40.0E-5982 40e-166 0e+6144 -> 1.6000E-6145 Subnormal +dqfma2839 fma 40.0E-5982 40e-165 0e+6144 -> 1.6000E-6144 Subnormal +dqfma2840 fma 40.0E-5982 40e-164 0e+6144 -> 1.6000E-6143 + +-- Long operand overflow may be a different path +dqfma2870 fma 100 9.999E+6143 0e+6144 -> Infinity Inexact Overflow Rounded +dqfma2871 fma 100 -9.999E+6143 0e+6144 -> -Infinity Inexact Overflow Rounded +dqfma2872 fma 9.999E+6143 100 0e+6144 -> Infinity Inexact Overflow Rounded +dqfma2873 fma -9.999E+6143 100 0e+6144 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +dqfma2881 fma 1.2347E-6133 1.2347E-40 0e+6144 -> 1.524E-6173 Inexact Rounded Subnormal Underflow +dqfma2882 fma 1.234E-6133 1.234E-40 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow +dqfma2883 fma 1.23E-6133 1.23E-40 0e+6144 -> 1.513E-6173 Inexact Rounded Subnormal Underflow +dqfma2884 fma 1.2E-6133 1.2E-40 0e+6144 -> 1.44E-6173 Subnormal +dqfma2885 fma 1.2E-6133 1.2E-41 0e+6144 -> 1.44E-6174 Subnormal +dqfma2886 fma 1.2E-6133 1.2E-42 0e+6144 -> 1.4E-6175 Subnormal Inexact Rounded Underflow +dqfma2887 fma 1.2E-6133 1.3E-42 0e+6144 -> 1.6E-6175 Subnormal Inexact Rounded Underflow +dqfma2888 fma 1.3E-6133 1.3E-42 0e+6144 -> 1.7E-6175 Subnormal Inexact Rounded Underflow +dqfma2889 fma 1.3E-6133 1.3E-43 0e+6144 -> 2E-6176 Subnormal Inexact Rounded Underflow +dqfma2890 fma 1.3E-6134 1.3E-43 0e+6144 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow + +dqfma2891 fma 1.2345E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow +dqfma2892 fma 1.23456E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow +dqfma2893 fma 1.2345E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow +dqfma2894 fma 1.23456E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow +dqfma2895 fma 1.2345E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow +dqfma2896 fma 1.23456E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +-- prove operands are exact +dqfma2906 fma 9.999999999999999999999999999999999E-6143 1 0e+6144 -> 9.999999999999999999999999999999999E-6143 +dqfma2907 fma 1 0.09999999999999999999999999999999999 0e+6144 -> 0.09999999999999999999999999999999999 +-- the next rounds to Nmin +dqfma2908 fma 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 0e+6144 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded + +-- hugest +dqfma2909 fma 9999999999999999999999999999999999 9999999999999999999999999999999999 0e+6144 -> 9.999999999999999999999999999999998E+67 Inexact Rounded + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +dqfma21001 fma 130E-2 120E-2 0e+6144 -> 1.5600 +dqfma21002 fma 130E-2 12E-1 0e+6144 -> 1.560 +dqfma21003 fma 130E-2 1E0 0e+6144 -> 1.30 +dqfma21004 fma 1E2 1E4 0e+6144 -> 1E+6 + +-- Null tests +dqfma2990 fma 10 # 0e+6144 -> NaN Invalid_operation +dqfma2991 fma # 10 0e+6144 -> NaN Invalid_operation + + +-- ADDITION TESTS ------------------------------------------------------ +rounding: half_even + +-- [first group are 'quick confidence check'] +dqadd3001 fma 1 1 1 -> 2 +dqadd3002 fma 1 2 3 -> 5 +dqadd3003 fma 1 '5.75' '3.3' -> 9.05 +dqadd3004 fma 1 '5' '-3' -> 2 +dqadd3005 fma 1 '-5' '-3' -> -8 +dqadd3006 fma 1 '-7' '2.5' -> -4.5 +dqadd3007 fma 1 '0.7' '0.3' -> 1.0 +dqadd3008 fma 1 '1.25' '1.25' -> 2.50 +dqadd3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789' +dqadd3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800' + +-- 1234567890123456 1234567890123456 +dqadd3011 fma 1 '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded +dqadd3012 fma 1 '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded +dqadd3013 fma 1 '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999' +dqadd3014 fma 1 '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd3015 fma 1 '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd3016 fma 1 '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd3017 fma 1 '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded +dqadd3018 fma 1 '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded +dqadd3019 fma 1 '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded +dqadd3020 fma 1 '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded + +dqadd3021 fma 1 0 1 -> 1 +dqadd3022 fma 1 1 1 -> 2 +dqadd3023 fma 1 2 1 -> 3 +dqadd3024 fma 1 3 1 -> 4 +dqadd3025 fma 1 4 1 -> 5 +dqadd3026 fma 1 5 1 -> 6 +dqadd3027 fma 1 6 1 -> 7 +dqadd3028 fma 1 7 1 -> 8 +dqadd3029 fma 1 8 1 -> 9 +dqadd3030 fma 1 9 1 -> 10 + +-- some carrying effects +dqadd3031 fma 1 '0.9998' '0.0000' -> '0.9998' +dqadd3032 fma 1 '0.9998' '0.0001' -> '0.9999' +dqadd3033 fma 1 '0.9998' '0.0002' -> '1.0000' +dqadd3034 fma 1 '0.9998' '0.0003' -> '1.0001' + +dqadd3035 fma 1 '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd3036 fma 1 '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd3037 fma 1 '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd3038 fma 1 '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded +dqadd3039 fma 1 '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded + +-- symmetry: +dqadd3040 fma 1 '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd3041 fma 1 '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd3042 fma 1 '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqadd3044 fma 1 '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded +dqadd3045 fma 1 '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded + +-- same, without rounding +dqadd3046 fma 1 '10000e+9' '7' -> '10000000000007' +dqadd3047 fma 1 '10000e+9' '70' -> '10000000000070' +dqadd3048 fma 1 '10000e+9' '700' -> '10000000000700' +dqadd3049 fma 1 '10000e+9' '7000' -> '10000000007000' +dqadd3050 fma 1 '10000e+9' '70000' -> '10000000070000' +dqadd3051 fma 1 '10000e+9' '700000' -> '10000000700000' +dqadd3052 fma 1 '10000e+9' '7000000' -> '10000007000000' + +-- examples from decarith +dqadd3053 fma 1 '12' '7.00' -> '19.00' +dqadd3054 fma 1 '1.3' '-1.07' -> '0.23' +dqadd3055 fma 1 '1.3' '-1.30' -> '0.00' +dqadd3056 fma 1 '1.3' '-2.07' -> '-0.77' +dqadd3057 fma 1 '1E+2' '1E+4' -> '1.01E+4' + +-- leading zero preservation +dqadd3061 fma 1 1 '0.0001' -> '1.0001' +dqadd3062 fma 1 1 '0.00001' -> '1.00001' +dqadd3063 fma 1 1 '0.000001' -> '1.000001' +dqadd3064 fma 1 1 '0.0000001' -> '1.0000001' +dqadd3065 fma 1 1 '0.00000001' -> '1.00000001' + +-- some funny zeros [in case of bad signum] +dqadd3070 fma 1 1 0 -> 1 +dqadd3071 fma 1 1 0. -> 1 +dqadd3072 fma 1 1 .0 -> 1.0 +dqadd3073 fma 1 1 0.0 -> 1.0 +dqadd3074 fma 1 1 0.00 -> 1.00 +dqadd3075 fma 1 0 1 -> 1 +dqadd3076 fma 1 0. 1 -> 1 +dqadd3077 fma 1 .0 1 -> 1.0 +dqadd3078 fma 1 0.0 1 -> 1.0 +dqadd3079 fma 1 0.00 1 -> 1.00 + +-- some carries +dqadd3080 fma 1 999999998 1 -> 999999999 +dqadd3081 fma 1 999999999 1 -> 1000000000 +dqadd3082 fma 1 99999999 1 -> 100000000 +dqadd3083 fma 1 9999999 1 -> 10000000 +dqadd3084 fma 1 999999 1 -> 1000000 +dqadd3085 fma 1 99999 1 -> 100000 +dqadd3086 fma 1 9999 1 -> 10000 +dqadd3087 fma 1 999 1 -> 1000 +dqadd3088 fma 1 99 1 -> 100 +dqadd3089 fma 1 9 1 -> 10 + + +-- more LHS swaps +dqadd3090 fma 1 '-56267E-10' 0 -> '-0.0000056267' +dqadd3091 fma 1 '-56267E-6' 0 -> '-0.056267' +dqadd3092 fma 1 '-56267E-5' 0 -> '-0.56267' +dqadd3093 fma 1 '-56267E-4' 0 -> '-5.6267' +dqadd3094 fma 1 '-56267E-3' 0 -> '-56.267' +dqadd3095 fma 1 '-56267E-2' 0 -> '-562.67' +dqadd3096 fma 1 '-56267E-1' 0 -> '-5626.7' +dqadd3097 fma 1 '-56267E-0' 0 -> '-56267' +dqadd3098 fma 1 '-5E-10' 0 -> '-5E-10' +dqadd3099 fma 1 '-5E-7' 0 -> '-5E-7' +dqadd3100 fma 1 '-5E-6' 0 -> '-0.000005' +dqadd3101 fma 1 '-5E-5' 0 -> '-0.00005' +dqadd3102 fma 1 '-5E-4' 0 -> '-0.0005' +dqadd3103 fma 1 '-5E-1' 0 -> '-0.5' +dqadd3104 fma 1 '-5E0' 0 -> '-5' +dqadd3105 fma 1 '-5E1' 0 -> '-50' +dqadd3106 fma 1 '-5E5' 0 -> '-500000' +dqadd3107 fma 1 '-5E33' 0 -> '-5000000000000000000000000000000000' +dqadd3108 fma 1 '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded +dqadd3109 fma 1 '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded +dqadd3110 fma 1 '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded +dqadd3111 fma 1 '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded + +-- more RHS swaps +dqadd3113 fma 1 0 '-56267E-10' -> '-0.0000056267' +dqadd3114 fma 1 0 '-56267E-6' -> '-0.056267' +dqadd3116 fma 1 0 '-56267E-5' -> '-0.56267' +dqadd3117 fma 1 0 '-56267E-4' -> '-5.6267' +dqadd3119 fma 1 0 '-56267E-3' -> '-56.267' +dqadd3120 fma 1 0 '-56267E-2' -> '-562.67' +dqadd3121 fma 1 0 '-56267E-1' -> '-5626.7' +dqadd3122 fma 1 0 '-56267E-0' -> '-56267' +dqadd3123 fma 1 0 '-5E-10' -> '-5E-10' +dqadd3124 fma 1 0 '-5E-7' -> '-5E-7' +dqadd3125 fma 1 0 '-5E-6' -> '-0.000005' +dqadd3126 fma 1 0 '-5E-5' -> '-0.00005' +dqadd3127 fma 1 0 '-5E-4' -> '-0.0005' +dqadd3128 fma 1 0 '-5E-1' -> '-0.5' +dqadd3129 fma 1 0 '-5E0' -> '-5' +dqadd3130 fma 1 0 '-5E1' -> '-50' +dqadd3131 fma 1 0 '-5E5' -> '-500000' +dqadd3132 fma 1 0 '-5E33' -> '-5000000000000000000000000000000000' +dqadd3133 fma 1 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded +dqadd3134 fma 1 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded +dqadd3135 fma 1 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded +dqadd3136 fma 1 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded + +-- related +dqadd3137 fma 1 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded +dqadd3138 fma 1 -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded +dqadd3139 fma 1 '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded +dqadd3140 fma 1 '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded +dqadd3141 fma 1 1E+29 0.0000 -> '100000000000000000000000000000.0000' +dqadd3142 fma 1 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded +dqadd3143 fma 1 0.000 1E+30 -> '1000000000000000000000000000000.000' +dqadd3144 fma 1 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +dqadd3146 fma 1 '00.0' 0 -> '0.0' +dqadd3147 fma 1 '0.00' 0 -> '0.00' +dqadd3148 fma 1 0 '0.00' -> '0.00' +dqadd3149 fma 1 0 '00.0' -> '0.0' +dqadd3150 fma 1 '00.0' '0.00' -> '0.00' +dqadd3151 fma 1 '0.00' '00.0' -> '0.00' +dqadd3152 fma 1 '3' '.3' -> '3.3' +dqadd3153 fma 1 '3.' '.3' -> '3.3' +dqadd3154 fma 1 '3.0' '.3' -> '3.3' +dqadd3155 fma 1 '3.00' '.3' -> '3.30' +dqadd3156 fma 1 '3' '3' -> '6' +dqadd3157 fma 1 '3' '+3' -> '6' +dqadd3158 fma 1 '3' '-3' -> '0' +dqadd3159 fma 1 '0.3' '-0.3' -> '0.0' +dqadd3160 fma 1 '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +dqadd3161 fma 1 '1E+12' '-1' -> '999999999999' +dqadd3162 fma 1 '1E+12' '1.11' -> '1000000000001.11' +dqadd3163 fma 1 '1.11' '1E+12' -> '1000000000001.11' +dqadd3164 fma 1 '-1' '1E+12' -> '999999999999' +dqadd3165 fma 1 '7E+12' '-1' -> '6999999999999' +dqadd3166 fma 1 '7E+12' '1.11' -> '7000000000001.11' +dqadd3167 fma 1 '1.11' '7E+12' -> '7000000000001.11' +dqadd3168 fma 1 '-1' '7E+12' -> '6999999999999' + +rounding: half_up +dqadd3170 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded +dqadd3171 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded +dqadd3172 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded +dqadd3173 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded +dqadd3174 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd3175 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd3176 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd3177 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded +dqadd3178 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded +dqadd3179 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd3180 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd3181 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd3182 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded +dqadd3183 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded + +-- and some more, including residue effects and different roundings +rounding: half_up +dqadd3200 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789' +dqadd3201 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3202 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3203 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3204 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3205 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3206 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3207 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3208 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3209 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3210 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3211 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3212 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3213 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3214 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3215 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3216 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790' +dqadd3217 fma 1 '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3218 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3219 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded + +rounding: half_even +dqadd3220 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789' +dqadd3221 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3222 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3223 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3224 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3225 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3226 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3227 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3228 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3229 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3230 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3231 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3232 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3233 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3234 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3235 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3236 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790' +dqadd3237 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3238 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3239 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded +-- critical few with even bottom digit... +dqadd3240 fma 1 '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded +dqadd3241 fma 1 '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded +dqadd3242 fma 1 '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded + +rounding: down +dqadd3250 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789' +dqadd3251 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3252 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3253 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3254 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3255 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3256 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3257 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3258 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3259 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3260 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3261 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3262 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3263 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3264 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3265 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded +dqadd3266 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790' +dqadd3267 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3268 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded +dqadd3269 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +dqadd3301 fma 1 -1 1 -> 0 +dqadd3302 fma 1 0 1 -> 1 +dqadd3303 fma 1 1 1 -> 2 +dqadd3304 fma 1 12 1 -> 13 +dqadd3305 fma 1 98 1 -> 99 +dqadd3306 fma 1 99 1 -> 100 +dqadd3307 fma 1 100 1 -> 101 +dqadd3308 fma 1 101 1 -> 102 +dqadd3309 fma 1 -1 -1 -> -2 +dqadd3310 fma 1 0 -1 -> -1 +dqadd3311 fma 1 1 -1 -> 0 +dqadd3312 fma 1 12 -1 -> 11 +dqadd3313 fma 1 98 -1 -> 97 +dqadd3314 fma 1 99 -1 -> 98 +dqadd3315 fma 1 100 -1 -> 99 +dqadd3316 fma 1 101 -1 -> 100 + +dqadd3321 fma 1 -0.01 0.01 -> 0.00 +dqadd3322 fma 1 0.00 0.01 -> 0.01 +dqadd3323 fma 1 0.01 0.01 -> 0.02 +dqadd3324 fma 1 0.12 0.01 -> 0.13 +dqadd3325 fma 1 0.98 0.01 -> 0.99 +dqadd3326 fma 1 0.99 0.01 -> 1.00 +dqadd3327 fma 1 1.00 0.01 -> 1.01 +dqadd3328 fma 1 1.01 0.01 -> 1.02 +dqadd3329 fma 1 -0.01 -0.01 -> -0.02 +dqadd3330 fma 1 0.00 -0.01 -> -0.01 +dqadd3331 fma 1 0.01 -0.01 -> 0.00 +dqadd3332 fma 1 0.12 -0.01 -> 0.11 +dqadd3333 fma 1 0.98 -0.01 -> 0.97 +dqadd3334 fma 1 0.99 -0.01 -> 0.98 +dqadd3335 fma 1 1.00 -0.01 -> 0.99 +dqadd3336 fma 1 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +dqadd3340 fma 1 1E+3 0 -> 1000 +dqadd3341 fma 1 1E+33 0 -> 1000000000000000000000000000000000 +dqadd3342 fma 1 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded +dqadd3343 fma 1 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded +-- which simply follow from these cases ... +dqadd3344 fma 1 1E+3 1 -> 1001 +dqadd3345 fma 1 1E+33 1 -> 1000000000000000000000000000000001 +dqadd3346 fma 1 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd3347 fma 1 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded +dqadd3348 fma 1 1E+3 7 -> 1007 +dqadd3349 fma 1 1E+33 7 -> 1000000000000000000000000000000007 +dqadd3350 fma 1 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded +dqadd3351 fma 1 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded + +-- tryzeros cases +rounding: half_up +dqadd3360 fma 1 0E+50 10000E+1 -> 1.0000E+5 +dqadd3361 fma 1 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded +dqadd3362 fma 1 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded +dqadd3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact +dqadd3364 fma 1 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111 +-- 1 234567890123456789012345678901234 + +-- a curiosity from JSR 13 testing +rounding: half_down +dqadd3370 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814 +dqadd3371 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact +rounding: half_up +dqadd3372 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814 +dqadd3373 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact +rounding: half_even +dqadd3374 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814 +dqadd3375 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact + +-- ulp replacement tests +dqadd3400 fma 1 1 77e-32 -> 1.00000000000000000000000000000077 +dqadd3401 fma 1 1 77e-33 -> 1.000000000000000000000000000000077 +dqadd3402 fma 1 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded +dqadd3403 fma 1 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded +dqadd3404 fma 1 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd3405 fma 1 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd3406 fma 1 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd3410 fma 1 10 77e-32 -> 10.00000000000000000000000000000077 +dqadd3411 fma 1 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded +dqadd3412 fma 1 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded +dqadd3413 fma 1 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd3414 fma 1 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd3415 fma 1 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd3416 fma 1 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded + +dqadd3420 fma 1 77e-32 1 -> 1.00000000000000000000000000000077 +dqadd3421 fma 1 77e-33 1 -> 1.000000000000000000000000000000077 +dqadd3422 fma 1 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded +dqadd3423 fma 1 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded +dqadd3424 fma 1 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd3425 fma 1 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd3426 fma 1 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd3430 fma 1 77e-32 10 -> 10.00000000000000000000000000000077 +dqadd3431 fma 1 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded +dqadd3432 fma 1 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded +dqadd3433 fma 1 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd3434 fma 1 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd3435 fma 1 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd3436 fma 1 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded + +-- negative ulps +dqadd36440 fma 1 1 -77e-32 -> 0.99999999999999999999999999999923 +dqadd36441 fma 1 1 -77e-33 -> 0.999999999999999999999999999999923 +dqadd36442 fma 1 1 -77e-34 -> 0.9999999999999999999999999999999923 +dqadd36443 fma 1 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded +dqadd36444 fma 1 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded +dqadd36445 fma 1 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd36446 fma 1 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd36450 fma 1 10 -77e-32 -> 9.99999999999999999999999999999923 +dqadd36451 fma 1 10 -77e-33 -> 9.999999999999999999999999999999923 +dqadd36452 fma 1 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded +dqadd36453 fma 1 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded +dqadd36454 fma 1 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd36455 fma 1 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd36456 fma 1 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded + +dqadd36460 fma 1 -77e-32 1 -> 0.99999999999999999999999999999923 +dqadd36461 fma 1 -77e-33 1 -> 0.999999999999999999999999999999923 +dqadd36462 fma 1 -77e-34 1 -> 0.9999999999999999999999999999999923 +dqadd36463 fma 1 -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded +dqadd36464 fma 1 -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded +dqadd36465 fma 1 -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded +dqadd36466 fma 1 -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded + +dqadd36470 fma 1 -77e-32 10 -> 9.99999999999999999999999999999923 +dqadd36471 fma 1 -77e-33 10 -> 9.999999999999999999999999999999923 +dqadd36472 fma 1 -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded +dqadd36473 fma 1 -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded +dqadd36474 fma 1 -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd36475 fma 1 -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded +dqadd36476 fma 1 -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded + +-- negative ulps +dqadd36480 fma 1 -1 77e-32 -> -0.99999999999999999999999999999923 +dqadd36481 fma 1 -1 77e-33 -> -0.999999999999999999999999999999923 +dqadd36482 fma 1 -1 77e-34 -> -0.9999999999999999999999999999999923 +dqadd36483 fma 1 -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded +dqadd36484 fma 1 -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded +dqadd36485 fma 1 -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded +dqadd36486 fma 1 -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded + +dqadd36490 fma 1 -10 77e-32 -> -9.99999999999999999999999999999923 +dqadd36491 fma 1 -10 77e-33 -> -9.999999999999999999999999999999923 +dqadd36492 fma 1 -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded +dqadd36493 fma 1 -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded +dqadd36494 fma 1 -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd36495 fma 1 -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd36496 fma 1 -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded + +dqadd36500 fma 1 77e-32 -1 -> -0.99999999999999999999999999999923 +dqadd36501 fma 1 77e-33 -1 -> -0.999999999999999999999999999999923 +dqadd36502 fma 1 77e-34 -1 -> -0.9999999999999999999999999999999923 +dqadd36503 fma 1 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded +dqadd36504 fma 1 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded +dqadd36505 fma 1 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded +dqadd36506 fma 1 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded + +dqadd36510 fma 1 77e-32 -10 -> -9.99999999999999999999999999999923 +dqadd36511 fma 1 77e-33 -10 -> -9.999999999999999999999999999999923 +dqadd36512 fma 1 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded +dqadd36513 fma 1 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded +dqadd36514 fma 1 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd36515 fma 1 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded +dqadd36516 fma 1 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded + +-- and some more residue effects and different roundings +rounding: half_up +dqadd36540 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789' +dqadd36541 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36542 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36543 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36544 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36545 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36546 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36547 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36548 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36549 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36550 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36551 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36552 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36553 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36554 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36555 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36556 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790' +dqadd36557 fma 1 '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36558 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36559 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded + +rounding: half_even +dqadd36560 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789' +dqadd36561 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36562 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36563 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36564 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36565 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36566 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36567 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd36568 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36569 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36570 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36571 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36572 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36573 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36574 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36575 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36576 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790' +dqadd36577 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36578 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd36579 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded + +-- critical few with even bottom digit... +dqadd37540 fma 1 '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded +dqadd37541 fma 1 '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded +dqadd37542 fma 1 '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded + +rounding: down +dqadd37550 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789' +dqadd37551 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37552 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37553 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37554 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37555 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37556 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37557 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37558 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37559 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37560 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37561 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37562 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37563 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37564 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37565 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded +dqadd37566 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790' +dqadd37567 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd37568 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded +dqadd37569 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded + +-- more zeros, etc. +rounding: half_even + +dqadd37701 fma 1 5.00 1.00E-3 -> 5.00100 +dqadd37702 fma 1 00.00 0.000 -> 0.000 +dqadd37703 fma 1 00.00 0E-3 -> 0.000 +dqadd37704 fma 1 0E-3 00.00 -> 0.000 + +dqadd37710 fma 1 0E+3 00.00 -> 0.00 +dqadd37711 fma 1 0E+3 00.0 -> 0.0 +dqadd37712 fma 1 0E+3 00. -> 0 +dqadd37713 fma 1 0E+3 00.E+1 -> 0E+1 +dqadd37714 fma 1 0E+3 00.E+2 -> 0E+2 +dqadd37715 fma 1 0E+3 00.E+3 -> 0E+3 +dqadd37716 fma 1 0E+3 00.E+4 -> 0E+3 +dqadd37717 fma 1 0E+3 00.E+5 -> 0E+3 +dqadd37718 fma 1 0E+3 -00.0 -> 0.0 +dqadd37719 fma 1 0E+3 -00. -> 0 +dqadd37731 fma 1 0E+3 -00.E+1 -> 0E+1 + +dqadd37720 fma 1 00.00 0E+3 -> 0.00 +dqadd37721 fma 1 00.0 0E+3 -> 0.0 +dqadd37722 fma 1 00. 0E+3 -> 0 +dqadd37723 fma 1 00.E+1 0E+3 -> 0E+1 +dqadd37724 fma 1 00.E+2 0E+3 -> 0E+2 +dqadd37725 fma 1 00.E+3 0E+3 -> 0E+3 +dqadd37726 fma 1 00.E+4 0E+3 -> 0E+3 +dqadd37727 fma 1 00.E+5 0E+3 -> 0E+3 +dqadd37728 fma 1 -00.00 0E+3 -> 0.00 +dqadd37729 fma 1 -00.0 0E+3 -> 0.0 +dqadd37730 fma 1 -00. 0E+3 -> 0 + +dqadd37732 fma 1 0 0 -> 0 +dqadd37733 fma 1 0 -0 -> 0 +dqadd37734 fma 1 -0 0 -> 0 +dqadd37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case + +dqadd37736 fma 1 1 -1 -> 0 +dqadd37737 fma 1 -1 -1 -> -2 +dqadd37738 fma 1 1 1 -> 2 +dqadd37739 fma 1 -1 1 -> 0 + +dqadd37741 fma 1 0 -1 -> -1 +dqadd37742 fma 1 -0 -1 -> -1 +dqadd37743 fma 1 0 1 -> 1 +dqadd37744 fma 1 -0 1 -> 1 +dqadd37745 fma 1 -1 0 -> -1 +dqadd37746 fma 1 -1 -0 -> -1 +dqadd37747 fma 1 1 0 -> 1 +dqadd37748 fma 1 1 -0 -> 1 + +dqadd37751 fma 1 0.0 -1 -> -1.0 +dqadd37752 fma 1 -0.0 -1 -> -1.0 +dqadd37753 fma 1 0.0 1 -> 1.0 +dqadd37754 fma 1 -0.0 1 -> 1.0 +dqadd37755 fma 1 -1.0 0 -> -1.0 +dqadd37756 fma 1 -1.0 -0 -> -1.0 +dqadd37757 fma 1 1.0 0 -> 1.0 +dqadd37758 fma 1 1.0 -0 -> 1.0 + +dqadd37761 fma 1 0 -1.0 -> -1.0 +dqadd37762 fma 1 -0 -1.0 -> -1.0 +dqadd37763 fma 1 0 1.0 -> 1.0 +dqadd37764 fma 1 -0 1.0 -> 1.0 +dqadd37765 fma 1 -1 0.0 -> -1.0 +dqadd37766 fma 1 -1 -0.0 -> -1.0 +dqadd37767 fma 1 1 0.0 -> 1.0 +dqadd37768 fma 1 1 -0.0 -> 1.0 + +dqadd37771 fma 1 0.0 -1.0 -> -1.0 +dqadd37772 fma 1 -0.0 -1.0 -> -1.0 +dqadd37773 fma 1 0.0 1.0 -> 1.0 +dqadd37774 fma 1 -0.0 1.0 -> 1.0 +dqadd37775 fma 1 -1.0 0.0 -> -1.0 +dqadd37776 fma 1 -1.0 -0.0 -> -1.0 +dqadd37777 fma 1 1.0 0.0 -> 1.0 +dqadd37778 fma 1 1.0 -0.0 -> 1.0 + +-- Specials +dqadd37780 fma 1 -Inf -Inf -> -Infinity +dqadd37781 fma 1 -Inf -1000 -> -Infinity +dqadd37782 fma 1 -Inf -1 -> -Infinity +dqadd37783 fma 1 -Inf -0 -> -Infinity +dqadd37784 fma 1 -Inf 0 -> -Infinity +dqadd37785 fma 1 -Inf 1 -> -Infinity +dqadd37786 fma 1 -Inf 1000 -> -Infinity +dqadd37787 fma 1 -1000 -Inf -> -Infinity +dqadd37788 fma 1 -Inf -Inf -> -Infinity +dqadd37789 fma 1 -1 -Inf -> -Infinity +dqadd37790 fma 1 -0 -Inf -> -Infinity +dqadd37791 fma 1 0 -Inf -> -Infinity +dqadd37792 fma 1 1 -Inf -> -Infinity +dqadd37793 fma 1 1000 -Inf -> -Infinity +dqadd37794 fma 1 Inf -Inf -> NaN Invalid_operation + +dqadd37800 fma 1 Inf -Inf -> NaN Invalid_operation +dqadd37801 fma 1 Inf -1000 -> Infinity +dqadd37802 fma 1 Inf -1 -> Infinity +dqadd37803 fma 1 Inf -0 -> Infinity +dqadd37804 fma 1 Inf 0 -> Infinity +dqadd37805 fma 1 Inf 1 -> Infinity +dqadd37806 fma 1 Inf 1000 -> Infinity +dqadd37807 fma 1 Inf Inf -> Infinity +dqadd37808 fma 1 -1000 Inf -> Infinity +dqadd37809 fma 1 -Inf Inf -> NaN Invalid_operation +dqadd37810 fma 1 -1 Inf -> Infinity +dqadd37811 fma 1 -0 Inf -> Infinity +dqadd37812 fma 1 0 Inf -> Infinity +dqadd37813 fma 1 1 Inf -> Infinity +dqadd37814 fma 1 1000 Inf -> Infinity +dqadd37815 fma 1 Inf Inf -> Infinity + +dqadd37821 fma 1 NaN -Inf -> NaN +dqadd37822 fma 1 NaN -1000 -> NaN +dqadd37823 fma 1 NaN -1 -> NaN +dqadd37824 fma 1 NaN -0 -> NaN +dqadd37825 fma 1 NaN 0 -> NaN +dqadd37826 fma 1 NaN 1 -> NaN +dqadd37827 fma 1 NaN 1000 -> NaN +dqadd37828 fma 1 NaN Inf -> NaN +dqadd37829 fma 1 NaN NaN -> NaN +dqadd37830 fma 1 -Inf NaN -> NaN +dqadd37831 fma 1 -1000 NaN -> NaN +dqadd37832 fma 1 -1 NaN -> NaN +dqadd37833 fma 1 -0 NaN -> NaN +dqadd37834 fma 1 0 NaN -> NaN +dqadd37835 fma 1 1 NaN -> NaN +dqadd37836 fma 1 1000 NaN -> NaN +dqadd37837 fma 1 Inf NaN -> NaN + +dqadd37841 fma 1 sNaN -Inf -> NaN Invalid_operation +dqadd37842 fma 1 sNaN -1000 -> NaN Invalid_operation +dqadd37843 fma 1 sNaN -1 -> NaN Invalid_operation +dqadd37844 fma 1 sNaN -0 -> NaN Invalid_operation +dqadd37845 fma 1 sNaN 0 -> NaN Invalid_operation +dqadd37846 fma 1 sNaN 1 -> NaN Invalid_operation +dqadd37847 fma 1 sNaN 1000 -> NaN Invalid_operation +dqadd37848 fma 1 sNaN NaN -> NaN Invalid_operation +dqadd37849 fma 1 sNaN sNaN -> NaN Invalid_operation +dqadd37850 fma 1 NaN sNaN -> NaN Invalid_operation +dqadd37851 fma 1 -Inf sNaN -> NaN Invalid_operation +dqadd37852 fma 1 -1000 sNaN -> NaN Invalid_operation +dqadd37853 fma 1 -1 sNaN -> NaN Invalid_operation +dqadd37854 fma 1 -0 sNaN -> NaN Invalid_operation +dqadd37855 fma 1 0 sNaN -> NaN Invalid_operation +dqadd37856 fma 1 1 sNaN -> NaN Invalid_operation +dqadd37857 fma 1 1000 sNaN -> NaN Invalid_operation +dqadd37858 fma 1 Inf sNaN -> NaN Invalid_operation +dqadd37859 fma 1 NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqadd37861 fma 1 NaN1 -Inf -> NaN1 +dqadd37862 fma 1 +NaN2 -1000 -> NaN2 +dqadd37863 fma 1 NaN3 1000 -> NaN3 +dqadd37864 fma 1 NaN4 Inf -> NaN4 +dqadd37865 fma 1 NaN5 +NaN6 -> NaN5 +dqadd37866 fma 1 -Inf NaN7 -> NaN7 +dqadd37867 fma 1 -1000 NaN8 -> NaN8 +dqadd37868 fma 1 1000 NaN9 -> NaN9 +dqadd37869 fma 1 Inf +NaN10 -> NaN10 +dqadd37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation +dqadd37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation +dqadd37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation +dqadd37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation +dqadd37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation +dqadd37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation +dqadd37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation +dqadd37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation +dqadd37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation +dqadd37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation +dqadd37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation +dqadd37882 fma 1 -NaN26 NaN28 -> -NaN26 +dqadd37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation +dqadd37884 fma 1 1000 -NaN30 -> -NaN30 +dqadd37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Here we explore near the boundary of rounding a subnormal to Nmin +dqadd37575 fma 1 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal +dqadd37576 fma 1 -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal + +-- check overflow edge case +-- 1234567890123456 +dqadd37972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqadd37973 fma 1 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37974 fma 1 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37975 fma 1 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded +dqadd37976 fma 1 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded +dqadd37977 fma 1 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded +dqadd37978 fma 1 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded +dqadd37979 fma 1 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded +dqadd37980 fma 1 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded +dqadd37981 fma 1 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37982 fma 1 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37983 fma 1 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37984 fma 1 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded + +dqadd37985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 +dqadd37986 fma 1 -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37987 fma 1 -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37988 fma 1 -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded +dqadd37989 fma 1 -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded +dqadd37990 fma 1 -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded +dqadd37991 fma 1 -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded +dqadd37992 fma 1 -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded +dqadd37993 fma 1 -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded +dqadd37994 fma 1 -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37995 fma 1 -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37996 fma 1 -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded +dqadd37997 fma 1 -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +dqadd371100 fma 1 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact +dqadd371101 fma 1 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact +dqadd371103 fma 1 +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact +dqadd371104 fma 1 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact +dqadd371105 fma 1 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact +dqadd371106 fma 1 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact +dqadd371107 fma 1 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact +dqadd371108 fma 1 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact +dqadd371109 fma 1 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact + +rounding: ceiling +dqadd371110 fma 1 -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact +dqadd371111 fma 1 -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact +dqadd371113 fma 1 -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact +dqadd371114 fma 1 -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact +dqadd371115 fma 1 -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact +dqadd371116 fma 1 -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact +dqadd371117 fma 1 -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact +dqadd371118 fma 1 -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact +dqadd371119 fma 1 -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +dqadd371300 fma 1 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371310 fma 1 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371311 fma 1 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371312 fma 1 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371313 fma 1 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371314 fma 1 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371315 fma 1 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371316 fma 1 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371317 fma 1 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371318 fma 1 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371319 fma 1 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371320 fma 1 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371321 fma 1 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371322 fma 1 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371323 fma 1 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371324 fma 1 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371325 fma 1 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371326 fma 1 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371327 fma 1 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371328 fma 1 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371329 fma 1 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371330 fma 1 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371331 fma 1 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371332 fma 1 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371333 fma 1 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371334 fma 1 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371335 fma 1 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371336 fma 1 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371337 fma 1 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371338 fma 1 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371339 fma 1 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded + +dqadd371340 fma 1 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded +dqadd371341 fma 1 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded + +dqadd371349 fma 1 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371350 fma 1 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371351 fma 1 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371352 fma 1 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371353 fma 1 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371354 fma 1 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371355 fma 1 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371356 fma 1 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371357 fma 1 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371358 fma 1 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371359 fma 1 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371360 fma 1 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371361 fma 1 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371362 fma 1 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371363 fma 1 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371364 fma 1 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded +dqadd371365 fma 1 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371367 fma 1 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371368 fma 1 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371369 fma 1 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371370 fma 1 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371371 fma 1 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371372 fma 1 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371373 fma 1 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371374 fma 1 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371375 fma 1 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371376 fma 1 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371377 fma 1 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371378 fma 1 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371379 fma 1 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371380 fma 1 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371381 fma 1 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371382 fma 1 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371383 fma 1 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371384 fma 1 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371385 fma 1 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371386 fma 1 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371387 fma 1 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371388 fma 1 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371389 fma 1 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371390 fma 1 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371391 fma 1 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371392 fma 1 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371393 fma 1 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371394 fma 1 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371395 fma 1 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded +dqadd371396 fma 1 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +dqadd371420 fma 1 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345 +dqadd371421 fma 1 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345 +dqadd371422 fma 1 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345 +dqadd371423 fma 1 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345 +dqadd371424 fma 1 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345 +dqadd371425 fma 1 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345 +dqadd371426 fma 1 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345 +dqadd371427 fma 1 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7 +dqadd371428 fma 1 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8 +dqadd371429 fma 1 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9 +dqadd371430 fma 1 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10 +dqadd371431 fma 1 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11 +dqadd371432 fma 1 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12 +dqadd371433 fma 1 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13 +dqadd371434 fma 1 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14 +dqadd371435 fma 1 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15 +dqadd371436 fma 1 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16 +dqadd371437 fma 1 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17 +dqadd371438 fma 1 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18 +dqadd371439 fma 1 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19 +dqadd371440 fma 1 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20 +dqadd371441 fma 1 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21 +dqadd371442 fma 1 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22 +dqadd371443 fma 1 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23 +dqadd371444 fma 1 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24 +dqadd371445 fma 1 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25 +dqadd371446 fma 1 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26 +dqadd371447 fma 1 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27 +dqadd371448 fma 1 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28 +dqadd371449 fma 1 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29 +dqadd371450 fma 1 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30 +dqadd371451 fma 1 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31 +dqadd371452 fma 1 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32 +dqadd371453 fma 1 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33 +dqadd371454 fma 1 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34 +dqadd371455 fma 1 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35 +dqadd371456 fma 1 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36 + +-- same, reversed 0 +dqadd371460 fma 1 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345 +dqadd371461 fma 1 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345 +dqadd371462 fma 1 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345 +dqadd371463 fma 1 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345 +dqadd371464 fma 1 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345 +dqadd371465 fma 1 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345 +dqadd371466 fma 1 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345 +dqadd371467 fma 1 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7 +dqadd371468 fma 1 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8 +dqadd371469 fma 1 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9 +dqadd371470 fma 1 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10 +dqadd371471 fma 1 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11 +dqadd371472 fma 1 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12 +dqadd371473 fma 1 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13 +dqadd371474 fma 1 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14 +dqadd371475 fma 1 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15 +dqadd371476 fma 1 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16 +dqadd371477 fma 1 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17 +dqadd371478 fma 1 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18 +dqadd371479 fma 1 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19 +dqadd371480 fma 1 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20 +dqadd371481 fma 1 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21 +dqadd371482 fma 1 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22 +dqadd371483 fma 1 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23 +dqadd371484 fma 1 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24 +dqadd371485 fma 1 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25 +dqadd371486 fma 1 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26 +dqadd371487 fma 1 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27 +dqadd371488 fma 1 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28 +dqadd371489 fma 1 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29 +dqadd371490 fma 1 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30 +dqadd371491 fma 1 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31 +dqadd371492 fma 1 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32 +dqadd371493 fma 1 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33 +dqadd371494 fma 1 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34 +dqadd371495 fma 1 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35 +dqadd371496 fma 1 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36 + +-- same, Es on the 0 +dqadd371500 fma 1 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345 +dqadd371501 fma 1 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345 +dqadd371502 fma 1 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345 +dqadd371503 fma 1 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345 +dqadd371504 fma 1 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345 +dqadd371505 fma 1 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345 +dqadd371506 fma 1 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345 +dqadd371507 fma 1 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345 +dqadd371508 fma 1 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345 +dqadd371509 fma 1 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345 +dqadd371510 fma 1 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345 +dqadd371511 fma 1 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345 +dqadd371512 fma 1 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345 +dqadd371513 fma 1 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345 +dqadd371514 fma 1 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345 +dqadd371515 fma 1 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345 +dqadd371516 fma 1 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345 +dqadd371517 fma 1 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345 +dqadd371518 fma 1 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345 +dqadd371519 fma 1 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345 +dqadd371520 fma 1 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345 +dqadd371521 fma 1 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345 +dqadd371522 fma 1 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345 +dqadd371523 fma 1 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345 +dqadd371524 fma 1 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345 +dqadd371525 fma 1 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345 +dqadd371526 fma 1 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345 +dqadd371527 fma 1 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345 +dqadd371528 fma 1 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345 +dqadd371529 fma 1 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345 +dqadd371530 fma 1 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345 +dqadd371531 fma 1 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345 +dqadd371532 fma 1 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345 +dqadd371533 fma 1 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345 +-- next four flag Rounded because the 0 extends the result +dqadd371534 fma 1 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded +dqadd371535 fma 1 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded +dqadd371536 fma 1 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded +dqadd371537 fma 1 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +dqadd371600 fma 1 0 0E-19 -> 0E-19 +dqadd371601 fma 1 -0 0E-19 -> 0E-19 +dqadd371602 fma 1 0 -0E-19 -> 0E-19 +dqadd371603 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371611 fma 1 -11 11 -> 0 +dqadd371612 fma 1 11 -11 -> 0 +-- overflow +dqadd371613 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded +dqadd371614 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded + +rounding: half_down +-- exact zeros from zeros +dqadd371620 fma 1 0 0E-19 -> 0E-19 +dqadd371621 fma 1 -0 0E-19 -> 0E-19 +dqadd371622 fma 1 0 -0E-19 -> 0E-19 +dqadd371623 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371631 fma 1 -11 11 -> 0 +dqadd371632 fma 1 11 -11 -> 0 +-- overflow +dqadd371633 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded +dqadd371634 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded + +rounding: half_even +-- exact zeros from zeros +dqadd371640 fma 1 0 0E-19 -> 0E-19 +dqadd371641 fma 1 -0 0E-19 -> 0E-19 +dqadd371642 fma 1 0 -0E-19 -> 0E-19 +dqadd371643 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371651 fma 1 -11 11 -> 0 +dqadd371652 fma 1 11 -11 -> 0 +-- overflow +dqadd371653 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded +dqadd371654 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded + +rounding: up +-- exact zeros from zeros +dqadd371660 fma 1 0 0E-19 -> 0E-19 +dqadd371661 fma 1 -0 0E-19 -> 0E-19 +dqadd371662 fma 1 0 -0E-19 -> 0E-19 +dqadd371663 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371671 fma 1 -11 11 -> 0 +dqadd371672 fma 1 11 -11 -> 0 +-- overflow +dqadd371673 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded +dqadd371674 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded + +rounding: down +-- exact zeros from zeros +dqadd371680 fma 1 0 0E-19 -> 0E-19 +dqadd371681 fma 1 -0 0E-19 -> 0E-19 +dqadd371682 fma 1 0 -0E-19 -> 0E-19 +dqadd371683 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371691 fma 1 -11 11 -> 0 +dqadd371692 fma 1 11 -11 -> 0 +-- overflow +dqadd371693 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +dqadd371694 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded + +rounding: ceiling +-- exact zeros from zeros +dqadd371700 fma 1 0 0E-19 -> 0E-19 +dqadd371701 fma 1 -0 0E-19 -> 0E-19 +dqadd371702 fma 1 0 -0E-19 -> 0E-19 +dqadd371703 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371711 fma 1 -11 11 -> 0 +dqadd371712 fma 1 11 -11 -> 0 +-- overflow +dqadd371713 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded +dqadd371714 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +dqadd371720 fma 1 0 0E-19 -> 0E-19 +dqadd371721 fma 1 -0 0E-19 -> -0E-19 -- * +dqadd371722 fma 1 0 -0E-19 -> -0E-19 -- * +dqadd371723 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371731 fma 1 -11 11 -> -0 -- * +dqadd371732 fma 1 11 -11 -> -0 -- * +-- overflow +dqadd371733 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +dqadd371734 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded + +rounding: 05up +-- exact zeros from zeros +dqadd371740 fma 1 0 0E-19 -> 0E-19 +dqadd371741 fma 1 -0 0E-19 -> 0E-19 +dqadd371742 fma 1 0 -0E-19 -> 0E-19 +dqadd371743 fma 1 -0 -0E-19 -> -0E-19 +-- exact zeros from non-zeros +dqadd371751 fma 1 -11 11 -> 0 +dqadd371752 fma 1 11 -11 -> 0 +-- overflow +dqadd371753 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded +dqadd371754 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded + +-- Examples from SQL proposal (Krishna Kulkarni) +dqadd371761 fma 1 130E-2 120E-2 -> 2.50 +dqadd371762 fma 1 130E-2 12E-1 -> 2.50 +dqadd371763 fma 1 130E-2 1E0 -> 2.30 +dqadd371764 fma 1 1E2 1E4 -> 1.01E+4 +dqadd371765 fma 1 130E-2 -120E-2 -> 0.10 +dqadd371766 fma 1 130E-2 -12E-1 -> 0.10 +dqadd371767 fma 1 130E-2 -1E0 -> 0.30 +dqadd371768 fma 1 1E2 -1E4 -> -9.9E+3 + +-- Gappy coefficients; check residue handling even with full coefficient gap +rounding: half_even + +dqadd375001 fma 1 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457 +dqadd375002 fma 1 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded +dqadd375003 fma 1 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375004 fma 1 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375005 fma 1 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375006 fma 1 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375007 fma 1 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375008 fma 1 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375009 fma 1 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375010 fma 1 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375011 fma 1 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375012 fma 1 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375013 fma 1 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375014 fma 1 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375015 fma 1 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375016 fma 1 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375017 fma 1 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375018 fma 1 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375019 fma 1 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375020 fma 1 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded +dqadd375021 fma 1 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded + +-- widening second argument at gap +dqadd375030 fma 1 12398765432112345678945678 1 -> 12398765432112345678945679 +dqadd375031 fma 1 12398765432112345678945678 0.1 -> 12398765432112345678945678.1 +dqadd375032 fma 1 12398765432112345678945678 0.12 -> 12398765432112345678945678.12 +dqadd375033 fma 1 12398765432112345678945678 0.123 -> 12398765432112345678945678.123 +dqadd375034 fma 1 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234 +dqadd375035 fma 1 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345 +dqadd375036 fma 1 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456 +dqadd375037 fma 1 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567 +dqadd375038 fma 1 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678 +dqadd375039 fma 1 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375040 fma 1 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded +dqadd375041 fma 1 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded +dqadd375042 fma 1 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375043 fma 1 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375044 fma 1 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375045 fma 1 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375046 fma 1 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375047 fma 1 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375048 fma 1 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded +dqadd375049 fma 1 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded +-- 90123456 +rounding: half_even +dqadd375050 fma 1 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded +dqadd375051 fma 1 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded +dqadd375052 fma 1 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded +dqadd375053 fma 1 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded +dqadd375054 fma 1 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded +dqadd375055 fma 1 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded +dqadd375056 fma 1 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded +dqadd375057 fma 1 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded +dqadd375060 fma 1 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded +dqadd375061 fma 1 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded +dqadd375062 fma 1 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded +dqadd375063 fma 1 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded +dqadd375064 fma 1 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded +dqadd375065 fma 1 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded +dqadd375066 fma 1 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded +dqadd375067 fma 1 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded +-- far-out residues (full coefficient gap is 16+15 digits) +rounding: up +dqadd375070 fma 1 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001 +dqadd375071 fma 1 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375072 fma 1 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375073 fma 1 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375074 fma 1 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375075 fma 1 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375076 fma 1 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375077 fma 1 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375078 fma 1 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375079 fma 1 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375080 fma 1 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375081 fma 1 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375082 fma 1 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375083 fma 1 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375084 fma 1 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375085 fma 1 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375086 fma 1 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375087 fma 1 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375088 fma 1 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded +dqadd375089 fma 1 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded + +-- Destructive subtract (from remainder tests) + +-- +++ some of these will be off-by-one remainder vs remainderNear + +dqfma4000 fma -1234567890123456789012345678901233 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> -0.234567890123456789012345678901233 +dqfma4001 fma -1234567890123456789012345678901222 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> -0.34567890123456789012345678901222 +dqfma4002 fma -1234567890123456789012345678901111 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.4567890123456789012345678901111 +dqfma4003 fma -308641972530864197253086419725314 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> -1.308641972530864197253086419725314 +dqfma4004 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692 +dqfma4005 fma -246913578024691357802469135780252 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> -1.3086421975308642197530864219748 +dqfma4006 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247 +dqfma4007 fma -246913578024691357802469135780247 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> -0.753086421975308642197530864219753 +dqfma4008 fma -246913578024691357802469135780247 5.000000000000000000000000000000001 1234567890123456789012345678901234 -> -1.246913578024691357802469135780247 +dqfma4009 fma -246913578024691357802469135780246 5.00000000000000000000000000000001 1234567890123456789012345678901234 -> 1.53086421975308642197530864219754 +dqfma4010 fma -246913578024691357802469135780242 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.6913578024691357802469135780242 +dqfma4011 fma -1234567890123456789012345678901232 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> 0.765432109876543210987654321098768 +dqfma4012 fma -1234567890123456789012345678901221 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> 0.65432109876543210987654321098779 +dqfma4013 fma -1234567890123456789012345678901110 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> 0.5432109876543210987654321098890 +dqfma4014 fma -308641972530864197253086419725313 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> 2.691358027469135802746913580274687 +dqfma4015 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692 +dqfma4016 fma -246913578024691357802469135780251 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> 3.6913578024691357802469135780251 +dqfma4017 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247 +dqfma4018 fma -246913578024691357802469135780246 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> 4.246913578024691357802469135780246 +dqfma4019 fma -246913578024691357802469135780241 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> 4.3086421975308642197530864219759 + +-- Null tests +dqadd39990 fma 1 10 # -> NaN Invalid_operation +dqadd39991 fma 1 # 10 -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqInvert.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqInvert.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,245 @@ +------------------------------------------------------------------------ +-- dqInvert.decTest -- digitwise logical INVERT for decQuads -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check (truth table) +dqinv001 invert 0 -> 1111111111111111111111111111111111 +dqinv002 invert 1 -> 1111111111111111111111111111111110 +dqinv003 invert 10 -> 1111111111111111111111111111111101 +dqinv004 invert 111111111 -> 1111111111111111111111111000000000 +dqinv005 invert 000000000 -> 1111111111111111111111111111111111 +-- and at msd and msd-1 +dqinv007 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111 +dqinv008 invert 1000000000000000000000000000000000 -> 111111111111111111111111111111111 +dqinv009 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111 +dqinv010 invert 0100000000000000000000000000000000 -> 1011111111111111111111111111111111 +dqinv011 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000 +dqinv012 invert 1111111111111111111111111111111111 -> 0 +dqinv013 invert 0011111111111111111111111111111111 -> 1100000000000000000000000000000000 +dqinv014 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000 + +-- Various lengths +dqinv600 invert 0111111111111111111011111111111111 -> 1000000000000000000100000000000000 +dqinv601 invert 0011111111111111110101111111111111 -> 1100000000000000001010000000000000 +dqinv602 invert 0101111111111111101110111111111111 -> 1010000000000000010001000000000000 +dqinv603 invert 0110111111111111011111011111111111 -> 1001000000000000100000100000000000 +dqinv604 invert 0111011111111110111111101111111111 -> 1000100000000001000000010000000000 +dqinv605 invert 0111101111111101111111110111111111 -> 1000010000000010000000001000000000 +dqinv606 invert 0111110111111011111111111011111111 -> 1000001000000100000000000100000000 +dqinv607 invert 0111111011110111111111111101111111 -> 1000000100001000000000000010000000 +dqinv608 invert 0111111101101111111111111110111111 -> 1000000010010000000000000001000000 +dqinv609 invert 0111111110011111111111111111011111 -> 1000000001100000000000000000100000 +dqinv610 invert 0111111110011111111111111111101111 -> 1000000001100000000000000000010000 +dqinv611 invert 0111111101101111111111111111110111 -> 1000000010010000000000000000001000 +dqinv612 invert 0111111011110111111111111111111011 -> 1000000100001000000000000000000100 +dqinv613 invert 0111110111111011111111111111111101 -> 1000001000000100000000000000000010 +dqinv614 invert 0111101111111101111111111111111110 -> 1000010000000010000000000000000001 +dqinv615 invert 0111011111111110111111111111111111 -> 1000100000000001000000000000000000 +dqinv616 invert 0110111111111111011111111111111110 -> 1001000000000000100000000000000001 +dqinv617 invert 0101111111111111101111111111111101 -> 1010000000000000010000000000000010 +dqinv618 invert 0011111111111111110111111111111011 -> 1100000000000000001000000000000100 +dqinv619 invert 0101111111111111111011111111110111 -> 1010000000000000000100000000001000 +dqinv620 invert 0110111111111111111101111111101111 -> 1001000000000000000010000000010000 +dqinv621 invert 0111011111111111111110111111011111 -> 1000100000000000000001000000100000 +dqinv622 invert 0111101111111111111111011110111111 -> 1000010000000000000000100001000000 +dqinv623 invert 0111110111111111111111101101111111 -> 1000001000000000000000010010000000 +dqinv624 invert 0111111011111111111111110011111111 -> 1000000100000000000000001100000000 +dqinv625 invert 0111111101111111111111110011111111 -> 1000000010000000000000001100000000 +dqinv626 invert 0111111110111111111111101101111111 -> 1000000001000000000000010010000000 +dqinv627 invert 0111111111011111111111011110111111 -> 1000000000100000000000100001000000 +dqinv628 invert 0111111111101111111110111111011111 -> 1000000000010000000001000000100000 +dqinv629 invert 0111111111110111111101111111101111 -> 1000000000001000000010000000010000 +dqinv630 invert 0111111111111011111011111111110111 -> 1000000000000100000100000000001000 +dqinv631 invert 0111111111111101110111111111111011 -> 1000000000000010001000000000000100 +dqinv632 invert 0111111111111110101111111111111101 -> 1000000000000001010000000000000010 +dqinv633 invert 0111111111111111011111111111111110 -> 1000000000000000100000000000000001 + +dqinv021 invert 111111111 -> 1111111111111111111111111000000000 +dqinv022 invert 111111111111 -> 1111111111111111111111000000000000 +dqinv023 invert 11111111 -> 1111111111111111111111111100000000 +dqinv025 invert 1111111 -> 1111111111111111111111111110000000 +dqinv026 invert 111111 -> 1111111111111111111111111111000000 +dqinv027 invert 11111 -> 1111111111111111111111111111100000 +dqinv028 invert 1111 -> 1111111111111111111111111111110000 +dqinv029 invert 111 -> 1111111111111111111111111111111000 +dqinv031 invert 11 -> 1111111111111111111111111111111100 +dqinv032 invert 1 -> 1111111111111111111111111111111110 +dqinv033 invert 111111111111 -> 1111111111111111111111000000000000 +dqinv034 invert 11111111111 -> 1111111111111111111111100000000000 +dqinv035 invert 1111111111 -> 1111111111111111111111110000000000 +dqinv036 invert 111111111 -> 1111111111111111111111111000000000 + +dqinv040 invert 011111111 -> 1111111111111111111111111100000000 +dqinv041 invert 101111111 -> 1111111111111111111111111010000000 +dqinv042 invert 110111111 -> 1111111111111111111111111001000000 +dqinv043 invert 111011111 -> 1111111111111111111111111000100000 +dqinv044 invert 111101111 -> 1111111111111111111111111000010000 +dqinv045 invert 111110111 -> 1111111111111111111111111000001000 +dqinv046 invert 111111011 -> 1111111111111111111111111000000100 +dqinv047 invert 111111101 -> 1111111111111111111111111000000010 +dqinv048 invert 111111110 -> 1111111111111111111111111000000001 +dqinv049 invert 011111011 -> 1111111111111111111111111100000100 +dqinv050 invert 101111101 -> 1111111111111111111111111010000010 +dqinv051 invert 110111110 -> 1111111111111111111111111001000001 +dqinv052 invert 111011101 -> 1111111111111111111111111000100010 +dqinv053 invert 111101011 -> 1111111111111111111111111000010100 +dqinv054 invert 111110111 -> 1111111111111111111111111000001000 +dqinv055 invert 111101011 -> 1111111111111111111111111000010100 +dqinv056 invert 111011101 -> 1111111111111111111111111000100010 +dqinv057 invert 110111110 -> 1111111111111111111111111001000001 +dqinv058 invert 101111101 -> 1111111111111111111111111010000010 +dqinv059 invert 011111011 -> 1111111111111111111111111100000100 + +dqinv080 invert 1000000011111111 -> 1111111111111111110111111100000000 +dqinv081 invert 0100000101111111 -> 1111111111111111111011111010000000 +dqinv082 invert 0010000110111111 -> 1111111111111111111101111001000000 +dqinv083 invert 0001000111011111 -> 1111111111111111111110111000100000 +dqinv084 invert 0000100111101111 -> 1111111111111111111111011000010000 +dqinv085 invert 0000010111110111 -> 1111111111111111111111101000001000 +dqinv086 invert 0000001111111011 -> 1111111111111111111111110000000100 +dqinv087 invert 0000010111111101 -> 1111111111111111111111101000000010 +dqinv088 invert 0000100111111110 -> 1111111111111111111111011000000001 +dqinv089 invert 0001000011111011 -> 1111111111111111111110111100000100 +dqinv090 invert 0010000101111101 -> 1111111111111111111101111010000010 +dqinv091 invert 0100000110111110 -> 1111111111111111111011111001000001 +dqinv092 invert 1000000111011101 -> 1111111111111111110111111000100010 +dqinv093 invert 0100000111101011 -> 1111111111111111111011111000010100 +dqinv094 invert 0010000111110111 -> 1111111111111111111101111000001000 +dqinv095 invert 0001000111101011 -> 1111111111111111111110111000010100 +dqinv096 invert 0000100111011101 -> 1111111111111111111111011000100010 +dqinv097 invert 0000010110111110 -> 1111111111111111111111101001000001 +dqinv098 invert 0000001101111101 -> 1111111111111111111111110010000010 +dqinv099 invert 0000010011111011 -> 1111111111111111111111101100000100 + +-- and more thorough MSD/LSD tests [8 and 9 mght be encoded differently...] +dqinv151 invert 1111111111111111111111111111111110 -> 1 +dqinv152 invert 1111111111111111110000000000000000 -> 1111111111111111 +dqinv153 invert 1000000000000000001111111111111111 -> 111111111111111110000000000000000 +dqinv154 invert 1111111111111111111000000000000000 -> 111111111111111 +dqinv155 invert 0100000000000000000111111111111111 -> 1011111111111111111000000000000000 +dqinv156 invert 1011111111111111110100000000000000 -> 100000000000000001011111111111111 +dqinv157 invert 1101111111111111110111111111111111 -> 10000000000000001000000000000000 +dqinv158 invert 1110111111111111110011111111111111 -> 1000000000000001100000000000000 + +-- non-0/1 should not be accepted, nor should signs +dqinv220 invert 111111112 -> NaN Invalid_operation +dqinv221 invert 333333333 -> NaN Invalid_operation +dqinv222 invert 555555555 -> NaN Invalid_operation +dqinv223 invert 777777777 -> NaN Invalid_operation +dqinv224 invert 999999999 -> NaN Invalid_operation +dqinv225 invert 222222222 -> NaN Invalid_operation +dqinv226 invert 444444444 -> NaN Invalid_operation +dqinv227 invert 666666666 -> NaN Invalid_operation +dqinv228 invert 888888888 -> NaN Invalid_operation +dqinv229 invert 999999999 -> NaN Invalid_operation +dqinv230 invert 999999999 -> NaN Invalid_operation +dqinv231 invert 999999999 -> NaN Invalid_operation +dqinv232 invert 999999999 -> NaN Invalid_operation +-- a few randoms +dqinv240 invert 567468689 -> NaN Invalid_operation +dqinv241 invert 567367689 -> NaN Invalid_operation +dqinv242 invert -631917772 -> NaN Invalid_operation +dqinv243 invert -756253257 -> NaN Invalid_operation +dqinv244 invert 835590149 -> NaN Invalid_operation +-- test MSD +dqinv250 invert 2000000111000111000111000000000000 -> NaN Invalid_operation +dqinv251 invert 3000000111000111000111000000000000 -> NaN Invalid_operation +dqinv252 invert 4000000111000111000111000000000000 -> NaN Invalid_operation +dqinv253 invert 5000000111000111000111000000000000 -> NaN Invalid_operation +dqinv254 invert 6000000111000111000111000000000000 -> NaN Invalid_operation +dqinv255 invert 7000000111000111000111000000000000 -> NaN Invalid_operation +dqinv256 invert 8000000111000111000111000000000000 -> NaN Invalid_operation +dqinv257 invert 9000000111000111000111000000000000 -> NaN Invalid_operation +-- test MSD-1 +dqinv270 invert 0200000111000111000111001000000000 -> NaN Invalid_operation +dqinv271 invert 0300000111000111000111000100000000 -> NaN Invalid_operation +dqinv272 invert 0400000111000111000111000010000000 -> NaN Invalid_operation +dqinv273 invert 0500000111000111000111000001000000 -> NaN Invalid_operation +dqinv274 invert 1600000111000111000111000000100000 -> NaN Invalid_operation +dqinv275 invert 1700000111000111000111000000010000 -> NaN Invalid_operation +dqinv276 invert 1800000111000111000111000000001000 -> NaN Invalid_operation +dqinv277 invert 1900000111000111000111000000000100 -> NaN Invalid_operation +-- test LSD +dqinv280 invert 0010000111000111000111000000000002 -> NaN Invalid_operation +dqinv281 invert 0001000111000111000111000000000003 -> NaN Invalid_operation +dqinv282 invert 0000000111000111000111100000000004 -> NaN Invalid_operation +dqinv283 invert 0000000111000111000111010000000005 -> NaN Invalid_operation +dqinv284 invert 1000000111000111000111001000000006 -> NaN Invalid_operation +dqinv285 invert 1000000111000111000111000100000007 -> NaN Invalid_operation +dqinv286 invert 1000000111000111000111000010000008 -> NaN Invalid_operation +dqinv287 invert 1000000111000111000111000001000009 -> NaN Invalid_operation +-- test Middie +dqinv288 invert 0010000111000111000111000020000000 -> NaN Invalid_operation +dqinv289 invert 0001000111000111000111000030000001 -> NaN Invalid_operation +dqinv290 invert 0000000111000111000111100040000010 -> NaN Invalid_operation +dqinv291 invert 0000000111000111000111010050000100 -> NaN Invalid_operation +dqinv292 invert 1000000111000111000111001060001000 -> NaN Invalid_operation +dqinv293 invert 1000000111000111000111000170010000 -> NaN Invalid_operation +dqinv294 invert 1000000111000111000111000080100000 -> NaN Invalid_operation +dqinv295 invert 1000000111000111000111000091000000 -> NaN Invalid_operation +-- signs +dqinv296 invert -1000000111000111000111000001000000 -> NaN Invalid_operation +dqinv299 invert 1000000111000111000111000001000000 -> 111111000111000111000111110111111 + +-- Nmax, Nmin, Ntiny-like +dqinv341 invert 9.99999999E+2998 -> NaN Invalid_operation +dqinv342 invert 1E-2998 -> NaN Invalid_operation +dqinv343 invert 1.00000000E-2998 -> NaN Invalid_operation +dqinv344 invert 1E-2078 -> NaN Invalid_operation +dqinv345 invert -1E-2078 -> NaN Invalid_operation +dqinv346 invert -1.00000000E-2998 -> NaN Invalid_operation +dqinv347 invert -1E-2998 -> NaN Invalid_operation +dqinv348 invert -9.99999999E+2998 -> NaN Invalid_operation + +-- A few other non-integers +dqinv361 invert 1.0 -> NaN Invalid_operation +dqinv362 invert 1E+1 -> NaN Invalid_operation +dqinv363 invert 0.0 -> NaN Invalid_operation +dqinv364 invert 0E+1 -> NaN Invalid_operation +dqinv365 invert 9.9 -> NaN Invalid_operation +dqinv366 invert 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +dqinv788 invert -Inf -> NaN Invalid_operation +dqinv794 invert Inf -> NaN Invalid_operation +dqinv821 invert NaN -> NaN Invalid_operation +dqinv841 invert sNaN -> NaN Invalid_operation +-- propagating NaNs +dqinv861 invert NaN1 -> NaN Invalid_operation +dqinv862 invert +NaN2 -> NaN Invalid_operation +dqinv863 invert NaN3 -> NaN Invalid_operation +dqinv864 invert NaN4 -> NaN Invalid_operation +dqinv865 invert NaN5 -> NaN Invalid_operation +dqinv871 invert sNaN11 -> NaN Invalid_operation +dqinv872 invert sNaN12 -> NaN Invalid_operation +dqinv873 invert sNaN13 -> NaN Invalid_operation +dqinv874 invert sNaN14 -> NaN Invalid_operation +dqinv875 invert sNaN15 -> NaN Invalid_operation +dqinv876 invert NaN16 -> NaN Invalid_operation +dqinv881 invert +NaN25 -> NaN Invalid_operation +dqinv882 invert -NaN26 -> NaN Invalid_operation +dqinv883 invert -sNaN27 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqLogB.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqLogB.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,160 @@ +------------------------------------------------------------------------ +-- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads -- +-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- basics +dqlogb000 logb 0 -> -Infinity Division_by_zero +dqlogb001 logb 1E-6176 -> -6176 +dqlogb002 logb 1E-6143 -> -6143 +dqlogb003 logb 0.001 -> -3 +dqlogb004 logb 0.03 -> -2 +dqlogb005 logb 1 -> 0 +dqlogb006 logb 2 -> 0 +dqlogb007 logb 2.5 -> 0 +dqlogb008 logb 2.50 -> 0 +dqlogb009 logb 2.500 -> 0 +dqlogb010 logb 10 -> 1 +dqlogb011 logb 70 -> 1 +dqlogb012 logb 100 -> 2 +dqlogb013 logb 250 -> 2 +dqlogb014 logb 9E+6144 -> 6144 +dqlogb015 logb +Infinity -> Infinity + +-- negatives appear to be treated as positives +dqlogb021 logb -0 -> -Infinity Division_by_zero +dqlogb022 logb -1E-6176 -> -6176 +dqlogb023 logb -9E-6143 -> -6143 +dqlogb024 logb -0.001 -> -3 +dqlogb025 logb -1 -> 0 +dqlogb026 logb -2 -> 0 +dqlogb027 logb -10 -> 1 +dqlogb028 logb -70 -> 1 +dqlogb029 logb -100 -> 2 +dqlogb030 logb -9E+6144 -> 6144 +dqlogb031 logb -Infinity -> Infinity + +-- zeros +dqlogb111 logb 0 -> -Infinity Division_by_zero +dqlogb112 logb -0 -> -Infinity Division_by_zero +dqlogb113 logb 0E+4 -> -Infinity Division_by_zero +dqlogb114 logb -0E+4 -> -Infinity Division_by_zero +dqlogb115 logb 0.0000 -> -Infinity Division_by_zero +dqlogb116 logb -0.0000 -> -Infinity Division_by_zero +dqlogb117 logb 0E-141 -> -Infinity Division_by_zero +dqlogb118 logb -0E-141 -> -Infinity Division_by_zero + +-- full coefficients, alternating bits +dqlogb121 logb 268268268 -> 8 +dqlogb122 logb -268268268 -> 8 +dqlogb123 logb 134134134 -> 8 +dqlogb124 logb -134134134 -> 8 + +-- Nmax, Nmin, Ntiny +dqlogb131 logb 9.999999999999999999999999999999999E+6144 -> 6144 +dqlogb132 logb 1E-6143 -> -6143 +dqlogb133 logb 1.000000000000000000000000000000000E-6143 -> -6143 +dqlogb134 logb 1E-6176 -> -6176 + +dqlogb135 logb -1E-6176 -> -6176 +dqlogb136 logb -1.000000000000000000000000000000000E-6143 -> -6143 +dqlogb137 logb -1E-6143 -> -6143 +dqlogb1614 logb -9.999999999999999999999999999999999E+6144 -> 6144 + +-- ones +dqlogb0061 logb 1 -> 0 +dqlogb0062 logb 1.0 -> 0 +dqlogb0063 logb 1.000000000000000 -> 0 + +-- notable cases -- exact powers of 10 +dqlogb1100 logb 1 -> 0 +dqlogb1101 logb 10 -> 1 +dqlogb1102 logb 100 -> 2 +dqlogb1103 logb 1000 -> 3 +dqlogb1104 logb 10000 -> 4 +dqlogb1105 logb 100000 -> 5 +dqlogb1106 logb 1000000 -> 6 +dqlogb1107 logb 10000000 -> 7 +dqlogb1108 logb 100000000 -> 8 +dqlogb1109 logb 1000000000 -> 9 +dqlogb1110 logb 10000000000 -> 10 +dqlogb1111 logb 100000000000 -> 11 +dqlogb1112 logb 1000000000000 -> 12 +dqlogb1113 logb 0.00000000001 -> -11 +dqlogb1114 logb 0.0000000001 -> -10 +dqlogb1115 logb 0.000000001 -> -9 +dqlogb1116 logb 0.00000001 -> -8 +dqlogb1117 logb 0.0000001 -> -7 +dqlogb1118 logb 0.000001 -> -6 +dqlogb1119 logb 0.00001 -> -5 +dqlogb1120 logb 0.0001 -> -4 +dqlogb1121 logb 0.001 -> -3 +dqlogb1122 logb 0.01 -> -2 +dqlogb1123 logb 0.1 -> -1 +dqlogb1124 logb 1E-99 -> -99 +dqlogb1125 logb 1E-100 -> -100 +dqlogb1127 logb 1E-299 -> -299 +dqlogb1126 logb 1E-6143 -> -6143 + +-- suggestions from Ilan Nehama +dqlogb1400 logb 10E-3 -> -2 +dqlogb1401 logb 10E-2 -> -1 +dqlogb1402 logb 100E-2 -> 0 +dqlogb1403 logb 1000E-2 -> 1 +dqlogb1404 logb 10000E-2 -> 2 +dqlogb1405 logb 10E-1 -> 0 +dqlogb1406 logb 100E-1 -> 1 +dqlogb1407 logb 1000E-1 -> 2 +dqlogb1408 logb 10000E-1 -> 3 +dqlogb1409 logb 10E0 -> 1 +dqlogb1410 logb 100E0 -> 2 +dqlogb1411 logb 1000E0 -> 3 +dqlogb1412 logb 10000E0 -> 4 +dqlogb1413 logb 10E1 -> 2 +dqlogb1414 logb 100E1 -> 3 +dqlogb1415 logb 1000E1 -> 4 +dqlogb1416 logb 10000E1 -> 5 +dqlogb1417 logb 10E2 -> 3 +dqlogb1418 logb 100E2 -> 4 +dqlogb1419 logb 1000E2 -> 5 +dqlogb1420 logb 10000E2 -> 6 + +-- special values +dqlogb820 logb Infinity -> Infinity +dqlogb821 logb 0 -> -Infinity Division_by_zero +dqlogb822 logb NaN -> NaN +dqlogb823 logb sNaN -> NaN Invalid_operation +-- propagating NaNs +dqlogb824 logb sNaN123 -> NaN123 Invalid_operation +dqlogb825 logb -sNaN321 -> -NaN321 Invalid_operation +dqlogb826 logb NaN456 -> NaN456 +dqlogb827 logb -NaN654 -> -NaN654 +dqlogb828 logb NaN1 -> NaN1 + +-- Null test +dqlogb900 logb # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMax.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMax.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,322 @@ +------------------------------------------------------------------------ +-- dqMax.decTest -- decQuad maxnum -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqmax001 max -2 -2 -> -2 +dqmax002 max -2 -1 -> -1 +dqmax003 max -2 0 -> 0 +dqmax004 max -2 1 -> 1 +dqmax005 max -2 2 -> 2 +dqmax006 max -1 -2 -> -1 +dqmax007 max -1 -1 -> -1 +dqmax008 max -1 0 -> 0 +dqmax009 max -1 1 -> 1 +dqmax010 max -1 2 -> 2 +dqmax011 max 0 -2 -> 0 +dqmax012 max 0 -1 -> 0 +dqmax013 max 0 0 -> 0 +dqmax014 max 0 1 -> 1 +dqmax015 max 0 2 -> 2 +dqmax016 max 1 -2 -> 1 +dqmax017 max 1 -1 -> 1 +dqmax018 max 1 0 -> 1 +dqmax019 max 1 1 -> 1 +dqmax020 max 1 2 -> 2 +dqmax021 max 2 -2 -> 2 +dqmax022 max 2 -1 -> 2 +dqmax023 max 2 0 -> 2 +dqmax025 max 2 1 -> 2 +dqmax026 max 2 2 -> 2 + +-- extended zeros +dqmax030 max 0 0 -> 0 +dqmax031 max 0 -0 -> 0 +dqmax032 max 0 -0.0 -> 0 +dqmax033 max 0 0.0 -> 0 +dqmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen +dqmax035 max -0 -0 -> -0 +dqmax036 max -0 -0.0 -> -0.0 +dqmax037 max -0 0.0 -> 0.0 +dqmax038 max 0.0 0 -> 0 +dqmax039 max 0.0 -0 -> 0.0 +dqmax040 max 0.0 -0.0 -> 0.0 +dqmax041 max 0.0 0.0 -> 0.0 +dqmax042 max -0.0 0 -> 0 +dqmax043 max -0.0 -0 -> -0.0 +dqmax044 max -0.0 -0.0 -> -0.0 +dqmax045 max -0.0 0.0 -> 0.0 + +dqmax050 max -0E1 0E1 -> 0E+1 +dqmax051 max -0E2 0E2 -> 0E+2 +dqmax052 max -0E2 0E1 -> 0E+1 +dqmax053 max -0E1 0E2 -> 0E+2 +dqmax054 max 0E1 -0E1 -> 0E+1 +dqmax055 max 0E2 -0E2 -> 0E+2 +dqmax056 max 0E2 -0E1 -> 0E+2 +dqmax057 max 0E1 -0E2 -> 0E+1 + +dqmax058 max 0E1 0E1 -> 0E+1 +dqmax059 max 0E2 0E2 -> 0E+2 +dqmax060 max 0E2 0E1 -> 0E+2 +dqmax061 max 0E1 0E2 -> 0E+2 +dqmax062 max -0E1 -0E1 -> -0E+1 +dqmax063 max -0E2 -0E2 -> -0E+2 +dqmax064 max -0E2 -0E1 -> -0E+1 +dqmax065 max -0E1 -0E2 -> -0E+1 + +-- Specials +dqmax090 max Inf -Inf -> Infinity +dqmax091 max Inf -1000 -> Infinity +dqmax092 max Inf -1 -> Infinity +dqmax093 max Inf -0 -> Infinity +dqmax094 max Inf 0 -> Infinity +dqmax095 max Inf 1 -> Infinity +dqmax096 max Inf 1000 -> Infinity +dqmax097 max Inf Inf -> Infinity +dqmax098 max -1000 Inf -> Infinity +dqmax099 max -Inf Inf -> Infinity +dqmax100 max -1 Inf -> Infinity +dqmax101 max -0 Inf -> Infinity +dqmax102 max 0 Inf -> Infinity +dqmax103 max 1 Inf -> Infinity +dqmax104 max 1000 Inf -> Infinity +dqmax105 max Inf Inf -> Infinity + +dqmax120 max -Inf -Inf -> -Infinity +dqmax121 max -Inf -1000 -> -1000 +dqmax122 max -Inf -1 -> -1 +dqmax123 max -Inf -0 -> -0 +dqmax124 max -Inf 0 -> 0 +dqmax125 max -Inf 1 -> 1 +dqmax126 max -Inf 1000 -> 1000 +dqmax127 max -Inf Inf -> Infinity +dqmax128 max -Inf -Inf -> -Infinity +dqmax129 max -1000 -Inf -> -1000 +dqmax130 max -1 -Inf -> -1 +dqmax131 max -0 -Inf -> -0 +dqmax132 max 0 -Inf -> 0 +dqmax133 max 1 -Inf -> 1 +dqmax134 max 1000 -Inf -> 1000 +dqmax135 max Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +dqmax141 max NaN -Inf -> -Infinity +dqmax142 max NaN -1000 -> -1000 +dqmax143 max NaN -1 -> -1 +dqmax144 max NaN -0 -> -0 +dqmax145 max NaN 0 -> 0 +dqmax146 max NaN 1 -> 1 +dqmax147 max NaN 1000 -> 1000 +dqmax148 max NaN Inf -> Infinity +dqmax149 max NaN NaN -> NaN +dqmax150 max -Inf NaN -> -Infinity +dqmax151 max -1000 NaN -> -1000 +dqmax152 max -1 NaN -> -1 +dqmax153 max -0 NaN -> -0 +dqmax154 max 0 NaN -> 0 +dqmax155 max 1 NaN -> 1 +dqmax156 max 1000 NaN -> 1000 +dqmax157 max Inf NaN -> Infinity + +dqmax161 max sNaN -Inf -> NaN Invalid_operation +dqmax162 max sNaN -1000 -> NaN Invalid_operation +dqmax163 max sNaN -1 -> NaN Invalid_operation +dqmax164 max sNaN -0 -> NaN Invalid_operation +dqmax165 max sNaN 0 -> NaN Invalid_operation +dqmax166 max sNaN 1 -> NaN Invalid_operation +dqmax167 max sNaN 1000 -> NaN Invalid_operation +dqmax168 max sNaN NaN -> NaN Invalid_operation +dqmax169 max sNaN sNaN -> NaN Invalid_operation +dqmax170 max NaN sNaN -> NaN Invalid_operation +dqmax171 max -Inf sNaN -> NaN Invalid_operation +dqmax172 max -1000 sNaN -> NaN Invalid_operation +dqmax173 max -1 sNaN -> NaN Invalid_operation +dqmax174 max -0 sNaN -> NaN Invalid_operation +dqmax175 max 0 sNaN -> NaN Invalid_operation +dqmax176 max 1 sNaN -> NaN Invalid_operation +dqmax177 max 1000 sNaN -> NaN Invalid_operation +dqmax178 max Inf sNaN -> NaN Invalid_operation +dqmax179 max NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqmax181 max NaN9 -Inf -> -Infinity +dqmax182 max NaN8 9 -> 9 +dqmax183 max -NaN7 Inf -> Infinity + +dqmax184 max -NaN1 NaN11 -> -NaN1 +dqmax185 max NaN2 NaN12 -> NaN2 +dqmax186 max -NaN13 -NaN7 -> -NaN13 +dqmax187 max NaN14 -NaN5 -> NaN14 + +dqmax188 max -Inf NaN4 -> -Infinity +dqmax189 max -9 -NaN3 -> -9 +dqmax190 max Inf NaN2 -> Infinity + +dqmax191 max sNaN99 -Inf -> NaN99 Invalid_operation +dqmax192 max sNaN98 -1 -> NaN98 Invalid_operation +dqmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation +dqmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation +dqmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation +dqmax196 max -Inf sNaN92 -> NaN92 Invalid_operation +dqmax197 max 0 sNaN91 -> NaN91 Invalid_operation +dqmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation +dqmax199 max NaN sNaN89 -> NaN89 Invalid_operation + +-- old rounding checks +dqmax221 max 12345678000 1 -> 12345678000 +dqmax222 max 1 12345678000 -> 12345678000 +dqmax223 max 1234567800 1 -> 1234567800 +dqmax224 max 1 1234567800 -> 1234567800 +dqmax225 max 1234567890 1 -> 1234567890 +dqmax226 max 1 1234567890 -> 1234567890 +dqmax227 max 1234567891 1 -> 1234567891 +dqmax228 max 1 1234567891 -> 1234567891 +dqmax229 max 12345678901 1 -> 12345678901 +dqmax230 max 1 12345678901 -> 12345678901 +dqmax231 max 1234567896 1 -> 1234567896 +dqmax232 max 1 1234567896 -> 1234567896 +dqmax233 max -1234567891 1 -> 1 +dqmax234 max 1 -1234567891 -> 1 +dqmax235 max -12345678901 1 -> 1 +dqmax236 max 1 -12345678901 -> 1 +dqmax237 max -1234567896 1 -> 1 +dqmax238 max 1 -1234567896 -> 1 + +-- from examples +dqmax280 max '3' '2' -> '3' +dqmax281 max '-10' '3' -> '3' +dqmax282 max '1.0' '1' -> '1' +dqmax283 max '1' '1.0' -> '1' +dqmax284 max '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +dqmax401 max Inf 1.1 -> Infinity +dqmax402 max 1.1 1 -> 1.1 +dqmax403 max 1 1.0 -> 1 +dqmax404 max 1.0 0.1 -> 1.0 +dqmax405 max 0.1 0.10 -> 0.1 +dqmax406 max 0.10 0.100 -> 0.10 +dqmax407 max 0.10 0 -> 0.10 +dqmax408 max 0 0.0 -> 0 +dqmax409 max 0.0 -0 -> 0.0 +dqmax410 max 0.0 -0.0 -> 0.0 +dqmax411 max 0.00 -0.0 -> 0.00 +dqmax412 max 0.0 -0.00 -> 0.0 +dqmax413 max 0 -0.0 -> 0 +dqmax414 max 0 -0 -> 0 +dqmax415 max -0.0 -0 -> -0.0 +dqmax416 max -0 -0.100 -> -0 +dqmax417 max -0.100 -0.10 -> -0.100 +dqmax418 max -0.10 -0.1 -> -0.10 +dqmax419 max -0.1 -1.0 -> -0.1 +dqmax420 max -1.0 -1 -> -1.0 +dqmax421 max -1 -1.1 -> -1 +dqmax423 max -1.1 -Inf -> -1.1 +-- same with operands reversed +dqmax431 max 1.1 Inf -> Infinity +dqmax432 max 1 1.1 -> 1.1 +dqmax433 max 1.0 1 -> 1 +dqmax434 max 0.1 1.0 -> 1.0 +dqmax435 max 0.10 0.1 -> 0.1 +dqmax436 max 0.100 0.10 -> 0.10 +dqmax437 max 0 0.10 -> 0.10 +dqmax438 max 0.0 0 -> 0 +dqmax439 max -0 0.0 -> 0.0 +dqmax440 max -0.0 0.0 -> 0.0 +dqmax441 max -0.0 0.00 -> 0.00 +dqmax442 max -0.00 0.0 -> 0.0 +dqmax443 max -0.0 0 -> 0 +dqmax444 max -0 0 -> 0 +dqmax445 max -0 -0.0 -> -0.0 +dqmax446 max -0.100 -0 -> -0 +dqmax447 max -0.10 -0.100 -> -0.100 +dqmax448 max -0.1 -0.10 -> -0.10 +dqmax449 max -1.0 -0.1 -> -0.1 +dqmax450 max -1 -1.0 -> -1.0 +dqmax451 max -1.1 -1 -> -1 +dqmax453 max -Inf -1.1 -> -1.1 +-- largies +dqmax460 max 1000 1E+3 -> 1E+3 +dqmax461 max 1E+3 1000 -> 1E+3 +dqmax462 max 1000 -1E+3 -> 1000 +dqmax463 max 1E+3 -1000 -> 1E+3 +dqmax464 max -1000 1E+3 -> 1E+3 +dqmax465 max -1E+3 1000 -> 1000 +dqmax466 max -1000 -1E+3 -> -1000 +dqmax467 max -1E+3 -1000 -> -1000 + +-- misalignment traps for little-endian +dqmax471 max 1.0 0.1 -> 1.0 +dqmax472 max 0.1 1.0 -> 1.0 +dqmax473 max 10.0 0.1 -> 10.0 +dqmax474 max 0.1 10.0 -> 10.0 +dqmax475 max 100 1.0 -> 100 +dqmax476 max 1.0 100 -> 100 +dqmax477 max 1000 10.0 -> 1000 +dqmax478 max 10.0 1000 -> 1000 +dqmax479 max 10000 100.0 -> 10000 +dqmax480 max 100.0 10000 -> 10000 +dqmax481 max 100000 1000.0 -> 100000 +dqmax482 max 1000.0 100000 -> 100000 +dqmax483 max 1000000 10000.0 -> 1000000 +dqmax484 max 10000.0 1000000 -> 1000000 + +-- subnormals +dqmax510 max 1.00E-6143 0 -> 1.00E-6143 +dqmax511 max 0.1E-6143 0 -> 1E-6144 Subnormal +dqmax512 max 0.10E-6143 0 -> 1.0E-6144 Subnormal +dqmax513 max 0.100E-6143 0 -> 1.00E-6144 Subnormal +dqmax514 max 0.01E-6143 0 -> 1E-6145 Subnormal +dqmax515 max 0.999E-6143 0 -> 9.99E-6144 Subnormal +dqmax516 max 0.099E-6143 0 -> 9.9E-6145 Subnormal +dqmax517 max 0.009E-6143 0 -> 9E-6146 Subnormal +dqmax518 max 0.001E-6143 0 -> 1E-6146 Subnormal +dqmax519 max 0.0009E-6143 0 -> 9E-6147 Subnormal +dqmax520 max 0.0001E-6143 0 -> 1E-6147 Subnormal + +dqmax530 max -1.00E-6143 0 -> 0 +dqmax531 max -0.1E-6143 0 -> 0 +dqmax532 max -0.10E-6143 0 -> 0 +dqmax533 max -0.100E-6143 0 -> 0 +dqmax534 max -0.01E-6143 0 -> 0 +dqmax535 max -0.999E-6143 0 -> 0 +dqmax536 max -0.099E-6143 0 -> 0 +dqmax537 max -0.009E-6143 0 -> 0 +dqmax538 max -0.001E-6143 0 -> 0 +dqmax539 max -0.0009E-6143 0 -> 0 +dqmax540 max -0.0001E-6143 0 -> 0 + +-- Null tests +dqmax900 max 10 # -> NaN Invalid_operation +dqmax901 max # 10 -> NaN Invalid_operation + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMaxMag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMaxMag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,304 @@ +------------------------------------------------------------------------ +-- dqMaxMag.decTest -- decQuad maxnummag -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqmxg001 maxmag -2 -2 -> -2 +dqmxg002 maxmag -2 -1 -> -2 +dqmxg003 maxmag -2 0 -> -2 +dqmxg004 maxmag -2 1 -> -2 +dqmxg005 maxmag -2 2 -> 2 +dqmxg006 maxmag -1 -2 -> -2 +dqmxg007 maxmag -1 -1 -> -1 +dqmxg008 maxmag -1 0 -> -1 +dqmxg009 maxmag -1 1 -> 1 +dqmxg010 maxmag -1 2 -> 2 +dqmxg011 maxmag 0 -2 -> -2 +dqmxg012 maxmag 0 -1 -> -1 +dqmxg013 maxmag 0 0 -> 0 +dqmxg014 maxmag 0 1 -> 1 +dqmxg015 maxmag 0 2 -> 2 +dqmxg016 maxmag 1 -2 -> -2 +dqmxg017 maxmag 1 -1 -> 1 +dqmxg018 maxmag 1 0 -> 1 +dqmxg019 maxmag 1 1 -> 1 +dqmxg020 maxmag 1 2 -> 2 +dqmxg021 maxmag 2 -2 -> 2 +dqmxg022 maxmag 2 -1 -> 2 +dqmxg023 maxmag 2 0 -> 2 +dqmxg025 maxmag 2 1 -> 2 +dqmxg026 maxmag 2 2 -> 2 + +-- extended zeros +dqmxg030 maxmag 0 0 -> 0 +dqmxg031 maxmag 0 -0 -> 0 +dqmxg032 maxmag 0 -0.0 -> 0 +dqmxg033 maxmag 0 0.0 -> 0 +dqmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen +dqmxg035 maxmag -0 -0 -> -0 +dqmxg036 maxmag -0 -0.0 -> -0.0 +dqmxg037 maxmag -0 0.0 -> 0.0 +dqmxg038 maxmag 0.0 0 -> 0 +dqmxg039 maxmag 0.0 -0 -> 0.0 +dqmxg040 maxmag 0.0 -0.0 -> 0.0 +dqmxg041 maxmag 0.0 0.0 -> 0.0 +dqmxg042 maxmag -0.0 0 -> 0 +dqmxg043 maxmag -0.0 -0 -> -0.0 +dqmxg044 maxmag -0.0 -0.0 -> -0.0 +dqmxg045 maxmag -0.0 0.0 -> 0.0 + +dqmxg050 maxmag -0E1 0E1 -> 0E+1 +dqmxg051 maxmag -0E2 0E2 -> 0E+2 +dqmxg052 maxmag -0E2 0E1 -> 0E+1 +dqmxg053 maxmag -0E1 0E2 -> 0E+2 +dqmxg054 maxmag 0E1 -0E1 -> 0E+1 +dqmxg055 maxmag 0E2 -0E2 -> 0E+2 +dqmxg056 maxmag 0E2 -0E1 -> 0E+2 +dqmxg057 maxmag 0E1 -0E2 -> 0E+1 + +dqmxg058 maxmag 0E1 0E1 -> 0E+1 +dqmxg059 maxmag 0E2 0E2 -> 0E+2 +dqmxg060 maxmag 0E2 0E1 -> 0E+2 +dqmxg061 maxmag 0E1 0E2 -> 0E+2 +dqmxg062 maxmag -0E1 -0E1 -> -0E+1 +dqmxg063 maxmag -0E2 -0E2 -> -0E+2 +dqmxg064 maxmag -0E2 -0E1 -> -0E+1 +dqmxg065 maxmag -0E1 -0E2 -> -0E+1 + +-- Specials +dqmxg090 maxmag Inf -Inf -> Infinity +dqmxg091 maxmag Inf -1000 -> Infinity +dqmxg092 maxmag Inf -1 -> Infinity +dqmxg093 maxmag Inf -0 -> Infinity +dqmxg094 maxmag Inf 0 -> Infinity +dqmxg095 maxmag Inf 1 -> Infinity +dqmxg096 maxmag Inf 1000 -> Infinity +dqmxg097 maxmag Inf Inf -> Infinity +dqmxg098 maxmag -1000 Inf -> Infinity +dqmxg099 maxmag -Inf Inf -> Infinity +dqmxg100 maxmag -1 Inf -> Infinity +dqmxg101 maxmag -0 Inf -> Infinity +dqmxg102 maxmag 0 Inf -> Infinity +dqmxg103 maxmag 1 Inf -> Infinity +dqmxg104 maxmag 1000 Inf -> Infinity +dqmxg105 maxmag Inf Inf -> Infinity + +dqmxg120 maxmag -Inf -Inf -> -Infinity +dqmxg121 maxmag -Inf -1000 -> -Infinity +dqmxg122 maxmag -Inf -1 -> -Infinity +dqmxg123 maxmag -Inf -0 -> -Infinity +dqmxg124 maxmag -Inf 0 -> -Infinity +dqmxg125 maxmag -Inf 1 -> -Infinity +dqmxg126 maxmag -Inf 1000 -> -Infinity +dqmxg127 maxmag -Inf Inf -> Infinity +dqmxg128 maxmag -Inf -Inf -> -Infinity +dqmxg129 maxmag -1000 -Inf -> -Infinity +dqmxg130 maxmag -1 -Inf -> -Infinity +dqmxg131 maxmag -0 -Inf -> -Infinity +dqmxg132 maxmag 0 -Inf -> -Infinity +dqmxg133 maxmag 1 -Inf -> -Infinity +dqmxg134 maxmag 1000 -Inf -> -Infinity +dqmxg135 maxmag Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +dqmxg141 maxmag NaN -Inf -> -Infinity +dqmxg142 maxmag NaN -1000 -> -1000 +dqmxg143 maxmag NaN -1 -> -1 +dqmxg144 maxmag NaN -0 -> -0 +dqmxg145 maxmag NaN 0 -> 0 +dqmxg146 maxmag NaN 1 -> 1 +dqmxg147 maxmag NaN 1000 -> 1000 +dqmxg148 maxmag NaN Inf -> Infinity +dqmxg149 maxmag NaN NaN -> NaN +dqmxg150 maxmag -Inf NaN -> -Infinity +dqmxg151 maxmag -1000 NaN -> -1000 +dqmxg152 maxmag -1 NaN -> -1 +dqmxg153 maxmag -0 NaN -> -0 +dqmxg154 maxmag 0 NaN -> 0 +dqmxg155 maxmag 1 NaN -> 1 +dqmxg156 maxmag 1000 NaN -> 1000 +dqmxg157 maxmag Inf NaN -> Infinity + +dqmxg161 maxmag sNaN -Inf -> NaN Invalid_operation +dqmxg162 maxmag sNaN -1000 -> NaN Invalid_operation +dqmxg163 maxmag sNaN -1 -> NaN Invalid_operation +dqmxg164 maxmag sNaN -0 -> NaN Invalid_operation +dqmxg165 maxmag sNaN 0 -> NaN Invalid_operation +dqmxg166 maxmag sNaN 1 -> NaN Invalid_operation +dqmxg167 maxmag sNaN 1000 -> NaN Invalid_operation +dqmxg168 maxmag sNaN NaN -> NaN Invalid_operation +dqmxg169 maxmag sNaN sNaN -> NaN Invalid_operation +dqmxg170 maxmag NaN sNaN -> NaN Invalid_operation +dqmxg171 maxmag -Inf sNaN -> NaN Invalid_operation +dqmxg172 maxmag -1000 sNaN -> NaN Invalid_operation +dqmxg173 maxmag -1 sNaN -> NaN Invalid_operation +dqmxg174 maxmag -0 sNaN -> NaN Invalid_operation +dqmxg175 maxmag 0 sNaN -> NaN Invalid_operation +dqmxg176 maxmag 1 sNaN -> NaN Invalid_operation +dqmxg177 maxmag 1000 sNaN -> NaN Invalid_operation +dqmxg178 maxmag Inf sNaN -> NaN Invalid_operation +dqmxg179 maxmag NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqmxg181 maxmag NaN9 -Inf -> -Infinity +dqmxg182 maxmag NaN8 9 -> 9 +dqmxg183 maxmag -NaN7 Inf -> Infinity + +dqmxg184 maxmag -NaN1 NaN11 -> -NaN1 +dqmxg185 maxmag NaN2 NaN12 -> NaN2 +dqmxg186 maxmag -NaN13 -NaN7 -> -NaN13 +dqmxg187 maxmag NaN14 -NaN5 -> NaN14 + +dqmxg188 maxmag -Inf NaN4 -> -Infinity +dqmxg189 maxmag -9 -NaN3 -> -9 +dqmxg190 maxmag Inf NaN2 -> Infinity + +dqmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation +dqmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation +dqmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation +dqmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation +dqmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation +dqmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation +dqmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation +dqmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation +dqmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation + +-- old rounding checks +dqmxg221 maxmag 12345678000 1 -> 12345678000 +dqmxg222 maxmag 1 12345678000 -> 12345678000 +dqmxg223 maxmag 1234567800 1 -> 1234567800 +dqmxg224 maxmag 1 1234567800 -> 1234567800 +dqmxg225 maxmag 1234567890 1 -> 1234567890 +dqmxg226 maxmag 1 1234567890 -> 1234567890 +dqmxg227 maxmag 1234567891 1 -> 1234567891 +dqmxg228 maxmag 1 1234567891 -> 1234567891 +dqmxg229 maxmag 12345678901 1 -> 12345678901 +dqmxg230 maxmag 1 12345678901 -> 12345678901 +dqmxg231 maxmag 1234567896 1 -> 1234567896 +dqmxg232 maxmag 1 1234567896 -> 1234567896 +dqmxg233 maxmag -1234567891 1 -> -1234567891 +dqmxg234 maxmag 1 -1234567891 -> -1234567891 +dqmxg235 maxmag -12345678901 1 -> -12345678901 +dqmxg236 maxmag 1 -12345678901 -> -12345678901 +dqmxg237 maxmag -1234567896 1 -> -1234567896 +dqmxg238 maxmag 1 -1234567896 -> -1234567896 + +-- from examples +dqmxg280 maxmag '3' '2' -> '3' +dqmxg281 maxmag '-10' '3' -> '-10' +dqmxg282 maxmag '1.0' '1' -> '1' +dqmxg283 maxmag '1' '1.0' -> '1' +dqmxg284 maxmag '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +dqmxg401 maxmag Inf 1.1 -> Infinity +dqmxg402 maxmag 1.1 1 -> 1.1 +dqmxg403 maxmag 1 1.0 -> 1 +dqmxg404 maxmag 1.0 0.1 -> 1.0 +dqmxg405 maxmag 0.1 0.10 -> 0.1 +dqmxg406 maxmag 0.10 0.100 -> 0.10 +dqmxg407 maxmag 0.10 0 -> 0.10 +dqmxg408 maxmag 0 0.0 -> 0 +dqmxg409 maxmag 0.0 -0 -> 0.0 +dqmxg410 maxmag 0.0 -0.0 -> 0.0 +dqmxg411 maxmag 0.00 -0.0 -> 0.00 +dqmxg412 maxmag 0.0 -0.00 -> 0.0 +dqmxg413 maxmag 0 -0.0 -> 0 +dqmxg414 maxmag 0 -0 -> 0 +dqmxg415 maxmag -0.0 -0 -> -0.0 +dqmxg416 maxmag -0 -0.100 -> -0.100 +dqmxg417 maxmag -0.100 -0.10 -> -0.100 +dqmxg418 maxmag -0.10 -0.1 -> -0.10 +dqmxg419 maxmag -0.1 -1.0 -> -1.0 +dqmxg420 maxmag -1.0 -1 -> -1.0 +dqmxg421 maxmag -1 -1.1 -> -1.1 +dqmxg423 maxmag -1.1 -Inf -> -Infinity +-- same with operands reversed +dqmxg431 maxmag 1.1 Inf -> Infinity +dqmxg432 maxmag 1 1.1 -> 1.1 +dqmxg433 maxmag 1.0 1 -> 1 +dqmxg434 maxmag 0.1 1.0 -> 1.0 +dqmxg435 maxmag 0.10 0.1 -> 0.1 +dqmxg436 maxmag 0.100 0.10 -> 0.10 +dqmxg437 maxmag 0 0.10 -> 0.10 +dqmxg438 maxmag 0.0 0 -> 0 +dqmxg439 maxmag -0 0.0 -> 0.0 +dqmxg440 maxmag -0.0 0.0 -> 0.0 +dqmxg441 maxmag -0.0 0.00 -> 0.00 +dqmxg442 maxmag -0.00 0.0 -> 0.0 +dqmxg443 maxmag -0.0 0 -> 0 +dqmxg444 maxmag -0 0 -> 0 +dqmxg445 maxmag -0 -0.0 -> -0.0 +dqmxg446 maxmag -0.100 -0 -> -0.100 +dqmxg447 maxmag -0.10 -0.100 -> -0.100 +dqmxg448 maxmag -0.1 -0.10 -> -0.10 +dqmxg449 maxmag -1.0 -0.1 -> -1.0 +dqmxg450 maxmag -1 -1.0 -> -1.0 +dqmxg451 maxmag -1.1 -1 -> -1.1 +dqmxg453 maxmag -Inf -1.1 -> -Infinity +-- largies +dqmxg460 maxmag 1000 1E+3 -> 1E+3 +dqmxg461 maxmag 1E+3 1000 -> 1E+3 +dqmxg462 maxmag 1000 -1E+3 -> 1000 +dqmxg463 maxmag 1E+3 -1000 -> 1E+3 +dqmxg464 maxmag -1000 1E+3 -> 1E+3 +dqmxg465 maxmag -1E+3 1000 -> 1000 +dqmxg466 maxmag -1000 -1E+3 -> -1000 +dqmxg467 maxmag -1E+3 -1000 -> -1000 + +-- subnormals +dqmxg510 maxmag 1.00E-6143 0 -> 1.00E-6143 +dqmxg511 maxmag 0.1E-6143 0 -> 1E-6144 Subnormal +dqmxg512 maxmag 0.10E-6143 0 -> 1.0E-6144 Subnormal +dqmxg513 maxmag 0.100E-6143 0 -> 1.00E-6144 Subnormal +dqmxg514 maxmag 0.01E-6143 0 -> 1E-6145 Subnormal +dqmxg515 maxmag 0.999E-6143 0 -> 9.99E-6144 Subnormal +dqmxg516 maxmag 0.099E-6143 0 -> 9.9E-6145 Subnormal +dqmxg517 maxmag 0.009E-6143 0 -> 9E-6146 Subnormal +dqmxg518 maxmag 0.001E-6143 0 -> 1E-6146 Subnormal +dqmxg519 maxmag 0.0009E-6143 0 -> 9E-6147 Subnormal +dqmxg520 maxmag 0.0001E-6143 0 -> 1E-6147 Subnormal + +dqmxg530 maxmag -1.00E-6143 0 -> -1.00E-6143 +dqmxg531 maxmag -0.1E-6143 0 -> -1E-6144 Subnormal +dqmxg532 maxmag -0.10E-6143 0 -> -1.0E-6144 Subnormal +dqmxg533 maxmag -0.100E-6143 0 -> -1.00E-6144 Subnormal +dqmxg534 maxmag -0.01E-6143 0 -> -1E-6145 Subnormal +dqmxg535 maxmag -0.999E-6143 0 -> -9.99E-6144 Subnormal +dqmxg536 maxmag -0.099E-6143 0 -> -9.9E-6145 Subnormal +dqmxg537 maxmag -0.009E-6143 0 -> -9E-6146 Subnormal +dqmxg538 maxmag -0.001E-6143 0 -> -1E-6146 Subnormal +dqmxg539 maxmag -0.0009E-6143 0 -> -9E-6147 Subnormal +dqmxg540 maxmag -0.0001E-6143 0 -> -1E-6147 Subnormal + +-- Null tests +dqmxg900 maxmag 10 # -> NaN Invalid_operation +dqmxg901 maxmag # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMin.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMin.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,309 @@ +------------------------------------------------------------------------ +-- dqMin.decTest -- decQuad minnum -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqmin001 min -2 -2 -> -2 +dqmin002 min -2 -1 -> -2 +dqmin003 min -2 0 -> -2 +dqmin004 min -2 1 -> -2 +dqmin005 min -2 2 -> -2 +dqmin006 min -1 -2 -> -2 +dqmin007 min -1 -1 -> -1 +dqmin008 min -1 0 -> -1 +dqmin009 min -1 1 -> -1 +dqmin010 min -1 2 -> -1 +dqmin011 min 0 -2 -> -2 +dqmin012 min 0 -1 -> -1 +dqmin013 min 0 0 -> 0 +dqmin014 min 0 1 -> 0 +dqmin015 min 0 2 -> 0 +dqmin016 min 1 -2 -> -2 +dqmin017 min 1 -1 -> -1 +dqmin018 min 1 0 -> 0 +dqmin019 min 1 1 -> 1 +dqmin020 min 1 2 -> 1 +dqmin021 min 2 -2 -> -2 +dqmin022 min 2 -1 -> -1 +dqmin023 min 2 0 -> 0 +dqmin025 min 2 1 -> 1 +dqmin026 min 2 2 -> 2 + +-- extended zeros +dqmin030 min 0 0 -> 0 +dqmin031 min 0 -0 -> -0 +dqmin032 min 0 -0.0 -> -0.0 +dqmin033 min 0 0.0 -> 0.0 +dqmin034 min -0 0 -> -0 +dqmin035 min -0 -0 -> -0 +dqmin036 min -0 -0.0 -> -0 +dqmin037 min -0 0.0 -> -0 +dqmin038 min 0.0 0 -> 0.0 +dqmin039 min 0.0 -0 -> -0 +dqmin040 min 0.0 -0.0 -> -0.0 +dqmin041 min 0.0 0.0 -> 0.0 +dqmin042 min -0.0 0 -> -0.0 +dqmin043 min -0.0 -0 -> -0 +dqmin044 min -0.0 -0.0 -> -0.0 +dqmin045 min -0.0 0.0 -> -0.0 + +dqmin046 min 0E1 -0E1 -> -0E+1 +dqmin047 min -0E1 0E2 -> -0E+1 +dqmin048 min 0E2 0E1 -> 0E+1 +dqmin049 min 0E1 0E2 -> 0E+1 +dqmin050 min -0E3 -0E2 -> -0E+3 +dqmin051 min -0E2 -0E3 -> -0E+3 + +-- Specials +dqmin090 min Inf -Inf -> -Infinity +dqmin091 min Inf -1000 -> -1000 +dqmin092 min Inf -1 -> -1 +dqmin093 min Inf -0 -> -0 +dqmin094 min Inf 0 -> 0 +dqmin095 min Inf 1 -> 1 +dqmin096 min Inf 1000 -> 1000 +dqmin097 min Inf Inf -> Infinity +dqmin098 min -1000 Inf -> -1000 +dqmin099 min -Inf Inf -> -Infinity +dqmin100 min -1 Inf -> -1 +dqmin101 min -0 Inf -> -0 +dqmin102 min 0 Inf -> 0 +dqmin103 min 1 Inf -> 1 +dqmin104 min 1000 Inf -> 1000 +dqmin105 min Inf Inf -> Infinity + +dqmin120 min -Inf -Inf -> -Infinity +dqmin121 min -Inf -1000 -> -Infinity +dqmin122 min -Inf -1 -> -Infinity +dqmin123 min -Inf -0 -> -Infinity +dqmin124 min -Inf 0 -> -Infinity +dqmin125 min -Inf 1 -> -Infinity +dqmin126 min -Inf 1000 -> -Infinity +dqmin127 min -Inf Inf -> -Infinity +dqmin128 min -Inf -Inf -> -Infinity +dqmin129 min -1000 -Inf -> -Infinity +dqmin130 min -1 -Inf -> -Infinity +dqmin131 min -0 -Inf -> -Infinity +dqmin132 min 0 -Inf -> -Infinity +dqmin133 min 1 -Inf -> -Infinity +dqmin134 min 1000 -Inf -> -Infinity +dqmin135 min Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +dqmin141 min NaN -Inf -> -Infinity +dqmin142 min NaN -1000 -> -1000 +dqmin143 min NaN -1 -> -1 +dqmin144 min NaN -0 -> -0 +dqmin145 min NaN 0 -> 0 +dqmin146 min NaN 1 -> 1 +dqmin147 min NaN 1000 -> 1000 +dqmin148 min NaN Inf -> Infinity +dqmin149 min NaN NaN -> NaN +dqmin150 min -Inf NaN -> -Infinity +dqmin151 min -1000 NaN -> -1000 +dqmin152 min -1 -NaN -> -1 +dqmin153 min -0 NaN -> -0 +dqmin154 min 0 -NaN -> 0 +dqmin155 min 1 NaN -> 1 +dqmin156 min 1000 NaN -> 1000 +dqmin157 min Inf NaN -> Infinity + +dqmin161 min sNaN -Inf -> NaN Invalid_operation +dqmin162 min sNaN -1000 -> NaN Invalid_operation +dqmin163 min sNaN -1 -> NaN Invalid_operation +dqmin164 min sNaN -0 -> NaN Invalid_operation +dqmin165 min -sNaN 0 -> -NaN Invalid_operation +dqmin166 min -sNaN 1 -> -NaN Invalid_operation +dqmin167 min sNaN 1000 -> NaN Invalid_operation +dqmin168 min sNaN NaN -> NaN Invalid_operation +dqmin169 min sNaN sNaN -> NaN Invalid_operation +dqmin170 min NaN sNaN -> NaN Invalid_operation +dqmin171 min -Inf sNaN -> NaN Invalid_operation +dqmin172 min -1000 sNaN -> NaN Invalid_operation +dqmin173 min -1 sNaN -> NaN Invalid_operation +dqmin174 min -0 sNaN -> NaN Invalid_operation +dqmin175 min 0 sNaN -> NaN Invalid_operation +dqmin176 min 1 sNaN -> NaN Invalid_operation +dqmin177 min 1000 sNaN -> NaN Invalid_operation +dqmin178 min Inf sNaN -> NaN Invalid_operation +dqmin179 min NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqmin181 min NaN9 -Inf -> -Infinity +dqmin182 min -NaN8 9990 -> 9990 +dqmin183 min NaN71 Inf -> Infinity + +dqmin184 min NaN1 NaN54 -> NaN1 +dqmin185 min NaN22 -NaN53 -> NaN22 +dqmin186 min -NaN3 NaN6 -> -NaN3 +dqmin187 min -NaN44 NaN7 -> -NaN44 + +dqmin188 min -Inf NaN41 -> -Infinity +dqmin189 min -9999 -NaN33 -> -9999 +dqmin190 min Inf NaN2 -> Infinity + +dqmin191 min sNaN99 -Inf -> NaN99 Invalid_operation +dqmin192 min sNaN98 -11 -> NaN98 Invalid_operation +dqmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation +dqmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation +dqmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation +dqmin196 min -Inf sNaN92 -> NaN92 Invalid_operation +dqmin197 min 088 sNaN91 -> NaN91 Invalid_operation +dqmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation +dqmin199 min NaN sNaN86 -> NaN86 Invalid_operation + +-- old rounding checks +dqmin221 min -12345678000 1 -> -12345678000 +dqmin222 min 1 -12345678000 -> -12345678000 +dqmin223 min -1234567800 1 -> -1234567800 +dqmin224 min 1 -1234567800 -> -1234567800 +dqmin225 min -1234567890 1 -> -1234567890 +dqmin226 min 1 -1234567890 -> -1234567890 +dqmin227 min -1234567891 1 -> -1234567891 +dqmin228 min 1 -1234567891 -> -1234567891 +dqmin229 min -12345678901 1 -> -12345678901 +dqmin230 min 1 -12345678901 -> -12345678901 +dqmin231 min -1234567896 1 -> -1234567896 +dqmin232 min 1 -1234567896 -> -1234567896 +dqmin233 min 1234567891 1 -> 1 +dqmin234 min 1 1234567891 -> 1 +dqmin235 min 12345678901 1 -> 1 +dqmin236 min 1 12345678901 -> 1 +dqmin237 min 1234567896 1 -> 1 +dqmin238 min 1 1234567896 -> 1 + +-- from examples +dqmin280 min '3' '2' -> '2' +dqmin281 min '-10' '3' -> '-10' +dqmin282 min '1.0' '1' -> '1.0' +dqmin283 min '1' '1.0' -> '1.0' +dqmin284 min '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +dqmin401 min Inf 1.1 -> 1.1 +dqmin402 min 1.1 1 -> 1 +dqmin403 min 1 1.0 -> 1.0 +dqmin404 min 1.0 0.1 -> 0.1 +dqmin405 min 0.1 0.10 -> 0.10 +dqmin406 min 0.10 0.100 -> 0.100 +dqmin407 min 0.10 0 -> 0 +dqmin408 min 0 0.0 -> 0.0 +dqmin409 min 0.0 -0 -> -0 +dqmin410 min 0.0 -0.0 -> -0.0 +dqmin411 min 0.00 -0.0 -> -0.0 +dqmin412 min 0.0 -0.00 -> -0.00 +dqmin413 min 0 -0.0 -> -0.0 +dqmin414 min 0 -0 -> -0 +dqmin415 min -0.0 -0 -> -0 +dqmin416 min -0 -0.100 -> -0.100 +dqmin417 min -0.100 -0.10 -> -0.10 +dqmin418 min -0.10 -0.1 -> -0.1 +dqmin419 min -0.1 -1.0 -> -1.0 +dqmin420 min -1.0 -1 -> -1 +dqmin421 min -1 -1.1 -> -1.1 +dqmin423 min -1.1 -Inf -> -Infinity +-- same with operands reversed +dqmin431 min 1.1 Inf -> 1.1 +dqmin432 min 1 1.1 -> 1 +dqmin433 min 1.0 1 -> 1.0 +dqmin434 min 0.1 1.0 -> 0.1 +dqmin435 min 0.10 0.1 -> 0.10 +dqmin436 min 0.100 0.10 -> 0.100 +dqmin437 min 0 0.10 -> 0 +dqmin438 min 0.0 0 -> 0.0 +dqmin439 min -0 0.0 -> -0 +dqmin440 min -0.0 0.0 -> -0.0 +dqmin441 min -0.0 0.00 -> -0.0 +dqmin442 min -0.00 0.0 -> -0.00 +dqmin443 min -0.0 0 -> -0.0 +dqmin444 min -0 0 -> -0 +dqmin445 min -0 -0.0 -> -0 +dqmin446 min -0.100 -0 -> -0.100 +dqmin447 min -0.10 -0.100 -> -0.10 +dqmin448 min -0.1 -0.10 -> -0.1 +dqmin449 min -1.0 -0.1 -> -1.0 +dqmin450 min -1 -1.0 -> -1 +dqmin451 min -1.1 -1 -> -1.1 +dqmin453 min -Inf -1.1 -> -Infinity +-- largies +dqmin460 min 1000 1E+3 -> 1000 +dqmin461 min 1E+3 1000 -> 1000 +dqmin462 min 1000 -1E+3 -> -1E+3 +dqmin463 min 1E+3 -384 -> -384 +dqmin464 min -384 1E+3 -> -384 +dqmin465 min -1E+3 1000 -> -1E+3 +dqmin466 min -384 -1E+3 -> -1E+3 +dqmin467 min -1E+3 -384 -> -1E+3 + +-- misalignment traps for little-endian +dqmin471 min 1.0 0.1 -> 0.1 +dqmin472 min 0.1 1.0 -> 0.1 +dqmin473 min 10.0 0.1 -> 0.1 +dqmin474 min 0.1 10.0 -> 0.1 +dqmin475 min 100 1.0 -> 1.0 +dqmin476 min 1.0 100 -> 1.0 +dqmin477 min 1000 10.0 -> 10.0 +dqmin478 min 10.0 1000 -> 10.0 +dqmin479 min 10000 100.0 -> 100.0 +dqmin480 min 100.0 10000 -> 100.0 +dqmin481 min 100000 1000.0 -> 1000.0 +dqmin482 min 1000.0 100000 -> 1000.0 +dqmin483 min 1000000 10000.0 -> 10000.0 +dqmin484 min 10000.0 1000000 -> 10000.0 + +-- subnormals +dqmin510 min 1.00E-6143 0 -> 0 +dqmin511 min 0.1E-6143 0 -> 0 +dqmin512 min 0.10E-6143 0 -> 0 +dqmin513 min 0.100E-6143 0 -> 0 +dqmin514 min 0.01E-6143 0 -> 0 +dqmin515 min 0.999E-6143 0 -> 0 +dqmin516 min 0.099E-6143 0 -> 0 +dqmin517 min 0.009E-6143 0 -> 0 +dqmin518 min 0.001E-6143 0 -> 0 +dqmin519 min 0.0009E-6143 0 -> 0 +dqmin520 min 0.0001E-6143 0 -> 0 + +dqmin530 min -1.00E-6143 0 -> -1.00E-6143 +dqmin531 min -0.1E-6143 0 -> -1E-6144 Subnormal +dqmin532 min -0.10E-6143 0 -> -1.0E-6144 Subnormal +dqmin533 min -0.100E-6143 0 -> -1.00E-6144 Subnormal +dqmin534 min -0.01E-6143 0 -> -1E-6145 Subnormal +dqmin535 min -0.999E-6143 0 -> -9.99E-6144 Subnormal +dqmin536 min -0.099E-6143 0 -> -9.9E-6145 Subnormal +dqmin537 min -0.009E-6143 0 -> -9E-6146 Subnormal +dqmin538 min -0.001E-6143 0 -> -1E-6146 Subnormal +dqmin539 min -0.0009E-6143 0 -> -9E-6147 Subnormal +dqmin540 min -0.0001E-6143 0 -> -1E-6147 Subnormal + + +-- Null tests +dqmin900 min 10 # -> NaN Invalid_operation +dqmin901 min # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMinMag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMinMag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,293 @@ +------------------------------------------------------------------------ +-- dqMinMag.decTest -- decQuad minnummag -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqmng001 minmag -2 -2 -> -2 +dqmng002 minmag -2 -1 -> -1 +dqmng003 minmag -2 0 -> 0 +dqmng004 minmag -2 1 -> 1 +dqmng005 minmag -2 2 -> -2 +dqmng006 minmag -1 -2 -> -1 +dqmng007 minmag -1 -1 -> -1 +dqmng008 minmag -1 0 -> 0 +dqmng009 minmag -1 1 -> -1 +dqmng010 minmag -1 2 -> -1 +dqmng011 minmag 0 -2 -> 0 +dqmng012 minmag 0 -1 -> 0 +dqmng013 minmag 0 0 -> 0 +dqmng014 minmag 0 1 -> 0 +dqmng015 minmag 0 2 -> 0 +dqmng016 minmag 1 -2 -> 1 +dqmng017 minmag 1 -1 -> -1 +dqmng018 minmag 1 0 -> 0 +dqmng019 minmag 1 1 -> 1 +dqmng020 minmag 1 2 -> 1 +dqmng021 minmag 2 -2 -> -2 +dqmng022 minmag 2 -1 -> -1 +dqmng023 minmag 2 0 -> 0 +dqmng025 minmag 2 1 -> 1 +dqmng026 minmag 2 2 -> 2 + +-- extended zeros +dqmng030 minmag 0 0 -> 0 +dqmng031 minmag 0 -0 -> -0 +dqmng032 minmag 0 -0.0 -> -0.0 +dqmng033 minmag 0 0.0 -> 0.0 +dqmng034 minmag -0 0 -> -0 +dqmng035 minmag -0 -0 -> -0 +dqmng036 minmag -0 -0.0 -> -0 +dqmng037 minmag -0 0.0 -> -0 +dqmng038 minmag 0.0 0 -> 0.0 +dqmng039 minmag 0.0 -0 -> -0 +dqmng040 minmag 0.0 -0.0 -> -0.0 +dqmng041 minmag 0.0 0.0 -> 0.0 +dqmng042 minmag -0.0 0 -> -0.0 +dqmng043 minmag -0.0 -0 -> -0 +dqmng044 minmag -0.0 -0.0 -> -0.0 +dqmng045 minmag -0.0 0.0 -> -0.0 + +dqmng046 minmag 0E1 -0E1 -> -0E+1 +dqmng047 minmag -0E1 0E2 -> -0E+1 +dqmng048 minmag 0E2 0E1 -> 0E+1 +dqmng049 minmag 0E1 0E2 -> 0E+1 +dqmng050 minmag -0E3 -0E2 -> -0E+3 +dqmng051 minmag -0E2 -0E3 -> -0E+3 + +-- Specials +dqmng090 minmag Inf -Inf -> -Infinity +dqmng091 minmag Inf -1000 -> -1000 +dqmng092 minmag Inf -1 -> -1 +dqmng093 minmag Inf -0 -> -0 +dqmng094 minmag Inf 0 -> 0 +dqmng095 minmag Inf 1 -> 1 +dqmng096 minmag Inf 1000 -> 1000 +dqmng097 minmag Inf Inf -> Infinity +dqmng098 minmag -1000 Inf -> -1000 +dqmng099 minmag -Inf Inf -> -Infinity +dqmng100 minmag -1 Inf -> -1 +dqmng101 minmag -0 Inf -> -0 +dqmng102 minmag 0 Inf -> 0 +dqmng103 minmag 1 Inf -> 1 +dqmng104 minmag 1000 Inf -> 1000 +dqmng105 minmag Inf Inf -> Infinity + +dqmng120 minmag -Inf -Inf -> -Infinity +dqmng121 minmag -Inf -1000 -> -1000 +dqmng122 minmag -Inf -1 -> -1 +dqmng123 minmag -Inf -0 -> -0 +dqmng124 minmag -Inf 0 -> 0 +dqmng125 minmag -Inf 1 -> 1 +dqmng126 minmag -Inf 1000 -> 1000 +dqmng127 minmag -Inf Inf -> -Infinity +dqmng128 minmag -Inf -Inf -> -Infinity +dqmng129 minmag -1000 -Inf -> -1000 +dqmng130 minmag -1 -Inf -> -1 +dqmng131 minmag -0 -Inf -> -0 +dqmng132 minmag 0 -Inf -> 0 +dqmng133 minmag 1 -Inf -> 1 +dqmng134 minmag 1000 -Inf -> 1000 +dqmng135 minmag Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +dqmng141 minmag NaN -Inf -> -Infinity +dqmng142 minmag NaN -1000 -> -1000 +dqmng143 minmag NaN -1 -> -1 +dqmng144 minmag NaN -0 -> -0 +dqmng145 minmag NaN 0 -> 0 +dqmng146 minmag NaN 1 -> 1 +dqmng147 minmag NaN 1000 -> 1000 +dqmng148 minmag NaN Inf -> Infinity +dqmng149 minmag NaN NaN -> NaN +dqmng150 minmag -Inf NaN -> -Infinity +dqmng151 minmag -1000 NaN -> -1000 +dqmng152 minmag -1 -NaN -> -1 +dqmng153 minmag -0 NaN -> -0 +dqmng154 minmag 0 -NaN -> 0 +dqmng155 minmag 1 NaN -> 1 +dqmng156 minmag 1000 NaN -> 1000 +dqmng157 minmag Inf NaN -> Infinity + +dqmng161 minmag sNaN -Inf -> NaN Invalid_operation +dqmng162 minmag sNaN -1000 -> NaN Invalid_operation +dqmng163 minmag sNaN -1 -> NaN Invalid_operation +dqmng164 minmag sNaN -0 -> NaN Invalid_operation +dqmng165 minmag -sNaN 0 -> -NaN Invalid_operation +dqmng166 minmag -sNaN 1 -> -NaN Invalid_operation +dqmng167 minmag sNaN 1000 -> NaN Invalid_operation +dqmng168 minmag sNaN NaN -> NaN Invalid_operation +dqmng169 minmag sNaN sNaN -> NaN Invalid_operation +dqmng170 minmag NaN sNaN -> NaN Invalid_operation +dqmng171 minmag -Inf sNaN -> NaN Invalid_operation +dqmng172 minmag -1000 sNaN -> NaN Invalid_operation +dqmng173 minmag -1 sNaN -> NaN Invalid_operation +dqmng174 minmag -0 sNaN -> NaN Invalid_operation +dqmng175 minmag 0 sNaN -> NaN Invalid_operation +dqmng176 minmag 1 sNaN -> NaN Invalid_operation +dqmng177 minmag 1000 sNaN -> NaN Invalid_operation +dqmng178 minmag Inf sNaN -> NaN Invalid_operation +dqmng179 minmag NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqmng181 minmag NaN9 -Inf -> -Infinity +dqmng182 minmag -NaN8 9990 -> 9990 +dqmng183 minmag NaN71 Inf -> Infinity + +dqmng184 minmag NaN1 NaN54 -> NaN1 +dqmng185 minmag NaN22 -NaN53 -> NaN22 +dqmng186 minmag -NaN3 NaN6 -> -NaN3 +dqmng187 minmag -NaN44 NaN7 -> -NaN44 + +dqmng188 minmag -Inf NaN41 -> -Infinity +dqmng189 minmag -9999 -NaN33 -> -9999 +dqmng190 minmag Inf NaN2 -> Infinity + +dqmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation +dqmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation +dqmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation +dqmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation +dqmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation +dqmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation +dqmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation +dqmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation +dqmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation + +-- old rounding checks +dqmng221 minmag -12345678000 1 -> 1 +dqmng222 minmag 1 -12345678000 -> 1 +dqmng223 minmag -1234567800 1 -> 1 +dqmng224 minmag 1 -1234567800 -> 1 +dqmng225 minmag -1234567890 1 -> 1 +dqmng226 minmag 1 -1234567890 -> 1 +dqmng227 minmag -1234567891 1 -> 1 +dqmng228 minmag 1 -1234567891 -> 1 +dqmng229 minmag -12345678901 1 -> 1 +dqmng230 minmag 1 -12345678901 -> 1 +dqmng231 minmag -1234567896 1 -> 1 +dqmng232 minmag 1 -1234567896 -> 1 +dqmng233 minmag 1234567891 1 -> 1 +dqmng234 minmag 1 1234567891 -> 1 +dqmng235 minmag 12345678901 1 -> 1 +dqmng236 minmag 1 12345678901 -> 1 +dqmng237 minmag 1234567896 1 -> 1 +dqmng238 minmag 1 1234567896 -> 1 + +-- from examples +dqmng280 minmag '3' '2' -> '2' +dqmng281 minmag '-10' '3' -> '3' +dqmng282 minmag '1.0' '1' -> '1.0' +dqmng283 minmag '1' '1.0' -> '1.0' +dqmng284 minmag '7' 'NaN' -> '7' + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +dqmng401 minmag Inf 1.1 -> 1.1 +dqmng402 minmag 1.1 1 -> 1 +dqmng403 minmag 1 1.0 -> 1.0 +dqmng404 minmag 1.0 0.1 -> 0.1 +dqmng405 minmag 0.1 0.10 -> 0.10 +dqmng406 minmag 0.10 0.100 -> 0.100 +dqmng407 minmag 0.10 0 -> 0 +dqmng408 minmag 0 0.0 -> 0.0 +dqmng409 minmag 0.0 -0 -> -0 +dqmng410 minmag 0.0 -0.0 -> -0.0 +dqmng411 minmag 0.00 -0.0 -> -0.0 +dqmng412 minmag 0.0 -0.00 -> -0.00 +dqmng413 minmag 0 -0.0 -> -0.0 +dqmng414 minmag 0 -0 -> -0 +dqmng415 minmag -0.0 -0 -> -0 +dqmng416 minmag -0 -0.100 -> -0 +dqmng417 minmag -0.100 -0.10 -> -0.10 +dqmng418 minmag -0.10 -0.1 -> -0.1 +dqmng419 minmag -0.1 -1.0 -> -0.1 +dqmng420 minmag -1.0 -1 -> -1 +dqmng421 minmag -1 -1.1 -> -1 +dqmng423 minmag -1.1 -Inf -> -1.1 +-- same with operands reversed +dqmng431 minmag 1.1 Inf -> 1.1 +dqmng432 minmag 1 1.1 -> 1 +dqmng433 minmag 1.0 1 -> 1.0 +dqmng434 minmag 0.1 1.0 -> 0.1 +dqmng435 minmag 0.10 0.1 -> 0.10 +dqmng436 minmag 0.100 0.10 -> 0.100 +dqmng437 minmag 0 0.10 -> 0 +dqmng438 minmag 0.0 0 -> 0.0 +dqmng439 minmag -0 0.0 -> -0 +dqmng440 minmag -0.0 0.0 -> -0.0 +dqmng441 minmag -0.0 0.00 -> -0.0 +dqmng442 minmag -0.00 0.0 -> -0.00 +dqmng443 minmag -0.0 0 -> -0.0 +dqmng444 minmag -0 0 -> -0 +dqmng445 minmag -0 -0.0 -> -0 +dqmng446 minmag -0.100 -0 -> -0 +dqmng447 minmag -0.10 -0.100 -> -0.10 +dqmng448 minmag -0.1 -0.10 -> -0.1 +dqmng449 minmag -1.0 -0.1 -> -0.1 +dqmng450 minmag -1 -1.0 -> -1 +dqmng451 minmag -1.1 -1 -> -1 +dqmng453 minmag -Inf -1.1 -> -1.1 +-- largies +dqmng460 minmag 1000 1E+3 -> 1000 +dqmng461 minmag 1E+3 1000 -> 1000 +dqmng462 minmag 1000 -1E+3 -> -1E+3 +dqmng463 minmag 1E+3 -384 -> -384 +dqmng464 minmag -384 1E+3 -> -384 +dqmng465 minmag -1E+3 1000 -> -1E+3 +dqmng466 minmag -384 -1E+3 -> -384 +dqmng467 minmag -1E+3 -384 -> -384 + +-- subnormals +dqmng510 minmag 1.00E-6143 0 -> 0 +dqmng511 minmag 0.1E-6143 0 -> 0 +dqmng512 minmag 0.10E-6143 0 -> 0 +dqmng513 minmag 0.100E-6143 0 -> 0 +dqmng514 minmag 0.01E-6143 0 -> 0 +dqmng515 minmag 0.999E-6143 0 -> 0 +dqmng516 minmag 0.099E-6143 0 -> 0 +dqmng517 minmag 0.009E-6143 0 -> 0 +dqmng518 minmag 0.001E-6143 0 -> 0 +dqmng519 minmag 0.0009E-6143 0 -> 0 +dqmng520 minmag 0.0001E-6143 0 -> 0 + +dqmng530 minmag -1.00E-6143 0 -> 0 +dqmng531 minmag -0.1E-6143 0 -> 0 +dqmng532 minmag -0.10E-6143 0 -> 0 +dqmng533 minmag -0.100E-6143 0 -> 0 +dqmng534 minmag -0.01E-6143 0 -> 0 +dqmng535 minmag -0.999E-6143 0 -> 0 +dqmng536 minmag -0.099E-6143 0 -> 0 +dqmng537 minmag -0.009E-6143 0 -> 0 +dqmng538 minmag -0.001E-6143 0 -> 0 +dqmng539 minmag -0.0009E-6143 0 -> 0 +dqmng540 minmag -0.0001E-6143 0 -> 0 + + +-- Null tests +dqmng900 minmag 10 # -> NaN Invalid_operation +dqmng901 minmag # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMinus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMinus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- dqMinus.decTest -- decQuad 0-x -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqmns001 minus +7.50 -> -7.50 + +-- Infinities +dqmns011 minus Infinity -> -Infinity +dqmns012 minus -Infinity -> Infinity + +-- NaNs, 0 payload +dqmns021 minus NaN -> NaN +dqmns022 minus -NaN -> -NaN +dqmns023 minus sNaN -> NaN Invalid_operation +dqmns024 minus -sNaN -> -NaN Invalid_operation + +-- NaNs, non-0 payload +dqmns031 minus NaN13 -> NaN13 +dqmns032 minus -NaN13 -> -NaN13 +dqmns033 minus sNaN13 -> NaN13 Invalid_operation +dqmns034 minus -sNaN13 -> -NaN13 Invalid_operation +dqmns035 minus NaN70 -> NaN70 +dqmns036 minus -NaN70 -> -NaN70 +dqmns037 minus sNaN101 -> NaN101 Invalid_operation +dqmns038 minus -sNaN101 -> -NaN101 Invalid_operation + +-- finites +dqmns101 minus 7 -> -7 +dqmns102 minus -7 -> 7 +dqmns103 minus 75 -> -75 +dqmns104 minus -75 -> 75 +dqmns105 minus 7.50 -> -7.50 +dqmns106 minus -7.50 -> 7.50 +dqmns107 minus 7.500 -> -7.500 +dqmns108 minus -7.500 -> 7.500 + +-- zeros +dqmns111 minus 0 -> 0 +dqmns112 minus -0 -> 0 +dqmns113 minus 0E+4 -> 0E+4 +dqmns114 minus -0E+4 -> 0E+4 +dqmns115 minus 0.0000 -> 0.0000 +dqmns116 minus -0.0000 -> 0.0000 +dqmns117 minus 0E-141 -> 0E-141 +dqmns118 minus -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +dqmns121 minus 2682682682682682682682682682682682 -> -2682682682682682682682682682682682 +dqmns122 minus -2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqmns123 minus 1341341341341341341341341341341341 -> -1341341341341341341341341341341341 +dqmns124 minus -1341341341341341341341341341341341 -> 1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqmns131 minus 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 +dqmns132 minus 1E-6143 -> -1E-6143 +dqmns133 minus 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143 +dqmns134 minus 1E-6176 -> -1E-6176 Subnormal + +dqmns135 minus -1E-6176 -> 1E-6176 Subnormal +dqmns136 minus -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqmns137 minus -1E-6143 -> 1E-6143 +dqmns138 minus -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMultiply.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqMultiply.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,589 @@ +------------------------------------------------------------------------ +-- dqMultiply.decTest -- decQuad multiplication -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests are for decQuads only; all arguments are +-- representable in a decQuad +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqmul000 multiply 2 2 -> 4 +dqmul001 multiply 2 3 -> 6 +dqmul002 multiply 5 1 -> 5 +dqmul003 multiply 5 2 -> 10 +dqmul004 multiply 1.20 2 -> 2.40 +dqmul005 multiply 1.20 0 -> 0.00 +dqmul006 multiply 1.20 -2 -> -2.40 +dqmul007 multiply -1.20 2 -> -2.40 +dqmul008 multiply -1.20 0 -> -0.00 +dqmul009 multiply -1.20 -2 -> 2.40 +dqmul010 multiply 5.09 7.1 -> 36.139 +dqmul011 multiply 2.5 4 -> 10.0 +dqmul012 multiply 2.50 4 -> 10.00 +dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded +dqmul015 multiply 2.50 4 -> 10.00 +dqmul016 multiply 9.99999999999999999 9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded +dqmul017 multiply 9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded +dqmul018 multiply -9.99999999999999999 9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded +dqmul019 multiply -9.99999999999999999 -9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded + +-- zeros, etc. +dqmul021 multiply 0 0 -> 0 +dqmul022 multiply 0 -0 -> -0 +dqmul023 multiply -0 0 -> -0 +dqmul024 multiply -0 -0 -> 0 +dqmul025 multiply -0.0 -0.0 -> 0.00 +dqmul026 multiply -0.0 -0.0 -> 0.00 +dqmul027 multiply -0.0 -0.0 -> 0.00 +dqmul028 multiply -0.0 -0.0 -> 0.00 +dqmul030 multiply 5.00 1E-3 -> 0.00500 +dqmul031 multiply 00.00 0.000 -> 0.00000 +dqmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0 +dqmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0 +dqmul034 multiply -5.00 1E-3 -> -0.00500 +dqmul035 multiply -00.00 0.000 -> -0.00000 +dqmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0 +dqmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0 +dqmul038 multiply 5.00 -1E-3 -> -0.00500 +dqmul039 multiply 00.00 -0.000 -> -0.00000 +dqmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0 +dqmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0 +dqmul042 multiply -5.00 -1E-3 -> 0.00500 +dqmul043 multiply -00.00 -0.000 -> 0.00000 +dqmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0 +dqmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0 + +-- examples from decarith +dqmul050 multiply 1.20 3 -> 3.60 +dqmul051 multiply 7 3 -> 21 +dqmul052 multiply 0.9 0.8 -> 0.72 +dqmul053 multiply 0.9 -0 -> -0.0 +dqmul054 multiply 654321 654321 -> 428135971041 + +dqmul060 multiply 123.45 1e7 -> 1.2345E+9 +dqmul061 multiply 123.45 1e8 -> 1.2345E+10 +dqmul062 multiply 123.45 1e+9 -> 1.2345E+11 +dqmul063 multiply 123.45 1e10 -> 1.2345E+12 +dqmul064 multiply 123.45 1e11 -> 1.2345E+13 +dqmul065 multiply 123.45 1e12 -> 1.2345E+14 +dqmul066 multiply 123.45 1e13 -> 1.2345E+15 + + +-- test some intermediate lengths +-- 1234567890123456 +dqmul080 multiply 0.1 1230123456456789 -> 123012345645678.9 +dqmul084 multiply 0.1 1230123456456789 -> 123012345645678.9 +dqmul090 multiply 1230123456456789 0.1 -> 123012345645678.9 +dqmul094 multiply 1230123456456789 0.1 -> 123012345645678.9 + +-- test some more edge cases and carries +dqmul101 multiply 9 9 -> 81 +dqmul102 multiply 9 90 -> 810 +dqmul103 multiply 9 900 -> 8100 +dqmul104 multiply 9 9000 -> 81000 +dqmul105 multiply 9 90000 -> 810000 +dqmul106 multiply 9 900000 -> 8100000 +dqmul107 multiply 9 9000000 -> 81000000 +dqmul108 multiply 9 90000000 -> 810000000 +dqmul109 multiply 9 900000000 -> 8100000000 +dqmul110 multiply 9 9000000000 -> 81000000000 +dqmul111 multiply 9 90000000000 -> 810000000000 +dqmul112 multiply 9 900000000000 -> 8100000000000 +dqmul113 multiply 9 9000000000000 -> 81000000000000 +dqmul114 multiply 9 90000000000000 -> 810000000000000 +dqmul115 multiply 9 900000000000000 -> 8100000000000000 +--dqmul116 multiply 9 9000000000000000 -> 81000000000000000 +--dqmul117 multiply 9 90000000000000000 -> 810000000000000000 +--dqmul118 multiply 9 900000000000000000 -> 8100000000000000000 +--dqmul119 multiply 9 9000000000000000000 -> 81000000000000000000 +--dqmul120 multiply 9 90000000000000000000 -> 810000000000000000000 +--dqmul121 multiply 9 900000000000000000000 -> 8100000000000000000000 +--dqmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000 +--dqmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000 +-- test some more edge cases without carries +dqmul131 multiply 3 3 -> 9 +dqmul132 multiply 3 30 -> 90 +dqmul133 multiply 3 300 -> 900 +dqmul134 multiply 3 3000 -> 9000 +dqmul135 multiply 3 30000 -> 90000 +dqmul136 multiply 3 300000 -> 900000 +dqmul137 multiply 3 3000000 -> 9000000 +dqmul138 multiply 3 30000000 -> 90000000 +dqmul139 multiply 3 300000000 -> 900000000 +dqmul140 multiply 3 3000000000 -> 9000000000 +dqmul141 multiply 3 30000000000 -> 90000000000 +dqmul142 multiply 3 300000000000 -> 900000000000 +dqmul143 multiply 3 3000000000000 -> 9000000000000 +dqmul144 multiply 3 30000000000000 -> 90000000000000 +dqmul145 multiply 3 300000000000000 -> 900000000000000 +dqmul146 multiply 3 3000000000000000 -> 9000000000000000 +dqmul147 multiply 3 30000000000000000 -> 90000000000000000 +dqmul148 multiply 3 300000000000000000 -> 900000000000000000 +dqmul149 multiply 3 3000000000000000000 -> 9000000000000000000 +dqmul150 multiply 3 30000000000000000000 -> 90000000000000000000 +dqmul151 multiply 3 300000000000000000000 -> 900000000000000000000 +dqmul152 multiply 3 3000000000000000000000 -> 9000000000000000000000 +dqmul153 multiply 3 30000000000000000000000 -> 90000000000000000000000 + +dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded + +-- test some edge cases with exact rounding +dqmul301 multiply 900000000000000000 9 -> 8100000000000000000 +dqmul302 multiply 900000000000000000 90 -> 81000000000000000000 +dqmul303 multiply 900000000000000000 900 -> 810000000000000000000 +dqmul304 multiply 900000000000000000 9000 -> 8100000000000000000000 +dqmul305 multiply 900000000000000000 90000 -> 81000000000000000000000 +dqmul306 multiply 900000000000000000 900000 -> 810000000000000000000000 +dqmul307 multiply 900000000000000000 9000000 -> 8100000000000000000000000 +dqmul308 multiply 900000000000000000 90000000 -> 81000000000000000000000000 +dqmul309 multiply 900000000000000000 900000000 -> 810000000000000000000000000 +dqmul310 multiply 900000000000000000 9000000000 -> 8100000000000000000000000000 +dqmul311 multiply 900000000000000000 90000000000 -> 81000000000000000000000000000 +dqmul312 multiply 900000000000000000 900000000000 -> 810000000000000000000000000000 +dqmul313 multiply 900000000000000000 9000000000000 -> 8100000000000000000000000000000 +dqmul314 multiply 900000000000000000 90000000000000 -> 81000000000000000000000000000000 +dqmul315 multiply 900000000000000000 900000000000000 -> 810000000000000000000000000000000 +dqmul316 multiply 900000000000000000 9000000000000000 -> 8100000000000000000000000000000000 +dqmul317 multiply 9000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+34 Rounded +dqmul318 multiply 90000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+35 Rounded +dqmul319 multiply 900000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+36 Rounded +dqmul320 multiply 9000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+37 Rounded +dqmul321 multiply 90000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+38 Rounded +dqmul322 multiply 900000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+39 Rounded +dqmul323 multiply 9000000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+40 Rounded + +-- tryzeros cases +dqmul504 multiply 0E-4260 1000E-4260 -> 0E-6176 Clamped +dqmul505 multiply 100E+4260 0E+4260 -> 0E+6111 Clamped + +-- mixed with zeros +dqmul541 multiply 0 -1 -> -0 +dqmul542 multiply -0 -1 -> 0 +dqmul543 multiply 0 1 -> 0 +dqmul544 multiply -0 1 -> -0 +dqmul545 multiply -1 0 -> -0 +dqmul546 multiply -1 -0 -> 0 +dqmul547 multiply 1 0 -> 0 +dqmul548 multiply 1 -0 -> -0 + +dqmul551 multiply 0.0 -1 -> -0.0 +dqmul552 multiply -0.0 -1 -> 0.0 +dqmul553 multiply 0.0 1 -> 0.0 +dqmul554 multiply -0.0 1 -> -0.0 +dqmul555 multiply -1.0 0 -> -0.0 +dqmul556 multiply -1.0 -0 -> 0.0 +dqmul557 multiply 1.0 0 -> 0.0 +dqmul558 multiply 1.0 -0 -> -0.0 + +dqmul561 multiply 0 -1.0 -> -0.0 +dqmul562 multiply -0 -1.0 -> 0.0 +dqmul563 multiply 0 1.0 -> 0.0 +dqmul564 multiply -0 1.0 -> -0.0 +dqmul565 multiply -1 0.0 -> -0.0 +dqmul566 multiply -1 -0.0 -> 0.0 +dqmul567 multiply 1 0.0 -> 0.0 +dqmul568 multiply 1 -0.0 -> -0.0 + +dqmul571 multiply 0.0 -1.0 -> -0.00 +dqmul572 multiply -0.0 -1.0 -> 0.00 +dqmul573 multiply 0.0 1.0 -> 0.00 +dqmul574 multiply -0.0 1.0 -> -0.00 +dqmul575 multiply -1.0 0.0 -> -0.00 +dqmul576 multiply -1.0 -0.0 -> 0.00 +dqmul577 multiply 1.0 0.0 -> 0.00 +dqmul578 multiply 1.0 -0.0 -> -0.00 + + +-- Specials +dqmul580 multiply Inf -Inf -> -Infinity +dqmul581 multiply Inf -1000 -> -Infinity +dqmul582 multiply Inf -1 -> -Infinity +dqmul583 multiply Inf -0 -> NaN Invalid_operation +dqmul584 multiply Inf 0 -> NaN Invalid_operation +dqmul585 multiply Inf 1 -> Infinity +dqmul586 multiply Inf 1000 -> Infinity +dqmul587 multiply Inf Inf -> Infinity +dqmul588 multiply -1000 Inf -> -Infinity +dqmul589 multiply -Inf Inf -> -Infinity +dqmul590 multiply -1 Inf -> -Infinity +dqmul591 multiply -0 Inf -> NaN Invalid_operation +dqmul592 multiply 0 Inf -> NaN Invalid_operation +dqmul593 multiply 1 Inf -> Infinity +dqmul594 multiply 1000 Inf -> Infinity +dqmul595 multiply Inf Inf -> Infinity + +dqmul600 multiply -Inf -Inf -> Infinity +dqmul601 multiply -Inf -1000 -> Infinity +dqmul602 multiply -Inf -1 -> Infinity +dqmul603 multiply -Inf -0 -> NaN Invalid_operation +dqmul604 multiply -Inf 0 -> NaN Invalid_operation +dqmul605 multiply -Inf 1 -> -Infinity +dqmul606 multiply -Inf 1000 -> -Infinity +dqmul607 multiply -Inf Inf -> -Infinity +dqmul608 multiply -1000 Inf -> -Infinity +dqmul609 multiply -Inf -Inf -> Infinity +dqmul610 multiply -1 -Inf -> Infinity +dqmul611 multiply -0 -Inf -> NaN Invalid_operation +dqmul612 multiply 0 -Inf -> NaN Invalid_operation +dqmul613 multiply 1 -Inf -> -Infinity +dqmul614 multiply 1000 -Inf -> -Infinity +dqmul615 multiply Inf -Inf -> -Infinity + +dqmul621 multiply NaN -Inf -> NaN +dqmul622 multiply NaN -1000 -> NaN +dqmul623 multiply NaN -1 -> NaN +dqmul624 multiply NaN -0 -> NaN +dqmul625 multiply NaN 0 -> NaN +dqmul626 multiply NaN 1 -> NaN +dqmul627 multiply NaN 1000 -> NaN +dqmul628 multiply NaN Inf -> NaN +dqmul629 multiply NaN NaN -> NaN +dqmul630 multiply -Inf NaN -> NaN +dqmul631 multiply -1000 NaN -> NaN +dqmul632 multiply -1 NaN -> NaN +dqmul633 multiply -0 NaN -> NaN +dqmul634 multiply 0 NaN -> NaN +dqmul635 multiply 1 NaN -> NaN +dqmul636 multiply 1000 NaN -> NaN +dqmul637 multiply Inf NaN -> NaN + +dqmul641 multiply sNaN -Inf -> NaN Invalid_operation +dqmul642 multiply sNaN -1000 -> NaN Invalid_operation +dqmul643 multiply sNaN -1 -> NaN Invalid_operation +dqmul644 multiply sNaN -0 -> NaN Invalid_operation +dqmul645 multiply sNaN 0 -> NaN Invalid_operation +dqmul646 multiply sNaN 1 -> NaN Invalid_operation +dqmul647 multiply sNaN 1000 -> NaN Invalid_operation +dqmul648 multiply sNaN NaN -> NaN Invalid_operation +dqmul649 multiply sNaN sNaN -> NaN Invalid_operation +dqmul650 multiply NaN sNaN -> NaN Invalid_operation +dqmul651 multiply -Inf sNaN -> NaN Invalid_operation +dqmul652 multiply -1000 sNaN -> NaN Invalid_operation +dqmul653 multiply -1 sNaN -> NaN Invalid_operation +dqmul654 multiply -0 sNaN -> NaN Invalid_operation +dqmul655 multiply 0 sNaN -> NaN Invalid_operation +dqmul656 multiply 1 sNaN -> NaN Invalid_operation +dqmul657 multiply 1000 sNaN -> NaN Invalid_operation +dqmul658 multiply Inf sNaN -> NaN Invalid_operation +dqmul659 multiply NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqmul661 multiply NaN9 -Inf -> NaN9 +dqmul662 multiply NaN8 999 -> NaN8 +dqmul663 multiply NaN71 Inf -> NaN71 +dqmul664 multiply NaN6 NaN5 -> NaN6 +dqmul665 multiply -Inf NaN4 -> NaN4 +dqmul666 multiply -999 NaN33 -> NaN33 +dqmul667 multiply Inf NaN2 -> NaN2 + +dqmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation +dqmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation +dqmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation +dqmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation +dqmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation +dqmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation +dqmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation +dqmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation +dqmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation + +dqmul681 multiply -NaN9 -Inf -> -NaN9 +dqmul682 multiply -NaN8 999 -> -NaN8 +dqmul683 multiply -NaN71 Inf -> -NaN71 +dqmul684 multiply -NaN6 -NaN5 -> -NaN6 +dqmul685 multiply -Inf -NaN4 -> -NaN4 +dqmul686 multiply -999 -NaN33 -> -NaN33 +dqmul687 multiply Inf -NaN2 -> -NaN2 + +dqmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation +dqmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation +dqmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation +dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation +dqmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation +dqmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation +dqmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation +dqmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation +dqmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation + +dqmul701 multiply -NaN -Inf -> -NaN +dqmul702 multiply -NaN 999 -> -NaN +dqmul703 multiply -NaN Inf -> -NaN +dqmul704 multiply -NaN -NaN -> -NaN +dqmul705 multiply -Inf -NaN0 -> -NaN +dqmul706 multiply -999 -NaN -> -NaN +dqmul707 multiply Inf -NaN -> -NaN + +dqmul711 multiply -sNaN -Inf -> -NaN Invalid_operation +dqmul712 multiply -sNaN -11 -> -NaN Invalid_operation +dqmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation +dqmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation +dqmul715 multiply -NaN -sNaN -> -NaN Invalid_operation +dqmul716 multiply -Inf -sNaN -> -NaN Invalid_operation +dqmul717 multiply 088 -sNaN -> -NaN Invalid_operation +dqmul718 multiply Inf -sNaN -> -NaN Invalid_operation +dqmul719 multiply -NaN -sNaN -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +-- signs +dqmul751 multiply 1e+4277 1e+3311 -> Infinity Overflow Inexact Rounded +dqmul752 multiply 1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded +dqmul753 multiply -1e+4277 1e+3311 -> -Infinity Overflow Inexact Rounded +dqmul754 multiply -1e+4277 -1e+3311 -> Infinity Overflow Inexact Rounded +dqmul755 multiply 1e-4277 1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul756 multiply 1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul757 multiply -1e-4277 1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul758 multiply -1e-4277 -1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal +dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal +dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal +dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal +dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal +dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal +dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal +dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped +dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142 Clamped +dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143 Clamped +dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144 Clamped +dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded +dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded +dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded +dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded +dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded +dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded + +dqmul801 multiply 1.0000E-6172 1 -> 1.0000E-6172 Subnormal +dqmul802 multiply 1.000E-6172 1e-1 -> 1.000E-6173 Subnormal +dqmul803 multiply 1.00E-6172 1e-2 -> 1.00E-6174 Subnormal +dqmul804 multiply 1.0E-6172 1e-3 -> 1.0E-6175 Subnormal +dqmul805 multiply 1.0E-6172 1e-4 -> 1E-6176 Subnormal Rounded +dqmul806 multiply 1.3E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqmul807 multiply 1.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul808 multiply 1.7E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul809 multiply 2.3E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul810 multiply 2.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul811 multiply 2.7E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded +dqmul812 multiply 1.49E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqmul813 multiply 1.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul814 multiply 1.51E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul815 multiply 2.49E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul816 multiply 2.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded +dqmul817 multiply 2.51E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded + +dqmul818 multiply 1E-6172 1e-4 -> 1E-6176 Subnormal +dqmul819 multiply 3E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul820 multiply 5E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul821 multiply 7E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqmul822 multiply 9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqmul823 multiply 9.9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded + +dqmul824 multiply 1E-6172 -1e-4 -> -1E-6176 Subnormal +dqmul825 multiply 3E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul826 multiply -5E-6172 1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul827 multiply 7E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqmul828 multiply -9E-6172 1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqmul829 multiply 9.9E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqmul830 multiply 3.0E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped + +dqmul831 multiply 1.0E-5977 1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqmul832 multiply 1.0E-5977 1e-199 -> 1E-6176 Subnormal Rounded +dqmul833 multiply 1.0E-5977 1e-198 -> 1.0E-6175 Subnormal +dqmul834 multiply 2.0E-5977 2e-198 -> 4.0E-6175 Subnormal +dqmul835 multiply 4.0E-5977 4e-198 -> 1.60E-6174 Subnormal +dqmul836 multiply 10.0E-5977 10e-198 -> 1.000E-6173 Subnormal +dqmul837 multiply 30.0E-5977 30e-198 -> 9.000E-6173 Subnormal +dqmul838 multiply 40.0E-5982 40e-166 -> 1.6000E-6145 Subnormal +dqmul839 multiply 40.0E-5982 40e-165 -> 1.6000E-6144 Subnormal +dqmul840 multiply 40.0E-5982 40e-164 -> 1.6000E-6143 + +-- Long operand overflow may be a different path +dqmul870 multiply 100 9.999E+6143 -> Infinity Inexact Overflow Rounded +dqmul871 multiply 100 -9.999E+6143 -> -Infinity Inexact Overflow Rounded +dqmul872 multiply 9.999E+6143 100 -> Infinity Inexact Overflow Rounded +dqmul873 multiply -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +dqmul881 multiply 1.2347E-6133 1.2347E-40 -> 1.524E-6173 Inexact Rounded Subnormal Underflow +dqmul882 multiply 1.234E-6133 1.234E-40 -> 1.523E-6173 Inexact Rounded Subnormal Underflow +dqmul883 multiply 1.23E-6133 1.23E-40 -> 1.513E-6173 Inexact Rounded Subnormal Underflow +dqmul884 multiply 1.2E-6133 1.2E-40 -> 1.44E-6173 Subnormal +dqmul885 multiply 1.2E-6133 1.2E-41 -> 1.44E-6174 Subnormal +dqmul886 multiply 1.2E-6133 1.2E-42 -> 1.4E-6175 Subnormal Inexact Rounded Underflow +dqmul887 multiply 1.2E-6133 1.3E-42 -> 1.6E-6175 Subnormal Inexact Rounded Underflow +dqmul888 multiply 1.3E-6133 1.3E-42 -> 1.7E-6175 Subnormal Inexact Rounded Underflow +dqmul889 multiply 1.3E-6133 1.3E-43 -> 2E-6176 Subnormal Inexact Rounded Underflow +dqmul890 multiply 1.3E-6134 1.3E-43 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow + +dqmul891 multiply 1.2345E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow +dqmul892 multiply 1.23456E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow +dqmul893 multiply 1.2345E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow +dqmul894 multiply 1.23456E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow +dqmul895 multiply 1.2345E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow +dqmul896 multiply 1.23456E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +-- prove operands are exact +dqmul906 multiply 9.999999999999999999999999999999999E-6143 1 -> 9.999999999999999999999999999999999E-6143 +dqmul907 multiply 1 0.09999999999999999999999999999999999 -> 0.09999999999999999999999999999999999 +-- the next rounds to Nmin +dqmul908 multiply 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded + +-- hugest +dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded +-- VG case +dqmul910 multiply 8.81125000000001349436E-1548 8.000000000000000000E-1550 -> 7.049000000000010795488000000000000E-3097 Rounded + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +dqmul911 multiply 130E-2 120E-2 -> 1.5600 +dqmul912 multiply 130E-2 12E-1 -> 1.560 +dqmul913 multiply 130E-2 1E0 -> 1.30 +dqmul914 multiply 1E2 1E4 -> 1E+6 + +-- power-of-ten edge cases +dqmul1001 multiply 1 10 -> 10 +dqmul1002 multiply 1 100 -> 100 +dqmul1003 multiply 1 1000 -> 1000 +dqmul1004 multiply 1 10000 -> 10000 +dqmul1005 multiply 1 100000 -> 100000 +dqmul1006 multiply 1 1000000 -> 1000000 +dqmul1007 multiply 1 10000000 -> 10000000 +dqmul1008 multiply 1 100000000 -> 100000000 +dqmul1009 multiply 1 1000000000 -> 1000000000 +dqmul1010 multiply 1 10000000000 -> 10000000000 +dqmul1011 multiply 1 100000000000 -> 100000000000 +dqmul1012 multiply 1 1000000000000 -> 1000000000000 +dqmul1013 multiply 1 10000000000000 -> 10000000000000 +dqmul1014 multiply 1 100000000000000 -> 100000000000000 +dqmul1015 multiply 1 1000000000000000 -> 1000000000000000 + +dqmul1016 multiply 1 1000000000000000000 -> 1000000000000000000 +dqmul1017 multiply 1 100000000000000000000000000 -> 100000000000000000000000000 +dqmul1018 multiply 1 1000000000000000000000000000 -> 1000000000000000000000000000 +dqmul1019 multiply 1 10000000000000000000000000000 -> 10000000000000000000000000000 +dqmul1020 multiply 1 1000000000000000000000000000000000 -> 1000000000000000000000000000000000 + +dqmul1021 multiply 10 1 -> 10 +dqmul1022 multiply 10 10 -> 100 +dqmul1023 multiply 10 100 -> 1000 +dqmul1024 multiply 10 1000 -> 10000 +dqmul1025 multiply 10 10000 -> 100000 +dqmul1026 multiply 10 100000 -> 1000000 +dqmul1027 multiply 10 1000000 -> 10000000 +dqmul1028 multiply 10 10000000 -> 100000000 +dqmul1029 multiply 10 100000000 -> 1000000000 +dqmul1030 multiply 10 1000000000 -> 10000000000 +dqmul1031 multiply 10 10000000000 -> 100000000000 +dqmul1032 multiply 10 100000000000 -> 1000000000000 +dqmul1033 multiply 10 1000000000000 -> 10000000000000 +dqmul1034 multiply 10 10000000000000 -> 100000000000000 +dqmul1035 multiply 10 100000000000000 -> 1000000000000000 + +dqmul1036 multiply 10 100000000000000000 -> 1000000000000000000 +dqmul1037 multiply 10 10000000000000000000000000 -> 100000000000000000000000000 +dqmul1038 multiply 10 100000000000000000000000000 -> 1000000000000000000000000000 +dqmul1039 multiply 10 1000000000000000000000000000 -> 10000000000000000000000000000 +dqmul1040 multiply 10 100000000000000000000000000000000 -> 1000000000000000000000000000000000 + +dqmul1041 multiply 100 0.1 -> 10.0 +dqmul1042 multiply 100 1 -> 100 +dqmul1043 multiply 100 10 -> 1000 +dqmul1044 multiply 100 100 -> 10000 +dqmul1045 multiply 100 1000 -> 100000 +dqmul1046 multiply 100 10000 -> 1000000 +dqmul1047 multiply 100 100000 -> 10000000 +dqmul1048 multiply 100 1000000 -> 100000000 +dqmul1049 multiply 100 10000000 -> 1000000000 +dqmul1050 multiply 100 100000000 -> 10000000000 +dqmul1051 multiply 100 1000000000 -> 100000000000 +dqmul1052 multiply 100 10000000000 -> 1000000000000 +dqmul1053 multiply 100 100000000000 -> 10000000000000 +dqmul1054 multiply 100 1000000000000 -> 100000000000000 +dqmul1055 multiply 100 10000000000000 -> 1000000000000000 + +dqmul1056 multiply 100 10000000000000000 -> 1000000000000000000 +dqmul1057 multiply 100 1000000000000000000000000 -> 100000000000000000000000000 +dqmul1058 multiply 100 10000000000000000000000000 -> 1000000000000000000000000000 +dqmul1059 multiply 100 100000000000000000000000000 -> 10000000000000000000000000000 +dqmul1060 multiply 100 10000000000000000000000000000000 -> 1000000000000000000000000000000000 + +dqmul1061 multiply 1000 0.01 -> 10.00 +dqmul1062 multiply 1000 0.1 -> 100.0 +dqmul1063 multiply 1000 1 -> 1000 +dqmul1064 multiply 1000 10 -> 10000 +dqmul1065 multiply 1000 100 -> 100000 +dqmul1066 multiply 1000 1000 -> 1000000 +dqmul1067 multiply 1000 10000 -> 10000000 +dqmul1068 multiply 1000 100000 -> 100000000 +dqmul1069 multiply 1000 1000000 -> 1000000000 +dqmul1070 multiply 1000 10000000 -> 10000000000 +dqmul1071 multiply 1000 100000000 -> 100000000000 +dqmul1072 multiply 1000 1000000000 -> 1000000000000 +dqmul1073 multiply 1000 10000000000 -> 10000000000000 +dqmul1074 multiply 1000 100000000000 -> 100000000000000 +dqmul1075 multiply 1000 1000000000000 -> 1000000000000000 + +dqmul1076 multiply 1000 1000000000000000 -> 1000000000000000000 +dqmul1077 multiply 1000 100000000000000000000000 -> 100000000000000000000000000 +dqmul1078 multiply 1000 1000000000000000000000000 -> 1000000000000000000000000000 +dqmul1079 multiply 1000 10000000000000000000000000 -> 10000000000000000000000000000 +dqmul1080 multiply 1000 1000000000000000000000000000000 -> 1000000000000000000000000000000000 + +dqmul1081 multiply 10000 0.001 -> 10.000 +dqmul1082 multiply 10000 0.01 -> 100.00 +dqmul1083 multiply 10000 0.1 -> 1000.0 +dqmul1084 multiply 10000 1 -> 10000 +dqmul1085 multiply 10000 10 -> 100000 +dqmul1086 multiply 10000 100 -> 1000000 +dqmul1087 multiply 10000 1000 -> 10000000 +dqmul1088 multiply 10000 10000 -> 100000000 +dqmul1089 multiply 10000 100000 -> 1000000000 +dqmul1090 multiply 10000 1000000 -> 10000000000 +dqmul1091 multiply 10000 10000000 -> 100000000000 +dqmul1092 multiply 10000 100000000 -> 1000000000000 +dqmul1093 multiply 10000 1000000000 -> 10000000000000 +dqmul1094 multiply 10000 10000000000 -> 100000000000000 +dqmul1095 multiply 10000 100000000000 -> 1000000000000000 + +dqmul1096 multiply 10000 100000000000000 -> 1000000000000000000 +dqmul1097 multiply 10000 10000000000000000000000 -> 100000000000000000000000000 +dqmul1098 multiply 10000 100000000000000000000000 -> 1000000000000000000000000000 +dqmul1099 multiply 10000 1000000000000000000000000 -> 10000000000000000000000000000 +dqmul1100 multiply 10000 100000000000000000000000000000 -> 1000000000000000000000000000000000 + +dqmul1107 multiply 10000 99999999999 -> 999999999990000 +dqmul1108 multiply 10000 99999999999 -> 999999999990000 + +-- Null tests +dqmul9990 multiply 10 # -> NaN Invalid_operation +dqmul9991 multiply # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextMinus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextMinus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,126 @@ +------------------------------------------------------------------------ +-- dqNextMinus.decTest -- decQuad next that is less [754r nextdown] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqnextm001 nextminus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999994 +dqnextm002 nextminus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999995 +dqnextm003 nextminus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999996 +dqnextm004 nextminus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999997 +dqnextm005 nextminus 0.9999999999999999999999999999999999 -> 0.9999999999999999999999999999999998 +dqnextm006 nextminus 1.000000000000000000000000000000000 -> 0.9999999999999999999999999999999999 +dqnextm007 nextminus 1.0 -> 0.9999999999999999999999999999999999 +dqnextm008 nextminus 1 -> 0.9999999999999999999999999999999999 +dqnextm009 nextminus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000000 +dqnextm010 nextminus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000001 +dqnextm011 nextminus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000002 +dqnextm012 nextminus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000003 +dqnextm013 nextminus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000004 +dqnextm014 nextminus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000005 +dqnextm015 nextminus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000006 +dqnextm016 nextminus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000007 +dqnextm017 nextminus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000008 +dqnextm018 nextminus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000009 +dqnextm019 nextminus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000010 +dqnextm020 nextminus 1.000000000000000000000000000000012 -> 1.000000000000000000000000000000011 + +dqnextm021 nextminus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999996 +dqnextm022 nextminus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999997 +dqnextm023 nextminus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999998 +dqnextm024 nextminus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999999 +dqnextm025 nextminus -0.9999999999999999999999999999999999 -> -1.000000000000000000000000000000000 +dqnextm026 nextminus -1.000000000000000000000000000000000 -> -1.000000000000000000000000000000001 +dqnextm027 nextminus -1.0 -> -1.000000000000000000000000000000001 +dqnextm028 nextminus -1 -> -1.000000000000000000000000000000001 +dqnextm029 nextminus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000002 +dqnextm030 nextminus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000003 +dqnextm031 nextminus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000004 +dqnextm032 nextminus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000005 +dqnextm033 nextminus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000006 +dqnextm034 nextminus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000007 +dqnextm035 nextminus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000008 +dqnextm036 nextminus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000009 +dqnextm037 nextminus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000010 +dqnextm038 nextminus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000011 +dqnextm039 nextminus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000012 + +-- ultra-tiny inputs +dqnextm062 nextminus 1E-6176 -> 0E-6176 +dqnextm065 nextminus -1E-6176 -> -2E-6176 + +-- Zeros +dqnextm100 nextminus -0 -> -1E-6176 +dqnextm101 nextminus 0 -> -1E-6176 +dqnextm102 nextminus 0.00 -> -1E-6176 +dqnextm103 nextminus -0.00 -> -1E-6176 +dqnextm104 nextminus 0E-300 -> -1E-6176 +dqnextm105 nextminus 0E+300 -> -1E-6176 +dqnextm106 nextminus 0E+30000 -> -1E-6176 +dqnextm107 nextminus -0E+30000 -> -1E-6176 + +-- specials +dqnextm150 nextminus Inf -> 9.999999999999999999999999999999999E+6144 +dqnextm151 nextminus -Inf -> -Infinity +dqnextm152 nextminus NaN -> NaN +dqnextm153 nextminus sNaN -> NaN Invalid_operation +dqnextm154 nextminus NaN77 -> NaN77 +dqnextm155 nextminus sNaN88 -> NaN88 Invalid_operation +dqnextm156 nextminus -NaN -> -NaN +dqnextm157 nextminus -sNaN -> -NaN Invalid_operation +dqnextm158 nextminus -NaN77 -> -NaN77 +dqnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +dqnextm170 nextminus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999998E+6144 +dqnextm171 nextminus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999997E+6144 +dqnextm172 nextminus 1E-6143 -> 9.99999999999999999999999999999999E-6144 +dqnextm173 nextminus 1.000000000000000000000000000000000E-6143 -> 9.99999999999999999999999999999999E-6144 +dqnextm174 nextminus 9E-6176 -> 8E-6176 +dqnextm175 nextminus 9.9E-6175 -> 9.8E-6175 +dqnextm176 nextminus 9.99999999999999999999999999999E-6147 -> 9.99999999999999999999999999998E-6147 +dqnextm177 nextminus 9.99999999999999999999999999999999E-6144 -> 9.99999999999999999999999999999998E-6144 +dqnextm178 nextminus 9.99999999999999999999999999999998E-6144 -> 9.99999999999999999999999999999997E-6144 +dqnextm179 nextminus 9.99999999999999999999999999999997E-6144 -> 9.99999999999999999999999999999996E-6144 +dqnextm180 nextminus 0E-6176 -> -1E-6176 +dqnextm181 nextminus 1E-6176 -> 0E-6176 +dqnextm182 nextminus 2E-6176 -> 1E-6176 + +dqnextm183 nextminus -0E-6176 -> -1E-6176 +dqnextm184 nextminus -1E-6176 -> -2E-6176 +dqnextm185 nextminus -2E-6176 -> -3E-6176 +dqnextm186 nextminus -10E-6176 -> -1.1E-6175 +dqnextm187 nextminus -100E-6176 -> -1.01E-6174 +dqnextm188 nextminus -100000E-6176 -> -1.00001E-6171 +dqnextm189 nextminus -1.00000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143 +dqnextm190 nextminus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143 +dqnextm191 nextminus -1E-6143 -> -1.000000000000000000000000000000001E-6143 +dqnextm192 nextminus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999999E+6144 +dqnextm193 nextminus -9.999999999999999999999999999999999E+6144 -> -Infinity + +-- Null tests +dqnextm900 nextminus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextPlus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextPlus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,124 @@ +------------------------------------------------------------------------ +-- dqNextPlus.decTest -- decQuad next that is greater [754r nextup] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqnextp001 nextplus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999996 +dqnextp002 nextplus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999997 +dqnextp003 nextplus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999998 +dqnextp004 nextplus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999999 +dqnextp005 nextplus 0.9999999999999999999999999999999999 -> 1.000000000000000000000000000000000 +dqnextp006 nextplus 1.000000000000000000000000000000000 -> 1.000000000000000000000000000000001 +dqnextp007 nextplus 1.0 -> 1.000000000000000000000000000000001 +dqnextp008 nextplus 1 -> 1.000000000000000000000000000000001 +dqnextp009 nextplus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000002 +dqnextp010 nextplus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000003 +dqnextp011 nextplus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000004 +dqnextp012 nextplus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000005 +dqnextp013 nextplus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000006 +dqnextp014 nextplus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000007 +dqnextp015 nextplus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000008 +dqnextp016 nextplus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000009 +dqnextp017 nextplus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000010 +dqnextp018 nextplus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000011 +dqnextp019 nextplus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000012 + +dqnextp021 nextplus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999994 +dqnextp022 nextplus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999995 +dqnextp023 nextplus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999996 +dqnextp024 nextplus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999997 +dqnextp025 nextplus -0.9999999999999999999999999999999999 -> -0.9999999999999999999999999999999998 +dqnextp026 nextplus -1.000000000000000000000000000000000 -> -0.9999999999999999999999999999999999 +dqnextp027 nextplus -1.0 -> -0.9999999999999999999999999999999999 +dqnextp028 nextplus -1 -> -0.9999999999999999999999999999999999 +dqnextp029 nextplus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000000 +dqnextp030 nextplus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000001 +dqnextp031 nextplus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000002 +dqnextp032 nextplus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000003 +dqnextp033 nextplus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000004 +dqnextp034 nextplus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000005 +dqnextp035 nextplus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000006 +dqnextp036 nextplus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000007 +dqnextp037 nextplus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000008 +dqnextp038 nextplus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000009 +dqnextp039 nextplus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000010 +dqnextp040 nextplus -1.000000000000000000000000000000012 -> -1.000000000000000000000000000000011 + +-- Zeros +dqnextp100 nextplus 0 -> 1E-6176 +dqnextp101 nextplus 0.00 -> 1E-6176 +dqnextp102 nextplus 0E-300 -> 1E-6176 +dqnextp103 nextplus 0E+300 -> 1E-6176 +dqnextp104 nextplus 0E+30000 -> 1E-6176 +dqnextp105 nextplus -0 -> 1E-6176 +dqnextp106 nextplus -0.00 -> 1E-6176 +dqnextp107 nextplus -0E-300 -> 1E-6176 +dqnextp108 nextplus -0E+300 -> 1E-6176 +dqnextp109 nextplus -0E+30000 -> 1E-6176 + +-- specials +dqnextp150 nextplus Inf -> Infinity +dqnextp151 nextplus -Inf -> -9.999999999999999999999999999999999E+6144 +dqnextp152 nextplus NaN -> NaN +dqnextp153 nextplus sNaN -> NaN Invalid_operation +dqnextp154 nextplus NaN77 -> NaN77 +dqnextp155 nextplus sNaN88 -> NaN88 Invalid_operation +dqnextp156 nextplus -NaN -> -NaN +dqnextp157 nextplus -sNaN -> -NaN Invalid_operation +dqnextp158 nextplus -NaN77 -> -NaN77 +dqnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +dqnextp170 nextplus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999998E+6144 +dqnextp171 nextplus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999997E+6144 +dqnextp172 nextplus -1E-6143 -> -9.99999999999999999999999999999999E-6144 +dqnextp173 nextplus -1.000000000000000E-6143 -> -9.99999999999999999999999999999999E-6144 +dqnextp174 nextplus -9E-6176 -> -8E-6176 +dqnextp175 nextplus -9.9E-6175 -> -9.8E-6175 +dqnextp176 nextplus -9.99999999999999999999999999999E-6147 -> -9.99999999999999999999999999998E-6147 +dqnextp177 nextplus -9.99999999999999999999999999999999E-6144 -> -9.99999999999999999999999999999998E-6144 +dqnextp178 nextplus -9.99999999999999999999999999999998E-6144 -> -9.99999999999999999999999999999997E-6144 +dqnextp179 nextplus -9.99999999999999999999999999999997E-6144 -> -9.99999999999999999999999999999996E-6144 +dqnextp180 nextplus -0E-6176 -> 1E-6176 +dqnextp181 nextplus -1E-6176 -> -0E-6176 +dqnextp182 nextplus -2E-6176 -> -1E-6176 + +dqnextp183 nextplus 0E-6176 -> 1E-6176 +dqnextp184 nextplus 1E-6176 -> 2E-6176 +dqnextp185 nextplus 2E-6176 -> 3E-6176 +dqnextp186 nextplus 10E-6176 -> 1.1E-6175 +dqnextp187 nextplus 100E-6176 -> 1.01E-6174 +dqnextp188 nextplus 100000E-6176 -> 1.00001E-6171 +dqnextp189 nextplus 1.00000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143 +dqnextp190 nextplus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143 +dqnextp191 nextplus 1E-6143 -> 1.000000000000000000000000000000001E-6143 +dqnextp192 nextplus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999999E+6144 +dqnextp193 nextplus 9.999999999999999999999999999999999E+6144 -> Infinity + +-- Null tests +dqnextp900 nextplus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextToward.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqNextToward.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,375 @@ +------------------------------------------------------------------------ +-- dqNextToward.decTest -- decQuad next toward rhs [754r nextafter] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + + +-- Sanity check with a scattering of numerics +dqnextt001 nexttoward 10 10 -> 10 +dqnextt002 nexttoward -10 -10 -> -10 +dqnextt003 nexttoward 1 10 -> 1.000000000000000000000000000000001 +dqnextt004 nexttoward 1 -10 -> 0.9999999999999999999999999999999999 +dqnextt005 nexttoward -1 10 -> -0.9999999999999999999999999999999999 +dqnextt006 nexttoward -1 -10 -> -1.000000000000000000000000000000001 +dqnextt007 nexttoward 0 10 -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt008 nexttoward 0 -10 -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt009 nexttoward 9.999999999999999999999999999999999E+6144 +Infinity -> Infinity Overflow Inexact Rounded +dqnextt010 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded +dqnextt011 nexttoward 9.999999999999999999999999999999999 10 -> 10.00000000000000000000000000000000 +dqnextt012 nexttoward 10 9.999999999999999999999999999999999 -> 9.999999999999999999999999999999999 +dqnextt013 nexttoward -9.999999999999999999999999999999999 -10 -> -10.00000000000000000000000000000000 +dqnextt014 nexttoward -10 -9.999999999999999999999999999999999 -> -9.999999999999999999999999999999999 +dqnextt015 nexttoward 9.999999999999999999999999999999998 10 -> 9.999999999999999999999999999999999 +dqnextt016 nexttoward 10 9.999999999999999999999999999999998 -> 9.999999999999999999999999999999999 +dqnextt017 nexttoward -9.999999999999999999999999999999998 -10 -> -9.999999999999999999999999999999999 +dqnextt018 nexttoward -10 -9.999999999999999999999999999999998 -> -9.999999999999999999999999999999999 + +------- lhs=rhs +-- finites +dqnextt101 nexttoward 7 7 -> 7 +dqnextt102 nexttoward -7 -7 -> -7 +dqnextt103 nexttoward 75 75 -> 75 +dqnextt104 nexttoward -75 -75 -> -75 +dqnextt105 nexttoward 7.50 7.5 -> 7.50 +dqnextt106 nexttoward -7.50 -7.50 -> -7.50 +dqnextt107 nexttoward 7.500 7.5000 -> 7.500 +dqnextt108 nexttoward -7.500 -7.5 -> -7.500 + +-- zeros +dqnextt111 nexttoward 0 0 -> 0 +dqnextt112 nexttoward -0 -0 -> -0 +dqnextt113 nexttoward 0E+4 0 -> 0E+4 +dqnextt114 nexttoward -0E+4 -0 -> -0E+4 +dqnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11 +dqnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11 +dqnextt117 nexttoward 0E-141 0 -> 0E-141 +dqnextt118 nexttoward -0E-141 -000 -> -0E-141 + +-- full coefficients, alternating bits +dqnextt121 nexttoward 268268268 268268268 -> 268268268 +dqnextt122 nexttoward -268268268 -268268268 -> -268268268 +dqnextt123 nexttoward 134134134 134134134 -> 134134134 +dqnextt124 nexttoward -134134134 -134134134 -> -134134134 + +-- Nmax, Nmin, Ntiny +dqnextt131 nexttoward 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqnextt132 nexttoward 1E-6143 1E-6143 -> 1E-6143 +dqnextt133 nexttoward 1.000000000000000000000000000000000E-6143 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqnextt134 nexttoward 1E-6176 1E-6176 -> 1E-6176 + +dqnextt135 nexttoward -1E-6176 -1E-6176 -> -1E-6176 +dqnextt136 nexttoward -1.000000000000000000000000000000000E-6143 -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143 +dqnextt137 nexttoward -1E-6143 -1E-6143 -> -1E-6143 +dqnextt138 nexttoward -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 + +------- lhs 0.9999999999999999999999999999999996 +dqnextt202 nexttoward 0.9999999999999999999999999999999996 Infinity -> 0.9999999999999999999999999999999997 +dqnextt203 nexttoward 0.9999999999999999999999999999999997 Infinity -> 0.9999999999999999999999999999999998 +dqnextt204 nexttoward 0.9999999999999999999999999999999998 Infinity -> 0.9999999999999999999999999999999999 +dqnextt205 nexttoward 0.9999999999999999999999999999999999 Infinity -> 1.000000000000000000000000000000000 +dqnextt206 nexttoward 1.000000000000000000000000000000000 Infinity -> 1.000000000000000000000000000000001 +dqnextt207 nexttoward 1.0 Infinity -> 1.000000000000000000000000000000001 +dqnextt208 nexttoward 1 Infinity -> 1.000000000000000000000000000000001 +dqnextt209 nexttoward 1.000000000000000000000000000000001 Infinity -> 1.000000000000000000000000000000002 +dqnextt210 nexttoward 1.000000000000000000000000000000002 Infinity -> 1.000000000000000000000000000000003 +dqnextt211 nexttoward 1.000000000000000000000000000000003 Infinity -> 1.000000000000000000000000000000004 +dqnextt212 nexttoward 1.000000000000000000000000000000004 Infinity -> 1.000000000000000000000000000000005 +dqnextt213 nexttoward 1.000000000000000000000000000000005 Infinity -> 1.000000000000000000000000000000006 +dqnextt214 nexttoward 1.000000000000000000000000000000006 Infinity -> 1.000000000000000000000000000000007 +dqnextt215 nexttoward 1.000000000000000000000000000000007 Infinity -> 1.000000000000000000000000000000008 +dqnextt216 nexttoward 1.000000000000000000000000000000008 Infinity -> 1.000000000000000000000000000000009 +dqnextt217 nexttoward 1.000000000000000000000000000000009 Infinity -> 1.000000000000000000000000000000010 +dqnextt218 nexttoward 1.000000000000000000000000000000010 Infinity -> 1.000000000000000000000000000000011 +dqnextt219 nexttoward 1.000000000000000000000000000000011 Infinity -> 1.000000000000000000000000000000012 + +dqnextt221 nexttoward -0.9999999999999999999999999999999995 Infinity -> -0.9999999999999999999999999999999994 +dqnextt222 nexttoward -0.9999999999999999999999999999999996 Infinity -> -0.9999999999999999999999999999999995 +dqnextt223 nexttoward -0.9999999999999999999999999999999997 Infinity -> -0.9999999999999999999999999999999996 +dqnextt224 nexttoward -0.9999999999999999999999999999999998 Infinity -> -0.9999999999999999999999999999999997 +dqnextt225 nexttoward -0.9999999999999999999999999999999999 Infinity -> -0.9999999999999999999999999999999998 +dqnextt226 nexttoward -1.000000000000000000000000000000000 Infinity -> -0.9999999999999999999999999999999999 +dqnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999999999999999999999 +dqnextt228 nexttoward -1 Infinity -> -0.9999999999999999999999999999999999 +dqnextt229 nexttoward -1.000000000000000000000000000000001 Infinity -> -1.000000000000000000000000000000000 +dqnextt230 nexttoward -1.000000000000000000000000000000002 Infinity -> -1.000000000000000000000000000000001 +dqnextt231 nexttoward -1.000000000000000000000000000000003 Infinity -> -1.000000000000000000000000000000002 +dqnextt232 nexttoward -1.000000000000000000000000000000004 Infinity -> -1.000000000000000000000000000000003 +dqnextt233 nexttoward -1.000000000000000000000000000000005 Infinity -> -1.000000000000000000000000000000004 +dqnextt234 nexttoward -1.000000000000000000000000000000006 Infinity -> -1.000000000000000000000000000000005 +dqnextt235 nexttoward -1.000000000000000000000000000000007 Infinity -> -1.000000000000000000000000000000006 +dqnextt236 nexttoward -1.000000000000000000000000000000008 Infinity -> -1.000000000000000000000000000000007 +dqnextt237 nexttoward -1.000000000000000000000000000000009 Infinity -> -1.000000000000000000000000000000008 +dqnextt238 nexttoward -1.000000000000000000000000000000010 Infinity -> -1.000000000000000000000000000000009 +dqnextt239 nexttoward -1.000000000000000000000000000000011 Infinity -> -1.000000000000000000000000000000010 +dqnextt240 nexttoward -1.000000000000000000000000000000012 Infinity -> -1.000000000000000000000000000000011 + +-- Zeros +dqnextt300 nexttoward 0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt301 nexttoward 0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt302 nexttoward 0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt303 nexttoward 0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt304 nexttoward 0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt305 nexttoward -0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt306 nexttoward -0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt307 nexttoward -0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt308 nexttoward -0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt309 nexttoward -0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded + +-- specials +dqnextt350 nexttoward Inf Infinity -> Infinity +dqnextt351 nexttoward -Inf Infinity -> -9.999999999999999999999999999999999E+6144 +dqnextt352 nexttoward NaN Infinity -> NaN +dqnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation +dqnextt354 nexttoward NaN77 Infinity -> NaN77 +dqnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation +dqnextt356 nexttoward -NaN Infinity -> -NaN +dqnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation +dqnextt358 nexttoward -NaN77 Infinity -> -NaN77 +dqnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +dqnextt370 nexttoward -9.999999999999999999999999999999999E+6144 Infinity -> -9.999999999999999999999999999999998E+6144 +dqnextt371 nexttoward -9.999999999999999999999999999999998E+6144 Infinity -> -9.999999999999999999999999999999997E+6144 +dqnextt372 nexttoward -1E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded +dqnextt373 nexttoward -1.000000000000000E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded +dqnextt374 nexttoward -9E-6176 Infinity -> -8E-6176 Underflow Subnormal Inexact Rounded +dqnextt375 nexttoward -9.9E-6175 Infinity -> -9.8E-6175 Underflow Subnormal Inexact Rounded +dqnextt376 nexttoward -9.99999999999999999999999999999E-6147 Infinity -> -9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded +dqnextt377 nexttoward -9.99999999999999999999999999999999E-6144 Infinity -> -9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded +dqnextt378 nexttoward -9.99999999999999999999999999999998E-6144 Infinity -> -9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded +dqnextt379 nexttoward -9.99999999999999999999999999999997E-6144 Infinity -> -9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded +dqnextt380 nexttoward -0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt381 nexttoward -1E-6176 Infinity -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqnextt382 nexttoward -2E-6176 Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded + +dqnextt383 nexttoward 0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt384 nexttoward 1E-6176 Infinity -> 2E-6176 Underflow Subnormal Inexact Rounded +dqnextt385 nexttoward 2E-6176 Infinity -> 3E-6176 Underflow Subnormal Inexact Rounded +dqnextt386 nexttoward 10E-6176 Infinity -> 1.1E-6175 Underflow Subnormal Inexact Rounded +dqnextt387 nexttoward 100E-6176 Infinity -> 1.01E-6174 Underflow Subnormal Inexact Rounded +dqnextt388 nexttoward 100000E-6176 Infinity -> 1.00001E-6171 Underflow Subnormal Inexact Rounded +dqnextt389 nexttoward 1.00000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143 +dqnextt390 nexttoward 1.000000000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143 +dqnextt391 nexttoward 1E-6143 Infinity -> 1.000000000000000000000000000000001E-6143 +dqnextt392 nexttoward 9.999999999999999999999999999999997E+6144 Infinity -> 9.999999999999999999999999999999998E+6144 +dqnextt393 nexttoward 9.999999999999999999999999999999998E+6144 Infinity -> 9.999999999999999999999999999999999E+6144 +dqnextt394 nexttoward 9.999999999999999999999999999999999E+6144 Infinity -> Infinity Overflow Inexact Rounded + +------- lhs>rhs +dqnextt401 nexttoward 0.9999999999999999999999999999999995 -Infinity -> 0.9999999999999999999999999999999994 +dqnextt402 nexttoward 0.9999999999999999999999999999999996 -Infinity -> 0.9999999999999999999999999999999995 +dqnextt403 nexttoward 0.9999999999999999999999999999999997 -Infinity -> 0.9999999999999999999999999999999996 +dqnextt404 nexttoward 0.9999999999999999999999999999999998 -Infinity -> 0.9999999999999999999999999999999997 +dqnextt405 nexttoward 0.9999999999999999999999999999999999 -Infinity -> 0.9999999999999999999999999999999998 +dqnextt406 nexttoward 1.000000000000000000000000000000000 -Infinity -> 0.9999999999999999999999999999999999 +dqnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999999999999999999999 +dqnextt408 nexttoward 1 -Infinity -> 0.9999999999999999999999999999999999 +dqnextt409 nexttoward 1.000000000000000000000000000000001 -Infinity -> 1.000000000000000000000000000000000 +dqnextt410 nexttoward 1.000000000000000000000000000000002 -Infinity -> 1.000000000000000000000000000000001 +dqnextt411 nexttoward 1.000000000000000000000000000000003 -Infinity -> 1.000000000000000000000000000000002 +dqnextt412 nexttoward 1.000000000000000000000000000000004 -Infinity -> 1.000000000000000000000000000000003 +dqnextt413 nexttoward 1.000000000000000000000000000000005 -Infinity -> 1.000000000000000000000000000000004 +dqnextt414 nexttoward 1.000000000000000000000000000000006 -Infinity -> 1.000000000000000000000000000000005 +dqnextt415 nexttoward 1.000000000000000000000000000000007 -Infinity -> 1.000000000000000000000000000000006 +dqnextt416 nexttoward 1.000000000000000000000000000000008 -Infinity -> 1.000000000000000000000000000000007 +dqnextt417 nexttoward 1.000000000000000000000000000000009 -Infinity -> 1.000000000000000000000000000000008 +dqnextt418 nexttoward 1.000000000000000000000000000000010 -Infinity -> 1.000000000000000000000000000000009 +dqnextt419 nexttoward 1.000000000000000000000000000000011 -Infinity -> 1.000000000000000000000000000000010 +dqnextt420 nexttoward 1.000000000000000000000000000000012 -Infinity -> 1.000000000000000000000000000000011 + +dqnextt421 nexttoward -0.9999999999999999999999999999999995 -Infinity -> -0.9999999999999999999999999999999996 +dqnextt422 nexttoward -0.9999999999999999999999999999999996 -Infinity -> -0.9999999999999999999999999999999997 +dqnextt423 nexttoward -0.9999999999999999999999999999999997 -Infinity -> -0.9999999999999999999999999999999998 +dqnextt424 nexttoward -0.9999999999999999999999999999999998 -Infinity -> -0.9999999999999999999999999999999999 +dqnextt425 nexttoward -0.9999999999999999999999999999999999 -Infinity -> -1.000000000000000000000000000000000 +dqnextt426 nexttoward -1.000000000000000000000000000000000 -Infinity -> -1.000000000000000000000000000000001 +dqnextt427 nexttoward -1.0 -Infinity -> -1.000000000000000000000000000000001 +dqnextt428 nexttoward -1 -Infinity -> -1.000000000000000000000000000000001 +dqnextt429 nexttoward -1.000000000000000000000000000000001 -Infinity -> -1.000000000000000000000000000000002 +dqnextt430 nexttoward -1.000000000000000000000000000000002 -Infinity -> -1.000000000000000000000000000000003 +dqnextt431 nexttoward -1.000000000000000000000000000000003 -Infinity -> -1.000000000000000000000000000000004 +dqnextt432 nexttoward -1.000000000000000000000000000000004 -Infinity -> -1.000000000000000000000000000000005 +dqnextt433 nexttoward -1.000000000000000000000000000000005 -Infinity -> -1.000000000000000000000000000000006 +dqnextt434 nexttoward -1.000000000000000000000000000000006 -Infinity -> -1.000000000000000000000000000000007 +dqnextt435 nexttoward -1.000000000000000000000000000000007 -Infinity -> -1.000000000000000000000000000000008 +dqnextt436 nexttoward -1.000000000000000000000000000000008 -Infinity -> -1.000000000000000000000000000000009 +dqnextt437 nexttoward -1.000000000000000000000000000000009 -Infinity -> -1.000000000000000000000000000000010 +dqnextt438 nexttoward -1.000000000000000000000000000000010 -Infinity -> -1.000000000000000000000000000000011 +dqnextt439 nexttoward -1.000000000000000000000000000000011 -Infinity -> -1.000000000000000000000000000000012 + +-- Zeros +dqnextt500 nexttoward -0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt501 nexttoward 0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt502 nexttoward 0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt503 nexttoward -0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt504 nexttoward 0E-300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt505 nexttoward 0E+300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt506 nexttoward 0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt507 nexttoward -0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded + +-- specials +dqnextt550 nexttoward Inf -Infinity -> 9.999999999999999999999999999999999E+6144 +dqnextt551 nexttoward -Inf -Infinity -> -Infinity +dqnextt552 nexttoward NaN -Infinity -> NaN +dqnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation +dqnextt554 nexttoward NaN77 -Infinity -> NaN77 +dqnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation +dqnextt556 nexttoward -NaN -Infinity -> -NaN +dqnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation +dqnextt558 nexttoward -NaN77 -Infinity -> -NaN77 +dqnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +dqnextt670 nexttoward 9.999999999999999999999999999999999E+6144 -Infinity -> 9.999999999999999999999999999999998E+6144 +dqnextt671 nexttoward 9.999999999999999999999999999999998E+6144 -Infinity -> 9.999999999999999999999999999999997E+6144 +dqnextt672 nexttoward 1E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded +dqnextt673 nexttoward 1.000000000000000000000000000000000E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded +dqnextt674 nexttoward 9E-6176 -Infinity -> 8E-6176 Underflow Subnormal Inexact Rounded +dqnextt675 nexttoward 9.9E-6175 -Infinity -> 9.8E-6175 Underflow Subnormal Inexact Rounded +dqnextt676 nexttoward 9.99999999999999999999999999999E-6147 -Infinity -> 9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded +dqnextt677 nexttoward 9.99999999999999999999999999999999E-6144 -Infinity -> 9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded +dqnextt678 nexttoward 9.99999999999999999999999999999998E-6144 -Infinity -> 9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded +dqnextt679 nexttoward 9.99999999999999999999999999999997E-6144 -Infinity -> 9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded +dqnextt680 nexttoward 0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt681 nexttoward 1E-6176 -Infinity -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqnextt682 nexttoward 2E-6176 -Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded + +dqnextt683 nexttoward -0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt684 nexttoward -1E-6176 -Infinity -> -2E-6176 Underflow Subnormal Inexact Rounded +dqnextt685 nexttoward -2E-6176 -Infinity -> -3E-6176 Underflow Subnormal Inexact Rounded +dqnextt686 nexttoward -10E-6176 -Infinity -> -1.1E-6175 Underflow Subnormal Inexact Rounded +dqnextt687 nexttoward -100E-6176 -Infinity -> -1.01E-6174 Underflow Subnormal Inexact Rounded +dqnextt688 nexttoward -100000E-6176 -Infinity -> -1.00001E-6171 Underflow Subnormal Inexact Rounded +dqnextt689 nexttoward -1.00000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143 +dqnextt690 nexttoward -1.000000000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143 +dqnextt691 nexttoward -1E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143 +dqnextt692 nexttoward -9.999999999999999999999999999999998E+6144 -Infinity -> -9.999999999999999999999999999999999E+6144 +dqnextt693 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded + +------- Specials +dqnextt780 nexttoward -Inf -Inf -> -Infinity +dqnextt781 nexttoward -Inf -1000 -> -9.999999999999999999999999999999999E+6144 +dqnextt782 nexttoward -Inf -1 -> -9.999999999999999999999999999999999E+6144 +dqnextt783 nexttoward -Inf -0 -> -9.999999999999999999999999999999999E+6144 +dqnextt784 nexttoward -Inf 0 -> -9.999999999999999999999999999999999E+6144 +dqnextt785 nexttoward -Inf 1 -> -9.999999999999999999999999999999999E+6144 +dqnextt786 nexttoward -Inf 1000 -> -9.999999999999999999999999999999999E+6144 +dqnextt787 nexttoward -1000 -Inf -> -1000.000000000000000000000000000001 +dqnextt788 nexttoward -Inf -Inf -> -Infinity +dqnextt789 nexttoward -1 -Inf -> -1.000000000000000000000000000000001 +dqnextt790 nexttoward -0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt791 nexttoward 0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded +dqnextt792 nexttoward 1 -Inf -> 0.9999999999999999999999999999999999 +dqnextt793 nexttoward 1000 -Inf -> 999.9999999999999999999999999999999 +dqnextt794 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144 + +dqnextt800 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144 +dqnextt801 nexttoward Inf -1000 -> 9.999999999999999999999999999999999E+6144 +dqnextt802 nexttoward Inf -1 -> 9.999999999999999999999999999999999E+6144 +dqnextt803 nexttoward Inf -0 -> 9.999999999999999999999999999999999E+6144 +dqnextt804 nexttoward Inf 0 -> 9.999999999999999999999999999999999E+6144 +dqnextt805 nexttoward Inf 1 -> 9.999999999999999999999999999999999E+6144 +dqnextt806 nexttoward Inf 1000 -> 9.999999999999999999999999999999999E+6144 +dqnextt807 nexttoward Inf Inf -> Infinity +dqnextt808 nexttoward -1000 Inf -> -999.9999999999999999999999999999999 +dqnextt809 nexttoward -Inf Inf -> -9.999999999999999999999999999999999E+6144 +dqnextt810 nexttoward -1 Inf -> -0.9999999999999999999999999999999999 +dqnextt811 nexttoward -0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt812 nexttoward 0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded +dqnextt813 nexttoward 1 Inf -> 1.000000000000000000000000000000001 +dqnextt814 nexttoward 1000 Inf -> 1000.000000000000000000000000000001 +dqnextt815 nexttoward Inf Inf -> Infinity + +dqnextt821 nexttoward NaN -Inf -> NaN +dqnextt822 nexttoward NaN -1000 -> NaN +dqnextt823 nexttoward NaN -1 -> NaN +dqnextt824 nexttoward NaN -0 -> NaN +dqnextt825 nexttoward NaN 0 -> NaN +dqnextt826 nexttoward NaN 1 -> NaN +dqnextt827 nexttoward NaN 1000 -> NaN +dqnextt828 nexttoward NaN Inf -> NaN +dqnextt829 nexttoward NaN NaN -> NaN +dqnextt830 nexttoward -Inf NaN -> NaN +dqnextt831 nexttoward -1000 NaN -> NaN +dqnextt832 nexttoward -1 NaN -> NaN +dqnextt833 nexttoward -0 NaN -> NaN +dqnextt834 nexttoward 0 NaN -> NaN +dqnextt835 nexttoward 1 NaN -> NaN +dqnextt836 nexttoward 1000 NaN -> NaN +dqnextt837 nexttoward Inf NaN -> NaN + +dqnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation +dqnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation +dqnextt843 nexttoward sNaN -1 -> NaN Invalid_operation +dqnextt844 nexttoward sNaN -0 -> NaN Invalid_operation +dqnextt845 nexttoward sNaN 0 -> NaN Invalid_operation +dqnextt846 nexttoward sNaN 1 -> NaN Invalid_operation +dqnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation +dqnextt848 nexttoward sNaN NaN -> NaN Invalid_operation +dqnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation +dqnextt850 nexttoward NaN sNaN -> NaN Invalid_operation +dqnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation +dqnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation +dqnextt853 nexttoward -1 sNaN -> NaN Invalid_operation +dqnextt854 nexttoward -0 sNaN -> NaN Invalid_operation +dqnextt855 nexttoward 0 sNaN -> NaN Invalid_operation +dqnextt856 nexttoward 1 sNaN -> NaN Invalid_operation +dqnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation +dqnextt858 nexttoward Inf sNaN -> NaN Invalid_operation +dqnextt859 nexttoward NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqnextt861 nexttoward NaN1 -Inf -> NaN1 +dqnextt862 nexttoward +NaN2 -1000 -> NaN2 +dqnextt863 nexttoward NaN3 1000 -> NaN3 +dqnextt864 nexttoward NaN4 Inf -> NaN4 +dqnextt865 nexttoward NaN5 +NaN6 -> NaN5 +dqnextt866 nexttoward -Inf NaN7 -> NaN7 +dqnextt867 nexttoward -1000 NaN8 -> NaN8 +dqnextt868 nexttoward 1000 NaN9 -> NaN9 +dqnextt869 nexttoward Inf +NaN10 -> NaN10 +dqnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation +dqnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation +dqnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation +dqnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation +dqnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation +dqnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation +dqnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation +dqnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation +dqnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation +dqnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation +dqnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation +dqnextt882 nexttoward -NaN26 NaN28 -> -NaN26 +dqnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation +dqnextt884 nexttoward 1000 -NaN30 -> -NaN30 +dqnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Null tests +dqnextt900 nexttoward 1 # -> NaN Invalid_operation +dqnextt901 nexttoward # 1 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqOr.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqOr.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,401 @@ +------------------------------------------------------------------------ +-- dqOr.decTest -- digitwise logical OR for decQuads -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check (truth table) +dqor001 or 0 0 -> 0 +dqor002 or 0 1 -> 1 +dqor003 or 1 0 -> 1 +dqor004 or 1 1 -> 1 +dqor005 or 1100 1010 -> 1110 +-- and at msd and msd-1 +dqor006 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqor007 or 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqor008 or 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqor009 or 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqor010 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqor011 or 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000 +dqor012 or 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000 +dqor013 or 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000 + +-- Various lengths +dqor601 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111 +dqor602 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111 +dqor603 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111 +dqor604 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111 +dqor605 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111 +dqor606 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111 +dqor607 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111 +dqor608 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111 +dqor609 or 1111111101111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111111111111 +dqor610 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111 +dqor611 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111 +dqor612 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111 +dqor613 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111 +dqor614 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111 +dqor615 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111 +dqor616 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111 +dqor617 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111 +dqor618 or 1111111111111111101111111111111111 1111111111111111011111111111111111 -> 1111111111111111111111111111111111 +dqor619 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111 +dqor620 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111 +dqor621 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111 +dqor622 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111 +dqor623 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111 +dqor624 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111 +dqor625 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111 +dqor626 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111 +dqor627 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111 +dqor628 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor629 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor630 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor631 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor632 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor633 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor634 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111 + +dqor641 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor642 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor643 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor644 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor645 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor646 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor647 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111 +dqor648 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111 +dqor649 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111 +dqor650 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111 +dqor651 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111 +dqor652 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111 +dqor653 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111 +dqor654 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111 +dqor655 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111 +dqor656 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111 +dqor657 or 1010101010101010101010101010101010 1010101010101010001010101010101010 -> 1010101010101010101010101010101010 +dqor658 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111 +dqor659 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111 +dqor660 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111 +dqor661 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111 +dqor662 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111 +dqor663 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111 +dqor664 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111 +dqor665 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111 +dqor666 or 0101010101010101010101010101010101 0101010101010101010101010001010101 -> 101010101010101010101010101010101 +dqor667 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111 +dqor668 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111 +dqor669 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111 +dqor670 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111 +dqor671 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111 +dqor672 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111 +dqor673 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111 +dqor674 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111 +dqor675 or 0111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110 +dqor676 or 1111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110 + +dqor681 or 0111111111111111111111111111111111 0111111111011111111111111111111110 -> 111111111111111111111111111111111 +dqor682 or 1011111111111111111111111111111111 1011111110101111111111111111111101 -> 1011111111111111111111111111111111 +dqor683 or 1101111111111111111111111111111111 1101111101110111111111111111111011 -> 1101111111111111111111111111111111 +dqor684 or 1110111111111111111111111111111111 1110111011111011111111111111110111 -> 1110111111111111111111111111111111 +dqor685 or 1111011111111111111111111111111111 1111010111111101111111111111101111 -> 1111011111111111111111111111111111 +dqor686 or 1111101111111111111111111111111111 1111101111111110111111111111011111 -> 1111101111111111111111111111111111 +dqor687 or 1111110111111111111111111111111111 1111010111111111011111111110111111 -> 1111110111111111111111111111111111 +dqor688 or 1111111011111111111111111111111111 1110111011111111101111111101111111 -> 1111111011111111111111111111111111 +dqor689 or 1111111101111111111111111111111111 1101111101111111110111111011111111 -> 1111111101111111111111111111111111 +dqor690 or 1111111110111111111111111111111111 1011111110111111111011110111111110 -> 1111111110111111111111111111111111 +dqor691 or 1111111111011111111111111111111111 0111111111011111111101101111111101 -> 1111111111011111111111111111111111 +dqor692 or 1111111111101111111111111111111111 1111111111101111111110011111111011 -> 1111111111101111111111111111111111 +dqor693 or 1111111111110111111111111111111111 1111111111110111111110011111110111 -> 1111111111110111111111111111111111 +dqor694 or 1111111111111011111111111111111111 1111111111111011111101101111101111 -> 1111111111111011111111111111111111 +dqor695 or 1111111111111101111111111111111111 1111111111111101111011110111011111 -> 1111111111111101111111111111111111 +dqor696 or 1111111111111110111111111111111111 1111111111111110110111111010111111 -> 1111111111111110111111111111111111 +dqor697 or 1111111111111111011111111111111111 1111111111111111001111111101111111 -> 1111111111111111011111111111111111 +dqor698 or 1111111111111111101111111111111111 1111111111111111001111111010111111 -> 1111111111111111101111111111111111 +dqor699 or 1111111111111111110111111111111111 1111111111111110110111110111011111 -> 1111111111111111110111111111111111 +dqor700 or 1111111111111111111011111111111111 1111111111111101111011101111101111 -> 1111111111111111111011111111111111 +dqor701 or 1111111111111111111101111111111111 1111111111111011111101011111110111 -> 1111111111111111111101111111111111 +dqor702 or 1111111111111111111110111111111111 1111111111110111111110111111111011 -> 1111111111111111111110111111111111 +dqor703 or 1111111111111111111111011111111111 1111111111101111111101011111111101 -> 1111111111111111111111011111111111 +dqor704 or 1111111111111111111111101111111111 1111111111011111111011101111111110 -> 1111111111111111111111101111111111 +dqor705 or 1111111111111111111111110111111111 0111111110111111110111110111111111 -> 1111111111111111111111110111111111 +dqor706 or 1111111111111111111111111011111111 1011111101111111101111111011111111 -> 1111111111111111111111111011111111 +dqor707 or 1111111111111111111111111101111111 1101111011111111011111111101111111 -> 1111111111111111111111111101111111 +dqor708 or 1111111111111111111111111110111111 1110110111111110111111111110111111 -> 1111111111111111111111111110111111 +dqor709 or 1111111111111111111111111111011111 1111001111111101111111111111011111 -> 1111111111111111111111111111011111 +dqor710 or 1111111111111111111111111111101111 1111001111111011111111111111101111 -> 1111111111111111111111111111101111 +dqor711 or 1111111111111111111111111111110111 1110110111110111111111111111110111 -> 1111111111111111111111111111110111 +dqor712 or 1111111111111111111111111111111011 1101111011101111111111111111111011 -> 1111111111111111111111111111111011 +dqor713 or 1111111111111111111111111111111101 1011111101011111111111111111111101 -> 1111111111111111111111111111111101 +dqor714 or 1111111111111111111111111111111110 0111111110111111111111111111111110 -> 1111111111111111111111111111111110 + + + +-- 1234567890123456 1234567890123456 1234567890123456 +dqor020 or 1111111111111111 1111111111111111 -> 1111111111111111 +dqor021 or 111111111111111 111111111111111 -> 111111111111111 +dqor022 or 11111111111111 11111111111111 -> 11111111111111 +dqor023 or 1111111111111 1111111111111 -> 1111111111111 +dqor024 or 111111111111 111111111111 -> 111111111111 +dqor025 or 11111111111 11111111111 -> 11111111111 +dqor026 or 1111111111 1111111111 -> 1111111111 +dqor027 or 111111111 111111111 -> 111111111 +dqor028 or 11111111 11111111 -> 11111111 +dqor029 or 1111111 1111111 -> 1111111 +dqor030 or 111111 111111 -> 111111 +dqor031 or 11111 11111 -> 11111 +dqor032 or 1111 1111 -> 1111 +dqor033 or 111 111 -> 111 +dqor034 or 11 11 -> 11 +dqor035 or 1 1 -> 1 +dqor036 or 0 0 -> 0 + +dqor042 or 111111110000000 1111111110000000 -> 1111111110000000 +dqor043 or 11111110000000 1000000100000000 -> 1011111110000000 +dqor044 or 1111110000000 1000001000000000 -> 1001111110000000 +dqor045 or 111110000000 1000010000000000 -> 1000111110000000 +dqor046 or 11110000000 1000100000000000 -> 1000111110000000 +dqor047 or 1110000000 1001000000000000 -> 1001001110000000 +dqor048 or 110000000 1010000000000000 -> 1010000110000000 +dqor049 or 10000000 1100000000000000 -> 1100000010000000 + +dqor090 or 011111111 111101111 -> 111111111 +dqor091 or 101111111 111101111 -> 111111111 +dqor092 or 110111111 111101111 -> 111111111 +dqor093 or 111011111 111101111 -> 111111111 +dqor094 or 111101111 111101111 -> 111101111 +dqor095 or 111110111 111101111 -> 111111111 +dqor096 or 111111011 111101111 -> 111111111 +dqor097 or 111111101 111101111 -> 111111111 +dqor098 or 111111110 111101111 -> 111111111 + +dqor100 or 111101111 011111111 -> 111111111 +dqor101 or 111101111 101111111 -> 111111111 +dqor102 or 111101111 110111111 -> 111111111 +dqor103 or 111101111 111011111 -> 111111111 +dqor104 or 111101111 111101111 -> 111101111 +dqor105 or 111101111 111110111 -> 111111111 +dqor106 or 111101111 111111011 -> 111111111 +dqor107 or 111101111 111111101 -> 111111111 +dqor108 or 111101111 111111110 -> 111111111 + +-- non-0/1 should not be accepted, nor should signs +dqor220 or 111111112 111111111 -> NaN Invalid_operation +dqor221 or 333333333 333333333 -> NaN Invalid_operation +dqor222 or 555555555 555555555 -> NaN Invalid_operation +dqor223 or 777777777 777777777 -> NaN Invalid_operation +dqor224 or 999999999 999999999 -> NaN Invalid_operation +dqor225 or 222222222 999999999 -> NaN Invalid_operation +dqor226 or 444444444 999999999 -> NaN Invalid_operation +dqor227 or 666666666 999999999 -> NaN Invalid_operation +dqor228 or 888888888 999999999 -> NaN Invalid_operation +dqor229 or 999999999 222222222 -> NaN Invalid_operation +dqor230 or 999999999 444444444 -> NaN Invalid_operation +dqor231 or 999999999 666666666 -> NaN Invalid_operation +dqor232 or 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +dqor240 or 567468689 -934981942 -> NaN Invalid_operation +dqor241 or 567367689 934981942 -> NaN Invalid_operation +dqor242 or -631917772 -706014634 -> NaN Invalid_operation +dqor243 or -756253257 138579234 -> NaN Invalid_operation +dqor244 or 835590149 567435400 -> NaN Invalid_operation +-- test MSD +dqor250 or 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqor251 or 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqor252 or 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqor253 or 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqor254 or 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqor255 or 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqor256 or 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqor257 or 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqor258 or 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation +dqor259 or 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation +dqor260 or 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation +dqor261 or 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation +dqor262 or 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation +dqor263 or 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation +dqor264 or 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation +dqor265 or 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation +-- test MSD-1 +dqor270 or 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation +dqor271 or 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation +dqor272 or 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation +dqor273 or 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation +dqor274 or 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation +dqor275 or 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation +dqor276 or 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation +dqor277 or 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation +-- test LSD +dqor280 or 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation +dqor281 or 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation +dqor282 or 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation +dqor283 or 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation +dqor284 or 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation +dqor285 or 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation +dqor286 or 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation +dqor287 or 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation +-- test Middie +dqor288 or 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation +dqor289 or 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation +dqor290 or 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation +dqor291 or 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation +dqor292 or 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation +dqor293 or 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation +dqor294 or 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation +dqor295 or 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation +-- signs +dqor296 or -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation +dqor297 or -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation +dqor298 or 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation +dqor299 or 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001111001111001111000011000100 + +-- Nmax, Nmin, Ntiny-like +dqor331 or 2 9.99999999E+1999 -> NaN Invalid_operation +dqor332 or 3 1E-1999 -> NaN Invalid_operation +dqor333 or 4 1.00000000E-1999 -> NaN Invalid_operation +dqor334 or 5 1E-1009 -> NaN Invalid_operation +dqor335 or 6 -1E-1009 -> NaN Invalid_operation +dqor336 or 7 -1.00000000E-1999 -> NaN Invalid_operation +dqor337 or 8 -1E-1999 -> NaN Invalid_operation +dqor338 or 9 -9.99999999E+1999 -> NaN Invalid_operation +dqor341 or 9.99999999E+2999 -18 -> NaN Invalid_operation +dqor342 or 1E-2999 01 -> NaN Invalid_operation +dqor343 or 1.00000000E-2999 -18 -> NaN Invalid_operation +dqor344 or 1E-1009 18 -> NaN Invalid_operation +dqor345 or -1E-1009 -10 -> NaN Invalid_operation +dqor346 or -1.00000000E-2999 18 -> NaN Invalid_operation +dqor347 or -1E-2999 10 -> NaN Invalid_operation +dqor348 or -9.99999999E+2999 -18 -> NaN Invalid_operation + +-- A few other non-integers +dqor361 or 1.0 1 -> NaN Invalid_operation +dqor362 or 1E+1 1 -> NaN Invalid_operation +dqor363 or 0.0 1 -> NaN Invalid_operation +dqor364 or 0E+1 1 -> NaN Invalid_operation +dqor365 or 9.9 1 -> NaN Invalid_operation +dqor366 or 9E+1 1 -> NaN Invalid_operation +dqor371 or 0 1.0 -> NaN Invalid_operation +dqor372 or 0 1E+1 -> NaN Invalid_operation +dqor373 or 0 0.0 -> NaN Invalid_operation +dqor374 or 0 0E+1 -> NaN Invalid_operation +dqor375 or 0 9.9 -> NaN Invalid_operation +dqor376 or 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +dqor780 or -Inf -Inf -> NaN Invalid_operation +dqor781 or -Inf -1000 -> NaN Invalid_operation +dqor782 or -Inf -1 -> NaN Invalid_operation +dqor783 or -Inf -0 -> NaN Invalid_operation +dqor784 or -Inf 0 -> NaN Invalid_operation +dqor785 or -Inf 1 -> NaN Invalid_operation +dqor786 or -Inf 1000 -> NaN Invalid_operation +dqor787 or -1000 -Inf -> NaN Invalid_operation +dqor788 or -Inf -Inf -> NaN Invalid_operation +dqor789 or -1 -Inf -> NaN Invalid_operation +dqor790 or -0 -Inf -> NaN Invalid_operation +dqor791 or 0 -Inf -> NaN Invalid_operation +dqor792 or 1 -Inf -> NaN Invalid_operation +dqor793 or 1000 -Inf -> NaN Invalid_operation +dqor794 or Inf -Inf -> NaN Invalid_operation + +dqor800 or Inf -Inf -> NaN Invalid_operation +dqor801 or Inf -1000 -> NaN Invalid_operation +dqor802 or Inf -1 -> NaN Invalid_operation +dqor803 or Inf -0 -> NaN Invalid_operation +dqor804 or Inf 0 -> NaN Invalid_operation +dqor805 or Inf 1 -> NaN Invalid_operation +dqor806 or Inf 1000 -> NaN Invalid_operation +dqor807 or Inf Inf -> NaN Invalid_operation +dqor808 or -1000 Inf -> NaN Invalid_operation +dqor809 or -Inf Inf -> NaN Invalid_operation +dqor810 or -1 Inf -> NaN Invalid_operation +dqor811 or -0 Inf -> NaN Invalid_operation +dqor812 or 0 Inf -> NaN Invalid_operation +dqor813 or 1 Inf -> NaN Invalid_operation +dqor814 or 1000 Inf -> NaN Invalid_operation +dqor815 or Inf Inf -> NaN Invalid_operation + +dqor821 or NaN -Inf -> NaN Invalid_operation +dqor822 or NaN -1000 -> NaN Invalid_operation +dqor823 or NaN -1 -> NaN Invalid_operation +dqor824 or NaN -0 -> NaN Invalid_operation +dqor825 or NaN 0 -> NaN Invalid_operation +dqor826 or NaN 1 -> NaN Invalid_operation +dqor827 or NaN 1000 -> NaN Invalid_operation +dqor828 or NaN Inf -> NaN Invalid_operation +dqor829 or NaN NaN -> NaN Invalid_operation +dqor830 or -Inf NaN -> NaN Invalid_operation +dqor831 or -1000 NaN -> NaN Invalid_operation +dqor832 or -1 NaN -> NaN Invalid_operation +dqor833 or -0 NaN -> NaN Invalid_operation +dqor834 or 0 NaN -> NaN Invalid_operation +dqor835 or 1 NaN -> NaN Invalid_operation +dqor836 or 1000 NaN -> NaN Invalid_operation +dqor837 or Inf NaN -> NaN Invalid_operation + +dqor841 or sNaN -Inf -> NaN Invalid_operation +dqor842 or sNaN -1000 -> NaN Invalid_operation +dqor843 or sNaN -1 -> NaN Invalid_operation +dqor844 or sNaN -0 -> NaN Invalid_operation +dqor845 or sNaN 0 -> NaN Invalid_operation +dqor846 or sNaN 1 -> NaN Invalid_operation +dqor847 or sNaN 1000 -> NaN Invalid_operation +dqor848 or sNaN NaN -> NaN Invalid_operation +dqor849 or sNaN sNaN -> NaN Invalid_operation +dqor850 or NaN sNaN -> NaN Invalid_operation +dqor851 or -Inf sNaN -> NaN Invalid_operation +dqor852 or -1000 sNaN -> NaN Invalid_operation +dqor853 or -1 sNaN -> NaN Invalid_operation +dqor854 or -0 sNaN -> NaN Invalid_operation +dqor855 or 0 sNaN -> NaN Invalid_operation +dqor856 or 1 sNaN -> NaN Invalid_operation +dqor857 or 1000 sNaN -> NaN Invalid_operation +dqor858 or Inf sNaN -> NaN Invalid_operation +dqor859 or NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqor861 or NaN1 -Inf -> NaN Invalid_operation +dqor862 or +NaN2 -1000 -> NaN Invalid_operation +dqor863 or NaN3 1000 -> NaN Invalid_operation +dqor864 or NaN4 Inf -> NaN Invalid_operation +dqor865 or NaN5 +NaN6 -> NaN Invalid_operation +dqor866 or -Inf NaN7 -> NaN Invalid_operation +dqor867 or -1000 NaN8 -> NaN Invalid_operation +dqor868 or 1000 NaN9 -> NaN Invalid_operation +dqor869 or Inf +NaN10 -> NaN Invalid_operation +dqor871 or sNaN11 -Inf -> NaN Invalid_operation +dqor872 or sNaN12 -1000 -> NaN Invalid_operation +dqor873 or sNaN13 1000 -> NaN Invalid_operation +dqor874 or sNaN14 NaN17 -> NaN Invalid_operation +dqor875 or sNaN15 sNaN18 -> NaN Invalid_operation +dqor876 or NaN16 sNaN19 -> NaN Invalid_operation +dqor877 or -Inf +sNaN20 -> NaN Invalid_operation +dqor878 or -1000 sNaN21 -> NaN Invalid_operation +dqor879 or 1000 sNaN22 -> NaN Invalid_operation +dqor880 or Inf sNaN23 -> NaN Invalid_operation +dqor881 or +NaN25 +sNaN24 -> NaN Invalid_operation +dqor882 or -NaN26 NaN28 -> NaN Invalid_operation +dqor883 or -sNaN27 sNaN29 -> NaN Invalid_operation +dqor884 or 1000 -NaN30 -> NaN Invalid_operation +dqor885 or 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqPlus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqPlus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,88 @@ +------------------------------------------------------------------------ +-- dqPlus.decTest -- decQuad 0+x -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqpls001 plus +7.50 -> 7.50 + +-- Infinities +dqpls011 plus Infinity -> Infinity +dqpls012 plus -Infinity -> -Infinity + +-- NaNs, 0 payload +ddqls021 plus NaN -> NaN +ddqls022 plus -NaN -> -NaN +ddqls023 plus sNaN -> NaN Invalid_operation +ddqls024 plus -sNaN -> -NaN Invalid_operation + +-- NaNs, non-0 payload +ddqls031 plus NaN13 -> NaN13 +ddqls032 plus -NaN13 -> -NaN13 +ddqls033 plus sNaN13 -> NaN13 Invalid_operation +ddqls034 plus -sNaN13 -> -NaN13 Invalid_operation +ddqls035 plus NaN70 -> NaN70 +ddqls036 plus -NaN70 -> -NaN70 +ddqls037 plus sNaN101 -> NaN101 Invalid_operation +ddqls038 plus -sNaN101 -> -NaN101 Invalid_operation + +-- finites +dqpls101 plus 7 -> 7 +dqpls102 plus -7 -> -7 +dqpls103 plus 75 -> 75 +dqpls104 plus -75 -> -75 +dqpls105 plus 7.50 -> 7.50 +dqpls106 plus -7.50 -> -7.50 +dqpls107 plus 7.500 -> 7.500 +dqpls108 plus -7.500 -> -7.500 + +-- zeros +dqpls111 plus 0 -> 0 +dqpls112 plus -0 -> 0 +dqpls113 plus 0E+4 -> 0E+4 +dqpls114 plus -0E+4 -> 0E+4 +dqpls115 plus 0.0000 -> 0.0000 +dqpls116 plus -0.0000 -> 0.0000 +dqpls117 plus 0E-141 -> 0E-141 +dqpls118 plus -0E-141 -> 0E-141 + +-- full coefficients, alternating bits +dqpls121 plus 2682682682682682682682682682682682 -> 2682682682682682682682682682682682 +dqpls122 plus -2682682682682682682682682682682682 -> -2682682682682682682682682682682682 +dqpls123 plus 1341341341341341341341341341341341 -> 1341341341341341341341341341341341 +dqpls124 plus -1341341341341341341341341341341341 -> -1341341341341341341341341341341341 + +-- Nmax, Nmin, Ntiny +dqpls131 plus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqpls132 plus 1E-6143 -> 1E-6143 +dqpls133 plus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143 +dqpls134 plus 1E-6176 -> 1E-6176 Subnormal + +dqpls135 plus -1E-6176 -> -1E-6176 Subnormal +dqpls136 plus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143 +dqpls137 plus -1E-6143 -> -1E-6143 +dqpls138 plus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqQuantize.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqQuantize.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,838 @@ +------------------------------------------------------------------------ +-- dqQuantize.decTest -- decQuad quantize operation -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Most of the tests here assume a "regular pattern", where the +-- sign and coefficient are +1. +-- 2004.03.15 Underflow for quantize is suppressed +-- 2005.06.08 More extensive tests for 'does not fit' +-- [Forked from quantize.decTest 2006.11.25] + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks +dqqua001 quantize 0 1e0 -> 0 +dqqua002 quantize 1 1e0 -> 1 +dqqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded +dqqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded +dqqua006 quantize 0.1 1e0 -> 0 Inexact Rounded +dqqua007 quantize 0.1 1e-1 -> 0.1 +dqqua008 quantize 0.1 1e-2 -> 0.10 +dqqua009 quantize 0.1 1e-3 -> 0.100 +dqqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded +dqqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded +dqqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded +dqqua013 quantize 0.9 1e-1 -> 0.9 +dqqua014 quantize 0.9 1e-2 -> 0.90 +dqqua015 quantize 0.9 1e-3 -> 0.900 +-- negatives +dqqua021 quantize -0 1e0 -> -0 +dqqua022 quantize -1 1e0 -> -1 +dqqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded +dqqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded +dqqua026 quantize -0.1 1e0 -> -0 Inexact Rounded +dqqua027 quantize -0.1 1e-1 -> -0.1 +dqqua028 quantize -0.1 1e-2 -> -0.10 +dqqua029 quantize -0.1 1e-3 -> -0.100 +dqqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +dqqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +dqqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded +dqqua033 quantize -0.9 1e-1 -> -0.9 +dqqua034 quantize -0.9 1e-2 -> -0.90 +dqqua035 quantize -0.9 1e-3 -> -0.900 +dqqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded +dqqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded +dqqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded +dqqua039 quantize -0.5 1e-1 -> -0.5 +dqqua040 quantize -0.5 1e-2 -> -0.50 +dqqua041 quantize -0.5 1e-3 -> -0.500 +dqqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +dqqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +dqqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded +dqqua045 quantize -0.9 1e-1 -> -0.9 +dqqua046 quantize -0.9 1e-2 -> -0.90 +dqqua047 quantize -0.9 1e-3 -> -0.900 + +-- examples from Specification +dqqua060 quantize 2.17 0.001 -> 2.170 +dqqua061 quantize 2.17 0.01 -> 2.17 +dqqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded +dqqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded +dqqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded +dqqua065 quantize -Inf Inf -> -Infinity +dqqua066 quantize 2 Inf -> NaN Invalid_operation +dqqua067 quantize -0.1 1 -> -0 Inexact Rounded +dqqua068 quantize -0 1e+5 -> -0E+5 +dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation +dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation +dqqua071 quantize 217 1e-1 -> 217.0 +dqqua072 quantize 217 1e+0 -> 217 +dqqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded +dqqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded + +-- general tests .. +dqqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded +dqqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded +dqqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded +dqqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded +dqqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded +dqqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded +dqqua095 quantize 1.2345 1e-6 -> 1.234500 +dqqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded +dqqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded +dqqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded +dqqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded +dqqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded + +dqqua101 quantize -1 1e0 -> -1 +dqqua102 quantize -1 1e-1 -> -1.0 +dqqua103 quantize -1 1e-2 -> -1.00 +dqqua104 quantize 0 1e0 -> 0 +dqqua105 quantize 0 1e-1 -> 0.0 +dqqua106 quantize 0 1e-2 -> 0.00 +dqqua107 quantize 0.00 1e0 -> 0 +dqqua108 quantize 0 1e+1 -> 0E+1 +dqqua109 quantize 0 1e+2 -> 0E+2 +dqqua110 quantize +1 1e0 -> 1 +dqqua111 quantize +1 1e-1 -> 1.0 +dqqua112 quantize +1 1e-2 -> 1.00 + +dqqua120 quantize 1.04 1e-3 -> 1.040 +dqqua121 quantize 1.04 1e-2 -> 1.04 +dqqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded +dqqua123 quantize 1.04 1e0 -> 1 Inexact Rounded +dqqua124 quantize 1.05 1e-3 -> 1.050 +dqqua125 quantize 1.05 1e-2 -> 1.05 +dqqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded +dqqua131 quantize 1.05 1e0 -> 1 Inexact Rounded +dqqua132 quantize 1.06 1e-3 -> 1.060 +dqqua133 quantize 1.06 1e-2 -> 1.06 +dqqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded +dqqua135 quantize 1.06 1e0 -> 1 Inexact Rounded + +dqqua140 quantize -10 1e-2 -> -10.00 +dqqua141 quantize +1 1e-2 -> 1.00 +dqqua142 quantize +10 1e-2 -> 10.00 +dqqua143 quantize 1E+37 1e-2 -> NaN Invalid_operation +dqqua144 quantize 1E-37 1e-2 -> 0.00 Inexact Rounded +dqqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded +dqqua146 quantize 1E-2 1e-2 -> 0.01 +dqqua147 quantize 1E-1 1e-2 -> 0.10 +dqqua148 quantize 0E-37 1e-2 -> 0.00 + +dqqua150 quantize 1.0600 1e-5 -> 1.06000 +dqqua151 quantize 1.0600 1e-4 -> 1.0600 +dqqua152 quantize 1.0600 1e-3 -> 1.060 Rounded +dqqua153 quantize 1.0600 1e-2 -> 1.06 Rounded +dqqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded +dqqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded + +-- a couple where rounding was different in base tests +rounding: half_up +dqqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded +dqqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded +dqqua159 quantize 1.06 1e0 -> 1 Inexact Rounded +rounding: half_even + +-- base tests with non-1 coefficients +dqqua161 quantize 0 -9e0 -> 0 +dqqua162 quantize 1 -7e0 -> 1 +dqqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded +dqqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded +dqqua166 quantize 0.1 2e0 -> 0 Inexact Rounded +dqqua167 quantize 0.1 3e-1 -> 0.1 +dqqua168 quantize 0.1 44e-2 -> 0.10 +dqqua169 quantize 0.1 555e-3 -> 0.100 +dqqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded +dqqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded +dqqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded +dqqua173 quantize 0.9 -9e-1 -> 0.9 +dqqua174 quantize 0.9 0e-2 -> 0.90 +dqqua175 quantize 0.9 1.1e-3 -> 0.9000 +-- negatives +dqqua181 quantize -0 1.1e0 -> -0.0 +dqqua182 quantize -1 -1e0 -> -1 +dqqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded +dqqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded +dqqua186 quantize -0.1 71e0 -> -0 Inexact Rounded +dqqua187 quantize -0.1 -91e-1 -> -0.1 +dqqua188 quantize -0.1 -.1e-2 -> -0.100 +dqqua189 quantize -0.1 -1e-3 -> -0.100 +dqqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded +dqqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded +dqqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded +dqqua193 quantize -0.9 100e-1 -> -0.9 +dqqua194 quantize -0.9 999e-2 -> -0.90 + +-- +ve exponents .. +dqqua201 quantize -1 1e+0 -> -1 +dqqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded +dqqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded +dqqua204 quantize 0 1e+0 -> 0 +dqqua205 quantize 0 1e+1 -> 0E+1 +dqqua206 quantize 0 1e+2 -> 0E+2 +dqqua207 quantize +1 1e+0 -> 1 +dqqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded +dqqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded + +dqqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded +dqqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded +dqqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded +dqqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded +dqqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +dqqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +dqqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +dqqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded +dqqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +dqqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +dqqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +dqqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded +dqqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded +dqqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded +dqqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded +dqqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded + +dqqua240 quantize -10 1e+1 -> -1E+1 Rounded +dqqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded +dqqua242 quantize +10 1e+1 -> 1E+1 Rounded +dqqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1 +dqqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1 +dqqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1 +dqqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1 +dqqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1 +dqqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1 +dqqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1 +dqqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1 +dqqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1 +-- next one tries to add 9 zeros +dqqua252 quantize 1E+37 1e+1 -> NaN Invalid_operation +dqqua253 quantize 1E-37 1e+1 -> 0E+1 Inexact Rounded +dqqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded +dqqua255 quantize 0E-37 1e+1 -> 0E+1 +dqqua256 quantize -0E-37 1e+1 -> -0E+1 +dqqua257 quantize -0E-1 1e+1 -> -0E+1 +dqqua258 quantize -0 1e+1 -> -0E+1 +dqqua259 quantize -0E+1 1e+1 -> -0E+1 + +dqqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded +dqqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded +dqqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded +dqqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded +dqqua264 quantize 1E+2 1e+2 -> 1E+2 +dqqua265 quantize 1E+3 1e+2 -> 1.0E+3 +dqqua266 quantize 1E+4 1e+2 -> 1.00E+4 +dqqua267 quantize 1E+5 1e+2 -> 1.000E+5 +dqqua268 quantize 1E+6 1e+2 -> 1.0000E+6 +dqqua269 quantize 1E+7 1e+2 -> 1.00000E+7 +dqqua270 quantize 1E+8 1e+2 -> 1.000000E+8 +dqqua271 quantize 1E+9 1e+2 -> 1.0000000E+9 +dqqua272 quantize 1E+10 1e+2 -> 1.00000000E+10 +dqqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded +dqqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded +dqqua275 quantize 0E-10 1e+2 -> 0E+2 + +dqqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded +dqqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded +dqqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded +dqqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded +dqqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded +dqqua285 quantize 1E+3 1e+3 -> 1E+3 +dqqua286 quantize 1E+4 1e+3 -> 1.0E+4 +dqqua287 quantize 1E+5 1e+3 -> 1.00E+5 +dqqua288 quantize 1E+6 1e+3 -> 1.000E+6 +dqqua289 quantize 1E+7 1e+3 -> 1.0000E+7 +dqqua290 quantize 1E+8 1e+3 -> 1.00000E+8 +dqqua291 quantize 1E+9 1e+3 -> 1.000000E+9 +dqqua292 quantize 1E+10 1e+3 -> 1.0000000E+10 +dqqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded +dqqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded +dqqua295 quantize 0E-10 1e+3 -> 0E+3 + +-- round up from below [sign wrong in JIT compiler once] +dqqua300 quantize 0.0078 1e-5 -> 0.00780 +dqqua301 quantize 0.0078 1e-4 -> 0.0078 +dqqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded +dqqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded +dqqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded +dqqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded +dqqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded +dqqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded + +dqqua310 quantize -0.0078 1e-5 -> -0.00780 +dqqua311 quantize -0.0078 1e-4 -> -0.0078 +dqqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded +dqqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded +dqqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded +dqqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded +dqqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded +dqqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded + +dqqua320 quantize 0.078 1e-5 -> 0.07800 +dqqua321 quantize 0.078 1e-4 -> 0.0780 +dqqua322 quantize 0.078 1e-3 -> 0.078 +dqqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded +dqqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded +dqqua325 quantize 0.078 1e0 -> 0 Inexact Rounded +dqqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded +dqqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded + +dqqua330 quantize -0.078 1e-5 -> -0.07800 +dqqua331 quantize -0.078 1e-4 -> -0.0780 +dqqua332 quantize -0.078 1e-3 -> -0.078 +dqqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded +dqqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded +dqqua335 quantize -0.078 1e0 -> -0 Inexact Rounded +dqqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded +dqqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded + +dqqua340 quantize 0.78 1e-5 -> 0.78000 +dqqua341 quantize 0.78 1e-4 -> 0.7800 +dqqua342 quantize 0.78 1e-3 -> 0.780 +dqqua343 quantize 0.78 1e-2 -> 0.78 +dqqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded +dqqua345 quantize 0.78 1e0 -> 1 Inexact Rounded +dqqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded +dqqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded + +dqqua350 quantize -0.78 1e-5 -> -0.78000 +dqqua351 quantize -0.78 1e-4 -> -0.7800 +dqqua352 quantize -0.78 1e-3 -> -0.780 +dqqua353 quantize -0.78 1e-2 -> -0.78 +dqqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded +dqqua355 quantize -0.78 1e0 -> -1 Inexact Rounded +dqqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded +dqqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded + +dqqua360 quantize 7.8 1e-5 -> 7.80000 +dqqua361 quantize 7.8 1e-4 -> 7.8000 +dqqua362 quantize 7.8 1e-3 -> 7.800 +dqqua363 quantize 7.8 1e-2 -> 7.80 +dqqua364 quantize 7.8 1e-1 -> 7.8 +dqqua365 quantize 7.8 1e0 -> 8 Inexact Rounded +dqqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded +dqqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded +dqqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded + +dqqua370 quantize -7.8 1e-5 -> -7.80000 +dqqua371 quantize -7.8 1e-4 -> -7.8000 +dqqua372 quantize -7.8 1e-3 -> -7.800 +dqqua373 quantize -7.8 1e-2 -> -7.80 +dqqua374 quantize -7.8 1e-1 -> -7.8 +dqqua375 quantize -7.8 1e0 -> -8 Inexact Rounded +dqqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded +dqqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded +dqqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded + +-- some individuals +dqqua380 quantize 1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded +dqqua381 quantize 11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06 +dqqua382 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation +dqqua383 quantize 1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation +dqqua384 quantize -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded +dqqua385 quantize -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06 +dqqua386 quantize -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation +dqqua387 quantize -1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation + +rounding: down +dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation +-- ? should that one instead have been: +-- dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation +rounding: half_up + +-- and a few more from e-mail discussions +dqqua391 quantize 11223344556677889912345678912.34567 1e-3 -> 11223344556677889912345678912.346 Inexact Rounded +dqqua392 quantize 112233445566778899123456789123.4567 1e-3 -> 112233445566778899123456789123.457 Inexact Rounded +dqqua393 quantize 1122334455667788991234567891234567. 1e-3 -> NaN Invalid_operation + +-- some 9999 round-up cases +dqqua400 quantize 9.999 1e-5 -> 9.99900 +dqqua401 quantize 9.999 1e-4 -> 9.9990 +dqqua402 quantize 9.999 1e-3 -> 9.999 +dqqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded +dqqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded +dqqua405 quantize 9.999 1e0 -> 10 Inexact Rounded +dqqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded +dqqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded + +dqqua410 quantize 0.999 1e-5 -> 0.99900 +dqqua411 quantize 0.999 1e-4 -> 0.9990 +dqqua412 quantize 0.999 1e-3 -> 0.999 +dqqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded +dqqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded +dqqua415 quantize 0.999 1e0 -> 1 Inexact Rounded +dqqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded + +dqqua420 quantize 0.0999 1e-5 -> 0.09990 +dqqua421 quantize 0.0999 1e-4 -> 0.0999 +dqqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded +dqqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded +dqqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded +dqqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded +dqqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded + +dqqua430 quantize 0.00999 1e-5 -> 0.00999 +dqqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded +dqqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded +dqqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded +dqqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded +dqqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded +dqqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded + +dqqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded +dqqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded +dqqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded +dqqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded +dqqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded +dqqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded +dqqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded + +dqqua1001 quantize 0.000 0.001 -> 0.000 +dqqua1002 quantize 0.001 0.001 -> 0.001 +dqqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded +dqqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded +dqqua1005 quantize 0.501 0.001 -> 0.501 +dqqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded +dqqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded +dqqua1008 quantize 0.999 0.001 -> 0.999 + +dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +dqqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +dqqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +dqqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +dqqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +-- a potential double-round +dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +dqqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +dqqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +dqqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +dqqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +-- Zeros +dqqua500 quantize 0 1e1 -> 0E+1 +dqqua501 quantize 0 1e0 -> 0 +dqqua502 quantize 0 1e-1 -> 0.0 +dqqua503 quantize 0.0 1e-1 -> 0.0 +dqqua504 quantize 0.0 1e0 -> 0 +dqqua505 quantize 0.0 1e+1 -> 0E+1 +dqqua506 quantize 0E+1 1e-1 -> 0.0 +dqqua507 quantize 0E+1 1e0 -> 0 +dqqua508 quantize 0E+1 1e+1 -> 0E+1 +dqqua509 quantize -0 1e1 -> -0E+1 +dqqua510 quantize -0 1e0 -> -0 +dqqua511 quantize -0 1e-1 -> -0.0 +dqqua512 quantize -0.0 1e-1 -> -0.0 +dqqua513 quantize -0.0 1e0 -> -0 +dqqua514 quantize -0.0 1e+1 -> -0E+1 +dqqua515 quantize -0E+1 1e-1 -> -0.0 +dqqua516 quantize -0E+1 1e0 -> -0 +dqqua517 quantize -0E+1 1e+1 -> -0E+1 +-- #519 here once a problem +dqqua518 quantize 0 0E-3 -> 0.000 +dqqua519 quantize 0 0E-33 -> 0E-33 +dqqua520 quantize 0.00000000000000000000000000000000 0E-33 -> 0E-33 +dqqua521 quantize 0.000000000000000000000000000000000 0E-33 -> 0E-33 + +-- Some non-zeros with lots of padding on the right +dqqua523 quantize 1 0E-33 -> 1.000000000000000000000000000000000 +dqqua524 quantize 12 0E-32 -> 12.00000000000000000000000000000000 +dqqua525 quantize 123 0E-31 -> 123.0000000000000000000000000000000 +dqqua526 quantize 123 0E-32 -> NaN Invalid_operation +dqqua527 quantize 123.4 0E-31 -> 123.4000000000000000000000000000000 +dqqua528 quantize 123.4 0E-32 -> NaN Invalid_operation + +-- Suspicious RHS values +dqqua530 quantize 1.234 1e359 -> 0E+359 Inexact Rounded +dqqua531 quantize 123.456 1e359 -> 0E+359 Inexact Rounded +dqqua532 quantize 1.234 1e359 -> 0E+359 Inexact Rounded +dqqua533 quantize 123.456 1e359 -> 0E+359 Inexact Rounded +-- next four are "won't fit" overflows +dqqua536 quantize 1.234 1e-299 -> NaN Invalid_operation +dqqua537 quantize 123.456 1e-299 -> NaN Invalid_operation +dqqua538 quantize 1.234 1e-299 -> NaN Invalid_operation +dqqua539 quantize 123.456 1e-299 -> NaN Invalid_operation + +dqqua542 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded +dqqua543 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded +dqqua544 quantize 1.234 1e299 -> 0E+299 Inexact Rounded +dqqua547 quantize 0 1e-299 -> 0E-299 +-- next two are "won't fit" overflows +dqqua548 quantize 1.234 1e-299 -> NaN Invalid_operation +dqqua549 quantize 1.234 1e-300 -> NaN Invalid_operation +-- [more below] + +-- Specials +dqqua580 quantize Inf -Inf -> Infinity +dqqua581 quantize Inf 1e-299 -> NaN Invalid_operation +dqqua582 quantize Inf 1e-1 -> NaN Invalid_operation +dqqua583 quantize Inf 1e0 -> NaN Invalid_operation +dqqua584 quantize Inf 1e1 -> NaN Invalid_operation +dqqua585 quantize Inf 1e299 -> NaN Invalid_operation +dqqua586 quantize Inf Inf -> Infinity +dqqua587 quantize -1000 Inf -> NaN Invalid_operation +dqqua588 quantize -Inf Inf -> -Infinity +dqqua589 quantize -1 Inf -> NaN Invalid_operation +dqqua590 quantize 0 Inf -> NaN Invalid_operation +dqqua591 quantize 1 Inf -> NaN Invalid_operation +dqqua592 quantize 1000 Inf -> NaN Invalid_operation +dqqua593 quantize Inf Inf -> Infinity +dqqua594 quantize Inf 1e-0 -> NaN Invalid_operation +dqqua595 quantize -0 Inf -> NaN Invalid_operation + +dqqua600 quantize -Inf -Inf -> -Infinity +dqqua601 quantize -Inf 1e-299 -> NaN Invalid_operation +dqqua602 quantize -Inf 1e-1 -> NaN Invalid_operation +dqqua603 quantize -Inf 1e0 -> NaN Invalid_operation +dqqua604 quantize -Inf 1e1 -> NaN Invalid_operation +dqqua605 quantize -Inf 1e299 -> NaN Invalid_operation +dqqua606 quantize -Inf Inf -> -Infinity +dqqua607 quantize -1000 Inf -> NaN Invalid_operation +dqqua608 quantize -Inf -Inf -> -Infinity +dqqua609 quantize -1 -Inf -> NaN Invalid_operation +dqqua610 quantize 0 -Inf -> NaN Invalid_operation +dqqua611 quantize 1 -Inf -> NaN Invalid_operation +dqqua612 quantize 1000 -Inf -> NaN Invalid_operation +dqqua613 quantize Inf -Inf -> Infinity +dqqua614 quantize -Inf 1e-0 -> NaN Invalid_operation +dqqua615 quantize -0 -Inf -> NaN Invalid_operation + +dqqua621 quantize NaN -Inf -> NaN +dqqua622 quantize NaN 1e-299 -> NaN +dqqua623 quantize NaN 1e-1 -> NaN +dqqua624 quantize NaN 1e0 -> NaN +dqqua625 quantize NaN 1e1 -> NaN +dqqua626 quantize NaN 1e299 -> NaN +dqqua627 quantize NaN Inf -> NaN +dqqua628 quantize NaN NaN -> NaN +dqqua629 quantize -Inf NaN -> NaN +dqqua630 quantize -1000 NaN -> NaN +dqqua631 quantize -1 NaN -> NaN +dqqua632 quantize 0 NaN -> NaN +dqqua633 quantize 1 NaN -> NaN +dqqua634 quantize 1000 NaN -> NaN +dqqua635 quantize Inf NaN -> NaN +dqqua636 quantize NaN 1e-0 -> NaN +dqqua637 quantize -0 NaN -> NaN + +dqqua641 quantize sNaN -Inf -> NaN Invalid_operation +dqqua642 quantize sNaN 1e-299 -> NaN Invalid_operation +dqqua643 quantize sNaN 1e-1 -> NaN Invalid_operation +dqqua644 quantize sNaN 1e0 -> NaN Invalid_operation +dqqua645 quantize sNaN 1e1 -> NaN Invalid_operation +dqqua646 quantize sNaN 1e299 -> NaN Invalid_operation +dqqua647 quantize sNaN NaN -> NaN Invalid_operation +dqqua648 quantize sNaN sNaN -> NaN Invalid_operation +dqqua649 quantize NaN sNaN -> NaN Invalid_operation +dqqua650 quantize -Inf sNaN -> NaN Invalid_operation +dqqua651 quantize -1000 sNaN -> NaN Invalid_operation +dqqua652 quantize -1 sNaN -> NaN Invalid_operation +dqqua653 quantize 0 sNaN -> NaN Invalid_operation +dqqua654 quantize 1 sNaN -> NaN Invalid_operation +dqqua655 quantize 1000 sNaN -> NaN Invalid_operation +dqqua656 quantize Inf sNaN -> NaN Invalid_operation +dqqua657 quantize NaN sNaN -> NaN Invalid_operation +dqqua658 quantize sNaN 1e-0 -> NaN Invalid_operation +dqqua659 quantize -0 sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqqua661 quantize NaN9 -Inf -> NaN9 +dqqua662 quantize NaN8 919 -> NaN8 +dqqua663 quantize NaN71 Inf -> NaN71 +dqqua664 quantize NaN6 NaN5 -> NaN6 +dqqua665 quantize -Inf NaN4 -> NaN4 +dqqua666 quantize -919 NaN31 -> NaN31 +dqqua667 quantize Inf NaN2 -> NaN2 + +dqqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation +dqqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation +dqqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation +dqqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation +dqqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation +dqqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation +dqqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation +dqqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation +dqqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation + +dqqua681 quantize -NaN9 -Inf -> -NaN9 +dqqua682 quantize -NaN8 919 -> -NaN8 +dqqua683 quantize -NaN71 Inf -> -NaN71 +dqqua684 quantize -NaN6 -NaN5 -> -NaN6 +dqqua685 quantize -Inf -NaN4 -> -NaN4 +dqqua686 quantize -919 -NaN31 -> -NaN31 +dqqua687 quantize Inf -NaN2 -> -NaN2 + +dqqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation +dqqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation +dqqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation +dqqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation +dqqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation +dqqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation +dqqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation +dqqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation +dqqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation + +-- subnormals and underflow +dqqua710 quantize 1.00E-6143 1e-6143 -> 1E-6143 Rounded +dqqua711 quantize 0.1E-6143 2e-6144 -> 1E-6144 Subnormal +dqqua712 quantize 0.10E-6143 3e-6144 -> 1E-6144 Subnormal Rounded +dqqua713 quantize 0.100E-6143 4e-6144 -> 1E-6144 Subnormal Rounded +dqqua714 quantize 0.01E-6143 5e-6145 -> 1E-6145 Subnormal +-- next is rounded to Emin +dqqua715 quantize 0.999E-6143 1e-6143 -> 1E-6143 Inexact Rounded +dqqua716 quantize 0.099E-6143 10e-6144 -> 1E-6144 Inexact Rounded Subnormal + +dqqua717 quantize 0.009E-6143 1e-6145 -> 1E-6145 Inexact Rounded Subnormal +dqqua718 quantize 0.001E-6143 1e-6145 -> 0E-6145 Inexact Rounded +dqqua719 quantize 0.0009E-6143 1e-6145 -> 0E-6145 Inexact Rounded +dqqua720 quantize 0.0001E-6143 1e-6145 -> 0E-6145 Inexact Rounded + +dqqua730 quantize -1.00E-6143 1e-6143 -> -1E-6143 Rounded +dqqua731 quantize -0.1E-6143 1e-6143 -> -0E-6143 Rounded Inexact +dqqua732 quantize -0.10E-6143 1e-6143 -> -0E-6143 Rounded Inexact +dqqua733 quantize -0.100E-6143 1e-6143 -> -0E-6143 Rounded Inexact +dqqua734 quantize -0.01E-6143 1e-6143 -> -0E-6143 Inexact Rounded +-- next is rounded to Emin +dqqua735 quantize -0.999E-6143 90e-6143 -> -1E-6143 Inexact Rounded +dqqua736 quantize -0.099E-6143 -1e-6143 -> -0E-6143 Inexact Rounded +dqqua737 quantize -0.009E-6143 -1e-6143 -> -0E-6143 Inexact Rounded +dqqua738 quantize -0.001E-6143 -0e-6143 -> -0E-6143 Inexact Rounded +dqqua739 quantize -0.0001E-6143 0e-6143 -> -0E-6143 Inexact Rounded + +dqqua740 quantize -1.00E-6143 1e-6144 -> -1.0E-6143 Rounded +dqqua741 quantize -0.1E-6143 1e-6144 -> -1E-6144 Subnormal +dqqua742 quantize -0.10E-6143 1e-6144 -> -1E-6144 Subnormal Rounded +dqqua743 quantize -0.100E-6143 1e-6144 -> -1E-6144 Subnormal Rounded +dqqua744 quantize -0.01E-6143 1e-6144 -> -0E-6144 Inexact Rounded +-- next is rounded to Emin +dqqua745 quantize -0.999E-6143 1e-6144 -> -1.0E-6143 Inexact Rounded +dqqua746 quantize -0.099E-6143 1e-6144 -> -1E-6144 Inexact Rounded Subnormal +dqqua747 quantize -0.009E-6143 1e-6144 -> -0E-6144 Inexact Rounded +dqqua748 quantize -0.001E-6143 1e-6144 -> -0E-6144 Inexact Rounded +dqqua749 quantize -0.0001E-6143 1e-6144 -> -0E-6144 Inexact Rounded + +dqqua750 quantize -1.00E-6143 1e-6145 -> -1.00E-6143 +dqqua751 quantize -0.1E-6143 1e-6145 -> -1.0E-6144 Subnormal +dqqua752 quantize -0.10E-6143 1e-6145 -> -1.0E-6144 Subnormal +dqqua753 quantize -0.100E-6143 1e-6145 -> -1.0E-6144 Subnormal Rounded +dqqua754 quantize -0.01E-6143 1e-6145 -> -1E-6145 Subnormal +-- next is rounded to Emin +dqqua755 quantize -0.999E-6143 1e-6145 -> -1.00E-6143 Inexact Rounded +dqqua756 quantize -0.099E-6143 1e-6145 -> -1.0E-6144 Inexact Rounded Subnormal +dqqua757 quantize -0.009E-6143 1e-6145 -> -1E-6145 Inexact Rounded Subnormal +dqqua758 quantize -0.001E-6143 1e-6145 -> -0E-6145 Inexact Rounded +dqqua759 quantize -0.0001E-6143 1e-6145 -> -0E-6145 Inexact Rounded + +dqqua760 quantize -1.00E-6143 1e-6146 -> -1.000E-6143 +dqqua761 quantize -0.1E-6143 1e-6146 -> -1.00E-6144 Subnormal +dqqua762 quantize -0.10E-6143 1e-6146 -> -1.00E-6144 Subnormal +dqqua763 quantize -0.100E-6143 1e-6146 -> -1.00E-6144 Subnormal +dqqua764 quantize -0.01E-6143 1e-6146 -> -1.0E-6145 Subnormal +dqqua765 quantize -0.999E-6143 1e-6146 -> -9.99E-6144 Subnormal +dqqua766 quantize -0.099E-6143 1e-6146 -> -9.9E-6145 Subnormal +dqqua767 quantize -0.009E-6143 1e-6146 -> -9E-6146 Subnormal +dqqua768 quantize -0.001E-6143 1e-6146 -> -1E-6146 Subnormal +dqqua769 quantize -0.0001E-6143 1e-6146 -> -0E-6146 Inexact Rounded + +-- More from Fung Lee +-- the next four would appear to be in error, but they are misleading (the +-- operands will be clamped to a lower exponent) and so are omitted +-- dqqua1021 quantize 8.666666666666000E+6144 1.000000000000000E+6144 -> 8.666666666666000000000000000000000E+6144 Clamped +-- dqqua1022 quantize -8.666666666666000E+6144 1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144 Clamped +-- dqqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation +-- dqqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded + +-- Int and uInt32 edge values for testing conversions +dqqua1040 quantize -2147483646 0 -> -2147483646 +dqqua1041 quantize -2147483647 0 -> -2147483647 +dqqua1042 quantize -2147483648 0 -> -2147483648 +dqqua1043 quantize -2147483649 0 -> -2147483649 +dqqua1044 quantize 2147483646 0 -> 2147483646 +dqqua1045 quantize 2147483647 0 -> 2147483647 +dqqua1046 quantize 2147483648 0 -> 2147483648 +dqqua1047 quantize 2147483649 0 -> 2147483649 +dqqua1048 quantize 4294967294 0 -> 4294967294 +dqqua1049 quantize 4294967295 0 -> 4294967295 +dqqua1050 quantize 4294967296 0 -> 4294967296 +dqqua1051 quantize 4294967297 0 -> 4294967297 + +-- Rounding swathe +rounding: half_even +dqqua1100 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +dqqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +dqqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +dqqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +dqqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +dqqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +dqqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +dqqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +dqqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded + +rounding: half_up +dqqua1200 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +dqqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +dqqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +dqqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +dqqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded +dqqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +dqqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +dqqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +dqqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded + +rounding: half_down +dqqua1300 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +dqqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +dqqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded +dqqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +dqqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +dqqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +dqqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +dqqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +dqqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded + +rounding: up +dqqua1400 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded +dqqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded +dqqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +dqqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +dqqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded +dqqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +dqqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +dqqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +dqqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded +dqqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded + +rounding: down +dqqua1500 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +dqqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +dqqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded +dqqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded +dqqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +dqqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded +dqqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded +dqqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded +dqqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded +dqqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded + +rounding: ceiling +dqqua1600 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded +dqqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded +dqqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded +dqqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded +dqqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded +dqqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded +dqqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded +dqqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded +dqqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded +dqqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded + +rounding: floor +dqqua1700 quantize 1.2300 1.00 -> 1.23 Rounded +dqqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded +dqqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded +dqqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded +dqqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded +dqqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +dqqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded +dqqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded +dqqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded +dqqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded +dqqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded + +rounding: 05up +dqqua1800 quantize 1.2000 1.00 -> 1.20 Rounded +dqqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded +dqqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded +dqqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded +dqqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded +dqqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded +dqqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded +dqqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded +dqqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded + +dqqua1900 quantize 1.2100 1.00 -> 1.21 Rounded +dqqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded +dqqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded +dqqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded +dqqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded +dqqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded +dqqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded +dqqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded +dqqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded + +dqqua2000 quantize 1.2400 1.00 -> 1.24 Rounded +dqqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded +dqqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded +dqqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded +dqqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded +dqqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded +dqqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded +dqqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded +dqqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded + +dqqua2100 quantize 1.2500 1.00 -> 1.25 Rounded +dqqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded +dqqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded +dqqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded +dqqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded +dqqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded +dqqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded +dqqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded +dqqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded + +dqqua2200 quantize 1.2600 1.00 -> 1.26 Rounded +dqqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded +dqqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded +dqqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded +dqqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded +dqqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded +dqqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded +dqqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded +dqqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded + +dqqua2300 quantize 1.2900 1.00 -> 1.29 Rounded +dqqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded +dqqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded +dqqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded +dqqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded +dqqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded +dqqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded +dqqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded +dqqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded + +-- Null tests +dqqua998 quantize 10 # -> NaN Invalid_operation +dqqua999 quantize # 1e10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqReduce.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqReduce.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,183 @@ +------------------------------------------------------------------------ +-- dqReduce.decTest -- remove trailing zeros from a decQuad -- +-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ + +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqred001 reduce '1' -> '1' +dqred002 reduce '-1' -> '-1' +dqred003 reduce '1.00' -> '1' +dqred004 reduce '-1.00' -> '-1' +dqred005 reduce '0' -> '0' +dqred006 reduce '0.00' -> '0' +dqred007 reduce '00.0' -> '0' +dqred008 reduce '00.00' -> '0' +dqred009 reduce '00' -> '0' +dqred010 reduce '0E+1' -> '0' +dqred011 reduce '0E+5' -> '0' + +dqred012 reduce '-2' -> '-2' +dqred013 reduce '2' -> '2' +dqred014 reduce '-2.00' -> '-2' +dqred015 reduce '2.00' -> '2' +dqred016 reduce '-0' -> '-0' +dqred017 reduce '-0.00' -> '-0' +dqred018 reduce '-00.0' -> '-0' +dqred019 reduce '-00.00' -> '-0' +dqred020 reduce '-00' -> '-0' +dqred021 reduce '-0E+5' -> '-0' +dqred022 reduce '-0E+1' -> '-0' + +dqred030 reduce '+0.1' -> '0.1' +dqred031 reduce '-0.1' -> '-0.1' +dqred032 reduce '+0.01' -> '0.01' +dqred033 reduce '-0.01' -> '-0.01' +dqred034 reduce '+0.001' -> '0.001' +dqred035 reduce '-0.001' -> '-0.001' +dqred036 reduce '+0.000001' -> '0.000001' +dqred037 reduce '-0.000001' -> '-0.000001' +dqred038 reduce '+0.000000000001' -> '1E-12' +dqred039 reduce '-0.000000000001' -> '-1E-12' + +dqred041 reduce 1.1 -> 1.1 +dqred042 reduce 1.10 -> 1.1 +dqred043 reduce 1.100 -> 1.1 +dqred044 reduce 1.110 -> 1.11 +dqred045 reduce -1.1 -> -1.1 +dqred046 reduce -1.10 -> -1.1 +dqred047 reduce -1.100 -> -1.1 +dqred048 reduce -1.110 -> -1.11 +dqred049 reduce 9.9 -> 9.9 +dqred050 reduce 9.90 -> 9.9 +dqred051 reduce 9.900 -> 9.9 +dqred052 reduce 9.990 -> 9.99 +dqred053 reduce -9.9 -> -9.9 +dqred054 reduce -9.90 -> -9.9 +dqred055 reduce -9.900 -> -9.9 +dqred056 reduce -9.990 -> -9.99 + +-- some trailing fractional zeros with zeros in units +dqred060 reduce 10.0 -> 1E+1 +dqred061 reduce 10.00 -> 1E+1 +dqred062 reduce 100.0 -> 1E+2 +dqred063 reduce 100.00 -> 1E+2 +dqred064 reduce 1.1000E+3 -> 1.1E+3 +dqred065 reduce 1.10000E+3 -> 1.1E+3 +dqred066 reduce -10.0 -> -1E+1 +dqred067 reduce -10.00 -> -1E+1 +dqred068 reduce -100.0 -> -1E+2 +dqred069 reduce -100.00 -> -1E+2 +dqred070 reduce -1.1000E+3 -> -1.1E+3 +dqred071 reduce -1.10000E+3 -> -1.1E+3 + +-- some insignificant trailing zeros with positive exponent +dqred080 reduce 10E+1 -> 1E+2 +dqred081 reduce 100E+1 -> 1E+3 +dqred082 reduce 1.0E+2 -> 1E+2 +dqred083 reduce 1.0E+3 -> 1E+3 +dqred084 reduce 1.1E+3 -> 1.1E+3 +dqred085 reduce 1.00E+3 -> 1E+3 +dqred086 reduce 1.10E+3 -> 1.1E+3 +dqred087 reduce -10E+1 -> -1E+2 +dqred088 reduce -100E+1 -> -1E+3 +dqred089 reduce -1.0E+2 -> -1E+2 +dqred090 reduce -1.0E+3 -> -1E+3 +dqred091 reduce -1.1E+3 -> -1.1E+3 +dqred092 reduce -1.00E+3 -> -1E+3 +dqred093 reduce -1.10E+3 -> -1.1E+3 + +-- some significant trailing zeros, were we to be trimming +dqred100 reduce 11 -> 11 +dqred101 reduce 10 -> 1E+1 +dqred102 reduce 10. -> 1E+1 +dqred103 reduce 1.1E+1 -> 11 +dqred104 reduce 1.0E+1 -> 1E+1 +dqred105 reduce 1.10E+2 -> 1.1E+2 +dqred106 reduce 1.00E+2 -> 1E+2 +dqred107 reduce 1.100E+3 -> 1.1E+3 +dqred108 reduce 1.000E+3 -> 1E+3 +dqred109 reduce 1.000000E+6 -> 1E+6 +dqred110 reduce -11 -> -11 +dqred111 reduce -10 -> -1E+1 +dqred112 reduce -10. -> -1E+1 +dqred113 reduce -1.1E+1 -> -11 +dqred114 reduce -1.0E+1 -> -1E+1 +dqred115 reduce -1.10E+2 -> -1.1E+2 +dqred116 reduce -1.00E+2 -> -1E+2 +dqred117 reduce -1.100E+3 -> -1.1E+3 +dqred118 reduce -1.000E+3 -> -1E+3 +dqred119 reduce -1.00000E+5 -> -1E+5 +dqred120 reduce -1.000000E+6 -> -1E+6 +dqred121 reduce -10.00000E+6 -> -1E+7 +dqred122 reduce -100.0000E+6 -> -1E+8 +dqred123 reduce -1000.000E+6 -> -1E+9 +dqred124 reduce -10000.00E+6 -> -1E+10 +dqred125 reduce -100000.0E+6 -> -1E+11 +dqred126 reduce -1000000.E+6 -> -1E+12 + +-- examples from decArith +dqred140 reduce '2.1' -> '2.1' +dqred141 reduce '-2.0' -> '-2' +dqred142 reduce '1.200' -> '1.2' +dqred143 reduce '-120' -> '-1.2E+2' +dqred144 reduce '120.00' -> '1.2E+2' +dqred145 reduce '0.00' -> '0' + +-- Nmax, Nmin, Ntiny +-- note origami effect on some of these +dqred151 reduce 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144 +dqred152 reduce 9.999999999999999999999999000000000E+6140 -> 9.99999999999999999999999900000E+6140 +dqred153 reduce 9.999999999999999999999999999990000E+6144 -> 9.999999999999999999999999999990000E+6144 +dqred154 reduce 1E-6143 -> 1E-6143 +dqred155 reduce 1.000000000000000000000000000000000E-6143 -> 1E-6143 +dqred156 reduce 2.000E-6173 -> 2E-6173 Subnormal +dqred157 reduce 1E-6176 -> 1E-6176 Subnormal + +dqred161 reduce -1E-6176 -> -1E-6176 Subnormal +dqred162 reduce -2.000E-6173 -> -2E-6173 Subnormal +dqred163 reduce -1.000000000000000000000000000000000E-6143 -> -1E-6143 +dqred164 reduce -1E-6143 -> -1E-6143 +dqred165 reduce -9.999999999999999999999999000000000E+6140 -> -9.99999999999999999999999900000E+6140 +dqred166 reduce -9.999999999999999999999999999990000E+6144 -> -9.999999999999999999999999999990000E+6144 +dqred167 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144 +dqred168 reduce -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144 +dqred169 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144 + + +-- specials (reduce does not affect payload) +dqred820 reduce 'Inf' -> 'Infinity' +dqred821 reduce '-Inf' -> '-Infinity' +dqred822 reduce NaN -> NaN +dqred823 reduce sNaN -> NaN Invalid_operation +dqred824 reduce NaN101 -> NaN101 +dqred825 reduce sNaN010 -> NaN10 Invalid_operation +dqred827 reduce -NaN -> -NaN +dqred828 reduce -sNaN -> -NaN Invalid_operation +dqred829 reduce -NaN101 -> -NaN101 +dqred830 reduce -sNaN010 -> -NaN10 Invalid_operation + +-- Null test +dqred900 reduce # -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRemainder.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRemainder.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,597 @@ +------------------------------------------------------------------------ +-- dqRemainder.decTest -- decQuad remainder -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks (as base, above) +dqrem001 remainder 1 1 -> 0 +dqrem002 remainder 2 1 -> 0 +dqrem003 remainder 1 2 -> 1 +dqrem004 remainder 2 2 -> 0 +dqrem005 remainder 0 1 -> 0 +dqrem006 remainder 0 2 -> 0 +dqrem007 remainder 1 3 -> 1 +dqrem008 remainder 2 3 -> 2 +dqrem009 remainder 3 3 -> 0 + +dqrem010 remainder 2.4 1 -> 0.4 +dqrem011 remainder 2.4 -1 -> 0.4 +dqrem012 remainder -2.4 1 -> -0.4 +dqrem013 remainder -2.4 -1 -> -0.4 +dqrem014 remainder 2.40 1 -> 0.40 +dqrem015 remainder 2.400 1 -> 0.400 +dqrem016 remainder 2.4 2 -> 0.4 +dqrem017 remainder 2.400 2 -> 0.400 +dqrem018 remainder 2. 2 -> 0 +dqrem019 remainder 20 20 -> 0 + +dqrem020 remainder 187 187 -> 0 +dqrem021 remainder 5 2 -> 1 +dqrem022 remainder 5 2.0 -> 1.0 +dqrem023 remainder 5 2.000 -> 1.000 +dqrem024 remainder 5 0.200 -> 0.000 +dqrem025 remainder 5 0.200 -> 0.000 + +dqrem030 remainder 1 2 -> 1 +dqrem031 remainder 1 4 -> 1 +dqrem032 remainder 1 8 -> 1 + +dqrem033 remainder 1 16 -> 1 +dqrem034 remainder 1 32 -> 1 +dqrem035 remainder 1 64 -> 1 +dqrem040 remainder 1 -2 -> 1 +dqrem041 remainder 1 -4 -> 1 +dqrem042 remainder 1 -8 -> 1 +dqrem043 remainder 1 -16 -> 1 +dqrem044 remainder 1 -32 -> 1 +dqrem045 remainder 1 -64 -> 1 +dqrem050 remainder -1 2 -> -1 +dqrem051 remainder -1 4 -> -1 +dqrem052 remainder -1 8 -> -1 +dqrem053 remainder -1 16 -> -1 +dqrem054 remainder -1 32 -> -1 +dqrem055 remainder -1 64 -> -1 +dqrem060 remainder -1 -2 -> -1 +dqrem061 remainder -1 -4 -> -1 +dqrem062 remainder -1 -8 -> -1 +dqrem063 remainder -1 -16 -> -1 +dqrem064 remainder -1 -32 -> -1 +dqrem065 remainder -1 -64 -> -1 + +dqrem066 remainder 999999999 1 -> 0 +dqrem067 remainder 999999999.4 1 -> 0.4 +dqrem068 remainder 999999999.5 1 -> 0.5 +dqrem069 remainder 999999999.9 1 -> 0.9 +dqrem070 remainder 999999999.999 1 -> 0.999 +dqrem071 remainder 999999.999999 1 -> 0.999999 +dqrem072 remainder 9 1 -> 0 + +dqrem080 remainder 0. 1 -> 0 +dqrem081 remainder .0 1 -> 0.0 +dqrem082 remainder 0.00 1 -> 0.00 +dqrem083 remainder 0.00E+9 1 -> 0 +dqrem084 remainder 0.00E+3 1 -> 0 +dqrem085 remainder 0.00E+2 1 -> 0 +dqrem086 remainder 0.00E+1 1 -> 0.0 +dqrem087 remainder 0.00E+0 1 -> 0.00 +dqrem088 remainder 0.00E-0 1 -> 0.00 +dqrem089 remainder 0.00E-1 1 -> 0.000 +dqrem090 remainder 0.00E-2 1 -> 0.0000 +dqrem091 remainder 0.00E-3 1 -> 0.00000 +dqrem092 remainder 0.00E-4 1 -> 0.000000 +dqrem093 remainder 0.00E-5 1 -> 0E-7 +dqrem094 remainder 0.00E-6 1 -> 0E-8 +dqrem095 remainder 0.0000E-50 1 -> 0E-54 + +-- Various flavours of remainder by 0 +dqrem101 remainder 0 0 -> NaN Division_undefined +dqrem102 remainder 0 -0 -> NaN Division_undefined +dqrem103 remainder -0 0 -> NaN Division_undefined +dqrem104 remainder -0 -0 -> NaN Division_undefined +dqrem105 remainder 0.0E5 0 -> NaN Division_undefined +dqrem106 remainder 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, but +-- IEEE 854 is explicit that it is Invalid operation .. for +-- remainder-near, anyway] +dqrem107 remainder 0.0001 0 -> NaN Invalid_operation +dqrem108 remainder 0.01 0 -> NaN Invalid_operation +dqrem109 remainder 0.1 0 -> NaN Invalid_operation +dqrem110 remainder 1 0 -> NaN Invalid_operation +dqrem111 remainder 1 0.0 -> NaN Invalid_operation +dqrem112 remainder 10 0.0 -> NaN Invalid_operation +dqrem113 remainder 1E+100 0.0 -> NaN Invalid_operation +dqrem114 remainder 1E+380 0 -> NaN Invalid_operation +dqrem115 remainder 0.0001 -0 -> NaN Invalid_operation +dqrem116 remainder 0.01 -0 -> NaN Invalid_operation +dqrem119 remainder 0.1 -0 -> NaN Invalid_operation +dqrem120 remainder 1 -0 -> NaN Invalid_operation +dqrem121 remainder 1 -0.0 -> NaN Invalid_operation +dqrem122 remainder 10 -0.0 -> NaN Invalid_operation +dqrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation +dqrem124 remainder 1E+384 -0 -> NaN Invalid_operation +-- and zeros on left +dqrem130 remainder 0 1 -> 0 +dqrem131 remainder 0 -1 -> 0 +dqrem132 remainder 0.0 1 -> 0.0 +dqrem133 remainder 0.0 -1 -> 0.0 +dqrem134 remainder -0 1 -> -0 +dqrem135 remainder -0 -1 -> -0 +dqrem136 remainder -0.0 1 -> -0.0 +dqrem137 remainder -0.0 -1 -> -0.0 + +-- 0.5ers +dqrem143 remainder 0.5 2 -> 0.5 +dqrem144 remainder 0.5 2.1 -> 0.5 +dqrem145 remainder 0.5 2.01 -> 0.50 +dqrem146 remainder 0.5 2.001 -> 0.500 +dqrem147 remainder 0.50 2 -> 0.50 +dqrem148 remainder 0.50 2.01 -> 0.50 +dqrem149 remainder 0.50 2.001 -> 0.500 + +-- steadies +dqrem150 remainder 1 1 -> 0 +dqrem151 remainder 1 2 -> 1 +dqrem152 remainder 1 3 -> 1 +dqrem153 remainder 1 4 -> 1 +dqrem154 remainder 1 5 -> 1 +dqrem155 remainder 1 6 -> 1 +dqrem156 remainder 1 7 -> 1 +dqrem157 remainder 1 8 -> 1 +dqrem158 remainder 1 9 -> 1 +dqrem159 remainder 1 10 -> 1 +dqrem160 remainder 1 1 -> 0 +dqrem161 remainder 2 1 -> 0 +dqrem162 remainder 3 1 -> 0 +dqrem163 remainder 4 1 -> 0 +dqrem164 remainder 5 1 -> 0 +dqrem165 remainder 6 1 -> 0 +dqrem166 remainder 7 1 -> 0 +dqrem167 remainder 8 1 -> 0 +dqrem168 remainder 9 1 -> 0 +dqrem169 remainder 10 1 -> 0 + +-- some differences from remainderNear +dqrem171 remainder 0.4 1.020 -> 0.400 +dqrem172 remainder 0.50 1.020 -> 0.500 +dqrem173 remainder 0.51 1.020 -> 0.510 +dqrem174 remainder 0.52 1.020 -> 0.520 +dqrem175 remainder 0.6 1.020 -> 0.600 + +-- More flavours of remainder by 0 +dqrem201 remainder 0 0 -> NaN Division_undefined +dqrem202 remainder 0.0E5 0 -> NaN Division_undefined +dqrem203 remainder 0.000 0 -> NaN Division_undefined +dqrem204 remainder 0.0001 0 -> NaN Invalid_operation +dqrem205 remainder 0.01 0 -> NaN Invalid_operation +dqrem206 remainder 0.1 0 -> NaN Invalid_operation +dqrem207 remainder 1 0 -> NaN Invalid_operation +dqrem208 remainder 1 0.0 -> NaN Invalid_operation +dqrem209 remainder 10 0.0 -> NaN Invalid_operation +dqrem210 remainder 1E+100 0.0 -> NaN Invalid_operation +dqrem211 remainder 1E+380 0 -> NaN Invalid_operation + +-- some differences from remainderNear +dqrem231 remainder -0.4 1.020 -> -0.400 +dqrem232 remainder -0.50 1.020 -> -0.500 +dqrem233 remainder -0.51 1.020 -> -0.510 +dqrem234 remainder -0.52 1.020 -> -0.520 +dqrem235 remainder -0.6 1.020 -> -0.600 + +-- high Xs +dqrem240 remainder 1E+2 1.00 -> 0.00 + +-- dqrem3xx are from DiagBigDecimal +dqrem301 remainder 1 3 -> 1 +dqrem302 remainder 5 5 -> 0 +dqrem303 remainder 13 10 -> 3 +dqrem304 remainder 13 50 -> 13 +dqrem305 remainder 13 100 -> 13 +dqrem306 remainder 13 1000 -> 13 +dqrem307 remainder .13 1 -> 0.13 +dqrem308 remainder 0.133 1 -> 0.133 +dqrem309 remainder 0.1033 1 -> 0.1033 +dqrem310 remainder 1.033 1 -> 0.033 +dqrem311 remainder 10.33 1 -> 0.33 +dqrem312 remainder 10.33 10 -> 0.33 +dqrem313 remainder 103.3 1 -> 0.3 +dqrem314 remainder 133 10 -> 3 +dqrem315 remainder 1033 10 -> 3 +dqrem316 remainder 1033 50 -> 33 +dqrem317 remainder 101.0 3 -> 2.0 +dqrem318 remainder 102.0 3 -> 0.0 +dqrem319 remainder 103.0 3 -> 1.0 +dqrem320 remainder 2.40 1 -> 0.40 +dqrem321 remainder 2.400 1 -> 0.400 +dqrem322 remainder 2.4 1 -> 0.4 +dqrem323 remainder 2.4 2 -> 0.4 +dqrem324 remainder 2.400 2 -> 0.400 +dqrem325 remainder 1 0.3 -> 0.1 +dqrem326 remainder 1 0.30 -> 0.10 +dqrem327 remainder 1 0.300 -> 0.100 +dqrem328 remainder 1 0.3000 -> 0.1000 +dqrem329 remainder 1.0 0.3 -> 0.1 +dqrem330 remainder 1.00 0.3 -> 0.10 +dqrem331 remainder 1.000 0.3 -> 0.100 +dqrem332 remainder 1.0000 0.3 -> 0.1000 +dqrem333 remainder 0.5 2 -> 0.5 +dqrem334 remainder 0.5 2.1 -> 0.5 +dqrem335 remainder 0.5 2.01 -> 0.50 +dqrem336 remainder 0.5 2.001 -> 0.500 +dqrem337 remainder 0.50 2 -> 0.50 +dqrem338 remainder 0.50 2.01 -> 0.50 +dqrem339 remainder 0.50 2.001 -> 0.500 + +dqrem340 remainder 0.5 0.5000001 -> 0.5000000 +dqrem341 remainder 0.5 0.50000001 -> 0.50000000 +dqrem342 remainder 0.5 0.500000001 -> 0.500000000 +dqrem343 remainder 0.5 0.5000000001 -> 0.5000000000 +dqrem344 remainder 0.5 0.50000000001 -> 0.50000000000 +dqrem345 remainder 0.5 0.4999999 -> 1E-7 +dqrem346 remainder 0.5 0.49999999 -> 1E-8 +dqrem347 remainder 0.5 0.499999999 -> 1E-9 +dqrem348 remainder 0.5 0.4999999999 -> 1E-10 +dqrem349 remainder 0.5 0.49999999999 -> 1E-11 +dqrem350 remainder 0.5 0.499999999999 -> 1E-12 + +dqrem351 remainder 0.03 7 -> 0.03 +dqrem352 remainder 5 2 -> 1 +dqrem353 remainder 4.1 2 -> 0.1 +dqrem354 remainder 4.01 2 -> 0.01 +dqrem355 remainder 4.001 2 -> 0.001 +dqrem356 remainder 4.0001 2 -> 0.0001 +dqrem357 remainder 4.00001 2 -> 0.00001 +dqrem358 remainder 4.000001 2 -> 0.000001 +dqrem359 remainder 4.0000001 2 -> 1E-7 + +dqrem360 remainder 1.2 0.7345 -> 0.4655 +dqrem361 remainder 0.8 12 -> 0.8 +dqrem362 remainder 0.8 0.2 -> 0.0 +dqrem363 remainder 0.8 0.3 -> 0.2 +dqrem364 remainder 0.800 12 -> 0.800 +dqrem365 remainder 0.800 1.7 -> 0.800 +dqrem366 remainder 2.400 2 -> 0.400 + +dqrem371 remainder 2.400 2 -> 0.400 + +dqrem381 remainder 12345 1 -> 0 +dqrem382 remainder 12345 1.0001 -> 0.7657 +dqrem383 remainder 12345 1.001 -> 0.668 +dqrem384 remainder 12345 1.01 -> 0.78 +dqrem385 remainder 12345 1.1 -> 0.8 +dqrem386 remainder 12355 4 -> 3 +dqrem387 remainder 12345 4 -> 1 +dqrem388 remainder 12355 4.0001 -> 2.6912 +dqrem389 remainder 12345 4.0001 -> 0.6914 +dqrem390 remainder 12345 4.9 -> 1.9 +dqrem391 remainder 12345 4.99 -> 4.73 +dqrem392 remainder 12345 4.999 -> 2.469 +dqrem393 remainder 12345 4.9999 -> 0.2469 +dqrem394 remainder 12345 5 -> 0 +dqrem395 remainder 12345 5.0001 -> 4.7532 +dqrem396 remainder 12345 5.001 -> 2.532 +dqrem397 remainder 12345 5.01 -> 0.36 +dqrem398 remainder 12345 5.1 -> 3.0 + +-- the nasty division-by-1 cases +dqrem401 remainder 0.5 1 -> 0.5 +dqrem402 remainder 0.55 1 -> 0.55 +dqrem403 remainder 0.555 1 -> 0.555 +dqrem404 remainder 0.5555 1 -> 0.5555 +dqrem405 remainder 0.55555 1 -> 0.55555 +dqrem406 remainder 0.555555 1 -> 0.555555 +dqrem407 remainder 0.5555555 1 -> 0.5555555 +dqrem408 remainder 0.55555555 1 -> 0.55555555 +dqrem409 remainder 0.555555555 1 -> 0.555555555 + +-- folddowns +dqrem421 remainder 1E+6144 1 -> NaN Division_impossible +dqrem422 remainder 1E+6144 1E+6143 -> 0E+6111 Clamped +dqrem423 remainder 1E+6144 2E+6143 -> 0E+6111 Clamped +dqrem424 remainder 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped +dqrem425 remainder 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped +dqrem426 remainder 1E+6144 5E+6143 -> 0E+6111 Clamped +dqrem427 remainder 1E+6144 6E+6143 -> 4.00000000000000000000000000000000E+6143 Clamped +dqrem428 remainder 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped +dqrem429 remainder 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped +dqrem430 remainder 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped +-- tinies +dqrem431 remainder 1E-6175 1E-6176 -> 0E-6176 +dqrem432 remainder 1E-6175 2E-6176 -> 0E-6176 +dqrem433 remainder 1E-6175 3E-6176 -> 1E-6176 Subnormal +dqrem434 remainder 1E-6175 4E-6176 -> 2E-6176 Subnormal +dqrem435 remainder 1E-6175 5E-6176 -> 0E-6176 +dqrem436 remainder 1E-6175 6E-6176 -> 4E-6176 Subnormal +dqrem437 remainder 1E-6175 7E-6176 -> 3E-6176 Subnormal +dqrem438 remainder 1E-6175 8E-6176 -> 2E-6176 Subnormal +dqrem439 remainder 1E-6175 9E-6176 -> 1E-6176 Subnormal +dqrem440 remainder 1E-6175 10E-6176 -> 0E-6176 +dqrem441 remainder 1E-6175 11E-6176 -> 1.0E-6175 Subnormal +dqrem442 remainder 100E-6175 11E-6176 -> 1.0E-6175 Subnormal +dqrem443 remainder 100E-6175 20E-6176 -> 0E-6176 +dqrem444 remainder 100E-6175 21E-6176 -> 1.3E-6175 Subnormal +dqrem445 remainder 100E-6175 30E-6176 -> 1.0E-6175 Subnormal + +-- zero signs +dqrem650 remainder 1 1 -> 0 +dqrem651 remainder -1 1 -> -0 +dqrem652 remainder 1 -1 -> 0 +dqrem653 remainder -1 -1 -> -0 +dqrem654 remainder 0 1 -> 0 +dqrem655 remainder -0 1 -> -0 +dqrem656 remainder 0 -1 -> 0 +dqrem657 remainder -0 -1 -> -0 +dqrem658 remainder 0.00 1 -> 0.00 +dqrem659 remainder -0.00 1 -> -0.00 + +-- Specials +dqrem680 remainder Inf -Inf -> NaN Invalid_operation +dqrem681 remainder Inf -1000 -> NaN Invalid_operation +dqrem682 remainder Inf -1 -> NaN Invalid_operation +dqrem683 remainder Inf 0 -> NaN Invalid_operation +dqrem684 remainder Inf -0 -> NaN Invalid_operation +dqrem685 remainder Inf 1 -> NaN Invalid_operation +dqrem686 remainder Inf 1000 -> NaN Invalid_operation +dqrem687 remainder Inf Inf -> NaN Invalid_operation +dqrem688 remainder -1000 Inf -> -1000 +dqrem689 remainder -Inf Inf -> NaN Invalid_operation +dqrem691 remainder -1 Inf -> -1 +dqrem692 remainder 0 Inf -> 0 +dqrem693 remainder -0 Inf -> -0 +dqrem694 remainder 1 Inf -> 1 +dqrem695 remainder 1000 Inf -> 1000 +dqrem696 remainder Inf Inf -> NaN Invalid_operation + +dqrem700 remainder -Inf -Inf -> NaN Invalid_operation +dqrem701 remainder -Inf -1000 -> NaN Invalid_operation +dqrem702 remainder -Inf -1 -> NaN Invalid_operation +dqrem703 remainder -Inf -0 -> NaN Invalid_operation +dqrem704 remainder -Inf 0 -> NaN Invalid_operation +dqrem705 remainder -Inf 1 -> NaN Invalid_operation +dqrem706 remainder -Inf 1000 -> NaN Invalid_operation +dqrem707 remainder -Inf Inf -> NaN Invalid_operation +dqrem708 remainder -Inf -Inf -> NaN Invalid_operation +dqrem709 remainder -1000 Inf -> -1000 +dqrem710 remainder -1 -Inf -> -1 +dqrem711 remainder -0 -Inf -> -0 +dqrem712 remainder 0 -Inf -> 0 +dqrem713 remainder 1 -Inf -> 1 +dqrem714 remainder 1000 -Inf -> 1000 +dqrem715 remainder Inf -Inf -> NaN Invalid_operation + +dqrem721 remainder NaN -Inf -> NaN +dqrem722 remainder NaN -1000 -> NaN +dqrem723 remainder NaN -1 -> NaN +dqrem724 remainder NaN -0 -> NaN +dqrem725 remainder -NaN 0 -> -NaN +dqrem726 remainder NaN 1 -> NaN +dqrem727 remainder NaN 1000 -> NaN +dqrem728 remainder NaN Inf -> NaN +dqrem729 remainder NaN -NaN -> NaN +dqrem730 remainder -Inf NaN -> NaN +dqrem731 remainder -1000 NaN -> NaN +dqrem732 remainder -1 NaN -> NaN +dqrem733 remainder -0 -NaN -> -NaN +dqrem734 remainder 0 NaN -> NaN +dqrem735 remainder 1 -NaN -> -NaN +dqrem736 remainder 1000 NaN -> NaN +dqrem737 remainder Inf NaN -> NaN + +dqrem741 remainder sNaN -Inf -> NaN Invalid_operation +dqrem742 remainder sNaN -1000 -> NaN Invalid_operation +dqrem743 remainder -sNaN -1 -> -NaN Invalid_operation +dqrem744 remainder sNaN -0 -> NaN Invalid_operation +dqrem745 remainder sNaN 0 -> NaN Invalid_operation +dqrem746 remainder sNaN 1 -> NaN Invalid_operation +dqrem747 remainder sNaN 1000 -> NaN Invalid_operation +dqrem749 remainder sNaN NaN -> NaN Invalid_operation +dqrem750 remainder sNaN sNaN -> NaN Invalid_operation +dqrem751 remainder NaN sNaN -> NaN Invalid_operation +dqrem752 remainder -Inf sNaN -> NaN Invalid_operation +dqrem753 remainder -1000 sNaN -> NaN Invalid_operation +dqrem754 remainder -1 sNaN -> NaN Invalid_operation +dqrem755 remainder -0 sNaN -> NaN Invalid_operation +dqrem756 remainder 0 sNaN -> NaN Invalid_operation +dqrem757 remainder 1 sNaN -> NaN Invalid_operation +dqrem758 remainder 1000 sNaN -> NaN Invalid_operation +dqrem759 remainder Inf -sNaN -> -NaN Invalid_operation + +-- propaging NaNs +dqrem760 remainder NaN1 NaN7 -> NaN1 +dqrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation +dqrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation +dqrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation +dqrem764 remainder 15 NaN11 -> NaN11 +dqrem765 remainder NaN6 NaN12 -> NaN6 +dqrem766 remainder Inf NaN13 -> NaN13 +dqrem767 remainder NaN14 -Inf -> NaN14 +dqrem768 remainder 0 NaN15 -> NaN15 +dqrem769 remainder NaN16 -0 -> NaN16 + +-- edge cases of impossible +dqrem770 remainder 1234568888888887777777777890123456 10 -> 6 +dqrem771 remainder 1234568888888887777777777890123456 1 -> 0 +dqrem772 remainder 1234568888888887777777777890123456 0.1 -> NaN Division_impossible +dqrem773 remainder 1234568888888887777777777890123456 0.01 -> NaN Division_impossible + +-- long operand checks +dqrem801 remainder 12345678000 100 -> 0 +dqrem802 remainder 1 12345678000 -> 1 +dqrem803 remainder 1234567800 10 -> 0 +dqrem804 remainder 1 1234567800 -> 1 +dqrem805 remainder 1234567890 10 -> 0 +dqrem806 remainder 1 1234567890 -> 1 +dqrem807 remainder 1234567891 10 -> 1 +dqrem808 remainder 1 1234567891 -> 1 +dqrem809 remainder 12345678901 100 -> 1 +dqrem810 remainder 1 12345678901 -> 1 +dqrem811 remainder 1234567896 10 -> 6 +dqrem812 remainder 1 1234567896 -> 1 + +dqrem821 remainder 12345678000 100 -> 0 +dqrem822 remainder 1 12345678000 -> 1 +dqrem823 remainder 1234567800 10 -> 0 +dqrem824 remainder 1 1234567800 -> 1 +dqrem825 remainder 1234567890 10 -> 0 +dqrem826 remainder 1 1234567890 -> 1 +dqrem827 remainder 1234567891 10 -> 1 +dqrem828 remainder 1 1234567891 -> 1 +dqrem829 remainder 12345678901 100 -> 1 +dqrem830 remainder 1 12345678901 -> 1 +dqrem831 remainder 1234567896 10 -> 6 +dqrem832 remainder 1 1234567896 -> 1 + +-- from divideint +dqrem840 remainder 100000000.0 1 -> 0.0 +dqrem841 remainder 100000000.4 1 -> 0.4 +dqrem842 remainder 100000000.5 1 -> 0.5 +dqrem843 remainder 100000000.9 1 -> 0.9 +dqrem844 remainder 100000000.999 1 -> 0.999 +dqrem850 remainder 100000003 5 -> 3 +dqrem851 remainder 10000003 5 -> 3 +dqrem852 remainder 1000003 5 -> 3 +dqrem853 remainder 100003 5 -> 3 +dqrem854 remainder 10003 5 -> 3 +dqrem855 remainder 1003 5 -> 3 +dqrem856 remainder 103 5 -> 3 +dqrem857 remainder 13 5 -> 3 +dqrem858 remainder 1 5 -> 1 + +-- Vladimir's cases 1234567890123456 +dqrem860 remainder 123.0e1 1000000000000000 -> 1230 +dqrem861 remainder 1230 1000000000000000 -> 1230 +dqrem862 remainder 12.3e2 1000000000000000 -> 1230 +dqrem863 remainder 1.23e3 1000000000000000 -> 1230 +dqrem864 remainder 123e1 1000000000000000 -> 1230 +dqrem870 remainder 123e1 1000000000000000 -> 1230 +dqrem871 remainder 123e1 100000000000000 -> 1230 +dqrem872 remainder 123e1 10000000000000 -> 1230 +dqrem873 remainder 123e1 1000000000000 -> 1230 +dqrem874 remainder 123e1 100000000000 -> 1230 +dqrem875 remainder 123e1 10000000000 -> 1230 +dqrem876 remainder 123e1 1000000000 -> 1230 +dqrem877 remainder 123e1 100000000 -> 1230 +dqrem878 remainder 1230 100000000 -> 1230 +dqrem879 remainder 123e1 10000000 -> 1230 +dqrem880 remainder 123e1 1000000 -> 1230 +dqrem881 remainder 123e1 100000 -> 1230 +dqrem882 remainder 123e1 10000 -> 1230 +dqrem883 remainder 123e1 1000 -> 230 +dqrem884 remainder 123e1 100 -> 30 +dqrem885 remainder 123e1 10 -> 0 +dqrem886 remainder 123e1 1 -> 0 + +dqrem890 remainder 123e1 2000000000000000 -> 1230 +dqrem891 remainder 123e1 200000000000000 -> 1230 +dqrem892 remainder 123e1 20000000000000 -> 1230 +dqrem893 remainder 123e1 2000000000000 -> 1230 +dqrem894 remainder 123e1 200000000000 -> 1230 +dqrem895 remainder 123e1 20000000000 -> 1230 +dqrem896 remainder 123e1 2000000000 -> 1230 +dqrem897 remainder 123e1 200000000 -> 1230 +dqrem899 remainder 123e1 20000000 -> 1230 +dqrem900 remainder 123e1 2000000 -> 1230 +dqrem901 remainder 123e1 200000 -> 1230 +dqrem902 remainder 123e1 20000 -> 1230 +dqrem903 remainder 123e1 2000 -> 1230 +dqrem904 remainder 123e1 200 -> 30 +dqrem905 remainder 123e1 20 -> 10 +dqrem906 remainder 123e1 2 -> 0 + +dqrem910 remainder 123e1 5000000000000000 -> 1230 +dqrem911 remainder 123e1 500000000000000 -> 1230 +dqrem912 remainder 123e1 50000000000000 -> 1230 +dqrem913 remainder 123e1 5000000000000 -> 1230 +dqrem914 remainder 123e1 500000000000 -> 1230 +dqrem915 remainder 123e1 50000000000 -> 1230 +dqrem916 remainder 123e1 5000000000 -> 1230 +dqrem917 remainder 123e1 500000000 -> 1230 +dqrem919 remainder 123e1 50000000 -> 1230 +dqrem920 remainder 123e1 5000000 -> 1230 +dqrem921 remainder 123e1 500000 -> 1230 +dqrem922 remainder 123e1 50000 -> 1230 +dqrem923 remainder 123e1 5000 -> 1230 +dqrem924 remainder 123e1 500 -> 230 +dqrem925 remainder 123e1 50 -> 30 +dqrem926 remainder 123e1 5 -> 0 + +dqrem930 remainder 123e1 9000000000000000 -> 1230 +dqrem931 remainder 123e1 900000000000000 -> 1230 +dqrem932 remainder 123e1 90000000000000 -> 1230 +dqrem933 remainder 123e1 9000000000000 -> 1230 +dqrem934 remainder 123e1 900000000000 -> 1230 +dqrem935 remainder 123e1 90000000000 -> 1230 +dqrem936 remainder 123e1 9000000000 -> 1230 +dqrem937 remainder 123e1 900000000 -> 1230 +dqrem939 remainder 123e1 90000000 -> 1230 +dqrem940 remainder 123e1 9000000 -> 1230 +dqrem941 remainder 123e1 900000 -> 1230 +dqrem942 remainder 123e1 90000 -> 1230 +dqrem943 remainder 123e1 9000 -> 1230 +dqrem944 remainder 123e1 900 -> 330 +dqrem945 remainder 123e1 90 -> 60 +dqrem946 remainder 123e1 9 -> 6 + +dqrem950 remainder 123e1 1000000000000000 -> 1230 +dqrem961 remainder 123e1 2999999999999999 -> 1230 +dqrem962 remainder 123e1 3999999999999999 -> 1230 +dqrem963 remainder 123e1 4999999999999999 -> 1230 +dqrem964 remainder 123e1 5999999999999999 -> 1230 +dqrem965 remainder 123e1 6999999999999999 -> 1230 +dqrem966 remainder 123e1 7999999999999999 -> 1230 +dqrem967 remainder 123e1 8999999999999999 -> 1230 +dqrem968 remainder 123e1 9999999999999999 -> 1230 +dqrem969 remainder 123e1 9876543210987654 -> 1230 + +dqrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally + +-- overflow and underflow tests [from divide] +dqrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible +dqrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible +dqrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible +dqrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible +dqrem1055 remainder 1e-277 1e+311 -> 1E-277 +dqrem1056 remainder 1e-277 -1e+311 -> 1E-277 +dqrem1057 remainder -1e-277 1e+311 -> -1E-277 +dqrem1058 remainder -1e-277 -1e+311 -> -1E-277 + +-- Gyuris example +dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143 + +-- destructive subtract +dqrem1120 remainder 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> 0.765432109876543210987654321098768 +dqrem1121 remainder 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> 0.65432109876543210987654321098779 +dqrem1122 remainder 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> 0.5432109876543210987654321098890 +dqrem1123 remainder 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> 2.691358027469135802746913580274687 +dqrem1124 remainder 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692 +dqrem1125 remainder 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> 3.6913578024691357802469135780251 +dqrem1126 remainder 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247 +dqrem1127 remainder 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> 4.246913578024691357802469135780246 +dqrem1128 remainder 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> 4.3086421975308642197530864219759 + +-- Null tests +dqrem1000 remainder 10 # -> NaN Invalid_operation +dqrem1001 remainder # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRemainderNear.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRemainderNear.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,631 @@ +------------------------------------------------------------------------ +-- dqRemainderNear.decTest -- decQuad remainder-near -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- sanity checks (as base, above) +dqrmn001 remaindernear 1 1 -> 0 +dqrmn002 remaindernear 2 1 -> 0 +dqrmn003 remaindernear 1 2 -> 1 +dqrmn004 remaindernear 2 2 -> 0 +dqrmn005 remaindernear 0 1 -> 0 +dqrmn006 remaindernear 0 2 -> 0 +dqrmn007 remaindernear 1 3 -> 1 +dqrmn008 remaindernear 2 3 -> -1 +dqrmn009 remaindernear 3 3 -> 0 + +dqrmn010 remaindernear 2.4 1 -> 0.4 +dqrmn011 remaindernear 2.4 -1 -> 0.4 +dqrmn012 remaindernear -2.4 1 -> -0.4 +dqrmn013 remaindernear -2.4 -1 -> -0.4 +dqrmn014 remaindernear 2.40 1 -> 0.40 +dqrmn015 remaindernear 2.400 1 -> 0.400 +dqrmn016 remaindernear 2.4 2 -> 0.4 +dqrmn017 remaindernear 2.400 2 -> 0.400 +dqrmn018 remaindernear 2. 2 -> 0 +dqrmn019 remaindernear 20 20 -> 0 + +dqrmn020 remaindernear 187 187 -> 0 +dqrmn021 remaindernear 5 2 -> 1 +dqrmn022 remaindernear 5 2.0 -> 1.0 +dqrmn023 remaindernear 5 2.000 -> 1.000 +dqrmn024 remaindernear 5 0.200 -> 0.000 +dqrmn025 remaindernear 5 0.200 -> 0.000 + +dqrmn030 remaindernear 1 2 -> 1 +dqrmn031 remaindernear 1 4 -> 1 +dqrmn032 remaindernear 1 8 -> 1 + +dqrmn033 remaindernear 1 16 -> 1 +dqrmn034 remaindernear 1 32 -> 1 +dqrmn035 remaindernear 1 64 -> 1 +dqrmn040 remaindernear 1 -2 -> 1 +dqrmn041 remaindernear 1 -4 -> 1 +dqrmn042 remaindernear 1 -8 -> 1 +dqrmn043 remaindernear 1 -16 -> 1 +dqrmn044 remaindernear 1 -32 -> 1 +dqrmn045 remaindernear 1 -64 -> 1 +dqrmn050 remaindernear -1 2 -> -1 +dqrmn051 remaindernear -1 4 -> -1 +dqrmn052 remaindernear -1 8 -> -1 +dqrmn053 remaindernear -1 16 -> -1 +dqrmn054 remaindernear -1 32 -> -1 +dqrmn055 remaindernear -1 64 -> -1 +dqrmn060 remaindernear -1 -2 -> -1 +dqrmn061 remaindernear -1 -4 -> -1 +dqrmn062 remaindernear -1 -8 -> -1 +dqrmn063 remaindernear -1 -16 -> -1 +dqrmn064 remaindernear -1 -32 -> -1 +dqrmn065 remaindernear -1 -64 -> -1 + +dqrmn066 remaindernear 9.9 1 -> -0.1 +dqrmn067 remaindernear 99.7 1 -> -0.3 +dqrmn068 remaindernear 999999999 1 -> 0 +dqrmn069 remaindernear 999999999.4 1 -> 0.4 +dqrmn070 remaindernear 999999999.5 1 -> -0.5 +dqrmn071 remaindernear 999999999.9 1 -> -0.1 +dqrmn072 remaindernear 999999999.999 1 -> -0.001 +dqrmn073 remaindernear 999999.999999 1 -> -0.000001 +dqrmn074 remaindernear 9 1 -> 0 +dqrmn075 remaindernear 9999999999999999 1 -> 0 +dqrmn076 remaindernear 9999999999999999 2 -> -1 +dqrmn077 remaindernear 9999999999999999 3 -> 0 +dqrmn078 remaindernear 9999999999999999 4 -> -1 + +dqrmn080 remaindernear 0. 1 -> 0 +dqrmn081 remaindernear .0 1 -> 0.0 +dqrmn082 remaindernear 0.00 1 -> 0.00 +dqrmn083 remaindernear 0.00E+9 1 -> 0 +dqrmn084 remaindernear 0.00E+3 1 -> 0 +dqrmn085 remaindernear 0.00E+2 1 -> 0 +dqrmn086 remaindernear 0.00E+1 1 -> 0.0 +dqrmn087 remaindernear 0.00E+0 1 -> 0.00 +dqrmn088 remaindernear 0.00E-0 1 -> 0.00 +dqrmn089 remaindernear 0.00E-1 1 -> 0.000 +dqrmn090 remaindernear 0.00E-2 1 -> 0.0000 +dqrmn091 remaindernear 0.00E-3 1 -> 0.00000 +dqrmn092 remaindernear 0.00E-4 1 -> 0.000000 +dqrmn093 remaindernear 0.00E-5 1 -> 0E-7 +dqrmn094 remaindernear 0.00E-6 1 -> 0E-8 +dqrmn095 remaindernear 0.0000E-50 1 -> 0E-54 + +-- Various flavours of remaindernear by 0 +dqrmn101 remaindernear 0 0 -> NaN Division_undefined +dqrmn102 remaindernear 0 -0 -> NaN Division_undefined +dqrmn103 remaindernear -0 0 -> NaN Division_undefined +dqrmn104 remaindernear -0 -0 -> NaN Division_undefined +dqrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined +dqrmn106 remaindernear 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, but +-- IEEE 854 is explicit that it is Invalid operation .. for +-- remainder-near, anyway] +dqrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation +dqrmn108 remaindernear 0.01 0 -> NaN Invalid_operation +dqrmn109 remaindernear 0.1 0 -> NaN Invalid_operation +dqrmn110 remaindernear 1 0 -> NaN Invalid_operation +dqrmn111 remaindernear 1 0.0 -> NaN Invalid_operation +dqrmn112 remaindernear 10 0.0 -> NaN Invalid_operation +dqrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation +dqrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation +dqrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation +dqrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation +dqrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation +dqrmn120 remaindernear 1 -0 -> NaN Invalid_operation +dqrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation +dqrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation +dqrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation +dqrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation +-- and zeros on left +dqrmn130 remaindernear 0 1 -> 0 +dqrmn131 remaindernear 0 -1 -> 0 +dqrmn132 remaindernear 0.0 1 -> 0.0 +dqrmn133 remaindernear 0.0 -1 -> 0.0 +dqrmn134 remaindernear -0 1 -> -0 +dqrmn135 remaindernear -0 -1 -> -0 +dqrmn136 remaindernear -0.0 1 -> -0.0 +dqrmn137 remaindernear -0.0 -1 -> -0.0 + +-- 0.5ers +dqrmn143 remaindernear 0.5 2 -> 0.5 +dqrmn144 remaindernear 0.5 2.1 -> 0.5 +dqrmn145 remaindernear 0.5 2.01 -> 0.50 +dqrmn146 remaindernear 0.5 2.001 -> 0.500 +dqrmn147 remaindernear 0.50 2 -> 0.50 +dqrmn148 remaindernear 0.50 2.01 -> 0.50 +dqrmn149 remaindernear 0.50 2.001 -> 0.500 + +-- steadies +dqrmn150 remaindernear 1 1 -> 0 +dqrmn151 remaindernear 1 2 -> 1 +dqrmn152 remaindernear 1 3 -> 1 +dqrmn153 remaindernear 1 4 -> 1 +dqrmn154 remaindernear 1 5 -> 1 +dqrmn155 remaindernear 1 6 -> 1 +dqrmn156 remaindernear 1 7 -> 1 +dqrmn157 remaindernear 1 8 -> 1 +dqrmn158 remaindernear 1 9 -> 1 +dqrmn159 remaindernear 1 10 -> 1 +dqrmn160 remaindernear 1 1 -> 0 +dqrmn161 remaindernear 2 1 -> 0 +dqrmn162 remaindernear 3 1 -> 0 +dqrmn163 remaindernear 4 1 -> 0 +dqrmn164 remaindernear 5 1 -> 0 +dqrmn165 remaindernear 6 1 -> 0 +dqrmn166 remaindernear 7 1 -> 0 +dqrmn167 remaindernear 8 1 -> 0 +dqrmn168 remaindernear 9 1 -> 0 +dqrmn169 remaindernear 10 1 -> 0 + +-- some differences from remainder +dqrmn171 remaindernear 0.4 1.020 -> 0.400 +dqrmn172 remaindernear 0.50 1.020 -> 0.500 +dqrmn173 remaindernear 0.51 1.020 -> 0.510 +dqrmn174 remaindernear 0.52 1.020 -> -0.500 +dqrmn175 remaindernear 0.6 1.020 -> -0.420 + +-- More flavours of remaindernear by 0 +dqrmn201 remaindernear 0 0 -> NaN Division_undefined +dqrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined +dqrmn203 remaindernear 0.000 0 -> NaN Division_undefined +dqrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation +dqrmn205 remaindernear 0.01 0 -> NaN Invalid_operation +dqrmn206 remaindernear 0.1 0 -> NaN Invalid_operation +dqrmn207 remaindernear 1 0 -> NaN Invalid_operation +dqrmn208 remaindernear 1 0.0 -> NaN Invalid_operation +dqrmn209 remaindernear 10 0.0 -> NaN Invalid_operation +dqrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation +dqrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation + +-- tests from the extended specification +dqrmn221 remaindernear 2.1 3 -> -0.9 +dqrmn222 remaindernear 10 6 -> -2 +dqrmn223 remaindernear 10 3 -> 1 +dqrmn224 remaindernear -10 3 -> -1 +dqrmn225 remaindernear 10.2 1 -> 0.2 +dqrmn226 remaindernear 10 0.3 -> 0.1 +dqrmn227 remaindernear 3.6 1.3 -> -0.3 + +-- some differences from remainder +dqrmn231 remaindernear -0.4 1.020 -> -0.400 +dqrmn232 remaindernear -0.50 1.020 -> -0.500 +dqrmn233 remaindernear -0.51 1.020 -> -0.510 +dqrmn234 remaindernear -0.52 1.020 -> 0.500 +dqrmn235 remaindernear -0.6 1.020 -> 0.420 + +-- high Xs +dqrmn240 remaindernear 1E+2 1.00 -> 0.00 + +-- dqrmn3xx are from DiagBigDecimal +dqrmn301 remaindernear 1 3 -> 1 +dqrmn302 remaindernear 5 5 -> 0 +dqrmn303 remaindernear 13 10 -> 3 +dqrmn304 remaindernear 13 50 -> 13 +dqrmn305 remaindernear 13 100 -> 13 +dqrmn306 remaindernear 13 1000 -> 13 +dqrmn307 remaindernear .13 1 -> 0.13 +dqrmn308 remaindernear 0.133 1 -> 0.133 +dqrmn309 remaindernear 0.1033 1 -> 0.1033 +dqrmn310 remaindernear 1.033 1 -> 0.033 +dqrmn311 remaindernear 10.33 1 -> 0.33 +dqrmn312 remaindernear 10.33 10 -> 0.33 +dqrmn313 remaindernear 103.3 1 -> 0.3 +dqrmn314 remaindernear 133 10 -> 3 +dqrmn315 remaindernear 1033 10 -> 3 +dqrmn316 remaindernear 1033 50 -> -17 +dqrmn317 remaindernear 101.0 3 -> -1.0 +dqrmn318 remaindernear 102.0 3 -> 0.0 +dqrmn319 remaindernear 103.0 3 -> 1.0 +dqrmn320 remaindernear 2.40 1 -> 0.40 +dqrmn321 remaindernear 2.400 1 -> 0.400 +dqrmn322 remaindernear 2.4 1 -> 0.4 +dqrmn323 remaindernear 2.4 2 -> 0.4 +dqrmn324 remaindernear 2.400 2 -> 0.400 +dqrmn325 remaindernear 1 0.3 -> 0.1 +dqrmn326 remaindernear 1 0.30 -> 0.10 +dqrmn327 remaindernear 1 0.300 -> 0.100 +dqrmn328 remaindernear 1 0.3000 -> 0.1000 +dqrmn329 remaindernear 1.0 0.3 -> 0.1 +dqrmn330 remaindernear 1.00 0.3 -> 0.10 +dqrmn331 remaindernear 1.000 0.3 -> 0.100 +dqrmn332 remaindernear 1.0000 0.3 -> 0.1000 +dqrmn333 remaindernear 0.5 2 -> 0.5 +dqrmn334 remaindernear 0.5 2.1 -> 0.5 +dqrmn335 remaindernear 0.5 2.01 -> 0.50 +dqrmn336 remaindernear 0.5 2.001 -> 0.500 +dqrmn337 remaindernear 0.50 2 -> 0.50 +dqrmn338 remaindernear 0.50 2.01 -> 0.50 +dqrmn339 remaindernear 0.50 2.001 -> 0.500 + +dqrmn340 remaindernear 0.5 0.5000001 -> -1E-7 +dqrmn341 remaindernear 0.5 0.50000001 -> -1E-8 +dqrmn342 remaindernear 0.5 0.500000001 -> -1E-9 +dqrmn343 remaindernear 0.5 0.5000000001 -> -1E-10 +dqrmn344 remaindernear 0.5 0.50000000001 -> -1E-11 +dqrmn345 remaindernear 0.5 0.4999999 -> 1E-7 +dqrmn346 remaindernear 0.5 0.49999999 -> 1E-8 +dqrmn347 remaindernear 0.5 0.499999999 -> 1E-9 +dqrmn348 remaindernear 0.5 0.4999999999 -> 1E-10 +dqrmn349 remaindernear 0.5 0.49999999999 -> 1E-11 +dqrmn350 remaindernear 0.5 0.499999999999 -> 1E-12 + +dqrmn351 remaindernear 0.03 7 -> 0.03 +dqrmn352 remaindernear 5 2 -> 1 +dqrmn353 remaindernear 4.1 2 -> 0.1 +dqrmn354 remaindernear 4.01 2 -> 0.01 +dqrmn355 remaindernear 4.001 2 -> 0.001 +dqrmn356 remaindernear 4.0001 2 -> 0.0001 +dqrmn357 remaindernear 4.00001 2 -> 0.00001 +dqrmn358 remaindernear 4.000001 2 -> 0.000001 +dqrmn359 remaindernear 4.0000001 2 -> 1E-7 + +dqrmn360 remaindernear 1.2 0.7345 -> -0.2690 +dqrmn361 remaindernear 0.8 12 -> 0.8 +dqrmn362 remaindernear 0.8 0.2 -> 0.0 +dqrmn363 remaindernear 0.8 0.3 -> -0.1 +dqrmn364 remaindernear 0.800 12 -> 0.800 +dqrmn365 remaindernear 0.800 1.7 -> 0.800 +dqrmn366 remaindernear 2.400 2 -> 0.400 + +-- round to even +dqrmn371 remaindernear 121 2 -> 1 +dqrmn372 remaindernear 122 2 -> 0 +dqrmn373 remaindernear 123 2 -> -1 +dqrmn374 remaindernear 124 2 -> 0 +dqrmn375 remaindernear 125 2 -> 1 +dqrmn376 remaindernear 126 2 -> 0 +dqrmn377 remaindernear 127 2 -> -1 + +dqrmn381 remaindernear 12345 1 -> 0 +dqrmn382 remaindernear 12345 1.0001 -> -0.2344 +dqrmn383 remaindernear 12345 1.001 -> -0.333 +dqrmn384 remaindernear 12345 1.01 -> -0.23 +dqrmn385 remaindernear 12345 1.1 -> -0.3 +dqrmn386 remaindernear 12355 4 -> -1 +dqrmn387 remaindernear 12345 4 -> 1 +dqrmn388 remaindernear 12355 4.0001 -> -1.3089 +dqrmn389 remaindernear 12345 4.0001 -> 0.6914 +dqrmn390 remaindernear 12345 4.9 -> 1.9 +dqrmn391 remaindernear 12345 4.99 -> -0.26 +dqrmn392 remaindernear 12345 4.999 -> 2.469 +dqrmn393 remaindernear 12345 4.9999 -> 0.2469 +dqrmn394 remaindernear 12345 5 -> 0 +dqrmn395 remaindernear 12345 5.0001 -> -0.2469 +dqrmn396 remaindernear 12345 5.001 -> -2.469 +dqrmn397 remaindernear 12345 5.01 -> 0.36 +dqrmn398 remaindernear 12345 5.1 -> -2.1 + +-- the nasty division-by-1 cases +dqrmn401 remaindernear 0.4 1 -> 0.4 +dqrmn402 remaindernear 0.45 1 -> 0.45 +dqrmn403 remaindernear 0.455 1 -> 0.455 +dqrmn404 remaindernear 0.4555 1 -> 0.4555 +dqrmn405 remaindernear 0.45555 1 -> 0.45555 +dqrmn406 remaindernear 0.455555 1 -> 0.455555 +dqrmn407 remaindernear 0.4555555 1 -> 0.4555555 +dqrmn408 remaindernear 0.45555555 1 -> 0.45555555 +dqrmn409 remaindernear 0.455555555 1 -> 0.455555555 +-- with spill... [412 exercises sticktab loop] +dqrmn411 remaindernear 0.5 1 -> 0.5 +dqrmn412 remaindernear 0.55 1 -> -0.45 +dqrmn413 remaindernear 0.555 1 -> -0.445 +dqrmn414 remaindernear 0.5555 1 -> -0.4445 +dqrmn415 remaindernear 0.55555 1 -> -0.44445 +dqrmn416 remaindernear 0.555555 1 -> -0.444445 +dqrmn417 remaindernear 0.5555555 1 -> -0.4444445 +dqrmn418 remaindernear 0.55555555 1 -> -0.44444445 +dqrmn419 remaindernear 0.555555555 1 -> -0.444444445 + +-- folddowns +dqrmn421 remaindernear 1E+6144 1 -> NaN Division_impossible +dqrmn422 remaindernear 1E+6144 1E+6143 -> 0E+6111 Clamped +dqrmn423 remaindernear 1E+6144 2E+6143 -> 0E+6111 Clamped +dqrmn424 remaindernear 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped +dqrmn425 remaindernear 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped +dqrmn426 remaindernear 1E+6144 5E+6143 -> 0E+6111 Clamped +dqrmn427 remaindernear 1E+6144 6E+6143 -> -2.00000000000000000000000000000000E+6143 Clamped +dqrmn428 remaindernear 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped +dqrmn429 remaindernear 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped +dqrmn430 remaindernear 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped +-- tinies +dqrmn431 remaindernear 1E-6175 1E-6176 -> 0E-6176 +dqrmn432 remaindernear 1E-6175 2E-6176 -> 0E-6176 +dqrmn433 remaindernear 1E-6175 3E-6176 -> 1E-6176 Subnormal +dqrmn434 remaindernear 1E-6175 4E-6176 -> 2E-6176 Subnormal +dqrmn435 remaindernear 1E-6175 5E-6176 -> 0E-6176 +dqrmn436 remaindernear 1E-6175 6E-6176 -> -2E-6176 Subnormal +dqrmn437 remaindernear 1E-6175 7E-6176 -> 3E-6176 Subnormal +dqrmn438 remaindernear 1E-6175 8E-6176 -> 2E-6176 Subnormal +dqrmn439 remaindernear 1E-6175 9E-6176 -> 1E-6176 Subnormal +dqrmn440 remaindernear 1E-6175 10E-6176 -> 0E-6176 +dqrmn441 remaindernear 1E-6175 11E-6176 -> -1E-6176 Subnormal +dqrmn442 remaindernear 100E-6175 11E-6176 -> -1E-6176 Subnormal +dqrmn443 remaindernear 100E-6175 20E-6176 -> 0E-6176 +dqrmn444 remaindernear 100E-6175 21E-6176 -> -8E-6176 Subnormal +dqrmn445 remaindernear 100E-6175 30E-6176 -> 1.0E-6175 Subnormal + +-- zero signs +dqrmn650 remaindernear 1 1 -> 0 +dqrmn651 remaindernear -1 1 -> -0 +dqrmn652 remaindernear 1 -1 -> 0 +dqrmn653 remaindernear -1 -1 -> -0 +dqrmn654 remaindernear 0 1 -> 0 +dqrmn655 remaindernear -0 1 -> -0 +dqrmn656 remaindernear 0 -1 -> 0 +dqrmn657 remaindernear -0 -1 -> -0 +dqrmn658 remaindernear 0.00 1 -> 0.00 +dqrmn659 remaindernear -0.00 1 -> -0.00 + +-- Specials +dqrmn680 remaindernear Inf -Inf -> NaN Invalid_operation +dqrmn681 remaindernear Inf -1000 -> NaN Invalid_operation +dqrmn682 remaindernear Inf -1 -> NaN Invalid_operation +dqrmn683 remaindernear Inf 0 -> NaN Invalid_operation +dqrmn684 remaindernear Inf -0 -> NaN Invalid_operation +dqrmn685 remaindernear Inf 1 -> NaN Invalid_operation +dqrmn686 remaindernear Inf 1000 -> NaN Invalid_operation +dqrmn687 remaindernear Inf Inf -> NaN Invalid_operation +dqrmn688 remaindernear -1000 Inf -> -1000 +dqrmn689 remaindernear -Inf Inf -> NaN Invalid_operation +dqrmn691 remaindernear -1 Inf -> -1 +dqrmn692 remaindernear 0 Inf -> 0 +dqrmn693 remaindernear -0 Inf -> -0 +dqrmn694 remaindernear 1 Inf -> 1 +dqrmn695 remaindernear 1000 Inf -> 1000 +dqrmn696 remaindernear Inf Inf -> NaN Invalid_operation + +dqrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation +dqrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation +dqrmn702 remaindernear -Inf -1 -> NaN Invalid_operation +dqrmn703 remaindernear -Inf -0 -> NaN Invalid_operation +dqrmn704 remaindernear -Inf 0 -> NaN Invalid_operation +dqrmn705 remaindernear -Inf 1 -> NaN Invalid_operation +dqrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation +dqrmn707 remaindernear -Inf Inf -> NaN Invalid_operation +dqrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation +dqrmn709 remaindernear -1000 Inf -> -1000 +dqrmn710 remaindernear -1 -Inf -> -1 +dqrmn711 remaindernear -0 -Inf -> -0 +dqrmn712 remaindernear 0 -Inf -> 0 +dqrmn713 remaindernear 1 -Inf -> 1 +dqrmn714 remaindernear 1000 -Inf -> 1000 +dqrmn715 remaindernear Inf -Inf -> NaN Invalid_operation + +dqrmn721 remaindernear NaN -Inf -> NaN +dqrmn722 remaindernear NaN -1000 -> NaN +dqrmn723 remaindernear NaN -1 -> NaN +dqrmn724 remaindernear NaN -0 -> NaN +dqrmn725 remaindernear -NaN 0 -> -NaN +dqrmn726 remaindernear NaN 1 -> NaN +dqrmn727 remaindernear NaN 1000 -> NaN +dqrmn728 remaindernear NaN Inf -> NaN +dqrmn729 remaindernear NaN -NaN -> NaN +dqrmn730 remaindernear -Inf NaN -> NaN +dqrmn731 remaindernear -1000 NaN -> NaN +dqrmn732 remaindernear -1 NaN -> NaN +dqrmn733 remaindernear -0 -NaN -> -NaN +dqrmn734 remaindernear 0 NaN -> NaN +dqrmn735 remaindernear 1 -NaN -> -NaN +dqrmn736 remaindernear 1000 NaN -> NaN +dqrmn737 remaindernear Inf NaN -> NaN + +dqrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation +dqrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation +dqrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation +dqrmn744 remaindernear sNaN -0 -> NaN Invalid_operation +dqrmn745 remaindernear sNaN 0 -> NaN Invalid_operation +dqrmn746 remaindernear sNaN 1 -> NaN Invalid_operation +dqrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation +dqrmn749 remaindernear sNaN NaN -> NaN Invalid_operation +dqrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation +dqrmn751 remaindernear NaN sNaN -> NaN Invalid_operation +dqrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation +dqrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation +dqrmn754 remaindernear -1 sNaN -> NaN Invalid_operation +dqrmn755 remaindernear -0 sNaN -> NaN Invalid_operation +dqrmn756 remaindernear 0 sNaN -> NaN Invalid_operation +dqrmn757 remaindernear 1 sNaN -> NaN Invalid_operation +dqrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation +dqrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation + +-- propaging NaNs +dqrmn760 remaindernear NaN1 NaN7 -> NaN1 +dqrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation +dqrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation +dqrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation +dqrmn764 remaindernear 15 NaN11 -> NaN11 +dqrmn765 remaindernear NaN6 NaN12 -> NaN6 +dqrmn766 remaindernear Inf NaN13 -> NaN13 +dqrmn767 remaindernear NaN14 -Inf -> NaN14 +dqrmn768 remaindernear 0 NaN15 -> NaN15 +dqrmn769 remaindernear NaN16 -0 -> NaN16 + +-- edge cases of impossible +dqrmn770 remaindernear 1234500000000000000000067890123456 10 -> -4 +dqrmn771 remaindernear 1234500000000000000000067890123456 1 -> 0 +dqrmn772 remaindernear 1234500000000000000000067890123456 0.1 -> NaN Division_impossible +dqrmn773 remaindernear 1234500000000000000000067890123456 0.01 -> NaN Division_impossible + +-- long operand checks +dqrmn801 remaindernear 12345678000 100 -> 0 +dqrmn802 remaindernear 1 12345678000 -> 1 +dqrmn803 remaindernear 1234567800 10 -> 0 +dqrmn804 remaindernear 1 1234567800 -> 1 +dqrmn805 remaindernear 1234567890 10 -> 0 +dqrmn806 remaindernear 1 1234567890 -> 1 +dqrmn807 remaindernear 1234567891 10 -> 1 +dqrmn808 remaindernear 1 1234567891 -> 1 +dqrmn809 remaindernear 12345678901 100 -> 1 +dqrmn810 remaindernear 1 12345678901 -> 1 +dqrmn811 remaindernear 1234567896 10 -> -4 +dqrmn812 remaindernear 1 1234567896 -> 1 + +dqrmn821 remaindernear 12345678000 100 -> 0 +dqrmn822 remaindernear 1 12345678000 -> 1 +dqrmn823 remaindernear 1234567800 10 -> 0 +dqrmn824 remaindernear 1 1234567800 -> 1 +dqrmn825 remaindernear 1234567890 10 -> 0 +dqrmn826 remaindernear 1 1234567890 -> 1 +dqrmn827 remaindernear 1234567891 10 -> 1 +dqrmn828 remaindernear 1 1234567891 -> 1 +dqrmn829 remaindernear 12345678901 100 -> 1 +dqrmn830 remaindernear 1 12345678901 -> 1 +dqrmn831 remaindernear 1234567896 10 -> -4 +dqrmn832 remaindernear 1 1234567896 -> 1 + +-- from divideint +dqrmn840 remaindernear 100000000.0 1 -> 0.0 +dqrmn841 remaindernear 100000000.4 1 -> 0.4 +dqrmn842 remaindernear 100000000.5 1 -> 0.5 +dqrmn843 remaindernear 100000000.9 1 -> -0.1 +dqrmn844 remaindernear 100000000.999 1 -> -0.001 +dqrmn850 remaindernear 100000003 5 -> -2 +dqrmn851 remaindernear 10000003 5 -> -2 +dqrmn852 remaindernear 1000003 5 -> -2 +dqrmn853 remaindernear 100003 5 -> -2 +dqrmn854 remaindernear 10003 5 -> -2 +dqrmn855 remaindernear 1003 5 -> -2 +dqrmn856 remaindernear 103 5 -> -2 +dqrmn857 remaindernear 13 5 -> -2 +dqrmn858 remaindernear 1 5 -> 1 + +-- Vladimir's cases 1234567890123456 +dqrmn860 remaindernear 123.0e1 1000000000000000 -> 1230 +dqrmn861 remaindernear 1230 1000000000000000 -> 1230 +dqrmn862 remaindernear 12.3e2 1000000000000000 -> 1230 +dqrmn863 remaindernear 1.23e3 1000000000000000 -> 1230 +dqrmn864 remaindernear 123e1 1000000000000000 -> 1230 +dqrmn870 remaindernear 123e1 1000000000000000 -> 1230 +dqrmn871 remaindernear 123e1 100000000000000 -> 1230 +dqrmn872 remaindernear 123e1 10000000000000 -> 1230 +dqrmn873 remaindernear 123e1 1000000000000 -> 1230 +dqrmn874 remaindernear 123e1 100000000000 -> 1230 +dqrmn875 remaindernear 123e1 10000000000 -> 1230 +dqrmn876 remaindernear 123e1 1000000000 -> 1230 +dqrmn877 remaindernear 123e1 100000000 -> 1230 +dqrmn878 remaindernear 1230 100000000 -> 1230 +dqrmn879 remaindernear 123e1 10000000 -> 1230 +dqrmn880 remaindernear 123e1 1000000 -> 1230 +dqrmn881 remaindernear 123e1 100000 -> 1230 +dqrmn882 remaindernear 123e1 10000 -> 1230 +dqrmn883 remaindernear 123e1 1000 -> 230 +dqrmn884 remaindernear 123e1 100 -> 30 +dqrmn885 remaindernear 123e1 10 -> 0 +dqrmn886 remaindernear 123e1 1 -> 0 + +dqrmn890 remaindernear 123e1 2000000000000000 -> 1230 +dqrmn891 remaindernear 123e1 200000000000000 -> 1230 +dqrmn892 remaindernear 123e1 20000000000000 -> 1230 +dqrmn893 remaindernear 123e1 2000000000000 -> 1230 +dqrmn894 remaindernear 123e1 200000000000 -> 1230 +dqrmn895 remaindernear 123e1 20000000000 -> 1230 +dqrmn896 remaindernear 123e1 2000000000 -> 1230 +dqrmn897 remaindernear 123e1 200000000 -> 1230 +dqrmn899 remaindernear 123e1 20000000 -> 1230 +dqrmn900 remaindernear 123e1 2000000 -> 1230 +dqrmn901 remaindernear 123e1 200000 -> 1230 +dqrmn902 remaindernear 123e1 20000 -> 1230 +dqrmn903 remaindernear 123e1 2000 -> -770 +dqrmn904 remaindernear 123e1 200 -> 30 +dqrmn905 remaindernear 123e1 20 -> -10 +dqrmn906 remaindernear 123e1 2 -> 0 + +dqrmn910 remaindernear 123e1 5000000000000000 -> 1230 +dqrmn911 remaindernear 123e1 500000000000000 -> 1230 +dqrmn912 remaindernear 123e1 50000000000000 -> 1230 +dqrmn913 remaindernear 123e1 5000000000000 -> 1230 +dqrmn914 remaindernear 123e1 500000000000 -> 1230 +dqrmn915 remaindernear 123e1 50000000000 -> 1230 +dqrmn916 remaindernear 123e1 5000000000 -> 1230 +dqrmn917 remaindernear 123e1 500000000 -> 1230 +dqrmn919 remaindernear 123e1 50000000 -> 1230 +dqrmn920 remaindernear 123e1 5000000 -> 1230 +dqrmn921 remaindernear 123e1 500000 -> 1230 +dqrmn922 remaindernear 123e1 50000 -> 1230 +dqrmn923 remaindernear 123e1 5000 -> 1230 +dqrmn924 remaindernear 123e1 500 -> 230 +dqrmn925 remaindernear 123e1 50 -> -20 +dqrmn926 remaindernear 123e1 5 -> 0 + +dqrmn930 remaindernear 123e1 9000000000000000 -> 1230 +dqrmn931 remaindernear 123e1 900000000000000 -> 1230 +dqrmn932 remaindernear 123e1 90000000000000 -> 1230 +dqrmn933 remaindernear 123e1 9000000000000 -> 1230 +dqrmn934 remaindernear 123e1 900000000000 -> 1230 +dqrmn935 remaindernear 123e1 90000000000 -> 1230 +dqrmn936 remaindernear 123e1 9000000000 -> 1230 +dqrmn937 remaindernear 123e1 900000000 -> 1230 +dqrmn939 remaindernear 123e1 90000000 -> 1230 +dqrmn940 remaindernear 123e1 9000000 -> 1230 +dqrmn941 remaindernear 123e1 900000 -> 1230 +dqrmn942 remaindernear 123e1 90000 -> 1230 +dqrmn943 remaindernear 123e1 9000 -> 1230 +dqrmn944 remaindernear 123e1 900 -> 330 +dqrmn945 remaindernear 123e1 90 -> -30 +dqrmn946 remaindernear 123e1 9 -> -3 + +dqrmn950 remaindernear 123e1 1000000000000000 -> 1230 +dqrmn961 remaindernear 123e1 2999999999999999 -> 1230 +dqrmn962 remaindernear 123e1 3999999999999999 -> 1230 +dqrmn963 remaindernear 123e1 4999999999999999 -> 1230 +dqrmn964 remaindernear 123e1 5999999999999999 -> 1230 +dqrmn965 remaindernear 123e1 6999999999999999 -> 1230 +dqrmn966 remaindernear 123e1 7999999999999999 -> 1230 +dqrmn967 remaindernear 123e1 8999999999999999 -> 1230 +dqrmn968 remaindernear 123e1 9999999999999999 -> 1230 +dqrmn969 remaindernear 123e1 9876543210987654 -> 1230 + +dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally + +-- overflow and underflow tests [from divide] +dqrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible +dqrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible +dqrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible +dqrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible +dqrmn1055 remaindernear 1e-277 1e+311 -> 1E-277 +dqrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277 +dqrmn1057 remaindernear -1e-277 1e+311 -> -1E-277 +dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277 + +-- Gyuris example +dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143 + +-- destructive subtract +dqrmn1101 remaindernear 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> -0.234567890123456789012345678901233 +dqrmn1102 remaindernear 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> -0.34567890123456789012345678901222 +dqrmn1103 remaindernear 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> -0.4567890123456789012345678901111 +dqrmn1104 remaindernear 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> -1.308641972530864197253086419725314 +dqrmn1105 remaindernear 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692 +dqrmn1106 remaindernear 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> -1.3086421975308642197530864219748 +dqrmn1107 remaindernear 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247 +dqrmn1108 remaindernear 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> -0.753086421975308642197530864219753 +dqrmn1109 remaindernear 1234567890123456789012345678901234 5.000000000000000000000000000000001 -> -1.246913578024691357802469135780247 +dqrmn1110 remaindernear 1234567890123456789012345678901234 5.00000000000000000000000000000001 -> 1.53086421975308642197530864219754 +dqrmn1111 remaindernear 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> -0.6913578024691357802469135780242 + +-- Null tests +dqrmn1000 remaindernear 10 # -> NaN Invalid_operation +dqrmn1001 remaindernear # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRotate.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqRotate.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,298 @@ +------------------------------------------------------------------------ +-- dqRotate.decTest -- rotate decQuad coefficient left or right -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqrot001 rotate 0 0 -> 0 +dqrot002 rotate 0 2 -> 0 +dqrot003 rotate 1 2 -> 100 +dqrot004 rotate 1 33 -> 1000000000000000000000000000000000 +dqrot005 rotate 1 34 -> 1 +dqrot006 rotate 1 -1 -> 1000000000000000000000000000000000 +dqrot007 rotate 0 -2 -> 0 +dqrot008 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123 +dqrot009 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341 +dqrot010 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234 +dqrot011 rotate 9934567890123456789012345678901234 -33 -> 9345678901234567890123456789012349 +dqrot012 rotate 9934567890123456789012345678901234 -34 -> 9934567890123456789012345678901234 + +-- rhs must be an integer +dqrot015 rotate 1 1.5 -> NaN Invalid_operation +dqrot016 rotate 1 1.0 -> NaN Invalid_operation +dqrot017 rotate 1 0.1 -> NaN Invalid_operation +dqrot018 rotate 1 0.0 -> NaN Invalid_operation +dqrot019 rotate 1 1E+1 -> NaN Invalid_operation +dqrot020 rotate 1 1E+99 -> NaN Invalid_operation +dqrot021 rotate 1 Inf -> NaN Invalid_operation +dqrot022 rotate 1 -Inf -> NaN Invalid_operation +-- and |rhs| <= precision +dqrot025 rotate 1 -1000 -> NaN Invalid_operation +dqrot026 rotate 1 -35 -> NaN Invalid_operation +dqrot027 rotate 1 35 -> NaN Invalid_operation +dqrot028 rotate 1 1000 -> NaN Invalid_operation + +-- full pattern +dqrot030 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234 +dqrot031 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341 +dqrot032 rotate 1234567890123456789012345678901234 -32 -> 3456789012345678901234567890123412 +dqrot033 rotate 1234567890123456789012345678901234 -31 -> 4567890123456789012345678901234123 +dqrot034 rotate 1234567890123456789012345678901234 -30 -> 5678901234567890123456789012341234 +dqrot035 rotate 1234567890123456789012345678901234 -29 -> 6789012345678901234567890123412345 +dqrot036 rotate 1234567890123456789012345678901234 -28 -> 7890123456789012345678901234123456 +dqrot037 rotate 1234567890123456789012345678901234 -27 -> 8901234567890123456789012341234567 +dqrot038 rotate 1234567890123456789012345678901234 -26 -> 9012345678901234567890123412345678 +dqrot039 rotate 1234567890123456789012345678901234 -25 -> 123456789012345678901234123456789 +dqrot040 rotate 1234567890123456789012345678901234 -24 -> 1234567890123456789012341234567890 +dqrot041 rotate 1234567890123456789012345678901234 -23 -> 2345678901234567890123412345678901 +dqrot042 rotate 1234567890123456789012345678901234 -22 -> 3456789012345678901234123456789012 +dqrot043 rotate 1234567890123456789012345678901234 -21 -> 4567890123456789012341234567890123 +dqrot044 rotate 1234567890123456789012345678901234 -20 -> 5678901234567890123412345678901234 +dqrot045 rotate 1234567890123456789012345678901234 -19 -> 6789012345678901234123456789012345 +dqrot047 rotate 1234567890123456789012345678901234 -18 -> 7890123456789012341234567890123456 +dqrot048 rotate 1234567890123456789012345678901234 -17 -> 8901234567890123412345678901234567 +dqrot049 rotate 1234567890123456789012345678901234 -16 -> 9012345678901234123456789012345678 +dqrot050 rotate 1234567890123456789012345678901234 -15 -> 123456789012341234567890123456789 +dqrot051 rotate 1234567890123456789012345678901234 -14 -> 1234567890123412345678901234567890 +dqrot052 rotate 1234567890123456789012345678901234 -13 -> 2345678901234123456789012345678901 +dqrot053 rotate 1234567890123456789012345678901234 -12 -> 3456789012341234567890123456789012 +dqrot054 rotate 1234567890123456789012345678901234 -11 -> 4567890123412345678901234567890123 +dqrot055 rotate 1234567890123456789012345678901234 -10 -> 5678901234123456789012345678901234 +dqrot056 rotate 1234567890123456789012345678901234 -9 -> 6789012341234567890123456789012345 +dqrot057 rotate 1234567890123456789012345678901234 -8 -> 7890123412345678901234567890123456 +dqrot058 rotate 1234567890123456789012345678901234 -7 -> 8901234123456789012345678901234567 +dqrot059 rotate 1234567890123456789012345678901234 -6 -> 9012341234567890123456789012345678 +dqrot060 rotate 1234567890123456789012345678901234 -5 -> 123412345678901234567890123456789 +dqrot061 rotate 1234567890123456789012345678901234 -4 -> 1234123456789012345678901234567890 +dqrot062 rotate 1234567890123456789012345678901234 -3 -> 2341234567890123456789012345678901 +dqrot063 rotate 1234567890123456789012345678901234 -2 -> 3412345678901234567890123456789012 +dqrot064 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123 +dqrot065 rotate 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234 + +dqrot066 rotate 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234 +dqrot067 rotate 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012341 +dqrot068 rotate 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123412 +dqrot069 rotate 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234123 +dqrot070 rotate 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012341234 +dqrot071 rotate 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123412345 +dqrot072 rotate 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234123456 +dqrot073 rotate 1234567890123456789012345678901234 +7 -> 8901234567890123456789012341234567 +dqrot074 rotate 1234567890123456789012345678901234 +8 -> 9012345678901234567890123412345678 +dqrot075 rotate 1234567890123456789012345678901234 +9 -> 123456789012345678901234123456789 +dqrot076 rotate 1234567890123456789012345678901234 +10 -> 1234567890123456789012341234567890 +dqrot077 rotate 1234567890123456789012345678901234 +11 -> 2345678901234567890123412345678901 +dqrot078 rotate 1234567890123456789012345678901234 +12 -> 3456789012345678901234123456789012 +dqrot079 rotate 1234567890123456789012345678901234 +13 -> 4567890123456789012341234567890123 +dqrot080 rotate 1234567890123456789012345678901234 +14 -> 5678901234567890123412345678901234 +dqrot081 rotate 1234567890123456789012345678901234 +15 -> 6789012345678901234123456789012345 +dqrot082 rotate 1234567890123456789012345678901234 +16 -> 7890123456789012341234567890123456 +dqrot083 rotate 1234567890123456789012345678901234 +17 -> 8901234567890123412345678901234567 +dqrot084 rotate 1234567890123456789012345678901234 +18 -> 9012345678901234123456789012345678 +dqrot085 rotate 1234567890123456789012345678901234 +19 -> 123456789012341234567890123456789 +dqrot086 rotate 1234567890123456789012345678901234 +20 -> 1234567890123412345678901234567890 +dqrot087 rotate 1234567890123456789012345678901234 +21 -> 2345678901234123456789012345678901 +dqrot088 rotate 1234567890123456789012345678901234 +22 -> 3456789012341234567890123456789012 +dqrot089 rotate 1234567890123456789012345678901234 +23 -> 4567890123412345678901234567890123 +dqrot090 rotate 1234567890123456789012345678901234 +24 -> 5678901234123456789012345678901234 +dqrot091 rotate 1234567890123456789012345678901234 +25 -> 6789012341234567890123456789012345 +dqrot092 rotate 1234567890123456789012345678901234 +26 -> 7890123412345678901234567890123456 +dqrot093 rotate 1234567890123456789012345678901234 +27 -> 8901234123456789012345678901234567 +dqrot094 rotate 1234567890123456789012345678901234 +28 -> 9012341234567890123456789012345678 +dqrot095 rotate 1234567890123456789012345678901234 +29 -> 123412345678901234567890123456789 +dqrot096 rotate 1234567890123456789012345678901234 +30 -> 1234123456789012345678901234567890 +dqrot097 rotate 1234567890123456789012345678901234 +31 -> 2341234567890123456789012345678901 +dqrot098 rotate 1234567890123456789012345678901234 +32 -> 3412345678901234567890123456789012 +dqrot099 rotate 1234567890123456789012345678901234 +33 -> 4123456789012345678901234567890123 +dqrot100 rotate 1234567890123456789012345678901234 +34 -> 1234567890123456789012345678901234 + +-- zeros +dqrot270 rotate 0E-10 +29 -> 0E-10 +dqrot271 rotate 0E-10 -29 -> 0E-10 +dqrot272 rotate 0.000 +29 -> 0.000 +dqrot273 rotate 0.000 -29 -> 0.000 +dqrot274 rotate 0E+10 +29 -> 0E+10 +dqrot275 rotate 0E+10 -29 -> 0E+10 +dqrot276 rotate -0E-10 +29 -> -0E-10 +dqrot277 rotate -0E-10 -29 -> -0E-10 +dqrot278 rotate -0.000 +29 -> -0.000 +dqrot279 rotate -0.000 -29 -> -0.000 +dqrot280 rotate -0E+10 +29 -> -0E+10 +dqrot281 rotate -0E+10 -29 -> -0E+10 + +-- Nmax, Nmin, Ntiny +dqrot141 rotate 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6144 +dqrot142 rotate 9.999999999999999999999999999999999E+6144 -33 -> 9.999999999999999999999999999999999E+6144 +dqrot143 rotate 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 +dqrot144 rotate 9.999999999999999999999999999999999E+6144 33 -> 9.999999999999999999999999999999999E+6144 +dqrot145 rotate 1E-6143 -1 -> 1.000000000000000000000000000000000E-6110 +dqrot146 rotate 1E-6143 -33 -> 1.0E-6142 +dqrot147 rotate 1E-6143 1 -> 1.0E-6142 +dqrot148 rotate 1E-6143 33 -> 1.000000000000000000000000000000000E-6110 +dqrot151 rotate 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 +dqrot152 rotate 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 +dqrot153 rotate 1.000000000000000000000000000000000E-6143 1 -> 1E-6176 +dqrot154 rotate 1.000000000000000000000000000000000E-6143 33 -> 1.00000000000000000000000000000000E-6144 +dqrot155 rotate 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144 +dqrot156 rotate 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176 +dqrot157 rotate 9.000000000000000000000000000000000E-6143 1 -> 9E-6176 +dqrot158 rotate 9.000000000000000000000000000000000E-6143 33 -> 9.00000000000000000000000000000000E-6144 +dqrot160 rotate 1E-6176 -1 -> 1.000000000000000000000000000000000E-6143 +dqrot161 rotate 1E-6176 -33 -> 1.0E-6175 +dqrot162 rotate 1E-6176 1 -> 1.0E-6175 +dqrot163 rotate 1E-6176 33 -> 1.000000000000000000000000000000000E-6143 +-- negatives +dqrot171 rotate -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 +dqrot172 rotate -9.999999999999999999999999999999999E+6144 -33 -> -9.999999999999999999999999999999999E+6144 +dqrot173 rotate -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999999E+6144 +dqrot174 rotate -9.999999999999999999999999999999999E+6144 33 -> -9.999999999999999999999999999999999E+6144 +dqrot175 rotate -1E-6143 -1 -> -1.000000000000000000000000000000000E-6110 +dqrot176 rotate -1E-6143 -33 -> -1.0E-6142 +dqrot177 rotate -1E-6143 1 -> -1.0E-6142 +dqrot178 rotate -1E-6143 33 -> -1.000000000000000000000000000000000E-6110 +dqrot181 rotate -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 +dqrot182 rotate -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176 +dqrot183 rotate -1.000000000000000000000000000000000E-6143 1 -> -1E-6176 +dqrot184 rotate -1.000000000000000000000000000000000E-6143 33 -> -1.00000000000000000000000000000000E-6144 +dqrot185 rotate -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144 +dqrot186 rotate -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176 +dqrot187 rotate -9.000000000000000000000000000000000E-6143 1 -> -9E-6176 +dqrot188 rotate -9.000000000000000000000000000000000E-6143 33 -> -9.00000000000000000000000000000000E-6144 +dqrot190 rotate -1E-6176 -1 -> -1.000000000000000000000000000000000E-6143 +dqrot191 rotate -1E-6176 -33 -> -1.0E-6175 +dqrot192 rotate -1E-6176 1 -> -1.0E-6175 +dqrot193 rotate -1E-6176 33 -> -1.000000000000000000000000000000000E-6143 + +-- more negatives (of sanities) +dqrot201 rotate -0 0 -> -0 +dqrot202 rotate -0 2 -> -0 +dqrot203 rotate -1 2 -> -100 +dqrot204 rotate -1 33 -> -1000000000000000000000000000000000 +dqrot205 rotate -1 34 -> -1 +dqrot206 rotate -1 -1 -> -1000000000000000000000000000000000 +dqrot207 rotate -0 -2 -> -0 +dqrot208 rotate -1234567890123456789012345678901234 -1 -> -4123456789012345678901234567890123 +dqrot209 rotate -1234567890123456789012345678901234 -33 -> -2345678901234567890123456789012341 +dqrot210 rotate -1234567890123456789012345678901234 -34 -> -1234567890123456789012345678901234 +dqrot211 rotate -9934567890123456789012345678901234 -33 -> -9345678901234567890123456789012349 +dqrot212 rotate -9934567890123456789012345678901234 -34 -> -9934567890123456789012345678901234 + + +-- Specials; NaNs are handled as usual +dqrot781 rotate -Inf -8 -> -Infinity +dqrot782 rotate -Inf -1 -> -Infinity +dqrot783 rotate -Inf -0 -> -Infinity +dqrot784 rotate -Inf 0 -> -Infinity +dqrot785 rotate -Inf 1 -> -Infinity +dqrot786 rotate -Inf 8 -> -Infinity +dqrot787 rotate -1000 -Inf -> NaN Invalid_operation +dqrot788 rotate -Inf -Inf -> NaN Invalid_operation +dqrot789 rotate -1 -Inf -> NaN Invalid_operation +dqrot790 rotate -0 -Inf -> NaN Invalid_operation +dqrot791 rotate 0 -Inf -> NaN Invalid_operation +dqrot792 rotate 1 -Inf -> NaN Invalid_operation +dqrot793 rotate 1000 -Inf -> NaN Invalid_operation +dqrot794 rotate Inf -Inf -> NaN Invalid_operation + +dqrot800 rotate Inf -Inf -> NaN Invalid_operation +dqrot801 rotate Inf -8 -> Infinity +dqrot802 rotate Inf -1 -> Infinity +dqrot803 rotate Inf -0 -> Infinity +dqrot804 rotate Inf 0 -> Infinity +dqrot805 rotate Inf 1 -> Infinity +dqrot806 rotate Inf 8 -> Infinity +dqrot807 rotate Inf Inf -> NaN Invalid_operation +dqrot808 rotate -1000 Inf -> NaN Invalid_operation +dqrot809 rotate -Inf Inf -> NaN Invalid_operation +dqrot810 rotate -1 Inf -> NaN Invalid_operation +dqrot811 rotate -0 Inf -> NaN Invalid_operation +dqrot812 rotate 0 Inf -> NaN Invalid_operation +dqrot813 rotate 1 Inf -> NaN Invalid_operation +dqrot814 rotate 1000 Inf -> NaN Invalid_operation +dqrot815 rotate Inf Inf -> NaN Invalid_operation + +dqrot821 rotate NaN -Inf -> NaN +dqrot822 rotate NaN -1000 -> NaN +dqrot823 rotate NaN -1 -> NaN +dqrot824 rotate NaN -0 -> NaN +dqrot825 rotate NaN 0 -> NaN +dqrot826 rotate NaN 1 -> NaN +dqrot827 rotate NaN 1000 -> NaN +dqrot828 rotate NaN Inf -> NaN +dqrot829 rotate NaN NaN -> NaN +dqrot830 rotate -Inf NaN -> NaN +dqrot831 rotate -1000 NaN -> NaN +dqrot832 rotate -1 NaN -> NaN +dqrot833 rotate -0 NaN -> NaN +dqrot834 rotate 0 NaN -> NaN +dqrot835 rotate 1 NaN -> NaN +dqrot836 rotate 1000 NaN -> NaN +dqrot837 rotate Inf NaN -> NaN + +dqrot841 rotate sNaN -Inf -> NaN Invalid_operation +dqrot842 rotate sNaN -1000 -> NaN Invalid_operation +dqrot843 rotate sNaN -1 -> NaN Invalid_operation +dqrot844 rotate sNaN -0 -> NaN Invalid_operation +dqrot845 rotate sNaN 0 -> NaN Invalid_operation +dqrot846 rotate sNaN 1 -> NaN Invalid_operation +dqrot847 rotate sNaN 1000 -> NaN Invalid_operation +dqrot848 rotate sNaN NaN -> NaN Invalid_operation +dqrot849 rotate sNaN sNaN -> NaN Invalid_operation +dqrot850 rotate NaN sNaN -> NaN Invalid_operation +dqrot851 rotate -Inf sNaN -> NaN Invalid_operation +dqrot852 rotate -1000 sNaN -> NaN Invalid_operation +dqrot853 rotate -1 sNaN -> NaN Invalid_operation +dqrot854 rotate -0 sNaN -> NaN Invalid_operation +dqrot855 rotate 0 sNaN -> NaN Invalid_operation +dqrot856 rotate 1 sNaN -> NaN Invalid_operation +dqrot857 rotate 1000 sNaN -> NaN Invalid_operation +dqrot858 rotate Inf sNaN -> NaN Invalid_operation +dqrot859 rotate NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqrot861 rotate NaN1 -Inf -> NaN1 +dqrot862 rotate +NaN2 -1000 -> NaN2 +dqrot863 rotate NaN3 1000 -> NaN3 +dqrot864 rotate NaN4 Inf -> NaN4 +dqrot865 rotate NaN5 +NaN6 -> NaN5 +dqrot866 rotate -Inf NaN7 -> NaN7 +dqrot867 rotate -1000 NaN8 -> NaN8 +dqrot868 rotate 1000 NaN9 -> NaN9 +dqrot869 rotate Inf +NaN10 -> NaN10 +dqrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation +dqrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation +dqrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation +dqrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation +dqrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation +dqrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation +dqrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation +dqrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation +dqrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation +dqrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation +dqrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation +dqrot882 rotate -NaN26 NaN28 -> -NaN26 +dqrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation +dqrot884 rotate 1000 -NaN30 -> -NaN30 +dqrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqSameQuantum.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqSameQuantum.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,389 @@ +------------------------------------------------------------------------ +-- dqSameQuantum.decTest -- check decQuad quantums match -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- All operands and results are decQuads. +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqsamq001 samequantum 0 0 -> 1 +dqsamq002 samequantum 0 1 -> 1 +dqsamq003 samequantum 1 0 -> 1 +dqsamq004 samequantum 1 1 -> 1 + +dqsamq011 samequantum 10 1E+1 -> 0 +dqsamq012 samequantum 10E+1 10E+1 -> 1 +dqsamq013 samequantum 100 10E+1 -> 0 +dqsamq014 samequantum 100 1E+2 -> 0 +dqsamq015 samequantum 0.1 1E-2 -> 0 +dqsamq016 samequantum 0.1 1E-1 -> 1 +dqsamq017 samequantum 0.1 1E-0 -> 0 +dqsamq018 samequantum 999 999 -> 1 +dqsamq019 samequantum 999E-1 99.9 -> 1 +dqsamq020 samequantum 111E-1 22.2 -> 1 +dqsamq021 samequantum 111E-1 1234.2 -> 1 + +-- zeros +dqsamq030 samequantum 0.0 1.1 -> 1 +dqsamq031 samequantum 0.0 1.11 -> 0 +dqsamq032 samequantum 0.0 0 -> 0 +dqsamq033 samequantum 0.0 0.0 -> 1 +dqsamq034 samequantum 0.0 0.00 -> 0 +dqsamq035 samequantum 0E+1 0E+0 -> 0 +dqsamq036 samequantum 0E+1 0E+1 -> 1 +dqsamq037 samequantum 0E+1 0E+2 -> 0 +dqsamq038 samequantum 0E-17 0E-16 -> 0 +dqsamq039 samequantum 0E-17 0E-17 -> 1 +dqsamq040 samequantum 0E-17 0E-18 -> 0 +dqsamq041 samequantum 0E-17 0.0E-15 -> 0 +dqsamq042 samequantum 0E-17 0.0E-16 -> 1 +dqsamq043 samequantum 0E-17 0.0E-17 -> 0 +dqsamq044 samequantum -0E-17 0.0E-16 -> 1 +dqsamq045 samequantum 0E-17 -0.0E-17 -> 0 +dqsamq046 samequantum 0E-17 -0.0E-16 -> 1 +dqsamq047 samequantum -0E-17 0.0E-17 -> 0 +dqsamq048 samequantum -0E-17 -0.0E-16 -> 1 +dqsamq049 samequantum -0E-17 -0.0E-17 -> 0 + +-- Nmax, Nmin, Ntiny +dqsamq051 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1 +dqsamq052 samequantum 1E-6143 1E-6143 -> 1 +dqsamq053 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1 +dqsamq054 samequantum 1E-6176 1E-6176 -> 1 +dqsamq055 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1 +dqsamq056 samequantum 1E-6143 1E-6143 -> 1 +dqsamq057 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1 +dqsamq058 samequantum 1E-6176 1E-6176 -> 1 + +dqsamq061 samequantum -1E-6176 -1E-6176 -> 1 +dqsamq062 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1 +dqsamq063 samequantum -1E-6143 -1E-6143 -> 1 +dqsamq064 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1 +dqsamq065 samequantum -1E-6176 -1E-6176 -> 1 +dqsamq066 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1 +dqsamq067 samequantum -1E-6143 -1E-6143 -> 1 +dqsamq068 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1 + +dqsamq071 samequantum -4E-6176 -1E-6176 -> 1 +dqsamq072 samequantum -4.00000000000000000000000000000000E-6143 -1.00000000000000000000000000004000E-6143 -> 1 +dqsamq073 samequantum -4E-6143 -1E-6143 -> 1 +dqsamq074 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6144 -> 1 +dqsamq075 samequantum -4E-6176 -1E-6176 -> 1 +dqsamq076 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6143 -> 1 +dqsamq077 samequantum -4E-6143 -1E-6143 -> 1 +dqsamq078 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6144 -> 1 + +dqsamq081 samequantum -4E-1006 -1E-6176 -> 0 +dqsamq082 samequantum -4.00000000000000000000000000000000E-6143 -1.00004000000000000000000000000000E-6136 -> 0 +dqsamq083 samequantum -4E-6140 -1E-6143 -> 0 +dqsamq084 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6136 -> 0 +dqsamq085 samequantum -4E-1006 -1E-6176 -> 0 +dqsamq086 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6136 -> 0 +dqsamq087 samequantum -4E-6133 -1E-6143 -> 0 +dqsamq088 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6136 -> 0 + +-- specials & combinations +dqsamq0110 samequantum -Inf -Inf -> 1 +dqsamq0111 samequantum -Inf Inf -> 1 +dqsamq0112 samequantum -Inf NaN -> 0 +dqsamq0113 samequantum -Inf -7E+3 -> 0 +dqsamq0114 samequantum -Inf -7 -> 0 +dqsamq0115 samequantum -Inf -7E-3 -> 0 +dqsamq0116 samequantum -Inf -0E-3 -> 0 +dqsamq0117 samequantum -Inf -0 -> 0 +dqsamq0118 samequantum -Inf -0E+3 -> 0 +dqsamq0119 samequantum -Inf 0E-3 -> 0 +dqsamq0120 samequantum -Inf 0 -> 0 +dqsamq0121 samequantum -Inf 0E+3 -> 0 +dqsamq0122 samequantum -Inf 7E-3 -> 0 +dqsamq0123 samequantum -Inf 7 -> 0 +dqsamq0124 samequantum -Inf 7E+3 -> 0 +dqsamq0125 samequantum -Inf sNaN -> 0 + +dqsamq0210 samequantum Inf -Inf -> 1 +dqsamq0211 samequantum Inf Inf -> 1 +dqsamq0212 samequantum Inf NaN -> 0 +dqsamq0213 samequantum Inf -7E+3 -> 0 +dqsamq0214 samequantum Inf -7 -> 0 +dqsamq0215 samequantum Inf -7E-3 -> 0 +dqsamq0216 samequantum Inf -0E-3 -> 0 +dqsamq0217 samequantum Inf -0 -> 0 +dqsamq0218 samequantum Inf -0E+3 -> 0 +dqsamq0219 samequantum Inf 0E-3 -> 0 +dqsamq0220 samequantum Inf 0 -> 0 +dqsamq0221 samequantum Inf 0E+3 -> 0 +dqsamq0222 samequantum Inf 7E-3 -> 0 +dqsamq0223 samequantum Inf 7 -> 0 +dqsamq0224 samequantum Inf 7E+3 -> 0 +dqsamq0225 samequantum Inf sNaN -> 0 + +dqsamq0310 samequantum NaN -Inf -> 0 +dqsamq0311 samequantum NaN Inf -> 0 +dqsamq0312 samequantum NaN NaN -> 1 +dqsamq0313 samequantum NaN -7E+3 -> 0 +dqsamq0314 samequantum NaN -7 -> 0 +dqsamq0315 samequantum NaN -7E-3 -> 0 +dqsamq0316 samequantum NaN -0E-3 -> 0 +dqsamq0317 samequantum NaN -0 -> 0 +dqsamq0318 samequantum NaN -0E+3 -> 0 +dqsamq0319 samequantum NaN 0E-3 -> 0 +dqsamq0320 samequantum NaN 0 -> 0 +dqsamq0321 samequantum NaN 0E+3 -> 0 +dqsamq0322 samequantum NaN 7E-3 -> 0 +dqsamq0323 samequantum NaN 7 -> 0 +dqsamq0324 samequantum NaN 7E+3 -> 0 +dqsamq0325 samequantum NaN sNaN -> 1 + +dqsamq0410 samequantum -7E+3 -Inf -> 0 +dqsamq0411 samequantum -7E+3 Inf -> 0 +dqsamq0412 samequantum -7E+3 NaN -> 0 +dqsamq0413 samequantum -7E+3 -7E+3 -> 1 +dqsamq0414 samequantum -7E+3 -7 -> 0 +dqsamq0415 samequantum -7E+3 -7E-3 -> 0 +dqsamq0416 samequantum -7E+3 -0E-3 -> 0 +dqsamq0417 samequantum -7E+3 -0 -> 0 +dqsamq0418 samequantum -7E+3 -0E+3 -> 1 +dqsamq0419 samequantum -7E+3 0E-3 -> 0 +dqsamq0420 samequantum -7E+3 0 -> 0 +dqsamq0421 samequantum -7E+3 0E+3 -> 1 +dqsamq0422 samequantum -7E+3 7E-3 -> 0 +dqsamq0423 samequantum -7E+3 7 -> 0 +dqsamq0424 samequantum -7E+3 7E+3 -> 1 +dqsamq0425 samequantum -7E+3 sNaN -> 0 + +dqsamq0510 samequantum -7 -Inf -> 0 +dqsamq0511 samequantum -7 Inf -> 0 +dqsamq0512 samequantum -7 NaN -> 0 +dqsamq0513 samequantum -7 -7E+3 -> 0 +dqsamq0514 samequantum -7 -7 -> 1 +dqsamq0515 samequantum -7 -7E-3 -> 0 +dqsamq0516 samequantum -7 -0E-3 -> 0 +dqsamq0517 samequantum -7 -0 -> 1 +dqsamq0518 samequantum -7 -0E+3 -> 0 +dqsamq0519 samequantum -7 0E-3 -> 0 +dqsamq0520 samequantum -7 0 -> 1 +dqsamq0521 samequantum -7 0E+3 -> 0 +dqsamq0522 samequantum -7 7E-3 -> 0 +dqsamq0523 samequantum -7 7 -> 1 +dqsamq0524 samequantum -7 7E+3 -> 0 +dqsamq0525 samequantum -7 sNaN -> 0 + +dqsamq0610 samequantum -7E-3 -Inf -> 0 +dqsamq0611 samequantum -7E-3 Inf -> 0 +dqsamq0612 samequantum -7E-3 NaN -> 0 +dqsamq0613 samequantum -7E-3 -7E+3 -> 0 +dqsamq0614 samequantum -7E-3 -7 -> 0 +dqsamq0615 samequantum -7E-3 -7E-3 -> 1 +dqsamq0616 samequantum -7E-3 -0E-3 -> 1 +dqsamq0617 samequantum -7E-3 -0 -> 0 +dqsamq0618 samequantum -7E-3 -0E+3 -> 0 +dqsamq0619 samequantum -7E-3 0E-3 -> 1 +dqsamq0620 samequantum -7E-3 0 -> 0 +dqsamq0621 samequantum -7E-3 0E+3 -> 0 +dqsamq0622 samequantum -7E-3 7E-3 -> 1 +dqsamq0623 samequantum -7E-3 7 -> 0 +dqsamq0624 samequantum -7E-3 7E+3 -> 0 +dqsamq0625 samequantum -7E-3 sNaN -> 0 + +dqsamq0710 samequantum -0E-3 -Inf -> 0 +dqsamq0711 samequantum -0E-3 Inf -> 0 +dqsamq0712 samequantum -0E-3 NaN -> 0 +dqsamq0713 samequantum -0E-3 -7E+3 -> 0 +dqsamq0714 samequantum -0E-3 -7 -> 0 +dqsamq0715 samequantum -0E-3 -7E-3 -> 1 +dqsamq0716 samequantum -0E-3 -0E-3 -> 1 +dqsamq0717 samequantum -0E-3 -0 -> 0 +dqsamq0718 samequantum -0E-3 -0E+3 -> 0 +dqsamq0719 samequantum -0E-3 0E-3 -> 1 +dqsamq0720 samequantum -0E-3 0 -> 0 +dqsamq0721 samequantum -0E-3 0E+3 -> 0 +dqsamq0722 samequantum -0E-3 7E-3 -> 1 +dqsamq0723 samequantum -0E-3 7 -> 0 +dqsamq0724 samequantum -0E-3 7E+3 -> 0 +dqsamq0725 samequantum -0E-3 sNaN -> 0 + +dqsamq0810 samequantum -0 -Inf -> 0 +dqsamq0811 samequantum -0 Inf -> 0 +dqsamq0812 samequantum -0 NaN -> 0 +dqsamq0813 samequantum -0 -7E+3 -> 0 +dqsamq0814 samequantum -0 -7 -> 1 +dqsamq0815 samequantum -0 -7E-3 -> 0 +dqsamq0816 samequantum -0 -0E-3 -> 0 +dqsamq0817 samequantum -0 -0 -> 1 +dqsamq0818 samequantum -0 -0E+3 -> 0 +dqsamq0819 samequantum -0 0E-3 -> 0 +dqsamq0820 samequantum -0 0 -> 1 +dqsamq0821 samequantum -0 0E+3 -> 0 +dqsamq0822 samequantum -0 7E-3 -> 0 +dqsamq0823 samequantum -0 7 -> 1 +dqsamq0824 samequantum -0 7E+3 -> 0 +dqsamq0825 samequantum -0 sNaN -> 0 + +dqsamq0910 samequantum -0E+3 -Inf -> 0 +dqsamq0911 samequantum -0E+3 Inf -> 0 +dqsamq0912 samequantum -0E+3 NaN -> 0 +dqsamq0913 samequantum -0E+3 -7E+3 -> 1 +dqsamq0914 samequantum -0E+3 -7 -> 0 +dqsamq0915 samequantum -0E+3 -7E-3 -> 0 +dqsamq0916 samequantum -0E+3 -0E-3 -> 0 +dqsamq0917 samequantum -0E+3 -0 -> 0 +dqsamq0918 samequantum -0E+3 -0E+3 -> 1 +dqsamq0919 samequantum -0E+3 0E-3 -> 0 +dqsamq0920 samequantum -0E+3 0 -> 0 +dqsamq0921 samequantum -0E+3 0E+3 -> 1 +dqsamq0922 samequantum -0E+3 7E-3 -> 0 +dqsamq0923 samequantum -0E+3 7 -> 0 +dqsamq0924 samequantum -0E+3 7E+3 -> 1 +dqsamq0925 samequantum -0E+3 sNaN -> 0 + +dqsamq1110 samequantum 0E-3 -Inf -> 0 +dqsamq1111 samequantum 0E-3 Inf -> 0 +dqsamq1112 samequantum 0E-3 NaN -> 0 +dqsamq1113 samequantum 0E-3 -7E+3 -> 0 +dqsamq1114 samequantum 0E-3 -7 -> 0 +dqsamq1115 samequantum 0E-3 -7E-3 -> 1 +dqsamq1116 samequantum 0E-3 -0E-3 -> 1 +dqsamq1117 samequantum 0E-3 -0 -> 0 +dqsamq1118 samequantum 0E-3 -0E+3 -> 0 +dqsamq1119 samequantum 0E-3 0E-3 -> 1 +dqsamq1120 samequantum 0E-3 0 -> 0 +dqsamq1121 samequantum 0E-3 0E+3 -> 0 +dqsamq1122 samequantum 0E-3 7E-3 -> 1 +dqsamq1123 samequantum 0E-3 7 -> 0 +dqsamq1124 samequantum 0E-3 7E+3 -> 0 +dqsamq1125 samequantum 0E-3 sNaN -> 0 + +dqsamq1210 samequantum 0 -Inf -> 0 +dqsamq1211 samequantum 0 Inf -> 0 +dqsamq1212 samequantum 0 NaN -> 0 +dqsamq1213 samequantum 0 -7E+3 -> 0 +dqsamq1214 samequantum 0 -7 -> 1 +dqsamq1215 samequantum 0 -7E-3 -> 0 +dqsamq1216 samequantum 0 -0E-3 -> 0 +dqsamq1217 samequantum 0 -0 -> 1 +dqsamq1218 samequantum 0 -0E+3 -> 0 +dqsamq1219 samequantum 0 0E-3 -> 0 +dqsamq1220 samequantum 0 0 -> 1 +dqsamq1221 samequantum 0 0E+3 -> 0 +dqsamq1222 samequantum 0 7E-3 -> 0 +dqsamq1223 samequantum 0 7 -> 1 +dqsamq1224 samequantum 0 7E+3 -> 0 +dqsamq1225 samequantum 0 sNaN -> 0 + +dqsamq1310 samequantum 0E+3 -Inf -> 0 +dqsamq1311 samequantum 0E+3 Inf -> 0 +dqsamq1312 samequantum 0E+3 NaN -> 0 +dqsamq1313 samequantum 0E+3 -7E+3 -> 1 +dqsamq1314 samequantum 0E+3 -7 -> 0 +dqsamq1315 samequantum 0E+3 -7E-3 -> 0 +dqsamq1316 samequantum 0E+3 -0E-3 -> 0 +dqsamq1317 samequantum 0E+3 -0 -> 0 +dqsamq1318 samequantum 0E+3 -0E+3 -> 1 +dqsamq1319 samequantum 0E+3 0E-3 -> 0 +dqsamq1320 samequantum 0E+3 0 -> 0 +dqsamq1321 samequantum 0E+3 0E+3 -> 1 +dqsamq1322 samequantum 0E+3 7E-3 -> 0 +dqsamq1323 samequantum 0E+3 7 -> 0 +dqsamq1324 samequantum 0E+3 7E+3 -> 1 +dqsamq1325 samequantum 0E+3 sNaN -> 0 + +dqsamq1410 samequantum 7E-3 -Inf -> 0 +dqsamq1411 samequantum 7E-3 Inf -> 0 +dqsamq1412 samequantum 7E-3 NaN -> 0 +dqsamq1413 samequantum 7E-3 -7E+3 -> 0 +dqsamq1414 samequantum 7E-3 -7 -> 0 +dqsamq1415 samequantum 7E-3 -7E-3 -> 1 +dqsamq1416 samequantum 7E-3 -0E-3 -> 1 +dqsamq1417 samequantum 7E-3 -0 -> 0 +dqsamq1418 samequantum 7E-3 -0E+3 -> 0 +dqsamq1419 samequantum 7E-3 0E-3 -> 1 +dqsamq1420 samequantum 7E-3 0 -> 0 +dqsamq1421 samequantum 7E-3 0E+3 -> 0 +dqsamq1422 samequantum 7E-3 7E-3 -> 1 +dqsamq1423 samequantum 7E-3 7 -> 0 +dqsamq1424 samequantum 7E-3 7E+3 -> 0 +dqsamq1425 samequantum 7E-3 sNaN -> 0 + +dqsamq1510 samequantum 7 -Inf -> 0 +dqsamq1511 samequantum 7 Inf -> 0 +dqsamq1512 samequantum 7 NaN -> 0 +dqsamq1513 samequantum 7 -7E+3 -> 0 +dqsamq1514 samequantum 7 -7 -> 1 +dqsamq1515 samequantum 7 -7E-3 -> 0 +dqsamq1516 samequantum 7 -0E-3 -> 0 +dqsamq1517 samequantum 7 -0 -> 1 +dqsamq1518 samequantum 7 -0E+3 -> 0 +dqsamq1519 samequantum 7 0E-3 -> 0 +dqsamq1520 samequantum 7 0 -> 1 +dqsamq1521 samequantum 7 0E+3 -> 0 +dqsamq1522 samequantum 7 7E-3 -> 0 +dqsamq1523 samequantum 7 7 -> 1 +dqsamq1524 samequantum 7 7E+3 -> 0 +dqsamq1525 samequantum 7 sNaN -> 0 + +dqsamq1610 samequantum 7E+3 -Inf -> 0 +dqsamq1611 samequantum 7E+3 Inf -> 0 +dqsamq1612 samequantum 7E+3 NaN -> 0 +dqsamq1613 samequantum 7E+3 -7E+3 -> 1 +dqsamq1614 samequantum 7E+3 -7 -> 0 +dqsamq1615 samequantum 7E+3 -7E-3 -> 0 +dqsamq1616 samequantum 7E+3 -0E-3 -> 0 +dqsamq1617 samequantum 7E+3 -0 -> 0 +dqsamq1618 samequantum 7E+3 -0E+3 -> 1 +dqsamq1619 samequantum 7E+3 0E-3 -> 0 +dqsamq1620 samequantum 7E+3 0 -> 0 +dqsamq1621 samequantum 7E+3 0E+3 -> 1 +dqsamq1622 samequantum 7E+3 7E-3 -> 0 +dqsamq1623 samequantum 7E+3 7 -> 0 +dqsamq1624 samequantum 7E+3 7E+3 -> 1 +dqsamq1625 samequantum 7E+3 sNaN -> 0 + +dqsamq1710 samequantum sNaN -Inf -> 0 +dqsamq1711 samequantum sNaN Inf -> 0 +dqsamq1712 samequantum sNaN NaN -> 1 +dqsamq1713 samequantum sNaN -7E+3 -> 0 +dqsamq1714 samequantum sNaN -7 -> 0 +dqsamq1715 samequantum sNaN -7E-3 -> 0 +dqsamq1716 samequantum sNaN -0E-3 -> 0 +dqsamq1717 samequantum sNaN -0 -> 0 +dqsamq1718 samequantum sNaN -0E+3 -> 0 +dqsamq1719 samequantum sNaN 0E-3 -> 0 +dqsamq1720 samequantum sNaN 0 -> 0 +dqsamq1721 samequantum sNaN 0E+3 -> 0 +dqsamq1722 samequantum sNaN 7E-3 -> 0 +dqsamq1723 samequantum sNaN 7 -> 0 +dqsamq1724 samequantum sNaN 7E+3 -> 0 +dqsamq1725 samequantum sNaN sNaN -> 1 +-- noisy NaNs +dqsamq1730 samequantum sNaN3 sNaN3 -> 1 +dqsamq1731 samequantum sNaN3 sNaN4 -> 1 +dqsamq1732 samequantum NaN3 NaN3 -> 1 +dqsamq1733 samequantum NaN3 NaN4 -> 1 +dqsamq1734 samequantum sNaN3 3 -> 0 +dqsamq1735 samequantum NaN3 3 -> 0 +dqsamq1736 samequantum 4 sNaN4 -> 0 +dqsamq1737 samequantum 3 NaN3 -> 0 +dqsamq1738 samequantum Inf sNaN4 -> 0 +dqsamq1739 samequantum -Inf NaN3 -> 0 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqScaleB.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqScaleB.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,260 @@ +------------------------------------------------------------------------ +-- dqScalebB.decTest -- scale a decQuad by powers of 10 -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Max |rhs| is 2*(6144+34) = 12356 + +-- Sanity checks +dqscb001 scaleb 7.50 10 -> 7.50E+10 +dqscb002 scaleb 7.50 3 -> 7.50E+3 +dqscb003 scaleb 7.50 2 -> 750 +dqscb004 scaleb 7.50 1 -> 75.0 +dqscb005 scaleb 7.50 0 -> 7.50 +dqscb006 scaleb 7.50 -1 -> 0.750 +dqscb007 scaleb 7.50 -2 -> 0.0750 +dqscb008 scaleb 7.50 -10 -> 7.50E-10 +dqscb009 scaleb -7.50 3 -> -7.50E+3 +dqscb010 scaleb -7.50 2 -> -750 +dqscb011 scaleb -7.50 1 -> -75.0 +dqscb012 scaleb -7.50 0 -> -7.50 +dqscb013 scaleb -7.50 -1 -> -0.750 + +-- Infinities +dqscb014 scaleb Infinity 1 -> Infinity +dqscb015 scaleb -Infinity 2 -> -Infinity +dqscb016 scaleb Infinity -1 -> Infinity +dqscb017 scaleb -Infinity -2 -> -Infinity + +-- Next two are somewhat undefined in 754r; treat as non-integer +dqscb018 scaleb 10 Infinity -> NaN Invalid_operation +dqscb019 scaleb 10 -Infinity -> NaN Invalid_operation + +-- NaNs are undefined in 754r; assume usual processing +-- NaNs, 0 payload +dqscb021 scaleb NaN 1 -> NaN +dqscb022 scaleb -NaN -1 -> -NaN +dqscb023 scaleb sNaN 1 -> NaN Invalid_operation +dqscb024 scaleb -sNaN 1 -> -NaN Invalid_operation +dqscb025 scaleb 4 NaN -> NaN +dqscb026 scaleb -Inf -NaN -> -NaN +dqscb027 scaleb 4 sNaN -> NaN Invalid_operation +dqscb028 scaleb Inf -sNaN -> -NaN Invalid_operation + +-- non-integer RHS +dqscb030 scaleb 1.23 1 -> 12.3 +dqscb031 scaleb 1.23 1.00 -> NaN Invalid_operation +dqscb032 scaleb 1.23 1.1 -> NaN Invalid_operation +dqscb033 scaleb 1.23 1.01 -> NaN Invalid_operation +dqscb034 scaleb 1.23 0.01 -> NaN Invalid_operation +dqscb035 scaleb 1.23 0.11 -> NaN Invalid_operation +dqscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation +dqscb037 scaleb 1.23 -1 -> 0.123 +dqscb0614 scaleb 1.23 -1.00 -> NaN Invalid_operation +dqscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation +dqscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation +dqscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation +dqscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation +dqscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation +dqscb044 scaleb 1.23 0.1 -> NaN Invalid_operation +dqscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation +dqscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation +dqscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation + +-- out-of range RHS +dqscb120 scaleb 1.23 12355 -> Infinity Overflow Inexact Rounded +dqscb121 scaleb 1.23 12356 -> Infinity Overflow Inexact Rounded +dqscb122 scaleb 1.23 12357 -> NaN Invalid_operation +dqscb123 scaleb 1.23 12358 -> NaN Invalid_operation +dqscb124 scaleb 1.23 -12355 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqscb125 scaleb 1.23 -12356 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqscb126 scaleb 1.23 -12357 -> NaN Invalid_operation +dqscb127 scaleb 1.23 -12358 -> NaN Invalid_operation + +-- NaNs, non-0 payload +-- propagating NaNs +dqscb861 scaleb NaN01 -Inf -> NaN1 +dqscb862 scaleb -NaN02 -1000 -> -NaN2 +dqscb863 scaleb NaN03 1000 -> NaN3 +dqscb864 scaleb NaN04 Inf -> NaN4 +dqscb865 scaleb NaN05 NaN61 -> NaN5 +dqscb866 scaleb -Inf -NaN71 -> -NaN71 +dqscb867 scaleb -1000 NaN81 -> NaN81 +dqscb868 scaleb 1000 NaN91 -> NaN91 +dqscb869 scaleb Inf NaN101 -> NaN101 +dqscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation +dqscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation +dqscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation +dqscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation +dqscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation +dqscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation +dqscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation +dqscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation +dqscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation +dqscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation +dqscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation + +-- finites +dqscb051 scaleb 7 -2 -> 0.07 +dqscb052 scaleb -7 -2 -> -0.07 +dqscb053 scaleb 75 -2 -> 0.75 +dqscb054 scaleb -75 -2 -> -0.75 +dqscb055 scaleb 7.50 -2 -> 0.0750 +dqscb056 scaleb -7.50 -2 -> -0.0750 +dqscb057 scaleb 7.500 -2 -> 0.07500 +dqscb058 scaleb -7.500 -2 -> -0.07500 +dqscb061 scaleb 7 -1 -> 0.7 +dqscb062 scaleb -7 -1 -> -0.7 +dqscb063 scaleb 75 -1 -> 7.5 +dqscb064 scaleb -75 -1 -> -7.5 +dqscb065 scaleb 7.50 -1 -> 0.750 +dqscb066 scaleb -7.50 -1 -> -0.750 +dqscb067 scaleb 7.500 -1 -> 0.7500 +dqscb068 scaleb -7.500 -1 -> -0.7500 +dqscb071 scaleb 7 0 -> 7 +dqscb072 scaleb -7 0 -> -7 +dqscb073 scaleb 75 0 -> 75 +dqscb074 scaleb -75 0 -> -75 +dqscb075 scaleb 7.50 0 -> 7.50 +dqscb076 scaleb -7.50 0 -> -7.50 +dqscb077 scaleb 7.500 0 -> 7.500 +dqscb078 scaleb -7.500 0 -> -7.500 +dqscb081 scaleb 7 1 -> 7E+1 +dqscb082 scaleb -7 1 -> -7E+1 +dqscb083 scaleb 75 1 -> 7.5E+2 +dqscb084 scaleb -75 1 -> -7.5E+2 +dqscb085 scaleb 7.50 1 -> 75.0 +dqscb086 scaleb -7.50 1 -> -75.0 +dqscb087 scaleb 7.500 1 -> 75.00 +dqscb088 scaleb -7.500 1 -> -75.00 +dqscb091 scaleb 7 2 -> 7E+2 +dqscb092 scaleb -7 2 -> -7E+2 +dqscb093 scaleb 75 2 -> 7.5E+3 +dqscb094 scaleb -75 2 -> -7.5E+3 +dqscb095 scaleb 7.50 2 -> 750 +dqscb096 scaleb -7.50 2 -> -750 +dqscb097 scaleb 7.500 2 -> 750.0 +dqscb098 scaleb -7.500 2 -> -750.0 + +-- zeros +dqscb111 scaleb 0 1 -> 0E+1 +dqscb112 scaleb -0 2 -> -0E+2 +dqscb113 scaleb 0E+4 3 -> 0E+7 +dqscb114 scaleb -0E+4 4 -> -0E+8 +dqscb115 scaleb 0.0000 5 -> 0E+1 +dqscb116 scaleb -0.0000 6 -> -0E+2 +dqscb117 scaleb 0E-141 7 -> 0E-134 +dqscb118 scaleb -0E-141 8 -> -0E-133 + +-- Nmax, Nmin, Ntiny +dqscb132 scaleb 9.999999999999999999999999999999999E+6144 +6144 -> Infinity Overflow Inexact Rounded +dqscb133 scaleb 9.999999999999999999999999999999999E+6144 +10 -> Infinity Overflow Inexact Rounded +dqscb134 scaleb 9.999999999999999999999999999999999E+6144 +1 -> Infinity Overflow Inexact Rounded +dqscb135 scaleb 9.999999999999999999999999999999999E+6144 0 -> 9.999999999999999999999999999999999E+6144 +dqscb136 scaleb 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6143 +dqscb137 scaleb 1E-6143 +1 -> 1E-6142 +dqscb1614 scaleb 1E-6143 -0 -> 1E-6143 +dqscb139 scaleb 1E-6143 -1 -> 1E-6144 Subnormal +dqscb140 scaleb 1.000000000000000000000000000000000E-6143 +1 -> 1.000000000000000000000000000000000E-6142 +dqscb141 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143 +dqscb142 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded +dqscb143 scaleb 1E-6176 +1 -> 1E-6175 Subnormal +dqscb144 scaleb 1E-6176 -0 -> 1E-6176 Subnormal +dqscb145 scaleb 1E-6176 -1 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped + +dqscb150 scaleb -1E-6176 +1 -> -1E-6175 Subnormal +dqscb151 scaleb -1E-6176 -0 -> -1E-6176 Subnormal +dqscb152 scaleb -1E-6176 -1 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqscb153 scaleb -1.000000000000000000000000000000000E-6143 +1 -> -1.000000000000000000000000000000000E-6142 +dqscb154 scaleb -1.000000000000000000000000000000000E-6143 +0 -> -1.000000000000000000000000000000000E-6143 +dqscb155 scaleb -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 Subnormal Rounded +dqscb156 scaleb -1E-6143 +1 -> -1E-6142 +dqscb157 scaleb -1E-6143 -0 -> -1E-6143 +dqscb158 scaleb -1E-6143 -1 -> -1E-6144 Subnormal +dqscb159 scaleb -9.999999999999999999999999999999999E+6144 +1 -> -Infinity Overflow Inexact Rounded +dqscb160 scaleb -9.999999999999999999999999999999999E+6144 +0 -> -9.999999999999999999999999999999999E+6144 +dqscb161 scaleb -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6143 +dqscb162 scaleb -9E+6144 +1 -> -Infinity Overflow Inexact Rounded +dqscb163 scaleb -1E+6144 +1 -> -Infinity Overflow Inexact Rounded + +-- some Origami +-- (these check that overflow is being done correctly) +dqscb171 scaleb 1000E+6109 +1 -> 1.000E+6113 +dqscb172 scaleb 1000E+6110 +1 -> 1.000E+6114 +dqscb173 scaleb 1000E+6111 +1 -> 1.0000E+6115 Clamped +dqscb174 scaleb 1000E+6112 +1 -> 1.00000E+6116 Clamped +dqscb175 scaleb 1000E+6113 +1 -> 1.000000E+6117 Clamped +dqscb176 scaleb 1000E+6114 +1 -> 1.0000000E+6118 Clamped +dqscb177 scaleb 1000E+6131 +1 -> 1.000000000000000000000000E+6135 Clamped +dqscb178 scaleb 1000E+6132 +1 -> 1.0000000000000000000000000E+6136 Clamped +dqscb179 scaleb 1000E+6133 +1 -> 1.00000000000000000000000000E+6137 Clamped +dqscb180 scaleb 1000E+6134 +1 -> 1.000000000000000000000000000E+6138 Clamped +dqscb181 scaleb 1000E+6135 +1 -> 1.0000000000000000000000000000E+6139 Clamped +dqscb182 scaleb 1000E+6136 +1 -> 1.00000000000000000000000000000E+6140 Clamped +dqscb183 scaleb 1000E+6137 +1 -> 1.000000000000000000000000000000E+6141 Clamped +dqscb184 scaleb 1000E+6138 +1 -> 1.0000000000000000000000000000000E+6142 Clamped +dqscb185 scaleb 1000E+6139 +1 -> 1.00000000000000000000000000000000E+6143 Clamped +dqscb186 scaleb 1000E+6140 +1 -> 1.000000000000000000000000000000000E+6144 Clamped +dqscb187 scaleb 1000E+6141 +1 -> Infinity Overflow Inexact Rounded + +-- and a few more subnormal truncations +-- (these check that underflow is being done correctly) +dqscb221 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143 +dqscb222 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded +dqscb223 scaleb 1.000000000000000000000000000000000E-6143 -2 -> 1.0000000000000000000000000000000E-6145 Subnormal Rounded +dqscb224 scaleb 1.000000000000000000000000000000000E-6143 -3 -> 1.000000000000000000000000000000E-6146 Subnormal Rounded +dqscb225 scaleb 1.000000000000000000000000000000000E-6143 -4 -> 1.00000000000000000000000000000E-6147 Subnormal Rounded +dqscb226 scaleb 1.000000000000000000000000000000000E-6143 -5 -> 1.0000000000000000000000000000E-6148 Subnormal Rounded +dqscb227 scaleb 1.000000000000000000000000000000000E-6143 -6 -> 1.000000000000000000000000000E-6149 Subnormal Rounded +dqscb228 scaleb 1.000000000000000000000000000000000E-6143 -7 -> 1.00000000000000000000000000E-6150 Subnormal Rounded +dqscb229 scaleb 1.000000000000000000000000000000000E-6143 -8 -> 1.0000000000000000000000000E-6151 Subnormal Rounded +dqscb230 scaleb 1.000000000000000000000000000000000E-6143 -9 -> 1.000000000000000000000000E-6152 Subnormal Rounded +dqscb231 scaleb 1.000000000000000000000000000000000E-6143 -10 -> 1.00000000000000000000000E-6153 Subnormal Rounded +dqscb232 scaleb 1.000000000000000000000000000000000E-6143 -11 -> 1.0000000000000000000000E-6154 Subnormal Rounded +dqscb233 scaleb 1.000000000000000000000000000000000E-6143 -12 -> 1.000000000000000000000E-6155 Subnormal Rounded +dqscb234 scaleb 1.000000000000000000000000000000000E-6143 -13 -> 1.00000000000000000000E-6156 Subnormal Rounded +dqscb235 scaleb 1.000000000000000000000000000000000E-6143 -14 -> 1.0000000000000000000E-6157 Subnormal Rounded +dqscb236 scaleb 1.000000000000000000000000000000000E-6143 -15 -> 1.000000000000000000E-6158 Subnormal Rounded +dqscb237 scaleb 1.000000000000000000000000000000000E-6143 -16 -> 1.00000000000000000E-6159 Subnormal Rounded +dqscb238 scaleb 1.000000000000000000000000000000000E-6143 -17 -> 1.0000000000000000E-6160 Subnormal Rounded +dqscb239 scaleb 1.000000000000000000000000000000000E-6143 -18 -> 1.000000000000000E-6161 Subnormal Rounded +dqscb202 scaleb 1.000000000000000000000000000000000E-6143 -19 -> 1.00000000000000E-6162 Subnormal Rounded +dqscb203 scaleb 1.000000000000000000000000000000000E-6143 -20 -> 1.0000000000000E-6163 Subnormal Rounded +dqscb204 scaleb 1.000000000000000000000000000000000E-6143 -21 -> 1.000000000000E-6164 Subnormal Rounded +dqscb205 scaleb 1.000000000000000000000000000000000E-6143 -22 -> 1.00000000000E-6165 Subnormal Rounded +dqscb206 scaleb 1.000000000000000000000000000000000E-6143 -23 -> 1.0000000000E-6166 Subnormal Rounded +dqscb207 scaleb 1.000000000000000000000000000000000E-6143 -24 -> 1.000000000E-6167 Subnormal Rounded +dqscb208 scaleb 1.000000000000000000000000000000000E-6143 -25 -> 1.00000000E-6168 Subnormal Rounded +dqscb209 scaleb 1.000000000000000000000000000000000E-6143 -26 -> 1.0000000E-6169 Subnormal Rounded +dqscb210 scaleb 1.000000000000000000000000000000000E-6143 -27 -> 1.000000E-6170 Subnormal Rounded +dqscb211 scaleb 1.000000000000000000000000000000000E-6143 -28 -> 1.00000E-6171 Subnormal Rounded +dqscb212 scaleb 1.000000000000000000000000000000000E-6143 -29 -> 1.0000E-6172 Subnormal Rounded +dqscb213 scaleb 1.000000000000000000000000000000000E-6143 -30 -> 1.000E-6173 Subnormal Rounded +dqscb214 scaleb 1.000000000000000000000000000000000E-6143 -31 -> 1.00E-6174 Subnormal Rounded +dqscb215 scaleb 1.000000000000000000000000000000000E-6143 -32 -> 1.0E-6175 Subnormal Rounded +dqscb216 scaleb 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 Subnormal Rounded +dqscb217 scaleb 1.000000000000000000000000000000000E-6143 -34 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped +dqscb218 scaleb 1.000000000000000000000000000000000E-6143 -35 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqShift.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqShift.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,298 @@ +------------------------------------------------------------------------ +-- dqShift.decTest -- shift decQuad coefficient left or right -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check +dqshi001 shift 0 0 -> 0 +dqshi002 shift 0 2 -> 0 +dqshi003 shift 1 2 -> 100 +dqshi004 shift 1 33 -> 1000000000000000000000000000000000 +dqshi005 shift 1 34 -> 0 +dqshi006 shift 1 -1 -> 0 +dqshi007 shift 0 -2 -> 0 +dqshi008 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123 +dqshi009 shift 1234567890123456789012345678901234 -33 -> 1 +dqshi010 shift 1234567890123456789012345678901234 -34 -> 0 +dqshi011 shift 9934567890123456789012345678901234 -33 -> 9 +dqshi012 shift 9934567890123456789012345678901234 -34 -> 0 + +-- rhs must be an integer +dqshi015 shift 1 1.5 -> NaN Invalid_operation +dqshi016 shift 1 1.0 -> NaN Invalid_operation +dqshi017 shift 1 0.1 -> NaN Invalid_operation +dqshi018 shift 1 0.0 -> NaN Invalid_operation +dqshi019 shift 1 1E+1 -> NaN Invalid_operation +dqshi020 shift 1 1E+99 -> NaN Invalid_operation +dqshi021 shift 1 Inf -> NaN Invalid_operation +dqshi022 shift 1 -Inf -> NaN Invalid_operation +-- and |rhs| <= precision +dqshi025 shift 1 -1000 -> NaN Invalid_operation +dqshi026 shift 1 -35 -> NaN Invalid_operation +dqshi027 shift 1 35 -> NaN Invalid_operation +dqshi028 shift 1 1000 -> NaN Invalid_operation + +-- full shifting pattern +dqshi030 shift 1234567890123456789012345678901234 -34 -> 0 +dqshi031 shift 1234567890123456789012345678901234 -33 -> 1 +dqshi032 shift 1234567890123456789012345678901234 -32 -> 12 +dqshi033 shift 1234567890123456789012345678901234 -31 -> 123 +dqshi034 shift 1234567890123456789012345678901234 -30 -> 1234 +dqshi035 shift 1234567890123456789012345678901234 -29 -> 12345 +dqshi036 shift 1234567890123456789012345678901234 -28 -> 123456 +dqshi037 shift 1234567890123456789012345678901234 -27 -> 1234567 +dqshi038 shift 1234567890123456789012345678901234 -26 -> 12345678 +dqshi039 shift 1234567890123456789012345678901234 -25 -> 123456789 +dqshi040 shift 1234567890123456789012345678901234 -24 -> 1234567890 +dqshi041 shift 1234567890123456789012345678901234 -23 -> 12345678901 +dqshi042 shift 1234567890123456789012345678901234 -22 -> 123456789012 +dqshi043 shift 1234567890123456789012345678901234 -21 -> 1234567890123 +dqshi044 shift 1234567890123456789012345678901234 -20 -> 12345678901234 +dqshi045 shift 1234567890123456789012345678901234 -19 -> 123456789012345 +dqshi047 shift 1234567890123456789012345678901234 -18 -> 1234567890123456 +dqshi048 shift 1234567890123456789012345678901234 -17 -> 12345678901234567 +dqshi049 shift 1234567890123456789012345678901234 -16 -> 123456789012345678 +dqshi050 shift 1234567890123456789012345678901234 -15 -> 1234567890123456789 +dqshi051 shift 1234567890123456789012345678901234 -14 -> 12345678901234567890 +dqshi052 shift 1234567890123456789012345678901234 -13 -> 123456789012345678901 +dqshi053 shift 1234567890123456789012345678901234 -12 -> 1234567890123456789012 +dqshi054 shift 1234567890123456789012345678901234 -11 -> 12345678901234567890123 +dqshi055 shift 1234567890123456789012345678901234 -10 -> 123456789012345678901234 +dqshi056 shift 1234567890123456789012345678901234 -9 -> 1234567890123456789012345 +dqshi057 shift 1234567890123456789012345678901234 -8 -> 12345678901234567890123456 +dqshi058 shift 1234567890123456789012345678901234 -7 -> 123456789012345678901234567 +dqshi059 shift 1234567890123456789012345678901234 -6 -> 1234567890123456789012345678 +dqshi060 shift 1234567890123456789012345678901234 -5 -> 12345678901234567890123456789 +dqshi061 shift 1234567890123456789012345678901234 -4 -> 123456789012345678901234567890 +dqshi062 shift 1234567890123456789012345678901234 -3 -> 1234567890123456789012345678901 +dqshi063 shift 1234567890123456789012345678901234 -2 -> 12345678901234567890123456789012 +dqshi064 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123 +dqshi065 shift 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234 + +dqshi066 shift 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234 +dqshi067 shift 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012340 +dqshi068 shift 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123400 +dqshi069 shift 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234000 +dqshi070 shift 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012340000 +dqshi071 shift 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123400000 +dqshi072 shift 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234000000 +dqshi073 shift 1234567890123456789012345678901234 +7 -> 8901234567890123456789012340000000 +dqshi074 shift 1234567890123456789012345678901234 +8 -> 9012345678901234567890123400000000 +dqshi075 shift 1234567890123456789012345678901234 +9 -> 123456789012345678901234000000000 +dqshi076 shift 1234567890123456789012345678901234 +10 -> 1234567890123456789012340000000000 +dqshi077 shift 1234567890123456789012345678901234 +11 -> 2345678901234567890123400000000000 +dqshi078 shift 1234567890123456789012345678901234 +12 -> 3456789012345678901234000000000000 +dqshi079 shift 1234567890123456789012345678901234 +13 -> 4567890123456789012340000000000000 +dqshi080 shift 1234567890123456789012345678901234 +14 -> 5678901234567890123400000000000000 +dqshi081 shift 1234567890123456789012345678901234 +15 -> 6789012345678901234000000000000000 +dqshi082 shift 1234567890123456789012345678901234 +16 -> 7890123456789012340000000000000000 +dqshi083 shift 1234567890123456789012345678901234 +17 -> 8901234567890123400000000000000000 +dqshi084 shift 1234567890123456789012345678901234 +18 -> 9012345678901234000000000000000000 +dqshi085 shift 1234567890123456789012345678901234 +19 -> 123456789012340000000000000000000 +dqshi086 shift 1234567890123456789012345678901234 +20 -> 1234567890123400000000000000000000 +dqshi087 shift 1234567890123456789012345678901234 +21 -> 2345678901234000000000000000000000 +dqshi088 shift 1234567890123456789012345678901234 +22 -> 3456789012340000000000000000000000 +dqshi089 shift 1234567890123456789012345678901234 +23 -> 4567890123400000000000000000000000 +dqshi090 shift 1234567890123456789012345678901234 +24 -> 5678901234000000000000000000000000 +dqshi091 shift 1234567890123456789012345678901234 +25 -> 6789012340000000000000000000000000 +dqshi092 shift 1234567890123456789012345678901234 +26 -> 7890123400000000000000000000000000 +dqshi093 shift 1234567890123456789012345678901234 +27 -> 8901234000000000000000000000000000 +dqshi094 shift 1234567890123456789012345678901234 +28 -> 9012340000000000000000000000000000 +dqshi095 shift 1234567890123456789012345678901234 +29 -> 123400000000000000000000000000000 +dqshi096 shift 1234567890123456789012345678901234 +30 -> 1234000000000000000000000000000000 +dqshi097 shift 1234567890123456789012345678901234 +31 -> 2340000000000000000000000000000000 +dqshi098 shift 1234567890123456789012345678901234 +32 -> 3400000000000000000000000000000000 +dqshi099 shift 1234567890123456789012345678901234 +33 -> 4000000000000000000000000000000000 +dqshi100 shift 1234567890123456789012345678901234 +34 -> 0 + +-- zeros +dqshi270 shift 0E-10 +29 -> 0E-10 +dqshi271 shift 0E-10 -29 -> 0E-10 +dqshi272 shift 0.000 +29 -> 0.000 +dqshi273 shift 0.000 -29 -> 0.000 +dqshi274 shift 0E+10 +29 -> 0E+10 +dqshi275 shift 0E+10 -29 -> 0E+10 +dqshi276 shift -0E-10 +29 -> -0E-10 +dqshi277 shift -0E-10 -29 -> -0E-10 +dqshi278 shift -0.000 +29 -> -0.000 +dqshi279 shift -0.000 -29 -> -0.000 +dqshi280 shift -0E+10 +29 -> -0E+10 +dqshi281 shift -0E+10 -29 -> -0E+10 + +-- Nmax, Nmin, Ntiny +dqshi141 shift 9.999999999999999999999999999999999E+6144 -1 -> 9.99999999999999999999999999999999E+6143 +dqshi142 shift 9.999999999999999999999999999999999E+6144 -33 -> 9E+6111 +dqshi143 shift 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999990E+6144 +dqshi144 shift 9.999999999999999999999999999999999E+6144 33 -> 9.000000000000000000000000000000000E+6144 +dqshi145 shift 1E-6143 -1 -> 0E-6143 +dqshi146 shift 1E-6143 -33 -> 0E-6143 +dqshi147 shift 1E-6143 1 -> 1.0E-6142 +dqshi148 shift 1E-6143 33 -> 1.000000000000000000000000000000000E-6110 +dqshi151 shift 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 +dqshi152 shift 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 +dqshi153 shift 1.000000000000000000000000000000000E-6143 1 -> 0E-6176 +dqshi154 shift 1.000000000000000000000000000000000E-6143 33 -> 0E-6176 +dqshi155 shift 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144 +dqshi156 shift 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176 +dqshi157 shift 9.000000000000000000000000000000000E-6143 1 -> 0E-6176 +dqshi158 shift 9.000000000000000000000000000000000E-6143 33 -> 0E-6176 +dqshi160 shift 1E-6176 -1 -> 0E-6176 +dqshi161 shift 1E-6176 -33 -> 0E-6176 +dqshi162 shift 1E-6176 1 -> 1.0E-6175 +dqshi163 shift 1E-6176 33 -> 1.000000000000000000000000000000000E-6143 +-- negatives +dqshi171 shift -9.999999999999999999999999999999999E+6144 -1 -> -9.99999999999999999999999999999999E+6143 +dqshi172 shift -9.999999999999999999999999999999999E+6144 -33 -> -9E+6111 +dqshi173 shift -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999990E+6144 +dqshi174 shift -9.999999999999999999999999999999999E+6144 33 -> -9.000000000000000000000000000000000E+6144 +dqshi175 shift -1E-6143 -1 -> -0E-6143 +dqshi176 shift -1E-6143 -33 -> -0E-6143 +dqshi177 shift -1E-6143 1 -> -1.0E-6142 +dqshi178 shift -1E-6143 33 -> -1.000000000000000000000000000000000E-6110 +dqshi181 shift -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 +dqshi182 shift -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176 +dqshi183 shift -1.000000000000000000000000000000000E-6143 1 -> -0E-6176 +dqshi184 shift -1.000000000000000000000000000000000E-6143 33 -> -0E-6176 +dqshi185 shift -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144 +dqshi186 shift -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176 +dqshi187 shift -9.000000000000000000000000000000000E-6143 1 -> -0E-6176 +dqshi188 shift -9.000000000000000000000000000000000E-6143 33 -> -0E-6176 +dqshi190 shift -1E-6176 -1 -> -0E-6176 +dqshi191 shift -1E-6176 -33 -> -0E-6176 +dqshi192 shift -1E-6176 1 -> -1.0E-6175 +dqshi193 shift -1E-6176 33 -> -1.000000000000000000000000000000000E-6143 + +-- more negatives (of sanities) +dqshi201 shift -0 0 -> -0 +dqshi202 shift -0 2 -> -0 +dqshi203 shift -1 2 -> -100 +dqshi204 shift -1 33 -> -1000000000000000000000000000000000 +dqshi205 shift -1 34 -> -0 +dqshi206 shift -1 -1 -> -0 +dqshi207 shift -0 -2 -> -0 +dqshi208 shift -1234567890123456789012345678901234 -1 -> -123456789012345678901234567890123 +dqshi209 shift -1234567890123456789012345678901234 -33 -> -1 +dqshi210 shift -1234567890123456789012345678901234 -34 -> -0 +dqshi211 shift -9934567890123456789012345678901234 -33 -> -9 +dqshi212 shift -9934567890123456789012345678901234 -34 -> -0 + + +-- Specials; NaNs are handled as usual +dqshi781 shift -Inf -8 -> -Infinity +dqshi782 shift -Inf -1 -> -Infinity +dqshi783 shift -Inf -0 -> -Infinity +dqshi784 shift -Inf 0 -> -Infinity +dqshi785 shift -Inf 1 -> -Infinity +dqshi786 shift -Inf 8 -> -Infinity +dqshi787 shift -1000 -Inf -> NaN Invalid_operation +dqshi788 shift -Inf -Inf -> NaN Invalid_operation +dqshi789 shift -1 -Inf -> NaN Invalid_operation +dqshi790 shift -0 -Inf -> NaN Invalid_operation +dqshi791 shift 0 -Inf -> NaN Invalid_operation +dqshi792 shift 1 -Inf -> NaN Invalid_operation +dqshi793 shift 1000 -Inf -> NaN Invalid_operation +dqshi794 shift Inf -Inf -> NaN Invalid_operation + +dqshi800 shift Inf -Inf -> NaN Invalid_operation +dqshi801 shift Inf -8 -> Infinity +dqshi802 shift Inf -1 -> Infinity +dqshi803 shift Inf -0 -> Infinity +dqshi804 shift Inf 0 -> Infinity +dqshi805 shift Inf 1 -> Infinity +dqshi806 shift Inf 8 -> Infinity +dqshi807 shift Inf Inf -> NaN Invalid_operation +dqshi808 shift -1000 Inf -> NaN Invalid_operation +dqshi809 shift -Inf Inf -> NaN Invalid_operation +dqshi810 shift -1 Inf -> NaN Invalid_operation +dqshi811 shift -0 Inf -> NaN Invalid_operation +dqshi812 shift 0 Inf -> NaN Invalid_operation +dqshi813 shift 1 Inf -> NaN Invalid_operation +dqshi814 shift 1000 Inf -> NaN Invalid_operation +dqshi815 shift Inf Inf -> NaN Invalid_operation + +dqshi821 shift NaN -Inf -> NaN +dqshi822 shift NaN -1000 -> NaN +dqshi823 shift NaN -1 -> NaN +dqshi824 shift NaN -0 -> NaN +dqshi825 shift NaN 0 -> NaN +dqshi826 shift NaN 1 -> NaN +dqshi827 shift NaN 1000 -> NaN +dqshi828 shift NaN Inf -> NaN +dqshi829 shift NaN NaN -> NaN +dqshi830 shift -Inf NaN -> NaN +dqshi831 shift -1000 NaN -> NaN +dqshi832 shift -1 NaN -> NaN +dqshi833 shift -0 NaN -> NaN +dqshi834 shift 0 NaN -> NaN +dqshi835 shift 1 NaN -> NaN +dqshi836 shift 1000 NaN -> NaN +dqshi837 shift Inf NaN -> NaN + +dqshi841 shift sNaN -Inf -> NaN Invalid_operation +dqshi842 shift sNaN -1000 -> NaN Invalid_operation +dqshi843 shift sNaN -1 -> NaN Invalid_operation +dqshi844 shift sNaN -0 -> NaN Invalid_operation +dqshi845 shift sNaN 0 -> NaN Invalid_operation +dqshi846 shift sNaN 1 -> NaN Invalid_operation +dqshi847 shift sNaN 1000 -> NaN Invalid_operation +dqshi848 shift sNaN NaN -> NaN Invalid_operation +dqshi849 shift sNaN sNaN -> NaN Invalid_operation +dqshi850 shift NaN sNaN -> NaN Invalid_operation +dqshi851 shift -Inf sNaN -> NaN Invalid_operation +dqshi852 shift -1000 sNaN -> NaN Invalid_operation +dqshi853 shift -1 sNaN -> NaN Invalid_operation +dqshi854 shift -0 sNaN -> NaN Invalid_operation +dqshi855 shift 0 sNaN -> NaN Invalid_operation +dqshi856 shift 1 sNaN -> NaN Invalid_operation +dqshi857 shift 1000 sNaN -> NaN Invalid_operation +dqshi858 shift Inf sNaN -> NaN Invalid_operation +dqshi859 shift NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqshi861 shift NaN1 -Inf -> NaN1 +dqshi862 shift +NaN2 -1000 -> NaN2 +dqshi863 shift NaN3 1000 -> NaN3 +dqshi864 shift NaN4 Inf -> NaN4 +dqshi865 shift NaN5 +NaN6 -> NaN5 +dqshi866 shift -Inf NaN7 -> NaN7 +dqshi867 shift -1000 NaN8 -> NaN8 +dqshi868 shift 1000 NaN9 -> NaN9 +dqshi869 shift Inf +NaN10 -> NaN10 +dqshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation +dqshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation +dqshi873 shift sNaN13 1000 -> NaN13 Invalid_operation +dqshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation +dqshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation +dqshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation +dqshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation +dqshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation +dqshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation +dqshi880 shift Inf sNaN23 -> NaN23 Invalid_operation +dqshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation +dqshi882 shift -NaN26 NaN28 -> -NaN26 +dqshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation +dqshi884 shift 1000 -NaN30 -> -NaN30 +dqshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqSubtract.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqSubtract.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,635 @@ +------------------------------------------------------------------------ +-- dqSubtract.decTest -- decQuad subtraction -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests are for decQuads only; all arguments are +-- representable in a decQuad +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- [first group are 'quick confidence check'] +dqsub001 subtract 0 0 -> '0' +dqsub002 subtract 1 1 -> '0' +dqsub003 subtract 1 2 -> '-1' +dqsub004 subtract 2 1 -> '1' +dqsub005 subtract 2 2 -> '0' +dqsub006 subtract 3 2 -> '1' +dqsub007 subtract 2 3 -> '-1' + +dqsub011 subtract -0 0 -> '-0' +dqsub012 subtract -1 1 -> '-2' +dqsub013 subtract -1 2 -> '-3' +dqsub014 subtract -2 1 -> '-3' +dqsub015 subtract -2 2 -> '-4' +dqsub016 subtract -3 2 -> '-5' +dqsub017 subtract -2 3 -> '-5' + +dqsub021 subtract 0 -0 -> '0' +dqsub022 subtract 1 -1 -> '2' +dqsub023 subtract 1 -2 -> '3' +dqsub024 subtract 2 -1 -> '3' +dqsub025 subtract 2 -2 -> '4' +dqsub026 subtract 3 -2 -> '5' +dqsub027 subtract 2 -3 -> '5' + +dqsub030 subtract 11 1 -> 10 +dqsub031 subtract 10 1 -> 9 +dqsub032 subtract 9 1 -> 8 +dqsub033 subtract 1 1 -> 0 +dqsub034 subtract 0 1 -> -1 +dqsub035 subtract -1 1 -> -2 +dqsub036 subtract -9 1 -> -10 +dqsub037 subtract -10 1 -> -11 +dqsub038 subtract -11 1 -> -12 + +dqsub040 subtract '5.75' '3.3' -> '2.45' +dqsub041 subtract '5' '-3' -> '8' +dqsub042 subtract '-5' '-3' -> '-2' +dqsub043 subtract '-7' '2.5' -> '-9.5' +dqsub044 subtract '0.7' '0.3' -> '0.4' +dqsub045 subtract '1.3' '0.3' -> '1.0' +dqsub046 subtract '1.25' '1.25' -> '0.00' + +dqsub050 subtract '1.23456789' '1.00000000' -> '0.23456789' +dqsub051 subtract '1.23456789' '1.00000089' -> '0.23456700' + +dqsub060 subtract '70' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded +dqsub061 subtract '700' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded +dqsub062 subtract '7000' '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded +dqsub063 subtract '70000' '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded +dqsub064 subtract '700000' '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded + -- symmetry: +dqsub065 subtract '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqsub066 subtract '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded +dqsub067 subtract '10000e+34' '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded +dqsub068 subtract '10000e+34' '70000' -> '9.999999999999999999999999999999993E+37' Rounded +dqsub069 subtract '10000e+34' '700000' -> '9.999999999999999999999999999999930E+37' Rounded + + -- some of the next group are really constructor tests +dqsub090 subtract '00.0' '0.0' -> '0.0' +dqsub091 subtract '00.0' '0.00' -> '0.00' +dqsub092 subtract '0.00' '00.0' -> '0.00' +dqsub093 subtract '00.0' '0.00' -> '0.00' +dqsub094 subtract '0.00' '00.0' -> '0.00' +dqsub095 subtract '3' '.3' -> '2.7' +dqsub096 subtract '3.' '.3' -> '2.7' +dqsub097 subtract '3.0' '.3' -> '2.7' +dqsub098 subtract '3.00' '.3' -> '2.70' +dqsub099 subtract '3' '3' -> '0' +dqsub100 subtract '3' '+3' -> '0' +dqsub101 subtract '3' '-3' -> '6' +dqsub102 subtract '3' '0.3' -> '2.7' +dqsub103 subtract '3.' '0.3' -> '2.7' +dqsub104 subtract '3.0' '0.3' -> '2.7' +dqsub105 subtract '3.00' '0.3' -> '2.70' +dqsub106 subtract '3' '3.0' -> '0.0' +dqsub107 subtract '3' '+3.0' -> '0.0' +dqsub108 subtract '3' '-3.0' -> '6.0' + +-- the above all from add; massaged and extended. Now some new ones... +-- [particularly important for comparisons] +-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7 +-- with input rounding. +dqsub120 subtract '10.23456784' '10.23456789' -> '-5E-8' +dqsub121 subtract '10.23456785' '10.23456789' -> '-4E-8' +dqsub122 subtract '10.23456786' '10.23456789' -> '-3E-8' +dqsub123 subtract '10.23456787' '10.23456789' -> '-2E-8' +dqsub124 subtract '10.23456788' '10.23456789' -> '-1E-8' +dqsub125 subtract '10.23456789' '10.23456789' -> '0E-8' +dqsub126 subtract '10.23456790' '10.23456789' -> '1E-8' +dqsub127 subtract '10.23456791' '10.23456789' -> '2E-8' +dqsub128 subtract '10.23456792' '10.23456789' -> '3E-8' +dqsub129 subtract '10.23456793' '10.23456789' -> '4E-8' +dqsub130 subtract '10.23456794' '10.23456789' -> '5E-8' +dqsub131 subtract '10.23456781' '10.23456786' -> '-5E-8' +dqsub132 subtract '10.23456782' '10.23456786' -> '-4E-8' +dqsub133 subtract '10.23456783' '10.23456786' -> '-3E-8' +dqsub134 subtract '10.23456784' '10.23456786' -> '-2E-8' +dqsub135 subtract '10.23456785' '10.23456786' -> '-1E-8' +dqsub136 subtract '10.23456786' '10.23456786' -> '0E-8' +dqsub137 subtract '10.23456787' '10.23456786' -> '1E-8' +dqsub138 subtract '10.23456788' '10.23456786' -> '2E-8' +dqsub139 subtract '10.23456789' '10.23456786' -> '3E-8' +dqsub140 subtract '10.23456790' '10.23456786' -> '4E-8' +dqsub141 subtract '10.23456791' '10.23456786' -> '5E-8' +dqsub142 subtract '1' '0.999999999' -> '1E-9' +dqsub143 subtract '0.999999999' '1' -> '-1E-9' +dqsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8' +dqsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8' +dqsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8' + +-- additional scaled arithmetic tests [0.97 problem] +dqsub160 subtract '0' '.1' -> '-0.1' +dqsub161 subtract '00' '.97983' -> '-0.97983' +dqsub162 subtract '0' '.9' -> '-0.9' +dqsub163 subtract '0' '0.102' -> '-0.102' +dqsub164 subtract '0' '.4' -> '-0.4' +dqsub165 subtract '0' '.307' -> '-0.307' +dqsub166 subtract '0' '.43822' -> '-0.43822' +dqsub167 subtract '0' '.911' -> '-0.911' +dqsub168 subtract '.0' '.02' -> '-0.02' +dqsub169 subtract '00' '.392' -> '-0.392' +dqsub170 subtract '0' '.26' -> '-0.26' +dqsub171 subtract '0' '0.51' -> '-0.51' +dqsub172 subtract '0' '.2234' -> '-0.2234' +dqsub173 subtract '0' '.2' -> '-0.2' +dqsub174 subtract '.0' '.0008' -> '-0.0008' +-- 0. on left +dqsub180 subtract '0.0' '-.1' -> '0.1' +dqsub181 subtract '0.00' '-.97983' -> '0.97983' +dqsub182 subtract '0.0' '-.9' -> '0.9' +dqsub183 subtract '0.0' '-0.102' -> '0.102' +dqsub184 subtract '0.0' '-.4' -> '0.4' +dqsub185 subtract '0.0' '-.307' -> '0.307' +dqsub186 subtract '0.0' '-.43822' -> '0.43822' +dqsub187 subtract '0.0' '-.911' -> '0.911' +dqsub188 subtract '0.0' '-.02' -> '0.02' +dqsub189 subtract '0.00' '-.392' -> '0.392' +dqsub190 subtract '0.0' '-.26' -> '0.26' +dqsub191 subtract '0.0' '-0.51' -> '0.51' +dqsub192 subtract '0.0' '-.2234' -> '0.2234' +dqsub193 subtract '0.0' '-.2' -> '0.2' +dqsub194 subtract '0.0' '-.0008' -> '0.0008' +-- negatives of same +dqsub200 subtract '0' '-.1' -> '0.1' +dqsub201 subtract '00' '-.97983' -> '0.97983' +dqsub202 subtract '0' '-.9' -> '0.9' +dqsub203 subtract '0' '-0.102' -> '0.102' +dqsub204 subtract '0' '-.4' -> '0.4' +dqsub205 subtract '0' '-.307' -> '0.307' +dqsub206 subtract '0' '-.43822' -> '0.43822' +dqsub207 subtract '0' '-.911' -> '0.911' +dqsub208 subtract '.0' '-.02' -> '0.02' +dqsub209 subtract '00' '-.392' -> '0.392' +dqsub210 subtract '0' '-.26' -> '0.26' +dqsub211 subtract '0' '-0.51' -> '0.51' +dqsub212 subtract '0' '-.2234' -> '0.2234' +dqsub213 subtract '0' '-.2' -> '0.2' +dqsub214 subtract '.0' '-.0008' -> '0.0008' + +-- more fixed, LHS swaps [really the same as testcases under add] +dqsub220 subtract '-56267E-12' 0 -> '-5.6267E-8' +dqsub221 subtract '-56267E-11' 0 -> '-5.6267E-7' +dqsub222 subtract '-56267E-10' 0 -> '-0.0000056267' +dqsub223 subtract '-56267E-9' 0 -> '-0.000056267' +dqsub224 subtract '-56267E-8' 0 -> '-0.00056267' +dqsub225 subtract '-56267E-7' 0 -> '-0.0056267' +dqsub226 subtract '-56267E-6' 0 -> '-0.056267' +dqsub227 subtract '-56267E-5' 0 -> '-0.56267' +dqsub228 subtract '-56267E-2' 0 -> '-562.67' +dqsub229 subtract '-56267E-1' 0 -> '-5626.7' +dqsub230 subtract '-56267E-0' 0 -> '-56267' +-- symmetry ... +dqsub240 subtract 0 '-56267E-12' -> '5.6267E-8' +dqsub241 subtract 0 '-56267E-11' -> '5.6267E-7' +dqsub242 subtract 0 '-56267E-10' -> '0.0000056267' +dqsub243 subtract 0 '-56267E-9' -> '0.000056267' +dqsub244 subtract 0 '-56267E-8' -> '0.00056267' +dqsub245 subtract 0 '-56267E-7' -> '0.0056267' +dqsub246 subtract 0 '-56267E-6' -> '0.056267' +dqsub247 subtract 0 '-56267E-5' -> '0.56267' +dqsub248 subtract 0 '-56267E-2' -> '562.67' +dqsub249 subtract 0 '-56267E-1' -> '5626.7' +dqsub250 subtract 0 '-56267E-0' -> '56267' + +-- now some more from the 'new' add +dqsub301 subtract '1.23456789' '1.00000000' -> '0.23456789' +dqsub302 subtract '1.23456789' '1.00000011' -> '0.23456778' + +-- some carrying effects +dqsub321 subtract '0.9998' '0.0000' -> '0.9998' +dqsub322 subtract '0.9998' '0.0001' -> '0.9997' +dqsub323 subtract '0.9998' '0.0002' -> '0.9996' +dqsub324 subtract '0.9998' '0.0003' -> '0.9995' +dqsub325 subtract '0.9998' '-0.0000' -> '0.9998' +dqsub326 subtract '0.9998' '-0.0001' -> '0.9999' +dqsub327 subtract '0.9998' '-0.0002' -> '1.0000' +dqsub328 subtract '0.9998' '-0.0003' -> '1.0001' + +-- internal boundaries +dqsub346 subtract '10000e+9' '7' -> '9999999999993' +dqsub347 subtract '10000e+9' '70' -> '9999999999930' +dqsub348 subtract '10000e+9' '700' -> '9999999999300' +dqsub349 subtract '10000e+9' '7000' -> '9999999993000' +dqsub350 subtract '10000e+9' '70000' -> '9999999930000' +dqsub351 subtract '10000e+9' '700000' -> '9999999300000' +dqsub352 subtract '7' '10000e+9' -> '-9999999999993' +dqsub353 subtract '70' '10000e+9' -> '-9999999999930' +dqsub354 subtract '700' '10000e+9' -> '-9999999999300' +dqsub355 subtract '7000' '10000e+9' -> '-9999999993000' +dqsub356 subtract '70000' '10000e+9' -> '-9999999930000' +dqsub357 subtract '700000' '10000e+9' -> '-9999999300000' + +-- zero preservation +dqsub361 subtract 1 '0.0001' -> '0.9999' +dqsub362 subtract 1 '0.00001' -> '0.99999' +dqsub363 subtract 1 '0.000001' -> '0.999999' +dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999' +dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded +dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +dqsub370 subtract 1 0 -> 1 +dqsub371 subtract 1 0. -> 1 +dqsub372 subtract 1 .0 -> 1.0 +dqsub373 subtract 1 0.0 -> 1.0 +dqsub374 subtract 0 1 -> -1 +dqsub375 subtract 0. 1 -> -1 +dqsub376 subtract .0 1 -> -1.0 +dqsub377 subtract 0.0 1 -> -1.0 + +-- leading 0 digit before round +dqsub910 subtract -103519362 -51897955.3 -> -51621406.7 +dqsub911 subtract 159579.444 89827.5229 -> 69751.9211 + +dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded +dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded +dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 99.99999999999999999999999999999995 +dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 -> 99.99999999999999999999999999999996 +dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded +dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 -> 90.00000000000000000000000000000000 +dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 -> 89.99999999999999999999999999999999 +dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 -> 89.99999999999999999999999999999994 +dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 -> 9.99999999999999999999999999999994 +dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 -> 1.99999999999999999999999999999994 + +-- more LHS swaps [were fixed] +dqsub390 subtract '-56267E-10' 0 -> '-0.0000056267' +dqsub391 subtract '-56267E-6' 0 -> '-0.056267' +dqsub392 subtract '-56267E-5' 0 -> '-0.56267' +dqsub393 subtract '-56267E-4' 0 -> '-5.6267' +dqsub394 subtract '-56267E-3' 0 -> '-56.267' +dqsub395 subtract '-56267E-2' 0 -> '-562.67' +dqsub396 subtract '-56267E-1' 0 -> '-5626.7' +dqsub397 subtract '-56267E-0' 0 -> '-56267' +dqsub398 subtract '-5E-10' 0 -> '-5E-10' +dqsub399 subtract '-5E-7' 0 -> '-5E-7' +dqsub400 subtract '-5E-6' 0 -> '-0.000005' +dqsub401 subtract '-5E-5' 0 -> '-0.00005' +dqsub402 subtract '-5E-4' 0 -> '-0.0005' +dqsub403 subtract '-5E-1' 0 -> '-0.5' +dqsub404 subtract '-5E0' 0 -> '-5' +dqsub405 subtract '-5E1' 0 -> '-50' +dqsub406 subtract '-5E5' 0 -> '-500000' +dqsub407 subtract '-5E33' 0 -> '-5000000000000000000000000000000000' +dqsub408 subtract '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded +dqsub409 subtract '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded +dqsub410 subtract '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded +dqsub411 subtract '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded + +-- more RHS swaps [were fixed] +dqsub420 subtract 0 '-56267E-10' -> '0.0000056267' +dqsub421 subtract 0 '-56267E-6' -> '0.056267' +dqsub422 subtract 0 '-56267E-5' -> '0.56267' +dqsub423 subtract 0 '-56267E-4' -> '5.6267' +dqsub424 subtract 0 '-56267E-3' -> '56.267' +dqsub425 subtract 0 '-56267E-2' -> '562.67' +dqsub426 subtract 0 '-56267E-1' -> '5626.7' +dqsub427 subtract 0 '-56267E-0' -> '56267' +dqsub428 subtract 0 '-5E-10' -> '5E-10' +dqsub429 subtract 0 '-5E-7' -> '5E-7' +dqsub430 subtract 0 '-5E-6' -> '0.000005' +dqsub431 subtract 0 '-5E-5' -> '0.00005' +dqsub432 subtract 0 '-5E-4' -> '0.0005' +dqsub433 subtract 0 '-5E-1' -> '0.5' +dqsub434 subtract 0 '-5E0' -> '5' +dqsub435 subtract 0 '-5E1' -> '50' +dqsub436 subtract 0 '-5E5' -> '500000' +dqsub437 subtract 0 '-5E33' -> '5000000000000000000000000000000000' +dqsub438 subtract 0 '-5E34' -> '5.000000000000000000000000000000000E+34' Rounded +dqsub439 subtract 0 '-5E35' -> '5.000000000000000000000000000000000E+35' Rounded +dqsub440 subtract 0 '-5E36' -> '5.000000000000000000000000000000000E+36' Rounded +dqsub441 subtract 0 '-5E100' -> '5.000000000000000000000000000000000E+100' Rounded + + +-- try borderline precision, with carries, etc. +dqsub461 subtract '1E+16' '1' -> '9999999999999999' +dqsub462 subtract '1E+12' '-1.111' -> '1000000000001.111' +dqsub463 subtract '1.111' '-1E+12' -> '1000000000001.111' +dqsub464 subtract '-1' '-1E+16' -> '9999999999999999' +dqsub465 subtract '7E+15' '1' -> '6999999999999999' +dqsub466 subtract '7E+12' '-1.111' -> '7000000000001.111' +dqsub467 subtract '1.111' '-7E+12' -> '7000000000001.111' +dqsub468 subtract '-1' '-7E+15' -> '6999999999999999' + +-- 1234567890123456 1234567890123456 1 23456789012345 +dqsub470 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded +dqsub471 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded +dqsub472 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded +dqsub473 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded +dqsub474 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded +dqsub475 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded +dqsub476 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded +dqsub477 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded +dqsub478 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999' +dqsub479 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998' +dqsub480 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997' +dqsub481 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996' +dqsub482 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995' +dqsub483 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994' + +-- and some more, including residue effects and different roundings +rounding: half_up +dqsub500 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789' +dqsub501 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub502 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub503 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub504 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub505 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub506 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub507 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub508 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub509 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub510 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub511 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub512 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub513 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub514 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub515 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub516 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788' +dqsub517 subtract '1231234555555555555555555567456789' 1.000000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub518 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub519 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded + +rounding: half_even +dqsub520 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789' +dqsub521 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub522 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub523 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub524 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub525 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub526 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub527 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded +dqsub528 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub529 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub530 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub531 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub532 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub533 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub534 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub535 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub536 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788' +dqsub537 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub538 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub539 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded +-- critical few with even bottom digit... +dqsub540 subtract '1231234555555555555555555567456788' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub541 subtract '1231234555555555555555555567456788' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub542 subtract '1231234555555555555555555567456788' 0.500000001 -> '1231234555555555555555555567456787' Inexact Rounded + +rounding: down +dqsub550 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789' +dqsub551 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub552 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub553 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub554 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub555 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub556 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub557 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub558 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub559 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub560 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub561 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub562 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub563 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub564 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub565 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded +dqsub566 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788' +dqsub567 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456787' Inexact Rounded +dqsub568 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456787' Inexact Rounded +dqsub569 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456787' Inexact Rounded + +-- symmetry... +rounding: half_up +dqsub600 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' +dqsub601 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub602 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub603 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub604 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub605 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub606 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub607 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub608 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub609 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub610 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub611 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub612 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub613 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub614 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub615 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub616 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' +dqsub617 subtract 1.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub618 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub619 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded + +rounding: half_even +dqsub620 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' +dqsub621 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub622 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub623 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub624 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub625 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub626 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub627 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded +dqsub628 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub629 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub630 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub631 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub632 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub633 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub634 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub635 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub636 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' +dqsub637 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub638 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub639 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +-- critical few with even bottom digit... +dqsub640 subtract 0.499999999 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub641 subtract 0.5 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub642 subtract 0.500000001 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded + +rounding: down +dqsub650 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' +dqsub651 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub652 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub653 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub654 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub655 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub656 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub657 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub658 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub659 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub660 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub661 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub662 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub663 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub664 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub665 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded +dqsub666 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' +dqsub667 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded +dqsub668 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded +dqsub669 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded + + +-- lots of leading zeros in intermediate result, and showing effects of +-- input rounding would have affected the following +rounding: half_up +dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9 +dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1 +dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1 +dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5 +dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9 + +rounding: half_even +dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9 +dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1 +dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1 +dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5 +dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9 + +dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9 +dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1 +dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1 +dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5 +dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9 + +rounding: down +dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9 +dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1 +dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1 +dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5 +dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9 + +-- Specials +dqsub780 subtract -Inf Inf -> -Infinity +dqsub781 subtract -Inf 1000 -> -Infinity +dqsub782 subtract -Inf 1 -> -Infinity +dqsub783 subtract -Inf -0 -> -Infinity +dqsub784 subtract -Inf -1 -> -Infinity +dqsub785 subtract -Inf -1000 -> -Infinity +dqsub787 subtract -1000 Inf -> -Infinity +dqsub788 subtract -Inf Inf -> -Infinity +dqsub789 subtract -1 Inf -> -Infinity +dqsub790 subtract 0 Inf -> -Infinity +dqsub791 subtract 1 Inf -> -Infinity +dqsub792 subtract 1000 Inf -> -Infinity + +dqsub800 subtract Inf Inf -> NaN Invalid_operation +dqsub801 subtract Inf 1000 -> Infinity +dqsub802 subtract Inf 1 -> Infinity +dqsub803 subtract Inf 0 -> Infinity +dqsub804 subtract Inf -0 -> Infinity +dqsub805 subtract Inf -1 -> Infinity +dqsub806 subtract Inf -1000 -> Infinity +dqsub807 subtract Inf -Inf -> Infinity +dqsub808 subtract -1000 -Inf -> Infinity +dqsub809 subtract -Inf -Inf -> NaN Invalid_operation +dqsub810 subtract -1 -Inf -> Infinity +dqsub811 subtract -0 -Inf -> Infinity +dqsub812 subtract 0 -Inf -> Infinity +dqsub813 subtract 1 -Inf -> Infinity +dqsub814 subtract 1000 -Inf -> Infinity +dqsub815 subtract Inf -Inf -> Infinity + +dqsub821 subtract NaN Inf -> NaN +dqsub822 subtract -NaN 1000 -> -NaN +dqsub823 subtract NaN 1 -> NaN +dqsub824 subtract NaN 0 -> NaN +dqsub825 subtract NaN -0 -> NaN +dqsub826 subtract NaN -1 -> NaN +dqsub827 subtract NaN -1000 -> NaN +dqsub828 subtract NaN -Inf -> NaN +dqsub829 subtract -NaN NaN -> -NaN +dqsub830 subtract -Inf NaN -> NaN +dqsub831 subtract -1000 NaN -> NaN +dqsub832 subtract -1 NaN -> NaN +dqsub833 subtract -0 NaN -> NaN +dqsub834 subtract 0 NaN -> NaN +dqsub835 subtract 1 NaN -> NaN +dqsub836 subtract 1000 -NaN -> -NaN +dqsub837 subtract Inf NaN -> NaN + +dqsub841 subtract sNaN Inf -> NaN Invalid_operation +dqsub842 subtract -sNaN 1000 -> -NaN Invalid_operation +dqsub843 subtract sNaN 1 -> NaN Invalid_operation +dqsub844 subtract sNaN 0 -> NaN Invalid_operation +dqsub845 subtract sNaN -0 -> NaN Invalid_operation +dqsub846 subtract sNaN -1 -> NaN Invalid_operation +dqsub847 subtract sNaN -1000 -> NaN Invalid_operation +dqsub848 subtract sNaN NaN -> NaN Invalid_operation +dqsub849 subtract sNaN sNaN -> NaN Invalid_operation +dqsub850 subtract NaN sNaN -> NaN Invalid_operation +dqsub851 subtract -Inf -sNaN -> -NaN Invalid_operation +dqsub852 subtract -1000 sNaN -> NaN Invalid_operation +dqsub853 subtract -1 sNaN -> NaN Invalid_operation +dqsub854 subtract -0 sNaN -> NaN Invalid_operation +dqsub855 subtract 0 sNaN -> NaN Invalid_operation +dqsub856 subtract 1 sNaN -> NaN Invalid_operation +dqsub857 subtract 1000 sNaN -> NaN Invalid_operation +dqsub858 subtract Inf sNaN -> NaN Invalid_operation +dqsub859 subtract NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqsub861 subtract NaN01 -Inf -> NaN1 +dqsub862 subtract -NaN02 -1000 -> -NaN2 +dqsub863 subtract NaN03 1000 -> NaN3 +dqsub864 subtract NaN04 Inf -> NaN4 +dqsub865 subtract NaN05 NaN61 -> NaN5 +dqsub866 subtract -Inf -NaN71 -> -NaN71 +dqsub867 subtract -1000 NaN81 -> NaN81 +dqsub868 subtract 1000 NaN91 -> NaN91 +dqsub869 subtract Inf NaN101 -> NaN101 +dqsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation +dqsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation +dqsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation +dqsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation +dqsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation +dqsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation +dqsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation +dqsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation +dqsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation +dqsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation +dqsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation + +-- edge case spills +dqsub901 subtract 2.E-3 1.002 -> -1.000 +dqsub902 subtract 2.0E-3 1.002 -> -1.0000 +dqsub903 subtract 2.00E-3 1.0020 -> -1.00000 +dqsub904 subtract 2.000E-3 1.00200 -> -1.000000 +dqsub905 subtract 2.0000E-3 1.002000 -> -1.0000000 +dqsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000 +dqsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000 +dqsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000 + +-- subnormals and overflows covered under Add + +-- Examples from SQL proposal (Krishna Kulkarni) +dqsub1125 subtract 130E-2 120E-2 -> 0.10 +dqsub1126 subtract 130E-2 12E-1 -> 0.10 +dqsub1127 subtract 130E-2 1E0 -> 0.30 +dqsub1128 subtract 1E2 1E4 -> -9.9E+3 + +-- Null tests +dqsub9990 subtract 10 # -> NaN Invalid_operation +dqsub9991 subtract # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqToIntegral.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqToIntegral.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,257 @@ +------------------------------------------------------------------------ +-- dqToIntegral.decTest -- round Quad to integral value -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests tests the extended specification 'round-to-integral +-- value-exact' operations (from IEEE 854, later modified in 754r). +-- All non-zero results are defined as being those from either copy or +-- quantize, so those are assumed to have been tested extensively +-- elsewhere; the tests here are for integrity, rounding mode, etc. +-- Also, it is assumed the test harness will use these tests for both +-- ToIntegralExact (which does set Inexact) and the fixed-name +-- functions (which do not set Inexact). + +-- Note that decNumber implements an earlier definition of toIntegral +-- which never sets Inexact; the decTest operator for that is called +-- 'tointegral' instead of 'tointegralx'. + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +dqintx001 tointegralx 0 -> 0 +dqintx002 tointegralx 0.0 -> 0 +dqintx003 tointegralx 0.1 -> 0 Inexact Rounded +dqintx004 tointegralx 0.2 -> 0 Inexact Rounded +dqintx005 tointegralx 0.3 -> 0 Inexact Rounded +dqintx006 tointegralx 0.4 -> 0 Inexact Rounded +dqintx007 tointegralx 0.5 -> 0 Inexact Rounded +dqintx008 tointegralx 0.6 -> 1 Inexact Rounded +dqintx009 tointegralx 0.7 -> 1 Inexact Rounded +dqintx010 tointegralx 0.8 -> 1 Inexact Rounded +dqintx011 tointegralx 0.9 -> 1 Inexact Rounded +dqintx012 tointegralx 1 -> 1 +dqintx013 tointegralx 1.0 -> 1 Rounded +dqintx014 tointegralx 1.1 -> 1 Inexact Rounded +dqintx015 tointegralx 1.2 -> 1 Inexact Rounded +dqintx016 tointegralx 1.3 -> 1 Inexact Rounded +dqintx017 tointegralx 1.4 -> 1 Inexact Rounded +dqintx018 tointegralx 1.5 -> 2 Inexact Rounded +dqintx019 tointegralx 1.6 -> 2 Inexact Rounded +dqintx020 tointegralx 1.7 -> 2 Inexact Rounded +dqintx021 tointegralx 1.8 -> 2 Inexact Rounded +dqintx022 tointegralx 1.9 -> 2 Inexact Rounded +-- negatives +dqintx031 tointegralx -0 -> -0 +dqintx032 tointegralx -0.0 -> -0 +dqintx033 tointegralx -0.1 -> -0 Inexact Rounded +dqintx034 tointegralx -0.2 -> -0 Inexact Rounded +dqintx035 tointegralx -0.3 -> -0 Inexact Rounded +dqintx036 tointegralx -0.4 -> -0 Inexact Rounded +dqintx037 tointegralx -0.5 -> -0 Inexact Rounded +dqintx038 tointegralx -0.6 -> -1 Inexact Rounded +dqintx039 tointegralx -0.7 -> -1 Inexact Rounded +dqintx040 tointegralx -0.8 -> -1 Inexact Rounded +dqintx041 tointegralx -0.9 -> -1 Inexact Rounded +dqintx042 tointegralx -1 -> -1 +dqintx043 tointegralx -1.0 -> -1 Rounded +dqintx044 tointegralx -1.1 -> -1 Inexact Rounded +dqintx045 tointegralx -1.2 -> -1 Inexact Rounded +dqintx046 tointegralx -1.3 -> -1 Inexact Rounded +dqintx047 tointegralx -1.4 -> -1 Inexact Rounded +dqintx048 tointegralx -1.5 -> -2 Inexact Rounded +dqintx049 tointegralx -1.6 -> -2 Inexact Rounded +dqintx050 tointegralx -1.7 -> -2 Inexact Rounded +dqintx051 tointegralx -1.8 -> -2 Inexact Rounded +dqintx052 tointegralx -1.9 -> -2 Inexact Rounded +-- next two would be NaN using quantize(x, 0) +dqintx053 tointegralx 10E+60 -> 1.0E+61 +dqintx054 tointegralx -10E+60 -> -1.0E+61 + +-- numbers around precision +dqintx060 tointegralx '56267E-17' -> '0' Inexact Rounded +dqintx061 tointegralx '56267E-5' -> '1' Inexact Rounded +dqintx062 tointegralx '56267E-2' -> '563' Inexact Rounded +dqintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded +dqintx065 tointegralx '56267E-0' -> '56267' +dqintx066 tointegralx '56267E+0' -> '56267' +dqintx067 tointegralx '56267E+1' -> '5.6267E+5' +dqintx068 tointegralx '56267E+9' -> '5.6267E+13' +dqintx069 tointegralx '56267E+10' -> '5.6267E+14' +dqintx070 tointegralx '56267E+11' -> '5.6267E+15' +dqintx071 tointegralx '56267E+12' -> '5.6267E+16' +dqintx072 tointegralx '56267E+13' -> '5.6267E+17' +dqintx073 tointegralx '1.23E+96' -> '1.23E+96' +dqintx074 tointegralx '1.23E+6144' -> #47ffd300000000000000000000000000 Clamped + +dqintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded +dqintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded +dqintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded +dqintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded +dqintx085 tointegralx '-56267E-0' -> '-56267' +dqintx086 tointegralx '-56267E+0' -> '-56267' +dqintx087 tointegralx '-56267E+1' -> '-5.6267E+5' +dqintx088 tointegralx '-56267E+9' -> '-5.6267E+13' +dqintx089 tointegralx '-56267E+10' -> '-5.6267E+14' +dqintx090 tointegralx '-56267E+11' -> '-5.6267E+15' +dqintx091 tointegralx '-56267E+12' -> '-5.6267E+16' +dqintx092 tointegralx '-56267E+13' -> '-5.6267E+17' +dqintx093 tointegralx '-1.23E+96' -> '-1.23E+96' +dqintx094 tointegralx '-1.23E+6144' -> #c7ffd300000000000000000000000000 Clamped + +-- subnormal inputs +dqintx100 tointegralx 1E-299 -> 0 Inexact Rounded +dqintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded +dqintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded +dqintx103 tointegralx 0E-299 -> 0 + +-- specials and zeros +dqintx120 tointegralx 'Inf' -> Infinity +dqintx121 tointegralx '-Inf' -> -Infinity +dqintx122 tointegralx NaN -> NaN +dqintx123 tointegralx sNaN -> NaN Invalid_operation +dqintx124 tointegralx 0 -> 0 +dqintx125 tointegralx -0 -> -0 +dqintx126 tointegralx 0.000 -> 0 +dqintx127 tointegralx 0.00 -> 0 +dqintx128 tointegralx 0.0 -> 0 +dqintx129 tointegralx 0 -> 0 +dqintx130 tointegralx 0E-3 -> 0 +dqintx131 tointegralx 0E-2 -> 0 +dqintx132 tointegralx 0E-1 -> 0 +dqintx133 tointegralx 0E-0 -> 0 +dqintx134 tointegralx 0E+1 -> 0E+1 +dqintx135 tointegralx 0E+2 -> 0E+2 +dqintx136 tointegralx 0E+3 -> 0E+3 +dqintx137 tointegralx 0E+4 -> 0E+4 +dqintx138 tointegralx 0E+5 -> 0E+5 +dqintx139 tointegralx -0.000 -> -0 +dqintx140 tointegralx -0.00 -> -0 +dqintx141 tointegralx -0.0 -> -0 +dqintx142 tointegralx -0 -> -0 +dqintx143 tointegralx -0E-3 -> -0 +dqintx144 tointegralx -0E-2 -> -0 +dqintx145 tointegralx -0E-1 -> -0 +dqintx146 tointegralx -0E-0 -> -0 +dqintx147 tointegralx -0E+1 -> -0E+1 +dqintx148 tointegralx -0E+2 -> -0E+2 +dqintx149 tointegralx -0E+3 -> -0E+3 +dqintx150 tointegralx -0E+4 -> -0E+4 +dqintx151 tointegralx -0E+5 -> -0E+5 +-- propagating NaNs +dqintx152 tointegralx NaN808 -> NaN808 +dqintx153 tointegralx sNaN080 -> NaN80 Invalid_operation +dqintx154 tointegralx -NaN808 -> -NaN808 +dqintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation +dqintx156 tointegralx -NaN -> -NaN +dqintx157 tointegralx -sNaN -> -NaN Invalid_operation + +-- examples +rounding: half_up +dqintx200 tointegralx 2.1 -> 2 Inexact Rounded +dqintx201 tointegralx 100 -> 100 +dqintx202 tointegralx 100.0 -> 100 Rounded +dqintx203 tointegralx 101.5 -> 102 Inexact Rounded +dqintx204 tointegralx -101.5 -> -102 Inexact Rounded +dqintx205 tointegralx 10E+5 -> 1.0E+6 +dqintx206 tointegralx 7.89E+77 -> 7.89E+77 +dqintx207 tointegralx -Inf -> -Infinity + + +-- all rounding modes +rounding: half_even +dqintx210 tointegralx 55.5 -> 56 Inexact Rounded +dqintx211 tointegralx 56.5 -> 56 Inexact Rounded +dqintx212 tointegralx 57.5 -> 58 Inexact Rounded +dqintx213 tointegralx -55.5 -> -56 Inexact Rounded +dqintx214 tointegralx -56.5 -> -56 Inexact Rounded +dqintx215 tointegralx -57.5 -> -58 Inexact Rounded + +rounding: half_up + +dqintx220 tointegralx 55.5 -> 56 Inexact Rounded +dqintx221 tointegralx 56.5 -> 57 Inexact Rounded +dqintx222 tointegralx 57.5 -> 58 Inexact Rounded +dqintx223 tointegralx -55.5 -> -56 Inexact Rounded +dqintx224 tointegralx -56.5 -> -57 Inexact Rounded +dqintx225 tointegralx -57.5 -> -58 Inexact Rounded + +rounding: half_down + +dqintx230 tointegralx 55.5 -> 55 Inexact Rounded +dqintx231 tointegralx 56.5 -> 56 Inexact Rounded +dqintx232 tointegralx 57.5 -> 57 Inexact Rounded +dqintx233 tointegralx -55.5 -> -55 Inexact Rounded +dqintx234 tointegralx -56.5 -> -56 Inexact Rounded +dqintx235 tointegralx -57.5 -> -57 Inexact Rounded + +rounding: up + +dqintx240 tointegralx 55.3 -> 56 Inexact Rounded +dqintx241 tointegralx 56.3 -> 57 Inexact Rounded +dqintx242 tointegralx 57.3 -> 58 Inexact Rounded +dqintx243 tointegralx -55.3 -> -56 Inexact Rounded +dqintx244 tointegralx -56.3 -> -57 Inexact Rounded +dqintx245 tointegralx -57.3 -> -58 Inexact Rounded + +rounding: down + +dqintx250 tointegralx 55.7 -> 55 Inexact Rounded +dqintx251 tointegralx 56.7 -> 56 Inexact Rounded +dqintx252 tointegralx 57.7 -> 57 Inexact Rounded +dqintx253 tointegralx -55.7 -> -55 Inexact Rounded +dqintx254 tointegralx -56.7 -> -56 Inexact Rounded +dqintx255 tointegralx -57.7 -> -57 Inexact Rounded + +rounding: ceiling + +dqintx260 tointegralx 55.3 -> 56 Inexact Rounded +dqintx261 tointegralx 56.3 -> 57 Inexact Rounded +dqintx262 tointegralx 57.3 -> 58 Inexact Rounded +dqintx263 tointegralx -55.3 -> -55 Inexact Rounded +dqintx264 tointegralx -56.3 -> -56 Inexact Rounded +dqintx265 tointegralx -57.3 -> -57 Inexact Rounded + +rounding: floor + +dqintx270 tointegralx 55.7 -> 55 Inexact Rounded +dqintx271 tointegralx 56.7 -> 56 Inexact Rounded +dqintx272 tointegralx 57.7 -> 57 Inexact Rounded +dqintx273 tointegralx -55.7 -> -56 Inexact Rounded +dqintx274 tointegralx -56.7 -> -57 Inexact Rounded +dqintx275 tointegralx -57.7 -> -58 Inexact Rounded + +-- Int and uInt32 edge values for testing conversions +dqintx300 tointegralx -2147483646 -> -2147483646 +dqintx301 tointegralx -2147483647 -> -2147483647 +dqintx302 tointegralx -2147483648 -> -2147483648 +dqintx303 tointegralx -2147483649 -> -2147483649 +dqintx304 tointegralx 2147483646 -> 2147483646 +dqintx305 tointegralx 2147483647 -> 2147483647 +dqintx306 tointegralx 2147483648 -> 2147483648 +dqintx307 tointegralx 2147483649 -> 2147483649 +dqintx308 tointegralx 4294967294 -> 4294967294 +dqintx309 tointegralx 4294967295 -> 4294967295 +dqintx310 tointegralx 4294967296 -> 4294967296 +dqintx311 tointegralx 4294967297 -> 4294967297 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqXor.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dqXor.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,410 @@ +------------------------------------------------------------------------ +-- dqXor.decTest -- digitwise logical XOR for decQuads -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +clamp: 1 +precision: 34 +maxExponent: 6144 +minExponent: -6143 +rounding: half_even + +-- Sanity check (truth table) +dqxor001 xor 0 0 -> 0 +dqxor002 xor 0 1 -> 1 +dqxor003 xor 1 0 -> 1 +dqxor004 xor 1 1 -> 0 +dqxor005 xor 1100 1010 -> 110 +-- and at msd and msd-1 +dqxor006 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqxor007 xor 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqxor008 xor 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000 +dqxor009 xor 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 0 +dqxor010 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0 +dqxor011 xor 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000 +dqxor012 xor 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000 +dqxor013 xor 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 0 + +-- Various lengths +-- 1234567890123456789012345678901234 +dqxor601 xor 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000000 +dqxor602 xor 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000000 +dqxor603 xor 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000000 +dqxor604 xor 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000 +dqxor605 xor 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000 +dqxor606 xor 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000 +dqxor607 xor 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000 +dqxor608 xor 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000 +dqxor609 xor 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000 +dqxor610 xor 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000 +dqxor611 xor 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000 +dqxor612 xor 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000 +dqxor613 xor 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000 +dqxor614 xor 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000 +dqxor615 xor 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000 +dqxor616 xor 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000 +dqxor617 xor 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 100000000000000000 +dqxor618 xor 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 10000000000000000 +dqxor619 xor 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1000000000000000 +dqxor620 xor 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 100000000000000 +dqxor621 xor 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 10000000000000 +dqxor622 xor 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1000000000000 +dqxor623 xor 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 100000000000 +dqxor624 xor 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 10000000000 +dqxor625 xor 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1000000000 +dqxor626 xor 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 100000000 +dqxor627 xor 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 10000000 +dqxor628 xor 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1000000 +dqxor629 xor 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 100000 +dqxor630 xor 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 10000 +dqxor631 xor 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1000 +dqxor632 xor 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 100 +dqxor633 xor 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 10 +dqxor634 xor 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1 + +dqxor641 xor 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 1000000000000000000000000000000000 +dqxor642 xor 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 100000000000000000000000000000000 +dqxor643 xor 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 10000000000000000000000000000000 +dqxor644 xor 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1000000000000000000000000000000 +dqxor645 xor 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 100000000000000000000000000000 +dqxor646 xor 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 10000000000000000000000000000 +dqxor647 xor 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1000000000000000000000000000 +dqxor648 xor 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 100000000000000000000000000 +dqxor649 xor 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 10000000000000000000000000 +dqxor650 xor 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1000000000000000000000000 +dqxor651 xor 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 100000000000000000000000 +dqxor652 xor 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 10000000000000000000000 +dqxor653 xor 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1000000000000000000000 +dqxor654 xor 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 100000000000000000000 +dqxor655 xor 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 10000000000000000000 +dqxor656 xor 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1000000000000000000 +dqxor657 xor 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 100000000000000000 +dqxor658 xor 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 10000000000000000 +dqxor659 xor 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1000000000000000 +dqxor660 xor 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 100000000000000 +dqxor661 xor 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 10000000000000 +dqxor662 xor 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1000000000000 +dqxor663 xor 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 100000000000 +dqxor664 xor 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 10000000000 +dqxor665 xor 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1000000000 +dqxor666 xor 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 100000000 +dqxor667 xor 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 10000000 +dqxor668 xor 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1000000 +dqxor669 xor 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 100000 +dqxor670 xor 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 10000 +dqxor671 xor 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1000 +dqxor672 xor 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 100 +dqxor673 xor 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 10 +dqxor674 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1 +dqxor675 xor 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1000000000000000000000000000000001 +dqxor676 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1 + + +dqxor021 xor 1111111110000000 1111111110000000 -> 0 +dqxor022 xor 111111110000000 111111110000000 -> 0 +dqxor023 xor 11111110000000 11111110000000 -> 0 +dqxor024 xor 1111110000000 1111110000000 -> 0 +dqxor025 xor 111110000000 111110000000 -> 0 +dqxor026 xor 11110000000 11110000000 -> 0 +dqxor027 xor 1110000000 1110000000 -> 0 +dqxor028 xor 110000000 110000000 -> 0 +dqxor029 xor 10000000 10000000 -> 0 +dqxor030 xor 1000000 1000000 -> 0 +dqxor031 xor 100000 100000 -> 0 +dqxor032 xor 10000 10000 -> 0 +dqxor033 xor 1000 1000 -> 0 +dqxor034 xor 100 100 -> 0 +dqxor035 xor 10 10 -> 0 +dqxor036 xor 1 1 -> 0 + +dqxor040 xor 111111111 111111111111 -> 111000000000 +dqxor041 xor 11111111 111111111111 -> 111100000000 +dqxor042 xor 11111111 111111111 -> 100000000 +dqxor043 xor 1111111 100000010 -> 101111101 +dqxor044 xor 111111 100000100 -> 100111011 +dqxor045 xor 11111 100001000 -> 100010111 +dqxor046 xor 1111 100010000 -> 100011111 +dqxor047 xor 111 100100000 -> 100100111 +dqxor048 xor 11 101000000 -> 101000011 +dqxor049 xor 1 110000000 -> 110000001 + +dqxor050 xor 1111111111 1 -> 1111111110 +dqxor051 xor 111111111 1 -> 111111110 +dqxor052 xor 11111111 1 -> 11111110 +dqxor053 xor 1111111 1 -> 1111110 +dqxor054 xor 111111 1 -> 111110 +dqxor055 xor 11111 1 -> 11110 +dqxor056 xor 1111 1 -> 1110 +dqxor057 xor 111 1 -> 110 +dqxor058 xor 11 1 -> 10 +dqxor059 xor 1 1 -> 0 + +dqxor060 xor 1111111111 0 -> 1111111111 +dqxor061 xor 111111111 0 -> 111111111 +dqxor062 xor 11111111 0 -> 11111111 +dqxor063 xor 1111111 0 -> 1111111 +dqxor064 xor 111111 0 -> 111111 +dqxor065 xor 11111 0 -> 11111 +dqxor066 xor 1111 0 -> 1111 +dqxor067 xor 111 0 -> 111 +dqxor068 xor 11 0 -> 11 +dqxor069 xor 1 0 -> 1 + +dqxor070 xor 1 1111111111 -> 1111111110 +dqxor071 xor 1 111111111 -> 111111110 +dqxor072 xor 1 11111111 -> 11111110 +dqxor073 xor 1 1111111 -> 1111110 +dqxor074 xor 1 111111 -> 111110 +dqxor075 xor 1 11111 -> 11110 +dqxor076 xor 1 1111 -> 1110 +dqxor077 xor 1 111 -> 110 +dqxor078 xor 1 11 -> 10 +dqxor079 xor 1 1 -> 0 + +dqxor080 xor 0 1111111111 -> 1111111111 +dqxor081 xor 0 111111111 -> 111111111 +dqxor082 xor 0 11111111 -> 11111111 +dqxor083 xor 0 1111111 -> 1111111 +dqxor084 xor 0 111111 -> 111111 +dqxor085 xor 0 11111 -> 11111 +dqxor086 xor 0 1111 -> 1111 +dqxor087 xor 0 111 -> 111 +dqxor088 xor 0 11 -> 11 +dqxor089 xor 0 1 -> 1 + +dqxor090 xor 011111111 111101111 -> 100010000 +dqxor091 xor 101111111 111101111 -> 10010000 +dqxor092 xor 110111111 111101111 -> 1010000 +dqxor093 xor 111011111 111101111 -> 110000 +dqxor094 xor 111101111 111101111 -> 0 +dqxor095 xor 111110111 111101111 -> 11000 +dqxor096 xor 111111011 111101111 -> 10100 +dqxor097 xor 111111101 111101111 -> 10010 +dqxor098 xor 111111110 111101111 -> 10001 + +dqxor100 xor 111101111 011111111 -> 100010000 +dqxor101 xor 111101111 101111111 -> 10010000 +dqxor102 xor 111101111 110111111 -> 1010000 +dqxor103 xor 111101111 111011111 -> 110000 +dqxor104 xor 111101111 111101111 -> 0 +dqxor105 xor 111101111 111110111 -> 11000 +dqxor106 xor 111101111 111111011 -> 10100 +dqxor107 xor 111101111 111111101 -> 10010 +dqxor108 xor 111101111 111111110 -> 10001 + +-- non-0/1 should not be accepted, nor should signs +dqxor220 xor 111111112 111111111 -> NaN Invalid_operation +dqxor221 xor 333333333 333333333 -> NaN Invalid_operation +dqxor222 xor 555555555 555555555 -> NaN Invalid_operation +dqxor223 xor 777777777 777777777 -> NaN Invalid_operation +dqxor224 xor 999999999 999999999 -> NaN Invalid_operation +dqxor225 xor 222222222 999999999 -> NaN Invalid_operation +dqxor226 xor 444444444 999999999 -> NaN Invalid_operation +dqxor227 xor 666666666 999999999 -> NaN Invalid_operation +dqxor228 xor 888888888 999999999 -> NaN Invalid_operation +dqxor229 xor 999999999 222222222 -> NaN Invalid_operation +dqxor230 xor 999999999 444444444 -> NaN Invalid_operation +dqxor231 xor 999999999 666666666 -> NaN Invalid_operation +dqxor232 xor 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +dqxor240 xor 567468689 -934981942 -> NaN Invalid_operation +dqxor241 xor 567367689 934981942 -> NaN Invalid_operation +dqxor242 xor -631917772 -706014634 -> NaN Invalid_operation +dqxor243 xor -756253257 138579234 -> NaN Invalid_operation +dqxor244 xor 835590149 567435400 -> NaN Invalid_operation +-- test MSD +dqxor250 xor 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqxor251 xor 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqxor252 xor 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqxor253 xor 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation +dqxor254 xor 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqxor255 xor 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqxor256 xor 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqxor257 xor 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation +dqxor258 xor 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation +dqxor259 xor 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation +dqxor260 xor 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation +dqxor261 xor 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation +dqxor262 xor 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation +dqxor263 xor 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation +dqxor264 xor 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation +dqxor265 xor 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation +-- test MSD-1 +dqxor270 xor 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation +dqxor271 xor 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation +dqxor272 xor 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation +dqxor273 xor 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation +dqxor274 xor 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation +dqxor275 xor 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation +dqxor276 xor 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation +dqxor277 xor 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation +-- test LSD +dqxor280 xor 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation +dqxor281 xor 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation +dqxor282 xor 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation +dqxor283 xor 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation +dqxor284 xor 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation +dqxor285 xor 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation +dqxor286 xor 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation +dqxor287 xor 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation +-- test Middie +dqxor288 xor 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation +dqxor289 xor 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation +dqxor290 xor 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation +dqxor291 xor 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation +dqxor292 xor 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation +dqxor293 xor 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation +dqxor294 xor 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation +dqxor295 xor 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation +-- signs +dqxor296 xor -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation +dqxor297 xor -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation +dqxor298 xor 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation +dqxor299 xor 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001001001001001001000010000100 + +-- Nmax, Nmin, Ntiny-like +dqxor331 xor 2 9.99999999E+999 -> NaN Invalid_operation +dqxor332 xor 3 1E-999 -> NaN Invalid_operation +dqxor333 xor 4 1.00000000E-2821 -> NaN Invalid_operation +dqxor334 xor 5 1E-900 -> NaN Invalid_operation +dqxor335 xor 6 -1E-900 -> NaN Invalid_operation +dqxor336 xor 7 -1.00000000E-999 -> NaN Invalid_operation +dqxor337 xor 8 -1E-999 -> NaN Invalid_operation +dqxor338 xor 9 -9.99999999E+999 -> NaN Invalid_operation +dqxor341 xor 9.99999999E+999 -18 -> NaN Invalid_operation +dqxor342 xor 1E-999 01 -> NaN Invalid_operation +dqxor343 xor 1.00000000E-999 -18 -> NaN Invalid_operation +dqxor344 xor 1E-908 18 -> NaN Invalid_operation +dqxor345 xor -1E-907 -10 -> NaN Invalid_operation +dqxor346 xor -1.00000000E-999 18 -> NaN Invalid_operation +dqxor347 xor -1E-999 10 -> NaN Invalid_operation +dqxor348 xor -9.99999999E+2991 -18 -> NaN Invalid_operation + +-- A few other non-integers +dqxor361 xor 1.0 1 -> NaN Invalid_operation +dqxor362 xor 1E+1 1 -> NaN Invalid_operation +dqxor363 xor 0.0 1 -> NaN Invalid_operation +dqxor364 xor 0E+1 1 -> NaN Invalid_operation +dqxor365 xor 9.9 1 -> NaN Invalid_operation +dqxor366 xor 9E+1 1 -> NaN Invalid_operation +dqxor371 xor 0 1.0 -> NaN Invalid_operation +dqxor372 xor 0 1E+1 -> NaN Invalid_operation +dqxor373 xor 0 0.0 -> NaN Invalid_operation +dqxor374 xor 0 0E+1 -> NaN Invalid_operation +dqxor375 xor 0 9.9 -> NaN Invalid_operation +dqxor376 xor 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +dqxor780 xor -Inf -Inf -> NaN Invalid_operation +dqxor781 xor -Inf -1000 -> NaN Invalid_operation +dqxor782 xor -Inf -1 -> NaN Invalid_operation +dqxor783 xor -Inf -0 -> NaN Invalid_operation +dqxor784 xor -Inf 0 -> NaN Invalid_operation +dqxor785 xor -Inf 1 -> NaN Invalid_operation +dqxor786 xor -Inf 1000 -> NaN Invalid_operation +dqxor787 xor -1000 -Inf -> NaN Invalid_operation +dqxor788 xor -Inf -Inf -> NaN Invalid_operation +dqxor789 xor -1 -Inf -> NaN Invalid_operation +dqxor790 xor -0 -Inf -> NaN Invalid_operation +dqxor791 xor 0 -Inf -> NaN Invalid_operation +dqxor792 xor 1 -Inf -> NaN Invalid_operation +dqxor793 xor 1000 -Inf -> NaN Invalid_operation +dqxor794 xor Inf -Inf -> NaN Invalid_operation + +dqxor800 xor Inf -Inf -> NaN Invalid_operation +dqxor801 xor Inf -1000 -> NaN Invalid_operation +dqxor802 xor Inf -1 -> NaN Invalid_operation +dqxor803 xor Inf -0 -> NaN Invalid_operation +dqxor804 xor Inf 0 -> NaN Invalid_operation +dqxor805 xor Inf 1 -> NaN Invalid_operation +dqxor806 xor Inf 1000 -> NaN Invalid_operation +dqxor807 xor Inf Inf -> NaN Invalid_operation +dqxor808 xor -1000 Inf -> NaN Invalid_operation +dqxor809 xor -Inf Inf -> NaN Invalid_operation +dqxor810 xor -1 Inf -> NaN Invalid_operation +dqxor811 xor -0 Inf -> NaN Invalid_operation +dqxor812 xor 0 Inf -> NaN Invalid_operation +dqxor813 xor 1 Inf -> NaN Invalid_operation +dqxor814 xor 1000 Inf -> NaN Invalid_operation +dqxor815 xor Inf Inf -> NaN Invalid_operation + +dqxor821 xor NaN -Inf -> NaN Invalid_operation +dqxor822 xor NaN -1000 -> NaN Invalid_operation +dqxor823 xor NaN -1 -> NaN Invalid_operation +dqxor824 xor NaN -0 -> NaN Invalid_operation +dqxor825 xor NaN 0 -> NaN Invalid_operation +dqxor826 xor NaN 1 -> NaN Invalid_operation +dqxor827 xor NaN 1000 -> NaN Invalid_operation +dqxor828 xor NaN Inf -> NaN Invalid_operation +dqxor829 xor NaN NaN -> NaN Invalid_operation +dqxor830 xor -Inf NaN -> NaN Invalid_operation +dqxor831 xor -1000 NaN -> NaN Invalid_operation +dqxor832 xor -1 NaN -> NaN Invalid_operation +dqxor833 xor -0 NaN -> NaN Invalid_operation +dqxor834 xor 0 NaN -> NaN Invalid_operation +dqxor835 xor 1 NaN -> NaN Invalid_operation +dqxor836 xor 1000 NaN -> NaN Invalid_operation +dqxor837 xor Inf NaN -> NaN Invalid_operation + +dqxor841 xor sNaN -Inf -> NaN Invalid_operation +dqxor842 xor sNaN -1000 -> NaN Invalid_operation +dqxor843 xor sNaN -1 -> NaN Invalid_operation +dqxor844 xor sNaN -0 -> NaN Invalid_operation +dqxor845 xor sNaN 0 -> NaN Invalid_operation +dqxor846 xor sNaN 1 -> NaN Invalid_operation +dqxor847 xor sNaN 1000 -> NaN Invalid_operation +dqxor848 xor sNaN NaN -> NaN Invalid_operation +dqxor849 xor sNaN sNaN -> NaN Invalid_operation +dqxor850 xor NaN sNaN -> NaN Invalid_operation +dqxor851 xor -Inf sNaN -> NaN Invalid_operation +dqxor852 xor -1000 sNaN -> NaN Invalid_operation +dqxor853 xor -1 sNaN -> NaN Invalid_operation +dqxor854 xor -0 sNaN -> NaN Invalid_operation +dqxor855 xor 0 sNaN -> NaN Invalid_operation +dqxor856 xor 1 sNaN -> NaN Invalid_operation +dqxor857 xor 1000 sNaN -> NaN Invalid_operation +dqxor858 xor Inf sNaN -> NaN Invalid_operation +dqxor859 xor NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dqxor861 xor NaN1 -Inf -> NaN Invalid_operation +dqxor862 xor +NaN2 -1000 -> NaN Invalid_operation +dqxor863 xor NaN3 1000 -> NaN Invalid_operation +dqxor864 xor NaN4 Inf -> NaN Invalid_operation +dqxor865 xor NaN5 +NaN6 -> NaN Invalid_operation +dqxor866 xor -Inf NaN7 -> NaN Invalid_operation +dqxor867 xor -1000 NaN8 -> NaN Invalid_operation +dqxor868 xor 1000 NaN9 -> NaN Invalid_operation +dqxor869 xor Inf +NaN10 -> NaN Invalid_operation +dqxor871 xor sNaN11 -Inf -> NaN Invalid_operation +dqxor872 xor sNaN12 -1000 -> NaN Invalid_operation +dqxor873 xor sNaN13 1000 -> NaN Invalid_operation +dqxor874 xor sNaN14 NaN17 -> NaN Invalid_operation +dqxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation +dqxor876 xor NaN16 sNaN19 -> NaN Invalid_operation +dqxor877 xor -Inf +sNaN20 -> NaN Invalid_operation +dqxor878 xor -1000 sNaN21 -> NaN Invalid_operation +dqxor879 xor 1000 sNaN22 -> NaN Invalid_operation +dqxor880 xor Inf sNaN23 -> NaN Invalid_operation +dqxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation +dqxor882 xor -NaN26 NaN28 -> NaN Invalid_operation +dqxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation +dqxor884 xor 1000 -NaN30 -> NaN Invalid_operation +dqxor885 xor 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dsBase.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dsBase.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1062 @@ +------------------------------------------------------------------------ +-- dsBase.decTest -- base decSingle <--> string conversions -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This file tests base conversions from string to a decimal number +-- and back to a string (in Scientific form) + +-- Note that unlike other operations the operand is subject to rounding +-- to conform to emax and precision settings (that is, numbers will +-- conform to rules and exponent will be in permitted range). The +-- 'left hand side', therefore, may have numbers that cannot be +-- represented in a decSingle. Some testcases go to the limit of the +-- next-wider format, and hence these testcases may also be used to +-- test narrowing and widening operations. + +extended: 1 +clamp: 1 +precision: 7 +maxExponent: 96 +minExponent: -95 +rounding: half_even + +dsbas001 toSci 0 -> 0 +dsbas002 toSci 1 -> 1 +dsbas003 toSci 1.0 -> 1.0 +dsbas004 toSci 1.00 -> 1.00 +dsbas005 toSci 10 -> 10 +dsbas006 toSci 1000 -> 1000 +dsbas007 toSci 10.0 -> 10.0 +dsbas008 toSci 10.1 -> 10.1 +dsbas009 toSci 10.4 -> 10.4 +dsbas010 toSci 10.5 -> 10.5 +dsbas011 toSci 10.6 -> 10.6 +dsbas012 toSci 10.9 -> 10.9 +dsbas013 toSci 11.0 -> 11.0 +dsbas014 toSci 1.234 -> 1.234 +dsbas015 toSci 0.123 -> 0.123 +dsbas016 toSci 0.012 -> 0.012 +dsbas017 toSci -0 -> -0 +dsbas018 toSci -0.0 -> -0.0 +dsbas019 toSci -00.00 -> -0.00 + +dsbas021 toSci -1 -> -1 +dsbas022 toSci -1.0 -> -1.0 +dsbas023 toSci -0.1 -> -0.1 +dsbas024 toSci -9.1 -> -9.1 +dsbas025 toSci -9.11 -> -9.11 +dsbas026 toSci -9.119 -> -9.119 +dsbas027 toSci -9.999 -> -9.999 + +dsbas030 toSci '1234.567' -> '1234.567' +dsbas031 toSci '1234.000' -> '1234.000' +dsbas032 toSci '1234912' -> '1234912' +dsbas033 toSci '0.00001234567' -> '0.00001234567' +dsbas034 toSci '0.000001234567' -> '0.000001234567' +dsbas035 toSci '0.0000001234567' -> '1.234567E-7' +dsbas036 toSci '0.00000001234567' -> '1.234567E-8' + +dsbas037 toSci '0.1234564' -> '0.1234564' +dsbas038 toSci '0.1234565' -> '0.1234565' + +-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax) +dsbsn001 toSci -9.999999E+96 -> -9.999999E+96 +dsbsn002 toSci -1E-95 -> -1E-95 +dsbsn003 toSci -1E-101 -> -1E-101 Subnormal +dsbsn004 toSci -0 -> -0 +dsbsn005 toSci +0 -> 0 +dsbsn006 toSci +1E-101 -> 1E-101 Subnormal +dsbsn007 toSci +1E-95 -> 1E-95 +dsbsn008 toSci +9.999999E+96 -> 9.999999E+96 + +-- String [many more examples are implicitly tested elsewhere] +-- strings without E cannot generate E in result +dsbas040 toSci "12" -> '12' +dsbas041 toSci "-76" -> '-76' +dsbas042 toSci "12.76" -> '12.76' +dsbas043 toSci "+12.76" -> '12.76' +dsbas044 toSci "012.76" -> '12.76' +dsbas045 toSci "+0.003" -> '0.003' +dsbas046 toSci "17." -> '17' +dsbas047 toSci ".5" -> '0.5' +dsbas048 toSci "044" -> '44' +dsbas049 toSci "0044" -> '44' +dsbas050 toSci "0.0005" -> '0.0005' +dsbas051 toSci "00.00005" -> '0.00005' +dsbas052 toSci "0.000005" -> '0.000005' +dsbas053 toSci "0.0000050" -> '0.0000050' +dsbas054 toSci "0.0000005" -> '5E-7' +dsbas055 toSci "0.00000005" -> '5E-8' +dsbas056 toSci "12678.54" -> '12678.54' +dsbas057 toSci "2678.543" -> '2678.543' +dsbas058 toSci "345678.5" -> '345678.5' +dsbas059 toSci "0678.5432" -> '678.5432' +dsbas060 toSci "678.5432" -> '678.5432' +dsbas061 toSci "+678.5432" -> '678.5432' +dsbas062 toSci "+0678.5432" -> '678.5432' +dsbas063 toSci "+00678.5432" -> '678.5432' +dsbas064 toSci "-678.5432" -> '-678.5432' +dsbas065 toSci "-0678.5432" -> '-678.5432' +dsbas066 toSci "-00678.5432" -> '-678.5432' +-- examples +dsbas067 toSci "5E-6" -> '0.000005' +dsbas068 toSci "50E-7" -> '0.0000050' +dsbas069 toSci "5E-7" -> '5E-7' + +-- [No exotics as no Unicode] + +-- rounded with dots in all (including edge) places +dsbas071 toSci .1234567890123456 -> 0.1234568 Inexact Rounded +dsbas072 toSci 1.234567890123456 -> 1.234568 Inexact Rounded +dsbas073 toSci 12.34567890123456 -> 12.34568 Inexact Rounded +dsbas074 toSci 123.4567890123456 -> 123.4568 Inexact Rounded +dsbas075 toSci 1234.567890123456 -> 1234.568 Inexact Rounded +dsbas076 toSci 12345.67890123456 -> 12345.68 Inexact Rounded +dsbas077 toSci 123456.7890123456 -> 123456.8 Inexact Rounded +dsbas078 toSci 1234567.890123456 -> 1234568 Inexact Rounded +dsbas079 toSci 12345678.90123456 -> 1.234568E+7 Inexact Rounded +dsbas080 toSci 123456789.0123456 -> 1.234568E+8 Inexact Rounded +dsbas081 toSci 1234567890.123456 -> 1.234568E+9 Inexact Rounded +dsbas082 toSci 12345678901.23456 -> 1.234568E+10 Inexact Rounded +dsbas083 toSci 123456789012.3456 -> 1.234568E+11 Inexact Rounded +dsbas084 toSci 1234567890123.456 -> 1.234568E+12 Inexact Rounded +dsbas085 toSci 12345678901234.56 -> 1.234568E+13 Inexact Rounded +dsbas086 toSci 123456789012345.6 -> 1.234568E+14 Inexact Rounded +dsbas087 toSci 1234567890123456. -> 1.234568E+15 Inexact Rounded +dsbas088 toSci 1234567890123456 -> 1.234568E+15 Inexact Rounded + +-- Numbers with E +dsbas130 toSci "0.000E-1" -> '0.0000' +dsbas131 toSci "0.000E-2" -> '0.00000' +dsbas132 toSci "0.000E-3" -> '0.000000' +dsbas133 toSci "0.000E-4" -> '0E-7' +dsbas134 toSci "0.00E-2" -> '0.0000' +dsbas135 toSci "0.00E-3" -> '0.00000' +dsbas136 toSci "0.00E-4" -> '0.000000' +dsbas137 toSci "0.00E-5" -> '0E-7' +dsbas138 toSci "+0E+9" -> '0E+9' +dsbas139 toSci "-0E+9" -> '-0E+9' +dsbas140 toSci "1E+9" -> '1E+9' +dsbas141 toSci "1e+09" -> '1E+9' +dsbas142 toSci "1E+90" -> '1E+90' +dsbas143 toSci "+1E+009" -> '1E+9' +dsbas144 toSci "0E+9" -> '0E+9' +dsbas145 toSci "1E+9" -> '1E+9' +dsbas146 toSci "1E+09" -> '1E+9' +dsbas147 toSci "1e+90" -> '1E+90' +dsbas148 toSci "1E+009" -> '1E+9' +dsbas149 toSci "000E+9" -> '0E+9' +dsbas150 toSci "1E9" -> '1E+9' +dsbas151 toSci "1e09" -> '1E+9' +dsbas152 toSci "1E90" -> '1E+90' +dsbas153 toSci "1E009" -> '1E+9' +dsbas154 toSci "0E9" -> '0E+9' +dsbas155 toSci "0.000e+0" -> '0.000' +dsbas156 toSci "0.000E-1" -> '0.0000' +dsbas157 toSci "4E+9" -> '4E+9' +dsbas158 toSci "44E+9" -> '4.4E+10' +dsbas159 toSci "0.73e-7" -> '7.3E-8' +dsbas160 toSci "00E+9" -> '0E+9' +dsbas161 toSci "00E-9" -> '0E-9' +dsbas162 toSci "10E+9" -> '1.0E+10' +dsbas163 toSci "10E+09" -> '1.0E+10' +dsbas164 toSci "10e+90" -> '1.0E+91' +dsbas165 toSci "10E+009" -> '1.0E+10' +dsbas166 toSci "100e+9" -> '1.00E+11' +dsbas167 toSci "100e+09" -> '1.00E+11' +dsbas168 toSci "100E+90" -> '1.00E+92' +dsbas169 toSci "100e+009" -> '1.00E+11' + +dsbas170 toSci "1.265" -> '1.265' +dsbas171 toSci "1.265E-20" -> '1.265E-20' +dsbas172 toSci "1.265E-8" -> '1.265E-8' +dsbas173 toSci "1.265E-4" -> '0.0001265' +dsbas174 toSci "1.265E-3" -> '0.001265' +dsbas175 toSci "1.265E-2" -> '0.01265' +dsbas176 toSci "1.265E-1" -> '0.1265' +dsbas177 toSci "1.265E-0" -> '1.265' +dsbas178 toSci "1.265E+1" -> '12.65' +dsbas179 toSci "1.265E+2" -> '126.5' +dsbas180 toSci "1.265E+3" -> '1265' +dsbas181 toSci "1.265E+4" -> '1.265E+4' +dsbas182 toSci "1.265E+8" -> '1.265E+8' +dsbas183 toSci "1.265E+20" -> '1.265E+20' + +dsbas190 toSci "12.65" -> '12.65' +dsbas191 toSci "12.65E-20" -> '1.265E-19' +dsbas192 toSci "12.65E-8" -> '1.265E-7' +dsbas193 toSci "12.65E-4" -> '0.001265' +dsbas194 toSci "12.65E-3" -> '0.01265' +dsbas195 toSci "12.65E-2" -> '0.1265' +dsbas196 toSci "12.65E-1" -> '1.265' +dsbas197 toSci "12.65E-0" -> '12.65' +dsbas198 toSci "12.65E+1" -> '126.5' +dsbas199 toSci "12.65E+2" -> '1265' +dsbas200 toSci "12.65E+3" -> '1.265E+4' +dsbas201 toSci "12.65E+4" -> '1.265E+5' +dsbas202 toSci "12.65E+8" -> '1.265E+9' +dsbas203 toSci "12.65E+20" -> '1.265E+21' + +dsbas210 toSci "126.5" -> '126.5' +dsbas211 toSci "126.5E-20" -> '1.265E-18' +dsbas212 toSci "126.5E-8" -> '0.000001265' +dsbas213 toSci "126.5E-4" -> '0.01265' +dsbas214 toSci "126.5E-3" -> '0.1265' +dsbas215 toSci "126.5E-2" -> '1.265' +dsbas216 toSci "126.5E-1" -> '12.65' +dsbas217 toSci "126.5E-0" -> '126.5' +dsbas218 toSci "126.5E+1" -> '1265' +dsbas219 toSci "126.5E+2" -> '1.265E+4' +dsbas220 toSci "126.5E+3" -> '1.265E+5' +dsbas221 toSci "126.5E+4" -> '1.265E+6' +dsbas222 toSci "126.5E+8" -> '1.265E+10' +dsbas223 toSci "126.5E+20" -> '1.265E+22' + +dsbas230 toSci "1265" -> '1265' +dsbas231 toSci "1265E-20" -> '1.265E-17' +dsbas232 toSci "1265E-8" -> '0.00001265' +dsbas233 toSci "1265E-4" -> '0.1265' +dsbas234 toSci "1265E-3" -> '1.265' +dsbas235 toSci "1265E-2" -> '12.65' +dsbas236 toSci "1265E-1" -> '126.5' +dsbas237 toSci "1265E-0" -> '1265' +dsbas238 toSci "1265E+1" -> '1.265E+4' +dsbas239 toSci "1265E+2" -> '1.265E+5' +dsbas240 toSci "1265E+3" -> '1.265E+6' +dsbas241 toSci "1265E+4" -> '1.265E+7' +dsbas242 toSci "1265E+8" -> '1.265E+11' +dsbas243 toSci "1265E+20" -> '1.265E+23' + +dsbas250 toSci "0.1265" -> '0.1265' +dsbas251 toSci "0.1265E-20" -> '1.265E-21' +dsbas252 toSci "0.1265E-8" -> '1.265E-9' +dsbas253 toSci "0.1265E-4" -> '0.00001265' +dsbas254 toSci "0.1265E-3" -> '0.0001265' +dsbas255 toSci "0.1265E-2" -> '0.001265' +dsbas256 toSci "0.1265E-1" -> '0.01265' +dsbas257 toSci "0.1265E-0" -> '0.1265' +dsbas258 toSci "0.1265E+1" -> '1.265' +dsbas259 toSci "0.1265E+2" -> '12.65' +dsbas260 toSci "0.1265E+3" -> '126.5' +dsbas261 toSci "0.1265E+4" -> '1265' +dsbas262 toSci "0.1265E+8" -> '1.265E+7' +dsbas263 toSci "0.1265E+20" -> '1.265E+19' + +-- some more negative zeros [systematic tests below] +dsbas290 toSci "-0.000E-1" -> '-0.0000' +dsbas291 toSci "-0.000E-2" -> '-0.00000' +dsbas292 toSci "-0.000E-3" -> '-0.000000' +dsbas293 toSci "-0.000E-4" -> '-0E-7' +dsbas294 toSci "-0.00E-2" -> '-0.0000' +dsbas295 toSci "-0.00E-3" -> '-0.00000' +dsbas296 toSci "-0.0E-2" -> '-0.000' +dsbas297 toSci "-0.0E-3" -> '-0.0000' +dsbas298 toSci "-0E-2" -> '-0.00' +dsbas299 toSci "-0E-3" -> '-0.000' + +-- Engineering notation tests +dsbas301 toSci 10e12 -> 1.0E+13 +dsbas302 toEng 10e12 -> 10E+12 +dsbas303 toSci 10e11 -> 1.0E+12 +dsbas304 toEng 10e11 -> 1.0E+12 +dsbas305 toSci 10e10 -> 1.0E+11 +dsbas306 toEng 10e10 -> 100E+9 +dsbas307 toSci 10e9 -> 1.0E+10 +dsbas308 toEng 10e9 -> 10E+9 +dsbas309 toSci 10e8 -> 1.0E+9 +dsbas310 toEng 10e8 -> 1.0E+9 +dsbas311 toSci 10e7 -> 1.0E+8 +dsbas312 toEng 10e7 -> 100E+6 +dsbas313 toSci 10e6 -> 1.0E+7 +dsbas314 toEng 10e6 -> 10E+6 +dsbas315 toSci 10e5 -> 1.0E+6 +dsbas316 toEng 10e5 -> 1.0E+6 +dsbas317 toSci 10e4 -> 1.0E+5 +dsbas318 toEng 10e4 -> 100E+3 +dsbas319 toSci 10e3 -> 1.0E+4 +dsbas320 toEng 10e3 -> 10E+3 +dsbas321 toSci 10e2 -> 1.0E+3 +dsbas322 toEng 10e2 -> 1.0E+3 +dsbas323 toSci 10e1 -> 1.0E+2 +dsbas324 toEng 10e1 -> 100 +dsbas325 toSci 10e0 -> 10 +dsbas326 toEng 10e0 -> 10 +dsbas327 toSci 10e-1 -> 1.0 +dsbas328 toEng 10e-1 -> 1.0 +dsbas329 toSci 10e-2 -> 0.10 +dsbas330 toEng 10e-2 -> 0.10 +dsbas331 toSci 10e-3 -> 0.010 +dsbas332 toEng 10e-3 -> 0.010 +dsbas333 toSci 10e-4 -> 0.0010 +dsbas334 toEng 10e-4 -> 0.0010 +dsbas335 toSci 10e-5 -> 0.00010 +dsbas336 toEng 10e-5 -> 0.00010 +dsbas337 toSci 10e-6 -> 0.000010 +dsbas338 toEng 10e-6 -> 0.000010 +dsbas339 toSci 10e-7 -> 0.0000010 +dsbas340 toEng 10e-7 -> 0.0000010 +dsbas341 toSci 10e-8 -> 1.0E-7 +dsbas342 toEng 10e-8 -> 100E-9 +dsbas343 toSci 10e-9 -> 1.0E-8 +dsbas344 toEng 10e-9 -> 10E-9 +dsbas345 toSci 10e-10 -> 1.0E-9 +dsbas346 toEng 10e-10 -> 1.0E-9 +dsbas347 toSci 10e-11 -> 1.0E-10 +dsbas348 toEng 10e-11 -> 100E-12 +dsbas349 toSci 10e-12 -> 1.0E-11 +dsbas350 toEng 10e-12 -> 10E-12 +dsbas351 toSci 10e-13 -> 1.0E-12 +dsbas352 toEng 10e-13 -> 1.0E-12 + +dsbas361 toSci 7E12 -> 7E+12 +dsbas362 toEng 7E12 -> 7E+12 +dsbas363 toSci 7E11 -> 7E+11 +dsbas364 toEng 7E11 -> 700E+9 +dsbas365 toSci 7E10 -> 7E+10 +dsbas366 toEng 7E10 -> 70E+9 +dsbas367 toSci 7E9 -> 7E+9 +dsbas368 toEng 7E9 -> 7E+9 +dsbas369 toSci 7E8 -> 7E+8 +dsbas370 toEng 7E8 -> 700E+6 +dsbas371 toSci 7E7 -> 7E+7 +dsbas372 toEng 7E7 -> 70E+6 +dsbas373 toSci 7E6 -> 7E+6 +dsbas374 toEng 7E6 -> 7E+6 +dsbas375 toSci 7E5 -> 7E+5 +dsbas376 toEng 7E5 -> 700E+3 +dsbas377 toSci 7E4 -> 7E+4 +dsbas378 toEng 7E4 -> 70E+3 +dsbas379 toSci 7E3 -> 7E+3 +dsbas380 toEng 7E3 -> 7E+3 +dsbas381 toSci 7E2 -> 7E+2 +dsbas382 toEng 7E2 -> 700 +dsbas383 toSci 7E1 -> 7E+1 +dsbas384 toEng 7E1 -> 70 +dsbas385 toSci 7E0 -> 7 +dsbas386 toEng 7E0 -> 7 +dsbas387 toSci 7E-1 -> 0.7 +dsbas388 toEng 7E-1 -> 0.7 +dsbas389 toSci 7E-2 -> 0.07 +dsbas390 toEng 7E-2 -> 0.07 +dsbas391 toSci 7E-3 -> 0.007 +dsbas392 toEng 7E-3 -> 0.007 +dsbas393 toSci 7E-4 -> 0.0007 +dsbas394 toEng 7E-4 -> 0.0007 +dsbas395 toSci 7E-5 -> 0.00007 +dsbas396 toEng 7E-5 -> 0.00007 +dsbas397 toSci 7E-6 -> 0.000007 +dsbas398 toEng 7E-6 -> 0.000007 +dsbas399 toSci 7E-7 -> 7E-7 +dsbas400 toEng 7E-7 -> 700E-9 +dsbas401 toSci 7E-8 -> 7E-8 +dsbas402 toEng 7E-8 -> 70E-9 +dsbas403 toSci 7E-9 -> 7E-9 +dsbas404 toEng 7E-9 -> 7E-9 +dsbas405 toSci 7E-10 -> 7E-10 +dsbas406 toEng 7E-10 -> 700E-12 +dsbas407 toSci 7E-11 -> 7E-11 +dsbas408 toEng 7E-11 -> 70E-12 +dsbas409 toSci 7E-12 -> 7E-12 +dsbas410 toEng 7E-12 -> 7E-12 +dsbas411 toSci 7E-13 -> 7E-13 +dsbas412 toEng 7E-13 -> 700E-15 + +-- Exacts remain exact up to precision .. +dsbas420 toSci 100 -> 100 +dsbas422 toSci 1000 -> 1000 +dsbas424 toSci 999.9 -> 999.9 +dsbas426 toSci 1000.0 -> 1000.0 +dsbas428 toSci 1000.1 -> 1000.1 +dsbas430 toSci 10000 -> 10000 +dsbas432 toSci 1000 -> 1000 +dsbas434 toSci 10000 -> 10000 +dsbas436 toSci 100000 -> 100000 +dsbas438 toSci 1000000 -> 1000000 +dsbas440 toSci 10000000 -> 1.000000E+7 Rounded +dsbas442 toSci 10000000 -> 1.000000E+7 Rounded +dsbas444 toSci 10000003 -> 1.000000E+7 Rounded Inexact +dsbas446 toSci 10000005 -> 1.000000E+7 Rounded Inexact +dsbas448 toSci 100000050 -> 1.000000E+8 Rounded Inexact +dsbas450 toSci 10000009 -> 1.000001E+7 Rounded Inexact +dsbas452 toSci 100000000 -> 1.000000E+8 Rounded +dsbas454 toSci 100000003 -> 1.000000E+8 Rounded Inexact +dsbas456 toSci 100000005 -> 1.000000E+8 Rounded Inexact +dsbas458 toSci 100000009 -> 1.000000E+8 Rounded Inexact +dsbas460 toSci 1000000000 -> 1.000000E+9 Rounded +dsbas462 toSci 1000000300 -> 1.000000E+9 Rounded Inexact +dsbas464 toSci 1000000500 -> 1.000000E+9 Rounded Inexact +dsbas466 toSci 1000000900 -> 1.000001E+9 Rounded Inexact +dsbas468 toSci 10000000000 -> 1.000000E+10 Rounded +dsbas470 toSci 10000003000 -> 1.000000E+10 Rounded Inexact +dsbas472 toSci 10000005000 -> 1.000000E+10 Rounded Inexact +dsbas474 toSci 10000009000 -> 1.000001E+10 Rounded Inexact + +-- check rounding modes heeded +rounding: ceiling +dsbsr401 toSci 1.1123450 -> 1.112345 Rounded +dsbsr402 toSci 1.11234549 -> 1.112346 Rounded Inexact +dsbsr403 toSci 1.11234550 -> 1.112346 Rounded Inexact +dsbsr404 toSci 1.11234551 -> 1.112346 Rounded Inexact +rounding: up +dsbsr405 toSci 1.1123450 -> 1.112345 Rounded +dsbsr406 toSci 1.11234549 -> 1.112346 Rounded Inexact +dsbsr407 toSci 1.11234550 -> 1.112346 Rounded Inexact +dsbsr408 toSci 1.11234551 -> 1.112346 Rounded Inexact +rounding: floor +dsbsr410 toSci 1.1123450 -> 1.112345 Rounded +dsbsr411 toSci 1.11234549 -> 1.112345 Rounded Inexact +dsbsr412 toSci 1.11234550 -> 1.112345 Rounded Inexact +dsbsr413 toSci 1.11234551 -> 1.112345 Rounded Inexact +rounding: half_down +dsbsr415 toSci 1.1123450 -> 1.112345 Rounded +dsbsr416 toSci 1.11234549 -> 1.112345 Rounded Inexact +dsbsr417 toSci 1.11234550 -> 1.112345 Rounded Inexact +dsbsr418 toSci 1.11234650 -> 1.112346 Rounded Inexact +dsbsr419 toSci 1.11234551 -> 1.112346 Rounded Inexact +rounding: half_even +dsbsr421 toSci 1.1123450 -> 1.112345 Rounded +dsbsr422 toSci 1.11234549 -> 1.112345 Rounded Inexact +dsbsr423 toSci 1.11234550 -> 1.112346 Rounded Inexact +dsbsr424 toSci 1.11234650 -> 1.112346 Rounded Inexact +dsbsr425 toSci 1.11234551 -> 1.112346 Rounded Inexact +rounding: down +dsbsr426 toSci 1.1123450 -> 1.112345 Rounded +dsbsr427 toSci 1.11234549 -> 1.112345 Rounded Inexact +dsbsr428 toSci 1.11234550 -> 1.112345 Rounded Inexact +dsbsr429 toSci 1.11234551 -> 1.112345 Rounded Inexact +rounding: half_up +dsbsr431 toSci 1.1123450 -> 1.112345 Rounded +dsbsr432 toSci 1.11234549 -> 1.112345 Rounded Inexact +dsbsr433 toSci 1.11234550 -> 1.112346 Rounded Inexact +dsbsr434 toSci 1.11234650 -> 1.112347 Rounded Inexact +dsbsr435 toSci 1.11234551 -> 1.112346 Rounded Inexact +-- negatives +rounding: ceiling +dsbsr501 toSci -1.1123450 -> -1.112345 Rounded +dsbsr502 toSci -1.11234549 -> -1.112345 Rounded Inexact +dsbsr503 toSci -1.11234550 -> -1.112345 Rounded Inexact +dsbsr504 toSci -1.11234551 -> -1.112345 Rounded Inexact +rounding: up +dsbsr505 toSci -1.1123450 -> -1.112345 Rounded +dsbsr506 toSci -1.11234549 -> -1.112346 Rounded Inexact +dsbsr507 toSci -1.11234550 -> -1.112346 Rounded Inexact +dsbsr508 toSci -1.11234551 -> -1.112346 Rounded Inexact +rounding: floor +dsbsr510 toSci -1.1123450 -> -1.112345 Rounded +dsbsr511 toSci -1.11234549 -> -1.112346 Rounded Inexact +dsbsr512 toSci -1.11234550 -> -1.112346 Rounded Inexact +dsbsr513 toSci -1.11234551 -> -1.112346 Rounded Inexact +rounding: half_down +dsbsr515 toSci -1.1123450 -> -1.112345 Rounded +dsbsr516 toSci -1.11234549 -> -1.112345 Rounded Inexact +dsbsr517 toSci -1.11234550 -> -1.112345 Rounded Inexact +dsbsr518 toSci -1.11234650 -> -1.112346 Rounded Inexact +dsbsr519 toSci -1.11234551 -> -1.112346 Rounded Inexact +rounding: half_even +dsbsr521 toSci -1.1123450 -> -1.112345 Rounded +dsbsr522 toSci -1.11234549 -> -1.112345 Rounded Inexact +dsbsr523 toSci -1.11234550 -> -1.112346 Rounded Inexact +dsbsr524 toSci -1.11234650 -> -1.112346 Rounded Inexact +dsbsr525 toSci -1.11234551 -> -1.112346 Rounded Inexact +rounding: down +dsbsr526 toSci -1.1123450 -> -1.112345 Rounded +dsbsr527 toSci -1.11234549 -> -1.112345 Rounded Inexact +dsbsr528 toSci -1.11234550 -> -1.112345 Rounded Inexact +dsbsr529 toSci -1.11234551 -> -1.112345 Rounded Inexact +rounding: half_up +dsbsr531 toSci -1.1123450 -> -1.112345 Rounded +dsbsr532 toSci -1.11234549 -> -1.112345 Rounded Inexact +dsbsr533 toSci -1.11234550 -> -1.112346 Rounded Inexact +dsbsr534 toSci -1.11234650 -> -1.112347 Rounded Inexact +dsbsr535 toSci -1.11234551 -> -1.112346 Rounded Inexact + +rounding: half_even + +-- The 'baddies' tests from DiagBigDecimal, plus some new ones +dsbas500 toSci '1..2' -> NaN Conversion_syntax +dsbas501 toSci '.' -> NaN Conversion_syntax +dsbas502 toSci '..' -> NaN Conversion_syntax +dsbas503 toSci '++1' -> NaN Conversion_syntax +dsbas504 toSci '--1' -> NaN Conversion_syntax +dsbas505 toSci '-+1' -> NaN Conversion_syntax +dsbas506 toSci '+-1' -> NaN Conversion_syntax +dsbas507 toSci '12e' -> NaN Conversion_syntax +dsbas508 toSci '12e++' -> NaN Conversion_syntax +dsbas509 toSci '12f4' -> NaN Conversion_syntax +dsbas510 toSci ' +1' -> NaN Conversion_syntax +dsbas511 toSci '+ 1' -> NaN Conversion_syntax +dsbas512 toSci '12 ' -> NaN Conversion_syntax +dsbas513 toSci ' + 1' -> NaN Conversion_syntax +dsbas514 toSci ' - 1 ' -> NaN Conversion_syntax +dsbas515 toSci 'x' -> NaN Conversion_syntax +dsbas516 toSci '-1-' -> NaN Conversion_syntax +dsbas517 toSci '12-' -> NaN Conversion_syntax +dsbas518 toSci '3+' -> NaN Conversion_syntax +dsbas519 toSci '' -> NaN Conversion_syntax +dsbas520 toSci '1e-' -> NaN Conversion_syntax +dsbas521 toSci '7e99999a' -> NaN Conversion_syntax +dsbas522 toSci '7e123567890x' -> NaN Conversion_syntax +dsbas523 toSci '7e12356789012x' -> NaN Conversion_syntax +dsbas524 toSci '' -> NaN Conversion_syntax +dsbas525 toSci 'e100' -> NaN Conversion_syntax +dsbas526 toSci '\u0e5a' -> NaN Conversion_syntax +dsbas527 toSci '\u0b65' -> NaN Conversion_syntax +dsbas528 toSci '123,65' -> NaN Conversion_syntax +dsbas529 toSci '1.34.5' -> NaN Conversion_syntax +dsbas530 toSci '.123.5' -> NaN Conversion_syntax +dsbas531 toSci '01.35.' -> NaN Conversion_syntax +dsbas532 toSci '01.35-' -> NaN Conversion_syntax +dsbas533 toSci '0000..' -> NaN Conversion_syntax +dsbas534 toSci '.0000.' -> NaN Conversion_syntax +dsbas535 toSci '00..00' -> NaN Conversion_syntax +dsbas536 toSci '111e*123' -> NaN Conversion_syntax +dsbas537 toSci '111e123-' -> NaN Conversion_syntax +dsbas538 toSci '111e+12+' -> NaN Conversion_syntax +dsbas539 toSci '111e1-3-' -> NaN Conversion_syntax +dsbas540 toSci '111e1*23' -> NaN Conversion_syntax +dsbas541 toSci '111e1e+3' -> NaN Conversion_syntax +dsbas542 toSci '1e1.0' -> NaN Conversion_syntax +dsbas543 toSci '1e123e' -> NaN Conversion_syntax +dsbas544 toSci 'ten' -> NaN Conversion_syntax +dsbas545 toSci 'ONE' -> NaN Conversion_syntax +dsbas546 toSci '1e.1' -> NaN Conversion_syntax +dsbas547 toSci '1e1.' -> NaN Conversion_syntax +dsbas548 toSci '1ee' -> NaN Conversion_syntax +dsbas549 toSci 'e+1' -> NaN Conversion_syntax +dsbas550 toSci '1.23.4' -> NaN Conversion_syntax +dsbas551 toSci '1.2.1' -> NaN Conversion_syntax +dsbas552 toSci '1E+1.2' -> NaN Conversion_syntax +dsbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax +dsbas554 toSci '1E++1' -> NaN Conversion_syntax +dsbas555 toSci '1E--1' -> NaN Conversion_syntax +dsbas556 toSci '1E+-1' -> NaN Conversion_syntax +dsbas557 toSci '1E-+1' -> NaN Conversion_syntax +dsbas558 toSci '1E''1' -> NaN Conversion_syntax +dsbas559 toSci "1E""1" -> NaN Conversion_syntax +dsbas560 toSci "1E""""" -> NaN Conversion_syntax +-- Near-specials +dsbas561 toSci "qNaN" -> NaN Conversion_syntax +dsbas562 toSci "NaNq" -> NaN Conversion_syntax +dsbas563 toSci "NaNs" -> NaN Conversion_syntax +dsbas564 toSci "Infi" -> NaN Conversion_syntax +dsbas565 toSci "Infin" -> NaN Conversion_syntax +dsbas566 toSci "Infini" -> NaN Conversion_syntax +dsbas567 toSci "Infinit" -> NaN Conversion_syntax +dsbas568 toSci "-Infinit" -> NaN Conversion_syntax +dsbas569 toSci "0Inf" -> NaN Conversion_syntax +dsbas570 toSci "9Inf" -> NaN Conversion_syntax +dsbas571 toSci "-0Inf" -> NaN Conversion_syntax +dsbas572 toSci "-9Inf" -> NaN Conversion_syntax +dsbas573 toSci "-sNa" -> NaN Conversion_syntax +dsbas574 toSci "xNaN" -> NaN Conversion_syntax +dsbas575 toSci "0sNaN" -> NaN Conversion_syntax + +-- some baddies with dots and Es and dots and specials +dsbas576 toSci 'e+1' -> NaN Conversion_syntax +dsbas577 toSci '.e+1' -> NaN Conversion_syntax +dsbas578 toSci '+.e+1' -> NaN Conversion_syntax +dsbas579 toSci '-.e+' -> NaN Conversion_syntax +dsbas580 toSci '-.e' -> NaN Conversion_syntax +dsbas581 toSci 'E+1' -> NaN Conversion_syntax +dsbas582 toSci '.E+1' -> NaN Conversion_syntax +dsbas583 toSci '+.E+1' -> NaN Conversion_syntax +dsbas584 toSci '-.E+' -> NaN Conversion_syntax +dsbas585 toSci '-.E' -> NaN Conversion_syntax + +dsbas586 toSci '.NaN' -> NaN Conversion_syntax +dsbas587 toSci '-.NaN' -> NaN Conversion_syntax +dsbas588 toSci '+.sNaN' -> NaN Conversion_syntax +dsbas589 toSci '+.Inf' -> NaN Conversion_syntax +dsbas590 toSci '.Infinity' -> NaN Conversion_syntax + +-- Zeros +dsbas601 toSci 0.000000000 -> 0E-9 +dsbas602 toSci 0.00000000 -> 0E-8 +dsbas603 toSci 0.0000000 -> 0E-7 +dsbas604 toSci 0.000000 -> 0.000000 +dsbas605 toSci 0.00000 -> 0.00000 +dsbas606 toSci 0.0000 -> 0.0000 +dsbas607 toSci 0.000 -> 0.000 +dsbas608 toSci 0.00 -> 0.00 +dsbas609 toSci 0.0 -> 0.0 +dsbas610 toSci .0 -> 0.0 +dsbas611 toSci 0. -> 0 +dsbas612 toSci -.0 -> -0.0 +dsbas613 toSci -0. -> -0 +dsbas614 toSci -0.0 -> -0.0 +dsbas615 toSci -0.00 -> -0.00 +dsbas616 toSci -0.000 -> -0.000 +dsbas617 toSci -0.0000 -> -0.0000 +dsbas618 toSci -0.00000 -> -0.00000 +dsbas619 toSci -0.000000 -> -0.000000 +dsbas620 toSci -0.0000000 -> -0E-7 +dsbas621 toSci -0.00000000 -> -0E-8 +dsbas622 toSci -0.000000000 -> -0E-9 + +dsbas630 toSci 0.00E+0 -> 0.00 +dsbas631 toSci 0.00E+1 -> 0.0 +dsbas632 toSci 0.00E+2 -> 0 +dsbas633 toSci 0.00E+3 -> 0E+1 +dsbas634 toSci 0.00E+4 -> 0E+2 +dsbas635 toSci 0.00E+5 -> 0E+3 +dsbas636 toSci 0.00E+6 -> 0E+4 +dsbas637 toSci 0.00E+7 -> 0E+5 +dsbas638 toSci 0.00E+8 -> 0E+6 +dsbas639 toSci 0.00E+9 -> 0E+7 + +dsbas640 toSci 0.0E+0 -> 0.0 +dsbas641 toSci 0.0E+1 -> 0 +dsbas642 toSci 0.0E+2 -> 0E+1 +dsbas643 toSci 0.0E+3 -> 0E+2 +dsbas644 toSci 0.0E+4 -> 0E+3 +dsbas645 toSci 0.0E+5 -> 0E+4 +dsbas646 toSci 0.0E+6 -> 0E+5 +dsbas647 toSci 0.0E+7 -> 0E+6 +dsbas648 toSci 0.0E+8 -> 0E+7 +dsbas649 toSci 0.0E+9 -> 0E+8 + +dsbas650 toSci 0E+0 -> 0 +dsbas651 toSci 0E+1 -> 0E+1 +dsbas652 toSci 0E+2 -> 0E+2 +dsbas653 toSci 0E+3 -> 0E+3 +dsbas654 toSci 0E+4 -> 0E+4 +dsbas655 toSci 0E+5 -> 0E+5 +dsbas656 toSci 0E+6 -> 0E+6 +dsbas657 toSci 0E+7 -> 0E+7 +dsbas658 toSci 0E+8 -> 0E+8 +dsbas659 toSci 0E+9 -> 0E+9 + +dsbas660 toSci 0.0E-0 -> 0.0 +dsbas661 toSci 0.0E-1 -> 0.00 +dsbas662 toSci 0.0E-2 -> 0.000 +dsbas663 toSci 0.0E-3 -> 0.0000 +dsbas664 toSci 0.0E-4 -> 0.00000 +dsbas665 toSci 0.0E-5 -> 0.000000 +dsbas666 toSci 0.0E-6 -> 0E-7 +dsbas667 toSci 0.0E-7 -> 0E-8 +dsbas668 toSci 0.0E-8 -> 0E-9 +dsbas669 toSci 0.0E-9 -> 0E-10 + +dsbas670 toSci 0.00E-0 -> 0.00 +dsbas671 toSci 0.00E-1 -> 0.000 +dsbas672 toSci 0.00E-2 -> 0.0000 +dsbas673 toSci 0.00E-3 -> 0.00000 +dsbas674 toSci 0.00E-4 -> 0.000000 +dsbas675 toSci 0.00E-5 -> 0E-7 +dsbas676 toSci 0.00E-6 -> 0E-8 +dsbas677 toSci 0.00E-7 -> 0E-9 +dsbas678 toSci 0.00E-8 -> 0E-10 +dsbas679 toSci 0.00E-9 -> 0E-11 + +dsbas680 toSci 000000. -> 0 +dsbas681 toSci 00000. -> 0 +dsbas682 toSci 0000. -> 0 +dsbas683 toSci 000. -> 0 +dsbas684 toSci 00. -> 0 +dsbas685 toSci 0. -> 0 +dsbas686 toSci +00000. -> 0 +dsbas687 toSci -00000. -> -0 +dsbas688 toSci +0. -> 0 +dsbas689 toSci -0. -> -0 + +-- Specials +dsbas700 toSci "NaN" -> NaN +dsbas701 toSci "nan" -> NaN +dsbas702 toSci "nAn" -> NaN +dsbas703 toSci "NAN" -> NaN +dsbas704 toSci "+NaN" -> NaN +dsbas705 toSci "+nan" -> NaN +dsbas706 toSci "+nAn" -> NaN +dsbas707 toSci "+NAN" -> NaN +dsbas708 toSci "-NaN" -> -NaN +dsbas709 toSci "-nan" -> -NaN +dsbas710 toSci "-nAn" -> -NaN +dsbas711 toSci "-NAN" -> -NaN +dsbas712 toSci 'NaN0' -> NaN +dsbas713 toSci 'NaN1' -> NaN1 +dsbas714 toSci 'NaN12' -> NaN12 +dsbas715 toSci 'NaN123' -> NaN123 +dsbas716 toSci 'NaN1234' -> NaN1234 +dsbas717 toSci 'NaN01' -> NaN1 +dsbas718 toSci 'NaN012' -> NaN12 +dsbas719 toSci 'NaN0123' -> NaN123 +dsbas720 toSci 'NaN01234' -> NaN1234 +dsbas721 toSci 'NaN001' -> NaN1 +dsbas722 toSci 'NaN0012' -> NaN12 +dsbas723 toSci 'NaN00123' -> NaN123 +dsbas724 toSci 'NaN001234' -> NaN1234 +dsbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax +dsbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax +dsbas727 toSci 'NaN12.45' -> NaN Conversion_syntax +dsbas728 toSci 'NaN-12' -> NaN Conversion_syntax +dsbas729 toSci 'NaN+12' -> NaN Conversion_syntax + +dsbas730 toSci "sNaN" -> sNaN +dsbas731 toSci "snan" -> sNaN +dsbas732 toSci "SnAn" -> sNaN +dsbas733 toSci "SNAN" -> sNaN +dsbas734 toSci "+sNaN" -> sNaN +dsbas735 toSci "+snan" -> sNaN +dsbas736 toSci "+SnAn" -> sNaN +dsbas737 toSci "+SNAN" -> sNaN +dsbas738 toSci "-sNaN" -> -sNaN +dsbas739 toSci "-snan" -> -sNaN +dsbas740 toSci "-SnAn" -> -sNaN +dsbas741 toSci "-SNAN" -> -sNaN +dsbas742 toSci 'sNaN0000' -> sNaN +dsbas743 toSci 'sNaN7' -> sNaN7 +dsbas744 toSci 'sNaN007234' -> sNaN7234 +dsbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax +dsbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax +dsbas747 toSci 'sNaN-72' -> NaN Conversion_syntax + +dsbas748 toSci "Inf" -> Infinity +dsbas749 toSci "inf" -> Infinity +dsbas750 toSci "iNf" -> Infinity +dsbas751 toSci "INF" -> Infinity +dsbas752 toSci "+Inf" -> Infinity +dsbas753 toSci "+inf" -> Infinity +dsbas754 toSci "+iNf" -> Infinity +dsbas755 toSci "+INF" -> Infinity +dsbas756 toSci "-Inf" -> -Infinity +dsbas757 toSci "-inf" -> -Infinity +dsbas758 toSci "-iNf" -> -Infinity +dsbas759 toSci "-INF" -> -Infinity + +dsbas760 toSci "Infinity" -> Infinity +dsbas761 toSci "infinity" -> Infinity +dsbas762 toSci "iNfInItY" -> Infinity +dsbas763 toSci "INFINITY" -> Infinity +dsbas764 toSci "+Infinity" -> Infinity +dsbas765 toSci "+infinity" -> Infinity +dsbas766 toSci "+iNfInItY" -> Infinity +dsbas767 toSci "+INFINITY" -> Infinity +dsbas768 toSci "-Infinity" -> -Infinity +dsbas769 toSci "-infinity" -> -Infinity +dsbas770 toSci "-iNfInItY" -> -Infinity +dsbas771 toSci "-INFINITY" -> -Infinity + +-- Specials and zeros for toEng +dsbast772 toEng "NaN" -> NaN +dsbast773 toEng "-Infinity" -> -Infinity +dsbast774 toEng "-sNaN" -> -sNaN +dsbast775 toEng "-NaN" -> -NaN +dsbast776 toEng "+Infinity" -> Infinity +dsbast778 toEng "+sNaN" -> sNaN +dsbast779 toEng "+NaN" -> NaN +dsbast780 toEng "INFINITY" -> Infinity +dsbast781 toEng "SNAN" -> sNaN +dsbast782 toEng "NAN" -> NaN +dsbast783 toEng "infinity" -> Infinity +dsbast784 toEng "snan" -> sNaN +dsbast785 toEng "nan" -> NaN +dsbast786 toEng "InFINITY" -> Infinity +dsbast787 toEng "SnAN" -> sNaN +dsbast788 toEng "nAN" -> NaN +dsbast789 toEng "iNfinity" -> Infinity +dsbast790 toEng "sNan" -> sNaN +dsbast791 toEng "Nan" -> NaN +dsbast792 toEng "Infinity" -> Infinity +dsbast793 toEng "sNaN" -> sNaN + +-- Zero toEng, etc. +dsbast800 toEng 0e+1 -> "0.00E+3" -- doc example + +dsbast801 toEng 0.000000000 -> 0E-9 +dsbast802 toEng 0.00000000 -> 0.00E-6 +dsbast803 toEng 0.0000000 -> 0.0E-6 +dsbast804 toEng 0.000000 -> 0.000000 +dsbast805 toEng 0.00000 -> 0.00000 +dsbast806 toEng 0.0000 -> 0.0000 +dsbast807 toEng 0.000 -> 0.000 +dsbast808 toEng 0.00 -> 0.00 +dsbast809 toEng 0.0 -> 0.0 +dsbast810 toEng .0 -> 0.0 +dsbast811 toEng 0. -> 0 +dsbast812 toEng -.0 -> -0.0 +dsbast813 toEng -0. -> -0 +dsbast814 toEng -0.0 -> -0.0 +dsbast815 toEng -0.00 -> -0.00 +dsbast816 toEng -0.000 -> -0.000 +dsbast817 toEng -0.0000 -> -0.0000 +dsbast818 toEng -0.00000 -> -0.00000 +dsbast819 toEng -0.000000 -> -0.000000 +dsbast820 toEng -0.0000000 -> -0.0E-6 +dsbast821 toEng -0.00000000 -> -0.00E-6 +dsbast822 toEng -0.000000000 -> -0E-9 + +dsbast830 toEng 0.00E+0 -> 0.00 +dsbast831 toEng 0.00E+1 -> 0.0 +dsbast832 toEng 0.00E+2 -> 0 +dsbast833 toEng 0.00E+3 -> 0.00E+3 +dsbast834 toEng 0.00E+4 -> 0.0E+3 +dsbast835 toEng 0.00E+5 -> 0E+3 +dsbast836 toEng 0.00E+6 -> 0.00E+6 +dsbast837 toEng 0.00E+7 -> 0.0E+6 +dsbast838 toEng 0.00E+8 -> 0E+6 +dsbast839 toEng 0.00E+9 -> 0.00E+9 + +dsbast840 toEng 0.0E+0 -> 0.0 +dsbast841 toEng 0.0E+1 -> 0 +dsbast842 toEng 0.0E+2 -> 0.00E+3 +dsbast843 toEng 0.0E+3 -> 0.0E+3 +dsbast844 toEng 0.0E+4 -> 0E+3 +dsbast845 toEng 0.0E+5 -> 0.00E+6 +dsbast846 toEng 0.0E+6 -> 0.0E+6 +dsbast847 toEng 0.0E+7 -> 0E+6 +dsbast848 toEng 0.0E+8 -> 0.00E+9 +dsbast849 toEng 0.0E+9 -> 0.0E+9 + +dsbast850 toEng 0E+0 -> 0 +dsbast851 toEng 0E+1 -> 0.00E+3 +dsbast852 toEng 0E+2 -> 0.0E+3 +dsbast853 toEng 0E+3 -> 0E+3 +dsbast854 toEng 0E+4 -> 0.00E+6 +dsbast855 toEng 0E+5 -> 0.0E+6 +dsbast856 toEng 0E+6 -> 0E+6 +dsbast857 toEng 0E+7 -> 0.00E+9 +dsbast858 toEng 0E+8 -> 0.0E+9 +dsbast859 toEng 0E+9 -> 0E+9 + +dsbast860 toEng 0.0E-0 -> 0.0 +dsbast861 toEng 0.0E-1 -> 0.00 +dsbast862 toEng 0.0E-2 -> 0.000 +dsbast863 toEng 0.0E-3 -> 0.0000 +dsbast864 toEng 0.0E-4 -> 0.00000 +dsbast865 toEng 0.0E-5 -> 0.000000 +dsbast866 toEng 0.0E-6 -> 0.0E-6 +dsbast867 toEng 0.0E-7 -> 0.00E-6 +dsbast868 toEng 0.0E-8 -> 0E-9 +dsbast869 toEng 0.0E-9 -> 0.0E-9 + +dsbast870 toEng 0.00E-0 -> 0.00 +dsbast871 toEng 0.00E-1 -> 0.000 +dsbast872 toEng 0.00E-2 -> 0.0000 +dsbast873 toEng 0.00E-3 -> 0.00000 +dsbast874 toEng 0.00E-4 -> 0.000000 +dsbast875 toEng 0.00E-5 -> 0.0E-6 +dsbast876 toEng 0.00E-6 -> 0.00E-6 +dsbast877 toEng 0.00E-7 -> 0E-9 +dsbast878 toEng 0.00E-8 -> 0.0E-9 +dsbast879 toEng 0.00E-9 -> 0.00E-9 + +-- long input strings +dsbas801 tosci '01234567' -> 1234567 +dsbas802 tosci '001234567' -> 1234567 +dsbas803 tosci '0001234567' -> 1234567 +dsbas804 tosci '00001234567' -> 1234567 +dsbas805 tosci '000001234567' -> 1234567 +dsbas806 tosci '0000001234567' -> 1234567 +dsbas807 tosci '00000001234567' -> 1234567 +dsbas808 tosci '000000001234567' -> 1234567 +dsbas809 tosci '0000000001234567' -> 1234567 +dsbas810 tosci '00000000001234567' -> 1234567 + +dsbas811 tosci '0.1234567' -> 0.1234567 +dsbas812 tosci '0.01234567' -> 0.01234567 +dsbas813 tosci '0.001234567' -> 0.001234567 +dsbas814 tosci '0.0001234567' -> 0.0001234567 +dsbas815 tosci '0.00001234567' -> 0.00001234567 +dsbas816 tosci '0.000001234567' -> 0.000001234567 +dsbas817 tosci '0.0000001234567' -> 1.234567E-7 +dsbas818 tosci '0.00000001234567' -> 1.234567E-8 +dsbas819 tosci '0.000000001234567' -> 1.234567E-9 +dsbas820 tosci '0.0000000001234567' -> 1.234567E-10 + +dsbas821 tosci '123456790' -> 1.234568E+8 Inexact Rounded +dsbas822 tosci '1234567901' -> 1.234568E+9 Inexact Rounded +dsbas823 tosci '12345679012' -> 1.234568E+10 Inexact Rounded +dsbas824 tosci '123456790123' -> 1.234568E+11 Inexact Rounded +dsbas825 tosci '1234567901234' -> 1.234568E+12 Inexact Rounded +dsbas826 tosci '12345679012345' -> 1.234568E+13 Inexact Rounded +dsbas827 tosci '123456790123456' -> 1.234568E+14 Inexact Rounded +dsbas828 tosci '1234567901234567' -> 1.234568E+15 Inexact Rounded +dsbas829 tosci '1234567890123456' -> 1.234568E+15 Inexact Rounded + +-- subnormals and overflows +dsbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded +dsbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded +dsbas908 toSci '0.9e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas909 toSci '0.09e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded +dsbas911 toSci '10e-1000000000' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded +dsbas913 toSci '99e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded +dsbas915 toSci '1111e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas916 toSci '1111e-99999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +-- negatives the same +dsbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded +dsbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded +dsbas920 toSci '-0.9e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas921 toSci '-0.09e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded +dsbas923 toSci '-10e-1000000000' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded +dsbas925 toSci '-99e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded +dsbas927 toSci '-1111e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas928 toSci '-1111e-99999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +-- overflow results at different rounding modes +rounding: ceiling +dsbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dsbas931 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded +rounding: up +dsbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dsbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: down +dsbas934 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded +dsbas935 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded +rounding: floor +dsbas936 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded +dsbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded + +rounding: half_up +dsbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dsbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: half_even +dsbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dsbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded +rounding: half_down +dsbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded +dsbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded + +rounding: half_even + +-- Now check 854/754r some subnormals and underflow to 0 +dsbem400 toSci 1.0000E-86 -> 1.0000E-86 +dsbem401 toSci 0.1E-97 -> 1E-98 Subnormal +dsbem402 toSci 0.1000E-97 -> 1.000E-98 Subnormal +dsbem403 toSci 0.0100E-97 -> 1.00E-99 Subnormal +dsbem404 toSci 0.0010E-97 -> 1.0E-100 Subnormal +dsbem405 toSci 0.0001E-97 -> 1E-101 Subnormal +dsbem406 toSci 0.00010E-97 -> 1E-101 Subnormal Rounded +dsbem407 toSci 0.00013E-97 -> 1E-101 Underflow Subnormal Inexact Rounded +dsbem408 toSci 0.00015E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem409 toSci 0.00017E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem410 toSci 0.00023E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem411 toSci 0.00025E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem412 toSci 0.00027E-97 -> 3E-101 Underflow Subnormal Inexact Rounded +dsbem413 toSci 0.000149E-97 -> 1E-101 Underflow Subnormal Inexact Rounded +dsbem414 toSci 0.000150E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem415 toSci 0.000151E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem416 toSci 0.000249E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem417 toSci 0.000250E-97 -> 2E-101 Underflow Subnormal Inexact Rounded +dsbem418 toSci 0.000251E-97 -> 3E-101 Underflow Subnormal Inexact Rounded +dsbem419 toSci 0.00009E-97 -> 1E-101 Underflow Subnormal Inexact Rounded +dsbem420 toSci 0.00005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbem421 toSci 0.00003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbem422 toSci 0.000009E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbem423 toSci 0.000005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbem424 toSci 0.000003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped + +dsbem425 toSci 0.001049E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded +dsbem426 toSci 0.001050E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded +dsbem427 toSci 0.001051E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded +dsbem428 toSci 0.001149E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded +dsbem429 toSci 0.001150E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded +dsbem430 toSci 0.001151E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded + +dsbem432 toSci 0.010049E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded +dsbem433 toSci 0.010050E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded +dsbem434 toSci 0.010051E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded +dsbem435 toSci 0.010149E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded +dsbem436 toSci 0.010150E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded +dsbem437 toSci 0.010151E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded + +dsbem440 toSci 0.10103E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded +dsbem441 toSci 0.10105E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded +dsbem442 toSci 0.10107E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded +dsbem443 toSci 0.10113E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded +dsbem444 toSci 0.10115E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded +dsbem445 toSci 0.10117E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded + +dsbem450 toSci 1.10730E-98 -> 1.107E-98 Underflow Subnormal Inexact Rounded +dsbem451 toSci 1.10750E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded +dsbem452 toSci 1.10770E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded +dsbem453 toSci 1.10830E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded +dsbem454 toSci 1.10850E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded +dsbem455 toSci 1.10870E-98 -> 1.109E-98 Underflow Subnormal Inexact Rounded + +-- make sure sign OK +dsbem456 toSci -0.10103E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded +dsbem457 toSci -0.10105E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded +dsbem458 toSci -0.10107E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded +dsbem459 toSci -0.10113E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded +dsbem460 toSci -0.10115E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded +dsbem461 toSci -0.10117E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded + +-- '999s' cases +dsbem464 toSci 999999E-98 -> 9.99999E-93 +dsbem465 toSci 99999.0E-97 -> 9.99990E-93 +dsbem466 toSci 99999.E-97 -> 9.9999E-93 +dsbem467 toSci 9999.9E-97 -> 9.9999E-94 +dsbem468 toSci 999.99E-97 -> 9.9999E-95 +dsbem469 toSci 99.999E-97 -> 9.9999E-96 Subnormal +dsbem470 toSci 9.9999E-97 -> 9.9999E-97 Subnormal +dsbem471 toSci 0.99999E-97 -> 1.0000E-97 Underflow Subnormal Inexact Rounded +dsbem472 toSci 0.099999E-97 -> 1.000E-98 Underflow Subnormal Inexact Rounded +dsbem473 toSci 0.0099999E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded +dsbem474 toSci 0.00099999E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded +dsbem475 toSci 0.000099999E-97 -> 1E-101 Underflow Subnormal Inexact Rounded +dsbem476 toSci 0.0000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbem477 toSci 0.00000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbem478 toSci 0.000000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped + +-- Exponents with insignificant leading zeros +dsbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded +dsbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded +dsbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded +dsbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded +dsbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded +dsbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded +dsbas1007 toSci 1e-999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas1008 toSci 1e-0999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas1009 toSci 1e-00999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas1010 toSci 1e-000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas1011 toSci 1e-000000000000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +dsbas1012 toSci 1e-000000000001000000007 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped + +-- check for double-rounded subnormals +dsbas1041 toSci 1.1152444E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow +dsbas1042 toSci 1.1152445E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow +dsbas1043 toSci 1.1152446E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow + +-- clamped zeros [see also clamp.decTest] +dsbas1075 toSci 0e+10000 -> 0E+90 Clamped +dsbas1076 toSci 0e-10000 -> 0E-101 Clamped +dsbas1077 toSci -0e+10000 -> -0E+90 Clamped +dsbas1078 toSci -0e-10000 -> -0E-101 Clamped + +-- extreme values from next-wider +dsbas1101 toSci -9.999999999999999E+384 -> -Infinity Overflow Inexact Rounded +dsbas1102 toSci -1E-383 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped +dsbas1103 toSci -1E-398 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped +dsbas1104 toSci -0 -> -0 +dsbas1105 toSci +0 -> 0 +dsbas1106 toSci +1E-398 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped +dsbas1107 toSci +1E-383 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped +dsbas1108 toSci +9.999999999999999E+384 -> Infinity Overflow Inexact Rounded + +-- narrowing case +dsbas1110 toSci 2.000000000000000E-99 -> 2.00E-99 Rounded Subnormal Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dsEncode.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/dsEncode.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,372 @@ +------------------------------------------------------------------------ +-- dsEncode.decTest -- decimal four-byte format testcases -- +-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +-- [Previously called decimal32.decTest] +version: 2.58 + +-- This set of tests is for the four-byte concrete representation. +-- Its characteristics are: +-- +-- 1 bit sign +-- 5 bits combination field +-- 6 bits exponent continuation +-- 20 bits coefficient continuation +-- +-- Total exponent length 8 bits +-- Total coefficient length 24 bits (7 digits) +-- +-- Elimit = 191 (maximum encoded exponent) +-- Emax = 96 (largest exponent value) +-- Emin = -95 (smallest exponent value) +-- bias = 101 (subtracted from encoded exponent) = -Etiny + +-- The testcases here have only exactly representable data on the +-- 'left-hand-side'; rounding from strings is tested in 'base' +-- testcase groups. + +extended: 1 +clamp: 1 +precision: 7 +rounding: half_up +maxExponent: 96 +minExponent: -95 + +-- General testcases +-- (mostly derived from the Strawman 4 document and examples) +decs001 apply #A23003D0 -> -7.50 +decs002 apply -7.50 -> #A23003D0 +-- derivative canonical plain strings +decs003 apply #A26003D0 -> -7.50E+3 +decs004 apply -7.50E+3 -> #A26003D0 +decs005 apply #A25003D0 -> -750 +decs006 apply -750 -> #A25003D0 +decs007 apply #A24003D0 -> -75.0 +decs008 apply -75.0 -> #A24003D0 +decs009 apply #A22003D0 -> -0.750 +decs010 apply -0.750 -> #A22003D0 +decs011 apply #A21003D0 -> -0.0750 +decs012 apply -0.0750 -> #A21003D0 +decs013 apply #A1f003D0 -> -0.000750 +decs014 apply -0.000750 -> #A1f003D0 +decs015 apply #A1d003D0 -> -0.00000750 +decs016 apply -0.00000750 -> #A1d003D0 +decs017 apply #A1c003D0 -> -7.50E-7 +decs018 apply -7.50E-7 -> #A1c003D0 + +-- Normality +decs020 apply 1234567 -> #2654d2e7 +decs021 apply -1234567 -> #a654d2e7 +decs022 apply 1111111 -> #26524491 + +-- Nmax and similar +decs031 apply 9.999999E+96 -> #77f3fcff +decs032 apply #77f3fcff -> 9.999999E+96 +decs033 apply 1.234567E+96 -> #47f4d2e7 +decs034 apply #47f4d2e7 -> 1.234567E+96 +-- fold-downs (more below) +decs035 apply 1.23E+96 -> #47f4c000 Clamped +decs036 apply #47f4c000 -> 1.230000E+96 +decs037 apply 1E+96 -> #47f00000 Clamped +decs038 apply #47f00000 -> 1.000000E+96 + +decs051 apply 12345 -> #225049c5 +decs052 apply #225049c5 -> 12345 +decs053 apply 1234 -> #22500534 +decs054 apply #22500534 -> 1234 +decs055 apply 123 -> #225000a3 +decs056 apply #225000a3 -> 123 +decs057 apply 12 -> #22500012 +decs058 apply #22500012 -> 12 +decs059 apply 1 -> #22500001 +decs060 apply #22500001 -> 1 +decs061 apply 1.23 -> #223000a3 +decs062 apply #223000a3 -> 1.23 +decs063 apply 123.45 -> #223049c5 +decs064 apply #223049c5 -> 123.45 + +-- Nmin and below +decs071 apply 1E-95 -> #00600001 +decs072 apply #00600001 -> 1E-95 +decs073 apply 1.000000E-95 -> #04000000 +decs074 apply #04000000 -> 1.000000E-95 +decs075 apply 1.000001E-95 -> #04000001 +decs076 apply #04000001 -> 1.000001E-95 + +decs077 apply 0.100000E-95 -> #00020000 Subnormal +decs07x apply 1.00000E-96 -> 1.00000E-96 Subnormal +decs078 apply #00020000 -> 1.00000E-96 Subnormal +decs079 apply 0.000010E-95 -> #00000010 Subnormal +decs080 apply #00000010 -> 1.0E-100 Subnormal +decs081 apply 0.000001E-95 -> #00000001 Subnormal +decs082 apply #00000001 -> 1E-101 Subnormal +decs083 apply 1e-101 -> #00000001 Subnormal +decs084 apply #00000001 -> 1E-101 Subnormal +decs08x apply 1e-101 -> 1E-101 Subnormal + +-- underflows cannot be tested; just check edge case +decs090 apply 1e-101 -> #00000001 Subnormal + +-- same again, negatives -- + +-- Nmax and similar +decs122 apply -9.999999E+96 -> #f7f3fcff +decs123 apply #f7f3fcff -> -9.999999E+96 +decs124 apply -1.234567E+96 -> #c7f4d2e7 +decs125 apply #c7f4d2e7 -> -1.234567E+96 +-- fold-downs (more below) +decs130 apply -1.23E+96 -> #c7f4c000 Clamped +decs131 apply #c7f4c000 -> -1.230000E+96 +decs132 apply -1E+96 -> #c7f00000 Clamped +decs133 apply #c7f00000 -> -1.000000E+96 + +decs151 apply -12345 -> #a25049c5 +decs152 apply #a25049c5 -> -12345 +decs153 apply -1234 -> #a2500534 +decs154 apply #a2500534 -> -1234 +decs155 apply -123 -> #a25000a3 +decs156 apply #a25000a3 -> -123 +decs157 apply -12 -> #a2500012 +decs158 apply #a2500012 -> -12 +decs159 apply -1 -> #a2500001 +decs160 apply #a2500001 -> -1 +decs161 apply -1.23 -> #a23000a3 +decs162 apply #a23000a3 -> -1.23 +decs163 apply -123.45 -> #a23049c5 +decs164 apply #a23049c5 -> -123.45 + +-- Nmin and below +decs171 apply -1E-95 -> #80600001 +decs172 apply #80600001 -> -1E-95 +decs173 apply -1.000000E-95 -> #84000000 +decs174 apply #84000000 -> -1.000000E-95 +decs175 apply -1.000001E-95 -> #84000001 +decs176 apply #84000001 -> -1.000001E-95 + +decs177 apply -0.100000E-95 -> #80020000 Subnormal +decs178 apply #80020000 -> -1.00000E-96 Subnormal +decs179 apply -0.000010E-95 -> #80000010 Subnormal +decs180 apply #80000010 -> -1.0E-100 Subnormal +decs181 apply -0.000001E-95 -> #80000001 Subnormal +decs182 apply #80000001 -> -1E-101 Subnormal +decs183 apply -1e-101 -> #80000001 Subnormal +decs184 apply #80000001 -> -1E-101 Subnormal + +-- underflow edge case +decs190 apply -1e-101 -> #80000001 Subnormal + +-- zeros +decs400 apply 0E-400 -> #00000000 Clamped +decs401 apply 0E-101 -> #00000000 +decs402 apply #00000000 -> 0E-101 +decs403 apply 0.000000E-95 -> #00000000 +decs404 apply #00000000 -> 0E-101 +decs405 apply 0E-2 -> #22300000 +decs406 apply #22300000 -> 0.00 +decs407 apply 0 -> #22500000 +decs408 apply #22500000 -> 0 +decs409 apply 0E+3 -> #22800000 +decs410 apply #22800000 -> 0E+3 +decs411 apply 0E+90 -> #43f00000 +decs412 apply #43f00000 -> 0E+90 +-- clamped zeros... +decs413 apply 0E+91 -> #43f00000 Clamped +decs414 apply #43f00000 -> 0E+90 +decs415 apply 0E+96 -> #43f00000 Clamped +decs416 apply #43f00000 -> 0E+90 +decs417 apply 0E+400 -> #43f00000 Clamped +decs418 apply #43f00000 -> 0E+90 + +-- negative zeros +decs420 apply -0E-400 -> #80000000 Clamped +decs421 apply -0E-101 -> #80000000 +decs422 apply #80000000 -> -0E-101 +decs423 apply -0.000000E-95 -> #80000000 +decs424 apply #80000000 -> -0E-101 +decs425 apply -0E-2 -> #a2300000 +decs426 apply #a2300000 -> -0.00 +decs427 apply -0 -> #a2500000 +decs428 apply #a2500000 -> -0 +decs429 apply -0E+3 -> #a2800000 +decs430 apply #a2800000 -> -0E+3 +decs431 apply -0E+90 -> #c3f00000 +decs432 apply #c3f00000 -> -0E+90 +-- clamped zeros... +decs433 apply -0E+91 -> #c3f00000 Clamped +decs434 apply #c3f00000 -> -0E+90 +decs435 apply -0E+96 -> #c3f00000 Clamped +decs436 apply #c3f00000 -> -0E+90 +decs437 apply -0E+400 -> #c3f00000 Clamped +decs438 apply #c3f00000 -> -0E+90 + +-- Specials +decs500 apply Infinity -> #78000000 +decs501 apply #78787878 -> #78000000 +decs502 apply #78000000 -> Infinity +decs503 apply #79797979 -> #78000000 +decs504 apply #79000000 -> Infinity +decs505 apply #7a7a7a7a -> #78000000 +decs506 apply #7a000000 -> Infinity +decs507 apply #7b7b7b7b -> #78000000 +decs508 apply #7b000000 -> Infinity +decs509 apply #7c7c7c7c -> #7c0c7c7c + +decs510 apply NaN -> #7c000000 +decs511 apply #7c000000 -> NaN +decs512 apply #7d7d7d7d -> #7c0d7d7d +decs513 apply #7d000000 -> NaN +decs514 apply #7e7e7e7e -> #7e0e7c7e +decs515 apply #7e000000 -> sNaN +decs516 apply #7f7f7f7f -> #7e0f7c7f +decs517 apply #7f000000 -> sNaN +decs518 apply #7fffffff -> sNaN999999 +decs519 apply #7fffffff -> #7e03fcff + +decs520 apply -Infinity -> #f8000000 +decs521 apply #f8787878 -> #f8000000 +decs522 apply #f8000000 -> -Infinity +decs523 apply #f9797979 -> #f8000000 +decs524 apply #f9000000 -> -Infinity +decs525 apply #fa7a7a7a -> #f8000000 +decs526 apply #fa000000 -> -Infinity +decs527 apply #fb7b7b7b -> #f8000000 +decs528 apply #fb000000 -> -Infinity + +decs529 apply -NaN -> #fc000000 +decs530 apply #fc7c7c7c -> #fc0c7c7c +decs531 apply #fc000000 -> -NaN +decs532 apply #fd7d7d7d -> #fc0d7d7d +decs533 apply #fd000000 -> -NaN +decs534 apply #fe7e7e7e -> #fe0e7c7e +decs535 apply #fe000000 -> -sNaN +decs536 apply #ff7f7f7f -> #fe0f7c7f +decs537 apply #ff000000 -> -sNaN +decs538 apply #ffffffff -> -sNaN999999 +decs539 apply #ffffffff -> #fe03fcff + +-- diagnostic NaNs +decs540 apply NaN -> #7c000000 +decs541 apply NaN0 -> #7c000000 +decs542 apply NaN1 -> #7c000001 +decs543 apply NaN12 -> #7c000012 +decs544 apply NaN79 -> #7c000079 +decs545 apply NaN12345 -> #7c0049c5 +decs546 apply NaN123456 -> #7c028e56 +decs547 apply NaN799799 -> #7c0f7fdf +decs548 apply NaN999999 -> #7c03fcff + + +-- fold-down full sequence +decs601 apply 1E+96 -> #47f00000 Clamped +decs602 apply #47f00000 -> 1.000000E+96 +decs603 apply 1E+95 -> #43f20000 Clamped +decs604 apply #43f20000 -> 1.00000E+95 +decs605 apply 1E+94 -> #43f04000 Clamped +decs606 apply #43f04000 -> 1.0000E+94 +decs607 apply 1E+93 -> #43f00400 Clamped +decs608 apply #43f00400 -> 1.000E+93 +decs609 apply 1E+92 -> #43f00080 Clamped +decs610 apply #43f00080 -> 1.00E+92 +decs611 apply 1E+91 -> #43f00010 Clamped +decs612 apply #43f00010 -> 1.0E+91 +decs613 apply 1E+90 -> #43f00001 +decs614 apply #43f00001 -> 1E+90 + + +-- Selected DPD codes +decs700 apply #22500000 -> 0 +decs701 apply #22500009 -> 9 +decs702 apply #22500010 -> 10 +decs703 apply #22500019 -> 19 +decs704 apply #22500020 -> 20 +decs705 apply #22500029 -> 29 +decs706 apply #22500030 -> 30 +decs707 apply #22500039 -> 39 +decs708 apply #22500040 -> 40 +decs709 apply #22500049 -> 49 +decs710 apply #22500050 -> 50 +decs711 apply #22500059 -> 59 +decs712 apply #22500060 -> 60 +decs713 apply #22500069 -> 69 +decs714 apply #22500070 -> 70 +decs715 apply #22500071 -> 71 +decs716 apply #22500072 -> 72 +decs717 apply #22500073 -> 73 +decs718 apply #22500074 -> 74 +decs719 apply #22500075 -> 75 +decs720 apply #22500076 -> 76 +decs721 apply #22500077 -> 77 +decs722 apply #22500078 -> 78 +decs723 apply #22500079 -> 79 + +decs730 apply #2250029e -> 994 +decs731 apply #2250029f -> 995 +decs732 apply #225002a0 -> 520 +decs733 apply #225002a1 -> 521 + +-- DPD: one of each of the huffman groups +decs740 apply #225003f7 -> 777 +decs741 apply #225003f8 -> 778 +decs742 apply #225003eb -> 787 +decs743 apply #2250037d -> 877 +decs744 apply #2250039f -> 997 +decs745 apply #225003bf -> 979 +decs746 apply #225003df -> 799 +decs747 apply #2250006e -> 888 + + +-- DPD all-highs cases (includes the 24 redundant codes) +decs750 apply #2250006e -> 888 +decs751 apply #2250016e -> 888 +decs752 apply #2250026e -> 888 +decs753 apply #2250036e -> 888 +decs754 apply #2250006f -> 889 +decs755 apply #2250016f -> 889 +decs756 apply #2250026f -> 889 +decs757 apply #2250036f -> 889 + +decs760 apply #2250007e -> 898 +decs761 apply #2250017e -> 898 +decs762 apply #2250027e -> 898 +decs763 apply #2250037e -> 898 +decs764 apply #2250007f -> 899 +decs765 apply #2250017f -> 899 +decs766 apply #2250027f -> 899 +decs767 apply #2250037f -> 899 + +decs770 apply #225000ee -> 988 +decs771 apply #225001ee -> 988 +decs772 apply #225002ee -> 988 +decs773 apply #225003ee -> 988 +decs774 apply #225000ef -> 989 +decs775 apply #225001ef -> 989 +decs776 apply #225002ef -> 989 +decs777 apply #225003ef -> 989 + +decs780 apply #225000fe -> 998 +decs781 apply #225001fe -> 998 +decs782 apply #225002fe -> 998 +decs783 apply #225003fe -> 998 +decs784 apply #225000ff -> 999 +decs785 apply #225001ff -> 999 +decs786 apply #225002ff -> 999 +decs787 apply #225003ff -> 999 + +-- narrowing case +decs790 apply 2.00E-99 -> #00000100 Subnormal +decs791 apply #00000100 -> 2.00E-99 Subnormal Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/exp.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/exp.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,674 @@ +------------------------------------------------------------------------ +-- exp.decTest -- decimal natural exponentiation -- +-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Tests of the exponential funtion. Currently all testcases here +-- show results which are correctly rounded (within <= 0.5 ulp). + +extended: 1 +precision: 9 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- basics (examples in specificiation, etc.) +expx001 exp -Infinity -> 0 +expx002 exp -10 -> 0.0000453999298 Inexact Rounded +expx003 exp -1 -> 0.367879441 Inexact Rounded +expx004 exp 0 -> 1 +expx005 exp -0 -> 1 +expx006 exp 1 -> 2.71828183 Inexact Rounded +expx007 exp 0.693147181 -> 2.00000000 Inexact Rounded +expx008 exp 10 -> 22026.4658 Inexact Rounded +expx009 exp +Infinity -> Infinity + +-- tiny edge cases +precision: 7 +expx011 exp 0.1 -> 1.105171 Inexact Rounded +expx012 exp 0.01 -> 1.010050 Inexact Rounded +expx013 exp 0.001 -> 1.001001 Inexact Rounded +expx014 exp 0.0001 -> 1.000100 Inexact Rounded +expx015 exp 0.00001 -> 1.000010 Inexact Rounded +expx016 exp 0.000001 -> 1.000001 Inexact Rounded +expx017 exp 0.0000001 -> 1.000000 Inexact Rounded +expx018 exp 0.0000003 -> 1.000000 Inexact Rounded +expx019 exp 0.0000004 -> 1.000000 Inexact Rounded +expx020 exp 0.0000005 -> 1.000001 Inexact Rounded +expx021 exp 0.0000008 -> 1.000001 Inexact Rounded +expx022 exp 0.0000009 -> 1.000001 Inexact Rounded +expx023 exp 0.0000010 -> 1.000001 Inexact Rounded +expx024 exp 0.0000011 -> 1.000001 Inexact Rounded +expx025 exp 0.00000009 -> 1.000000 Inexact Rounded +expx026 exp 0.00000005 -> 1.000000 Inexact Rounded +expx027 exp 0.00000004 -> 1.000000 Inexact Rounded +expx028 exp 0.00000001 -> 1.000000 Inexact Rounded + +-- and some more zeros +expx030 exp 0.00000000 -> 1 +expx031 exp 0E+100 -> 1 +expx032 exp 0E-100 -> 1 +expx033 exp -0.00000000 -> 1 +expx034 exp -0E+100 -> 1 +expx035 exp -0E-100 -> 1 + +-- basic e=0, e=1, e=2, e=4, e>=8 cases +precision: 7 +expx041 exp 1 -> 2.718282 Inexact Rounded +expx042 exp -1 -> 0.3678794 Inexact Rounded +expx043 exp 10 -> 22026.47 Inexact Rounded +expx044 exp -10 -> 0.00004539993 Inexact Rounded +expx045 exp 100 -> 2.688117E+43 Inexact Rounded +expx046 exp -100 -> 3.720076E-44 Inexact Rounded +expx047 exp 1000 -> Infinity Overflow Inexact Rounded +expx048 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx049 exp 100000000 -> Infinity Overflow Inexact Rounded +expx050 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal + +-- miscellanea +-- similar to 'VF bug' test, at 17, but with last digit corrected for decimal +precision: 16 +expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded +-- result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236 +-- result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236 +precision: 17 +expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded +precision: 18 +expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded +precision: 19 +expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded +precision: 20 +expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded + +-- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences +precision: 50 +expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded +precision: 31 +expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded +precision: 30 +expx103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded +precision: 29 +expx104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded +precision: 28 +expx105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded +precision: 27 +expx106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded +precision: 26 +expx107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded +precision: 25 +expx108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded +precision: 24 +expx109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded +precision: 23 +expx110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded +precision: 22 +expx111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded +precision: 21 +expx112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded +precision: 20 +expx113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded +precision: 19 +expx114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded +precision: 18 +expx115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded +precision: 17 +expx116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded +precision: 16 +expx117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded +precision: 15 +expx118 exp -9E-8 -> 0.999999910000004 Inexact Rounded +precision: 14 +expx119 exp -9E-8 -> 0.99999991000000 Inexact Rounded +precision: 13 +expx120 exp -9E-8 -> 0.9999999100000 Inexact Rounded +precision: 12 +expx121 exp -9E-8 -> 0.999999910000 Inexact Rounded +precision: 11 +expx122 exp -9E-8 -> 0.99999991000 Inexact Rounded +precision: 10 +expx123 exp -9E-8 -> 0.9999999100 Inexact Rounded +precision: 9 +expx124 exp -9E-8 -> 0.999999910 Inexact Rounded +precision: 8 +expx125 exp -9E-8 -> 0.99999991 Inexact Rounded +precision: 7 +expx126 exp -9E-8 -> 0.9999999 Inexact Rounded +precision: 6 +expx127 exp -9E-8 -> 1.00000 Inexact Rounded +precision: 5 +expx128 exp -9E-8 -> 1.0000 Inexact Rounded +precision: 4 +expx129 exp -9E-8 -> 1.000 Inexact Rounded +precision: 3 +expx130 exp -9E-8 -> 1.00 Inexact Rounded +precision: 2 +expx131 exp -9E-8 -> 1.0 Inexact Rounded +precision: 1 +expx132 exp -9E-8 -> 1 Inexact Rounded + + +-- sanity checks, with iteration counts [normalized so 0<=|x|<1] +precision: 50 + +expx210 exp 0 -> 1 +-- iterations: 2 +expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded +-- iterations: 8 +expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded +-- iterations: 6 +expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded +-- iterations: 15 +expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded +-- iterations: 14 +expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded +-- iterations: 26 +expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded +-- iterations: 39 +expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded +-- iterations: 41 +expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded +-- iterations: 43 +expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded +-- iterations: 26 +expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded +-- iterations: 26 +expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded +-- iterations: 27 +expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded +-- iterations: 28 +expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded +-- iterations: 30 +expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded +-- iterations: 36 +expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded +-- iterations: 26 +expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded +-- iterations: 28 +expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded +-- iterations: 29 +expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded +-- iterations: 30 +expx233 exp 0 -> 1 +-- iterations: 2 +expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded +-- iterations: 7 +expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded +-- iterations: 6 +expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded +-- iterations: 15 +expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded +-- iterations: 13 +expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded +-- iterations: 25 +expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded +-- iterations: 38 +expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded +-- iterations: 41 +expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded +-- iterations: 42 +expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded +-- iterations: 26 +expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded +-- iterations: 26 +expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded +-- iterations: 26 +expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded +-- iterations: 28 +expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded +-- iterations: 29 +expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded +-- iterations: 36 +expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded +-- iterations: 26 +expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded +-- iterations: 28 +expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded +-- iterations: 28 +expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded +-- iterations: 29 + +-- a biggie [result verified 3 ways] +precision: 250 +expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded + +-- extreme range boundaries +precision: 16 +maxExponent: 999999 +minExponent: -999999 +-- Ntiny boundary +expx290 exp -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped +expx291 exp -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded +-- Nmax/10 and Nmax boundary +expx292 exp 2302582.790408952 -> 9.999999993100277E+999998 Inexact Rounded +expx293 exp 2302582.790408953 -> 1.000000000310028E+999999 Inexact Rounded +expx294 exp 2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded +expx295 exp 2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded +expx296 exp 2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded +expx297 exp 2302585.092994046 -> Infinity Overflow Inexact Rounded + +-- 0<-x<<1 effects +precision: 30 +expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded +expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded +expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded +precision: 20 +expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded +expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded +expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded +precision: 14 +expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded +expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded +expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded +-- overprecise and 0<-x<<1 +precision: 8 +expx330 exp -4.9999999999999E-8 -> 0.99999995 Inexact Rounded +expx331 exp -5.0000000000000E-8 -> 0.99999995 Inexact Rounded +expx332 exp -5.0000000000001E-8 -> 0.99999995 Inexact Rounded +precision: 7 +expx333 exp -4.9999999999999E-8 -> 1.000000 Inexact Rounded +expx334 exp -5.0000000000000E-8 -> 1.000000 Inexact Rounded +expx335 exp -5.0000000000001E-8 -> 1.000000 Inexact Rounded +precision: 3 +expx336 exp -4.9999999999999E-8 -> 1.00 Inexact Rounded +expx337 exp -5.0000000000000E-8 -> 1.00 Inexact Rounded +expx338 exp -5.0000000000001E-8 -> 1.00 Inexact Rounded + +-- 0 1.00000005000000124999902083328 Inexact Rounded +expx341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded +expx342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded +precision: 20 +expx343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded +expx344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded +expx345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded +precision: 14 +expx346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded +expx347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded +expx348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded +-- overprecise and 0 1.0000001 Inexact Rounded +expx351 exp 5.0000000000000E-8 -> 1.0000001 Inexact Rounded +expx352 exp 5.0000000000001E-8 -> 1.0000001 Inexact Rounded +precision: 7 +expx353 exp 4.9999999999999E-8 -> 1.000000 Inexact Rounded +expx354 exp 5.0000000000000E-8 -> 1.000000 Inexact Rounded +expx355 exp 5.0000000000001E-8 -> 1.000000 Inexact Rounded +precision: 3 +expx356 exp 4.9999999999999E-8 -> 1.00 Inexact Rounded +expx357 exp 5.0000000000000E-8 -> 1.00 Inexact Rounded +expx358 exp 5.0000000000001E-8 -> 1.00 Inexact Rounded + +-- cases near 1 -- 1 2345678901234567890 +precision: 20 +expx401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded +expx402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded +expx403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded +expx404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded +expx405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded +expx406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded +expx407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded +precision: 14 +expx411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded +expx412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded +expx413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded +expx414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded +expx415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded +expx416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded +expx417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded +-- overprecise... +precision: 7 +expx421 exp 0.99999999999996 -> 2.718282 Inexact Rounded +expx422 exp 0.99999999999997 -> 2.718282 Inexact Rounded +expx423 exp 0.99999999999998 -> 2.718282 Inexact Rounded +expx424 exp 0.99999999999999 -> 2.718282 Inexact Rounded +expx425 exp 1.0000000000001 -> 2.718282 Inexact Rounded +expx426 exp 1.0000000000002 -> 2.718282 Inexact Rounded +expx427 exp 1.0000000000003 -> 2.718282 Inexact Rounded +precision: 2 +expx431 exp 0.99999999999996 -> 2.7 Inexact Rounded +expx432 exp 0.99999999999997 -> 2.7 Inexact Rounded +expx433 exp 0.99999999999998 -> 2.7 Inexact Rounded +expx434 exp 0.99999999999999 -> 2.7 Inexact Rounded +expx435 exp 1.0000000000001 -> 2.7 Inexact Rounded +expx436 exp 1.0000000000002 -> 2.7 Inexact Rounded +expx437 exp 1.0000000000003 -> 2.7 Inexact Rounded + +-- basics at low precisions +precision: 3 +expx501 exp -Infinity -> 0 +expx502 exp -10 -> 0.0000454 Inexact Rounded +expx503 exp -1 -> 0.368 Inexact Rounded +expx504 exp 0 -> 1 +expx505 exp -0 -> 1 +expx506 exp 1 -> 2.72 Inexact Rounded +expx507 exp 0.693147181 -> 2.00 Inexact Rounded +expx508 exp 10 -> 2.20E+4 Inexact Rounded +expx509 exp +Infinity -> Infinity +precision: 2 +expx511 exp -Infinity -> 0 +expx512 exp -10 -> 0.000045 Inexact Rounded +expx513 exp -1 -> 0.37 Inexact Rounded +expx514 exp 0 -> 1 +expx515 exp -0 -> 1 +expx516 exp 1 -> 2.7 Inexact Rounded +expx517 exp 0.693147181 -> 2.0 Inexact Rounded +expx518 exp 10 -> 2.2E+4 Inexact Rounded +expx519 exp +Infinity -> Infinity +precision: 1 +expx521 exp -Infinity -> 0 +expx522 exp -10 -> 0.00005 Inexact Rounded +expx523 exp -1 -> 0.4 Inexact Rounded +expx524 exp 0 -> 1 +expx525 exp -0 -> 1 +expx526 exp 1 -> 3 Inexact Rounded +expx527 exp 0.693147181 -> 2 Inexact Rounded +expx528 exp 10 -> 2E+4 Inexact Rounded +expx529 exp +Infinity -> Infinity + +-- overflows, including some overprecise borderlines +precision: 7 +maxExponent: 384 +minExponent: -383 +expx701 exp 1000000000 -> Infinity Overflow Inexact Rounded +expx702 exp 100000000 -> Infinity Overflow Inexact Rounded +expx703 exp 10000000 -> Infinity Overflow Inexact Rounded +expx704 exp 1000000 -> Infinity Overflow Inexact Rounded +expx705 exp 100000 -> Infinity Overflow Inexact Rounded +expx706 exp 10000 -> Infinity Overflow Inexact Rounded +expx707 exp 1000 -> Infinity Overflow Inexact Rounded +expx708 exp 886.4952608 -> Infinity Overflow Inexact Rounded +expx709 exp 886.4952607 -> 9.999999E+384 Inexact Rounded +expx710 exp 886.49527 -> Infinity Overflow Inexact Rounded +expx711 exp 886.49526 -> 9.999992E+384 Inexact Rounded +precision: 16 +expx721 exp 886.4952608027075883 -> Infinity Overflow Inexact Rounded +expx722 exp 886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded +expx723 exp 886.49526080270759 -> Infinity Overflow Inexact Rounded +expx724 exp 886.49526080270758 -> 9.999999999999917E+384 Inexact Rounded +expx725 exp 886.4952608027076 -> Infinity Overflow Inexact Rounded +expx726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded +-- and by special request ... +precision: 15 +expx731 exp 886.495260802708 -> Infinity Overflow Inexact Rounded +expx732 exp 886.495260802707 -> 9.99999999999412E+384 Inexact Rounded +expx733 exp 886.495260802706 -> 9.99999999998412E+384 Inexact Rounded +maxExponent: 999 +minExponent: -999 +expx735 exp 2302.58509299405 -> Infinity Overflow Inexact Rounded +expx736 exp 2302.58509299404 -> 9.99999999994316E+999 Inexact Rounded +expx737 exp 2302.58509299403 -> 9.99999999984316E+999 Inexact Rounded + +-- subnormals and underflows, including underflow-to-zero edge point +precision: 7 +maxExponent: 384 +minExponent: -383 +expx751 exp -1000000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx752 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx753 exp -10000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx754 exp -1000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx755 exp -100000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx756 exp -10000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx757 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx758 exp -881.89009 -> 1.000001E-383 Inexact Rounded +expx759 exp -881.8901 -> 9.99991E-384 Inexact Rounded Underflow Subnormal +expx760 exp -885 -> 4.4605E-385 Inexact Rounded Underflow Subnormal +expx761 exp -888 -> 2.221E-386 Inexact Rounded Underflow Subnormal +expx762 exp -890 -> 3.01E-387 Inexact Rounded Underflow Subnormal +expx763 exp -892.9 -> 1.7E-388 Inexact Rounded Underflow Subnormal +expx764 exp -893 -> 1.5E-388 Inexact Rounded Underflow Subnormal +expx765 exp -893.5 -> 9E-389 Inexact Rounded Underflow Subnormal +expx766 exp -895.7056 -> 1E-389 Inexact Rounded Underflow Subnormal +expx769 exp -895.8 -> 1E-389 Inexact Rounded Underflow Subnormal +expx770 exp -895.73 -> 1E-389 Inexact Rounded Underflow Subnormal +expx771 exp -896.3987 -> 1E-389 Inexact Rounded Underflow Subnormal +expx772 exp -896.3988 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped +expx773 exp -898.0081 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped +expx774 exp -898.0082 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped + +-- special values +maxexponent: 999 +minexponent: -999 +expx820 exp Inf -> Infinity +expx821 exp -Inf -> 0 +expx822 exp NaN -> NaN +expx823 exp sNaN -> NaN Invalid_operation +-- propagating NaNs +expx824 exp sNaN123 -> NaN123 Invalid_operation +expx825 exp -sNaN321 -> -NaN321 Invalid_operation +expx826 exp NaN456 -> NaN456 +expx827 exp -NaN654 -> -NaN654 +expx828 exp NaN1 -> NaN1 + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +expx901 exp -Infinity -> NaN Invalid_context +precision: 99999999 +expx902 exp -Infinity -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +expx903 exp -Infinity -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +expx904 exp -Infinity -> 0 +maxExponent: 999999 +minExponent: -1000000 +expx905 exp -Infinity -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +expx906 exp -Infinity -> 0 + +-- +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- Null test +expx900 exp # -> NaN Invalid_operation + + +-- Randoms P=50, within 0-999 +Precision: 50 +maxExponent: 384 +minExponent: -383 +expx1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded +expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded +expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded +expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded +expx1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded +expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded +expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded +expx1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded +expx1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded +expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded +expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded +expx1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded +expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded +expx1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded +expx1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded +expx1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded +expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded +expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded +expx1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded +expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded +expx1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded +expx1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded +expx1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded +expx1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded +expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded +expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded +expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded +expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded +expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded +expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded +expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded +expx1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded +expx1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded +expx1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded +expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded +expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded +expx1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded +expx1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded +expx1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded +expx1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded + +-- exp(1) at 34 +Precision: 34 +expx1200 exp 1 -> 2.718281828459045235360287471352662 Inexact Rounded + +-- Randoms P=34, within 0-999 +Precision: 34 +maxExponent: 6144 +minExponent: -6143 +expx1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded +expx1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded +expx1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded +expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded +expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded +expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded +expx1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded +expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded +expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded +expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded +expx1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded +expx1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded +expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded +expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded +expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded +expx1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded +expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded +expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded +expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded +expx1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded +expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded +expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded +expx1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded +expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded +expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded +expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded +expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded +expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded +expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded +expx1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded +expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded +expx1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded +expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded +expx1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded +expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded +expx1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded +expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded +expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded +expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded +expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded + +-- Randoms P=16, within 0-99 +Precision: 16 +maxExponent: 384 +minExponent: -383 +expx1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded +expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded +expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded +expx1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded +expx1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded +expx1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded +expx1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded +expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded +expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded +expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded +expx1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded +expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded +expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded +expx1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded +expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded +expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded +expx1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded +expx1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded +expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded +expx1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded +expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded +expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded +expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded +expx1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded +expx1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded +expx1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded +expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded +expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded +expx1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded +expx1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded +expx1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded +expx1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded +expx1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded +expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded +expx1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded +expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded +expx1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded +expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded +expx1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded +expx1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded + +-- Randoms P=7, within 0-9 +Precision: 7 +maxExponent: 96 +minExponent: -95 +expx1001 exp 2.395441 -> 10.97304 Inexact Rounded +expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded +expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded +expx1004 exp 3.055120 -> 21.22373 Inexact Rounded +expx1005 exp 1.536792 -> 4.649650 Inexact Rounded +expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded +expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded +expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded +expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded +expx1010 exp 2.956859 -> 19.23745 Inexact Rounded +expx1011 exp 7.504679 -> 1816.522 Inexact Rounded +expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded +expx1013 exp 3.810071 -> 45.15364 Inexact Rounded +expx1014 exp 1.502390 -> 4.492413 Inexact Rounded +expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded +expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded +expx1017 exp 9.811445 -> 18241.33 Inexact Rounded +expx1018 exp 3.245249 -> 25.66810 Inexact Rounded +expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded +expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded +expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded +expx1022 exp 2.202088 -> 9.043877 Inexact Rounded +expx1023 exp 8.778203 -> 6491.202 Inexact Rounded +expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded +expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded +expx1026 exp 0.276413 -> 1.318392 Inexact Rounded +expx1027 exp 4.490067 -> 89.12742 Inexact Rounded +expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded +expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded +expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded +expx1031 exp 9.261816 -> 10528.24 Inexact Rounded +expx1032 exp 9.611186 -> 14930.87 Inexact Rounded +expx1033 exp 9.118125 -> 9119.087 Inexact Rounded +expx1034 exp 9.469083 -> 12953.00 Inexact Rounded +expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded +expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded +expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded +expx1038 exp 9.138494 -> 9306.739 Inexact Rounded +expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded +expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/extra.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/extra.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,2690 @@ +version: ?.?? + +extended: 1 +rounding: half_even + +-- testing folddown and clamping +maxexponent: 9 +minexponent: -9 +precision: 6 +clamp: 1 +extr0000 apply 1E+11 -> Infinity Overflow Inexact Rounded +extr0001 apply 1E+10 -> Infinity Overflow Inexact Rounded +extr0002 apply 1E+9 -> 1.00000E+9 Clamped +extr0003 apply 1E+8 -> 1.0000E+8 Clamped +extr0004 apply 1E+7 -> 1.000E+7 Clamped +extr0005 apply 1E+6 -> 1.00E+6 Clamped +extr0006 apply 1E+5 -> 1.0E+5 Clamped +extr0007 apply 1E+4 -> 1E+4 +extr0008 apply 1E+3 -> 1E+3 +extr0009 apply 1E+2 -> 1E+2 +extr0010 apply 1E+1 -> 1E+1 +extr0011 apply 1 -> 1 +extr0012 apply 1E-1 -> 0.1 +extr0013 apply 1E-2 -> 0.01 +extr0014 apply 1E-3 -> 0.001 +extr0015 apply 1E-4 -> 0.0001 +extr0016 apply 1E-5 -> 0.00001 +extr0017 apply 1E-6 -> 0.000001 +extr0018 apply 1E-7 -> 1E-7 +extr0019 apply 1E-8 -> 1E-8 +extr0020 apply 1E-9 -> 1E-9 +extr0021 apply 1E-10 -> 1E-10 Subnormal +extr0022 apply 1E-11 -> 1E-11 Subnormal +extr0023 apply 1E-12 -> 1E-12 Subnormal +extr0024 apply 1E-13 -> 1E-13 Subnormal +extr0025 apply 1E-14 -> 1E-14 Subnormal +extr0026 apply 1E-15 -> 0E-14 Inexact Rounded Subnormal Underflow Clamped +extr0027 apply 1E-16 -> 0E-14 Inexact Rounded Subnormal Underflow Clamped +clamp: 0 + +-- large precision, small minimum and maximum exponent; in this case +-- it's possible that folddown is required on a subnormal result +maxexponent: 9 +minexponent: -9 +precision: 24 +clamp: 1 +extr0100 apply 1E+11 -> Infinity Overflow Inexact Rounded +extr0101 apply 1E+10 -> Infinity Overflow Inexact Rounded +extr0102 apply 1E+9 -> 1000000000.00000000000000 Clamped +extr0103 apply 1E+8 -> 100000000.00000000000000 Clamped +extr0104 apply 1E+7 -> 10000000.00000000000000 Clamped +extr0105 apply 1E+6 -> 1000000.00000000000000 Clamped +extr0106 apply 1E+5 -> 100000.00000000000000 Clamped +extr0107 apply 1E+4 -> 10000.00000000000000 Clamped +extr0108 apply 1E+3 -> 1000.00000000000000 Clamped +extr0109 apply 1E+2 -> 100.00000000000000 Clamped +extr0110 apply 1E+1 -> 10.00000000000000 Clamped +extr0111 apply 1 -> 1.00000000000000 Clamped +extr0112 apply 1E-1 -> 0.10000000000000 Clamped +extr0113 apply 1E-2 -> 0.01000000000000 Clamped +extr0114 apply 1E-3 -> 0.00100000000000 Clamped +extr0115 apply 1E-4 -> 0.00010000000000 Clamped +extr0116 apply 1E-5 -> 0.00001000000000 Clamped +extr0117 apply 1E-6 -> 0.00000100000000 Clamped +extr0118 apply 1E-7 -> 1.0000000E-7 Clamped +extr0119 apply 1E-8 -> 1.000000E-8 Clamped +extr0120 apply 1E-9 -> 1.00000E-9 Clamped +extr0121 apply 1E-10 -> 1.0000E-10 Subnormal Clamped +extr0122 apply 1E-11 -> 1.000E-11 Subnormal Clamped +extr0123 apply 1E-12 -> 1.00E-12 Subnormal Clamped +extr0124 apply 1E-13 -> 1.0E-13 Subnormal Clamped +extr0125 apply 1E-14 -> 1E-14 Subnormal +extr0126 apply 1E-15 -> 1E-15 Subnormal +extr0127 apply 1E-16 -> 1E-16 Subnormal +extr0128 apply 1E-17 -> 1E-17 Subnormal +extr0129 apply 1E-18 -> 1E-18 Subnormal +extr0130 apply 1E-19 -> 1E-19 Subnormal +extr0131 apply 1E-20 -> 1E-20 Subnormal +extr0132 apply 1E-21 -> 1E-21 Subnormal +extr0133 apply 1E-22 -> 1E-22 Subnormal +extr0134 apply 1E-23 -> 1E-23 Subnormal +extr0135 apply 1E-24 -> 1E-24 Subnormal +extr0136 apply 1E-25 -> 1E-25 Subnormal +extr0137 apply 1E-26 -> 1E-26 Subnormal +extr0138 apply 1E-27 -> 1E-27 Subnormal +extr0139 apply 1E-28 -> 1E-28 Subnormal +extr0140 apply 1E-29 -> 1E-29 Subnormal +extr0141 apply 1E-30 -> 1E-30 Subnormal +extr0142 apply 1E-31 -> 1E-31 Subnormal +extr0143 apply 1E-32 -> 1E-32 Subnormal +extr0144 apply 1E-33 -> 0E-32 Inexact Rounded Subnormal Underflow Clamped +extr0145 apply 1E-34 -> 0E-32 Inexact Rounded Subnormal Underflow Clamped +clamp: 0 + +-- some buggy addition cases from Python 2.5.x +maxexponent: 999 +minexponent: -999 +precision: 6 +extr1000 add 0E+1000 0E+2000 -> 0E+999 Clamped +extr1001 add 0E+1004 0E+1001 -> 0E+999 Clamped +clamp: 1 +extr1002 add 0E+1000 0E+1000 -> 0E+994 Clamped +clamp: 0 +extr1003 add 0E+1000 0E-1005 -> 0E-1004 Clamped +extr1004 add 0E-1006 0 -> 0E-1004 Clamped +extr1005 add 1E+1000 -1E+1000 -> 0E+999 Clamped +extr1006 add -3.1E+1004 3.1E+1004 -> 0E+999 Clamped +clamp: 1 +extr1007 add 1E+998 -1E+998 -> 0E+994 Clamped +clamp: 0 +extr1008 add 2E-1005 -2E-1005 -> 0E-1004 Clamped +extr1009 add -3.1E-1005 3.1E-1005 -> 0E-1004 Clamped + +precision: 3 +extr1010 add 99949.9 0.200000 -> 1.00E+5 Inexact Rounded +extr1011 add 99949.9 0.100000 -> 1.00E+5 Inexact Rounded +extr1012 add 99849.9 0.200000 -> 9.99E+4 Inexact Rounded +extr1013 add 99849.9 0.100000 -> 9.98E+4 Inexact Rounded +extr1014 add 1.0149 0.00011 -> 1.02 Inexact Rounded +extr1015 add 1.0149 0.00010 -> 1.02 Inexact Rounded +extr1016 add 1.0149 0.00009 -> 1.01 Inexact Rounded +extr1017 add 1.0049 0.00011 -> 1.01 Inexact Rounded +extr1018 add 1.0049 0.00010 -> 1.00 Inexact Rounded +extr1019 add 1.0049 0.00009 -> 1.00 Inexact Rounded +rounding: down +extr1020 add 99999.9 0.200000 -> 1.00E+5 Inexact Rounded +extr1021 add 99999.8 0.200000 -> 1.00E+5 Rounded +extr1022 add 99999.7 0.200000 -> 9.99E+4 Inexact Rounded +rounding: half_even + +-- a bug in _rescale caused the following to fail in Python 2.5.1 +maxexponent: 999 +minexponent: -999 +precision: 6 +extr1100 add 0E+1000 1E+1000 -> Infinity Overflow Inexact Rounded +extr1101 remainder 1E+1000 2E+1000 -> Infinity Overflow Inexact Rounded + +-- tests for scaleb in case where input precision > context precision. +-- Result should be rounded. (This isn't totally clear from the +-- specification, but the treatment of underflow in the testcases +-- suggests that rounding should occur in general. Furthermore, it's +-- the way that the reference implementation behaves.) +maxexponent: 999 +minexponent: -999 +precision: 3 +extr1200 scaleb 1234 1 -> 1.23E+4 Inexact Rounded +extr1201 scaleb 5678 0 -> 5.68E+3 Inexact Rounded +extr1202 scaleb -9105 -1 -> -910 Inexact Rounded + +-- Invalid operation from 0 * infinity in fma +-- takes precedence over a third-argument sNaN +extr1300 fma 0 Inf sNaN123 -> NaN Invalid_operation +extr1301 fma Inf 0 sNaN456 -> NaN Invalid_operation +extr1302 fma 0E123 -Inf sNaN789 -> NaN Invalid_operation +extr1302 fma -Inf 0E-456 sNaN148 -> NaN Invalid_operation + +-- max/min/max_mag/min_mag bug in 2.5.2/2.6/3.0: max(NaN, finite) gave +-- incorrect answers when the finite number required rounding; similarly +-- for the other thre functions +maxexponent: 999 +minexponent: -999 +precision: 6 +rounding: half_even +extr1400 max NaN 1234567 -> 1.23457E+6 Inexact Rounded +extr1401 max 3141590E-123 NaN1729 -> 3.14159E-117 Rounded +extr1402 max -7.654321 -NaN -> -7.65432 Inexact Rounded +extr1410 min -NaN -765432.1 -> -765432 Inexact Rounded +extr1411 min 3141592 NaN -> 3.14159E+6 Inexact Rounded +extr1420 max_mag 0.1111111 -NaN123 -> 0.111111 Inexact Rounded +extr1421 max_mag NaN999999999 0.001234567 -> 0.00123457 Inexact Rounded +extr1430 min_mag 9181716151 -NaN -> 9.18172E+9 Inexact Rounded +extr1431 min_mag NaN4 1.818180E100 -> 1.81818E+100 Rounded + +-- Tests for the is_* boolean operations +precision: 9 +maxExponent: 999 +minExponent: -999 + +bool0000 iscanonical 0E-2000 -> 1 +bool0001 iscanonical -0E-2000 -> 1 +bool0002 iscanonical 0E-1008 -> 1 +bool0003 iscanonical -0E-1008 -> 1 +bool0004 iscanonical 0E-1007 -> 1 +bool0005 iscanonical -0E-1007 -> 1 +bool0006 iscanonical 0E-1006 -> 1 +bool0007 iscanonical -0E-1006 -> 1 +bool0008 iscanonical 0E-1000 -> 1 +bool0009 iscanonical -0E-1000 -> 1 +bool0010 iscanonical 0E-999 -> 1 +bool0011 iscanonical -0E-999 -> 1 +bool0012 iscanonical 0E-998 -> 1 +bool0013 iscanonical -0E-998 -> 1 +bool0014 iscanonical 0E-100 -> 1 +bool0015 iscanonical -0E-100 -> 1 +bool0016 iscanonical 0.000000 -> 1 +bool0017 iscanonical -0.000000 -> 1 +bool0018 iscanonical 0.000 -> 1 +bool0019 iscanonical -0.000 -> 1 +bool0020 iscanonical 0.00 -> 1 +bool0021 iscanonical -0.00 -> 1 +bool0022 iscanonical 0.0 -> 1 +bool0023 iscanonical -0.0 -> 1 +bool0024 iscanonical 0 -> 1 +bool0025 iscanonical -0 -> 1 +bool0026 iscanonical 0E+1 -> 1 +bool0027 iscanonical -0E+1 -> 1 +bool0028 iscanonical 0E+2 -> 1 +bool0029 iscanonical -0E+2 -> 1 +bool0030 iscanonical 0E+3 -> 1 +bool0031 iscanonical -0E+3 -> 1 +bool0032 iscanonical 0E+6 -> 1 +bool0033 iscanonical -0E+6 -> 1 +bool0034 iscanonical 0E+100 -> 1 +bool0035 iscanonical -0E+100 -> 1 +bool0036 iscanonical 0E+990 -> 1 +bool0037 iscanonical -0E+990 -> 1 +bool0038 iscanonical 0E+991 -> 1 +bool0039 iscanonical -0E+991 -> 1 +bool0040 iscanonical 0E+992 -> 1 +bool0041 iscanonical -0E+992 -> 1 +bool0042 iscanonical 0E+998 -> 1 +bool0043 iscanonical -0E+998 -> 1 +bool0044 iscanonical 0E+999 -> 1 +bool0045 iscanonical -0E+999 -> 1 +bool0046 iscanonical 0E+1000 -> 1 +bool0047 iscanonical -0E+1000 -> 1 +bool0048 iscanonical 0E+2000 -> 1 +bool0049 iscanonical -0E+2000 -> 1 +bool0050 iscanonical 1E-2000 -> 1 +bool0051 iscanonical -1E-2000 -> 1 +bool0052 iscanonical 1E-1008 -> 1 +bool0053 iscanonical -1E-1008 -> 1 +bool0054 iscanonical 1E-1007 -> 1 +bool0055 iscanonical -1E-1007 -> 1 +bool0056 iscanonical 1E-1006 -> 1 +bool0057 iscanonical -1E-1006 -> 1 +bool0058 iscanonical 1E-1000 -> 1 +bool0059 iscanonical -1E-1000 -> 1 +bool0060 iscanonical 1E-999 -> 1 +bool0061 iscanonical -1E-999 -> 1 +bool0062 iscanonical 1E-998 -> 1 +bool0063 iscanonical -1E-998 -> 1 +bool0064 iscanonical 1E-100 -> 1 +bool0065 iscanonical -1E-100 -> 1 +bool0066 iscanonical 0.000001 -> 1 +bool0067 iscanonical -0.000001 -> 1 +bool0068 iscanonical 0.001 -> 1 +bool0069 iscanonical -0.001 -> 1 +bool0070 iscanonical 0.01 -> 1 +bool0071 iscanonical -0.01 -> 1 +bool0072 iscanonical 0.1 -> 1 +bool0073 iscanonical -0.1 -> 1 +bool0074 iscanonical 1 -> 1 +bool0075 iscanonical -1 -> 1 +bool0076 iscanonical 1E+1 -> 1 +bool0077 iscanonical -1E+1 -> 1 +bool0078 iscanonical 1E+2 -> 1 +bool0079 iscanonical -1E+2 -> 1 +bool0080 iscanonical 1E+3 -> 1 +bool0081 iscanonical -1E+3 -> 1 +bool0082 iscanonical 1E+6 -> 1 +bool0083 iscanonical -1E+6 -> 1 +bool0084 iscanonical 1E+100 -> 1 +bool0085 iscanonical -1E+100 -> 1 +bool0086 iscanonical 1E+990 -> 1 +bool0087 iscanonical -1E+990 -> 1 +bool0088 iscanonical 1E+991 -> 1 +bool0089 iscanonical -1E+991 -> 1 +bool0090 iscanonical 1E+992 -> 1 +bool0091 iscanonical -1E+992 -> 1 +bool0092 iscanonical 1E+998 -> 1 +bool0093 iscanonical -1E+998 -> 1 +bool0094 iscanonical 1E+999 -> 1 +bool0095 iscanonical -1E+999 -> 1 +bool0096 iscanonical 1E+1000 -> 1 +bool0097 iscanonical -1E+1000 -> 1 +bool0098 iscanonical 1E+2000 -> 1 +bool0099 iscanonical -1E+2000 -> 1 +bool0100 iscanonical 9E-2000 -> 1 +bool0101 iscanonical -9E-2000 -> 1 +bool0102 iscanonical 9E-1008 -> 1 +bool0103 iscanonical -9E-1008 -> 1 +bool0104 iscanonical 9E-1007 -> 1 +bool0105 iscanonical -9E-1007 -> 1 +bool0106 iscanonical 9E-1006 -> 1 +bool0107 iscanonical -9E-1006 -> 1 +bool0108 iscanonical 9E-1000 -> 1 +bool0109 iscanonical -9E-1000 -> 1 +bool0110 iscanonical 9E-999 -> 1 +bool0111 iscanonical -9E-999 -> 1 +bool0112 iscanonical 9E-998 -> 1 +bool0113 iscanonical -9E-998 -> 1 +bool0114 iscanonical 9E-100 -> 1 +bool0115 iscanonical -9E-100 -> 1 +bool0116 iscanonical 0.000009 -> 1 +bool0117 iscanonical -0.000009 -> 1 +bool0118 iscanonical 0.009 -> 1 +bool0119 iscanonical -0.009 -> 1 +bool0120 iscanonical 0.09 -> 1 +bool0121 iscanonical -0.09 -> 1 +bool0122 iscanonical 0.9 -> 1 +bool0123 iscanonical -0.9 -> 1 +bool0124 iscanonical 9 -> 1 +bool0125 iscanonical -9 -> 1 +bool0126 iscanonical 9E+1 -> 1 +bool0127 iscanonical -9E+1 -> 1 +bool0128 iscanonical 9E+2 -> 1 +bool0129 iscanonical -9E+2 -> 1 +bool0130 iscanonical 9E+3 -> 1 +bool0131 iscanonical -9E+3 -> 1 +bool0132 iscanonical 9E+6 -> 1 +bool0133 iscanonical -9E+6 -> 1 +bool0134 iscanonical 9E+100 -> 1 +bool0135 iscanonical -9E+100 -> 1 +bool0136 iscanonical 9E+990 -> 1 +bool0137 iscanonical -9E+990 -> 1 +bool0138 iscanonical 9E+991 -> 1 +bool0139 iscanonical -9E+991 -> 1 +bool0140 iscanonical 9E+992 -> 1 +bool0141 iscanonical -9E+992 -> 1 +bool0142 iscanonical 9E+998 -> 1 +bool0143 iscanonical -9E+998 -> 1 +bool0144 iscanonical 9E+999 -> 1 +bool0145 iscanonical -9E+999 -> 1 +bool0146 iscanonical 9E+1000 -> 1 +bool0147 iscanonical -9E+1000 -> 1 +bool0148 iscanonical 9E+2000 -> 1 +bool0149 iscanonical -9E+2000 -> 1 +bool0150 iscanonical 9.99999999E-2000 -> 1 +bool0151 iscanonical -9.99999999E-2000 -> 1 +bool0152 iscanonical 9.99999999E-1008 -> 1 +bool0153 iscanonical -9.99999999E-1008 -> 1 +bool0154 iscanonical 9.99999999E-1007 -> 1 +bool0155 iscanonical -9.99999999E-1007 -> 1 +bool0156 iscanonical 9.99999999E-1006 -> 1 +bool0157 iscanonical -9.99999999E-1006 -> 1 +bool0158 iscanonical 9.99999999E-1000 -> 1 +bool0159 iscanonical -9.99999999E-1000 -> 1 +bool0160 iscanonical 9.99999999E-999 -> 1 +bool0161 iscanonical -9.99999999E-999 -> 1 +bool0162 iscanonical 9.99999999E-998 -> 1 +bool0163 iscanonical -9.99999999E-998 -> 1 +bool0164 iscanonical 9.99999999E-100 -> 1 +bool0165 iscanonical -9.99999999E-100 -> 1 +bool0166 iscanonical 0.00000999999999 -> 1 +bool0167 iscanonical -0.00000999999999 -> 1 +bool0168 iscanonical 0.00999999999 -> 1 +bool0169 iscanonical -0.00999999999 -> 1 +bool0170 iscanonical 0.0999999999 -> 1 +bool0171 iscanonical -0.0999999999 -> 1 +bool0172 iscanonical 0.999999999 -> 1 +bool0173 iscanonical -0.999999999 -> 1 +bool0174 iscanonical 9.99999999 -> 1 +bool0175 iscanonical -9.99999999 -> 1 +bool0176 iscanonical 99.9999999 -> 1 +bool0177 iscanonical -99.9999999 -> 1 +bool0178 iscanonical 999.999999 -> 1 +bool0179 iscanonical -999.999999 -> 1 +bool0180 iscanonical 9999.99999 -> 1 +bool0181 iscanonical -9999.99999 -> 1 +bool0182 iscanonical 9999999.99 -> 1 +bool0183 iscanonical -9999999.99 -> 1 +bool0184 iscanonical 9.99999999E+100 -> 1 +bool0185 iscanonical -9.99999999E+100 -> 1 +bool0186 iscanonical 9.99999999E+990 -> 1 +bool0187 iscanonical -9.99999999E+990 -> 1 +bool0188 iscanonical 9.99999999E+991 -> 1 +bool0189 iscanonical -9.99999999E+991 -> 1 +bool0190 iscanonical 9.99999999E+992 -> 1 +bool0191 iscanonical -9.99999999E+992 -> 1 +bool0192 iscanonical 9.99999999E+998 -> 1 +bool0193 iscanonical -9.99999999E+998 -> 1 +bool0194 iscanonical 9.99999999E+999 -> 1 +bool0195 iscanonical -9.99999999E+999 -> 1 +bool0196 iscanonical 9.99999999E+1000 -> 1 +bool0197 iscanonical -9.99999999E+1000 -> 1 +bool0198 iscanonical 9.99999999E+2000 -> 1 +bool0199 iscanonical -9.99999999E+2000 -> 1 +bool0200 iscanonical Infinity -> 1 +bool0201 iscanonical -Infinity -> 1 +bool0202 iscanonical NaN -> 1 +bool0203 iscanonical -NaN -> 1 +bool0204 iscanonical NaN123 -> 1 +bool0205 iscanonical -NaN123 -> 1 +bool0206 iscanonical sNaN -> 1 +bool0207 iscanonical -sNaN -> 1 +bool0208 iscanonical sNaN123 -> 1 +bool0209 iscanonical -sNaN123 -> 1 +bool0210 isfinite 0E-2000 -> 1 +bool0211 isfinite -0E-2000 -> 1 +bool0212 isfinite 0E-1008 -> 1 +bool0213 isfinite -0E-1008 -> 1 +bool0214 isfinite 0E-1007 -> 1 +bool0215 isfinite -0E-1007 -> 1 +bool0216 isfinite 0E-1006 -> 1 +bool0217 isfinite -0E-1006 -> 1 +bool0218 isfinite 0E-1000 -> 1 +bool0219 isfinite -0E-1000 -> 1 +bool0220 isfinite 0E-999 -> 1 +bool0221 isfinite -0E-999 -> 1 +bool0222 isfinite 0E-998 -> 1 +bool0223 isfinite -0E-998 -> 1 +bool0224 isfinite 0E-100 -> 1 +bool0225 isfinite -0E-100 -> 1 +bool0226 isfinite 0.000000 -> 1 +bool0227 isfinite -0.000000 -> 1 +bool0228 isfinite 0.000 -> 1 +bool0229 isfinite -0.000 -> 1 +bool0230 isfinite 0.00 -> 1 +bool0231 isfinite -0.00 -> 1 +bool0232 isfinite 0.0 -> 1 +bool0233 isfinite -0.0 -> 1 +bool0234 isfinite 0 -> 1 +bool0235 isfinite -0 -> 1 +bool0236 isfinite 0E+1 -> 1 +bool0237 isfinite -0E+1 -> 1 +bool0238 isfinite 0E+2 -> 1 +bool0239 isfinite -0E+2 -> 1 +bool0240 isfinite 0E+3 -> 1 +bool0241 isfinite -0E+3 -> 1 +bool0242 isfinite 0E+6 -> 1 +bool0243 isfinite -0E+6 -> 1 +bool0244 isfinite 0E+100 -> 1 +bool0245 isfinite -0E+100 -> 1 +bool0246 isfinite 0E+990 -> 1 +bool0247 isfinite -0E+990 -> 1 +bool0248 isfinite 0E+991 -> 1 +bool0249 isfinite -0E+991 -> 1 +bool0250 isfinite 0E+992 -> 1 +bool0251 isfinite -0E+992 -> 1 +bool0252 isfinite 0E+998 -> 1 +bool0253 isfinite -0E+998 -> 1 +bool0254 isfinite 0E+999 -> 1 +bool0255 isfinite -0E+999 -> 1 +bool0256 isfinite 0E+1000 -> 1 +bool0257 isfinite -0E+1000 -> 1 +bool0258 isfinite 0E+2000 -> 1 +bool0259 isfinite -0E+2000 -> 1 +bool0260 isfinite 1E-2000 -> 1 +bool0261 isfinite -1E-2000 -> 1 +bool0262 isfinite 1E-1008 -> 1 +bool0263 isfinite -1E-1008 -> 1 +bool0264 isfinite 1E-1007 -> 1 +bool0265 isfinite -1E-1007 -> 1 +bool0266 isfinite 1E-1006 -> 1 +bool0267 isfinite -1E-1006 -> 1 +bool0268 isfinite 1E-1000 -> 1 +bool0269 isfinite -1E-1000 -> 1 +bool0270 isfinite 1E-999 -> 1 +bool0271 isfinite -1E-999 -> 1 +bool0272 isfinite 1E-998 -> 1 +bool0273 isfinite -1E-998 -> 1 +bool0274 isfinite 1E-100 -> 1 +bool0275 isfinite -1E-100 -> 1 +bool0276 isfinite 0.000001 -> 1 +bool0277 isfinite -0.000001 -> 1 +bool0278 isfinite 0.001 -> 1 +bool0279 isfinite -0.001 -> 1 +bool0280 isfinite 0.01 -> 1 +bool0281 isfinite -0.01 -> 1 +bool0282 isfinite 0.1 -> 1 +bool0283 isfinite -0.1 -> 1 +bool0284 isfinite 1 -> 1 +bool0285 isfinite -1 -> 1 +bool0286 isfinite 1E+1 -> 1 +bool0287 isfinite -1E+1 -> 1 +bool0288 isfinite 1E+2 -> 1 +bool0289 isfinite -1E+2 -> 1 +bool0290 isfinite 1E+3 -> 1 +bool0291 isfinite -1E+3 -> 1 +bool0292 isfinite 1E+6 -> 1 +bool0293 isfinite -1E+6 -> 1 +bool0294 isfinite 1E+100 -> 1 +bool0295 isfinite -1E+100 -> 1 +bool0296 isfinite 1E+990 -> 1 +bool0297 isfinite -1E+990 -> 1 +bool0298 isfinite 1E+991 -> 1 +bool0299 isfinite -1E+991 -> 1 +bool0300 isfinite 1E+992 -> 1 +bool0301 isfinite -1E+992 -> 1 +bool0302 isfinite 1E+998 -> 1 +bool0303 isfinite -1E+998 -> 1 +bool0304 isfinite 1E+999 -> 1 +bool0305 isfinite -1E+999 -> 1 +bool0306 isfinite 1E+1000 -> 1 +bool0307 isfinite -1E+1000 -> 1 +bool0308 isfinite 1E+2000 -> 1 +bool0309 isfinite -1E+2000 -> 1 +bool0310 isfinite 9E-2000 -> 1 +bool0311 isfinite -9E-2000 -> 1 +bool0312 isfinite 9E-1008 -> 1 +bool0313 isfinite -9E-1008 -> 1 +bool0314 isfinite 9E-1007 -> 1 +bool0315 isfinite -9E-1007 -> 1 +bool0316 isfinite 9E-1006 -> 1 +bool0317 isfinite -9E-1006 -> 1 +bool0318 isfinite 9E-1000 -> 1 +bool0319 isfinite -9E-1000 -> 1 +bool0320 isfinite 9E-999 -> 1 +bool0321 isfinite -9E-999 -> 1 +bool0322 isfinite 9E-998 -> 1 +bool0323 isfinite -9E-998 -> 1 +bool0324 isfinite 9E-100 -> 1 +bool0325 isfinite -9E-100 -> 1 +bool0326 isfinite 0.000009 -> 1 +bool0327 isfinite -0.000009 -> 1 +bool0328 isfinite 0.009 -> 1 +bool0329 isfinite -0.009 -> 1 +bool0330 isfinite 0.09 -> 1 +bool0331 isfinite -0.09 -> 1 +bool0332 isfinite 0.9 -> 1 +bool0333 isfinite -0.9 -> 1 +bool0334 isfinite 9 -> 1 +bool0335 isfinite -9 -> 1 +bool0336 isfinite 9E+1 -> 1 +bool0337 isfinite -9E+1 -> 1 +bool0338 isfinite 9E+2 -> 1 +bool0339 isfinite -9E+2 -> 1 +bool0340 isfinite 9E+3 -> 1 +bool0341 isfinite -9E+3 -> 1 +bool0342 isfinite 9E+6 -> 1 +bool0343 isfinite -9E+6 -> 1 +bool0344 isfinite 9E+100 -> 1 +bool0345 isfinite -9E+100 -> 1 +bool0346 isfinite 9E+990 -> 1 +bool0347 isfinite -9E+990 -> 1 +bool0348 isfinite 9E+991 -> 1 +bool0349 isfinite -9E+991 -> 1 +bool0350 isfinite 9E+992 -> 1 +bool0351 isfinite -9E+992 -> 1 +bool0352 isfinite 9E+998 -> 1 +bool0353 isfinite -9E+998 -> 1 +bool0354 isfinite 9E+999 -> 1 +bool0355 isfinite -9E+999 -> 1 +bool0356 isfinite 9E+1000 -> 1 +bool0357 isfinite -9E+1000 -> 1 +bool0358 isfinite 9E+2000 -> 1 +bool0359 isfinite -9E+2000 -> 1 +bool0360 isfinite 9.99999999E-2000 -> 1 +bool0361 isfinite -9.99999999E-2000 -> 1 +bool0362 isfinite 9.99999999E-1008 -> 1 +bool0363 isfinite -9.99999999E-1008 -> 1 +bool0364 isfinite 9.99999999E-1007 -> 1 +bool0365 isfinite -9.99999999E-1007 -> 1 +bool0366 isfinite 9.99999999E-1006 -> 1 +bool0367 isfinite -9.99999999E-1006 -> 1 +bool0368 isfinite 9.99999999E-1000 -> 1 +bool0369 isfinite -9.99999999E-1000 -> 1 +bool0370 isfinite 9.99999999E-999 -> 1 +bool0371 isfinite -9.99999999E-999 -> 1 +bool0372 isfinite 9.99999999E-998 -> 1 +bool0373 isfinite -9.99999999E-998 -> 1 +bool0374 isfinite 9.99999999E-100 -> 1 +bool0375 isfinite -9.99999999E-100 -> 1 +bool0376 isfinite 0.00000999999999 -> 1 +bool0377 isfinite -0.00000999999999 -> 1 +bool0378 isfinite 0.00999999999 -> 1 +bool0379 isfinite -0.00999999999 -> 1 +bool0380 isfinite 0.0999999999 -> 1 +bool0381 isfinite -0.0999999999 -> 1 +bool0382 isfinite 0.999999999 -> 1 +bool0383 isfinite -0.999999999 -> 1 +bool0384 isfinite 9.99999999 -> 1 +bool0385 isfinite -9.99999999 -> 1 +bool0386 isfinite 99.9999999 -> 1 +bool0387 isfinite -99.9999999 -> 1 +bool0388 isfinite 999.999999 -> 1 +bool0389 isfinite -999.999999 -> 1 +bool0390 isfinite 9999.99999 -> 1 +bool0391 isfinite -9999.99999 -> 1 +bool0392 isfinite 9999999.99 -> 1 +bool0393 isfinite -9999999.99 -> 1 +bool0394 isfinite 9.99999999E+100 -> 1 +bool0395 isfinite -9.99999999E+100 -> 1 +bool0396 isfinite 9.99999999E+990 -> 1 +bool0397 isfinite -9.99999999E+990 -> 1 +bool0398 isfinite 9.99999999E+991 -> 1 +bool0399 isfinite -9.99999999E+991 -> 1 +bool0400 isfinite 9.99999999E+992 -> 1 +bool0401 isfinite -9.99999999E+992 -> 1 +bool0402 isfinite 9.99999999E+998 -> 1 +bool0403 isfinite -9.99999999E+998 -> 1 +bool0404 isfinite 9.99999999E+999 -> 1 +bool0405 isfinite -9.99999999E+999 -> 1 +bool0406 isfinite 9.99999999E+1000 -> 1 +bool0407 isfinite -9.99999999E+1000 -> 1 +bool0408 isfinite 9.99999999E+2000 -> 1 +bool0409 isfinite -9.99999999E+2000 -> 1 +bool0410 isfinite Infinity -> 0 +bool0411 isfinite -Infinity -> 0 +bool0412 isfinite NaN -> 0 +bool0413 isfinite -NaN -> 0 +bool0414 isfinite NaN123 -> 0 +bool0415 isfinite -NaN123 -> 0 +bool0416 isfinite sNaN -> 0 +bool0417 isfinite -sNaN -> 0 +bool0418 isfinite sNaN123 -> 0 +bool0419 isfinite -sNaN123 -> 0 +bool0420 isinfinite 0E-2000 -> 0 +bool0421 isinfinite -0E-2000 -> 0 +bool0422 isinfinite 0E-1008 -> 0 +bool0423 isinfinite -0E-1008 -> 0 +bool0424 isinfinite 0E-1007 -> 0 +bool0425 isinfinite -0E-1007 -> 0 +bool0426 isinfinite 0E-1006 -> 0 +bool0427 isinfinite -0E-1006 -> 0 +bool0428 isinfinite 0E-1000 -> 0 +bool0429 isinfinite -0E-1000 -> 0 +bool0430 isinfinite 0E-999 -> 0 +bool0431 isinfinite -0E-999 -> 0 +bool0432 isinfinite 0E-998 -> 0 +bool0433 isinfinite -0E-998 -> 0 +bool0434 isinfinite 0E-100 -> 0 +bool0435 isinfinite -0E-100 -> 0 +bool0436 isinfinite 0.000000 -> 0 +bool0437 isinfinite -0.000000 -> 0 +bool0438 isinfinite 0.000 -> 0 +bool0439 isinfinite -0.000 -> 0 +bool0440 isinfinite 0.00 -> 0 +bool0441 isinfinite -0.00 -> 0 +bool0442 isinfinite 0.0 -> 0 +bool0443 isinfinite -0.0 -> 0 +bool0444 isinfinite 0 -> 0 +bool0445 isinfinite -0 -> 0 +bool0446 isinfinite 0E+1 -> 0 +bool0447 isinfinite -0E+1 -> 0 +bool0448 isinfinite 0E+2 -> 0 +bool0449 isinfinite -0E+2 -> 0 +bool0450 isinfinite 0E+3 -> 0 +bool0451 isinfinite -0E+3 -> 0 +bool0452 isinfinite 0E+6 -> 0 +bool0453 isinfinite -0E+6 -> 0 +bool0454 isinfinite 0E+100 -> 0 +bool0455 isinfinite -0E+100 -> 0 +bool0456 isinfinite 0E+990 -> 0 +bool0457 isinfinite -0E+990 -> 0 +bool0458 isinfinite 0E+991 -> 0 +bool0459 isinfinite -0E+991 -> 0 +bool0460 isinfinite 0E+992 -> 0 +bool0461 isinfinite -0E+992 -> 0 +bool0462 isinfinite 0E+998 -> 0 +bool0463 isinfinite -0E+998 -> 0 +bool0464 isinfinite 0E+999 -> 0 +bool0465 isinfinite -0E+999 -> 0 +bool0466 isinfinite 0E+1000 -> 0 +bool0467 isinfinite -0E+1000 -> 0 +bool0468 isinfinite 0E+2000 -> 0 +bool0469 isinfinite -0E+2000 -> 0 +bool0470 isinfinite 1E-2000 -> 0 +bool0471 isinfinite -1E-2000 -> 0 +bool0472 isinfinite 1E-1008 -> 0 +bool0473 isinfinite -1E-1008 -> 0 +bool0474 isinfinite 1E-1007 -> 0 +bool0475 isinfinite -1E-1007 -> 0 +bool0476 isinfinite 1E-1006 -> 0 +bool0477 isinfinite -1E-1006 -> 0 +bool0478 isinfinite 1E-1000 -> 0 +bool0479 isinfinite -1E-1000 -> 0 +bool0480 isinfinite 1E-999 -> 0 +bool0481 isinfinite -1E-999 -> 0 +bool0482 isinfinite 1E-998 -> 0 +bool0483 isinfinite -1E-998 -> 0 +bool0484 isinfinite 1E-100 -> 0 +bool0485 isinfinite -1E-100 -> 0 +bool0486 isinfinite 0.000001 -> 0 +bool0487 isinfinite -0.000001 -> 0 +bool0488 isinfinite 0.001 -> 0 +bool0489 isinfinite -0.001 -> 0 +bool0490 isinfinite 0.01 -> 0 +bool0491 isinfinite -0.01 -> 0 +bool0492 isinfinite 0.1 -> 0 +bool0493 isinfinite -0.1 -> 0 +bool0494 isinfinite 1 -> 0 +bool0495 isinfinite -1 -> 0 +bool0496 isinfinite 1E+1 -> 0 +bool0497 isinfinite -1E+1 -> 0 +bool0498 isinfinite 1E+2 -> 0 +bool0499 isinfinite -1E+2 -> 0 +bool0500 isinfinite 1E+3 -> 0 +bool0501 isinfinite -1E+3 -> 0 +bool0502 isinfinite 1E+6 -> 0 +bool0503 isinfinite -1E+6 -> 0 +bool0504 isinfinite 1E+100 -> 0 +bool0505 isinfinite -1E+100 -> 0 +bool0506 isinfinite 1E+990 -> 0 +bool0507 isinfinite -1E+990 -> 0 +bool0508 isinfinite 1E+991 -> 0 +bool0509 isinfinite -1E+991 -> 0 +bool0510 isinfinite 1E+992 -> 0 +bool0511 isinfinite -1E+992 -> 0 +bool0512 isinfinite 1E+998 -> 0 +bool0513 isinfinite -1E+998 -> 0 +bool0514 isinfinite 1E+999 -> 0 +bool0515 isinfinite -1E+999 -> 0 +bool0516 isinfinite 1E+1000 -> 0 +bool0517 isinfinite -1E+1000 -> 0 +bool0518 isinfinite 1E+2000 -> 0 +bool0519 isinfinite -1E+2000 -> 0 +bool0520 isinfinite 9E-2000 -> 0 +bool0521 isinfinite -9E-2000 -> 0 +bool0522 isinfinite 9E-1008 -> 0 +bool0523 isinfinite -9E-1008 -> 0 +bool0524 isinfinite 9E-1007 -> 0 +bool0525 isinfinite -9E-1007 -> 0 +bool0526 isinfinite 9E-1006 -> 0 +bool0527 isinfinite -9E-1006 -> 0 +bool0528 isinfinite 9E-1000 -> 0 +bool0529 isinfinite -9E-1000 -> 0 +bool0530 isinfinite 9E-999 -> 0 +bool0531 isinfinite -9E-999 -> 0 +bool0532 isinfinite 9E-998 -> 0 +bool0533 isinfinite -9E-998 -> 0 +bool0534 isinfinite 9E-100 -> 0 +bool0535 isinfinite -9E-100 -> 0 +bool0536 isinfinite 0.000009 -> 0 +bool0537 isinfinite -0.000009 -> 0 +bool0538 isinfinite 0.009 -> 0 +bool0539 isinfinite -0.009 -> 0 +bool0540 isinfinite 0.09 -> 0 +bool0541 isinfinite -0.09 -> 0 +bool0542 isinfinite 0.9 -> 0 +bool0543 isinfinite -0.9 -> 0 +bool0544 isinfinite 9 -> 0 +bool0545 isinfinite -9 -> 0 +bool0546 isinfinite 9E+1 -> 0 +bool0547 isinfinite -9E+1 -> 0 +bool0548 isinfinite 9E+2 -> 0 +bool0549 isinfinite -9E+2 -> 0 +bool0550 isinfinite 9E+3 -> 0 +bool0551 isinfinite -9E+3 -> 0 +bool0552 isinfinite 9E+6 -> 0 +bool0553 isinfinite -9E+6 -> 0 +bool0554 isinfinite 9E+100 -> 0 +bool0555 isinfinite -9E+100 -> 0 +bool0556 isinfinite 9E+990 -> 0 +bool0557 isinfinite -9E+990 -> 0 +bool0558 isinfinite 9E+991 -> 0 +bool0559 isinfinite -9E+991 -> 0 +bool0560 isinfinite 9E+992 -> 0 +bool0561 isinfinite -9E+992 -> 0 +bool0562 isinfinite 9E+998 -> 0 +bool0563 isinfinite -9E+998 -> 0 +bool0564 isinfinite 9E+999 -> 0 +bool0565 isinfinite -9E+999 -> 0 +bool0566 isinfinite 9E+1000 -> 0 +bool0567 isinfinite -9E+1000 -> 0 +bool0568 isinfinite 9E+2000 -> 0 +bool0569 isinfinite -9E+2000 -> 0 +bool0570 isinfinite 9.99999999E-2000 -> 0 +bool0571 isinfinite -9.99999999E-2000 -> 0 +bool0572 isinfinite 9.99999999E-1008 -> 0 +bool0573 isinfinite -9.99999999E-1008 -> 0 +bool0574 isinfinite 9.99999999E-1007 -> 0 +bool0575 isinfinite -9.99999999E-1007 -> 0 +bool0576 isinfinite 9.99999999E-1006 -> 0 +bool0577 isinfinite -9.99999999E-1006 -> 0 +bool0578 isinfinite 9.99999999E-1000 -> 0 +bool0579 isinfinite -9.99999999E-1000 -> 0 +bool0580 isinfinite 9.99999999E-999 -> 0 +bool0581 isinfinite -9.99999999E-999 -> 0 +bool0582 isinfinite 9.99999999E-998 -> 0 +bool0583 isinfinite -9.99999999E-998 -> 0 +bool0584 isinfinite 9.99999999E-100 -> 0 +bool0585 isinfinite -9.99999999E-100 -> 0 +bool0586 isinfinite 0.00000999999999 -> 0 +bool0587 isinfinite -0.00000999999999 -> 0 +bool0588 isinfinite 0.00999999999 -> 0 +bool0589 isinfinite -0.00999999999 -> 0 +bool0590 isinfinite 0.0999999999 -> 0 +bool0591 isinfinite -0.0999999999 -> 0 +bool0592 isinfinite 0.999999999 -> 0 +bool0593 isinfinite -0.999999999 -> 0 +bool0594 isinfinite 9.99999999 -> 0 +bool0595 isinfinite -9.99999999 -> 0 +bool0596 isinfinite 99.9999999 -> 0 +bool0597 isinfinite -99.9999999 -> 0 +bool0598 isinfinite 999.999999 -> 0 +bool0599 isinfinite -999.999999 -> 0 +bool0600 isinfinite 9999.99999 -> 0 +bool0601 isinfinite -9999.99999 -> 0 +bool0602 isinfinite 9999999.99 -> 0 +bool0603 isinfinite -9999999.99 -> 0 +bool0604 isinfinite 9.99999999E+100 -> 0 +bool0605 isinfinite -9.99999999E+100 -> 0 +bool0606 isinfinite 9.99999999E+990 -> 0 +bool0607 isinfinite -9.99999999E+990 -> 0 +bool0608 isinfinite 9.99999999E+991 -> 0 +bool0609 isinfinite -9.99999999E+991 -> 0 +bool0610 isinfinite 9.99999999E+992 -> 0 +bool0611 isinfinite -9.99999999E+992 -> 0 +bool0612 isinfinite 9.99999999E+998 -> 0 +bool0613 isinfinite -9.99999999E+998 -> 0 +bool0614 isinfinite 9.99999999E+999 -> 0 +bool0615 isinfinite -9.99999999E+999 -> 0 +bool0616 isinfinite 9.99999999E+1000 -> 0 +bool0617 isinfinite -9.99999999E+1000 -> 0 +bool0618 isinfinite 9.99999999E+2000 -> 0 +bool0619 isinfinite -9.99999999E+2000 -> 0 +bool0620 isinfinite Infinity -> 1 +bool0621 isinfinite -Infinity -> 1 +bool0622 isinfinite NaN -> 0 +bool0623 isinfinite -NaN -> 0 +bool0624 isinfinite NaN123 -> 0 +bool0625 isinfinite -NaN123 -> 0 +bool0626 isinfinite sNaN -> 0 +bool0627 isinfinite -sNaN -> 0 +bool0628 isinfinite sNaN123 -> 0 +bool0629 isinfinite -sNaN123 -> 0 +bool0630 isnan 0E-2000 -> 0 +bool0631 isnan -0E-2000 -> 0 +bool0632 isnan 0E-1008 -> 0 +bool0633 isnan -0E-1008 -> 0 +bool0634 isnan 0E-1007 -> 0 +bool0635 isnan -0E-1007 -> 0 +bool0636 isnan 0E-1006 -> 0 +bool0637 isnan -0E-1006 -> 0 +bool0638 isnan 0E-1000 -> 0 +bool0639 isnan -0E-1000 -> 0 +bool0640 isnan 0E-999 -> 0 +bool0641 isnan -0E-999 -> 0 +bool0642 isnan 0E-998 -> 0 +bool0643 isnan -0E-998 -> 0 +bool0644 isnan 0E-100 -> 0 +bool0645 isnan -0E-100 -> 0 +bool0646 isnan 0.000000 -> 0 +bool0647 isnan -0.000000 -> 0 +bool0648 isnan 0.000 -> 0 +bool0649 isnan -0.000 -> 0 +bool0650 isnan 0.00 -> 0 +bool0651 isnan -0.00 -> 0 +bool0652 isnan 0.0 -> 0 +bool0653 isnan -0.0 -> 0 +bool0654 isnan 0 -> 0 +bool0655 isnan -0 -> 0 +bool0656 isnan 0E+1 -> 0 +bool0657 isnan -0E+1 -> 0 +bool0658 isnan 0E+2 -> 0 +bool0659 isnan -0E+2 -> 0 +bool0660 isnan 0E+3 -> 0 +bool0661 isnan -0E+3 -> 0 +bool0662 isnan 0E+6 -> 0 +bool0663 isnan -0E+6 -> 0 +bool0664 isnan 0E+100 -> 0 +bool0665 isnan -0E+100 -> 0 +bool0666 isnan 0E+990 -> 0 +bool0667 isnan -0E+990 -> 0 +bool0668 isnan 0E+991 -> 0 +bool0669 isnan -0E+991 -> 0 +bool0670 isnan 0E+992 -> 0 +bool0671 isnan -0E+992 -> 0 +bool0672 isnan 0E+998 -> 0 +bool0673 isnan -0E+998 -> 0 +bool0674 isnan 0E+999 -> 0 +bool0675 isnan -0E+999 -> 0 +bool0676 isnan 0E+1000 -> 0 +bool0677 isnan -0E+1000 -> 0 +bool0678 isnan 0E+2000 -> 0 +bool0679 isnan -0E+2000 -> 0 +bool0680 isnan 1E-2000 -> 0 +bool0681 isnan -1E-2000 -> 0 +bool0682 isnan 1E-1008 -> 0 +bool0683 isnan -1E-1008 -> 0 +bool0684 isnan 1E-1007 -> 0 +bool0685 isnan -1E-1007 -> 0 +bool0686 isnan 1E-1006 -> 0 +bool0687 isnan -1E-1006 -> 0 +bool0688 isnan 1E-1000 -> 0 +bool0689 isnan -1E-1000 -> 0 +bool0690 isnan 1E-999 -> 0 +bool0691 isnan -1E-999 -> 0 +bool0692 isnan 1E-998 -> 0 +bool0693 isnan -1E-998 -> 0 +bool0694 isnan 1E-100 -> 0 +bool0695 isnan -1E-100 -> 0 +bool0696 isnan 0.000001 -> 0 +bool0697 isnan -0.000001 -> 0 +bool0698 isnan 0.001 -> 0 +bool0699 isnan -0.001 -> 0 +bool0700 isnan 0.01 -> 0 +bool0701 isnan -0.01 -> 0 +bool0702 isnan 0.1 -> 0 +bool0703 isnan -0.1 -> 0 +bool0704 isnan 1 -> 0 +bool0705 isnan -1 -> 0 +bool0706 isnan 1E+1 -> 0 +bool0707 isnan -1E+1 -> 0 +bool0708 isnan 1E+2 -> 0 +bool0709 isnan -1E+2 -> 0 +bool0710 isnan 1E+3 -> 0 +bool0711 isnan -1E+3 -> 0 +bool0712 isnan 1E+6 -> 0 +bool0713 isnan -1E+6 -> 0 +bool0714 isnan 1E+100 -> 0 +bool0715 isnan -1E+100 -> 0 +bool0716 isnan 1E+990 -> 0 +bool0717 isnan -1E+990 -> 0 +bool0718 isnan 1E+991 -> 0 +bool0719 isnan -1E+991 -> 0 +bool0720 isnan 1E+992 -> 0 +bool0721 isnan -1E+992 -> 0 +bool0722 isnan 1E+998 -> 0 +bool0723 isnan -1E+998 -> 0 +bool0724 isnan 1E+999 -> 0 +bool0725 isnan -1E+999 -> 0 +bool0726 isnan 1E+1000 -> 0 +bool0727 isnan -1E+1000 -> 0 +bool0728 isnan 1E+2000 -> 0 +bool0729 isnan -1E+2000 -> 0 +bool0730 isnan 9E-2000 -> 0 +bool0731 isnan -9E-2000 -> 0 +bool0732 isnan 9E-1008 -> 0 +bool0733 isnan -9E-1008 -> 0 +bool0734 isnan 9E-1007 -> 0 +bool0735 isnan -9E-1007 -> 0 +bool0736 isnan 9E-1006 -> 0 +bool0737 isnan -9E-1006 -> 0 +bool0738 isnan 9E-1000 -> 0 +bool0739 isnan -9E-1000 -> 0 +bool0740 isnan 9E-999 -> 0 +bool0741 isnan -9E-999 -> 0 +bool0742 isnan 9E-998 -> 0 +bool0743 isnan -9E-998 -> 0 +bool0744 isnan 9E-100 -> 0 +bool0745 isnan -9E-100 -> 0 +bool0746 isnan 0.000009 -> 0 +bool0747 isnan -0.000009 -> 0 +bool0748 isnan 0.009 -> 0 +bool0749 isnan -0.009 -> 0 +bool0750 isnan 0.09 -> 0 +bool0751 isnan -0.09 -> 0 +bool0752 isnan 0.9 -> 0 +bool0753 isnan -0.9 -> 0 +bool0754 isnan 9 -> 0 +bool0755 isnan -9 -> 0 +bool0756 isnan 9E+1 -> 0 +bool0757 isnan -9E+1 -> 0 +bool0758 isnan 9E+2 -> 0 +bool0759 isnan -9E+2 -> 0 +bool0760 isnan 9E+3 -> 0 +bool0761 isnan -9E+3 -> 0 +bool0762 isnan 9E+6 -> 0 +bool0763 isnan -9E+6 -> 0 +bool0764 isnan 9E+100 -> 0 +bool0765 isnan -9E+100 -> 0 +bool0766 isnan 9E+990 -> 0 +bool0767 isnan -9E+990 -> 0 +bool0768 isnan 9E+991 -> 0 +bool0769 isnan -9E+991 -> 0 +bool0770 isnan 9E+992 -> 0 +bool0771 isnan -9E+992 -> 0 +bool0772 isnan 9E+998 -> 0 +bool0773 isnan -9E+998 -> 0 +bool0774 isnan 9E+999 -> 0 +bool0775 isnan -9E+999 -> 0 +bool0776 isnan 9E+1000 -> 0 +bool0777 isnan -9E+1000 -> 0 +bool0778 isnan 9E+2000 -> 0 +bool0779 isnan -9E+2000 -> 0 +bool0780 isnan 9.99999999E-2000 -> 0 +bool0781 isnan -9.99999999E-2000 -> 0 +bool0782 isnan 9.99999999E-1008 -> 0 +bool0783 isnan -9.99999999E-1008 -> 0 +bool0784 isnan 9.99999999E-1007 -> 0 +bool0785 isnan -9.99999999E-1007 -> 0 +bool0786 isnan 9.99999999E-1006 -> 0 +bool0787 isnan -9.99999999E-1006 -> 0 +bool0788 isnan 9.99999999E-1000 -> 0 +bool0789 isnan -9.99999999E-1000 -> 0 +bool0790 isnan 9.99999999E-999 -> 0 +bool0791 isnan -9.99999999E-999 -> 0 +bool0792 isnan 9.99999999E-998 -> 0 +bool0793 isnan -9.99999999E-998 -> 0 +bool0794 isnan 9.99999999E-100 -> 0 +bool0795 isnan -9.99999999E-100 -> 0 +bool0796 isnan 0.00000999999999 -> 0 +bool0797 isnan -0.00000999999999 -> 0 +bool0798 isnan 0.00999999999 -> 0 +bool0799 isnan -0.00999999999 -> 0 +bool0800 isnan 0.0999999999 -> 0 +bool0801 isnan -0.0999999999 -> 0 +bool0802 isnan 0.999999999 -> 0 +bool0803 isnan -0.999999999 -> 0 +bool0804 isnan 9.99999999 -> 0 +bool0805 isnan -9.99999999 -> 0 +bool0806 isnan 99.9999999 -> 0 +bool0807 isnan -99.9999999 -> 0 +bool0808 isnan 999.999999 -> 0 +bool0809 isnan -999.999999 -> 0 +bool0810 isnan 9999.99999 -> 0 +bool0811 isnan -9999.99999 -> 0 +bool0812 isnan 9999999.99 -> 0 +bool0813 isnan -9999999.99 -> 0 +bool0814 isnan 9.99999999E+100 -> 0 +bool0815 isnan -9.99999999E+100 -> 0 +bool0816 isnan 9.99999999E+990 -> 0 +bool0817 isnan -9.99999999E+990 -> 0 +bool0818 isnan 9.99999999E+991 -> 0 +bool0819 isnan -9.99999999E+991 -> 0 +bool0820 isnan 9.99999999E+992 -> 0 +bool0821 isnan -9.99999999E+992 -> 0 +bool0822 isnan 9.99999999E+998 -> 0 +bool0823 isnan -9.99999999E+998 -> 0 +bool0824 isnan 9.99999999E+999 -> 0 +bool0825 isnan -9.99999999E+999 -> 0 +bool0826 isnan 9.99999999E+1000 -> 0 +bool0827 isnan -9.99999999E+1000 -> 0 +bool0828 isnan 9.99999999E+2000 -> 0 +bool0829 isnan -9.99999999E+2000 -> 0 +bool0830 isnan Infinity -> 0 +bool0831 isnan -Infinity -> 0 +bool0832 isnan NaN -> 1 +bool0833 isnan -NaN -> 1 +bool0834 isnan NaN123 -> 1 +bool0835 isnan -NaN123 -> 1 +bool0836 isnan sNaN -> 1 +bool0837 isnan -sNaN -> 1 +bool0838 isnan sNaN123 -> 1 +bool0839 isnan -sNaN123 -> 1 +bool0840 isnormal 0E-2000 -> 0 +bool0841 isnormal -0E-2000 -> 0 +bool0842 isnormal 0E-1008 -> 0 +bool0843 isnormal -0E-1008 -> 0 +bool0844 isnormal 0E-1007 -> 0 +bool0845 isnormal -0E-1007 -> 0 +bool0846 isnormal 0E-1006 -> 0 +bool0847 isnormal -0E-1006 -> 0 +bool0848 isnormal 0E-1000 -> 0 +bool0849 isnormal -0E-1000 -> 0 +bool0850 isnormal 0E-999 -> 0 +bool0851 isnormal -0E-999 -> 0 +bool0852 isnormal 0E-998 -> 0 +bool0853 isnormal -0E-998 -> 0 +bool0854 isnormal 0E-100 -> 0 +bool0855 isnormal -0E-100 -> 0 +bool0856 isnormal 0.000000 -> 0 +bool0857 isnormal -0.000000 -> 0 +bool0858 isnormal 0.000 -> 0 +bool0859 isnormal -0.000 -> 0 +bool0860 isnormal 0.00 -> 0 +bool0861 isnormal -0.00 -> 0 +bool0862 isnormal 0.0 -> 0 +bool0863 isnormal -0.0 -> 0 +bool0864 isnormal 0 -> 0 +bool0865 isnormal -0 -> 0 +bool0866 isnormal 0E+1 -> 0 +bool0867 isnormal -0E+1 -> 0 +bool0868 isnormal 0E+2 -> 0 +bool0869 isnormal -0E+2 -> 0 +bool0870 isnormal 0E+3 -> 0 +bool0871 isnormal -0E+3 -> 0 +bool0872 isnormal 0E+6 -> 0 +bool0873 isnormal -0E+6 -> 0 +bool0874 isnormal 0E+100 -> 0 +bool0875 isnormal -0E+100 -> 0 +bool0876 isnormal 0E+990 -> 0 +bool0877 isnormal -0E+990 -> 0 +bool0878 isnormal 0E+991 -> 0 +bool0879 isnormal -0E+991 -> 0 +bool0880 isnormal 0E+992 -> 0 +bool0881 isnormal -0E+992 -> 0 +bool0882 isnormal 0E+998 -> 0 +bool0883 isnormal -0E+998 -> 0 +bool0884 isnormal 0E+999 -> 0 +bool0885 isnormal -0E+999 -> 0 +bool0886 isnormal 0E+1000 -> 0 +bool0887 isnormal -0E+1000 -> 0 +bool0888 isnormal 0E+2000 -> 0 +bool0889 isnormal -0E+2000 -> 0 +bool0890 isnormal 1E-2000 -> 0 +bool0891 isnormal -1E-2000 -> 0 +bool0892 isnormal 1E-1008 -> 0 +bool0893 isnormal -1E-1008 -> 0 +bool0894 isnormal 1E-1007 -> 0 +bool0895 isnormal -1E-1007 -> 0 +bool0896 isnormal 1E-1006 -> 0 +bool0897 isnormal -1E-1006 -> 0 +bool0898 isnormal 1E-1000 -> 0 +bool0899 isnormal -1E-1000 -> 0 +bool0900 isnormal 1E-999 -> 1 +bool0901 isnormal -1E-999 -> 1 +bool0902 isnormal 1E-998 -> 1 +bool0903 isnormal -1E-998 -> 1 +bool0904 isnormal 1E-100 -> 1 +bool0905 isnormal -1E-100 -> 1 +bool0906 isnormal 0.000001 -> 1 +bool0907 isnormal -0.000001 -> 1 +bool0908 isnormal 0.001 -> 1 +bool0909 isnormal -0.001 -> 1 +bool0910 isnormal 0.01 -> 1 +bool0911 isnormal -0.01 -> 1 +bool0912 isnormal 0.1 -> 1 +bool0913 isnormal -0.1 -> 1 +bool0914 isnormal 1 -> 1 +bool0915 isnormal -1 -> 1 +bool0916 isnormal 1E+1 -> 1 +bool0917 isnormal -1E+1 -> 1 +bool0918 isnormal 1E+2 -> 1 +bool0919 isnormal -1E+2 -> 1 +bool0920 isnormal 1E+3 -> 1 +bool0921 isnormal -1E+3 -> 1 +bool0922 isnormal 1E+6 -> 1 +bool0923 isnormal -1E+6 -> 1 +bool0924 isnormal 1E+100 -> 1 +bool0925 isnormal -1E+100 -> 1 +bool0926 isnormal 1E+990 -> 1 +bool0927 isnormal -1E+990 -> 1 +bool0928 isnormal 1E+991 -> 1 +bool0929 isnormal -1E+991 -> 1 +bool0930 isnormal 1E+992 -> 1 +bool0931 isnormal -1E+992 -> 1 +bool0932 isnormal 1E+998 -> 1 +bool0933 isnormal -1E+998 -> 1 +bool0934 isnormal 1E+999 -> 1 +bool0935 isnormal -1E+999 -> 1 +bool0936 isnormal 1E+1000 -> 0 +bool0937 isnormal -1E+1000 -> 0 +bool0938 isnormal 1E+2000 -> 0 +bool0939 isnormal -1E+2000 -> 0 +bool0940 isnormal 9E-2000 -> 0 +bool0941 isnormal -9E-2000 -> 0 +bool0942 isnormal 9E-1008 -> 0 +bool0943 isnormal -9E-1008 -> 0 +bool0944 isnormal 9E-1007 -> 0 +bool0945 isnormal -9E-1007 -> 0 +bool0946 isnormal 9E-1006 -> 0 +bool0947 isnormal -9E-1006 -> 0 +bool0948 isnormal 9E-1000 -> 0 +bool0949 isnormal -9E-1000 -> 0 +bool0950 isnormal 9E-999 -> 1 +bool0951 isnormal -9E-999 -> 1 +bool0952 isnormal 9E-998 -> 1 +bool0953 isnormal -9E-998 -> 1 +bool0954 isnormal 9E-100 -> 1 +bool0955 isnormal -9E-100 -> 1 +bool0956 isnormal 0.000009 -> 1 +bool0957 isnormal -0.000009 -> 1 +bool0958 isnormal 0.009 -> 1 +bool0959 isnormal -0.009 -> 1 +bool0960 isnormal 0.09 -> 1 +bool0961 isnormal -0.09 -> 1 +bool0962 isnormal 0.9 -> 1 +bool0963 isnormal -0.9 -> 1 +bool0964 isnormal 9 -> 1 +bool0965 isnormal -9 -> 1 +bool0966 isnormal 9E+1 -> 1 +bool0967 isnormal -9E+1 -> 1 +bool0968 isnormal 9E+2 -> 1 +bool0969 isnormal -9E+2 -> 1 +bool0970 isnormal 9E+3 -> 1 +bool0971 isnormal -9E+3 -> 1 +bool0972 isnormal 9E+6 -> 1 +bool0973 isnormal -9E+6 -> 1 +bool0974 isnormal 9E+100 -> 1 +bool0975 isnormal -9E+100 -> 1 +bool0976 isnormal 9E+990 -> 1 +bool0977 isnormal -9E+990 -> 1 +bool0978 isnormal 9E+991 -> 1 +bool0979 isnormal -9E+991 -> 1 +bool0980 isnormal 9E+992 -> 1 +bool0981 isnormal -9E+992 -> 1 +bool0982 isnormal 9E+998 -> 1 +bool0983 isnormal -9E+998 -> 1 +bool0984 isnormal 9E+999 -> 1 +bool0985 isnormal -9E+999 -> 1 +bool0986 isnormal 9E+1000 -> 0 +bool0987 isnormal -9E+1000 -> 0 +bool0988 isnormal 9E+2000 -> 0 +bool0989 isnormal -9E+2000 -> 0 +bool0990 isnormal 9.99999999E-2000 -> 0 +bool0991 isnormal -9.99999999E-2000 -> 0 +bool0992 isnormal 9.99999999E-1008 -> 0 +bool0993 isnormal -9.99999999E-1008 -> 0 +bool0994 isnormal 9.99999999E-1007 -> 0 +bool0995 isnormal -9.99999999E-1007 -> 0 +bool0996 isnormal 9.99999999E-1006 -> 0 +bool0997 isnormal -9.99999999E-1006 -> 0 +bool0998 isnormal 9.99999999E-1000 -> 0 +bool0999 isnormal -9.99999999E-1000 -> 0 +bool1000 isnormal 9.99999999E-999 -> 1 +bool1001 isnormal -9.99999999E-999 -> 1 +bool1002 isnormal 9.99999999E-998 -> 1 +bool1003 isnormal -9.99999999E-998 -> 1 +bool1004 isnormal 9.99999999E-100 -> 1 +bool1005 isnormal -9.99999999E-100 -> 1 +bool1006 isnormal 0.00000999999999 -> 1 +bool1007 isnormal -0.00000999999999 -> 1 +bool1008 isnormal 0.00999999999 -> 1 +bool1009 isnormal -0.00999999999 -> 1 +bool1010 isnormal 0.0999999999 -> 1 +bool1011 isnormal -0.0999999999 -> 1 +bool1012 isnormal 0.999999999 -> 1 +bool1013 isnormal -0.999999999 -> 1 +bool1014 isnormal 9.99999999 -> 1 +bool1015 isnormal -9.99999999 -> 1 +bool1016 isnormal 99.9999999 -> 1 +bool1017 isnormal -99.9999999 -> 1 +bool1018 isnormal 999.999999 -> 1 +bool1019 isnormal -999.999999 -> 1 +bool1020 isnormal 9999.99999 -> 1 +bool1021 isnormal -9999.99999 -> 1 +bool1022 isnormal 9999999.99 -> 1 +bool1023 isnormal -9999999.99 -> 1 +bool1024 isnormal 9.99999999E+100 -> 1 +bool1025 isnormal -9.99999999E+100 -> 1 +bool1026 isnormal 9.99999999E+990 -> 1 +bool1027 isnormal -9.99999999E+990 -> 1 +bool1028 isnormal 9.99999999E+991 -> 1 +bool1029 isnormal -9.99999999E+991 -> 1 +bool1030 isnormal 9.99999999E+992 -> 1 +bool1031 isnormal -9.99999999E+992 -> 1 +bool1032 isnormal 9.99999999E+998 -> 1 +bool1033 isnormal -9.99999999E+998 -> 1 +bool1034 isnormal 9.99999999E+999 -> 1 +bool1035 isnormal -9.99999999E+999 -> 1 +bool1036 isnormal 9.99999999E+1000 -> 0 +bool1037 isnormal -9.99999999E+1000 -> 0 +bool1038 isnormal 9.99999999E+2000 -> 0 +bool1039 isnormal -9.99999999E+2000 -> 0 +bool1040 isnormal Infinity -> 0 +bool1041 isnormal -Infinity -> 0 +bool1042 isnormal NaN -> 0 +bool1043 isnormal -NaN -> 0 +bool1044 isnormal NaN123 -> 0 +bool1045 isnormal -NaN123 -> 0 +bool1046 isnormal sNaN -> 0 +bool1047 isnormal -sNaN -> 0 +bool1048 isnormal sNaN123 -> 0 +bool1049 isnormal -sNaN123 -> 0 +bool1050 isqnan 0E-2000 -> 0 +bool1051 isqnan -0E-2000 -> 0 +bool1052 isqnan 0E-1008 -> 0 +bool1053 isqnan -0E-1008 -> 0 +bool1054 isqnan 0E-1007 -> 0 +bool1055 isqnan -0E-1007 -> 0 +bool1056 isqnan 0E-1006 -> 0 +bool1057 isqnan -0E-1006 -> 0 +bool1058 isqnan 0E-1000 -> 0 +bool1059 isqnan -0E-1000 -> 0 +bool1060 isqnan 0E-999 -> 0 +bool1061 isqnan -0E-999 -> 0 +bool1062 isqnan 0E-998 -> 0 +bool1063 isqnan -0E-998 -> 0 +bool1064 isqnan 0E-100 -> 0 +bool1065 isqnan -0E-100 -> 0 +bool1066 isqnan 0.000000 -> 0 +bool1067 isqnan -0.000000 -> 0 +bool1068 isqnan 0.000 -> 0 +bool1069 isqnan -0.000 -> 0 +bool1070 isqnan 0.00 -> 0 +bool1071 isqnan -0.00 -> 0 +bool1072 isqnan 0.0 -> 0 +bool1073 isqnan -0.0 -> 0 +bool1074 isqnan 0 -> 0 +bool1075 isqnan -0 -> 0 +bool1076 isqnan 0E+1 -> 0 +bool1077 isqnan -0E+1 -> 0 +bool1078 isqnan 0E+2 -> 0 +bool1079 isqnan -0E+2 -> 0 +bool1080 isqnan 0E+3 -> 0 +bool1081 isqnan -0E+3 -> 0 +bool1082 isqnan 0E+6 -> 0 +bool1083 isqnan -0E+6 -> 0 +bool1084 isqnan 0E+100 -> 0 +bool1085 isqnan -0E+100 -> 0 +bool1086 isqnan 0E+990 -> 0 +bool1087 isqnan -0E+990 -> 0 +bool1088 isqnan 0E+991 -> 0 +bool1089 isqnan -0E+991 -> 0 +bool1090 isqnan 0E+992 -> 0 +bool1091 isqnan -0E+992 -> 0 +bool1092 isqnan 0E+998 -> 0 +bool1093 isqnan -0E+998 -> 0 +bool1094 isqnan 0E+999 -> 0 +bool1095 isqnan -0E+999 -> 0 +bool1096 isqnan 0E+1000 -> 0 +bool1097 isqnan -0E+1000 -> 0 +bool1098 isqnan 0E+2000 -> 0 +bool1099 isqnan -0E+2000 -> 0 +bool1100 isqnan 1E-2000 -> 0 +bool1101 isqnan -1E-2000 -> 0 +bool1102 isqnan 1E-1008 -> 0 +bool1103 isqnan -1E-1008 -> 0 +bool1104 isqnan 1E-1007 -> 0 +bool1105 isqnan -1E-1007 -> 0 +bool1106 isqnan 1E-1006 -> 0 +bool1107 isqnan -1E-1006 -> 0 +bool1108 isqnan 1E-1000 -> 0 +bool1109 isqnan -1E-1000 -> 0 +bool1110 isqnan 1E-999 -> 0 +bool1111 isqnan -1E-999 -> 0 +bool1112 isqnan 1E-998 -> 0 +bool1113 isqnan -1E-998 -> 0 +bool1114 isqnan 1E-100 -> 0 +bool1115 isqnan -1E-100 -> 0 +bool1116 isqnan 0.000001 -> 0 +bool1117 isqnan -0.000001 -> 0 +bool1118 isqnan 0.001 -> 0 +bool1119 isqnan -0.001 -> 0 +bool1120 isqnan 0.01 -> 0 +bool1121 isqnan -0.01 -> 0 +bool1122 isqnan 0.1 -> 0 +bool1123 isqnan -0.1 -> 0 +bool1124 isqnan 1 -> 0 +bool1125 isqnan -1 -> 0 +bool1126 isqnan 1E+1 -> 0 +bool1127 isqnan -1E+1 -> 0 +bool1128 isqnan 1E+2 -> 0 +bool1129 isqnan -1E+2 -> 0 +bool1130 isqnan 1E+3 -> 0 +bool1131 isqnan -1E+3 -> 0 +bool1132 isqnan 1E+6 -> 0 +bool1133 isqnan -1E+6 -> 0 +bool1134 isqnan 1E+100 -> 0 +bool1135 isqnan -1E+100 -> 0 +bool1136 isqnan 1E+990 -> 0 +bool1137 isqnan -1E+990 -> 0 +bool1138 isqnan 1E+991 -> 0 +bool1139 isqnan -1E+991 -> 0 +bool1140 isqnan 1E+992 -> 0 +bool1141 isqnan -1E+992 -> 0 +bool1142 isqnan 1E+998 -> 0 +bool1143 isqnan -1E+998 -> 0 +bool1144 isqnan 1E+999 -> 0 +bool1145 isqnan -1E+999 -> 0 +bool1146 isqnan 1E+1000 -> 0 +bool1147 isqnan -1E+1000 -> 0 +bool1148 isqnan 1E+2000 -> 0 +bool1149 isqnan -1E+2000 -> 0 +bool1150 isqnan 9E-2000 -> 0 +bool1151 isqnan -9E-2000 -> 0 +bool1152 isqnan 9E-1008 -> 0 +bool1153 isqnan -9E-1008 -> 0 +bool1154 isqnan 9E-1007 -> 0 +bool1155 isqnan -9E-1007 -> 0 +bool1156 isqnan 9E-1006 -> 0 +bool1157 isqnan -9E-1006 -> 0 +bool1158 isqnan 9E-1000 -> 0 +bool1159 isqnan -9E-1000 -> 0 +bool1160 isqnan 9E-999 -> 0 +bool1161 isqnan -9E-999 -> 0 +bool1162 isqnan 9E-998 -> 0 +bool1163 isqnan -9E-998 -> 0 +bool1164 isqnan 9E-100 -> 0 +bool1165 isqnan -9E-100 -> 0 +bool1166 isqnan 0.000009 -> 0 +bool1167 isqnan -0.000009 -> 0 +bool1168 isqnan 0.009 -> 0 +bool1169 isqnan -0.009 -> 0 +bool1170 isqnan 0.09 -> 0 +bool1171 isqnan -0.09 -> 0 +bool1172 isqnan 0.9 -> 0 +bool1173 isqnan -0.9 -> 0 +bool1174 isqnan 9 -> 0 +bool1175 isqnan -9 -> 0 +bool1176 isqnan 9E+1 -> 0 +bool1177 isqnan -9E+1 -> 0 +bool1178 isqnan 9E+2 -> 0 +bool1179 isqnan -9E+2 -> 0 +bool1180 isqnan 9E+3 -> 0 +bool1181 isqnan -9E+3 -> 0 +bool1182 isqnan 9E+6 -> 0 +bool1183 isqnan -9E+6 -> 0 +bool1184 isqnan 9E+100 -> 0 +bool1185 isqnan -9E+100 -> 0 +bool1186 isqnan 9E+990 -> 0 +bool1187 isqnan -9E+990 -> 0 +bool1188 isqnan 9E+991 -> 0 +bool1189 isqnan -9E+991 -> 0 +bool1190 isqnan 9E+992 -> 0 +bool1191 isqnan -9E+992 -> 0 +bool1192 isqnan 9E+998 -> 0 +bool1193 isqnan -9E+998 -> 0 +bool1194 isqnan 9E+999 -> 0 +bool1195 isqnan -9E+999 -> 0 +bool1196 isqnan 9E+1000 -> 0 +bool1197 isqnan -9E+1000 -> 0 +bool1198 isqnan 9E+2000 -> 0 +bool1199 isqnan -9E+2000 -> 0 +bool1200 isqnan 9.99999999E-2000 -> 0 +bool1201 isqnan -9.99999999E-2000 -> 0 +bool1202 isqnan 9.99999999E-1008 -> 0 +bool1203 isqnan -9.99999999E-1008 -> 0 +bool1204 isqnan 9.99999999E-1007 -> 0 +bool1205 isqnan -9.99999999E-1007 -> 0 +bool1206 isqnan 9.99999999E-1006 -> 0 +bool1207 isqnan -9.99999999E-1006 -> 0 +bool1208 isqnan 9.99999999E-1000 -> 0 +bool1209 isqnan -9.99999999E-1000 -> 0 +bool1210 isqnan 9.99999999E-999 -> 0 +bool1211 isqnan -9.99999999E-999 -> 0 +bool1212 isqnan 9.99999999E-998 -> 0 +bool1213 isqnan -9.99999999E-998 -> 0 +bool1214 isqnan 9.99999999E-100 -> 0 +bool1215 isqnan -9.99999999E-100 -> 0 +bool1216 isqnan 0.00000999999999 -> 0 +bool1217 isqnan -0.00000999999999 -> 0 +bool1218 isqnan 0.00999999999 -> 0 +bool1219 isqnan -0.00999999999 -> 0 +bool1220 isqnan 0.0999999999 -> 0 +bool1221 isqnan -0.0999999999 -> 0 +bool1222 isqnan 0.999999999 -> 0 +bool1223 isqnan -0.999999999 -> 0 +bool1224 isqnan 9.99999999 -> 0 +bool1225 isqnan -9.99999999 -> 0 +bool1226 isqnan 99.9999999 -> 0 +bool1227 isqnan -99.9999999 -> 0 +bool1228 isqnan 999.999999 -> 0 +bool1229 isqnan -999.999999 -> 0 +bool1230 isqnan 9999.99999 -> 0 +bool1231 isqnan -9999.99999 -> 0 +bool1232 isqnan 9999999.99 -> 0 +bool1233 isqnan -9999999.99 -> 0 +bool1234 isqnan 9.99999999E+100 -> 0 +bool1235 isqnan -9.99999999E+100 -> 0 +bool1236 isqnan 9.99999999E+990 -> 0 +bool1237 isqnan -9.99999999E+990 -> 0 +bool1238 isqnan 9.99999999E+991 -> 0 +bool1239 isqnan -9.99999999E+991 -> 0 +bool1240 isqnan 9.99999999E+992 -> 0 +bool1241 isqnan -9.99999999E+992 -> 0 +bool1242 isqnan 9.99999999E+998 -> 0 +bool1243 isqnan -9.99999999E+998 -> 0 +bool1244 isqnan 9.99999999E+999 -> 0 +bool1245 isqnan -9.99999999E+999 -> 0 +bool1246 isqnan 9.99999999E+1000 -> 0 +bool1247 isqnan -9.99999999E+1000 -> 0 +bool1248 isqnan 9.99999999E+2000 -> 0 +bool1249 isqnan -9.99999999E+2000 -> 0 +bool1250 isqnan Infinity -> 0 +bool1251 isqnan -Infinity -> 0 +bool1252 isqnan NaN -> 1 +bool1253 isqnan -NaN -> 1 +bool1254 isqnan NaN123 -> 1 +bool1255 isqnan -NaN123 -> 1 +bool1256 isqnan sNaN -> 0 +bool1257 isqnan -sNaN -> 0 +bool1258 isqnan sNaN123 -> 0 +bool1259 isqnan -sNaN123 -> 0 +bool1260 issigned 0E-2000 -> 0 +bool1261 issigned -0E-2000 -> 1 +bool1262 issigned 0E-1008 -> 0 +bool1263 issigned -0E-1008 -> 1 +bool1264 issigned 0E-1007 -> 0 +bool1265 issigned -0E-1007 -> 1 +bool1266 issigned 0E-1006 -> 0 +bool1267 issigned -0E-1006 -> 1 +bool1268 issigned 0E-1000 -> 0 +bool1269 issigned -0E-1000 -> 1 +bool1270 issigned 0E-999 -> 0 +bool1271 issigned -0E-999 -> 1 +bool1272 issigned 0E-998 -> 0 +bool1273 issigned -0E-998 -> 1 +bool1274 issigned 0E-100 -> 0 +bool1275 issigned -0E-100 -> 1 +bool1276 issigned 0.000000 -> 0 +bool1277 issigned -0.000000 -> 1 +bool1278 issigned 0.000 -> 0 +bool1279 issigned -0.000 -> 1 +bool1280 issigned 0.00 -> 0 +bool1281 issigned -0.00 -> 1 +bool1282 issigned 0.0 -> 0 +bool1283 issigned -0.0 -> 1 +bool1284 issigned 0 -> 0 +bool1285 issigned -0 -> 1 +bool1286 issigned 0E+1 -> 0 +bool1287 issigned -0E+1 -> 1 +bool1288 issigned 0E+2 -> 0 +bool1289 issigned -0E+2 -> 1 +bool1290 issigned 0E+3 -> 0 +bool1291 issigned -0E+3 -> 1 +bool1292 issigned 0E+6 -> 0 +bool1293 issigned -0E+6 -> 1 +bool1294 issigned 0E+100 -> 0 +bool1295 issigned -0E+100 -> 1 +bool1296 issigned 0E+990 -> 0 +bool1297 issigned -0E+990 -> 1 +bool1298 issigned 0E+991 -> 0 +bool1299 issigned -0E+991 -> 1 +bool1300 issigned 0E+992 -> 0 +bool1301 issigned -0E+992 -> 1 +bool1302 issigned 0E+998 -> 0 +bool1303 issigned -0E+998 -> 1 +bool1304 issigned 0E+999 -> 0 +bool1305 issigned -0E+999 -> 1 +bool1306 issigned 0E+1000 -> 0 +bool1307 issigned -0E+1000 -> 1 +bool1308 issigned 0E+2000 -> 0 +bool1309 issigned -0E+2000 -> 1 +bool1310 issigned 1E-2000 -> 0 +bool1311 issigned -1E-2000 -> 1 +bool1312 issigned 1E-1008 -> 0 +bool1313 issigned -1E-1008 -> 1 +bool1314 issigned 1E-1007 -> 0 +bool1315 issigned -1E-1007 -> 1 +bool1316 issigned 1E-1006 -> 0 +bool1317 issigned -1E-1006 -> 1 +bool1318 issigned 1E-1000 -> 0 +bool1319 issigned -1E-1000 -> 1 +bool1320 issigned 1E-999 -> 0 +bool1321 issigned -1E-999 -> 1 +bool1322 issigned 1E-998 -> 0 +bool1323 issigned -1E-998 -> 1 +bool1324 issigned 1E-100 -> 0 +bool1325 issigned -1E-100 -> 1 +bool1326 issigned 0.000001 -> 0 +bool1327 issigned -0.000001 -> 1 +bool1328 issigned 0.001 -> 0 +bool1329 issigned -0.001 -> 1 +bool1330 issigned 0.01 -> 0 +bool1331 issigned -0.01 -> 1 +bool1332 issigned 0.1 -> 0 +bool1333 issigned -0.1 -> 1 +bool1334 issigned 1 -> 0 +bool1335 issigned -1 -> 1 +bool1336 issigned 1E+1 -> 0 +bool1337 issigned -1E+1 -> 1 +bool1338 issigned 1E+2 -> 0 +bool1339 issigned -1E+2 -> 1 +bool1340 issigned 1E+3 -> 0 +bool1341 issigned -1E+3 -> 1 +bool1342 issigned 1E+6 -> 0 +bool1343 issigned -1E+6 -> 1 +bool1344 issigned 1E+100 -> 0 +bool1345 issigned -1E+100 -> 1 +bool1346 issigned 1E+990 -> 0 +bool1347 issigned -1E+990 -> 1 +bool1348 issigned 1E+991 -> 0 +bool1349 issigned -1E+991 -> 1 +bool1350 issigned 1E+992 -> 0 +bool1351 issigned -1E+992 -> 1 +bool1352 issigned 1E+998 -> 0 +bool1353 issigned -1E+998 -> 1 +bool1354 issigned 1E+999 -> 0 +bool1355 issigned -1E+999 -> 1 +bool1356 issigned 1E+1000 -> 0 +bool1357 issigned -1E+1000 -> 1 +bool1358 issigned 1E+2000 -> 0 +bool1359 issigned -1E+2000 -> 1 +bool1360 issigned 9E-2000 -> 0 +bool1361 issigned -9E-2000 -> 1 +bool1362 issigned 9E-1008 -> 0 +bool1363 issigned -9E-1008 -> 1 +bool1364 issigned 9E-1007 -> 0 +bool1365 issigned -9E-1007 -> 1 +bool1366 issigned 9E-1006 -> 0 +bool1367 issigned -9E-1006 -> 1 +bool1368 issigned 9E-1000 -> 0 +bool1369 issigned -9E-1000 -> 1 +bool1370 issigned 9E-999 -> 0 +bool1371 issigned -9E-999 -> 1 +bool1372 issigned 9E-998 -> 0 +bool1373 issigned -9E-998 -> 1 +bool1374 issigned 9E-100 -> 0 +bool1375 issigned -9E-100 -> 1 +bool1376 issigned 0.000009 -> 0 +bool1377 issigned -0.000009 -> 1 +bool1378 issigned 0.009 -> 0 +bool1379 issigned -0.009 -> 1 +bool1380 issigned 0.09 -> 0 +bool1381 issigned -0.09 -> 1 +bool1382 issigned 0.9 -> 0 +bool1383 issigned -0.9 -> 1 +bool1384 issigned 9 -> 0 +bool1385 issigned -9 -> 1 +bool1386 issigned 9E+1 -> 0 +bool1387 issigned -9E+1 -> 1 +bool1388 issigned 9E+2 -> 0 +bool1389 issigned -9E+2 -> 1 +bool1390 issigned 9E+3 -> 0 +bool1391 issigned -9E+3 -> 1 +bool1392 issigned 9E+6 -> 0 +bool1393 issigned -9E+6 -> 1 +bool1394 issigned 9E+100 -> 0 +bool1395 issigned -9E+100 -> 1 +bool1396 issigned 9E+990 -> 0 +bool1397 issigned -9E+990 -> 1 +bool1398 issigned 9E+991 -> 0 +bool1399 issigned -9E+991 -> 1 +bool1400 issigned 9E+992 -> 0 +bool1401 issigned -9E+992 -> 1 +bool1402 issigned 9E+998 -> 0 +bool1403 issigned -9E+998 -> 1 +bool1404 issigned 9E+999 -> 0 +bool1405 issigned -9E+999 -> 1 +bool1406 issigned 9E+1000 -> 0 +bool1407 issigned -9E+1000 -> 1 +bool1408 issigned 9E+2000 -> 0 +bool1409 issigned -9E+2000 -> 1 +bool1410 issigned 9.99999999E-2000 -> 0 +bool1411 issigned -9.99999999E-2000 -> 1 +bool1412 issigned 9.99999999E-1008 -> 0 +bool1413 issigned -9.99999999E-1008 -> 1 +bool1414 issigned 9.99999999E-1007 -> 0 +bool1415 issigned -9.99999999E-1007 -> 1 +bool1416 issigned 9.99999999E-1006 -> 0 +bool1417 issigned -9.99999999E-1006 -> 1 +bool1418 issigned 9.99999999E-1000 -> 0 +bool1419 issigned -9.99999999E-1000 -> 1 +bool1420 issigned 9.99999999E-999 -> 0 +bool1421 issigned -9.99999999E-999 -> 1 +bool1422 issigned 9.99999999E-998 -> 0 +bool1423 issigned -9.99999999E-998 -> 1 +bool1424 issigned 9.99999999E-100 -> 0 +bool1425 issigned -9.99999999E-100 -> 1 +bool1426 issigned 0.00000999999999 -> 0 +bool1427 issigned -0.00000999999999 -> 1 +bool1428 issigned 0.00999999999 -> 0 +bool1429 issigned -0.00999999999 -> 1 +bool1430 issigned 0.0999999999 -> 0 +bool1431 issigned -0.0999999999 -> 1 +bool1432 issigned 0.999999999 -> 0 +bool1433 issigned -0.999999999 -> 1 +bool1434 issigned 9.99999999 -> 0 +bool1435 issigned -9.99999999 -> 1 +bool1436 issigned 99.9999999 -> 0 +bool1437 issigned -99.9999999 -> 1 +bool1438 issigned 999.999999 -> 0 +bool1439 issigned -999.999999 -> 1 +bool1440 issigned 9999.99999 -> 0 +bool1441 issigned -9999.99999 -> 1 +bool1442 issigned 9999999.99 -> 0 +bool1443 issigned -9999999.99 -> 1 +bool1444 issigned 9.99999999E+100 -> 0 +bool1445 issigned -9.99999999E+100 -> 1 +bool1446 issigned 9.99999999E+990 -> 0 +bool1447 issigned -9.99999999E+990 -> 1 +bool1448 issigned 9.99999999E+991 -> 0 +bool1449 issigned -9.99999999E+991 -> 1 +bool1450 issigned 9.99999999E+992 -> 0 +bool1451 issigned -9.99999999E+992 -> 1 +bool1452 issigned 9.99999999E+998 -> 0 +bool1453 issigned -9.99999999E+998 -> 1 +bool1454 issigned 9.99999999E+999 -> 0 +bool1455 issigned -9.99999999E+999 -> 1 +bool1456 issigned 9.99999999E+1000 -> 0 +bool1457 issigned -9.99999999E+1000 -> 1 +bool1458 issigned 9.99999999E+2000 -> 0 +bool1459 issigned -9.99999999E+2000 -> 1 +bool1460 issigned Infinity -> 0 +bool1461 issigned -Infinity -> 1 +bool1462 issigned NaN -> 0 +bool1463 issigned -NaN -> 1 +bool1464 issigned NaN123 -> 0 +bool1465 issigned -NaN123 -> 1 +bool1466 issigned sNaN -> 0 +bool1467 issigned -sNaN -> 1 +bool1468 issigned sNaN123 -> 0 +bool1469 issigned -sNaN123 -> 1 +bool1470 issnan 0E-2000 -> 0 +bool1471 issnan -0E-2000 -> 0 +bool1472 issnan 0E-1008 -> 0 +bool1473 issnan -0E-1008 -> 0 +bool1474 issnan 0E-1007 -> 0 +bool1475 issnan -0E-1007 -> 0 +bool1476 issnan 0E-1006 -> 0 +bool1477 issnan -0E-1006 -> 0 +bool1478 issnan 0E-1000 -> 0 +bool1479 issnan -0E-1000 -> 0 +bool1480 issnan 0E-999 -> 0 +bool1481 issnan -0E-999 -> 0 +bool1482 issnan 0E-998 -> 0 +bool1483 issnan -0E-998 -> 0 +bool1484 issnan 0E-100 -> 0 +bool1485 issnan -0E-100 -> 0 +bool1486 issnan 0.000000 -> 0 +bool1487 issnan -0.000000 -> 0 +bool1488 issnan 0.000 -> 0 +bool1489 issnan -0.000 -> 0 +bool1490 issnan 0.00 -> 0 +bool1491 issnan -0.00 -> 0 +bool1492 issnan 0.0 -> 0 +bool1493 issnan -0.0 -> 0 +bool1494 issnan 0 -> 0 +bool1495 issnan -0 -> 0 +bool1496 issnan 0E+1 -> 0 +bool1497 issnan -0E+1 -> 0 +bool1498 issnan 0E+2 -> 0 +bool1499 issnan -0E+2 -> 0 +bool1500 issnan 0E+3 -> 0 +bool1501 issnan -0E+3 -> 0 +bool1502 issnan 0E+6 -> 0 +bool1503 issnan -0E+6 -> 0 +bool1504 issnan 0E+100 -> 0 +bool1505 issnan -0E+100 -> 0 +bool1506 issnan 0E+990 -> 0 +bool1507 issnan -0E+990 -> 0 +bool1508 issnan 0E+991 -> 0 +bool1509 issnan -0E+991 -> 0 +bool1510 issnan 0E+992 -> 0 +bool1511 issnan -0E+992 -> 0 +bool1512 issnan 0E+998 -> 0 +bool1513 issnan -0E+998 -> 0 +bool1514 issnan 0E+999 -> 0 +bool1515 issnan -0E+999 -> 0 +bool1516 issnan 0E+1000 -> 0 +bool1517 issnan -0E+1000 -> 0 +bool1518 issnan 0E+2000 -> 0 +bool1519 issnan -0E+2000 -> 0 +bool1520 issnan 1E-2000 -> 0 +bool1521 issnan -1E-2000 -> 0 +bool1522 issnan 1E-1008 -> 0 +bool1523 issnan -1E-1008 -> 0 +bool1524 issnan 1E-1007 -> 0 +bool1525 issnan -1E-1007 -> 0 +bool1526 issnan 1E-1006 -> 0 +bool1527 issnan -1E-1006 -> 0 +bool1528 issnan 1E-1000 -> 0 +bool1529 issnan -1E-1000 -> 0 +bool1530 issnan 1E-999 -> 0 +bool1531 issnan -1E-999 -> 0 +bool1532 issnan 1E-998 -> 0 +bool1533 issnan -1E-998 -> 0 +bool1534 issnan 1E-100 -> 0 +bool1535 issnan -1E-100 -> 0 +bool1536 issnan 0.000001 -> 0 +bool1537 issnan -0.000001 -> 0 +bool1538 issnan 0.001 -> 0 +bool1539 issnan -0.001 -> 0 +bool1540 issnan 0.01 -> 0 +bool1541 issnan -0.01 -> 0 +bool1542 issnan 0.1 -> 0 +bool1543 issnan -0.1 -> 0 +bool1544 issnan 1 -> 0 +bool1545 issnan -1 -> 0 +bool1546 issnan 1E+1 -> 0 +bool1547 issnan -1E+1 -> 0 +bool1548 issnan 1E+2 -> 0 +bool1549 issnan -1E+2 -> 0 +bool1550 issnan 1E+3 -> 0 +bool1551 issnan -1E+3 -> 0 +bool1552 issnan 1E+6 -> 0 +bool1553 issnan -1E+6 -> 0 +bool1554 issnan 1E+100 -> 0 +bool1555 issnan -1E+100 -> 0 +bool1556 issnan 1E+990 -> 0 +bool1557 issnan -1E+990 -> 0 +bool1558 issnan 1E+991 -> 0 +bool1559 issnan -1E+991 -> 0 +bool1560 issnan 1E+992 -> 0 +bool1561 issnan -1E+992 -> 0 +bool1562 issnan 1E+998 -> 0 +bool1563 issnan -1E+998 -> 0 +bool1564 issnan 1E+999 -> 0 +bool1565 issnan -1E+999 -> 0 +bool1566 issnan 1E+1000 -> 0 +bool1567 issnan -1E+1000 -> 0 +bool1568 issnan 1E+2000 -> 0 +bool1569 issnan -1E+2000 -> 0 +bool1570 issnan 9E-2000 -> 0 +bool1571 issnan -9E-2000 -> 0 +bool1572 issnan 9E-1008 -> 0 +bool1573 issnan -9E-1008 -> 0 +bool1574 issnan 9E-1007 -> 0 +bool1575 issnan -9E-1007 -> 0 +bool1576 issnan 9E-1006 -> 0 +bool1577 issnan -9E-1006 -> 0 +bool1578 issnan 9E-1000 -> 0 +bool1579 issnan -9E-1000 -> 0 +bool1580 issnan 9E-999 -> 0 +bool1581 issnan -9E-999 -> 0 +bool1582 issnan 9E-998 -> 0 +bool1583 issnan -9E-998 -> 0 +bool1584 issnan 9E-100 -> 0 +bool1585 issnan -9E-100 -> 0 +bool1586 issnan 0.000009 -> 0 +bool1587 issnan -0.000009 -> 0 +bool1588 issnan 0.009 -> 0 +bool1589 issnan -0.009 -> 0 +bool1590 issnan 0.09 -> 0 +bool1591 issnan -0.09 -> 0 +bool1592 issnan 0.9 -> 0 +bool1593 issnan -0.9 -> 0 +bool1594 issnan 9 -> 0 +bool1595 issnan -9 -> 0 +bool1596 issnan 9E+1 -> 0 +bool1597 issnan -9E+1 -> 0 +bool1598 issnan 9E+2 -> 0 +bool1599 issnan -9E+2 -> 0 +bool1600 issnan 9E+3 -> 0 +bool1601 issnan -9E+3 -> 0 +bool1602 issnan 9E+6 -> 0 +bool1603 issnan -9E+6 -> 0 +bool1604 issnan 9E+100 -> 0 +bool1605 issnan -9E+100 -> 0 +bool1606 issnan 9E+990 -> 0 +bool1607 issnan -9E+990 -> 0 +bool1608 issnan 9E+991 -> 0 +bool1609 issnan -9E+991 -> 0 +bool1610 issnan 9E+992 -> 0 +bool1611 issnan -9E+992 -> 0 +bool1612 issnan 9E+998 -> 0 +bool1613 issnan -9E+998 -> 0 +bool1614 issnan 9E+999 -> 0 +bool1615 issnan -9E+999 -> 0 +bool1616 issnan 9E+1000 -> 0 +bool1617 issnan -9E+1000 -> 0 +bool1618 issnan 9E+2000 -> 0 +bool1619 issnan -9E+2000 -> 0 +bool1620 issnan 9.99999999E-2000 -> 0 +bool1621 issnan -9.99999999E-2000 -> 0 +bool1622 issnan 9.99999999E-1008 -> 0 +bool1623 issnan -9.99999999E-1008 -> 0 +bool1624 issnan 9.99999999E-1007 -> 0 +bool1625 issnan -9.99999999E-1007 -> 0 +bool1626 issnan 9.99999999E-1006 -> 0 +bool1627 issnan -9.99999999E-1006 -> 0 +bool1628 issnan 9.99999999E-1000 -> 0 +bool1629 issnan -9.99999999E-1000 -> 0 +bool1630 issnan 9.99999999E-999 -> 0 +bool1631 issnan -9.99999999E-999 -> 0 +bool1632 issnan 9.99999999E-998 -> 0 +bool1633 issnan -9.99999999E-998 -> 0 +bool1634 issnan 9.99999999E-100 -> 0 +bool1635 issnan -9.99999999E-100 -> 0 +bool1636 issnan 0.00000999999999 -> 0 +bool1637 issnan -0.00000999999999 -> 0 +bool1638 issnan 0.00999999999 -> 0 +bool1639 issnan -0.00999999999 -> 0 +bool1640 issnan 0.0999999999 -> 0 +bool1641 issnan -0.0999999999 -> 0 +bool1642 issnan 0.999999999 -> 0 +bool1643 issnan -0.999999999 -> 0 +bool1644 issnan 9.99999999 -> 0 +bool1645 issnan -9.99999999 -> 0 +bool1646 issnan 99.9999999 -> 0 +bool1647 issnan -99.9999999 -> 0 +bool1648 issnan 999.999999 -> 0 +bool1649 issnan -999.999999 -> 0 +bool1650 issnan 9999.99999 -> 0 +bool1651 issnan -9999.99999 -> 0 +bool1652 issnan 9999999.99 -> 0 +bool1653 issnan -9999999.99 -> 0 +bool1654 issnan 9.99999999E+100 -> 0 +bool1655 issnan -9.99999999E+100 -> 0 +bool1656 issnan 9.99999999E+990 -> 0 +bool1657 issnan -9.99999999E+990 -> 0 +bool1658 issnan 9.99999999E+991 -> 0 +bool1659 issnan -9.99999999E+991 -> 0 +bool1660 issnan 9.99999999E+992 -> 0 +bool1661 issnan -9.99999999E+992 -> 0 +bool1662 issnan 9.99999999E+998 -> 0 +bool1663 issnan -9.99999999E+998 -> 0 +bool1664 issnan 9.99999999E+999 -> 0 +bool1665 issnan -9.99999999E+999 -> 0 +bool1666 issnan 9.99999999E+1000 -> 0 +bool1667 issnan -9.99999999E+1000 -> 0 +bool1668 issnan 9.99999999E+2000 -> 0 +bool1669 issnan -9.99999999E+2000 -> 0 +bool1670 issnan Infinity -> 0 +bool1671 issnan -Infinity -> 0 +bool1672 issnan NaN -> 0 +bool1673 issnan -NaN -> 0 +bool1674 issnan NaN123 -> 0 +bool1675 issnan -NaN123 -> 0 +bool1676 issnan sNaN -> 1 +bool1677 issnan -sNaN -> 1 +bool1678 issnan sNaN123 -> 1 +bool1679 issnan -sNaN123 -> 1 +bool1680 issubnormal 0E-2000 -> 0 +bool1681 issubnormal -0E-2000 -> 0 +bool1682 issubnormal 0E-1008 -> 0 +bool1683 issubnormal -0E-1008 -> 0 +bool1684 issubnormal 0E-1007 -> 0 +bool1685 issubnormal -0E-1007 -> 0 +bool1686 issubnormal 0E-1006 -> 0 +bool1687 issubnormal -0E-1006 -> 0 +bool1688 issubnormal 0E-1000 -> 0 +bool1689 issubnormal -0E-1000 -> 0 +bool1690 issubnormal 0E-999 -> 0 +bool1691 issubnormal -0E-999 -> 0 +bool1692 issubnormal 0E-998 -> 0 +bool1693 issubnormal -0E-998 -> 0 +bool1694 issubnormal 0E-100 -> 0 +bool1695 issubnormal -0E-100 -> 0 +bool1696 issubnormal 0.000000 -> 0 +bool1697 issubnormal -0.000000 -> 0 +bool1698 issubnormal 0.000 -> 0 +bool1699 issubnormal -0.000 -> 0 +bool1700 issubnormal 0.00 -> 0 +bool1701 issubnormal -0.00 -> 0 +bool1702 issubnormal 0.0 -> 0 +bool1703 issubnormal -0.0 -> 0 +bool1704 issubnormal 0 -> 0 +bool1705 issubnormal -0 -> 0 +bool1706 issubnormal 0E+1 -> 0 +bool1707 issubnormal -0E+1 -> 0 +bool1708 issubnormal 0E+2 -> 0 +bool1709 issubnormal -0E+2 -> 0 +bool1710 issubnormal 0E+3 -> 0 +bool1711 issubnormal -0E+3 -> 0 +bool1712 issubnormal 0E+6 -> 0 +bool1713 issubnormal -0E+6 -> 0 +bool1714 issubnormal 0E+100 -> 0 +bool1715 issubnormal -0E+100 -> 0 +bool1716 issubnormal 0E+990 -> 0 +bool1717 issubnormal -0E+990 -> 0 +bool1718 issubnormal 0E+991 -> 0 +bool1719 issubnormal -0E+991 -> 0 +bool1720 issubnormal 0E+992 -> 0 +bool1721 issubnormal -0E+992 -> 0 +bool1722 issubnormal 0E+998 -> 0 +bool1723 issubnormal -0E+998 -> 0 +bool1724 issubnormal 0E+999 -> 0 +bool1725 issubnormal -0E+999 -> 0 +bool1726 issubnormal 0E+1000 -> 0 +bool1727 issubnormal -0E+1000 -> 0 +bool1728 issubnormal 0E+2000 -> 0 +bool1729 issubnormal -0E+2000 -> 0 +bool1730 issubnormal 1E-2000 -> 1 +bool1731 issubnormal -1E-2000 -> 1 +bool1732 issubnormal 1E-1008 -> 1 +bool1733 issubnormal -1E-1008 -> 1 +bool1734 issubnormal 1E-1007 -> 1 +bool1735 issubnormal -1E-1007 -> 1 +bool1736 issubnormal 1E-1006 -> 1 +bool1737 issubnormal -1E-1006 -> 1 +bool1738 issubnormal 1E-1000 -> 1 +bool1739 issubnormal -1E-1000 -> 1 +bool1740 issubnormal 1E-999 -> 0 +bool1741 issubnormal -1E-999 -> 0 +bool1742 issubnormal 1E-998 -> 0 +bool1743 issubnormal -1E-998 -> 0 +bool1744 issubnormal 1E-100 -> 0 +bool1745 issubnormal -1E-100 -> 0 +bool1746 issubnormal 0.000001 -> 0 +bool1747 issubnormal -0.000001 -> 0 +bool1748 issubnormal 0.001 -> 0 +bool1749 issubnormal -0.001 -> 0 +bool1750 issubnormal 0.01 -> 0 +bool1751 issubnormal -0.01 -> 0 +bool1752 issubnormal 0.1 -> 0 +bool1753 issubnormal -0.1 -> 0 +bool1754 issubnormal 1 -> 0 +bool1755 issubnormal -1 -> 0 +bool1756 issubnormal 1E+1 -> 0 +bool1757 issubnormal -1E+1 -> 0 +bool1758 issubnormal 1E+2 -> 0 +bool1759 issubnormal -1E+2 -> 0 +bool1760 issubnormal 1E+3 -> 0 +bool1761 issubnormal -1E+3 -> 0 +bool1762 issubnormal 1E+6 -> 0 +bool1763 issubnormal -1E+6 -> 0 +bool1764 issubnormal 1E+100 -> 0 +bool1765 issubnormal -1E+100 -> 0 +bool1766 issubnormal 1E+990 -> 0 +bool1767 issubnormal -1E+990 -> 0 +bool1768 issubnormal 1E+991 -> 0 +bool1769 issubnormal -1E+991 -> 0 +bool1770 issubnormal 1E+992 -> 0 +bool1771 issubnormal -1E+992 -> 0 +bool1772 issubnormal 1E+998 -> 0 +bool1773 issubnormal -1E+998 -> 0 +bool1774 issubnormal 1E+999 -> 0 +bool1775 issubnormal -1E+999 -> 0 +bool1776 issubnormal 1E+1000 -> 0 +bool1777 issubnormal -1E+1000 -> 0 +bool1778 issubnormal 1E+2000 -> 0 +bool1779 issubnormal -1E+2000 -> 0 +bool1780 issubnormal 9E-2000 -> 1 +bool1781 issubnormal -9E-2000 -> 1 +bool1782 issubnormal 9E-1008 -> 1 +bool1783 issubnormal -9E-1008 -> 1 +bool1784 issubnormal 9E-1007 -> 1 +bool1785 issubnormal -9E-1007 -> 1 +bool1786 issubnormal 9E-1006 -> 1 +bool1787 issubnormal -9E-1006 -> 1 +bool1788 issubnormal 9E-1000 -> 1 +bool1789 issubnormal -9E-1000 -> 1 +bool1790 issubnormal 9E-999 -> 0 +bool1791 issubnormal -9E-999 -> 0 +bool1792 issubnormal 9E-998 -> 0 +bool1793 issubnormal -9E-998 -> 0 +bool1794 issubnormal 9E-100 -> 0 +bool1795 issubnormal -9E-100 -> 0 +bool1796 issubnormal 0.000009 -> 0 +bool1797 issubnormal -0.000009 -> 0 +bool1798 issubnormal 0.009 -> 0 +bool1799 issubnormal -0.009 -> 0 +bool1800 issubnormal 0.09 -> 0 +bool1801 issubnormal -0.09 -> 0 +bool1802 issubnormal 0.9 -> 0 +bool1803 issubnormal -0.9 -> 0 +bool1804 issubnormal 9 -> 0 +bool1805 issubnormal -9 -> 0 +bool1806 issubnormal 9E+1 -> 0 +bool1807 issubnormal -9E+1 -> 0 +bool1808 issubnormal 9E+2 -> 0 +bool1809 issubnormal -9E+2 -> 0 +bool1810 issubnormal 9E+3 -> 0 +bool1811 issubnormal -9E+3 -> 0 +bool1812 issubnormal 9E+6 -> 0 +bool1813 issubnormal -9E+6 -> 0 +bool1814 issubnormal 9E+100 -> 0 +bool1815 issubnormal -9E+100 -> 0 +bool1816 issubnormal 9E+990 -> 0 +bool1817 issubnormal -9E+990 -> 0 +bool1818 issubnormal 9E+991 -> 0 +bool1819 issubnormal -9E+991 -> 0 +bool1820 issubnormal 9E+992 -> 0 +bool1821 issubnormal -9E+992 -> 0 +bool1822 issubnormal 9E+998 -> 0 +bool1823 issubnormal -9E+998 -> 0 +bool1824 issubnormal 9E+999 -> 0 +bool1825 issubnormal -9E+999 -> 0 +bool1826 issubnormal 9E+1000 -> 0 +bool1827 issubnormal -9E+1000 -> 0 +bool1828 issubnormal 9E+2000 -> 0 +bool1829 issubnormal -9E+2000 -> 0 +bool1830 issubnormal 9.99999999E-2000 -> 1 +bool1831 issubnormal -9.99999999E-2000 -> 1 +bool1832 issubnormal 9.99999999E-1008 -> 1 +bool1833 issubnormal -9.99999999E-1008 -> 1 +bool1834 issubnormal 9.99999999E-1007 -> 1 +bool1835 issubnormal -9.99999999E-1007 -> 1 +bool1836 issubnormal 9.99999999E-1006 -> 1 +bool1837 issubnormal -9.99999999E-1006 -> 1 +bool1838 issubnormal 9.99999999E-1000 -> 1 +bool1839 issubnormal -9.99999999E-1000 -> 1 +bool1840 issubnormal 9.99999999E-999 -> 0 +bool1841 issubnormal -9.99999999E-999 -> 0 +bool1842 issubnormal 9.99999999E-998 -> 0 +bool1843 issubnormal -9.99999999E-998 -> 0 +bool1844 issubnormal 9.99999999E-100 -> 0 +bool1845 issubnormal -9.99999999E-100 -> 0 +bool1846 issubnormal 0.00000999999999 -> 0 +bool1847 issubnormal -0.00000999999999 -> 0 +bool1848 issubnormal 0.00999999999 -> 0 +bool1849 issubnormal -0.00999999999 -> 0 +bool1850 issubnormal 0.0999999999 -> 0 +bool1851 issubnormal -0.0999999999 -> 0 +bool1852 issubnormal 0.999999999 -> 0 +bool1853 issubnormal -0.999999999 -> 0 +bool1854 issubnormal 9.99999999 -> 0 +bool1855 issubnormal -9.99999999 -> 0 +bool1856 issubnormal 99.9999999 -> 0 +bool1857 issubnormal -99.9999999 -> 0 +bool1858 issubnormal 999.999999 -> 0 +bool1859 issubnormal -999.999999 -> 0 +bool1860 issubnormal 9999.99999 -> 0 +bool1861 issubnormal -9999.99999 -> 0 +bool1862 issubnormal 9999999.99 -> 0 +bool1863 issubnormal -9999999.99 -> 0 +bool1864 issubnormal 9.99999999E+100 -> 0 +bool1865 issubnormal -9.99999999E+100 -> 0 +bool1866 issubnormal 9.99999999E+990 -> 0 +bool1867 issubnormal -9.99999999E+990 -> 0 +bool1868 issubnormal 9.99999999E+991 -> 0 +bool1869 issubnormal -9.99999999E+991 -> 0 +bool1870 issubnormal 9.99999999E+992 -> 0 +bool1871 issubnormal -9.99999999E+992 -> 0 +bool1872 issubnormal 9.99999999E+998 -> 0 +bool1873 issubnormal -9.99999999E+998 -> 0 +bool1874 issubnormal 9.99999999E+999 -> 0 +bool1875 issubnormal -9.99999999E+999 -> 0 +bool1876 issubnormal 9.99999999E+1000 -> 0 +bool1877 issubnormal -9.99999999E+1000 -> 0 +bool1878 issubnormal 9.99999999E+2000 -> 0 +bool1879 issubnormal -9.99999999E+2000 -> 0 +bool1880 issubnormal Infinity -> 0 +bool1881 issubnormal -Infinity -> 0 +bool1882 issubnormal NaN -> 0 +bool1883 issubnormal -NaN -> 0 +bool1884 issubnormal NaN123 -> 0 +bool1885 issubnormal -NaN123 -> 0 +bool1886 issubnormal sNaN -> 0 +bool1887 issubnormal -sNaN -> 0 +bool1888 issubnormal sNaN123 -> 0 +bool1889 issubnormal -sNaN123 -> 0 +bool1890 iszero 0E-2000 -> 1 +bool1891 iszero -0E-2000 -> 1 +bool1892 iszero 0E-1008 -> 1 +bool1893 iszero -0E-1008 -> 1 +bool1894 iszero 0E-1007 -> 1 +bool1895 iszero -0E-1007 -> 1 +bool1896 iszero 0E-1006 -> 1 +bool1897 iszero -0E-1006 -> 1 +bool1898 iszero 0E-1000 -> 1 +bool1899 iszero -0E-1000 -> 1 +bool1900 iszero 0E-999 -> 1 +bool1901 iszero -0E-999 -> 1 +bool1902 iszero 0E-998 -> 1 +bool1903 iszero -0E-998 -> 1 +bool1904 iszero 0E-100 -> 1 +bool1905 iszero -0E-100 -> 1 +bool1906 iszero 0.000000 -> 1 +bool1907 iszero -0.000000 -> 1 +bool1908 iszero 0.000 -> 1 +bool1909 iszero -0.000 -> 1 +bool1910 iszero 0.00 -> 1 +bool1911 iszero -0.00 -> 1 +bool1912 iszero 0.0 -> 1 +bool1913 iszero -0.0 -> 1 +bool1914 iszero 0 -> 1 +bool1915 iszero -0 -> 1 +bool1916 iszero 0E+1 -> 1 +bool1917 iszero -0E+1 -> 1 +bool1918 iszero 0E+2 -> 1 +bool1919 iszero -0E+2 -> 1 +bool1920 iszero 0E+3 -> 1 +bool1921 iszero -0E+3 -> 1 +bool1922 iszero 0E+6 -> 1 +bool1923 iszero -0E+6 -> 1 +bool1924 iszero 0E+100 -> 1 +bool1925 iszero -0E+100 -> 1 +bool1926 iszero 0E+990 -> 1 +bool1927 iszero -0E+990 -> 1 +bool1928 iszero 0E+991 -> 1 +bool1929 iszero -0E+991 -> 1 +bool1930 iszero 0E+992 -> 1 +bool1931 iszero -0E+992 -> 1 +bool1932 iszero 0E+998 -> 1 +bool1933 iszero -0E+998 -> 1 +bool1934 iszero 0E+999 -> 1 +bool1935 iszero -0E+999 -> 1 +bool1936 iszero 0E+1000 -> 1 +bool1937 iszero -0E+1000 -> 1 +bool1938 iszero 0E+2000 -> 1 +bool1939 iszero -0E+2000 -> 1 +bool1940 iszero 1E-2000 -> 0 +bool1941 iszero -1E-2000 -> 0 +bool1942 iszero 1E-1008 -> 0 +bool1943 iszero -1E-1008 -> 0 +bool1944 iszero 1E-1007 -> 0 +bool1945 iszero -1E-1007 -> 0 +bool1946 iszero 1E-1006 -> 0 +bool1947 iszero -1E-1006 -> 0 +bool1948 iszero 1E-1000 -> 0 +bool1949 iszero -1E-1000 -> 0 +bool1950 iszero 1E-999 -> 0 +bool1951 iszero -1E-999 -> 0 +bool1952 iszero 1E-998 -> 0 +bool1953 iszero -1E-998 -> 0 +bool1954 iszero 1E-100 -> 0 +bool1955 iszero -1E-100 -> 0 +bool1956 iszero 0.000001 -> 0 +bool1957 iszero -0.000001 -> 0 +bool1958 iszero 0.001 -> 0 +bool1959 iszero -0.001 -> 0 +bool1960 iszero 0.01 -> 0 +bool1961 iszero -0.01 -> 0 +bool1962 iszero 0.1 -> 0 +bool1963 iszero -0.1 -> 0 +bool1964 iszero 1 -> 0 +bool1965 iszero -1 -> 0 +bool1966 iszero 1E+1 -> 0 +bool1967 iszero -1E+1 -> 0 +bool1968 iszero 1E+2 -> 0 +bool1969 iszero -1E+2 -> 0 +bool1970 iszero 1E+3 -> 0 +bool1971 iszero -1E+3 -> 0 +bool1972 iszero 1E+6 -> 0 +bool1973 iszero -1E+6 -> 0 +bool1974 iszero 1E+100 -> 0 +bool1975 iszero -1E+100 -> 0 +bool1976 iszero 1E+990 -> 0 +bool1977 iszero -1E+990 -> 0 +bool1978 iszero 1E+991 -> 0 +bool1979 iszero -1E+991 -> 0 +bool1980 iszero 1E+992 -> 0 +bool1981 iszero -1E+992 -> 0 +bool1982 iszero 1E+998 -> 0 +bool1983 iszero -1E+998 -> 0 +bool1984 iszero 1E+999 -> 0 +bool1985 iszero -1E+999 -> 0 +bool1986 iszero 1E+1000 -> 0 +bool1987 iszero -1E+1000 -> 0 +bool1988 iszero 1E+2000 -> 0 +bool1989 iszero -1E+2000 -> 0 +bool1990 iszero 9E-2000 -> 0 +bool1991 iszero -9E-2000 -> 0 +bool1992 iszero 9E-1008 -> 0 +bool1993 iszero -9E-1008 -> 0 +bool1994 iszero 9E-1007 -> 0 +bool1995 iszero -9E-1007 -> 0 +bool1996 iszero 9E-1006 -> 0 +bool1997 iszero -9E-1006 -> 0 +bool1998 iszero 9E-1000 -> 0 +bool1999 iszero -9E-1000 -> 0 +bool2000 iszero 9E-999 -> 0 +bool2001 iszero -9E-999 -> 0 +bool2002 iszero 9E-998 -> 0 +bool2003 iszero -9E-998 -> 0 +bool2004 iszero 9E-100 -> 0 +bool2005 iszero -9E-100 -> 0 +bool2006 iszero 0.000009 -> 0 +bool2007 iszero -0.000009 -> 0 +bool2008 iszero 0.009 -> 0 +bool2009 iszero -0.009 -> 0 +bool2010 iszero 0.09 -> 0 +bool2011 iszero -0.09 -> 0 +bool2012 iszero 0.9 -> 0 +bool2013 iszero -0.9 -> 0 +bool2014 iszero 9 -> 0 +bool2015 iszero -9 -> 0 +bool2016 iszero 9E+1 -> 0 +bool2017 iszero -9E+1 -> 0 +bool2018 iszero 9E+2 -> 0 +bool2019 iszero -9E+2 -> 0 +bool2020 iszero 9E+3 -> 0 +bool2021 iszero -9E+3 -> 0 +bool2022 iszero 9E+6 -> 0 +bool2023 iszero -9E+6 -> 0 +bool2024 iszero 9E+100 -> 0 +bool2025 iszero -9E+100 -> 0 +bool2026 iszero 9E+990 -> 0 +bool2027 iszero -9E+990 -> 0 +bool2028 iszero 9E+991 -> 0 +bool2029 iszero -9E+991 -> 0 +bool2030 iszero 9E+992 -> 0 +bool2031 iszero -9E+992 -> 0 +bool2032 iszero 9E+998 -> 0 +bool2033 iszero -9E+998 -> 0 +bool2034 iszero 9E+999 -> 0 +bool2035 iszero -9E+999 -> 0 +bool2036 iszero 9E+1000 -> 0 +bool2037 iszero -9E+1000 -> 0 +bool2038 iszero 9E+2000 -> 0 +bool2039 iszero -9E+2000 -> 0 +bool2040 iszero 9.99999999E-2000 -> 0 +bool2041 iszero -9.99999999E-2000 -> 0 +bool2042 iszero 9.99999999E-1008 -> 0 +bool2043 iszero -9.99999999E-1008 -> 0 +bool2044 iszero 9.99999999E-1007 -> 0 +bool2045 iszero -9.99999999E-1007 -> 0 +bool2046 iszero 9.99999999E-1006 -> 0 +bool2047 iszero -9.99999999E-1006 -> 0 +bool2048 iszero 9.99999999E-1000 -> 0 +bool2049 iszero -9.99999999E-1000 -> 0 +bool2050 iszero 9.99999999E-999 -> 0 +bool2051 iszero -9.99999999E-999 -> 0 +bool2052 iszero 9.99999999E-998 -> 0 +bool2053 iszero -9.99999999E-998 -> 0 +bool2054 iszero 9.99999999E-100 -> 0 +bool2055 iszero -9.99999999E-100 -> 0 +bool2056 iszero 0.00000999999999 -> 0 +bool2057 iszero -0.00000999999999 -> 0 +bool2058 iszero 0.00999999999 -> 0 +bool2059 iszero -0.00999999999 -> 0 +bool2060 iszero 0.0999999999 -> 0 +bool2061 iszero -0.0999999999 -> 0 +bool2062 iszero 0.999999999 -> 0 +bool2063 iszero -0.999999999 -> 0 +bool2064 iszero 9.99999999 -> 0 +bool2065 iszero -9.99999999 -> 0 +bool2066 iszero 99.9999999 -> 0 +bool2067 iszero -99.9999999 -> 0 +bool2068 iszero 999.999999 -> 0 +bool2069 iszero -999.999999 -> 0 +bool2070 iszero 9999.99999 -> 0 +bool2071 iszero -9999.99999 -> 0 +bool2072 iszero 9999999.99 -> 0 +bool2073 iszero -9999999.99 -> 0 +bool2074 iszero 9.99999999E+100 -> 0 +bool2075 iszero -9.99999999E+100 -> 0 +bool2076 iszero 9.99999999E+990 -> 0 +bool2077 iszero -9.99999999E+990 -> 0 +bool2078 iszero 9.99999999E+991 -> 0 +bool2079 iszero -9.99999999E+991 -> 0 +bool2080 iszero 9.99999999E+992 -> 0 +bool2081 iszero -9.99999999E+992 -> 0 +bool2082 iszero 9.99999999E+998 -> 0 +bool2083 iszero -9.99999999E+998 -> 0 +bool2084 iszero 9.99999999E+999 -> 0 +bool2085 iszero -9.99999999E+999 -> 0 +bool2086 iszero 9.99999999E+1000 -> 0 +bool2087 iszero -9.99999999E+1000 -> 0 +bool2088 iszero 9.99999999E+2000 -> 0 +bool2089 iszero -9.99999999E+2000 -> 0 +bool2090 iszero Infinity -> 0 +bool2091 iszero -Infinity -> 0 +bool2092 iszero NaN -> 0 +bool2093 iszero -NaN -> 0 +bool2094 iszero NaN123 -> 0 +bool2095 iszero -NaN123 -> 0 +bool2096 iszero sNaN -> 0 +bool2097 iszero -sNaN -> 0 +bool2098 iszero sNaN123 -> 0 +bool2099 iszero -sNaN123 -> 0 + +------------------------------------------------------------------------ +-- The following tests (pwmx0 through pwmx440) are for the -- +-- three-argument version of power: -- +-- -- +-- pow(x, y, z) := x**y % z -- +-- -- +-- Note that the three-argument version of power is *not* part of -- +-- the IBM General Decimal Arithmetic specification. Questions -- +-- about it, or about these testcases, should go to one of the -- +-- Python decimal authors. -- +------------------------------------------------------------------------ + +extended: 1 +precision: 9 +rounding: down +maxExponent: 999 +minExponent: -999 + +-- Small numbers +-- Note that power(0, 0, m) is an error for any m +pwmx0 power 0 -0 1 -> NaN Invalid_operation +pwmx1 power 0 -0 2 -> NaN Invalid_operation +pwmx2 power 0 -0 3 -> NaN Invalid_operation +pwmx3 power 0 -0 4 -> NaN Invalid_operation +pwmx4 power 0 -0 -1 -> NaN Invalid_operation +pwmx5 power 0 -0 -2 -> NaN Invalid_operation +pwmx6 power 0 0 1 -> NaN Invalid_operation +pwmx7 power 0 0 2 -> NaN Invalid_operation +pwmx8 power 0 0 3 -> NaN Invalid_operation +pwmx9 power 0 0 4 -> NaN Invalid_operation +pwmx10 power 0 0 -1 -> NaN Invalid_operation +pwmx11 power 0 0 -2 -> NaN Invalid_operation +pwmx12 power 0 1 1 -> 0 +pwmx13 power 0 1 2 -> 0 +pwmx14 power 0 1 3 -> 0 +pwmx15 power 0 1 4 -> 0 +pwmx16 power 0 1 -1 -> 0 +pwmx17 power 0 1 -2 -> 0 +pwmx18 power 0 2 1 -> 0 +pwmx19 power 0 2 2 -> 0 +pwmx20 power 0 2 3 -> 0 +pwmx21 power 0 2 4 -> 0 +pwmx22 power 0 2 -1 -> 0 +pwmx23 power 0 2 -2 -> 0 +pwmx24 power 0 3 1 -> 0 +pwmx25 power 0 3 2 -> 0 +pwmx26 power 0 3 3 -> 0 +pwmx27 power 0 3 4 -> 0 +pwmx28 power 0 3 -1 -> 0 +pwmx29 power 0 3 -2 -> 0 +pwmx30 power 0 4 1 -> 0 +pwmx31 power 0 4 2 -> 0 +pwmx32 power 0 4 3 -> 0 +pwmx33 power 0 4 4 -> 0 +pwmx34 power 0 4 -1 -> 0 +pwmx35 power 0 4 -2 -> 0 +pwmx36 power 0 5 1 -> 0 +pwmx37 power 0 5 2 -> 0 +pwmx38 power 0 5 3 -> 0 +pwmx39 power 0 5 4 -> 0 +pwmx40 power 0 5 -1 -> 0 +pwmx41 power 0 5 -2 -> 0 +pwmx42 power 1 -0 1 -> 0 +pwmx43 power 1 -0 2 -> 1 +pwmx44 power 1 -0 3 -> 1 +pwmx45 power 1 -0 4 -> 1 +pwmx46 power 1 -0 -1 -> 0 +pwmx47 power 1 -0 -2 -> 1 +pwmx48 power 1 0 1 -> 0 +pwmx49 power 1 0 2 -> 1 +pwmx50 power 1 0 3 -> 1 +pwmx51 power 1 0 4 -> 1 +pwmx52 power 1 0 -1 -> 0 +pwmx53 power 1 0 -2 -> 1 +pwmx54 power 1 1 1 -> 0 +pwmx55 power 1 1 2 -> 1 +pwmx56 power 1 1 3 -> 1 +pwmx57 power 1 1 4 -> 1 +pwmx58 power 1 1 -1 -> 0 +pwmx59 power 1 1 -2 -> 1 +pwmx60 power 1 2 1 -> 0 +pwmx61 power 1 2 2 -> 1 +pwmx62 power 1 2 3 -> 1 +pwmx63 power 1 2 4 -> 1 +pwmx64 power 1 2 -1 -> 0 +pwmx65 power 1 2 -2 -> 1 +pwmx66 power 1 3 1 -> 0 +pwmx67 power 1 3 2 -> 1 +pwmx68 power 1 3 3 -> 1 +pwmx69 power 1 3 4 -> 1 +pwmx70 power 1 3 -1 -> 0 +pwmx71 power 1 3 -2 -> 1 +pwmx72 power 1 4 1 -> 0 +pwmx73 power 1 4 2 -> 1 +pwmx74 power 1 4 3 -> 1 +pwmx75 power 1 4 4 -> 1 +pwmx76 power 1 4 -1 -> 0 +pwmx77 power 1 4 -2 -> 1 +pwmx78 power 1 5 1 -> 0 +pwmx79 power 1 5 2 -> 1 +pwmx80 power 1 5 3 -> 1 +pwmx81 power 1 5 4 -> 1 +pwmx82 power 1 5 -1 -> 0 +pwmx83 power 1 5 -2 -> 1 +pwmx84 power 2 -0 1 -> 0 +pwmx85 power 2 -0 2 -> 1 +pwmx86 power 2 -0 3 -> 1 +pwmx87 power 2 -0 4 -> 1 +pwmx88 power 2 -0 -1 -> 0 +pwmx89 power 2 -0 -2 -> 1 +pwmx90 power 2 0 1 -> 0 +pwmx91 power 2 0 2 -> 1 +pwmx92 power 2 0 3 -> 1 +pwmx93 power 2 0 4 -> 1 +pwmx94 power 2 0 -1 -> 0 +pwmx95 power 2 0 -2 -> 1 +pwmx96 power 2 1 1 -> 0 +pwmx97 power 2 1 2 -> 0 +pwmx98 power 2 1 3 -> 2 +pwmx99 power 2 1 4 -> 2 +pwmx100 power 2 1 -1 -> 0 +pwmx101 power 2 1 -2 -> 0 +pwmx102 power 2 2 1 -> 0 +pwmx103 power 2 2 2 -> 0 +pwmx104 power 2 2 3 -> 1 +pwmx105 power 2 2 4 -> 0 +pwmx106 power 2 2 -1 -> 0 +pwmx107 power 2 2 -2 -> 0 +pwmx108 power 2 3 1 -> 0 +pwmx109 power 2 3 2 -> 0 +pwmx110 power 2 3 3 -> 2 +pwmx111 power 2 3 4 -> 0 +pwmx112 power 2 3 -1 -> 0 +pwmx113 power 2 3 -2 -> 0 +pwmx114 power 2 4 1 -> 0 +pwmx115 power 2 4 2 -> 0 +pwmx116 power 2 4 3 -> 1 +pwmx117 power 2 4 4 -> 0 +pwmx118 power 2 4 -1 -> 0 +pwmx119 power 2 4 -2 -> 0 +pwmx120 power 2 5 1 -> 0 +pwmx121 power 2 5 2 -> 0 +pwmx122 power 2 5 3 -> 2 +pwmx123 power 2 5 4 -> 0 +pwmx124 power 2 5 -1 -> 0 +pwmx125 power 2 5 -2 -> 0 +pwmx126 power 3 -0 1 -> 0 +pwmx127 power 3 -0 2 -> 1 +pwmx128 power 3 -0 3 -> 1 +pwmx129 power 3 -0 4 -> 1 +pwmx130 power 3 -0 -1 -> 0 +pwmx131 power 3 -0 -2 -> 1 +pwmx132 power 3 0 1 -> 0 +pwmx133 power 3 0 2 -> 1 +pwmx134 power 3 0 3 -> 1 +pwmx135 power 3 0 4 -> 1 +pwmx136 power 3 0 -1 -> 0 +pwmx137 power 3 0 -2 -> 1 +pwmx138 power 3 1 1 -> 0 +pwmx139 power 3 1 2 -> 1 +pwmx140 power 3 1 3 -> 0 +pwmx141 power 3 1 4 -> 3 +pwmx142 power 3 1 -1 -> 0 +pwmx143 power 3 1 -2 -> 1 +pwmx144 power 3 2 1 -> 0 +pwmx145 power 3 2 2 -> 1 +pwmx146 power 3 2 3 -> 0 +pwmx147 power 3 2 4 -> 1 +pwmx148 power 3 2 -1 -> 0 +pwmx149 power 3 2 -2 -> 1 +pwmx150 power 3 3 1 -> 0 +pwmx151 power 3 3 2 -> 1 +pwmx152 power 3 3 3 -> 0 +pwmx153 power 3 3 4 -> 3 +pwmx154 power 3 3 -1 -> 0 +pwmx155 power 3 3 -2 -> 1 +pwmx156 power 3 4 1 -> 0 +pwmx157 power 3 4 2 -> 1 +pwmx158 power 3 4 3 -> 0 +pwmx159 power 3 4 4 -> 1 +pwmx160 power 3 4 -1 -> 0 +pwmx161 power 3 4 -2 -> 1 +pwmx162 power 3 5 1 -> 0 +pwmx163 power 3 5 2 -> 1 +pwmx164 power 3 5 3 -> 0 +pwmx165 power 3 5 4 -> 3 +pwmx166 power 3 5 -1 -> 0 +pwmx167 power 3 5 -2 -> 1 +pwmx168 power -0 -0 1 -> NaN Invalid_operation +pwmx169 power -0 -0 2 -> NaN Invalid_operation +pwmx170 power -0 -0 3 -> NaN Invalid_operation +pwmx171 power -0 -0 4 -> NaN Invalid_operation +pwmx172 power -0 -0 -1 -> NaN Invalid_operation +pwmx173 power -0 -0 -2 -> NaN Invalid_operation +pwmx174 power -0 0 1 -> NaN Invalid_operation +pwmx175 power -0 0 2 -> NaN Invalid_operation +pwmx176 power -0 0 3 -> NaN Invalid_operation +pwmx177 power -0 0 4 -> NaN Invalid_operation +pwmx178 power -0 0 -1 -> NaN Invalid_operation +pwmx179 power -0 0 -2 -> NaN Invalid_operation +pwmx180 power -0 1 1 -> -0 +pwmx181 power -0 1 2 -> -0 +pwmx182 power -0 1 3 -> -0 +pwmx183 power -0 1 4 -> -0 +pwmx184 power -0 1 -1 -> -0 +pwmx185 power -0 1 -2 -> -0 +pwmx186 power -0 2 1 -> 0 +pwmx187 power -0 2 2 -> 0 +pwmx188 power -0 2 3 -> 0 +pwmx189 power -0 2 4 -> 0 +pwmx190 power -0 2 -1 -> 0 +pwmx191 power -0 2 -2 -> 0 +pwmx192 power -0 3 1 -> -0 +pwmx193 power -0 3 2 -> -0 +pwmx194 power -0 3 3 -> -0 +pwmx195 power -0 3 4 -> -0 +pwmx196 power -0 3 -1 -> -0 +pwmx197 power -0 3 -2 -> -0 +pwmx198 power -0 4 1 -> 0 +pwmx199 power -0 4 2 -> 0 +pwmx200 power -0 4 3 -> 0 +pwmx201 power -0 4 4 -> 0 +pwmx202 power -0 4 -1 -> 0 +pwmx203 power -0 4 -2 -> 0 +pwmx204 power -0 5 1 -> -0 +pwmx205 power -0 5 2 -> -0 +pwmx206 power -0 5 3 -> -0 +pwmx207 power -0 5 4 -> -0 +pwmx208 power -0 5 -1 -> -0 +pwmx209 power -0 5 -2 -> -0 +pwmx210 power -1 -0 1 -> 0 +pwmx211 power -1 -0 2 -> 1 +pwmx212 power -1 -0 3 -> 1 +pwmx213 power -1 -0 4 -> 1 +pwmx214 power -1 -0 -1 -> 0 +pwmx215 power -1 -0 -2 -> 1 +pwmx216 power -1 0 1 -> 0 +pwmx217 power -1 0 2 -> 1 +pwmx218 power -1 0 3 -> 1 +pwmx219 power -1 0 4 -> 1 +pwmx220 power -1 0 -1 -> 0 +pwmx221 power -1 0 -2 -> 1 +pwmx222 power -1 1 1 -> -0 +pwmx223 power -1 1 2 -> -1 +pwmx224 power -1 1 3 -> -1 +pwmx225 power -1 1 4 -> -1 +pwmx226 power -1 1 -1 -> -0 +pwmx227 power -1 1 -2 -> -1 +pwmx228 power -1 2 1 -> 0 +pwmx229 power -1 2 2 -> 1 +pwmx230 power -1 2 3 -> 1 +pwmx231 power -1 2 4 -> 1 +pwmx232 power -1 2 -1 -> 0 +pwmx233 power -1 2 -2 -> 1 +pwmx234 power -1 3 1 -> -0 +pwmx235 power -1 3 2 -> -1 +pwmx236 power -1 3 3 -> -1 +pwmx237 power -1 3 4 -> -1 +pwmx238 power -1 3 -1 -> -0 +pwmx239 power -1 3 -2 -> -1 +pwmx240 power -1 4 1 -> 0 +pwmx241 power -1 4 2 -> 1 +pwmx242 power -1 4 3 -> 1 +pwmx243 power -1 4 4 -> 1 +pwmx244 power -1 4 -1 -> 0 +pwmx245 power -1 4 -2 -> 1 +pwmx246 power -1 5 1 -> -0 +pwmx247 power -1 5 2 -> -1 +pwmx248 power -1 5 3 -> -1 +pwmx249 power -1 5 4 -> -1 +pwmx250 power -1 5 -1 -> -0 +pwmx251 power -1 5 -2 -> -1 + +-- Randomly chosen larger values +pwmx252 power 0 4 7 -> 0 +pwmx253 power -4 5 -9 -> -7 +pwmx254 power -5 4 -9 -> 4 +pwmx255 power -50 29 2 -> -0 +pwmx256 power -1 83 3 -> -1 +pwmx257 power -55 65 -75 -> -25 +pwmx258 power -613 151 -302 -> -9 +pwmx259 power 551 23 -35 -> 31 +pwmx260 power 51 142 942 -> 9 +pwmx261 power 6886 9204 -6091 -> 5034 +pwmx262 power 3057 5890 -3 -> 0 +pwmx263 power 56 4438 5365 -> 521 +pwmx264 power 96237 35669 -46669 -> 30717 +pwmx265 power 40011 34375 -57611 -> 625 +pwmx266 power 44317 38493 -12196 -> 11081 +pwmx267 power -282368 895633 -235870 -> -220928 +pwmx268 power 77328 852553 -405529 -> 129173 +pwmx269 power -929659 855713 650348 -> -90803 +pwmx270 power 907057 6574309 4924768 -> 3018257 +pwmx271 power -2887757 3198492 -5864352 -> 3440113 +pwmx272 power -247310 657371 -7415739 -> -1301840 +pwmx273 power -8399046 45334087 -22395020 -> -18515896 +pwmx274 power 79621397 4850236 1486555 -> 928706 +pwmx275 power 96012251 27971901 69609031 -> 50028729 +pwmx276 power -907335481 74127986 582330017 -> 51527187 +pwmx277 power -141192960 821063826 -260877928 -> 112318560 +pwmx278 power -501711702 934355994 82135143 -> 66586995 +pwmx279 power -9256358075 8900900138 -467222031 -> 95800246 +pwmx280 power -7031964291 1751257483 -935334498 -> -607626609 +pwmx281 power 8494314971 8740197252 107522491 -> 17373655 +pwmx282 power 88306216890 87477374166 -23498076 -> 15129528 +pwmx283 power -33939432478 7170196239 22133583 -> -11017036 +pwmx284 power 19466222767 30410710614 305752056 -> 191509537 +pwmx285 power -864942494008 370558899638 346688856 -> 56956768 +pwmx286 power -525406225603 345700226898 237163621 -> 56789534 +pwmx287 power 464612215955 312474621651 -329485700 -> 1853975 +pwmx288 power -1664283031244 3774474669855 919022867 -> -516034520 +pwmx289 power -3472438506913 7407327549995 -451206854 -> -74594761 +pwmx290 power -4223662152949 6891069279069 499843503 -> -80135290 +pwmx291 power -44022119276816 8168266170326 569679509 -> 375734475 +pwmx292 power -66195891207902 12532690555875 -243262129 -> -113186833 +pwmx293 power -69039911263164 52726605857673 360625196 -> -268662748 +pwmx294 power -299010116699208 885092589359231 -731310123 -> -104103765 +pwmx295 power -202495776299758 501159122943145 -686234870 -> -135511878 +pwmx296 power -595411478087676 836269270472481 -214614901 -> -183440819 +pwmx297 power -139555381056229 1324808520020507 -228944738 -> -218991473 +pwmx298 power 7846356250770543 1798045051036814 -101028985 -> 7805179 +pwmx299 power -4298015862709415 604966944844209 880212893 -> -87408671 +pwmx300 power -37384897538910893 76022206995659295 -930512842 -> -697757157 +pwmx301 power 82166659028005443 23375408251767704 817270700 -> 770697001 +pwmx302 power 97420301198165641 72213282983416924 947519716 -> 610711721 +pwmx303 power 913382043453243607 449681707248500262 211135545 -> 79544899 +pwmx304 power -313823613418052171 534579409610142937 -943062968 -> -446001379 +pwmx305 power -928106516894494093 760020177330116509 -50043994 -> -46010575 +pwmx306 power 4692146601679439796 4565354511806767804 -667339075 -> 480272081 +pwmx307 power 9722256633509177930 7276568791860505790 792675321 -> 182879752 +pwmx308 power 8689899484830064228 429082967129615261 -844555637 -> 270374557 + +-- All inputs must be integers +pwmx309 power 2.1 3 1 -> NaN Invalid_operation +pwmx310 power 0.4 1 5 -> NaN Invalid_operation +pwmx311 power 2 3.1 5 -> NaN Invalid_operation +pwmx312 power 13 -1.2 10 -> NaN Invalid_operation +pwmx313 power 2 3 5.1 -> NaN Invalid_operation + +-- Second argument must be nonnegative (-0 is okay) +pwmx314 power 2 -3 5 -> NaN Invalid_operation +pwmx315 power 7 -1 1 -> NaN Invalid_operation +pwmx316 power 0 -2 6 -> NaN Invalid_operation + +-- Third argument must be nonzero +pwmx317 power 13 1003 0 -> NaN Invalid_operation +pwmx318 power 1 0 0E+987 -> NaN Invalid_operation +pwmx319 power 0 2 -0 -> NaN Invalid_operation + +-- Integers are fine, no matter how they're expressed +pwmx320 power 13.0 117.00 1E+2 -> 33 +pwmx321 power -2E+3 1.1E+10 -12323 -> 4811 +pwmx322 power 20 0E-300 143 -> 1 +pwmx323 power -20 -0E+1005 1179 -> 1 +pwmx324 power 0E-1001 17 5.6E+4 -> 0 + +-- Modulus must not exceed precision +pwmx325 power 0 1 1234567890 -> NaN Invalid_operation +pwmx326 power 1 0 1000000000 -> NaN Invalid_operation +pwmx327 power -23 5 -1000000000 -> NaN Invalid_operation +pwmx328 power 41557 213 -999999999 -> 47650456 +pwmx329 power -2134 199 999999997 -> -946957912 + +-- Huge base shouldn't present any problems +pwmx330 power 1.23E+123456791 10123898 17291065 -> 5674045 + +-- Large exponent, may be slow +-- (if second argument is 1En then expect O(n) running time) +pwmx331 power 1000288896 9.87E+12347 93379908 -> 43224924 + +-- Triple NaN propagation (adapted from examples in fma.decTest) +pwmx400 power NaN2 NaN3 NaN5 -> NaN2 +pwmx401 power 1 NaN3 NaN5 -> NaN3 +pwmx402 power 1 1 NaN5 -> NaN5 +pwmx403 power sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +pwmx404 power 1 sNaN2 sNaN3 -> NaN2 Invalid_operation +pwmx405 power 1 1 sNaN3 -> NaN3 Invalid_operation +pwmx406 power sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +pwmx407 power NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation +pwmx408 power NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation + +-- Infinities not allowed +pwmx410 power Inf 1 1 -> NaN Invalid_operation +pwmx411 power 1 Inf 1 -> NaN Invalid_operation +pwmx412 power 1 1 Inf -> NaN Invalid_operation +pwmx413 power -Inf 1 1 -> NaN Invalid_operation +pwmx414 power 1 -Inf 1 -> NaN Invalid_operation +pwmx415 power 1 1 -Inf -> NaN Invalid_operation + +-- Just for fun: 1729 is a Carmichael number +pwmx420 power 0 1728 1729 -> 0 +pwmx421 power 1 1728 1729 -> 1 +pwmx422 power 2 1728 1729 -> 1 +pwmx423 power 3 1728 1729 -> 1 +pwmx424 power 4 1728 1729 -> 1 +pwmx425 power 5 1728 1729 -> 1 +pwmx426 power 6 1728 1729 -> 1 +pwmx427 power 7 1728 1729 -> 742 +pwmx428 power 8 1728 1729 -> 1 +pwmx429 power 9 1728 1729 -> 1 +pwmx430 power 10 1728 1729 -> 1 +pwmx431 power 11 1728 1729 -> 1 +pwmx432 power 12 1728 1729 -> 1 +pwmx433 power 13 1728 1729 -> 533 +pwmx434 power 14 1728 1729 -> 742 +pwmx435 power 15 1728 1729 -> 1 +pwmx436 power 16 1728 1729 -> 1 +pwmx437 power 17 1728 1729 -> 1 +pwmx438 power 18 1728 1729 -> 1 +pwmx439 power 19 1728 1729 -> 456 +pwmx440 power 20 1728 1729 -> 1 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/fma.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/fma.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,3426 @@ +------------------------------------------------------------------------ +-- fma.decTest -- decimal fused multiply add -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- These tests comprese three parts: +-- 1. Sanity checks and other three-operand tests (especially those +-- where the fused operation makes a difference) +-- 2. Multiply tests (third operand is neutral zero [0E+emax]) +-- 3. Addition tests (first operand is 1) +-- The multiply and addition tests are extensive because FMA may have +-- its own dedicated multiplication or addition routine(s), and they +-- also inherently check the left-to-right properties. + +-- Sanity checks +fmax0001 fma 1 1 1 -> 2 +fmax0002 fma 1 1 2 -> 3 +fmax0003 fma 2 2 3 -> 7 +fmax0004 fma 9 9 9 -> 90 +fmax0005 fma -1 1 1 -> 0 +fmax0006 fma -1 1 2 -> 1 +fmax0007 fma -2 2 3 -> -1 +fmax0008 fma -9 9 9 -> -72 +fmax0011 fma 1 -1 1 -> 0 +fmax0012 fma 1 -1 2 -> 1 +fmax0013 fma 2 -2 3 -> -1 +fmax0014 fma 9 -9 9 -> -72 +fmax0015 fma 1 1 -1 -> 0 +fmax0016 fma 1 1 -2 -> -1 +fmax0017 fma 2 2 -3 -> 1 +fmax0018 fma 9 9 -9 -> 72 +fmax0019 fma 3 5 7 -> 22 +fmax0029 fma 3 -5 7 -> -8 + +-- non-integer exacts +fma0100 fma 25.2 63.6 -438 -> 1164.72 +fma0101 fma 0.301 0.380 334 -> 334.114380 +fma0102 fma 49.2 -4.8 23.3 -> -212.86 +fma0103 fma 4.22 0.079 -94.6 -> -94.26662 +fma0104 fma 903 0.797 0.887 -> 720.578 +fma0105 fma 6.13 -161 65.9 -> -921.03 +fma0106 fma 28.2 727 5.45 -> 20506.85 +fma0107 fma 4 605 688 -> 3108 +fma0108 fma 93.3 0.19 0.226 -> 17.953 +fma0109 fma 0.169 -341 5.61 -> -52.019 +fma0110 fma -72.2 30 -51.2 -> -2217.2 +fma0111 fma -0.409 13 20.4 -> 15.083 +fma0112 fma 317 77.0 19.0 -> 24428.0 +fma0113 fma 47 6.58 1.62 -> 310.88 +fma0114 fma 1.36 0.984 0.493 -> 1.83124 +fma0115 fma 72.7 274 1.56 -> 19921.36 +fma0116 fma 335 847 83 -> 283828 +fma0117 fma 666 0.247 25.4 -> 189.902 +fma0118 fma -3.87 3.06 78.0 -> 66.1578 +fma0119 fma 0.742 192 35.6 -> 178.064 +fma0120 fma -91.6 5.29 0.153 -> -484.411 + +-- cases where result is different from separate multiply + add; each +-- is preceded by the result of unfused multiply and add +-- [this is about 20% of all similar cases in general] +-- 888565290 1557.96930 -86087.7578 -> 1.38435735E+12 +fma0201 fma 888565290 1557.96930 -86087.7578 -> 1.38435736E+12 Inexact Rounded +-- -85519342.9 735155419 42010431 -> -6.28700084E+16 +fma0205 fma -85519342.9 735155419 42010431 -> -6.28700083E+16 Inexact Rounded +-- -98025.5 -294603.472 10414348.2 -> 2.88890669E+10 +fma0208 fma -98025.5 -294603.472 10414348.2 -> 2.88890670E+10 Inexact Rounded +-- 5967627.39 83526540.6 498494.810 -> 4.98455271E+14 +fma0211 fma 5967627.39 83526540.6 498494.810 -> 4.98455272E+14 Inexact Rounded +-- 3456.9433 874.39518 197866.615 -> 3220601.18 +fma0216 fma 3456.9433 874.39518 197866.615 -> 3220601.17 Inexact Rounded +-- 62769.8287 2096.98927 48.420317 -> 131627705 +fma0218 fma 62769.8287 2096.98927 48.420317 -> 131627706 Inexact Rounded +-- -68.81500 59961113.9 -8988862 -> -4.13521291E+9 +fma0219 fma -68.81500 59961113.9 -8988862 -> -4.13521292E+9 Inexact Rounded +-- 2126341.02 63491.5152 302427455 -> 1.35307040E+11 +fma0226 fma 2126341.02 63491.5152 302427455 -> 1.35307041E+11 Inexact Rounded + + +-- Infinite combinations +fmax0800 fma Inf Inf Inf -> Infinity +fmax0801 fma Inf Inf -Inf -> NaN Invalid_operation +fmax0802 fma Inf -Inf Inf -> NaN Invalid_operation +fmax0803 fma Inf -Inf -Inf -> -Infinity +fmax0804 fma -Inf Inf Inf -> NaN Invalid_operation +fmax0805 fma -Inf Inf -Inf -> -Infinity +fmax0806 fma -Inf -Inf Inf -> Infinity +fmax0807 fma -Inf -Inf -Inf -> NaN Invalid_operation +fmax0808 fma -Inf 0 1 -> NaN Invalid_operation +fmax0809 fma -Inf 0 NaN -> NaN Invalid_operation + +-- Triple NaN propagation +fmax0900 fma NaN2 NaN3 NaN5 -> NaN2 +fmax0901 fma 0 NaN3 NaN5 -> NaN3 +fmax0902 fma 0 0 NaN5 -> NaN5 +-- first sNaN wins (consider qNaN from earlier sNaN being +-- overridden by an sNaN in third operand) +fmax0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +fmax0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation +fmax0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation +fmax0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation +fmax0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation +fmax0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation + +-- MULTIPLICATION TESTS ------------------------------------------------ +-- sanity checks (as base, above) +fmax2000 fma 2 2 0E+999999 -> 4 +fmax2001 fma 2 3 0E+999999 -> 6 +fmax2002 fma 5 1 0E+999999 -> 5 +fmax2003 fma 5 2 0E+999999 -> 10 +fmax2004 fma 1.20 2 0E+999999 -> 2.40 +fmax2005 fma 1.20 0 0E+999999 -> 0.00 +fmax2006 fma 1.20 -2 0E+999999 -> -2.40 +fmax2007 fma -1.20 2 0E+999999 -> -2.40 +fmax2008 fma -1.20 0 0E+999999 -> 0.00 +fmax2009 fma -1.20 -2 0E+999999 -> 2.40 +fmax2010 fma 5.09 7.1 0E+999999 -> 36.139 +fmax2011 fma 2.5 4 0E+999999 -> 10.0 +fmax2012 fma 2.50 4 0E+999999 -> 10.00 +fmax2013 fma 1.23456789 1.00000000 0E+999999 -> 1.23456789 Rounded +fmax2014 fma 9.999999999 9.999999999 0E+999999 -> 100.000000 Inexact Rounded +fmax2015 fma 2.50 4 0E+999999 -> 10.00 +precision: 6 +fmax2016 fma 2.50 4 0E+999999 -> 10.00 +fmax2017 fma 9.999999 9.999999 0E+999999 -> 100.000 Inexact Rounded +fmax2018 fma 9.999999 -9.999999 0E+999999 -> -100.000 Inexact Rounded +fmax2019 fma -9.999999 9.999999 0E+999999 -> -100.000 Inexact Rounded +fmax2020 fma -9.999999 -9.999999 0E+999999 -> 100.000 Inexact Rounded + +-- 1999.12.21: next one is a edge case if intermediate longs are used +precision: 15 +fmax2059 fma 999999999999 9765625 0E+999999 -> 9.76562499999023E+18 Inexact Rounded +precision: 30 +fmax2160 fma 999999999999 9765625 0E+999999 -> 9765624999990234375 +precision: 9 +----- + +-- zeros, etc. +fmax2021 fma 0 0 0E+999999 -> 0 +fmax2022 fma 0 -0 0E+999999 -> 0 +fmax2023 fma -0 0 0E+999999 -> 0 +fmax2024 fma -0 -0 0E+999999 -> 0 +fmax2025 fma -0.0 -0.0 0E+999999 -> 0.00 +fmax2026 fma -0.0 -0.0 0E+999999 -> 0.00 +fmax2027 fma -0.0 -0.0 0E+999999 -> 0.00 +fmax2028 fma -0.0 -0.0 0E+999999 -> 0.00 +fmax2030 fma 5.00 1E-3 0E+999999 -> 0.00500 +fmax2031 fma 00.00 0.000 0E+999999 -> 0.00000 +fmax2032 fma 00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0 +fmax2033 fma 0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0 +fmax2034 fma -5.00 1E-3 0E+999999 -> -0.00500 +fmax2035 fma -00.00 0.000 0E+999999 -> 0.00000 +fmax2036 fma -00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0 +fmax2037 fma -0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0 +fmax2038 fma 5.00 -1E-3 0E+999999 -> -0.00500 +fmax2039 fma 00.00 -0.000 0E+999999 -> 0.00000 +fmax2040 fma 00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0 +fmax2041 fma 0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0 +fmax2042 fma -5.00 -1E-3 0E+999999 -> 0.00500 +fmax2043 fma -00.00 -0.000 0E+999999 -> 0.00000 +fmax2044 fma -00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0 +fmax2045 fma -0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0 + +-- examples from decarith multiply +fmax2050 fma 1.20 3 0E+999999 -> 3.60 +fmax2051 fma 7 3 0E+999999 -> 21 +fmax2052 fma 0.9 0.8 0E+999999 -> 0.72 +fmax2053 fma 0.9 -0 0E+999999 -> 0.0 +fmax2054 fma 654321 654321 0E+999999 -> 4.28135971E+11 Inexact Rounded + +fmax2060 fma 123.45 1e7 0E+999999 -> 1.2345E+9 +fmax2061 fma 123.45 1e8 0E+999999 -> 1.2345E+10 +fmax2062 fma 123.45 1e+9 0E+999999 -> 1.2345E+11 +fmax2063 fma 123.45 1e10 0E+999999 -> 1.2345E+12 +fmax2064 fma 123.45 1e11 0E+999999 -> 1.2345E+13 +fmax2065 fma 123.45 1e12 0E+999999 -> 1.2345E+14 +fmax2066 fma 123.45 1e13 0E+999999 -> 1.2345E+15 + + +-- test some intermediate lengths +precision: 9 +fmax2080 fma 0.1 123456789 0E+999999 -> 12345678.9 +fmax2081 fma 0.1 1234567891 0E+999999 -> 123456789 Inexact Rounded +fmax2082 fma 0.1 12345678912 0E+999999 -> 1.23456789E+9 Inexact Rounded +fmax2083 fma 0.1 12345678912345 0E+999999 -> 1.23456789E+12 Inexact Rounded +fmax2084 fma 0.1 123456789 0E+999999 -> 12345678.9 +precision: 8 +fmax2085 fma 0.1 12345678912 0E+999999 -> 1.2345679E+9 Inexact Rounded +fmax2086 fma 0.1 12345678912345 0E+999999 -> 1.2345679E+12 Inexact Rounded +precision: 7 +fmax2087 fma 0.1 12345678912 0E+999999 -> 1.234568E+9 Inexact Rounded +fmax2088 fma 0.1 12345678912345 0E+999999 -> 1.234568E+12 Inexact Rounded + +precision: 9 +fmax2090 fma 123456789 0.1 0E+999999 -> 12345678.9 +fmax2091 fma 1234567891 0.1 0E+999999 -> 123456789 Inexact Rounded +fmax2092 fma 12345678912 0.1 0E+999999 -> 1.23456789E+9 Inexact Rounded +fmax2093 fma 12345678912345 0.1 0E+999999 -> 1.23456789E+12 Inexact Rounded +fmax2094 fma 123456789 0.1 0E+999999 -> 12345678.9 +precision: 8 +fmax2095 fma 12345678912 0.1 0E+999999 -> 1.2345679E+9 Inexact Rounded +fmax2096 fma 12345678912345 0.1 0E+999999 -> 1.2345679E+12 Inexact Rounded +precision: 7 +fmax2097 fma 12345678912 0.1 0E+999999 -> 1.234568E+9 Inexact Rounded +fmax2098 fma 12345678912345 0.1 0E+999999 -> 1.234568E+12 Inexact Rounded + +-- test some more edge cases and carries +maxexponent: 9999 +minexponent: -9999 +precision: 33 +fmax2101 fma 9 9 0E+999999 -> 81 +fmax2102 fma 9 90 0E+999999 -> 810 +fmax2103 fma 9 900 0E+999999 -> 8100 +fmax2104 fma 9 9000 0E+999999 -> 81000 +fmax2105 fma 9 90000 0E+999999 -> 810000 +fmax2106 fma 9 900000 0E+999999 -> 8100000 +fmax2107 fma 9 9000000 0E+999999 -> 81000000 +fmax2108 fma 9 90000000 0E+999999 -> 810000000 +fmax2109 fma 9 900000000 0E+999999 -> 8100000000 +fmax2110 fma 9 9000000000 0E+999999 -> 81000000000 +fmax2111 fma 9 90000000000 0E+999999 -> 810000000000 +fmax2112 fma 9 900000000000 0E+999999 -> 8100000000000 +fmax2113 fma 9 9000000000000 0E+999999 -> 81000000000000 +fmax2114 fma 9 90000000000000 0E+999999 -> 810000000000000 +fmax2115 fma 9 900000000000000 0E+999999 -> 8100000000000000 +fmax2116 fma 9 9000000000000000 0E+999999 -> 81000000000000000 +fmax2117 fma 9 90000000000000000 0E+999999 -> 810000000000000000 +fmax2118 fma 9 900000000000000000 0E+999999 -> 8100000000000000000 +fmax2119 fma 9 9000000000000000000 0E+999999 -> 81000000000000000000 +fmax2120 fma 9 90000000000000000000 0E+999999 -> 810000000000000000000 +fmax2121 fma 9 900000000000000000000 0E+999999 -> 8100000000000000000000 +fmax2122 fma 9 9000000000000000000000 0E+999999 -> 81000000000000000000000 +fmax2123 fma 9 90000000000000000000000 0E+999999 -> 810000000000000000000000 +-- test some more edge cases without carries +fmax2131 fma 3 3 0E+999999 -> 9 +fmax2132 fma 3 30 0E+999999 -> 90 +fmax2133 fma 3 300 0E+999999 -> 900 +fmax2134 fma 3 3000 0E+999999 -> 9000 +fmax2135 fma 3 30000 0E+999999 -> 90000 +fmax2136 fma 3 300000 0E+999999 -> 900000 +fmax2137 fma 3 3000000 0E+999999 -> 9000000 +fmax2138 fma 3 30000000 0E+999999 -> 90000000 +fmax2139 fma 3 300000000 0E+999999 -> 900000000 +fmax2140 fma 3 3000000000 0E+999999 -> 9000000000 +fmax2141 fma 3 30000000000 0E+999999 -> 90000000000 +fmax2142 fma 3 300000000000 0E+999999 -> 900000000000 +fmax2143 fma 3 3000000000000 0E+999999 -> 9000000000000 +fmax2144 fma 3 30000000000000 0E+999999 -> 90000000000000 +fmax2145 fma 3 300000000000000 0E+999999 -> 900000000000000 +fmax2146 fma 3 3000000000000000 0E+999999 -> 9000000000000000 +fmax2147 fma 3 30000000000000000 0E+999999 -> 90000000000000000 +fmax2148 fma 3 300000000000000000 0E+999999 -> 900000000000000000 +fmax2149 fma 3 3000000000000000000 0E+999999 -> 9000000000000000000 +fmax2150 fma 3 30000000000000000000 0E+999999 -> 90000000000000000000 +fmax2151 fma 3 300000000000000000000 0E+999999 -> 900000000000000000000 +fmax2152 fma 3 3000000000000000000000 0E+999999 -> 9000000000000000000000 +fmax2153 fma 3 30000000000000000000000 0E+999999 -> 90000000000000000000000 + +maxexponent: 999999 +minexponent: -999999 +precision: 9 +-- test some cases that are close to exponent overflow/underflow +fmax2170 fma 1 9e999999 0E+999999 -> 9E+999999 +fmax2171 fma 1 9.9e999999 0E+999999 -> 9.9E+999999 +fmax2172 fma 1 9.99e999999 0E+999999 -> 9.99E+999999 +fmax2173 fma 9e999999 1 0E+999999 -> 9E+999999 +fmax2174 fma 9.9e999999 1 0E+999999 -> 9.9E+999999 +fmax2176 fma 9.99e999999 1 0E+999999 -> 9.99E+999999 +fmax2177 fma 1 9.99999e999999 0E+999999 -> 9.99999E+999999 +fmax2178 fma 9.99999e999999 1 0E+999999 -> 9.99999E+999999 + +fmax2180 fma 0.1 9e-999998 0E+999999 -> 9E-999999 +fmax2181 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998 +fmax2182 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997 + +fmax2183 fma 0.1 9e-999998 0E+999999 -> 9E-999999 +fmax2184 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998 +fmax2185 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997 +fmax2186 fma 0.1 999e-999997 0E+999999 -> 9.99E-999996 +fmax2187 fma 0.1 9999e-999997 0E+999999 -> 9.999E-999995 +fmax2188 fma 0.1 99999e-999997 0E+999999 -> 9.9999E-999994 + +fmax2190 fma 1 9e-999998 0E+999999 -> 9E-999998 +fmax2191 fma 1 99e-999998 0E+999999 -> 9.9E-999997 +fmax2192 fma 1 999e-999998 0E+999999 -> 9.99E-999996 +fmax2193 fma 9e-999998 1 0E+999999 -> 9E-999998 +fmax2194 fma 99e-999998 1 0E+999999 -> 9.9E-999997 +fmax2195 fma 999e-999998 1 0E+999999 -> 9.99E-999996 + +-- long operand triangle +precision: 33 +fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511992830 Inexact Rounded +precision: 32 +fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199283 Inexact Rounded +precision: 31 +fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165119928 Inexact Rounded +precision: 30 +fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511993 Inexact Rounded +precision: 29 +fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199 Inexact Rounded +precision: 28 +fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165120 Inexact Rounded +precision: 27 +fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916512 Inexact Rounded +precision: 26 +fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651 Inexact Rounded +precision: 25 +fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165 Inexact Rounded +precision: 24 +fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671917 Inexact Rounded +precision: 23 +fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967192 Inexact Rounded +precision: 22 +fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719 Inexact Rounded +precision: 21 +fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369672 Inexact Rounded +precision: 20 +fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967 Inexact Rounded +precision: 19 +fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933697 Inexact Rounded +precision: 18 +fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193370 Inexact Rounded +precision: 17 +fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119337 Inexact Rounded +precision: 16 +fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011934 Inexact Rounded +precision: 15 +fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193 Inexact Rounded +precision: 14 +fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119 Inexact Rounded +precision: 13 +fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908012 Inexact Rounded +precision: 12 +fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801 Inexact Rounded +precision: 11 +fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080 Inexact Rounded +precision: 10 +fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908 Inexact Rounded +precision: 9 +fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.291 Inexact Rounded +precision: 8 +fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29 Inexact Rounded +precision: 7 +fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.3 Inexact Rounded +precision: 6 +fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433 Inexact Rounded +precision: 5 +fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.4543E+5 Inexact Rounded +precision: 4 +fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.454E+5 Inexact Rounded +precision: 3 +fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.45E+5 Inexact Rounded +precision: 2 +fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.5E+5 Inexact Rounded +precision: 1 +fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1E+5 Inexact Rounded + +-- test some edge cases with exact rounding +maxexponent: 9999 +minexponent: -9999 +precision: 9 +fmax2301 fma 9 9 0E+999999 -> 81 +fmax2302 fma 9 90 0E+999999 -> 810 +fmax2303 fma 9 900 0E+999999 -> 8100 +fmax2304 fma 9 9000 0E+999999 -> 81000 +fmax2305 fma 9 90000 0E+999999 -> 810000 +fmax2306 fma 9 900000 0E+999999 -> 8100000 +fmax2307 fma 9 9000000 0E+999999 -> 81000000 +fmax2308 fma 9 90000000 0E+999999 -> 810000000 +fmax2309 fma 9 900000000 0E+999999 -> 8.10000000E+9 Rounded +fmax2310 fma 9 9000000000 0E+999999 -> 8.10000000E+10 Rounded +fmax2311 fma 9 90000000000 0E+999999 -> 8.10000000E+11 Rounded +fmax2312 fma 9 900000000000 0E+999999 -> 8.10000000E+12 Rounded +fmax2313 fma 9 9000000000000 0E+999999 -> 8.10000000E+13 Rounded +fmax2314 fma 9 90000000000000 0E+999999 -> 8.10000000E+14 Rounded +fmax2315 fma 9 900000000000000 0E+999999 -> 8.10000000E+15 Rounded +fmax2316 fma 9 9000000000000000 0E+999999 -> 8.10000000E+16 Rounded +fmax2317 fma 9 90000000000000000 0E+999999 -> 8.10000000E+17 Rounded +fmax2318 fma 9 900000000000000000 0E+999999 -> 8.10000000E+18 Rounded +fmax2319 fma 9 9000000000000000000 0E+999999 -> 8.10000000E+19 Rounded +fmax2320 fma 9 90000000000000000000 0E+999999 -> 8.10000000E+20 Rounded +fmax2321 fma 9 900000000000000000000 0E+999999 -> 8.10000000E+21 Rounded +fmax2322 fma 9 9000000000000000000000 0E+999999 -> 8.10000000E+22 Rounded +fmax2323 fma 9 90000000000000000000000 0E+999999 -> 8.10000000E+23 Rounded + +-- fastpath breakers +precision: 29 +fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 0E+999999 -> 1.6487212707001281468486507878 Inexact Rounded +precision: 55 +fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 0E+999999 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded + + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +fmax2504 fma 0E-60 1000E-60 0E+999999 -> 0E-98 Clamped +fmax2505 fma 100E+60 0E+60 0E+999999 -> 0E+92 Clamped + +-- mixed with zeros +maxexponent: 999999 +minexponent: -999999 +precision: 9 +fmax2541 fma 0 -1 0E+999999 -> 0 +fmax2542 fma -0 -1 0E+999999 -> 0 +fmax2543 fma 0 1 0E+999999 -> 0 +fmax2544 fma -0 1 0E+999999 -> 0 +fmax2545 fma -1 0 0E+999999 -> 0 +fmax2546 fma -1 -0 0E+999999 -> 0 +fmax2547 fma 1 0 0E+999999 -> 0 +fmax2548 fma 1 -0 0E+999999 -> 0 + +fmax2551 fma 0.0 -1 0E+999999 -> 0.0 +fmax2552 fma -0.0 -1 0E+999999 -> 0.0 +fmax2553 fma 0.0 1 0E+999999 -> 0.0 +fmax2554 fma -0.0 1 0E+999999 -> 0.0 +fmax2555 fma -1.0 0 0E+999999 -> 0.0 +fmax2556 fma -1.0 -0 0E+999999 -> 0.0 +fmax2557 fma 1.0 0 0E+999999 -> 0.0 +fmax2558 fma 1.0 -0 0E+999999 -> 0.0 + +fmax2561 fma 0 -1.0 0E+999999 -> 0.0 +fmax2562 fma -0 -1.0 0E+999999 -> 0.0 +fmax2563 fma 0 1.0 0E+999999 -> 0.0 +fmax2564 fma -0 1.0 0E+999999 -> 0.0 +fmax2565 fma -1 0.0 0E+999999 -> 0.0 +fmax2566 fma -1 -0.0 0E+999999 -> 0.0 +fmax2567 fma 1 0.0 0E+999999 -> 0.0 +fmax2568 fma 1 -0.0 0E+999999 -> 0.0 + +fmax2571 fma 0.0 -1.0 0E+999999 -> 0.00 +fmax2572 fma -0.0 -1.0 0E+999999 -> 0.00 +fmax2573 fma 0.0 1.0 0E+999999 -> 0.00 +fmax2574 fma -0.0 1.0 0E+999999 -> 0.00 +fmax2575 fma -1.0 0.0 0E+999999 -> 0.00 +fmax2576 fma -1.0 -0.0 0E+999999 -> 0.00 +fmax2577 fma 1.0 0.0 0E+999999 -> 0.00 +fmax2578 fma 1.0 -0.0 0E+999999 -> 0.00 + + +-- Specials +fmax2580 fma Inf -Inf 0E+999999 -> -Infinity +fmax2581 fma Inf -1000 0E+999999 -> -Infinity +fmax2582 fma Inf -1 0E+999999 -> -Infinity +fmax2583 fma Inf -0 0E+999999 -> NaN Invalid_operation +fmax2584 fma Inf 0 0E+999999 -> NaN Invalid_operation +fmax2585 fma Inf 1 0E+999999 -> Infinity +fmax2586 fma Inf 1000 0E+999999 -> Infinity +fmax2587 fma Inf Inf 0E+999999 -> Infinity +fmax2588 fma -1000 Inf 0E+999999 -> -Infinity +fmax2589 fma -Inf Inf 0E+999999 -> -Infinity +fmax2590 fma -1 Inf 0E+999999 -> -Infinity +fmax2591 fma -0 Inf 0E+999999 -> NaN Invalid_operation +fmax2592 fma 0 Inf 0E+999999 -> NaN Invalid_operation +fmax2593 fma 1 Inf 0E+999999 -> Infinity +fmax2594 fma 1000 Inf 0E+999999 -> Infinity +fmax2595 fma Inf Inf 0E+999999 -> Infinity + +fmax2600 fma -Inf -Inf 0E+999999 -> Infinity +fmax2601 fma -Inf -1000 0E+999999 -> Infinity +fmax2602 fma -Inf -1 0E+999999 -> Infinity +fmax2603 fma -Inf -0 0E+999999 -> NaN Invalid_operation +fmax2604 fma -Inf 0 0E+999999 -> NaN Invalid_operation +fmax2605 fma -Inf 1 0E+999999 -> -Infinity +fmax2606 fma -Inf 1000 0E+999999 -> -Infinity +fmax2607 fma -Inf Inf 0E+999999 -> -Infinity +fmax2608 fma -1000 Inf 0E+999999 -> -Infinity +fmax2609 fma -Inf -Inf 0E+999999 -> Infinity +fmax2610 fma -1 -Inf 0E+999999 -> Infinity +fmax2611 fma -0 -Inf 0E+999999 -> NaN Invalid_operation +fmax2612 fma 0 -Inf 0E+999999 -> NaN Invalid_operation +fmax2613 fma 1 -Inf 0E+999999 -> -Infinity +fmax2614 fma 1000 -Inf 0E+999999 -> -Infinity +fmax2615 fma Inf -Inf 0E+999999 -> -Infinity + +fmax2621 fma NaN -Inf 0E+999999 -> NaN +fmax2622 fma NaN -1000 0E+999999 -> NaN +fmax2623 fma NaN -1 0E+999999 -> NaN +fmax2624 fma NaN -0 0E+999999 -> NaN +fmax2625 fma NaN 0 0E+999999 -> NaN +fmax2626 fma NaN 1 0E+999999 -> NaN +fmax2627 fma NaN 1000 0E+999999 -> NaN +fmax2628 fma NaN Inf 0E+999999 -> NaN +fmax2629 fma NaN NaN 0E+999999 -> NaN +fmax2630 fma -Inf NaN 0E+999999 -> NaN +fmax2631 fma -1000 NaN 0E+999999 -> NaN +fmax2632 fma -1 NaN 0E+999999 -> NaN +fmax2633 fma -0 NaN 0E+999999 -> NaN +fmax2634 fma 0 NaN 0E+999999 -> NaN +fmax2635 fma 1 NaN 0E+999999 -> NaN +fmax2636 fma 1000 NaN 0E+999999 -> NaN +fmax2637 fma Inf NaN 0E+999999 -> NaN + +fmax2641 fma sNaN -Inf 0E+999999 -> NaN Invalid_operation +fmax2642 fma sNaN -1000 0E+999999 -> NaN Invalid_operation +fmax2643 fma sNaN -1 0E+999999 -> NaN Invalid_operation +fmax2644 fma sNaN -0 0E+999999 -> NaN Invalid_operation +fmax2645 fma sNaN 0 0E+999999 -> NaN Invalid_operation +fmax2646 fma sNaN 1 0E+999999 -> NaN Invalid_operation +fmax2647 fma sNaN 1000 0E+999999 -> NaN Invalid_operation +fmax2648 fma sNaN NaN 0E+999999 -> NaN Invalid_operation +fmax2649 fma sNaN sNaN 0E+999999 -> NaN Invalid_operation +fmax2650 fma NaN sNaN 0E+999999 -> NaN Invalid_operation +fmax2651 fma -Inf sNaN 0E+999999 -> NaN Invalid_operation +fmax2652 fma -1000 sNaN 0E+999999 -> NaN Invalid_operation +fmax2653 fma -1 sNaN 0E+999999 -> NaN Invalid_operation +fmax2654 fma -0 sNaN 0E+999999 -> NaN Invalid_operation +fmax2655 fma 0 sNaN 0E+999999 -> NaN Invalid_operation +fmax2656 fma 1 sNaN 0E+999999 -> NaN Invalid_operation +fmax2657 fma 1000 sNaN 0E+999999 -> NaN Invalid_operation +fmax2658 fma Inf sNaN 0E+999999 -> NaN Invalid_operation +fmax2659 fma NaN sNaN 0E+999999 -> NaN Invalid_operation + +-- propagating NaNs +fmax2661 fma NaN9 -Inf 0E+999999 -> NaN9 +fmax2662 fma NaN8 999 0E+999999 -> NaN8 +fmax2663 fma NaN71 Inf 0E+999999 -> NaN71 +fmax2664 fma NaN6 NaN5 0E+999999 -> NaN6 +fmax2665 fma -Inf NaN4 0E+999999 -> NaN4 +fmax2666 fma -999 NaN33 0E+999999 -> NaN33 +fmax2667 fma Inf NaN2 0E+999999 -> NaN2 + +fmax2671 fma sNaN99 -Inf 0E+999999 -> NaN99 Invalid_operation +fmax2672 fma sNaN98 -11 0E+999999 -> NaN98 Invalid_operation +fmax2673 fma sNaN97 NaN 0E+999999 -> NaN97 Invalid_operation +fmax2674 fma sNaN16 sNaN94 0E+999999 -> NaN16 Invalid_operation +fmax2675 fma NaN95 sNaN93 0E+999999 -> NaN93 Invalid_operation +fmax2676 fma -Inf sNaN92 0E+999999 -> NaN92 Invalid_operation +fmax2677 fma 088 sNaN91 0E+999999 -> NaN91 Invalid_operation +fmax2678 fma Inf sNaN90 0E+999999 -> NaN90 Invalid_operation +fmax2679 fma NaN sNaN89 0E+999999 -> NaN89 Invalid_operation + +fmax2681 fma -NaN9 -Inf 0E+999999 -> -NaN9 +fmax2682 fma -NaN8 999 0E+999999 -> -NaN8 +fmax2683 fma -NaN71 Inf 0E+999999 -> -NaN71 +fmax2684 fma -NaN6 -NaN5 0E+999999 -> -NaN6 +fmax2685 fma -Inf -NaN4 0E+999999 -> -NaN4 +fmax2686 fma -999 -NaN33 0E+999999 -> -NaN33 +fmax2687 fma Inf -NaN2 0E+999999 -> -NaN2 + +fmax2691 fma -sNaN99 -Inf 0E+999999 -> -NaN99 Invalid_operation +fmax2692 fma -sNaN98 -11 0E+999999 -> -NaN98 Invalid_operation +fmax2693 fma -sNaN97 NaN 0E+999999 -> -NaN97 Invalid_operation +fmax2694 fma -sNaN16 -sNaN94 0E+999999 -> -NaN16 Invalid_operation +fmax2695 fma -NaN95 -sNaN93 0E+999999 -> -NaN93 Invalid_operation +fmax2696 fma -Inf -sNaN92 0E+999999 -> -NaN92 Invalid_operation +fmax2697 fma 088 -sNaN91 0E+999999 -> -NaN91 Invalid_operation +fmax2698 fma Inf -sNaN90 0E+999999 -> -NaN90 Invalid_operation +fmax2699 fma -NaN -sNaN89 0E+999999 -> -NaN89 Invalid_operation + +fmax2701 fma -NaN -Inf 0E+999999 -> -NaN +fmax2702 fma -NaN 999 0E+999999 -> -NaN +fmax2703 fma -NaN Inf 0E+999999 -> -NaN +fmax2704 fma -NaN -NaN 0E+999999 -> -NaN +fmax2705 fma -Inf -NaN0 0E+999999 -> -NaN +fmax2706 fma -999 -NaN 0E+999999 -> -NaN +fmax2707 fma Inf -NaN 0E+999999 -> -NaN + +fmax2711 fma -sNaN -Inf 0E+999999 -> -NaN Invalid_operation +fmax2712 fma -sNaN -11 0E+999999 -> -NaN Invalid_operation +fmax2713 fma -sNaN00 NaN 0E+999999 -> -NaN Invalid_operation +fmax2714 fma -sNaN -sNaN 0E+999999 -> -NaN Invalid_operation +fmax2715 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation +fmax2716 fma -Inf -sNaN 0E+999999 -> -NaN Invalid_operation +fmax2717 fma 088 -sNaN 0E+999999 -> -NaN Invalid_operation +fmax2718 fma Inf -sNaN 0E+999999 -> -NaN Invalid_operation +fmax2719 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +maxexponent: 999999 +minexponent: -999999 +fmax2730 fma +1.23456789012345E-0 9E+999999 0E+999999 -> Infinity Inexact Overflow Rounded +fmax2731 fma 9E+999999 +1.23456789012345E-0 0E+999999 -> Infinity Inexact Overflow Rounded +fmax2732 fma +0.100 9E-999999 0E+999999 -> 9.00E-1000000 Subnormal +fmax2733 fma 9E-999999 +0.100 0E+999999 -> 9.00E-1000000 Subnormal +fmax2735 fma -1.23456789012345E-0 9E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded +fmax2736 fma 9E+999999 -1.23456789012345E-0 0E+999999 -> -Infinity Inexact Overflow Rounded +fmax2737 fma -0.100 9E-999999 0E+999999 -> -9.00E-1000000 Subnormal +fmax2738 fma 9E-999999 -0.100 0E+999999 -> -9.00E-1000000 Subnormal + +-- signs +fmax2751 fma 1e+777777 1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2752 fma 1e+777777 -1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded +fmax2753 fma -1e+777777 1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded +fmax2754 fma -1e+777777 -1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2755 fma 1e-777777 1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +fmax2756 fma 1e-777777 -1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +fmax2757 fma -1e-777777 1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +fmax2758 fma -1e-777777 -1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +precision: 9 +fmax2760 fma 1e-600000 1e-400001 0E+999999 -> 1E-1000001 Subnormal +fmax2761 fma 1e-600000 1e-400002 0E+999999 -> 1E-1000002 Subnormal +fmax2762 fma 1e-600000 1e-400003 0E+999999 -> 1E-1000003 Subnormal +fmax2763 fma 1e-600000 1e-400004 0E+999999 -> 1E-1000004 Subnormal +fmax2764 fma 1e-600000 1e-400005 0E+999999 -> 1E-1000005 Subnormal +fmax2765 fma 1e-600000 1e-400006 0E+999999 -> 1E-1000006 Subnormal +fmax2766 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal +fmax2767 fma 1e-600000 1e-400008 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +fmax2768 fma 1e-600000 1e-400009 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +fmax2769 fma 1e-600000 1e-400010 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +fmax2770 fma 1e+600000 1e+400001 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2771 fma 1e+600000 1e+400002 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2772 fma 1e+600000 1e+400003 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2773 fma 1e+600000 1e+400004 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2774 fma 1e+600000 1e+400005 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2775 fma 1e+600000 1e+400006 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2776 fma 1e+600000 1e+400007 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2777 fma 1e+600000 1e+400008 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2778 fma 1e+600000 1e+400009 0E+999999 -> Infinity Overflow Inexact Rounded +fmax2779 fma 1e+600000 1e+400010 0E+999999 -> Infinity Overflow Inexact Rounded + +-- 'subnormal' test edge condition at higher precisions +precision: 99 +fmax2780 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal +fmax2781 fma 1e-600000 1e-400008 0E+999999 -> 1E-1000008 Subnormal +fmax2782 fma 1e-600000 1e-400097 0E+999999 -> 1E-1000097 Subnormal +fmax2783 fma 1e-600000 1e-400098 0E+999999 -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped +precision: 999 +fmax2784 fma 1e-600000 1e-400997 0E+999999 -> 1E-1000997 Subnormal +fmax2785 fma 1e-600000 1e-400998 0E+999999 -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped + +-- test subnormals rounding +precision: 5 +maxExponent: 999 +minexponent: -999 +rounding: half_even + +fmax2801 fma 1.0000E-999 1 0E+999999 -> 1.0000E-999 +fmax2802 fma 1.000E-999 1e-1 0E+999999 -> 1.000E-1000 Subnormal +fmax2803 fma 1.00E-999 1e-2 0E+999999 -> 1.00E-1001 Subnormal +fmax2804 fma 1.0E-999 1e-3 0E+999999 -> 1.0E-1002 Subnormal +fmax2805 fma 1.0E-999 1e-4 0E+999999 -> 1E-1003 Subnormal Rounded +fmax2806 fma 1.3E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded +fmax2807 fma 1.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2808 fma 1.7E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2809 fma 2.3E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2810 fma 2.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2811 fma 2.7E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded +fmax2812 fma 1.49E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded +fmax2813 fma 1.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2814 fma 1.51E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2815 fma 2.49E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2816 fma 2.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded +fmax2817 fma 2.51E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded + +fmax2818 fma 1E-999 1e-4 0E+999999 -> 1E-1003 Subnormal +fmax2819 fma 3E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +fmax2820 fma 5E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +fmax2821 fma 7E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded +fmax2822 fma 9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded +fmax2823 fma 9.9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded + +fmax2824 fma 1E-999 -1e-4 0E+999999 -> -1E-1003 Subnormal +fmax2825 fma 3E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +fmax2826 fma -5E-999 1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +fmax2827 fma 7E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded +fmax2828 fma -9E-999 1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded +fmax2829 fma 9.9E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded +fmax2830 fma 3.0E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped + +fmax2831 fma 1.0E-501 1e-501 0E+999999 -> 1.0E-1002 Subnormal +fmax2832 fma 2.0E-501 2e-501 0E+999999 -> 4.0E-1002 Subnormal +fmax2833 fma 4.0E-501 4e-501 0E+999999 -> 1.60E-1001 Subnormal +fmax2834 fma 10.0E-501 10e-501 0E+999999 -> 1.000E-1000 Subnormal +fmax2835 fma 30.0E-501 30e-501 0E+999999 -> 9.000E-1000 Subnormal +fmax2836 fma 40.0E-501 40e-501 0E+999999 -> 1.6000E-999 + +-- squares +fmax2840 fma 1E-502 1e-502 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +fmax2841 fma 1E-501 1e-501 0E+999999 -> 1E-1002 Subnormal +fmax2842 fma 2E-501 2e-501 0E+999999 -> 4E-1002 Subnormal +fmax2843 fma 4E-501 4e-501 0E+999999 -> 1.6E-1001 Subnormal +fmax2844 fma 10E-501 10e-501 0E+999999 -> 1.00E-1000 Subnormal +fmax2845 fma 30E-501 30e-501 0E+999999 -> 9.00E-1000 Subnormal +fmax2846 fma 40E-501 40e-501 0E+999999 -> 1.600E-999 + +-- cubes +fmax2850 fma 1E-670 1e-335 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +fmax2851 fma 1E-668 1e-334 0E+999999 -> 1E-1002 Subnormal +fmax2852 fma 4E-668 2e-334 0E+999999 -> 8E-1002 Subnormal +fmax2853 fma 9E-668 3e-334 0E+999999 -> 2.7E-1001 Subnormal +fmax2854 fma 16E-668 4e-334 0E+999999 -> 6.4E-1001 Subnormal +fmax2855 fma 25E-668 5e-334 0E+999999 -> 1.25E-1000 Subnormal +fmax2856 fma 10E-668 100e-334 0E+999999 -> 1.000E-999 + +-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent +precision: 19 +fmax2860 fma 6636851557994578716E-520 6636851557994578716E-520 0E+999999 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded + +-- Long operand overflow may be a different path +precision: 3 +maxExponent: 999999 +minexponent: -999999 +fmax2870 fma 1 9.999E+999999 0E+999999 -> Infinity Inexact Overflow Rounded +fmax2871 fma 1 -9.999E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded +fmax2872 fma 9.999E+999999 1 0E+999999 -> Infinity Inexact Overflow Rounded +fmax2873 fma -9.999E+999999 1 0E+999999 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +fmax2881 fma 1.2347E-40 1.2347E-40 0E+999999 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax2882 fma 1.234E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow +fmax2883 fma 1.23E-40 1.23E-40 0E+999999 -> 1.513E-80 Inexact Rounded Subnormal Underflow +fmax2884 fma 1.2E-40 1.2E-40 0E+999999 -> 1.44E-80 Subnormal +fmax2885 fma 1.2E-40 1.2E-41 0E+999999 -> 1.44E-81 Subnormal +fmax2886 fma 1.2E-40 1.2E-42 0E+999999 -> 1.4E-82 Subnormal Inexact Rounded Underflow +fmax2887 fma 1.2E-40 1.3E-42 0E+999999 -> 1.6E-82 Subnormal Inexact Rounded Underflow +fmax2888 fma 1.3E-40 1.3E-42 0E+999999 -> 1.7E-82 Subnormal Inexact Rounded Underflow +fmax2889 fma 1.3E-40 1.3E-43 0E+999999 -> 2E-83 Subnormal Inexact Rounded Underflow +fmax2890 fma 1.3E-41 1.3E-43 0E+999999 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow + +fmax2891 fma 1.2345E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded +fmax2892 fma 1.23456E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded +fmax2893 fma 1.2345E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow +fmax2894 fma 1.23456E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow +fmax2895 fma 1.2345E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow +fmax2896 fma 1.23456E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +fmax2900 fma 0.3000000000E-191 0.3000000000E-191 0E+999999 -> 9.00000000000000E-384 Subnormal Rounded +fmax2901 fma 0.3000000001E-191 0.3000000001E-191 0E+999999 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded +fmax2902 fma 9.999999999999999E-383 0.0999999999999 0E+999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded +fmax2903 fma 9.999999999999999E-383 0.09999999999999 0E+999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded +fmax2904 fma 9.999999999999999E-383 0.099999999999999 0E+999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded +fmax2905 fma 9.999999999999999E-383 0.0999999999999999 0E+999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded +-- prove operands are exact +fmax2906 fma 9.999999999999999E-383 1 0E+999999 -> 9.999999999999999E-383 +fmax2907 fma 1 0.09999999999999999 0E+999999 -> 0.09999999999999999 +-- the next rounds to Nmin +fmax2908 fma 9.999999999999999E-383 0.09999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax2909 fma 9.999999999999999E-383 0.099999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax2910 fma 9.999999999999999E-383 0.0999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax2911 fma 9.999999999999999E-383 0.09999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +fmax2921 fma 130E-2 120E-2 0E+999999 -> 1.5600 +fmax2922 fma 130E-2 12E-1 0E+999999 -> 1.560 +fmax2923 fma 130E-2 1E0 0E+999999 -> 1.30 + +-- Null tests +fmax2990 fma # 10 0E+999999 -> NaN Invalid_operation +fmax2991 fma 10 # 0E+999999 -> NaN Invalid_operation + +-- ADDITION TESTS ------------------------------------------------------ +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- [first group are 'quick confidence check'] +fmax3001 fma 1 1 1 -> 2 +fmax3002 fma 1 2 3 -> 5 +fmax3003 fma 1 '5.75' '3.3' -> 9.05 +fmax3004 fma 1 '5' '-3' -> 2 +fmax3005 fma 1 '-5' '-3' -> -8 +fmax3006 fma 1 '-7' '2.5' -> -4.5 +fmax3007 fma 1 '0.7' '0.3' -> 1.0 +fmax3008 fma 1 '1.25' '1.25' -> 2.50 +fmax3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789' +fmax3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800' + +fmax3011 fma 1 '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded +fmax3012 fma 1 '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded +fmax3013 fma 1 '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded +fmax3014 fma 1 '0.44444444449' '0' -> '0.444444444' Inexact Rounded +fmax3015 fma 1 '0.444444444499' '0' -> '0.444444444' Inexact Rounded +fmax3016 fma 1 '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +fmax3017 fma 1 '0.4444444445000' '0' -> '0.444444445' Inexact Rounded +fmax3018 fma 1 '0.4444444445001' '0' -> '0.444444445' Inexact Rounded +fmax3019 fma 1 '0.444444444501' '0' -> '0.444444445' Inexact Rounded +fmax3020 fma 1 '0.44444444451' '0' -> '0.444444445' Inexact Rounded + +fmax3021 fma 1 0 1 -> 1 +fmax3022 fma 1 1 1 -> 2 +fmax3023 fma 1 2 1 -> 3 +fmax3024 fma 1 3 1 -> 4 +fmax3025 fma 1 4 1 -> 5 +fmax3026 fma 1 5 1 -> 6 +fmax3027 fma 1 6 1 -> 7 +fmax3028 fma 1 7 1 -> 8 +fmax3029 fma 1 8 1 -> 9 +fmax3030 fma 1 9 1 -> 10 + +-- some carrying effects +fmax3031 fma 1 '0.9998' '0.0000' -> '0.9998' +fmax3032 fma 1 '0.9998' '0.0001' -> '0.9999' +fmax3033 fma 1 '0.9998' '0.0002' -> '1.0000' +fmax3034 fma 1 '0.9998' '0.0003' -> '1.0001' + +fmax3035 fma 1 '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded +fmax3036 fma 1 '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded +fmax3037 fma 1 '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded +fmax3038 fma 1 '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded +fmax3039 fma 1 '700000' '10000e+9' -> '1.00000007E+13' Rounded + +-- symmetry: +fmax3040 fma 1 '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +fmax3041 fma 1 '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +fmax3042 fma 1 '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded +fmax3044 fma 1 '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded +fmax3045 fma 1 '10000e+9' '700000' -> '1.00000007E+13' Rounded + +-- same, higher precision +precision: 15 +fmax3046 fma 1 '10000e+9' '7' -> '10000000000007' +fmax3047 fma 1 '10000e+9' '70' -> '10000000000070' +fmax3048 fma 1 '10000e+9' '700' -> '10000000000700' +fmax3049 fma 1 '10000e+9' '7000' -> '10000000007000' +fmax3050 fma 1 '10000e+9' '70000' -> '10000000070000' +fmax3051 fma 1 '10000e+9' '700000' -> '10000000700000' +fmax3052 fma 1 '10000e+9' '7000000' -> '10000007000000' + +-- examples from decarith +fmax3053 fma 1 '12' '7.00' -> '19.00' +fmax3054 fma 1 '1.3' '-1.07' -> '0.23' +fmax3055 fma 1 '1.3' '-1.30' -> '0.00' +fmax3056 fma 1 '1.3' '-2.07' -> '-0.77' +fmax3057 fma 1 '1E+2' '1E+4' -> '1.01E+4' + +-- zero preservation +precision: 6 +fmax3060 fma 1 '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +fmax3061 fma 1 1 '0.0001' -> '1.0001' +fmax3062 fma 1 1 '0.00001' -> '1.00001' +fmax3063 fma 1 1 '0.000001' -> '1.00000' Inexact Rounded +fmax3064 fma 1 1 '0.0000001' -> '1.00000' Inexact Rounded +fmax3065 fma 1 1 '0.00000001' -> '1.00000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +fmax3070 fma 1 1 0 -> 1 +fmax3071 fma 1 1 0. -> 1 +fmax3072 fma 1 1 .0 -> 1.0 +fmax3073 fma 1 1 0.0 -> 1.0 +fmax3074 fma 1 1 0.00 -> 1.00 +fmax3075 fma 1 0 1 -> 1 +fmax3076 fma 1 0. 1 -> 1 +fmax3077 fma 1 .0 1 -> 1.0 +fmax3078 fma 1 0.0 1 -> 1.0 +fmax3079 fma 1 0.00 1 -> 1.00 + +precision: 9 + +-- some carries +fmax3080 fma 1 999999998 1 -> 999999999 +fmax3081 fma 1 999999999 1 -> 1.00000000E+9 Rounded +fmax3082 fma 1 99999999 1 -> 100000000 +fmax3083 fma 1 9999999 1 -> 10000000 +fmax3084 fma 1 999999 1 -> 1000000 +fmax3085 fma 1 99999 1 -> 100000 +fmax3086 fma 1 9999 1 -> 10000 +fmax3087 fma 1 999 1 -> 1000 +fmax3088 fma 1 99 1 -> 100 +fmax3089 fma 1 9 1 -> 10 + + +-- more LHS swaps +fmax3090 fma 1 '-56267E-10' 0 -> '-0.0000056267' +fmax3091 fma 1 '-56267E-6' 0 -> '-0.056267' +fmax3092 fma 1 '-56267E-5' 0 -> '-0.56267' +fmax3093 fma 1 '-56267E-4' 0 -> '-5.6267' +fmax3094 fma 1 '-56267E-3' 0 -> '-56.267' +fmax3095 fma 1 '-56267E-2' 0 -> '-562.67' +fmax3096 fma 1 '-56267E-1' 0 -> '-5626.7' +fmax3097 fma 1 '-56267E-0' 0 -> '-56267' +fmax3098 fma 1 '-5E-10' 0 -> '-5E-10' +fmax3099 fma 1 '-5E-7' 0 -> '-5E-7' +fmax3100 fma 1 '-5E-6' 0 -> '-0.000005' +fmax3101 fma 1 '-5E-5' 0 -> '-0.00005' +fmax3102 fma 1 '-5E-4' 0 -> '-0.0005' +fmax3103 fma 1 '-5E-1' 0 -> '-0.5' +fmax3104 fma 1 '-5E0' 0 -> '-5' +fmax3105 fma 1 '-5E1' 0 -> '-50' +fmax3106 fma 1 '-5E5' 0 -> '-500000' +fmax3107 fma 1 '-5E8' 0 -> '-500000000' +fmax3108 fma 1 '-5E9' 0 -> '-5.00000000E+9' Rounded +fmax3109 fma 1 '-5E10' 0 -> '-5.00000000E+10' Rounded +fmax3110 fma 1 '-5E11' 0 -> '-5.00000000E+11' Rounded +fmax3111 fma 1 '-5E100' 0 -> '-5.00000000E+100' Rounded + +-- more RHS swaps +fmax3113 fma 1 0 '-56267E-10' -> '-0.0000056267' +fmax3114 fma 1 0 '-56267E-6' -> '-0.056267' +fmax3116 fma 1 0 '-56267E-5' -> '-0.56267' +fmax3117 fma 1 0 '-56267E-4' -> '-5.6267' +fmax3119 fma 1 0 '-56267E-3' -> '-56.267' +fmax3120 fma 1 0 '-56267E-2' -> '-562.67' +fmax3121 fma 1 0 '-56267E-1' -> '-5626.7' +fmax3122 fma 1 0 '-56267E-0' -> '-56267' +fmax3123 fma 1 0 '-5E-10' -> '-5E-10' +fmax3124 fma 1 0 '-5E-7' -> '-5E-7' +fmax3125 fma 1 0 '-5E-6' -> '-0.000005' +fmax3126 fma 1 0 '-5E-5' -> '-0.00005' +fmax3127 fma 1 0 '-5E-4' -> '-0.0005' +fmax3128 fma 1 0 '-5E-1' -> '-0.5' +fmax3129 fma 1 0 '-5E0' -> '-5' +fmax3130 fma 1 0 '-5E1' -> '-50' +fmax3131 fma 1 0 '-5E5' -> '-500000' +fmax3132 fma 1 0 '-5E8' -> '-500000000' +fmax3133 fma 1 0 '-5E9' -> '-5.00000000E+9' Rounded +fmax3134 fma 1 0 '-5E10' -> '-5.00000000E+10' Rounded +fmax3135 fma 1 0 '-5E11' -> '-5.00000000E+11' Rounded +fmax3136 fma 1 0 '-5E100' -> '-5.00000000E+100' Rounded + +-- related +fmax3137 fma 1 1 '0E-12' -> '1.00000000' Rounded +fmax3138 fma 1 -1 '0E-12' -> '-1.00000000' Rounded +fmax3139 fma 1 '0E-12' 1 -> '1.00000000' Rounded +fmax3140 fma 1 '0E-12' -1 -> '-1.00000000' Rounded +fmax3141 fma 1 1E+4 0.0000 -> '10000.0000' +fmax3142 fma 1 1E+4 0.00000 -> '10000.0000' Rounded +fmax3143 fma 1 0.000 1E+5 -> '100000.000' +fmax3144 fma 1 0.0000 1E+5 -> '100000.000' Rounded + +-- [some of the next group are really constructor tests] +fmax3146 fma 1 '00.0' 0 -> '0.0' +fmax3147 fma 1 '0.00' 0 -> '0.00' +fmax3148 fma 1 0 '0.00' -> '0.00' +fmax3149 fma 1 0 '00.0' -> '0.0' +fmax3150 fma 1 '00.0' '0.00' -> '0.00' +fmax3151 fma 1 '0.00' '00.0' -> '0.00' +fmax3152 fma 1 '3' '.3' -> '3.3' +fmax3153 fma 1 '3.' '.3' -> '3.3' +fmax3154 fma 1 '3.0' '.3' -> '3.3' +fmax3155 fma 1 '3.00' '.3' -> '3.30' +fmax3156 fma 1 '3' '3' -> '6' +fmax3157 fma 1 '3' '+3' -> '6' +fmax3158 fma 1 '3' '-3' -> '0' +fmax3159 fma 1 '0.3' '-0.3' -> '0.0' +fmax3160 fma 1 '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +precision: 15 +fmax3161 fma 1 '1E+12' '-1' -> '999999999999' +fmax3162 fma 1 '1E+12' '1.11' -> '1000000000001.11' +fmax3163 fma 1 '1.11' '1E+12' -> '1000000000001.11' +fmax3164 fma 1 '-1' '1E+12' -> '999999999999' +fmax3165 fma 1 '7E+12' '-1' -> '6999999999999' +fmax3166 fma 1 '7E+12' '1.11' -> '7000000000001.11' +fmax3167 fma 1 '1.11' '7E+12' -> '7000000000001.11' +fmax3168 fma 1 '-1' '7E+12' -> '6999999999999' + +-- 123456789012345 123456789012345 1 23456789012345 +fmax3170 fma 1 '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded +fmax3171 fma 1 '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded +fmax3172 fma 1 '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded +fmax3173 fma 1 '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded +fmax3174 fma 1 '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded +fmax3175 fma 1 '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded +fmax3176 fma 1 '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded +fmax3177 fma 1 '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded +fmax3178 fma 1 '0.444444444444444' '0.555555555555555' -> '0.999999999999999' +fmax3179 fma 1 '0.444444444444444' '0.555555555555554' -> '0.999999999999998' +fmax3180 fma 1 '0.444444444444444' '0.555555555555553' -> '0.999999999999997' +fmax3181 fma 1 '0.444444444444444' '0.555555555555552' -> '0.999999999999996' +fmax3182 fma 1 '0.444444444444444' '0.555555555555551' -> '0.999999999999995' +fmax3183 fma 1 '0.444444444444444' '0.555555555555550' -> '0.999999999999994' + +-- and some more, including residue effects and different roundings +precision: 9 +rounding: half_up +fmax3200 fma 1 '123456789' 0 -> '123456789' +fmax3201 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded +fmax3202 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded +fmax3203 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded +fmax3204 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded +fmax3205 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded +fmax3206 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded +fmax3207 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded +fmax3208 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded +fmax3209 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded +fmax3210 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded +fmax3211 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded +fmax3212 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded +fmax3213 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded +fmax3214 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded +fmax3215 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded +fmax3216 fma 1 '123456789' 1 -> '123456790' +fmax3217 fma 1 '123456789' 1.000000001 -> '123456790' Inexact Rounded +fmax3218 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded +fmax3219 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded + +rounding: half_even +fmax3220 fma 1 '123456789' 0 -> '123456789' +fmax3221 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded +fmax3222 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded +fmax3223 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded +fmax3224 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded +fmax3225 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded +fmax3226 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded +fmax3227 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded +fmax3228 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded +fmax3229 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded +fmax3230 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded +fmax3231 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded +fmax3232 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded +fmax3233 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded +fmax3234 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded +fmax3235 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded +fmax3236 fma 1 '123456789' 1 -> '123456790' +fmax3237 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded +fmax3238 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded +fmax3239 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded +-- critical few with even bottom digit... +fmax3240 fma 1 '123456788' 0.499999999 -> '123456788' Inexact Rounded +fmax3241 fma 1 '123456788' 0.5 -> '123456788' Inexact Rounded +fmax3242 fma 1 '123456788' 0.500000001 -> '123456789' Inexact Rounded + +rounding: down +fmax3250 fma 1 '123456789' 0 -> '123456789' +fmax3251 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded +fmax3252 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded +fmax3253 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded +fmax3254 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded +fmax3255 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded +fmax3256 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded +fmax3257 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded +fmax3258 fma 1 '123456789' 0.5 -> '123456789' Inexact Rounded +fmax3259 fma 1 '123456789' 0.500000001 -> '123456789' Inexact Rounded +fmax3260 fma 1 '123456789' 0.500001 -> '123456789' Inexact Rounded +fmax3261 fma 1 '123456789' 0.51 -> '123456789' Inexact Rounded +fmax3262 fma 1 '123456789' 0.6 -> '123456789' Inexact Rounded +fmax3263 fma 1 '123456789' 0.9 -> '123456789' Inexact Rounded +fmax3264 fma 1 '123456789' 0.99999 -> '123456789' Inexact Rounded +fmax3265 fma 1 '123456789' 0.999999999 -> '123456789' Inexact Rounded +fmax3266 fma 1 '123456789' 1 -> '123456790' +fmax3267 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded +fmax3268 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded +fmax3269 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded + +-- input preparation tests (operands should not be rounded) +precision: 3 +rounding: half_up + +fmax3270 fma 1 '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded +fmax3271 fma 1 '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded + +fmax3272 fma 1 '12E+3' '3444' -> '1.54E+4' Inexact Rounded +fmax3273 fma 1 '12E+3' '3446' -> '1.54E+4' Inexact Rounded +fmax3274 fma 1 '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded +fmax3275 fma 1 '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded +fmax3276 fma 1 '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded +fmax3277 fma 1 '12E+3' '3454' -> '1.55E+4' Inexact Rounded +fmax3278 fma 1 '12E+3' '3456' -> '1.55E+4' Inexact Rounded + +fmax3281 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3282 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3283 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3284 fma 1 '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded +fmax3285 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded +fmax3286 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded +fmax3287 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded + +rounding: half_down +fmax3291 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3292 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3293 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3294 fma 1 '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded +fmax3295 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded +fmax3296 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded +fmax3297 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +fmax3301 fma 1 -1 1 -> 0 +fmax3302 fma 1 0 1 -> 1 +fmax3303 fma 1 1 1 -> 2 +fmax3304 fma 1 12 1 -> 13 +fmax3305 fma 1 98 1 -> 99 +fmax3306 fma 1 99 1 -> 100 +fmax3307 fma 1 100 1 -> 101 +fmax3308 fma 1 101 1 -> 102 +fmax3309 fma 1 -1 -1 -> -2 +fmax3310 fma 1 0 -1 -> -1 +fmax3311 fma 1 1 -1 -> 0 +fmax3312 fma 1 12 -1 -> 11 +fmax3313 fma 1 98 -1 -> 97 +fmax3314 fma 1 99 -1 -> 98 +fmax3315 fma 1 100 -1 -> 99 +fmax3316 fma 1 101 -1 -> 100 + +fmax3321 fma 1 -0.01 0.01 -> 0.00 +fmax3322 fma 1 0.00 0.01 -> 0.01 +fmax3323 fma 1 0.01 0.01 -> 0.02 +fmax3324 fma 1 0.12 0.01 -> 0.13 +fmax3325 fma 1 0.98 0.01 -> 0.99 +fmax3326 fma 1 0.99 0.01 -> 1.00 +fmax3327 fma 1 1.00 0.01 -> 1.01 +fmax3328 fma 1 1.01 0.01 -> 1.02 +fmax3329 fma 1 -0.01 -0.01 -> -0.02 +fmax3330 fma 1 0.00 -0.01 -> -0.01 +fmax3331 fma 1 0.01 -0.01 -> 0.00 +fmax3332 fma 1 0.12 -0.01 -> 0.11 +fmax3333 fma 1 0.98 -0.01 -> 0.97 +fmax3334 fma 1 0.99 -0.01 -> 0.98 +fmax3335 fma 1 1.00 -0.01 -> 0.99 +fmax3336 fma 1 1.01 -0.01 -> 1.00 + +-- some more cases where fma 1 ing 0 affects the coefficient +precision: 9 +fmax3340 fma 1 1E+3 0 -> 1000 +fmax3341 fma 1 1E+8 0 -> 100000000 +fmax3342 fma 1 1E+9 0 -> 1.00000000E+9 Rounded +fmax3343 fma 1 1E+10 0 -> 1.00000000E+10 Rounded +-- which simply follow from these cases ... +fmax3344 fma 1 1E+3 1 -> 1001 +fmax3345 fma 1 1E+8 1 -> 100000001 +fmax3346 fma 1 1E+9 1 -> 1.00000000E+9 Inexact Rounded +fmax3347 fma 1 1E+10 1 -> 1.00000000E+10 Inexact Rounded +fmax3348 fma 1 1E+3 7 -> 1007 +fmax3349 fma 1 1E+8 7 -> 100000007 +fmax3350 fma 1 1E+9 7 -> 1.00000001E+9 Inexact Rounded +fmax3351 fma 1 1E+10 7 -> 1.00000000E+10 Inexact Rounded + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +fmax3361 fma 1 0E+50 10000E+1 -> 1.0000E+5 +fmax3362 fma 1 10000E+1 0E-50 -> 100000.0 Rounded +fmax3363 fma 1 10000E+1 10000E-50 -> 100000.0 Rounded Inexact +fmax3364 fma 1 9.999999E+92 -9.999999E+92 -> 0E+86 + +-- a curiosity from JSR 13 testing +rounding: half_down +precision: 10 +fmax3370 fma 1 99999999 81512 -> 100081511 +precision: 6 +fmax3371 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact +rounding: half_up +precision: 10 +fmax3372 fma 1 99999999 81512 -> 100081511 +precision: 6 +fmax3373 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact +rounding: half_even +precision: 10 +fmax3374 fma 1 99999999 81512 -> 100081511 +precision: 6 +fmax3375 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact + +-- ulp replacement tests +precision: 9 +maxexponent: 999999 +minexponent: -999999 +fmax3400 fma 1 1 77e-7 -> 1.0000077 +fmax3401 fma 1 1 77e-8 -> 1.00000077 +fmax3402 fma 1 1 77e-9 -> 1.00000008 Inexact Rounded +fmax3403 fma 1 1 77e-10 -> 1.00000001 Inexact Rounded +fmax3404 fma 1 1 77e-11 -> 1.00000000 Inexact Rounded +fmax3405 fma 1 1 77e-12 -> 1.00000000 Inexact Rounded +fmax3406 fma 1 1 77e-999 -> 1.00000000 Inexact Rounded +fmax3407 fma 1 1 77e-999999 -> 1.00000000 Inexact Rounded + +fmax3410 fma 1 10 77e-7 -> 10.0000077 +fmax3411 fma 1 10 77e-8 -> 10.0000008 Inexact Rounded +fmax3412 fma 1 10 77e-9 -> 10.0000001 Inexact Rounded +fmax3413 fma 1 10 77e-10 -> 10.0000000 Inexact Rounded +fmax3414 fma 1 10 77e-11 -> 10.0000000 Inexact Rounded +fmax3415 fma 1 10 77e-12 -> 10.0000000 Inexact Rounded +fmax3416 fma 1 10 77e-999 -> 10.0000000 Inexact Rounded +fmax3417 fma 1 10 77e-999999 -> 10.0000000 Inexact Rounded + +fmax3420 fma 1 77e-7 1 -> 1.0000077 +fmax3421 fma 1 77e-8 1 -> 1.00000077 +fmax3422 fma 1 77e-9 1 -> 1.00000008 Inexact Rounded +fmax3423 fma 1 77e-10 1 -> 1.00000001 Inexact Rounded +fmax3424 fma 1 77e-11 1 -> 1.00000000 Inexact Rounded +fmax3425 fma 1 77e-12 1 -> 1.00000000 Inexact Rounded +fmax3426 fma 1 77e-999 1 -> 1.00000000 Inexact Rounded +fmax3427 fma 1 77e-999999 1 -> 1.00000000 Inexact Rounded + +fmax3430 fma 1 77e-7 10 -> 10.0000077 +fmax3431 fma 1 77e-8 10 -> 10.0000008 Inexact Rounded +fmax3432 fma 1 77e-9 10 -> 10.0000001 Inexact Rounded +fmax3433 fma 1 77e-10 10 -> 10.0000000 Inexact Rounded +fmax3434 fma 1 77e-11 10 -> 10.0000000 Inexact Rounded +fmax3435 fma 1 77e-12 10 -> 10.0000000 Inexact Rounded +fmax3436 fma 1 77e-999 10 -> 10.0000000 Inexact Rounded +fmax3437 fma 1 77e-999999 10 -> 10.0000000 Inexact Rounded + +-- negative ulps +fmax3440 fma 1 1 -77e-7 -> 0.9999923 +fmax3441 fma 1 1 -77e-8 -> 0.99999923 +fmax3442 fma 1 1 -77e-9 -> 0.999999923 +fmax3443 fma 1 1 -77e-10 -> 0.999999992 Inexact Rounded +fmax3444 fma 1 1 -77e-11 -> 0.999999999 Inexact Rounded +fmax3445 fma 1 1 -77e-12 -> 1.00000000 Inexact Rounded +fmax3446 fma 1 1 -77e-999 -> 1.00000000 Inexact Rounded +fmax3447 fma 1 1 -77e-999999 -> 1.00000000 Inexact Rounded + +fmax3450 fma 1 10 -77e-7 -> 9.9999923 +fmax3451 fma 1 10 -77e-8 -> 9.99999923 +fmax3452 fma 1 10 -77e-9 -> 9.99999992 Inexact Rounded +fmax3453 fma 1 10 -77e-10 -> 9.99999999 Inexact Rounded +fmax3454 fma 1 10 -77e-11 -> 10.0000000 Inexact Rounded +fmax3455 fma 1 10 -77e-12 -> 10.0000000 Inexact Rounded +fmax3456 fma 1 10 -77e-999 -> 10.0000000 Inexact Rounded +fmax3457 fma 1 10 -77e-999999 -> 10.0000000 Inexact Rounded + +fmax3460 fma 1 -77e-7 1 -> 0.9999923 +fmax3461 fma 1 -77e-8 1 -> 0.99999923 +fmax3462 fma 1 -77e-9 1 -> 0.999999923 +fmax3463 fma 1 -77e-10 1 -> 0.999999992 Inexact Rounded +fmax3464 fma 1 -77e-11 1 -> 0.999999999 Inexact Rounded +fmax3465 fma 1 -77e-12 1 -> 1.00000000 Inexact Rounded +fmax3466 fma 1 -77e-999 1 -> 1.00000000 Inexact Rounded +fmax3467 fma 1 -77e-999999 1 -> 1.00000000 Inexact Rounded + +fmax3470 fma 1 -77e-7 10 -> 9.9999923 +fmax3471 fma 1 -77e-8 10 -> 9.99999923 +fmax3472 fma 1 -77e-9 10 -> 9.99999992 Inexact Rounded +fmax3473 fma 1 -77e-10 10 -> 9.99999999 Inexact Rounded +fmax3474 fma 1 -77e-11 10 -> 10.0000000 Inexact Rounded +fmax3475 fma 1 -77e-12 10 -> 10.0000000 Inexact Rounded +fmax3476 fma 1 -77e-999 10 -> 10.0000000 Inexact Rounded +fmax3477 fma 1 -77e-999999 10 -> 10.0000000 Inexact Rounded + +-- negative ulps +fmax3480 fma 1 -1 77e-7 -> -0.9999923 +fmax3481 fma 1 -1 77e-8 -> -0.99999923 +fmax3482 fma 1 -1 77e-9 -> -0.999999923 +fmax3483 fma 1 -1 77e-10 -> -0.999999992 Inexact Rounded +fmax3484 fma 1 -1 77e-11 -> -0.999999999 Inexact Rounded +fmax3485 fma 1 -1 77e-12 -> -1.00000000 Inexact Rounded +fmax3486 fma 1 -1 77e-999 -> -1.00000000 Inexact Rounded +fmax3487 fma 1 -1 77e-999999 -> -1.00000000 Inexact Rounded + +fmax3490 fma 1 -10 77e-7 -> -9.9999923 +fmax3491 fma 1 -10 77e-8 -> -9.99999923 +fmax3492 fma 1 -10 77e-9 -> -9.99999992 Inexact Rounded +fmax3493 fma 1 -10 77e-10 -> -9.99999999 Inexact Rounded +fmax3494 fma 1 -10 77e-11 -> -10.0000000 Inexact Rounded +fmax3495 fma 1 -10 77e-12 -> -10.0000000 Inexact Rounded +fmax3496 fma 1 -10 77e-999 -> -10.0000000 Inexact Rounded +fmax3497 fma 1 -10 77e-999999 -> -10.0000000 Inexact Rounded + +fmax3500 fma 1 77e-7 -1 -> -0.9999923 +fmax3501 fma 1 77e-8 -1 -> -0.99999923 +fmax3502 fma 1 77e-9 -1 -> -0.999999923 +fmax3503 fma 1 77e-10 -1 -> -0.999999992 Inexact Rounded +fmax3504 fma 1 77e-11 -1 -> -0.999999999 Inexact Rounded +fmax3505 fma 1 77e-12 -1 -> -1.00000000 Inexact Rounded +fmax3506 fma 1 77e-999 -1 -> -1.00000000 Inexact Rounded +fmax3507 fma 1 77e-999999 -1 -> -1.00000000 Inexact Rounded + +fmax3510 fma 1 77e-7 -10 -> -9.9999923 +fmax3511 fma 1 77e-8 -10 -> -9.99999923 +fmax3512 fma 1 77e-9 -10 -> -9.99999992 Inexact Rounded +fmax3513 fma 1 77e-10 -10 -> -9.99999999 Inexact Rounded +fmax3514 fma 1 77e-11 -10 -> -10.0000000 Inexact Rounded +fmax3515 fma 1 77e-12 -10 -> -10.0000000 Inexact Rounded +fmax3516 fma 1 77e-999 -10 -> -10.0000000 Inexact Rounded +fmax3517 fma 1 77e-999999 -10 -> -10.0000000 Inexact Rounded + + +-- long operands +maxexponent: 999 +minexponent: -999 +precision: 9 +fmax3521 fma 1 12345678000 0 -> 1.23456780E+10 Rounded +fmax3522 fma 1 0 12345678000 -> 1.23456780E+10 Rounded +fmax3523 fma 1 1234567800 0 -> 1.23456780E+9 Rounded +fmax3524 fma 1 0 1234567800 -> 1.23456780E+9 Rounded +fmax3525 fma 1 1234567890 0 -> 1.23456789E+9 Rounded +fmax3526 fma 1 0 1234567890 -> 1.23456789E+9 Rounded +fmax3527 fma 1 1234567891 0 -> 1.23456789E+9 Inexact Rounded +fmax3528 fma 1 0 1234567891 -> 1.23456789E+9 Inexact Rounded +fmax3529 fma 1 12345678901 0 -> 1.23456789E+10 Inexact Rounded +fmax3530 fma 1 0 12345678901 -> 1.23456789E+10 Inexact Rounded +fmax3531 fma 1 1234567896 0 -> 1.23456790E+9 Inexact Rounded +fmax3532 fma 1 0 1234567896 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +fmax3541 fma 1 12345678000 0 -> 12345678000 +fmax3542 fma 1 0 12345678000 -> 12345678000 +fmax3543 fma 1 1234567800 0 -> 1234567800 +fmax3544 fma 1 0 1234567800 -> 1234567800 +fmax3545 fma 1 1234567890 0 -> 1234567890 +fmax3546 fma 1 0 1234567890 -> 1234567890 +fmax3547 fma 1 1234567891 0 -> 1234567891 +fmax3548 fma 1 0 1234567891 -> 1234567891 +fmax3549 fma 1 12345678901 0 -> 12345678901 +fmax3550 fma 1 0 12345678901 -> 12345678901 +fmax3551 fma 1 1234567896 0 -> 1234567896 +fmax3552 fma 1 0 1234567896 -> 1234567896 + +-- verify a query +precision: 16 +maxExponent: +394 +minExponent: -393 +rounding: down +fmax3561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +fmax3562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +-- and using decimal64 bounds... +precision: 16 +maxExponent: +384 +minExponent: -383 +rounding: down +fmax3563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +fmax3564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + + +-- some more residue effects with extreme rounding +precision: 9 +rounding: half_up +fmax3601 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: half_even +fmax3602 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: half_down +fmax3603 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: floor +fmax3604 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: ceiling +fmax3605 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded +rounding: up +fmax3606 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded +rounding: down +fmax3607 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded + +rounding: half_up +fmax3611 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: half_even +fmax3612 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: half_down +fmax3613 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: floor +fmax3614 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded +rounding: ceiling +fmax3615 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: up +fmax3616 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: down +fmax3617 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded + +rounding: half_up +fmax3621 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: half_even +fmax3622 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: half_down +fmax3623 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: floor +fmax3624 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: ceiling +fmax3625 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded +rounding: up +fmax3626 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded +rounding: down +fmax3627 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded + +rounding: half_up +fmax3631 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: half_even +fmax3632 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: half_down +fmax3633 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: floor +fmax3634 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded +rounding: ceiling +fmax3635 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: up +fmax3636 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: down +fmax3637 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded + +rounding: half_up +fmax3641 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: half_even +fmax3642 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: half_down +fmax3643 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: floor +fmax3644 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded +rounding: ceiling +fmax3645 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: up +fmax3646 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: down +fmax3647 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded + +rounding: half_up +fmax3651 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: half_even +fmax3652 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: half_down +fmax3653 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: floor +fmax3654 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: ceiling +fmax3655 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded +rounding: up +fmax3656 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded +rounding: down +fmax3657 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded + +-- long operand triangle +rounding: half_up +precision: 37 +fmax3660 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538 +precision: 36 +fmax3661 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded +precision: 35 +fmax3662 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded +precision: 34 +fmax3663 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded +precision: 33 +fmax3664 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded +precision: 32 +fmax3665 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded +precision: 31 +fmax3666 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded +precision: 30 +fmax3667 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded +precision: 29 +fmax3668 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded +precision: 28 +fmax3669 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded +precision: 27 +fmax3670 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded +precision: 26 +fmax3671 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded +precision: 25 +fmax3672 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded +precision: 24 +fmax3673 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded +precision: 23 +fmax3674 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded +precision: 22 +fmax3675 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded +precision: 21 +fmax3676 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded +precision: 20 +fmax3677 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded +precision: 19 +fmax3678 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded +precision: 18 +fmax3679 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded +precision: 17 +fmax3680 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded +precision: 16 +fmax3681 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded +precision: 15 +fmax3682 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded +precision: 14 +fmax3683 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded +precision: 13 +fmax3684 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded +precision: 12 +fmax3685 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded +precision: 11 +fmax3686 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded +precision: 10 +fmax3687 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded +precision: 9 +fmax3688 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded +precision: 8 +fmax3689 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded +precision: 7 +fmax3690 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded +precision: 6 +fmax3691 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded +precision: 5 +fmax3692 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded +precision: 4 +fmax3693 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded +precision: 3 +fmax3694 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded +precision: 2 +fmax3695 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded +precision: 1 +fmax3696 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded + +-- more zeros, etc. +rounding: half_up +precision: 9 + +fmax3701 fma 1 5.00 1.00E-3 -> 5.00100 +fmax3702 fma 1 00.00 0.000 -> 0.000 +fmax3703 fma 1 00.00 0E-3 -> 0.000 +fmax3704 fma 1 0E-3 00.00 -> 0.000 + +fmax3710 fma 1 0E+3 00.00 -> 0.00 +fmax3711 fma 1 0E+3 00.0 -> 0.0 +fmax3712 fma 1 0E+3 00. -> 0 +fmax3713 fma 1 0E+3 00.E+1 -> 0E+1 +fmax3714 fma 1 0E+3 00.E+2 -> 0E+2 +fmax3715 fma 1 0E+3 00.E+3 -> 0E+3 +fmax3716 fma 1 0E+3 00.E+4 -> 0E+3 +fmax3717 fma 1 0E+3 00.E+5 -> 0E+3 +fmax3718 fma 1 0E+3 -00.0 -> 0.0 +fmax3719 fma 1 0E+3 -00. -> 0 +fmax3731 fma 1 0E+3 -00.E+1 -> 0E+1 + +fmax3720 fma 1 00.00 0E+3 -> 0.00 +fmax3721 fma 1 00.0 0E+3 -> 0.0 +fmax3722 fma 1 00. 0E+3 -> 0 +fmax3723 fma 1 00.E+1 0E+3 -> 0E+1 +fmax3724 fma 1 00.E+2 0E+3 -> 0E+2 +fmax3725 fma 1 00.E+3 0E+3 -> 0E+3 +fmax3726 fma 1 00.E+4 0E+3 -> 0E+3 +fmax3727 fma 1 00.E+5 0E+3 -> 0E+3 +fmax3728 fma 1 -00.00 0E+3 -> 0.00 +fmax3729 fma 1 -00.0 0E+3 -> 0.0 +fmax3730 fma 1 -00. 0E+3 -> 0 + +fmax3732 fma 1 0 0 -> 0 +fmax3733 fma 1 0 -0 -> 0 +fmax3734 fma 1 -0 0 -> 0 +fmax3735 fma 1 -0 -0 -> -0 -- IEEE 854 special case + +fmax3736 fma 1 1 -1 -> 0 +fmax3737 fma 1 -1 -1 -> -2 +fmax3738 fma 1 1 1 -> 2 +fmax3739 fma 1 -1 1 -> 0 + +fmax3741 fma 1 0 -1 -> -1 +fmax3742 fma 1 -0 -1 -> -1 +fmax3743 fma 1 0 1 -> 1 +fmax3744 fma 1 -0 1 -> 1 +fmax3745 fma 1 -1 0 -> -1 +fmax3746 fma 1 -1 -0 -> -1 +fmax3747 fma 1 1 0 -> 1 +fmax3748 fma 1 1 -0 -> 1 + +fmax3751 fma 1 0.0 -1 -> -1.0 +fmax3752 fma 1 -0.0 -1 -> -1.0 +fmax3753 fma 1 0.0 1 -> 1.0 +fmax3754 fma 1 -0.0 1 -> 1.0 +fmax3755 fma 1 -1.0 0 -> -1.0 +fmax3756 fma 1 -1.0 -0 -> -1.0 +fmax3757 fma 1 1.0 0 -> 1.0 +fmax3758 fma 1 1.0 -0 -> 1.0 + +fmax3761 fma 1 0 -1.0 -> -1.0 +fmax3762 fma 1 -0 -1.0 -> -1.0 +fmax3763 fma 1 0 1.0 -> 1.0 +fmax3764 fma 1 -0 1.0 -> 1.0 +fmax3765 fma 1 -1 0.0 -> -1.0 +fmax3766 fma 1 -1 -0.0 -> -1.0 +fmax3767 fma 1 1 0.0 -> 1.0 +fmax3768 fma 1 1 -0.0 -> 1.0 + +fmax3771 fma 1 0.0 -1.0 -> -1.0 +fmax3772 fma 1 -0.0 -1.0 -> -1.0 +fmax3773 fma 1 0.0 1.0 -> 1.0 +fmax3774 fma 1 -0.0 1.0 -> 1.0 +fmax3775 fma 1 -1.0 0.0 -> -1.0 +fmax3776 fma 1 -1.0 -0.0 -> -1.0 +fmax3777 fma 1 1.0 0.0 -> 1.0 +fmax3778 fma 1 1.0 -0.0 -> 1.0 + +-- Specials +fmax3780 fma 1 -Inf -Inf -> -Infinity +fmax3781 fma 1 -Inf -1000 -> -Infinity +fmax3782 fma 1 -Inf -1 -> -Infinity +fmax3783 fma 1 -Inf -0 -> -Infinity +fmax3784 fma 1 -Inf 0 -> -Infinity +fmax3785 fma 1 -Inf 1 -> -Infinity +fmax3786 fma 1 -Inf 1000 -> -Infinity +fmax3787 fma 1 -1000 -Inf -> -Infinity +fmax3788 fma 1 -Inf -Inf -> -Infinity +fmax3789 fma 1 -1 -Inf -> -Infinity +fmax3790 fma 1 -0 -Inf -> -Infinity +fmax3791 fma 1 0 -Inf -> -Infinity +fmax3792 fma 1 1 -Inf -> -Infinity +fmax3793 fma 1 1000 -Inf -> -Infinity +fmax3794 fma 1 Inf -Inf -> NaN Invalid_operation + +fmax3800 fma 1 Inf -Inf -> NaN Invalid_operation +fmax3801 fma 1 Inf -1000 -> Infinity +fmax3802 fma 1 Inf -1 -> Infinity +fmax3803 fma 1 Inf -0 -> Infinity +fmax3804 fma 1 Inf 0 -> Infinity +fmax3805 fma 1 Inf 1 -> Infinity +fmax3806 fma 1 Inf 1000 -> Infinity +fmax3807 fma 1 Inf Inf -> Infinity +fmax3808 fma 1 -1000 Inf -> Infinity +fmax3809 fma 1 -Inf Inf -> NaN Invalid_operation +fmax3810 fma 1 -1 Inf -> Infinity +fmax3811 fma 1 -0 Inf -> Infinity +fmax3812 fma 1 0 Inf -> Infinity +fmax3813 fma 1 1 Inf -> Infinity +fmax3814 fma 1 1000 Inf -> Infinity +fmax3815 fma 1 Inf Inf -> Infinity + +fmax3821 fma 1 NaN -Inf -> NaN +fmax3822 fma 1 NaN -1000 -> NaN +fmax3823 fma 1 NaN -1 -> NaN +fmax3824 fma 1 NaN -0 -> NaN +fmax3825 fma 1 NaN 0 -> NaN +fmax3826 fma 1 NaN 1 -> NaN +fmax3827 fma 1 NaN 1000 -> NaN +fmax3828 fma 1 NaN Inf -> NaN +fmax3829 fma 1 NaN NaN -> NaN +fmax3830 fma 1 -Inf NaN -> NaN +fmax3831 fma 1 -1000 NaN -> NaN +fmax3832 fma 1 -1 NaN -> NaN +fmax3833 fma 1 -0 NaN -> NaN +fmax3834 fma 1 0 NaN -> NaN +fmax3835 fma 1 1 NaN -> NaN +fmax3836 fma 1 1000 NaN -> NaN +fmax3837 fma 1 Inf NaN -> NaN + +fmax3841 fma 1 sNaN -Inf -> NaN Invalid_operation +fmax3842 fma 1 sNaN -1000 -> NaN Invalid_operation +fmax3843 fma 1 sNaN -1 -> NaN Invalid_operation +fmax3844 fma 1 sNaN -0 -> NaN Invalid_operation +fmax3845 fma 1 sNaN 0 -> NaN Invalid_operation +fmax3846 fma 1 sNaN 1 -> NaN Invalid_operation +fmax3847 fma 1 sNaN 1000 -> NaN Invalid_operation +fmax3848 fma 1 sNaN NaN -> NaN Invalid_operation +fmax3849 fma 1 sNaN sNaN -> NaN Invalid_operation +fmax3850 fma 1 NaN sNaN -> NaN Invalid_operation +fmax3851 fma 1 -Inf sNaN -> NaN Invalid_operation +fmax3852 fma 1 -1000 sNaN -> NaN Invalid_operation +fmax3853 fma 1 -1 sNaN -> NaN Invalid_operation +fmax3854 fma 1 -0 sNaN -> NaN Invalid_operation +fmax3855 fma 1 0 sNaN -> NaN Invalid_operation +fmax3856 fma 1 1 sNaN -> NaN Invalid_operation +fmax3857 fma 1 1000 sNaN -> NaN Invalid_operation +fmax3858 fma 1 Inf sNaN -> NaN Invalid_operation +fmax3859 fma 1 NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +fmax3861 fma 1 NaN1 -Inf -> NaN1 +fmax3862 fma 1 +NaN2 -1000 -> NaN2 +fmax3863 fma 1 NaN3 1000 -> NaN3 +fmax3864 fma 1 NaN4 Inf -> NaN4 +fmax3865 fma 1 NaN5 +NaN6 -> NaN5 +fmax3866 fma 1 -Inf NaN7 -> NaN7 +fmax3867 fma 1 -1000 NaN8 -> NaN8 +fmax3868 fma 1 1000 NaN9 -> NaN9 +fmax3869 fma 1 Inf +NaN10 -> NaN10 +fmax3871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation +fmax3872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation +fmax3873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation +fmax3874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation +fmax3875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation +fmax3876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation +fmax3877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation +fmax3878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation +fmax3879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation +fmax3880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation +fmax3881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation +fmax3882 fma 1 -NaN26 NaN28 -> -NaN26 +fmax3883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation +fmax3884 fma 1 1000 -NaN30 -> -NaN30 +fmax3885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- overflow, underflow and subnormal tests +maxexponent: 999999 +minexponent: -999999 +precision: 9 +fmax3890 fma 1 1E+999999 9E+999999 -> Infinity Overflow Inexact Rounded +fmax3891 fma 1 9E+999999 1E+999999 -> Infinity Overflow Inexact Rounded +fmax3892 fma 1 -1.1E-999999 1E-999999 -> -1E-1000000 Subnormal +fmax3893 fma 1 1E-999999 -1.1e-999999 -> -1E-1000000 Subnormal +fmax3894 fma 1 -1.0001E-999999 1E-999999 -> -1E-1000003 Subnormal +fmax3895 fma 1 1E-999999 -1.0001e-999999 -> -1E-1000003 Subnormal +fmax3896 fma 1 -1E+999999 -9E+999999 -> -Infinity Overflow Inexact Rounded +fmax3897 fma 1 -9E+999999 -1E+999999 -> -Infinity Overflow Inexact Rounded +fmax3898 fma 1 +1.1E-999999 -1E-999999 -> 1E-1000000 Subnormal +fmax3899 fma 1 -1E-999999 +1.1e-999999 -> 1E-1000000 Subnormal +fmax3900 fma 1 +1.0001E-999999 -1E-999999 -> 1E-1000003 Subnormal +fmax3901 fma 1 -1E-999999 +1.0001e-999999 -> 1E-1000003 Subnormal +fmax3902 fma 1 -1E+999999 +9E+999999 -> 8E+999999 +fmax3903 fma 1 -9E+999999 +1E+999999 -> -8E+999999 + +precision: 3 +fmax3904 fma 1 0 -9.999E+999999 -> -Infinity Inexact Overflow Rounded +fmax3905 fma 1 -9.999E+999999 0 -> -Infinity Inexact Overflow Rounded +fmax3906 fma 1 0 9.999E+999999 -> Infinity Inexact Overflow Rounded +fmax3907 fma 1 9.999E+999999 0 -> Infinity Inexact Overflow Rounded + +precision: 3 +maxexponent: 999 +minexponent: -999 +fmax3910 fma 1 1.00E-999 0 -> 1.00E-999 +fmax3911 fma 1 0.1E-999 0 -> 1E-1000 Subnormal +fmax3912 fma 1 0.10E-999 0 -> 1.0E-1000 Subnormal +fmax3913 fma 1 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded +fmax3914 fma 1 0.01E-999 0 -> 1E-1001 Subnormal +-- next is rounded to Nmin +fmax3915 fma 1 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow +fmax3916 fma 1 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +fmax3917 fma 1 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow +fmax3918 fma 1 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +fmax3919 fma 1 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +fmax3920 fma 1 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +fmax3930 fma 1 -1.00E-999 0 -> -1.00E-999 +fmax3931 fma 1 -0.1E-999 0 -> -1E-1000 Subnormal +fmax3932 fma 1 -0.10E-999 0 -> -1.0E-1000 Subnormal +fmax3933 fma 1 -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded +fmax3934 fma 1 -0.01E-999 0 -> -1E-1001 Subnormal +-- next is rounded to Nmin +fmax3935 fma 1 -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow +fmax3936 fma 1 -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +fmax3937 fma 1 -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow +fmax3938 fma 1 -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +fmax3939 fma 1 -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +fmax3940 fma 1 -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- some non-zero subnormal fma 1 s +fmax3950 fma 1 1.00E-999 0.1E-999 -> 1.10E-999 +fmax3951 fma 1 0.1E-999 0.1E-999 -> 2E-1000 Subnormal +fmax3952 fma 1 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal +fmax3953 fma 1 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded +fmax3954 fma 1 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal +fmax3955 fma 1 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded +fmax3956 fma 1 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow +fmax3957 fma 1 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow +fmax3958 fma 1 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +fmax3959 fma 1 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +fmax3960 fma 1 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +-- negatives... +fmax3961 fma 1 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal +fmax3962 fma 1 0.1E-999 -0.1E-999 -> 0E-1000 +fmax3963 fma 1 0.10E-999 -0.1E-999 -> 0E-1001 +fmax3964 fma 1 0.100E-999 -0.1E-999 -> 0E-1001 Clamped +fmax3965 fma 1 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal +fmax3966 fma 1 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow +fmax3967 fma 1 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +fmax3968 fma 1 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow +fmax3969 fma 1 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +fmax3970 fma 1 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +fmax3971 fma 1 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow + +-- some 'real' numbers +maxExponent: 384 +minExponent: -383 +precision: 8 +fmax3566 fma 1 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal +precision: 7 +fmax3567 fma 1 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal +precision: 6 +fmax3568 fma 1 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal + +-- now the case where we can get underflow but the result is normal +-- [note this can't happen if the operands are also bounded, as we +-- cannot represent 1E-399, for example] +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +fmax3571 fma 1 1E-383 0 -> 1E-383 +fmax3572 fma 1 1E-384 0 -> 1E-384 Subnormal +fmax3573 fma 1 1E-383 1E-384 -> 1.1E-383 +fmax3574 subtract 1E-383 1E-384 -> 9E-384 Subnormal + +-- Here we explore the boundary of rounding a subnormal to Nmin +fmax3575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +fmax3576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +fmax3577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax3578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax3579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax3580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +-- Add: lhs and rhs 0 +fmax31001 fma 1 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31002 fma 1 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31003 fma 1 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31004 fma 1 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31005 fma 1 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31006 fma 1 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Add: lhs >> rhs and vice versa +fmax31011 fma 1 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31012 fma 1 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31013 fma 1 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31014 fma 1 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31015 fma 1 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +fmax31016 fma 1 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Add: lhs + rhs fma 1 ition carried out +fmax31021 fma 1 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +fmax31022 fma 1 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +fmax31023 fma 1 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +fmax31024 fma 1 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +fmax31025 fma 1 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +fmax31026 fma 1 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow + +-- And for round down full and subnormal results +precision: 16 +maxExponent: +384 +minExponent: -383 +rounding: down + +fmax31100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +fmax31101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +fmax31103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +fmax31104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +fmax31105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +fmax31106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +fmax31107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +fmax31108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +fmax31109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +fmax31110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +fmax31111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +fmax31113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +fmax31114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +fmax31115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +fmax31116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +fmax31117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +fmax31118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +fmax31119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +rounding: down +precision: 7 +maxExponent: +96 +minExponent: -95 +fmax31130 fma 1 1 -1e-200 -> 0.9999999 Rounded Inexact +-- subnormal boundary +fmax31131 fma 1 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact +fmax31132 fma 1 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact +fmax31133 fma 1 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow +fmax31134 fma 1 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow +fmax31135 fma 1 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow +fmax31136 fma 1 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow +fmax31137 fma 1 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal +fmax31138 fma 1 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow +fmax31139 fma 1 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow +fmax31140 fma 1 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow +fmax31141 fma 1 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow +fmax31142 fma 1 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +fmax31143 fma 1 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +fmax31144 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +fmax31151 fma 1 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow +fmax31152 fma 1 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow +fmax31153 fma 1 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow +fmax31154 fma 1 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +fmax31155 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +fmax31156 fma 1 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +fmax31157 fma 1 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +fmax31160 fma 1 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +fmax31161 fma 1 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +-- tests based on Gunnar Degnbol's edge case +precision: 15 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +fmax31200 fma 1 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded +fmax31201 fma 1 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded +fmax31210 fma 1 1E15 -0.51 -> 999999999999999 Inexact Rounded +fmax31211 fma 1 1E15 -0.501 -> 999999999999999 Inexact Rounded +fmax31212 fma 1 1E15 -0.5001 -> 999999999999999 Inexact Rounded +fmax31213 fma 1 1E15 -0.50001 -> 999999999999999 Inexact Rounded +fmax31214 fma 1 1E15 -0.500001 -> 999999999999999 Inexact Rounded +fmax31215 fma 1 1E15 -0.5000001 -> 999999999999999 Inexact Rounded +fmax31216 fma 1 1E15 -0.50000001 -> 999999999999999 Inexact Rounded +fmax31217 fma 1 1E15 -0.500000001 -> 999999999999999 Inexact Rounded +fmax31218 fma 1 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded +fmax31219 fma 1 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded +fmax31220 fma 1 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded +fmax31221 fma 1 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded +fmax31222 fma 1 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded +fmax31223 fma 1 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded +fmax31224 fma 1 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded +fmax31225 fma 1 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded +fmax31230 fma 1 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded + +precision: 16 + +fmax31300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +fmax31310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded +fmax31311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded +fmax31312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +fmax31313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +fmax31314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +fmax31315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +fmax31316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +fmax31317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +fmax31318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +fmax31319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +fmax31320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +fmax31321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +fmax31322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +fmax31323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +fmax31324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +fmax31325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +fmax31336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +fmax31337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +fmax31338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +fmax31339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +fmax31340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +fmax31341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +fmax31349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +fmax31350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +fmax31351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +fmax31352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +fmax31353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +fmax31354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +fmax31355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +fmax31356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +fmax31357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +fmax31358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +fmax31359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +fmax31360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +fmax31361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +fmax31362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +fmax31363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +fmax31364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +fmax31365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +fmax31376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +fmax31377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +fmax31378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +fmax31379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +fmax31380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +fmax31381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +fmax31382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +fmax31392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +fmax31393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +fmax31394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +fmax31395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +fmax31396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +precision: 15 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +fmax31400 fma 1 0 1.23456789012345 -> 1.23456789012345 +fmax31401 fma 1 0 1.23456789012345E-1 -> 0.123456789012345 +fmax31402 fma 1 0 1.23456789012345E-2 -> 0.0123456789012345 +fmax31403 fma 1 0 1.23456789012345E-3 -> 0.00123456789012345 +fmax31404 fma 1 0 1.23456789012345E-4 -> 0.000123456789012345 +fmax31405 fma 1 0 1.23456789012345E-5 -> 0.0000123456789012345 +fmax31406 fma 1 0 1.23456789012345E-6 -> 0.00000123456789012345 +fmax31407 fma 1 0 1.23456789012345E-7 -> 1.23456789012345E-7 +fmax31408 fma 1 0 1.23456789012345E-8 -> 1.23456789012345E-8 +fmax31409 fma 1 0 1.23456789012345E-9 -> 1.23456789012345E-9 +fmax31410 fma 1 0 1.23456789012345E-10 -> 1.23456789012345E-10 +fmax31411 fma 1 0 1.23456789012345E-11 -> 1.23456789012345E-11 +fmax31412 fma 1 0 1.23456789012345E-12 -> 1.23456789012345E-12 +fmax31413 fma 1 0 1.23456789012345E-13 -> 1.23456789012345E-13 +fmax31414 fma 1 0 1.23456789012345E-14 -> 1.23456789012345E-14 +fmax31415 fma 1 0 1.23456789012345E-15 -> 1.23456789012345E-15 +fmax31416 fma 1 0 1.23456789012345E-16 -> 1.23456789012345E-16 +fmax31417 fma 1 0 1.23456789012345E-17 -> 1.23456789012345E-17 +fmax31418 fma 1 0 1.23456789012345E-18 -> 1.23456789012345E-18 +fmax31419 fma 1 0 1.23456789012345E-19 -> 1.23456789012345E-19 + +-- same, precision 16.. +precision: 16 +fmax31420 fma 1 0 1.123456789012345 -> 1.123456789012345 +fmax31421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345 +fmax31422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345 +fmax31423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345 +fmax31424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345 +fmax31425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345 +fmax31426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345 +fmax31427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7 +fmax31428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8 +fmax31429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9 +fmax31430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10 +fmax31431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11 +fmax31432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12 +fmax31433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13 +fmax31434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14 +fmax31435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15 +fmax31436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16 +fmax31437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17 +fmax31438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18 +fmax31439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +fmax31440 fma 1 1.123456789012345 0 -> 1.123456789012345 +fmax31441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345 +fmax31442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345 +fmax31443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345 +fmax31444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345 +fmax31445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345 +fmax31446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345 +fmax31447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7 +fmax31448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8 +fmax31449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9 +fmax31450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10 +fmax31451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11 +fmax31452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12 +fmax31453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13 +fmax31454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14 +fmax31455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15 +fmax31456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16 +fmax31457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17 +fmax31458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18 +fmax31459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +fmax31460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345 +fmax31461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345 +fmax31462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345 +fmax31463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345 +fmax31464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345 +fmax31465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345 +fmax31466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345 +fmax31467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345 +fmax31468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345 +fmax31469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345 +fmax31470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345 +fmax31471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345 +fmax31472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345 +fmax31473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345 +fmax31474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345 +fmax31475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded because the 0 extends the result +fmax31476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +fmax31477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +fmax31478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +fmax31479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +precision: 16 +maxExponent: 384 +minexponent: -383 + +rounding: half_up +-- exact zeros from zeros +fmax31500 fma 1 0 0E-19 -> 0E-19 +fmax31501 fma 1 -0 0E-19 -> 0E-19 +fmax31502 fma 1 0 -0E-19 -> 0E-19 +fmax31503 fma 1 -0 -0E-19 -> -0E-19 +fmax31504 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax31506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax31507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax31515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax31517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax31518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_down +-- exact zeros from zeros +fmax31520 fma 1 0 0E-19 -> 0E-19 +fmax31521 fma 1 -0 0E-19 -> 0E-19 +fmax31522 fma 1 0 -0E-19 -> 0E-19 +fmax31523 fma 1 -0 -0E-19 -> -0E-19 +fmax31524 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax31526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax31527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax31535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax31537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax31538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_even +-- exact zeros from zeros +fmax31540 fma 1 0 0E-19 -> 0E-19 +fmax31541 fma 1 -0 0E-19 -> 0E-19 +fmax31542 fma 1 0 -0E-19 -> 0E-19 +fmax31543 fma 1 -0 -0E-19 -> -0E-19 +fmax31544 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax31546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax31547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax31555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax31557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax31558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: up +-- exact zeros from zeros +fmax31560 fma 1 0 0E-19 -> 0E-19 +fmax31561 fma 1 -0 0E-19 -> 0E-19 +fmax31562 fma 1 0 -0E-19 -> 0E-19 +fmax31563 fma 1 -0 -0E-19 -> -0E-19 +fmax31564 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax31566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax31567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax31572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax31573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +fmax31574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +fmax31575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax31576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax31577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax31578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +rounding: down +-- exact zeros from zeros +fmax31580 fma 1 0 0E-19 -> 0E-19 +fmax31581 fma 1 -0 0E-19 -> 0E-19 +fmax31582 fma 1 0 -0E-19 -> 0E-19 +fmax31583 fma 1 -0 -0E-19 -> -0E-19 +fmax31584 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax31586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax31587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax31595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax31597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax31598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: ceiling +-- exact zeros from zeros +fmax31600 fma 1 0 0E-19 -> 0E-19 +fmax31601 fma 1 -0 0E-19 -> 0E-19 +fmax31602 fma 1 0 -0E-19 -> 0E-19 +fmax31603 fma 1 -0 -0E-19 -> -0E-19 +fmax31604 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax31606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax31607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax31612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax31613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax31615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax31616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax31617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax31618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +fmax31620 fma 1 0 0E-19 -> 0E-19 +fmax31621 fma 1 -0 0E-19 -> -0E-19 -- * +fmax31622 fma 1 0 -0E-19 -> -0E-19 -- * +fmax31623 fma 1 -0 -0E-19 -> -0E-19 +fmax31624 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax31625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- * +fmax31626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- * +fmax31627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax31631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +fmax31634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +fmax31635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax31636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- * +fmax31637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- * +fmax31638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +-- BigDecimal problem testcases 2006.01.23 +precision: 16 +maxExponent: 384 +minexponent: -383 + +rounding: down +precision: 7 +fmax31651 fma 1 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +fmax31652 fma 1 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +fmax31653 fma 1 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded +precision: 4 +fmax31654 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded +precision: 3 +fmax31655 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded +precision: 2 +fmax31656 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded +precision: 1 +fmax31657 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded + +rounding: half_even +precision: 7 +fmax31661 fma 1 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +fmax31662 fma 1 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +fmax31663 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded +precision: 4 +fmax31664 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded +precision: 3 +fmax31665 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded +precision: 2 +fmax31666 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded +precision: 1 +fmax31667 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded + +rounding: up +precision: 7 +fmax31671 fma 1 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +fmax31672 fma 1 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +fmax31673 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded +precision: 4 +fmax31674 fma 1 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded +precision: 3 +fmax31675 fma 1 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded +precision: 2 +fmax31676 fma 1 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded +precision: 1 +fmax31677 fma 1 10001E+2 -2E+1 -> 2E+6 Inexact Rounded + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Examples from SQL proposal (Krishna Kulkarni) +fmax31701 fma 1 130E-2 120E-2 -> 2.50 +fmax31702 fma 1 130E-2 12E-1 -> 2.50 +fmax31703 fma 1 130E-2 1E0 -> 2.30 +fmax31704 fma 1 1E2 1E4 -> 1.01E+4 +fmax31705 subtract 130E-2 120E-2 -> 0.10 +fmax31706 subtract 130E-2 12E-1 -> 0.10 +fmax31707 subtract 130E-2 1E0 -> 0.30 +fmax31708 subtract 1E2 1E4 -> -9.9E+3 + +------------------------------------------------------------------------ +-- Same as above, using decimal64 default parameters -- +------------------------------------------------------------------------ +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- [first group are 'quick confidence check'] +fmax36001 fma 1 1 1 -> 2 +fmax36002 fma 1 2 3 -> 5 +fmax36003 fma 1 '5.75' '3.3' -> 9.05 +fmax36004 fma 1 '5' '-3' -> 2 +fmax36005 fma 1 '-5' '-3' -> -8 +fmax36006 fma 1 '-7' '2.5' -> -4.5 +fmax36007 fma 1 '0.7' '0.3' -> 1.0 +fmax36008 fma 1 '1.25' '1.25' -> 2.50 +fmax36009 fma 1 '1.23456789' '1.00000000' -> '2.23456789' +fmax36010 fma 1 '1.23456789' '1.00000011' -> '2.23456800' + +fmax36011 fma 1 '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded +fmax36012 fma 1 '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded +fmax36013 fma 1 '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded +fmax36014 fma 1 '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded +fmax36015 fma 1 '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded +fmax36016 fma 1 '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded +fmax36017 fma 1 '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded +fmax36018 fma 1 '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded +fmax36019 fma 1 '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded +fmax36020 fma 1 '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded + +fmax36021 fma 1 0 1 -> 1 +fmax36022 fma 1 1 1 -> 2 +fmax36023 fma 1 2 1 -> 3 +fmax36024 fma 1 3 1 -> 4 +fmax36025 fma 1 4 1 -> 5 +fmax36026 fma 1 5 1 -> 6 +fmax36027 fma 1 6 1 -> 7 +fmax36028 fma 1 7 1 -> 8 +fmax36029 fma 1 8 1 -> 9 +fmax36030 fma 1 9 1 -> 10 + +-- some carrying effects +fmax36031 fma 1 '0.9998' '0.0000' -> '0.9998' +fmax36032 fma 1 '0.9998' '0.0001' -> '0.9999' +fmax36033 fma 1 '0.9998' '0.0002' -> '1.0000' +fmax36034 fma 1 '0.9998' '0.0003' -> '1.0001' + +fmax36035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +fmax36036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +fmax36037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +fmax36038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded +fmax36039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded + +-- symmetry: +fmax36040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded +fmax36041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded +fmax36042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded +fmax36044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded +fmax36045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded + +fmax36046 fma 1 '10000e+9' '7' -> '10000000000007' +fmax36047 fma 1 '10000e+9' '70' -> '10000000000070' +fmax36048 fma 1 '10000e+9' '700' -> '10000000000700' +fmax36049 fma 1 '10000e+9' '7000' -> '10000000007000' +fmax36050 fma 1 '10000e+9' '70000' -> '10000000070000' +fmax36051 fma 1 '10000e+9' '700000' -> '10000000700000' + +-- examples from decarith +fmax36053 fma 1 '12' '7.00' -> '19.00' +fmax36054 fma 1 '1.3' '-1.07' -> '0.23' +fmax36055 fma 1 '1.3' '-1.30' -> '0.00' +fmax36056 fma 1 '1.3' '-2.07' -> '-0.77' +fmax36057 fma 1 '1E+2' '1E+4' -> '1.01E+4' + +-- from above +fmax36061 fma 1 1 '0.1' -> '1.1' +fmax36062 fma 1 1 '0.01' -> '1.01' +fmax36063 fma 1 1 '0.001' -> '1.001' +fmax36064 fma 1 1 '0.0001' -> '1.0001' +fmax36065 fma 1 1 '0.00001' -> '1.00001' +fmax36066 fma 1 1 '0.000001' -> '1.000001' +fmax36067 fma 1 1 '0.0000001' -> '1.0000001' +fmax36068 fma 1 1 '0.00000001' -> '1.00000001' + +-- some funny zeros [in case of bad signum] +fmax36070 fma 1 1 0 -> 1 +fmax36071 fma 1 1 0. -> 1 +fmax36072 fma 1 1 .0 -> 1.0 +fmax36073 fma 1 1 0.0 -> 1.0 +fmax36074 fma 1 1 0.00 -> 1.00 +fmax36075 fma 1 0 1 -> 1 +fmax36076 fma 1 0. 1 -> 1 +fmax36077 fma 1 .0 1 -> 1.0 +fmax36078 fma 1 0.0 1 -> 1.0 +fmax36079 fma 1 0.00 1 -> 1.00 + +-- some carries +fmax36080 fma 1 9999999999999998 1 -> 9999999999999999 +fmax36081 fma 1 9999999999999999 1 -> 1.000000000000000E+16 Rounded +fmax36082 fma 1 999999999999999 1 -> 1000000000000000 +fmax36083 fma 1 9999999999999 1 -> 10000000000000 +fmax36084 fma 1 99999999999 1 -> 100000000000 +fmax36085 fma 1 999999999 1 -> 1000000000 +fmax36086 fma 1 9999999 1 -> 10000000 +fmax36087 fma 1 99999 1 -> 100000 +fmax36088 fma 1 999 1 -> 1000 +fmax36089 fma 1 9 1 -> 10 + + +-- more LHS swaps +fmax36090 fma 1 '-56267E-10' 0 -> '-0.0000056267' +fmax36091 fma 1 '-56267E-6' 0 -> '-0.056267' +fmax36092 fma 1 '-56267E-5' 0 -> '-0.56267' +fmax36093 fma 1 '-56267E-4' 0 -> '-5.6267' +fmax36094 fma 1 '-56267E-3' 0 -> '-56.267' +fmax36095 fma 1 '-56267E-2' 0 -> '-562.67' +fmax36096 fma 1 '-56267E-1' 0 -> '-5626.7' +fmax36097 fma 1 '-56267E-0' 0 -> '-56267' +fmax36098 fma 1 '-5E-10' 0 -> '-5E-10' +fmax36099 fma 1 '-5E-7' 0 -> '-5E-7' +fmax36100 fma 1 '-5E-6' 0 -> '-0.000005' +fmax36101 fma 1 '-5E-5' 0 -> '-0.00005' +fmax36102 fma 1 '-5E-4' 0 -> '-0.0005' +fmax36103 fma 1 '-5E-1' 0 -> '-0.5' +fmax36104 fma 1 '-5E0' 0 -> '-5' +fmax36105 fma 1 '-5E1' 0 -> '-50' +fmax36106 fma 1 '-5E5' 0 -> '-500000' +fmax36107 fma 1 '-5E15' 0 -> '-5000000000000000' +fmax36108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded +fmax36109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded +fmax36110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded +fmax36111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded + +-- more RHS swaps +fmax36113 fma 1 0 '-56267E-10' -> '-0.0000056267' +fmax36114 fma 1 0 '-56267E-6' -> '-0.056267' +fmax36116 fma 1 0 '-56267E-5' -> '-0.56267' +fmax36117 fma 1 0 '-56267E-4' -> '-5.6267' +fmax36119 fma 1 0 '-56267E-3' -> '-56.267' +fmax36120 fma 1 0 '-56267E-2' -> '-562.67' +fmax36121 fma 1 0 '-56267E-1' -> '-5626.7' +fmax36122 fma 1 0 '-56267E-0' -> '-56267' +fmax36123 fma 1 0 '-5E-10' -> '-5E-10' +fmax36124 fma 1 0 '-5E-7' -> '-5E-7' +fmax36125 fma 1 0 '-5E-6' -> '-0.000005' +fmax36126 fma 1 0 '-5E-5' -> '-0.00005' +fmax36127 fma 1 0 '-5E-4' -> '-0.0005' +fmax36128 fma 1 0 '-5E-1' -> '-0.5' +fmax36129 fma 1 0 '-5E0' -> '-5' +fmax36130 fma 1 0 '-5E1' -> '-50' +fmax36131 fma 1 0 '-5E5' -> '-500000' +fmax36132 fma 1 0 '-5E15' -> '-5000000000000000' +fmax36133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded +fmax36134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded +fmax36135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded +fmax36136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded + +-- related +fmax36137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded +fmax36138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded +fmax36139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded +fmax36140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded +fmax36141 fma 1 1E+11 0.0000 -> '100000000000.0000' +fmax36142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded +fmax36143 fma 1 0.000 1E+12 -> '1000000000000.000' +fmax36144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +fmax36146 fma 1 '00.0' 0 -> '0.0' +fmax36147 fma 1 '0.00' 0 -> '0.00' +fmax36148 fma 1 0 '0.00' -> '0.00' +fmax36149 fma 1 0 '00.0' -> '0.0' +fmax36150 fma 1 '00.0' '0.00' -> '0.00' +fmax36151 fma 1 '0.00' '00.0' -> '0.00' +fmax36152 fma 1 '3' '.3' -> '3.3' +fmax36153 fma 1 '3.' '.3' -> '3.3' +fmax36154 fma 1 '3.0' '.3' -> '3.3' +fmax36155 fma 1 '3.00' '.3' -> '3.30' +fmax36156 fma 1 '3' '3' -> '6' +fmax36157 fma 1 '3' '+3' -> '6' +fmax36158 fma 1 '3' '-3' -> '0' +fmax36159 fma 1 '0.3' '-0.3' -> '0.0' +fmax36160 fma 1 '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +fmax36161 fma 1 '1E+13' '-1' -> '9999999999999' +fmax36162 fma 1 '1E+13' '1.11' -> '10000000000001.11' +fmax36163 fma 1 '1.11' '1E+13' -> '10000000000001.11' +fmax36164 fma 1 '-1' '1E+13' -> '9999999999999' +fmax36165 fma 1 '7E+13' '-1' -> '69999999999999' +fmax36166 fma 1 '7E+13' '1.11' -> '70000000000001.11' +fmax36167 fma 1 '1.11' '7E+13' -> '70000000000001.11' +fmax36168 fma 1 '-1' '7E+13' -> '69999999999999' + +-- 1234567890123456 1234567890123456 1 234567890123456 +fmax36170 fma 1 '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded +fmax36171 fma 1 '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded +fmax36172 fma 1 '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded +fmax36173 fma 1 '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded +fmax36174 fma 1 '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded +fmax36175 fma 1 '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded +fmax36176 fma 1 '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded +fmax36177 fma 1 '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded +fmax36178 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999' +fmax36179 fma 1 '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998' +fmax36180 fma 1 '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997' +fmax36181 fma 1 '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996' +fmax36182 fma 1 '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995' +fmax36183 fma 1 '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994' + +-- and some more, including residue effects and different roundings +rounding: half_up +fmax36200 fma 1 '6543210123456789' 0 -> '6543210123456789' +fmax36201 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +fmax36202 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +fmax36203 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +fmax36204 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +fmax36205 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +fmax36206 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +fmax36207 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +fmax36208 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +fmax36209 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +fmax36210 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +fmax36211 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +fmax36212 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +fmax36213 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +fmax36214 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +fmax36215 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded +fmax36216 fma 1 '6543210123456789' 1 -> '6543210123456790' +fmax36217 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded +fmax36218 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +fmax36219 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +rounding: half_even +fmax36220 fma 1 '6543210123456789' 0 -> '6543210123456789' +fmax36221 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +fmax36222 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +fmax36223 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +fmax36224 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +fmax36225 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +fmax36226 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +fmax36227 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +fmax36228 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +fmax36229 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +fmax36230 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +fmax36231 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +fmax36232 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +fmax36233 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +fmax36234 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +fmax36235 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded +fmax36236 fma 1 '6543210123456789' 1 -> '6543210123456790' +fmax36237 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +fmax36238 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +fmax36239 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded +-- critical few with even bottom digit... +fmax36240 fma 1 '6543210123456788' 0.499999 -> '6543210123456788' Inexact Rounded +fmax36241 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded +fmax36242 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded + +rounding: down +fmax36250 fma 1 '6543210123456789' 0 -> '6543210123456789' +fmax36251 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +fmax36252 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +fmax36253 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +fmax36254 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +fmax36255 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +fmax36256 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +fmax36257 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +fmax36258 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded +fmax36259 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded +fmax36260 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded +fmax36261 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded +fmax36262 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded +fmax36263 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded +fmax36264 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded +fmax36265 fma 1 '6543210123456789' 0.999999 -> '6543210123456789' Inexact Rounded +fmax36266 fma 1 '6543210123456789' 1 -> '6543210123456790' +fmax36267 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +fmax36268 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +fmax36269 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_even +fmax36301 fma 1 -1 1 -> 0 +fmax36302 fma 1 0 1 -> 1 +fmax36303 fma 1 1 1 -> 2 +fmax36304 fma 1 12 1 -> 13 +fmax36305 fma 1 98 1 -> 99 +fmax36306 fma 1 99 1 -> 100 +fmax36307 fma 1 100 1 -> 101 +fmax36308 fma 1 101 1 -> 102 +fmax36309 fma 1 -1 -1 -> -2 +fmax36310 fma 1 0 -1 -> -1 +fmax36311 fma 1 1 -1 -> 0 +fmax36312 fma 1 12 -1 -> 11 +fmax36313 fma 1 98 -1 -> 97 +fmax36314 fma 1 99 -1 -> 98 +fmax36315 fma 1 100 -1 -> 99 +fmax36316 fma 1 101 -1 -> 100 + +fmax36321 fma 1 -0.01 0.01 -> 0.00 +fmax36322 fma 1 0.00 0.01 -> 0.01 +fmax36323 fma 1 0.01 0.01 -> 0.02 +fmax36324 fma 1 0.12 0.01 -> 0.13 +fmax36325 fma 1 0.98 0.01 -> 0.99 +fmax36326 fma 1 0.99 0.01 -> 1.00 +fmax36327 fma 1 1.00 0.01 -> 1.01 +fmax36328 fma 1 1.01 0.01 -> 1.02 +fmax36329 fma 1 -0.01 -0.01 -> -0.02 +fmax36330 fma 1 0.00 -0.01 -> -0.01 +fmax36331 fma 1 0.01 -0.01 -> 0.00 +fmax36332 fma 1 0.12 -0.01 -> 0.11 +fmax36333 fma 1 0.98 -0.01 -> 0.97 +fmax36334 fma 1 0.99 -0.01 -> 0.98 +fmax36335 fma 1 1.00 -0.01 -> 0.99 +fmax36336 fma 1 1.01 -0.01 -> 1.00 + +-- some more cases where fma 1 ing 0 affects the coefficient +fmax36340 fma 1 1E+3 0 -> 1000 +fmax36341 fma 1 1E+15 0 -> 1000000000000000 +fmax36342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded +fmax36343 fma 1 1E+17 0 -> 1.000000000000000E+17 Rounded +-- which simply follow from these cases ... +fmax36344 fma 1 1E+3 1 -> 1001 +fmax36345 fma 1 1E+15 1 -> 1000000000000001 +fmax36346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded +fmax36347 fma 1 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded +fmax36348 fma 1 1E+3 7 -> 1007 +fmax36349 fma 1 1E+15 7 -> 1000000000000007 +fmax36350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded +fmax36351 fma 1 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded + +-- tryzeros cases +fmax36361 fma 1 0E+50 10000E+1 -> 1.0000E+5 +fmax36362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded +fmax36363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact +fmax36364 fma 1 12.34 0e-398 -> 12.34000000000000 Rounded + +-- ulp replacement tests +fmax36400 fma 1 1 77e-14 -> 1.00000000000077 +fmax36401 fma 1 1 77e-15 -> 1.000000000000077 +fmax36402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded +fmax36403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded +fmax36404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded +fmax36405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded +fmax36406 fma 1 1 77e-99 -> 1.000000000000000 Inexact Rounded + +fmax36410 fma 1 10 77e-14 -> 10.00000000000077 +fmax36411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded +fmax36412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded +fmax36413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded +fmax36414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded +fmax36415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded +fmax36416 fma 1 10 77e-99 -> 10.00000000000000 Inexact Rounded + +fmax36420 fma 1 77e-14 1 -> 1.00000000000077 +fmax36421 fma 1 77e-15 1 -> 1.000000000000077 +fmax36422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded +fmax36423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded +fmax36424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded +fmax36425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded +fmax36426 fma 1 77e-99 1 -> 1.000000000000000 Inexact Rounded + +fmax36430 fma 1 77e-14 10 -> 10.00000000000077 +fmax36431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded +fmax36432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded +fmax36433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded +fmax36434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded +fmax36435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded +fmax36436 fma 1 77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +fmax36440 fma 1 1 -77e-14 -> 0.99999999999923 +fmax36441 fma 1 1 -77e-15 -> 0.999999999999923 +fmax36442 fma 1 1 -77e-16 -> 0.9999999999999923 +fmax36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded +fmax36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded +fmax36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded +fmax36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded + +fmax36450 fma 1 10 -77e-14 -> 9.99999999999923 +fmax36451 fma 1 10 -77e-15 -> 9.999999999999923 +fmax36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded +fmax36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded +fmax36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded +fmax36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded +fmax36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded + +fmax36460 fma 1 -77e-14 1 -> 0.99999999999923 +fmax36461 fma 1 -77e-15 1 -> 0.999999999999923 +fmax36462 fma 1 -77e-16 1 -> 0.9999999999999923 +fmax36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded +fmax36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded +fmax36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded +fmax36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded + +fmax36470 fma 1 -77e-14 10 -> 9.99999999999923 +fmax36471 fma 1 -77e-15 10 -> 9.999999999999923 +fmax36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded +fmax36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded +fmax36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded +fmax36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded +fmax36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +fmax36480 fma 1 -1 77e-14 -> -0.99999999999923 +fmax36481 fma 1 -1 77e-15 -> -0.999999999999923 +fmax36482 fma 1 -1 77e-16 -> -0.9999999999999923 +fmax36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded +fmax36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded +fmax36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded +fmax36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded + +fmax36490 fma 1 -10 77e-14 -> -9.99999999999923 +fmax36491 fma 1 -10 77e-15 -> -9.999999999999923 +fmax36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded +fmax36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded +fmax36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded +fmax36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded +fmax36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded + +fmax36500 fma 1 77e-14 -1 -> -0.99999999999923 +fmax36501 fma 1 77e-15 -1 -> -0.999999999999923 +fmax36502 fma 1 77e-16 -1 -> -0.9999999999999923 +fmax36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded +fmax36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded +fmax36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded +fmax36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded + +fmax36510 fma 1 77e-14 -10 -> -9.99999999999923 +fmax36511 fma 1 77e-15 -10 -> -9.999999999999923 +fmax36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded +fmax36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded +fmax36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded +fmax36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded +fmax36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded + + +-- long operands +fmax36521 fma 1 101234562345678000 0 -> 1.012345623456780E+17 Rounded +fmax36522 fma 1 0 101234562345678000 -> 1.012345623456780E+17 Rounded +fmax36523 fma 1 10123456234567800 0 -> 1.012345623456780E+16 Rounded +fmax36524 fma 1 0 10123456234567800 -> 1.012345623456780E+16 Rounded +fmax36525 fma 1 10123456234567890 0 -> 1.012345623456789E+16 Rounded +fmax36526 fma 1 0 10123456234567890 -> 1.012345623456789E+16 Rounded +fmax36527 fma 1 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded +fmax36528 fma 1 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded +fmax36529 fma 1 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded +fmax36530 fma 1 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded +fmax36531 fma 1 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded +fmax36532 fma 1 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded + +-- verify a query +rounding: down +fmax36561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +fmax36562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +-- and using decimal64 bounds... +rounding: down +fmax36563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +fmax36564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + +-- more zeros, etc. +rounding: half_even + +fmax36701 fma 1 5.00 1.00E-3 -> 5.00100 +fmax36702 fma 1 00.00 0.000 -> 0.000 +fmax36703 fma 1 00.00 0E-3 -> 0.000 +fmax36704 fma 1 0E-3 00.00 -> 0.000 + +fmax36710 fma 1 0E+3 00.00 -> 0.00 +fmax36711 fma 1 0E+3 00.0 -> 0.0 +fmax36712 fma 1 0E+3 00. -> 0 +fmax36713 fma 1 0E+3 00.E+1 -> 0E+1 +fmax36714 fma 1 0E+3 00.E+2 -> 0E+2 +fmax36715 fma 1 0E+3 00.E+3 -> 0E+3 +fmax36716 fma 1 0E+3 00.E+4 -> 0E+3 +fmax36717 fma 1 0E+3 00.E+5 -> 0E+3 +fmax36718 fma 1 0E+3 -00.0 -> 0.0 +fmax36719 fma 1 0E+3 -00. -> 0 +fmax36731 fma 1 0E+3 -00.E+1 -> 0E+1 + +fmax36720 fma 1 00.00 0E+3 -> 0.00 +fmax36721 fma 1 00.0 0E+3 -> 0.0 +fmax36722 fma 1 00. 0E+3 -> 0 +fmax36723 fma 1 00.E+1 0E+3 -> 0E+1 +fmax36724 fma 1 00.E+2 0E+3 -> 0E+2 +fmax36725 fma 1 00.E+3 0E+3 -> 0E+3 +fmax36726 fma 1 00.E+4 0E+3 -> 0E+3 +fmax36727 fma 1 00.E+5 0E+3 -> 0E+3 +fmax36728 fma 1 -00.00 0E+3 -> 0.00 +fmax36729 fma 1 -00.0 0E+3 -> 0.0 +fmax36730 fma 1 -00. 0E+3 -> 0 + +fmax36732 fma 1 0 0 -> 0 +fmax36733 fma 1 0 -0 -> 0 +fmax36734 fma 1 -0 0 -> 0 +fmax36735 fma 1 -0 -0 -> -0 -- IEEE 854 special case + +fmax36736 fma 1 1 -1 -> 0 +fmax36737 fma 1 -1 -1 -> -2 +fmax36738 fma 1 1 1 -> 2 +fmax36739 fma 1 -1 1 -> 0 + +fmax36741 fma 1 0 -1 -> -1 +fmax36742 fma 1 -0 -1 -> -1 +fmax36743 fma 1 0 1 -> 1 +fmax36744 fma 1 -0 1 -> 1 +fmax36745 fma 1 -1 0 -> -1 +fmax36746 fma 1 -1 -0 -> -1 +fmax36747 fma 1 1 0 -> 1 +fmax36748 fma 1 1 -0 -> 1 + +fmax36751 fma 1 0.0 -1 -> -1.0 +fmax36752 fma 1 -0.0 -1 -> -1.0 +fmax36753 fma 1 0.0 1 -> 1.0 +fmax36754 fma 1 -0.0 1 -> 1.0 +fmax36755 fma 1 -1.0 0 -> -1.0 +fmax36756 fma 1 -1.0 -0 -> -1.0 +fmax36757 fma 1 1.0 0 -> 1.0 +fmax36758 fma 1 1.0 -0 -> 1.0 + +fmax36761 fma 1 0 -1.0 -> -1.0 +fmax36762 fma 1 -0 -1.0 -> -1.0 +fmax36763 fma 1 0 1.0 -> 1.0 +fmax36764 fma 1 -0 1.0 -> 1.0 +fmax36765 fma 1 -1 0.0 -> -1.0 +fmax36766 fma 1 -1 -0.0 -> -1.0 +fmax36767 fma 1 1 0.0 -> 1.0 +fmax36768 fma 1 1 -0.0 -> 1.0 + +fmax36771 fma 1 0.0 -1.0 -> -1.0 +fmax36772 fma 1 -0.0 -1.0 -> -1.0 +fmax36773 fma 1 0.0 1.0 -> 1.0 +fmax36774 fma 1 -0.0 1.0 -> 1.0 +fmax36775 fma 1 -1.0 0.0 -> -1.0 +fmax36776 fma 1 -1.0 -0.0 -> -1.0 +fmax36777 fma 1 1.0 0.0 -> 1.0 +fmax36778 fma 1 1.0 -0.0 -> 1.0 + +-- Specials +fmax36780 fma 1 -Inf -Inf -> -Infinity +fmax36781 fma 1 -Inf -1000 -> -Infinity +fmax36782 fma 1 -Inf -1 -> -Infinity +fmax36783 fma 1 -Inf -0 -> -Infinity +fmax36784 fma 1 -Inf 0 -> -Infinity +fmax36785 fma 1 -Inf 1 -> -Infinity +fmax36786 fma 1 -Inf 1000 -> -Infinity +fmax36787 fma 1 -1000 -Inf -> -Infinity +fmax36788 fma 1 -Inf -Inf -> -Infinity +fmax36789 fma 1 -1 -Inf -> -Infinity +fmax36790 fma 1 -0 -Inf -> -Infinity +fmax36791 fma 1 0 -Inf -> -Infinity +fmax36792 fma 1 1 -Inf -> -Infinity +fmax36793 fma 1 1000 -Inf -> -Infinity +fmax36794 fma 1 Inf -Inf -> NaN Invalid_operation + +fmax36800 fma 1 Inf -Inf -> NaN Invalid_operation +fmax36801 fma 1 Inf -1000 -> Infinity +fmax36802 fma 1 Inf -1 -> Infinity +fmax36803 fma 1 Inf -0 -> Infinity +fmax36804 fma 1 Inf 0 -> Infinity +fmax36805 fma 1 Inf 1 -> Infinity +fmax36806 fma 1 Inf 1000 -> Infinity +fmax36807 fma 1 Inf Inf -> Infinity +fmax36808 fma 1 -1000 Inf -> Infinity +fmax36809 fma 1 -Inf Inf -> NaN Invalid_operation +fmax36810 fma 1 -1 Inf -> Infinity +fmax36811 fma 1 -0 Inf -> Infinity +fmax36812 fma 1 0 Inf -> Infinity +fmax36813 fma 1 1 Inf -> Infinity +fmax36814 fma 1 1000 Inf -> Infinity +fmax36815 fma 1 Inf Inf -> Infinity + +fmax36821 fma 1 NaN -Inf -> NaN +fmax36822 fma 1 NaN -1000 -> NaN +fmax36823 fma 1 NaN -1 -> NaN +fmax36824 fma 1 NaN -0 -> NaN +fmax36825 fma 1 NaN 0 -> NaN +fmax36826 fma 1 NaN 1 -> NaN +fmax36827 fma 1 NaN 1000 -> NaN +fmax36828 fma 1 NaN Inf -> NaN +fmax36829 fma 1 NaN NaN -> NaN +fmax36830 fma 1 -Inf NaN -> NaN +fmax36831 fma 1 -1000 NaN -> NaN +fmax36832 fma 1 -1 NaN -> NaN +fmax36833 fma 1 -0 NaN -> NaN +fmax36834 fma 1 0 NaN -> NaN +fmax36835 fma 1 1 NaN -> NaN +fmax36836 fma 1 1000 NaN -> NaN +fmax36837 fma 1 Inf NaN -> NaN + +fmax36841 fma 1 sNaN -Inf -> NaN Invalid_operation +fmax36842 fma 1 sNaN -1000 -> NaN Invalid_operation +fmax36843 fma 1 sNaN -1 -> NaN Invalid_operation +fmax36844 fma 1 sNaN -0 -> NaN Invalid_operation +fmax36845 fma 1 sNaN 0 -> NaN Invalid_operation +fmax36846 fma 1 sNaN 1 -> NaN Invalid_operation +fmax36847 fma 1 sNaN 1000 -> NaN Invalid_operation +fmax36848 fma 1 sNaN NaN -> NaN Invalid_operation +fmax36849 fma 1 sNaN sNaN -> NaN Invalid_operation +fmax36850 fma 1 NaN sNaN -> NaN Invalid_operation +fmax36851 fma 1 -Inf sNaN -> NaN Invalid_operation +fmax36852 fma 1 -1000 sNaN -> NaN Invalid_operation +fmax36853 fma 1 -1 sNaN -> NaN Invalid_operation +fmax36854 fma 1 -0 sNaN -> NaN Invalid_operation +fmax36855 fma 1 0 sNaN -> NaN Invalid_operation +fmax36856 fma 1 1 sNaN -> NaN Invalid_operation +fmax36857 fma 1 1000 sNaN -> NaN Invalid_operation +fmax36858 fma 1 Inf sNaN -> NaN Invalid_operation +fmax36859 fma 1 NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +fmax36861 fma 1 NaN1 -Inf -> NaN1 +fmax36862 fma 1 +NaN2 -1000 -> NaN2 +fmax36863 fma 1 NaN3 1000 -> NaN3 +fmax36864 fma 1 NaN4 Inf -> NaN4 +fmax36865 fma 1 NaN5 +NaN6 -> NaN5 +fmax36866 fma 1 -Inf NaN7 -> NaN7 +fmax36867 fma 1 -1000 NaN8 -> NaN8 +fmax36868 fma 1 1000 NaN9 -> NaN9 +fmax36869 fma 1 Inf +NaN10 -> NaN10 +fmax36871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation +fmax36872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation +fmax36873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation +fmax36874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation +fmax36875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation +fmax36876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation +fmax36877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation +fmax36878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation +fmax36879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation +fmax36880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation +fmax36881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation +fmax36882 fma 1 -NaN26 NaN28 -> -NaN26 +fmax36883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation +fmax36884 fma 1 1000 -NaN30 -> -NaN30 +fmax36885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- now the case where we can get underflow but the result is normal +-- [note this can't happen if the operands are also bounded, as we +-- cannot represent 1E-399, for example] + +fmax36571 fma 1 1E-383 0 -> 1E-383 +fmax36572 fma 1 1E-384 0 -> 1E-384 Subnormal +fmax36573 fma 1 1E-383 1E-384 -> 1.1E-383 +fmax36574 subtract 1E-383 1E-384 -> 9E-384 Subnormal + +-- Here we explore the boundary of rounding a subnormal to Nmin +fmax36575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +fmax36576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +fmax36577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax36578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax36579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +fmax36580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- check overflow edge case +-- 1234567890123456 +fmax36972 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +fmax36973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded +fmax36974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded +fmax36975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded +fmax36976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded +fmax36977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded +fmax36978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded +fmax36979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded +fmax36980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded +fmax36981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded +fmax36982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded +fmax36983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded +fmax36984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded + +fmax36985 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +fmax36986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded +fmax36987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded +fmax36988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded +fmax36989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded +fmax36990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded +fmax36991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded +fmax36992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded +fmax36993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded +fmax36994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded +fmax36995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded +fmax36996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded +fmax36997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +fmax361100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +fmax361101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +fmax361103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +fmax361104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +fmax361105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +fmax361106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +fmax361107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +fmax361108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +fmax361109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +fmax361110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +fmax361111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +fmax361113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +fmax361114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +fmax361115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +fmax361116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +fmax361117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +fmax361118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +fmax361119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +fmax361300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +fmax361310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded +fmax361311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded +fmax361312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +fmax361313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +fmax361314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +fmax361315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +fmax361316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +fmax361317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +fmax361318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +fmax361319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +fmax361320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +fmax361321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +fmax361322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +fmax361323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +fmax361324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +fmax361325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +fmax361336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +fmax361337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +fmax361338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +fmax361339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +fmax361340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +fmax361341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +fmax361349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +fmax361350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +fmax361351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +fmax361352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +fmax361353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +fmax361354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +fmax361355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +fmax361356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +fmax361357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +fmax361358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +fmax361359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +fmax361360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +fmax361361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +fmax361362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +fmax361363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +fmax361364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +fmax361365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +fmax361376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +fmax361377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +fmax361378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +fmax361379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +fmax361380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +fmax361381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +fmax361382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +fmax361392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +fmax361393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +fmax361394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +fmax361395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +fmax361396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +fmax361420 fma 1 0 1.123456789012345 -> 1.123456789012345 +fmax361421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345 +fmax361422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345 +fmax361423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345 +fmax361424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345 +fmax361425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345 +fmax361426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345 +fmax361427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7 +fmax361428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8 +fmax361429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9 +fmax361430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10 +fmax361431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11 +fmax361432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12 +fmax361433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13 +fmax361434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14 +fmax361435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15 +fmax361436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16 +fmax361437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17 +fmax361438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18 +fmax361439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +fmax361440 fma 1 1.123456789012345 0 -> 1.123456789012345 +fmax361441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345 +fmax361442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345 +fmax361443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345 +fmax361444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345 +fmax361445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345 +fmax361446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345 +fmax361447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7 +fmax361448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8 +fmax361449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9 +fmax361450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10 +fmax361451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11 +fmax361452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12 +fmax361453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13 +fmax361454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14 +fmax361455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15 +fmax361456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16 +fmax361457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17 +fmax361458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18 +fmax361459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +fmax361460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345 +fmax361461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345 +fmax361462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345 +fmax361463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345 +fmax361464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345 +fmax361465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345 +fmax361466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345 +fmax361467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345 +fmax361468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345 +fmax361469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345 +fmax361470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345 +fmax361471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345 +fmax361472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345 +fmax361473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345 +fmax361474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345 +fmax361475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded because the 0 extends the result +fmax361476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +fmax361477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +fmax361478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +fmax361479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +fmax361500 fma 1 0 0E-19 -> 0E-19 +fmax361501 fma 1 -0 0E-19 -> 0E-19 +fmax361502 fma 1 0 -0E-19 -> 0E-19 +fmax361503 fma 1 -0 -0E-19 -> -0E-19 +fmax361504 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax361506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax361507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax361515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax361517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax361518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_down +-- exact zeros from zeros +fmax361520 fma 1 0 0E-19 -> 0E-19 +fmax361521 fma 1 -0 0E-19 -> 0E-19 +fmax361522 fma 1 0 -0E-19 -> 0E-19 +fmax361523 fma 1 -0 -0E-19 -> -0E-19 +fmax361524 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax361526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax361527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax361535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax361537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax361538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_even +-- exact zeros from zeros +fmax361540 fma 1 0 0E-19 -> 0E-19 +fmax361541 fma 1 -0 0E-19 -> 0E-19 +fmax361542 fma 1 0 -0E-19 -> 0E-19 +fmax361543 fma 1 -0 -0E-19 -> -0E-19 +fmax361544 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax361546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax361547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax361555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax361557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax361558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: up +-- exact zeros from zeros +fmax361560 fma 1 0 0E-19 -> 0E-19 +fmax361561 fma 1 -0 0E-19 -> 0E-19 +fmax361562 fma 1 0 -0E-19 -> 0E-19 +fmax361563 fma 1 -0 -0E-19 -> -0E-19 +fmax361564 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax361566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax361567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax361572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax361573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +fmax361574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +fmax361575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax361576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax361577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax361578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +rounding: down +-- exact zeros from zeros +fmax361580 fma 1 0 0E-19 -> 0E-19 +fmax361581 fma 1 -0 0E-19 -> 0E-19 +fmax361582 fma 1 0 -0E-19 -> 0E-19 +fmax361583 fma 1 -0 -0E-19 -> -0E-19 +fmax361584 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax361586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax361587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax361595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax361597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax361598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: ceiling +-- exact zeros from zeros +fmax361600 fma 1 0 0E-19 -> 0E-19 +fmax361601 fma 1 -0 0E-19 -> 0E-19 +fmax361602 fma 1 0 -0E-19 -> 0E-19 +fmax361603 fma 1 -0 -0E-19 -> -0E-19 +fmax361604 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped +fmax361606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped +fmax361607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax361612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax361613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +fmax361615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +fmax361616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped +fmax361617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped +fmax361618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +fmax361620 fma 1 0 0E-19 -> 0E-19 +fmax361621 fma 1 -0 0E-19 -> -0E-19 -- * +fmax361622 fma 1 0 -0E-19 -> -0E-19 -- * +fmax361623 fma 1 -0 -0E-19 -> -0E-19 +fmax361624 fma 1 0E-400 0E-19 -> 0E-398 Clamped +fmax361625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- * +fmax361626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- * +fmax361627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +fmax361631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +fmax361634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +fmax361635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +fmax361636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- * +fmax361637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- * +fmax361638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +-- Examples from SQL proposal (Krishna Kulkarni) +fmax361701 fma 1 130E-2 120E-2 -> 2.50 +fmax361702 fma 1 130E-2 12E-1 -> 2.50 +fmax361703 fma 1 130E-2 1E0 -> 2.30 +fmax361704 fma 1 1E2 1E4 -> 1.01E+4 +fmax361705 subtract 130E-2 120E-2 -> 0.10 +fmax361706 subtract 130E-2 12E-1 -> 0.10 +fmax361707 subtract 130E-2 1E0 -> 0.30 +fmax361708 subtract 1E2 1E4 -> -9.9E+3 + +-- Gappy coefficients; check residue handling even with full coefficient gap +rounding: half_even + +fmax362001 fma 1 1234567890123456 1 -> 1234567890123457 +fmax362002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded +fmax362003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded +fmax362004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded +fmax362005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded +fmax362006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded +fmax362007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded +fmax362008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded +fmax362009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded +fmax362010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded +fmax362011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded +fmax362012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded +fmax362013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded +fmax362014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded +fmax362015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded +fmax362016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded +fmax362017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded +fmax362018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded +fmax362019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded +fmax362020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded +fmax362021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded + +-- widening second argument at gap +fmax362030 fma 1 12345678 1 -> 12345679 +fmax362031 fma 1 12345678 0.1 -> 12345678.1 +fmax362032 fma 1 12345678 0.12 -> 12345678.12 +fmax362033 fma 1 12345678 0.123 -> 12345678.123 +fmax362034 fma 1 12345678 0.1234 -> 12345678.1234 +fmax362035 fma 1 12345678 0.12345 -> 12345678.12345 +fmax362036 fma 1 12345678 0.123456 -> 12345678.123456 +fmax362037 fma 1 12345678 0.1234567 -> 12345678.1234567 +fmax362038 fma 1 12345678 0.12345678 -> 12345678.12345678 +fmax362039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded +fmax362040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded +fmax362041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded +fmax362042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded +fmax362043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded +fmax362044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded +fmax362045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded +fmax362046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded +fmax362047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded +fmax362048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded +fmax362049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded +-- 90123456 +rounding: half_even +fmax362050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded +fmax362051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded +fmax362052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded +fmax362053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded +fmax362054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded +fmax362055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded +fmax362056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded +fmax362057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded +fmax362060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded +fmax362061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded +fmax362062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded +fmax362063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded +fmax362064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded +fmax362065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded +fmax362066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded +fmax362067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded +-- far-out residues (full coefficient gap is 16+15 digits) +rounding: up +fmax362070 fma 1 12345678 1E-8 -> 12345678.00000001 +fmax362071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded +fmax362072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded +fmax362073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded +fmax362074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded +fmax362075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded +fmax362076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded +fmax362077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded +fmax362078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded +fmax362079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded +fmax362080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded +fmax362081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded +fmax362082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded +fmax362083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded +fmax362084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded +fmax362085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded +fmax362086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded +fmax362087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded +fmax362088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded +fmax362089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded + +-- payload decapitate x3 +precision: 5 +fmax363000 fma 1 1 sNaN1234567890 -> NaN67890 Invalid_operation +fmax363001 fma 1 -sNaN1234512345 1 -> -NaN12345 Invalid_operation +fmax363002 fma sNaN1234554321 1 1 -> NaN54321 Invalid_operation + +-- Null tests +fmax39990 fma 1 10 # -> NaN Invalid_operation +fmax39991 fma 1 # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/inexact.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/inexact.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,215 @@ +------------------------------------------------------------------------ +-- inexact.decTest -- decimal inexact and rounded edge cases -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +inx001 add 1 1 -> 2 +inx002 add 123456789 0 -> 123456789 +inx003 add 123456789 0.0 -> 123456789 Rounded +inx004 add 123456789 0.00 -> 123456789 Rounded +inx005 add 123456789 1 -> 123456790 +inx006 add 123456789 0.1 -> 123456789 Inexact Rounded +inx007 add 123456789 0.01 -> 123456789 Inexact Rounded +inx008 add 123456789 0.001 -> 123456789 Inexact Rounded +inx009 add 123456789 0.000001 -> 123456789 Inexact Rounded +inx010 add 123456789 0.000000001 -> 123456789 Inexact Rounded +inx011 add 123456789 0.000000000001 -> 123456789 Inexact Rounded + +inx012 add 123456789 0.9 -> 123456790 Inexact Rounded +inx013 add 123456789 0.09 -> 123456789 Inexact Rounded +inx014 add 123456789 0.009 -> 123456789 Inexact Rounded +inx015 add 123456789 0.000009 -> 123456789 Inexact Rounded +inx016 add 123456789 0.000000009 -> 123456789 Inexact Rounded +inx017 add 123456789 0.000000000009 -> 123456789 Inexact Rounded + +inx021 add 1 -1 -> 0 +inx022 add 123456789 -0 -> 123456789 +inx023 add 123456789 -0.0 -> 123456789 Rounded +inx024 add 123456789 -0.00 -> 123456789 Rounded +inx025 add 123456789 -1 -> 123456788 +inx026 add 123456789 -0.1 -> 123456789 Inexact Rounded +inx027 add 123456789 -0.01 -> 123456789 Inexact Rounded +inx028 add 123456789 -0.001 -> 123456789 Inexact Rounded +inx029 add 123456789 -0.000001 -> 123456789 Inexact Rounded +inx030 add 123456789 -0.000000001 -> 123456789 Inexact Rounded +inx031 add 123456789 -0.000000000001 -> 123456789 Inexact Rounded +inx032 add 123456789 -0.9 -> 123456788 Inexact Rounded +inx033 add 123456789 -0.09 -> 123456789 Inexact Rounded +inx034 add 123456789 -0.009 -> 123456789 Inexact Rounded +inx035 add 123456789 -0.000009 -> 123456789 Inexact Rounded +inx036 add 123456789 -0.000000009 -> 123456789 Inexact Rounded +inx037 add 123456789 -0.000000000009 -> 123456789 Inexact Rounded + +inx042 add 0 123456789 -> 123456789 +inx043 add 0.0 123456789 -> 123456789 Rounded +inx044 add 0.00 123456789 -> 123456789 Rounded +inx045 add 1 123456789 -> 123456790 +inx046 add 0.1 123456789 -> 123456789 Inexact Rounded +inx047 add 0.01 123456789 -> 123456789 Inexact Rounded +inx048 add 0.001 123456789 -> 123456789 Inexact Rounded +inx049 add 0.000001 123456789 -> 123456789 Inexact Rounded +inx050 add 0.000000001 123456789 -> 123456789 Inexact Rounded +inx051 add 0.000000000001 123456789 -> 123456789 Inexact Rounded +inx052 add 0.9 123456789 -> 123456790 Inexact Rounded +inx053 add 0.09 123456789 -> 123456789 Inexact Rounded +inx054 add 0.009 123456789 -> 123456789 Inexact Rounded +inx055 add 0.000009 123456789 -> 123456789 Inexact Rounded +inx056 add 0.000000009 123456789 -> 123456789 Inexact Rounded +inx057 add 0.000000000009 123456789 -> 123456789 Inexact Rounded + +inx062 add -0 123456789 -> 123456789 +inx063 add -0.0 123456789 -> 123456789 Rounded +inx064 add -0.00 123456789 -> 123456789 Rounded +inx065 add -1 123456789 -> 123456788 +inx066 add -0.1 123456789 -> 123456789 Inexact Rounded +inx067 add -0.01 123456789 -> 123456789 Inexact Rounded +inx068 add -0.001 123456789 -> 123456789 Inexact Rounded +inx069 add -0.000001 123456789 -> 123456789 Inexact Rounded +inx070 add -0.000000001 123456789 -> 123456789 Inexact Rounded +inx071 add -0.000000000001 123456789 -> 123456789 Inexact Rounded +inx072 add -0.9 123456789 -> 123456788 Inexact Rounded +inx073 add -0.09 123456789 -> 123456789 Inexact Rounded +inx074 add -0.009 123456789 -> 123456789 Inexact Rounded +inx075 add -0.000009 123456789 -> 123456789 Inexact Rounded +inx076 add -0.000000009 123456789 -> 123456789 Inexact Rounded +inx077 add -0.000000000009 123456789 -> 123456789 Inexact Rounded + +-- some boundaries +inx081 add 999999999 0 -> 999999999 +inx082 add 0.999999999 0.000000000 -> 0.999999999 +inx083 add 999999999 1 -> 1.00000000E+9 Rounded +inx084 add 0.999999999 0.000000001 -> 1.00000000 Rounded +inx085 add 999999999 2 -> 1.00000000E+9 Inexact Rounded +inx086 add 0.999999999 0.000000002 -> 1.00000000 Inexact Rounded +inx087 add 999999999 3 -> 1.00000000E+9 Inexact Rounded +inx089 add 0.999999999 0.000000003 -> 1.00000000 Inexact Rounded + +-- minus, plus, and subtract all assumed to work like add. + +-- multiply +precision: 8 +inx101 multiply 1000 1000 -> 1000000 +inx102 multiply 9000 9000 -> 81000000 +inx103 multiply 9999 9999 -> 99980001 +inx104 multiply 1000 10000 -> 10000000 +inx105 multiply 10000 10000 -> 1.0000000E+8 Rounded +inx106 multiply 10001 10000 -> 1.0001000E+8 Rounded +inx107 multiply 10001 10001 -> 1.0002000E+8 Inexact Rounded +inx108 multiply 10101 10001 -> 1.0102010E+8 Inexact Rounded +inx109 multiply 10001 10101 -> 1.0102010E+8 Inexact Rounded + +-- divide +precision: 4 +inx201 divide 1000 1000 -> 1 +inx202 divide 1000 1 -> 1000 +inx203 divide 1000 2 -> 500 +inx204 divide 1000 3 -> 333.3 Inexact Rounded +inx205 divide 1000 4 -> 250 +inx206 divide 1000 5 -> 200 +inx207 divide 1000 6 -> 166.7 Inexact Rounded +inx208 divide 1000 7 -> 142.9 Inexact Rounded +inx209 divide 1000 8 -> 125 +inx210 divide 1000 9 -> 111.1 Inexact Rounded +inx211 divide 1000 10 -> 100 + +inx220 divide 1 1 -> 1 +inx221 divide 1 2 -> 0.5 +inx222 divide 1 4 -> 0.25 +inx223 divide 1 8 -> 0.125 +inx224 divide 1 16 -> 0.0625 +inx225 divide 1 32 -> 0.03125 +inx226 divide 1 64 -> 0.01563 Inexact Rounded +inx227 divide 1 128 -> 0.007813 Inexact Rounded + +precision: 5 +inx230 divide 1 1 -> 1 +inx231 divide 1 2 -> 0.5 +inx232 divide 1 4 -> 0.25 +inx233 divide 1 8 -> 0.125 +inx234 divide 1 16 -> 0.0625 +inx235 divide 1 32 -> 0.03125 +inx236 divide 1 64 -> 0.015625 +inx237 divide 1 128 -> 0.0078125 + +precision: 3 +inx240 divide 1 1 -> 1 +inx241 divide 1 2 -> 0.5 +inx242 divide 1 4 -> 0.25 +inx243 divide 1 8 -> 0.125 +inx244 divide 1 16 -> 0.0625 +inx245 divide 1 32 -> 0.0313 Inexact Rounded +inx246 divide 1 64 -> 0.0156 Inexact Rounded +inx247 divide 1 128 -> 0.00781 Inexact Rounded + +precision: 2 +inx250 divide 1 1 -> 1 +inx251 divide 1 2 -> 0.5 +inx252 divide 1 4 -> 0.25 +inx253 divide 1 8 -> 0.13 Inexact Rounded +inx254 divide 1 16 -> 0.063 Inexact Rounded +inx255 divide 1 32 -> 0.031 Inexact Rounded +inx256 divide 1 64 -> 0.016 Inexact Rounded +inx257 divide 1 128 -> 0.0078 Inexact Rounded + +precision: 1 +inx260 divide 1 1 -> 1 +inx261 divide 1 2 -> 0.5 +inx262 divide 1 4 -> 0.3 Inexact Rounded +inx263 divide 1 8 -> 0.1 Inexact Rounded +inx264 divide 1 16 -> 0.06 Inexact Rounded +inx265 divide 1 32 -> 0.03 Inexact Rounded +inx266 divide 1 64 -> 0.02 Inexact Rounded +inx267 divide 1 128 -> 0.008 Inexact Rounded + + +-- power +precision: 4 +inx301 power 0.5 2 -> 0.25 +inx302 power 0.5 4 -> 0.0625 +inx303 power 0.5 8 -> 0.003906 Inexact Rounded +inx304 power 0.5 16 -> 0.00001526 Inexact Rounded +inx305 power 0.5 32 -> 2.328E-10 Inexact Rounded + +-- compare, divideInteger, and remainder are always exact + +-- rescale +precision: 4 +inx401 rescale 0 0 -> 0 +inx402 rescale 1 0 -> 1 +inx403 rescale 0.1 +2 -> 0E+2 Inexact Rounded +inx404 rescale 0.1 +1 -> 0E+1 Inexact Rounded +inx405 rescale 0.1 0 -> 0 Inexact Rounded +inx406 rescale 0.1 -1 -> 0.1 +inx407 rescale 0.1 -2 -> 0.10 + +-- long operands cause rounding too +precision: 9 +inx801 plus 123456789 -> 123456789 +inx802 plus 1234567890 -> 1.23456789E+9 Rounded +inx803 plus 1234567891 -> 1.23456789E+9 Inexact Rounded +inx804 plus 1234567892 -> 1.23456789E+9 Inexact Rounded +inx805 plus 1234567899 -> 1.23456790E+9 Inexact Rounded +inx806 plus 1234567900 -> 1.23456790E+9 Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/invert.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/invert.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,176 @@ +------------------------------------------------------------------------ +-- invert.decTest -- digitwise logical INVERT -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check (truth table), and examples from decArith +invx001 invert 0 -> 111111111 +invx002 invert 1 -> 111111110 +invx003 invert 10 -> 111111101 +invx004 invert 111111111 -> 0 +invx005 invert 000000000 -> 111111111 +invx006 invert 101010101 -> '10101010' +-- and at msd and msd-1 +invx007 invert 000000000 -> 111111111 +invx009 invert 100000000 -> 11111111 +invx011 invert 000000000 -> 111111111 +invx013 invert 010000000 -> 101111111 + +-- Various lengths +-- 123456789 123456789 +invx021 invert 111111111 -> 0 +invx022 invert 111111111111 -> 0 +invx023 invert 11111111 -> 100000000 +invx025 invert 1111111 -> 110000000 +invx026 invert 111111 -> 111000000 +invx027 invert 11111 -> 111100000 +invx028 invert 1111 -> 111110000 +invx029 invert 111 -> 111111000 +invx031 invert 11 -> 111111100 +invx032 invert 1 -> 111111110 +invx033 invert 111111111111 -> 0 +invx034 invert 11111111111 -> 0 +invx035 invert 1111111111 -> 0 +invx036 invert 111111111 -> 0 + +invx080 invert 011111111 -> 100000000 +invx081 invert 101111111 -> 10000000 +invx082 invert 110111111 -> 1000000 +invx083 invert 111011111 -> 100000 +invx084 invert 111101111 -> 10000 +invx085 invert 111110111 -> 1000 +invx086 invert 111111011 -> 100 +invx087 invert 111111101 -> 10 +invx088 invert 111111110 -> 1 +invx089 invert 011111011 -> 100000100 +invx090 invert 101111101 -> 10000010 +invx091 invert 110111110 -> 1000001 +invx092 invert 111011101 -> 100010 +invx093 invert 111101011 -> 10100 +invx094 invert 111110111 -> 1000 +invx095 invert 111101011 -> 10100 +invx096 invert 111011101 -> 100010 +invx097 invert 110111110 -> 1000001 +invx098 invert 101111101 -> 10000010 +invx099 invert 011111011 -> 100000100 + +-- non-0/1 should not be accepted, nor should signs +invx220 invert 111111112 -> NaN Invalid_operation +invx221 invert 333333333 -> NaN Invalid_operation +invx222 invert 555555555 -> NaN Invalid_operation +invx223 invert 777777777 -> NaN Invalid_operation +invx224 invert 999999999 -> NaN Invalid_operation +invx225 invert 222222222 -> NaN Invalid_operation +invx226 invert 444444444 -> NaN Invalid_operation +invx227 invert 666666666 -> NaN Invalid_operation +invx228 invert 888888888 -> NaN Invalid_operation +invx229 invert 999999999 -> NaN Invalid_operation +invx230 invert 999999999 -> NaN Invalid_operation +invx231 invert 999999999 -> NaN Invalid_operation +invx232 invert 999999999 -> NaN Invalid_operation +-- a few randoms +invx240 invert 567468689 -> NaN Invalid_operation +invx241 invert 567367689 -> NaN Invalid_operation +invx242 invert -631917772 -> NaN Invalid_operation +invx243 invert -756253257 -> NaN Invalid_operation +invx244 invert 835590149 -> NaN Invalid_operation +-- test MSD +invx250 invert 200000000 -> NaN Invalid_operation +invx251 invert 300000000 -> NaN Invalid_operation +invx252 invert 400000000 -> NaN Invalid_operation +invx253 invert 500000000 -> NaN Invalid_operation +invx254 invert 600000000 -> NaN Invalid_operation +invx255 invert 700000000 -> NaN Invalid_operation +invx256 invert 800000000 -> NaN Invalid_operation +invx257 invert 900000000 -> NaN Invalid_operation +-- test MSD-1 +invx270 invert 021000000 -> NaN Invalid_operation +invx271 invert 030100000 -> NaN Invalid_operation +invx272 invert 040010000 -> NaN Invalid_operation +invx273 invert 050001000 -> NaN Invalid_operation +invx274 invert 160000100 -> NaN Invalid_operation +invx275 invert 170000010 -> NaN Invalid_operation +invx276 invert 180000000 -> NaN Invalid_operation +invx277 invert 190000000 -> NaN Invalid_operation +-- test LSD +invx280 invert 000000002 -> NaN Invalid_operation +invx281 invert 000000003 -> NaN Invalid_operation +invx282 invert 000000004 -> NaN Invalid_operation +invx283 invert 000000005 -> NaN Invalid_operation +invx284 invert 101000006 -> NaN Invalid_operation +invx285 invert 100100007 -> NaN Invalid_operation +invx286 invert 100010008 -> NaN Invalid_operation +invx287 invert 100001009 -> NaN Invalid_operation +-- test Middie +invx288 invert 000020000 -> NaN Invalid_operation +invx289 invert 000030001 -> NaN Invalid_operation +invx290 invert 000040000 -> NaN Invalid_operation +invx291 invert 000050000 -> NaN Invalid_operation +invx292 invert 101060000 -> NaN Invalid_operation +invx293 invert 100170010 -> NaN Invalid_operation +invx294 invert 100080100 -> NaN Invalid_operation +invx295 invert 100091000 -> NaN Invalid_operation +-- signs +invx296 invert -100001000 -> NaN Invalid_operation +invx299 invert 100001000 -> 11110111 + +-- Nmax, Nmin, Ntiny +invx341 invert 9.99999999E+999 -> NaN Invalid_operation +invx342 invert 1E-999 -> NaN Invalid_operation +invx343 invert 1.00000000E-999 -> NaN Invalid_operation +invx344 invert 1E-1007 -> NaN Invalid_operation +invx345 invert -1E-1007 -> NaN Invalid_operation +invx346 invert -1.00000000E-999 -> NaN Invalid_operation +invx347 invert -1E-999 -> NaN Invalid_operation +invx348 invert -9.99999999E+999 -> NaN Invalid_operation + +-- A few other non-integers +invx361 invert 1.0 -> NaN Invalid_operation +invx362 invert 1E+1 -> NaN Invalid_operation +invx363 invert 0.0 -> NaN Invalid_operation +invx364 invert 0E+1 -> NaN Invalid_operation +invx365 invert 9.9 -> NaN Invalid_operation +invx366 invert 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +invx788 invert -Inf -> NaN Invalid_operation +invx794 invert Inf -> NaN Invalid_operation +invx821 invert NaN -> NaN Invalid_operation +invx841 invert sNaN -> NaN Invalid_operation +-- propagating NaNs +invx861 invert NaN1 -> NaN Invalid_operation +invx862 invert +NaN2 -> NaN Invalid_operation +invx863 invert NaN3 -> NaN Invalid_operation +invx864 invert NaN4 -> NaN Invalid_operation +invx865 invert NaN5 -> NaN Invalid_operation +invx871 invert sNaN11 -> NaN Invalid_operation +invx872 invert sNaN12 -> NaN Invalid_operation +invx873 invert sNaN13 -> NaN Invalid_operation +invx874 invert sNaN14 -> NaN Invalid_operation +invx875 invert sNaN15 -> NaN Invalid_operation +invx876 invert NaN16 -> NaN Invalid_operation +invx881 invert +NaN25 -> NaN Invalid_operation +invx882 invert -NaN26 -> NaN Invalid_operation +invx883 invert -sNaN27 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ln.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/ln.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,611 @@ +------------------------------------------------------------------------ +-- ln.decTest -- decimal natural logarithm -- +-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- basics (examples in specification) +precision: 9 +lnxs001 ln 0 -> -Infinity +lnxs002 ln 1.000 -> 0 +lnxs003 ln 2.71828183 -> 1.00000000 Inexact Rounded +lnxs004 ln 10 -> 2.30258509 Inexact Rounded +lnxs005 ln +Infinity -> Infinity + + +-- basics +precision: 16 +lnx0001 ln 0 -> -Infinity +lnx0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded +lnx0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded +lnx0004 ln 0.1 -> -2.302585092994046 Inexact Rounded +lnx0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded +lnx0006 ln 1 -> 0 +lnx0007 ln 1.000 -> 0 +lnx0008 ln 1.5 -> 0.4054651081081644 Inexact Rounded +lnx0009 ln 2 -> 0.6931471805599453 Inexact Rounded +lnx0010 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded +lnx0011 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded +lnx0012 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded +lnx0013 ln 10 -> 2.302585092994046 Inexact Rounded +lnx0014 ln 10.5 -> 2.351375257163478 Inexact Rounded +lnx0015 ln 9999 -> 9.210240366975849 Inexact Rounded +lnx0016 ln 1E6 -> 13.81551055796427 Inexact Rounded +lnx0017 ln 1E+9 -> 20.72326583694641 Inexact Rounded +lnx0018 ln +Infinity -> Infinity + +-- notable cases +-- negatives +lnx0021 ln -1E-9 -> NaN Invalid_operation +lnx0022 ln -0.0007 -> NaN Invalid_operation +lnx0023 ln -0.1 -> NaN Invalid_operation +lnx0024 ln -0.7 -> NaN Invalid_operation +lnx0025 ln -1 -> NaN Invalid_operation +lnx0026 ln -1.5 -> NaN Invalid_operation +lnx0027 ln -2 -> NaN Invalid_operation +lnx0029 ln -10.5 -> NaN Invalid_operation +lnx0028 ln -9999 -> NaN Invalid_operation +lnx0030 ln -2.718281828459045 -> NaN Invalid_operation +lnx0031 ln -2.718281828459046 -> NaN Invalid_operation +lnx0032 ln -0 -> -Infinity +lnx0033 ln -0E+17 -> -Infinity +lnx0034 ln -0E-17 -> -Infinity +-- other zeros +lnx0041 ln 0 -> -Infinity +lnx0042 ln 0E+17 -> -Infinity +lnx0043 ln 0E-17 -> -Infinity +-- infinities +lnx0045 ln -Infinity -> NaN Invalid_operation +lnx0046 ln +Infinity -> Infinity +-- ones +lnx0050 ln 1 -> 0 +lnx0051 ln 1.0 -> 0 +lnx0052 ln 1.000000000000000 -> 0 +lnx0053 ln 1.000000000000000000 -> 0 + +-- lower precision basics +Precision: 7 +lnx0101 ln 0 -> -Infinity +lnx0102 ln 1E-9 -> -20.72327 Inexact Rounded +lnx0103 ln 0.0007 -> -7.264430 Inexact Rounded +lnx0104 ln 0.1 -> -2.302585 Inexact Rounded +lnx0105 ln 0.7 -> -0.3566749 Inexact Rounded +lnx0106 ln 1 -> 0 +lnx0107 ln 1.5 -> 0.4054651 Inexact Rounded +lnx0108 ln 2 -> 0.6931472 Inexact Rounded +lnx0109 ln 2.718281828459045 -> 1.000000 Inexact Rounded +lnx0110 ln 2.718281828459046 -> 1.000000 Inexact Rounded +lnx0111 ln 2.718281828459047 -> 1.000000 Inexact Rounded +lnx0112 ln 10 -> 2.302585 Inexact Rounded +lnx0113 ln 10.5 -> 2.351375 Inexact Rounded +lnx0114 ln 9999 -> 9.210240 Inexact Rounded +lnx0115 ln 1E6 -> 13.81551 Inexact Rounded +lnx0116 ln 1E+9 -> 20.72327 Inexact Rounded +lnx0117 ln +Infinity -> Infinity +Precision: 2 +lnx0121 ln 0 -> -Infinity +lnx0122 ln 1E-9 -> -21 Inexact Rounded +lnx0123 ln 0.0007 -> -7.3 Inexact Rounded +lnx0124 ln 0.1 -> -2.3 Inexact Rounded +lnx0125 ln 0.7 -> -0.36 Inexact Rounded +lnx0126 ln 1 -> 0 +lnx0127 ln 1.5 -> 0.41 Inexact Rounded +lnx0128 ln 2 -> 0.69 Inexact Rounded +lnx0129 ln 2.718281828459045 -> 1.0 Inexact Rounded +lnx0130 ln 2.718281828459046 -> 1.0 Inexact Rounded +lnx0131 ln 2.718281828459047 -> 1.0 Inexact Rounded +lnx0132 ln 10 -> 2.3 Inexact Rounded +lnx0133 ln 10.5 -> 2.4 Inexact Rounded +lnx0134 ln 9999 -> 9.2 Inexact Rounded +lnx0135 ln 1E6 -> 14 Inexact Rounded +lnx0136 ln 1E+9 -> 21 Inexact Rounded +lnx0137 ln +Infinity -> Infinity +Precision: 1 +lnx0141 ln 0 -> -Infinity +lnx0142 ln 1E-9 -> -2E+1 Inexact Rounded +lnx0143 ln 0.0007 -> -7 Inexact Rounded +lnx0144 ln 0.1 -> -2 Inexact Rounded +lnx0145 ln 0.7 -> -0.4 Inexact Rounded +lnx0146 ln 1 -> 0 +lnx0147 ln 1.5 -> 0.4 Inexact Rounded +lnx0148 ln 2 -> 0.7 Inexact Rounded +lnx0149 ln 2.718281828459045 -> 1 Inexact Rounded +lnx0150 ln 2.718281828459046 -> 1 Inexact Rounded +lnx0151 ln 2.718281828459047 -> 1 Inexact Rounded +lnx0152 ln 10 -> 2 Inexact Rounded +lnx0153 ln 10.5 -> 2 Inexact Rounded +lnx0154 ln 9999 -> 9 Inexact Rounded +lnx0155 ln 1E6 -> 1E+1 Inexact Rounded +lnx0156 ln 1E+9 -> 2E+1 Inexact Rounded +lnx0157 ln +Infinity -> Infinity + +-- group low-precision ln(1)s: +precision: 1 +lnx0161 ln 1 -> 0 +precision: 2 +lnx0162 ln 1 -> 0 +precision: 3 +lnx0163 ln 1 -> 0 +precision: 4 +lnx0164 ln 1 -> 0 +precision: 5 +lnx0165 ln 1 -> 0 +precision: 6 +lnx0166 ln 1 -> 0 +precision: 7 +lnx0167 ln 1 -> 0 +precision: 8 +lnx0168 ln 1 -> 0 + +-- edge-test ln(2) and ln(10) in case of lookasides +precision: 45 +lnx201 ln 2 -> 0.693147180559945309417232121458176568075500134 Inexact Rounded +lnx202 ln 10 -> 2.30258509299404568401799145468436420760110149 Inexact Rounded +precision: 44 +lnx203 ln 2 -> 0.69314718055994530941723212145817656807550013 Inexact Rounded +lnx204 ln 10 -> 2.3025850929940456840179914546843642076011015 Inexact Rounded +precision: 43 +lnx205 ln 2 -> 0.6931471805599453094172321214581765680755001 Inexact Rounded +lnx206 ln 10 -> 2.302585092994045684017991454684364207601101 Inexact Rounded +precision: 42 +lnx207 ln 2 -> 0.693147180559945309417232121458176568075500 Inexact Rounded +lnx208 ln 10 -> 2.30258509299404568401799145468436420760110 Inexact Rounded +precision: 41 +lnx209 ln 2 -> 0.69314718055994530941723212145817656807550 Inexact Rounded +lnx210 ln 10 -> 2.3025850929940456840179914546843642076011 Inexact Rounded +precision: 40 +lnx211 ln 2 -> 0.6931471805599453094172321214581765680755 Inexact Rounded +lnx212 ln 10 -> 2.302585092994045684017991454684364207601 Inexact Rounded +precision: 39 +lnx213 ln 2 -> 0.693147180559945309417232121458176568076 Inexact Rounded +lnx214 ln 10 -> 2.30258509299404568401799145468436420760 Inexact Rounded +precision: 38 +lnx215 ln 2 -> 0.69314718055994530941723212145817656808 Inexact Rounded +lnx216 ln 10 -> 2.3025850929940456840179914546843642076 Inexact Rounded +precision: 37 +lnx217 ln 2 -> 0.6931471805599453094172321214581765681 Inexact Rounded +lnx218 ln 10 -> 2.302585092994045684017991454684364208 Inexact Rounded +precision: 36 +lnx219 ln 2 -> 0.693147180559945309417232121458176568 Inexact Rounded +lnx220 ln 10 -> 2.30258509299404568401799145468436421 Inexact Rounded +precision: 35 +lnx221 ln 2 -> 0.69314718055994530941723212145817657 Inexact Rounded +lnx222 ln 10 -> 2.3025850929940456840179914546843642 Inexact Rounded +precision: 34 +lnx223 ln 2 -> 0.6931471805599453094172321214581766 Inexact Rounded +lnx224 ln 10 -> 2.302585092994045684017991454684364 Inexact Rounded +precision: 33 +lnx225 ln 2 -> 0.693147180559945309417232121458177 Inexact Rounded +lnx226 ln 10 -> 2.30258509299404568401799145468436 Inexact Rounded +precision: 32 +lnx227 ln 2 -> 0.69314718055994530941723212145818 Inexact Rounded +lnx228 ln 10 -> 2.3025850929940456840179914546844 Inexact Rounded +precision: 31 +lnx229 ln 2 -> 0.6931471805599453094172321214582 Inexact Rounded +lnx230 ln 10 -> 2.302585092994045684017991454684 Inexact Rounded +precision: 30 +lnx231 ln 2 -> 0.693147180559945309417232121458 Inexact Rounded +lnx232 ln 10 -> 2.30258509299404568401799145468 Inexact Rounded + +-- extreme input range values +maxExponent: 384 +minExponent: -383 +Precision: 16 + +lnx0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded +lnx0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded +lnx0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded +lnx0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded +lnx0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded +lnx0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded + +lnx0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded +lnx0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded +lnx0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded +lnx0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded +lnx0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded +lnx0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded +lnx0916 ln 9.999999999999999999999999e+999999 -> 2302585.092994046 Inexact Rounded + +-- randoms +-- P=50, within 0-999 +Precision: 50 +maxExponent: 384 +minExponent: -383 +lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded +lnx1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded +lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded +lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded +lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded +lnx1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded +lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded +lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded +lnx1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded +lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded +lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded +lnx1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded +lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded +lnx1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded +lnx1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded +lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded +lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded +lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded +lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded +lnx1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded +lnx1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded +lnx1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded +lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded +lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded +lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded +lnx1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded +lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded +lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded +lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded +lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded +lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded +lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded +lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded +lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded +lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded +lnx1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded +lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded +lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded +lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded +lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded + +-- P=34, within 0-999 +Precision: 34 +lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded +lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded +lnx1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded +lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded +lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded +lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded +lnx1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded +lnx1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded +lnx1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded +lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded +lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded +lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded +lnx1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded +lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded +lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded +lnx1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded +lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded +lnx1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded +lnx1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded +lnx1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded +lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded +lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded +lnx1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded +lnx1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded +lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded +lnx1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded +lnx1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded +lnx1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded +lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded +lnx1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded +lnx1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded +lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded +lnx1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded +lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded +lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded +lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded +lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded +lnx1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded +lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded +lnx1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded + +-- P=16, within 0-99 +Precision: 16 +lnx1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded +lnx1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded +lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded +lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded +lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded +lnx1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded +lnx1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded +lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded +lnx1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded +lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded +lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded +lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded +lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded +lnx1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded +lnx1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded +lnx1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded +lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded +lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded +lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded +lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded +lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded +lnx1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded +lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded +lnx1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded +lnx1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded +lnx1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded +lnx1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded +lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded +lnx1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded +lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded +lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded +lnx1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded +lnx1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded +lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded +lnx1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded +lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded +lnx1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded +lnx1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded +lnx1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded +lnx1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded + +-- P=7, within 0-9 +Precision: 7 +lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded +lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded +lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded +lnx1004 ln 8.798639 -> 2.174597 Inexact Rounded +lnx1005 ln 2.459121 -> 0.8998040 Inexact Rounded +lnx1006 ln 2.013193 -> 0.6997220 Inexact Rounded +lnx1007 ln 9.064857 -> 2.204405 Inexact Rounded +lnx1008 ln 5.796417 -> 1.757240 Inexact Rounded +lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded +lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded +lnx1011 ln 6.693781 -> 1.901179 Inexact Rounded +lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded +lnx1013 ln 8.313616 -> 2.117895 Inexact Rounded +lnx1014 ln 3.486925 -> 1.249020 Inexact Rounded +lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded +lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded +lnx1017 ln 7.818111 -> 2.056443 Inexact Rounded +lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded +lnx1019 ln 8.153966 -> 2.098504 Inexact Rounded +lnx1020 ln 2.040975 -> 0.7134276 Inexact Rounded +lnx1021 ln 1.481642 -> 0.3931509 Inexact Rounded +lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded +lnx1023 ln 0.466723 -> -0.7620193 Inexact Rounded +lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded +lnx1025 ln 2.056410 -> 0.7209617 Inexact Rounded +lnx1026 ln 0.181522 -> -1.706378 Inexact Rounded +lnx1027 ln 0.515551 -> -0.6625190 Inexact Rounded +lnx1028 ln 8.425089 -> 2.131214 Inexact Rounded +lnx1029 ln 2.077091 -> 0.7309684 Inexact Rounded +lnx1030 ln 6.212705 -> 1.826596 Inexact Rounded +lnx1031 ln 5.729343 -> 1.745601 Inexact Rounded +lnx1032 ln 4.831251 -> 1.575105 Inexact Rounded +lnx1033 ln 2.029760 -> 0.7079176 Inexact Rounded +lnx1034 ln 8.615060 -> 2.153512 Inexact Rounded +lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded +lnx1036 ln 5.195269 -> 1.647748 Inexact Rounded +lnx1037 ln 9.617686 -> 2.263604 Inexact Rounded +lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded +lnx1039 ln 2.786840 -> 1.024908 Inexact Rounded +lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded + +-- from here 3-digit tests are based on reverse exp tests +precision: 9 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +lnx001 ln 0 -> -Infinity +lnx002 ln 0.367879441 -> -1.00000000 Inexact Rounded +lnx003 ln 1 -> 0 +lnx005 ln 2.71828183 -> 1.00000000 Inexact Rounded +lnx006 ln 2.00000000 -> 0.693147181 Inexact Rounded +lnx007 ln +Infinity -> Infinity + +-- tiny edge cases +precision: 7 +lnx011 ln 1.105171 -> 0.1000001 Inexact Rounded +lnx012 ln 1.010050 -> 0.009999835 Inexact Rounded +lnx013 ln 1.000010 -> 0.000009999950 Inexact Rounded +lnx014 ln 1.000001 -> 9.999995E-7 Inexact Rounded +lnx015 ln 1.000000 -> 0 + +-- basic e=0, e=1, e=2, e=4, e>=8 cases +precision: 7 +lnx041 ln 2.718282 -> 1.000000 Inexact Rounded +lnx042 ln 0.3678794 -> -1.000000 Inexact Rounded +lnx043 ln 22026.47 -> 10.00000 Inexact Rounded +lnx044 ln 0.00004539993 -> -10.00000 Inexact Rounded +lnx045 ln 2.688117E+43 -> 100.0000 Inexact Rounded +lnx046 ln 3.720076E-44 -> -100.0000 Inexact Rounded +lnx047 ln Infinity -> Infinity +lnx048 ln 0E-389 -> -Infinity + +-- miscellanea +precision: 16 +lnx055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded +precision: 17 +lnx056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded +precision: 18 +lnx057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded +precision: 19 +lnx058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded +precision: 20 +lnx059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded + +-- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences +precision: 50 +lnx102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded +precision: 30 +lnx103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded +precision: 29 +lnx104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded +precision: 28 +lnx105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded +precision: 27 +lnx106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded +precision: 26 +lnx107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded +precision: 25 +lnx108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded +precision: 24 +lnx109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded +precision: 23 +lnx110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded +precision: 22 +lnx111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded +precision: 21 +lnx112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded +precision: 20 +lnx113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded +precision: 19 +lnx114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded +precision: 18 +lnx115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded +-- next may be a > 0.5ulp case; a more precise answer is: +-- -8.99999999999998784999918E-8 +precision: 17 +lnx116 ln 0.99999991000000405 -> -8.9999999999999878E-8 Inexact Rounded +precision: 16 +lnx117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded +precision: 15 +lnx118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded +precision: 14 +lnx119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded +precision: 13 +lnx120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded +precision: 12 +lnx121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded +precision: 11 +lnx122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded +precision: 10 +lnx123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded +precision: 9 +lnx124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded +precision: 8 +lnx125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded +precision: 7 +lnx126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded +precision: 16 +lnx126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded +precision: 6 +lnx127 ln 0.999999 -> -0.00000100000 Inexact Rounded +precision: 5 +lnx128 ln 0.99999 -> -0.000010000 Inexact Rounded +precision: 4 +lnx129 ln 0.9999 -> -0.0001000 Inexact Rounded +precision: 3 +lnx130 ln 0.999 -> -0.00100 Inexact Rounded +precision: 2 +lnx131 ln 0.99 -> -0.010 Inexact Rounded +precision: 1 +lnx132 ln 0.9 -> -0.1 Inexact Rounded + + +-- cases near 1 -- 1 2345678901234567890 +precision: 20 +lnx401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded +lnx402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded +lnx403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded +lnx404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded +lnx405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded +lnx406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded +lnx407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded +precision: 14 +lnx411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded +lnx413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded +lnx416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded +lnx417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded + +-- overflows, including some exp overprecise borderlines +precision: 7 +maxExponent: 384 +minExponent: -383 +lnx709 ln 9.999999E+384 -> 886.4953 Inexact Rounded +lnx711 ln 9.999992E+384 -> 886.4953 Inexact Rounded +precision: 16 +lnx722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded +lnx724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded +lnx726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded +-- and more... +precision: 15 +maxExponent: 999 +minExponent: -999 +lnx731 ln 9.99999999999999E+999 -> 2302.58509299405 Inexact Rounded +-- next may be a > 0.5ulp case; a more precise answer is: +-- 2302.58509299404495001799145442 +lnx732 ln 9.99999999999266E+999 -> 2302.58509299404 Inexact Rounded +lnx733 ln 9.99999999999265E+999 -> 2302.58509299404 Inexact Rounded +lnx734 ln 9.99999999999264E+999 -> 2302.58509299404 Inexact Rounded + +-- subnormals and underflows for exp, including underflow-to-zero edge point +precision: 7 +maxExponent: 384 +minExponent: -383 +lnx751 ln 0E-389 -> -Infinity +lnx758 ln 1.000001E-383 -> -881.8901 Inexact Rounded +lnx759 ln 9.99991E-384 -> -881.8901 Inexact Rounded +lnx760 ln 4.4605E-385 -> -885.0000 Inexact Rounded +lnx761 ln 2.221E-386 -> -887.9999 Inexact Rounded +lnx762 ln 3.01E-387 -> -889.9985 Inexact Rounded +lnx763 ln 1.7E-388 -> -892.8724 Inexact Rounded +lnx764 ln 1.5E-388 -> -892.9976 Inexact Rounded +lnx765 ln 9E-389 -> -893.5084 Inexact Rounded +lnx766 ln 1E-389 -> -895.7056 Inexact Rounded +lnx774 ln 0E-389 -> -Infinity + +-- special values +lnx820 ln Infinity -> Infinity +lnx821 ln 0 -> -Infinity +lnx822 ln NaN -> NaN +lnx823 ln sNaN -> NaN Invalid_operation +-- propagating NaNs +lnx824 ln sNaN123 -> NaN123 Invalid_operation +lnx825 ln -sNaN321 -> -NaN321 Invalid_operation +lnx826 ln NaN456 -> NaN456 +lnx827 ln -NaN654 -> -NaN654 +lnx828 ln NaN1 -> NaN1 + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +lnx901 ln 1 -> NaN Invalid_context +precision: 99999999 +lnx902 ln 0 -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +lnx903 ln 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +lnx904 ln 0 -> -Infinity +maxExponent: 999999 +minExponent: -1000000 +lnx905 ln 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +lnx906 ln 0 -> -Infinity + +-- payload decapitate +precision: 5 +lnx910 ln -sNaN1234567890 -> -NaN67890 Invalid_operation + +-- Null test +lnx900 ln # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/log10.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/log10.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,551 @@ +------------------------------------------------------------------------ +-- log10.decTest -- decimal logarithm in base 10 -- +-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This emphasises the testing of notable cases, as they will often +-- have unusual paths (especially the 10**n results). + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- examples in specification +precision: 9 +logxs000 log10 0 -> -Infinity +logxs001 log10 0.001 -> -3 +logxs002 log10 1 -> 0 +logxs003 log10 2 -> 0.301029996 Inexact Rounded +logxs004 log10 10 -> 1 +logxs005 log10 70 -> 1.84509804 Inexact Rounded +logxs006 log10 +Infinity -> Infinity + + +-- basics (examples in specification, etc.) +precision: 16 +logx0000 log10 0 -> -Infinity +logx0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded +logx0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded +logx0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded +logx0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded +logx0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded +logx0006 log10 1 -> 0 +logx0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded +logx0008 log10 2 -> 0.3010299956639812 Inexact Rounded +logx0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded +logx0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded +logx0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded +logx0012 log10 7 -> 0.8450980400142568 Inexact Rounded +logx0013 log10 10 -> 1 +logx0014 log10 10.5 -> 1.021189299069938 Inexact Rounded +logx0015 log10 11 -> 1.041392685158225 Inexact Rounded +logx0016 log10 70 -> 1.845098040014257 Inexact Rounded +logx0017 log10 9999 -> 3.999956568380192 Inexact Rounded +logx0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded +logx0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded +logx0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded +logx0021 log10 +Infinity -> Infinity + +-- notable cases +-- negatives +logx0031 log10 -1E-9 -> NaN Invalid_operation +logx0032 log10 -0.0007 -> NaN Invalid_operation +logx0033 log10 -0.1 -> NaN Invalid_operation +logx0034 log10 -0.7 -> NaN Invalid_operation +logx0035 log10 -1 -> NaN Invalid_operation +logx0036 log10 -1.5 -> NaN Invalid_operation +logx0037 log10 -2 -> NaN Invalid_operation +logx0038 log10 -10.5 -> NaN Invalid_operation +logx0039 log10 -10.5 -> NaN Invalid_operation +logx0040 log10 -9999 -> NaN Invalid_operation +logx0041 log10 -10 -> NaN Invalid_operation +logx0042 log10 -0 -> -Infinity +logx0043 log10 -0E+17 -> -Infinity +logx0044 log10 -0E-17 -> -Infinity +-- other zeros +logx0051 log10 0 -> -Infinity +logx0052 log10 0E+17 -> -Infinity +logx0053 log10 0E-17 -> -Infinity +-- infinities +logx0055 log10 -Infinity -> NaN Invalid_operation +logx0056 log10 +Infinity -> Infinity +-- ones +logx0061 log10 1 -> 0 +logx0062 log10 1.0 -> 0 +logx0063 log10 1.000000000000000 -> 0 +logx0064 log10 1.000000000000000000 -> 0 + +-- notable cases -- exact powers of 10 +logx1100 log10 1 -> 0 +logx1101 log10 10 -> 1 +logx1102 log10 100 -> 2 +logx1103 log10 1000 -> 3 +logx1104 log10 10000 -> 4 +logx1105 log10 100000 -> 5 +logx1106 log10 1000000 -> 6 +logx1107 log10 10000000 -> 7 +logx1108 log10 100000000 -> 8 +logx1109 log10 1000000000 -> 9 +logx1110 log10 10000000000 -> 10 +logx1111 log10 100000000000 -> 11 +logx1112 log10 1000000000000 -> 12 +logx1113 log10 0.00000000001 -> -11 +logx1114 log10 0.0000000001 -> -10 +logx1115 log10 0.000000001 -> -9 +logx1116 log10 0.00000001 -> -8 +logx1117 log10 0.0000001 -> -7 +logx1118 log10 0.000001 -> -6 +logx1119 log10 0.00001 -> -5 +logx1120 log10 0.0001 -> -4 +logx1121 log10 0.001 -> -3 +logx1122 log10 0.01 -> -2 +logx1123 log10 0.1 -> -1 +logx1124 log10 1E-99 -> -99 +logx1125 log10 1E-100 -> -100 +logx1126 log10 1E-383 -> -383 + +-- check normally exact cases round properly +precision: 1 +logx1141 log10 10000000000 -> 1E+1 Rounded +logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded +logx1143 log10 1E+100 -> 1E+2 Rounded +logx1144 log10 1E+123 -> 1E+2 Inexact Rounded +logx1145 log10 1E+126 -> 1E+2 Inexact Rounded +logx1146 log10 1E+916 -> 9E+2 Inexact Rounded +logx1147 log10 1E+999 -> 1E+3 Inexact Rounded + +precision: 2 +logx1151 log10 10000000000 -> 10 +logx1152 log10 1000000000000 -> 12 +logx1153 log10 1E+100 -> 1.0E+2 Rounded +logx1154 log10 1E+123 -> 1.2E+2 Inexact Rounded +logx1155 log10 1E+126 -> 1.3E+2 Inexact Rounded +logx1156 log10 1E+916 -> 9.2E+2 Inexact Rounded +logx1157 log10 1E+999 -> 1.0E+3 Inexact Rounded +-- some half-way point rounds, other cases, and negatives +logx1158 log10 1E+125 -> 1.2E+2 Inexact Rounded +logx1159 log10 1E+135 -> 1.4E+2 Inexact Rounded +logx1160 log10 1E+129 -> 1.3E+2 Inexact Rounded +logx1161 log10 1E+131 -> 1.3E+2 Inexact Rounded +logx1162 log10 1E-123 -> -1.2E+2 Inexact Rounded +logx1163 log10 1E-126 -> -1.3E+2 Inexact Rounded +logx1164 log10 1E-916 -> -9.2E+2 Inexact Rounded +logx1165 log10 1E-999 -> -1.0E+3 Inexact Rounded +logx1166 log10 1E-125 -> -1.2E+2 Inexact Rounded +logx1167 log10 1E-135 -> -1.4E+2 Inexact Rounded +logx1168 log10 1E-129 -> -1.3E+2 Inexact Rounded +logx1169 log10 1E-131 -> -1.3E+2 Inexact Rounded + +precision: 3 +logx1171 log10 10000000000 -> 10 +logx1172 log10 1000000000000 -> 12 +logx1173 log10 1E+100 -> 100 +logx1174 log10 1E+123 -> 123 +logx1175 log10 1E+126 -> 126 +logx1176 log10 1E+916 -> 916 +logx1177 log10 1E+999 -> 999 + +-- log10(2) .. tests both ln(2) and ln(10) constants, too +precision: 50 +logx1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded +logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded +logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded +precision: 49 +logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded +precision: 48 +logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded +precision: 47 +logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded +precision: 46 +logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded +precision: 45 +logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded +precision: 44 +logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded +precision: 43 +logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded +precision: 42 +logx1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded +precision: 41 +logx1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded +precision: 40 +logx1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded +precision: 39 +logx1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded +precision: 38 +logx1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded +precision: 37 +logx1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded +precision: 36 +logx1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded +precision: 35 +logx1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded +precision: 34 +logx1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded +precision: 33 +logx1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded +precision: 32 +logx1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded +precision: 31 +logx1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded +precision: 30 +logx1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded +precision: 29 +logx1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded +precision: 28 +logx1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded +precision: 27 +logx1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded +precision: 26 +logx1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded +precision: 25 +logx1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded +precision: 24 +logx1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded +precision: 23 +logx1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded +precision: 22 +logx1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded +precision: 21 +logx1232 log10 2 -> 0.301029995663981195214 Inexact Rounded +precision: 20 +logx1233 log10 2 -> 0.30102999566398119521 Inexact Rounded +precision: 19 +logx1234 log10 2 -> 0.3010299956639811952 Inexact Rounded +precision: 18 +logx1235 log10 2 -> 0.301029995663981195 Inexact Rounded +precision: 17 +logx1236 log10 2 -> 0.30102999566398120 Inexact Rounded +precision: 16 +logx1237 log10 2 -> 0.3010299956639812 Inexact Rounded +precision: 15 +logx1238 log10 2 -> 0.301029995663981 Inexact Rounded +precision: 14 +logx1239 log10 2 -> 0.30102999566398 Inexact Rounded +precision: 13 +logx1240 log10 2 -> 0.3010299956640 Inexact Rounded +precision: 12 +logx1241 log10 2 -> 0.301029995664 Inexact Rounded +precision: 11 +logx1242 log10 2 -> 0.30102999566 Inexact Rounded +precision: 10 +logx1243 log10 2 -> 0.3010299957 Inexact Rounded +precision: 9 +logx1244 log10 2 -> 0.301029996 Inexact Rounded +precision: 8 +logx1245 log10 2 -> 0.30103000 Inexact Rounded +precision: 7 +logx1246 log10 2 -> 0.3010300 Inexact Rounded +precision: 6 +logx1247 log10 2 -> 0.301030 Inexact Rounded +precision: 5 +logx1248 log10 2 -> 0.30103 Inexact Rounded +precision: 4 +logx1249 log10 2 -> 0.3010 Inexact Rounded +precision: 3 +logx1250 log10 2 -> 0.301 Inexact Rounded +precision: 2 +logx1251 log10 2 -> 0.30 Inexact Rounded +precision: 1 +logx1252 log10 2 -> 0.3 Inexact Rounded + +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- More close-to-e, etc., tests +precision: 34 +logx1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded +logx1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded +logx1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded +logx1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded +logx1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded +logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded +logx1307 log10 1.000000000000000000000000000000000 -> 0 +logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded +logx1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded +logx1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded +-- lower p +precision: 7 +logx1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded +logx1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded +logx1322 log10 0.99999999 -> -4.342945E-9 Inexact Rounded +logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded +logx1324 log10 1.00000000 -> 0 +logx1325 log10 1.00000001 -> 4.342945E-9 Inexact Rounded +logx1326 log10 1.0000001 -> 4.342945E-8 Inexact Rounded +logx1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded + +-- near 10^3 +precision: 9 +logx1331 log10 999.9999998 -> 3.00000000 Inexact Rounded +logx1332 log10 999.9999999 -> 3.00000000 Inexact Rounded +logx1333 log10 1000.000000 -> 3 +logx1334 log10 1000.000001 -> 3.00000000 Inexact Rounded +logx1335 log10 1000.000002 -> 3.00000000 Inexact Rounded +precision: 16 +logx1341 log10 999.9999998 -> 2.999999999913141 Inexact Rounded +logx1342 log10 999.9999999 -> 2.999999999956571 Inexact Rounded +logx1343 log10 1000.000000 -> 3 +logx1344 log10 1000.000001 -> 3.000000000434294 Inexact Rounded +logx1345 log10 1000.000002 -> 3.000000000868589 Inexact Rounded + +-- suggestions from Ilan Nehama +logx1400 log10 10E-3 -> -2 +logx1401 log10 10E-2 -> -1 +logx1402 log10 100E-2 -> 0 +logx1403 log10 1000E-2 -> 1 +logx1404 log10 10000E-2 -> 2 +logx1405 log10 10E-1 -> 0 +logx1406 log10 100E-1 -> 1 +logx1407 log10 1000E-1 -> 2 +logx1408 log10 10000E-1 -> 3 +logx1409 log10 10E0 -> 1 +logx1410 log10 100E0 -> 2 +logx1411 log10 1000E0 -> 3 +logx1412 log10 10000E0 -> 4 +logx1413 log10 10E1 -> 2 +logx1414 log10 100E1 -> 3 +logx1415 log10 1000E1 -> 4 +logx1416 log10 10000E1 -> 5 +logx1417 log10 10E2 -> 3 +logx1418 log10 100E2 -> 4 +logx1419 log10 1000E2 -> 5 +logx1420 log10 10000E2 -> 6 + +-- Randoms +-- P=50, within 0-9999 +Precision: 50 +logx2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded +logx2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded +logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded +logx2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded +logx2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded +logx2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded +logx2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded +logx2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded +logx2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded +logx2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded +logx2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded +logx2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded +logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded +logx2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded +logx2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded +logx2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded +logx2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded +logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded +logx2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded +logx2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded +logx2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded +logx2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded +logx2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded +logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded +logx2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded +logx2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded +logx2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded +logx2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded +logx2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded +logx2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded +logx2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded +logx2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded +logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded +logx2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded +logx2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded +logx2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded +logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded +logx2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded +logx2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded +logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded + +-- P=34, within 0-9999 +Precision: 34 +logx2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded +logx2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded +logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded +logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded +logx2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded +logx2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded +logx2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded +logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded +logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded +logx2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded +logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded +logx2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded +logx2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded +logx2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded +logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded +logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded +logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded +logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded +logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded +logx2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded +logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded +logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded +logx2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded +logx2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded +logx2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded +logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded +logx2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded +logx2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded +logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded +logx2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded +logx2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded +logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded +logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded +logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded +logx2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded +logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded +logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded +logx2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded +logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded +logx2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded + +-- P=16, within 0-999 +Precision: 16 +logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded +logx2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded +logx2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded +logx2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded +logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded +logx2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded +logx2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded +logx2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded +logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded +logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded +logx2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded +logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded +logx2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded +logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded +logx2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded +logx2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded +logx2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded +logx2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded +logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded +logx2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded +logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded +logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded +logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded +logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded +logx2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded +logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded +logx2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded +logx2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded +logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded +logx2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded +logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded +logx2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded +logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded +logx2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded +logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded +logx2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded +logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded +logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded +logx2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded +logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded + +-- P=7, within 0-99 +Precision: 7 +logx2001 log10 57.26089 -> 1.757858 Inexact Rounded +logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded +logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded +logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded +logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded +logx2006 log10 9.926963 -> 0.9968164 Inexact Rounded +logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded +logx2008 log10 84.15412 -> 1.925075 Inexact Rounded +logx2009 log10 2.466856 -> 0.3921438 Inexact Rounded +logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded +logx2011 log10 9.885154 -> 0.9949834 Inexact Rounded +logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded +logx2013 log10 34.65736 -> 1.539795 Inexact Rounded +logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded +logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded +logx2016 log10 66.01407 -> 1.819637 Inexact Rounded +logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded +logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded +logx2019 log10 9.838983 -> 0.9929502 Inexact Rounded +logx2020 log10 15.89696 -> 1.201314 Inexact Rounded +logx2021 log10 8.459247 -> 0.9273317 Inexact Rounded +logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded +logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded +logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded +logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded +logx2026 log10 51.11152 -> 1.708519 Inexact Rounded +logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded +logx2028 log10 2.254721 -> 0.3530928 Inexact Rounded +logx2029 log10 6.568444 -> 0.8174625 Inexact Rounded +logx2030 log10 83.72639 -> 1.922862 Inexact Rounded +logx2031 log10 6.720585 -> 0.8274071 Inexact Rounded +logx2032 log10 87.90366 -> 1.944007 Inexact Rounded +logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded +logx2034 log10 34.63912 -> 1.539567 Inexact Rounded +logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded +logx2036 log10 7.793405 -> 0.8917272 Inexact Rounded +logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded +logx2038 log10 7.135417 -> 0.8534194 Inexact Rounded +logx2039 log10 12.49570 -> 1.096761 Inexact Rounded +logx2040 log10 6.356276 -> 0.8032027 Inexact Rounded + +-------- +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- special values +logx820 log10 Infinity -> Infinity +logx821 log10 0 -> -Infinity +logx822 log10 NaN -> NaN +logx823 log10 sNaN -> NaN Invalid_operation +-- propagating NaNs +logx824 log10 sNaN123 -> NaN123 Invalid_operation +logx825 log10 -sNaN321 -> -NaN321 Invalid_operation +logx826 log10 NaN456 -> NaN456 +logx827 log10 -NaN654 -> -NaN654 +logx828 log10 NaN1 -> NaN1 + + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +logx901 log10 1 -> NaN Invalid_context +precision: 99999999 +logx902 log10 0 -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +logx903 log10 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +logx904 log10 0 -> -Infinity +maxExponent: 999999 +minExponent: -1000000 +logx905 log10 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +logx906 log10 0 -> -Infinity + +-- Null test +logx900 log10 # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/logb.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/logb.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,162 @@ +------------------------------------------------------------------------ +-- logb.decTest -- return integral adjusted exponent as per 754r -- +-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This emphasises the testing of notable cases, as they will often +-- have unusual paths (especially the 10**n results). + +extended: 1 +rounding: half_even +maxExponent: 999 +minexponent: -999 + +-- basics & examples +precision: 9 +logbx001 logb 0 -> -Infinity Division_by_zero +logbx002 logb 1E-999 -> -999 +logbx003 logb 9E-999 -> -999 +logbx004 logb 0.001 -> -3 +logbx005 logb 0.03 -> -2 +logbx006 logb 1 -> 0 +logbx007 logb 2 -> 0 +logbx008 logb 2.5 -> 0 +logbx009 logb 2.50 -> 0 +logbx010 logb 10 -> 1 +logbx011 logb 70 -> 1 +logbx012 logb 100 -> 2 +logbx013 logb 250 -> 2 +logbx014 logb +Infinity -> Infinity + +-- negatives are treated as positives +logbx021 logb -0 -> -Infinity Division_by_zero +logbx022 logb -1E-999 -> -999 +logbx023 logb -9E-999 -> -999 +logbx024 logb -0.001 -> -3 +logbx025 logb -1 -> 0 +logbx026 logb -2 -> 0 +logbx027 logb -10 -> 1 +logbx028 logb -70 -> 1 +logbx029 logb -100 -> 2 +logbx030 logb -100000000 -> 8 +logbx031 logb -Infinity -> Infinity + +-- zeros +logbx111 logb 0 -> -Infinity Division_by_zero +logbx112 logb -0 -> -Infinity Division_by_zero +logbx113 logb 0E+4 -> -Infinity Division_by_zero +logbx114 logb -0E+4 -> -Infinity Division_by_zero +logbx115 logb 0.0000 -> -Infinity Division_by_zero +logbx116 logb -0.0000 -> -Infinity Division_by_zero +logbx117 logb 0E-141 -> -Infinity Division_by_zero +logbx118 logb -0E-141 -> -Infinity Division_by_zero + +-- full coefficients, alternating bits +logbx121 logb 268268268 -> 8 +logbx122 logb -268268268 -> 8 +logbx123 logb 134134134 -> 8 +logbx124 logb -134134134 -> 8 + +-- Nmax, Nmin, Ntiny +logbx131 logb 9.99999999E+999 -> 999 +logbx132 logb 1E-999 -> -999 +logbx133 logb 1.00000000E-999 -> -999 +logbx134 logb 1E-1007 -> -1007 + +logbx135 logb -1E-1007 -> -1007 +logbx136 logb -1.00000000E-999 -> -999 +logbx137 logb -1E-999 -> -999 +logbx138 logb -9.99999999E+999 -> 999 + +-- ones +logbx0061 logb 1 -> 0 +logbx0062 logb 1.0 -> 0 +logbx0063 logb 1.000000000000000 -> 0 +logbx0064 logb 1.000000000000000000 -> 0 + +-- notable cases -- exact powers of 10 +logbx1100 logb 1 -> 0 +logbx1101 logb 10 -> 1 +logbx1102 logb 100 -> 2 +logbx1103 logb 1000 -> 3 +logbx1104 logb 10000 -> 4 +logbx1105 logb 100000 -> 5 +logbx1106 logb 1000000 -> 6 +logbx1107 logb 10000000 -> 7 +logbx1108 logb 100000000 -> 8 +logbx1109 logb 1000000000 -> 9 +logbx1110 logb 10000000000 -> 10 +logbx1111 logb 100000000000 -> 11 +logbx1112 logb 1000000000000 -> 12 +logbx1113 logb 0.00000000001 -> -11 +logbx1114 logb 0.0000000001 -> -10 +logbx1115 logb 0.000000001 -> -9 +logbx1116 logb 0.00000001 -> -8 +logbx1117 logb 0.0000001 -> -7 +logbx1118 logb 0.000001 -> -6 +logbx1119 logb 0.00001 -> -5 +logbx1120 logb 0.0001 -> -4 +logbx1121 logb 0.001 -> -3 +logbx1122 logb 0.01 -> -2 +logbx1123 logb 0.1 -> -1 +logbx1124 logb 1E-99 -> -99 +logbx1125 logb 1E-100 -> -100 +logbx1126 logb 1E-383 -> -383 +logbx1127 logb 1E-999 -> -999 + +-- suggestions from Ilan Nehama +logbx1400 logb 10E-3 -> -2 +logbx1401 logb 10E-2 -> -1 +logbx1402 logb 100E-2 -> 0 +logbx1403 logb 1000E-2 -> 1 +logbx1404 logb 10000E-2 -> 2 +logbx1405 logb 10E-1 -> 0 +logbx1406 logb 100E-1 -> 1 +logbx1407 logb 1000E-1 -> 2 +logbx1408 logb 10000E-1 -> 3 +logbx1409 logb 10E0 -> 1 +logbx1410 logb 100E0 -> 2 +logbx1411 logb 1000E0 -> 3 +logbx1412 logb 10000E0 -> 4 +logbx1413 logb 10E1 -> 2 +logbx1414 logb 100E1 -> 3 +logbx1415 logb 1000E1 -> 4 +logbx1416 logb 10000E1 -> 5 +logbx1417 logb 10E2 -> 3 +logbx1418 logb 100E2 -> 4 +logbx1419 logb 1000E2 -> 5 +logbx1420 logb 10000E2 -> 6 + +-- special values +logbx820 logb Infinity -> Infinity +logbx821 logb -Infinity -> Infinity +logbx822 logb 0 -> -Infinity Division_by_zero +logbx823 logb NaN -> NaN +logbx824 logb sNaN -> NaN Invalid_operation +-- propagating NaNs +logbx825 logb sNaN123 -> NaN123 Invalid_operation +logbx826 logb -sNaN321 -> -NaN321 Invalid_operation +logbx827 logb NaN456 -> NaN456 +logbx828 logb -NaN654 -> -NaN654 +logbx829 logb NaN1 -> NaN1 + +-- Null test +logbx900 logb # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/max.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/max.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,424 @@ +------------------------------------------------------------------------ +-- max.decTest -- decimal maximum -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +maxx001 max -2 -2 -> -2 +maxx002 max -2 -1 -> -1 +maxx003 max -2 0 -> 0 +maxx004 max -2 1 -> 1 +maxx005 max -2 2 -> 2 +maxx006 max -1 -2 -> -1 +maxx007 max -1 -1 -> -1 +maxx008 max -1 0 -> 0 +maxx009 max -1 1 -> 1 +maxx010 max -1 2 -> 2 +maxx011 max 0 -2 -> 0 +maxx012 max 0 -1 -> 0 +maxx013 max 0 0 -> 0 +maxx014 max 0 1 -> 1 +maxx015 max 0 2 -> 2 +maxx016 max 1 -2 -> 1 +maxx017 max 1 -1 -> 1 +maxx018 max 1 0 -> 1 +maxx019 max 1 1 -> 1 +maxx020 max 1 2 -> 2 +maxx021 max 2 -2 -> 2 +maxx022 max 2 -1 -> 2 +maxx023 max 2 0 -> 2 +maxx025 max 2 1 -> 2 +maxx026 max 2 2 -> 2 + +-- extended zeros +maxx030 max 0 0 -> 0 +maxx031 max 0 -0 -> 0 +maxx032 max 0 -0.0 -> 0 +maxx033 max 0 0.0 -> 0 +maxx034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen +maxx035 max -0 -0 -> -0 +maxx036 max -0 -0.0 -> -0.0 +maxx037 max -0 0.0 -> 0.0 +maxx038 max 0.0 0 -> 0 +maxx039 max 0.0 -0 -> 0.0 +maxx040 max 0.0 -0.0 -> 0.0 +maxx041 max 0.0 0.0 -> 0.0 +maxx042 max -0.0 0 -> 0 +maxx043 max -0.0 -0 -> -0.0 +maxx044 max -0.0 -0.0 -> -0.0 +maxx045 max -0.0 0.0 -> 0.0 + +maxx050 max -0E1 0E1 -> 0E+1 +maxx051 max -0E2 0E2 -> 0E+2 +maxx052 max -0E2 0E1 -> 0E+1 +maxx053 max -0E1 0E2 -> 0E+2 +maxx054 max 0E1 -0E1 -> 0E+1 +maxx055 max 0E2 -0E2 -> 0E+2 +maxx056 max 0E2 -0E1 -> 0E+2 +maxx057 max 0E1 -0E2 -> 0E+1 + +maxx058 max 0E1 0E1 -> 0E+1 +maxx059 max 0E2 0E2 -> 0E+2 +maxx060 max 0E2 0E1 -> 0E+2 +maxx061 max 0E1 0E2 -> 0E+2 +maxx062 max -0E1 -0E1 -> -0E+1 +maxx063 max -0E2 -0E2 -> -0E+2 +maxx064 max -0E2 -0E1 -> -0E+1 +maxx065 max -0E1 -0E2 -> -0E+1 + +-- Specials +precision: 9 +maxx090 max Inf -Inf -> Infinity +maxx091 max Inf -1000 -> Infinity +maxx092 max Inf -1 -> Infinity +maxx093 max Inf -0 -> Infinity +maxx094 max Inf 0 -> Infinity +maxx095 max Inf 1 -> Infinity +maxx096 max Inf 1000 -> Infinity +maxx097 max Inf Inf -> Infinity +maxx098 max -1000 Inf -> Infinity +maxx099 max -Inf Inf -> Infinity +maxx100 max -1 Inf -> Infinity +maxx101 max -0 Inf -> Infinity +maxx102 max 0 Inf -> Infinity +maxx103 max 1 Inf -> Infinity +maxx104 max 1000 Inf -> Infinity +maxx105 max Inf Inf -> Infinity + +maxx120 max -Inf -Inf -> -Infinity +maxx121 max -Inf -1000 -> -1000 +maxx122 max -Inf -1 -> -1 +maxx123 max -Inf -0 -> -0 +maxx124 max -Inf 0 -> 0 +maxx125 max -Inf 1 -> 1 +maxx126 max -Inf 1000 -> 1000 +maxx127 max -Inf Inf -> Infinity +maxx128 max -Inf -Inf -> -Infinity +maxx129 max -1000 -Inf -> -1000 +maxx130 max -1 -Inf -> -1 +maxx131 max -0 -Inf -> -0 +maxx132 max 0 -Inf -> 0 +maxx133 max 1 -Inf -> 1 +maxx134 max 1000 -Inf -> 1000 +maxx135 max Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +maxx141 max NaN -Inf -> -Infinity +maxx142 max NaN -1000 -> -1000 +maxx143 max NaN -1 -> -1 +maxx144 max NaN -0 -> -0 +maxx145 max NaN 0 -> 0 +maxx146 max NaN 1 -> 1 +maxx147 max NaN 1000 -> 1000 +maxx148 max NaN Inf -> Infinity +maxx149 max NaN NaN -> NaN +maxx150 max -Inf NaN -> -Infinity +maxx151 max -1000 NaN -> -1000 +maxx152 max -1 NaN -> -1 +maxx153 max -0 NaN -> -0 +maxx154 max 0 NaN -> 0 +maxx155 max 1 NaN -> 1 +maxx156 max 1000 NaN -> 1000 +maxx157 max Inf NaN -> Infinity + +maxx161 max sNaN -Inf -> NaN Invalid_operation +maxx162 max sNaN -1000 -> NaN Invalid_operation +maxx163 max sNaN -1 -> NaN Invalid_operation +maxx164 max sNaN -0 -> NaN Invalid_operation +maxx165 max sNaN 0 -> NaN Invalid_operation +maxx166 max sNaN 1 -> NaN Invalid_operation +maxx167 max sNaN 1000 -> NaN Invalid_operation +maxx168 max sNaN NaN -> NaN Invalid_operation +maxx169 max sNaN sNaN -> NaN Invalid_operation +maxx170 max NaN sNaN -> NaN Invalid_operation +maxx171 max -Inf sNaN -> NaN Invalid_operation +maxx172 max -1000 sNaN -> NaN Invalid_operation +maxx173 max -1 sNaN -> NaN Invalid_operation +maxx174 max -0 sNaN -> NaN Invalid_operation +maxx175 max 0 sNaN -> NaN Invalid_operation +maxx176 max 1 sNaN -> NaN Invalid_operation +maxx177 max 1000 sNaN -> NaN Invalid_operation +maxx178 max Inf sNaN -> NaN Invalid_operation +maxx179 max NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +maxx181 max NaN9 -Inf -> -Infinity +maxx182 max NaN8 9 -> 9 +maxx183 max -NaN7 Inf -> Infinity + +maxx184 max -NaN1 NaN11 -> -NaN1 +maxx185 max NaN2 NaN12 -> NaN2 +maxx186 max -NaN13 -NaN7 -> -NaN13 +maxx187 max NaN14 -NaN5 -> NaN14 + +maxx188 max -Inf NaN4 -> -Infinity +maxx189 max -9 -NaN3 -> -9 +maxx190 max Inf NaN2 -> Infinity + +maxx191 max sNaN99 -Inf -> NaN99 Invalid_operation +maxx192 max sNaN98 -1 -> NaN98 Invalid_operation +maxx193 max -sNaN97 NaN -> -NaN97 Invalid_operation +maxx194 max sNaN96 sNaN94 -> NaN96 Invalid_operation +maxx195 max NaN95 sNaN93 -> NaN93 Invalid_operation +maxx196 max -Inf sNaN92 -> NaN92 Invalid_operation +maxx197 max 0 sNaN91 -> NaN91 Invalid_operation +maxx198 max Inf -sNaN90 -> -NaN90 Invalid_operation +maxx199 max NaN sNaN89 -> NaN89 Invalid_operation + +-- rounding checks +maxexponent: 999 +minexponent: -999 +precision: 9 +maxx201 max 12345678000 1 -> 1.23456780E+10 Rounded +maxx202 max 1 12345678000 -> 1.23456780E+10 Rounded +maxx203 max 1234567800 1 -> 1.23456780E+9 Rounded +maxx204 max 1 1234567800 -> 1.23456780E+9 Rounded +maxx205 max 1234567890 1 -> 1.23456789E+9 Rounded +maxx206 max 1 1234567890 -> 1.23456789E+9 Rounded +maxx207 max 1234567891 1 -> 1.23456789E+9 Inexact Rounded +maxx208 max 1 1234567891 -> 1.23456789E+9 Inexact Rounded +maxx209 max 12345678901 1 -> 1.23456789E+10 Inexact Rounded +maxx210 max 1 12345678901 -> 1.23456789E+10 Inexact Rounded +maxx211 max 1234567896 1 -> 1.23456790E+9 Inexact Rounded +maxx212 max 1 1234567896 -> 1.23456790E+9 Inexact Rounded +maxx213 max -1234567891 1 -> 1 +maxx214 max 1 -1234567891 -> 1 +maxx215 max -12345678901 1 -> 1 +maxx216 max 1 -12345678901 -> 1 +maxx217 max -1234567896 1 -> 1 +maxx218 max 1 -1234567896 -> 1 + +precision: 15 +maxx221 max 12345678000 1 -> 12345678000 +maxx222 max 1 12345678000 -> 12345678000 +maxx223 max 1234567800 1 -> 1234567800 +maxx224 max 1 1234567800 -> 1234567800 +maxx225 max 1234567890 1 -> 1234567890 +maxx226 max 1 1234567890 -> 1234567890 +maxx227 max 1234567891 1 -> 1234567891 +maxx228 max 1 1234567891 -> 1234567891 +maxx229 max 12345678901 1 -> 12345678901 +maxx230 max 1 12345678901 -> 12345678901 +maxx231 max 1234567896 1 -> 1234567896 +maxx232 max 1 1234567896 -> 1234567896 +maxx233 max -1234567891 1 -> 1 +maxx234 max 1 -1234567891 -> 1 +maxx235 max -12345678901 1 -> 1 +maxx236 max 1 -12345678901 -> 1 +maxx237 max -1234567896 1 -> 1 +maxx238 max 1 -1234567896 -> 1 + +-- from examples +maxx280 max '3' '2' -> '3' +maxx281 max '-10' '3' -> '3' +maxx282 max '1.0' '1' -> '1' +maxx283 max '1' '1.0' -> '1' +maxx284 max '7' 'NaN' -> '7' + +-- overflow and underflow tests ... +maxExponent: 999999999 +minexponent: -999999999 +maxx330 max +1.23456789012345E-0 9E+999999999 -> 9E+999999999 +maxx331 max 9E+999999999 +1.23456789012345E-0 -> 9E+999999999 +maxx332 max +0.100 9E-999999999 -> 0.100 +maxx333 max 9E-999999999 +0.100 -> 0.100 +maxx335 max -1.23456789012345E-0 9E+999999999 -> 9E+999999999 +maxx336 max 9E+999999999 -1.23456789012345E-0 -> 9E+999999999 +maxx337 max -0.100 9E-999999999 -> 9E-999999999 +maxx338 max 9E-999999999 -0.100 -> 9E-999999999 + +maxx339 max 1e-599999999 1e-400000001 -> 1E-400000001 +maxx340 max 1e-599999999 1e-400000000 -> 1E-400000000 +maxx341 max 1e-600000000 1e-400000000 -> 1E-400000000 +maxx342 max 9e-999999998 0.01 -> 0.01 +maxx343 max 9e-999999998 0.1 -> 0.1 +maxx344 max 0.01 9e-999999998 -> 0.01 +maxx345 max 1e599999999 1e400000001 -> 1E+599999999 +maxx346 max 1e599999999 1e400000000 -> 1E+599999999 +maxx347 max 1e600000000 1e400000000 -> 1E+600000000 +maxx348 max 9e999999998 100 -> 9E+999999998 +maxx349 max 9e999999998 10 -> 9E+999999998 +maxx350 max 100 9e999999998 -> 9E+999999998 +-- signs +maxx351 max 1e+777777777 1e+411111111 -> 1E+777777777 +maxx352 max 1e+777777777 -1e+411111111 -> 1E+777777777 +maxx353 max -1e+777777777 1e+411111111 -> 1E+411111111 +maxx354 max -1e+777777777 -1e+411111111 -> -1E+411111111 +maxx355 max 1e-777777777 1e-411111111 -> 1E-411111111 +maxx356 max 1e-777777777 -1e-411111111 -> 1E-777777777 +maxx357 max -1e-777777777 1e-411111111 -> 1E-411111111 +maxx358 max -1e-777777777 -1e-411111111 -> -1E-777777777 + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +maxx401 max Inf 1.1 -> Infinity +maxx402 max 1.1 1 -> 1.1 +maxx403 max 1 1.0 -> 1 +maxx404 max 1.0 0.1 -> 1.0 +maxx405 max 0.1 0.10 -> 0.1 +maxx406 max 0.10 0.100 -> 0.10 +maxx407 max 0.10 0 -> 0.10 +maxx408 max 0 0.0 -> 0 +maxx409 max 0.0 -0 -> 0.0 +maxx410 max 0.0 -0.0 -> 0.0 +maxx411 max 0.00 -0.0 -> 0.00 +maxx412 max 0.0 -0.00 -> 0.0 +maxx413 max 0 -0.0 -> 0 +maxx414 max 0 -0 -> 0 +maxx415 max -0.0 -0 -> -0.0 +maxx416 max -0 -0.100 -> -0 +maxx417 max -0.100 -0.10 -> -0.100 +maxx418 max -0.10 -0.1 -> -0.10 +maxx419 max -0.1 -1.0 -> -0.1 +maxx420 max -1.0 -1 -> -1.0 +maxx421 max -1 -1.1 -> -1 +maxx423 max -1.1 -Inf -> -1.1 +-- same with operands reversed +maxx431 max 1.1 Inf -> Infinity +maxx432 max 1 1.1 -> 1.1 +maxx433 max 1.0 1 -> 1 +maxx434 max 0.1 1.0 -> 1.0 +maxx435 max 0.10 0.1 -> 0.1 +maxx436 max 0.100 0.10 -> 0.10 +maxx437 max 0 0.10 -> 0.10 +maxx438 max 0.0 0 -> 0 +maxx439 max -0 0.0 -> 0.0 +maxx440 max -0.0 0.0 -> 0.0 +maxx441 max -0.0 0.00 -> 0.00 +maxx442 max -0.00 0.0 -> 0.0 +maxx443 max -0.0 0 -> 0 +maxx444 max -0 0 -> 0 +maxx445 max -0 -0.0 -> -0.0 +maxx446 max -0.100 -0 -> -0 +maxx447 max -0.10 -0.100 -> -0.100 +maxx448 max -0.1 -0.10 -> -0.10 +maxx449 max -1.0 -0.1 -> -0.1 +maxx450 max -1 -1.0 -> -1.0 +maxx451 max -1.1 -1 -> -1 +maxx453 max -Inf -1.1 -> -1.1 +-- largies +maxx460 max 1000 1E+3 -> 1E+3 +maxx461 max 1E+3 1000 -> 1E+3 +maxx462 max 1000 -1E+3 -> 1000 +maxx463 max 1E+3 -1000 -> 1E+3 +maxx464 max -1000 1E+3 -> 1E+3 +maxx465 max -1E+3 1000 -> 1000 +maxx466 max -1000 -1E+3 -> -1000 +maxx467 max -1E+3 -1000 -> -1000 + +-- rounding (results treated as though plus) +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 + +maxx470 max 1 .5 -> 1 +maxx471 max 10 5 -> 10 +maxx472 max 100 50 -> 100 +maxx473 max 1000 500 -> 1.00E+3 Rounded +maxx474 max 10000 5000 -> 1.00E+4 Rounded +maxx475 max 6 .5 -> 6 +maxx476 max 66 5 -> 66 +maxx477 max 666 50 -> 666 +maxx478 max 6666 500 -> 6.67E+3 Rounded Inexact +maxx479 max 66666 5000 -> 6.67E+4 Rounded Inexact +maxx480 max 33333 5000 -> 3.33E+4 Rounded Inexact +maxx481 max .5 1 -> 1 +maxx482 max .5 10 -> 10 +maxx483 max .5 100 -> 100 +maxx484 max .5 1000 -> 1.00E+3 Rounded +maxx485 max .5 10000 -> 1.00E+4 Rounded +maxx486 max .5 6 -> 6 +maxx487 max .5 66 -> 66 +maxx488 max .5 666 -> 666 +maxx489 max .5 6666 -> 6.67E+3 Rounded Inexact +maxx490 max .5 66666 -> 6.67E+4 Rounded Inexact +maxx491 max .5 33333 -> 3.33E+4 Rounded Inexact + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +maxx500 max 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded +maxx501 max -9.999E+999999999 0 -> 0 + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +maxx510 max 1.00E-999 0 -> 1.00E-999 +maxx511 max 0.1E-999 0 -> 1E-1000 Subnormal +maxx512 max 0.10E-999 0 -> 1.0E-1000 Subnormal +maxx513 max 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded +maxx514 max 0.01E-999 0 -> 1E-1001 Subnormal +-- next is rounded to Nmin +maxx515 max 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow +maxx516 max 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +maxx517 max 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow +maxx518 max 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +maxx519 max 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +maxx520 max 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +maxx530 max -1.00E-999 0 -> 0 +maxx531 max -0.1E-999 0 -> 0 +maxx532 max -0.10E-999 0 -> 0 +maxx533 max -0.100E-999 0 -> 0 +maxx534 max -0.01E-999 0 -> 0 +maxx535 max -0.999E-999 0 -> 0 +maxx536 max -0.099E-999 0 -> 0 +maxx537 max -0.009E-999 0 -> 0 +maxx538 max -0.001E-999 0 -> 0 +maxx539 max -0.0009E-999 0 -> 0 +maxx540 max -0.0001E-999 0 -> 0 + +-- misalignment traps for little-endian +precision: 9 +maxx551 max 1.0 0.1 -> 1.0 +maxx552 max 0.1 1.0 -> 1.0 +maxx553 max 10.0 0.1 -> 10.0 +maxx554 max 0.1 10.0 -> 10.0 +maxx555 max 100 1.0 -> 100 +maxx556 max 1.0 100 -> 100 +maxx557 max 1000 10.0 -> 1000 +maxx558 max 10.0 1000 -> 1000 +maxx559 max 10000 100.0 -> 10000 +maxx560 max 100.0 10000 -> 10000 +maxx661 max 100000 1000.0 -> 100000 +maxx662 max 1000.0 100000 -> 100000 +maxx663 max 1000000 10000.0 -> 1000000 +maxx664 max 10000.0 1000000 -> 1000000 + +-- payload decapitate +precision: 5 +maxx670 max 11 -sNaN12345678901 -> -NaN78901 Invalid_operation + +-- Null tests +maxx900 max 10 # -> NaN Invalid_operation +maxx901 max # 10 -> NaN Invalid_operation + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/maxmag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/maxmag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,404 @@ +------------------------------------------------------------------------ +-- maxmag.decTest -- decimal maximum by magnitude -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +mxgx001 maxmag -2 -2 -> -2 +mxgx002 maxmag -2 -1 -> -2 +mxgx003 maxmag -2 0 -> -2 +mxgx004 maxmag -2 1 -> -2 +mxgx005 maxmag -2 2 -> 2 +mxgx006 maxmag -1 -2 -> -2 +mxgx007 maxmag -1 -1 -> -1 +mxgx008 maxmag -1 0 -> -1 +mxgx009 maxmag -1 1 -> 1 +mxgx010 maxmag -1 2 -> 2 +mxgx011 maxmag 0 -2 -> -2 +mxgx012 maxmag 0 -1 -> -1 +mxgx013 maxmag 0 0 -> 0 +mxgx014 maxmag 0 1 -> 1 +mxgx015 maxmag 0 2 -> 2 +mxgx016 maxmag 1 -2 -> -2 +mxgx017 maxmag 1 -1 -> 1 +mxgx018 maxmag 1 0 -> 1 +mxgx019 maxmag 1 1 -> 1 +mxgx020 maxmag 1 2 -> 2 +mxgx021 maxmag 2 -2 -> 2 +mxgx022 maxmag 2 -1 -> 2 +mxgx023 maxmag 2 0 -> 2 +mxgx025 maxmag 2 1 -> 2 +mxgx026 maxmag 2 2 -> 2 + +-- extended zeros +mxgx030 maxmag 0 0 -> 0 +mxgx031 maxmag 0 -0 -> 0 +mxgx032 maxmag 0 -0.0 -> 0 +mxgx033 maxmag 0 0.0 -> 0 +mxgx034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen +mxgx035 maxmag -0 -0 -> -0 +mxgx036 maxmag -0 -0.0 -> -0.0 +mxgx037 maxmag -0 0.0 -> 0.0 +mxgx038 maxmag 0.0 0 -> 0 +mxgx039 maxmag 0.0 -0 -> 0.0 +mxgx040 maxmag 0.0 -0.0 -> 0.0 +mxgx041 maxmag 0.0 0.0 -> 0.0 +mxgx042 maxmag -0.0 0 -> 0 +mxgx043 maxmag -0.0 -0 -> -0.0 +mxgx044 maxmag -0.0 -0.0 -> -0.0 +mxgx045 maxmag -0.0 0.0 -> 0.0 + +mxgx050 maxmag -0E1 0E1 -> 0E+1 +mxgx051 maxmag -0E2 0E2 -> 0E+2 +mxgx052 maxmag -0E2 0E1 -> 0E+1 +mxgx053 maxmag -0E1 0E2 -> 0E+2 +mxgx054 maxmag 0E1 -0E1 -> 0E+1 +mxgx055 maxmag 0E2 -0E2 -> 0E+2 +mxgx056 maxmag 0E2 -0E1 -> 0E+2 +mxgx057 maxmag 0E1 -0E2 -> 0E+1 + +mxgx058 maxmag 0E1 0E1 -> 0E+1 +mxgx059 maxmag 0E2 0E2 -> 0E+2 +mxgx060 maxmag 0E2 0E1 -> 0E+2 +mxgx061 maxmag 0E1 0E2 -> 0E+2 +mxgx062 maxmag -0E1 -0E1 -> -0E+1 +mxgx063 maxmag -0E2 -0E2 -> -0E+2 +mxgx064 maxmag -0E2 -0E1 -> -0E+1 +mxgx065 maxmag -0E1 -0E2 -> -0E+1 + +-- Specials +precision: 9 +mxgx090 maxmag Inf -Inf -> Infinity +mxgx091 maxmag Inf -1000 -> Infinity +mxgx092 maxmag Inf -1 -> Infinity +mxgx093 maxmag Inf -0 -> Infinity +mxgx094 maxmag Inf 0 -> Infinity +mxgx095 maxmag Inf 1 -> Infinity +mxgx096 maxmag Inf 1000 -> Infinity +mxgx097 maxmag Inf Inf -> Infinity +mxgx098 maxmag -1000 Inf -> Infinity +mxgx099 maxmag -Inf Inf -> Infinity +mxgx100 maxmag -1 Inf -> Infinity +mxgx101 maxmag -0 Inf -> Infinity +mxgx102 maxmag 0 Inf -> Infinity +mxgx103 maxmag 1 Inf -> Infinity +mxgx104 maxmag 1000 Inf -> Infinity +mxgx105 maxmag Inf Inf -> Infinity + +mxgx120 maxmag -Inf -Inf -> -Infinity +mxgx121 maxmag -Inf -1000 -> -Infinity +mxgx122 maxmag -Inf -1 -> -Infinity +mxgx123 maxmag -Inf -0 -> -Infinity +mxgx124 maxmag -Inf 0 -> -Infinity +mxgx125 maxmag -Inf 1 -> -Infinity +mxgx126 maxmag -Inf 1000 -> -Infinity +mxgx127 maxmag -Inf Inf -> Infinity +mxgx128 maxmag -Inf -Inf -> -Infinity +mxgx129 maxmag -1000 -Inf -> -Infinity +mxgx130 maxmag -1 -Inf -> -Infinity +mxgx131 maxmag -0 -Inf -> -Infinity +mxgx132 maxmag 0 -Inf -> -Infinity +mxgx133 maxmag 1 -Inf -> -Infinity +mxgx134 maxmag 1000 -Inf -> -Infinity +mxgx135 maxmag Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +mxgx141 maxmag NaN -Inf -> -Infinity +mxgx142 maxmag NaN -1000 -> -1000 +mxgx143 maxmag NaN -1 -> -1 +mxgx144 maxmag NaN -0 -> -0 +mxgx145 maxmag NaN 0 -> 0 +mxgx146 maxmag NaN 1 -> 1 +mxgx147 maxmag NaN 1000 -> 1000 +mxgx148 maxmag NaN Inf -> Infinity +mxgx149 maxmag NaN NaN -> NaN +mxgx150 maxmag -Inf NaN -> -Infinity +mxgx151 maxmag -1000 NaN -> -1000 +mxgx152 maxmag -1 NaN -> -1 +mxgx153 maxmag -0 NaN -> -0 +mxgx154 maxmag 0 NaN -> 0 +mxgx155 maxmag 1 NaN -> 1 +mxgx156 maxmag 1000 NaN -> 1000 +mxgx157 maxmag Inf NaN -> Infinity + +mxgx161 maxmag sNaN -Inf -> NaN Invalid_operation +mxgx162 maxmag sNaN -1000 -> NaN Invalid_operation +mxgx163 maxmag sNaN -1 -> NaN Invalid_operation +mxgx164 maxmag sNaN -0 -> NaN Invalid_operation +mxgx165 maxmag sNaN 0 -> NaN Invalid_operation +mxgx166 maxmag sNaN 1 -> NaN Invalid_operation +mxgx167 maxmag sNaN 1000 -> NaN Invalid_operation +mxgx168 maxmag sNaN NaN -> NaN Invalid_operation +mxgx169 maxmag sNaN sNaN -> NaN Invalid_operation +mxgx170 maxmag NaN sNaN -> NaN Invalid_operation +mxgx171 maxmag -Inf sNaN -> NaN Invalid_operation +mxgx172 maxmag -1000 sNaN -> NaN Invalid_operation +mxgx173 maxmag -1 sNaN -> NaN Invalid_operation +mxgx174 maxmag -0 sNaN -> NaN Invalid_operation +mxgx175 maxmag 0 sNaN -> NaN Invalid_operation +mxgx176 maxmag 1 sNaN -> NaN Invalid_operation +mxgx177 maxmag 1000 sNaN -> NaN Invalid_operation +mxgx178 maxmag Inf sNaN -> NaN Invalid_operation +mxgx179 maxmag NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +mxgx181 maxmag NaN9 -Inf -> -Infinity +mxgx182 maxmag NaN8 9 -> 9 +mxgx183 maxmag -NaN7 Inf -> Infinity + +mxgx184 maxmag -NaN1 NaN11 -> -NaN1 +mxgx185 maxmag NaN2 NaN12 -> NaN2 +mxgx186 maxmag -NaN13 -NaN7 -> -NaN13 +mxgx187 maxmag NaN14 -NaN5 -> NaN14 + +mxgx188 maxmag -Inf NaN4 -> -Infinity +mxgx189 maxmag -9 -NaN3 -> -9 +mxgx190 maxmag Inf NaN2 -> Infinity + +mxgx191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation +mxgx192 maxmag sNaN98 -1 -> NaN98 Invalid_operation +mxgx193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation +mxgx194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation +mxgx195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation +mxgx196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation +mxgx197 maxmag 0 sNaN91 -> NaN91 Invalid_operation +mxgx198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation +mxgx199 maxmag NaN sNaN89 -> NaN89 Invalid_operation + +-- rounding checks +maxexponent: 999 +minexponent: -999 +precision: 9 +mxgx201 maxmag 12345678000 1 -> 1.23456780E+10 Rounded +mxgx202 maxmag 1 12345678000 -> 1.23456780E+10 Rounded +mxgx203 maxmag 1234567800 1 -> 1.23456780E+9 Rounded +mxgx204 maxmag 1 1234567800 -> 1.23456780E+9 Rounded +mxgx205 maxmag 1234567890 1 -> 1.23456789E+9 Rounded +mxgx206 maxmag 1 1234567890 -> 1.23456789E+9 Rounded +mxgx207 maxmag 1234567891 1 -> 1.23456789E+9 Inexact Rounded +mxgx208 maxmag 1 1234567891 -> 1.23456789E+9 Inexact Rounded +mxgx209 maxmag 12345678901 1 -> 1.23456789E+10 Inexact Rounded +mxgx210 maxmag 1 12345678901 -> 1.23456789E+10 Inexact Rounded +mxgx211 maxmag 1234567896 1 -> 1.23456790E+9 Inexact Rounded +mxgx212 maxmag 1 1234567896 -> 1.23456790E+9 Inexact Rounded +mxgx213 maxmag -1234567891 1 -> -1.23456789E+9 Inexact Rounded +mxgx214 maxmag 1 -1234567891 -> -1.23456789E+9 Inexact Rounded +mxgx215 maxmag -12345678901 1 -> -1.23456789E+10 Inexact Rounded +mxgx216 maxmag 1 -12345678901 -> -1.23456789E+10 Inexact Rounded +mxgx217 maxmag -1234567896 1 -> -1.23456790E+9 Inexact Rounded +mxgx218 maxmag 1 -1234567896 -> -1.23456790E+9 Inexact Rounded + +precision: 15 +mxgx221 maxmag 12345678000 1 -> 12345678000 +mxgx222 maxmag 1 12345678000 -> 12345678000 +mxgx223 maxmag 1234567800 1 -> 1234567800 +mxgx224 maxmag 1 1234567800 -> 1234567800 +mxgx225 maxmag 1234567890 1 -> 1234567890 +mxgx226 maxmag 1 1234567890 -> 1234567890 +mxgx227 maxmag 1234567891 1 -> 1234567891 +mxgx228 maxmag 1 1234567891 -> 1234567891 +mxgx229 maxmag 12345678901 1 -> 12345678901 +mxgx230 maxmag 1 12345678901 -> 12345678901 +mxgx231 maxmag 1234567896 1 -> 1234567896 +mxgx232 maxmag 1 1234567896 -> 1234567896 +mxgx233 maxmag -1234567891 1 -> -1234567891 +mxgx234 maxmag 1 -1234567891 -> -1234567891 +mxgx235 maxmag -12345678901 1 -> -12345678901 +mxgx236 maxmag 1 -12345678901 -> -12345678901 +mxgx237 maxmag -1234567896 1 -> -1234567896 +mxgx238 maxmag 1 -1234567896 -> -1234567896 + +-- from examples +mxgx280 maxmag '3' '2' -> '3' +mxgx281 maxmag '-10' '3' -> '-10' +mxgx282 maxmag '1.0' '1' -> '1' +mxgx283 maxmag '1' '1.0' -> '1' +mxgx284 maxmag '7' 'NaN' -> '7' + +-- overflow and underflow tests ... +maxExponent: 999999999 +minexponent: -999999999 +mxgx330 maxmag +1.23456789012345E-0 9E+999999999 -> 9E+999999999 +mxgx331 maxmag 9E+999999999 +1.23456789012345E-0 -> 9E+999999999 +mxgx332 maxmag +0.100 9E-999999999 -> 0.100 +mxgx333 maxmag 9E-999999999 +0.100 -> 0.100 +mxgx335 maxmag -1.23456789012345E-0 9E+999999999 -> 9E+999999999 +mxgx336 maxmag 9E+999999999 -1.23456789012345E-0 -> 9E+999999999 +mxgx337 maxmag -0.100 9E-999999999 -> -0.100 +mxgx338 maxmag 9E-999999999 -0.100 -> -0.100 + +mxgx339 maxmag 1e-599999999 1e-400000001 -> 1E-400000001 +mxgx340 maxmag 1e-599999999 1e-400000000 -> 1E-400000000 +mxgx341 maxmag 1e-600000000 1e-400000000 -> 1E-400000000 +mxgx342 maxmag 9e-999999998 0.01 -> 0.01 +mxgx343 maxmag 9e-999999998 0.1 -> 0.1 +mxgx344 maxmag 0.01 9e-999999998 -> 0.01 +mxgx345 maxmag 1e599999999 1e400000001 -> 1E+599999999 +mxgx346 maxmag 1e599999999 1e400000000 -> 1E+599999999 +mxgx347 maxmag 1e600000000 1e400000000 -> 1E+600000000 +mxgx348 maxmag 9e999999998 100 -> 9E+999999998 +mxgx349 maxmag 9e999999998 10 -> 9E+999999998 +mxgx350 maxmag 100 9e999999998 -> 9E+999999998 +-- signs +mxgx351 maxmag 1e+777777777 1e+411111111 -> 1E+777777777 +mxgx352 maxmag 1e+777777777 -1e+411111111 -> 1E+777777777 +mxgx353 maxmag -1e+777777777 1e+411111111 -> -1E+777777777 +mxgx354 maxmag -1e+777777777 -1e+411111111 -> -1E+777777777 +mxgx355 maxmag 1e-777777777 1e-411111111 -> 1E-411111111 +mxgx356 maxmag 1e-777777777 -1e-411111111 -> -1E-411111111 +mxgx357 maxmag -1e-777777777 1e-411111111 -> 1E-411111111 +mxgx358 maxmag -1e-777777777 -1e-411111111 -> -1E-411111111 + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +mxgx401 maxmag Inf 1.1 -> Infinity +mxgx402 maxmag 1.1 1 -> 1.1 +mxgx403 maxmag 1 1.0 -> 1 +mxgx404 maxmag 1.0 0.1 -> 1.0 +mxgx405 maxmag 0.1 0.10 -> 0.1 +mxgx406 maxmag 0.10 0.100 -> 0.10 +mxgx407 maxmag 0.10 0 -> 0.10 +mxgx408 maxmag 0 0.0 -> 0 +mxgx409 maxmag 0.0 -0 -> 0.0 +mxgx410 maxmag 0.0 -0.0 -> 0.0 +mxgx411 maxmag 0.00 -0.0 -> 0.00 +mxgx412 maxmag 0.0 -0.00 -> 0.0 +mxgx413 maxmag 0 -0.0 -> 0 +mxgx414 maxmag 0 -0 -> 0 +mxgx415 maxmag -0.0 -0 -> -0.0 +mxgx416 maxmag -0 -0.100 -> -0.100 +mxgx417 maxmag -0.100 -0.10 -> -0.100 +mxgx418 maxmag -0.10 -0.1 -> -0.10 +mxgx419 maxmag -0.1 -1.0 -> -1.0 +mxgx420 maxmag -1.0 -1 -> -1.0 +mxgx421 maxmag -1 -1.1 -> -1.1 +mxgx423 maxmag -1.1 -Inf -> -Infinity +-- same with operands reversed +mxgx431 maxmag 1.1 Inf -> Infinity +mxgx432 maxmag 1 1.1 -> 1.1 +mxgx433 maxmag 1.0 1 -> 1 +mxgx434 maxmag 0.1 1.0 -> 1.0 +mxgx435 maxmag 0.10 0.1 -> 0.1 +mxgx436 maxmag 0.100 0.10 -> 0.10 +mxgx437 maxmag 0 0.10 -> 0.10 +mxgx438 maxmag 0.0 0 -> 0 +mxgx439 maxmag -0 0.0 -> 0.0 +mxgx440 maxmag -0.0 0.0 -> 0.0 +mxgx441 maxmag -0.0 0.00 -> 0.00 +mxgx442 maxmag -0.00 0.0 -> 0.0 +mxgx443 maxmag -0.0 0 -> 0 +mxgx444 maxmag -0 0 -> 0 +mxgx445 maxmag -0 -0.0 -> -0.0 +mxgx446 maxmag -0.100 -0 -> -0.100 +mxgx447 maxmag -0.10 -0.100 -> -0.100 +mxgx448 maxmag -0.1 -0.10 -> -0.10 +mxgx449 maxmag -1.0 -0.1 -> -1.0 +mxgx450 maxmag -1 -1.0 -> -1.0 +mxgx451 maxmag -1.1 -1 -> -1.1 +mxgx453 maxmag -Inf -1.1 -> -Infinity +-- largies +mxgx460 maxmag 1000 1E+3 -> 1E+3 +mxgx461 maxmag 1E+3 1000 -> 1E+3 +mxgx462 maxmag 1000 -1E+3 -> 1000 +mxgx463 maxmag 1E+3 -1000 -> 1E+3 +mxgx464 maxmag -1000 1E+3 -> 1E+3 +mxgx465 maxmag -1E+3 1000 -> 1000 +mxgx466 maxmag -1000 -1E+3 -> -1000 +mxgx467 maxmag -1E+3 -1000 -> -1000 + +-- rounding (results treated as though plus) +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 + +mxgx470 maxmag 1 .5 -> 1 +mxgx471 maxmag 10 5 -> 10 +mxgx472 maxmag 100 50 -> 100 +mxgx473 maxmag 1000 500 -> 1.00E+3 Rounded +mxgx474 maxmag 10000 5000 -> 1.00E+4 Rounded +mxgx475 maxmag 6 .5 -> 6 +mxgx476 maxmag 66 5 -> 66 +mxgx477 maxmag 666 50 -> 666 +mxgx478 maxmag 6666 500 -> 6.67E+3 Rounded Inexact +mxgx479 maxmag 66666 5000 -> 6.67E+4 Rounded Inexact +mxgx480 maxmag 33333 5000 -> 3.33E+4 Rounded Inexact +mxgx481 maxmag .5 1 -> 1 +mxgx482 maxmag .5 10 -> 10 +mxgx483 maxmag .5 100 -> 100 +mxgx484 maxmag .5 1000 -> 1.00E+3 Rounded +mxgx485 maxmag .5 10000 -> 1.00E+4 Rounded +mxgx486 maxmag .5 6 -> 6 +mxgx487 maxmag .5 66 -> 66 +mxgx488 maxmag .5 666 -> 666 +mxgx489 maxmag .5 6666 -> 6.67E+3 Rounded Inexact +mxgx490 maxmag .5 66666 -> 6.67E+4 Rounded Inexact +mxgx491 maxmag .5 33333 -> 3.33E+4 Rounded Inexact + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +mxgx500 maxmag 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded +mxgx501 maxmag -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +mxgx510 maxmag 1.00E-999 0 -> 1.00E-999 +mxgx511 maxmag 0.1E-999 0 -> 1E-1000 Subnormal +mxgx512 maxmag 0.10E-999 0 -> 1.0E-1000 Subnormal +mxgx513 maxmag 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded +mxgx514 maxmag 0.01E-999 0 -> 1E-1001 Subnormal +-- next is rounded to Nmin +mxgx515 maxmag 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow +mxgx516 maxmag 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +mxgx517 maxmag 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow +mxgx518 maxmag 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +mxgx519 maxmag 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +mxgx520 maxmag 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +mxgx530 maxmag -1.00E-999 0 -> -1.00E-999 +mxgx531 maxmag -0.1E-999 0 -> -1E-1000 Subnormal +mxgx532 maxmag -0.10E-999 0 -> -1.0E-1000 Subnormal +mxgx533 maxmag -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded +mxgx534 maxmag -0.01E-999 0 -> -1E-1001 Subnormal +-- next is rounded to -Nmin +mxgx535 maxmag -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow +mxgx536 maxmag -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +mxgx537 maxmag -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow +mxgx538 maxmag -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +mxgx539 maxmag -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +mxgx540 maxmag -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- Null tests +mxgx900 maxmag 10 # -> NaN Invalid_operation +mxgx901 maxmag # 10 -> NaN Invalid_operation + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/min.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/min.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,407 @@ +------------------------------------------------------------------------ +-- min.decTest -- decimal minimum -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +mnmx001 min -2 -2 -> -2 +mnmx002 min -2 -1 -> -2 +mnmx003 min -2 0 -> -2 +mnmx004 min -2 1 -> -2 +mnmx005 min -2 2 -> -2 +mnmx006 min -1 -2 -> -2 +mnmx007 min -1 -1 -> -1 +mnmx008 min -1 0 -> -1 +mnmx009 min -1 1 -> -1 +mnmx010 min -1 2 -> -1 +mnmx011 min 0 -2 -> -2 +mnmx012 min 0 -1 -> -1 +mnmx013 min 0 0 -> 0 +mnmx014 min 0 1 -> 0 +mnmx015 min 0 2 -> 0 +mnmx016 min 1 -2 -> -2 +mnmx017 min 1 -1 -> -1 +mnmx018 min 1 0 -> 0 +mnmx019 min 1 1 -> 1 +mnmx020 min 1 2 -> 1 +mnmx021 min 2 -2 -> -2 +mnmx022 min 2 -1 -> -1 +mnmx023 min 2 0 -> 0 +mnmx025 min 2 1 -> 1 +mnmx026 min 2 2 -> 2 + +-- extended zeros +mnmx030 min 0 0 -> 0 +mnmx031 min 0 -0 -> -0 +mnmx032 min 0 -0.0 -> -0.0 +mnmx033 min 0 0.0 -> 0.0 +mnmx034 min -0 0 -> -0 +mnmx035 min -0 -0 -> -0 +mnmx036 min -0 -0.0 -> -0 +mnmx037 min -0 0.0 -> -0 +mnmx038 min 0.0 0 -> 0.0 +mnmx039 min 0.0 -0 -> -0 +mnmx040 min 0.0 -0.0 -> -0.0 +mnmx041 min 0.0 0.0 -> 0.0 +mnmx042 min -0.0 0 -> -0.0 +mnmx043 min -0.0 -0 -> -0 +mnmx044 min -0.0 -0.0 -> -0.0 +mnmx045 min -0.0 0.0 -> -0.0 + +mnmx046 min 0E1 -0E1 -> -0E+1 +mnmx047 min -0E1 0E2 -> -0E+1 +mnmx048 min 0E2 0E1 -> 0E+1 +mnmx049 min 0E1 0E2 -> 0E+1 +mnmx050 min -0E3 -0E2 -> -0E+3 +mnmx051 min -0E2 -0E3 -> -0E+3 + +-- Specials +precision: 9 +mnmx090 min Inf -Inf -> -Infinity +mnmx091 min Inf -1000 -> -1000 +mnmx092 min Inf -1 -> -1 +mnmx093 min Inf -0 -> -0 +mnmx094 min Inf 0 -> 0 +mnmx095 min Inf 1 -> 1 +mnmx096 min Inf 1000 -> 1000 +mnmx097 min Inf Inf -> Infinity +mnmx098 min -1000 Inf -> -1000 +mnmx099 min -Inf Inf -> -Infinity +mnmx100 min -1 Inf -> -1 +mnmx101 min -0 Inf -> -0 +mnmx102 min 0 Inf -> 0 +mnmx103 min 1 Inf -> 1 +mnmx104 min 1000 Inf -> 1000 +mnmx105 min Inf Inf -> Infinity + +mnmx120 min -Inf -Inf -> -Infinity +mnmx121 min -Inf -1000 -> -Infinity +mnmx122 min -Inf -1 -> -Infinity +mnmx123 min -Inf -0 -> -Infinity +mnmx124 min -Inf 0 -> -Infinity +mnmx125 min -Inf 1 -> -Infinity +mnmx126 min -Inf 1000 -> -Infinity +mnmx127 min -Inf Inf -> -Infinity +mnmx128 min -Inf -Inf -> -Infinity +mnmx129 min -1000 -Inf -> -Infinity +mnmx130 min -1 -Inf -> -Infinity +mnmx131 min -0 -Inf -> -Infinity +mnmx132 min 0 -Inf -> -Infinity +mnmx133 min 1 -Inf -> -Infinity +mnmx134 min 1000 -Inf -> -Infinity +mnmx135 min Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +mnmx141 min NaN -Inf -> -Infinity +mnmx142 min NaN -1000 -> -1000 +mnmx143 min NaN -1 -> -1 +mnmx144 min NaN -0 -> -0 +mnmx145 min NaN 0 -> 0 +mnmx146 min NaN 1 -> 1 +mnmx147 min NaN 1000 -> 1000 +mnmx148 min NaN Inf -> Infinity +mnmx149 min NaN NaN -> NaN +mnmx150 min -Inf NaN -> -Infinity +mnmx151 min -1000 NaN -> -1000 +mnmx152 min -1 -NaN -> -1 +mnmx153 min -0 NaN -> -0 +mnmx154 min 0 -NaN -> 0 +mnmx155 min 1 NaN -> 1 +mnmx156 min 1000 NaN -> 1000 +mnmx157 min Inf NaN -> Infinity + +mnmx161 min sNaN -Inf -> NaN Invalid_operation +mnmx162 min sNaN -1000 -> NaN Invalid_operation +mnmx163 min sNaN -1 -> NaN Invalid_operation +mnmx164 min sNaN -0 -> NaN Invalid_operation +mnmx165 min -sNaN 0 -> -NaN Invalid_operation +mnmx166 min -sNaN 1 -> -NaN Invalid_operation +mnmx167 min sNaN 1000 -> NaN Invalid_operation +mnmx168 min sNaN NaN -> NaN Invalid_operation +mnmx169 min sNaN sNaN -> NaN Invalid_operation +mnmx170 min NaN sNaN -> NaN Invalid_operation +mnmx171 min -Inf sNaN -> NaN Invalid_operation +mnmx172 min -1000 sNaN -> NaN Invalid_operation +mnmx173 min -1 sNaN -> NaN Invalid_operation +mnmx174 min -0 sNaN -> NaN Invalid_operation +mnmx175 min 0 sNaN -> NaN Invalid_operation +mnmx176 min 1 sNaN -> NaN Invalid_operation +mnmx177 min 1000 sNaN -> NaN Invalid_operation +mnmx178 min Inf sNaN -> NaN Invalid_operation +mnmx179 min NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +mnmx181 min NaN9 -Inf -> -Infinity +mnmx182 min -NaN8 9990 -> 9990 +mnmx183 min NaN71 Inf -> Infinity + +mnmx184 min NaN1 NaN54 -> NaN1 +mnmx185 min NaN22 -NaN53 -> NaN22 +mnmx186 min -NaN3 NaN6 -> -NaN3 +mnmx187 min -NaN44 NaN7 -> -NaN44 + +mnmx188 min -Inf NaN41 -> -Infinity +mnmx189 min -9999 -NaN33 -> -9999 +mnmx190 min Inf NaN2 -> Infinity + +mnmx191 min sNaN99 -Inf -> NaN99 Invalid_operation +mnmx192 min sNaN98 -11 -> NaN98 Invalid_operation +mnmx193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation +mnmx194 min sNaN69 sNaN94 -> NaN69 Invalid_operation +mnmx195 min NaN95 sNaN93 -> NaN93 Invalid_operation +mnmx196 min -Inf sNaN92 -> NaN92 Invalid_operation +mnmx197 min 088 sNaN91 -> NaN91 Invalid_operation +mnmx198 min Inf -sNaN90 -> -NaN90 Invalid_operation +mnmx199 min NaN sNaN86 -> NaN86 Invalid_operation + +-- rounding checks -- chosen is rounded, or not +maxExponent: 999 +minexponent: -999 +precision: 9 +mnmx201 min -12345678000 1 -> -1.23456780E+10 Rounded +mnmx202 min 1 -12345678000 -> -1.23456780E+10 Rounded +mnmx203 min -1234567800 1 -> -1.23456780E+9 Rounded +mnmx204 min 1 -1234567800 -> -1.23456780E+9 Rounded +mnmx205 min -1234567890 1 -> -1.23456789E+9 Rounded +mnmx206 min 1 -1234567890 -> -1.23456789E+9 Rounded +mnmx207 min -1234567891 1 -> -1.23456789E+9 Inexact Rounded +mnmx208 min 1 -1234567891 -> -1.23456789E+9 Inexact Rounded +mnmx209 min -12345678901 1 -> -1.23456789E+10 Inexact Rounded +mnmx210 min 1 -12345678901 -> -1.23456789E+10 Inexact Rounded +mnmx211 min -1234567896 1 -> -1.23456790E+9 Inexact Rounded +mnmx212 min 1 -1234567896 -> -1.23456790E+9 Inexact Rounded +mnmx213 min 1234567891 1 -> 1 +mnmx214 min 1 1234567891 -> 1 +mnmx215 min 12345678901 1 -> 1 +mnmx216 min 1 12345678901 -> 1 +mnmx217 min 1234567896 1 -> 1 +mnmx218 min 1 1234567896 -> 1 + +precision: 15 +mnmx221 min -12345678000 1 -> -12345678000 +mnmx222 min 1 -12345678000 -> -12345678000 +mnmx223 min -1234567800 1 -> -1234567800 +mnmx224 min 1 -1234567800 -> -1234567800 +mnmx225 min -1234567890 1 -> -1234567890 +mnmx226 min 1 -1234567890 -> -1234567890 +mnmx227 min -1234567891 1 -> -1234567891 +mnmx228 min 1 -1234567891 -> -1234567891 +mnmx229 min -12345678901 1 -> -12345678901 +mnmx230 min 1 -12345678901 -> -12345678901 +mnmx231 min -1234567896 1 -> -1234567896 +mnmx232 min 1 -1234567896 -> -1234567896 +mnmx233 min 1234567891 1 -> 1 +mnmx234 min 1 1234567891 -> 1 +mnmx235 min 12345678901 1 -> 1 +mnmx236 min 1 12345678901 -> 1 +mnmx237 min 1234567896 1 -> 1 +mnmx238 min 1 1234567896 -> 1 + +-- from examples +mnmx280 min '3' '2' -> '2' +mnmx281 min '-10' '3' -> '-10' +mnmx282 min '1.0' '1' -> '1.0' +mnmx283 min '1' '1.0' -> '1.0' +mnmx284 min '7' 'NaN' -> '7' + +-- overflow and underflow tests .. subnormal results [inputs] now allowed +maxExponent: 999999999 +minexponent: -999999999 +mnmx330 min -1.23456789012345E-0 -9E+999999999 -> -9E+999999999 +mnmx331 min -9E+999999999 -1.23456789012345E-0 -> -9E+999999999 +mnmx332 min -0.100 -9E-999999999 -> -0.100 +mnmx333 min -9E-999999999 -0.100 -> -0.100 +mnmx335 min +1.23456789012345E-0 -9E+999999999 -> -9E+999999999 +mnmx336 min -9E+999999999 1.23456789012345E-0 -> -9E+999999999 +mnmx337 min +0.100 -9E-999999999 -> -9E-999999999 +mnmx338 min -9E-999999999 0.100 -> -9E-999999999 + +mnmx339 min -1e-599999999 -1e-400000001 -> -1E-400000001 +mnmx340 min -1e-599999999 -1e-400000000 -> -1E-400000000 +mnmx341 min -1e-600000000 -1e-400000000 -> -1E-400000000 +mnmx342 min -9e-999999998 -0.01 -> -0.01 +mnmx343 min -9e-999999998 -0.1 -> -0.1 +mnmx344 min -0.01 -9e-999999998 -> -0.01 +mnmx345 min -1e599999999 -1e400000001 -> -1E+599999999 +mnmx346 min -1e599999999 -1e400000000 -> -1E+599999999 +mnmx347 min -1e600000000 -1e400000000 -> -1E+600000000 +mnmx348 min -9e999999998 -100 -> -9E+999999998 +mnmx349 min -9e999999998 -10 -> -9E+999999998 +mnmx350 min -100 -9e999999998 -> -9E+999999998 +-- signs +mnmx351 min -1e+777777777 -1e+411111111 -> -1E+777777777 +mnmx352 min -1e+777777777 +1e+411111111 -> -1E+777777777 +mnmx353 min +1e+777777777 -1e+411111111 -> -1E+411111111 +mnmx354 min +1e+777777777 +1e+411111111 -> 1E+411111111 +mnmx355 min -1e-777777777 -1e-411111111 -> -1E-411111111 +mnmx356 min -1e-777777777 +1e-411111111 -> -1E-777777777 +mnmx357 min +1e-777777777 -1e-411111111 -> -1E-411111111 +mnmx358 min +1e-777777777 +1e-411111111 -> 1E-777777777 + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +mnmx401 min Inf 1.1 -> 1.1 +mnmx402 min 1.1 1 -> 1 +mnmx403 min 1 1.0 -> 1.0 +mnmx404 min 1.0 0.1 -> 0.1 +mnmx405 min 0.1 0.10 -> 0.10 +mnmx406 min 0.10 0.100 -> 0.100 +mnmx407 min 0.10 0 -> 0 +mnmx408 min 0 0.0 -> 0.0 +mnmx409 min 0.0 -0 -> -0 +mnmx410 min 0.0 -0.0 -> -0.0 +mnmx411 min 0.00 -0.0 -> -0.0 +mnmx412 min 0.0 -0.00 -> -0.00 +mnmx413 min 0 -0.0 -> -0.0 +mnmx414 min 0 -0 -> -0 +mnmx415 min -0.0 -0 -> -0 +mnmx416 min -0 -0.100 -> -0.100 +mnmx417 min -0.100 -0.10 -> -0.10 +mnmx418 min -0.10 -0.1 -> -0.1 +mnmx419 min -0.1 -1.0 -> -1.0 +mnmx420 min -1.0 -1 -> -1 +mnmx421 min -1 -1.1 -> -1.1 +mnmx423 min -1.1 -Inf -> -Infinity +-- same with operands reversed +mnmx431 min 1.1 Inf -> 1.1 +mnmx432 min 1 1.1 -> 1 +mnmx433 min 1.0 1 -> 1.0 +mnmx434 min 0.1 1.0 -> 0.1 +mnmx435 min 0.10 0.1 -> 0.10 +mnmx436 min 0.100 0.10 -> 0.100 +mnmx437 min 0 0.10 -> 0 +mnmx438 min 0.0 0 -> 0.0 +mnmx439 min -0 0.0 -> -0 +mnmx440 min -0.0 0.0 -> -0.0 +mnmx441 min -0.0 0.00 -> -0.0 +mnmx442 min -0.00 0.0 -> -0.00 +mnmx443 min -0.0 0 -> -0.0 +mnmx444 min -0 0 -> -0 +mnmx445 min -0 -0.0 -> -0 +mnmx446 min -0.100 -0 -> -0.100 +mnmx447 min -0.10 -0.100 -> -0.10 +mnmx448 min -0.1 -0.10 -> -0.1 +mnmx449 min -1.0 -0.1 -> -1.0 +mnmx450 min -1 -1.0 -> -1 +mnmx451 min -1.1 -1 -> -1.1 +mnmx453 min -Inf -1.1 -> -Infinity +-- largies +mnmx460 min 1000 1E+3 -> 1000 +mnmx461 min 1E+3 1000 -> 1000 +mnmx462 min 1000 -1E+3 -> -1E+3 +mnmx463 min 1E+3 -1000 -> -1000 +mnmx464 min -1000 1E+3 -> -1000 +mnmx465 min -1E+3 1000 -> -1E+3 +mnmx466 min -1000 -1E+3 -> -1E+3 +mnmx467 min -1E+3 -1000 -> -1E+3 + +-- rounding (results treated as though plus) +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 + +mnmx470 min 1 5 -> 1 +mnmx471 min 10 50 -> 10 +mnmx472 min 100 500 -> 100 +mnmx473 min 1000 5000 -> 1.00E+3 Rounded +mnmx474 min 10000 50000 -> 1.00E+4 Rounded +mnmx475 min 6 50 -> 6 +mnmx476 min 66 500 -> 66 +mnmx477 min 666 5000 -> 666 +mnmx478 min 6666 50000 -> 6.67E+3 Rounded Inexact +mnmx479 min 66666 500000 -> 6.67E+4 Rounded Inexact +mnmx480 min 33333 500000 -> 3.33E+4 Rounded Inexact +mnmx481 min 75401 1 -> 1 +mnmx482 min 75402 10 -> 10 +mnmx483 min 75403 100 -> 100 +mnmx484 min 75404 1000 -> 1.00E+3 Rounded +mnmx485 min 75405 10000 -> 1.00E+4 Rounded +mnmx486 min 75406 6 -> 6 +mnmx487 min 75407 66 -> 66 +mnmx488 min 75408 666 -> 666 +mnmx489 min 75409 6666 -> 6.67E+3 Rounded Inexact +mnmx490 min 75410 66666 -> 6.67E+4 Rounded Inexact +mnmx491 min 75411 33333 -> 3.33E+4 Rounded Inexact + + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +mnmx500 min 9.999E+999999999 0 -> 0 +mnmx501 min -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +mnmx510 min 1.00E-999 0 -> 0 +mnmx511 min 0.1E-999 0 -> 0 +mnmx512 min 0.10E-999 0 -> 0 +mnmx513 min 0.100E-999 0 -> 0 +mnmx514 min 0.01E-999 0 -> 0 +mnmx515 min 0.999E-999 0 -> 0 +mnmx516 min 0.099E-999 0 -> 0 +mnmx517 min 0.009E-999 0 -> 0 +mnmx518 min 0.001E-999 0 -> 0 +mnmx519 min 0.0009E-999 0 -> 0 +mnmx520 min 0.0001E-999 0 -> 0 + +mnmx530 min -1.00E-999 0 -> -1.00E-999 +mnmx531 min -0.1E-999 0 -> -1E-1000 Subnormal +mnmx532 min -0.10E-999 0 -> -1.0E-1000 Subnormal +mnmx533 min -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded +mnmx534 min -0.01E-999 0 -> -1E-1001 Subnormal +-- next is rounded to Nmin +mnmx535 min -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow +mnmx536 min -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +mnmx537 min -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow +mnmx538 min -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +mnmx539 min -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +mnmx540 min -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- misalignment traps for little-endian +precision: 9 +mnmx551 min 1.0 0.1 -> 0.1 +mnmx552 min 0.1 1.0 -> 0.1 +mnmx553 min 10.0 0.1 -> 0.1 +mnmx554 min 0.1 10.0 -> 0.1 +mnmx555 min 100 1.0 -> 1.0 +mnmx556 min 1.0 100 -> 1.0 +mnmx557 min 1000 10.0 -> 10.0 +mnmx558 min 10.0 1000 -> 10.0 +mnmx559 min 10000 100.0 -> 100.0 +mnmx560 min 100.0 10000 -> 100.0 +mnmx561 min 100000 1000.0 -> 1000.0 +mnmx562 min 1000.0 100000 -> 1000.0 +mnmx563 min 1000000 10000.0 -> 10000.0 +mnmx564 min 10000.0 1000000 -> 10000.0 + +-- Null tests +mnm900 min 10 # -> NaN Invalid_operation +mnm901 min # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/minmag.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/minmag.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,390 @@ +------------------------------------------------------------------------ +-- minmag.decTest -- decimal minimum by magnitude -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +mngx001 minmag -2 -2 -> -2 +mngx002 minmag -2 -1 -> -1 +mngx003 minmag -2 0 -> 0 +mngx004 minmag -2 1 -> 1 +mngx005 minmag -2 2 -> -2 +mngx006 minmag -1 -2 -> -1 +mngx007 minmag -1 -1 -> -1 +mngx008 minmag -1 0 -> 0 +mngx009 minmag -1 1 -> -1 +mngx010 minmag -1 2 -> -1 +mngx011 minmag 0 -2 -> 0 +mngx012 minmag 0 -1 -> 0 +mngx013 minmag 0 0 -> 0 +mngx014 minmag 0 1 -> 0 +mngx015 minmag 0 2 -> 0 +mngx016 minmag 1 -2 -> 1 +mngx017 minmag 1 -1 -> -1 +mngx018 minmag 1 0 -> 0 +mngx019 minmag 1 1 -> 1 +mngx020 minmag 1 2 -> 1 +mngx021 minmag 2 -2 -> -2 +mngx022 minmag 2 -1 -> -1 +mngx023 minmag 2 0 -> 0 +mngx025 minmag 2 1 -> 1 +mngx026 minmag 2 2 -> 2 + +-- extended zeros +mngx030 minmag 0 0 -> 0 +mngx031 minmag 0 -0 -> -0 +mngx032 minmag 0 -0.0 -> -0.0 +mngx033 minmag 0 0.0 -> 0.0 +mngx034 minmag -0 0 -> -0 +mngx035 minmag -0 -0 -> -0 +mngx036 minmag -0 -0.0 -> -0 +mngx037 minmag -0 0.0 -> -0 +mngx038 minmag 0.0 0 -> 0.0 +mngx039 minmag 0.0 -0 -> -0 +mngx040 minmag 0.0 -0.0 -> -0.0 +mngx041 minmag 0.0 0.0 -> 0.0 +mngx042 minmag -0.0 0 -> -0.0 +mngx043 minmag -0.0 -0 -> -0 +mngx044 minmag -0.0 -0.0 -> -0.0 +mngx045 minmag -0.0 0.0 -> -0.0 + +mngx046 minmag 0E1 -0E1 -> -0E+1 +mngx047 minmag -0E1 0E2 -> -0E+1 +mngx048 minmag 0E2 0E1 -> 0E+1 +mngx049 minmag 0E1 0E2 -> 0E+1 +mngx050 minmag -0E3 -0E2 -> -0E+3 +mngx051 minmag -0E2 -0E3 -> -0E+3 + +-- Specials +precision: 9 +mngx090 minmag Inf -Inf -> -Infinity +mngx091 minmag Inf -1000 -> -1000 +mngx092 minmag Inf -1 -> -1 +mngx093 minmag Inf -0 -> -0 +mngx094 minmag Inf 0 -> 0 +mngx095 minmag Inf 1 -> 1 +mngx096 minmag Inf 1000 -> 1000 +mngx097 minmag Inf Inf -> Infinity +mngx098 minmag -1000 Inf -> -1000 +mngx099 minmag -Inf Inf -> -Infinity +mngx100 minmag -1 Inf -> -1 +mngx101 minmag -0 Inf -> -0 +mngx102 minmag 0 Inf -> 0 +mngx103 minmag 1 Inf -> 1 +mngx104 minmag 1000 Inf -> 1000 +mngx105 minmag Inf Inf -> Infinity + +mngx120 minmag -Inf -Inf -> -Infinity +mngx121 minmag -Inf -1000 -> -1000 +mngx122 minmag -Inf -1 -> -1 +mngx123 minmag -Inf -0 -> -0 +mngx124 minmag -Inf 0 -> 0 +mngx125 minmag -Inf 1 -> 1 +mngx126 minmag -Inf 1000 -> 1000 +mngx127 minmag -Inf Inf -> -Infinity +mngx128 minmag -Inf -Inf -> -Infinity +mngx129 minmag -1000 -Inf -> -1000 +mngx130 minmag -1 -Inf -> -1 +mngx131 minmag -0 -Inf -> -0 +mngx132 minmag 0 -Inf -> 0 +mngx133 minmag 1 -Inf -> 1 +mngx134 minmag 1000 -Inf -> 1000 +mngx135 minmag Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +mngx141 minmag NaN -Inf -> -Infinity +mngx142 minmag NaN -1000 -> -1000 +mngx143 minmag NaN -1 -> -1 +mngx144 minmag NaN -0 -> -0 +mngx145 minmag NaN 0 -> 0 +mngx146 minmag NaN 1 -> 1 +mngx147 minmag NaN 1000 -> 1000 +mngx148 minmag NaN Inf -> Infinity +mngx149 minmag NaN NaN -> NaN +mngx150 minmag -Inf NaN -> -Infinity +mngx151 minmag -1000 NaN -> -1000 +mngx152 minmag -1 -NaN -> -1 +mngx153 minmag -0 NaN -> -0 +mngx154 minmag 0 -NaN -> 0 +mngx155 minmag 1 NaN -> 1 +mngx156 minmag 1000 NaN -> 1000 +mngx157 minmag Inf NaN -> Infinity + +mngx161 minmag sNaN -Inf -> NaN Invalid_operation +mngx162 minmag sNaN -1000 -> NaN Invalid_operation +mngx163 minmag sNaN -1 -> NaN Invalid_operation +mngx164 minmag sNaN -0 -> NaN Invalid_operation +mngx165 minmag -sNaN 0 -> -NaN Invalid_operation +mngx166 minmag -sNaN 1 -> -NaN Invalid_operation +mngx167 minmag sNaN 1000 -> NaN Invalid_operation +mngx168 minmag sNaN NaN -> NaN Invalid_operation +mngx169 minmag sNaN sNaN -> NaN Invalid_operation +mngx170 minmag NaN sNaN -> NaN Invalid_operation +mngx171 minmag -Inf sNaN -> NaN Invalid_operation +mngx172 minmag -1000 sNaN -> NaN Invalid_operation +mngx173 minmag -1 sNaN -> NaN Invalid_operation +mngx174 minmag -0 sNaN -> NaN Invalid_operation +mngx175 minmag 0 sNaN -> NaN Invalid_operation +mngx176 minmag 1 sNaN -> NaN Invalid_operation +mngx177 minmag 1000 sNaN -> NaN Invalid_operation +mngx178 minmag Inf sNaN -> NaN Invalid_operation +mngx179 minmag NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +mngx181 minmag NaN9 -Inf -> -Infinity +mngx182 minmag -NaN8 9990 -> 9990 +mngx183 minmag NaN71 Inf -> Infinity + +mngx184 minmag NaN1 NaN54 -> NaN1 +mngx185 minmag NaN22 -NaN53 -> NaN22 +mngx186 minmag -NaN3 NaN6 -> -NaN3 +mngx187 minmag -NaN44 NaN7 -> -NaN44 + +mngx188 minmag -Inf NaN41 -> -Infinity +mngx189 minmag -9999 -NaN33 -> -9999 +mngx190 minmag Inf NaN2 -> Infinity + +mngx191 minmag sNaN99 -Inf -> NaN99 Invalid_operation +mngx192 minmag sNaN98 -11 -> NaN98 Invalid_operation +mngx193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation +mngx194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation +mngx195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation +mngx196 minmag -Inf sNaN92 -> NaN92 Invalid_operation +mngx197 minmag 088 sNaN91 -> NaN91 Invalid_operation +mngx198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation +mngx199 minmag NaN sNaN86 -> NaN86 Invalid_operation + +-- rounding checks -- chosen is rounded, or not +maxExponent: 999 +minexponent: -999 +precision: 9 +mngx201 minmag -12345678000 1 -> 1 +mngx202 minmag 1 -12345678000 -> 1 +mngx203 minmag -1234567800 1 -> 1 +mngx204 minmag 1 -1234567800 -> 1 +mngx205 minmag -1234567890 1 -> 1 +mngx206 minmag 1 -1234567890 -> 1 +mngx207 minmag -1234567891 1 -> 1 +mngx208 minmag 1 -1234567891 -> 1 +mngx209 minmag -12345678901 1 -> 1 +mngx210 minmag 1 -12345678901 -> 1 +mngx211 minmag -1234567896 1 -> 1 +mngx212 minmag 1 -1234567896 -> 1 +mngx213 minmag 1234567891 1 -> 1 +mngx214 minmag 1 1234567891 -> 1 +mngx215 minmag 12345678901 1 -> 1 +mngx216 minmag 1 12345678901 -> 1 +mngx217 minmag 1234567896 1 -> 1 +mngx218 minmag 1 1234567896 -> 1 + +precision: 15 +mngx221 minmag -12345678000 1 -> 1 +mngx222 minmag 1 -12345678000 -> 1 +mngx223 minmag -1234567800 1 -> 1 +mngx224 minmag 1 -1234567800 -> 1 +mngx225 minmag -1234567890 1 -> 1 +mngx226 minmag 1 -1234567890 -> 1 +mngx227 minmag -1234567891 1 -> 1 +mngx228 minmag 1 -1234567891 -> 1 +mngx229 minmag -12345678901 1 -> 1 +mngx230 minmag 1 -12345678901 -> 1 +mngx231 minmag -1234567896 1 -> 1 +mngx232 minmag 1 -1234567896 -> 1 +mngx233 minmag 1234567891 1 -> 1 +mngx234 minmag 1 1234567891 -> 1 +mngx235 minmag 12345678901 1 -> 1 +mngx236 minmag 1 12345678901 -> 1 +mngx237 minmag 1234567896 1 -> 1 +mngx238 minmag 1 1234567896 -> 1 + +-- from examples +mngx280 minmag '3' '2' -> '2' +mngx281 minmag '-10' '3' -> '3' +mngx282 minmag '1.0' '1' -> '1.0' +mngx283 minmag '1' '1.0' -> '1.0' +mngx284 minmag '7' 'NaN' -> '7' + +-- overflow and underflow tests .. subnormal results [inputs] now allowed +maxExponent: 999999999 +minexponent: -999999999 +mngx330 minmag -1.23456789012345E-0 -9E+999999999 -> -1.23456789012345 +mngx331 minmag -9E+999999999 -1.23456789012345E-0 -> -1.23456789012345 +mngx332 minmag -0.100 -9E-999999999 -> -9E-999999999 +mngx333 minmag -9E-999999999 -0.100 -> -9E-999999999 +mngx335 minmag +1.23456789012345E-0 -9E+999999999 -> 1.23456789012345 +mngx336 minmag -9E+999999999 1.23456789012345E-0 -> 1.23456789012345 +mngx337 minmag +0.100 -9E-999999999 -> -9E-999999999 +mngx338 minmag -9E-999999999 0.100 -> -9E-999999999 + +mngx339 minmag -1e-599999999 -1e-400000001 -> -1E-599999999 +mngx340 minmag -1e-599999999 -1e-400000000 -> -1E-599999999 +mngx341 minmag -1e-600000000 -1e-400000000 -> -1E-600000000 +mngx342 minmag -9e-999999998 -0.01 -> -9E-999999998 +mngx343 minmag -9e-999999998 -0.1 -> -9E-999999998 +mngx344 minmag -0.01 -9e-999999998 -> -9E-999999998 +mngx345 minmag -1e599999999 -1e400000001 -> -1E+400000001 +mngx346 minmag -1e599999999 -1e400000000 -> -1E+400000000 +mngx347 minmag -1e600000000 -1e400000000 -> -1E+400000000 +mngx348 minmag -9e999999998 -100 -> -100 +mngx349 minmag -9e999999998 -10 -> -10 +mngx350 minmag -100 -9e999999998 -> -100 +-- signs +mngx351 minmag -1e+777777777 -1e+411111111 -> -1E+411111111 +mngx352 minmag -1e+777777777 +1e+411111111 -> 1E+411111111 +mngx353 minmag +1e+777777777 -1e+411111111 -> -1E+411111111 +mngx354 minmag +1e+777777777 +1e+411111111 -> 1E+411111111 +mngx355 minmag -1e-777777777 -1e-411111111 -> -1E-777777777 +mngx356 minmag -1e-777777777 +1e-411111111 -> -1E-777777777 +mngx357 minmag +1e-777777777 -1e-411111111 -> 1E-777777777 +mngx358 minmag +1e-777777777 +1e-411111111 -> 1E-777777777 + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +mngx401 minmag Inf 1.1 -> 1.1 +mngx402 minmag 1.1 1 -> 1 +mngx403 minmag 1 1.0 -> 1.0 +mngx404 minmag 1.0 0.1 -> 0.1 +mngx405 minmag 0.1 0.10 -> 0.10 +mngx406 minmag 0.10 0.100 -> 0.100 +mngx407 minmag 0.10 0 -> 0 +mngx408 minmag 0 0.0 -> 0.0 +mngx409 minmag 0.0 -0 -> -0 +mngx410 minmag 0.0 -0.0 -> -0.0 +mngx411 minmag 0.00 -0.0 -> -0.0 +mngx412 minmag 0.0 -0.00 -> -0.00 +mngx413 minmag 0 -0.0 -> -0.0 +mngx414 minmag 0 -0 -> -0 +mngx415 minmag -0.0 -0 -> -0 +mngx416 minmag -0 -0.100 -> -0 +mngx417 minmag -0.100 -0.10 -> -0.10 +mngx418 minmag -0.10 -0.1 -> -0.1 +mngx419 minmag -0.1 -1.0 -> -0.1 +mngx420 minmag -1.0 -1 -> -1 +mngx421 minmag -1 -1.1 -> -1 +mngx423 minmag -1.1 -Inf -> -1.1 +-- same with operands reversed +mngx431 minmag 1.1 Inf -> 1.1 +mngx432 minmag 1 1.1 -> 1 +mngx433 minmag 1.0 1 -> 1.0 +mngx434 minmag 0.1 1.0 -> 0.1 +mngx435 minmag 0.10 0.1 -> 0.10 +mngx436 minmag 0.100 0.10 -> 0.100 +mngx437 minmag 0 0.10 -> 0 +mngx438 minmag 0.0 0 -> 0.0 +mngx439 minmag -0 0.0 -> -0 +mngx440 minmag -0.0 0.0 -> -0.0 +mngx441 minmag -0.0 0.00 -> -0.0 +mngx442 minmag -0.00 0.0 -> -0.00 +mngx443 minmag -0.0 0 -> -0.0 +mngx444 minmag -0 0 -> -0 +mngx445 minmag -0 -0.0 -> -0 +mngx446 minmag -0.100 -0 -> -0 +mngx447 minmag -0.10 -0.100 -> -0.10 +mngx448 minmag -0.1 -0.10 -> -0.1 +mngx449 minmag -1.0 -0.1 -> -0.1 +mngx450 minmag -1 -1.0 -> -1 +mngx451 minmag -1.1 -1 -> -1 +mngx453 minmag -Inf -1.1 -> -1.1 +-- largies +mngx460 minmag 1000 1E+3 -> 1000 +mngx461 minmag 1E+3 1000 -> 1000 +mngx462 minmag 1000 -1E+3 -> -1E+3 +mngx463 minmag 1E+3 -1000 -> -1000 +mngx464 minmag -1000 1E+3 -> -1000 +mngx465 minmag -1E+3 1000 -> -1E+3 +mngx466 minmag -1000 -1E+3 -> -1E+3 +mngx467 minmag -1E+3 -1000 -> -1E+3 + +-- rounding (results treated as though plus) +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 + +mngx470 minmag 1 5 -> 1 +mngx471 minmag 10 50 -> 10 +mngx472 minmag 100 500 -> 100 +mngx473 minmag 1000 5000 -> 1.00E+3 Rounded +mngx474 minmag 10000 50000 -> 1.00E+4 Rounded +mngx475 minmag 6 50 -> 6 +mngx476 minmag 66 500 -> 66 +mngx477 minmag 666 5000 -> 666 +mngx478 minmag 6666 50000 -> 6.67E+3 Rounded Inexact +mngx479 minmag 66666 500000 -> 6.67E+4 Rounded Inexact +mngx480 minmag 33333 500000 -> 3.33E+4 Rounded Inexact +mngx481 minmag 75401 1 -> 1 +mngx482 minmag 75402 10 -> 10 +mngx483 minmag 75403 100 -> 100 +mngx484 minmag 75404 1000 -> 1.00E+3 Rounded +mngx485 minmag 75405 10000 -> 1.00E+4 Rounded +mngx486 minmag 75406 6 -> 6 +mngx487 minmag 75407 66 -> 66 +mngx488 minmag 75408 666 -> 666 +mngx489 minmag 75409 6666 -> 6.67E+3 Rounded Inexact +mngx490 minmag 75410 66666 -> 6.67E+4 Rounded Inexact +mngx491 minmag 75411 33333 -> 3.33E+4 Rounded Inexact + + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +mngx500 minmag 9.999E+999999999 0 -> 0 +mngx501 minmag -9.999E+999999999 0 -> 0 + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +mngx510 minmag 1.00E-999 0 -> 0 +mngx511 minmag 0.1E-999 0 -> 0 +mngx512 minmag 0.10E-999 0 -> 0 +mngx513 minmag 0.100E-999 0 -> 0 +mngx514 minmag 0.01E-999 0 -> 0 +mngx515 minmag 0.999E-999 0 -> 0 +mngx516 minmag 0.099E-999 0 -> 0 +mngx517 minmag 0.009E-999 0 -> 0 +mngx518 minmag 0.001E-999 0 -> 0 +mngx519 minmag 0.0009E-999 0 -> 0 +mngx520 minmag 0.0001E-999 0 -> 0 + +mngx530 minmag -1.00E-999 0 -> 0 +mngx531 minmag -0.1E-999 0 -> 0 +mngx532 minmag -0.10E-999 0 -> 0 +mngx533 minmag -0.100E-999 0 -> 0 +mngx534 minmag -0.01E-999 0 -> 0 +mngx535 minmag -0.999E-999 0 -> 0 +mngx536 minmag -0.099E-999 0 -> 0 +mngx537 minmag -0.009E-999 0 -> 0 +mngx538 minmag -0.001E-999 0 -> 0 +mngx539 minmag -0.0009E-999 0 -> 0 +mngx540 minmag -0.0001E-999 0 -> 0 + + +-- Null tests +mng900 minmag 10 # -> NaN Invalid_operation +mng901 minmag # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/minus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/minus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,182 @@ +------------------------------------------------------------------------ +-- minus.decTest -- decimal negation -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests primarily tests the existence of the operator. +-- Subtraction, rounding, and more overflows are tested elsewhere. + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +minx001 minus '1' -> '-1' +minx002 minus '-1' -> '1' +minx003 minus '1.00' -> '-1.00' +minx004 minus '-1.00' -> '1.00' +minx005 minus '0' -> '0' +minx006 minus '0.00' -> '0.00' +minx007 minus '00.0' -> '0.0' +minx008 minus '00.00' -> '0.00' +minx009 minus '00' -> '0' + +minx010 minus '-2' -> '2' +minx011 minus '2' -> '-2' +minx012 minus '-2.00' -> '2.00' +minx013 minus '2.00' -> '-2.00' +minx014 minus '-0' -> '0' +minx015 minus '-0.00' -> '0.00' +minx016 minus '-00.0' -> '0.0' +minx017 minus '-00.00' -> '0.00' +minx018 minus '-00' -> '0' + +-- "lhs" zeros in plus and minus have exponent = operand +minx020 minus '-0E3' -> '0E+3' +minx021 minus '-0E2' -> '0E+2' +minx022 minus '-0E1' -> '0E+1' +minx023 minus '-0E0' -> '0' +minx024 minus '+0E0' -> '0' +minx025 minus '+0E1' -> '0E+1' +minx026 minus '+0E2' -> '0E+2' +minx027 minus '+0E3' -> '0E+3' + +minx030 minus '-5E3' -> '5E+3' +minx031 minus '-5E8' -> '5E+8' +minx032 minus '-5E13' -> '5E+13' +minx033 minus '-5E18' -> '5E+18' +minx034 minus '+5E3' -> '-5E+3' +minx035 minus '+5E8' -> '-5E+8' +minx036 minus '+5E13' -> '-5E+13' +minx037 minus '+5E18' -> '-5E+18' + +minx050 minus '-2000000' -> '2000000' +minx051 minus '2000000' -> '-2000000' +precision: 7 +minx052 minus '-2000000' -> '2000000' +minx053 minus '2000000' -> '-2000000' +precision: 6 +minx054 minus '-2000000' -> '2.00000E+6' Rounded +minx055 minus '2000000' -> '-2.00000E+6' Rounded +precision: 3 +minx056 minus '-2000000' -> '2.00E+6' Rounded +minx057 minus '2000000' -> '-2.00E+6' Rounded + +-- more fixed, potential LHS swaps/overlays if done by 0 subtract x +precision: 9 +minx060 minus '56267E-10' -> '-0.0000056267' +minx061 minus '56267E-5' -> '-0.56267' +minx062 minus '56267E-2' -> '-562.67' +minx063 minus '56267E-1' -> '-5626.7' +minx065 minus '56267E-0' -> '-56267' +minx066 minus '56267E+0' -> '-56267' +minx067 minus '56267E+1' -> '-5.6267E+5' +minx068 minus '56267E+2' -> '-5.6267E+6' +minx069 minus '56267E+3' -> '-5.6267E+7' +minx070 minus '56267E+4' -> '-5.6267E+8' +minx071 minus '56267E+5' -> '-5.6267E+9' +minx072 minus '56267E+6' -> '-5.6267E+10' +minx080 minus '-56267E-10' -> '0.0000056267' +minx081 minus '-56267E-5' -> '0.56267' +minx082 minus '-56267E-2' -> '562.67' +minx083 minus '-56267E-1' -> '5626.7' +minx085 minus '-56267E-0' -> '56267' +minx086 minus '-56267E+0' -> '56267' +minx087 minus '-56267E+1' -> '5.6267E+5' +minx088 minus '-56267E+2' -> '5.6267E+6' +minx089 minus '-56267E+3' -> '5.6267E+7' +minx090 minus '-56267E+4' -> '5.6267E+8' +minx091 minus '-56267E+5' -> '5.6267E+9' +minx092 minus '-56267E+6' -> '5.6267E+10' + + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +minx100 minus 9.999E+999999999 -> -Infinity Inexact Overflow Rounded +minx101 minus -9.999E+999999999 -> Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +minx110 minus 1.00E-999 -> -1.00E-999 +minx111 minus 0.1E-999 -> -1E-1000 Subnormal +minx112 minus 0.10E-999 -> -1.0E-1000 Subnormal +minx113 minus 0.100E-999 -> -1.0E-1000 Subnormal Rounded +minx114 minus 0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +minx115 minus 0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow +minx116 minus 0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +minx117 minus 0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +minx118 minus 0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx119 minus 0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx120 minus 0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +minx130 minus -1.00E-999 -> 1.00E-999 +minx131 minus -0.1E-999 -> 1E-1000 Subnormal +minx132 minus -0.10E-999 -> 1.0E-1000 Subnormal +minx133 minus -0.100E-999 -> 1.0E-1000 Subnormal Rounded +minx134 minus -0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +minx135 minus -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +minx136 minus -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +minx137 minus -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +minx138 minus -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx139 minus -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx140 minus -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +minx301 minus 12345678000 -> -1.23456780E+10 Rounded +minx302 minus 1234567800 -> -1.23456780E+9 Rounded +minx303 minus 1234567890 -> -1.23456789E+9 Rounded +minx304 minus 1234567891 -> -1.23456789E+9 Inexact Rounded +minx305 minus 12345678901 -> -1.23456789E+10 Inexact Rounded +minx306 minus 1234567896 -> -1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +minx321 minus 12345678000 -> -12345678000 +minx322 minus 1234567800 -> -1234567800 +minx323 minus 1234567890 -> -1234567890 +minx324 minus 1234567891 -> -1234567891 +minx325 minus 12345678901 -> -12345678901 +minx326 minus 1234567896 -> -1234567896 + +-- specials +minx420 minus 'Inf' -> '-Infinity' +minx421 minus '-Inf' -> 'Infinity' +minx422 minus NaN -> NaN +minx423 minus sNaN -> NaN Invalid_operation +minx424 minus NaN255 -> NaN255 +minx425 minus sNaN256 -> NaN256 Invalid_operation +minx426 minus -NaN -> -NaN +minx427 minus -sNaN -> -NaN Invalid_operation +minx428 minus -NaN255 -> -NaN255 +minx429 minus -sNaN256 -> -NaN256 Invalid_operation + +-- Null tests +minx900 minus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/multiply.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/multiply.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,731 @@ +------------------------------------------------------------------------ +-- multiply.decTest -- decimal multiplication -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks (as base, above) +mulx000 multiply 2 2 -> 4 +mulx001 multiply 2 3 -> 6 +mulx002 multiply 5 1 -> 5 +mulx003 multiply 5 2 -> 10 +mulx004 multiply 1.20 2 -> 2.40 +mulx005 multiply 1.20 0 -> 0.00 +mulx006 multiply 1.20 -2 -> -2.40 +mulx007 multiply -1.20 2 -> -2.40 +mulx008 multiply -1.20 0 -> -0.00 +mulx009 multiply -1.20 -2 -> 2.40 +mulx010 multiply 5.09 7.1 -> 36.139 +mulx011 multiply 2.5 4 -> 10.0 +mulx012 multiply 2.50 4 -> 10.00 +mulx013 multiply 1.23456789 1.00000000 -> 1.23456789 Rounded +mulx014 multiply 9.999999999 9.999999999 -> 100.000000 Inexact Rounded +mulx015 multiply 2.50 4 -> 10.00 +precision: 6 +mulx016 multiply 2.50 4 -> 10.00 +mulx017 multiply 9.999999999 9.999999999 -> 100.000 Inexact Rounded +mulx018 multiply 9.999999999 -9.999999999 -> -100.000 Inexact Rounded +mulx019 multiply -9.999999999 9.999999999 -> -100.000 Inexact Rounded +mulx020 multiply -9.999999999 -9.999999999 -> 100.000 Inexact Rounded + +-- 1999.12.21: next one is a edge case if intermediate longs are used +precision: 15 +mulx059 multiply 999999999999 9765625 -> 9.76562499999023E+18 Inexact Rounded +precision: 30 +mulx160 multiply 999999999999 9765625 -> 9765624999990234375 +precision: 9 +----- + +-- zeros, etc. +mulx021 multiply 0 0 -> 0 +mulx022 multiply 0 -0 -> -0 +mulx023 multiply -0 0 -> -0 +mulx024 multiply -0 -0 -> 0 +mulx025 multiply -0.0 -0.0 -> 0.00 +mulx026 multiply -0.0 -0.0 -> 0.00 +mulx027 multiply -0.0 -0.0 -> 0.00 +mulx028 multiply -0.0 -0.0 -> 0.00 +mulx030 multiply 5.00 1E-3 -> 0.00500 +mulx031 multiply 00.00 0.000 -> 0.00000 +mulx032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0 +mulx033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0 +mulx034 multiply -5.00 1E-3 -> -0.00500 +mulx035 multiply -00.00 0.000 -> -0.00000 +mulx036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0 +mulx037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0 +mulx038 multiply 5.00 -1E-3 -> -0.00500 +mulx039 multiply 00.00 -0.000 -> -0.00000 +mulx040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0 +mulx041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0 +mulx042 multiply -5.00 -1E-3 -> 0.00500 +mulx043 multiply -00.00 -0.000 -> 0.00000 +mulx044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0 +mulx045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0 + +-- examples from decarith +mulx050 multiply 1.20 3 -> 3.60 +mulx051 multiply 7 3 -> 21 +mulx052 multiply 0.9 0.8 -> 0.72 +mulx053 multiply 0.9 -0 -> -0.0 +mulx054 multiply 654321 654321 -> 4.28135971E+11 Inexact Rounded + +mulx060 multiply 123.45 1e7 -> 1.2345E+9 +mulx061 multiply 123.45 1e8 -> 1.2345E+10 +mulx062 multiply 123.45 1e+9 -> 1.2345E+11 +mulx063 multiply 123.45 1e10 -> 1.2345E+12 +mulx064 multiply 123.45 1e11 -> 1.2345E+13 +mulx065 multiply 123.45 1e12 -> 1.2345E+14 +mulx066 multiply 123.45 1e13 -> 1.2345E+15 + + +-- test some intermediate lengths +precision: 9 +mulx080 multiply 0.1 123456789 -> 12345678.9 +mulx081 multiply 0.1 1234567891 -> 123456789 Inexact Rounded +mulx082 multiply 0.1 12345678912 -> 1.23456789E+9 Inexact Rounded +mulx083 multiply 0.1 12345678912345 -> 1.23456789E+12 Inexact Rounded +mulx084 multiply 0.1 123456789 -> 12345678.9 +precision: 8 +mulx085 multiply 0.1 12345678912 -> 1.2345679E+9 Inexact Rounded +mulx086 multiply 0.1 12345678912345 -> 1.2345679E+12 Inexact Rounded +precision: 7 +mulx087 multiply 0.1 12345678912 -> 1.234568E+9 Inexact Rounded +mulx088 multiply 0.1 12345678912345 -> 1.234568E+12 Inexact Rounded + +precision: 9 +mulx090 multiply 123456789 0.1 -> 12345678.9 +mulx091 multiply 1234567891 0.1 -> 123456789 Inexact Rounded +mulx092 multiply 12345678912 0.1 -> 1.23456789E+9 Inexact Rounded +mulx093 multiply 12345678912345 0.1 -> 1.23456789E+12 Inexact Rounded +mulx094 multiply 123456789 0.1 -> 12345678.9 +precision: 8 +mulx095 multiply 12345678912 0.1 -> 1.2345679E+9 Inexact Rounded +mulx096 multiply 12345678912345 0.1 -> 1.2345679E+12 Inexact Rounded +precision: 7 +mulx097 multiply 12345678912 0.1 -> 1.234568E+9 Inexact Rounded +mulx098 multiply 12345678912345 0.1 -> 1.234568E+12 Inexact Rounded + +-- test some more edge cases and carries +maxexponent: 9999 +minexponent: -9999 +precision: 33 +mulx101 multiply 9 9 -> 81 +mulx102 multiply 9 90 -> 810 +mulx103 multiply 9 900 -> 8100 +mulx104 multiply 9 9000 -> 81000 +mulx105 multiply 9 90000 -> 810000 +mulx106 multiply 9 900000 -> 8100000 +mulx107 multiply 9 9000000 -> 81000000 +mulx108 multiply 9 90000000 -> 810000000 +mulx109 multiply 9 900000000 -> 8100000000 +mulx110 multiply 9 9000000000 -> 81000000000 +mulx111 multiply 9 90000000000 -> 810000000000 +mulx112 multiply 9 900000000000 -> 8100000000000 +mulx113 multiply 9 9000000000000 -> 81000000000000 +mulx114 multiply 9 90000000000000 -> 810000000000000 +mulx115 multiply 9 900000000000000 -> 8100000000000000 +mulx116 multiply 9 9000000000000000 -> 81000000000000000 +mulx117 multiply 9 90000000000000000 -> 810000000000000000 +mulx118 multiply 9 900000000000000000 -> 8100000000000000000 +mulx119 multiply 9 9000000000000000000 -> 81000000000000000000 +mulx120 multiply 9 90000000000000000000 -> 810000000000000000000 +mulx121 multiply 9 900000000000000000000 -> 8100000000000000000000 +mulx122 multiply 9 9000000000000000000000 -> 81000000000000000000000 +mulx123 multiply 9 90000000000000000000000 -> 810000000000000000000000 +-- test some more edge cases without carries +mulx131 multiply 3 3 -> 9 +mulx132 multiply 3 30 -> 90 +mulx133 multiply 3 300 -> 900 +mulx134 multiply 3 3000 -> 9000 +mulx135 multiply 3 30000 -> 90000 +mulx136 multiply 3 300000 -> 900000 +mulx137 multiply 3 3000000 -> 9000000 +mulx138 multiply 3 30000000 -> 90000000 +mulx139 multiply 3 300000000 -> 900000000 +mulx140 multiply 3 3000000000 -> 9000000000 +mulx141 multiply 3 30000000000 -> 90000000000 +mulx142 multiply 3 300000000000 -> 900000000000 +mulx143 multiply 3 3000000000000 -> 9000000000000 +mulx144 multiply 3 30000000000000 -> 90000000000000 +mulx145 multiply 3 300000000000000 -> 900000000000000 +mulx146 multiply 3 3000000000000000 -> 9000000000000000 +mulx147 multiply 3 30000000000000000 -> 90000000000000000 +mulx148 multiply 3 300000000000000000 -> 900000000000000000 +mulx149 multiply 3 3000000000000000000 -> 9000000000000000000 +mulx150 multiply 3 30000000000000000000 -> 90000000000000000000 +mulx151 multiply 3 300000000000000000000 -> 900000000000000000000 +mulx152 multiply 3 3000000000000000000000 -> 9000000000000000000000 +mulx153 multiply 3 30000000000000000000000 -> 90000000000000000000000 + +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +-- test some cases that are close to exponent overflow/underflow +mulx170 multiply 1 9e999999999 -> 9E+999999999 +mulx171 multiply 1 9.9e999999999 -> 9.9E+999999999 +mulx172 multiply 1 9.99e999999999 -> 9.99E+999999999 +mulx173 multiply 9e999999999 1 -> 9E+999999999 +mulx174 multiply 9.9e999999999 1 -> 9.9E+999999999 +mulx176 multiply 9.99e999999999 1 -> 9.99E+999999999 +mulx177 multiply 1 9.99999999e999999999 -> 9.99999999E+999999999 +mulx178 multiply 9.99999999e999999999 1 -> 9.99999999E+999999999 + +mulx180 multiply 0.1 9e-999999998 -> 9E-999999999 +mulx181 multiply 0.1 99e-999999998 -> 9.9E-999999998 +mulx182 multiply 0.1 999e-999999998 -> 9.99E-999999997 + +mulx183 multiply 0.1 9e-999999998 -> 9E-999999999 +mulx184 multiply 0.1 99e-999999998 -> 9.9E-999999998 +mulx185 multiply 0.1 999e-999999998 -> 9.99E-999999997 +mulx186 multiply 0.1 999e-999999997 -> 9.99E-999999996 +mulx187 multiply 0.1 9999e-999999997 -> 9.999E-999999995 +mulx188 multiply 0.1 99999e-999999997 -> 9.9999E-999999994 + +mulx190 multiply 1 9e-999999998 -> 9E-999999998 +mulx191 multiply 1 99e-999999998 -> 9.9E-999999997 +mulx192 multiply 1 999e-999999998 -> 9.99E-999999996 +mulx193 multiply 9e-999999998 1 -> 9E-999999998 +mulx194 multiply 99e-999999998 1 -> 9.9E-999999997 +mulx195 multiply 999e-999999998 1 -> 9.99E-999999996 + +mulx196 multiply 1e-599999999 1e-400000000 -> 1E-999999999 +mulx197 multiply 1e-600000000 1e-399999999 -> 1E-999999999 +mulx198 multiply 1.2e-599999999 1.2e-400000000 -> 1.44E-999999999 +mulx199 multiply 1.2e-600000000 1.2e-399999999 -> 1.44E-999999999 + +mulx201 multiply 1e599999999 1e400000000 -> 1E+999999999 +mulx202 multiply 1e600000000 1e399999999 -> 1E+999999999 +mulx203 multiply 1.2e599999999 1.2e400000000 -> 1.44E+999999999 +mulx204 multiply 1.2e600000000 1.2e399999999 -> 1.44E+999999999 + +-- long operand triangle +precision: 33 +mulx246 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671916511992830 Inexact Rounded +precision: 32 +mulx247 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199283 Inexact Rounded +precision: 31 +mulx248 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928 Inexact Rounded +precision: 30 +mulx249 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671916511993 Inexact Rounded +precision: 29 +mulx250 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199 Inexact Rounded +precision: 28 +mulx251 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165120 Inexact Rounded +precision: 27 +mulx252 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671916512 Inexact Rounded +precision: 26 +mulx253 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651 Inexact Rounded +precision: 25 +mulx254 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165 Inexact Rounded +precision: 24 +mulx255 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671917 Inexact Rounded +precision: 23 +mulx256 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967192 Inexact Rounded +precision: 22 +mulx257 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719 Inexact Rounded +precision: 21 +mulx258 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369672 Inexact Rounded +precision: 20 +mulx259 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967 Inexact Rounded +precision: 19 +mulx260 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933697 Inexact Rounded +precision: 18 +mulx261 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193370 Inexact Rounded +precision: 17 +mulx262 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119337 Inexact Rounded +precision: 16 +mulx263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011934 Inexact Rounded +precision: 15 +mulx264 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193 Inexact Rounded +precision: 14 +mulx265 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119 Inexact Rounded +precision: 13 +mulx266 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908012 Inexact Rounded +precision: 12 +mulx267 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801 Inexact Rounded +precision: 11 +mulx268 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080 Inexact Rounded +precision: 10 +mulx269 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908 Inexact Rounded +precision: 9 +mulx270 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.291 Inexact Rounded +precision: 8 +mulx271 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29 Inexact Rounded +precision: 7 +mulx272 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.3 Inexact Rounded +precision: 6 +mulx273 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433 Inexact Rounded +precision: 5 +mulx274 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.4543E+5 Inexact Rounded +precision: 4 +mulx275 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.454E+5 Inexact Rounded +precision: 3 +mulx276 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.45E+5 Inexact Rounded +precision: 2 +mulx277 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.5E+5 Inexact Rounded +precision: 1 +mulx278 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1E+5 Inexact Rounded + +-- test some edge cases with exact rounding +maxexponent: 9999 +minexponent: -9999 +precision: 9 +mulx301 multiply 9 9 -> 81 +mulx302 multiply 9 90 -> 810 +mulx303 multiply 9 900 -> 8100 +mulx304 multiply 9 9000 -> 81000 +mulx305 multiply 9 90000 -> 810000 +mulx306 multiply 9 900000 -> 8100000 +mulx307 multiply 9 9000000 -> 81000000 +mulx308 multiply 9 90000000 -> 810000000 +mulx309 multiply 9 900000000 -> 8.10000000E+9 Rounded +mulx310 multiply 9 9000000000 -> 8.10000000E+10 Rounded +mulx311 multiply 9 90000000000 -> 8.10000000E+11 Rounded +mulx312 multiply 9 900000000000 -> 8.10000000E+12 Rounded +mulx313 multiply 9 9000000000000 -> 8.10000000E+13 Rounded +mulx314 multiply 9 90000000000000 -> 8.10000000E+14 Rounded +mulx315 multiply 9 900000000000000 -> 8.10000000E+15 Rounded +mulx316 multiply 9 9000000000000000 -> 8.10000000E+16 Rounded +mulx317 multiply 9 90000000000000000 -> 8.10000000E+17 Rounded +mulx318 multiply 9 900000000000000000 -> 8.10000000E+18 Rounded +mulx319 multiply 9 9000000000000000000 -> 8.10000000E+19 Rounded +mulx320 multiply 9 90000000000000000000 -> 8.10000000E+20 Rounded +mulx321 multiply 9 900000000000000000000 -> 8.10000000E+21 Rounded +mulx322 multiply 9 9000000000000000000000 -> 8.10000000E+22 Rounded +mulx323 multiply 9 90000000000000000000000 -> 8.10000000E+23 Rounded + +-- fastpath breakers +precision: 29 +mulx330 multiply 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 -> 1.6487212707001281468486507878 Inexact Rounded +precision: 55 +mulx331 multiply 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded + + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +mulx504 multiply 0E-60 1000E-60 -> 0E-98 Clamped +mulx505 multiply 100E+60 0E+60 -> 0E+92 Clamped + +-- mixed with zeros +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +mulx541 multiply 0 -1 -> -0 +mulx542 multiply -0 -1 -> 0 +mulx543 multiply 0 1 -> 0 +mulx544 multiply -0 1 -> -0 +mulx545 multiply -1 0 -> -0 +mulx546 multiply -1 -0 -> 0 +mulx547 multiply 1 0 -> 0 +mulx548 multiply 1 -0 -> -0 + +mulx551 multiply 0.0 -1 -> -0.0 +mulx552 multiply -0.0 -1 -> 0.0 +mulx553 multiply 0.0 1 -> 0.0 +mulx554 multiply -0.0 1 -> -0.0 +mulx555 multiply -1.0 0 -> -0.0 +mulx556 multiply -1.0 -0 -> 0.0 +mulx557 multiply 1.0 0 -> 0.0 +mulx558 multiply 1.0 -0 -> -0.0 + +mulx561 multiply 0 -1.0 -> -0.0 +mulx562 multiply -0 -1.0 -> 0.0 +mulx563 multiply 0 1.0 -> 0.0 +mulx564 multiply -0 1.0 -> -0.0 +mulx565 multiply -1 0.0 -> -0.0 +mulx566 multiply -1 -0.0 -> 0.0 +mulx567 multiply 1 0.0 -> 0.0 +mulx568 multiply 1 -0.0 -> -0.0 + +mulx571 multiply 0.0 -1.0 -> -0.00 +mulx572 multiply -0.0 -1.0 -> 0.00 +mulx573 multiply 0.0 1.0 -> 0.00 +mulx574 multiply -0.0 1.0 -> -0.00 +mulx575 multiply -1.0 0.0 -> -0.00 +mulx576 multiply -1.0 -0.0 -> 0.00 +mulx577 multiply 1.0 0.0 -> 0.00 +mulx578 multiply 1.0 -0.0 -> -0.00 + + +-- Specials +mulx580 multiply Inf -Inf -> -Infinity +mulx581 multiply Inf -1000 -> -Infinity +mulx582 multiply Inf -1 -> -Infinity +mulx583 multiply Inf -0 -> NaN Invalid_operation +mulx584 multiply Inf 0 -> NaN Invalid_operation +mulx585 multiply Inf 1 -> Infinity +mulx586 multiply Inf 1000 -> Infinity +mulx587 multiply Inf Inf -> Infinity +mulx588 multiply -1000 Inf -> -Infinity +mulx589 multiply -Inf Inf -> -Infinity +mulx590 multiply -1 Inf -> -Infinity +mulx591 multiply -0 Inf -> NaN Invalid_operation +mulx592 multiply 0 Inf -> NaN Invalid_operation +mulx593 multiply 1 Inf -> Infinity +mulx594 multiply 1000 Inf -> Infinity +mulx595 multiply Inf Inf -> Infinity + +mulx600 multiply -Inf -Inf -> Infinity +mulx601 multiply -Inf -1000 -> Infinity +mulx602 multiply -Inf -1 -> Infinity +mulx603 multiply -Inf -0 -> NaN Invalid_operation +mulx604 multiply -Inf 0 -> NaN Invalid_operation +mulx605 multiply -Inf 1 -> -Infinity +mulx606 multiply -Inf 1000 -> -Infinity +mulx607 multiply -Inf Inf -> -Infinity +mulx608 multiply -1000 Inf -> -Infinity +mulx609 multiply -Inf -Inf -> Infinity +mulx610 multiply -1 -Inf -> Infinity +mulx611 multiply -0 -Inf -> NaN Invalid_operation +mulx612 multiply 0 -Inf -> NaN Invalid_operation +mulx613 multiply 1 -Inf -> -Infinity +mulx614 multiply 1000 -Inf -> -Infinity +mulx615 multiply Inf -Inf -> -Infinity + +mulx621 multiply NaN -Inf -> NaN +mulx622 multiply NaN -1000 -> NaN +mulx623 multiply NaN -1 -> NaN +mulx624 multiply NaN -0 -> NaN +mulx625 multiply NaN 0 -> NaN +mulx626 multiply NaN 1 -> NaN +mulx627 multiply NaN 1000 -> NaN +mulx628 multiply NaN Inf -> NaN +mulx629 multiply NaN NaN -> NaN +mulx630 multiply -Inf NaN -> NaN +mulx631 multiply -1000 NaN -> NaN +mulx632 multiply -1 NaN -> NaN +mulx633 multiply -0 NaN -> NaN +mulx634 multiply 0 NaN -> NaN +mulx635 multiply 1 NaN -> NaN +mulx636 multiply 1000 NaN -> NaN +mulx637 multiply Inf NaN -> NaN + +mulx641 multiply sNaN -Inf -> NaN Invalid_operation +mulx642 multiply sNaN -1000 -> NaN Invalid_operation +mulx643 multiply sNaN -1 -> NaN Invalid_operation +mulx644 multiply sNaN -0 -> NaN Invalid_operation +mulx645 multiply sNaN 0 -> NaN Invalid_operation +mulx646 multiply sNaN 1 -> NaN Invalid_operation +mulx647 multiply sNaN 1000 -> NaN Invalid_operation +mulx648 multiply sNaN NaN -> NaN Invalid_operation +mulx649 multiply sNaN sNaN -> NaN Invalid_operation +mulx650 multiply NaN sNaN -> NaN Invalid_operation +mulx651 multiply -Inf sNaN -> NaN Invalid_operation +mulx652 multiply -1000 sNaN -> NaN Invalid_operation +mulx653 multiply -1 sNaN -> NaN Invalid_operation +mulx654 multiply -0 sNaN -> NaN Invalid_operation +mulx655 multiply 0 sNaN -> NaN Invalid_operation +mulx656 multiply 1 sNaN -> NaN Invalid_operation +mulx657 multiply 1000 sNaN -> NaN Invalid_operation +mulx658 multiply Inf sNaN -> NaN Invalid_operation +mulx659 multiply NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +mulx661 multiply NaN9 -Inf -> NaN9 +mulx662 multiply NaN8 999 -> NaN8 +mulx663 multiply NaN71 Inf -> NaN71 +mulx664 multiply NaN6 NaN5 -> NaN6 +mulx665 multiply -Inf NaN4 -> NaN4 +mulx666 multiply -999 NaN33 -> NaN33 +mulx667 multiply Inf NaN2 -> NaN2 + +mulx671 multiply sNaN99 -Inf -> NaN99 Invalid_operation +mulx672 multiply sNaN98 -11 -> NaN98 Invalid_operation +mulx673 multiply sNaN97 NaN -> NaN97 Invalid_operation +mulx674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation +mulx675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation +mulx676 multiply -Inf sNaN92 -> NaN92 Invalid_operation +mulx677 multiply 088 sNaN91 -> NaN91 Invalid_operation +mulx678 multiply Inf sNaN90 -> NaN90 Invalid_operation +mulx679 multiply NaN sNaN89 -> NaN89 Invalid_operation + +mulx681 multiply -NaN9 -Inf -> -NaN9 +mulx682 multiply -NaN8 999 -> -NaN8 +mulx683 multiply -NaN71 Inf -> -NaN71 +mulx684 multiply -NaN6 -NaN5 -> -NaN6 +mulx685 multiply -Inf -NaN4 -> -NaN4 +mulx686 multiply -999 -NaN33 -> -NaN33 +mulx687 multiply Inf -NaN2 -> -NaN2 + +mulx691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation +mulx692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation +mulx693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation +mulx694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation +mulx695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation +mulx696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation +mulx697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation +mulx698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation +mulx699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation + +mulx701 multiply -NaN -Inf -> -NaN +mulx702 multiply -NaN 999 -> -NaN +mulx703 multiply -NaN Inf -> -NaN +mulx704 multiply -NaN -NaN -> -NaN +mulx705 multiply -Inf -NaN0 -> -NaN +mulx706 multiply -999 -NaN -> -NaN +mulx707 multiply Inf -NaN -> -NaN + +mulx711 multiply -sNaN -Inf -> -NaN Invalid_operation +mulx712 multiply -sNaN -11 -> -NaN Invalid_operation +mulx713 multiply -sNaN00 NaN -> -NaN Invalid_operation +mulx714 multiply -sNaN -sNaN -> -NaN Invalid_operation +mulx715 multiply -NaN -sNaN -> -NaN Invalid_operation +mulx716 multiply -Inf -sNaN -> -NaN Invalid_operation +mulx717 multiply 088 -sNaN -> -NaN Invalid_operation +mulx718 multiply Inf -sNaN -> -NaN Invalid_operation +mulx719 multiply -NaN -sNaN -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +maxexponent: 999999999 +minexponent: -999999999 +mulx730 multiply +1.23456789012345E-0 9E+999999999 -> Infinity Inexact Overflow Rounded +mulx731 multiply 9E+999999999 +1.23456789012345E-0 -> Infinity Inexact Overflow Rounded +mulx732 multiply +0.100 9E-999999999 -> 9.00E-1000000000 Subnormal +mulx733 multiply 9E-999999999 +0.100 -> 9.00E-1000000000 Subnormal +mulx735 multiply -1.23456789012345E-0 9E+999999999 -> -Infinity Inexact Overflow Rounded +mulx736 multiply 9E+999999999 -1.23456789012345E-0 -> -Infinity Inexact Overflow Rounded +mulx737 multiply -0.100 9E-999999999 -> -9.00E-1000000000 Subnormal +mulx738 multiply 9E-999999999 -0.100 -> -9.00E-1000000000 Subnormal + +mulx739 multiply 1e-599999999 1e-400000001 -> 1E-1000000000 Subnormal +mulx740 multiply 1e-599999999 1e-400000000 -> 1E-999999999 +mulx741 multiply 1e-600000000 1e-400000000 -> 1E-1000000000 Subnormal +mulx742 multiply 9e-999999998 0.01 -> 9E-1000000000 Subnormal +mulx743 multiply 9e-999999998 0.1 -> 9E-999999999 +mulx744 multiply 0.01 9e-999999998 -> 9E-1000000000 Subnormal +mulx745 multiply 1e599999999 1e400000001 -> Infinity Overflow Inexact Rounded +mulx746 multiply 1e599999999 1e400000000 -> 1E+999999999 +mulx747 multiply 1e600000000 1e400000000 -> Infinity Overflow Inexact Rounded +mulx748 multiply 9e999999998 100 -> Infinity Overflow Inexact Rounded +mulx749 multiply 9e999999998 10 -> 9.0E+999999999 +mulx750 multiply 100 9e999999998 -> Infinity Overflow Inexact Rounded +-- signs +mulx751 multiply 1e+777777777 1e+411111111 -> Infinity Overflow Inexact Rounded +mulx752 multiply 1e+777777777 -1e+411111111 -> -Infinity Overflow Inexact Rounded +mulx753 multiply -1e+777777777 1e+411111111 -> -Infinity Overflow Inexact Rounded +mulx754 multiply -1e+777777777 -1e+411111111 -> Infinity Overflow Inexact Rounded +mulx755 multiply 1e-777777777 1e-411111111 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx756 multiply 1e-777777777 -1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx757 multiply -1e-777777777 1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx758 multiply -1e-777777777 -1e-411111111 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +precision: 9 +mulx760 multiply 1e-600000000 1e-400000001 -> 1E-1000000001 Subnormal +mulx761 multiply 1e-600000000 1e-400000002 -> 1E-1000000002 Subnormal +mulx762 multiply 1e-600000000 1e-400000003 -> 1E-1000000003 Subnormal +mulx763 multiply 1e-600000000 1e-400000004 -> 1E-1000000004 Subnormal +mulx764 multiply 1e-600000000 1e-400000005 -> 1E-1000000005 Subnormal +mulx765 multiply 1e-600000000 1e-400000006 -> 1E-1000000006 Subnormal +mulx766 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal +mulx767 multiply 1e-600000000 1e-400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx768 multiply 1e-600000000 1e-400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx769 multiply 1e-600000000 1e-400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +mulx770 multiply 1e+600000000 1e+400000001 -> Infinity Overflow Inexact Rounded +mulx771 multiply 1e+600000000 1e+400000002 -> Infinity Overflow Inexact Rounded +mulx772 multiply 1e+600000000 1e+400000003 -> Infinity Overflow Inexact Rounded +mulx773 multiply 1e+600000000 1e+400000004 -> Infinity Overflow Inexact Rounded +mulx774 multiply 1e+600000000 1e+400000005 -> Infinity Overflow Inexact Rounded +mulx775 multiply 1e+600000000 1e+400000006 -> Infinity Overflow Inexact Rounded +mulx776 multiply 1e+600000000 1e+400000007 -> Infinity Overflow Inexact Rounded +mulx777 multiply 1e+600000000 1e+400000008 -> Infinity Overflow Inexact Rounded +mulx778 multiply 1e+600000000 1e+400000009 -> Infinity Overflow Inexact Rounded +mulx779 multiply 1e+600000000 1e+400000010 -> Infinity Overflow Inexact Rounded + +-- 'subnormal' test edge condition at higher precisions +precision: 99 +mulx780 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal +mulx781 multiply 1e-600000000 1e-400000008 -> 1E-1000000008 Subnormal +mulx782 multiply 1e-600000000 1e-400000097 -> 1E-1000000097 Subnormal +mulx783 multiply 1e-600000000 1e-400000098 -> 0E-1000000097 Underflow Subnormal Inexact Rounded Clamped +precision: 999 +mulx784 multiply 1e-600000000 1e-400000997 -> 1E-1000000997 Subnormal +mulx785 multiply 1e-600000000 1e-400000998 -> 0E-1000000997 Underflow Subnormal Inexact Rounded Clamped + +-- following testcases [through mulx800] not yet run against code +precision: 9999 +mulx786 multiply 1e-600000000 1e-400009997 -> 1E-1000009997 Subnormal +mulx787 multiply 1e-600000000 1e-400009998 -> 0E-1000009997 Underflow Subnormal Inexact Rounded Clamped +precision: 99999 +mulx788 multiply 1e-600000000 1e-400099997 -> 1E-1000099997 Subnormal +mulx789 multiply 1e-600000000 1e-400099998 -> 0E-1000099997 Underflow Subnormal Inexact Rounded Clamped +precision: 999999 +mulx790 multiply 1e-600000000 1e-400999997 -> 1E-1000999997 Subnormal +mulx791 multiply 1e-600000000 1e-400999998 -> 0E-1000999997 Underflow Subnormal Inexact Rounded Clamped +precision: 9999999 +mulx792 multiply 1e-600000000 1e-409999997 -> 1E-1009999997 Subnormal +mulx793 multiply 1e-600000000 1e-409999998 -> 0E-1009999997 Underflow Subnormal Inexact Rounded Clamped +precision: 99999999 +mulx794 multiply 1e-600000000 1e-499999997 -> 1E-1099999997 Subnormal +mulx795 multiply 1e-600000000 1e-499999998 -> 0E-1099999997 Underflow Subnormal Inexact Rounded Clamped +precision: 999999999 +mulx796 multiply 1e-999999999 1e-999999997 -> 1E-1999999996 Subnormal +mulx797 multiply 1e-999999999 1e-999999998 -> 1E-1999999997 Subnormal +mulx798 multiply 1e-999999999 1e-999999999 -> 0E-1999999997 Underflow Subnormal Inexact Rounded Clamped +mulx799 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal +mulx800 multiply 1e-600000000 1e-400000008 -> 1E-1000000008 Subnormal + +-- test subnormals rounding +precision: 5 +maxExponent: 999 +minexponent: -999 +rounding: half_even + +mulx801 multiply 1.0000E-999 1 -> 1.0000E-999 +mulx802 multiply 1.000E-999 1e-1 -> 1.000E-1000 Subnormal +mulx803 multiply 1.00E-999 1e-2 -> 1.00E-1001 Subnormal +mulx804 multiply 1.0E-999 1e-3 -> 1.0E-1002 Subnormal +mulx805 multiply 1.0E-999 1e-4 -> 1E-1003 Subnormal Rounded +mulx806 multiply 1.3E-999 1e-4 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx807 multiply 1.5E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx808 multiply 1.7E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx809 multiply 2.3E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx810 multiply 2.5E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx811 multiply 2.7E-999 1e-4 -> 3E-1003 Underflow Subnormal Inexact Rounded +mulx812 multiply 1.49E-999 1e-4 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx813 multiply 1.50E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx814 multiply 1.51E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx815 multiply 2.49E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx816 multiply 2.50E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx817 multiply 2.51E-999 1e-4 -> 3E-1003 Underflow Subnormal Inexact Rounded + +mulx818 multiply 1E-999 1e-4 -> 1E-1003 Subnormal +mulx819 multiply 3E-999 1e-5 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx820 multiply 5E-999 1e-5 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx821 multiply 7E-999 1e-5 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx822 multiply 9E-999 1e-5 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx823 multiply 9.9E-999 1e-5 -> 1E-1003 Underflow Subnormal Inexact Rounded + +mulx824 multiply 1E-999 -1e-4 -> -1E-1003 Subnormal +mulx825 multiply 3E-999 -1e-5 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx826 multiply -5E-999 1e-5 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx827 multiply 7E-999 -1e-5 -> -1E-1003 Underflow Subnormal Inexact Rounded +mulx828 multiply -9E-999 1e-5 -> -1E-1003 Underflow Subnormal Inexact Rounded +mulx829 multiply 9.9E-999 -1e-5 -> -1E-1003 Underflow Subnormal Inexact Rounded +mulx830 multiply 3.0E-999 -1e-5 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped + +mulx831 multiply 1.0E-501 1e-501 -> 1.0E-1002 Subnormal +mulx832 multiply 2.0E-501 2e-501 -> 4.0E-1002 Subnormal +mulx833 multiply 4.0E-501 4e-501 -> 1.60E-1001 Subnormal +mulx834 multiply 10.0E-501 10e-501 -> 1.000E-1000 Subnormal +mulx835 multiply 30.0E-501 30e-501 -> 9.000E-1000 Subnormal +mulx836 multiply 40.0E-501 40e-501 -> 1.6000E-999 + +-- squares +mulx840 multiply 1E-502 1e-502 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx841 multiply 1E-501 1e-501 -> 1E-1002 Subnormal +mulx842 multiply 2E-501 2e-501 -> 4E-1002 Subnormal +mulx843 multiply 4E-501 4e-501 -> 1.6E-1001 Subnormal +mulx844 multiply 10E-501 10e-501 -> 1.00E-1000 Subnormal +mulx845 multiply 30E-501 30e-501 -> 9.00E-1000 Subnormal +mulx846 multiply 40E-501 40e-501 -> 1.600E-999 + +-- cubes +mulx850 multiply 1E-670 1e-335 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx851 multiply 1E-668 1e-334 -> 1E-1002 Subnormal +mulx852 multiply 4E-668 2e-334 -> 8E-1002 Subnormal +mulx853 multiply 9E-668 3e-334 -> 2.7E-1001 Subnormal +mulx854 multiply 16E-668 4e-334 -> 6.4E-1001 Subnormal +mulx855 multiply 25E-668 5e-334 -> 1.25E-1000 Subnormal +mulx856 multiply 10E-668 100e-334 -> 1.000E-999 + +-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent +precision: 19 +mulx860 multiply 6636851557994578716E-520 6636851557994578716E-520 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded + +-- Long operand overflow may be a different path +precision: 3 +maxExponent: 999999999 +minexponent: -999999999 +mulx870 multiply 1 9.999E+999999999 -> Infinity Inexact Overflow Rounded +mulx871 multiply 1 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded +mulx872 multiply 9.999E+999999999 1 -> Infinity Inexact Overflow Rounded +mulx873 multiply -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +mulx881 multiply 1.2347E-40 1.2347E-40 -> 1.524E-80 Inexact Rounded Subnormal Underflow +mulx882 multiply 1.234E-40 1.234E-40 -> 1.523E-80 Inexact Rounded Subnormal Underflow +mulx883 multiply 1.23E-40 1.23E-40 -> 1.513E-80 Inexact Rounded Subnormal Underflow +mulx884 multiply 1.2E-40 1.2E-40 -> 1.44E-80 Subnormal +mulx885 multiply 1.2E-40 1.2E-41 -> 1.44E-81 Subnormal +mulx886 multiply 1.2E-40 1.2E-42 -> 1.4E-82 Subnormal Inexact Rounded Underflow +mulx887 multiply 1.2E-40 1.3E-42 -> 1.6E-82 Subnormal Inexact Rounded Underflow +mulx888 multiply 1.3E-40 1.3E-42 -> 1.7E-82 Subnormal Inexact Rounded Underflow +mulx889 multiply 1.3E-40 1.3E-43 -> 2E-83 Subnormal Inexact Rounded Underflow +mulx890 multiply 1.3E-41 1.3E-43 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow + +mulx891 multiply 1.2345E-39 1.234E-40 -> 1.5234E-79 Inexact Rounded +mulx892 multiply 1.23456E-39 1.234E-40 -> 1.5234E-79 Inexact Rounded +mulx893 multiply 1.2345E-40 1.234E-40 -> 1.523E-80 Inexact Rounded Subnormal Underflow +mulx894 multiply 1.23456E-40 1.234E-40 -> 1.523E-80 Inexact Rounded Subnormal Underflow +mulx895 multiply 1.2345E-41 1.234E-40 -> 1.52E-81 Inexact Rounded Subnormal Underflow +mulx896 multiply 1.23456E-41 1.234E-40 -> 1.52E-81 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +mulx900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded +mulx901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded +mulx902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded +mulx903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded +mulx904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded +mulx905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded +-- prove operands are exact +mulx906 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383 +mulx907 multiply 1 0.09999999999999999 -> 0.09999999999999999 +-- the next rounds to Nmin +mulx908 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +mulx909 multiply 9.999999999999999E-383 0.099999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +mulx910 multiply 9.999999999999999E-383 0.0999999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +mulx911 multiply 9.999999999999999E-383 0.09999999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +mulx1001 multiply 130E-2 120E-2 -> 1.5600 +mulx1002 multiply 130E-2 12E-1 -> 1.560 +mulx1003 multiply 130E-2 1E0 -> 1.30 +mulx1004 multiply 1E2 1E4 -> 1E+6 + +-- payload decapitate +precision: 5 +mulx1010 multiply 11 -sNaN1234567890 -> -NaN67890 Invalid_operation + +-- Null tests +mulx990 multiply 10 # -> NaN Invalid_operation +mulx991 multiply # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nextminus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nextminus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,148 @@ +------------------------------------------------------------------------ +-- nextminus.decTest -- decimal next that is less [754r nextdown] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +nextm001 nextminus 0.999999995 -> 0.999999994 +nextm002 nextminus 0.999999996 -> 0.999999995 +nextm003 nextminus 0.999999997 -> 0.999999996 +nextm004 nextminus 0.999999998 -> 0.999999997 +nextm005 nextminus 0.999999999 -> 0.999999998 +nextm006 nextminus 1.00000000 -> 0.999999999 +nextm007 nextminus 1.0 -> 0.999999999 +nextm008 nextminus 1 -> 0.999999999 +nextm009 nextminus 1.00000001 -> 1.00000000 +nextm010 nextminus 1.00000002 -> 1.00000001 +nextm011 nextminus 1.00000003 -> 1.00000002 +nextm012 nextminus 1.00000004 -> 1.00000003 +nextm013 nextminus 1.00000005 -> 1.00000004 +nextm014 nextminus 1.00000006 -> 1.00000005 +nextm015 nextminus 1.00000007 -> 1.00000006 +nextm016 nextminus 1.00000008 -> 1.00000007 +nextm017 nextminus 1.00000009 -> 1.00000008 +nextm018 nextminus 1.00000010 -> 1.00000009 +nextm019 nextminus 1.00000011 -> 1.00000010 +nextm020 nextminus 1.00000012 -> 1.00000011 + +nextm021 nextminus -0.999999995 -> -0.999999996 +nextm022 nextminus -0.999999996 -> -0.999999997 +nextm023 nextminus -0.999999997 -> -0.999999998 +nextm024 nextminus -0.999999998 -> -0.999999999 +nextm025 nextminus -0.999999999 -> -1.00000000 +nextm026 nextminus -1.00000000 -> -1.00000001 +nextm027 nextminus -1.0 -> -1.00000001 +nextm028 nextminus -1 -> -1.00000001 +nextm029 nextminus -1.00000001 -> -1.00000002 +nextm030 nextminus -1.00000002 -> -1.00000003 +nextm031 nextminus -1.00000003 -> -1.00000004 +nextm032 nextminus -1.00000004 -> -1.00000005 +nextm033 nextminus -1.00000005 -> -1.00000006 +nextm034 nextminus -1.00000006 -> -1.00000007 +nextm035 nextminus -1.00000007 -> -1.00000008 +nextm036 nextminus -1.00000008 -> -1.00000009 +nextm037 nextminus -1.00000009 -> -1.00000010 +nextm038 nextminus -1.00000010 -> -1.00000011 +nextm039 nextminus -1.00000011 -> -1.00000012 + +-- input operand is >precision +nextm041 nextminus 1.00000010998 -> 1.00000010 +nextm042 nextminus 1.00000010999 -> 1.00000010 +nextm043 nextminus 1.00000011000 -> 1.00000010 +nextm044 nextminus 1.00000011001 -> 1.00000011 +nextm045 nextminus 1.00000011002 -> 1.00000011 +nextm046 nextminus 1.00000011002 -> 1.00000011 +nextm047 nextminus 1.00000011052 -> 1.00000011 +nextm048 nextminus 1.00000011552 -> 1.00000011 +nextm049 nextminus -1.00000010998 -> -1.00000011 +nextm050 nextminus -1.00000010999 -> -1.00000011 +nextm051 nextminus -1.00000011000 -> -1.00000012 +nextm052 nextminus -1.00000011001 -> -1.00000012 +nextm053 nextminus -1.00000011002 -> -1.00000012 +nextm054 nextminus -1.00000011002 -> -1.00000012 +nextm055 nextminus -1.00000011052 -> -1.00000012 +nextm056 nextminus -1.00000011552 -> -1.00000012 +-- ultra-tiny inputs +nextm060 nextminus 1E-99999 -> 0E-391 +nextm061 nextminus 1E-999999999 -> 0E-391 +nextm062 nextminus 1E-391 -> 0E-391 +nextm063 nextminus -1E-99999 -> -1E-391 +nextm064 nextminus -1E-999999999 -> -1E-391 +nextm065 nextminus -1E-391 -> -2E-391 + +-- Zeros +nextm100 nextminus -0 -> -1E-391 +nextm101 nextminus 0 -> -1E-391 +nextm102 nextminus 0.00 -> -1E-391 +nextm103 nextminus -0.00 -> -1E-391 +nextm104 nextminus 0E-300 -> -1E-391 +nextm105 nextminus 0E+300 -> -1E-391 +nextm106 nextminus 0E+30000 -> -1E-391 +nextm107 nextminus -0E+30000 -> -1E-391 + +precision: 9 +maxExponent: 999 +minexponent: -999 +-- specials +nextm150 nextminus Inf -> 9.99999999E+999 +nextm151 nextminus -Inf -> -Infinity +nextm152 nextminus NaN -> NaN +nextm153 nextminus sNaN -> NaN Invalid_operation +nextm154 nextminus NaN77 -> NaN77 +nextm155 nextminus sNaN88 -> NaN88 Invalid_operation +nextm156 nextminus -NaN -> -NaN +nextm157 nextminus -sNaN -> -NaN Invalid_operation +nextm158 nextminus -NaN77 -> -NaN77 +nextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +nextm170 nextminus 9.99999999E+999 -> 9.99999998E+999 +nextm171 nextminus 9.99999998E+999 -> 9.99999997E+999 +nextm172 nextminus 1E-999 -> 9.9999999E-1000 +nextm173 nextminus 1.00000000E-999 -> 9.9999999E-1000 +nextm174 nextminus 9E-1007 -> 8E-1007 +nextm175 nextminus 9.9E-1006 -> 9.8E-1006 +nextm176 nextminus 9.9999E-1003 -> 9.9998E-1003 +nextm177 nextminus 9.9999999E-1000 -> 9.9999998E-1000 +nextm178 nextminus 9.9999998E-1000 -> 9.9999997E-1000 +nextm179 nextminus 9.9999997E-1000 -> 9.9999996E-1000 +nextm180 nextminus 0E-1007 -> -1E-1007 +nextm181 nextminus 1E-1007 -> 0E-1007 +nextm182 nextminus 2E-1007 -> 1E-1007 + +nextm183 nextminus -0E-1007 -> -1E-1007 +nextm184 nextminus -1E-1007 -> -2E-1007 +nextm185 nextminus -2E-1007 -> -3E-1007 +nextm186 nextminus -10E-1007 -> -1.1E-1006 +nextm187 nextminus -100E-1007 -> -1.01E-1005 +nextm188 nextminus -100000E-1007 -> -1.00001E-1002 +nextm189 nextminus -1.0000E-999 -> -1.00000001E-999 +nextm190 nextminus -1.00000000E-999 -> -1.00000001E-999 +nextm191 nextminus -1E-999 -> -1.00000001E-999 +nextm192 nextminus -9.99999998E+999 -> -9.99999999E+999 +nextm193 nextminus -9.99999999E+999 -> -Infinity + +-- Null tests +nextm900 nextminus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nextplus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nextplus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,150 @@ +------------------------------------------------------------------------ +-- nextplus.decTest -- decimal next that is greater [754r nextup] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +nextp001 nextplus 0.999999995 -> 0.999999996 +nextp002 nextplus 0.999999996 -> 0.999999997 +nextp003 nextplus 0.999999997 -> 0.999999998 +nextp004 nextplus 0.999999998 -> 0.999999999 +nextp005 nextplus 0.999999999 -> 1.00000000 +nextp006 nextplus 1.00000000 -> 1.00000001 +nextp007 nextplus 1.0 -> 1.00000001 +nextp008 nextplus 1 -> 1.00000001 +nextp009 nextplus 1.00000001 -> 1.00000002 +nextp010 nextplus 1.00000002 -> 1.00000003 +nextp011 nextplus 1.00000003 -> 1.00000004 +nextp012 nextplus 1.00000004 -> 1.00000005 +nextp013 nextplus 1.00000005 -> 1.00000006 +nextp014 nextplus 1.00000006 -> 1.00000007 +nextp015 nextplus 1.00000007 -> 1.00000008 +nextp016 nextplus 1.00000008 -> 1.00000009 +nextp017 nextplus 1.00000009 -> 1.00000010 +nextp018 nextplus 1.00000010 -> 1.00000011 +nextp019 nextplus 1.00000011 -> 1.00000012 + +nextp021 nextplus -0.999999995 -> -0.999999994 +nextp022 nextplus -0.999999996 -> -0.999999995 +nextp023 nextplus -0.999999997 -> -0.999999996 +nextp024 nextplus -0.999999998 -> -0.999999997 +nextp025 nextplus -0.999999999 -> -0.999999998 +nextp026 nextplus -1.00000000 -> -0.999999999 +nextp027 nextplus -1.0 -> -0.999999999 +nextp028 nextplus -1 -> -0.999999999 +nextp029 nextplus -1.00000001 -> -1.00000000 +nextp030 nextplus -1.00000002 -> -1.00000001 +nextp031 nextplus -1.00000003 -> -1.00000002 +nextp032 nextplus -1.00000004 -> -1.00000003 +nextp033 nextplus -1.00000005 -> -1.00000004 +nextp034 nextplus -1.00000006 -> -1.00000005 +nextp035 nextplus -1.00000007 -> -1.00000006 +nextp036 nextplus -1.00000008 -> -1.00000007 +nextp037 nextplus -1.00000009 -> -1.00000008 +nextp038 nextplus -1.00000010 -> -1.00000009 +nextp039 nextplus -1.00000011 -> -1.00000010 +nextp040 nextplus -1.00000012 -> -1.00000011 + +-- input operand is >precision +nextp041 nextplus 1.00000010998 -> 1.00000011 +nextp042 nextplus 1.00000010999 -> 1.00000011 +nextp043 nextplus 1.00000011000 -> 1.00000012 +nextp044 nextplus 1.00000011001 -> 1.00000012 +nextp045 nextplus 1.00000011002 -> 1.00000012 +nextp046 nextplus 1.00000011002 -> 1.00000012 +nextp047 nextplus 1.00000011052 -> 1.00000012 +nextp048 nextplus 1.00000011552 -> 1.00000012 +nextp049 nextplus -1.00000010998 -> -1.00000010 +nextp050 nextplus -1.00000010999 -> -1.00000010 +nextp051 nextplus -1.00000011000 -> -1.00000010 +nextp052 nextplus -1.00000011001 -> -1.00000011 +nextp053 nextplus -1.00000011002 -> -1.00000011 +nextp054 nextplus -1.00000011002 -> -1.00000011 +nextp055 nextplus -1.00000011052 -> -1.00000011 +nextp056 nextplus -1.00000011552 -> -1.00000011 +-- ultra-tiny inputs +nextp060 nextplus 1E-99999 -> 1E-391 +nextp061 nextplus 1E-999999999 -> 1E-391 +nextp062 nextplus 1E-391 -> 2E-391 +nextp063 nextplus -1E-99999 -> -0E-391 +nextp064 nextplus -1E-999999999 -> -0E-391 +nextp065 nextplus -1E-391 -> -0E-391 + +-- Zeros +nextp100 nextplus 0 -> 1E-391 +nextp101 nextplus 0.00 -> 1E-391 +nextp102 nextplus 0E-300 -> 1E-391 +nextp103 nextplus 0E+300 -> 1E-391 +nextp104 nextplus 0E+30000 -> 1E-391 +nextp105 nextplus -0 -> 1E-391 +nextp106 nextplus -0.00 -> 1E-391 +nextp107 nextplus -0E-300 -> 1E-391 +nextp108 nextplus -0E+300 -> 1E-391 +nextp109 nextplus -0E+30000 -> 1E-391 + +maxExponent: 999 +minexponent: -999 +precision: 9 +-- specials +nextp150 nextplus Inf -> Infinity +nextp151 nextplus -Inf -> -9.99999999E+999 +nextp152 nextplus NaN -> NaN +nextp153 nextplus sNaN -> NaN Invalid_operation +nextp154 nextplus NaN77 -> NaN77 +nextp155 nextplus sNaN88 -> NaN88 Invalid_operation +nextp156 nextplus -NaN -> -NaN +nextp157 nextplus -sNaN -> -NaN Invalid_operation +nextp158 nextplus -NaN77 -> -NaN77 +nextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +nextp170 nextplus 9.99999999E+999 -> Infinity +nextp171 nextplus 9.99999998E+999 -> 9.99999999E+999 +nextp172 nextplus 1E-999 -> 1.00000001E-999 +nextp173 nextplus 1.00000000E-999 -> 1.00000001E-999 +nextp174 nextplus 9E-1007 -> 1.0E-1006 +nextp175 nextplus 9.9E-1006 -> 1.00E-1005 +nextp176 nextplus 9.9999E-1003 -> 1.00000E-1002 +nextp177 nextplus 9.9999999E-1000 -> 1.00000000E-999 +nextp178 nextplus 9.9999998E-1000 -> 9.9999999E-1000 +nextp179 nextplus 9.9999997E-1000 -> 9.9999998E-1000 +nextp180 nextplus 0E-1007 -> 1E-1007 +nextp181 nextplus 1E-1007 -> 2E-1007 +nextp182 nextplus 2E-1007 -> 3E-1007 + +nextp183 nextplus -0E-1007 -> 1E-1007 +nextp184 nextplus -1E-1007 -> -0E-1007 +nextp185 nextplus -2E-1007 -> -1E-1007 +nextp186 nextplus -10E-1007 -> -9E-1007 +nextp187 nextplus -100E-1007 -> -9.9E-1006 +nextp188 nextplus -100000E-1007 -> -9.9999E-1003 +nextp189 nextplus -1.0000E-999 -> -9.9999999E-1000 +nextp190 nextplus -1.00000000E-999 -> -9.9999999E-1000 +nextp191 nextplus -1E-999 -> -9.9999999E-1000 +nextp192 nextplus -9.99999998E+999 -> -9.99999997E+999 +nextp193 nextplus -9.99999999E+999 -> -9.99999998E+999 + +-- Null tests +nextp900 nextplus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nexttoward.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/nexttoward.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,426 @@ +------------------------------------------------------------------------ +-- nexttoward.decTest -- decimal next toward rhs [754r nextafter] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- Sanity check with a scattering of numerics +nextt001 nexttoward 10 10 -> 10 +nextt002 nexttoward -10 -10 -> -10 +nextt003 nexttoward 1 10 -> 1.00000001 +nextt004 nexttoward 1 -10 -> 0.999999999 +nextt005 nexttoward -1 10 -> -0.999999999 +nextt006 nexttoward -1 -10 -> -1.00000001 +nextt007 nexttoward 0 10 -> 1E-391 Underflow Subnormal Inexact Rounded +nextt008 nexttoward 0 -10 -> -1E-391 Underflow Subnormal Inexact Rounded +nextt009 nexttoward 9.99999999E+384 +Infinity -> Infinity Overflow Inexact Rounded +nextt010 nexttoward -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded + +------- lhs=rhs +-- finites +nextt101 nexttoward 7 7 -> 7 +nextt102 nexttoward -7 -7 -> -7 +nextt103 nexttoward 75 75 -> 75 +nextt104 nexttoward -75 -75 -> -75 +nextt105 nexttoward 7.50 7.5 -> 7.50 +nextt106 nexttoward -7.50 -7.50 -> -7.50 +nextt107 nexttoward 7.500 7.5000 -> 7.500 +nextt108 nexttoward -7.500 -7.5 -> -7.500 + +-- zeros +nextt111 nexttoward 0 0 -> 0 +nextt112 nexttoward -0 -0 -> -0 +nextt113 nexttoward 0E+4 0 -> 0E+4 +nextt114 nexttoward -0E+4 -0 -> -0E+4 +nextt115 nexttoward 0.0000 0.00000 -> 0.0000 +nextt116 nexttoward -0.0000 -0.00 -> -0.0000 +nextt117 nexttoward 0E-141 0 -> 0E-141 +nextt118 nexttoward -0E-141 -000 -> -0E-141 + +-- full coefficients, alternating bits +nextt121 nexttoward 268268268 268268268 -> 268268268 +nextt122 nexttoward -268268268 -268268268 -> -268268268 +nextt123 nexttoward 134134134 134134134 -> 134134134 +nextt124 nexttoward -134134134 -134134134 -> -134134134 + +-- Nmax, Nmin, Ntiny +nextt131 nexttoward 9.99999999E+384 9.99999999E+384 -> 9.99999999E+384 +nextt132 nexttoward 1E-383 1E-383 -> 1E-383 +nextt133 nexttoward 1.00000000E-383 1.00000000E-383 -> 1.00000000E-383 +nextt134 nexttoward 1E-391 1E-391 -> 1E-391 + +nextt135 nexttoward -1E-391 -1E-391 -> -1E-391 +nextt136 nexttoward -1.00000000E-383 -1.00000000E-383 -> -1.00000000E-383 +nextt137 nexttoward -1E-383 -1E-383 -> -1E-383 +nextt138 nexttoward -9.99999999E+384 -9.99999999E+384 -> -9.99999999E+384 + +------- lhs 0.999999996 +nextt202 nexttoward 0.999999996 Infinity -> 0.999999997 +nextt203 nexttoward 0.999999997 Infinity -> 0.999999998 +nextt204 nexttoward 0.999999998 Infinity -> 0.999999999 +nextt205 nexttoward 0.999999999 Infinity -> 1.00000000 +nextt206 nexttoward 1.00000000 Infinity -> 1.00000001 +nextt207 nexttoward 1.0 Infinity -> 1.00000001 +nextt208 nexttoward 1 Infinity -> 1.00000001 +nextt209 nexttoward 1.00000001 Infinity -> 1.00000002 +nextt210 nexttoward 1.00000002 Infinity -> 1.00000003 +nextt211 nexttoward 1.00000003 Infinity -> 1.00000004 +nextt212 nexttoward 1.00000004 Infinity -> 1.00000005 +nextt213 nexttoward 1.00000005 Infinity -> 1.00000006 +nextt214 nexttoward 1.00000006 Infinity -> 1.00000007 +nextt215 nexttoward 1.00000007 Infinity -> 1.00000008 +nextt216 nexttoward 1.00000008 Infinity -> 1.00000009 +nextt217 nexttoward 1.00000009 Infinity -> 1.00000010 +nextt218 nexttoward 1.00000010 Infinity -> 1.00000011 +nextt219 nexttoward 1.00000011 Infinity -> 1.00000012 + +nextt221 nexttoward -0.999999995 Infinity -> -0.999999994 +nextt222 nexttoward -0.999999996 Infinity -> -0.999999995 +nextt223 nexttoward -0.999999997 Infinity -> -0.999999996 +nextt224 nexttoward -0.999999998 Infinity -> -0.999999997 +nextt225 nexttoward -0.999999999 Infinity -> -0.999999998 +nextt226 nexttoward -1.00000000 Infinity -> -0.999999999 +nextt227 nexttoward -1.0 Infinity -> -0.999999999 +nextt228 nexttoward -1 Infinity -> -0.999999999 +nextt229 nexttoward -1.00000001 Infinity -> -1.00000000 +nextt230 nexttoward -1.00000002 Infinity -> -1.00000001 +nextt231 nexttoward -1.00000003 Infinity -> -1.00000002 +nextt232 nexttoward -1.00000004 Infinity -> -1.00000003 +nextt233 nexttoward -1.00000005 Infinity -> -1.00000004 +nextt234 nexttoward -1.00000006 Infinity -> -1.00000005 +nextt235 nexttoward -1.00000007 Infinity -> -1.00000006 +nextt236 nexttoward -1.00000008 Infinity -> -1.00000007 +nextt237 nexttoward -1.00000009 Infinity -> -1.00000008 +nextt238 nexttoward -1.00000010 Infinity -> -1.00000009 +nextt239 nexttoward -1.00000011 Infinity -> -1.00000010 +nextt240 nexttoward -1.00000012 Infinity -> -1.00000011 + +-- input operand is >precision +nextt241 nexttoward 1.00000010998 Infinity -> 1.00000011 +nextt242 nexttoward 1.00000010999 Infinity -> 1.00000011 +nextt243 nexttoward 1.00000011000 Infinity -> 1.00000012 +nextt244 nexttoward 1.00000011001 Infinity -> 1.00000012 +nextt245 nexttoward 1.00000011002 Infinity -> 1.00000012 +nextt246 nexttoward 1.00000011002 Infinity -> 1.00000012 +nextt247 nexttoward 1.00000011052 Infinity -> 1.00000012 +nextt248 nexttoward 1.00000011552 Infinity -> 1.00000012 +nextt249 nexttoward -1.00000010998 Infinity -> -1.00000010 +nextt250 nexttoward -1.00000010999 Infinity -> -1.00000010 +nextt251 nexttoward -1.00000011000 Infinity -> -1.00000010 +nextt252 nexttoward -1.00000011001 Infinity -> -1.00000011 +nextt253 nexttoward -1.00000011002 Infinity -> -1.00000011 +nextt254 nexttoward -1.00000011002 Infinity -> -1.00000011 +nextt255 nexttoward -1.00000011052 Infinity -> -1.00000011 +nextt256 nexttoward -1.00000011552 Infinity -> -1.00000011 +-- ultra-tiny inputs +nextt260 nexttoward 1E-99999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt261 nexttoward 1E-999999999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt262 nexttoward 1E-391 Infinity -> 2E-391 Underflow Subnormal Inexact Rounded +nextt263 nexttoward -1E-99999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped +nextt264 nexttoward -1E-999999999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped +nextt265 nexttoward -1E-391 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped + +-- Zeros +nextt300 nexttoward 0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt301 nexttoward 0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt302 nexttoward 0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt303 nexttoward 0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt304 nexttoward 0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt305 nexttoward -0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt306 nexttoward -0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt307 nexttoward -0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt308 nexttoward -0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded +nextt309 nexttoward -0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded + +-- specials +nextt350 nexttoward Inf Infinity -> Infinity +nextt351 nexttoward -Inf Infinity -> -9.99999999E+384 +nextt352 nexttoward NaN Infinity -> NaN +nextt353 nexttoward sNaN Infinity -> NaN Invalid_operation +nextt354 nexttoward NaN77 Infinity -> NaN77 +nextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation +nextt356 nexttoward -NaN Infinity -> -NaN +nextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation +nextt358 nexttoward -NaN77 Infinity -> -NaN77 +nextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +maxExponent: 999 +minexponent: -999 +nextt370 nexttoward 9.99999999E+999 Infinity -> Infinity Overflow Inexact Rounded +nextt371 nexttoward 9.99999998E+999 Infinity -> 9.99999999E+999 +nextt372 nexttoward 1E-999 Infinity -> 1.00000001E-999 +nextt373 nexttoward 1.00000000E-999 Infinity -> 1.00000001E-999 +nextt374 nexttoward 0.999999999E-999 Infinity -> 1.00000000E-999 +nextt375 nexttoward 0.99999999E-999 Infinity -> 1.00000000E-999 +nextt376 nexttoward 9E-1007 Infinity -> 1.0E-1006 Underflow Subnormal Inexact Rounded +nextt377 nexttoward 9.9E-1006 Infinity -> 1.00E-1005 Underflow Subnormal Inexact Rounded +nextt378 nexttoward 9.9999E-1003 Infinity -> 1.00000E-1002 Underflow Subnormal Inexact Rounded +nextt379 nexttoward 9.9999998E-1000 Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded +nextt380 nexttoward 9.9999997E-1000 Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded +nextt381 nexttoward 0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded +nextt382 nexttoward 1E-1007 Infinity -> 2E-1007 Underflow Subnormal Inexact Rounded +nextt383 nexttoward 2E-1007 Infinity -> 3E-1007 Underflow Subnormal Inexact Rounded + +nextt385 nexttoward -0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded +nextt386 nexttoward -1E-1007 Infinity -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped +nextt387 nexttoward -2E-1007 Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded +nextt388 nexttoward -10E-1007 Infinity -> -9E-1007 Underflow Subnormal Inexact Rounded +nextt389 nexttoward -100E-1007 Infinity -> -9.9E-1006 Underflow Subnormal Inexact Rounded +nextt390 nexttoward -100000E-1007 Infinity -> -9.9999E-1003 Underflow Subnormal Inexact Rounded +nextt391 nexttoward -1.0000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded +nextt392 nexttoward -1.00000000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded +nextt393 nexttoward -1E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded +nextt394 nexttoward -9.99999998E+999 Infinity -> -9.99999997E+999 +nextt395 nexttoward -9.99999999E+999 Infinity -> -9.99999998E+999 + +------- lhs>rhs +maxExponent: 384 +minexponent: -383 +nextt401 nexttoward 0.999999995 -Infinity -> 0.999999994 +nextt402 nexttoward 0.999999996 -Infinity -> 0.999999995 +nextt403 nexttoward 0.999999997 -Infinity -> 0.999999996 +nextt404 nexttoward 0.999999998 -Infinity -> 0.999999997 +nextt405 nexttoward 0.999999999 -Infinity -> 0.999999998 +nextt406 nexttoward 1.00000000 -Infinity -> 0.999999999 +nextt407 nexttoward 1.0 -Infinity -> 0.999999999 +nextt408 nexttoward 1 -Infinity -> 0.999999999 +nextt409 nexttoward 1.00000001 -Infinity -> 1.00000000 +nextt410 nexttoward 1.00000002 -Infinity -> 1.00000001 +nextt411 nexttoward 1.00000003 -Infinity -> 1.00000002 +nextt412 nexttoward 1.00000004 -Infinity -> 1.00000003 +nextt413 nexttoward 1.00000005 -Infinity -> 1.00000004 +nextt414 nexttoward 1.00000006 -Infinity -> 1.00000005 +nextt415 nexttoward 1.00000007 -Infinity -> 1.00000006 +nextt416 nexttoward 1.00000008 -Infinity -> 1.00000007 +nextt417 nexttoward 1.00000009 -Infinity -> 1.00000008 +nextt418 nexttoward 1.00000010 -Infinity -> 1.00000009 +nextt419 nexttoward 1.00000011 -Infinity -> 1.00000010 +nextt420 nexttoward 1.00000012 -Infinity -> 1.00000011 + +nextt421 nexttoward -0.999999995 -Infinity -> -0.999999996 +nextt422 nexttoward -0.999999996 -Infinity -> -0.999999997 +nextt423 nexttoward -0.999999997 -Infinity -> -0.999999998 +nextt424 nexttoward -0.999999998 -Infinity -> -0.999999999 +nextt425 nexttoward -0.999999999 -Infinity -> -1.00000000 +nextt426 nexttoward -1.00000000 -Infinity -> -1.00000001 +nextt427 nexttoward -1.0 -Infinity -> -1.00000001 +nextt428 nexttoward -1 -Infinity -> -1.00000001 +nextt429 nexttoward -1.00000001 -Infinity -> -1.00000002 +nextt430 nexttoward -1.00000002 -Infinity -> -1.00000003 +nextt431 nexttoward -1.00000003 -Infinity -> -1.00000004 +nextt432 nexttoward -1.00000004 -Infinity -> -1.00000005 +nextt433 nexttoward -1.00000005 -Infinity -> -1.00000006 +nextt434 nexttoward -1.00000006 -Infinity -> -1.00000007 +nextt435 nexttoward -1.00000007 -Infinity -> -1.00000008 +nextt436 nexttoward -1.00000008 -Infinity -> -1.00000009 +nextt437 nexttoward -1.00000009 -Infinity -> -1.00000010 +nextt438 nexttoward -1.00000010 -Infinity -> -1.00000011 +nextt439 nexttoward -1.00000011 -Infinity -> -1.00000012 + +-- input operand is >precision +nextt441 nexttoward 1.00000010998 -Infinity -> 1.00000010 +nextt442 nexttoward 1.00000010999 -Infinity -> 1.00000010 +nextt443 nexttoward 1.00000011000 -Infinity -> 1.00000010 +nextt444 nexttoward 1.00000011001 -Infinity -> 1.00000011 +nextt445 nexttoward 1.00000011002 -Infinity -> 1.00000011 +nextt446 nexttoward 1.00000011002 -Infinity -> 1.00000011 +nextt447 nexttoward 1.00000011052 -Infinity -> 1.00000011 +nextt448 nexttoward 1.00000011552 -Infinity -> 1.00000011 +nextt449 nexttoward -1.00000010998 -Infinity -> -1.00000011 +nextt450 nexttoward -1.00000010999 -Infinity -> -1.00000011 +nextt451 nexttoward -1.00000011000 -Infinity -> -1.00000012 +nextt452 nexttoward -1.00000011001 -Infinity -> -1.00000012 +nextt453 nexttoward -1.00000011002 -Infinity -> -1.00000012 +nextt454 nexttoward -1.00000011002 -Infinity -> -1.00000012 +nextt455 nexttoward -1.00000011052 -Infinity -> -1.00000012 +nextt456 nexttoward -1.00000011552 -Infinity -> -1.00000012 +-- ultra-tiny inputs +nextt460 nexttoward 1E-99999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped +nextt461 nexttoward 1E-999999999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped +nextt462 nexttoward 1E-391 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped +nextt463 nexttoward -1E-99999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt464 nexttoward -1E-999999999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt465 nexttoward -1E-391 -Infinity -> -2E-391 Underflow Subnormal Inexact Rounded + +-- Zeros +nextt500 nexttoward -0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt501 nexttoward 0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt502 nexttoward 0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt503 nexttoward -0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt504 nexttoward 0E-300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt505 nexttoward 0E+300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt506 nexttoward 0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt507 nexttoward -0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded +nextt508 nexttoward 0.00 -0.0000 -> -0.00 + +-- specials +nextt550 nexttoward Inf -Infinity -> 9.99999999E+384 +nextt551 nexttoward -Inf -Infinity -> -Infinity +nextt552 nexttoward NaN -Infinity -> NaN +nextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation +nextt554 nexttoward NaN77 -Infinity -> NaN77 +nextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation +nextt556 nexttoward -NaN -Infinity -> -NaN +nextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation +nextt558 nexttoward -NaN77 -Infinity -> -NaN77 +nextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation + +-- Nmax, Nmin, Ntiny, subnormals +maxExponent: 999 +minexponent: -999 +nextt570 nexttoward 9.99999999E+999 -Infinity -> 9.99999998E+999 +nextt571 nexttoward 9.99999998E+999 -Infinity -> 9.99999997E+999 +nextt572 nexttoward 1E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded +nextt573 nexttoward 1.00000000E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded +nextt574 nexttoward 9E-1007 -Infinity -> 8E-1007 Underflow Subnormal Inexact Rounded +nextt575 nexttoward 9.9E-1006 -Infinity -> 9.8E-1006 Underflow Subnormal Inexact Rounded +nextt576 nexttoward 9.9999E-1003 -Infinity -> 9.9998E-1003 Underflow Subnormal Inexact Rounded +nextt577 nexttoward 9.9999999E-1000 -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded +nextt578 nexttoward 9.9999998E-1000 -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded +nextt579 nexttoward 9.9999997E-1000 -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded +nextt580 nexttoward 0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded +nextt581 nexttoward 1E-1007 -Infinity -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped +nextt582 nexttoward 2E-1007 -Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded + +nextt583 nexttoward -0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded +nextt584 nexttoward -1E-1007 -Infinity -> -2E-1007 Underflow Subnormal Inexact Rounded +nextt585 nexttoward -2E-1007 -Infinity -> -3E-1007 Underflow Subnormal Inexact Rounded +nextt586 nexttoward -10E-1007 -Infinity -> -1.1E-1006 Underflow Subnormal Inexact Rounded +nextt587 nexttoward -100E-1007 -Infinity -> -1.01E-1005 Underflow Subnormal Inexact Rounded +nextt588 nexttoward -100000E-1007 -Infinity -> -1.00001E-1002 Underflow Subnormal Inexact Rounded +nextt589 nexttoward -1.0000E-999 -Infinity -> -1.00000001E-999 +nextt590 nexttoward -1.00000000E-999 -Infinity -> -1.00000001E-999 +nextt591 nexttoward -1E-999 -Infinity -> -1.00000001E-999 +nextt592 nexttoward -9.99999998E+999 -Infinity -> -9.99999999E+999 +nextt593 nexttoward -9.99999999E+999 -Infinity -> -Infinity Overflow Inexact Rounded + + + + +------- Specials +maxExponent: 384 +minexponent: -383 +nextt780 nexttoward -Inf -Inf -> -Infinity +nextt781 nexttoward -Inf -1000 -> -9.99999999E+384 +nextt782 nexttoward -Inf -1 -> -9.99999999E+384 +nextt783 nexttoward -Inf -0 -> -9.99999999E+384 +nextt784 nexttoward -Inf 0 -> -9.99999999E+384 +nextt785 nexttoward -Inf 1 -> -9.99999999E+384 +nextt786 nexttoward -Inf 1000 -> -9.99999999E+384 +nextt787 nexttoward -1000 -Inf -> -1000.00001 +nextt788 nexttoward -Inf -Inf -> -Infinity +nextt789 nexttoward -1 -Inf -> -1.00000001 +nextt790 nexttoward -0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded +nextt791 nexttoward 0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded +nextt792 nexttoward 1 -Inf -> 0.999999999 +nextt793 nexttoward 1000 -Inf -> 999.999999 +nextt794 nexttoward Inf -Inf -> 9.99999999E+384 + +nextt800 nexttoward Inf -Inf -> 9.99999999E+384 +nextt801 nexttoward Inf -1000 -> 9.99999999E+384 +nextt802 nexttoward Inf -1 -> 9.99999999E+384 +nextt803 nexttoward Inf -0 -> 9.99999999E+384 +nextt804 nexttoward Inf 0 -> 9.99999999E+384 +nextt805 nexttoward Inf 1 -> 9.99999999E+384 +nextt806 nexttoward Inf 1000 -> 9.99999999E+384 +nextt807 nexttoward Inf Inf -> Infinity +nextt808 nexttoward -1000 Inf -> -999.999999 +nextt809 nexttoward -Inf Inf -> -9.99999999E+384 +nextt810 nexttoward -1 Inf -> -0.999999999 +nextt811 nexttoward -0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded +nextt812 nexttoward 0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded +nextt813 nexttoward 1 Inf -> 1.00000001 +nextt814 nexttoward 1000 Inf -> 1000.00001 +nextt815 nexttoward Inf Inf -> Infinity + +nextt821 nexttoward NaN -Inf -> NaN +nextt822 nexttoward NaN -1000 -> NaN +nextt823 nexttoward NaN -1 -> NaN +nextt824 nexttoward NaN -0 -> NaN +nextt825 nexttoward NaN 0 -> NaN +nextt826 nexttoward NaN 1 -> NaN +nextt827 nexttoward NaN 1000 -> NaN +nextt828 nexttoward NaN Inf -> NaN +nextt829 nexttoward NaN NaN -> NaN +nextt830 nexttoward -Inf NaN -> NaN +nextt831 nexttoward -1000 NaN -> NaN +nextt832 nexttoward -1 NaN -> NaN +nextt833 nexttoward -0 NaN -> NaN +nextt834 nexttoward 0 NaN -> NaN +nextt835 nexttoward 1 NaN -> NaN +nextt836 nexttoward 1000 NaN -> NaN +nextt837 nexttoward Inf NaN -> NaN + +nextt841 nexttoward sNaN -Inf -> NaN Invalid_operation +nextt842 nexttoward sNaN -1000 -> NaN Invalid_operation +nextt843 nexttoward sNaN -1 -> NaN Invalid_operation +nextt844 nexttoward sNaN -0 -> NaN Invalid_operation +nextt845 nexttoward sNaN 0 -> NaN Invalid_operation +nextt846 nexttoward sNaN 1 -> NaN Invalid_operation +nextt847 nexttoward sNaN 1000 -> NaN Invalid_operation +nextt848 nexttoward sNaN NaN -> NaN Invalid_operation +nextt849 nexttoward sNaN sNaN -> NaN Invalid_operation +nextt850 nexttoward NaN sNaN -> NaN Invalid_operation +nextt851 nexttoward -Inf sNaN -> NaN Invalid_operation +nextt852 nexttoward -1000 sNaN -> NaN Invalid_operation +nextt853 nexttoward -1 sNaN -> NaN Invalid_operation +nextt854 nexttoward -0 sNaN -> NaN Invalid_operation +nextt855 nexttoward 0 sNaN -> NaN Invalid_operation +nextt856 nexttoward 1 sNaN -> NaN Invalid_operation +nextt857 nexttoward 1000 sNaN -> NaN Invalid_operation +nextt858 nexttoward Inf sNaN -> NaN Invalid_operation +nextt859 nexttoward NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +nextt861 nexttoward NaN1 -Inf -> NaN1 +nextt862 nexttoward +NaN2 -1000 -> NaN2 +nextt863 nexttoward NaN3 1000 -> NaN3 +nextt864 nexttoward NaN4 Inf -> NaN4 +nextt865 nexttoward NaN5 +NaN6 -> NaN5 +nextt866 nexttoward -Inf NaN7 -> NaN7 +nextt867 nexttoward -1000 NaN8 -> NaN8 +nextt868 nexttoward 1000 NaN9 -> NaN9 +nextt869 nexttoward Inf +NaN10 -> NaN10 +nextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation +nextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation +nextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation +nextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation +nextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation +nextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation +nextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation +nextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation +nextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation +nextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation +nextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation +nextt882 nexttoward -NaN26 NaN28 -> -NaN26 +nextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation +nextt884 nexttoward 1000 -NaN30 -> -NaN30 +nextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- Null tests +nextt900 nexttoward 1 # -> NaN Invalid_operation +nextt901 nexttoward # 1 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/or.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/or.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,334 @@ +------------------------------------------------------------------------ +-- or.decTest -- digitwise logical OR -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check (truth table) +orx001 or 0 0 -> 0 +orx002 or 0 1 -> 1 +orx003 or 1 0 -> 1 +orx004 or 1 1 -> 1 +orx005 or 1100 1010 -> 1110 +-- and at msd and msd-1 +orx006 or 000000000 000000000 -> 0 +orx007 or 000000000 100000000 -> 100000000 +orx008 or 100000000 000000000 -> 100000000 +orx009 or 100000000 100000000 -> 100000000 +orx010 or 000000000 000000000 -> 0 +orx011 or 000000000 010000000 -> 10000000 +orx012 or 010000000 000000000 -> 10000000 +orx013 or 010000000 010000000 -> 10000000 + +-- Various lengths +-- 123456789 123456789 123456789 +orx021 or 111111111 111111111 -> 111111111 +orx022 or 111111111111 111111111 -> 111111111 +orx023 or 11111111 11111111 -> 11111111 +orx025 or 1111111 1111111 -> 1111111 +orx026 or 111111 111111 -> 111111 +orx027 or 11111 11111 -> 11111 +orx028 or 1111 1111 -> 1111 +orx029 or 111 111 -> 111 +orx031 or 11 11 -> 11 +orx032 or 1 1 -> 1 +orx033 or 111111111111 1111111111 -> 111111111 +orx034 or 11111111111 11111111111 -> 111111111 +orx035 or 1111111111 111111111111 -> 111111111 +orx036 or 111111111 1111111111111 -> 111111111 + +orx040 or 111111111 111111111111 -> 111111111 +orx041 or 11111111 111111111111 -> 111111111 +orx042 or 11111111 111111111 -> 111111111 +orx043 or 1111111 100000010 -> 101111111 +orx044 or 111111 100000100 -> 100111111 +orx045 or 11111 100001000 -> 100011111 +orx046 or 1111 100010000 -> 100011111 +orx047 or 111 100100000 -> 100100111 +orx048 or 11 101000000 -> 101000011 +orx049 or 1 110000000 -> 110000001 + +orx050 or 1111111111 1 -> 111111111 +orx051 or 111111111 1 -> 111111111 +orx052 or 11111111 1 -> 11111111 +orx053 or 1111111 1 -> 1111111 +orx054 or 111111 1 -> 111111 +orx055 or 11111 1 -> 11111 +orx056 or 1111 1 -> 1111 +orx057 or 111 1 -> 111 +orx058 or 11 1 -> 11 +orx059 or 1 1 -> 1 + +orx060 or 1111111111 0 -> 111111111 +orx061 or 111111111 0 -> 111111111 +orx062 or 11111111 0 -> 11111111 +orx063 or 1111111 0 -> 1111111 +orx064 or 111111 0 -> 111111 +orx065 or 11111 0 -> 11111 +orx066 or 1111 0 -> 1111 +orx067 or 111 0 -> 111 +orx068 or 11 0 -> 11 +orx069 or 1 0 -> 1 + +orx070 or 1 1111111111 -> 111111111 +orx071 or 1 111111111 -> 111111111 +orx072 or 1 11111111 -> 11111111 +orx073 or 1 1111111 -> 1111111 +orx074 or 1 111111 -> 111111 +orx075 or 1 11111 -> 11111 +orx076 or 1 1111 -> 1111 +orx077 or 1 111 -> 111 +orx078 or 1 11 -> 11 +orx079 or 1 1 -> 1 + +orx080 or 0 1111111111 -> 111111111 +orx081 or 0 111111111 -> 111111111 +orx082 or 0 11111111 -> 11111111 +orx083 or 0 1111111 -> 1111111 +orx084 or 0 111111 -> 111111 +orx085 or 0 11111 -> 11111 +orx086 or 0 1111 -> 1111 +orx087 or 0 111 -> 111 +orx088 or 0 11 -> 11 +orx089 or 0 1 -> 1 + +orx090 or 011111111 111101111 -> 111111111 +orx091 or 101111111 111101111 -> 111111111 +orx092 or 110111111 111101111 -> 111111111 +orx093 or 111011111 111101111 -> 111111111 +orx094 or 111101111 111101111 -> 111101111 +orx095 or 111110111 111101111 -> 111111111 +orx096 or 111111011 111101111 -> 111111111 +orx097 or 111111101 111101111 -> 111111111 +orx098 or 111111110 111101111 -> 111111111 + +orx100 or 111101111 011111111 -> 111111111 +orx101 or 111101111 101111111 -> 111111111 +orx102 or 111101111 110111111 -> 111111111 +orx103 or 111101111 111011111 -> 111111111 +orx104 or 111101111 111101111 -> 111101111 +orx105 or 111101111 111110111 -> 111111111 +orx106 or 111101111 111111011 -> 111111111 +orx107 or 111101111 111111101 -> 111111111 +orx108 or 111101111 111111110 -> 111111111 + +-- non-0/1 should not be accepted, nor should signs +orx220 or 111111112 111111111 -> NaN Invalid_operation +orx221 or 333333333 333333333 -> NaN Invalid_operation +orx222 or 555555555 555555555 -> NaN Invalid_operation +orx223 or 777777777 777777777 -> NaN Invalid_operation +orx224 or 999999999 999999999 -> NaN Invalid_operation +orx225 or 222222222 999999999 -> NaN Invalid_operation +orx226 or 444444444 999999999 -> NaN Invalid_operation +orx227 or 666666666 999999999 -> NaN Invalid_operation +orx228 or 888888888 999999999 -> NaN Invalid_operation +orx229 or 999999999 222222222 -> NaN Invalid_operation +orx230 or 999999999 444444444 -> NaN Invalid_operation +orx231 or 999999999 666666666 -> NaN Invalid_operation +orx232 or 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +orx240 or 567468689 -934981942 -> NaN Invalid_operation +orx241 or 567367689 934981942 -> NaN Invalid_operation +orx242 or -631917772 -706014634 -> NaN Invalid_operation +orx243 or -756253257 138579234 -> NaN Invalid_operation +orx244 or 835590149 567435400 -> NaN Invalid_operation +-- test MSD +orx250 or 200000000 100000000 -> NaN Invalid_operation +orx251 or 700000000 100000000 -> NaN Invalid_operation +orx252 or 800000000 100000000 -> NaN Invalid_operation +orx253 or 900000000 100000000 -> NaN Invalid_operation +orx254 or 200000000 000000000 -> NaN Invalid_operation +orx255 or 700000000 000000000 -> NaN Invalid_operation +orx256 or 800000000 000000000 -> NaN Invalid_operation +orx257 or 900000000 000000000 -> NaN Invalid_operation +orx258 or 100000000 200000000 -> NaN Invalid_operation +orx259 or 100000000 700000000 -> NaN Invalid_operation +orx260 or 100000000 800000000 -> NaN Invalid_operation +orx261 or 100000000 900000000 -> NaN Invalid_operation +orx262 or 000000000 200000000 -> NaN Invalid_operation +orx263 or 000000000 700000000 -> NaN Invalid_operation +orx264 or 000000000 800000000 -> NaN Invalid_operation +orx265 or 000000000 900000000 -> NaN Invalid_operation +-- test MSD-1 +orx270 or 020000000 100000000 -> NaN Invalid_operation +orx271 or 070100000 100000000 -> NaN Invalid_operation +orx272 or 080010000 100000001 -> NaN Invalid_operation +orx273 or 090001000 100000010 -> NaN Invalid_operation +orx274 or 100000100 020010100 -> NaN Invalid_operation +orx275 or 100000000 070001000 -> NaN Invalid_operation +orx276 or 100000010 080010100 -> NaN Invalid_operation +orx277 or 100000000 090000010 -> NaN Invalid_operation +-- test LSD +orx280 or 001000002 100000000 -> NaN Invalid_operation +orx281 or 000000007 100000000 -> NaN Invalid_operation +orx282 or 000000008 100000000 -> NaN Invalid_operation +orx283 or 000000009 100000000 -> NaN Invalid_operation +orx284 or 100000000 000100002 -> NaN Invalid_operation +orx285 or 100100000 001000007 -> NaN Invalid_operation +orx286 or 100010000 010000008 -> NaN Invalid_operation +orx287 or 100001000 100000009 -> NaN Invalid_operation +-- test Middie +orx288 or 001020000 100000000 -> NaN Invalid_operation +orx289 or 000070001 100000000 -> NaN Invalid_operation +orx290 or 000080000 100010000 -> NaN Invalid_operation +orx291 or 000090000 100001000 -> NaN Invalid_operation +orx292 or 100000010 000020100 -> NaN Invalid_operation +orx293 or 100100000 000070010 -> NaN Invalid_operation +orx294 or 100010100 000080001 -> NaN Invalid_operation +orx295 or 100001000 000090000 -> NaN Invalid_operation +-- signs +orx296 or -100001000 -000000000 -> NaN Invalid_operation +orx297 or -100001000 000010000 -> NaN Invalid_operation +orx298 or 100001000 -000000000 -> NaN Invalid_operation +orx299 or 100001000 000011000 -> 100011000 + +-- Nmax, Nmin, Ntiny +orx331 or 2 9.99999999E+999 -> NaN Invalid_operation +orx332 or 3 1E-999 -> NaN Invalid_operation +orx333 or 4 1.00000000E-999 -> NaN Invalid_operation +orx334 or 5 1E-1007 -> NaN Invalid_operation +orx335 or 6 -1E-1007 -> NaN Invalid_operation +orx336 or 7 -1.00000000E-999 -> NaN Invalid_operation +orx337 or 8 -1E-999 -> NaN Invalid_operation +orx338 or 9 -9.99999999E+999 -> NaN Invalid_operation +orx341 or 9.99999999E+999 -18 -> NaN Invalid_operation +orx342 or 1E-999 01 -> NaN Invalid_operation +orx343 or 1.00000000E-999 -18 -> NaN Invalid_operation +orx344 or 1E-1007 18 -> NaN Invalid_operation +orx345 or -1E-1007 -10 -> NaN Invalid_operation +orx346 or -1.00000000E-999 18 -> NaN Invalid_operation +orx347 or -1E-999 10 -> NaN Invalid_operation +orx348 or -9.99999999E+999 -18 -> NaN Invalid_operation + +-- A few other non-integers +orx361 or 1.0 1 -> NaN Invalid_operation +orx362 or 1E+1 1 -> NaN Invalid_operation +orx363 or 0.0 1 -> NaN Invalid_operation +orx364 or 0E+1 1 -> NaN Invalid_operation +orx365 or 9.9 1 -> NaN Invalid_operation +orx366 or 9E+1 1 -> NaN Invalid_operation +orx371 or 0 1.0 -> NaN Invalid_operation +orx372 or 0 1E+1 -> NaN Invalid_operation +orx373 or 0 0.0 -> NaN Invalid_operation +orx374 or 0 0E+1 -> NaN Invalid_operation +orx375 or 0 9.9 -> NaN Invalid_operation +orx376 or 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +orx780 or -Inf -Inf -> NaN Invalid_operation +orx781 or -Inf -1000 -> NaN Invalid_operation +orx782 or -Inf -1 -> NaN Invalid_operation +orx783 or -Inf -0 -> NaN Invalid_operation +orx784 or -Inf 0 -> NaN Invalid_operation +orx785 or -Inf 1 -> NaN Invalid_operation +orx786 or -Inf 1000 -> NaN Invalid_operation +orx787 or -1000 -Inf -> NaN Invalid_operation +orx788 or -Inf -Inf -> NaN Invalid_operation +orx789 or -1 -Inf -> NaN Invalid_operation +orx790 or -0 -Inf -> NaN Invalid_operation +orx791 or 0 -Inf -> NaN Invalid_operation +orx792 or 1 -Inf -> NaN Invalid_operation +orx793 or 1000 -Inf -> NaN Invalid_operation +orx794 or Inf -Inf -> NaN Invalid_operation + +orx800 or Inf -Inf -> NaN Invalid_operation +orx801 or Inf -1000 -> NaN Invalid_operation +orx802 or Inf -1 -> NaN Invalid_operation +orx803 or Inf -0 -> NaN Invalid_operation +orx804 or Inf 0 -> NaN Invalid_operation +orx805 or Inf 1 -> NaN Invalid_operation +orx806 or Inf 1000 -> NaN Invalid_operation +orx807 or Inf Inf -> NaN Invalid_operation +orx808 or -1000 Inf -> NaN Invalid_operation +orx809 or -Inf Inf -> NaN Invalid_operation +orx810 or -1 Inf -> NaN Invalid_operation +orx811 or -0 Inf -> NaN Invalid_operation +orx812 or 0 Inf -> NaN Invalid_operation +orx813 or 1 Inf -> NaN Invalid_operation +orx814 or 1000 Inf -> NaN Invalid_operation +orx815 or Inf Inf -> NaN Invalid_operation + +orx821 or NaN -Inf -> NaN Invalid_operation +orx822 or NaN -1000 -> NaN Invalid_operation +orx823 or NaN -1 -> NaN Invalid_operation +orx824 or NaN -0 -> NaN Invalid_operation +orx825 or NaN 0 -> NaN Invalid_operation +orx826 or NaN 1 -> NaN Invalid_operation +orx827 or NaN 1000 -> NaN Invalid_operation +orx828 or NaN Inf -> NaN Invalid_operation +orx829 or NaN NaN -> NaN Invalid_operation +orx830 or -Inf NaN -> NaN Invalid_operation +orx831 or -1000 NaN -> NaN Invalid_operation +orx832 or -1 NaN -> NaN Invalid_operation +orx833 or -0 NaN -> NaN Invalid_operation +orx834 or 0 NaN -> NaN Invalid_operation +orx835 or 1 NaN -> NaN Invalid_operation +orx836 or 1000 NaN -> NaN Invalid_operation +orx837 or Inf NaN -> NaN Invalid_operation + +orx841 or sNaN -Inf -> NaN Invalid_operation +orx842 or sNaN -1000 -> NaN Invalid_operation +orx843 or sNaN -1 -> NaN Invalid_operation +orx844 or sNaN -0 -> NaN Invalid_operation +orx845 or sNaN 0 -> NaN Invalid_operation +orx846 or sNaN 1 -> NaN Invalid_operation +orx847 or sNaN 1000 -> NaN Invalid_operation +orx848 or sNaN NaN -> NaN Invalid_operation +orx849 or sNaN sNaN -> NaN Invalid_operation +orx850 or NaN sNaN -> NaN Invalid_operation +orx851 or -Inf sNaN -> NaN Invalid_operation +orx852 or -1000 sNaN -> NaN Invalid_operation +orx853 or -1 sNaN -> NaN Invalid_operation +orx854 or -0 sNaN -> NaN Invalid_operation +orx855 or 0 sNaN -> NaN Invalid_operation +orx856 or 1 sNaN -> NaN Invalid_operation +orx857 or 1000 sNaN -> NaN Invalid_operation +orx858 or Inf sNaN -> NaN Invalid_operation +orx859 or NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +orx861 or NaN1 -Inf -> NaN Invalid_operation +orx862 or +NaN2 -1000 -> NaN Invalid_operation +orx863 or NaN3 1000 -> NaN Invalid_operation +orx864 or NaN4 Inf -> NaN Invalid_operation +orx865 or NaN5 +NaN6 -> NaN Invalid_operation +orx866 or -Inf NaN7 -> NaN Invalid_operation +orx867 or -1000 NaN8 -> NaN Invalid_operation +orx868 or 1000 NaN9 -> NaN Invalid_operation +orx869 or Inf +NaN10 -> NaN Invalid_operation +orx871 or sNaN11 -Inf -> NaN Invalid_operation +orx872 or sNaN12 -1000 -> NaN Invalid_operation +orx873 or sNaN13 1000 -> NaN Invalid_operation +orx874 or sNaN14 NaN17 -> NaN Invalid_operation +orx875 or sNaN15 sNaN18 -> NaN Invalid_operation +orx876 or NaN16 sNaN19 -> NaN Invalid_operation +orx877 or -Inf +sNaN20 -> NaN Invalid_operation +orx878 or -1000 sNaN21 -> NaN Invalid_operation +orx879 or 1000 sNaN22 -> NaN Invalid_operation +orx880 or Inf sNaN23 -> NaN Invalid_operation +orx881 or +NaN25 +sNaN24 -> NaN Invalid_operation +orx882 or -NaN26 NaN28 -> NaN Invalid_operation +orx883 or -sNaN27 sNaN29 -> NaN Invalid_operation +orx884 or 1000 -NaN30 -> NaN Invalid_operation +orx885 or 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/plus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/plus.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,195 @@ +------------------------------------------------------------------------ +-- plus.decTest -- decimal monadic addition -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests primarily tests the existence of the operator. +-- Addition and rounding, and most overflows, are tested elsewhere. + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +plux001 plus '1' -> '1' +plux002 plus '-1' -> '-1' +plux003 plus '1.00' -> '1.00' +plux004 plus '-1.00' -> '-1.00' +plux005 plus '0' -> '0' +plux006 plus '0.00' -> '0.00' +plux007 plus '00.0' -> '0.0' +plux008 plus '00.00' -> '0.00' +plux009 plus '00' -> '0' + +plux010 plus '-2' -> '-2' +plux011 plus '2' -> '2' +plux012 plus '-2.00' -> '-2.00' +plux013 plus '2.00' -> '2.00' +plux014 plus '-0' -> '0' +plux015 plus '-0.00' -> '0.00' +plux016 plus '-00.0' -> '0.0' +plux017 plus '-00.00' -> '0.00' +plux018 plus '-00' -> '0' + +plux020 plus '-2000000' -> '-2000000' +plux021 plus '2000000' -> '2000000' +precision: 7 +plux022 plus '-2000000' -> '-2000000' +plux023 plus '2000000' -> '2000000' +precision: 6 +plux024 plus '-2000000' -> '-2.00000E+6' Rounded +plux025 plus '2000000' -> '2.00000E+6' Rounded +precision: 3 +plux026 plus '-2000000' -> '-2.00E+6' Rounded +plux027 plus '2000000' -> '2.00E+6' Rounded + +-- more fixed, potential LHS swaps if done by add 0 +precision: 9 +plux060 plus '56267E-10' -> '0.0000056267' +plux061 plus '56267E-5' -> '0.56267' +plux062 plus '56267E-2' -> '562.67' +plux063 plus '56267E-1' -> '5626.7' +plux065 plus '56267E-0' -> '56267' +plux066 plus '56267E+0' -> '56267' +plux067 plus '56267E+1' -> '5.6267E+5' +plux068 plus '56267E+2' -> '5.6267E+6' +plux069 plus '56267E+3' -> '5.6267E+7' +plux070 plus '56267E+4' -> '5.6267E+8' +plux071 plus '56267E+5' -> '5.6267E+9' +plux072 plus '56267E+6' -> '5.6267E+10' +plux080 plus '-56267E-10' -> '-0.0000056267' +plux081 plus '-56267E-5' -> '-0.56267' +plux082 plus '-56267E-2' -> '-562.67' +plux083 plus '-56267E-1' -> '-5626.7' +plux085 plus '-56267E-0' -> '-56267' +plux086 plus '-56267E+0' -> '-56267' +plux087 plus '-56267E+1' -> '-5.6267E+5' +plux088 plus '-56267E+2' -> '-5.6267E+6' +plux089 plus '-56267E+3' -> '-5.6267E+7' +plux090 plus '-56267E+4' -> '-5.6267E+8' +plux091 plus '-56267E+5' -> '-5.6267E+9' +plux092 plus '-56267E+6' -> '-5.6267E+10' + +-- "lhs" zeros in plus and minus have exponent = operand +plux120 plus '-0E3' -> '0E+3' +plux121 plus '-0E2' -> '0E+2' +plux122 plus '-0E1' -> '0E+1' +plux123 plus '-0E0' -> '0' +plux124 plus '+0E0' -> '0' +plux125 plus '+0E1' -> '0E+1' +plux126 plus '+0E2' -> '0E+2' +plux127 plus '+0E3' -> '0E+3' + +plux130 plus '-5E3' -> '-5E+3' +plux131 plus '-5E8' -> '-5E+8' +plux132 plus '-5E13' -> '-5E+13' +plux133 plus '-5E18' -> '-5E+18' +plux134 plus '+5E3' -> '5E+3' +plux135 plus '+5E8' -> '5E+8' +plux136 plus '+5E13' -> '5E+13' +plux137 plus '+5E18' -> '5E+18' + +-- specials +plux150 plus 'Inf' -> 'Infinity' +plux151 plus '-Inf' -> '-Infinity' +plux152 plus NaN -> NaN +plux153 plus sNaN -> NaN Invalid_operation +plux154 plus NaN77 -> NaN77 +plux155 plus sNaN88 -> NaN88 Invalid_operation +plux156 plus -NaN -> -NaN +plux157 plus -sNaN -> -NaN Invalid_operation +plux158 plus -NaN77 -> -NaN77 +plux159 plus -sNaN88 -> -NaN88 Invalid_operation + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +plux160 plus 9.999E+999999999 -> Infinity Inexact Overflow Rounded +plux161 plus -9.999E+999999999 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +plux210 plus 1.00E-999 -> 1.00E-999 +plux211 plus 0.1E-999 -> 1E-1000 Subnormal +plux212 plus 0.10E-999 -> 1.0E-1000 Subnormal +plux213 plus 0.100E-999 -> 1.0E-1000 Subnormal Rounded +plux214 plus 0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +plux215 plus 0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +plux216 plus 0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +plux217 plus 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +plux218 plus 0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux219 plus 0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux220 plus 0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +plux230 plus -1.00E-999 -> -1.00E-999 +plux231 plus -0.1E-999 -> -1E-1000 Subnormal +plux232 plus -0.10E-999 -> -1.0E-1000 Subnormal +plux233 plus -0.100E-999 -> -1.0E-1000 Subnormal Rounded +plux234 plus -0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +plux235 plus -0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow +plux236 plus -0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +plux237 plus -0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +plux238 plus -0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux239 plus -0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux240 plus -0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- subnormals clamped to 0-Etiny +precision: 16 +maxExponent: 384 +minExponent: -383 +plux251 plus 7E-398 -> 7E-398 Subnormal +plux252 plus 0E-398 -> 0E-398 +plux253 plus 7E-399 -> 1E-398 Subnormal Underflow Inexact Rounded +plux254 plus 4E-399 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +plux255 plus 7E-400 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +plux256 plus 7E-401 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +plux257 plus 0E-399 -> 0E-398 Clamped +plux258 plus 0E-400 -> 0E-398 Clamped +plux259 plus 0E-401 -> 0E-398 Clamped + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +plux301 plus 12345678000 -> 1.23456780E+10 Rounded +plux302 plus 1234567800 -> 1.23456780E+9 Rounded +plux303 plus 1234567890 -> 1.23456789E+9 Rounded +plux304 plus 1234567891 -> 1.23456789E+9 Inexact Rounded +plux305 plus 12345678901 -> 1.23456789E+10 Inexact Rounded +plux306 plus 1234567896 -> 1.23456790E+9 Inexact Rounded + +-- still checking +precision: 15 +plux321 plus 12345678000 -> 12345678000 +plux322 plus 1234567800 -> 1234567800 +plux323 plus 1234567890 -> 1234567890 +plux324 plus 1234567891 -> 1234567891 +plux325 plus 12345678901 -> 12345678901 +plux326 plus 1234567896 -> 1234567896 +precision: 9 + +-- Null tests +plu900 plus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/power.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/power.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1624 @@ +------------------------------------------------------------------------ +-- power.decTest -- decimal exponentiation [power(x, y)] -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- In addition to the power operator testcases here, see also the file +-- powersqrt.decTest which includes all the tests from +-- squareroot.decTest implemented using power(x, 0.5) + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 + +-- base checks. Note 0**0 is an error. +powx001 power '0' '0' -> NaN Invalid_operation +powx002 power '0' '1' -> '0' +powx003 power '0' '2' -> '0' +powx004 power '1' '0' -> '1' +powx005 power '1' '1' -> '1' +powx006 power '1' '2' -> '1' + +powx010 power '2' '0' -> '1' +powx011 power '2' '1' -> '2' +powx012 power '2' '2' -> '4' +powx013 power '2' '3' -> '8' +powx014 power '2' '4' -> '16' +powx015 power '2' '5' -> '32' +powx016 power '2' '6' -> '64' +powx017 power '2' '7' -> '128' +powx018 power '2' '8' -> '256' +powx019 power '2' '9' -> '512' +powx020 power '2' '10' -> '1024' +powx021 power '2' '11' -> '2048' +powx022 power '2' '12' -> '4096' +powx023 power '2' '15' -> '32768' +powx024 power '2' '16' -> '65536' +powx025 power '2' '31' -> '2147483648' +-- NB 0 not stripped in next +powx026 power '2' '32' -> '4294967296' + +precision: 9 +powx027 power '2' '31' -> '2.14748365E+9' Inexact Rounded +-- NB 0 not stripped in next +powx028 power '2' '32' -> '4.29496730E+9' Inexact Rounded +precision: 10 +powx029 power '2' '31' -> '2147483648' +powx030 power '2' '32' -> '4294967296' +precision: 9 + +powx031 power '3' '2' -> 9 +powx032 power '4' '2' -> 16 +powx033 power '5' '2' -> 25 +powx034 power '6' '2' -> 36 +powx035 power '7' '2' -> 49 +powx036 power '8' '2' -> 64 +powx037 power '9' '2' -> 81 +powx038 power '10' '2' -> 100 +powx039 power '11' '2' -> 121 +powx040 power '12' '2' -> 144 + +powx041 power '3' '3' -> 27 +powx042 power '4' '3' -> 64 +powx043 power '5' '3' -> 125 +powx044 power '6' '3' -> 216 +powx045 power '7' '3' -> 343 +powx047 power '-3' '3' -> -27 +powx048 power '-4' '3' -> -64 +powx049 power '-5' '3' -> -125 +powx050 power '-6' '3' -> -216 +powx051 power '-7' '3' -> -343 + +powx052 power '10' '0' -> 1 +powx053 power '10' '1' -> 10 +powx054 power '10' '2' -> 100 +powx055 power '10' '3' -> 1000 +powx056 power '10' '4' -> 10000 +powx057 power '10' '5' -> 100000 +powx058 power '10' '6' -> 1000000 +powx059 power '10' '7' -> 10000000 +powx060 power '10' '8' -> 100000000 +powx061 power '10' '9' -> 1.00000000E+9 Rounded +powx062 power '10' '22' -> 1.00000000E+22 Rounded +powx063 power '10' '77' -> 1.00000000E+77 Rounded +powx064 power '10' '99' -> 1.00000000E+99 Rounded + +powx070 power '0.3' '0' -> '1' +powx071 power '0.3' '1' -> '0.3' +powx072 power '0.3' '1.00' -> '0.3' +powx073 power '0.3' '2.00' -> '0.09' +powx074 power '0.3' '2.000000000' -> '0.09' +powx075 power '6.0' '1' -> '6.0' -- NB zeros not stripped +powx076 power '6.0' '2' -> '36.00' -- .. +powx077 power '-3' '2' -> '9' -- from NetRexx book +powx078 power '4' '3' -> '64' -- .. (sort of) + +powx080 power 0.1 0 -> 1 +powx081 power 0.1 1 -> 0.1 +powx082 power 0.1 2 -> 0.01 +powx083 power 0.1 3 -> 0.001 +powx084 power 0.1 4 -> 0.0001 +powx085 power 0.1 5 -> 0.00001 +powx086 power 0.1 6 -> 0.000001 +powx087 power 0.1 7 -> 1E-7 +powx088 power 0.1 8 -> 1E-8 +powx089 power 0.1 9 -> 1E-9 + +powx090 power 101 2 -> 10201 +powx091 power 101 3 -> 1030301 +powx092 power 101 4 -> 104060401 +powx093 power 101 5 -> 1.05101005E+10 Inexact Rounded +powx094 power 101 6 -> 1.06152015E+12 Inexact Rounded +powx095 power 101 7 -> 1.07213535E+14 Inexact Rounded + +-- negative powers +powx099 power '1' '-1' -> 1 +powx100 power '3' '-1' -> 0.333333333 Inexact Rounded +powx101 power '2' '-1' -> 0.5 +powx102 power '2' '-2' -> 0.25 +powx103 power '2' '-4' -> 0.0625 +powx104 power '2' '-8' -> 0.00390625 +powx105 power '2' '-16' -> 0.0000152587891 Inexact Rounded +powx106 power '2' '-32' -> 2.32830644E-10 Inexact Rounded +powx108 power '2' '-64' -> 5.42101086E-20 Inexact Rounded +powx110 power '10' '-8' -> 1E-8 +powx111 power '10' '-7' -> 1E-7 +powx112 power '10' '-6' -> 0.000001 +powx113 power '10' '-5' -> 0.00001 +powx114 power '10' '-4' -> 0.0001 +powx115 power '10' '-3' -> 0.001 +powx116 power '10' '-2' -> 0.01 +powx117 power '10' '-1' -> 0.1 +powx121 power '10' '-77' -> '1E-77' +powx122 power '10' '-22' -> '1E-22' + +powx123 power '2' '-1' -> '0.5' +powx124 power '2' '-2' -> '0.25' +powx125 power '2' '-4' -> '0.0625' + +powx126 power '0' '-1' -> Infinity +powx127 power '0' '-2' -> Infinity +powx128 power -0 '-1' -> -Infinity +powx129 power -0 '-2' -> Infinity + +-- "0.5" tests from original Rexx diagnostics [loop unrolled] +powx200 power 0.5 0 -> 1 +powx201 power 0.5 1 -> 0.5 +powx202 power 0.5 2 -> 0.25 +powx203 power 0.5 3 -> 0.125 +powx204 power 0.5 4 -> 0.0625 +powx205 power 0.5 5 -> 0.03125 +powx206 power 0.5 6 -> 0.015625 +powx207 power 0.5 7 -> 0.0078125 +powx208 power 0.5 8 -> 0.00390625 +powx209 power 0.5 9 -> 0.001953125 +powx210 power 0.5 10 -> 0.0009765625 + +powx211 power 1 100000000 -> 1 +powx212 power 1 999999998 -> 1 +powx213 power 1 999999999 -> 1 + + +-- The Vienna case. Checks both setup and 1/acc working precision +-- Modified 1998.12.14 as RHS no longer rounded before use (must fit) +-- Modified 1990.02.04 as LHS is now rounded (instead of truncated to guard) +-- '123456789E+10' -- lhs .. rounded to 1.23E+18 +-- '-1.23000e+2' -- rhs .. [was: -1.23455e+2, rounds to -123] +-- Modified 2002.10.06 -- finally, no input rounding +-- With input rounding, result would be 8.74E-2226 +precision: 3 +maxexponent: 5000 +minexponent: -5000 +powx219 power '123456789E+10' '-1.23000e+2' -> '5.54E-2226' Inexact Rounded + +-- zeros +maxexponent: +96 +minexponent: -95 +precision: 7 +powx223 power 0E-30 3 -> 0 +powx224 power 0E-10 3 -> 0 +powx225 power 0E-1 3 -> 0 +powx226 power 0E+0 3 -> 0 +powx227 power 0 3 -> 0 +powx228 power 0E+1 3 -> 0 +powx229 power 0E+10 3 -> 0 +powx230 power 0E+30 3 -> 0 +powx231 power 3 0E-30 -> 1 +powx232 power 3 0E-10 -> 1 +powx233 power 3 0E-1 -> 1 +powx234 power 3 0E+0 -> 1 +powx235 power 3 0 -> 1 +powx236 power 3 0E+1 -> 1 +powx237 power 3 0E+10 -> 1 +powx238 power 3 0E+30 -> 1 +powx239 power 0E-30 -3 -> Infinity +powx240 power 0E-10 -3 -> Infinity +powx241 power 0E-1 -3 -> Infinity +powx242 power 0E+0 -3 -> Infinity +powx243 power 0 -3 -> Infinity +powx244 power 0E+1 -3 -> Infinity +powx245 power 0E+10 -3 -> Infinity +powx246 power 0E+30 -3 -> Infinity +powx247 power -3 0E-30 -> 1 +powx248 power -3 0E-10 -> 1 +powx249 power -3 0E-1 -> 1 +powx250 power -3 0E+0 -> 1 +powx251 power -3 0 -> 1 +powx252 power -3 0E+1 -> 1 +powx253 power -3 0E+10 -> 1 +powx254 power -3 0E+30 -> 1 + +-- a few lhs negatives +precision: 9 +maxExponent: 999 +minexponent: -999 +powx260 power -10 '0' -> 1 +powx261 power -10 '1' -> -10 +powx262 power -10 '2' -> 100 +powx263 power -10 '3' -> -1000 +powx264 power -10 '4' -> 10000 +powx265 power -10 '5' -> -100000 +powx266 power -10 '6' -> 1000000 +powx267 power -10 '7' -> -10000000 +powx268 power -10 '8' -> 100000000 +powx269 power -10 '9' -> -1.00000000E+9 Rounded +powx270 power -10 '22' -> 1.00000000E+22 Rounded +powx271 power -10 '77' -> -1.00000000E+77 Rounded +powx272 power -10 '99' -> -1.00000000E+99 Rounded + +-- some more edge cases +precision: 15 +maxExponent: 999 +minexponent: -999 +powx391 power 0.1 999 -> 1E-999 +powx392 power 0.099 999 -> 4.360732062E-1004 Underflow Subnormal Inexact Rounded +powx393 power 0.098 999 -> 1.71731E-1008 Underflow Subnormal Inexact Rounded +powx394 power 0.097 999 -> 6E-1013 Underflow Subnormal Inexact Rounded +powx395 power 0.096 999 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped +powx396 power 0.01 999 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped +powx397 power 0.02 100000000 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped + +-- multiply tests are here to aid checking and test for consistent handling +-- of underflow +precision: 5 +maxexponent: 999 +minexponent: -999 + +-- squares +mulx400 multiply 1E-502 1e-502 -> 0E-1003 Subnormal Inexact Underflow Rounded Clamped +mulx401 multiply 1E-501 1e-501 -> 1E-1002 Subnormal +mulx402 multiply 2E-501 2e-501 -> 4E-1002 Subnormal +mulx403 multiply 4E-501 4e-501 -> 1.6E-1001 Subnormal +mulx404 multiply 10E-501 10e-501 -> 1.00E-1000 Subnormal +mulx405 multiply 30E-501 30e-501 -> 9.00E-1000 Subnormal +mulx406 multiply 40E-501 40e-501 -> 1.600E-999 + +powx400 power 1E-502 2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx401 power 1E-501 2 -> 1E-1002 Subnormal +powx402 power 2E-501 2 -> 4E-1002 Subnormal +powx403 power 4E-501 2 -> 1.6E-1001 Subnormal +powx404 power 10E-501 2 -> 1.00E-1000 Subnormal +powx405 power 30E-501 2 -> 9.00E-1000 Subnormal +powx406 power 40E-501 2 -> 1.600E-999 + +-- cubes +mulx410 multiply 1E-670 1e-335 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx411 multiply 1E-668 1e-334 -> 1E-1002 Subnormal +mulx412 multiply 4E-668 2e-334 -> 8E-1002 Subnormal +mulx413 multiply 9E-668 3e-334 -> 2.7E-1001 Subnormal +mulx414 multiply 16E-668 4e-334 -> 6.4E-1001 Subnormal +mulx415 multiply 25E-668 5e-334 -> 1.25E-1000 Subnormal +mulx416 multiply 10E-668 100e-334 -> 1.000E-999 + +powx410 power 1E-335 3 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx411 power 1E-334 3 -> 1E-1002 Subnormal +powx412 power 2E-334 3 -> 8E-1002 Subnormal +powx413 power 3E-334 3 -> 2.7E-1001 Subnormal +powx414 power 4E-334 3 -> 6.4E-1001 Subnormal +powx415 power 5E-334 3 -> 1.25E-1000 Subnormal +powx416 power 10E-334 3 -> 1.000E-999 + +-- negative powers, testing subnormals +precision: 5 +maxExponent: 999 +minexponent: -999 +powx421 power 2.5E-501 -2 -> Infinity Overflow Inexact Rounded +powx422 power 2.5E-500 -2 -> 1.6E+999 + +powx423 power 2.5E+499 -2 -> 1.6E-999 +powx424 power 2.5E+500 -2 -> 1.6E-1001 Subnormal +powx425 power 2.5E+501 -2 -> 2E-1003 Underflow Subnormal Inexact Rounded +powx426 power 2.5E+502 -2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +powx427 power 0.25E+499 -2 -> 1.6E-997 +powx428 power 0.25E+500 -2 -> 1.6E-999 +powx429 power 0.25E+501 -2 -> 1.6E-1001 Subnormal +powx430 power 0.25E+502 -2 -> 2E-1003 Underflow Subnormal Inexact Rounded +powx431 power 0.25E+503 -2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +powx432 power 0.04E+499 -2 -> 6.25E-996 +powx433 power 0.04E+500 -2 -> 6.25E-998 +powx434 power 0.04E+501 -2 -> 6.25E-1000 Subnormal +powx435 power 0.04E+502 -2 -> 6.2E-1002 Underflow Subnormal Inexact Rounded +powx436 power 0.04E+503 -2 -> 1E-1003 Underflow Subnormal Inexact Rounded +powx437 power 0.04E+504 -2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +powx441 power 0.04E+334 -3 -> 1.5625E-998 +powx442 power 0.04E+335 -3 -> 1.56E-1001 Underflow Subnormal Inexact Rounded +powx443 power 0.04E+336 -3 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx444 power 0.25E+333 -3 -> 6.4E-998 +powx445 power 0.25E+334 -3 -> 6.4E-1001 Subnormal +powx446 power 0.25E+335 -3 -> 1E-1003 Underflow Subnormal Inexact Rounded +powx447 power 0.25E+336 -3 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +-- check sign for cubes and a few squares +powx448 power -0.04E+334 -3 -> -1.5625E-998 +powx449 power -0.04E+335 -3 -> -1.56E-1001 Underflow Subnormal Inexact Rounded +powx450 power -0.04E+336 -3 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx451 power -0.25E+333 -3 -> -6.4E-998 +powx452 power -0.25E+334 -3 -> -6.4E-1001 Subnormal +powx453 power -0.25E+335 -3 -> -1E-1003 Underflow Subnormal Inexact Rounded +powx454 power -0.25E+336 -3 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx455 power -0.04E+499 -2 -> 6.25E-996 +powx456 power -0.04E+500 -2 -> 6.25E-998 +powx457 power -0.04E+501 -2 -> 6.25E-1000 Subnormal +powx458 power -0.04E+502 -2 -> 6.2E-1002 Underflow Subnormal Inexact Rounded + +-- test -0s +precision: 9 +powx560 power 0 0 -> NaN Invalid_operation +powx561 power 0 -0 -> NaN Invalid_operation +powx562 power -0 0 -> NaN Invalid_operation +powx563 power -0 -0 -> NaN Invalid_operation +powx564 power 1 0 -> 1 +powx565 power 1 -0 -> 1 +powx566 power -1 0 -> 1 +powx567 power -1 -0 -> 1 +powx568 power 0 1 -> 0 +powx569 power 0 -1 -> Infinity +powx570 power -0 1 -> -0 +powx571 power -0 -1 -> -Infinity +powx572 power 0 2 -> 0 +powx573 power 0 -2 -> Infinity +powx574 power -0 2 -> 0 +powx575 power -0 -2 -> Infinity +powx576 power 0 3 -> 0 +powx577 power 0 -3 -> Infinity +powx578 power -0 3 -> -0 +powx579 power -0 -3 -> -Infinity + +-- Specials +powx580 power Inf -Inf -> 0 +powx581 power Inf -1000 -> 0 +powx582 power Inf -1 -> 0 +powx583 power Inf -0.5 -> 0 +powx584 power Inf -0 -> 1 +powx585 power Inf 0 -> 1 +powx586 power Inf 0.5 -> Infinity +powx587 power Inf 1 -> Infinity +powx588 power Inf 1000 -> Infinity +powx589 power Inf Inf -> Infinity +powx590 power -1000 Inf -> NaN Invalid_operation +powx591 power -Inf Inf -> NaN Invalid_operation +powx592 power -1 Inf -> NaN Invalid_operation +powx593 power -0.5 Inf -> NaN Invalid_operation +powx594 power -0 Inf -> 0 +powx595 power 0 Inf -> 0 +powx596 power 0.5 Inf -> 0 +powx597 power 1 Inf -> 1.00000000 Inexact Rounded +powx598 power 1000 Inf -> Infinity +powx599 power Inf Inf -> Infinity + +powx600 power -Inf -Inf -> NaN Invalid_operation +powx601 power -Inf -1000 -> 0 +powx602 power -Inf -1 -> -0 +powx603 power -Inf -0.5 -> NaN Invalid_operation +powx604 power -Inf -0 -> 1 +powx605 power -Inf 0 -> 1 +powx606 power -Inf 0.5 -> NaN Invalid_operation +powx607 power -Inf 1 -> -Infinity +powx608 power -Inf 1000 -> Infinity +powx609 power -Inf Inf -> NaN Invalid_operation +powx610 power -1000 Inf -> NaN Invalid_operation +powx611 power -Inf -Inf -> NaN Invalid_operation +powx612 power -1 -Inf -> NaN Invalid_operation +powx613 power -0.5 -Inf -> NaN Invalid_operation +powx614 power -0 -Inf -> Infinity +powx615 power 0 -Inf -> Infinity +powx616 power 0.5 -Inf -> Infinity +powx617 power 1 -Inf -> 1.00000000 Inexact Rounded +powx618 power 1000 -Inf -> 0 +powx619 power Inf -Inf -> 0 + +powx621 power NaN -Inf -> NaN +powx622 power NaN -1000 -> NaN +powx623 power NaN -1 -> NaN +powx624 power NaN -0.5 -> NaN +powx625 power NaN -0 -> NaN +powx626 power NaN 0 -> NaN +powx627 power NaN 0.5 -> NaN +powx628 power NaN 1 -> NaN +powx629 power NaN 1000 -> NaN +powx630 power NaN Inf -> NaN +powx631 power NaN NaN -> NaN +powx632 power -Inf NaN -> NaN +powx633 power -1000 NaN -> NaN +powx634 power -1 NaN -> NaN +powx635 power -0 NaN -> NaN +powx636 power 0 NaN -> NaN +powx637 power 1 NaN -> NaN +powx638 power 1000 NaN -> NaN +powx639 power Inf NaN -> NaN + +powx641 power sNaN -Inf -> NaN Invalid_operation +powx642 power sNaN -1000 -> NaN Invalid_operation +powx643 power sNaN -1 -> NaN Invalid_operation +powx644 power sNaN -0.5 -> NaN Invalid_operation +powx645 power sNaN -0 -> NaN Invalid_operation +powx646 power sNaN 0 -> NaN Invalid_operation +powx647 power sNaN 0.5 -> NaN Invalid_operation +powx648 power sNaN 1 -> NaN Invalid_operation +powx649 power sNaN 1000 -> NaN Invalid_operation +powx650 power sNaN NaN -> NaN Invalid_operation +powx651 power sNaN sNaN -> NaN Invalid_operation +powx652 power NaN sNaN -> NaN Invalid_operation +powx653 power -Inf sNaN -> NaN Invalid_operation +powx654 power -1000 sNaN -> NaN Invalid_operation +powx655 power -1 sNaN -> NaN Invalid_operation +powx656 power -0.5 sNaN -> NaN Invalid_operation +powx657 power -0 sNaN -> NaN Invalid_operation +powx658 power 0 sNaN -> NaN Invalid_operation +powx659 power 0.5 sNaN -> NaN Invalid_operation +powx660 power 1 sNaN -> NaN Invalid_operation +powx661 power 1000 sNaN -> NaN Invalid_operation +powx662 power Inf sNaN -> NaN Invalid_operation +powx663 power NaN sNaN -> NaN Invalid_operation + +-- NaN propagation +powx670 power NaN3 sNaN7 -> NaN7 Invalid_operation +powx671 power sNaN8 NaN6 -> NaN8 Invalid_operation +powx672 power 1 sNaN7 -> NaN7 Invalid_operation +powx673 power sNaN8 1 -> NaN8 Invalid_operation +powx674 power Inf sNaN7 -> NaN7 Invalid_operation +powx675 power sNaN8 Inf -> NaN8 Invalid_operation +powx676 power Inf NaN9 -> NaN9 +powx677 power NaN6 Inf -> NaN6 +powx678 power 1 NaN5 -> NaN5 +powx679 power NaN2 1 -> NaN2 +powx680 power NaN2 Nan4 -> NaN2 +powx681 power NaN Nan4 -> NaN +powx682 power NaN345 Nan -> NaN345 +powx683 power Inf -sNaN7 -> -NaN7 Invalid_operation +powx684 power -sNaN8 Inf -> -NaN8 Invalid_operation +powx685 power Inf -NaN9 -> -NaN9 +powx686 power -NaN6 Inf -> -NaN6 +powx687 power -NaN2 -Nan4 -> -NaN2 + +-- long operand and RHS range checks +maxexponent: 999 +minexponent: -999 +precision: 9 +powx701 power 12345678000 1 -> 1.23456780E+10 Rounded +powx702 power 1234567800 1 -> 1.23456780E+9 Rounded +powx703 power 1234567890 1 -> 1.23456789E+9 Rounded +powx704 power 1234567891 1 -> 1.23456789E+9 Inexact Rounded +powx705 power 12345678901 1 -> 1.23456789E+10 Inexact Rounded +powx706 power 1234567896 1 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +powx741 power 12345678000 1 -> 12345678000 +powx742 power 1234567800 1 -> 1234567800 +powx743 power 1234567890 1 -> 1234567890 +powx744 power 1234567891 1 -> 1234567891 +powx745 power 12345678901 1 -> 12345678901 +powx746 power 1234567896 1 -> 1234567896 + +maxexponent: 999999 +minexponent: -999999 +precision: 9 + +-- near out-of-range edge cases +powx163 power '10' '999999' -> '1.00000000E+999999' Rounded +powx164 power '10' '999998' -> '1.00000000E+999998' Rounded +powx165 power '10' '999997' -> '1.00000000E+999997' Rounded +powx166 power '10' '333333' -> '1.00000000E+333333' Rounded +powx183 power '7' '1000000' -> 1.09651419E+845098 Inexact Rounded +powx184 power '7' '1000001' -> 7.67559934E+845098 Inexact Rounded +powx186 power '7' '-1000001' -> 1.30282986E-845099 Inexact Rounded +powx187 power '7' '-1000000' -> 9.11980901E-845099 Inexact Rounded +powx118 power '10' '-333333' -> 1E-333333 +powx119 power '10' '-999998' -> 1E-999998 +powx120 power '10' '-999999' -> 1E-999999 +powx181 power '7' '999998' -> 2.23778406E+845096 Inexact Rounded +powx182 power '7' '999999' -> 1.56644884E+845097 Inexact Rounded +powx189 power '7' '-999999' -> 6.38386631E-845098 Inexact Rounded +powx190 power '7' '-999998' -> 4.46870641E-845097 Inexact Rounded + +-- overflow and underflow tests +precision: 9 + +powx277 power 9 999999 -> 3.59084629E+954241 Inexact Rounded +powx278 power 9.99999999 999999 -> 9.99000501E+999998 Inexact Rounded +powx279 power 10 999999 -> 1.00000000E+999999 Rounded +powx280 power 10.0000001 999999 -> 1.01005016E+999999 Inexact Rounded +powx281 power 10.000001 999999 -> 1.10517080E+999999 Inexact Rounded +powx282 power 10.00001 999999 -> 2.71827775E+999999 Inexact Rounded +powx283 power 10.0001 999999 -> Infinity Overflow Inexact Rounded +powx285 power 11 999999 -> Infinity Overflow Inexact Rounded +powx286 power 12 999999 -> Infinity Overflow Inexact Rounded +powx287 power 999 999999 -> Infinity Overflow Inexact Rounded +powx288 power 999999999 999999 -> Infinity Overflow Inexact Rounded +powx289 power 9.9E999999999 999999 -> Infinity Overflow Inexact Rounded + +powx290 power 0.5 999999 -> 2.02006812E-301030 Inexact Rounded +powx291 power 0.1 999999 -> 1E-999999 -- unrounded +powx292 power 0.09 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx293 power 0.05 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx294 power 0.01 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx295 power 0.0001 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx297 power 0.0000001 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx298 power 0.0000000001 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx299 power 1E-999999999 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +powx310 power -9 999999 -> -3.59084629E+954241 Inexact Rounded +powx311 power -10 999999 -> -1.00000000E+999999 Rounded +powx312 power -10.0001 999999 -> -Infinity Overflow Inexact Rounded +powx313 power -10.1 999999 -> -Infinity Overflow Inexact Rounded +powx314 power -11 999999 -> -Infinity Overflow Inexact Rounded +powx315 power -12 999999 -> -Infinity Overflow Inexact Rounded +powx316 power -999 999999 -> -Infinity Overflow Inexact Rounded +powx317 power -999999 999999 -> -Infinity Overflow Inexact Rounded +powx318 power -999999999 999999 -> -Infinity Overflow Inexact Rounded +powx319 power -9.9E999999999 999999 -> -Infinity Overflow Inexact Rounded + +powx320 power -0.5 999999 -> -2.02006812E-301030 Inexact Rounded +powx321 power -0.1 999999 -> -1E-999999 +powx322 power -0.09 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx323 power -0.05 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx324 power -0.01 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx325 power -0.0001 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx327 power -0.0000001 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx328 power -0.0000000001 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx329 power -1E-999999999 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- note no trim of next result +powx330 power -9 999998 -> 3.98982921E+954240 Inexact Rounded +powx331 power -10 999998 -> 1.00000000E+999998 Rounded +powx332 power -10.0001 999998 -> Infinity Overflow Inexact Rounded +powx333 power -10.1 999998 -> Infinity Overflow Inexact Rounded +powx334 power -11 999998 -> Infinity Overflow Inexact Rounded +powx335 power -12 999998 -> Infinity Overflow Inexact Rounded +powx336 power -999 999998 -> Infinity Overflow Inexact Rounded +powx337 power -999999 999998 -> Infinity Overflow Inexact Rounded +powx338 power -999999999 999998 -> Infinity Overflow Inexact Rounded +powx339 power -9.9E999999999 999998 -> Infinity Overflow Inexact Rounded + +powx340 power -0.5 999998 -> 4.04013624E-301030 Inexact Rounded +powx341 power -0.1 999998 -> 1E-999998 -- NB exact unrounded +powx342 power -0.09 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx343 power -0.05 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx344 power -0.01 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx345 power -0.0001 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx347 power -0.0000001 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx348 power -0.0000000001 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx349 power -1E-999999999 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- some subnormals +precision: 9 +-- [precision is 9, so smallest exponent is -1000000007 +powx350 power 1e-1 500000 -> 1E-500000 +powx351 power 1e-2 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx352 power 1e-2 500000 -> 1E-1000000 Subnormal +powx353 power 1e-2 500001 -> 1E-1000002 Subnormal +powx354 power 1e-2 500002 -> 1E-1000004 Subnormal +powx355 power 1e-2 500003 -> 1E-1000006 Subnormal +powx356 power 1e-2 500004 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +powx360 power 0.010001 500000 -> 5.17176082E-999979 Inexact Rounded +powx361 power 0.010000001 500000 -> 1.0512711E-1000000 Underflow Subnormal Inexact Rounded +powx362 power 0.010000001 500001 -> 1.05127E-1000002 Underflow Subnormal Inexact Rounded +powx363 power 0.0100000009 500000 -> 1.0460279E-1000000 Underflow Subnormal Inexact Rounded +powx364 power 0.0100000001 500000 -> 1.0050125E-1000000 Underflow Subnormal Inexact Rounded +powx365 power 0.01 500000 -> 1E-1000000 Subnormal +powx366 power 0.0099999999 500000 -> 9.950125E-1000001 Underflow Subnormal Inexact Rounded +powx367 power 0.0099999998 500000 -> 9.900498E-1000001 Underflow Subnormal Inexact Rounded +powx368 power 0.0099999997 500000 -> 9.851119E-1000001 Underflow Subnormal Inexact Rounded +powx369 power 0.0099999996 500000 -> 9.801987E-1000001 Underflow Subnormal Inexact Rounded +powx370 power 0.009 500000 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- 1/subnormal -> overflow +powx371 power 1e-1 -500000 -> 1E+500000 +powx372 power 1e-2 -999999 -> Infinity Overflow Inexact Rounded +powx373 power 1e-2 -500000 -> Infinity Overflow Inexact Rounded +powx374 power 1e-2 -500001 -> Infinity Overflow Inexact Rounded +powx375 power 1e-2 -500002 -> Infinity Overflow Inexact Rounded +powx376 power 1e-2 -500003 -> Infinity Overflow Inexact Rounded +powx377 power 1e-2 -500004 -> Infinity Overflow Inexact Rounded + +powx381 power 0.010001 -500000 -> 1.93357743E+999978 Inexact Rounded +powx382 power 0.010000001 -500000 -> 9.51229427E+999999 Inexact Rounded +powx383 power 0.010000001 -500001 -> Infinity Overflow Inexact Rounded +powx384 power 0.0100000009 -500000 -> 9.55997484E+999999 Inexact Rounded +powx385 power 0.0100000001 -500000 -> 9.95012479E+999999 Inexact Rounded +powx386 power 0.01 -500000 -> Infinity Overflow Inexact Rounded +powx387 power 0.009999 -500000 -> Infinity Overflow Inexact Rounded + +-- negative power giving subnormal +powx388 power 100.000001 -500000 -> 9.950125E-1000001 Underflow Subnormal Inexact Rounded + + +-- test some 'false integer' boundaries +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 +powx501 power 100 1E+1 -> 1.000000000000000E+20 Rounded +powx502 power 100 1E+2 -> 1.000000000000000E+200 Rounded +powx503 power 100 1E+3 -> Infinity Overflow Inexact Rounded +powx504 power 100 1E+4 -> Infinity Overflow Inexact Rounded +powx505 power 100 1E+5 -> Infinity Overflow Inexact Rounded +powx506 power 100 1E+6 -> Infinity Overflow Inexact Rounded +powx507 power 100 1E+7 -> Infinity Overflow Inexact Rounded +powx508 power 100 1E+8 -> Infinity Overflow Inexact Rounded +powx509 power 100 1E+9 -> Infinity Overflow Inexact Rounded +powx510 power 100 1E+10 -> Infinity Overflow Inexact Rounded +powx511 power 100 1E+11 -> Infinity Overflow Inexact Rounded +powx512 power 100 1E+12 -> Infinity Overflow Inexact Rounded +powx513 power 100 1E+13 -> Infinity Overflow Inexact Rounded +powx514 power 100 1E+14 -> Infinity Overflow Inexact Rounded +powx515 power 100 1E+15 -> Infinity Overflow Inexact Rounded +powx516 power 100 1E+16 -> Infinity Overflow Inexact Rounded +powx517 power 100 1E+17 -> Infinity Overflow Inexact Rounded +powx518 power 100 1E+18 -> Infinity Overflow Inexact Rounded +powx519 power 100 1E+19 -> Infinity Overflow Inexact Rounded +powx520 power 100 1E+20 -> Infinity Overflow Inexact Rounded +powx521 power 100 1E+21 -> Infinity Overflow Inexact Rounded +powx522 power 100 1E+22 -> Infinity Overflow Inexact Rounded +powx523 power 100 1E+23 -> Infinity Overflow Inexact Rounded +powx524 power 100 1E+24 -> Infinity Overflow Inexact Rounded +powx525 power 100 1E+25 -> Infinity Overflow Inexact Rounded +powx526 power 100 1E+26 -> Infinity Overflow Inexact Rounded +powx527 power 100 1E+27 -> Infinity Overflow Inexact Rounded +powx528 power 100 1E+28 -> Infinity Overflow Inexact Rounded +powx529 power 100 1E+29 -> Infinity Overflow Inexact Rounded +powx530 power 100 1E+30 -> Infinity Overflow Inexact Rounded +powx531 power 100 1E+40 -> Infinity Overflow Inexact Rounded +powx532 power 100 1E+50 -> Infinity Overflow Inexact Rounded +powx533 power 100 1E+100 -> Infinity Overflow Inexact Rounded +powx534 power 100 1E+383 -> Infinity Overflow Inexact Rounded + +-- a check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +powx750 power 1.2347E-40 2 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Null tests +powx900 power 1 # -> NaN Invalid_operation +powx901 power # 1 -> NaN Invalid_operation + +---------------------------------------------------------------------- +-- Below here are tests with a precision or context outside of the -- +-- decNumber 'mathematical functions' restricted range. These -- +-- remain supported in decNumber to minimize breakage, but may be -- +-- outside the range of other implementations. -- +---------------------------------------------------------------------- +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +powx1063 power '10' '999999999' -> '1.00000000E+999999999' Rounded +powx1064 power '10' '999999998' -> '1.00000000E+999999998' Rounded +powx1065 power '10' '999999997' -> '1.00000000E+999999997' Rounded +powx1066 power '10' '333333333' -> '1.00000000E+333333333' Rounded +-- next two are integer-out-of range +powx1183 power '7' '1000000000' -> NaN Invalid_context +powx1184 power '7' '1000000001' -> NaN Invalid_context +powx1186 power '7' '-1000000001' -> 1.38243630E-845098041 Inexact Rounded +powx1187 power '7' '-1000000000' -> 9.67705411E-845098041 Inexact Rounded + +-- out-of-range edge cases +powx1118 power '10' '-333333333' -> 1E-333333333 +powx1119 power '10' '-999999998' -> 1E-999999998 +powx1120 power '10' '-999999999' -> 1E-999999999 +powx1181 power '7' '999999998' -> 2.10892313E+845098038 Inexact Rounded +powx1182 power '7' '999999999' -> 1.47624619E+845098039 Inexact Rounded +powx1189 power '7' '-999999999' -> 6.77393787E-845098040 Inexact Rounded +powx1190 power '7' '-999999998' -> 4.74175651E-845098039 Inexact Rounded + +-- A (rare) case where the last digit is not within 0.5 ULP with classic precision +precision: 9 +powx1215 power "-21971575.0E+31454441" "-7" -> "-4.04549502E-220181139" Inexact Rounded +precision: 20 +powx1216 power "-21971575.0E+31454441" "-7" -> "-4.0454950249324891788E-220181139" Inexact Rounded + +-- overflow and underflow tests +precision: 9 +powx1280 power 9 999999999 -> 3.05550054E+954242508 Inexact Rounded +powx1281 power 10 999999999 -> 1.00000000E+999999999 Rounded +powx1282 power 10.0001 999999999 -> Infinity Overflow Inexact Rounded +powx1283 power 10.1 999999999 -> Infinity Overflow Inexact Rounded +powx1284 power 11 999999999 -> Infinity Overflow Inexact Rounded +powx1285 power 12 999999999 -> Infinity Overflow Inexact Rounded +powx1286 power 999 999999999 -> Infinity Overflow Inexact Rounded +powx1287 power 999999 999999999 -> Infinity Overflow Inexact Rounded +powx1288 power 999999999 999999999 -> Infinity Overflow Inexact Rounded +powx1289 power 9.9E999999999 999999999 -> Infinity Overflow Inexact Rounded + +powx1290 power 0.5 999999999 -> 4.33559594E-301029996 Inexact Rounded +powx1291 power 0.1 999999999 -> 1E-999999999 -- unrounded +powx1292 power 0.09 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1293 power 0.05 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1294 power 0.01 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1295 power 0.0001 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1297 power 0.0000001 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1298 power 0.0000000001 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1299 power 1E-999999999 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +powx1310 power -9 999999999 -> -3.05550054E+954242508 Inexact Rounded +powx1311 power -10 999999999 -> -1.00000000E+999999999 Rounded +powx1312 power -10.0001 999999999 -> -Infinity Overflow Inexact Rounded +powx1313 power -10.1 999999999 -> -Infinity Overflow Inexact Rounded +powx1314 power -11 999999999 -> -Infinity Overflow Inexact Rounded +powx1315 power -12 999999999 -> -Infinity Overflow Inexact Rounded +powx1316 power -999 999999999 -> -Infinity Overflow Inexact Rounded +powx1317 power -999999 999999999 -> -Infinity Overflow Inexact Rounded +powx1318 power -999999999 999999999 -> -Infinity Overflow Inexact Rounded +powx1319 power -9.9E999999999 999999999 -> -Infinity Overflow Inexact Rounded + +powx1320 power -0.5 999999999 -> -4.33559594E-301029996 Inexact Rounded +powx1321 power -0.1 999999999 -> -1E-999999999 +powx1322 power -0.09 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1323 power -0.05 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1324 power -0.01 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1325 power -0.0001 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1327 power -0.0000001 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1328 power -0.0000000001 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1329 power -1E-999999999 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- note no trim of next result +powx1330 power -9 999999998 -> 3.39500060E+954242507 Inexact Rounded +powx1331 power -10 999999998 -> 1.00000000E+999999998 Rounded +powx1332 power -10.0001 999999998 -> Infinity Overflow Inexact Rounded +powx1333 power -10.1 999999998 -> Infinity Overflow Inexact Rounded +powx1334 power -11 999999998 -> Infinity Overflow Inexact Rounded +powx1335 power -12 999999998 -> Infinity Overflow Inexact Rounded +powx1336 power -999 999999998 -> Infinity Overflow Inexact Rounded +powx1337 power -999999 999999998 -> Infinity Overflow Inexact Rounded +powx1338 power -999999999 999999998 -> Infinity Overflow Inexact Rounded +powx1339 power -9.9E999999999 999999998 -> Infinity Overflow Inexact Rounded + +powx1340 power -0.5 999999998 -> 8.67119187E-301029996 Inexact Rounded +powx1341 power -0.1 999999998 -> 1E-999999998 -- NB exact unrounded +powx1342 power -0.09 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1343 power -0.05 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1344 power -0.01 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1345 power -0.0001 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1347 power -0.0000001 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1348 power -0.0000000001 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1349 power -1E-999999999 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- some subnormals +precision: 9 +-- [precision is 9, so smallest exponent is -1000000007 +powx1350 power 1e-1 500000000 -> 1E-500000000 +powx1351 power 1e-2 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1352 power 1e-2 500000000 -> 1E-1000000000 Subnormal +powx1353 power 1e-2 500000001 -> 1E-1000000002 Subnormal +powx1354 power 1e-2 500000002 -> 1E-1000000004 Subnormal +powx1355 power 1e-2 500000003 -> 1E-1000000006 Subnormal +powx1356 power 1e-2 500000004 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +powx1360 power 0.010001 500000000 -> 4.34941988E-999978287 Inexact Rounded +powx1361 power 0.010000001 500000000 -> 5.18469257E-999999979 Inexact Rounded +powx1362 power 0.010000001 500000001 -> 5.18469309E-999999981 Inexact Rounded +powx1363 power 0.0100000009 500000000 -> 3.49342003E-999999981 Inexact Rounded +powx1364 power 0.0100000001 500000000 -> 1.48413155E-999999998 Inexact Rounded +powx1365 power 0.01 500000000 -> 1E-1000000000 Subnormal +powx1366 power 0.0099999999 500000000 -> 6.7379E-1000000003 Underflow Subnormal Inexact Rounded +powx1367 power 0.0099999998 500000000 -> 4.54E-1000000005 Underflow Subnormal Inexact Rounded +powx1368 power 0.0099999997 500000000 -> 3E-1000000007 Underflow Subnormal Inexact Rounded +powx1369 power 0.0099999996 500000000 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1370 power 0.009 500000000 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- 1/subnormal -> overflow +powx1371 power 1e-1 -500000000 -> 1E+500000000 +powx1372 power 1e-2 -999999999 -> Infinity Overflow Inexact Rounded +powx1373 power 1e-2 -500000000 -> Infinity Overflow Inexact Rounded +powx1374 power 1e-2 -500000001 -> Infinity Overflow Inexact Rounded +powx1375 power 1e-2 -500000002 -> Infinity Overflow Inexact Rounded +powx1376 power 1e-2 -500000003 -> Infinity Overflow Inexact Rounded +powx1377 power 1e-2 -500000004 -> Infinity Overflow Inexact Rounded + +powx1381 power 0.010001 -500000000 -> 2.29915719E+999978286 Inexact Rounded +powx1382 power 0.010000001 -500000000 -> 1.92875467E+999999978 Inexact Rounded +powx1383 power 0.010000001 -500000001 -> 1.92875448E+999999980 Inexact Rounded +powx1384 power 0.0100000009 -500000000 -> 2.86252438E+999999980 Inexact Rounded +powx1385 power 0.0100000001 -500000000 -> 6.73794717E+999999997 Inexact Rounded +powx1386 power 0.01 -500000000 -> Infinity Overflow Inexact Rounded +powx1387 power 0.009999 -500000000 -> Infinity Overflow Inexact Rounded + +-- negative power giving subnormal +powx1388 power 100.000001 -500000000 -> 6.7379E-1000000003 Underflow Subnormal Inexact Rounded + +---------------------------------------------------------------------- +-- Below here are the tests with a non-integer rhs, including the -- +-- tests that previously caused Invalid operation. An integer-only -- +-- (on rhs) implementation should handle all the tests above as -- +-- shown, and would flag most of the following tests as Invalid. -- +---------------------------------------------------------------------- +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 + +powx2000 power 7 '10000000000' -> Infinity Overflow Inexact Rounded +powx2001 power 2 '2.000001' -> 4.000002772589683 Inexact Rounded +powx2002 power 2 '2.00000000' -> 4 +powx2003 power 2 '2.000000001' -> 4.000000002772589 Inexact Rounded +powx2004 power 2 '2.0000000001' -> 4.000000000277259 Inexact Rounded +powx2005 power 2 '2.00000000001' -> 4.000000000027726 Inexact Rounded +powx2006 power 2 '2.000000000001' -> 4.000000000002773 Inexact Rounded +powx2007 power 2 '2.0000000000001' -> 4.000000000000277 Inexact Rounded +powx2008 power 2 '2.00000000000001' -> 4.000000000000028 Inexact Rounded +powx2009 power 2 '2.000000000000001' -> 4.000000000000003 Inexact Rounded +powx2010 power 2 '2.0000000000000001' -> 4.000000000000000 Inexact Rounded +-- 1 234567890123456 + +powx2011 power 1 1234 -> 1 +precision: 4 +powx2012 power 1 1234 -> 1 +precision: 3 +powx2013 power 1 1234 -> 1 +powx2014 power 1 12.34e+2 -> 1 +powx2015 power 1 12.3 -> 1.00 Inexact Rounded +powx2016 power 1 12.0 -> 1 +powx2017 power 1 1.01 -> 1.00 Inexact Rounded +powx2018 power 2 1.00 -> 2 +powx2019 power 2 2.00 -> 4 +precision: 9 +powx2030 power 1 1.0001 -> 1.00000000 Inexact Rounded +powx2031 power 1 1.0000001 -> 1.00000000 Inexact Rounded +powx2032 power 1 1.0000000001 -> 1.00000000 Inexact Rounded +powx2033 power 1 1.0000000000001 -> 1.00000000 Inexact Rounded +precision: 5 +powx2034 power 1 1.0001 -> 1.0000 Inexact Rounded +powx2035 power 1 1.0000001 -> 1.0000 Inexact Rounded +powx2036 power 1 1.0000000001 -> 1.0000 Inexact Rounded +powx2037 power 1 1.0000000000001 -> 1.0000 Inexact Rounded +powx2038 power 1 1.0000000000001 -> 1.0000 Inexact Rounded + +rounding: ceiling +precision: 3 +powx2039 power 1 1.01 -> 1.00 Inexact Rounded +powx2040 power 1 12.3 -> 1.00 Inexact Rounded +rounding: half_even + +-- 1 ** any integer, including big ones, should be exact +powx2041 power 1 1000000000 -> 1 +powx2042 power 1 9999999999 -> 1 +powx2043 power 1 12345678000 -> 1 +powx2044 power 1 1234567800 -> 1 +powx2045 power 1 1234567890 -> 1 +powx2046 power 1 11234567891 -> 1 +powx2047 power 1 12345678901 -> 1 +powx2048 power 1 1234567896 -> 1 +powx2049 power 1 -1234567896 -> 1 +powx2051 power 1 1000000000 -> 1 +powx2052 power 1 -1000000000 -> 1 +powx2053 power 1 12345678000 -> 1 +powx2054 power 1 -1234567896 -> 1 +powx2055 power 1 1000000000 -> 1 +powx2056 power 1 4300000000 -> 1 +powx2057 power 1 -1000000000 -> 1 +-- negatives ... but not out of range for decNumber +powx2061 power -1 100000 -> 1 +powx2062 power -1 999999 -> -1 +powx2063 power -1 1278000 -> 1 +powx2064 power -1 127803 -> -1 +powx2065 power -1 127890 -> 1 +powx2066 power -1 1167891 -> -1 +powx2067 power -1 1278901 -> -1 +powx2068 power -1 127896 -> 1 +powx2069 power -1 -167897 -> -1 +powx2071 power -1 100000 -> 1 +powx2072 power -1 -100001 -> -1 +powx2073 power -1 1278000 -> 1 +powx2074 power -1 -167896 -> 1 +powx2075 power -1 100000 -> 1 +powx2076 power -1 -100009 -> -1 + +-- The above were derived from the earlier version of power.decTest; +-- now start new tests for power(x,y) for non-integer y +precision: 9 + +-- tests from specification +powx2081 power 2 3 -> '8' +powx2082 power -2 3 -> '-8' +powx2083 power 2 -3 -> '0.125' +powx2084 power 1.7 '8' -> '69.7575744' Inexact Rounded +powx2085 power 10 0.301029996 -> 2.00000000 Inexact Rounded +powx2086 power Infinity '-1' -> '0' +powx2087 power Infinity '0' -> '1' +powx2088 power Infinity '1' -> 'Infinity' +powx2089 power -Infinity '-1' -> '-0' +powx2090 power -Infinity '0' -> '1' +powx2091 power -Infinity '1' -> '-Infinity' +powx2092 power -Infinity '2' -> 'Infinity' +powx2093 power 0 0 -> 'NaN' Invalid_operation + +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 + +-- basics +powx2100 power 1E-7 1E-7 -> 0.9999983881917339 Inexact Rounded +powx2101 power 0.003 1E-7 -> 0.9999994190858697 Inexact Rounded +powx2102 power 0.7 1E-7 -> 0.9999999643325062 Inexact Rounded +powx2103 power 1.2 1E-7 -> 1.000000018232156 Inexact Rounded +powx2104 power 71 1E-7 -> 1.000000426268079 Inexact Rounded +powx2105 power 9E+9 1E-7 -> 1.000002292051668 Inexact Rounded + +powx2110 power 1E-7 0.003 -> 0.9527961640236519 Inexact Rounded +powx2111 power 0.003 0.003 -> 0.9827235503366797 Inexact Rounded +powx2112 power 0.7 0.003 -> 0.9989305474406207 Inexact Rounded +powx2113 power 1.2 0.003 -> 1.000547114282834 Inexact Rounded +powx2114 power 71 0.003 -> 1.012870156273545 Inexact Rounded +powx2115 power 9E+9 0.003 -> 1.071180671278787 Inexact Rounded + +powx2120 power 1E-7 0.7 -> 0.00001258925411794167 Inexact Rounded +powx2121 power 0.003 0.7 -> 0.01713897630281030 Inexact Rounded +powx2122 power 0.7 0.7 -> 0.7790559126704491 Inexact Rounded +powx2123 power 1.2 0.7 -> 1.136126977198889 Inexact Rounded +powx2124 power 71 0.7 -> 19.76427300093870 Inexact Rounded +powx2125 power 9E+9 0.7 -> 9289016.976853710 Inexact Rounded + +powx2130 power 1E-7 1.2 -> 3.981071705534973E-9 Inexact Rounded +powx2131 power 0.003 1.2 -> 0.0009387403933595694 Inexact Rounded +powx2132 power 0.7 1.2 -> 0.6518049405663864 Inexact Rounded +powx2133 power 1.2 1.2 -> 1.244564747203978 Inexact Rounded +powx2134 power 71 1.2 -> 166.5367244638552 Inexact Rounded +powx2135 power 9E+9 1.2 -> 881233526124.8791 Inexact Rounded + +powx2140 power 1E-7 71 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2141 power 0.003 71 -> 7.509466514979725E-180 Inexact Rounded +powx2142 power 0.7 71 -> 1.004525211269079E-11 Inexact Rounded +powx2143 power 1.2 71 -> 418666.7483186515 Inexact Rounded +powx2144 power 71 71 -> 2.750063734834616E+131 Inexact Rounded +powx2145 power 9E+9 71 -> Infinity Inexact Rounded Overflow + +powx2150 power 1E-7 9E+9 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2151 power 0.003 9E+9 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2152 power 0.7 9E+9 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2153 power 1.2 9E+9 -> Infinity Inexact Rounded Overflow +powx2154 power 71 9E+9 -> Infinity Inexact Rounded Overflow +powx2155 power 9E+9 9E+9 -> Infinity Inexact Rounded Overflow + +-- number line milestones with lhs<1 and lhs>1 + +-- Overflow boundary (Nmax) +powx2202 power 71 207.966651583983200 -> Infinity Inexact Rounded Overflow +powx2201 power 71 207.966651583983199 -> 9.999999999999994E+384 Inexact Rounded +powx2204 power 0.003 -152.603449817093577 -> Infinity Inexact Rounded Overflow +powx2203 power 0.003 -152.603449817093576 -> 9.999999999999994E+384 Inexact Rounded + +-- Nmin boundary +powx2211 power 71 -206.886305341988480 -> 1.000000000000005E-383 Inexact Rounded +powx2212 power 71 -206.886305341988481 -> 1.000000000000001E-383 Inexact Rounded +powx2213 power 71 -206.886305341988482 -> 9.99999999999997E-384 Inexact Rounded Underflow Subnormal +powx2214 power 71 -206.886305341988483 -> 9.99999999999992E-384 Inexact Rounded Underflow Subnormal +-- 9.999999999999924565357019820 + +powx2215 power 0.003 151.810704623238543 -> 1.000000000000009E-383 Inexact Rounded +powx2216 power 0.003 151.810704623238544 -> 1.000000000000003E-383 Inexact Rounded +powx2217 power 0.003 151.810704623238545 -> 9.99999999999997E-384 Inexact Rounded Underflow Subnormal +powx2218 power 0.003 151.810704623238546 -> 9.99999999999991E-384 Inexact Rounded Underflow Subnormal + +-- Ntiny boundary, these edge cases determined using half_up rounding +rounding: half_up +powx2221 power 71 -215.151510469220498 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2222 power 71 -215.151510469220499 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2223 power 71 -215.151510469220500 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2224 power 71 -215.151510469220501 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped + +powx2225 power 0.003 157.875613618285691 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2226 power 0.003 157.875613618285692 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2227 power 0.003 157.875613618285693 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2228 power 0.003 220 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +rounding: half_even + +-- power(10, y) are important ... + +-- Integer powers are exact, unless over/underflow +powx2301 power 10 385 -> Infinity Overflow Inexact Rounded +powx2302 power 10 384 -> 1.000000000000000E+384 Rounded +powx2303 power 10 17 -> 1.000000000000000E+17 Rounded +powx2304 power 10 16 -> 1.000000000000000E+16 Rounded +powx2305 power 10 15 -> 1000000000000000 +powx2306 power 10 10 -> 10000000000 +powx2307 power 10 5 -> 100000 +powx2308 power 10 1 -> 10 +powx2309 power 10 0 -> 1 +powx2310 power 10 -1 -> 0.1 +powx2311 power 10 -5 -> 0.00001 +powx2312 power 10 -6 -> 0.000001 +powx2313 power 10 -7 -> 1E-7 +powx2314 power 10 -8 -> 1E-8 +powx2315 power 10 -9 -> 1E-9 +powx2316 power 10 -10 -> 1E-10 +powx2317 power 10 -383 -> 1E-383 +powx2318 power 10 -384 -> 1E-384 Subnormal +powx2319 power 10 -385 -> 1E-385 Subnormal +powx2320 power 10 -397 -> 1E-397 Subnormal +powx2321 power 10 -398 -> 1E-398 Subnormal +powx2322 power 10 -399 -> 0E-398 Subnormal Underflow Inexact Rounded Clamped +powx2323 power 10 -400 -> 0E-398 Subnormal Underflow Inexact Rounded Clamped + +-- Independent sanity check: 1961 Godfrey & Siddons four-figure logs +powx2351 power 10 0.0000 -> 1 +powx2352 power 10 0.3010 -> 1.999861869632744 Inexact Rounded +powx2353 power 10 0.4771 -> 2.999853181190793 Inexact Rounded +powx2354 power 10 0.6021 -> 4.000368510461250 Inexact Rounded +powx2355 power 10 0.6990 -> 5.000345349769785 Inexact Rounded +powx2356 power 10 0.7782 -> 6.000673538641164 Inexact Rounded +powx2357 power 10 0.8451 -> 7.000031591308969 Inexact Rounded +powx2358 power 10 0.9031 -> 8.000184448550990 Inexact Rounded +powx2359 power 10 0.9542 -> 8.999119108700520 Inexact Rounded +powx2360 power 10 0.9956 -> 9.899197750805841 Inexact Rounded +powx2361 power 10 0.9996 -> 9.990793899844618 Inexact Rounded +precision: 4 +powx2371 power 10 0.0000 -> 1 +powx2372 power 10 0.3010 -> 2.000 Inexact Rounded +powx2373 power 10 0.4771 -> 3.000 Inexact Rounded +powx2374 power 10 0.6021 -> 4.000 Inexact Rounded +powx2375 power 10 0.6990 -> 5.000 Inexact Rounded +powx2376 power 10 0.7782 -> 6.001 Inexact Rounded +powx2377 power 10 0.8451 -> 7.000 Inexact Rounded +powx2378 power 10 0.9031 -> 8.000 Inexact Rounded +powx2379 power 10 0.9542 -> 8.999 Inexact Rounded +powx2380 power 10 0.9956 -> 9.899 Inexact Rounded +powx2381 power 10 0.9996 -> 9.991 Inexact Rounded + +-- 10**x ~=2 (inverse of the test in log10.decTest) +precision: 50 +powx2401 power 10 0.30102999566398119521373889472449302676818988146211 -> 2.0000000000000000000000000000000000000000000000000 Inexact Rounded +precision: 49 +powx2402 power 10 0.3010299956639811952137388947244930267681898814621 -> 2.000000000000000000000000000000000000000000000000 Inexact Rounded +precision: 48 +powx2403 power 10 0.301029995663981195213738894724493026768189881462 -> 2.00000000000000000000000000000000000000000000000 Inexact Rounded +precision: 47 +powx2404 power 10 0.30102999566398119521373889472449302676818988146 -> 2.0000000000000000000000000000000000000000000000 Inexact Rounded +precision: 46 +powx2405 power 10 0.3010299956639811952137388947244930267681898815 -> 2.000000000000000000000000000000000000000000000 Inexact Rounded +precision: 45 +powx2406 power 10 0.301029995663981195213738894724493026768189881 -> 2.00000000000000000000000000000000000000000000 Inexact Rounded +precision: 44 +powx2407 power 10 0.30102999566398119521373889472449302676818988 -> 2.0000000000000000000000000000000000000000000 Inexact Rounded +precision: 43 +powx2408 power 10 0.3010299956639811952137388947244930267681899 -> 2.000000000000000000000000000000000000000000 Inexact Rounded +precision: 42 +powx2409 power 10 0.301029995663981195213738894724493026768190 -> 2.00000000000000000000000000000000000000000 Inexact Rounded +precision: 41 +powx2410 power 10 0.30102999566398119521373889472449302676819 -> 2.0000000000000000000000000000000000000000 Inexact Rounded +precision: 40 +powx2411 power 10 0.3010299956639811952137388947244930267682 -> 2.000000000000000000000000000000000000000 Inexact Rounded +precision: 39 +powx2412 power 10 0.301029995663981195213738894724493026768 -> 2.00000000000000000000000000000000000000 Inexact Rounded +precision: 38 +powx2413 power 10 0.30102999566398119521373889472449302677 -> 2.0000000000000000000000000000000000000 Inexact Rounded +precision: 37 +powx2414 power 10 0.3010299956639811952137388947244930268 -> 2.000000000000000000000000000000000000 Inexact Rounded +precision: 36 +powx2415 power 10 0.301029995663981195213738894724493027 -> 2.00000000000000000000000000000000000 Inexact Rounded +precision: 35 +powx2416 power 10 0.30102999566398119521373889472449303 -> 2.0000000000000000000000000000000000 Inexact Rounded +precision: 34 +powx2417 power 10 0.3010299956639811952137388947244930 -> 2.000000000000000000000000000000000 Inexact Rounded +precision: 33 +powx2418 power 10 0.301029995663981195213738894724493 -> 2.00000000000000000000000000000000 Inexact Rounded +precision: 32 +powx2419 power 10 0.30102999566398119521373889472449 -> 2.0000000000000000000000000000000 Inexact Rounded +precision: 31 +powx2420 power 10 0.3010299956639811952137388947245 -> 2.000000000000000000000000000000 Inexact Rounded +precision: 30 +powx2421 power 10 0.301029995663981195213738894725 -> 2.00000000000000000000000000000 Inexact Rounded +precision: 29 +powx2422 power 10 0.30102999566398119521373889472 -> 2.0000000000000000000000000000 Inexact Rounded +precision: 28 +powx2423 power 10 0.3010299956639811952137388947 -> 2.000000000000000000000000000 Inexact Rounded +precision: 27 +powx2424 power 10 0.301029995663981195213738895 -> 2.00000000000000000000000000 Inexact Rounded +precision: 26 +powx2425 power 10 0.30102999566398119521373889 -> 2.0000000000000000000000000 Inexact Rounded +precision: 25 +powx2426 power 10 0.3010299956639811952137389 -> 2.000000000000000000000000 Inexact Rounded +precision: 24 +powx2427 power 10 0.301029995663981195213739 -> 2.00000000000000000000000 Inexact Rounded +precision: 23 +powx2428 power 10 0.30102999566398119521374 -> 2.0000000000000000000000 Inexact Rounded +precision: 22 +powx2429 power 10 0.3010299956639811952137 -> 2.000000000000000000000 Inexact Rounded +precision: 21 +powx2430 power 10 0.301029995663981195214 -> 2.00000000000000000000 Inexact Rounded +precision: 20 +powx2431 power 10 0.30102999566398119521 -> 2.0000000000000000000 Inexact Rounded +precision: 19 +powx2432 power 10 0.3010299956639811952 -> 2.000000000000000000 Inexact Rounded +precision: 18 +powx2433 power 10 0.301029995663981195 -> 2.00000000000000000 Inexact Rounded +precision: 17 +powx2434 power 10 0.30102999566398120 -> 2.0000000000000000 Inexact Rounded +precision: 16 +powx2435 power 10 0.3010299956639812 -> 2.000000000000000 Inexact Rounded +precision: 15 +powx2436 power 10 0.301029995663981 -> 2.00000000000000 Inexact Rounded +precision: 14 +powx2437 power 10 0.30102999566398 -> 2.0000000000000 Inexact Rounded +precision: 13 +powx2438 power 10 0.3010299956640 -> 2.000000000000 Inexact Rounded +precision: 12 +powx2439 power 10 0.301029995664 -> 2.00000000000 Inexact Rounded +precision: 11 +powx2440 power 10 0.30102999566 -> 2.0000000000 Inexact Rounded +precision: 10 +powx2441 power 10 0.3010299957 -> 2.000000000 Inexact Rounded +precision: 9 +powx2442 power 10 0.301029996 -> 2.00000000 Inexact Rounded +precision: 8 +powx2443 power 10 0.30103000 -> 2.0000000 Inexact Rounded +precision: 7 +powx2444 power 10 0.3010300 -> 2.000000 Inexact Rounded +precision: 6 +powx2445 power 10 0.301030 -> 2.00000 Inexact Rounded +precision: 5 +powx2446 power 10 0.30103 -> 2.0000 Inexact Rounded +precision: 4 +powx2447 power 10 0.3010 -> 2.000 Inexact Rounded +precision: 3 +powx2448 power 10 0.301 -> 2.00 Inexact Rounded +precision: 2 +powx2449 power 10 0.30 -> 2.0 Inexact Rounded +precision: 1 +powx2450 power 10 0.3 -> 2 Inexact Rounded + +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- Close-to-e tests +precision: 34 +powx2500 power 10 0.4342944819032518276511289189166048 -> 2.718281828459045235360287471352661 Inexact Rounded +powx2501 power 10 0.4342944819032518276511289189166049 -> 2.718281828459045235360287471352661 Inexact Rounded +powx2502 power 10 0.4342944819032518276511289189166050 -> 2.718281828459045235360287471352662 Inexact Rounded +powx2503 power 10 0.4342944819032518276511289189166051 -> 2.718281828459045235360287471352663 Inexact Rounded +powx2504 power 10 0.4342944819032518276511289189166052 -> 2.718281828459045235360287471352663 Inexact Rounded + +-- e**e, 16->34 +powx2505 power 2.718281828459045 2.718281828459045 -> '15.15426224147925705633739513098219' Inexact Rounded + +-- Sequence around an integer +powx2512 power 10 2.9999999999999999999999999999999997 -> 999.9999999999999999999999999999993 Inexact Rounded +powx2513 power 10 2.9999999999999999999999999999999998 -> 999.9999999999999999999999999999995 Inexact Rounded +powx2514 power 10 2.9999999999999999999999999999999999 -> 999.9999999999999999999999999999998 Inexact Rounded +powx2515 power 10 3.0000000000000000000000000000000000 -> 1000 +powx2516 power 10 3.0000000000000000000000000000000001 -> 1000.000000000000000000000000000000 Inexact Rounded +powx2517 power 10 3.0000000000000000000000000000000002 -> 1000.000000000000000000000000000000 Inexact Rounded +powx2518 power 10 3.0000000000000000000000000000000003 -> 1000.000000000000000000000000000001 Inexact Rounded + +-- randomly generated tests +maxExponent: 384 +minExponent: -383 + +-- P=34, within 0-999 -- positive arg2 +Precision: 34 +powx3201 power 5.301557744131969249145904611290735 369.3175647984435534243813466380579 -> 3.427165676345688240023113326603960E+267 Inexact Rounded +powx3202 power 0.0000000000506875655819165973738225 21.93514102704466434121826965196878 -> 1.498169860033487321566659495340789E-226 Inexact Rounded +powx3203 power 97.88877680721519917858007810494043 5.159898445242793470476673109899554 -> 18705942904.43290467281449559427982 Inexact Rounded +powx3204 power 7.380441015594399747973924380493799 17.93614173904818313507525109033288 -> 3715757985820076.273336082702577274 Inexact Rounded +powx3205 power 2.045623627647350918819219169855040 1082.999652407430697958175966996254 -> 4.208806435006704867447150904279854E+336 Inexact Rounded +powx3206 power 0.0000000762582873112118926142955423 20.30534237055073996975203864170432 -> 2.967574278677013090697130349198877E-145 Inexact Rounded +powx3207 power 0.0000000000194091470907814855660535 14.71164213947722238856835440242911 -> 2.564391397469554735037158345963280E-158 Inexact Rounded +powx3208 power 0.0000000000509434185382818596853504 20.97051498204188277347203735421595 -> 1.420157372748083000927138678417272E-216 Inexact Rounded +powx3209 power 0.0005389217212073307301395750745119 43.96798225485747315858678755538971 -> 1.957850185781292007977898626137240E-144 Inexact Rounded +powx3210 power 498.5690105989136050444077447411198 128.1038813807243375878831104745803 -> 3.882212970903893127009102293596268E+345 Inexact Rounded +powx3211 power 0.0000000935428918637303954281938975 5.736933454863278597460091596496099 -> 4.733219644540496152403967823635195E-41 Inexact Rounded +powx3212 power 8.581586784734161309180363110126352 252.0229459968869784643374981477208 -> 1.907464842458674622356177850049873E+235 Inexact Rounded +powx3213 power 294.1005302951621709143320795278305 155.5466374141708615975111014663722 -> 9.251717033292072959166737280729728E+383 Inexact Rounded +powx3214 power 0.0000000041253343654396865855722090 19.00170974760425576247662125110472 -> 4.779566288553864405790921353593512E-160 Inexact Rounded +powx3215 power 0.0000000000046912257352141395184092 24.66089523148729269098773236636878 -> 4.205126874048597849476723538057527E-280 Inexact Rounded +powx3216 power 0.0000000000036796674296520639450494 22.09713956900694689234335912523078 -> 2.173081843837539818472071316420405E-253 Inexact Rounded +powx3217 power 9.659887100303037657934372148567685 277.3765665424320875993026404492216 -> 1.614974043145519382749740616665041E+273 Inexact Rounded +powx3218 power 0.0000083231310642229204398943076403 29.33123211782131466471359128190372 -> 1.013330439786660210757226597785328E-149 Inexact Rounded +powx3219 power 0.0938084859086450954956863725653664 262.6091918199905272837286784975012 -> 1.262802485286301066967555821509344E-270 Inexact Rounded +powx3220 power 8.194926977580900145696305910223304 184.3705133945546202012995485297248 -> 2.696353910907824016690021495828584E+168 Inexact Rounded +powx3221 power 72.39594594653085161522285114566120 168.7721909489321402152033939836725 -> 7.379858293630460043361584410795031E+313 Inexact Rounded +powx3222 power 0.0000000000003436856010144185445537 26.34329868961274988994452526178983 -> 4.585379573595865689605567720192768E-329 Inexact Rounded +powx3223 power 20.18365633762226550254542489492623 127.2099705237021350103678072707790 -> 1.020919629336979353690271762206060E+166 Inexact Rounded +powx3224 power 0.0000000553723990761530290129268131 8.157597566134754638015199501162405 -> 6.349030513396147480954474615067145E-60 Inexact Rounded +powx3225 power 0.0001028742674265840656614682618035 93.99842317306603797965470281716482 -> 1.455871110222736531854990397769940E-375 Inexact Rounded +powx3226 power 95.90195152775543876489746343266050 143.5992850002211509777720799352475 -> 3.881540015848530405189834366588567E+284 Inexact Rounded +powx3227 power 0.0000000000041783747057233878360333 12.14591167764993506821334760954430 -> 6.190998557456885985124592807383163E-139 Inexact Rounded +powx3228 power 0.5572830497086740798434917090018768 1001.921811263919522230330241349166 -> 3.871145158537170450093833881625838E-255 Inexact Rounded +powx3229 power 516.4754759779093954790813881333232 29.23812463126309057800793645336343 -> 2.110986192408878294012450052929185E+79 Inexact Rounded +powx3230 power 0.0000835892099464584776847299020706 27.64279992884843877453592659341588 -> 1.891535098905506689512376224943293E-113 Inexact Rounded +powx3231 power 72.45836577748571838139900165184955 166.2562890735032545091688015160084 -> 1.784091549041561516923092542939141E+309 Inexact Rounded +powx3232 power 305.1823317643335924007629563009032 83.01065159508472884219290136319623 -> 1.757493136164395229602456782779110E+206 Inexact Rounded +powx3233 power 7.108527102951713603542835791733786 145.7057852766236365450463428821948 -> 1.285934774113104362663619896550528E+124 Inexact Rounded +powx3234 power 6.471393503175464828149365697049824 64.11741937262455725284754171995720 -> 9.978990355881803195280027533011699E+51 Inexact Rounded +powx3235 power 39.72898094138459885662380866268385 239.9677288017447400786672779735168 -> 5.422218208517098335832848487375086E+383 Inexact Rounded +powx3236 power 0.0002865592332736973000183287329933 90.34733869590583787065642532641096 -> 8.293733126976212033209243257136796E-321 Inexact Rounded +powx3237 power 0.0000011343384394864811195077357936 1.926568285528399656789140809399396 -> 3.516055639378350146874261077470142E-12 Inexact Rounded +powx3238 power 0.0000000035321610295065299384889224 7.583861778824284092434085265265582 -> 7.970899823817369764381976286536230E-65 Inexact Rounded +powx3239 power 657.5028301569352677543770758346683 90.55778453811965116200206020172758 -> 1.522530898581564200655160665723268E+255 Inexact Rounded +powx3240 power 8.484756398325748879450577520251447 389.7468292476262478578280531222417 -> 8.595142803587368093392510310811218E+361 Inexact Rounded + +-- P=16, within 0-99 -- positive arg2 +Precision: 16 +powx3101 power 0.0000215524639223 48.37532522355252 -> 1.804663257287277E-226 Inexact Rounded +powx3102 power 00.80705856227999 2706.777535121391 -> 1.029625065876157E-252 Inexact Rounded +powx3103 power 3.445441676383689 428.5185892455830 -> 1.657401683096454E+230 Inexact Rounded +powx3104 power 0.0040158689495826 159.5725558816240 -> 4.255743665762492E-383 Inexact Rounded +powx3105 power 0.0000841553281215 38.32504413453944 -> 6.738653902512052E-157 Inexact Rounded +powx3106 power 0.7322610252571353 502.1254457674118 -> 1.109978126985943E-68 Inexact Rounded +powx3107 power 10.75052532144880 67.34180604734781 -> 2.873015019470189E+69 Inexact Rounded +powx3108 power 26.20425952945617 104.6002671186488 -> 2.301859355777030E+148 Inexact Rounded +powx3109 power 0.0000055737473850 31.16285859005424 -> 1.883348470100446E-164 Inexact Rounded +powx3110 power 61.06096011360700 10.93608439088726 -> 3.382686473028249E+19 Inexact Rounded +powx3111 power 9.340880853257137 179.9094938131726 -> 3.819299795937696E+174 Inexact Rounded +powx3112 power 0.0000050767371756 72.03346394186741 -> 4.216236691569869E-382 Inexact Rounded +powx3113 power 6.838478807860596 47.49665590602285 -> 4.547621630099203E+39 Inexact Rounded +powx3114 power 0.1299324346439081 397.7440523576938 -> 3.065047705553981E-353 Inexact Rounded +powx3115 power 0.0003418047034264 20.00516791512018 -> 4.546189665380487E-70 Inexact Rounded +powx3116 power 0.0001276899611715 78.12968287355703 -> 5.960217405063995E-305 Inexact Rounded +powx3117 power 25.93160588180509 252.6245071004620 -> 1.472171597589146E+357 Inexact Rounded +powx3118 power 35.47516857763178 86.14723037360925 -> 3.324299908481125E+133 Inexact Rounded +powx3119 power 0.0000048171086721 43.31965603038666 -> 4.572331516616228E-231 Inexact Rounded +powx3120 power 17.97652681097851 144.4684576550292 -> 1.842509906097860E+181 Inexact Rounded +powx3121 power 3.622765141518729 305.1948680344950 -> 4.132320967578704E+170 Inexact Rounded +powx3122 power 0.0080959002453519 143.9899444945627 -> 6.474627812947047E-302 Inexact Rounded +powx3123 power 9.841699927276571 299.2466668837188 -> 1.489097656208736E+297 Inexact Rounded +powx3124 power 0.0786659206232355 347.4750796962570 -> 2.05764809646925E-384 Inexact Rounded Underflow Subnormal +powx3125 power 0.0000084459792645 52.47348690745487 -> 6.076251876516942E-267 Inexact Rounded +powx3126 power 27.86589909967504 191.7296537102283 -> 1.157064112989386E+277 Inexact Rounded +powx3127 power 0.0000419907937234 58.44957702730767 -> 1.496950672075162E-256 Inexact Rounded +powx3128 power 0.0000664977739382 80.06749213261876 -> 3.488517620107875E-335 Inexact Rounded +powx3129 power 58.49554484886656 125.8480768373499 -> 2.449089862146640E+222 Inexact Rounded +powx3130 power 15.02820060024449 212.3527988973338 -> 8.307913932682067E+249 Inexact Rounded +powx3131 power 0.0002650089942992 30.92173123678761 -> 2.517827664836147E-111 Inexact Rounded +powx3132 power 0.0007342977426578 69.49168880741123 -> 1.600168665674440E-218 Inexact Rounded +powx3133 power 0.0063816068650629 150.1400094183812 -> 2.705057295799001E-330 Inexact Rounded +powx3134 power 9.912921122728791 297.8274013633411 -> 4.967624993438900E+296 Inexact Rounded +powx3135 power 1.988603563989245 768.4862967922182 -> 2.692842474899596E+229 Inexact Rounded +powx3136 power 8.418014519517691 164.2431359980725 -> 9.106211585888836E+151 Inexact Rounded +powx3137 power 6.068823604450686 120.2955212365837 -> 1.599431918105982E+94 Inexact Rounded +powx3138 power 56.90062738303850 54.90468294683645 -> 2.312839177902428E+96 Inexact Rounded +powx3139 power 5.710905139750871 73.44608752962156 -> 3.775876053709929E+55 Inexact Rounded +powx3140 power 0.0000017446761203 1.223981492228899 -> 8.952936595465635E-8 Inexact Rounded + +-- P=7, within 0-9 -- positive arg2 +Precision: 7 +powx3001 power 8.738689 55.96523 -> 4.878180E+52 Inexact Rounded +powx3002 power 0.0404763 147.4965 -> 3.689722E-206 Inexact Rounded +powx3003 power 0.0604232 76.69778 -> 3.319183E-94 Inexact Rounded +powx3004 power 0.0058855 107.5018 -> 1.768875E-240 Inexact Rounded +powx3005 power 2.058302 1173.050 -> 5.778899E+367 Inexact Rounded +powx3006 power 0.0056998 85.70157 -> 4.716783E-193 Inexact Rounded +powx3007 power 0.8169297 3693.537 -> 4.475962E-325 Inexact Rounded +powx3008 power 0.2810153 659.9568 -> 1.533177E-364 Inexact Rounded +powx3009 power 4.617478 15.68308 -> 2.629748E+10 Inexact Rounded +powx3010 power 0.0296418 244.2302 -> 6.207949E-374 Inexact Rounded +powx3011 power 0.0036456 127.9987 -> 8.120891E-313 Inexact Rounded +powx3012 power 0.5012813 577.5418 -> 6.088802E-174 Inexact Rounded +powx3013 power 0.0033275 119.9800 -> 5.055049E-298 Inexact Rounded +powx3014 power 0.0037652 111.7092 -> 1.560351E-271 Inexact Rounded +powx3015 power 0.6463252 239.0568 -> 4.864564E-46 Inexact Rounded +powx3016 power 4.784378 475.0521 -> 8.964460E+322 Inexact Rounded +powx3017 power 4.610305 563.1791 -> 6.290298E+373 Inexact Rounded +powx3018 power 0.0175167 80.52208 -> 3.623472E-142 Inexact Rounded +powx3019 power 5.238307 356.7944 -> 4.011461E+256 Inexact Rounded +powx3020 power 0.0003527 96.26347 -> 4.377932E-333 Inexact Rounded +powx3021 power 0.0015155 136.0516 -> 2.57113E-384 Inexact Rounded Underflow Subnormal +powx3022 power 5.753573 273.2340 -> 4.373184E+207 Inexact Rounded +powx3023 power 7.778665 332.7917 -> 3.060640E+296 Inexact Rounded +powx3024 power 1.432479 2046.064 -> 2.325829E+319 Inexact Rounded +powx3025 power 5.610516 136.4563 -> 1.607502E+102 Inexact Rounded +powx3026 power 0.0050697 137.4513 -> 3.522315E-316 Inexact Rounded +powx3027 power 5.678737 85.16253 -> 1.713909E+64 Inexact Rounded +powx3028 power 0.0816167 236.1973 -> 9.228802E-258 Inexact Rounded +powx3029 power 0.2602805 562.0157 -> 2.944556E-329 Inexact Rounded +powx3030 power 0.0080936 24.25367 -> 1.839755E-51 Inexact Rounded +powx3031 power 4.092016 82.94603 -> 5.724948E+50 Inexact Rounded +powx3032 power 0.0078255 7.204184 -> 6.675342E-16 Inexact Rounded +powx3033 power 0.9917693 29846.44 -> 7.430177E-108 Inexact Rounded +powx3034 power 1.610380 301.2467 -> 2.170142E+62 Inexact Rounded +powx3035 power 0.0588236 212.1097 -> 1.023196E-261 Inexact Rounded +powx3036 power 2.498069 531.4647 -> 2.054561E+211 Inexact Rounded +powx3037 power 9.964342 326.5438 -> 1.089452E+326 Inexact Rounded +powx3038 power 0.0820626 268.8718 -> 1.107350E-292 Inexact Rounded +powx3039 power 6.176486 360.7779 -> 1.914449E+285 Inexact Rounded +powx3040 power 4.206363 16.17288 -> 1.231314E+10 Inexact Rounded + +-- P=34, within 0-999 -- negative arg2 +Precision: 34 +powx3701 power 376.0915270000109486633402827007902 -35.69822349904102131649243701958463 -> 1.165722831225506457828653413200143E-92 Inexact Rounded +powx3702 power 0.0000000503747440074613191665845314 -9.520308341497979093021813571450575 -> 3.000432478861883953977971226770410E+69 Inexact Rounded +powx3703 power 290.6858731495339778337953407938308 -118.5459048597789693292455673428367 -> 9.357969047113989238392527565200302E-293 Inexact Rounded +powx3704 power 4.598864607620052062908700928454182 -299.8323667698931125720218537483753 -> 2.069641269855413539579128114448478E-199 Inexact Rounded +powx3705 power 2.556952676986830645708349254938903 -425.1755373251941383147998924703593 -> 4.428799777833598654260883861514638E-174 Inexact Rounded +powx3706 power 0.0000005656198763404221986640610118 -32.83361380678301321230028730075315 -> 1.340270622401829145968477601029251E+205 Inexact Rounded +powx3707 power 012.4841978642452960750801410372125 -214.3734291828712962809866663321921 -> 9.319857751170603140459057535971202E-236 Inexact Rounded +powx3708 power 0.0000000056041586148066919174315551 -37.21129049213858341528033343116533 -> 1.118345010652454313186702341873169E+307 Inexact Rounded +powx3709 power 0.0694569218941833767199998804202152 -8.697509072368973932501239815677732 -> 11862866995.51026489032838174290271 Inexact Rounded +powx3710 power 6.380984024259450398729243522354144 -451.0635696889193561457985486366827 -> 8.800353109387322474809325670314330E-364 Inexact Rounded +powx3711 power 786.0264840756809048288007204917801 -43.09935384678762773057342161718540 -> 1.616324183365644133979585419925934E-125 Inexact Rounded +powx3712 power 96.07836427113204744101287948445130 -185.1414572546330024388914720271876 -> 8.586320815218383004023264980018610E-368 Inexact Rounded +powx3713 power 0.0000000002332189796855870659792406 -5.779561613164628076880609893753327 -> 4.678450775876385793618570483345066E+55 Inexact Rounded +powx3714 power 0.7254146672024602242369943237968857 -2115.512891397828615710130092245691 -> 8.539080958041689288202111403102495E+294 Inexact Rounded +powx3715 power 0.0017380543649702864796144008592137 -6.307668017761022788220578633538713 -> 256309141459075651.2275798017695017 Inexact Rounded +powx3716 power 05.29498758952276908267649116142379 -287.3233896734103442991981056134167 -> 1.039130027847489364009368608104291E-208 Inexact Rounded +powx3717 power 15.64403593865932622003462779104178 -110.5296633358063267478609032002475 -> 9.750540276026524527375125980296142E-133 Inexact Rounded +powx3718 power 89.69639006761571087634945077373508 -181.3209914139357665609268339422627 -> 8.335034232277762924539395632025281E-355 Inexact Rounded +powx3719 power 6.974087483731006359914914110135058 -174.6815625746710345173615508179842 -> 4.553072265122011176641590109568031E-148 Inexact Rounded +powx3720 power 0.0034393024010554821130553772681993 -93.60931598413919272595497100497364 -> 4.067468855817145539589988349449394E+230 Inexact Rounded +powx3721 power 63.32834072300379155053737260965633 -168.3926799435088324825751446957616 -> 4.207907835462640471617519501741094E-304 Inexact Rounded +powx3722 power 00.00216088174206276369011255907785 -70.12279562855442784757874508991013 -> 8.000657143378187029609343435067057E+186 Inexact Rounded +powx3723 power 934.5957982703545893572134393004375 -102.2287735565878252484031426026726 -> 2.073813769209257617246544424827240E-304 Inexact Rounded +powx3724 power 107.9116792558793921873995885441177 -44.11941092260869786313838181499158 -> 2.005476533631183268912552168759595E-90 Inexact Rounded +powx3725 power 0.0000000000188049827381428191769262 -19.32118917192242027966847501724073 -> 1.713174297100918857053338286389034E+207 Inexact Rounded +powx3726 power 614.9820907366248142166636259027728 -4.069913257030791586645250035698123 -> 4.462432572576935752713876293746717E-12 Inexact Rounded +powx3727 power 752.0655175769182096165651274049422 -22.59292060348797472013598378334370 -> 1.039881526694635205040192531504131E-65 Inexact Rounded +powx3728 power 72.20446632047659449616175456059013 -175.4705356401853924020842356605072 -> 7.529540175791582421966947814549028E-327 Inexact Rounded +powx3729 power 518.8346486600403405764055847937416 -65.87320268592761588756963215588232 -> 1.420189426992170936958891180073151E-179 Inexact Rounded +powx3730 power 3.457164372003960576453458502270716 -440.3201118177861273814529713443698 -> 6.176418595751201287186292664257369E-238 Inexact Rounded +powx3731 power 7.908352793344189720739467675503991 -298.6646112894719680394152664740255 -> 5.935857120229147638104675057695125E-269 Inexact Rounded +powx3732 power 0.0000004297399403788595027926075086 -22.66504617185071293588817501468339 -> 2.012270405520600820469665145636204E+144 Inexact Rounded +powx3733 power 0.0000008592124097322966354868716443 -9.913109586558030204789520190180906 -> 1.354958763843310237046818832755215E+60 Inexact Rounded +powx3734 power 161.4806080561258105880907470989925 -70.72907837434814261716311990271578 -> 6.632555003698945544941329872901929E-157 Inexact Rounded +powx3735 power 0.0000000090669568624173832705631918 -36.53759624613665940127058439106640 -> 7.161808401023414735428130112941559E+293 Inexact Rounded +powx3736 power 0.0000000000029440295978365709342752 -1.297354238738921988884421117731562 -> 911731060579291.7661267358872917380 Inexact Rounded +powx3737 power 21.37477220144832172175460425143692 -76.95949933640539226475686997477889 -> 4.481741242418091914011962399912885E-103 Inexact Rounded +powx3738 power 0.0000000000186657798201636342150903 -20.18296240350678245567049161730909 -> 3.483954007114900406906338526575672E+216 Inexact Rounded +powx3739 power 0.0006522464792960191985996959126792 -80.03762491483514679886504099194414 -> 9.266548513614215557228467517053035E+254 Inexact Rounded +powx3740 power 0.0000000032851343694200568966168055 -21.53462116926375512242403160008026 -> 4.873201679668455240861376213601189E+182 Inexact Rounded + +-- P=16, within 0-99 -- negative arg2 +Precision: 16 +powx3601 power 0.0000151338748474 -40.84655618364688 -> 7.628470824137755E+196 Inexact Rounded +powx3602 power 0.1542771848654862 -435.8830009466800 -> 6.389817177800744E+353 Inexact Rounded +powx3603 power 48.28477749367364 -218.5929209902050 -> 8.531049532576154E-369 Inexact Rounded +powx3604 power 7.960775891584911 -12.78113732182505 -> 3.053270889769488E-12 Inexact Rounded +powx3605 power 0.9430340651863058 -9010.470056913748 -> 3.313374654923807E+229 Inexact Rounded +powx3606 power 0.0000202661501602 -65.57915207383306 -> 5.997379176536464E+307 Inexact Rounded +powx3607 power 04.33007440798390 -232.0476834666588 -> 2.007827183010456E-148 Inexact Rounded +powx3608 power 0.0000141944643914 -11.32407921958717 -> 7.902934485074846E+54 Inexact Rounded +powx3609 power 0.0000021977758261 -53.53706138253307 -> 8.195631772317815E+302 Inexact Rounded +powx3610 power 39.51297655474188 -19.40370976012326 -> 1.040699608072659E-31 Inexact Rounded +powx3611 power 38.71210232488775 -66.58341618227921 -> 1.886855066146495E-106 Inexact Rounded +powx3612 power 0.0000804235229062 -6.715207948992859 -> 3.134757864389333E+27 Inexact Rounded +powx3613 power 0.0000073547092399 -11.27725685719934 -> 7.781428390953695E+57 Inexact Rounded +powx3614 power 52.72181272599316 -186.1422311607435 -> 2.916601998744177E-321 Inexact Rounded +powx3615 power 0.0969519963083306 -280.8220862151369 -> 3.955906885970987E+284 Inexact Rounded +powx3616 power 94.07263302150081 -148.2031146071230 -> 3.361958990752490E-293 Inexact Rounded +powx3617 power 85.80286965053704 -90.21453695813759 -> 3.715602429645798E-175 Inexact Rounded +powx3618 power 03.52699858152259 -492.0414362539196 -> 4.507309220081092E-270 Inexact Rounded +powx3619 power 0.0508278086396068 -181.0871731572167 -> 2.034428013017949E+234 Inexact Rounded +powx3620 power 0.395576740303172 -915.5524507432392 -> 5.706585187437578E+368 Inexact Rounded +powx3621 power 38.06105826789202 -49.75913753435335 -> 2.273188991431738E-79 Inexact Rounded +powx3622 power 0.0003656748910646 -73.28988491310354 -> 7.768936940568763E+251 Inexact Rounded +powx3623 power 0.0000006373551809 -51.30825234200690 -> 7.697618167701985E+317 Inexact Rounded +powx3624 power 82.41729920673856 -35.73319631625699 -> 3.424042354585529E-69 Inexact Rounded +powx3625 power 0.7845821453127670 -971.4982028897663 -> 2.283415527661089E+102 Inexact Rounded +powx3626 power 4.840983673433497 -182.3730452370515 -> 1.220591407927770E-125 Inexact Rounded +powx3627 power 0.0000006137592139 -2.122139474431484 -> 15231217034839.29 Inexact Rounded +powx3628 power 0.0003657962862984 -35.97993782448099 -> 4.512701319250839E+123 Inexact Rounded +powx3629 power 40.93693004443150 -165.1362408792997 -> 6.044276411057239E-267 Inexact Rounded +powx3630 power 0.2941552583028898 -17.41046264945892 -> 1787833103.503346 Inexact Rounded +powx3631 power 63.99335135369977 -69.92417205168579 -> 5.099359804872509E-127 Inexact Rounded +powx3632 power 0.0000657924467388 -89.14497293588313 -> 6.145878266688521E+372 Inexact Rounded +powx3633 power 11.35071250339147 -323.3705865614542 -> 6.863626248766775E-342 Inexact Rounded +powx3634 power 23.88024718470895 -277.7117513329510 -> 2.006441422612815E-383 Inexact Rounded +powx3635 power 0.0000009111939914 -58.51782946929182 -> 2.954352883996773E+353 Inexact Rounded +powx3636 power 0.0000878179048782 -75.81060420238669 -> 3.306878455207585E+307 Inexact Rounded +powx3637 power 07.39190564273779 -287.5047307244636 -> 1.692080354659805E-250 Inexact Rounded +powx3638 power 0.0000298310819799 -1.844740377759355 -> 222874718.7238888 Inexact Rounded +powx3639 power 0.0000006412929384 -28.24850078229290 -> 8.737164230666529E+174 Inexact Rounded +powx3640 power 0.0000010202965998 -47.17573701956498 -> 4.392845306049341E+282 Inexact Rounded + +-- P=7, within 0-9 -- negative arg2 +Precision: 7 +powx3501 power 0.326324 -71.96509 -> 1.000673E+35 Inexact Rounded +powx3502 power 0.0017635 -0.7186967 -> 95.28419 Inexact Rounded +powx3503 power 8.564155 -253.0899 -> 8.850512E-237 Inexact Rounded +powx3504 power 8.987272 -2.155789 -> 0.008793859 Inexact Rounded +powx3505 power 9.604856 -139.9630 -> 3.073492E-138 Inexact Rounded +powx3506 power 0.8472919 -2539.085 -> 5.372686E+182 Inexact Rounded +powx3507 power 5.312329 -60.32965 -> 1.753121E-44 Inexact Rounded +powx3508 power 0.0338294 -100.5440 -> 7.423939E+147 Inexact Rounded +powx3509 power 0.0017777 -130.8583 -> 7.565629E+359 Inexact Rounded +powx3510 power 8.016154 -405.5689 -> 2.395977E-367 Inexact Rounded +powx3511 power 5.016570 -327.8906 -> 2.203784E-230 Inexact Rounded +powx3512 power 0.8161743 -744.5276 -> 4.786899E+65 Inexact Rounded +powx3513 power 0.0666343 -164.7320 -> 5.951240E+193 Inexact Rounded +powx3514 power 0.0803966 -202.2666 -> 2.715512E+221 Inexact Rounded +powx3515 power 0.0014752 -12.55547 -> 3.518905E+35 Inexact Rounded +powx3516 power 9.737565 -14.69615 -> 2.975672E-15 Inexact Rounded +powx3517 power 0.6634172 -152.7308 -> 1.654458E+27 Inexact Rounded +powx3518 power 0.0009337 -33.32939 -> 9.575039E+100 Inexact Rounded +powx3519 power 8.679922 -224.4194 -> 2.392446E-211 Inexact Rounded +powx3520 power 7.390494 -161.9483 -> 2.088375E-141 Inexact Rounded +powx3521 power 0.4631489 -417.1673 -> 2.821106E+139 Inexact Rounded +powx3522 power 0.0095471 -7.677458 -> 3.231855E+15 Inexact Rounded +powx3523 power 6.566339 -176.1867 -> 9.965633E-145 Inexact Rounded +powx3524 power 2.696128 -26.15501 -> 5.419731E-12 Inexact Rounded +powx3525 power 0.4464366 -852.1893 -> 2.957725E+298 Inexact Rounded +powx3526 power 0.4772006 -921.4111 -> 1.118105E+296 Inexact Rounded +powx3527 power 8.923696 -359.2211 -> 3.501573E-342 Inexact Rounded +powx3528 power 0.0018008 -66.91252 -> 4.402718E+183 Inexact Rounded +powx3529 power 0.0811964 -92.83278 -> 1.701111E+101 Inexact Rounded +powx3530 power 0.0711219 -58.94347 -> 4.644148E+67 Inexact Rounded +powx3531 power 7.958121 -50.66123 -> 2.311161E-46 Inexact Rounded +powx3532 power 6.106466 -81.83610 -> 4.943285E-65 Inexact Rounded +powx3533 power 4.557634 -129.5268 -> 4.737917E-86 Inexact Rounded +powx3534 power 0.0027348 -9.180135 -> 3.383524E+23 Inexact Rounded +powx3535 power 0.0083924 -46.24016 -> 9.996212E+95 Inexact Rounded +powx3536 power 2.138523 -47.25897 -> 2.507009E-16 Inexact Rounded +powx3537 power 1.626728 -1573.830 -> 2.668117E-333 Inexact Rounded +powx3538 power 0.082615 -164.5842 -> 1.717882E+178 Inexact Rounded +powx3539 power 7.636003 -363.6763 -> 8.366174E-322 Inexact Rounded +powx3540 power 0.0021481 -138.0065 -> 1.562505E+368 Inexact Rounded + + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +powx4001 power 1 1.1 -> NaN Invalid_context +precision: 99999999 +powx4002 power 1 1.1 -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +powx4003 power 1 1.1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +powx4004 power 1 1.1 -> 1.00000000 Inexact Rounded +maxExponent: 999999 +minExponent: -1000000 +powx4005 power 1 1.1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +powx4006 power 1 1.1 -> 1.00000000 Inexact Rounded + +-- operand range violations +powx4007 power 1 1.1E+999999 -> 1 +powx4008 power 1 1.1E+1000000 -> NaN Invalid_operation +powx4009 power 1.1E+999999 1.1 -> Infinity Overflow Inexact Rounded +powx4010 power 1.1E+1000000 1.1 -> NaN Invalid_operation +powx4011 power 1 1.1E-1999997 -> 1.00000000 Inexact Rounded +powx4012 power 1 1.1E-1999998 -> NaN Invalid_operation +powx4013 power 1.1E-1999997 1.1 -> 0E-1000006 Underflow Inexact Rounded Clamped Subnormal +powx4014 power 1.1E-1999998 1.1 -> NaN Invalid_operation + +-- rounding modes -- power is sensitive +precision: 7 +maxExponent: 99 +minExponent: -99 + +-- 0.7 ** 3.3 => 0.30819354053418943822 +-- 0.7 ** 3.4 => 0.29739477638272533854 +-- -1.2 ** 17 => -22.18611106740436992 +-- -1.3 ** 17 => -86.50415919381337933 +-- 0.5 ** 11 => 0.00048828125 +-- 3.15 ** 3 => 31.255875 + +rounding: up +powx4100 power 0.7 3.3 -> 0.3081936 Inexact Rounded +powx4101 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4102 power -1.2 17 -> -22.18612 Inexact Rounded +powx4103 power -1.3 17 -> -86.50416 Inexact Rounded +powx4104 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4105 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: down +powx4120 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4121 power 0.7 3.4 -> 0.2973947 Inexact Rounded +powx4122 power -1.2 17 -> -22.18611 Inexact Rounded +powx4123 power -1.3 17 -> -86.50415 Inexact Rounded +powx4124 power 17 81.27115 -> 9.999973E+99 Inexact Rounded +powx4125 power 17 81.27116 -> 9.999999E+99 Overflow Inexact Rounded + +rounding: floor +powx4140 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4141 power 0.7 3.4 -> 0.2973947 Inexact Rounded +powx4142 power -1.2 17 -> -22.18612 Inexact Rounded +powx4143 power -1.3 17 -> -86.50416 Inexact Rounded +powx4144 power 17 81.27115 -> 9.999973E+99 Inexact Rounded +powx4145 power 17 81.27116 -> 9.999999E+99 Overflow Inexact Rounded + +rounding: ceiling +powx4160 power 0.7 3.3 -> 0.3081936 Inexact Rounded +powx4161 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4162 power -1.2 17 -> -22.18611 Inexact Rounded +powx4163 power -1.3 17 -> -86.50415 Inexact Rounded +powx4164 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4165 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: half_up +powx4180 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4181 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4182 power -1.2 17 -> -22.18611 Inexact Rounded +powx4183 power -1.3 17 -> -86.50416 Inexact Rounded +powx4184 power 0.5 11 -> 0.0004882813 Inexact Rounded +powx4185 power 3.15 3 -> 31.25588 Inexact Rounded +powx4186 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4187 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: half_even +powx4200 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4201 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4202 power -1.2 17 -> -22.18611 Inexact Rounded +powx4203 power -1.3 17 -> -86.50416 Inexact Rounded +powx4204 power 0.5 11 -> 0.0004882812 Inexact Rounded +powx4205 power 3.15 3 -> 31.25588 Inexact Rounded +powx4206 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4207 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: half_down +powx4220 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4221 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4222 power -1.2 17 -> -22.18611 Inexact Rounded +powx4223 power -1.3 17 -> -86.50416 Inexact Rounded +powx4224 power 0.5 11 -> 0.0004882812 Inexact Rounded +powx4225 power 3.15 3 -> 31.25587 Inexact Rounded +powx4226 power -3.15 3 -> -31.25587 Inexact Rounded +powx4227 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4228 power 17 81.27116 -> Infinity Overflow Inexact Rounded + + +-- more rounding tests as per Ilan Nehama's suggestions & analysis +-- these are likely to show > 0.5 ulp error for very small powers +precision: 7 +maxExponent: 96 +minExponent: -95 + +-- For x=nextfp(1)=1.00..001 (where the number of 0s is precision-2) +-- power(x,y)=x when the rounding is up (e.g., toward_pos_inf or +-- ceil) for any y in (0,1]. +rounding: ceiling +powx4301 power 1.000001 0 -> 1 +-- The next test should be skipped for decNumber +powx4302 power 1.000001 1e-101 -> 1.000001 Inexact Rounded +-- The next test should be skipped for decNumber +powx4303 power 1.000001 1e-95 -> 1.000001 Inexact Rounded +powx4304 power 1.000001 1e-10 -> 1.000001 Inexact Rounded +powx4305 power 1.000001 0.1 -> 1.000001 Inexact Rounded +powx4306 power 1.000001 0.1234567 -> 1.000001 Inexact Rounded +powx4307 power 1.000001 0.7 -> 1.000001 Inexact Rounded +powx4308 power 1.000001 0.9999999 -> 1.000001 Inexact Rounded +powx4309 power 1.000001 1.000000 -> 1.000001 +-- power(x,y)=1 when the rounding is down (e.g. toward_zero or +-- floor) for any y in [0,1). +rounding: floor +powx4321 power 1.000001 0 -> 1 +powx4322 power 1.000001 1e-101 -> 1.000000 Inexact Rounded +powx4323 power 1.000001 1e-95 -> 1.000000 Inexact Rounded +powx4324 power 1.000001 1e-10 -> 1.000000 Inexact Rounded +powx4325 power 1.000001 0.1 -> 1.000000 Inexact Rounded +powx4326 power 1.000001 0.1234567 -> 1.000000 Inexact Rounded +powx4327 power 1.000001 0.7 -> 1.000000 Inexact Rounded +powx4328 power 1.000001 0.9999999 -> 1.000000 Inexact Rounded +powx4329 power 1.000001 1.000000 -> 1.000001 + +-- For x=prevfp(1)=0.99..99 (where the number of 9s is precision) +-- power(x,y)=x when the rounding is down for any y in (0,1]. +rounding: floor +powx4341 power 0.9999999 0 -> 1 +-- The next test should be skipped for decNumber +powx4342 power 0.9999999 1e-101 -> 0.9999999 Inexact Rounded +-- The next test should be skipped for decNumber +powx4343 power 0.9999999 1e-95 -> 0.9999999 Inexact Rounded +powx4344 power 0.9999999 1e-10 -> 0.9999999 Inexact Rounded +powx4345 power 0.9999999 0.1 -> 0.9999999 Inexact Rounded +powx4346 power 0.9999999 0.1234567 -> 0.9999999 Inexact Rounded +powx4347 power 0.9999999 0.7 -> 0.9999999 Inexact Rounded +powx4348 power 0.9999999 0.9999999 -> 0.9999999 Inexact Rounded +powx4349 power 0.9999999 1.000000 -> 0.9999999 +-- power(x,y)=1 when the rounding is up for any y in (0,1]. +rounding: ceiling +powx4361 power 0.9999999 0 -> 1 +powx4362 power 0.9999999 1e-101 -> 1.000000 Inexact Rounded +powx4363 power 0.9999999 1e-95 -> 1.000000 Inexact Rounded +powx4364 power 0.9999999 1e-10 -> 1.000000 Inexact Rounded +powx4365 power 0.9999999 0.1 -> 1.000000 Inexact Rounded +powx4366 power 0.9999999 0.1234567 -> 1.000000 Inexact Rounded +powx4367 power 0.9999999 0.7 -> 1.000000 Inexact Rounded +powx4368 power 0.9999999 0.9999999 -> 1.000000 Inexact Rounded +powx4369 power 0.9999999 1.000000 -> 0.9999999 + +-- For x=nextfp(0) +-- power(x,y)=0 when the rounding is down for any y larger than 1. +rounding: floor +powx4382 power 1e-101 0 -> 1 +powx4383 power 1e-101 0.9999999 -> 1E-101 Underflow Subnormal Inexact Rounded +powx4384 power 1e-101 1.000000 -> 1E-101 Subnormal +powx4385 power 1e-101 1.000001 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +powx4386 power 1e-101 2.000000 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/powersqrt.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/powersqrt.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,2970 @@ +------------------------------------------------------------------------ +-- powersqrt.decTest -- decimal square root, using power -- +-- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- These testcases are taken from squareroot.decTest but are +-- evaluated using the power operator. The differences in results +-- (153 out of 2856) fall into the following categories: +-- +-- x ** 0.5 (x>0) has no preferred exponent, and is Inexact +-- (and hence full precision); almost all differences are +-- in this category +-- 0.00 ** 0.5 becomes 0 (not 0.0), etc. +-- -0 ** 0.5 becomes 0 (never -0) +-- Some exact subnormals become inexact and hence underflows + +extended: 1 +precision: 9 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- basics +pwsx001 power 1 0.5 -> 1.00000000 Inexact Rounded +pwsx002 power -1 0.5 -> NaN Invalid_operation +pwsx003 power 1.00 0.5 -> 1.00000000 Inexact Rounded +pwsx004 power -1.00 0.5 -> NaN Invalid_operation +pwsx005 power 0 0.5 -> 0 +pwsx006 power 00.0 0.5 -> 0 +pwsx007 power 0.00 0.5 -> 0 +pwsx008 power 00.00 0.5 -> 0 +pwsx009 power 00.000 0.5 -> 0 +pwsx010 power 00.0000 0.5 -> 0 +pwsx011 power 00 0.5 -> 0 + +pwsx012 power -2 0.5 -> NaN Invalid_operation +pwsx013 power 2 0.5 -> 1.41421356 Inexact Rounded +pwsx014 power -2.00 0.5 -> NaN Invalid_operation +pwsx015 power 2.00 0.5 -> 1.41421356 Inexact Rounded +pwsx016 power -0 0.5 -> 0 +pwsx017 power -0.0 0.5 -> 0 +pwsx018 power -00.00 0.5 -> 0 +pwsx019 power -00.000 0.5 -> 0 +pwsx020 power -0.0000 0.5 -> 0 +pwsx021 power -0E+9 0.5 -> 0 +pwsx022 power -0E+10 0.5 -> 0 +pwsx023 power -0E+11 0.5 -> 0 +pwsx024 power -0E+12 0.5 -> 0 +pwsx025 power -00 0.5 -> 0 +pwsx026 power 0E+5 0.5 -> 0 +pwsx027 power 4.0 0.5 -> 2.00000000 Inexact Rounded +pwsx028 power 4.00 0.5 -> 2.00000000 Inexact Rounded + +pwsx030 power +0.1 0.5 -> 0.316227766 Inexact Rounded +pwsx031 power -0.1 0.5 -> NaN Invalid_operation +pwsx032 power +0.01 0.5 -> 0.100000000 Inexact Rounded +pwsx033 power -0.01 0.5 -> NaN Invalid_operation +pwsx034 power +0.001 0.5 -> 0.0316227766 Inexact Rounded +pwsx035 power -0.001 0.5 -> NaN Invalid_operation +pwsx036 power +0.000001 0.5 -> 0.00100000000 Inexact Rounded +pwsx037 power -0.000001 0.5 -> NaN Invalid_operation +pwsx038 power +0.000000000001 0.5 -> 0.00000100000000 Inexact Rounded +pwsx039 power -0.000000000001 0.5 -> NaN Invalid_operation + +pwsx041 power 1.1 0.5 -> 1.04880885 Inexact Rounded +pwsx042 power 1.10 0.5 -> 1.04880885 Inexact Rounded +pwsx043 power 1.100 0.5 -> 1.04880885 Inexact Rounded +pwsx044 power 1.110 0.5 -> 1.05356538 Inexact Rounded +pwsx045 power -1.1 0.5 -> NaN Invalid_operation +pwsx046 power -1.10 0.5 -> NaN Invalid_operation +pwsx047 power -1.100 0.5 -> NaN Invalid_operation +pwsx048 power -1.110 0.5 -> NaN Invalid_operation +pwsx049 power 9.9 0.5 -> 3.14642654 Inexact Rounded +pwsx050 power 9.90 0.5 -> 3.14642654 Inexact Rounded +pwsx051 power 9.900 0.5 -> 3.14642654 Inexact Rounded +pwsx052 power 9.990 0.5 -> 3.16069613 Inexact Rounded +pwsx053 power -9.9 0.5 -> NaN Invalid_operation +pwsx054 power -9.90 0.5 -> NaN Invalid_operation +pwsx055 power -9.900 0.5 -> NaN Invalid_operation +pwsx056 power -9.990 0.5 -> NaN Invalid_operation + +pwsx060 power 1 0.5 -> 1.00000000 Inexact Rounded +pwsx061 power 1.0 0.5 -> 1.00000000 Inexact Rounded +pwsx062 power 1.00 0.5 -> 1.00000000 Inexact Rounded +pwsx063 power 10.0 0.5 -> 3.16227766 Inexact Rounded +pwsx064 power 10.0 0.5 -> 3.16227766 Inexact Rounded +pwsx065 power 10.0 0.5 -> 3.16227766 Inexact Rounded +pwsx066 power 10.00 0.5 -> 3.16227766 Inexact Rounded +pwsx067 power 100 0.5 -> 10.0000000 Inexact Rounded +pwsx068 power 100.0 0.5 -> 10.0000000 Inexact Rounded +pwsx069 power 100.00 0.5 -> 10.0000000 Inexact Rounded +pwsx070 power 1.1000E+3 0.5 -> 33.1662479 Inexact Rounded +pwsx071 power 1.10000E+3 0.5 -> 33.1662479 Inexact Rounded +pwsx072 power -10.0 0.5 -> NaN Invalid_operation +pwsx073 power -10.00 0.5 -> NaN Invalid_operation +pwsx074 power -100.0 0.5 -> NaN Invalid_operation +pwsx075 power -100.00 0.5 -> NaN Invalid_operation +pwsx076 power -1.1000E+3 0.5 -> NaN Invalid_operation +pwsx077 power -1.10000E+3 0.5 -> NaN Invalid_operation + +-- famous squares +pwsx080 power 1 0.5 -> 1.00000000 Inexact Rounded +pwsx081 power 4 0.5 -> 2.00000000 Inexact Rounded +pwsx082 power 9 0.5 -> 3.00000000 Inexact Rounded +pwsx083 power 16 0.5 -> 4.00000000 Inexact Rounded +pwsx084 power 25 0.5 -> 5.00000000 Inexact Rounded +pwsx085 power 36 0.5 -> 6.00000000 Inexact Rounded +pwsx086 power 49 0.5 -> 7.00000000 Inexact Rounded +pwsx087 power 64 0.5 -> 8.00000000 Inexact Rounded +pwsx088 power 81 0.5 -> 9.00000000 Inexact Rounded +pwsx089 power 100 0.5 -> 10.0000000 Inexact Rounded +pwsx090 power 121 0.5 -> 11.0000000 Inexact Rounded +pwsx091 power 144 0.5 -> 12.0000000 Inexact Rounded +pwsx092 power 169 0.5 -> 13.0000000 Inexact Rounded +pwsx093 power 256 0.5 -> 16.0000000 Inexact Rounded +pwsx094 power 1024 0.5 -> 32.0000000 Inexact Rounded +pwsx095 power 4096 0.5 -> 64.0000000 Inexact Rounded +pwsx100 power 0.01 0.5 -> 0.100000000 Inexact Rounded +pwsx101 power 0.04 0.5 -> 0.200000000 Inexact Rounded +pwsx102 power 0.09 0.5 -> 0.300000000 Inexact Rounded +pwsx103 power 0.16 0.5 -> 0.400000000 Inexact Rounded +pwsx104 power 0.25 0.5 -> 0.500000000 Inexact Rounded +pwsx105 power 0.36 0.5 -> 0.600000000 Inexact Rounded +pwsx106 power 0.49 0.5 -> 0.700000000 Inexact Rounded +pwsx107 power 0.64 0.5 -> 0.800000000 Inexact Rounded +pwsx108 power 0.81 0.5 -> 0.900000000 Inexact Rounded +pwsx109 power 1.00 0.5 -> 1.00000000 Inexact Rounded +pwsx110 power 1.21 0.5 -> 1.10000000 Inexact Rounded +pwsx111 power 1.44 0.5 -> 1.20000000 Inexact Rounded +pwsx112 power 1.69 0.5 -> 1.30000000 Inexact Rounded +pwsx113 power 2.56 0.5 -> 1.60000000 Inexact Rounded +pwsx114 power 10.24 0.5 -> 3.20000000 Inexact Rounded +pwsx115 power 40.96 0.5 -> 6.40000000 Inexact Rounded + +-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 1 +pwsx1201 power 0.1 0.5 -> 0.3 Inexact Rounded +pwsx1202 power 0.01 0.5 -> 0.1 Inexact Rounded +pwsx1203 power 1.0E-1 0.5 -> 0.3 Inexact Rounded +pwsx1204 power 1.00E-2 0.5 -> 0.1 Inexact Rounded +pwsx1205 power 1E-3 0.5 -> 0.03 Inexact Rounded +pwsx1206 power 1E+1 0.5 -> 3 Inexact Rounded +pwsx1207 power 1E+2 0.5 -> 1E+1 Inexact Rounded +pwsx1208 power 1E+3 0.5 -> 3E+1 Inexact Rounded +pwsx1209 power 0.2 0.5 -> 0.4 Inexact Rounded +pwsx1210 power 0.02 0.5 -> 0.1 Inexact Rounded +pwsx1211 power 2.0E-1 0.5 -> 0.4 Inexact Rounded +pwsx1212 power 2.00E-2 0.5 -> 0.1 Inexact Rounded +pwsx1213 power 2E-3 0.5 -> 0.04 Inexact Rounded +pwsx1214 power 2E+1 0.5 -> 4 Inexact Rounded +pwsx1215 power 2E+2 0.5 -> 1E+1 Inexact Rounded +pwsx1216 power 2E+3 0.5 -> 4E+1 Inexact Rounded +pwsx1217 power 0.3 0.5 -> 0.5 Inexact Rounded +pwsx1218 power 0.03 0.5 -> 0.2 Inexact Rounded +pwsx1219 power 3.0E-1 0.5 -> 0.5 Inexact Rounded +pwsx1220 power 3.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1221 power 3E-3 0.5 -> 0.05 Inexact Rounded +pwsx1222 power 3E+1 0.5 -> 5 Inexact Rounded +pwsx1223 power 3E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1224 power 3E+3 0.5 -> 5E+1 Inexact Rounded +pwsx1225 power 0.4 0.5 -> 0.6 Inexact Rounded +pwsx1226 power 0.04 0.5 -> 0.2 Inexact Rounded +pwsx1227 power 4.0E-1 0.5 -> 0.6 Inexact Rounded +pwsx1228 power 4.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1229 power 4E-3 0.5 -> 0.06 Inexact Rounded +pwsx1230 power 4E+1 0.5 -> 6 Inexact Rounded +pwsx1231 power 4E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1232 power 4E+3 0.5 -> 6E+1 Inexact Rounded +pwsx1233 power 0.5 0.5 -> 0.7 Inexact Rounded +pwsx1234 power 0.05 0.5 -> 0.2 Inexact Rounded +pwsx1235 power 5.0E-1 0.5 -> 0.7 Inexact Rounded +pwsx1236 power 5.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1237 power 5E-3 0.5 -> 0.07 Inexact Rounded +pwsx1238 power 5E+1 0.5 -> 7 Inexact Rounded +pwsx1239 power 5E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1240 power 5E+3 0.5 -> 7E+1 Inexact Rounded +pwsx1241 power 0.6 0.5 -> 0.8 Inexact Rounded +pwsx1242 power 0.06 0.5 -> 0.2 Inexact Rounded +pwsx1243 power 6.0E-1 0.5 -> 0.8 Inexact Rounded +pwsx1244 power 6.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1245 power 6E-3 0.5 -> 0.08 Inexact Rounded +pwsx1246 power 6E+1 0.5 -> 8 Inexact Rounded +pwsx1247 power 6E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1248 power 6E+3 0.5 -> 8E+1 Inexact Rounded +pwsx1249 power 0.7 0.5 -> 0.8 Inexact Rounded +pwsx1250 power 0.07 0.5 -> 0.3 Inexact Rounded +pwsx1251 power 7.0E-1 0.5 -> 0.8 Inexact Rounded +pwsx1252 power 7.00E-2 0.5 -> 0.3 Inexact Rounded +pwsx1253 power 7E-3 0.5 -> 0.08 Inexact Rounded +pwsx1254 power 7E+1 0.5 -> 8 Inexact Rounded +pwsx1255 power 7E+2 0.5 -> 3E+1 Inexact Rounded +pwsx1256 power 7E+3 0.5 -> 8E+1 Inexact Rounded +pwsx1257 power 0.8 0.5 -> 0.9 Inexact Rounded +pwsx1258 power 0.08 0.5 -> 0.3 Inexact Rounded +pwsx1259 power 8.0E-1 0.5 -> 0.9 Inexact Rounded +pwsx1260 power 8.00E-2 0.5 -> 0.3 Inexact Rounded +pwsx1261 power 8E-3 0.5 -> 0.09 Inexact Rounded +pwsx1262 power 8E+1 0.5 -> 9 Inexact Rounded +pwsx1263 power 8E+2 0.5 -> 3E+1 Inexact Rounded +pwsx1264 power 8E+3 0.5 -> 9E+1 Inexact Rounded +pwsx1265 power 0.9 0.5 -> 0.9 Inexact Rounded +pwsx1266 power 0.09 0.5 -> 0.3 Inexact Rounded +pwsx1267 power 9.0E-1 0.5 -> 0.9 Inexact Rounded +pwsx1268 power 9.00E-2 0.5 -> 0.3 Inexact Rounded +pwsx1269 power 9E-3 0.5 -> 0.09 Inexact Rounded +pwsx1270 power 9E+1 0.5 -> 9 Inexact Rounded +pwsx1271 power 9E+2 0.5 -> 3E+1 Inexact Rounded +pwsx1272 power 9E+3 0.5 -> 9E+1 Inexact Rounded + +-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 2 +pwsx2201 power 0.1 0.5 -> 0.32 Inexact Rounded +pwsx2202 power 0.01 0.5 -> 0.10 Inexact Rounded +pwsx2203 power 1.0E-1 0.5 -> 0.32 Inexact Rounded +pwsx2204 power 1.00E-2 0.5 -> 0.10 Inexact Rounded +pwsx2205 power 1E-3 0.5 -> 0.032 Inexact Rounded +pwsx2206 power 1E+1 0.5 -> 3.2 Inexact Rounded +pwsx2207 power 1E+2 0.5 -> 10 Inexact Rounded +pwsx2208 power 1E+3 0.5 -> 32 Inexact Rounded +pwsx2209 power 0.2 0.5 -> 0.45 Inexact Rounded +pwsx2210 power 0.02 0.5 -> 0.14 Inexact Rounded +pwsx2211 power 2.0E-1 0.5 -> 0.45 Inexact Rounded +pwsx2212 power 2.00E-2 0.5 -> 0.14 Inexact Rounded +pwsx2213 power 2E-3 0.5 -> 0.045 Inexact Rounded +pwsx2214 power 2E+1 0.5 -> 4.5 Inexact Rounded +pwsx2215 power 2E+2 0.5 -> 14 Inexact Rounded +pwsx2216 power 2E+3 0.5 -> 45 Inexact Rounded +pwsx2217 power 0.3 0.5 -> 0.55 Inexact Rounded +pwsx2218 power 0.03 0.5 -> 0.17 Inexact Rounded +pwsx2219 power 3.0E-1 0.5 -> 0.55 Inexact Rounded +pwsx2220 power 3.00E-2 0.5 -> 0.17 Inexact Rounded +pwsx2221 power 3E-3 0.5 -> 0.055 Inexact Rounded +pwsx2222 power 3E+1 0.5 -> 5.5 Inexact Rounded +pwsx2223 power 3E+2 0.5 -> 17 Inexact Rounded +pwsx2224 power 3E+3 0.5 -> 55 Inexact Rounded +pwsx2225 power 0.4 0.5 -> 0.63 Inexact Rounded +pwsx2226 power 0.04 0.5 -> 0.20 Inexact Rounded +pwsx2227 power 4.0E-1 0.5 -> 0.63 Inexact Rounded +pwsx2228 power 4.00E-2 0.5 -> 0.20 Inexact Rounded +pwsx2229 power 4E-3 0.5 -> 0.063 Inexact Rounded +pwsx2230 power 4E+1 0.5 -> 6.3 Inexact Rounded +pwsx2231 power 4E+2 0.5 -> 20 Inexact Rounded +pwsx2232 power 4E+3 0.5 -> 63 Inexact Rounded +pwsx2233 power 0.5 0.5 -> 0.71 Inexact Rounded +pwsx2234 power 0.05 0.5 -> 0.22 Inexact Rounded +pwsx2235 power 5.0E-1 0.5 -> 0.71 Inexact Rounded +pwsx2236 power 5.00E-2 0.5 -> 0.22 Inexact Rounded +pwsx2237 power 5E-3 0.5 -> 0.071 Inexact Rounded +pwsx2238 power 5E+1 0.5 -> 7.1 Inexact Rounded +pwsx2239 power 5E+2 0.5 -> 22 Inexact Rounded +pwsx2240 power 5E+3 0.5 -> 71 Inexact Rounded +pwsx2241 power 0.6 0.5 -> 0.77 Inexact Rounded +pwsx2242 power 0.06 0.5 -> 0.24 Inexact Rounded +pwsx2243 power 6.0E-1 0.5 -> 0.77 Inexact Rounded +pwsx2244 power 6.00E-2 0.5 -> 0.24 Inexact Rounded +pwsx2245 power 6E-3 0.5 -> 0.077 Inexact Rounded +pwsx2246 power 6E+1 0.5 -> 7.7 Inexact Rounded +pwsx2247 power 6E+2 0.5 -> 24 Inexact Rounded +pwsx2248 power 6E+3 0.5 -> 77 Inexact Rounded +pwsx2249 power 0.7 0.5 -> 0.84 Inexact Rounded +pwsx2250 power 0.07 0.5 -> 0.26 Inexact Rounded +pwsx2251 power 7.0E-1 0.5 -> 0.84 Inexact Rounded +pwsx2252 power 7.00E-2 0.5 -> 0.26 Inexact Rounded +pwsx2253 power 7E-3 0.5 -> 0.084 Inexact Rounded +pwsx2254 power 7E+1 0.5 -> 8.4 Inexact Rounded +pwsx2255 power 7E+2 0.5 -> 26 Inexact Rounded +pwsx2256 power 7E+3 0.5 -> 84 Inexact Rounded +pwsx2257 power 0.8 0.5 -> 0.89 Inexact Rounded +pwsx2258 power 0.08 0.5 -> 0.28 Inexact Rounded +pwsx2259 power 8.0E-1 0.5 -> 0.89 Inexact Rounded +pwsx2260 power 8.00E-2 0.5 -> 0.28 Inexact Rounded +pwsx2261 power 8E-3 0.5 -> 0.089 Inexact Rounded +pwsx2262 power 8E+1 0.5 -> 8.9 Inexact Rounded +pwsx2263 power 8E+2 0.5 -> 28 Inexact Rounded +pwsx2264 power 8E+3 0.5 -> 89 Inexact Rounded +pwsx2265 power 0.9 0.5 -> 0.95 Inexact Rounded +pwsx2266 power 0.09 0.5 -> 0.30 Inexact Rounded +pwsx2267 power 9.0E-1 0.5 -> 0.95 Inexact Rounded +pwsx2268 power 9.00E-2 0.5 -> 0.30 Inexact Rounded +pwsx2269 power 9E-3 0.5 -> 0.095 Inexact Rounded +pwsx2270 power 9E+1 0.5 -> 9.5 Inexact Rounded +pwsx2271 power 9E+2 0.5 -> 30 Inexact Rounded +pwsx2272 power 9E+3 0.5 -> 95 Inexact Rounded +pwsx2273 power 0.10 0.5 -> 0.32 Inexact Rounded +pwsx2274 power 0.010 0.5 -> 0.10 Inexact Rounded +pwsx2275 power 10.0E-1 0.5 -> 1.0 Inexact Rounded +pwsx2276 power 10.00E-2 0.5 -> 0.32 Inexact Rounded +pwsx2277 power 10E-3 0.5 -> 0.10 Inexact Rounded +pwsx2278 power 10E+1 0.5 -> 10 Inexact Rounded +pwsx2279 power 10E+2 0.5 -> 32 Inexact Rounded +pwsx2280 power 10E+3 0.5 -> 1.0E+2 Inexact Rounded +pwsx2281 power 0.11 0.5 -> 0.33 Inexact Rounded +pwsx2282 power 0.011 0.5 -> 0.10 Inexact Rounded +pwsx2283 power 11.0E-1 0.5 -> 1.0 Inexact Rounded +pwsx2284 power 11.00E-2 0.5 -> 0.33 Inexact Rounded +pwsx2285 power 11E-3 0.5 -> 0.10 Inexact Rounded +pwsx2286 power 11E+1 0.5 -> 10 Inexact Rounded +pwsx2287 power 11E+2 0.5 -> 33 Inexact Rounded +pwsx2288 power 11E+3 0.5 -> 1.0E+2 Inexact Rounded +pwsx2289 power 0.12 0.5 -> 0.35 Inexact Rounded +pwsx2290 power 0.012 0.5 -> 0.11 Inexact Rounded +pwsx2291 power 12.0E-1 0.5 -> 1.1 Inexact Rounded +pwsx2292 power 12.00E-2 0.5 -> 0.35 Inexact Rounded +pwsx2293 power 12E-3 0.5 -> 0.11 Inexact Rounded +pwsx2294 power 12E+1 0.5 -> 11 Inexact Rounded +pwsx2295 power 12E+2 0.5 -> 35 Inexact Rounded +pwsx2296 power 12E+3 0.5 -> 1.1E+2 Inexact Rounded +pwsx2297 power 0.13 0.5 -> 0.36 Inexact Rounded +pwsx2298 power 0.013 0.5 -> 0.11 Inexact Rounded +pwsx2299 power 13.0E-1 0.5 -> 1.1 Inexact Rounded +pwsx2300 power 13.00E-2 0.5 -> 0.36 Inexact Rounded +pwsx2301 power 13E-3 0.5 -> 0.11 Inexact Rounded +pwsx2302 power 13E+1 0.5 -> 11 Inexact Rounded +pwsx2303 power 13E+2 0.5 -> 36 Inexact Rounded +pwsx2304 power 13E+3 0.5 -> 1.1E+2 Inexact Rounded +pwsx2305 power 0.14 0.5 -> 0.37 Inexact Rounded +pwsx2306 power 0.014 0.5 -> 0.12 Inexact Rounded +pwsx2307 power 14.0E-1 0.5 -> 1.2 Inexact Rounded +pwsx2308 power 14.00E-2 0.5 -> 0.37 Inexact Rounded +pwsx2309 power 14E-3 0.5 -> 0.12 Inexact Rounded +pwsx2310 power 14E+1 0.5 -> 12 Inexact Rounded +pwsx2311 power 14E+2 0.5 -> 37 Inexact Rounded +pwsx2312 power 14E+3 0.5 -> 1.2E+2 Inexact Rounded +pwsx2313 power 0.15 0.5 -> 0.39 Inexact Rounded +pwsx2314 power 0.015 0.5 -> 0.12 Inexact Rounded +pwsx2315 power 15.0E-1 0.5 -> 1.2 Inexact Rounded +pwsx2316 power 15.00E-2 0.5 -> 0.39 Inexact Rounded +pwsx2317 power 15E-3 0.5 -> 0.12 Inexact Rounded +pwsx2318 power 15E+1 0.5 -> 12 Inexact Rounded +pwsx2319 power 15E+2 0.5 -> 39 Inexact Rounded +pwsx2320 power 15E+3 0.5 -> 1.2E+2 Inexact Rounded +pwsx2321 power 0.16 0.5 -> 0.40 Inexact Rounded +pwsx2322 power 0.016 0.5 -> 0.13 Inexact Rounded +pwsx2323 power 16.0E-1 0.5 -> 1.3 Inexact Rounded +pwsx2324 power 16.00E-2 0.5 -> 0.40 Inexact Rounded +pwsx2325 power 16E-3 0.5 -> 0.13 Inexact Rounded +pwsx2326 power 16E+1 0.5 -> 13 Inexact Rounded +pwsx2327 power 16E+2 0.5 -> 40 Inexact Rounded +pwsx2328 power 16E+3 0.5 -> 1.3E+2 Inexact Rounded +pwsx2329 power 0.17 0.5 -> 0.41 Inexact Rounded +pwsx2330 power 0.017 0.5 -> 0.13 Inexact Rounded +pwsx2331 power 17.0E-1 0.5 -> 1.3 Inexact Rounded +pwsx2332 power 17.00E-2 0.5 -> 0.41 Inexact Rounded +pwsx2333 power 17E-3 0.5 -> 0.13 Inexact Rounded +pwsx2334 power 17E+1 0.5 -> 13 Inexact Rounded +pwsx2335 power 17E+2 0.5 -> 41 Inexact Rounded +pwsx2336 power 17E+3 0.5 -> 1.3E+2 Inexact Rounded +pwsx2337 power 0.18 0.5 -> 0.42 Inexact Rounded +pwsx2338 power 0.018 0.5 -> 0.13 Inexact Rounded +pwsx2339 power 18.0E-1 0.5 -> 1.3 Inexact Rounded +pwsx2340 power 18.00E-2 0.5 -> 0.42 Inexact Rounded +pwsx2341 power 18E-3 0.5 -> 0.13 Inexact Rounded +pwsx2342 power 18E+1 0.5 -> 13 Inexact Rounded +pwsx2343 power 18E+2 0.5 -> 42 Inexact Rounded +pwsx2344 power 18E+3 0.5 -> 1.3E+2 Inexact Rounded +pwsx2345 power 0.19 0.5 -> 0.44 Inexact Rounded +pwsx2346 power 0.019 0.5 -> 0.14 Inexact Rounded +pwsx2347 power 19.0E-1 0.5 -> 1.4 Inexact Rounded +pwsx2348 power 19.00E-2 0.5 -> 0.44 Inexact Rounded +pwsx2349 power 19E-3 0.5 -> 0.14 Inexact Rounded +pwsx2350 power 19E+1 0.5 -> 14 Inexact Rounded +pwsx2351 power 19E+2 0.5 -> 44 Inexact Rounded +pwsx2352 power 19E+3 0.5 -> 1.4E+2 Inexact Rounded +pwsx2353 power 0.20 0.5 -> 0.45 Inexact Rounded +pwsx2354 power 0.020 0.5 -> 0.14 Inexact Rounded +pwsx2355 power 20.0E-1 0.5 -> 1.4 Inexact Rounded +pwsx2356 power 20.00E-2 0.5 -> 0.45 Inexact Rounded +pwsx2357 power 20E-3 0.5 -> 0.14 Inexact Rounded +pwsx2358 power 20E+1 0.5 -> 14 Inexact Rounded +pwsx2359 power 20E+2 0.5 -> 45 Inexact Rounded +pwsx2360 power 20E+3 0.5 -> 1.4E+2 Inexact Rounded +pwsx2361 power 0.21 0.5 -> 0.46 Inexact Rounded +pwsx2362 power 0.021 0.5 -> 0.14 Inexact Rounded +pwsx2363 power 21.0E-1 0.5 -> 1.4 Inexact Rounded +pwsx2364 power 21.00E-2 0.5 -> 0.46 Inexact Rounded +pwsx2365 power 21E-3 0.5 -> 0.14 Inexact Rounded +pwsx2366 power 21E+1 0.5 -> 14 Inexact Rounded +pwsx2367 power 21E+2 0.5 -> 46 Inexact Rounded +pwsx2368 power 21E+3 0.5 -> 1.4E+2 Inexact Rounded +pwsx2369 power 0.22 0.5 -> 0.47 Inexact Rounded +pwsx2370 power 0.022 0.5 -> 0.15 Inexact Rounded +pwsx2371 power 22.0E-1 0.5 -> 1.5 Inexact Rounded +pwsx2372 power 22.00E-2 0.5 -> 0.47 Inexact Rounded +pwsx2373 power 22E-3 0.5 -> 0.15 Inexact Rounded +pwsx2374 power 22E+1 0.5 -> 15 Inexact Rounded +pwsx2375 power 22E+2 0.5 -> 47 Inexact Rounded +pwsx2376 power 22E+3 0.5 -> 1.5E+2 Inexact Rounded +pwsx2377 power 0.23 0.5 -> 0.48 Inexact Rounded +pwsx2378 power 0.023 0.5 -> 0.15 Inexact Rounded +pwsx2379 power 23.0E-1 0.5 -> 1.5 Inexact Rounded +pwsx2380 power 23.00E-2 0.5 -> 0.48 Inexact Rounded +pwsx2381 power 23E-3 0.5 -> 0.15 Inexact Rounded +pwsx2382 power 23E+1 0.5 -> 15 Inexact Rounded +pwsx2383 power 23E+2 0.5 -> 48 Inexact Rounded +pwsx2384 power 23E+3 0.5 -> 1.5E+2 Inexact Rounded +pwsx2385 power 0.24 0.5 -> 0.49 Inexact Rounded +pwsx2386 power 0.024 0.5 -> 0.15 Inexact Rounded +pwsx2387 power 24.0E-1 0.5 -> 1.5 Inexact Rounded +pwsx2388 power 24.00E-2 0.5 -> 0.49 Inexact Rounded +pwsx2389 power 24E-3 0.5 -> 0.15 Inexact Rounded +pwsx2390 power 24E+1 0.5 -> 15 Inexact Rounded +pwsx2391 power 24E+2 0.5 -> 49 Inexact Rounded +pwsx2392 power 24E+3 0.5 -> 1.5E+2 Inexact Rounded +pwsx2393 power 0.25 0.5 -> 0.50 Inexact Rounded +pwsx2394 power 0.025 0.5 -> 0.16 Inexact Rounded +pwsx2395 power 25.0E-1 0.5 -> 1.6 Inexact Rounded +pwsx2396 power 25.00E-2 0.5 -> 0.50 Inexact Rounded +pwsx2397 power 25E-3 0.5 -> 0.16 Inexact Rounded +pwsx2398 power 25E+1 0.5 -> 16 Inexact Rounded +pwsx2399 power 25E+2 0.5 -> 50 Inexact Rounded +pwsx2400 power 25E+3 0.5 -> 1.6E+2 Inexact Rounded +pwsx2401 power 0.26 0.5 -> 0.51 Inexact Rounded +pwsx2402 power 0.026 0.5 -> 0.16 Inexact Rounded +pwsx2403 power 26.0E-1 0.5 -> 1.6 Inexact Rounded +pwsx2404 power 26.00E-2 0.5 -> 0.51 Inexact Rounded +pwsx2405 power 26E-3 0.5 -> 0.16 Inexact Rounded +pwsx2406 power 26E+1 0.5 -> 16 Inexact Rounded +pwsx2407 power 26E+2 0.5 -> 51 Inexact Rounded +pwsx2408 power 26E+3 0.5 -> 1.6E+2 Inexact Rounded +pwsx2409 power 0.27 0.5 -> 0.52 Inexact Rounded +pwsx2410 power 0.027 0.5 -> 0.16 Inexact Rounded +pwsx2411 power 27.0E-1 0.5 -> 1.6 Inexact Rounded +pwsx2412 power 27.00E-2 0.5 -> 0.52 Inexact Rounded +pwsx2413 power 27E-3 0.5 -> 0.16 Inexact Rounded +pwsx2414 power 27E+1 0.5 -> 16 Inexact Rounded +pwsx2415 power 27E+2 0.5 -> 52 Inexact Rounded +pwsx2416 power 27E+3 0.5 -> 1.6E+2 Inexact Rounded +pwsx2417 power 0.28 0.5 -> 0.53 Inexact Rounded +pwsx2418 power 0.028 0.5 -> 0.17 Inexact Rounded +pwsx2419 power 28.0E-1 0.5 -> 1.7 Inexact Rounded +pwsx2420 power 28.00E-2 0.5 -> 0.53 Inexact Rounded +pwsx2421 power 28E-3 0.5 -> 0.17 Inexact Rounded +pwsx2422 power 28E+1 0.5 -> 17 Inexact Rounded +pwsx2423 power 28E+2 0.5 -> 53 Inexact Rounded +pwsx2424 power 28E+3 0.5 -> 1.7E+2 Inexact Rounded +pwsx2425 power 0.29 0.5 -> 0.54 Inexact Rounded +pwsx2426 power 0.029 0.5 -> 0.17 Inexact Rounded +pwsx2427 power 29.0E-1 0.5 -> 1.7 Inexact Rounded +pwsx2428 power 29.00E-2 0.5 -> 0.54 Inexact Rounded +pwsx2429 power 29E-3 0.5 -> 0.17 Inexact Rounded +pwsx2430 power 29E+1 0.5 -> 17 Inexact Rounded +pwsx2431 power 29E+2 0.5 -> 54 Inexact Rounded +pwsx2432 power 29E+3 0.5 -> 1.7E+2 Inexact Rounded +pwsx2433 power 0.30 0.5 -> 0.55 Inexact Rounded +pwsx2434 power 0.030 0.5 -> 0.17 Inexact Rounded +pwsx2435 power 30.0E-1 0.5 -> 1.7 Inexact Rounded +pwsx2436 power 30.00E-2 0.5 -> 0.55 Inexact Rounded +pwsx2437 power 30E-3 0.5 -> 0.17 Inexact Rounded +pwsx2438 power 30E+1 0.5 -> 17 Inexact Rounded +pwsx2439 power 30E+2 0.5 -> 55 Inexact Rounded +pwsx2440 power 30E+3 0.5 -> 1.7E+2 Inexact Rounded +pwsx2441 power 0.31 0.5 -> 0.56 Inexact Rounded +pwsx2442 power 0.031 0.5 -> 0.18 Inexact Rounded +pwsx2443 power 31.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2444 power 31.00E-2 0.5 -> 0.56 Inexact Rounded +pwsx2445 power 31E-3 0.5 -> 0.18 Inexact Rounded +pwsx2446 power 31E+1 0.5 -> 18 Inexact Rounded +pwsx2447 power 31E+2 0.5 -> 56 Inexact Rounded +pwsx2448 power 31E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2449 power 0.32 0.5 -> 0.57 Inexact Rounded +pwsx2450 power 0.032 0.5 -> 0.18 Inexact Rounded +pwsx2451 power 32.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2452 power 32.00E-2 0.5 -> 0.57 Inexact Rounded +pwsx2453 power 32E-3 0.5 -> 0.18 Inexact Rounded +pwsx2454 power 32E+1 0.5 -> 18 Inexact Rounded +pwsx2455 power 32E+2 0.5 -> 57 Inexact Rounded +pwsx2456 power 32E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2457 power 0.33 0.5 -> 0.57 Inexact Rounded +pwsx2458 power 0.033 0.5 -> 0.18 Inexact Rounded +pwsx2459 power 33.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2460 power 33.00E-2 0.5 -> 0.57 Inexact Rounded +pwsx2461 power 33E-3 0.5 -> 0.18 Inexact Rounded +pwsx2462 power 33E+1 0.5 -> 18 Inexact Rounded +pwsx2463 power 33E+2 0.5 -> 57 Inexact Rounded +pwsx2464 power 33E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2465 power 0.34 0.5 -> 0.58 Inexact Rounded +pwsx2466 power 0.034 0.5 -> 0.18 Inexact Rounded +pwsx2467 power 34.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2468 power 34.00E-2 0.5 -> 0.58 Inexact Rounded +pwsx2469 power 34E-3 0.5 -> 0.18 Inexact Rounded +pwsx2470 power 34E+1 0.5 -> 18 Inexact Rounded +pwsx2471 power 34E+2 0.5 -> 58 Inexact Rounded +pwsx2472 power 34E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2473 power 0.35 0.5 -> 0.59 Inexact Rounded +pwsx2474 power 0.035 0.5 -> 0.19 Inexact Rounded +pwsx2475 power 35.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2476 power 35.00E-2 0.5 -> 0.59 Inexact Rounded +pwsx2477 power 35E-3 0.5 -> 0.19 Inexact Rounded +pwsx2478 power 35E+1 0.5 -> 19 Inexact Rounded +pwsx2479 power 35E+2 0.5 -> 59 Inexact Rounded +pwsx2480 power 35E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2481 power 0.36 0.5 -> 0.60 Inexact Rounded +pwsx2482 power 0.036 0.5 -> 0.19 Inexact Rounded +pwsx2483 power 36.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2484 power 36.00E-2 0.5 -> 0.60 Inexact Rounded +pwsx2485 power 36E-3 0.5 -> 0.19 Inexact Rounded +pwsx2486 power 36E+1 0.5 -> 19 Inexact Rounded +pwsx2487 power 36E+2 0.5 -> 60 Inexact Rounded +pwsx2488 power 36E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2489 power 0.37 0.5 -> 0.61 Inexact Rounded +pwsx2490 power 0.037 0.5 -> 0.19 Inexact Rounded +pwsx2491 power 37.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2492 power 37.00E-2 0.5 -> 0.61 Inexact Rounded +pwsx2493 power 37E-3 0.5 -> 0.19 Inexact Rounded +pwsx2494 power 37E+1 0.5 -> 19 Inexact Rounded +pwsx2495 power 37E+2 0.5 -> 61 Inexact Rounded +pwsx2496 power 37E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2497 power 0.38 0.5 -> 0.62 Inexact Rounded +pwsx2498 power 0.038 0.5 -> 0.19 Inexact Rounded +pwsx2499 power 38.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2500 power 38.00E-2 0.5 -> 0.62 Inexact Rounded +pwsx2501 power 38E-3 0.5 -> 0.19 Inexact Rounded +pwsx2502 power 38E+1 0.5 -> 19 Inexact Rounded +pwsx2503 power 38E+2 0.5 -> 62 Inexact Rounded +pwsx2504 power 38E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2505 power 0.39 0.5 -> 0.62 Inexact Rounded +pwsx2506 power 0.039 0.5 -> 0.20 Inexact Rounded +pwsx2507 power 39.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2508 power 39.00E-2 0.5 -> 0.62 Inexact Rounded +pwsx2509 power 39E-3 0.5 -> 0.20 Inexact Rounded +pwsx2510 power 39E+1 0.5 -> 20 Inexact Rounded +pwsx2511 power 39E+2 0.5 -> 62 Inexact Rounded +pwsx2512 power 39E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2513 power 0.40 0.5 -> 0.63 Inexact Rounded +pwsx2514 power 0.040 0.5 -> 0.20 Inexact Rounded +pwsx2515 power 40.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2516 power 40.00E-2 0.5 -> 0.63 Inexact Rounded +pwsx2517 power 40E-3 0.5 -> 0.20 Inexact Rounded +pwsx2518 power 40E+1 0.5 -> 20 Inexact Rounded +pwsx2519 power 40E+2 0.5 -> 63 Inexact Rounded +pwsx2520 power 40E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2521 power 0.41 0.5 -> 0.64 Inexact Rounded +pwsx2522 power 0.041 0.5 -> 0.20 Inexact Rounded +pwsx2523 power 41.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2524 power 41.00E-2 0.5 -> 0.64 Inexact Rounded +pwsx2525 power 41E-3 0.5 -> 0.20 Inexact Rounded +pwsx2526 power 41E+1 0.5 -> 20 Inexact Rounded +pwsx2527 power 41E+2 0.5 -> 64 Inexact Rounded +pwsx2528 power 41E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2529 power 0.42 0.5 -> 0.65 Inexact Rounded +pwsx2530 power 0.042 0.5 -> 0.20 Inexact Rounded +pwsx2531 power 42.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2532 power 42.00E-2 0.5 -> 0.65 Inexact Rounded +pwsx2533 power 42E-3 0.5 -> 0.20 Inexact Rounded +pwsx2534 power 42E+1 0.5 -> 20 Inexact Rounded +pwsx2535 power 42E+2 0.5 -> 65 Inexact Rounded +pwsx2536 power 42E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2537 power 0.43 0.5 -> 0.66 Inexact Rounded +pwsx2538 power 0.043 0.5 -> 0.21 Inexact Rounded +pwsx2539 power 43.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2540 power 43.00E-2 0.5 -> 0.66 Inexact Rounded +pwsx2541 power 43E-3 0.5 -> 0.21 Inexact Rounded +pwsx2542 power 43E+1 0.5 -> 21 Inexact Rounded +pwsx2543 power 43E+2 0.5 -> 66 Inexact Rounded +pwsx2544 power 43E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2545 power 0.44 0.5 -> 0.66 Inexact Rounded +pwsx2546 power 0.044 0.5 -> 0.21 Inexact Rounded +pwsx2547 power 44.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2548 power 44.00E-2 0.5 -> 0.66 Inexact Rounded +pwsx2549 power 44E-3 0.5 -> 0.21 Inexact Rounded +pwsx2550 power 44E+1 0.5 -> 21 Inexact Rounded +pwsx2551 power 44E+2 0.5 -> 66 Inexact Rounded +pwsx2552 power 44E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2553 power 0.45 0.5 -> 0.67 Inexact Rounded +pwsx2554 power 0.045 0.5 -> 0.21 Inexact Rounded +pwsx2555 power 45.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2556 power 45.00E-2 0.5 -> 0.67 Inexact Rounded +pwsx2557 power 45E-3 0.5 -> 0.21 Inexact Rounded +pwsx2558 power 45E+1 0.5 -> 21 Inexact Rounded +pwsx2559 power 45E+2 0.5 -> 67 Inexact Rounded +pwsx2560 power 45E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2561 power 0.46 0.5 -> 0.68 Inexact Rounded +pwsx2562 power 0.046 0.5 -> 0.21 Inexact Rounded +pwsx2563 power 46.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2564 power 46.00E-2 0.5 -> 0.68 Inexact Rounded +pwsx2565 power 46E-3 0.5 -> 0.21 Inexact Rounded +pwsx2566 power 46E+1 0.5 -> 21 Inexact Rounded +pwsx2567 power 46E+2 0.5 -> 68 Inexact Rounded +pwsx2568 power 46E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2569 power 0.47 0.5 -> 0.69 Inexact Rounded +pwsx2570 power 0.047 0.5 -> 0.22 Inexact Rounded +pwsx2571 power 47.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2572 power 47.00E-2 0.5 -> 0.69 Inexact Rounded +pwsx2573 power 47E-3 0.5 -> 0.22 Inexact Rounded +pwsx2574 power 47E+1 0.5 -> 22 Inexact Rounded +pwsx2575 power 47E+2 0.5 -> 69 Inexact Rounded +pwsx2576 power 47E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2577 power 0.48 0.5 -> 0.69 Inexact Rounded +pwsx2578 power 0.048 0.5 -> 0.22 Inexact Rounded +pwsx2579 power 48.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2580 power 48.00E-2 0.5 -> 0.69 Inexact Rounded +pwsx2581 power 48E-3 0.5 -> 0.22 Inexact Rounded +pwsx2582 power 48E+1 0.5 -> 22 Inexact Rounded +pwsx2583 power 48E+2 0.5 -> 69 Inexact Rounded +pwsx2584 power 48E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2585 power 0.49 0.5 -> 0.70 Inexact Rounded +pwsx2586 power 0.049 0.5 -> 0.22 Inexact Rounded +pwsx2587 power 49.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2588 power 49.00E-2 0.5 -> 0.70 Inexact Rounded +pwsx2589 power 49E-3 0.5 -> 0.22 Inexact Rounded +pwsx2590 power 49E+1 0.5 -> 22 Inexact Rounded +pwsx2591 power 49E+2 0.5 -> 70 Inexact Rounded +pwsx2592 power 49E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2593 power 0.50 0.5 -> 0.71 Inexact Rounded +pwsx2594 power 0.050 0.5 -> 0.22 Inexact Rounded +pwsx2595 power 50.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2596 power 50.00E-2 0.5 -> 0.71 Inexact Rounded +pwsx2597 power 50E-3 0.5 -> 0.22 Inexact Rounded +pwsx2598 power 50E+1 0.5 -> 22 Inexact Rounded +pwsx2599 power 50E+2 0.5 -> 71 Inexact Rounded +pwsx2600 power 50E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2601 power 0.51 0.5 -> 0.71 Inexact Rounded +pwsx2602 power 0.051 0.5 -> 0.23 Inexact Rounded +pwsx2603 power 51.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2604 power 51.00E-2 0.5 -> 0.71 Inexact Rounded +pwsx2605 power 51E-3 0.5 -> 0.23 Inexact Rounded +pwsx2606 power 51E+1 0.5 -> 23 Inexact Rounded +pwsx2607 power 51E+2 0.5 -> 71 Inexact Rounded +pwsx2608 power 51E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2609 power 0.52 0.5 -> 0.72 Inexact Rounded +pwsx2610 power 0.052 0.5 -> 0.23 Inexact Rounded +pwsx2611 power 52.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2612 power 52.00E-2 0.5 -> 0.72 Inexact Rounded +pwsx2613 power 52E-3 0.5 -> 0.23 Inexact Rounded +pwsx2614 power 52E+1 0.5 -> 23 Inexact Rounded +pwsx2615 power 52E+2 0.5 -> 72 Inexact Rounded +pwsx2616 power 52E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2617 power 0.53 0.5 -> 0.73 Inexact Rounded +pwsx2618 power 0.053 0.5 -> 0.23 Inexact Rounded +pwsx2619 power 53.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2620 power 53.00E-2 0.5 -> 0.73 Inexact Rounded +pwsx2621 power 53E-3 0.5 -> 0.23 Inexact Rounded +pwsx2622 power 53E+1 0.5 -> 23 Inexact Rounded +pwsx2623 power 53E+2 0.5 -> 73 Inexact Rounded +pwsx2624 power 53E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2625 power 0.54 0.5 -> 0.73 Inexact Rounded +pwsx2626 power 0.054 0.5 -> 0.23 Inexact Rounded +pwsx2627 power 54.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2628 power 54.00E-2 0.5 -> 0.73 Inexact Rounded +pwsx2629 power 54E-3 0.5 -> 0.23 Inexact Rounded +pwsx2630 power 54E+1 0.5 -> 23 Inexact Rounded +pwsx2631 power 54E+2 0.5 -> 73 Inexact Rounded +pwsx2632 power 54E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2633 power 0.55 0.5 -> 0.74 Inexact Rounded +pwsx2634 power 0.055 0.5 -> 0.23 Inexact Rounded +pwsx2635 power 55.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2636 power 55.00E-2 0.5 -> 0.74 Inexact Rounded +pwsx2637 power 55E-3 0.5 -> 0.23 Inexact Rounded +pwsx2638 power 55E+1 0.5 -> 23 Inexact Rounded +pwsx2639 power 55E+2 0.5 -> 74 Inexact Rounded +pwsx2640 power 55E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2641 power 0.56 0.5 -> 0.75 Inexact Rounded +pwsx2642 power 0.056 0.5 -> 0.24 Inexact Rounded +pwsx2643 power 56.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2644 power 56.00E-2 0.5 -> 0.75 Inexact Rounded +pwsx2645 power 56E-3 0.5 -> 0.24 Inexact Rounded +pwsx2646 power 56E+1 0.5 -> 24 Inexact Rounded +pwsx2647 power 56E+2 0.5 -> 75 Inexact Rounded +pwsx2648 power 56E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2649 power 0.57 0.5 -> 0.75 Inexact Rounded +pwsx2650 power 0.057 0.5 -> 0.24 Inexact Rounded +pwsx2651 power 57.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2652 power 57.00E-2 0.5 -> 0.75 Inexact Rounded +pwsx2653 power 57E-3 0.5 -> 0.24 Inexact Rounded +pwsx2654 power 57E+1 0.5 -> 24 Inexact Rounded +pwsx2655 power 57E+2 0.5 -> 75 Inexact Rounded +pwsx2656 power 57E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2657 power 0.58 0.5 -> 0.76 Inexact Rounded +pwsx2658 power 0.058 0.5 -> 0.24 Inexact Rounded +pwsx2659 power 58.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2660 power 58.00E-2 0.5 -> 0.76 Inexact Rounded +pwsx2661 power 58E-3 0.5 -> 0.24 Inexact Rounded +pwsx2662 power 58E+1 0.5 -> 24 Inexact Rounded +pwsx2663 power 58E+2 0.5 -> 76 Inexact Rounded +pwsx2664 power 58E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2665 power 0.59 0.5 -> 0.77 Inexact Rounded +pwsx2666 power 0.059 0.5 -> 0.24 Inexact Rounded +pwsx2667 power 59.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2668 power 59.00E-2 0.5 -> 0.77 Inexact Rounded +pwsx2669 power 59E-3 0.5 -> 0.24 Inexact Rounded +pwsx2670 power 59E+1 0.5 -> 24 Inexact Rounded +pwsx2671 power 59E+2 0.5 -> 77 Inexact Rounded +pwsx2672 power 59E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2673 power 0.60 0.5 -> 0.77 Inexact Rounded +pwsx2674 power 0.060 0.5 -> 0.24 Inexact Rounded +pwsx2675 power 60.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2676 power 60.00E-2 0.5 -> 0.77 Inexact Rounded +pwsx2677 power 60E-3 0.5 -> 0.24 Inexact Rounded +pwsx2678 power 60E+1 0.5 -> 24 Inexact Rounded +pwsx2679 power 60E+2 0.5 -> 77 Inexact Rounded +pwsx2680 power 60E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2681 power 0.61 0.5 -> 0.78 Inexact Rounded +pwsx2682 power 0.061 0.5 -> 0.25 Inexact Rounded +pwsx2683 power 61.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2684 power 61.00E-2 0.5 -> 0.78 Inexact Rounded +pwsx2685 power 61E-3 0.5 -> 0.25 Inexact Rounded +pwsx2686 power 61E+1 0.5 -> 25 Inexact Rounded +pwsx2687 power 61E+2 0.5 -> 78 Inexact Rounded +pwsx2688 power 61E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2689 power 0.62 0.5 -> 0.79 Inexact Rounded +pwsx2690 power 0.062 0.5 -> 0.25 Inexact Rounded +pwsx2691 power 62.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2692 power 62.00E-2 0.5 -> 0.79 Inexact Rounded +pwsx2693 power 62E-3 0.5 -> 0.25 Inexact Rounded +pwsx2694 power 62E+1 0.5 -> 25 Inexact Rounded +pwsx2695 power 62E+2 0.5 -> 79 Inexact Rounded +pwsx2696 power 62E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2697 power 0.63 0.5 -> 0.79 Inexact Rounded +pwsx2698 power 0.063 0.5 -> 0.25 Inexact Rounded +pwsx2699 power 63.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2700 power 63.00E-2 0.5 -> 0.79 Inexact Rounded +pwsx2701 power 63E-3 0.5 -> 0.25 Inexact Rounded +pwsx2702 power 63E+1 0.5 -> 25 Inexact Rounded +pwsx2703 power 63E+2 0.5 -> 79 Inexact Rounded +pwsx2704 power 63E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2705 power 0.64 0.5 -> 0.80 Inexact Rounded +pwsx2706 power 0.064 0.5 -> 0.25 Inexact Rounded +pwsx2707 power 64.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2708 power 64.00E-2 0.5 -> 0.80 Inexact Rounded +pwsx2709 power 64E-3 0.5 -> 0.25 Inexact Rounded +pwsx2710 power 64E+1 0.5 -> 25 Inexact Rounded +pwsx2711 power 64E+2 0.5 -> 80 Inexact Rounded +pwsx2712 power 64E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2713 power 0.65 0.5 -> 0.81 Inexact Rounded +pwsx2714 power 0.065 0.5 -> 0.25 Inexact Rounded +pwsx2715 power 65.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2716 power 65.00E-2 0.5 -> 0.81 Inexact Rounded +pwsx2717 power 65E-3 0.5 -> 0.25 Inexact Rounded +pwsx2718 power 65E+1 0.5 -> 25 Inexact Rounded +pwsx2719 power 65E+2 0.5 -> 81 Inexact Rounded +pwsx2720 power 65E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2721 power 0.66 0.5 -> 0.81 Inexact Rounded +pwsx2722 power 0.066 0.5 -> 0.26 Inexact Rounded +pwsx2723 power 66.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2724 power 66.00E-2 0.5 -> 0.81 Inexact Rounded +pwsx2725 power 66E-3 0.5 -> 0.26 Inexact Rounded +pwsx2726 power 66E+1 0.5 -> 26 Inexact Rounded +pwsx2727 power 66E+2 0.5 -> 81 Inexact Rounded +pwsx2728 power 66E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2729 power 0.67 0.5 -> 0.82 Inexact Rounded +pwsx2730 power 0.067 0.5 -> 0.26 Inexact Rounded +pwsx2731 power 67.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2732 power 67.00E-2 0.5 -> 0.82 Inexact Rounded +pwsx2733 power 67E-3 0.5 -> 0.26 Inexact Rounded +pwsx2734 power 67E+1 0.5 -> 26 Inexact Rounded +pwsx2735 power 67E+2 0.5 -> 82 Inexact Rounded +pwsx2736 power 67E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2737 power 0.68 0.5 -> 0.82 Inexact Rounded +pwsx2738 power 0.068 0.5 -> 0.26 Inexact Rounded +pwsx2739 power 68.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2740 power 68.00E-2 0.5 -> 0.82 Inexact Rounded +pwsx2741 power 68E-3 0.5 -> 0.26 Inexact Rounded +pwsx2742 power 68E+1 0.5 -> 26 Inexact Rounded +pwsx2743 power 68E+2 0.5 -> 82 Inexact Rounded +pwsx2744 power 68E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2745 power 0.69 0.5 -> 0.83 Inexact Rounded +pwsx2746 power 0.069 0.5 -> 0.26 Inexact Rounded +pwsx2747 power 69.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2748 power 69.00E-2 0.5 -> 0.83 Inexact Rounded +pwsx2749 power 69E-3 0.5 -> 0.26 Inexact Rounded +pwsx2750 power 69E+1 0.5 -> 26 Inexact Rounded +pwsx2751 power 69E+2 0.5 -> 83 Inexact Rounded +pwsx2752 power 69E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2753 power 0.70 0.5 -> 0.84 Inexact Rounded +pwsx2754 power 0.070 0.5 -> 0.26 Inexact Rounded +pwsx2755 power 70.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2756 power 70.00E-2 0.5 -> 0.84 Inexact Rounded +pwsx2757 power 70E-3 0.5 -> 0.26 Inexact Rounded +pwsx2758 power 70E+1 0.5 -> 26 Inexact Rounded +pwsx2759 power 70E+2 0.5 -> 84 Inexact Rounded +pwsx2760 power 70E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2761 power 0.71 0.5 -> 0.84 Inexact Rounded +pwsx2762 power 0.071 0.5 -> 0.27 Inexact Rounded +pwsx2763 power 71.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2764 power 71.00E-2 0.5 -> 0.84 Inexact Rounded +pwsx2765 power 71E-3 0.5 -> 0.27 Inexact Rounded +pwsx2766 power 71E+1 0.5 -> 27 Inexact Rounded +pwsx2767 power 71E+2 0.5 -> 84 Inexact Rounded +pwsx2768 power 71E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2769 power 0.72 0.5 -> 0.85 Inexact Rounded +pwsx2770 power 0.072 0.5 -> 0.27 Inexact Rounded +pwsx2771 power 72.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2772 power 72.00E-2 0.5 -> 0.85 Inexact Rounded +pwsx2773 power 72E-3 0.5 -> 0.27 Inexact Rounded +pwsx2774 power 72E+1 0.5 -> 27 Inexact Rounded +pwsx2775 power 72E+2 0.5 -> 85 Inexact Rounded +pwsx2776 power 72E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2777 power 0.73 0.5 -> 0.85 Inexact Rounded +pwsx2778 power 0.073 0.5 -> 0.27 Inexact Rounded +pwsx2779 power 73.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2780 power 73.00E-2 0.5 -> 0.85 Inexact Rounded +pwsx2781 power 73E-3 0.5 -> 0.27 Inexact Rounded +pwsx2782 power 73E+1 0.5 -> 27 Inexact Rounded +pwsx2783 power 73E+2 0.5 -> 85 Inexact Rounded +pwsx2784 power 73E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2785 power 0.74 0.5 -> 0.86 Inexact Rounded +pwsx2786 power 0.074 0.5 -> 0.27 Inexact Rounded +pwsx2787 power 74.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2788 power 74.00E-2 0.5 -> 0.86 Inexact Rounded +pwsx2789 power 74E-3 0.5 -> 0.27 Inexact Rounded +pwsx2790 power 74E+1 0.5 -> 27 Inexact Rounded +pwsx2791 power 74E+2 0.5 -> 86 Inexact Rounded +pwsx2792 power 74E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2793 power 0.75 0.5 -> 0.87 Inexact Rounded +pwsx2794 power 0.075 0.5 -> 0.27 Inexact Rounded +pwsx2795 power 75.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2796 power 75.00E-2 0.5 -> 0.87 Inexact Rounded +pwsx2797 power 75E-3 0.5 -> 0.27 Inexact Rounded +pwsx2798 power 75E+1 0.5 -> 27 Inexact Rounded +pwsx2799 power 75E+2 0.5 -> 87 Inexact Rounded +pwsx2800 power 75E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2801 power 0.76 0.5 -> 0.87 Inexact Rounded +pwsx2802 power 0.076 0.5 -> 0.28 Inexact Rounded +pwsx2803 power 76.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2804 power 76.00E-2 0.5 -> 0.87 Inexact Rounded +pwsx2805 power 76E-3 0.5 -> 0.28 Inexact Rounded +pwsx2806 power 76E+1 0.5 -> 28 Inexact Rounded +pwsx2807 power 76E+2 0.5 -> 87 Inexact Rounded +pwsx2808 power 76E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2809 power 0.77 0.5 -> 0.88 Inexact Rounded +pwsx2810 power 0.077 0.5 -> 0.28 Inexact Rounded +pwsx2811 power 77.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2812 power 77.00E-2 0.5 -> 0.88 Inexact Rounded +pwsx2813 power 77E-3 0.5 -> 0.28 Inexact Rounded +pwsx2814 power 77E+1 0.5 -> 28 Inexact Rounded +pwsx2815 power 77E+2 0.5 -> 88 Inexact Rounded +pwsx2816 power 77E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2817 power 0.78 0.5 -> 0.88 Inexact Rounded +pwsx2818 power 0.078 0.5 -> 0.28 Inexact Rounded +pwsx2819 power 78.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2820 power 78.00E-2 0.5 -> 0.88 Inexact Rounded +pwsx2821 power 78E-3 0.5 -> 0.28 Inexact Rounded +pwsx2822 power 78E+1 0.5 -> 28 Inexact Rounded +pwsx2823 power 78E+2 0.5 -> 88 Inexact Rounded +pwsx2824 power 78E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2825 power 0.79 0.5 -> 0.89 Inexact Rounded +pwsx2826 power 0.079 0.5 -> 0.28 Inexact Rounded +pwsx2827 power 79.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2828 power 79.00E-2 0.5 -> 0.89 Inexact Rounded +pwsx2829 power 79E-3 0.5 -> 0.28 Inexact Rounded +pwsx2830 power 79E+1 0.5 -> 28 Inexact Rounded +pwsx2831 power 79E+2 0.5 -> 89 Inexact Rounded +pwsx2832 power 79E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2833 power 0.80 0.5 -> 0.89 Inexact Rounded +pwsx2834 power 0.080 0.5 -> 0.28 Inexact Rounded +pwsx2835 power 80.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2836 power 80.00E-2 0.5 -> 0.89 Inexact Rounded +pwsx2837 power 80E-3 0.5 -> 0.28 Inexact Rounded +pwsx2838 power 80E+1 0.5 -> 28 Inexact Rounded +pwsx2839 power 80E+2 0.5 -> 89 Inexact Rounded +pwsx2840 power 80E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2841 power 0.81 0.5 -> 0.90 Inexact Rounded +pwsx2842 power 0.081 0.5 -> 0.28 Inexact Rounded +pwsx2843 power 81.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2844 power 81.00E-2 0.5 -> 0.90 Inexact Rounded +pwsx2845 power 81E-3 0.5 -> 0.28 Inexact Rounded +pwsx2846 power 81E+1 0.5 -> 28 Inexact Rounded +pwsx2847 power 81E+2 0.5 -> 90 Inexact Rounded +pwsx2848 power 81E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2849 power 0.82 0.5 -> 0.91 Inexact Rounded +pwsx2850 power 0.082 0.5 -> 0.29 Inexact Rounded +pwsx2851 power 82.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2852 power 82.00E-2 0.5 -> 0.91 Inexact Rounded +pwsx2853 power 82E-3 0.5 -> 0.29 Inexact Rounded +pwsx2854 power 82E+1 0.5 -> 29 Inexact Rounded +pwsx2855 power 82E+2 0.5 -> 91 Inexact Rounded +pwsx2856 power 82E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2857 power 0.83 0.5 -> 0.91 Inexact Rounded +pwsx2858 power 0.083 0.5 -> 0.29 Inexact Rounded +pwsx2859 power 83.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2860 power 83.00E-2 0.5 -> 0.91 Inexact Rounded +pwsx2861 power 83E-3 0.5 -> 0.29 Inexact Rounded +pwsx2862 power 83E+1 0.5 -> 29 Inexact Rounded +pwsx2863 power 83E+2 0.5 -> 91 Inexact Rounded +pwsx2864 power 83E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2865 power 0.84 0.5 -> 0.92 Inexact Rounded +pwsx2866 power 0.084 0.5 -> 0.29 Inexact Rounded +pwsx2867 power 84.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2868 power 84.00E-2 0.5 -> 0.92 Inexact Rounded +pwsx2869 power 84E-3 0.5 -> 0.29 Inexact Rounded +pwsx2870 power 84E+1 0.5 -> 29 Inexact Rounded +pwsx2871 power 84E+2 0.5 -> 92 Inexact Rounded +pwsx2872 power 84E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2873 power 0.85 0.5 -> 0.92 Inexact Rounded +pwsx2874 power 0.085 0.5 -> 0.29 Inexact Rounded +pwsx2875 power 85.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2876 power 85.00E-2 0.5 -> 0.92 Inexact Rounded +pwsx2877 power 85E-3 0.5 -> 0.29 Inexact Rounded +pwsx2878 power 85E+1 0.5 -> 29 Inexact Rounded +pwsx2879 power 85E+2 0.5 -> 92 Inexact Rounded +pwsx2880 power 85E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2881 power 0.86 0.5 -> 0.93 Inexact Rounded +pwsx2882 power 0.086 0.5 -> 0.29 Inexact Rounded +pwsx2883 power 86.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2884 power 86.00E-2 0.5 -> 0.93 Inexact Rounded +pwsx2885 power 86E-3 0.5 -> 0.29 Inexact Rounded +pwsx2886 power 86E+1 0.5 -> 29 Inexact Rounded +pwsx2887 power 86E+2 0.5 -> 93 Inexact Rounded +pwsx2888 power 86E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2889 power 0.87 0.5 -> 0.93 Inexact Rounded +pwsx2890 power 0.087 0.5 -> 0.29 Inexact Rounded +pwsx2891 power 87.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2892 power 87.00E-2 0.5 -> 0.93 Inexact Rounded +pwsx2893 power 87E-3 0.5 -> 0.29 Inexact Rounded +pwsx2894 power 87E+1 0.5 -> 29 Inexact Rounded +pwsx2895 power 87E+2 0.5 -> 93 Inexact Rounded +pwsx2896 power 87E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2897 power 0.88 0.5 -> 0.94 Inexact Rounded +pwsx2898 power 0.088 0.5 -> 0.30 Inexact Rounded +pwsx2899 power 88.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2900 power 88.00E-2 0.5 -> 0.94 Inexact Rounded +pwsx2901 power 88E-3 0.5 -> 0.30 Inexact Rounded +pwsx2902 power 88E+1 0.5 -> 30 Inexact Rounded +pwsx2903 power 88E+2 0.5 -> 94 Inexact Rounded +pwsx2904 power 88E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2905 power 0.89 0.5 -> 0.94 Inexact Rounded +pwsx2906 power 0.089 0.5 -> 0.30 Inexact Rounded +pwsx2907 power 89.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2908 power 89.00E-2 0.5 -> 0.94 Inexact Rounded +pwsx2909 power 89E-3 0.5 -> 0.30 Inexact Rounded +pwsx2910 power 89E+1 0.5 -> 30 Inexact Rounded +pwsx2911 power 89E+2 0.5 -> 94 Inexact Rounded +pwsx2912 power 89E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2913 power 0.90 0.5 -> 0.95 Inexact Rounded +pwsx2914 power 0.090 0.5 -> 0.30 Inexact Rounded +pwsx2915 power 90.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2916 power 90.00E-2 0.5 -> 0.95 Inexact Rounded +pwsx2917 power 90E-3 0.5 -> 0.30 Inexact Rounded +pwsx2918 power 90E+1 0.5 -> 30 Inexact Rounded +pwsx2919 power 90E+2 0.5 -> 95 Inexact Rounded +pwsx2920 power 90E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2921 power 0.91 0.5 -> 0.95 Inexact Rounded +pwsx2922 power 0.091 0.5 -> 0.30 Inexact Rounded +pwsx2923 power 91.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2924 power 91.00E-2 0.5 -> 0.95 Inexact Rounded +pwsx2925 power 91E-3 0.5 -> 0.30 Inexact Rounded +pwsx2926 power 91E+1 0.5 -> 30 Inexact Rounded +pwsx2927 power 91E+2 0.5 -> 95 Inexact Rounded +pwsx2928 power 91E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2929 power 0.92 0.5 -> 0.96 Inexact Rounded +pwsx2930 power 0.092 0.5 -> 0.30 Inexact Rounded +pwsx2931 power 92.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2932 power 92.00E-2 0.5 -> 0.96 Inexact Rounded +pwsx2933 power 92E-3 0.5 -> 0.30 Inexact Rounded +pwsx2934 power 92E+1 0.5 -> 30 Inexact Rounded +pwsx2935 power 92E+2 0.5 -> 96 Inexact Rounded +pwsx2936 power 92E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2937 power 0.93 0.5 -> 0.96 Inexact Rounded +pwsx2938 power 0.093 0.5 -> 0.30 Inexact Rounded +pwsx2939 power 93.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2940 power 93.00E-2 0.5 -> 0.96 Inexact Rounded +pwsx2941 power 93E-3 0.5 -> 0.30 Inexact Rounded +pwsx2942 power 93E+1 0.5 -> 30 Inexact Rounded +pwsx2943 power 93E+2 0.5 -> 96 Inexact Rounded +pwsx2944 power 93E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2945 power 0.94 0.5 -> 0.97 Inexact Rounded +pwsx2946 power 0.094 0.5 -> 0.31 Inexact Rounded +pwsx2947 power 94.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2948 power 94.00E-2 0.5 -> 0.97 Inexact Rounded +pwsx2949 power 94E-3 0.5 -> 0.31 Inexact Rounded +pwsx2950 power 94E+1 0.5 -> 31 Inexact Rounded +pwsx2951 power 94E+2 0.5 -> 97 Inexact Rounded +pwsx2952 power 94E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2953 power 0.95 0.5 -> 0.97 Inexact Rounded +pwsx2954 power 0.095 0.5 -> 0.31 Inexact Rounded +pwsx2955 power 95.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2956 power 95.00E-2 0.5 -> 0.97 Inexact Rounded +pwsx2957 power 95E-3 0.5 -> 0.31 Inexact Rounded +pwsx2958 power 95E+1 0.5 -> 31 Inexact Rounded +pwsx2959 power 95E+2 0.5 -> 97 Inexact Rounded +pwsx2960 power 95E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2961 power 0.96 0.5 -> 0.98 Inexact Rounded +pwsx2962 power 0.096 0.5 -> 0.31 Inexact Rounded +pwsx2963 power 96.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2964 power 96.00E-2 0.5 -> 0.98 Inexact Rounded +pwsx2965 power 96E-3 0.5 -> 0.31 Inexact Rounded +pwsx2966 power 96E+1 0.5 -> 31 Inexact Rounded +pwsx2967 power 96E+2 0.5 -> 98 Inexact Rounded +pwsx2968 power 96E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2969 power 0.97 0.5 -> 0.98 Inexact Rounded +pwsx2970 power 0.097 0.5 -> 0.31 Inexact Rounded +pwsx2971 power 97.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2972 power 97.00E-2 0.5 -> 0.98 Inexact Rounded +pwsx2973 power 97E-3 0.5 -> 0.31 Inexact Rounded +pwsx2974 power 97E+1 0.5 -> 31 Inexact Rounded +pwsx2975 power 97E+2 0.5 -> 98 Inexact Rounded +pwsx2976 power 97E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2977 power 0.98 0.5 -> 0.99 Inexact Rounded +pwsx2978 power 0.098 0.5 -> 0.31 Inexact Rounded +pwsx2979 power 98.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2980 power 98.00E-2 0.5 -> 0.99 Inexact Rounded +pwsx2981 power 98E-3 0.5 -> 0.31 Inexact Rounded +pwsx2982 power 98E+1 0.5 -> 31 Inexact Rounded +pwsx2983 power 98E+2 0.5 -> 99 Inexact Rounded +pwsx2984 power 98E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2985 power 0.99 0.5 -> 0.99 Inexact Rounded +pwsx2986 power 0.099 0.5 -> 0.31 Inexact Rounded +pwsx2987 power 99.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2988 power 99.00E-2 0.5 -> 0.99 Inexact Rounded +pwsx2989 power 99E-3 0.5 -> 0.31 Inexact Rounded +pwsx2990 power 99E+1 0.5 -> 31 Inexact Rounded +pwsx2991 power 99E+2 0.5 -> 99 Inexact Rounded +pwsx2992 power 99E+3 0.5 -> 3.1E+2 Inexact Rounded + +-- Precision 3 squareroot tests [exhaustive, f and f/10] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 3 +pwsx3001 power 0.1 0.5 -> 0.316 Inexact Rounded +pwsx3002 power 0.01 0.5 -> 0.100 Inexact Rounded +pwsx3003 power 0.2 0.5 -> 0.447 Inexact Rounded +pwsx3004 power 0.02 0.5 -> 0.141 Inexact Rounded +pwsx3005 power 0.3 0.5 -> 0.548 Inexact Rounded +pwsx3006 power 0.03 0.5 -> 0.173 Inexact Rounded +pwsx3007 power 0.4 0.5 -> 0.632 Inexact Rounded +pwsx3008 power 0.04 0.5 -> 0.200 Inexact Rounded +pwsx3009 power 0.5 0.5 -> 0.707 Inexact Rounded +pwsx3010 power 0.05 0.5 -> 0.224 Inexact Rounded +pwsx3011 power 0.6 0.5 -> 0.775 Inexact Rounded +pwsx3012 power 0.06 0.5 -> 0.245 Inexact Rounded +pwsx3013 power 0.7 0.5 -> 0.837 Inexact Rounded +pwsx3014 power 0.07 0.5 -> 0.265 Inexact Rounded +pwsx3015 power 0.8 0.5 -> 0.894 Inexact Rounded +pwsx3016 power 0.08 0.5 -> 0.283 Inexact Rounded +pwsx3017 power 0.9 0.5 -> 0.949 Inexact Rounded +pwsx3018 power 0.09 0.5 -> 0.300 Inexact Rounded +pwsx3019 power 0.11 0.5 -> 0.332 Inexact Rounded +pwsx3020 power 0.011 0.5 -> 0.105 Inexact Rounded +pwsx3021 power 0.12 0.5 -> 0.346 Inexact Rounded +pwsx3022 power 0.012 0.5 -> 0.110 Inexact Rounded +pwsx3023 power 0.13 0.5 -> 0.361 Inexact Rounded +pwsx3024 power 0.013 0.5 -> 0.114 Inexact Rounded +pwsx3025 power 0.14 0.5 -> 0.374 Inexact Rounded +pwsx3026 power 0.014 0.5 -> 0.118 Inexact Rounded +pwsx3027 power 0.15 0.5 -> 0.387 Inexact Rounded +pwsx3028 power 0.015 0.5 -> 0.122 Inexact Rounded +pwsx3029 power 0.16 0.5 -> 0.400 Inexact Rounded +pwsx3030 power 0.016 0.5 -> 0.126 Inexact Rounded +pwsx3031 power 0.17 0.5 -> 0.412 Inexact Rounded +pwsx3032 power 0.017 0.5 -> 0.130 Inexact Rounded +pwsx3033 power 0.18 0.5 -> 0.424 Inexact Rounded +pwsx3034 power 0.018 0.5 -> 0.134 Inexact Rounded +pwsx3035 power 0.19 0.5 -> 0.436 Inexact Rounded +pwsx3036 power 0.019 0.5 -> 0.138 Inexact Rounded +pwsx3037 power 0.21 0.5 -> 0.458 Inexact Rounded +pwsx3038 power 0.021 0.5 -> 0.145 Inexact Rounded +pwsx3039 power 0.22 0.5 -> 0.469 Inexact Rounded +pwsx3040 power 0.022 0.5 -> 0.148 Inexact Rounded +pwsx3041 power 0.23 0.5 -> 0.480 Inexact Rounded +pwsx3042 power 0.023 0.5 -> 0.152 Inexact Rounded +pwsx3043 power 0.24 0.5 -> 0.490 Inexact Rounded +pwsx3044 power 0.024 0.5 -> 0.155 Inexact Rounded +pwsx3045 power 0.25 0.5 -> 0.500 Inexact Rounded +pwsx3046 power 0.025 0.5 -> 0.158 Inexact Rounded +pwsx3047 power 0.26 0.5 -> 0.510 Inexact Rounded +pwsx3048 power 0.026 0.5 -> 0.161 Inexact Rounded +pwsx3049 power 0.27 0.5 -> 0.520 Inexact Rounded +pwsx3050 power 0.027 0.5 -> 0.164 Inexact Rounded +pwsx3051 power 0.28 0.5 -> 0.529 Inexact Rounded +pwsx3052 power 0.028 0.5 -> 0.167 Inexact Rounded +pwsx3053 power 0.29 0.5 -> 0.539 Inexact Rounded +pwsx3054 power 0.029 0.5 -> 0.170 Inexact Rounded +pwsx3055 power 0.31 0.5 -> 0.557 Inexact Rounded +pwsx3056 power 0.031 0.5 -> 0.176 Inexact Rounded +pwsx3057 power 0.32 0.5 -> 0.566 Inexact Rounded +pwsx3058 power 0.032 0.5 -> 0.179 Inexact Rounded +pwsx3059 power 0.33 0.5 -> 0.574 Inexact Rounded +pwsx3060 power 0.033 0.5 -> 0.182 Inexact Rounded +pwsx3061 power 0.34 0.5 -> 0.583 Inexact Rounded +pwsx3062 power 0.034 0.5 -> 0.184 Inexact Rounded +pwsx3063 power 0.35 0.5 -> 0.592 Inexact Rounded +pwsx3064 power 0.035 0.5 -> 0.187 Inexact Rounded +pwsx3065 power 0.36 0.5 -> 0.600 Inexact Rounded +pwsx3066 power 0.036 0.5 -> 0.190 Inexact Rounded +pwsx3067 power 0.37 0.5 -> 0.608 Inexact Rounded +pwsx3068 power 0.037 0.5 -> 0.192 Inexact Rounded +pwsx3069 power 0.38 0.5 -> 0.616 Inexact Rounded +pwsx3070 power 0.038 0.5 -> 0.195 Inexact Rounded +pwsx3071 power 0.39 0.5 -> 0.624 Inexact Rounded +pwsx3072 power 0.039 0.5 -> 0.197 Inexact Rounded +pwsx3073 power 0.41 0.5 -> 0.640 Inexact Rounded +pwsx3074 power 0.041 0.5 -> 0.202 Inexact Rounded +pwsx3075 power 0.42 0.5 -> 0.648 Inexact Rounded +pwsx3076 power 0.042 0.5 -> 0.205 Inexact Rounded +pwsx3077 power 0.43 0.5 -> 0.656 Inexact Rounded +pwsx3078 power 0.043 0.5 -> 0.207 Inexact Rounded +pwsx3079 power 0.44 0.5 -> 0.663 Inexact Rounded +pwsx3080 power 0.044 0.5 -> 0.210 Inexact Rounded +pwsx3081 power 0.45 0.5 -> 0.671 Inexact Rounded +pwsx3082 power 0.045 0.5 -> 0.212 Inexact Rounded +pwsx3083 power 0.46 0.5 -> 0.678 Inexact Rounded +pwsx3084 power 0.046 0.5 -> 0.214 Inexact Rounded +pwsx3085 power 0.47 0.5 -> 0.686 Inexact Rounded +pwsx3086 power 0.047 0.5 -> 0.217 Inexact Rounded +pwsx3087 power 0.48 0.5 -> 0.693 Inexact Rounded +pwsx3088 power 0.048 0.5 -> 0.219 Inexact Rounded +pwsx3089 power 0.49 0.5 -> 0.700 Inexact Rounded +pwsx3090 power 0.049 0.5 -> 0.221 Inexact Rounded +pwsx3091 power 0.51 0.5 -> 0.714 Inexact Rounded +pwsx3092 power 0.051 0.5 -> 0.226 Inexact Rounded +pwsx3093 power 0.52 0.5 -> 0.721 Inexact Rounded +pwsx3094 power 0.052 0.5 -> 0.228 Inexact Rounded +pwsx3095 power 0.53 0.5 -> 0.728 Inexact Rounded +pwsx3096 power 0.053 0.5 -> 0.230 Inexact Rounded +pwsx3097 power 0.54 0.5 -> 0.735 Inexact Rounded +pwsx3098 power 0.054 0.5 -> 0.232 Inexact Rounded +pwsx3099 power 0.55 0.5 -> 0.742 Inexact Rounded +pwsx3100 power 0.055 0.5 -> 0.235 Inexact Rounded +pwsx3101 power 0.56 0.5 -> 0.748 Inexact Rounded +pwsx3102 power 0.056 0.5 -> 0.237 Inexact Rounded +pwsx3103 power 0.57 0.5 -> 0.755 Inexact Rounded +pwsx3104 power 0.057 0.5 -> 0.239 Inexact Rounded +pwsx3105 power 0.58 0.5 -> 0.762 Inexact Rounded +pwsx3106 power 0.058 0.5 -> 0.241 Inexact Rounded +pwsx3107 power 0.59 0.5 -> 0.768 Inexact Rounded +pwsx3108 power 0.059 0.5 -> 0.243 Inexact Rounded +pwsx3109 power 0.61 0.5 -> 0.781 Inexact Rounded +pwsx3110 power 0.061 0.5 -> 0.247 Inexact Rounded +pwsx3111 power 0.62 0.5 -> 0.787 Inexact Rounded +pwsx3112 power 0.062 0.5 -> 0.249 Inexact Rounded +pwsx3113 power 0.63 0.5 -> 0.794 Inexact Rounded +pwsx3114 power 0.063 0.5 -> 0.251 Inexact Rounded +pwsx3115 power 0.64 0.5 -> 0.800 Inexact Rounded +pwsx3116 power 0.064 0.5 -> 0.253 Inexact Rounded +pwsx3117 power 0.65 0.5 -> 0.806 Inexact Rounded +pwsx3118 power 0.065 0.5 -> 0.255 Inexact Rounded +pwsx3119 power 0.66 0.5 -> 0.812 Inexact Rounded +pwsx3120 power 0.066 0.5 -> 0.257 Inexact Rounded +pwsx3121 power 0.67 0.5 -> 0.819 Inexact Rounded +pwsx3122 power 0.067 0.5 -> 0.259 Inexact Rounded +pwsx3123 power 0.68 0.5 -> 0.825 Inexact Rounded +pwsx3124 power 0.068 0.5 -> 0.261 Inexact Rounded +pwsx3125 power 0.69 0.5 -> 0.831 Inexact Rounded +pwsx3126 power 0.069 0.5 -> 0.263 Inexact Rounded +pwsx3127 power 0.71 0.5 -> 0.843 Inexact Rounded +pwsx3128 power 0.071 0.5 -> 0.266 Inexact Rounded +pwsx3129 power 0.72 0.5 -> 0.849 Inexact Rounded +pwsx3130 power 0.072 0.5 -> 0.268 Inexact Rounded +pwsx3131 power 0.73 0.5 -> 0.854 Inexact Rounded +pwsx3132 power 0.073 0.5 -> 0.270 Inexact Rounded +pwsx3133 power 0.74 0.5 -> 0.860 Inexact Rounded +pwsx3134 power 0.074 0.5 -> 0.272 Inexact Rounded +pwsx3135 power 0.75 0.5 -> 0.866 Inexact Rounded +pwsx3136 power 0.075 0.5 -> 0.274 Inexact Rounded +pwsx3137 power 0.76 0.5 -> 0.872 Inexact Rounded +pwsx3138 power 0.076 0.5 -> 0.276 Inexact Rounded +pwsx3139 power 0.77 0.5 -> 0.877 Inexact Rounded +pwsx3140 power 0.077 0.5 -> 0.277 Inexact Rounded +pwsx3141 power 0.78 0.5 -> 0.883 Inexact Rounded +pwsx3142 power 0.078 0.5 -> 0.279 Inexact Rounded +pwsx3143 power 0.79 0.5 -> 0.889 Inexact Rounded +pwsx3144 power 0.079 0.5 -> 0.281 Inexact Rounded +pwsx3145 power 0.81 0.5 -> 0.900 Inexact Rounded +pwsx3146 power 0.081 0.5 -> 0.285 Inexact Rounded +pwsx3147 power 0.82 0.5 -> 0.906 Inexact Rounded +pwsx3148 power 0.082 0.5 -> 0.286 Inexact Rounded +pwsx3149 power 0.83 0.5 -> 0.911 Inexact Rounded +pwsx3150 power 0.083 0.5 -> 0.288 Inexact Rounded +pwsx3151 power 0.84 0.5 -> 0.917 Inexact Rounded +pwsx3152 power 0.084 0.5 -> 0.290 Inexact Rounded +pwsx3153 power 0.85 0.5 -> 0.922 Inexact Rounded +pwsx3154 power 0.085 0.5 -> 0.292 Inexact Rounded +pwsx3155 power 0.86 0.5 -> 0.927 Inexact Rounded +pwsx3156 power 0.086 0.5 -> 0.293 Inexact Rounded +pwsx3157 power 0.87 0.5 -> 0.933 Inexact Rounded +pwsx3158 power 0.087 0.5 -> 0.295 Inexact Rounded +pwsx3159 power 0.88 0.5 -> 0.938 Inexact Rounded +pwsx3160 power 0.088 0.5 -> 0.297 Inexact Rounded +pwsx3161 power 0.89 0.5 -> 0.943 Inexact Rounded +pwsx3162 power 0.089 0.5 -> 0.298 Inexact Rounded +pwsx3163 power 0.91 0.5 -> 0.954 Inexact Rounded +pwsx3164 power 0.091 0.5 -> 0.302 Inexact Rounded +pwsx3165 power 0.92 0.5 -> 0.959 Inexact Rounded +pwsx3166 power 0.092 0.5 -> 0.303 Inexact Rounded +pwsx3167 power 0.93 0.5 -> 0.964 Inexact Rounded +pwsx3168 power 0.093 0.5 -> 0.305 Inexact Rounded +pwsx3169 power 0.94 0.5 -> 0.970 Inexact Rounded +pwsx3170 power 0.094 0.5 -> 0.307 Inexact Rounded +pwsx3171 power 0.95 0.5 -> 0.975 Inexact Rounded +pwsx3172 power 0.095 0.5 -> 0.308 Inexact Rounded +pwsx3173 power 0.96 0.5 -> 0.980 Inexact Rounded +pwsx3174 power 0.096 0.5 -> 0.310 Inexact Rounded +pwsx3175 power 0.97 0.5 -> 0.985 Inexact Rounded +pwsx3176 power 0.097 0.5 -> 0.311 Inexact Rounded +pwsx3177 power 0.98 0.5 -> 0.990 Inexact Rounded +pwsx3178 power 0.098 0.5 -> 0.313 Inexact Rounded +pwsx3179 power 0.99 0.5 -> 0.995 Inexact Rounded +pwsx3180 power 0.099 0.5 -> 0.315 Inexact Rounded +pwsx3181 power 0.101 0.5 -> 0.318 Inexact Rounded +pwsx3182 power 0.0101 0.5 -> 0.100 Inexact Rounded +pwsx3183 power 0.102 0.5 -> 0.319 Inexact Rounded +pwsx3184 power 0.0102 0.5 -> 0.101 Inexact Rounded +pwsx3185 power 0.103 0.5 -> 0.321 Inexact Rounded +pwsx3186 power 0.0103 0.5 -> 0.101 Inexact Rounded +pwsx3187 power 0.104 0.5 -> 0.322 Inexact Rounded +pwsx3188 power 0.0104 0.5 -> 0.102 Inexact Rounded +pwsx3189 power 0.105 0.5 -> 0.324 Inexact Rounded +pwsx3190 power 0.0105 0.5 -> 0.102 Inexact Rounded +pwsx3191 power 0.106 0.5 -> 0.326 Inexact Rounded +pwsx3192 power 0.0106 0.5 -> 0.103 Inexact Rounded +pwsx3193 power 0.107 0.5 -> 0.327 Inexact Rounded +pwsx3194 power 0.0107 0.5 -> 0.103 Inexact Rounded +pwsx3195 power 0.108 0.5 -> 0.329 Inexact Rounded +pwsx3196 power 0.0108 0.5 -> 0.104 Inexact Rounded +pwsx3197 power 0.109 0.5 -> 0.330 Inexact Rounded +pwsx3198 power 0.0109 0.5 -> 0.104 Inexact Rounded +pwsx3199 power 0.111 0.5 -> 0.333 Inexact Rounded +pwsx3200 power 0.0111 0.5 -> 0.105 Inexact Rounded +pwsx3201 power 0.112 0.5 -> 0.335 Inexact Rounded +pwsx3202 power 0.0112 0.5 -> 0.106 Inexact Rounded +pwsx3203 power 0.113 0.5 -> 0.336 Inexact Rounded +pwsx3204 power 0.0113 0.5 -> 0.106 Inexact Rounded +pwsx3205 power 0.114 0.5 -> 0.338 Inexact Rounded +pwsx3206 power 0.0114 0.5 -> 0.107 Inexact Rounded +pwsx3207 power 0.115 0.5 -> 0.339 Inexact Rounded +pwsx3208 power 0.0115 0.5 -> 0.107 Inexact Rounded +pwsx3209 power 0.116 0.5 -> 0.341 Inexact Rounded +pwsx3210 power 0.0116 0.5 -> 0.108 Inexact Rounded +pwsx3211 power 0.117 0.5 -> 0.342 Inexact Rounded +pwsx3212 power 0.0117 0.5 -> 0.108 Inexact Rounded +pwsx3213 power 0.118 0.5 -> 0.344 Inexact Rounded +pwsx3214 power 0.0118 0.5 -> 0.109 Inexact Rounded +pwsx3215 power 0.119 0.5 -> 0.345 Inexact Rounded +pwsx3216 power 0.0119 0.5 -> 0.109 Inexact Rounded +pwsx3217 power 0.121 0.5 -> 0.348 Inexact Rounded +pwsx3218 power 0.0121 0.5 -> 0.110 Inexact Rounded +pwsx3219 power 0.122 0.5 -> 0.349 Inexact Rounded +pwsx3220 power 0.0122 0.5 -> 0.110 Inexact Rounded +pwsx3221 power 0.123 0.5 -> 0.351 Inexact Rounded +pwsx3222 power 0.0123 0.5 -> 0.111 Inexact Rounded +pwsx3223 power 0.124 0.5 -> 0.352 Inexact Rounded +pwsx3224 power 0.0124 0.5 -> 0.111 Inexact Rounded +pwsx3225 power 0.125 0.5 -> 0.354 Inexact Rounded +pwsx3226 power 0.0125 0.5 -> 0.112 Inexact Rounded +pwsx3227 power 0.126 0.5 -> 0.355 Inexact Rounded +pwsx3228 power 0.0126 0.5 -> 0.112 Inexact Rounded +pwsx3229 power 0.127 0.5 -> 0.356 Inexact Rounded +pwsx3230 power 0.0127 0.5 -> 0.113 Inexact Rounded +pwsx3231 power 0.128 0.5 -> 0.358 Inexact Rounded +pwsx3232 power 0.0128 0.5 -> 0.113 Inexact Rounded +pwsx3233 power 0.129 0.5 -> 0.359 Inexact Rounded +pwsx3234 power 0.0129 0.5 -> 0.114 Inexact Rounded +pwsx3235 power 0.131 0.5 -> 0.362 Inexact Rounded +pwsx3236 power 0.0131 0.5 -> 0.114 Inexact Rounded +pwsx3237 power 0.132 0.5 -> 0.363 Inexact Rounded +pwsx3238 power 0.0132 0.5 -> 0.115 Inexact Rounded +pwsx3239 power 0.133 0.5 -> 0.365 Inexact Rounded +pwsx3240 power 0.0133 0.5 -> 0.115 Inexact Rounded +pwsx3241 power 0.134 0.5 -> 0.366 Inexact Rounded +pwsx3242 power 0.0134 0.5 -> 0.116 Inexact Rounded +pwsx3243 power 0.135 0.5 -> 0.367 Inexact Rounded +pwsx3244 power 0.0135 0.5 -> 0.116 Inexact Rounded +pwsx3245 power 0.136 0.5 -> 0.369 Inexact Rounded +pwsx3246 power 0.0136 0.5 -> 0.117 Inexact Rounded +pwsx3247 power 0.137 0.5 -> 0.370 Inexact Rounded +pwsx3248 power 0.0137 0.5 -> 0.117 Inexact Rounded +pwsx3249 power 0.138 0.5 -> 0.371 Inexact Rounded +pwsx3250 power 0.0138 0.5 -> 0.117 Inexact Rounded +pwsx3251 power 0.139 0.5 -> 0.373 Inexact Rounded +pwsx3252 power 0.0139 0.5 -> 0.118 Inexact Rounded +pwsx3253 power 0.141 0.5 -> 0.375 Inexact Rounded +pwsx3254 power 0.0141 0.5 -> 0.119 Inexact Rounded +pwsx3255 power 0.142 0.5 -> 0.377 Inexact Rounded +pwsx3256 power 0.0142 0.5 -> 0.119 Inexact Rounded +pwsx3257 power 0.143 0.5 -> 0.378 Inexact Rounded +pwsx3258 power 0.0143 0.5 -> 0.120 Inexact Rounded +pwsx3259 power 0.144 0.5 -> 0.379 Inexact Rounded +pwsx3260 power 0.0144 0.5 -> 0.120 Inexact Rounded +pwsx3261 power 0.145 0.5 -> 0.381 Inexact Rounded +pwsx3262 power 0.0145 0.5 -> 0.120 Inexact Rounded +pwsx3263 power 0.146 0.5 -> 0.382 Inexact Rounded +pwsx3264 power 0.0146 0.5 -> 0.121 Inexact Rounded +pwsx3265 power 0.147 0.5 -> 0.383 Inexact Rounded +pwsx3266 power 0.0147 0.5 -> 0.121 Inexact Rounded +pwsx3267 power 0.148 0.5 -> 0.385 Inexact Rounded +pwsx3268 power 0.0148 0.5 -> 0.122 Inexact Rounded +pwsx3269 power 0.149 0.5 -> 0.386 Inexact Rounded +pwsx3270 power 0.0149 0.5 -> 0.122 Inexact Rounded +pwsx3271 power 0.151 0.5 -> 0.389 Inexact Rounded +pwsx3272 power 0.0151 0.5 -> 0.123 Inexact Rounded +pwsx3273 power 0.152 0.5 -> 0.390 Inexact Rounded +pwsx3274 power 0.0152 0.5 -> 0.123 Inexact Rounded +pwsx3275 power 0.153 0.5 -> 0.391 Inexact Rounded +pwsx3276 power 0.0153 0.5 -> 0.124 Inexact Rounded +pwsx3277 power 0.154 0.5 -> 0.392 Inexact Rounded +pwsx3278 power 0.0154 0.5 -> 0.124 Inexact Rounded +pwsx3279 power 0.155 0.5 -> 0.394 Inexact Rounded +pwsx3280 power 0.0155 0.5 -> 0.124 Inexact Rounded +pwsx3281 power 0.156 0.5 -> 0.395 Inexact Rounded +pwsx3282 power 0.0156 0.5 -> 0.125 Inexact Rounded +pwsx3283 power 0.157 0.5 -> 0.396 Inexact Rounded +pwsx3284 power 0.0157 0.5 -> 0.125 Inexact Rounded +pwsx3285 power 0.158 0.5 -> 0.397 Inexact Rounded +pwsx3286 power 0.0158 0.5 -> 0.126 Inexact Rounded +pwsx3287 power 0.159 0.5 -> 0.399 Inexact Rounded +pwsx3288 power 0.0159 0.5 -> 0.126 Inexact Rounded +pwsx3289 power 0.161 0.5 -> 0.401 Inexact Rounded +pwsx3290 power 0.0161 0.5 -> 0.127 Inexact Rounded +pwsx3291 power 0.162 0.5 -> 0.402 Inexact Rounded +pwsx3292 power 0.0162 0.5 -> 0.127 Inexact Rounded +pwsx3293 power 0.163 0.5 -> 0.404 Inexact Rounded +pwsx3294 power 0.0163 0.5 -> 0.128 Inexact Rounded +pwsx3295 power 0.164 0.5 -> 0.405 Inexact Rounded +pwsx3296 power 0.0164 0.5 -> 0.128 Inexact Rounded +pwsx3297 power 0.165 0.5 -> 0.406 Inexact Rounded +pwsx3298 power 0.0165 0.5 -> 0.128 Inexact Rounded +pwsx3299 power 0.166 0.5 -> 0.407 Inexact Rounded +pwsx3300 power 0.0166 0.5 -> 0.129 Inexact Rounded +pwsx3301 power 0.167 0.5 -> 0.409 Inexact Rounded +pwsx3302 power 0.0167 0.5 -> 0.129 Inexact Rounded +pwsx3303 power 0.168 0.5 -> 0.410 Inexact Rounded +pwsx3304 power 0.0168 0.5 -> 0.130 Inexact Rounded +pwsx3305 power 0.169 0.5 -> 0.411 Inexact Rounded +pwsx3306 power 0.0169 0.5 -> 0.130 Inexact Rounded +pwsx3307 power 0.171 0.5 -> 0.414 Inexact Rounded +pwsx3308 power 0.0171 0.5 -> 0.131 Inexact Rounded +pwsx3309 power 0.172 0.5 -> 0.415 Inexact Rounded +pwsx3310 power 0.0172 0.5 -> 0.131 Inexact Rounded +pwsx3311 power 0.173 0.5 -> 0.416 Inexact Rounded +pwsx3312 power 0.0173 0.5 -> 0.132 Inexact Rounded +pwsx3313 power 0.174 0.5 -> 0.417 Inexact Rounded +pwsx3314 power 0.0174 0.5 -> 0.132 Inexact Rounded +pwsx3315 power 0.175 0.5 -> 0.418 Inexact Rounded +pwsx3316 power 0.0175 0.5 -> 0.132 Inexact Rounded +pwsx3317 power 0.176 0.5 -> 0.420 Inexact Rounded +pwsx3318 power 0.0176 0.5 -> 0.133 Inexact Rounded +pwsx3319 power 0.177 0.5 -> 0.421 Inexact Rounded +pwsx3320 power 0.0177 0.5 -> 0.133 Inexact Rounded +pwsx3321 power 0.178 0.5 -> 0.422 Inexact Rounded +pwsx3322 power 0.0178 0.5 -> 0.133 Inexact Rounded +pwsx3323 power 0.179 0.5 -> 0.423 Inexact Rounded +pwsx3324 power 0.0179 0.5 -> 0.134 Inexact Rounded +pwsx3325 power 0.181 0.5 -> 0.425 Inexact Rounded +pwsx3326 power 0.0181 0.5 -> 0.135 Inexact Rounded +pwsx3327 power 0.182 0.5 -> 0.427 Inexact Rounded +pwsx3328 power 0.0182 0.5 -> 0.135 Inexact Rounded +pwsx3329 power 0.183 0.5 -> 0.428 Inexact Rounded +pwsx3330 power 0.0183 0.5 -> 0.135 Inexact Rounded +pwsx3331 power 0.184 0.5 -> 0.429 Inexact Rounded +pwsx3332 power 0.0184 0.5 -> 0.136 Inexact Rounded +pwsx3333 power 0.185 0.5 -> 0.430 Inexact Rounded +pwsx3334 power 0.0185 0.5 -> 0.136 Inexact Rounded +pwsx3335 power 0.186 0.5 -> 0.431 Inexact Rounded +pwsx3336 power 0.0186 0.5 -> 0.136 Inexact Rounded +pwsx3337 power 0.187 0.5 -> 0.432 Inexact Rounded +pwsx3338 power 0.0187 0.5 -> 0.137 Inexact Rounded +pwsx3339 power 0.188 0.5 -> 0.434 Inexact Rounded +pwsx3340 power 0.0188 0.5 -> 0.137 Inexact Rounded +pwsx3341 power 0.189 0.5 -> 0.435 Inexact Rounded +pwsx3342 power 0.0189 0.5 -> 0.137 Inexact Rounded +pwsx3343 power 0.191 0.5 -> 0.437 Inexact Rounded +pwsx3344 power 0.0191 0.5 -> 0.138 Inexact Rounded +pwsx3345 power 0.192 0.5 -> 0.438 Inexact Rounded +pwsx3346 power 0.0192 0.5 -> 0.139 Inexact Rounded +pwsx3347 power 0.193 0.5 -> 0.439 Inexact Rounded +pwsx3348 power 0.0193 0.5 -> 0.139 Inexact Rounded +pwsx3349 power 0.194 0.5 -> 0.440 Inexact Rounded +pwsx3350 power 0.0194 0.5 -> 0.139 Inexact Rounded +pwsx3351 power 0.195 0.5 -> 0.442 Inexact Rounded +pwsx3352 power 0.0195 0.5 -> 0.140 Inexact Rounded +pwsx3353 power 0.196 0.5 -> 0.443 Inexact Rounded +pwsx3354 power 0.0196 0.5 -> 0.140 Inexact Rounded +pwsx3355 power 0.197 0.5 -> 0.444 Inexact Rounded +pwsx3356 power 0.0197 0.5 -> 0.140 Inexact Rounded +pwsx3357 power 0.198 0.5 -> 0.445 Inexact Rounded +pwsx3358 power 0.0198 0.5 -> 0.141 Inexact Rounded +pwsx3359 power 0.199 0.5 -> 0.446 Inexact Rounded +pwsx3360 power 0.0199 0.5 -> 0.141 Inexact Rounded +pwsx3361 power 0.201 0.5 -> 0.448 Inexact Rounded +pwsx3362 power 0.0201 0.5 -> 0.142 Inexact Rounded +pwsx3363 power 0.202 0.5 -> 0.449 Inexact Rounded +pwsx3364 power 0.0202 0.5 -> 0.142 Inexact Rounded +pwsx3365 power 0.203 0.5 -> 0.451 Inexact Rounded +pwsx3366 power 0.0203 0.5 -> 0.142 Inexact Rounded +pwsx3367 power 0.204 0.5 -> 0.452 Inexact Rounded +pwsx3368 power 0.0204 0.5 -> 0.143 Inexact Rounded +pwsx3369 power 0.205 0.5 -> 0.453 Inexact Rounded +pwsx3370 power 0.0205 0.5 -> 0.143 Inexact Rounded +pwsx3371 power 0.206 0.5 -> 0.454 Inexact Rounded +pwsx3372 power 0.0206 0.5 -> 0.144 Inexact Rounded +pwsx3373 power 0.207 0.5 -> 0.455 Inexact Rounded +pwsx3374 power 0.0207 0.5 -> 0.144 Inexact Rounded +pwsx3375 power 0.208 0.5 -> 0.456 Inexact Rounded +pwsx3376 power 0.0208 0.5 -> 0.144 Inexact Rounded +pwsx3377 power 0.209 0.5 -> 0.457 Inexact Rounded +pwsx3378 power 0.0209 0.5 -> 0.145 Inexact Rounded +pwsx3379 power 0.211 0.5 -> 0.459 Inexact Rounded +pwsx3380 power 0.0211 0.5 -> 0.145 Inexact Rounded +pwsx3381 power 0.212 0.5 -> 0.460 Inexact Rounded +pwsx3382 power 0.0212 0.5 -> 0.146 Inexact Rounded +pwsx3383 power 0.213 0.5 -> 0.462 Inexact Rounded +pwsx3384 power 0.0213 0.5 -> 0.146 Inexact Rounded +pwsx3385 power 0.214 0.5 -> 0.463 Inexact Rounded +pwsx3386 power 0.0214 0.5 -> 0.146 Inexact Rounded +pwsx3387 power 0.215 0.5 -> 0.464 Inexact Rounded +pwsx3388 power 0.0215 0.5 -> 0.147 Inexact Rounded +pwsx3389 power 0.216 0.5 -> 0.465 Inexact Rounded +pwsx3390 power 0.0216 0.5 -> 0.147 Inexact Rounded +pwsx3391 power 0.217 0.5 -> 0.466 Inexact Rounded +pwsx3392 power 0.0217 0.5 -> 0.147 Inexact Rounded +pwsx3393 power 0.218 0.5 -> 0.467 Inexact Rounded +pwsx3394 power 0.0218 0.5 -> 0.148 Inexact Rounded +pwsx3395 power 0.219 0.5 -> 0.468 Inexact Rounded +pwsx3396 power 0.0219 0.5 -> 0.148 Inexact Rounded +pwsx3397 power 0.221 0.5 -> 0.470 Inexact Rounded +pwsx3398 power 0.0221 0.5 -> 0.149 Inexact Rounded +pwsx3399 power 0.222 0.5 -> 0.471 Inexact Rounded +pwsx3400 power 0.0222 0.5 -> 0.149 Inexact Rounded +pwsx3401 power 0.223 0.5 -> 0.472 Inexact Rounded +pwsx3402 power 0.0223 0.5 -> 0.149 Inexact Rounded +pwsx3403 power 0.224 0.5 -> 0.473 Inexact Rounded +pwsx3404 power 0.0224 0.5 -> 0.150 Inexact Rounded +pwsx3405 power 0.225 0.5 -> 0.474 Inexact Rounded +pwsx3406 power 0.0225 0.5 -> 0.150 Inexact Rounded +pwsx3407 power 0.226 0.5 -> 0.475 Inexact Rounded +pwsx3408 power 0.0226 0.5 -> 0.150 Inexact Rounded +pwsx3409 power 0.227 0.5 -> 0.476 Inexact Rounded +pwsx3410 power 0.0227 0.5 -> 0.151 Inexact Rounded +pwsx3411 power 0.228 0.5 -> 0.477 Inexact Rounded +pwsx3412 power 0.0228 0.5 -> 0.151 Inexact Rounded +pwsx3413 power 0.229 0.5 -> 0.479 Inexact Rounded +pwsx3414 power 0.0229 0.5 -> 0.151 Inexact Rounded +pwsx3415 power 0.231 0.5 -> 0.481 Inexact Rounded +pwsx3416 power 0.0231 0.5 -> 0.152 Inexact Rounded +pwsx3417 power 0.232 0.5 -> 0.482 Inexact Rounded +pwsx3418 power 0.0232 0.5 -> 0.152 Inexact Rounded +pwsx3419 power 0.233 0.5 -> 0.483 Inexact Rounded +pwsx3420 power 0.0233 0.5 -> 0.153 Inexact Rounded +pwsx3421 power 0.234 0.5 -> 0.484 Inexact Rounded +pwsx3422 power 0.0234 0.5 -> 0.153 Inexact Rounded +pwsx3423 power 0.235 0.5 -> 0.485 Inexact Rounded +pwsx3424 power 0.0235 0.5 -> 0.153 Inexact Rounded +pwsx3425 power 0.236 0.5 -> 0.486 Inexact Rounded +pwsx3426 power 0.0236 0.5 -> 0.154 Inexact Rounded +pwsx3427 power 0.237 0.5 -> 0.487 Inexact Rounded +pwsx3428 power 0.0237 0.5 -> 0.154 Inexact Rounded +pwsx3429 power 0.238 0.5 -> 0.488 Inexact Rounded +pwsx3430 power 0.0238 0.5 -> 0.154 Inexact Rounded +pwsx3431 power 0.239 0.5 -> 0.489 Inexact Rounded +pwsx3432 power 0.0239 0.5 -> 0.155 Inexact Rounded +pwsx3433 power 0.241 0.5 -> 0.491 Inexact Rounded +pwsx3434 power 0.0241 0.5 -> 0.155 Inexact Rounded +pwsx3435 power 0.242 0.5 -> 0.492 Inexact Rounded +pwsx3436 power 0.0242 0.5 -> 0.156 Inexact Rounded +pwsx3437 power 0.243 0.5 -> 0.493 Inexact Rounded +pwsx3438 power 0.0243 0.5 -> 0.156 Inexact Rounded +pwsx3439 power 0.244 0.5 -> 0.494 Inexact Rounded +pwsx3440 power 0.0244 0.5 -> 0.156 Inexact Rounded +pwsx3441 power 0.245 0.5 -> 0.495 Inexact Rounded +pwsx3442 power 0.0245 0.5 -> 0.157 Inexact Rounded +pwsx3443 power 0.246 0.5 -> 0.496 Inexact Rounded +pwsx3444 power 0.0246 0.5 -> 0.157 Inexact Rounded +pwsx3445 power 0.247 0.5 -> 0.497 Inexact Rounded +pwsx3446 power 0.0247 0.5 -> 0.157 Inexact Rounded +pwsx3447 power 0.248 0.5 -> 0.498 Inexact Rounded +pwsx3448 power 0.0248 0.5 -> 0.157 Inexact Rounded +pwsx3449 power 0.249 0.5 -> 0.499 Inexact Rounded +pwsx3450 power 0.0249 0.5 -> 0.158 Inexact Rounded +pwsx3451 power 0.251 0.5 -> 0.501 Inexact Rounded +pwsx3452 power 0.0251 0.5 -> 0.158 Inexact Rounded +pwsx3453 power 0.252 0.5 -> 0.502 Inexact Rounded +pwsx3454 power 0.0252 0.5 -> 0.159 Inexact Rounded +pwsx3455 power 0.253 0.5 -> 0.503 Inexact Rounded +pwsx3456 power 0.0253 0.5 -> 0.159 Inexact Rounded +pwsx3457 power 0.254 0.5 -> 0.504 Inexact Rounded +pwsx3458 power 0.0254 0.5 -> 0.159 Inexact Rounded +pwsx3459 power 0.255 0.5 -> 0.505 Inexact Rounded +pwsx3460 power 0.0255 0.5 -> 0.160 Inexact Rounded +pwsx3461 power 0.256 0.5 -> 0.506 Inexact Rounded +pwsx3462 power 0.0256 0.5 -> 0.160 Inexact Rounded +pwsx3463 power 0.257 0.5 -> 0.507 Inexact Rounded +pwsx3464 power 0.0257 0.5 -> 0.160 Inexact Rounded +pwsx3465 power 0.258 0.5 -> 0.508 Inexact Rounded +pwsx3466 power 0.0258 0.5 -> 0.161 Inexact Rounded +pwsx3467 power 0.259 0.5 -> 0.509 Inexact Rounded +pwsx3468 power 0.0259 0.5 -> 0.161 Inexact Rounded +pwsx3469 power 0.261 0.5 -> 0.511 Inexact Rounded +pwsx3470 power 0.0261 0.5 -> 0.162 Inexact Rounded +pwsx3471 power 0.262 0.5 -> 0.512 Inexact Rounded +pwsx3472 power 0.0262 0.5 -> 0.162 Inexact Rounded +pwsx3473 power 0.263 0.5 -> 0.513 Inexact Rounded +pwsx3474 power 0.0263 0.5 -> 0.162 Inexact Rounded +pwsx3475 power 0.264 0.5 -> 0.514 Inexact Rounded +pwsx3476 power 0.0264 0.5 -> 0.162 Inexact Rounded +pwsx3477 power 0.265 0.5 -> 0.515 Inexact Rounded +pwsx3478 power 0.0265 0.5 -> 0.163 Inexact Rounded +pwsx3479 power 0.266 0.5 -> 0.516 Inexact Rounded +pwsx3480 power 0.0266 0.5 -> 0.163 Inexact Rounded +pwsx3481 power 0.267 0.5 -> 0.517 Inexact Rounded +pwsx3482 power 0.0267 0.5 -> 0.163 Inexact Rounded +pwsx3483 power 0.268 0.5 -> 0.518 Inexact Rounded +pwsx3484 power 0.0268 0.5 -> 0.164 Inexact Rounded +pwsx3485 power 0.269 0.5 -> 0.519 Inexact Rounded +pwsx3486 power 0.0269 0.5 -> 0.164 Inexact Rounded +pwsx3487 power 0.271 0.5 -> 0.521 Inexact Rounded +pwsx3488 power 0.0271 0.5 -> 0.165 Inexact Rounded +pwsx3489 power 0.272 0.5 -> 0.522 Inexact Rounded +pwsx3490 power 0.0272 0.5 -> 0.165 Inexact Rounded +pwsx3491 power 0.273 0.5 -> 0.522 Inexact Rounded +pwsx3492 power 0.0273 0.5 -> 0.165 Inexact Rounded +pwsx3493 power 0.274 0.5 -> 0.523 Inexact Rounded +pwsx3494 power 0.0274 0.5 -> 0.166 Inexact Rounded +pwsx3495 power 0.275 0.5 -> 0.524 Inexact Rounded +pwsx3496 power 0.0275 0.5 -> 0.166 Inexact Rounded +pwsx3497 power 0.276 0.5 -> 0.525 Inexact Rounded +pwsx3498 power 0.0276 0.5 -> 0.166 Inexact Rounded +pwsx3499 power 0.277 0.5 -> 0.526 Inexact Rounded +pwsx3500 power 0.0277 0.5 -> 0.166 Inexact Rounded +pwsx3501 power 0.278 0.5 -> 0.527 Inexact Rounded +pwsx3502 power 0.0278 0.5 -> 0.167 Inexact Rounded +pwsx3503 power 0.279 0.5 -> 0.528 Inexact Rounded +pwsx3504 power 0.0279 0.5 -> 0.167 Inexact Rounded +pwsx3505 power 0.281 0.5 -> 0.530 Inexact Rounded +pwsx3506 power 0.0281 0.5 -> 0.168 Inexact Rounded +pwsx3507 power 0.282 0.5 -> 0.531 Inexact Rounded +pwsx3508 power 0.0282 0.5 -> 0.168 Inexact Rounded +pwsx3509 power 0.283 0.5 -> 0.532 Inexact Rounded +pwsx3510 power 0.0283 0.5 -> 0.168 Inexact Rounded +pwsx3511 power 0.284 0.5 -> 0.533 Inexact Rounded +pwsx3512 power 0.0284 0.5 -> 0.169 Inexact Rounded +pwsx3513 power 0.285 0.5 -> 0.534 Inexact Rounded +pwsx3514 power 0.0285 0.5 -> 0.169 Inexact Rounded +pwsx3515 power 0.286 0.5 -> 0.535 Inexact Rounded +pwsx3516 power 0.0286 0.5 -> 0.169 Inexact Rounded +pwsx3517 power 0.287 0.5 -> 0.536 Inexact Rounded +pwsx3518 power 0.0287 0.5 -> 0.169 Inexact Rounded +pwsx3519 power 0.288 0.5 -> 0.537 Inexact Rounded +pwsx3520 power 0.0288 0.5 -> 0.170 Inexact Rounded +pwsx3521 power 0.289 0.5 -> 0.538 Inexact Rounded +pwsx3522 power 0.0289 0.5 -> 0.170 Inexact Rounded +pwsx3523 power 0.291 0.5 -> 0.539 Inexact Rounded +pwsx3524 power 0.0291 0.5 -> 0.171 Inexact Rounded +pwsx3525 power 0.292 0.5 -> 0.540 Inexact Rounded +pwsx3526 power 0.0292 0.5 -> 0.171 Inexact Rounded +pwsx3527 power 0.293 0.5 -> 0.541 Inexact Rounded +pwsx3528 power 0.0293 0.5 -> 0.171 Inexact Rounded +pwsx3529 power 0.294 0.5 -> 0.542 Inexact Rounded +pwsx3530 power 0.0294 0.5 -> 0.171 Inexact Rounded +pwsx3531 power 0.295 0.5 -> 0.543 Inexact Rounded +pwsx3532 power 0.0295 0.5 -> 0.172 Inexact Rounded +pwsx3533 power 0.296 0.5 -> 0.544 Inexact Rounded +pwsx3534 power 0.0296 0.5 -> 0.172 Inexact Rounded +pwsx3535 power 0.297 0.5 -> 0.545 Inexact Rounded +pwsx3536 power 0.0297 0.5 -> 0.172 Inexact Rounded +pwsx3537 power 0.298 0.5 -> 0.546 Inexact Rounded +pwsx3538 power 0.0298 0.5 -> 0.173 Inexact Rounded +pwsx3539 power 0.299 0.5 -> 0.547 Inexact Rounded +pwsx3540 power 0.0299 0.5 -> 0.173 Inexact Rounded +pwsx3541 power 0.301 0.5 -> 0.549 Inexact Rounded +pwsx3542 power 0.0301 0.5 -> 0.173 Inexact Rounded +pwsx3543 power 0.302 0.5 -> 0.550 Inexact Rounded +pwsx3544 power 0.0302 0.5 -> 0.174 Inexact Rounded +pwsx3545 power 0.303 0.5 -> 0.550 Inexact Rounded +pwsx3546 power 0.0303 0.5 -> 0.174 Inexact Rounded +pwsx3547 power 0.304 0.5 -> 0.551 Inexact Rounded +pwsx3548 power 0.0304 0.5 -> 0.174 Inexact Rounded +pwsx3549 power 0.305 0.5 -> 0.552 Inexact Rounded +pwsx3550 power 0.0305 0.5 -> 0.175 Inexact Rounded +pwsx3551 power 0.306 0.5 -> 0.553 Inexact Rounded +pwsx3552 power 0.0306 0.5 -> 0.175 Inexact Rounded +pwsx3553 power 0.307 0.5 -> 0.554 Inexact Rounded +pwsx3554 power 0.0307 0.5 -> 0.175 Inexact Rounded +pwsx3555 power 0.308 0.5 -> 0.555 Inexact Rounded +pwsx3556 power 0.0308 0.5 -> 0.175 Inexact Rounded +pwsx3557 power 0.309 0.5 -> 0.556 Inexact Rounded +pwsx3558 power 0.0309 0.5 -> 0.176 Inexact Rounded +pwsx3559 power 0.311 0.5 -> 0.558 Inexact Rounded +pwsx3560 power 0.0311 0.5 -> 0.176 Inexact Rounded +pwsx3561 power 0.312 0.5 -> 0.559 Inexact Rounded +pwsx3562 power 0.0312 0.5 -> 0.177 Inexact Rounded +pwsx3563 power 0.313 0.5 -> 0.559 Inexact Rounded +pwsx3564 power 0.0313 0.5 -> 0.177 Inexact Rounded +pwsx3565 power 0.314 0.5 -> 0.560 Inexact Rounded +pwsx3566 power 0.0314 0.5 -> 0.177 Inexact Rounded +pwsx3567 power 0.315 0.5 -> 0.561 Inexact Rounded +pwsx3568 power 0.0315 0.5 -> 0.177 Inexact Rounded +pwsx3569 power 0.316 0.5 -> 0.562 Inexact Rounded +pwsx3570 power 0.0316 0.5 -> 0.178 Inexact Rounded +pwsx3571 power 0.317 0.5 -> 0.563 Inexact Rounded +pwsx3572 power 0.0317 0.5 -> 0.178 Inexact Rounded +pwsx3573 power 0.318 0.5 -> 0.564 Inexact Rounded +pwsx3574 power 0.0318 0.5 -> 0.178 Inexact Rounded +pwsx3575 power 0.319 0.5 -> 0.565 Inexact Rounded +pwsx3576 power 0.0319 0.5 -> 0.179 Inexact Rounded +pwsx3577 power 0.321 0.5 -> 0.567 Inexact Rounded +pwsx3578 power 0.0321 0.5 -> 0.179 Inexact Rounded +pwsx3579 power 0.322 0.5 -> 0.567 Inexact Rounded +pwsx3580 power 0.0322 0.5 -> 0.179 Inexact Rounded +pwsx3581 power 0.323 0.5 -> 0.568 Inexact Rounded +pwsx3582 power 0.0323 0.5 -> 0.180 Inexact Rounded +pwsx3583 power 0.324 0.5 -> 0.569 Inexact Rounded +pwsx3584 power 0.0324 0.5 -> 0.180 Inexact Rounded +pwsx3585 power 0.325 0.5 -> 0.570 Inexact Rounded +pwsx3586 power 0.0325 0.5 -> 0.180 Inexact Rounded +pwsx3587 power 0.326 0.5 -> 0.571 Inexact Rounded +pwsx3588 power 0.0326 0.5 -> 0.181 Inexact Rounded +pwsx3589 power 0.327 0.5 -> 0.572 Inexact Rounded +pwsx3590 power 0.0327 0.5 -> 0.181 Inexact Rounded +pwsx3591 power 0.328 0.5 -> 0.573 Inexact Rounded +pwsx3592 power 0.0328 0.5 -> 0.181 Inexact Rounded +pwsx3593 power 0.329 0.5 -> 0.574 Inexact Rounded +pwsx3594 power 0.0329 0.5 -> 0.181 Inexact Rounded +pwsx3595 power 0.331 0.5 -> 0.575 Inexact Rounded +pwsx3596 power 0.0331 0.5 -> 0.182 Inexact Rounded +pwsx3597 power 0.332 0.5 -> 0.576 Inexact Rounded +pwsx3598 power 0.0332 0.5 -> 0.182 Inexact Rounded +pwsx3599 power 0.333 0.5 -> 0.577 Inexact Rounded +pwsx3600 power 0.0333 0.5 -> 0.182 Inexact Rounded +pwsx3601 power 0.334 0.5 -> 0.578 Inexact Rounded +pwsx3602 power 0.0334 0.5 -> 0.183 Inexact Rounded +pwsx3603 power 0.335 0.5 -> 0.579 Inexact Rounded +pwsx3604 power 0.0335 0.5 -> 0.183 Inexact Rounded +pwsx3605 power 0.336 0.5 -> 0.580 Inexact Rounded +pwsx3606 power 0.0336 0.5 -> 0.183 Inexact Rounded +pwsx3607 power 0.337 0.5 -> 0.581 Inexact Rounded +pwsx3608 power 0.0337 0.5 -> 0.184 Inexact Rounded +pwsx3609 power 0.338 0.5 -> 0.581 Inexact Rounded +pwsx3610 power 0.0338 0.5 -> 0.184 Inexact Rounded +pwsx3611 power 0.339 0.5 -> 0.582 Inexact Rounded +pwsx3612 power 0.0339 0.5 -> 0.184 Inexact Rounded +pwsx3613 power 0.341 0.5 -> 0.584 Inexact Rounded +pwsx3614 power 0.0341 0.5 -> 0.185 Inexact Rounded +pwsx3615 power 0.342 0.5 -> 0.585 Inexact Rounded +pwsx3616 power 0.0342 0.5 -> 0.185 Inexact Rounded +pwsx3617 power 0.343 0.5 -> 0.586 Inexact Rounded +pwsx3618 power 0.0343 0.5 -> 0.185 Inexact Rounded +pwsx3619 power 0.344 0.5 -> 0.587 Inexact Rounded +pwsx3620 power 0.0344 0.5 -> 0.185 Inexact Rounded +pwsx3621 power 0.345 0.5 -> 0.587 Inexact Rounded +pwsx3622 power 0.0345 0.5 -> 0.186 Inexact Rounded +pwsx3623 power 0.346 0.5 -> 0.588 Inexact Rounded +pwsx3624 power 0.0346 0.5 -> 0.186 Inexact Rounded +pwsx3625 power 0.347 0.5 -> 0.589 Inexact Rounded +pwsx3626 power 0.0347 0.5 -> 0.186 Inexact Rounded +pwsx3627 power 0.348 0.5 -> 0.590 Inexact Rounded +pwsx3628 power 0.0348 0.5 -> 0.187 Inexact Rounded +pwsx3629 power 0.349 0.5 -> 0.591 Inexact Rounded +pwsx3630 power 0.0349 0.5 -> 0.187 Inexact Rounded +pwsx3631 power 0.351 0.5 -> 0.592 Inexact Rounded +pwsx3632 power 0.0351 0.5 -> 0.187 Inexact Rounded +pwsx3633 power 0.352 0.5 -> 0.593 Inexact Rounded +pwsx3634 power 0.0352 0.5 -> 0.188 Inexact Rounded +pwsx3635 power 0.353 0.5 -> 0.594 Inexact Rounded +pwsx3636 power 0.0353 0.5 -> 0.188 Inexact Rounded +pwsx3637 power 0.354 0.5 -> 0.595 Inexact Rounded +pwsx3638 power 0.0354 0.5 -> 0.188 Inexact Rounded +pwsx3639 power 0.355 0.5 -> 0.596 Inexact Rounded +pwsx3640 power 0.0355 0.5 -> 0.188 Inexact Rounded +pwsx3641 power 0.356 0.5 -> 0.597 Inexact Rounded +pwsx3642 power 0.0356 0.5 -> 0.189 Inexact Rounded +pwsx3643 power 0.357 0.5 -> 0.597 Inexact Rounded +pwsx3644 power 0.0357 0.5 -> 0.189 Inexact Rounded +pwsx3645 power 0.358 0.5 -> 0.598 Inexact Rounded +pwsx3646 power 0.0358 0.5 -> 0.189 Inexact Rounded +pwsx3647 power 0.359 0.5 -> 0.599 Inexact Rounded +pwsx3648 power 0.0359 0.5 -> 0.189 Inexact Rounded +pwsx3649 power 0.361 0.5 -> 0.601 Inexact Rounded +pwsx3650 power 0.0361 0.5 -> 0.190 Inexact Rounded +pwsx3651 power 0.362 0.5 -> 0.602 Inexact Rounded +pwsx3652 power 0.0362 0.5 -> 0.190 Inexact Rounded +pwsx3653 power 0.363 0.5 -> 0.602 Inexact Rounded +pwsx3654 power 0.0363 0.5 -> 0.191 Inexact Rounded +pwsx3655 power 0.364 0.5 -> 0.603 Inexact Rounded +pwsx3656 power 0.0364 0.5 -> 0.191 Inexact Rounded +pwsx3657 power 0.365 0.5 -> 0.604 Inexact Rounded +pwsx3658 power 0.0365 0.5 -> 0.191 Inexact Rounded +pwsx3659 power 0.366 0.5 -> 0.605 Inexact Rounded +pwsx3660 power 0.0366 0.5 -> 0.191 Inexact Rounded +pwsx3661 power 0.367 0.5 -> 0.606 Inexact Rounded +pwsx3662 power 0.0367 0.5 -> 0.192 Inexact Rounded +pwsx3663 power 0.368 0.5 -> 0.607 Inexact Rounded +pwsx3664 power 0.0368 0.5 -> 0.192 Inexact Rounded +pwsx3665 power 0.369 0.5 -> 0.607 Inexact Rounded +pwsx3666 power 0.0369 0.5 -> 0.192 Inexact Rounded +pwsx3667 power 0.371 0.5 -> 0.609 Inexact Rounded +pwsx3668 power 0.0371 0.5 -> 0.193 Inexact Rounded +pwsx3669 power 0.372 0.5 -> 0.610 Inexact Rounded +pwsx3670 power 0.0372 0.5 -> 0.193 Inexact Rounded +pwsx3671 power 0.373 0.5 -> 0.611 Inexact Rounded +pwsx3672 power 0.0373 0.5 -> 0.193 Inexact Rounded +pwsx3673 power 0.374 0.5 -> 0.612 Inexact Rounded +pwsx3674 power 0.0374 0.5 -> 0.193 Inexact Rounded +pwsx3675 power 0.375 0.5 -> 0.612 Inexact Rounded +pwsx3676 power 0.0375 0.5 -> 0.194 Inexact Rounded +pwsx3677 power 0.376 0.5 -> 0.613 Inexact Rounded +pwsx3678 power 0.0376 0.5 -> 0.194 Inexact Rounded +pwsx3679 power 0.377 0.5 -> 0.614 Inexact Rounded +pwsx3680 power 0.0377 0.5 -> 0.194 Inexact Rounded +pwsx3681 power 0.378 0.5 -> 0.615 Inexact Rounded +pwsx3682 power 0.0378 0.5 -> 0.194 Inexact Rounded +pwsx3683 power 0.379 0.5 -> 0.616 Inexact Rounded +pwsx3684 power 0.0379 0.5 -> 0.195 Inexact Rounded +pwsx3685 power 0.381 0.5 -> 0.617 Inexact Rounded +pwsx3686 power 0.0381 0.5 -> 0.195 Inexact Rounded +pwsx3687 power 0.382 0.5 -> 0.618 Inexact Rounded +pwsx3688 power 0.0382 0.5 -> 0.195 Inexact Rounded +pwsx3689 power 0.383 0.5 -> 0.619 Inexact Rounded +pwsx3690 power 0.0383 0.5 -> 0.196 Inexact Rounded +pwsx3691 power 0.384 0.5 -> 0.620 Inexact Rounded +pwsx3692 power 0.0384 0.5 -> 0.196 Inexact Rounded +pwsx3693 power 0.385 0.5 -> 0.620 Inexact Rounded +pwsx3694 power 0.0385 0.5 -> 0.196 Inexact Rounded +pwsx3695 power 0.386 0.5 -> 0.621 Inexact Rounded +pwsx3696 power 0.0386 0.5 -> 0.196 Inexact Rounded +pwsx3697 power 0.387 0.5 -> 0.622 Inexact Rounded +pwsx3698 power 0.0387 0.5 -> 0.197 Inexact Rounded +pwsx3699 power 0.388 0.5 -> 0.623 Inexact Rounded +pwsx3700 power 0.0388 0.5 -> 0.197 Inexact Rounded +pwsx3701 power 0.389 0.5 -> 0.624 Inexact Rounded +pwsx3702 power 0.0389 0.5 -> 0.197 Inexact Rounded +pwsx3703 power 0.391 0.5 -> 0.625 Inexact Rounded +pwsx3704 power 0.0391 0.5 -> 0.198 Inexact Rounded +pwsx3705 power 0.392 0.5 -> 0.626 Inexact Rounded +pwsx3706 power 0.0392 0.5 -> 0.198 Inexact Rounded +pwsx3707 power 0.393 0.5 -> 0.627 Inexact Rounded +pwsx3708 power 0.0393 0.5 -> 0.198 Inexact Rounded +pwsx3709 power 0.394 0.5 -> 0.628 Inexact Rounded +pwsx3710 power 0.0394 0.5 -> 0.198 Inexact Rounded +pwsx3711 power 0.395 0.5 -> 0.628 Inexact Rounded +pwsx3712 power 0.0395 0.5 -> 0.199 Inexact Rounded +pwsx3713 power 0.396 0.5 -> 0.629 Inexact Rounded +pwsx3714 power 0.0396 0.5 -> 0.199 Inexact Rounded +pwsx3715 power 0.397 0.5 -> 0.630 Inexact Rounded +pwsx3716 power 0.0397 0.5 -> 0.199 Inexact Rounded +pwsx3717 power 0.398 0.5 -> 0.631 Inexact Rounded +pwsx3718 power 0.0398 0.5 -> 0.199 Inexact Rounded +pwsx3719 power 0.399 0.5 -> 0.632 Inexact Rounded +pwsx3720 power 0.0399 0.5 -> 0.200 Inexact Rounded +pwsx3721 power 0.401 0.5 -> 0.633 Inexact Rounded +pwsx3722 power 0.0401 0.5 -> 0.200 Inexact Rounded +pwsx3723 power 0.402 0.5 -> 0.634 Inexact Rounded +pwsx3724 power 0.0402 0.5 -> 0.200 Inexact Rounded +pwsx3725 power 0.403 0.5 -> 0.635 Inexact Rounded +pwsx3726 power 0.0403 0.5 -> 0.201 Inexact Rounded +pwsx3727 power 0.404 0.5 -> 0.636 Inexact Rounded +pwsx3728 power 0.0404 0.5 -> 0.201 Inexact Rounded +pwsx3729 power 0.405 0.5 -> 0.636 Inexact Rounded +pwsx3730 power 0.0405 0.5 -> 0.201 Inexact Rounded +pwsx3731 power 0.406 0.5 -> 0.637 Inexact Rounded +pwsx3732 power 0.0406 0.5 -> 0.201 Inexact Rounded +pwsx3733 power 0.407 0.5 -> 0.638 Inexact Rounded +pwsx3734 power 0.0407 0.5 -> 0.202 Inexact Rounded +pwsx3735 power 0.408 0.5 -> 0.639 Inexact Rounded +pwsx3736 power 0.0408 0.5 -> 0.202 Inexact Rounded +pwsx3737 power 0.409 0.5 -> 0.640 Inexact Rounded +pwsx3738 power 0.0409 0.5 -> 0.202 Inexact Rounded +pwsx3739 power 0.411 0.5 -> 0.641 Inexact Rounded +pwsx3740 power 0.0411 0.5 -> 0.203 Inexact Rounded +pwsx3741 power 0.412 0.5 -> 0.642 Inexact Rounded +pwsx3742 power 0.0412 0.5 -> 0.203 Inexact Rounded +pwsx3743 power 0.413 0.5 -> 0.643 Inexact Rounded +pwsx3744 power 0.0413 0.5 -> 0.203 Inexact Rounded +pwsx3745 power 0.414 0.5 -> 0.643 Inexact Rounded +pwsx3746 power 0.0414 0.5 -> 0.203 Inexact Rounded +pwsx3747 power 0.415 0.5 -> 0.644 Inexact Rounded +pwsx3748 power 0.0415 0.5 -> 0.204 Inexact Rounded +pwsx3749 power 0.416 0.5 -> 0.645 Inexact Rounded +pwsx3750 power 0.0416 0.5 -> 0.204 Inexact Rounded +pwsx3751 power 0.417 0.5 -> 0.646 Inexact Rounded +pwsx3752 power 0.0417 0.5 -> 0.204 Inexact Rounded +pwsx3753 power 0.418 0.5 -> 0.647 Inexact Rounded +pwsx3754 power 0.0418 0.5 -> 0.204 Inexact Rounded +pwsx3755 power 0.419 0.5 -> 0.647 Inexact Rounded +pwsx3756 power 0.0419 0.5 -> 0.205 Inexact Rounded +pwsx3757 power 0.421 0.5 -> 0.649 Inexact Rounded +pwsx3758 power 0.0421 0.5 -> 0.205 Inexact Rounded +pwsx3759 power 0.422 0.5 -> 0.650 Inexact Rounded +pwsx3760 power 0.0422 0.5 -> 0.205 Inexact Rounded +pwsx3761 power 0.423 0.5 -> 0.650 Inexact Rounded +pwsx3762 power 0.0423 0.5 -> 0.206 Inexact Rounded +pwsx3763 power 0.424 0.5 -> 0.651 Inexact Rounded +pwsx3764 power 0.0424 0.5 -> 0.206 Inexact Rounded +pwsx3765 power 0.425 0.5 -> 0.652 Inexact Rounded +pwsx3766 power 0.0425 0.5 -> 0.206 Inexact Rounded +pwsx3767 power 0.426 0.5 -> 0.653 Inexact Rounded +pwsx3768 power 0.0426 0.5 -> 0.206 Inexact Rounded +pwsx3769 power 0.427 0.5 -> 0.653 Inexact Rounded +pwsx3770 power 0.0427 0.5 -> 0.207 Inexact Rounded +pwsx3771 power 0.428 0.5 -> 0.654 Inexact Rounded +pwsx3772 power 0.0428 0.5 -> 0.207 Inexact Rounded +pwsx3773 power 0.429 0.5 -> 0.655 Inexact Rounded +pwsx3774 power 0.0429 0.5 -> 0.207 Inexact Rounded +pwsx3775 power 0.431 0.5 -> 0.657 Inexact Rounded +pwsx3776 power 0.0431 0.5 -> 0.208 Inexact Rounded +pwsx3777 power 0.432 0.5 -> 0.657 Inexact Rounded +pwsx3778 power 0.0432 0.5 -> 0.208 Inexact Rounded +pwsx3779 power 0.433 0.5 -> 0.658 Inexact Rounded +pwsx3780 power 0.0433 0.5 -> 0.208 Inexact Rounded +pwsx3781 power 0.434 0.5 -> 0.659 Inexact Rounded +pwsx3782 power 0.0434 0.5 -> 0.208 Inexact Rounded +pwsx3783 power 0.435 0.5 -> 0.660 Inexact Rounded +pwsx3784 power 0.0435 0.5 -> 0.209 Inexact Rounded +pwsx3785 power 0.436 0.5 -> 0.660 Inexact Rounded +pwsx3786 power 0.0436 0.5 -> 0.209 Inexact Rounded +pwsx3787 power 0.437 0.5 -> 0.661 Inexact Rounded +pwsx3788 power 0.0437 0.5 -> 0.209 Inexact Rounded +pwsx3789 power 0.438 0.5 -> 0.662 Inexact Rounded +pwsx3790 power 0.0438 0.5 -> 0.209 Inexact Rounded +pwsx3791 power 0.439 0.5 -> 0.663 Inexact Rounded +pwsx3792 power 0.0439 0.5 -> 0.210 Inexact Rounded +pwsx3793 power 0.441 0.5 -> 0.664 Inexact Rounded +pwsx3794 power 0.0441 0.5 -> 0.210 Inexact Rounded +pwsx3795 power 0.442 0.5 -> 0.665 Inexact Rounded +pwsx3796 power 0.0442 0.5 -> 0.210 Inexact Rounded +pwsx3797 power 0.443 0.5 -> 0.666 Inexact Rounded +pwsx3798 power 0.0443 0.5 -> 0.210 Inexact Rounded +pwsx3799 power 0.444 0.5 -> 0.666 Inexact Rounded +pwsx3800 power 0.0444 0.5 -> 0.211 Inexact Rounded +pwsx3801 power 0.445 0.5 -> 0.667 Inexact Rounded +pwsx3802 power 0.0445 0.5 -> 0.211 Inexact Rounded +pwsx3803 power 0.446 0.5 -> 0.668 Inexact Rounded +pwsx3804 power 0.0446 0.5 -> 0.211 Inexact Rounded +pwsx3805 power 0.447 0.5 -> 0.669 Inexact Rounded +pwsx3806 power 0.0447 0.5 -> 0.211 Inexact Rounded +pwsx3807 power 0.448 0.5 -> 0.669 Inexact Rounded +pwsx3808 power 0.0448 0.5 -> 0.212 Inexact Rounded +pwsx3809 power 0.449 0.5 -> 0.670 Inexact Rounded +pwsx3810 power 0.0449 0.5 -> 0.212 Inexact Rounded +pwsx3811 power 0.451 0.5 -> 0.672 Inexact Rounded +pwsx3812 power 0.0451 0.5 -> 0.212 Inexact Rounded +pwsx3813 power 0.452 0.5 -> 0.672 Inexact Rounded +pwsx3814 power 0.0452 0.5 -> 0.213 Inexact Rounded +pwsx3815 power 0.453 0.5 -> 0.673 Inexact Rounded +pwsx3816 power 0.0453 0.5 -> 0.213 Inexact Rounded +pwsx3817 power 0.454 0.5 -> 0.674 Inexact Rounded +pwsx3818 power 0.0454 0.5 -> 0.213 Inexact Rounded +pwsx3819 power 0.455 0.5 -> 0.675 Inexact Rounded +pwsx3820 power 0.0455 0.5 -> 0.213 Inexact Rounded +pwsx3821 power 0.456 0.5 -> 0.675 Inexact Rounded +pwsx3822 power 0.0456 0.5 -> 0.214 Inexact Rounded +pwsx3823 power 0.457 0.5 -> 0.676 Inexact Rounded +pwsx3824 power 0.0457 0.5 -> 0.214 Inexact Rounded +pwsx3825 power 0.458 0.5 -> 0.677 Inexact Rounded +pwsx3826 power 0.0458 0.5 -> 0.214 Inexact Rounded +pwsx3827 power 0.459 0.5 -> 0.677 Inexact Rounded +pwsx3828 power 0.0459 0.5 -> 0.214 Inexact Rounded +pwsx3829 power 0.461 0.5 -> 0.679 Inexact Rounded +pwsx3830 power 0.0461 0.5 -> 0.215 Inexact Rounded +pwsx3831 power 0.462 0.5 -> 0.680 Inexact Rounded +pwsx3832 power 0.0462 0.5 -> 0.215 Inexact Rounded +pwsx3833 power 0.463 0.5 -> 0.680 Inexact Rounded +pwsx3834 power 0.0463 0.5 -> 0.215 Inexact Rounded +pwsx3835 power 0.464 0.5 -> 0.681 Inexact Rounded +pwsx3836 power 0.0464 0.5 -> 0.215 Inexact Rounded +pwsx3837 power 0.465 0.5 -> 0.682 Inexact Rounded +pwsx3838 power 0.0465 0.5 -> 0.216 Inexact Rounded +pwsx3839 power 0.466 0.5 -> 0.683 Inexact Rounded +pwsx3840 power 0.0466 0.5 -> 0.216 Inexact Rounded +pwsx3841 power 0.467 0.5 -> 0.683 Inexact Rounded +pwsx3842 power 0.0467 0.5 -> 0.216 Inexact Rounded +pwsx3843 power 0.468 0.5 -> 0.684 Inexact Rounded +pwsx3844 power 0.0468 0.5 -> 0.216 Inexact Rounded +pwsx3845 power 0.469 0.5 -> 0.685 Inexact Rounded +pwsx3846 power 0.0469 0.5 -> 0.217 Inexact Rounded +pwsx3847 power 0.471 0.5 -> 0.686 Inexact Rounded +pwsx3848 power 0.0471 0.5 -> 0.217 Inexact Rounded +pwsx3849 power 0.472 0.5 -> 0.687 Inexact Rounded +pwsx3850 power 0.0472 0.5 -> 0.217 Inexact Rounded +pwsx3851 power 0.473 0.5 -> 0.688 Inexact Rounded +pwsx3852 power 0.0473 0.5 -> 0.217 Inexact Rounded +pwsx3853 power 0.474 0.5 -> 0.688 Inexact Rounded +pwsx3854 power 0.0474 0.5 -> 0.218 Inexact Rounded +pwsx3855 power 0.475 0.5 -> 0.689 Inexact Rounded +pwsx3856 power 0.0475 0.5 -> 0.218 Inexact Rounded +pwsx3857 power 0.476 0.5 -> 0.690 Inexact Rounded +pwsx3858 power 0.0476 0.5 -> 0.218 Inexact Rounded +pwsx3859 power 0.477 0.5 -> 0.691 Inexact Rounded +pwsx3860 power 0.0477 0.5 -> 0.218 Inexact Rounded +pwsx3861 power 0.478 0.5 -> 0.691 Inexact Rounded +pwsx3862 power 0.0478 0.5 -> 0.219 Inexact Rounded +pwsx3863 power 0.479 0.5 -> 0.692 Inexact Rounded +pwsx3864 power 0.0479 0.5 -> 0.219 Inexact Rounded +pwsx3865 power 0.481 0.5 -> 0.694 Inexact Rounded +pwsx3866 power 0.0481 0.5 -> 0.219 Inexact Rounded +pwsx3867 power 0.482 0.5 -> 0.694 Inexact Rounded +pwsx3868 power 0.0482 0.5 -> 0.220 Inexact Rounded +pwsx3869 power 0.483 0.5 -> 0.695 Inexact Rounded +pwsx3870 power 0.0483 0.5 -> 0.220 Inexact Rounded +pwsx3871 power 0.484 0.5 -> 0.696 Inexact Rounded +pwsx3872 power 0.0484 0.5 -> 0.220 Inexact Rounded +pwsx3873 power 0.485 0.5 -> 0.696 Inexact Rounded +pwsx3874 power 0.0485 0.5 -> 0.220 Inexact Rounded +pwsx3875 power 0.486 0.5 -> 0.697 Inexact Rounded +pwsx3876 power 0.0486 0.5 -> 0.220 Inexact Rounded +pwsx3877 power 0.487 0.5 -> 0.698 Inexact Rounded +pwsx3878 power 0.0487 0.5 -> 0.221 Inexact Rounded +pwsx3879 power 0.488 0.5 -> 0.699 Inexact Rounded +pwsx3880 power 0.0488 0.5 -> 0.221 Inexact Rounded +pwsx3881 power 0.489 0.5 -> 0.699 Inexact Rounded +pwsx3882 power 0.0489 0.5 -> 0.221 Inexact Rounded +pwsx3883 power 0.491 0.5 -> 0.701 Inexact Rounded +pwsx3884 power 0.0491 0.5 -> 0.222 Inexact Rounded +pwsx3885 power 0.492 0.5 -> 0.701 Inexact Rounded +pwsx3886 power 0.0492 0.5 -> 0.222 Inexact Rounded +pwsx3887 power 0.493 0.5 -> 0.702 Inexact Rounded +pwsx3888 power 0.0493 0.5 -> 0.222 Inexact Rounded +pwsx3889 power 0.494 0.5 -> 0.703 Inexact Rounded +pwsx3890 power 0.0494 0.5 -> 0.222 Inexact Rounded +pwsx3891 power 0.495 0.5 -> 0.704 Inexact Rounded +pwsx3892 power 0.0495 0.5 -> 0.222 Inexact Rounded +pwsx3893 power 0.496 0.5 -> 0.704 Inexact Rounded +pwsx3894 power 0.0496 0.5 -> 0.223 Inexact Rounded +pwsx3895 power 0.497 0.5 -> 0.705 Inexact Rounded +pwsx3896 power 0.0497 0.5 -> 0.223 Inexact Rounded +pwsx3897 power 0.498 0.5 -> 0.706 Inexact Rounded +pwsx3898 power 0.0498 0.5 -> 0.223 Inexact Rounded +pwsx3899 power 0.499 0.5 -> 0.706 Inexact Rounded +pwsx3900 power 0.0499 0.5 -> 0.223 Inexact Rounded +pwsx3901 power 0.501 0.5 -> 0.708 Inexact Rounded +pwsx3902 power 0.0501 0.5 -> 0.224 Inexact Rounded +pwsx3903 power 0.502 0.5 -> 0.709 Inexact Rounded +pwsx3904 power 0.0502 0.5 -> 0.224 Inexact Rounded +pwsx3905 power 0.503 0.5 -> 0.709 Inexact Rounded +pwsx3906 power 0.0503 0.5 -> 0.224 Inexact Rounded +pwsx3907 power 0.504 0.5 -> 0.710 Inexact Rounded +pwsx3908 power 0.0504 0.5 -> 0.224 Inexact Rounded +pwsx3909 power 0.505 0.5 -> 0.711 Inexact Rounded +pwsx3910 power 0.0505 0.5 -> 0.225 Inexact Rounded +pwsx3911 power 0.506 0.5 -> 0.711 Inexact Rounded +pwsx3912 power 0.0506 0.5 -> 0.225 Inexact Rounded +pwsx3913 power 0.507 0.5 -> 0.712 Inexact Rounded +pwsx3914 power 0.0507 0.5 -> 0.225 Inexact Rounded +pwsx3915 power 0.508 0.5 -> 0.713 Inexact Rounded +pwsx3916 power 0.0508 0.5 -> 0.225 Inexact Rounded +pwsx3917 power 0.509 0.5 -> 0.713 Inexact Rounded +pwsx3918 power 0.0509 0.5 -> 0.226 Inexact Rounded +pwsx3919 power 0.511 0.5 -> 0.715 Inexact Rounded +pwsx3920 power 0.0511 0.5 -> 0.226 Inexact Rounded +pwsx3921 power 0.512 0.5 -> 0.716 Inexact Rounded +pwsx3922 power 0.0512 0.5 -> 0.226 Inexact Rounded +pwsx3923 power 0.513 0.5 -> 0.716 Inexact Rounded +pwsx3924 power 0.0513 0.5 -> 0.226 Inexact Rounded +pwsx3925 power 0.514 0.5 -> 0.717 Inexact Rounded +pwsx3926 power 0.0514 0.5 -> 0.227 Inexact Rounded +pwsx3927 power 0.515 0.5 -> 0.718 Inexact Rounded +pwsx3928 power 0.0515 0.5 -> 0.227 Inexact Rounded +pwsx3929 power 0.516 0.5 -> 0.718 Inexact Rounded +pwsx3930 power 0.0516 0.5 -> 0.227 Inexact Rounded +pwsx3931 power 0.517 0.5 -> 0.719 Inexact Rounded +pwsx3932 power 0.0517 0.5 -> 0.227 Inexact Rounded +pwsx3933 power 0.518 0.5 -> 0.720 Inexact Rounded +pwsx3934 power 0.0518 0.5 -> 0.228 Inexact Rounded +pwsx3935 power 0.519 0.5 -> 0.720 Inexact Rounded +pwsx3936 power 0.0519 0.5 -> 0.228 Inexact Rounded +pwsx3937 power 0.521 0.5 -> 0.722 Inexact Rounded +pwsx3938 power 0.0521 0.5 -> 0.228 Inexact Rounded +pwsx3939 power 0.522 0.5 -> 0.722 Inexact Rounded +pwsx3940 power 0.0522 0.5 -> 0.228 Inexact Rounded +pwsx3941 power 0.523 0.5 -> 0.723 Inexact Rounded +pwsx3942 power 0.0523 0.5 -> 0.229 Inexact Rounded +pwsx3943 power 0.524 0.5 -> 0.724 Inexact Rounded +pwsx3944 power 0.0524 0.5 -> 0.229 Inexact Rounded +pwsx3945 power 0.525 0.5 -> 0.725 Inexact Rounded +pwsx3946 power 0.0525 0.5 -> 0.229 Inexact Rounded +pwsx3947 power 0.526 0.5 -> 0.725 Inexact Rounded +pwsx3948 power 0.0526 0.5 -> 0.229 Inexact Rounded +pwsx3949 power 0.527 0.5 -> 0.726 Inexact Rounded +pwsx3950 power 0.0527 0.5 -> 0.230 Inexact Rounded +pwsx3951 power 0.528 0.5 -> 0.727 Inexact Rounded +pwsx3952 power 0.0528 0.5 -> 0.230 Inexact Rounded +pwsx3953 power 0.529 0.5 -> 0.727 Inexact Rounded +pwsx3954 power 0.0529 0.5 -> 0.230 Inexact Rounded +pwsx3955 power 0.531 0.5 -> 0.729 Inexact Rounded +pwsx3956 power 0.0531 0.5 -> 0.230 Inexact Rounded +pwsx3957 power 0.532 0.5 -> 0.729 Inexact Rounded +pwsx3958 power 0.0532 0.5 -> 0.231 Inexact Rounded +pwsx3959 power 0.533 0.5 -> 0.730 Inexact Rounded +pwsx3960 power 0.0533 0.5 -> 0.231 Inexact Rounded +pwsx3961 power 0.534 0.5 -> 0.731 Inexact Rounded +pwsx3962 power 0.0534 0.5 -> 0.231 Inexact Rounded +pwsx3963 power 0.535 0.5 -> 0.731 Inexact Rounded +pwsx3964 power 0.0535 0.5 -> 0.231 Inexact Rounded +pwsx3965 power 0.536 0.5 -> 0.732 Inexact Rounded +pwsx3966 power 0.0536 0.5 -> 0.232 Inexact Rounded +pwsx3967 power 0.537 0.5 -> 0.733 Inexact Rounded +pwsx3968 power 0.0537 0.5 -> 0.232 Inexact Rounded +pwsx3969 power 0.538 0.5 -> 0.733 Inexact Rounded +pwsx3970 power 0.0538 0.5 -> 0.232 Inexact Rounded +pwsx3971 power 0.539 0.5 -> 0.734 Inexact Rounded +pwsx3972 power 0.0539 0.5 -> 0.232 Inexact Rounded +pwsx3973 power 0.541 0.5 -> 0.736 Inexact Rounded +pwsx3974 power 0.0541 0.5 -> 0.233 Inexact Rounded +pwsx3975 power 0.542 0.5 -> 0.736 Inexact Rounded +pwsx3976 power 0.0542 0.5 -> 0.233 Inexact Rounded +pwsx3977 power 0.543 0.5 -> 0.737 Inexact Rounded +pwsx3978 power 0.0543 0.5 -> 0.233 Inexact Rounded +pwsx3979 power 0.544 0.5 -> 0.738 Inexact Rounded +pwsx3980 power 0.0544 0.5 -> 0.233 Inexact Rounded +pwsx3981 power 0.545 0.5 -> 0.738 Inexact Rounded +pwsx3982 power 0.0545 0.5 -> 0.233 Inexact Rounded +pwsx3983 power 0.546 0.5 -> 0.739 Inexact Rounded +pwsx3984 power 0.0546 0.5 -> 0.234 Inexact Rounded +pwsx3985 power 0.547 0.5 -> 0.740 Inexact Rounded +pwsx3986 power 0.0547 0.5 -> 0.234 Inexact Rounded +pwsx3987 power 0.548 0.5 -> 0.740 Inexact Rounded +pwsx3988 power 0.0548 0.5 -> 0.234 Inexact Rounded +pwsx3989 power 0.549 0.5 -> 0.741 Inexact Rounded +pwsx3990 power 0.0549 0.5 -> 0.234 Inexact Rounded +pwsx3991 power 0.551 0.5 -> 0.742 Inexact Rounded +pwsx3992 power 0.0551 0.5 -> 0.235 Inexact Rounded +pwsx3993 power 0.552 0.5 -> 0.743 Inexact Rounded +pwsx3994 power 0.0552 0.5 -> 0.235 Inexact Rounded +pwsx3995 power 0.553 0.5 -> 0.744 Inexact Rounded +pwsx3996 power 0.0553 0.5 -> 0.235 Inexact Rounded +pwsx3997 power 0.554 0.5 -> 0.744 Inexact Rounded +pwsx3998 power 0.0554 0.5 -> 0.235 Inexact Rounded +pwsx3999 power 0.555 0.5 -> 0.745 Inexact Rounded +pwsx4000 power 0.0555 0.5 -> 0.236 Inexact Rounded +pwsx4001 power 0.556 0.5 -> 0.746 Inexact Rounded +pwsx4002 power 0.0556 0.5 -> 0.236 Inexact Rounded +pwsx4003 power 0.557 0.5 -> 0.746 Inexact Rounded +pwsx4004 power 0.0557 0.5 -> 0.236 Inexact Rounded +pwsx4005 power 0.558 0.5 -> 0.747 Inexact Rounded +pwsx4006 power 0.0558 0.5 -> 0.236 Inexact Rounded +pwsx4007 power 0.559 0.5 -> 0.748 Inexact Rounded +pwsx4008 power 0.0559 0.5 -> 0.236 Inexact Rounded +pwsx4009 power 0.561 0.5 -> 0.749 Inexact Rounded +pwsx4010 power 0.0561 0.5 -> 0.237 Inexact Rounded +pwsx4011 power 0.562 0.5 -> 0.750 Inexact Rounded +pwsx4012 power 0.0562 0.5 -> 0.237 Inexact Rounded +pwsx4013 power 0.563 0.5 -> 0.750 Inexact Rounded +pwsx4014 power 0.0563 0.5 -> 0.237 Inexact Rounded +pwsx4015 power 0.564 0.5 -> 0.751 Inexact Rounded +pwsx4016 power 0.0564 0.5 -> 0.237 Inexact Rounded +pwsx4017 power 0.565 0.5 -> 0.752 Inexact Rounded +pwsx4018 power 0.0565 0.5 -> 0.238 Inexact Rounded +pwsx4019 power 0.566 0.5 -> 0.752 Inexact Rounded +pwsx4020 power 0.0566 0.5 -> 0.238 Inexact Rounded +pwsx4021 power 0.567 0.5 -> 0.753 Inexact Rounded +pwsx4022 power 0.0567 0.5 -> 0.238 Inexact Rounded +pwsx4023 power 0.568 0.5 -> 0.754 Inexact Rounded +pwsx4024 power 0.0568 0.5 -> 0.238 Inexact Rounded +pwsx4025 power 0.569 0.5 -> 0.754 Inexact Rounded +pwsx4026 power 0.0569 0.5 -> 0.239 Inexact Rounded +pwsx4027 power 0.571 0.5 -> 0.756 Inexact Rounded +pwsx4028 power 0.0571 0.5 -> 0.239 Inexact Rounded +pwsx4029 power 0.572 0.5 -> 0.756 Inexact Rounded +pwsx4030 power 0.0572 0.5 -> 0.239 Inexact Rounded +pwsx4031 power 0.573 0.5 -> 0.757 Inexact Rounded +pwsx4032 power 0.0573 0.5 -> 0.239 Inexact Rounded +pwsx4033 power 0.574 0.5 -> 0.758 Inexact Rounded +pwsx4034 power 0.0574 0.5 -> 0.240 Inexact Rounded +pwsx4035 power 0.575 0.5 -> 0.758 Inexact Rounded +pwsx4036 power 0.0575 0.5 -> 0.240 Inexact Rounded +pwsx4037 power 0.576 0.5 -> 0.759 Inexact Rounded +pwsx4038 power 0.0576 0.5 -> 0.240 Inexact Rounded +pwsx4039 power 0.577 0.5 -> 0.760 Inexact Rounded +pwsx4040 power 0.0577 0.5 -> 0.240 Inexact Rounded +pwsx4041 power 0.578 0.5 -> 0.760 Inexact Rounded +pwsx4042 power 0.0578 0.5 -> 0.240 Inexact Rounded +pwsx4043 power 0.579 0.5 -> 0.761 Inexact Rounded +pwsx4044 power 0.0579 0.5 -> 0.241 Inexact Rounded +pwsx4045 power 0.581 0.5 -> 0.762 Inexact Rounded +pwsx4046 power 0.0581 0.5 -> 0.241 Inexact Rounded +pwsx4047 power 0.582 0.5 -> 0.763 Inexact Rounded +pwsx4048 power 0.0582 0.5 -> 0.241 Inexact Rounded +pwsx4049 power 0.583 0.5 -> 0.764 Inexact Rounded +pwsx4050 power 0.0583 0.5 -> 0.241 Inexact Rounded +pwsx4051 power 0.584 0.5 -> 0.764 Inexact Rounded +pwsx4052 power 0.0584 0.5 -> 0.242 Inexact Rounded +pwsx4053 power 0.585 0.5 -> 0.765 Inexact Rounded +pwsx4054 power 0.0585 0.5 -> 0.242 Inexact Rounded +pwsx4055 power 0.586 0.5 -> 0.766 Inexact Rounded +pwsx4056 power 0.0586 0.5 -> 0.242 Inexact Rounded +pwsx4057 power 0.587 0.5 -> 0.766 Inexact Rounded +pwsx4058 power 0.0587 0.5 -> 0.242 Inexact Rounded +pwsx4059 power 0.588 0.5 -> 0.767 Inexact Rounded +pwsx4060 power 0.0588 0.5 -> 0.242 Inexact Rounded +pwsx4061 power 0.589 0.5 -> 0.767 Inexact Rounded +pwsx4062 power 0.0589 0.5 -> 0.243 Inexact Rounded +pwsx4063 power 0.591 0.5 -> 0.769 Inexact Rounded +pwsx4064 power 0.0591 0.5 -> 0.243 Inexact Rounded +pwsx4065 power 0.592 0.5 -> 0.769 Inexact Rounded +pwsx4066 power 0.0592 0.5 -> 0.243 Inexact Rounded +pwsx4067 power 0.593 0.5 -> 0.770 Inexact Rounded +pwsx4068 power 0.0593 0.5 -> 0.244 Inexact Rounded +pwsx4069 power 0.594 0.5 -> 0.771 Inexact Rounded +pwsx4070 power 0.0594 0.5 -> 0.244 Inexact Rounded +pwsx4071 power 0.595 0.5 -> 0.771 Inexact Rounded +pwsx4072 power 0.0595 0.5 -> 0.244 Inexact Rounded +pwsx4073 power 0.596 0.5 -> 0.772 Inexact Rounded +pwsx4074 power 0.0596 0.5 -> 0.244 Inexact Rounded +pwsx4075 power 0.597 0.5 -> 0.773 Inexact Rounded +pwsx4076 power 0.0597 0.5 -> 0.244 Inexact Rounded +pwsx4077 power 0.598 0.5 -> 0.773 Inexact Rounded +pwsx4078 power 0.0598 0.5 -> 0.245 Inexact Rounded +pwsx4079 power 0.599 0.5 -> 0.774 Inexact Rounded +pwsx4080 power 0.0599 0.5 -> 0.245 Inexact Rounded +pwsx4081 power 0.601 0.5 -> 0.775 Inexact Rounded +pwsx4082 power 0.0601 0.5 -> 0.245 Inexact Rounded +pwsx4083 power 0.602 0.5 -> 0.776 Inexact Rounded +pwsx4084 power 0.0602 0.5 -> 0.245 Inexact Rounded +pwsx4085 power 0.603 0.5 -> 0.777 Inexact Rounded +pwsx4086 power 0.0603 0.5 -> 0.246 Inexact Rounded +pwsx4087 power 0.604 0.5 -> 0.777 Inexact Rounded +pwsx4088 power 0.0604 0.5 -> 0.246 Inexact Rounded +pwsx4089 power 0.605 0.5 -> 0.778 Inexact Rounded +pwsx4090 power 0.0605 0.5 -> 0.246 Inexact Rounded +pwsx4091 power 0.606 0.5 -> 0.778 Inexact Rounded +pwsx4092 power 0.0606 0.5 -> 0.246 Inexact Rounded +pwsx4093 power 0.607 0.5 -> 0.779 Inexact Rounded +pwsx4094 power 0.0607 0.5 -> 0.246 Inexact Rounded +pwsx4095 power 0.608 0.5 -> 0.780 Inexact Rounded +pwsx4096 power 0.0608 0.5 -> 0.247 Inexact Rounded +pwsx4097 power 0.609 0.5 -> 0.780 Inexact Rounded +pwsx4098 power 0.0609 0.5 -> 0.247 Inexact Rounded +pwsx4099 power 0.611 0.5 -> 0.782 Inexact Rounded +pwsx4100 power 0.0611 0.5 -> 0.247 Inexact Rounded +pwsx4101 power 0.612 0.5 -> 0.782 Inexact Rounded +pwsx4102 power 0.0612 0.5 -> 0.247 Inexact Rounded +pwsx4103 power 0.613 0.5 -> 0.783 Inexact Rounded +pwsx4104 power 0.0613 0.5 -> 0.248 Inexact Rounded +pwsx4105 power 0.614 0.5 -> 0.784 Inexact Rounded +pwsx4106 power 0.0614 0.5 -> 0.248 Inexact Rounded +pwsx4107 power 0.615 0.5 -> 0.784 Inexact Rounded +pwsx4108 power 0.0615 0.5 -> 0.248 Inexact Rounded +pwsx4109 power 0.616 0.5 -> 0.785 Inexact Rounded +pwsx4110 power 0.0616 0.5 -> 0.248 Inexact Rounded +pwsx4111 power 0.617 0.5 -> 0.785 Inexact Rounded +pwsx4112 power 0.0617 0.5 -> 0.248 Inexact Rounded +pwsx4113 power 0.618 0.5 -> 0.786 Inexact Rounded +pwsx4114 power 0.0618 0.5 -> 0.249 Inexact Rounded +pwsx4115 power 0.619 0.5 -> 0.787 Inexact Rounded +pwsx4116 power 0.0619 0.5 -> 0.249 Inexact Rounded +pwsx4117 power 0.621 0.5 -> 0.788 Inexact Rounded +pwsx4118 power 0.0621 0.5 -> 0.249 Inexact Rounded +pwsx4119 power 0.622 0.5 -> 0.789 Inexact Rounded +pwsx4120 power 0.0622 0.5 -> 0.249 Inexact Rounded +pwsx4121 power 0.623 0.5 -> 0.789 Inexact Rounded +pwsx4122 power 0.0623 0.5 -> 0.250 Inexact Rounded +pwsx4123 power 0.624 0.5 -> 0.790 Inexact Rounded +pwsx4124 power 0.0624 0.5 -> 0.250 Inexact Rounded +pwsx4125 power 0.625 0.5 -> 0.791 Inexact Rounded +pwsx4126 power 0.0625 0.5 -> 0.250 Inexact Rounded +pwsx4127 power 0.626 0.5 -> 0.791 Inexact Rounded +pwsx4128 power 0.0626 0.5 -> 0.250 Inexact Rounded +pwsx4129 power 0.627 0.5 -> 0.792 Inexact Rounded +pwsx4130 power 0.0627 0.5 -> 0.250 Inexact Rounded +pwsx4131 power 0.628 0.5 -> 0.792 Inexact Rounded +pwsx4132 power 0.0628 0.5 -> 0.251 Inexact Rounded +pwsx4133 power 0.629 0.5 -> 0.793 Inexact Rounded +pwsx4134 power 0.0629 0.5 -> 0.251 Inexact Rounded +pwsx4135 power 0.631 0.5 -> 0.794 Inexact Rounded +pwsx4136 power 0.0631 0.5 -> 0.251 Inexact Rounded +pwsx4137 power 0.632 0.5 -> 0.795 Inexact Rounded +pwsx4138 power 0.0632 0.5 -> 0.251 Inexact Rounded +pwsx4139 power 0.633 0.5 -> 0.796 Inexact Rounded +pwsx4140 power 0.0633 0.5 -> 0.252 Inexact Rounded +pwsx4141 power 0.634 0.5 -> 0.796 Inexact Rounded +pwsx4142 power 0.0634 0.5 -> 0.252 Inexact Rounded +pwsx4143 power 0.635 0.5 -> 0.797 Inexact Rounded +pwsx4144 power 0.0635 0.5 -> 0.252 Inexact Rounded +pwsx4145 power 0.636 0.5 -> 0.797 Inexact Rounded +pwsx4146 power 0.0636 0.5 -> 0.252 Inexact Rounded +pwsx4147 power 0.637 0.5 -> 0.798 Inexact Rounded +pwsx4148 power 0.0637 0.5 -> 0.252 Inexact Rounded +pwsx4149 power 0.638 0.5 -> 0.799 Inexact Rounded +pwsx4150 power 0.0638 0.5 -> 0.253 Inexact Rounded +pwsx4151 power 0.639 0.5 -> 0.799 Inexact Rounded +pwsx4152 power 0.0639 0.5 -> 0.253 Inexact Rounded +pwsx4153 power 0.641 0.5 -> 0.801 Inexact Rounded +pwsx4154 power 0.0641 0.5 -> 0.253 Inexact Rounded +pwsx4155 power 0.642 0.5 -> 0.801 Inexact Rounded +pwsx4156 power 0.0642 0.5 -> 0.253 Inexact Rounded +pwsx4157 power 0.643 0.5 -> 0.802 Inexact Rounded +pwsx4158 power 0.0643 0.5 -> 0.254 Inexact Rounded +pwsx4159 power 0.644 0.5 -> 0.802 Inexact Rounded +pwsx4160 power 0.0644 0.5 -> 0.254 Inexact Rounded +pwsx4161 power 0.645 0.5 -> 0.803 Inexact Rounded +pwsx4162 power 0.0645 0.5 -> 0.254 Inexact Rounded +pwsx4163 power 0.646 0.5 -> 0.804 Inexact Rounded +pwsx4164 power 0.0646 0.5 -> 0.254 Inexact Rounded +pwsx4165 power 0.647 0.5 -> 0.804 Inexact Rounded +pwsx4166 power 0.0647 0.5 -> 0.254 Inexact Rounded +pwsx4167 power 0.648 0.5 -> 0.805 Inexact Rounded +pwsx4168 power 0.0648 0.5 -> 0.255 Inexact Rounded +pwsx4169 power 0.649 0.5 -> 0.806 Inexact Rounded +pwsx4170 power 0.0649 0.5 -> 0.255 Inexact Rounded +pwsx4171 power 0.651 0.5 -> 0.807 Inexact Rounded +pwsx4172 power 0.0651 0.5 -> 0.255 Inexact Rounded +pwsx4173 power 0.652 0.5 -> 0.807 Inexact Rounded +pwsx4174 power 0.0652 0.5 -> 0.255 Inexact Rounded +pwsx4175 power 0.653 0.5 -> 0.808 Inexact Rounded +pwsx4176 power 0.0653 0.5 -> 0.256 Inexact Rounded +pwsx4177 power 0.654 0.5 -> 0.809 Inexact Rounded +pwsx4178 power 0.0654 0.5 -> 0.256 Inexact Rounded +pwsx4179 power 0.655 0.5 -> 0.809 Inexact Rounded +pwsx4180 power 0.0655 0.5 -> 0.256 Inexact Rounded +pwsx4181 power 0.656 0.5 -> 0.810 Inexact Rounded +pwsx4182 power 0.0656 0.5 -> 0.256 Inexact Rounded +pwsx4183 power 0.657 0.5 -> 0.811 Inexact Rounded +pwsx4184 power 0.0657 0.5 -> 0.256 Inexact Rounded +pwsx4185 power 0.658 0.5 -> 0.811 Inexact Rounded +pwsx4186 power 0.0658 0.5 -> 0.257 Inexact Rounded +pwsx4187 power 0.659 0.5 -> 0.812 Inexact Rounded +pwsx4188 power 0.0659 0.5 -> 0.257 Inexact Rounded +pwsx4189 power 0.661 0.5 -> 0.813 Inexact Rounded +pwsx4190 power 0.0661 0.5 -> 0.257 Inexact Rounded +pwsx4191 power 0.662 0.5 -> 0.814 Inexact Rounded +pwsx4192 power 0.0662 0.5 -> 0.257 Inexact Rounded +pwsx4193 power 0.663 0.5 -> 0.814 Inexact Rounded +pwsx4194 power 0.0663 0.5 -> 0.257 Inexact Rounded +pwsx4195 power 0.664 0.5 -> 0.815 Inexact Rounded +pwsx4196 power 0.0664 0.5 -> 0.258 Inexact Rounded +pwsx4197 power 0.665 0.5 -> 0.815 Inexact Rounded +pwsx4198 power 0.0665 0.5 -> 0.258 Inexact Rounded +pwsx4199 power 0.666 0.5 -> 0.816 Inexact Rounded +pwsx4200 power 0.0666 0.5 -> 0.258 Inexact Rounded +pwsx4201 power 0.667 0.5 -> 0.817 Inexact Rounded +pwsx4202 power 0.0667 0.5 -> 0.258 Inexact Rounded +pwsx4203 power 0.668 0.5 -> 0.817 Inexact Rounded +pwsx4204 power 0.0668 0.5 -> 0.258 Inexact Rounded +pwsx4205 power 0.669 0.5 -> 0.818 Inexact Rounded +pwsx4206 power 0.0669 0.5 -> 0.259 Inexact Rounded +pwsx4207 power 0.671 0.5 -> 0.819 Inexact Rounded +pwsx4208 power 0.0671 0.5 -> 0.259 Inexact Rounded +pwsx4209 power 0.672 0.5 -> 0.820 Inexact Rounded +pwsx4210 power 0.0672 0.5 -> 0.259 Inexact Rounded +pwsx4211 power 0.673 0.5 -> 0.820 Inexact Rounded +pwsx4212 power 0.0673 0.5 -> 0.259 Inexact Rounded +pwsx4213 power 0.674 0.5 -> 0.821 Inexact Rounded +pwsx4214 power 0.0674 0.5 -> 0.260 Inexact Rounded +pwsx4215 power 0.675 0.5 -> 0.822 Inexact Rounded +pwsx4216 power 0.0675 0.5 -> 0.260 Inexact Rounded +pwsx4217 power 0.676 0.5 -> 0.822 Inexact Rounded +pwsx4218 power 0.0676 0.5 -> 0.260 Inexact Rounded +pwsx4219 power 0.677 0.5 -> 0.823 Inexact Rounded +pwsx4220 power 0.0677 0.5 -> 0.260 Inexact Rounded +pwsx4221 power 0.678 0.5 -> 0.823 Inexact Rounded +pwsx4222 power 0.0678 0.5 -> 0.260 Inexact Rounded +pwsx4223 power 0.679 0.5 -> 0.824 Inexact Rounded +pwsx4224 power 0.0679 0.5 -> 0.261 Inexact Rounded +pwsx4225 power 0.681 0.5 -> 0.825 Inexact Rounded +pwsx4226 power 0.0681 0.5 -> 0.261 Inexact Rounded +pwsx4227 power 0.682 0.5 -> 0.826 Inexact Rounded +pwsx4228 power 0.0682 0.5 -> 0.261 Inexact Rounded +pwsx4229 power 0.683 0.5 -> 0.826 Inexact Rounded +pwsx4230 power 0.0683 0.5 -> 0.261 Inexact Rounded +pwsx4231 power 0.684 0.5 -> 0.827 Inexact Rounded +pwsx4232 power 0.0684 0.5 -> 0.262 Inexact Rounded +pwsx4233 power 0.685 0.5 -> 0.828 Inexact Rounded +pwsx4234 power 0.0685 0.5 -> 0.262 Inexact Rounded +pwsx4235 power 0.686 0.5 -> 0.828 Inexact Rounded +pwsx4236 power 0.0686 0.5 -> 0.262 Inexact Rounded +pwsx4237 power 0.687 0.5 -> 0.829 Inexact Rounded +pwsx4238 power 0.0687 0.5 -> 0.262 Inexact Rounded +pwsx4239 power 0.688 0.5 -> 0.829 Inexact Rounded +pwsx4240 power 0.0688 0.5 -> 0.262 Inexact Rounded +pwsx4241 power 0.689 0.5 -> 0.830 Inexact Rounded +pwsx4242 power 0.0689 0.5 -> 0.262 Inexact Rounded +pwsx4243 power 0.691 0.5 -> 0.831 Inexact Rounded +pwsx4244 power 0.0691 0.5 -> 0.263 Inexact Rounded +pwsx4245 power 0.692 0.5 -> 0.832 Inexact Rounded +pwsx4246 power 0.0692 0.5 -> 0.263 Inexact Rounded +pwsx4247 power 0.693 0.5 -> 0.832 Inexact Rounded +pwsx4248 power 0.0693 0.5 -> 0.263 Inexact Rounded +pwsx4249 power 0.694 0.5 -> 0.833 Inexact Rounded +pwsx4250 power 0.0694 0.5 -> 0.263 Inexact Rounded +pwsx4251 power 0.695 0.5 -> 0.834 Inexact Rounded +pwsx4252 power 0.0695 0.5 -> 0.264 Inexact Rounded +pwsx4253 power 0.696 0.5 -> 0.834 Inexact Rounded +pwsx4254 power 0.0696 0.5 -> 0.264 Inexact Rounded +pwsx4255 power 0.697 0.5 -> 0.835 Inexact Rounded +pwsx4256 power 0.0697 0.5 -> 0.264 Inexact Rounded +pwsx4257 power 0.698 0.5 -> 0.835 Inexact Rounded +pwsx4258 power 0.0698 0.5 -> 0.264 Inexact Rounded +pwsx4259 power 0.699 0.5 -> 0.836 Inexact Rounded +pwsx4260 power 0.0699 0.5 -> 0.264 Inexact Rounded +pwsx4261 power 0.701 0.5 -> 0.837 Inexact Rounded +pwsx4262 power 0.0701 0.5 -> 0.265 Inexact Rounded +pwsx4263 power 0.702 0.5 -> 0.838 Inexact Rounded +pwsx4264 power 0.0702 0.5 -> 0.265 Inexact Rounded +pwsx4265 power 0.703 0.5 -> 0.838 Inexact Rounded +pwsx4266 power 0.0703 0.5 -> 0.265 Inexact Rounded +pwsx4267 power 0.704 0.5 -> 0.839 Inexact Rounded +pwsx4268 power 0.0704 0.5 -> 0.265 Inexact Rounded +pwsx4269 power 0.705 0.5 -> 0.840 Inexact Rounded +pwsx4270 power 0.0705 0.5 -> 0.266 Inexact Rounded +pwsx4271 power 0.706 0.5 -> 0.840 Inexact Rounded +pwsx4272 power 0.0706 0.5 -> 0.266 Inexact Rounded +pwsx4273 power 0.707 0.5 -> 0.841 Inexact Rounded +pwsx4274 power 0.0707 0.5 -> 0.266 Inexact Rounded +pwsx4275 power 0.708 0.5 -> 0.841 Inexact Rounded +pwsx4276 power 0.0708 0.5 -> 0.266 Inexact Rounded +pwsx4277 power 0.709 0.5 -> 0.842 Inexact Rounded +pwsx4278 power 0.0709 0.5 -> 0.266 Inexact Rounded +pwsx4279 power 0.711 0.5 -> 0.843 Inexact Rounded +pwsx4280 power 0.0711 0.5 -> 0.267 Inexact Rounded +pwsx4281 power 0.712 0.5 -> 0.844 Inexact Rounded +pwsx4282 power 0.0712 0.5 -> 0.267 Inexact Rounded +pwsx4283 power 0.713 0.5 -> 0.844 Inexact Rounded +pwsx4284 power 0.0713 0.5 -> 0.267 Inexact Rounded +pwsx4285 power 0.714 0.5 -> 0.845 Inexact Rounded +pwsx4286 power 0.0714 0.5 -> 0.267 Inexact Rounded +pwsx4287 power 0.715 0.5 -> 0.846 Inexact Rounded +pwsx4288 power 0.0715 0.5 -> 0.267 Inexact Rounded +pwsx4289 power 0.716 0.5 -> 0.846 Inexact Rounded +pwsx4290 power 0.0716 0.5 -> 0.268 Inexact Rounded +pwsx4291 power 0.717 0.5 -> 0.847 Inexact Rounded +pwsx4292 power 0.0717 0.5 -> 0.268 Inexact Rounded +pwsx4293 power 0.718 0.5 -> 0.847 Inexact Rounded +pwsx4294 power 0.0718 0.5 -> 0.268 Inexact Rounded +pwsx4295 power 0.719 0.5 -> 0.848 Inexact Rounded +pwsx4296 power 0.0719 0.5 -> 0.268 Inexact Rounded +pwsx4297 power 0.721 0.5 -> 0.849 Inexact Rounded +pwsx4298 power 0.0721 0.5 -> 0.269 Inexact Rounded +pwsx4299 power 0.722 0.5 -> 0.850 Inexact Rounded +pwsx4300 power 0.0722 0.5 -> 0.269 Inexact Rounded +pwsx4301 power 0.723 0.5 -> 0.850 Inexact Rounded +pwsx4302 power 0.0723 0.5 -> 0.269 Inexact Rounded +pwsx4303 power 0.724 0.5 -> 0.851 Inexact Rounded +pwsx4304 power 0.0724 0.5 -> 0.269 Inexact Rounded +pwsx4305 power 0.725 0.5 -> 0.851 Inexact Rounded +pwsx4306 power 0.0725 0.5 -> 0.269 Inexact Rounded +pwsx4307 power 0.726 0.5 -> 0.852 Inexact Rounded +pwsx4308 power 0.0726 0.5 -> 0.269 Inexact Rounded +pwsx4309 power 0.727 0.5 -> 0.853 Inexact Rounded +pwsx4310 power 0.0727 0.5 -> 0.270 Inexact Rounded +pwsx4311 power 0.728 0.5 -> 0.853 Inexact Rounded +pwsx4312 power 0.0728 0.5 -> 0.270 Inexact Rounded +pwsx4313 power 0.729 0.5 -> 0.854 Inexact Rounded +pwsx4314 power 0.0729 0.5 -> 0.270 Inexact Rounded +pwsx4315 power 0.731 0.5 -> 0.855 Inexact Rounded +pwsx4316 power 0.0731 0.5 -> 0.270 Inexact Rounded +pwsx4317 power 0.732 0.5 -> 0.856 Inexact Rounded +pwsx4318 power 0.0732 0.5 -> 0.271 Inexact Rounded +pwsx4319 power 0.733 0.5 -> 0.856 Inexact Rounded +pwsx4320 power 0.0733 0.5 -> 0.271 Inexact Rounded +pwsx4321 power 0.734 0.5 -> 0.857 Inexact Rounded +pwsx4322 power 0.0734 0.5 -> 0.271 Inexact Rounded +pwsx4323 power 0.735 0.5 -> 0.857 Inexact Rounded +pwsx4324 power 0.0735 0.5 -> 0.271 Inexact Rounded +pwsx4325 power 0.736 0.5 -> 0.858 Inexact Rounded +pwsx4326 power 0.0736 0.5 -> 0.271 Inexact Rounded +pwsx4327 power 0.737 0.5 -> 0.858 Inexact Rounded +pwsx4328 power 0.0737 0.5 -> 0.271 Inexact Rounded +pwsx4329 power 0.738 0.5 -> 0.859 Inexact Rounded +pwsx4330 power 0.0738 0.5 -> 0.272 Inexact Rounded +pwsx4331 power 0.739 0.5 -> 0.860 Inexact Rounded +pwsx4332 power 0.0739 0.5 -> 0.272 Inexact Rounded +pwsx4333 power 0.741 0.5 -> 0.861 Inexact Rounded +pwsx4334 power 0.0741 0.5 -> 0.272 Inexact Rounded +pwsx4335 power 0.742 0.5 -> 0.861 Inexact Rounded +pwsx4336 power 0.0742 0.5 -> 0.272 Inexact Rounded +pwsx4337 power 0.743 0.5 -> 0.862 Inexact Rounded +pwsx4338 power 0.0743 0.5 -> 0.273 Inexact Rounded +pwsx4339 power 0.744 0.5 -> 0.863 Inexact Rounded +pwsx4340 power 0.0744 0.5 -> 0.273 Inexact Rounded +pwsx4341 power 0.745 0.5 -> 0.863 Inexact Rounded +pwsx4342 power 0.0745 0.5 -> 0.273 Inexact Rounded +pwsx4343 power 0.746 0.5 -> 0.864 Inexact Rounded +pwsx4344 power 0.0746 0.5 -> 0.273 Inexact Rounded +pwsx4345 power 0.747 0.5 -> 0.864 Inexact Rounded +pwsx4346 power 0.0747 0.5 -> 0.273 Inexact Rounded +pwsx4347 power 0.748 0.5 -> 0.865 Inexact Rounded +pwsx4348 power 0.0748 0.5 -> 0.273 Inexact Rounded +pwsx4349 power 0.749 0.5 -> 0.865 Inexact Rounded +pwsx4350 power 0.0749 0.5 -> 0.274 Inexact Rounded +pwsx4351 power 0.751 0.5 -> 0.867 Inexact Rounded +pwsx4352 power 0.0751 0.5 -> 0.274 Inexact Rounded +pwsx4353 power 0.752 0.5 -> 0.867 Inexact Rounded +pwsx4354 power 0.0752 0.5 -> 0.274 Inexact Rounded +pwsx4355 power 0.753 0.5 -> 0.868 Inexact Rounded +pwsx4356 power 0.0753 0.5 -> 0.274 Inexact Rounded +pwsx4357 power 0.754 0.5 -> 0.868 Inexact Rounded +pwsx4358 power 0.0754 0.5 -> 0.275 Inexact Rounded +pwsx4359 power 0.755 0.5 -> 0.869 Inexact Rounded +pwsx4360 power 0.0755 0.5 -> 0.275 Inexact Rounded +pwsx4361 power 0.756 0.5 -> 0.869 Inexact Rounded +pwsx4362 power 0.0756 0.5 -> 0.275 Inexact Rounded +pwsx4363 power 0.757 0.5 -> 0.870 Inexact Rounded +pwsx4364 power 0.0757 0.5 -> 0.275 Inexact Rounded +pwsx4365 power 0.758 0.5 -> 0.871 Inexact Rounded +pwsx4366 power 0.0758 0.5 -> 0.275 Inexact Rounded +pwsx4367 power 0.759 0.5 -> 0.871 Inexact Rounded +pwsx4368 power 0.0759 0.5 -> 0.275 Inexact Rounded +pwsx4369 power 0.761 0.5 -> 0.872 Inexact Rounded +pwsx4370 power 0.0761 0.5 -> 0.276 Inexact Rounded +pwsx4371 power 0.762 0.5 -> 0.873 Inexact Rounded +pwsx4372 power 0.0762 0.5 -> 0.276 Inexact Rounded +pwsx4373 power 0.763 0.5 -> 0.873 Inexact Rounded +pwsx4374 power 0.0763 0.5 -> 0.276 Inexact Rounded +pwsx4375 power 0.764 0.5 -> 0.874 Inexact Rounded +pwsx4376 power 0.0764 0.5 -> 0.276 Inexact Rounded +pwsx4377 power 0.765 0.5 -> 0.875 Inexact Rounded +pwsx4378 power 0.0765 0.5 -> 0.277 Inexact Rounded +pwsx4379 power 0.766 0.5 -> 0.875 Inexact Rounded +pwsx4380 power 0.0766 0.5 -> 0.277 Inexact Rounded +pwsx4381 power 0.767 0.5 -> 0.876 Inexact Rounded +pwsx4382 power 0.0767 0.5 -> 0.277 Inexact Rounded +pwsx4383 power 0.768 0.5 -> 0.876 Inexact Rounded +pwsx4384 power 0.0768 0.5 -> 0.277 Inexact Rounded +pwsx4385 power 0.769 0.5 -> 0.877 Inexact Rounded +pwsx4386 power 0.0769 0.5 -> 0.277 Inexact Rounded +pwsx4387 power 0.771 0.5 -> 0.878 Inexact Rounded +pwsx4388 power 0.0771 0.5 -> 0.278 Inexact Rounded +pwsx4389 power 0.772 0.5 -> 0.879 Inexact Rounded +pwsx4390 power 0.0772 0.5 -> 0.278 Inexact Rounded +pwsx4391 power 0.773 0.5 -> 0.879 Inexact Rounded +pwsx4392 power 0.0773 0.5 -> 0.278 Inexact Rounded +pwsx4393 power 0.774 0.5 -> 0.880 Inexact Rounded +pwsx4394 power 0.0774 0.5 -> 0.278 Inexact Rounded +pwsx4395 power 0.775 0.5 -> 0.880 Inexact Rounded +pwsx4396 power 0.0775 0.5 -> 0.278 Inexact Rounded +pwsx4397 power 0.776 0.5 -> 0.881 Inexact Rounded +pwsx4398 power 0.0776 0.5 -> 0.279 Inexact Rounded +pwsx4399 power 0.777 0.5 -> 0.881 Inexact Rounded +pwsx4400 power 0.0777 0.5 -> 0.279 Inexact Rounded +pwsx4401 power 0.778 0.5 -> 0.882 Inexact Rounded +pwsx4402 power 0.0778 0.5 -> 0.279 Inexact Rounded +pwsx4403 power 0.779 0.5 -> 0.883 Inexact Rounded +pwsx4404 power 0.0779 0.5 -> 0.279 Inexact Rounded +pwsx4405 power 0.781 0.5 -> 0.884 Inexact Rounded +pwsx4406 power 0.0781 0.5 -> 0.279 Inexact Rounded +pwsx4407 power 0.782 0.5 -> 0.884 Inexact Rounded +pwsx4408 power 0.0782 0.5 -> 0.280 Inexact Rounded +pwsx4409 power 0.783 0.5 -> 0.885 Inexact Rounded +pwsx4410 power 0.0783 0.5 -> 0.280 Inexact Rounded +pwsx4411 power 0.784 0.5 -> 0.885 Inexact Rounded +pwsx4412 power 0.0784 0.5 -> 0.280 Inexact Rounded +pwsx4413 power 0.785 0.5 -> 0.886 Inexact Rounded +pwsx4414 power 0.0785 0.5 -> 0.280 Inexact Rounded +pwsx4415 power 0.786 0.5 -> 0.887 Inexact Rounded +pwsx4416 power 0.0786 0.5 -> 0.280 Inexact Rounded +pwsx4417 power 0.787 0.5 -> 0.887 Inexact Rounded +pwsx4418 power 0.0787 0.5 -> 0.281 Inexact Rounded +pwsx4419 power 0.788 0.5 -> 0.888 Inexact Rounded +pwsx4420 power 0.0788 0.5 -> 0.281 Inexact Rounded +pwsx4421 power 0.789 0.5 -> 0.888 Inexact Rounded +pwsx4422 power 0.0789 0.5 -> 0.281 Inexact Rounded +pwsx4423 power 0.791 0.5 -> 0.889 Inexact Rounded +pwsx4424 power 0.0791 0.5 -> 0.281 Inexact Rounded +pwsx4425 power 0.792 0.5 -> 0.890 Inexact Rounded +pwsx4426 power 0.0792 0.5 -> 0.281 Inexact Rounded +pwsx4427 power 0.793 0.5 -> 0.891 Inexact Rounded +pwsx4428 power 0.0793 0.5 -> 0.282 Inexact Rounded +pwsx4429 power 0.794 0.5 -> 0.891 Inexact Rounded +pwsx4430 power 0.0794 0.5 -> 0.282 Inexact Rounded +pwsx4431 power 0.795 0.5 -> 0.892 Inexact Rounded +pwsx4432 power 0.0795 0.5 -> 0.282 Inexact Rounded +pwsx4433 power 0.796 0.5 -> 0.892 Inexact Rounded +pwsx4434 power 0.0796 0.5 -> 0.282 Inexact Rounded +pwsx4435 power 0.797 0.5 -> 0.893 Inexact Rounded +pwsx4436 power 0.0797 0.5 -> 0.282 Inexact Rounded +pwsx4437 power 0.798 0.5 -> 0.893 Inexact Rounded +pwsx4438 power 0.0798 0.5 -> 0.282 Inexact Rounded +pwsx4439 power 0.799 0.5 -> 0.894 Inexact Rounded +pwsx4440 power 0.0799 0.5 -> 0.283 Inexact Rounded +pwsx4441 power 0.801 0.5 -> 0.895 Inexact Rounded +pwsx4442 power 0.0801 0.5 -> 0.283 Inexact Rounded +pwsx4443 power 0.802 0.5 -> 0.896 Inexact Rounded +pwsx4444 power 0.0802 0.5 -> 0.283 Inexact Rounded +pwsx4445 power 0.803 0.5 -> 0.896 Inexact Rounded +pwsx4446 power 0.0803 0.5 -> 0.283 Inexact Rounded +pwsx4447 power 0.804 0.5 -> 0.897 Inexact Rounded +pwsx4448 power 0.0804 0.5 -> 0.284 Inexact Rounded +pwsx4449 power 0.805 0.5 -> 0.897 Inexact Rounded +pwsx4450 power 0.0805 0.5 -> 0.284 Inexact Rounded +pwsx4451 power 0.806 0.5 -> 0.898 Inexact Rounded +pwsx4452 power 0.0806 0.5 -> 0.284 Inexact Rounded +pwsx4453 power 0.807 0.5 -> 0.898 Inexact Rounded +pwsx4454 power 0.0807 0.5 -> 0.284 Inexact Rounded +pwsx4455 power 0.808 0.5 -> 0.899 Inexact Rounded +pwsx4456 power 0.0808 0.5 -> 0.284 Inexact Rounded +pwsx4457 power 0.809 0.5 -> 0.899 Inexact Rounded +pwsx4458 power 0.0809 0.5 -> 0.284 Inexact Rounded +pwsx4459 power 0.811 0.5 -> 0.901 Inexact Rounded +pwsx4460 power 0.0811 0.5 -> 0.285 Inexact Rounded +pwsx4461 power 0.812 0.5 -> 0.901 Inexact Rounded +pwsx4462 power 0.0812 0.5 -> 0.285 Inexact Rounded +pwsx4463 power 0.813 0.5 -> 0.902 Inexact Rounded +pwsx4464 power 0.0813 0.5 -> 0.285 Inexact Rounded +pwsx4465 power 0.814 0.5 -> 0.902 Inexact Rounded +pwsx4466 power 0.0814 0.5 -> 0.285 Inexact Rounded +pwsx4467 power 0.815 0.5 -> 0.903 Inexact Rounded +pwsx4468 power 0.0815 0.5 -> 0.285 Inexact Rounded +pwsx4469 power 0.816 0.5 -> 0.903 Inexact Rounded +pwsx4470 power 0.0816 0.5 -> 0.286 Inexact Rounded +pwsx4471 power 0.817 0.5 -> 0.904 Inexact Rounded +pwsx4472 power 0.0817 0.5 -> 0.286 Inexact Rounded +pwsx4473 power 0.818 0.5 -> 0.904 Inexact Rounded +pwsx4474 power 0.0818 0.5 -> 0.286 Inexact Rounded +pwsx4475 power 0.819 0.5 -> 0.905 Inexact Rounded +pwsx4476 power 0.0819 0.5 -> 0.286 Inexact Rounded +pwsx4477 power 0.821 0.5 -> 0.906 Inexact Rounded +pwsx4478 power 0.0821 0.5 -> 0.287 Inexact Rounded +pwsx4479 power 0.822 0.5 -> 0.907 Inexact Rounded +pwsx4480 power 0.0822 0.5 -> 0.287 Inexact Rounded +pwsx4481 power 0.823 0.5 -> 0.907 Inexact Rounded +pwsx4482 power 0.0823 0.5 -> 0.287 Inexact Rounded +pwsx4483 power 0.824 0.5 -> 0.908 Inexact Rounded +pwsx4484 power 0.0824 0.5 -> 0.287 Inexact Rounded +pwsx4485 power 0.825 0.5 -> 0.908 Inexact Rounded +pwsx4486 power 0.0825 0.5 -> 0.287 Inexact Rounded +pwsx4487 power 0.826 0.5 -> 0.909 Inexact Rounded +pwsx4488 power 0.0826 0.5 -> 0.287 Inexact Rounded +pwsx4489 power 0.827 0.5 -> 0.909 Inexact Rounded +pwsx4490 power 0.0827 0.5 -> 0.288 Inexact Rounded +pwsx4491 power 0.828 0.5 -> 0.910 Inexact Rounded +pwsx4492 power 0.0828 0.5 -> 0.288 Inexact Rounded +pwsx4493 power 0.829 0.5 -> 0.910 Inexact Rounded +pwsx4494 power 0.0829 0.5 -> 0.288 Inexact Rounded +pwsx4495 power 0.831 0.5 -> 0.912 Inexact Rounded +pwsx4496 power 0.0831 0.5 -> 0.288 Inexact Rounded +pwsx4497 power 0.832 0.5 -> 0.912 Inexact Rounded +pwsx4498 power 0.0832 0.5 -> 0.288 Inexact Rounded +pwsx4499 power 0.833 0.5 -> 0.913 Inexact Rounded +pwsx4500 power 0.0833 0.5 -> 0.289 Inexact Rounded +pwsx4501 power 0.834 0.5 -> 0.913 Inexact Rounded +pwsx4502 power 0.0834 0.5 -> 0.289 Inexact Rounded +pwsx4503 power 0.835 0.5 -> 0.914 Inexact Rounded +pwsx4504 power 0.0835 0.5 -> 0.289 Inexact Rounded +pwsx4505 power 0.836 0.5 -> 0.914 Inexact Rounded +pwsx4506 power 0.0836 0.5 -> 0.289 Inexact Rounded +pwsx4507 power 0.837 0.5 -> 0.915 Inexact Rounded +pwsx4508 power 0.0837 0.5 -> 0.289 Inexact Rounded +pwsx4509 power 0.838 0.5 -> 0.915 Inexact Rounded +pwsx4510 power 0.0838 0.5 -> 0.289 Inexact Rounded +pwsx4511 power 0.839 0.5 -> 0.916 Inexact Rounded +pwsx4512 power 0.0839 0.5 -> 0.290 Inexact Rounded +pwsx4513 power 0.841 0.5 -> 0.917 Inexact Rounded +pwsx4514 power 0.0841 0.5 -> 0.290 Inexact Rounded +pwsx4515 power 0.842 0.5 -> 0.918 Inexact Rounded +pwsx4516 power 0.0842 0.5 -> 0.290 Inexact Rounded +pwsx4517 power 0.843 0.5 -> 0.918 Inexact Rounded +pwsx4518 power 0.0843 0.5 -> 0.290 Inexact Rounded +pwsx4519 power 0.844 0.5 -> 0.919 Inexact Rounded +pwsx4520 power 0.0844 0.5 -> 0.291 Inexact Rounded +pwsx4521 power 0.845 0.5 -> 0.919 Inexact Rounded +pwsx4522 power 0.0845 0.5 -> 0.291 Inexact Rounded +pwsx4523 power 0.846 0.5 -> 0.920 Inexact Rounded +pwsx4524 power 0.0846 0.5 -> 0.291 Inexact Rounded +pwsx4525 power 0.847 0.5 -> 0.920 Inexact Rounded +pwsx4526 power 0.0847 0.5 -> 0.291 Inexact Rounded +pwsx4527 power 0.848 0.5 -> 0.921 Inexact Rounded +pwsx4528 power 0.0848 0.5 -> 0.291 Inexact Rounded +pwsx4529 power 0.849 0.5 -> 0.921 Inexact Rounded +pwsx4530 power 0.0849 0.5 -> 0.291 Inexact Rounded +pwsx4531 power 0.851 0.5 -> 0.922 Inexact Rounded +pwsx4532 power 0.0851 0.5 -> 0.292 Inexact Rounded +pwsx4533 power 0.852 0.5 -> 0.923 Inexact Rounded +pwsx4534 power 0.0852 0.5 -> 0.292 Inexact Rounded +pwsx4535 power 0.853 0.5 -> 0.924 Inexact Rounded +pwsx4536 power 0.0853 0.5 -> 0.292 Inexact Rounded +pwsx4537 power 0.854 0.5 -> 0.924 Inexact Rounded +pwsx4538 power 0.0854 0.5 -> 0.292 Inexact Rounded +pwsx4539 power 0.855 0.5 -> 0.925 Inexact Rounded +pwsx4540 power 0.0855 0.5 -> 0.292 Inexact Rounded +pwsx4541 power 0.856 0.5 -> 0.925 Inexact Rounded +pwsx4542 power 0.0856 0.5 -> 0.293 Inexact Rounded +pwsx4543 power 0.857 0.5 -> 0.926 Inexact Rounded +pwsx4544 power 0.0857 0.5 -> 0.293 Inexact Rounded +pwsx4545 power 0.858 0.5 -> 0.926 Inexact Rounded +pwsx4546 power 0.0858 0.5 -> 0.293 Inexact Rounded +pwsx4547 power 0.859 0.5 -> 0.927 Inexact Rounded +pwsx4548 power 0.0859 0.5 -> 0.293 Inexact Rounded +pwsx4549 power 0.861 0.5 -> 0.928 Inexact Rounded +pwsx4550 power 0.0861 0.5 -> 0.293 Inexact Rounded +pwsx4551 power 0.862 0.5 -> 0.928 Inexact Rounded +pwsx4552 power 0.0862 0.5 -> 0.294 Inexact Rounded +pwsx4553 power 0.863 0.5 -> 0.929 Inexact Rounded +pwsx4554 power 0.0863 0.5 -> 0.294 Inexact Rounded +pwsx4555 power 0.864 0.5 -> 0.930 Inexact Rounded +pwsx4556 power 0.0864 0.5 -> 0.294 Inexact Rounded +pwsx4557 power 0.865 0.5 -> 0.930 Inexact Rounded +pwsx4558 power 0.0865 0.5 -> 0.294 Inexact Rounded +pwsx4559 power 0.866 0.5 -> 0.931 Inexact Rounded +pwsx4560 power 0.0866 0.5 -> 0.294 Inexact Rounded +pwsx4561 power 0.867 0.5 -> 0.931 Inexact Rounded +pwsx4562 power 0.0867 0.5 -> 0.294 Inexact Rounded +pwsx4563 power 0.868 0.5 -> 0.932 Inexact Rounded +pwsx4564 power 0.0868 0.5 -> 0.295 Inexact Rounded +pwsx4565 power 0.869 0.5 -> 0.932 Inexact Rounded +pwsx4566 power 0.0869 0.5 -> 0.295 Inexact Rounded +pwsx4567 power 0.871 0.5 -> 0.933 Inexact Rounded +pwsx4568 power 0.0871 0.5 -> 0.295 Inexact Rounded +pwsx4569 power 0.872 0.5 -> 0.934 Inexact Rounded +pwsx4570 power 0.0872 0.5 -> 0.295 Inexact Rounded +pwsx4571 power 0.873 0.5 -> 0.934 Inexact Rounded +pwsx4572 power 0.0873 0.5 -> 0.295 Inexact Rounded +pwsx4573 power 0.874 0.5 -> 0.935 Inexact Rounded +pwsx4574 power 0.0874 0.5 -> 0.296 Inexact Rounded +pwsx4575 power 0.875 0.5 -> 0.935 Inexact Rounded +pwsx4576 power 0.0875 0.5 -> 0.296 Inexact Rounded +pwsx4577 power 0.876 0.5 -> 0.936 Inexact Rounded +pwsx4578 power 0.0876 0.5 -> 0.296 Inexact Rounded +pwsx4579 power 0.877 0.5 -> 0.936 Inexact Rounded +pwsx4580 power 0.0877 0.5 -> 0.296 Inexact Rounded +pwsx4581 power 0.878 0.5 -> 0.937 Inexact Rounded +pwsx4582 power 0.0878 0.5 -> 0.296 Inexact Rounded +pwsx4583 power 0.879 0.5 -> 0.938 Inexact Rounded +pwsx4584 power 0.0879 0.5 -> 0.296 Inexact Rounded +pwsx4585 power 0.881 0.5 -> 0.939 Inexact Rounded +pwsx4586 power 0.0881 0.5 -> 0.297 Inexact Rounded +pwsx4587 power 0.882 0.5 -> 0.939 Inexact Rounded +pwsx4588 power 0.0882 0.5 -> 0.297 Inexact Rounded +pwsx4589 power 0.883 0.5 -> 0.940 Inexact Rounded +pwsx4590 power 0.0883 0.5 -> 0.297 Inexact Rounded +pwsx4591 power 0.884 0.5 -> 0.940 Inexact Rounded +pwsx4592 power 0.0884 0.5 -> 0.297 Inexact Rounded +pwsx4593 power 0.885 0.5 -> 0.941 Inexact Rounded +pwsx4594 power 0.0885 0.5 -> 0.297 Inexact Rounded +pwsx4595 power 0.886 0.5 -> 0.941 Inexact Rounded +pwsx4596 power 0.0886 0.5 -> 0.298 Inexact Rounded +pwsx4597 power 0.887 0.5 -> 0.942 Inexact Rounded +pwsx4598 power 0.0887 0.5 -> 0.298 Inexact Rounded +pwsx4599 power 0.888 0.5 -> 0.942 Inexact Rounded +pwsx4600 power 0.0888 0.5 -> 0.298 Inexact Rounded +pwsx4601 power 0.889 0.5 -> 0.943 Inexact Rounded +pwsx4602 power 0.0889 0.5 -> 0.298 Inexact Rounded +pwsx4603 power 0.891 0.5 -> 0.944 Inexact Rounded +pwsx4604 power 0.0891 0.5 -> 0.298 Inexact Rounded +pwsx4605 power 0.892 0.5 -> 0.944 Inexact Rounded +pwsx4606 power 0.0892 0.5 -> 0.299 Inexact Rounded +pwsx4607 power 0.893 0.5 -> 0.945 Inexact Rounded +pwsx4608 power 0.0893 0.5 -> 0.299 Inexact Rounded +pwsx4609 power 0.894 0.5 -> 0.946 Inexact Rounded +pwsx4610 power 0.0894 0.5 -> 0.299 Inexact Rounded +pwsx4611 power 0.895 0.5 -> 0.946 Inexact Rounded +pwsx4612 power 0.0895 0.5 -> 0.299 Inexact Rounded +pwsx4613 power 0.896 0.5 -> 0.947 Inexact Rounded +pwsx4614 power 0.0896 0.5 -> 0.299 Inexact Rounded +pwsx4615 power 0.897 0.5 -> 0.947 Inexact Rounded +pwsx4616 power 0.0897 0.5 -> 0.299 Inexact Rounded +pwsx4617 power 0.898 0.5 -> 0.948 Inexact Rounded +pwsx4618 power 0.0898 0.5 -> 0.300 Inexact Rounded +pwsx4619 power 0.899 0.5 -> 0.948 Inexact Rounded +pwsx4620 power 0.0899 0.5 -> 0.300 Inexact Rounded +pwsx4621 power 0.901 0.5 -> 0.949 Inexact Rounded +pwsx4622 power 0.0901 0.5 -> 0.300 Inexact Rounded +pwsx4623 power 0.902 0.5 -> 0.950 Inexact Rounded +pwsx4624 power 0.0902 0.5 -> 0.300 Inexact Rounded +pwsx4625 power 0.903 0.5 -> 0.950 Inexact Rounded +pwsx4626 power 0.0903 0.5 -> 0.300 Inexact Rounded +pwsx4627 power 0.904 0.5 -> 0.951 Inexact Rounded +pwsx4628 power 0.0904 0.5 -> 0.301 Inexact Rounded +pwsx4629 power 0.905 0.5 -> 0.951 Inexact Rounded +pwsx4630 power 0.0905 0.5 -> 0.301 Inexact Rounded +pwsx4631 power 0.906 0.5 -> 0.952 Inexact Rounded +pwsx4632 power 0.0906 0.5 -> 0.301 Inexact Rounded +pwsx4633 power 0.907 0.5 -> 0.952 Inexact Rounded +pwsx4634 power 0.0907 0.5 -> 0.301 Inexact Rounded +pwsx4635 power 0.908 0.5 -> 0.953 Inexact Rounded +pwsx4636 power 0.0908 0.5 -> 0.301 Inexact Rounded +pwsx4637 power 0.909 0.5 -> 0.953 Inexact Rounded +pwsx4638 power 0.0909 0.5 -> 0.301 Inexact Rounded +pwsx4639 power 0.911 0.5 -> 0.954 Inexact Rounded +pwsx4640 power 0.0911 0.5 -> 0.302 Inexact Rounded +pwsx4641 power 0.912 0.5 -> 0.955 Inexact Rounded +pwsx4642 power 0.0912 0.5 -> 0.302 Inexact Rounded +pwsx4643 power 0.913 0.5 -> 0.956 Inexact Rounded +pwsx4644 power 0.0913 0.5 -> 0.302 Inexact Rounded +pwsx4645 power 0.914 0.5 -> 0.956 Inexact Rounded +pwsx4646 power 0.0914 0.5 -> 0.302 Inexact Rounded +pwsx4647 power 0.915 0.5 -> 0.957 Inexact Rounded +pwsx4648 power 0.0915 0.5 -> 0.302 Inexact Rounded +pwsx4649 power 0.916 0.5 -> 0.957 Inexact Rounded +pwsx4650 power 0.0916 0.5 -> 0.303 Inexact Rounded +pwsx4651 power 0.917 0.5 -> 0.958 Inexact Rounded +pwsx4652 power 0.0917 0.5 -> 0.303 Inexact Rounded +pwsx4653 power 0.918 0.5 -> 0.958 Inexact Rounded +pwsx4654 power 0.0918 0.5 -> 0.303 Inexact Rounded +pwsx4655 power 0.919 0.5 -> 0.959 Inexact Rounded +pwsx4656 power 0.0919 0.5 -> 0.303 Inexact Rounded +pwsx4657 power 0.921 0.5 -> 0.960 Inexact Rounded +pwsx4658 power 0.0921 0.5 -> 0.303 Inexact Rounded +pwsx4659 power 0.922 0.5 -> 0.960 Inexact Rounded +pwsx4660 power 0.0922 0.5 -> 0.304 Inexact Rounded +pwsx4661 power 0.923 0.5 -> 0.961 Inexact Rounded +pwsx4662 power 0.0923 0.5 -> 0.304 Inexact Rounded +pwsx4663 power 0.924 0.5 -> 0.961 Inexact Rounded +pwsx4664 power 0.0924 0.5 -> 0.304 Inexact Rounded +pwsx4665 power 0.925 0.5 -> 0.962 Inexact Rounded +pwsx4666 power 0.0925 0.5 -> 0.304 Inexact Rounded +pwsx4667 power 0.926 0.5 -> 0.962 Inexact Rounded +pwsx4668 power 0.0926 0.5 -> 0.304 Inexact Rounded +pwsx4669 power 0.927 0.5 -> 0.963 Inexact Rounded +pwsx4670 power 0.0927 0.5 -> 0.304 Inexact Rounded +pwsx4671 power 0.928 0.5 -> 0.963 Inexact Rounded +pwsx4672 power 0.0928 0.5 -> 0.305 Inexact Rounded +pwsx4673 power 0.929 0.5 -> 0.964 Inexact Rounded +pwsx4674 power 0.0929 0.5 -> 0.305 Inexact Rounded +pwsx4675 power 0.931 0.5 -> 0.965 Inexact Rounded +pwsx4676 power 0.0931 0.5 -> 0.305 Inexact Rounded +pwsx4677 power 0.932 0.5 -> 0.965 Inexact Rounded +pwsx4678 power 0.0932 0.5 -> 0.305 Inexact Rounded +pwsx4679 power 0.933 0.5 -> 0.966 Inexact Rounded +pwsx4680 power 0.0933 0.5 -> 0.305 Inexact Rounded +pwsx4681 power 0.934 0.5 -> 0.966 Inexact Rounded +pwsx4682 power 0.0934 0.5 -> 0.306 Inexact Rounded +pwsx4683 power 0.935 0.5 -> 0.967 Inexact Rounded +pwsx4684 power 0.0935 0.5 -> 0.306 Inexact Rounded +pwsx4685 power 0.936 0.5 -> 0.967 Inexact Rounded +pwsx4686 power 0.0936 0.5 -> 0.306 Inexact Rounded +pwsx4687 power 0.937 0.5 -> 0.968 Inexact Rounded +pwsx4688 power 0.0937 0.5 -> 0.306 Inexact Rounded +pwsx4689 power 0.938 0.5 -> 0.969 Inexact Rounded +pwsx4690 power 0.0938 0.5 -> 0.306 Inexact Rounded +pwsx4691 power 0.939 0.5 -> 0.969 Inexact Rounded +pwsx4692 power 0.0939 0.5 -> 0.306 Inexact Rounded +pwsx4693 power 0.941 0.5 -> 0.970 Inexact Rounded +pwsx4694 power 0.0941 0.5 -> 0.307 Inexact Rounded +pwsx4695 power 0.942 0.5 -> 0.971 Inexact Rounded +pwsx4696 power 0.0942 0.5 -> 0.307 Inexact Rounded +pwsx4697 power 0.943 0.5 -> 0.971 Inexact Rounded +pwsx4698 power 0.0943 0.5 -> 0.307 Inexact Rounded +pwsx4699 power 0.944 0.5 -> 0.972 Inexact Rounded +pwsx4700 power 0.0944 0.5 -> 0.307 Inexact Rounded +pwsx4701 power 0.945 0.5 -> 0.972 Inexact Rounded +pwsx4702 power 0.0945 0.5 -> 0.307 Inexact Rounded +pwsx4703 power 0.946 0.5 -> 0.973 Inexact Rounded +pwsx4704 power 0.0946 0.5 -> 0.308 Inexact Rounded +pwsx4705 power 0.947 0.5 -> 0.973 Inexact Rounded +pwsx4706 power 0.0947 0.5 -> 0.308 Inexact Rounded +pwsx4707 power 0.948 0.5 -> 0.974 Inexact Rounded +pwsx4708 power 0.0948 0.5 -> 0.308 Inexact Rounded +pwsx4709 power 0.949 0.5 -> 0.974 Inexact Rounded +pwsx4710 power 0.0949 0.5 -> 0.308 Inexact Rounded +pwsx4711 power 0.951 0.5 -> 0.975 Inexact Rounded +pwsx4712 power 0.0951 0.5 -> 0.308 Inexact Rounded +pwsx4713 power 0.952 0.5 -> 0.976 Inexact Rounded +pwsx4714 power 0.0952 0.5 -> 0.309 Inexact Rounded +pwsx4715 power 0.953 0.5 -> 0.976 Inexact Rounded +pwsx4716 power 0.0953 0.5 -> 0.309 Inexact Rounded +pwsx4717 power 0.954 0.5 -> 0.977 Inexact Rounded +pwsx4718 power 0.0954 0.5 -> 0.309 Inexact Rounded +pwsx4719 power 0.955 0.5 -> 0.977 Inexact Rounded +pwsx4720 power 0.0955 0.5 -> 0.309 Inexact Rounded +pwsx4721 power 0.956 0.5 -> 0.978 Inexact Rounded +pwsx4722 power 0.0956 0.5 -> 0.309 Inexact Rounded +pwsx4723 power 0.957 0.5 -> 0.978 Inexact Rounded +pwsx4724 power 0.0957 0.5 -> 0.309 Inexact Rounded +pwsx4725 power 0.958 0.5 -> 0.979 Inexact Rounded +pwsx4726 power 0.0958 0.5 -> 0.310 Inexact Rounded +pwsx4727 power 0.959 0.5 -> 0.979 Inexact Rounded +pwsx4728 power 0.0959 0.5 -> 0.310 Inexact Rounded +pwsx4729 power 0.961 0.5 -> 0.980 Inexact Rounded +pwsx4730 power 0.0961 0.5 -> 0.310 Inexact Rounded +pwsx4731 power 0.962 0.5 -> 0.981 Inexact Rounded +pwsx4732 power 0.0962 0.5 -> 0.310 Inexact Rounded +pwsx4733 power 0.963 0.5 -> 0.981 Inexact Rounded +pwsx4734 power 0.0963 0.5 -> 0.310 Inexact Rounded +pwsx4735 power 0.964 0.5 -> 0.982 Inexact Rounded +pwsx4736 power 0.0964 0.5 -> 0.310 Inexact Rounded +pwsx4737 power 0.965 0.5 -> 0.982 Inexact Rounded +pwsx4738 power 0.0965 0.5 -> 0.311 Inexact Rounded +pwsx4739 power 0.966 0.5 -> 0.983 Inexact Rounded +pwsx4740 power 0.0966 0.5 -> 0.311 Inexact Rounded +pwsx4741 power 0.967 0.5 -> 0.983 Inexact Rounded +pwsx4742 power 0.0967 0.5 -> 0.311 Inexact Rounded +pwsx4743 power 0.968 0.5 -> 0.984 Inexact Rounded +pwsx4744 power 0.0968 0.5 -> 0.311 Inexact Rounded +pwsx4745 power 0.969 0.5 -> 0.984 Inexact Rounded +pwsx4746 power 0.0969 0.5 -> 0.311 Inexact Rounded +pwsx4747 power 0.971 0.5 -> 0.985 Inexact Rounded +pwsx4748 power 0.0971 0.5 -> 0.312 Inexact Rounded +pwsx4749 power 0.972 0.5 -> 0.986 Inexact Rounded +pwsx4750 power 0.0972 0.5 -> 0.312 Inexact Rounded +pwsx4751 power 0.973 0.5 -> 0.986 Inexact Rounded +pwsx4752 power 0.0973 0.5 -> 0.312 Inexact Rounded +pwsx4753 power 0.974 0.5 -> 0.987 Inexact Rounded +pwsx4754 power 0.0974 0.5 -> 0.312 Inexact Rounded +pwsx4755 power 0.975 0.5 -> 0.987 Inexact Rounded +pwsx4756 power 0.0975 0.5 -> 0.312 Inexact Rounded +pwsx4757 power 0.976 0.5 -> 0.988 Inexact Rounded +pwsx4758 power 0.0976 0.5 -> 0.312 Inexact Rounded +pwsx4759 power 0.977 0.5 -> 0.988 Inexact Rounded +pwsx4760 power 0.0977 0.5 -> 0.313 Inexact Rounded +pwsx4761 power 0.978 0.5 -> 0.989 Inexact Rounded +pwsx4762 power 0.0978 0.5 -> 0.313 Inexact Rounded +pwsx4763 power 0.979 0.5 -> 0.989 Inexact Rounded +pwsx4764 power 0.0979 0.5 -> 0.313 Inexact Rounded +pwsx4765 power 0.981 0.5 -> 0.990 Inexact Rounded +pwsx4766 power 0.0981 0.5 -> 0.313 Inexact Rounded +pwsx4767 power 0.982 0.5 -> 0.991 Inexact Rounded +pwsx4768 power 0.0982 0.5 -> 0.313 Inexact Rounded +pwsx4769 power 0.983 0.5 -> 0.991 Inexact Rounded +pwsx4770 power 0.0983 0.5 -> 0.314 Inexact Rounded +pwsx4771 power 0.984 0.5 -> 0.992 Inexact Rounded +pwsx4772 power 0.0984 0.5 -> 0.314 Inexact Rounded +pwsx4773 power 0.985 0.5 -> 0.992 Inexact Rounded +pwsx4774 power 0.0985 0.5 -> 0.314 Inexact Rounded +pwsx4775 power 0.986 0.5 -> 0.993 Inexact Rounded +pwsx4776 power 0.0986 0.5 -> 0.314 Inexact Rounded +pwsx4777 power 0.987 0.5 -> 0.993 Inexact Rounded +pwsx4778 power 0.0987 0.5 -> 0.314 Inexact Rounded +pwsx4779 power 0.988 0.5 -> 0.994 Inexact Rounded +pwsx4780 power 0.0988 0.5 -> 0.314 Inexact Rounded +pwsx4781 power 0.989 0.5 -> 0.994 Inexact Rounded +pwsx4782 power 0.0989 0.5 -> 0.314 Inexact Rounded +pwsx4783 power 0.991 0.5 -> 0.995 Inexact Rounded +pwsx4784 power 0.0991 0.5 -> 0.315 Inexact Rounded +pwsx4785 power 0.992 0.5 -> 0.996 Inexact Rounded +pwsx4786 power 0.0992 0.5 -> 0.315 Inexact Rounded +pwsx4787 power 0.993 0.5 -> 0.996 Inexact Rounded +pwsx4788 power 0.0993 0.5 -> 0.315 Inexact Rounded +pwsx4789 power 0.994 0.5 -> 0.997 Inexact Rounded +pwsx4790 power 0.0994 0.5 -> 0.315 Inexact Rounded +pwsx4791 power 0.995 0.5 -> 0.997 Inexact Rounded +pwsx4792 power 0.0995 0.5 -> 0.315 Inexact Rounded +pwsx4793 power 0.996 0.5 -> 0.998 Inexact Rounded +pwsx4794 power 0.0996 0.5 -> 0.316 Inexact Rounded +pwsx4795 power 0.997 0.5 -> 0.998 Inexact Rounded +pwsx4796 power 0.0997 0.5 -> 0.316 Inexact Rounded +pwsx4797 power 0.998 0.5 -> 0.999 Inexact Rounded +pwsx4798 power 0.0998 0.5 -> 0.316 Inexact Rounded +pwsx4799 power 0.999 0.5 -> 0.999 Inexact Rounded +pwsx4800 power 0.0999 0.5 -> 0.316 Inexact Rounded + +-- A group of precision 4 tests where Hull & Abrham adjustments are +-- needed in some cases (both up and down) [see Hull1985b] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 4 +pwsx5001 power 0.0118 0.5 -> 0.1086 Inexact Rounded +pwsx5002 power 0.119 0.5 -> 0.3450 Inexact Rounded +pwsx5003 power 0.0119 0.5 -> 0.1091 Inexact Rounded +pwsx5004 power 0.121 0.5 -> 0.3479 Inexact Rounded +pwsx5005 power 0.0121 0.5 -> 0.1100 Inexact Rounded +pwsx5006 power 0.122 0.5 -> 0.3493 Inexact Rounded +pwsx5007 power 0.0122 0.5 -> 0.1105 Inexact Rounded +pwsx5008 power 0.123 0.5 -> 0.3507 Inexact Rounded +pwsx5009 power 0.494 0.5 -> 0.7029 Inexact Rounded +pwsx5010 power 0.0669 0.5 -> 0.2587 Inexact Rounded +pwsx5011 power 0.9558 0.5 -> 0.9777 Inexact Rounded +pwsx5012 power 0.9348 0.5 -> 0.9669 Inexact Rounded +pwsx5013 power 0.9345 0.5 -> 0.9667 Inexact Rounded +pwsx5014 power 0.09345 0.5 -> 0.3057 Inexact Rounded +pwsx5015 power 0.9346 0.5 -> 0.9667 Inexact Rounded +pwsx5016 power 0.09346 0.5 -> 0.3057 Inexact Rounded +pwsx5017 power 0.9347 0.5 -> 0.9668 Inexact Rounded + +-- examples from decArith +precision: 9 +pwsx700 power 0 0.5 -> '0' +pwsx701 power -0 0.5 -> '0' +pwsx702 power 0.39 0.5 -> 0.624499800 Inexact Rounded +pwsx703 power 100 0.5 -> '10.0000000' Inexact Rounded +pwsx704 power 1.00 0.5 -> '1.00000000' Inexact Rounded +pwsx705 power 7 0.5 -> '2.64575131' Inexact Rounded +pwsx706 power 10 0.5 -> 3.16227766 Inexact Rounded + +-- some one-offs +precision: 9 +pwsx711 power 0.1 0.5 -> 0.316227766 Inexact Rounded +pwsx712 power 0.2 0.5 -> 0.447213595 Inexact Rounded +pwsx713 power 0.3 0.5 -> 0.547722558 Inexact Rounded +pwsx714 power 0.4 0.5 -> 0.632455532 Inexact Rounded +pwsx715 power 0.5 0.5 -> 0.707106781 Inexact Rounded +pwsx716 power 0.6 0.5 -> 0.774596669 Inexact Rounded +pwsx717 power 0.7 0.5 -> 0.836660027 Inexact Rounded +pwsx718 power 0.8 0.5 -> 0.894427191 Inexact Rounded +pwsx719 power 0.9 0.5 -> 0.948683298 Inexact Rounded +precision: 10 -- note no normalizatoin here +pwsx720 power +0.1 0.5 -> 0.3162277660 Inexact Rounded +precision: 11 +pwsx721 power +0.1 0.5 -> 0.31622776602 Inexact Rounded +precision: 12 +pwsx722 power +0.1 0.5 -> 0.316227766017 Inexact Rounded +precision: 9 +pwsx723 power 0.39 0.5 -> 0.624499800 Inexact Rounded +precision: 15 +pwsx724 power 0.39 0.5 -> 0.624499799839840 Inexact Rounded + +-- discussion cases +precision: 7 +pwsx731 power 9 0.5 -> 3.000000 Inexact Rounded +pwsx732 power 100 0.5 -> 10.00000 Inexact Rounded +pwsx733 power 123 0.5 -> 11.09054 Inexact Rounded +pwsx734 power 144 0.5 -> 12.00000 Inexact Rounded +pwsx735 power 156 0.5 -> 12.49000 Inexact Rounded +pwsx736 power 10000 0.5 -> 100.0000 Inexact Rounded + +-- values close to overflow (if there were input rounding) +maxexponent: 99 +minexponent: -99 +precision: 5 +pwsx760 power 9.9997E+99 0.5 -> 9.9998E+49 Inexact Rounded +pwsx761 power 9.9998E+99 0.5 -> 9.9999E+49 Inexact Rounded +pwsx762 power 9.9999E+99 0.5 -> 9.9999E+49 Inexact Rounded +pwsx763 power 9.99991E+99 0.5 -> 1.0000E+50 Inexact Rounded +pwsx764 power 9.99994E+99 0.5 -> 1.0000E+50 Inexact Rounded +pwsx765 power 9.99995E+99 0.5 -> 1.0000E+50 Inexact Rounded +pwsx766 power 9.99999E+99 0.5 -> 1.0000E+50 Inexact Rounded +precision: 9 +pwsx770 power 9.9997E+99 0.5 -> 9.99985000E+49 Inexact Rounded +pwsx771 power 9.9998E+99 0.5 -> 9.99990000E+49 Inexact Rounded +pwsx772 power 9.9999E+99 0.5 -> 9.99995000E+49 Inexact Rounded +pwsx773 power 9.99991E+99 0.5 -> 9.99995500E+49 Inexact Rounded +pwsx774 power 9.99994E+99 0.5 -> 9.99997000E+49 Inexact Rounded +pwsx775 power 9.99995E+99 0.5 -> 9.99997500E+49 Inexact Rounded +pwsx776 power 9.99999E+99 0.5 -> 9.99999500E+49 Inexact Rounded +precision: 20 +pwsx780 power 9.9997E+99 0.5 -> '9.9998499988749831247E+49' Inexact Rounded +pwsx781 power 9.9998E+99 0.5 -> '9.9998999994999949999E+49' Inexact Rounded +pwsx782 power 9.9999E+99 0.5 -> '9.9999499998749993750E+49' Inexact Rounded +pwsx783 power 9.99991E+99 0.5 -> '9.9999549998987495444E+49' Inexact Rounded +pwsx784 power 9.99994E+99 0.5 -> '9.9999699999549998650E+49' Inexact Rounded +pwsx785 power 9.99995E+99 0.5 -> '9.9999749999687499219E+49' Inexact Rounded +pwsx786 power 9.99999E+99 0.5 -> '9.9999949999987499994E+49' Inexact Rounded + +-- subnormals and underflows [these can only result when eMax is < digits+1] +-- Etiny = -(Emax + (precision-1)) +-- start with subnormal operands and normal results +maxexponent: 9 +minexponent: -9 +precision: 9 -- Etiny=-17 +pwsx800 power 1E-17 0.5 -> 3.16227766E-9 Inexact Rounded +pwsx801 power 10E-17 0.5 -> 1.00000000E-8 Inexact Rounded +precision: 10 -- Etiny=-18 +pwsx802 power 10E-18 0.5 -> 3.162277660E-9 Inexact Rounded +pwsx803 power 1E-18 0.5 -> 1.000000000E-9 Inexact Rounded + +precision: 11 -- Etiny=-19 +pwsx804 power 1E-19 0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded +-- The next test should be skipped for decNumber +pwsx805 power 10E-19 0.5 -> 1.0000000000E-9 Inexact Rounded +precision: 12 -- Etiny=-20 +pwsx806 power 10E-20 0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded +pwsx807 power 1E-20 0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded + +precision: 13 -- Etiny=-21 +pwsx808 power 1E-21 0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded +pwsx809 power 10E-21 0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded +precision: 14 -- Etiny=-22 +pwsx810 power 1E-21 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +pwsx811 power 10E-22 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +pwsx812 power 1E-22 0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded + + +-- special values +maxexponent: 999 +minexponent: -999 +pwsx820 power Inf 0.5 -> Infinity +pwsx821 power -Inf 0.5 -> NaN Invalid_operation +pwsx822 power NaN 0.5 -> NaN +pwsx823 power sNaN 0.5 -> NaN Invalid_operation +-- propagating NaNs +pwsx824 power sNaN123 0.5 -> NaN123 Invalid_operation +pwsx825 power -sNaN321 0.5 -> -NaN321 Invalid_operation +pwsx826 power NaN456 0.5 -> NaN456 +pwsx827 power -NaN654 0.5 -> -NaN654 +pwsx828 power NaN1 0.5 -> NaN1 + +-- Null test +pwsx900 power # 0.5 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/quantize.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/quantize.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,948 @@ +------------------------------------------------------------------------ +-- quantize.decTest -- decimal quantize operation -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- Most of the tests here assume a "regular pattern", where the +-- sign and coefficient are +1. +-- 2004.03.15 Underflow for quantize is suppressed +-- 2005.06.08 More extensive tests for 'does not fit' + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- sanity checks +quax001 quantize 0 1e0 -> 0 +quax002 quantize 1 1e0 -> 1 +quax003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded +quax005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded +quax006 quantize 0.1 1e0 -> 0 Inexact Rounded +quax007 quantize 0.1 1e-1 -> 0.1 +quax008 quantize 0.1 1e-2 -> 0.10 +quax009 quantize 0.1 1e-3 -> 0.100 +quax010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded +quax011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded +quax012 quantize 0.9 1e+0 -> 1 Inexact Rounded +quax013 quantize 0.9 1e-1 -> 0.9 +quax014 quantize 0.9 1e-2 -> 0.90 +quax015 quantize 0.9 1e-3 -> 0.900 +-- negatives +quax021 quantize -0 1e0 -> -0 +quax022 quantize -1 1e0 -> -1 +quax023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded +quax025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded +quax026 quantize -0.1 1e0 -> -0 Inexact Rounded +quax027 quantize -0.1 1e-1 -> -0.1 +quax028 quantize -0.1 1e-2 -> -0.10 +quax029 quantize -0.1 1e-3 -> -0.100 +quax030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +quax031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +quax032 quantize -0.9 1e+0 -> -1 Inexact Rounded +quax033 quantize -0.9 1e-1 -> -0.9 +quax034 quantize -0.9 1e-2 -> -0.90 +quax035 quantize -0.9 1e-3 -> -0.900 +quax036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded +quax037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded +quax038 quantize -0.5 1e+0 -> -1 Inexact Rounded +quax039 quantize -0.5 1e-1 -> -0.5 +quax040 quantize -0.5 1e-2 -> -0.50 +quax041 quantize -0.5 1e-3 -> -0.500 +quax042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +quax043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +quax044 quantize -0.9 1e+0 -> -1 Inexact Rounded +quax045 quantize -0.9 1e-1 -> -0.9 +quax046 quantize -0.9 1e-2 -> -0.90 +quax047 quantize -0.9 1e-3 -> -0.900 + +-- examples from Specification +quax060 quantize 2.17 0.001 -> 2.170 +quax061 quantize 2.17 0.01 -> 2.17 +quax062 quantize 2.17 0.1 -> 2.2 Inexact Rounded +quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded +quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded +quax065 quantize -Inf Inf -> -Infinity +quax066 quantize 2 Inf -> NaN Invalid_operation +quax067 quantize -0.1 1 -> -0 Inexact Rounded +quax068 quantize -0 1e+5 -> -0E+5 +quax069 quantize +35236450.6 1e-2 -> NaN Invalid_operation +quax070 quantize -35236450.6 1e-2 -> NaN Invalid_operation +quax071 quantize 217 1e-1 -> 217.0 +quax072 quantize 217 1e+0 -> 217 +quax073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded +quax074 quantize 217 1e+2 -> 2E+2 Inexact Rounded + +-- general tests .. +quax089 quantize 12 1e+4 -> 0E+4 Inexact Rounded +quax090 quantize 12 1e+3 -> 0E+3 Inexact Rounded +quax091 quantize 12 1e+2 -> 0E+2 Inexact Rounded +quax092 quantize 12 1e+1 -> 1E+1 Inexact Rounded +quax093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded +quax094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded +quax095 quantize 1.2345 1e-6 -> 1.234500 +quax096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded +quax097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded +quax098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded +quax099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded +quax100 quantize 92 1e+2 -> 1E+2 Inexact Rounded + +quax101 quantize -1 1e0 -> -1 +quax102 quantize -1 1e-1 -> -1.0 +quax103 quantize -1 1e-2 -> -1.00 +quax104 quantize 0 1e0 -> 0 +quax105 quantize 0 1e-1 -> 0.0 +quax106 quantize 0 1e-2 -> 0.00 +quax107 quantize 0.00 1e0 -> 0 +quax108 quantize 0 1e+1 -> 0E+1 +quax109 quantize 0 1e+2 -> 0E+2 +quax110 quantize +1 1e0 -> 1 +quax111 quantize +1 1e-1 -> 1.0 +quax112 quantize +1 1e-2 -> 1.00 + +quax120 quantize 1.04 1e-3 -> 1.040 +quax121 quantize 1.04 1e-2 -> 1.04 +quax122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded +quax123 quantize 1.04 1e0 -> 1 Inexact Rounded +quax124 quantize 1.05 1e-3 -> 1.050 +quax125 quantize 1.05 1e-2 -> 1.05 +quax126 quantize 1.05 1e-1 -> 1.1 Inexact Rounded +quax131 quantize 1.05 1e0 -> 1 Inexact Rounded +quax132 quantize 1.06 1e-3 -> 1.060 +quax133 quantize 1.06 1e-2 -> 1.06 +quax134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded +quax135 quantize 1.06 1e0 -> 1 Inexact Rounded + +quax140 quantize -10 1e-2 -> -10.00 +quax141 quantize +1 1e-2 -> 1.00 +quax142 quantize +10 1e-2 -> 10.00 +quax143 quantize 1E+10 1e-2 -> NaN Invalid_operation +quax144 quantize 1E-10 1e-2 -> 0.00 Inexact Rounded +quax145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded +quax146 quantize 1E-2 1e-2 -> 0.01 +quax147 quantize 1E-1 1e-2 -> 0.10 +quax148 quantize 0E-10 1e-2 -> 0.00 + +quax150 quantize 1.0600 1e-5 -> 1.06000 +quax151 quantize 1.0600 1e-4 -> 1.0600 +quax152 quantize 1.0600 1e-3 -> 1.060 Rounded +quax153 quantize 1.0600 1e-2 -> 1.06 Rounded +quax154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded +quax155 quantize 1.0600 1e0 -> 1 Inexact Rounded + +-- base tests with non-1 coefficients +quax161 quantize 0 -9e0 -> 0 +quax162 quantize 1 -7e0 -> 1 +quax163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded +quax165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded +quax166 quantize 0.1 2e0 -> 0 Inexact Rounded +quax167 quantize 0.1 3e-1 -> 0.1 +quax168 quantize 0.1 44e-2 -> 0.10 +quax169 quantize 0.1 555e-3 -> 0.100 +quax170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded +quax171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded +quax172 quantize 0.9 -88e+0 -> 1 Inexact Rounded +quax173 quantize 0.9 -9e-1 -> 0.9 +quax174 quantize 0.9 0e-2 -> 0.90 +quax175 quantize 0.9 1.1e-3 -> 0.9000 +-- negatives +quax181 quantize -0 1.1e0 -> -0.0 +quax182 quantize -1 -1e0 -> -1 +quax183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded +quax185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded +quax186 quantize -0.1 71e0 -> -0 Inexact Rounded +quax187 quantize -0.1 -91e-1 -> -0.1 +quax188 quantize -0.1 -.1e-2 -> -0.100 +quax189 quantize -0.1 -1e-3 -> -0.100 +quax190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded +quax191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded +quax192 quantize -0.9 -10e+0 -> -1 Inexact Rounded +quax193 quantize -0.9 100e-1 -> -0.9 +quax194 quantize -0.9 999e-2 -> -0.90 + +-- +ve exponents .. +quax201 quantize -1 1e+0 -> -1 +quax202 quantize -1 1e+1 -> -0E+1 Inexact Rounded +quax203 quantize -1 1e+2 -> -0E+2 Inexact Rounded +quax204 quantize 0 1e+0 -> 0 +quax205 quantize 0 1e+1 -> 0E+1 +quax206 quantize 0 1e+2 -> 0E+2 +quax207 quantize +1 1e+0 -> 1 +quax208 quantize +1 1e+1 -> 0E+1 Inexact Rounded +quax209 quantize +1 1e+2 -> 0E+2 Inexact Rounded + +quax220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded +quax221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded +quax222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded +quax223 quantize 1.04 1e+0 -> 1 Inexact Rounded +quax224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +quax225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +quax226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +quax227 quantize 1.05 1e+0 -> 1 Inexact Rounded +quax228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +quax229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +quax230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +quax231 quantize 1.05 1e+0 -> 1 Inexact Rounded +quax232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded +quax233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded +quax234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded +quax235 quantize 1.06 1e+0 -> 1 Inexact Rounded + +quax240 quantize -10 1e+1 -> -1E+1 Rounded +quax241 quantize +1 1e+1 -> 0E+1 Inexact Rounded +quax242 quantize +10 1e+1 -> 1E+1 Rounded +quax243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1 +quax244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1 +quax245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1 +quax246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1 +quax247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1 +quax248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1 +quax249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1 +quax250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1 +quax251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1 +-- next one tries to add 9 zeros +quax252 quantize 1E+10 1e+1 -> NaN Invalid_operation +quax253 quantize 1E-10 1e+1 -> 0E+1 Inexact Rounded +quax254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded +quax255 quantize 0E-10 1e+1 -> 0E+1 +quax256 quantize -0E-10 1e+1 -> -0E+1 +quax257 quantize -0E-1 1e+1 -> -0E+1 +quax258 quantize -0 1e+1 -> -0E+1 +quax259 quantize -0E+1 1e+1 -> -0E+1 + +quax260 quantize -10 1e+2 -> -0E+2 Inexact Rounded +quax261 quantize +1 1e+2 -> 0E+2 Inexact Rounded +quax262 quantize +10 1e+2 -> 0E+2 Inexact Rounded +quax263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded +quax264 quantize 1E+2 1e+2 -> 1E+2 +quax265 quantize 1E+3 1e+2 -> 1.0E+3 +quax266 quantize 1E+4 1e+2 -> 1.00E+4 +quax267 quantize 1E+5 1e+2 -> 1.000E+5 +quax268 quantize 1E+6 1e+2 -> 1.0000E+6 +quax269 quantize 1E+7 1e+2 -> 1.00000E+7 +quax270 quantize 1E+8 1e+2 -> 1.000000E+8 +quax271 quantize 1E+9 1e+2 -> 1.0000000E+9 +quax272 quantize 1E+10 1e+2 -> 1.00000000E+10 +quax273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded +quax274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded +quax275 quantize 0E-10 1e+2 -> 0E+2 + +quax280 quantize -10 1e+3 -> -0E+3 Inexact Rounded +quax281 quantize +1 1e+3 -> 0E+3 Inexact Rounded +quax282 quantize +10 1e+3 -> 0E+3 Inexact Rounded +quax283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded +quax284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded +quax285 quantize 1E+3 1e+3 -> 1E+3 +quax286 quantize 1E+4 1e+3 -> 1.0E+4 +quax287 quantize 1E+5 1e+3 -> 1.00E+5 +quax288 quantize 1E+6 1e+3 -> 1.000E+6 +quax289 quantize 1E+7 1e+3 -> 1.0000E+7 +quax290 quantize 1E+8 1e+3 -> 1.00000E+8 +quax291 quantize 1E+9 1e+3 -> 1.000000E+9 +quax292 quantize 1E+10 1e+3 -> 1.0000000E+10 +quax293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded +quax294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded +quax295 quantize 0E-10 1e+3 -> 0E+3 + +-- round up from below [sign wrong in JIT compiler once] +quax300 quantize 0.0078 1e-5 -> 0.00780 +quax301 quantize 0.0078 1e-4 -> 0.0078 +quax302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded +quax303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded +quax304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded +quax305 quantize 0.0078 1e0 -> 0 Inexact Rounded +quax306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded +quax307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded + +quax310 quantize -0.0078 1e-5 -> -0.00780 +quax311 quantize -0.0078 1e-4 -> -0.0078 +quax312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded +quax313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded +quax314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded +quax315 quantize -0.0078 1e0 -> -0 Inexact Rounded +quax316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded +quax317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded + +quax320 quantize 0.078 1e-5 -> 0.07800 +quax321 quantize 0.078 1e-4 -> 0.0780 +quax322 quantize 0.078 1e-3 -> 0.078 +quax323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded +quax324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded +quax325 quantize 0.078 1e0 -> 0 Inexact Rounded +quax326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded +quax327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded + +quax330 quantize -0.078 1e-5 -> -0.07800 +quax331 quantize -0.078 1e-4 -> -0.0780 +quax332 quantize -0.078 1e-3 -> -0.078 +quax333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded +quax334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded +quax335 quantize -0.078 1e0 -> -0 Inexact Rounded +quax336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded +quax337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded + +quax340 quantize 0.78 1e-5 -> 0.78000 +quax341 quantize 0.78 1e-4 -> 0.7800 +quax342 quantize 0.78 1e-3 -> 0.780 +quax343 quantize 0.78 1e-2 -> 0.78 +quax344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded +quax345 quantize 0.78 1e0 -> 1 Inexact Rounded +quax346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded +quax347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded + +quax350 quantize -0.78 1e-5 -> -0.78000 +quax351 quantize -0.78 1e-4 -> -0.7800 +quax352 quantize -0.78 1e-3 -> -0.780 +quax353 quantize -0.78 1e-2 -> -0.78 +quax354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded +quax355 quantize -0.78 1e0 -> -1 Inexact Rounded +quax356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded +quax357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded + +quax360 quantize 7.8 1e-5 -> 7.80000 +quax361 quantize 7.8 1e-4 -> 7.8000 +quax362 quantize 7.8 1e-3 -> 7.800 +quax363 quantize 7.8 1e-2 -> 7.80 +quax364 quantize 7.8 1e-1 -> 7.8 +quax365 quantize 7.8 1e0 -> 8 Inexact Rounded +quax366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded +quax367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded +quax368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded + +quax370 quantize -7.8 1e-5 -> -7.80000 +quax371 quantize -7.8 1e-4 -> -7.8000 +quax372 quantize -7.8 1e-3 -> -7.800 +quax373 quantize -7.8 1e-2 -> -7.80 +quax374 quantize -7.8 1e-1 -> -7.8 +quax375 quantize -7.8 1e0 -> -8 Inexact Rounded +quax376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded +quax377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded +quax378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded + +-- some individuals +precision: 9 +quax380 quantize 352364.506 1e-2 -> 352364.51 Inexact Rounded +quax381 quantize 3523645.06 1e-2 -> 3523645.06 +quax382 quantize 35236450.6 1e-2 -> NaN Invalid_operation +quax383 quantize 352364506 1e-2 -> NaN Invalid_operation +quax384 quantize -352364.506 1e-2 -> -352364.51 Inexact Rounded +quax385 quantize -3523645.06 1e-2 -> -3523645.06 +quax386 quantize -35236450.6 1e-2 -> NaN Invalid_operation +quax387 quantize -352364506 1e-2 -> NaN Invalid_operation + +rounding: down +quax389 quantize 35236450.6 1e-2 -> NaN Invalid_operation +-- ? should that one instead have been: +-- quax389 quantize 35236450.6 1e-2 -> NaN Invalid_operation +rounding: half_up + +-- and a few more from e-mail discussions +precision: 7 +quax391 quantize 12.34567 1e-3 -> 12.346 Inexact Rounded +quax392 quantize 123.4567 1e-3 -> 123.457 Inexact Rounded +quax393 quantize 1234.567 1e-3 -> 1234.567 +quax394 quantize 12345.67 1e-3 -> NaN Invalid_operation +quax395 quantize 123456.7 1e-3 -> NaN Invalid_operation +quax396 quantize 1234567. 1e-3 -> NaN Invalid_operation + +-- some 9999 round-up cases +precision: 9 +quax400 quantize 9.999 1e-5 -> 9.99900 +quax401 quantize 9.999 1e-4 -> 9.9990 +quax402 quantize 9.999 1e-3 -> 9.999 +quax403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded +quax404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded +quax405 quantize 9.999 1e0 -> 10 Inexact Rounded +quax406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded +quax407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded + +quax410 quantize 0.999 1e-5 -> 0.99900 +quax411 quantize 0.999 1e-4 -> 0.9990 +quax412 quantize 0.999 1e-3 -> 0.999 +quax413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded +quax414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded +quax415 quantize 0.999 1e0 -> 1 Inexact Rounded +quax416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded + +quax420 quantize 0.0999 1e-5 -> 0.09990 +quax421 quantize 0.0999 1e-4 -> 0.0999 +quax422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded +quax423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded +quax424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded +quax425 quantize 0.0999 1e0 -> 0 Inexact Rounded +quax426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded + +quax430 quantize 0.00999 1e-5 -> 0.00999 +quax431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded +quax432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded +quax433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded +quax434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded +quax435 quantize 0.00999 1e0 -> 0 Inexact Rounded +quax436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded + +quax440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded +quax441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded +quax442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded +quax443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded +quax444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded +quax445 quantize 0.000999 1e0 -> 0 Inexact Rounded +quax446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded + +precision: 8 +quax449 quantize 9.999E-15 1e-23 -> NaN Invalid_operation +quax450 quantize 9.999E-15 1e-22 -> 9.9990000E-15 +quax451 quantize 9.999E-15 1e-21 -> 9.999000E-15 +quax452 quantize 9.999E-15 1e-20 -> 9.99900E-15 +quax453 quantize 9.999E-15 1e-19 -> 9.9990E-15 +quax454 quantize 9.999E-15 1e-18 -> 9.999E-15 +quax455 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded +quax456 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax457 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax458 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax459 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax460 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax461 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax462 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax463 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax464 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax465 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax466 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax467 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax468 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax469 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax470 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax471 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax472 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax473 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +precision: 7 +quax900 quantize 9.999E-15 1e-22 -> NaN Invalid_operation +quax901 quantize 9.999E-15 1e-21 -> 9.999000E-15 +quax902 quantize 9.999E-15 1e-20 -> 9.99900E-15 +quax903 quantize 9.999E-15 1e-19 -> 9.9990E-15 +quax904 quantize 9.999E-15 1e-18 -> 9.999E-15 +quax905 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded +quax906 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax907 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax908 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax909 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax910 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax911 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax912 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax913 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax914 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax915 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax916 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax917 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax918 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax919 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax920 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax921 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax922 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax923 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +precision: 6 +quax930 quantize 9.999E-15 1e-22 -> NaN Invalid_operation +quax931 quantize 9.999E-15 1e-21 -> NaN Invalid_operation +quax932 quantize 9.999E-15 1e-20 -> 9.99900E-15 +quax933 quantize 9.999E-15 1e-19 -> 9.9990E-15 +quax934 quantize 9.999E-15 1e-18 -> 9.999E-15 +quax935 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded +quax936 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax937 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax938 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax939 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax940 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax941 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax942 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax943 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax944 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax945 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax946 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax947 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax948 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax949 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax950 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax951 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax952 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax953 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +precision: 3 +quax960 quantize 9.999E-15 1e-22 -> NaN Invalid_operation +quax961 quantize 9.999E-15 1e-21 -> NaN Invalid_operation +quax962 quantize 9.999E-15 1e-20 -> NaN Invalid_operation +quax963 quantize 9.999E-15 1e-19 -> NaN Invalid_operation +quax964 quantize 9.999E-15 1e-18 -> NaN Invalid_operation +quax965 quantize 9.999E-15 1e-17 -> NaN Invalid_operation +quax966 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax967 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax968 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax969 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax970 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax971 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax972 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax973 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax974 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax975 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax976 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax977 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax978 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax979 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax980 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax981 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax982 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax983 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +-- Fung Lee's case & similar +precision: 3 +quax1001 quantize 0.000 0.001 -> 0.000 +quax1002 quantize 0.001 0.001 -> 0.001 +quax1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded +quax1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded +quax1005 quantize 0.501 0.001 -> 0.501 +quax1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded +quax1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded +quax1008 quantize 0.999 0.001 -> 0.999 +quax1009 quantize 0.9992 0.001 -> 0.999 Inexact Rounded +quax1010 quantize 0.9998 0.001 -> NaN Invalid_operation +quax1011 quantize 1.0001 0.001 -> NaN Invalid_operation +quax1012 quantize 1.0051 0.001 -> NaN Invalid_operation +quax1013 quantize 1.0551 0.001 -> NaN Invalid_operation +quax1014 quantize 1.5551 0.001 -> NaN Invalid_operation +quax1015 quantize 1.9999 0.001 -> NaN Invalid_operation + +-- long operand checks [rhs checks removed] +maxexponent: 999 +minexponent: -999 +precision: 9 +quax481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +quax482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +quax483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +quax484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +quax485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +quax486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +-- a potential double-round +quax487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +quax488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +precision: 15 +quax491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +quax492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +quax493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +quax494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +quax495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +quax496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +quax497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +quax498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +-- Zeros +quax500 quantize 0 1e1 -> 0E+1 +quax501 quantize 0 1e0 -> 0 +quax502 quantize 0 1e-1 -> 0.0 +quax503 quantize 0.0 1e-1 -> 0.0 +quax504 quantize 0.0 1e0 -> 0 +quax505 quantize 0.0 1e+1 -> 0E+1 +quax506 quantize 0E+1 1e-1 -> 0.0 +quax507 quantize 0E+1 1e0 -> 0 +quax508 quantize 0E+1 1e+1 -> 0E+1 +quax509 quantize -0 1e1 -> -0E+1 +quax510 quantize -0 1e0 -> -0 +quax511 quantize -0 1e-1 -> -0.0 +quax512 quantize -0.0 1e-1 -> -0.0 +quax513 quantize -0.0 1e0 -> -0 +quax514 quantize -0.0 1e+1 -> -0E+1 +quax515 quantize -0E+1 1e-1 -> -0.0 +quax516 quantize -0E+1 1e0 -> -0 +quax517 quantize -0E+1 1e+1 -> -0E+1 + +-- Suspicious RHS values +maxexponent: 999999999 +minexponent: -999999999 +precision: 15 +quax520 quantize 1.234 1e999999000 -> 0E+999999000 Inexact Rounded +quax521 quantize 123.456 1e999999000 -> 0E+999999000 Inexact Rounded +quax522 quantize 1.234 1e999999999 -> 0E+999999999 Inexact Rounded +quax523 quantize 123.456 1e999999999 -> 0E+999999999 Inexact Rounded +quax524 quantize 123.456 1e1000000000 -> NaN Invalid_operation +quax525 quantize 123.456 1e12345678903 -> NaN Invalid_operation +-- next four are "won't fit" overflows +quax526 quantize 1.234 1e-999999000 -> NaN Invalid_operation +quax527 quantize 123.456 1e-999999000 -> NaN Invalid_operation +quax528 quantize 1.234 1e-999999999 -> NaN Invalid_operation +quax529 quantize 123.456 1e-999999999 -> NaN Invalid_operation +quax530 quantize 123.456 1e-1000000014 -> NaN Invalid_operation +quax531 quantize 123.456 1e-12345678903 -> NaN Invalid_operation + +maxexponent: 999 +minexponent: -999 +precision: 15 +quax532 quantize 1.234E+999 1e999 -> 1E+999 Inexact Rounded +quax533 quantize 1.234E+998 1e999 -> 0E+999 Inexact Rounded +quax534 quantize 1.234 1e999 -> 0E+999 Inexact Rounded +quax535 quantize 1.234 1e1000 -> NaN Invalid_operation +quax536 quantize 1.234 1e5000 -> NaN Invalid_operation +quax537 quantize 0 1e-999 -> 0E-999 +-- next two are "won't fit" overflows +quax538 quantize 1.234 1e-999 -> NaN Invalid_operation +quax539 quantize 1.234 1e-1000 -> NaN Invalid_operation +quax540 quantize 1.234 1e-5000 -> NaN Invalid_operation +-- [more below] + +-- check bounds (lhs maybe out of range for destination, etc.) +precision: 7 +quax541 quantize 1E+999 1e+999 -> 1E+999 +quax542 quantize 1E+1000 1e+999 -> NaN Invalid_operation +quax543 quantize 1E+999 1e+1000 -> NaN Invalid_operation +quax544 quantize 1E-999 1e-999 -> 1E-999 +quax545 quantize 1E-1000 1e-999 -> 0E-999 Inexact Rounded +quax546 quantize 1E-999 1e-1000 -> 1.0E-999 +quax547 quantize 1E-1005 1e-999 -> 0E-999 Inexact Rounded +quax548 quantize 1E-1006 1e-999 -> 0E-999 Inexact Rounded +quax549 quantize 1E-1007 1e-999 -> 0E-999 Inexact Rounded +quax550 quantize 1E-998 1e-1005 -> NaN Invalid_operation -- won't fit +quax551 quantize 1E-999 1e-1005 -> 1.000000E-999 +quax552 quantize 1E-1000 1e-1005 -> 1.00000E-1000 Subnormal +quax553 quantize 1E-999 1e-1006 -> NaN Invalid_operation +quax554 quantize 1E-999 1e-1007 -> NaN Invalid_operation +-- related subnormal rounding +quax555 quantize 1.666666E-999 1e-1005 -> 1.666666E-999 +quax556 quantize 1.666666E-1000 1e-1005 -> 1.66667E-1000 Subnormal Inexact Rounded +quax557 quantize 1.666666E-1001 1e-1005 -> 1.6667E-1001 Subnormal Inexact Rounded +quax558 quantize 1.666666E-1002 1e-1005 -> 1.667E-1002 Subnormal Inexact Rounded +quax559 quantize 1.666666E-1003 1e-1005 -> 1.67E-1003 Subnormal Inexact Rounded +quax560 quantize 1.666666E-1004 1e-1005 -> 1.7E-1004 Subnormal Inexact Rounded +quax561 quantize 1.666666E-1005 1e-1005 -> 2E-1005 Subnormal Inexact Rounded +quax562 quantize 1.666666E-1006 1e-1005 -> 0E-1005 Inexact Rounded +quax563 quantize 1.666666E-1007 1e-1005 -> 0E-1005 Inexact Rounded + +-- Specials +quax580 quantize Inf -Inf -> Infinity +quax581 quantize Inf 1e-1000 -> NaN Invalid_operation +quax582 quantize Inf 1e-1 -> NaN Invalid_operation +quax583 quantize Inf 1e0 -> NaN Invalid_operation +quax584 quantize Inf 1e1 -> NaN Invalid_operation +quax585 quantize Inf 1e1000 -> NaN Invalid_operation +quax586 quantize Inf Inf -> Infinity +quax587 quantize -1000 Inf -> NaN Invalid_operation +quax588 quantize -Inf Inf -> -Infinity +quax589 quantize -1 Inf -> NaN Invalid_operation +quax590 quantize 0 Inf -> NaN Invalid_operation +quax591 quantize 1 Inf -> NaN Invalid_operation +quax592 quantize 1000 Inf -> NaN Invalid_operation +quax593 quantize Inf Inf -> Infinity +quax594 quantize Inf 1e-0 -> NaN Invalid_operation +quax595 quantize -0 Inf -> NaN Invalid_operation + +quax600 quantize -Inf -Inf -> -Infinity +quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation +quax602 quantize -Inf 1e-1 -> NaN Invalid_operation +quax603 quantize -Inf 1e0 -> NaN Invalid_operation +quax604 quantize -Inf 1e1 -> NaN Invalid_operation +quax605 quantize -Inf 1e1000 -> NaN Invalid_operation +quax606 quantize -Inf Inf -> -Infinity +quax607 quantize -1000 Inf -> NaN Invalid_operation +quax608 quantize -Inf -Inf -> -Infinity +quax609 quantize -1 -Inf -> NaN Invalid_operation +quax610 quantize 0 -Inf -> NaN Invalid_operation +quax611 quantize 1 -Inf -> NaN Invalid_operation +quax612 quantize 1000 -Inf -> NaN Invalid_operation +quax613 quantize Inf -Inf -> Infinity +quax614 quantize -Inf 1e-0 -> NaN Invalid_operation +quax615 quantize -0 -Inf -> NaN Invalid_operation + +quax621 quantize NaN -Inf -> NaN +quax622 quantize NaN 1e-1000 -> NaN +quax623 quantize NaN 1e-1 -> NaN +quax624 quantize NaN 1e0 -> NaN +quax625 quantize NaN 1e1 -> NaN +quax626 quantize NaN 1e1000 -> NaN +quax627 quantize NaN Inf -> NaN +quax628 quantize NaN NaN -> NaN +quax629 quantize -Inf NaN -> NaN +quax630 quantize -1000 NaN -> NaN +quax631 quantize -1 NaN -> NaN +quax632 quantize 0 NaN -> NaN +quax633 quantize 1 NaN -> NaN +quax634 quantize 1000 NaN -> NaN +quax635 quantize Inf NaN -> NaN +quax636 quantize NaN 1e-0 -> NaN +quax637 quantize -0 NaN -> NaN + +quax641 quantize sNaN -Inf -> NaN Invalid_operation +quax642 quantize sNaN 1e-1000 -> NaN Invalid_operation +quax643 quantize sNaN 1e-1 -> NaN Invalid_operation +quax644 quantize sNaN 1e0 -> NaN Invalid_operation +quax645 quantize sNaN 1e1 -> NaN Invalid_operation +quax646 quantize sNaN 1e1000 -> NaN Invalid_operation +quax647 quantize sNaN NaN -> NaN Invalid_operation +quax648 quantize sNaN sNaN -> NaN Invalid_operation +quax649 quantize NaN sNaN -> NaN Invalid_operation +quax650 quantize -Inf sNaN -> NaN Invalid_operation +quax651 quantize -1000 sNaN -> NaN Invalid_operation +quax652 quantize -1 sNaN -> NaN Invalid_operation +quax653 quantize 0 sNaN -> NaN Invalid_operation +quax654 quantize 1 sNaN -> NaN Invalid_operation +quax655 quantize 1000 sNaN -> NaN Invalid_operation +quax656 quantize Inf sNaN -> NaN Invalid_operation +quax657 quantize NaN sNaN -> NaN Invalid_operation +quax658 quantize sNaN 1e-0 -> NaN Invalid_operation +quax659 quantize -0 sNaN -> NaN Invalid_operation + +-- propagating NaNs +quax661 quantize NaN9 -Inf -> NaN9 +quax662 quantize NaN8 919 -> NaN8 +quax663 quantize NaN71 Inf -> NaN71 +quax664 quantize NaN6 NaN5 -> NaN6 +quax665 quantize -Inf NaN4 -> NaN4 +quax666 quantize -919 NaN31 -> NaN31 +quax667 quantize Inf NaN2 -> NaN2 + +quax671 quantize sNaN99 -Inf -> NaN99 Invalid_operation +quax672 quantize sNaN98 -11 -> NaN98 Invalid_operation +quax673 quantize sNaN97 NaN -> NaN97 Invalid_operation +quax674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation +quax675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation +quax676 quantize -Inf sNaN92 -> NaN92 Invalid_operation +quax677 quantize 088 sNaN91 -> NaN91 Invalid_operation +quax678 quantize Inf sNaN90 -> NaN90 Invalid_operation +quax679 quantize NaN sNaN88 -> NaN88 Invalid_operation + +quax681 quantize -NaN9 -Inf -> -NaN9 +quax682 quantize -NaN8 919 -> -NaN8 +quax683 quantize -NaN71 Inf -> -NaN71 +quax684 quantize -NaN6 -NaN5 -> -NaN6 +quax685 quantize -Inf -NaN4 -> -NaN4 +quax686 quantize -919 -NaN31 -> -NaN31 +quax687 quantize Inf -NaN2 -> -NaN2 + +quax691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation +quax692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation +quax693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation +quax694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation +quax695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation +quax696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation +quax697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation +quax698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation +quax699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation + +-- subnormals and underflow +precision: 4 +maxexponent: 999 +minexponent: -999 +quax710 quantize 1.00E-999 1e-999 -> 1E-999 Rounded +quax711 quantize 0.1E-999 2e-1000 -> 1E-1000 Subnormal +quax712 quantize 0.10E-999 3e-1000 -> 1E-1000 Subnormal Rounded +quax713 quantize 0.100E-999 4e-1000 -> 1E-1000 Subnormal Rounded +quax714 quantize 0.01E-999 5e-1001 -> 1E-1001 Subnormal +-- next is rounded to Emin +quax715 quantize 0.999E-999 1e-999 -> 1E-999 Inexact Rounded +quax716 quantize 0.099E-999 10e-1000 -> 1E-1000 Inexact Rounded Subnormal + +quax717 quantize 0.009E-999 1e-1001 -> 1E-1001 Inexact Rounded Subnormal +quax718 quantize 0.001E-999 1e-1001 -> 0E-1001 Inexact Rounded +quax719 quantize 0.0009E-999 1e-1001 -> 0E-1001 Inexact Rounded +quax720 quantize 0.0001E-999 1e-1001 -> 0E-1001 Inexact Rounded + +quax730 quantize -1.00E-999 1e-999 -> -1E-999 Rounded +quax731 quantize -0.1E-999 1e-999 -> -0E-999 Rounded Inexact +quax732 quantize -0.10E-999 1e-999 -> -0E-999 Rounded Inexact +quax733 quantize -0.100E-999 1e-999 -> -0E-999 Rounded Inexact +quax734 quantize -0.01E-999 1e-999 -> -0E-999 Inexact Rounded +-- next is rounded to Emin +quax735 quantize -0.999E-999 90e-999 -> -1E-999 Inexact Rounded +quax736 quantize -0.099E-999 -1e-999 -> -0E-999 Inexact Rounded +quax737 quantize -0.009E-999 -1e-999 -> -0E-999 Inexact Rounded +quax738 quantize -0.001E-999 -0e-999 -> -0E-999 Inexact Rounded +quax739 quantize -0.0001E-999 0e-999 -> -0E-999 Inexact Rounded + +quax740 quantize -1.00E-999 1e-1000 -> -1.0E-999 Rounded +quax741 quantize -0.1E-999 1e-1000 -> -1E-1000 Subnormal +quax742 quantize -0.10E-999 1e-1000 -> -1E-1000 Subnormal Rounded +quax743 quantize -0.100E-999 1e-1000 -> -1E-1000 Subnormal Rounded +quax744 quantize -0.01E-999 1e-1000 -> -0E-1000 Inexact Rounded +-- next is rounded to Emin +quax745 quantize -0.999E-999 1e-1000 -> -1.0E-999 Inexact Rounded +quax746 quantize -0.099E-999 1e-1000 -> -1E-1000 Inexact Rounded Subnormal +quax747 quantize -0.009E-999 1e-1000 -> -0E-1000 Inexact Rounded +quax748 quantize -0.001E-999 1e-1000 -> -0E-1000 Inexact Rounded +quax749 quantize -0.0001E-999 1e-1000 -> -0E-1000 Inexact Rounded + +quax750 quantize -1.00E-999 1e-1001 -> -1.00E-999 +quax751 quantize -0.1E-999 1e-1001 -> -1.0E-1000 Subnormal +quax752 quantize -0.10E-999 1e-1001 -> -1.0E-1000 Subnormal +quax753 quantize -0.100E-999 1e-1001 -> -1.0E-1000 Subnormal Rounded +quax754 quantize -0.01E-999 1e-1001 -> -1E-1001 Subnormal +-- next is rounded to Emin +quax755 quantize -0.999E-999 1e-1001 -> -1.00E-999 Inexact Rounded +quax756 quantize -0.099E-999 1e-1001 -> -1.0E-1000 Inexact Rounded Subnormal +quax757 quantize -0.009E-999 1e-1001 -> -1E-1001 Inexact Rounded Subnormal +quax758 quantize -0.001E-999 1e-1001 -> -0E-1001 Inexact Rounded +quax759 quantize -0.0001E-999 1e-1001 -> -0E-1001 Inexact Rounded + +quax760 quantize -1.00E-999 1e-1002 -> -1.000E-999 +quax761 quantize -0.1E-999 1e-1002 -> -1.00E-1000 Subnormal +quax762 quantize -0.10E-999 1e-1002 -> -1.00E-1000 Subnormal +quax763 quantize -0.100E-999 1e-1002 -> -1.00E-1000 Subnormal +quax764 quantize -0.01E-999 1e-1002 -> -1.0E-1001 Subnormal +quax765 quantize -0.999E-999 1e-1002 -> -9.99E-1000 Subnormal +quax766 quantize -0.099E-999 1e-1002 -> -9.9E-1001 Subnormal +quax767 quantize -0.009E-999 1e-1002 -> -9E-1002 Subnormal +quax768 quantize -0.001E-999 1e-1002 -> -1E-1002 Subnormal +quax769 quantize -0.0001E-999 1e-1002 -> -0E-1002 Inexact Rounded + +-- rhs must be no less than Etiny +quax770 quantize -1.00E-999 1e-1003 -> NaN Invalid_operation +quax771 quantize -0.1E-999 1e-1003 -> NaN Invalid_operation +quax772 quantize -0.10E-999 1e-1003 -> NaN Invalid_operation +quax773 quantize -0.100E-999 1e-1003 -> NaN Invalid_operation +quax774 quantize -0.01E-999 1e-1003 -> NaN Invalid_operation +quax775 quantize -0.999E-999 1e-1003 -> NaN Invalid_operation +quax776 quantize -0.099E-999 1e-1003 -> NaN Invalid_operation +quax777 quantize -0.009E-999 1e-1003 -> NaN Invalid_operation +quax778 quantize -0.001E-999 1e-1003 -> NaN Invalid_operation +quax779 quantize -0.0001E-999 1e-1003 -> NaN Invalid_operation +quax780 quantize -0.0001E-999 1e-1004 -> NaN Invalid_operation + +precision: 9 +maxExponent: 999999999 +minexponent: -999999999 + +-- some extremes derived from Rescale testcases +quax801 quantize 0 1e1000000000 -> NaN Invalid_operation +quax802 quantize 0 1e-1000000000 -> 0E-1000000000 +quax803 quantize 0 1e2000000000 -> NaN Invalid_operation +quax804 quantize 0 1e-2000000000 -> NaN Invalid_operation +quax805 quantize 0 1e3000000000 -> NaN Invalid_operation +quax806 quantize 0 1e-3000000000 -> NaN Invalid_operation +quax807 quantize 0 1e4000000000 -> NaN Invalid_operation +quax808 quantize 0 1e-4000000000 -> NaN Invalid_operation +quax809 quantize 0 1e5000000000 -> NaN Invalid_operation +quax810 quantize 0 1e-5000000000 -> NaN Invalid_operation +quax811 quantize 0 1e6000000000 -> NaN Invalid_operation +quax812 quantize 0 1e-6000000000 -> NaN Invalid_operation +quax813 quantize 0 1e7000000000 -> NaN Invalid_operation +quax814 quantize 0 1e-7000000000 -> NaN Invalid_operation +quax815 quantize 0 1e8000000000 -> NaN Invalid_operation +quax816 quantize 0 1e-8000000000 -> NaN Invalid_operation +quax817 quantize 0 1e9000000000 -> NaN Invalid_operation +quax818 quantize 0 1e-9000000000 -> NaN Invalid_operation +quax819 quantize 0 1e9999999999 -> NaN Invalid_operation +quax820 quantize 0 1e-9999999999 -> NaN Invalid_operation +quax821 quantize 0 1e10000000000 -> NaN Invalid_operation +quax822 quantize 0 1e-10000000000 -> NaN Invalid_operation + +quax843 quantize 0 1e999999999 -> 0E+999999999 +quax844 quantize 0 1e1000000000 -> NaN Invalid_operation +quax845 quantize 0 1e-999999999 -> 0E-999999999 +quax846 quantize 0 1e-1000000000 -> 0E-1000000000 +quax847 quantize 0 1e-1000000001 -> 0E-1000000001 +quax848 quantize 0 1e-1000000002 -> 0E-1000000002 +quax849 quantize 0 1e-1000000003 -> 0E-1000000003 +quax850 quantize 0 1e-1000000004 -> 0E-1000000004 +quax851 quantize 0 1e-1000000005 -> 0E-1000000005 +quax852 quantize 0 1e-1000000006 -> 0E-1000000006 +quax853 quantize 0 1e-1000000007 -> 0E-1000000007 +quax854 quantize 0 1e-1000000008 -> NaN Invalid_operation + +quax861 quantize 1 1e+2147483649 -> NaN Invalid_operation +quax862 quantize 1 1e+2147483648 -> NaN Invalid_operation +quax863 quantize 1 1e+2147483647 -> NaN Invalid_operation +quax864 quantize 1 1e-2147483647 -> NaN Invalid_operation +quax865 quantize 1 1e-2147483648 -> NaN Invalid_operation +quax866 quantize 1 1e-2147483649 -> NaN Invalid_operation + +-- More from Fung Lee +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 +quax1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384 +quax1022 quantize 64#8.666666666666000E+384 64#1.000000000000000E+384 -> 8.666666666666000E+384 +quax1023 quantize 64#8.666666666666000E+384 128#1.000000000000000E+384 -> 8.666666666666000E+384 +quax1024 quantize 64#8.666666666666000E+384 64#1E+384 -> 8.666666666666000E+384 +quax1025 quantize 64#8.666666666666000E+384 64#1E+384 -> 64#8.666666666666000E+384 +quax1026 quantize 64#8.666666666666000E+384 128#1E+384 -> 64#9E+384 Inexact Rounded Clamped +quax1027 quantize 64#8.666666666666000E+323 64#1E+31 -> NaN Invalid_operation +quax1028 quantize 64#8.666666666666000E+323 128#1E+31 -> NaN Invalid_operation +quax1029 quantize 64#8.66666666E+3 128#1E+10 -> 64#0E10 Inexact Rounded +quax1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded + +-- Int and uInt32 edge values for testing conversions +quax1040 quantize -2147483646 0 -> -2147483646 +quax1041 quantize -2147483647 0 -> -2147483647 +quax1042 quantize -2147483648 0 -> -2147483648 +quax1043 quantize -2147483649 0 -> -2147483649 +quax1044 quantize 2147483646 0 -> 2147483646 +quax1045 quantize 2147483647 0 -> 2147483647 +quax1046 quantize 2147483648 0 -> 2147483648 +quax1047 quantize 2147483649 0 -> 2147483649 +quax1048 quantize 4294967294 0 -> 4294967294 +quax1049 quantize 4294967295 0 -> 4294967295 +quax1050 quantize 4294967296 0 -> 4294967296 +quax1051 quantize 4294967297 0 -> 4294967297 +-- and powers of ten for same +quax1101 quantize 5000000000 0 -> 5000000000 +quax1102 quantize 4000000000 0 -> 4000000000 +quax1103 quantize 2000000000 0 -> 2000000000 +quax1104 quantize 1000000000 0 -> 1000000000 +quax1105 quantize 0100000000 0 -> 100000000 +quax1106 quantize 0010000000 0 -> 10000000 +quax1107 quantize 0001000000 0 -> 1000000 +quax1108 quantize 0000100000 0 -> 100000 +quax1109 quantize 0000010000 0 -> 10000 +quax1110 quantize 0000001000 0 -> 1000 +quax1111 quantize 0000000100 0 -> 100 +quax1112 quantize 0000000010 0 -> 10 +quax1113 quantize 0000000001 0 -> 1 +quax1114 quantize 0000000000 0 -> 0 +-- and powers of ten for same +quax1121 quantize -5000000000 0 -> -5000000000 +quax1122 quantize -4000000000 0 -> -4000000000 +quax1123 quantize -2000000000 0 -> -2000000000 +quax1124 quantize -1000000000 0 -> -1000000000 +quax1125 quantize -0100000000 0 -> -100000000 +quax1126 quantize -0010000000 0 -> -10000000 +quax1127 quantize -0001000000 0 -> -1000000 +quax1128 quantize -0000100000 0 -> -100000 +quax1129 quantize -0000010000 0 -> -10000 +quax1130 quantize -0000001000 0 -> -1000 +quax1131 quantize -0000000100 0 -> -100 +quax1132 quantize -0000000010 0 -> -10 +quax1133 quantize -0000000001 0 -> -1 +quax1134 quantize -0000000000 0 -> -0 + +-- Some miscellany +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- 1 2 3 +-- 1 234567890123456789012345678901234 +quax0a1 quantize 8.555555555555555555555555555555555E+6143 1E+6143 -> 9E+6143 Inexact Rounded +quax0a2 quantize 128#8.555555555555555555555555555555555E+6143 128#1E+6143 -> 8.55555555555555555555555555555556E+6143 Rounded Inexact +quax0a3 quantize 128#8.555555555555555555555555555555555E+6144 128#1E+6144 -> 8.555555555555555555555555555555555E+6144 + +-- payload decapitate +precision: 5 +quax62100 quantize 11 -sNaN1234567890 -> -NaN67890 Invalid_operation + +-- Null tests +quax998 quantize 10 # -> NaN Invalid_operation +quax999 quantize # 1e10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/randomBound32.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/randomBound32.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,2443 @@ +------------------------------------------------------------------------ +-- randomBound32.decTest -- decimal testcases -- boundaries near 32 -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- These testcases test calculations at precisions 31, 32, and 33, to +-- exercise the boundaries around 2**5 + +-- randomly generated testcases [26 Sep 2001] +extended: 1 +precision: 31 +rounding: half_up +maxExponent: 9999 +minexponent: -9999 + +addx3001 add 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 2.189320103965343717049307148600E+799 Inexact Rounded +comx3001 compare 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> -1 +divx3001 divide 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 2.262681764507965005284080800438E-787 Inexact Rounded +dvix3001 divideint 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 0 +mulx3001 multiply 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 1.084531091568672041923151632066E+812 Inexact Rounded +powx3001 power 4953734675913.065314738743322579 2 -> 24539487239343522246155890.99495 Inexact Rounded +remx3001 remainder 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 4953734675913.065314738743322579 +subx3001 subtract 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> -2.189320103965343717049307148600E+799 Inexact Rounded +addx3002 add 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -7.886453204712287484430980636798E+944 Inexact Rounded +comx3002 compare 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 1 +divx3002 divide 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -1.222562801441069667849402782716E-1785 Inexact Rounded +dvix3002 divideint 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -0 +mulx3002 multiply 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -7.603869223099928141659831589905E+104 Inexact Rounded +powx3002 power 9641.684323386955881595490347910E-844 -8 -> 1.338988152067180337738955757587E+6720 Inexact Rounded +remx3002 remainder 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 9.641684323386955881595490347910E-841 +subx3002 subtract 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 7.886453204712287484430980636798E+944 Inexact Rounded +addx3003 add -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1.028048571628326871054964307774E+529 Inexact Rounded +comx3003 compare -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1 +divx3003 divide -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -2.089529249946971482861843692465E+515 Inexact Rounded +dvix3003 divideint -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> NaN Division_impossible +mulx3003 multiply -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -5.057999861231255549283737861207E+542 Inexact Rounded +powx3003 power -1.028048571628326871054964307774E+529 5 -> -1.148333858253704284232780819739E+2645 Inexact Rounded +remx3003 remainder -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> NaN Division_impossible +subx3003 subtract -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1.028048571628326871054964307774E+529 Inexact Rounded +addx3004 add 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 84158050139.12535935915094076662 Inexact Rounded +comx3004 compare 479084.8561808930525417735205519 084157571054.2691784660983989931 -> -1 +divx3004 divide 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 0.000005692712493709617905493710207969 Inexact Rounded +dvix3004 divideint 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 0 +mulx3004 multiply 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 40318617825067837.47317700523687 Inexact Rounded +powx3004 power 479084.8561808930525417735205519 8 -> 2.775233598021235973545933045837E+45 Inexact Rounded +remx3004 remainder 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 479084.8561808930525417735205519 +subx3004 subtract 479084.8561808930525417735205519 084157571054.2691784660983989931 -> -84157091969.41299757304585721958 Inexact Rounded +addx3005 add -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -363753960.6547166697980414728370 Inexact Rounded +comx3005 compare -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -1 +divx3005 divide -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 114672.6064337420167096295290890 Inexact Rounded +dvix3005 divideint -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 114672 +mulx3005 multiply -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 1153846941331.188583292239230818 Inexact Rounded +powx3005 power -0363750788.573782205664349562931 -3172 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3005 remainder -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -1923.656911066945656824381431488 +subx3005 subtract -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -363747616.4928477415306576530250 Inexact Rounded +addx3006 add 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1381026551423669919010191878366 Inexact Rounded +comx3006 compare 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1 +divx3006 divide 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -16706071214613552377376639557.90 Inexact Rounded +dvix3006 divideint 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -16706071214613552377376639557 +mulx3006 multiply 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -1.141641449528127656560770057228E+32 Inexact Rounded +powx3006 power 1381026551423669919010191878449 -83 -> 2.307977908106564299925193011052E-2502 Inexact Rounded +remx3006 remainder 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 74.22115953553602036042168767377 +subx3006 subtract 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1381026551423669919010191878532 Inexact Rounded +addx3007 add 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -4410583128274.803057056669103177 Inexact Rounded +comx3007 compare 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 1 +divx3007 divide 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -1.049073743992404570569003129346E-9 Inexact Rounded +dvix3007 divideint 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -0 +mulx3007 multiply 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -20407887067124025.31576887565113 Inexact Rounded +powx3007 power 4627.026960423072127953556635585 -4 -> 2.181684167222334934221407781701E-15 Inexact Rounded +remx3007 remainder 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 4627.026960423072127953556635585 +subx3007 subtract 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 4410583137528.856977902813359085 Inexact Rounded +addx3008 add 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8684111695095849922187690616727 Inexact Rounded +comx3008 compare 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 1 +divx3008 divide 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8.677177026223536475531592432118E-21 Inexact Rounded +dvix3008 divideint 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -0 +mulx3008 multiply 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -6.543788575292743281456830701127E+41 Inexact Rounded +powx3008 power 75353574493.84484153484918212042 -9 -> 1.276630670287906925570645490707E-98 Inexact Rounded +remx3008 remainder 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 75353574493.84484153484918212042 +subx3008 subtract 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 8684111695095849922338397765715 Inexact Rounded +addx3009 add 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907061.073440802792400108035410 Inexact Rounded +comx3009 compare 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 1 +divx3009 divide 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 2417586.646146283856436864121104 Inexact Rounded +dvix3009 divideint 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 2417586 +mulx3009 multiply 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 19733502.94653326211623698034717 Inexact Rounded +powx3009 power 6907058.216435355874729592373011 3 -> 329518156646369505494.8971353240 Inexact Rounded +remx3009 remainder 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 1.846043452483451396449034189630 +subx3009 subtract 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907055.359429908957059076710612 Inexact Rounded +addx3010 add -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -38949530427253.24030680468677190 Inexact Rounded +comx3010 compare -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -1 +divx3010 divide -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -5.469149031100999700489221122509E+996 Inexact Rounded +dvix3010 divideint -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> NaN Division_impossible +mulx3010 multiply -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -2.773861000818483769292240109417E-970 Inexact Rounded +powx3010 power -38949530427253.24030680468677190 7 -> -1.359926959823071332599817363877E+95 Inexact Rounded +remx3010 remainder -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> NaN Division_impossible +subx3010 subtract -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -38949530427253.24030680468677190 Inexact Rounded +addx3011 add -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -1270911.495819550779479954702829 Inexact Rounded +comx3011 compare -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -1 +divx3011 divide -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 1.258023449218665608349145394069 Inexact Rounded +dvix3011 divideint -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 1 +mulx3011 multiply -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 398531319444.8556128729086112205 Inexact Rounded +powx3011 power -0708069.025667471996378081482549 -562842 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3011 remainder -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -145226.5555153932132762082622686 +subx3011 subtract -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -145226.5555153932132762082622686 +addx3012 add 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -4.318314692189767383476104084575E+224 Inexact Rounded +comx3012 compare 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 1 +divx3012 divide 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -9.390439409913307906923909630247E-219 Inexact Rounded +dvix3012 divideint 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -0 +mulx3012 multiply 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -1.751114283680833039197637874453E+231 Inexact Rounded +powx3012 power 4055087.246994644709729942673976 -4 -> 3.698274893849241116195795515302E-27 Inexact Rounded +remx3012 remainder 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 4055087.246994644709729942673976 +subx3012 subtract 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 4.318314692189767383476104084575E+224 Inexact Rounded +addx3013 add 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -815.9047305921862348263521876034 Inexact Rounded +comx3013 compare 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 1 +divx3013 divide 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -5.518899111238367862234798433551E-503 Inexact Rounded +dvix3013 divideint 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -0 +mulx3013 multiply 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -3.673934060071516156604453756541E-497 Inexact Rounded +powx3013 power 4502895892520.396581348110906909E-512 -816 -> Infinity Overflow Inexact Rounded +remx3013 remainder 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 4.502895892520396581348110906909E-500 +subx3013 subtract 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 815.9047305921862348263521876034 Inexact Rounded +addx3014 add 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 465.6005787733070743275007572563 Inexact Rounded +comx3014 compare 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 1 +divx3014 divide 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -225.7594380101027705997496045999 Inexact Rounded +dvix3014 divideint 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -225 +mulx3014 multiply 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -968.8065431314121523074875069807 Inexact Rounded +powx3014 power 467.6721295072628100260239179865 -2 -> 0.000004572113694193221810609836080931 Inexact Rounded +remx3014 remainder 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 1.57321436722227785831275368025 +subx3014 subtract 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 469.7436802412185457245470787168 Inexact Rounded +addx3015 add 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -8677147.586389401682712180146855 Inexact Rounded +comx3015 compare 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 1 +divx3015 divide 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -2.485604044230163799604243529005E-578 Inexact Rounded +dvix3015 divideint 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -0 +mulx3015 multiply 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -1.871483124723381986272837942577E-564 Inexact Rounded +powx3015 power 2.156795313311150143949997552501E-571 -8677148 -> Infinity Overflow Inexact Rounded +remx3015 remainder 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 2.156795313311150143949997552501E-571 +subx3015 subtract 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 8677147.586389401682712180146855 Inexact Rounded +addx3016 add -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> -694070746.6469215276170700777068 Inexact Rounded +comx3016 compare -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 1 +divx3016 divide -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 0.001406664546942092941961075608769 Inexact Rounded +dvix3016 divideint -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 0 +mulx3016 multiply -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 675736017210596.9899587749991363 Inexact Rounded +powx3016 power -974953.2801637208368002585822457 -693095793 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3016 remainder -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> -974953.2801637208368002585822457 +subx3016 subtract -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 692120840.0865940859434695605424 Inexact Rounded +addx3017 add -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -7634680140009571846155654339781 Inexact Rounded +comx3017 compare -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -1 +divx3017 divide -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -2.536749610869326753741024659948E+508 Inexact Rounded +dvix3017 divideint -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> NaN Division_impossible +mulx3017 multiply -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -2.297756963892134373657544025107E-447 Inexact Rounded +powx3017 power -7634680140009571846155654339781 3 -> -4.450128382072157170207584847831E+92 Inexact Rounded +remx3017 remainder -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> NaN Division_impossible +subx3017 subtract -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -7634680140009571846155654339781 Inexact Rounded +addx3018 add 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 74177.21073338090843145838835480 Inexact Rounded +comx3018 compare 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> -1 +divx3018 divide 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 3.535762799545274329358292065343E-624 Inexact Rounded +dvix3018 divideint 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 0 +mulx3018 multiply 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 1.945468124372395349192665031675E-614 Inexact Rounded +powx3018 power 262273.0222851186523650889896428E-624 74177 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3018 remainder 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 2.622730222851186523650889896428E-619 +subx3018 subtract 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> -74177.21073338090843145838835480 Inexact Rounded +addx3019 add -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -8036052748815903177624783259089 Inexact Rounded +comx3019 compare -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -1 +divx3019 divide -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 120521464210387351732732.6271469 Inexact Rounded +dvix3019 divideint -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 120521464210387351732732 +mulx3019 multiply -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 5.358227615706800711033262124598E+38 Inexact Rounded +powx3019 power -8036052748815903177624716581732 -66677357 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3019 remainder -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -41816499.5048993028288978900564 +subx3019 subtract -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -8036052748815903177624649904375 Inexact Rounded +addx3020 add 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 8.834295928031498103637713570166E+770 Inexact Rounded +comx3020 compare 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 1 +divx3020 divide 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> -2.008754492913739633208672455025E+766 Inexact Rounded +dvix3020 divideint 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> NaN Division_impossible +mulx3020 multiply 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> -3.885232606540600490321438191516E+775 Inexact Rounded +powx3020 power 883429.5928031498103637713570166E+765 -43979 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3020 remainder 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> NaN Division_impossible +subx3020 subtract 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 8.834295928031498103637713570166E+770 Inexact Rounded +addx3021 add 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -5588536565419.943265474528122494 Inexact Rounded +comx3021 compare 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 1 +divx3021 divide 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -0.004416506865458415275182120038399 Inexact Rounded +dvix3021 divideint 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -0 +mulx3021 multiply 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -139161701088530765925120.8408852 Inexact Rounded +powx3021 power 24791301060.37938360567775506973 -6 -> 4.307289712375673028996126249656E-63 Inexact Rounded +remx3021 remainder 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 24791301060.37938360567775506973 +subx3021 subtract 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 5638119167540.702032685883632634 Inexact Rounded +addx3022 add -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -930712184.3335760878938383398937 Inexact Rounded +comx3022 compare -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -1 +divx3022 divide -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 1257062.290270583507131602958799 Inexact Rounded +dvix3022 divideint -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 1257062 +mulx3022 multiply -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 689085814282.3968746911100154133 Inexact Rounded +powx3022 power -930711443.9474781586162910776139 -740 -> 1.193603394165051899997226995178E-6637 Inexact Rounded +remx3022 remainder -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -214.9123046664996750639167712140 +subx3022 subtract -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -930710703.5613802293387438153341 Inexact Rounded +addx3023 add 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 2358276428979.423170691006252127 Inexact Rounded +comx3023 compare 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 1 +divx3023 divide 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 11001528525.07089502152736489473 Inexact Rounded +dvix3023 divideint 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 11001528525 +mulx3023 multiply 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 505517728904226.6233443209659001 Inexact Rounded +powx3023 power 2358276428765.064191082773385539 214 -> 5.435856480782850080741276939256E+2647 Inexact Rounded +remx3023 remainder 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 15.1969844739096415643561521775 +subx3023 subtract 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 2358276428550.705211474540518951 Inexact Rounded +addx3024 add -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.868744449795653651638308926987E+750 Inexact Rounded +comx3024 compare -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -1 +divx3024 divide -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -4.677779235812959233092739433453E+746 Inexact Rounded +dvix3024 divideint -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> NaN Division_impossible +mulx3024 multiply -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.199634455434813294426505526063E+754 Inexact Rounded +powx3024 power -3.868744449795653651638308926987E+750 8270 -> Infinity Overflow Inexact Rounded +remx3024 remainder -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> NaN Division_impossible +subx3024 subtract -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.868744449795653651638308926987E+750 Inexact Rounded +addx3025 add 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -567195652586.2454217069003186487 Inexact Rounded +comx3025 compare 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 1 +divx3025 divide 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -2.475725421131866851190640203633E-451 Inexact Rounded +dvix3025 divideint 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -0 +mulx3025 multiply 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -7.964678739652657498503799559950E-428 Inexact Rounded +powx3025 power 140422069.5863246490180206814374E-447 -6 -> 1.304330899731988395473578425854E+2633 Inexact Rounded +remx3025 remainder 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 1.404220695863246490180206814374E-439 +subx3025 subtract 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 567195652586.2454217069003186487 Inexact Rounded +addx3026 add 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -9.452601935038035195726041512900E+467 Inexact Rounded +comx3026 compare 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 1 +divx3026 divide 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -8.032613347885465805613265604973E-305 Inexact Rounded +dvix3026 divideint 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -0 +mulx3026 multiply 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -7.177275242712723733041569606882E+631 Inexact Rounded +powx3026 power 75929096475.63450425339472559646E+153 -9 -> 1.192136299657177324051477375561E-1475 Inexact Rounded +remx3026 remainder 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 7.592909647563450425339472559646E+163 +subx3026 subtract 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 9.452601935038035195726041512900E+467 Inexact Rounded +addx3027 add 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -5.641317823202274083982487558514E+637 Inexact Rounded +comx3027 compare 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 1 +divx3027 divide 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -1.118943925332481944765809682502E-628 Inexact Rounded +dvix3027 divideint 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -0 +mulx3027 multiply 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -3.560979378308906043783023726787E+647 Inexact Rounded +powx3027 power 6312318309.142044953357460463732 -6 -> 1.580762611512787720076533747265E-59 Inexact Rounded +remx3027 remainder 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 6312318309.142044953357460463732 +subx3027 subtract 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 5.641317823202274083982487558514E+637 Inexact Rounded +addx3028 add 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 93793652428100.52105928239469937 Inexact Rounded +comx3028 compare 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 1 +divx3028 divide 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 1.022544815694674972559924997256E+723 Inexact Rounded +dvix3028 divideint 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> NaN Division_impossible +mulx3028 multiply 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 8.603289656137796526769786965341E-696 Inexact Rounded +powx3028 power 93793652428100.52105928239469937 9 -> 5.617732206663136654187263964365E+125 Inexact Rounded +remx3028 remainder 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> NaN Division_impossible +subx3028 subtract 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 93793652428100.52105928239469937 Inexact Rounded +addx3029 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded +comx3029 compare 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1 +divx3029 divide 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -4103968.106336710126241266685434 Inexact Rounded +dvix3029 divideint 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -4103968 +mulx3029 multiply 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -2362732023235112.375960528304974 Inexact Rounded +powx3029 power 98471198160.56524417578665886060 -23994 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3029 remainder 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 2551.45824316125588493249246784 +subx3029 subtract 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471222154.70837811518409435005 Inexact Rounded +addx3030 add 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 329324100.9201858301191681987940 Inexact Rounded +comx3030 compare 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 1 +divx3030 divide 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -134358.6406732917173739187421978 Inexact Rounded +dvix3030 divideint 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -134358 +mulx3030 multiply 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -807212527028.0005401736893474430 Inexact Rounded +powx3030 power 329326552.0208398002250836592043 -2451 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3030 remainder 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 1570.35472430963565384668749322 +subx3030 subtract 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 329329003.1214937703309991196146 Inexact Rounded +addx3031 add -92980.68431371090354435763218439 -2282178507046019721925800997065 -> -2282178507046019721925801090046 Inexact Rounded +comx3031 compare -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 1 +divx3031 divide -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 4.074207342968196863070496994457E-26 Inexact Rounded +dvix3031 divideint -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 0 +mulx3031 multiply -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 2.121985193111820147170707717938E+35 Inexact Rounded +powx3031 power -92980.68431371090354435763218439 -2 -> 1.156683455371909793870207184337E-10 Inexact Rounded +remx3031 remainder -92980.68431371090354435763218439 -2282178507046019721925800997065 -> -92980.68431371090354435763218439 +subx3031 subtract -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 2282178507046019721925800904084 Inexact Rounded +addx3032 add 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.213581776227858606259822256987E+748 Inexact Rounded +comx3032 compare 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1 +divx3032 divide 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.233860374149945561886955398724E+1648 Inexact Rounded +dvix3032 divideint 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> NaN Division_impossible +mulx3032 multiply 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.193636458750059340733188876015E-152 Inexact Rounded +powx3032 power 12135817762.27858606259822256987E+738 10 -> 6.929317520577437720457517499936E+7480 Inexact Rounded +remx3032 remainder 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> NaN Division_impossible +subx3032 subtract 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.213581776227858606259822256987E+748 Inexact Rounded +addx3033 add 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -392513.2044337156627881674596002 Inexact Rounded +comx3033 compare 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 1 +divx3033 divide 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -0.00009495486002714264641177211062199 Inexact Rounded +dvix3033 divideint 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -0 +mulx3033 multiply 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -14632152.58043001234518095997140 Inexact Rounded +powx3033 power 37.27457578793521166809739140081 -392550 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3033 remainder 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 37.27457578793521166809739140081 +subx3033 subtract 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 392587.7535852915332115036543830 Inexact Rounded +addx3034 add -2787.980590304199878755265273703 7117631179305319208210387565324 -> 7117631179305319208210387562536 Inexact Rounded +comx3034 compare -2787.980590304199878755265273703 7117631179305319208210387565324 -> -1 +divx3034 divide -2787.980590304199878755265273703 7117631179305319208210387565324 -> -3.917006262435063093475140250870E-28 Inexact Rounded +dvix3034 divideint -2787.980590304199878755265273703 7117631179305319208210387565324 -> -0 +mulx3034 multiply -2787.980590304199878755265273703 7117631179305319208210387565324 -> -1.984381757684722217801410305714E+34 Inexact Rounded +powx3034 power -2787.980590304199878755265273703 7 -> -1309266999233099220127139.440082 Inexact Rounded +remx3034 remainder -2787.980590304199878755265273703 7117631179305319208210387565324 -> -2787.980590304199878755265273703 +subx3034 subtract -2787.980590304199878755265273703 7117631179305319208210387565324 -> -7117631179305319208210387568112 Inexact Rounded +addx3035 add -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -9.890633854609434943559831911276E+977 Inexact Rounded +comx3035 compare -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -1 +divx3035 divide -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> 5.098302376420396260404821158158E+968 Inexact Rounded +dvix3035 divideint -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> NaN Division_impossible +mulx3035 multiply -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> 1.918768853302706825964087702307E+987 Inexact Rounded +powx3035 power -9890633.854609434943559831911276E+971 -2 -> 1.022237362667592867768511487814E-1956 Inexact Rounded +remx3035 remainder -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> NaN Division_impossible +subx3035 subtract -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -9.890633854609434943559831911276E+977 Inexact Rounded +addx3036 add 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3927209601.042340294247970850347 Inexact Rounded +comx3036 compare 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 1 +divx3036 divide 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -227.2123393091837706827708196101 Inexact Rounded +dvix3036 divideint 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -227 +mulx3036 multiply 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -68480589931920481.56020043213767 Inexact Rounded +powx3036 power 3944570323.331121750661920475191 -17360722 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3036 remainder 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3686363.77773114469535563568018 +subx3036 subtract 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3961931045.619903207075870100035 Inexact Rounded +addx3037 add 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 1786717307.025364028452423865075 Inexact Rounded +comx3037 compare 19544.14018503427029002552872707 1786697762.885178994182133839546 -> -1 +divx3037 divide 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 0.00001093869404832867759234359871991 Inexact Rounded +dvix3037 divideint 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 0 +mulx3037 multiply 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 34919471546115.05897163496162290 Inexact Rounded +powx3037 power 19544.14018503427029002552872707 2 -> 381973415.5722714009298802557940 Inexact Rounded +remx3037 remainder 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 19544.14018503427029002552872707 +subx3037 subtract 19544.14018503427029002552872707 1786697762.885178994182133839546 -> -1786678218.744993959911843814017 Inexact Rounded +addx3038 add -05.75485957937617757983513662981 5564476875.989640431173694372083 -> 5564476870.234780851797516792248 Inexact Rounded +comx3038 compare -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -1 +divx3038 divide -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -1.034213944568271324841608825136E-9 Inexact Rounded +dvix3038 divideint -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -0 +mulx3038 multiply -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -32022783054.00620878436398990135 Inexact Rounded +powx3038 power -05.75485957937617757983513662981 6 -> 36325.23118223611421303238908472 Inexact Rounded +remx3038 remainder -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -5.75485957937617757983513662981 +subx3038 subtract -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -5564476881.744500010549871951918 Inexact Rounded +addx3039 add -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> 6.268877553774705678201112845462E+211 Inexact Rounded +comx3039 compare -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -1 +divx3039 divide -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -6.713834913211527184907421856434E-206 Inexact Rounded +dvix3039 divideint -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -0 +mulx3039 multiply -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -2.638458285983158789458925170267E+218 Inexact Rounded +powx3039 power -4208820.898718069194008526302746 6 -> 5.558564783291260359142223337994E+39 Inexact Rounded +remx3039 remainder -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -4208820.898718069194008526302746 +subx3039 subtract -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -6.268877553774705678201112845462E+211 Inexact Rounded +addx3040 add -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -7.007719547806630896979085821269E+562 Inexact Rounded +comx3040 compare -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -1 +divx3040 divide -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -1.521048673498997627360230078306E+559 Inexact Rounded +dvix3040 divideint -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> NaN Division_impossible +mulx3040 multiply -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -3.228570795682925509478191397878E+566 Inexact Rounded +powx3040 power -70077195478066.30896979085821269E+549 4607 -> -Infinity Overflow Inexact Rounded +remx3040 remainder -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> NaN Division_impossible +subx3040 subtract -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -7.007719547806630896979085821269E+562 Inexact Rounded +addx3041 add -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> -68569709.81053713470972973953995 Inexact Rounded +comx3041 compare -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 1 +divx3041 divide -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 0.006501728568934042143913111768557 Inexact Rounded +dvix3041 divideint -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 0 +mulx3041 multiply -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 30176190149574.84386395947593970 Inexact Rounded +powx3041 power -442941.7541811527940918244383454 -68126768 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3041 remainder -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> -442941.7541811527940918244383454 +subx3041 subtract -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 67683826.30217482912154609066325 Inexact Rounded +addx3042 add -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -40726479019.92472703575370611619 Inexact Rounded +comx3042 compare -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -1 +divx3042 divide -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -135895.4741975690872548233111888 Inexact Rounded +dvix3042 divideint -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -135895 +mulx3042 multiply -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -12205487445696816.02175665622242 Inexact Rounded +powx3042 power -040726778711.8677615616711676159 299692 -> Infinity Overflow Inexact Rounded +remx3042 remainder -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -142113.1908620082406650022240180 +subx3042 subtract -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -40727078403.81079608758862911561 Inexact Rounded +addx3043 add -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1934197516.927615489663964685661 Inexact Rounded +comx3043 compare -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1 +divx3043 divide -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -507563287.7312566071537233697473 Inexact Rounded +dvix3043 divideint -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -507563287 +mulx3043 multiply -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -7370745953.579062985130438309023 Inexact Rounded +powx3043 power -1934197520.738366912179143085955 4 -> 1.399597922275400947497855539475E+37 Inexact Rounded +remx3043 remainder -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -2.786637155934674312936704177047 +subx3043 subtract -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1934197524.549118334694321486249 Inexact Rounded +addx3044 add 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -303284009454.0558644298079356347 Inexact Rounded +comx3044 compare 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 1 +divx3044 divide 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -0.000002681514904267770294213381485108 Inexact Rounded +dvix3044 divideint 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -0 +mulx3044 multiply 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -246650255735392080.1357404280431 Inexact Rounded +powx3044 power 813262.7723533833038829559646830 -3 -> 1.859119568310997605545914895133E-18 Inexact Rounded +remx3044 remainder 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 813262.7723533833038829559646830 +subx3044 subtract 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 303285635979.6005711964157015467 Inexact Rounded +addx3045 add 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 36105954884.94621434979365589311 Inexact Rounded +comx3045 compare 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 1 +divx3045 divide 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 4.842808328786805821411674302686E+953 Inexact Rounded +dvix3045 divideint 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> NaN Division_impossible +mulx3045 multiply 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 2.691909094160561673391352743869E-933 Inexact Rounded +powx3045 power 36105954884.94621434979365589311 7 -> 7.999297449713301719582732447386E+73 Inexact Rounded +remx3045 remainder 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> NaN Division_impossible +subx3045 subtract 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 36105954884.94621434979365589311 Inexact Rounded +addx3046 add -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -48556402282.66602309736499370002 +comx3046 compare -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -1 +divx3046 divide -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2.799666682029089956269018541649 Inexact Rounded +dvix3046 divideint -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2 +mulx3046 multiply -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2038051610593641947717.268652175 Inexact Rounded +powx3046 power -075537177538.1814516621962185490 3 -> -4.310049518987988084595264617727E+32 Inexact Rounded +remx3046 remainder -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -21575627027.15059453253376885104 +subx3046 subtract -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -102517952793.6968802270274433980 Inexact Rounded +addx3047 add -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -4223765.415319564898840040697647 Inexact Rounded +comx3047 compare -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -1 +divx3047 divide -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> 1.630425855588347356570076909053E+191 Inexact Rounded +dvix3047 divideint -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> NaN Division_impossible +mulx3047 multiply -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> 1.094204573762229308798604845395E-178 Inexact Rounded +powx3047 power -4223765.415319564898840040697647 -3 -> -1.327090775863616939309569791138E-20 Inexact Rounded +remx3047 remainder -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> NaN Division_impossible +subx3047 subtract -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -4223765.415319564898840040697647 Inexact Rounded +addx3048 add -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> -7.877324314273694312164407794939E+270 Inexact Rounded +comx3048 compare -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 1 +divx3048 divide -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 8.212057140774706874666307246628E-268 Inexact Rounded +dvix3048 divideint -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 0 +mulx3048 multiply -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 5.095765270616284455922747530676E+274 Inexact Rounded +powx3048 power -6468.903738522951259063099946195 -8 -> 3.261027724982089298030362367616E-31 Inexact Rounded +remx3048 remainder -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> -6468.903738522951259063099946195 +subx3048 subtract -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 7.877324314273694312164407794939E+270 Inexact Rounded +addx3049 add -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> 1650.198961256061165362319471264 Inexact Rounded +comx3049 compare -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1 +divx3049 divide -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -5.797616777301250711985729776957E-200 Inexact Rounded +dvix3049 divideint -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -0 +mulx3049 multiply -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1.578781845938805737527304303976E-193 Inexact Rounded +powx3049 power -9567221.183663236817239254783372E-203 1650 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3049 remainder -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -9.567221183663236817239254783372E-197 +subx3049 subtract -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1650.198961256061165362319471264 Inexact Rounded +addx3050 add 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 2.679017380163975186972720427030E+572 Inexact Rounded +comx3050 compare 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> -1 +divx3050 divide 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 3.289379965960065573444140749635E-988 Inexact Rounded +dvix3050 divideint 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 0 +mulx3050 multiply 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 2.360832119793036398127652187732E+157 Inexact Rounded +powx3050 power 8812306098770.200752139142033569E-428 3 -> 6.843349527476967274129043949969E-1246 Inexact Rounded +remx3050 remainder 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 8.812306098770200752139142033569E-416 +subx3050 subtract 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> -2.679017380163975186972720427030E+572 Inexact Rounded +addx3051 add 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -706127147059.6372708438205200619 Inexact Rounded +comx3051 compare 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 1 +divx3051 divide 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -0.0001134341690057060105325397863996 Inexact Rounded +dvix3051 divideint 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -0 +mulx3051 multiply 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -56572874185674332398.36004114372 Inexact Rounded +powx3051 power 80108033.12724838718736922500904 -7 -> 4.723539145042336483008674060324E-56 Inexact Rounded +remx3051 remainder 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 80108033.12724838718736922500904 +subx3051 subtract 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 706287363125.8917676181952585119 Inexact Rounded +addx3052 add -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -37942846288.41047269183344038636 Inexact Rounded +comx3052 compare -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -1 +divx3052 divide -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 6716194607.139224735032566328960 Inexact Rounded +dvix3052 divideint -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 6716194607 +mulx3052 multiply -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 214356442635.9672009449140933366 Inexact Rounded +powx3052 power -37942846282.76101663789059003505 -6 -> 3.351355986382646046773008753885E-64 Inexact Rounded +remx3052 remainder -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -0.786544022188321089603127981421 +subx3052 subtract -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -37942846277.11156058394773968374 Inexact Rounded +addx3053 add 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 92659632115305.13735437728445541 Inexact Rounded +comx3053 compare 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 1 +divx3053 divide 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 1.429174267919135710410529211791E+146 Inexact Rounded +dvix3053 divideint 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> NaN Division_impossible +mulx3053 multiply 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 6.007530093754446085819255987878E-119 Inexact Rounded +powx3053 power 92659632115305.13735437728445541 6 -> 6.329121451953461546696051563323E+83 Inexact Rounded +remx3053 remainder 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> NaN Division_impossible +subx3053 subtract 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 92659632115305.13735437728445541 Inexact Rounded +addx3054 add 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 569549865196.1367939656357237466 Inexact Rounded +comx3054 compare 2838948.589837595494152150647194 569547026247.5469563701415715960 -> -1 +divx3054 divide 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 0.000004984572755198057481907281080406 Inexact Rounded +dvix3054 divideint 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 0 +mulx3054 multiply 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 1616914727011669419.390959984273 Inexact Rounded +powx3054 power 2838948.589837595494152150647194 6 -> 5.235343334986059753096884080673E+38 Inexact Rounded +remx3054 remainder 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 2838948.589837595494152150647194 +subx3054 subtract 2838948.589837595494152150647194 569547026247.5469563701415715960 -> -569544187298.9571187746474194454 Inexact Rounded +addx3055 add 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 5.249952045236053307941775794287E+705 Inexact Rounded +comx3055 compare 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 1 +divx3055 divide 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 3.302685669286670708554753139233E+675 Inexact Rounded +dvix3055 divideint 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> NaN Division_impossible +mulx3055 multiply 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 8.345328389435009812933599889447E+735 Inexact Rounded +powx3055 power 524995204523.6053307941775794287E+694 2 -> 2.756199647727821911857160230849E+1411 Inexact Rounded +remx3055 remainder 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> NaN Division_impossible +subx3055 subtract 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 5.249952045236053307941775794287E+705 Inexact Rounded +addx3056 add -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -52461892246715.82764070853532913 Inexact Rounded +comx3056 compare -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -1 +divx3056 divide -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -12.23457628210057733643575143694 Inexact Rounded +dvix3056 divideint -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -12 +mulx3056 multiply -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -266786248710342647746063322.0544 Inexact Rounded +powx3056 power -57131573677452.15449921725097290 5 -> -6.086686503752679375430019503679E+68 Inexact Rounded +remx3056 remainder -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -1095396508616.232197112663247672 +subx3056 subtract -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -61801255108188.48135772596661667 Inexact Rounded +addx3057 add 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 90794821.08377791746707352380646 Inexact Rounded +comx3057 compare 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 1 +divx3057 divide 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -16594131.20365054928428313232246 Inexact Rounded +dvix3057 divideint 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -16594131 +mulx3057 multiply 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -496784099.6333617958496589124964 Inexact Rounded +powx3057 power 90794826.55528018781830463383411 -5 -> 1.620669590532856523565742953997E-40 Inexact Rounded +remx3057 remainder 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 1.114274442767230442307896655232 +subx3057 subtract 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 90794832.02678245816953574386176 Inexact Rounded +addx3058 add 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 58461733862.10202881160156091690 Inexact Rounded +comx3058 compare 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 1 +divx3058 divide 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -1243.257894477021678809337875304 Inexact Rounded +dvix3058 divideint 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -1243 +mulx3058 multiply 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -2753474621708672573.249029643967 Inexact Rounded +powx3058 power 58508794729.35191160840980489138 -47060867 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3058 remainder 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 12136737.74759517576254461832107 +subx3058 subtract 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 58555855596.60179440521804886586 Inexact Rounded +addx3059 add -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> 9.595418300613754556671852801667E+391 Inexact Rounded +comx3059 compare -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -1 +divx3059 divide -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -7.775628465932789700547872511745E-381 Inexact Rounded +dvix3059 divideint -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -0 +mulx3059 multiply -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -7.159180712764549711669939947084E+403 Inexact Rounded +powx3059 power -746104.0768078474426464219416332E+006 10 -> 5.345571346302582882805035996696E+118 Inexact Rounded +remx3059 remainder -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -746104076807.8474426464219416332 +subx3059 subtract -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -9.595418300613754556671852801667E+391 Inexact Rounded +addx3060 add 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 5.599427632688387400403789659459E+120 Inexact Rounded +comx3060 compare 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 1 +divx3060 divide 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> -6.105892851759828176655685111491E+119 Inexact Rounded +dvix3060 divideint 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> NaN Division_impossible +mulx3060 multiply 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> -5.134972161307679939281170944556E+121 Inexact Rounded +powx3060 power 55.99427632688387400403789659459E+119 -9 -> 1.848022584764384077672041056396E-1087 Inexact Rounded +remx3060 remainder 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> NaN Division_impossible +subx3060 subtract 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 5.599427632688387400403789659459E+120 Inexact Rounded +addx3061 add -41214265628.83801241467317270595 1015336323798389903361978271354 -> 1015336323798389903320764005725 Inexact Rounded +comx3061 compare -41214265628.83801241467317270595 1015336323798389903361978271354 -> -1 +divx3061 divide -41214265628.83801241467317270595 1015336323798389903361978271354 -> -4.059173759750342247620706384027E-20 Inexact Rounded +dvix3061 divideint -41214265628.83801241467317270595 1015336323798389903361978271354 -> -0 +mulx3061 multiply -41214265628.83801241467317270595 1015336323798389903361978271354 -> -4.184634095163472384028549378392E+40 Inexact Rounded +powx3061 power -41214265628.83801241467317270595 1 -> -41214265628.83801241467317270595 +remx3061 remainder -41214265628.83801241467317270595 1015336323798389903361978271354 -> -41214265628.83801241467317270595 +subx3061 subtract -41214265628.83801241467317270595 1015336323798389903361978271354 -> -1015336323798389903403192536983 Inexact Rounded +addx3062 add 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 82351554300031.00628677123370689 Inexact Rounded +comx3062 compare 89937.39749201095570357557430822 82351554210093.60879476027800331 -> -1 +divx3062 divide 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 1.092115362662913415592930982129E-9 Inexact Rounded +dvix3062 divideint 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 0 +mulx3062 multiply 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 7406484465078077191.920015793662 Inexact Rounded +powx3062 power 89937.39749201095570357557430822 8 -> 4.280776267723913043050100934291E+39 Inexact Rounded +remx3062 remainder 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 89937.39749201095570357557430822 +subx3062 subtract 89937.39749201095570357557430822 82351554210093.60879476027800331 -> -82351554120156.21130274932229973 Inexact Rounded +addx3063 add 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1.712661646770821562841254869430E+365 Inexact Rounded +comx3063 compare 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1 +divx3063 divide 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 2.956290925475414185960999788848E+397 Inexact Rounded +dvix3063 divideint 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> NaN Division_impossible +mulx3063 multiply 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 9.921925785595813587655312307930E+332 Inexact Rounded +powx3063 power 01712661.64677082156284125486943E+359 6 -> 2.523651803323047711735501944959E+2191 Inexact Rounded +remx3063 remainder 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> NaN Division_impossible +subx3063 subtract 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1.712661646770821562841254869430E+365 Inexact Rounded +addx3064 add -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> -658179152015.9868345843925715053 Inexact Rounded +comx3064 compare -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 1 +divx3064 divide -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 0.004038849497560303158639192895544 Inexact Rounded +dvix3064 divideint -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 0 +mulx3064 multiply -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 1735580967057433153120.099643641 Inexact Rounded +powx3064 power -2647593306.528617691373470059213 -7 -> -1.096581914005902583413810201571E-66 Inexact Rounded +remx3064 remainder -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> -2647593306.528617691373470059213 +subx3064 subtract -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 652883965402.9295992016456313869 Inexact Rounded +addx3065 add 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -7.145586619176091599264717047885E+788 Inexact Rounded +comx3065 compare 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 1 +divx3065 divide 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -4.064157144036712325084472022316E-1088 Inexact Rounded +dvix3065 divideint 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -0 +mulx3065 multiply 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -2.075134583305571527962710017262E+490 Inexact Rounded +powx3065 power 2904078690665765116603253099668E-329 -7 -> 5.740389208842895561250128407803E+2089 Inexact Rounded +remx3065 remainder 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 2.904078690665765116603253099668E-299 +subx3065 subtract 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 7.145586619176091599264717047885E+788 Inexact Rounded +addx3066 add 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 22094338972.39109726522477999515 Inexact Rounded +comx3066 compare 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 1 +divx3066 divide 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> -5.390880808019174194010224736965E+497 Inexact Rounded +dvix3066 divideint 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> NaN Division_impossible +mulx3066 multiply 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> -9.055288588476315822113975426730E-478 Inexact Rounded +powx3066 power 22094338972.39109726522477999515 -4 -> 4.196391022354122686725315209967E-42 Inexact Rounded +remx3066 remainder 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> NaN Division_impossible +subx3066 subtract 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 22094338972.39109726522477999515 Inexact Rounded +addx3067 add -3374988581607586061255542201048 82293895124.90045271504836568681 -> -3374988581607586061173248305923 Inexact Rounded +comx3067 compare -3374988581607586061255542201048 82293895124.90045271504836568681 -> -1 +divx3067 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977038 Inexact Rounded +dvix3067 divideint -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797 +mulx3067 multiply -3374988581607586061255542201048 82293895124.90045271504836568681 -> -2.777409563825512202793336132310E+41 Inexact Rounded +powx3067 power -3374988581607586061255542201048 8 -> 1.683365657238878057620634207267E+244 Inexact Rounded +remx3067 remainder -3374988581607586061255542201048 82293895124.90045271504836568681 -> -66913970168.62046257175566384243 +subx3067 subtract -3374988581607586061255542201048 82293895124.90045271504836568681 -> -3374988581607586061337836096173 Inexact Rounded +addx3068 add -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -84172558171932.94780431960508260 Inexact Rounded +comx3068 compare -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -1 +divx3068 divide -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 7467674426.467986736459678347587 Inexact Rounded +dvix3068 divideint -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 7467674426 +mulx3068 multiply -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 948758494638999235.1953022970755 Inexact Rounded +powx3068 power -84172558160661.35863831029352323 -11272 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3068 remainder -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -5274.95422851496534479122656860 +subx3068 subtract -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -84172558149389.76947230098196386 Inexact Rounded +addx3069 add -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -7.004693232461490596396237508541E-555 Inexact Rounded +comx3069 compare -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -1 +divx3069 divide -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -2.082768876995463487926920072359E+362 Inexact Rounded +dvix3069 divideint -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> NaN Division_impossible +mulx3069 multiply -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -2.355793185832144388285949021738E-1471 Inexact Rounded +powx3069 power -70046932324614.90596396237508541E-568 3 -> -3.436903678302639677280508409829E-1663 Inexact Rounded +remx3069 remainder -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> NaN Division_impossible +subx3069 subtract -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -7.004693232461490596396237508541E-555 Inexact Rounded +addx3070 add 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 4125384407.053782660115680886000 Inexact Rounded +comx3070 compare 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 1 +divx3070 divide 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> -1.053928941287132717250540955457E+649 Inexact Rounded +dvix3070 divideint 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> NaN Division_impossible +mulx3070 multiply 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> -1.614795442013190139080634449273E-630 Inexact Rounded +powx3070 power 0004125384407.053782660115680886 -4 -> 3.452568541597450106266555783362E-39 Inexact Rounded +remx3070 remainder 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> NaN Division_impossible +subx3070 subtract 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 4125384407.053782660115680886000 Inexact Rounded +addx3071 add -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> 9.291391582947237200286427030028E+775 Inexact Rounded +comx3071 compare -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -1 +divx3071 divide -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -3.425012375468251447194400841658E-1209 Inexact Rounded +dvix3071 divideint -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -0 +mulx3071 multiply -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -2.956811729743937541973845029816E+343 Inexact Rounded +powx3071 power -31823131.15691583393820628480997E-440 9 -> -3.347234803487575870321338308655E-3893 Inexact Rounded +remx3071 remainder -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -3.182313115691583393820628480997E-433 +subx3071 subtract -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -9.291391582947237200286427030028E+775 Inexact Rounded +addx3072 add 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 55573868488.43891477926020011694 Inexact Rounded +comx3072 compare 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 1 +divx3072 divide 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 92696782.14318796763098335498657 Inexact Rounded +dvix3072 divideint 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 92696782 +mulx3072 multiply 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 33317820972080.24347717542221477 Inexact Rounded +powx3072 power 55573867888.91575330563698128150 600 -> 8.363240671070136278221965616973E+6446 Inexact Rounded +remx3072 remainder 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 85.8445030391099686478265169012 +subx3072 subtract 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 55573867289.39259183201376244606 Inexact Rounded +addx3073 add -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> 5.487207142687001607026665515349E-356 Inexact Rounded +comx3073 compare -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -1 +divx3073 divide -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -9.928051387110587327889009363069E-415 Inexact Rounded +dvix3073 divideint -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -0 +mulx3073 multiply -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -2.989280896644635352838087864373E-1125 Inexact Rounded +powx3073 power -5447727448431680878699555714796E-800 5 -> -4.798183553278543065204833300725E-3847 Inexact Rounded +remx3073 remainder -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -5.447727448431680878699555714796E-770 +subx3073 subtract -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -5.487207142687001607026665515349E-356 Inexact Rounded +addx3074 add 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 418359224750.4711631202083513795 Inexact Rounded +comx3074 compare 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 1 +divx3074 divide 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 42602.13713335803513874339309132 Inexact Rounded +dvix3074 divideint 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 42602 +mulx3074 multiply 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 4108155982352814348.343441299082 Inexact Rounded +powx3074 power 0418349404834.547110239542290134 9819916 -> Infinity Overflow Inexact Rounded +remx3074 remainder 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 1346638.04628810400110728063718 +subx3074 subtract 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 418339584918.6230573588762288885 Inexact Rounded +addx3075 add -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> -7.983992600094836304387324162042E+420 Inexact Rounded +comx3075 compare -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 1 +divx3075 divide -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 3.281838669494274896180376328433E-416 Inexact Rounded +dvix3075 divideint -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 0 +mulx3075 multiply -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 2.091979765115329268275803385534E+426 Inexact Rounded +powx3075 power -262021.7565194737396448014286436 -8 -> 4.500918721033033032706782304195E-44 Inexact Rounded +remx3075 remainder -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> -262021.7565194737396448014286436 +subx3075 subtract -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 7.983992600094836304387324162042E+420 Inexact Rounded +addx3076 add 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -3.386875233985057267609967806187E+831 Inexact Rounded +comx3076 compare 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 1 +divx3076 divide 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -1.437786964892976582009952172420E-1326 Inexact Rounded +dvix3076 divideint 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -0 +mulx3076 multiply 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -1.649274478764579569246425611629E+337 Inexact Rounded +powx3076 power 48696050631.42565380301204592392E-505 -3 -> 8.660017688773759463020340778853E+1482 Inexact Rounded +remx3076 remainder 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 4.869605063142565380301204592392E-495 +subx3076 subtract 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 3.386875233985057267609967806187E+831 Inexact Rounded +addx3077 add 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 95256207.85635086953625240702318 Inexact Rounded +comx3077 compare 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 1 +divx3077 divide 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -1567.937180706641856870286122623 Inexact Rounded +dvix3077 divideint 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -1567 +mulx3077 multiply 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -5794447919993.150493301061195714 Inexact Rounded +powx3077 power 95316999.19440144356471126680708 -60791 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3077 remainder 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 56972.46915194096967798542896355 +subx3077 subtract 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 95377790.53245201759317012659098 Inexact Rounded +addx3078 add -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> 8032459.450998820205916538543258 Inexact Rounded +comx3078 compare -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -1 +divx3078 divide -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -6.631471131473117487839243582873E-113 Inexact Rounded +dvix3078 divideint -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -0 +mulx3078 multiply -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -4.278652020339705265013632757349E-99 Inexact Rounded +powx3078 power -5326702296402708234722215224979E-136 8032459 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3078 remainder -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -5.326702296402708234722215224979E-106 +subx3078 subtract -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -8032459.450998820205916538543258 Inexact Rounded +addx3079 add 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 6.718750684079501575335482615780E-280 Inexact Rounded +comx3079 compare 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 1 +divx3079 divide 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 9.152153872187460598958616592442E+571 Inexact Rounded +dvix3079 divideint 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> NaN Division_impossible +mulx3079 multiply 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 4.932348317700372401849231767007E-1131 Inexact Rounded +powx3079 power 67.18750684079501575335482615780E-281 7 -> 6.180444071023111300817518409550E-1955 Inexact Rounded +remx3079 remainder 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> NaN Division_impossible +subx3079 subtract 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 6.718750684079501575335482615780E-280 Inexact Rounded +addx3080 add -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -8738791762039.358125211204773930 Inexact Rounded +comx3080 compare -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -1 +divx3080 divide -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -17216.56012577673731612130068130 Inexact Rounded +dvix3080 divideint -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -17216 +mulx3080 multiply -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -4436156407404759833857.580707024 Inexact Rounded +powx3080 power -8739299372114.092482914139281669 507610075 -> -Infinity Overflow Inexact Rounded +remx3080 remainder -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -284325487.3902691936540542102992 +subx3080 subtract -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -8739806982188.826840617073789408 Inexact Rounded +addx3081 add 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 2454.002078468928665008217727731 Inexact Rounded +comx3081 compare 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 1 +divx3081 divide 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 4.205327278123112611006652533618E+141 Inexact Rounded +dvix3081 divideint 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> NaN Division_impossible +mulx3081 multiply 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 1.432023194118096842806010293027E-135 Inexact Rounded +powx3081 power 2454.002078468928665008217727731 6 -> 218398452792293853786.9263054420 Inexact Rounded +remx3081 remainder 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> NaN Division_impossible +subx3081 subtract 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 2454.002078468928665008217727731 Inexact Rounded +addx3082 add 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 829181.6561975853393326976860680 Inexact Rounded +comx3082 compare 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 1 +divx3082 divide 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 11.83500633601553578851124281417 Inexact Rounded +dvix3082 divideint 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 11 +mulx3082 multiply 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 49394169921.82458094138096628957 Inexact Rounded +powx3082 power 764578.5204849936912066033177429 64603 -> Infinity Overflow Inexact Rounded +remx3082 remainder 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 53944.02764648556181956526616724 +subx3082 subtract 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 699975.3847724020430805089494178 Inexact Rounded +addx3083 add 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 846389013551.3654139910676568223 Inexact Rounded +comx3083 compare 079203.7330103777716903518367560 846388934347.6324036132959664705 -> -1 +divx3083 divide 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 9.357841270860339858146471876044E-8 Inexact Rounded +dvix3083 divideint 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 0 +mulx3083 multiply 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 67037163179008037.19983564789203 Inexact Rounded +powx3083 power 079203.7330103777716903518367560 8 -> 1.548692549503356788115682996756E+39 Inexact Rounded +remx3083 remainder 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 79203.7330103777716903518367560 +subx3083 subtract 079203.7330103777716903518367560 846388934347.6324036132959664705 -> -846388855143.8993932355242761187 Inexact Rounded +addx3084 add -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> 5.474973992953902631890208360829 Inexact Rounded +comx3084 compare -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -1 +divx3084 divide -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -7.814797878848469282033896969532E-327 Inexact Rounded +dvix3084 divideint -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -0 +mulx3084 multiply -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -2.342512251965378028433584538870E-325 Inexact Rounded +powx3084 power -4278.581514688669249247007127899E-329 5 -> -1.433834587801771244104676682986E-1627 Inexact Rounded +remx3084 remainder -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -4.278581514688669249247007127899E-326 +subx3084 subtract -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -5.474973992953902631890208360829 Inexact Rounded +addx3085 add 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 6.149612565404080501157093851895E+817 Inexact Rounded +comx3085 compare 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> -1 +divx3085 divide 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 9.897699923417617920996187420968E-160 Inexact Rounded +dvix3085 divideint 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 0 +mulx3085 multiply 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 3.743085898893072544197564013497E+1476 Inexact Rounded +powx3085 power 60867019.81764798845468445196869E+651 6 -> 5.085014897388871736767602086646E+3952 Inexact Rounded +remx3085 remainder 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 6.086701981764798845468445196869E+658 +subx3085 subtract 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> -6.149612565404080501157093851895E+817 Inexact Rounded +addx3086 add 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -8.945059095290523784746184357820E+538 Inexact Rounded +comx3086 compare 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 1 +divx3086 divide 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -2.074264411286709228674841672954E-908 Inexact Rounded +dvix3086 divideint 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -0 +mulx3086 multiply 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -1.659703631470633700884136887614E+170 Inexact Rounded +powx3086 power 18554417738217.62218590965803605E-382 -9 -> 3.836842998295531899082688721531E+3318 Inexact Rounded +remx3086 remainder 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 1.855441773821762218590965803605E-369 +subx3086 subtract 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 8.945059095290523784746184357820E+538 Inexact Rounded +addx3087 add 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 9.977847825356104634823627327033E+127 Inexact Rounded +comx3087 compare 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> -1 +divx3087 divide 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 6.922670772910807388395384866884E-115 Inexact Rounded +dvix3087 divideint 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 0 +mulx3087 multiply 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 6.892034301367879802693422066425E+141 Inexact Rounded +powx3087 power 69073355517144.36356688642213839 10 -> 2.472324890841334302628435461516E+138 Inexact Rounded +remx3087 remainder 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 69073355517144.36356688642213839 +subx3087 subtract 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> -9.977847825356104634823627327033E+127 Inexact Rounded +addx3088 add 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -1791307965314309175027629110751 Inexact Rounded +comx3088 compare 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 1 +divx3088 divide 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -2.513706564096350714213771006483E-19 Inexact Rounded +dvix3088 divideint 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -0 +mulx3088 multiply 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -8.065941973169457071650996861677E+41 Inexact Rounded +powx3088 power 450282259072.8657099359104277477 -2 -> 4.932082442194544671633570348838E-24 Inexact Rounded +remx3088 remainder 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 450282259072.8657099359104277477 +subx3088 subtract 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 1791307965314309175928193628897 Inexact Rounded +addx3089 add 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 954821400.4934353520984462184316 Inexact Rounded +comx3089 compare 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 1 +divx3089 divide 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 6676.599951968811589335427770046 Inexact Rounded +dvix3089 divideint 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 6676 +mulx3089 multiply 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 136508234203444.8694879431412375 Inexact Rounded +powx3089 power 954678411.7838149266455177850037 142989 -> Infinity Overflow Inexact Rounded +remx3089 remainder 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 85786.3578546028952962204808256 +subx3089 subtract 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 954535423.0741945011925893515758 Inexact Rounded +addx3090 add -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -9.244530976220812127155852389807E+566 Inexact Rounded +comx3090 compare -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -1 +divx3090 divide -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -1.708503207395591002370649848757E+561 Inexact Rounded +dvix3090 divideint -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> NaN Division_impossible +mulx3090 multiply -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -5.002118380601798392363043558941E+572 Inexact Rounded +powx3090 power -9244530976.220812127155852389807E+557 541089 -> -Infinity Overflow Inexact Rounded +remx3090 remainder -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> NaN Division_impossible +subx3090 subtract -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -9.244530976220812127155852389807E+566 Inexact Rounded +addx3091 add -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> -14760496803372.56259241638975169 Inexact Rounded +comx3091 compare -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 1 +divx3091 divide -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 0.000005114489797920668836278344635108 Inexact Rounded +dvix3091 divideint -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 0 +mulx3091 multiply -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 1114294082984662825831.464787487 Inexact Rounded +powx3091 power -75492024.20990197005974241975449 -1 -> -1.324643246046162082348970735576E-8 Inexact Rounded +remx3091 remainder -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> -75492024.20990197005974241975449 +subx3091 subtract -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 14760345819324.14278847627026685 Inexact Rounded +addx3092 add 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 2.475976333144824613591228097330E+99 Inexact Rounded +comx3092 compare 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> -1 +divx3092 divide 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 1.283322837007852247594216151634E-546 Inexact Rounded +dvix3092 divideint 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 0 +mulx3092 multiply 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 7.867357782318786860404997647513E-348 Inexact Rounded +powx3092 power 317747.6972215715434186596178036E-452 2 -> 1.009635990896115043331231496209E-893 Inexact Rounded +remx3092 remainder 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 3.177476972215715434186596178036E-447 +subx3092 subtract 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> -2.475976333144824613591228097330E+99 Inexact Rounded +addx3093 add -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> -17.87120645617324368279740020695 Inexact Rounded +comx3093 compare -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 1 +divx3093 divide -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 0.8390040956188859972044344532019 Inexact Rounded +dvix3093 divideint -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 0 +mulx3093 multiply -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 79.23306057789328578902960605222 Inexact Rounded +powx3093 power -8.153334430358647134334545353427 -10 -> 7.702778966876727056635952801162E-10 Inexact Rounded +remx3093 remainder -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> -8.153334430358647134334545353427 +subx3093 subtract -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 1.564537595455949414128309500095 +addx3094 add 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 5054015481833.263541189916208065 Inexact Rounded +comx3094 compare 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> -1 +divx3094 divide 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 1.437934890309606594895299558654E-490 Inexact Rounded +dvix3094 divideint 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 0 +mulx3094 multiply 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 3.672927513995607308048737751972E-465 Inexact Rounded +powx3094 power 7.267345197492967332320456062961E-478 5 -> 2.027117616846668568108096583897E-2386 Inexact Rounded +remx3094 remainder 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 7.267345197492967332320456062961E-478 +subx3094 subtract 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> -5054015481833.263541189916208065 Inexact Rounded +addx3095 add -1223354029.862567054230912271171 8135774223401322785475014855625 -> 8135774223401322785473791501595 Inexact Rounded +comx3095 compare -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1 +divx3095 divide -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1.503672540892020337688277553692E-22 Inexact Rounded +dvix3095 divideint -1223354029.862567054230912271171 8135774223401322785475014855625 -> -0 +mulx3095 multiply -1223354029.862567054230912271171 8135774223401322785475014855625 -> -9.952932182250005119307429060894E+39 Inexact Rounded +powx3095 power -1223354029.862567054230912271171 8 -> 5.016689887192830666848068841227E+72 Inexact Rounded +remx3095 remainder -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1223354029.862567054230912271171 +subx3095 subtract -1223354029.862567054230912271171 8135774223401322785475014855625 -> -8135774223401322785476238209655 Inexact Rounded +addx3096 add 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 2.853976441115655679961211349982E+656 Inexact Rounded +comx3096 compare 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 1 +divx3096 divide 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> -1.151029280076495626421134733122E+626 Inexact Rounded +dvix3096 divideint 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> NaN Division_impossible +mulx3096 multiply 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> -7.076432952167704614138411740001E+686 Inexact Rounded +powx3096 power 285397644111.5655679961211349982E+645 -2 -> 1.227719722087860401233030479451E-1313 Inexact Rounded +remx3096 remainder 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> NaN Division_impossible +subx3096 subtract 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 2.853976441115655679961211349982E+656 Inexact Rounded +addx3097 add -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -4676542.661845508839813784891890 Inexact Rounded +comx3097 compare -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -1 +divx3097 divide -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 1362.424151323477505064686589716 Inexact Rounded +dvix3097 divideint -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 1362 +mulx3097 multiply -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 16028768973.31252639476148371361 Inexact Rounded +powx3097 power -4673112.663442366293812346653429 -3430 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3097 remainder -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -1454.838362218639853465869604204 +subx3097 subtract -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -4669682.665039223747810908414968 Inexact Rounded +addx3098 add 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 3.869394621006514751889096510923E+144 Inexact Rounded +comx3098 compare 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> -1 +divx3098 divide 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 2.299194926095985647821385937618E-143 Inexact Rounded +dvix3098 divideint 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 0 +mulx3098 multiply 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 3.442404014670364763780946297856E+146 Inexact Rounded +powx3098 power 88.96492479681278079861456051103 4 -> 62643391.73078290226474758858970 Inexact Rounded +remx3098 remainder 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 88.96492479681278079861456051103 +subx3098 subtract 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> -3.869394621006514751889096510923E+144 Inexact Rounded +addx3099 add 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 92.23649942010862087149015091350 Inexact Rounded +comx3099 compare 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> -1 +divx3099 divide 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 6.974120530708230229344349531719E-937 Inexact Rounded +dvix3099 divideint 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 0 +mulx3099 multiply 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 5.933283133313013755814405436342E-933 Inexact Rounded +powx3099 power 064326846.4286437304788069444326E-942 92 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3099 remainder 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 6.43268464286437304788069444326E-935 +subx3099 subtract 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> -92.23649942010862087149015091350 Inexact Rounded +addx3100 add 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 1109894.721947227977782971677146 Inexact Rounded +comx3100 compare 504507.0043949324433170405699360 605387.7175522955344659311072099 -> -1 +divx3100 divide 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 0.8333618105678718895216067463832 Inexact Rounded +dvix3100 divideint 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 0 +mulx3100 multiply 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 305422343879.7940838630401656585 Inexact Rounded +powx3100 power 504507.0043949324433170405699360 605388 -> Infinity Overflow Inexact Rounded +remx3100 remainder 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 504507.0043949324433170405699360 +subx3100 subtract 504507.0043949324433170405699360 605387.7175522955344659311072099 -> -100880.7131573630911488905372739 + +-- randomly generated testcases [26 Sep 2001] +precision: 32 +rounding: half_up +maxExponent: 9999 + +addx3201 add 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0.1294608320983180201262861125848 +comx3201 compare 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 1 +divx3201 divide 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0.92190879812324313630282980110280 Inexact Rounded +dvix3201 divideint 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0 +mulx3201 multiply 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -2.5337311682687808926633910761614 Inexact Rounded +powx3201 power 1.5283550163839789319142430253644 -2 -> 0.42810618916584924451466691603128 Inexact Rounded +remx3201 remainder 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 1.5283550163839789319142430253644 +subx3201 subtract 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 3.1861708648662758839547721633136 +addx3202 add -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -616383641998.15356482333651785302 Inexact Rounded +comx3202 compare -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -1 +divx3202 divide -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -95.546234185785110491676894153510 Inexact Rounded +dvix3202 divideint -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -95 +mulx3202 multiply -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -4060946921076840449949.6988828486 Inexact Rounded +powx3202 power -622903030605.2867503937836507326 7 -> -3.6386736597702404352813308064300E+82 Inexact Rounded +remx3202 remainder -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -3561112927.6341212013060271723005 +subx3202 subtract -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -629422419212.41993596423078361218 Inexact Rounded +addx3203 add -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> 73908233965.134822146441861002895 Inexact Rounded +comx3203 compare -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -1 +divx3203 divide -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -0.000076790894376056827552388054657082 Inexact Rounded +dvix3203 divideint -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -0 +mulx3203 multiply -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -419529088021865067.23307352973589 Inexact Rounded +powx3203 power -5675915.2465457487632250245209054 7 -> -1.8978038060207777231389234721908E+47 Inexact Rounded +remx3203 remainder -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -5675915.2465457487632250245209054 +subx3203 subtract -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -73919585795.627913643968311051937 Inexact Rounded +addx3204 add 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 102.50941233130989977580658947572 Inexact Rounded +comx3204 compare 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 1 +divx3204 divide 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 20.083399916665466374741708949621 Inexact Rounded +dvix3204 divideint 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 20 +mulx3204 multiply 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 474.77017694916635398652276042175 Inexact Rounded +powx3204 power 97.647321172555144900685605318635 5 -> 8877724578.7935312939231828719842 Inexact Rounded +remx3204 remainder 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 0.4054979974600473982659221768650 +subx3204 subtract 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 92.785230013800390025564621161547 Inexact Rounded +addx3205 add -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> -2.6692539695193820424002013488480E+366 Inexact Rounded +comx3205 compare -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 1 +divx3205 divide -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 3.6404378818903462695633337631098E-354 Inexact Rounded +dvix3205 divideint -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 0 +mulx3205 multiply -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 2.5937816855830431899123217912144E+379 Inexact Rounded +powx3205 power -9717253267024.5380651435435603552 -3 -> -1.0898567880085337780041328661330E-39 Inexact Rounded +remx3205 remainder -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> -9717253267024.5380651435435603552 +subx3205 subtract -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 2.6692539695193820424002013488480E+366 Inexact Rounded +addx3206 add -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> 12772.807105920712660991033689206 Inexact Rounded +comx3206 compare -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -1 +divx3206 divide -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -3.1956477052150593175206769891434E-771 Inexact Rounded +dvix3206 divideint -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -0 +mulx3206 multiply -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -5.2135267097047531336100750110314E-763 Inexact Rounded +powx3206 power -4.0817391717190128506083001702335E-767 12773 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3206 remainder -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -4.0817391717190128506083001702335E-767 +subx3206 subtract -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -12772.807105920712660991033689206 Inexact Rounded +addx3207 add 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 68625322655934146845003028928587 Inexact Rounded +comx3207 compare 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 1 +divx3207 divide 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -1150771826276954946844322988192.5 Inexact Rounded +dvix3207 divideint 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -1150771826276954946844322988192 +mulx3207 multiply 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -4.0924141537834748501140151997778E+33 Inexact Rounded +powx3207 power 68625322655934146845003028928647 -60 -> 6.4704731111943370171711131942603E-1911 Inexact Rounded +remx3207 remainder 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 28.201254004897257552939369449600 +subx3207 subtract 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 68625322655934146845003028928707 Inexact Rounded +addx3208 add 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -92134479103305.554299334115573170 Inexact Rounded +comx3208 compare 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 1 +divx3208 divide 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -7.9505063318943846655593887991914E-9 Inexact Rounded +dvix3208 divideint 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -0 +mulx3208 multiply 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -67489959009342175728.710494356322 Inexact Rounded +powx3208 power 732515.76532049290815665856727641 -9 -> 1.6468241050443471359358016585877E-53 Inexact Rounded +remx3208 remainder 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 732515.76532049290815665856727641 +subx3208 subtract 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 92134480568337.084940319931886488 Inexact Rounded +addx3209 add -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> -5.0233720245976651023364304104030E+861 Inexact Rounded +comx3209 compare -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 1 +divx3209 divide -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 6.0632602550311410821483001305010E-861 Inexact Rounded +dvix3209 divideint -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 0 +mulx3209 multiply -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 1.5300192511921895929031818638961E+863 Inexact Rounded +powx3209 power -30.458011942978338421676454778733 -5 -> -3.8149797481405136042487643253109E-8 Inexact Rounded +remx3209 remainder -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> -30.458011942978338421676454778733 +subx3209 subtract -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 5.0233720245976651023364304104030E+861 Inexact Rounded +addx3210 add -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> -58703509398.895039317872169695760 Inexact Rounded +comx3210 compare -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 1 +divx3210 divide -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 0.0000015269995260536025237167199970238 Inexact Rounded +dvix3210 divideint -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 0 +mulx3210 multiply -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 5262180074071519.7018252171579753 Inexact Rounded +powx3210 power -89640.094149414644660480286430462 -6 -> 1.9274635591165405888724595165741E-30 Inexact Rounded +remx3210 remainder -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> -89640.094149414644660480286430462 +subx3210 subtract -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 58703330118.706740488582848735188 Inexact Rounded +addx3211 add 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 458653.15678700818100529177142590 Inexact Rounded +comx3211 compare 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 1 +divx3211 divide 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 2.4990492117594160215641311760498E+33 Inexact Rounded +dvix3211 divideint 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> NaN Division_impossible +mulx3211 multiply 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 8.4177101131428047497998594379593E-23 Inexact Rounded +powx3211 power 458653.1567870081810052917714259 2 -> 210362718230.68790865117452429990 Inexact Rounded +remx3211 remainder 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> NaN Division_impossible +subx3211 subtract 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 458653.15678700818100529177142590 Inexact Rounded +addx3212 add 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -2.1051638816432817393202262710630E+439 Inexact Rounded +comx3212 compare 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 1 +divx3212 divide 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -4.3388138824102151127273259092613E-434 Inexact Rounded +dvix3212 divideint 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -0 +mulx3212 multiply 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -1.9228386428540135340600836707270E+445 Inexact Rounded +powx3212 power 913391.42744224458216174967853722 -2 -> 1.1986327439971532470297300128074E-12 Inexact Rounded +remx3212 remainder 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 913391.42744224458216174967853722 +subx3212 subtract 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 2.1051638816432817393202262710630E+439 Inexact Rounded +addx3213 add -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> -2.8892177726858026955513438843371E+739 Inexact Rounded +comx3213 compare -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 1 +divx3213 divide -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 3.1759165595057674196644927106447E-728 Inexact Rounded +dvix3213 divideint -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 0 +mulx3213 multiply -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 2.6511215451353541156703914721725E+751 Inexact Rounded +powx3213 power -917591456829.12109027484399536567 -3 -> -1.2943505591853739240003453341911E-36 Inexact Rounded +remx3213 remainder -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> -917591456829.12109027484399536567 +subx3213 subtract -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 2.8892177726858026955513438843371E+739 Inexact Rounded +addx3214 add 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 34938410840676.731620092461631064 Inexact Rounded +comx3214 compare 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1 +divx3214 divide 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1133693327999.7879503260098666966 Inexact Rounded +dvix3214 divideint 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1133693327999 +mulx3214 multiply 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1076739645476675.3318519289128961 Inexact Rounded +powx3214 power 34938410840645.913399699219228218 31 -> 6.9566085958798732786509909683267E+419 Inexact Rounded +remx3214 remainder 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 24.283226805899273551376371736548 +subx3214 subtract 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 34938410840615.095179305976825372 Inexact Rounded +addx3215 add 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 29771833428054709077850588904653 Inexact Rounded +comx3215 compare 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> -1 +divx3215 divide 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 2.0269955680376683526099444523691E-545 Inexact Rounded +dvix3215 divideint 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 0 +mulx3215 multiply 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 1.7966519787854159464382359411642E-482 Inexact Rounded +powx3215 power 6034.7374411022598081745006769023E-517 3 -> 2.1977340597301840681528507640032E-1540 Inexact Rounded +remx3215 remainder 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 6.0347374411022598081745006769023E-514 +subx3215 subtract 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> -29771833428054709077850588904653 Inexact Rounded +addx3216 add -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -5565747672224.4775959193681631431 Inexact Rounded +comx3216 compare -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -1 +divx3216 divide -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 11351510433.365074871574519756245 Inexact Rounded +dvix3216 divideint -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 11351510433 +mulx3216 multiply -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 2728936147066663.4580064428639745 Inexact Rounded +powx3216 power -5565747671734.1686009705574503152 -490 -> 4.9371745297619526113991728953197E-6246 Inexact Rounded +remx3216 remainder -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -178.99949336276892685183308348801 +subx3216 subtract -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -5565747671243.8596060217467374873 Inexact Rounded +addx3217 add 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 3.1954551189203199952335879232538E+44 Inexact Rounded +comx3217 compare 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 1 +divx3217 divide 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -108102711781422.68663084859902931 Inexact Rounded +dvix3217 divideint 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -108102711781422 +mulx3217 multiply 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -9.4455848967786959996525702197139E+74 Inexact Rounded +powx3217 power 319545511.89203495546689273564728E+036 -3 -> 3.0647978448946294457985223953472E-134 Inexact Rounded +remx3217 remainder 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 2029642017122316721531728309258 +subx3217 subtract 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 3.1954551189203791141042667896918E+44 Inexact Rounded +addx3218 add -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -42682764.676651465089307430325104 Rounded +comx3218 compare -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -1 +divx3218 divide -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 6.3204380807318655475459047410160 Inexact Rounded +dvix3218 divideint -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 6 +mulx3218 multiply -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 214871156882133.34437417534873098 Inexact Rounded +powx3218 power -36852134.84194296250843579428931 -5830630 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3218 remainder -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -1868355.8336919470232059780745460 +subx3218 subtract -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -31021505.007234459927564158253516 Rounded +addx3219 add 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -39505285344943.729681835377530908 Inexact Rounded +comx3219 compare 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 1 +divx3219 divide 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -2.1774783867700502002511486885272E-387 Inexact Rounded +dvix3219 divideint 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -0 +mulx3219 multiply 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -3.3983199030116951081865430362053E-360 Inexact Rounded +powx3219 power 8.6021905001798578659275880018221E-374 -4 -> 1.8262649155820433126240754123257E+1492 Inexact Rounded +remx3219 remainder 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 8.6021905001798578659275880018221E-374 +subx3219 subtract 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 39505285344943.729681835377530908 Inexact Rounded +addx3220 add -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -54862429.012326453703398777272191 Inexact Rounded +comx3220 compare -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -1 +divx3220 divide -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -74528.182826764384088602813142847 Inexact Rounded +dvix3220 divideint -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -74528 +mulx3220 multiply -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -40386962037.048345148338122539405 Inexact Rounded +powx3220 power -54863165.152174109720312887805017 736 -> 1.2903643981679111625370174573639E+5696 Inexact Rounded +remx3220 remainder -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -134.5860664811454830973740198416 +subx3220 subtract -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -54863901.292021765737226998337843 Inexact Rounded +addx3221 add -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -3263743464517851012531706353100.8 Inexact Rounded +comx3221 compare -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1 +divx3221 divide -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1328233422952076975055082.5768082 Inexact Rounded +dvix3221 divideint -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1328233422952076975055082 +mulx3221 multiply -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -8.0196908300261262548565838031943E+36 Inexact Rounded +powx3221 power -3263743464517851012531708810307 2457206 -> Infinity Overflow Inexact Rounded +remx3221 remainder -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1417336.7573398366062994535940062 +subx3221 subtract -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -3263743464517851012531711267513.2 Inexact Rounded +addx3222 add 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 9.5354563764657694835860339582821E+91 Inexact Rounded +comx3222 compare 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> -1 +divx3222 divide 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.9957525170007980008712828968300E-978 Inexact Rounded +dvix3222 divideint 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 0 +mulx3222 multiply 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.7238858283525541854826594343954E-794 Inexact Rounded +powx3222 power 2856586744.0548637797291151154902E-895 10 -> 3.6180466753307072256807593988336E-8856 Inexact Rounded +remx3222 remainder 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.8565867440548637797291151154902E-886 +subx3222 subtract 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> -9.5354563764657694835860339582821E+91 Inexact Rounded +addx3223 add 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 631722566499.28075196842125460014 Inexact Rounded +comx3223 compare 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> -1 +divx3223 divide 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 0.0089828645946207580492752544218316 Inexact Rounded +dvix3223 divideint 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 0 +mulx3223 multiply 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 3521275897257796938833.8975037909 Inexact Rounded +powx3223 power 5624157233.3433661009203529937625 6 -> 3.1647887196303262540158328459030E+58 Inexact Rounded +remx3223 remainder 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 5624157233.3433661009203529937625 +subx3223 subtract 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> -620474252032.59401976658054861262 Inexact Rounded +addx3224 add -213499362.91476998701834067092611 419272438.02555757699863022643444 -> 205773075.11078758998028955550833 +comx3224 compare -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -1 +divx3224 divide -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -0.50921392286166855779828061147786 Inexact Rounded +dvix3224 divideint -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -0 +mulx3224 multiply -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -89514398406178925.073260776410672 Inexact Rounded +powx3224 power -213499362.91476998701834067092611 419272438 -> Infinity Overflow Inexact Rounded +remx3224 remainder -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -213499362.91476998701834067092611 +subx3224 subtract -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -632771800.94032756401697089736055 +addx3225 add 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 30274.392356614101238316845401518 Inexact Rounded +comx3225 compare 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1 +divx3225 divide 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 6300.1252178837655359831527173832 Inexact Rounded +dvix3225 divideint 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 6300 +mulx3225 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199283 Inexact Rounded +powx3225 power 30269.587755640502150977251770554 5 -> 25411630481547464128383.220368208 Inexact Rounded +remx3225 remainder 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 0.6016219662519115373766970119100 +subx3225 subtract 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 30264.783154666903063637658139590 Inexact Rounded +addx3226 add 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded +comx3226 compare 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 1 +divx3226 divide 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -8.1057651538555854520994438038537E+673 Inexact Rounded +dvix3226 divideint 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible +mulx3226 multiply 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -2.7865227773649353769876975366506E+737 Inexact Rounded +powx3226 power 47.525676459351505682005359699680E+704 -6 -> 8.6782100393941226535150385475464E-4235 Inexact Rounded +remx3226 remainder 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible +subx3226 subtract 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded +addx3227 add -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396977890406.153948943614775470 Inexact Rounded +comx3227 compare -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -1 +divx3227 divide -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 643479.03948459716424778005613112 Inexact Rounded +dvix3227 divideint -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 643479 +mulx3227 multiply -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 8601512678051025297297.7169654467 Inexact Rounded +powx3227 power -74396862273800.625679130772935550 -115616606 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3227 remainder -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -4565075.09478147646296920746797 +subx3227 subtract -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396746657195.097409317931095630 Inexact Rounded +addx3228 add 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 67586387.525464115583388327481014 Inexact Rounded +comx3228 compare 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 1 +divx3228 divide 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 81727.439437354248789852715586510 Inexact Rounded +dvix3228 divideint 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 81727 +mulx3228 multiply 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 55890751355.998983433895910295596 Inexact Rounded +powx3228 power 67585560.562561229497720955705979 827 -> 1.9462204583352191108781197788255E+6475 Inexact Rounded +remx3228 remainder 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 363.39839010616042789746007924349 +subx3228 subtract 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 67584733.599658343412053583930944 Inexact Rounded +addx3229 add 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 390.31542898606435093937697545510 Inexact Rounded +comx3229 compare 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> -1 +divx3229 divide 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 1.7620074325054038174571564409871E-225 Inexact Rounded +dvix3229 divideint 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 0 +mulx3229 multiply 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 2.6843502060572691408091663822732E-220 Inexact Rounded +powx3229 power 6877386868.9498051860742298735156E-232 390 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3229 remainder 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 6.8773868689498051860742298735156E-223 +subx3229 subtract 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> -390.31542898606435093937697545510 Inexact Rounded +addx3230 add -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> -186656471117.70574263160637723440 Inexact Rounded +comx3230 compare -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 1 +divx3230 divide -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 0.0000088255699357876233458660331146583 Inexact Rounded +dvix3230 divideint -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 0 +mulx3230 multiply -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 307483061680363807.48775619333285 Inexact Rounded +powx3230 power -1647335.201144609256134925838937 -2 -> 3.6849876990439502152784389237891E-13 Inexact Rounded +remx3230 remainder -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> -1647335.201144609256134925838937 +subx3230 subtract -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 186653176447.30345341309410738272 Inexact Rounded +addx3231 add 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 41407818140948.866630923934138155 Inexact Rounded +comx3231 compare 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 1 +divx3231 divide 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> -8.0298091128179204076796507697517E+972 Inexact Rounded +dvix3231 divideint 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> NaN Division_impossible +mulx3231 multiply 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> -2.1353028186646179369220834691156E-946 Inexact Rounded +powx3231 power 41407818140948.866630923934138155 -5 -> 8.2146348556648547525693528004081E-69 Inexact Rounded +remx3231 remainder 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> NaN Division_impossible +subx3231 subtract 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 41407818140948.866630923934138155 Inexact Rounded +addx3232 add -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> -574454585586.71690214265053093061 Inexact Rounded +comx3232 compare -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 1 +divx3232 divide -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 1.1584453442097568745411568037078E-11 Inexact Rounded +dvix3232 divideint -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 0 +mulx3232 multiply -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 3822847288253.1035559206691532826 Inexact Rounded +powx3232 power -6.6547424012516834662011706165297 -6 -> 0.000011513636283388791488128239232906 Inexact Rounded +remx3232 remainder -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> -6.6547424012516834662011706165297 +subx3232 subtract -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 574454585573.40741734014716399821 Inexact Rounded +addx3233 add -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> -23385972217069.468331815025891947 Inexact Rounded +comx3233 compare -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 1 +divx3233 divide -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 1.1813816642548920194709898111624E-9 Inexact Rounded +dvix3233 divideint -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 0 +mulx3233 multiply -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 646101997676091306.41485393678655 Inexact Rounded +powx3233 power -27627.758745381267780885067447671 -2 -> 1.3101128009560812529198521922269E-9 Inexact Rounded +remx3233 remainder -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> -27627.758745381267780885067447671 +subx3233 subtract -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 23385972161813.950841052490330177 Inexact Rounded +addx3234 add 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 2.0981974379099914752963711944307E-223 Inexact Rounded +comx3234 compare 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 1 +divx3234 divide 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> -4.7661318949867060595545765053187E+731 Inexact Rounded +dvix3234 divideint 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> NaN Division_impossible +mulx3234 multiply 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> -9.2369086409102239573726316593648E-1178 Inexact Rounded +powx3234 power 209819.74379099914752963711944307E-228 -4 -> 5.1595828494111690910650919776705E+890 Inexact Rounded +remx3234 remainder 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> NaN Division_impossible +subx3234 subtract 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 2.0981974379099914752963711944307E-223 Inexact Rounded +addx3235 add 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.3488457600415474270259330865184 Inexact Rounded +comx3235 compare 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 1 +divx3235 divide 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.5579771002708402753412266574941E+605 Inexact Rounded +dvix3235 divideint 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> NaN Division_impossible +mulx3235 multiply 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.1568122732142531556215204459407E-605 Inexact Rounded +powx3235 power 2.3488457600415474270259330865184 9 -> 2176.1583446147511579113022622255 Inexact Rounded +remx3235 remainder 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> NaN Division_impossible +subx3235 subtract 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.3488457600415474270259330865184 Inexact Rounded +addx3236 add -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -5107586300197.9703941034404557409 Inexact Rounded +comx3236 compare -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -1 +divx3236 divide -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -9.0225606358909877855326357402242E+775 Inexact Rounded +dvix3236 divideint -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> NaN Division_impossible +mulx3236 multiply -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -2.8913563307290346152596212593532E-751 Inexact Rounded +powx3236 power -5107586300197.9703941034404557409 6 -> 1.7753920894188022125919559565029E+76 Inexact Rounded +remx3236 remainder -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> NaN Division_impossible +subx3236 subtract -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -5107586300197.9703941034404557409 Inexact Rounded +addx3237 add -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -70454076296048.077427972135182788 Inexact Rounded +comx3237 compare -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -1 +divx3237 divide -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 11363232.779549422490548997517194 Inexact Rounded +dvix3237 divideint -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 11363232 +mulx3237 multiply -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 436827801504436566945.76663687924 Inexact Rounded +powx3237 power -70454070095869.70717871212601390 -6200178 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3237 remainder -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -4833345.467866203920028883583808 +subx3237 subtract -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -70454063895691.336929452116845012 Inexact Rounded +addx3238 add 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 29119.220621511046558757900645228 Inexact Rounded +comx3238 compare 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 1 +divx3238 divide 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 8.2781197380089684063239752337467E+219 Inexact Rounded +dvix3238 divideint 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> NaN Division_impossible +mulx3238 multiply 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 1.0243014554512542440592768088600E-211 Inexact Rounded +powx3238 power 29119.220621511046558757900645228 4 -> 718983605328417461.32835984217255 Inexact Rounded +remx3238 remainder 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> NaN Division_impossible +subx3238 subtract 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 29119.220621511046558757900645228 Inexact Rounded +addx3239 add -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> -5695442.3185284567660037344669935 Inexact Rounded +comx3239 compare -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 1 +divx3239 divide -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 0.00090825526554639915580539316714451 Inexact Rounded +dvix3239 divideint -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 0 +mulx3239 multiply -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 29408596423.801454053855793898323 Inexact Rounded +powx3239 power -5168.2214111091132913776042214525 -5690274 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3239 remainder -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> -5168.2214111091132913776042214525 +subx3239 subtract -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 5685105.8757062385394209792585505 Inexact Rounded +addx3240 add 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 31712.980161250558571611312236423 Inexact Rounded +comx3240 compare 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 1 +divx3240 divide 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -16.319683055519892881394358449220 Inexact Rounded +dvix3240 divideint 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -16 +mulx3240 multiply 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -69933662.130469766080574235843448 Inexact Rounded +powx3240 power 33783.060857197067391462144517964 -2070 -> 3.9181336001803008597293818984406E-9375 Inexact Rounded +remx3240 remainder 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 661.7697220529262738488280133144 +subx3240 subtract 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 35853.141553143576211312976799505 Inexact Rounded +addx3241 add 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 7.3330633078828216018536326743325E+986 Inexact Rounded +comx3241 compare 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> -1 +divx3241 divide 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 5.7557712676064206636178247554056E-1879 Inexact Rounded +dvix3241 divideint 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 0 +mulx3241 multiply 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 3.0950979358603075650592433398939E+95 Inexact Rounded +powx3241 power 42207435091050.840296353874733169E-905 7 -> 2.3862872940615283599573082966642E-6240 Inexact Rounded +remx3241 remainder 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 4.2207435091050840296353874733169E-892 +subx3241 subtract 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> -7.3330633078828216018536326743325E+986 Inexact Rounded +addx3242 add -71800.806700868784841045406679641 -39617456964250697902519150526701 -> -39617456964250697902519150598502 Inexact Rounded +comx3242 compare -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 1 +divx3242 divide -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 1.8123527405017220178579049964126E-27 Inexact Rounded +dvix3242 divideint -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 0 +mulx3242 multiply -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 2.8445653694701522164901827524538E+36 Inexact Rounded +powx3242 power -71800.806700868784841045406679641 -4 -> 3.7625536850895480882178599428774E-20 Inexact Rounded +remx3242 remainder -71800.806700868784841045406679641 -39617456964250697902519150526701 -> -71800.806700868784841045406679641 +subx3242 subtract -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 39617456964250697902519150454900 Inexact Rounded +addx3243 add 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 53627809061.200981502803149181991 Inexact Rounded +comx3243 compare 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 1 +divx3243 divide 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 163369.13159039717901500465109839 Inexact Rounded +dvix3243 divideint 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 163369 +mulx3243 multiply 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 17603733760058752.363123585224369 Inexact Rounded +powx3243 power 53627480801.631504892310016062160 328260 -> Infinity Overflow Inexact Rounded +remx3243 remainder 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 43195.80712523964536237599604393 +subx3243 subtract 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 53627152542.062028281816882942329 Inexact Rounded +addx3244 add -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -5150456970.7802587986281516264289 Inexact Rounded +comx3244 compare -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -1 +divx3244 divide -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 51.633359351732432283879274192947 Inexact Rounded +dvix3244 divideint -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 51 +mulx3244 multiply -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 494424210127893893.12581512954787 Inexact Rounded +powx3244 power -5052601598.5559371338428368438728 -97855372 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3244 remainder -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -61977615.115532229791782933513536 +subx3244 subtract -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -4954746226.3316154690575220613167 Inexact Rounded +addx3245 add 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 4.2708691760149477598920960628392E+477 Inexact Rounded +comx3245 compare 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> -1 +divx3245 divide 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 9.8531098643021951048744078027283E-320 Inexact Rounded +dvix3245 divideint 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 0 +mulx3245 multiply 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 1.7972391158952189002169082753183E+636 Inexact Rounded +powx3245 power 4208134320733.7069742988228068191E+146 4 -> 3.1358723439830872127129821963857E+634 Inexact Rounded +remx3245 remainder 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 4.2081343207337069742988228068191E+158 +subx3245 subtract 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> -4.2708691760149477598920960628392E+477 Inexact Rounded +addx3246 add -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.5077009657942581515590471189084E+308 Inexact Rounded +comx3246 compare -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -1 +divx3246 divide -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.8143110457236089978070419047970E+548 Inexact Rounded +dvix3246 divideint -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> NaN Division_impossible +mulx3246 multiply -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.2117564660363596283732942091852E+68 Inexact Rounded +powx3246 power -8.5077009657942581515590471189084E+308 10 -> 1.9866536812573207868350640760678E+3089 Inexact Rounded +remx3246 remainder -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> NaN Division_impossible +subx3246 subtract -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.5077009657942581515590471189084E+308 Inexact Rounded +addx3247 add -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -9.5049703032286960790904181078063E+622 Inexact Rounded +comx3247 compare -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -1 +divx3247 divide -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> 1.1020772033225707125391212519421E+621 Inexact Rounded +dvix3247 divideint -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> NaN Division_impossible +mulx3247 multiply -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> 8.1976525957425311427858087117655E+624 Inexact Rounded +powx3247 power -9504.9703032286960790904181078063E+619 -86 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3247 remainder -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> NaN Division_impossible +subx3247 subtract -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -9.5049703032286960790904181078063E+622 Inexact Rounded +addx3248 add -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -440323641.68311120898457496019108 Inexact Rounded +comx3248 compare -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -1 +divx3248 divide -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 4285.4305022264473269770246126234 Inexact Rounded +dvix3248 divideint -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 4285 +mulx3248 multiply -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 45221700683419.655596771711603505 Inexact Rounded +powx3248 power -440220916.66716743026896931194749 -102725 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3248 remainder -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -44223.34807563389876658817398125 +subx3248 subtract -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -440118191.65122365155336366370390 Inexact Rounded +addx3249 add -46.250735086006350517943464758019 14656357555174.263295266074908024 -> 14656357555128.012560180068557506 Inexact Rounded +comx3249 compare -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -1 +divx3249 divide -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -3.1556773169523313932207725522866E-12 Inexact Rounded +dvix3249 divideint -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -0 +mulx3249 multiply -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -677867310610152.55569620459788530 Inexact Rounded +powx3249 power -46.250735086006350517943464758019 1 -> -46.250735086006350517943464758019 +remx3249 remainder -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -46.250735086006350517943464758019 +subx3249 subtract -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -14656357555220.514030352081258542 Inexact Rounded +addx3250 add -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -6.1641121299391316420647102699627E+776 Inexact Rounded +comx3250 compare -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -1 +divx3250 divide -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> 6.7076702065897819604716946852581E+291 Inexact Rounded +dvix3250 divideint -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> NaN Division_impossible +mulx3250 multiply -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> 5.6646014458394584921579417504939E+1261 Inexact Rounded +powx3250 power -61641121299391.316420647102699627E+763 -9 -> -7.7833261179975532508748150708605E-6992 Inexact Rounded +remx3250 remainder -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> NaN Division_impossible +subx3250 subtract -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -6.1641121299391316420647102699627E+776 Inexact Rounded +addx3251 add 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -1.9498732131365824921639467044927E-511 Inexact Rounded +comx3251 compare 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 1 +divx3251 divide 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -4.9576772044192514715453215933704E-314 Inexact Rounded +dvix3251 divideint 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -0 +mulx3251 multiply 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -1.8849116232962331617140676274611E-1335 Inexact Rounded +powx3251 power 96668419802749.555738010239087449E-838 -2 -> 1.0701157625268896323611633350003E+1648 Inexact Rounded +remx3251 remainder 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 9.6668419802749555738010239087449E-825 +subx3251 subtract 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 1.9498732131365824921639467044927E-511 Inexact Rounded +addx3252 add -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -8.5345439111979959060312457195190E+154 Inexact Rounded +comx3252 compare -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -1 +divx3252 divide -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -5.1764925822381062287959523371316E+141 Inexact Rounded +dvix3252 divideint -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> NaN Division_impossible +mulx3252 multiply -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -1.4071002443255581217471698731240E+168 Inexact Rounded +powx3252 power -8534543911197995906031245719519E+124 2 -> 7.2838439772166785429482995041337E+309 Inexact Rounded +remx3252 remainder -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> NaN Division_impossible +subx3252 subtract -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -8.5345439111979959060312457195190E+154 Inexact Rounded +addx3253 add -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> 9.2570938837239134052589184917186E+916 Inexact Rounded +comx3253 compare -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -1 +divx3253 divide -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -6.7692307720384142592597124956951E-907 Inexact Rounded +dvix3253 divideint -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -0 +mulx3253 multiply -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -5.8008102109774576654709018012876E+927 Inexact Rounded +powx3253 power -62663404777.352508979582846931050 9 -> -1.4897928814133059615670462753825E+97 Inexact Rounded +remx3253 remainder -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -62663404777.352508979582846931050 +subx3253 subtract -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -9.2570938837239134052589184917186E+916 Inexact Rounded +addx3254 add 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -1.7353669504253419489494030651507E-630 Inexact Rounded +comx3254 compare 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1 +divx3254 divide 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -1.0053212169604565230497117966004E-197 Inexact Rounded +dvix3254 divideint 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -0 +mulx3254 multiply 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -3.0275232892710668432895049546233E-1457 Inexact Rounded +powx3254 power 1.744601214474560992754529320172E-827 -2 -> 3.2855468099615282394992542515980E+1653 Inexact Rounded +remx3254 remainder 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1.744601214474560992754529320172E-827 +subx3254 subtract 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1.7353669504253419489494030651507E-630 Inexact Rounded +addx3255 add 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 4.4103206624152665337631438377420E+751 Inexact Rounded +comx3255 compare 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> -1 +divx3255 divide 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 8.3257335949720619093963917942525E-723 Inexact Rounded +dvix3255 divideint 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 0 +mulx3255 multiply 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 1.6194324757808363802947192054966E+781 Inexact Rounded +powx3255 power 0367191549036702224827734853471 4 -> 1.8179030119354318182493703269258E+118 Inexact Rounded +remx3255 remainder 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 367191549036702224827734853471 +subx3255 subtract 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> -4.4103206624152665337631438377420E+751 Inexact Rounded +addx3256 add 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 97607380.048316862763014969003011 Inexact Rounded +comx3256 compare 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 1 +divx3256 divide 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -1010.0036335861757252324592571874 Inexact Rounded +dvix3256 divideint 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -1010 +mulx3256 multiply 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -9451544582305.1234805483449772252 Inexact Rounded +powx3256 power 097704116.4492566721965710365073 -96736 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3256 remainder 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 351.500049144304942857175263550 +subx3256 subtract 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 97800852.850196481630127104011589 Inexact Rounded +addx3257 add 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 19533298.147150158931958733807878 Inexact Rounded +comx3257 compare 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 1 +divx3257 divide 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 2.4373460837728485395672882395171E+646 Inexact Rounded +dvix3257 divideint 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> NaN Division_impossible +mulx3257 multiply 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 1.5654311016630284502459158971272E-632 Inexact Rounded +powx3257 power 19533298.147150158931958733807878 8 -> 2.1193595047638230427530063654613E+58 Inexact Rounded +remx3257 remainder 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> NaN Division_impossible +subx3257 subtract 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 19533298.147150158931958733807878 Inexact Rounded +addx3258 add -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -23765003221220177430797028997378 Inexact Rounded +comx3258 compare -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -1 +divx3258 divide -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> 1.5631405336020930064824135669541E+966 Inexact Rounded +dvix3258 divideint -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> NaN Division_impossible +mulx3258 multiply -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> 3.6130812678955994625210007005216E-904 Inexact Rounded +powx3258 power -23765003221220177430797028997378 -2 -> 1.7706154318483481190364979209436E-63 Inexact Rounded +remx3258 remainder -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> NaN Division_impossible +subx3258 subtract -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -23765003221220177430797028997378 Inexact Rounded +addx3259 add 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1.2925541937932433359193338910552E+937 Inexact Rounded +comx3259 compare 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1 +divx3259 divide 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> -4.5956836453828213050223260551064E+928 Inexact Rounded +dvix3259 divideint 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> NaN Division_impossible +mulx3259 multiply 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> -3.6353597697504958096931088780367E+945 Inexact Rounded +powx3259 power 129255.41937932433359193338910552E+932 -281253953 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3259 remainder 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> NaN Division_impossible +subx3259 subtract 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1.2925541937932433359193338910552E+937 Inexact Rounded +addx3260 add -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -86331.770222938687407130786425993 Inexact Rounded +comx3260 compare -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -1 +divx3260 divide -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -163.42858201815891408475902229649 Inexact Rounded +dvix3260 divideint -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -163 +mulx3260 multiply -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -46168354.810498682140456143534524 Inexact Rounded +powx3260 power -86863.276249466008289214762980838 532 -> 2.8897579184173839519859710217510E+2627 Inexact Rounded +remx3260 remainder -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -227.79392551270450952658454114212 +subx3260 subtract -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -87394.782275993329171298739535683 Inexact Rounded +addx3261 add -40707.169006771111855573524157083 -68795521421321853333274411827749 -> -68795521421321853333274411868456 Inexact Rounded +comx3261 compare -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 1 +divx3261 divide -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 5.9171248601300236694386185513139E-28 Inexact Rounded +dvix3261 divideint -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 0 +mulx3261 multiply -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 2.8004709174066910577370895499575E+36 Inexact Rounded +powx3261 power -40707.169006771111855573524157083 -7 -> -5.3988802915897595722440392884051E-33 Inexact Rounded +remx3261 remainder -40707.169006771111855573524157083 -68795521421321853333274411827749 -> -40707.169006771111855573524157083 +subx3261 subtract -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 68795521421321853333274411787042 Inexact Rounded +addx3262 add -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -9.0838752568673728630494658778003E+108 Inexact Rounded +comx3262 compare -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -1 +divx3262 divide -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> 1.2308545518588430875268553851424E+106 Inexact Rounded +dvix3262 divideint -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> NaN Division_impossible +mulx3262 multiply -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> 6.7040244160213718891633678248127E+111 Inexact Rounded +powx3262 power -90838752568673.728630494658778003E+095 -738 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3262 remainder -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> NaN Division_impossible +subx3262 subtract -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -9.0838752568673728630494658778003E+108 Inexact Rounded +addx3263 add -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> -3.1196062390425302071032035080570 Inexact Rounded +comx3263 compare -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1 +divx3263 divide -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1.3608643662980066356437236081969E-670 Inexact Rounded +dvix3263 divideint -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 0 +mulx3263 multiply -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1.3243854561493627844105290415330E-669 Inexact Rounded +powx3263 power -4245360967593.9206771555839718158E-682 -3 -> -1.3069414504933253288042820429894E+2008 Inexact Rounded +remx3263 remainder -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> -4.2453609675939206771555839718158E-670 +subx3263 subtract -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 3.1196062390425302071032035080570 Inexact Rounded +addx3264 add -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> -60810.964656409685060465379447110 Inexact Rounded +comx3264 compare -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 1 +divx3264 divide -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 5.6275137635287882875914124742650E-16 Inexact Rounded +dvix3264 divideint -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 0 +mulx3264 multiply -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 0.0000020810396331962224323288744910607 Inexact Rounded +powx3264 power -3422145405774.0800213000547612240E-023 -60811 -> -Infinity Overflow Inexact Rounded +remx3264 remainder -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> -3.4221454057740800213000547612240E-11 +subx3264 subtract -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 60810.964656409616617557263965510 Inexact Rounded +addx3265 add -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> -94860846133404815410816234000694 Inexact Rounded +comx3265 compare -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 1 +divx3265 divide -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 2.5850297647576657819483988845904E-686 Inexact Rounded +dvix3265 divideint -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 0 +mulx3265 multiply -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 2.3261597474398006215017751785104E-622 Inexact Rounded +powx3265 power -24521811.07649485796598387627478E-661 -9 -> -3.1190843559949184618590264246586E+5882 Inexact Rounded +remx3265 remainder -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> -2.452181107649485796598387627478E-654 +subx3265 subtract -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 94860846133404815410816234000694 Inexact Rounded +addx3266 add -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -5038638032824.4395321279731805825 Inexact Rounded +comx3266 compare -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1 +divx3266 divide -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1295.6457979549894351378127413283 Inexact Rounded +dvix3266 divideint -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1295 +mulx3266 multiply -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -19625045834830808256871.952659048 Inexact Rounded +powx3266 power -5042529937498.8944492248538951438 4 -> 6.4653782991800009492580180960839E+50 Inexact Rounded +remx3266 remainder -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -2513384079.7768087643285383187045 +subx3266 subtract -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -5046421842173.3493663217346097051 Inexact Rounded +addx3267 add -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> 2732988.5891363639325008206099712 Inexact Rounded +comx3267 compare -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1 +divx3267 divide -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1.9605795855687791246611683328346E-663 Inexact Rounded +dvix3267 divideint -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -0 +mulx3267 multiply -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1.4644013247528895376254850705597E-650 Inexact Rounded +powx3267 power -535824163.54531747646293693868651E-665 2732989 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3267 remainder -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -5.3582416354531747646293693868651E-657 +subx3267 subtract -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -2732988.5891363639325008206099712 Inexact Rounded +addx3268 add 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 52864854.899420632375589206704068 Inexact Rounded +comx3268 compare 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> -1 +divx3268 divide 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 4.5460641203455697917573431961511E-513 Inexact Rounded +dvix3268 divideint 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 0 +mulx3268 multiply 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 1.2704853045231735885074945710576E-497 Inexact Rounded +powx3268 power 24032.702008553084252925140858134E-509 52864855 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3268 remainder 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 2.4032702008553084252925140858134E-505 +subx3268 subtract 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> -52864854.899420632375589206704068 Inexact Rounded +addx3269 add 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 754.44220417415325444943566016062 Inexact Rounded +comx3269 compare 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> -1 +divx3269 divide 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 9.4842547068617879794218050008353E-489 Inexact Rounded +dvix3269 divideint 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 0 +mulx3269 multiply 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 5.3982769208667021044675146787248E-483 Inexact Rounded +powx3269 power 71553220259.938950698030519906727E-496 754 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3269 remainder 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 7.1553220259938950698030519906727E-486 +subx3269 subtract 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> -754.44220417415325444943566016062 Inexact Rounded +addx3270 add 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 35572.960284795962697740953932508 Inexact Rounded +comx3270 compare 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 1 +divx3270 divide 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 6.8357605153869556504869061469852E+732 Inexact Rounded +dvix3270 divideint 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> NaN Division_impossible +mulx3270 multiply 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 1.8511992931514185102474609686066E-724 Inexact Rounded +powx3270 power 35572.960284795962697740953932508 5 -> 56963942247985404337401.149353169 Inexact Rounded +remx3270 remainder 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> NaN Division_impossible +subx3270 subtract 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 35572.960284795962697740953932508 Inexact Rounded +addx3271 add 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 5.3035405018123760598334895413057E+849 Inexact Rounded +comx3271 compare 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 1 +divx3271 divide 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> -5.5485278436266802470202487233285E+836 Inexact Rounded +dvix3271 divideint 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> NaN Division_impossible +mulx3271 multiply 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> -5.0693702270365259274203181894613E+862 Inexact Rounded +powx3271 power 53035405018123760598334895413057E+818 -10 -> 5.6799053935427267944455848135618E-8498 Inexact Rounded +remx3271 remainder 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> NaN Division_impossible +subx3271 subtract 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 5.3035405018123760598334895413057E+849 Inexact Rounded +addx3272 add 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.8701498316307365714167410690192E+135 Inexact Rounded +comx3272 compare 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> -1 +divx3272 divide 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.6747012716293341927566515915016E-135 Inexact Rounded +dvix3272 divideint 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 0 +mulx3272 multiply 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.4250802116091862185764800227004E+137 Inexact Rounded +powx3272 power 95.490751127249945886828257312118 10 -> 63039548646186864162.847491534337 Inexact Rounded +remx3272 remainder 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 95.490751127249945886828257312118 +subx3272 subtract 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> -9.8701498316307365714167410690192E+135 Inexact Rounded +addx3273 add 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -35119136549015044241500392691977 Inexact Rounded +comx3273 compare 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 1 +divx3273 divide 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -1.9771229338327273644129394734299E-21 Inexact Rounded +dvix3273 divideint 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -0 +mulx3273 multiply 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -2.4384919885057519302646522425980E+42 Inexact Rounded +powx3273 power 69434850287.460788550936730296153 -4 -> 4.3021939605842038995370443743844E-44 Inexact Rounded +remx3273 remainder 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 69434850287.460788550936730296153 +subx3273 subtract 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 35119136549015044241639262392551 Inexact Rounded +addx3274 add -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> -65551667.214560244414938327003123 Inexact Rounded +comx3274 compare -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 1 +divx3274 divide -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 0.0000059835205237890809449684317245033 Inexact Rounded +dvix3274 divideint -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 0 +mulx3274 multiply -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 25711006105.487929108329637701882 Inexact Rounded +powx3274 power -392.22739924621965621739098725407 -65551275 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3274 remainder -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> -392.22739924621965621739098725407 +subx3274 subtract -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 65550882.759761751975625892221149 Inexact Rounded +addx3275 add 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 6437779.6650608333186472347196668 Inexact Rounded +comx3275 compare 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 1 +divx3275 divide 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 261.61406460270241498757868681883 Inexact Rounded +dvix3275 divideint 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 261 +mulx3275 multiply 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 157216217318.36494525300694583138 Inexact Rounded +powx3275 power 6413265.4423561191792972085539457 24514 -> Infinity Overflow Inexact Rounded +remx3275 remainder 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 15053.316425728808940379300726594 +subx3275 subtract 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 6388751.2196514050399471823882246 Inexact Rounded +addx3276 add -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -6.9667706389122107760046184064057E+487 Inexact Rounded +comx3276 compare -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -1 +divx3276 divide -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -2.1498522911689997341347293419761E+486 Inexact Rounded +dvix3276 divideint -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> NaN Division_impossible +mulx3276 multiply -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -2.2576385054257595259511556258470E+489 Inexact Rounded +powx3276 power -6.9667706389122107760046184064057E+487 32 -> Infinity Overflow Inexact Rounded +remx3276 remainder -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> NaN Division_impossible +subx3276 subtract -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -6.9667706389122107760046184064057E+487 Inexact Rounded +addx3277 add 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 77986002255.07800973642274406015 +comx3277 compare 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 1 +divx3277 divide 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -1.2597639604731753284599748820876 Inexact Rounded +dvix3277 divideint 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -1 +mulx3277 multiply 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -113544133799497082075557.21180430 Inexact Rounded +powx3277 power 378204716633.40024100602896057615 -3 -> 1.8484988212401886887562779996737E-35 Inexact Rounded +remx3277 remainder 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 77986002255.07800973642274406015 +subx3277 subtract 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 678423431011.72247227563517709215 +addx3278 add -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -4.4234512012457148027685282969235E+505 Inexact Rounded +comx3278 compare -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -1 +divx3278 divide -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -2.0742325477916347193181603963257E+499 Inexact Rounded +dvix3278 divideint -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> NaN Division_impossible +mulx3278 multiply -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -9.4333301975395170465982968019915E+511 Inexact Rounded +powx3278 power -44234.512012457148027685282969235E+501 2132572 -> Infinity Overflow Inexact Rounded +remx3278 remainder -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> NaN Division_impossible +subx3278 subtract -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -4.4234512012457148027685282969235E+505 Inexact Rounded +addx3279 add -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> 9.7520428746722497621936998533848E+519 Inexact Rounded +comx3279 compare -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -1 +divx3279 divide -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.6449692061227100572768330912162E-590 Inexact Rounded +dvix3279 divideint -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -0 +mulx3279 multiply -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.4664510156653491769901435777060E+450 Inexact Rounded +powx3279 power -3554.5895974968741465654022772100E-073 10 -> 3.2202875716019266933215387456197E-695 Inexact Rounded +remx3279 remainder -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.5545895974968741465654022772100E-70 +subx3279 subtract -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -9.7520428746722497621936998533848E+519 Inexact Rounded +addx3280 add 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 4633944440549.3093886865008969464 Inexact Rounded +comx3280 compare 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> -1 +divx3280 divide 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 0.00016191587157664541463871807382759 Inexact Rounded +dvix3280 divideint 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 0 +mulx3280 multiply 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 3475765273659325895012.7612107556 Inexact Rounded +powx3280 power 750187685.63632608923397234391668 5 -> 2.3760176068829529745152188798557E+44 Inexact Rounded +remx3280 remainder 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 750187685.63632608923397234391668 +subx3280 subtract 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> -4632444065178.0367365080329522586 Inexact Rounded +addx3281 add 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 8038885676320423832297608779.9751 Inexact Rounded +comx3281 compare 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> -1 +divx3281 divide 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 3.7554998862319807295903348960280E-43 Inexact Rounded +dvix3281 divideint 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 0 +mulx3281 multiply 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 24269423384249.611263728854793731 Inexact Rounded +powx3281 power 30190034242853.251165951457589386E-028 8 -> 6.9009494305612589578332690692113E-117 Inexact Rounded +remx3281 remainder 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 3.0190034242853251165951457589386E-15 +subx3281 subtract 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> -8038885676320423832297608779.9751 Inexact Rounded +addx3282 add 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 125946917326.41330773874663377538 Inexact Rounded +comx3282 compare 65.537942676774715953400768803539 125946917260.87536506197191782198 -> -1 +divx3282 divide 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 5.2036162616846894920389414735878E-10 Inexact Rounded +dvix3282 divideint 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 0 +mulx3282 multiply 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 8254301843759.7376990957355411370 Inexact Rounded +powx3282 power 65.537942676774715953400768803539 1 -> 65.537942676774715953400768803539 +remx3282 remainder 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 65.537942676774715953400768803539 +subx3282 subtract 65.537942676774715953400768803539 125946917260.87536506197191782198 -> -125946917195.33742238519720186858 Inexact Rounded +addx3283 add 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8015272349626.7792105333859739528 Inexact Rounded +comx3283 compare 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 1 +divx3283 divide 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8443970438.5560107978790084430110 Inexact Rounded +dvix3283 divideint 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8443970438 +mulx3283 multiply 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 7608339144595734.8984281431471741 Inexact Rounded +powx3283 power 8015272348677.5489394183881813700 949 -> Infinity Overflow Inexact Rounded +remx3283 remainder 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 527.78228041355742397895303690364 +subx3283 subtract 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8015272347728.3186683033903887872 Inexact Rounded +addx3284 add -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -32595333982.670686221204518042250 Inexact Rounded +comx3284 compare -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -1 +divx3284 divide -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -4.7150744038935574574681609457727E+867 Inexact Rounded +dvix3284 divideint -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> NaN Division_impossible +mulx3284 multiply -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -2.2533171407952851885446213697715E-847 Inexact Rounded +powx3284 power -32595333982.67068622120451804225 7 -> -3.9092014148031739666525606093306E+73 Inexact Rounded +remx3284 remainder -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> NaN Division_impossible +subx3284 subtract -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -32595333982.670686221204518042250 Inexact Rounded +addx3285 add -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> 292178000.06450804618299520094843 Inexact Rounded +comx3285 compare -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -1 +divx3285 divide -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -6.0046235559392715334668277026896E-533 Inexact Rounded +dvix3285 divideint -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -0 +mulx3285 multiply -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -5.1260260597833406461110136952456E-516 Inexact Rounded +powx3285 power -17544189017145.710117633021800426E-537 292178000 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3285 remainder -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -1.7544189017145710117633021800426E-524 +subx3285 subtract -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -292178000.06450804618299520094843 Inexact Rounded +addx3286 add -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -506639.97552899703974189156234893 Inexact Rounded +comx3286 compare -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -1 +divx3286 divide -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -45982.150707356329027698717189104 Inexact Rounded +dvix3286 divideint -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -45982 +mulx3286 multiply -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -5582497.2457419607392940234271222 Inexact Rounded +powx3286 power -506650.99395649907139204052441630 11 -> -5.6467412678809885333313818078829E+62 Inexact Rounded +remx3286 remainder -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -1.660558079734242466742739640844 +subx3286 subtract -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -506662.01238400110304218948648367 Inexact Rounded +addx3287 add 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -84.001893040865864590122330800768 Inexact Rounded +comx3287 compare 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 1 +divx3287 divide 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -5.7699118247660357814641813260524E-234 Inexact Rounded +dvix3287 divideint 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -0 +mulx3287 multiply 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -4.0714332866277514481192856925775E-230 Inexact Rounded +powx3287 power 4846835159.5922372307656000769395E-241 -84 -> Infinity Overflow Inexact Rounded +remx3287 remainder 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 4.8468351595922372307656000769395E-232 +subx3287 subtract 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 84.001893040865864590122330800768 Inexact Rounded +addx3288 add -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> -3994308913.2287755451637127790293 Inexact Rounded +comx3288 compare -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 1 +divx3288 divide -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 8.7698052609323004543538163061774E-9 Inexact Rounded +dvix3288 divideint -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 0 +mulx3288 multiply -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 139917887979.72053637272961120639 Inexact Rounded +powx3288 power -35.029311013822259358116556164908 -4 -> 6.6416138040522124693495178218096E-7 Inexact Rounded +remx3288 remainder -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> -35.029311013822259358116556164908 +subx3288 subtract -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 3994308843.1701535175191940627961 Inexact Rounded +addx3289 add 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -5.4918146394484565418284686127552E+374 Inexact Rounded +comx3289 compare 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 1 +divx3289 divide 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -1.3850911310869487895947733090204E-199 Inexact Rounded +dvix3289 divideint 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -0 +mulx3289 multiply 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -4.1774387343310777190917128006589E+550 Inexact Rounded +powx3289 power 7606663750.6735265233044420887018E+166 -5 -> 3.9267106978887346373957314818178E-880 Inexact Rounded +remx3289 remainder 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 7.6066637506735265233044420887018E+175 +subx3289 subtract 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 5.4918146394484565418284686127552E+374 Inexact Rounded +addx3290 add -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -2.5677829660831741274207326697052E-159 Inexact Rounded +comx3290 compare -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -1 +divx3290 divide -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> 2.7277550199853009708493167299838E+671 Inexact Rounded +dvix3290 divideint -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> NaN Division_impossible +mulx3290 multiply -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> 2.4171926410541199393728294762559E-989 Inexact Rounded +powx3290 power -25677.829660831741274207326697052E-163 -9 -> -2.0605121420682764897867221992174E+1427 Inexact Rounded +remx3290 remainder -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> NaN Division_impossible +subx3290 subtract -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -2.5677829660831741274207326697052E-159 Inexact Rounded +addx3291 add 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -1.5412563837540810793697955063295E+554 Inexact Rounded +comx3291 compare 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 1 +divx3291 divide 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -6.3111872313890646144473652645030E-544 Inexact Rounded +dvix3291 divideint 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -0 +mulx3291 multiply 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -1.4992043761340180288065959300090E+565 Inexact Rounded +powx3291 power 97271576094.456406729671729224827 -2 -> 1.0568858765852073181352309401343E-22 Inexact Rounded +remx3291 remainder 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 97271576094.456406729671729224827 +subx3291 subtract 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 1.5412563837540810793697955063295E+554 Inexact Rounded +addx3292 add 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 41139789894.401826915757391777544 Inexact Rounded +comx3292 compare 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 1 +divx3292 divide 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -2196474369511625389289506461551.0 Inexact Rounded +dvix3292 divideint 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -2196474369511625389289506461551 +mulx3292 multiply 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -7.7054498611419776714291080928601E-10 Inexact Rounded +powx3292 power 41139789894.401826915757391777563 -2 -> 5.9084812442741091550891451069919E-22 Inexact Rounded +remx3292 remainder 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 6.98141022640544018935102953527E-22 +subx3292 subtract 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 41139789894.401826915757391777582 Inexact Rounded +addx3293 add -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -83310831287241.777598696853498149 Inexact Rounded +comx3293 compare -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -1 +divx3293 divide -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> 1.5202754978845438636605170857478E+333 Inexact Rounded +dvix3293 divideint -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> NaN Division_impossible +mulx3293 multiply -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> 4.5654189779610386760330527839588E-306 Inexact Rounded +powx3293 power -83310831287241.777598696853498149 -5 -> -2.4916822606682624827900581728387E-70 Inexact Rounded +remx3293 remainder -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> NaN Division_impossible +subx3293 subtract -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -83310831287241.777598696853498149 Inexact Rounded +addx3294 add 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 4506653461.4414974233678331771169 Inexact Rounded +comx3294 compare 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 1 +divx3294 divide 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> -6.0124409901781490054438220048629E+888 Inexact Rounded +dvix3294 divideint 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> NaN Division_impossible +mulx3294 multiply 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> -3.3779833273541776470902903512949E-870 Inexact Rounded +powx3294 power 4506653461.4414974233678331771169 -7 -> 2.6486272911486461102735412463189E-68 Inexact Rounded +remx3294 remainder 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> NaN Division_impossible +subx3294 subtract 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 4506653461.4414974233678331771169 Inexact Rounded +addx3295 add 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 744537.89692255653780778146167691 Inexact Rounded +comx3295 compare 23777.857951114967684767609401626 720760.03897144157012301385227528 -> -1 +divx3295 divide 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 0.032989978169498808275308039034795 Inexact Rounded +dvix3295 divideint 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 0 +mulx3295 multiply 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 17138129823.503025913034987537096 Inexact Rounded +powx3295 power 23777.857951114967684767609401626 720760 -> Infinity Overflow Inexact Rounded +remx3295 remainder 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 23777.857951114967684767609401626 +subx3295 subtract 23777.857951114967684767609401626 720760.03897144157012301385227528 -> -696982.18102032660243824624287365 Inexact Rounded +addx3296 add -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> 6.0802728403071490445256786982100E+541 Inexact Rounded +comx3296 compare -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -1 +divx3296 divide -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -3.5093578667274020123788514069885E-511 Inexact Rounded +dvix3296 divideint -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -0 +mulx3296 multiply -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -1.2973997003625843317417981902198E+573 Inexact Rounded +powx3296 power -21337853323980858055292469611948 6 -> 9.4385298321304970306180652097874E+187 Inexact Rounded +remx3296 remainder -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -21337853323980858055292469611948 +subx3296 subtract -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -6.0802728403071490445256786982100E+541 Inexact Rounded +addx3297 add -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -818408481.65082668425744179302401 Inexact Rounded +comx3297 compare -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1 +divx3297 divide -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1081991.4954690752676494129493403 Inexact Rounded +dvix3297 divideint -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1081991 +mulx3297 multiply -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -619037842458.03980537370328252817 Inexact Rounded +powx3297 power -818409238.0423893439849743856947 756 -> 1.6058883946373232750995543573461E+6738 Inexact Rounded +remx3297 remainder -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -374.76862809126749803143314108840 +subx3297 subtract -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -818409994.43395200371250697836539 Inexact Rounded +addx3298 add 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 47567380385008.954845377769826287 Inexact Rounded +comx3298 compare 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 1 +divx3298 divide 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 730853388480.86247690474303493972 Inexact Rounded +dvix3298 divideint 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 730853388480 +mulx3298 multiply 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 3095909128079784.3348591472999468 Inexact Rounded +powx3298 power 47567380384943.87013600286155046 65 -> 1.0594982876763214301042437482634E+889 Inexact Rounded +remx3298 remainder 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 56.134058687770878126430844955520 +subx3298 subtract 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 47567380384878.785426627953274633 Inexact Rounded +addx3299 add -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -302031659.49048519905267279799984 Inexact Rounded +comx3299 compare -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -1 +divx3299 divide -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 54.765366028496664530688259272591 Inexact Rounded +dvix3299 divideint -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 54 +mulx3299 multiply -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 1606504025402196.8484885386501478 Inexact Rounded +powx3299 power -296615544.05897984545127115290251 -5416115 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3299 remainder -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -4145310.7576907509755823176468844 +subx3299 subtract -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -291199428.62747449184986950780518 Inexact Rounded +addx3300 add 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 6.1391705914046707180652185247584E+749 Inexact Rounded +comx3300 compare 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 1 +divx3300 divide 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> -9.0818539468906248593699700040068E+737 Inexact Rounded +dvix3300 divideint 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> NaN Division_impossible +mulx3300 multiply 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> -4.1499693532587347944890300176290E+761 Inexact Rounded +powx3300 power 61391705914.046707180652185247584E+739 -7 -> 3.0425105291210947473420999890124E-5249 Inexact Rounded +remx3300 remainder 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> NaN Division_impossible +subx3300 subtract 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 6.1391705914046707180652185247584E+749 Inexact Rounded + +-- randomly generated testcases [26 Sep 2001] +precision: 33 +rounding: half_up +maxExponent: 9999 + +addx3401 add 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -1364112374596.82605557115996067822 Inexact Rounded +comx3401 compare 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 1 +divx3401 divide 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -3.12789896373176963160811150593867E-11 Inexact Rounded +dvix3401 divideint 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -0 +mulx3401 multiply 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -58204024324286.5595453066065234923 Inexact Rounded +powx3401 power 042.668056830485571428877212944418 -1 -> 0.0234367363850869744523417227148909 Inexact Rounded +remx3401 remainder 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 42.668056830485571428877212944418 +subx3401 subtract 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 1364112374682.16216923213110353598 Inexact Rounded +addx3402 add -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -3.27179426341653256363531809227344E+455 Inexact Rounded +comx3402 compare -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -1 +divx3402 divide -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -4.31028129684803083255704680611589E+446 Inexact Rounded +dvix3402 divideint -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> NaN Division_impossible +mulx3402 multiply -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -2.48351255171055445110558613627379E+464 Inexact Rounded +powx3402 power -327.179426341653256363531809227344E+453 759067457 -> -Infinity Overflow Inexact Rounded +remx3402 remainder -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> NaN Division_impossible +subx3402 subtract -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -3.27179426341653256363531809227344E+455 Inexact Rounded +addx3403 add 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 900181194.826119246619069527471177 Inexact Rounded +comx3403 compare 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> -1 +divx3403 divide 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 0.0000907917210693679220610511319812826 Inexact Rounded +dvix3403 divideint 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 0 +mulx3403 multiply 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 73557551389502.7779979042453102926 Inexact Rounded +powx3403 power 81721.5803096185422787702538493471 900099473 -> Infinity Overflow Inexact Rounded +remx3403 remainder 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 81721.5803096185422787702538493471 +subx3403 subtract 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> -900017751.665500009534511986963479 Inexact Rounded +addx3404 add 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 72.3239822255871305731314565069132 Inexact Rounded +comx3404 compare 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> -1 +divx3404 divide 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 5.51900935695390664984598248115290E-806 Inexact Rounded +dvix3404 divideint 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 0 +mulx3404 multiply 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 2.88686045809784034794803928177854E-802 Inexact Rounded +powx3404 power 3991.56734635183403814636354392163E-807 72 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3404 remainder 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 3.99156734635183403814636354392163E-804 +subx3404 subtract 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> -72.3239822255871305731314565069132 Inexact Rounded +addx3405 add -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -61.2544651290911805069948520197050 Inexact Rounded +comx3405 compare -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -1 +divx3405 divide -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -13.0464272560079276694749924915850 Inexact Rounded +dvix3405 divideint -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -13 +mulx3405 multiply -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -337.326590072564290813539036280205 Inexact Rounded +powx3405 power -66.3393308595957726456416979163306 5 -> -1284858888.27285822259184896667990 Inexact Rounded +remx3405 remainder -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -0.23607636303607484323270126019793 +subx3405 subtract -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -71.4241965901003647842885438129562 Inexact Rounded +addx3406 add -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -3.93606873703567753255097095208112E+116 Inexact Rounded +comx3406 compare -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -1 +divx3406 divide -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> 1.85284350396137075010428736564737E+107 Inexact Rounded +dvix3406 divideint -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> NaN Division_impossible +mulx3406 multiply -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> 8.36154649302353269818801263275941E+125 Inexact Rounded +powx3406 power -393606.873703567753255097095208112E+111 -2 -> 6.45467904123103560528919747688443E-234 Inexact Rounded +remx3406 remainder -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> NaN Division_impossible +subx3406 subtract -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -3.93606873703567753255097095208112E+116 Inexact Rounded +addx3407 add -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> -877573445.238180259264773343614397 +comx3407 compare -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 1 +divx3407 divide -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 0.0222888053076312565797460650311070 Inexact Rounded +dvix3407 divideint -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 0 +mulx3407 multiply -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 16425043456056213.7395191514029288 Inexact Rounded +powx3407 power -019133598.609812524622150421584346 -858439847 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3407 remainder -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> -19133598.609812524622150421584346 +subx3407 subtract -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 839306248.018555210020472500445705 +addx3408 add 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 240910.327926825971183391888394542 Inexact Rounded +comx3408 compare 465.351982159046525762715549761814 240444.975944666924657629172844780 -> -1 +divx3408 divide 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 0.00193537827243326122782974132829095 Inexact Rounded +dvix3408 divideint 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 0 +mulx3408 multiply 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 111891546.156035013780371395668674 Inexact Rounded +powx3408 power 465.351982159046525762715549761814 240445 -> Infinity Overflow Inexact Rounded +remx3408 remainder 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 465.351982159046525762715549761814 +subx3408 subtract 465.351982159046525762715549761814 240444.975944666924657629172844780 -> -239979.623962507878131866457295018 Inexact Rounded +addx3409 add 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 28066955004783.1076824222873384828 Inexact Rounded +comx3409 compare 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 1 +divx3409 divide 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 4.90938543219432390013656968123815E+722 Inexact Rounded +dvix3409 divideint 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> NaN Division_impossible +mulx3409 multiply 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 1.60458773123547770690452195569223E-696 Inexact Rounded +powx3409 power 28066955004783.1076824222873384828 6 -> 4.88845689938951583020171325568218E+80 Inexact Rounded +remx3409 remainder 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> NaN Division_impossible +subx3409 subtract 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 28066955004783.1076824222873384828 Inexact Rounded +addx3410 add 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 2.82120384825243127096613158419270E+429 Inexact Rounded +comx3410 compare 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> -1 +divx3410 divide 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 1.00224012330435927467559203688861E-416 Inexact Rounded +dvix3410 divideint 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 0 +mulx3410 multiply 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 7.97702072298089605706798770013561E+442 Inexact Rounded +powx3410 power 28275236927392.4960902824105246047 3 -> 2.26057415546622161347322061281516E+40 Inexact Rounded +remx3410 remainder 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 28275236927392.4960902824105246047 +subx3410 subtract 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> -2.82120384825243127096613158419270E+429 Inexact Rounded +addx3411 add 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 11783.4098484281593848173575655680 Inexact Rounded +comx3411 compare 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 1 +divx3411 divide 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -1394.73214754836418731335761858151 Inexact Rounded +dvix3411 divideint 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -1394 +mulx3411 multiply 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -99695.1757167732926302533138186716 Inexact Rounded +powx3411 power 11791.8644211874630234271801789996 -8 -> 2.67510099318723516565332928253711E-33 Inexact Rounded +remx3411 remainder 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 6.18999471819080133445705535281046 +subx3411 subtract 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 11800.3189939467666620370027924312 Inexact Rounded +addx3412 add 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -9292.34554725628103950730533220061 Inexact Rounded +comx3412 compare 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 1 +divx3412 divide 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -0.00478829121953512281527242631775613 Inexact Rounded +dvix3412 divideint 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -0 +mulx3412 multiply 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -417446.000545543168866158913077419 Inexact Rounded +powx3412 power 44.7085340739581668975502342787578 -9337 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3412 remainder 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 44.7085340739581668975502342787578 +subx3412 subtract 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 9381.76261540419737330240580075813 Inexact Rounded +addx3413 add 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 9.33545274288045458053295581965867E+589 Inexact Rounded +comx3413 compare 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 1 +divx3413 divide 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> -1.08992064752484400353231056271614E+578 Inexact Rounded +dvix3413 divideint 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> NaN Division_impossible +mulx3413 multiply 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> -7.99605715447900642683774360731254E+601 Inexact Rounded +powx3413 power 93354527428804.5458053295581965867E+576 -9 -> 1.85687015691763406448005521221518E-5310 Inexact Rounded +remx3413 remainder 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> NaN Division_impossible +subx3413 subtract 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 9.33545274288045458053295581965867E+589 Inexact Rounded +addx3414 add -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -367399415798804503177950095289166 Inexact Rounded +comx3414 compare -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -1 +divx3414 divide -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 6698784465980529140072174.30474769 Inexact Rounded +dvix3414 divideint -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 6698784465980529140072174 +mulx3414 multiply -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 2.01502722493617222018040789291414E+40 Inexact Rounded +powx3414 power -367399415798804503177950040443482 -54845684 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3414 remainder -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -16714095.6549657189177857892292804 +subx3414 subtract -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -367399415798804503177949985597798 Inexact Rounded +addx3415 add -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> 89529730127.7712289354674386343440 Inexact Rounded +comx3415 compare -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -1 +divx3415 divide -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -3.20738060264454013174835928754430E-11 Inexact Rounded +dvix3415 divideint -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -0 +mulx3415 multiply -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -257089920034.115975469931085527642 Inexact Rounded +powx3415 power -2.87155919781024108503670175443740 9 -> -13275.7774683251354527310820885737 Inexact Rounded +remx3415 remainder -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -2.87155919781024108503670175443740 +subx3415 subtract -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -89529730133.5143473310879208044174 Inexact Rounded +addx3416 add -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1.06939343381794796521780572792040E+189 Inexact Rounded +comx3416 compare -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1 +divx3416 divide -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -4.03774938598259547575707503087638E+184 Inexact Rounded +dvix3416 divideint -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> NaN Division_impossible +mulx3416 multiply -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -2.83227661494558963558481633880647E+193 Inexact Rounded +powx3416 power -010.693934338179479652178057279204E+188 26485 -> -Infinity Overflow Inexact Rounded +remx3416 remainder -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> NaN Division_impossible +subx3416 subtract -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1.06939343381794796521780572792040E+189 Inexact Rounded +addx3417 add 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 621838312788.308537943268041906168 +comx3417 compare 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 1 +divx3417 divide 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 60.0678575886074367081836436812959 Inexact Rounded +dvix3417 divideint 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 60 +mulx3417 multiply 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 6228331603681663511826.60450280350 Inexact Rounded +powx3417 power 611655569568.832698912762075889186 1 -> 611655569568.832698912762075889186 +remx3417 remainder 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 690976400.282357082404114870266 +subx3417 subtract 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 601472826349.356859882256109872204 +addx3418 add 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 3457945.39110674985794181949638944 Inexact Rounded +comx3418 compare 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 1 +divx3418 divide 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -1729387.11663991852426428263230475 Inexact Rounded +dvix3418 divideint 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -1729387 +mulx3418 multiply 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -6914241.49127918361259252956576654 Inexact Rounded +powx3418 power 3457947.39062863674882672518304442 -2 -> 8.36302195229701913376802373659526E-14 Inexact Rounded +remx3418 remainder 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 0.2332240699744359979851713353525 +subx3418 subtract 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 3457949.39015052363971163086969940 Inexact Rounded +addx3419 add -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -53308666960535.7393391289364591513 Inexact Rounded +comx3419 compare -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -1 +divx3419 divide -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> 8.16740037282731870883136714441204E+451 Inexact Rounded +dvix3419 divideint -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> NaN Division_impossible +mulx3419 multiply -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> 3.47945961185390084641156250100085E-425 Inexact Rounded +powx3419 power -53308666960535.7393391289364591513 -7 -> -8.17363502380497033342380498988958E-97 Inexact Rounded +remx3419 remainder -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> NaN Division_impossible +subx3419 subtract -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -53308666960535.7393391289364591513 Inexact Rounded +addx3420 add -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> -413474500.320043571235254629529038 Inexact Rounded +comx3420 compare -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 1 +divx3420 divide -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 0.0136503290701197094953429018013146 Inexact Rounded +dvix3420 divideint -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 0 +mulx3420 multiply -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 2271246398971702.91169807728132089 Inexact Rounded +powx3420 power -5568057.17870139549478277980540034 -407906443 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3420 remainder -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> -5568057.17870139549478277980540034 +subx3420 subtract -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 402338385.962640780245689069918238 Inexact Rounded +addx3421 add 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 9804385357.63872821851861785530505 Inexact Rounded +comx3421 compare 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 1 +divx3421 divide 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 116519965.821719977402398190558439 Inexact Rounded +dvix3421 divideint 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 116519965 +mulx3421 multiply 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 824974242939.691780798621180901714 Inexact Rounded +powx3421 power 9804385273.49533524416415189990857 84 -> 1.90244010779692739037080418507909E+839 Inexact Rounded +remx3421 remainder 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 69.1423069734476624350435642749915 +subx3421 subtract 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 9804385189.35194226980968594451209 Inexact Rounded +addx3422 add -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> -5874220715892.91440069210512515154 Inexact Rounded +comx3422 compare -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 1 +divx3422 divide -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 8.91166886601477021757439826903776E-548 Inexact Rounded +dvix3422 divideint -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 0 +mulx3422 multiply -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 3.07510225632952455144944282925583E-522 Inexact Rounded +powx3422 power -5234910986592.18801727046580014273E-547 -6 -> 4.85896970703117149235935037271084E+3205 Inexact Rounded +remx3422 remainder -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> -5.23491098659218801727046580014273E-535 +subx3422 subtract -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 5874220715892.91440069210512515154 Inexact Rounded +addx3423 add 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 5.17546816784872628933218985216916E-259 Inexact Rounded +comx3423 compare 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> -1 +divx3423 divide 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 1.34947513442491971488363250398908E-204 Inexact Rounded +dvix3423 divideint 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 0 +mulx3423 multiply 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 3.61463267496484976064271305679796E-721 Inexact Rounded +powx3423 power 698416560151955285929747633786867E-495 5 -> 1.66177661007189430761396979787413E-2311 Inexact Rounded +remx3423 remainder 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 6.98416560151955285929747633786867E-463 +subx3423 subtract 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> -5.17546816784872628933218985216916E-259 Inexact Rounded +addx3424 add 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 107635.497735316515080720330536027 Inexact Rounded +comx3424 compare 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 1 +divx3424 divide 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> -2.70980469844599888443309571235597E+603 Inexact Rounded +dvix3424 divideint 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> NaN Division_impossible +mulx3424 multiply 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> -4.27536360069537352698066408021773E-594 Inexact Rounded +powx3424 power 107635.497735316515080720330536027 -4 -> 7.45037111502910487803432806334714E-21 Inexact Rounded +remx3424 remainder 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> NaN Division_impossible +subx3424 subtract 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 107635.497735316515080720330536027 Inexact Rounded +addx3425 add -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> 7.95188637593855925052747867099091E+421 Inexact Rounded +comx3425 compare -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -1 +divx3425 divide -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -4.04612060894658007715621807881076E-409 Inexact Rounded +dvix3425 divideint -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -0 +mulx3425 multiply -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -2.55846309007242668513226814043593E+435 Inexact Rounded +powx3425 power -32174291345686.5371446616670961807 8 -> 1.14834377656109143210058690590666E+108 Inexact Rounded +remx3425 remainder -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -32174291345686.5371446616670961807 +subx3425 subtract -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -7.95188637593855925052747867099091E+421 Inexact Rounded +addx3426 add -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> -9.31730631474527142307644239919480E+904 Inexact Rounded +comx3426 compare -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 1 +divx3426 divide -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 8.74902060655796717043678441884283E-208 Inexact Rounded +dvix3426 divideint -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 0 +mulx3426 multiply -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 7.59521700128037149179751467730962E+1602 Inexact Rounded +powx3426 power -8151730494.53190523620899410544099E+688 -9 -> -6.29146352774842448375275282183700E-6282 Inexact Rounded +remx3426 remainder -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> -8.15173049453190523620899410544099E+697 +subx3426 subtract -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 9.31730631474527142307644239919480E+904 Inexact Rounded +addx3427 add 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -5.66230530039528969825480755159562E+463 Inexact Rounded +comx3427 compare 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 1 +divx3427 divide 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -2.36034255052700900395787131334608E-464 Inexact Rounded +dvix3427 divideint 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -0 +mulx3427 multiply 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -7.56765978558098558928268129700052E+463 Inexact Rounded +powx3427 power 1.33649801345976199708341799505220 -6 -> 0.175464835912284900180305028965188 Inexact Rounded +remx3427 remainder 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 1.33649801345976199708341799505220 +subx3427 subtract 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 5.66230530039528969825480755159562E+463 Inexact Rounded +addx3428 add 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 67762238162788.6551061476018185196 Inexact Rounded +comx3428 compare 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 1 +divx3428 divide 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> -1.10348321777294157014941951870409E+832 Inexact Rounded +dvix3428 divideint 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> NaN Division_impossible +mulx3428 multiply 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> -4.16111531818085838717201828773857E-805 Inexact Rounded +powx3428 power 67762238162788.6551061476018185196 -6 -> 1.03293631708006509074972764670281E-83 Inexact Rounded +remx3428 remainder 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> NaN Division_impossible +subx3428 subtract 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 67762238162788.6551061476018185196 Inexact Rounded +addx3429 add 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 6.28677291578497580015557979349893E+823 Inexact Rounded +comx3429 compare 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> -1 +divx3429 divide 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 6.81838333133660025740681459349372E-818 Inexact Rounded +dvix3429 divideint 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 0 +mulx3429 multiply 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 2.69486466971438542975159893306219E+830 Inexact Rounded +powx3429 power 4286562.76568866751577306056498271 6 -> 6.20376193064412081058181881805108E+39 Inexact Rounded +remx3429 remainder 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 4286562.76568866751577306056498271 +subx3429 subtract 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> -6.28677291578497580015557979349893E+823 Inexact Rounded +addx3430 add -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -765715.663995796739622174820554104 Inexact Rounded +comx3430 compare -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -1 +divx3430 divide -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -11401.7814363639478774761697650867 Inexact Rounded +dvix3430 divideint -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -11401 +mulx3430 multiply -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -51432606.5679912088468256122315944 Inexact Rounded +powx3430 power -765782.827432642697305644096365566 67 -> -1.71821200770749773595473594136582E+394 Inexact Rounded +remx3430 remainder -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -52.4839518791480724305698888408548 +subx3430 subtract -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -765849.990869488654989113372177028 Inexact Rounded +addx3431 add 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 105.582516975019937108929234216907 Inexact Rounded +comx3431 compare 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> -1 +divx3431 divide 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 0.780513207299722975882416995140701 Inexact Rounded +dvix3431 divideint 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 0 +mulx3431 multiply 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 2744.56726509164060561370653286614 Inexact Rounded +powx3431 power 46.2835931916106252756465724211276 59 -> 1.82052645780601002671007943923993E+98 Inexact Rounded +remx3431 remainder 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 46.2835931916106252756465724211276 +subx3431 subtract 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> -13.0153305917986865576360893746515 +addx3432 add -3029555.82298840234029474459694644 857535844655004737373089601128532 -> 857535844655004737373089598098976 Inexact Rounded +comx3432 compare -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -1 +divx3432 divide -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -3.53286202771759704502126811323937E-27 Inexact Rounded +dvix3432 divideint -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -0 +mulx3432 multiply -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -2.59795271159584761928986181925721E+39 Inexact Rounded +powx3432 power -3029555.82298840234029474459694644 9 -> -2.14986224790431302561340100746360E+58 Inexact Rounded +remx3432 remainder -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -3029555.82298840234029474459694644 +subx3432 subtract -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -857535844655004737373089604158088 Inexact Rounded +addx3433 add -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> 481026979918882487383654367924619 Inexact Rounded +comx3433 compare -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -1 +divx3433 divide -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -2.87856597038397207797777811199804E-970 Inexact Rounded +dvix3433 divideint -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -0 +mulx3433 multiply -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -6.66062615833636908683785283687416E-905 Inexact Rounded +powx3433 power -0138466789523.10694176543700501945E-948 5 -> -5.09012109092637525843636056746667E-4685 Inexact Rounded +remx3433 remainder -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -1.3846678952310694176543700501945E-937 +subx3433 subtract -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -481026979918882487383654367924619 Inexact Rounded +addx3434 add -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> -8.76320343474845477961976776833770E+779 Inexact Rounded +comx3434 compare -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 1 +divx3434 divide -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 1.09475564939253134070730299863765E-770 Inexact Rounded +dvix3434 divideint -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 0 +mulx3434 multiply -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 8.40703746148119867711463485065336E+789 Inexact Rounded +powx3434 power -9593566466.96690575714244442109870 -9 -> -1.45271091841882960010964421066745E-90 Inexact Rounded +remx3434 remainder -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> -9593566466.96690575714244442109870 +subx3434 subtract -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 8.76320343474845477961976776833770E+779 Inexact Rounded +addx3435 add -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> 5.65688889355241946154894311253202E-458 Inexact Rounded +comx3435 compare -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -1 +divx3435 divide -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -5.63791814686655486612569970629128E-438 Inexact Rounded +dvix3435 divideint -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -0 +mulx3435 multiply -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -1.80415590504280580443565448126548E-1352 Inexact Rounded +powx3435 power -3189.30765477670526823106100241863E-898 6 -> 1.05239431027683904514311527228736E-5367 Inexact Rounded +remx3435 remainder -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -3.18930765477670526823106100241863E-895 +subx3435 subtract -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -5.65688889355241946154894311253202E-458 Inexact Rounded +addx3436 add -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> -6.31925802672685034379197328370812E+538 Inexact Rounded +comx3436 compare -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 1 +divx3436 divide -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 2.70356936263934622050341328519534E-529 Inexact Rounded +dvix3436 divideint -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 0 +mulx3436 multiply -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 1.07961694859382462346866817306769E+549 Inexact Rounded +powx3436 power -17084552395.6714834680088150543965 -6 -> 4.02141014977177984123011868387622E-62 Inexact Rounded +remx3436 remainder -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> -17084552395.6714834680088150543965 +subx3436 subtract -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 6.31925802672685034379197328370812E+538 Inexact Rounded +addx3437 add 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 34956830.3498233068159118874697600 Inexact Rounded +comx3437 compare 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 1 +divx3437 divide 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> -5.67473494371787737607169979602343E+666 Inexact Rounded +dvix3437 divideint 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> NaN Division_impossible +mulx3437 multiply 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> -2.15336927667273841617128781173293E-652 Inexact Rounded +powx3437 power 034956830.349823306815911887469760 -6 -> 5.48034272566098493462169431762597E-46 Inexact Rounded +remx3437 remainder 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> NaN Division_impossible +subx3437 subtract 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 34956830.3498233068159118874697600 Inexact Rounded +addx3438 add -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -743.513686646195531912469919819067 Inexact Rounded +comx3438 compare -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -1 +divx3438 divide -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -38.3130314835722766807703585435688 Inexact Rounded +dvix3438 divideint -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -38 +mulx3438 multiply -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -15212.5977643862002585039364868883 Inexact Rounded +powx3438 power -763.440067781256632695791981893608 20 -> 4.52375407727336769552481661250924E+57 Inexact Rounded +remx3438 remainder -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -6.2375846489348029295536230610386 +subx3438 subtract -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -783.366448916317733479114043968149 Inexact Rounded +addx3439 add -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -5.10472027868440667684575147556654E+821 Inexact Rounded +comx3439 compare -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -1 +divx3439 divide -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -6.11437198047603754107526874071737E+788 Inexact Rounded +dvix3439 divideint -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> NaN Division_impossible +mulx3439 multiply -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -4.26178996090176289115594057419892E+854 Inexact Rounded +powx3439 power -510472027868440667684575147556654E+789 8 -> 4.61079266619522147262600755274182E+6573 Inexact Rounded +remx3439 remainder -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> NaN Division_impossible +subx3439 subtract -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -5.10472027868440667684575147556654E+821 Inexact Rounded +addx3440 add 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 7.03047615605170866769935030348280E-87 Inexact Rounded +comx3440 compare 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 1 +divx3440 divide 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> -3.95554019499502537743883483402608E+670 Inexact Rounded +dvix3440 divideint 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> NaN Division_impossible +mulx3440 multiply 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> -1.24957888288817581538108991453732E-843 Inexact Rounded +powx3440 power 070304761.560517086676993503034828E-094 -2 -> 2.02316135427631488479902919959627E+172 Inexact Rounded +remx3440 remainder 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> NaN Division_impossible +subx3440 subtract 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 7.03047615605170866769935030348280E-87 Inexact Rounded +addx3441 add -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -970725702203.695030010334183533769 Inexact Rounded +comx3441 compare -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -1 +divx3441 divide -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 213749425.654447811698884007553614 Inexact Rounded +dvix3441 divideint -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 213749425 +mulx3441 multiply -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 4408472103336875.21161867891724392 Inexact Rounded +powx3441 power -0970725697662.27605454336231195463 -4541 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3441 remainder -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -2972.12171050214753770792631747550 +subx3441 subtract -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -970725693120.857079076390440375491 Inexact Rounded +addx3442 add -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -808178238631844268316111260157075 Inexact Rounded +comx3442 compare -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -1 +divx3442 divide -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 1350564640015847635178945884.97836 Inexact Rounded +dvix3442 divideint -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 1350564640015847635178945884 +mulx3442 multiply -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 4.83614072252332979731348423145208E+38 Inexact Rounded +powx3442 power -808178238631844268316111259558675 -598400 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3442 remainder -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -585452.097764536570956813681556320 +subx3442 subtract -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -808178238631844268316111258960275 Inexact Rounded +addx3443 add -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> -41.5341827319983835079860474697980 Rounded +comx3443 compare -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 1 +divx3443 divide -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 0.313295770023233218639213140599856 Inexact Rounded +dvix3443 divideint -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 0 +mulx3443 multiply -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 313.357994403604968250936036978086 Inexact Rounded +powx3443 power -9.90826595069053564311371766315200 -32 -> 1.34299698259038003011439568004625E-32 Inexact Rounded +remx3443 remainder -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> -9.90826595069053564311371766315200 +subx3443 subtract -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 21.7176508306173122217586121434940 Rounded +addx3444 add -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -238194.467436351098567470879626885 Inexact Rounded +comx3444 compare -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -1 +divx3444 divide -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 4.77175317088274715226553516820589 Inexact Rounded +dvix3444 divideint -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 4 +mulx3444 multiply -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 8126916733.40905487026003135987472 Inexact Rounded +powx3444 power -196925.469891897719160698483752907 -41269 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3444 remainder -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -31849.4797140842015336089002569958 +subx3444 subtract -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -155656.472347444339753926087878929 Inexact Rounded +addx3445 add 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 421071135212152225162086005824310 Inexact Rounded +comx3445 compare 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 1 +divx3445 divide 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 3.15333426537349744281860005497304E+627 Inexact Rounded +dvix3445 divideint 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> NaN Division_impossible +mulx3445 multiply 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 5.62264847262712040027311932121460E-563 Inexact Rounded +powx3445 power 421071135212152225162086005824310 1 -> 421071135212152225162086005824310 +remx3445 remainder 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> NaN Division_impossible +subx3445 subtract 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 421071135212152225162086005824310 Inexact Rounded +addx3446 add 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1249441.46421514282301182772247227 Inexact Rounded +comx3446 compare 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1 +divx3446 divide 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> -4.31066764178328992440635387255816E+676 Inexact Rounded +dvix3446 divideint 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> NaN Division_impossible +mulx3446 multiply 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> -3.62148999233506984566620611700349E-665 Inexact Rounded +powx3446 power 1249441.46421514282301182772247227 -3 -> 5.12686942572191282348415024932322E-19 Inexact Rounded +remx3446 remainder 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> NaN Division_impossible +subx3446 subtract 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1249441.46421514282301182772247227 Inexact Rounded +addx3447 add 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -6.90425401708167622194241915195001E+923 Inexact Rounded +comx3447 compare 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 1 +divx3447 divide 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -1.08360729901578455109968388309079E-916 Inexact Rounded +dvix3447 divideint 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -0 +mulx3447 multiply 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -5.16541767544616308732028810026275E+931 Inexact Rounded +powx3447 power 74815000.4716875558358937279052903 -7 -> 7.62218032252683815537906972439985E-56 Inexact Rounded +remx3447 remainder 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 74815000.4716875558358937279052903 +subx3447 subtract 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 6.90425401708167622194241915195001E+923 Inexact Rounded +addx3448 add -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> -72394386611338.3523609383834372430 Inexact Rounded +comx3448 compare -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 1 +divx3448 divide -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 2.32613829621244113284301004158794E-8 Inexact Rounded +dvix3448 divideint -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 0 +mulx3448 multiply -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 121911674530293613615.441384822381 Inexact Rounded +powx3448 power -1683993.51210241555668790556759021 -7 -> -2.60385683509956889000676113860292E-44 Inexact Rounded +remx3448 remainder -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> -1683993.51210241555668790556759021 +subx3448 subtract -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 72394383243351.3281561072700614318 Inexact Rounded +addx3449 add -763.148530974741766171756970448158 517370.808956957601473642272664647 -> 516607.660425982859707470515694199 Inexact Rounded +comx3449 compare -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -1 +divx3449 divide -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -0.00147505139014951946381155525173867 Inexact Rounded +dvix3449 divideint -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -0 +mulx3449 multiply -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -394830772.824715962925351447322187 Inexact Rounded +powx3449 power -763.148530974741766171756970448158 517371 -> -Infinity Overflow Inexact Rounded +remx3449 remainder -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -763.148530974741766171756970448158 +subx3449 subtract -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -518133.957487932343239814029635095 Inexact Rounded +addx3450 add -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> -9.27540422641025050968830154578151E+532 Inexact Rounded +comx3450 compare -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 1 +divx3450 divide -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 8.36450164191471769978415758342237E-532 Inexact Rounded +dvix3450 divideint -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 0 +mulx3450 multiply -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 7.19624203304351070562409746475943E+534 Inexact Rounded +powx3450 power -77.5841338812312523460591226178754 -9 -> -9.81846856873938549466341693997829E-18 Inexact Rounded +remx3450 remainder -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> -77.5841338812312523460591226178754 +subx3450 subtract -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 9.27540422641025050968830154578151E+532 Inexact Rounded +addx3451 add 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 5176165576.79580866488385418967956 Inexact Rounded +comx3451 compare 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 1 +divx3451 divide 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -39899.5720067736855444089432524094 Inexact Rounded +dvix3451 divideint 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -39899 +mulx3451 multiply 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -671536855852442.071887385512001794 Inexact Rounded +powx3451 power 5176295309.89943746236102209837813 -129733 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3451 remainder 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 74208.214046920838632934314641965 +subx3451 subtract 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 5176425043.00306625983819000707670 Inexact Rounded +addx3452 add 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 4.47163484116690197229286530307326E+184 Inexact Rounded +comx3452 compare 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1 +divx3452 divide 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1.41906636616314987705536737025932E+1129 Inexact Rounded +dvix3452 divideint 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> NaN Division_impossible +mulx3452 multiply 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1.40906152309150441010046222214810E-760 Inexact Rounded +powx3452 power 4471634841166.90197229286530307326E+172 3 -> 8.94126556389673498386397569249516E+553 Inexact Rounded +remx3452 remainder 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> NaN Division_impossible +subx3452 subtract 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 4.47163484116690197229286530307326E+184 Inexact Rounded +addx3453 add -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -8189130.15945231049670285726774317 Inexact Rounded +comx3453 compare -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -1 +divx3453 divide -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -3.17515949922556778343526099830093E+372 Inexact Rounded +dvix3453 divideint -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> NaN Division_impossible +mulx3453 multiply -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -2.11207823685103185039979144161848E-359 Inexact Rounded +powx3453 power -8189130.15945231049670285726774317 3 -> -549178241054875982731.000937875885 Inexact Rounded +remx3453 remainder -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> NaN Division_impossible +subx3453 subtract -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -8189130.15945231049670285726774317 Inexact Rounded +addx3454 add -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -254346232981353293392888785644009 Inexact Rounded +comx3454 compare -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -1 +divx3454 divide -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 332732350833857889204406356900.665 Inexact Rounded +dvix3454 divideint -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 332732350833857889204406356900 +mulx3454 multiply -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 1.94426559574627262006307326336289E+35 Inexact Rounded +powx3454 power -254346232981353293392888785643245 -764 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3454 remainder -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -508.299323962538610580669092979500 +subx3454 subtract -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -254346232981353293392888785642481 Inexact Rounded +addx3455 add -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> -16063.2166595009220002171676000611 Inexact Rounded +comx3455 compare -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 1 +divx3455 divide -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 0.218031569091122520391599541575615 Inexact Rounded +dvix3455 divideint -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 0 +mulx3455 multiply -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 37919912.4040225840727281633024665 Inexact Rounded +powx3455 power -2875.36745499544177964804277329726 -13188 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3455 remainder -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> -2875.36745499544177964804277329726 +subx3455 subtract -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 10312.4817495100384409210820534665 Inexact Rounded +addx3456 add -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -7.26927570984219944693602140223103 Inexact Rounded +comx3456 compare -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -1 +divx3456 divide -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -4.51836100553039917574557235275173E+427 Inexact Rounded +dvix3456 divideint -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> NaN Division_impossible +mulx3456 multiply -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -1.16950304061635681891361504442479E-426 Inexact Rounded +powx3456 power -7.26927570984219944693602140223103 2 -> 52.8423693457018126451998096211036 Inexact Rounded +remx3456 remainder -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> NaN Division_impossible +subx3456 subtract -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -7.26927570984219944693602140223103 Inexact Rounded +addx3457 add -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -2.85671516868762752241056540028515E+505 Inexact Rounded +comx3457 compare -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -1 +divx3457 divide -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> 6.39064071690455919792707589054106E+501 Inexact Rounded +dvix3457 divideint -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> NaN Division_impossible +mulx3457 multiply -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> 1.27699583132923253605397736797000E+509 Inexact Rounded +powx3457 power -28567151.6868762752241056540028515E+498 -4470 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3457 remainder -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> NaN Division_impossible +subx3457 subtract -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -2.85671516868762752241056540028515E+505 Inexact Rounded +addx3458 add 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 7191835.18758398207642347765831492 Inexact Rounded +comx3458 compare 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 1 +divx3458 divide 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 88363.9812586188186733935569874100 Inexact Rounded +dvix3458 divideint 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 88363 +mulx3458 multiply 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 585321326.397904638863485891524555 Inexact Rounded +powx3458 power 7191753.79974136447257468282073718 81 -> 2.53290983138561482612557404148760E+555 Inexact Rounded +remx3458 remainder 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 79.8625220355815164499390351500273 +subx3458 subtract 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 7191672.41189874686872588798315944 Inexact Rounded +addx3459 add 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 502976488.859892968179149660674285 Inexact Rounded +comx3459 compare 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 1 +divx3459 divide 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 734496.390406706323899801641278933 Inexact Rounded +dvix3459 divideint 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 734496 +mulx3459 multiply 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 344432815169.648082754214631086270 Inexact Rounded +powx3459 power 502975804.069864536104621700404770 685 -> 3.62876716573623552761739177592677E+5960 Inexact Rounded +remx3459 remainder 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 267.346619523615915582548420925472 +subx3459 subtract 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 502975119.279836104030093740135255 Inexact Rounded +addx3460 add 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1040125.74219736715313697451377660 Inexact Rounded +comx3460 compare 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1 +divx3460 divide 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -3.23566278503319947059213001405065 Inexact Rounded +dvix3460 divideint 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -3 +mulx3460 multiply 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -700361636056.225618266296899048765 Inexact Rounded +powx3460 power 1505368.42063731861590460453659570 -465243 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3460 remainder 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 109640.385317464227601714468138385 +subx3460 subtract 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1970611.09907727007867223455941481 Inexact Rounded +addx3461 add 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 77809073.3514961963946898136677398 Inexact Rounded +comx3461 compare 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 1 +divx3461 divide 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 8.06437785764050431295652411163382 Inexact Rounded +dvix3461 divideint 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 8 +mulx3461 multiply 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 594231065731939.137329770485497261 Inexact Rounded +powx3461 power 69225023.2850142784063416137144829 8584050 -> Infinity Overflow Inexact Rounded +remx3461 remainder 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 552622.75315893449955601408842746 +subx3461 subtract 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 60640973.2185323604179934137612260 Inexact Rounded +addx3462 add -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -5.56695018537751006841940471339310E+624 Inexact Rounded +comx3462 compare -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -1 +divx3462 divide -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -9.06661464189378059067792554300676E+616 Inexact Rounded +dvix3462 divideint -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> NaN Division_impossible +mulx3462 multiply -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -3.41813737437080390787865389703565E+632 Inexact Rounded +powx3462 power -55669501853.7751006841940471339310E+614 61400538 -> Infinity Overflow Inexact Rounded +remx3462 remainder -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> NaN Division_impossible +subx3462 subtract -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -5.56695018537751006841940471339310E+624 Inexact Rounded +addx3463 add -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> -834662.599983953345718523807123972 Inexact Rounded +comx3463 compare -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 1 +divx3463 divide -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 6.32071595497552015656909892339226E-409 Inexact Rounded +dvix3463 divideint -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 0 +mulx3463 multiply -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 4.40340044311040151960763108019957E-397 Inexact Rounded +powx3463 power -527566.521273992424649346837337602E-408 -834663 -> -Infinity Overflow Inexact Rounded +remx3463 remainder -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> -5.27566521273992424649346837337602E-403 +subx3463 subtract -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 834662.599983953345718523807123972 Inexact Rounded +addx3464 add 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 69065510.0459653699418083455335366 Inexact Rounded +comx3464 compare 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 1 +divx3464 divide 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 9.93964810285396646889830919492683E+827 Inexact Rounded +dvix3464 divideint 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> NaN Division_impossible +mulx3464 multiply 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 4.79900759921241352562381181332720E-813 Inexact Rounded +powx3464 power 69065510.0459653699418083455335366 7 -> 7.49598249763416483824919118973567E+54 Inexact Rounded +remx3464 remainder 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> NaN Division_impossible +subx3464 subtract 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 69065510.0459653699418083455335366 Inexact Rounded +addx3465 add -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -2921982.82411285505229122890041841 Inexact Rounded +comx3465 compare -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -1 +divx3465 divide -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> 4.00300943792444663467732029501716E+764 Inexact Rounded +dvix3465 divideint -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> NaN Division_impossible +mulx3465 multiply -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> 2.13289120518223547921212412642411E-752 Inexact Rounded +powx3465 power -2921982.82411285505229122890041841 -7 -> -5.49865394870631248479668782154131E-46 Inexact Rounded +remx3465 remainder -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> NaN Division_impossible +subx3465 subtract -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -2921982.82411285505229122890041841 Inexact Rounded +addx3466 add 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 3873389.71099271106554595739922987 Inexact Rounded +comx3466 compare 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> -1 +divx3466 divide 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 0.00000116465942888322776753062580106351 Inexact Rounded +dvix3466 divideint 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 0 +mulx3466 multiply 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 17473516.9087705701652062546164705 Inexact Rounded +powx3466 power 4.51117459466491451401835756593793 3873385 -> Infinity Overflow Inexact Rounded +remx3466 remainder 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 4.51117459466491451401835756593793 +subx3466 subtract 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> -3873380.68864352173571692936251473 Inexact Rounded +addx3467 add 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 3.61713861293896216593840817950781E+411 Inexact Rounded +comx3467 compare 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> -1 +divx3467 divide 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 1.36997137177543416190811827685231E-398 Inexact Rounded +dvix3467 divideint 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 0 +mulx3467 multiply 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 1.79242831280777466554271332425735E+425 Inexact Rounded +powx3467 power 49553763474698.8118661758811091120 4 -> 6.02985091099730236635954801474802E+54 Inexact Rounded +remx3467 remainder 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 49553763474698.8118661758811091120 +subx3467 subtract 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> -3.61713861293896216593840817950781E+411 Inexact Rounded +addx3468 add 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 7.55985583344379951506071499170749E+967 Inexact Rounded +comx3468 compare 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 1 +divx3468 divide 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 1.01213580367212873025671916758669E+935 Inexact Rounded +dvix3468 divideint 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> NaN Division_impossible +mulx3468 multiply 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 5.64661580146688255286933753616580E+1000 Inexact Rounded +powx3468 power 755985583344.379951506071499170749E+956 7 -> 1.41121958516547725677142981375469E+6775 Inexact Rounded +remx3468 remainder 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> NaN Division_impossible +subx3468 subtract 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 7.55985583344379951506071499170749E+967 Inexact Rounded +addx3469 add -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -20497230690.0922299809209551116556 Inexact Rounded +comx3469 compare -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -1 +divx3469 divide -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 50.8179779735012053661447873666816 Inexact Rounded +dvix3469 divideint -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 50 +mulx3469 multiply -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 7951459193692715079.09328760016914 Inexact Rounded +powx3469 power -20101668541.7472260497594230105456 -395562148 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3469 remainder -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -323561124.497029491682817955047400 +subx3469 subtract -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -19706106393.4022221185978909094356 Inexact Rounded +addx3470 add 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 460874498597.269108074612032613370 Inexact Rounded +comx3470 compare 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> -1 +divx3470 divide 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 0.0000121160334374633240168068405467307 Inexact Rounded +dvix3470 divideint 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 0 +mulx3470 multiply 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 2573447398655758659.39475672905225 Inexact Rounded +powx3470 power 5583903.18072100716072011264668631 5 -> 5.42861943589418603298670454702901E+33 Inexact Rounded +remx3470 remainder 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 5583903.18072100716072011264668631 +subx3470 subtract 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> -460863330790.907666060290592388076 Inexact Rounded +addx3471 add -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> -5.08580148958769104511751975720470E+667 Inexact Rounded +comx3471 compare -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 1 +divx3471 divide -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 1.87903204624039476408191264564568E-615 Inexact Rounded +dvix3471 divideint -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 0 +mulx3471 multiply -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 4.86018718792967378985838739820108E+720 Inexact Rounded +powx3471 power -955638397975240685017992436116257E+020 -5 -> -1.25467730420304189161768408462414E-265 Inexact Rounded +remx3471 remainder -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> -9.55638397975240685017992436116257E+52 +subx3471 subtract -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 5.08580148958769104511751975720470E+667 Inexact Rounded +addx3472 add -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1.36243796098020983814115584402407E+828 Inexact Rounded +comx3472 compare -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1 +divx3472 divide -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -2.06771226638255600634939371365920E+818 Inexact Rounded +dvix3472 divideint -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> NaN Division_impossible +mulx3472 multiply -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -8.97725098263977535966921696143011E+837 Inexact Rounded +powx3472 power -136243796098020983814115584402407E+796 7 -> -8.71399185551742199752832286984005E+5796 Inexact Rounded +remx3472 remainder -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> NaN Division_impossible +subx3472 subtract -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1.36243796098020983814115584402407E+828 Inexact Rounded +addx3473 add -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -8.08498482718304598213092937543934E+526 Inexact Rounded +comx3473 compare -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -1 +divx3473 divide -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -1.68419126177106468565397017107736E+522 Inexact Rounded +dvix3473 divideint -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> NaN Division_impossible +mulx3473 multiply -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -3.88120881158362912220132691803539E+531 Inexact Rounded +powx3473 power -808498.482718304598213092937543934E+521 48005 -> -Infinity Overflow Inexact Rounded +remx3473 remainder -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> NaN Division_impossible +subx3473 subtract -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -8.08498482718304598213092937543934E+526 Inexact Rounded +addx3474 add -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> -3.19563111559114001594257448970812E+989 Inexact Rounded +comx3474 compare -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 1 +divx3474 divide -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 2.54180257724779721448484781056040E-591 Inexact Rounded +dvix3474 divideint -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 0 +mulx3474 multiply -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 2.59570359202261082537505332325404E+1388 Inexact Rounded +powx3474 power -812.266340554281305985524813074211E+396 -3 -> -1.86596988030914616216741808216469E-1197 Inexact Rounded +remx3474 remainder -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> -8.12266340554281305985524813074211E+398 +subx3474 subtract -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 3.19563111559114001594257448970812E+989 Inexact Rounded +addx3475 add -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -9.29889720905183397678866648217793E+139 Inexact Rounded +comx3475 compare -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -1 +divx3475 divide -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> 3.31747801646964399331556971055197E+128 Inexact Rounded +dvix3475 divideint -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> NaN Division_impossible +mulx3475 multiply -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> 2.60648266168558079957349074609920E+151 Inexact Rounded +powx3475 power -929889.720905183397678866648217793E+134 -3 -> -1.24367143370300189518778505830181E-420 Inexact Rounded +remx3475 remainder -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> NaN Division_impossible +subx3475 subtract -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -9.29889720905183397678866648217793E+139 Inexact Rounded +addx3476 add 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 492754319.251171861122327008214092 Inexact Rounded +comx3476 compare 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> -1 +divx3476 divide 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 0.000170389819117633485695890041185782 Inexact Rounded +dvix3476 divideint 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 0 +mulx3476 multiply 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 41357714926052.9282985560380064649 Inexact Rounded +powx3476 power 83946.0157801953636255078996185540 492670373 -> Infinity Overflow Inexact Rounded +remx3476 remainder 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 83946.0157801953636255078996185540 +subx3476 subtract 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> -492586427.219611470395075992414854 Inexact Rounded +addx3477 add 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 7812758113817.99135851825223122508 Inexact Rounded +comx3477 compare 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 1 +divx3477 divide 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 2.57210790001590171809512871857381E+163 Inexact Rounded +dvix3477 divideint 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> NaN Division_impossible +mulx3477 multiply 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 2.37311931372130583136091717093935E-138 Inexact Rounded +powx3477 power 7812758113817.99135851825223122508 3 -> 4.76884421816246896090414314934253E+38 Inexact Rounded +remx3477 remainder 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> NaN Division_impossible +subx3477 subtract 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 7812758113817.99135851825223122508 Inexact Rounded +addx3478 add 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 490328689.266902084767070133475071 Inexact Rounded +comx3478 compare 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 1 +divx3478 divide 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 430.269702657525223124148258641358 Inexact Rounded +dvix3478 divideint 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 430 +mulx3478 multiply 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 556182701222751.588454129518830550 Inexact Rounded +powx3478 power 489191747.148674326757767356626016 1136942 -> Infinity Overflow Inexact Rounded +remx3478 remainder 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 306636.3107383827575733115325810 +subx3478 subtract 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 488054805.030446568748464579776962 Inexact Rounded +addx3479 add -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -5.99369540373174482335865567937853E+297 Inexact Rounded +comx3479 compare -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -1 +divx3479 divide -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> 1.56540833065089684132688143737586E+287 Inexact Rounded +dvix3479 divideint -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> NaN Division_impossible +mulx3479 multiply -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> 2.29488906436173641324091638963715E+308 Inexact Rounded +powx3479 power -599369540.373174482335865567937853E+289 -4 -> 7.74856580646291366270329165540958E-1192 Inexact Rounded +remx3479 remainder -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> NaN Division_impossible +subx3479 subtract -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -5.99369540373174482335865567937853E+297 Inexact Rounded +addx3480 add -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> -68624373320.5930758945974232604298 Inexact Rounded +comx3480 compare -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 1 +divx3480 divide -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 0.0517550008335747813596332404664731 Inexact Rounded +dvix3480 divideint -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 0 +mulx3480 multiply -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 220333194736887939420.719579906257 Inexact Rounded +powx3480 power -3376883870.85961692148022521960139 -7 -> -1.99704163718361153125735756179280E-67 Inexact Rounded +remx3480 remainder -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> -3376883870.85961692148022521960139 +subx3480 subtract -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 61870605578.8738420516369728212270 Inexact Rounded +addx3481 add 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 60.2702299236537409084931002396185 +comx3481 compare 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 1 +divx3481 divide 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 36.8450651616286048437498576613622 Inexact Rounded +dvix3481 divideint 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 36 +mulx3481 multiply 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 93.4472468622373769590900258060029 Inexact Rounded +powx3481 power 58.6776780370008364590621772421025 2 -> 3443.06989981393033632008313505230 Inexact Rounded +remx3481 remainder 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 1.3458101174962762795489493315265 +subx3481 subtract 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 57.0851261503479320096312542445865 +addx3482 add 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 4099616630.75768235660057557396732 Inexact Rounded +comx3482 compare 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 1 +divx3482 divide 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 14097951.1289920788134209002390834 Inexact Rounded +dvix3482 divideint 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 14097951 +mulx3482 multiply 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 1192148701687.90798437501397900174 Inexact Rounded +powx3482 power 4099616339.96249499552808575717579 291 -> 2.03364757877800497409765979877258E+2797 Inexact Rounded +remx3482 remainder 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 37.510275726642959858538282144855 +subx3482 subtract 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 4099616049.16730763445559594038426 Inexact Rounded +addx3483 add 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -2140306990376.46573014981378406578 Inexact Rounded +comx3483 compare 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 1 +divx3483 divide 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -0.0000401191663393971853092748263233128 Inexact Rounded +dvix3483 divideint 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -0 +mulx3483 multiply 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -183797198561136797328.508878254848 Inexact Rounded +powx3483 power 85870777.2282833141709970713739108 -2 -> 1.35615463448707573424578785973269E-16 Inexact Rounded +remx3483 remainder 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 85870777.2282833141709970713739108 +subx3483 subtract 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 2140478731930.92229677815577820852 Inexact Rounded +addx3484 add 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 20862.2147613905641948547078989489 Inexact Rounded +comx3484 compare 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 1 +divx3484 divide 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -539.315627388386430188627412639767 Inexact Rounded +dvix3484 divideint 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -539 +mulx3484 multiply 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -810009.016386974103738622793670566 Inexact Rounded +powx3484 power 20900.9693761555165742010339929779 -39 -> 3.26219014701526335296044439989665E-169 Inexact Rounded +remx3484 remainder 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 12.2320178461841065312693113692685 +subx3484 subtract 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 20939.7239909204689535473600870069 Inexact Rounded +addx3485 add 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 379130602.210390198240885543797232 Inexact Rounded +comx3485 compare 448.827596155587910947511170319456 379130153.382794042652974596286062 -> -1 +divx3485 divide 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 0.00000118383513458615061394140895596979 Inexact Rounded +dvix3485 divideint 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 0 +mulx3485 multiply 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 170164075372.898786469094460692097 Inexact Rounded +powx3485 power 448.827596155587910947511170319456 379130153 -> Infinity Overflow Inexact Rounded +remx3485 remainder 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 448.827596155587910947511170319456 +subx3485 subtract 448.827596155587910947511170319456 379130153.382794042652974596286062 -> -379129704.555197887065063648774892 Inexact Rounded +addx3486 add 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 3404725642.18381024654682525116780 Inexact Rounded +comx3486 compare 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> -1 +divx3486 divide 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 2.89049673833970863420201979291523E-8 Inexact Rounded +dvix3486 divideint 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 0 +mulx3486 multiply 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 335070891904.214504811798212040413 Inexact Rounded +powx3486 power 98.4134807921002817357000140482039 3 -> 953155.543384739667965055839894682 Inexact Rounded +remx3486 remainder 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 98.4134807921002817357000140482039 +subx3486 subtract 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> -3404725445.35684866234626177976778 Inexact Rounded +addx3487 add 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -5.14995709970912830072802043560650E-425 Inexact Rounded +comx3487 compare 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 1 +divx3487 divide 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -1.05971064046375011086850722752614E-354 Inexact Rounded +dvix3487 divideint 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -0 +mulx3487 multiply 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -2.81057072061345688074304873033317E-1203 Inexact Rounded +powx3487 power 545746433.649359734136476718176330E-787 -5 -> 2.06559640092667166976186801348662E+3891 Inexact Rounded +remx3487 remainder 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 5.45746433649359734136476718176330E-779 +subx3487 subtract 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 5.14995709970912830072802043560650E-425 Inexact Rounded +addx3488 add 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 741304513547.273820525801608231737 Inexact Rounded +comx3488 compare 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 1 +divx3488 divide 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 1.87090281565101612623398174727653E+839 Inexact Rounded +dvix3488 divideint 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> NaN Division_impossible +mulx3488 multiply 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 2.93725776244737788947443361076095E-816 Inexact Rounded +powx3488 power 741304513547.273820525801608231737 4 -> 3.01985838652892073903194846668712E+47 Inexact Rounded +remx3488 remainder 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> NaN Division_impossible +subx3488 subtract 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 741304513547.273820525801608231737 Inexact Rounded +addx3489 add -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> 4033.67985686310526747345220908179 Inexact Rounded +comx3489 compare -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -1 +divx3489 divide -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -0.148981244172527671907534117771626 Inexact Rounded +dvix3489 divideint -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -0 +mulx3489 multiply -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -3347003.65129295988793454267973464 Inexact Rounded +powx3489 power -706.145005094292315613907254240553 4740 -> Infinity Overflow Inexact Rounded +remx3489 remainder -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -706.145005094292315613907254240553 +subx3489 subtract -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -5445.96986705168989870126671756289 Inexact Rounded +addx3490 add -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -769956988.821146059252782194757952 Inexact Rounded +comx3490 compare -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -1 +divx3490 divide -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24675.5283319978698932292028650803 Inexact Rounded +dvix3490 divideint -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24675 +mulx3490 multiply -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24023222896770.8161787236737395477 Inexact Rounded +powx3490 power -769925786.823099083228795187975893 -31202 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3490 remainder -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -16485.0139656913494028406582486750 +subx3490 subtract -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -769894584.825052107204808181193834 Inexact Rounded +addx3491 add 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 8.44386105460497256507419289692857E+919 Inexact Rounded +comx3491 compare 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 1 +divx3491 divide 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 1.60516736512701978695559003341922E+888 Inexact Rounded +dvix3491 divideint 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> NaN Division_impossible +mulx3491 multiply 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 4.44182899917309231779837668210610E+951 Inexact Rounded +powx3491 power 84438610546049.7256507419289692857E+906 5 -> 4.29245144719689283247342866988213E+4599 Inexact Rounded +remx3491 remainder 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> NaN Division_impossible +subx3491 subtract 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 8.44386105460497256507419289692857E+919 Inexact Rounded +addx3492 add 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 549926.071394341400088797374170467 Inexact Rounded +comx3492 compare 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 1 +divx3492 divide 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 3328.65471667062107598395714348089 Inexact Rounded +dvix3492 divideint 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 3328 +mulx3492 multiply 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 90798561.3782451425861113694732484 Inexact Rounded +powx3492 power 549760.911304725795164589619286514 165 -> 1.34488925442386544028875603347654E+947 Inexact Rounded +remx3492 remainder 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 108.133063992607401181365489319248 +subx3492 subtract 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 549595.751215110190240381864402561 Inexact Rounded +addx3493 add 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 11737235.5901860743933857728701908 Inexact Rounded +comx3493 compare 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> -1 +divx3493 divide 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 0.451420792712387250865423208234291 Inexact Rounded +dvix3493 divideint 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 0 +mulx3493 multiply 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 29520691206417.5831886752808745421 Inexact Rounded +powx3493 power 3650514.18649737956855828939662794 8086721 -> Infinity Overflow Inexact Rounded +remx3493 remainder 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 3650514.18649737956855828939662794 +subx3493 subtract 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> -4436207.21719131525626919407693496 +addx3494 add 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 55067723881941.2298810010885806451 Inexact Rounded +comx3494 compare 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 1 +divx3494 divide 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -6184039198391.19853088419484117054 Inexact Rounded +dvix3494 divideint 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -6184039198391 +mulx3494 multiply 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -490367883555396.250365158593373279 Inexact Rounded +powx3494 power 55067723881950.1346958179604099594 -9 -> 2.14746386538529270173788457887121E-124 Inexact Rounded +remx3494 remainder 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 1.76788075918488693086347720461547 +subx3494 subtract 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 55067723881959.0395106348322392737 Inexact Rounded +addx3495 add 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 5.57966504537858308541154858567656E+140 Inexact Rounded +comx3495 compare 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> -1 +divx3495 divide 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 1.55609900657590706155251902725027E-113 Inexact Rounded +dvix3495 divideint 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 0 +mulx3495 multiply 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 4.84455044392374106106966779322483E+168 Inexact Rounded +powx3495 power 868251123.413992653362860637541060E+019 6 -> 4.28422354304291884802690733853227E+167 Inexact Rounded +remx3495 remainder 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 8682511234139926533628606375.41060 +subx3495 subtract 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> -5.57966504537858308541154858567656E+140 Inexact Rounded +addx3496 add -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -646.464431574014407536004990059069 Inexact Rounded +comx3496 compare -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -1 +divx3496 divide -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> 8.09416521887063886613527228353543E+36 Inexact Rounded +dvix3496 divideint -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> NaN Division_impossible +mulx3496 multiply -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> 5.16317927778381197995451363439626E-32 Inexact Rounded +powx3496 power -646.464431574014407536004990059069 -8 -> 3.27825641569860861774700548035691E-23 Inexact Rounded +remx3496 remainder -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> NaN Division_impossible +subx3496 subtract -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -646.464431574014407536004990059069 Inexact Rounded +addx3497 add 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 354.546679975219753598558273421556 Inexact Rounded +comx3497 compare 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 1 +divx3497 divide 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> -5.03655799102477192579414523352028E+446 Inexact Rounded +dvix3497 divideint 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> NaN Division_impossible +mulx3497 multiply 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> -2.49581854324831161267369292071408E-442 Inexact Rounded +powx3497 power 354.546679975219753598558273421556 -7 -> 1.41999246365875617298270414304233E-18 Inexact Rounded +remx3497 remainder 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> NaN Division_impossible +subx3497 subtract 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 354.546679975219753598558273421556 Inexact Rounded +addx3498 add 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 91936087917435.5974889495278215874 Inexact Rounded +comx3498 compare 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 1 +divx3498 divide 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> -1.37052712434303366569304688993783E+760 Inexact Rounded +dvix3498 divideint 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> NaN Division_impossible +mulx3498 multiply 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> -6.16714847260980448099292763939423E-733 Inexact Rounded +powx3498 power 91936087917435.5974889495278215874 -7 -> 1.80134899939035708719659065082630E-98 Inexact Rounded +remx3498 remainder 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> NaN Division_impossible +subx3498 subtract 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 91936087917435.5974889495278215874 Inexact Rounded +addx3499 add -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -7.34564225185285561365214172598110E-597 Inexact Rounded +comx3499 compare -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -1 +divx3499 divide -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -1.78342822299163842247184303878022E+159 Inexact Rounded +dvix3499 divideint -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> NaN Division_impossible +mulx3499 multiply -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -3.02554705575380338274126867655676E-1352 Inexact Rounded +powx3499 power -07345.6422518528556136521417259811E-600 4 -> 2.91151541552217582082937236255996E-2385 Inexact Rounded +remx3499 remainder -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> NaN Division_impossible +subx3499 subtract -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -7.34564225185285561365214172598110E-597 Inexact Rounded +addx3500 add -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> 6.16988426425908872398170896375634E+401 Inexact Rounded +comx3500 compare -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -1 +divx3500 divide -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -4.10511306357337753351655511866170E-394 Inexact Rounded +dvix3500 divideint -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -0 +mulx3500 multiply -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -1.56271275924409657991913620522315E+410 Inexact Rounded +powx3500 power -253280724.939458021588167965038184 6 -> 2.64005420221406808782284459794424E+50 Inexact Rounded +remx3500 remainder -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -253280724.939458021588167965038184 +subx3500 subtract -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -6.16988426425908872398170896375634E+401 Inexact Rounded Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/randoms.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/randoms.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,4030 @@ +------------------------------------------------------------------------ +-- randoms.decTest -- decimal random testcases -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +rounding: half_up + +-- Randomly generated testcases [31 Dec 2000, with results defined for +-- all cases [27 Oct 2001], and no trim/finish [9 Jun 2002] +xadd001 add 905.67402 -202896611.E-780472620 -> 905.674020 Inexact Rounded +xcom001 compare 905.67402 -202896611.E-780472620 -> 1 +xdiv001 divide 905.67402 -202896611.E-780472620 -> -4.46372177E+780472614 Inexact Rounded +xdvi001 divideint 905.67402 -202896611.E-780472620 -> NaN Division_impossible +xmul001 multiply 905.67402 -202896611.E-780472620 -> -1.83758189E-780472609 Inexact Rounded +xpow001 power 905.67402 -2 -> 0.00000121914730 Inexact Rounded +xrem001 remainder 905.67402 -202896611.E-780472620 -> NaN Division_impossible +xsub001 subtract 905.67402 -202896611.E-780472620 -> 905.674020 Inexact Rounded +xadd002 add 3915134.7 -597164907. -> -593249772 Inexact Rounded +xcom002 compare 3915134.7 -597164907. -> 1 +xdiv002 divide 3915134.7 -597164907. -> -0.00655620358 Inexact Rounded +xdvi002 divideint 3915134.7 -597164907. -> -0 +xmul002 multiply 3915134.7 -597164907. -> -2.33798105E+15 Inexact Rounded +xpow002 power 3915134.7 -597164907 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem002 remainder 3915134.7 -597164907. -> 3915134.7 +xsub002 subtract 3915134.7 -597164907. -> 601080042 Inexact Rounded +xadd003 add 309759261 62663.487 -> 309821924 Inexact Rounded +xcom003 compare 309759261 62663.487 -> 1 +xdiv003 divide 309759261 62663.487 -> 4943.21775 Inexact Rounded +xdvi003 divideint 309759261 62663.487 -> 4943 +xmul003 multiply 309759261 62663.487 -> 1.94105954E+13 Inexact Rounded +xpow003 power 309759261 62663 -> 1.13679199E+532073 Inexact Rounded +xrem003 remainder 309759261 62663.487 -> 13644.759 +xsub003 subtract 309759261 62663.487 -> 309696598 Inexact Rounded +xadd004 add 3.93591888E-236595626 7242375.00 -> 7242375.00 Inexact Rounded +xcom004 compare 3.93591888E-236595626 7242375.00 -> -1 +xdiv004 divide 3.93591888E-236595626 7242375.00 -> 5.43456930E-236595633 Inexact Rounded +xdvi004 divideint 3.93591888E-236595626 7242375.00 -> 0 +xmul004 multiply 3.93591888E-236595626 7242375.00 -> 2.85054005E-236595619 Inexact Rounded +xpow004 power 3.93591888E-236595626 7242375 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem004 remainder 3.93591888E-236595626 7242375.00 -> 3.93591888E-236595626 +xsub004 subtract 3.93591888E-236595626 7242375.00 -> -7242375.00 Inexact Rounded +xadd005 add 323902.714 -608669.607E-657060568 -> 323902.714 Inexact Rounded +xcom005 compare 323902.714 -608669.607E-657060568 -> 1 +xdiv005 divide 323902.714 -608669.607E-657060568 -> -5.32148657E+657060567 Inexact Rounded +xdvi005 divideint 323902.714 -608669.607E-657060568 -> NaN Division_impossible +xmul005 multiply 323902.714 -608669.607E-657060568 -> -1.97149738E-657060557 Inexact Rounded +xpow005 power 323902.714 -6 -> 8.65989204E-34 Inexact Rounded +xrem005 remainder 323902.714 -608669.607E-657060568 -> NaN Division_impossible +xsub005 subtract 323902.714 -608669.607E-657060568 -> 323902.714 Inexact Rounded +xadd006 add 5.11970092 -8807.22036 -> -8802.10066 Inexact Rounded +xcom006 compare 5.11970092 -8807.22036 -> 1 +xdiv006 divide 5.11970092 -8807.22036 -> -0.000581307236 Inexact Rounded +xdvi006 divideint 5.11970092 -8807.22036 -> -0 +xmul006 multiply 5.11970092 -8807.22036 -> -45090.3342 Inexact Rounded +xpow006 power 5.11970092 -8807 -> 4.81819262E-6247 Inexact Rounded +xrem006 remainder 5.11970092 -8807.22036 -> 5.11970092 +xsub006 subtract 5.11970092 -8807.22036 -> 8812.34006 Inexact Rounded +xadd007 add -7.99874516 4561.83758 -> 4553.83883 Inexact Rounded +xcom007 compare -7.99874516 4561.83758 -> -1 +xdiv007 divide -7.99874516 4561.83758 -> -0.00175340420 Inexact Rounded +xdvi007 divideint -7.99874516 4561.83758 -> -0 +xmul007 multiply -7.99874516 4561.83758 -> -36488.9763 Inexact Rounded +xpow007 power -7.99874516 4562 -> 3.85236199E+4119 Inexact Rounded +xrem007 remainder -7.99874516 4561.83758 -> -7.99874516 +xsub007 subtract -7.99874516 4561.83758 -> -4569.83633 Inexact Rounded +xadd008 add 297802878 -927206.324 -> 296875672 Inexact Rounded +xcom008 compare 297802878 -927206.324 -> 1 +xdiv008 divide 297802878 -927206.324 -> -321.182967 Inexact Rounded +xdvi008 divideint 297802878 -927206.324 -> -321 +xmul008 multiply 297802878 -927206.324 -> -2.76124712E+14 Inexact Rounded +xpow008 power 297802878 -927206 -> 1.94602810E-7857078 Inexact Rounded +xrem008 remainder 297802878 -927206.324 -> 169647.996 +xsub008 subtract 297802878 -927206.324 -> 298730084 Inexact Rounded +xadd009 add -766.651824 31300.3619 -> 30533.7101 Inexact Rounded +xcom009 compare -766.651824 31300.3619 -> -1 +xdiv009 divide -766.651824 31300.3619 -> -0.0244933853 Inexact Rounded +xdvi009 divideint -766.651824 31300.3619 -> -0 +xmul009 multiply -766.651824 31300.3619 -> -23996479.5 Inexact Rounded +xpow009 power -766.651824 31300 -> 8.37189011E+90287 Inexact Rounded +xrem009 remainder -766.651824 31300.3619 -> -766.651824 +xsub009 subtract -766.651824 31300.3619 -> -32067.0137 Inexact Rounded +xadd010 add -56746.8689E+934981942 471002521. -> -5.67468689E+934981946 Inexact Rounded +xcom010 compare -56746.8689E+934981942 471002521. -> -1 +xdiv010 divide -56746.8689E+934981942 471002521. -> -1.20481030E+934981938 Inexact Rounded +xdvi010 divideint -56746.8689E+934981942 471002521. -> NaN Division_impossible +xmul010 multiply -56746.8689E+934981942 471002521. -> -2.67279183E+934981955 Inexact Rounded +xpow010 power -56746.8689E+934981942 471002521 -> -Infinity Overflow Inexact Rounded +xrem010 remainder -56746.8689E+934981942 471002521. -> NaN Division_impossible +xsub010 subtract -56746.8689E+934981942 471002521. -> -5.67468689E+934981946 Inexact Rounded +xadd011 add 456417160 -41346.1024 -> 456375814 Inexact Rounded +xcom011 compare 456417160 -41346.1024 -> 1 +xdiv011 divide 456417160 -41346.1024 -> -11038.9404 Inexact Rounded +xdvi011 divideint 456417160 -41346.1024 -> -11038 +xmul011 multiply 456417160 -41346.1024 -> -1.88710706E+13 Inexact Rounded +xpow011 power 456417160 -41346 -> 1.04766863E-358030 Inexact Rounded +xrem011 remainder 456417160 -41346.1024 -> 38881.7088 +xsub011 subtract 456417160 -41346.1024 -> 456458506 Inexact Rounded +xadd012 add 102895.722 -2.62214826 -> 102893.100 Inexact Rounded +xcom012 compare 102895.722 -2.62214826 -> 1 +xdiv012 divide 102895.722 -2.62214826 -> -39241.0008 Inexact Rounded +xdvi012 divideint 102895.722 -2.62214826 -> -39241 +xmul012 multiply 102895.722 -2.62214826 -> -269807.838 Inexact Rounded +xpow012 power 102895.722 -3 -> 9.17926786E-16 Inexact Rounded +xrem012 remainder 102895.722 -2.62214826 -> 0.00212934 +xsub012 subtract 102895.722 -2.62214826 -> 102898.344 Inexact Rounded +xadd013 add 61.3033331E+157644141 -567740.918E-893439456 -> 6.13033331E+157644142 Inexact Rounded +xcom013 compare 61.3033331E+157644141 -567740.918E-893439456 -> 1 +xdiv013 divide 61.3033331E+157644141 -567740.918E-893439456 -> -Infinity Inexact Overflow Rounded +xdvi013 divideint 61.3033331E+157644141 -567740.918E-893439456 -> NaN Division_impossible +xmul013 multiply 61.3033331E+157644141 -567740.918E-893439456 -> -3.48044106E-735795308 Inexact Rounded +xpow013 power 61.3033331E+157644141 -6 -> 1.88406322E-945864857 Inexact Rounded +xrem013 remainder 61.3033331E+157644141 -567740.918E-893439456 -> NaN Division_impossible +xsub013 subtract 61.3033331E+157644141 -567740.918E-893439456 -> 6.13033331E+157644142 Inexact Rounded +xadd014 add 80223.3897 73921.0383E-467772675 -> 80223.3897 Inexact Rounded +xcom014 compare 80223.3897 73921.0383E-467772675 -> 1 +xdiv014 divide 80223.3897 73921.0383E-467772675 -> 1.08525789E+467772675 Inexact Rounded +xdvi014 divideint 80223.3897 73921.0383E-467772675 -> NaN Division_impossible +xmul014 multiply 80223.3897 73921.0383E-467772675 -> 5.93019626E-467772666 Inexact Rounded +xpow014 power 80223.3897 7 -> 2.13848919E+34 Inexact Rounded +xrem014 remainder 80223.3897 73921.0383E-467772675 -> NaN Division_impossible +xsub014 subtract 80223.3897 73921.0383E-467772675 -> 80223.3897 Inexact Rounded +xadd015 add -654645.954 -9.12535752 -> -654655.079 Inexact Rounded +xcom015 compare -654645.954 -9.12535752 -> -1 +xdiv015 divide -654645.954 -9.12535752 -> 71739.2116 Inexact Rounded +xdvi015 divideint -654645.954 -9.12535752 -> 71739 +xmul015 multiply -654645.954 -9.12535752 -> 5973878.38 Inexact Rounded +xpow015 power -654645.954 -9 -> -4.52836690E-53 Inexact Rounded +xrem015 remainder -654645.954 -9.12535752 -> -1.93087272 +xsub015 subtract -654645.954 -9.12535752 -> -654636.829 Inexact Rounded +xadd016 add 63.1917772E-706014634 -7.56253257E-138579234 -> -7.56253257E-138579234 Inexact Rounded +xcom016 compare 63.1917772E-706014634 -7.56253257E-138579234 -> 1 +xdiv016 divide 63.1917772E-706014634 -7.56253257E-138579234 -> -8.35590149E-567435400 Inexact Rounded +xdvi016 divideint 63.1917772E-706014634 -7.56253257E-138579234 -> -0 +xmul016 multiply 63.1917772E-706014634 -7.56253257E-138579234 -> -4.77889873E-844593866 Inexact Rounded +xpow016 power 63.1917772E-706014634 -8 -> Infinity Overflow Inexact Rounded +xrem016 remainder 63.1917772E-706014634 -7.56253257E-138579234 -> 6.31917772E-706014633 +xsub016 subtract 63.1917772E-706014634 -7.56253257E-138579234 -> 7.56253257E-138579234 Inexact Rounded +xadd017 add -39674.7190 2490607.78 -> 2450933.06 Inexact Rounded +xcom017 compare -39674.7190 2490607.78 -> -1 +xdiv017 divide -39674.7190 2490607.78 -> -0.0159297338 Inexact Rounded +xdvi017 divideint -39674.7190 2490607.78 -> -0 +xmul017 multiply -39674.7190 2490607.78 -> -9.88141638E+10 Inexact Rounded +xpow017 power -39674.7190 2490608 -> 2.55032329E+11453095 Inexact Rounded +xrem017 remainder -39674.7190 2490607.78 -> -39674.7190 +xsub017 subtract -39674.7190 2490607.78 -> -2530282.50 Inexact Rounded +xadd018 add -3364.59737E-600363681 896487.451 -> 896487.451 Inexact Rounded +xcom018 compare -3364.59737E-600363681 896487.451 -> -1 +xdiv018 divide -3364.59737E-600363681 896487.451 -> -3.75308920E-600363684 Inexact Rounded +xdvi018 divideint -3364.59737E-600363681 896487.451 -> -0 +xmul018 multiply -3364.59737E-600363681 896487.451 -> -3.01631932E-600363672 Inexact Rounded +xpow018 power -3364.59737E-600363681 896487 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem018 remainder -3364.59737E-600363681 896487.451 -> -3.36459737E-600363678 +xsub018 subtract -3364.59737E-600363681 896487.451 -> -896487.451 Inexact Rounded +xadd019 add -64138.0578 31759011.3E+697488342 -> 3.17590113E+697488349 Inexact Rounded +xcom019 compare -64138.0578 31759011.3E+697488342 -> -1 +xdiv019 divide -64138.0578 31759011.3E+697488342 -> -2.01952313E-697488345 Inexact Rounded +xdvi019 divideint -64138.0578 31759011.3E+697488342 -> -0 +xmul019 multiply -64138.0578 31759011.3E+697488342 -> -2.03696130E+697488354 Inexact Rounded +xpow019 power -64138.0578 3 -> -2.63844116E+14 Inexact Rounded +xrem019 remainder -64138.0578 31759011.3E+697488342 -> -64138.0578 +xsub019 subtract -64138.0578 31759011.3E+697488342 -> -3.17590113E+697488349 Inexact Rounded +xadd020 add 61399.8527 -64344484.5 -> -64283084.6 Inexact Rounded +xcom020 compare 61399.8527 -64344484.5 -> 1 +xdiv020 divide 61399.8527 -64344484.5 -> -0.000954236454 Inexact Rounded +xdvi020 divideint 61399.8527 -64344484.5 -> -0 +xmul020 multiply 61399.8527 -64344484.5 -> -3.95074187E+12 Inexact Rounded +xpow020 power 61399.8527 -64344485 -> 1.27378842E-308092161 Inexact Rounded +xrem020 remainder 61399.8527 -64344484.5 -> 61399.8527 +xsub020 subtract 61399.8527 -64344484.5 -> 64405884.4 Inexact Rounded +xadd021 add -722960.204 -26154599.8 -> -26877560.0 Inexact Rounded +xcom021 compare -722960.204 -26154599.8 -> 1 +xdiv021 divide -722960.204 -26154599.8 -> 0.0276417995 Inexact Rounded +xdvi021 divideint -722960.204 -26154599.8 -> 0 +xmul021 multiply -722960.204 -26154599.8 -> 1.89087348E+13 Inexact Rounded +xpow021 power -722960.204 -26154600 -> 5.34236139E-153242794 Inexact Rounded +xrem021 remainder -722960.204 -26154599.8 -> -722960.204 +xsub021 subtract -722960.204 -26154599.8 -> 25431639.6 Inexact Rounded +xadd022 add 9.47109959E+230565093 73354723.2 -> 9.47109959E+230565093 Inexact Rounded +xcom022 compare 9.47109959E+230565093 73354723.2 -> 1 +xdiv022 divide 9.47109959E+230565093 73354723.2 -> 1.29113698E+230565086 Inexact Rounded +xdvi022 divideint 9.47109959E+230565093 73354723.2 -> NaN Division_impossible +xmul022 multiply 9.47109959E+230565093 73354723.2 -> 6.94749889E+230565101 Inexact Rounded +xpow022 power 9.47109959E+230565093 73354723 -> Infinity Overflow Inexact Rounded +xrem022 remainder 9.47109959E+230565093 73354723.2 -> NaN Division_impossible +xsub022 subtract 9.47109959E+230565093 73354723.2 -> 9.47109959E+230565093 Inexact Rounded +xadd023 add 43.7456245 547441956. -> 547442000 Inexact Rounded +xcom023 compare 43.7456245 547441956. -> -1 +xdiv023 divide 43.7456245 547441956. -> 7.99091557E-8 Inexact Rounded +xdvi023 divideint 43.7456245 547441956. -> 0 +xmul023 multiply 43.7456245 547441956. -> 2.39481902E+10 Inexact Rounded +xpow023 power 43.7456245 547441956 -> 2.91742391E+898316458 Inexact Rounded +xrem023 remainder 43.7456245 547441956. -> 43.7456245 +xsub023 subtract 43.7456245 547441956. -> -547441912 Inexact Rounded +xadd024 add -73150542E-242017390 -8.15869954 -> -8.15869954 Inexact Rounded +xcom024 compare -73150542E-242017390 -8.15869954 -> 1 +xdiv024 divide -73150542E-242017390 -8.15869954 -> 8.96595611E-242017384 Inexact Rounded +xdvi024 divideint -73150542E-242017390 -8.15869954 -> 0 +xmul024 multiply -73150542E-242017390 -8.15869954 -> 5.96813293E-242017382 Inexact Rounded +xpow024 power -73150542E-242017390 -8 -> Infinity Overflow Inexact Rounded +xrem024 remainder -73150542E-242017390 -8.15869954 -> -7.3150542E-242017383 +xsub024 subtract -73150542E-242017390 -8.15869954 -> 8.15869954 Inexact Rounded +xadd025 add 2015.62109E+299897596 -11788916.1 -> 2.01562109E+299897599 Inexact Rounded +xcom025 compare 2015.62109E+299897596 -11788916.1 -> 1 +xdiv025 divide 2015.62109E+299897596 -11788916.1 -> -1.70975947E+299897592 Inexact Rounded +xdvi025 divideint 2015.62109E+299897596 -11788916.1 -> NaN Division_impossible +xmul025 multiply 2015.62109E+299897596 -11788916.1 -> -2.37619879E+299897606 Inexact Rounded +xpow025 power 2015.62109E+299897596 -11788916 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem025 remainder 2015.62109E+299897596 -11788916.1 -> NaN Division_impossible +xsub025 subtract 2015.62109E+299897596 -11788916.1 -> 2.01562109E+299897599 Inexact Rounded +xadd026 add 29.498114 -26486451 -> -26486421.5 Inexact Rounded +xcom026 compare 29.498114 -26486451 -> 1 +xdiv026 divide 29.498114 -26486451 -> -0.00000111370580 Inexact Rounded +xdvi026 divideint 29.498114 -26486451 -> -0 +xmul026 multiply 29.498114 -26486451 -> -781300351 Inexact Rounded +xpow026 power 29.498114 -26486451 -> 4.22252513E-38929634 Inexact Rounded +xrem026 remainder 29.498114 -26486451 -> 29.498114 +xsub026 subtract 29.498114 -26486451 -> 26486480.5 Inexact Rounded +xadd027 add 244375043.E+130840878 -9.44522029 -> 2.44375043E+130840886 Inexact Rounded +xcom027 compare 244375043.E+130840878 -9.44522029 -> 1 +xdiv027 divide 244375043.E+130840878 -9.44522029 -> -2.58728791E+130840885 Inexact Rounded +xdvi027 divideint 244375043.E+130840878 -9.44522029 -> NaN Division_impossible +xmul027 multiply 244375043.E+130840878 -9.44522029 -> -2.30817611E+130840887 Inexact Rounded +xpow027 power 244375043.E+130840878 -9 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem027 remainder 244375043.E+130840878 -9.44522029 -> NaN Division_impossible +xsub027 subtract 244375043.E+130840878 -9.44522029 -> 2.44375043E+130840886 Inexact Rounded +xadd028 add -349388.759 -196215.776 -> -545604.535 +xcom028 compare -349388.759 -196215.776 -> -1 +xdiv028 divide -349388.759 -196215.776 -> 1.78063541 Inexact Rounded +xdvi028 divideint -349388.759 -196215.776 -> 1 +xmul028 multiply -349388.759 -196215.776 -> 6.85555865E+10 Inexact Rounded +xpow028 power -349388.759 -196216 -> 1.24551752E-1087686 Inexact Rounded +xrem028 remainder -349388.759 -196215.776 -> -153172.983 +xsub028 subtract -349388.759 -196215.776 -> -153172.983 +xadd029 add -70905112.4 -91353968.8 -> -162259081 Inexact Rounded +xcom029 compare -70905112.4 -91353968.8 -> 1 +xdiv029 divide -70905112.4 -91353968.8 -> 0.776157986 Inexact Rounded +xdvi029 divideint -70905112.4 -91353968.8 -> 0 +xmul029 multiply -70905112.4 -91353968.8 -> 6.47746343E+15 Inexact Rounded +xpow029 power -70905112.4 -91353969 -> -3.05944741E-717190554 Inexact Rounded +xrem029 remainder -70905112.4 -91353968.8 -> -70905112.4 +xsub029 subtract -70905112.4 -91353968.8 -> 20448856.4 +xadd030 add -225094.28 -88.7723542 -> -225183.052 Inexact Rounded +xcom030 compare -225094.28 -88.7723542 -> -1 +xdiv030 divide -225094.28 -88.7723542 -> 2535.63491 Inexact Rounded +xdvi030 divideint -225094.28 -88.7723542 -> 2535 +xmul030 multiply -225094.28 -88.7723542 -> 19982149.2 Inexact Rounded +xpow030 power -225094.28 -89 -> -4.36076965E-477 Inexact Rounded +xrem030 remainder -225094.28 -88.7723542 -> -56.3621030 +xsub030 subtract -225094.28 -88.7723542 -> -225005.508 Inexact Rounded +xadd031 add 50.4442340 82.7952169E+880120759 -> 8.27952169E+880120760 Inexact Rounded +xcom031 compare 50.4442340 82.7952169E+880120759 -> -1 +xdiv031 divide 50.4442340 82.7952169E+880120759 -> 6.09265075E-880120760 Inexact Rounded +xdvi031 divideint 50.4442340 82.7952169E+880120759 -> 0 +xmul031 multiply 50.4442340 82.7952169E+880120759 -> 4.17654130E+880120762 Inexact Rounded +xpow031 power 50.4442340 8 -> 4.19268518E+13 Inexact Rounded +xrem031 remainder 50.4442340 82.7952169E+880120759 -> 50.4442340 +xsub031 subtract 50.4442340 82.7952169E+880120759 -> -8.27952169E+880120760 Inexact Rounded +xadd032 add -32311.9037 8.36379449 -> -32303.5399 Inexact Rounded +xcom032 compare -32311.9037 8.36379449 -> -1 +xdiv032 divide -32311.9037 8.36379449 -> -3863.30675 Inexact Rounded +xdvi032 divideint -32311.9037 8.36379449 -> -3863 +xmul032 multiply -32311.9037 8.36379449 -> -270250.122 Inexact Rounded +xpow032 power -32311.9037 8 -> 1.18822960E+36 Inexact Rounded +xrem032 remainder -32311.9037 8.36379449 -> -2.56558513 +xsub032 subtract -32311.9037 8.36379449 -> -32320.2675 Inexact Rounded +xadd033 add 615396156.E+549895291 -29530247.4 -> 6.15396156E+549895299 Inexact Rounded +xcom033 compare 615396156.E+549895291 -29530247.4 -> 1 +xdiv033 divide 615396156.E+549895291 -29530247.4 -> -2.08395191E+549895292 Inexact Rounded +xdvi033 divideint 615396156.E+549895291 -29530247.4 -> NaN Division_impossible +xmul033 multiply 615396156.E+549895291 -29530247.4 -> -1.81728007E+549895307 Inexact Rounded +xpow033 power 615396156.E+549895291 -29530247 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem033 remainder 615396156.E+549895291 -29530247.4 -> NaN Division_impossible +xsub033 subtract 615396156.E+549895291 -29530247.4 -> 6.15396156E+549895299 Inexact Rounded +xadd034 add 592.142173E-419941416 -3.46079109E-844011845 -> 5.92142173E-419941414 Inexact Rounded +xcom034 compare 592.142173E-419941416 -3.46079109E-844011845 -> 1 +xdiv034 divide 592.142173E-419941416 -3.46079109E-844011845 -> -1.71100236E+424070431 Inexact Rounded +xdvi034 divideint 592.142173E-419941416 -3.46079109E-844011845 -> NaN Division_impossible +xmul034 multiply 592.142173E-419941416 -3.46079109E-844011845 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow034 power 592.142173E-419941416 -3 -> Infinity Overflow Inexact Rounded +xrem034 remainder 592.142173E-419941416 -3.46079109E-844011845 -> NaN Division_impossible +xsub034 subtract 592.142173E-419941416 -3.46079109E-844011845 -> 5.92142173E-419941414 Inexact Rounded +xadd035 add 849.515993E-878446473 -1039.08778 -> -1039.08778 Inexact Rounded +xcom035 compare 849.515993E-878446473 -1039.08778 -> 1 +xdiv035 divide 849.515993E-878446473 -1039.08778 -> -8.17559411E-878446474 Inexact Rounded +xdvi035 divideint 849.515993E-878446473 -1039.08778 -> -0 +xmul035 multiply 849.515993E-878446473 -1039.08778 -> -8.82721687E-878446468 Inexact Rounded +xpow035 power 849.515993E-878446473 -1039 -> Infinity Overflow Inexact Rounded +xrem035 remainder 849.515993E-878446473 -1039.08778 -> 8.49515993E-878446471 +xsub035 subtract 849.515993E-878446473 -1039.08778 -> 1039.08778 Inexact Rounded +xadd036 add 213361789 -599.644851 -> 213361189 Inexact Rounded +xcom036 compare 213361789 -599.644851 -> 1 +xdiv036 divide 213361789 -599.644851 -> -355813.593 Inexact Rounded +xdvi036 divideint 213361789 -599.644851 -> -355813 +xmul036 multiply 213361789 -599.644851 -> -1.27941298E+11 Inexact Rounded +xpow036 power 213361789 -600 -> 3.38854684E-4998 Inexact Rounded +xrem036 remainder 213361789 -599.644851 -> 355.631137 +xsub036 subtract 213361789 -599.644851 -> 213362389 Inexact Rounded +xadd037 add -795522555. -298.037702 -> -795522853 Inexact Rounded +xcom037 compare -795522555. -298.037702 -> -1 +xdiv037 divide -795522555. -298.037702 -> 2669201.08 Inexact Rounded +xdvi037 divideint -795522555. -298.037702 -> 2669201 +xmul037 multiply -795522555. -298.037702 -> 2.37095714E+11 Inexact Rounded +xpow037 power -795522555. -298 -> 4.03232712E-2653 Inexact Rounded +xrem037 remainder -795522555. -298.037702 -> -22.783898 +xsub037 subtract -795522555. -298.037702 -> -795522257 Inexact Rounded +xadd038 add -501260651. -8761893.0E-689281479 -> -501260651 Inexact Rounded +xcom038 compare -501260651. -8761893.0E-689281479 -> -1 +xdiv038 divide -501260651. -8761893.0E-689281479 -> 5.72091728E+689281480 Inexact Rounded +xdvi038 divideint -501260651. -8761893.0E-689281479 -> NaN Division_impossible +xmul038 multiply -501260651. -8761893.0E-689281479 -> 4.39199219E-689281464 Inexact Rounded +xpow038 power -501260651. -9 -> -5.00526961E-79 Inexact Rounded +xrem038 remainder -501260651. -8761893.0E-689281479 -> NaN Division_impossible +xsub038 subtract -501260651. -8761893.0E-689281479 -> -501260651 Inexact Rounded +xadd039 add -1.70781105E-848889023 36504769.4 -> 36504769.4 Inexact Rounded +xcom039 compare -1.70781105E-848889023 36504769.4 -> -1 +xdiv039 divide -1.70781105E-848889023 36504769.4 -> -4.67832307E-848889031 Inexact Rounded +xdvi039 divideint -1.70781105E-848889023 36504769.4 -> -0 +xmul039 multiply -1.70781105E-848889023 36504769.4 -> -6.23432486E-848889016 Inexact Rounded +xpow039 power -1.70781105E-848889023 36504769 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem039 remainder -1.70781105E-848889023 36504769.4 -> -1.70781105E-848889023 +xsub039 subtract -1.70781105E-848889023 36504769.4 -> -36504769.4 Inexact Rounded +xadd040 add -5290.54984E-490626676 842535254 -> 842535254 Inexact Rounded +xcom040 compare -5290.54984E-490626676 842535254 -> -1 +xdiv040 divide -5290.54984E-490626676 842535254 -> -6.27932162E-490626682 Inexact Rounded +xdvi040 divideint -5290.54984E-490626676 842535254 -> -0 +xmul040 multiply -5290.54984E-490626676 842535254 -> -4.45747475E-490626664 Inexact Rounded +xpow040 power -5290.54984E-490626676 842535254 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem040 remainder -5290.54984E-490626676 842535254 -> -5.29054984E-490626673 +xsub040 subtract -5290.54984E-490626676 842535254 -> -842535254 Inexact Rounded +xadd041 add 608.31825E+535268120 -59609.0993 -> 6.08318250E+535268122 Inexact Rounded +xcom041 compare 608.31825E+535268120 -59609.0993 -> 1 +xdiv041 divide 608.31825E+535268120 -59609.0993 -> -1.02051240E+535268118 Inexact Rounded +xdvi041 divideint 608.31825E+535268120 -59609.0993 -> NaN Division_impossible +xmul041 multiply 608.31825E+535268120 -59609.0993 -> -3.62613030E+535268127 Inexact Rounded +xpow041 power 608.31825E+535268120 -59609 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem041 remainder 608.31825E+535268120 -59609.0993 -> NaN Division_impossible +xsub041 subtract 608.31825E+535268120 -59609.0993 -> 6.08318250E+535268122 Inexact Rounded +xadd042 add -4629035.31 -167.884398 -> -4629203.19 Inexact Rounded +xcom042 compare -4629035.31 -167.884398 -> -1 +xdiv042 divide -4629035.31 -167.884398 -> 27572.7546 Inexact Rounded +xdvi042 divideint -4629035.31 -167.884398 -> 27572 +xmul042 multiply -4629035.31 -167.884398 -> 777142806 Inexact Rounded +xpow042 power -4629035.31 -168 -> 1.57614831E-1120 Inexact Rounded +xrem042 remainder -4629035.31 -167.884398 -> -126.688344 +xsub042 subtract -4629035.31 -167.884398 -> -4628867.43 Inexact Rounded +xadd043 add -66527378. -706400268. -> -772927646 +xcom043 compare -66527378. -706400268. -> 1 +xdiv043 divide -66527378. -706400268. -> 0.0941780192 Inexact Rounded +xdvi043 divideint -66527378. -706400268. -> 0 +xmul043 multiply -66527378. -706400268. -> 4.69949576E+16 Inexact Rounded +xpow043 power -66527378. -706400268 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem043 remainder -66527378. -706400268. -> -66527378 +xsub043 subtract -66527378. -706400268. -> 639872890 +xadd044 add -2510497.53 372882462. -> 370371964 Inexact Rounded +xcom044 compare -2510497.53 372882462. -> -1 +xdiv044 divide -2510497.53 372882462. -> -0.00673267795 Inexact Rounded +xdvi044 divideint -2510497.53 372882462. -> -0 +xmul044 multiply -2510497.53 372882462. -> -9.36120500E+14 Inexact Rounded +xpow044 power -2510497.53 372882462 -> Infinity Overflow Inexact Rounded +xrem044 remainder -2510497.53 372882462. -> -2510497.53 +xsub044 subtract -2510497.53 372882462. -> -375392960 Inexact Rounded +xadd045 add 136.255393E+53329961 -53494.7201E+720058060 -> -5.34947201E+720058064 Inexact Rounded +xcom045 compare 136.255393E+53329961 -53494.7201E+720058060 -> 1 +xdiv045 divide 136.255393E+53329961 -53494.7201E+720058060 -> -2.54708115E-666728102 Inexact Rounded +xdvi045 divideint 136.255393E+53329961 -53494.7201E+720058060 -> -0 +xmul045 multiply 136.255393E+53329961 -53494.7201E+720058060 -> -7.28894411E+773388027 Inexact Rounded +xpow045 power 136.255393E+53329961 -5 -> 2.12927373E-266649816 Inexact Rounded +xrem045 remainder 136.255393E+53329961 -53494.7201E+720058060 -> 1.36255393E+53329963 +xsub045 subtract 136.255393E+53329961 -53494.7201E+720058060 -> 5.34947201E+720058064 Inexact Rounded +xadd046 add -876673.100 -6150.92266 -> -882824.023 Inexact Rounded +xcom046 compare -876673.100 -6150.92266 -> -1 +xdiv046 divide -876673.100 -6150.92266 -> 142.527089 Inexact Rounded +xdvi046 divideint -876673.100 -6150.92266 -> 142 +xmul046 multiply -876673.100 -6150.92266 -> 5.39234844E+9 Inexact Rounded +xpow046 power -876673.100 -6151 -> -4.03111774E-36555 Inexact Rounded +xrem046 remainder -876673.100 -6150.92266 -> -3242.08228 +xsub046 subtract -876673.100 -6150.92266 -> -870522.177 Inexact Rounded +xadd047 add -2.45151797E+911306117 27235771 -> -2.45151797E+911306117 Inexact Rounded +xcom047 compare -2.45151797E+911306117 27235771 -> -1 +xdiv047 divide -2.45151797E+911306117 27235771 -> -9.00109628E+911306109 Inexact Rounded +xdvi047 divideint -2.45151797E+911306117 27235771 -> NaN Division_impossible +xmul047 multiply -2.45151797E+911306117 27235771 -> -6.67689820E+911306124 Inexact Rounded +xpow047 power -2.45151797E+911306117 27235771 -> -Infinity Overflow Inexact Rounded +xrem047 remainder -2.45151797E+911306117 27235771 -> NaN Division_impossible +xsub047 subtract -2.45151797E+911306117 27235771 -> -2.45151797E+911306117 Inexact Rounded +xadd048 add -9.15117551 -4.95100733E-314511326 -> -9.15117551 Inexact Rounded +xcom048 compare -9.15117551 -4.95100733E-314511326 -> -1 +xdiv048 divide -9.15117551 -4.95100733E-314511326 -> 1.84834618E+314511326 Inexact Rounded +xdvi048 divideint -9.15117551 -4.95100733E-314511326 -> NaN Division_impossible +xmul048 multiply -9.15117551 -4.95100733E-314511326 -> 4.53075370E-314511325 Inexact Rounded +xpow048 power -9.15117551 -5 -> -0.0000155817265 Inexact Rounded +xrem048 remainder -9.15117551 -4.95100733E-314511326 -> NaN Division_impossible +xsub048 subtract -9.15117551 -4.95100733E-314511326 -> -9.15117551 Inexact Rounded +xadd049 add 3.61890453E-985606128 30664416. -> 30664416.0 Inexact Rounded +xcom049 compare 3.61890453E-985606128 30664416. -> -1 +xdiv049 divide 3.61890453E-985606128 30664416. -> 1.18016418E-985606135 Inexact Rounded +xdvi049 divideint 3.61890453E-985606128 30664416. -> 0 +xmul049 multiply 3.61890453E-985606128 30664416. -> 1.10971594E-985606120 Inexact Rounded +xpow049 power 3.61890453E-985606128 30664416 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem049 remainder 3.61890453E-985606128 30664416. -> 3.61890453E-985606128 +xsub049 subtract 3.61890453E-985606128 30664416. -> -30664416.0 Inexact Rounded +xadd050 add -257674602E+216723382 -70820959.4 -> -2.57674602E+216723390 Inexact Rounded +xcom050 compare -257674602E+216723382 -70820959.4 -> -1 +xdiv050 divide -257674602E+216723382 -70820959.4 -> 3.63839468E+216723382 Inexact Rounded +xdvi050 divideint -257674602E+216723382 -70820959.4 -> NaN Division_impossible +xmul050 multiply -257674602E+216723382 -70820959.4 -> 1.82487625E+216723398 Inexact Rounded +xpow050 power -257674602E+216723382 -70820959 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem050 remainder -257674602E+216723382 -70820959.4 -> NaN Division_impossible +xsub050 subtract -257674602E+216723382 -70820959.4 -> -2.57674602E+216723390 Inexact Rounded +xadd051 add 218699.206 556944241. -> 557162940 Inexact Rounded +xcom051 compare 218699.206 556944241. -> -1 +xdiv051 divide 218699.206 556944241. -> 0.000392677022 Inexact Rounded +xdvi051 divideint 218699.206 556944241. -> 0 +xmul051 multiply 218699.206 556944241. -> 1.21803263E+14 Inexact Rounded +xpow051 power 218699.206 556944241 -> Infinity Overflow Inexact Rounded +xrem051 remainder 218699.206 556944241. -> 218699.206 +xsub051 subtract 218699.206 556944241. -> -556725542 Inexact Rounded +xadd052 add 106211716. -3456793.74 -> 102754922 Inexact Rounded +xcom052 compare 106211716. -3456793.74 -> 1 +xdiv052 divide 106211716. -3456793.74 -> -30.7255000 Inexact Rounded +xdvi052 divideint 106211716. -3456793.74 -> -30 +xmul052 multiply 106211716. -3456793.74 -> -3.67151995E+14 Inexact Rounded +xpow052 power 106211716. -3456794 -> 2.07225581E-27744825 Inexact Rounded +xrem052 remainder 106211716. -3456793.74 -> 2507903.80 +xsub052 subtract 106211716. -3456793.74 -> 109668510 Inexact Rounded +xadd053 add 1.25018078 399856.763E-726816740 -> 1.25018078 Inexact Rounded +xcom053 compare 1.25018078 399856.763E-726816740 -> 1 +xdiv053 divide 1.25018078 399856.763E-726816740 -> 3.12657155E+726816734 Inexact Rounded +xdvi053 divideint 1.25018078 399856.763E-726816740 -> NaN Division_impossible +xmul053 multiply 1.25018078 399856.763E-726816740 -> 4.99893240E-726816735 Inexact Rounded +xpow053 power 1.25018078 4 -> 2.44281890 Inexact Rounded +xrem053 remainder 1.25018078 399856.763E-726816740 -> NaN Division_impossible +xsub053 subtract 1.25018078 399856.763E-726816740 -> 1.25018078 Inexact Rounded +xadd054 add 364.99811 -46222.0505 -> -45857.0524 Inexact Rounded +xcom054 compare 364.99811 -46222.0505 -> 1 +xdiv054 divide 364.99811 -46222.0505 -> -0.00789662306 Inexact Rounded +xdvi054 divideint 364.99811 -46222.0505 -> -0 +xmul054 multiply 364.99811 -46222.0505 -> -16870961.1 Inexact Rounded +xpow054 power 364.99811 -46222 -> 6.35570856E-118435 Inexact Rounded +xrem054 remainder 364.99811 -46222.0505 -> 364.99811 +xsub054 subtract 364.99811 -46222.0505 -> 46587.0486 Inexact Rounded +xadd055 add -392217576. -958364096 -> -1.35058167E+9 Inexact Rounded +xcom055 compare -392217576. -958364096 -> 1 +xdiv055 divide -392217576. -958364096 -> 0.409257377 Inexact Rounded +xdvi055 divideint -392217576. -958364096 -> 0 +xmul055 multiply -392217576. -958364096 -> 3.75887243E+17 Inexact Rounded +xpow055 power -392217576. -958364096 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem055 remainder -392217576. -958364096 -> -392217576 +xsub055 subtract -392217576. -958364096 -> 566146520 +xadd056 add 169601285 714526.639 -> 170315812 Inexact Rounded +xcom056 compare 169601285 714526.639 -> 1 +xdiv056 divide 169601285 714526.639 -> 237.361738 Inexact Rounded +xdvi056 divideint 169601285 714526.639 -> 237 +xmul056 multiply 169601285 714526.639 -> 1.21184636E+14 Inexact Rounded +xpow056 power 169601285 714527 -> 2.06052444E+5880149 Inexact Rounded +xrem056 remainder 169601285 714526.639 -> 258471.557 +xsub056 subtract 169601285 714526.639 -> 168886758 Inexact Rounded +xadd057 add -674.094552E+586944319 6354.2668E+589657266 -> 6.35426680E+589657269 Inexact Rounded +xcom057 compare -674.094552E+586944319 6354.2668E+589657266 -> -1 +xdiv057 divide -674.094552E+586944319 6354.2668E+589657266 -> -1.06085340E-2712948 Inexact Rounded +xdvi057 divideint -674.094552E+586944319 6354.2668E+589657266 -> -0 +xmul057 multiply -674.094552E+586944319 6354.2668E+589657266 -> -Infinity Inexact Overflow Rounded +xpow057 power -674.094552E+586944319 6 -> Infinity Overflow Inexact Rounded +xrem057 remainder -674.094552E+586944319 6354.2668E+589657266 -> -6.74094552E+586944321 +xsub057 subtract -674.094552E+586944319 6354.2668E+589657266 -> -6.35426680E+589657269 Inexact Rounded +xadd058 add 151795163E-371727182 -488.09788E-738852245 -> 1.51795163E-371727174 Inexact Rounded +xcom058 compare 151795163E-371727182 -488.09788E-738852245 -> 1 +xdiv058 divide 151795163E-371727182 -488.09788E-738852245 -> -3.10993285E+367125068 Inexact Rounded +xdvi058 divideint 151795163E-371727182 -488.09788E-738852245 -> NaN Division_impossible +xmul058 multiply 151795163E-371727182 -488.09788E-738852245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow058 power 151795163E-371727182 -5 -> Infinity Overflow Inexact Rounded +xrem058 remainder 151795163E-371727182 -488.09788E-738852245 -> NaN Division_impossible +xsub058 subtract 151795163E-371727182 -488.09788E-738852245 -> 1.51795163E-371727174 Inexact Rounded +xadd059 add -746.293386 927749.647 -> 927003.354 Inexact Rounded +xcom059 compare -746.293386 927749.647 -> -1 +xdiv059 divide -746.293386 927749.647 -> -0.000804412471 Inexact Rounded +xdvi059 divideint -746.293386 927749.647 -> -0 +xmul059 multiply -746.293386 927749.647 -> -692373425 Inexact Rounded +xpow059 power -746.293386 927750 -> 7.49278741E+2665341 Inexact Rounded +xrem059 remainder -746.293386 927749.647 -> -746.293386 +xsub059 subtract -746.293386 927749.647 -> -928495.940 Inexact Rounded +xadd060 add 888946471E+241331592 -235739.595 -> 8.88946471E+241331600 Inexact Rounded +xcom060 compare 888946471E+241331592 -235739.595 -> 1 +xdiv060 divide 888946471E+241331592 -235739.595 -> -3.77088317E+241331595 Inexact Rounded +xdvi060 divideint 888946471E+241331592 -235739.595 -> NaN Division_impossible +xmul060 multiply 888946471E+241331592 -235739.595 -> -2.09559881E+241331606 Inexact Rounded +xpow060 power 888946471E+241331592 -235740 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem060 remainder 888946471E+241331592 -235739.595 -> NaN Division_impossible +xsub060 subtract 888946471E+241331592 -235739.595 -> 8.88946471E+241331600 Inexact Rounded +xadd061 add 6.64377249 79161.1070E+619453776 -> 7.91611070E+619453780 Inexact Rounded +xcom061 compare 6.64377249 79161.1070E+619453776 -> -1 +xdiv061 divide 6.64377249 79161.1070E+619453776 -> 8.39272307E-619453781 Inexact Rounded +xdvi061 divideint 6.64377249 79161.1070E+619453776 -> 0 +xmul061 multiply 6.64377249 79161.1070E+619453776 -> 5.25928385E+619453781 Inexact Rounded +xpow061 power 6.64377249 8 -> 3795928.44 Inexact Rounded +xrem061 remainder 6.64377249 79161.1070E+619453776 -> 6.64377249 +xsub061 subtract 6.64377249 79161.1070E+619453776 -> -7.91611070E+619453780 Inexact Rounded +xadd062 add 3146.66571E-313373366 88.5282010 -> 88.5282010 Inexact Rounded +xcom062 compare 3146.66571E-313373366 88.5282010 -> -1 +xdiv062 divide 3146.66571E-313373366 88.5282010 -> 3.55442184E-313373365 Inexact Rounded +xdvi062 divideint 3146.66571E-313373366 88.5282010 -> 0 +xmul062 multiply 3146.66571E-313373366 88.5282010 -> 2.78568654E-313373361 Inexact Rounded +xpow062 power 3146.66571E-313373366 89 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem062 remainder 3146.66571E-313373366 88.5282010 -> 3.14666571E-313373363 +xsub062 subtract 3146.66571E-313373366 88.5282010 -> -88.5282010 Inexact Rounded +xadd063 add 6.44693097 -87195.8711 -> -87189.4242 Inexact Rounded +xcom063 compare 6.44693097 -87195.8711 -> 1 +xdiv063 divide 6.44693097 -87195.8711 -> -0.0000739361955 Inexact Rounded +xdvi063 divideint 6.44693097 -87195.8711 -> -0 +xmul063 multiply 6.44693097 -87195.8711 -> -562145.762 Inexact Rounded +xpow063 power 6.44693097 -87196 -> 4.50881730E-70573 Inexact Rounded +xrem063 remainder 6.44693097 -87195.8711 -> 6.44693097 +xsub063 subtract 6.44693097 -87195.8711 -> 87202.3180 Inexact Rounded +xadd064 add -2113132.56E+577957840 981125821 -> -2.11313256E+577957846 Inexact Rounded +xcom064 compare -2113132.56E+577957840 981125821 -> -1 +xdiv064 divide -2113132.56E+577957840 981125821 -> -2.15378345E+577957837 Inexact Rounded +xdvi064 divideint -2113132.56E+577957840 981125821 -> NaN Division_impossible +xmul064 multiply -2113132.56E+577957840 981125821 -> -2.07324892E+577957855 Inexact Rounded +xpow064 power -2113132.56E+577957840 981125821 -> -Infinity Overflow Inexact Rounded +xrem064 remainder -2113132.56E+577957840 981125821 -> NaN Division_impossible +xsub064 subtract -2113132.56E+577957840 981125821 -> -2.11313256E+577957846 Inexact Rounded +xadd065 add -7701.42814 72667.5181 -> 64966.0900 Inexact Rounded +xcom065 compare -7701.42814 72667.5181 -> -1 +xdiv065 divide -7701.42814 72667.5181 -> -0.105981714 Inexact Rounded +xdvi065 divideint -7701.42814 72667.5181 -> -0 +xmul065 multiply -7701.42814 72667.5181 -> -559643669 Inexact Rounded +xpow065 power -7701.42814 72668 -> 2.29543837E+282429 Inexact Rounded +xrem065 remainder -7701.42814 72667.5181 -> -7701.42814 +xsub065 subtract -7701.42814 72667.5181 -> -80368.9462 Inexact Rounded +xadd066 add -851.754789 -582659.149 -> -583510.904 Inexact Rounded +xcom066 compare -851.754789 -582659.149 -> 1 +xdiv066 divide -851.754789 -582659.149 -> 0.00146184058 Inexact Rounded +xdvi066 divideint -851.754789 -582659.149 -> 0 +xmul066 multiply -851.754789 -582659.149 -> 496282721 Inexact Rounded +xpow066 power -851.754789 -582659 -> -6.83532593E-1707375 Inexact Rounded +xrem066 remainder -851.754789 -582659.149 -> -851.754789 +xsub066 subtract -851.754789 -582659.149 -> 581807.394 Inexact Rounded +xadd067 add -5.01992943 7852.16531 -> 7847.14538 Inexact Rounded +xcom067 compare -5.01992943 7852.16531 -> -1 +xdiv067 divide -5.01992943 7852.16531 -> -0.000639305113 Inexact Rounded +xdvi067 divideint -5.01992943 7852.16531 -> -0 +xmul067 multiply -5.01992943 7852.16531 -> -39417.3157 Inexact Rounded +xpow067 power -5.01992943 7852 -> 7.54481448E+5501 Inexact Rounded +xrem067 remainder -5.01992943 7852.16531 -> -5.01992943 +xsub067 subtract -5.01992943 7852.16531 -> -7857.18524 Inexact Rounded +xadd068 add -12393257.2 76803689E+949125770 -> 7.68036890E+949125777 Inexact Rounded +xcom068 compare -12393257.2 76803689E+949125770 -> -1 +xdiv068 divide -12393257.2 76803689E+949125770 -> -1.61362786E-949125771 Inexact Rounded +xdvi068 divideint -12393257.2 76803689E+949125770 -> -0 +xmul068 multiply -12393257.2 76803689E+949125770 -> -9.51847872E+949125784 Inexact Rounded +xpow068 power -12393257.2 8 -> 5.56523749E+56 Inexact Rounded +xrem068 remainder -12393257.2 76803689E+949125770 -> -12393257.2 +xsub068 subtract -12393257.2 76803689E+949125770 -> -7.68036890E+949125777 Inexact Rounded +xadd069 add -754771634.E+716555026 -292336.311 -> -7.54771634E+716555034 Inexact Rounded +xcom069 compare -754771634.E+716555026 -292336.311 -> -1 +xdiv069 divide -754771634.E+716555026 -292336.311 -> 2.58186070E+716555029 Inexact Rounded +xdvi069 divideint -754771634.E+716555026 -292336.311 -> NaN Division_impossible +xmul069 multiply -754771634.E+716555026 -292336.311 -> 2.20647155E+716555040 Inexact Rounded +xpow069 power -754771634.E+716555026 -292336 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem069 remainder -754771634.E+716555026 -292336.311 -> NaN Division_impossible +xsub069 subtract -754771634.E+716555026 -292336.311 -> -7.54771634E+716555034 Inexact Rounded +xadd070 add -915006.171E+614548652 -314086965. -> -9.15006171E+614548657 Inexact Rounded +xcom070 compare -915006.171E+614548652 -314086965. -> -1 +xdiv070 divide -915006.171E+614548652 -314086965. -> 2.91322555E+614548649 Inexact Rounded +xdvi070 divideint -915006.171E+614548652 -314086965. -> NaN Division_impossible +xmul070 multiply -915006.171E+614548652 -314086965. -> 2.87391511E+614548666 Inexact Rounded +xpow070 power -915006.171E+614548652 -314086965 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem070 remainder -915006.171E+614548652 -314086965. -> NaN Division_impossible +xsub070 subtract -915006.171E+614548652 -314086965. -> -9.15006171E+614548657 Inexact Rounded +xadd071 add -296590035 -481734529 -> -778324564 +xcom071 compare -296590035 -481734529 -> 1 +xdiv071 divide -296590035 -481734529 -> 0.615671116 Inexact Rounded +xdvi071 divideint -296590035 -481734529 -> 0 +xmul071 multiply -296590035 -481734529 -> 1.42877661E+17 Inexact Rounded +xpow071 power -296590035 -481734529 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem071 remainder -296590035 -481734529 -> -296590035 +xsub071 subtract -296590035 -481734529 -> 185144494 +xadd072 add 8.27822605 9241557.19 -> 9241565.47 Inexact Rounded +xcom072 compare 8.27822605 9241557.19 -> -1 +xdiv072 divide 8.27822605 9241557.19 -> 8.95760950E-7 Inexact Rounded +xdvi072 divideint 8.27822605 9241557.19 -> 0 +xmul072 multiply 8.27822605 9241557.19 -> 76503699.5 Inexact Rounded +xpow072 power 8.27822605 9241557 -> 5.10219969E+8483169 Inexact Rounded +xrem072 remainder 8.27822605 9241557.19 -> 8.27822605 +xsub072 subtract 8.27822605 9241557.19 -> -9241548.91 Inexact Rounded +xadd073 add -1.43581098 7286313.54 -> 7286312.10 Inexact Rounded +xcom073 compare -1.43581098 7286313.54 -> -1 +xdiv073 divide -1.43581098 7286313.54 -> -1.97055887E-7 Inexact Rounded +xdvi073 divideint -1.43581098 7286313.54 -> -0 +xmul073 multiply -1.43581098 7286313.54 -> -10461769.0 Inexact Rounded +xpow073 power -1.43581098 7286314 -> 1.09389741E+1144660 Inexact Rounded +xrem073 remainder -1.43581098 7286313.54 -> -1.43581098 +xsub073 subtract -1.43581098 7286313.54 -> -7286314.98 Inexact Rounded +xadd074 add -699036193. 759263.509E+533543625 -> 7.59263509E+533543630 Inexact Rounded +xcom074 compare -699036193. 759263.509E+533543625 -> -1 +xdiv074 divide -699036193. 759263.509E+533543625 -> -9.20676662E-533543623 Inexact Rounded +xdvi074 divideint -699036193. 759263.509E+533543625 -> -0 +xmul074 multiply -699036193. 759263.509E+533543625 -> -5.30752673E+533543639 Inexact Rounded +xpow074 power -699036193. 8 -> 5.70160724E+70 Inexact Rounded +xrem074 remainder -699036193. 759263.509E+533543625 -> -699036193 +xsub074 subtract -699036193. 759263.509E+533543625 -> -7.59263509E+533543630 Inexact Rounded +xadd075 add -83.7273615E-305281957 -287779593.E+458777774 -> -2.87779593E+458777782 Inexact Rounded +xcom075 compare -83.7273615E-305281957 -287779593.E+458777774 -> 1 +xdiv075 divide -83.7273615E-305281957 -287779593.E+458777774 -> 2.90942664E-764059738 Inexact Rounded +xdvi075 divideint -83.7273615E-305281957 -287779593.E+458777774 -> 0 +xmul075 multiply -83.7273615E-305281957 -287779593.E+458777774 -> 2.40950260E+153495827 Inexact Rounded +xpow075 power -83.7273615E-305281957 -3 -> -1.70371828E+915845865 Inexact Rounded +xrem075 remainder -83.7273615E-305281957 -287779593.E+458777774 -> -8.37273615E-305281956 +xsub075 subtract -83.7273615E-305281957 -287779593.E+458777774 -> 2.87779593E+458777782 Inexact Rounded +xadd076 add 8.48503224 6522.03316 -> 6530.51819 Inexact Rounded +xcom076 compare 8.48503224 6522.03316 -> -1 +xdiv076 divide 8.48503224 6522.03316 -> 0.00130097962 Inexact Rounded +xdvi076 divideint 8.48503224 6522.03316 -> 0 +xmul076 multiply 8.48503224 6522.03316 -> 55339.6616 Inexact Rounded +xpow076 power 8.48503224 6522 -> 4.76547542E+6056 Inexact Rounded +xrem076 remainder 8.48503224 6522.03316 -> 8.48503224 +xsub076 subtract 8.48503224 6522.03316 -> -6513.54813 Inexact Rounded +xadd077 add 527916091 -809.054070 -> 527915282 Inexact Rounded +xcom077 compare 527916091 -809.054070 -> 1 +xdiv077 divide 527916091 -809.054070 -> -652510.272 Inexact Rounded +xdvi077 divideint 527916091 -809.054070 -> -652510 +xmul077 multiply 527916091 -809.054070 -> -4.27112662E+11 Inexact Rounded +xpow077 power 527916091 -809 -> 2.78609697E-7057 Inexact Rounded +xrem077 remainder 527916091 -809.054070 -> 219.784300 +xsub077 subtract 527916091 -809.054070 -> 527916900 Inexact Rounded +xadd078 add 3857058.60 5792997.58E+881077409 -> 5.79299758E+881077415 Inexact Rounded +xcom078 compare 3857058.60 5792997.58E+881077409 -> -1 +xdiv078 divide 3857058.60 5792997.58E+881077409 -> 6.65813950E-881077410 Inexact Rounded +xdvi078 divideint 3857058.60 5792997.58E+881077409 -> 0 +xmul078 multiply 3857058.60 5792997.58E+881077409 -> 2.23439311E+881077422 Inexact Rounded +xpow078 power 3857058.60 6 -> 3.29258824E+39 Inexact Rounded +xrem078 remainder 3857058.60 5792997.58E+881077409 -> 3857058.60 +xsub078 subtract 3857058.60 5792997.58E+881077409 -> -5.79299758E+881077415 Inexact Rounded +xadd079 add -66587363.E+556538173 -551902402E+357309146 -> -6.65873630E+556538180 Inexact Rounded +xcom079 compare -66587363.E+556538173 -551902402E+357309146 -> -1 +xdiv079 divide -66587363.E+556538173 -551902402E+357309146 -> 1.20650613E+199229026 Inexact Rounded +xdvi079 divideint -66587363.E+556538173 -551902402E+357309146 -> NaN Division_impossible +xmul079 multiply -66587363.E+556538173 -551902402E+357309146 -> 3.67497256E+913847335 Inexact Rounded +xpow079 power -66587363.E+556538173 -6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem079 remainder -66587363.E+556538173 -551902402E+357309146 -> NaN Division_impossible +xsub079 subtract -66587363.E+556538173 -551902402E+357309146 -> -6.65873630E+556538180 Inexact Rounded +xadd080 add -580.502955 38125521.7 -> 38124941.2 Inexact Rounded +xcom080 compare -580.502955 38125521.7 -> -1 +xdiv080 divide -580.502955 38125521.7 -> -0.0000152260987 Inexact Rounded +xdvi080 divideint -580.502955 38125521.7 -> -0 +xmul080 multiply -580.502955 38125521.7 -> -2.21319780E+10 Inexact Rounded +xpow080 power -580.502955 38125522 -> 6.07262078E+105371486 Inexact Rounded +xrem080 remainder -580.502955 38125521.7 -> -580.502955 +xsub080 subtract -580.502955 38125521.7 -> -38126102.2 Inexact Rounded +xadd081 add -9627363.00 -80616885E-749891394 -> -9627363.00 Inexact Rounded +xcom081 compare -9627363.00 -80616885E-749891394 -> -1 +xdiv081 divide -9627363.00 -80616885E-749891394 -> 1.19421173E+749891393 Inexact Rounded +xdvi081 divideint -9627363.00 -80616885E-749891394 -> NaN Division_impossible +xmul081 multiply -9627363.00 -80616885E-749891394 -> 7.76128016E-749891380 Inexact Rounded +xpow081 power -9627363.00 -8 -> 1.35500601E-56 Inexact Rounded +xrem081 remainder -9627363.00 -80616885E-749891394 -> NaN Division_impossible +xsub081 subtract -9627363.00 -80616885E-749891394 -> -9627363.00 Inexact Rounded +xadd082 add -526.594855E+803110107 -64.5451639 -> -5.26594855E+803110109 Inexact Rounded +xcom082 compare -526.594855E+803110107 -64.5451639 -> -1 +xdiv082 divide -526.594855E+803110107 -64.5451639 -> 8.15854858E+803110107 Inexact Rounded +xdvi082 divideint -526.594855E+803110107 -64.5451639 -> NaN Division_impossible +xmul082 multiply -526.594855E+803110107 -64.5451639 -> 3.39891512E+803110111 Inexact Rounded +xpow082 power -526.594855E+803110107 -65 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem082 remainder -526.594855E+803110107 -64.5451639 -> NaN Division_impossible +xsub082 subtract -526.594855E+803110107 -64.5451639 -> -5.26594855E+803110109 Inexact Rounded +xadd083 add -8378.55499 760.131257 -> -7618.42373 Inexact Rounded +xcom083 compare -8378.55499 760.131257 -> -1 +xdiv083 divide -8378.55499 760.131257 -> -11.0225108 Inexact Rounded +xdvi083 divideint -8378.55499 760.131257 -> -11 +xmul083 multiply -8378.55499 760.131257 -> -6368801.54 Inexact Rounded +xpow083 power -8378.55499 760 -> 4.06007928E+2981 Inexact Rounded +xrem083 remainder -8378.55499 760.131257 -> -17.111163 +xsub083 subtract -8378.55499 760.131257 -> -9138.68625 Inexact Rounded +xadd084 add -717.697718 984304413 -> 984303695 Inexact Rounded +xcom084 compare -717.697718 984304413 -> -1 +xdiv084 divide -717.697718 984304413 -> -7.29142030E-7 Inexact Rounded +xdvi084 divideint -717.697718 984304413 -> -0 +xmul084 multiply -717.697718 984304413 -> -7.06433031E+11 Inexact Rounded +xpow084 power -717.697718 984304413 -> -Infinity Overflow Inexact Rounded +xrem084 remainder -717.697718 984304413 -> -717.697718 +xsub084 subtract -717.697718 984304413 -> -984305131 Inexact Rounded +xadd085 add -76762243.4E-741100094 -273.706674 -> -273.706674 Inexact Rounded +xcom085 compare -76762243.4E-741100094 -273.706674 -> 1 +xdiv085 divide -76762243.4E-741100094 -273.706674 -> 2.80454409E-741100089 Inexact Rounded +xdvi085 divideint -76762243.4E-741100094 -273.706674 -> 0 +xmul085 multiply -76762243.4E-741100094 -273.706674 -> 2.10103383E-741100084 Inexact Rounded +xpow085 power -76762243.4E-741100094 -274 -> Infinity Overflow Inexact Rounded +xrem085 remainder -76762243.4E-741100094 -273.706674 -> -7.67622434E-741100087 +xsub085 subtract -76762243.4E-741100094 -273.706674 -> 273.706674 Inexact Rounded +xadd086 add -701.518354E+786274918 8822750.68E+243052107 -> -7.01518354E+786274920 Inexact Rounded +xcom086 compare -701.518354E+786274918 8822750.68E+243052107 -> -1 +xdiv086 divide -701.518354E+786274918 8822750.68E+243052107 -> -7.95124309E+543222806 Inexact Rounded +xdvi086 divideint -701.518354E+786274918 8822750.68E+243052107 -> NaN Division_impossible +xmul086 multiply -701.518354E+786274918 8822750.68E+243052107 -> -Infinity Inexact Overflow Rounded +xpow086 power -701.518354E+786274918 9 -> -Infinity Overflow Inexact Rounded +xrem086 remainder -701.518354E+786274918 8822750.68E+243052107 -> NaN Division_impossible +xsub086 subtract -701.518354E+786274918 8822750.68E+243052107 -> -7.01518354E+786274920 Inexact Rounded +xadd087 add -359866845. -4.57434117 -> -359866850 Inexact Rounded +xcom087 compare -359866845. -4.57434117 -> -1 +xdiv087 divide -359866845. -4.57434117 -> 78670748.8 Inexact Rounded +xdvi087 divideint -359866845. -4.57434117 -> 78670748 +xmul087 multiply -359866845. -4.57434117 -> 1.64615372E+9 Inexact Rounded +xpow087 power -359866845. -5 -> -1.65687909E-43 Inexact Rounded +xrem087 remainder -359866845. -4.57434117 -> -3.54890484 +xsub087 subtract -359866845. -4.57434117 -> -359866840 Inexact Rounded +xadd088 add 779934536. -76562645.7 -> 703371890 Inexact Rounded +xcom088 compare 779934536. -76562645.7 -> 1 +xdiv088 divide 779934536. -76562645.7 -> -10.1868807 Inexact Rounded +xdvi088 divideint 779934536. -76562645.7 -> -10 +xmul088 multiply 779934536. -76562645.7 -> -5.97138515E+16 Inexact Rounded +xpow088 power 779934536. -76562646 -> 3.36739063E-680799501 Inexact Rounded +xrem088 remainder 779934536. -76562645.7 -> 14308079.0 +xsub088 subtract 779934536. -76562645.7 -> 856497182 Inexact Rounded +xadd089 add -4820.95451 3516234.99E+303303176 -> 3.51623499E+303303182 Inexact Rounded +xcom089 compare -4820.95451 3516234.99E+303303176 -> -1 +xdiv089 divide -4820.95451 3516234.99E+303303176 -> -1.37105584E-303303179 Inexact Rounded +xdvi089 divideint -4820.95451 3516234.99E+303303176 -> -0 +xmul089 multiply -4820.95451 3516234.99E+303303176 -> -1.69516089E+303303186 Inexact Rounded +xpow089 power -4820.95451 4 -> 5.40172082E+14 Inexact Rounded +xrem089 remainder -4820.95451 3516234.99E+303303176 -> -4820.95451 +xsub089 subtract -4820.95451 3516234.99E+303303176 -> -3.51623499E+303303182 Inexact Rounded +xadd090 add 69355976.9 -9.57838562E+758804984 -> -9.57838562E+758804984 Inexact Rounded +xcom090 compare 69355976.9 -9.57838562E+758804984 -> 1 +xdiv090 divide 69355976.9 -9.57838562E+758804984 -> -7.24088376E-758804978 Inexact Rounded +xdvi090 divideint 69355976.9 -9.57838562E+758804984 -> -0 +xmul090 multiply 69355976.9 -9.57838562E+758804984 -> -6.64318292E+758804992 Inexact Rounded +xpow090 power 69355976.9 -10 -> 3.88294346E-79 Inexact Rounded +xrem090 remainder 69355976.9 -9.57838562E+758804984 -> 69355976.9 +xsub090 subtract 69355976.9 -9.57838562E+758804984 -> 9.57838562E+758804984 Inexact Rounded +xadd091 add -12672093.1 8569.78255E-382866025 -> -12672093.1 Inexact Rounded +xcom091 compare -12672093.1 8569.78255E-382866025 -> -1 +xdiv091 divide -12672093.1 8569.78255E-382866025 -> -1.47869482E+382866028 Inexact Rounded +xdvi091 divideint -12672093.1 8569.78255E-382866025 -> NaN Division_impossible +xmul091 multiply -12672093.1 8569.78255E-382866025 -> -1.08597082E-382866014 Inexact Rounded +xpow091 power -12672093.1 9 -> -8.42626658E+63 Inexact Rounded +xrem091 remainder -12672093.1 8569.78255E-382866025 -> NaN Division_impossible +xsub091 subtract -12672093.1 8569.78255E-382866025 -> -12672093.1 Inexact Rounded +xadd092 add -5910750.2 66150383E-662459241 -> -5910750.20 Inexact Rounded +xcom092 compare -5910750.2 66150383E-662459241 -> -1 +xdiv092 divide -5910750.2 66150383E-662459241 -> -8.93532272E+662459239 Inexact Rounded +xdvi092 divideint -5910750.2 66150383E-662459241 -> NaN Division_impossible +xmul092 multiply -5910750.2 66150383E-662459241 -> -3.90998390E-662459227 Inexact Rounded +xpow092 power -5910750.2 7 -> -2.52056696E+47 Inexact Rounded +xrem092 remainder -5910750.2 66150383E-662459241 -> NaN Division_impossible +xsub092 subtract -5910750.2 66150383E-662459241 -> -5910750.20 Inexact Rounded +xadd093 add -532577268.E-163806629 -240650398E-650110558 -> -5.32577268E-163806621 Inexact Rounded +xcom093 compare -532577268.E-163806629 -240650398E-650110558 -> -1 +xdiv093 divide -532577268.E-163806629 -240650398E-650110558 -> 2.21307454E+486303929 Inexact Rounded +xdvi093 divideint -532577268.E-163806629 -240650398E-650110558 -> NaN Division_impossible +xmul093 multiply -532577268.E-163806629 -240650398E-650110558 -> 1.28164932E-813917170 Inexact Rounded +xpow093 power -532577268.E-163806629 -2 -> 3.52561389E+327613240 Inexact Rounded +xrem093 remainder -532577268.E-163806629 -240650398E-650110558 -> NaN Division_impossible +xsub093 subtract -532577268.E-163806629 -240650398E-650110558 -> -5.32577268E-163806621 Inexact Rounded +xadd094 add -671.507198E-908587890 3057429.32E-555230623 -> 3.05742932E-555230617 Inexact Rounded +xcom094 compare -671.507198E-908587890 3057429.32E-555230623 -> -1 +xdiv094 divide -671.507198E-908587890 3057429.32E-555230623 -> -2.19631307E-353357271 Inexact Rounded +xdvi094 divideint -671.507198E-908587890 3057429.32E-555230623 -> -0 +xmul094 multiply -671.507198E-908587890 3057429.32E-555230623 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow094 power -671.507198E-908587890 3 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem094 remainder -671.507198E-908587890 3057429.32E-555230623 -> -6.71507198E-908587888 +xsub094 subtract -671.507198E-908587890 3057429.32E-555230623 -> -3.05742932E-555230617 Inexact Rounded +xadd095 add -294.994352E+346452027 -6061853.0 -> -2.94994352E+346452029 Inexact Rounded +xcom095 compare -294.994352E+346452027 -6061853.0 -> -1 +xdiv095 divide -294.994352E+346452027 -6061853.0 -> 4.86640557E+346452022 Inexact Rounded +xdvi095 divideint -294.994352E+346452027 -6061853.0 -> NaN Division_impossible +xmul095 multiply -294.994352E+346452027 -6061853.0 -> 1.78821240E+346452036 Inexact Rounded +xpow095 power -294.994352E+346452027 -6061853 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem095 remainder -294.994352E+346452027 -6061853.0 -> NaN Division_impossible +xsub095 subtract -294.994352E+346452027 -6061853.0 -> -2.94994352E+346452029 Inexact Rounded +xadd096 add 329579114 146780548. -> 476359662 +xcom096 compare 329579114 146780548. -> 1 +xdiv096 divide 329579114 146780548. -> 2.24538686 Inexact Rounded +xdvi096 divideint 329579114 146780548. -> 2 +xmul096 multiply 329579114 146780548. -> 4.83758030E+16 Inexact Rounded +xpow096 power 329579114 146780548 -> Infinity Overflow Inexact Rounded +xrem096 remainder 329579114 146780548. -> 36018018 +xsub096 subtract 329579114 146780548. -> 182798566 +xadd097 add -789904.686E-217225000 -1991.07181E-84080059 -> -1.99107181E-84080056 Inexact Rounded +xcom097 compare -789904.686E-217225000 -1991.07181E-84080059 -> 1 +xdiv097 divide -789904.686E-217225000 -1991.07181E-84080059 -> 3.96723354E-133144939 Inexact Rounded +xdvi097 divideint -789904.686E-217225000 -1991.07181E-84080059 -> 0 +xmul097 multiply -789904.686E-217225000 -1991.07181E-84080059 -> 1.57275695E-301305050 Inexact Rounded +xpow097 power -789904.686E-217225000 -2 -> 1.60269403E+434449988 Inexact Rounded +xrem097 remainder -789904.686E-217225000 -1991.07181E-84080059 -> -7.89904686E-217224995 +xsub097 subtract -789904.686E-217225000 -1991.07181E-84080059 -> 1.99107181E-84080056 Inexact Rounded +xadd098 add 59893.3544 -408595868 -> -408535975 Inexact Rounded +xcom098 compare 59893.3544 -408595868 -> 1 +xdiv098 divide 59893.3544 -408595868 -> -0.000146583358 Inexact Rounded +xdvi098 divideint 59893.3544 -408595868 -> -0 +xmul098 multiply 59893.3544 -408595868 -> -2.44721771E+13 Inexact Rounded +xpow098 power 59893.3544 -408595868 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem098 remainder 59893.3544 -408595868 -> 59893.3544 +xsub098 subtract 59893.3544 -408595868 -> 408655761 Inexact Rounded +xadd099 add 129.878613 -54652.7288E-963564940 -> 129.878613 Inexact Rounded +xcom099 compare 129.878613 -54652.7288E-963564940 -> 1 +xdiv099 divide 129.878613 -54652.7288E-963564940 -> -2.37643418E+963564937 Inexact Rounded +xdvi099 divideint 129.878613 -54652.7288E-963564940 -> NaN Division_impossible +xmul099 multiply 129.878613 -54652.7288E-963564940 -> -7.09822061E-963564934 Inexact Rounded +xpow099 power 129.878613 -5 -> 2.70590029E-11 Inexact Rounded +xrem099 remainder 129.878613 -54652.7288E-963564940 -> NaN Division_impossible +xsub099 subtract 129.878613 -54652.7288E-963564940 -> 129.878613 Inexact Rounded +xadd100 add 9866.99208 708756501. -> 708766368 Inexact Rounded +xcom100 compare 9866.99208 708756501. -> -1 +xdiv100 divide 9866.99208 708756501. -> 0.0000139215543 Inexact Rounded +xdvi100 divideint 9866.99208 708756501. -> 0 +xmul100 multiply 9866.99208 708756501. -> 6.99329478E+12 Inexact Rounded +xpow100 power 9866.99208 708756501 -> Infinity Overflow Inexact Rounded +xrem100 remainder 9866.99208 708756501. -> 9866.99208 +xsub100 subtract 9866.99208 708756501. -> -708746634 Inexact Rounded +xadd101 add -78810.6297 -399884.68 -> -478695.310 Inexact Rounded +xcom101 compare -78810.6297 -399884.68 -> 1 +xdiv101 divide -78810.6297 -399884.68 -> 0.197083393 Inexact Rounded +xdvi101 divideint -78810.6297 -399884.68 -> 0 +xmul101 multiply -78810.6297 -399884.68 -> 3.15151634E+10 Inexact Rounded +xpow101 power -78810.6297 -399885 -> -1.54252408E-1958071 Inexact Rounded +xrem101 remainder -78810.6297 -399884.68 -> -78810.6297 +xsub101 subtract -78810.6297 -399884.68 -> 321074.050 Inexact Rounded +xadd102 add 409189761 -771.471460 -> 409188990 Inexact Rounded +xcom102 compare 409189761 -771.471460 -> 1 +xdiv102 divide 409189761 -771.471460 -> -530401.683 Inexact Rounded +xdvi102 divideint 409189761 -771.471460 -> -530401 +xmul102 multiply 409189761 -771.471460 -> -3.15678222E+11 Inexact Rounded +xpow102 power 409189761 -771 -> 1.60698414E-6640 Inexact Rounded +xrem102 remainder 409189761 -771.471460 -> 527.144540 +xsub102 subtract 409189761 -771.471460 -> 409190532 Inexact Rounded +xadd103 add -1.68748838 460.46924 -> 458.781752 Inexact Rounded +xcom103 compare -1.68748838 460.46924 -> -1 +xdiv103 divide -1.68748838 460.46924 -> -0.00366471467 Inexact Rounded +xdvi103 divideint -1.68748838 460.46924 -> -0 +xmul103 multiply -1.68748838 460.46924 -> -777.036492 Inexact Rounded +xpow103 power -1.68748838 460 -> 3.39440648E+104 Inexact Rounded +xrem103 remainder -1.68748838 460.46924 -> -1.68748838 +xsub103 subtract -1.68748838 460.46924 -> -462.156728 Inexact Rounded +xadd104 add 553527296. -7924.40185 -> 553519372 Inexact Rounded +xcom104 compare 553527296. -7924.40185 -> 1 +xdiv104 divide 553527296. -7924.40185 -> -69850.9877 Inexact Rounded +xdvi104 divideint 553527296. -7924.40185 -> -69850 +xmul104 multiply 553527296. -7924.40185 -> -4.38637273E+12 Inexact Rounded +xpow104 power 553527296. -7924 -> 2.32397214E-69281 Inexact Rounded +xrem104 remainder 553527296. -7924.40185 -> 7826.77750 +xsub104 subtract 553527296. -7924.40185 -> 553535220 Inexact Rounded +xadd105 add -38.7465207 64936.2942 -> 64897.5477 Inexact Rounded +xcom105 compare -38.7465207 64936.2942 -> -1 +xdiv105 divide -38.7465207 64936.2942 -> -0.000596685123 Inexact Rounded +xdvi105 divideint -38.7465207 64936.2942 -> -0 +xmul105 multiply -38.7465207 64936.2942 -> -2516055.47 Inexact Rounded +xpow105 power -38.7465207 64936 -> 3.01500762E+103133 Inexact Rounded +xrem105 remainder -38.7465207 64936.2942 -> -38.7465207 +xsub105 subtract -38.7465207 64936.2942 -> -64975.0407 Inexact Rounded +xadd106 add -201075.248 845.663928 -> -200229.584 Inexact Rounded +xcom106 compare -201075.248 845.663928 -> -1 +xdiv106 divide -201075.248 845.663928 -> -237.772053 Inexact Rounded +xdvi106 divideint -201075.248 845.663928 -> -237 +xmul106 multiply -201075.248 845.663928 -> -170042084 Inexact Rounded +xpow106 power -201075.248 846 -> 4.37911767E+4486 Inexact Rounded +xrem106 remainder -201075.248 845.663928 -> -652.897064 +xsub106 subtract -201075.248 845.663928 -> -201920.912 Inexact Rounded +xadd107 add 91048.4559 75953609.3 -> 76044657.8 Inexact Rounded +xcom107 compare 91048.4559 75953609.3 -> -1 +xdiv107 divide 91048.4559 75953609.3 -> 0.00119873771 Inexact Rounded +xdvi107 divideint 91048.4559 75953609.3 -> 0 +xmul107 multiply 91048.4559 75953609.3 -> 6.91545885E+12 Inexact Rounded +xpow107 power 91048.4559 75953609 -> 6.94467746E+376674650 Inexact Rounded +xrem107 remainder 91048.4559 75953609.3 -> 91048.4559 +xsub107 subtract 91048.4559 75953609.3 -> -75862560.8 Inexact Rounded +xadd108 add 6898273.86E-252097460 15.3456196 -> 15.3456196 Inexact Rounded +xcom108 compare 6898273.86E-252097460 15.3456196 -> -1 +xdiv108 divide 6898273.86E-252097460 15.3456196 -> 4.49527229E-252097455 Inexact Rounded +xdvi108 divideint 6898273.86E-252097460 15.3456196 -> 0 +xmul108 multiply 6898273.86E-252097460 15.3456196 -> 1.05858287E-252097452 Inexact Rounded +xpow108 power 6898273.86E-252097460 15 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem108 remainder 6898273.86E-252097460 15.3456196 -> 6.89827386E-252097454 +xsub108 subtract 6898273.86E-252097460 15.3456196 -> -15.3456196 Inexact Rounded +xadd109 add 88.4370343 -980709105E-869899289 -> 88.4370343 Inexact Rounded +xcom109 compare 88.4370343 -980709105E-869899289 -> 1 +xdiv109 divide 88.4370343 -980709105E-869899289 -> -9.01766220E+869899281 Inexact Rounded +xdvi109 divideint 88.4370343 -980709105E-869899289 -> NaN Division_impossible +xmul109 multiply 88.4370343 -980709105E-869899289 -> -8.67310048E-869899279 Inexact Rounded +xpow109 power 88.4370343 -10 -> 3.41710479E-20 Inexact Rounded +xrem109 remainder 88.4370343 -980709105E-869899289 -> NaN Division_impossible +xsub109 subtract 88.4370343 -980709105E-869899289 -> 88.4370343 Inexact Rounded +xadd110 add -17643.39 2.0352568E+304871331 -> 2.03525680E+304871331 Inexact Rounded +xcom110 compare -17643.39 2.0352568E+304871331 -> -1 +xdiv110 divide -17643.39 2.0352568E+304871331 -> -8.66887658E-304871328 Inexact Rounded +xdvi110 divideint -17643.39 2.0352568E+304871331 -> -0 +xmul110 multiply -17643.39 2.0352568E+304871331 -> -3.59088295E+304871335 Inexact Rounded +xpow110 power -17643.39 2 -> 311289211 Inexact Rounded +xrem110 remainder -17643.39 2.0352568E+304871331 -> -17643.39 +xsub110 subtract -17643.39 2.0352568E+304871331 -> -2.03525680E+304871331 Inexact Rounded +xadd111 add 4589785.16 7459.04237 -> 4597244.20 Inexact Rounded +xcom111 compare 4589785.16 7459.04237 -> 1 +xdiv111 divide 4589785.16 7459.04237 -> 615.331692 Inexact Rounded +xdvi111 divideint 4589785.16 7459.04237 -> 615 +xmul111 multiply 4589785.16 7459.04237 -> 3.42354020E+10 Inexact Rounded +xpow111 power 4589785.16 7459 -> 2.03795258E+49690 Inexact Rounded +xrem111 remainder 4589785.16 7459.04237 -> 2474.10245 +xsub111 subtract 4589785.16 7459.04237 -> 4582326.12 Inexact Rounded +xadd112 add -51.1632090E-753968082 8.96207471E-585797887 -> 8.96207471E-585797887 Inexact Rounded +xcom112 compare -51.1632090E-753968082 8.96207471E-585797887 -> -1 +xdiv112 divide -51.1632090E-753968082 8.96207471E-585797887 -> -5.70885768E-168170195 Inexact Rounded +xdvi112 divideint -51.1632090E-753968082 8.96207471E-585797887 -> -0 +xmul112 multiply -51.1632090E-753968082 8.96207471E-585797887 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow112 power -51.1632090E-753968082 9 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem112 remainder -51.1632090E-753968082 8.96207471E-585797887 -> -5.11632090E-753968081 +xsub112 subtract -51.1632090E-753968082 8.96207471E-585797887 -> -8.96207471E-585797887 Inexact Rounded +xadd113 add 982.217817 7224909.4E-45243816 -> 982.217817 Inexact Rounded +xcom113 compare 982.217817 7224909.4E-45243816 -> 1 +xdiv113 divide 982.217817 7224909.4E-45243816 -> 1.35948807E+45243812 Inexact Rounded +xdvi113 divideint 982.217817 7224909.4E-45243816 -> NaN Division_impossible +xmul113 multiply 982.217817 7224909.4E-45243816 -> 7.09643474E-45243807 Inexact Rounded +xpow113 power 982.217817 7 -> 8.81971709E+20 Inexact Rounded +xrem113 remainder 982.217817 7224909.4E-45243816 -> NaN Division_impossible +xsub113 subtract 982.217817 7224909.4E-45243816 -> 982.217817 Inexact Rounded +xadd114 add 503712056. -57490703.5E+924890183 -> -5.74907035E+924890190 Inexact Rounded +xcom114 compare 503712056. -57490703.5E+924890183 -> 1 +xdiv114 divide 503712056. -57490703.5E+924890183 -> -8.76162623E-924890183 Inexact Rounded +xdvi114 divideint 503712056. -57490703.5E+924890183 -> -0 +xmul114 multiply 503712056. -57490703.5E+924890183 -> -2.89587605E+924890199 Inexact Rounded +xpow114 power 503712056. -6 -> 6.12217764E-53 Inexact Rounded +xrem114 remainder 503712056. -57490703.5E+924890183 -> 503712056 +xsub114 subtract 503712056. -57490703.5E+924890183 -> 5.74907035E+924890190 Inexact Rounded +xadd115 add 883.849223 249259171 -> 249260055 Inexact Rounded +xcom115 compare 883.849223 249259171 -> -1 +xdiv115 divide 883.849223 249259171 -> 0.00000354590453 Inexact Rounded +xdvi115 divideint 883.849223 249259171 -> 0 +xmul115 multiply 883.849223 249259171 -> 2.20307525E+11 Inexact Rounded +xpow115 power 883.849223 249259171 -> 5.15642844E+734411783 Inexact Rounded +xrem115 remainder 883.849223 249259171 -> 883.849223 +xsub115 subtract 883.849223 249259171 -> -249258287 Inexact Rounded +xadd116 add 245.092853E+872642874 828195.152E+419771532 -> 2.45092853E+872642876 Inexact Rounded +xcom116 compare 245.092853E+872642874 828195.152E+419771532 -> 1 +xdiv116 divide 245.092853E+872642874 828195.152E+419771532 -> 2.95936112E+452871338 Inexact Rounded +xdvi116 divideint 245.092853E+872642874 828195.152E+419771532 -> NaN Division_impossible +xmul116 multiply 245.092853E+872642874 828195.152E+419771532 -> Infinity Inexact Overflow Rounded +xpow116 power 245.092853E+872642874 8 -> Infinity Overflow Inexact Rounded +xrem116 remainder 245.092853E+872642874 828195.152E+419771532 -> NaN Division_impossible +xsub116 subtract 245.092853E+872642874 828195.152E+419771532 -> 2.45092853E+872642876 Inexact Rounded +xadd117 add -83658638.6E+728551928 2952478.42 -> -8.36586386E+728551935 Inexact Rounded +xcom117 compare -83658638.6E+728551928 2952478.42 -> -1 +xdiv117 divide -83658638.6E+728551928 2952478.42 -> -2.83350551E+728551929 Inexact Rounded +xdvi117 divideint -83658638.6E+728551928 2952478.42 -> NaN Division_impossible +xmul117 multiply -83658638.6E+728551928 2952478.42 -> -2.47000325E+728551942 Inexact Rounded +xpow117 power -83658638.6E+728551928 2952478 -> Infinity Overflow Inexact Rounded +xrem117 remainder -83658638.6E+728551928 2952478.42 -> NaN Division_impossible +xsub117 subtract -83658638.6E+728551928 2952478.42 -> -8.36586386E+728551935 Inexact Rounded +xadd118 add -6291780.97 269967.394E-22000817 -> -6291780.97 Inexact Rounded +xcom118 compare -6291780.97 269967.394E-22000817 -> -1 +xdiv118 divide -6291780.97 269967.394E-22000817 -> -2.33057069E+22000818 Inexact Rounded +xdvi118 divideint -6291780.97 269967.394E-22000817 -> NaN Division_impossible +xmul118 multiply -6291780.97 269967.394E-22000817 -> -1.69857571E-22000805 Inexact Rounded +xpow118 power -6291780.97 3 -> -2.49069636E+20 Inexact Rounded +xrem118 remainder -6291780.97 269967.394E-22000817 -> NaN Division_impossible +xsub118 subtract -6291780.97 269967.394E-22000817 -> -6291780.97 Inexact Rounded +xadd119 add 978571348.E+222382547 6006.19370 -> 9.78571348E+222382555 Inexact Rounded +xcom119 compare 978571348.E+222382547 6006.19370 -> 1 +xdiv119 divide 978571348.E+222382547 6006.19370 -> 1.62927038E+222382552 Inexact Rounded +xdvi119 divideint 978571348.E+222382547 6006.19370 -> NaN Division_impossible +xmul119 multiply 978571348.E+222382547 6006.19370 -> 5.87748907E+222382559 Inexact Rounded +xpow119 power 978571348.E+222382547 6006 -> Infinity Overflow Inexact Rounded +xrem119 remainder 978571348.E+222382547 6006.19370 -> NaN Division_impossible +xsub119 subtract 978571348.E+222382547 6006.19370 -> 9.78571348E+222382555 Inexact Rounded +xadd120 add 14239029. -36527.2221 -> 14202501.8 Inexact Rounded +xcom120 compare 14239029. -36527.2221 -> 1 +xdiv120 divide 14239029. -36527.2221 -> -389.819652 Inexact Rounded +xdvi120 divideint 14239029. -36527.2221 -> -389 +xmul120 multiply 14239029. -36527.2221 -> -5.20112175E+11 Inexact Rounded +xpow120 power 14239029. -36527 -> 6.64292731E-261296 Inexact Rounded +xrem120 remainder 14239029. -36527.2221 -> 29939.6031 +xsub120 subtract 14239029. -36527.2221 -> 14275556.2 Inexact Rounded +xadd121 add 72333.2654E-544425548 -690.664836E+662155120 -> -6.90664836E+662155122 Inexact Rounded +xcom121 compare 72333.2654E-544425548 -690.664836E+662155120 -> 1 +xdiv121 divide 72333.2654E-544425548 -690.664836E+662155120 -> -0E-1000000007 Inexact Rounded Underflow Subnormal Clamped +xdvi121 divideint 72333.2654E-544425548 -690.664836E+662155120 -> -0 +xmul121 multiply 72333.2654E-544425548 -690.664836E+662155120 -> -4.99580429E+117729579 Inexact Rounded +xpow121 power 72333.2654E-544425548 -7 -> Infinity Overflow Inexact Rounded +xrem121 remainder 72333.2654E-544425548 -690.664836E+662155120 -> 7.23332654E-544425544 +xsub121 subtract 72333.2654E-544425548 -690.664836E+662155120 -> 6.90664836E+662155122 Inexact Rounded +xadd122 add -37721.1567E-115787341 -828949864E-76251747 -> -8.28949864E-76251739 Inexact Rounded +xcom122 compare -37721.1567E-115787341 -828949864E-76251747 -> 1 +xdiv122 divide -37721.1567E-115787341 -828949864E-76251747 -> 4.55047505E-39535599 Inexact Rounded +xdvi122 divideint -37721.1567E-115787341 -828949864E-76251747 -> 0 +xmul122 multiply -37721.1567E-115787341 -828949864E-76251747 -> 3.12689477E-192039075 Inexact Rounded +xpow122 power -37721.1567E-115787341 -8 -> 2.43960765E+926298691 Inexact Rounded +xrem122 remainder -37721.1567E-115787341 -828949864E-76251747 -> -3.77211567E-115787337 +xsub122 subtract -37721.1567E-115787341 -828949864E-76251747 -> 8.28949864E-76251739 Inexact Rounded +xadd123 add -2078852.83E-647080089 -119779858.E+734665461 -> -1.19779858E+734665469 Inexact Rounded +xcom123 compare -2078852.83E-647080089 -119779858.E+734665461 -> 1 +xdiv123 divide -2078852.83E-647080089 -119779858.E+734665461 -> 0E-1000000007 Inexact Rounded Underflow Subnormal Clamped +xdvi123 divideint -2078852.83E-647080089 -119779858.E+734665461 -> 0 +xmul123 multiply -2078852.83E-647080089 -119779858.E+734665461 -> 2.49004697E+87585386 Inexact Rounded +xpow123 power -2078852.83E-647080089 -1 -> -4.81034533E+647080082 Inexact Rounded +xrem123 remainder -2078852.83E-647080089 -119779858.E+734665461 -> -2.07885283E-647080083 +xsub123 subtract -2078852.83E-647080089 -119779858.E+734665461 -> 1.19779858E+734665469 Inexact Rounded +xadd124 add -79145.3625 -7718.57307 -> -86863.9356 Inexact Rounded +xcom124 compare -79145.3625 -7718.57307 -> -1 +xdiv124 divide -79145.3625 -7718.57307 -> 10.2538852 Inexact Rounded +xdvi124 divideint -79145.3625 -7718.57307 -> 10 +xmul124 multiply -79145.3625 -7718.57307 -> 610889264 Inexact Rounded +xpow124 power -79145.3625 -7719 -> -1.13181941E-37811 Inexact Rounded +xrem124 remainder -79145.3625 -7718.57307 -> -1959.63180 +xsub124 subtract -79145.3625 -7718.57307 -> -71426.7894 Inexact Rounded +xadd125 add 2103890.49E+959247237 20024.3017 -> 2.10389049E+959247243 Inexact Rounded +xcom125 compare 2103890.49E+959247237 20024.3017 -> 1 +xdiv125 divide 2103890.49E+959247237 20024.3017 -> 1.05066859E+959247239 Inexact Rounded +xdvi125 divideint 2103890.49E+959247237 20024.3017 -> NaN Division_impossible +xmul125 multiply 2103890.49E+959247237 20024.3017 -> 4.21289379E+959247247 Inexact Rounded +xpow125 power 2103890.49E+959247237 20024 -> Infinity Overflow Inexact Rounded +xrem125 remainder 2103890.49E+959247237 20024.3017 -> NaN Division_impossible +xsub125 subtract 2103890.49E+959247237 20024.3017 -> 2.10389049E+959247243 Inexact Rounded +xadd126 add 911249557 79810804.9 -> 991060362 Inexact Rounded +xcom126 compare 911249557 79810804.9 -> 1 +xdiv126 divide 911249557 79810804.9 -> 11.4176214 Inexact Rounded +xdvi126 divideint 911249557 79810804.9 -> 11 +xmul126 multiply 911249557 79810804.9 -> 7.27275606E+16 Inexact Rounded +xpow126 power 911249557 79810805 -> 6.77595741E+715075867 Inexact Rounded +xrem126 remainder 911249557 79810804.9 -> 33330703.1 +xsub126 subtract 911249557 79810804.9 -> 831438752 Inexact Rounded +xadd127 add 341134.994 3.37486292 -> 341138.369 Inexact Rounded +xcom127 compare 341134.994 3.37486292 -> 1 +xdiv127 divide 341134.994 3.37486292 -> 101081.141 Inexact Rounded +xdvi127 divideint 341134.994 3.37486292 -> 101081 +xmul127 multiply 341134.994 3.37486292 -> 1151283.84 Inexact Rounded +xpow127 power 341134.994 3 -> 3.96989314E+16 Inexact Rounded +xrem127 remainder 341134.994 3.37486292 -> 0.47518348 +xsub127 subtract 341134.994 3.37486292 -> 341131.619 Inexact Rounded +xadd128 add 244.23634 512706190E-341459836 -> 244.236340 Inexact Rounded +xcom128 compare 244.23634 512706190E-341459836 -> 1 +xdiv128 divide 244.23634 512706190E-341459836 -> 4.76367059E+341459829 Inexact Rounded +xdvi128 divideint 244.23634 512706190E-341459836 -> NaN Division_impossible +xmul128 multiply 244.23634 512706190E-341459836 -> 1.25221483E-341459825 Inexact Rounded +xpow128 power 244.23634 5 -> 8.69063312E+11 Inexact Rounded +xrem128 remainder 244.23634 512706190E-341459836 -> NaN Division_impossible +xsub128 subtract 244.23634 512706190E-341459836 -> 244.236340 Inexact Rounded +xadd129 add -9.22783849E+171585954 -99.0946800 -> -9.22783849E+171585954 Inexact Rounded +xcom129 compare -9.22783849E+171585954 -99.0946800 -> -1 +xdiv129 divide -9.22783849E+171585954 -99.0946800 -> 9.31214318E+171585952 Inexact Rounded +xdvi129 divideint -9.22783849E+171585954 -99.0946800 -> NaN Division_impossible +xmul129 multiply -9.22783849E+171585954 -99.0946800 -> 9.14429702E+171585956 Inexact Rounded +xpow129 power -9.22783849E+171585954 -99 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem129 remainder -9.22783849E+171585954 -99.0946800 -> NaN Division_impossible +xsub129 subtract -9.22783849E+171585954 -99.0946800 -> -9.22783849E+171585954 Inexact Rounded +xadd130 add 699631.893 -226.423958 -> 699405.469 Inexact Rounded +xcom130 compare 699631.893 -226.423958 -> 1 +xdiv130 divide 699631.893 -226.423958 -> -3089.91990 Inexact Rounded +xdvi130 divideint 699631.893 -226.423958 -> -3089 +xmul130 multiply 699631.893 -226.423958 -> -158413422 Inexact Rounded +xpow130 power 699631.893 -226 -> 1.14675511E-1321 Inexact Rounded +xrem130 remainder 699631.893 -226.423958 -> 208.286738 +xsub130 subtract 699631.893 -226.423958 -> 699858.317 Inexact Rounded +xadd131 add -249350139.E-571793673 775732428. -> 775732428 Inexact Rounded +xcom131 compare -249350139.E-571793673 775732428. -> -1 +xdiv131 divide -249350139.E-571793673 775732428. -> -3.21438334E-571793674 Inexact Rounded +xdvi131 divideint -249350139.E-571793673 775732428. -> -0 +xmul131 multiply -249350139.E-571793673 775732428. -> -1.93428989E-571793656 Inexact Rounded +xpow131 power -249350139.E-571793673 775732428 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem131 remainder -249350139.E-571793673 775732428. -> -2.49350139E-571793665 +xsub131 subtract -249350139.E-571793673 775732428. -> -775732428 Inexact Rounded +xadd132 add 5.11629020 -480.53194 -> -475.415650 Inexact Rounded +xcom132 compare 5.11629020 -480.53194 -> 1 +xdiv132 divide 5.11629020 -480.53194 -> -0.0106471387 Inexact Rounded +xdvi132 divideint 5.11629020 -480.53194 -> -0 +xmul132 multiply 5.11629020 -480.53194 -> -2458.54086 Inexact Rounded +xpow132 power 5.11629020 -481 -> 9.83021951E-342 Inexact Rounded +xrem132 remainder 5.11629020 -480.53194 -> 5.11629020 +xsub132 subtract 5.11629020 -480.53194 -> 485.648230 Inexact Rounded +xadd133 add -8.23352673E-446723147 -530710.866 -> -530710.866 Inexact Rounded +xcom133 compare -8.23352673E-446723147 -530710.866 -> 1 +xdiv133 divide -8.23352673E-446723147 -530710.866 -> 1.55141476E-446723152 Inexact Rounded +xdvi133 divideint -8.23352673E-446723147 -530710.866 -> 0 +xmul133 multiply -8.23352673E-446723147 -530710.866 -> 4.36962210E-446723141 Inexact Rounded +xpow133 power -8.23352673E-446723147 -530711 -> -Infinity Overflow Inexact Rounded +xrem133 remainder -8.23352673E-446723147 -530710.866 -> -8.23352673E-446723147 +xsub133 subtract -8.23352673E-446723147 -530710.866 -> 530710.866 Inexact Rounded +xadd134 add 7.0598608 -95908.35 -> -95901.2901 Inexact Rounded +xcom134 compare 7.0598608 -95908.35 -> 1 +xdiv134 divide 7.0598608 -95908.35 -> -0.0000736104917 Inexact Rounded +xdvi134 divideint 7.0598608 -95908.35 -> -0 +xmul134 multiply 7.0598608 -95908.35 -> -677099.601 Inexact Rounded +xpow134 power 7.0598608 -95908 -> 4.57073877E-81407 Inexact Rounded +xrem134 remainder 7.0598608 -95908.35 -> 7.0598608 +xsub134 subtract 7.0598608 -95908.35 -> 95915.4099 Inexact Rounded +xadd135 add -7.91189845E+207202706 1532.71847E+509944335 -> 1.53271847E+509944338 Inexact Rounded +xcom135 compare -7.91189845E+207202706 1532.71847E+509944335 -> -1 +xdiv135 divide -7.91189845E+207202706 1532.71847E+509944335 -> -5.16200372E-302741632 Inexact Rounded +xdvi135 divideint -7.91189845E+207202706 1532.71847E+509944335 -> -0 +xmul135 multiply -7.91189845E+207202706 1532.71847E+509944335 -> -1.21267129E+717147045 Inexact Rounded +xpow135 power -7.91189845E+207202706 2 -> 6.25981371E+414405413 Inexact Rounded +xrem135 remainder -7.91189845E+207202706 1532.71847E+509944335 -> -7.91189845E+207202706 +xsub135 subtract -7.91189845E+207202706 1532.71847E+509944335 -> -1.53271847E+509944338 Inexact Rounded +xadd136 add 208839370.E-215147432 -75.9420559 -> -75.9420559 Inexact Rounded +xcom136 compare 208839370.E-215147432 -75.9420559 -> 1 +xdiv136 divide 208839370.E-215147432 -75.9420559 -> -2.74998310E-215147426 Inexact Rounded +xdvi136 divideint 208839370.E-215147432 -75.9420559 -> -0 +xmul136 multiply 208839370.E-215147432 -75.9420559 -> -1.58596911E-215147422 Inexact Rounded +xpow136 power 208839370.E-215147432 -76 -> Infinity Overflow Inexact Rounded +xrem136 remainder 208839370.E-215147432 -75.9420559 -> 2.08839370E-215147424 +xsub136 subtract 208839370.E-215147432 -75.9420559 -> 75.9420559 Inexact Rounded +xadd137 add 427.754244E-353328369 4705.0796 -> 4705.07960 Inexact Rounded +xcom137 compare 427.754244E-353328369 4705.0796 -> -1 +xdiv137 divide 427.754244E-353328369 4705.0796 -> 9.09132853E-353328371 Inexact Rounded +xdvi137 divideint 427.754244E-353328369 4705.0796 -> 0 +xmul137 multiply 427.754244E-353328369 4705.0796 -> 2.01261777E-353328363 Inexact Rounded +xpow137 power 427.754244E-353328369 4705 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem137 remainder 427.754244E-353328369 4705.0796 -> 4.27754244E-353328367 +xsub137 subtract 427.754244E-353328369 4705.0796 -> -4705.07960 Inexact Rounded +xadd138 add 44911.089 -95.1733605E-313081848 -> 44911.0890 Inexact Rounded +xcom138 compare 44911.089 -95.1733605E-313081848 -> 1 +xdiv138 divide 44911.089 -95.1733605E-313081848 -> -4.71887183E+313081850 Inexact Rounded +xdvi138 divideint 44911.089 -95.1733605E-313081848 -> NaN Division_impossible +xmul138 multiply 44911.089 -95.1733605E-313081848 -> -4.27433926E-313081842 Inexact Rounded +xpow138 power 44911.089 -10 -> 2.99546425E-47 Inexact Rounded +xrem138 remainder 44911.089 -95.1733605E-313081848 -> NaN Division_impossible +xsub138 subtract 44911.089 -95.1733605E-313081848 -> 44911.0890 Inexact Rounded +xadd139 add 452371821. -4109709.19 -> 448262112 Inexact Rounded +xcom139 compare 452371821. -4109709.19 -> 1 +xdiv139 divide 452371821. -4109709.19 -> -110.073925 Inexact Rounded +xdvi139 divideint 452371821. -4109709.19 -> -110 +xmul139 multiply 452371821. -4109709.19 -> -1.85911663E+15 Inexact Rounded +xpow139 power 452371821. -4109709 -> 1.15528807E-35571568 Inexact Rounded +xrem139 remainder 452371821. -4109709.19 -> 303810.10 +xsub139 subtract 452371821. -4109709.19 -> 456481530 Inexact Rounded +xadd140 add 94007.4392 -9467725.5E+681898234 -> -9.46772550E+681898240 Inexact Rounded +xcom140 compare 94007.4392 -9467725.5E+681898234 -> 1 +xdiv140 divide 94007.4392 -9467725.5E+681898234 -> -9.92925272E-681898237 Inexact Rounded +xdvi140 divideint 94007.4392 -9467725.5E+681898234 -> -0 +xmul140 multiply 94007.4392 -9467725.5E+681898234 -> -8.90036629E+681898245 Inexact Rounded +xpow140 power 94007.4392 -9 -> 1.74397397E-45 Inexact Rounded +xrem140 remainder 94007.4392 -9467725.5E+681898234 -> 94007.4392 +xsub140 subtract 94007.4392 -9467725.5E+681898234 -> 9.46772550E+681898240 Inexact Rounded +xadd141 add 99147554.0E-751410586 38313.6423 -> 38313.6423 Inexact Rounded +xcom141 compare 99147554.0E-751410586 38313.6423 -> -1 +xdiv141 divide 99147554.0E-751410586 38313.6423 -> 2.58778722E-751410583 Inexact Rounded +xdvi141 divideint 99147554.0E-751410586 38313.6423 -> 0 +xmul141 multiply 99147554.0E-751410586 38313.6423 -> 3.79870392E-751410574 Inexact Rounded +xpow141 power 99147554.0E-751410586 38314 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem141 remainder 99147554.0E-751410586 38313.6423 -> 9.91475540E-751410579 +xsub141 subtract 99147554.0E-751410586 38313.6423 -> -38313.6423 Inexact Rounded +xadd142 add -7919.30254 -669.607854 -> -8588.91039 Inexact Rounded +xcom142 compare -7919.30254 -669.607854 -> -1 +xdiv142 divide -7919.30254 -669.607854 -> 11.8267767 Inexact Rounded +xdvi142 divideint -7919.30254 -669.607854 -> 11 +xmul142 multiply -7919.30254 -669.607854 -> 5302827.18 Inexact Rounded +xpow142 power -7919.30254 -670 -> 7.58147724E-2613 Inexact Rounded +xrem142 remainder -7919.30254 -669.607854 -> -553.616146 +xsub142 subtract -7919.30254 -669.607854 -> -7249.69469 Inexact Rounded +xadd143 add 461.58280E+136110821 710666052.E-383754231 -> 4.61582800E+136110823 Inexact Rounded +xcom143 compare 461.58280E+136110821 710666052.E-383754231 -> 1 +xdiv143 divide 461.58280E+136110821 710666052.E-383754231 -> 6.49507316E+519865045 Inexact Rounded +xdvi143 divideint 461.58280E+136110821 710666052.E-383754231 -> NaN Division_impossible +xmul143 multiply 461.58280E+136110821 710666052.E-383754231 -> 3.28031226E-247643399 Inexact Rounded +xpow143 power 461.58280E+136110821 7 -> 4.46423781E+952775765 Inexact Rounded +xrem143 remainder 461.58280E+136110821 710666052.E-383754231 -> NaN Division_impossible +xsub143 subtract 461.58280E+136110821 710666052.E-383754231 -> 4.61582800E+136110823 Inexact Rounded +xadd144 add 3455755.47E-112465506 771.674306 -> 771.674306 Inexact Rounded +xcom144 compare 3455755.47E-112465506 771.674306 -> -1 +xdiv144 divide 3455755.47E-112465506 771.674306 -> 4.47825649E-112465503 Inexact Rounded +xdvi144 divideint 3455755.47E-112465506 771.674306 -> 0 +xmul144 multiply 3455755.47E-112465506 771.674306 -> 2.66671770E-112465497 Inexact Rounded +xpow144 power 3455755.47E-112465506 772 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem144 remainder 3455755.47E-112465506 771.674306 -> 3.45575547E-112465500 +xsub144 subtract 3455755.47E-112465506 771.674306 -> -771.674306 Inexact Rounded +xadd145 add -477067757.E-961684940 7.70122608E-741072245 -> 7.70122608E-741072245 Inexact Rounded +xcom145 compare -477067757.E-961684940 7.70122608E-741072245 -> -1 +xdiv145 divide -477067757.E-961684940 7.70122608E-741072245 -> -6.19469877E-220612688 Inexact Rounded +xdvi145 divideint -477067757.E-961684940 7.70122608E-741072245 -> -0 +xmul145 multiply -477067757.E-961684940 7.70122608E-741072245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow145 power -477067757.E-961684940 8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem145 remainder -477067757.E-961684940 7.70122608E-741072245 -> -4.77067757E-961684932 +xsub145 subtract -477067757.E-961684940 7.70122608E-741072245 -> -7.70122608E-741072245 Inexact Rounded +xadd146 add 76482.352 8237806.8 -> 8314289.15 Inexact Rounded +xcom146 compare 76482.352 8237806.8 -> -1 +xdiv146 divide 76482.352 8237806.8 -> 0.00928430999 Inexact Rounded +xdvi146 divideint 76482.352 8237806.8 -> 0 +xmul146 multiply 76482.352 8237806.8 -> 6.30046839E+11 Inexact Rounded +xpow146 power 76482.352 8237807 -> 8.44216559E+40229834 Inexact Rounded +xrem146 remainder 76482.352 8237806.8 -> 76482.352 +xsub146 subtract 76482.352 8237806.8 -> -8161324.45 Inexact Rounded +xadd147 add 1.21505164E-565556504 9.26146573 -> 9.26146573 Inexact Rounded +xcom147 compare 1.21505164E-565556504 9.26146573 -> -1 +xdiv147 divide 1.21505164E-565556504 9.26146573 -> 1.31194314E-565556505 Inexact Rounded +xdvi147 divideint 1.21505164E-565556504 9.26146573 -> 0 +xmul147 multiply 1.21505164E-565556504 9.26146573 -> 1.12531591E-565556503 Inexact Rounded +xpow147 power 1.21505164E-565556504 9 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem147 remainder 1.21505164E-565556504 9.26146573 -> 1.21505164E-565556504 +xsub147 subtract 1.21505164E-565556504 9.26146573 -> -9.26146573 Inexact Rounded +xadd148 add -8303060.25E-169894883 901561.985 -> 901561.985 Inexact Rounded +xcom148 compare -8303060.25E-169894883 901561.985 -> -1 +xdiv148 divide -8303060.25E-169894883 901561.985 -> -9.20963881E-169894883 Inexact Rounded +xdvi148 divideint -8303060.25E-169894883 901561.985 -> -0 +xmul148 multiply -8303060.25E-169894883 901561.985 -> -7.48572348E-169894871 Inexact Rounded +xpow148 power -8303060.25E-169894883 901562 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem148 remainder -8303060.25E-169894883 901561.985 -> -8.30306025E-169894877 +xsub148 subtract -8303060.25E-169894883 901561.985 -> -901561.985 Inexact Rounded +xadd149 add -592464.92 71445510.7 -> 70853045.8 Inexact Rounded +xcom149 compare -592464.92 71445510.7 -> -1 +xdiv149 divide -592464.92 71445510.7 -> -0.00829254231 Inexact Rounded +xdvi149 divideint -592464.92 71445510.7 -> -0 +xmul149 multiply -592464.92 71445510.7 -> -4.23289588E+13 Inexact Rounded +xpow149 power -592464.92 71445511 -> -1.58269108E+412430832 Inexact Rounded +xrem149 remainder -592464.92 71445510.7 -> -592464.92 +xsub149 subtract -592464.92 71445510.7 -> -72037975.6 Inexact Rounded +xadd150 add -73774.4165 -39.8243027 -> -73814.2408 Inexact Rounded +xcom150 compare -73774.4165 -39.8243027 -> -1 +xdiv150 divide -73774.4165 -39.8243027 -> 1852.49738 Inexact Rounded +xdvi150 divideint -73774.4165 -39.8243027 -> 1852 +xmul150 multiply -73774.4165 -39.8243027 -> 2938014.69 Inexact Rounded +xpow150 power -73774.4165 -40 -> 1.92206765E-195 Inexact Rounded +xrem150 remainder -73774.4165 -39.8243027 -> -19.8078996 +xsub150 subtract -73774.4165 -39.8243027 -> -73734.5922 Inexact Rounded +xadd151 add -524724715. -55763.7937 -> -524780479 Inexact Rounded +xcom151 compare -524724715. -55763.7937 -> -1 +xdiv151 divide -524724715. -55763.7937 -> 9409.77434 Inexact Rounded +xdvi151 divideint -524724715. -55763.7937 -> 9409 +xmul151 multiply -524724715. -55763.7937 -> 2.92606408E+13 Inexact Rounded +xpow151 power -524724715. -55764 -> 5.47898351E-486259 Inexact Rounded +xrem151 remainder -524724715. -55763.7937 -> -43180.0767 +xsub151 subtract -524724715. -55763.7937 -> -524668951 Inexact Rounded +xadd152 add 7.53800427 784873768E-9981146 -> 7.53800427 Inexact Rounded +xcom152 compare 7.53800427 784873768E-9981146 -> 1 +xdiv152 divide 7.53800427 784873768E-9981146 -> 9.60409760E+9981137 Inexact Rounded +xdvi152 divideint 7.53800427 784873768E-9981146 -> NaN Division_impossible +xmul152 multiply 7.53800427 784873768E-9981146 -> 5.91638181E-9981137 Inexact Rounded +xpow152 power 7.53800427 8 -> 10424399.2 Inexact Rounded +xrem152 remainder 7.53800427 784873768E-9981146 -> NaN Division_impossible +xsub152 subtract 7.53800427 784873768E-9981146 -> 7.53800427 Inexact Rounded +xadd153 add 37.6027452 7.22454233 -> 44.8272875 Inexact Rounded +xcom153 compare 37.6027452 7.22454233 -> 1 +xdiv153 divide 37.6027452 7.22454233 -> 5.20486191 Inexact Rounded +xdvi153 divideint 37.6027452 7.22454233 -> 5 +xmul153 multiply 37.6027452 7.22454233 -> 271.662624 Inexact Rounded +xpow153 power 37.6027452 7 -> 1.06300881E+11 Inexact Rounded +xrem153 remainder 37.6027452 7.22454233 -> 1.48003355 +xsub153 subtract 37.6027452 7.22454233 -> 30.3782029 Inexact Rounded +xadd154 add 2447660.39 -36981.4253 -> 2410678.96 Inexact Rounded +xcom154 compare 2447660.39 -36981.4253 -> 1 +xdiv154 divide 2447660.39 -36981.4253 -> -66.1862102 Inexact Rounded +xdvi154 divideint 2447660.39 -36981.4253 -> -66 +xmul154 multiply 2447660.39 -36981.4253 -> -9.05179699E+10 Inexact Rounded +xpow154 power 2447660.39 -36981 -> 3.92066064E-236263 Inexact Rounded +xrem154 remainder 2447660.39 -36981.4253 -> 6886.3202 +xsub154 subtract 2447660.39 -36981.4253 -> 2484641.82 Inexact Rounded +xadd155 add 2160.36419 1418.33574E+656265382 -> 1.41833574E+656265385 Inexact Rounded +xcom155 compare 2160.36419 1418.33574E+656265382 -> -1 +xdiv155 divide 2160.36419 1418.33574E+656265382 -> 1.52316841E-656265382 Inexact Rounded +xdvi155 divideint 2160.36419 1418.33574E+656265382 -> 0 +xmul155 multiply 2160.36419 1418.33574E+656265382 -> 3.06412174E+656265388 Inexact Rounded +xpow155 power 2160.36419 1 -> 2160.36419 +xrem155 remainder 2160.36419 1418.33574E+656265382 -> 2160.36419 +xsub155 subtract 2160.36419 1418.33574E+656265382 -> -1.41833574E+656265385 Inexact Rounded +xadd156 add 8926.44939 54.9430027 -> 8981.39239 Inexact Rounded +xcom156 compare 8926.44939 54.9430027 -> 1 +xdiv156 divide 8926.44939 54.9430027 -> 162.467447 Inexact Rounded +xdvi156 divideint 8926.44939 54.9430027 -> 162 +xmul156 multiply 8926.44939 54.9430027 -> 490445.933 Inexact Rounded +xpow156 power 8926.44939 55 -> 1.93789877E+217 Inexact Rounded +xrem156 remainder 8926.44939 54.9430027 -> 25.6829526 +xsub156 subtract 8926.44939 54.9430027 -> 8871.50639 Inexact Rounded +xadd157 add 861588029 -41657398E+77955925 -> -4.16573980E+77955932 Inexact Rounded +xcom157 compare 861588029 -41657398E+77955925 -> 1 +xdiv157 divide 861588029 -41657398E+77955925 -> -2.06827135E-77955924 Inexact Rounded +xdvi157 divideint 861588029 -41657398E+77955925 -> -0 +xmul157 multiply 861588029 -41657398E+77955925 -> -3.58915154E+77955941 Inexact Rounded +xpow157 power 861588029 -4 -> 1.81468553E-36 Inexact Rounded +xrem157 remainder 861588029 -41657398E+77955925 -> 861588029 +xsub157 subtract 861588029 -41657398E+77955925 -> 4.16573980E+77955932 Inexact Rounded +xadd158 add -34.5253062 52.6722019 -> 18.1468957 +xcom158 compare -34.5253062 52.6722019 -> -1 +xdiv158 divide -34.5253062 52.6722019 -> -0.655474899 Inexact Rounded +xdvi158 divideint -34.5253062 52.6722019 -> -0 +xmul158 multiply -34.5253062 52.6722019 -> -1818.52390 Inexact Rounded +xpow158 power -34.5253062 53 -> -3.32115821E+81 Inexact Rounded +xrem158 remainder -34.5253062 52.6722019 -> -34.5253062 +xsub158 subtract -34.5253062 52.6722019 -> -87.1975081 +xadd159 add -18861647. 99794586.7 -> 80932939.7 +xcom159 compare -18861647. 99794586.7 -> -1 +xdiv159 divide -18861647. 99794586.7 -> -0.189004711 Inexact Rounded +xdvi159 divideint -18861647. 99794586.7 -> -0 +xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded +xpow159 power -18861647. 99794587 -> -4.28957459E+726063462 Inexact Rounded +xrem159 remainder -18861647. 99794586.7 -> -18861647.0 +xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded +xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded +xcom160 compare 322192.407 461.67044 -> 1 +xdiv160 divide 322192.407 461.67044 -> 697.883986 Inexact Rounded +xdvi160 divideint 322192.407 461.67044 -> 697 +xmul160 multiply 322192.407 461.67044 -> 148746710 Inexact Rounded +xpow160 power 322192.407 462 -> 5.61395873E+2544 Inexact Rounded +xrem160 remainder 322192.407 461.67044 -> 408.11032 +xsub160 subtract 322192.407 461.67044 -> 321730.737 Inexact Rounded +xadd161 add -896298518E+61412314 78873.8049 -> -8.96298518E+61412322 Inexact Rounded +xcom161 compare -896298518E+61412314 78873.8049 -> -1 +xdiv161 divide -896298518E+61412314 78873.8049 -> -1.13637033E+61412318 Inexact Rounded +xdvi161 divideint -896298518E+61412314 78873.8049 -> NaN Division_impossible +xmul161 multiply -896298518E+61412314 78873.8049 -> -7.06944744E+61412327 Inexact Rounded +xpow161 power -896298518E+61412314 78874 -> Infinity Overflow Inexact Rounded +xrem161 remainder -896298518E+61412314 78873.8049 -> NaN Division_impossible +xsub161 subtract -896298518E+61412314 78873.8049 -> -8.96298518E+61412322 Inexact Rounded +xadd162 add 293.773732 479899052E+789950177 -> 4.79899052E+789950185 Inexact Rounded +xcom162 compare 293.773732 479899052E+789950177 -> -1 +xdiv162 divide 293.773732 479899052E+789950177 -> 6.12157350E-789950184 Inexact Rounded +xdvi162 divideint 293.773732 479899052E+789950177 -> 0 +xmul162 multiply 293.773732 479899052E+789950177 -> 1.40981735E+789950188 Inexact Rounded +xpow162 power 293.773732 5 -> 2.18808809E+12 Inexact Rounded +xrem162 remainder 293.773732 479899052E+789950177 -> 293.773732 +xsub162 subtract 293.773732 479899052E+789950177 -> -4.79899052E+789950185 Inexact Rounded +xadd163 add -103519362 51897955.3 -> -51621406.7 +xcom163 compare -103519362 51897955.3 -> -1 +xdiv163 divide -103519362 51897955.3 -> -1.99467130 Inexact Rounded +xdvi163 divideint -103519362 51897955.3 -> -1 +xmul163 multiply -103519362 51897955.3 -> -5.37244322E+15 Inexact Rounded +xpow163 power -103519362 51897955 -> -4.28858229E+415963229 Inexact Rounded +xrem163 remainder -103519362 51897955.3 -> -51621406.7 +xsub163 subtract -103519362 51897955.3 -> -155417317 Inexact Rounded +xadd164 add 37380.7802 -277719788. -> -277682407 Inexact Rounded +xcom164 compare 37380.7802 -277719788. -> 1 +xdiv164 divide 37380.7802 -277719788. -> -0.000134598908 Inexact Rounded +xdvi164 divideint 37380.7802 -277719788. -> -0 +xmul164 multiply 37380.7802 -277719788. -> -1.03813824E+13 Inexact Rounded +xpow164 power 37380.7802 -277719788 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem164 remainder 37380.7802 -277719788. -> 37380.7802 +xsub164 subtract 37380.7802 -277719788. -> 277757169 Inexact Rounded +xadd165 add 320133844. -977517477 -> -657383633 +xcom165 compare 320133844. -977517477 -> 1 +xdiv165 divide 320133844. -977517477 -> -0.327496798 Inexact Rounded +xdvi165 divideint 320133844. -977517477 -> -0 +xmul165 multiply 320133844. -977517477 -> -3.12936427E+17 Inexact Rounded +xpow165 power 320133844. -977517477 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem165 remainder 320133844. -977517477 -> 320133844 +xsub165 subtract 320133844. -977517477 -> 1.29765132E+9 Inexact Rounded +xadd166 add 721776701E+933646161 -5689279.64E+669903645 -> 7.21776701E+933646169 Inexact Rounded +xcom166 compare 721776701E+933646161 -5689279.64E+669903645 -> 1 +xdiv166 divide 721776701E+933646161 -5689279.64E+669903645 -> -1.26866097E+263742518 Inexact Rounded +xdvi166 divideint 721776701E+933646161 -5689279.64E+669903645 -> NaN Division_impossible +xmul166 multiply 721776701E+933646161 -5689279.64E+669903645 -> -Infinity Inexact Overflow Rounded +xpow166 power 721776701E+933646161 -6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem166 remainder 721776701E+933646161 -5689279.64E+669903645 -> NaN Division_impossible +xsub166 subtract 721776701E+933646161 -5689279.64E+669903645 -> 7.21776701E+933646169 Inexact Rounded +xadd167 add -5409.00482 -2.16149386 -> -5411.16631 Inexact Rounded +xcom167 compare -5409.00482 -2.16149386 -> -1 +xdiv167 divide -5409.00482 -2.16149386 -> 2502.43821 Inexact Rounded +xdvi167 divideint -5409.00482 -2.16149386 -> 2502 +xmul167 multiply -5409.00482 -2.16149386 -> 11691.5307 Inexact Rounded +xpow167 power -5409.00482 -2 -> 3.41794652E-8 Inexact Rounded +xrem167 remainder -5409.00482 -2.16149386 -> -0.94718228 +xsub167 subtract -5409.00482 -2.16149386 -> -5406.84333 Inexact Rounded +xadd168 add -957960.367 322.858170 -> -957637.509 Inexact Rounded +xcom168 compare -957960.367 322.858170 -> -1 +xdiv168 divide -957960.367 322.858170 -> -2967.12444 Inexact Rounded +xdvi168 divideint -957960.367 322.858170 -> -2967 +xmul168 multiply -957960.367 322.858170 -> -309285331 Inexact Rounded +xpow168 power -957960.367 323 -> -9.44617460E+1931 Inexact Rounded +xrem168 remainder -957960.367 322.858170 -> -40.176610 +xsub168 subtract -957960.367 322.858170 -> -958283.225 Inexact Rounded +xadd169 add -11817.8754E+613893442 -3.84735082E+888333249 -> -3.84735082E+888333249 Inexact Rounded +xcom169 compare -11817.8754E+613893442 -3.84735082E+888333249 -> 1 +xdiv169 divide -11817.8754E+613893442 -3.84735082E+888333249 -> 3.07169165E-274439804 Inexact Rounded +xdvi169 divideint -11817.8754E+613893442 -3.84735082E+888333249 -> 0 +xmul169 multiply -11817.8754E+613893442 -3.84735082E+888333249 -> Infinity Inexact Overflow Rounded +xpow169 power -11817.8754E+613893442 -4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem169 remainder -11817.8754E+613893442 -3.84735082E+888333249 -> -1.18178754E+613893446 +xsub169 subtract -11817.8754E+613893442 -3.84735082E+888333249 -> 3.84735082E+888333249 Inexact Rounded +xadd170 add 840258203 58363.980E-906584723 -> 840258203 Inexact Rounded +xcom170 compare 840258203 58363.980E-906584723 -> 1 +xdiv170 divide 840258203 58363.980E-906584723 -> 1.43968626E+906584727 Inexact Rounded +xdvi170 divideint 840258203 58363.980E-906584723 -> NaN Division_impossible +xmul170 multiply 840258203 58363.980E-906584723 -> 4.90408130E-906584710 Inexact Rounded +xpow170 power 840258203 6 -> 3.51946431E+53 Inexact Rounded +xrem170 remainder 840258203 58363.980E-906584723 -> NaN Division_impossible +xsub170 subtract 840258203 58363.980E-906584723 -> 840258203 Inexact Rounded +xadd171 add -205842096. -191342.721 -> -206033439 Inexact Rounded +xcom171 compare -205842096. -191342.721 -> -1 +xdiv171 divide -205842096. -191342.721 -> 1075.77699 Inexact Rounded +xdvi171 divideint -205842096. -191342.721 -> 1075 +xmul171 multiply -205842096. -191342.721 -> 3.93863867E+13 Inexact Rounded +xpow171 power -205842096. -191343 -> -2.66955553E-1590737 Inexact Rounded +xrem171 remainder -205842096. -191342.721 -> -148670.925 +xsub171 subtract -205842096. -191342.721 -> -205650753 Inexact Rounded +xadd172 add 42501124. 884.938498E+123341480 -> 8.84938498E+123341482 Inexact Rounded +xcom172 compare 42501124. 884.938498E+123341480 -> -1 +xdiv172 divide 42501124. 884.938498E+123341480 -> 4.80272065E-123341476 Inexact Rounded +xdvi172 divideint 42501124. 884.938498E+123341480 -> 0 +xmul172 multiply 42501124. 884.938498E+123341480 -> 3.76108808E+123341490 Inexact Rounded +xpow172 power 42501124. 9 -> 4.52484536E+68 Inexact Rounded +xrem172 remainder 42501124. 884.938498E+123341480 -> 42501124 +xsub172 subtract 42501124. 884.938498E+123341480 -> -8.84938498E+123341482 Inexact Rounded +xadd173 add -57809452. -620380746 -> -678190198 +xcom173 compare -57809452. -620380746 -> 1 +xdiv173 divide -57809452. -620380746 -> 0.0931838268 Inexact Rounded +xdvi173 divideint -57809452. -620380746 -> 0 +xmul173 multiply -57809452. -620380746 -> 3.58638710E+16 Inexact Rounded +xpow173 power -57809452. -620380746 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem173 remainder -57809452. -620380746 -> -57809452 +xsub173 subtract -57809452. -620380746 -> 562571294 +xadd174 add -8022370.31 9858581.6 -> 1836211.29 +xcom174 compare -8022370.31 9858581.6 -> -1 +xdiv174 divide -8022370.31 9858581.6 -> -0.813744881 Inexact Rounded +xdvi174 divideint -8022370.31 9858581.6 -> -0 +xmul174 multiply -8022370.31 9858581.6 -> -7.90891923E+13 Inexact Rounded +xpow174 power -8022370.31 9858582 -> 2.34458249E+68066634 Inexact Rounded +xrem174 remainder -8022370.31 9858581.6 -> -8022370.31 +xsub174 subtract -8022370.31 9858581.6 -> -17880951.9 Inexact Rounded +xadd175 add 2.49065060E+592139141 -5432.72014E-419965357 -> 2.49065060E+592139141 Inexact Rounded +xcom175 compare 2.49065060E+592139141 -5432.72014E-419965357 -> 1 +xdiv175 divide 2.49065060E+592139141 -5432.72014E-419965357 -> -Infinity Inexact Overflow Rounded +xdvi175 divideint 2.49065060E+592139141 -5432.72014E-419965357 -> NaN Division_impossible +xmul175 multiply 2.49065060E+592139141 -5432.72014E-419965357 -> -1.35310077E+172173788 Inexact Rounded +xpow175 power 2.49065060E+592139141 -5 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem175 remainder 2.49065060E+592139141 -5432.72014E-419965357 -> NaN Division_impossible +xsub175 subtract 2.49065060E+592139141 -5432.72014E-419965357 -> 2.49065060E+592139141 Inexact Rounded +xadd176 add -697273715E-242824870 -3.81757506 -> -3.81757506 Inexact Rounded +xcom176 compare -697273715E-242824870 -3.81757506 -> 1 +xdiv176 divide -697273715E-242824870 -3.81757506 -> 1.82648331E-242824862 Inexact Rounded +xdvi176 divideint -697273715E-242824870 -3.81757506 -> 0 +xmul176 multiply -697273715E-242824870 -3.81757506 -> 2.66189474E-242824861 Inexact Rounded +xpow176 power -697273715E-242824870 -4 -> 4.23045251E+971299444 Inexact Rounded +xrem176 remainder -697273715E-242824870 -3.81757506 -> -6.97273715E-242824862 +xsub176 subtract -697273715E-242824870 -3.81757506 -> 3.81757506 Inexact Rounded +xadd177 add -7.42204403E-315716280 -8156111.67E+283261636 -> -8.15611167E+283261642 Inexact Rounded +xcom177 compare -7.42204403E-315716280 -8156111.67E+283261636 -> 1 +xdiv177 divide -7.42204403E-315716280 -8156111.67E+283261636 -> 9.09997843E-598977923 Inexact Rounded +xdvi177 divideint -7.42204403E-315716280 -8156111.67E+283261636 -> 0 +xmul177 multiply -7.42204403E-315716280 -8156111.67E+283261636 -> 6.05350199E-32454637 Inexact Rounded +xpow177 power -7.42204403E-315716280 -8 -> Infinity Overflow Inexact Rounded +xrem177 remainder -7.42204403E-315716280 -8156111.67E+283261636 -> -7.42204403E-315716280 +xsub177 subtract -7.42204403E-315716280 -8156111.67E+283261636 -> 8.15611167E+283261642 Inexact Rounded +xadd178 add 738063892 89900467.8 -> 827964360 Inexact Rounded +xcom178 compare 738063892 89900467.8 -> 1 +xdiv178 divide 738063892 89900467.8 -> 8.20978923 Inexact Rounded +xdvi178 divideint 738063892 89900467.8 -> 8 +xmul178 multiply 738063892 89900467.8 -> 6.63522892E+16 Inexact Rounded +xpow178 power 738063892 89900468 -> 1.53166723E+797245797 Inexact Rounded +xrem178 remainder 738063892 89900467.8 -> 18860149.6 +xsub178 subtract 738063892 89900467.8 -> 648163424 Inexact Rounded +xadd179 add -630309366 -884783.338E-21595410 -> -630309366 Inexact Rounded +xcom179 compare -630309366 -884783.338E-21595410 -> -1 +xdiv179 divide -630309366 -884783.338E-21595410 -> 7.12388377E+21595412 Inexact Rounded +xdvi179 divideint -630309366 -884783.338E-21595410 -> NaN Division_impossible +xmul179 multiply -630309366 -884783.338E-21595410 -> 5.57687225E-21595396 Inexact Rounded +xpow179 power -630309366 -9 -> -6.36819210E-80 Inexact Rounded +xrem179 remainder -630309366 -884783.338E-21595410 -> NaN Division_impossible +xsub179 subtract -630309366 -884783.338E-21595410 -> -630309366 Inexact Rounded +xadd180 add 613.207774 -3007.78608 -> -2394.57831 Inexact Rounded +xcom180 compare 613.207774 -3007.78608 -> 1 +xdiv180 divide 613.207774 -3007.78608 -> -0.203873466 Inexact Rounded +xdvi180 divideint 613.207774 -3007.78608 -> -0 +xmul180 multiply 613.207774 -3007.78608 -> -1844397.81 Inexact Rounded +xpow180 power 613.207774 -3008 -> 7.51939160E-8386 Inexact Rounded +xrem180 remainder 613.207774 -3007.78608 -> 613.207774 +xsub180 subtract 613.207774 -3007.78608 -> 3620.99385 Inexact Rounded +xadd181 add -93006222.3 -3.08964619 -> -93006225.4 Inexact Rounded +xcom181 compare -93006222.3 -3.08964619 -> -1 +xdiv181 divide -93006222.3 -3.08964619 -> 30102547.9 Inexact Rounded +xdvi181 divideint -93006222.3 -3.08964619 -> 30102547 +xmul181 multiply -93006222.3 -3.08964619 -> 287356320 Inexact Rounded +xpow181 power -93006222.3 -3 -> -1.24297956E-24 Inexact Rounded +xrem181 remainder -93006222.3 -3.08964619 -> -2.65215407 +xsub181 subtract -93006222.3 -3.08964619 -> -93006219.2 Inexact Rounded +xadd182 add -18116.0621 34096.306E-270347092 -> -18116.0621 Inexact Rounded +xcom182 compare -18116.0621 34096.306E-270347092 -> -1 +xdiv182 divide -18116.0621 34096.306E-270347092 -> -5.31320375E+270347091 Inexact Rounded +xdvi182 divideint -18116.0621 34096.306E-270347092 -> NaN Division_impossible +xmul182 multiply -18116.0621 34096.306E-270347092 -> -6.17690797E-270347084 Inexact Rounded +xpow182 power -18116.0621 3 -> -5.94554133E+12 Inexact Rounded +xrem182 remainder -18116.0621 34096.306E-270347092 -> NaN Division_impossible +xsub182 subtract -18116.0621 34096.306E-270347092 -> -18116.0621 Inexact Rounded +xadd183 add 19272386.9 -410442379. -> -391169992 Inexact Rounded +xcom183 compare 19272386.9 -410442379. -> 1 +xdiv183 divide 19272386.9 -410442379. -> -0.0469551584 Inexact Rounded +xdvi183 divideint 19272386.9 -410442379. -> -0 +xmul183 multiply 19272386.9 -410442379. -> -7.91020433E+15 Inexact Rounded +xpow183 power 19272386.9 -410442379 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem183 remainder 19272386.9 -410442379. -> 19272386.9 +xsub183 subtract 19272386.9 -410442379. -> 429714766 Inexact Rounded +xadd184 add 4180.30821 -1.6439543E-624759104 -> 4180.30821 Inexact Rounded +xcom184 compare 4180.30821 -1.6439543E-624759104 -> 1 +xdiv184 divide 4180.30821 -1.6439543E-624759104 -> -2.54283724E+624759107 Inexact Rounded +xdvi184 divideint 4180.30821 -1.6439543E-624759104 -> NaN Division_impossible +xmul184 multiply 4180.30821 -1.6439543E-624759104 -> -6.87223566E-624759101 Inexact Rounded +xpow184 power 4180.30821 -2 -> 5.72246828E-8 Inexact Rounded +xrem184 remainder 4180.30821 -1.6439543E-624759104 -> NaN Division_impossible +xsub184 subtract 4180.30821 -1.6439543E-624759104 -> 4180.30821 Inexact Rounded +xadd185 add 571.536725 389.899220 -> 961.435945 +xcom185 compare 571.536725 389.899220 -> 1 +xdiv185 divide 571.536725 389.899220 -> 1.46585757 Inexact Rounded +xdvi185 divideint 571.536725 389.899220 -> 1 +xmul185 multiply 571.536725 389.899220 -> 222841.723 Inexact Rounded +xpow185 power 571.536725 390 -> 1.76691373E+1075 Inexact Rounded +xrem185 remainder 571.536725 389.899220 -> 181.637505 +xsub185 subtract 571.536725 389.899220 -> 181.637505 +xadd186 add -622007306.E+159924886 -126.971745 -> -6.22007306E+159924894 Inexact Rounded +xcom186 compare -622007306.E+159924886 -126.971745 -> -1 +xdiv186 divide -622007306.E+159924886 -126.971745 -> 4.89878521E+159924892 Inexact Rounded +xdvi186 divideint -622007306.E+159924886 -126.971745 -> NaN Division_impossible +xmul186 multiply -622007306.E+159924886 -126.971745 -> 7.89773530E+159924896 Inexact Rounded +xpow186 power -622007306.E+159924886 -127 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem186 remainder -622007306.E+159924886 -126.971745 -> NaN Division_impossible +xsub186 subtract -622007306.E+159924886 -126.971745 -> -6.22007306E+159924894 Inexact Rounded +xadd187 add -29.356551E-282816139 37141748E-903397821 -> -2.93565510E-282816138 Inexact Rounded +xcom187 compare -29.356551E-282816139 37141748E-903397821 -> -1 +xdiv187 divide -29.356551E-282816139 37141748E-903397821 -> -7.90392283E+620581675 Inexact Rounded +xdvi187 divideint -29.356551E-282816139 37141748E-903397821 -> NaN Division_impossible +xmul187 multiply -29.356551E-282816139 37141748E-903397821 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow187 power -29.356551E-282816139 4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem187 remainder -29.356551E-282816139 37141748E-903397821 -> NaN Division_impossible +xsub187 subtract -29.356551E-282816139 37141748E-903397821 -> -2.93565510E-282816138 Inexact Rounded +xadd188 add 92427442.4 674334898. -> 766762340 Inexact Rounded +xcom188 compare 92427442.4 674334898. -> -1 +xdiv188 divide 92427442.4 674334898. -> 0.137064599 Inexact Rounded +xdvi188 divideint 92427442.4 674334898. -> 0 +xmul188 multiply 92427442.4 674334898. -> 6.23270499E+16 Inexact Rounded +xpow188 power 92427442.4 674334898 -> Infinity Overflow Inexact Rounded +xrem188 remainder 92427442.4 674334898. -> 92427442.4 +xsub188 subtract 92427442.4 674334898. -> -581907456 Inexact Rounded +xadd189 add 44651895.7 -910508.438 -> 43741387.3 Inexact Rounded +xcom189 compare 44651895.7 -910508.438 -> 1 +xdiv189 divide 44651895.7 -910508.438 -> -49.0406171 Inexact Rounded +xdvi189 divideint 44651895.7 -910508.438 -> -49 +xmul189 multiply 44651895.7 -910508.438 -> -4.06559278E+13 Inexact Rounded +xpow189 power 44651895.7 -910508 -> 3.72264277E-6965241 Inexact Rounded +xrem189 remainder 44651895.7 -910508.438 -> 36982.238 +xsub189 subtract 44651895.7 -910508.438 -> 45562404.1 Inexact Rounded +xadd190 add 647897872.E+374021790 -467.423029 -> 6.47897872E+374021798 Inexact Rounded +xcom190 compare 647897872.E+374021790 -467.423029 -> 1 +xdiv190 divide 647897872.E+374021790 -467.423029 -> -1.38610601E+374021796 Inexact Rounded +xdvi190 divideint 647897872.E+374021790 -467.423029 -> NaN Division_impossible +xmul190 multiply 647897872.E+374021790 -467.423029 -> -3.02842386E+374021801 Inexact Rounded +xpow190 power 647897872.E+374021790 -467 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem190 remainder 647897872.E+374021790 -467.423029 -> NaN Division_impossible +xsub190 subtract 647897872.E+374021790 -467.423029 -> 6.47897872E+374021798 Inexact Rounded +xadd191 add 25.2592149 59.0436981 -> 84.3029130 +xcom191 compare 25.2592149 59.0436981 -> -1 +xdiv191 divide 25.2592149 59.0436981 -> 0.427805434 Inexact Rounded +xdvi191 divideint 25.2592149 59.0436981 -> 0 +xmul191 multiply 25.2592149 59.0436981 -> 1491.39746 Inexact Rounded +xpow191 power 25.2592149 59 -> 5.53058435E+82 Inexact Rounded +xrem191 remainder 25.2592149 59.0436981 -> 25.2592149 +xsub191 subtract 25.2592149 59.0436981 -> -33.7844832 +xadd192 add -6.850835 -1273.48240 -> -1280.33324 Inexact Rounded +xcom192 compare -6.850835 -1273.48240 -> 1 +xdiv192 divide -6.850835 -1273.48240 -> 0.00537960713 Inexact Rounded +xdvi192 divideint -6.850835 -1273.48240 -> 0 +xmul192 multiply -6.850835 -1273.48240 -> 8724.41780 Inexact Rounded +xpow192 power -6.850835 -1273 -> -1.25462678E-1064 Inexact Rounded +xrem192 remainder -6.850835 -1273.48240 -> -6.850835 +xsub192 subtract -6.850835 -1273.48240 -> 1266.63157 Inexact Rounded +xadd193 add 174.272325 5638.16229 -> 5812.43462 Inexact Rounded +xcom193 compare 174.272325 5638.16229 -> -1 +xdiv193 divide 174.272325 5638.16229 -> 0.0309094198 Inexact Rounded +xdvi193 divideint 174.272325 5638.16229 -> 0 +xmul193 multiply 174.272325 5638.16229 -> 982575.651 Inexact Rounded +xpow193 power 174.272325 5638 -> 1.11137724E+12636 Inexact Rounded +xrem193 remainder 174.272325 5638.16229 -> 174.272325 +xsub193 subtract 174.272325 5638.16229 -> -5463.88997 Inexact Rounded +xadd194 add 3455629.76 -8.27332322 -> 3455621.49 Inexact Rounded +xcom194 compare 3455629.76 -8.27332322 -> 1 +xdiv194 divide 3455629.76 -8.27332322 -> -417683.399 Inexact Rounded +xdvi194 divideint 3455629.76 -8.27332322 -> -417683 +xmul194 multiply 3455629.76 -8.27332322 -> -28589541.9 Inexact Rounded +xpow194 power 3455629.76 -8 -> 4.91793015E-53 Inexact Rounded +xrem194 remainder 3455629.76 -8.27332322 -> 3.29750074 +xsub194 subtract 3455629.76 -8.27332322 -> 3455638.03 Inexact Rounded +xadd195 add -924337723E-640771235 86639377.1 -> 86639377.1 Inexact Rounded +xcom195 compare -924337723E-640771235 86639377.1 -> -1 +xdiv195 divide -924337723E-640771235 86639377.1 -> -1.06687947E-640771234 Inexact Rounded +xdvi195 divideint -924337723E-640771235 86639377.1 -> -0 +xmul195 multiply -924337723E-640771235 86639377.1 -> -8.00840446E-640771219 Inexact Rounded +xpow195 power -924337723E-640771235 86639377 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem195 remainder -924337723E-640771235 86639377.1 -> -9.24337723E-640771227 +xsub195 subtract -924337723E-640771235 86639377.1 -> -86639377.1 Inexact Rounded +xadd196 add -620236932.E+656823969 3364722.73 -> -6.20236932E+656823977 Inexact Rounded +xcom196 compare -620236932.E+656823969 3364722.73 -> -1 +xdiv196 divide -620236932.E+656823969 3364722.73 -> -1.84335228E+656823971 Inexact Rounded +xdvi196 divideint -620236932.E+656823969 3364722.73 -> NaN Division_impossible +xmul196 multiply -620236932.E+656823969 3364722.73 -> -2.08692530E+656823984 Inexact Rounded +xpow196 power -620236932.E+656823969 3364723 -> -Infinity Overflow Inexact Rounded +xrem196 remainder -620236932.E+656823969 3364722.73 -> NaN Division_impossible +xsub196 subtract -620236932.E+656823969 3364722.73 -> -6.20236932E+656823977 Inexact Rounded +xadd197 add 9.10025079 702777882E-8192234 -> 9.10025079 Inexact Rounded +xcom197 compare 9.10025079 702777882E-8192234 -> 1 +xdiv197 divide 9.10025079 702777882E-8192234 -> 1.29489715E+8192226 Inexact Rounded +xdvi197 divideint 9.10025079 702777882E-8192234 -> NaN Division_impossible +xmul197 multiply 9.10025079 702777882E-8192234 -> 6.39545498E-8192225 Inexact Rounded +xpow197 power 9.10025079 7 -> 5168607.19 Inexact Rounded +xrem197 remainder 9.10025079 702777882E-8192234 -> NaN Division_impossible +xsub197 subtract 9.10025079 702777882E-8192234 -> 9.10025079 Inexact Rounded +xadd198 add -18857539.9 813013129. -> 794155589 Inexact Rounded +xcom198 compare -18857539.9 813013129. -> -1 +xdiv198 divide -18857539.9 813013129. -> -0.0231946315 Inexact Rounded +xdvi198 divideint -18857539.9 813013129. -> -0 +xmul198 multiply -18857539.9 813013129. -> -1.53314275E+16 Inexact Rounded +xpow198 power -18857539.9 813013129 -> -Infinity Overflow Inexact Rounded +xrem198 remainder -18857539.9 813013129. -> -18857539.9 +xsub198 subtract -18857539.9 813013129. -> -831870669 Inexact Rounded +xadd199 add -8.29530327 3243419.57E+35688332 -> 3.24341957E+35688338 Inexact Rounded +xcom199 compare -8.29530327 3243419.57E+35688332 -> -1 +xdiv199 divide -8.29530327 3243419.57E+35688332 -> -2.55757946E-35688338 Inexact Rounded +xdvi199 divideint -8.29530327 3243419.57E+35688332 -> -0 +xmul199 multiply -8.29530327 3243419.57E+35688332 -> -2.69051490E+35688339 Inexact Rounded +xpow199 power -8.29530327 3 -> -570.816876 Inexact Rounded +xrem199 remainder -8.29530327 3243419.57E+35688332 -> -8.29530327 +xsub199 subtract -8.29530327 3243419.57E+35688332 -> -3.24341957E+35688338 Inexact Rounded +xadd200 add -57101683.5 763551341E+991491712 -> 7.63551341E+991491720 Inexact Rounded +xcom200 compare -57101683.5 763551341E+991491712 -> -1 +xdiv200 divide -57101683.5 763551341E+991491712 -> -7.47843405E-991491714 Inexact Rounded +xdvi200 divideint -57101683.5 763551341E+991491712 -> -0 +xmul200 multiply -57101683.5 763551341E+991491712 -> -4.36000670E+991491728 Inexact Rounded +xpow200 power -57101683.5 8 -> 1.13029368E+62 Inexact Rounded +xrem200 remainder -57101683.5 763551341E+991491712 -> -57101683.5 +xsub200 subtract -57101683.5 763551341E+991491712 -> -7.63551341E+991491720 Inexact Rounded +xadd201 add -603326.740 1710.95183 -> -601615.788 Inexact Rounded +xcom201 compare -603326.740 1710.95183 -> -1 +xdiv201 divide -603326.740 1710.95183 -> -352.626374 Inexact Rounded +xdvi201 divideint -603326.740 1710.95183 -> -352 +xmul201 multiply -603326.740 1710.95183 -> -1.03226299E+9 Inexact Rounded +xpow201 power -603326.740 1711 -> -3.35315976E+9890 Inexact Rounded +xrem201 remainder -603326.740 1710.95183 -> -1071.69584 +xsub201 subtract -603326.740 1710.95183 -> -605037.692 Inexact Rounded +xadd202 add -48142763.3 -943434114 -> -991576877 Inexact Rounded +xcom202 compare -48142763.3 -943434114 -> 1 +xdiv202 divide -48142763.3 -943434114 -> 0.0510292797 Inexact Rounded +xdvi202 divideint -48142763.3 -943434114 -> 0 +xmul202 multiply -48142763.3 -943434114 -> 4.54195252E+16 Inexact Rounded +xpow202 power -48142763.3 -943434114 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem202 remainder -48142763.3 -943434114 -> -48142763.3 +xsub202 subtract -48142763.3 -943434114 -> 895291351 Inexact Rounded +xadd203 add -204.586767 -235.531847 -> -440.118614 +xcom203 compare -204.586767 -235.531847 -> 1 +xdiv203 divide -204.586767 -235.531847 -> 0.868616154 Inexact Rounded +xdvi203 divideint -204.586767 -235.531847 -> 0 +xmul203 multiply -204.586767 -235.531847 -> 48186.6991 Inexact Rounded +xpow203 power -204.586767 -236 -> 4.29438222E-546 Inexact Rounded +xrem203 remainder -204.586767 -235.531847 -> -204.586767 +xsub203 subtract -204.586767 -235.531847 -> 30.945080 +xadd204 add -70.3805581 830137.913 -> 830067.532 Inexact Rounded +xcom204 compare -70.3805581 830137.913 -> -1 +xdiv204 divide -70.3805581 830137.913 -> -0.0000847817658 Inexact Rounded +xdvi204 divideint -70.3805581 830137.913 -> -0 +xmul204 multiply -70.3805581 830137.913 -> -58425569.6 Inexact Rounded +xpow204 power -70.3805581 830138 -> 4.95165841E+1533640 Inexact Rounded +xrem204 remainder -70.3805581 830137.913 -> -70.3805581 +xsub204 subtract -70.3805581 830137.913 -> -830208.294 Inexact Rounded +xadd205 add -8818.47606 -60766.4571 -> -69584.9332 Inexact Rounded +xcom205 compare -8818.47606 -60766.4571 -> 1 +xdiv205 divide -8818.47606 -60766.4571 -> 0.145120787 Inexact Rounded +xdvi205 divideint -8818.47606 -60766.4571 -> 0 +xmul205 multiply -8818.47606 -60766.4571 -> 535867547 Inexact Rounded +xpow205 power -8818.47606 -60766 -> 1.64487755E-239746 Inexact Rounded +xrem205 remainder -8818.47606 -60766.4571 -> -8818.47606 +xsub205 subtract -8818.47606 -60766.4571 -> 51947.9810 Inexact Rounded +xadd206 add 37060929.3E-168439509 -79576717.1 -> -79576717.1 Inexact Rounded +xcom206 compare 37060929.3E-168439509 -79576717.1 -> 1 +xdiv206 divide 37060929.3E-168439509 -79576717.1 -> -4.65725788E-168439510 Inexact Rounded +xdvi206 divideint 37060929.3E-168439509 -79576717.1 -> -0 +xmul206 multiply 37060929.3E-168439509 -79576717.1 -> -2.94918709E-168439494 Inexact Rounded +xpow206 power 37060929.3E-168439509 -79576717 -> Infinity Overflow Inexact Rounded +xrem206 remainder 37060929.3E-168439509 -79576717.1 -> 3.70609293E-168439502 +xsub206 subtract 37060929.3E-168439509 -79576717.1 -> 79576717.1 Inexact Rounded +xadd207 add -656285310. -107221462. -> -763506772 +xcom207 compare -656285310. -107221462. -> -1 +xdiv207 divide -656285310. -107221462. -> 6.12083904 Inexact Rounded +xdvi207 divideint -656285310. -107221462. -> 6 +xmul207 multiply -656285310. -107221462. -> 7.03678704E+16 Inexact Rounded +xpow207 power -656285310. -107221462 -> 8.05338080E-945381569 Inexact Rounded +xrem207 remainder -656285310. -107221462. -> -12956538 +xsub207 subtract -656285310. -107221462. -> -549063848 +xadd208 add 653397.125 7195.30990 -> 660592.435 Inexact Rounded +xcom208 compare 653397.125 7195.30990 -> 1 +xdiv208 divide 653397.125 7195.30990 -> 90.8087538 Inexact Rounded +xdvi208 divideint 653397.125 7195.30990 -> 90 +xmul208 multiply 653397.125 7195.30990 -> 4.70139480E+9 Inexact Rounded +xpow208 power 653397.125 7195 -> 1.58522983E+41840 Inexact Rounded +xrem208 remainder 653397.125 7195.30990 -> 5819.23400 +xsub208 subtract 653397.125 7195.30990 -> 646201.815 Inexact Rounded +xadd209 add 56221910.0E+857909374 -58.7247929 -> 5.62219100E+857909381 Inexact Rounded +xcom209 compare 56221910.0E+857909374 -58.7247929 -> 1 +xdiv209 divide 56221910.0E+857909374 -58.7247929 -> -9.57379451E+857909379 Inexact Rounded +xdvi209 divideint 56221910.0E+857909374 -58.7247929 -> NaN Division_impossible +xmul209 multiply 56221910.0E+857909374 -58.7247929 -> -3.30162002E+857909383 Inexact Rounded +xpow209 power 56221910.0E+857909374 -59 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem209 remainder 56221910.0E+857909374 -58.7247929 -> NaN Division_impossible +xsub209 subtract 56221910.0E+857909374 -58.7247929 -> 5.62219100E+857909381 Inexact Rounded +xadd210 add 809862859E+643769974 -5.06784016 -> 8.09862859E+643769982 Inexact Rounded +xcom210 compare 809862859E+643769974 -5.06784016 -> 1 +xdiv210 divide 809862859E+643769974 -5.06784016 -> -1.59804341E+643769982 Inexact Rounded +xdvi210 divideint 809862859E+643769974 -5.06784016 -> NaN Division_impossible +xmul210 multiply 809862859E+643769974 -5.06784016 -> -4.10425552E+643769983 Inexact Rounded +xpow210 power 809862859E+643769974 -5 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem210 remainder 809862859E+643769974 -5.06784016 -> NaN Division_impossible +xsub210 subtract 809862859E+643769974 -5.06784016 -> 8.09862859E+643769982 Inexact Rounded +xadd211 add -62011.4563E-117563240 -57.1731586E+115657204 -> -5.71731586E+115657205 Inexact Rounded +xcom211 compare -62011.4563E-117563240 -57.1731586E+115657204 -> 1 +xdiv211 divide -62011.4563E-117563240 -57.1731586E+115657204 -> 1.08462534E-233220441 Inexact Rounded +xdvi211 divideint -62011.4563E-117563240 -57.1731586E+115657204 -> 0 +xmul211 multiply -62011.4563E-117563240 -57.1731586E+115657204 -> 3.54539083E-1906030 Inexact Rounded +xpow211 power -62011.4563E-117563240 -6 -> 1.75860546E+705379411 Inexact Rounded +xrem211 remainder -62011.4563E-117563240 -57.1731586E+115657204 -> -6.20114563E-117563236 +xsub211 subtract -62011.4563E-117563240 -57.1731586E+115657204 -> 5.71731586E+115657205 Inexact Rounded +xadd212 add 315.33351 91588.837E-536020149 -> 315.333510 Inexact Rounded +xcom212 compare 315.33351 91588.837E-536020149 -> 1 +xdiv212 divide 315.33351 91588.837E-536020149 -> 3.44292515E+536020146 Inexact Rounded +xdvi212 divideint 315.33351 91588.837E-536020149 -> NaN Division_impossible +xmul212 multiply 315.33351 91588.837E-536020149 -> 2.88810294E-536020142 Inexact Rounded +xpow212 power 315.33351 9 -> 3.08269902E+22 Inexact Rounded +xrem212 remainder 315.33351 91588.837E-536020149 -> NaN Division_impossible +xsub212 subtract 315.33351 91588.837E-536020149 -> 315.333510 Inexact Rounded +xadd213 add 739.944710 202949.175 -> 203689.120 Inexact Rounded +xcom213 compare 739.944710 202949.175 -> -1 +xdiv213 divide 739.944710 202949.175 -> 0.00364596067 Inexact Rounded +xdvi213 divideint 739.944710 202949.175 -> 0 +xmul213 multiply 739.944710 202949.175 -> 150171168 Inexact Rounded +xpow213 power 739.944710 202949 -> 1.32611729E+582301 Inexact Rounded +xrem213 remainder 739.944710 202949.175 -> 739.944710 +xsub213 subtract 739.944710 202949.175 -> -202209.230 Inexact Rounded +xadd214 add 87686.8016 4204890.40 -> 4292577.20 Inexact Rounded +xcom214 compare 87686.8016 4204890.40 -> -1 +xdiv214 divide 87686.8016 4204890.40 -> 0.0208535285 Inexact Rounded +xdvi214 divideint 87686.8016 4204890.40 -> 0 +xmul214 multiply 87686.8016 4204890.40 -> 3.68713390E+11 Inexact Rounded +xpow214 power 87686.8016 4204890 -> 5.14846981E+20784494 Inexact Rounded +xrem214 remainder 87686.8016 4204890.40 -> 87686.8016 +xsub214 subtract 87686.8016 4204890.40 -> -4117203.60 Inexact Rounded +xadd215 add 987126721.E-725794834 4874166.23 -> 4874166.23 Inexact Rounded +xcom215 compare 987126721.E-725794834 4874166.23 -> -1 +xdiv215 divide 987126721.E-725794834 4874166.23 -> 2.02522170E-725794832 Inexact Rounded +xdvi215 divideint 987126721.E-725794834 4874166.23 -> 0 +xmul215 multiply 987126721.E-725794834 4874166.23 -> 4.81141973E-725794819 Inexact Rounded +xpow215 power 987126721.E-725794834 4874166 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem215 remainder 987126721.E-725794834 4874166.23 -> 9.87126721E-725794826 +xsub215 subtract 987126721.E-725794834 4874166.23 -> -4874166.23 Inexact Rounded +xadd216 add 728148726.E-661695938 32798.5202 -> 32798.5202 Inexact Rounded +xcom216 compare 728148726.E-661695938 32798.5202 -> -1 +xdiv216 divide 728148726.E-661695938 32798.5202 -> 2.22006579E-661695934 Inexact Rounded +xdvi216 divideint 728148726.E-661695938 32798.5202 -> 0 +xmul216 multiply 728148726.E-661695938 32798.5202 -> 2.38822007E-661695925 Inexact Rounded +xpow216 power 728148726.E-661695938 32799 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem216 remainder 728148726.E-661695938 32798.5202 -> 7.28148726E-661695930 +xsub216 subtract 728148726.E-661695938 32798.5202 -> -32798.5202 Inexact Rounded +xadd217 add 7428219.97 667.326760 -> 7428887.30 Inexact Rounded +xcom217 compare 7428219.97 667.326760 -> 1 +xdiv217 divide 7428219.97 667.326760 -> 11131.3084 Inexact Rounded +xdvi217 divideint 7428219.97 667.326760 -> 11131 +xmul217 multiply 7428219.97 667.326760 -> 4.95704997E+9 Inexact Rounded +xpow217 power 7428219.97 667 -> 7.58808509E+4582 Inexact Rounded +xrem217 remainder 7428219.97 667.326760 -> 205.804440 +xsub217 subtract 7428219.97 667.326760 -> 7427552.64 Inexact Rounded +xadd218 add -7291.19212 209.64966E-588526476 -> -7291.19212 Inexact Rounded +xcom218 compare -7291.19212 209.64966E-588526476 -> -1 +xdiv218 divide -7291.19212 209.64966E-588526476 -> -3.47779821E+588526477 Inexact Rounded +xdvi218 divideint -7291.19212 209.64966E-588526476 -> NaN Division_impossible +xmul218 multiply -7291.19212 209.64966E-588526476 -> -1.52859595E-588526470 Inexact Rounded +xpow218 power -7291.19212 2 -> 53161482.5 Inexact Rounded +xrem218 remainder -7291.19212 209.64966E-588526476 -> NaN Division_impossible +xsub218 subtract -7291.19212 209.64966E-588526476 -> -7291.19212 Inexact Rounded +xadd219 add -358.24550 -4447.78675E+601402509 -> -4.44778675E+601402512 Inexact Rounded +xcom219 compare -358.24550 -4447.78675E+601402509 -> 1 +xdiv219 divide -358.24550 -4447.78675E+601402509 -> 8.05446664E-601402511 Inexact Rounded +xdvi219 divideint -358.24550 -4447.78675E+601402509 -> 0 +xmul219 multiply -358.24550 -4447.78675E+601402509 -> 1.59339959E+601402515 Inexact Rounded +xpow219 power -358.24550 -4 -> 6.07123474E-11 Inexact Rounded +xrem219 remainder -358.24550 -4447.78675E+601402509 -> -358.24550 +xsub219 subtract -358.24550 -4447.78675E+601402509 -> 4.44778675E+601402512 Inexact Rounded +xadd220 add 118.621826 -2.72010038 -> 115.901726 Inexact Rounded +xcom220 compare 118.621826 -2.72010038 -> 1 +xdiv220 divide 118.621826 -2.72010038 -> -43.6093561 Inexact Rounded +xdvi220 divideint 118.621826 -2.72010038 -> -43 +xmul220 multiply 118.621826 -2.72010038 -> -322.663274 Inexact Rounded +xpow220 power 118.621826 -3 -> 5.99109471E-7 Inexact Rounded +xrem220 remainder 118.621826 -2.72010038 -> 1.65750966 +xsub220 subtract 118.621826 -2.72010038 -> 121.341926 Inexact Rounded +xadd221 add 8071961.94 -135533740.E-102451543 -> 8071961.94 Inexact Rounded +xcom221 compare 8071961.94 -135533740.E-102451543 -> 1 +xdiv221 divide 8071961.94 -135533740.E-102451543 -> -5.95568450E+102451541 Inexact Rounded +xdvi221 divideint 8071961.94 -135533740.E-102451543 -> NaN Division_impossible +xmul221 multiply 8071961.94 -135533740.E-102451543 -> -1.09402319E-102451528 Inexact Rounded +xpow221 power 8071961.94 -1 -> 1.23885619E-7 Inexact Rounded +xrem221 remainder 8071961.94 -135533740.E-102451543 -> NaN Division_impossible +xsub221 subtract 8071961.94 -135533740.E-102451543 -> 8071961.94 Inexact Rounded +xadd222 add 64262528.5E+812118682 -8692.94447E-732186947 -> 6.42625285E+812118689 Inexact Rounded +xcom222 compare 64262528.5E+812118682 -8692.94447E-732186947 -> 1 +xdiv222 divide 64262528.5E+812118682 -8692.94447E-732186947 -> -Infinity Inexact Overflow Rounded +xdvi222 divideint 64262528.5E+812118682 -8692.94447E-732186947 -> NaN Division_impossible +xmul222 multiply 64262528.5E+812118682 -8692.94447E-732186947 -> -5.58630592E+79931746 Inexact Rounded +xpow222 power 64262528.5E+812118682 -9 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem222 remainder 64262528.5E+812118682 -8692.94447E-732186947 -> NaN Division_impossible +xsub222 subtract 64262528.5E+812118682 -8692.94447E-732186947 -> 6.42625285E+812118689 Inexact Rounded +xadd223 add -35544.4029 -567830.130 -> -603374.533 Inexact Rounded +xcom223 compare -35544.4029 -567830.130 -> 1 +xdiv223 divide -35544.4029 -567830.130 -> 0.0625968948 Inexact Rounded +xdvi223 divideint -35544.4029 -567830.130 -> 0 +xmul223 multiply -35544.4029 -567830.130 -> 2.01831829E+10 Inexact Rounded +xpow223 power -35544.4029 -567830 -> 3.77069368E-2584065 Inexact Rounded +xrem223 remainder -35544.4029 -567830.130 -> -35544.4029 +xsub223 subtract -35544.4029 -567830.130 -> 532285.727 Inexact Rounded +xadd224 add -7.16513047E+59297103 87767.8211 -> -7.16513047E+59297103 Inexact Rounded +xcom224 compare -7.16513047E+59297103 87767.8211 -> -1 +xdiv224 divide -7.16513047E+59297103 87767.8211 -> -8.16373288E+59297098 Inexact Rounded +xdvi224 divideint -7.16513047E+59297103 87767.8211 -> NaN Division_impossible +xmul224 multiply -7.16513047E+59297103 87767.8211 -> -6.28867889E+59297108 Inexact Rounded +xpow224 power -7.16513047E+59297103 87768 -> Infinity Overflow Inexact Rounded +xrem224 remainder -7.16513047E+59297103 87767.8211 -> NaN Division_impossible +xsub224 subtract -7.16513047E+59297103 87767.8211 -> -7.16513047E+59297103 Inexact Rounded +xadd225 add -509.483395 -147242915. -> -147243424 Inexact Rounded +xcom225 compare -509.483395 -147242915. -> 1 +xdiv225 divide -509.483395 -147242915. -> 0.00000346015559 Inexact Rounded +xdvi225 divideint -509.483395 -147242915. -> 0 +xmul225 multiply -509.483395 -147242915. -> 7.50178202E+10 Inexact Rounded +xpow225 power -509.483395 -147242915 -> -3.10760519E-398605718 Inexact Rounded +xrem225 remainder -509.483395 -147242915. -> -509.483395 +xsub225 subtract -509.483395 -147242915. -> 147242406 Inexact Rounded +xadd226 add -7919047.28E+956041629 -367667329 -> -7.91904728E+956041635 Inexact Rounded +xcom226 compare -7919047.28E+956041629 -367667329 -> -1 +xdiv226 divide -7919047.28E+956041629 -367667329 -> 2.15386211E+956041627 Inexact Rounded +xdvi226 divideint -7919047.28E+956041629 -367667329 -> NaN Division_impossible +xmul226 multiply -7919047.28E+956041629 -367667329 -> 2.91157496E+956041644 Inexact Rounded +xpow226 power -7919047.28E+956041629 -367667329 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem226 remainder -7919047.28E+956041629 -367667329 -> NaN Division_impossible +xsub226 subtract -7919047.28E+956041629 -367667329 -> -7.91904728E+956041635 Inexact Rounded +xadd227 add 895612630. -36.4104040 -> 895612594 Inexact Rounded +xcom227 compare 895612630. -36.4104040 -> 1 +xdiv227 divide 895612630. -36.4104040 -> -24597712.0 Inexact Rounded +xdvi227 divideint 895612630. -36.4104040 -> -24597711 +xmul227 multiply 895612630. -36.4104040 -> -3.26096177E+10 Inexact Rounded +xpow227 power 895612630. -36 -> 5.29264130E-323 Inexact Rounded +xrem227 remainder 895612630. -36.4104040 -> 35.0147560 +xsub227 subtract 895612630. -36.4104040 -> 895612666 Inexact Rounded +xadd228 add 25455.4973 2955.00006E+528196218 -> 2.95500006E+528196221 Inexact Rounded +xcom228 compare 25455.4973 2955.00006E+528196218 -> -1 +xdiv228 divide 25455.4973 2955.00006E+528196218 -> 8.61438131E-528196218 Inexact Rounded +xdvi228 divideint 25455.4973 2955.00006E+528196218 -> 0 +xmul228 multiply 25455.4973 2955.00006E+528196218 -> 7.52209960E+528196225 Inexact Rounded +xpow228 power 25455.4973 3 -> 1.64947128E+13 Inexact Rounded +xrem228 remainder 25455.4973 2955.00006E+528196218 -> 25455.4973 +xsub228 subtract 25455.4973 2955.00006E+528196218 -> -2.95500006E+528196221 Inexact Rounded +xadd229 add -112.294144E+273414172 -71448007.7 -> -1.12294144E+273414174 Inexact Rounded +xcom229 compare -112.294144E+273414172 -71448007.7 -> -1 +xdiv229 divide -112.294144E+273414172 -71448007.7 -> 1.57169035E+273414166 Inexact Rounded +xdvi229 divideint -112.294144E+273414172 -71448007.7 -> NaN Division_impossible +xmul229 multiply -112.294144E+273414172 -71448007.7 -> 8.02319287E+273414181 Inexact Rounded +xpow229 power -112.294144E+273414172 -71448008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem229 remainder -112.294144E+273414172 -71448007.7 -> NaN Division_impossible +xsub229 subtract -112.294144E+273414172 -71448007.7 -> -1.12294144E+273414174 Inexact Rounded +xadd230 add 62871.2202 2484.0382E+211662557 -> 2.48403820E+211662560 Inexact Rounded +xcom230 compare 62871.2202 2484.0382E+211662557 -> -1 +xdiv230 divide 62871.2202 2484.0382E+211662557 -> 2.53100859E-211662556 Inexact Rounded +xdvi230 divideint 62871.2202 2484.0382E+211662557 -> 0 +xmul230 multiply 62871.2202 2484.0382E+211662557 -> 1.56174513E+211662565 Inexact Rounded +xpow230 power 62871.2202 2 -> 3.95279033E+9 Inexact Rounded +xrem230 remainder 62871.2202 2484.0382E+211662557 -> 62871.2202 +xsub230 subtract 62871.2202 2484.0382E+211662557 -> -2.48403820E+211662560 Inexact Rounded +xadd231 add 71.9281575 -9810012.5 -> -9809940.57 Inexact Rounded +xcom231 compare 71.9281575 -9810012.5 -> 1 +xdiv231 divide 71.9281575 -9810012.5 -> -0.00000733211680 Inexact Rounded +xdvi231 divideint 71.9281575 -9810012.5 -> -0 +xmul231 multiply 71.9281575 -9810012.5 -> -705616124 Inexact Rounded +xpow231 power 71.9281575 -9810013 -> 2.00363798E-18216203 Inexact Rounded +xrem231 remainder 71.9281575 -9810012.5 -> 71.9281575 +xsub231 subtract 71.9281575 -9810012.5 -> 9810084.43 Inexact Rounded +xadd232 add -6388022. -88.042967 -> -6388110.04 Inexact Rounded +xcom232 compare -6388022. -88.042967 -> -1 +xdiv232 divide -6388022. -88.042967 -> 72555.7329 Inexact Rounded +xdvi232 divideint -6388022. -88.042967 -> 72555 +xmul232 multiply -6388022. -88.042967 -> 562420410 Inexact Rounded +xpow232 power -6388022. -88 -> 1.34201238E-599 Inexact Rounded +xrem232 remainder -6388022. -88.042967 -> -64.529315 +xsub232 subtract -6388022. -88.042967 -> -6387933.96 Inexact Rounded +xadd233 add 372567445. 96.0992141 -> 372567541 Inexact Rounded +xcom233 compare 372567445. 96.0992141 -> 1 +xdiv233 divide 372567445. 96.0992141 -> 3876904.18 Inexact Rounded +xdvi233 divideint 372567445. 96.0992141 -> 3876904 +xmul233 multiply 372567445. 96.0992141 -> 3.58034387E+10 Inexact Rounded +xpow233 power 372567445. 96 -> 6.84968715E+822 Inexact Rounded +xrem233 remainder 372567445. 96.0992141 -> 17.4588536 +xsub233 subtract 372567445. 96.0992141 -> 372567349 Inexact Rounded +xadd234 add 802.156517 -174409310.E-255338020 -> 802.156517 Inexact Rounded +xcom234 compare 802.156517 -174409310.E-255338020 -> 1 +xdiv234 divide 802.156517 -174409310.E-255338020 -> -4.59927579E+255338014 Inexact Rounded +xdvi234 divideint 802.156517 -174409310.E-255338020 -> NaN Division_impossible +xmul234 multiply 802.156517 -174409310.E-255338020 -> -1.39903565E-255338009 Inexact Rounded +xpow234 power 802.156517 -2 -> 0.00000155411005 Inexact Rounded +xrem234 remainder 802.156517 -174409310.E-255338020 -> NaN Division_impossible +xsub234 subtract 802.156517 -174409310.E-255338020 -> 802.156517 Inexact Rounded +xadd235 add -3.65207541 74501982.0 -> 74501978.3 Inexact Rounded +xcom235 compare -3.65207541 74501982.0 -> -1 +xdiv235 divide -3.65207541 74501982.0 -> -4.90198423E-8 Inexact Rounded +xdvi235 divideint -3.65207541 74501982.0 -> -0 +xmul235 multiply -3.65207541 74501982.0 -> -272086856 Inexact Rounded +xpow235 power -3.65207541 74501982 -> 2.10339452E+41910325 Inexact Rounded +xrem235 remainder -3.65207541 74501982.0 -> -3.65207541 +xsub235 subtract -3.65207541 74501982.0 -> -74501985.7 Inexact Rounded +xadd236 add -5297.76981 -859.719404 -> -6157.48921 Inexact Rounded +xcom236 compare -5297.76981 -859.719404 -> -1 +xdiv236 divide -5297.76981 -859.719404 -> 6.16220802 Inexact Rounded +xdvi236 divideint -5297.76981 -859.719404 -> 6 +xmul236 multiply -5297.76981 -859.719404 -> 4554595.50 Inexact Rounded +xpow236 power -5297.76981 -860 -> 1.90523108E-3203 Inexact Rounded +xrem236 remainder -5297.76981 -859.719404 -> -139.453386 +xsub236 subtract -5297.76981 -859.719404 -> -4438.05041 Inexact Rounded +xadd237 add -684172.592 766.448597E+288361959 -> 7.66448597E+288361961 Inexact Rounded +xcom237 compare -684172.592 766.448597E+288361959 -> -1 +xdiv237 divide -684172.592 766.448597E+288361959 -> -8.92652938E-288361957 Inexact Rounded +xdvi237 divideint -684172.592 766.448597E+288361959 -> -0 +xmul237 multiply -684172.592 766.448597E+288361959 -> -5.24383123E+288361967 Inexact Rounded +xpow237 power -684172.592 8 -> 4.80093005E+46 Inexact Rounded +xrem237 remainder -684172.592 766.448597E+288361959 -> -684172.592 +xsub237 subtract -684172.592 766.448597E+288361959 -> -7.66448597E+288361961 Inexact Rounded +xadd238 add 626919.219 57469.8727E+13188610 -> 5.74698727E+13188614 Inexact Rounded +xcom238 compare 626919.219 57469.8727E+13188610 -> -1 +xdiv238 divide 626919.219 57469.8727E+13188610 -> 1.09086586E-13188609 Inexact Rounded +xdvi238 divideint 626919.219 57469.8727E+13188610 -> 0 +xmul238 multiply 626919.219 57469.8727E+13188610 -> 3.60289677E+13188620 Inexact Rounded +xpow238 power 626919.219 6 -> 6.07112959E+34 Inexact Rounded +xrem238 remainder 626919.219 57469.8727E+13188610 -> 626919.219 +xsub238 subtract 626919.219 57469.8727E+13188610 -> -5.74698727E+13188614 Inexact Rounded +xadd239 add -77480.5840 893265.594E+287982552 -> 8.93265594E+287982557 Inexact Rounded +xcom239 compare -77480.5840 893265.594E+287982552 -> -1 +xdiv239 divide -77480.5840 893265.594E+287982552 -> -8.67385742E-287982554 Inexact Rounded +xdvi239 divideint -77480.5840 893265.594E+287982552 -> -0 +xmul239 multiply -77480.5840 893265.594E+287982552 -> -6.92107399E+287982562 Inexact Rounded +xpow239 power -77480.5840 9 -> -1.00631969E+44 Inexact Rounded +xrem239 remainder -77480.5840 893265.594E+287982552 -> -77480.5840 +xsub239 subtract -77480.5840 893265.594E+287982552 -> -8.93265594E+287982557 Inexact Rounded +xadd240 add -7177620.29 7786343.83 -> 608723.54 +xcom240 compare -7177620.29 7786343.83 -> -1 +xdiv240 divide -7177620.29 7786343.83 -> -0.921821647 Inexact Rounded +xdvi240 divideint -7177620.29 7786343.83 -> -0 +xmul240 multiply -7177620.29 7786343.83 -> -5.58874195E+13 Inexact Rounded +xpow240 power -7177620.29 7786344 -> 2.96037074E+53383022 Inexact Rounded +xrem240 remainder -7177620.29 7786343.83 -> -7177620.29 +xsub240 subtract -7177620.29 7786343.83 -> -14963964.1 Inexact Rounded +xadd241 add 9.6224130 4.50355112 -> 14.1259641 Inexact Rounded +xcom241 compare 9.6224130 4.50355112 -> 1 +xdiv241 divide 9.6224130 4.50355112 -> 2.13662791 Inexact Rounded +xdvi241 divideint 9.6224130 4.50355112 -> 2 +xmul241 multiply 9.6224130 4.50355112 -> 43.3350288 Inexact Rounded +xpow241 power 9.6224130 5 -> 82493.5448 Inexact Rounded +xrem241 remainder 9.6224130 4.50355112 -> 0.61531076 +xsub241 subtract 9.6224130 4.50355112 -> 5.11886188 +xadd242 add -66.6337347E-597410086 -818812885 -> -818812885 Inexact Rounded +xcom242 compare -66.6337347E-597410086 -818812885 -> 1 +xdiv242 divide -66.6337347E-597410086 -818812885 -> 8.13784638E-597410094 Inexact Rounded +xdvi242 divideint -66.6337347E-597410086 -818812885 -> 0 +xmul242 multiply -66.6337347E-597410086 -818812885 -> 5.45605605E-597410076 Inexact Rounded +xpow242 power -66.6337347E-597410086 -818812885 -> -Infinity Overflow Inexact Rounded +xrem242 remainder -66.6337347E-597410086 -818812885 -> -6.66337347E-597410085 +xsub242 subtract -66.6337347E-597410086 -818812885 -> 818812885 Inexact Rounded +xadd243 add 65587553.7 600574.736 -> 66188128.4 Inexact Rounded +xcom243 compare 65587553.7 600574.736 -> 1 +xdiv243 divide 65587553.7 600574.736 -> 109.207980 Inexact Rounded +xdvi243 divideint 65587553.7 600574.736 -> 109 +xmul243 multiply 65587553.7 600574.736 -> 3.93902277E+13 Inexact Rounded +xpow243 power 65587553.7 600575 -> 3.40404817E+4694587 Inexact Rounded +xrem243 remainder 65587553.7 600574.736 -> 124907.476 +xsub243 subtract 65587553.7 600574.736 -> 64986979.0 Inexact Rounded +xadd244 add -32401.939 -585200217. -> -585232619 Inexact Rounded +xcom244 compare -32401.939 -585200217. -> 1 +xdiv244 divide -32401.939 -585200217. -> 0.0000553689798 Inexact Rounded +xdvi244 divideint -32401.939 -585200217. -> 0 +xmul244 multiply -32401.939 -585200217. -> 1.89616217E+13 Inexact Rounded +xpow244 power -32401.939 -585200217 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem244 remainder -32401.939 -585200217. -> -32401.939 +xsub244 subtract -32401.939 -585200217. -> 585167815 Inexact Rounded +xadd245 add 69573.988 -9.77003465E+740933668 -> -9.77003465E+740933668 Inexact Rounded +xcom245 compare 69573.988 -9.77003465E+740933668 -> 1 +xdiv245 divide 69573.988 -9.77003465E+740933668 -> -7.12116082E-740933665 Inexact Rounded +xdvi245 divideint 69573.988 -9.77003465E+740933668 -> -0 +xmul245 multiply 69573.988 -9.77003465E+740933668 -> -6.79740273E+740933673 Inexact Rounded +xpow245 power 69573.988 -10 -> 3.76297229E-49 Inexact Rounded +xrem245 remainder 69573.988 -9.77003465E+740933668 -> 69573.988 +xsub245 subtract 69573.988 -9.77003465E+740933668 -> 9.77003465E+740933668 Inexact Rounded +xadd246 add 2362.06251 -433149546.E-152643629 -> 2362.06251 Inexact Rounded +xcom246 compare 2362.06251 -433149546.E-152643629 -> 1 +xdiv246 divide 2362.06251 -433149546.E-152643629 -> -5.45322633E+152643623 Inexact Rounded +xdvi246 divideint 2362.06251 -433149546.E-152643629 -> NaN Division_impossible +xmul246 multiply 2362.06251 -433149546.E-152643629 -> -1.02312630E-152643617 Inexact Rounded +xpow246 power 2362.06251 -4 -> 3.21243577E-14 Inexact Rounded +xrem246 remainder 2362.06251 -433149546.E-152643629 -> NaN Division_impossible +xsub246 subtract 2362.06251 -433149546.E-152643629 -> 2362.06251 Inexact Rounded +xadd247 add -615.23488E+249953452 -21437483.7 -> -6.15234880E+249953454 Inexact Rounded +xcom247 compare -615.23488E+249953452 -21437483.7 -> -1 +xdiv247 divide -615.23488E+249953452 -21437483.7 -> 2.86990250E+249953447 Inexact Rounded +xdvi247 divideint -615.23488E+249953452 -21437483.7 -> NaN Division_impossible +xmul247 multiply -615.23488E+249953452 -21437483.7 -> 1.31890877E+249953462 Inexact Rounded +xpow247 power -615.23488E+249953452 -21437484 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem247 remainder -615.23488E+249953452 -21437483.7 -> NaN Division_impossible +xsub247 subtract -615.23488E+249953452 -21437483.7 -> -6.15234880E+249953454 Inexact Rounded +xadd248 add 216741082. 250290244 -> 467031326 +xcom248 compare 216741082. 250290244 -> -1 +xdiv248 divide 216741082. 250290244 -> 0.865958970 Inexact Rounded +xdvi248 divideint 216741082. 250290244 -> 0 +xmul248 multiply 216741082. 250290244 -> 5.42481783E+16 Inexact Rounded +xpow248 power 216741082. 250290244 -> Infinity Overflow Inexact Rounded +xrem248 remainder 216741082. 250290244 -> 216741082 +xsub248 subtract 216741082. 250290244 -> -33549162 +xadd249 add -6364720.49 5539245.64 -> -825474.85 +xcom249 compare -6364720.49 5539245.64 -> -1 +xdiv249 divide -6364720.49 5539245.64 -> -1.14902297 Inexact Rounded +xdvi249 divideint -6364720.49 5539245.64 -> -1 +xmul249 multiply -6364720.49 5539245.64 -> -3.52557502E+13 Inexact Rounded +xpow249 power -6364720.49 5539246 -> 2.96894641E+37687807 Inexact Rounded +xrem249 remainder -6364720.49 5539245.64 -> -825474.85 +xsub249 subtract -6364720.49 5539245.64 -> -11903966.1 Inexact Rounded +xadd250 add -814599.475 -14.5431191 -> -814614.018 Inexact Rounded +xcom250 compare -814599.475 -14.5431191 -> -1 +xdiv250 divide -814599.475 -14.5431191 -> 56012.7074 Inexact Rounded +xdvi250 divideint -814599.475 -14.5431191 -> 56012 +xmul250 multiply -814599.475 -14.5431191 -> 11846817.2 Inexact Rounded +xpow250 power -814599.475 -15 -> -2.16689622E-89 Inexact Rounded +xrem250 remainder -814599.475 -14.5431191 -> -10.2879708 +xsub250 subtract -814599.475 -14.5431191 -> -814584.932 Inexact Rounded +xadd251 add -877498.755 507408724E-168628106 -> -877498.755 Inexact Rounded +xcom251 compare -877498.755 507408724E-168628106 -> -1 +xdiv251 divide -877498.755 507408724E-168628106 -> -1.72937262E+168628103 Inexact Rounded +xdvi251 divideint -877498.755 507408724E-168628106 -> NaN Division_impossible +xmul251 multiply -877498.755 507408724E-168628106 -> -4.45250524E-168628092 Inexact Rounded +xpow251 power -877498.755 5 -> -5.20274505E+29 Inexact Rounded +xrem251 remainder -877498.755 507408724E-168628106 -> NaN Division_impossible +xsub251 subtract -877498.755 507408724E-168628106 -> -877498.755 Inexact Rounded +xadd252 add 10634446.5E+475783861 50.7213056E+17807809 -> 1.06344465E+475783868 Inexact Rounded +xcom252 compare 10634446.5E+475783861 50.7213056E+17807809 -> 1 +xdiv252 divide 10634446.5E+475783861 50.7213056E+17807809 -> 2.09664289E+457976057 Inexact Rounded +xdvi252 divideint 10634446.5E+475783861 50.7213056E+17807809 -> NaN Division_impossible +xmul252 multiply 10634446.5E+475783861 50.7213056E+17807809 -> 5.39393011E+493591678 Inexact Rounded +xpow252 power 10634446.5E+475783861 5 -> Infinity Overflow Inexact Rounded +xrem252 remainder 10634446.5E+475783861 50.7213056E+17807809 -> NaN Division_impossible +xsub252 subtract 10634446.5E+475783861 50.7213056E+17807809 -> 1.06344465E+475783868 Inexact Rounded +xadd253 add -162726.257E-597285918 -4391.54799 -> -4391.54799 Inexact Rounded +xcom253 compare -162726.257E-597285918 -4391.54799 -> 1 +xdiv253 divide -162726.257E-597285918 -4391.54799 -> 3.70544185E-597285917 Inexact Rounded +xdvi253 divideint -162726.257E-597285918 -4391.54799 -> 0 +xmul253 multiply -162726.257E-597285918 -4391.54799 -> 7.14620167E-597285910 Inexact Rounded +xpow253 power -162726.257E-597285918 -4392 -> Infinity Overflow Inexact Rounded +xrem253 remainder -162726.257E-597285918 -4391.54799 -> -1.62726257E-597285913 +xsub253 subtract -162726.257E-597285918 -4391.54799 -> 4391.54799 Inexact Rounded +xadd254 add 700354586.E-99856707 7198.0493E+436250299 -> 7.19804930E+436250302 Inexact Rounded +xcom254 compare 700354586.E-99856707 7198.0493E+436250299 -> -1 +xdiv254 divide 700354586.E-99856707 7198.0493E+436250299 -> 9.72978312E-536107002 Inexact Rounded +xdvi254 divideint 700354586.E-99856707 7198.0493E+436250299 -> 0 +xmul254 multiply 700354586.E-99856707 7198.0493E+436250299 -> 5.04118684E+336393604 Inexact Rounded +xpow254 power 700354586.E-99856707 7 -> 8.26467610E-698996888 Inexact Rounded +xrem254 remainder 700354586.E-99856707 7198.0493E+436250299 -> 7.00354586E-99856699 +xsub254 subtract 700354586.E-99856707 7198.0493E+436250299 -> -7.19804930E+436250302 Inexact Rounded +xadd255 add 39617663E-463704664 -895.290346 -> -895.290346 Inexact Rounded +xcom255 compare 39617663E-463704664 -895.290346 -> 1 +xdiv255 divide 39617663E-463704664 -895.290346 -> -4.42511898E-463704660 Inexact Rounded +xdvi255 divideint 39617663E-463704664 -895.290346 -> -0 +xmul255 multiply 39617663E-463704664 -895.290346 -> -3.54693112E-463704654 Inexact Rounded +xpow255 power 39617663E-463704664 -895 -> Infinity Overflow Inexact Rounded +xrem255 remainder 39617663E-463704664 -895.290346 -> 3.9617663E-463704657 +xsub255 subtract 39617663E-463704664 -895.290346 -> 895.290346 Inexact Rounded +xadd256 add 5350882.59 -36329829 -> -30978946.4 Inexact Rounded +xcom256 compare 5350882.59 -36329829 -> 1 +xdiv256 divide 5350882.59 -36329829 -> -0.147286204 Inexact Rounded +xdvi256 divideint 5350882.59 -36329829 -> -0 +xmul256 multiply 5350882.59 -36329829 -> -1.94396649E+14 Inexact Rounded +xpow256 power 5350882.59 -36329829 -> 9.77006107E-244442546 Inexact Rounded +xrem256 remainder 5350882.59 -36329829 -> 5350882.59 +xsub256 subtract 5350882.59 -36329829 -> 41680711.6 Inexact Rounded +xadd257 add 91966.4084E+210382952 166740.46E-42001390 -> 9.19664084E+210382956 Inexact Rounded +xcom257 compare 91966.4084E+210382952 166740.46E-42001390 -> 1 +xdiv257 divide 91966.4084E+210382952 166740.46E-42001390 -> 5.51554244E+252384341 Inexact Rounded +xdvi257 divideint 91966.4084E+210382952 166740.46E-42001390 -> NaN Division_impossible +xmul257 multiply 91966.4084E+210382952 166740.46E-42001390 -> 1.53345212E+168381572 Inexact Rounded +xpow257 power 91966.4084E+210382952 2 -> 8.45782027E+420765913 Inexact Rounded +xrem257 remainder 91966.4084E+210382952 166740.46E-42001390 -> NaN Division_impossible +xsub257 subtract 91966.4084E+210382952 166740.46E-42001390 -> 9.19664084E+210382956 Inexact Rounded +xadd258 add 231899031.E-481759076 726.337100 -> 726.337100 Inexact Rounded +xcom258 compare 231899031.E-481759076 726.337100 -> -1 +xdiv258 divide 231899031.E-481759076 726.337100 -> 3.19271907E-481759071 Inexact Rounded +xdvi258 divideint 231899031.E-481759076 726.337100 -> 0 +xmul258 multiply 231899031.E-481759076 726.337100 -> 1.68436870E-481759065 Inexact Rounded +xpow258 power 231899031.E-481759076 726 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem258 remainder 231899031.E-481759076 726.337100 -> 2.31899031E-481759068 +xsub258 subtract 231899031.E-481759076 726.337100 -> -726.337100 Inexact Rounded +xadd259 add -9611312.33 22109735.9 -> 12498423.6 Inexact Rounded +xcom259 compare -9611312.33 22109735.9 -> -1 +xdiv259 divide -9611312.33 22109735.9 -> -0.434709504 Inexact Rounded +xdvi259 divideint -9611312.33 22109735.9 -> -0 +xmul259 multiply -9611312.33 22109735.9 -> -2.12503577E+14 Inexact Rounded +xpow259 power -9611312.33 22109736 -> 6.74530828E+154387481 Inexact Rounded +xrem259 remainder -9611312.33 22109735.9 -> -9611312.33 +xsub259 subtract -9611312.33 22109735.9 -> -31721048.2 Inexact Rounded +xadd260 add -5604938.15E-36812542 735937577. -> 735937577 Inexact Rounded +xcom260 compare -5604938.15E-36812542 735937577. -> -1 +xdiv260 divide -5604938.15E-36812542 735937577. -> -7.61605104E-36812545 Inexact Rounded +xdvi260 divideint -5604938.15E-36812542 735937577. -> -0 +xmul260 multiply -5604938.15E-36812542 735937577. -> -4.12488460E-36812527 Inexact Rounded +xpow260 power -5604938.15E-36812542 735937577 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem260 remainder -5604938.15E-36812542 735937577. -> -5.60493815E-36812536 +xsub260 subtract -5604938.15E-36812542 735937577. -> -735937577 Inexact Rounded +xadd261 add 693881413. 260547224E-480281418 -> 693881413 Inexact Rounded +xcom261 compare 693881413. 260547224E-480281418 -> 1 +xdiv261 divide 693881413. 260547224E-480281418 -> 2.66316947E+480281418 Inexact Rounded +xdvi261 divideint 693881413. 260547224E-480281418 -> NaN Division_impossible +xmul261 multiply 693881413. 260547224E-480281418 -> 1.80788876E-480281401 Inexact Rounded +xpow261 power 693881413. 3 -> 3.34084066E+26 Inexact Rounded +xrem261 remainder 693881413. 260547224E-480281418 -> NaN Division_impossible +xsub261 subtract 693881413. 260547224E-480281418 -> 693881413 Inexact Rounded +xadd262 add -34865.7378E-368768024 2297117.88 -> 2297117.88 Inexact Rounded +xcom262 compare -34865.7378E-368768024 2297117.88 -> -1 +xdiv262 divide -34865.7378E-368768024 2297117.88 -> -1.51780360E-368768026 Inexact Rounded +xdvi262 divideint -34865.7378E-368768024 2297117.88 -> -0 +xmul262 multiply -34865.7378E-368768024 2297117.88 -> -8.00907097E-368768014 Inexact Rounded +xpow262 power -34865.7378E-368768024 2297118 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem262 remainder -34865.7378E-368768024 2297117.88 -> -3.48657378E-368768020 +xsub262 subtract -34865.7378E-368768024 2297117.88 -> -2297117.88 Inexact Rounded +xadd263 add 1123.32456 7.86747918E+930888796 -> 7.86747918E+930888796 Inexact Rounded +xcom263 compare 1123.32456 7.86747918E+930888796 -> -1 +xdiv263 divide 1123.32456 7.86747918E+930888796 -> 1.42780748E-930888794 Inexact Rounded +xdvi263 divideint 1123.32456 7.86747918E+930888796 -> 0 +xmul263 multiply 1123.32456 7.86747918E+930888796 -> 8.83773259E+930888799 Inexact Rounded +xpow263 power 1123.32456 8 -> 2.53537401E+24 Inexact Rounded +xrem263 remainder 1123.32456 7.86747918E+930888796 -> 1123.32456 +xsub263 subtract 1123.32456 7.86747918E+930888796 -> -7.86747918E+930888796 Inexact Rounded +xadd264 add 56.6607465E+467812565 909552512E+764516200 -> 9.09552512E+764516208 Inexact Rounded +xcom264 compare 56.6607465E+467812565 909552512E+764516200 -> -1 +xdiv264 divide 56.6607465E+467812565 909552512E+764516200 -> 6.22951899E-296703643 Inexact Rounded +xdvi264 divideint 56.6607465E+467812565 909552512E+764516200 -> 0 +xmul264 multiply 56.6607465E+467812565 909552512E+764516200 -> Infinity Inexact Overflow Rounded +xpow264 power 56.6607465E+467812565 9 -> Infinity Overflow Inexact Rounded +xrem264 remainder 56.6607465E+467812565 909552512E+764516200 -> 5.66607465E+467812566 +xsub264 subtract 56.6607465E+467812565 909552512E+764516200 -> -9.09552512E+764516208 Inexact Rounded +xadd265 add -1.85771840E+365552540 -73028339.7 -> -1.85771840E+365552540 Inexact Rounded +xcom265 compare -1.85771840E+365552540 -73028339.7 -> -1 +xdiv265 divide -1.85771840E+365552540 -73028339.7 -> 2.54383217E+365552532 Inexact Rounded +xdvi265 divideint -1.85771840E+365552540 -73028339.7 -> NaN Division_impossible +xmul265 multiply -1.85771840E+365552540 -73028339.7 -> 1.35666090E+365552548 Inexact Rounded +xpow265 power -1.85771840E+365552540 -73028340 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem265 remainder -1.85771840E+365552540 -73028339.7 -> NaN Division_impossible +xsub265 subtract -1.85771840E+365552540 -73028339.7 -> -1.85771840E+365552540 Inexact Rounded +xadd266 add 34.1935525 -40767.6450 -> -40733.4514 Inexact Rounded +xcom266 compare 34.1935525 -40767.6450 -> 1 +xdiv266 divide 34.1935525 -40767.6450 -> -0.000838742402 Inexact Rounded +xdvi266 divideint 34.1935525 -40767.6450 -> -0 +xmul266 multiply 34.1935525 -40767.6450 -> -1393990.61 Inexact Rounded +xpow266 power 34.1935525 -40768 -> 1.45174210E-62536 Inexact Rounded +xrem266 remainder 34.1935525 -40767.6450 -> 34.1935525 +xsub266 subtract 34.1935525 -40767.6450 -> 40801.8386 Inexact Rounded +xadd267 add 26.0009168E+751618294 -304019.929 -> 2.60009168E+751618295 Inexact Rounded +xcom267 compare 26.0009168E+751618294 -304019.929 -> 1 +xdiv267 divide 26.0009168E+751618294 -304019.929 -> -8.55237250E+751618289 Inexact Rounded +xdvi267 divideint 26.0009168E+751618294 -304019.929 -> NaN Division_impossible +xmul267 multiply 26.0009168E+751618294 -304019.929 -> -7.90479688E+751618300 Inexact Rounded +xpow267 power 26.0009168E+751618294 -304020 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem267 remainder 26.0009168E+751618294 -304019.929 -> NaN Division_impossible +xsub267 subtract 26.0009168E+751618294 -304019.929 -> 2.60009168E+751618295 Inexact Rounded +xadd268 add -58.4853072E+588540055 -4647.3205 -> -5.84853072E+588540056 Inexact Rounded +xcom268 compare -58.4853072E+588540055 -4647.3205 -> -1 +xdiv268 divide -58.4853072E+588540055 -4647.3205 -> 1.25847372E+588540053 Inexact Rounded +xdvi268 divideint -58.4853072E+588540055 -4647.3205 -> NaN Division_impossible +xmul268 multiply -58.4853072E+588540055 -4647.3205 -> 2.71799967E+588540060 Inexact Rounded +xpow268 power -58.4853072E+588540055 -4647 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem268 remainder -58.4853072E+588540055 -4647.3205 -> NaN Division_impossible +xsub268 subtract -58.4853072E+588540055 -4647.3205 -> -5.84853072E+588540056 Inexact Rounded +xadd269 add 51.025101 -4467691.57 -> -4467640.54 Inexact Rounded +xcom269 compare 51.025101 -4467691.57 -> 1 +xdiv269 divide 51.025101 -4467691.57 -> -0.0000114209095 Inexact Rounded +xdvi269 divideint 51.025101 -4467691.57 -> -0 +xmul269 multiply 51.025101 -4467691.57 -> -227964414 Inexact Rounded +xpow269 power 51.025101 -4467692 -> 4.49462589E-7629853 Inexact Rounded +xrem269 remainder 51.025101 -4467691.57 -> 51.025101 +xsub269 subtract 51.025101 -4467691.57 -> 4467742.60 Inexact Rounded +xadd270 add -2214.76582 379785372E+223117572 -> 3.79785372E+223117580 Inexact Rounded +xcom270 compare -2214.76582 379785372E+223117572 -> -1 +xdiv270 divide -2214.76582 379785372E+223117572 -> -5.83162487E-223117578 Inexact Rounded +xdvi270 divideint -2214.76582 379785372E+223117572 -> -0 +xmul270 multiply -2214.76582 379785372E+223117572 -> -8.41135661E+223117583 Inexact Rounded +xpow270 power -2214.76582 4 -> 2.40608658E+13 Inexact Rounded +xrem270 remainder -2214.76582 379785372E+223117572 -> -2214.76582 +xsub270 subtract -2214.76582 379785372E+223117572 -> -3.79785372E+223117580 Inexact Rounded +xadd271 add -2564.75207E-841443929 -653498187 -> -653498187 Inexact Rounded +xcom271 compare -2564.75207E-841443929 -653498187 -> 1 +xdiv271 divide -2564.75207E-841443929 -653498187 -> 3.92465063E-841443935 Inexact Rounded +xdvi271 divideint -2564.75207E-841443929 -653498187 -> 0 +xmul271 multiply -2564.75207E-841443929 -653498187 -> 1.67606083E-841443917 Inexact Rounded +xpow271 power -2564.75207E-841443929 -653498187 -> -Infinity Overflow Inexact Rounded +xrem271 remainder -2564.75207E-841443929 -653498187 -> -2.56475207E-841443926 +xsub271 subtract -2564.75207E-841443929 -653498187 -> 653498187 Inexact Rounded +xadd272 add 513115529. 27775075.6E+217133352 -> 2.77750756E+217133359 Inexact Rounded +xcom272 compare 513115529. 27775075.6E+217133352 -> -1 +xdiv272 divide 513115529. 27775075.6E+217133352 -> 1.84739562E-217133351 Inexact Rounded +xdvi272 divideint 513115529. 27775075.6E+217133352 -> 0 +xmul272 multiply 513115529. 27775075.6E+217133352 -> 1.42518226E+217133368 Inexact Rounded +xpow272 power 513115529. 3 -> 1.35096928E+26 Inexact Rounded +xrem272 remainder 513115529. 27775075.6E+217133352 -> 513115529 +xsub272 subtract 513115529. 27775075.6E+217133352 -> -2.77750756E+217133359 Inexact Rounded +xadd273 add -247157.208 -532990.453 -> -780147.661 +xcom273 compare -247157.208 -532990.453 -> 1 +xdiv273 divide -247157.208 -532990.453 -> 0.463717890 Inexact Rounded +xdvi273 divideint -247157.208 -532990.453 -> 0 +xmul273 multiply -247157.208 -532990.453 -> 1.31732432E+11 Inexact Rounded +xpow273 power -247157.208 -532990 -> 1.48314033E-2874401 Inexact Rounded +xrem273 remainder -247157.208 -532990.453 -> -247157.208 +xsub273 subtract -247157.208 -532990.453 -> 285833.245 +xadd274 add 40.2490764E-339482253 7626.85442E+594264540 -> 7.62685442E+594264543 Inexact Rounded +xcom274 compare 40.2490764E-339482253 7626.85442E+594264540 -> -1 +xdiv274 divide 40.2490764E-339482253 7626.85442E+594264540 -> 5.27728395E-933746796 Inexact Rounded +xdvi274 divideint 40.2490764E-339482253 7626.85442E+594264540 -> 0 +xmul274 multiply 40.2490764E-339482253 7626.85442E+594264540 -> 3.06973846E+254782292 Inexact Rounded +xpow274 power 40.2490764E-339482253 8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem274 remainder 40.2490764E-339482253 7626.85442E+594264540 -> 4.02490764E-339482252 +xsub274 subtract 40.2490764E-339482253 7626.85442E+594264540 -> -7.62685442E+594264543 Inexact Rounded +xadd275 add -1156008.8 -8870382.36 -> -10026391.2 Inexact Rounded +xcom275 compare -1156008.8 -8870382.36 -> 1 +xdiv275 divide -1156008.8 -8870382.36 -> 0.130322319 Inexact Rounded +xdvi275 divideint -1156008.8 -8870382.36 -> 0 +xmul275 multiply -1156008.8 -8870382.36 -> 1.02542401E+13 Inexact Rounded +xpow275 power -1156008.8 -8870382 -> 4.32494996E-53780782 Inexact Rounded +xrem275 remainder -1156008.8 -8870382.36 -> -1156008.80 +xsub275 subtract -1156008.8 -8870382.36 -> 7714373.56 +xadd276 add 880097928. -52455011.1E+204538218 -> -5.24550111E+204538225 Inexact Rounded +xcom276 compare 880097928. -52455011.1E+204538218 -> 1 +xdiv276 divide 880097928. -52455011.1E+204538218 -> -1.67781478E-204538217 Inexact Rounded +xdvi276 divideint 880097928. -52455011.1E+204538218 -> -0 +xmul276 multiply 880097928. -52455011.1E+204538218 -> -4.61655466E+204538234 Inexact Rounded +xpow276 power 880097928. -5 -> 1.89384751E-45 Inexact Rounded +xrem276 remainder 880097928. -52455011.1E+204538218 -> 880097928 +xsub276 subtract 880097928. -52455011.1E+204538218 -> 5.24550111E+204538225 Inexact Rounded +xadd277 add 5796.2524 34458329.7E+832129426 -> 3.44583297E+832129433 Inexact Rounded +xcom277 compare 5796.2524 34458329.7E+832129426 -> -1 +xdiv277 divide 5796.2524 34458329.7E+832129426 -> 1.68210486E-832129430 Inexact Rounded +xdvi277 divideint 5796.2524 34458329.7E+832129426 -> 0 +xmul277 multiply 5796.2524 34458329.7E+832129426 -> 1.99729176E+832129437 Inexact Rounded +xpow277 power 5796.2524 3 -> 1.94734037E+11 Inexact Rounded +xrem277 remainder 5796.2524 34458329.7E+832129426 -> 5796.2524 +xsub277 subtract 5796.2524 34458329.7E+832129426 -> -3.44583297E+832129433 Inexact Rounded +xadd278 add 27.1000923E-218032223 -45.0198341 -> -45.0198341 Inexact Rounded +xcom278 compare 27.1000923E-218032223 -45.0198341 -> 1 +xdiv278 divide 27.1000923E-218032223 -45.0198341 -> -6.01958955E-218032224 Inexact Rounded +xdvi278 divideint 27.1000923E-218032223 -45.0198341 -> -0 +xmul278 multiply 27.1000923E-218032223 -45.0198341 -> -1.22004166E-218032220 Inexact Rounded +xpow278 power 27.1000923E-218032223 -45 -> Infinity Overflow Inexact Rounded +xrem278 remainder 27.1000923E-218032223 -45.0198341 -> 2.71000923E-218032222 +xsub278 subtract 27.1000923E-218032223 -45.0198341 -> 45.0198341 Inexact Rounded +xadd279 add 42643477.8 26118465E-730390549 -> 42643477.8 Inexact Rounded +xcom279 compare 42643477.8 26118465E-730390549 -> 1 +xdiv279 divide 42643477.8 26118465E-730390549 -> 1.63269464E+730390549 Inexact Rounded +xdvi279 divideint 42643477.8 26118465E-730390549 -> NaN Division_impossible +xmul279 multiply 42643477.8 26118465E-730390549 -> 1.11378218E-730390534 Inexact Rounded +xpow279 power 42643477.8 3 -> 7.75457230E+22 Inexact Rounded +xrem279 remainder 42643477.8 26118465E-730390549 -> NaN Division_impossible +xsub279 subtract 42643477.8 26118465E-730390549 -> 42643477.8 Inexact Rounded +xadd280 add -31918.9176E-163031657 -21.5422824E-807317258 -> -3.19189176E-163031653 Inexact Rounded +xcom280 compare -31918.9176E-163031657 -21.5422824E-807317258 -> -1 +xdiv280 divide -31918.9176E-163031657 -21.5422824E-807317258 -> 1.48168690E+644285604 Inexact Rounded +xdvi280 divideint -31918.9176E-163031657 -21.5422824E-807317258 -> NaN Division_impossible +xmul280 multiply -31918.9176E-163031657 -21.5422824E-807317258 -> 6.87606337E-970348910 Inexact Rounded +xpow280 power -31918.9176E-163031657 -2 -> 9.81530250E+326063304 Inexact Rounded +xrem280 remainder -31918.9176E-163031657 -21.5422824E-807317258 -> NaN Division_impossible +xsub280 subtract -31918.9176E-163031657 -21.5422824E-807317258 -> -3.19189176E-163031653 Inexact Rounded +xadd281 add 84224841.0 2.62548255E+647087608 -> 2.62548255E+647087608 Inexact Rounded +xcom281 compare 84224841.0 2.62548255E+647087608 -> -1 +xdiv281 divide 84224841.0 2.62548255E+647087608 -> 3.20797565E-647087601 Inexact Rounded +xdvi281 divideint 84224841.0 2.62548255E+647087608 -> 0 +xmul281 multiply 84224841.0 2.62548255E+647087608 -> 2.21130850E+647087616 Inexact Rounded +xpow281 power 84224841.0 3 -> 5.97476185E+23 Inexact Rounded +xrem281 remainder 84224841.0 2.62548255E+647087608 -> 84224841.0 +xsub281 subtract 84224841.0 2.62548255E+647087608 -> -2.62548255E+647087608 Inexact Rounded +xadd282 add -64413698.9 -6674.1055E-701047852 -> -64413698.9 Inexact Rounded +xcom282 compare -64413698.9 -6674.1055E-701047852 -> -1 +xdiv282 divide -64413698.9 -6674.1055E-701047852 -> 9.65128569E+701047855 Inexact Rounded +xdvi282 divideint -64413698.9 -6674.1055E-701047852 -> NaN Division_impossible +xmul282 multiply -64413698.9 -6674.1055E-701047852 -> 4.29903822E-701047841 Inexact Rounded +xpow282 power -64413698.9 -7 -> -2.17346338E-55 Inexact Rounded +xrem282 remainder -64413698.9 -6674.1055E-701047852 -> NaN Division_impossible +xsub282 subtract -64413698.9 -6674.1055E-701047852 -> -64413698.9 Inexact Rounded +xadd283 add -62.5059208 9.5795779E-898350012 -> -62.5059208 Inexact Rounded +xcom283 compare -62.5059208 9.5795779E-898350012 -> -1 +xdiv283 divide -62.5059208 9.5795779E-898350012 -> -6.52491388E+898350012 Inexact Rounded +xdvi283 divideint -62.5059208 9.5795779E-898350012 -> NaN Division_impossible +xmul283 multiply -62.5059208 9.5795779E-898350012 -> -5.98780338E-898350010 Inexact Rounded +xpow283 power -62.5059208 10 -> 9.10356659E+17 Inexact Rounded +xrem283 remainder -62.5059208 9.5795779E-898350012 -> NaN Division_impossible +xsub283 subtract -62.5059208 9.5795779E-898350012 -> -62.5059208 Inexact Rounded +xadd284 add 9090950.80 436.400932 -> 9091387.20 Inexact Rounded +xcom284 compare 9090950.80 436.400932 -> 1 +xdiv284 divide 9090950.80 436.400932 -> 20831.6485 Inexact Rounded +xdvi284 divideint 9090950.80 436.400932 -> 20831 +xmul284 multiply 9090950.80 436.400932 -> 3.96729940E+9 Inexact Rounded +xpow284 power 9090950.80 436 -> 8.98789557E+3033 Inexact Rounded +xrem284 remainder 9090950.80 436.400932 -> 282.985508 +xsub284 subtract 9090950.80 436.400932 -> 9090514.40 Inexact Rounded +xadd285 add -89833825.7E+329205393 -779430.194 -> -8.98338257E+329205400 Inexact Rounded +xcom285 compare -89833825.7E+329205393 -779430.194 -> -1 +xdiv285 divide -89833825.7E+329205393 -779430.194 -> 1.15255768E+329205395 Inexact Rounded +xdvi285 divideint -89833825.7E+329205393 -779430.194 -> NaN Division_impossible +xmul285 multiply -89833825.7E+329205393 -779430.194 -> 7.00191962E+329205406 Inexact Rounded +xpow285 power -89833825.7E+329205393 -779430 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem285 remainder -89833825.7E+329205393 -779430.194 -> NaN Division_impossible +xsub285 subtract -89833825.7E+329205393 -779430.194 -> -8.98338257E+329205400 Inexact Rounded +xadd286 add -714562.019E+750205688 704079764 -> -7.14562019E+750205693 Inexact Rounded +xcom286 compare -714562.019E+750205688 704079764 -> -1 +xdiv286 divide -714562.019E+750205688 704079764 -> -1.01488788E+750205685 Inexact Rounded +xdvi286 divideint -714562.019E+750205688 704079764 -> NaN Division_impossible +xmul286 multiply -714562.019E+750205688 704079764 -> -5.03108658E+750205702 Inexact Rounded +xpow286 power -714562.019E+750205688 704079764 -> Infinity Overflow Inexact Rounded +xrem286 remainder -714562.019E+750205688 704079764 -> NaN Division_impossible +xsub286 subtract -714562.019E+750205688 704079764 -> -7.14562019E+750205693 Inexact Rounded +xadd287 add -584537670. 31139.7737E-146687560 -> -584537670 Inexact Rounded +xcom287 compare -584537670. 31139.7737E-146687560 -> -1 +xdiv287 divide -584537670. 31139.7737E-146687560 -> -1.87714168E+146687564 Inexact Rounded +xdvi287 divideint -584537670. 31139.7737E-146687560 -> NaN Division_impossible +xmul287 multiply -584537670. 31139.7737E-146687560 -> -1.82023708E-146687547 Inexact Rounded +xpow287 power -584537670. 3 -> -1.99727337E+26 Inexact Rounded +xrem287 remainder -584537670. 31139.7737E-146687560 -> NaN Division_impossible +xsub287 subtract -584537670. 31139.7737E-146687560 -> -584537670 Inexact Rounded +xadd288 add -4.18074650E-858746879 571035.277E-279409165 -> 5.71035277E-279409160 Inexact Rounded +xcom288 compare -4.18074650E-858746879 571035.277E-279409165 -> -1 +xdiv288 divide -4.18074650E-858746879 571035.277E-279409165 -> -7.32134540E-579337720 Inexact Rounded +xdvi288 divideint -4.18074650E-858746879 571035.277E-279409165 -> -0 +xmul288 multiply -4.18074650E-858746879 571035.277E-279409165 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow288 power -4.18074650E-858746879 6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem288 remainder -4.18074650E-858746879 571035.277E-279409165 -> -4.18074650E-858746879 +xsub288 subtract -4.18074650E-858746879 571035.277E-279409165 -> -5.71035277E-279409160 Inexact Rounded +xadd289 add 5.15309635 -695649.219E+451948183 -> -6.95649219E+451948188 Inexact Rounded +xcom289 compare 5.15309635 -695649.219E+451948183 -> 1 +xdiv289 divide 5.15309635 -695649.219E+451948183 -> -7.40760747E-451948189 Inexact Rounded +xdvi289 divideint 5.15309635 -695649.219E+451948183 -> -0 +xmul289 multiply 5.15309635 -695649.219E+451948183 -> -3.58474745E+451948189 Inexact Rounded +xpow289 power 5.15309635 -7 -> 0.0000103638749 Inexact Rounded +xrem289 remainder 5.15309635 -695649.219E+451948183 -> 5.15309635 +xsub289 subtract 5.15309635 -695649.219E+451948183 -> 6.95649219E+451948188 Inexact Rounded +xadd290 add -940030153.E+83797657 -4.11510193 -> -9.40030153E+83797665 Inexact Rounded +xcom290 compare -940030153.E+83797657 -4.11510193 -> -1 +xdiv290 divide -940030153.E+83797657 -4.11510193 -> 2.28434233E+83797665 Inexact Rounded +xdvi290 divideint -940030153.E+83797657 -4.11510193 -> NaN Division_impossible +xmul290 multiply -940030153.E+83797657 -4.11510193 -> 3.86831990E+83797666 Inexact Rounded +xpow290 power -940030153.E+83797657 -4 -> 1.28065710E-335190664 Inexact Rounded +xrem290 remainder -940030153.E+83797657 -4.11510193 -> NaN Division_impossible +xsub290 subtract -940030153.E+83797657 -4.11510193 -> -9.40030153E+83797665 Inexact Rounded +xadd291 add 89088.9683E+587739290 1.31932110 -> 8.90889683E+587739294 Inexact Rounded +xcom291 compare 89088.9683E+587739290 1.31932110 -> 1 +xdiv291 divide 89088.9683E+587739290 1.31932110 -> 6.75263727E+587739294 Inexact Rounded +xdvi291 divideint 89088.9683E+587739290 1.31932110 -> NaN Division_impossible +xmul291 multiply 89088.9683E+587739290 1.31932110 -> 1.17536956E+587739295 Inexact Rounded +xpow291 power 89088.9683E+587739290 1 -> 8.90889683E+587739294 +xrem291 remainder 89088.9683E+587739290 1.31932110 -> NaN Division_impossible +xsub291 subtract 89088.9683E+587739290 1.31932110 -> 8.90889683E+587739294 Inexact Rounded +xadd292 add 3336750 6.47961126 -> 3336756.48 Inexact Rounded +xcom292 compare 3336750 6.47961126 -> 1 +xdiv292 divide 3336750 6.47961126 -> 514961.448 Inexact Rounded +xdvi292 divideint 3336750 6.47961126 -> 514961 +xmul292 multiply 3336750 6.47961126 -> 21620842.9 Inexact Rounded +xpow292 power 3336750 6 -> 1.38019997E+39 Inexact Rounded +xrem292 remainder 3336750 6.47961126 -> 2.90593914 +xsub292 subtract 3336750 6.47961126 -> 3336743.52 Inexact Rounded +xadd293 add 904654622. 692065270.E+329081915 -> 6.92065270E+329081923 Inexact Rounded +xcom293 compare 904654622. 692065270.E+329081915 -> -1 +xdiv293 divide 904654622. 692065270.E+329081915 -> 1.30718107E-329081915 Inexact Rounded +xdvi293 divideint 904654622. 692065270.E+329081915 -> 0 +xmul293 multiply 904654622. 692065270.E+329081915 -> 6.26080045E+329081932 Inexact Rounded +xpow293 power 904654622. 7 -> 4.95883485E+62 Inexact Rounded +xrem293 remainder 904654622. 692065270.E+329081915 -> 904654622 +xsub293 subtract 904654622. 692065270.E+329081915 -> -6.92065270E+329081923 Inexact Rounded +xadd294 add 304804380 -4681.23698 -> 304799699 Inexact Rounded +xcom294 compare 304804380 -4681.23698 -> 1 +xdiv294 divide 304804380 -4681.23698 -> -65111.9312 Inexact Rounded +xdvi294 divideint 304804380 -4681.23698 -> -65111 +xmul294 multiply 304804380 -4681.23698 -> -1.42686154E+12 Inexact Rounded +xpow294 power 304804380 -4681 -> 1.98037102E-39714 Inexact Rounded +xrem294 remainder 304804380 -4681.23698 -> 4358.99522 +xsub294 subtract 304804380 -4681.23698 -> 304809061 Inexact Rounded +xadd295 add 674.55569 -82981.2684E+852890752 -> -8.29812684E+852890756 Inexact Rounded +xcom295 compare 674.55569 -82981.2684E+852890752 -> 1 +xdiv295 divide 674.55569 -82981.2684E+852890752 -> -8.12901156E-852890755 Inexact Rounded +xdvi295 divideint 674.55569 -82981.2684E+852890752 -> -0 +xmul295 multiply 674.55569 -82981.2684E+852890752 -> -5.59754868E+852890759 Inexact Rounded +xpow295 power 674.55569 -8 -> 2.33269265E-23 Inexact Rounded +xrem295 remainder 674.55569 -82981.2684E+852890752 -> 674.55569 +xsub295 subtract 674.55569 -82981.2684E+852890752 -> 8.29812684E+852890756 Inexact Rounded +xadd296 add -5111.51025E-108006096 5448870.4E+279212255 -> 5.44887040E+279212261 Inexact Rounded +xcom296 compare -5111.51025E-108006096 5448870.4E+279212255 -> -1 +xdiv296 divide -5111.51025E-108006096 5448870.4E+279212255 -> -9.38086222E-387218355 Inexact Rounded +xdvi296 divideint -5111.51025E-108006096 5448870.4E+279212255 -> -0 +xmul296 multiply -5111.51025E-108006096 5448870.4E+279212255 -> -2.78519569E+171206169 Inexact Rounded +xpow296 power -5111.51025E-108006096 5 -> -3.48936323E-540030462 Inexact Rounded +xrem296 remainder -5111.51025E-108006096 5448870.4E+279212255 -> -5.11151025E-108006093 +xsub296 subtract -5111.51025E-108006096 5448870.4E+279212255 -> -5.44887040E+279212261 Inexact Rounded +xadd297 add -2623.45068 -466463938. -> -466466561 Inexact Rounded +xcom297 compare -2623.45068 -466463938. -> 1 +xdiv297 divide -2623.45068 -466463938. -> 0.00000562412325 Inexact Rounded +xdvi297 divideint -2623.45068 -466463938. -> 0 +xmul297 multiply -2623.45068 -466463938. -> 1.22374514E+12 Inexact Rounded +xpow297 power -2623.45068 -466463938 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem297 remainder -2623.45068 -466463938. -> -2623.45068 +xsub297 subtract -2623.45068 -466463938. -> 466461315 Inexact Rounded +xadd298 add 299350.435 3373.33551 -> 302723.771 Inexact Rounded +xcom298 compare 299350.435 3373.33551 -> 1 +xdiv298 divide 299350.435 3373.33551 -> 88.7401903 Inexact Rounded +xdvi298 divideint 299350.435 3373.33551 -> 88 +xmul298 multiply 299350.435 3373.33551 -> 1.00980945E+9 Inexact Rounded +xpow298 power 299350.435 3373 -> 1.42817370E+18471 Inexact Rounded +xrem298 remainder 299350.435 3373.33551 -> 2496.91012 +xsub298 subtract 299350.435 3373.33551 -> 295977.099 Inexact Rounded +xadd299 add -6589947.80 -2448.75933E-591549734 -> -6589947.80 Inexact Rounded +xcom299 compare -6589947.80 -2448.75933E-591549734 -> -1 +xdiv299 divide -6589947.80 -2448.75933E-591549734 -> 2.69113739E+591549737 Inexact Rounded +xdvi299 divideint -6589947.80 -2448.75933E-591549734 -> NaN Division_impossible +xmul299 multiply -6589947.80 -2448.75933E-591549734 -> 1.61371962E-591549724 Inexact Rounded +xpow299 power -6589947.80 -2 -> 2.30269305E-14 Inexact Rounded +xrem299 remainder -6589947.80 -2448.75933E-591549734 -> NaN Division_impossible +xsub299 subtract -6589947.80 -2448.75933E-591549734 -> -6589947.80 Inexact Rounded +xadd300 add 3774.5358E-491090520 173.060090 -> 173.060090 Inexact Rounded +xcom300 compare 3774.5358E-491090520 173.060090 -> -1 +xdiv300 divide 3774.5358E-491090520 173.060090 -> 2.18105503E-491090519 Inexact Rounded +xdvi300 divideint 3774.5358E-491090520 173.060090 -> 0 +xmul300 multiply 3774.5358E-491090520 173.060090 -> 6.53221505E-491090515 Inexact Rounded +xpow300 power 3774.5358E-491090520 173 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem300 remainder 3774.5358E-491090520 173.060090 -> 3.7745358E-491090517 +xsub300 subtract 3774.5358E-491090520 173.060090 -> -173.060090 Inexact Rounded +xadd301 add -13.6783690 -453.610117 -> -467.288486 Rounded +xcom301 compare -13.6783690 -453.610117 -> 1 +xdiv301 divide -13.6783690 -453.610117 -> 0.0301544619 Inexact Rounded +xdvi301 divideint -13.6783690 -453.610117 -> 0 +xmul301 multiply -13.6783690 -453.610117 -> 6204.64656 Inexact Rounded +xpow301 power -13.6783690 -454 -> 1.73948535E-516 Inexact Rounded +xrem301 remainder -13.6783690 -453.610117 -> -13.6783690 +xsub301 subtract -13.6783690 -453.610117 -> 439.931748 Rounded +xadd302 add -990100927.E-615244634 223801.421E+247632618 -> 2.23801421E+247632623 Inexact Rounded +xcom302 compare -990100927.E-615244634 223801.421E+247632618 -> -1 +xdiv302 divide -990100927.E-615244634 223801.421E+247632618 -> -4.42401537E-862877249 Inexact Rounded +xdvi302 divideint -990100927.E-615244634 223801.421E+247632618 -> -0 +xmul302 multiply -990100927.E-615244634 223801.421E+247632618 -> -2.21585994E-367612002 Inexact Rounded +xpow302 power -990100927.E-615244634 2 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem302 remainder -990100927.E-615244634 223801.421E+247632618 -> -9.90100927E-615244626 +xsub302 subtract -990100927.E-615244634 223801.421E+247632618 -> -2.23801421E+247632623 Inexact Rounded +xadd303 add 1275.10292 -667965353 -> -667964078 Inexact Rounded +xcom303 compare 1275.10292 -667965353 -> 1 +xdiv303 divide 1275.10292 -667965353 -> -0.00000190893572 Inexact Rounded +xdvi303 divideint 1275.10292 -667965353 -> -0 +xmul303 multiply 1275.10292 -667965353 -> -8.51724572E+11 Inexact Rounded +xpow303 power 1275.10292 -667965353 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem303 remainder 1275.10292 -667965353 -> 1275.10292 +xsub303 subtract 1275.10292 -667965353 -> 667966628 Inexact Rounded +xadd304 add -8.76375480E-596792197 992.077361 -> 992.077361 Inexact Rounded +xcom304 compare -8.76375480E-596792197 992.077361 -> -1 +xdiv304 divide -8.76375480E-596792197 992.077361 -> -8.83374134E-596792200 Inexact Rounded +xdvi304 divideint -8.76375480E-596792197 992.077361 -> -0 +xmul304 multiply -8.76375480E-596792197 992.077361 -> -8.69432273E-596792194 Inexact Rounded +xpow304 power -8.76375480E-596792197 992 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem304 remainder -8.76375480E-596792197 992.077361 -> -8.76375480E-596792197 +xsub304 subtract -8.76375480E-596792197 992.077361 -> -992.077361 Inexact Rounded +xadd305 add 953.976935E+385444720 96503.3378 -> 9.53976935E+385444722 Inexact Rounded +xcom305 compare 953.976935E+385444720 96503.3378 -> 1 +xdiv305 divide 953.976935E+385444720 96503.3378 -> 9.88542942E+385444717 Inexact Rounded +xdvi305 divideint 953.976935E+385444720 96503.3378 -> NaN Division_impossible +xmul305 multiply 953.976935E+385444720 96503.3378 -> 9.20619584E+385444727 Inexact Rounded +xpow305 power 953.976935E+385444720 96503 -> Infinity Overflow Inexact Rounded +xrem305 remainder 953.976935E+385444720 96503.3378 -> NaN Division_impossible +xsub305 subtract 953.976935E+385444720 96503.3378 -> 9.53976935E+385444722 Inexact Rounded +xadd306 add 213577152 -986710073E+31900046 -> -9.86710073E+31900054 Inexact Rounded +xcom306 compare 213577152 -986710073E+31900046 -> 1 +xdiv306 divide 213577152 -986710073E+31900046 -> -2.16453807E-31900047 Inexact Rounded +xdvi306 divideint 213577152 -986710073E+31900046 -> -0 +xmul306 multiply 213577152 -986710073E+31900046 -> -2.10738727E+31900063 Inexact Rounded +xpow306 power 213577152 -10 -> 5.06351487E-84 Inexact Rounded +xrem306 remainder 213577152 -986710073E+31900046 -> 213577152 +xsub306 subtract 213577152 -986710073E+31900046 -> 9.86710073E+31900054 Inexact Rounded +xadd307 add 91393.9398E-323439228 -135.701000 -> -135.701000 Inexact Rounded +xcom307 compare 91393.9398E-323439228 -135.701000 -> 1 +xdiv307 divide 91393.9398E-323439228 -135.701000 -> -6.73494962E-323439226 Inexact Rounded +xdvi307 divideint 91393.9398E-323439228 -135.701000 -> -0 +xmul307 multiply 91393.9398E-323439228 -135.701000 -> -1.24022490E-323439221 Inexact Rounded +xpow307 power 91393.9398E-323439228 -136 -> Infinity Overflow Inexact Rounded +xrem307 remainder 91393.9398E-323439228 -135.701000 -> 9.13939398E-323439224 +xsub307 subtract 91393.9398E-323439228 -135.701000 -> 135.701000 Inexact Rounded +xadd308 add -396.503557 45757264.E-254363788 -> -396.503557 Inexact Rounded +xcom308 compare -396.503557 45757264.E-254363788 -> -1 +xdiv308 divide -396.503557 45757264.E-254363788 -> -8.66536856E+254363782 Inexact Rounded +xdvi308 divideint -396.503557 45757264.E-254363788 -> NaN Division_impossible +xmul308 multiply -396.503557 45757264.E-254363788 -> -1.81429179E-254363778 Inexact Rounded +xpow308 power -396.503557 5 -> -9.80021128E+12 Inexact Rounded +xrem308 remainder -396.503557 45757264.E-254363788 -> NaN Division_impossible +xsub308 subtract -396.503557 45757264.E-254363788 -> -396.503557 Inexact Rounded +xadd309 add 59807846.1 1.53345254 -> 59807847.6 Inexact Rounded +xcom309 compare 59807846.1 1.53345254 -> 1 +xdiv309 divide 59807846.1 1.53345254 -> 39002084.9 Inexact Rounded +xdvi309 divideint 59807846.1 1.53345254 -> 39002084 +xmul309 multiply 59807846.1 1.53345254 -> 91712493.5 Inexact Rounded +xpow309 power 59807846.1 2 -> 3.57697846E+15 Inexact Rounded +xrem309 remainder 59807846.1 1.53345254 -> 1.32490664 +xsub309 subtract 59807846.1 1.53345254 -> 59807844.6 Inexact Rounded +xadd310 add -8046158.45 8.3635397 -> -8046150.09 Inexact Rounded +xcom310 compare -8046158.45 8.3635397 -> -1 +xdiv310 divide -8046158.45 8.3635397 -> -962051.803 Inexact Rounded +xdvi310 divideint -8046158.45 8.3635397 -> -962051 +xmul310 multiply -8046158.45 8.3635397 -> -67294365.6 Inexact Rounded +xpow310 power -8046158.45 8 -> 1.75674467E+55 Inexact Rounded +xrem310 remainder -8046158.45 8.3635397 -> -6.7180753 +xsub310 subtract -8046158.45 8.3635397 -> -8046166.81 Inexact Rounded +xadd311 add 55.1123381E+50627250 -94.0355047E-162540316 -> 5.51123381E+50627251 Inexact Rounded +xcom311 compare 55.1123381E+50627250 -94.0355047E-162540316 -> 1 +xdiv311 divide 55.1123381E+50627250 -94.0355047E-162540316 -> -5.86080101E+213167565 Inexact Rounded +xdvi311 divideint 55.1123381E+50627250 -94.0355047E-162540316 -> NaN Division_impossible +xmul311 multiply 55.1123381E+50627250 -94.0355047E-162540316 -> -5.18251653E-111913063 Inexact Rounded +xpow311 power 55.1123381E+50627250 -9 -> 2.13186881E-455645266 Inexact Rounded +xrem311 remainder 55.1123381E+50627250 -94.0355047E-162540316 -> NaN Division_impossible +xsub311 subtract 55.1123381E+50627250 -94.0355047E-162540316 -> 5.51123381E+50627251 Inexact Rounded +xadd312 add -948.038054 3580.84510 -> 2632.80705 Inexact Rounded +xcom312 compare -948.038054 3580.84510 -> -1 +xdiv312 divide -948.038054 3580.84510 -> -0.264752601 Inexact Rounded +xdvi312 divideint -948.038054 3580.84510 -> -0 +xmul312 multiply -948.038054 3580.84510 -> -3394777.42 Inexact Rounded +xpow312 power -948.038054 3581 -> -1.03058288E+10660 Inexact Rounded +xrem312 remainder -948.038054 3580.84510 -> -948.038054 +xsub312 subtract -948.038054 3580.84510 -> -4528.88315 Inexact Rounded +xadd313 add -6026.42752 -14.2286406E-334921364 -> -6026.42752 Inexact Rounded +xcom313 compare -6026.42752 -14.2286406E-334921364 -> -1 +xdiv313 divide -6026.42752 -14.2286406E-334921364 -> 4.23542044E+334921366 Inexact Rounded +xdvi313 divideint -6026.42752 -14.2286406E-334921364 -> NaN Division_impossible +xmul313 multiply -6026.42752 -14.2286406E-334921364 -> 8.57478713E-334921360 Inexact Rounded +xpow313 power -6026.42752 -1 -> -0.000165935788 Inexact Rounded +xrem313 remainder -6026.42752 -14.2286406E-334921364 -> NaN Division_impossible +xsub313 subtract -6026.42752 -14.2286406E-334921364 -> -6026.42752 Inexact Rounded +xadd314 add 79551.5014 -538.186229 -> 79013.3152 Inexact Rounded +xcom314 compare 79551.5014 -538.186229 -> 1 +xdiv314 divide 79551.5014 -538.186229 -> -147.814078 Inexact Rounded +xdvi314 divideint 79551.5014 -538.186229 -> -147 +xmul314 multiply 79551.5014 -538.186229 -> -42813522.5 Inexact Rounded +xpow314 power 79551.5014 -538 -> 2.82599389E-2637 Inexact Rounded +xrem314 remainder 79551.5014 -538.186229 -> 438.125737 +xsub314 subtract 79551.5014 -538.186229 -> 80089.6876 Inexact Rounded +xadd315 add 42706056.E+623578292 -690.327745 -> 4.27060560E+623578299 Inexact Rounded +xcom315 compare 42706056.E+623578292 -690.327745 -> 1 +xdiv315 divide 42706056.E+623578292 -690.327745 -> -6.18634501E+623578296 Inexact Rounded +xdvi315 divideint 42706056.E+623578292 -690.327745 -> NaN Division_impossible +xmul315 multiply 42706056.E+623578292 -690.327745 -> -2.94811753E+623578302 Inexact Rounded +xpow315 power 42706056.E+623578292 -690 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem315 remainder 42706056.E+623578292 -690.327745 -> NaN Division_impossible +xsub315 subtract 42706056.E+623578292 -690.327745 -> 4.27060560E+623578299 Inexact Rounded +xadd316 add 2454136.08E+502374077 856268.795E-356664934 -> 2.45413608E+502374083 Inexact Rounded +xcom316 compare 2454136.08E+502374077 856268.795E-356664934 -> 1 +xdiv316 divide 2454136.08E+502374077 856268.795E-356664934 -> 2.86608142E+859039011 Inexact Rounded +xdvi316 divideint 2454136.08E+502374077 856268.795E-356664934 -> NaN Division_impossible +xmul316 multiply 2454136.08E+502374077 856268.795E-356664934 -> 2.10140014E+145709155 Inexact Rounded +xpow316 power 2454136.08E+502374077 9 -> Infinity Overflow Inexact Rounded +xrem316 remainder 2454136.08E+502374077 856268.795E-356664934 -> NaN Division_impossible +xsub316 subtract 2454136.08E+502374077 856268.795E-356664934 -> 2.45413608E+502374083 Inexact Rounded +xadd317 add -3264204.54 -42704.501 -> -3306909.04 Inexact Rounded +xcom317 compare -3264204.54 -42704.501 -> -1 +xdiv317 divide -3264204.54 -42704.501 -> 76.4370140 Inexact Rounded +xdvi317 divideint -3264204.54 -42704.501 -> 76 +xmul317 multiply -3264204.54 -42704.501 -> 1.39396226E+11 Inexact Rounded +xpow317 power -3264204.54 -42705 -> -1.37293410E-278171 Inexact Rounded +xrem317 remainder -3264204.54 -42704.501 -> -18662.464 +xsub317 subtract -3264204.54 -42704.501 -> -3221500.04 Inexact Rounded +xadd318 add 1.21265492 44102.6073 -> 44103.8200 Inexact Rounded +xcom318 compare 1.21265492 44102.6073 -> -1 +xdiv318 divide 1.21265492 44102.6073 -> 0.0000274962183 Inexact Rounded +xdvi318 divideint 1.21265492 44102.6073 -> 0 +xmul318 multiply 1.21265492 44102.6073 -> 53481.2437 Inexact Rounded +xpow318 power 1.21265492 44103 -> 1.15662573E+3693 Inexact Rounded +xrem318 remainder 1.21265492 44102.6073 -> 1.21265492 +xsub318 subtract 1.21265492 44102.6073 -> -44101.3946 Inexact Rounded +xadd319 add -19.054711E+975514652 -22144.0822 -> -1.90547110E+975514653 Inexact Rounded +xcom319 compare -19.054711E+975514652 -22144.0822 -> -1 +xdiv319 divide -19.054711E+975514652 -22144.0822 -> 8.60487729E+975514648 Inexact Rounded +xdvi319 divideint -19.054711E+975514652 -22144.0822 -> NaN Division_impossible +xmul319 multiply -19.054711E+975514652 -22144.0822 -> 4.21949087E+975514657 Inexact Rounded +xpow319 power -19.054711E+975514652 -22144 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem319 remainder -19.054711E+975514652 -22144.0822 -> NaN Division_impossible +xsub319 subtract -19.054711E+975514652 -22144.0822 -> -1.90547110E+975514653 Inexact Rounded +xadd320 add 745.78452 -1922.00670E+375923302 -> -1.92200670E+375923305 Inexact Rounded +xcom320 compare 745.78452 -1922.00670E+375923302 -> 1 +xdiv320 divide 745.78452 -1922.00670E+375923302 -> -3.88023892E-375923303 Inexact Rounded +xdvi320 divideint 745.78452 -1922.00670E+375923302 -> -0 +xmul320 multiply 745.78452 -1922.00670E+375923302 -> -1.43340284E+375923308 Inexact Rounded +xpow320 power 745.78452 -2 -> 0.00000179793204 Inexact Rounded +xrem320 remainder 745.78452 -1922.00670E+375923302 -> 745.78452 +xsub320 subtract 745.78452 -1922.00670E+375923302 -> 1.92200670E+375923305 Inexact Rounded +xadd321 add -963717836 -823989308 -> -1.78770714E+9 Inexact Rounded +xcom321 compare -963717836 -823989308 -> -1 +xdiv321 divide -963717836 -823989308 -> 1.16957566 Inexact Rounded +xdvi321 divideint -963717836 -823989308 -> 1 +xmul321 multiply -963717836 -823989308 -> 7.94093193E+17 Inexact Rounded +xpow321 power -963717836 -823989308 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem321 remainder -963717836 -823989308 -> -139728528 +xsub321 subtract -963717836 -823989308 -> -139728528 +xadd322 add 82.4185291E-321919303 -215747737.E-995147400 -> 8.24185291E-321919302 Inexact Rounded +xcom322 compare 82.4185291E-321919303 -215747737.E-995147400 -> 1 +xdiv322 divide 82.4185291E-321919303 -215747737.E-995147400 -> -3.82013412E+673228090 Inexact Rounded +xdvi322 divideint 82.4185291E-321919303 -215747737.E-995147400 -> NaN Division_impossible +xmul322 multiply 82.4185291E-321919303 -215747737.E-995147400 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow322 power 82.4185291E-321919303 -2 -> 1.47214396E+643838602 Inexact Rounded +xrem322 remainder 82.4185291E-321919303 -215747737.E-995147400 -> NaN Division_impossible +xsub322 subtract 82.4185291E-321919303 -215747737.E-995147400 -> 8.24185291E-321919302 Inexact Rounded +xadd323 add -808328.607E-790810342 53075.7082 -> 53075.7082 Inexact Rounded +xcom323 compare -808328.607E-790810342 53075.7082 -> -1 +xdiv323 divide -808328.607E-790810342 53075.7082 -> -1.52297281E-790810341 Inexact Rounded +xdvi323 divideint -808328.607E-790810342 53075.7082 -> -0 +xmul323 multiply -808328.607E-790810342 53075.7082 -> -4.29026133E-790810332 Inexact Rounded +xpow323 power -808328.607E-790810342 53076 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem323 remainder -808328.607E-790810342 53075.7082 -> -8.08328607E-790810337 +xsub323 subtract -808328.607E-790810342 53075.7082 -> -53075.7082 Inexact Rounded +xadd324 add 700592.720 -698485.085 -> 2107.635 +xcom324 compare 700592.720 -698485.085 -> 1 +xdiv324 divide 700592.720 -698485.085 -> -1.00301744 Inexact Rounded +xdvi324 divideint 700592.720 -698485.085 -> -1 +xmul324 multiply 700592.720 -698485.085 -> -4.89353566E+11 Inexact Rounded +xpow324 power 700592.720 -698485 -> 8.83690000E-4082971 Inexact Rounded +xrem324 remainder 700592.720 -698485.085 -> 2107.635 +xsub324 subtract 700592.720 -698485.085 -> 1399077.81 Inexact Rounded +xadd325 add -80273928.0 661346.239 -> -79612581.8 Inexact Rounded +xcom325 compare -80273928.0 661346.239 -> -1 +xdiv325 divide -80273928.0 661346.239 -> -121.379579 Inexact Rounded +xdvi325 divideint -80273928.0 661346.239 -> -121 +xmul325 multiply -80273928.0 661346.239 -> -5.30888604E+13 Inexact Rounded +xpow325 power -80273928.0 661346 -> 5.45664856E+5227658 Inexact Rounded +xrem325 remainder -80273928.0 661346.239 -> -251033.081 +xsub325 subtract -80273928.0 661346.239 -> -80935274.2 Inexact Rounded +xadd326 add -24018251.0E+819786764 59141.9600E-167165065 -> -2.40182510E+819786771 Inexact Rounded +xcom326 compare -24018251.0E+819786764 59141.9600E-167165065 -> -1 +xdiv326 divide -24018251.0E+819786764 59141.9600E-167165065 -> -4.06111854E+986951831 Inexact Rounded +xdvi326 divideint -24018251.0E+819786764 59141.9600E-167165065 -> NaN Division_impossible +xmul326 multiply -24018251.0E+819786764 59141.9600E-167165065 -> -1.42048644E+652621711 Inexact Rounded +xpow326 power -24018251.0E+819786764 6 -> Infinity Overflow Inexact Rounded +xrem326 remainder -24018251.0E+819786764 59141.9600E-167165065 -> NaN Division_impossible +xsub326 subtract -24018251.0E+819786764 59141.9600E-167165065 -> -2.40182510E+819786771 Inexact Rounded +xadd327 add 2512953.3 -3769170.35E-993621645 -> 2512953.30 Inexact Rounded +xcom327 compare 2512953.3 -3769170.35E-993621645 -> 1 +xdiv327 divide 2512953.3 -3769170.35E-993621645 -> -6.66712583E+993621644 Inexact Rounded +xdvi327 divideint 2512953.3 -3769170.35E-993621645 -> NaN Division_impossible +xmul327 multiply 2512953.3 -3769170.35E-993621645 -> -9.47174907E-993621633 Inexact Rounded +xpow327 power 2512953.3 -4 -> 2.50762348E-26 Inexact Rounded +xrem327 remainder 2512953.3 -3769170.35E-993621645 -> NaN Division_impossible +xsub327 subtract 2512953.3 -3769170.35E-993621645 -> 2512953.30 Inexact Rounded +xadd328 add -682.796370 71131.0224 -> 70448.2260 Inexact Rounded +xcom328 compare -682.796370 71131.0224 -> -1 +xdiv328 divide -682.796370 71131.0224 -> -0.00959913617 Inexact Rounded +xdvi328 divideint -682.796370 71131.0224 -> -0 +xmul328 multiply -682.796370 71131.0224 -> -48568003.9 Inexact Rounded +xpow328 power -682.796370 71131 -> -9.28114741E+201605 Inexact Rounded +xrem328 remainder -682.796370 71131.0224 -> -682.796370 +xsub328 subtract -682.796370 71131.0224 -> -71813.8188 Inexact Rounded +xadd329 add 89.9997490 -4993.69831 -> -4903.69856 Inexact Rounded +xcom329 compare 89.9997490 -4993.69831 -> 1 +xdiv329 divide 89.9997490 -4993.69831 -> -0.0180226644 Inexact Rounded +xdvi329 divideint 89.9997490 -4993.69831 -> -0 +xmul329 multiply 89.9997490 -4993.69831 -> -449431.594 Inexact Rounded +xpow329 power 89.9997490 -4994 -> 3.30336525E-9760 Inexact Rounded +xrem329 remainder 89.9997490 -4993.69831 -> 89.9997490 +xsub329 subtract 89.9997490 -4993.69831 -> 5083.69806 Inexact Rounded +xadd330 add 76563354.6E-112338836 278271.585E-511481095 -> 7.65633546E-112338829 Inexact Rounded +xcom330 compare 76563354.6E-112338836 278271.585E-511481095 -> 1 +xdiv330 divide 76563354.6E-112338836 278271.585E-511481095 -> 2.75138960E+399142261 Inexact Rounded +xdvi330 divideint 76563354.6E-112338836 278271.585E-511481095 -> NaN Division_impossible +xmul330 multiply 76563354.6E-112338836 278271.585E-511481095 -> 2.13054060E-623819918 Inexact Rounded +xpow330 power 76563354.6E-112338836 3 -> 4.48810347E-337016485 Inexact Rounded +xrem330 remainder 76563354.6E-112338836 278271.585E-511481095 -> NaN Division_impossible +xsub330 subtract 76563354.6E-112338836 278271.585E-511481095 -> 7.65633546E-112338829 Inexact Rounded +xadd331 add -932499.010 873.377701E-502190452 -> -932499.010 Inexact Rounded +xcom331 compare -932499.010 873.377701E-502190452 -> -1 +xdiv331 divide -932499.010 873.377701E-502190452 -> -1.06769272E+502190455 Inexact Rounded +xdvi331 divideint -932499.010 873.377701E-502190452 -> NaN Division_impossible +xmul331 multiply -932499.010 873.377701E-502190452 -> -8.14423842E-502190444 Inexact Rounded +xpow331 power -932499.010 9 -> -5.33132815E+53 Inexact Rounded +xrem331 remainder -932499.010 873.377701E-502190452 -> NaN Division_impossible +xsub331 subtract -932499.010 873.377701E-502190452 -> -932499.010 Inexact Rounded +xadd332 add -7735918.21E+799514797 -7748.78023 -> -7.73591821E+799514803 Inexact Rounded +xcom332 compare -7735918.21E+799514797 -7748.78023 -> -1 +xdiv332 divide -7735918.21E+799514797 -7748.78023 -> 9.98340123E+799514799 Inexact Rounded +xdvi332 divideint -7735918.21E+799514797 -7748.78023 -> NaN Division_impossible +xmul332 multiply -7735918.21E+799514797 -7748.78023 -> 5.99439301E+799514807 Inexact Rounded +xpow332 power -7735918.21E+799514797 -7749 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem332 remainder -7735918.21E+799514797 -7748.78023 -> NaN Division_impossible +xsub332 subtract -7735918.21E+799514797 -7748.78023 -> -7.73591821E+799514803 Inexact Rounded +xadd333 add -3708780.75E+445232787 980.006567E-780728623 -> -3.70878075E+445232793 Inexact Rounded +xcom333 compare -3708780.75E+445232787 980.006567E-780728623 -> -1 +xdiv333 divide -3708780.75E+445232787 980.006567E-780728623 -> -Infinity Inexact Overflow Rounded +xdvi333 divideint -3708780.75E+445232787 980.006567E-780728623 -> NaN Division_impossible +xmul333 multiply -3708780.75E+445232787 980.006567E-780728623 -> -3.63462949E-335495827 Inexact Rounded +xpow333 power -3708780.75E+445232787 10 -> Infinity Overflow Inexact Rounded +xrem333 remainder -3708780.75E+445232787 980.006567E-780728623 -> NaN Division_impossible +xsub333 subtract -3708780.75E+445232787 980.006567E-780728623 -> -3.70878075E+445232793 Inexact Rounded +xadd334 add -5205124.44E-140588661 -495394029.E-620856313 -> -5.20512444E-140588655 Inexact Rounded +xcom334 compare -5205124.44E-140588661 -495394029.E-620856313 -> -1 +xdiv334 divide -5205124.44E-140588661 -495394029.E-620856313 -> 1.05070391E+480267650 Inexact Rounded +xdvi334 divideint -5205124.44E-140588661 -495394029.E-620856313 -> NaN Division_impossible +xmul334 multiply -5205124.44E-140588661 -495394029.E-620856313 -> 2.57858757E-761444959 Inexact Rounded +xpow334 power -5205124.44E-140588661 -5 -> -2.61724523E+702943271 Inexact Rounded +xrem334 remainder -5205124.44E-140588661 -495394029.E-620856313 -> NaN Division_impossible +xsub334 subtract -5205124.44E-140588661 -495394029.E-620856313 -> -5.20512444E-140588655 Inexact Rounded +xadd335 add -8868.72074 5592399.93 -> 5583531.21 Inexact Rounded +xcom335 compare -8868.72074 5592399.93 -> -1 +xdiv335 divide -8868.72074 5592399.93 -> -0.00158585238 Inexact Rounded +xdvi335 divideint -8868.72074 5592399.93 -> -0 +xmul335 multiply -8868.72074 5592399.93 -> -4.95974332E+10 Inexact Rounded +xpow335 power -8868.72074 5592400 -> 5.55074142E+22078017 Inexact Rounded +xrem335 remainder -8868.72074 5592399.93 -> -8868.72074 +xsub335 subtract -8868.72074 5592399.93 -> -5601268.65 Inexact Rounded +xadd336 add -74.7852037E-175205809 4.14316542 -> 4.14316542 Inexact Rounded +xcom336 compare -74.7852037E-175205809 4.14316542 -> -1 +xdiv336 divide -74.7852037E-175205809 4.14316542 -> -1.80502577E-175205808 Inexact Rounded +xdvi336 divideint -74.7852037E-175205809 4.14316542 -> -0 +xmul336 multiply -74.7852037E-175205809 4.14316542 -> -3.09847470E-175205807 Inexact Rounded +xpow336 power -74.7852037E-175205809 4 -> 3.12797104E-700823229 Inexact Rounded +xrem336 remainder -74.7852037E-175205809 4.14316542 -> -7.47852037E-175205808 +xsub336 subtract -74.7852037E-175205809 4.14316542 -> -4.14316542 Inexact Rounded +xadd337 add 84196.1091E+242628748 8.07523036E-288231467 -> 8.41961091E+242628752 Inexact Rounded +xcom337 compare 84196.1091E+242628748 8.07523036E-288231467 -> 1 +xdiv337 divide 84196.1091E+242628748 8.07523036E-288231467 -> 1.04264653E+530860219 Inexact Rounded +xdvi337 divideint 84196.1091E+242628748 8.07523036E-288231467 -> NaN Division_impossible +xmul337 multiply 84196.1091E+242628748 8.07523036E-288231467 -> 6.79902976E-45602714 Inexact Rounded +xpow337 power 84196.1091E+242628748 8 -> Infinity Overflow Inexact Rounded +xrem337 remainder 84196.1091E+242628748 8.07523036E-288231467 -> NaN Division_impossible +xsub337 subtract 84196.1091E+242628748 8.07523036E-288231467 -> 8.41961091E+242628752 Inexact Rounded +xadd338 add 38660103.1 -6671.73085E+900998477 -> -6.67173085E+900998480 Inexact Rounded +xcom338 compare 38660103.1 -6671.73085E+900998477 -> 1 +xdiv338 divide 38660103.1 -6671.73085E+900998477 -> -5.79461372E-900998474 Inexact Rounded +xdvi338 divideint 38660103.1 -6671.73085E+900998477 -> -0 +xmul338 multiply 38660103.1 -6671.73085E+900998477 -> -2.57929803E+900998488 Inexact Rounded +xpow338 power 38660103.1 -7 -> 7.74745290E-54 Inexact Rounded +xrem338 remainder 38660103.1 -6671.73085E+900998477 -> 38660103.1 +xsub338 subtract 38660103.1 -6671.73085E+900998477 -> 6.67173085E+900998480 Inexact Rounded +xadd339 add -52.2659460 -296404199E+372050476 -> -2.96404199E+372050484 Inexact Rounded +xcom339 compare -52.2659460 -296404199E+372050476 -> 1 +xdiv339 divide -52.2659460 -296404199E+372050476 -> 1.76333352E-372050483 Inexact Rounded +xdvi339 divideint -52.2659460 -296404199E+372050476 -> 0 +xmul339 multiply -52.2659460 -296404199E+372050476 -> 1.54918459E+372050486 Inexact Rounded +xpow339 power -52.2659460 -3 -> -0.00000700395833 Inexact Rounded +xrem339 remainder -52.2659460 -296404199E+372050476 -> -52.2659460 +xsub339 subtract -52.2659460 -296404199E+372050476 -> 2.96404199E+372050484 Inexact Rounded +xadd340 add 6.06625013 -276.359186 -> -270.292936 Inexact Rounded +xcom340 compare 6.06625013 -276.359186 -> 1 +xdiv340 divide 6.06625013 -276.359186 -> -0.0219506007 Inexact Rounded +xdvi340 divideint 6.06625013 -276.359186 -> -0 +xmul340 multiply 6.06625013 -276.359186 -> -1676.46395 Inexact Rounded +xpow340 power 6.06625013 -276 -> 8.20339149E-217 Inexact Rounded +xrem340 remainder 6.06625013 -276.359186 -> 6.06625013 +xsub340 subtract 6.06625013 -276.359186 -> 282.425436 Inexact Rounded +xadd341 add -62971617.5E-241444744 46266799.3 -> 46266799.3 Inexact Rounded +xcom341 compare -62971617.5E-241444744 46266799.3 -> -1 +xdiv341 divide -62971617.5E-241444744 46266799.3 -> -1.36105411E-241444744 Inexact Rounded +xdvi341 divideint -62971617.5E-241444744 46266799.3 -> -0 +xmul341 multiply -62971617.5E-241444744 46266799.3 -> -2.91349519E-241444729 Inexact Rounded +xpow341 power -62971617.5E-241444744 46266799 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem341 remainder -62971617.5E-241444744 46266799.3 -> -6.29716175E-241444737 +xsub341 subtract -62971617.5E-241444744 46266799.3 -> -46266799.3 Inexact Rounded +xadd342 add -5.36917800 -311124593.E-976066491 -> -5.36917800 Inexact Rounded +xcom342 compare -5.36917800 -311124593.E-976066491 -> -1 +xdiv342 divide -5.36917800 -311124593.E-976066491 -> 1.72573243E+976066483 Inexact Rounded +xdvi342 divideint -5.36917800 -311124593.E-976066491 -> NaN Division_impossible +xmul342 multiply -5.36917800 -311124593.E-976066491 -> 1.67048332E-976066482 Inexact Rounded +xpow342 power -5.36917800 -3 -> -0.00646065565 Inexact Rounded +xrem342 remainder -5.36917800 -311124593.E-976066491 -> NaN Division_impossible +xsub342 subtract -5.36917800 -311124593.E-976066491 -> -5.36917800 Inexact Rounded +xadd343 add 2467915.01 -92.5558322 -> 2467822.45 Inexact Rounded +xcom343 compare 2467915.01 -92.5558322 -> 1 +xdiv343 divide 2467915.01 -92.5558322 -> -26664.0681 Inexact Rounded +xdvi343 divideint 2467915.01 -92.5558322 -> -26664 +xmul343 multiply 2467915.01 -92.5558322 -> -228419928 Inexact Rounded +xpow343 power 2467915.01 -93 -> 3.26055444E-595 Inexact Rounded +xrem343 remainder 2467915.01 -92.5558322 -> 6.3002192 +xsub343 subtract 2467915.01 -92.5558322 -> 2468007.57 Inexact Rounded +xadd344 add 187.232671 -840.469347 -> -653.236676 +xcom344 compare 187.232671 -840.469347 -> 1 +xdiv344 divide 187.232671 -840.469347 -> -0.222771564 Inexact Rounded +xdvi344 divideint 187.232671 -840.469347 -> -0 +xmul344 multiply 187.232671 -840.469347 -> -157363.321 Inexact Rounded +xpow344 power 187.232671 -840 -> 1.58280862E-1909 Inexact Rounded +xrem344 remainder 187.232671 -840.469347 -> 187.232671 +xsub344 subtract 187.232671 -840.469347 -> 1027.70202 Inexact Rounded +xadd345 add 81233.6823 -5192.21666E+309315093 -> -5.19221666E+309315096 Inexact Rounded +xcom345 compare 81233.6823 -5192.21666E+309315093 -> 1 +xdiv345 divide 81233.6823 -5192.21666E+309315093 -> -1.56452798E-309315092 Inexact Rounded +xdvi345 divideint 81233.6823 -5192.21666E+309315093 -> -0 +xmul345 multiply 81233.6823 -5192.21666E+309315093 -> -4.21782879E+309315101 Inexact Rounded +xpow345 power 81233.6823 -5 -> 2.82695763E-25 Inexact Rounded +xrem345 remainder 81233.6823 -5192.21666E+309315093 -> 81233.6823 +xsub345 subtract 81233.6823 -5192.21666E+309315093 -> 5.19221666E+309315096 Inexact Rounded +xadd346 add -854.586113 -79.8715762E-853065103 -> -854.586113 Inexact Rounded +xcom346 compare -854.586113 -79.8715762E-853065103 -> -1 +xdiv346 divide -854.586113 -79.8715762E-853065103 -> 1.06995023E+853065104 Inexact Rounded +xdvi346 divideint -854.586113 -79.8715762E-853065103 -> NaN Division_impossible +xmul346 multiply -854.586113 -79.8715762E-853065103 -> 6.82571398E-853065099 Inexact Rounded +xpow346 power -854.586113 -8 -> 3.51522679E-24 Inexact Rounded +xrem346 remainder -854.586113 -79.8715762E-853065103 -> NaN Division_impossible +xsub346 subtract -854.586113 -79.8715762E-853065103 -> -854.586113 Inexact Rounded +xadd347 add 78872665.3 172.102119 -> 78872837.4 Inexact Rounded +xcom347 compare 78872665.3 172.102119 -> 1 +xdiv347 divide 78872665.3 172.102119 -> 458289.914 Inexact Rounded +xdvi347 divideint 78872665.3 172.102119 -> 458289 +xmul347 multiply 78872665.3 172.102119 -> 1.35741528E+10 Inexact Rounded +xpow347 power 78872665.3 172 -> 1.86793137E+1358 Inexact Rounded +xrem347 remainder 78872665.3 172.102119 -> 157.285609 +xsub347 subtract 78872665.3 172.102119 -> 78872493.2 Inexact Rounded +xadd348 add 328268.1E-436315617 -204.522245 -> -204.522245 Inexact Rounded +xcom348 compare 328268.1E-436315617 -204.522245 -> 1 +xdiv348 divide 328268.1E-436315617 -204.522245 -> -1.60504839E-436315614 Inexact Rounded +xdvi348 divideint 328268.1E-436315617 -204.522245 -> -0 +xmul348 multiply 328268.1E-436315617 -204.522245 -> -6.71381288E-436315610 Inexact Rounded +xpow348 power 328268.1E-436315617 -205 -> Infinity Overflow Inexact Rounded +xrem348 remainder 328268.1E-436315617 -204.522245 -> 3.282681E-436315612 +xsub348 subtract 328268.1E-436315617 -204.522245 -> 204.522245 Inexact Rounded +xadd349 add -4037911.02E+641367645 29.5713010 -> -4.03791102E+641367651 Inexact Rounded +xcom349 compare -4037911.02E+641367645 29.5713010 -> -1 +xdiv349 divide -4037911.02E+641367645 29.5713010 -> -1.36548305E+641367650 Inexact Rounded +xdvi349 divideint -4037911.02E+641367645 29.5713010 -> NaN Division_impossible +xmul349 multiply -4037911.02E+641367645 29.5713010 -> -1.19406282E+641367653 Inexact Rounded +xpow349 power -4037911.02E+641367645 30 -> Infinity Overflow Inexact Rounded +xrem349 remainder -4037911.02E+641367645 29.5713010 -> NaN Division_impossible +xsub349 subtract -4037911.02E+641367645 29.5713010 -> -4.03791102E+641367651 Inexact Rounded +xadd350 add -688755561.E-95301699 978.275312E+913812609 -> 9.78275312E+913812611 Inexact Rounded +xcom350 compare -688755561.E-95301699 978.275312E+913812609 -> -1 +xdiv350 divide -688755561.E-95301699 978.275312E+913812609 -> -0E-1000000007 Inexact Rounded Underflow Subnormal Clamped +xdvi350 divideint -688755561.E-95301699 978.275312E+913812609 -> -0 +xmul350 multiply -688755561.E-95301699 978.275312E+913812609 -> -6.73792561E+818510921 Inexact Rounded +xpow350 power -688755561.E-95301699 10 -> 2.40243244E-953016902 Inexact Rounded +xrem350 remainder -688755561.E-95301699 978.275312E+913812609 -> -6.88755561E-95301691 +xsub350 subtract -688755561.E-95301699 978.275312E+913812609 -> -9.78275312E+913812611 Inexact Rounded +xadd351 add -5.47345502 59818.7580 -> 59813.2845 Inexact Rounded +xcom351 compare -5.47345502 59818.7580 -> -1 +xdiv351 divide -5.47345502 59818.7580 -> -0.0000915006463 Inexact Rounded +xdvi351 divideint -5.47345502 59818.7580 -> -0 +xmul351 multiply -5.47345502 59818.7580 -> -327415.281 Inexact Rounded +xpow351 power -5.47345502 59819 -> -1.16914146E+44162 Inexact Rounded +xrem351 remainder -5.47345502 59818.7580 -> -5.47345502 +xsub351 subtract -5.47345502 59818.7580 -> -59824.2315 Inexact Rounded +xadd352 add 563891620E-361354567 -845900362. -> -845900362 Inexact Rounded +xcom352 compare 563891620E-361354567 -845900362. -> 1 +xdiv352 divide 563891620E-361354567 -845900362. -> -6.66617069E-361354568 Inexact Rounded +xdvi352 divideint 563891620E-361354567 -845900362. -> -0 +xmul352 multiply 563891620E-361354567 -845900362. -> -4.76996125E-361354550 Inexact Rounded +xpow352 power 563891620E-361354567 -845900362 -> Infinity Overflow Inexact Rounded +xrem352 remainder 563891620E-361354567 -845900362. -> 5.63891620E-361354559 +xsub352 subtract 563891620E-361354567 -845900362. -> 845900362 Inexact Rounded +xadd353 add -69.7231286 85773.7504 -> 85704.0273 Inexact Rounded +xcom353 compare -69.7231286 85773.7504 -> -1 +xdiv353 divide -69.7231286 85773.7504 -> -0.000812872566 Inexact Rounded +xdvi353 divideint -69.7231286 85773.7504 -> -0 +xmul353 multiply -69.7231286 85773.7504 -> -5980414.23 Inexact Rounded +xpow353 power -69.7231286 85774 -> 6.41714261E+158113 Inexact Rounded +xrem353 remainder -69.7231286 85773.7504 -> -69.7231286 +xsub353 subtract -69.7231286 85773.7504 -> -85843.4735 Inexact Rounded +xadd354 add 5125.51188 73814638.4E-500934741 -> 5125.51188 Inexact Rounded +xcom354 compare 5125.51188 73814638.4E-500934741 -> 1 +xdiv354 divide 5125.51188 73814638.4E-500934741 -> 6.94376074E+500934736 Inexact Rounded +xdvi354 divideint 5125.51188 73814638.4E-500934741 -> NaN Division_impossible +xmul354 multiply 5125.51188 73814638.4E-500934741 -> 3.78337806E-500934730 Inexact Rounded +xpow354 power 5125.51188 7 -> 9.29310216E+25 Inexact Rounded +xrem354 remainder 5125.51188 73814638.4E-500934741 -> NaN Division_impossible +xsub354 subtract 5125.51188 73814638.4E-500934741 -> 5125.51188 Inexact Rounded +xadd355 add -54.6254096 -332921899. -> -332921954 Inexact Rounded +xcom355 compare -54.6254096 -332921899. -> 1 +xdiv355 divide -54.6254096 -332921899. -> 1.64078752E-7 Inexact Rounded +xdvi355 divideint -54.6254096 -332921899. -> 0 +xmul355 multiply -54.6254096 -332921899. -> 1.81859951E+10 Inexact Rounded +xpow355 power -54.6254096 -332921899 -> -1.01482569E-578416745 Inexact Rounded +xrem355 remainder -54.6254096 -332921899. -> -54.6254096 +xsub355 subtract -54.6254096 -332921899. -> 332921844 Inexact Rounded +xadd356 add -9.04778095E-591874079 8719.40286 -> 8719.40286 Inexact Rounded +xcom356 compare -9.04778095E-591874079 8719.40286 -> -1 +xdiv356 divide -9.04778095E-591874079 8719.40286 -> -1.03766062E-591874082 Inexact Rounded +xdvi356 divideint -9.04778095E-591874079 8719.40286 -> -0 +xmul356 multiply -9.04778095E-591874079 8719.40286 -> -7.88912471E-591874075 Inexact Rounded +xpow356 power -9.04778095E-591874079 8719 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem356 remainder -9.04778095E-591874079 8719.40286 -> -9.04778095E-591874079 +xsub356 subtract -9.04778095E-591874079 8719.40286 -> -8719.40286 Inexact Rounded +xadd357 add -21006.1733E+884684431 -48872.9175 -> -2.10061733E+884684435 Inexact Rounded +xcom357 compare -21006.1733E+884684431 -48872.9175 -> -1 +xdiv357 divide -21006.1733E+884684431 -48872.9175 -> 4.29812141E+884684430 Inexact Rounded +xdvi357 divideint -21006.1733E+884684431 -48872.9175 -> NaN Division_impossible +xmul357 multiply -21006.1733E+884684431 -48872.9175 -> 1.02663297E+884684440 Inexact Rounded +xpow357 power -21006.1733E+884684431 -48873 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem357 remainder -21006.1733E+884684431 -48872.9175 -> NaN Division_impossible +xsub357 subtract -21006.1733E+884684431 -48872.9175 -> -2.10061733E+884684435 Inexact Rounded +xadd358 add -1546783 -51935370.4 -> -53482153.4 +xcom358 compare -1546783 -51935370.4 -> 1 +xdiv358 divide -1546783 -51935370.4 -> 0.0297828433 Inexact Rounded +xdvi358 divideint -1546783 -51935370.4 -> 0 +xmul358 multiply -1546783 -51935370.4 -> 8.03327480E+13 Inexact Rounded +xpow358 power -1546783 -51935370 -> 3.36022461E-321450306 Inexact Rounded +xrem358 remainder -1546783 -51935370.4 -> -1546783.0 +xsub358 subtract -1546783 -51935370.4 -> 50388587.4 +xadd359 add 61302486.8 205.490417 -> 61302692.3 Inexact Rounded +xcom359 compare 61302486.8 205.490417 -> 1 +xdiv359 divide 61302486.8 205.490417 -> 298322.850 Inexact Rounded +xdvi359 divideint 61302486.8 205.490417 -> 298322 +xmul359 multiply 61302486.8 205.490417 -> 1.25970736E+10 Inexact Rounded +xpow359 power 61302486.8 205 -> 2.71024755E+1596 Inexact Rounded +xrem359 remainder 61302486.8 205.490417 -> 174.619726 +xsub359 subtract 61302486.8 205.490417 -> 61302281.3 Inexact Rounded +xadd360 add -318180109. -54008744.6E-170931002 -> -318180109 Inexact Rounded +xcom360 compare -318180109. -54008744.6E-170931002 -> -1 +xdiv360 divide -318180109. -54008744.6E-170931002 -> 5.89127023E+170931002 Inexact Rounded +xdvi360 divideint -318180109. -54008744.6E-170931002 -> NaN Division_impossible +xmul360 multiply -318180109. -54008744.6E-170931002 -> 1.71845082E-170930986 Inexact Rounded +xpow360 power -318180109. -5 -> -3.06644280E-43 Inexact Rounded +xrem360 remainder -318180109. -54008744.6E-170931002 -> NaN Division_impossible +xsub360 subtract -318180109. -54008744.6E-170931002 -> -318180109 Inexact Rounded +xadd361 add -28486137.1E+901441714 -42454.940 -> -2.84861371E+901441721 Inexact Rounded +xcom361 compare -28486137.1E+901441714 -42454.940 -> -1 +xdiv361 divide -28486137.1E+901441714 -42454.940 -> 6.70973439E+901441716 Inexact Rounded +xdvi361 divideint -28486137.1E+901441714 -42454.940 -> NaN Division_impossible +xmul361 multiply -28486137.1E+901441714 -42454.940 -> 1.20937724E+901441726 Inexact Rounded +xpow361 power -28486137.1E+901441714 -42455 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem361 remainder -28486137.1E+901441714 -42454.940 -> NaN Division_impossible +xsub361 subtract -28486137.1E+901441714 -42454.940 -> -2.84861371E+901441721 Inexact Rounded +xadd362 add -546398328. -27.9149712 -> -546398356 Inexact Rounded +xcom362 compare -546398328. -27.9149712 -> -1 +xdiv362 divide -546398328. -27.9149712 -> 19573666.2 Inexact Rounded +xdvi362 divideint -546398328. -27.9149712 -> 19573666 +xmul362 multiply -546398328. -27.9149712 -> 1.52526936E+10 Inexact Rounded +xpow362 power -546398328. -28 -> 2.23737032E-245 Inexact Rounded +xrem362 remainder -546398328. -27.9149712 -> -5.3315808 +xsub362 subtract -546398328. -27.9149712 -> -546398300 Inexact Rounded +xadd363 add 5402066.1E-284978216 622.751128 -> 622.751128 Inexact Rounded +xcom363 compare 5402066.1E-284978216 622.751128 -> -1 +xdiv363 divide 5402066.1E-284978216 622.751128 -> 8.67451837E-284978213 Inexact Rounded +xdvi363 divideint 5402066.1E-284978216 622.751128 -> 0 +xmul363 multiply 5402066.1E-284978216 622.751128 -> 3.36414276E-284978207 Inexact Rounded +xpow363 power 5402066.1E-284978216 623 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem363 remainder 5402066.1E-284978216 622.751128 -> 5.4020661E-284978210 +xsub363 subtract 5402066.1E-284978216 622.751128 -> -622.751128 Inexact Rounded +xadd364 add 18845620 3129.43753 -> 18848749.4 Inexact Rounded +xcom364 compare 18845620 3129.43753 -> 1 +xdiv364 divide 18845620 3129.43753 -> 6022.04704 Inexact Rounded +xdvi364 divideint 18845620 3129.43753 -> 6022 +xmul364 multiply 18845620 3129.43753 -> 5.89761905E+10 Inexact Rounded +xpow364 power 18845620 3129 -> 1.35967443E+22764 Inexact Rounded +xrem364 remainder 18845620 3129.43753 -> 147.19434 +xsub364 subtract 18845620 3129.43753 -> 18842490.6 Inexact Rounded +xadd365 add 50707.1412E+912475670 -198098.186E+701407524 -> 5.07071412E+912475674 Inexact Rounded +xcom365 compare 50707.1412E+912475670 -198098.186E+701407524 -> 1 +xdiv365 divide 50707.1412E+912475670 -198098.186E+701407524 -> -2.55969740E+211068145 Inexact Rounded +xdvi365 divideint 50707.1412E+912475670 -198098.186E+701407524 -> NaN Division_impossible +xmul365 multiply 50707.1412E+912475670 -198098.186E+701407524 -> -Infinity Inexact Overflow Rounded +xpow365 power 50707.1412E+912475670 -2 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem365 remainder 50707.1412E+912475670 -198098.186E+701407524 -> NaN Division_impossible +xsub365 subtract 50707.1412E+912475670 -198098.186E+701407524 -> 5.07071412E+912475674 Inexact Rounded +xadd366 add 55.8245006E+928885991 99170843.9E-47402167 -> 5.58245006E+928885992 Inexact Rounded +xcom366 compare 55.8245006E+928885991 99170843.9E-47402167 -> 1 +xdiv366 divide 55.8245006E+928885991 99170843.9E-47402167 -> 5.62912429E+976288151 Inexact Rounded +xdvi366 divideint 55.8245006E+928885991 99170843.9E-47402167 -> NaN Division_impossible +xmul366 multiply 55.8245006E+928885991 99170843.9E-47402167 -> 5.53616283E+881483833 Inexact Rounded +xpow366 power 55.8245006E+928885991 10 -> Infinity Overflow Inexact Rounded +xrem366 remainder 55.8245006E+928885991 99170843.9E-47402167 -> NaN Division_impossible +xsub366 subtract 55.8245006E+928885991 99170843.9E-47402167 -> 5.58245006E+928885992 Inexact Rounded +xadd367 add 13.8003883E-386224921 -84126481.9E-296378341 -> -8.41264819E-296378334 Inexact Rounded +xcom367 compare 13.8003883E-386224921 -84126481.9E-296378341 -> 1 +xdiv367 divide 13.8003883E-386224921 -84126481.9E-296378341 -> -1.64043331E-89846587 Inexact Rounded +xdvi367 divideint 13.8003883E-386224921 -84126481.9E-296378341 -> -0 +xmul367 multiply 13.8003883E-386224921 -84126481.9E-296378341 -> -1.16097812E-682603253 Inexact Rounded +xpow367 power 13.8003883E-386224921 -8 -> Infinity Overflow Inexact Rounded +xrem367 remainder 13.8003883E-386224921 -84126481.9E-296378341 -> 1.38003883E-386224920 +xsub367 subtract 13.8003883E-386224921 -84126481.9E-296378341 -> 8.41264819E-296378334 Inexact Rounded +xadd368 add 9820.90457 46671.5915 -> 56492.4961 Inexact Rounded +xcom368 compare 9820.90457 46671.5915 -> -1 +xdiv368 divide 9820.90457 46671.5915 -> 0.210425748 Inexact Rounded +xdvi368 divideint 9820.90457 46671.5915 -> 0 +xmul368 multiply 9820.90457 46671.5915 -> 458357246 Inexact Rounded +xpow368 power 9820.90457 46672 -> 4.94753070E+186321 Inexact Rounded +xrem368 remainder 9820.90457 46671.5915 -> 9820.90457 +xsub368 subtract 9820.90457 46671.5915 -> -36850.6869 Inexact Rounded +xadd369 add 7.22436006E+831949153 -11168830E+322331045 -> 7.22436006E+831949153 Inexact Rounded +xcom369 compare 7.22436006E+831949153 -11168830E+322331045 -> 1 +xdiv369 divide 7.22436006E+831949153 -11168830E+322331045 -> -6.46832306E+509618101 Inexact Rounded +xdvi369 divideint 7.22436006E+831949153 -11168830E+322331045 -> NaN Division_impossible +xmul369 multiply 7.22436006E+831949153 -11168830E+322331045 -> -Infinity Inexact Overflow Rounded +xpow369 power 7.22436006E+831949153 -1 -> 1.38420565E-831949154 Inexact Rounded +xrem369 remainder 7.22436006E+831949153 -11168830E+322331045 -> NaN Division_impossible +xsub369 subtract 7.22436006E+831949153 -11168830E+322331045 -> 7.22436006E+831949153 Inexact Rounded +xadd370 add 472648900 -207.784153 -> 472648692 Inexact Rounded +xcom370 compare 472648900 -207.784153 -> 1 +xdiv370 divide 472648900 -207.784153 -> -2274711.01 Inexact Rounded +xdvi370 divideint 472648900 -207.784153 -> -2274711 +xmul370 multiply 472648900 -207.784153 -> -9.82089514E+10 Inexact Rounded +xpow370 power 472648900 -208 -> 4.96547145E-1805 Inexact Rounded +xrem370 remainder 472648900 -207.784153 -> 1.545217 +xsub370 subtract 472648900 -207.784153 -> 472649108 Inexact Rounded +xadd371 add -8754.49306 -818.165153E+631475457 -> -8.18165153E+631475459 Inexact Rounded +xcom371 compare -8754.49306 -818.165153E+631475457 -> 1 +xdiv371 divide -8754.49306 -818.165153E+631475457 -> 1.07001539E-631475456 Inexact Rounded +xdvi371 divideint -8754.49306 -818.165153E+631475457 -> 0 +xmul371 multiply -8754.49306 -818.165153E+631475457 -> 7.16262115E+631475463 Inexact Rounded +xpow371 power -8754.49306 -8 -> 2.89835767E-32 Inexact Rounded +xrem371 remainder -8754.49306 -818.165153E+631475457 -> -8754.49306 +xsub371 subtract -8754.49306 -818.165153E+631475457 -> 8.18165153E+631475459 Inexact Rounded +xadd372 add 98750864 191380.551 -> 98942244.6 Inexact Rounded +xcom372 compare 98750864 191380.551 -> 1 +xdiv372 divide 98750864 191380.551 -> 515.992161 Inexact Rounded +xdvi372 divideint 98750864 191380.551 -> 515 +xmul372 multiply 98750864 191380.551 -> 1.88989948E+13 Inexact Rounded +xpow372 power 98750864 191381 -> 1.70908809E+1530003 Inexact Rounded +xrem372 remainder 98750864 191380.551 -> 189880.235 +xsub372 subtract 98750864 191380.551 -> 98559483.4 Inexact Rounded +xadd373 add 725292561. -768963606.E+340762986 -> -7.68963606E+340762994 Inexact Rounded +xcom373 compare 725292561. -768963606.E+340762986 -> 1 +xdiv373 divide 725292561. -768963606.E+340762986 -> -9.43207917E-340762987 Inexact Rounded +xdvi373 divideint 725292561. -768963606.E+340762986 -> -0 +xmul373 multiply 725292561. -768963606.E+340762986 -> -5.57723583E+340763003 Inexact Rounded +xpow373 power 725292561. -8 -> 1.30585277E-71 Inexact Rounded +xrem373 remainder 725292561. -768963606.E+340762986 -> 725292561 +xsub373 subtract 725292561. -768963606.E+340762986 -> 7.68963606E+340762994 Inexact Rounded +xadd374 add 1862.80445 648254483. -> 648256346 Inexact Rounded +xcom374 compare 1862.80445 648254483. -> -1 +xdiv374 divide 1862.80445 648254483. -> 0.00000287356972 Inexact Rounded +xdvi374 divideint 1862.80445 648254483. -> 0 +xmul374 multiply 1862.80445 648254483. -> 1.20757134E+12 Inexact Rounded +xpow374 power 1862.80445 648254483 -> Infinity Overflow Inexact Rounded +xrem374 remainder 1862.80445 648254483. -> 1862.80445 +xsub374 subtract 1862.80445 648254483. -> -648252620 Inexact Rounded +xadd375 add -5549320.1 -93580684.1 -> -99130004.2 +xcom375 compare -5549320.1 -93580684.1 -> 1 +xdiv375 divide -5549320.1 -93580684.1 -> 0.0592998454 Inexact Rounded +xdvi375 divideint -5549320.1 -93580684.1 -> 0 +xmul375 multiply -5549320.1 -93580684.1 -> 5.19309171E+14 Inexact Rounded +xpow375 power -5549320.1 -93580684 -> 4.20662079E-631130572 Inexact Rounded +xrem375 remainder -5549320.1 -93580684.1 -> -5549320.1 +xsub375 subtract -5549320.1 -93580684.1 -> 88031364.0 +xadd376 add -14677053.1 -25784.7358 -> -14702837.8 Inexact Rounded +xcom376 compare -14677053.1 -25784.7358 -> -1 +xdiv376 divide -14677053.1 -25784.7358 -> 569.214795 Inexact Rounded +xdvi376 divideint -14677053.1 -25784.7358 -> 569 +xmul376 multiply -14677053.1 -25784.7358 -> 3.78443937E+11 Inexact Rounded +xpow376 power -14677053.1 -25785 -> -1.64760831E-184792 Inexact Rounded +xrem376 remainder -14677053.1 -25784.7358 -> -5538.4298 +xsub376 subtract -14677053.1 -25784.7358 -> -14651268.4 Inexact Rounded +xadd377 add 547402.308E+571687617 -7835797.01E+500067364 -> 5.47402308E+571687622 Inexact Rounded +xcom377 compare 547402.308E+571687617 -7835797.01E+500067364 -> 1 +xdiv377 divide 547402.308E+571687617 -7835797.01E+500067364 -> -6.98591742E+71620251 Inexact Rounded +xdvi377 divideint 547402.308E+571687617 -7835797.01E+500067364 -> NaN Division_impossible +xmul377 multiply 547402.308E+571687617 -7835797.01E+500067364 -> -Infinity Inexact Overflow Rounded +xpow377 power 547402.308E+571687617 -8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem377 remainder 547402.308E+571687617 -7835797.01E+500067364 -> NaN Division_impossible +xsub377 subtract 547402.308E+571687617 -7835797.01E+500067364 -> 5.47402308E+571687622 Inexact Rounded +xadd378 add -4131738.09 7579.07566 -> -4124159.01 Inexact Rounded +xcom378 compare -4131738.09 7579.07566 -> -1 +xdiv378 divide -4131738.09 7579.07566 -> -545.150659 Inexact Rounded +xdvi378 divideint -4131738.09 7579.07566 -> -545 +xmul378 multiply -4131738.09 7579.07566 -> -3.13147556E+10 Inexact Rounded +xpow378 power -4131738.09 7579 -> -4.68132794E+50143 Inexact Rounded +xrem378 remainder -4131738.09 7579.07566 -> -1141.85530 +xsub378 subtract -4131738.09 7579.07566 -> -4139317.17 Inexact Rounded +xadd379 add 504544.648 -7678.96133E-662143268 -> 504544.648 Inexact Rounded +xcom379 compare 504544.648 -7678.96133E-662143268 -> 1 +xdiv379 divide 504544.648 -7678.96133E-662143268 -> -6.57048039E+662143269 Inexact Rounded +xdvi379 divideint 504544.648 -7678.96133E-662143268 -> NaN Division_impossible +xmul379 multiply 504544.648 -7678.96133E-662143268 -> -3.87437884E-662143259 Inexact Rounded +xpow379 power 504544.648 -8 -> 2.38124001E-46 Inexact Rounded +xrem379 remainder 504544.648 -7678.96133E-662143268 -> NaN Division_impossible +xsub379 subtract 504544.648 -7678.96133E-662143268 -> 504544.648 Inexact Rounded +xadd380 add 829898241 8912.99114E+929228149 -> 8.91299114E+929228152 Inexact Rounded +xcom380 compare 829898241 8912.99114E+929228149 -> -1 +xdiv380 divide 829898241 8912.99114E+929228149 -> 9.31110811E-929228145 Inexact Rounded +xdvi380 divideint 829898241 8912.99114E+929228149 -> 0 +xmul380 multiply 829898241 8912.99114E+929228149 -> 7.39687567E+929228161 Inexact Rounded +xpow380 power 829898241 9 -> 1.86734084E+80 Inexact Rounded +xrem380 remainder 829898241 8912.99114E+929228149 -> 829898241 +xsub380 subtract 829898241 8912.99114E+929228149 -> -8.91299114E+929228152 Inexact Rounded +xadd381 add 53.6891691 -11.2371140 -> 42.4520551 +xcom381 compare 53.6891691 -11.2371140 -> 1 +xdiv381 divide 53.6891691 -11.2371140 -> -4.77784323 Inexact Rounded +xdvi381 divideint 53.6891691 -11.2371140 -> -4 +xmul381 multiply 53.6891691 -11.2371140 -> -603.311314 Inexact Rounded +xpow381 power 53.6891691 -11 -> 9.35936725E-20 Inexact Rounded +xrem381 remainder 53.6891691 -11.2371140 -> 8.7407131 +xsub381 subtract 53.6891691 -11.2371140 -> 64.9262831 +xadd382 add -93951823.4 -25317.8645 -> -93977141.3 Inexact Rounded +xcom382 compare -93951823.4 -25317.8645 -> -1 +xdiv382 divide -93951823.4 -25317.8645 -> 3710.89052 Inexact Rounded +xdvi382 divideint -93951823.4 -25317.8645 -> 3710 +xmul382 multiply -93951823.4 -25317.8645 -> 2.37865953E+12 Inexact Rounded +xpow382 power -93951823.4 -25318 -> 9.67857714E-201859 Inexact Rounded +xrem382 remainder -93951823.4 -25317.8645 -> -22546.1050 +xsub382 subtract -93951823.4 -25317.8645 -> -93926505.5 Inexact Rounded +xadd383 add 446919.123 951338490. -> 951785409 Inexact Rounded +xcom383 compare 446919.123 951338490. -> -1 +xdiv383 divide 446919.123 951338490. -> 0.000469779293 Inexact Rounded +xdvi383 divideint 446919.123 951338490. -> 0 +xmul383 multiply 446919.123 951338490. -> 4.25171364E+14 Inexact Rounded +xpow383 power 446919.123 951338490 -> Infinity Overflow Inexact Rounded +xrem383 remainder 446919.123 951338490. -> 446919.123 +xsub383 subtract 446919.123 951338490. -> -950891571 Inexact Rounded +xadd384 add -8.01787748 -88.3076852 -> -96.3255627 Inexact Rounded +xcom384 compare -8.01787748 -88.3076852 -> 1 +xdiv384 divide -8.01787748 -88.3076852 -> 0.0907947871 Inexact Rounded +xdvi384 divideint -8.01787748 -88.3076852 -> 0 +xmul384 multiply -8.01787748 -88.3076852 -> 708.040200 Inexact Rounded +xpow384 power -8.01787748 -88 -> 2.77186088E-80 Inexact Rounded +xrem384 remainder -8.01787748 -88.3076852 -> -8.01787748 +xsub384 subtract -8.01787748 -88.3076852 -> 80.2898077 Inexact Rounded +xadd385 add 517458139 -999731.548 -> 516458407 Inexact Rounded +xcom385 compare 517458139 -999731.548 -> 1 +xdiv385 divide 517458139 -999731.548 -> -517.597089 Inexact Rounded +xdvi385 divideint 517458139 -999731.548 -> -517 +xmul385 multiply 517458139 -999731.548 -> -5.17319226E+14 Inexact Rounded +xpow385 power 517458139 -999732 -> 1.24821346E-8711540 Inexact Rounded +xrem385 remainder 517458139 -999731.548 -> 596928.684 +xsub385 subtract 517458139 -999731.548 -> 518457871 Inexact Rounded +xadd386 add -405543440 -4013.18295 -> -405547453 Inexact Rounded +xcom386 compare -405543440 -4013.18295 -> -1 +xdiv386 divide -405543440 -4013.18295 -> 101052.816 Inexact Rounded +xdvi386 divideint -405543440 -4013.18295 -> 101052 +xmul386 multiply -405543440 -4013.18295 -> 1.62752002E+12 Inexact Rounded +xpow386 power -405543440 -4013 -> -8.83061932E-34545 Inexact Rounded +xrem386 remainder -405543440 -4013.18295 -> -3276.53660 +xsub386 subtract -405543440 -4013.18295 -> -405539427 Inexact Rounded +xadd387 add -49245250.1E+682760825 -848776.637 -> -4.92452501E+682760832 Inexact Rounded +xcom387 compare -49245250.1E+682760825 -848776.637 -> -1 +xdiv387 divide -49245250.1E+682760825 -848776.637 -> 5.80190924E+682760826 Inexact Rounded +xdvi387 divideint -49245250.1E+682760825 -848776.637 -> NaN Division_impossible +xmul387 multiply -49245250.1E+682760825 -848776.637 -> 4.17982178E+682760838 Inexact Rounded +xpow387 power -49245250.1E+682760825 -848777 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem387 remainder -49245250.1E+682760825 -848776.637 -> NaN Division_impossible +xsub387 subtract -49245250.1E+682760825 -848776.637 -> -4.92452501E+682760832 Inexact Rounded +xadd388 add -151144455 -170371.29 -> -151314826 Inexact Rounded +xcom388 compare -151144455 -170371.29 -> -1 +xdiv388 divide -151144455 -170371.29 -> 887.147447 Inexact Rounded +xdvi388 divideint -151144455 -170371.29 -> 887 +xmul388 multiply -151144455 -170371.29 -> 2.57506758E+13 Inexact Rounded +xpow388 power -151144455 -170371 -> -5.86496369E-1393532 Inexact Rounded +xrem388 remainder -151144455 -170371.29 -> -25120.77 +xsub388 subtract -151144455 -170371.29 -> -150974084 Inexact Rounded +xadd389 add -729236746.E+662737067 9.10823602 -> -7.29236746E+662737075 Inexact Rounded +xcom389 compare -729236746.E+662737067 9.10823602 -> -1 +xdiv389 divide -729236746.E+662737067 9.10823602 -> -8.00634442E+662737074 Inexact Rounded +xdvi389 divideint -729236746.E+662737067 9.10823602 -> NaN Division_impossible +xmul389 multiply -729236746.E+662737067 9.10823602 -> -6.64206040E+662737076 Inexact Rounded +xpow389 power -729236746.E+662737067 9 -> -Infinity Overflow Inexact Rounded +xrem389 remainder -729236746.E+662737067 9.10823602 -> NaN Division_impossible +xsub389 subtract -729236746.E+662737067 9.10823602 -> -7.29236746E+662737075 Inexact Rounded +xadd390 add 534.394729 -2369839.37 -> -2369304.98 Inexact Rounded +xcom390 compare 534.394729 -2369839.37 -> 1 +xdiv390 divide 534.394729 -2369839.37 -> -0.000225498291 Inexact Rounded +xdvi390 divideint 534.394729 -2369839.37 -> -0 +xmul390 multiply 534.394729 -2369839.37 -> -1.26642967E+9 Inexact Rounded +xpow390 power 534.394729 -2369839 -> 7.12522896E-6464595 Inexact Rounded +xrem390 remainder 534.394729 -2369839.37 -> 534.394729 +xsub390 subtract 534.394729 -2369839.37 -> 2370373.76 Inexact Rounded +xadd391 add 89100.1797 224.370309 -> 89324.5500 Inexact Rounded +xcom391 compare 89100.1797 224.370309 -> 1 +xdiv391 divide 89100.1797 224.370309 -> 397.112167 Inexact Rounded +xdvi391 divideint 89100.1797 224.370309 -> 397 +xmul391 multiply 89100.1797 224.370309 -> 19991434.9 Inexact Rounded +xpow391 power 89100.1797 224 -> 5.92654936E+1108 Inexact Rounded +xrem391 remainder 89100.1797 224.370309 -> 25.167027 +xsub391 subtract 89100.1797 224.370309 -> 88875.8094 Inexact Rounded +xadd392 add -821377.777 38.552821 -> -821339.224 Inexact Rounded +xcom392 compare -821377.777 38.552821 -> -1 +xdiv392 divide -821377.777 38.552821 -> -21305.2575 Inexact Rounded +xdvi392 divideint -821377.777 38.552821 -> -21305 +xmul392 multiply -821377.777 38.552821 -> -31666430.4 Inexact Rounded +xpow392 power -821377.777 39 -> -4.64702482E+230 Inexact Rounded +xrem392 remainder -821377.777 38.552821 -> -9.925595 +xsub392 subtract -821377.777 38.552821 -> -821416.330 Inexact Rounded +xadd393 add -392640.782 -2571619.5E+113237865 -> -2.57161950E+113237871 Inexact Rounded +xcom393 compare -392640.782 -2571619.5E+113237865 -> 1 +xdiv393 divide -392640.782 -2571619.5E+113237865 -> 1.52682301E-113237866 Inexact Rounded +xdvi393 divideint -392640.782 -2571619.5E+113237865 -> 0 +xmul393 multiply -392640.782 -2571619.5E+113237865 -> 1.00972269E+113237877 Inexact Rounded +xpow393 power -392640.782 -3 -> -1.65201422E-17 Inexact Rounded +xrem393 remainder -392640.782 -2571619.5E+113237865 -> -392640.782 +xsub393 subtract -392640.782 -2571619.5E+113237865 -> 2.57161950E+113237871 Inexact Rounded +xadd394 add -651397.712 -723.59673 -> -652121.309 Inexact Rounded +xcom394 compare -651397.712 -723.59673 -> -1 +xdiv394 divide -651397.712 -723.59673 -> 900.222023 Inexact Rounded +xdvi394 divideint -651397.712 -723.59673 -> 900 +xmul394 multiply -651397.712 -723.59673 -> 471349254 Inexact Rounded +xpow394 power -651397.712 -724 -> 5.96115415E-4210 Inexact Rounded +xrem394 remainder -651397.712 -723.59673 -> -160.65500 +xsub394 subtract -651397.712 -723.59673 -> -650674.115 Inexact Rounded +xadd395 add 86.6890892 940380864 -> 940380951 Inexact Rounded +xcom395 compare 86.6890892 940380864 -> -1 +xdiv395 divide 86.6890892 940380864 -> 9.21850843E-8 Inexact Rounded +xdvi395 divideint 86.6890892 940380864 -> 0 +xmul395 multiply 86.6890892 940380864 -> 8.15207606E+10 Inexact Rounded +xpow395 power 86.6890892 940380864 -> Infinity Overflow Inexact Rounded +xrem395 remainder 86.6890892 940380864 -> 86.6890892 +xsub395 subtract 86.6890892 940380864 -> -940380777 Inexact Rounded +xadd396 add 4880.06442E-382222621 -115627239E-912834031 -> 4.88006442E-382222618 Inexact Rounded +xcom396 compare 4880.06442E-382222621 -115627239E-912834031 -> 1 +xdiv396 divide 4880.06442E-382222621 -115627239E-912834031 -> -4.22051453E+530611405 Inexact Rounded +xdvi396 divideint 4880.06442E-382222621 -115627239E-912834031 -> NaN Division_impossible +xmul396 multiply 4880.06442E-382222621 -115627239E-912834031 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow396 power 4880.06442E-382222621 -1 -> 2.04915328E+382222617 Inexact Rounded +xrem396 remainder 4880.06442E-382222621 -115627239E-912834031 -> NaN Division_impossible +xsub396 subtract 4880.06442E-382222621 -115627239E-912834031 -> 4.88006442E-382222618 Inexact Rounded +xadd397 add 173398265E-532383158 3462.51450E+80986915 -> 3.46251450E+80986918 Inexact Rounded +xcom397 compare 173398265E-532383158 3462.51450E+80986915 -> -1 +xdiv397 divide 173398265E-532383158 3462.51450E+80986915 -> 5.00787116E-613370069 Inexact Rounded +xdvi397 divideint 173398265E-532383158 3462.51450E+80986915 -> 0 +xmul397 multiply 173398265E-532383158 3462.51450E+80986915 -> 6.00394007E-451396232 Inexact Rounded +xpow397 power 173398265E-532383158 3 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem397 remainder 173398265E-532383158 3462.51450E+80986915 -> 1.73398265E-532383150 +xsub397 subtract 173398265E-532383158 3462.51450E+80986915 -> -3.46251450E+80986918 Inexact Rounded +xadd398 add -1522176.78 -6631061.77 -> -8153238.55 +xcom398 compare -1522176.78 -6631061.77 -> 1 +xdiv398 divide -1522176.78 -6631061.77 -> 0.229552496 Inexact Rounded +xdvi398 divideint -1522176.78 -6631061.77 -> 0 +xmul398 multiply -1522176.78 -6631061.77 -> 1.00936483E+13 Inexact Rounded +xpow398 power -1522176.78 -6631062 -> 4.54268854E-40996310 Inexact Rounded +xrem398 remainder -1522176.78 -6631061.77 -> -1522176.78 +xsub398 subtract -1522176.78 -6631061.77 -> 5108884.99 +xadd399 add 538.10453 522934310 -> 522934848 Inexact Rounded +xcom399 compare 538.10453 522934310 -> -1 +xdiv399 divide 538.10453 522934310 -> 0.00000102900980 Inexact Rounded +xdvi399 divideint 538.10453 522934310 -> 0 +xmul399 multiply 538.10453 522934310 -> 2.81393321E+11 Inexact Rounded +xpow399 power 538.10453 522934310 -> Infinity Overflow Inexact Rounded +xrem399 remainder 538.10453 522934310 -> 538.10453 +xsub399 subtract 538.10453 522934310 -> -522933772 Inexact Rounded +xadd400 add 880243.444E-750940977 -354.601578E-204943740 -> -3.54601578E-204943738 Inexact Rounded +xcom400 compare 880243.444E-750940977 -354.601578E-204943740 -> 1 +xdiv400 divide 880243.444E-750940977 -354.601578E-204943740 -> -2.48234497E-545997234 Inexact Rounded +xdvi400 divideint 880243.444E-750940977 -354.601578E-204943740 -> -0 +xmul400 multiply 880243.444E-750940977 -354.601578E-204943740 -> -3.12135714E-955884709 Inexact Rounded +xpow400 power 880243.444E-750940977 -4 -> Infinity Overflow Inexact Rounded +xrem400 remainder 880243.444E-750940977 -354.601578E-204943740 -> 8.80243444E-750940972 +xsub400 subtract 880243.444E-750940977 -354.601578E-204943740 -> 3.54601578E-204943738 Inexact Rounded +xadd401 add 968370.780 6677268.73 -> 7645639.51 Rounded +xcom401 compare 968370.780 6677268.73 -> -1 +xdiv401 divide 968370.780 6677268.73 -> 0.145024982 Inexact Rounded +xdvi401 divideint 968370.780 6677268.73 -> 0 +xmul401 multiply 968370.780 6677268.73 -> 6.46607193E+12 Inexact Rounded +xpow401 power 968370.780 6677269 -> 3.29990931E+39970410 Inexact Rounded +xrem401 remainder 968370.780 6677268.73 -> 968370.780 +xsub401 subtract 968370.780 6677268.73 -> -5708897.95 Rounded +xadd402 add -97.7474945 31248241.5 -> 31248143.8 Inexact Rounded +xcom402 compare -97.7474945 31248241.5 -> -1 +xdiv402 divide -97.7474945 31248241.5 -> -0.00000312809585 Inexact Rounded +xdvi402 divideint -97.7474945 31248241.5 -> -0 +xmul402 multiply -97.7474945 31248241.5 -> -3.05443731E+9 Inexact Rounded +xpow402 power -97.7474945 31248242 -> 2.90714257E+62187302 Inexact Rounded +xrem402 remainder -97.7474945 31248241.5 -> -97.7474945 +xsub402 subtract -97.7474945 31248241.5 -> -31248339.2 Inexact Rounded +xadd403 add -187582786.E+369916952 957840435E+744365567 -> 9.57840435E+744365575 Inexact Rounded +xcom403 compare -187582786.E+369916952 957840435E+744365567 -> -1 +xdiv403 divide -187582786.E+369916952 957840435E+744365567 -> -1.95839285E-374448616 Inexact Rounded +xdvi403 divideint -187582786.E+369916952 957840435E+744365567 -> -0 +xmul403 multiply -187582786.E+369916952 957840435E+744365567 -> -Infinity Inexact Overflow Rounded +xpow403 power -187582786.E+369916952 10 -> Infinity Overflow Inexact Rounded +xrem403 remainder -187582786.E+369916952 957840435E+744365567 -> -1.87582786E+369916960 +xsub403 subtract -187582786.E+369916952 957840435E+744365567 -> -9.57840435E+744365575 Inexact Rounded +xadd404 add -328026144. -125499735. -> -453525879 +xcom404 compare -328026144. -125499735. -> -1 +xdiv404 divide -328026144. -125499735. -> 2.61375965 Inexact Rounded +xdvi404 divideint -328026144. -125499735. -> 2 +xmul404 multiply -328026144. -125499735. -> 4.11671941E+16 Inexact Rounded +xpow404 power -328026144. -125499735 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem404 remainder -328026144. -125499735. -> -77026674 +xsub404 subtract -328026144. -125499735. -> -202526409 +xadd405 add -99424150.2E-523662102 3712.35030 -> 3712.35030 Inexact Rounded +xcom405 compare -99424150.2E-523662102 3712.35030 -> -1 +xdiv405 divide -99424150.2E-523662102 3712.35030 -> -2.67819958E-523662098 Inexact Rounded +xdvi405 divideint -99424150.2E-523662102 3712.35030 -> -0 +xmul405 multiply -99424150.2E-523662102 3712.35030 -> -3.69097274E-523662091 Inexact Rounded +xpow405 power -99424150.2E-523662102 3712 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem405 remainder -99424150.2E-523662102 3712.35030 -> -9.94241502E-523662095 +xsub405 subtract -99424150.2E-523662102 3712.35030 -> -3712.35030 Inexact Rounded +xadd406 add 14838.0718 9489893.28E+830631266 -> 9.48989328E+830631272 Inexact Rounded +xcom406 compare 14838.0718 9489893.28E+830631266 -> -1 +xdiv406 divide 14838.0718 9489893.28E+830631266 -> 1.56356572E-830631269 Inexact Rounded +xdvi406 divideint 14838.0718 9489893.28E+830631266 -> 0 +xmul406 multiply 14838.0718 9489893.28E+830631266 -> 1.40811718E+830631277 Inexact Rounded +xpow406 power 14838.0718 9 -> 3.48656057E+37 Inexact Rounded +xrem406 remainder 14838.0718 9489893.28E+830631266 -> 14838.0718 +xsub406 subtract 14838.0718 9489893.28E+830631266 -> -9.48989328E+830631272 Inexact Rounded +xadd407 add 71207472.8 -31835.0809 -> 71175637.7 Inexact Rounded +xcom407 compare 71207472.8 -31835.0809 -> 1 +xdiv407 divide 71207472.8 -31835.0809 -> -2236.76117 Inexact Rounded +xdvi407 divideint 71207472.8 -31835.0809 -> -2236 +xmul407 multiply 71207472.8 -31835.0809 -> -2.26689566E+12 Inexact Rounded +xpow407 power 71207472.8 -31835 -> 7.05333953E-249986 Inexact Rounded +xrem407 remainder 71207472.8 -31835.0809 -> 24231.9076 +xsub407 subtract 71207472.8 -31835.0809 -> 71239307.9 Inexact Rounded +xadd408 add -20440.4394 -44.4064328E+511085806 -> -4.44064328E+511085807 Inexact Rounded +xcom408 compare -20440.4394 -44.4064328E+511085806 -> 1 +xdiv408 divide -20440.4394 -44.4064328E+511085806 -> 4.60303567E-511085804 Inexact Rounded +xdvi408 divideint -20440.4394 -44.4064328E+511085806 -> 0 +xmul408 multiply -20440.4394 -44.4064328E+511085806 -> 9.07686999E+511085811 Inexact Rounded +xpow408 power -20440.4394 -4 -> 5.72847590E-18 Inexact Rounded +xrem408 remainder -20440.4394 -44.4064328E+511085806 -> -20440.4394 +xsub408 subtract -20440.4394 -44.4064328E+511085806 -> 4.44064328E+511085807 Inexact Rounded +xadd409 add -54.3684171E-807210192 1.04592973E-984041807 -> -5.43684171E-807210191 Inexact Rounded +xcom409 compare -54.3684171E-807210192 1.04592973E-984041807 -> -1 +xdiv409 divide -54.3684171E-807210192 1.04592973E-984041807 -> -5.19809463E+176831616 Inexact Rounded +xdvi409 divideint -54.3684171E-807210192 1.04592973E-984041807 -> NaN Division_impossible +xmul409 multiply -54.3684171E-807210192 1.04592973E-984041807 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow409 power -54.3684171E-807210192 1 -> -5.43684171E-807210191 +xrem409 remainder -54.3684171E-807210192 1.04592973E-984041807 -> NaN Division_impossible +xsub409 subtract -54.3684171E-807210192 1.04592973E-984041807 -> -5.43684171E-807210191 Inexact Rounded +xadd410 add 54310060.5E+948159739 274320701.E+205880484 -> 5.43100605E+948159746 Inexact Rounded +xcom410 compare 54310060.5E+948159739 274320701.E+205880484 -> 1 +xdiv410 divide 54310060.5E+948159739 274320701.E+205880484 -> 1.97980175E+742279254 Inexact Rounded +xdvi410 divideint 54310060.5E+948159739 274320701.E+205880484 -> NaN Division_impossible +xmul410 multiply 54310060.5E+948159739 274320701.E+205880484 -> Infinity Inexact Overflow Rounded +xpow410 power 54310060.5E+948159739 3 -> Infinity Overflow Inexact Rounded +xrem410 remainder 54310060.5E+948159739 274320701.E+205880484 -> NaN Division_impossible +xsub410 subtract 54310060.5E+948159739 274320701.E+205880484 -> 5.43100605E+948159746 Inexact Rounded +xadd411 add -657.186702 426844.39 -> 426187.203 Inexact Rounded +xcom411 compare -657.186702 426844.39 -> -1 +xdiv411 divide -657.186702 426844.39 -> -0.00153964001 Inexact Rounded +xdvi411 divideint -657.186702 426844.39 -> -0 +xmul411 multiply -657.186702 426844.39 -> -280516457 Inexact Rounded +xpow411 power -657.186702 426844 -> 3.50000575E+1202713 Inexact Rounded +xrem411 remainder -657.186702 426844.39 -> -657.186702 +xsub411 subtract -657.186702 426844.39 -> -427501.577 Inexact Rounded +xadd412 add -41593077.0 -688607.564 -> -42281684.6 Inexact Rounded +xcom412 compare -41593077.0 -688607.564 -> -1 +xdiv412 divide -41593077.0 -688607.564 -> 60.4017138 Inexact Rounded +xdvi412 divideint -41593077.0 -688607.564 -> 60 +xmul412 multiply -41593077.0 -688607.564 -> 2.86413074E+13 Inexact Rounded +xpow412 power -41593077.0 -688608 -> 1.42150750E-5246519 Inexact Rounded +xrem412 remainder -41593077.0 -688607.564 -> -276623.160 +xsub412 subtract -41593077.0 -688607.564 -> -40904469.4 Inexact Rounded +xadd413 add -5786.38132 190556652.E+177045877 -> 1.90556652E+177045885 Inexact Rounded +xcom413 compare -5786.38132 190556652.E+177045877 -> -1 +xdiv413 divide -5786.38132 190556652.E+177045877 -> -3.03656748E-177045882 Inexact Rounded +xdvi413 divideint -5786.38132 190556652.E+177045877 -> -0 +xmul413 multiply -5786.38132 190556652.E+177045877 -> -1.10263345E+177045889 Inexact Rounded +xpow413 power -5786.38132 2 -> 33482208.8 Inexact Rounded +xrem413 remainder -5786.38132 190556652.E+177045877 -> -5786.38132 +xsub413 subtract -5786.38132 190556652.E+177045877 -> -1.90556652E+177045885 Inexact Rounded +xadd414 add 737622.974 -241560693E+249506565 -> -2.41560693E+249506573 Inexact Rounded +xcom414 compare 737622.974 -241560693E+249506565 -> 1 +xdiv414 divide 737622.974 -241560693E+249506565 -> -3.05357202E-249506568 Inexact Rounded +xdvi414 divideint 737622.974 -241560693E+249506565 -> -0 +xmul414 multiply 737622.974 -241560693E+249506565 -> -1.78180717E+249506579 Inexact Rounded +xpow414 power 737622.974 -2 -> 1.83793916E-12 Inexact Rounded +xrem414 remainder 737622.974 -241560693E+249506565 -> 737622.974 +xsub414 subtract 737622.974 -241560693E+249506565 -> 2.41560693E+249506573 Inexact Rounded +xadd415 add 5615373.52 -7.27583808E-949781048 -> 5615373.52 Inexact Rounded +xcom415 compare 5615373.52 -7.27583808E-949781048 -> 1 +xdiv415 divide 5615373.52 -7.27583808E-949781048 -> -7.71783739E+949781053 Inexact Rounded +xdvi415 divideint 5615373.52 -7.27583808E-949781048 -> NaN Division_impossible +xmul415 multiply 5615373.52 -7.27583808E-949781048 -> -4.08565485E-949781041 Inexact Rounded +xpow415 power 5615373.52 -7 -> 5.68001460E-48 Inexact Rounded +xrem415 remainder 5615373.52 -7.27583808E-949781048 -> NaN Division_impossible +xsub415 subtract 5615373.52 -7.27583808E-949781048 -> 5615373.52 Inexact Rounded +xadd416 add 644136.179 -835708.103 -> -191571.924 +xcom416 compare 644136.179 -835708.103 -> 1 +xdiv416 divide 644136.179 -835708.103 -> -0.770766942 Inexact Rounded +xdvi416 divideint 644136.179 -835708.103 -> -0 +xmul416 multiply 644136.179 -835708.103 -> -5.38309824E+11 Inexact Rounded +xpow416 power 644136.179 -835708 -> 7.41936858E-4854610 Inexact Rounded +xrem416 remainder 644136.179 -835708.103 -> 644136.179 +xsub416 subtract 644136.179 -835708.103 -> 1479844.28 Inexact Rounded +xadd417 add -307.419521E+466861843 -738689976.E-199032711 -> -3.07419521E+466861845 Inexact Rounded +xcom417 compare -307.419521E+466861843 -738689976.E-199032711 -> -1 +xdiv417 divide -307.419521E+466861843 -738689976.E-199032711 -> 4.16168529E+665894547 Inexact Rounded +xdvi417 divideint -307.419521E+466861843 -738689976.E-199032711 -> NaN Division_impossible +xmul417 multiply -307.419521E+466861843 -738689976.E-199032711 -> 2.27087719E+267829143 Inexact Rounded +xpow417 power -307.419521E+466861843 -7 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem417 remainder -307.419521E+466861843 -738689976.E-199032711 -> NaN Division_impossible +xsub417 subtract -307.419521E+466861843 -738689976.E-199032711 -> -3.07419521E+466861845 Inexact Rounded +xadd418 add -619642.130 -226740537.E-902590153 -> -619642.130 Inexact Rounded +xcom418 compare -619642.130 -226740537.E-902590153 -> -1 +xdiv418 divide -619642.130 -226740537.E-902590153 -> 2.73282466E+902590150 Inexact Rounded +xdvi418 divideint -619642.130 -226740537.E-902590153 -> NaN Division_impossible +xmul418 multiply -619642.130 -226740537.E-902590153 -> 1.40497989E-902590139 Inexact Rounded +xpow418 power -619642.130 -2 -> 2.60446259E-12 Inexact Rounded +xrem418 remainder -619642.130 -226740537.E-902590153 -> NaN Division_impossible +xsub418 subtract -619642.130 -226740537.E-902590153 -> -619642.130 Inexact Rounded +xadd419 add -31068.7549 -3.41495042E+86001379 -> -3.41495042E+86001379 Inexact Rounded +xcom419 compare -31068.7549 -3.41495042E+86001379 -> 1 +xdiv419 divide -31068.7549 -3.41495042E+86001379 -> 9.09786412E-86001376 Inexact Rounded +xdvi419 divideint -31068.7549 -3.41495042E+86001379 -> 0 +xmul419 multiply -31068.7549 -3.41495042E+86001379 -> 1.06098258E+86001384 Inexact Rounded +xpow419 power -31068.7549 -3 -> -3.33448258E-14 Inexact Rounded +xrem419 remainder -31068.7549 -3.41495042E+86001379 -> -31068.7549 +xsub419 subtract -31068.7549 -3.41495042E+86001379 -> 3.41495042E+86001379 Inexact Rounded +xadd420 add -68951173. -211804977.E-97318126 -> -68951173.0 Inexact Rounded +xcom420 compare -68951173. -211804977.E-97318126 -> -1 +xdiv420 divide -68951173. -211804977.E-97318126 -> 3.25540854E+97318125 Inexact Rounded +xdvi420 divideint -68951173. -211804977.E-97318126 -> NaN Division_impossible +xmul420 multiply -68951173. -211804977.E-97318126 -> 1.46042016E-97318110 Inexact Rounded +xpow420 power -68951173. -2 -> 2.10337488E-16 Inexact Rounded +xrem420 remainder -68951173. -211804977.E-97318126 -> NaN Division_impossible +xsub420 subtract -68951173. -211804977.E-97318126 -> -68951173.0 Inexact Rounded +xadd421 add -4.09492571E-301749490 434.20199E-749390952 -> -4.09492571E-301749490 Inexact Rounded +xcom421 compare -4.09492571E-301749490 434.20199E-749390952 -> -1 +xdiv421 divide -4.09492571E-301749490 434.20199E-749390952 -> -9.43092341E+447641459 Inexact Rounded +xdvi421 divideint -4.09492571E-301749490 434.20199E-749390952 -> NaN Division_impossible +xmul421 multiply -4.09492571E-301749490 434.20199E-749390952 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow421 power -4.09492571E-301749490 4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem421 remainder -4.09492571E-301749490 434.20199E-749390952 -> NaN Division_impossible +xsub421 subtract -4.09492571E-301749490 434.20199E-749390952 -> -4.09492571E-301749490 Inexact Rounded +xadd422 add 3898.03188 -82572.615 -> -78674.5831 Inexact Rounded +xcom422 compare 3898.03188 -82572.615 -> 1 +xdiv422 divide 3898.03188 -82572.615 -> -0.0472073202 Inexact Rounded +xdvi422 divideint 3898.03188 -82572.615 -> -0 +xmul422 multiply 3898.03188 -82572.615 -> -321870686 Inexact Rounded +xpow422 power 3898.03188 -82573 -> 1.33010737E-296507 Inexact Rounded +xrem422 remainder 3898.03188 -82572.615 -> 3898.03188 +xsub422 subtract 3898.03188 -82572.615 -> 86470.6469 Inexact Rounded +xadd423 add -1.7619356 -2546.64043 -> -2548.40237 Inexact Rounded +xcom423 compare -1.7619356 -2546.64043 -> 1 +xdiv423 divide -1.7619356 -2546.64043 -> 0.000691866657 Inexact Rounded +xdvi423 divideint -1.7619356 -2546.64043 -> 0 +xmul423 multiply -1.7619356 -2546.64043 -> 4487.01643 Inexact Rounded +xpow423 power -1.7619356 -2547 -> -2.90664557E-627 Inexact Rounded +xrem423 remainder -1.7619356 -2546.64043 -> -1.7619356 +xsub423 subtract -1.7619356 -2546.64043 -> 2544.87849 Inexact Rounded +xadd424 add 59714.1968 29734388.6E-564525525 -> 59714.1968 Inexact Rounded +xcom424 compare 59714.1968 29734388.6E-564525525 -> 1 +xdiv424 divide 59714.1968 29734388.6E-564525525 -> 2.00825373E+564525522 Inexact Rounded +xdvi424 divideint 59714.1968 29734388.6E-564525525 -> NaN Division_impossible +xmul424 multiply 59714.1968 29734388.6E-564525525 -> 1.77556513E-564525513 Inexact Rounded +xpow424 power 59714.1968 3 -> 2.12928005E+14 Inexact Rounded +xrem424 remainder 59714.1968 29734388.6E-564525525 -> NaN Division_impossible +xsub424 subtract 59714.1968 29734388.6E-564525525 -> 59714.1968 Inexact Rounded +xadd425 add 6.88891136E-935467395 -785049.562E-741671442 -> -7.85049562E-741671437 Inexact Rounded +xcom425 compare 6.88891136E-935467395 -785049.562E-741671442 -> 1 +xdiv425 divide 6.88891136E-935467395 -785049.562E-741671442 -> -8.77512923E-193795959 Inexact Rounded +xdvi425 divideint 6.88891136E-935467395 -785049.562E-741671442 -> -0 +xmul425 multiply 6.88891136E-935467395 -785049.562E-741671442 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow425 power 6.88891136E-935467395 -8 -> Infinity Overflow Inexact Rounded +xrem425 remainder 6.88891136E-935467395 -785049.562E-741671442 -> 6.88891136E-935467395 +xsub425 subtract 6.88891136E-935467395 -785049.562E-741671442 -> 7.85049562E-741671437 Inexact Rounded +xadd426 add 975566251 -519.858530 -> 975565731 Inexact Rounded +xcom426 compare 975566251 -519.858530 -> 1 +xdiv426 divide 975566251 -519.858530 -> -1876599.49 Inexact Rounded +xdvi426 divideint 975566251 -519.858530 -> -1876599 +xmul426 multiply 975566251 -519.858530 -> -5.07156437E+11 Inexact Rounded +xpow426 power 975566251 -520 -> 3.85905300E-4675 Inexact Rounded +xrem426 remainder 975566251 -519.858530 -> 253.460530 +xsub426 subtract 975566251 -519.858530 -> 975566771 Inexact Rounded +xadd427 add 307401954 -231481582. -> 75920372 +xcom427 compare 307401954 -231481582. -> 1 +xdiv427 divide 307401954 -231481582. -> -1.32797586 Inexact Rounded +xdvi427 divideint 307401954 -231481582. -> -1 +xmul427 multiply 307401954 -231481582. -> -7.11578906E+16 Inexact Rounded +xpow427 power 307401954 -231481582 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem427 remainder 307401954 -231481582. -> 75920372 +xsub427 subtract 307401954 -231481582. -> 538883536 +xadd428 add 2237645.48E+992947388 -60618055.3E-857316706 -> 2.23764548E+992947394 Inexact Rounded +xcom428 compare 2237645.48E+992947388 -60618055.3E-857316706 -> 1 +xdiv428 divide 2237645.48E+992947388 -60618055.3E-857316706 -> -Infinity Inexact Overflow Rounded +xdvi428 divideint 2237645.48E+992947388 -60618055.3E-857316706 -> NaN Division_impossible +xmul428 multiply 2237645.48E+992947388 -60618055.3E-857316706 -> -1.35641717E+135630696 Inexact Rounded +xpow428 power 2237645.48E+992947388 -6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem428 remainder 2237645.48E+992947388 -60618055.3E-857316706 -> NaN Division_impossible +xsub428 subtract 2237645.48E+992947388 -60618055.3E-857316706 -> 2.23764548E+992947394 Inexact Rounded +xadd429 add -403903.851 35.5049687E-72095155 -> -403903.851 Inexact Rounded +xcom429 compare -403903.851 35.5049687E-72095155 -> -1 +xdiv429 divide -403903.851 35.5049687E-72095155 -> -1.13759810E+72095159 Inexact Rounded +xdvi429 divideint -403903.851 35.5049687E-72095155 -> NaN Division_impossible +xmul429 multiply -403903.851 35.5049687E-72095155 -> -1.43405936E-72095148 Inexact Rounded +xpow429 power -403903.851 4 -> 2.66141117E+22 Inexact Rounded +xrem429 remainder -403903.851 35.5049687E-72095155 -> NaN Division_impossible +xsub429 subtract -403903.851 35.5049687E-72095155 -> -403903.851 Inexact Rounded +xadd430 add 6.48674979 -621732.532E+422575800 -> -6.21732532E+422575805 Inexact Rounded +xcom430 compare 6.48674979 -621732.532E+422575800 -> 1 +xdiv430 divide 6.48674979 -621732.532E+422575800 -> -1.04333447E-422575805 Inexact Rounded +xdvi430 divideint 6.48674979 -621732.532E+422575800 -> -0 +xmul430 multiply 6.48674979 -621732.532E+422575800 -> -4.03302337E+422575806 Inexact Rounded +xpow430 power 6.48674979 -6 -> 0.0000134226146 Inexact Rounded +xrem430 remainder 6.48674979 -621732.532E+422575800 -> 6.48674979 +xsub430 subtract 6.48674979 -621732.532E+422575800 -> 6.21732532E+422575805 Inexact Rounded +xadd431 add -31401.9418 36.3960679 -> -31365.5457 Inexact Rounded +xcom431 compare -31401.9418 36.3960679 -> -1 +xdiv431 divide -31401.9418 36.3960679 -> -862.783911 Inexact Rounded +xdvi431 divideint -31401.9418 36.3960679 -> -862 +xmul431 multiply -31401.9418 36.3960679 -> -1142907.21 Inexact Rounded +xpow431 power -31401.9418 36 -> 7.77023505E+161 Inexact Rounded +xrem431 remainder -31401.9418 36.3960679 -> -28.5312702 +xsub431 subtract -31401.9418 36.3960679 -> -31438.3379 Inexact Rounded +xadd432 add 31345321.1 51.5482191 -> 31345372.6 Inexact Rounded +xcom432 compare 31345321.1 51.5482191 -> 1 +xdiv432 divide 31345321.1 51.5482191 -> 608077.673 Inexact Rounded +xdvi432 divideint 31345321.1 51.5482191 -> 608077 +xmul432 multiply 31345321.1 51.5482191 -> 1.61579548E+9 Inexact Rounded +xpow432 power 31345321.1 52 -> 6.32385059E+389 Inexact Rounded +xrem432 remainder 31345321.1 51.5482191 -> 34.6743293 +xsub432 subtract 31345321.1 51.5482191 -> 31345269.6 Inexact Rounded +xadd433 add -64.172844 -28506227.2E-767965800 -> -64.1728440 Inexact Rounded +xcom433 compare -64.172844 -28506227.2E-767965800 -> -1 +xdiv433 divide -64.172844 -28506227.2E-767965800 -> 2.25118686E+767965794 Inexact Rounded +xdvi433 divideint -64.172844 -28506227.2E-767965800 -> NaN Division_impossible +xmul433 multiply -64.172844 -28506227.2E-767965800 -> 1.82932567E-767965791 Inexact Rounded +xpow433 power -64.172844 -3 -> -0.00000378395654 Inexact Rounded +xrem433 remainder -64.172844 -28506227.2E-767965800 -> NaN Division_impossible +xsub433 subtract -64.172844 -28506227.2E-767965800 -> -64.1728440 Inexact Rounded +xadd434 add 70437.1551 -62916.1233 -> 7521.0318 +xcom434 compare 70437.1551 -62916.1233 -> 1 +xdiv434 divide 70437.1551 -62916.1233 -> -1.11954061 Inexact Rounded +xdvi434 divideint 70437.1551 -62916.1233 -> -1 +xmul434 multiply 70437.1551 -62916.1233 -> -4.43163274E+9 Inexact Rounded +xpow434 power 70437.1551 -62916 -> 5.02945060E-305005 Inexact Rounded +xrem434 remainder 70437.1551 -62916.1233 -> 7521.0318 +xsub434 subtract 70437.1551 -62916.1233 -> 133353.278 Inexact Rounded +xadd435 add 916260164 -58.4017325 -> 916260106 Inexact Rounded +xcom435 compare 916260164 -58.4017325 -> 1 +xdiv435 divide 916260164 -58.4017325 -> -15688920.9 Inexact Rounded +xdvi435 divideint 916260164 -58.4017325 -> -15688920 +xmul435 multiply 916260164 -58.4017325 -> -5.35111810E+10 Inexact Rounded +xpow435 power 916260164 -58 -> 1.59554587E-520 Inexact Rounded +xrem435 remainder 916260164 -58.4017325 -> 54.9461000 +xsub435 subtract 916260164 -58.4017325 -> 916260222 Inexact Rounded +xadd436 add 19889085.3E-46816480 1581683.94 -> 1581683.94 Inexact Rounded +xcom436 compare 19889085.3E-46816480 1581683.94 -> -1 +xdiv436 divide 19889085.3E-46816480 1581683.94 -> 1.25746268E-46816479 Inexact Rounded +xdvi436 divideint 19889085.3E-46816480 1581683.94 -> 0 +xmul436 multiply 19889085.3E-46816480 1581683.94 -> 3.14582468E-46816467 Inexact Rounded +xpow436 power 19889085.3E-46816480 1581684 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem436 remainder 19889085.3E-46816480 1581683.94 -> 1.98890853E-46816473 +xsub436 subtract 19889085.3E-46816480 1581683.94 -> -1581683.94 Inexact Rounded +xadd437 add -56312.3383 789.466064 -> -55522.8722 Inexact Rounded +xcom437 compare -56312.3383 789.466064 -> -1 +xdiv437 divide -56312.3383 789.466064 -> -71.3296503 Inexact Rounded +xdvi437 divideint -56312.3383 789.466064 -> -71 +xmul437 multiply -56312.3383 789.466064 -> -44456680.1 Inexact Rounded +xpow437 power -56312.3383 789 -> -1.68348724E+3748 Inexact Rounded +xrem437 remainder -56312.3383 789.466064 -> -260.247756 +xsub437 subtract -56312.3383 789.466064 -> -57101.8044 Inexact Rounded +xadd438 add 183442.849 -925876106 -> -925692663 Inexact Rounded +xcom438 compare 183442.849 -925876106 -> 1 +xdiv438 divide 183442.849 -925876106 -> -0.000198128937 Inexact Rounded +xdvi438 divideint 183442.849 -925876106 -> -0 +xmul438 multiply 183442.849 -925876106 -> -1.69845351E+14 Inexact Rounded +xpow438 power 183442.849 -925876106 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem438 remainder 183442.849 -925876106 -> 183442.849 +xsub438 subtract 183442.849 -925876106 -> 926059549 Inexact Rounded +xadd439 add 971113.655E-695540249 -419351120E-977743823 -> 9.71113655E-695540244 Inexact Rounded +xcom439 compare 971113.655E-695540249 -419351120E-977743823 -> 1 +xdiv439 divide 971113.655E-695540249 -419351120E-977743823 -> -2.31575310E+282203571 Inexact Rounded +xdvi439 divideint 971113.655E-695540249 -419351120E-977743823 -> NaN Division_impossible +xmul439 multiply 971113.655E-695540249 -419351120E-977743823 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow439 power 971113.655E-695540249 -4 -> Infinity Overflow Inexact Rounded +xrem439 remainder 971113.655E-695540249 -419351120E-977743823 -> NaN Division_impossible +xsub439 subtract 971113.655E-695540249 -419351120E-977743823 -> 9.71113655E-695540244 Inexact Rounded +xadd440 add 859658551. 72338.2054 -> 859730889 Inexact Rounded +xcom440 compare 859658551. 72338.2054 -> 1 +xdiv440 divide 859658551. 72338.2054 -> 11883.8800 Inexact Rounded +xdvi440 divideint 859658551. 72338.2054 -> 11883 +xmul440 multiply 859658551. 72338.2054 -> 6.21861568E+13 Inexact Rounded +xpow440 power 859658551. 72338 -> 1.87620450E+646291 Inexact Rounded +xrem440 remainder 859658551. 72338.2054 -> 63656.2318 +xsub440 subtract 859658551. 72338.2054 -> 859586213 Inexact Rounded +xadd441 add -3.86446630E+426816068 -664.534737 -> -3.86446630E+426816068 Inexact Rounded +xcom441 compare -3.86446630E+426816068 -664.534737 -> -1 +xdiv441 divide -3.86446630E+426816068 -664.534737 -> 5.81529615E+426816065 Inexact Rounded +xdvi441 divideint -3.86446630E+426816068 -664.534737 -> NaN Division_impossible +xmul441 multiply -3.86446630E+426816068 -664.534737 -> 2.56807210E+426816071 Inexact Rounded +xpow441 power -3.86446630E+426816068 -665 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem441 remainder -3.86446630E+426816068 -664.534737 -> NaN Division_impossible +xsub441 subtract -3.86446630E+426816068 -664.534737 -> -3.86446630E+426816068 Inexact Rounded +xadd442 add -969.881818 31170.8555 -> 30200.9737 Inexact Rounded +xcom442 compare -969.881818 31170.8555 -> -1 +xdiv442 divide -969.881818 31170.8555 -> -0.0311150208 Inexact Rounded +xdvi442 divideint -969.881818 31170.8555 -> -0 +xmul442 multiply -969.881818 31170.8555 -> -30232046.0 Inexact Rounded +xpow442 power -969.881818 31171 -> -1.02865894E+93099 Inexact Rounded +xrem442 remainder -969.881818 31170.8555 -> -969.881818 +xsub442 subtract -969.881818 31170.8555 -> -32140.7373 Inexact Rounded +xadd443 add 7980537.27 85.4040512 -> 7980622.67 Inexact Rounded +xcom443 compare 7980537.27 85.4040512 -> 1 +xdiv443 divide 7980537.27 85.4040512 -> 93444.4814 Inexact Rounded +xdvi443 divideint 7980537.27 85.4040512 -> 93444 +xmul443 multiply 7980537.27 85.4040512 -> 681570214 Inexact Rounded +xpow443 power 7980537.27 85 -> 4.70685763E+586 Inexact Rounded +xrem443 remainder 7980537.27 85.4040512 -> 41.1096672 +xsub443 subtract 7980537.27 85.4040512 -> 7980451.87 Inexact Rounded +xadd444 add -114609916. 7525.14981 -> -114602391 Inexact Rounded +xcom444 compare -114609916. 7525.14981 -> -1 +xdiv444 divide -114609916. 7525.14981 -> -15230.2504 Inexact Rounded +xdvi444 divideint -114609916. 7525.14981 -> -15230 +xmul444 multiply -114609916. 7525.14981 -> -8.62456788E+11 Inexact Rounded +xpow444 power -114609916. 7525 -> -4.43620445E+60645 Inexact Rounded +xrem444 remainder -114609916. 7525.14981 -> -1884.39370 +xsub444 subtract -114609916. 7525.14981 -> -114617441 Inexact Rounded +xadd445 add 8.43404682E-500572568 474526719 -> 474526719 Inexact Rounded +xcom445 compare 8.43404682E-500572568 474526719 -> -1 +xdiv445 divide 8.43404682E-500572568 474526719 -> 1.77735973E-500572576 Inexact Rounded +xdvi445 divideint 8.43404682E-500572568 474526719 -> 0 +xmul445 multiply 8.43404682E-500572568 474526719 -> 4.00218057E-500572559 Inexact Rounded +xpow445 power 8.43404682E-500572568 474526719 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem445 remainder 8.43404682E-500572568 474526719 -> 8.43404682E-500572568 +xsub445 subtract 8.43404682E-500572568 474526719 -> -474526719 Inexact Rounded +xadd446 add 188006433 2260.17037E-978192525 -> 188006433 Inexact Rounded +xcom446 compare 188006433 2260.17037E-978192525 -> 1 +xdiv446 divide 188006433 2260.17037E-978192525 -> 8.31824165E+978192529 Inexact Rounded +xdvi446 divideint 188006433 2260.17037E-978192525 -> NaN Division_impossible +xmul446 multiply 188006433 2260.17037E-978192525 -> 4.24926569E-978192514 Inexact Rounded +xpow446 power 188006433 2 -> 3.53464188E+16 Inexact Rounded +xrem446 remainder 188006433 2260.17037E-978192525 -> NaN Division_impossible +xsub446 subtract 188006433 2260.17037E-978192525 -> 188006433 Inexact Rounded +xadd447 add -9.95836312 -866466703 -> -866466713 Inexact Rounded +xcom447 compare -9.95836312 -866466703 -> 1 +xdiv447 divide -9.95836312 -866466703 -> 1.14930707E-8 Inexact Rounded +xdvi447 divideint -9.95836312 -866466703 -> 0 +xmul447 multiply -9.95836312 -866466703 -> 8.62859006E+9 Inexact Rounded +xpow447 power -9.95836312 -866466703 -> -6.71744369E-864896630 Inexact Rounded +xrem447 remainder -9.95836312 -866466703 -> -9.95836312 +xsub447 subtract -9.95836312 -866466703 -> 866466693 Inexact Rounded +xadd448 add 80919339.2E-967231586 219.824266 -> 219.824266 Inexact Rounded +xcom448 compare 80919339.2E-967231586 219.824266 -> -1 +xdiv448 divide 80919339.2E-967231586 219.824266 -> 3.68109220E-967231581 Inexact Rounded +xdvi448 divideint 80919339.2E-967231586 219.824266 -> 0 +xmul448 multiply 80919339.2E-967231586 219.824266 -> 1.77880343E-967231576 Inexact Rounded +xpow448 power 80919339.2E-967231586 220 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem448 remainder 80919339.2E-967231586 219.824266 -> 8.09193392E-967231579 +xsub448 subtract 80919339.2E-967231586 219.824266 -> -219.824266 Inexact Rounded +xadd449 add 159579.444 -89827.5229 -> 69751.9211 +xcom449 compare 159579.444 -89827.5229 -> 1 +xdiv449 divide 159579.444 -89827.5229 -> -1.77650946 Inexact Rounded +xdvi449 divideint 159579.444 -89827.5229 -> -1 +xmul449 multiply 159579.444 -89827.5229 -> -1.43346262E+10 Inexact Rounded +xpow449 power 159579.444 -89828 -> 9.69955850E-467374 Inexact Rounded +xrem449 remainder 159579.444 -89827.5229 -> 69751.9211 +xsub449 subtract 159579.444 -89827.5229 -> 249406.967 Inexact Rounded +xadd450 add -4.54000153 6966333.74 -> 6966329.20 Inexact Rounded +xcom450 compare -4.54000153 6966333.74 -> -1 +xdiv450 divide -4.54000153 6966333.74 -> -6.51706005E-7 Inexact Rounded +xdvi450 divideint -4.54000153 6966333.74 -> -0 +xmul450 multiply -4.54000153 6966333.74 -> -31627165.8 Inexact Rounded +xpow450 power -4.54000153 6966334 -> 3.52568913E+4577271 Inexact Rounded +xrem450 remainder -4.54000153 6966333.74 -> -4.54000153 +xsub450 subtract -4.54000153 6966333.74 -> -6966338.28 Inexact Rounded +xadd451 add 28701538.7E-391015649 -920999192. -> -920999192 Inexact Rounded +xcom451 compare 28701538.7E-391015649 -920999192. -> 1 +xdiv451 divide 28701538.7E-391015649 -920999192. -> -3.11634787E-391015651 Inexact Rounded +xdvi451 divideint 28701538.7E-391015649 -920999192. -> -0 +xmul451 multiply 28701538.7E-391015649 -920999192. -> -2.64340940E-391015633 Inexact Rounded +xpow451 power 28701538.7E-391015649 -920999192 -> Infinity Overflow Inexact Rounded +xrem451 remainder 28701538.7E-391015649 -920999192. -> 2.87015387E-391015642 +xsub451 subtract 28701538.7E-391015649 -920999192. -> 920999192 Inexact Rounded +xadd452 add -361382575. -7976.15286E+898491169 -> -7.97615286E+898491172 Inexact Rounded +xcom452 compare -361382575. -7976.15286E+898491169 -> 1 +xdiv452 divide -361382575. -7976.15286E+898491169 -> 4.53078798E-898491165 Inexact Rounded +xdvi452 divideint -361382575. -7976.15286E+898491169 -> 0 +xmul452 multiply -361382575. -7976.15286E+898491169 -> 2.88244266E+898491181 Inexact Rounded +xpow452 power -361382575. -8 -> 3.43765537E-69 Inexact Rounded +xrem452 remainder -361382575. -7976.15286E+898491169 -> -361382575 +xsub452 subtract -361382575. -7976.15286E+898491169 -> 7.97615286E+898491172 Inexact Rounded +xadd453 add 7021805.61 1222952.83 -> 8244758.44 +xcom453 compare 7021805.61 1222952.83 -> 1 +xdiv453 divide 7021805.61 1222952.83 -> 5.74168148 Inexact Rounded +xdvi453 divideint 7021805.61 1222952.83 -> 5 +xmul453 multiply 7021805.61 1222952.83 -> 8.58733704E+12 Inexact Rounded +xpow453 power 7021805.61 1222953 -> 1.26540553E+8372885 Inexact Rounded +xrem453 remainder 7021805.61 1222952.83 -> 907041.46 +xsub453 subtract 7021805.61 1222952.83 -> 5798852.78 +xadd454 add -40.4811667 -79655.5635 -> -79696.0447 Inexact Rounded +xcom454 compare -40.4811667 -79655.5635 -> 1 +xdiv454 divide -40.4811667 -79655.5635 -> 0.000508202628 Inexact Rounded +xdvi454 divideint -40.4811667 -79655.5635 -> 0 +xmul454 multiply -40.4811667 -79655.5635 -> 3224550.14 Inexact Rounded +xpow454 power -40.4811667 -79656 -> 4.50174275E-128028 Inexact Rounded +xrem454 remainder -40.4811667 -79655.5635 -> -40.4811667 +xsub454 subtract -40.4811667 -79655.5635 -> 79615.0823 Inexact Rounded +xadd455 add -8755674.38E+117168177 148.903404 -> -8.75567438E+117168183 Inexact Rounded +xcom455 compare -8755674.38E+117168177 148.903404 -> -1 +xdiv455 divide -8755674.38E+117168177 148.903404 -> -5.88010357E+117168181 Inexact Rounded +xdvi455 divideint -8755674.38E+117168177 148.903404 -> NaN Division_impossible +xmul455 multiply -8755674.38E+117168177 148.903404 -> -1.30374972E+117168186 Inexact Rounded +xpow455 power -8755674.38E+117168177 149 -> -Infinity Overflow Inexact Rounded +xrem455 remainder -8755674.38E+117168177 148.903404 -> NaN Division_impossible +xsub455 subtract -8755674.38E+117168177 148.903404 -> -8.75567438E+117168183 Inexact Rounded +xadd456 add 34.5329781E+382829392 -45.2177309 -> 3.45329781E+382829393 Inexact Rounded +xcom456 compare 34.5329781E+382829392 -45.2177309 -> 1 +xdiv456 divide 34.5329781E+382829392 -45.2177309 -> -7.63704357E+382829391 Inexact Rounded +xdvi456 divideint 34.5329781E+382829392 -45.2177309 -> NaN Division_impossible +xmul456 multiply 34.5329781E+382829392 -45.2177309 -> -1.56150291E+382829395 Inexact Rounded +xpow456 power 34.5329781E+382829392 -45 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem456 remainder 34.5329781E+382829392 -45.2177309 -> NaN Division_impossible +xsub456 subtract 34.5329781E+382829392 -45.2177309 -> 3.45329781E+382829393 Inexact Rounded +xadd457 add -37958476.0 584367.935 -> -37374108.1 Inexact Rounded +xcom457 compare -37958476.0 584367.935 -> -1 +xdiv457 divide -37958476.0 584367.935 -> -64.9564662 Inexact Rounded +xdvi457 divideint -37958476.0 584367.935 -> -64 +xmul457 multiply -37958476.0 584367.935 -> -2.21817162E+13 Inexact Rounded +xpow457 power -37958476.0 584368 -> 3.20538268E+4429105 Inexact Rounded +xrem457 remainder -37958476.0 584367.935 -> -558928.160 +xsub457 subtract -37958476.0 584367.935 -> -38542843.9 Inexact Rounded +xadd458 add 495233.553E-414152215 62352759.2 -> 62352759.2 Inexact Rounded +xcom458 compare 495233.553E-414152215 62352759.2 -> -1 +xdiv458 divide 495233.553E-414152215 62352759.2 -> 7.94244809E-414152218 Inexact Rounded +xdvi458 divideint 495233.553E-414152215 62352759.2 -> 0 +xmul458 multiply 495233.553E-414152215 62352759.2 -> 3.08791785E-414152202 Inexact Rounded +xpow458 power 495233.553E-414152215 62352759 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem458 remainder 495233.553E-414152215 62352759.2 -> 4.95233553E-414152210 +xsub458 subtract 495233.553E-414152215 62352759.2 -> -62352759.2 Inexact Rounded +xadd459 add -502343060 -96828.994 -> -502439889 Inexact Rounded +xcom459 compare -502343060 -96828.994 -> -1 +xdiv459 divide -502343060 -96828.994 -> 5187.94050 Inexact Rounded +xdvi459 divideint -502343060 -96828.994 -> 5187 +xmul459 multiply -502343060 -96828.994 -> 4.86413731E+13 Inexact Rounded +xpow459 power -502343060 -96829 -> -6.78602119E-842510 Inexact Rounded +xrem459 remainder -502343060 -96828.994 -> -91068.122 +xsub459 subtract -502343060 -96828.994 -> -502246231 Inexact Rounded +xadd460 add -22.439639E+916362878 -39.4037681 -> -2.24396390E+916362879 Inexact Rounded +xcom460 compare -22.439639E+916362878 -39.4037681 -> -1 +xdiv460 divide -22.439639E+916362878 -39.4037681 -> 5.69479521E+916362877 Inexact Rounded +xdvi460 divideint -22.439639E+916362878 -39.4037681 -> NaN Division_impossible +xmul460 multiply -22.439639E+916362878 -39.4037681 -> 8.84206331E+916362880 Inexact Rounded +xpow460 power -22.439639E+916362878 -39 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem460 remainder -22.439639E+916362878 -39.4037681 -> NaN Division_impossible +xsub460 subtract -22.439639E+916362878 -39.4037681 -> -2.24396390E+916362879 Inexact Rounded +xadd461 add 718180.587E-957473722 1.66223443 -> 1.66223443 Inexact Rounded +xcom461 compare 718180.587E-957473722 1.66223443 -> -1 +xdiv461 divide 718180.587E-957473722 1.66223443 -> 4.32057340E-957473717 Inexact Rounded +xdvi461 divideint 718180.587E-957473722 1.66223443 -> 0 +xmul461 multiply 718180.587E-957473722 1.66223443 -> 1.19378450E-957473716 Inexact Rounded +xpow461 power 718180.587E-957473722 2 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem461 remainder 718180.587E-957473722 1.66223443 -> 7.18180587E-957473717 +xsub461 subtract 718180.587E-957473722 1.66223443 -> -1.66223443 Inexact Rounded +xadd462 add -51592.2698 -713885.741 -> -765478.011 Inexact Rounded +xcom462 compare -51592.2698 -713885.741 -> 1 +xdiv462 divide -51592.2698 -713885.741 -> 0.0722696460 Inexact Rounded +xdvi462 divideint -51592.2698 -713885.741 -> 0 +xmul462 multiply -51592.2698 -713885.741 -> 3.68309858E+10 Inexact Rounded +xpow462 power -51592.2698 -713886 -> 6.38576920E-3364249 Inexact Rounded +xrem462 remainder -51592.2698 -713885.741 -> -51592.2698 +xsub462 subtract -51592.2698 -713885.741 -> 662293.471 Inexact Rounded +xadd463 add 51.2279848E+80439745 207.55925E+865165070 -> 2.07559250E+865165072 Inexact Rounded +xcom463 compare 51.2279848E+80439745 207.55925E+865165070 -> -1 +xdiv463 divide 51.2279848E+80439745 207.55925E+865165070 -> 2.46811379E-784725326 Inexact Rounded +xdvi463 divideint 51.2279848E+80439745 207.55925E+865165070 -> 0 +xmul463 multiply 51.2279848E+80439745 207.55925E+865165070 -> 1.06328421E+945604819 Inexact Rounded +xpow463 power 51.2279848E+80439745 2 -> 2.62430643E+160879493 Inexact Rounded +xrem463 remainder 51.2279848E+80439745 207.55925E+865165070 -> 5.12279848E+80439746 +xsub463 subtract 51.2279848E+80439745 207.55925E+865165070 -> -2.07559250E+865165072 Inexact Rounded +xadd464 add -5983.23468 -39.9544513 -> -6023.18913 Inexact Rounded +xcom464 compare -5983.23468 -39.9544513 -> -1 +xdiv464 divide -5983.23468 -39.9544513 -> 149.751392 Inexact Rounded +xdvi464 divideint -5983.23468 -39.9544513 -> 149 +xmul464 multiply -5983.23468 -39.9544513 -> 239056.859 Inexact Rounded +xpow464 power -5983.23468 -40 -> 8.36678291E-152 Inexact Rounded +xrem464 remainder -5983.23468 -39.9544513 -> -30.0214363 +xsub464 subtract -5983.23468 -39.9544513 -> -5943.28023 Inexact Rounded +xadd465 add 921639332.E-917542963 287325.891 -> 287325.891 Inexact Rounded +xcom465 compare 921639332.E-917542963 287325.891 -> -1 +xdiv465 divide 921639332.E-917542963 287325.891 -> 3.20764456E-917542960 Inexact Rounded +xdvi465 divideint 921639332.E-917542963 287325.891 -> 0 +xmul465 multiply 921639332.E-917542963 287325.891 -> 2.64810842E-917542949 Inexact Rounded +xpow465 power 921639332.E-917542963 287326 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem465 remainder 921639332.E-917542963 287325.891 -> 9.21639332E-917542955 +xsub465 subtract 921639332.E-917542963 287325.891 -> -287325.891 Inexact Rounded +xadd466 add 91095916.8E-787312969 -58643.418E+58189880 -> -5.86434180E+58189884 Inexact Rounded +xcom466 compare 91095916.8E-787312969 -58643.418E+58189880 -> 1 +xdiv466 divide 91095916.8E-787312969 -58643.418E+58189880 -> -1.55338689E-845502846 Inexact Rounded +xdvi466 divideint 91095916.8E-787312969 -58643.418E+58189880 -> -0 +xmul466 multiply 91095916.8E-787312969 -58643.418E+58189880 -> -5.34217593E-729123077 Inexact Rounded +xpow466 power 91095916.8E-787312969 -6 -> Infinity Overflow Inexact Rounded +xrem466 remainder 91095916.8E-787312969 -58643.418E+58189880 -> 9.10959168E-787312962 +xsub466 subtract 91095916.8E-787312969 -58643.418E+58189880 -> 5.86434180E+58189884 Inexact Rounded +xadd467 add -6410.5555 -234964259 -> -234970670 Inexact Rounded +xcom467 compare -6410.5555 -234964259 -> 1 +xdiv467 divide -6410.5555 -234964259 -> 0.0000272831090 Inexact Rounded +xdvi467 divideint -6410.5555 -234964259 -> 0 +xmul467 multiply -6410.5555 -234964259 -> 1.50625142E+12 Inexact Rounded +xpow467 power -6410.5555 -234964259 -> -1.27064467E-894484419 Inexact Rounded +xrem467 remainder -6410.5555 -234964259 -> -6410.5555 +xsub467 subtract -6410.5555 -234964259 -> 234957848 Inexact Rounded +xadd468 add -5.32711606 -8447286.21 -> -8447291.54 Inexact Rounded +xcom468 compare -5.32711606 -8447286.21 -> 1 +xdiv468 divide -5.32711606 -8447286.21 -> 6.30630468E-7 Inexact Rounded +xdvi468 divideint -5.32711606 -8447286.21 -> 0 +xmul468 multiply -5.32711606 -8447286.21 -> 44999674.0 Inexact Rounded +xpow468 power -5.32711606 -8447286 -> 9.09138728E-6136888 Inexact Rounded +xrem468 remainder -5.32711606 -8447286.21 -> -5.32711606 +xsub468 subtract -5.32711606 -8447286.21 -> 8447280.88 Inexact Rounded +xadd469 add -82272171.8 -776.238587E-372690416 -> -82272171.8 Inexact Rounded +xcom469 compare -82272171.8 -776.238587E-372690416 -> -1 +xdiv469 divide -82272171.8 -776.238587E-372690416 -> 1.05988253E+372690421 Inexact Rounded +xdvi469 divideint -82272171.8 -776.238587E-372690416 -> NaN Division_impossible +xmul469 multiply -82272171.8 -776.238587E-372690416 -> 6.38628344E-372690406 Inexact Rounded +xpow469 power -82272171.8 -8 -> 4.76404994E-64 Inexact Rounded +xrem469 remainder -82272171.8 -776.238587E-372690416 -> NaN Division_impossible +xsub469 subtract -82272171.8 -776.238587E-372690416 -> -82272171.8 Inexact Rounded +xadd470 add 412411244.E-774339264 866452.465 -> 866452.465 Inexact Rounded +xcom470 compare 412411244.E-774339264 866452.465 -> -1 +xdiv470 divide 412411244.E-774339264 866452.465 -> 4.75976768E-774339262 Inexact Rounded +xdvi470 divideint 412411244.E-774339264 866452.465 -> 0 +xmul470 multiply 412411244.E-774339264 866452.465 -> 3.57334739E-774339250 Inexact Rounded +xpow470 power 412411244.E-774339264 866452 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem470 remainder 412411244.E-774339264 866452.465 -> 4.12411244E-774339256 +xsub470 subtract 412411244.E-774339264 866452.465 -> -866452.465 Inexact Rounded +xadd471 add -103.474598 -3.01660661E-446661257 -> -103.474598 Inexact Rounded +xcom471 compare -103.474598 -3.01660661E-446661257 -> -1 +xdiv471 divide -103.474598 -3.01660661E-446661257 -> 3.43016546E+446661258 Inexact Rounded +xdvi471 divideint -103.474598 -3.01660661E-446661257 -> NaN Division_impossible +xmul471 multiply -103.474598 -3.01660661E-446661257 -> 3.12142156E-446661255 Inexact Rounded +xpow471 power -103.474598 -3 -> -9.02607123E-7 Inexact Rounded +xrem471 remainder -103.474598 -3.01660661E-446661257 -> NaN Division_impossible +xsub471 subtract -103.474598 -3.01660661E-446661257 -> -103.474598 Inexact Rounded +xadd472 add -31027.8323 -475378186. -> -475409214 Inexact Rounded +xcom472 compare -31027.8323 -475378186. -> 1 +xdiv472 divide -31027.8323 -475378186. -> 0.0000652697856 Inexact Rounded +xdvi472 divideint -31027.8323 -475378186. -> 0 +xmul472 multiply -31027.8323 -475378186. -> 1.47499546E+13 Inexact Rounded +xpow472 power -31027.8323 -475378186 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem472 remainder -31027.8323 -475378186. -> -31027.8323 +xsub472 subtract -31027.8323 -475378186. -> 475347158 Inexact Rounded +xadd473 add -1199339.72 -5.73068392E+53774632 -> -5.73068392E+53774632 Inexact Rounded +xcom473 compare -1199339.72 -5.73068392E+53774632 -> 1 +xdiv473 divide -1199339.72 -5.73068392E+53774632 -> 2.09283872E-53774627 Inexact Rounded +xdvi473 divideint -1199339.72 -5.73068392E+53774632 -> 0 +xmul473 multiply -1199339.72 -5.73068392E+53774632 -> 6.87303685E+53774638 Inexact Rounded +xpow473 power -1199339.72 -6 -> 3.36005741E-37 Inexact Rounded +xrem473 remainder -1199339.72 -5.73068392E+53774632 -> -1199339.72 +xsub473 subtract -1199339.72 -5.73068392E+53774632 -> 5.73068392E+53774632 Inexact Rounded +xadd474 add -732908.930E+364345433 -3486146.26 -> -7.32908930E+364345438 Inexact Rounded +xcom474 compare -732908.930E+364345433 -3486146.26 -> -1 +xdiv474 divide -732908.930E+364345433 -3486146.26 -> 2.10234705E+364345432 Inexact Rounded +xdvi474 divideint -732908.930E+364345433 -3486146.26 -> NaN Division_impossible +xmul474 multiply -732908.930E+364345433 -3486146.26 -> 2.55502773E+364345445 Inexact Rounded +xpow474 power -732908.930E+364345433 -3486146 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem474 remainder -732908.930E+364345433 -3486146.26 -> NaN Division_impossible +xsub474 subtract -732908.930E+364345433 -3486146.26 -> -7.32908930E+364345438 Inexact Rounded +xadd475 add -2376150.83 -46777583.3 -> -49153734.1 Inexact Rounded +xcom475 compare -2376150.83 -46777583.3 -> 1 +xdiv475 divide -2376150.83 -46777583.3 -> 0.0507967847 Inexact Rounded +xdvi475 divideint -2376150.83 -46777583.3 -> 0 +xmul475 multiply -2376150.83 -46777583.3 -> 1.11150593E+14 Inexact Rounded +xpow475 power -2376150.83 -46777583 -> -3.51886193E-298247976 Inexact Rounded +xrem475 remainder -2376150.83 -46777583.3 -> -2376150.83 +xsub475 subtract -2376150.83 -46777583.3 -> 44401432.5 Inexact Rounded +xadd476 add 6.3664211 -140854908. -> -140854902 Inexact Rounded +xcom476 compare 6.3664211 -140854908. -> 1 +xdiv476 divide 6.3664211 -140854908. -> -4.51984328E-8 Inexact Rounded +xdvi476 divideint 6.3664211 -140854908. -> -0 +xmul476 multiply 6.3664211 -140854908. -> -896741658 Inexact Rounded +xpow476 power 6.3664211 -140854908 -> 7.25432803E-113232608 Inexact Rounded +xrem476 remainder 6.3664211 -140854908. -> 6.3664211 +xsub476 subtract 6.3664211 -140854908. -> 140854914 Inexact Rounded +xadd477 add -15.791522 1902.30210E+90741844 -> 1.90230210E+90741847 Inexact Rounded +xcom477 compare -15.791522 1902.30210E+90741844 -> -1 +xdiv477 divide -15.791522 1902.30210E+90741844 -> -8.30126929E-90741847 Inexact Rounded +xdvi477 divideint -15.791522 1902.30210E+90741844 -> -0 +xmul477 multiply -15.791522 1902.30210E+90741844 -> -3.00402455E+90741848 Inexact Rounded +xpow477 power -15.791522 2 -> 249.372167 Inexact Rounded +xrem477 remainder -15.791522 1902.30210E+90741844 -> -15.791522 +xsub477 subtract -15.791522 1902.30210E+90741844 -> -1.90230210E+90741847 Inexact Rounded +xadd478 add 15356.1505E+373950429 2.88020400 -> 1.53561505E+373950433 Inexact Rounded +xcom478 compare 15356.1505E+373950429 2.88020400 -> 1 +xdiv478 divide 15356.1505E+373950429 2.88020400 -> 5.33161905E+373950432 Inexact Rounded +xdvi478 divideint 15356.1505E+373950429 2.88020400 -> NaN Division_impossible +xmul478 multiply 15356.1505E+373950429 2.88020400 -> 4.42288461E+373950433 Inexact Rounded +xpow478 power 15356.1505E+373950429 3 -> Infinity Overflow Inexact Rounded +xrem478 remainder 15356.1505E+373950429 2.88020400 -> NaN Division_impossible +xsub478 subtract 15356.1505E+373950429 2.88020400 -> 1.53561505E+373950433 Inexact Rounded +xadd479 add -3.12001326E+318884762 9567.21595 -> -3.12001326E+318884762 Inexact Rounded +xcom479 compare -3.12001326E+318884762 9567.21595 -> -1 +xdiv479 divide -3.12001326E+318884762 9567.21595 -> -3.26115066E+318884758 Inexact Rounded +xdvi479 divideint -3.12001326E+318884762 9567.21595 -> NaN Division_impossible +xmul479 multiply -3.12001326E+318884762 9567.21595 -> -2.98498406E+318884766 Inexact Rounded +xpow479 power -3.12001326E+318884762 9567 -> -Infinity Overflow Inexact Rounded +xrem479 remainder -3.12001326E+318884762 9567.21595 -> NaN Division_impossible +xsub479 subtract -3.12001326E+318884762 9567.21595 -> -3.12001326E+318884762 Inexact Rounded +xadd480 add 49436.6528 751.919517 -> 50188.5723 Inexact Rounded +xcom480 compare 49436.6528 751.919517 -> 1 +xdiv480 divide 49436.6528 751.919517 -> 65.7472664 Inexact Rounded +xdvi480 divideint 49436.6528 751.919517 -> 65 +xmul480 multiply 49436.6528 751.919517 -> 37172384.1 Inexact Rounded +xpow480 power 49436.6528 752 -> 8.41185718E+3529 Inexact Rounded +xrem480 remainder 49436.6528 751.919517 -> 561.884195 +xsub480 subtract 49436.6528 751.919517 -> 48684.7333 Inexact Rounded +xadd481 add 552.669453 8.3725760E+16223526 -> 8.37257600E+16223526 Inexact Rounded +xcom481 compare 552.669453 8.3725760E+16223526 -> -1 +xdiv481 divide 552.669453 8.3725760E+16223526 -> 6.60094878E-16223525 Inexact Rounded +xdvi481 divideint 552.669453 8.3725760E+16223526 -> 0 +xmul481 multiply 552.669453 8.3725760E+16223526 -> 4.62726700E+16223529 Inexact Rounded +xpow481 power 552.669453 8 -> 8.70409632E+21 Inexact Rounded +xrem481 remainder 552.669453 8.3725760E+16223526 -> 552.669453 +xsub481 subtract 552.669453 8.3725760E+16223526 -> -8.37257600E+16223526 Inexact Rounded +xadd482 add -3266303 453741.520 -> -2812561.48 Rounded +xcom482 compare -3266303 453741.520 -> -1 +xdiv482 divide -3266303 453741.520 -> -7.19859844 Inexact Rounded +xdvi482 divideint -3266303 453741.520 -> -7 +xmul482 multiply -3266303 453741.520 -> -1.48205729E+12 Inexact Rounded +xpow482 power -3266303 453742 -> 1.02497315E+2955701 Inexact Rounded +xrem482 remainder -3266303 453741.520 -> -90112.360 +xsub482 subtract -3266303 453741.520 -> -3720044.52 Rounded +xadd483 add 12302757.4 542922.487E+414443353 -> 5.42922487E+414443358 Inexact Rounded +xcom483 compare 12302757.4 542922.487E+414443353 -> -1 +xdiv483 divide 12302757.4 542922.487E+414443353 -> 2.26602465E-414443352 Inexact Rounded +xdvi483 divideint 12302757.4 542922.487E+414443353 -> 0 +xmul483 multiply 12302757.4 542922.487E+414443353 -> 6.67944364E+414443365 Inexact Rounded +xpow483 power 12302757.4 5 -> 2.81846276E+35 Inexact Rounded +xrem483 remainder 12302757.4 542922.487E+414443353 -> 12302757.4 +xsub483 subtract 12302757.4 542922.487E+414443353 -> -5.42922487E+414443358 Inexact Rounded +xadd484 add -5670757.79E-784754984 128144.503 -> 128144.503 Inexact Rounded +xcom484 compare -5670757.79E-784754984 128144.503 -> -1 +xdiv484 divide -5670757.79E-784754984 128144.503 -> -4.42528369E-784754983 Inexact Rounded +xdvi484 divideint -5670757.79E-784754984 128144.503 -> -0 +xmul484 multiply -5670757.79E-784754984 128144.503 -> -7.26676439E-784754973 Inexact Rounded +xpow484 power -5670757.79E-784754984 128145 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem484 remainder -5670757.79E-784754984 128144.503 -> -5.67075779E-784754978 +xsub484 subtract -5670757.79E-784754984 128144.503 -> -128144.503 Inexact Rounded +xadd485 add 22.7721968E+842530698 5223.70462 -> 2.27721968E+842530699 Inexact Rounded +xcom485 compare 22.7721968E+842530698 5223.70462 -> 1 +xdiv485 divide 22.7721968E+842530698 5223.70462 -> 4.35939596E+842530695 Inexact Rounded +xdvi485 divideint 22.7721968E+842530698 5223.70462 -> NaN Division_impossible +xmul485 multiply 22.7721968E+842530698 5223.70462 -> 1.18955230E+842530703 Inexact Rounded +xpow485 power 22.7721968E+842530698 5224 -> Infinity Overflow Inexact Rounded +xrem485 remainder 22.7721968E+842530698 5223.70462 -> NaN Division_impossible +xsub485 subtract 22.7721968E+842530698 5223.70462 -> 2.27721968E+842530699 Inexact Rounded +xadd486 add 88.5158199E-980164357 325846116 -> 325846116 Inexact Rounded +xcom486 compare 88.5158199E-980164357 325846116 -> -1 +xdiv486 divide 88.5158199E-980164357 325846116 -> 2.71649148E-980164364 Inexact Rounded +xdvi486 divideint 88.5158199E-980164357 325846116 -> 0 +xmul486 multiply 88.5158199E-980164357 325846116 -> 2.88425361E-980164347 Inexact Rounded +xpow486 power 88.5158199E-980164357 325846116 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem486 remainder 88.5158199E-980164357 325846116 -> 8.85158199E-980164356 +xsub486 subtract 88.5158199E-980164357 325846116 -> -325846116 Inexact Rounded +xadd487 add -22881.0408 5.63661562 -> -22875.4042 Inexact Rounded +xcom487 compare -22881.0408 5.63661562 -> -1 +xdiv487 divide -22881.0408 5.63661562 -> -4059.35802 Inexact Rounded +xdvi487 divideint -22881.0408 5.63661562 -> -4059 +xmul487 multiply -22881.0408 5.63661562 -> -128971.632 Inexact Rounded +xpow487 power -22881.0408 6 -> 1.43500909E+26 Inexact Rounded +xrem487 remainder -22881.0408 5.63661562 -> -2.01799842 +xsub487 subtract -22881.0408 5.63661562 -> -22886.6774 Inexact Rounded +xadd488 add -7157.57449 -76.4455519E-85647047 -> -7157.57449 Inexact Rounded +xcom488 compare -7157.57449 -76.4455519E-85647047 -> -1 +xdiv488 divide -7157.57449 -76.4455519E-85647047 -> 9.36297052E+85647048 Inexact Rounded +xdvi488 divideint -7157.57449 -76.4455519E-85647047 -> NaN Division_impossible +xmul488 multiply -7157.57449 -76.4455519E-85647047 -> 5.47164732E-85647042 Inexact Rounded +xpow488 power -7157.57449 -8 -> 1.45168700E-31 Inexact Rounded +xrem488 remainder -7157.57449 -76.4455519E-85647047 -> NaN Division_impossible +xsub488 subtract -7157.57449 -76.4455519E-85647047 -> -7157.57449 Inexact Rounded +xadd489 add -503113.801 -9715149.82E-612184422 -> -503113.801 Inexact Rounded +xcom489 compare -503113.801 -9715149.82E-612184422 -> -1 +xdiv489 divide -503113.801 -9715149.82E-612184422 -> 5.17865201E+612184420 Inexact Rounded +xdvi489 divideint -503113.801 -9715149.82E-612184422 -> NaN Division_impossible +xmul489 multiply -503113.801 -9715149.82E-612184422 -> 4.88782595E-612184410 Inexact Rounded +xpow489 power -503113.801 -10 -> 9.62360287E-58 Inexact Rounded +xrem489 remainder -503113.801 -9715149.82E-612184422 -> NaN Division_impossible +xsub489 subtract -503113.801 -9715149.82E-612184422 -> -503113.801 Inexact Rounded +xadd490 add -3066962.41 -55.3096879 -> -3067017.72 Inexact Rounded +xcom490 compare -3066962.41 -55.3096879 -> -1 +xdiv490 divide -3066962.41 -55.3096879 -> 55450.7271 Inexact Rounded +xdvi490 divideint -3066962.41 -55.3096879 -> 55450 +xmul490 multiply -3066962.41 -55.3096879 -> 169632734 Inexact Rounded +xpow490 power -3066962.41 -55 -> -1.70229600E-357 Inexact Rounded +xrem490 remainder -3066962.41 -55.3096879 -> -40.2159450 +xsub490 subtract -3066962.41 -55.3096879 -> -3066907.10 Inexact Rounded +xadd491 add -53311.5738E+156608936 -7.45890666 -> -5.33115738E+156608940 Inexact Rounded +xcom491 compare -53311.5738E+156608936 -7.45890666 -> -1 +xdiv491 divide -53311.5738E+156608936 -7.45890666 -> 7.14737109E+156608939 Inexact Rounded +xdvi491 divideint -53311.5738E+156608936 -7.45890666 -> NaN Division_impossible +xmul491 multiply -53311.5738E+156608936 -7.45890666 -> 3.97646053E+156608941 Inexact Rounded +xpow491 power -53311.5738E+156608936 -7 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem491 remainder -53311.5738E+156608936 -7.45890666 -> NaN Division_impossible +xsub491 subtract -53311.5738E+156608936 -7.45890666 -> -5.33115738E+156608940 Inexact Rounded +xadd492 add 998890068. -92.057879 -> 998889976 Inexact Rounded +xcom492 compare 998890068. -92.057879 -> 1 +xdiv492 divide 998890068. -92.057879 -> -10850674.4 Inexact Rounded +xdvi492 divideint 998890068. -92.057879 -> -10850674 +xmul492 multiply 998890068. -92.057879 -> -9.19557010E+10 Inexact Rounded +xpow492 power 998890068. -92 -> 1.10757225E-828 Inexact Rounded +xrem492 remainder 998890068. -92.057879 -> 33.839554 +xsub492 subtract 998890068. -92.057879 -> 998890160 Inexact Rounded +xadd493 add 122.495591 -407836028. -> -407835906 Inexact Rounded +xcom493 compare 122.495591 -407836028. -> 1 +xdiv493 divide 122.495591 -407836028. -> -3.00355002E-7 Inexact Rounded +xdvi493 divideint 122.495591 -407836028. -> -0 +xmul493 multiply 122.495591 -407836028. -> -4.99581153E+10 Inexact Rounded +xpow493 power 122.495591 -407836028 -> 4.82463773E-851610754 Inexact Rounded +xrem493 remainder 122.495591 -407836028. -> 122.495591 +xsub493 subtract 122.495591 -407836028. -> 407836150 Inexact Rounded +xadd494 add 187098.488 6220.05584E-236541249 -> 187098.488 Inexact Rounded +xcom494 compare 187098.488 6220.05584E-236541249 -> 1 +xdiv494 divide 187098.488 6220.05584E-236541249 -> 3.00798727E+236541250 Inexact Rounded +xdvi494 divideint 187098.488 6220.05584E-236541249 -> NaN Division_impossible +xmul494 multiply 187098.488 6220.05584E-236541249 -> 1.16376304E-236541240 Inexact Rounded +xpow494 power 187098.488 6 -> 4.28964811E+31 Inexact Rounded +xrem494 remainder 187098.488 6220.05584E-236541249 -> NaN Division_impossible +xsub494 subtract 187098.488 6220.05584E-236541249 -> 187098.488 Inexact Rounded +xadd495 add 4819899.21E+432982550 -727441917 -> 4.81989921E+432982556 Inexact Rounded +xcom495 compare 4819899.21E+432982550 -727441917 -> 1 +xdiv495 divide 4819899.21E+432982550 -727441917 -> -6.62582001E+432982547 Inexact Rounded +xdvi495 divideint 4819899.21E+432982550 -727441917 -> NaN Division_impossible +xmul495 multiply 4819899.21E+432982550 -727441917 -> -3.50619672E+432982565 Inexact Rounded +xpow495 power 4819899.21E+432982550 -727441917 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem495 remainder 4819899.21E+432982550 -727441917 -> NaN Division_impossible +xsub495 subtract 4819899.21E+432982550 -727441917 -> 4.81989921E+432982556 Inexact Rounded +xadd496 add 5770.01020E+507459752 -4208339.33E-129766680 -> 5.77001020E+507459755 Inexact Rounded +xcom496 compare 5770.01020E+507459752 -4208339.33E-129766680 -> 1 +xdiv496 divide 5770.01020E+507459752 -4208339.33E-129766680 -> -1.37108958E+637226429 Inexact Rounded +xdvi496 divideint 5770.01020E+507459752 -4208339.33E-129766680 -> NaN Division_impossible +xmul496 multiply 5770.01020E+507459752 -4208339.33E-129766680 -> -2.42821609E+377693082 Inexact Rounded +xpow496 power 5770.01020E+507459752 -4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem496 remainder 5770.01020E+507459752 -4208339.33E-129766680 -> NaN Division_impossible +xsub496 subtract 5770.01020E+507459752 -4208339.33E-129766680 -> 5.77001020E+507459755 Inexact Rounded +xadd497 add -286.371320 710319152 -> 710318866 Inexact Rounded +xcom497 compare -286.371320 710319152 -> -1 +xdiv497 divide -286.371320 710319152 -> -4.03158664E-7 Inexact Rounded +xdvi497 divideint -286.371320 710319152 -> -0 +xmul497 multiply -286.371320 710319152 -> -2.03415033E+11 Inexact Rounded +xpow497 power -286.371320 710319152 -> Infinity Overflow Inexact Rounded +xrem497 remainder -286.371320 710319152 -> -286.371320 +xsub497 subtract -286.371320 710319152 -> -710319438 Inexact Rounded +xadd498 add -7.27403536 -481469656E-835183700 -> -7.27403536 Inexact Rounded +xcom498 compare -7.27403536 -481469656E-835183700 -> -1 +xdiv498 divide -7.27403536 -481469656E-835183700 -> 1.51079830E+835183692 Inexact Rounded +xdvi498 divideint -7.27403536 -481469656E-835183700 -> NaN Division_impossible +xmul498 multiply -7.27403536 -481469656E-835183700 -> 3.50222730E-835183691 Inexact Rounded +xpow498 power -7.27403536 -5 -> -0.0000491046885 Inexact Rounded +xrem498 remainder -7.27403536 -481469656E-835183700 -> NaN Division_impossible +xsub498 subtract -7.27403536 -481469656E-835183700 -> -7.27403536 Inexact Rounded +xadd499 add -6157.74292 -94075286.2E+92555877 -> -9.40752862E+92555884 Inexact Rounded +xcom499 compare -6157.74292 -94075286.2E+92555877 -> 1 +xdiv499 divide -6157.74292 -94075286.2E+92555877 -> 6.54554790E-92555882 Inexact Rounded +xdvi499 divideint -6157.74292 -94075286.2E+92555877 -> 0 +xmul499 multiply -6157.74292 -94075286.2E+92555877 -> 5.79291428E+92555888 Inexact Rounded +xpow499 power -6157.74292 -9 -> -7.85608218E-35 Inexact Rounded +xrem499 remainder -6157.74292 -94075286.2E+92555877 -> -6157.74292 +xsub499 subtract -6157.74292 -94075286.2E+92555877 -> 9.40752862E+92555884 Inexact Rounded +xadd500 add -525445087.E+231529167 188227460 -> -5.25445087E+231529175 Inexact Rounded +xcom500 compare -525445087.E+231529167 188227460 -> -1 +xdiv500 divide -525445087.E+231529167 188227460 -> -2.79154321E+231529167 Inexact Rounded +xdvi500 divideint -525445087.E+231529167 188227460 -> NaN Division_impossible +xmul500 multiply -525445087.E+231529167 188227460 -> -9.89031941E+231529183 Inexact Rounded +xpow500 power -525445087.E+231529167 188227460 -> Infinity Overflow Inexact Rounded +xrem500 remainder -525445087.E+231529167 188227460 -> NaN Division_impossible +xsub500 subtract -525445087.E+231529167 188227460 -> -5.25445087E+231529175 Inexact Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/reduce.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/reduce.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,234 @@ +------------------------------------------------------------------------ +-- reduce.decTest -- remove trailing zeros -- +-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +-- [This used to be called normalize.] + +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +redx001 reduce '1' -> '1' +redx002 reduce '-1' -> '-1' +redx003 reduce '1.00' -> '1' +redx004 reduce '-1.00' -> '-1' +redx005 reduce '0' -> '0' +redx006 reduce '0.00' -> '0' +redx007 reduce '00.0' -> '0' +redx008 reduce '00.00' -> '0' +redx009 reduce '00' -> '0' +redx010 reduce '0E+1' -> '0' +redx011 reduce '0E+5' -> '0' + +redx012 reduce '-2' -> '-2' +redx013 reduce '2' -> '2' +redx014 reduce '-2.00' -> '-2' +redx015 reduce '2.00' -> '2' +redx016 reduce '-0' -> '-0' +redx017 reduce '-0.00' -> '-0' +redx018 reduce '-00.0' -> '-0' +redx019 reduce '-00.00' -> '-0' +redx020 reduce '-00' -> '-0' +redx021 reduce '-0E+5' -> '-0' +redx022 reduce '-0E+1' -> '-0' + +redx030 reduce '+0.1' -> '0.1' +redx031 reduce '-0.1' -> '-0.1' +redx032 reduce '+0.01' -> '0.01' +redx033 reduce '-0.01' -> '-0.01' +redx034 reduce '+0.001' -> '0.001' +redx035 reduce '-0.001' -> '-0.001' +redx036 reduce '+0.000001' -> '0.000001' +redx037 reduce '-0.000001' -> '-0.000001' +redx038 reduce '+0.000000000001' -> '1E-12' +redx039 reduce '-0.000000000001' -> '-1E-12' + +redx041 reduce 1.1 -> 1.1 +redx042 reduce 1.10 -> 1.1 +redx043 reduce 1.100 -> 1.1 +redx044 reduce 1.110 -> 1.11 +redx045 reduce -1.1 -> -1.1 +redx046 reduce -1.10 -> -1.1 +redx047 reduce -1.100 -> -1.1 +redx048 reduce -1.110 -> -1.11 +redx049 reduce 9.9 -> 9.9 +redx050 reduce 9.90 -> 9.9 +redx051 reduce 9.900 -> 9.9 +redx052 reduce 9.990 -> 9.99 +redx053 reduce -9.9 -> -9.9 +redx054 reduce -9.90 -> -9.9 +redx055 reduce -9.900 -> -9.9 +redx056 reduce -9.990 -> -9.99 + +-- some trailing fractional zeros with zeros in units +redx060 reduce 10.0 -> 1E+1 +redx061 reduce 10.00 -> 1E+1 +redx062 reduce 100.0 -> 1E+2 +redx063 reduce 100.00 -> 1E+2 +redx064 reduce 1.1000E+3 -> 1.1E+3 +redx065 reduce 1.10000E+3 -> 1.1E+3 +redx066 reduce -10.0 -> -1E+1 +redx067 reduce -10.00 -> -1E+1 +redx068 reduce -100.0 -> -1E+2 +redx069 reduce -100.00 -> -1E+2 +redx070 reduce -1.1000E+3 -> -1.1E+3 +redx071 reduce -1.10000E+3 -> -1.1E+3 + +-- some insignificant trailing zeros with positive exponent +redx080 reduce 10E+1 -> 1E+2 +redx081 reduce 100E+1 -> 1E+3 +redx082 reduce 1.0E+2 -> 1E+2 +redx083 reduce 1.0E+3 -> 1E+3 +redx084 reduce 1.1E+3 -> 1.1E+3 +redx085 reduce 1.00E+3 -> 1E+3 +redx086 reduce 1.10E+3 -> 1.1E+3 +redx087 reduce -10E+1 -> -1E+2 +redx088 reduce -100E+1 -> -1E+3 +redx089 reduce -1.0E+2 -> -1E+2 +redx090 reduce -1.0E+3 -> -1E+3 +redx091 reduce -1.1E+3 -> -1.1E+3 +redx092 reduce -1.00E+3 -> -1E+3 +redx093 reduce -1.10E+3 -> -1.1E+3 + +-- some significant trailing zeros, were we to be trimming +redx100 reduce 11 -> 11 +redx101 reduce 10 -> 1E+1 +redx102 reduce 10. -> 1E+1 +redx103 reduce 1.1E+1 -> 11 +redx104 reduce 1.0E+1 -> 1E+1 +redx105 reduce 1.10E+2 -> 1.1E+2 +redx106 reduce 1.00E+2 -> 1E+2 +redx107 reduce 1.100E+3 -> 1.1E+3 +redx108 reduce 1.000E+3 -> 1E+3 +redx109 reduce 1.000000E+6 -> 1E+6 +redx110 reduce -11 -> -11 +redx111 reduce -10 -> -1E+1 +redx112 reduce -10. -> -1E+1 +redx113 reduce -1.1E+1 -> -11 +redx114 reduce -1.0E+1 -> -1E+1 +redx115 reduce -1.10E+2 -> -1.1E+2 +redx116 reduce -1.00E+2 -> -1E+2 +redx117 reduce -1.100E+3 -> -1.1E+3 +redx118 reduce -1.000E+3 -> -1E+3 +redx119 reduce -1.00000E+5 -> -1E+5 +redx120 reduce -1.000000E+6 -> -1E+6 +redx121 reduce -10.00000E+6 -> -1E+7 +redx122 reduce -100.0000E+6 -> -1E+8 +redx123 reduce -1000.000E+6 -> -1E+9 +redx124 reduce -10000.00E+6 -> -1E+10 +redx125 reduce -100000.0E+6 -> -1E+11 +redx126 reduce -1000000.E+6 -> -1E+12 + +-- examples from decArith +redx140 reduce '2.1' -> '2.1' +redx141 reduce '-2.0' -> '-2' +redx142 reduce '1.200' -> '1.2' +redx143 reduce '-120' -> '-1.2E+2' +redx144 reduce '120.00' -> '1.2E+2' +redx145 reduce '0.00' -> '0' + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +redx160 reduce 9.999E+999999999 -> Infinity Inexact Overflow Rounded +redx161 reduce -9.999E+999999999 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +redx210 reduce 1.00E-999 -> 1E-999 +redx211 reduce 0.1E-999 -> 1E-1000 Subnormal +redx212 reduce 0.10E-999 -> 1E-1000 Subnormal +redx213 reduce 0.100E-999 -> 1E-1000 Subnormal Rounded +redx214 reduce 0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +redx215 reduce 0.999E-999 -> 1E-999 Inexact Rounded Subnormal Underflow +redx216 reduce 0.099E-999 -> 1E-1000 Inexact Rounded Subnormal Underflow +redx217 reduce 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +redx218 reduce 0.001E-999 -> 0 Inexact Rounded Subnormal Underflow Clamped +redx219 reduce 0.0009E-999 -> 0 Inexact Rounded Subnormal Underflow Clamped +redx220 reduce 0.0001E-999 -> 0 Inexact Rounded Subnormal Underflow Clamped + +redx230 reduce -1.00E-999 -> -1E-999 +redx231 reduce -0.1E-999 -> -1E-1000 Subnormal +redx232 reduce -0.10E-999 -> -1E-1000 Subnormal +redx233 reduce -0.100E-999 -> -1E-1000 Subnormal Rounded +redx234 reduce -0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +redx235 reduce -0.999E-999 -> -1E-999 Inexact Rounded Subnormal Underflow +redx236 reduce -0.099E-999 -> -1E-1000 Inexact Rounded Subnormal Underflow +redx237 reduce -0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +redx238 reduce -0.001E-999 -> -0 Inexact Rounded Subnormal Underflow Clamped +redx239 reduce -0.0009E-999 -> -0 Inexact Rounded Subnormal Underflow Clamped +redx240 reduce -0.0001E-999 -> -0 Inexact Rounded Subnormal Underflow Clamped + +-- more reshaping +precision: 9 +redx260 reduce '56260E-10' -> '0.000005626' +redx261 reduce '56260E-5' -> '0.5626' +redx262 reduce '56260E-2' -> '562.6' +redx263 reduce '56260E-1' -> '5626' +redx265 reduce '56260E-0' -> '5.626E+4' +redx266 reduce '56260E+0' -> '5.626E+4' +redx267 reduce '56260E+1' -> '5.626E+5' +redx268 reduce '56260E+2' -> '5.626E+6' +redx269 reduce '56260E+3' -> '5.626E+7' +redx270 reduce '56260E+4' -> '5.626E+8' +redx271 reduce '56260E+5' -> '5.626E+9' +redx272 reduce '56260E+6' -> '5.626E+10' +redx280 reduce '-56260E-10' -> '-0.000005626' +redx281 reduce '-56260E-5' -> '-0.5626' +redx282 reduce '-56260E-2' -> '-562.6' +redx283 reduce '-56260E-1' -> '-5626' +redx285 reduce '-56260E-0' -> '-5.626E+4' +redx286 reduce '-56260E+0' -> '-5.626E+4' +redx287 reduce '-56260E+1' -> '-5.626E+5' +redx288 reduce '-56260E+2' -> '-5.626E+6' +redx289 reduce '-56260E+3' -> '-5.626E+7' +redx290 reduce '-56260E+4' -> '-5.626E+8' +redx291 reduce '-56260E+5' -> '-5.626E+9' +redx292 reduce '-56260E+6' -> '-5.626E+10' + +-- FL test +precision: 40 +redx295 reduce 9892345673.0123456780000000000 -> 9892345673.012345678 + +-- specials +redx820 reduce 'Inf' -> 'Infinity' +redx821 reduce '-Inf' -> '-Infinity' +redx822 reduce NaN -> NaN +redx823 reduce sNaN -> NaN Invalid_operation +redx824 reduce NaN101 -> NaN101 +redx825 reduce sNaN010 -> NaN10 Invalid_operation +redx827 reduce -NaN -> -NaN +redx828 reduce -sNaN -> -NaN Invalid_operation +redx829 reduce -NaN101 -> -NaN101 +redx830 reduce -sNaN010 -> -NaN10 Invalid_operation + +-- payload decapitate +precision: 5 +redx62100 reduce sNaN1234567890 -> NaN67890 Invalid_operation + +-- Null test +redx900 reduce # -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/remainder.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/remainder.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,640 @@ +------------------------------------------------------------------------ +-- remainder.decTest -- decimal remainder -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks (as base, above) +remx001 remainder 1 1 -> 0 +remx002 remainder 2 1 -> 0 +remx003 remainder 1 2 -> 1 +remx004 remainder 2 2 -> 0 +remx005 remainder 0 1 -> 0 +remx006 remainder 0 2 -> 0 +remx007 remainder 1 3 -> 1 +remx008 remainder 2 3 -> 2 +remx009 remainder 3 3 -> 0 + +remx010 remainder 2.4 1 -> 0.4 +remx011 remainder 2.4 -1 -> 0.4 +remx012 remainder -2.4 1 -> -0.4 +remx013 remainder -2.4 -1 -> -0.4 +remx014 remainder 2.40 1 -> 0.40 +remx015 remainder 2.400 1 -> 0.400 +remx016 remainder 2.4 2 -> 0.4 +remx017 remainder 2.400 2 -> 0.400 +remx018 remainder 2. 2 -> 0 +remx019 remainder 20 20 -> 0 + +remx020 remainder 187 187 -> 0 +remx021 remainder 5 2 -> 1 +remx022 remainder 5 2.0 -> 1.0 +remx023 remainder 5 2.000 -> 1.000 +remx024 remainder 5 0.200 -> 0.000 +remx025 remainder 5 0.200 -> 0.000 + +remx030 remainder 1 2 -> 1 +remx031 remainder 1 4 -> 1 +remx032 remainder 1 8 -> 1 + +remx033 remainder 1 16 -> 1 +remx034 remainder 1 32 -> 1 +remx035 remainder 1 64 -> 1 +remx040 remainder 1 -2 -> 1 +remx041 remainder 1 -4 -> 1 +remx042 remainder 1 -8 -> 1 +remx043 remainder 1 -16 -> 1 +remx044 remainder 1 -32 -> 1 +remx045 remainder 1 -64 -> 1 +remx050 remainder -1 2 -> -1 +remx051 remainder -1 4 -> -1 +remx052 remainder -1 8 -> -1 +remx053 remainder -1 16 -> -1 +remx054 remainder -1 32 -> -1 +remx055 remainder -1 64 -> -1 +remx060 remainder -1 -2 -> -1 +remx061 remainder -1 -4 -> -1 +remx062 remainder -1 -8 -> -1 +remx063 remainder -1 -16 -> -1 +remx064 remainder -1 -32 -> -1 +remx065 remainder -1 -64 -> -1 + +remx066 remainder 999999999 1 -> 0 +remx067 remainder 999999999.4 1 -> 0.4 +remx068 remainder 999999999.5 1 -> 0.5 +remx069 remainder 999999999.9 1 -> 0.9 +remx070 remainder 999999999.999 1 -> 0.999 +precision: 6 +remx071 remainder 999999999 1 -> NaN Division_impossible +remx072 remainder 99999999 1 -> NaN Division_impossible +remx073 remainder 9999999 1 -> NaN Division_impossible +remx074 remainder 999999 1 -> 0 +remx075 remainder 99999 1 -> 0 +remx076 remainder 9999 1 -> 0 +remx077 remainder 999 1 -> 0 +remx078 remainder 99 1 -> 0 +remx079 remainder 9 1 -> 0 + +precision: 9 +remx080 remainder 0. 1 -> 0 +remx081 remainder .0 1 -> 0.0 +remx082 remainder 0.00 1 -> 0.00 +remx083 remainder 0.00E+9 1 -> 0 +remx084 remainder 0.00E+3 1 -> 0 +remx085 remainder 0.00E+2 1 -> 0 +remx086 remainder 0.00E+1 1 -> 0.0 +remx087 remainder 0.00E+0 1 -> 0.00 +remx088 remainder 0.00E-0 1 -> 0.00 +remx089 remainder 0.00E-1 1 -> 0.000 +remx090 remainder 0.00E-2 1 -> 0.0000 +remx091 remainder 0.00E-3 1 -> 0.00000 +remx092 remainder 0.00E-4 1 -> 0.000000 +remx093 remainder 0.00E-5 1 -> 0E-7 +remx094 remainder 0.00E-6 1 -> 0E-8 +remx095 remainder 0.0000E-50 1 -> 0E-54 + +-- Various flavours of remainder by 0 +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +remx101 remainder 0 0 -> NaN Division_undefined +remx102 remainder 0 -0 -> NaN Division_undefined +remx103 remainder -0 0 -> NaN Division_undefined +remx104 remainder -0 -0 -> NaN Division_undefined +remx105 remainder 0.0E5 0 -> NaN Division_undefined +remx106 remainder 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, but +-- IEEE 854 is explicit that it is Invalid operation .. for +-- remainder-near, anyway] +remx107 remainder 0.0001 0 -> NaN Invalid_operation +remx108 remainder 0.01 0 -> NaN Invalid_operation +remx109 remainder 0.1 0 -> NaN Invalid_operation +remx110 remainder 1 0 -> NaN Invalid_operation +remx111 remainder 1 0.0 -> NaN Invalid_operation +remx112 remainder 10 0.0 -> NaN Invalid_operation +remx113 remainder 1E+100 0.0 -> NaN Invalid_operation +remx114 remainder 1E+1000 0 -> NaN Invalid_operation +remx115 remainder 0.0001 -0 -> NaN Invalid_operation +remx116 remainder 0.01 -0 -> NaN Invalid_operation +remx119 remainder 0.1 -0 -> NaN Invalid_operation +remx120 remainder 1 -0 -> NaN Invalid_operation +remx121 remainder 1 -0.0 -> NaN Invalid_operation +remx122 remainder 10 -0.0 -> NaN Invalid_operation +remx123 remainder 1E+100 -0.0 -> NaN Invalid_operation +remx124 remainder 1E+1000 -0 -> NaN Invalid_operation +-- and zeros on left +remx130 remainder 0 1 -> 0 +remx131 remainder 0 -1 -> 0 +remx132 remainder 0.0 1 -> 0.0 +remx133 remainder 0.0 -1 -> 0.0 +remx134 remainder -0 1 -> -0 +remx135 remainder -0 -1 -> -0 +remx136 remainder -0.0 1 -> -0.0 +remx137 remainder -0.0 -1 -> -0.0 + +-- 0.5ers +remx143 remainder 0.5 2 -> 0.5 +remx144 remainder 0.5 2.1 -> 0.5 +remx145 remainder 0.5 2.01 -> 0.50 +remx146 remainder 0.5 2.001 -> 0.500 +remx147 remainder 0.50 2 -> 0.50 +remx148 remainder 0.50 2.01 -> 0.50 +remx149 remainder 0.50 2.001 -> 0.500 + +-- steadies +remx150 remainder 1 1 -> 0 +remx151 remainder 1 2 -> 1 +remx152 remainder 1 3 -> 1 +remx153 remainder 1 4 -> 1 +remx154 remainder 1 5 -> 1 +remx155 remainder 1 6 -> 1 +remx156 remainder 1 7 -> 1 +remx157 remainder 1 8 -> 1 +remx158 remainder 1 9 -> 1 +remx159 remainder 1 10 -> 1 +remx160 remainder 1 1 -> 0 +remx161 remainder 2 1 -> 0 +remx162 remainder 3 1 -> 0 +remx163 remainder 4 1 -> 0 +remx164 remainder 5 1 -> 0 +remx165 remainder 6 1 -> 0 +remx166 remainder 7 1 -> 0 +remx167 remainder 8 1 -> 0 +remx168 remainder 9 1 -> 0 +remx169 remainder 10 1 -> 0 + +-- some differences from remainderNear +remx171 remainder 0.4 1.020 -> 0.400 +remx172 remainder 0.50 1.020 -> 0.500 +remx173 remainder 0.51 1.020 -> 0.510 +remx174 remainder 0.52 1.020 -> 0.520 +remx175 remainder 0.6 1.020 -> 0.600 + + +-- More flavours of remainder by 0 +maxexponent: 999999999 +minexponent: -999999999 +remx201 remainder 0 0 -> NaN Division_undefined +remx202 remainder 0.0E5 0 -> NaN Division_undefined +remx203 remainder 0.000 0 -> NaN Division_undefined +remx204 remainder 0.0001 0 -> NaN Invalid_operation +remx205 remainder 0.01 0 -> NaN Invalid_operation +remx206 remainder 0.1 0 -> NaN Invalid_operation +remx207 remainder 1 0 -> NaN Invalid_operation +remx208 remainder 1 0.0 -> NaN Invalid_operation +remx209 remainder 10 0.0 -> NaN Invalid_operation +remx210 remainder 1E+100 0.0 -> NaN Invalid_operation +remx211 remainder 1E+1000 0 -> NaN Invalid_operation + +-- some differences from remainderNear +remx231 remainder -0.4 1.020 -> -0.400 +remx232 remainder -0.50 1.020 -> -0.500 +remx233 remainder -0.51 1.020 -> -0.510 +remx234 remainder -0.52 1.020 -> -0.520 +remx235 remainder -0.6 1.020 -> -0.600 + +-- high Xs +remx240 remainder 1E+2 1.00 -> 0.00 + + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +remx270 remainder 1 1e999999999 -> 1 +remx271 remainder 1 0.9e999999999 -> 1 +remx272 remainder 1 0.99e999999999 -> 1 +remx273 remainder 1 0.999999999e999999999 -> 1 +remx274 remainder 9e999999999 1 -> NaN Division_impossible +remx275 remainder 9.9e999999999 1 -> NaN Division_impossible +remx276 remainder 9.99e999999999 1 -> NaN Division_impossible +remx277 remainder 9.99999999e999999999 1 -> NaN Division_impossible + +remx280 remainder 0.1 9e-999999999 -> NaN Division_impossible +remx281 remainder 0.1 99e-999999999 -> NaN Division_impossible +remx282 remainder 0.1 999e-999999999 -> NaN Division_impossible + +remx283 remainder 0.1 9e-999999998 -> NaN Division_impossible +remx284 remainder 0.1 99e-999999998 -> NaN Division_impossible +remx285 remainder 0.1 999e-999999998 -> NaN Division_impossible +remx286 remainder 0.1 999e-999999997 -> NaN Division_impossible +remx287 remainder 0.1 9999e-999999997 -> NaN Division_impossible +remx288 remainder 0.1 99999e-999999997 -> NaN Division_impossible + +-- remx3xx are from DiagBigDecimal +remx301 remainder 1 3 -> 1 +remx302 remainder 5 5 -> 0 +remx303 remainder 13 10 -> 3 +remx304 remainder 13 50 -> 13 +remx305 remainder 13 100 -> 13 +remx306 remainder 13 1000 -> 13 +remx307 remainder .13 1 -> 0.13 +remx308 remainder 0.133 1 -> 0.133 +remx309 remainder 0.1033 1 -> 0.1033 +remx310 remainder 1.033 1 -> 0.033 +remx311 remainder 10.33 1 -> 0.33 +remx312 remainder 10.33 10 -> 0.33 +remx313 remainder 103.3 1 -> 0.3 +remx314 remainder 133 10 -> 3 +remx315 remainder 1033 10 -> 3 +remx316 remainder 1033 50 -> 33 +remx317 remainder 101.0 3 -> 2.0 +remx318 remainder 102.0 3 -> 0.0 +remx319 remainder 103.0 3 -> 1.0 +remx320 remainder 2.40 1 -> 0.40 +remx321 remainder 2.400 1 -> 0.400 +remx322 remainder 2.4 1 -> 0.4 +remx323 remainder 2.4 2 -> 0.4 +remx324 remainder 2.400 2 -> 0.400 +remx325 remainder 1 0.3 -> 0.1 +remx326 remainder 1 0.30 -> 0.10 +remx327 remainder 1 0.300 -> 0.100 +remx328 remainder 1 0.3000 -> 0.1000 +remx329 remainder 1.0 0.3 -> 0.1 +remx330 remainder 1.00 0.3 -> 0.10 +remx331 remainder 1.000 0.3 -> 0.100 +remx332 remainder 1.0000 0.3 -> 0.1000 +remx333 remainder 0.5 2 -> 0.5 +remx334 remainder 0.5 2.1 -> 0.5 +remx335 remainder 0.5 2.01 -> 0.50 +remx336 remainder 0.5 2.001 -> 0.500 +remx337 remainder 0.50 2 -> 0.50 +remx338 remainder 0.50 2.01 -> 0.50 +remx339 remainder 0.50 2.001 -> 0.500 + +remx340 remainder 0.5 0.5000001 -> 0.5000000 +remx341 remainder 0.5 0.50000001 -> 0.50000000 +remx342 remainder 0.5 0.500000001 -> 0.500000000 +remx343 remainder 0.5 0.5000000001 -> 0.500000000 Rounded +remx344 remainder 0.5 0.50000000001 -> 0.500000000 Rounded +remx345 remainder 0.5 0.4999999 -> 1E-7 +remx346 remainder 0.5 0.49999999 -> 1E-8 +remx347 remainder 0.5 0.499999999 -> 1E-9 +remx348 remainder 0.5 0.4999999999 -> 1E-10 +remx349 remainder 0.5 0.49999999999 -> 1E-11 +remx350 remainder 0.5 0.499999999999 -> 1E-12 + +remx351 remainder 0.03 7 -> 0.03 +remx352 remainder 5 2 -> 1 +remx353 remainder 4.1 2 -> 0.1 +remx354 remainder 4.01 2 -> 0.01 +remx355 remainder 4.001 2 -> 0.001 +remx356 remainder 4.0001 2 -> 0.0001 +remx357 remainder 4.00001 2 -> 0.00001 +remx358 remainder 4.000001 2 -> 0.000001 +remx359 remainder 4.0000001 2 -> 1E-7 + +remx360 remainder 1.2 0.7345 -> 0.4655 +remx361 remainder 0.8 12 -> 0.8 +remx362 remainder 0.8 0.2 -> 0.0 +remx363 remainder 0.8 0.3 -> 0.2 +remx364 remainder 0.800 12 -> 0.800 +remx365 remainder 0.800 1.7 -> 0.800 +remx366 remainder 2.400 2 -> 0.400 + +precision: 6 +remx371 remainder 2.400 2 -> 0.400 +precision: 3 +-- long operand, rounded, case +remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded +-- 12000000000000 + +precision: 5 +remx381 remainder 12345 1 -> 0 +remx382 remainder 12345 1.0001 -> 0.7657 +remx383 remainder 12345 1.001 -> 0.668 +remx384 remainder 12345 1.01 -> 0.78 +remx385 remainder 12345 1.1 -> 0.8 +remx386 remainder 12355 4 -> 3 +remx387 remainder 12345 4 -> 1 +remx388 remainder 12355 4.0001 -> 2.6912 +remx389 remainder 12345 4.0001 -> 0.6914 +remx390 remainder 12345 4.9 -> 1.9 +remx391 remainder 12345 4.99 -> 4.73 +remx392 remainder 12345 4.999 -> 2.469 +remx393 remainder 12345 4.9999 -> 0.2469 +remx394 remainder 12345 5 -> 0 +remx395 remainder 12345 5.0001 -> 4.7532 +remx396 remainder 12345 5.001 -> 2.532 +remx397 remainder 12345 5.01 -> 0.36 +remx398 remainder 12345 5.1 -> 3.0 + +precision: 9 +-- the nasty division-by-1 cases +remx401 remainder 0.5 1 -> 0.5 +remx402 remainder 0.55 1 -> 0.55 +remx403 remainder 0.555 1 -> 0.555 +remx404 remainder 0.5555 1 -> 0.5555 +remx405 remainder 0.55555 1 -> 0.55555 +remx406 remainder 0.555555 1 -> 0.555555 +remx407 remainder 0.5555555 1 -> 0.5555555 +remx408 remainder 0.55555555 1 -> 0.55555555 +remx409 remainder 0.555555555 1 -> 0.555555555 + +-- zero signs +remx650 remainder 1 1 -> 0 +remx651 remainder -1 1 -> -0 +remx652 remainder 1 -1 -> 0 +remx653 remainder -1 -1 -> -0 +remx654 remainder 0 1 -> 0 +remx655 remainder -0 1 -> -0 +remx656 remainder 0 -1 -> 0 +remx657 remainder -0 -1 -> -0 +remx658 remainder 0.00 1 -> 0.00 +remx659 remainder -0.00 1 -> -0.00 + +-- Specials +remx680 remainder Inf -Inf -> NaN Invalid_operation +remx681 remainder Inf -1000 -> NaN Invalid_operation +remx682 remainder Inf -1 -> NaN Invalid_operation +remx683 remainder Inf 0 -> NaN Invalid_operation +remx684 remainder Inf -0 -> NaN Invalid_operation +remx685 remainder Inf 1 -> NaN Invalid_operation +remx686 remainder Inf 1000 -> NaN Invalid_operation +remx687 remainder Inf Inf -> NaN Invalid_operation +remx688 remainder -1000 Inf -> -1000 +remx689 remainder -Inf Inf -> NaN Invalid_operation +remx691 remainder -1 Inf -> -1 +remx692 remainder 0 Inf -> 0 +remx693 remainder -0 Inf -> -0 +remx694 remainder 1 Inf -> 1 +remx695 remainder 1000 Inf -> 1000 +remx696 remainder Inf Inf -> NaN Invalid_operation + +remx700 remainder -Inf -Inf -> NaN Invalid_operation +remx701 remainder -Inf -1000 -> NaN Invalid_operation +remx702 remainder -Inf -1 -> NaN Invalid_operation +remx703 remainder -Inf -0 -> NaN Invalid_operation +remx704 remainder -Inf 0 -> NaN Invalid_operation +remx705 remainder -Inf 1 -> NaN Invalid_operation +remx706 remainder -Inf 1000 -> NaN Invalid_operation +remx707 remainder -Inf Inf -> NaN Invalid_operation +remx708 remainder -Inf -Inf -> NaN Invalid_operation +remx709 remainder -1000 Inf -> -1000 +remx710 remainder -1 -Inf -> -1 +remx711 remainder -0 -Inf -> -0 +remx712 remainder 0 -Inf -> 0 +remx713 remainder 1 -Inf -> 1 +remx714 remainder 1000 -Inf -> 1000 +remx715 remainder Inf -Inf -> NaN Invalid_operation + +remx721 remainder NaN -Inf -> NaN +remx722 remainder NaN -1000 -> NaN +remx723 remainder NaN -1 -> NaN +remx724 remainder NaN -0 -> NaN +remx725 remainder -NaN 0 -> -NaN +remx726 remainder NaN 1 -> NaN +remx727 remainder NaN 1000 -> NaN +remx728 remainder NaN Inf -> NaN +remx729 remainder NaN -NaN -> NaN +remx730 remainder -Inf NaN -> NaN +remx731 remainder -1000 NaN -> NaN +remx732 remainder -1 NaN -> NaN +remx733 remainder -0 -NaN -> -NaN +remx734 remainder 0 NaN -> NaN +remx735 remainder 1 -NaN -> -NaN +remx736 remainder 1000 NaN -> NaN +remx737 remainder Inf NaN -> NaN + +remx741 remainder sNaN -Inf -> NaN Invalid_operation +remx742 remainder sNaN -1000 -> NaN Invalid_operation +remx743 remainder -sNaN -1 -> -NaN Invalid_operation +remx744 remainder sNaN -0 -> NaN Invalid_operation +remx745 remainder sNaN 0 -> NaN Invalid_operation +remx746 remainder sNaN 1 -> NaN Invalid_operation +remx747 remainder sNaN 1000 -> NaN Invalid_operation +remx749 remainder sNaN NaN -> NaN Invalid_operation +remx750 remainder sNaN sNaN -> NaN Invalid_operation +remx751 remainder NaN sNaN -> NaN Invalid_operation +remx752 remainder -Inf sNaN -> NaN Invalid_operation +remx753 remainder -1000 sNaN -> NaN Invalid_operation +remx754 remainder -1 sNaN -> NaN Invalid_operation +remx755 remainder -0 sNaN -> NaN Invalid_operation +remx756 remainder 0 sNaN -> NaN Invalid_operation +remx757 remainder 1 sNaN -> NaN Invalid_operation +remx758 remainder 1000 sNaN -> NaN Invalid_operation +remx759 remainder Inf -sNaN -> -NaN Invalid_operation + +-- propaging NaNs +remx760 remainder NaN1 NaN7 -> NaN1 +remx761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation +remx762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation +remx763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation +remx764 remainder 15 NaN11 -> NaN11 +remx765 remainder NaN6 NaN12 -> NaN6 +remx766 remainder Inf NaN13 -> NaN13 +remx767 remainder NaN14 -Inf -> NaN14 +remx768 remainder 0 NaN15 -> NaN15 +remx769 remainder NaN16 -0 -> NaN16 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +remx770 remainder 1 1e999999999 -> 1 +remx771 remainder 1 0.9e999999999 -> 1 +remx772 remainder 1 0.99e999999999 -> 1 +remx773 remainder 1 0.999999999e999999999 -> 1 +remx774 remainder 9e999999999 1 -> NaN Division_impossible +remx775 remainder 9.9e999999999 1 -> NaN Division_impossible +remx776 remainder 9.99e999999999 1 -> NaN Division_impossible +remx777 remainder 9.99999999e999999999 1 -> NaN Division_impossible + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +remx801 remainder 12345678000 100 -> 0 +remx802 remainder 1 12345678000 -> 1 +remx803 remainder 1234567800 10 -> 0 +remx804 remainder 1 1234567800 -> 1 +remx805 remainder 1234567890 10 -> 0 +remx806 remainder 1 1234567890 -> 1 +remx807 remainder 1234567891 10 -> 1 +remx808 remainder 1 1234567891 -> 1 +remx809 remainder 12345678901 100 -> 1 +remx810 remainder 1 12345678901 -> 1 +remx811 remainder 1234567896 10 -> 6 +remx812 remainder 1 1234567896 -> 1 + +precision: 15 +remx821 remainder 12345678000 100 -> 0 +remx822 remainder 1 12345678000 -> 1 +remx823 remainder 1234567800 10 -> 0 +remx824 remainder 1 1234567800 -> 1 +remx825 remainder 1234567890 10 -> 0 +remx826 remainder 1 1234567890 -> 1 +remx827 remainder 1234567891 10 -> 1 +remx828 remainder 1 1234567891 -> 1 +remx829 remainder 12345678901 100 -> 1 +remx830 remainder 1 12345678901 -> 1 +remx831 remainder 1234567896 10 -> 6 +remx832 remainder 1 1234567896 -> 1 + +-- worries from divideint +precision: 8 +remx840 remainder 100000000.0 1 -> NaN Division_impossible +remx841 remainder 100000000.4 1 -> NaN Division_impossible +remx842 remainder 100000000.5 1 -> NaN Division_impossible +remx843 remainder 100000000.9 1 -> NaN Division_impossible +remx844 remainder 100000000.999 1 -> NaN Division_impossible +precision: 6 +remx850 remainder 100000003 5 -> NaN Division_impossible +remx851 remainder 10000003 5 -> NaN Division_impossible +remx852 remainder 1000003 5 -> 3 +remx853 remainder 100003 5 -> 3 +remx854 remainder 10003 5 -> 3 +remx855 remainder 1003 5 -> 3 +remx856 remainder 103 5 -> 3 +remx857 remainder 13 5 -> 3 +remx858 remainder 1 5 -> 1 + +-- Vladimir's cases +remx860 remainder 123.0e1 10000000000000000 -> 1230 +remx861 remainder 1230 10000000000000000 -> 1230 +remx862 remainder 12.3e2 10000000000000000 -> 1230 +remx863 remainder 1.23e3 10000000000000000 -> 1230 +remx864 remainder 123e1 10000000000000000 -> 1230 +remx870 remainder 123e1 1000000000000000 -> 1230 +remx871 remainder 123e1 100000000000000 -> 1230 +remx872 remainder 123e1 10000000000000 -> 1230 +remx873 remainder 123e1 1000000000000 -> 1230 +remx874 remainder 123e1 100000000000 -> 1230 +remx875 remainder 123e1 10000000000 -> 1230 +remx876 remainder 123e1 1000000000 -> 1230 +remx877 remainder 123e1 100000000 -> 1230 +remx878 remainder 1230 100000000 -> 1230 +remx879 remainder 123e1 10000000 -> 1230 +remx880 remainder 123e1 1000000 -> 1230 +remx881 remainder 123e1 100000 -> 1230 +remx882 remainder 123e1 10000 -> 1230 +remx883 remainder 123e1 1000 -> 230 +remx884 remainder 123e1 100 -> 30 +remx885 remainder 123e1 10 -> 0 +remx886 remainder 123e1 1 -> 0 + +remx889 remainder 123e1 20000000000000000 -> 1230 +remx890 remainder 123e1 2000000000000000 -> 1230 +remx891 remainder 123e1 200000000000000 -> 1230 +remx892 remainder 123e1 20000000000000 -> 1230 +remx893 remainder 123e1 2000000000000 -> 1230 +remx894 remainder 123e1 200000000000 -> 1230 +remx895 remainder 123e1 20000000000 -> 1230 +remx896 remainder 123e1 2000000000 -> 1230 +remx897 remainder 123e1 200000000 -> 1230 +remx899 remainder 123e1 20000000 -> 1230 +remx900 remainder 123e1 2000000 -> 1230 +remx901 remainder 123e1 200000 -> 1230 +remx902 remainder 123e1 20000 -> 1230 +remx903 remainder 123e1 2000 -> 1230 +remx904 remainder 123e1 200 -> 30 +remx905 remainder 123e1 20 -> 10 +remx906 remainder 123e1 2 -> 0 + +remx909 remainder 123e1 50000000000000000 -> 1230 +remx910 remainder 123e1 5000000000000000 -> 1230 +remx911 remainder 123e1 500000000000000 -> 1230 +remx912 remainder 123e1 50000000000000 -> 1230 +remx913 remainder 123e1 5000000000000 -> 1230 +remx914 remainder 123e1 500000000000 -> 1230 +remx915 remainder 123e1 50000000000 -> 1230 +remx916 remainder 123e1 5000000000 -> 1230 +remx917 remainder 123e1 500000000 -> 1230 +remx919 remainder 123e1 50000000 -> 1230 +remx920 remainder 123e1 5000000 -> 1230 +remx921 remainder 123e1 500000 -> 1230 +remx922 remainder 123e1 50000 -> 1230 +remx923 remainder 123e1 5000 -> 1230 +remx924 remainder 123e1 500 -> 230 +remx925 remainder 123e1 50 -> 30 +remx926 remainder 123e1 5 -> 0 + +remx929 remainder 123e1 90000000000000000 -> 1230 +remx930 remainder 123e1 9000000000000000 -> 1230 +remx931 remainder 123e1 900000000000000 -> 1230 +remx932 remainder 123e1 90000000000000 -> 1230 +remx933 remainder 123e1 9000000000000 -> 1230 +remx934 remainder 123e1 900000000000 -> 1230 +remx935 remainder 123e1 90000000000 -> 1230 +remx936 remainder 123e1 9000000000 -> 1230 +remx937 remainder 123e1 900000000 -> 1230 +remx939 remainder 123e1 90000000 -> 1230 +remx940 remainder 123e1 9000000 -> 1230 +remx941 remainder 123e1 900000 -> 1230 +remx942 remainder 123e1 90000 -> 1230 +remx943 remainder 123e1 9000 -> 1230 +remx944 remainder 123e1 900 -> 330 +remx945 remainder 123e1 90 -> 60 +remx946 remainder 123e1 9 -> 6 + +remx950 remainder 123e1 10000000000000000 -> 1230 +remx951 remainder 123e1 100000000000000000 -> 1230 +remx952 remainder 123e1 1000000000000000000 -> 1230 +remx953 remainder 123e1 10000000000000000000 -> 1230 +remx954 remainder 123e1 100000000000000000000 -> 1230 +remx955 remainder 123e1 1000000000000000000000 -> 1230 +remx956 remainder 123e1 10000000000000000000000 -> 1230 +remx957 remainder 123e1 100000000000000000000000 -> 1230 +remx958 remainder 123e1 1000000000000000000000000 -> 1230 +remx959 remainder 123e1 10000000000000000000000000 -> 1230 + +remx960 remainder 123e1 19999999999999999 -> 1230 +remx961 remainder 123e1 199999999999999990 -> 1230 +remx962 remainder 123e1 1999999999999999999 -> 1230 +remx963 remainder 123e1 19999999999999999990 -> 1230 +remx964 remainder 123e1 199999999999999999999 -> 1230 +remx965 remainder 123e1 1999999999999999999990 -> 1230 +remx966 remainder 123e1 19999999999999999999999 -> 1230 +remx967 remainder 123e1 199999999999999999999990 -> 1230 +remx968 remainder 123e1 1999999999999999999999999 -> 1230 +remx969 remainder 123e1 19999999999999999999999990 -> 1230 + +remx970 remainder 1e1 10000000000000000 -> 10 +remx971 remainder 1e1 100000000000000000 -> 10 +remx972 remainder 1e1 1000000000000000000 -> 10 +remx973 remainder 1e1 10000000000000000000 -> 10 +remx974 remainder 1e1 100000000000000000000 -> 10 +remx975 remainder 1e1 1000000000000000000000 -> 10 +remx976 remainder 1e1 10000000000000000000000 -> 10 +remx977 remainder 1e1 100000000000000000000000 -> 10 +remx978 remainder 1e1 1000000000000000000000000 -> 10 +remx979 remainder 1e1 10000000000000000000000000 -> 10 + +remx980 remainder 123e1 1000E999999 -> 1.23E+3 -- 123E+1 internally + +-- overflow and underflow tests [from divide] +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +remx990 remainder +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded +remx991 remainder 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +remx992 remainder +0.100 9E+999999999 -> 0.100 +remx993 remainder 9E-999999999 +9.100 -> 9E-999999999 +remx995 remainder -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded +remx996 remainder 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +remx997 remainder -0.100 9E+999999999 -> -0.100 +remx998 remainder 9E-999999999 -9.100 -> 9E-999999999 + +-- Null tests +remx1000 remainder 10 # -> NaN Invalid_operation +remx1001 remainder # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/remainderNear.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/remainderNear.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,572 @@ +------------------------------------------------------------------------ +-- remainderNear.decTest -- decimal remainder-near (IEEE remainder) -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +rmnx001 remaindernear 1 1 -> 0 +rmnx002 remaindernear 2 1 -> 0 +rmnx003 remaindernear 1 2 -> 1 +rmnx004 remaindernear 2 2 -> 0 +rmnx005 remaindernear 0 1 -> 0 +rmnx006 remaindernear 0 2 -> 0 +rmnx007 remaindernear 1 3 -> 1 +rmnx008 remaindernear 2 3 -> -1 +rmnx009 remaindernear 3 3 -> 0 + +rmnx010 remaindernear 2.4 1 -> 0.4 +rmnx011 remaindernear 2.4 -1 -> 0.4 +rmnx012 remaindernear -2.4 1 -> -0.4 +rmnx013 remaindernear -2.4 -1 -> -0.4 +rmnx014 remaindernear 2.40 1 -> 0.40 +rmnx015 remaindernear 2.400 1 -> 0.400 +rmnx016 remaindernear 2.4 2 -> 0.4 +rmnx017 remaindernear 2.400 2 -> 0.400 +rmnx018 remaindernear 2. 2 -> 0 +rmnx019 remaindernear 20 20 -> 0 + +rmnx020 remaindernear 187 187 -> 0 +rmnx021 remaindernear 5 2 -> 1 +rmnx022 remaindernear 5 2.0 -> 1.0 +rmnx023 remaindernear 5 2.000 -> 1.000 +rmnx024 remaindernear 5 0.200 -> 0.000 +rmnx025 remaindernear 5 0.200 -> 0.000 + +rmnx030 remaindernear 1 2 -> 1 +rmnx031 remaindernear 1 4 -> 1 +rmnx032 remaindernear 1 8 -> 1 +rmnx033 remaindernear 1 16 -> 1 +rmnx034 remaindernear 1 32 -> 1 +rmnx035 remaindernear 1 64 -> 1 +rmnx040 remaindernear 1 -2 -> 1 +rmnx041 remaindernear 1 -4 -> 1 +rmnx042 remaindernear 1 -8 -> 1 +rmnx043 remaindernear 1 -16 -> 1 +rmnx044 remaindernear 1 -32 -> 1 +rmnx045 remaindernear 1 -64 -> 1 +rmnx050 remaindernear -1 2 -> -1 +rmnx051 remaindernear -1 4 -> -1 +rmnx052 remaindernear -1 8 -> -1 +rmnx053 remaindernear -1 16 -> -1 +rmnx054 remaindernear -1 32 -> -1 +rmnx055 remaindernear -1 64 -> -1 +rmnx060 remaindernear -1 -2 -> -1 +rmnx061 remaindernear -1 -4 -> -1 +rmnx062 remaindernear -1 -8 -> -1 +rmnx063 remaindernear -1 -16 -> -1 +rmnx064 remaindernear -1 -32 -> -1 +rmnx065 remaindernear -1 -64 -> -1 + +rmnx066 remaindernear 999999997 1 -> 0 +rmnx067 remaindernear 999999997.4 1 -> 0.4 +rmnx068 remaindernear 999999997.5 1 -> -0.5 +rmnx069 remaindernear 999999997.9 1 -> -0.1 +rmnx070 remaindernear 999999997.999 1 -> -0.001 + +rmnx071 remaindernear 999999998 1 -> 0 +rmnx072 remaindernear 999999998.4 1 -> 0.4 +rmnx073 remaindernear 999999998.5 1 -> 0.5 +rmnx074 remaindernear 999999998.9 1 -> -0.1 +rmnx075 remaindernear 999999998.999 1 -> -0.001 + +rmnx076 remaindernear 999999999 1 -> 0 +rmnx077 remaindernear 999999999.4 1 -> 0.4 +rmnx078 remaindernear 999999999.5 1 -> NaN Division_impossible +rmnx079 remaindernear 999999999.9 1 -> NaN Division_impossible +rmnx080 remaindernear 999999999.999 1 -> NaN Division_impossible + +precision: 6 +rmnx081 remaindernear 999999999 1 -> NaN Division_impossible +rmnx082 remaindernear 99999999 1 -> NaN Division_impossible +rmnx083 remaindernear 9999999 1 -> NaN Division_impossible +rmnx084 remaindernear 999999 1 -> 0 +rmnx085 remaindernear 99999 1 -> 0 +rmnx086 remaindernear 9999 1 -> 0 +rmnx087 remaindernear 999 1 -> 0 +rmnx088 remaindernear 99 1 -> 0 +rmnx089 remaindernear 9 1 -> 0 + +precision: 9 +rmnx090 remaindernear 0. 1 -> 0 +rmnx091 remaindernear .0 1 -> 0.0 +rmnx092 remaindernear 0.00 1 -> 0.00 +rmnx093 remaindernear 0.00E+9 1 -> 0 +rmnx094 remaindernear 0.0000E-50 1 -> 0E-54 + + +-- Various flavours of remaindernear by 0 +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +rmnx101 remaindernear 0 0 -> NaN Division_undefined +rmnx102 remaindernear 0 -0 -> NaN Division_undefined +rmnx103 remaindernear -0 0 -> NaN Division_undefined +rmnx104 remaindernear -0 -0 -> NaN Division_undefined +rmnx105 remaindernear 0.0E5 0 -> NaN Division_undefined +rmnx106 remaindernear 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, +-- but IEEE 854 is explicit that it is Invalid operation .. for +-- remaindernear-near, anyway] +rmnx107 remaindernear 0.0001 0 -> NaN Invalid_operation +rmnx108 remaindernear 0.01 0 -> NaN Invalid_operation +rmnx109 remaindernear 0.1 0 -> NaN Invalid_operation +rmnx110 remaindernear 1 0 -> NaN Invalid_operation +rmnx111 remaindernear 1 0.0 -> NaN Invalid_operation +rmnx112 remaindernear 10 0.0 -> NaN Invalid_operation +rmnx113 remaindernear 1E+100 0.0 -> NaN Invalid_operation +rmnx114 remaindernear 1E+1000 0 -> NaN Invalid_operation +rmnx115 remaindernear 0.0001 -0 -> NaN Invalid_operation +rmnx116 remaindernear 0.01 -0 -> NaN Invalid_operation +rmnx119 remaindernear 0.1 -0 -> NaN Invalid_operation +rmnx120 remaindernear 1 -0 -> NaN Invalid_operation +rmnx121 remaindernear 1 -0.0 -> NaN Invalid_operation +rmnx122 remaindernear 10 -0.0 -> NaN Invalid_operation +rmnx123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation +rmnx124 remaindernear 1E+1000 -0 -> NaN Invalid_operation +-- and zeros on left +rmnx130 remaindernear 0 1 -> 0 +rmnx131 remaindernear 0 -1 -> 0 +rmnx132 remaindernear 0.0 1 -> 0.0 +rmnx133 remaindernear 0.0 -1 -> 0.0 +rmnx134 remaindernear -0 1 -> -0 +rmnx135 remaindernear -0 -1 -> -0 +rmnx136 remaindernear -0.0 1 -> -0.0 +rmnx137 remaindernear -0.0 -1 -> -0.0 + +-- 0.5ers +rmmx143 remaindernear 0.5 2 -> 0.5 +rmmx144 remaindernear 0.5 2.1 -> 0.5 +rmmx145 remaindernear 0.5 2.01 -> 0.50 +rmmx146 remaindernear 0.5 2.001 -> 0.500 +rmmx147 remaindernear 0.50 2 -> 0.50 +rmmx148 remaindernear 0.50 2.01 -> 0.50 +rmmx149 remaindernear 0.50 2.001 -> 0.500 + +-- some differences from remainder +rmnx150 remaindernear 0.4 1.020 -> 0.400 +rmnx151 remaindernear 0.50 1.020 -> 0.500 +rmnx152 remaindernear 0.51 1.020 -> 0.510 +rmnx153 remaindernear 0.52 1.020 -> -0.500 +rmnx154 remaindernear 0.6 1.020 -> -0.420 +rmnx155 remaindernear 0.49 1 -> 0.49 +rmnx156 remaindernear 0.50 1 -> 0.50 +rmnx157 remaindernear 1.50 1 -> -0.50 +rmnx158 remaindernear 2.50 1 -> 0.50 +rmnx159 remaindernear 9.50 1 -> -0.50 +rmnx160 remaindernear 0.51 1 -> -0.49 + +-- the nasty division-by-1 cases +rmnx161 remaindernear 0.4 1 -> 0.4 +rmnx162 remaindernear 0.45 1 -> 0.45 +rmnx163 remaindernear 0.455 1 -> 0.455 +rmnx164 remaindernear 0.4555 1 -> 0.4555 +rmnx165 remaindernear 0.45555 1 -> 0.45555 +rmnx166 remaindernear 0.455555 1 -> 0.455555 +rmnx167 remaindernear 0.4555555 1 -> 0.4555555 +rmnx168 remaindernear 0.45555555 1 -> 0.45555555 +rmnx169 remaindernear 0.455555555 1 -> 0.455555555 +-- with spill... +rmnx171 remaindernear 0.5 1 -> 0.5 +rmnx172 remaindernear 0.55 1 -> -0.45 +rmnx173 remaindernear 0.555 1 -> -0.445 +rmnx174 remaindernear 0.5555 1 -> -0.4445 +rmnx175 remaindernear 0.55555 1 -> -0.44445 +rmnx176 remaindernear 0.555555 1 -> -0.444445 +rmnx177 remaindernear 0.5555555 1 -> -0.4444445 +rmnx178 remaindernear 0.55555555 1 -> -0.44444445 +rmnx179 remaindernear 0.555555555 1 -> -0.444444445 + +-- progression +rmnx180 remaindernear 1 1 -> 0 +rmnx181 remaindernear 1 2 -> 1 +rmnx182 remaindernear 1 3 -> 1 +rmnx183 remaindernear 1 4 -> 1 +rmnx184 remaindernear 1 5 -> 1 +rmnx185 remaindernear 1 6 -> 1 +rmnx186 remaindernear 1 7 -> 1 +rmnx187 remaindernear 1 8 -> 1 +rmnx188 remaindernear 1 9 -> 1 +rmnx189 remaindernear 1 10 -> 1 +rmnx190 remaindernear 1 1 -> 0 +rmnx191 remaindernear 2 1 -> 0 +rmnx192 remaindernear 3 1 -> 0 +rmnx193 remaindernear 4 1 -> 0 +rmnx194 remaindernear 5 1 -> 0 +rmnx195 remaindernear 6 1 -> 0 +rmnx196 remaindernear 7 1 -> 0 +rmnx197 remaindernear 8 1 -> 0 +rmnx198 remaindernear 9 1 -> 0 +rmnx199 remaindernear 10 1 -> 0 + + +-- Various flavours of remaindernear by 0 +maxexponent: 999999999 +minexponent: -999999999 +rmnx201 remaindernear 0 0 -> NaN Division_undefined +rmnx202 remaindernear 0.0E5 0 -> NaN Division_undefined +rmnx203 remaindernear 0.000 0 -> NaN Division_undefined +rmnx204 remaindernear 0.0001 0 -> NaN Invalid_operation +rmnx205 remaindernear 0.01 0 -> NaN Invalid_operation +rmnx206 remaindernear 0.1 0 -> NaN Invalid_operation +rmnx207 remaindernear 1 0 -> NaN Invalid_operation +rmnx208 remaindernear 1 0.0 -> NaN Invalid_operation +rmnx209 remaindernear 10 0.0 -> NaN Invalid_operation +rmnx210 remaindernear 1E+100 0.0 -> NaN Invalid_operation +rmnx211 remaindernear 1E+1000 0 -> NaN Invalid_operation + +-- tests from the extended specification +rmnx221 remaindernear 2.1 3 -> -0.9 +rmnx222 remaindernear 10 6 -> -2 +rmnx223 remaindernear 10 3 -> 1 +rmnx224 remaindernear -10 3 -> -1 +rmnx225 remaindernear 10.2 1 -> 0.2 +rmnx226 remaindernear 10 0.3 -> 0.1 +rmnx227 remaindernear 3.6 1.3 -> -0.3 + +-- some differences from remainder +rmnx231 remaindernear 0.4 1.020 -> 0.400 +rmnx232 remaindernear 0.50 1.020 -> 0.500 +rmnx233 remaindernear 0.51 1.020 -> 0.510 +rmnx234 remaindernear 0.52 1.020 -> -0.500 +rmnx235 remaindernear 0.6 1.020 -> -0.420 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +rmnx270 remaindernear 1 1e999999999 -> 1 +rmnx271 remaindernear 1 0.9e999999999 -> 1 +rmnx272 remaindernear 1 0.99e999999999 -> 1 +rmnx273 remaindernear 1 0.999999999e999999999 -> 1 +rmnx274 remaindernear 9e999999999 1 -> NaN Division_impossible +rmnx275 remaindernear 9.9e999999999 1 -> NaN Division_impossible +rmnx276 remaindernear 9.99e999999999 1 -> NaN Division_impossible +rmnx277 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible + +rmnx280 remaindernear 0.1 9e-999999999 -> NaN Division_impossible +rmnx281 remaindernear 0.1 99e-999999999 -> NaN Division_impossible +rmnx282 remaindernear 0.1 999e-999999999 -> NaN Division_impossible + +rmnx283 remaindernear 0.1 9e-999999998 -> NaN Division_impossible +rmnx284 remaindernear 0.1 99e-999999998 -> NaN Division_impossible +rmnx285 remaindernear 0.1 999e-999999998 -> NaN Division_impossible +rmnx286 remaindernear 0.1 999e-999999997 -> NaN Division_impossible +rmnx287 remaindernear 0.1 9999e-999999997 -> NaN Division_impossible +rmnx288 remaindernear 0.1 99999e-999999997 -> NaN Division_impossible + +-- rmnx3xx are from DiagBigDecimal +rmnx301 remaindernear 1 3 -> 1 +rmnx302 remaindernear 5 5 -> 0 +rmnx303 remaindernear 13 10 -> 3 +rmnx304 remaindernear 13 50 -> 13 +rmnx305 remaindernear 13 100 -> 13 +rmnx306 remaindernear 13 1000 -> 13 +rmnx307 remaindernear .13 1 -> 0.13 +rmnx308 remaindernear 0.133 1 -> 0.133 +rmnx309 remaindernear 0.1033 1 -> 0.1033 +rmnx310 remaindernear 1.033 1 -> 0.033 +rmnx311 remaindernear 10.33 1 -> 0.33 +rmnx312 remaindernear 10.33 10 -> 0.33 +rmnx313 remaindernear 103.3 1 -> 0.3 +rmnx314 remaindernear 133 10 -> 3 +rmnx315 remaindernear 1033 10 -> 3 +rmnx316 remaindernear 1033 50 -> -17 +rmnx317 remaindernear 101.0 3 -> -1.0 +rmnx318 remaindernear 102.0 3 -> 0.0 +rmnx319 remaindernear 103.0 3 -> 1.0 +rmnx320 remaindernear 2.40 1 -> 0.40 +rmnx321 remaindernear 2.400 1 -> 0.400 +rmnx322 remaindernear 2.4 1 -> 0.4 +rmnx323 remaindernear 2.4 2 -> 0.4 +rmnx324 remaindernear 2.400 2 -> 0.400 +rmnx325 remaindernear 1 0.3 -> 0.1 +rmnx326 remaindernear 1 0.30 -> 0.10 +rmnx327 remaindernear 1 0.300 -> 0.100 +rmnx328 remaindernear 1 0.3000 -> 0.1000 +rmnx329 remaindernear 1.0 0.3 -> 0.1 +rmnx330 remaindernear 1.00 0.3 -> 0.10 +rmnx331 remaindernear 1.000 0.3 -> 0.100 +rmnx332 remaindernear 1.0000 0.3 -> 0.1000 +rmnx333 remaindernear 0.5 2 -> 0.5 +rmnx334 remaindernear 0.5 2.1 -> 0.5 +rmnx335 remaindernear 0.5 2.01 -> 0.50 +rmnx336 remaindernear 0.5 2.001 -> 0.500 +rmnx337 remaindernear 0.50 2 -> 0.50 +rmnx338 remaindernear 0.50 2.01 -> 0.50 +rmnx339 remaindernear 0.50 2.001 -> 0.500 + +rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 +rmnx341 remaindernear 0.5 0.50000001 -> -1E-8 +rmnx342 remaindernear 0.5 0.500000001 -> -1E-9 +rmnx343 remaindernear 0.5 0.5000000001 -> -1E-10 +rmnx344 remaindernear 0.5 0.50000000001 -> -1E-11 +rmnx345 remaindernear 0.5 0.4999999 -> 1E-7 +rmnx346 remaindernear 0.5 0.49999999 -> 1E-8 +rmnx347 remaindernear 0.5 0.499999999 -> 1E-9 +rmnx348 remaindernear 0.5 0.4999999999 -> 1E-10 +rmnx349 remaindernear 0.5 0.49999999999 -> 1E-11 + +rmnx350 remaindernear 0.03 7 -> 0.03 +rmnx351 remaindernear 5 2 -> 1 +rmnx352 remaindernear 4.1 2 -> 0.1 +rmnx353 remaindernear 4.01 2 -> 0.01 +rmnx354 remaindernear 4.001 2 -> 0.001 +rmnx355 remaindernear 4.0001 2 -> 0.0001 +rmnx356 remaindernear 4.00001 2 -> 0.00001 +rmnx357 remaindernear 4.000001 2 -> 0.000001 +rmnx358 remaindernear 4.0000001 2 -> 1E-7 + +rmnx360 remaindernear 1.2 0.7345 -> -0.2690 +rmnx361 remaindernear 0.8 12 -> 0.8 +rmnx362 remaindernear 0.8 0.2 -> 0.0 +rmnx363 remaindernear 0.8 0.3 -> -0.1 +rmnx364 remaindernear 0.800 12 -> 0.800 +rmnx365 remaindernear 0.800 1.7 -> 0.800 +rmnx366 remaindernear 2.400 2 -> 0.400 + +precision: 6 +rmnx371 remaindernear 2.400 2 -> 0.400 +precision: 3 +rmnx372 remaindernear 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded + +precision: 5 +rmnx381 remaindernear 12345 1 -> 0 +rmnx382 remaindernear 12345 1.0001 -> -0.2344 +rmnx383 remaindernear 12345 1.001 -> -0.333 +rmnx384 remaindernear 12345 1.01 -> -0.23 +rmnx385 remaindernear 12345 1.1 -> -0.3 +rmnx386 remaindernear 12355 4 -> -1 +rmnx387 remaindernear 12345 4 -> 1 +rmnx388 remaindernear 12355 4.0001 -> -1.3089 +rmnx389 remaindernear 12345 4.0001 -> 0.6914 +rmnx390 remaindernear 12345 4.9 -> 1.9 +rmnx391 remaindernear 12345 4.99 -> -0.26 +rmnx392 remaindernear 12345 4.999 -> 2.469 +rmnx393 remaindernear 12345 4.9999 -> 0.2469 +rmnx394 remaindernear 12345 5 -> 0 +rmnx395 remaindernear 12345 5.0001 -> -0.2469 +rmnx396 remaindernear 12345 5.001 -> -2.469 +rmnx397 remaindernear 12345 5.01 -> 0.36 +rmnx398 remaindernear 12345 5.1 -> -2.1 + +precision: 9 +-- some nasty division-by-1 cases [some similar above] +rmnx401 remaindernear 0.4 1 -> 0.4 +rmnx402 remaindernear 0.45 1 -> 0.45 +rmnx403 remaindernear 0.455 1 -> 0.455 +rmnx404 remaindernear 0.4555 1 -> 0.4555 +rmnx405 remaindernear 0.45555 1 -> 0.45555 +rmnx406 remaindernear 0.455555 1 -> 0.455555 +rmnx407 remaindernear 0.4555555 1 -> 0.4555555 +rmnx408 remaindernear 0.45555555 1 -> 0.45555555 +rmnx409 remaindernear 0.455555555 1 -> 0.455555555 + +-- some tricky LHSs +rmnx420 remaindernear 99999999.999999999 1E+8 -> -1E-9 +rmnx421 remaindernear 999999999.999999999 1E+9 -> -1E-9 +precision: 9 +rmnx430 remaindernear 0.455555555 1 -> 0.455555555 +precision: 8 +rmnx431 remaindernear 0.455555555 1 -> 0.45555556 Inexact Rounded +precision: 7 +rmnx432 remaindernear 0.455555555 1 -> 0.4555556 Inexact Rounded +precision: 6 +rmnx433 remaindernear 0.455555555 1 -> 0.455556 Inexact Rounded +precision: 5 +rmnx434 remaindernear 0.455555555 1 -> 0.45556 Inexact Rounded +precision: 4 +rmnx435 remaindernear 0.455555555 1 -> 0.4556 Inexact Rounded +precision: 3 +rmnx436 remaindernear 0.455555555 1 -> 0.456 Inexact Rounded +precision: 2 +rmnx437 remaindernear 0.455555555 1 -> 0.46 Inexact Rounded +precision: 1 +rmnx438 remaindernear 0.455555555 1 -> 0.5 Inexact Rounded + +-- early tests; from text descriptions +precision: 9 +rmnx601 remaindernear 10 6 -> -2 +rmnx602 remaindernear -10 6 -> 2 +rmnx603 remaindernear 11 3 -> -1 +rmnx604 remaindernear 11 5 -> 1 +rmnx605 remaindernear 7.7 8 -> -0.3 +rmnx606 remaindernear 31.5 3 -> 1.5 -- i=10 +rmnx607 remaindernear 34.5 3 -> -1.5 -- i=11 + +-- zero signs +rmnx650 remaindernear 1 1 -> 0 +rmnx651 remaindernear -1 1 -> -0 +rmnx652 remaindernear 1 -1 -> 0 +rmnx653 remaindernear -1 -1 -> -0 +rmnx654 remaindernear 0 1 -> 0 +rmnx655 remaindernear -0 1 -> -0 +rmnx656 remaindernear 0 -1 -> 0 +rmnx657 remaindernear -0 -1 -> -0 +rmnx658 remaindernear 0.00 1 -> 0.00 +rmnx659 remaindernear -0.00 1 -> -0.00 + +-- Specials +rmnx680 remaindernear Inf -Inf -> NaN Invalid_operation +rmnx681 remaindernear Inf -1000 -> NaN Invalid_operation +rmnx682 remaindernear Inf -1 -> NaN Invalid_operation +rmnx683 remaindernear Inf 0 -> NaN Invalid_operation +rmnx684 remaindernear Inf -0 -> NaN Invalid_operation +rmnx685 remaindernear Inf 1 -> NaN Invalid_operation +rmnx686 remaindernear Inf 1000 -> NaN Invalid_operation +rmnx687 remaindernear Inf Inf -> NaN Invalid_operation +rmnx688 remaindernear -1000 Inf -> -1000 +rmnx689 remaindernear -Inf Inf -> NaN Invalid_operation +rmnx691 remaindernear -1 Inf -> -1 +rmnx692 remaindernear 0 Inf -> 0 +rmnx693 remaindernear -0 Inf -> -0 +rmnx694 remaindernear 1 Inf -> 1 +rmnx695 remaindernear 1000 Inf -> 1000 +rmnx696 remaindernear Inf Inf -> NaN Invalid_operation + +rmnx700 remaindernear -Inf -Inf -> NaN Invalid_operation +rmnx701 remaindernear -Inf -1000 -> NaN Invalid_operation +rmnx702 remaindernear -Inf -1 -> NaN Invalid_operation +rmnx703 remaindernear -Inf -0 -> NaN Invalid_operation +rmnx704 remaindernear -Inf 0 -> NaN Invalid_operation +rmnx705 remaindernear -Inf 1 -> NaN Invalid_operation +rmnx706 remaindernear -Inf 1000 -> NaN Invalid_operation +rmnx707 remaindernear -Inf Inf -> NaN Invalid_operation +rmnx708 remaindernear -Inf -Inf -> NaN Invalid_operation +rmnx709 remaindernear -1000 Inf -> -1000 +rmnx710 remaindernear -1 -Inf -> -1 +rmnx711 remaindernear -0 -Inf -> -0 +rmnx712 remaindernear 0 -Inf -> 0 +rmnx713 remaindernear 1 -Inf -> 1 +rmnx714 remaindernear 1000 -Inf -> 1000 +rmnx715 remaindernear Inf -Inf -> NaN Invalid_operation + +rmnx721 remaindernear NaN -Inf -> NaN +rmnx722 remaindernear NaN -1000 -> NaN +rmnx723 remaindernear NaN -1 -> NaN +rmnx724 remaindernear NaN -0 -> NaN +rmnx725 remaindernear NaN 0 -> NaN +rmnx726 remaindernear NaN 1 -> NaN +rmnx727 remaindernear NaN 1000 -> NaN +rmnx728 remaindernear NaN Inf -> NaN +rmnx729 remaindernear NaN NaN -> NaN +rmnx730 remaindernear -Inf NaN -> NaN +rmnx731 remaindernear -1000 NaN -> NaN +rmnx732 remaindernear -1 -NaN -> -NaN +rmnx733 remaindernear -0 NaN -> NaN +rmnx734 remaindernear 0 NaN -> NaN +rmnx735 remaindernear 1 NaN -> NaN +rmnx736 remaindernear 1000 NaN -> NaN +rmnx737 remaindernear Inf NaN -> NaN + +rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation +rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation +rmnx743 remaindernear -sNaN -1 -> -NaN Invalid_operation +rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation +rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation +rmnx746 remaindernear sNaN 1 -> NaN Invalid_operation +rmnx747 remaindernear sNaN 1000 -> NaN Invalid_operation +rmnx749 remaindernear sNaN NaN -> NaN Invalid_operation +rmnx750 remaindernear sNaN sNaN -> NaN Invalid_operation +rmnx751 remaindernear NaN sNaN -> NaN Invalid_operation +rmnx752 remaindernear -Inf sNaN -> NaN Invalid_operation +rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation +rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation +rmnx755 remaindernear -0 -sNaN -> -NaN Invalid_operation +rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation +rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation +rmnx758 remaindernear 1000 sNaN -> NaN Invalid_operation +rmnx759 remaindernear Inf sNaN -> NaN Invalid_operation +rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation + +-- propaging NaNs +rmnx761 remaindernear NaN1 NaN7 -> NaN1 +rmnx762 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation +rmnx763 remaindernear NaN3 -sNaN9 -> -NaN9 Invalid_operation +rmnx764 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation +rmnx765 remaindernear 15 NaN11 -> NaN11 +rmnx766 remaindernear NaN6 NaN12 -> NaN6 +rmnx767 remaindernear Inf -NaN13 -> -NaN13 +rmnx768 remaindernear NaN14 -Inf -> NaN14 +rmnx769 remaindernear 0 NaN15 -> NaN15 +rmnx770 remaindernear -NaN16 -0 -> -NaN16 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +rmnx780 remaindernear 1 1e999999999 -> 1 +rmnx781 remaindernear 1 0.9e999999999 -> 1 +rmnx782 remaindernear 1 0.99e999999999 -> 1 +rmnx783 remaindernear 1 0.999999999e999999999 -> 1 +rmnx784 remaindernear 9e999999999 1 -> NaN Division_impossible +rmnx785 remaindernear 9.9e999999999 1 -> NaN Division_impossible +rmnx786 remaindernear 9.99e999999999 1 -> NaN Division_impossible +rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible + + +-- overflow and underflow tests [from divide] +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded +rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +rmnx792 remaindernear +0.100 9E+999999999 -> 0.100 +rmnx793 remaindernear 9E-999999999 +9.100 -> 9E-999999999 +rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded +rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +rmnx797 remaindernear -0.100 9E+999999999 -> -0.100 +rmnx798 remaindernear 9E-999999999 -9.100 -> 9E-999999999 + +-- long operands checks +maxexponent: 999 +minexponent: -999 +precision: 9 +rmnx801 remaindernear 12345678000 100 -> 0 +rmnx802 remaindernear 1 12345678000 -> 1 +rmnx803 remaindernear 1234567800 10 -> 0 +rmnx804 remaindernear 1 1234567800 -> 1 +rmnx805 remaindernear 1234567890 10 -> 0 +rmnx806 remaindernear 1 1234567890 -> 1 +rmnx807 remaindernear 1234567891 10 -> 1 +rmnx808 remaindernear 1 1234567891 -> 1 +rmnx809 remaindernear 12345678901 100 -> 1 +rmnx810 remaindernear 1 12345678901 -> 1 +rmnx811 remaindernear 1234567896 10 -> -4 +rmnx812 remaindernear 1 1234567896 -> 1 + +precision: 15 +rmnx841 remaindernear 12345678000 100 -> 0 +rmnx842 remaindernear 1 12345678000 -> 1 +rmnx843 remaindernear 1234567800 10 -> 0 +rmnx844 remaindernear 1 1234567800 -> 1 +rmnx845 remaindernear 1234567890 10 -> 0 +rmnx846 remaindernear 1 1234567890 -> 1 +rmnx847 remaindernear 1234567891 10 -> 1 +rmnx848 remaindernear 1 1234567891 -> 1 +rmnx849 remaindernear 12345678901 100 -> 1 +rmnx850 remaindernear 1 12345678901 -> 1 +rmnx851 remaindernear 1234567896 10 -> -4 +rmnx852 remaindernear 1 1234567896 -> 1 + +-- Null tests +rmnx900 remaindernear 10 # -> NaN Invalid_operation +rmnx901 remaindernear # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rescale.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rescale.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,764 @@ +------------------------------------------------------------------------ +-- rescale.decTest -- decimal rescale operation -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- [obsolete] Quantize.decTest has the improved version + +-- 2004.03.15 Underflow for quantize is suppressed + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- sanity checks + +resx001 rescale 0 0 -> 0 +resx002 rescale 1 0 -> 1 +resx003 rescale 0.1 +2 -> 0E+2 Inexact Rounded +resx005 rescale 0.1 +1 -> 0E+1 Inexact Rounded +resx006 rescale 0.1 0 -> 0 Inexact Rounded +resx007 rescale 0.1 -1 -> 0.1 +resx008 rescale 0.1 -2 -> 0.10 +resx009 rescale 0.1 -3 -> 0.100 +resx010 rescale 0.9 +2 -> 0E+2 Inexact Rounded +resx011 rescale 0.9 +1 -> 0E+1 Inexact Rounded +resx012 rescale 0.9 +0 -> 1 Inexact Rounded +resx013 rescale 0.9 -1 -> 0.9 +resx014 rescale 0.9 -2 -> 0.90 +resx015 rescale 0.9 -3 -> 0.900 +-- negatives +resx021 rescale -0 0 -> -0 +resx022 rescale -1 0 -> -1 +resx023 rescale -0.1 +2 -> -0E+2 Inexact Rounded +resx025 rescale -0.1 +1 -> -0E+1 Inexact Rounded +resx026 rescale -0.1 0 -> -0 Inexact Rounded +resx027 rescale -0.1 -1 -> -0.1 +resx028 rescale -0.1 -2 -> -0.10 +resx029 rescale -0.1 -3 -> -0.100 +resx030 rescale -0.9 +2 -> -0E+2 Inexact Rounded +resx031 rescale -0.9 +1 -> -0E+1 Inexact Rounded +resx032 rescale -0.9 +0 -> -1 Inexact Rounded +resx033 rescale -0.9 -1 -> -0.9 +resx034 rescale -0.9 -2 -> -0.90 +resx035 rescale -0.9 -3 -> -0.900 +resx036 rescale -0.5 +2 -> -0E+2 Inexact Rounded +resx037 rescale -0.5 +1 -> -0E+1 Inexact Rounded +resx038 rescale -0.5 +0 -> -1 Inexact Rounded +resx039 rescale -0.5 -1 -> -0.5 +resx040 rescale -0.5 -2 -> -0.50 +resx041 rescale -0.5 -3 -> -0.500 +resx042 rescale -0.9 +2 -> -0E+2 Inexact Rounded +resx043 rescale -0.9 +1 -> -0E+1 Inexact Rounded +resx044 rescale -0.9 +0 -> -1 Inexact Rounded +resx045 rescale -0.9 -1 -> -0.9 +resx046 rescale -0.9 -2 -> -0.90 +resx047 rescale -0.9 -3 -> -0.900 + +-- examples from Specification +resx060 rescale 2.17 -3 -> 2.170 +resx061 rescale 2.17 -2 -> 2.17 +resx062 rescale 2.17 -1 -> 2.2 Inexact Rounded +resx063 rescale 2.17 0 -> 2 Inexact Rounded +resx064 rescale 2.17 +1 -> 0E+1 Inexact Rounded +resx065 rescale 2 Inf -> NaN Invalid_operation +resx066 rescale -0.1 0 -> -0 Inexact Rounded +resx067 rescale -0 5 -> -0E+5 +resx068 rescale +35236450.6 -2 -> NaN Invalid_operation +resx069 rescale -35236450.6 -2 -> NaN Invalid_operation +resx070 rescale 217 -1 -> 217.0 +resx071 rescale 217 0 -> 217 +resx072 rescale 217 +1 -> 2.2E+2 Inexact Rounded +resx073 rescale 217 +2 -> 2E+2 Inexact Rounded + +-- general tests .. +resx089 rescale 12 +4 -> 0E+4 Inexact Rounded +resx090 rescale 12 +3 -> 0E+3 Inexact Rounded +resx091 rescale 12 +2 -> 0E+2 Inexact Rounded +resx092 rescale 12 +1 -> 1E+1 Inexact Rounded +resx093 rescale 1.2345 -2 -> 1.23 Inexact Rounded +resx094 rescale 1.2355 -2 -> 1.24 Inexact Rounded +resx095 rescale 1.2345 -6 -> 1.234500 +resx096 rescale 9.9999 -2 -> 10.00 Inexact Rounded +resx097 rescale 0.0001 -2 -> 0.00 Inexact Rounded +resx098 rescale 0.001 -2 -> 0.00 Inexact Rounded +resx099 rescale 0.009 -2 -> 0.01 Inexact Rounded +resx100 rescale 92 +2 -> 1E+2 Inexact Rounded + +resx101 rescale -1 0 -> -1 +resx102 rescale -1 -1 -> -1.0 +resx103 rescale -1 -2 -> -1.00 +resx104 rescale 0 0 -> 0 +resx105 rescale 0 -1 -> 0.0 +resx106 rescale 0 -2 -> 0.00 +resx107 rescale 0.00 0 -> 0 +resx108 rescale 0 +1 -> 0E+1 +resx109 rescale 0 +2 -> 0E+2 +resx110 rescale +1 0 -> 1 +resx111 rescale +1 -1 -> 1.0 +resx112 rescale +1 -2 -> 1.00 + +resx120 rescale 1.04 -3 -> 1.040 +resx121 rescale 1.04 -2 -> 1.04 +resx122 rescale 1.04 -1 -> 1.0 Inexact Rounded +resx123 rescale 1.04 0 -> 1 Inexact Rounded +resx124 rescale 1.05 -3 -> 1.050 +resx125 rescale 1.05 -2 -> 1.05 +resx126 rescale 1.05 -1 -> 1.1 Inexact Rounded +resx127 rescale 1.05 0 -> 1 Inexact Rounded +resx128 rescale 1.05 -3 -> 1.050 +resx129 rescale 1.05 -2 -> 1.05 +resx130 rescale 1.05 -1 -> 1.1 Inexact Rounded +resx131 rescale 1.05 0 -> 1 Inexact Rounded +resx132 rescale 1.06 -3 -> 1.060 +resx133 rescale 1.06 -2 -> 1.06 +resx134 rescale 1.06 -1 -> 1.1 Inexact Rounded +resx135 rescale 1.06 0 -> 1 Inexact Rounded + +resx140 rescale -10 -2 -> -10.00 +resx141 rescale +1 -2 -> 1.00 +resx142 rescale +10 -2 -> 10.00 +resx143 rescale 1E+10 -2 -> NaN Invalid_operation +resx144 rescale 1E-10 -2 -> 0.00 Inexact Rounded +resx145 rescale 1E-3 -2 -> 0.00 Inexact Rounded +resx146 rescale 1E-2 -2 -> 0.01 +resx147 rescale 1E-1 -2 -> 0.10 +resx148 rescale 0E-10 -2 -> 0.00 + +resx150 rescale 1.0600 -5 -> 1.06000 +resx151 rescale 1.0600 -4 -> 1.0600 +resx152 rescale 1.0600 -3 -> 1.060 Rounded +resx153 rescale 1.0600 -2 -> 1.06 Rounded +resx154 rescale 1.0600 -1 -> 1.1 Inexact Rounded +resx155 rescale 1.0600 0 -> 1 Inexact Rounded + +-- +ve exponents .. +resx201 rescale -1 +0 -> -1 +resx202 rescale -1 +1 -> -0E+1 Inexact Rounded +resx203 rescale -1 +2 -> -0E+2 Inexact Rounded +resx204 rescale 0 +0 -> 0 +resx205 rescale 0 +1 -> 0E+1 +resx206 rescale 0 +2 -> 0E+2 +resx207 rescale +1 +0 -> 1 +resx208 rescale +1 +1 -> 0E+1 Inexact Rounded +resx209 rescale +1 +2 -> 0E+2 Inexact Rounded + +resx220 rescale 1.04 +3 -> 0E+3 Inexact Rounded +resx221 rescale 1.04 +2 -> 0E+2 Inexact Rounded +resx222 rescale 1.04 +1 -> 0E+1 Inexact Rounded +resx223 rescale 1.04 +0 -> 1 Inexact Rounded +resx224 rescale 1.05 +3 -> 0E+3 Inexact Rounded +resx225 rescale 1.05 +2 -> 0E+2 Inexact Rounded +resx226 rescale 1.05 +1 -> 0E+1 Inexact Rounded +resx227 rescale 1.05 +0 -> 1 Inexact Rounded +resx228 rescale 1.05 +3 -> 0E+3 Inexact Rounded +resx229 rescale 1.05 +2 -> 0E+2 Inexact Rounded +resx230 rescale 1.05 +1 -> 0E+1 Inexact Rounded +resx231 rescale 1.05 +0 -> 1 Inexact Rounded +resx232 rescale 1.06 +3 -> 0E+3 Inexact Rounded +resx233 rescale 1.06 +2 -> 0E+2 Inexact Rounded +resx234 rescale 1.06 +1 -> 0E+1 Inexact Rounded +resx235 rescale 1.06 +0 -> 1 Inexact Rounded + +resx240 rescale -10 +1 -> -1E+1 Rounded +resx241 rescale +1 +1 -> 0E+1 Inexact Rounded +resx242 rescale +10 +1 -> 1E+1 Rounded +resx243 rescale 1E+1 +1 -> 1E+1 -- underneath this is E+1 +resx244 rescale 1E+2 +1 -> 1.0E+2 -- underneath this is E+1 +resx245 rescale 1E+3 +1 -> 1.00E+3 -- underneath this is E+1 +resx246 rescale 1E+4 +1 -> 1.000E+4 -- underneath this is E+1 +resx247 rescale 1E+5 +1 -> 1.0000E+5 -- underneath this is E+1 +resx248 rescale 1E+6 +1 -> 1.00000E+6 -- underneath this is E+1 +resx249 rescale 1E+7 +1 -> 1.000000E+7 -- underneath this is E+1 +resx250 rescale 1E+8 +1 -> 1.0000000E+8 -- underneath this is E+1 +resx251 rescale 1E+9 +1 -> 1.00000000E+9 -- underneath this is E+1 +-- next one tries to add 9 zeros +resx252 rescale 1E+10 +1 -> NaN Invalid_operation +resx253 rescale 1E-10 +1 -> 0E+1 Inexact Rounded +resx254 rescale 1E-2 +1 -> 0E+1 Inexact Rounded +resx255 rescale 0E-10 +1 -> 0E+1 +resx256 rescale -0E-10 +1 -> -0E+1 +resx257 rescale -0E-1 +1 -> -0E+1 +resx258 rescale -0 +1 -> -0E+1 +resx259 rescale -0E+1 +1 -> -0E+1 + +resx260 rescale -10 +2 -> -0E+2 Inexact Rounded +resx261 rescale +1 +2 -> 0E+2 Inexact Rounded +resx262 rescale +10 +2 -> 0E+2 Inexact Rounded +resx263 rescale 1E+1 +2 -> 0E+2 Inexact Rounded +resx264 rescale 1E+2 +2 -> 1E+2 +resx265 rescale 1E+3 +2 -> 1.0E+3 +resx266 rescale 1E+4 +2 -> 1.00E+4 +resx267 rescale 1E+5 +2 -> 1.000E+5 +resx268 rescale 1E+6 +2 -> 1.0000E+6 +resx269 rescale 1E+7 +2 -> 1.00000E+7 +resx270 rescale 1E+8 +2 -> 1.000000E+8 +resx271 rescale 1E+9 +2 -> 1.0000000E+9 +resx272 rescale 1E+10 +2 -> 1.00000000E+10 +resx273 rescale 1E-10 +2 -> 0E+2 Inexact Rounded +resx274 rescale 1E-2 +2 -> 0E+2 Inexact Rounded +resx275 rescale 0E-10 +2 -> 0E+2 + +resx280 rescale -10 +3 -> -0E+3 Inexact Rounded +resx281 rescale +1 +3 -> 0E+3 Inexact Rounded +resx282 rescale +10 +3 -> 0E+3 Inexact Rounded +resx283 rescale 1E+1 +3 -> 0E+3 Inexact Rounded +resx284 rescale 1E+2 +3 -> 0E+3 Inexact Rounded +resx285 rescale 1E+3 +3 -> 1E+3 +resx286 rescale 1E+4 +3 -> 1.0E+4 +resx287 rescale 1E+5 +3 -> 1.00E+5 +resx288 rescale 1E+6 +3 -> 1.000E+6 +resx289 rescale 1E+7 +3 -> 1.0000E+7 +resx290 rescale 1E+8 +3 -> 1.00000E+8 +resx291 rescale 1E+9 +3 -> 1.000000E+9 +resx292 rescale 1E+10 +3 -> 1.0000000E+10 +resx293 rescale 1E-10 +3 -> 0E+3 Inexact Rounded +resx294 rescale 1E-2 +3 -> 0E+3 Inexact Rounded +resx295 rescale 0E-10 +3 -> 0E+3 + +-- round up from below [sign wrong in JIT compiler once] +resx300 rescale 0.0078 -5 -> 0.00780 +resx301 rescale 0.0078 -4 -> 0.0078 +resx302 rescale 0.0078 -3 -> 0.008 Inexact Rounded +resx303 rescale 0.0078 -2 -> 0.01 Inexact Rounded +resx304 rescale 0.0078 -1 -> 0.0 Inexact Rounded +resx305 rescale 0.0078 0 -> 0 Inexact Rounded +resx306 rescale 0.0078 +1 -> 0E+1 Inexact Rounded +resx307 rescale 0.0078 +2 -> 0E+2 Inexact Rounded + +resx310 rescale -0.0078 -5 -> -0.00780 +resx311 rescale -0.0078 -4 -> -0.0078 +resx312 rescale -0.0078 -3 -> -0.008 Inexact Rounded +resx313 rescale -0.0078 -2 -> -0.01 Inexact Rounded +resx314 rescale -0.0078 -1 -> -0.0 Inexact Rounded +resx315 rescale -0.0078 0 -> -0 Inexact Rounded +resx316 rescale -0.0078 +1 -> -0E+1 Inexact Rounded +resx317 rescale -0.0078 +2 -> -0E+2 Inexact Rounded + +resx320 rescale 0.078 -5 -> 0.07800 +resx321 rescale 0.078 -4 -> 0.0780 +resx322 rescale 0.078 -3 -> 0.078 +resx323 rescale 0.078 -2 -> 0.08 Inexact Rounded +resx324 rescale 0.078 -1 -> 0.1 Inexact Rounded +resx325 rescale 0.078 0 -> 0 Inexact Rounded +resx326 rescale 0.078 +1 -> 0E+1 Inexact Rounded +resx327 rescale 0.078 +2 -> 0E+2 Inexact Rounded + +resx330 rescale -0.078 -5 -> -0.07800 +resx331 rescale -0.078 -4 -> -0.0780 +resx332 rescale -0.078 -3 -> -0.078 +resx333 rescale -0.078 -2 -> -0.08 Inexact Rounded +resx334 rescale -0.078 -1 -> -0.1 Inexact Rounded +resx335 rescale -0.078 0 -> -0 Inexact Rounded +resx336 rescale -0.078 +1 -> -0E+1 Inexact Rounded +resx337 rescale -0.078 +2 -> -0E+2 Inexact Rounded + +resx340 rescale 0.78 -5 -> 0.78000 +resx341 rescale 0.78 -4 -> 0.7800 +resx342 rescale 0.78 -3 -> 0.780 +resx343 rescale 0.78 -2 -> 0.78 +resx344 rescale 0.78 -1 -> 0.8 Inexact Rounded +resx345 rescale 0.78 0 -> 1 Inexact Rounded +resx346 rescale 0.78 +1 -> 0E+1 Inexact Rounded +resx347 rescale 0.78 +2 -> 0E+2 Inexact Rounded + +resx350 rescale -0.78 -5 -> -0.78000 +resx351 rescale -0.78 -4 -> -0.7800 +resx352 rescale -0.78 -3 -> -0.780 +resx353 rescale -0.78 -2 -> -0.78 +resx354 rescale -0.78 -1 -> -0.8 Inexact Rounded +resx355 rescale -0.78 0 -> -1 Inexact Rounded +resx356 rescale -0.78 +1 -> -0E+1 Inexact Rounded +resx357 rescale -0.78 +2 -> -0E+2 Inexact Rounded + +resx360 rescale 7.8 -5 -> 7.80000 +resx361 rescale 7.8 -4 -> 7.8000 +resx362 rescale 7.8 -3 -> 7.800 +resx363 rescale 7.8 -2 -> 7.80 +resx364 rescale 7.8 -1 -> 7.8 +resx365 rescale 7.8 0 -> 8 Inexact Rounded +resx366 rescale 7.8 +1 -> 1E+1 Inexact Rounded +resx367 rescale 7.8 +2 -> 0E+2 Inexact Rounded +resx368 rescale 7.8 +3 -> 0E+3 Inexact Rounded + +resx370 rescale -7.8 -5 -> -7.80000 +resx371 rescale -7.8 -4 -> -7.8000 +resx372 rescale -7.8 -3 -> -7.800 +resx373 rescale -7.8 -2 -> -7.80 +resx374 rescale -7.8 -1 -> -7.8 +resx375 rescale -7.8 0 -> -8 Inexact Rounded +resx376 rescale -7.8 +1 -> -1E+1 Inexact Rounded +resx377 rescale -7.8 +2 -> -0E+2 Inexact Rounded +resx378 rescale -7.8 +3 -> -0E+3 Inexact Rounded + +-- some individuals +precision: 9 +resx380 rescale 352364.506 -2 -> 352364.51 Inexact Rounded +resx381 rescale 3523645.06 -2 -> 3523645.06 +resx382 rescale 35236450.6 -2 -> NaN Invalid_operation +resx383 rescale 352364506 -2 -> NaN Invalid_operation +resx384 rescale -352364.506 -2 -> -352364.51 Inexact Rounded +resx385 rescale -3523645.06 -2 -> -3523645.06 +resx386 rescale -35236450.6 -2 -> NaN Invalid_operation +resx387 rescale -352364506 -2 -> NaN Invalid_operation + +rounding: down +resx389 rescale 35236450.6 -2 -> NaN Invalid_operation +-- ? should that one instead have been: +-- resx389 rescale 35236450.6 -2 -> NaN Invalid_operation +rounding: half_up + +-- and a few more from e-mail discussions +precision: 7 +resx391 rescale 12.34567 -3 -> 12.346 Inexact Rounded +resx392 rescale 123.4567 -3 -> 123.457 Inexact Rounded +resx393 rescale 1234.567 -3 -> 1234.567 +resx394 rescale 12345.67 -3 -> NaN Invalid_operation +resx395 rescale 123456.7 -3 -> NaN Invalid_operation +resx396 rescale 1234567. -3 -> NaN Invalid_operation + +-- some 9999 round-up cases +precision: 9 +resx400 rescale 9.999 -5 -> 9.99900 +resx401 rescale 9.999 -4 -> 9.9990 +resx402 rescale 9.999 -3 -> 9.999 +resx403 rescale 9.999 -2 -> 10.00 Inexact Rounded +resx404 rescale 9.999 -1 -> 10.0 Inexact Rounded +resx405 rescale 9.999 0 -> 10 Inexact Rounded +resx406 rescale 9.999 1 -> 1E+1 Inexact Rounded +resx407 rescale 9.999 2 -> 0E+2 Inexact Rounded + +resx410 rescale 0.999 -5 -> 0.99900 +resx411 rescale 0.999 -4 -> 0.9990 +resx412 rescale 0.999 -3 -> 0.999 +resx413 rescale 0.999 -2 -> 1.00 Inexact Rounded +resx414 rescale 0.999 -1 -> 1.0 Inexact Rounded +resx415 rescale 0.999 0 -> 1 Inexact Rounded +resx416 rescale 0.999 1 -> 0E+1 Inexact Rounded + +resx420 rescale 0.0999 -5 -> 0.09990 +resx421 rescale 0.0999 -4 -> 0.0999 +resx422 rescale 0.0999 -3 -> 0.100 Inexact Rounded +resx423 rescale 0.0999 -2 -> 0.10 Inexact Rounded +resx424 rescale 0.0999 -1 -> 0.1 Inexact Rounded +resx425 rescale 0.0999 0 -> 0 Inexact Rounded +resx426 rescale 0.0999 1 -> 0E+1 Inexact Rounded + +resx430 rescale 0.00999 -5 -> 0.00999 +resx431 rescale 0.00999 -4 -> 0.0100 Inexact Rounded +resx432 rescale 0.00999 -3 -> 0.010 Inexact Rounded +resx433 rescale 0.00999 -2 -> 0.01 Inexact Rounded +resx434 rescale 0.00999 -1 -> 0.0 Inexact Rounded +resx435 rescale 0.00999 0 -> 0 Inexact Rounded +resx436 rescale 0.00999 1 -> 0E+1 Inexact Rounded + +resx440 rescale 0.000999 -5 -> 0.00100 Inexact Rounded +resx441 rescale 0.000999 -4 -> 0.0010 Inexact Rounded +resx442 rescale 0.000999 -3 -> 0.001 Inexact Rounded +resx443 rescale 0.000999 -2 -> 0.00 Inexact Rounded +resx444 rescale 0.000999 -1 -> 0.0 Inexact Rounded +resx445 rescale 0.000999 0 -> 0 Inexact Rounded +resx446 rescale 0.000999 1 -> 0E+1 Inexact Rounded + +precision: 8 +resx449 rescale 9.999E-15 -23 -> NaN Invalid_operation +resx450 rescale 9.999E-15 -22 -> 9.9990000E-15 +resx451 rescale 9.999E-15 -21 -> 9.999000E-15 +resx452 rescale 9.999E-15 -20 -> 9.99900E-15 +resx453 rescale 9.999E-15 -19 -> 9.9990E-15 +resx454 rescale 9.999E-15 -18 -> 9.999E-15 +resx455 rescale 9.999E-15 -17 -> 1.000E-14 Inexact Rounded +resx456 rescale 9.999E-15 -16 -> 1.00E-14 Inexact Rounded +resx457 rescale 9.999E-15 -15 -> 1.0E-14 Inexact Rounded +resx458 rescale 9.999E-15 -14 -> 1E-14 Inexact Rounded +resx459 rescale 9.999E-15 -13 -> 0E-13 Inexact Rounded +resx460 rescale 9.999E-15 -12 -> 0E-12 Inexact Rounded +resx461 rescale 9.999E-15 -11 -> 0E-11 Inexact Rounded +resx462 rescale 9.999E-15 -10 -> 0E-10 Inexact Rounded +resx463 rescale 9.999E-15 -9 -> 0E-9 Inexact Rounded +resx464 rescale 9.999E-15 -8 -> 0E-8 Inexact Rounded +resx465 rescale 9.999E-15 -7 -> 0E-7 Inexact Rounded +resx466 rescale 9.999E-15 -6 -> 0.000000 Inexact Rounded +resx467 rescale 9.999E-15 -5 -> 0.00000 Inexact Rounded +resx468 rescale 9.999E-15 -4 -> 0.0000 Inexact Rounded +resx469 rescale 9.999E-15 -3 -> 0.000 Inexact Rounded +resx470 rescale 9.999E-15 -2 -> 0.00 Inexact Rounded +resx471 rescale 9.999E-15 -1 -> 0.0 Inexact Rounded +resx472 rescale 9.999E-15 0 -> 0 Inexact Rounded +resx473 rescale 9.999E-15 1 -> 0E+1 Inexact Rounded + +-- [additional tests for "don't fit" edge cases are in +-- quantize.decTest. Here's a critical one.] +precision: 3 +resx480 rescale 0.9999 -3 -> NaN Invalid_operation + + +-- long operand checks [rhs checks removed] +maxexponent: 999 +minexponent: -999 +precision: 9 +resx481 rescale 12345678000 +3 -> 1.2345678E+10 Rounded +resx482 rescale 1234567800 +1 -> 1.23456780E+9 Rounded +resx483 rescale 1234567890 +1 -> 1.23456789E+9 Rounded +resx484 rescale 1234567891 +1 -> 1.23456789E+9 Inexact Rounded +resx485 rescale 12345678901 +2 -> 1.23456789E+10 Inexact Rounded +resx486 rescale 1234567896 +1 -> 1.23456790E+9 Inexact Rounded +-- a potential double-round +resx487 rescale 1234.987643 -4 -> 1234.9876 Inexact Rounded +resx488 rescale 1234.987647 -4 -> 1234.9876 Inexact Rounded + +precision: 15 +resx491 rescale 12345678000 +3 -> 1.2345678E+10 Rounded +resx492 rescale 1234567800 +1 -> 1.23456780E+9 Rounded +resx493 rescale 1234567890 +1 -> 1.23456789E+9 Rounded +resx494 rescale 1234567891 +1 -> 1.23456789E+9 Inexact Rounded +resx495 rescale 12345678901 +2 -> 1.23456789E+10 Inexact Rounded +resx496 rescale 1234567896 +1 -> 1.23456790E+9 Inexact Rounded +resx497 rescale 1234.987643 -4 -> 1234.9876 Inexact Rounded +resx498 rescale 1234.987647 -4 -> 1234.9876 Inexact Rounded + +-- Zeros +resx500 rescale 0 1 -> 0E+1 +resx501 rescale 0 0 -> 0 +resx502 rescale 0 -1 -> 0.0 +resx503 rescale 0.0 -1 -> 0.0 +resx504 rescale 0.0 0 -> 0 +resx505 rescale 0.0 +1 -> 0E+1 +resx506 rescale 0E+1 -1 -> 0.0 +resx507 rescale 0E+1 0 -> 0 +resx508 rescale 0E+1 +1 -> 0E+1 +resx509 rescale -0 1 -> -0E+1 +resx510 rescale -0 0 -> -0 +resx511 rescale -0 -1 -> -0.0 +resx512 rescale -0.0 -1 -> -0.0 +resx513 rescale -0.0 0 -> -0 +resx514 rescale -0.0 +1 -> -0E+1 +resx515 rescale -0E+1 -1 -> -0.0 +resx516 rescale -0E+1 0 -> -0 +resx517 rescale -0E+1 +1 -> -0E+1 + +-- Suspicious RHS values +maxexponent: 999999999 +minexponent: -999999999 +precision: 15 +resx520 rescale 1.234 999999E+3 -> 0E+999999000 Inexact Rounded +resx521 rescale 123.456 999999E+3 -> 0E+999999000 Inexact Rounded +resx522 rescale 1.234 999999999 -> 0E+999999999 Inexact Rounded +resx523 rescale 123.456 999999999 -> 0E+999999999 Inexact Rounded +resx524 rescale 123.456 1000000000 -> NaN Invalid_operation +resx525 rescale 123.456 12345678903 -> NaN Invalid_operation +-- next four are "won't fit" overflows +resx526 rescale 1.234 -999999E+3 -> NaN Invalid_operation +resx527 rescale 123.456 -999999E+3 -> NaN Invalid_operation +resx528 rescale 1.234 -999999999 -> NaN Invalid_operation +resx529 rescale 123.456 -999999999 -> NaN Invalid_operation +resx530 rescale 123.456 -1000000014 -> NaN Invalid_operation +resx531 rescale 123.456 -12345678903 -> NaN Invalid_operation + +maxexponent: 999 +minexponent: -999 +precision: 15 +resx532 rescale 1.234E+999 999 -> 1E+999 Inexact Rounded +resx533 rescale 1.234E+998 999 -> 0E+999 Inexact Rounded +resx534 rescale 1.234 999 -> 0E+999 Inexact Rounded +resx535 rescale 1.234 1000 -> NaN Invalid_operation +resx536 rescale 1.234 5000 -> NaN Invalid_operation +resx537 rescale 0 -999 -> 0E-999 +-- next two are "won't fit" overflows +resx538 rescale 1.234 -999 -> NaN Invalid_operation +resx539 rescale 1.234 -1000 -> NaN Invalid_operation +resx540 rescale 1.234 -5000 -> NaN Invalid_operation +-- [more below] + +-- check bounds (lhs maybe out of range for destination, etc.) +precision: 7 +resx541 rescale 1E+999 +999 -> 1E+999 +resx542 rescale 1E+1000 +999 -> NaN Invalid_operation +resx543 rescale 1E+999 +1000 -> NaN Invalid_operation +resx544 rescale 1E-999 -999 -> 1E-999 +resx545 rescale 1E-1000 -999 -> 0E-999 Inexact Rounded +resx546 rescale 1E-999 -1000 -> 1.0E-999 +resx547 rescale 1E-1005 -999 -> 0E-999 Inexact Rounded +resx548 rescale 1E-1006 -999 -> 0E-999 Inexact Rounded +resx549 rescale 1E-1007 -999 -> 0E-999 Inexact Rounded +resx550 rescale 1E-998 -1005 -> NaN Invalid_operation -- won't fit +resx551 rescale 1E-999 -1005 -> 1.000000E-999 +resx552 rescale 1E-1000 -1005 -> 1.00000E-1000 Subnormal +resx553 rescale 1E-999 -1006 -> NaN Invalid_operation +resx554 rescale 1E-999 -1007 -> NaN Invalid_operation +-- related subnormal rounding +resx555 rescale 1.666666E-999 -1005 -> 1.666666E-999 +resx556 rescale 1.666666E-1000 -1005 -> 1.66667E-1000 Subnormal Inexact Rounded +resx557 rescale 1.666666E-1001 -1005 -> 1.6667E-1001 Subnormal Inexact Rounded +resx558 rescale 1.666666E-1002 -1005 -> 1.667E-1002 Subnormal Inexact Rounded +resx559 rescale 1.666666E-1003 -1005 -> 1.67E-1003 Subnormal Inexact Rounded +resx560 rescale 1.666666E-1004 -1005 -> 1.7E-1004 Subnormal Inexact Rounded +resx561 rescale 1.666666E-1005 -1005 -> 2E-1005 Subnormal Inexact Rounded +resx562 rescale 1.666666E-1006 -1005 -> 0E-1005 Inexact Rounded +resx563 rescale 1.666666E-1007 -1005 -> 0E-1005 Inexact Rounded + +-- fractional RHS, some good and some bad +precision: 9 +resx564 rescale 222 +2.0 -> 2E+2 Inexact Rounded +resx565 rescale 222 +2.00000000 -> 2E+2 Inexact Rounded +resx566 rescale 222 +2.00100000000 -> NaN Invalid_operation +resx567 rescale 222 +2.000001 -> NaN Invalid_operation +resx568 rescale 222 +2.000000001 -> NaN Invalid_operation +resx569 rescale 222 +2.0000000001 -> NaN Invalid_operation +resx570 rescale 222 +2.00000000001 -> NaN Invalid_operation +resx571 rescale 222 +2.99999999999 -> NaN Invalid_operation +resx572 rescale 222 -2.00000000 -> 222.00 +resx573 rescale 222 -2.00100000000 -> NaN Invalid_operation +resx574 rescale 222 -2.0000001000 -> NaN Invalid_operation +resx575 rescale 222 -2.00000000001 -> NaN Invalid_operation +resx576 rescale 222 -2.99999999999 -> NaN Invalid_operation + +-- Specials +resx580 rescale Inf -Inf -> Infinity +resx581 rescale Inf -1000 -> NaN Invalid_operation +resx582 rescale Inf -1 -> NaN Invalid_operation +resx583 rescale Inf 0 -> NaN Invalid_operation +resx584 rescale Inf 1 -> NaN Invalid_operation +resx585 rescale Inf 1000 -> NaN Invalid_operation +resx586 rescale Inf Inf -> Infinity +resx587 rescale -1000 Inf -> NaN Invalid_operation +resx588 rescale -Inf Inf -> -Infinity +resx589 rescale -1 Inf -> NaN Invalid_operation +resx590 rescale 0 Inf -> NaN Invalid_operation +resx591 rescale 1 Inf -> NaN Invalid_operation +resx592 rescale 1000 Inf -> NaN Invalid_operation +resx593 rescale Inf Inf -> Infinity +resx594 rescale Inf -0 -> NaN Invalid_operation +resx595 rescale -0 Inf -> NaN Invalid_operation + +resx600 rescale -Inf -Inf -> -Infinity +resx601 rescale -Inf -1000 -> NaN Invalid_operation +resx602 rescale -Inf -1 -> NaN Invalid_operation +resx603 rescale -Inf 0 -> NaN Invalid_operation +resx604 rescale -Inf 1 -> NaN Invalid_operation +resx605 rescale -Inf 1000 -> NaN Invalid_operation +resx606 rescale -Inf Inf -> -Infinity +resx607 rescale -1000 Inf -> NaN Invalid_operation +resx608 rescale -Inf -Inf -> -Infinity +resx609 rescale -1 -Inf -> NaN Invalid_operation +resx610 rescale 0 -Inf -> NaN Invalid_operation +resx611 rescale 1 -Inf -> NaN Invalid_operation +resx612 rescale 1000 -Inf -> NaN Invalid_operation +resx613 rescale Inf -Inf -> Infinity +resx614 rescale -Inf -0 -> NaN Invalid_operation +resx615 rescale -0 -Inf -> NaN Invalid_operation + +resx621 rescale NaN -Inf -> NaN +resx622 rescale NaN -1000 -> NaN +resx623 rescale NaN -1 -> NaN +resx624 rescale NaN 0 -> NaN +resx625 rescale NaN 1 -> NaN +resx626 rescale NaN 1000 -> NaN +resx627 rescale NaN Inf -> NaN +resx628 rescale NaN NaN -> NaN +resx629 rescale -Inf NaN -> NaN +resx630 rescale -1000 NaN -> NaN +resx631 rescale -1 NaN -> NaN +resx632 rescale 0 NaN -> NaN +resx633 rescale 1 -NaN -> -NaN +resx634 rescale 1000 NaN -> NaN +resx635 rescale Inf NaN -> NaN +resx636 rescale NaN -0 -> NaN +resx637 rescale -0 NaN -> NaN + +resx641 rescale sNaN -Inf -> NaN Invalid_operation +resx642 rescale sNaN -1000 -> NaN Invalid_operation +resx643 rescale sNaN -1 -> NaN Invalid_operation +resx644 rescale sNaN 0 -> NaN Invalid_operation +resx645 rescale sNaN 1 -> NaN Invalid_operation +resx646 rescale sNaN 1000 -> NaN Invalid_operation +resx647 rescale -sNaN NaN -> -NaN Invalid_operation +resx648 rescale sNaN -sNaN -> NaN Invalid_operation +resx649 rescale NaN sNaN -> NaN Invalid_operation +resx650 rescale -Inf sNaN -> NaN Invalid_operation +resx651 rescale -1000 sNaN -> NaN Invalid_operation +resx652 rescale -1 sNaN -> NaN Invalid_operation +resx653 rescale 0 sNaN -> NaN Invalid_operation +resx654 rescale 1 -sNaN -> -NaN Invalid_operation +resx655 rescale 1000 sNaN -> NaN Invalid_operation +resx656 rescale Inf sNaN -> NaN Invalid_operation +resx657 rescale NaN sNaN -> NaN Invalid_operation +resx658 rescale sNaN -0 -> NaN Invalid_operation +resx659 rescale -0 sNaN -> NaN Invalid_operation + +-- propagating NaNs +resx661 rescale NaN9 -Inf -> NaN9 +resx662 rescale NaN81 919 -> NaN81 +resx663 rescale NaN72 Inf -> NaN72 +resx664 rescale -NaN66 NaN5 -> -NaN66 +resx665 rescale -Inf NaN4 -> NaN4 +resx666 rescale -919 NaN32 -> NaN32 +resx667 rescale Inf NaN2 -> NaN2 + +resx671 rescale sNaN99 -Inf -> NaN99 Invalid_operation +resx672 rescale -sNaN98 -11 -> -NaN98 Invalid_operation +resx673 rescale sNaN97 NaN -> NaN97 Invalid_operation +resx674 rescale sNaN16 sNaN94 -> NaN16 Invalid_operation +resx675 rescale NaN95 sNaN93 -> NaN93 Invalid_operation +resx676 rescale -Inf sNaN92 -> NaN92 Invalid_operation +resx677 rescale 088 -sNaN91 -> -NaN91 Invalid_operation +resx678 rescale Inf -sNaN90 -> -NaN90 Invalid_operation +resx679 rescale NaN sNaN87 -> NaN87 Invalid_operation + +-- subnormals and underflow +precision: 4 +maxexponent: 999 +minexponent: -999 +resx710 rescale 1.00E-999 -999 -> 1E-999 Rounded +resx711 rescale 0.1E-999 -1000 -> 1E-1000 Subnormal +resx712 rescale 0.10E-999 -1000 -> 1E-1000 Subnormal Rounded +resx713 rescale 0.100E-999 -1000 -> 1E-1000 Subnormal Rounded +resx714 rescale 0.01E-999 -1001 -> 1E-1001 Subnormal +-- next is rounded to Emin +resx715 rescale 0.999E-999 -999 -> 1E-999 Inexact Rounded +resx716 rescale 0.099E-999 -1000 -> 1E-1000 Inexact Rounded Subnormal + +resx717 rescale 0.009E-999 -1001 -> 1E-1001 Inexact Rounded Subnormal +resx718 rescale 0.001E-999 -1001 -> 0E-1001 Inexact Rounded +resx719 rescale 0.0009E-999 -1001 -> 0E-1001 Inexact Rounded +resx720 rescale 0.0001E-999 -1001 -> 0E-1001 Inexact Rounded + +resx730 rescale -1.00E-999 -999 -> -1E-999 Rounded +resx731 rescale -0.1E-999 -999 -> -0E-999 Rounded Inexact +resx732 rescale -0.10E-999 -999 -> -0E-999 Rounded Inexact +resx733 rescale -0.100E-999 -999 -> -0E-999 Rounded Inexact +resx734 rescale -0.01E-999 -999 -> -0E-999 Inexact Rounded +-- next is rounded to Emin +resx735 rescale -0.999E-999 -999 -> -1E-999 Inexact Rounded +resx736 rescale -0.099E-999 -999 -> -0E-999 Inexact Rounded +resx737 rescale -0.009E-999 -999 -> -0E-999 Inexact Rounded +resx738 rescale -0.001E-999 -999 -> -0E-999 Inexact Rounded +resx739 rescale -0.0001E-999 -999 -> -0E-999 Inexact Rounded + +resx740 rescale -1.00E-999 -1000 -> -1.0E-999 Rounded +resx741 rescale -0.1E-999 -1000 -> -1E-1000 Subnormal +resx742 rescale -0.10E-999 -1000 -> -1E-1000 Subnormal Rounded +resx743 rescale -0.100E-999 -1000 -> -1E-1000 Subnormal Rounded +resx744 rescale -0.01E-999 -1000 -> -0E-1000 Inexact Rounded +-- next is rounded to Emin +resx745 rescale -0.999E-999 -1000 -> -1.0E-999 Inexact Rounded +resx746 rescale -0.099E-999 -1000 -> -1E-1000 Inexact Rounded Subnormal +resx747 rescale -0.009E-999 -1000 -> -0E-1000 Inexact Rounded +resx748 rescale -0.001E-999 -1000 -> -0E-1000 Inexact Rounded +resx749 rescale -0.0001E-999 -1000 -> -0E-1000 Inexact Rounded + +resx750 rescale -1.00E-999 -1001 -> -1.00E-999 +resx751 rescale -0.1E-999 -1001 -> -1.0E-1000 Subnormal +resx752 rescale -0.10E-999 -1001 -> -1.0E-1000 Subnormal +resx753 rescale -0.100E-999 -1001 -> -1.0E-1000 Subnormal Rounded +resx754 rescale -0.01E-999 -1001 -> -1E-1001 Subnormal +-- next is rounded to Emin +resx755 rescale -0.999E-999 -1001 -> -1.00E-999 Inexact Rounded +resx756 rescale -0.099E-999 -1001 -> -1.0E-1000 Inexact Rounded Subnormal +resx757 rescale -0.009E-999 -1001 -> -1E-1001 Inexact Rounded Subnormal +resx758 rescale -0.001E-999 -1001 -> -0E-1001 Inexact Rounded +resx759 rescale -0.0001E-999 -1001 -> -0E-1001 Inexact Rounded + +resx760 rescale -1.00E-999 -1002 -> -1.000E-999 +resx761 rescale -0.1E-999 -1002 -> -1.00E-1000 Subnormal +resx762 rescale -0.10E-999 -1002 -> -1.00E-1000 Subnormal +resx763 rescale -0.100E-999 -1002 -> -1.00E-1000 Subnormal +resx764 rescale -0.01E-999 -1002 -> -1.0E-1001 Subnormal +resx765 rescale -0.999E-999 -1002 -> -9.99E-1000 Subnormal +resx766 rescale -0.099E-999 -1002 -> -9.9E-1001 Subnormal +resx767 rescale -0.009E-999 -1002 -> -9E-1002 Subnormal +resx768 rescale -0.001E-999 -1002 -> -1E-1002 Subnormal +resx769 rescale -0.0001E-999 -1002 -> -0E-1002 Inexact Rounded + +-- rhs must be no less than Etiny +resx770 rescale -1.00E-999 -1003 -> NaN Invalid_operation +resx771 rescale -0.1E-999 -1003 -> NaN Invalid_operation +resx772 rescale -0.10E-999 -1003 -> NaN Invalid_operation +resx773 rescale -0.100E-999 -1003 -> NaN Invalid_operation +resx774 rescale -0.01E-999 -1003 -> NaN Invalid_operation +resx775 rescale -0.999E-999 -1003 -> NaN Invalid_operation +resx776 rescale -0.099E-999 -1003 -> NaN Invalid_operation +resx777 rescale -0.009E-999 -1003 -> NaN Invalid_operation +resx778 rescale -0.001E-999 -1003 -> NaN Invalid_operation +resx779 rescale -0.0001E-999 -1003 -> NaN Invalid_operation + +precision: 9 +maxExponent: 999999999 +minexponent: -999999999 + +-- getInt worries +resx801 rescale 0 1000000000 -> NaN Invalid_operation +resx802 rescale 0 -1000000000 -> 0E-1000000000 +resx803 rescale 0 2000000000 -> NaN Invalid_operation +resx804 rescale 0 -2000000000 -> NaN Invalid_operation +resx805 rescale 0 3000000000 -> NaN Invalid_operation +resx806 rescale 0 -3000000000 -> NaN Invalid_operation +resx807 rescale 0 4000000000 -> NaN Invalid_operation +resx808 rescale 0 -4000000000 -> NaN Invalid_operation +resx809 rescale 0 5000000000 -> NaN Invalid_operation +resx810 rescale 0 -5000000000 -> NaN Invalid_operation +resx811 rescale 0 6000000000 -> NaN Invalid_operation +resx812 rescale 0 -6000000000 -> NaN Invalid_operation +resx813 rescale 0 7000000000 -> NaN Invalid_operation +resx814 rescale 0 -7000000000 -> NaN Invalid_operation +resx815 rescale 0 8000000000 -> NaN Invalid_operation +resx816 rescale 0 -8000000000 -> NaN Invalid_operation +resx817 rescale 0 9000000000 -> NaN Invalid_operation +resx818 rescale 0 -9000000000 -> NaN Invalid_operation +resx819 rescale 0 9999999999 -> NaN Invalid_operation +resx820 rescale 0 -9999999999 -> NaN Invalid_operation +resx821 rescale 0 10000000000 -> NaN Invalid_operation +resx822 rescale 0 -10000000000 -> NaN Invalid_operation + +resx831 rescale 1 0E-1 -> 1 +resx832 rescale 1 0E-2 -> 1 +resx833 rescale 1 0E-3 -> 1 +resx834 rescale 1 0E-4 -> 1 +resx835 rescale 1 0E-100 -> 1 +resx836 rescale 1 0E-100000 -> 1 +resx837 rescale 1 0E+100 -> 1 +resx838 rescale 1 0E+100000 -> 1 + +resx841 rescale 0 5E-1000000 -> NaN Invalid_operation +resx842 rescale 0 5E-1000000 -> NaN Invalid_operation +resx843 rescale 0 999999999 -> 0E+999999999 +resx844 rescale 0 1000000000 -> NaN Invalid_operation +resx845 rescale 0 -999999999 -> 0E-999999999 +resx846 rescale 0 -1000000000 -> 0E-1000000000 +resx847 rescale 0 -1000000001 -> 0E-1000000001 +resx848 rescale 0 -1000000002 -> 0E-1000000002 +resx849 rescale 0 -1000000003 -> 0E-1000000003 +resx850 rescale 0 -1000000004 -> 0E-1000000004 +resx851 rescale 0 -1000000005 -> 0E-1000000005 +resx852 rescale 0 -1000000006 -> 0E-1000000006 +resx853 rescale 0 -1000000007 -> 0E-1000000007 +resx854 rescale 0 -1000000008 -> NaN Invalid_operation + +resx861 rescale 1 +2147483649 -> NaN Invalid_operation +resx862 rescale 1 +2147483648 -> NaN Invalid_operation +resx863 rescale 1 +2147483647 -> NaN Invalid_operation +resx864 rescale 1 -2147483647 -> NaN Invalid_operation +resx865 rescale 1 -2147483648 -> NaN Invalid_operation +resx866 rescale 1 -2147483649 -> NaN Invalid_operation + +-- Null tests +res900 rescale 10 # -> NaN Invalid_operation +res901 rescale # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rotate.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rotate.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,247 @@ +------------------------------------------------------------------------ +-- rotate.decTest -- rotate coefficient left or right -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check +rotx001 rotate 0 0 -> 0 +rotx002 rotate 0 2 -> 0 +rotx003 rotate 1 2 -> 100 +rotx004 rotate 34 8 -> 400000003 +rotx005 rotate 1 9 -> 1 +rotx006 rotate 1 -1 -> 100000000 +rotx007 rotate 123456789 -1 -> 912345678 +rotx008 rotate 123456789 -8 -> 234567891 +rotx009 rotate 123456789 -9 -> 123456789 +rotx010 rotate 0 -2 -> 0 + +-- rhs must be an integer +rotx011 rotate 1 1.5 -> NaN Invalid_operation +rotx012 rotate 1 1.0 -> NaN Invalid_operation +rotx013 rotate 1 0.1 -> NaN Invalid_operation +rotx014 rotate 1 0.0 -> NaN Invalid_operation +rotx015 rotate 1 1E+1 -> NaN Invalid_operation +rotx016 rotate 1 1E+99 -> NaN Invalid_operation +rotx017 rotate 1 Inf -> NaN Invalid_operation +rotx018 rotate 1 -Inf -> NaN Invalid_operation +-- and |rhs| <= precision +rotx020 rotate 1 -1000 -> NaN Invalid_operation +rotx021 rotate 1 -10 -> NaN Invalid_operation +rotx022 rotate 1 10 -> NaN Invalid_operation +rotx023 rotate 1 1000 -> NaN Invalid_operation + +-- full pattern +rotx030 rotate 123456789 -9 -> 123456789 +rotx031 rotate 123456789 -8 -> 234567891 +rotx032 rotate 123456789 -7 -> 345678912 +rotx033 rotate 123456789 -6 -> 456789123 +rotx034 rotate 123456789 -5 -> 567891234 +rotx035 rotate 123456789 -4 -> 678912345 +rotx036 rotate 123456789 -3 -> 789123456 +rotx037 rotate 123456789 -2 -> 891234567 +rotx038 rotate 123456789 -1 -> 912345678 +rotx039 rotate 123456789 -0 -> 123456789 +rotx040 rotate 123456789 +0 -> 123456789 +rotx041 rotate 123456789 +1 -> 234567891 +rotx042 rotate 123456789 +2 -> 345678912 +rotx043 rotate 123456789 +3 -> 456789123 +rotx044 rotate 123456789 +4 -> 567891234 +rotx045 rotate 123456789 +5 -> 678912345 +rotx046 rotate 123456789 +6 -> 789123456 +rotx047 rotate 123456789 +7 -> 891234567 +rotx048 rotate 123456789 +8 -> 912345678 +rotx049 rotate 123456789 +9 -> 123456789 + +-- zeros +rotx060 rotate 0E-10 +9 -> 0E-10 +rotx061 rotate 0E-10 -9 -> 0E-10 +rotx062 rotate 0.000 +9 -> 0.000 +rotx063 rotate 0.000 -9 -> 0.000 +rotx064 rotate 0E+10 +9 -> 0E+10 +rotx065 rotate 0E+10 -9 -> 0E+10 +rotx066 rotate -0E-10 +9 -> -0E-10 +rotx067 rotate -0E-10 -9 -> -0E-10 +rotx068 rotate -0.000 +9 -> -0.000 +rotx069 rotate -0.000 -9 -> -0.000 +rotx070 rotate -0E+10 +9 -> -0E+10 +rotx071 rotate -0E+10 -9 -> -0E+10 + +-- Nmax, Nmin, Ntiny +rotx141 rotate 9.99999999E+999 -1 -> 9.99999999E+999 +rotx142 rotate 9.99999999E+999 -8 -> 9.99999999E+999 +rotx143 rotate 9.99999999E+999 1 -> 9.99999999E+999 +rotx144 rotate 9.99999999E+999 8 -> 9.99999999E+999 +rotx145 rotate 1E-999 -1 -> 1.00000000E-991 +rotx146 rotate 1E-999 -8 -> 1.0E-998 +rotx147 rotate 1E-999 1 -> 1.0E-998 +rotx148 rotate 1E-999 8 -> 1.00000000E-991 +rotx151 rotate 1.00000000E-999 -1 -> 1.0000000E-1000 +rotx152 rotate 1.00000000E-999 -8 -> 1E-1007 +rotx153 rotate 1.00000000E-999 1 -> 1E-1007 +rotx154 rotate 1.00000000E-999 8 -> 1.0000000E-1000 +rotx155 rotate 9.00000000E-999 -1 -> 9.0000000E-1000 +rotx156 rotate 9.00000000E-999 -8 -> 9E-1007 +rotx157 rotate 9.00000000E-999 1 -> 9E-1007 +rotx158 rotate 9.00000000E-999 8 -> 9.0000000E-1000 +rotx160 rotate 1E-1007 -1 -> 1.00000000E-999 +rotx161 rotate 1E-1007 -8 -> 1.0E-1006 +rotx162 rotate 1E-1007 1 -> 1.0E-1006 +rotx163 rotate 1E-1007 8 -> 1.00000000E-999 +-- negatives +rotx171 rotate -9.99999999E+999 -1 -> -9.99999999E+999 +rotx172 rotate -9.99999999E+999 -8 -> -9.99999999E+999 +rotx173 rotate -9.99999999E+999 1 -> -9.99999999E+999 +rotx174 rotate -9.99999999E+999 8 -> -9.99999999E+999 +rotx175 rotate -1E-999 -1 -> -1.00000000E-991 +rotx176 rotate -1E-999 -8 -> -1.0E-998 +rotx177 rotate -1E-999 1 -> -1.0E-998 +rotx178 rotate -1E-999 8 -> -1.00000000E-991 +rotx181 rotate -1.00000000E-999 -1 -> -1.0000000E-1000 +rotx182 rotate -1.00000000E-999 -8 -> -1E-1007 +rotx183 rotate -1.00000000E-999 1 -> -1E-1007 +rotx184 rotate -1.00000000E-999 8 -> -1.0000000E-1000 +rotx185 rotate -9.00000000E-999 -1 -> -9.0000000E-1000 +rotx186 rotate -9.00000000E-999 -8 -> -9E-1007 +rotx187 rotate -9.00000000E-999 1 -> -9E-1007 +rotx188 rotate -9.00000000E-999 8 -> -9.0000000E-1000 +rotx190 rotate -1E-1007 -1 -> -1.00000000E-999 +rotx191 rotate -1E-1007 -8 -> -1.0E-1006 +rotx192 rotate -1E-1007 1 -> -1.0E-1006 +rotx193 rotate -1E-1007 8 -> -1.00000000E-999 + +-- more negatives (of sanities) +rotx201 rotate -0 0 -> -0 +rotx202 rotate -0 2 -> -0 +rotx203 rotate -1 2 -> -100 +rotx204 rotate -1 8 -> -100000000 +rotx205 rotate -1 9 -> -1 +rotx206 rotate -1 -1 -> -100000000 +rotx207 rotate -123456789 -1 -> -912345678 +rotx208 rotate -123456789 -8 -> -234567891 +rotx209 rotate -123456789 -9 -> -123456789 +rotx210 rotate -0 -2 -> -0 + +-- Specials; NaNs are handled as usual +rotx781 rotate -Inf -8 -> -Infinity +rotx782 rotate -Inf -1 -> -Infinity +rotx783 rotate -Inf -0 -> -Infinity +rotx784 rotate -Inf 0 -> -Infinity +rotx785 rotate -Inf 1 -> -Infinity +rotx786 rotate -Inf 8 -> -Infinity +rotx787 rotate -1000 -Inf -> NaN Invalid_operation +rotx788 rotate -Inf -Inf -> NaN Invalid_operation +rotx789 rotate -1 -Inf -> NaN Invalid_operation +rotx790 rotate -0 -Inf -> NaN Invalid_operation +rotx791 rotate 0 -Inf -> NaN Invalid_operation +rotx792 rotate 1 -Inf -> NaN Invalid_operation +rotx793 rotate 1000 -Inf -> NaN Invalid_operation +rotx794 rotate Inf -Inf -> NaN Invalid_operation + +rotx800 rotate Inf -Inf -> NaN Invalid_operation +rotx801 rotate Inf -8 -> Infinity +rotx802 rotate Inf -1 -> Infinity +rotx803 rotate Inf -0 -> Infinity +rotx804 rotate Inf 0 -> Infinity +rotx805 rotate Inf 1 -> Infinity +rotx806 rotate Inf 8 -> Infinity +rotx807 rotate Inf Inf -> NaN Invalid_operation +rotx808 rotate -1000 Inf -> NaN Invalid_operation +rotx809 rotate -Inf Inf -> NaN Invalid_operation +rotx810 rotate -1 Inf -> NaN Invalid_operation +rotx811 rotate -0 Inf -> NaN Invalid_operation +rotx812 rotate 0 Inf -> NaN Invalid_operation +rotx813 rotate 1 Inf -> NaN Invalid_operation +rotx814 rotate 1000 Inf -> NaN Invalid_operation +rotx815 rotate Inf Inf -> NaN Invalid_operation + +rotx821 rotate NaN -Inf -> NaN +rotx822 rotate NaN -1000 -> NaN +rotx823 rotate NaN -1 -> NaN +rotx824 rotate NaN -0 -> NaN +rotx825 rotate NaN 0 -> NaN +rotx826 rotate NaN 1 -> NaN +rotx827 rotate NaN 1000 -> NaN +rotx828 rotate NaN Inf -> NaN +rotx829 rotate NaN NaN -> NaN +rotx830 rotate -Inf NaN -> NaN +rotx831 rotate -1000 NaN -> NaN +rotx832 rotate -1 NaN -> NaN +rotx833 rotate -0 NaN -> NaN +rotx834 rotate 0 NaN -> NaN +rotx835 rotate 1 NaN -> NaN +rotx836 rotate 1000 NaN -> NaN +rotx837 rotate Inf NaN -> NaN + + + +rotx841 rotate sNaN -Inf -> NaN Invalid_operation +rotx842 rotate sNaN -1000 -> NaN Invalid_operation +rotx843 rotate sNaN -1 -> NaN Invalid_operation +rotx844 rotate sNaN -0 -> NaN Invalid_operation +rotx845 rotate sNaN 0 -> NaN Invalid_operation +rotx846 rotate sNaN 1 -> NaN Invalid_operation +rotx847 rotate sNaN 1000 -> NaN Invalid_operation +rotx848 rotate sNaN NaN -> NaN Invalid_operation +rotx849 rotate sNaN sNaN -> NaN Invalid_operation +rotx850 rotate NaN sNaN -> NaN Invalid_operation +rotx851 rotate -Inf sNaN -> NaN Invalid_operation +rotx852 rotate -1000 sNaN -> NaN Invalid_operation +rotx853 rotate -1 sNaN -> NaN Invalid_operation +rotx854 rotate -0 sNaN -> NaN Invalid_operation +rotx855 rotate 0 sNaN -> NaN Invalid_operation +rotx856 rotate 1 sNaN -> NaN Invalid_operation +rotx857 rotate 1000 sNaN -> NaN Invalid_operation +rotx858 rotate Inf sNaN -> NaN Invalid_operation +rotx859 rotate NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +rotx861 rotate NaN1 -Inf -> NaN1 +rotx862 rotate +NaN2 -1000 -> NaN2 +rotx863 rotate NaN3 1000 -> NaN3 +rotx864 rotate NaN4 Inf -> NaN4 +rotx865 rotate NaN5 +NaN6 -> NaN5 +rotx866 rotate -Inf NaN7 -> NaN7 +rotx867 rotate -1000 NaN8 -> NaN8 +rotx868 rotate 1000 NaN9 -> NaN9 +rotx869 rotate Inf +NaN10 -> NaN10 +rotx871 rotate sNaN11 -Inf -> NaN11 Invalid_operation +rotx872 rotate sNaN12 -1000 -> NaN12 Invalid_operation +rotx873 rotate sNaN13 1000 -> NaN13 Invalid_operation +rotx874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation +rotx875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation +rotx876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation +rotx877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation +rotx878 rotate -1000 sNaN21 -> NaN21 Invalid_operation +rotx879 rotate 1000 sNaN22 -> NaN22 Invalid_operation +rotx880 rotate Inf sNaN23 -> NaN23 Invalid_operation +rotx881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation +rotx882 rotate -NaN26 NaN28 -> -NaN26 +rotx883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation +rotx884 rotate 1000 -NaN30 -> -NaN30 +rotx885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- payload decapitate +precision: 5 +rotx886 rotate 11 -sNaN1234567890 -> -NaN67890 Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rounding.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/rounding.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1303 @@ +------------------------------------------------------------------------ +-- rounding.decTest -- decimal rounding modes testcases -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- These tests require that implementations take account of residues in +-- order to get correct results for some rounding modes. Rather than +-- single rounding tests we therefore need tests for most operators. +-- [We do assume add/minus/plus/subtract are common paths, however, as +-- is rounding of negatives (if the latter works for addition, assume it +-- works for the others, too).] +-- +-- Round-for-reround (05UP) is tested as a separate block, mostly for +-- 'historical' reasons. +-- +-- Underflow Subnormal and overflow behaviours are tested under the +-- individual operators. + +extended: 1 +precision: 5 -- for easier visual inspection +maxExponent: 999 +minexponent: -999 + +-- Addition operators ------------------------------------------------- +rounding: down + +radx100 add 12345 -0.1 -> 12344 Inexact Rounded +radx101 add 12345 -0.01 -> 12344 Inexact Rounded +radx102 add 12345 -0.001 -> 12344 Inexact Rounded +radx103 add 12345 -0.00001 -> 12344 Inexact Rounded +radx104 add 12345 -0.000001 -> 12344 Inexact Rounded +radx105 add 12345 -0.0000001 -> 12344 Inexact Rounded +radx106 add 12345 0 -> 12345 +radx107 add 12345 0.0000001 -> 12345 Inexact Rounded +radx108 add 12345 0.000001 -> 12345 Inexact Rounded +radx109 add 12345 0.00001 -> 12345 Inexact Rounded +radx110 add 12345 0.0001 -> 12345 Inexact Rounded +radx111 add 12345 0.001 -> 12345 Inexact Rounded +radx112 add 12345 0.01 -> 12345 Inexact Rounded +radx113 add 12345 0.1 -> 12345 Inexact Rounded + +radx115 add 12346 0.49999 -> 12346 Inexact Rounded +radx116 add 12346 0.5 -> 12346 Inexact Rounded +radx117 add 12346 0.50001 -> 12346 Inexact Rounded + +radx120 add 12345 0.4 -> 12345 Inexact Rounded +radx121 add 12345 0.49 -> 12345 Inexact Rounded +radx122 add 12345 0.499 -> 12345 Inexact Rounded +radx123 add 12345 0.49999 -> 12345 Inexact Rounded +radx124 add 12345 0.5 -> 12345 Inexact Rounded +radx125 add 12345 0.50001 -> 12345 Inexact Rounded +radx126 add 12345 0.5001 -> 12345 Inexact Rounded +radx127 add 12345 0.501 -> 12345 Inexact Rounded +radx128 add 12345 0.51 -> 12345 Inexact Rounded +radx129 add 12345 0.6 -> 12345 Inexact Rounded + +rounding: half_down + +radx140 add 12345 -0.1 -> 12345 Inexact Rounded +radx141 add 12345 -0.01 -> 12345 Inexact Rounded +radx142 add 12345 -0.001 -> 12345 Inexact Rounded +radx143 add 12345 -0.00001 -> 12345 Inexact Rounded +radx144 add 12345 -0.000001 -> 12345 Inexact Rounded +radx145 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx146 add 12345 0 -> 12345 +radx147 add 12345 0.0000001 -> 12345 Inexact Rounded +radx148 add 12345 0.000001 -> 12345 Inexact Rounded +radx149 add 12345 0.00001 -> 12345 Inexact Rounded +radx150 add 12345 0.0001 -> 12345 Inexact Rounded +radx151 add 12345 0.001 -> 12345 Inexact Rounded +radx152 add 12345 0.01 -> 12345 Inexact Rounded +radx153 add 12345 0.1 -> 12345 Inexact Rounded + +radx155 add 12346 0.49999 -> 12346 Inexact Rounded +radx156 add 12346 0.5 -> 12346 Inexact Rounded +radx157 add 12346 0.50001 -> 12347 Inexact Rounded + +radx160 add 12345 0.4 -> 12345 Inexact Rounded +radx161 add 12345 0.49 -> 12345 Inexact Rounded +radx162 add 12345 0.499 -> 12345 Inexact Rounded +radx163 add 12345 0.49999 -> 12345 Inexact Rounded +radx164 add 12345 0.5 -> 12345 Inexact Rounded +radx165 add 12345 0.50001 -> 12346 Inexact Rounded +radx166 add 12345 0.5001 -> 12346 Inexact Rounded +radx167 add 12345 0.501 -> 12346 Inexact Rounded +radx168 add 12345 0.51 -> 12346 Inexact Rounded +radx169 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: half_even + +radx170 add 12345 -0.1 -> 12345 Inexact Rounded +radx171 add 12345 -0.01 -> 12345 Inexact Rounded +radx172 add 12345 -0.001 -> 12345 Inexact Rounded +radx173 add 12345 -0.00001 -> 12345 Inexact Rounded +radx174 add 12345 -0.000001 -> 12345 Inexact Rounded +radx175 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx176 add 12345 0 -> 12345 +radx177 add 12345 0.0000001 -> 12345 Inexact Rounded +radx178 add 12345 0.000001 -> 12345 Inexact Rounded +radx179 add 12345 0.00001 -> 12345 Inexact Rounded +radx180 add 12345 0.0001 -> 12345 Inexact Rounded +radx181 add 12345 0.001 -> 12345 Inexact Rounded +radx182 add 12345 0.01 -> 12345 Inexact Rounded +radx183 add 12345 0.1 -> 12345 Inexact Rounded + +radx185 add 12346 0.49999 -> 12346 Inexact Rounded +radx186 add 12346 0.5 -> 12346 Inexact Rounded +radx187 add 12346 0.50001 -> 12347 Inexact Rounded + +radx190 add 12345 0.4 -> 12345 Inexact Rounded +radx191 add 12345 0.49 -> 12345 Inexact Rounded +radx192 add 12345 0.499 -> 12345 Inexact Rounded +radx193 add 12345 0.49999 -> 12345 Inexact Rounded +radx194 add 12345 0.5 -> 12346 Inexact Rounded +radx195 add 12345 0.50001 -> 12346 Inexact Rounded +radx196 add 12345 0.5001 -> 12346 Inexact Rounded +radx197 add 12345 0.501 -> 12346 Inexact Rounded +radx198 add 12345 0.51 -> 12346 Inexact Rounded +radx199 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: half_up + +radx200 add 12345 -0.1 -> 12345 Inexact Rounded +radx201 add 12345 -0.01 -> 12345 Inexact Rounded +radx202 add 12345 -0.001 -> 12345 Inexact Rounded +radx203 add 12345 -0.00001 -> 12345 Inexact Rounded +radx204 add 12345 -0.000001 -> 12345 Inexact Rounded +radx205 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx206 add 12345 0 -> 12345 +radx207 add 12345 0.0000001 -> 12345 Inexact Rounded +radx208 add 12345 0.000001 -> 12345 Inexact Rounded +radx209 add 12345 0.00001 -> 12345 Inexact Rounded +radx210 add 12345 0.0001 -> 12345 Inexact Rounded +radx211 add 12345 0.001 -> 12345 Inexact Rounded +radx212 add 12345 0.01 -> 12345 Inexact Rounded +radx213 add 12345 0.1 -> 12345 Inexact Rounded + +radx215 add 12346 0.49999 -> 12346 Inexact Rounded +radx216 add 12346 0.5 -> 12347 Inexact Rounded +radx217 add 12346 0.50001 -> 12347 Inexact Rounded + +radx220 add 12345 0.4 -> 12345 Inexact Rounded +radx221 add 12345 0.49 -> 12345 Inexact Rounded +radx222 add 12345 0.499 -> 12345 Inexact Rounded +radx223 add 12345 0.49999 -> 12345 Inexact Rounded +radx224 add 12345 0.5 -> 12346 Inexact Rounded +radx225 add 12345 0.50001 -> 12346 Inexact Rounded +radx226 add 12345 0.5001 -> 12346 Inexact Rounded +radx227 add 12345 0.501 -> 12346 Inexact Rounded +radx228 add 12345 0.51 -> 12346 Inexact Rounded +radx229 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: up + +radx230 add 12345 -0.1 -> 12345 Inexact Rounded +radx231 add 12345 -0.01 -> 12345 Inexact Rounded +radx232 add 12345 -0.001 -> 12345 Inexact Rounded +radx233 add 12345 -0.00001 -> 12345 Inexact Rounded +radx234 add 12345 -0.000001 -> 12345 Inexact Rounded +radx235 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx236 add 12345 0 -> 12345 +radx237 add 12345 0.0000001 -> 12346 Inexact Rounded +radx238 add 12345 0.000001 -> 12346 Inexact Rounded +radx239 add 12345 0.00001 -> 12346 Inexact Rounded +radx240 add 12345 0.0001 -> 12346 Inexact Rounded +radx241 add 12345 0.001 -> 12346 Inexact Rounded +radx242 add 12345 0.01 -> 12346 Inexact Rounded +radx243 add 12345 0.1 -> 12346 Inexact Rounded + +radx245 add 12346 0.49999 -> 12347 Inexact Rounded +radx246 add 12346 0.5 -> 12347 Inexact Rounded +radx247 add 12346 0.50001 -> 12347 Inexact Rounded + +radx250 add 12345 0.4 -> 12346 Inexact Rounded +radx251 add 12345 0.49 -> 12346 Inexact Rounded +radx252 add 12345 0.499 -> 12346 Inexact Rounded +radx253 add 12345 0.49999 -> 12346 Inexact Rounded +radx254 add 12345 0.5 -> 12346 Inexact Rounded +radx255 add 12345 0.50001 -> 12346 Inexact Rounded +radx256 add 12345 0.5001 -> 12346 Inexact Rounded +radx257 add 12345 0.501 -> 12346 Inexact Rounded +radx258 add 12345 0.51 -> 12346 Inexact Rounded +radx259 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: floor + +radx300 add 12345 -0.1 -> 12344 Inexact Rounded +radx301 add 12345 -0.01 -> 12344 Inexact Rounded +radx302 add 12345 -0.001 -> 12344 Inexact Rounded +radx303 add 12345 -0.00001 -> 12344 Inexact Rounded +radx304 add 12345 -0.000001 -> 12344 Inexact Rounded +radx305 add 12345 -0.0000001 -> 12344 Inexact Rounded +radx306 add 12345 0 -> 12345 +radx307 add 12345 0.0000001 -> 12345 Inexact Rounded +radx308 add 12345 0.000001 -> 12345 Inexact Rounded +radx309 add 12345 0.00001 -> 12345 Inexact Rounded +radx310 add 12345 0.0001 -> 12345 Inexact Rounded +radx311 add 12345 0.001 -> 12345 Inexact Rounded +radx312 add 12345 0.01 -> 12345 Inexact Rounded +radx313 add 12345 0.1 -> 12345 Inexact Rounded + +radx315 add 12346 0.49999 -> 12346 Inexact Rounded +radx316 add 12346 0.5 -> 12346 Inexact Rounded +radx317 add 12346 0.50001 -> 12346 Inexact Rounded + +radx320 add 12345 0.4 -> 12345 Inexact Rounded +radx321 add 12345 0.49 -> 12345 Inexact Rounded +radx322 add 12345 0.499 -> 12345 Inexact Rounded +radx323 add 12345 0.49999 -> 12345 Inexact Rounded +radx324 add 12345 0.5 -> 12345 Inexact Rounded +radx325 add 12345 0.50001 -> 12345 Inexact Rounded +radx326 add 12345 0.5001 -> 12345 Inexact Rounded +radx327 add 12345 0.501 -> 12345 Inexact Rounded +radx328 add 12345 0.51 -> 12345 Inexact Rounded +radx329 add 12345 0.6 -> 12345 Inexact Rounded + +rounding: ceiling + +radx330 add 12345 -0.1 -> 12345 Inexact Rounded +radx331 add 12345 -0.01 -> 12345 Inexact Rounded +radx332 add 12345 -0.001 -> 12345 Inexact Rounded +radx333 add 12345 -0.00001 -> 12345 Inexact Rounded +radx334 add 12345 -0.000001 -> 12345 Inexact Rounded +radx335 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx336 add 12345 0 -> 12345 +radx337 add 12345 0.0000001 -> 12346 Inexact Rounded +radx338 add 12345 0.000001 -> 12346 Inexact Rounded +radx339 add 12345 0.00001 -> 12346 Inexact Rounded +radx340 add 12345 0.0001 -> 12346 Inexact Rounded +radx341 add 12345 0.001 -> 12346 Inexact Rounded +radx342 add 12345 0.01 -> 12346 Inexact Rounded +radx343 add 12345 0.1 -> 12346 Inexact Rounded + +radx345 add 12346 0.49999 -> 12347 Inexact Rounded +radx346 add 12346 0.5 -> 12347 Inexact Rounded +radx347 add 12346 0.50001 -> 12347 Inexact Rounded + +radx350 add 12345 0.4 -> 12346 Inexact Rounded +radx351 add 12345 0.49 -> 12346 Inexact Rounded +radx352 add 12345 0.499 -> 12346 Inexact Rounded +radx353 add 12345 0.49999 -> 12346 Inexact Rounded +radx354 add 12345 0.5 -> 12346 Inexact Rounded +radx355 add 12345 0.50001 -> 12346 Inexact Rounded +radx356 add 12345 0.5001 -> 12346 Inexact Rounded +radx357 add 12345 0.501 -> 12346 Inexact Rounded +radx358 add 12345 0.51 -> 12346 Inexact Rounded +radx359 add 12345 0.6 -> 12346 Inexact Rounded + +-- negatives... + +rounding: down + +rsux100 add -12345 -0.1 -> -12345 Inexact Rounded +rsux101 add -12345 -0.01 -> -12345 Inexact Rounded +rsux102 add -12345 -0.001 -> -12345 Inexact Rounded +rsux103 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux104 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux105 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux106 add -12345 0 -> -12345 +rsux107 add -12345 0.0000001 -> -12344 Inexact Rounded +rsux108 add -12345 0.000001 -> -12344 Inexact Rounded +rsux109 add -12345 0.00001 -> -12344 Inexact Rounded +rsux110 add -12345 0.0001 -> -12344 Inexact Rounded +rsux111 add -12345 0.001 -> -12344 Inexact Rounded +rsux112 add -12345 0.01 -> -12344 Inexact Rounded +rsux113 add -12345 0.1 -> -12344 Inexact Rounded + +rsux115 add -12346 0.49999 -> -12345 Inexact Rounded +rsux116 add -12346 0.5 -> -12345 Inexact Rounded +rsux117 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux120 add -12345 0.4 -> -12344 Inexact Rounded +rsux121 add -12345 0.49 -> -12344 Inexact Rounded +rsux122 add -12345 0.499 -> -12344 Inexact Rounded +rsux123 add -12345 0.49999 -> -12344 Inexact Rounded +rsux124 add -12345 0.5 -> -12344 Inexact Rounded +rsux125 add -12345 0.50001 -> -12344 Inexact Rounded +rsux126 add -12345 0.5001 -> -12344 Inexact Rounded +rsux127 add -12345 0.501 -> -12344 Inexact Rounded +rsux128 add -12345 0.51 -> -12344 Inexact Rounded +rsux129 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: half_down + +rsux140 add -12345 -0.1 -> -12345 Inexact Rounded +rsux141 add -12345 -0.01 -> -12345 Inexact Rounded +rsux142 add -12345 -0.001 -> -12345 Inexact Rounded +rsux143 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux144 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux145 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux146 add -12345 0 -> -12345 +rsux147 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux148 add -12345 0.000001 -> -12345 Inexact Rounded +rsux149 add -12345 0.00001 -> -12345 Inexact Rounded +rsux150 add -12345 0.0001 -> -12345 Inexact Rounded +rsux151 add -12345 0.001 -> -12345 Inexact Rounded +rsux152 add -12345 0.01 -> -12345 Inexact Rounded +rsux153 add -12345 0.1 -> -12345 Inexact Rounded + +rsux155 add -12346 0.49999 -> -12346 Inexact Rounded +rsux156 add -12346 0.5 -> -12345 Inexact Rounded +rsux157 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux160 add -12345 0.4 -> -12345 Inexact Rounded +rsux161 add -12345 0.49 -> -12345 Inexact Rounded +rsux162 add -12345 0.499 -> -12345 Inexact Rounded +rsux163 add -12345 0.49999 -> -12345 Inexact Rounded +rsux164 add -12345 0.5 -> -12344 Inexact Rounded +rsux165 add -12345 0.50001 -> -12344 Inexact Rounded +rsux166 add -12345 0.5001 -> -12344 Inexact Rounded +rsux167 add -12345 0.501 -> -12344 Inexact Rounded +rsux168 add -12345 0.51 -> -12344 Inexact Rounded +rsux169 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: half_even + +rsux170 add -12345 -0.1 -> -12345 Inexact Rounded +rsux171 add -12345 -0.01 -> -12345 Inexact Rounded +rsux172 add -12345 -0.001 -> -12345 Inexact Rounded +rsux173 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux174 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux175 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux176 add -12345 0 -> -12345 +rsux177 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux178 add -12345 0.000001 -> -12345 Inexact Rounded +rsux179 add -12345 0.00001 -> -12345 Inexact Rounded +rsux180 add -12345 0.0001 -> -12345 Inexact Rounded +rsux181 add -12345 0.001 -> -12345 Inexact Rounded +rsux182 add -12345 0.01 -> -12345 Inexact Rounded +rsux183 add -12345 0.1 -> -12345 Inexact Rounded + +rsux185 add -12346 0.49999 -> -12346 Inexact Rounded +rsux186 add -12346 0.5 -> -12346 Inexact Rounded +rsux187 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux190 add -12345 0.4 -> -12345 Inexact Rounded +rsux191 add -12345 0.49 -> -12345 Inexact Rounded +rsux192 add -12345 0.499 -> -12345 Inexact Rounded +rsux193 add -12345 0.49999 -> -12345 Inexact Rounded +rsux194 add -12345 0.5 -> -12344 Inexact Rounded +rsux195 add -12345 0.50001 -> -12344 Inexact Rounded +rsux196 add -12345 0.5001 -> -12344 Inexact Rounded +rsux197 add -12345 0.501 -> -12344 Inexact Rounded +rsux198 add -12345 0.51 -> -12344 Inexact Rounded +rsux199 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: half_up + +rsux200 add -12345 -0.1 -> -12345 Inexact Rounded +rsux201 add -12345 -0.01 -> -12345 Inexact Rounded +rsux202 add -12345 -0.001 -> -12345 Inexact Rounded +rsux203 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux204 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux205 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux206 add -12345 0 -> -12345 +rsux207 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux208 add -12345 0.000001 -> -12345 Inexact Rounded +rsux209 add -12345 0.00001 -> -12345 Inexact Rounded +rsux210 add -12345 0.0001 -> -12345 Inexact Rounded +rsux211 add -12345 0.001 -> -12345 Inexact Rounded +rsux212 add -12345 0.01 -> -12345 Inexact Rounded +rsux213 add -12345 0.1 -> -12345 Inexact Rounded + +rsux215 add -12346 0.49999 -> -12346 Inexact Rounded +rsux216 add -12346 0.5 -> -12346 Inexact Rounded +rsux217 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux220 add -12345 0.4 -> -12345 Inexact Rounded +rsux221 add -12345 0.49 -> -12345 Inexact Rounded +rsux222 add -12345 0.499 -> -12345 Inexact Rounded +rsux223 add -12345 0.49999 -> -12345 Inexact Rounded +rsux224 add -12345 0.5 -> -12345 Inexact Rounded +rsux225 add -12345 0.50001 -> -12344 Inexact Rounded +rsux226 add -12345 0.5001 -> -12344 Inexact Rounded +rsux227 add -12345 0.501 -> -12344 Inexact Rounded +rsux228 add -12345 0.51 -> -12344 Inexact Rounded +rsux229 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: up + +rsux230 add -12345 -0.1 -> -12346 Inexact Rounded +rsux231 add -12345 -0.01 -> -12346 Inexact Rounded +rsux232 add -12345 -0.001 -> -12346 Inexact Rounded +rsux233 add -12345 -0.00001 -> -12346 Inexact Rounded +rsux234 add -12345 -0.000001 -> -12346 Inexact Rounded +rsux235 add -12345 -0.0000001 -> -12346 Inexact Rounded +rsux236 add -12345 0 -> -12345 +rsux237 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux238 add -12345 0.000001 -> -12345 Inexact Rounded +rsux239 add -12345 0.00001 -> -12345 Inexact Rounded +rsux240 add -12345 0.0001 -> -12345 Inexact Rounded +rsux241 add -12345 0.001 -> -12345 Inexact Rounded +rsux242 add -12345 0.01 -> -12345 Inexact Rounded +rsux243 add -12345 0.1 -> -12345 Inexact Rounded + +rsux245 add -12346 0.49999 -> -12346 Inexact Rounded +rsux246 add -12346 0.5 -> -12346 Inexact Rounded +rsux247 add -12346 0.50001 -> -12346 Inexact Rounded + +rsux250 add -12345 0.4 -> -12345 Inexact Rounded +rsux251 add -12345 0.49 -> -12345 Inexact Rounded +rsux252 add -12345 0.499 -> -12345 Inexact Rounded +rsux253 add -12345 0.49999 -> -12345 Inexact Rounded +rsux254 add -12345 0.5 -> -12345 Inexact Rounded +rsux255 add -12345 0.50001 -> -12345 Inexact Rounded +rsux256 add -12345 0.5001 -> -12345 Inexact Rounded +rsux257 add -12345 0.501 -> -12345 Inexact Rounded +rsux258 add -12345 0.51 -> -12345 Inexact Rounded +rsux259 add -12345 0.6 -> -12345 Inexact Rounded + +rounding: floor + +rsux300 add -12345 -0.1 -> -12346 Inexact Rounded +rsux301 add -12345 -0.01 -> -12346 Inexact Rounded +rsux302 add -12345 -0.001 -> -12346 Inexact Rounded +rsux303 add -12345 -0.00001 -> -12346 Inexact Rounded +rsux304 add -12345 -0.000001 -> -12346 Inexact Rounded +rsux305 add -12345 -0.0000001 -> -12346 Inexact Rounded +rsux306 add -12345 0 -> -12345 +rsux307 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux308 add -12345 0.000001 -> -12345 Inexact Rounded +rsux309 add -12345 0.00001 -> -12345 Inexact Rounded +rsux310 add -12345 0.0001 -> -12345 Inexact Rounded +rsux311 add -12345 0.001 -> -12345 Inexact Rounded +rsux312 add -12345 0.01 -> -12345 Inexact Rounded +rsux313 add -12345 0.1 -> -12345 Inexact Rounded + +rsux315 add -12346 0.49999 -> -12346 Inexact Rounded +rsux316 add -12346 0.5 -> -12346 Inexact Rounded +rsux317 add -12346 0.50001 -> -12346 Inexact Rounded + +rsux320 add -12345 0.4 -> -12345 Inexact Rounded +rsux321 add -12345 0.49 -> -12345 Inexact Rounded +rsux322 add -12345 0.499 -> -12345 Inexact Rounded +rsux323 add -12345 0.49999 -> -12345 Inexact Rounded +rsux324 add -12345 0.5 -> -12345 Inexact Rounded +rsux325 add -12345 0.50001 -> -12345 Inexact Rounded +rsux326 add -12345 0.5001 -> -12345 Inexact Rounded +rsux327 add -12345 0.501 -> -12345 Inexact Rounded +rsux328 add -12345 0.51 -> -12345 Inexact Rounded +rsux329 add -12345 0.6 -> -12345 Inexact Rounded + +rounding: ceiling + +rsux330 add -12345 -0.1 -> -12345 Inexact Rounded +rsux331 add -12345 -0.01 -> -12345 Inexact Rounded +rsux332 add -12345 -0.001 -> -12345 Inexact Rounded +rsux333 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux334 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux335 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux336 add -12345 0 -> -12345 +rsux337 add -12345 0.0000001 -> -12344 Inexact Rounded +rsux338 add -12345 0.000001 -> -12344 Inexact Rounded +rsux339 add -12345 0.00001 -> -12344 Inexact Rounded +rsux340 add -12345 0.0001 -> -12344 Inexact Rounded +rsux341 add -12345 0.001 -> -12344 Inexact Rounded +rsux342 add -12345 0.01 -> -12344 Inexact Rounded +rsux343 add -12345 0.1 -> -12344 Inexact Rounded + +rsux345 add -12346 0.49999 -> -12345 Inexact Rounded +rsux346 add -12346 0.5 -> -12345 Inexact Rounded +rsux347 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux350 add -12345 0.4 -> -12344 Inexact Rounded +rsux351 add -12345 0.49 -> -12344 Inexact Rounded +rsux352 add -12345 0.499 -> -12344 Inexact Rounded +rsux353 add -12345 0.49999 -> -12344 Inexact Rounded +rsux354 add -12345 0.5 -> -12344 Inexact Rounded +rsux355 add -12345 0.50001 -> -12344 Inexact Rounded +rsux356 add -12345 0.5001 -> -12344 Inexact Rounded +rsux357 add -12345 0.501 -> -12344 Inexact Rounded +rsux358 add -12345 0.51 -> -12344 Inexact Rounded +rsux359 add -12345 0.6 -> -12344 Inexact Rounded + +-- Check cancellation subtractions +-- (The IEEE 854 'curious rule' in $6.3) + +rounding: down +rzex001 add 0 0 -> 0 +rzex002 add 0 -0 -> 0 +rzex003 add -0 0 -> 0 +rzex004 add -0 -0 -> -0 +rzex005 add 1 -1 -> 0 +rzex006 add -1 1 -> 0 +rzex007 add 1.5 -1.5 -> 0.0 +rzex008 add -1.5 1.5 -> 0.0 +rzex009 add 2 -2 -> 0 +rzex010 add -2 2 -> 0 + +rounding: up +rzex011 add 0 0 -> 0 +rzex012 add 0 -0 -> 0 +rzex013 add -0 0 -> 0 +rzex014 add -0 -0 -> -0 +rzex015 add 1 -1 -> 0 +rzex016 add -1 1 -> 0 +rzex017 add 1.5 -1.5 -> 0.0 +rzex018 add -1.5 1.5 -> 0.0 +rzex019 add 2 -2 -> 0 +rzex020 add -2 2 -> 0 + +rounding: half_up +rzex021 add 0 0 -> 0 +rzex022 add 0 -0 -> 0 +rzex023 add -0 0 -> 0 +rzex024 add -0 -0 -> -0 +rzex025 add 1 -1 -> 0 +rzex026 add -1 1 -> 0 +rzex027 add 1.5 -1.5 -> 0.0 +rzex028 add -1.5 1.5 -> 0.0 +rzex029 add 2 -2 -> 0 +rzex030 add -2 2 -> 0 + +rounding: half_down +rzex031 add 0 0 -> 0 +rzex032 add 0 -0 -> 0 +rzex033 add -0 0 -> 0 +rzex034 add -0 -0 -> -0 +rzex035 add 1 -1 -> 0 +rzex036 add -1 1 -> 0 +rzex037 add 1.5 -1.5 -> 0.0 +rzex038 add -1.5 1.5 -> 0.0 +rzex039 add 2 -2 -> 0 +rzex040 add -2 2 -> 0 + +rounding: half_even +rzex041 add 0 0 -> 0 +rzex042 add 0 -0 -> 0 +rzex043 add -0 0 -> 0 +rzex044 add -0 -0 -> -0 +rzex045 add 1 -1 -> 0 +rzex046 add -1 1 -> 0 +rzex047 add 1.5 -1.5 -> 0.0 +rzex048 add -1.5 1.5 -> 0.0 +rzex049 add 2 -2 -> 0 +rzex050 add -2 2 -> 0 + +rounding: floor +rzex051 add 0 0 -> 0 +rzex052 add 0 -0 -> -0 -- here are two 'curious' +rzex053 add -0 0 -> -0 -- +rzex054 add -0 -0 -> -0 +rzex055 add 1 -1 -> -0 -- here are the rest +rzex056 add -1 1 -> -0 -- .. +rzex057 add 1.5 -1.5 -> -0.0 -- .. +rzex058 add -1.5 1.5 -> -0.0 -- .. +rzex059 add 2 -2 -> -0 -- .. +rzex060 add -2 2 -> -0 -- .. + +rounding: ceiling +rzex061 add 0 0 -> 0 +rzex062 add 0 -0 -> 0 +rzex063 add -0 0 -> 0 +rzex064 add -0 -0 -> -0 +rzex065 add 1 -1 -> 0 +rzex066 add -1 1 -> 0 +rzex067 add 1.5 -1.5 -> 0.0 +rzex068 add -1.5 1.5 -> 0.0 +rzex069 add 2 -2 -> 0 +rzex070 add -2 2 -> 0 + + +-- Division operators ------------------------------------------------- + +rounding: down +rdvx101 divide 12345 1 -> 12345 +rdvx102 divide 12345 1.0001 -> 12343 Inexact Rounded +rdvx103 divide 12345 1.001 -> 12332 Inexact Rounded +rdvx104 divide 12345 1.01 -> 12222 Inexact Rounded +rdvx105 divide 12345 1.1 -> 11222 Inexact Rounded +rdvx106 divide 12355 4 -> 3088.7 Inexact Rounded +rdvx107 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx108 divide 12355 4.0001 -> 3088.6 Inexact Rounded +rdvx109 divide 12345 4.0001 -> 3086.1 Inexact Rounded +rdvx110 divide 12345 4.9 -> 2519.3 Inexact Rounded +rdvx111 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx112 divide 12345 4.999 -> 2469.4 Inexact Rounded +rdvx113 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx114 divide 12345 5 -> 2469 +rdvx115 divide 12345 5.0001 -> 2468.9 Inexact Rounded +rdvx116 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx117 divide 12345 5.01 -> 2464.0 Inexact Rounded +rdvx118 divide 12345 5.1 -> 2420.5 Inexact Rounded + +rounding: half_down +rdvx201 divide 12345 1 -> 12345 +rdvx202 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx203 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx204 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx205 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx206 divide 12355 4 -> 3088.7 Inexact Rounded +rdvx207 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx208 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx209 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx210 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx211 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx212 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx213 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx214 divide 12345 5 -> 2469 +rdvx215 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx216 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx217 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx218 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: half_even +rdvx301 divide 12345 1 -> 12345 +rdvx302 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx303 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx304 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx305 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx306 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx307 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx308 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx309 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx310 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx311 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx312 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx313 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx314 divide 12345 5 -> 2469 +rdvx315 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx316 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx317 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx318 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: half_up +rdvx401 divide 12345 1 -> 12345 +rdvx402 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx403 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx404 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx405 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx406 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx407 divide 12345 4 -> 3086.3 Inexact Rounded +rdvx408 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx409 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx410 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx411 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx412 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx413 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx414 divide 12345 5 -> 2469 +rdvx415 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx416 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx417 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx418 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: up +rdvx501 divide 12345 1 -> 12345 +rdvx502 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx503 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx504 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx505 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx506 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx507 divide 12345 4 -> 3086.3 Inexact Rounded +rdvx508 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx509 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx510 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx511 divide 12345 4.99 -> 2474.0 Inexact Rounded +rdvx512 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx513 divide 12345 4.9999 -> 2469.1 Inexact Rounded +rdvx514 divide 12345 5 -> 2469 +rdvx515 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx516 divide 12345 5.001 -> 2468.6 Inexact Rounded +rdvx517 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx518 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: floor +rdvx601 divide 12345 1 -> 12345 +rdvx602 divide 12345 1.0001 -> 12343 Inexact Rounded +rdvx603 divide 12345 1.001 -> 12332 Inexact Rounded +rdvx604 divide 12345 1.01 -> 12222 Inexact Rounded +rdvx605 divide 12345 1.1 -> 11222 Inexact Rounded +rdvx606 divide 12355 4 -> 3088.7 Inexact Rounded +rdvx607 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx608 divide 12355 4.0001 -> 3088.6 Inexact Rounded +rdvx609 divide 12345 4.0001 -> 3086.1 Inexact Rounded +rdvx610 divide 12345 4.9 -> 2519.3 Inexact Rounded +rdvx611 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx612 divide 12345 4.999 -> 2469.4 Inexact Rounded +rdvx613 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx614 divide 12345 5 -> 2469 +rdvx615 divide 12345 5.0001 -> 2468.9 Inexact Rounded +rdvx616 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx617 divide 12345 5.01 -> 2464.0 Inexact Rounded +rdvx618 divide 12345 5.1 -> 2420.5 Inexact Rounded + +rounding: ceiling +rdvx701 divide 12345 1 -> 12345 +rdvx702 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx703 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx704 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx705 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx706 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx707 divide 12345 4 -> 3086.3 Inexact Rounded +rdvx708 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx709 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx710 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx711 divide 12345 4.99 -> 2474.0 Inexact Rounded +rdvx712 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx713 divide 12345 4.9999 -> 2469.1 Inexact Rounded +rdvx714 divide 12345 5 -> 2469 +rdvx715 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx716 divide 12345 5.001 -> 2468.6 Inexact Rounded +rdvx717 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx718 divide 12345 5.1 -> 2420.6 Inexact Rounded + +-- [divideInteger and remainder unaffected] + +-- Multiplication operator -------------------------------------------- + +rounding: down +rmux101 multiply 12345 1 -> 12345 +rmux102 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux103 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux104 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux105 multiply 12345 1.1 -> 13579 Inexact Rounded +rmux106 multiply 12345 4 -> 49380 +rmux107 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux108 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux109 multiply 12345 4.99 -> 61601 Inexact Rounded +rmux110 multiply 12345 4.999 -> 61712 Inexact Rounded +rmux111 multiply 12345 4.9999 -> 61723 Inexact Rounded +rmux112 multiply 12345 5 -> 61725 +rmux113 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux114 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux115 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux116 multiply 12345 12 -> 1.4814E+5 Rounded +rmux117 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux118 multiply 12355 12 -> 1.4826E+5 Rounded +rmux119 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + +rounding: half_down +rmux201 multiply 12345 1 -> 12345 +rmux202 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux203 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux204 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux205 multiply 12345 1.1 -> 13579 Inexact Rounded +rmux206 multiply 12345 4 -> 49380 +rmux207 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux208 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux209 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux210 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux211 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux212 multiply 12345 5 -> 61725 +rmux213 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux214 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux215 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux216 multiply 12345 12 -> 1.4814E+5 Rounded +rmux217 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux218 multiply 12355 12 -> 1.4826E+5 Rounded +rmux219 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + +rounding: half_even +rmux301 multiply 12345 1 -> 12345 +rmux302 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux303 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux304 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux305 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux306 multiply 12345 4 -> 49380 +rmux307 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux308 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux309 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux310 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux311 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux312 multiply 12345 5 -> 61725 +rmux313 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux314 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux315 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux316 multiply 12345 12 -> 1.4814E+5 Rounded +rmux317 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux318 multiply 12355 12 -> 1.4826E+5 Rounded +rmux319 multiply 12355 13 -> 1.6062E+5 Inexact Rounded + +rounding: half_up +rmux401 multiply 12345 1 -> 12345 +rmux402 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux403 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux404 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux405 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux406 multiply 12345 4 -> 49380 +rmux407 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux408 multiply 12345 4.9 -> 60491 Inexact Rounded +rmux409 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux410 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux411 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux412 multiply 12345 5 -> 61725 +rmux413 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux414 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux415 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux416 multiply 12345 12 -> 1.4814E+5 Rounded +rmux417 multiply 12345 13 -> 1.6049E+5 Inexact Rounded +rmux418 multiply 12355 12 -> 1.4826E+5 Rounded +rmux419 multiply 12355 13 -> 1.6062E+5 Inexact Rounded + +rounding: up +rmux501 multiply 12345 1 -> 12345 +rmux502 multiply 12345 1.0001 -> 12347 Inexact Rounded +rmux503 multiply 12345 1.001 -> 12358 Inexact Rounded +rmux504 multiply 12345 1.01 -> 12469 Inexact Rounded +rmux505 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux506 multiply 12345 4 -> 49380 +rmux507 multiply 12345 4.0001 -> 49382 Inexact Rounded +rmux508 multiply 12345 4.9 -> 60491 Inexact Rounded +rmux509 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux510 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux511 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux512 multiply 12345 5 -> 61725 +rmux513 multiply 12345 5.0001 -> 61727 Inexact Rounded +rmux514 multiply 12345 5.001 -> 61738 Inexact Rounded +rmux515 multiply 12345 5.01 -> 61849 Inexact Rounded +rmux516 multiply 12345 12 -> 1.4814E+5 Rounded +rmux517 multiply 12345 13 -> 1.6049E+5 Inexact Rounded +rmux518 multiply 12355 12 -> 1.4826E+5 Rounded +rmux519 multiply 12355 13 -> 1.6062E+5 Inexact Rounded +-- [rmux516 & rmux518] can surprise + +rounding: floor +rmux601 multiply 12345 1 -> 12345 +rmux602 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux603 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux604 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux605 multiply 12345 1.1 -> 13579 Inexact Rounded +rmux606 multiply 12345 4 -> 49380 +rmux607 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux608 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux609 multiply 12345 4.99 -> 61601 Inexact Rounded +rmux610 multiply 12345 4.999 -> 61712 Inexact Rounded +rmux611 multiply 12345 4.9999 -> 61723 Inexact Rounded +rmux612 multiply 12345 5 -> 61725 +rmux613 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux614 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux615 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux616 multiply 12345 12 -> 1.4814E+5 Rounded +rmux617 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux618 multiply 12355 12 -> 1.4826E+5 Rounded +rmux619 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + +rounding: ceiling +rmux701 multiply 12345 1 -> 12345 +rmux702 multiply 12345 1.0001 -> 12347 Inexact Rounded +rmux703 multiply 12345 1.001 -> 12358 Inexact Rounded +rmux704 multiply 12345 1.01 -> 12469 Inexact Rounded +rmux705 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux706 multiply 12345 4 -> 49380 +rmux707 multiply 12345 4.0001 -> 49382 Inexact Rounded +rmux708 multiply 12345 4.9 -> 60491 Inexact Rounded +rmux709 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux710 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux711 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux712 multiply 12345 5 -> 61725 +rmux713 multiply 12345 5.0001 -> 61727 Inexact Rounded +rmux714 multiply 12345 5.001 -> 61738 Inexact Rounded +rmux715 multiply 12345 5.01 -> 61849 Inexact Rounded +rmux716 multiply 12345 12 -> 1.4814E+5 Rounded +rmux717 multiply 12345 13 -> 1.6049E+5 Inexact Rounded +rmux718 multiply 12355 12 -> 1.4826E+5 Rounded +rmux719 multiply 12355 13 -> 1.6062E+5 Inexact Rounded + +-- Power operator ----------------------------------------------------- + +rounding: down +rpox101 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox102 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox103 power 12345 -3 -> 5.3152E-13 Inexact Rounded +rpox104 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox105 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox106 power 12345 0 -> 1 +rpox107 power 12345 1 -> 12345 +rpox108 power 12345 2 -> 1.5239E+8 Inexact Rounded +rpox109 power 12345 3 -> 1.8813E+12 Inexact Rounded +rpox110 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox111 power 12345 5 -> 2.8671E+20 Inexact Rounded +rpox112 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox113 power 75 3 -> 4.2187E+5 Inexact Rounded + +rounding: half_down +rpox201 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox202 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox203 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox204 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox205 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox206 power 12345 0 -> 1 +rpox207 power 12345 1 -> 12345 +rpox208 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox209 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox210 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox211 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox212 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox213 power 75 3 -> 4.2187E+5 Inexact Rounded + +rounding: half_even +rpox301 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox302 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox303 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox304 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox305 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox306 power 12345 0 -> 1 +rpox307 power 12345 1 -> 12345 +rpox308 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox309 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox310 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox311 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox312 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox313 power 75 3 -> 4.2188E+5 Inexact Rounded + +rounding: half_up +rpox401 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox402 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox403 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox404 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox405 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox406 power 12345 0 -> 1 +rpox407 power 12345 1 -> 12345 +rpox408 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox409 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox410 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox411 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox412 power 415 2 -> 1.7223E+5 Inexact Rounded +rpox413 power 75 3 -> 4.2188E+5 Inexact Rounded + +rounding: up +rpox501 power 12345 -5 -> 3.4878E-21 Inexact Rounded +rpox502 power 12345 -4 -> 4.3057E-17 Inexact Rounded +rpox503 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox504 power 12345 -2 -> 6.5618E-9 Inexact Rounded +rpox505 power 12345 -1 -> 0.000081005 Inexact Rounded +rpox506 power 12345 0 -> 1 +rpox507 power 12345 1 -> 12345 +rpox508 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox509 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox510 power 12345 4 -> 2.3226E+16 Inexact Rounded +rpox511 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox512 power 415 2 -> 1.7223E+5 Inexact Rounded +rpox513 power 75 3 -> 4.2188E+5 Inexact Rounded + +rounding: floor +rpox601 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox602 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox603 power 12345 -3 -> 5.3152E-13 Inexact Rounded +rpox604 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox605 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox606 power 12345 0 -> 1 +rpox607 power 12345 1 -> 12345 +rpox608 power 12345 2 -> 1.5239E+8 Inexact Rounded +rpox609 power 12345 3 -> 1.8813E+12 Inexact Rounded +rpox610 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox611 power 12345 5 -> 2.8671E+20 Inexact Rounded +rpox612 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox613 power 75 3 -> 4.2187E+5 Inexact Rounded + +rounding: ceiling +rpox701 power 12345 -5 -> 3.4878E-21 Inexact Rounded +rpox702 power 12345 -4 -> 4.3057E-17 Inexact Rounded +rpox703 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox704 power 12345 -2 -> 6.5618E-9 Inexact Rounded +rpox705 power 12345 -1 -> 0.000081005 Inexact Rounded +rpox706 power 12345 0 -> 1 +rpox707 power 12345 1 -> 12345 +rpox708 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox709 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox710 power 12345 4 -> 2.3226E+16 Inexact Rounded +rpox711 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox712 power 415 2 -> 1.7223E+5 Inexact Rounded +rpox713 power 75 3 -> 4.2188E+5 Inexact Rounded + +-- Underflow Subnormal and overflow values vary with rounding mode and sign +maxexponent: 999999999 +minexponent: -999999999 +rounding: down +rovx100 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +rovx101 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +rovx102 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx104 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: up +rovx110 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx111 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx112 divide 1E-9 9E+999999999 -> 1E-1000000003 Underflow Subnormal Inexact Rounded +rovx114 divide -1E-9 9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded + +rounding: ceiling +rovx120 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx121 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +rovx122 divide 1E-9 9E+999999999 -> 1E-1000000003 Underflow Subnormal Inexact Rounded +rovx124 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: floor +rovx130 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +rovx131 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx132 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx134 divide -1E-9 9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded + +rounding: half_up +rovx140 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx141 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx142 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx144 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: half_even +rovx150 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx151 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx152 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx154 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: half_down +rovx160 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx161 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx162 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx164 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +-- check maximum finite value over a range of precisions +rounding: down +precision: 1 +rovx200 multiply 10 9E+999999999 -> 9E+999999999 Overflow Inexact Rounded +rovx201 multiply -10 9E+999999999 -> -9E+999999999 Overflow Inexact Rounded +precision: 2 +rovx210 multiply 10 9E+999999999 -> 9.9E+999999999 Overflow Inexact Rounded +rovx211 multiply -10 9E+999999999 -> -9.9E+999999999 Overflow Inexact Rounded +precision: 3 +rovx220 multiply 10 9E+999999999 -> 9.99E+999999999 Overflow Inexact Rounded +rovx221 multiply -10 9E+999999999 -> -9.99E+999999999 Overflow Inexact Rounded +precision: 4 +rovx230 multiply 10 9E+999999999 -> 9.999E+999999999 Overflow Inexact Rounded +rovx231 multiply -10 9E+999999999 -> -9.999E+999999999 Overflow Inexact Rounded +precision: 5 +rovx240 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +rovx241 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +precision: 6 +rovx250 multiply 10 9E+999999999 -> 9.99999E+999999999 Overflow Inexact Rounded +rovx251 multiply -10 9E+999999999 -> -9.99999E+999999999 Overflow Inexact Rounded +precision: 7 +rovx260 multiply 10 9E+999999999 -> 9.999999E+999999999 Overflow Inexact Rounded +rovx261 multiply -10 9E+999999999 -> -9.999999E+999999999 Overflow Inexact Rounded +precision: 8 +rovx270 multiply 10 9E+999999999 -> 9.9999999E+999999999 Overflow Inexact Rounded +rovx271 multiply -10 9E+999999999 -> -9.9999999E+999999999 Overflow Inexact Rounded +precision: 9 +rovx280 multiply 10 9E+999999999 -> 9.99999999E+999999999 Overflow Inexact Rounded +rovx281 multiply -10 9E+999999999 -> -9.99999999E+999999999 Overflow Inexact Rounded +precision: 10 +rovx290 multiply 10 9E+999999999 -> 9.999999999E+999999999 Overflow Inexact Rounded +rovx291 multiply -10 9E+999999999 -> -9.999999999E+999999999 Overflow Inexact Rounded + +-- reprise rounding mode effect (using multiplies so precision directive used) +precision: 9 +maxexponent: 999999999 +rounding: half_up +rmex400 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex401 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: half_down +rmex402 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex403 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: half_even +rmex404 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex405 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: floor +rmex406 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex407 multiply 9.999E+999999999 10 -> 9.99999999E+999999999 Overflow Inexact Rounded +rounding: ceiling +rmex408 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded +rmex409 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: up +rmex410 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex411 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: down +rmex412 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded +rmex413 multiply 9.999E+999999999 10 -> 9.99999999E+999999999 Overflow Inexact Rounded + +----- Round-for-reround ----- +rounding: 05up +precision: 5 -- for easier visual inspection +maxExponent: 999 +minexponent: -999 + +-- basic rounding; really is just 0 and 5 up +r05up001 add 12340 0.001 -> 12341 Inexact Rounded +r05up002 add 12341 0.001 -> 12341 Inexact Rounded +r05up003 add 12342 0.001 -> 12342 Inexact Rounded +r05up004 add 12343 0.001 -> 12343 Inexact Rounded +r05up005 add 12344 0.001 -> 12344 Inexact Rounded +r05up006 add 12345 0.001 -> 12346 Inexact Rounded +r05up007 add 12346 0.001 -> 12346 Inexact Rounded +r05up008 add 12347 0.001 -> 12347 Inexact Rounded +r05up009 add 12348 0.001 -> 12348 Inexact Rounded +r05up010 add 12349 0.001 -> 12349 Inexact Rounded + +r05up011 add 12340 0.000 -> 12340 Rounded +r05up012 add 12341 0.000 -> 12341 Rounded +r05up013 add 12342 0.000 -> 12342 Rounded +r05up014 add 12343 0.000 -> 12343 Rounded +r05up015 add 12344 0.000 -> 12344 Rounded +r05up016 add 12345 0.000 -> 12345 Rounded +r05up017 add 12346 0.000 -> 12346 Rounded +r05up018 add 12347 0.000 -> 12347 Rounded +r05up019 add 12348 0.000 -> 12348 Rounded +r05up020 add 12349 0.000 -> 12349 Rounded + +r05up021 add 12340 0.901 -> 12341 Inexact Rounded +r05up022 add 12341 0.901 -> 12341 Inexact Rounded +r05up023 add 12342 0.901 -> 12342 Inexact Rounded +r05up024 add 12343 0.901 -> 12343 Inexact Rounded +r05up025 add 12344 0.901 -> 12344 Inexact Rounded +r05up026 add 12345 0.901 -> 12346 Inexact Rounded +r05up027 add 12346 0.901 -> 12346 Inexact Rounded +r05up028 add 12347 0.901 -> 12347 Inexact Rounded +r05up029 add 12348 0.901 -> 12348 Inexact Rounded +r05up030 add 12349 0.901 -> 12349 Inexact Rounded + +r05up031 add -12340 -0.001 -> -12341 Inexact Rounded +r05up032 add -12341 -0.001 -> -12341 Inexact Rounded +r05up033 add -12342 -0.001 -> -12342 Inexact Rounded +r05up034 add -12343 -0.001 -> -12343 Inexact Rounded +r05up035 add -12344 -0.001 -> -12344 Inexact Rounded +r05up036 add -12345 -0.001 -> -12346 Inexact Rounded +r05up037 add -12346 -0.001 -> -12346 Inexact Rounded +r05up038 add -12347 -0.001 -> -12347 Inexact Rounded +r05up039 add -12348 -0.001 -> -12348 Inexact Rounded +r05up040 add -12349 -0.001 -> -12349 Inexact Rounded + +r05up041 add -12340 0.001 -> -12339 Inexact Rounded +r05up042 add -12341 0.001 -> -12341 Inexact Rounded +r05up043 add -12342 0.001 -> -12341 Inexact Rounded +r05up044 add -12343 0.001 -> -12342 Inexact Rounded +r05up045 add -12344 0.001 -> -12343 Inexact Rounded +r05up046 add -12345 0.001 -> -12344 Inexact Rounded +r05up047 add -12346 0.001 -> -12346 Inexact Rounded +r05up048 add -12347 0.001 -> -12346 Inexact Rounded +r05up049 add -12348 0.001 -> -12347 Inexact Rounded +r05up050 add -12349 0.001 -> -12348 Inexact Rounded + +-- Addition operators ------------------------------------------------- +-- [The first few of these check negative residue possibilities; these +-- cases may be implemented as a negative residue in fastpaths] + +r0adx100 add 12345 -0.1 -> 12344 Inexact Rounded +r0adx101 add 12345 -0.01 -> 12344 Inexact Rounded +r0adx102 add 12345 -0.001 -> 12344 Inexact Rounded +r0adx103 add 12345 -0.00001 -> 12344 Inexact Rounded +r0adx104 add 12345 -0.000001 -> 12344 Inexact Rounded +r0adx105 add 12345 -0.0000001 -> 12344 Inexact Rounded +r0adx106 add 12345 0 -> 12345 +r0adx107 add 12345 0.0000001 -> 12346 Inexact Rounded +r0adx108 add 12345 0.000001 -> 12346 Inexact Rounded +r0adx109 add 12345 0.00001 -> 12346 Inexact Rounded +r0adx110 add 12345 0.0001 -> 12346 Inexact Rounded +r0adx111 add 12345 0.001 -> 12346 Inexact Rounded +r0adx112 add 12345 0.01 -> 12346 Inexact Rounded +r0adx113 add 12345 0.1 -> 12346 Inexact Rounded + +r0adx115 add 12346 0.49999 -> 12346 Inexact Rounded +r0adx116 add 12346 0.5 -> 12346 Inexact Rounded +r0adx117 add 12346 0.50001 -> 12346 Inexact Rounded + +r0adx120 add 12345 0.4 -> 12346 Inexact Rounded +r0adx121 add 12345 0.49 -> 12346 Inexact Rounded +r0adx122 add 12345 0.499 -> 12346 Inexact Rounded +r0adx123 add 12345 0.49999 -> 12346 Inexact Rounded +r0adx124 add 12345 0.5 -> 12346 Inexact Rounded +r0adx125 add 12345 0.50001 -> 12346 Inexact Rounded +r0adx126 add 12345 0.5001 -> 12346 Inexact Rounded +r0adx127 add 12345 0.501 -> 12346 Inexact Rounded +r0adx128 add 12345 0.51 -> 12346 Inexact Rounded +r0adx129 add 12345 0.6 -> 12346 Inexact Rounded + +-- negatives... + +r0sux100 add -12345 -0.1 -> -12346 Inexact Rounded +r0sux101 add -12345 -0.01 -> -12346 Inexact Rounded +r0sux102 add -12345 -0.001 -> -12346 Inexact Rounded +r0sux103 add -12345 -0.00001 -> -12346 Inexact Rounded +r0sux104 add -12345 -0.000001 -> -12346 Inexact Rounded +r0sux105 add -12345 -0.0000001 -> -12346 Inexact Rounded +r0sux106 add -12345 0 -> -12345 +r0sux107 add -12345 0.0000001 -> -12344 Inexact Rounded +r0sux108 add -12345 0.000001 -> -12344 Inexact Rounded +r0sux109 add -12345 0.00001 -> -12344 Inexact Rounded +r0sux110 add -12345 0.0001 -> -12344 Inexact Rounded +r0sux111 add -12345 0.001 -> -12344 Inexact Rounded +r0sux112 add -12345 0.01 -> -12344 Inexact Rounded +r0sux113 add -12345 0.1 -> -12344 Inexact Rounded + +r0sux115 add -12346 0.49999 -> -12346 Inexact Rounded +r0sux116 add -12346 0.5 -> -12346 Inexact Rounded +r0sux117 add -12346 0.50001 -> -12346 Inexact Rounded + +r0sux120 add -12345 0.4 -> -12344 Inexact Rounded +r0sux121 add -12345 0.49 -> -12344 Inexact Rounded +r0sux122 add -12345 0.499 -> -12344 Inexact Rounded +r0sux123 add -12345 0.49999 -> -12344 Inexact Rounded +r0sux124 add -12345 0.5 -> -12344 Inexact Rounded +r0sux125 add -12345 0.50001 -> -12344 Inexact Rounded +r0sux126 add -12345 0.5001 -> -12344 Inexact Rounded +r0sux127 add -12345 0.501 -> -12344 Inexact Rounded +r0sux128 add -12345 0.51 -> -12344 Inexact Rounded +r0sux129 add -12345 0.6 -> -12344 Inexact Rounded + +-- Check cancellation subtractions +-- (The IEEE 854 'curious rule' in $6.3) + +r0zex001 add 0 0 -> 0 +r0zex002 add 0 -0 -> 0 +r0zex003 add -0 0 -> 0 +r0zex004 add -0 -0 -> -0 +r0zex005 add 1 -1 -> 0 +r0zex006 add -1 1 -> 0 +r0zex007 add 1.5 -1.5 -> 0.0 +r0zex008 add -1.5 1.5 -> 0.0 +r0zex009 add 2 -2 -> 0 +r0zex010 add -2 2 -> 0 + + +-- Division operators ------------------------------------------------- + +r0dvx101 divide 12345 1 -> 12345 +r0dvx102 divide 12345 1.0001 -> 12343 Inexact Rounded +r0dvx103 divide 12345 1.001 -> 12332 Inexact Rounded +r0dvx104 divide 12345 1.01 -> 12222 Inexact Rounded +r0dvx105 divide 12345 1.1 -> 11222 Inexact Rounded +r0dvx106 divide 12355 4 -> 3088.7 Inexact Rounded +r0dvx107 divide 12345 4 -> 3086.2 Inexact Rounded +r0dvx108 divide 12355 4.0001 -> 3088.6 Inexact Rounded +r0dvx109 divide 12345 4.0001 -> 3086.1 Inexact Rounded +r0dvx110 divide 12345 4.9 -> 2519.3 Inexact Rounded +r0dvx111 divide 12345 4.99 -> 2473.9 Inexact Rounded +r0dvx112 divide 12345 4.999 -> 2469.4 Inexact Rounded +r0dvx113 divide 12345 4.9999 -> 2469.1 Inexact Rounded +r0dvx114 divide 12345 5 -> 2469 +r0dvx115 divide 12345 5.0001 -> 2468.9 Inexact Rounded +r0dvx116 divide 12345 5.001 -> 2468.6 Inexact Rounded +r0dvx117 divide 12345 5.01 -> 2464.1 Inexact Rounded +r0dvx118 divide 12345 5.1 -> 2420.6 Inexact Rounded + +-- [divideInteger and remainder unaffected] + +-- Multiplication operator -------------------------------------------- + +r0mux101 multiply 12345 1 -> 12345 +r0mux102 multiply 12345 1.0001 -> 12346 Inexact Rounded +r0mux103 multiply 12345 1.001 -> 12357 Inexact Rounded +r0mux104 multiply 12345 1.01 -> 12468 Inexact Rounded +r0mux105 multiply 12345 1.1 -> 13579 Inexact Rounded +r0mux106 multiply 12345 4 -> 49380 +r0mux107 multiply 12345 4.0001 -> 49381 Inexact Rounded +r0mux108 multiply 12345 4.9 -> 60491 Inexact Rounded +r0mux109 multiply 12345 4.99 -> 61601 Inexact Rounded +r0mux110 multiply 12345 4.999 -> 61712 Inexact Rounded +r0mux111 multiply 12345 4.9999 -> 61723 Inexact Rounded +r0mux112 multiply 12345 5 -> 61725 +r0mux113 multiply 12345 5.0001 -> 61726 Inexact Rounded +r0mux114 multiply 12345 5.001 -> 61737 Inexact Rounded +r0mux115 multiply 12345 5.01 -> 61848 Inexact Rounded +r0mux116 multiply 12345 12 -> 1.4814E+5 Rounded +r0mux117 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +r0mux118 multiply 12355 12 -> 1.4826E+5 Rounded +r0mux119 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + + +-- Power operator ----------------------------------------------------- + +r0pox101 power 12345 -5 -> 3.4877E-21 Inexact Rounded +r0pox102 power 12345 -4 -> 4.3056E-17 Inexact Rounded +r0pox103 power 12345 -3 -> 5.3152E-13 Inexact Rounded +r0pox104 power 12345 -2 -> 6.5617E-9 Inexact Rounded +r0pox105 power 12345 -1 -> 0.000081004 Inexact Rounded +r0pox106 power 12345 0 -> 1 +r0pox107 power 12345 1 -> 12345 +r0pox108 power 12345 2 -> 1.5239E+8 Inexact Rounded +r0pox109 power 12345 3 -> 1.8813E+12 Inexact Rounded +r0pox110 power 12345 4 -> 2.3226E+16 Inexact Rounded +r0pox111 power 12345 5 -> 2.8671E+20 Inexact Rounded +r0pox112 power 415 2 -> 1.7222E+5 Inexact Rounded +r0pox113 power 75 3 -> 4.2187E+5 Inexact Rounded + + +-- Underflow Subnormal and overflow values vary with rounding mode and sign +maxexponent: 999999999 +minexponent: -999999999 +-- [round down gives Nmax on first two and .0E... on the next two] +r0ovx100 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +r0ovx101 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +r0ovx102 divide 1E-9 9E+999999999 -> 1E-1000000003 Underflow Subnormal Inexact Rounded +r0ovx104 divide -1E-9 9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded + +-- reprise rounding mode effect (using multiplies so precision directive used) +precision: 9 +maxexponent: 999999999 +r0mex412 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded +r0mex413 multiply 9.999E+999999999 10 -> 9.99999999E+999999999 Overflow Inexact Rounded + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/samequantum.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/samequantum.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,389 @@ +------------------------------------------------------------------------ +-- samequantum.decTest -- check quantums match -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +samq001 samequantum 0 0 -> 1 +samq002 samequantum 0 1 -> 1 +samq003 samequantum 1 0 -> 1 +samq004 samequantum 1 1 -> 1 + +samq011 samequantum 10 1E+1 -> 0 +samq012 samequantum 10E+1 10E+1 -> 1 +samq013 samequantum 100 10E+1 -> 0 +samq014 samequantum 100 1E+2 -> 0 +samq015 samequantum 0.1 1E-2 -> 0 +samq016 samequantum 0.1 1E-1 -> 1 +samq017 samequantum 0.1 1E-0 -> 0 +samq018 samequantum 999 999 -> 1 +samq019 samequantum 999E-1 99.9 -> 1 +samq020 samequantum 111E-1 22.2 -> 1 +samq021 samequantum 111E-1 1234.2 -> 1 + +-- zeros +samq030 samequantum 0.0 1.1 -> 1 +samq031 samequantum 0.0 1.11 -> 0 +samq032 samequantum 0.0 0 -> 0 +samq033 samequantum 0.0 0.0 -> 1 +samq034 samequantum 0.0 0.00 -> 0 +samq035 samequantum 0E+1 0E+0 -> 0 +samq036 samequantum 0E+1 0E+1 -> 1 +samq037 samequantum 0E+1 0E+2 -> 0 +samq038 samequantum 0E-17 0E-16 -> 0 +samq039 samequantum 0E-17 0E-17 -> 1 +samq040 samequantum 0E-17 0E-18 -> 0 +samq041 samequantum 0E-17 0.0E-15 -> 0 +samq042 samequantum 0E-17 0.0E-16 -> 1 +samq043 samequantum 0E-17 0.0E-17 -> 0 +samq044 samequantum -0E-17 0.0E-16 -> 1 +samq045 samequantum 0E-17 -0.0E-17 -> 0 +samq046 samequantum 0E-17 -0.0E-16 -> 1 +samq047 samequantum -0E-17 0.0E-17 -> 0 +samq048 samequantum -0E-17 -0.0E-16 -> 1 +samq049 samequantum -0E-17 -0.0E-17 -> 0 + +-- Nmax, Nmin, Ntiny +samq051 samequantum 9.99999999E+999 9.99999999E+999 -> 1 +samq052 samequantum 1E-999 1E-999 -> 1 +samq053 samequantum 1.00000000E-999 1.00000000E-999 -> 1 +samq054 samequantum 1E-1007 1E-1007 -> 1 +samq055 samequantum 9.99999999E+999 9.99999999E+999 -> 1 +samq056 samequantum 1E-999 1E-999 -> 1 +samq057 samequantum 1.00000000E-999 1.00000000E-999 -> 1 +samq058 samequantum 1E-1007 1E-1007 -> 1 + +samq061 samequantum -1E-1007 -1E-1007 -> 1 +samq062 samequantum -1.00000000E-999 -1.00000000E-999 -> 1 +samq063 samequantum -1E-999 -1E-999 -> 1 +samq064 samequantum -9.99999999E+999 -9.99999999E+999 -> 1 +samq065 samequantum -1E-1007 -1E-1007 -> 1 +samq066 samequantum -1.00000000E-999 -1.00000000E-999 -> 1 +samq067 samequantum -1E-999 -1E-999 -> 1 +samq068 samequantum -9.99999999E+999 -9.99999999E+999 -> 1 + +samq071 samequantum -4E-1007 -1E-1007 -> 1 +samq072 samequantum -4.00000000E-999 -1.00004000E-999 -> 1 +samq073 samequantum -4E-999 -1E-999 -> 1 +samq074 samequantum -4.99999999E+999 -9.99949999E+999 -> 1 +samq075 samequantum -4E-1007 -1E-1007 -> 1 +samq076 samequantum -4.00000000E-999 -1.00400000E-999 -> 1 +samq077 samequantum -4E-999 -1E-999 -> 1 +samq078 samequantum -4.99999999E+999 -9.94999999E+999 -> 1 + +samq081 samequantum -4E-1006 -1E-1007 -> 0 +samq082 samequantum -4.00000000E-999 -1.00004000E-996 -> 0 +samq083 samequantum -4E-996 -1E-999 -> 0 +samq084 samequantum -4.99999999E+999 -9.99949999E+996 -> 0 +samq085 samequantum -4E-1006 -1E-1007 -> 0 +samq086 samequantum -4.00000000E-999 -1.00400000E-996 -> 0 +samq087 samequantum -4E-996 -1E-999 -> 0 +samq088 samequantum -4.99999999E+999 -9.94999999E+996 -> 0 + +-- specials & combinations +samq0110 samequantum -Inf -Inf -> 1 +samq0111 samequantum -Inf Inf -> 1 +samq0112 samequantum -Inf NaN -> 0 +samq0113 samequantum -Inf -7E+3 -> 0 +samq0114 samequantum -Inf -7 -> 0 +samq0115 samequantum -Inf -7E-3 -> 0 +samq0116 samequantum -Inf -0E-3 -> 0 +samq0117 samequantum -Inf -0 -> 0 +samq0118 samequantum -Inf -0E+3 -> 0 +samq0119 samequantum -Inf 0E-3 -> 0 +samq0120 samequantum -Inf 0 -> 0 +samq0121 samequantum -Inf 0E+3 -> 0 +samq0122 samequantum -Inf 7E-3 -> 0 +samq0123 samequantum -Inf 7 -> 0 +samq0124 samequantum -Inf 7E+3 -> 0 +samq0125 samequantum -Inf sNaN -> 0 + +samq0210 samequantum Inf -Inf -> 1 +samq0211 samequantum Inf Inf -> 1 +samq0212 samequantum Inf NaN -> 0 +samq0213 samequantum Inf -7E+3 -> 0 +samq0214 samequantum Inf -7 -> 0 +samq0215 samequantum Inf -7E-3 -> 0 +samq0216 samequantum Inf -0E-3 -> 0 +samq0217 samequantum Inf -0 -> 0 +samq0218 samequantum Inf -0E+3 -> 0 +samq0219 samequantum Inf 0E-3 -> 0 +samq0220 samequantum Inf 0 -> 0 +samq0221 samequantum Inf 0E+3 -> 0 +samq0222 samequantum Inf 7E-3 -> 0 +samq0223 samequantum Inf 7 -> 0 +samq0224 samequantum Inf 7E+3 -> 0 +samq0225 samequantum Inf sNaN -> 0 + +samq0310 samequantum NaN -Inf -> 0 +samq0311 samequantum NaN Inf -> 0 +samq0312 samequantum NaN NaN -> 1 +samq0313 samequantum NaN -7E+3 -> 0 +samq0314 samequantum NaN -7 -> 0 +samq0315 samequantum NaN -7E-3 -> 0 +samq0316 samequantum NaN -0E-3 -> 0 +samq0317 samequantum NaN -0 -> 0 +samq0318 samequantum NaN -0E+3 -> 0 +samq0319 samequantum NaN 0E-3 -> 0 +samq0320 samequantum NaN 0 -> 0 +samq0321 samequantum NaN 0E+3 -> 0 +samq0322 samequantum NaN 7E-3 -> 0 +samq0323 samequantum NaN 7 -> 0 +samq0324 samequantum NaN 7E+3 -> 0 +samq0325 samequantum NaN sNaN -> 1 + +samq0410 samequantum -7E+3 -Inf -> 0 +samq0411 samequantum -7E+3 Inf -> 0 +samq0412 samequantum -7E+3 NaN -> 0 +samq0413 samequantum -7E+3 -7E+3 -> 1 +samq0414 samequantum -7E+3 -7 -> 0 +samq0415 samequantum -7E+3 -7E-3 -> 0 +samq0416 samequantum -7E+3 -0E-3 -> 0 +samq0417 samequantum -7E+3 -0 -> 0 +samq0418 samequantum -7E+3 -0E+3 -> 1 +samq0419 samequantum -7E+3 0E-3 -> 0 +samq0420 samequantum -7E+3 0 -> 0 +samq0421 samequantum -7E+3 0E+3 -> 1 +samq0422 samequantum -7E+3 7E-3 -> 0 +samq0423 samequantum -7E+3 7 -> 0 +samq0424 samequantum -7E+3 7E+3 -> 1 +samq0425 samequantum -7E+3 sNaN -> 0 + +samq0510 samequantum -7 -Inf -> 0 +samq0511 samequantum -7 Inf -> 0 +samq0512 samequantum -7 NaN -> 0 +samq0513 samequantum -7 -7E+3 -> 0 +samq0514 samequantum -7 -7 -> 1 +samq0515 samequantum -7 -7E-3 -> 0 +samq0516 samequantum -7 -0E-3 -> 0 +samq0517 samequantum -7 -0 -> 1 +samq0518 samequantum -7 -0E+3 -> 0 +samq0519 samequantum -7 0E-3 -> 0 +samq0520 samequantum -7 0 -> 1 +samq0521 samequantum -7 0E+3 -> 0 +samq0522 samequantum -7 7E-3 -> 0 +samq0523 samequantum -7 7 -> 1 +samq0524 samequantum -7 7E+3 -> 0 +samq0525 samequantum -7 sNaN -> 0 + +samq0610 samequantum -7E-3 -Inf -> 0 +samq0611 samequantum -7E-3 Inf -> 0 +samq0612 samequantum -7E-3 NaN -> 0 +samq0613 samequantum -7E-3 -7E+3 -> 0 +samq0614 samequantum -7E-3 -7 -> 0 +samq0615 samequantum -7E-3 -7E-3 -> 1 +samq0616 samequantum -7E-3 -0E-3 -> 1 +samq0617 samequantum -7E-3 -0 -> 0 +samq0618 samequantum -7E-3 -0E+3 -> 0 +samq0619 samequantum -7E-3 0E-3 -> 1 +samq0620 samequantum -7E-3 0 -> 0 +samq0621 samequantum -7E-3 0E+3 -> 0 +samq0622 samequantum -7E-3 7E-3 -> 1 +samq0623 samequantum -7E-3 7 -> 0 +samq0624 samequantum -7E-3 7E+3 -> 0 +samq0625 samequantum -7E-3 sNaN -> 0 + +samq0710 samequantum -0E-3 -Inf -> 0 +samq0711 samequantum -0E-3 Inf -> 0 +samq0712 samequantum -0E-3 NaN -> 0 +samq0713 samequantum -0E-3 -7E+3 -> 0 +samq0714 samequantum -0E-3 -7 -> 0 +samq0715 samequantum -0E-3 -7E-3 -> 1 +samq0716 samequantum -0E-3 -0E-3 -> 1 +samq0717 samequantum -0E-3 -0 -> 0 +samq0718 samequantum -0E-3 -0E+3 -> 0 +samq0719 samequantum -0E-3 0E-3 -> 1 +samq0720 samequantum -0E-3 0 -> 0 +samq0721 samequantum -0E-3 0E+3 -> 0 +samq0722 samequantum -0E-3 7E-3 -> 1 +samq0723 samequantum -0E-3 7 -> 0 +samq0724 samequantum -0E-3 7E+3 -> 0 +samq0725 samequantum -0E-3 sNaN -> 0 + +samq0810 samequantum -0 -Inf -> 0 +samq0811 samequantum -0 Inf -> 0 +samq0812 samequantum -0 NaN -> 0 +samq0813 samequantum -0 -7E+3 -> 0 +samq0814 samequantum -0 -7 -> 1 +samq0815 samequantum -0 -7E-3 -> 0 +samq0816 samequantum -0 -0E-3 -> 0 +samq0817 samequantum -0 -0 -> 1 +samq0818 samequantum -0 -0E+3 -> 0 +samq0819 samequantum -0 0E-3 -> 0 +samq0820 samequantum -0 0 -> 1 +samq0821 samequantum -0 0E+3 -> 0 +samq0822 samequantum -0 7E-3 -> 0 +samq0823 samequantum -0 7 -> 1 +samq0824 samequantum -0 7E+3 -> 0 +samq0825 samequantum -0 sNaN -> 0 + +samq0910 samequantum -0E+3 -Inf -> 0 +samq0911 samequantum -0E+3 Inf -> 0 +samq0912 samequantum -0E+3 NaN -> 0 +samq0913 samequantum -0E+3 -7E+3 -> 1 +samq0914 samequantum -0E+3 -7 -> 0 +samq0915 samequantum -0E+3 -7E-3 -> 0 +samq0916 samequantum -0E+3 -0E-3 -> 0 +samq0917 samequantum -0E+3 -0 -> 0 +samq0918 samequantum -0E+3 -0E+3 -> 1 +samq0919 samequantum -0E+3 0E-3 -> 0 +samq0920 samequantum -0E+3 0 -> 0 +samq0921 samequantum -0E+3 0E+3 -> 1 +samq0922 samequantum -0E+3 7E-3 -> 0 +samq0923 samequantum -0E+3 7 -> 0 +samq0924 samequantum -0E+3 7E+3 -> 1 +samq0925 samequantum -0E+3 sNaN -> 0 + +samq1110 samequantum 0E-3 -Inf -> 0 +samq1111 samequantum 0E-3 Inf -> 0 +samq1112 samequantum 0E-3 NaN -> 0 +samq1113 samequantum 0E-3 -7E+3 -> 0 +samq1114 samequantum 0E-3 -7 -> 0 +samq1115 samequantum 0E-3 -7E-3 -> 1 +samq1116 samequantum 0E-3 -0E-3 -> 1 +samq1117 samequantum 0E-3 -0 -> 0 +samq1118 samequantum 0E-3 -0E+3 -> 0 +samq1119 samequantum 0E-3 0E-3 -> 1 +samq1120 samequantum 0E-3 0 -> 0 +samq1121 samequantum 0E-3 0E+3 -> 0 +samq1122 samequantum 0E-3 7E-3 -> 1 +samq1123 samequantum 0E-3 7 -> 0 +samq1124 samequantum 0E-3 7E+3 -> 0 +samq1125 samequantum 0E-3 sNaN -> 0 + +samq1210 samequantum 0 -Inf -> 0 +samq1211 samequantum 0 Inf -> 0 +samq1212 samequantum 0 NaN -> 0 +samq1213 samequantum 0 -7E+3 -> 0 +samq1214 samequantum 0 -7 -> 1 +samq1215 samequantum 0 -7E-3 -> 0 +samq1216 samequantum 0 -0E-3 -> 0 +samq1217 samequantum 0 -0 -> 1 +samq1218 samequantum 0 -0E+3 -> 0 +samq1219 samequantum 0 0E-3 -> 0 +samq1220 samequantum 0 0 -> 1 +samq1221 samequantum 0 0E+3 -> 0 +samq1222 samequantum 0 7E-3 -> 0 +samq1223 samequantum 0 7 -> 1 +samq1224 samequantum 0 7E+3 -> 0 +samq1225 samequantum 0 sNaN -> 0 + +samq1310 samequantum 0E+3 -Inf -> 0 +samq1311 samequantum 0E+3 Inf -> 0 +samq1312 samequantum 0E+3 NaN -> 0 +samq1313 samequantum 0E+3 -7E+3 -> 1 +samq1314 samequantum 0E+3 -7 -> 0 +samq1315 samequantum 0E+3 -7E-3 -> 0 +samq1316 samequantum 0E+3 -0E-3 -> 0 +samq1317 samequantum 0E+3 -0 -> 0 +samq1318 samequantum 0E+3 -0E+3 -> 1 +samq1319 samequantum 0E+3 0E-3 -> 0 +samq1320 samequantum 0E+3 0 -> 0 +samq1321 samequantum 0E+3 0E+3 -> 1 +samq1322 samequantum 0E+3 7E-3 -> 0 +samq1323 samequantum 0E+3 7 -> 0 +samq1324 samequantum 0E+3 7E+3 -> 1 +samq1325 samequantum 0E+3 sNaN -> 0 + +samq1410 samequantum 7E-3 -Inf -> 0 +samq1411 samequantum 7E-3 Inf -> 0 +samq1412 samequantum 7E-3 NaN -> 0 +samq1413 samequantum 7E-3 -7E+3 -> 0 +samq1414 samequantum 7E-3 -7 -> 0 +samq1415 samequantum 7E-3 -7E-3 -> 1 +samq1416 samequantum 7E-3 -0E-3 -> 1 +samq1417 samequantum 7E-3 -0 -> 0 +samq1418 samequantum 7E-3 -0E+3 -> 0 +samq1419 samequantum 7E-3 0E-3 -> 1 +samq1420 samequantum 7E-3 0 -> 0 +samq1421 samequantum 7E-3 0E+3 -> 0 +samq1422 samequantum 7E-3 7E-3 -> 1 +samq1423 samequantum 7E-3 7 -> 0 +samq1424 samequantum 7E-3 7E+3 -> 0 +samq1425 samequantum 7E-3 sNaN -> 0 + +samq1510 samequantum 7 -Inf -> 0 +samq1511 samequantum 7 Inf -> 0 +samq1512 samequantum 7 NaN -> 0 +samq1513 samequantum 7 -7E+3 -> 0 +samq1514 samequantum 7 -7 -> 1 +samq1515 samequantum 7 -7E-3 -> 0 +samq1516 samequantum 7 -0E-3 -> 0 +samq1517 samequantum 7 -0 -> 1 +samq1518 samequantum 7 -0E+3 -> 0 +samq1519 samequantum 7 0E-3 -> 0 +samq1520 samequantum 7 0 -> 1 +samq1521 samequantum 7 0E+3 -> 0 +samq1522 samequantum 7 7E-3 -> 0 +samq1523 samequantum 7 7 -> 1 +samq1524 samequantum 7 7E+3 -> 0 +samq1525 samequantum 7 sNaN -> 0 + +samq1610 samequantum 7E+3 -Inf -> 0 +samq1611 samequantum 7E+3 Inf -> 0 +samq1612 samequantum 7E+3 NaN -> 0 +samq1613 samequantum 7E+3 -7E+3 -> 1 +samq1614 samequantum 7E+3 -7 -> 0 +samq1615 samequantum 7E+3 -7E-3 -> 0 +samq1616 samequantum 7E+3 -0E-3 -> 0 +samq1617 samequantum 7E+3 -0 -> 0 +samq1618 samequantum 7E+3 -0E+3 -> 1 +samq1619 samequantum 7E+3 0E-3 -> 0 +samq1620 samequantum 7E+3 0 -> 0 +samq1621 samequantum 7E+3 0E+3 -> 1 +samq1622 samequantum 7E+3 7E-3 -> 0 +samq1623 samequantum 7E+3 7 -> 0 +samq1624 samequantum 7E+3 7E+3 -> 1 +samq1625 samequantum 7E+3 sNaN -> 0 + +samq1710 samequantum sNaN -Inf -> 0 +samq1711 samequantum sNaN Inf -> 0 +samq1712 samequantum sNaN NaN -> 1 +samq1713 samequantum sNaN -7E+3 -> 0 +samq1714 samequantum sNaN -7 -> 0 +samq1715 samequantum sNaN -7E-3 -> 0 +samq1716 samequantum sNaN -0E-3 -> 0 +samq1717 samequantum sNaN -0 -> 0 +samq1718 samequantum sNaN -0E+3 -> 0 +samq1719 samequantum sNaN 0E-3 -> 0 +samq1720 samequantum sNaN 0 -> 0 +samq1721 samequantum sNaN 0E+3 -> 0 +samq1722 samequantum sNaN 7E-3 -> 0 +samq1723 samequantum sNaN 7 -> 0 +samq1724 samequantum sNaN 7E+3 -> 0 +samq1725 samequantum sNaN sNaN -> 1 +-- noisy NaNs +samq1730 samequantum sNaN3 sNaN3 -> 1 +samq1731 samequantum sNaN3 sNaN4 -> 1 +samq1732 samequantum NaN3 NaN3 -> 1 +samq1733 samequantum NaN3 NaN4 -> 1 +samq1734 samequantum sNaN3 3 -> 0 +samq1735 samequantum NaN3 3 -> 0 +samq1736 samequantum 4 sNaN4 -> 0 +samq1737 samequantum 3 NaN3 -> 0 +samq1738 samequantum Inf sNaN4 -> 0 +samq1739 samequantum -Inf NaN3 -> 0 + + + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/scaleb.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/scaleb.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,200 @@ +------------------------------------------------------------------------ +-- scaleb.decTest -- scale a number by powers of 10 -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Max |rhs| is 2*(999+9) = 2016 + +-- Sanity checks +scbx001 scaleb 7.50 10 -> 7.50E+10 +scbx002 scaleb 7.50 3 -> 7.50E+3 +scbx003 scaleb 7.50 2 -> 750 +scbx004 scaleb 7.50 1 -> 75.0 +scbx005 scaleb 7.50 0 -> 7.50 +scbx006 scaleb 7.50 -1 -> 0.750 +scbx007 scaleb 7.50 -2 -> 0.0750 +scbx008 scaleb 7.50 -10 -> 7.50E-10 +scbx009 scaleb -7.50 3 -> -7.50E+3 +scbx010 scaleb -7.50 2 -> -750 +scbx011 scaleb -7.50 1 -> -75.0 +scbx012 scaleb -7.50 0 -> -7.50 +scbx013 scaleb -7.50 -1 -> -0.750 + +-- Infinities +scbx014 scaleb Infinity 1 -> Infinity +scbx015 scaleb -Infinity 2 -> -Infinity +scbx016 scaleb Infinity -1 -> Infinity +scbx017 scaleb -Infinity -2 -> -Infinity + +-- Next two are somewhat undefined in 754r; treat as non-integer +scbx018 scaleb 10 Infinity -> NaN Invalid_operation +scbx019 scaleb 10 -Infinity -> NaN Invalid_operation + +-- NaNs are undefined in 754r; assume usual processing +-- NaNs, 0 payload +scbx021 scaleb NaN 1 -> NaN +scbx022 scaleb -NaN -1 -> -NaN +scbx023 scaleb sNaN 1 -> NaN Invalid_operation +scbx024 scaleb -sNaN 1 -> -NaN Invalid_operation +scbx025 scaleb 4 NaN -> NaN +scbx026 scaleb -Inf -NaN -> -NaN +scbx027 scaleb 4 sNaN -> NaN Invalid_operation +scbx028 scaleb Inf -sNaN -> -NaN Invalid_operation + +-- non-integer RHS +scbx030 scaleb 1.23 1 -> 12.3 +scbx031 scaleb 1.23 1.00 -> NaN Invalid_operation +scbx032 scaleb 1.23 1.1 -> NaN Invalid_operation +scbx033 scaleb 1.23 1.01 -> NaN Invalid_operation +scbx034 scaleb 1.23 0.01 -> NaN Invalid_operation +scbx035 scaleb 1.23 0.11 -> NaN Invalid_operation +scbx036 scaleb 1.23 0.999999999 -> NaN Invalid_operation +scbx037 scaleb 1.23 -1 -> 0.123 +scbx038 scaleb 1.23 -1.00 -> NaN Invalid_operation +scbx039 scaleb 1.23 -1.1 -> NaN Invalid_operation +scbx040 scaleb 1.23 -1.01 -> NaN Invalid_operation +scbx041 scaleb 1.23 -0.01 -> NaN Invalid_operation +scbx042 scaleb 1.23 -0.11 -> NaN Invalid_operation +scbx043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation +scbx044 scaleb 1.23 0.1 -> NaN Invalid_operation +scbx045 scaleb 1.23 1E+1 -> NaN Invalid_operation +scbx046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation +scbx047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation + + +scbx120 scaleb 1.23 2015 -> Infinity Overflow Inexact Rounded +scbx121 scaleb 1.23 2016 -> Infinity Overflow Inexact Rounded +scbx122 scaleb 1.23 2017 -> NaN Invalid_operation +scbx123 scaleb 1.23 2018 -> NaN Invalid_operation +scbx124 scaleb 1.23 -2015 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped +scbx125 scaleb 1.23 -2016 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped +scbx126 scaleb 1.23 -2017 -> NaN Invalid_operation +scbx127 scaleb 1.23 -2018 -> NaN Invalid_operation + +-- NaNs, non-0 payload +-- propagating NaNs +scbx861 scaleb NaN01 -Inf -> NaN1 +scbx862 scaleb -NaN02 -1000 -> -NaN2 +scbx863 scaleb NaN03 1000 -> NaN3 +scbx864 scaleb NaN04 Inf -> NaN4 +scbx865 scaleb NaN05 NaN61 -> NaN5 +scbx866 scaleb -Inf -NaN71 -> -NaN71 +scbx867 scaleb -1000 NaN81 -> NaN81 +scbx868 scaleb 1000 NaN91 -> NaN91 +scbx869 scaleb Inf NaN101 -> NaN101 +scbx871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation +scbx872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation +scbx873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation +scbx874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation +scbx875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation +scbx876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation +scbx877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation +scbx878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation +scbx879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation +scbx880 scaleb Inf sNaN231 -> NaN231 Invalid_operation +scbx881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation + +-- finites +scbx051 scaleb 7 -2 -> 0.07 +scbx052 scaleb -7 -2 -> -0.07 +scbx053 scaleb 75 -2 -> 0.75 +scbx054 scaleb -75 -2 -> -0.75 +scbx055 scaleb 7.50 -2 -> 0.0750 +scbx056 scaleb -7.50 -2 -> -0.0750 +scbx057 scaleb 7.500 -2 -> 0.07500 +scbx058 scaleb -7.500 -2 -> -0.07500 +scbx061 scaleb 7 -1 -> 0.7 +scbx062 scaleb -7 -1 -> -0.7 +scbx063 scaleb 75 -1 -> 7.5 +scbx064 scaleb -75 -1 -> -7.5 +scbx065 scaleb 7.50 -1 -> 0.750 +scbx066 scaleb -7.50 -1 -> -0.750 +scbx067 scaleb 7.500 -1 -> 0.7500 +scbx068 scaleb -7.500 -1 -> -0.7500 +scbx071 scaleb 7 0 -> 7 +scbx072 scaleb -7 0 -> -7 +scbx073 scaleb 75 0 -> 75 +scbx074 scaleb -75 0 -> -75 +scbx075 scaleb 7.50 0 -> 7.50 +scbx076 scaleb -7.50 0 -> -7.50 +scbx077 scaleb 7.500 0 -> 7.500 +scbx078 scaleb -7.500 0 -> -7.500 +scbx081 scaleb 7 1 -> 7E+1 +scbx082 scaleb -7 1 -> -7E+1 +scbx083 scaleb 75 1 -> 7.5E+2 +scbx084 scaleb -75 1 -> -7.5E+2 +scbx085 scaleb 7.50 1 -> 75.0 +scbx086 scaleb -7.50 1 -> -75.0 +scbx087 scaleb 7.500 1 -> 75.00 +scbx088 scaleb -7.500 1 -> -75.00 +scbx091 scaleb 7 2 -> 7E+2 +scbx092 scaleb -7 2 -> -7E+2 +scbx093 scaleb 75 2 -> 7.5E+3 +scbx094 scaleb -75 2 -> -7.5E+3 +scbx095 scaleb 7.50 2 -> 750 +scbx096 scaleb -7.50 2 -> -750 +scbx097 scaleb 7.500 2 -> 750.0 +scbx098 scaleb -7.500 2 -> -750.0 + +-- zeros +scbx111 scaleb 0 1 -> 0E+1 +scbx112 scaleb -0 2 -> -0E+2 +scbx113 scaleb 0E+4 3 -> 0E+7 +scbx114 scaleb -0E+4 4 -> -0E+8 +scbx115 scaleb 0.0000 5 -> 0E+1 +scbx116 scaleb -0.0000 6 -> -0E+2 +scbx117 scaleb 0E-141 7 -> 0E-134 +scbx118 scaleb -0E-141 8 -> -0E-133 + +-- Nmax, Nmin, Ntiny +scbx132 scaleb 9.99999999E+999 +999 -> Infinity Overflow Inexact Rounded +scbx133 scaleb 9.99999999E+999 +10 -> Infinity Overflow Inexact Rounded +scbx134 scaleb 9.99999999E+999 +1 -> Infinity Overflow Inexact Rounded +scbx135 scaleb 9.99999999E+999 0 -> 9.99999999E+999 +scbx136 scaleb 9.99999999E+999 -1 -> 9.99999999E+998 +scbx137 scaleb 1E-999 +1 -> 1E-998 +scbx138 scaleb 1E-999 -0 -> 1E-999 +scbx139 scaleb 1E-999 -1 -> 1E-1000 Subnormal +scbx140 scaleb 1.00000000E-999 +1 -> 1.00000000E-998 +scbx141 scaleb 1.00000000E-999 0 -> 1.00000000E-999 +scbx142 scaleb 1.00000000E-999 -1 -> 1.0000000E-1000 Subnormal Rounded +scbx143 scaleb 1E-1007 +1 -> 1E-1006 Subnormal +scbx144 scaleb 1E-1007 -0 -> 1E-1007 Subnormal +scbx145 scaleb 1E-1007 -1 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped + +scbx150 scaleb -1E-1007 +1 -> -1E-1006 Subnormal +scbx151 scaleb -1E-1007 -0 -> -1E-1007 Subnormal +scbx152 scaleb -1E-1007 -1 -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped +scbx153 scaleb -1.00000000E-999 +1 -> -1.00000000E-998 +scbx154 scaleb -1.00000000E-999 +0 -> -1.00000000E-999 +scbx155 scaleb -1.00000000E-999 -1 -> -1.0000000E-1000 Subnormal Rounded +scbx156 scaleb -1E-999 +1 -> -1E-998 +scbx157 scaleb -1E-999 -0 -> -1E-999 +scbx158 scaleb -1E-999 -1 -> -1E-1000 Subnormal +scbx159 scaleb -9.99999999E+999 +1 -> -Infinity Overflow Inexact Rounded +scbx160 scaleb -9.99999999E+999 +0 -> -9.99999999E+999 +scbx161 scaleb -9.99999999E+999 -1 -> -9.99999999E+998 +scbx162 scaleb -9E+999 +1 -> -Infinity Overflow Inexact Rounded +scbx163 scaleb -1E+999 +1 -> -Infinity Overflow Inexact Rounded Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/shift.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/shift.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,250 @@ +------------------------------------------------------------------------ +-- shift.decTest -- shift coefficient left or right -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check +shix001 shift 0 0 -> 0 +shix002 shift 0 2 -> 0 +shix003 shift 1 2 -> 100 +shix004 shift 1 8 -> 100000000 +shix005 shift 1 9 -> 0 +shix006 shift 1 -1 -> 0 +shix007 shift 123456789 -1 -> 12345678 +shix008 shift 123456789 -8 -> 1 +shix009 shift 123456789 -9 -> 0 +shix010 shift 0 -2 -> 0 + +-- rhs must be an integer +shix011 shift 1 1.5 -> NaN Invalid_operation +shix012 shift 1 1.0 -> NaN Invalid_operation +shix013 shift 1 0.1 -> NaN Invalid_operation +shix014 shift 1 0.0 -> NaN Invalid_operation +shix015 shift 1 1E+1 -> NaN Invalid_operation +shix016 shift 1 1E+99 -> NaN Invalid_operation +shix017 shift 1 Inf -> NaN Invalid_operation +shix018 shift 1 -Inf -> NaN Invalid_operation +-- and |rhs| <= precision +shix020 shift 1 -1000 -> NaN Invalid_operation +shix021 shift 1 -10 -> NaN Invalid_operation +shix022 shift 1 10 -> NaN Invalid_operation +shix023 shift 1 1000 -> NaN Invalid_operation + +-- full shifting pattern +shix030 shift 123456789 -9 -> 0 +shix031 shift 123456789 -8 -> 1 +shix032 shift 123456789 -7 -> 12 +shix033 shift 123456789 -6 -> 123 +shix034 shift 123456789 -5 -> 1234 +shix035 shift 123456789 -4 -> 12345 +shix036 shift 123456789 -3 -> 123456 +shix037 shift 123456789 -2 -> 1234567 +shix038 shift 123456789 -1 -> 12345678 +shix039 shift 123456789 -0 -> 123456789 +shix040 shift 123456789 +0 -> 123456789 +shix041 shift 123456789 +1 -> 234567890 +shix042 shift 123456789 +2 -> 345678900 +shix043 shift 123456789 +3 -> 456789000 +shix044 shift 123456789 +4 -> 567890000 +shix045 shift 123456789 +5 -> 678900000 +shix046 shift 123456789 +6 -> 789000000 +shix047 shift 123456789 +7 -> 890000000 +shix048 shift 123456789 +8 -> 900000000 +shix049 shift 123456789 +9 -> 0 + +-- from examples +shix051 shift 34 8 -> '400000000' +shix052 shift 12 9 -> '0' +shix053 shift 123456789 -2 -> '1234567' +shix054 shift 123456789 0 -> '123456789' +shix055 shift 123456789 +2 -> '345678900' + +-- zeros +shix060 shift 0E-10 +9 -> 0E-10 +shix061 shift 0E-10 -9 -> 0E-10 +shix062 shift 0.000 +9 -> 0.000 +shix063 shift 0.000 -9 -> 0.000 +shix064 shift 0E+10 +9 -> 0E+10 +shix065 shift 0E+10 -9 -> 0E+10 +shix066 shift -0E-10 +9 -> -0E-10 +shix067 shift -0E-10 -9 -> -0E-10 +shix068 shift -0.000 +9 -> -0.000 +shix069 shift -0.000 -9 -> -0.000 +shix070 shift -0E+10 +9 -> -0E+10 +shix071 shift -0E+10 -9 -> -0E+10 + +-- Nmax, Nmin, Ntiny +shix141 shift 9.99999999E+999 -1 -> 9.9999999E+998 +shix142 shift 9.99999999E+999 -8 -> 9E+991 +shix143 shift 9.99999999E+999 1 -> 9.99999990E+999 +shix144 shift 9.99999999E+999 8 -> 9.00000000E+999 +shix145 shift 1E-999 -1 -> 0E-999 +shix146 shift 1E-999 -8 -> 0E-999 +shix147 shift 1E-999 1 -> 1.0E-998 +shix148 shift 1E-999 8 -> 1.00000000E-991 +shix151 shift 1.00000000E-999 -1 -> 1.0000000E-1000 +shix152 shift 1.00000000E-999 -8 -> 1E-1007 +shix153 shift 1.00000000E-999 1 -> 0E-1007 +shix154 shift 1.00000000E-999 8 -> 0E-1007 +shix155 shift 9.00000000E-999 -1 -> 9.0000000E-1000 +shix156 shift 9.00000000E-999 -8 -> 9E-1007 +shix157 shift 9.00000000E-999 1 -> 0E-1007 +shix158 shift 9.00000000E-999 8 -> 0E-1007 +shix160 shift 1E-1007 -1 -> 0E-1007 +shix161 shift 1E-1007 -8 -> 0E-1007 +shix162 shift 1E-1007 1 -> 1.0E-1006 +shix163 shift 1E-1007 8 -> 1.00000000E-999 +-- negatives +shix171 shift -9.99999999E+999 -1 -> -9.9999999E+998 +shix172 shift -9.99999999E+999 -8 -> -9E+991 +shix173 shift -9.99999999E+999 1 -> -9.99999990E+999 +shix174 shift -9.99999999E+999 8 -> -9.00000000E+999 +shix175 shift -1E-999 -1 -> -0E-999 +shix176 shift -1E-999 -8 -> -0E-999 +shix177 shift -1E-999 1 -> -1.0E-998 +shix178 shift -1E-999 8 -> -1.00000000E-991 +shix181 shift -1.00000000E-999 -1 -> -1.0000000E-1000 +shix182 shift -1.00000000E-999 -8 -> -1E-1007 +shix183 shift -1.00000000E-999 1 -> -0E-1007 +shix184 shift -1.00000000E-999 8 -> -0E-1007 +shix185 shift -9.00000000E-999 -1 -> -9.0000000E-1000 +shix186 shift -9.00000000E-999 -8 -> -9E-1007 +shix187 shift -9.00000000E-999 1 -> -0E-1007 +shix188 shift -9.00000000E-999 8 -> -0E-1007 +shix190 shift -1E-1007 -1 -> -0E-1007 +shix191 shift -1E-1007 -8 -> -0E-1007 +shix192 shift -1E-1007 1 -> -1.0E-1006 +shix193 shift -1E-1007 8 -> -1.00000000E-999 + +-- more negatives (of sanities) +shix201 shift -0 0 -> -0 +shix202 shift -0 2 -> -0 +shix203 shift -1 2 -> -100 +shix204 shift -1 8 -> -100000000 +shix205 shift -1 9 -> -0 +shix206 shift -1 -1 -> -0 +shix207 shift -123456789 -1 -> -12345678 +shix208 shift -123456789 -8 -> -1 +shix209 shift -123456789 -9 -> -0 +shix210 shift -0 -2 -> -0 +shix211 shift -0 -0 -> -0 + + +-- Specials; NaNs are handled as usual +shix781 shift -Inf -8 -> -Infinity +shix782 shift -Inf -1 -> -Infinity +shix783 shift -Inf -0 -> -Infinity +shix784 shift -Inf 0 -> -Infinity +shix785 shift -Inf 1 -> -Infinity +shix786 shift -Inf 8 -> -Infinity +shix787 shift -1000 -Inf -> NaN Invalid_operation +shix788 shift -Inf -Inf -> NaN Invalid_operation +shix789 shift -1 -Inf -> NaN Invalid_operation +shix790 shift -0 -Inf -> NaN Invalid_operation +shix791 shift 0 -Inf -> NaN Invalid_operation +shix792 shift 1 -Inf -> NaN Invalid_operation +shix793 shift 1000 -Inf -> NaN Invalid_operation +shix794 shift Inf -Inf -> NaN Invalid_operation + +shix800 shift Inf -Inf -> NaN Invalid_operation +shix801 shift Inf -8 -> Infinity +shix802 shift Inf -1 -> Infinity +shix803 shift Inf -0 -> Infinity +shix804 shift Inf 0 -> Infinity +shix805 shift Inf 1 -> Infinity +shix806 shift Inf 8 -> Infinity +shix807 shift Inf Inf -> NaN Invalid_operation +shix808 shift -1000 Inf -> NaN Invalid_operation +shix809 shift -Inf Inf -> NaN Invalid_operation +shix810 shift -1 Inf -> NaN Invalid_operation +shix811 shift -0 Inf -> NaN Invalid_operation +shix812 shift 0 Inf -> NaN Invalid_operation +shix813 shift 1 Inf -> NaN Invalid_operation +shix814 shift 1000 Inf -> NaN Invalid_operation +shix815 shift Inf Inf -> NaN Invalid_operation + +shix821 shift NaN -Inf -> NaN +shix822 shift NaN -1000 -> NaN +shix823 shift NaN -1 -> NaN +shix824 shift NaN -0 -> NaN +shix825 shift NaN 0 -> NaN +shix826 shift NaN 1 -> NaN +shix827 shift NaN 1000 -> NaN +shix828 shift NaN Inf -> NaN +shix829 shift NaN NaN -> NaN +shix830 shift -Inf NaN -> NaN +shix831 shift -1000 NaN -> NaN +shix832 shift -1 NaN -> NaN +shix833 shift -0 NaN -> NaN +shix834 shift 0 NaN -> NaN +shix835 shift 1 NaN -> NaN +shix836 shift 1000 NaN -> NaN +shix837 shift Inf NaN -> NaN + +shix841 shift sNaN -Inf -> NaN Invalid_operation +shix842 shift sNaN -1000 -> NaN Invalid_operation +shix843 shift sNaN -1 -> NaN Invalid_operation +shix844 shift sNaN -0 -> NaN Invalid_operation +shix845 shift sNaN 0 -> NaN Invalid_operation +shix846 shift sNaN 1 -> NaN Invalid_operation +shix847 shift sNaN 1000 -> NaN Invalid_operation +shix848 shift sNaN NaN -> NaN Invalid_operation +shix849 shift sNaN sNaN -> NaN Invalid_operation +shix850 shift NaN sNaN -> NaN Invalid_operation +shix851 shift -Inf sNaN -> NaN Invalid_operation +shix852 shift -1000 sNaN -> NaN Invalid_operation +shix853 shift -1 sNaN -> NaN Invalid_operation +shix854 shift -0 sNaN -> NaN Invalid_operation +shix855 shift 0 sNaN -> NaN Invalid_operation +shix856 shift 1 sNaN -> NaN Invalid_operation +shix857 shift 1000 sNaN -> NaN Invalid_operation +shix858 shift Inf sNaN -> NaN Invalid_operation +shix859 shift NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +shix861 shift NaN1 -Inf -> NaN1 +shix862 shift +NaN2 -1000 -> NaN2 +shix863 shift NaN3 1000 -> NaN3 +shix864 shift NaN4 Inf -> NaN4 +shix865 shift NaN5 +NaN6 -> NaN5 +shix866 shift -Inf NaN7 -> NaN7 +shix867 shift -1000 NaN8 -> NaN8 +shix868 shift 1000 NaN9 -> NaN9 +shix869 shift Inf +NaN10 -> NaN10 +shix871 shift sNaN11 -Inf -> NaN11 Invalid_operation +shix872 shift sNaN12 -1000 -> NaN12 Invalid_operation +shix873 shift sNaN13 1000 -> NaN13 Invalid_operation +shix874 shift sNaN14 NaN17 -> NaN14 Invalid_operation +shix875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation +shix876 shift NaN16 sNaN19 -> NaN19 Invalid_operation +shix877 shift -Inf +sNaN20 -> NaN20 Invalid_operation +shix878 shift -1000 sNaN21 -> NaN21 Invalid_operation +shix879 shift 1000 sNaN22 -> NaN22 Invalid_operation +shix880 shift Inf sNaN23 -> NaN23 Invalid_operation +shix881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation +shix882 shift -NaN26 NaN28 -> -NaN26 +shix883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation +shix884 shift 1000 -NaN30 -> -NaN30 +shix885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/squareroot.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/squareroot.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,3824 @@ +------------------------------------------------------------------------ +-- squareroot.decTest -- decimal square root -- +-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- basics +sqtx001 squareroot 1 -> 1 +sqtx002 squareroot -1 -> NaN Invalid_operation +sqtx003 squareroot 1.00 -> 1.0 +sqtx004 squareroot -1.00 -> NaN Invalid_operation +sqtx005 squareroot 0 -> 0 +sqtx006 squareroot 00.0 -> 0.0 +sqtx007 squareroot 0.00 -> 0.0 +sqtx008 squareroot 00.00 -> 0.0 +sqtx009 squareroot 00.000 -> 0.00 +sqtx010 squareroot 00.0000 -> 0.00 +sqtx011 squareroot 00 -> 0 + +sqtx012 squareroot -2 -> NaN Invalid_operation +sqtx013 squareroot 2 -> 1.41421356 Inexact Rounded +sqtx014 squareroot -2.00 -> NaN Invalid_operation +sqtx015 squareroot 2.00 -> 1.41421356 Inexact Rounded +sqtx016 squareroot -0 -> -0 +sqtx017 squareroot -0.0 -> -0.0 +sqtx018 squareroot -00.00 -> -0.0 +sqtx019 squareroot -00.000 -> -0.00 +sqtx020 squareroot -0.0000 -> -0.00 +sqtx021 squareroot -0E+9 -> -0E+4 +sqtx022 squareroot -0E+10 -> -0E+5 +sqtx023 squareroot -0E+11 -> -0E+5 +sqtx024 squareroot -0E+12 -> -0E+6 +sqtx025 squareroot -00 -> -0 +sqtx026 squareroot 0E+5 -> 0E+2 +sqtx027 squareroot 4.0 -> 2.0 +sqtx028 squareroot 4.00 -> 2.0 + +sqtx030 squareroot +0.1 -> 0.316227766 Inexact Rounded +sqtx031 squareroot -0.1 -> NaN Invalid_operation +sqtx032 squareroot +0.01 -> 0.1 +sqtx033 squareroot -0.01 -> NaN Invalid_operation +sqtx034 squareroot +0.001 -> 0.0316227766 Inexact Rounded +sqtx035 squareroot -0.001 -> NaN Invalid_operation +sqtx036 squareroot +0.000001 -> 0.001 +sqtx037 squareroot -0.000001 -> NaN Invalid_operation +sqtx038 squareroot +0.000000000001 -> 0.000001 +sqtx039 squareroot -0.000000000001 -> NaN Invalid_operation + +sqtx041 squareroot 1.1 -> 1.04880885 Inexact Rounded +sqtx042 squareroot 1.10 -> 1.04880885 Inexact Rounded +sqtx043 squareroot 1.100 -> 1.04880885 Inexact Rounded +sqtx044 squareroot 1.110 -> 1.05356538 Inexact Rounded +sqtx045 squareroot -1.1 -> NaN Invalid_operation +sqtx046 squareroot -1.10 -> NaN Invalid_operation +sqtx047 squareroot -1.100 -> NaN Invalid_operation +sqtx048 squareroot -1.110 -> NaN Invalid_operation +sqtx049 squareroot 9.9 -> 3.14642654 Inexact Rounded +sqtx050 squareroot 9.90 -> 3.14642654 Inexact Rounded +sqtx051 squareroot 9.900 -> 3.14642654 Inexact Rounded +sqtx052 squareroot 9.990 -> 3.16069613 Inexact Rounded +sqtx053 squareroot -9.9 -> NaN Invalid_operation +sqtx054 squareroot -9.90 -> NaN Invalid_operation +sqtx055 squareroot -9.900 -> NaN Invalid_operation +sqtx056 squareroot -9.990 -> NaN Invalid_operation + +sqtx060 squareroot 1 -> 1 +sqtx061 squareroot 1.0 -> 1.0 +sqtx062 squareroot 1.00 -> 1.0 +sqtx063 squareroot 10.0 -> 3.16227766 Inexact Rounded +sqtx064 squareroot 10.0 -> 3.16227766 Inexact Rounded +sqtx065 squareroot 10.0 -> 3.16227766 Inexact Rounded +sqtx066 squareroot 10.00 -> 3.16227766 Inexact Rounded +sqtx067 squareroot 100 -> 10 +sqtx068 squareroot 100.0 -> 10.0 +sqtx069 squareroot 100.00 -> 10.0 +sqtx070 squareroot 1.1000E+3 -> 33.1662479 Inexact Rounded +sqtx071 squareroot 1.10000E+3 -> 33.1662479 Inexact Rounded +sqtx072 squareroot -10.0 -> NaN Invalid_operation +sqtx073 squareroot -10.00 -> NaN Invalid_operation +sqtx074 squareroot -100.0 -> NaN Invalid_operation +sqtx075 squareroot -100.00 -> NaN Invalid_operation +sqtx076 squareroot -1.1000E+3 -> NaN Invalid_operation +sqtx077 squareroot -1.10000E+3 -> NaN Invalid_operation +sqtx078 squareroot 1.000 -> 1.00 +sqtx079 squareroot 1.0000 -> 1.00 + +-- famous squares +sqtx080 squareroot 1 -> 1 +sqtx081 squareroot 4 -> 2 +sqtx082 squareroot 9 -> 3 +sqtx083 squareroot 16 -> 4 +sqtx084 squareroot 25 -> 5 +sqtx085 squareroot 36 -> 6 +sqtx086 squareroot 49 -> 7 +sqtx087 squareroot 64 -> 8 +sqtx088 squareroot 81 -> 9 +sqtx089 squareroot 100 -> 10 +sqtx090 squareroot 121 -> 11 +sqtx091 squareroot 144 -> 12 +sqtx092 squareroot 169 -> 13 +sqtx093 squareroot 256 -> 16 +sqtx094 squareroot 1024 -> 32 +sqtx095 squareroot 4096 -> 64 +sqtx100 squareroot 0.01 -> 0.1 +sqtx101 squareroot 0.04 -> 0.2 +sqtx102 squareroot 0.09 -> 0.3 +sqtx103 squareroot 0.16 -> 0.4 +sqtx104 squareroot 0.25 -> 0.5 +sqtx105 squareroot 0.36 -> 0.6 +sqtx106 squareroot 0.49 -> 0.7 +sqtx107 squareroot 0.64 -> 0.8 +sqtx108 squareroot 0.81 -> 0.9 +sqtx109 squareroot 1.00 -> 1.0 +sqtx110 squareroot 1.21 -> 1.1 +sqtx111 squareroot 1.44 -> 1.2 +sqtx112 squareroot 1.69 -> 1.3 +sqtx113 squareroot 2.56 -> 1.6 +sqtx114 squareroot 10.24 -> 3.2 +sqtx115 squareroot 40.96 -> 6.4 + +-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 1 +sqtx1201 squareroot 0.1 -> 0.3 Inexact Rounded +sqtx1202 squareroot 0.01 -> 0.1 +sqtx1203 squareroot 1.0E-1 -> 0.3 Inexact Rounded +sqtx1204 squareroot 1.00E-2 -> 0.1 Rounded +sqtx1205 squareroot 1E-3 -> 0.03 Inexact Rounded +sqtx1206 squareroot 1E+1 -> 3 Inexact Rounded +sqtx1207 squareroot 1E+2 -> 1E+1 +sqtx1208 squareroot 1E+3 -> 3E+1 Inexact Rounded +sqtx1209 squareroot 0.2 -> 0.4 Inexact Rounded +sqtx1210 squareroot 0.02 -> 0.1 Inexact Rounded +sqtx1211 squareroot 2.0E-1 -> 0.4 Inexact Rounded +sqtx1212 squareroot 2.00E-2 -> 0.1 Inexact Rounded +sqtx1213 squareroot 2E-3 -> 0.04 Inexact Rounded +sqtx1214 squareroot 2E+1 -> 4 Inexact Rounded +sqtx1215 squareroot 2E+2 -> 1E+1 Inexact Rounded +sqtx1216 squareroot 2E+3 -> 4E+1 Inexact Rounded +sqtx1217 squareroot 0.3 -> 0.5 Inexact Rounded +sqtx1218 squareroot 0.03 -> 0.2 Inexact Rounded +sqtx1219 squareroot 3.0E-1 -> 0.5 Inexact Rounded +sqtx1220 squareroot 3.00E-2 -> 0.2 Inexact Rounded +sqtx1221 squareroot 3E-3 -> 0.05 Inexact Rounded +sqtx1222 squareroot 3E+1 -> 5 Inexact Rounded +sqtx1223 squareroot 3E+2 -> 2E+1 Inexact Rounded +sqtx1224 squareroot 3E+3 -> 5E+1 Inexact Rounded +sqtx1225 squareroot 0.4 -> 0.6 Inexact Rounded +sqtx1226 squareroot 0.04 -> 0.2 +sqtx1227 squareroot 4.0E-1 -> 0.6 Inexact Rounded +sqtx1228 squareroot 4.00E-2 -> 0.2 Rounded +sqtx1229 squareroot 4E-3 -> 0.06 Inexact Rounded +sqtx1230 squareroot 4E+1 -> 6 Inexact Rounded +sqtx1231 squareroot 4E+2 -> 2E+1 +sqtx1232 squareroot 4E+3 -> 6E+1 Inexact Rounded +sqtx1233 squareroot 0.5 -> 0.7 Inexact Rounded +sqtx1234 squareroot 0.05 -> 0.2 Inexact Rounded +sqtx1235 squareroot 5.0E-1 -> 0.7 Inexact Rounded +sqtx1236 squareroot 5.00E-2 -> 0.2 Inexact Rounded +sqtx1237 squareroot 5E-3 -> 0.07 Inexact Rounded +sqtx1238 squareroot 5E+1 -> 7 Inexact Rounded +sqtx1239 squareroot 5E+2 -> 2E+1 Inexact Rounded +sqtx1240 squareroot 5E+3 -> 7E+1 Inexact Rounded +sqtx1241 squareroot 0.6 -> 0.8 Inexact Rounded +sqtx1242 squareroot 0.06 -> 0.2 Inexact Rounded +sqtx1243 squareroot 6.0E-1 -> 0.8 Inexact Rounded +sqtx1244 squareroot 6.00E-2 -> 0.2 Inexact Rounded +sqtx1245 squareroot 6E-3 -> 0.08 Inexact Rounded +sqtx1246 squareroot 6E+1 -> 8 Inexact Rounded +sqtx1247 squareroot 6E+2 -> 2E+1 Inexact Rounded +sqtx1248 squareroot 6E+3 -> 8E+1 Inexact Rounded +sqtx1249 squareroot 0.7 -> 0.8 Inexact Rounded +sqtx1250 squareroot 0.07 -> 0.3 Inexact Rounded +sqtx1251 squareroot 7.0E-1 -> 0.8 Inexact Rounded +sqtx1252 squareroot 7.00E-2 -> 0.3 Inexact Rounded +sqtx1253 squareroot 7E-3 -> 0.08 Inexact Rounded +sqtx1254 squareroot 7E+1 -> 8 Inexact Rounded +sqtx1255 squareroot 7E+2 -> 3E+1 Inexact Rounded +sqtx1256 squareroot 7E+3 -> 8E+1 Inexact Rounded +sqtx1257 squareroot 0.8 -> 0.9 Inexact Rounded +sqtx1258 squareroot 0.08 -> 0.3 Inexact Rounded +sqtx1259 squareroot 8.0E-1 -> 0.9 Inexact Rounded +sqtx1260 squareroot 8.00E-2 -> 0.3 Inexact Rounded +sqtx1261 squareroot 8E-3 -> 0.09 Inexact Rounded +sqtx1262 squareroot 8E+1 -> 9 Inexact Rounded +sqtx1263 squareroot 8E+2 -> 3E+1 Inexact Rounded +sqtx1264 squareroot 8E+3 -> 9E+1 Inexact Rounded +sqtx1265 squareroot 0.9 -> 0.9 Inexact Rounded +sqtx1266 squareroot 0.09 -> 0.3 +sqtx1267 squareroot 9.0E-1 -> 0.9 Inexact Rounded +sqtx1268 squareroot 9.00E-2 -> 0.3 Rounded +sqtx1269 squareroot 9E-3 -> 0.09 Inexact Rounded +sqtx1270 squareroot 9E+1 -> 9 Inexact Rounded +sqtx1271 squareroot 9E+2 -> 3E+1 +sqtx1272 squareroot 9E+3 -> 9E+1 Inexact Rounded + +-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 2 +sqtx2201 squareroot 0.1 -> 0.32 Inexact Rounded +sqtx2202 squareroot 0.01 -> 0.1 +sqtx2203 squareroot 1.0E-1 -> 0.32 Inexact Rounded +sqtx2204 squareroot 1.00E-2 -> 0.10 +sqtx2205 squareroot 1E-3 -> 0.032 Inexact Rounded +sqtx2206 squareroot 1E+1 -> 3.2 Inexact Rounded +sqtx2207 squareroot 1E+2 -> 1E+1 +sqtx2208 squareroot 1E+3 -> 32 Inexact Rounded +sqtx2209 squareroot 0.2 -> 0.45 Inexact Rounded +sqtx2210 squareroot 0.02 -> 0.14 Inexact Rounded +sqtx2211 squareroot 2.0E-1 -> 0.45 Inexact Rounded +sqtx2212 squareroot 2.00E-2 -> 0.14 Inexact Rounded +sqtx2213 squareroot 2E-3 -> 0.045 Inexact Rounded +sqtx2214 squareroot 2E+1 -> 4.5 Inexact Rounded +sqtx2215 squareroot 2E+2 -> 14 Inexact Rounded +sqtx2216 squareroot 2E+3 -> 45 Inexact Rounded +sqtx2217 squareroot 0.3 -> 0.55 Inexact Rounded +sqtx2218 squareroot 0.03 -> 0.17 Inexact Rounded +sqtx2219 squareroot 3.0E-1 -> 0.55 Inexact Rounded +sqtx2220 squareroot 3.00E-2 -> 0.17 Inexact Rounded +sqtx2221 squareroot 3E-3 -> 0.055 Inexact Rounded +sqtx2222 squareroot 3E+1 -> 5.5 Inexact Rounded +sqtx2223 squareroot 3E+2 -> 17 Inexact Rounded +sqtx2224 squareroot 3E+3 -> 55 Inexact Rounded +sqtx2225 squareroot 0.4 -> 0.63 Inexact Rounded +sqtx2226 squareroot 0.04 -> 0.2 +sqtx2227 squareroot 4.0E-1 -> 0.63 Inexact Rounded +sqtx2228 squareroot 4.00E-2 -> 0.20 +sqtx2229 squareroot 4E-3 -> 0.063 Inexact Rounded +sqtx2230 squareroot 4E+1 -> 6.3 Inexact Rounded +sqtx2231 squareroot 4E+2 -> 2E+1 +sqtx2232 squareroot 4E+3 -> 63 Inexact Rounded +sqtx2233 squareroot 0.5 -> 0.71 Inexact Rounded +sqtx2234 squareroot 0.05 -> 0.22 Inexact Rounded +sqtx2235 squareroot 5.0E-1 -> 0.71 Inexact Rounded +sqtx2236 squareroot 5.00E-2 -> 0.22 Inexact Rounded +sqtx2237 squareroot 5E-3 -> 0.071 Inexact Rounded +sqtx2238 squareroot 5E+1 -> 7.1 Inexact Rounded +sqtx2239 squareroot 5E+2 -> 22 Inexact Rounded +sqtx2240 squareroot 5E+3 -> 71 Inexact Rounded +sqtx2241 squareroot 0.6 -> 0.77 Inexact Rounded +sqtx2242 squareroot 0.06 -> 0.24 Inexact Rounded +sqtx2243 squareroot 6.0E-1 -> 0.77 Inexact Rounded +sqtx2244 squareroot 6.00E-2 -> 0.24 Inexact Rounded +sqtx2245 squareroot 6E-3 -> 0.077 Inexact Rounded +sqtx2246 squareroot 6E+1 -> 7.7 Inexact Rounded +sqtx2247 squareroot 6E+2 -> 24 Inexact Rounded +sqtx2248 squareroot 6E+3 -> 77 Inexact Rounded +sqtx2249 squareroot 0.7 -> 0.84 Inexact Rounded +sqtx2250 squareroot 0.07 -> 0.26 Inexact Rounded +sqtx2251 squareroot 7.0E-1 -> 0.84 Inexact Rounded +sqtx2252 squareroot 7.00E-2 -> 0.26 Inexact Rounded +sqtx2253 squareroot 7E-3 -> 0.084 Inexact Rounded +sqtx2254 squareroot 7E+1 -> 8.4 Inexact Rounded +sqtx2255 squareroot 7E+2 -> 26 Inexact Rounded +sqtx2256 squareroot 7E+3 -> 84 Inexact Rounded +sqtx2257 squareroot 0.8 -> 0.89 Inexact Rounded +sqtx2258 squareroot 0.08 -> 0.28 Inexact Rounded +sqtx2259 squareroot 8.0E-1 -> 0.89 Inexact Rounded +sqtx2260 squareroot 8.00E-2 -> 0.28 Inexact Rounded +sqtx2261 squareroot 8E-3 -> 0.089 Inexact Rounded +sqtx2262 squareroot 8E+1 -> 8.9 Inexact Rounded +sqtx2263 squareroot 8E+2 -> 28 Inexact Rounded +sqtx2264 squareroot 8E+3 -> 89 Inexact Rounded +sqtx2265 squareroot 0.9 -> 0.95 Inexact Rounded +sqtx2266 squareroot 0.09 -> 0.3 +sqtx2267 squareroot 9.0E-1 -> 0.95 Inexact Rounded +sqtx2268 squareroot 9.00E-2 -> 0.30 +sqtx2269 squareroot 9E-3 -> 0.095 Inexact Rounded +sqtx2270 squareroot 9E+1 -> 9.5 Inexact Rounded +sqtx2271 squareroot 9E+2 -> 3E+1 +sqtx2272 squareroot 9E+3 -> 95 Inexact Rounded +sqtx2273 squareroot 0.10 -> 0.32 Inexact Rounded +sqtx2274 squareroot 0.010 -> 0.10 +sqtx2275 squareroot 10.0E-1 -> 1.0 +sqtx2276 squareroot 10.00E-2 -> 0.32 Inexact Rounded +sqtx2277 squareroot 10E-3 -> 0.10 +sqtx2278 squareroot 10E+1 -> 10 +sqtx2279 squareroot 10E+2 -> 32 Inexact Rounded +sqtx2280 squareroot 10E+3 -> 1.0E+2 +sqtx2281 squareroot 0.11 -> 0.33 Inexact Rounded +sqtx2282 squareroot 0.011 -> 0.10 Inexact Rounded +sqtx2283 squareroot 11.0E-1 -> 1.0 Inexact Rounded +sqtx2284 squareroot 11.00E-2 -> 0.33 Inexact Rounded +sqtx2285 squareroot 11E-3 -> 0.10 Inexact Rounded +sqtx2286 squareroot 11E+1 -> 10 Inexact Rounded +sqtx2287 squareroot 11E+2 -> 33 Inexact Rounded +sqtx2288 squareroot 11E+3 -> 1.0E+2 Inexact Rounded +sqtx2289 squareroot 0.12 -> 0.35 Inexact Rounded +sqtx2290 squareroot 0.012 -> 0.11 Inexact Rounded +sqtx2291 squareroot 12.0E-1 -> 1.1 Inexact Rounded +sqtx2292 squareroot 12.00E-2 -> 0.35 Inexact Rounded +sqtx2293 squareroot 12E-3 -> 0.11 Inexact Rounded +sqtx2294 squareroot 12E+1 -> 11 Inexact Rounded +sqtx2295 squareroot 12E+2 -> 35 Inexact Rounded +sqtx2296 squareroot 12E+3 -> 1.1E+2 Inexact Rounded +sqtx2297 squareroot 0.13 -> 0.36 Inexact Rounded +sqtx2298 squareroot 0.013 -> 0.11 Inexact Rounded +sqtx2299 squareroot 13.0E-1 -> 1.1 Inexact Rounded +sqtx2300 squareroot 13.00E-2 -> 0.36 Inexact Rounded +sqtx2301 squareroot 13E-3 -> 0.11 Inexact Rounded +sqtx2302 squareroot 13E+1 -> 11 Inexact Rounded +sqtx2303 squareroot 13E+2 -> 36 Inexact Rounded +sqtx2304 squareroot 13E+3 -> 1.1E+2 Inexact Rounded +sqtx2305 squareroot 0.14 -> 0.37 Inexact Rounded +sqtx2306 squareroot 0.014 -> 0.12 Inexact Rounded +sqtx2307 squareroot 14.0E-1 -> 1.2 Inexact Rounded +sqtx2308 squareroot 14.00E-2 -> 0.37 Inexact Rounded +sqtx2309 squareroot 14E-3 -> 0.12 Inexact Rounded +sqtx2310 squareroot 14E+1 -> 12 Inexact Rounded +sqtx2311 squareroot 14E+2 -> 37 Inexact Rounded +sqtx2312 squareroot 14E+3 -> 1.2E+2 Inexact Rounded +sqtx2313 squareroot 0.15 -> 0.39 Inexact Rounded +sqtx2314 squareroot 0.015 -> 0.12 Inexact Rounded +sqtx2315 squareroot 15.0E-1 -> 1.2 Inexact Rounded +sqtx2316 squareroot 15.00E-2 -> 0.39 Inexact Rounded +sqtx2317 squareroot 15E-3 -> 0.12 Inexact Rounded +sqtx2318 squareroot 15E+1 -> 12 Inexact Rounded +sqtx2319 squareroot 15E+2 -> 39 Inexact Rounded +sqtx2320 squareroot 15E+3 -> 1.2E+2 Inexact Rounded +sqtx2321 squareroot 0.16 -> 0.4 +sqtx2322 squareroot 0.016 -> 0.13 Inexact Rounded +sqtx2323 squareroot 16.0E-1 -> 1.3 Inexact Rounded +sqtx2324 squareroot 16.00E-2 -> 0.40 +sqtx2325 squareroot 16E-3 -> 0.13 Inexact Rounded +sqtx2326 squareroot 16E+1 -> 13 Inexact Rounded +sqtx2327 squareroot 16E+2 -> 4E+1 +sqtx2328 squareroot 16E+3 -> 1.3E+2 Inexact Rounded +sqtx2329 squareroot 0.17 -> 0.41 Inexact Rounded +sqtx2330 squareroot 0.017 -> 0.13 Inexact Rounded +sqtx2331 squareroot 17.0E-1 -> 1.3 Inexact Rounded +sqtx2332 squareroot 17.00E-2 -> 0.41 Inexact Rounded +sqtx2333 squareroot 17E-3 -> 0.13 Inexact Rounded +sqtx2334 squareroot 17E+1 -> 13 Inexact Rounded +sqtx2335 squareroot 17E+2 -> 41 Inexact Rounded +sqtx2336 squareroot 17E+3 -> 1.3E+2 Inexact Rounded +sqtx2337 squareroot 0.18 -> 0.42 Inexact Rounded +sqtx2338 squareroot 0.018 -> 0.13 Inexact Rounded +sqtx2339 squareroot 18.0E-1 -> 1.3 Inexact Rounded +sqtx2340 squareroot 18.00E-2 -> 0.42 Inexact Rounded +sqtx2341 squareroot 18E-3 -> 0.13 Inexact Rounded +sqtx2342 squareroot 18E+1 -> 13 Inexact Rounded +sqtx2343 squareroot 18E+2 -> 42 Inexact Rounded +sqtx2344 squareroot 18E+3 -> 1.3E+2 Inexact Rounded +sqtx2345 squareroot 0.19 -> 0.44 Inexact Rounded +sqtx2346 squareroot 0.019 -> 0.14 Inexact Rounded +sqtx2347 squareroot 19.0E-1 -> 1.4 Inexact Rounded +sqtx2348 squareroot 19.00E-2 -> 0.44 Inexact Rounded +sqtx2349 squareroot 19E-3 -> 0.14 Inexact Rounded +sqtx2350 squareroot 19E+1 -> 14 Inexact Rounded +sqtx2351 squareroot 19E+2 -> 44 Inexact Rounded +sqtx2352 squareroot 19E+3 -> 1.4E+2 Inexact Rounded +sqtx2353 squareroot 0.20 -> 0.45 Inexact Rounded +sqtx2354 squareroot 0.020 -> 0.14 Inexact Rounded +sqtx2355 squareroot 20.0E-1 -> 1.4 Inexact Rounded +sqtx2356 squareroot 20.00E-2 -> 0.45 Inexact Rounded +sqtx2357 squareroot 20E-3 -> 0.14 Inexact Rounded +sqtx2358 squareroot 20E+1 -> 14 Inexact Rounded +sqtx2359 squareroot 20E+2 -> 45 Inexact Rounded +sqtx2360 squareroot 20E+3 -> 1.4E+2 Inexact Rounded +sqtx2361 squareroot 0.21 -> 0.46 Inexact Rounded +sqtx2362 squareroot 0.021 -> 0.14 Inexact Rounded +sqtx2363 squareroot 21.0E-1 -> 1.4 Inexact Rounded +sqtx2364 squareroot 21.00E-2 -> 0.46 Inexact Rounded +sqtx2365 squareroot 21E-3 -> 0.14 Inexact Rounded +sqtx2366 squareroot 21E+1 -> 14 Inexact Rounded +sqtx2367 squareroot 21E+2 -> 46 Inexact Rounded +sqtx2368 squareroot 21E+3 -> 1.4E+2 Inexact Rounded +sqtx2369 squareroot 0.22 -> 0.47 Inexact Rounded +sqtx2370 squareroot 0.022 -> 0.15 Inexact Rounded +sqtx2371 squareroot 22.0E-1 -> 1.5 Inexact Rounded +sqtx2372 squareroot 22.00E-2 -> 0.47 Inexact Rounded +sqtx2373 squareroot 22E-3 -> 0.15 Inexact Rounded +sqtx2374 squareroot 22E+1 -> 15 Inexact Rounded +sqtx2375 squareroot 22E+2 -> 47 Inexact Rounded +sqtx2376 squareroot 22E+3 -> 1.5E+2 Inexact Rounded +sqtx2377 squareroot 0.23 -> 0.48 Inexact Rounded +sqtx2378 squareroot 0.023 -> 0.15 Inexact Rounded +sqtx2379 squareroot 23.0E-1 -> 1.5 Inexact Rounded +sqtx2380 squareroot 23.00E-2 -> 0.48 Inexact Rounded +sqtx2381 squareroot 23E-3 -> 0.15 Inexact Rounded +sqtx2382 squareroot 23E+1 -> 15 Inexact Rounded +sqtx2383 squareroot 23E+2 -> 48 Inexact Rounded +sqtx2384 squareroot 23E+3 -> 1.5E+2 Inexact Rounded +sqtx2385 squareroot 0.24 -> 0.49 Inexact Rounded +sqtx2386 squareroot 0.024 -> 0.15 Inexact Rounded +sqtx2387 squareroot 24.0E-1 -> 1.5 Inexact Rounded +sqtx2388 squareroot 24.00E-2 -> 0.49 Inexact Rounded +sqtx2389 squareroot 24E-3 -> 0.15 Inexact Rounded +sqtx2390 squareroot 24E+1 -> 15 Inexact Rounded +sqtx2391 squareroot 24E+2 -> 49 Inexact Rounded +sqtx2392 squareroot 24E+3 -> 1.5E+2 Inexact Rounded +sqtx2393 squareroot 0.25 -> 0.5 +sqtx2394 squareroot 0.025 -> 0.16 Inexact Rounded +sqtx2395 squareroot 25.0E-1 -> 1.6 Inexact Rounded +sqtx2396 squareroot 25.00E-2 -> 0.50 +sqtx2397 squareroot 25E-3 -> 0.16 Inexact Rounded +sqtx2398 squareroot 25E+1 -> 16 Inexact Rounded +sqtx2399 squareroot 25E+2 -> 5E+1 +sqtx2400 squareroot 25E+3 -> 1.6E+2 Inexact Rounded +sqtx2401 squareroot 0.26 -> 0.51 Inexact Rounded +sqtx2402 squareroot 0.026 -> 0.16 Inexact Rounded +sqtx2403 squareroot 26.0E-1 -> 1.6 Inexact Rounded +sqtx2404 squareroot 26.00E-2 -> 0.51 Inexact Rounded +sqtx2405 squareroot 26E-3 -> 0.16 Inexact Rounded +sqtx2406 squareroot 26E+1 -> 16 Inexact Rounded +sqtx2407 squareroot 26E+2 -> 51 Inexact Rounded +sqtx2408 squareroot 26E+3 -> 1.6E+2 Inexact Rounded +sqtx2409 squareroot 0.27 -> 0.52 Inexact Rounded +sqtx2410 squareroot 0.027 -> 0.16 Inexact Rounded +sqtx2411 squareroot 27.0E-1 -> 1.6 Inexact Rounded +sqtx2412 squareroot 27.00E-2 -> 0.52 Inexact Rounded +sqtx2413 squareroot 27E-3 -> 0.16 Inexact Rounded +sqtx2414 squareroot 27E+1 -> 16 Inexact Rounded +sqtx2415 squareroot 27E+2 -> 52 Inexact Rounded +sqtx2416 squareroot 27E+3 -> 1.6E+2 Inexact Rounded +sqtx2417 squareroot 0.28 -> 0.53 Inexact Rounded +sqtx2418 squareroot 0.028 -> 0.17 Inexact Rounded +sqtx2419 squareroot 28.0E-1 -> 1.7 Inexact Rounded +sqtx2420 squareroot 28.00E-2 -> 0.53 Inexact Rounded +sqtx2421 squareroot 28E-3 -> 0.17 Inexact Rounded +sqtx2422 squareroot 28E+1 -> 17 Inexact Rounded +sqtx2423 squareroot 28E+2 -> 53 Inexact Rounded +sqtx2424 squareroot 28E+3 -> 1.7E+2 Inexact Rounded +sqtx2425 squareroot 0.29 -> 0.54 Inexact Rounded +sqtx2426 squareroot 0.029 -> 0.17 Inexact Rounded +sqtx2427 squareroot 29.0E-1 -> 1.7 Inexact Rounded +sqtx2428 squareroot 29.00E-2 -> 0.54 Inexact Rounded +sqtx2429 squareroot 29E-3 -> 0.17 Inexact Rounded +sqtx2430 squareroot 29E+1 -> 17 Inexact Rounded +sqtx2431 squareroot 29E+2 -> 54 Inexact Rounded +sqtx2432 squareroot 29E+3 -> 1.7E+2 Inexact Rounded +sqtx2433 squareroot 0.30 -> 0.55 Inexact Rounded +sqtx2434 squareroot 0.030 -> 0.17 Inexact Rounded +sqtx2435 squareroot 30.0E-1 -> 1.7 Inexact Rounded +sqtx2436 squareroot 30.00E-2 -> 0.55 Inexact Rounded +sqtx2437 squareroot 30E-3 -> 0.17 Inexact Rounded +sqtx2438 squareroot 30E+1 -> 17 Inexact Rounded +sqtx2439 squareroot 30E+2 -> 55 Inexact Rounded +sqtx2440 squareroot 30E+3 -> 1.7E+2 Inexact Rounded +sqtx2441 squareroot 0.31 -> 0.56 Inexact Rounded +sqtx2442 squareroot 0.031 -> 0.18 Inexact Rounded +sqtx2443 squareroot 31.0E-1 -> 1.8 Inexact Rounded +sqtx2444 squareroot 31.00E-2 -> 0.56 Inexact Rounded +sqtx2445 squareroot 31E-3 -> 0.18 Inexact Rounded +sqtx2446 squareroot 31E+1 -> 18 Inexact Rounded +sqtx2447 squareroot 31E+2 -> 56 Inexact Rounded +sqtx2448 squareroot 31E+3 -> 1.8E+2 Inexact Rounded +sqtx2449 squareroot 0.32 -> 0.57 Inexact Rounded +sqtx2450 squareroot 0.032 -> 0.18 Inexact Rounded +sqtx2451 squareroot 32.0E-1 -> 1.8 Inexact Rounded +sqtx2452 squareroot 32.00E-2 -> 0.57 Inexact Rounded +sqtx2453 squareroot 32E-3 -> 0.18 Inexact Rounded +sqtx2454 squareroot 32E+1 -> 18 Inexact Rounded +sqtx2455 squareroot 32E+2 -> 57 Inexact Rounded +sqtx2456 squareroot 32E+3 -> 1.8E+2 Inexact Rounded +sqtx2457 squareroot 0.33 -> 0.57 Inexact Rounded +sqtx2458 squareroot 0.033 -> 0.18 Inexact Rounded +sqtx2459 squareroot 33.0E-1 -> 1.8 Inexact Rounded +sqtx2460 squareroot 33.00E-2 -> 0.57 Inexact Rounded +sqtx2461 squareroot 33E-3 -> 0.18 Inexact Rounded +sqtx2462 squareroot 33E+1 -> 18 Inexact Rounded +sqtx2463 squareroot 33E+2 -> 57 Inexact Rounded +sqtx2464 squareroot 33E+3 -> 1.8E+2 Inexact Rounded +sqtx2465 squareroot 0.34 -> 0.58 Inexact Rounded +sqtx2466 squareroot 0.034 -> 0.18 Inexact Rounded +sqtx2467 squareroot 34.0E-1 -> 1.8 Inexact Rounded +sqtx2468 squareroot 34.00E-2 -> 0.58 Inexact Rounded +sqtx2469 squareroot 34E-3 -> 0.18 Inexact Rounded +sqtx2470 squareroot 34E+1 -> 18 Inexact Rounded +sqtx2471 squareroot 34E+2 -> 58 Inexact Rounded +sqtx2472 squareroot 34E+3 -> 1.8E+2 Inexact Rounded +sqtx2473 squareroot 0.35 -> 0.59 Inexact Rounded +sqtx2474 squareroot 0.035 -> 0.19 Inexact Rounded +sqtx2475 squareroot 35.0E-1 -> 1.9 Inexact Rounded +sqtx2476 squareroot 35.00E-2 -> 0.59 Inexact Rounded +sqtx2477 squareroot 35E-3 -> 0.19 Inexact Rounded +sqtx2478 squareroot 35E+1 -> 19 Inexact Rounded +sqtx2479 squareroot 35E+2 -> 59 Inexact Rounded +sqtx2480 squareroot 35E+3 -> 1.9E+2 Inexact Rounded +sqtx2481 squareroot 0.36 -> 0.6 +sqtx2482 squareroot 0.036 -> 0.19 Inexact Rounded +sqtx2483 squareroot 36.0E-1 -> 1.9 Inexact Rounded +sqtx2484 squareroot 36.00E-2 -> 0.60 +sqtx2485 squareroot 36E-3 -> 0.19 Inexact Rounded +sqtx2486 squareroot 36E+1 -> 19 Inexact Rounded +sqtx2487 squareroot 36E+2 -> 6E+1 +sqtx2488 squareroot 36E+3 -> 1.9E+2 Inexact Rounded +sqtx2489 squareroot 0.37 -> 0.61 Inexact Rounded +sqtx2490 squareroot 0.037 -> 0.19 Inexact Rounded +sqtx2491 squareroot 37.0E-1 -> 1.9 Inexact Rounded +sqtx2492 squareroot 37.00E-2 -> 0.61 Inexact Rounded +sqtx2493 squareroot 37E-3 -> 0.19 Inexact Rounded +sqtx2494 squareroot 37E+1 -> 19 Inexact Rounded +sqtx2495 squareroot 37E+2 -> 61 Inexact Rounded +sqtx2496 squareroot 37E+3 -> 1.9E+2 Inexact Rounded +sqtx2497 squareroot 0.38 -> 0.62 Inexact Rounded +sqtx2498 squareroot 0.038 -> 0.19 Inexact Rounded +sqtx2499 squareroot 38.0E-1 -> 1.9 Inexact Rounded +sqtx2500 squareroot 38.00E-2 -> 0.62 Inexact Rounded +sqtx2501 squareroot 38E-3 -> 0.19 Inexact Rounded +sqtx2502 squareroot 38E+1 -> 19 Inexact Rounded +sqtx2503 squareroot 38E+2 -> 62 Inexact Rounded +sqtx2504 squareroot 38E+3 -> 1.9E+2 Inexact Rounded +sqtx2505 squareroot 0.39 -> 0.62 Inexact Rounded +sqtx2506 squareroot 0.039 -> 0.20 Inexact Rounded +sqtx2507 squareroot 39.0E-1 -> 2.0 Inexact Rounded +sqtx2508 squareroot 39.00E-2 -> 0.62 Inexact Rounded +sqtx2509 squareroot 39E-3 -> 0.20 Inexact Rounded +sqtx2510 squareroot 39E+1 -> 20 Inexact Rounded +sqtx2511 squareroot 39E+2 -> 62 Inexact Rounded +sqtx2512 squareroot 39E+3 -> 2.0E+2 Inexact Rounded +sqtx2513 squareroot 0.40 -> 0.63 Inexact Rounded +sqtx2514 squareroot 0.040 -> 0.20 +sqtx2515 squareroot 40.0E-1 -> 2.0 +sqtx2516 squareroot 40.00E-2 -> 0.63 Inexact Rounded +sqtx2517 squareroot 40E-3 -> 0.20 +sqtx2518 squareroot 40E+1 -> 20 +sqtx2519 squareroot 40E+2 -> 63 Inexact Rounded +sqtx2520 squareroot 40E+3 -> 2.0E+2 +sqtx2521 squareroot 0.41 -> 0.64 Inexact Rounded +sqtx2522 squareroot 0.041 -> 0.20 Inexact Rounded +sqtx2523 squareroot 41.0E-1 -> 2.0 Inexact Rounded +sqtx2524 squareroot 41.00E-2 -> 0.64 Inexact Rounded +sqtx2525 squareroot 41E-3 -> 0.20 Inexact Rounded +sqtx2526 squareroot 41E+1 -> 20 Inexact Rounded +sqtx2527 squareroot 41E+2 -> 64 Inexact Rounded +sqtx2528 squareroot 41E+3 -> 2.0E+2 Inexact Rounded +sqtx2529 squareroot 0.42 -> 0.65 Inexact Rounded +sqtx2530 squareroot 0.042 -> 0.20 Inexact Rounded +sqtx2531 squareroot 42.0E-1 -> 2.0 Inexact Rounded +sqtx2532 squareroot 42.00E-2 -> 0.65 Inexact Rounded +sqtx2533 squareroot 42E-3 -> 0.20 Inexact Rounded +sqtx2534 squareroot 42E+1 -> 20 Inexact Rounded +sqtx2535 squareroot 42E+2 -> 65 Inexact Rounded +sqtx2536 squareroot 42E+3 -> 2.0E+2 Inexact Rounded +sqtx2537 squareroot 0.43 -> 0.66 Inexact Rounded +sqtx2538 squareroot 0.043 -> 0.21 Inexact Rounded +sqtx2539 squareroot 43.0E-1 -> 2.1 Inexact Rounded +sqtx2540 squareroot 43.00E-2 -> 0.66 Inexact Rounded +sqtx2541 squareroot 43E-3 -> 0.21 Inexact Rounded +sqtx2542 squareroot 43E+1 -> 21 Inexact Rounded +sqtx2543 squareroot 43E+2 -> 66 Inexact Rounded +sqtx2544 squareroot 43E+3 -> 2.1E+2 Inexact Rounded +sqtx2545 squareroot 0.44 -> 0.66 Inexact Rounded +sqtx2546 squareroot 0.044 -> 0.21 Inexact Rounded +sqtx2547 squareroot 44.0E-1 -> 2.1 Inexact Rounded +sqtx2548 squareroot 44.00E-2 -> 0.66 Inexact Rounded +sqtx2549 squareroot 44E-3 -> 0.21 Inexact Rounded +sqtx2550 squareroot 44E+1 -> 21 Inexact Rounded +sqtx2551 squareroot 44E+2 -> 66 Inexact Rounded +sqtx2552 squareroot 44E+3 -> 2.1E+2 Inexact Rounded +sqtx2553 squareroot 0.45 -> 0.67 Inexact Rounded +sqtx2554 squareroot 0.045 -> 0.21 Inexact Rounded +sqtx2555 squareroot 45.0E-1 -> 2.1 Inexact Rounded +sqtx2556 squareroot 45.00E-2 -> 0.67 Inexact Rounded +sqtx2557 squareroot 45E-3 -> 0.21 Inexact Rounded +sqtx2558 squareroot 45E+1 -> 21 Inexact Rounded +sqtx2559 squareroot 45E+2 -> 67 Inexact Rounded +sqtx2560 squareroot 45E+3 -> 2.1E+2 Inexact Rounded +sqtx2561 squareroot 0.46 -> 0.68 Inexact Rounded +sqtx2562 squareroot 0.046 -> 0.21 Inexact Rounded +sqtx2563 squareroot 46.0E-1 -> 2.1 Inexact Rounded +sqtx2564 squareroot 46.00E-2 -> 0.68 Inexact Rounded +sqtx2565 squareroot 46E-3 -> 0.21 Inexact Rounded +sqtx2566 squareroot 46E+1 -> 21 Inexact Rounded +sqtx2567 squareroot 46E+2 -> 68 Inexact Rounded +sqtx2568 squareroot 46E+3 -> 2.1E+2 Inexact Rounded +sqtx2569 squareroot 0.47 -> 0.69 Inexact Rounded +sqtx2570 squareroot 0.047 -> 0.22 Inexact Rounded +sqtx2571 squareroot 47.0E-1 -> 2.2 Inexact Rounded +sqtx2572 squareroot 47.00E-2 -> 0.69 Inexact Rounded +sqtx2573 squareroot 47E-3 -> 0.22 Inexact Rounded +sqtx2574 squareroot 47E+1 -> 22 Inexact Rounded +sqtx2575 squareroot 47E+2 -> 69 Inexact Rounded +sqtx2576 squareroot 47E+3 -> 2.2E+2 Inexact Rounded +sqtx2577 squareroot 0.48 -> 0.69 Inexact Rounded +sqtx2578 squareroot 0.048 -> 0.22 Inexact Rounded +sqtx2579 squareroot 48.0E-1 -> 2.2 Inexact Rounded +sqtx2580 squareroot 48.00E-2 -> 0.69 Inexact Rounded +sqtx2581 squareroot 48E-3 -> 0.22 Inexact Rounded +sqtx2582 squareroot 48E+1 -> 22 Inexact Rounded +sqtx2583 squareroot 48E+2 -> 69 Inexact Rounded +sqtx2584 squareroot 48E+3 -> 2.2E+2 Inexact Rounded +sqtx2585 squareroot 0.49 -> 0.7 +sqtx2586 squareroot 0.049 -> 0.22 Inexact Rounded +sqtx2587 squareroot 49.0E-1 -> 2.2 Inexact Rounded +sqtx2588 squareroot 49.00E-2 -> 0.70 +sqtx2589 squareroot 49E-3 -> 0.22 Inexact Rounded +sqtx2590 squareroot 49E+1 -> 22 Inexact Rounded +sqtx2591 squareroot 49E+2 -> 7E+1 +sqtx2592 squareroot 49E+3 -> 2.2E+2 Inexact Rounded +sqtx2593 squareroot 0.50 -> 0.71 Inexact Rounded +sqtx2594 squareroot 0.050 -> 0.22 Inexact Rounded +sqtx2595 squareroot 50.0E-1 -> 2.2 Inexact Rounded +sqtx2596 squareroot 50.00E-2 -> 0.71 Inexact Rounded +sqtx2597 squareroot 50E-3 -> 0.22 Inexact Rounded +sqtx2598 squareroot 50E+1 -> 22 Inexact Rounded +sqtx2599 squareroot 50E+2 -> 71 Inexact Rounded +sqtx2600 squareroot 50E+3 -> 2.2E+2 Inexact Rounded +sqtx2601 squareroot 0.51 -> 0.71 Inexact Rounded +sqtx2602 squareroot 0.051 -> 0.23 Inexact Rounded +sqtx2603 squareroot 51.0E-1 -> 2.3 Inexact Rounded +sqtx2604 squareroot 51.00E-2 -> 0.71 Inexact Rounded +sqtx2605 squareroot 51E-3 -> 0.23 Inexact Rounded +sqtx2606 squareroot 51E+1 -> 23 Inexact Rounded +sqtx2607 squareroot 51E+2 -> 71 Inexact Rounded +sqtx2608 squareroot 51E+3 -> 2.3E+2 Inexact Rounded +sqtx2609 squareroot 0.52 -> 0.72 Inexact Rounded +sqtx2610 squareroot 0.052 -> 0.23 Inexact Rounded +sqtx2611 squareroot 52.0E-1 -> 2.3 Inexact Rounded +sqtx2612 squareroot 52.00E-2 -> 0.72 Inexact Rounded +sqtx2613 squareroot 52E-3 -> 0.23 Inexact Rounded +sqtx2614 squareroot 52E+1 -> 23 Inexact Rounded +sqtx2615 squareroot 52E+2 -> 72 Inexact Rounded +sqtx2616 squareroot 52E+3 -> 2.3E+2 Inexact Rounded +sqtx2617 squareroot 0.53 -> 0.73 Inexact Rounded +sqtx2618 squareroot 0.053 -> 0.23 Inexact Rounded +sqtx2619 squareroot 53.0E-1 -> 2.3 Inexact Rounded +sqtx2620 squareroot 53.00E-2 -> 0.73 Inexact Rounded +sqtx2621 squareroot 53E-3 -> 0.23 Inexact Rounded +sqtx2622 squareroot 53E+1 -> 23 Inexact Rounded +sqtx2623 squareroot 53E+2 -> 73 Inexact Rounded +sqtx2624 squareroot 53E+3 -> 2.3E+2 Inexact Rounded +sqtx2625 squareroot 0.54 -> 0.73 Inexact Rounded +sqtx2626 squareroot 0.054 -> 0.23 Inexact Rounded +sqtx2627 squareroot 54.0E-1 -> 2.3 Inexact Rounded +sqtx2628 squareroot 54.00E-2 -> 0.73 Inexact Rounded +sqtx2629 squareroot 54E-3 -> 0.23 Inexact Rounded +sqtx2630 squareroot 54E+1 -> 23 Inexact Rounded +sqtx2631 squareroot 54E+2 -> 73 Inexact Rounded +sqtx2632 squareroot 54E+3 -> 2.3E+2 Inexact Rounded +sqtx2633 squareroot 0.55 -> 0.74 Inexact Rounded +sqtx2634 squareroot 0.055 -> 0.23 Inexact Rounded +sqtx2635 squareroot 55.0E-1 -> 2.3 Inexact Rounded +sqtx2636 squareroot 55.00E-2 -> 0.74 Inexact Rounded +sqtx2637 squareroot 55E-3 -> 0.23 Inexact Rounded +sqtx2638 squareroot 55E+1 -> 23 Inexact Rounded +sqtx2639 squareroot 55E+2 -> 74 Inexact Rounded +sqtx2640 squareroot 55E+3 -> 2.3E+2 Inexact Rounded +sqtx2641 squareroot 0.56 -> 0.75 Inexact Rounded +sqtx2642 squareroot 0.056 -> 0.24 Inexact Rounded +sqtx2643 squareroot 56.0E-1 -> 2.4 Inexact Rounded +sqtx2644 squareroot 56.00E-2 -> 0.75 Inexact Rounded +sqtx2645 squareroot 56E-3 -> 0.24 Inexact Rounded +sqtx2646 squareroot 56E+1 -> 24 Inexact Rounded +sqtx2647 squareroot 56E+2 -> 75 Inexact Rounded +sqtx2648 squareroot 56E+3 -> 2.4E+2 Inexact Rounded +sqtx2649 squareroot 0.57 -> 0.75 Inexact Rounded +sqtx2650 squareroot 0.057 -> 0.24 Inexact Rounded +sqtx2651 squareroot 57.0E-1 -> 2.4 Inexact Rounded +sqtx2652 squareroot 57.00E-2 -> 0.75 Inexact Rounded +sqtx2653 squareroot 57E-3 -> 0.24 Inexact Rounded +sqtx2654 squareroot 57E+1 -> 24 Inexact Rounded +sqtx2655 squareroot 57E+2 -> 75 Inexact Rounded +sqtx2656 squareroot 57E+3 -> 2.4E+2 Inexact Rounded +sqtx2657 squareroot 0.58 -> 0.76 Inexact Rounded +sqtx2658 squareroot 0.058 -> 0.24 Inexact Rounded +sqtx2659 squareroot 58.0E-1 -> 2.4 Inexact Rounded +sqtx2660 squareroot 58.00E-2 -> 0.76 Inexact Rounded +sqtx2661 squareroot 58E-3 -> 0.24 Inexact Rounded +sqtx2662 squareroot 58E+1 -> 24 Inexact Rounded +sqtx2663 squareroot 58E+2 -> 76 Inexact Rounded +sqtx2664 squareroot 58E+3 -> 2.4E+2 Inexact Rounded +sqtx2665 squareroot 0.59 -> 0.77 Inexact Rounded +sqtx2666 squareroot 0.059 -> 0.24 Inexact Rounded +sqtx2667 squareroot 59.0E-1 -> 2.4 Inexact Rounded +sqtx2668 squareroot 59.00E-2 -> 0.77 Inexact Rounded +sqtx2669 squareroot 59E-3 -> 0.24 Inexact Rounded +sqtx2670 squareroot 59E+1 -> 24 Inexact Rounded +sqtx2671 squareroot 59E+2 -> 77 Inexact Rounded +sqtx2672 squareroot 59E+3 -> 2.4E+2 Inexact Rounded +sqtx2673 squareroot 0.60 -> 0.77 Inexact Rounded +sqtx2674 squareroot 0.060 -> 0.24 Inexact Rounded +sqtx2675 squareroot 60.0E-1 -> 2.4 Inexact Rounded +sqtx2676 squareroot 60.00E-2 -> 0.77 Inexact Rounded +sqtx2677 squareroot 60E-3 -> 0.24 Inexact Rounded +sqtx2678 squareroot 60E+1 -> 24 Inexact Rounded +sqtx2679 squareroot 60E+2 -> 77 Inexact Rounded +sqtx2680 squareroot 60E+3 -> 2.4E+2 Inexact Rounded +sqtx2681 squareroot 0.61 -> 0.78 Inexact Rounded +sqtx2682 squareroot 0.061 -> 0.25 Inexact Rounded +sqtx2683 squareroot 61.0E-1 -> 2.5 Inexact Rounded +sqtx2684 squareroot 61.00E-2 -> 0.78 Inexact Rounded +sqtx2685 squareroot 61E-3 -> 0.25 Inexact Rounded +sqtx2686 squareroot 61E+1 -> 25 Inexact Rounded +sqtx2687 squareroot 61E+2 -> 78 Inexact Rounded +sqtx2688 squareroot 61E+3 -> 2.5E+2 Inexact Rounded +sqtx2689 squareroot 0.62 -> 0.79 Inexact Rounded +sqtx2690 squareroot 0.062 -> 0.25 Inexact Rounded +sqtx2691 squareroot 62.0E-1 -> 2.5 Inexact Rounded +sqtx2692 squareroot 62.00E-2 -> 0.79 Inexact Rounded +sqtx2693 squareroot 62E-3 -> 0.25 Inexact Rounded +sqtx2694 squareroot 62E+1 -> 25 Inexact Rounded +sqtx2695 squareroot 62E+2 -> 79 Inexact Rounded +sqtx2696 squareroot 62E+3 -> 2.5E+2 Inexact Rounded +sqtx2697 squareroot 0.63 -> 0.79 Inexact Rounded +sqtx2698 squareroot 0.063 -> 0.25 Inexact Rounded +sqtx2699 squareroot 63.0E-1 -> 2.5 Inexact Rounded +sqtx2700 squareroot 63.00E-2 -> 0.79 Inexact Rounded +sqtx2701 squareroot 63E-3 -> 0.25 Inexact Rounded +sqtx2702 squareroot 63E+1 -> 25 Inexact Rounded +sqtx2703 squareroot 63E+2 -> 79 Inexact Rounded +sqtx2704 squareroot 63E+3 -> 2.5E+2 Inexact Rounded +sqtx2705 squareroot 0.64 -> 0.8 +sqtx2706 squareroot 0.064 -> 0.25 Inexact Rounded +sqtx2707 squareroot 64.0E-1 -> 2.5 Inexact Rounded +sqtx2708 squareroot 64.00E-2 -> 0.80 +sqtx2709 squareroot 64E-3 -> 0.25 Inexact Rounded +sqtx2710 squareroot 64E+1 -> 25 Inexact Rounded +sqtx2711 squareroot 64E+2 -> 8E+1 +sqtx2712 squareroot 64E+3 -> 2.5E+2 Inexact Rounded +sqtx2713 squareroot 0.65 -> 0.81 Inexact Rounded +sqtx2714 squareroot 0.065 -> 0.25 Inexact Rounded +sqtx2715 squareroot 65.0E-1 -> 2.5 Inexact Rounded +sqtx2716 squareroot 65.00E-2 -> 0.81 Inexact Rounded +sqtx2717 squareroot 65E-3 -> 0.25 Inexact Rounded +sqtx2718 squareroot 65E+1 -> 25 Inexact Rounded +sqtx2719 squareroot 65E+2 -> 81 Inexact Rounded +sqtx2720 squareroot 65E+3 -> 2.5E+2 Inexact Rounded +sqtx2721 squareroot 0.66 -> 0.81 Inexact Rounded +sqtx2722 squareroot 0.066 -> 0.26 Inexact Rounded +sqtx2723 squareroot 66.0E-1 -> 2.6 Inexact Rounded +sqtx2724 squareroot 66.00E-2 -> 0.81 Inexact Rounded +sqtx2725 squareroot 66E-3 -> 0.26 Inexact Rounded +sqtx2726 squareroot 66E+1 -> 26 Inexact Rounded +sqtx2727 squareroot 66E+2 -> 81 Inexact Rounded +sqtx2728 squareroot 66E+3 -> 2.6E+2 Inexact Rounded +sqtx2729 squareroot 0.67 -> 0.82 Inexact Rounded +sqtx2730 squareroot 0.067 -> 0.26 Inexact Rounded +sqtx2731 squareroot 67.0E-1 -> 2.6 Inexact Rounded +sqtx2732 squareroot 67.00E-2 -> 0.82 Inexact Rounded +sqtx2733 squareroot 67E-3 -> 0.26 Inexact Rounded +sqtx2734 squareroot 67E+1 -> 26 Inexact Rounded +sqtx2735 squareroot 67E+2 -> 82 Inexact Rounded +sqtx2736 squareroot 67E+3 -> 2.6E+2 Inexact Rounded +sqtx2737 squareroot 0.68 -> 0.82 Inexact Rounded +sqtx2738 squareroot 0.068 -> 0.26 Inexact Rounded +sqtx2739 squareroot 68.0E-1 -> 2.6 Inexact Rounded +sqtx2740 squareroot 68.00E-2 -> 0.82 Inexact Rounded +sqtx2741 squareroot 68E-3 -> 0.26 Inexact Rounded +sqtx2742 squareroot 68E+1 -> 26 Inexact Rounded +sqtx2743 squareroot 68E+2 -> 82 Inexact Rounded +sqtx2744 squareroot 68E+3 -> 2.6E+2 Inexact Rounded +sqtx2745 squareroot 0.69 -> 0.83 Inexact Rounded +sqtx2746 squareroot 0.069 -> 0.26 Inexact Rounded +sqtx2747 squareroot 69.0E-1 -> 2.6 Inexact Rounded +sqtx2748 squareroot 69.00E-2 -> 0.83 Inexact Rounded +sqtx2749 squareroot 69E-3 -> 0.26 Inexact Rounded +sqtx2750 squareroot 69E+1 -> 26 Inexact Rounded +sqtx2751 squareroot 69E+2 -> 83 Inexact Rounded +sqtx2752 squareroot 69E+3 -> 2.6E+2 Inexact Rounded +sqtx2753 squareroot 0.70 -> 0.84 Inexact Rounded +sqtx2754 squareroot 0.070 -> 0.26 Inexact Rounded +sqtx2755 squareroot 70.0E-1 -> 2.6 Inexact Rounded +sqtx2756 squareroot 70.00E-2 -> 0.84 Inexact Rounded +sqtx2757 squareroot 70E-3 -> 0.26 Inexact Rounded +sqtx2758 squareroot 70E+1 -> 26 Inexact Rounded +sqtx2759 squareroot 70E+2 -> 84 Inexact Rounded +sqtx2760 squareroot 70E+3 -> 2.6E+2 Inexact Rounded +sqtx2761 squareroot 0.71 -> 0.84 Inexact Rounded +sqtx2762 squareroot 0.071 -> 0.27 Inexact Rounded +sqtx2763 squareroot 71.0E-1 -> 2.7 Inexact Rounded +sqtx2764 squareroot 71.00E-2 -> 0.84 Inexact Rounded +sqtx2765 squareroot 71E-3 -> 0.27 Inexact Rounded +sqtx2766 squareroot 71E+1 -> 27 Inexact Rounded +sqtx2767 squareroot 71E+2 -> 84 Inexact Rounded +sqtx2768 squareroot 71E+3 -> 2.7E+2 Inexact Rounded +sqtx2769 squareroot 0.72 -> 0.85 Inexact Rounded +sqtx2770 squareroot 0.072 -> 0.27 Inexact Rounded +sqtx2771 squareroot 72.0E-1 -> 2.7 Inexact Rounded +sqtx2772 squareroot 72.00E-2 -> 0.85 Inexact Rounded +sqtx2773 squareroot 72E-3 -> 0.27 Inexact Rounded +sqtx2774 squareroot 72E+1 -> 27 Inexact Rounded +sqtx2775 squareroot 72E+2 -> 85 Inexact Rounded +sqtx2776 squareroot 72E+3 -> 2.7E+2 Inexact Rounded +sqtx2777 squareroot 0.73 -> 0.85 Inexact Rounded +sqtx2778 squareroot 0.073 -> 0.27 Inexact Rounded +sqtx2779 squareroot 73.0E-1 -> 2.7 Inexact Rounded +sqtx2780 squareroot 73.00E-2 -> 0.85 Inexact Rounded +sqtx2781 squareroot 73E-3 -> 0.27 Inexact Rounded +sqtx2782 squareroot 73E+1 -> 27 Inexact Rounded +sqtx2783 squareroot 73E+2 -> 85 Inexact Rounded +sqtx2784 squareroot 73E+3 -> 2.7E+2 Inexact Rounded +sqtx2785 squareroot 0.74 -> 0.86 Inexact Rounded +sqtx2786 squareroot 0.074 -> 0.27 Inexact Rounded +sqtx2787 squareroot 74.0E-1 -> 2.7 Inexact Rounded +sqtx2788 squareroot 74.00E-2 -> 0.86 Inexact Rounded +sqtx2789 squareroot 74E-3 -> 0.27 Inexact Rounded +sqtx2790 squareroot 74E+1 -> 27 Inexact Rounded +sqtx2791 squareroot 74E+2 -> 86 Inexact Rounded +sqtx2792 squareroot 74E+3 -> 2.7E+2 Inexact Rounded +sqtx2793 squareroot 0.75 -> 0.87 Inexact Rounded +sqtx2794 squareroot 0.075 -> 0.27 Inexact Rounded +sqtx2795 squareroot 75.0E-1 -> 2.7 Inexact Rounded +sqtx2796 squareroot 75.00E-2 -> 0.87 Inexact Rounded +sqtx2797 squareroot 75E-3 -> 0.27 Inexact Rounded +sqtx2798 squareroot 75E+1 -> 27 Inexact Rounded +sqtx2799 squareroot 75E+2 -> 87 Inexact Rounded +sqtx2800 squareroot 75E+3 -> 2.7E+2 Inexact Rounded +sqtx2801 squareroot 0.76 -> 0.87 Inexact Rounded +sqtx2802 squareroot 0.076 -> 0.28 Inexact Rounded +sqtx2803 squareroot 76.0E-1 -> 2.8 Inexact Rounded +sqtx2804 squareroot 76.00E-2 -> 0.87 Inexact Rounded +sqtx2805 squareroot 76E-3 -> 0.28 Inexact Rounded +sqtx2806 squareroot 76E+1 -> 28 Inexact Rounded +sqtx2807 squareroot 76E+2 -> 87 Inexact Rounded +sqtx2808 squareroot 76E+3 -> 2.8E+2 Inexact Rounded +sqtx2809 squareroot 0.77 -> 0.88 Inexact Rounded +sqtx2810 squareroot 0.077 -> 0.28 Inexact Rounded +sqtx2811 squareroot 77.0E-1 -> 2.8 Inexact Rounded +sqtx2812 squareroot 77.00E-2 -> 0.88 Inexact Rounded +sqtx2813 squareroot 77E-3 -> 0.28 Inexact Rounded +sqtx2814 squareroot 77E+1 -> 28 Inexact Rounded +sqtx2815 squareroot 77E+2 -> 88 Inexact Rounded +sqtx2816 squareroot 77E+3 -> 2.8E+2 Inexact Rounded +sqtx2817 squareroot 0.78 -> 0.88 Inexact Rounded +sqtx2818 squareroot 0.078 -> 0.28 Inexact Rounded +sqtx2819 squareroot 78.0E-1 -> 2.8 Inexact Rounded +sqtx2820 squareroot 78.00E-2 -> 0.88 Inexact Rounded +sqtx2821 squareroot 78E-3 -> 0.28 Inexact Rounded +sqtx2822 squareroot 78E+1 -> 28 Inexact Rounded +sqtx2823 squareroot 78E+2 -> 88 Inexact Rounded +sqtx2824 squareroot 78E+3 -> 2.8E+2 Inexact Rounded +sqtx2825 squareroot 0.79 -> 0.89 Inexact Rounded +sqtx2826 squareroot 0.079 -> 0.28 Inexact Rounded +sqtx2827 squareroot 79.0E-1 -> 2.8 Inexact Rounded +sqtx2828 squareroot 79.00E-2 -> 0.89 Inexact Rounded +sqtx2829 squareroot 79E-3 -> 0.28 Inexact Rounded +sqtx2830 squareroot 79E+1 -> 28 Inexact Rounded +sqtx2831 squareroot 79E+2 -> 89 Inexact Rounded +sqtx2832 squareroot 79E+3 -> 2.8E+2 Inexact Rounded +sqtx2833 squareroot 0.80 -> 0.89 Inexact Rounded +sqtx2834 squareroot 0.080 -> 0.28 Inexact Rounded +sqtx2835 squareroot 80.0E-1 -> 2.8 Inexact Rounded +sqtx2836 squareroot 80.00E-2 -> 0.89 Inexact Rounded +sqtx2837 squareroot 80E-3 -> 0.28 Inexact Rounded +sqtx2838 squareroot 80E+1 -> 28 Inexact Rounded +sqtx2839 squareroot 80E+2 -> 89 Inexact Rounded +sqtx2840 squareroot 80E+3 -> 2.8E+2 Inexact Rounded +sqtx2841 squareroot 0.81 -> 0.9 +sqtx2842 squareroot 0.081 -> 0.28 Inexact Rounded +sqtx2843 squareroot 81.0E-1 -> 2.8 Inexact Rounded +sqtx2844 squareroot 81.00E-2 -> 0.90 +sqtx2845 squareroot 81E-3 -> 0.28 Inexact Rounded +sqtx2846 squareroot 81E+1 -> 28 Inexact Rounded +sqtx2847 squareroot 81E+2 -> 9E+1 +sqtx2848 squareroot 81E+3 -> 2.8E+2 Inexact Rounded +sqtx2849 squareroot 0.82 -> 0.91 Inexact Rounded +sqtx2850 squareroot 0.082 -> 0.29 Inexact Rounded +sqtx2851 squareroot 82.0E-1 -> 2.9 Inexact Rounded +sqtx2852 squareroot 82.00E-2 -> 0.91 Inexact Rounded +sqtx2853 squareroot 82E-3 -> 0.29 Inexact Rounded +sqtx2854 squareroot 82E+1 -> 29 Inexact Rounded +sqtx2855 squareroot 82E+2 -> 91 Inexact Rounded +sqtx2856 squareroot 82E+3 -> 2.9E+2 Inexact Rounded +sqtx2857 squareroot 0.83 -> 0.91 Inexact Rounded +sqtx2858 squareroot 0.083 -> 0.29 Inexact Rounded +sqtx2859 squareroot 83.0E-1 -> 2.9 Inexact Rounded +sqtx2860 squareroot 83.00E-2 -> 0.91 Inexact Rounded +sqtx2861 squareroot 83E-3 -> 0.29 Inexact Rounded +sqtx2862 squareroot 83E+1 -> 29 Inexact Rounded +sqtx2863 squareroot 83E+2 -> 91 Inexact Rounded +sqtx2864 squareroot 83E+3 -> 2.9E+2 Inexact Rounded +sqtx2865 squareroot 0.84 -> 0.92 Inexact Rounded +sqtx2866 squareroot 0.084 -> 0.29 Inexact Rounded +sqtx2867 squareroot 84.0E-1 -> 2.9 Inexact Rounded +sqtx2868 squareroot 84.00E-2 -> 0.92 Inexact Rounded +sqtx2869 squareroot 84E-3 -> 0.29 Inexact Rounded +sqtx2870 squareroot 84E+1 -> 29 Inexact Rounded +sqtx2871 squareroot 84E+2 -> 92 Inexact Rounded +sqtx2872 squareroot 84E+3 -> 2.9E+2 Inexact Rounded +sqtx2873 squareroot 0.85 -> 0.92 Inexact Rounded +sqtx2874 squareroot 0.085 -> 0.29 Inexact Rounded +sqtx2875 squareroot 85.0E-1 -> 2.9 Inexact Rounded +sqtx2876 squareroot 85.00E-2 -> 0.92 Inexact Rounded +sqtx2877 squareroot 85E-3 -> 0.29 Inexact Rounded +sqtx2878 squareroot 85E+1 -> 29 Inexact Rounded +sqtx2879 squareroot 85E+2 -> 92 Inexact Rounded +sqtx2880 squareroot 85E+3 -> 2.9E+2 Inexact Rounded +sqtx2881 squareroot 0.86 -> 0.93 Inexact Rounded +sqtx2882 squareroot 0.086 -> 0.29 Inexact Rounded +sqtx2883 squareroot 86.0E-1 -> 2.9 Inexact Rounded +sqtx2884 squareroot 86.00E-2 -> 0.93 Inexact Rounded +sqtx2885 squareroot 86E-3 -> 0.29 Inexact Rounded +sqtx2886 squareroot 86E+1 -> 29 Inexact Rounded +sqtx2887 squareroot 86E+2 -> 93 Inexact Rounded +sqtx2888 squareroot 86E+3 -> 2.9E+2 Inexact Rounded +sqtx2889 squareroot 0.87 -> 0.93 Inexact Rounded +sqtx2890 squareroot 0.087 -> 0.29 Inexact Rounded +sqtx2891 squareroot 87.0E-1 -> 2.9 Inexact Rounded +sqtx2892 squareroot 87.00E-2 -> 0.93 Inexact Rounded +sqtx2893 squareroot 87E-3 -> 0.29 Inexact Rounded +sqtx2894 squareroot 87E+1 -> 29 Inexact Rounded +sqtx2895 squareroot 87E+2 -> 93 Inexact Rounded +sqtx2896 squareroot 87E+3 -> 2.9E+2 Inexact Rounded +sqtx2897 squareroot 0.88 -> 0.94 Inexact Rounded +sqtx2898 squareroot 0.088 -> 0.30 Inexact Rounded +sqtx2899 squareroot 88.0E-1 -> 3.0 Inexact Rounded +sqtx2900 squareroot 88.00E-2 -> 0.94 Inexact Rounded +sqtx2901 squareroot 88E-3 -> 0.30 Inexact Rounded +sqtx2902 squareroot 88E+1 -> 30 Inexact Rounded +sqtx2903 squareroot 88E+2 -> 94 Inexact Rounded +sqtx2904 squareroot 88E+3 -> 3.0E+2 Inexact Rounded +sqtx2905 squareroot 0.89 -> 0.94 Inexact Rounded +sqtx2906 squareroot 0.089 -> 0.30 Inexact Rounded +sqtx2907 squareroot 89.0E-1 -> 3.0 Inexact Rounded +sqtx2908 squareroot 89.00E-2 -> 0.94 Inexact Rounded +sqtx2909 squareroot 89E-3 -> 0.30 Inexact Rounded +sqtx2910 squareroot 89E+1 -> 30 Inexact Rounded +sqtx2911 squareroot 89E+2 -> 94 Inexact Rounded +sqtx2912 squareroot 89E+3 -> 3.0E+2 Inexact Rounded +sqtx2913 squareroot 0.90 -> 0.95 Inexact Rounded +sqtx2914 squareroot 0.090 -> 0.30 +sqtx2915 squareroot 90.0E-1 -> 3.0 +sqtx2916 squareroot 90.00E-2 -> 0.95 Inexact Rounded +sqtx2917 squareroot 90E-3 -> 0.30 +sqtx2918 squareroot 90E+1 -> 30 +sqtx2919 squareroot 90E+2 -> 95 Inexact Rounded +sqtx2920 squareroot 90E+3 -> 3.0E+2 +sqtx2921 squareroot 0.91 -> 0.95 Inexact Rounded +sqtx2922 squareroot 0.091 -> 0.30 Inexact Rounded +sqtx2923 squareroot 91.0E-1 -> 3.0 Inexact Rounded +sqtx2924 squareroot 91.00E-2 -> 0.95 Inexact Rounded +sqtx2925 squareroot 91E-3 -> 0.30 Inexact Rounded +sqtx2926 squareroot 91E+1 -> 30 Inexact Rounded +sqtx2927 squareroot 91E+2 -> 95 Inexact Rounded +sqtx2928 squareroot 91E+3 -> 3.0E+2 Inexact Rounded +sqtx2929 squareroot 0.92 -> 0.96 Inexact Rounded +sqtx2930 squareroot 0.092 -> 0.30 Inexact Rounded +sqtx2931 squareroot 92.0E-1 -> 3.0 Inexact Rounded +sqtx2932 squareroot 92.00E-2 -> 0.96 Inexact Rounded +sqtx2933 squareroot 92E-3 -> 0.30 Inexact Rounded +sqtx2934 squareroot 92E+1 -> 30 Inexact Rounded +sqtx2935 squareroot 92E+2 -> 96 Inexact Rounded +sqtx2936 squareroot 92E+3 -> 3.0E+2 Inexact Rounded +sqtx2937 squareroot 0.93 -> 0.96 Inexact Rounded +sqtx2938 squareroot 0.093 -> 0.30 Inexact Rounded +sqtx2939 squareroot 93.0E-1 -> 3.0 Inexact Rounded +sqtx2940 squareroot 93.00E-2 -> 0.96 Inexact Rounded +sqtx2941 squareroot 93E-3 -> 0.30 Inexact Rounded +sqtx2942 squareroot 93E+1 -> 30 Inexact Rounded +sqtx2943 squareroot 93E+2 -> 96 Inexact Rounded +sqtx2944 squareroot 93E+3 -> 3.0E+2 Inexact Rounded +sqtx2945 squareroot 0.94 -> 0.97 Inexact Rounded +sqtx2946 squareroot 0.094 -> 0.31 Inexact Rounded +sqtx2947 squareroot 94.0E-1 -> 3.1 Inexact Rounded +sqtx2948 squareroot 94.00E-2 -> 0.97 Inexact Rounded +sqtx2949 squareroot 94E-3 -> 0.31 Inexact Rounded +sqtx2950 squareroot 94E+1 -> 31 Inexact Rounded +sqtx2951 squareroot 94E+2 -> 97 Inexact Rounded +sqtx2952 squareroot 94E+3 -> 3.1E+2 Inexact Rounded +sqtx2953 squareroot 0.95 -> 0.97 Inexact Rounded +sqtx2954 squareroot 0.095 -> 0.31 Inexact Rounded +sqtx2955 squareroot 95.0E-1 -> 3.1 Inexact Rounded +sqtx2956 squareroot 95.00E-2 -> 0.97 Inexact Rounded +sqtx2957 squareroot 95E-3 -> 0.31 Inexact Rounded +sqtx2958 squareroot 95E+1 -> 31 Inexact Rounded +sqtx2959 squareroot 95E+2 -> 97 Inexact Rounded +sqtx2960 squareroot 95E+3 -> 3.1E+2 Inexact Rounded +sqtx2961 squareroot 0.96 -> 0.98 Inexact Rounded +sqtx2962 squareroot 0.096 -> 0.31 Inexact Rounded +sqtx2963 squareroot 96.0E-1 -> 3.1 Inexact Rounded +sqtx2964 squareroot 96.00E-2 -> 0.98 Inexact Rounded +sqtx2965 squareroot 96E-3 -> 0.31 Inexact Rounded +sqtx2966 squareroot 96E+1 -> 31 Inexact Rounded +sqtx2967 squareroot 96E+2 -> 98 Inexact Rounded +sqtx2968 squareroot 96E+3 -> 3.1E+2 Inexact Rounded +sqtx2969 squareroot 0.97 -> 0.98 Inexact Rounded +sqtx2970 squareroot 0.097 -> 0.31 Inexact Rounded +sqtx2971 squareroot 97.0E-1 -> 3.1 Inexact Rounded +sqtx2972 squareroot 97.00E-2 -> 0.98 Inexact Rounded +sqtx2973 squareroot 97E-3 -> 0.31 Inexact Rounded +sqtx2974 squareroot 97E+1 -> 31 Inexact Rounded +sqtx2975 squareroot 97E+2 -> 98 Inexact Rounded +sqtx2976 squareroot 97E+3 -> 3.1E+2 Inexact Rounded +sqtx2977 squareroot 0.98 -> 0.99 Inexact Rounded +sqtx2978 squareroot 0.098 -> 0.31 Inexact Rounded +sqtx2979 squareroot 98.0E-1 -> 3.1 Inexact Rounded +sqtx2980 squareroot 98.00E-2 -> 0.99 Inexact Rounded +sqtx2981 squareroot 98E-3 -> 0.31 Inexact Rounded +sqtx2982 squareroot 98E+1 -> 31 Inexact Rounded +sqtx2983 squareroot 98E+2 -> 99 Inexact Rounded +sqtx2984 squareroot 98E+3 -> 3.1E+2 Inexact Rounded +sqtx2985 squareroot 0.99 -> 0.99 Inexact Rounded +sqtx2986 squareroot 0.099 -> 0.31 Inexact Rounded +sqtx2987 squareroot 99.0E-1 -> 3.1 Inexact Rounded +sqtx2988 squareroot 99.00E-2 -> 0.99 Inexact Rounded +sqtx2989 squareroot 99E-3 -> 0.31 Inexact Rounded +sqtx2990 squareroot 99E+1 -> 31 Inexact Rounded +sqtx2991 squareroot 99E+2 -> 99 Inexact Rounded +sqtx2992 squareroot 99E+3 -> 3.1E+2 Inexact Rounded + +-- Precision 3 squareroot tests [exhaustive, f and f/10] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 3 +sqtx3001 squareroot 0.1 -> 0.316 Inexact Rounded +sqtx3002 squareroot 0.01 -> 0.1 +sqtx3003 squareroot 0.2 -> 0.447 Inexact Rounded +sqtx3004 squareroot 0.02 -> 0.141 Inexact Rounded +sqtx3005 squareroot 0.3 -> 0.548 Inexact Rounded +sqtx3006 squareroot 0.03 -> 0.173 Inexact Rounded +sqtx3007 squareroot 0.4 -> 0.632 Inexact Rounded +sqtx3008 squareroot 0.04 -> 0.2 +sqtx3009 squareroot 0.5 -> 0.707 Inexact Rounded +sqtx3010 squareroot 0.05 -> 0.224 Inexact Rounded +sqtx3011 squareroot 0.6 -> 0.775 Inexact Rounded +sqtx3012 squareroot 0.06 -> 0.245 Inexact Rounded +sqtx3013 squareroot 0.7 -> 0.837 Inexact Rounded +sqtx3014 squareroot 0.07 -> 0.265 Inexact Rounded +sqtx3015 squareroot 0.8 -> 0.894 Inexact Rounded +sqtx3016 squareroot 0.08 -> 0.283 Inexact Rounded +sqtx3017 squareroot 0.9 -> 0.949 Inexact Rounded +sqtx3018 squareroot 0.09 -> 0.3 +sqtx3019 squareroot 0.11 -> 0.332 Inexact Rounded +sqtx3020 squareroot 0.011 -> 0.105 Inexact Rounded +sqtx3021 squareroot 0.12 -> 0.346 Inexact Rounded +sqtx3022 squareroot 0.012 -> 0.110 Inexact Rounded +sqtx3023 squareroot 0.13 -> 0.361 Inexact Rounded +sqtx3024 squareroot 0.013 -> 0.114 Inexact Rounded +sqtx3025 squareroot 0.14 -> 0.374 Inexact Rounded +sqtx3026 squareroot 0.014 -> 0.118 Inexact Rounded +sqtx3027 squareroot 0.15 -> 0.387 Inexact Rounded +sqtx3028 squareroot 0.015 -> 0.122 Inexact Rounded +sqtx3029 squareroot 0.16 -> 0.4 +sqtx3030 squareroot 0.016 -> 0.126 Inexact Rounded +sqtx3031 squareroot 0.17 -> 0.412 Inexact Rounded +sqtx3032 squareroot 0.017 -> 0.130 Inexact Rounded +sqtx3033 squareroot 0.18 -> 0.424 Inexact Rounded +sqtx3034 squareroot 0.018 -> 0.134 Inexact Rounded +sqtx3035 squareroot 0.19 -> 0.436 Inexact Rounded +sqtx3036 squareroot 0.019 -> 0.138 Inexact Rounded +sqtx3037 squareroot 0.21 -> 0.458 Inexact Rounded +sqtx3038 squareroot 0.021 -> 0.145 Inexact Rounded +sqtx3039 squareroot 0.22 -> 0.469 Inexact Rounded +sqtx3040 squareroot 0.022 -> 0.148 Inexact Rounded +sqtx3041 squareroot 0.23 -> 0.480 Inexact Rounded +sqtx3042 squareroot 0.023 -> 0.152 Inexact Rounded +sqtx3043 squareroot 0.24 -> 0.490 Inexact Rounded +sqtx3044 squareroot 0.024 -> 0.155 Inexact Rounded +sqtx3045 squareroot 0.25 -> 0.5 +sqtx3046 squareroot 0.025 -> 0.158 Inexact Rounded +sqtx3047 squareroot 0.26 -> 0.510 Inexact Rounded +sqtx3048 squareroot 0.026 -> 0.161 Inexact Rounded +sqtx3049 squareroot 0.27 -> 0.520 Inexact Rounded +sqtx3050 squareroot 0.027 -> 0.164 Inexact Rounded +sqtx3051 squareroot 0.28 -> 0.529 Inexact Rounded +sqtx3052 squareroot 0.028 -> 0.167 Inexact Rounded +sqtx3053 squareroot 0.29 -> 0.539 Inexact Rounded +sqtx3054 squareroot 0.029 -> 0.170 Inexact Rounded +sqtx3055 squareroot 0.31 -> 0.557 Inexact Rounded +sqtx3056 squareroot 0.031 -> 0.176 Inexact Rounded +sqtx3057 squareroot 0.32 -> 0.566 Inexact Rounded +sqtx3058 squareroot 0.032 -> 0.179 Inexact Rounded +sqtx3059 squareroot 0.33 -> 0.574 Inexact Rounded +sqtx3060 squareroot 0.033 -> 0.182 Inexact Rounded +sqtx3061 squareroot 0.34 -> 0.583 Inexact Rounded +sqtx3062 squareroot 0.034 -> 0.184 Inexact Rounded +sqtx3063 squareroot 0.35 -> 0.592 Inexact Rounded +sqtx3064 squareroot 0.035 -> 0.187 Inexact Rounded +sqtx3065 squareroot 0.36 -> 0.6 +sqtx3066 squareroot 0.036 -> 0.190 Inexact Rounded +sqtx3067 squareroot 0.37 -> 0.608 Inexact Rounded +sqtx3068 squareroot 0.037 -> 0.192 Inexact Rounded +sqtx3069 squareroot 0.38 -> 0.616 Inexact Rounded +sqtx3070 squareroot 0.038 -> 0.195 Inexact Rounded +sqtx3071 squareroot 0.39 -> 0.624 Inexact Rounded +sqtx3072 squareroot 0.039 -> 0.197 Inexact Rounded +sqtx3073 squareroot 0.41 -> 0.640 Inexact Rounded +sqtx3074 squareroot 0.041 -> 0.202 Inexact Rounded +sqtx3075 squareroot 0.42 -> 0.648 Inexact Rounded +sqtx3076 squareroot 0.042 -> 0.205 Inexact Rounded +sqtx3077 squareroot 0.43 -> 0.656 Inexact Rounded +sqtx3078 squareroot 0.043 -> 0.207 Inexact Rounded +sqtx3079 squareroot 0.44 -> 0.663 Inexact Rounded +sqtx3080 squareroot 0.044 -> 0.210 Inexact Rounded +sqtx3081 squareroot 0.45 -> 0.671 Inexact Rounded +sqtx3082 squareroot 0.045 -> 0.212 Inexact Rounded +sqtx3083 squareroot 0.46 -> 0.678 Inexact Rounded +sqtx3084 squareroot 0.046 -> 0.214 Inexact Rounded +sqtx3085 squareroot 0.47 -> 0.686 Inexact Rounded +sqtx3086 squareroot 0.047 -> 0.217 Inexact Rounded +sqtx3087 squareroot 0.48 -> 0.693 Inexact Rounded +sqtx3088 squareroot 0.048 -> 0.219 Inexact Rounded +sqtx3089 squareroot 0.49 -> 0.7 +sqtx3090 squareroot 0.049 -> 0.221 Inexact Rounded +sqtx3091 squareroot 0.51 -> 0.714 Inexact Rounded +sqtx3092 squareroot 0.051 -> 0.226 Inexact Rounded +sqtx3093 squareroot 0.52 -> 0.721 Inexact Rounded +sqtx3094 squareroot 0.052 -> 0.228 Inexact Rounded +sqtx3095 squareroot 0.53 -> 0.728 Inexact Rounded +sqtx3096 squareroot 0.053 -> 0.230 Inexact Rounded +sqtx3097 squareroot 0.54 -> 0.735 Inexact Rounded +sqtx3098 squareroot 0.054 -> 0.232 Inexact Rounded +sqtx3099 squareroot 0.55 -> 0.742 Inexact Rounded +sqtx3100 squareroot 0.055 -> 0.235 Inexact Rounded +sqtx3101 squareroot 0.56 -> 0.748 Inexact Rounded +sqtx3102 squareroot 0.056 -> 0.237 Inexact Rounded +sqtx3103 squareroot 0.57 -> 0.755 Inexact Rounded +sqtx3104 squareroot 0.057 -> 0.239 Inexact Rounded +sqtx3105 squareroot 0.58 -> 0.762 Inexact Rounded +sqtx3106 squareroot 0.058 -> 0.241 Inexact Rounded +sqtx3107 squareroot 0.59 -> 0.768 Inexact Rounded +sqtx3108 squareroot 0.059 -> 0.243 Inexact Rounded +sqtx3109 squareroot 0.61 -> 0.781 Inexact Rounded +sqtx3110 squareroot 0.061 -> 0.247 Inexact Rounded +sqtx3111 squareroot 0.62 -> 0.787 Inexact Rounded +sqtx3112 squareroot 0.062 -> 0.249 Inexact Rounded +sqtx3113 squareroot 0.63 -> 0.794 Inexact Rounded +sqtx3114 squareroot 0.063 -> 0.251 Inexact Rounded +sqtx3115 squareroot 0.64 -> 0.8 +sqtx3116 squareroot 0.064 -> 0.253 Inexact Rounded +sqtx3117 squareroot 0.65 -> 0.806 Inexact Rounded +sqtx3118 squareroot 0.065 -> 0.255 Inexact Rounded +sqtx3119 squareroot 0.66 -> 0.812 Inexact Rounded +sqtx3120 squareroot 0.066 -> 0.257 Inexact Rounded +sqtx3121 squareroot 0.67 -> 0.819 Inexact Rounded +sqtx3122 squareroot 0.067 -> 0.259 Inexact Rounded +sqtx3123 squareroot 0.68 -> 0.825 Inexact Rounded +sqtx3124 squareroot 0.068 -> 0.261 Inexact Rounded +sqtx3125 squareroot 0.69 -> 0.831 Inexact Rounded +sqtx3126 squareroot 0.069 -> 0.263 Inexact Rounded +sqtx3127 squareroot 0.71 -> 0.843 Inexact Rounded +sqtx3128 squareroot 0.071 -> 0.266 Inexact Rounded +sqtx3129 squareroot 0.72 -> 0.849 Inexact Rounded +sqtx3130 squareroot 0.072 -> 0.268 Inexact Rounded +sqtx3131 squareroot 0.73 -> 0.854 Inexact Rounded +sqtx3132 squareroot 0.073 -> 0.270 Inexact Rounded +sqtx3133 squareroot 0.74 -> 0.860 Inexact Rounded +sqtx3134 squareroot 0.074 -> 0.272 Inexact Rounded +sqtx3135 squareroot 0.75 -> 0.866 Inexact Rounded +sqtx3136 squareroot 0.075 -> 0.274 Inexact Rounded +sqtx3137 squareroot 0.76 -> 0.872 Inexact Rounded +sqtx3138 squareroot 0.076 -> 0.276 Inexact Rounded +sqtx3139 squareroot 0.77 -> 0.877 Inexact Rounded +sqtx3140 squareroot 0.077 -> 0.277 Inexact Rounded +sqtx3141 squareroot 0.78 -> 0.883 Inexact Rounded +sqtx3142 squareroot 0.078 -> 0.279 Inexact Rounded +sqtx3143 squareroot 0.79 -> 0.889 Inexact Rounded +sqtx3144 squareroot 0.079 -> 0.281 Inexact Rounded +sqtx3145 squareroot 0.81 -> 0.9 +sqtx3146 squareroot 0.081 -> 0.285 Inexact Rounded +sqtx3147 squareroot 0.82 -> 0.906 Inexact Rounded +sqtx3148 squareroot 0.082 -> 0.286 Inexact Rounded +sqtx3149 squareroot 0.83 -> 0.911 Inexact Rounded +sqtx3150 squareroot 0.083 -> 0.288 Inexact Rounded +sqtx3151 squareroot 0.84 -> 0.917 Inexact Rounded +sqtx3152 squareroot 0.084 -> 0.290 Inexact Rounded +sqtx3153 squareroot 0.85 -> 0.922 Inexact Rounded +sqtx3154 squareroot 0.085 -> 0.292 Inexact Rounded +sqtx3155 squareroot 0.86 -> 0.927 Inexact Rounded +sqtx3156 squareroot 0.086 -> 0.293 Inexact Rounded +sqtx3157 squareroot 0.87 -> 0.933 Inexact Rounded +sqtx3158 squareroot 0.087 -> 0.295 Inexact Rounded +sqtx3159 squareroot 0.88 -> 0.938 Inexact Rounded +sqtx3160 squareroot 0.088 -> 0.297 Inexact Rounded +sqtx3161 squareroot 0.89 -> 0.943 Inexact Rounded +sqtx3162 squareroot 0.089 -> 0.298 Inexact Rounded +sqtx3163 squareroot 0.91 -> 0.954 Inexact Rounded +sqtx3164 squareroot 0.091 -> 0.302 Inexact Rounded +sqtx3165 squareroot 0.92 -> 0.959 Inexact Rounded +sqtx3166 squareroot 0.092 -> 0.303 Inexact Rounded +sqtx3167 squareroot 0.93 -> 0.964 Inexact Rounded +sqtx3168 squareroot 0.093 -> 0.305 Inexact Rounded +sqtx3169 squareroot 0.94 -> 0.970 Inexact Rounded +sqtx3170 squareroot 0.094 -> 0.307 Inexact Rounded +sqtx3171 squareroot 0.95 -> 0.975 Inexact Rounded +sqtx3172 squareroot 0.095 -> 0.308 Inexact Rounded +sqtx3173 squareroot 0.96 -> 0.980 Inexact Rounded +sqtx3174 squareroot 0.096 -> 0.310 Inexact Rounded +sqtx3175 squareroot 0.97 -> 0.985 Inexact Rounded +sqtx3176 squareroot 0.097 -> 0.311 Inexact Rounded +sqtx3177 squareroot 0.98 -> 0.990 Inexact Rounded +sqtx3178 squareroot 0.098 -> 0.313 Inexact Rounded +sqtx3179 squareroot 0.99 -> 0.995 Inexact Rounded +sqtx3180 squareroot 0.099 -> 0.315 Inexact Rounded +sqtx3181 squareroot 0.101 -> 0.318 Inexact Rounded +sqtx3182 squareroot 0.0101 -> 0.100 Inexact Rounded +sqtx3183 squareroot 0.102 -> 0.319 Inexact Rounded +sqtx3184 squareroot 0.0102 -> 0.101 Inexact Rounded +sqtx3185 squareroot 0.103 -> 0.321 Inexact Rounded +sqtx3186 squareroot 0.0103 -> 0.101 Inexact Rounded +sqtx3187 squareroot 0.104 -> 0.322 Inexact Rounded +sqtx3188 squareroot 0.0104 -> 0.102 Inexact Rounded +sqtx3189 squareroot 0.105 -> 0.324 Inexact Rounded +sqtx3190 squareroot 0.0105 -> 0.102 Inexact Rounded +sqtx3191 squareroot 0.106 -> 0.326 Inexact Rounded +sqtx3192 squareroot 0.0106 -> 0.103 Inexact Rounded +sqtx3193 squareroot 0.107 -> 0.327 Inexact Rounded +sqtx3194 squareroot 0.0107 -> 0.103 Inexact Rounded +sqtx3195 squareroot 0.108 -> 0.329 Inexact Rounded +sqtx3196 squareroot 0.0108 -> 0.104 Inexact Rounded +sqtx3197 squareroot 0.109 -> 0.330 Inexact Rounded +sqtx3198 squareroot 0.0109 -> 0.104 Inexact Rounded +sqtx3199 squareroot 0.111 -> 0.333 Inexact Rounded +sqtx3200 squareroot 0.0111 -> 0.105 Inexact Rounded +sqtx3201 squareroot 0.112 -> 0.335 Inexact Rounded +sqtx3202 squareroot 0.0112 -> 0.106 Inexact Rounded +sqtx3203 squareroot 0.113 -> 0.336 Inexact Rounded +sqtx3204 squareroot 0.0113 -> 0.106 Inexact Rounded +sqtx3205 squareroot 0.114 -> 0.338 Inexact Rounded +sqtx3206 squareroot 0.0114 -> 0.107 Inexact Rounded +sqtx3207 squareroot 0.115 -> 0.339 Inexact Rounded +sqtx3208 squareroot 0.0115 -> 0.107 Inexact Rounded +sqtx3209 squareroot 0.116 -> 0.341 Inexact Rounded +sqtx3210 squareroot 0.0116 -> 0.108 Inexact Rounded +sqtx3211 squareroot 0.117 -> 0.342 Inexact Rounded +sqtx3212 squareroot 0.0117 -> 0.108 Inexact Rounded +sqtx3213 squareroot 0.118 -> 0.344 Inexact Rounded +sqtx3214 squareroot 0.0118 -> 0.109 Inexact Rounded +sqtx3215 squareroot 0.119 -> 0.345 Inexact Rounded +sqtx3216 squareroot 0.0119 -> 0.109 Inexact Rounded +sqtx3217 squareroot 0.121 -> 0.348 Inexact Rounded +sqtx3218 squareroot 0.0121 -> 0.11 +sqtx3219 squareroot 0.122 -> 0.349 Inexact Rounded +sqtx3220 squareroot 0.0122 -> 0.110 Inexact Rounded +sqtx3221 squareroot 0.123 -> 0.351 Inexact Rounded +sqtx3222 squareroot 0.0123 -> 0.111 Inexact Rounded +sqtx3223 squareroot 0.124 -> 0.352 Inexact Rounded +sqtx3224 squareroot 0.0124 -> 0.111 Inexact Rounded +sqtx3225 squareroot 0.125 -> 0.354 Inexact Rounded +sqtx3226 squareroot 0.0125 -> 0.112 Inexact Rounded +sqtx3227 squareroot 0.126 -> 0.355 Inexact Rounded +sqtx3228 squareroot 0.0126 -> 0.112 Inexact Rounded +sqtx3229 squareroot 0.127 -> 0.356 Inexact Rounded +sqtx3230 squareroot 0.0127 -> 0.113 Inexact Rounded +sqtx3231 squareroot 0.128 -> 0.358 Inexact Rounded +sqtx3232 squareroot 0.0128 -> 0.113 Inexact Rounded +sqtx3233 squareroot 0.129 -> 0.359 Inexact Rounded +sqtx3234 squareroot 0.0129 -> 0.114 Inexact Rounded +sqtx3235 squareroot 0.131 -> 0.362 Inexact Rounded +sqtx3236 squareroot 0.0131 -> 0.114 Inexact Rounded +sqtx3237 squareroot 0.132 -> 0.363 Inexact Rounded +sqtx3238 squareroot 0.0132 -> 0.115 Inexact Rounded +sqtx3239 squareroot 0.133 -> 0.365 Inexact Rounded +sqtx3240 squareroot 0.0133 -> 0.115 Inexact Rounded +sqtx3241 squareroot 0.134 -> 0.366 Inexact Rounded +sqtx3242 squareroot 0.0134 -> 0.116 Inexact Rounded +sqtx3243 squareroot 0.135 -> 0.367 Inexact Rounded +sqtx3244 squareroot 0.0135 -> 0.116 Inexact Rounded +sqtx3245 squareroot 0.136 -> 0.369 Inexact Rounded +sqtx3246 squareroot 0.0136 -> 0.117 Inexact Rounded +sqtx3247 squareroot 0.137 -> 0.370 Inexact Rounded +sqtx3248 squareroot 0.0137 -> 0.117 Inexact Rounded +sqtx3249 squareroot 0.138 -> 0.371 Inexact Rounded +sqtx3250 squareroot 0.0138 -> 0.117 Inexact Rounded +sqtx3251 squareroot 0.139 -> 0.373 Inexact Rounded +sqtx3252 squareroot 0.0139 -> 0.118 Inexact Rounded +sqtx3253 squareroot 0.141 -> 0.375 Inexact Rounded +sqtx3254 squareroot 0.0141 -> 0.119 Inexact Rounded +sqtx3255 squareroot 0.142 -> 0.377 Inexact Rounded +sqtx3256 squareroot 0.0142 -> 0.119 Inexact Rounded +sqtx3257 squareroot 0.143 -> 0.378 Inexact Rounded +sqtx3258 squareroot 0.0143 -> 0.120 Inexact Rounded +sqtx3259 squareroot 0.144 -> 0.379 Inexact Rounded +sqtx3260 squareroot 0.0144 -> 0.12 +sqtx3261 squareroot 0.145 -> 0.381 Inexact Rounded +sqtx3262 squareroot 0.0145 -> 0.120 Inexact Rounded +sqtx3263 squareroot 0.146 -> 0.382 Inexact Rounded +sqtx3264 squareroot 0.0146 -> 0.121 Inexact Rounded +sqtx3265 squareroot 0.147 -> 0.383 Inexact Rounded +sqtx3266 squareroot 0.0147 -> 0.121 Inexact Rounded +sqtx3267 squareroot 0.148 -> 0.385 Inexact Rounded +sqtx3268 squareroot 0.0148 -> 0.122 Inexact Rounded +sqtx3269 squareroot 0.149 -> 0.386 Inexact Rounded +sqtx3270 squareroot 0.0149 -> 0.122 Inexact Rounded +sqtx3271 squareroot 0.151 -> 0.389 Inexact Rounded +sqtx3272 squareroot 0.0151 -> 0.123 Inexact Rounded +sqtx3273 squareroot 0.152 -> 0.390 Inexact Rounded +sqtx3274 squareroot 0.0152 -> 0.123 Inexact Rounded +sqtx3275 squareroot 0.153 -> 0.391 Inexact Rounded +sqtx3276 squareroot 0.0153 -> 0.124 Inexact Rounded +sqtx3277 squareroot 0.154 -> 0.392 Inexact Rounded +sqtx3278 squareroot 0.0154 -> 0.124 Inexact Rounded +sqtx3279 squareroot 0.155 -> 0.394 Inexact Rounded +sqtx3280 squareroot 0.0155 -> 0.124 Inexact Rounded +sqtx3281 squareroot 0.156 -> 0.395 Inexact Rounded +sqtx3282 squareroot 0.0156 -> 0.125 Inexact Rounded +sqtx3283 squareroot 0.157 -> 0.396 Inexact Rounded +sqtx3284 squareroot 0.0157 -> 0.125 Inexact Rounded +sqtx3285 squareroot 0.158 -> 0.397 Inexact Rounded +sqtx3286 squareroot 0.0158 -> 0.126 Inexact Rounded +sqtx3287 squareroot 0.159 -> 0.399 Inexact Rounded +sqtx3288 squareroot 0.0159 -> 0.126 Inexact Rounded +sqtx3289 squareroot 0.161 -> 0.401 Inexact Rounded +sqtx3290 squareroot 0.0161 -> 0.127 Inexact Rounded +sqtx3291 squareroot 0.162 -> 0.402 Inexact Rounded +sqtx3292 squareroot 0.0162 -> 0.127 Inexact Rounded +sqtx3293 squareroot 0.163 -> 0.404 Inexact Rounded +sqtx3294 squareroot 0.0163 -> 0.128 Inexact Rounded +sqtx3295 squareroot 0.164 -> 0.405 Inexact Rounded +sqtx3296 squareroot 0.0164 -> 0.128 Inexact Rounded +sqtx3297 squareroot 0.165 -> 0.406 Inexact Rounded +sqtx3298 squareroot 0.0165 -> 0.128 Inexact Rounded +sqtx3299 squareroot 0.166 -> 0.407 Inexact Rounded +sqtx3300 squareroot 0.0166 -> 0.129 Inexact Rounded +sqtx3301 squareroot 0.167 -> 0.409 Inexact Rounded +sqtx3302 squareroot 0.0167 -> 0.129 Inexact Rounded +sqtx3303 squareroot 0.168 -> 0.410 Inexact Rounded +sqtx3304 squareroot 0.0168 -> 0.130 Inexact Rounded +sqtx3305 squareroot 0.169 -> 0.411 Inexact Rounded +sqtx3306 squareroot 0.0169 -> 0.13 +sqtx3307 squareroot 0.171 -> 0.414 Inexact Rounded +sqtx3308 squareroot 0.0171 -> 0.131 Inexact Rounded +sqtx3309 squareroot 0.172 -> 0.415 Inexact Rounded +sqtx3310 squareroot 0.0172 -> 0.131 Inexact Rounded +sqtx3311 squareroot 0.173 -> 0.416 Inexact Rounded +sqtx3312 squareroot 0.0173 -> 0.132 Inexact Rounded +sqtx3313 squareroot 0.174 -> 0.417 Inexact Rounded +sqtx3314 squareroot 0.0174 -> 0.132 Inexact Rounded +sqtx3315 squareroot 0.175 -> 0.418 Inexact Rounded +sqtx3316 squareroot 0.0175 -> 0.132 Inexact Rounded +sqtx3317 squareroot 0.176 -> 0.420 Inexact Rounded +sqtx3318 squareroot 0.0176 -> 0.133 Inexact Rounded +sqtx3319 squareroot 0.177 -> 0.421 Inexact Rounded +sqtx3320 squareroot 0.0177 -> 0.133 Inexact Rounded +sqtx3321 squareroot 0.178 -> 0.422 Inexact Rounded +sqtx3322 squareroot 0.0178 -> 0.133 Inexact Rounded +sqtx3323 squareroot 0.179 -> 0.423 Inexact Rounded +sqtx3324 squareroot 0.0179 -> 0.134 Inexact Rounded +sqtx3325 squareroot 0.181 -> 0.425 Inexact Rounded +sqtx3326 squareroot 0.0181 -> 0.135 Inexact Rounded +sqtx3327 squareroot 0.182 -> 0.427 Inexact Rounded +sqtx3328 squareroot 0.0182 -> 0.135 Inexact Rounded +sqtx3329 squareroot 0.183 -> 0.428 Inexact Rounded +sqtx3330 squareroot 0.0183 -> 0.135 Inexact Rounded +sqtx3331 squareroot 0.184 -> 0.429 Inexact Rounded +sqtx3332 squareroot 0.0184 -> 0.136 Inexact Rounded +sqtx3333 squareroot 0.185 -> 0.430 Inexact Rounded +sqtx3334 squareroot 0.0185 -> 0.136 Inexact Rounded +sqtx3335 squareroot 0.186 -> 0.431 Inexact Rounded +sqtx3336 squareroot 0.0186 -> 0.136 Inexact Rounded +sqtx3337 squareroot 0.187 -> 0.432 Inexact Rounded +sqtx3338 squareroot 0.0187 -> 0.137 Inexact Rounded +sqtx3339 squareroot 0.188 -> 0.434 Inexact Rounded +sqtx3340 squareroot 0.0188 -> 0.137 Inexact Rounded +sqtx3341 squareroot 0.189 -> 0.435 Inexact Rounded +sqtx3342 squareroot 0.0189 -> 0.137 Inexact Rounded +sqtx3343 squareroot 0.191 -> 0.437 Inexact Rounded +sqtx3344 squareroot 0.0191 -> 0.138 Inexact Rounded +sqtx3345 squareroot 0.192 -> 0.438 Inexact Rounded +sqtx3346 squareroot 0.0192 -> 0.139 Inexact Rounded +sqtx3347 squareroot 0.193 -> 0.439 Inexact Rounded +sqtx3348 squareroot 0.0193 -> 0.139 Inexact Rounded +sqtx3349 squareroot 0.194 -> 0.440 Inexact Rounded +sqtx3350 squareroot 0.0194 -> 0.139 Inexact Rounded +sqtx3351 squareroot 0.195 -> 0.442 Inexact Rounded +sqtx3352 squareroot 0.0195 -> 0.140 Inexact Rounded +sqtx3353 squareroot 0.196 -> 0.443 Inexact Rounded +sqtx3354 squareroot 0.0196 -> 0.14 +sqtx3355 squareroot 0.197 -> 0.444 Inexact Rounded +sqtx3356 squareroot 0.0197 -> 0.140 Inexact Rounded +sqtx3357 squareroot 0.198 -> 0.445 Inexact Rounded +sqtx3358 squareroot 0.0198 -> 0.141 Inexact Rounded +sqtx3359 squareroot 0.199 -> 0.446 Inexact Rounded +sqtx3360 squareroot 0.0199 -> 0.141 Inexact Rounded +sqtx3361 squareroot 0.201 -> 0.448 Inexact Rounded +sqtx3362 squareroot 0.0201 -> 0.142 Inexact Rounded +sqtx3363 squareroot 0.202 -> 0.449 Inexact Rounded +sqtx3364 squareroot 0.0202 -> 0.142 Inexact Rounded +sqtx3365 squareroot 0.203 -> 0.451 Inexact Rounded +sqtx3366 squareroot 0.0203 -> 0.142 Inexact Rounded +sqtx3367 squareroot 0.204 -> 0.452 Inexact Rounded +sqtx3368 squareroot 0.0204 -> 0.143 Inexact Rounded +sqtx3369 squareroot 0.205 -> 0.453 Inexact Rounded +sqtx3370 squareroot 0.0205 -> 0.143 Inexact Rounded +sqtx3371 squareroot 0.206 -> 0.454 Inexact Rounded +sqtx3372 squareroot 0.0206 -> 0.144 Inexact Rounded +sqtx3373 squareroot 0.207 -> 0.455 Inexact Rounded +sqtx3374 squareroot 0.0207 -> 0.144 Inexact Rounded +sqtx3375 squareroot 0.208 -> 0.456 Inexact Rounded +sqtx3376 squareroot 0.0208 -> 0.144 Inexact Rounded +sqtx3377 squareroot 0.209 -> 0.457 Inexact Rounded +sqtx3378 squareroot 0.0209 -> 0.145 Inexact Rounded +sqtx3379 squareroot 0.211 -> 0.459 Inexact Rounded +sqtx3380 squareroot 0.0211 -> 0.145 Inexact Rounded +sqtx3381 squareroot 0.212 -> 0.460 Inexact Rounded +sqtx3382 squareroot 0.0212 -> 0.146 Inexact Rounded +sqtx3383 squareroot 0.213 -> 0.462 Inexact Rounded +sqtx3384 squareroot 0.0213 -> 0.146 Inexact Rounded +sqtx3385 squareroot 0.214 -> 0.463 Inexact Rounded +sqtx3386 squareroot 0.0214 -> 0.146 Inexact Rounded +sqtx3387 squareroot 0.215 -> 0.464 Inexact Rounded +sqtx3388 squareroot 0.0215 -> 0.147 Inexact Rounded +sqtx3389 squareroot 0.216 -> 0.465 Inexact Rounded +sqtx3390 squareroot 0.0216 -> 0.147 Inexact Rounded +sqtx3391 squareroot 0.217 -> 0.466 Inexact Rounded +sqtx3392 squareroot 0.0217 -> 0.147 Inexact Rounded +sqtx3393 squareroot 0.218 -> 0.467 Inexact Rounded +sqtx3394 squareroot 0.0218 -> 0.148 Inexact Rounded +sqtx3395 squareroot 0.219 -> 0.468 Inexact Rounded +sqtx3396 squareroot 0.0219 -> 0.148 Inexact Rounded +sqtx3397 squareroot 0.221 -> 0.470 Inexact Rounded +sqtx3398 squareroot 0.0221 -> 0.149 Inexact Rounded +sqtx3399 squareroot 0.222 -> 0.471 Inexact Rounded +sqtx3400 squareroot 0.0222 -> 0.149 Inexact Rounded +sqtx3401 squareroot 0.223 -> 0.472 Inexact Rounded +sqtx3402 squareroot 0.0223 -> 0.149 Inexact Rounded +sqtx3403 squareroot 0.224 -> 0.473 Inexact Rounded +sqtx3404 squareroot 0.0224 -> 0.150 Inexact Rounded +sqtx3405 squareroot 0.225 -> 0.474 Inexact Rounded +sqtx3406 squareroot 0.0225 -> 0.15 +sqtx3407 squareroot 0.226 -> 0.475 Inexact Rounded +sqtx3408 squareroot 0.0226 -> 0.150 Inexact Rounded +sqtx3409 squareroot 0.227 -> 0.476 Inexact Rounded +sqtx3410 squareroot 0.0227 -> 0.151 Inexact Rounded +sqtx3411 squareroot 0.228 -> 0.477 Inexact Rounded +sqtx3412 squareroot 0.0228 -> 0.151 Inexact Rounded +sqtx3413 squareroot 0.229 -> 0.479 Inexact Rounded +sqtx3414 squareroot 0.0229 -> 0.151 Inexact Rounded +sqtx3415 squareroot 0.231 -> 0.481 Inexact Rounded +sqtx3416 squareroot 0.0231 -> 0.152 Inexact Rounded +sqtx3417 squareroot 0.232 -> 0.482 Inexact Rounded +sqtx3418 squareroot 0.0232 -> 0.152 Inexact Rounded +sqtx3419 squareroot 0.233 -> 0.483 Inexact Rounded +sqtx3420 squareroot 0.0233 -> 0.153 Inexact Rounded +sqtx3421 squareroot 0.234 -> 0.484 Inexact Rounded +sqtx3422 squareroot 0.0234 -> 0.153 Inexact Rounded +sqtx3423 squareroot 0.235 -> 0.485 Inexact Rounded +sqtx3424 squareroot 0.0235 -> 0.153 Inexact Rounded +sqtx3425 squareroot 0.236 -> 0.486 Inexact Rounded +sqtx3426 squareroot 0.0236 -> 0.154 Inexact Rounded +sqtx3427 squareroot 0.237 -> 0.487 Inexact Rounded +sqtx3428 squareroot 0.0237 -> 0.154 Inexact Rounded +sqtx3429 squareroot 0.238 -> 0.488 Inexact Rounded +sqtx3430 squareroot 0.0238 -> 0.154 Inexact Rounded +sqtx3431 squareroot 0.239 -> 0.489 Inexact Rounded +sqtx3432 squareroot 0.0239 -> 0.155 Inexact Rounded +sqtx3433 squareroot 0.241 -> 0.491 Inexact Rounded +sqtx3434 squareroot 0.0241 -> 0.155 Inexact Rounded +sqtx3435 squareroot 0.242 -> 0.492 Inexact Rounded +sqtx3436 squareroot 0.0242 -> 0.156 Inexact Rounded +sqtx3437 squareroot 0.243 -> 0.493 Inexact Rounded +sqtx3438 squareroot 0.0243 -> 0.156 Inexact Rounded +sqtx3439 squareroot 0.244 -> 0.494 Inexact Rounded +sqtx3440 squareroot 0.0244 -> 0.156 Inexact Rounded +sqtx3441 squareroot 0.245 -> 0.495 Inexact Rounded +sqtx3442 squareroot 0.0245 -> 0.157 Inexact Rounded +sqtx3443 squareroot 0.246 -> 0.496 Inexact Rounded +sqtx3444 squareroot 0.0246 -> 0.157 Inexact Rounded +sqtx3445 squareroot 0.247 -> 0.497 Inexact Rounded +sqtx3446 squareroot 0.0247 -> 0.157 Inexact Rounded +sqtx3447 squareroot 0.248 -> 0.498 Inexact Rounded +sqtx3448 squareroot 0.0248 -> 0.157 Inexact Rounded +sqtx3449 squareroot 0.249 -> 0.499 Inexact Rounded +sqtx3450 squareroot 0.0249 -> 0.158 Inexact Rounded +sqtx3451 squareroot 0.251 -> 0.501 Inexact Rounded +sqtx3452 squareroot 0.0251 -> 0.158 Inexact Rounded +sqtx3453 squareroot 0.252 -> 0.502 Inexact Rounded +sqtx3454 squareroot 0.0252 -> 0.159 Inexact Rounded +sqtx3455 squareroot 0.253 -> 0.503 Inexact Rounded +sqtx3456 squareroot 0.0253 -> 0.159 Inexact Rounded +sqtx3457 squareroot 0.254 -> 0.504 Inexact Rounded +sqtx3458 squareroot 0.0254 -> 0.159 Inexact Rounded +sqtx3459 squareroot 0.255 -> 0.505 Inexact Rounded +sqtx3460 squareroot 0.0255 -> 0.160 Inexact Rounded +sqtx3461 squareroot 0.256 -> 0.506 Inexact Rounded +sqtx3462 squareroot 0.0256 -> 0.16 +sqtx3463 squareroot 0.257 -> 0.507 Inexact Rounded +sqtx3464 squareroot 0.0257 -> 0.160 Inexact Rounded +sqtx3465 squareroot 0.258 -> 0.508 Inexact Rounded +sqtx3466 squareroot 0.0258 -> 0.161 Inexact Rounded +sqtx3467 squareroot 0.259 -> 0.509 Inexact Rounded +sqtx3468 squareroot 0.0259 -> 0.161 Inexact Rounded +sqtx3469 squareroot 0.261 -> 0.511 Inexact Rounded +sqtx3470 squareroot 0.0261 -> 0.162 Inexact Rounded +sqtx3471 squareroot 0.262 -> 0.512 Inexact Rounded +sqtx3472 squareroot 0.0262 -> 0.162 Inexact Rounded +sqtx3473 squareroot 0.263 -> 0.513 Inexact Rounded +sqtx3474 squareroot 0.0263 -> 0.162 Inexact Rounded +sqtx3475 squareroot 0.264 -> 0.514 Inexact Rounded +sqtx3476 squareroot 0.0264 -> 0.162 Inexact Rounded +sqtx3477 squareroot 0.265 -> 0.515 Inexact Rounded +sqtx3478 squareroot 0.0265 -> 0.163 Inexact Rounded +sqtx3479 squareroot 0.266 -> 0.516 Inexact Rounded +sqtx3480 squareroot 0.0266 -> 0.163 Inexact Rounded +sqtx3481 squareroot 0.267 -> 0.517 Inexact Rounded +sqtx3482 squareroot 0.0267 -> 0.163 Inexact Rounded +sqtx3483 squareroot 0.268 -> 0.518 Inexact Rounded +sqtx3484 squareroot 0.0268 -> 0.164 Inexact Rounded +sqtx3485 squareroot 0.269 -> 0.519 Inexact Rounded +sqtx3486 squareroot 0.0269 -> 0.164 Inexact Rounded +sqtx3487 squareroot 0.271 -> 0.521 Inexact Rounded +sqtx3488 squareroot 0.0271 -> 0.165 Inexact Rounded +sqtx3489 squareroot 0.272 -> 0.522 Inexact Rounded +sqtx3490 squareroot 0.0272 -> 0.165 Inexact Rounded +sqtx3491 squareroot 0.273 -> 0.522 Inexact Rounded +sqtx3492 squareroot 0.0273 -> 0.165 Inexact Rounded +sqtx3493 squareroot 0.274 -> 0.523 Inexact Rounded +sqtx3494 squareroot 0.0274 -> 0.166 Inexact Rounded +sqtx3495 squareroot 0.275 -> 0.524 Inexact Rounded +sqtx3496 squareroot 0.0275 -> 0.166 Inexact Rounded +sqtx3497 squareroot 0.276 -> 0.525 Inexact Rounded +sqtx3498 squareroot 0.0276 -> 0.166 Inexact Rounded +sqtx3499 squareroot 0.277 -> 0.526 Inexact Rounded +sqtx3500 squareroot 0.0277 -> 0.166 Inexact Rounded +sqtx3501 squareroot 0.278 -> 0.527 Inexact Rounded +sqtx3502 squareroot 0.0278 -> 0.167 Inexact Rounded +sqtx3503 squareroot 0.279 -> 0.528 Inexact Rounded +sqtx3504 squareroot 0.0279 -> 0.167 Inexact Rounded +sqtx3505 squareroot 0.281 -> 0.530 Inexact Rounded +sqtx3506 squareroot 0.0281 -> 0.168 Inexact Rounded +sqtx3507 squareroot 0.282 -> 0.531 Inexact Rounded +sqtx3508 squareroot 0.0282 -> 0.168 Inexact Rounded +sqtx3509 squareroot 0.283 -> 0.532 Inexact Rounded +sqtx3510 squareroot 0.0283 -> 0.168 Inexact Rounded +sqtx3511 squareroot 0.284 -> 0.533 Inexact Rounded +sqtx3512 squareroot 0.0284 -> 0.169 Inexact Rounded +sqtx3513 squareroot 0.285 -> 0.534 Inexact Rounded +sqtx3514 squareroot 0.0285 -> 0.169 Inexact Rounded +sqtx3515 squareroot 0.286 -> 0.535 Inexact Rounded +sqtx3516 squareroot 0.0286 -> 0.169 Inexact Rounded +sqtx3517 squareroot 0.287 -> 0.536 Inexact Rounded +sqtx3518 squareroot 0.0287 -> 0.169 Inexact Rounded +sqtx3519 squareroot 0.288 -> 0.537 Inexact Rounded +sqtx3520 squareroot 0.0288 -> 0.170 Inexact Rounded +sqtx3521 squareroot 0.289 -> 0.538 Inexact Rounded +sqtx3522 squareroot 0.0289 -> 0.17 +sqtx3523 squareroot 0.291 -> 0.539 Inexact Rounded +sqtx3524 squareroot 0.0291 -> 0.171 Inexact Rounded +sqtx3525 squareroot 0.292 -> 0.540 Inexact Rounded +sqtx3526 squareroot 0.0292 -> 0.171 Inexact Rounded +sqtx3527 squareroot 0.293 -> 0.541 Inexact Rounded +sqtx3528 squareroot 0.0293 -> 0.171 Inexact Rounded +sqtx3529 squareroot 0.294 -> 0.542 Inexact Rounded +sqtx3530 squareroot 0.0294 -> 0.171 Inexact Rounded +sqtx3531 squareroot 0.295 -> 0.543 Inexact Rounded +sqtx3532 squareroot 0.0295 -> 0.172 Inexact Rounded +sqtx3533 squareroot 0.296 -> 0.544 Inexact Rounded +sqtx3534 squareroot 0.0296 -> 0.172 Inexact Rounded +sqtx3535 squareroot 0.297 -> 0.545 Inexact Rounded +sqtx3536 squareroot 0.0297 -> 0.172 Inexact Rounded +sqtx3537 squareroot 0.298 -> 0.546 Inexact Rounded +sqtx3538 squareroot 0.0298 -> 0.173 Inexact Rounded +sqtx3539 squareroot 0.299 -> 0.547 Inexact Rounded +sqtx3540 squareroot 0.0299 -> 0.173 Inexact Rounded +sqtx3541 squareroot 0.301 -> 0.549 Inexact Rounded +sqtx3542 squareroot 0.0301 -> 0.173 Inexact Rounded +sqtx3543 squareroot 0.302 -> 0.550 Inexact Rounded +sqtx3544 squareroot 0.0302 -> 0.174 Inexact Rounded +sqtx3545 squareroot 0.303 -> 0.550 Inexact Rounded +sqtx3546 squareroot 0.0303 -> 0.174 Inexact Rounded +sqtx3547 squareroot 0.304 -> 0.551 Inexact Rounded +sqtx3548 squareroot 0.0304 -> 0.174 Inexact Rounded +sqtx3549 squareroot 0.305 -> 0.552 Inexact Rounded +sqtx3550 squareroot 0.0305 -> 0.175 Inexact Rounded +sqtx3551 squareroot 0.306 -> 0.553 Inexact Rounded +sqtx3552 squareroot 0.0306 -> 0.175 Inexact Rounded +sqtx3553 squareroot 0.307 -> 0.554 Inexact Rounded +sqtx3554 squareroot 0.0307 -> 0.175 Inexact Rounded +sqtx3555 squareroot 0.308 -> 0.555 Inexact Rounded +sqtx3556 squareroot 0.0308 -> 0.175 Inexact Rounded +sqtx3557 squareroot 0.309 -> 0.556 Inexact Rounded +sqtx3558 squareroot 0.0309 -> 0.176 Inexact Rounded +sqtx3559 squareroot 0.311 -> 0.558 Inexact Rounded +sqtx3560 squareroot 0.0311 -> 0.176 Inexact Rounded +sqtx3561 squareroot 0.312 -> 0.559 Inexact Rounded +sqtx3562 squareroot 0.0312 -> 0.177 Inexact Rounded +sqtx3563 squareroot 0.313 -> 0.559 Inexact Rounded +sqtx3564 squareroot 0.0313 -> 0.177 Inexact Rounded +sqtx3565 squareroot 0.314 -> 0.560 Inexact Rounded +sqtx3566 squareroot 0.0314 -> 0.177 Inexact Rounded +sqtx3567 squareroot 0.315 -> 0.561 Inexact Rounded +sqtx3568 squareroot 0.0315 -> 0.177 Inexact Rounded +sqtx3569 squareroot 0.316 -> 0.562 Inexact Rounded +sqtx3570 squareroot 0.0316 -> 0.178 Inexact Rounded +sqtx3571 squareroot 0.317 -> 0.563 Inexact Rounded +sqtx3572 squareroot 0.0317 -> 0.178 Inexact Rounded +sqtx3573 squareroot 0.318 -> 0.564 Inexact Rounded +sqtx3574 squareroot 0.0318 -> 0.178 Inexact Rounded +sqtx3575 squareroot 0.319 -> 0.565 Inexact Rounded +sqtx3576 squareroot 0.0319 -> 0.179 Inexact Rounded +sqtx3577 squareroot 0.321 -> 0.567 Inexact Rounded +sqtx3578 squareroot 0.0321 -> 0.179 Inexact Rounded +sqtx3579 squareroot 0.322 -> 0.567 Inexact Rounded +sqtx3580 squareroot 0.0322 -> 0.179 Inexact Rounded +sqtx3581 squareroot 0.323 -> 0.568 Inexact Rounded +sqtx3582 squareroot 0.0323 -> 0.180 Inexact Rounded +sqtx3583 squareroot 0.324 -> 0.569 Inexact Rounded +sqtx3584 squareroot 0.0324 -> 0.18 +sqtx3585 squareroot 0.325 -> 0.570 Inexact Rounded +sqtx3586 squareroot 0.0325 -> 0.180 Inexact Rounded +sqtx3587 squareroot 0.326 -> 0.571 Inexact Rounded +sqtx3588 squareroot 0.0326 -> 0.181 Inexact Rounded +sqtx3589 squareroot 0.327 -> 0.572 Inexact Rounded +sqtx3590 squareroot 0.0327 -> 0.181 Inexact Rounded +sqtx3591 squareroot 0.328 -> 0.573 Inexact Rounded +sqtx3592 squareroot 0.0328 -> 0.181 Inexact Rounded +sqtx3593 squareroot 0.329 -> 0.574 Inexact Rounded +sqtx3594 squareroot 0.0329 -> 0.181 Inexact Rounded +sqtx3595 squareroot 0.331 -> 0.575 Inexact Rounded +sqtx3596 squareroot 0.0331 -> 0.182 Inexact Rounded +sqtx3597 squareroot 0.332 -> 0.576 Inexact Rounded +sqtx3598 squareroot 0.0332 -> 0.182 Inexact Rounded +sqtx3599 squareroot 0.333 -> 0.577 Inexact Rounded +sqtx3600 squareroot 0.0333 -> 0.182 Inexact Rounded +sqtx3601 squareroot 0.334 -> 0.578 Inexact Rounded +sqtx3602 squareroot 0.0334 -> 0.183 Inexact Rounded +sqtx3603 squareroot 0.335 -> 0.579 Inexact Rounded +sqtx3604 squareroot 0.0335 -> 0.183 Inexact Rounded +sqtx3605 squareroot 0.336 -> 0.580 Inexact Rounded +sqtx3606 squareroot 0.0336 -> 0.183 Inexact Rounded +sqtx3607 squareroot 0.337 -> 0.581 Inexact Rounded +sqtx3608 squareroot 0.0337 -> 0.184 Inexact Rounded +sqtx3609 squareroot 0.338 -> 0.581 Inexact Rounded +sqtx3610 squareroot 0.0338 -> 0.184 Inexact Rounded +sqtx3611 squareroot 0.339 -> 0.582 Inexact Rounded +sqtx3612 squareroot 0.0339 -> 0.184 Inexact Rounded +sqtx3613 squareroot 0.341 -> 0.584 Inexact Rounded +sqtx3614 squareroot 0.0341 -> 0.185 Inexact Rounded +sqtx3615 squareroot 0.342 -> 0.585 Inexact Rounded +sqtx3616 squareroot 0.0342 -> 0.185 Inexact Rounded +sqtx3617 squareroot 0.343 -> 0.586 Inexact Rounded +sqtx3618 squareroot 0.0343 -> 0.185 Inexact Rounded +sqtx3619 squareroot 0.344 -> 0.587 Inexact Rounded +sqtx3620 squareroot 0.0344 -> 0.185 Inexact Rounded +sqtx3621 squareroot 0.345 -> 0.587 Inexact Rounded +sqtx3622 squareroot 0.0345 -> 0.186 Inexact Rounded +sqtx3623 squareroot 0.346 -> 0.588 Inexact Rounded +sqtx3624 squareroot 0.0346 -> 0.186 Inexact Rounded +sqtx3625 squareroot 0.347 -> 0.589 Inexact Rounded +sqtx3626 squareroot 0.0347 -> 0.186 Inexact Rounded +sqtx3627 squareroot 0.348 -> 0.590 Inexact Rounded +sqtx3628 squareroot 0.0348 -> 0.187 Inexact Rounded +sqtx3629 squareroot 0.349 -> 0.591 Inexact Rounded +sqtx3630 squareroot 0.0349 -> 0.187 Inexact Rounded +sqtx3631 squareroot 0.351 -> 0.592 Inexact Rounded +sqtx3632 squareroot 0.0351 -> 0.187 Inexact Rounded +sqtx3633 squareroot 0.352 -> 0.593 Inexact Rounded +sqtx3634 squareroot 0.0352 -> 0.188 Inexact Rounded +sqtx3635 squareroot 0.353 -> 0.594 Inexact Rounded +sqtx3636 squareroot 0.0353 -> 0.188 Inexact Rounded +sqtx3637 squareroot 0.354 -> 0.595 Inexact Rounded +sqtx3638 squareroot 0.0354 -> 0.188 Inexact Rounded +sqtx3639 squareroot 0.355 -> 0.596 Inexact Rounded +sqtx3640 squareroot 0.0355 -> 0.188 Inexact Rounded +sqtx3641 squareroot 0.356 -> 0.597 Inexact Rounded +sqtx3642 squareroot 0.0356 -> 0.189 Inexact Rounded +sqtx3643 squareroot 0.357 -> 0.597 Inexact Rounded +sqtx3644 squareroot 0.0357 -> 0.189 Inexact Rounded +sqtx3645 squareroot 0.358 -> 0.598 Inexact Rounded +sqtx3646 squareroot 0.0358 -> 0.189 Inexact Rounded +sqtx3647 squareroot 0.359 -> 0.599 Inexact Rounded +sqtx3648 squareroot 0.0359 -> 0.189 Inexact Rounded +sqtx3649 squareroot 0.361 -> 0.601 Inexact Rounded +sqtx3650 squareroot 0.0361 -> 0.19 +sqtx3651 squareroot 0.362 -> 0.602 Inexact Rounded +sqtx3652 squareroot 0.0362 -> 0.190 Inexact Rounded +sqtx3653 squareroot 0.363 -> 0.602 Inexact Rounded +sqtx3654 squareroot 0.0363 -> 0.191 Inexact Rounded +sqtx3655 squareroot 0.364 -> 0.603 Inexact Rounded +sqtx3656 squareroot 0.0364 -> 0.191 Inexact Rounded +sqtx3657 squareroot 0.365 -> 0.604 Inexact Rounded +sqtx3658 squareroot 0.0365 -> 0.191 Inexact Rounded +sqtx3659 squareroot 0.366 -> 0.605 Inexact Rounded +sqtx3660 squareroot 0.0366 -> 0.191 Inexact Rounded +sqtx3661 squareroot 0.367 -> 0.606 Inexact Rounded +sqtx3662 squareroot 0.0367 -> 0.192 Inexact Rounded +sqtx3663 squareroot 0.368 -> 0.607 Inexact Rounded +sqtx3664 squareroot 0.0368 -> 0.192 Inexact Rounded +sqtx3665 squareroot 0.369 -> 0.607 Inexact Rounded +sqtx3666 squareroot 0.0369 -> 0.192 Inexact Rounded +sqtx3667 squareroot 0.371 -> 0.609 Inexact Rounded +sqtx3668 squareroot 0.0371 -> 0.193 Inexact Rounded +sqtx3669 squareroot 0.372 -> 0.610 Inexact Rounded +sqtx3670 squareroot 0.0372 -> 0.193 Inexact Rounded +sqtx3671 squareroot 0.373 -> 0.611 Inexact Rounded +sqtx3672 squareroot 0.0373 -> 0.193 Inexact Rounded +sqtx3673 squareroot 0.374 -> 0.612 Inexact Rounded +sqtx3674 squareroot 0.0374 -> 0.193 Inexact Rounded +sqtx3675 squareroot 0.375 -> 0.612 Inexact Rounded +sqtx3676 squareroot 0.0375 -> 0.194 Inexact Rounded +sqtx3677 squareroot 0.376 -> 0.613 Inexact Rounded +sqtx3678 squareroot 0.0376 -> 0.194 Inexact Rounded +sqtx3679 squareroot 0.377 -> 0.614 Inexact Rounded +sqtx3680 squareroot 0.0377 -> 0.194 Inexact Rounded +sqtx3681 squareroot 0.378 -> 0.615 Inexact Rounded +sqtx3682 squareroot 0.0378 -> 0.194 Inexact Rounded +sqtx3683 squareroot 0.379 -> 0.616 Inexact Rounded +sqtx3684 squareroot 0.0379 -> 0.195 Inexact Rounded +sqtx3685 squareroot 0.381 -> 0.617 Inexact Rounded +sqtx3686 squareroot 0.0381 -> 0.195 Inexact Rounded +sqtx3687 squareroot 0.382 -> 0.618 Inexact Rounded +sqtx3688 squareroot 0.0382 -> 0.195 Inexact Rounded +sqtx3689 squareroot 0.383 -> 0.619 Inexact Rounded +sqtx3690 squareroot 0.0383 -> 0.196 Inexact Rounded +sqtx3691 squareroot 0.384 -> 0.620 Inexact Rounded +sqtx3692 squareroot 0.0384 -> 0.196 Inexact Rounded +sqtx3693 squareroot 0.385 -> 0.620 Inexact Rounded +sqtx3694 squareroot 0.0385 -> 0.196 Inexact Rounded +sqtx3695 squareroot 0.386 -> 0.621 Inexact Rounded +sqtx3696 squareroot 0.0386 -> 0.196 Inexact Rounded +sqtx3697 squareroot 0.387 -> 0.622 Inexact Rounded +sqtx3698 squareroot 0.0387 -> 0.197 Inexact Rounded +sqtx3699 squareroot 0.388 -> 0.623 Inexact Rounded +sqtx3700 squareroot 0.0388 -> 0.197 Inexact Rounded +sqtx3701 squareroot 0.389 -> 0.624 Inexact Rounded +sqtx3702 squareroot 0.0389 -> 0.197 Inexact Rounded +sqtx3703 squareroot 0.391 -> 0.625 Inexact Rounded +sqtx3704 squareroot 0.0391 -> 0.198 Inexact Rounded +sqtx3705 squareroot 0.392 -> 0.626 Inexact Rounded +sqtx3706 squareroot 0.0392 -> 0.198 Inexact Rounded +sqtx3707 squareroot 0.393 -> 0.627 Inexact Rounded +sqtx3708 squareroot 0.0393 -> 0.198 Inexact Rounded +sqtx3709 squareroot 0.394 -> 0.628 Inexact Rounded +sqtx3710 squareroot 0.0394 -> 0.198 Inexact Rounded +sqtx3711 squareroot 0.395 -> 0.628 Inexact Rounded +sqtx3712 squareroot 0.0395 -> 0.199 Inexact Rounded +sqtx3713 squareroot 0.396 -> 0.629 Inexact Rounded +sqtx3714 squareroot 0.0396 -> 0.199 Inexact Rounded +sqtx3715 squareroot 0.397 -> 0.630 Inexact Rounded +sqtx3716 squareroot 0.0397 -> 0.199 Inexact Rounded +sqtx3717 squareroot 0.398 -> 0.631 Inexact Rounded +sqtx3718 squareroot 0.0398 -> 0.199 Inexact Rounded +sqtx3719 squareroot 0.399 -> 0.632 Inexact Rounded +sqtx3720 squareroot 0.0399 -> 0.200 Inexact Rounded +sqtx3721 squareroot 0.401 -> 0.633 Inexact Rounded +sqtx3722 squareroot 0.0401 -> 0.200 Inexact Rounded +sqtx3723 squareroot 0.402 -> 0.634 Inexact Rounded +sqtx3724 squareroot 0.0402 -> 0.200 Inexact Rounded +sqtx3725 squareroot 0.403 -> 0.635 Inexact Rounded +sqtx3726 squareroot 0.0403 -> 0.201 Inexact Rounded +sqtx3727 squareroot 0.404 -> 0.636 Inexact Rounded +sqtx3728 squareroot 0.0404 -> 0.201 Inexact Rounded +sqtx3729 squareroot 0.405 -> 0.636 Inexact Rounded +sqtx3730 squareroot 0.0405 -> 0.201 Inexact Rounded +sqtx3731 squareroot 0.406 -> 0.637 Inexact Rounded +sqtx3732 squareroot 0.0406 -> 0.201 Inexact Rounded +sqtx3733 squareroot 0.407 -> 0.638 Inexact Rounded +sqtx3734 squareroot 0.0407 -> 0.202 Inexact Rounded +sqtx3735 squareroot 0.408 -> 0.639 Inexact Rounded +sqtx3736 squareroot 0.0408 -> 0.202 Inexact Rounded +sqtx3737 squareroot 0.409 -> 0.640 Inexact Rounded +sqtx3738 squareroot 0.0409 -> 0.202 Inexact Rounded +sqtx3739 squareroot 0.411 -> 0.641 Inexact Rounded +sqtx3740 squareroot 0.0411 -> 0.203 Inexact Rounded +sqtx3741 squareroot 0.412 -> 0.642 Inexact Rounded +sqtx3742 squareroot 0.0412 -> 0.203 Inexact Rounded +sqtx3743 squareroot 0.413 -> 0.643 Inexact Rounded +sqtx3744 squareroot 0.0413 -> 0.203 Inexact Rounded +sqtx3745 squareroot 0.414 -> 0.643 Inexact Rounded +sqtx3746 squareroot 0.0414 -> 0.203 Inexact Rounded +sqtx3747 squareroot 0.415 -> 0.644 Inexact Rounded +sqtx3748 squareroot 0.0415 -> 0.204 Inexact Rounded +sqtx3749 squareroot 0.416 -> 0.645 Inexact Rounded +sqtx3750 squareroot 0.0416 -> 0.204 Inexact Rounded +sqtx3751 squareroot 0.417 -> 0.646 Inexact Rounded +sqtx3752 squareroot 0.0417 -> 0.204 Inexact Rounded +sqtx3753 squareroot 0.418 -> 0.647 Inexact Rounded +sqtx3754 squareroot 0.0418 -> 0.204 Inexact Rounded +sqtx3755 squareroot 0.419 -> 0.647 Inexact Rounded +sqtx3756 squareroot 0.0419 -> 0.205 Inexact Rounded +sqtx3757 squareroot 0.421 -> 0.649 Inexact Rounded +sqtx3758 squareroot 0.0421 -> 0.205 Inexact Rounded +sqtx3759 squareroot 0.422 -> 0.650 Inexact Rounded +sqtx3760 squareroot 0.0422 -> 0.205 Inexact Rounded +sqtx3761 squareroot 0.423 -> 0.650 Inexact Rounded +sqtx3762 squareroot 0.0423 -> 0.206 Inexact Rounded +sqtx3763 squareroot 0.424 -> 0.651 Inexact Rounded +sqtx3764 squareroot 0.0424 -> 0.206 Inexact Rounded +sqtx3765 squareroot 0.425 -> 0.652 Inexact Rounded +sqtx3766 squareroot 0.0425 -> 0.206 Inexact Rounded +sqtx3767 squareroot 0.426 -> 0.653 Inexact Rounded +sqtx3768 squareroot 0.0426 -> 0.206 Inexact Rounded +sqtx3769 squareroot 0.427 -> 0.653 Inexact Rounded +sqtx3770 squareroot 0.0427 -> 0.207 Inexact Rounded +sqtx3771 squareroot 0.428 -> 0.654 Inexact Rounded +sqtx3772 squareroot 0.0428 -> 0.207 Inexact Rounded +sqtx3773 squareroot 0.429 -> 0.655 Inexact Rounded +sqtx3774 squareroot 0.0429 -> 0.207 Inexact Rounded +sqtx3775 squareroot 0.431 -> 0.657 Inexact Rounded +sqtx3776 squareroot 0.0431 -> 0.208 Inexact Rounded +sqtx3777 squareroot 0.432 -> 0.657 Inexact Rounded +sqtx3778 squareroot 0.0432 -> 0.208 Inexact Rounded +sqtx3779 squareroot 0.433 -> 0.658 Inexact Rounded +sqtx3780 squareroot 0.0433 -> 0.208 Inexact Rounded +sqtx3781 squareroot 0.434 -> 0.659 Inexact Rounded +sqtx3782 squareroot 0.0434 -> 0.208 Inexact Rounded +sqtx3783 squareroot 0.435 -> 0.660 Inexact Rounded +sqtx3784 squareroot 0.0435 -> 0.209 Inexact Rounded +sqtx3785 squareroot 0.436 -> 0.660 Inexact Rounded +sqtx3786 squareroot 0.0436 -> 0.209 Inexact Rounded +sqtx3787 squareroot 0.437 -> 0.661 Inexact Rounded +sqtx3788 squareroot 0.0437 -> 0.209 Inexact Rounded +sqtx3789 squareroot 0.438 -> 0.662 Inexact Rounded +sqtx3790 squareroot 0.0438 -> 0.209 Inexact Rounded +sqtx3791 squareroot 0.439 -> 0.663 Inexact Rounded +sqtx3792 squareroot 0.0439 -> 0.210 Inexact Rounded +sqtx3793 squareroot 0.441 -> 0.664 Inexact Rounded +sqtx3794 squareroot 0.0441 -> 0.21 +sqtx3795 squareroot 0.442 -> 0.665 Inexact Rounded +sqtx3796 squareroot 0.0442 -> 0.210 Inexact Rounded +sqtx3797 squareroot 0.443 -> 0.666 Inexact Rounded +sqtx3798 squareroot 0.0443 -> 0.210 Inexact Rounded +sqtx3799 squareroot 0.444 -> 0.666 Inexact Rounded +sqtx3800 squareroot 0.0444 -> 0.211 Inexact Rounded +sqtx3801 squareroot 0.445 -> 0.667 Inexact Rounded +sqtx3802 squareroot 0.0445 -> 0.211 Inexact Rounded +sqtx3803 squareroot 0.446 -> 0.668 Inexact Rounded +sqtx3804 squareroot 0.0446 -> 0.211 Inexact Rounded +sqtx3805 squareroot 0.447 -> 0.669 Inexact Rounded +sqtx3806 squareroot 0.0447 -> 0.211 Inexact Rounded +sqtx3807 squareroot 0.448 -> 0.669 Inexact Rounded +sqtx3808 squareroot 0.0448 -> 0.212 Inexact Rounded +sqtx3809 squareroot 0.449 -> 0.670 Inexact Rounded +sqtx3810 squareroot 0.0449 -> 0.212 Inexact Rounded +sqtx3811 squareroot 0.451 -> 0.672 Inexact Rounded +sqtx3812 squareroot 0.0451 -> 0.212 Inexact Rounded +sqtx3813 squareroot 0.452 -> 0.672 Inexact Rounded +sqtx3814 squareroot 0.0452 -> 0.213 Inexact Rounded +sqtx3815 squareroot 0.453 -> 0.673 Inexact Rounded +sqtx3816 squareroot 0.0453 -> 0.213 Inexact Rounded +sqtx3817 squareroot 0.454 -> 0.674 Inexact Rounded +sqtx3818 squareroot 0.0454 -> 0.213 Inexact Rounded +sqtx3819 squareroot 0.455 -> 0.675 Inexact Rounded +sqtx3820 squareroot 0.0455 -> 0.213 Inexact Rounded +sqtx3821 squareroot 0.456 -> 0.675 Inexact Rounded +sqtx3822 squareroot 0.0456 -> 0.214 Inexact Rounded +sqtx3823 squareroot 0.457 -> 0.676 Inexact Rounded +sqtx3824 squareroot 0.0457 -> 0.214 Inexact Rounded +sqtx3825 squareroot 0.458 -> 0.677 Inexact Rounded +sqtx3826 squareroot 0.0458 -> 0.214 Inexact Rounded +sqtx3827 squareroot 0.459 -> 0.677 Inexact Rounded +sqtx3828 squareroot 0.0459 -> 0.214 Inexact Rounded +sqtx3829 squareroot 0.461 -> 0.679 Inexact Rounded +sqtx3830 squareroot 0.0461 -> 0.215 Inexact Rounded +sqtx3831 squareroot 0.462 -> 0.680 Inexact Rounded +sqtx3832 squareroot 0.0462 -> 0.215 Inexact Rounded +sqtx3833 squareroot 0.463 -> 0.680 Inexact Rounded +sqtx3834 squareroot 0.0463 -> 0.215 Inexact Rounded +sqtx3835 squareroot 0.464 -> 0.681 Inexact Rounded +sqtx3836 squareroot 0.0464 -> 0.215 Inexact Rounded +sqtx3837 squareroot 0.465 -> 0.682 Inexact Rounded +sqtx3838 squareroot 0.0465 -> 0.216 Inexact Rounded +sqtx3839 squareroot 0.466 -> 0.683 Inexact Rounded +sqtx3840 squareroot 0.0466 -> 0.216 Inexact Rounded +sqtx3841 squareroot 0.467 -> 0.683 Inexact Rounded +sqtx3842 squareroot 0.0467 -> 0.216 Inexact Rounded +sqtx3843 squareroot 0.468 -> 0.684 Inexact Rounded +sqtx3844 squareroot 0.0468 -> 0.216 Inexact Rounded +sqtx3845 squareroot 0.469 -> 0.685 Inexact Rounded +sqtx3846 squareroot 0.0469 -> 0.217 Inexact Rounded +sqtx3847 squareroot 0.471 -> 0.686 Inexact Rounded +sqtx3848 squareroot 0.0471 -> 0.217 Inexact Rounded +sqtx3849 squareroot 0.472 -> 0.687 Inexact Rounded +sqtx3850 squareroot 0.0472 -> 0.217 Inexact Rounded +sqtx3851 squareroot 0.473 -> 0.688 Inexact Rounded +sqtx3852 squareroot 0.0473 -> 0.217 Inexact Rounded +sqtx3853 squareroot 0.474 -> 0.688 Inexact Rounded +sqtx3854 squareroot 0.0474 -> 0.218 Inexact Rounded +sqtx3855 squareroot 0.475 -> 0.689 Inexact Rounded +sqtx3856 squareroot 0.0475 -> 0.218 Inexact Rounded +sqtx3857 squareroot 0.476 -> 0.690 Inexact Rounded +sqtx3858 squareroot 0.0476 -> 0.218 Inexact Rounded +sqtx3859 squareroot 0.477 -> 0.691 Inexact Rounded +sqtx3860 squareroot 0.0477 -> 0.218 Inexact Rounded +sqtx3861 squareroot 0.478 -> 0.691 Inexact Rounded +sqtx3862 squareroot 0.0478 -> 0.219 Inexact Rounded +sqtx3863 squareroot 0.479 -> 0.692 Inexact Rounded +sqtx3864 squareroot 0.0479 -> 0.219 Inexact Rounded +sqtx3865 squareroot 0.481 -> 0.694 Inexact Rounded +sqtx3866 squareroot 0.0481 -> 0.219 Inexact Rounded +sqtx3867 squareroot 0.482 -> 0.694 Inexact Rounded +sqtx3868 squareroot 0.0482 -> 0.220 Inexact Rounded +sqtx3869 squareroot 0.483 -> 0.695 Inexact Rounded +sqtx3870 squareroot 0.0483 -> 0.220 Inexact Rounded +sqtx3871 squareroot 0.484 -> 0.696 Inexact Rounded +sqtx3872 squareroot 0.0484 -> 0.22 +sqtx3873 squareroot 0.485 -> 0.696 Inexact Rounded +sqtx3874 squareroot 0.0485 -> 0.220 Inexact Rounded +sqtx3875 squareroot 0.486 -> 0.697 Inexact Rounded +sqtx3876 squareroot 0.0486 -> 0.220 Inexact Rounded +sqtx3877 squareroot 0.487 -> 0.698 Inexact Rounded +sqtx3878 squareroot 0.0487 -> 0.221 Inexact Rounded +sqtx3879 squareroot 0.488 -> 0.699 Inexact Rounded +sqtx3880 squareroot 0.0488 -> 0.221 Inexact Rounded +sqtx3881 squareroot 0.489 -> 0.699 Inexact Rounded +sqtx3882 squareroot 0.0489 -> 0.221 Inexact Rounded +sqtx3883 squareroot 0.491 -> 0.701 Inexact Rounded +sqtx3884 squareroot 0.0491 -> 0.222 Inexact Rounded +sqtx3885 squareroot 0.492 -> 0.701 Inexact Rounded +sqtx3886 squareroot 0.0492 -> 0.222 Inexact Rounded +sqtx3887 squareroot 0.493 -> 0.702 Inexact Rounded +sqtx3888 squareroot 0.0493 -> 0.222 Inexact Rounded +sqtx3889 squareroot 0.494 -> 0.703 Inexact Rounded +sqtx3890 squareroot 0.0494 -> 0.222 Inexact Rounded +sqtx3891 squareroot 0.495 -> 0.704 Inexact Rounded +sqtx3892 squareroot 0.0495 -> 0.222 Inexact Rounded +sqtx3893 squareroot 0.496 -> 0.704 Inexact Rounded +sqtx3894 squareroot 0.0496 -> 0.223 Inexact Rounded +sqtx3895 squareroot 0.497 -> 0.705 Inexact Rounded +sqtx3896 squareroot 0.0497 -> 0.223 Inexact Rounded +sqtx3897 squareroot 0.498 -> 0.706 Inexact Rounded +sqtx3898 squareroot 0.0498 -> 0.223 Inexact Rounded +sqtx3899 squareroot 0.499 -> 0.706 Inexact Rounded +sqtx3900 squareroot 0.0499 -> 0.223 Inexact Rounded +sqtx3901 squareroot 0.501 -> 0.708 Inexact Rounded +sqtx3902 squareroot 0.0501 -> 0.224 Inexact Rounded +sqtx3903 squareroot 0.502 -> 0.709 Inexact Rounded +sqtx3904 squareroot 0.0502 -> 0.224 Inexact Rounded +sqtx3905 squareroot 0.503 -> 0.709 Inexact Rounded +sqtx3906 squareroot 0.0503 -> 0.224 Inexact Rounded +sqtx3907 squareroot 0.504 -> 0.710 Inexact Rounded +sqtx3908 squareroot 0.0504 -> 0.224 Inexact Rounded +sqtx3909 squareroot 0.505 -> 0.711 Inexact Rounded +sqtx3910 squareroot 0.0505 -> 0.225 Inexact Rounded +sqtx3911 squareroot 0.506 -> 0.711 Inexact Rounded +sqtx3912 squareroot 0.0506 -> 0.225 Inexact Rounded +sqtx3913 squareroot 0.507 -> 0.712 Inexact Rounded +sqtx3914 squareroot 0.0507 -> 0.225 Inexact Rounded +sqtx3915 squareroot 0.508 -> 0.713 Inexact Rounded +sqtx3916 squareroot 0.0508 -> 0.225 Inexact Rounded +sqtx3917 squareroot 0.509 -> 0.713 Inexact Rounded +sqtx3918 squareroot 0.0509 -> 0.226 Inexact Rounded +sqtx3919 squareroot 0.511 -> 0.715 Inexact Rounded +sqtx3920 squareroot 0.0511 -> 0.226 Inexact Rounded +sqtx3921 squareroot 0.512 -> 0.716 Inexact Rounded +sqtx3922 squareroot 0.0512 -> 0.226 Inexact Rounded +sqtx3923 squareroot 0.513 -> 0.716 Inexact Rounded +sqtx3924 squareroot 0.0513 -> 0.226 Inexact Rounded +sqtx3925 squareroot 0.514 -> 0.717 Inexact Rounded +sqtx3926 squareroot 0.0514 -> 0.227 Inexact Rounded +sqtx3927 squareroot 0.515 -> 0.718 Inexact Rounded +sqtx3928 squareroot 0.0515 -> 0.227 Inexact Rounded +sqtx3929 squareroot 0.516 -> 0.718 Inexact Rounded +sqtx3930 squareroot 0.0516 -> 0.227 Inexact Rounded +sqtx3931 squareroot 0.517 -> 0.719 Inexact Rounded +sqtx3932 squareroot 0.0517 -> 0.227 Inexact Rounded +sqtx3933 squareroot 0.518 -> 0.720 Inexact Rounded +sqtx3934 squareroot 0.0518 -> 0.228 Inexact Rounded +sqtx3935 squareroot 0.519 -> 0.720 Inexact Rounded +sqtx3936 squareroot 0.0519 -> 0.228 Inexact Rounded +sqtx3937 squareroot 0.521 -> 0.722 Inexact Rounded +sqtx3938 squareroot 0.0521 -> 0.228 Inexact Rounded +sqtx3939 squareroot 0.522 -> 0.722 Inexact Rounded +sqtx3940 squareroot 0.0522 -> 0.228 Inexact Rounded +sqtx3941 squareroot 0.523 -> 0.723 Inexact Rounded +sqtx3942 squareroot 0.0523 -> 0.229 Inexact Rounded +sqtx3943 squareroot 0.524 -> 0.724 Inexact Rounded +sqtx3944 squareroot 0.0524 -> 0.229 Inexact Rounded +sqtx3945 squareroot 0.525 -> 0.725 Inexact Rounded +sqtx3946 squareroot 0.0525 -> 0.229 Inexact Rounded +sqtx3947 squareroot 0.526 -> 0.725 Inexact Rounded +sqtx3948 squareroot 0.0526 -> 0.229 Inexact Rounded +sqtx3949 squareroot 0.527 -> 0.726 Inexact Rounded +sqtx3950 squareroot 0.0527 -> 0.230 Inexact Rounded +sqtx3951 squareroot 0.528 -> 0.727 Inexact Rounded +sqtx3952 squareroot 0.0528 -> 0.230 Inexact Rounded +sqtx3953 squareroot 0.529 -> 0.727 Inexact Rounded +sqtx3954 squareroot 0.0529 -> 0.23 +sqtx3955 squareroot 0.531 -> 0.729 Inexact Rounded +sqtx3956 squareroot 0.0531 -> 0.230 Inexact Rounded +sqtx3957 squareroot 0.532 -> 0.729 Inexact Rounded +sqtx3958 squareroot 0.0532 -> 0.231 Inexact Rounded +sqtx3959 squareroot 0.533 -> 0.730 Inexact Rounded +sqtx3960 squareroot 0.0533 -> 0.231 Inexact Rounded +sqtx3961 squareroot 0.534 -> 0.731 Inexact Rounded +sqtx3962 squareroot 0.0534 -> 0.231 Inexact Rounded +sqtx3963 squareroot 0.535 -> 0.731 Inexact Rounded +sqtx3964 squareroot 0.0535 -> 0.231 Inexact Rounded +sqtx3965 squareroot 0.536 -> 0.732 Inexact Rounded +sqtx3966 squareroot 0.0536 -> 0.232 Inexact Rounded +sqtx3967 squareroot 0.537 -> 0.733 Inexact Rounded +sqtx3968 squareroot 0.0537 -> 0.232 Inexact Rounded +sqtx3969 squareroot 0.538 -> 0.733 Inexact Rounded +sqtx3970 squareroot 0.0538 -> 0.232 Inexact Rounded +sqtx3971 squareroot 0.539 -> 0.734 Inexact Rounded +sqtx3972 squareroot 0.0539 -> 0.232 Inexact Rounded +sqtx3973 squareroot 0.541 -> 0.736 Inexact Rounded +sqtx3974 squareroot 0.0541 -> 0.233 Inexact Rounded +sqtx3975 squareroot 0.542 -> 0.736 Inexact Rounded +sqtx3976 squareroot 0.0542 -> 0.233 Inexact Rounded +sqtx3977 squareroot 0.543 -> 0.737 Inexact Rounded +sqtx3978 squareroot 0.0543 -> 0.233 Inexact Rounded +sqtx3979 squareroot 0.544 -> 0.738 Inexact Rounded +sqtx3980 squareroot 0.0544 -> 0.233 Inexact Rounded +sqtx3981 squareroot 0.545 -> 0.738 Inexact Rounded +sqtx3982 squareroot 0.0545 -> 0.233 Inexact Rounded +sqtx3983 squareroot 0.546 -> 0.739 Inexact Rounded +sqtx3984 squareroot 0.0546 -> 0.234 Inexact Rounded +sqtx3985 squareroot 0.547 -> 0.740 Inexact Rounded +sqtx3986 squareroot 0.0547 -> 0.234 Inexact Rounded +sqtx3987 squareroot 0.548 -> 0.740 Inexact Rounded +sqtx3988 squareroot 0.0548 -> 0.234 Inexact Rounded +sqtx3989 squareroot 0.549 -> 0.741 Inexact Rounded +sqtx3990 squareroot 0.0549 -> 0.234 Inexact Rounded +sqtx3991 squareroot 0.551 -> 0.742 Inexact Rounded +sqtx3992 squareroot 0.0551 -> 0.235 Inexact Rounded +sqtx3993 squareroot 0.552 -> 0.743 Inexact Rounded +sqtx3994 squareroot 0.0552 -> 0.235 Inexact Rounded +sqtx3995 squareroot 0.553 -> 0.744 Inexact Rounded +sqtx3996 squareroot 0.0553 -> 0.235 Inexact Rounded +sqtx3997 squareroot 0.554 -> 0.744 Inexact Rounded +sqtx3998 squareroot 0.0554 -> 0.235 Inexact Rounded +sqtx3999 squareroot 0.555 -> 0.745 Inexact Rounded +sqtx4000 squareroot 0.0555 -> 0.236 Inexact Rounded +sqtx4001 squareroot 0.556 -> 0.746 Inexact Rounded +sqtx4002 squareroot 0.0556 -> 0.236 Inexact Rounded +sqtx4003 squareroot 0.557 -> 0.746 Inexact Rounded +sqtx4004 squareroot 0.0557 -> 0.236 Inexact Rounded +sqtx4005 squareroot 0.558 -> 0.747 Inexact Rounded +sqtx4006 squareroot 0.0558 -> 0.236 Inexact Rounded +sqtx4007 squareroot 0.559 -> 0.748 Inexact Rounded +sqtx4008 squareroot 0.0559 -> 0.236 Inexact Rounded +sqtx4009 squareroot 0.561 -> 0.749 Inexact Rounded +sqtx4010 squareroot 0.0561 -> 0.237 Inexact Rounded +sqtx4011 squareroot 0.562 -> 0.750 Inexact Rounded +sqtx4012 squareroot 0.0562 -> 0.237 Inexact Rounded +sqtx4013 squareroot 0.563 -> 0.750 Inexact Rounded +sqtx4014 squareroot 0.0563 -> 0.237 Inexact Rounded +sqtx4015 squareroot 0.564 -> 0.751 Inexact Rounded +sqtx4016 squareroot 0.0564 -> 0.237 Inexact Rounded +sqtx4017 squareroot 0.565 -> 0.752 Inexact Rounded +sqtx4018 squareroot 0.0565 -> 0.238 Inexact Rounded +sqtx4019 squareroot 0.566 -> 0.752 Inexact Rounded +sqtx4020 squareroot 0.0566 -> 0.238 Inexact Rounded +sqtx4021 squareroot 0.567 -> 0.753 Inexact Rounded +sqtx4022 squareroot 0.0567 -> 0.238 Inexact Rounded +sqtx4023 squareroot 0.568 -> 0.754 Inexact Rounded +sqtx4024 squareroot 0.0568 -> 0.238 Inexact Rounded +sqtx4025 squareroot 0.569 -> 0.754 Inexact Rounded +sqtx4026 squareroot 0.0569 -> 0.239 Inexact Rounded +sqtx4027 squareroot 0.571 -> 0.756 Inexact Rounded +sqtx4028 squareroot 0.0571 -> 0.239 Inexact Rounded +sqtx4029 squareroot 0.572 -> 0.756 Inexact Rounded +sqtx4030 squareroot 0.0572 -> 0.239 Inexact Rounded +sqtx4031 squareroot 0.573 -> 0.757 Inexact Rounded +sqtx4032 squareroot 0.0573 -> 0.239 Inexact Rounded +sqtx4033 squareroot 0.574 -> 0.758 Inexact Rounded +sqtx4034 squareroot 0.0574 -> 0.240 Inexact Rounded +sqtx4035 squareroot 0.575 -> 0.758 Inexact Rounded +sqtx4036 squareroot 0.0575 -> 0.240 Inexact Rounded +sqtx4037 squareroot 0.576 -> 0.759 Inexact Rounded +sqtx4038 squareroot 0.0576 -> 0.24 +sqtx4039 squareroot 0.577 -> 0.760 Inexact Rounded +sqtx4040 squareroot 0.0577 -> 0.240 Inexact Rounded +sqtx4041 squareroot 0.578 -> 0.760 Inexact Rounded +sqtx4042 squareroot 0.0578 -> 0.240 Inexact Rounded +sqtx4043 squareroot 0.579 -> 0.761 Inexact Rounded +sqtx4044 squareroot 0.0579 -> 0.241 Inexact Rounded +sqtx4045 squareroot 0.581 -> 0.762 Inexact Rounded +sqtx4046 squareroot 0.0581 -> 0.241 Inexact Rounded +sqtx4047 squareroot 0.582 -> 0.763 Inexact Rounded +sqtx4048 squareroot 0.0582 -> 0.241 Inexact Rounded +sqtx4049 squareroot 0.583 -> 0.764 Inexact Rounded +sqtx4050 squareroot 0.0583 -> 0.241 Inexact Rounded +sqtx4051 squareroot 0.584 -> 0.764 Inexact Rounded +sqtx4052 squareroot 0.0584 -> 0.242 Inexact Rounded +sqtx4053 squareroot 0.585 -> 0.765 Inexact Rounded +sqtx4054 squareroot 0.0585 -> 0.242 Inexact Rounded +sqtx4055 squareroot 0.586 -> 0.766 Inexact Rounded +sqtx4056 squareroot 0.0586 -> 0.242 Inexact Rounded +sqtx4057 squareroot 0.587 -> 0.766 Inexact Rounded +sqtx4058 squareroot 0.0587 -> 0.242 Inexact Rounded +sqtx4059 squareroot 0.588 -> 0.767 Inexact Rounded +sqtx4060 squareroot 0.0588 -> 0.242 Inexact Rounded +sqtx4061 squareroot 0.589 -> 0.767 Inexact Rounded +sqtx4062 squareroot 0.0589 -> 0.243 Inexact Rounded +sqtx4063 squareroot 0.591 -> 0.769 Inexact Rounded +sqtx4064 squareroot 0.0591 -> 0.243 Inexact Rounded +sqtx4065 squareroot 0.592 -> 0.769 Inexact Rounded +sqtx4066 squareroot 0.0592 -> 0.243 Inexact Rounded +sqtx4067 squareroot 0.593 -> 0.770 Inexact Rounded +sqtx4068 squareroot 0.0593 -> 0.244 Inexact Rounded +sqtx4069 squareroot 0.594 -> 0.771 Inexact Rounded +sqtx4070 squareroot 0.0594 -> 0.244 Inexact Rounded +sqtx4071 squareroot 0.595 -> 0.771 Inexact Rounded +sqtx4072 squareroot 0.0595 -> 0.244 Inexact Rounded +sqtx4073 squareroot 0.596 -> 0.772 Inexact Rounded +sqtx4074 squareroot 0.0596 -> 0.244 Inexact Rounded +sqtx4075 squareroot 0.597 -> 0.773 Inexact Rounded +sqtx4076 squareroot 0.0597 -> 0.244 Inexact Rounded +sqtx4077 squareroot 0.598 -> 0.773 Inexact Rounded +sqtx4078 squareroot 0.0598 -> 0.245 Inexact Rounded +sqtx4079 squareroot 0.599 -> 0.774 Inexact Rounded +sqtx4080 squareroot 0.0599 -> 0.245 Inexact Rounded +sqtx4081 squareroot 0.601 -> 0.775 Inexact Rounded +sqtx4082 squareroot 0.0601 -> 0.245 Inexact Rounded +sqtx4083 squareroot 0.602 -> 0.776 Inexact Rounded +sqtx4084 squareroot 0.0602 -> 0.245 Inexact Rounded +sqtx4085 squareroot 0.603 -> 0.777 Inexact Rounded +sqtx4086 squareroot 0.0603 -> 0.246 Inexact Rounded +sqtx4087 squareroot 0.604 -> 0.777 Inexact Rounded +sqtx4088 squareroot 0.0604 -> 0.246 Inexact Rounded +sqtx4089 squareroot 0.605 -> 0.778 Inexact Rounded +sqtx4090 squareroot 0.0605 -> 0.246 Inexact Rounded +sqtx4091 squareroot 0.606 -> 0.778 Inexact Rounded +sqtx4092 squareroot 0.0606 -> 0.246 Inexact Rounded +sqtx4093 squareroot 0.607 -> 0.779 Inexact Rounded +sqtx4094 squareroot 0.0607 -> 0.246 Inexact Rounded +sqtx4095 squareroot 0.608 -> 0.780 Inexact Rounded +sqtx4096 squareroot 0.0608 -> 0.247 Inexact Rounded +sqtx4097 squareroot 0.609 -> 0.780 Inexact Rounded +sqtx4098 squareroot 0.0609 -> 0.247 Inexact Rounded +sqtx4099 squareroot 0.611 -> 0.782 Inexact Rounded +sqtx4100 squareroot 0.0611 -> 0.247 Inexact Rounded +sqtx4101 squareroot 0.612 -> 0.782 Inexact Rounded +sqtx4102 squareroot 0.0612 -> 0.247 Inexact Rounded +sqtx4103 squareroot 0.613 -> 0.783 Inexact Rounded +sqtx4104 squareroot 0.0613 -> 0.248 Inexact Rounded +sqtx4105 squareroot 0.614 -> 0.784 Inexact Rounded +sqtx4106 squareroot 0.0614 -> 0.248 Inexact Rounded +sqtx4107 squareroot 0.615 -> 0.784 Inexact Rounded +sqtx4108 squareroot 0.0615 -> 0.248 Inexact Rounded +sqtx4109 squareroot 0.616 -> 0.785 Inexact Rounded +sqtx4110 squareroot 0.0616 -> 0.248 Inexact Rounded +sqtx4111 squareroot 0.617 -> 0.785 Inexact Rounded +sqtx4112 squareroot 0.0617 -> 0.248 Inexact Rounded +sqtx4113 squareroot 0.618 -> 0.786 Inexact Rounded +sqtx4114 squareroot 0.0618 -> 0.249 Inexact Rounded +sqtx4115 squareroot 0.619 -> 0.787 Inexact Rounded +sqtx4116 squareroot 0.0619 -> 0.249 Inexact Rounded +sqtx4117 squareroot 0.621 -> 0.788 Inexact Rounded +sqtx4118 squareroot 0.0621 -> 0.249 Inexact Rounded +sqtx4119 squareroot 0.622 -> 0.789 Inexact Rounded +sqtx4120 squareroot 0.0622 -> 0.249 Inexact Rounded +sqtx4121 squareroot 0.623 -> 0.789 Inexact Rounded +sqtx4122 squareroot 0.0623 -> 0.250 Inexact Rounded +sqtx4123 squareroot 0.624 -> 0.790 Inexact Rounded +sqtx4124 squareroot 0.0624 -> 0.250 Inexact Rounded +sqtx4125 squareroot 0.625 -> 0.791 Inexact Rounded +sqtx4126 squareroot 0.0625 -> 0.25 +sqtx4127 squareroot 0.626 -> 0.791 Inexact Rounded +sqtx4128 squareroot 0.0626 -> 0.250 Inexact Rounded +sqtx4129 squareroot 0.627 -> 0.792 Inexact Rounded +sqtx4130 squareroot 0.0627 -> 0.250 Inexact Rounded +sqtx4131 squareroot 0.628 -> 0.792 Inexact Rounded +sqtx4132 squareroot 0.0628 -> 0.251 Inexact Rounded +sqtx4133 squareroot 0.629 -> 0.793 Inexact Rounded +sqtx4134 squareroot 0.0629 -> 0.251 Inexact Rounded +sqtx4135 squareroot 0.631 -> 0.794 Inexact Rounded +sqtx4136 squareroot 0.0631 -> 0.251 Inexact Rounded +sqtx4137 squareroot 0.632 -> 0.795 Inexact Rounded +sqtx4138 squareroot 0.0632 -> 0.251 Inexact Rounded +sqtx4139 squareroot 0.633 -> 0.796 Inexact Rounded +sqtx4140 squareroot 0.0633 -> 0.252 Inexact Rounded +sqtx4141 squareroot 0.634 -> 0.796 Inexact Rounded +sqtx4142 squareroot 0.0634 -> 0.252 Inexact Rounded +sqtx4143 squareroot 0.635 -> 0.797 Inexact Rounded +sqtx4144 squareroot 0.0635 -> 0.252 Inexact Rounded +sqtx4145 squareroot 0.636 -> 0.797 Inexact Rounded +sqtx4146 squareroot 0.0636 -> 0.252 Inexact Rounded +sqtx4147 squareroot 0.637 -> 0.798 Inexact Rounded +sqtx4148 squareroot 0.0637 -> 0.252 Inexact Rounded +sqtx4149 squareroot 0.638 -> 0.799 Inexact Rounded +sqtx4150 squareroot 0.0638 -> 0.253 Inexact Rounded +sqtx4151 squareroot 0.639 -> 0.799 Inexact Rounded +sqtx4152 squareroot 0.0639 -> 0.253 Inexact Rounded +sqtx4153 squareroot 0.641 -> 0.801 Inexact Rounded +sqtx4154 squareroot 0.0641 -> 0.253 Inexact Rounded +sqtx4155 squareroot 0.642 -> 0.801 Inexact Rounded +sqtx4156 squareroot 0.0642 -> 0.253 Inexact Rounded +sqtx4157 squareroot 0.643 -> 0.802 Inexact Rounded +sqtx4158 squareroot 0.0643 -> 0.254 Inexact Rounded +sqtx4159 squareroot 0.644 -> 0.802 Inexact Rounded +sqtx4160 squareroot 0.0644 -> 0.254 Inexact Rounded +sqtx4161 squareroot 0.645 -> 0.803 Inexact Rounded +sqtx4162 squareroot 0.0645 -> 0.254 Inexact Rounded +sqtx4163 squareroot 0.646 -> 0.804 Inexact Rounded +sqtx4164 squareroot 0.0646 -> 0.254 Inexact Rounded +sqtx4165 squareroot 0.647 -> 0.804 Inexact Rounded +sqtx4166 squareroot 0.0647 -> 0.254 Inexact Rounded +sqtx4167 squareroot 0.648 -> 0.805 Inexact Rounded +sqtx4168 squareroot 0.0648 -> 0.255 Inexact Rounded +sqtx4169 squareroot 0.649 -> 0.806 Inexact Rounded +sqtx4170 squareroot 0.0649 -> 0.255 Inexact Rounded +sqtx4171 squareroot 0.651 -> 0.807 Inexact Rounded +sqtx4172 squareroot 0.0651 -> 0.255 Inexact Rounded +sqtx4173 squareroot 0.652 -> 0.807 Inexact Rounded +sqtx4174 squareroot 0.0652 -> 0.255 Inexact Rounded +sqtx4175 squareroot 0.653 -> 0.808 Inexact Rounded +sqtx4176 squareroot 0.0653 -> 0.256 Inexact Rounded +sqtx4177 squareroot 0.654 -> 0.809 Inexact Rounded +sqtx4178 squareroot 0.0654 -> 0.256 Inexact Rounded +sqtx4179 squareroot 0.655 -> 0.809 Inexact Rounded +sqtx4180 squareroot 0.0655 -> 0.256 Inexact Rounded +sqtx4181 squareroot 0.656 -> 0.810 Inexact Rounded +sqtx4182 squareroot 0.0656 -> 0.256 Inexact Rounded +sqtx4183 squareroot 0.657 -> 0.811 Inexact Rounded +sqtx4184 squareroot 0.0657 -> 0.256 Inexact Rounded +sqtx4185 squareroot 0.658 -> 0.811 Inexact Rounded +sqtx4186 squareroot 0.0658 -> 0.257 Inexact Rounded +sqtx4187 squareroot 0.659 -> 0.812 Inexact Rounded +sqtx4188 squareroot 0.0659 -> 0.257 Inexact Rounded +sqtx4189 squareroot 0.661 -> 0.813 Inexact Rounded +sqtx4190 squareroot 0.0661 -> 0.257 Inexact Rounded +sqtx4191 squareroot 0.662 -> 0.814 Inexact Rounded +sqtx4192 squareroot 0.0662 -> 0.257 Inexact Rounded +sqtx4193 squareroot 0.663 -> 0.814 Inexact Rounded +sqtx4194 squareroot 0.0663 -> 0.257 Inexact Rounded +sqtx4195 squareroot 0.664 -> 0.815 Inexact Rounded +sqtx4196 squareroot 0.0664 -> 0.258 Inexact Rounded +sqtx4197 squareroot 0.665 -> 0.815 Inexact Rounded +sqtx4198 squareroot 0.0665 -> 0.258 Inexact Rounded +sqtx4199 squareroot 0.666 -> 0.816 Inexact Rounded +sqtx4200 squareroot 0.0666 -> 0.258 Inexact Rounded +sqtx4201 squareroot 0.667 -> 0.817 Inexact Rounded +sqtx4202 squareroot 0.0667 -> 0.258 Inexact Rounded +sqtx4203 squareroot 0.668 -> 0.817 Inexact Rounded +sqtx4204 squareroot 0.0668 -> 0.258 Inexact Rounded +sqtx4205 squareroot 0.669 -> 0.818 Inexact Rounded +sqtx4206 squareroot 0.0669 -> 0.259 Inexact Rounded +sqtx4207 squareroot 0.671 -> 0.819 Inexact Rounded +sqtx4208 squareroot 0.0671 -> 0.259 Inexact Rounded +sqtx4209 squareroot 0.672 -> 0.820 Inexact Rounded +sqtx4210 squareroot 0.0672 -> 0.259 Inexact Rounded +sqtx4211 squareroot 0.673 -> 0.820 Inexact Rounded +sqtx4212 squareroot 0.0673 -> 0.259 Inexact Rounded +sqtx4213 squareroot 0.674 -> 0.821 Inexact Rounded +sqtx4214 squareroot 0.0674 -> 0.260 Inexact Rounded +sqtx4215 squareroot 0.675 -> 0.822 Inexact Rounded +sqtx4216 squareroot 0.0675 -> 0.260 Inexact Rounded +sqtx4217 squareroot 0.676 -> 0.822 Inexact Rounded +sqtx4218 squareroot 0.0676 -> 0.26 +sqtx4219 squareroot 0.677 -> 0.823 Inexact Rounded +sqtx4220 squareroot 0.0677 -> 0.260 Inexact Rounded +sqtx4221 squareroot 0.678 -> 0.823 Inexact Rounded +sqtx4222 squareroot 0.0678 -> 0.260 Inexact Rounded +sqtx4223 squareroot 0.679 -> 0.824 Inexact Rounded +sqtx4224 squareroot 0.0679 -> 0.261 Inexact Rounded +sqtx4225 squareroot 0.681 -> 0.825 Inexact Rounded +sqtx4226 squareroot 0.0681 -> 0.261 Inexact Rounded +sqtx4227 squareroot 0.682 -> 0.826 Inexact Rounded +sqtx4228 squareroot 0.0682 -> 0.261 Inexact Rounded +sqtx4229 squareroot 0.683 -> 0.826 Inexact Rounded +sqtx4230 squareroot 0.0683 -> 0.261 Inexact Rounded +sqtx4231 squareroot 0.684 -> 0.827 Inexact Rounded +sqtx4232 squareroot 0.0684 -> 0.262 Inexact Rounded +sqtx4233 squareroot 0.685 -> 0.828 Inexact Rounded +sqtx4234 squareroot 0.0685 -> 0.262 Inexact Rounded +sqtx4235 squareroot 0.686 -> 0.828 Inexact Rounded +sqtx4236 squareroot 0.0686 -> 0.262 Inexact Rounded +sqtx4237 squareroot 0.687 -> 0.829 Inexact Rounded +sqtx4238 squareroot 0.0687 -> 0.262 Inexact Rounded +sqtx4239 squareroot 0.688 -> 0.829 Inexact Rounded +sqtx4240 squareroot 0.0688 -> 0.262 Inexact Rounded +sqtx4241 squareroot 0.689 -> 0.830 Inexact Rounded +sqtx4242 squareroot 0.0689 -> 0.262 Inexact Rounded +sqtx4243 squareroot 0.691 -> 0.831 Inexact Rounded +sqtx4244 squareroot 0.0691 -> 0.263 Inexact Rounded +sqtx4245 squareroot 0.692 -> 0.832 Inexact Rounded +sqtx4246 squareroot 0.0692 -> 0.263 Inexact Rounded +sqtx4247 squareroot 0.693 -> 0.832 Inexact Rounded +sqtx4248 squareroot 0.0693 -> 0.263 Inexact Rounded +sqtx4249 squareroot 0.694 -> 0.833 Inexact Rounded +sqtx4250 squareroot 0.0694 -> 0.263 Inexact Rounded +sqtx4251 squareroot 0.695 -> 0.834 Inexact Rounded +sqtx4252 squareroot 0.0695 -> 0.264 Inexact Rounded +sqtx4253 squareroot 0.696 -> 0.834 Inexact Rounded +sqtx4254 squareroot 0.0696 -> 0.264 Inexact Rounded +sqtx4255 squareroot 0.697 -> 0.835 Inexact Rounded +sqtx4256 squareroot 0.0697 -> 0.264 Inexact Rounded +sqtx4257 squareroot 0.698 -> 0.835 Inexact Rounded +sqtx4258 squareroot 0.0698 -> 0.264 Inexact Rounded +sqtx4259 squareroot 0.699 -> 0.836 Inexact Rounded +sqtx4260 squareroot 0.0699 -> 0.264 Inexact Rounded +sqtx4261 squareroot 0.701 -> 0.837 Inexact Rounded +sqtx4262 squareroot 0.0701 -> 0.265 Inexact Rounded +sqtx4263 squareroot 0.702 -> 0.838 Inexact Rounded +sqtx4264 squareroot 0.0702 -> 0.265 Inexact Rounded +sqtx4265 squareroot 0.703 -> 0.838 Inexact Rounded +sqtx4266 squareroot 0.0703 -> 0.265 Inexact Rounded +sqtx4267 squareroot 0.704 -> 0.839 Inexact Rounded +sqtx4268 squareroot 0.0704 -> 0.265 Inexact Rounded +sqtx4269 squareroot 0.705 -> 0.840 Inexact Rounded +sqtx4270 squareroot 0.0705 -> 0.266 Inexact Rounded +sqtx4271 squareroot 0.706 -> 0.840 Inexact Rounded +sqtx4272 squareroot 0.0706 -> 0.266 Inexact Rounded +sqtx4273 squareroot 0.707 -> 0.841 Inexact Rounded +sqtx4274 squareroot 0.0707 -> 0.266 Inexact Rounded +sqtx4275 squareroot 0.708 -> 0.841 Inexact Rounded +sqtx4276 squareroot 0.0708 -> 0.266 Inexact Rounded +sqtx4277 squareroot 0.709 -> 0.842 Inexact Rounded +sqtx4278 squareroot 0.0709 -> 0.266 Inexact Rounded +sqtx4279 squareroot 0.711 -> 0.843 Inexact Rounded +sqtx4280 squareroot 0.0711 -> 0.267 Inexact Rounded +sqtx4281 squareroot 0.712 -> 0.844 Inexact Rounded +sqtx4282 squareroot 0.0712 -> 0.267 Inexact Rounded +sqtx4283 squareroot 0.713 -> 0.844 Inexact Rounded +sqtx4284 squareroot 0.0713 -> 0.267 Inexact Rounded +sqtx4285 squareroot 0.714 -> 0.845 Inexact Rounded +sqtx4286 squareroot 0.0714 -> 0.267 Inexact Rounded +sqtx4287 squareroot 0.715 -> 0.846 Inexact Rounded +sqtx4288 squareroot 0.0715 -> 0.267 Inexact Rounded +sqtx4289 squareroot 0.716 -> 0.846 Inexact Rounded +sqtx4290 squareroot 0.0716 -> 0.268 Inexact Rounded +sqtx4291 squareroot 0.717 -> 0.847 Inexact Rounded +sqtx4292 squareroot 0.0717 -> 0.268 Inexact Rounded +sqtx4293 squareroot 0.718 -> 0.847 Inexact Rounded +sqtx4294 squareroot 0.0718 -> 0.268 Inexact Rounded +sqtx4295 squareroot 0.719 -> 0.848 Inexact Rounded +sqtx4296 squareroot 0.0719 -> 0.268 Inexact Rounded +sqtx4297 squareroot 0.721 -> 0.849 Inexact Rounded +sqtx4298 squareroot 0.0721 -> 0.269 Inexact Rounded +sqtx4299 squareroot 0.722 -> 0.850 Inexact Rounded +sqtx4300 squareroot 0.0722 -> 0.269 Inexact Rounded +sqtx4301 squareroot 0.723 -> 0.850 Inexact Rounded +sqtx4302 squareroot 0.0723 -> 0.269 Inexact Rounded +sqtx4303 squareroot 0.724 -> 0.851 Inexact Rounded +sqtx4304 squareroot 0.0724 -> 0.269 Inexact Rounded +sqtx4305 squareroot 0.725 -> 0.851 Inexact Rounded +sqtx4306 squareroot 0.0725 -> 0.269 Inexact Rounded +sqtx4307 squareroot 0.726 -> 0.852 Inexact Rounded +sqtx4308 squareroot 0.0726 -> 0.269 Inexact Rounded +sqtx4309 squareroot 0.727 -> 0.853 Inexact Rounded +sqtx4310 squareroot 0.0727 -> 0.270 Inexact Rounded +sqtx4311 squareroot 0.728 -> 0.853 Inexact Rounded +sqtx4312 squareroot 0.0728 -> 0.270 Inexact Rounded +sqtx4313 squareroot 0.729 -> 0.854 Inexact Rounded +sqtx4314 squareroot 0.0729 -> 0.27 +sqtx4315 squareroot 0.731 -> 0.855 Inexact Rounded +sqtx4316 squareroot 0.0731 -> 0.270 Inexact Rounded +sqtx4317 squareroot 0.732 -> 0.856 Inexact Rounded +sqtx4318 squareroot 0.0732 -> 0.271 Inexact Rounded +sqtx4319 squareroot 0.733 -> 0.856 Inexact Rounded +sqtx4320 squareroot 0.0733 -> 0.271 Inexact Rounded +sqtx4321 squareroot 0.734 -> 0.857 Inexact Rounded +sqtx4322 squareroot 0.0734 -> 0.271 Inexact Rounded +sqtx4323 squareroot 0.735 -> 0.857 Inexact Rounded +sqtx4324 squareroot 0.0735 -> 0.271 Inexact Rounded +sqtx4325 squareroot 0.736 -> 0.858 Inexact Rounded +sqtx4326 squareroot 0.0736 -> 0.271 Inexact Rounded +sqtx4327 squareroot 0.737 -> 0.858 Inexact Rounded +sqtx4328 squareroot 0.0737 -> 0.271 Inexact Rounded +sqtx4329 squareroot 0.738 -> 0.859 Inexact Rounded +sqtx4330 squareroot 0.0738 -> 0.272 Inexact Rounded +sqtx4331 squareroot 0.739 -> 0.860 Inexact Rounded +sqtx4332 squareroot 0.0739 -> 0.272 Inexact Rounded +sqtx4333 squareroot 0.741 -> 0.861 Inexact Rounded +sqtx4334 squareroot 0.0741 -> 0.272 Inexact Rounded +sqtx4335 squareroot 0.742 -> 0.861 Inexact Rounded +sqtx4336 squareroot 0.0742 -> 0.272 Inexact Rounded +sqtx4337 squareroot 0.743 -> 0.862 Inexact Rounded +sqtx4338 squareroot 0.0743 -> 0.273 Inexact Rounded +sqtx4339 squareroot 0.744 -> 0.863 Inexact Rounded +sqtx4340 squareroot 0.0744 -> 0.273 Inexact Rounded +sqtx4341 squareroot 0.745 -> 0.863 Inexact Rounded +sqtx4342 squareroot 0.0745 -> 0.273 Inexact Rounded +sqtx4343 squareroot 0.746 -> 0.864 Inexact Rounded +sqtx4344 squareroot 0.0746 -> 0.273 Inexact Rounded +sqtx4345 squareroot 0.747 -> 0.864 Inexact Rounded +sqtx4346 squareroot 0.0747 -> 0.273 Inexact Rounded +sqtx4347 squareroot 0.748 -> 0.865 Inexact Rounded +sqtx4348 squareroot 0.0748 -> 0.273 Inexact Rounded +sqtx4349 squareroot 0.749 -> 0.865 Inexact Rounded +sqtx4350 squareroot 0.0749 -> 0.274 Inexact Rounded +sqtx4351 squareroot 0.751 -> 0.867 Inexact Rounded +sqtx4352 squareroot 0.0751 -> 0.274 Inexact Rounded +sqtx4353 squareroot 0.752 -> 0.867 Inexact Rounded +sqtx4354 squareroot 0.0752 -> 0.274 Inexact Rounded +sqtx4355 squareroot 0.753 -> 0.868 Inexact Rounded +sqtx4356 squareroot 0.0753 -> 0.274 Inexact Rounded +sqtx4357 squareroot 0.754 -> 0.868 Inexact Rounded +sqtx4358 squareroot 0.0754 -> 0.275 Inexact Rounded +sqtx4359 squareroot 0.755 -> 0.869 Inexact Rounded +sqtx4360 squareroot 0.0755 -> 0.275 Inexact Rounded +sqtx4361 squareroot 0.756 -> 0.869 Inexact Rounded +sqtx4362 squareroot 0.0756 -> 0.275 Inexact Rounded +sqtx4363 squareroot 0.757 -> 0.870 Inexact Rounded +sqtx4364 squareroot 0.0757 -> 0.275 Inexact Rounded +sqtx4365 squareroot 0.758 -> 0.871 Inexact Rounded +sqtx4366 squareroot 0.0758 -> 0.275 Inexact Rounded +sqtx4367 squareroot 0.759 -> 0.871 Inexact Rounded +sqtx4368 squareroot 0.0759 -> 0.275 Inexact Rounded +sqtx4369 squareroot 0.761 -> 0.872 Inexact Rounded +sqtx4370 squareroot 0.0761 -> 0.276 Inexact Rounded +sqtx4371 squareroot 0.762 -> 0.873 Inexact Rounded +sqtx4372 squareroot 0.0762 -> 0.276 Inexact Rounded +sqtx4373 squareroot 0.763 -> 0.873 Inexact Rounded +sqtx4374 squareroot 0.0763 -> 0.276 Inexact Rounded +sqtx4375 squareroot 0.764 -> 0.874 Inexact Rounded +sqtx4376 squareroot 0.0764 -> 0.276 Inexact Rounded +sqtx4377 squareroot 0.765 -> 0.875 Inexact Rounded +sqtx4378 squareroot 0.0765 -> 0.277 Inexact Rounded +sqtx4379 squareroot 0.766 -> 0.875 Inexact Rounded +sqtx4380 squareroot 0.0766 -> 0.277 Inexact Rounded +sqtx4381 squareroot 0.767 -> 0.876 Inexact Rounded +sqtx4382 squareroot 0.0767 -> 0.277 Inexact Rounded +sqtx4383 squareroot 0.768 -> 0.876 Inexact Rounded +sqtx4384 squareroot 0.0768 -> 0.277 Inexact Rounded +sqtx4385 squareroot 0.769 -> 0.877 Inexact Rounded +sqtx4386 squareroot 0.0769 -> 0.277 Inexact Rounded +sqtx4387 squareroot 0.771 -> 0.878 Inexact Rounded +sqtx4388 squareroot 0.0771 -> 0.278 Inexact Rounded +sqtx4389 squareroot 0.772 -> 0.879 Inexact Rounded +sqtx4390 squareroot 0.0772 -> 0.278 Inexact Rounded +sqtx4391 squareroot 0.773 -> 0.879 Inexact Rounded +sqtx4392 squareroot 0.0773 -> 0.278 Inexact Rounded +sqtx4393 squareroot 0.774 -> 0.880 Inexact Rounded +sqtx4394 squareroot 0.0774 -> 0.278 Inexact Rounded +sqtx4395 squareroot 0.775 -> 0.880 Inexact Rounded +sqtx4396 squareroot 0.0775 -> 0.278 Inexact Rounded +sqtx4397 squareroot 0.776 -> 0.881 Inexact Rounded +sqtx4398 squareroot 0.0776 -> 0.279 Inexact Rounded +sqtx4399 squareroot 0.777 -> 0.881 Inexact Rounded +sqtx4400 squareroot 0.0777 -> 0.279 Inexact Rounded +sqtx4401 squareroot 0.778 -> 0.882 Inexact Rounded +sqtx4402 squareroot 0.0778 -> 0.279 Inexact Rounded +sqtx4403 squareroot 0.779 -> 0.883 Inexact Rounded +sqtx4404 squareroot 0.0779 -> 0.279 Inexact Rounded +sqtx4405 squareroot 0.781 -> 0.884 Inexact Rounded +sqtx4406 squareroot 0.0781 -> 0.279 Inexact Rounded +sqtx4407 squareroot 0.782 -> 0.884 Inexact Rounded +sqtx4408 squareroot 0.0782 -> 0.280 Inexact Rounded +sqtx4409 squareroot 0.783 -> 0.885 Inexact Rounded +sqtx4410 squareroot 0.0783 -> 0.280 Inexact Rounded +sqtx4411 squareroot 0.784 -> 0.885 Inexact Rounded +sqtx4412 squareroot 0.0784 -> 0.28 +sqtx4413 squareroot 0.785 -> 0.886 Inexact Rounded +sqtx4414 squareroot 0.0785 -> 0.280 Inexact Rounded +sqtx4415 squareroot 0.786 -> 0.887 Inexact Rounded +sqtx4416 squareroot 0.0786 -> 0.280 Inexact Rounded +sqtx4417 squareroot 0.787 -> 0.887 Inexact Rounded +sqtx4418 squareroot 0.0787 -> 0.281 Inexact Rounded +sqtx4419 squareroot 0.788 -> 0.888 Inexact Rounded +sqtx4420 squareroot 0.0788 -> 0.281 Inexact Rounded +sqtx4421 squareroot 0.789 -> 0.888 Inexact Rounded +sqtx4422 squareroot 0.0789 -> 0.281 Inexact Rounded +sqtx4423 squareroot 0.791 -> 0.889 Inexact Rounded +sqtx4424 squareroot 0.0791 -> 0.281 Inexact Rounded +sqtx4425 squareroot 0.792 -> 0.890 Inexact Rounded +sqtx4426 squareroot 0.0792 -> 0.281 Inexact Rounded +sqtx4427 squareroot 0.793 -> 0.891 Inexact Rounded +sqtx4428 squareroot 0.0793 -> 0.282 Inexact Rounded +sqtx4429 squareroot 0.794 -> 0.891 Inexact Rounded +sqtx4430 squareroot 0.0794 -> 0.282 Inexact Rounded +sqtx4431 squareroot 0.795 -> 0.892 Inexact Rounded +sqtx4432 squareroot 0.0795 -> 0.282 Inexact Rounded +sqtx4433 squareroot 0.796 -> 0.892 Inexact Rounded +sqtx4434 squareroot 0.0796 -> 0.282 Inexact Rounded +sqtx4435 squareroot 0.797 -> 0.893 Inexact Rounded +sqtx4436 squareroot 0.0797 -> 0.282 Inexact Rounded +sqtx4437 squareroot 0.798 -> 0.893 Inexact Rounded +sqtx4438 squareroot 0.0798 -> 0.282 Inexact Rounded +sqtx4439 squareroot 0.799 -> 0.894 Inexact Rounded +sqtx4440 squareroot 0.0799 -> 0.283 Inexact Rounded +sqtx4441 squareroot 0.801 -> 0.895 Inexact Rounded +sqtx4442 squareroot 0.0801 -> 0.283 Inexact Rounded +sqtx4443 squareroot 0.802 -> 0.896 Inexact Rounded +sqtx4444 squareroot 0.0802 -> 0.283 Inexact Rounded +sqtx4445 squareroot 0.803 -> 0.896 Inexact Rounded +sqtx4446 squareroot 0.0803 -> 0.283 Inexact Rounded +sqtx4447 squareroot 0.804 -> 0.897 Inexact Rounded +sqtx4448 squareroot 0.0804 -> 0.284 Inexact Rounded +sqtx4449 squareroot 0.805 -> 0.897 Inexact Rounded +sqtx4450 squareroot 0.0805 -> 0.284 Inexact Rounded +sqtx4451 squareroot 0.806 -> 0.898 Inexact Rounded +sqtx4452 squareroot 0.0806 -> 0.284 Inexact Rounded +sqtx4453 squareroot 0.807 -> 0.898 Inexact Rounded +sqtx4454 squareroot 0.0807 -> 0.284 Inexact Rounded +sqtx4455 squareroot 0.808 -> 0.899 Inexact Rounded +sqtx4456 squareroot 0.0808 -> 0.284 Inexact Rounded +sqtx4457 squareroot 0.809 -> 0.899 Inexact Rounded +sqtx4458 squareroot 0.0809 -> 0.284 Inexact Rounded +sqtx4459 squareroot 0.811 -> 0.901 Inexact Rounded +sqtx4460 squareroot 0.0811 -> 0.285 Inexact Rounded +sqtx4461 squareroot 0.812 -> 0.901 Inexact Rounded +sqtx4462 squareroot 0.0812 -> 0.285 Inexact Rounded +sqtx4463 squareroot 0.813 -> 0.902 Inexact Rounded +sqtx4464 squareroot 0.0813 -> 0.285 Inexact Rounded +sqtx4465 squareroot 0.814 -> 0.902 Inexact Rounded +sqtx4466 squareroot 0.0814 -> 0.285 Inexact Rounded +sqtx4467 squareroot 0.815 -> 0.903 Inexact Rounded +sqtx4468 squareroot 0.0815 -> 0.285 Inexact Rounded +sqtx4469 squareroot 0.816 -> 0.903 Inexact Rounded +sqtx4470 squareroot 0.0816 -> 0.286 Inexact Rounded +sqtx4471 squareroot 0.817 -> 0.904 Inexact Rounded +sqtx4472 squareroot 0.0817 -> 0.286 Inexact Rounded +sqtx4473 squareroot 0.818 -> 0.904 Inexact Rounded +sqtx4474 squareroot 0.0818 -> 0.286 Inexact Rounded +sqtx4475 squareroot 0.819 -> 0.905 Inexact Rounded +sqtx4476 squareroot 0.0819 -> 0.286 Inexact Rounded +sqtx4477 squareroot 0.821 -> 0.906 Inexact Rounded +sqtx4478 squareroot 0.0821 -> 0.287 Inexact Rounded +sqtx4479 squareroot 0.822 -> 0.907 Inexact Rounded +sqtx4480 squareroot 0.0822 -> 0.287 Inexact Rounded +sqtx4481 squareroot 0.823 -> 0.907 Inexact Rounded +sqtx4482 squareroot 0.0823 -> 0.287 Inexact Rounded +sqtx4483 squareroot 0.824 -> 0.908 Inexact Rounded +sqtx4484 squareroot 0.0824 -> 0.287 Inexact Rounded +sqtx4485 squareroot 0.825 -> 0.908 Inexact Rounded +sqtx4486 squareroot 0.0825 -> 0.287 Inexact Rounded +sqtx4487 squareroot 0.826 -> 0.909 Inexact Rounded +sqtx4488 squareroot 0.0826 -> 0.287 Inexact Rounded +sqtx4489 squareroot 0.827 -> 0.909 Inexact Rounded +sqtx4490 squareroot 0.0827 -> 0.288 Inexact Rounded +sqtx4491 squareroot 0.828 -> 0.910 Inexact Rounded +sqtx4492 squareroot 0.0828 -> 0.288 Inexact Rounded +sqtx4493 squareroot 0.829 -> 0.910 Inexact Rounded +sqtx4494 squareroot 0.0829 -> 0.288 Inexact Rounded +sqtx4495 squareroot 0.831 -> 0.912 Inexact Rounded +sqtx4496 squareroot 0.0831 -> 0.288 Inexact Rounded +sqtx4497 squareroot 0.832 -> 0.912 Inexact Rounded +sqtx4498 squareroot 0.0832 -> 0.288 Inexact Rounded +sqtx4499 squareroot 0.833 -> 0.913 Inexact Rounded +sqtx4500 squareroot 0.0833 -> 0.289 Inexact Rounded +sqtx4501 squareroot 0.834 -> 0.913 Inexact Rounded +sqtx4502 squareroot 0.0834 -> 0.289 Inexact Rounded +sqtx4503 squareroot 0.835 -> 0.914 Inexact Rounded +sqtx4504 squareroot 0.0835 -> 0.289 Inexact Rounded +sqtx4505 squareroot 0.836 -> 0.914 Inexact Rounded +sqtx4506 squareroot 0.0836 -> 0.289 Inexact Rounded +sqtx4507 squareroot 0.837 -> 0.915 Inexact Rounded +sqtx4508 squareroot 0.0837 -> 0.289 Inexact Rounded +sqtx4509 squareroot 0.838 -> 0.915 Inexact Rounded +sqtx4510 squareroot 0.0838 -> 0.289 Inexact Rounded +sqtx4511 squareroot 0.839 -> 0.916 Inexact Rounded +sqtx4512 squareroot 0.0839 -> 0.290 Inexact Rounded +sqtx4513 squareroot 0.841 -> 0.917 Inexact Rounded +sqtx4514 squareroot 0.0841 -> 0.29 +sqtx4515 squareroot 0.842 -> 0.918 Inexact Rounded +sqtx4516 squareroot 0.0842 -> 0.290 Inexact Rounded +sqtx4517 squareroot 0.843 -> 0.918 Inexact Rounded +sqtx4518 squareroot 0.0843 -> 0.290 Inexact Rounded +sqtx4519 squareroot 0.844 -> 0.919 Inexact Rounded +sqtx4520 squareroot 0.0844 -> 0.291 Inexact Rounded +sqtx4521 squareroot 0.845 -> 0.919 Inexact Rounded +sqtx4522 squareroot 0.0845 -> 0.291 Inexact Rounded +sqtx4523 squareroot 0.846 -> 0.920 Inexact Rounded +sqtx4524 squareroot 0.0846 -> 0.291 Inexact Rounded +sqtx4525 squareroot 0.847 -> 0.920 Inexact Rounded +sqtx4526 squareroot 0.0847 -> 0.291 Inexact Rounded +sqtx4527 squareroot 0.848 -> 0.921 Inexact Rounded +sqtx4528 squareroot 0.0848 -> 0.291 Inexact Rounded +sqtx4529 squareroot 0.849 -> 0.921 Inexact Rounded +sqtx4530 squareroot 0.0849 -> 0.291 Inexact Rounded +sqtx4531 squareroot 0.851 -> 0.922 Inexact Rounded +sqtx4532 squareroot 0.0851 -> 0.292 Inexact Rounded +sqtx4533 squareroot 0.852 -> 0.923 Inexact Rounded +sqtx4534 squareroot 0.0852 -> 0.292 Inexact Rounded +sqtx4535 squareroot 0.853 -> 0.924 Inexact Rounded +sqtx4536 squareroot 0.0853 -> 0.292 Inexact Rounded +sqtx4537 squareroot 0.854 -> 0.924 Inexact Rounded +sqtx4538 squareroot 0.0854 -> 0.292 Inexact Rounded +sqtx4539 squareroot 0.855 -> 0.925 Inexact Rounded +sqtx4540 squareroot 0.0855 -> 0.292 Inexact Rounded +sqtx4541 squareroot 0.856 -> 0.925 Inexact Rounded +sqtx4542 squareroot 0.0856 -> 0.293 Inexact Rounded +sqtx4543 squareroot 0.857 -> 0.926 Inexact Rounded +sqtx4544 squareroot 0.0857 -> 0.293 Inexact Rounded +sqtx4545 squareroot 0.858 -> 0.926 Inexact Rounded +sqtx4546 squareroot 0.0858 -> 0.293 Inexact Rounded +sqtx4547 squareroot 0.859 -> 0.927 Inexact Rounded +sqtx4548 squareroot 0.0859 -> 0.293 Inexact Rounded +sqtx4549 squareroot 0.861 -> 0.928 Inexact Rounded +sqtx4550 squareroot 0.0861 -> 0.293 Inexact Rounded +sqtx4551 squareroot 0.862 -> 0.928 Inexact Rounded +sqtx4552 squareroot 0.0862 -> 0.294 Inexact Rounded +sqtx4553 squareroot 0.863 -> 0.929 Inexact Rounded +sqtx4554 squareroot 0.0863 -> 0.294 Inexact Rounded +sqtx4555 squareroot 0.864 -> 0.930 Inexact Rounded +sqtx4556 squareroot 0.0864 -> 0.294 Inexact Rounded +sqtx4557 squareroot 0.865 -> 0.930 Inexact Rounded +sqtx4558 squareroot 0.0865 -> 0.294 Inexact Rounded +sqtx4559 squareroot 0.866 -> 0.931 Inexact Rounded +sqtx4560 squareroot 0.0866 -> 0.294 Inexact Rounded +sqtx4561 squareroot 0.867 -> 0.931 Inexact Rounded +sqtx4562 squareroot 0.0867 -> 0.294 Inexact Rounded +sqtx4563 squareroot 0.868 -> 0.932 Inexact Rounded +sqtx4564 squareroot 0.0868 -> 0.295 Inexact Rounded +sqtx4565 squareroot 0.869 -> 0.932 Inexact Rounded +sqtx4566 squareroot 0.0869 -> 0.295 Inexact Rounded +sqtx4567 squareroot 0.871 -> 0.933 Inexact Rounded +sqtx4568 squareroot 0.0871 -> 0.295 Inexact Rounded +sqtx4569 squareroot 0.872 -> 0.934 Inexact Rounded +sqtx4570 squareroot 0.0872 -> 0.295 Inexact Rounded +sqtx4571 squareroot 0.873 -> 0.934 Inexact Rounded +sqtx4572 squareroot 0.0873 -> 0.295 Inexact Rounded +sqtx4573 squareroot 0.874 -> 0.935 Inexact Rounded +sqtx4574 squareroot 0.0874 -> 0.296 Inexact Rounded +sqtx4575 squareroot 0.875 -> 0.935 Inexact Rounded +sqtx4576 squareroot 0.0875 -> 0.296 Inexact Rounded +sqtx4577 squareroot 0.876 -> 0.936 Inexact Rounded +sqtx4578 squareroot 0.0876 -> 0.296 Inexact Rounded +sqtx4579 squareroot 0.877 -> 0.936 Inexact Rounded +sqtx4580 squareroot 0.0877 -> 0.296 Inexact Rounded +sqtx4581 squareroot 0.878 -> 0.937 Inexact Rounded +sqtx4582 squareroot 0.0878 -> 0.296 Inexact Rounded +sqtx4583 squareroot 0.879 -> 0.938 Inexact Rounded +sqtx4584 squareroot 0.0879 -> 0.296 Inexact Rounded +sqtx4585 squareroot 0.881 -> 0.939 Inexact Rounded +sqtx4586 squareroot 0.0881 -> 0.297 Inexact Rounded +sqtx4587 squareroot 0.882 -> 0.939 Inexact Rounded +sqtx4588 squareroot 0.0882 -> 0.297 Inexact Rounded +sqtx4589 squareroot 0.883 -> 0.940 Inexact Rounded +sqtx4590 squareroot 0.0883 -> 0.297 Inexact Rounded +sqtx4591 squareroot 0.884 -> 0.940 Inexact Rounded +sqtx4592 squareroot 0.0884 -> 0.297 Inexact Rounded +sqtx4593 squareroot 0.885 -> 0.941 Inexact Rounded +sqtx4594 squareroot 0.0885 -> 0.297 Inexact Rounded +sqtx4595 squareroot 0.886 -> 0.941 Inexact Rounded +sqtx4596 squareroot 0.0886 -> 0.298 Inexact Rounded +sqtx4597 squareroot 0.887 -> 0.942 Inexact Rounded +sqtx4598 squareroot 0.0887 -> 0.298 Inexact Rounded +sqtx4599 squareroot 0.888 -> 0.942 Inexact Rounded +sqtx4600 squareroot 0.0888 -> 0.298 Inexact Rounded +sqtx4601 squareroot 0.889 -> 0.943 Inexact Rounded +sqtx4602 squareroot 0.0889 -> 0.298 Inexact Rounded +sqtx4603 squareroot 0.891 -> 0.944 Inexact Rounded +sqtx4604 squareroot 0.0891 -> 0.298 Inexact Rounded +sqtx4605 squareroot 0.892 -> 0.944 Inexact Rounded +sqtx4606 squareroot 0.0892 -> 0.299 Inexact Rounded +sqtx4607 squareroot 0.893 -> 0.945 Inexact Rounded +sqtx4608 squareroot 0.0893 -> 0.299 Inexact Rounded +sqtx4609 squareroot 0.894 -> 0.946 Inexact Rounded +sqtx4610 squareroot 0.0894 -> 0.299 Inexact Rounded +sqtx4611 squareroot 0.895 -> 0.946 Inexact Rounded +sqtx4612 squareroot 0.0895 -> 0.299 Inexact Rounded +sqtx4613 squareroot 0.896 -> 0.947 Inexact Rounded +sqtx4614 squareroot 0.0896 -> 0.299 Inexact Rounded +sqtx4615 squareroot 0.897 -> 0.947 Inexact Rounded +sqtx4616 squareroot 0.0897 -> 0.299 Inexact Rounded +sqtx4617 squareroot 0.898 -> 0.948 Inexact Rounded +sqtx4618 squareroot 0.0898 -> 0.300 Inexact Rounded +sqtx4619 squareroot 0.899 -> 0.948 Inexact Rounded +sqtx4620 squareroot 0.0899 -> 0.300 Inexact Rounded +sqtx4621 squareroot 0.901 -> 0.949 Inexact Rounded +sqtx4622 squareroot 0.0901 -> 0.300 Inexact Rounded +sqtx4623 squareroot 0.902 -> 0.950 Inexact Rounded +sqtx4624 squareroot 0.0902 -> 0.300 Inexact Rounded +sqtx4625 squareroot 0.903 -> 0.950 Inexact Rounded +sqtx4626 squareroot 0.0903 -> 0.300 Inexact Rounded +sqtx4627 squareroot 0.904 -> 0.951 Inexact Rounded +sqtx4628 squareroot 0.0904 -> 0.301 Inexact Rounded +sqtx4629 squareroot 0.905 -> 0.951 Inexact Rounded +sqtx4630 squareroot 0.0905 -> 0.301 Inexact Rounded +sqtx4631 squareroot 0.906 -> 0.952 Inexact Rounded +sqtx4632 squareroot 0.0906 -> 0.301 Inexact Rounded +sqtx4633 squareroot 0.907 -> 0.952 Inexact Rounded +sqtx4634 squareroot 0.0907 -> 0.301 Inexact Rounded +sqtx4635 squareroot 0.908 -> 0.953 Inexact Rounded +sqtx4636 squareroot 0.0908 -> 0.301 Inexact Rounded +sqtx4637 squareroot 0.909 -> 0.953 Inexact Rounded +sqtx4638 squareroot 0.0909 -> 0.301 Inexact Rounded +sqtx4639 squareroot 0.911 -> 0.954 Inexact Rounded +sqtx4640 squareroot 0.0911 -> 0.302 Inexact Rounded +sqtx4641 squareroot 0.912 -> 0.955 Inexact Rounded +sqtx4642 squareroot 0.0912 -> 0.302 Inexact Rounded +sqtx4643 squareroot 0.913 -> 0.956 Inexact Rounded +sqtx4644 squareroot 0.0913 -> 0.302 Inexact Rounded +sqtx4645 squareroot 0.914 -> 0.956 Inexact Rounded +sqtx4646 squareroot 0.0914 -> 0.302 Inexact Rounded +sqtx4647 squareroot 0.915 -> 0.957 Inexact Rounded +sqtx4648 squareroot 0.0915 -> 0.302 Inexact Rounded +sqtx4649 squareroot 0.916 -> 0.957 Inexact Rounded +sqtx4650 squareroot 0.0916 -> 0.303 Inexact Rounded +sqtx4651 squareroot 0.917 -> 0.958 Inexact Rounded +sqtx4652 squareroot 0.0917 -> 0.303 Inexact Rounded +sqtx4653 squareroot 0.918 -> 0.958 Inexact Rounded +sqtx4654 squareroot 0.0918 -> 0.303 Inexact Rounded +sqtx4655 squareroot 0.919 -> 0.959 Inexact Rounded +sqtx4656 squareroot 0.0919 -> 0.303 Inexact Rounded +sqtx4657 squareroot 0.921 -> 0.960 Inexact Rounded +sqtx4658 squareroot 0.0921 -> 0.303 Inexact Rounded +sqtx4659 squareroot 0.922 -> 0.960 Inexact Rounded +sqtx4660 squareroot 0.0922 -> 0.304 Inexact Rounded +sqtx4661 squareroot 0.923 -> 0.961 Inexact Rounded +sqtx4662 squareroot 0.0923 -> 0.304 Inexact Rounded +sqtx4663 squareroot 0.924 -> 0.961 Inexact Rounded +sqtx4664 squareroot 0.0924 -> 0.304 Inexact Rounded +sqtx4665 squareroot 0.925 -> 0.962 Inexact Rounded +sqtx4666 squareroot 0.0925 -> 0.304 Inexact Rounded +sqtx4667 squareroot 0.926 -> 0.962 Inexact Rounded +sqtx4668 squareroot 0.0926 -> 0.304 Inexact Rounded +sqtx4669 squareroot 0.927 -> 0.963 Inexact Rounded +sqtx4670 squareroot 0.0927 -> 0.304 Inexact Rounded +sqtx4671 squareroot 0.928 -> 0.963 Inexact Rounded +sqtx4672 squareroot 0.0928 -> 0.305 Inexact Rounded +sqtx4673 squareroot 0.929 -> 0.964 Inexact Rounded +sqtx4674 squareroot 0.0929 -> 0.305 Inexact Rounded +sqtx4675 squareroot 0.931 -> 0.965 Inexact Rounded +sqtx4676 squareroot 0.0931 -> 0.305 Inexact Rounded +sqtx4677 squareroot 0.932 -> 0.965 Inexact Rounded +sqtx4678 squareroot 0.0932 -> 0.305 Inexact Rounded +sqtx4679 squareroot 0.933 -> 0.966 Inexact Rounded +sqtx4680 squareroot 0.0933 -> 0.305 Inexact Rounded +sqtx4681 squareroot 0.934 -> 0.966 Inexact Rounded +sqtx4682 squareroot 0.0934 -> 0.306 Inexact Rounded +sqtx4683 squareroot 0.935 -> 0.967 Inexact Rounded +sqtx4684 squareroot 0.0935 -> 0.306 Inexact Rounded +sqtx4685 squareroot 0.936 -> 0.967 Inexact Rounded +sqtx4686 squareroot 0.0936 -> 0.306 Inexact Rounded +sqtx4687 squareroot 0.937 -> 0.968 Inexact Rounded +sqtx4688 squareroot 0.0937 -> 0.306 Inexact Rounded +sqtx4689 squareroot 0.938 -> 0.969 Inexact Rounded +sqtx4690 squareroot 0.0938 -> 0.306 Inexact Rounded +sqtx4691 squareroot 0.939 -> 0.969 Inexact Rounded +sqtx4692 squareroot 0.0939 -> 0.306 Inexact Rounded +sqtx4693 squareroot 0.941 -> 0.970 Inexact Rounded +sqtx4694 squareroot 0.0941 -> 0.307 Inexact Rounded +sqtx4695 squareroot 0.942 -> 0.971 Inexact Rounded +sqtx4696 squareroot 0.0942 -> 0.307 Inexact Rounded +sqtx4697 squareroot 0.943 -> 0.971 Inexact Rounded +sqtx4698 squareroot 0.0943 -> 0.307 Inexact Rounded +sqtx4699 squareroot 0.944 -> 0.972 Inexact Rounded +sqtx4700 squareroot 0.0944 -> 0.307 Inexact Rounded +sqtx4701 squareroot 0.945 -> 0.972 Inexact Rounded +sqtx4702 squareroot 0.0945 -> 0.307 Inexact Rounded +sqtx4703 squareroot 0.946 -> 0.973 Inexact Rounded +sqtx4704 squareroot 0.0946 -> 0.308 Inexact Rounded +sqtx4705 squareroot 0.947 -> 0.973 Inexact Rounded +sqtx4706 squareroot 0.0947 -> 0.308 Inexact Rounded +sqtx4707 squareroot 0.948 -> 0.974 Inexact Rounded +sqtx4708 squareroot 0.0948 -> 0.308 Inexact Rounded +sqtx4709 squareroot 0.949 -> 0.974 Inexact Rounded +sqtx4710 squareroot 0.0949 -> 0.308 Inexact Rounded +sqtx4711 squareroot 0.951 -> 0.975 Inexact Rounded +sqtx4712 squareroot 0.0951 -> 0.308 Inexact Rounded +sqtx4713 squareroot 0.952 -> 0.976 Inexact Rounded +sqtx4714 squareroot 0.0952 -> 0.309 Inexact Rounded +sqtx4715 squareroot 0.953 -> 0.976 Inexact Rounded +sqtx4716 squareroot 0.0953 -> 0.309 Inexact Rounded +sqtx4717 squareroot 0.954 -> 0.977 Inexact Rounded +sqtx4718 squareroot 0.0954 -> 0.309 Inexact Rounded +sqtx4719 squareroot 0.955 -> 0.977 Inexact Rounded +sqtx4720 squareroot 0.0955 -> 0.309 Inexact Rounded +sqtx4721 squareroot 0.956 -> 0.978 Inexact Rounded +sqtx4722 squareroot 0.0956 -> 0.309 Inexact Rounded +sqtx4723 squareroot 0.957 -> 0.978 Inexact Rounded +sqtx4724 squareroot 0.0957 -> 0.309 Inexact Rounded +sqtx4725 squareroot 0.958 -> 0.979 Inexact Rounded +sqtx4726 squareroot 0.0958 -> 0.310 Inexact Rounded +sqtx4727 squareroot 0.959 -> 0.979 Inexact Rounded +sqtx4728 squareroot 0.0959 -> 0.310 Inexact Rounded +sqtx4729 squareroot 0.961 -> 0.980 Inexact Rounded +sqtx4730 squareroot 0.0961 -> 0.31 +sqtx4731 squareroot 0.962 -> 0.981 Inexact Rounded +sqtx4732 squareroot 0.0962 -> 0.310 Inexact Rounded +sqtx4733 squareroot 0.963 -> 0.981 Inexact Rounded +sqtx4734 squareroot 0.0963 -> 0.310 Inexact Rounded +sqtx4735 squareroot 0.964 -> 0.982 Inexact Rounded +sqtx4736 squareroot 0.0964 -> 0.310 Inexact Rounded +sqtx4737 squareroot 0.965 -> 0.982 Inexact Rounded +sqtx4738 squareroot 0.0965 -> 0.311 Inexact Rounded +sqtx4739 squareroot 0.966 -> 0.983 Inexact Rounded +sqtx4740 squareroot 0.0966 -> 0.311 Inexact Rounded +sqtx4741 squareroot 0.967 -> 0.983 Inexact Rounded +sqtx4742 squareroot 0.0967 -> 0.311 Inexact Rounded +sqtx4743 squareroot 0.968 -> 0.984 Inexact Rounded +sqtx4744 squareroot 0.0968 -> 0.311 Inexact Rounded +sqtx4745 squareroot 0.969 -> 0.984 Inexact Rounded +sqtx4746 squareroot 0.0969 -> 0.311 Inexact Rounded +sqtx4747 squareroot 0.971 -> 0.985 Inexact Rounded +sqtx4748 squareroot 0.0971 -> 0.312 Inexact Rounded +sqtx4749 squareroot 0.972 -> 0.986 Inexact Rounded +sqtx4750 squareroot 0.0972 -> 0.312 Inexact Rounded +sqtx4751 squareroot 0.973 -> 0.986 Inexact Rounded +sqtx4752 squareroot 0.0973 -> 0.312 Inexact Rounded +sqtx4753 squareroot 0.974 -> 0.987 Inexact Rounded +sqtx4754 squareroot 0.0974 -> 0.312 Inexact Rounded +sqtx4755 squareroot 0.975 -> 0.987 Inexact Rounded +sqtx4756 squareroot 0.0975 -> 0.312 Inexact Rounded +sqtx4757 squareroot 0.976 -> 0.988 Inexact Rounded +sqtx4758 squareroot 0.0976 -> 0.312 Inexact Rounded +sqtx4759 squareroot 0.977 -> 0.988 Inexact Rounded +sqtx4760 squareroot 0.0977 -> 0.313 Inexact Rounded +sqtx4761 squareroot 0.978 -> 0.989 Inexact Rounded +sqtx4762 squareroot 0.0978 -> 0.313 Inexact Rounded +sqtx4763 squareroot 0.979 -> 0.989 Inexact Rounded +sqtx4764 squareroot 0.0979 -> 0.313 Inexact Rounded +sqtx4765 squareroot 0.981 -> 0.990 Inexact Rounded +sqtx4766 squareroot 0.0981 -> 0.313 Inexact Rounded +sqtx4767 squareroot 0.982 -> 0.991 Inexact Rounded +sqtx4768 squareroot 0.0982 -> 0.313 Inexact Rounded +sqtx4769 squareroot 0.983 -> 0.991 Inexact Rounded +sqtx4770 squareroot 0.0983 -> 0.314 Inexact Rounded +sqtx4771 squareroot 0.984 -> 0.992 Inexact Rounded +sqtx4772 squareroot 0.0984 -> 0.314 Inexact Rounded +sqtx4773 squareroot 0.985 -> 0.992 Inexact Rounded +sqtx4774 squareroot 0.0985 -> 0.314 Inexact Rounded +sqtx4775 squareroot 0.986 -> 0.993 Inexact Rounded +sqtx4776 squareroot 0.0986 -> 0.314 Inexact Rounded +sqtx4777 squareroot 0.987 -> 0.993 Inexact Rounded +sqtx4778 squareroot 0.0987 -> 0.314 Inexact Rounded +sqtx4779 squareroot 0.988 -> 0.994 Inexact Rounded +sqtx4780 squareroot 0.0988 -> 0.314 Inexact Rounded +sqtx4781 squareroot 0.989 -> 0.994 Inexact Rounded +sqtx4782 squareroot 0.0989 -> 0.314 Inexact Rounded +sqtx4783 squareroot 0.991 -> 0.995 Inexact Rounded +sqtx4784 squareroot 0.0991 -> 0.315 Inexact Rounded +sqtx4785 squareroot 0.992 -> 0.996 Inexact Rounded +sqtx4786 squareroot 0.0992 -> 0.315 Inexact Rounded +sqtx4787 squareroot 0.993 -> 0.996 Inexact Rounded +sqtx4788 squareroot 0.0993 -> 0.315 Inexact Rounded +sqtx4789 squareroot 0.994 -> 0.997 Inexact Rounded +sqtx4790 squareroot 0.0994 -> 0.315 Inexact Rounded +sqtx4791 squareroot 0.995 -> 0.997 Inexact Rounded +sqtx4792 squareroot 0.0995 -> 0.315 Inexact Rounded +sqtx4793 squareroot 0.996 -> 0.998 Inexact Rounded +sqtx4794 squareroot 0.0996 -> 0.316 Inexact Rounded +sqtx4795 squareroot 0.997 -> 0.998 Inexact Rounded +sqtx4796 squareroot 0.0997 -> 0.316 Inexact Rounded +sqtx4797 squareroot 0.998 -> 0.999 Inexact Rounded +sqtx4798 squareroot 0.0998 -> 0.316 Inexact Rounded +sqtx4799 squareroot 0.999 -> 0.999 Inexact Rounded +sqtx4800 squareroot 0.0999 -> 0.316 Inexact Rounded + +-- A group of precision 4 tests where Hull & Abrham adjustments are +-- needed in some cases (both up and down) [see Hull1985b] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 4 +sqtx5001 squareroot 0.0118 -> 0.1086 Inexact Rounded +sqtx5002 squareroot 0.119 -> 0.3450 Inexact Rounded +sqtx5003 squareroot 0.0119 -> 0.1091 Inexact Rounded +sqtx5004 squareroot 0.121 -> 0.3479 Inexact Rounded +sqtx5005 squareroot 0.0121 -> 0.11 +sqtx5006 squareroot 0.122 -> 0.3493 Inexact Rounded +sqtx5007 squareroot 0.0122 -> 0.1105 Inexact Rounded +sqtx5008 squareroot 0.123 -> 0.3507 Inexact Rounded +sqtx5009 squareroot 0.494 -> 0.7029 Inexact Rounded +sqtx5010 squareroot 0.0669 -> 0.2587 Inexact Rounded +sqtx5011 squareroot 0.9558 -> 0.9777 Inexact Rounded +sqtx5012 squareroot 0.9348 -> 0.9669 Inexact Rounded +sqtx5013 squareroot 0.9345 -> 0.9667 Inexact Rounded +sqtx5014 squareroot 0.09345 -> 0.3057 Inexact Rounded +sqtx5015 squareroot 0.9346 -> 0.9667 Inexact Rounded +sqtx5016 squareroot 0.09346 -> 0.3057 Inexact Rounded +sqtx5017 squareroot 0.9347 -> 0.9668 Inexact Rounded + +-- examples from decArith +precision: 9 +sqtx700 squareroot 0 -> '0' +sqtx701 squareroot -0 -> '-0' +sqtx702 squareroot 0.39 -> 0.624499800 Inexact Rounded +sqtx703 squareroot 100 -> '10' +sqtx704 squareroot 1.00 -> '1.0' +sqtx705 squareroot 7 -> '2.64575131' Inexact Rounded +sqtx706 squareroot 10 -> 3.16227766 Inexact Rounded + +-- some one-offs +precision: 9 +sqtx711 squareroot 0.1 -> 0.316227766 Inexact Rounded +sqtx712 squareroot 0.2 -> 0.447213595 Inexact Rounded +sqtx713 squareroot 0.3 -> 0.547722558 Inexact Rounded +sqtx714 squareroot 0.4 -> 0.632455532 Inexact Rounded +sqtx715 squareroot 0.5 -> 0.707106781 Inexact Rounded +sqtx716 squareroot 0.6 -> 0.774596669 Inexact Rounded +sqtx717 squareroot 0.7 -> 0.836660027 Inexact Rounded +sqtx718 squareroot 0.8 -> 0.894427191 Inexact Rounded +sqtx719 squareroot 0.9 -> 0.948683298 Inexact Rounded +precision: 10 -- note no normalizatoin here +sqtx720 squareroot +0.1 -> 0.3162277660 Inexact Rounded +precision: 11 +sqtx721 squareroot +0.1 -> 0.31622776602 Inexact Rounded +precision: 12 +sqtx722 squareroot +0.1 -> 0.316227766017 Inexact Rounded +precision: 9 +sqtx723 squareroot 0.39 -> 0.624499800 Inexact Rounded +precision: 15 +sqtx724 squareroot 0.39 -> 0.624499799839840 Inexact Rounded + +-- discussion cases +precision: 7 +sqtx731 squareroot 9 -> 3 +sqtx732 squareroot 100 -> 10 +sqtx733 squareroot 123 -> 11.09054 Inexact Rounded +sqtx734 squareroot 144 -> 12 +sqtx735 squareroot 156 -> 12.49000 Inexact Rounded +sqtx736 squareroot 10000 -> 100 + +-- values close to overflow (if there were input rounding) +maxexponent: 99 +minexponent: -99 +precision: 5 +sqtx760 squareroot 9.9997E+99 -> 9.9998E+49 Inexact Rounded +sqtx761 squareroot 9.9998E+99 -> 9.9999E+49 Inexact Rounded +sqtx762 squareroot 9.9999E+99 -> 9.9999E+49 Inexact Rounded +sqtx763 squareroot 9.99991E+99 -> 1.0000E+50 Inexact Rounded +sqtx764 squareroot 9.99994E+99 -> 1.0000E+50 Inexact Rounded +sqtx765 squareroot 9.99995E+99 -> 1.0000E+50 Inexact Rounded +sqtx766 squareroot 9.99999E+99 -> 1.0000E+50 Inexact Rounded +precision: 9 +sqtx770 squareroot 9.9997E+99 -> 9.99985000E+49 Inexact Rounded +sqtx771 squareroot 9.9998E+99 -> 9.99990000E+49 Inexact Rounded +sqtx772 squareroot 9.9999E+99 -> 9.99995000E+49 Inexact Rounded +sqtx773 squareroot 9.99991E+99 -> 9.99995500E+49 Inexact Rounded +sqtx774 squareroot 9.99994E+99 -> 9.99997000E+49 Inexact Rounded +sqtx775 squareroot 9.99995E+99 -> 9.99997500E+49 Inexact Rounded +sqtx776 squareroot 9.99999E+99 -> 9.99999500E+49 Inexact Rounded +precision: 20 +sqtx780 squareroot 9.9997E+99 -> '9.9998499988749831247E+49' Inexact Rounded +sqtx781 squareroot 9.9998E+99 -> '9.9998999994999949999E+49' Inexact Rounded +sqtx782 squareroot 9.9999E+99 -> '9.9999499998749993750E+49' Inexact Rounded +sqtx783 squareroot 9.99991E+99 -> '9.9999549998987495444E+49' Inexact Rounded +sqtx784 squareroot 9.99994E+99 -> '9.9999699999549998650E+49' Inexact Rounded +sqtx785 squareroot 9.99995E+99 -> '9.9999749999687499219E+49' Inexact Rounded +sqtx786 squareroot 9.99999E+99 -> '9.9999949999987499994E+49' Inexact Rounded + +-- subnormals and underflows [these can only result when eMax is < digits+1] +-- Etiny = -(Emax + (precision-1)) +-- start with subnormal operands and normal results +maxexponent: 9 +minexponent: -9 +precision: 9 -- Etiny=-17 +sqtx800 squareroot 1E-17 -> 3.16227766E-9 Inexact Rounded +sqtx801 squareroot 10E-17 -> 1.0E-8 +precision: 10 -- Etiny=-18 +sqtx802 squareroot 10E-18 -> 3.162277660E-9 Inexact Rounded +sqtx803 squareroot 1E-18 -> 1E-9 + +precision: 11 -- Etiny=-19 +sqtx804 squareroot 1E-19 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded +sqtx805 squareroot 10E-19 -> 1.0E-9 -- exact +precision: 12 -- Etiny=-20 +sqtx806 squareroot 10E-20 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded +sqtx807 squareroot 1E-20 -> 1E-10 Subnormal -- exact Subnormal case + +precision: 13 -- Etiny=-21 +sqtx808 squareroot 1E-21 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded +sqtx809 squareroot 10E-21 -> 1.0E-10 Subnormal -- exact Subnormal case +precision: 14 -- Etiny=-22 +sqtx810 squareroot 1E-21 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +sqtx811 squareroot 10E-22 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +sqtx812 squareroot 1E-22 -> 1E-11 Subnormal -- exact Subnormal case + +-- Not enough digits? +precision: 16 +maxExponent: 384 +minExponent: -383 +rounding: half_even +sqtx815 squareroot 1.0000000001000000E-78 -> 1.000000000050000E-39 Inexact Rounded +-- 1 234567890123456 + +-- special values +maxexponent: 999 +minexponent: -999 +sqtx820 squareroot Inf -> Infinity +sqtx821 squareroot -Inf -> NaN Invalid_operation +sqtx822 squareroot NaN -> NaN +sqtx823 squareroot sNaN -> NaN Invalid_operation +-- propagating NaNs +sqtx824 squareroot sNaN123 -> NaN123 Invalid_operation +sqtx825 squareroot -sNaN321 -> -NaN321 Invalid_operation +sqtx826 squareroot NaN456 -> NaN456 +sqtx827 squareroot -NaN654 -> -NaN654 +sqtx828 squareroot NaN1 -> NaN1 + +-- payload decapitate +precision: 5 +sqtx840 squareroot -sNaN1234567890 -> -NaN67890 Invalid_operation + +------------------------------------------------------------------------ +-- +-- Special thanks to Mark Dickinson for tests in the range 8000-8999. +-- +-- Extra tests for the square root function, dealing with a variety of +-- corner cases. In particular, these tests concentrate on +-- (1) cases where the input precision exceeds the context precision, and +-- (2) cases where the input exponent is outside the current context, +-- and in particular when the result is subnormal +-- +-- maxexponent and minexponent are set to 9 and -9 for most of these +-- cases; only the precision changes. The rounding also does not +-- change, because it is ignored for this operation. +maxexponent: 9 +minexponent: -9 + +-- exact results, input precision > context precision +precision: 1 +sqtx8000 squareroot 0 -> 0 +sqtx8001 squareroot 1 -> 1 +sqtx8002 squareroot 4 -> 2 +sqtx8003 squareroot 9 -> 3 +sqtx8004 squareroot 16 -> 4 +sqtx8005 squareroot 25 -> 5 +sqtx8006 squareroot 36 -> 6 +sqtx8007 squareroot 49 -> 7 +sqtx8008 squareroot 64 -> 8 +sqtx8009 squareroot 81 -> 9 +sqtx8010 squareroot 100 -> 1E+1 Rounded +sqtx8011 squareroot 121 -> 1E+1 Inexact Rounded + +precision: 2 +sqtx8012 squareroot 0 -> 0 +sqtx8013 squareroot 1 -> 1 +sqtx8014 squareroot 4 -> 2 +sqtx8015 squareroot 9 -> 3 +sqtx8016 squareroot 16 -> 4 +sqtx8017 squareroot 25 -> 5 +sqtx8018 squareroot 36 -> 6 +sqtx8019 squareroot 49 -> 7 +sqtx8020 squareroot 64 -> 8 +sqtx8021 squareroot 81 -> 9 +sqtx8022 squareroot 100 -> 10 +sqtx8023 squareroot 121 -> 11 +sqtx8024 squareroot 144 -> 12 +sqtx8025 squareroot 169 -> 13 +sqtx8026 squareroot 196 -> 14 +sqtx8027 squareroot 225 -> 15 +sqtx8028 squareroot 256 -> 16 +sqtx8029 squareroot 289 -> 17 +sqtx8030 squareroot 324 -> 18 +sqtx8031 squareroot 361 -> 19 +sqtx8032 squareroot 400 -> 20 +sqtx8033 squareroot 441 -> 21 +sqtx8034 squareroot 484 -> 22 +sqtx8035 squareroot 529 -> 23 +sqtx8036 squareroot 576 -> 24 +sqtx8037 squareroot 625 -> 25 +sqtx8038 squareroot 676 -> 26 +sqtx8039 squareroot 729 -> 27 +sqtx8040 squareroot 784 -> 28 +sqtx8041 squareroot 841 -> 29 +sqtx8042 squareroot 900 -> 30 +sqtx8043 squareroot 961 -> 31 +sqtx8044 squareroot 1024 -> 32 +sqtx8045 squareroot 1089 -> 33 +sqtx8046 squareroot 1156 -> 34 +sqtx8047 squareroot 1225 -> 35 +sqtx8048 squareroot 1296 -> 36 +sqtx8049 squareroot 1369 -> 37 +sqtx8050 squareroot 1444 -> 38 +sqtx8051 squareroot 1521 -> 39 +sqtx8052 squareroot 1600 -> 40 +sqtx8053 squareroot 1681 -> 41 +sqtx8054 squareroot 1764 -> 42 +sqtx8055 squareroot 1849 -> 43 +sqtx8056 squareroot 1936 -> 44 +sqtx8057 squareroot 2025 -> 45 +sqtx8058 squareroot 2116 -> 46 +sqtx8059 squareroot 2209 -> 47 +sqtx8060 squareroot 2304 -> 48 +sqtx8061 squareroot 2401 -> 49 +sqtx8062 squareroot 2500 -> 50 +sqtx8063 squareroot 2601 -> 51 +sqtx8064 squareroot 2704 -> 52 +sqtx8065 squareroot 2809 -> 53 +sqtx8066 squareroot 2916 -> 54 +sqtx8067 squareroot 3025 -> 55 +sqtx8068 squareroot 3136 -> 56 +sqtx8069 squareroot 3249 -> 57 +sqtx8070 squareroot 3364 -> 58 +sqtx8071 squareroot 3481 -> 59 +sqtx8072 squareroot 3600 -> 60 +sqtx8073 squareroot 3721 -> 61 +sqtx8074 squareroot 3844 -> 62 +sqtx8075 squareroot 3969 -> 63 +sqtx8076 squareroot 4096 -> 64 +sqtx8077 squareroot 4225 -> 65 +sqtx8078 squareroot 4356 -> 66 +sqtx8079 squareroot 4489 -> 67 +sqtx8080 squareroot 4624 -> 68 +sqtx8081 squareroot 4761 -> 69 +sqtx8082 squareroot 4900 -> 70 +sqtx8083 squareroot 5041 -> 71 +sqtx8084 squareroot 5184 -> 72 +sqtx8085 squareroot 5329 -> 73 +sqtx8086 squareroot 5476 -> 74 +sqtx8087 squareroot 5625 -> 75 +sqtx8088 squareroot 5776 -> 76 +sqtx8089 squareroot 5929 -> 77 +sqtx8090 squareroot 6084 -> 78 +sqtx8091 squareroot 6241 -> 79 +sqtx8092 squareroot 6400 -> 80 +sqtx8093 squareroot 6561 -> 81 +sqtx8094 squareroot 6724 -> 82 +sqtx8095 squareroot 6889 -> 83 +sqtx8096 squareroot 7056 -> 84 +sqtx8097 squareroot 7225 -> 85 +sqtx8098 squareroot 7396 -> 86 +sqtx8099 squareroot 7569 -> 87 +sqtx8100 squareroot 7744 -> 88 +sqtx8101 squareroot 7921 -> 89 +sqtx8102 squareroot 8100 -> 90 +sqtx8103 squareroot 8281 -> 91 +sqtx8104 squareroot 8464 -> 92 +sqtx8105 squareroot 8649 -> 93 +sqtx8106 squareroot 8836 -> 94 +sqtx8107 squareroot 9025 -> 95 +sqtx8108 squareroot 9216 -> 96 +sqtx8109 squareroot 9409 -> 97 +sqtx8110 squareroot 9604 -> 98 +sqtx8111 squareroot 9801 -> 99 +sqtx8112 squareroot 10000 -> 1.0E+2 Rounded +sqtx8113 squareroot 10201 -> 1.0E+2 Inexact Rounded + +precision: 3 +sqtx8114 squareroot 841 -> 29 +sqtx8115 squareroot 1600 -> 40 +sqtx8116 squareroot 2209 -> 47 +sqtx8117 squareroot 9604 -> 98 +sqtx8118 squareroot 21316 -> 146 +sqtx8119 squareroot 52441 -> 229 +sqtx8120 squareroot 68644 -> 262 +sqtx8121 squareroot 69696 -> 264 +sqtx8122 squareroot 70225 -> 265 +sqtx8123 squareroot 76729 -> 277 +sqtx8124 squareroot 130321 -> 361 +sqtx8125 squareroot 171396 -> 414 +sqtx8126 squareroot 270400 -> 520 +sqtx8127 squareroot 279841 -> 529 +sqtx8128 squareroot 407044 -> 638 +sqtx8129 squareroot 408321 -> 639 +sqtx8130 squareroot 480249 -> 693 +sqtx8131 squareroot 516961 -> 719 +sqtx8132 squareroot 692224 -> 832 +sqtx8133 squareroot 829921 -> 911 + +-- selection of random exact results +precision: 6 +sqtx8134 squareroot 2.25E-12 -> 0.0000015 +sqtx8135 squareroot 8.41E-14 -> 2.9E-7 +sqtx8136 squareroot 6.241E-15 -> 7.9E-8 +sqtx8137 squareroot 5.041E+13 -> 7.1E+6 +sqtx8138 squareroot 4761 -> 69 +sqtx8139 squareroot 1.369E+17 -> 3.7E+8 +sqtx8140 squareroot 0.00002116 -> 0.0046 +sqtx8141 squareroot 7.29E+4 -> 2.7E+2 +sqtx8142 squareroot 4.624E-13 -> 6.8E-7 +sqtx8143 squareroot 3.969E+5 -> 6.3E+2 +sqtx8144 squareroot 3.73321E-11 -> 0.00000611 +sqtx8145 squareroot 5.61001E+17 -> 7.49E+8 +sqtx8146 squareroot 2.30400E-11 -> 0.00000480 +sqtx8147 squareroot 4.30336E+17 -> 6.56E+8 +sqtx8148 squareroot 0.057121 -> 0.239 +sqtx8149 squareroot 7.225E+17 -> 8.5E+8 +sqtx8150 squareroot 3.14721E+13 -> 5.61E+6 +sqtx8151 squareroot 4.61041E+17 -> 6.79E+8 +sqtx8152 squareroot 1.39876E-15 -> 3.74E-8 +sqtx8153 squareroot 6.19369E-9 -> 0.0000787 +sqtx8154 squareroot 1.620529E-10 -> 0.00001273 +sqtx8155 squareroot 1177.1761 -> 34.31 +sqtx8156 squareroot 67043344 -> 8188 +sqtx8157 squareroot 4.84E+6 -> 2.2E+3 +sqtx8158 squareroot 1.23904E+11 -> 3.52E+5 +sqtx8159 squareroot 32604100 -> 5710 +sqtx8160 squareroot 2.9757025E-11 -> 0.000005455 +sqtx8161 squareroot 6.3760225E-9 -> 0.00007985 +sqtx8162 squareroot 4.5198729E-11 -> 0.000006723 +sqtx8163 squareroot 1.4745600E-11 -> 0.000003840 +sqtx8164 squareroot 18964283.04 -> 4354.8 +sqtx8165 squareroot 3.308895529E+13 -> 5.7523E+6 +sqtx8166 squareroot 0.0028590409 -> 0.05347 +sqtx8167 squareroot 3572.213824 -> 59.768 +sqtx8168 squareroot 4.274021376E+15 -> 6.5376E+7 +sqtx8169 squareroot 4455476.64 -> 2110.8 +sqtx8170 squareroot 38.44 -> 6.2 +sqtx8171 squareroot 68.558400 -> 8.280 +sqtx8172 squareroot 715402009 -> 26747 +sqtx8173 squareroot 93.373569 -> 9.663 +sqtx8174 squareroot 2.62144000000E+15 -> 5.12000E+7 +sqtx8175 squareroot 7.48225000000E+15 -> 8.65000E+7 +sqtx8176 squareroot 3.38724000000E-9 -> 0.0000582000 +sqtx8177 squareroot 5.64001000000E-13 -> 7.51000E-7 +sqtx8178 squareroot 5.06944000000E-15 -> 7.12000E-8 +sqtx8179 squareroot 4.95616000000E+17 -> 7.04000E+8 +sqtx8180 squareroot 0.0000242064000000 -> 0.00492000 +sqtx8181 squareroot 1.48996000000E-15 -> 3.86000E-8 +sqtx8182 squareroot 9.37024000000E+17 -> 9.68000E+8 +sqtx8183 squareroot 7128900.0000 -> 2670.00 +sqtx8184 squareroot 8.2311610000E-10 -> 0.0000286900 +sqtx8185 squareroot 482747040000 -> 694800 +sqtx8186 squareroot 4.14478440000E+17 -> 6.43800E+8 +sqtx8187 squareroot 5.10510250000E-7 -> 0.000714500 +sqtx8188 squareroot 355096.810000 -> 595.900 +sqtx8189 squareroot 14288400.0000 -> 3780.00 +sqtx8190 squareroot 3.36168040000E-15 -> 5.79800E-8 +sqtx8191 squareroot 1.70899560000E-13 -> 4.13400E-7 +sqtx8192 squareroot 0.0000378348010000 -> 0.00615100 +sqtx8193 squareroot 2.00972890000E-13 -> 4.48300E-7 +sqtx8194 squareroot 4.07222659600E-13 -> 6.38140E-7 +sqtx8195 squareroot 131486012100 -> 362610 +sqtx8196 squareroot 818192611600 -> 904540 +sqtx8197 squareroot 9.8558323600E+16 -> 3.13940E+8 +sqtx8198 squareroot 5641.06144900 -> 75.1070 +sqtx8199 squareroot 4.58789475600E+17 -> 6.77340E+8 +sqtx8200 squareroot 3.21386948100E-9 -> 0.0000566910 +sqtx8201 squareroot 3.9441960000E-8 -> 0.000198600 +sqtx8202 squareroot 242723.728900 -> 492.670 +sqtx8203 squareroot 1874.89000000 -> 43.3000 +sqtx8204 squareroot 2.56722595684E+15 -> 5.06678E+7 +sqtx8205 squareroot 3.96437714689E-17 -> 6.29633E-9 +sqtx8206 squareroot 3.80106774784E-17 -> 6.16528E-9 +sqtx8207 squareroot 1.42403588496E-13 -> 3.77364E-7 +sqtx8208 squareroot 4604.84388100 -> 67.8590 +sqtx8209 squareroot 2157100869.16 -> 46444.6 +sqtx8210 squareroot 355288570.81 -> 18849.1 +sqtx8211 squareroot 4.69775901604E-11 -> 0.00000685402 +sqtx8212 squareroot 8.22115770436E+17 -> 9.06706E+8 +sqtx8213 squareroot 7.16443744900E+15 -> 8.46430E+7 +sqtx8214 squareroot 9.48995498896E+15 -> 9.74164E+7 +sqtx8215 squareroot 0.0000419091801129 -> 0.00647373 +sqtx8216 squareroot 5862627996.84 -> 76567.8 +sqtx8217 squareroot 9369537.3409 -> 3060.97 +sqtx8218 squareroot 7.74792529729E+17 -> 8.80223E+8 +sqtx8219 squareroot 1.08626931396E+17 -> 3.29586E+8 +sqtx8220 squareroot 8.89584739684E-7 -> 0.000943178 +sqtx8221 squareroot 4.0266040896E-18 -> 2.00664E-9 +sqtx8222 squareroot 9.27669480336E-7 -> 0.000963156 +sqtx8223 squareroot 0.00225497717956 -> 0.0474866 + +-- test use of round-half-even for ties +precision: 1 +sqtx8224 squareroot 225 -> 2E+1 Inexact Rounded +sqtx8225 squareroot 625 -> 2E+1 Inexact Rounded +sqtx8226 squareroot 1225 -> 4E+1 Inexact Rounded +sqtx8227 squareroot 2025 -> 4E+1 Inexact Rounded +sqtx8228 squareroot 3025 -> 6E+1 Inexact Rounded +sqtx8229 squareroot 4225 -> 6E+1 Inexact Rounded +sqtx8230 squareroot 5625 -> 8E+1 Inexact Rounded +sqtx8231 squareroot 7225 -> 8E+1 Inexact Rounded +sqtx8232 squareroot 9025 -> 1E+2 Inexact Rounded + +precision: 2 +sqtx8233 squareroot 11025 -> 1.0E+2 Inexact Rounded +sqtx8234 squareroot 13225 -> 1.2E+2 Inexact Rounded +sqtx8235 squareroot 15625 -> 1.2E+2 Inexact Rounded +sqtx8236 squareroot 18225 -> 1.4E+2 Inexact Rounded +sqtx8237 squareroot 21025 -> 1.4E+2 Inexact Rounded +sqtx8238 squareroot 24025 -> 1.6E+2 Inexact Rounded +sqtx8239 squareroot 27225 -> 1.6E+2 Inexact Rounded +sqtx8240 squareroot 30625 -> 1.8E+2 Inexact Rounded +sqtx8241 squareroot 34225 -> 1.8E+2 Inexact Rounded +sqtx8242 squareroot 38025 -> 2.0E+2 Inexact Rounded +sqtx8243 squareroot 42025 -> 2.0E+2 Inexact Rounded +sqtx8244 squareroot 46225 -> 2.2E+2 Inexact Rounded +sqtx8245 squareroot 50625 -> 2.2E+2 Inexact Rounded +sqtx8246 squareroot 55225 -> 2.4E+2 Inexact Rounded +sqtx8247 squareroot 60025 -> 2.4E+2 Inexact Rounded +sqtx8248 squareroot 65025 -> 2.6E+2 Inexact Rounded +sqtx8249 squareroot 70225 -> 2.6E+2 Inexact Rounded +sqtx8250 squareroot 75625 -> 2.8E+2 Inexact Rounded +sqtx8251 squareroot 81225 -> 2.8E+2 Inexact Rounded +sqtx8252 squareroot 87025 -> 3.0E+2 Inexact Rounded +sqtx8253 squareroot 93025 -> 3.0E+2 Inexact Rounded +sqtx8254 squareroot 99225 -> 3.2E+2 Inexact Rounded +sqtx8255 squareroot 105625 -> 3.2E+2 Inexact Rounded +sqtx8256 squareroot 112225 -> 3.4E+2 Inexact Rounded +sqtx8257 squareroot 119025 -> 3.4E+2 Inexact Rounded +sqtx8258 squareroot 126025 -> 3.6E+2 Inexact Rounded +sqtx8259 squareroot 133225 -> 3.6E+2 Inexact Rounded +sqtx8260 squareroot 140625 -> 3.8E+2 Inexact Rounded +sqtx8261 squareroot 148225 -> 3.8E+2 Inexact Rounded +sqtx8262 squareroot 156025 -> 4.0E+2 Inexact Rounded +sqtx8263 squareroot 164025 -> 4.0E+2 Inexact Rounded +sqtx8264 squareroot 172225 -> 4.2E+2 Inexact Rounded +sqtx8265 squareroot 180625 -> 4.2E+2 Inexact Rounded +sqtx8266 squareroot 189225 -> 4.4E+2 Inexact Rounded +sqtx8267 squareroot 198025 -> 4.4E+2 Inexact Rounded +sqtx8268 squareroot 207025 -> 4.6E+2 Inexact Rounded +sqtx8269 squareroot 216225 -> 4.6E+2 Inexact Rounded +sqtx8270 squareroot 225625 -> 4.8E+2 Inexact Rounded +sqtx8271 squareroot 235225 -> 4.8E+2 Inexact Rounded +sqtx8272 squareroot 245025 -> 5.0E+2 Inexact Rounded +sqtx8273 squareroot 255025 -> 5.0E+2 Inexact Rounded +sqtx8274 squareroot 265225 -> 5.2E+2 Inexact Rounded +sqtx8275 squareroot 275625 -> 5.2E+2 Inexact Rounded +sqtx8276 squareroot 286225 -> 5.4E+2 Inexact Rounded +sqtx8277 squareroot 297025 -> 5.4E+2 Inexact Rounded +sqtx8278 squareroot 308025 -> 5.6E+2 Inexact Rounded +sqtx8279 squareroot 319225 -> 5.6E+2 Inexact Rounded +sqtx8280 squareroot 330625 -> 5.8E+2 Inexact Rounded +sqtx8281 squareroot 342225 -> 5.8E+2 Inexact Rounded +sqtx8282 squareroot 354025 -> 6.0E+2 Inexact Rounded +sqtx8283 squareroot 366025 -> 6.0E+2 Inexact Rounded +sqtx8284 squareroot 378225 -> 6.2E+2 Inexact Rounded +sqtx8285 squareroot 390625 -> 6.2E+2 Inexact Rounded +sqtx8286 squareroot 403225 -> 6.4E+2 Inexact Rounded +sqtx8287 squareroot 416025 -> 6.4E+2 Inexact Rounded +sqtx8288 squareroot 429025 -> 6.6E+2 Inexact Rounded +sqtx8289 squareroot 442225 -> 6.6E+2 Inexact Rounded +sqtx8290 squareroot 455625 -> 6.8E+2 Inexact Rounded +sqtx8291 squareroot 469225 -> 6.8E+2 Inexact Rounded +sqtx8292 squareroot 483025 -> 7.0E+2 Inexact Rounded +sqtx8293 squareroot 497025 -> 7.0E+2 Inexact Rounded +sqtx8294 squareroot 511225 -> 7.2E+2 Inexact Rounded +sqtx8295 squareroot 525625 -> 7.2E+2 Inexact Rounded +sqtx8296 squareroot 540225 -> 7.4E+2 Inexact Rounded +sqtx8297 squareroot 555025 -> 7.4E+2 Inexact Rounded +sqtx8298 squareroot 570025 -> 7.6E+2 Inexact Rounded +sqtx8299 squareroot 585225 -> 7.6E+2 Inexact Rounded +sqtx8300 squareroot 600625 -> 7.8E+2 Inexact Rounded +sqtx8301 squareroot 616225 -> 7.8E+2 Inexact Rounded +sqtx8302 squareroot 632025 -> 8.0E+2 Inexact Rounded +sqtx8303 squareroot 648025 -> 8.0E+2 Inexact Rounded +sqtx8304 squareroot 664225 -> 8.2E+2 Inexact Rounded +sqtx8305 squareroot 680625 -> 8.2E+2 Inexact Rounded +sqtx8306 squareroot 697225 -> 8.4E+2 Inexact Rounded +sqtx8307 squareroot 714025 -> 8.4E+2 Inexact Rounded +sqtx8308 squareroot 731025 -> 8.6E+2 Inexact Rounded +sqtx8309 squareroot 748225 -> 8.6E+2 Inexact Rounded +sqtx8310 squareroot 765625 -> 8.8E+2 Inexact Rounded +sqtx8311 squareroot 783225 -> 8.8E+2 Inexact Rounded +sqtx8312 squareroot 801025 -> 9.0E+2 Inexact Rounded +sqtx8313 squareroot 819025 -> 9.0E+2 Inexact Rounded +sqtx8314 squareroot 837225 -> 9.2E+2 Inexact Rounded +sqtx8315 squareroot 855625 -> 9.2E+2 Inexact Rounded +sqtx8316 squareroot 874225 -> 9.4E+2 Inexact Rounded +sqtx8317 squareroot 893025 -> 9.4E+2 Inexact Rounded +sqtx8318 squareroot 912025 -> 9.6E+2 Inexact Rounded +sqtx8319 squareroot 931225 -> 9.6E+2 Inexact Rounded +sqtx8320 squareroot 950625 -> 9.8E+2 Inexact Rounded +sqtx8321 squareroot 970225 -> 9.8E+2 Inexact Rounded +sqtx8322 squareroot 990025 -> 1.0E+3 Inexact Rounded + +precision: 6 +sqtx8323 squareroot 88975734963025 -> 9.43270E+6 Inexact Rounded +sqtx8324 squareroot 71085555000625 -> 8.43122E+6 Inexact Rounded +sqtx8325 squareroot 39994304.051025 -> 6324.10 Inexact Rounded +sqtx8326 squareroot 0.000007327172265625 -> 0.00270688 Inexact Rounded +sqtx8327 squareroot 1.0258600439025E-13 -> 3.20290E-7 Inexact Rounded +sqtx8328 squareroot 0.0034580574275625 -> 0.0588052 Inexact Rounded +sqtx8329 squareroot 7.6842317700625E-7 -> 0.000876598 Inexact Rounded +sqtx8330 squareroot 1263834495.2025 -> 35550.4 Inexact Rounded +sqtx8331 squareroot 433970666460.25 -> 658764 Inexact Rounded +sqtx8332 squareroot 4.5879286230625E-7 -> 0.000677342 Inexact Rounded +sqtx8333 squareroot 0.0029305603306225 -> 0.0541346 Inexact Rounded +sqtx8334 squareroot 70218282.733225 -> 8379.64 Inexact Rounded +sqtx8335 squareroot 11942519.082025 -> 3455.80 Inexact Rounded +sqtx8336 squareroot 0.0021230668905625 -> 0.0460768 Inexact Rounded +sqtx8337 squareroot 0.90081833411025 -> 0.949114 Inexact Rounded +sqtx8338 squareroot 5.5104120936225E-17 -> 7.42322E-9 Inexact Rounded +sqtx8339 squareroot 0.10530446854225 -> 0.324506 Inexact Rounded +sqtx8340 squareroot 8.706069866025E-14 -> 2.95060E-7 Inexact Rounded +sqtx8341 squareroot 23838.58800625 -> 154.398 Inexact Rounded +sqtx8342 squareroot 0.0013426911275625 -> 0.0366428 Inexact Rounded + +-- test use of round-half-even in underflow situations + +-- precisions 2; all cases where result is both subnormal and a tie +precision: 2 +sqtx8343 squareroot 2.5E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped +sqtx8344 squareroot 2.25E-20 -> 2E-10 Underflow Subnormal Inexact Rounded +sqtx8345 squareroot 6.25E-20 -> 2E-10 Underflow Subnormal Inexact Rounded +sqtx8346 squareroot 1.225E-19 -> 4E-10 Underflow Subnormal Inexact Rounded +sqtx8347 squareroot 2.025E-19 -> 4E-10 Underflow Subnormal Inexact Rounded +sqtx8348 squareroot 3.025E-19 -> 6E-10 Underflow Subnormal Inexact Rounded +sqtx8349 squareroot 4.225E-19 -> 6E-10 Underflow Subnormal Inexact Rounded +sqtx8350 squareroot 5.625E-19 -> 8E-10 Underflow Subnormal Inexact Rounded +sqtx8351 squareroot 7.225E-19 -> 8E-10 Underflow Subnormal Inexact Rounded +sqtx8352 squareroot 9.025E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded + +-- precision 3, input precision <= 5 +precision: 3 +sqtx8353 squareroot 2.5E-23 -> 0E-11 Underflow Subnormal Inexact Rounded Clamped +sqtx8354 squareroot 2.25E-22 -> 2E-11 Underflow Subnormal Inexact Rounded +sqtx8355 squareroot 6.25E-22 -> 2E-11 Underflow Subnormal Inexact Rounded +sqtx8356 squareroot 1.225E-21 -> 4E-11 Underflow Subnormal Inexact Rounded +sqtx8357 squareroot 2.025E-21 -> 4E-11 Underflow Subnormal Inexact Rounded +sqtx8358 squareroot 3.025E-21 -> 6E-11 Underflow Subnormal Inexact Rounded +sqtx8359 squareroot 4.225E-21 -> 6E-11 Underflow Subnormal Inexact Rounded +sqtx8360 squareroot 5.625E-21 -> 8E-11 Underflow Subnormal Inexact Rounded +sqtx8361 squareroot 7.225E-21 -> 8E-11 Underflow Subnormal Inexact Rounded +sqtx8362 squareroot 9.025E-21 -> 1.0E-10 Underflow Subnormal Inexact Rounded +sqtx8363 squareroot 1.1025E-20 -> 1.0E-10 Underflow Subnormal Inexact Rounded +sqtx8364 squareroot 1.3225E-20 -> 1.2E-10 Underflow Subnormal Inexact Rounded +sqtx8365 squareroot 1.5625E-20 -> 1.2E-10 Underflow Subnormal Inexact Rounded +sqtx8366 squareroot 1.8225E-20 -> 1.4E-10 Underflow Subnormal Inexact Rounded +sqtx8367 squareroot 2.1025E-20 -> 1.4E-10 Underflow Subnormal Inexact Rounded +sqtx8368 squareroot 2.4025E-20 -> 1.6E-10 Underflow Subnormal Inexact Rounded +sqtx8369 squareroot 2.7225E-20 -> 1.6E-10 Underflow Subnormal Inexact Rounded +sqtx8370 squareroot 3.0625E-20 -> 1.8E-10 Underflow Subnormal Inexact Rounded +sqtx8371 squareroot 3.4225E-20 -> 1.8E-10 Underflow Subnormal Inexact Rounded +sqtx8372 squareroot 3.8025E-20 -> 2.0E-10 Underflow Subnormal Inexact Rounded +sqtx8373 squareroot 4.2025E-20 -> 2.0E-10 Underflow Subnormal Inexact Rounded +sqtx8374 squareroot 4.6225E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded +sqtx8375 squareroot 5.0625E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded +sqtx8376 squareroot 5.5225E-20 -> 2.4E-10 Underflow Subnormal Inexact Rounded +sqtx8377 squareroot 6.0025E-20 -> 2.4E-10 Underflow Subnormal Inexact Rounded +sqtx8378 squareroot 6.5025E-20 -> 2.6E-10 Underflow Subnormal Inexact Rounded +sqtx8379 squareroot 7.0225E-20 -> 2.6E-10 Underflow Subnormal Inexact Rounded +sqtx8380 squareroot 7.5625E-20 -> 2.8E-10 Underflow Subnormal Inexact Rounded +sqtx8381 squareroot 8.1225E-20 -> 2.8E-10 Underflow Subnormal Inexact Rounded +sqtx8382 squareroot 8.7025E-20 -> 3.0E-10 Underflow Subnormal Inexact Rounded +sqtx8383 squareroot 9.3025E-20 -> 3.0E-10 Underflow Subnormal Inexact Rounded +sqtx8384 squareroot 9.9225E-20 -> 3.2E-10 Underflow Subnormal Inexact Rounded + +--precision 4, input precision <= 4 +precision: 4 +sqtx8385 squareroot 2.5E-25 -> 0E-12 Underflow Subnormal Inexact Rounded Clamped +sqtx8386 squareroot 2.25E-24 -> 2E-12 Underflow Subnormal Inexact Rounded +sqtx8387 squareroot 6.25E-24 -> 2E-12 Underflow Subnormal Inexact Rounded +sqtx8388 squareroot 1.225E-23 -> 4E-12 Underflow Subnormal Inexact Rounded +sqtx8389 squareroot 2.025E-23 -> 4E-12 Underflow Subnormal Inexact Rounded +sqtx8390 squareroot 3.025E-23 -> 6E-12 Underflow Subnormal Inexact Rounded +sqtx8391 squareroot 4.225E-23 -> 6E-12 Underflow Subnormal Inexact Rounded +sqtx8392 squareroot 5.625E-23 -> 8E-12 Underflow Subnormal Inexact Rounded +sqtx8393 squareroot 7.225E-23 -> 8E-12 Underflow Subnormal Inexact Rounded +sqtx8394 squareroot 9.025E-23 -> 1.0E-11 Underflow Subnormal Inexact Rounded + +--precision 5, input precision <= 5 +precision: 5 +sqtx8395 squareroot 2.5E-27 -> 0E-13 Underflow Subnormal Inexact Rounded Clamped +sqtx8396 squareroot 2.25E-26 -> 2E-13 Underflow Subnormal Inexact Rounded +sqtx8397 squareroot 6.25E-26 -> 2E-13 Underflow Subnormal Inexact Rounded +sqtx8398 squareroot 1.225E-25 -> 4E-13 Underflow Subnormal Inexact Rounded +sqtx8399 squareroot 2.025E-25 -> 4E-13 Underflow Subnormal Inexact Rounded +sqtx8400 squareroot 3.025E-25 -> 6E-13 Underflow Subnormal Inexact Rounded +sqtx8401 squareroot 4.225E-25 -> 6E-13 Underflow Subnormal Inexact Rounded +sqtx8402 squareroot 5.625E-25 -> 8E-13 Underflow Subnormal Inexact Rounded +sqtx8403 squareroot 7.225E-25 -> 8E-13 Underflow Subnormal Inexact Rounded +sqtx8404 squareroot 9.025E-25 -> 1.0E-12 Underflow Subnormal Inexact Rounded +sqtx8405 squareroot 1.1025E-24 -> 1.0E-12 Underflow Subnormal Inexact Rounded +sqtx8406 squareroot 1.3225E-24 -> 1.2E-12 Underflow Subnormal Inexact Rounded +sqtx8407 squareroot 1.5625E-24 -> 1.2E-12 Underflow Subnormal Inexact Rounded +sqtx8408 squareroot 1.8225E-24 -> 1.4E-12 Underflow Subnormal Inexact Rounded +sqtx8409 squareroot 2.1025E-24 -> 1.4E-12 Underflow Subnormal Inexact Rounded +sqtx8410 squareroot 2.4025E-24 -> 1.6E-12 Underflow Subnormal Inexact Rounded +sqtx8411 squareroot 2.7225E-24 -> 1.6E-12 Underflow Subnormal Inexact Rounded +sqtx8412 squareroot 3.0625E-24 -> 1.8E-12 Underflow Subnormal Inexact Rounded +sqtx8413 squareroot 3.4225E-24 -> 1.8E-12 Underflow Subnormal Inexact Rounded +sqtx8414 squareroot 3.8025E-24 -> 2.0E-12 Underflow Subnormal Inexact Rounded +sqtx8415 squareroot 4.2025E-24 -> 2.0E-12 Underflow Subnormal Inexact Rounded +sqtx8416 squareroot 4.6225E-24 -> 2.2E-12 Underflow Subnormal Inexact Rounded +sqtx8417 squareroot 5.0625E-24 -> 2.2E-12 Underflow Subnormal Inexact Rounded +sqtx8418 squareroot 5.5225E-24 -> 2.4E-12 Underflow Subnormal Inexact Rounded +sqtx8419 squareroot 6.0025E-24 -> 2.4E-12 Underflow Subnormal Inexact Rounded +sqtx8420 squareroot 6.5025E-24 -> 2.6E-12 Underflow Subnormal Inexact Rounded +sqtx8421 squareroot 7.0225E-24 -> 2.6E-12 Underflow Subnormal Inexact Rounded +sqtx8422 squareroot 7.5625E-24 -> 2.8E-12 Underflow Subnormal Inexact Rounded +sqtx8423 squareroot 8.1225E-24 -> 2.8E-12 Underflow Subnormal Inexact Rounded +sqtx8424 squareroot 8.7025E-24 -> 3.0E-12 Underflow Subnormal Inexact Rounded +sqtx8425 squareroot 9.3025E-24 -> 3.0E-12 Underflow Subnormal Inexact Rounded +sqtx8426 squareroot 9.9225E-24 -> 3.2E-12 Underflow Subnormal Inexact Rounded + +-- a random selection of values that Python2.5.1 rounds incorrectly +precision: 1 +sqtx8427 squareroot 227 -> 2E+1 Inexact Rounded +sqtx8428 squareroot 625 -> 2E+1 Inexact Rounded +sqtx8429 squareroot 1215 -> 3E+1 Inexact Rounded +sqtx8430 squareroot 2008 -> 4E+1 Inexact Rounded +sqtx8431 squareroot 2020 -> 4E+1 Inexact Rounded +sqtx8432 squareroot 2026 -> 5E+1 Inexact Rounded +sqtx8433 squareroot 2027 -> 5E+1 Inexact Rounded +sqtx8434 squareroot 2065 -> 5E+1 Inexact Rounded +sqtx8435 squareroot 2075 -> 5E+1 Inexact Rounded +sqtx8436 squareroot 2088 -> 5E+1 Inexact Rounded +sqtx8437 squareroot 3049 -> 6E+1 Inexact Rounded +sqtx8438 squareroot 3057 -> 6E+1 Inexact Rounded +sqtx8439 squareroot 3061 -> 6E+1 Inexact Rounded +sqtx8440 squareroot 3092 -> 6E+1 Inexact Rounded +sqtx8441 squareroot 4222 -> 6E+1 Inexact Rounded +sqtx8442 squareroot 5676 -> 8E+1 Inexact Rounded +sqtx8443 squareroot 5686 -> 8E+1 Inexact Rounded +sqtx8444 squareroot 7215 -> 8E+1 Inexact Rounded +sqtx8445 squareroot 9086 -> 1E+2 Inexact Rounded +sqtx8446 squareroot 9095 -> 1E+2 Inexact Rounded + +precision: 2 +sqtx8447 squareroot 1266 -> 36 Inexact Rounded +sqtx8448 squareroot 2552 -> 51 Inexact Rounded +sqtx8449 squareroot 5554 -> 75 Inexact Rounded +sqtx8450 squareroot 7832 -> 88 Inexact Rounded +sqtx8451 squareroot 13201 -> 1.1E+2 Inexact Rounded +sqtx8452 squareroot 15695 -> 1.3E+2 Inexact Rounded +sqtx8453 squareroot 18272 -> 1.4E+2 Inexact Rounded +sqtx8454 squareroot 21026 -> 1.5E+2 Inexact Rounded +sqtx8455 squareroot 24069 -> 1.6E+2 Inexact Rounded +sqtx8456 squareroot 34277 -> 1.9E+2 Inexact Rounded +sqtx8457 squareroot 46233 -> 2.2E+2 Inexact Rounded +sqtx8458 squareroot 46251 -> 2.2E+2 Inexact Rounded +sqtx8459 squareroot 46276 -> 2.2E+2 Inexact Rounded +sqtx8460 squareroot 70214 -> 2.6E+2 Inexact Rounded +sqtx8461 squareroot 81249 -> 2.9E+2 Inexact Rounded +sqtx8462 squareroot 81266 -> 2.9E+2 Inexact Rounded +sqtx8463 squareroot 93065 -> 3.1E+2 Inexact Rounded +sqtx8464 squareroot 93083 -> 3.1E+2 Inexact Rounded +sqtx8465 squareroot 99230 -> 3.2E+2 Inexact Rounded +sqtx8466 squareroot 99271 -> 3.2E+2 Inexact Rounded + +precision: 3 +sqtx8467 squareroot 11349 -> 107 Inexact Rounded +sqtx8468 squareroot 26738 -> 164 Inexact Rounded +sqtx8469 squareroot 31508 -> 178 Inexact Rounded +sqtx8470 squareroot 44734 -> 212 Inexact Rounded +sqtx8471 squareroot 44738 -> 212 Inexact Rounded +sqtx8472 squareroot 51307 -> 227 Inexact Rounded +sqtx8473 squareroot 62259 -> 250 Inexact Rounded +sqtx8474 squareroot 75901 -> 276 Inexact Rounded +sqtx8475 squareroot 76457 -> 277 Inexact Rounded +sqtx8476 squareroot 180287 -> 425 Inexact Rounded +sqtx8477 squareroot 202053 -> 450 Inexact Rounded +sqtx8478 squareroot 235747 -> 486 Inexact Rounded +sqtx8479 squareroot 256537 -> 506 Inexact Rounded +sqtx8480 squareroot 299772 -> 548 Inexact Rounded +sqtx8481 squareroot 415337 -> 644 Inexact Rounded +sqtx8482 squareroot 617067 -> 786 Inexact Rounded +sqtx8483 squareroot 628022 -> 792 Inexact Rounded +sqtx8484 squareroot 645629 -> 804 Inexact Rounded +sqtx8485 squareroot 785836 -> 886 Inexact Rounded +sqtx8486 squareroot 993066 -> 997 Inexact Rounded + +precision: 6 +sqtx8487 squareroot 14917781 -> 3862.35 Inexact Rounded +sqtx8488 squareroot 17237238 -> 4151.78 Inexact Rounded +sqtx8489 squareroot 18054463 -> 4249.05 Inexact Rounded +sqtx8490 squareroot 19990694 -> 4471.10 Inexact Rounded +sqtx8491 squareroot 29061855 -> 5390.90 Inexact Rounded +sqtx8492 squareroot 49166257 -> 7011.87 Inexact Rounded +sqtx8493 squareroot 53082086 -> 7285.75 Inexact Rounded +sqtx8494 squareroot 56787909 -> 7535.78 Inexact Rounded +sqtx8495 squareroot 81140019 -> 9007.78 Inexact Rounded +sqtx8496 squareroot 87977554 -> 9379.64 Inexact Rounded +sqtx8497 squareroot 93624683 -> 9675.98 Inexact Rounded +sqtx8498 squareroot 98732747 -> 9936.44 Inexact Rounded +sqtx8499 squareroot 99222813 -> 9961.06 Inexact Rounded +sqtx8500 squareroot 143883626 -> 11995.2 Inexact Rounded +sqtx8501 squareroot 180433301 -> 13432.5 Inexact Rounded +sqtx8502 squareroot 227034020 -> 15067.6 Inexact Rounded +sqtx8503 squareroot 283253992 -> 16830.2 Inexact Rounded +sqtx8504 squareroot 617047954 -> 24840.4 Inexact Rounded +sqtx8505 squareroot 736870094 -> 27145.4 Inexact Rounded +sqtx8506 squareroot 897322915 -> 29955.3 Inexact Rounded + +-- results close to minimum normal +precision: 1 +sqtx8507 squareroot 1E-20 -> 0E-9 Underflow Subnormal Inexact Rounded Clamped +sqtx8508 squareroot 1E-19 -> 0E-9 Underflow Subnormal Inexact Rounded Clamped +sqtx8509 squareroot 1E-18 -> 1E-9 + +precision: 2 +sqtx8510 squareroot 8.1E-19 -> 9E-10 Subnormal +sqtx8511 squareroot 8.10E-19 -> 9E-10 Subnormal Rounded +sqtx8512 squareroot 9.0E-19 -> 9E-10 Underflow Subnormal Inexact Rounded +sqtx8513 squareroot 9.02E-19 -> 9E-10 Underflow Subnormal Inexact Rounded +sqtx8514 squareroot 9.03E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8515 squareroot 9.1E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8516 squareroot 9.9E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8517 squareroot 9.91E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8518 squareroot 9.92E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8519 squareroot 9.95E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8520 squareroot 9.98E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8521 squareroot 9.99E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +sqtx8522 squareroot 1E-18 -> 1E-9 +sqtx8523 squareroot 1.0E-18 -> 1.0E-9 +sqtx8524 squareroot 1.00E-18 -> 1.0E-9 +sqtx8525 squareroot 1.000E-18 -> 1.0E-9 Rounded +sqtx8526 squareroot 1.0000E-18 -> 1.0E-9 Rounded +sqtx8527 squareroot 1.01E-18 -> 1.0E-9 Inexact Rounded +sqtx8528 squareroot 1.02E-18 -> 1.0E-9 Inexact Rounded +sqtx8529 squareroot 1.1E-18 -> 1.0E-9 Inexact Rounded + +precision: 3 +sqtx8530 squareroot 8.1E-19 -> 9E-10 Subnormal +sqtx8531 squareroot 8.10E-19 -> 9.0E-10 Subnormal +sqtx8532 squareroot 8.100E-19 -> 9.0E-10 Subnormal +sqtx8533 squareroot 8.1000E-19 -> 9.0E-10 Subnormal Rounded +sqtx8534 squareroot 9.9E-19 -> 9.9E-10 Underflow Subnormal Inexact Rounded +sqtx8535 squareroot 9.91E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded +sqtx8536 squareroot 9.99E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded +sqtx8537 squareroot 9.998E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded +sqtx8538 squareroot 1E-18 -> 1E-9 +sqtx8539 squareroot 1.0E-18 -> 1.0E-9 +sqtx8540 squareroot 1.00E-18 -> 1.0E-9 +sqtx8541 squareroot 1.000E-18 -> 1.00E-9 +sqtx8542 squareroot 1.0000E-18 -> 1.00E-9 +sqtx8543 squareroot 1.00000E-18 -> 1.00E-9 Rounded +sqtx8544 squareroot 1.000000E-18 -> 1.00E-9 Rounded +sqtx8545 squareroot 1.01E-18 -> 1.00E-9 Inexact Rounded +sqtx8546 squareroot 1.02E-18 -> 1.01E-9 Inexact Rounded + +-- result exactly representable with precision p, but not necessarily +-- exactly representable as a subnormal; check the correct flags are raised +precision: 2 +sqtx8547 squareroot 1.21E-20 -> 1E-10 Underflow Subnormal Inexact Rounded +sqtx8548 squareroot 1.44E-20 -> 1E-10 Underflow Subnormal Inexact Rounded +sqtx8549 squareroot 9.61E-20 -> 3E-10 Underflow Subnormal Inexact Rounded +sqtx8550 squareroot 8.836E-19 -> 9E-10 Underflow Subnormal Inexact Rounded +sqtx8551 squareroot 9.216E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded + +precision: 3 +sqtx8552 squareroot 1.21E-22 -> 1E-11 Underflow Subnormal Inexact Rounded +sqtx8553 squareroot 1.21E-20 -> 1.1E-10 Subnormal +sqtx8554 squareroot 1.96E-22 -> 1E-11 Underflow Subnormal Inexact Rounded +sqtx8555 squareroot 1.96E-20 -> 1.4E-10 Subnormal +sqtx8556 squareroot 2.56E-22 -> 2E-11 Underflow Subnormal Inexact Rounded +sqtx8557 squareroot 4.00E-22 -> 2E-11 Subnormal Rounded +sqtx8558 squareroot 7.84E-22 -> 3E-11 Underflow Subnormal Inexact Rounded +sqtx8559 squareroot 9.801E-21 -> 1.0E-10 Underflow Subnormal Inexact Rounded +sqtx8560 squareroot 9.801E-19 -> 9.9E-10 Subnormal +sqtx8561 squareroot 1.0201E-20 -> 1.0E-10 Underflow Subnormal Inexact Rounded +sqtx8562 squareroot 1.1025E-20 -> 1.0E-10 Underflow Subnormal Inexact Rounded +sqtx8563 squareroot 1.1236E-20 -> 1.1E-10 Underflow Subnormal Inexact Rounded +sqtx8564 squareroot 1.2996E-20 -> 1.1E-10 Underflow Subnormal Inexact Rounded +sqtx8565 squareroot 1.3225E-20 -> 1.2E-10 Underflow Subnormal Inexact Rounded + +-- A selection of subnormal results prone to double rounding errors +precision: 2 +sqtx8566 squareroot 2.3E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped +sqtx8567 squareroot 2.4E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped +sqtx8568 squareroot 2.5E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped +sqtx8569 squareroot 2.6E-21 -> 1E-10 Underflow Subnormal Inexact Rounded +sqtx8570 squareroot 2.7E-21 -> 1E-10 Underflow Subnormal Inexact Rounded +sqtx8571 squareroot 2.8E-21 -> 1E-10 Underflow Subnormal Inexact Rounded +sqtx8572 squareroot 2.2E-20 -> 1E-10 Underflow Subnormal Inexact Rounded +sqtx8573 squareroot 2.3E-20 -> 2E-10 Underflow Subnormal Inexact Rounded +sqtx8574 squareroot 2.4E-20 -> 2E-10 Underflow Subnormal Inexact Rounded +sqtx8575 squareroot 6.2E-20 -> 2E-10 Underflow Subnormal Inexact Rounded +sqtx8576 squareroot 6.3E-20 -> 3E-10 Underflow Subnormal Inexact Rounded +sqtx8577 squareroot 6.4E-20 -> 3E-10 Underflow Subnormal Inexact Rounded +sqtx8578 squareroot 6.5E-20 -> 3E-10 Underflow Subnormal Inexact Rounded +sqtx8579 squareroot 1.2E-19 -> 3E-10 Underflow Subnormal Inexact Rounded +sqtx8580 squareroot 2.0E-19 -> 4E-10 Underflow Subnormal Inexact Rounded +sqtx8581 squareroot 4.2E-19 -> 6E-10 Underflow Subnormal Inexact Rounded +sqtx8582 squareroot 5.6E-19 -> 7E-10 Underflow Subnormal Inexact Rounded +sqtx8583 squareroot 5.7E-19 -> 8E-10 Underflow Subnormal Inexact Rounded +sqtx8584 squareroot 9.0E-19 -> 9E-10 Underflow Subnormal Inexact Rounded +sqtx8585 squareroot 9.1E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded +precision: 3 +sqtx8586 squareroot 2.6E-23 -> 1E-11 Underflow Subnormal Inexact Rounded +sqtx8587 squareroot 2.22E-22 -> 1E-11 Underflow Subnormal Inexact Rounded +sqtx8588 squareroot 6.07E-22 -> 2E-11 Underflow Subnormal Inexact Rounded +sqtx8589 squareroot 6.25E-22 -> 2E-11 Underflow Subnormal Inexact Rounded +sqtx8590 squareroot 6.45E-22 -> 3E-11 Underflow Subnormal Inexact Rounded +sqtx8591 squareroot 6.50E-22 -> 3E-11 Underflow Subnormal Inexact Rounded +sqtx8592 squareroot 1.22E-21 -> 3E-11 Underflow Subnormal Inexact Rounded +sqtx8593 squareroot 1.24E-21 -> 4E-11 Underflow Subnormal Inexact Rounded +sqtx8594 squareroot 4.18E-21 -> 6E-11 Underflow Subnormal Inexact Rounded +sqtx8595 squareroot 7.19E-21 -> 8E-11 Underflow Subnormal Inexact Rounded +sqtx8596 squareroot 8.94E-21 -> 9E-11 Underflow Subnormal Inexact Rounded +sqtx8597 squareroot 1.81E-20 -> 1.3E-10 Underflow Subnormal Inexact Rounded +sqtx8598 squareroot 4.64E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded +sqtx8599 squareroot 5.06E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded +sqtx8600 squareroot 5.08E-20 -> 2.3E-10 Underflow Subnormal Inexact Rounded +sqtx8601 squareroot 7.00E-20 -> 2.6E-10 Underflow Subnormal Inexact Rounded +sqtx8602 squareroot 1.81E-19 -> 4.3E-10 Underflow Subnormal Inexact Rounded +sqtx8603 squareroot 6.64E-19 -> 8.1E-10 Underflow Subnormal Inexact Rounded +sqtx8604 squareroot 7.48E-19 -> 8.6E-10 Underflow Subnormal Inexact Rounded +sqtx8605 squareroot 9.91E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded +precision: 4 +sqtx8606 squareroot 6.24E-24 -> 2E-12 Underflow Subnormal Inexact Rounded +sqtx8607 squareroot 7.162E-23 -> 8E-12 Underflow Subnormal Inexact Rounded +sqtx8608 squareroot 7.243E-23 -> 9E-12 Underflow Subnormal Inexact Rounded +sqtx8609 squareroot 8.961E-23 -> 9E-12 Underflow Subnormal Inexact Rounded +sqtx8610 squareroot 9.029E-23 -> 1.0E-11 Underflow Subnormal Inexact Rounded +sqtx8611 squareroot 4.624E-22 -> 2.2E-11 Underflow Subnormal Inexact Rounded +sqtx8612 squareroot 5.980E-22 -> 2.4E-11 Underflow Subnormal Inexact Rounded +sqtx8613 squareroot 6.507E-22 -> 2.6E-11 Underflow Subnormal Inexact Rounded +sqtx8614 squareroot 1.483E-21 -> 3.9E-11 Underflow Subnormal Inexact Rounded +sqtx8615 squareroot 3.903E-21 -> 6.2E-11 Underflow Subnormal Inexact Rounded +sqtx8616 squareroot 8.733E-21 -> 9.3E-11 Underflow Subnormal Inexact Rounded +sqtx8617 squareroot 1.781E-20 -> 1.33E-10 Underflow Subnormal Inexact Rounded +sqtx8618 squareroot 6.426E-20 -> 2.53E-10 Underflow Subnormal Inexact Rounded +sqtx8619 squareroot 7.102E-20 -> 2.66E-10 Underflow Subnormal Inexact Rounded +sqtx8620 squareroot 7.535E-20 -> 2.74E-10 Underflow Subnormal Inexact Rounded +sqtx8621 squareroot 9.892E-20 -> 3.15E-10 Underflow Subnormal Inexact Rounded +sqtx8622 squareroot 1.612E-19 -> 4.01E-10 Underflow Subnormal Inexact Rounded +sqtx8623 squareroot 1.726E-19 -> 4.15E-10 Underflow Subnormal Inexact Rounded +sqtx8624 squareroot 1.853E-19 -> 4.30E-10 Underflow Subnormal Inexact Rounded +sqtx8625 squareroot 4.245E-19 -> 6.52E-10 Underflow Subnormal Inexact Rounded + +-- clamping and overflow for large exponents +precision: 1 +sqtx8626 squareroot 1E+18 -> 1E+9 +sqtx8627 squareroot 1E+19 -> 3E+9 Inexact Rounded +-- in this next one, intermediate result is 9486832980.505137996... +-- so rounds down to 9 (not up to 10 which would cause Infinity overflow) +sqtx8628 squareroot 9E+19 -> 9E+9 Inexact Rounded +sqtx8629 squareroot 9.1E+19 -> Infinity Overflow Inexact Rounded +sqtx8630 squareroot 1E+20 -> Infinity Overflow Inexact Rounded + +precision: 2 +sqtx8631 squareroot 1E+18 -> 1E+9 +sqtx8632 squareroot 1.0E+18 -> 1.0E+9 +sqtx8633 squareroot 1.00E+18 -> 1.0E+9 +sqtx8634 squareroot 1.000E+18 -> 1.0E+9 Rounded +sqtx8635 squareroot 1E+20 -> Infinity Overflow Inexact Rounded +clamp: 1 +sqtx8636 squareroot 1E+18 -> 1.0E+9 Clamped +sqtx8637 squareroot 1.0E+18 -> 1.0E+9 +sqtx8638 squareroot 1E+20 -> Infinity Overflow Inexact Rounded +clamp: 0 + +precision: 6 +sqtx8639 squareroot 1E+18 -> 1E+9 +sqtx8640 squareroot 1.0000000000E+18 -> 1.00000E+9 +sqtx8641 squareroot 1.00000000000E+18 -> 1.00000E+9 Rounded +sqtx8642 squareroot 1E+20 -> Infinity Overflow Inexact Rounded +clamp: 1 +sqtx8643 squareroot 1E+8 -> 1E+4 +sqtx8644 squareroot 1E+10 -> 1.0E+5 Clamped +sqtx8645 squareroot 1.0E+10 -> 1.0E+5 +sqtx8646 squareroot 1E+12 -> 1.00E+6 Clamped +sqtx8647 squareroot 1.0E+12 -> 1.00E+6 Clamped +sqtx8648 squareroot 1.00E+12 -> 1.00E+6 Clamped +sqtx8649 squareroot 1.000E+12 -> 1.00E+6 +sqtx8650 squareroot 1E+18 -> 1.00000E+9 Clamped +sqtx8651 squareroot 1.00000000E+18 -> 1.00000E+9 Clamped +sqtx8652 squareroot 1.000000000E+18 -> 1.00000E+9 +sqtx8653 squareroot 1E+20 -> Infinity Overflow Inexact Rounded +clamp: 0 + +-- The following example causes a TypeError in Python 2.5.1 +precision: 3 +maxexponent: 9 +minexponent: -9 +sqtx8654 squareroot 10000000000 -> 1.00E+5 Rounded + +-- Additional tricky cases of underflown subnormals +rounding: half_even +precision: 5 +maxexponent: 999 +minexponent: -999 +sqtx8700 squareroot 2.8073E-2000 -> 1.675E-1000 Underflow Subnormal Inexact Rounded +sqtx8701 squareroot 2.8883E-2000 -> 1.699E-1000 Underflow Subnormal Inexact Rounded +sqtx8702 squareroot 3.1524E-2000 -> 1.775E-1000 Underflow Subnormal Inexact Rounded +sqtx8703 squareroot 3.2382E-2000 -> 1.799E-1000 Underflow Subnormal Inexact Rounded +sqtx8704 squareroot 3.5175E-2000 -> 1.875E-1000 Underflow Subnormal Inexact Rounded +sqtx8705 squareroot 3.6081E-2000 -> 1.899E-1000 Underflow Subnormal Inexact Rounded +sqtx8706 squareroot 3.9026E-2000 -> 1.975E-1000 Underflow Subnormal Inexact Rounded +sqtx8707 squareroot 3.9980E-2000 -> 1.999E-1000 Underflow Subnormal Inexact Rounded +sqtx8708 squareroot 4.3077E-2000 -> 2.075E-1000 Underflow Subnormal Inexact Rounded +sqtx8709 squareroot 4.4079E-2000 -> 2.099E-1000 Underflow Subnormal Inexact Rounded +sqtx8710 squareroot 4.7328E-2000 -> 2.175E-1000 Underflow Subnormal Inexact Rounded +sqtx8711 squareroot 4.8378E-2000 -> 2.199E-1000 Underflow Subnormal Inexact Rounded +sqtx8712 squareroot 5.1779E-2000 -> 2.275E-1000 Underflow Subnormal Inexact Rounded +sqtx8713 squareroot 5.2877E-2000 -> 2.299E-1000 Underflow Subnormal Inexact Rounded +sqtx8714 squareroot 5.6430E-2000 -> 2.375E-1000 Underflow Subnormal Inexact Rounded +sqtx8715 squareroot 5.7576E-2000 -> 2.399E-1000 Underflow Subnormal Inexact Rounded +sqtx8716 squareroot 6.1281E-2000 -> 2.475E-1000 Underflow Subnormal Inexact Rounded +sqtx8717 squareroot 6.2475E-2000 -> 2.499E-1000 Underflow Subnormal Inexact Rounded +sqtx8718 squareroot 6.6332E-2000 -> 2.575E-1000 Underflow Subnormal Inexact Rounded +sqtx8719 squareroot 6.7574E-2000 -> 2.599E-1000 Underflow Subnormal Inexact Rounded +sqtx8720 squareroot 7.1583E-2000 -> 2.675E-1000 Underflow Subnormal Inexact Rounded +sqtx8721 squareroot 7.2873E-2000 -> 2.699E-1000 Underflow Subnormal Inexact Rounded +sqtx8722 squareroot 7.7034E-2000 -> 2.775E-1000 Underflow Subnormal Inexact Rounded +sqtx8723 squareroot 7.8372E-2000 -> 2.799E-1000 Underflow Subnormal Inexact Rounded +sqtx8724 squareroot 8.2685E-2000 -> 2.875E-1000 Underflow Subnormal Inexact Rounded +sqtx8725 squareroot 8.4071E-2000 -> 2.899E-1000 Underflow Subnormal Inexact Rounded +sqtx8726 squareroot 8.8536E-2000 -> 2.975E-1000 Underflow Subnormal Inexact Rounded +sqtx8727 squareroot 8.9970E-2000 -> 2.999E-1000 Underflow Subnormal Inexact Rounded +sqtx8728 squareroot 9.4587E-2000 -> 3.075E-1000 Underflow Subnormal Inexact Rounded +sqtx8729 squareroot 9.6069E-2000 -> 3.099E-1000 Underflow Subnormal Inexact Rounded +-- (End of Mark Dickinson's testcases.) + + +-- Some additional edge cases +maxexponent: 9 +minexponent: -9 +precision: 2 +sqtx9000 squareroot 9980.01 -> 1.0E+2 Inexact Rounded +precision: 3 +sqtx9001 squareroot 9980.01 -> 99.9 +precision: 4 +sqtx9002 squareroot 9980.01 -> 99.9 + +-- Exact from over-precise +precision: 4 +sqtx9003 squareroot 11025 -> 105 +precision: 3 +sqtx9004 squareroot 11025 -> 105 +precision: 2 +sqtx9005 squareroot 11025 -> 1.0E+2 Inexact Rounded +precision: 1 +sqtx9006 squareroot 11025 -> 1E+2 Inexact Rounded + +-- an interesting case +precision: 7 +sqtx9007 squareroot 1600000e1 -> 4000 + +-- Out-of-bounds zeros +precision: 4 +sqtx9010 squareroot 0E-9 -> 0.00000 +sqtx9011 squareroot 0E-10 -> 0.00000 +sqtx9012 squareroot 0E-11 -> 0.000000 +sqtx9013 squareroot 0E-12 -> 0.000000 +sqtx9014 squareroot 0E-13 -> 0E-7 +sqtx9015 squareroot 0E-14 -> 0E-7 +sqtx9020 squareroot 0E-17 -> 0E-9 +sqtx9021 squareroot 0E-20 -> 0E-10 +sqtx9022 squareroot 0E-22 -> 0E-11 +sqtx9023 squareroot 0E-24 -> 0E-12 +sqtx9024 squareroot 0E-25 -> 0E-12 Clamped +sqtx9025 squareroot 0E-26 -> 0E-12 Clamped +sqtx9026 squareroot 0E-27 -> 0E-12 Clamped +sqtx9027 squareroot 0E-28 -> 0E-12 Clamped + +sqtx9030 squareroot 0E+8 -> 0E+4 +sqtx9031 squareroot 0E+10 -> 0E+5 +sqtx9032 squareroot 0E+12 -> 0E+6 +sqtx9033 squareroot 0E+14 -> 0E+7 +sqtx9034 squareroot 0E+15 -> 0E+7 +sqtx9035 squareroot 0E+16 -> 0E+8 +sqtx9036 squareroot 0E+18 -> 0E+9 +sqtx9037 squareroot 0E+19 -> 0E+9 +sqtx9038 squareroot 0E+20 -> 0E+9 Clamped +sqtx9039 squareroot 0E+21 -> 0E+9 Clamped +sqtx9040 squareroot 0E+22 -> 0E+9 Clamped + +-- if digits > emax maximum real exponent is negative +maxexponent: 9 +minexponent: -9 +precision: 15 +clamp: 1 +sqtx9045 squareroot 1 -> 1.00000 Clamped + +-- High-precision exact and inexact +maxexponent: 999 +minexponent: -999 +precision: 400 +sqtx9050 squareroot 2 -> 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641572735013846230912297024924836055850737212644121497099935831413222665927505592755799950501152782060571470109559971605970274534596862014728517418640889198609552329230484308714321450839762603627995251407989687253396546331808829640620615258352395054745750287759961729835575220337531857011354374603408498847 Inexact Rounded +sqtx9051 squareroot 1089 -> 33 +sqtx9052 squareroot 10.89 -> 3.3 + +-- Null test +sqtx9900 squareroot # -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/subtract.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/subtract.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,873 @@ +------------------------------------------------------------------------ +-- subtract.decTest -- decimal subtraction -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- [first group are 'quick confidence check'] +subx001 subtract 0 0 -> '0' +subx002 subtract 1 1 -> '0' +subx003 subtract 1 2 -> '-1' +subx004 subtract 2 1 -> '1' +subx005 subtract 2 2 -> '0' +subx006 subtract 3 2 -> '1' +subx007 subtract 2 3 -> '-1' + +subx011 subtract -0 0 -> '-0' +subx012 subtract -1 1 -> '-2' +subx013 subtract -1 2 -> '-3' +subx014 subtract -2 1 -> '-3' +subx015 subtract -2 2 -> '-4' +subx016 subtract -3 2 -> '-5' +subx017 subtract -2 3 -> '-5' + +subx021 subtract 0 -0 -> '0' +subx022 subtract 1 -1 -> '2' +subx023 subtract 1 -2 -> '3' +subx024 subtract 2 -1 -> '3' +subx025 subtract 2 -2 -> '4' +subx026 subtract 3 -2 -> '5' +subx027 subtract 2 -3 -> '5' + +subx030 subtract 11 1 -> 10 +subx031 subtract 10 1 -> 9 +subx032 subtract 9 1 -> 8 +subx033 subtract 1 1 -> 0 +subx034 subtract 0 1 -> -1 +subx035 subtract -1 1 -> -2 +subx036 subtract -9 1 -> -10 +subx037 subtract -10 1 -> -11 +subx038 subtract -11 1 -> -12 + +subx040 subtract '5.75' '3.3' -> '2.45' +subx041 subtract '5' '-3' -> '8' +subx042 subtract '-5' '-3' -> '-2' +subx043 subtract '-7' '2.5' -> '-9.5' +subx044 subtract '0.7' '0.3' -> '0.4' +subx045 subtract '1.3' '0.3' -> '1.0' +subx046 subtract '1.25' '1.25' -> '0.00' + +subx050 subtract '1.23456789' '1.00000000' -> '0.23456789' +subx051 subtract '1.23456789' '1.00000089' -> '0.23456700' +subx052 subtract '0.5555555559' '0.0000000001' -> '0.555555556' Inexact Rounded +subx053 subtract '0.5555555559' '0.0000000005' -> '0.555555555' Inexact Rounded +subx054 subtract '0.4444444444' '0.1111111111' -> '0.333333333' Inexact Rounded +subx055 subtract '1.0000000000' '0.00000001' -> '0.999999990' Rounded +subx056 subtract '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +subx057 subtract '0.4444444445000' '0' -> '0.444444445' Inexact Rounded + +subx060 subtract '70' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx061 subtract '700' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx062 subtract '7000' '10000e+9' -> '-9.99999999E+12' Inexact Rounded +subx063 subtract '70000' '10000e+9' -> '-9.99999993E+12' Rounded +subx064 subtract '700000' '10000e+9' -> '-9.99999930E+12' Rounded + -- symmetry: +subx065 subtract '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +subx066 subtract '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +subx067 subtract '10000e+9' '7000' -> '9.99999999E+12' Inexact Rounded +subx068 subtract '10000e+9' '70000' -> '9.99999993E+12' Rounded +subx069 subtract '10000e+9' '700000' -> '9.99999930E+12' Rounded + + -- change precision +subx080 subtract '10000e+9' '70000' -> '9.99999993E+12' Rounded +precision: 6 +subx081 subtract '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +precision: 9 + + -- some of the next group are really constructor tests +subx090 subtract '00.0' '0.0' -> '0.0' +subx091 subtract '00.0' '0.00' -> '0.00' +subx092 subtract '0.00' '00.0' -> '0.00' +subx093 subtract '00.0' '0.00' -> '0.00' +subx094 subtract '0.00' '00.0' -> '0.00' +subx095 subtract '3' '.3' -> '2.7' +subx096 subtract '3.' '.3' -> '2.7' +subx097 subtract '3.0' '.3' -> '2.7' +subx098 subtract '3.00' '.3' -> '2.70' +subx099 subtract '3' '3' -> '0' +subx100 subtract '3' '+3' -> '0' +subx101 subtract '3' '-3' -> '6' +subx102 subtract '3' '0.3' -> '2.7' +subx103 subtract '3.' '0.3' -> '2.7' +subx104 subtract '3.0' '0.3' -> '2.7' +subx105 subtract '3.00' '0.3' -> '2.70' +subx106 subtract '3' '3.0' -> '0.0' +subx107 subtract '3' '+3.0' -> '0.0' +subx108 subtract '3' '-3.0' -> '6.0' + +-- the above all from add; massaged and extended. Now some new ones... +-- [particularly important for comparisons] +-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7 +-- with input rounding. +subx120 subtract '10.23456784' '10.23456789' -> '-5E-8' +subx121 subtract '10.23456785' '10.23456789' -> '-4E-8' +subx122 subtract '10.23456786' '10.23456789' -> '-3E-8' +subx123 subtract '10.23456787' '10.23456789' -> '-2E-8' +subx124 subtract '10.23456788' '10.23456789' -> '-1E-8' +subx125 subtract '10.23456789' '10.23456789' -> '0E-8' +subx126 subtract '10.23456790' '10.23456789' -> '1E-8' +subx127 subtract '10.23456791' '10.23456789' -> '2E-8' +subx128 subtract '10.23456792' '10.23456789' -> '3E-8' +subx129 subtract '10.23456793' '10.23456789' -> '4E-8' +subx130 subtract '10.23456794' '10.23456789' -> '5E-8' +subx131 subtract '10.23456781' '10.23456786' -> '-5E-8' +subx132 subtract '10.23456782' '10.23456786' -> '-4E-8' +subx133 subtract '10.23456783' '10.23456786' -> '-3E-8' +subx134 subtract '10.23456784' '10.23456786' -> '-2E-8' +subx135 subtract '10.23456785' '10.23456786' -> '-1E-8' +subx136 subtract '10.23456786' '10.23456786' -> '0E-8' +subx137 subtract '10.23456787' '10.23456786' -> '1E-8' +subx138 subtract '10.23456788' '10.23456786' -> '2E-8' +subx139 subtract '10.23456789' '10.23456786' -> '3E-8' +subx140 subtract '10.23456790' '10.23456786' -> '4E-8' +subx141 subtract '10.23456791' '10.23456786' -> '5E-8' +subx142 subtract '1' '0.999999999' -> '1E-9' +subx143 subtract '0.999999999' '1' -> '-1E-9' +subx144 subtract '-10.23456780' '-10.23456786' -> '6E-8' +subx145 subtract '-10.23456790' '-10.23456786' -> '-4E-8' +subx146 subtract '-10.23456791' '-10.23456786' -> '-5E-8' + +precision: 3 +subx150 subtract '12345678900000' '9999999999999' -> 2.35E+12 Inexact Rounded +subx151 subtract '9999999999999' '12345678900000' -> -2.35E+12 Inexact Rounded +precision: 6 +subx152 subtract '12345678900000' '9999999999999' -> 2.34568E+12 Inexact Rounded +subx153 subtract '9999999999999' '12345678900000' -> -2.34568E+12 Inexact Rounded +precision: 9 +subx154 subtract '12345678900000' '9999999999999' -> 2.34567890E+12 Inexact Rounded +subx155 subtract '9999999999999' '12345678900000' -> -2.34567890E+12 Inexact Rounded +precision: 12 +subx156 subtract '12345678900000' '9999999999999' -> 2.34567890000E+12 Inexact Rounded +subx157 subtract '9999999999999' '12345678900000' -> -2.34567890000E+12 Inexact Rounded +precision: 15 +subx158 subtract '12345678900000' '9999999999999' -> 2345678900001 +subx159 subtract '9999999999999' '12345678900000' -> -2345678900001 +precision: 9 + +-- additional scaled arithmetic tests [0.97 problem] +subx160 subtract '0' '.1' -> '-0.1' +subx161 subtract '00' '.97983' -> '-0.97983' +subx162 subtract '0' '.9' -> '-0.9' +subx163 subtract '0' '0.102' -> '-0.102' +subx164 subtract '0' '.4' -> '-0.4' +subx165 subtract '0' '.307' -> '-0.307' +subx166 subtract '0' '.43822' -> '-0.43822' +subx167 subtract '0' '.911' -> '-0.911' +subx168 subtract '.0' '.02' -> '-0.02' +subx169 subtract '00' '.392' -> '-0.392' +subx170 subtract '0' '.26' -> '-0.26' +subx171 subtract '0' '0.51' -> '-0.51' +subx172 subtract '0' '.2234' -> '-0.2234' +subx173 subtract '0' '.2' -> '-0.2' +subx174 subtract '.0' '.0008' -> '-0.0008' +-- 0. on left +subx180 subtract '0.0' '-.1' -> '0.1' +subx181 subtract '0.00' '-.97983' -> '0.97983' +subx182 subtract '0.0' '-.9' -> '0.9' +subx183 subtract '0.0' '-0.102' -> '0.102' +subx184 subtract '0.0' '-.4' -> '0.4' +subx185 subtract '0.0' '-.307' -> '0.307' +subx186 subtract '0.0' '-.43822' -> '0.43822' +subx187 subtract '0.0' '-.911' -> '0.911' +subx188 subtract '0.0' '-.02' -> '0.02' +subx189 subtract '0.00' '-.392' -> '0.392' +subx190 subtract '0.0' '-.26' -> '0.26' +subx191 subtract '0.0' '-0.51' -> '0.51' +subx192 subtract '0.0' '-.2234' -> '0.2234' +subx193 subtract '0.0' '-.2' -> '0.2' +subx194 subtract '0.0' '-.0008' -> '0.0008' +-- negatives of same +subx200 subtract '0' '-.1' -> '0.1' +subx201 subtract '00' '-.97983' -> '0.97983' +subx202 subtract '0' '-.9' -> '0.9' +subx203 subtract '0' '-0.102' -> '0.102' +subx204 subtract '0' '-.4' -> '0.4' +subx205 subtract '0' '-.307' -> '0.307' +subx206 subtract '0' '-.43822' -> '0.43822' +subx207 subtract '0' '-.911' -> '0.911' +subx208 subtract '.0' '-.02' -> '0.02' +subx209 subtract '00' '-.392' -> '0.392' +subx210 subtract '0' '-.26' -> '0.26' +subx211 subtract '0' '-0.51' -> '0.51' +subx212 subtract '0' '-.2234' -> '0.2234' +subx213 subtract '0' '-.2' -> '0.2' +subx214 subtract '.0' '-.0008' -> '0.0008' + +-- more fixed, LHS swaps [really the same as testcases under add] +subx220 subtract '-56267E-12' 0 -> '-5.6267E-8' +subx221 subtract '-56267E-11' 0 -> '-5.6267E-7' +subx222 subtract '-56267E-10' 0 -> '-0.0000056267' +subx223 subtract '-56267E-9' 0 -> '-0.000056267' +subx224 subtract '-56267E-8' 0 -> '-0.00056267' +subx225 subtract '-56267E-7' 0 -> '-0.0056267' +subx226 subtract '-56267E-6' 0 -> '-0.056267' +subx227 subtract '-56267E-5' 0 -> '-0.56267' +subx228 subtract '-56267E-2' 0 -> '-562.67' +subx229 subtract '-56267E-1' 0 -> '-5626.7' +subx230 subtract '-56267E-0' 0 -> '-56267' +-- symmetry ... +subx240 subtract 0 '-56267E-12' -> '5.6267E-8' +subx241 subtract 0 '-56267E-11' -> '5.6267E-7' +subx242 subtract 0 '-56267E-10' -> '0.0000056267' +subx243 subtract 0 '-56267E-9' -> '0.000056267' +subx244 subtract 0 '-56267E-8' -> '0.00056267' +subx245 subtract 0 '-56267E-7' -> '0.0056267' +subx246 subtract 0 '-56267E-6' -> '0.056267' +subx247 subtract 0 '-56267E-5' -> '0.56267' +subx248 subtract 0 '-56267E-2' -> '562.67' +subx249 subtract 0 '-56267E-1' -> '5626.7' +subx250 subtract 0 '-56267E-0' -> '56267' + +-- now some more from the 'new' add +precision: 9 +subx301 subtract '1.23456789' '1.00000000' -> '0.23456789' +subx302 subtract '1.23456789' '1.00000011' -> '0.23456778' + +subx311 subtract '0.4444444444' '0.5555555555' -> '-0.111111111' Inexact Rounded +subx312 subtract '0.4444444440' '0.5555555555' -> '-0.111111112' Inexact Rounded +subx313 subtract '0.4444444444' '0.5555555550' -> '-0.111111111' Inexact Rounded +subx314 subtract '0.44444444449' '0' -> '0.444444444' Inexact Rounded +subx315 subtract '0.444444444499' '0' -> '0.444444444' Inexact Rounded +subx316 subtract '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +subx317 subtract '0.4444444445000' '0' -> '0.444444445' Inexact Rounded +subx318 subtract '0.4444444445001' '0' -> '0.444444445' Inexact Rounded +subx319 subtract '0.444444444501' '0' -> '0.444444445' Inexact Rounded +subx320 subtract '0.44444444451' '0' -> '0.444444445' Inexact Rounded + +-- some carrying effects +subx321 subtract '0.9998' '0.0000' -> '0.9998' +subx322 subtract '0.9998' '0.0001' -> '0.9997' +subx323 subtract '0.9998' '0.0002' -> '0.9996' +subx324 subtract '0.9998' '0.0003' -> '0.9995' +subx325 subtract '0.9998' '-0.0000' -> '0.9998' +subx326 subtract '0.9998' '-0.0001' -> '0.9999' +subx327 subtract '0.9998' '-0.0002' -> '1.0000' +subx328 subtract '0.9998' '-0.0003' -> '1.0001' + +subx330 subtract '70' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx331 subtract '700' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx332 subtract '7000' '10000e+9' -> '-9.99999999E+12' Inexact Rounded +subx333 subtract '70000' '10000e+9' -> '-9.99999993E+12' Rounded +subx334 subtract '700000' '10000e+9' -> '-9.99999930E+12' Rounded +subx335 subtract '7000000' '10000e+9' -> '-9.99999300E+12' Rounded +-- symmetry: +subx340 subtract '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +subx341 subtract '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +subx342 subtract '10000e+9' '7000' -> '9.99999999E+12' Inexact Rounded +subx343 subtract '10000e+9' '70000' -> '9.99999993E+12' Rounded +subx344 subtract '10000e+9' '700000' -> '9.99999930E+12' Rounded +subx345 subtract '10000e+9' '7000000' -> '9.99999300E+12' Rounded + +-- same, higher precision +precision: 15 +subx346 subtract '10000e+9' '7' -> '9999999999993' +subx347 subtract '10000e+9' '70' -> '9999999999930' +subx348 subtract '10000e+9' '700' -> '9999999999300' +subx349 subtract '10000e+9' '7000' -> '9999999993000' +subx350 subtract '10000e+9' '70000' -> '9999999930000' +subx351 subtract '10000e+9' '700000' -> '9999999300000' +subx352 subtract '7' '10000e+9' -> '-9999999999993' +subx353 subtract '70' '10000e+9' -> '-9999999999930' +subx354 subtract '700' '10000e+9' -> '-9999999999300' +subx355 subtract '7000' '10000e+9' -> '-9999999993000' +subx356 subtract '70000' '10000e+9' -> '-9999999930000' +subx357 subtract '700000' '10000e+9' -> '-9999999300000' + +-- zero preservation +precision: 6 +subx360 subtract '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +subx361 subtract 1 '0.0001' -> '0.9999' +subx362 subtract 1 '0.00001' -> '0.99999' +subx363 subtract 1 '0.000001' -> '0.999999' +subx364 subtract 1 '0.0000001' -> '1.00000' Inexact Rounded +subx365 subtract 1 '0.00000001' -> '1.00000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +subx370 subtract 1 0 -> 1 +subx371 subtract 1 0. -> 1 +subx372 subtract 1 .0 -> 1.0 +subx373 subtract 1 0.0 -> 1.0 +subx374 subtract 0 1 -> -1 +subx375 subtract 0. 1 -> -1 +subx376 subtract .0 1 -> -1.0 +subx377 subtract 0.0 1 -> -1.0 + +precision: 9 + +-- leading 0 digit before round +subx910 subtract -103519362 -51897955.3 -> -51621406.7 +subx911 subtract 159579.444 89827.5229 -> 69751.9211 + +subx920 subtract 333.123456 33.1234566 -> 299.999999 Inexact Rounded +subx921 subtract 333.123456 33.1234565 -> 300.000000 Inexact Rounded +subx922 subtract 133.123456 33.1234565 -> 99.9999995 +subx923 subtract 133.123456 33.1234564 -> 99.9999996 +subx924 subtract 133.123456 33.1234540 -> 100.000002 Rounded +subx925 subtract 133.123456 43.1234560 -> 90.0000000 +subx926 subtract 133.123456 43.1234561 -> 89.9999999 +subx927 subtract 133.123456 43.1234566 -> 89.9999994 +subx928 subtract 101.123456 91.1234566 -> 9.9999994 +subx929 subtract 101.123456 99.1234566 -> 1.9999994 + +-- more of the same; probe for cluster boundary problems +precision: 1 +subx930 subtract 11 2 -> 9 +precision: 2 +subx932 subtract 101 2 -> 99 +precision: 3 +subx934 subtract 101 2.1 -> 98.9 +subx935 subtract 101 92.01 -> 8.99 +precision: 4 +subx936 subtract 101 2.01 -> 98.99 +subx937 subtract 101 92.01 -> 8.99 +subx938 subtract 101 92.006 -> 8.994 +precision: 5 +subx939 subtract 101 2.001 -> 98.999 +subx940 subtract 101 92.001 -> 8.999 +subx941 subtract 101 92.0006 -> 8.9994 +precision: 6 +subx942 subtract 101 2.0001 -> 98.9999 +subx943 subtract 101 92.0001 -> 8.9999 +subx944 subtract 101 92.00006 -> 8.99994 +precision: 7 +subx945 subtract 101 2.00001 -> 98.99999 +subx946 subtract 101 92.00001 -> 8.99999 +subx947 subtract 101 92.000006 -> 8.999994 +precision: 8 +subx948 subtract 101 2.000001 -> 98.999999 +subx949 subtract 101 92.000001 -> 8.999999 +subx950 subtract 101 92.0000006 -> 8.9999994 +precision: 9 +subx951 subtract 101 2.0000001 -> 98.9999999 +subx952 subtract 101 92.0000001 -> 8.9999999 +subx953 subtract 101 92.00000006 -> 8.99999994 + +precision: 9 + +-- more LHS swaps [were fixed] +subx390 subtract '-56267E-10' 0 -> '-0.0000056267' +subx391 subtract '-56267E-6' 0 -> '-0.056267' +subx392 subtract '-56267E-5' 0 -> '-0.56267' +subx393 subtract '-56267E-4' 0 -> '-5.6267' +subx394 subtract '-56267E-3' 0 -> '-56.267' +subx395 subtract '-56267E-2' 0 -> '-562.67' +subx396 subtract '-56267E-1' 0 -> '-5626.7' +subx397 subtract '-56267E-0' 0 -> '-56267' +subx398 subtract '-5E-10' 0 -> '-5E-10' +subx399 subtract '-5E-7' 0 -> '-5E-7' +subx400 subtract '-5E-6' 0 -> '-0.000005' +subx401 subtract '-5E-5' 0 -> '-0.00005' +subx402 subtract '-5E-4' 0 -> '-0.0005' +subx403 subtract '-5E-1' 0 -> '-0.5' +subx404 subtract '-5E0' 0 -> '-5' +subx405 subtract '-5E1' 0 -> '-50' +subx406 subtract '-5E5' 0 -> '-500000' +subx407 subtract '-5E8' 0 -> '-500000000' +subx408 subtract '-5E9' 0 -> '-5.00000000E+9' Rounded +subx409 subtract '-5E10' 0 -> '-5.00000000E+10' Rounded +subx410 subtract '-5E11' 0 -> '-5.00000000E+11' Rounded +subx411 subtract '-5E100' 0 -> '-5.00000000E+100' Rounded + +-- more RHS swaps [were fixed] +subx420 subtract 0 '-56267E-10' -> '0.0000056267' +subx421 subtract 0 '-56267E-6' -> '0.056267' +subx422 subtract 0 '-56267E-5' -> '0.56267' +subx423 subtract 0 '-56267E-4' -> '5.6267' +subx424 subtract 0 '-56267E-3' -> '56.267' +subx425 subtract 0 '-56267E-2' -> '562.67' +subx426 subtract 0 '-56267E-1' -> '5626.7' +subx427 subtract 0 '-56267E-0' -> '56267' +subx428 subtract 0 '-5E-10' -> '5E-10' +subx429 subtract 0 '-5E-7' -> '5E-7' +subx430 subtract 0 '-5E-6' -> '0.000005' +subx431 subtract 0 '-5E-5' -> '0.00005' +subx432 subtract 0 '-5E-4' -> '0.0005' +subx433 subtract 0 '-5E-1' -> '0.5' +subx434 subtract 0 '-5E0' -> '5' +subx435 subtract 0 '-5E1' -> '50' +subx436 subtract 0 '-5E5' -> '500000' +subx437 subtract 0 '-5E8' -> '500000000' +subx438 subtract 0 '-5E9' -> '5.00000000E+9' Rounded +subx439 subtract 0 '-5E10' -> '5.00000000E+10' Rounded +subx440 subtract 0 '-5E11' -> '5.00000000E+11' Rounded +subx441 subtract 0 '-5E100' -> '5.00000000E+100' Rounded + + +-- try borderline precision, with carries, etc. +precision: 15 +subx461 subtract '1E+12' '1' -> '999999999999' +subx462 subtract '1E+12' '-1.11' -> '1000000000001.11' +subx463 subtract '1.11' '-1E+12' -> '1000000000001.11' +subx464 subtract '-1' '-1E+12' -> '999999999999' +subx465 subtract '7E+12' '1' -> '6999999999999' +subx466 subtract '7E+12' '-1.11' -> '7000000000001.11' +subx467 subtract '1.11' '-7E+12' -> '7000000000001.11' +subx468 subtract '-1' '-7E+12' -> '6999999999999' + +-- 123456789012345 123456789012345 1 23456789012345 +subx470 subtract '0.444444444444444' '-0.555555555555563' -> '1.00000000000001' Inexact Rounded +subx471 subtract '0.444444444444444' '-0.555555555555562' -> '1.00000000000001' Inexact Rounded +subx472 subtract '0.444444444444444' '-0.555555555555561' -> '1.00000000000001' Inexact Rounded +subx473 subtract '0.444444444444444' '-0.555555555555560' -> '1.00000000000000' Inexact Rounded +subx474 subtract '0.444444444444444' '-0.555555555555559' -> '1.00000000000000' Inexact Rounded +subx475 subtract '0.444444444444444' '-0.555555555555558' -> '1.00000000000000' Inexact Rounded +subx476 subtract '0.444444444444444' '-0.555555555555557' -> '1.00000000000000' Inexact Rounded +subx477 subtract '0.444444444444444' '-0.555555555555556' -> '1.00000000000000' Rounded +subx478 subtract '0.444444444444444' '-0.555555555555555' -> '0.999999999999999' +subx479 subtract '0.444444444444444' '-0.555555555555554' -> '0.999999999999998' +subx480 subtract '0.444444444444444' '-0.555555555555553' -> '0.999999999999997' +subx481 subtract '0.444444444444444' '-0.555555555555552' -> '0.999999999999996' +subx482 subtract '0.444444444444444' '-0.555555555555551' -> '0.999999999999995' +subx483 subtract '0.444444444444444' '-0.555555555555550' -> '0.999999999999994' + +-- and some more, including residue effects and different roundings +precision: 9 +rounding: half_up +subx500 subtract '123456789' 0 -> '123456789' +subx501 subtract '123456789' 0.000000001 -> '123456789' Inexact Rounded +subx502 subtract '123456789' 0.000001 -> '123456789' Inexact Rounded +subx503 subtract '123456789' 0.1 -> '123456789' Inexact Rounded +subx504 subtract '123456789' 0.4 -> '123456789' Inexact Rounded +subx505 subtract '123456789' 0.49 -> '123456789' Inexact Rounded +subx506 subtract '123456789' 0.499999 -> '123456789' Inexact Rounded +subx507 subtract '123456789' 0.499999999 -> '123456789' Inexact Rounded +subx508 subtract '123456789' 0.5 -> '123456789' Inexact Rounded +subx509 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded +subx510 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded +subx511 subtract '123456789' 0.51 -> '123456788' Inexact Rounded +subx512 subtract '123456789' 0.6 -> '123456788' Inexact Rounded +subx513 subtract '123456789' 0.9 -> '123456788' Inexact Rounded +subx514 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded +subx515 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded +subx516 subtract '123456789' 1 -> '123456788' +subx517 subtract '123456789' 1.000000001 -> '123456788' Inexact Rounded +subx518 subtract '123456789' 1.00001 -> '123456788' Inexact Rounded +subx519 subtract '123456789' 1.1 -> '123456788' Inexact Rounded + +rounding: half_even +subx520 subtract '123456789' 0 -> '123456789' +subx521 subtract '123456789' 0.000000001 -> '123456789' Inexact Rounded +subx522 subtract '123456789' 0.000001 -> '123456789' Inexact Rounded +subx523 subtract '123456789' 0.1 -> '123456789' Inexact Rounded +subx524 subtract '123456789' 0.4 -> '123456789' Inexact Rounded +subx525 subtract '123456789' 0.49 -> '123456789' Inexact Rounded +subx526 subtract '123456789' 0.499999 -> '123456789' Inexact Rounded +subx527 subtract '123456789' 0.499999999 -> '123456789' Inexact Rounded +subx528 subtract '123456789' 0.5 -> '123456788' Inexact Rounded +subx529 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded +subx530 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded +subx531 subtract '123456789' 0.51 -> '123456788' Inexact Rounded +subx532 subtract '123456789' 0.6 -> '123456788' Inexact Rounded +subx533 subtract '123456789' 0.9 -> '123456788' Inexact Rounded +subx534 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded +subx535 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded +subx536 subtract '123456789' 1 -> '123456788' +subx537 subtract '123456789' 1.00000001 -> '123456788' Inexact Rounded +subx538 subtract '123456789' 1.00001 -> '123456788' Inexact Rounded +subx539 subtract '123456789' 1.1 -> '123456788' Inexact Rounded +-- critical few with even bottom digit... +subx540 subtract '123456788' 0.499999999 -> '123456788' Inexact Rounded +subx541 subtract '123456788' 0.5 -> '123456788' Inexact Rounded +subx542 subtract '123456788' 0.500000001 -> '123456787' Inexact Rounded + +rounding: down +subx550 subtract '123456789' 0 -> '123456789' +subx551 subtract '123456789' 0.000000001 -> '123456788' Inexact Rounded +subx552 subtract '123456789' 0.000001 -> '123456788' Inexact Rounded +subx553 subtract '123456789' 0.1 -> '123456788' Inexact Rounded +subx554 subtract '123456789' 0.4 -> '123456788' Inexact Rounded +subx555 subtract '123456789' 0.49 -> '123456788' Inexact Rounded +subx556 subtract '123456789' 0.499999 -> '123456788' Inexact Rounded +subx557 subtract '123456789' 0.499999999 -> '123456788' Inexact Rounded +subx558 subtract '123456789' 0.5 -> '123456788' Inexact Rounded +subx559 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded +subx560 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded +subx561 subtract '123456789' 0.51 -> '123456788' Inexact Rounded +subx562 subtract '123456789' 0.6 -> '123456788' Inexact Rounded +subx563 subtract '123456789' 0.9 -> '123456788' Inexact Rounded +subx564 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded +subx565 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded +subx566 subtract '123456789' 1 -> '123456788' +subx567 subtract '123456789' 1.00000001 -> '123456787' Inexact Rounded +subx568 subtract '123456789' 1.00001 -> '123456787' Inexact Rounded +subx569 subtract '123456789' 1.1 -> '123456787' Inexact Rounded + +-- symmetry... +rounding: half_up +subx600 subtract 0 '123456789' -> '-123456789' +subx601 subtract 0.000000001 '123456789' -> '-123456789' Inexact Rounded +subx602 subtract 0.000001 '123456789' -> '-123456789' Inexact Rounded +subx603 subtract 0.1 '123456789' -> '-123456789' Inexact Rounded +subx604 subtract 0.4 '123456789' -> '-123456789' Inexact Rounded +subx605 subtract 0.49 '123456789' -> '-123456789' Inexact Rounded +subx606 subtract 0.499999 '123456789' -> '-123456789' Inexact Rounded +subx607 subtract 0.499999999 '123456789' -> '-123456789' Inexact Rounded +subx608 subtract 0.5 '123456789' -> '-123456789' Inexact Rounded +subx609 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded +subx610 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded +subx611 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded +subx612 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded +subx613 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded +subx614 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded +subx615 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded +subx616 subtract 1 '123456789' -> '-123456788' +subx617 subtract 1.000000001 '123456789' -> '-123456788' Inexact Rounded +subx618 subtract 1.00001 '123456789' -> '-123456788' Inexact Rounded +subx619 subtract 1.1 '123456789' -> '-123456788' Inexact Rounded + +rounding: half_even +subx620 subtract 0 '123456789' -> '-123456789' +subx621 subtract 0.000000001 '123456789' -> '-123456789' Inexact Rounded +subx622 subtract 0.000001 '123456789' -> '-123456789' Inexact Rounded +subx623 subtract 0.1 '123456789' -> '-123456789' Inexact Rounded +subx624 subtract 0.4 '123456789' -> '-123456789' Inexact Rounded +subx625 subtract 0.49 '123456789' -> '-123456789' Inexact Rounded +subx626 subtract 0.499999 '123456789' -> '-123456789' Inexact Rounded +subx627 subtract 0.499999999 '123456789' -> '-123456789' Inexact Rounded +subx628 subtract 0.5 '123456789' -> '-123456788' Inexact Rounded +subx629 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded +subx630 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded +subx631 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded +subx632 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded +subx633 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded +subx634 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded +subx635 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded +subx636 subtract 1 '123456789' -> '-123456788' +subx637 subtract 1.00000001 '123456789' -> '-123456788' Inexact Rounded +subx638 subtract 1.00001 '123456789' -> '-123456788' Inexact Rounded +subx639 subtract 1.1 '123456789' -> '-123456788' Inexact Rounded +-- critical few with even bottom digit... +subx640 subtract 0.499999999 '123456788' -> '-123456788' Inexact Rounded +subx641 subtract 0.5 '123456788' -> '-123456788' Inexact Rounded +subx642 subtract 0.500000001 '123456788' -> '-123456787' Inexact Rounded + +rounding: down +subx650 subtract 0 '123456789' -> '-123456789' +subx651 subtract 0.000000001 '123456789' -> '-123456788' Inexact Rounded +subx652 subtract 0.000001 '123456789' -> '-123456788' Inexact Rounded +subx653 subtract 0.1 '123456789' -> '-123456788' Inexact Rounded +subx654 subtract 0.4 '123456789' -> '-123456788' Inexact Rounded +subx655 subtract 0.49 '123456789' -> '-123456788' Inexact Rounded +subx656 subtract 0.499999 '123456789' -> '-123456788' Inexact Rounded +subx657 subtract 0.499999999 '123456789' -> '-123456788' Inexact Rounded +subx658 subtract 0.5 '123456789' -> '-123456788' Inexact Rounded +subx659 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded +subx660 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded +subx661 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded +subx662 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded +subx663 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded +subx664 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded +subx665 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded +subx666 subtract 1 '123456789' -> '-123456788' +subx667 subtract 1.00000001 '123456789' -> '-123456787' Inexact Rounded +subx668 subtract 1.00001 '123456789' -> '-123456787' Inexact Rounded +subx669 subtract 1.1 '123456789' -> '-123456787' Inexact Rounded + + +-- lots of leading zeros in intermediate result, and showing effects of +-- input rounding would have affected the following +precision: 9 +rounding: half_up +subx670 subtract '123456789' '123456788.1' -> 0.9 +subx671 subtract '123456789' '123456788.9' -> 0.1 +subx672 subtract '123456789' '123456789.1' -> -0.1 +subx673 subtract '123456789' '123456789.5' -> -0.5 +subx674 subtract '123456789' '123456789.9' -> -0.9 + +rounding: half_even +subx680 subtract '123456789' '123456788.1' -> 0.9 +subx681 subtract '123456789' '123456788.9' -> 0.1 +subx682 subtract '123456789' '123456789.1' -> -0.1 +subx683 subtract '123456789' '123456789.5' -> -0.5 +subx684 subtract '123456789' '123456789.9' -> -0.9 + +subx685 subtract '123456788' '123456787.1' -> 0.9 +subx686 subtract '123456788' '123456787.9' -> 0.1 +subx687 subtract '123456788' '123456788.1' -> -0.1 +subx688 subtract '123456788' '123456788.5' -> -0.5 +subx689 subtract '123456788' '123456788.9' -> -0.9 + +rounding: down +subx690 subtract '123456789' '123456788.1' -> 0.9 +subx691 subtract '123456789' '123456788.9' -> 0.1 +subx692 subtract '123456789' '123456789.1' -> -0.1 +subx693 subtract '123456789' '123456789.5' -> -0.5 +subx694 subtract '123456789' '123456789.9' -> -0.9 + +-- input preparation tests +rounding: half_up +precision: 3 + +subx700 subtract '12345678900000' -9999999999999 -> '2.23E+13' Inexact Rounded +subx701 subtract '9999999999999' -12345678900000 -> '2.23E+13' Inexact Rounded +subx702 subtract '12E+3' '-3456' -> '1.55E+4' Inexact Rounded +subx703 subtract '12E+3' '-3446' -> '1.54E+4' Inexact Rounded +subx704 subtract '12E+3' '-3454' -> '1.55E+4' Inexact Rounded +subx705 subtract '12E+3' '-3444' -> '1.54E+4' Inexact Rounded + +subx706 subtract '3456' '-12E+3' -> '1.55E+4' Inexact Rounded +subx707 subtract '3446' '-12E+3' -> '1.54E+4' Inexact Rounded +subx708 subtract '3454' '-12E+3' -> '1.55E+4' Inexact Rounded +subx709 subtract '3444' '-12E+3' -> '1.54E+4' Inexact Rounded + +-- overflow and underflow tests [subnormals now possible] +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +rounding: down +subx710 subtract 1E+999999999 -9E+999999999 -> 9.99999999E+999999999 Overflow Inexact Rounded +subx711 subtract 9E+999999999 -1E+999999999 -> 9.99999999E+999999999 Overflow Inexact Rounded +rounding: half_up +subx712 subtract 1E+999999999 -9E+999999999 -> Infinity Overflow Inexact Rounded +subx713 subtract 9E+999999999 -1E+999999999 -> Infinity Overflow Inexact Rounded +subx714 subtract -1.1E-999999999 -1E-999999999 -> -1E-1000000000 Subnormal +subx715 subtract 1E-999999999 +1.1e-999999999 -> -1E-1000000000 Subnormal +subx716 subtract -1E+999999999 +9E+999999999 -> -Infinity Overflow Inexact Rounded +subx717 subtract -9E+999999999 +1E+999999999 -> -Infinity Overflow Inexact Rounded +subx718 subtract +1.1E-999999999 +1E-999999999 -> 1E-1000000000 Subnormal +subx719 subtract -1E-999999999 -1.1e-999999999 -> 1E-1000000000 Subnormal + +precision: 3 +subx720 subtract 1 9.999E+999999999 -> -Infinity Inexact Overflow Rounded +subx721 subtract 1 -9.999E+999999999 -> Infinity Inexact Overflow Rounded +subx722 subtract 9.999E+999999999 1 -> Infinity Inexact Overflow Rounded +subx723 subtract -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded +subx724 subtract 1 9.999E+999999999 -> -Infinity Inexact Overflow Rounded +subx725 subtract 1 -9.999E+999999999 -> Infinity Inexact Overflow Rounded +subx726 subtract 9.999E+999999999 1 -> Infinity Inexact Overflow Rounded +subx727 subtract -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded + +-- [more below] + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +sub731 subtract 12345678000 0 -> 1.23456780E+10 Rounded +sub732 subtract 0 12345678000 -> -1.23456780E+10 Rounded +sub733 subtract 1234567800 0 -> 1.23456780E+9 Rounded +sub734 subtract 0 1234567800 -> -1.23456780E+9 Rounded +sub735 subtract 1234567890 0 -> 1.23456789E+9 Rounded +sub736 subtract 0 1234567890 -> -1.23456789E+9 Rounded +sub737 subtract 1234567891 0 -> 1.23456789E+9 Inexact Rounded +sub738 subtract 0 1234567891 -> -1.23456789E+9 Inexact Rounded +sub739 subtract 12345678901 0 -> 1.23456789E+10 Inexact Rounded +sub740 subtract 0 12345678901 -> -1.23456789E+10 Inexact Rounded +sub741 subtract 1234567896 0 -> 1.23456790E+9 Inexact Rounded +sub742 subtract 0 1234567896 -> -1.23456790E+9 Inexact Rounded + +precision: 15 +sub751 subtract 12345678000 0 -> 12345678000 +sub752 subtract 0 12345678000 -> -12345678000 +sub753 subtract 1234567800 0 -> 1234567800 +sub754 subtract 0 1234567800 -> -1234567800 +sub755 subtract 1234567890 0 -> 1234567890 +sub756 subtract 0 1234567890 -> -1234567890 +sub757 subtract 1234567891 0 -> 1234567891 +sub758 subtract 0 1234567891 -> -1234567891 +sub759 subtract 12345678901 0 -> 12345678901 +sub760 subtract 0 12345678901 -> -12345678901 +sub761 subtract 1234567896 0 -> 1234567896 +sub762 subtract 0 1234567896 -> -1234567896 + +-- Specials +subx780 subtract -Inf Inf -> -Infinity +subx781 subtract -Inf 1000 -> -Infinity +subx782 subtract -Inf 1 -> -Infinity +subx783 subtract -Inf -0 -> -Infinity +subx784 subtract -Inf -1 -> -Infinity +subx785 subtract -Inf -1000 -> -Infinity +subx787 subtract -1000 Inf -> -Infinity +subx788 subtract -Inf Inf -> -Infinity +subx789 subtract -1 Inf -> -Infinity +subx790 subtract 0 Inf -> -Infinity +subx791 subtract 1 Inf -> -Infinity +subx792 subtract 1000 Inf -> -Infinity + +subx800 subtract Inf Inf -> NaN Invalid_operation +subx801 subtract Inf 1000 -> Infinity +subx802 subtract Inf 1 -> Infinity +subx803 subtract Inf 0 -> Infinity +subx804 subtract Inf -0 -> Infinity +subx805 subtract Inf -1 -> Infinity +subx806 subtract Inf -1000 -> Infinity +subx807 subtract Inf -Inf -> Infinity +subx808 subtract -1000 -Inf -> Infinity +subx809 subtract -Inf -Inf -> NaN Invalid_operation +subx810 subtract -1 -Inf -> Infinity +subx811 subtract -0 -Inf -> Infinity +subx812 subtract 0 -Inf -> Infinity +subx813 subtract 1 -Inf -> Infinity +subx814 subtract 1000 -Inf -> Infinity +subx815 subtract Inf -Inf -> Infinity + +subx821 subtract NaN Inf -> NaN +subx822 subtract -NaN 1000 -> -NaN +subx823 subtract NaN 1 -> NaN +subx824 subtract NaN 0 -> NaN +subx825 subtract NaN -0 -> NaN +subx826 subtract NaN -1 -> NaN +subx827 subtract NaN -1000 -> NaN +subx828 subtract NaN -Inf -> NaN +subx829 subtract -NaN NaN -> -NaN +subx830 subtract -Inf NaN -> NaN +subx831 subtract -1000 NaN -> NaN +subx832 subtract -1 NaN -> NaN +subx833 subtract -0 NaN -> NaN +subx834 subtract 0 NaN -> NaN +subx835 subtract 1 NaN -> NaN +subx836 subtract 1000 -NaN -> -NaN +subx837 subtract Inf NaN -> NaN + +subx841 subtract sNaN Inf -> NaN Invalid_operation +subx842 subtract -sNaN 1000 -> -NaN Invalid_operation +subx843 subtract sNaN 1 -> NaN Invalid_operation +subx844 subtract sNaN 0 -> NaN Invalid_operation +subx845 subtract sNaN -0 -> NaN Invalid_operation +subx846 subtract sNaN -1 -> NaN Invalid_operation +subx847 subtract sNaN -1000 -> NaN Invalid_operation +subx848 subtract sNaN NaN -> NaN Invalid_operation +subx849 subtract sNaN sNaN -> NaN Invalid_operation +subx850 subtract NaN sNaN -> NaN Invalid_operation +subx851 subtract -Inf -sNaN -> -NaN Invalid_operation +subx852 subtract -1000 sNaN -> NaN Invalid_operation +subx853 subtract -1 sNaN -> NaN Invalid_operation +subx854 subtract -0 sNaN -> NaN Invalid_operation +subx855 subtract 0 sNaN -> NaN Invalid_operation +subx856 subtract 1 sNaN -> NaN Invalid_operation +subx857 subtract 1000 sNaN -> NaN Invalid_operation +subx858 subtract Inf sNaN -> NaN Invalid_operation +subx859 subtract NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +subx861 subtract NaN01 -Inf -> NaN1 +subx862 subtract -NaN02 -1000 -> -NaN2 +subx863 subtract NaN03 1000 -> NaN3 +subx864 subtract NaN04 Inf -> NaN4 +subx865 subtract NaN05 NaN61 -> NaN5 +subx866 subtract -Inf -NaN71 -> -NaN71 +subx867 subtract -1000 NaN81 -> NaN81 +subx868 subtract 1000 NaN91 -> NaN91 +subx869 subtract Inf NaN101 -> NaN101 +subx871 subtract sNaN011 -Inf -> NaN11 Invalid_operation +subx872 subtract sNaN012 -1000 -> NaN12 Invalid_operation +subx873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation +subx874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation +subx875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation +subx876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation +subx877 subtract -Inf sNaN201 -> NaN201 Invalid_operation +subx878 subtract -1000 sNaN211 -> NaN211 Invalid_operation +subx879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation +subx880 subtract Inf sNaN231 -> NaN231 Invalid_operation +subx881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation + +-- edge case spills +subx901 subtract 2.E-3 1.002 -> -1.000 +subx902 subtract 2.0E-3 1.002 -> -1.0000 +subx903 subtract 2.00E-3 1.0020 -> -1.00000 +subx904 subtract 2.000E-3 1.00200 -> -1.000000 +subx905 subtract 2.0000E-3 1.002000 -> -1.0000000 +subx906 subtract 2.00000E-3 1.0020000 -> -1.00000000 +subx907 subtract 2.000000E-3 1.00200000 -> -1.000000000 +subx908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000 + +-- subnormals and underflows +precision: 3 +maxexponent: 999 +minexponent: -999 +subx1010 subtract 0 1.00E-999 -> -1.00E-999 +subx1011 subtract 0 0.1E-999 -> -1E-1000 Subnormal +subx1012 subtract 0 0.10E-999 -> -1.0E-1000 Subnormal +subx1013 subtract 0 0.100E-999 -> -1.0E-1000 Subnormal Rounded +subx1014 subtract 0 0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +subx1015 subtract 0 0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow +subx1016 subtract 0 0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +subx1017 subtract 0 0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +subx1018 subtract 0 0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1019 subtract 0 0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1020 subtract 0 0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +subx1030 subtract 0 -1.00E-999 -> 1.00E-999 +subx1031 subtract 0 -0.1E-999 -> 1E-1000 Subnormal +subx1032 subtract 0 -0.10E-999 -> 1.0E-1000 Subnormal +subx1033 subtract 0 -0.100E-999 -> 1.0E-1000 Subnormal Rounded +subx1034 subtract 0 -0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +subx1035 subtract 0 -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +subx1036 subtract 0 -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +subx1037 subtract 0 -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +subx1038 subtract 0 -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1039 subtract 0 -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1040 subtract 0 -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- some non-zero subnormal subtracts +-- subx1056 is a tricky case +rounding: half_up +subx1050 subtract 1.00E-999 0.1E-999 -> 9.0E-1000 Subnormal +subx1051 subtract 0.1E-999 0.1E-999 -> 0E-1000 +subx1052 subtract 0.10E-999 0.1E-999 -> 0E-1001 +subx1053 subtract 0.100E-999 0.1E-999 -> 0E-1001 Clamped +subx1054 subtract 0.01E-999 0.1E-999 -> -9E-1001 Subnormal +subx1055 subtract 0.999E-999 0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow +subx1056 subtract 0.099E-999 0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1057 subtract 0.009E-999 0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow +subx1058 subtract 0.001E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +subx1059 subtract 0.0009E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +subx1060 subtract 0.0001E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow + + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +subx1101 subtract 0 1.52444E-80 -> -1.524E-80 Inexact Rounded Subnormal Underflow +subx1102 subtract 0 1.52445E-80 -> -1.524E-80 Inexact Rounded Subnormal Underflow +subx1103 subtract 0 1.52446E-80 -> -1.524E-80 Inexact Rounded Subnormal Underflow +subx1104 subtract 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +subx1105 subtract 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +subx1106 subtract 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +subx1111 subtract 1.2345678E-80 1.2345671E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1112 subtract 1.2345678E-80 1.2345618E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1113 subtract 1.2345678E-80 1.2345178E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1114 subtract 1.2345678E-80 1.2341678E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1115 subtract 1.2345678E-80 1.2315678E-80 -> 3E-83 Rounded Subnormal +subx1116 subtract 1.2345678E-80 1.2145678E-80 -> 2.0E-82 Rounded Subnormal +subx1117 subtract 1.2345678E-80 1.1345678E-80 -> 1.00E-81 Rounded Subnormal +subx1118 subtract 1.2345678E-80 0.2345678E-80 -> 1.000E-80 Rounded Subnormal + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Examples from SQL proposal (Krishna Kulkarni) +subx1125 subtract 130E-2 120E-2 -> 0.10 +subx1126 subtract 130E-2 12E-1 -> 0.10 +subx1127 subtract 130E-2 1E0 -> 0.30 +subx1128 subtract 1E2 1E4 -> -9.9E+3 + +-- Null tests +subx9990 subtract 10 # -> NaN Invalid_operation +subx9991 subtract # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/testall.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/testall.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,87 @@ +------------------------------------------------------------------------ +-- testall.decTest -- run all general decimal arithmetic testcases -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- core tests (using Extended: 1) -------------------------------------- +dectest: base + +dectest: abs +dectest: add +dectest: and +dectest: clamp +dectest: class +dectest: compare +dectest: comparesig +dectest: comparetotal +dectest: comparetotmag +dectest: copy +dectest: copyabs +dectest: copynegate +dectest: copysign +dectest: divide +dectest: divideint +dectest: exp +dectest: fma +dectest: inexact +dectest: invert +dectest: ln +dectest: logb +dectest: log10 +dectest: max +dectest: maxmag +dectest: min +dectest: minmag +dectest: minus +dectest: multiply +dectest: nextminus +dectest: nextplus +dectest: nexttoward +dectest: or +dectest: plus +dectest: power +dectest: powersqrt +dectest: quantize +dectest: randoms +dectest: reduce -- [was called normalize] +dectest: remainder +dectest: remaindernear +dectest: rescale -- [obsolete] +dectest: rotate +dectest: rounding +dectest: samequantum +dectest: scaleb +dectest: shift +dectest: squareroot +dectest: subtract +dectest: tointegral +dectest: tointegralx +dectest: trim +dectest: xor + +-- The next are for the Strawman 4d concrete representations and +-- tests at those sizes [including dsEncode, ddEncode, and dqEncode, +-- which replace decimal32, decimal64, and decimal128] +dectest: decSingle +dectest: decDouble +dectest: decQuad + +-- General 31->33-digit boundary tests +dectest: randombound32 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/tointegral.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/tointegral.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,241 @@ +------------------------------------------------------------------------ +-- tointegral.decTest -- round decimal to integral value -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests tests the extended specification 'round-to-integral +-- value' operation (from IEEE 854, later modified in 754r). +-- All non-zero results are defined as being those from either copy or +-- quantize, so those are assumed to have been tested. +-- Note that 754r requires that Inexact not be set, and we similarly +-- assume Rounded is not set. + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +intx001 tointegral 0 -> 0 +intx002 tointegral 0.0 -> 0 +intx003 tointegral 0.1 -> 0 +intx004 tointegral 0.2 -> 0 +intx005 tointegral 0.3 -> 0 +intx006 tointegral 0.4 -> 0 +intx007 tointegral 0.5 -> 1 +intx008 tointegral 0.6 -> 1 +intx009 tointegral 0.7 -> 1 +intx010 tointegral 0.8 -> 1 +intx011 tointegral 0.9 -> 1 +intx012 tointegral 1 -> 1 +intx013 tointegral 1.0 -> 1 +intx014 tointegral 1.1 -> 1 +intx015 tointegral 1.2 -> 1 +intx016 tointegral 1.3 -> 1 +intx017 tointegral 1.4 -> 1 +intx018 tointegral 1.5 -> 2 +intx019 tointegral 1.6 -> 2 +intx020 tointegral 1.7 -> 2 +intx021 tointegral 1.8 -> 2 +intx022 tointegral 1.9 -> 2 +-- negatives +intx031 tointegral -0 -> -0 +intx032 tointegral -0.0 -> -0 +intx033 tointegral -0.1 -> -0 +intx034 tointegral -0.2 -> -0 +intx035 tointegral -0.3 -> -0 +intx036 tointegral -0.4 -> -0 +intx037 tointegral -0.5 -> -1 +intx038 tointegral -0.6 -> -1 +intx039 tointegral -0.7 -> -1 +intx040 tointegral -0.8 -> -1 +intx041 tointegral -0.9 -> -1 +intx042 tointegral -1 -> -1 +intx043 tointegral -1.0 -> -1 +intx044 tointegral -1.1 -> -1 +intx045 tointegral -1.2 -> -1 +intx046 tointegral -1.3 -> -1 +intx047 tointegral -1.4 -> -1 +intx048 tointegral -1.5 -> -2 +intx049 tointegral -1.6 -> -2 +intx050 tointegral -1.7 -> -2 +intx051 tointegral -1.8 -> -2 +intx052 tointegral -1.9 -> -2 +-- next two would be NaN using quantize(x, 0) +intx053 tointegral 10E+30 -> 1.0E+31 +intx054 tointegral -10E+30 -> -1.0E+31 + +-- numbers around precision +precision: 9 +intx060 tointegral '56267E-10' -> '0' +intx061 tointegral '56267E-5' -> '1' +intx062 tointegral '56267E-2' -> '563' +intx063 tointegral '56267E-1' -> '5627' +intx065 tointegral '56267E-0' -> '56267' +intx066 tointegral '56267E+0' -> '56267' +intx067 tointegral '56267E+1' -> '5.6267E+5' +intx068 tointegral '56267E+2' -> '5.6267E+6' +intx069 tointegral '56267E+3' -> '5.6267E+7' +intx070 tointegral '56267E+4' -> '5.6267E+8' +intx071 tointegral '56267E+5' -> '5.6267E+9' +intx072 tointegral '56267E+6' -> '5.6267E+10' +intx073 tointegral '1.23E+96' -> '1.23E+96' +intx074 tointegral '1.23E+384' -> '1.23E+384' +intx075 tointegral '1.23E+999' -> '1.23E+999' + +intx080 tointegral '-56267E-10' -> '-0' +intx081 tointegral '-56267E-5' -> '-1' +intx082 tointegral '-56267E-2' -> '-563' +intx083 tointegral '-56267E-1' -> '-5627' +intx085 tointegral '-56267E-0' -> '-56267' +intx086 tointegral '-56267E+0' -> '-56267' +intx087 tointegral '-56267E+1' -> '-5.6267E+5' +intx088 tointegral '-56267E+2' -> '-5.6267E+6' +intx089 tointegral '-56267E+3' -> '-5.6267E+7' +intx090 tointegral '-56267E+4' -> '-5.6267E+8' +intx091 tointegral '-56267E+5' -> '-5.6267E+9' +intx092 tointegral '-56267E+6' -> '-5.6267E+10' +intx093 tointegral '-1.23E+96' -> '-1.23E+96' +intx094 tointegral '-1.23E+384' -> '-1.23E+384' +intx095 tointegral '-1.23E+999' -> '-1.23E+999' + +-- subnormal inputs +intx100 tointegral 1E-999 -> 0 +intx101 tointegral 0.1E-999 -> 0 +intx102 tointegral 0.01E-999 -> 0 +intx103 tointegral 0E-999 -> 0 + +-- specials and zeros +intx120 tointegral 'Inf' -> Infinity +intx121 tointegral '-Inf' -> -Infinity +intx122 tointegral NaN -> NaN +intx123 tointegral sNaN -> NaN Invalid_operation +intx124 tointegral 0 -> 0 +intx125 tointegral -0 -> -0 +intx126 tointegral 0.000 -> 0 +intx127 tointegral 0.00 -> 0 +intx128 tointegral 0.0 -> 0 +intx129 tointegral 0 -> 0 +intx130 tointegral 0E-3 -> 0 +intx131 tointegral 0E-2 -> 0 +intx132 tointegral 0E-1 -> 0 +intx133 tointegral 0E-0 -> 0 +intx134 tointegral 0E+1 -> 0E+1 +intx135 tointegral 0E+2 -> 0E+2 +intx136 tointegral 0E+3 -> 0E+3 +intx137 tointegral 0E+4 -> 0E+4 +intx138 tointegral 0E+5 -> 0E+5 +intx139 tointegral -0.000 -> -0 +intx140 tointegral -0.00 -> -0 +intx141 tointegral -0.0 -> -0 +intx142 tointegral -0 -> -0 +intx143 tointegral -0E-3 -> -0 +intx144 tointegral -0E-2 -> -0 +intx145 tointegral -0E-1 -> -0 +intx146 tointegral -0E-0 -> -0 +intx147 tointegral -0E+1 -> -0E+1 +intx148 tointegral -0E+2 -> -0E+2 +intx149 tointegral -0E+3 -> -0E+3 +intx150 tointegral -0E+4 -> -0E+4 +intx151 tointegral -0E+5 -> -0E+5 +-- propagating NaNs +intx152 tointegral NaN808 -> NaN808 +intx153 tointegral sNaN080 -> NaN80 Invalid_operation +intx154 tointegral -NaN808 -> -NaN808 +intx155 tointegral -sNaN080 -> -NaN80 Invalid_operation +intx156 tointegral -NaN -> -NaN +intx157 tointegral -sNaN -> -NaN Invalid_operation + +-- examples +rounding: half_up +precision: 9 +intx200 tointegral 2.1 -> 2 +intx201 tointegral 100 -> 100 +intx202 tointegral 100.0 -> 100 +intx203 tointegral 101.5 -> 102 +intx204 tointegral -101.5 -> -102 +intx205 tointegral 10E+5 -> 1.0E+6 +intx206 tointegral 7.89E+77 -> 7.89E+77 +intx207 tointegral -Inf -> -Infinity + + +-- all rounding modes +rounding: half_even + +intx210 tointegral 55.5 -> 56 +intx211 tointegral 56.5 -> 56 +intx212 tointegral 57.5 -> 58 +intx213 tointegral -55.5 -> -56 +intx214 tointegral -56.5 -> -56 +intx215 tointegral -57.5 -> -58 + +rounding: half_up + +intx220 tointegral 55.5 -> 56 +intx221 tointegral 56.5 -> 57 +intx222 tointegral 57.5 -> 58 +intx223 tointegral -55.5 -> -56 +intx224 tointegral -56.5 -> -57 +intx225 tointegral -57.5 -> -58 + +rounding: half_down + +intx230 tointegral 55.5 -> 55 +intx231 tointegral 56.5 -> 56 +intx232 tointegral 57.5 -> 57 +intx233 tointegral -55.5 -> -55 +intx234 tointegral -56.5 -> -56 +intx235 tointegral -57.5 -> -57 + +rounding: up + +intx240 tointegral 55.3 -> 56 +intx241 tointegral 56.3 -> 57 +intx242 tointegral 57.3 -> 58 +intx243 tointegral -55.3 -> -56 +intx244 tointegral -56.3 -> -57 +intx245 tointegral -57.3 -> -58 + +rounding: down + +intx250 tointegral 55.7 -> 55 +intx251 tointegral 56.7 -> 56 +intx252 tointegral 57.7 -> 57 +intx253 tointegral -55.7 -> -55 +intx254 tointegral -56.7 -> -56 +intx255 tointegral -57.7 -> -57 + +rounding: ceiling + +intx260 tointegral 55.3 -> 56 +intx261 tointegral 56.3 -> 57 +intx262 tointegral 57.3 -> 58 +intx263 tointegral -55.3 -> -55 +intx264 tointegral -56.3 -> -56 +intx265 tointegral -57.3 -> -57 + +rounding: floor + +intx270 tointegral 55.7 -> 55 +intx271 tointegral 56.7 -> 56 +intx272 tointegral 57.7 -> 57 +intx273 tointegral -55.7 -> -56 +intx274 tointegral -56.7 -> -57 +intx275 tointegral -57.7 -> -58 + Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/tointegralx.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/tointegralx.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,255 @@ +------------------------------------------------------------------------ +-- tointegralx.decTest -- round decimal to integral value, exact -- +-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +-- This set of tests tests the extended specification 'round-to-integral +-- value' operation (from IEEE 854, later modified in 754r). +-- All non-zero results are defined as being those from either copy or +-- quantize, so those are assumed to have been tested. + +-- This tests toIntegraExact, which may set Inexact + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +intxx001 tointegralx 0 -> 0 +intxx002 tointegralx 0.0 -> 0 +intxx003 tointegralx 0.1 -> 0 Inexact Rounded +intxx004 tointegralx 0.2 -> 0 Inexact Rounded +intxx005 tointegralx 0.3 -> 0 Inexact Rounded +intxx006 tointegralx 0.4 -> 0 Inexact Rounded +intxx007 tointegralx 0.5 -> 1 Inexact Rounded +intxx008 tointegralx 0.6 -> 1 Inexact Rounded +intxx009 tointegralx 0.7 -> 1 Inexact Rounded +intxx010 tointegralx 0.8 -> 1 Inexact Rounded +intxx011 tointegralx 0.9 -> 1 Inexact Rounded +intxx012 tointegralx 1 -> 1 +intxx013 tointegralx 1.0 -> 1 Rounded +intxx014 tointegralx 1.1 -> 1 Inexact Rounded +intxx015 tointegralx 1.2 -> 1 Inexact Rounded +intxx016 tointegralx 1.3 -> 1 Inexact Rounded +intxx017 tointegralx 1.4 -> 1 Inexact Rounded +intxx018 tointegralx 1.5 -> 2 Inexact Rounded +intxx019 tointegralx 1.6 -> 2 Inexact Rounded +intxx020 tointegralx 1.7 -> 2 Inexact Rounded +intxx021 tointegralx 1.8 -> 2 Inexact Rounded +intxx022 tointegralx 1.9 -> 2 Inexact Rounded +-- negatives +intxx031 tointegralx -0 -> -0 +intxx032 tointegralx -0.0 -> -0 +intxx033 tointegralx -0.1 -> -0 Inexact Rounded +intxx034 tointegralx -0.2 -> -0 Inexact Rounded +intxx035 tointegralx -0.3 -> -0 Inexact Rounded +intxx036 tointegralx -0.4 -> -0 Inexact Rounded +intxx037 tointegralx -0.5 -> -1 Inexact Rounded +intxx038 tointegralx -0.6 -> -1 Inexact Rounded +intxx039 tointegralx -0.7 -> -1 Inexact Rounded +intxx040 tointegralx -0.8 -> -1 Inexact Rounded +intxx041 tointegralx -0.9 -> -1 Inexact Rounded +intxx042 tointegralx -1 -> -1 +intxx043 tointegralx -1.0 -> -1 Rounded +intxx044 tointegralx -1.1 -> -1 Inexact Rounded +intxx045 tointegralx -1.2 -> -1 Inexact Rounded +intxx046 tointegralx -1.3 -> -1 Inexact Rounded +intxx047 tointegralx -1.4 -> -1 Inexact Rounded +intxx048 tointegralx -1.5 -> -2 Inexact Rounded +intxx049 tointegralx -1.6 -> -2 Inexact Rounded +intxx050 tointegralx -1.7 -> -2 Inexact Rounded +intxx051 tointegralx -1.8 -> -2 Inexact Rounded +intxx052 tointegralx -1.9 -> -2 Inexact Rounded +-- next two would be NaN using quantize(x, 0) +intxx053 tointegralx 10E+30 -> 1.0E+31 +intxx054 tointegralx -10E+30 -> -1.0E+31 + +-- numbers around precision +precision: 9 +intxx060 tointegralx '56267E-10' -> '0' Inexact Rounded +intxx061 tointegralx '56267E-5' -> '1' Inexact Rounded +intxx062 tointegralx '56267E-2' -> '563' Inexact Rounded +intxx063 tointegralx '56267E-1' -> '5627' Inexact Rounded +intxx065 tointegralx '56267E-0' -> '56267' +intxx066 tointegralx '56267E+0' -> '56267' +intxx067 tointegralx '56267E+1' -> '5.6267E+5' +intxx068 tointegralx '56267E+2' -> '5.6267E+6' +intxx069 tointegralx '56267E+3' -> '5.6267E+7' +intxx070 tointegralx '56267E+4' -> '5.6267E+8' +intxx071 tointegralx '56267E+5' -> '5.6267E+9' +intxx072 tointegralx '56267E+6' -> '5.6267E+10' +intxx073 tointegralx '1.23E+96' -> '1.23E+96' +intxx074 tointegralx '1.23E+384' -> '1.23E+384' +intxx075 tointegralx '1.23E+999' -> '1.23E+999' + +intxx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded +intxx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded +intxx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded +intxx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded +intxx085 tointegralx '-56267E-0' -> '-56267' +intxx086 tointegralx '-56267E+0' -> '-56267' +intxx087 tointegralx '-56267E+1' -> '-5.6267E+5' +intxx088 tointegralx '-56267E+2' -> '-5.6267E+6' +intxx089 tointegralx '-56267E+3' -> '-5.6267E+7' +intxx090 tointegralx '-56267E+4' -> '-5.6267E+8' +intxx091 tointegralx '-56267E+5' -> '-5.6267E+9' +intxx092 tointegralx '-56267E+6' -> '-5.6267E+10' +intxx093 tointegralx '-1.23E+96' -> '-1.23E+96' +intxx094 tointegralx '-1.23E+384' -> '-1.23E+384' +intxx095 tointegralx '-1.23E+999' -> '-1.23E+999' + +-- subnormal inputs +intxx100 tointegralx 1E-999 -> 0 Inexact Rounded +intxx101 tointegralx 0.1E-999 -> 0 Inexact Rounded +intxx102 tointegralx 0.01E-999 -> 0 Inexact Rounded +intxx103 tointegralx 0E-999 -> 0 + +-- specials and zeros +intxx120 tointegralx 'Inf' -> Infinity +intxx121 tointegralx '-Inf' -> -Infinity +intxx122 tointegralx NaN -> NaN +intxx123 tointegralx sNaN -> NaN Invalid_operation +intxx124 tointegralx 0 -> 0 +intxx125 tointegralx -0 -> -0 +intxx126 tointegralx 0.000 -> 0 +intxx127 tointegralx 0.00 -> 0 +intxx128 tointegralx 0.0 -> 0 +intxx129 tointegralx 0 -> 0 +intxx130 tointegralx 0E-3 -> 0 +intxx131 tointegralx 0E-2 -> 0 +intxx132 tointegralx 0E-1 -> 0 +intxx133 tointegralx 0E-0 -> 0 +intxx134 tointegralx 0E+1 -> 0E+1 +intxx135 tointegralx 0E+2 -> 0E+2 +intxx136 tointegralx 0E+3 -> 0E+3 +intxx137 tointegralx 0E+4 -> 0E+4 +intxx138 tointegralx 0E+5 -> 0E+5 +intxx139 tointegralx -0.000 -> -0 +intxx140 tointegralx -0.00 -> -0 +intxx141 tointegralx -0.0 -> -0 +intxx142 tointegralx -0 -> -0 +intxx143 tointegralx -0E-3 -> -0 +intxx144 tointegralx -0E-2 -> -0 +intxx145 tointegralx -0E-1 -> -0 +intxx146 tointegralx -0E-0 -> -0 +intxx147 tointegralx -0E+1 -> -0E+1 +intxx148 tointegralx -0E+2 -> -0E+2 +intxx149 tointegralx -0E+3 -> -0E+3 +intxx150 tointegralx -0E+4 -> -0E+4 +intxx151 tointegralx -0E+5 -> -0E+5 +-- propagating NaNs +intxx152 tointegralx NaN808 -> NaN808 +intxx153 tointegralx sNaN080 -> NaN80 Invalid_operation +intxx154 tointegralx -NaN808 -> -NaN808 +intxx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation +intxx156 tointegralx -NaN -> -NaN +intxx157 tointegralx -sNaN -> -NaN Invalid_operation + +-- examples +rounding: half_up +precision: 9 +intxx200 tointegralx 2.1 -> 2 Inexact Rounded +intxx201 tointegralx 100 -> 100 +intxx202 tointegralx 100.0 -> 100 Rounded +intxx203 tointegralx 101.5 -> 102 Inexact Rounded +intxx204 tointegralx -101.5 -> -102 Inexact Rounded +intxx205 tointegralx 10E+5 -> 1.0E+6 +intxx206 tointegralx 7.89E+77 -> 7.89E+77 +intxx207 tointegralx -Inf -> -Infinity + + +-- all rounding modes +rounding: half_even + +intxx210 tointegralx 55.5 -> 56 Inexact Rounded +intxx211 tointegralx 56.5 -> 56 Inexact Rounded +intxx212 tointegralx 57.5 -> 58 Inexact Rounded +intxx213 tointegralx -55.5 -> -56 Inexact Rounded +intxx214 tointegralx -56.5 -> -56 Inexact Rounded +intxx215 tointegralx -57.5 -> -58 Inexact Rounded + +rounding: half_up + +intxx220 tointegralx 55.5 -> 56 Inexact Rounded +intxx221 tointegralx 56.5 -> 57 Inexact Rounded +intxx222 tointegralx 57.5 -> 58 Inexact Rounded +intxx223 tointegralx -55.5 -> -56 Inexact Rounded +intxx224 tointegralx -56.5 -> -57 Inexact Rounded +intxx225 tointegralx -57.5 -> -58 Inexact Rounded + +rounding: half_down + +intxx230 tointegralx 55.5 -> 55 Inexact Rounded +intxx231 tointegralx 56.5 -> 56 Inexact Rounded +intxx232 tointegralx 57.5 -> 57 Inexact Rounded +intxx233 tointegralx -55.5 -> -55 Inexact Rounded +intxx234 tointegralx -56.5 -> -56 Inexact Rounded +intxx235 tointegralx -57.5 -> -57 Inexact Rounded + +rounding: up + +intxx240 tointegralx 55.3 -> 56 Inexact Rounded +intxx241 tointegralx 56.3 -> 57 Inexact Rounded +intxx242 tointegralx 57.3 -> 58 Inexact Rounded +intxx243 tointegralx -55.3 -> -56 Inexact Rounded +intxx244 tointegralx -56.3 -> -57 Inexact Rounded +intxx245 tointegralx -57.3 -> -58 Inexact Rounded + +rounding: down + +intxx250 tointegralx 55.7 -> 55 Inexact Rounded +intxx251 tointegralx 56.7 -> 56 Inexact Rounded +intxx252 tointegralx 57.7 -> 57 Inexact Rounded +intxx253 tointegralx -55.7 -> -55 Inexact Rounded +intxx254 tointegralx -56.7 -> -56 Inexact Rounded +intxx255 tointegralx -57.7 -> -57 Inexact Rounded + +rounding: ceiling + +intxx260 tointegralx 55.3 -> 56 Inexact Rounded +intxx261 tointegralx 56.3 -> 57 Inexact Rounded +intxx262 tointegralx 57.3 -> 58 Inexact Rounded +intxx263 tointegralx -55.3 -> -55 Inexact Rounded +intxx264 tointegralx -56.3 -> -56 Inexact Rounded +intxx265 tointegralx -57.3 -> -57 Inexact Rounded + +rounding: floor + +intxx270 tointegralx 55.7 -> 55 Inexact Rounded +intxx271 tointegralx 56.7 -> 56 Inexact Rounded +intxx272 tointegralx 57.7 -> 57 Inexact Rounded +intxx273 tointegralx -55.7 -> -56 Inexact Rounded +intxx274 tointegralx -56.7 -> -57 Inexact Rounded +intxx275 tointegralx -57.7 -> -58 Inexact Rounded + +-- Int and uInt32 edge values for testing conversions +precision: 16 +intxx300 tointegralx -2147483646 -> -2147483646 +intxx301 tointegralx -2147483647 -> -2147483647 +intxx302 tointegralx -2147483648 -> -2147483648 +intxx303 tointegralx -2147483649 -> -2147483649 +intxx304 tointegralx 2147483646 -> 2147483646 +intxx305 tointegralx 2147483647 -> 2147483647 +intxx306 tointegralx 2147483648 -> 2147483648 +intxx307 tointegralx 2147483649 -> 2147483649 +intxx308 tointegralx 4294967294 -> 4294967294 +intxx309 tointegralx 4294967295 -> 4294967295 +intxx310 tointegralx 4294967296 -> 4294967296 +intxx311 tointegralx 4294967297 -> 4294967297 Added: sandbox/trunk/decimal/decimal_in_c/decimaltestdata/xor.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/decimaltestdata/xor.decTest Sat Jan 10 18:22:25 2009 @@ -0,0 +1,335 @@ +------------------------------------------------------------------------ +-- xor.decTest -- digitwise logical XOR -- +-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.58 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +-- Sanity check (truth table) +xorx001 xor 0 0 -> 0 +xorx002 xor 0 1 -> 1 +xorx003 xor 1 0 -> 1 +xorx004 xor 1 1 -> 0 +xorx005 xor 1100 1010 -> 110 +xorx006 xor 1111 10 -> 1101 +-- and at msd and msd-1 +xorx010 xor 000000000 000000000 -> 0 +xorx011 xor 000000000 100000000 -> 100000000 +xorx012 xor 100000000 000000000 -> 100000000 +xorx013 xor 100000000 100000000 -> 0 +xorx014 xor 000000000 000000000 -> 0 +xorx015 xor 000000000 010000000 -> 10000000 +xorx016 xor 010000000 000000000 -> 10000000 +xorx017 xor 010000000 010000000 -> 0 + +-- Various lengths +-- 123456789 123456789 123456789 +xorx021 xor 111111111 111111111 -> 0 +xorx022 xor 111111111111 111111111 -> 0 +xorx023 xor 11111111 11111111 -> 0 +xorx025 xor 1111111 1111111 -> 0 +xorx026 xor 111111 111111 -> 0 +xorx027 xor 11111 11111 -> 0 +xorx028 xor 1111 1111 -> 0 +xorx029 xor 111 111 -> 0 +xorx031 xor 11 11 -> 0 +xorx032 xor 1 1 -> 0 +xorx033 xor 111111111111 1111111111 -> 0 +xorx034 xor 11111111111 11111111111 -> 0 +xorx035 xor 1111111111 111111111111 -> 0 +xorx036 xor 111111111 1111111111111 -> 0 + +xorx040 xor 111111111 111111111111 -> 0 +xorx041 xor 11111111 111111111111 -> 100000000 +xorx042 xor 11111111 111111111 -> 100000000 +xorx043 xor 1111111 100000010 -> 101111101 +xorx044 xor 111111 100000100 -> 100111011 +xorx045 xor 11111 100001000 -> 100010111 +xorx046 xor 1111 100010000 -> 100011111 +xorx047 xor 111 100100000 -> 100100111 +xorx048 xor 11 101000000 -> 101000011 +xorx049 xor 1 110000000 -> 110000001 + +xorx050 xor 1111111111 1 -> 111111110 +xorx051 xor 111111111 1 -> 111111110 +xorx052 xor 11111111 1 -> 11111110 +xorx053 xor 1111111 1 -> 1111110 +xorx054 xor 111111 1 -> 111110 +xorx055 xor 11111 1 -> 11110 +xorx056 xor 1111 1 -> 1110 +xorx057 xor 111 1 -> 110 +xorx058 xor 11 1 -> 10 +xorx059 xor 1 1 -> 0 + +xorx060 xor 1111111111 0 -> 111111111 +xorx061 xor 111111111 0 -> 111111111 +xorx062 xor 11111111 0 -> 11111111 +xorx063 xor 1111111 0 -> 1111111 +xorx064 xor 111111 0 -> 111111 +xorx065 xor 11111 0 -> 11111 +xorx066 xor 1111 0 -> 1111 +xorx067 xor 111 0 -> 111 +xorx068 xor 11 0 -> 11 +xorx069 xor 1 0 -> 1 + +xorx070 xor 1 1111111111 -> 111111110 +xorx071 xor 1 111111111 -> 111111110 +xorx072 xor 1 11111111 -> 11111110 +xorx073 xor 1 1111111 -> 1111110 +xorx074 xor 1 111111 -> 111110 +xorx075 xor 1 11111 -> 11110 +xorx076 xor 1 1111 -> 1110 +xorx077 xor 1 111 -> 110 +xorx078 xor 1 11 -> 10 +xorx079 xor 1 1 -> 0 + +xorx080 xor 0 1111111111 -> 111111111 +xorx081 xor 0 111111111 -> 111111111 +xorx082 xor 0 11111111 -> 11111111 +xorx083 xor 0 1111111 -> 1111111 +xorx084 xor 0 111111 -> 111111 +xorx085 xor 0 11111 -> 11111 +xorx086 xor 0 1111 -> 1111 +xorx087 xor 0 111 -> 111 +xorx088 xor 0 11 -> 11 +xorx089 xor 0 1 -> 1 + +xorx090 xor 011111111 111101111 -> 100010000 +xorx091 xor 101111111 111101111 -> 10010000 +xorx092 xor 110111111 111101111 -> 1010000 +xorx093 xor 111011111 111101111 -> 110000 +xorx094 xor 111101111 111101111 -> 0 +xorx095 xor 111110111 111101111 -> 11000 +xorx096 xor 111111011 111101111 -> 10100 +xorx097 xor 111111101 111101111 -> 10010 +xorx098 xor 111111110 111101111 -> 10001 + +xorx100 xor 111101111 011111111 -> 100010000 +xorx101 xor 111101111 101111111 -> 10010000 +xorx102 xor 111101111 110111111 -> 1010000 +xorx103 xor 111101111 111011111 -> 110000 +xorx104 xor 111101111 111101111 -> 0 +xorx105 xor 111101111 111110111 -> 11000 +xorx106 xor 111101111 111111011 -> 10100 +xorx107 xor 111101111 111111101 -> 10010 +xorx108 xor 111101111 111111110 -> 10001 + +-- non-0/1 should not be accepted, nor should signs +xorx220 xor 111111112 111111111 -> NaN Invalid_operation +xorx221 xor 333333333 333333333 -> NaN Invalid_operation +xorx222 xor 555555555 555555555 -> NaN Invalid_operation +xorx223 xor 777777777 777777777 -> NaN Invalid_operation +xorx224 xor 999999999 999999999 -> NaN Invalid_operation +xorx225 xor 222222222 999999999 -> NaN Invalid_operation +xorx226 xor 444444444 999999999 -> NaN Invalid_operation +xorx227 xor 666666666 999999999 -> NaN Invalid_operation +xorx228 xor 888888888 999999999 -> NaN Invalid_operation +xorx229 xor 999999999 222222222 -> NaN Invalid_operation +xorx230 xor 999999999 444444444 -> NaN Invalid_operation +xorx231 xor 999999999 666666666 -> NaN Invalid_operation +xorx232 xor 999999999 888888888 -> NaN Invalid_operation +-- a few randoms +xorx240 xor 567468689 -934981942 -> NaN Invalid_operation +xorx241 xor 567367689 934981942 -> NaN Invalid_operation +xorx242 xor -631917772 -706014634 -> NaN Invalid_operation +xorx243 xor -756253257 138579234 -> NaN Invalid_operation +xorx244 xor 835590149 567435400 -> NaN Invalid_operation +-- test MSD +xorx250 xor 200000000 100000000 -> NaN Invalid_operation +xorx251 xor 700000000 100000000 -> NaN Invalid_operation +xorx252 xor 800000000 100000000 -> NaN Invalid_operation +xorx253 xor 900000000 100000000 -> NaN Invalid_operation +xorx254 xor 200000000 000000000 -> NaN Invalid_operation +xorx255 xor 700000000 000000000 -> NaN Invalid_operation +xorx256 xor 800000000 000000000 -> NaN Invalid_operation +xorx257 xor 900000000 000000000 -> NaN Invalid_operation +xorx258 xor 100000000 200000000 -> NaN Invalid_operation +xorx259 xor 100000000 700000000 -> NaN Invalid_operation +xorx260 xor 100000000 800000000 -> NaN Invalid_operation +xorx261 xor 100000000 900000000 -> NaN Invalid_operation +xorx262 xor 000000000 200000000 -> NaN Invalid_operation +xorx263 xor 000000000 700000000 -> NaN Invalid_operation +xorx264 xor 000000000 800000000 -> NaN Invalid_operation +xorx265 xor 000000000 900000000 -> NaN Invalid_operation +-- test MSD-1 +xorx270 xor 020000000 100000000 -> NaN Invalid_operation +xorx271 xor 070100000 100000000 -> NaN Invalid_operation +xorx272 xor 080010000 100000001 -> NaN Invalid_operation +xorx273 xor 090001000 100000010 -> NaN Invalid_operation +xorx274 xor 100000100 020010100 -> NaN Invalid_operation +xorx275 xor 100000000 070001000 -> NaN Invalid_operation +xorx276 xor 100000010 080010100 -> NaN Invalid_operation +xorx277 xor 100000000 090000010 -> NaN Invalid_operation +-- test LSD +xorx280 xor 001000002 100000000 -> NaN Invalid_operation +xorx281 xor 000000007 100000000 -> NaN Invalid_operation +xorx282 xor 000000008 100000000 -> NaN Invalid_operation +xorx283 xor 000000009 100000000 -> NaN Invalid_operation +xorx284 xor 100000000 000100002 -> NaN Invalid_operation +xorx285 xor 100100000 001000007 -> NaN Invalid_operation +xorx286 xor 100010000 010000008 -> NaN Invalid_operation +xorx287 xor 100001000 100000009 -> NaN Invalid_operation +-- test Middie +xorx288 xor 001020000 100000000 -> NaN Invalid_operation +xorx289 xor 000070001 100000000 -> NaN Invalid_operation +xorx290 xor 000080000 100010000 -> NaN Invalid_operation +xorx291 xor 000090000 100001000 -> NaN Invalid_operation +xorx292 xor 100000010 000020100 -> NaN Invalid_operation +xorx293 xor 100100000 000070010 -> NaN Invalid_operation +xorx294 xor 100010100 000080001 -> NaN Invalid_operation +xorx295 xor 100001000 000090000 -> NaN Invalid_operation +-- signs +xorx296 xor -100001000 -000000000 -> NaN Invalid_operation +xorx297 xor -100001000 000010000 -> NaN Invalid_operation +xorx298 xor 100001000 -000000000 -> NaN Invalid_operation +xorx299 xor 100001000 000011000 -> 100010000 + +-- Nmax, Nmin, Ntiny +xorx331 xor 2 9.99999999E+999 -> NaN Invalid_operation +xorx332 xor 3 1E-999 -> NaN Invalid_operation +xorx333 xor 4 1.00000000E-999 -> NaN Invalid_operation +xorx334 xor 5 1E-1007 -> NaN Invalid_operation +xorx335 xor 6 -1E-1007 -> NaN Invalid_operation +xorx336 xor 7 -1.00000000E-999 -> NaN Invalid_operation +xorx337 xor 8 -1E-999 -> NaN Invalid_operation +xorx338 xor 9 -9.99999999E+999 -> NaN Invalid_operation +xorx341 xor 9.99999999E+999 -18 -> NaN Invalid_operation +xorx342 xor 1E-999 01 -> NaN Invalid_operation +xorx343 xor 1.00000000E-999 -18 -> NaN Invalid_operation +xorx344 xor 1E-1007 18 -> NaN Invalid_operation +xorx345 xor -1E-1007 -10 -> NaN Invalid_operation +xorx346 xor -1.00000000E-999 18 -> NaN Invalid_operation +xorx347 xor -1E-999 10 -> NaN Invalid_operation +xorx348 xor -9.99999999E+999 -18 -> NaN Invalid_operation + +-- A few other non-integers +xorx361 xor 1.0 1 -> NaN Invalid_operation +xorx362 xor 1E+1 1 -> NaN Invalid_operation +xorx363 xor 0.0 1 -> NaN Invalid_operation +xorx364 xor 0E+1 1 -> NaN Invalid_operation +xorx365 xor 9.9 1 -> NaN Invalid_operation +xorx366 xor 9E+1 1 -> NaN Invalid_operation +xorx371 xor 0 1.0 -> NaN Invalid_operation +xorx372 xor 0 1E+1 -> NaN Invalid_operation +xorx373 xor 0 0.0 -> NaN Invalid_operation +xorx374 xor 0 0E+1 -> NaN Invalid_operation +xorx375 xor 0 9.9 -> NaN Invalid_operation +xorx376 xor 0 9E+1 -> NaN Invalid_operation + +-- All Specials are in error +xorx780 xor -Inf -Inf -> NaN Invalid_operation +xorx781 xor -Inf -1000 -> NaN Invalid_operation +xorx782 xor -Inf -1 -> NaN Invalid_operation +xorx783 xor -Inf -0 -> NaN Invalid_operation +xorx784 xor -Inf 0 -> NaN Invalid_operation +xorx785 xor -Inf 1 -> NaN Invalid_operation +xorx786 xor -Inf 1000 -> NaN Invalid_operation +xorx787 xor -1000 -Inf -> NaN Invalid_operation +xorx788 xor -Inf -Inf -> NaN Invalid_operation +xorx789 xor -1 -Inf -> NaN Invalid_operation +xorx790 xor -0 -Inf -> NaN Invalid_operation +xorx791 xor 0 -Inf -> NaN Invalid_operation +xorx792 xor 1 -Inf -> NaN Invalid_operation +xorx793 xor 1000 -Inf -> NaN Invalid_operation +xorx794 xor Inf -Inf -> NaN Invalid_operation + +xorx800 xor Inf -Inf -> NaN Invalid_operation +xorx801 xor Inf -1000 -> NaN Invalid_operation +xorx802 xor Inf -1 -> NaN Invalid_operation +xorx803 xor Inf -0 -> NaN Invalid_operation +xorx804 xor Inf 0 -> NaN Invalid_operation +xorx805 xor Inf 1 -> NaN Invalid_operation +xorx806 xor Inf 1000 -> NaN Invalid_operation +xorx807 xor Inf Inf -> NaN Invalid_operation +xorx808 xor -1000 Inf -> NaN Invalid_operation +xorx809 xor -Inf Inf -> NaN Invalid_operation +xorx810 xor -1 Inf -> NaN Invalid_operation +xorx811 xor -0 Inf -> NaN Invalid_operation +xorx812 xor 0 Inf -> NaN Invalid_operation +xorx813 xor 1 Inf -> NaN Invalid_operation +xorx814 xor 1000 Inf -> NaN Invalid_operation +xorx815 xor Inf Inf -> NaN Invalid_operation + +xorx821 xor NaN -Inf -> NaN Invalid_operation +xorx822 xor NaN -1000 -> NaN Invalid_operation +xorx823 xor NaN -1 -> NaN Invalid_operation +xorx824 xor NaN -0 -> NaN Invalid_operation +xorx825 xor NaN 0 -> NaN Invalid_operation +xorx826 xor NaN 1 -> NaN Invalid_operation +xorx827 xor NaN 1000 -> NaN Invalid_operation +xorx828 xor NaN Inf -> NaN Invalid_operation +xorx829 xor NaN NaN -> NaN Invalid_operation +xorx830 xor -Inf NaN -> NaN Invalid_operation +xorx831 xor -1000 NaN -> NaN Invalid_operation +xorx832 xor -1 NaN -> NaN Invalid_operation +xorx833 xor -0 NaN -> NaN Invalid_operation +xorx834 xor 0 NaN -> NaN Invalid_operation +xorx835 xor 1 NaN -> NaN Invalid_operation +xorx836 xor 1000 NaN -> NaN Invalid_operation +xorx837 xor Inf NaN -> NaN Invalid_operation + +xorx841 xor sNaN -Inf -> NaN Invalid_operation +xorx842 xor sNaN -1000 -> NaN Invalid_operation +xorx843 xor sNaN -1 -> NaN Invalid_operation +xorx844 xor sNaN -0 -> NaN Invalid_operation +xorx845 xor sNaN 0 -> NaN Invalid_operation +xorx846 xor sNaN 1 -> NaN Invalid_operation +xorx847 xor sNaN 1000 -> NaN Invalid_operation +xorx848 xor sNaN NaN -> NaN Invalid_operation +xorx849 xor sNaN sNaN -> NaN Invalid_operation +xorx850 xor NaN sNaN -> NaN Invalid_operation +xorx851 xor -Inf sNaN -> NaN Invalid_operation +xorx852 xor -1000 sNaN -> NaN Invalid_operation +xorx853 xor -1 sNaN -> NaN Invalid_operation +xorx854 xor -0 sNaN -> NaN Invalid_operation +xorx855 xor 0 sNaN -> NaN Invalid_operation +xorx856 xor 1 sNaN -> NaN Invalid_operation +xorx857 xor 1000 sNaN -> NaN Invalid_operation +xorx858 xor Inf sNaN -> NaN Invalid_operation +xorx859 xor NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +xorx861 xor NaN1 -Inf -> NaN Invalid_operation +xorx862 xor +NaN2 -1000 -> NaN Invalid_operation +xorx863 xor NaN3 1000 -> NaN Invalid_operation +xorx864 xor NaN4 Inf -> NaN Invalid_operation +xorx865 xor NaN5 +NaN6 -> NaN Invalid_operation +xorx866 xor -Inf NaN7 -> NaN Invalid_operation +xorx867 xor -1000 NaN8 -> NaN Invalid_operation +xorx868 xor 1000 NaN9 -> NaN Invalid_operation +xorx869 xor Inf +NaN10 -> NaN Invalid_operation +xorx871 xor sNaN11 -Inf -> NaN Invalid_operation +xorx872 xor sNaN12 -1000 -> NaN Invalid_operation +xorx873 xor sNaN13 1000 -> NaN Invalid_operation +xorx874 xor sNaN14 NaN17 -> NaN Invalid_operation +xorx875 xor sNaN15 sNaN18 -> NaN Invalid_operation +xorx876 xor NaN16 sNaN19 -> NaN Invalid_operation +xorx877 xor -Inf +sNaN20 -> NaN Invalid_operation +xorx878 xor -1000 sNaN21 -> NaN Invalid_operation +xorx879 xor 1000 sNaN22 -> NaN Invalid_operation +xorx880 xor Inf sNaN23 -> NaN Invalid_operation +xorx881 xor +NaN25 +sNaN24 -> NaN Invalid_operation +xorx882 xor -NaN26 NaN28 -> NaN Invalid_operation +xorx883 xor -sNaN27 sNaN29 -> NaN Invalid_operation +xorx884 xor 1000 -NaN30 -> NaN Invalid_operation +xorx885 xor 1000 -sNaN31 -> NaN Invalid_operation Added: sandbox/trunk/decimal/decimal_in_c/profile.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/profile.py Sat Jan 10 18:22:25 2009 @@ -0,0 +1,29 @@ +# Timings for multiplication + +import timeit +from random import randrange +from deccoeff import Deccoeff as D + +def getvals(N): + a = randrange(10**N) + b = randrange(10**N) + return a, b + +# test multiplication of two random n-digit numbers + +N = 1000 + +T = timeit.Timer('c = a*b', + 'from __main__ import getvals, D\n' + 'a, b = getvals(%s)\n' + 'a, b = D(a), D(b)' % N) + +T2 = timeit.Timer('c = a*b', + 'from __main__ import getvals\n' + 'a, b = getvals(%s)' % N) + +count = 10000 +times = T.repeat(repeat = 5, number = count) +print("%s-digit by %s-digit multiply, decimal: %.9f" % (N, N, min(times)/count)) +times = T2.repeat(repeat = 5, number = count) +print("%s-digit by %s-digit multiply, binary: %.9f" % (N, N, min(times)/count)) Added: sandbox/trunk/decimal/decimal_in_c/run.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/run.py Sat Jan 10 18:22:25 2009 @@ -0,0 +1,2 @@ +from deccoeff import _Decimal, Deccoeff +from decimal import Decimal Added: sandbox/trunk/decimal/decimal_in_c/setup.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/setup.py Sat Jan 10 18:22:25 2009 @@ -0,0 +1,13 @@ +from distutils.core import setup, Extension + +files = ['deccoeff.c'] + +libraries = [] +includes = [] +setup(name = "deccoeff", version = "0.2", + ext_modules = [Extension("deccoeff", files, + libraries = libraries, + include_dirs = includes, + ) + ], + ) Added: sandbox/trunk/decimal/decimal_in_c/test_deccoeff.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/test_deccoeff.py Sat Jan 10 18:22:25 2009 @@ -0,0 +1,95 @@ +from deccoeff import Deccoeff as D, LIMB_DIGITS, MAX_DIGITS +from test.support import run_unittest +from operator import add, mul, sub, floordiv, mod, pow +from operator import eq, ge, gt, le, lt, ne +import operator +import unittest +from random import randrange + +opname = { + add: '+', + sub: '-', + mul: '*', + floordiv: '/', + mod: '%', + le: '<=', + lt: '<', + eq: '==', + ne: '!=', + ge: '>=', + gt: '>', +} + +class DecccoeffTest(unittest.TestCase): + def compare_op(self, op, a, b): + """Check that Deccoeff and Python integers give the same + result for the given arithmetic operation.""" + + if op is sub and a < b: + self.assertRaises(OverflowError, op, D(a), D(b)) + elif op in (floordiv, mod) and b == 0: + self.assertRaises(ZeroDivisionError, op, D(a), D(b)) + else: + int_result = D(op(a, b)) + deccoeff_result = op(D(a), D(b)) + mixed_result1 = op(a, D(b)) + mixed_result2 = op(D(a), b) + if int_result != deccoeff_result: + self.fail('integer and deccoeff give different results for: ' + '%s %s %s' % (a, opname[op], b)) + self.assertEquals(mixed_result1, int_result) + self.assertEquals(mixed_result2, int_result) + + def testRandomOps(self): + sizes = [10**i for i in + [0, 1, 2, 4, 5, 9, 10, 18, 19, 20, 50, 100]] + trials = 100 + for op in opname.keys(): + for a_max in sizes: + for b_max in sizes: + for n in range(trials): + self.compare_op(op, randrange(a_max), randrange(b_max)) + + def testAdd(self): + # additional tests for addition + for i in range(100): + for j in range(100): + self.compare_op(add, i, j) + test_values = [ + (0, 123456789), + (0, 999999999), + (0, 10**9), + (1, 10**9-1), + (1, 10**9), + (1, 10**18-1), + (123456789, 876543210), + (123456789, 876543211), + (123456789, 999999999876543210), + (123456789, 999999999876543211), + (123456789, 999999999876543212), + ] + for i, j in test_values: + self.compare_op(add, i, j) + + def testMixed(self): + class MyInteger(object): + def __init__(self, n): + self.n = n + def __index__(self): + return self.n + + # integer types should be automatically converted to Deccoeffs + self.assertEqual(D(123) + 47, D(123+47)) + self.assertEqual(True * D(123), D(True * 123)) + self.assertEqual(MyInteger(12345) % D(123), D(12345 % 123)) + + # but an attempt to convert a negative integer type + # should cause an error, even if the operation result is nonnegative + self.assertRaises(OverflowError, add, D(47), -12) + self.assertRaises(OverflowError, add, -12, D(47)) + +def test_main(): + run_unittest(DecccoeffTest) + +if __name__ == '__main__': + test_main() Added: sandbox/trunk/decimal/decimal_in_c/test_decimal.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal/decimal_in_c/test_decimal.py Sat Jan 10 18:22:25 2009 @@ -0,0 +1,1635 @@ +# Copyright (c) 2004 Python Software Foundation. +# All rights reserved. + +# Written by Eric Price +# and Facundo Batista +# and Raymond Hettinger +# and Aahz (aahz at pobox.com) +# and Tim Peters + +""" +These are the test cases for the Decimal module. + +There are two groups of tests, Arithmetic and Behaviour. The former test +the Decimal arithmetic using the tests provided by Mike Cowlishaw. The latter +test the pythonic behaviour according to PEP 327. + +Cowlishaw's tests can be downloaded from: + + www2.hursley.ibm.com/decimal/dectest.zip + +This test module can be called from command line with one parameter (Arithmetic +or Behaviour) to test each part, or without parameter to test both parts. If +you're working through IDLE, you can import this test module and call test_main() +with the corresponding argument. +""" + +import glob +import math +import os, sys +import pickle, copy +import unittest +from decimal import * +from test.support import (TestSkipped, run_unittest, run_doctest, + is_resource_enabled) +import random +try: + import threading +except ImportError: + threading = None + +# Useful Test Constant +Signals = tuple(getcontext().flags.keys()) + +# Tests are built around these assumed context defaults. +# test_main() restores the original context. +def init(): + global ORIGINAL_CONTEXT + ORIGINAL_CONTEXT = getcontext().copy() + DefaultTestContext = Context( + prec = 9, + rounding = ROUND_HALF_EVEN, + traps = dict.fromkeys(Signals, 0) + ) + setcontext(DefaultTestContext) + +TESTDATADIR = 'decimaltestdata' +if __name__ == '__main__': + file = sys.argv[0] +else: + file = __file__ +testdir = os.path.dirname(file) or os.curdir +directory = testdir + os.sep + TESTDATADIR + os.sep + +skip_expected = not os.path.isdir(directory) + +# Make sure it actually raises errors when not expected and caught in flags +# Slower, since it runs some things several times. +EXTENDEDERRORTEST = False + +#Map the test cases' error names to the actual errors +ErrorNames = {'clamped' : Clamped, + 'conversion_syntax' : InvalidOperation, + 'division_by_zero' : DivisionByZero, + 'division_impossible' : InvalidOperation, + 'division_undefined' : InvalidOperation, + 'inexact' : Inexact, + 'invalid_context' : InvalidOperation, + 'invalid_operation' : InvalidOperation, + 'overflow' : Overflow, + 'rounded' : Rounded, + 'subnormal' : Subnormal, + 'underflow' : Underflow} + + +def Nonfunction(*args): + """Doesn't do anything.""" + return None + +RoundingDict = {'ceiling' : ROUND_CEILING, #Maps test-case names to roundings. + 'down' : ROUND_DOWN, + 'floor' : ROUND_FLOOR, + 'half_down' : ROUND_HALF_DOWN, + 'half_even' : ROUND_HALF_EVEN, + 'half_up' : ROUND_HALF_UP, + 'up' : ROUND_UP, + '05up' : ROUND_05UP} + +# Name adapter to be able to change the Decimal and Context +# interface without changing the test files from Cowlishaw +nameAdapter = {'and':'logical_and', + 'apply':'_apply', + 'class':'number_class', + 'comparesig':'compare_signal', + 'comparetotal':'compare_total', + 'comparetotmag':'compare_total_mag', + 'copy':'copy_decimal', + 'copyabs':'copy_abs', + 'copynegate':'copy_negate', + 'copysign':'copy_sign', + 'divideint':'divide_int', + 'invert':'logical_invert', + 'iscanonical':'is_canonical', + 'isfinite':'is_finite', + 'isinfinite':'is_infinite', + 'isnan':'is_nan', + 'isnormal':'is_normal', + 'isqnan':'is_qnan', + 'issigned':'is_signed', + 'issnan':'is_snan', + 'issubnormal':'is_subnormal', + 'iszero':'is_zero', + 'maxmag':'max_mag', + 'minmag':'min_mag', + 'nextminus':'next_minus', + 'nextplus':'next_plus', + 'nexttoward':'next_toward', + 'or':'logical_or', + 'reduce':'normalize', + 'remaindernear':'remainder_near', + 'samequantum':'same_quantum', + 'squareroot':'sqrt', + 'toeng':'to_eng_string', + 'tointegral':'to_integral_value', + 'tointegralx':'to_integral_exact', + 'tosci':'to_sci_string', + 'xor':'logical_xor', + } + +# The following functions return True/False rather than a Decimal instance + +LOGICAL_FUNCTIONS = ( + 'is_canonical', + 'is_finite', + 'is_infinite', + 'is_nan', + 'is_normal', + 'is_qnan', + 'is_signed', + 'is_snan', + 'is_subnormal', + 'is_zero', + 'same_quantum', + ) + +# For some operations (currently exp, ln, log10, power), the decNumber +# reference implementation imposes additional restrictions on the +# context and operands. These restrictions are not part of the +# specification; however, the effect of these restrictions does show +# up in some of the testcases. We skip testcases that violate these +# restrictions, since Decimal behaves differently from decNumber for +# these testcases so these testcases would otherwise fail. + +decNumberRestricted = ('power', 'ln', 'log10', 'exp') +DEC_MAX_MATH = 999999 +def outside_decNumber_bounds(v, context): + if (context.prec > DEC_MAX_MATH or + context.Emax > DEC_MAX_MATH or + -context.Emin > DEC_MAX_MATH): + return True + if not v._is_special and v and ( + v.adjusted() > DEC_MAX_MATH or + v.adjusted() < 1-2*DEC_MAX_MATH): + return True + return False + +class DecimalTest(unittest.TestCase): + """Class which tests the Decimal class against the test cases. + + Changed for unittest. + """ + def setUp(self): + self.context = Context() + self.ignore_list = ['#'] + # Basically, a # means return NaN InvalidOperation. + # Different from a sNaN in trim + + self.ChangeDict = {'precision' : self.change_precision, + 'rounding' : self.change_rounding_method, + 'maxexponent' : self.change_max_exponent, + 'minexponent' : self.change_min_exponent, + 'clamp' : self.change_clamp} + + def eval_file(self, file): + global skip_expected + if skip_expected: + raise TestSkipped + return + for line in open(file): + line = line.replace('\r\n', '').replace('\n', '') + #print line + try: + t = self.eval_line(line) + except DecimalException as exception: + #Exception raised where there shoudn't have been one. + self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line) + + return + + def eval_line(self, s): + if s.find(' -> ') >= 0 and s[:2] != '--' and not s.startswith(' --'): + s = (s.split('->')[0] + '->' + + s.split('->')[1].split('--')[0]).strip() + else: + s = s.split('--')[0].strip() + + for ignore in self.ignore_list: + if s.find(ignore) >= 0: + #print s.split()[0], 'NotImplemented--', ignore + return + if not s: + return + elif ':' in s: + return self.eval_directive(s) + else: + return self.eval_equation(s) + + def eval_directive(self, s): + funct, value = (x.strip().lower() for x in s.split(':')) + if funct == 'rounding': + value = RoundingDict[value] + else: + try: + value = int(value) + except ValueError: + pass + + funct = self.ChangeDict.get(funct, Nonfunction) + funct(value) + + def eval_equation(self, s): + #global DEFAULT_PRECISION + #print DEFAULT_PRECISION + + if not TEST_ALL and random.random() < 0.90: + return + + try: + Sides = s.split('->') + L = Sides[0].strip().split() + id = L[0] + if DEBUG: + print("Test ", id, end=" ") + funct = L[1].lower() + valstemp = L[2:] + L = Sides[1].strip().split() + ans = L[0] + exceptions = L[1:] + except (TypeError, AttributeError, IndexError): + raise InvalidOperation + def FixQuotes(val): + val = val.replace("''", 'SingleQuote').replace('""', 'DoubleQuote') + val = val.replace("'", '').replace('"', '') + val = val.replace('SingleQuote', "'").replace('DoubleQuote', '"') + return val + fname = nameAdapter.get(funct, funct) + if fname == 'rescale': + return + funct = getattr(self.context, fname) + vals = [] + conglomerate = '' + quote = 0 + theirexceptions = [ErrorNames[x.lower()] for x in exceptions] + + for exception in Signals: + self.context.traps[exception] = 1 #Catch these bugs... + for exception in theirexceptions: + self.context.traps[exception] = 0 + for i, val in enumerate(valstemp): + if val.count("'") % 2 == 1: + quote = 1 - quote + if quote: + conglomerate = conglomerate + ' ' + val + continue + else: + val = conglomerate + val + conglomerate = '' + v = FixQuotes(val) + if fname in ('to_sci_string', 'to_eng_string'): + if EXTENDEDERRORTEST: + for error in theirexceptions: + self.context.traps[error] = 1 + try: + funct(self.context.create_decimal(v)) + except error: + pass + except Signals as e: + self.fail("Raised %s in %s when %s disabled" % \ + (e, s, error)) + else: + self.fail("Did not raise %s in %s" % (error, s)) + self.context.traps[error] = 0 + v = self.context.create_decimal(v) + else: + v = Decimal(v, self.context) + vals.append(v) + + ans = FixQuotes(ans) + + # skip tests that are related to bounds imposed in the decNumber + # reference implementation + if fname in decNumberRestricted: + if fname == 'power': + if not (vals[1]._isinteger() and + -1999999997 <= vals[1] <= 999999999): + if outside_decNumber_bounds(vals[0], self.context) or \ + outside_decNumber_bounds(vals[1], self.context): + #print "Skipping test %s" % s + return + else: + if outside_decNumber_bounds(vals[0], self.context): + #print "Skipping test %s" % s + return + + + if EXTENDEDERRORTEST and fname not in ('to_sci_string', 'to_eng_string'): + for error in theirexceptions: + self.context.traps[error] = 1 + try: + funct(*vals) + except error: + pass + except Signals as e: + self.fail("Raised %s in %s when %s disabled" % \ + (e, s, error)) + else: + self.fail("Did not raise %s in %s" % (error, s)) + self.context.traps[error] = 0 + if DEBUG: + print("--", self.context) + try: + result = str(funct(*vals)) + if fname in LOGICAL_FUNCTIONS: + result = str(int(eval(result))) # 'True', 'False' -> '1', '0' + except Signals as error: + self.fail("Raised %s in %s" % (error, s)) + except: #Catch any error long enough to state the test case. + print("ERROR:", s) + raise + + myexceptions = self.getexceptions() + self.context.clear_flags() + + myexceptions.sort(key=repr) + theirexceptions.sort(key=repr) + + self.assertEqual(result, ans, + 'Incorrect answer for ' + s + ' -- got ' + result) + self.assertEqual(myexceptions, theirexceptions, + 'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions)) + return + + def getexceptions(self): + return [e for e in Signals if self.context.flags[e]] + + def change_precision(self, prec): + self.context.prec = prec + def change_rounding_method(self, rounding): + self.context.rounding = rounding + def change_min_exponent(self, exp): + self.context.Emin = exp + def change_max_exponent(self, exp): + self.context.Emax = exp + def change_clamp(self, clamp): + self.context._clamp = clamp + + + +# The following classes test the behaviour of Decimal according to PEP 327 + +class DecimalExplicitConstructionTest(unittest.TestCase): + '''Unit tests for Explicit Construction cases of Decimal.''' + + def test_explicit_empty(self): + self.assertEqual(Decimal(), Decimal("0")) + + def test_explicit_from_None(self): + self.assertRaises(TypeError, Decimal, None) + + def test_explicit_from_int(self): + + #positive + d = Decimal(45) + self.assertEqual(str(d), '45') + + #very large positive + d = Decimal(500000123) + self.assertEqual(str(d), '500000123') + + #negative + d = Decimal(-45) + self.assertEqual(str(d), '-45') + + #zero + d = Decimal(0) + self.assertEqual(str(d), '0') + + def test_explicit_from_string(self): + + #empty + self.assertEqual(str(Decimal('')), 'NaN') + + #int + self.assertEqual(str(Decimal('45')), '45') + + #float + self.assertEqual(str(Decimal('45.34')), '45.34') + + #engineer notation + self.assertEqual(str(Decimal('45e2')), '4.5E+3') + + #just not a number + self.assertEqual(str(Decimal('ugly')), 'NaN') + + #leading and trailing whitespace permitted + self.assertEqual(str(Decimal('1.3E4 \n')), '1.3E+4') + self.assertEqual(str(Decimal(' -7.89')), '-7.89') + + #but alternate unicode digits should not + self.assertEqual(str(Decimal('\uff11')), 'NaN') + + def test_explicit_from_tuples(self): + + #zero + d = Decimal( (0, (0,), 0) ) + self.assertEqual(str(d), '0') + + #int + d = Decimal( (1, (4, 5), 0) ) + self.assertEqual(str(d), '-45') + + #float + d = Decimal( (0, (4, 5, 3, 4), -2) ) + self.assertEqual(str(d), '45.34') + + #weird + d = Decimal( (1, (4, 3, 4, 9, 1, 3, 5, 3, 4), -25) ) + self.assertEqual(str(d), '-4.34913534E-17') + + #wrong number of items + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1)) ) + + #bad sign + self.assertRaises(ValueError, Decimal, (8, (4, 3, 4, 9, 1), 2) ) + self.assertRaises(ValueError, Decimal, (0., (4, 3, 4, 9, 1), 2) ) + self.assertRaises(ValueError, Decimal, (Decimal(1), (4, 3, 4, 9, 1), 2)) + + #bad exp + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), 'wrong!') ) + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), 0.) ) + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), '1') ) + + #bad coefficients + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, None, 1), 2) ) + self.assertRaises(ValueError, Decimal, (1, (4, -3, 4, 9, 1), 2) ) + self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) ) + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 'a', 1), 2) ) + + def test_explicit_from_Decimal(self): + + #positive + d = Decimal(45) + e = Decimal(d) + self.assertEqual(str(e), '45') + self.assertNotEqual(id(d), id(e)) + + #very large positive + d = Decimal(500000123) + e = Decimal(d) + self.assertEqual(str(e), '500000123') + self.assertNotEqual(id(d), id(e)) + + #negative + d = Decimal(-45) + e = Decimal(d) + self.assertEqual(str(e), '-45') + self.assertNotEqual(id(d), id(e)) + + #zero + d = Decimal(0) + e = Decimal(d) + self.assertEqual(str(e), '0') + self.assertNotEqual(id(d), id(e)) + + def test_explicit_context_create_decimal(self): + + nc = copy.copy(getcontext()) + nc.prec = 3 + + # empty + d = Decimal() + self.assertEqual(str(d), '0') + d = nc.create_decimal() + self.assertEqual(str(d), '0') + + # from None + self.assertRaises(TypeError, nc.create_decimal, None) + + # from int + d = nc.create_decimal(456) + self.failUnless(isinstance(d, Decimal)) + self.assertEqual(nc.create_decimal(45678), + nc.create_decimal('457E+2')) + + # from string + d = Decimal('456789') + self.assertEqual(str(d), '456789') + d = nc.create_decimal('456789') + self.assertEqual(str(d), '4.57E+5') + # leading and trailing whitespace should result in a NaN; + # spaces are already checked in Cowlishaw's test-suite, so + # here we just check that a trailing newline results in a NaN + self.assertEqual(str(nc.create_decimal('3.14\n')), 'NaN') + + # from tuples + d = Decimal( (1, (4, 3, 4, 9, 1, 3, 5, 3, 4), -25) ) + self.assertEqual(str(d), '-4.34913534E-17') + d = nc.create_decimal( (1, (4, 3, 4, 9, 1, 3, 5, 3, 4), -25) ) + self.assertEqual(str(d), '-4.35E-17') + + # from Decimal + prevdec = Decimal(500000123) + d = Decimal(prevdec) + self.assertEqual(str(d), '500000123') + d = nc.create_decimal(prevdec) + self.assertEqual(str(d), '5.00E+8') + + +class DecimalImplicitConstructionTest(unittest.TestCase): + '''Unit tests for Implicit Construction cases of Decimal.''' + + def test_implicit_from_None(self): + self.assertRaises(TypeError, eval, 'Decimal(5) + None', globals()) + + def test_implicit_from_int(self): + #normal + self.assertEqual(str(Decimal(5) + 45), '50') + #exceeding precision + self.assertEqual(Decimal(5) + 123456789000, Decimal(123456789000)) + + def test_implicit_from_string(self): + self.assertRaises(TypeError, eval, 'Decimal(5) + "3"', globals()) + + def test_implicit_from_float(self): + self.assertRaises(TypeError, eval, 'Decimal(5) + 2.2', globals()) + + def test_implicit_from_Decimal(self): + self.assertEqual(Decimal(5) + Decimal(45), Decimal(50)) + + def test_rop(self): + # Allow other classes to be trained to interact with Decimals + class E: + def __divmod__(self, other): + return 'divmod ' + str(other) + def __rdivmod__(self, other): + return str(other) + ' rdivmod' + def __lt__(self, other): + return 'lt ' + str(other) + def __gt__(self, other): + return 'gt ' + str(other) + def __le__(self, other): + return 'le ' + str(other) + def __ge__(self, other): + return 'ge ' + str(other) + def __eq__(self, other): + return 'eq ' + str(other) + def __ne__(self, other): + return 'ne ' + str(other) + + self.assertEqual(divmod(E(), Decimal(10)), 'divmod 10') + self.assertEqual(divmod(Decimal(10), E()), '10 rdivmod') + self.assertEqual(eval('Decimal(10) < E()'), 'gt 10') + self.assertEqual(eval('Decimal(10) > E()'), 'lt 10') + self.assertEqual(eval('Decimal(10) <= E()'), 'ge 10') + self.assertEqual(eval('Decimal(10) >= E()'), 'le 10') + self.assertEqual(eval('Decimal(10) == E()'), 'eq 10') + self.assertEqual(eval('Decimal(10) != E()'), 'ne 10') + + # insert operator methods and then exercise them + oplist = [ + ('+', '__add__', '__radd__'), + ('-', '__sub__', '__rsub__'), + ('*', '__mul__', '__rmul__'), + ('/', '__truediv__', '__rtruediv__'), + ('%', '__mod__', '__rmod__'), + ('//', '__floordiv__', '__rfloordiv__'), + ('**', '__pow__', '__rpow__') + ] + + for sym, lop, rop in oplist: + setattr(E, lop, lambda self, other: 'str' + lop + str(other)) + setattr(E, rop, lambda self, other: str(other) + rop + 'str') + self.assertEqual(eval('E()' + sym + 'Decimal(10)'), + 'str' + lop + '10') + self.assertEqual(eval('Decimal(10)' + sym + 'E()'), + '10' + rop + 'str') + +class DecimalFormatTest(unittest.TestCase): + '''Unit tests for the format function.''' + def test_formatting(self): + # triples giving a format, a Decimal, and the expected result + test_values = [ + ('e', '0E-15', '0e-15'), + ('e', '2.3E-15', '2.3e-15'), + ('e', '2.30E+2', '2.30e+2'), # preserve significant zeros + ('e', '2.30000E-15', '2.30000e-15'), + ('e', '1.23456789123456789e40', '1.23456789123456789e+40'), + ('e', '1.5', '1.5e+0'), + ('e', '0.15', '1.5e-1'), + ('e', '0.015', '1.5e-2'), + ('e', '0.0000000000015', '1.5e-12'), + ('e', '15.0', '1.50e+1'), + ('e', '-15', '-1.5e+1'), + ('e', '0', '0e+0'), + ('e', '0E1', '0e+1'), + ('e', '0.0', '0e-1'), + ('e', '0.00', '0e-2'), + ('.6e', '0E-15', '0.000000e-9'), + ('.6e', '0', '0.000000e+6'), + ('.6e', '9.999999', '9.999999e+0'), + ('.6e', '9.9999999', '1.000000e+1'), + ('.6e', '-1.23e5', '-1.230000e+5'), + ('.6e', '1.23456789e-3', '1.234568e-3'), + ('f', '0', '0'), + ('f', '0.0', '0.0'), + ('f', '0E-2', '0.00'), + ('f', '0.00E-8', '0.0000000000'), + ('f', '0E1', '0'), # loses exponent information + ('f', '3.2E1', '32'), + ('f', '3.2E2', '320'), + ('f', '3.20E2', '320'), + ('f', '3.200E2', '320.0'), + ('f', '3.2E-6', '0.0000032'), + ('.6f', '0E-15', '0.000000'), # all zeros treated equally + ('.6f', '0E1', '0.000000'), + ('.6f', '0', '0.000000'), + ('.0f', '0', '0'), # no decimal point + ('.0f', '0e-2', '0'), + ('.0f', '3.14159265', '3'), + ('.1f', '3.14159265', '3.1'), + ('.4f', '3.14159265', '3.1416'), + ('.6f', '3.14159265', '3.141593'), + ('.7f', '3.14159265', '3.1415926'), # round-half-even! + ('.8f', '3.14159265', '3.14159265'), + ('.9f', '3.14159265', '3.141592650'), + + ('g', '0', '0'), + ('g', '0.0', '0.0'), + ('g', '0E1', '0e+1'), + ('G', '0E1', '0E+1'), + ('g', '0E-5', '0.00000'), + ('g', '0E-6', '0.000000'), + ('g', '0E-7', '0e-7'), + ('g', '-0E2', '-0e+2'), + ('.0g', '3.14159265', '3'), # 0 sig fig -> 1 sig fig + ('.1g', '3.14159265', '3'), + ('.2g', '3.14159265', '3.1'), + ('.5g', '3.14159265', '3.1416'), + ('.7g', '3.14159265', '3.141593'), + ('.8g', '3.14159265', '3.1415926'), # round-half-even! + ('.9g', '3.14159265', '3.14159265'), + ('.10g', '3.14159265', '3.14159265'), # don't pad + + ('%', '0E1', '0%'), + ('%', '0E0', '0%'), + ('%', '0E-1', '0%'), + ('%', '0E-2', '0%'), + ('%', '0E-3', '0.0%'), + ('%', '0E-4', '0.00%'), + + ('.3%', '0', '0.000%'), # all zeros treated equally + ('.3%', '0E10', '0.000%'), + ('.3%', '0E-10', '0.000%'), + ('.3%', '2.34', '234.000%'), + ('.3%', '1.234567', '123.457%'), + ('.0%', '1.23', '123%'), + + ('e', 'NaN', 'NaN'), + ('f', '-NaN123', '-NaN123'), + ('+g', 'NaN456', '+NaN456'), + ('.3e', 'Inf', 'Infinity'), + ('.16f', '-Inf', '-Infinity'), + ('.0g', '-sNaN', '-sNaN'), + + ('', '1.00', '1.00'), + ] + for fmt, d, result in test_values: + self.assertEqual(format(Decimal(d), fmt), result) + +class DecimalArithmeticOperatorsTest(unittest.TestCase): + '''Unit tests for all arithmetic operators, binary and unary.''' + + def test_addition(self): + + d1 = Decimal('-11.1') + d2 = Decimal('22.2') + + #two Decimals + self.assertEqual(d1+d2, Decimal('11.1')) + self.assertEqual(d2+d1, Decimal('11.1')) + + #with other type, left + c = d1 + 5 + self.assertEqual(c, Decimal('-6.1')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 5 + d1 + self.assertEqual(c, Decimal('-6.1')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 += d2 + self.assertEqual(d1, Decimal('11.1')) + + #inline with other type + d1 += 5 + self.assertEqual(d1, Decimal('16.1')) + + def test_subtraction(self): + + d1 = Decimal('-11.1') + d2 = Decimal('22.2') + + #two Decimals + self.assertEqual(d1-d2, Decimal('-33.3')) + self.assertEqual(d2-d1, Decimal('33.3')) + + #with other type, left + c = d1 - 5 + self.assertEqual(c, Decimal('-16.1')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 5 - d1 + self.assertEqual(c, Decimal('16.1')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 -= d2 + self.assertEqual(d1, Decimal('-33.3')) + + #inline with other type + d1 -= 5 + self.assertEqual(d1, Decimal('-38.3')) + + def test_multiplication(self): + + d1 = Decimal('-5') + d2 = Decimal('3') + + #two Decimals + self.assertEqual(d1*d2, Decimal('-15')) + self.assertEqual(d2*d1, Decimal('-15')) + + #with other type, left + c = d1 * 5 + self.assertEqual(c, Decimal('-25')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 5 * d1 + self.assertEqual(c, Decimal('-25')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 *= d2 + self.assertEqual(d1, Decimal('-15')) + + #inline with other type + d1 *= 5 + self.assertEqual(d1, Decimal('-75')) + + def test_division(self): + + d1 = Decimal('-5') + d2 = Decimal('2') + + #two Decimals + self.assertEqual(d1/d2, Decimal('-2.5')) + self.assertEqual(d2/d1, Decimal('-0.4')) + + #with other type, left + c = d1 / 4 + self.assertEqual(c, Decimal('-1.25')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 4 / d1 + self.assertEqual(c, Decimal('-0.8')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 /= d2 + self.assertEqual(d1, Decimal('-2.5')) + + #inline with other type + d1 /= 4 + self.assertEqual(d1, Decimal('-0.625')) + + def test_floor_division(self): + + d1 = Decimal('5') + d2 = Decimal('2') + + #two Decimals + self.assertEqual(d1//d2, Decimal('2')) + self.assertEqual(d2//d1, Decimal('0')) + + #with other type, left + c = d1 // 4 + self.assertEqual(c, Decimal('1')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 7 // d1 + self.assertEqual(c, Decimal('1')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 //= d2 + self.assertEqual(d1, Decimal('2')) + + #inline with other type + d1 //= 2 + self.assertEqual(d1, Decimal('1')) + + def test_powering(self): + + d1 = Decimal('5') + d2 = Decimal('2') + + #two Decimals + self.assertEqual(d1**d2, Decimal('25')) + self.assertEqual(d2**d1, Decimal('32')) + + #with other type, left + c = d1 ** 4 + self.assertEqual(c, Decimal('625')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 7 ** d1 + self.assertEqual(c, Decimal('16807')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 **= d2 + self.assertEqual(d1, Decimal('25')) + + #inline with other type + d1 **= 4 + self.assertEqual(d1, Decimal('390625')) + + def test_module(self): + + d1 = Decimal('5') + d2 = Decimal('2') + + #two Decimals + self.assertEqual(d1%d2, Decimal('1')) + self.assertEqual(d2%d1, Decimal('2')) + + #with other type, left + c = d1 % 4 + self.assertEqual(c, Decimal('1')) + self.assertEqual(type(c), type(d1)) + + #with other type, right + c = 7 % d1 + self.assertEqual(c, Decimal('2')) + self.assertEqual(type(c), type(d1)) + + #inline with decimal + d1 %= d2 + self.assertEqual(d1, Decimal('1')) + + #inline with other type + d1 %= 4 + self.assertEqual(d1, Decimal('1')) + + def test_floor_div_module(self): + + d1 = Decimal('5') + d2 = Decimal('2') + + #two Decimals + (p, q) = divmod(d1, d2) + self.assertEqual(p, Decimal('2')) + self.assertEqual(q, Decimal('1')) + self.assertEqual(type(p), type(d1)) + self.assertEqual(type(q), type(d1)) + + #with other type, left + (p, q) = divmod(d1, 4) + self.assertEqual(p, Decimal('1')) + self.assertEqual(q, Decimal('1')) + self.assertEqual(type(p), type(d1)) + self.assertEqual(type(q), type(d1)) + + #with other type, right + (p, q) = divmod(7, d1) + self.assertEqual(p, Decimal('1')) + self.assertEqual(q, Decimal('2')) + self.assertEqual(type(p), type(d1)) + self.assertEqual(type(q), type(d1)) + + def test_unary_operators(self): + self.assertEqual(+Decimal(45), Decimal(+45)) # + + self.assertEqual(-Decimal(45), Decimal(-45)) # - + self.assertEqual(abs(Decimal(45)), abs(Decimal(-45))) # abs + + def test_nan_comparisons(self): + n = Decimal('NaN') + s = Decimal('sNaN') + i = Decimal('Inf') + f = Decimal('2') + for x, y in [(n, n), (n, i), (i, n), (n, f), (f, n), + (s, n), (n, s), (s, i), (i, s), (s, f), (f, s), (s, s)]: + self.assert_(x != y) + self.assert_(not (x == y)) + self.assert_(not (x < y)) + self.assert_(not (x <= y)) + self.assert_(not (x > y)) + self.assert_(not (x >= y)) + +# The following are two functions used to test threading in the next class + +def thfunc1(cls): + d1 = Decimal(1) + d3 = Decimal(3) + test1 = d1/d3 + cls.synchro.wait() + test2 = d1/d3 + cls.finish1.set() + + cls.assertEqual(test1, Decimal('0.3333333333333333333333333333')) + cls.assertEqual(test2, Decimal('0.3333333333333333333333333333')) + return + +def thfunc2(cls): + d1 = Decimal(1) + d3 = Decimal(3) + test1 = d1/d3 + thiscontext = getcontext() + thiscontext.prec = 18 + test2 = d1/d3 + cls.synchro.set() + cls.finish2.set() + + cls.assertEqual(test1, Decimal('0.3333333333333333333333333333')) + cls.assertEqual(test2, Decimal('0.333333333333333333')) + return + + +class DecimalUseOfContextTest(unittest.TestCase): + '''Unit tests for Use of Context cases in Decimal.''' + + try: + import threading + except ImportError: + threading = None + + # Take care executing this test from IDLE, there's an issue in threading + # that hangs IDLE and I couldn't find it + + def test_threading(self): + #Test the "threading isolation" of a Context. + + self.synchro = threading.Event() + self.finish1 = threading.Event() + self.finish2 = threading.Event() + + th1 = threading.Thread(target=thfunc1, args=(self,)) + th2 = threading.Thread(target=thfunc2, args=(self,)) + + th1.start() + th2.start() + + self.finish1.wait() + self.finish2.wait() + return + + if threading is None: + del test_threading + + +class DecimalUsabilityTest(unittest.TestCase): + '''Unit tests for Usability cases of Decimal.''' + + def test_comparison_operators(self): + + da = Decimal('23.42') + db = Decimal('23.42') + dc = Decimal('45') + + #two Decimals + self.failUnless(dc > da) + self.failUnless(dc >= da) + self.failUnless(da < dc) + self.failUnless(da <= dc) + self.assertEqual(da, db) + 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') + self.assertNotEqual(da, 32.7) + self.assertNotEqual(da, object()) + self.assertNotEqual(da, object) + + # sortable + a = list(map(Decimal, range(100))) + b = a[:] + random.shuffle(a) + a.sort() + self.assertEqual(a, b) + + def test_copy_and_deepcopy_methods(self): + d = Decimal('43.24') + c = copy.copy(d) + self.assertEqual(id(c), id(d)) + dc = copy.deepcopy(d) + self.assertEqual(id(dc), id(d)) + + def test_hash_method(self): + #just that it's hashable + hash(Decimal(23)) + + test_values = [Decimal(sign*(2**m + n)) + for m in [0, 14, 15, 16, 17, 30, 31, + 32, 33, 62, 63, 64, 65, 66] + for n in range(-10, 10) + for sign in [-1, 1]] + test_values.extend([ + Decimal("-0"), # zeros + Decimal("0.00"), + Decimal("-0.000"), + Decimal("0E10"), + Decimal("-0E12"), + Decimal("10.0"), # negative exponent + Decimal("-23.00000"), + Decimal("1230E100"), # positive exponent + Decimal("-4.5678E50"), + # a value for which hash(n) != hash(n % (2**64-1)) + # in Python pre-2.6 + Decimal(2**64 + 2**32 - 1), + # selection of values which fail with the old (before + # version 2.6) long.__hash__ + Decimal("1.634E100"), + Decimal("90.697E100"), + Decimal("188.83E100"), + Decimal("1652.9E100"), + Decimal("56531E100"), + ]) + + # check that hash(d) == hash(int(d)) for integral values + for value in test_values: + self.assertEqual(hash(value), hash(int(value))) + + #the same hash that to an int + self.assertEqual(hash(Decimal(23)), hash(23)) + self.assertRaises(TypeError, hash, Decimal('NaN')) + self.assert_(hash(Decimal('Inf'))) + self.assert_(hash(Decimal('-Inf'))) + + # check that the value of the hash doesn't depend on the + # current context (issue #1757) + c = getcontext() + old_precision = c.prec + x = Decimal("123456789.1") + + c.prec = 6 + h1 = hash(x) + c.prec = 10 + h2 = hash(x) + c.prec = 16 + h3 = hash(x) + + self.assertEqual(h1, h2) + self.assertEqual(h1, h3) + c.prec = old_precision + + def test_min_and_max_methods(self): + + d1 = Decimal('15.32') + d2 = Decimal('28.5') + l1 = 15 + l2 = 28 + + #between Decimals + self.failUnless(min(d1,d2) is d1) + self.failUnless(min(d2,d1) is d1) + self.failUnless(max(d1,d2) is d2) + self.failUnless(max(d2,d1) is d2) + + #between Decimal and long + self.failUnless(min(d1,l2) is d1) + self.failUnless(min(l2,d1) is d1) + self.failUnless(max(l1,d2) is d2) + self.failUnless(max(d2,l1) is d2) + + def test_as_nonzero(self): + #as false + self.failIf(Decimal(0)) + #as true + self.failUnless(Decimal('0.372')) + + def test_tostring_methods(self): + #Test str and repr methods. + + d = Decimal('15.32') + self.assertEqual(str(d), '15.32') # str + self.assertEqual(repr(d), "Decimal('15.32')") # repr + + def test_tonum_methods(self): + #Test float, int and long methods. + + d1 = Decimal('66') + d2 = Decimal('15.32') + + #int + self.assertEqual(int(d1), 66) + self.assertEqual(int(d2), 15) + + #long + self.assertEqual(int(d1), 66) + self.assertEqual(int(d2), 15) + + #float + self.assertEqual(float(d1), 66) + self.assertEqual(float(d2), 15.32) + + #floor + test_pairs = [ + ('123.00', 123), + ('3.2', 3), + ('3.54', 3), + ('3.899', 3), + ('-2.3', -3), + ('-11.0', -11), + ('0.0', 0), + ('-0E3', 0), + ] + for d, i in test_pairs: + self.assertEqual(math.floor(Decimal(d)), i) + self.assertRaises(ValueError, math.floor, Decimal('-NaN')) + self.assertRaises(ValueError, math.floor, Decimal('sNaN')) + self.assertRaises(ValueError, math.floor, Decimal('NaN123')) + self.assertRaises(OverflowError, math.floor, Decimal('Inf')) + self.assertRaises(OverflowError, math.floor, Decimal('-Inf')) + + #ceiling + test_pairs = [ + ('123.00', 123), + ('3.2', 4), + ('3.54', 4), + ('3.899', 4), + ('-2.3', -2), + ('-11.0', -11), + ('0.0', 0), + ('-0E3', 0), + ] + for d, i in test_pairs: + self.assertEqual(math.ceil(Decimal(d)), i) + self.assertRaises(ValueError, math.ceil, Decimal('-NaN')) + self.assertRaises(ValueError, math.ceil, Decimal('sNaN')) + self.assertRaises(ValueError, math.ceil, Decimal('NaN123')) + self.assertRaises(OverflowError, math.ceil, Decimal('Inf')) + self.assertRaises(OverflowError, math.ceil, Decimal('-Inf')) + + #round, single argument + test_pairs = [ + ('123.00', 123), + ('3.2', 3), + ('3.54', 4), + ('3.899', 4), + ('-2.3', -2), + ('-11.0', -11), + ('0.0', 0), + ('-0E3', 0), + ('-3.5', -4), + ('-2.5', -2), + ('-1.5', -2), + ('-0.5', 0), + ('0.5', 0), + ('1.5', 2), + ('2.5', 2), + ('3.5', 4), + ] + for d, i in test_pairs: + self.assertEqual(round(Decimal(d)), i) + self.assertRaises(ValueError, round, Decimal('-NaN')) + self.assertRaises(ValueError, round, Decimal('sNaN')) + self.assertRaises(ValueError, round, Decimal('NaN123')) + self.assertRaises(OverflowError, round, Decimal('Inf')) + self.assertRaises(OverflowError, round, Decimal('-Inf')) + + #round, two arguments; this is essentially equivalent + #to quantize, which is already extensively tested + test_triples = [ + ('123.456', -4, '0E+4'), + ('123.456', -3, '0E+3'), + ('123.456', -2, '1E+2'), + ('123.456', -1, '1.2E+2'), + ('123.456', 0, '123'), + ('123.456', 1, '123.5'), + ('123.456', 2, '123.46'), + ('123.456', 3, '123.456'), + ('123.456', 4, '123.4560'), + ('123.455', 2, '123.46'), + ('123.445', 2, '123.44'), + ('Inf', 4, 'NaN'), + ('-Inf', -23, 'NaN'), + ('sNaN314', 3, 'NaN314'), + ] + for d, n, r in test_triples: + self.assertEqual(str(round(Decimal(d), n)), r) + + + + def test_eval_round_trip(self): + + #with zero + d = Decimal( (0, (0,), 0) ) + self.assertEqual(d, eval(repr(d))) + + #int + d = Decimal( (1, (4, 5), 0) ) + self.assertEqual(d, eval(repr(d))) + + #float + d = Decimal( (0, (4, 5, 3, 4), -2) ) + self.assertEqual(d, eval(repr(d))) + + #weird + d = Decimal( (1, (4, 3, 4, 9, 1, 3, 5, 3, 4), -25) ) + self.assertEqual(d, eval(repr(d))) + + def test_as_tuple(self): + + #with zero + d = Decimal(0) + self.assertEqual(d.as_tuple(), (0, (0,), 0) ) + + #int + d = Decimal(-45) + self.assertEqual(d.as_tuple(), (1, (4, 5), 0) ) + + #complicated string + d = Decimal("-4.34913534E-17") + self.assertEqual(d.as_tuple(), (1, (4, 3, 4, 9, 1, 3, 5, 3, 4), -25) ) + + #inf + d = Decimal("Infinity") + self.assertEqual(d.as_tuple(), (0, (0,), 'F') ) + + #leading zeros in coefficient should be stripped + d = Decimal( (0, (0, 0, 4, 0, 5, 3, 4), -2) ) + self.assertEqual(d.as_tuple(), (0, (4, 0, 5, 3, 4), -2) ) + d = Decimal( (1, (0, 0, 0), 37) ) + self.assertEqual(d.as_tuple(), (1, (0,), 37)) + d = Decimal( (1, (), 37) ) + self.assertEqual(d.as_tuple(), (1, (0,), 37)) + + #leading zeros in NaN diagnostic info should be stripped + d = Decimal( (0, (0, 0, 4, 0, 5, 3, 4), 'n') ) + self.assertEqual(d.as_tuple(), (0, (4, 0, 5, 3, 4), 'n') ) + d = Decimal( (1, (0, 0, 0), 'N') ) + self.assertEqual(d.as_tuple(), (1, (), 'N') ) + d = Decimal( (1, (), 'n') ) + self.assertEqual(d.as_tuple(), (1, (), 'n') ) + + #coefficient in infinity should be ignored + d = Decimal( (0, (4, 5, 3, 4), 'F') ) + self.assertEqual(d.as_tuple(), (0, (0,), 'F')) + d = Decimal( (1, (0, 2, 7, 1), 'F') ) + self.assertEqual(d.as_tuple(), (1, (0,), 'F')) + + def test_immutability_operations(self): + # Do operations and check that it didn't change change internal objects. + + d1 = Decimal('-25e55') + b1 = Decimal('-25e55') + d2 = Decimal('33e+33') + b2 = Decimal('33e+33') + + def checkSameDec(operation, useOther=False): + if useOther: + eval("d1." + operation + "(d2)") + self.assertEqual(d1._sign, b1._sign) + self.assertEqual(d1._int, b1._int) + self.assertEqual(d1._exp, b1._exp) + self.assertEqual(d2._sign, b2._sign) + self.assertEqual(d2._int, b2._int) + self.assertEqual(d2._exp, b2._exp) + else: + eval("d1." + operation + "()") + self.assertEqual(d1._sign, b1._sign) + self.assertEqual(d1._int, b1._int) + self.assertEqual(d1._exp, b1._exp) + return + + Decimal(d1) + self.assertEqual(d1._sign, b1._sign) + self.assertEqual(d1._int, b1._int) + self.assertEqual(d1._exp, b1._exp) + + checkSameDec("__abs__") + checkSameDec("__add__", True) + checkSameDec("__divmod__", True) + checkSameDec("__eq__", True) + checkSameDec("__ne__", True) + checkSameDec("__le__", True) + checkSameDec("__lt__", True) + checkSameDec("__ge__", True) + checkSameDec("__gt__", True) + checkSameDec("__float__") + checkSameDec("__floordiv__", True) + checkSameDec("__hash__") + checkSameDec("__int__") + checkSameDec("__trunc__") + checkSameDec("__mod__", True) + checkSameDec("__mul__", True) + checkSameDec("__neg__") + checkSameDec("__bool__") + checkSameDec("__pos__") + checkSameDec("__pow__", True) + checkSameDec("__radd__", True) + checkSameDec("__rdivmod__", True) + checkSameDec("__repr__") + checkSameDec("__rfloordiv__", True) + checkSameDec("__rmod__", True) + checkSameDec("__rmul__", True) + checkSameDec("__rpow__", True) + checkSameDec("__rsub__", True) + checkSameDec("__str__") + checkSameDec("__sub__", True) + checkSameDec("__truediv__", True) + checkSameDec("adjusted") + checkSameDec("as_tuple") + checkSameDec("compare", True) + checkSameDec("max", True) + checkSameDec("min", True) + checkSameDec("normalize") + checkSameDec("quantize", True) + checkSameDec("remainder_near", True) + checkSameDec("same_quantum", True) + checkSameDec("sqrt") + checkSameDec("to_eng_string") + checkSameDec("to_integral") + + def test_subclassing(self): + # Different behaviours when subclassing Decimal + + class MyDecimal(Decimal): + pass + + d1 = MyDecimal(1) + d2 = MyDecimal(2) + d = d1 + d2 + self.assertTrue(type(d) is Decimal) + + d = d1.max(d2) + self.assertTrue(type(d) is Decimal) + + def test_implicit_context(self): + # Check results when context given implicitly. (Issue 2478) + c = getcontext() + self.assertEqual(str(Decimal(0).sqrt()), + str(c.sqrt(Decimal(0)))) + + +class DecimalPythonAPItests(unittest.TestCase): + + def test_pickle(self): + d = Decimal('-3.141590000') + p = pickle.dumps(d) + e = pickle.loads(p) + self.assertEqual(d, e) + + def test_int(self): + for x in range(-250, 250): + s = '%0.2f' % (x / 100.0) + # should work the same as for floats + self.assertEqual(int(Decimal(s)), int(float(s))) + # should work the same as to_integral in the ROUND_DOWN mode + d = Decimal(s) + r = d.to_integral(ROUND_DOWN) + self.assertEqual(Decimal(int(d)), r) + + def test_trunc(self): + for x in range(-250, 250): + s = '%0.2f' % (x / 100.0) + # should work the same as for floats + self.assertEqual(int(Decimal(s)), int(float(s))) + # should work the same as to_integral in the ROUND_DOWN mode + d = Decimal(s) + r = d.to_integral(ROUND_DOWN) + self.assertEqual(Decimal(math.trunc(d)), r) + + def test_from_float(self): + + class MyDecimal(Decimal): + pass + + r = MyDecimal.from_float(0.1) + self.assertEqual(type(r), MyDecimal) + self.assertEqual(str(r), + '0.1000000000000000055511151231257827021181583404541015625') + bigint = 12345678901234567890123456789 + self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) + self.assert_(MyDecimal.from_float(float('nan')).is_qnan()) + self.assert_(MyDecimal.from_float(float('inf')).is_infinite()) + self.assert_(MyDecimal.from_float(float('-inf')).is_infinite()) + self.assertEqual(str(MyDecimal.from_float(float('nan'))), + str(Decimal('NaN'))) + self.assertEqual(str(MyDecimal.from_float(float('inf'))), + str(Decimal('Infinity'))) + self.assertEqual(str(MyDecimal.from_float(float('-inf'))), + str(Decimal('-Infinity'))) + self.assertRaises(TypeError, MyDecimal.from_float, 'abc') + for i in range(200): + x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0) + self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip + + def test_create_decimal_from_float(self): + context = Context(prec=5, rounding=ROUND_DOWN) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1415') + ) + context = Context(prec=5, rounding=ROUND_UP) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1416') + ) + context = Context(prec=5, traps=[Inexact]) + self.assertRaises( + Inexact, + context.create_decimal_from_float, + math.pi + ) + self.assertEqual(repr(context.create_decimal_from_float(-0.0)), + "Decimal('-0')") + self.assertEqual(repr(context.create_decimal_from_float(1.0)), + "Decimal('1')") + self.assertEqual(repr(context.create_decimal_from_float(10)), + "Decimal('10')") + +class ContextAPItests(unittest.TestCase): + + def test_pickle(self): + c = Context() + e = pickle.loads(pickle.dumps(c)) + for k in vars(c): + v1 = vars(c)[k] + v2 = vars(e)[k] + self.assertEqual(v1, v2) + + def test_equality_with_other_types(self): + self.assert_(Decimal(10) in ['a', 1.0, Decimal(10), (1,2), {}]) + self.assert_(Decimal(10) not in ['a', 1.0, (1,2), {}]) + + def test_copy(self): + # All copies should be deep + c = Context() + d = c.copy() + self.assertNotEqual(id(c), id(d)) + self.assertNotEqual(id(c.flags), id(d.flags)) + self.assertNotEqual(id(c.traps), id(d.traps)) + +class WithStatementTest(unittest.TestCase): + # Can't do these as docstrings until Python 2.6 + # as doctest can't handle __future__ statements + + def test_localcontext(self): + # Use a copy of the current context in the block + orig_ctx = getcontext() + with localcontext() as enter_ctx: + set_ctx = getcontext() + final_ctx = getcontext() + self.assert_(orig_ctx is final_ctx, 'did not restore context correctly') + self.assert_(orig_ctx is not set_ctx, 'did not copy the context') + self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context') + + def test_localcontextarg(self): + # Use a copy of the supplied context in the block + orig_ctx = getcontext() + new_ctx = Context(prec=42) + with localcontext(new_ctx) as enter_ctx: + set_ctx = getcontext() + final_ctx = getcontext() + self.assert_(orig_ctx is final_ctx, 'did not restore context correctly') + self.assert_(set_ctx.prec == new_ctx.prec, 'did not set correct context') + self.assert_(new_ctx is not set_ctx, 'did not copy the context') + self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context') + +class ContextFlags(unittest.TestCase): + def test_flags_irrelevant(self): + # check that the result (numeric result + flags raised) of an + # arithmetic operation doesn't depend on the current flags + + context = Context(prec=9, Emin = -999999999, Emax = 999999999, + rounding=ROUND_HALF_EVEN, traps=[], flags=[]) + + # operations that raise various flags, in the form (function, arglist) + operations = [ + (context._apply, [Decimal("100E-1000000009")]), + (context.sqrt, [Decimal(2)]), + (context.add, [Decimal("1.23456789"), Decimal("9.87654321")]), + (context.multiply, [Decimal("1.23456789"), Decimal("9.87654321")]), + (context.subtract, [Decimal("1.23456789"), Decimal("9.87654321")]), + ] + + # try various flags individually, then a whole lot at once + flagsets = [[Inexact], [Rounded], [Underflow], [Clamped], [Subnormal], + [Inexact, Rounded, Underflow, Clamped, Subnormal]] + + for fn, args in operations: + # find answer and flags raised using a clean context + context.clear_flags() + ans = fn(*args) + flags = [k for k, v in context.flags.items() if v] + + for extra_flags in flagsets: + # set flags, before calling operation + context.clear_flags() + for flag in extra_flags: + context._raise_error(flag) + new_ans = fn(*args) + + # flags that we expect to be set after the operation + expected_flags = list(flags) + for flag in extra_flags: + if flag not in expected_flags: + expected_flags.append(flag) + expected_flags.sort(key=id) + + # flags we actually got + new_flags = [k for k,v in context.flags.items() if v] + new_flags.sort(key=id) + + self.assertEqual(ans, new_ans, + "operation produces different answers depending on flags set: " + + "expected %s, got %s." % (ans, new_ans)) + self.assertEqual(new_flags, expected_flags, + "operation raises different flags depending on flags set: " + + "expected %s, got %s" % (expected_flags, new_flags)) + +def test_main(arith=False, verbose=None, todo_tests=None, debug=None): + """ Execute the tests. + + Runs all arithmetic tests if arith is True or if the "decimal" resource + is enabled in regrtest.py + """ + + init() + global TEST_ALL, DEBUG + TEST_ALL = arith or is_resource_enabled('decimal') + DEBUG = debug + + if todo_tests is None: + test_classes = [ + DecimalExplicitConstructionTest, + DecimalImplicitConstructionTest, + DecimalArithmeticOperatorsTest, + DecimalFormatTest, + DecimalUseOfContextTest, + DecimalUsabilityTest, + DecimalPythonAPItests, + ContextAPItests, + DecimalTest, + WithStatementTest, + ContextFlags + ] + else: + test_classes = [DecimalTest] + + # Dynamically build custom test definition for each file in the test + # directory and add the definitions to the DecimalTest class. This + # procedure insures that new files do not get skipped. + for filename in os.listdir(directory): + if '.decTest' not in filename or filename.startswith("."): + continue + head, tail = filename.split('.') + if todo_tests is not None and head not in todo_tests: + continue + tester = lambda self, f=filename: self.eval_file(directory + f) + setattr(DecimalTest, 'test_' + head, tester) + del filename, head, tail, tester + + + try: + run_unittest(*test_classes) + if todo_tests is None: + import decimal as DecimalModule + run_doctest(DecimalModule, verbose) + finally: + setcontext(ORIGINAL_CONTEXT) + +if __name__ == '__main__': + import optparse + p = optparse.OptionParser("test_decimal.py [--debug] [{--skip | test1 [test2 [...]]}]") + p.add_option('--debug', '-d', action='store_true', help='shows the test number and context before each test') + p.add_option('--skip', '-s', action='store_true', help='skip over 90% of the arithmetic tests') + (opt, args) = p.parse_args() + + if opt.skip: + test_main(arith=False, verbose=True) + elif args: + test_main(arith=True, verbose=True, todo_tests=args, debug=opt.debug) + else: + test_main(arith=True, verbose=True) From python-checkins at python.org Sat Jan 10 18:36:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 18:36:45 +0100 (CET) Subject: [Python-checkins] r68495 - python/trunk/Doc/c-api/typeobj.rst Message-ID: <20090110173645.0A8E11E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 18:36:44 2009 New Revision: 68495 Log: tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 Modified: python/trunk/Doc/c-api/typeobj.rst Modified: python/trunk/Doc/c-api/typeobj.rst ============================================================================== --- python/trunk/Doc/c-api/typeobj.rst (original) +++ python/trunk/Doc/c-api/typeobj.rst Sat Jan 10 18:36:44 2009 @@ -743,7 +743,7 @@ :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its base type. -The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_CLASS` flag bit is +The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_ITER` flag bit is set. From buildbot at python.org Sat Jan 10 18:50:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 17:50:35 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090110175035.437161E4002@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/104 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: benjamin.peterson,matthias.klose 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 Sat Jan 10 19:02:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 18:02:48 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090110180248.1EA601E4002@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/90 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,matthias.klose BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Sat Jan 10 19:33:21 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 19:33:21 +0100 (CET) Subject: [Python-checkins] r68496 - python/trunk/Misc/ACKS Message-ID: <20090110183321.D77081E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 19:33:21 2009 New Revision: 68496 Log: Add ACKS entries for some of the patches I've been committing. Modified: python/trunk/Misc/ACKS Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat Jan 10 19:33:21 2009 @@ -84,6 +84,7 @@ Sebastian Boving Monty Brandenberg Georg Brandl +Christopher Brannon Terrence Brannon Dave Brennan Tom Bridgman @@ -178,6 +179,7 @@ Quinn Dunkan Robin Dunn Luke Dunstan +Virgil Dupras Andy Dustman Gary Duzan Eugene Dvurechenski @@ -245,6 +247,7 @@ Harry Henry Gebel Marius Gedminas Thomas Gellekum +Gabriel Genellina Christos Georgiou Ben Gertzfield Dinu Gherman @@ -312,6 +315,7 @@ Naofumi Honda Jeffrey Honig Rob Hooft +Michiel de Hoon Brian Hooper Randall Hopper Nadav Horesh @@ -372,6 +376,7 @@ Taek Joo Kim Paul Kippes Steve Kirsch +Sebastian Kirsche Ron Klatchko Bastian Kleineidam Bob Kline @@ -427,6 +432,7 @@ Jason Lowe Tony Lownds Ray Loyzaga +Lukas Lueg Loren Luke Fredrik Lundh Mark Lutz From python-checkins at python.org Sat Jan 10 19:38:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 19:38:45 +0100 (CET) Subject: [Python-checkins] r68497 - in python/branches/py3k: Misc/ACKS Message-ID: <20090110183845.664BA1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 19:38:45 2009 New Revision: 68497 Log: Merged revisions 68496 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68496 | antoine.pitrou | 2009-01-10 19:33:21 +0100 (sam., 10 janv. 2009) | 3 lines Add ACKS entries for some of the patches I've been committing. ........ 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 Sat Jan 10 19:38:45 2009 @@ -83,6 +83,7 @@ Sebastian Boving Monty Brandenberg Georg Brandl +Christopher Brannon Terrence Brannon Dave Brennan Tom Bridgman @@ -178,6 +179,7 @@ Quinn Dunkan Robin Dunn Luke Dunstan +Virgil Dupras Andy Dustman Gary Duzan Eugene Dvurechenski @@ -246,6 +248,7 @@ Harry Henry Gebel Marius Gedminas Thomas Gellekum +Gabriel Genellina Christos Georgiou Ben Gertzfield Dinu Gherman @@ -313,6 +316,7 @@ Naofumi Honda Jeffrey Honig Rob Hooft +Michiel de Hoon Brian Hooper Randall Hopper Nadav Horesh @@ -373,6 +377,7 @@ Taek Joo Kim Paul Kippes Steve Kirsch +Sebastian Kirsche Ron Klatchko Bastian Kleineidam Bob Kline @@ -428,6 +433,7 @@ Jason Lowe Tony Lownds Ray Loyzaga +Lukas Lueg Loren Luke Fredrik Lundh Mark Lutz From buildbot at python.org Sat Jan 10 19:59:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 18:59:22 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090110185922.8639F1E4002@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/505 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 BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 10 20:08:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 20:08:49 +0100 (CET) Subject: [Python-checkins] r68498 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090110190849.862011E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 20:08:49 2009 New Revision: 68498 Log: fix encoding Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sat Jan 10 20:08:49 2009 @@ -60,7 +60,7 @@ .. ======================================================================== -Kristj?n Valur J?nsson, issue 4293 +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. From python-checkins at python.org Sat Jan 10 20:14:55 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 10 Jan 2009 20:14:55 +0100 (CET) Subject: [Python-checkins] r68499 - python/trunk/Lib/test/test_decimal.py Message-ID: <20090110191455.9AB511E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 10 20:14:55 2009 New Revision: 68499 Log: Remove an unnecessary check from test_decimal. Modified: python/trunk/Lib/test/test_decimal.py Modified: python/trunk/Lib/test/test_decimal.py ============================================================================== --- python/trunk/Lib/test/test_decimal.py (original) +++ python/trunk/Lib/test/test_decimal.py Sat Jan 10 20:14:55 2009 @@ -168,7 +168,6 @@ -context.Emin > DEC_MAX_MATH): return True if not v._is_special and v and ( - len(v._int) > DEC_MAX_MATH or v.adjusted() > DEC_MAX_MATH or v.adjusted() < 1-2*DEC_MAX_MATH): return True From python-checkins at python.org Sat Jan 10 20:16:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 10 Jan 2009 20:16:41 +0100 (CET) Subject: [Python-checkins] r68500 - in python/branches/py3k: Lib/test/test_decimal.py Message-ID: <20090110191641.03DEE1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 10 20:16:40 2009 New Revision: 68500 Log: Merged revisions 68499 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68499 | mark.dickinson | 2009-01-10 19:14:55 +0000 (Sat, 10 Jan 2009) | 2 lines Remove an unnecessary check from test_decimal. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_decimal.py 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 Sat Jan 10 20:16:40 2009 @@ -168,7 +168,6 @@ -context.Emin > DEC_MAX_MATH): return True if not v._is_special and v and ( - len(v._int) > DEC_MAX_MATH or v.adjusted() > DEC_MAX_MATH or v.adjusted() < 1-2*DEC_MAX_MATH): return True From python-checkins at python.org Sat Jan 10 20:22:57 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 10 Jan 2009 20:22:57 +0100 (CET) Subject: [Python-checkins] r68501 - python/trunk/Doc/library/logging.rst Message-ID: <20090110192257.760661E4002@bag.python.org> Author: vinay.sajip Date: Sat Jan 10 20:22:57 2009 New Revision: 68501 Log: Corrected minor typo and added .currentmodule directives to fix missing cross-references. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Sat Jan 10 20:22:57 2009 @@ -121,7 +121,7 @@ messages at different log levels. This allows you to instrument your code with debug messages, for example, but turning the log level down so that those debug messages are not written for your production system. The default levels are -``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``. +``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``. The logger, handler, and log message call each specify a level. The log message is only emitted if the handler and logger are configured to emit messages of @@ -532,6 +532,8 @@ #. :class:`FileHandler` instances send error messages to disk files. +.. currentmodule:: logging.handlers + #. :class:`BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated directly. Instead, use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. @@ -561,6 +563,13 @@ #. :class:`HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. +#. :class:`WatchedFileHandler` instances watch the file they are logging to. If +the file changes, it is closed and reopened using the file name. This handler +is only useful on Unix-like systems; Windows does not support the underlying +mechanism used. + +.. currentmodule:: logging + #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if From python-checkins at python.org Sat Jan 10 20:23:34 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 10 Jan 2009 20:23:34 +0100 (CET) Subject: [Python-checkins] r68502 - python/branches/py3k/Doc/library/logging.rst Message-ID: <20090110192334.931A21E4002@bag.python.org> Author: vinay.sajip Date: Sat Jan 10 20:23:34 2009 New Revision: 68502 Log: Corrected minor typo and added .currentmodule directives to fix missing cross-references. Modified: python/branches/py3k/Doc/library/logging.rst Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Sat Jan 10 20:23:34 2009 @@ -119,7 +119,7 @@ messages at different log levels. This allows you to instrument your code with debug messages, for example, but turning the log level down so that those debug messages are not written for your production system. The default levels are -``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``. +``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``. The logger, handler, and log message call each specify a level. The log message is only emitted if the handler and logger are configured to emit messages of @@ -421,6 +421,7 @@ noncoders to easily modify the logging properties. .. _library-config: + Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -529,6 +530,8 @@ #. :class:`FileHandler` instances send error messages to disk files. +.. currentmodule:: logging.handlers + #. :class:`BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated directly. Instead, use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. @@ -558,6 +561,13 @@ #. :class:`HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. +#. :class:`WatchedFileHandler` instances watch the file they are logging to. If +the file changes, it is closed and reopened using the file name. This handler +is only useful on Unix-like systems; Windows does not support the underlying +mechanism used. + +.. currentmodule:: logging + #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if @@ -1618,8 +1628,6 @@ .. module:: logging.handlers -.. module:: logging.handlers - The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. From buildbot at python.org Sat Jan 10 20:26:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 19:26:30 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090110192630.2E31B1E4002@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/680 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 10 21:14:50 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 21:14:50 +0100 (CET) Subject: [Python-checkins] r68503 - sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Message-ID: <20090110201450.048561E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 21:14:49 2009 New Revision: 68503 Log: use variable Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Sat Jan 10 21:14:49 2009 @@ -121,12 +121,13 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[import_mod.value] + mod_name = import_mod.value + new_name = self.mapping[mod_name] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, # marked its usage to be replaced. - self.replace[import_mod.value] = new_name + self.replace[mod_name] = new_name if "multiple_imports" in results: # This is a nasty hack to fix multiple imports on a # line (e.g., "import StringIO, urlparse"). The problem is that I From python-checkins at python.org Sat Jan 10 21:16:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 21:16:14 +0100 (CET) Subject: [Python-checkins] r68504 - sandbox/trunk/io-c/_textio.c Message-ID: <20090110201614.90F0D1E400C@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 21:16:14 2009 New Revision: 68504 Log: Speedup TextIOWrapper.__init__ by bypassing method call overhead in the common case. Good for a 50% speedup in "for line in f: pass" Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 10 21:16:14 2009 @@ -926,17 +926,12 @@ static PyObject * -TextIOWrapper_readline(PyTextIOWrapperObject *self, PyObject *args) +_TextIOWrapper_readline(PyTextIOWrapperObject *self, Py_ssize_t limit) { - Py_ssize_t limit = -1; PyObject *line; Py_ssize_t start, endpos; int res; - if (!PyArg_ParseTuple(args, "|n:readline", &limit)) { - return NULL; - } - if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) return NULL; @@ -1069,6 +1064,17 @@ return NULL; } +static PyObject * +TextIOWrapper_readline(PyTextIOWrapperObject *self, PyObject *args) +{ + Py_ssize_t limit = -1; + + if (!PyArg_ParseTuple(args, "|n:readline", &limit)) { + return NULL; + } + return _TextIOWrapper_readline(self, limit); +} + /* Seek and Tell */ #if defined(MS_WIN64) || defined(MS_WINDOWS) @@ -1573,7 +1579,15 @@ self->telling = 0; - line = PyObject_CallMethod((PyObject *)self, "readline", NULL); + if (Py_TYPE(self) == &PyTextIOWrapper_Type) { + /* Skip method call overhead for speed */ + line = _TextIOWrapper_readline(self, -1); + } + else { + line = PyObject_CallMethodObjArgs((PyObject *)self, + _PyIO_str_readline, NULL); + /* TODO: check return type */ + } if (line == NULL) return NULL; @@ -1581,6 +1595,7 @@ assert (PyUnicode_Check(line)); if (PyUnicode_GET_SIZE(line) == 0) { + /* Reached EOF or would have blocked */ Py_DECREF(line); Py_CLEAR(self->snapshot); self->telling = self->seekable; From buildbot at python.org Sat Jan 10 21:17:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 20:17:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090110201712.C4C711E4002@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/92 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,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Sat Jan 10 21:59:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 21:59:11 +0100 (CET) Subject: [Python-checkins] r68505 - in sandbox/trunk/io-c: _textio.c test_io.py Message-ID: <20090110205911.89CE91E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 21:59:11 2009 New Revision: 68505 Log: Fix readline() bug on NUL chars (Py_UNICODE_strchr stops at the first NUL character!) Modified: sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 10 21:59:11 2009 @@ -924,6 +924,29 @@ return NULL; } +static Py_UNICODE * +find_LF(Py_UNICODE *start, Py_UNICODE *end) +{ + Py_UNICODE *s = start; + while (s < end) { + if (*s == '\n') + return s; + s++; + } + return NULL; +} + +static Py_UNICODE * +find_CR(Py_UNICODE *start, Py_UNICODE *end) +{ + Py_UNICODE *s = start; + while (s < end) { + if (*s == '\r') + return s; + s++; + } + return NULL; +} static PyObject * _TextIOWrapper_readline(PyTextIOWrapperObject *self, Py_ssize_t limit) @@ -948,7 +971,8 @@ Py_UNICODE* ptr = PyUnicode_AS_UNICODE(line); if (self->readtranslate) { /* Newlines are already translated, only search for \n */ - Py_UNICODE* pos = Py_UNICODE_strchr(ptr + start, '\n'); + Py_UNICODE *pos = find_LF(ptr + start, + ptr + PyUnicode_GET_SIZE(line)); if (pos != NULL) { endpos = pos - ptr + 1; break; @@ -964,8 +988,10 @@ /* In C we'd look for these in parallel of course. * XXX Hey! */ - Py_UNICODE* nlpos = Py_UNICODE_strchr(ptr + start, '\n'); - Py_UNICODE* crpos = Py_UNICODE_strchr(ptr + start, '\r'); + Py_UNICODE* nlpos = find_LF(ptr + start, + ptr + PyUnicode_GET_SIZE(line)); + Py_UNICODE* crpos = find_CR(ptr + start, + ptr + PyUnicode_GET_SIZE(line)); if (crpos == NULL) { if (nlpos == NULL) { /* Nothing found */ Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Sat Jan 10 21:59:11 2009 @@ -232,14 +232,15 @@ def test_readline(self): f = io.open(support.TESTFN, "wb") - f.write(b"abc\ndef\nxyzzy\nfoo") + f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line") f.close() f = io.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") self.assertEqual(f.readline(4), b"zzy\n") - self.assertEqual(f.readline(), b"foo") + self.assertEqual(f.readline(), b"foo\x00bar\n") + self.assertEqual(f.readline(), b"another line") f.close() def test_raw_bytes_io(self): @@ -1226,14 +1227,14 @@ self.assertEquals(len(got_lines), len(exp_lines)) def testNewlinesInput(self): - testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" + 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 [ (None, normalized.decode("ascii").splitlines(True)), ("", testdata.decode("ascii").splitlines(True)), - ("\n", ["AAA\n", "BBB\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r\n", ["AAA\nBBB\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r", ["AAA\nBBB\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]), + ("\n", ["AAA\n", "BB\x00B\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), + ("\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) From python-checkins at python.org Sat Jan 10 22:02:27 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 22:02:27 +0100 (CET) Subject: [Python-checkins] r68506 - sandbox/trunk/io-c/test_io.py Message-ID: <20090110210227.E6D241E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 22:02:27 2009 New Revision: 68506 Log: testNewlinesInput and testNewlinesOutput were duplicated, dump one of each Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Sat Jan 10 22:02:27 2009 @@ -1150,40 +1150,6 @@ t.flush() self.assertEquals(b.getvalue(), b"abc?def\n") - def testNewlinesInput(self): - testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" - normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n") - for newline, expected in [ - (None, normalized.decode("ascii").splitlines(True)), - ("", testdata.decode("ascii").splitlines(True)), - ("\n", ["AAA\n", "BBB\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r\n", ["AAA\nBBB\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r", ["AAA\nBBB\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]), - ]: - buf = io.BytesIO(testdata) - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) - self.assertEquals(txt.readlines(), expected) - txt.seek(0) - self.assertEquals(txt.read(), "".join(expected)) - - def testNewlinesOutput(self): - testdict = { - "": b"AAA\nBBB\nCCC\nX\rY\r\nZ", - "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ", - "\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ", - "\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ", - } - tests = [(None, testdict[os.linesep])] + sorted(testdict.items()) - for newline, expected in tests: - buf = io.BytesIO() - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) - txt.write("AAA\nB") - txt.write("BB\nCCC\n") - txt.write("X\rY\r\nZ") - txt.flush() - self.assertEquals(buf.closed, False) - self.assertEquals(buf.getvalue(), expected) - def testNewlines(self): input_lines = [ "unix\n", "windows\r\n", "os9\r", "last\n", "nonl" ] @@ -1243,32 +1209,22 @@ self.assertEquals(txt.read(), "".join(expected)) def testNewlinesOutput(self): - data = "AAA\nBBB\rCCC\n" - data_lf = b"AAA\nBBB\rCCC\n" - data_cr = b"AAA\rBBB\rCCC\r" - data_crlf = b"AAA\r\nBBB\rCCC\r\n" - save_linesep = os.linesep - try: - for os.linesep, newline, expected in [ - ("\n", None, data_lf), - ("\r\n", None, data_crlf), - ("\n", "", data_lf), - ("\r\n", "", data_lf), - ("\n", "\n", data_lf), - ("\r\n", "\n", data_lf), - ("\n", "\r", data_cr), - ("\r\n", "\r", data_cr), - ("\n", "\r\n", data_crlf), - ("\r\n", "\r\n", data_crlf), - ]: - buf = io.BytesIO() - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) - txt.write(data) - txt.close() - self.assertEquals(buf.closed, True) - self.assertRaises(ValueError, buf.getvalue) - finally: - os.linesep = save_linesep + testdict = { + "": b"AAA\nBBB\nCCC\nX\rY\r\nZ", + "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ", + "\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ", + "\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ", + } + tests = [(None, testdict[os.linesep])] + sorted(testdict.items()) + for newline, expected in tests: + buf = io.BytesIO() + txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) + txt.write("AAA\nB") + txt.write("BB\nCCC\n") + txt.write("X\rY\r\nZ") + txt.flush() + self.assertEquals(buf.closed, False) + self.assertEquals(buf.getvalue(), expected) def testDestructor(self): l = [] From python-checkins at python.org Sat Jan 10 22:13:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 22:13:16 +0100 (CET) Subject: [Python-checkins] r68507 - sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Message-ID: <20090110211316.F01FB1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 22:13:16 2009 New Revision: 68507 Log: rewrap Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Sat Jan 10 22:13:16 2009 @@ -129,10 +129,10 @@ # marked its usage to be replaced. self.replace[mod_name] = new_name if "multiple_imports" in results: - # This is a nasty hack to fix multiple imports on a - # line (e.g., "import StringIO, urlparse"). The problem is that I - # can't figure out an easy way to make a pattern recognize the - # keys of MAPPING randomly sprinkled in an import statement. + # This is a nasty hack to fix multiple imports on a line (e.g., + # "import StringIO, urlparse"). The problem is that I can't + # figure out an easy way to make a pattern recognize the keys of + # MAPPING randomly sprinkled in an import statement. results = self.match(node) if results: self.transform(node, results) From python-checkins at python.org Sat Jan 10 23:14:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 10 Jan 2009 23:14:34 +0100 (CET) Subject: [Python-checkins] r68508 - in python/branches/py3k: Doc/c-api/number.rst Include/abstract.h Objects/typeobject.c Message-ID: <20090110221434.1574D1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 10 23:14:33 2009 New Revision: 68508 Log: Issue #4910: replace "long" with "int" in docstring for __long__ slot and in documentation for PyNumber_Long. Modified: python/branches/py3k/Doc/c-api/number.rst python/branches/py3k/Include/abstract.h python/branches/py3k/Objects/typeobject.c 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 Sat Jan 10 23:14:33 2009 @@ -230,19 +230,16 @@ .. cfunction:: PyObject* PyNumber_Int(PyObject *o) - .. index:: builtin: int - - Returns the *o* converted to an integer object on success, or *NULL* on failure. - If the argument is outside the integer range a long object will be returned - instead. This is the equivalent of the Python expression ``int(o)``. + Returns the *o* converted to an integer object on success, or *NULL* on + failure. This is the equivalent of the Python expression ``int(o)``. .. cfunction:: PyObject* PyNumber_Long(PyObject *o) - .. index:: builtin: long + .. index:: builtin: int Returns the *o* converted to an integer object on success, or *NULL* on - failure. This is the equivalent of the Python expression ``long(o)``. + failure. This is the equivalent of the Python expression ``int(o)``. .. cfunction:: PyObject* PyNumber_Float(PyObject *o) Modified: python/branches/py3k/Include/abstract.h ============================================================================== --- python/branches/py3k/Include/abstract.h (original) +++ python/branches/py3k/Include/abstract.h Sat Jan 10 23:14:33 2009 @@ -808,20 +808,14 @@ #define PyNumber_Int PyNumber_Long + PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); + /* Returns the o converted to an integer object on success, or NULL on failure. This is the equivalent of the Python expression: int(o). */ - PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); - - /* - Returns the o converted to a long integer object on success, - or NULL on failure. This is the equivalent of the Python - expression: long(o). - */ - PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o); /* Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sat Jan 10 23:14:33 2009 @@ -5444,7 +5444,7 @@ UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc, "int(x)"), UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc, - "long(x)"), + "int(x)"), UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc, "float(x)"), NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, From python-checkins at python.org Sat Jan 10 23:18:36 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 10 Jan 2009 23:18:36 +0100 (CET) Subject: [Python-checkins] r68509 - in python/branches/release30-maint: Doc/c-api/number.rst Include/abstract.h Objects/typeobject.c Message-ID: <20090110221836.ADECE1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 10 23:18:36 2009 New Revision: 68509 Log: Merged revisions 68508 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68508 | mark.dickinson | 2009-01-10 22:14:33 +0000 (Sat, 10 Jan 2009) | 3 lines Issue #4910: replace "long" with "int" in docstring for __long__ slot and in documentation for PyNumber_Long. ........ 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/Objects/typeobject.c 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 Sat Jan 10 23:18:36 2009 @@ -230,19 +230,16 @@ .. cfunction:: PyObject* PyNumber_Int(PyObject *o) - .. index:: builtin: int - - Returns the *o* converted to an integer object on success, or *NULL* on failure. - If the argument is outside the integer range a long object will be returned - instead. This is the equivalent of the Python expression ``int(o)``. + Returns the *o* converted to an integer object on success, or *NULL* on + failure. This is the equivalent of the Python expression ``int(o)``. .. cfunction:: PyObject* PyNumber_Long(PyObject *o) - .. index:: builtin: long + .. index:: builtin: int Returns the *o* converted to an integer object on success, or *NULL* on - failure. This is the equivalent of the Python expression ``long(o)``. + failure. This is the equivalent of the Python expression ``int(o)``. .. cfunction:: PyObject* PyNumber_Float(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 Sat Jan 10 23:18:36 2009 @@ -808,20 +808,14 @@ #define PyNumber_Int PyNumber_Long + PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); + /* Returns the o converted to an integer object on success, or NULL on failure. This is the equivalent of the Python expression: int(o). */ - PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); - - /* - Returns the o converted to a long integer object on success, - or NULL on failure. This is the equivalent of the Python - expression: long(o). - */ - PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o); /* Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sat Jan 10 23:18:36 2009 @@ -5444,7 +5444,7 @@ UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc, "int(x)"), UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc, - "long(x)"), + "int(x)"), UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc, "float(x)"), NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, From python-checkins at python.org Sat Jan 10 23:35:55 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 10 Jan 2009 23:35:55 +0100 (CET) Subject: [Python-checkins] r68510 - sandbox/trunk/io-c/_textio.c Message-ID: <20090110223555.682ED1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 10 23:35:55 2009 New Revision: 68510 Log: Slightly faster newline detection Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 10 23:35:55 2009 @@ -180,7 +180,7 @@ all in one pass. */ { Py_UNICODE *in_str; - Py_ssize_t in, len; + Py_ssize_t len; int seennl = self->seennl; int only_lf; @@ -197,26 +197,33 @@ && !memchr(in_str, '\r', len * sizeof(Py_UNICODE))); if (!self->translate) { + Py_UNICODE *s, *end; if (seennl == SEEN_ALL) goto endscan; if (only_lf) goto endscan; - for (in = 0; in < len;) { - Py_UNICODE c = in_str[in++]; - if (c >= 0x20) - continue; + s = in_str; + end = in_str + len; + for (;;) { + Py_UNICODE c; + /* Fast loop for non-control characters */ + while (*s > '\r') + s++; + c = *s++; if (c == '\n') seennl |= SEEN_LF; else if (c == '\r') { - if (in_str[in] == '\n') { + if (*s == '\n') { seennl |= SEEN_CRLF; - in++; + s++; } else seennl |= SEEN_CR; } + if (s > end) + break; if (seennl == SEEN_ALL) - goto endscan; + break; } endscan: ; @@ -224,7 +231,7 @@ else if (!only_lf) { PyObject *translated = NULL; Py_UNICODE *out_str; - Py_ssize_t out; + Py_UNICODE *in, *out, *end; if (Py_REFCNT(output) != 1) { /* We could try to optimize this so that we only do a copy when there is something to translate. On the other hand, @@ -242,35 +249,39 @@ translated = output; } out_str = PyUnicode_AS_UNICODE(translated); - for (in = 0, out = 0; in < len;) { - Py_UNICODE c = in_str[in++]; - if (c >= 0x20) { - out_str[out++] = c; - continue; - } + in = in_str; + out = out_str; + end = in_str + len; + for (;;) { + Py_UNICODE c; + /* Fast loop for non-control characters */ + while ((c = *in++) > '\r') + *out++ = c; if (c == '\n') { - out_str[out++] = c; + *out++ = c; seennl |= SEEN_LF; continue; } - if (c != '\r') { - out_str[out++] = c; + if (c == '\r') { + if (*in == '\n') { + in++; + seennl |= SEEN_CRLF; + } + else + seennl |= SEEN_CR; + *out++ = '\n'; continue; } - if (in_str[in] == '\n') { - in++; - seennl |= SEEN_CRLF; - } - else - seennl |= SEEN_CR; - out_str[out++] = '\n'; + if (in > end) + break; + *out++ = c; } if (translated != output) { Py_DECREF(output); output = translated; } - if (out != in) { - if (PyUnicode_Resize(&output, out) < 0) + if (out - out_str != len) { + if (PyUnicode_Resize(&output, out - out_str) < 0) goto error; } } @@ -924,28 +935,22 @@ return NULL; } +/* It is assumed that end points to the real end of the Py_UNICODE storage, + that is to the NUL character. Otherwise the function will produce incorrect + results. */ static Py_UNICODE * -find_LF(Py_UNICODE *start, Py_UNICODE *end) -{ - Py_UNICODE *s = start; - while (s < end) { - if (*s == '\n') - return s; - s++; - } - return NULL; -} - -static Py_UNICODE * -find_CR(Py_UNICODE *start, Py_UNICODE *end) +find_control_char(Py_UNICODE *start, Py_UNICODE *end, Py_UNICODE ch) { Py_UNICODE *s = start; - while (s < end) { - if (*s == '\r') + for (;;) { + while (*s > ch) + s++; + if (*s == ch) return s; + if (s == end) + return NULL; s++; } - return NULL; } static PyObject * @@ -971,8 +976,9 @@ Py_UNICODE* ptr = PyUnicode_AS_UNICODE(line); if (self->readtranslate) { /* Newlines are already translated, only search for \n */ - Py_UNICODE *pos = find_LF(ptr + start, - ptr + PyUnicode_GET_SIZE(line)); + Py_UNICODE *pos = find_control_char(ptr + start, + ptr + PyUnicode_GET_SIZE(line), + '\n'); if (pos != NULL) { endpos = pos - ptr + 1; break; @@ -984,53 +990,58 @@ /* 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. - * XXX Hey! - */ - Py_UNICODE* nlpos = find_LF(ptr + start, - ptr + PyUnicode_GET_SIZE(line)); - Py_UNICODE* crpos = find_CR(ptr + start, - ptr + PyUnicode_GET_SIZE(line)); - if (crpos == NULL) { - if (nlpos == NULL) { - /* Nothing found */ - start = PyUnicode_GET_SIZE(line); + Py_UNICODE *s = ptr + start; + Py_UNICODE *e = ptr + PyUnicode_GET_SIZE(line); + for (;;) { + Py_UNICODE ch; + /* Fast path for non-control chars. The loop always ends + since the Py_UNICODE storage is NUL-terminated. */ + while (*s > '\r') + s++; + if (s == e) + goto _universal_not_found; + ch = *s++; + if (ch == '\n') { + endpos = s - ptr; + break; } - else { - /* Found \n */ - endpos = nlpos - ptr + 1; + if (ch == '\r') { + if (*s == '\n') + endpos = s - ptr + 1; + else + endpos = s - ptr; break; } } - else if (nlpos == NULL) { - /* Found lone \r */ - endpos = crpos - ptr + 1; - break; - } - else if (nlpos < crpos) { - /* Found \n */ - endpos = nlpos - ptr + 1; - break; - } - else if (nlpos == crpos + 1) { - /* Found \r\n */ - endpos = crpos - ptr + 2; - break; - } - else { - /* Found \r */ - endpos = crpos - ptr + 1; - break; - } + break; + _universal_not_found: + start = PyUnicode_GET_SIZE(line); } else { - /* non-universal */ - Py_ssize_t pos = PyUnicode_Find(line, self->readnl, - start, -1, 1); - if (pos >= 0) { - endpos = pos + PyUnicode_GET_SIZE(self->readnl); - break; + /* Non-universal mode. */ + Py_ssize_t readnl_len = PyUnicode_GET_SIZE(self->readnl); + Py_ssize_t line_len = PyUnicode_GET_SIZE(line); + if (readnl_len <= line_len) { + if (readnl_len == 1) { + Py_UNICODE *pos = find_control_char( + ptr + start, + ptr + line_len, + PyUnicode_AS_UNICODE(self->readnl)[0]); + if (pos != NULL) { + endpos = pos - ptr + 1; + break; + } + start = PyUnicode_GET_SIZE(line); + } + else { + Py_ssize_t pos = PyUnicode_Find(line, self->readnl, + start, line_len, 1); + if (pos >= 0) { + endpos = pos + readnl_len; + break; + } + start = line_len - readnl_len + 1; + } } } From python-checkins at python.org Sat Jan 10 23:37:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 23:37:11 +0100 (CET) Subject: [Python-checkins] r68511 - python/branches/py3k/Lib/ctypes/util.py Message-ID: <20090110223711.54E461E4034@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 23:37:11 2009 New Revision: 68511 Log: fix syntax in ctypes.util Modified: python/branches/py3k/Lib/ctypes/util.py Modified: python/branches/py3k/Lib/ctypes/util.py ============================================================================== --- python/branches/py3k/Lib/ctypes/util.py (original) +++ python/branches/py3k/Lib/ctypes/util.py Sat Jan 10 23:37:11 2009 @@ -104,7 +104,7 @@ if e.errno != errno.ENOENT: raise if rv == 10: - raise OSError, 'gcc or cc command not found' + raise OSError('gcc or cc command not found') res = re.search(expr, trace) if not res: return None @@ -137,7 +137,7 @@ dump = f.read() rv = f.close() if rv == 10: - raise OSError, 'objdump command not found' + raise OSError('objdump command not found') f = os.popen(cmd) try: data = f.read() From python-checkins at python.org Sat Jan 10 23:42:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 23:42:11 +0100 (CET) Subject: [Python-checkins] r68512 - python/trunk/Lib/ctypes/test/__init__.py Message-ID: <20090110224211.2116E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 23:42:10 2009 New Revision: 68512 Log: make tests fail if they can't be imported Modified: python/trunk/Lib/ctypes/test/__init__.py Modified: python/trunk/Lib/ctypes/test/__init__.py ============================================================================== --- python/trunk/Lib/ctypes/test/__init__.py (original) +++ python/trunk/Lib/ctypes/test/__init__.py Sat Jan 10 23:42:10 2009 @@ -67,9 +67,6 @@ if verbosity > 1: print >> sys.stderr, "Skipped %s: %s" % (modname, detail) continue - except Exception, detail: - print >> sys.stderr, "Warning: could not import %s: %s" % (modname, detail) - continue for name in dir(mod): if name.startswith("_"): continue From python-checkins at python.org Sat Jan 10 23:42:12 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 10 Jan 2009 23:42:12 +0100 (CET) Subject: [Python-checkins] r68513 - in python/branches/release30-maint: Lib/ctypes/util.py Message-ID: <20090110224212.297F61E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 10 23:42:12 2009 New Revision: 68513 Log: Merged revisions 68511 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68511 | benjamin.peterson | 2009-01-10 16:37:11 -0600 (Sat, 10 Jan 2009) | 1 line fix syntax in ctypes.util ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/ctypes/util.py Modified: python/branches/release30-maint/Lib/ctypes/util.py ============================================================================== --- python/branches/release30-maint/Lib/ctypes/util.py (original) +++ python/branches/release30-maint/Lib/ctypes/util.py Sat Jan 10 23:42:12 2009 @@ -104,7 +104,7 @@ if e.errno != errno.ENOENT: raise if rv == 10: - raise OSError, 'gcc or cc command not found' + raise OSError('gcc or cc command not found') res = re.search(expr, trace) if not res: return None @@ -137,7 +137,7 @@ dump = f.read() rv = f.close() if rv == 10: - raise OSError, 'objdump command not found' + raise OSError('objdump command not found') f = os.popen(cmd) try: data = f.read() From python-checkins at python.org Sun Jan 11 00:41:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 00:41:59 +0100 (CET) Subject: [Python-checkins] r68514 - python/trunk/Doc/library/sys.rst Message-ID: <20090110234159.B0DF81E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 00:41:59 2009 New Revision: 68514 Log: move seealso to a more appropiate place 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 Sun Jan 11 00:41:59 2009 @@ -566,6 +566,10 @@ .. versionchanged:: 2.3 Unicode strings are no longer ignored. + .. seealso:: + Module :mod:`site` This describes how to use .pth files to extend + :data:`sys.path`. + .. data:: platform @@ -869,10 +873,3 @@ first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python. Availability: Windows. - - -.. seealso:: - - Module :mod:`site` - This describes how to use .pth files to extend ``sys.path``. - From python-checkins at python.org Sun Jan 11 00:49:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 00:49:08 +0100 (CET) Subject: [Python-checkins] r68515 - python/trunk/Doc/library/sys.rst Message-ID: <20090110234908.3BF881E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 00:49:08 2009 New Revision: 68515 Log: macos 9 isn't supported 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 Sun Jan 11 00:49:08 2009 @@ -587,7 +587,6 @@ Windows ``'win32'`` Windows/Cygwin ``'cygwin'`` Mac OS X ``'darwin'`` - Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` RiscOS ``'riscos'`` From python-checkins at python.org Sun Jan 11 00:49:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 00:49:20 +0100 (CET) Subject: [Python-checkins] r68516 - python/branches/py3k/Doc/library/sys.rst Message-ID: <20090110234920.D3EC61E400C@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 00:49:20 2009 New Revision: 68516 Log: ricos isn't supported Modified: python/branches/py3k/Doc/library/sys.rst Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Sun Jan 11 00:49:20 2009 @@ -503,7 +503,6 @@ Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` - RiscOS ``'riscos'`` AtheOS ``'atheos'`` ================ =========================== From buildbot at python.org Sun Jan 11 00:51:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 10 Jan 2009 23:51:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090110235142.57F301E4002@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/48 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 buildbot at python.org Sun Jan 11 01:34:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 00:34:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090111003413.BF26D1E4002@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/94 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Jan 11 01:41:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 01:41:53 +0100 (CET) Subject: [Python-checkins] r68517 - peps/trunk/Makefile Message-ID: <20090111004153.613A31E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 01:41:53 2009 New Revision: 68517 Log: fix logic error which didn't include all peps in build Modified: peps/trunk/Makefile Modified: peps/trunk/Makefile ============================================================================== --- peps/trunk/Makefile (original) +++ peps/trunk/Makefile Sun Jan 11 01:41:53 2009 @@ -10,13 +10,13 @@ .txt.html: $(PEP2HTML) $< -TARGETS=$(patsubst %.txt,%.html,$(wildcard pep-????.txt)) +TARGETS=$(patsubst %.txt,%.html,$(wildcard pep-????.txt)) pep-0000.html all: pep-0000.txt $(TARGETS) $(TARGETS): pep2html.py -pep-0000.txt: $(wildcard pep-???[1-9].txt) +pep-0000.txt: $(wildcard pep-????.txt) ./genpepindex.py . install: From python-checkins at python.org Sun Jan 11 02:38:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 11 Jan 2009 02:38:50 +0100 (CET) Subject: [Python-checkins] r68518 - sandbox/trunk/io-c/_textio.c Message-ID: <20090111013850.699A61E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 11 02:38:50 2009 New Revision: 68518 Log: Text IO changes: - readline() twice as fast - introduce a CHECK_CLOSED macro - introduce a CHECK_INITIALIZED macro Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sun Jan 11 02:38:50 2009 @@ -450,6 +450,7 @@ typedef struct { PyObject_HEAD + int ok; /* initialized? */ Py_ssize_t chunk_size; PyObject *buffer; PyObject *encoding; @@ -492,6 +493,7 @@ PyObject *res; int r; + self->ok = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|zzzi:fileio", kwlist, &buffer, &encoding, &errors, &newline, &line_buffering)) @@ -609,6 +611,7 @@ self->seekable = self->telling = PyObject_IsTrue(res); Py_DECREF(res); + self->ok = 1; return 0; error: @@ -620,7 +623,7 @@ { PyObject *res; /* XXX this is inelegant */ - if (Py_TYPE(self)->tp_del == NULL) { + if (Py_TYPE(self)->tp_del == NULL && self->ok) { /* We need to resurrect the object as calling close() can invoke arbitrary code. */ ((PyObject *) self)->ob_refcnt++; @@ -635,6 +638,7 @@ if (--((PyObject *) self)->ob_refcnt != 0) return; } + self->ok = 0; Py_CLEAR(self->buffer); Py_CLEAR(self->encoding); Py_CLEAR(self->encoder); @@ -648,6 +652,42 @@ Py_TYPE(self)->tp_free((PyObject *)self); } +static PyObject * +TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context); + +/* This macro takes some shortcuts to make the common case faster. We could + specialize even more, by detecting that the underlying buffer is a + BufferedObject. */ +#define CHECK_CLOSED(self) \ + do { \ + int r; \ + PyObject *_res; \ + if (Py_TYPE(self) == &PyTextIOWrapper_Type) { \ + _res = TextIOWrapper_closed_get(self, NULL); \ + if (_res == NULL) \ + return NULL; \ + r = PyObject_IsTrue(_res); \ + Py_DECREF(_res); \ + if (r < 0) \ + return NULL; \ + if (r > 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on closed file."); \ + return NULL; \ + } \ + } \ + else if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) \ + return NULL; \ + } while (0) + +#define CHECK_INITIALIZED(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return NULL; \ + } + + Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) { @@ -670,12 +710,13 @@ int haslf = 0; int needflush = 0; + CHECK_INITIALIZED(self); + if (!PyArg_ParseTuple(args, "U:write", &text)) { return NULL; } - if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) - return NULL; + CHECK_CLOSED(self); Py_INCREF(text); @@ -873,15 +914,20 @@ } + static PyObject * TextIOWrapper_read(PyTextIOWrapperObject *self, PyObject *args) { Py_ssize_t n = -1; PyObject *result; + CHECK_INITIALIZED(self); + if (!PyArg_ParseTuple(args, "|n:read", &n)) return NULL; + CHECK_CLOSED(self); + if (n < 0) { /* Read everything */ PyObject *bytes = PyObject_CallMethod(self->buffer, "read", NULL); @@ -935,9 +981,10 @@ return NULL; } -/* It is assumed that end points to the real end of the Py_UNICODE storage, - that is to the NUL character. Otherwise the function will produce incorrect - results. */ + +/* 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_UNICODE * find_control_char(Py_UNICODE *start, Py_UNICODE *end, Py_UNICODE ch) { @@ -953,151 +1000,236 @@ } } -static PyObject * -_TextIOWrapper_readline(PyTextIOWrapperObject *self, Py_ssize_t limit) +/* 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) { - PyObject *line; - Py_ssize_t start, endpos; - int res; - - if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) - return NULL; + Py_ssize_t len = end - start; - /* Grab all the decoded text (we will rewind any extra bits later). */ - line = TextIOWrapper_get_decoded_chars(self, -1); - if (line == NULL) - return NULL; - - start = 0; - - endpos = -1; - - while (1) { - Py_UNICODE* ptr = PyUnicode_AS_UNICODE(line); - if (self->readtranslate) { - /* Newlines are already translated, only search for \n */ - Py_UNICODE *pos = find_control_char(ptr + start, - ptr + PyUnicode_GET_SIZE(line), - '\n'); - if (pos != NULL) { - endpos = pos - ptr + 1; - break; - } - else - start = PyUnicode_GET_SIZE(line); + if (self->readtranslate) { + /* Newlines are already translated, only search for \n */ + Py_UNICODE *pos = find_control_char(start, end, '\n'); + if (pos != NULL) + return pos - start + 1; + else { + *consumed = len; + return -1; } - else if (self->readuniversal) { - /* Universal newline search. Find any of \r, \r\n, \n - * The decoder ensures that \r\n are not split in two pieces - */ - Py_UNICODE *s = ptr + start; - Py_UNICODE *e = ptr + PyUnicode_GET_SIZE(line); - for (;;) { - Py_UNICODE ch; - /* Fast path for non-control chars. The loop always ends - since the Py_UNICODE storage is NUL-terminated. */ - while (*s > '\r') - s++; - if (s == e) - goto _universal_not_found; - ch = *s++; - if (ch == '\n') { - endpos = s - ptr; - break; - } - if (ch == '\r') { - if (*s == '\n') - endpos = s - ptr + 1; - else - endpos = s - ptr; - break; - } + } + else if (self->readuniversal) { + /* Universal newline search. Find any of \r, \r\n, \n + * The decoder ensures that \r\n are not split in two pieces + */ + Py_UNICODE *s = start; + for (;;) { + Py_UNICODE ch; + /* Fast path for non-control chars. The loop always ends + since the Py_UNICODE storage is NUL-terminated. */ + while (*s > '\r') + s++; + if (s >= end) { + *consumed = len; + return -1; } - break; - _universal_not_found: - start = PyUnicode_GET_SIZE(line); + ch = *s++; + if (ch == '\n') + return s - start; + if (ch == '\r') { + if (*s == '\n') + return s - start + 1; + else + return s - start; + } + } + } + else { + /* Non-universal mode. */ + Py_ssize_t readnl_len = PyUnicode_GET_SIZE(self->readnl); + Py_UNICODE *nl = PyUnicode_AS_UNICODE(self->readnl); + if (readnl_len == 1) { + Py_UNICODE *pos = find_control_char(start, end, nl[0]); + if (pos != NULL) + return pos - start + 1; + *consumed = len; + return -1; } else { - /* Non-universal mode. */ - Py_ssize_t readnl_len = PyUnicode_GET_SIZE(self->readnl); - Py_ssize_t line_len = PyUnicode_GET_SIZE(line); - if (readnl_len <= line_len) { - if (readnl_len == 1) { - Py_UNICODE *pos = find_control_char( - ptr + start, - ptr + line_len, - PyUnicode_AS_UNICODE(self->readnl)[0]); - if (pos != NULL) { - endpos = pos - ptr + 1; - break; - } - start = PyUnicode_GET_SIZE(line); - } - else { - Py_ssize_t pos = PyUnicode_Find(line, self->readnl, - start, line_len, 1); - if (pos >= 0) { - endpos = pos + readnl_len; + Py_UNICODE *s = start; + Py_UNICODE *e = end - readnl_len + 1; + Py_UNICODE *pos; + if (e < s) + e = s; + while (s < e) { + Py_ssize_t i; + Py_UNICODE *pos = find_control_char(s, end, nl[0]); + if (pos == NULL || pos >= e) + break; + for (i = 1; i < readnl_len; i++) { + if (pos[i] != nl[i]) break; - } - start = line_len - readnl_len + 1; } + if (i == readnl_len) + return pos - start + readnl_len; + s = pos + 1; } + pos = find_control_char(e, end, nl[0]); + if (pos == NULL) + *consumed = len; + else + *consumed = pos - start; + return -1; } + } +} - if (limit >= 0 && PyUnicode_GET_SIZE(line) >= limit) { - /* reached length limit */ - endpos = limit; - break; - } +static PyObject * +_TextIOWrapper_readline(PyTextIOWrapperObject *self, Py_ssize_t limit) +{ + PyObject *line = NULL, *chunks = NULL, *remaining = NULL; + Py_ssize_t start, endpos, chunked, offset_to_buffer; + int res; + + CHECK_CLOSED(self); + + chunked = 0; - /* No line ending seen yet - get more data */ - while (1) { + while (1) { + Py_UNICODE *ptr; + Py_ssize_t line_len; + Py_ssize_t consumed = 0; + + /* First, get some data if necessary */ + res = 1; + while (!self->decoded_chars || + !PyUnicode_GET_SIZE(self->decoded_chars)) { res = TextIOWrapper_read_chunk(self); if (res < 0) goto error; if (res == 0) break; - if (self->decoded_chars && - PyUnicode_GET_SIZE(self->decoded_chars)) - break; } if (res == 0) { /* end of file */ TextIOWrapper_set_decoded_chars(self, NULL); Py_CLEAR(self->snapshot); - return line; + start = endpos = offset_to_buffer = 0; + break; + } + + if (remaining == NULL) { + line = self->decoded_chars; + start = self->decoded_chars_used; + offset_to_buffer = 0; + Py_INCREF(line); } else { - PyUnicode_AppendAndDel(&line, - TextIOWrapper_get_decoded_chars( - self, -1)); + assert(self->decoded_chars_used == 0); + line = PyUnicode_Concat(remaining, self->decoded_chars); + start = 0; + offset_to_buffer = PyUnicode_GET_SIZE(remaining); + Py_CLEAR(remaining); if (line == NULL) goto error; } - } - if (limit >= 0 && endpos > limit) - endpos = limit; /* don't exceed limit */ + ptr = PyUnicode_AS_UNICODE(line); + line_len = PyUnicode_GET_SIZE(line); - /* Rewind decoded_chars to just after the line ending we found. */ - TextIOWrapper_rewind_decoded_chars( - self, PyUnicode_GET_SIZE(line) - endpos); - - if (PyUnicode_GET_SIZE(line) != endpos) { - PyObject *resized = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(line), endpos); + endpos = find_line_ending(self, ptr + start, ptr + line_len, &consumed); + if (endpos >= 0) { + endpos += start; + if (limit >= 0 && (endpos - start) + chunked >= limit) + endpos = start + limit - chunked; + break; + } - if (resized == NULL) - goto error; + /* We can put aside up to `endpos` */ + endpos = consumed + start; + if (limit >= 0 && (endpos - start) + chunked >= limit) { + /* Didn't find line ending, but reached length limit */ + endpos = start + limit - chunked; + break; + } - Py_DECREF(line); - line = resized; + if (endpos > start) { + /* No line ending seen yet - put aside current data */ + PyObject *s; + if (chunks == NULL) { + chunks = PyList_New(0); + if (chunks == NULL) + goto error; + } + s = PyUnicode_FromUnicode(ptr + start, endpos - start); + if (s == NULL) + goto error; + if (PyList_Append(chunks, s) < 0) { + Py_DECREF(s); + goto error; + } + chunked += PyUnicode_GET_SIZE(s); + Py_DECREF(s); + } + /* There may be some remaining bytes we'll have to prepend to the + next chunk of data */ + if (endpos < line_len) { + remaining = PyUnicode_FromUnicode( + ptr + endpos, line_len - endpos); + if (remaining == NULL) + goto error; + } + Py_CLEAR(line); + /* We have consumed the buffer */ + TextIOWrapper_set_decoded_chars(self, NULL); + } + + if (line != NULL) { + /* Our line ends in the current buffer */ + self->decoded_chars_used = endpos - offset_to_buffer; + if (start > 0 || endpos < PyUnicode_GET_SIZE(line)) { + if (start == 0 && Py_REFCNT(line) == 1) { + if (PyUnicode_Resize(&line, endpos) < 0) + goto error; + } + else { + PyObject *s = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(line) + start, endpos - start); + Py_CLEAR(line); + if (s == NULL) + goto error; + line = s; + } + } + } + if (chunks != NULL) { + if (remaining != NULL && PyList_Append(chunks, remaining) < 0) + goto error; + Py_CLEAR(remaining); + if (line != NULL && PyList_Append(chunks, line) < 0) + goto error; + Py_CLEAR(line); + line = PyUnicode_Join(PyUnicode_FromStringAndSize(NULL, 0), chunks); + if (line == NULL) + goto error; + Py_DECREF(chunks); } + if (line == NULL) + line = PyUnicode_FromStringAndSize(NULL, 0); + return line; error: - Py_DECREF(line); + Py_XDECREF(chunks); + Py_XDECREF(remaining); + Py_XDECREF(line); return NULL; } @@ -1106,6 +1238,7 @@ { Py_ssize_t limit = -1; + CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "|n:readline", &limit)) { return NULL; } @@ -1234,6 +1367,8 @@ PyObject *res; int cmp; + CHECK_INITIALIZED(self); + if (zero == NULL) { zero = PyLong_FromLong(0L); if (zero == NULL) @@ -1244,8 +1379,7 @@ return NULL; Py_INCREF(cookieObj); - if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) - goto fail; + CHECK_CLOSED(self); if (!self->seekable) { PyErr_SetString(PyExc_IOError, @@ -1404,6 +1538,9 @@ PyObject *saved_state = NULL; char *input, *input_end; + CHECK_INITIALIZED(self); + CHECK_CLOSED(self); + if (!self->seekable) { PyErr_SetString(PyExc_IOError, "underlying stream is not seekable"); @@ -1561,36 +1698,43 @@ static PyObject * TextIOWrapper_fileno(PyTextIOWrapperObject *self, PyObject *args) { + CHECK_INITIALIZED(self); return PyObject_CallMethod(self->buffer, "fileno", NULL); } static PyObject * TextIOWrapper_seekable(PyTextIOWrapperObject *self, PyObject *args) { + CHECK_INITIALIZED(self); return PyObject_CallMethod(self->buffer, "seekable", NULL); } static PyObject * TextIOWrapper_readable(PyTextIOWrapperObject *self, PyObject *args) { + CHECK_INITIALIZED(self); return PyObject_CallMethod(self->buffer, "readable", NULL); } static PyObject * TextIOWrapper_writable(PyTextIOWrapperObject *self, PyObject *args) { + CHECK_INITIALIZED(self); return PyObject_CallMethod(self->buffer, "writable", NULL); } static PyObject * TextIOWrapper_isatty(PyTextIOWrapperObject *self, PyObject *args) { + CHECK_INITIALIZED(self); return PyObject_CallMethod(self->buffer, "isatty", NULL); } static PyObject * TextIOWrapper_flush(PyTextIOWrapperObject *self, PyObject *args) { + CHECK_INITIALIZED(self); + CHECK_CLOSED(self); self->telling = self->seekable; return PyObject_CallMethod(self->buffer, "flush", NULL); } @@ -1598,7 +1742,9 @@ static PyObject * TextIOWrapper_close(PyTextIOWrapperObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethod((PyObject *)self, "flush", NULL); + PyObject *res; + CHECK_INITIALIZED(self); + res = PyObject_CallMethod((PyObject *)self, "flush", NULL); if (res == NULL) { /* If flush() fails, just give up */ PyErr_Clear(); @@ -1614,8 +1760,9 @@ { PyObject *line; - self->telling = 0; + CHECK_INITIALIZED(self); + self->telling = 0; if (Py_TYPE(self) == &PyTextIOWrapper_Type) { /* Skip method call overhead for speed */ line = _TextIOWrapper_readline(self, -1); @@ -1645,12 +1792,14 @@ static PyObject * TextIOWrapper_name_get(PyTextIOWrapperObject *self, void *context) { + CHECK_INITIALIZED(self); return PyObject_GetAttrString(self->buffer, "name"); } static PyObject * TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context) { + CHECK_INITIALIZED(self); return PyObject_GetAttr(self->buffer, _PyIO_str_closed); } @@ -1658,6 +1807,7 @@ TextIOWrapper_newlines_get(PyTextIOWrapperObject *self, void *context) { PyObject *res; + CHECK_INITIALIZED(self); if (self->decoder == NULL) Py_RETURN_NONE; res = PyObject_GetAttr(self->decoder, _PyIO_str_newlines); From python-checkins at python.org Sun Jan 11 03:41:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 03:41:49 +0100 (CET) Subject: [Python-checkins] r68519 - in peps/trunk: pep-0373.txt pep-3139.txt Message-ID: <20090111024149.8C7B31E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 03:41:49 2009 New Revision: 68519 Log: add email address Modified: peps/trunk/pep-0373.txt peps/trunk/pep-3139.txt Modified: peps/trunk/pep-0373.txt ============================================================================== --- peps/trunk/pep-0373.txt (original) +++ peps/trunk/pep-0373.txt Sun Jan 11 03:41:49 2009 @@ -2,7 +2,7 @@ Title: Python 2.7 Release Schedule Version: $Revision$ Last-Modified: $Date$ -Author: Benjamin Peterson +Author: Benjamin Peterson Status: Draft Type: Process Content-Type: text/x-rst Modified: peps/trunk/pep-3139.txt ============================================================================== --- peps/trunk/pep-3139.txt (original) +++ peps/trunk/pep-3139.txt Sun Jan 11 03:41:49 2009 @@ -2,7 +2,7 @@ Title: Cleaning out sys and the "interpreter" module Version: $Revision$ Last-Modified: $Date$ -Author: Benjamin Peterson +Author: Benjamin Peterson Status: Rejected Type: Standards Track Content-Type: text/x-rst From python-checkins at python.org Sun Jan 11 03:48:38 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 11 Jan 2009 03:48:38 +0100 (CET) Subject: [Python-checkins] r68520 - sandbox/trunk/io-c/_textio.c Message-ID: <20090111024838.5FD911E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 11 03:48:38 2009 New Revision: 68520 Log: Fix failures in test_univnewline. TextIOWrapper_read_chunk was returning 0 (eof) even if a last byte had been returned by the IncrementalNewlineDecoder (which happens when a file open in universal newlines mode ends with a '\r'). Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sun Jan 11 03:48:38 2009 @@ -886,9 +886,12 @@ decoded_chars = PyObject_CallMethod(self->decoder, "decode", "Oi", input_chunk, eof); + /* TODO sanity check: isinstance(decoded_chars, unicode) */ if (decoded_chars == NULL) goto fail; TextIOWrapper_set_decoded_chars(self, decoded_chars); + if (PyUnicode_GET_SIZE(decoded_chars) > 0) + eof = 0; if (self->telling) { /* At the snapshot point, len(dec_buffer) bytes before the read, the @@ -1209,10 +1212,17 @@ } } } - if (chunks != NULL) { - if (remaining != NULL && PyList_Append(chunks, remaining) < 0) + if (remaining != NULL) { + if (chunks == NULL) { + chunks = PyList_New(0); + if (chunks == NULL) + goto error; + } + if (PyList_Append(chunks, remaining) < 0) goto error; Py_CLEAR(remaining); + } + if (chunks != NULL) { if (line != NULL && PyList_Append(chunks, line) < 0) goto error; Py_CLEAR(line); From python-checkins at python.org Sun Jan 11 04:28:13 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 11 Jan 2009 04:28:13 +0100 (CET) Subject: [Python-checkins] r68521 - in python/trunk: PC/VS8.0/build_ssl.bat PCbuild/build_ssl.bat Message-ID: <20090111032813.DD2371E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sun Jan 11 04:28:13 2009 New Revision: 68521 Log: Fixed version number in build_ssl.bat. Modified: python/trunk/PC/VS8.0/build_ssl.bat python/trunk/PCbuild/build_ssl.bat Modified: python/trunk/PC/VS8.0/build_ssl.bat ============================================================================== --- python/trunk/PC/VS8.0/build_ssl.bat (original) +++ python/trunk/PC/VS8.0/build_ssl.bat Sun Jan 11 04:28:13 2009 @@ -2,10 +2,10 @@ if not defined HOST_PYTHON ( if %1 EQU Debug ( set HOST_PYTHON=python_d.exe - if not exist python30_d.dll exit 1 + if not exist python27_d.dll exit 1 ) ELSE ( set HOST_PYTHON=python.exe - if not exist python30.dll exit 1 + if not exist python27.dll exit 1 ) ) %HOST_PYTHON% build_ssl.py %1 %2 %3 Modified: python/trunk/PCbuild/build_ssl.bat ============================================================================== --- python/trunk/PCbuild/build_ssl.bat (original) +++ python/trunk/PCbuild/build_ssl.bat Sun Jan 11 04:28:13 2009 @@ -2,10 +2,10 @@ if not defined HOST_PYTHON ( if %1 EQU Debug ( set HOST_PYTHON=python_d.exe - if not exist python30_d.dll exit 1 + if not exist python27_d.dll exit 1 ) ELSE ( set HOST_PYTHON=python.exe - if not exist python30.dll exit 1 + if not exist python27.dll exit 1 ) ) %HOST_PYTHON% build_ssl.py %1 %2 %3 From python-checkins at python.org Sun Jan 11 04:32:00 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 11 Jan 2009 04:32:00 +0100 (CET) Subject: [Python-checkins] r68522 - in python/branches/release26-maint: PC/VS8.0/build_ssl.bat PCbuild/build_ssl.bat Message-ID: <20090111033200.85ABE1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sun Jan 11 04:32:00 2009 New Revision: 68522 Log: Fixed version number in build_ssl.bat. Modified: python/branches/release26-maint/PC/VS8.0/build_ssl.bat python/branches/release26-maint/PCbuild/build_ssl.bat Modified: python/branches/release26-maint/PC/VS8.0/build_ssl.bat ============================================================================== --- python/branches/release26-maint/PC/VS8.0/build_ssl.bat (original) +++ python/branches/release26-maint/PC/VS8.0/build_ssl.bat Sun Jan 11 04:32:00 2009 @@ -2,10 +2,10 @@ if not defined HOST_PYTHON ( if %1 EQU Debug ( set HOST_PYTHON=python_d.exe - if not exist python30_d.dll exit 1 + if not exist python26_d.dll exit 1 ) ELSE ( set HOST_PYTHON=python.exe - if not exist python30.dll exit 1 + if not exist python26.dll exit 1 ) ) %HOST_PYTHON% build_ssl.py %1 %2 %3 Modified: python/branches/release26-maint/PCbuild/build_ssl.bat ============================================================================== --- python/branches/release26-maint/PCbuild/build_ssl.bat (original) +++ python/branches/release26-maint/PCbuild/build_ssl.bat Sun Jan 11 04:32:00 2009 @@ -2,10 +2,10 @@ if not defined HOST_PYTHON ( if %1 EQU Debug ( set HOST_PYTHON=python_d.exe - if not exist python30_d.dll exit 1 + if not exist python26_d.dll exit 1 ) ELSE ( set HOST_PYTHON=python.exe - if not exist python30.dll exit 1 + if not exist python26.dll exit 1 ) ) %HOST_PYTHON% build_ssl.py %1 %2 %3 From buildbot at python.org Sun Jan 11 05:20:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 04:20:17 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090111042017.3DA9F1E4038@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/43 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: 1 test failed: test_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 11 10:26:55 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 11 Jan 2009 10:26:55 +0100 (CET) Subject: [Python-checkins] r68523 - in python/trunk: Misc/NEWS Parser/printgrammar.c Python/graminit.c Message-ID: <20090111092655.695821E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 11 10:26:54 2009 New Revision: 68523 Log: Issue #4279: Fix build of parsermodule under Cygwin. Modified: python/trunk/Misc/NEWS python/trunk/Parser/printgrammar.c python/trunk/Python/graminit.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 11 10:26:54 2009 @@ -331,6 +331,8 @@ Extension Modules ----------------- +- Issue #4279: Fix build of parsermodule under Cygwin. + - Issue #4051: Prevent conflict of UNICODE macros in cPickle. - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. Modified: python/trunk/Parser/printgrammar.c ============================================================================== --- python/trunk/Parser/printgrammar.c (original) +++ python/trunk/Parser/printgrammar.c Sun Jan 11 10:26:54 2009 @@ -16,6 +16,7 @@ fprintf(fp, "/* Generated by Parser/pgen */\n\n"); fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n"); + fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); printdfas(g, fp); printlabels(g, fp); fprintf(fp, "grammar _PyParser_Grammar = {\n"); Modified: python/trunk/Python/graminit.c ============================================================================== --- python/trunk/Python/graminit.c (original) +++ python/trunk/Python/graminit.c Sun Jan 11 10:26:54 2009 @@ -2,6 +2,7 @@ #include "pgenheaders.h" #include "grammar.h" +PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, From python-checkins at python.org Sun Jan 11 10:28:08 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 11 Jan 2009 10:28:08 +0100 (CET) Subject: [Python-checkins] r68524 - in python/branches/release26-maint: Misc/NEWS Parser/printgrammar.c Python/graminit.c Message-ID: <20090111092808.6D93D1E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 11 10:28:08 2009 New Revision: 68524 Log: Merged revisions 68523 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68523 | martin.v.loewis | 2009-01-11 10:26:54 +0100 (So, 11 Jan 2009) | 2 lines Issue #4279: Fix build of parsermodule under Cygwin. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Parser/printgrammar.c python/branches/release26-maint/Python/graminit.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun Jan 11 10:28:08 2009 @@ -306,6 +306,8 @@ Extension Modules ----------------- +- Issue #4279: Fix build of parsermodule under Cygwin. + - Issue #4051: Prevent conflict of UNICODE macros in cPickle. - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. Modified: python/branches/release26-maint/Parser/printgrammar.c ============================================================================== --- python/branches/release26-maint/Parser/printgrammar.c (original) +++ python/branches/release26-maint/Parser/printgrammar.c Sun Jan 11 10:28:08 2009 @@ -16,6 +16,7 @@ fprintf(fp, "/* Generated by Parser/pgen */\n\n"); fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n"); + fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); printdfas(g, fp); printlabels(g, fp); fprintf(fp, "grammar _PyParser_Grammar = {\n"); Modified: python/branches/release26-maint/Python/graminit.c ============================================================================== --- python/branches/release26-maint/Python/graminit.c (original) +++ python/branches/release26-maint/Python/graminit.c Sun Jan 11 10:28:08 2009 @@ -2,6 +2,7 @@ #include "pgenheaders.h" #include "grammar.h" +PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, From python-checkins at python.org Sun Jan 11 10:30:50 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 11 Jan 2009 10:30:50 +0100 (CET) Subject: [Python-checkins] r68525 - in python/branches/py3k: Misc/NEWS Parser/printgrammar.c Python/graminit.c Message-ID: <20090111093050.D04A81E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 11 10:30:50 2009 New Revision: 68525 Log: Merged revisions 68523 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68523 | martin.v.loewis | 2009-01-11 10:26:54 +0100 (So, 11 Jan 2009) | 2 lines Issue #4279: Fix build of parsermodule under Cygwin. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Parser/printgrammar.c python/branches/py3k/Python/graminit.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 11 10:30:50 2009 @@ -284,6 +284,8 @@ Extension Modules ----------------- +- Issue #4279: Fix build of parsermodule under Cygwin. + - Issue #4751: hashlib now releases the GIL when hashing large buffers (with a hardwired threshold of 2048 bytes), allowing better parallelization on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner. Modified: python/branches/py3k/Parser/printgrammar.c ============================================================================== --- python/branches/py3k/Parser/printgrammar.c (original) +++ python/branches/py3k/Parser/printgrammar.c Sun Jan 11 10:30:50 2009 @@ -16,6 +16,7 @@ fprintf(fp, "/* Generated by Parser/pgen */\n\n"); fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n"); + fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); printdfas(g, fp); printlabels(g, fp); fprintf(fp, "grammar _PyParser_Grammar = {\n"); Modified: python/branches/py3k/Python/graminit.c ============================================================================== --- python/branches/py3k/Python/graminit.c (original) +++ python/branches/py3k/Python/graminit.c Sun Jan 11 10:30:50 2009 @@ -2,6 +2,7 @@ #include "pgenheaders.h" #include "grammar.h" +PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, From python-checkins at python.org Sun Jan 11 10:33:05 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 11 Jan 2009 10:33:05 +0100 (CET) Subject: [Python-checkins] r68526 - in python/branches/release30-maint: Misc/NEWS Parser/printgrammar.c Python/graminit.c Message-ID: <20090111093305.C53771E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 11 10:33:05 2009 New Revision: 68526 Log: Merged revisions 68525 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68525 | martin.v.loewis | 2009-01-11 10:30:50 +0100 (So, 11 Jan 2009) | 9 lines Merged revisions 68523 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68523 | martin.v.loewis | 2009-01-11 10:26:54 +0100 (So, 11 Jan 2009) | 2 lines Issue #4279: Fix build of parsermodule under Cygwin. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Parser/printgrammar.c python/branches/release30-maint/Python/graminit.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Jan 11 10:33:05 2009 @@ -217,6 +217,8 @@ Extension Modules ----------------- +- Issue #4279: Fix build of parsermodule under Cygwin. + - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. - Issue #1040026: Fix os.times result on systems where HZ is incorrect. Modified: python/branches/release30-maint/Parser/printgrammar.c ============================================================================== --- python/branches/release30-maint/Parser/printgrammar.c (original) +++ python/branches/release30-maint/Parser/printgrammar.c Sun Jan 11 10:33:05 2009 @@ -16,6 +16,7 @@ fprintf(fp, "/* Generated by Parser/pgen */\n\n"); fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n"); + fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); printdfas(g, fp); printlabels(g, fp); fprintf(fp, "grammar _PyParser_Grammar = {\n"); Modified: python/branches/release30-maint/Python/graminit.c ============================================================================== --- python/branches/release30-maint/Python/graminit.c (original) +++ python/branches/release30-maint/Python/graminit.c Sun Jan 11 10:33:05 2009 @@ -2,6 +2,7 @@ #include "pgenheaders.h" #include "grammar.h" +PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, From python-checkins at python.org Sun Jan 11 10:43:56 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 11 Jan 2009 10:43:56 +0100 (CET) Subject: [Python-checkins] r68527 - in python/trunk: Misc/NEWS PC/pyconfig.h Message-ID: <20090111094356.061CB1E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 11 10:43:55 2009 New Revision: 68527 Log: Issue #4895: Use _strdup on Windows CE. Modified: python/trunk/Misc/NEWS python/trunk/PC/pyconfig.h Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 11 10:43:55 2009 @@ -297,6 +297,8 @@ Build ----- +- Issue #4895: Use _strdup on Windows CE. + - Issue #4472: "configure --enable-shared" now works on OSX - Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. Modified: python/trunk/PC/pyconfig.h ============================================================================== --- python/trunk/PC/pyconfig.h (original) +++ python/trunk/PC/pyconfig.h Sun Jan 11 10:43:55 2009 @@ -88,6 +88,12 @@ #define USE_SOCKET #endif +/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ +#if defined(MS_WINCE) +# include +# define strdup _strdup +#endif + #ifdef MS_WINCE /* Python uses GetVersion() to distinguish between * Windows NT and 9x/ME where OS Unicode support is concerned. From python-checkins at python.org Sun Jan 11 10:45:11 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 11 Jan 2009 10:45:11 +0100 (CET) Subject: [Python-checkins] r68528 - in python/branches/py3k: Misc/NEWS PC/pyconfig.h Message-ID: <20090111094511.4332B1E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 11 10:45:11 2009 New Revision: 68528 Log: Merged revisions 68527 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68527 | martin.v.loewis | 2009-01-11 10:43:55 +0100 (So, 11 Jan 2009) | 2 lines Issue #4895: Use _strdup on Windows CE. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/PC/pyconfig.h Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 11 10:45:11 2009 @@ -248,6 +248,8 @@ Build ----- +- Issue #4895: Use _strdup on Windows CE. + - Issue #4472: "configure --enable-shared" now works on OSX - Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. Modified: python/branches/py3k/PC/pyconfig.h ============================================================================== --- python/branches/py3k/PC/pyconfig.h (original) +++ python/branches/py3k/PC/pyconfig.h Sun Jan 11 10:45:11 2009 @@ -88,6 +88,12 @@ #define USE_SOCKET #endif +/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ +#if defined(MS_WINCE) +# include +# define strdup _strdup +#endif + #ifdef MS_WINCE /* Python uses GetVersion() to distinguish between * Windows NT and 9x/ME where OS Unicode support is concerned. From buildbot at python.org Sun Jan 11 10:55:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 09:55:47 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090111095548.1271F1E4002@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/509 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_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 11 11:11:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 10:11:57 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090111101157.EC7191E4002@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/43 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: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 11 11:38:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 10:38:59 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090111103859.A77081E4002@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/684 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 buildbot at python.org Sun Jan 11 12:00:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 11:00:37 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090111110039.723791E404A@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/50 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sun Jan 11 12:42:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 11:42:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090111114254.A3BDF1E4002@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/96 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 11 12:54:02 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 11 Jan 2009 12:54:02 +0100 (CET) Subject: [Python-checkins] r68529 - in python/branches/py3k: Demo/classes/Complex.py Demo/classes/bitvec.py Lib/collections.py Message-ID: <20090111115402.F39BA1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 11 12:54:02 2009 New Revision: 68529 Log: Remove __long__ methods from UserString and from Demo/ classes. Modified: python/branches/py3k/Demo/classes/Complex.py python/branches/py3k/Demo/classes/bitvec.py python/branches/py3k/Lib/collections.py Modified: python/branches/py3k/Demo/classes/Complex.py ============================================================================== --- python/branches/py3k/Demo/classes/Complex.py (original) +++ python/branches/py3k/Demo/classes/Complex.py Sun Jan 11 12:54:02 2009 @@ -39,7 +39,6 @@ # # These conversions accept complex arguments only if their imaginary part is zero: # int(z) -# long(z) # float(z) # # The following operators accept two complex numbers, or one complex number @@ -147,11 +146,6 @@ raise ValueError("can't convert Complex with nonzero im to int") return int(self.re) - def __long__(self): - if self.im: - raise ValueError("can't convert Complex with nonzero im to long") - return int(self.re) - def __float__(self): if self.im: raise ValueError("can't convert Complex with nonzero im to float") Modified: python/branches/py3k/Demo/classes/bitvec.py ============================================================================== --- python/branches/py3k/Demo/classes/bitvec.py (original) +++ python/branches/py3k/Demo/classes/bitvec.py Sun Jan 11 12:54:02 2009 @@ -315,9 +315,6 @@ def __int__(self): return int(self._data) - def __long__(self): - return int(self._data) - def __float__(self): return float(self._data) Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Sun Jan 11 12:54:02 2009 @@ -255,7 +255,6 @@ def __str__(self): return str(self.data) def __repr__(self): return repr(self.data) def __int__(self): return int(self.data) - def __long__(self): return int(self.data) def __float__(self): return float(self.data) def __complex__(self): return complex(self.data) def __hash__(self): return hash(self.data) From buildbot at python.org Sun Jan 11 12:54:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 11:54:17 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090111115417.586C11E4002@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/31 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: martin.v.loewis 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 Jan 11 12:55:32 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 11 Jan 2009 12:55:32 +0100 (CET) Subject: [Python-checkins] r68530 - in python/branches/release30-maint: Demo/classes/Complex.py Demo/classes/bitvec.py Lib/collections.py Message-ID: <20090111115532.E001C1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 11 12:55:32 2009 New Revision: 68530 Log: Merged revisions 68529 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68529 | mark.dickinson | 2009-01-11 11:54:02 +0000 (Sun, 11 Jan 2009) | 2 lines Remove __long__ methods from UserString and from Demo/ classes. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Demo/classes/Complex.py python/branches/release30-maint/Demo/classes/bitvec.py python/branches/release30-maint/Lib/collections.py Modified: python/branches/release30-maint/Demo/classes/Complex.py ============================================================================== --- python/branches/release30-maint/Demo/classes/Complex.py (original) +++ python/branches/release30-maint/Demo/classes/Complex.py Sun Jan 11 12:55:32 2009 @@ -39,7 +39,6 @@ # # These conversions accept complex arguments only if their imaginary part is zero: # int(z) -# long(z) # float(z) # # The following operators accept two complex numbers, or one complex number @@ -147,11 +146,6 @@ raise ValueError("can't convert Complex with nonzero im to int") return int(self.re) - def __long__(self): - if self.im: - raise ValueError("can't convert Complex with nonzero im to long") - return int(self.re) - def __float__(self): if self.im: raise ValueError("can't convert Complex with nonzero im to float") Modified: python/branches/release30-maint/Demo/classes/bitvec.py ============================================================================== --- python/branches/release30-maint/Demo/classes/bitvec.py (original) +++ python/branches/release30-maint/Demo/classes/bitvec.py Sun Jan 11 12:55:32 2009 @@ -315,9 +315,6 @@ def __int__(self): return int(self._data) - def __long__(self): - return int(self._data) - def __float__(self): return float(self._data) Modified: python/branches/release30-maint/Lib/collections.py ============================================================================== --- python/branches/release30-maint/Lib/collections.py (original) +++ python/branches/release30-maint/Lib/collections.py Sun Jan 11 12:55:32 2009 @@ -255,7 +255,6 @@ def __str__(self): return str(self.data) def __repr__(self): return repr(self.data) def __int__(self): return int(self.data) - def __long__(self): return int(self.data) def __float__(self): return float(self.data) def __complex__(self): return complex(self.data) def __hash__(self): return hash(self.data) From python-checkins at python.org Sun Jan 11 14:53:36 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 11 Jan 2009 14:53:36 +0100 (CET) Subject: [Python-checkins] r68531 - in sandbox/trunk/io-c: _iomodule.h _textio.c io.c Message-ID: <20090111135336.4570D1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 11 14:53:36 2009 New Revision: 68531 Log: Use joining instead of appending in TextIOWrapper.read(), and a few micro-optimizations. Modified: sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/io.c Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Sun Jan 11 14:53:36 2009 @@ -64,6 +64,7 @@ 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; Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sun Jan 11 14:53:36 2009 @@ -106,18 +106,12 @@ #define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF) static PyObject * -IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, - PyObject *args, PyObject *kwds) +_IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, + PyObject *input, int final) { - char *kwlist[] = {"input", "final", NULL}; - PyObject *input, *output; - int final = 0; + PyObject *output; Py_ssize_t output_len; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i:IncrementalNewlineDecoder", - kwlist, &input, &final)) - return NULL; - if (self->decoder == NULL) { PyErr_SetString(PyExc_ValueError, "IncrementalNewlineDecoder.__init__ not called"); @@ -296,6 +290,20 @@ } static PyObject * +IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, + PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"input", "final", NULL}; + PyObject *input; + int final = 0; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i:IncrementalNewlineDecoder", + kwlist, &input, &final)) + return NULL; + return _IncrementalNewlineDecoder_decode(self, input, final); +} + +static PyObject * IncrementalNewlineDecoder_getstate(PyNewLineDecoderObject *self, PyObject *args) { PyObject *state = PyObject_CallMethodObjArgs(self->decoder, @@ -800,11 +808,17 @@ if (n < 0 || n > avail) n = avail; - chars = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(self->decoded_chars) - + self->decoded_chars_used, n); - if (chars == NULL) - return NULL; + if (self->decoded_chars_used > 0 || n < avail) { + chars = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(self->decoded_chars) + + self->decoded_chars_used, n); + if (chars == NULL) + return NULL; + } + else { + chars = self->decoded_chars; + Py_INCREF(chars); + } self->decoded_chars_used += n; return chars; @@ -839,7 +853,8 @@ { PyObject *dec_buffer = NULL; PyObject *dec_flags = NULL; - PyObject *input_chunk, *decoded_chars; + PyObject *input_chunk = NULL; + PyObject *decoded_chars, *chunk_size; int eof; /* The return value is True unless EOF was reached. The decoded string is @@ -875,16 +890,26 @@ } /* Read a chunk, decode it, and put the result in self._decoded_chars. */ - input_chunk = PyObject_CallMethod(self->buffer, "read1", - "n", self->chunk_size); + chunk_size = PyLong_FromSsize_t(self->chunk_size); + if (chunk_size == NULL) + goto fail; + input_chunk = PyObject_CallMethodObjArgs(self->buffer, + _PyIO_str_read1, chunk_size, NULL); + Py_DECREF(chunk_size); if (input_chunk == NULL) goto fail; assert(PyBytes_Check(input_chunk)); eof = (PyBytes_Size(input_chunk) == 0); - decoded_chars = PyObject_CallMethod(self->decoder, "decode", - "Oi", input_chunk, eof); + if (Py_TYPE(self->decoder) == &PyIncrementalNewlineDecoder_Type) { + decoded_chars = _IncrementalNewlineDecoder_decode( + (PyNewLineDecoderObject *) self->decoder, input_chunk, eof); + } + else { + decoded_chars = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_decode, input_chunk, eof ? Py_True : Py_False, NULL); + } /* TODO sanity check: isinstance(decoded_chars, unicode) */ if (decoded_chars == NULL) @@ -914,15 +939,13 @@ Py_XDECREF(dec_flags); Py_XDECREF(input_chunk); return -1; - } - static PyObject * TextIOWrapper_read(PyTextIOWrapperObject *self, PyObject *args) { Py_ssize_t n = -1; - PyObject *result; + PyObject *result = NULL, *chunks = NULL; CHECK_INITIALIZED(self); @@ -937,8 +960,8 @@ PyObject *decoded; if (bytes == NULL) goto fail; - decoded = PyObject_CallMethod(self->decoder, "decode", - "Oi", bytes, /*final=*/1); + decoded = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, + bytes, Py_True, NULL); Py_DECREF(bytes); if (decoded == NULL) goto fail; @@ -959,28 +982,48 @@ } else { int res = 1; + Py_ssize_t remaining = n; + result = TextIOWrapper_get_decoded_chars(self, n); + if (result == NULL) + goto fail; + remaining -= PyUnicode_GET_SIZE(result); /* Keep reading chunks until we have n characters to return */ - while (res == 1) { - if (result == NULL || Py_SIZE(result) >= n) { - break; - } + while (remaining > 0) { res = TextIOWrapper_read_chunk(self); - if (res < 0) { - Py_DECREF(result); + if (res < 0) goto fail; + if (res == 0) /* EOF */ + break; + if (chunks == NULL) { + chunks = PyList_New(0); + if (chunks == NULL) + goto fail; } - - PyUnicode_AppendAndDel(&result, - TextIOWrapper_get_decoded_chars( - self, n - Py_SIZE(result))); + if (PyList_Append(chunks, result) < 0) + goto fail; + Py_DECREF(result); + result = TextIOWrapper_get_decoded_chars(self, remaining); + if (result == NULL) + goto fail; + remaining -= PyUnicode_GET_SIZE(result); + } + if (chunks != NULL) { + if (result != NULL && PyList_Append(chunks, result) < 0) + goto fail; + Py_CLEAR(result); + result = PyUnicode_Join(PyUnicode_FromStringAndSize(NULL, 0), + chunks); if (result == NULL) goto fail; + Py_CLEAR(chunks); } return result; } fail: + Py_XDECREF(result); + Py_XDECREF(chunks); return NULL; } Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Sun Jan 11 14:53:36 2009 @@ -24,6 +24,7 @@ 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; @@ -649,6 +650,8 @@ goto fail; if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) goto fail; + if (!(_PyIO_str_read1 = PyUnicode_InternFromString("read1"))) + goto fail; if (!(_PyIO_str_readable = PyUnicode_InternFromString("readable"))) goto fail; if (!(_PyIO_str_readinto = PyUnicode_InternFromString("readinto"))) From python-checkins at python.org Sun Jan 11 17:23:37 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Sun, 11 Jan 2009 17:23:37 +0100 (CET) Subject: [Python-checkins] r68532 - in python/trunk/Lib: httplib.py test/test_xmlrpc.py urllib2.py xmlrpclib.py Message-ID: <20090111162337.EFAC81E4002@bag.python.org> Author: kristjan.jonsson Date: Sun Jan 11 17:23:37 2009 New Revision: 68532 Log: Issue 4879: Allow buffering for HTTPResponse Modified: python/trunk/Lib/httplib.py python/trunk/Lib/test/test_xmlrpc.py python/trunk/Lib/urllib2.py python/trunk/Lib/xmlrpclib.py Modified: python/trunk/Lib/httplib.py ============================================================================== --- python/trunk/Lib/httplib.py (original) +++ python/trunk/Lib/httplib.py Sun Jan 11 17:23:37 2009 @@ -325,13 +325,18 @@ # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details. - def __init__(self, sock, debuglevel=0, strict=0, method=None): - # The buffer size is specified as zero, because the headers of - # the response are read with readline(). If the reads were - # buffered the readline() calls could consume some of the - # response, which make be read via a recv() on the underlying - # socket. - self.fp = sock.makefile('rb', 0) + def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering=False): + if buffering: + # The caller won't be using any sock.recv() calls, so buffering + # is fine and recommendef for performance + self.fp = sock.makefile('rb') + else: + # The buffer size is specified as zero, because the headers of + # the response are read with readline(). If the reads were + # buffered the readline() calls could consume some of the + # response, which make be read via a recv() on the underlying + # socket. + self.fp = sock.makefile('rb', 0) self.debuglevel = debuglevel self.strict = strict self._method = method @@ -935,7 +940,7 @@ self.putheader(hdr, value) self.endheaders(body) - def getresponse(self): + def getresponse(self, buffering=False): "Get the response from the server." # if a prior response has been completed, then forget about it. @@ -961,13 +966,15 @@ if self.__state != _CS_REQ_SENT or self.__response: raise ResponseNotReady() + args = (self.sock,) + kwds = {"strict":self.strict, "method":self._method} if self.debuglevel > 0: - response = self.response_class(self.sock, self.debuglevel, - strict=self.strict, - method=self._method) - else: - response = self.response_class(self.sock, strict=self.strict, - method=self._method) + args += (self.debuglevel,) + if buffering: + #only add this keyword if non-default, for compatibility with + #other response_classes. + kwds["buffering"] = True; + response = self.response_class(*args, **kwds) response.begin() assert response.will_close != _UNKNOWN @@ -1031,7 +1038,7 @@ "Provide a getfile, since the superclass' does not use this concept." return self.file - def getreply(self): + def getreply(self, buffering=False): """Compat definition since superclass does not define it. Returns a tuple consisting of: @@ -1040,7 +1047,12 @@ - any RFC822 headers in the response from the server """ try: - response = self._conn.getresponse() + if not buffering: + response = self._conn.getresponse() + else: + #only add this keyword if non-default for compatibility + #with other connection classes + response = self._conn.getresponse(buffering) except BadStatusLine, e: ### hmm. if getresponse() ever closes the socket on a bad request, ### then we are going to have problems with self.sock Modified: python/trunk/Lib/test/test_xmlrpc.py ============================================================================== --- python/trunk/Lib/test/test_xmlrpc.py (original) +++ python/trunk/Lib/test/test_xmlrpc.py Sun Jan 11 17:23:37 2009 @@ -655,7 +655,7 @@ def getvalue(self): return self.data.getvalue() - def makefile(self, x, y): + def makefile(self, x='r', y=-1): raise RuntimeError class FakeTransport(xmlrpclib.Transport): Modified: python/trunk/Lib/urllib2.py ============================================================================== --- python/trunk/Lib/urllib2.py (original) +++ python/trunk/Lib/urllib2.py Sun Jan 11 17:23:37 2009 @@ -1100,7 +1100,10 @@ (name.title(), val) for name, val in headers.items()) try: h.request(req.get_method(), req.get_selector(), req.data, headers) - r = h.getresponse() + try: + r = h.getresponse(buffering=True) + except TypeError: #buffering kw not supported + r = h.getresponse() except socket.error, err: # XXX what error? raise URLError(err) Modified: python/trunk/Lib/xmlrpclib.py ============================================================================== --- python/trunk/Lib/xmlrpclib.py (original) +++ python/trunk/Lib/xmlrpclib.py Sun Jan 11 17:23:37 2009 @@ -1234,7 +1234,7 @@ self.send_user_agent(h) self.send_content(h, request_body) - errcode, errmsg, headers = h.getreply() + errcode, errmsg, headers = h.getreply(buffering=True) if errcode != 200: raise ProtocolError( @@ -1245,12 +1245,7 @@ self.verbose = verbose - try: - sock = h._conn.sock - except AttributeError: - sock = None - - return self._parse_response(h.getfile(), sock) + return self._parse_response(h.getfile()) ## # Create parser. @@ -1355,29 +1350,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 Sun Jan 11 17:52:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 16:52:57 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090111165257.25C611E4002@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/4458 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: 1 test failed: test_xmlrpc ====================================================================== ERROR: test_dotted_attribute (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 492, in test_dotted_attribute self.test_simple1() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 376, in test_simple1 self.assertEqual(p.pow(6,8), 6**8) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection1 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 398, in test_introspection1 meth = p.system.listMethods() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection2 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 413, in test_introspection2 divhelp = p.system.methodHelp('div') File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection3 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 425, in test_introspection3 myfunction = p.system.methodHelp('my_function') File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection4 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 438, in test_introspection4 divsig = p.system.methodSignature('div') File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_multicall (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 453, in test_multicall add_result, pow_result, div_result = multicall() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1042, in __call__ return MultiCallIterator(self.__server.system.multicall(marshalled_list)) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_non_existing_multicall (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 468, in test_non_existing_multicall result = multicall() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1042, in __call__ return MultiCallIterator(self.__server.system.multicall(marshalled_list)) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_simple1 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 376, in test_simple1 self.assertEqual(p.pow(6,8), 6**8) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_basic (test.test_xmlrpc.FailingServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_xmlrpc.py", line 534, in test_basic self.assertEqual(p.pow(6,8), 6**8) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 11 18:04:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 17:04:27 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090111170427.94B2E1E4002@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/511 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: kristjan.jonsson 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 Sun Jan 11 18:13:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 18:13:55 +0100 (CET) Subject: [Python-checkins] r68533 - in python/branches/py3k: Objects/bytesobject.c Objects/object.c Objects/tupleobject.c Message-ID: <20090111171355.E67691E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 18:13:55 2009 New Revision: 68533 Log: Merged revisions 68381 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68381 | martin.v.loewis | 2009-01-07 12:40:40 -0600 (Wed, 07 Jan 2009) | 2 lines Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/bytesobject.c python/branches/py3k/Objects/object.c python/branches/py3k/Objects/tupleobject.c Modified: python/branches/py3k/Objects/bytesobject.c ============================================================================== --- python/branches/py3k/Objects/bytesobject.c (original) +++ python/branches/py3k/Objects/bytesobject.c Sun Jan 11 18:13:55 2009 @@ -26,7 +26,7 @@ } #ifdef COUNT_ALLOCS -int null_strings, one_strings; +Py_ssize_t null_strings, one_strings; #endif static PyBytesObject *characters[UCHAR_MAX + 1]; Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Sun Jan 11 18:13:55 2009 @@ -81,24 +81,29 @@ garbage itself. If unlist_types_without_objects is set, they will be removed from the type_list once the last object is deallocated. */ -int unlist_types_without_objects; -extern int tuple_zero_allocs, fast_tuple_allocs; -extern int quick_int_allocs, quick_neg_int_allocs; -extern int null_strings, one_strings; +static int unlist_types_without_objects; +extern Py_ssize_t tuple_zero_allocs, fast_tuple_allocs; +extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs; +extern Py_ssize_t null_strings, one_strings; void dump_counts(FILE* f) { PyTypeObject *tp; for (tp = type_list; tp; tp = tp->tp_next) - fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n", + fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, " + "freed: %" PY_FORMAT_SIZE_T "d, " + "max in use: %" PY_FORMAT_SIZE_T "d\n", tp->tp_name, tp->tp_allocs, tp->tp_frees, tp->tp_maxalloc); - fprintf(f, "fast tuple allocs: %d, empty: %d\n", + fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, " + "empty: %" PY_FORMAT_SIZE_T "d\n", fast_tuple_allocs, tuple_zero_allocs); - fprintf(f, "fast int allocs: pos: %d, neg: %d\n", + fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, " + "neg: %" PY_FORMAT_SIZE_T "d\n", quick_int_allocs, quick_neg_int_allocs); - fprintf(f, "null strings: %d, 1-strings: %d\n", + fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, " + "1-strings: %" PY_FORMAT_SIZE_T "d\n", null_strings, one_strings); } Modified: python/branches/py3k/Objects/tupleobject.c ============================================================================== --- python/branches/py3k/Objects/tupleobject.c (original) +++ python/branches/py3k/Objects/tupleobject.c Sun Jan 11 18:13:55 2009 @@ -19,8 +19,8 @@ static int numfree[PyTuple_MAXSAVESIZE]; #endif #ifdef COUNT_ALLOCS -int fast_tuple_allocs; -int tuple_zero_allocs; +Py_ssize_t fast_tuple_allocs; +Py_ssize_t tuple_zero_allocs; #endif PyObject * From buildbot at python.org Sun Jan 11 18:16:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 17:16:49 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090111171649.836A81E4002@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/884 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: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_xmlrpc ====================================================================== ERROR: test_dotted_attribute (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 492, in test_dotted_attribute self.test_simple1() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 376, in test_simple1 self.assertEqual(p.pow(6,8), 6**8) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection1 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 398, in test_introspection1 meth = p.system.listMethods() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection2 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 413, in test_introspection2 divhelp = p.system.methodHelp('div') File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection3 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 425, in test_introspection3 myfunction = p.system.methodHelp('my_function') File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection4 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 438, in test_introspection4 divsig = p.system.methodSignature('div') File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_multicall (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 453, in test_multicall add_result, pow_result, div_result = multicall() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1042, in __call__ return MultiCallIterator(self.__server.system.multicall(marshalled_list)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_non_existing_multicall (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 468, in test_non_existing_multicall result = multicall() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1042, in __call__ return MultiCallIterator(self.__server.system.multicall(marshalled_list)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_simple1 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 376, in test_simple1 self.assertEqual(p.pow(6,8), 6**8) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_basic (test.test_xmlrpc.FailingServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 534, in test_basic self.assertEqual(p.pow(6,8), 6**8) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 11 18:53:33 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 11 Jan 2009 18:53:33 +0100 (CET) Subject: [Python-checkins] r68534 - python/trunk/Doc/library/hashlib.rst Message-ID: <20090111175333.9D5E71E402C@bag.python.org> Author: gregory.p.smith Date: Sun Jan 11 18:53:33 2009 New Revision: 68534 Log: correct email address Modified: python/trunk/Doc/library/hashlib.rst Modified: python/trunk/Doc/library/hashlib.rst ============================================================================== --- python/trunk/Doc/library/hashlib.rst (original) +++ python/trunk/Doc/library/hashlib.rst Sun Jan 11 18:53:33 2009 @@ -4,8 +4,8 @@ .. module:: hashlib :synopsis: Secure hash and message digest algorithms. -.. moduleauthor:: Gregory P. Smith -.. sectionauthor:: Gregory P. Smith +.. moduleauthor:: Gregory P. Smith +.. sectionauthor:: Gregory P. Smith .. versionadded:: 2.5 From python-checkins at python.org Sun Jan 11 18:57:54 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 11 Jan 2009 18:57:54 +0100 (CET) Subject: [Python-checkins] r68535 - in python/trunk/Doc/library: binascii.rst zlib.rst Message-ID: <20090111175754.4A38F1E4002@bag.python.org> Author: gregory.p.smith Date: Sun Jan 11 18:57:54 2009 New Revision: 68535 Log: Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. Modified: python/trunk/Doc/library/binascii.rst python/trunk/Doc/library/zlib.rst Modified: python/trunk/Doc/library/binascii.rst ============================================================================== --- python/trunk/Doc/library/binascii.rst (original) +++ python/trunk/Doc/library/binascii.rst Sun Jan 11 18:57:54 2009 @@ -113,8 +113,25 @@ print binascii.crc32("hello world") # Or, in two pieces: crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) - print crc + crc = binascii.crc32(" world", crc) & 0xffffffff + print 'crc32 = 0x%08x' % crc + +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 2.6 + The return value will always be 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] + regardless of platform. .. function:: b2a_hex(data) Modified: python/trunk/Doc/library/zlib.rst ============================================================================== --- python/trunk/Doc/library/zlib.rst (original) +++ python/trunk/Doc/library/zlib.rst Sun Jan 11 18:57:54 2009 @@ -31,22 +31,34 @@ Exception raised on compression and decompression errors. -.. function:: adler32(string[, value]) +.. function:: adler32(data[, value]) - Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as + Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much more quickly.) If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. This function always returns an integer object. - .. versionchanged:: 2.6 - For consistent cross-platform behavior we always return a signed integer. - ie: Results in the (2**31)...(2**32-1) range will be negative. +.. note:: + 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 + 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 + 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] + regardless of platform. .. function:: compress(string[, level]) @@ -66,25 +78,37 @@ ``9`` is slowest and produces the most. The default value is ``6``. -.. function:: crc32(string[, value]) +.. function:: crc32(data[, value]) .. index:: single: Cyclic Redundancy Check single: checksum; Cyclic Redundancy Check - Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is + Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. This function always returns an integer object. - .. versionchanged:: 2.6 - For consistent cross-platform behavior we always return a signed integer. - ie: Results in the (2**31)...(2**32-1) range will be negative. +.. note:: + 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 + 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 + 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] + regardless of platform. .. function:: decompress(string[, wbits[, bufsize]]) From buildbot at python.org Sun Jan 11 19:01:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 18:01:37 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090111180137.701E61E4002@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/98 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 Sun Jan 11 20:48:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 11 Jan 2009 20:48:15 +0100 (CET) Subject: [Python-checkins] r68536 - in python/trunk/Doc/library: 2to3.rst io.rst Message-ID: <20090111194815.C47801E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 11 20:48:15 2009 New Revision: 68536 Log: add email addresses Modified: python/trunk/Doc/library/2to3.rst python/trunk/Doc/library/io.rst Modified: python/trunk/Doc/library/2to3.rst ============================================================================== --- python/trunk/Doc/library/2to3.rst (original) +++ python/trunk/Doc/library/2to3.rst Sun Jan 11 20:48:15 2009 @@ -3,7 +3,7 @@ 2to3 - Automated Python 2 to 3 code translation =============================================== -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson 2to3 is a Python program that reads Python 2.x source code and applies a series of *fixers* to transform it into valid Python 3.x code. The standard library Modified: python/trunk/Doc/library/io.rst ============================================================================== --- python/trunk/Doc/library/io.rst (original) +++ python/trunk/Doc/library/io.rst Sun Jan 11 20:48:15 2009 @@ -6,7 +6,7 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson .. versionadded:: 2.6 The :mod:`io` module provides the Python interfaces to stream handling. The From nnorwitz at gmail.com Sun Jan 11 22:09:02 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 11 Jan 2009 16:09:02 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090111210902.GA19583@python.psfb.org> 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [656594 refs] From nnorwitz at gmail.com Sun Jan 11 22:15:49 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 11 Jan 2009 16:15:49 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090111211549.GA20984@python.psfb.org> 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [655869 refs] From buildbot at python.org Sun Jan 11 22:29:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 11 Jan 2009 21:29:01 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090111212902.19ACE1E4002@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/77 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,gregory.p.smith,hirokazu.yamamoto,kristjan.jonsson,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_xmlrpc ====================================================================== ERROR: test_dotted_attribute (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 492, in test_dotted_attribute self.test_simple1() File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 376, in test_simple1 self.assertEqual(p.pow(6,8), 6**8) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection1 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 398, in test_introspection1 meth = p.system.listMethods() File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection2 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 413, in test_introspection2 divhelp = p.system.methodHelp('div') File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection3 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 425, in test_introspection3 myfunction = p.system.methodHelp('my_function') File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_introspection4 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 438, in test_introspection4 divsig = p.system.methodSignature('div') File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_multicall (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 453, in test_multicall add_result, pow_result, div_result = multicall() File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1042, in __call__ return MultiCallIterator(self.__server.system.multicall(marshalled_list)) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_non_existing_multicall (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 468, in test_non_existing_multicall result = multicall() File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1042, in __call__ return MultiCallIterator(self.__server.system.multicall(marshalled_list)) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_simple1 (test.test_xmlrpc.SimpleServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 376, in test_simple1 self.assertEqual(p.pow(6,8), 6**8) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' ====================================================================== ERROR: test_basic (test.test_xmlrpc.FailingServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_xmlrpc.py", line 534, in test_basic self.assertEqual(p.pow(6,8), 6**8) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1465, in __request verbose=self.__verbose File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/xmlrpclib.py", line 1248, in request return self._parse_response(h.getfile()) AttributeError: Transport instance has no attribute '_parse_response' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Sun Jan 11 23:34:40 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 11 Jan 2009 17:34:40 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090111223440.GA1306@python.psfb.org> 333 tests OK. 1 test failed: test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-31098 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 333 tests OK. 1 test failed: test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [670464 refs] From python-checkins at python.org Mon Jan 12 00:56:55 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 00:56:55 +0100 (CET) Subject: [Python-checkins] r68537 - python/branches/py3k/Objects/unicodeobject.c Message-ID: <20090111235655.952441E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 00:56:55 2009 New Revision: 68537 Log: Issue #4916: fix little-endian UTF-16 decoding bug on big-endian UCS-4 builds, introduced by r68483. Modified: python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Mon Jan 12 00:56:55 2009 @@ -2791,16 +2791,24 @@ _p[3] = 0; #endif #endif - ((unsigned char *) _p)[1] = _q[0]; - ((unsigned char *) _p)[0] = _q[1]; - ((unsigned char *) _p)[1 + Py_UNICODE_SIZE] = _q[2]; - ((unsigned char *) _p)[0 + Py_UNICODE_SIZE] = _q[3]; + /* Issue #4916; UCS-4 builds on big endian machines must + fill the two last bytes of each 4-byte unit. */ +#if (!defined(BYTEORDER_IS_LITTLE_ENDIAN) && Py_UNICODE_SIZE > 2) +# define OFF 2 +#else +# define OFF 0 +#endif + ((unsigned char *) _p)[OFF + 1] = _q[0]; + ((unsigned char *) _p)[OFF + 0] = _q[1]; + ((unsigned char *) _p)[OFF + 1 + Py_UNICODE_SIZE] = _q[2]; + ((unsigned char *) _p)[OFF + 0 + Py_UNICODE_SIZE] = _q[3]; #if (SIZEOF_LONG == 8) - ((unsigned char *) _p)[1 + 2 * Py_UNICODE_SIZE] = _q[4]; - ((unsigned char *) _p)[0 + 2 * Py_UNICODE_SIZE] = _q[5]; - ((unsigned char *) _p)[1 + 3 * Py_UNICODE_SIZE] = _q[6]; - ((unsigned char *) _p)[0 + 3 * Py_UNICODE_SIZE] = _q[7]; + ((unsigned char *) _p)[OFF + 1 + 2 * Py_UNICODE_SIZE] = _q[4]; + ((unsigned char *) _p)[OFF + 0 + 2 * Py_UNICODE_SIZE] = _q[5]; + ((unsigned char *) _p)[OFF + 1 + 3 * Py_UNICODE_SIZE] = _q[6]; + ((unsigned char *) _p)[OFF + 0 + 3 * Py_UNICODE_SIZE] = _q[7]; #endif +#undef OFF _q += SIZEOF_LONG; _p += SIZEOF_LONG / 2; } From buildbot at python.org Mon Jan 12 01:13:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 12 Jan 2009 00:13:32 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090112001332.41F821E4002@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/111 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 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 Jan 12 01:28:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 12 Jan 2009 01:28:16 +0100 (CET) Subject: [Python-checkins] r68538 - python/branches/py3k/Doc/c-api/bytes.rst Message-ID: <20090112002816.DC38E1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 12 01:28:16 2009 New Revision: 68538 Log: remove docs for PyBytes_Format #4917 Modified: python/branches/py3k/Doc/c-api/bytes.rst Modified: python/branches/py3k/Doc/c-api/bytes.rst ============================================================================== --- python/branches/py3k/Doc/c-api/bytes.rst (original) +++ python/branches/py3k/Doc/c-api/bytes.rst Mon Jan 12 01:28:16 2009 @@ -192,9 +192,3 @@ reallocation fails, the original bytes object at *\*bytes* is deallocated, *\*bytes* is set to *NULL*, a memory exception is set, and ``-1`` is returned. - - -.. cfunction:: PyObject* PyBytes_Format(PyObject *format, PyObject *args) - - Return a new bytes object from *format* and *args*. Analogous to ``format % - args``. The *args* argument must be a tuple. From python-checkins at python.org Mon Jan 12 05:50:11 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 12 Jan 2009 05:50:11 +0100 (CET) Subject: [Python-checkins] r68539 - in python/branches/py3k: Lib/socket.py Lib/test/test_socket.py Misc/NEWS Message-ID: <20090112045011.61A731E4002@bag.python.org> Author: gregory.p.smith Date: Mon Jan 12 05:50:11 2009 New Revision: 68539 Log: Fixes issue #3826 and #4791: Have SocketIO objects update their reference count in the underlying socket object on close() so that the underlying socket object is closed immediately when the last user is done rather than at an unknown later time when garbage collection can do it. Modified: python/branches/py3k/Lib/socket.py python/branches/py3k/Lib/test/test_socket.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/socket.py ============================================================================== --- python/branches/py3k/Lib/socket.py (original) +++ python/branches/py3k/Lib/socket.py Mon Jan 12 05:50:11 2009 @@ -225,11 +225,12 @@ return self._writing and not self.closed def fileno(self): + self._checkClosed() return self._sock.fileno() @property def name(self): - return self._sock.fileno() + return self.fileno() @property def mode(self): @@ -239,9 +240,12 @@ if self.closed: return io.RawIOBase.close(self) + self._sock._decref_socketios() + self._sock = None def __del__(self): - self._sock._decref_socketios() + if not self.closed: + self._sock._decref_socketios() def getfqdn(name=''): 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 Mon Jan 12 05:50:11 2009 @@ -856,6 +856,16 @@ self.assertEqual(self.cli_file.mode, 'wb') self.assertEqual(self.cli_file.name, self.serv_conn.fileno()) + def testRealClose(self): + self.serv_file.close() + self.assertRaises(ValueError, self.serv_file.fileno) + self.cli_conn.close() + self.assertRaises(socket.error, self.cli_conn.getsockname) + + def _testRealClose(self): + pass + + class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase): """Repeat the tests from FileObjectClassTestCase with bufsize==0. @@ -881,6 +891,29 @@ self.cli_file.write(b"B. " + MSG) self.cli_file.flush() + def testMakefileClose(self): + # The file returned by makefile should keep the socket open... + self.cli_conn.close() + msg = self.cli_conn.recv(1024) + self.assertEqual(msg, MSG) + # ...until the file is itself closed + self.serv_file.close() + self.assertRaises(socket.error, self.cli_conn.recv, 1024) + + def _testMakefileClose(self): + self.cli_file.write(MSG) + self.cli_file.flush() + + def testMakefileCloseSocketDestroy(self): + refcount_before = sys.getrefcount(self.cli_conn) + self.serv_file.close() + refcount_after = sys.getrefcount(self.cli_conn) + self.assertEqual(refcount_before - 1, refcount_after) + + def _testMakefileCloseSocketDestroy(self): + pass + + class LineBufferedFileObjectClassTestCase(FileObjectClassTestCase): bufsize = 1 # Default-buffered for reading; line-buffered for writing Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 12 05:50:11 2009 @@ -111,6 +111,10 @@ Library ------- +- Issue #3826 and #4791: The socket module now closes the underlying socket + appropriately when it is being used via socket.makefile() objects + rather than delaying the close by waiting for garbage collection to do it. + - Issue #3860: GzipFile and BZ2File now support the context manager protocol. - Issue #4867: Fixed a crash in ctypes when passing a string to a From buildbot at python.org Mon Jan 12 06:46:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 12 Jan 2009 05:46:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090112054612.5A2FE1E4002@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/100 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,gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Mon Jan 12 08:57:11 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 12 Jan 2009 08:57:11 +0100 (CET) Subject: [Python-checkins] r68540 - in python/trunk: Misc/NEWS Python/sysmodule.c Message-ID: <20090112075711.A4B621E4002@bag.python.org> Author: martin.v.loewis Date: Mon Jan 12 08:57:11 2009 New Revision: 68540 Log: Issue #4915: Port sysmodule to Windows CE. Modified: python/trunk/Misc/NEWS python/trunk/Python/sysmodule.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 12 08:57:11 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4915: Port sysmodule to Windows CE. + - 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 Modified: python/trunk/Python/sysmodule.c ============================================================================== --- python/trunk/Python/sysmodule.c (original) +++ python/trunk/Python/sysmodule.c Mon Jan 12 08:57:11 2009 @@ -1296,8 +1296,13 @@ PyDict_SetItemString(sysdict, key, v); \ Py_XDECREF(v) + /* Check that stdin is not a directory + Using shell redirection, you can redirect stdin to a directory, + crashing the Python interpreter. Catch this common mistake here + and output a useful error message. Note that under MS Windows, + the shell already prevents that. */ +#if !defined(MS_WINDOWS) { - /* XXX: does this work on Win/Win64? (see posix_fstat) */ struct stat sb; if (fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { @@ -1307,6 +1312,7 @@ exit(EXIT_FAILURE); } } +#endif /* Closing the standard FILE* if sys.std* goes aways causes problems * for embedded Python usages. Closing them when somebody explicitly @@ -1526,7 +1532,7 @@ { #if defined(HAVE_REALPATH) char fullpath[MAXPATHLEN]; -#elif defined(MS_WINDOWS) +#elif defined(MS_WINDOWS) && !defined(MS_WINCE) char fullpath[MAX_PATH]; #endif PyObject *av = makeargvobject(argc, argv); @@ -1571,7 +1577,10 @@ #if SEP == '\\' /* Special case for MS filename syntax */ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { char *q; -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) && !defined(MS_WINCE) + /* This code here replaces the first element in argv with the full + path that it represents. Under CE, there are no relative paths so + the argument must be the full path anyway. */ char *ptemp; if (GetFullPathName(argv0, sizeof(fullpath), From python-checkins at python.org Mon Jan 12 08:59:10 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 12 Jan 2009 08:59:10 +0100 (CET) Subject: [Python-checkins] r68541 - in python/branches/py3k: Misc/NEWS Python/sysmodule.c Message-ID: <20090112075910.58E0D1E4002@bag.python.org> Author: martin.v.loewis Date: Mon Jan 12 08:59:10 2009 New Revision: 68541 Log: Merged revisions 68540 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68540 | martin.v.loewis | 2009-01-12 08:57:11 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4915: Port sysmodule to Windows CE. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Python/sysmodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 12 08:59:10 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4915: Port sysmodule to Windows CE. + - Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The common cases are optimized thanks to a dedicated fast path and a moderate amount of loop unrolling. Modified: python/branches/py3k/Python/sysmodule.c ============================================================================== --- python/branches/py3k/Python/sysmodule.c (original) +++ python/branches/py3k/Python/sysmodule.c Mon Jan 12 08:59:10 2009 @@ -1257,8 +1257,13 @@ PyDict_SetItemString(sysdict, key, v); \ Py_XDECREF(v) + /* Check that stdin is not a directory + Using shell redirection, you can redirect stdin to a directory, + crashing the Python interpreter. Catch this common mistake here + and output a useful error message. Note that under MS Windows, + the shell already prevents that. */ +#if !defined(MS_WINDOWS) { - /* XXX: does this work on Win/Win64? (see posix_fstat) */ struct stat sb; if (fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { @@ -1268,6 +1273,7 @@ exit(EXIT_FAILURE); } } +#endif /* stdin/stdout/stderr are now set by pythonrun.c */ @@ -1483,7 +1489,7 @@ { #if defined(HAVE_REALPATH) wchar_t fullpath[MAXPATHLEN]; -#elif defined(MS_WINDOWS) +#elif defined(MS_WINDOWS) && !defined(MS_WINCE) wchar_t fullpath[MAX_PATH]; #endif PyObject *av = makeargvobject(argc, argv); @@ -1529,7 +1535,10 @@ #if SEP == '\\' /* Special case for MS filename syntax */ if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) { wchar_t *q; -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) && !defined(MS_WINCE) + /* This code here replaces the first element in argv with the full + path that it represents. Under CE, there are no relative paths so + the argument must be the full path anyway. */ wchar_t *ptemp; if (GetFullPathNameW(argv0, sizeof(fullpath)/sizeof(fullpath[0]), From python-checkins at python.org Mon Jan 12 09:11:24 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 12 Jan 2009 09:11:24 +0100 (CET) Subject: [Python-checkins] r68542 - in python/trunk: Misc/NEWS Python/thread.c Python/thread_nt.h Message-ID: <20090112081124.A24CB1E400C@bag.python.org> Author: martin.v.loewis Date: Mon Jan 12 09:11:24 2009 New Revision: 68542 Log: Issue #4893: Use NT threading on CE. Modified: python/trunk/Misc/NEWS python/trunk/Python/thread.c python/trunk/Python/thread_nt.h Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 12 09:11:24 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4893: Use NT threading on CE. + - Issue #4915: Port sysmodule to Windows CE. - Issue #4074: Change the criteria for doing a full garbage collection (i.e. Modified: python/trunk/Python/thread.c ============================================================================== --- python/trunk/Python/thread.c (original) +++ python/trunk/Python/thread.c Mon Jan 12 09:11:24 2009 @@ -137,10 +137,6 @@ #include "thread_beos.h" #endif -#ifdef WINCE_THREADS -#include "thread_wince.h" -#endif - #ifdef PLAN9_THREADS #include "thread_plan9.h" #endif Modified: python/trunk/Python/thread_nt.h ============================================================================== --- python/trunk/Python/thread_nt.h (original) +++ python/trunk/Python/thread_nt.h Mon Jan 12 09:11:24 2009 @@ -106,8 +106,13 @@ void *arg; } callobj; -/* thunker to call a __cdecl function instead of a __stdcall */ +/* thunker to call adapt between the function type used by the system's +thread start function and the internally used one. */ +#if defined(MS_WINCE) +static DWORD WINAPI +#else static unsigned __stdcall +#endif bootstrap(void *call) { callobj *obj = (callobj*)call; @@ -135,24 +140,38 @@ return -1; obj->func = func; obj->arg = arg; +#if defined(MS_WINCE) + hThread = CreateThread(NULL, + Py_SAFE_DOWNCAST(_pythread_stacksize, Py_ssize_t, SIZE_T), + bootstrap, obj, 0, &threadID); +#else hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(_pythread_stacksize, Py_ssize_t, unsigned int), bootstrap, obj, 0, &threadID); +#endif if (hThread == 0) { +#if defined(MS_WINCE) + /* Save error in variable, to prevent PyThread_get_thread_ident + from clobbering it. */ + unsigned e = GetLastError(); + dprintf(("%ld: PyThread_start_new_thread failed, win32 error code %u\n", + PyThread_get_thread_ident(), e)); +#else /* I've seen errno == EAGAIN here, which means "there are * too many threads". */ + int e = errno; dprintf(("%ld: PyThread_start_new_thread failed, errno %d\n", - PyThread_get_thread_ident(), errno)); + PyThread_get_thread_ident(), e)); +#endif threadID = (unsigned)-1; HeapFree(GetProcessHeap(), 0, obj); } else { dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", PyThread_get_thread_ident(), (void*)hThread)); - /* wait for thread to initialize, so we can get its id */ CloseHandle(hThread); } return (long) threadID; @@ -177,7 +196,11 @@ dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); if (!initialized) exit(0); +#if defined(MS_WINCE) + ExitThread(0); +#else _endthreadex(0); +#endif } #ifndef NO_EXIT_PROG From python-checkins at python.org Mon Jan 12 09:21:03 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 12 Jan 2009 09:21:03 +0100 (CET) Subject: [Python-checkins] r68543 - in python/branches/py3k: Misc/NEWS Python/thread.c Python/thread_nt.h Message-ID: <20090112082103.CF6A01E4002@bag.python.org> Author: martin.v.loewis Date: Mon Jan 12 09:21:03 2009 New Revision: 68543 Log: Merged revisions 68455,68476,68542 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68455 | kristjan.jonsson | 2009-01-09 21:03:27 +0100 (Fr, 09 Jan 2009) | 1 line Issue 3582. Improved thread support and TLS for Windows ........ r68476 | kristjan.jonsson | 2009-01-10 13:14:31 +0100 (Sa, 10 Jan 2009) | 1 line Issue 4906: Preserve windows error state across PyThread_get_key_value ........ r68542 | martin.v.loewis | 2009-01-12 09:11:24 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4893: Use NT threading on CE. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Python/thread.c python/branches/py3k/Python/thread_nt.h Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 12 09:21:03 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4893: Use NT threading on CE. + - Issue #4915: Port sysmodule to Windows CE. - Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The Modified: python/branches/py3k/Python/thread.c ============================================================================== --- python/branches/py3k/Python/thread.c (original) +++ python/branches/py3k/Python/thread.c Mon Jan 12 09:21:03 2009 @@ -133,10 +133,6 @@ #include "thread_os2.h" #endif -#ifdef WINCE_THREADS -#include "thread_wince.h" -#endif - #ifdef PLAN9_THREADS #include "thread_plan9.h" #endif Modified: python/branches/py3k/Python/thread_nt.h ============================================================================== --- python/branches/py3k/Python/thread_nt.h (original) +++ python/branches/py3k/Python/thread_nt.h Mon Jan 12 09:21:03 2009 @@ -104,20 +104,21 @@ typedef struct { void (*func)(void*); void *arg; - long id; - HANDLE done; } callobj; -static int +/* thunker to call adapt between the function type used by the system's +thread start function and the internally used one. */ +#if defined(MS_WINCE) +static DWORD WINAPI +#else +static unsigned __stdcall +#endif bootstrap(void *call) { callobj *obj = (callobj*)call; - /* copy callobj since other thread might free it before we're done */ void (*func)(void*) = obj->func; void *arg = obj->arg; - - obj->id = PyThread_get_thread_ident(); - ReleaseSemaphore(obj->done, 1, NULL); + HeapFree(GetProcessHeap(), 0, obj); func(arg); return 0; } @@ -125,42 +126,55 @@ long PyThread_start_new_thread(void (*func)(void *), void *arg) { - Py_uintptr_t rv; - callobj obj; - + HANDLE hThread; + unsigned threadID; + callobj *obj; + dprintf(("%ld: PyThread_start_new_thread called\n", PyThread_get_thread_ident())); if (!initialized) PyThread_init_thread(); - obj.id = -1; /* guilty until proved innocent */ - obj.func = func; - obj.arg = arg; - obj.done = CreateSemaphore(NULL, 0, 1, NULL); - if (obj.done == NULL) + obj = (callobj*)HeapAlloc(GetProcessHeap(), 0, sizeof(*obj)); + if (!obj) return -1; - - rv = _beginthread(bootstrap, + obj->func = func; + obj->arg = arg; +#if defined(MS_WINCE) + hThread = CreateThread(NULL, + Py_SAFE_DOWNCAST(_pythread_stacksize, Py_ssize_t, SIZE_T), + bootstrap, obj, 0, &threadID); +#else + hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(_pythread_stacksize, - Py_ssize_t, int), - &obj); - if (rv == (Py_uintptr_t)-1) { + Py_ssize_t, unsigned int), + bootstrap, obj, + 0, &threadID); +#endif + if (hThread == 0) { +#if defined(MS_WINCE) + /* Save error in variable, to prevent PyThread_get_thread_ident + from clobbering it. */ + unsigned e = GetLastError(); + dprintf(("%ld: PyThread_start_new_thread failed, win32 error code %u\n", + PyThread_get_thread_ident(), e)); +#else /* I've seen errno == EAGAIN here, which means "there are * too many threads". */ - dprintf(("%ld: PyThread_start_new_thread failed: %p errno %d\n", - PyThread_get_thread_ident(), (void*)rv, errno)); - obj.id = -1; + int e = errno; + dprintf(("%ld: PyThread_start_new_thread failed, errno %d\n", + PyThread_get_thread_ident(), e)); +#endif + threadID = (unsigned)-1; + HeapFree(GetProcessHeap(), 0, obj); } else { dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", - PyThread_get_thread_ident(), (void*)rv)); - /* wait for thread to initialize, so we can get its id */ - WaitForSingleObject(obj.done, INFINITE); - assert(obj.id != -1); + PyThread_get_thread_ident(), (void*)hThread)); + CloseHandle(hThread); } - CloseHandle((HANDLE)obj.done); - return obj.id; + return (long) threadID; } /* @@ -176,52 +190,26 @@ return GetCurrentThreadId(); } -static void -do_PyThread_exit_thread(int no_cleanup) -{ - dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); - if (!initialized) - if (no_cleanup) - _exit(0); - else - exit(0); - _endthread(); -} - void PyThread_exit_thread(void) { - do_PyThread_exit_thread(0); -} - -void -PyThread__exit_thread(void) -{ - do_PyThread_exit_thread(1); -} - -#ifndef NO_EXIT_PROG -static void -do_PyThread_exit_prog(int status, int no_cleanup) -{ - dprintf(("PyThread_exit_prog(%d) called\n", status)); + dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); if (!initialized) - if (no_cleanup) - _exit(status); - else - exit(status); + exit(0); +#if defined(MS_WINCE) + ExitThread(0); +#else + _endthreadex(0); +#endif } +#ifndef NO_EXIT_PROG void PyThread_exit_prog(int status) { - do_PyThread_exit_prog(status, 0); -} - -void -PyThread__exit_prog(int status) -{ - do_PyThread_exit_prog(status, 1); + dprintf(("PyThread_exit_prog(%d) called\n", status)); + if (!initialized) + exit(status); } #endif /* NO_EXIT_PROG */ @@ -309,3 +297,73 @@ } #define THREAD_SET_STACKSIZE(x) _pythread_nt_set_stacksize(x) + + +/* use native Windows TLS functions */ +#define Py_HAVE_NATIVE_TLS + +#ifdef Py_HAVE_NATIVE_TLS +int +PyThread_create_key(void) +{ + return (int) TlsAlloc(); +} + +void +PyThread_delete_key(int key) +{ + TlsFree(key); +} + +/* We must be careful to emulate the strange semantics implemented in thread.c, + * where the value is only set if it hasn't been set before. + */ +int +PyThread_set_key_value(int key, void *value) +{ + BOOL ok; + void *oldvalue; + + assert(value != NULL); + oldvalue = TlsGetValue(key); + if (oldvalue != NULL) + /* ignore value if already set */ + return 0; + ok = TlsSetValue(key, value); + if (!ok) + return -1; + return 0; +} + +void * +PyThread_get_key_value(int key) +{ + /* because TLS is used in the Py_END_ALLOW_THREAD macro, + * it is necessary to preserve the windows error state, because + * it is assumed to be preserved across the call to the macro. + * Ideally, the macro should be fixed, but it is simpler to + * do it here. + */ + DWORD error = GetLastError(); + void *result = TlsGetValue(key); + SetLastError(error); + return result; +} + +void +PyThread_delete_key_value(int key) +{ + /* NULL is used as "key missing", and it is also the default + * given by TlsGetValue() if nothing has been set yet. + */ + TlsSetValue(key, NULL); +} + +/* reinitialization of TLS is not necessary after fork when using + * the native TLS functions. And forking isn't supported on Windows either. + */ +void +PyThread_ReInitTLS(void) +{} + +#endif From nnorwitz at gmail.com Mon Jan 12 10:08:21 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 12 Jan 2009 04:08:21 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090112090821.GA25572@python.psfb.org> 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [656597 refs] From nnorwitz at gmail.com Mon Jan 12 10:14:48 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 12 Jan 2009 04:14:48 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090112091448.GA26930@python.psfb.org> 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 328 tests OK. 1 test failed: test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [655869 refs] From python-checkins at python.org Mon Jan 12 10:20:34 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Mon, 12 Jan 2009 10:20:34 +0100 (CET) Subject: [Python-checkins] r68544 - python/trunk/Misc/NEWS Message-ID: <20090112092034.BAC831E400C@bag.python.org> Author: kristjan.jonsson Date: Mon Jan 12 10:20:34 2009 New Revision: 68544 Log: Update Misc/NEWS for issue 3582 Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 12 10:20:34 2009 @@ -123,6 +123,8 @@ - Issue #4748: Lambda generators no longer return a value. +- Issue #3582: Use native TLS functions on Windows + Library ------- From python-checkins at python.org Mon Jan 12 10:24:04 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Mon, 12 Jan 2009 10:24:04 +0100 (CET) Subject: [Python-checkins] r68545 - python/trunk/Misc/NEWS Message-ID: <20090112092404.6B8C81E4002@bag.python.org> Author: kristjan.jonsson Date: Mon Jan 12 10:24:04 2009 New Revision: 68545 Log: Misc/NEWS for issue 4293 Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 12 10:24:04 2009 @@ -335,6 +335,9 @@ - Issue #4122: On Windows, fix a compilation error when using the Py_UNICODE_ISSPACE macro in an extension module. + +- Issue #4293: Py_AddPendingCall is now thread safe and can be used for + asynchronous notifications to python from any thread. Documentation added. Extension Modules ----------------- From buildbot at python.org Mon Jan 12 10:27:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 12 Jan 2009 09:27:53 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090112092753.83E5B1E4002@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/102 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_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 nnorwitz at gmail.com Mon Jan 12 11:31:25 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 12 Jan 2009 05:31:25 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090112103125.GA7479@python.psfb.org> 333 tests OK. 1 test failed: test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-4861 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 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 333 tests OK. 1 test failed: test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [670466 refs] From python-checkins at python.org Mon Jan 12 11:37:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 12 Jan 2009 11:37:32 +0100 (CET) Subject: [Python-checkins] r68546 - python/trunk/Lib/heapq.py Message-ID: <20090112103732.DAC821E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 12 11:37:32 2009 New Revision: 68546 Log: Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size. Modified: python/trunk/Lib/heapq.py Modified: python/trunk/Lib/heapq.py ============================================================================== --- python/trunk/Lib/heapq.py (original) +++ python/trunk/Lib/heapq.py Mon Jan 12 11:37:32 2009 @@ -129,7 +129,7 @@ __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge', 'nlargest', 'nsmallest', 'heappushpop'] -from itertools import islice, repeat, count, imap, izip, tee +from itertools import islice, repeat, count, imap, izip, tee, chain from operator import itemgetter, neg import bisect @@ -354,10 +354,32 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + # Short-cut for n==1 is to use min() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [min(chain(head, it))] + return [min(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key)[:n] + + # When key is none, use simpler decoration if key is None: it = izip(iterable, count()) # decorate result = _nsmallest(n, it) return map(itemgetter(0), result) # undecorate + + # General case, slowest method in1, in2 = tee(iterable) it = izip(imap(key, in1), count(), in2) # decorate result = _nsmallest(n, it) @@ -369,10 +391,33 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + + # Short-cut for n==1 is to use max() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [max(chain(head, it))] + return [max(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key, reverse=True)[:n] + + # When key is none, use simpler decoration if key is None: it = izip(iterable, imap(neg, count())) # 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 result = _nlargest(n, it) From python-checkins at python.org Mon Jan 12 19:09:28 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Mon, 12 Jan 2009 19:09:28 +0100 (CET) Subject: [Python-checkins] r68547 - in python/trunk/Lib/test: test_datetime.py test_os.py Message-ID: <20090112180928.2E3471E404C@bag.python.org> Author: kristjan.jonsson Date: Mon Jan 12 19:09:27 2009 New Revision: 68547 Log: Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. Modified: python/trunk/Lib/test/test_datetime.py python/trunk/Lib/test/test_os.py Modified: python/trunk/Lib/test/test_datetime.py ============================================================================== --- python/trunk/Lib/test/test_datetime.py (original) +++ python/trunk/Lib/test/test_datetime.py Mon Jan 12 19:09:27 2009 @@ -856,6 +856,14 @@ # A naive object replaces %z and %Z w/ empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + #make sure that invalid format specifiers are handled correctly + self.assertRaises(ValueError, t.strftime, "%e") + self.assertRaises(ValueError, t.strftime, "%") + self.assertRaises(ValueError, t.strftime, "%#") + + #check that this standard extension works + t.strftime("%f") + def test_format(self): dt = self.theclass(2007, 9, 10) Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Mon Jan 12 19:09:27 2009 @@ -533,6 +533,55 @@ def test_chmod(self): self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) +class TestInvalidFD(unittest.TestCase): + singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat", + "fstatvfs", "fsync", "tcgetpgrp", "ttyname"] + def get_single(f): + def helper(self): + if getattr(os, f, None): + self.assertRaises(OSError, getattr(os, f), 10) + return helper + for f in singles: + locals()["test_"+f] = get_single(f) + + def test_isatty(self): + self.assertEqual(os.isatty(10), False) + + def test_closerange(self): + self.assertEqual(os.closerange(10, 20), None) + + def test_dup2(self): + self.assertRaises(OSError, os.dup2, 10, 20) + + def test_fchmod(self): + if hasattr(os, "fchmod"): + self.assertRaises(OSError, os.fchmod, 10, 0) + + def test_fchown(self): + if hasattr(os, "fchown"): + self.assertRaises(OSError, os.fchmod, 10, -1, -1) + + def test_fpathconf(self): + if hasattr(os, "fpathconf"): + self.assertRaises(OSError, os.fpathconf, 10, "foo") + + def test_ftruncate(self): + if hasattr(os, "ftruncate"): + self.assertRaises(OSError, os.ftruncate, 10, 0) + + def test_lseek(self): + self.assertRaises(OSError, os.lseek, 10, 0, 0) + + def test_read(self): + self.assertRaises(OSError, os.read, 10, 1) + + def test_tcsetpgrpt(self): + if hasattr(os, "tcsetpgrp"): + self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + + def test_write(self): + self.assertRaises(OSError, os.write, 10, " ") + if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): pass @@ -547,7 +596,8 @@ MakedirTests, DevNullTests, URandomTests, - Win32ErrorTests + Win32ErrorTests, + TestInvalidFD ) if __name__ == "__main__": From python-checkins at python.org Mon Jan 12 20:03:05 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 20:03:05 +0100 (CET) Subject: [Python-checkins] r68548 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090112190305.B2A241E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 20:03:05 2009 New Revision: 68548 Log: Rewrite read1 so as not to call peek then read. Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Mon Jan 12 20:03:05 2009 @@ -424,6 +424,8 @@ /* Forward decls */ static PyObject * _BufferedWriter_flush_unlocked(BufferedObject *, int); +static Py_ssize_t +_BufferedReader_fill_buffer(BufferedObject *self); static void _BufferedReader_reset_buf(BufferedObject *self); static void @@ -604,7 +606,7 @@ static PyObject * Buffered_read1(BufferedObject *self, PyObject *args) { - Py_ssize_t n, have; + Py_ssize_t n, have, r; PyObject *res; CHECK_INITIALIZED(self) @@ -633,16 +635,30 @@ all `n` bytes asked by the caller (and possibly more, so as to fill our buffer for the next reads). */ - res = _BufferedReader_peek_unlocked(self, 1); - if (res == NULL) + have = READAHEAD(self); + if (have > 0) { + if (n > have) + n = have; + res = PyBytes_FromStringAndSize(self->buffer + self->pos, n); + if (res == NULL) + goto end; + self->pos += n; goto end; - Py_CLEAR(res); - - have = self->read_end - self->pos; - if (n > have) - n = have; + } - res = _BufferedReader_read_unlocked(self, n); + /* Fill the buffer from the raw stream, and copy it to the result. */ + _BufferedReader_reset_buf(self); + r = _BufferedReader_fill_buffer(self); + if (r == -1) + return NULL; + if (r == -2) + r = 0; + if (n > r) + n = r; + res = PyBytes_FromStringAndSize(self->buffer, n); + if (res == NULL) + goto end; + self->pos = n; end: LEAVE_BUFFERED(self) From python-checkins at python.org Mon Jan 12 20:54:46 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 20:54:46 +0100 (CET) Subject: [Python-checkins] r68549 - sandbox/trunk/io-c/_textio.c Message-ID: <20090112195446.60F251E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 20:54:46 2009 New Revision: 68549 Log: Fix the cookie packing/unpacking logic. Using offsetof() is wrong because the various struct fields can be aligned, and some parts of the intermediary bytestring ended up unitialized. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Mon Jan 12 20:54:46 2009 @@ -1314,28 +1314,48 @@ char need_eof; } CookieStruct; -/* Same structure as before, with fields in reversed order. Only used for - * offsetof(). - * - * This trick allows the copy of fields between the structure and the bytes - * buffer, while respecting both the machine's endianness and the fact that - * start_pos should be the least significant part of the packed value. +/* + To speed up cookie packing/unpacking, we store the fields in a temporary + string and call _PyLong_FromByteArray() or _PyLong_AsByteArray (resp.). + The following macros define at which offsets in the intermediary byte + string the various CookieStruct fields will be stored. */ -typedef struct { - char need_eof; - int chars_to_skip; - int bytes_to_feed; - int dec_flags; - Py_off_t start_pos; -} _CookieStruct_LE; -#define IS_LITTLE_ENDIAN (int)*(unsigned char*)&one +#define COOKIE_BUF_LEN (sizeof(Py_off_t) + 3 * sizeof(int) + sizeof(char)) + +#if defined(WORDS_BIGENDIAN) + +# define IS_LITTLE_ENDIAN 0 + +/* We want the least significant byte of start_pos to also be the least + significant byte of the cookie, which means that in big-endian mode we + must copy the fields in reverse order. */ + +# define OFF_START_POS (sizeof(char) + 3 * sizeof(int)) +# define OFF_DEC_FLAGS (sizeof(char) + 2 * sizeof(int)) +# define OFF_BYTES_TO_FEED (sizeof(char) + sizeof(int)) +# define OFF_CHARS_TO_SKIP (sizeof(char)) +# define OFF_NEED_EOF 0 + +#else + +# define IS_LITTLE_ENDIAN 1 + +/* Little-endian mode: the least significant byte of start_pos will + naturally end up the least significant byte of the cookie. */ + +# define OFF_START_POS 0 +# define OFF_DEC_FLAGS (sizeof(Py_off_t)) +# define OFF_BYTES_TO_FEED (sizeof(Py_off_t) + sizeof(int)) +# define OFF_CHARS_TO_SKIP (sizeof(Py_off_t) + 2 * sizeof(int)) +# define OFF_NEED_EOF (sizeof(Py_off_t) + 3 * sizeof(int)) + +#endif static int TextIOWrapper_parseCookie(CookieStruct *cookie, PyObject *cookieObj) { - char buffer[sizeof(CookieStruct)]; - int one = 1; + char buffer[COOKIE_BUF_LEN]; PyLongObject *cookieLong = (PyLongObject *)PyNumber_Long(cookieObj); if (cookieLong == NULL) return -1; @@ -1347,30 +1367,11 @@ } Py_DECREF(cookieLong); - if (!IS_LITTLE_ENDIAN) { - cookie->start_pos = *(Py_off_t*)(buffer + - offsetof(CookieStruct, start_pos)); - cookie->dec_flags = *(int*) (buffer + - offsetof(CookieStruct, dec_flags)); - cookie->bytes_to_feed = *(int*) (buffer + - offsetof(CookieStruct, bytes_to_feed)); - cookie->chars_to_skip = *(int*) (buffer + - offsetof(CookieStruct, chars_to_skip)); - cookie->need_eof = *(char*) (buffer + - offsetof(CookieStruct, need_eof)); - } - else { - cookie->start_pos = *(Py_off_t*)(buffer + - offsetof(_CookieStruct_LE, start_pos)); - cookie->dec_flags = *(int*) (buffer + - offsetof(_CookieStruct_LE, dec_flags)); - cookie->bytes_to_feed = *(int*) (buffer + - offsetof(_CookieStruct_LE, bytes_to_feed)); - cookie->chars_to_skip = *(int*) (buffer + - offsetof(_CookieStruct_LE, chars_to_skip)); - cookie->need_eof = *(char*) (buffer + - offsetof(_CookieStruct_LE, need_eof)); - } + cookie->start_pos = * (Py_off_t *)(buffer + OFF_START_POS); + cookie->dec_flags = * (int *) (buffer + OFF_DEC_FLAGS); + cookie->bytes_to_feed = * (int *) (buffer + OFF_BYTES_TO_FEED); + cookie->chars_to_skip = * (int *) (buffer + OFF_CHARS_TO_SKIP); + cookie->need_eof = * (char *) (buffer + OFF_NEED_EOF); return 0; } @@ -1378,33 +1379,13 @@ static PyObject * TextIOWrapper_buildCookie(CookieStruct *cookie) { - char buffer[sizeof(CookieStruct)]; - int one = 1; + char buffer[COOKIE_BUF_LEN]; - if (!IS_LITTLE_ENDIAN) { - *(Py_off_t*)(buffer + - offsetof(CookieStruct, start_pos)) = cookie->start_pos; - *(int*) (buffer + - offsetof(CookieStruct, dec_flags)) = cookie->dec_flags; - *(int*) (buffer + - offsetof(CookieStruct, bytes_to_feed)) = cookie->bytes_to_feed; - *(int*) (buffer + - offsetof(CookieStruct, chars_to_skip)) = cookie->chars_to_skip; - *(char*) (buffer + - offsetof(CookieStruct, need_eof)) = cookie->need_eof; - } - else { - *(Py_off_t*)(buffer + - offsetof(_CookieStruct_LE, start_pos)) = cookie->start_pos; - *(int*) (buffer + - offsetof(_CookieStruct_LE, dec_flags)) = cookie->dec_flags; - *(int*) (buffer + - offsetof(_CookieStruct_LE, bytes_to_feed)) = cookie->bytes_to_feed; - *(int*) (buffer + - offsetof(_CookieStruct_LE, chars_to_skip)) = cookie->chars_to_skip; - *(char*) (buffer + - offsetof(_CookieStruct_LE, need_eof)) = cookie->need_eof; - } + * (Py_off_t *)(buffer + OFF_START_POS) = cookie->start_pos; + * (int *) (buffer + OFF_DEC_FLAGS) = cookie->dec_flags; + * (int *) (buffer + OFF_BYTES_TO_FEED) = cookie->bytes_to_feed; + * (int *) (buffer + OFF_CHARS_TO_SKIP) = cookie->chars_to_skip; + * (char *) (buffer + OFF_NEED_EOF) = cookie->need_eof; return _PyLong_FromByteArray(buffer, sizeof(buffer), IS_LITTLE_ENDIAN, 0); } From python-checkins at python.org Mon Jan 12 21:06:38 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 21:06:38 +0100 (CET) Subject: [Python-checkins] r68550 - sandbox/trunk/io-c/_textio.c Message-ID: <20090112200638.BC1F71E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 21:06:38 2009 New Revision: 68550 Log: add checking for telling flag in text.seek() Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Mon Jan 12 21:06:38 2009 @@ -1580,6 +1580,11 @@ "underlying stream is not seekable"); goto fail; } + if (!self->telling) { + PyErr_SetString(PyExc_IOError, + "telling position disabled by next() call"); + goto fail; + } res = PyObject_CallMethod((PyObject *)self, "flush", NULL); if (res == NULL) From python-checkins at python.org Mon Jan 12 21:17:42 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 21:17:42 +0100 (CET) Subject: [Python-checkins] r68551 - sandbox/trunk/io-c/_textio.c Message-ID: <20090112201742.D44E61E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 21:17:41 2009 New Revision: 68551 Log: Fix fetching of an argument into an oversized variable (Py_ssize_t instead of int). Fixes all tests in test_mailbox + one test in test_io. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Mon Jan 12 21:17:41 2009 @@ -1595,7 +1595,7 @@ if (posobj == NULL) goto fail; - if(self->decoder == NULL || self->snapshot == NULL) { + if (self->decoder == NULL || self->snapshot == NULL) { assert (self->decoded_chars == NULL || PyUnicode_GetSize(self->decoded_chars) == 0); return posobj; } @@ -1651,7 +1651,7 @@ while (input < input_end) { PyObject *state; char *dec_buffer; - Py_ssize_t dec_buffer_len; + int dec_buffer_len; int dec_flags; PyObject *decoded = PyObject_CallMethod( From python-checkins at python.org Mon Jan 12 21:36:19 2009 From: python-checkins at python.org (vinay.sajip) Date: Mon, 12 Jan 2009 21:36:19 +0100 (CET) Subject: [Python-checkins] r68552 - python/trunk/Doc/library/logging.rst Message-ID: <20090112203619.0C36B1E4002@bag.python.org> Author: vinay.sajip Date: Mon Jan 12 21:36:18 2009 New Revision: 68552 Log: Minor changes/corrections in markup. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Mon Jan 12 21:36:18 2009 @@ -532,44 +532,41 @@ #. :class:`FileHandler` instances send error messages to disk files. -.. currentmodule:: logging.handlers +#. :class:`handlers.BaseRotatingHandler` is the base class for handlers that + rotate log files at a certain point. It is not meant to be instantiated + directly. Instead, use :class:`RotatingFileHandler` or + :class:`TimedRotatingFileHandler`. -#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log - files at a certain point. It is not meant to be instantiated directly. Instead, - use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. - -#. :class:`RotatingFileHandler` instances send error messages to disk files, +#. :class:`handlers.RotatingFileHandler` instances send error messages to disk files, with support for maximum log file sizes and log file rotation. -#. :class:`TimedRotatingFileHandler` instances send error messages to disk files +#. :class:`handlers.TimedRotatingFileHandler` instances send error messages to disk files rotating the log file at certain timed intervals. -#. :class:`SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`handlers.SocketHandler` instances send error messages to TCP/IP sockets. -#. :class:`DatagramHandler` instances send error messages to UDP sockets. +#. :class:`handlers.DatagramHandler` instances send error messages to UDP sockets. -#. :class:`SMTPHandler` instances send error messages to a designated email +#. :class:`handlers.SMTPHandler` instances send error messages to a designated email address. -#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon, +#. :class:`handlers.SysLogHandler` instances send error messages to a Unix syslog daemon, possibly on a remote machine. -#. :class:`NTEventLogHandler` instances send error messages to a Windows +#. :class:`handlers.NTEventLogHandler` instances send error messages to a Windows NT/2000/XP event log. -#. :class:`MemoryHandler` instances send error messages to a buffer in memory, +#. :class:`handlers.MemoryHandler` instances send error messages to a buffer in memory, which is flushed whenever specific criteria are met. -#. :class:`HTTPHandler` instances send error messages to an HTTP server using +#. :class:`handlers.HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. -#. :class:`WatchedFileHandler` instances watch the file they are logging to. If +#. :class:`handlers.WatchedFileHandler` instances watch the file they are logging to. If the file changes, it is closed and reopened using the file name. This handler is only useful on Unix-like systems; Windows does not support the underlying mechanism used. -.. currentmodule:: logging - #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if From python-checkins at python.org Mon Jan 12 21:49:19 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 12 Jan 2009 21:49:19 +0100 (CET) Subject: [Python-checkins] r68553 - in python/branches/py3k: Lib/test/test_long.py Misc/NEWS Objects/abstract.c Message-ID: <20090112204919.CBBDC1E4002@bag.python.org> Author: mark.dickinson Date: Mon Jan 12 21:49:19 2009 New Revision: 68553 Log: Issue #4910 (1st patch of a series): fix int() and the corresponding PyNumber_Int/PyNumber_Long API function so that it no longer attempts to call the __long__ method for conversion. Only the __int__ and __trunc__ methods are used. (This removes a major remaining use of the nb_long slot from the Python 3.x core.) Thanks Benjamin for review. Modified: python/branches/py3k/Lib/test/test_long.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/abstract.c Modified: python/branches/py3k/Lib/test/test_long.py ============================================================================== --- python/branches/py3k/Lib/test/test_long.py (original) +++ python/branches/py3k/Lib/test/test_long.py Mon Jan 12 21:49:19 2009 @@ -367,7 +367,7 @@ def test_conversion(self): - # Test __long__() + # Test __int__() class ClassicMissingMethods: pass self.assertRaises(TypeError, int, ClassicMissingMethods()) @@ -410,18 +410,32 @@ class Classic: pass for base in (object, Classic): - class LongOverridesTrunc(base): - def __long__(self): + class IntOverridesTrunc(base): + def __int__(self): return 42 def __trunc__(self): return -12 - self.assertEqual(int(LongOverridesTrunc()), 42) + self.assertEqual(int(IntOverridesTrunc()), 42) class JustTrunc(base): def __trunc__(self): return 42 self.assertEqual(int(JustTrunc()), 42) + class JustLong(base): + # test that __long__ no longer used in 3.x + def __long__(self): + return 42 + self.assertRaises(TypeError, int, JustLong()) + + class LongTrunc(base): + # __long__ should be ignored in 3.x + def __long__(self): + return 42 + def __trunc__(self): + return 1729 + self.assertEqual(int(LongTrunc()), 1729) + for trunc_result_base in (object, Classic): class Integral(trunc_result_base): def __int__(self): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 12 21:49:19 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API + function no longer attempt to call the __long__ slot to convert an object + to an integer. Only the __int__ and __trunc__ slots are examined. + - Issue #4893: Use NT threading on CE. - Issue #4915: Port sysmodule to Windows CE. Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Mon Jan 12 21:49:19 2009 @@ -1379,19 +1379,7 @@ } return res; } - if (m && m->nb_long) { /* This should include subclasses of long */ - /* Classic classes always take this branch. */ - PyObject *res = m->nb_long(o); - if (res && !PyLong_Check(res)) { - PyErr_Format(PyExc_TypeError, - "__long__ returned non-long (type %.200s)", - res->ob_type->tp_name); - Py_DECREF(res); - return NULL; - } - return res; - } - if (PyLong_Check(o)) /* A long subclass without nb_long */ + if (PyLong_Check(o)) /* An int subclass without nb_int */ return _PyLong_Copy((PyLongObject *)o); trunc_func = PyObject_GetAttr(o, trunc_name); if (trunc_func) { From python-checkins at python.org Mon Jan 12 21:51:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 21:51:33 +0100 (CET) Subject: [Python-checkins] r68554 - in sandbox/trunk/io-c: _textio.c test_io.py Message-ID: <20090112205133.3157B1E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 21:51:32 2009 New Revision: 68554 Log: Add a writable _CHUNK_SIZE attribute to TextIOWrapper so that we can run more of test_io.py Modified: sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Mon Jan 12 21:51:32 2009 @@ -695,6 +695,13 @@ return NULL; \ } +#define CHECK_INITIALIZED_INT(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return -1; \ + } + Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) @@ -1857,6 +1864,31 @@ return res; } +static PyObject * +TextIOWrapper_chunk_size_get(PyTextIOWrapperObject *self, void *context) +{ + CHECK_INITIALIZED(self); + return PyLong_FromSsize_t(self->chunk_size); +} + +static int +TextIOWrapper_chunk_size_set(PyTextIOWrapperObject *self, + PyObject *arg, void *context) +{ + Py_ssize_t n; + CHECK_INITIALIZED_INT(self); + n = PyNumber_AsSsize_t(arg, PyExc_TypeError); + if (n == -1 && PyErr_Occurred()) + return -1; + if (n <= 0) { + PyErr_SetString(PyExc_ValueError, + "a strictly positive integer is required"); + return -1; + } + self->chunk_size = n; + return 0; +} + static PyMethodDef TextIOWrapper_methods[] = { {"write", (PyCFunction)TextIOWrapper_write, METH_VARARGS}, {"read", (PyCFunction)TextIOWrapper_read, METH_VARARGS}, @@ -1892,6 +1924,8 @@ /* {"mode", (getter)TextIOWrapper_mode_get, NULL, NULL}, */ {"newlines", (getter)TextIOWrapper_newlines_get, NULL, NULL}, + {"_CHUNK_SIZE", (getter)TextIOWrapper_chunk_size_get, + (setter)TextIOWrapper_chunk_size_set, NULL}, {0} }; Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 12 21:51:32 2009 @@ -15,6 +15,12 @@ import io # The module under test +def _default_chunk_size(): + """Get the default TextIOWrapper chunk size""" + with open(__file__, "r", encoding="latin1") as f: + return f._CHUNK_SIZE + + class MockRawIO(io.RawIOBase): def __init__(self, read_stack=()): @@ -1332,7 +1338,7 @@ f.close() def testSeeking(self): - chunk_size = io.TextIOWrapper._CHUNK_SIZE + chunk_size = _default_chunk_size() prefix_size = chunk_size - 2 u_prefix = "a" * prefix_size prefix = bytes(u_prefix.encode("utf-8")) @@ -1394,7 +1400,7 @@ testSeekAndTellWithData(input) # Position each test case so that it crosses a chunk boundary. - CHUNK_SIZE = io.TextIOWrapper._CHUNK_SIZE + CHUNK_SIZE = _default_chunk_size() for input, _, _ in StatefulIncrementalDecoderTest.test_cases: offset = CHUNK_SIZE - len(input)//2 prefix = b'.'*offset From nnorwitz at gmail.com Mon Jan 12 22:13:38 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 12 Jan 2009 16:13:38 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (3) Message-ID: <20090112211338.GA2779@python.psfb.org> 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657085 refs] From nnorwitz at gmail.com Mon Jan 12 22:20:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 12 Jan 2009 16:20:17 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (3) Message-ID: <20090112212017.GA4145@python.psfb.org> 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17051 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16012 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [656356 refs] From python-checkins at python.org Mon Jan 12 22:47:26 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 22:47:26 +0100 (CET) Subject: [Python-checkins] r68555 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090112214726.92CB51E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 22:47:26 2009 New Revision: 68555 Log: Fix a place in read1() where the lock wouldn't be released Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Mon Jan 12 22:47:26 2009 @@ -607,7 +607,7 @@ Buffered_read1(BufferedObject *self, PyObject *args) { Py_ssize_t n, have, r; - PyObject *res; + PyObject *res = NULL; CHECK_INITIALIZED(self) if (!PyArg_ParseTuple(args, "n:read1", &n)) { @@ -650,7 +650,7 @@ _BufferedReader_reset_buf(self); r = _BufferedReader_fill_buffer(self); if (r == -1) - return NULL; + goto end; if (r == -2) r = 0; if (n > r) From python-checkins at python.org Mon Jan 12 22:53:17 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 12 Jan 2009 22:53:17 +0100 (CET) Subject: [Python-checkins] r68556 - in python/branches/release30-maint: Lib/test/test_long.py Misc/NEWS Objects/abstract.c Message-ID: <20090112215317.2F6641E4002@bag.python.org> Author: mark.dickinson Date: Mon Jan 12 22:53:16 2009 New Revision: 68556 Log: Merged revisions 68553 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68553 | mark.dickinson | 2009-01-12 20:49:19 +0000 (Mon, 12 Jan 2009) | 8 lines Issue #4910 (1st patch of a series): fix int() and the corresponding PyNumber_Int/PyNumber_Long API function so that it no longer attempts to call the __long__ method for conversion. Only the __int__ and __trunc__ methods are used. (This removes a major remaining use of the nb_long slot from the Python 3.x core.) Thanks Benjamin for review. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_long.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/abstract.c Modified: python/branches/release30-maint/Lib/test/test_long.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_long.py (original) +++ python/branches/release30-maint/Lib/test/test_long.py Mon Jan 12 22:53:16 2009 @@ -366,7 +366,7 @@ def test_conversion(self): - # Test __long__() + # Test __int__() class ClassicMissingMethods: pass self.assertRaises(TypeError, int, ClassicMissingMethods()) @@ -409,18 +409,32 @@ class Classic: pass for base in (object, Classic): - class LongOverridesTrunc(base): - def __long__(self): + class IntOverridesTrunc(base): + def __int__(self): return 42 def __trunc__(self): return -12 - self.assertEqual(int(LongOverridesTrunc()), 42) + self.assertEqual(int(IntOverridesTrunc()), 42) class JustTrunc(base): def __trunc__(self): return 42 self.assertEqual(int(JustTrunc()), 42) + class JustLong(base): + # test that __long__ no longer used in 3.x + def __long__(self): + return 42 + self.assertRaises(TypeError, int, JustLong()) + + class LongTrunc(base): + # __long__ should be ignored in 3.x + def __long__(self): + return 42 + def __trunc__(self): + return 1729 + self.assertEqual(int(LongTrunc()), 1729) + for trunc_result_base in (object, Classic): class Integral(trunc_result_base): def __int__(self): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Jan 12 22:53:16 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API + function no longer attempt to call the __long__ slot to convert an object + to an integer. Only the __int__ and __trunc__ slots are examined. + - Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. Modified: python/branches/release30-maint/Objects/abstract.c ============================================================================== --- python/branches/release30-maint/Objects/abstract.c (original) +++ python/branches/release30-maint/Objects/abstract.c Mon Jan 12 22:53:16 2009 @@ -1379,19 +1379,7 @@ } return res; } - if (m && m->nb_long) { /* This should include subclasses of long */ - /* Classic classes always take this branch. */ - PyObject *res = m->nb_long(o); - if (res && !PyLong_Check(res)) { - PyErr_Format(PyExc_TypeError, - "__long__ returned non-long (type %.200s)", - res->ob_type->tp_name); - Py_DECREF(res); - return NULL; - } - return res; - } - if (PyLong_Check(o)) /* A long subclass without nb_long */ + if (PyLong_Check(o)) /* An int subclass without nb_int */ return _PyLong_Copy((PyLongObject *)o); trunc_func = PyObject_GetAttr(o, trunc_name); if (trunc_func) { From python-checkins at python.org Mon Jan 12 23:06:58 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 23:06:58 +0100 (CET) Subject: [Python-checkins] r68557 - in sandbox/trunk/io-c: _textio.c test_io.py Message-ID: <20090112220658.8F3D61E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 23:06:58 2009 New Revision: 68557 Log: add tests for TextIOWrapper.__init__ Modified: sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Mon Jan 12 23:06:58 2009 @@ -516,6 +516,12 @@ return -1; } + Py_CLEAR(self->buffer); + Py_CLEAR(self->encoding); + Py_CLEAR(self->encoder); + Py_CLEAR(self->decoder); + Py_CLEAR(self->readnl); + if (encoding == NULL) { /* Try os.device_encoding(fileno) */ PyObject *os = PyImport_ImportModule("os"); Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 12 23:06:58 2009 @@ -1103,6 +1103,18 @@ def tearDown(self): support.unlink(support.TESTFN) + def testConstructor(self): + r = io.BytesIO(b"\xc3\xa9\n\n") + b = io.BufferedReader(r, 1000) + t = io.TextIOWrapper(b) + t.__init__(b, encoding="latin1", newline="\r\n") + t.__init__(b, encoding="utf8") + 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 = io.BytesIO() b = io.BufferedWriter(r, 1000) From nnorwitz at gmail.com Mon Jan 12 23:44:35 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 12 Jan 2009 17:44:35 -0500 Subject: [Python-checkins] Python Regression Test Failures all (3) Message-ID: <20090112224435.GA31053@python.psfb.org> 331 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-28453 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 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [21405 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17405 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16857 refs] [15828 refs] [15828 refs] [15828 refs] [15828 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 331 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [670948 refs] From python-checkins at python.org Mon Jan 12 23:45:43 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 12 Jan 2009 23:45:43 +0100 (CET) Subject: [Python-checkins] r68558 - in sandbox/trunk/io-c: _bufferedio.c test_io.py Message-ID: <20090112224543.B8D051E404D@bag.python.org> Author: antoine.pitrou Date: Mon Jan 12 23:45:43 2009 New Revision: 68558 Log: Add some sanity checks, and test them. Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Mon Jan 12 23:45:43 2009 @@ -469,8 +469,12 @@ return -1; n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); + if (n < 0) { + PyErr_Format(PyExc_IOError, + "Raw stream returned invalid position %zd", n); + return -1; + } self->abs_pos = n; - /* TODO: sanity check (n >= 0) */ return n; } @@ -485,7 +489,11 @@ n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); self->abs_pos = n; - /* TODO: sanity check (n >= 0) */ + if (n < 0) { + PyErr_Format(PyExc_IOError, + "Raw stream returned invalid position %zd", n); + return -1; + } return n; } @@ -590,6 +598,11 @@ if (!PyArg_ParseTuple(args, "|n:read", &n)) { return NULL; } + if (n < -1) { + PyErr_SetString(PyExc_ValueError, + "read length must be positive or -1"); + return NULL; + } if (BufferedIOMixin_closed(self)) { PyErr_SetString(PyExc_ValueError, "read of closed file"); @@ -614,8 +627,12 @@ return NULL; } - /* TODO: n < 0 should raise an error (?) */ - if (n <= 0) + if (n < 0) { + PyErr_SetString(PyExc_ValueError, + "read length must be positive"); + return NULL; + } + if (n == 0) return PyBytes_FromStringAndSize(NULL, 0); ENTER_BUFFERED(self) @@ -712,7 +729,12 @@ if (!PyArg_ParseTuple(args, "n|i:seek", &target, &whence)) { return NULL; } - /* TODO: sanity check whence value */ + + if (whence < 0 || whence > 2) { + PyErr_Format(PyExc_ValueError, + "whence must be between 0 and 2, not %d", whence); + return NULL; + } ENTER_BUFFERED(self) @@ -872,7 +894,12 @@ } n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); - /* TODO: sanity check (0 <= n <= len) */ + if (n < 0 || n > len) { + PyErr_Format(PyExc_IOError, + "raw readinto() returned invalid length %zd " + "(should have been between 0 and %zd)", n, len); + return -1; + } if (n > 0 && self->abs_pos != -1) self->abs_pos += n; return n; @@ -1241,7 +1268,12 @@ return -1; n = PyNumber_AsSsize_t(res, PyExc_ValueError); Py_DECREF(res); - /* TODO: sanity check (0 <= n <= len) */ + if (n < 0 || n > len) { + PyErr_Format(PyExc_IOError, + "raw write() returned invalid length %zd " + "(should have been between 0 and %zd)", n, len); + return -1; + } if (n > 0 && self->abs_pos != -1) self->abs_pos += n; return n; Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Mon Jan 12 23:45:43 2009 @@ -81,6 +81,24 @@ return pos +class MisbehavedRawIO(MockRawIO): + def write(self, b): + return MockRawIO.write(self, b) * 2 + + def read(self, n=None): + return MockRawIO.read(self, n) * 2 + + def seek(self, pos, whence): + return -123 + + def tell(self): + return -456 + + def readinto(self, buf): + MockRawIO.readinto(self, buf) + return len(buf) * 5 + + class MockFileIO(io.BytesIO): def __init__(self, data): @@ -420,6 +438,7 @@ class CommonBufferedTests: # Tests common to BufferedReader, BufferedWriter and BufferedRandom + def testFileno(self): rawio = MockRawIO() bufio = self.tp(rawio) @@ -431,6 +450,13 @@ # this test. Else, write it. pass + def testInvalidArgs(self): + rawio = MockRawIO() + bufio = self.tp(rawio) + # Invalid whence + self.assertRaises(ValueError, bufio.seek, 0, -1) + self.assertRaises(ValueError, bufio.seek, 0, 3) + def testOverrideDestructor(self): tp = self.tp record = [] @@ -470,6 +496,7 @@ # a ValueError. self.assertRaises(ValueError, _with) + class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): tp = io.BufferedReader read_mode = "rb" @@ -497,6 +524,8 @@ rawio = 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")) @@ -511,6 +540,8 @@ self.assertEquals(b"efg", bufio.read1(100)) self.assertEquals(rawio._reads, 3) self.assertEquals(b"", bufio.read1(100)) + # Invalid args + self.assertRaises(ValueError, bufio.read1, -1) def testReadinto(self): rawio = MockRawIO((b"abc", b"d", b"efg")) @@ -612,6 +643,13 @@ finally: support.unlink(support.TESTFN) + def testMisbehavedRawIO(self): + rawio = MisbehavedRawIO((b"abc", b"d", b"efg")) + bufio = self.tp(rawio) + self.assertRaises(IOError, bufio.seek, 0) + self.assertRaises(IOError, bufio.tell) + self.assertRaises(IOError, bufio.read, 10) + class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): tp = io.BufferedWriter @@ -812,6 +850,13 @@ finally: support.unlink(support.TESTFN) + def testMisbehavedRawIO(self): + rawio = MisbehavedRawIO() + bufio = self.tp(rawio, 5) + self.assertRaises(IOError, bufio.seek, 0) + self.assertRaises(IOError, bufio.tell) + self.assertRaises(IOError, bufio.write, b"abcdef") + class BufferedRWPairTest(unittest.TestCase): @@ -948,6 +993,10 @@ bufio.readinto(bytearray(1)) self.check_writes(_read) + def testMisbehavedRawIO(self): + BufferedReaderTest.testMisbehavedRawIO(self) + BufferedWriterTest.testMisbehavedRawIO(self) + # To fully exercise seek/tell, the StatefulIncrementalDecoder has these # properties: @@ -1381,6 +1430,8 @@ def testSeekAndTell(self): """Test seek/tell using the StatefulIncrementalDecoder.""" + # Make test faster by doing smaller seeks + CHUNK_SIZE = 256 def testSeekAndTellWithData(data, min_pos=0): """Tell/seek to various points within a data stream and ensure @@ -1389,6 +1440,7 @@ f.write(data) f.close() f = io.open(support.TESTFN, encoding='test_decoder') + f._CHUNK_SIZE = CHUNK_SIZE decoded = f.read() f.close() @@ -1412,7 +1464,7 @@ testSeekAndTellWithData(input) # Position each test case so that it crosses a chunk boundary. - CHUNK_SIZE = _default_chunk_size() + #CHUNK_SIZE = _default_chunk_size() for input, _, _ in StatefulIncrementalDecoderTest.test_cases: offset = CHUNK_SIZE - len(input)//2 prefix = b'.'*offset From buildbot at python.org Mon Jan 12 23:48:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 12 Jan 2009 22:48:21 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090112224821.85FFA1E4002@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/52 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 683, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Jan 12 23:58:43 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 12 Jan 2009 23:58:43 +0100 (CET) Subject: [Python-checkins] r68559 - in python/trunk: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090112225843.C55931E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 12 23:58:41 2009 New Revision: 68559 Log: Issue 1696199: Add collections.Counter(). 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 Mon Jan 12 23:58:41 2009 @@ -152,6 +152,134 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) +.. _counter-objects: + +:class:`Counter` objects +------------------------ + +A counter tool is provided to support convenient and rapid tallies. +For example:: + + # Tally repeated words in a list + >>> words = ['red', 'blue', 'red', 'green', 'blue', blue'] + >>> cnt = Counter() + >>> for word in words: + ... cnt[word] += 1 + >>> cnt + Counter(items=[('blue', 3), ('red', 2), ('green', 1)]) + + # Find the ten most common words in Hamlet + >>> import re + >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) + >>> Counter(hamlet_words).most_common(10) + [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), + ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] + +.. class:: Counter([iterable[, items]]) + + A :class:`Counter` is a :class:`dict` subclass for counting hashable items. + Elements are stored as dictionary keys and their counts are stored as + dictionary values. Counts are allowed to be any integer value including + zero or negative counts. The :class:`Counter` class is similar to bags + or multisets in other languages. + + Elements are counted from the *iterable* if given. Also, the counts + can be initialized from an *items* list of *(element, count)* pairs. + If provided, *items* must be a keyword argument:: + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter(items=[('a', 4), ('b', 2)]) # a new counter from an items list + + The returned object has a dictionary style interface except that it returns + a zero count for missing items (instead of raising a :exc:`KeyError` like a + dictionary would):: + + >>> c = Counter(['if', 'your', 'peril', 'be']) + >>> c['questions'] # count of a missing element is zero + 0 + + Assigning a count of zero or reducing the count to zero leaves the + element in the dictionary. Use ``del`` to remove the entry entirely: + + >>> c = Counter(['arthur', 'gwain']) + >>> c['arthur'] = 0 # set the count of "arthur" to zero + >>> 'arthur' in c # but "arthur" is still in the counter + True + >>> del c['arthur'] # del will completely remove the entry + >>> 'arthur' in c + False + + .. versionadded:: 2.7 + + + Counter objects support two methods beyond those available for all + dictionaries: + + .. method:: elements() + + Return an iterator over elements repeating each as many times as its count. + Elements are returned in arbitrary order. If an element's count has been + set to zero or a negative number, :meth:`elements` will ignore it. + + >>> c = Counter(items=[('a', 4), ('b', 2), ('d', 0), ('e', -2)]) + >>> list(c.elements()) + ['a', 'a', 'a', 'a', 'b', 'b'] + + .. 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* is not specified or is ``None``, + return a list of all element counts in decreasing order of frequency. + Elements with equal counts are ordered arbitrarily:: + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + The usual dictionary methods are available for :class:`Counter` objects. + All of those work the same as they do for dictionaries except for two + which work differently for counters. + + .. method:: fromkeys(iterable) + + There is no equivalent class method for :class:`Counter` objects. + Raises a :exc:`NotImplementedError` when called. + + .. method:: update(mapping) + + Like :meth:`dict.update` but adds-in counts instead of replacing them. + Used for combining two independent counts. Accepts a *mapping* object + which can be another counter or can be a :class:`dict` that maps + elements to element counts:: + + >>> c = Counter('which') # count letters in a word + >>> d = Counter('witch') # count letters in another word + >>> c.update(d) # add counts from d to those in c + >>> c['h'] # count of 'h' is now three + 3 + >>> c.update(Counter('watch')) # add in letters from another word + >>> c['h'] # count of 'h' is now four + 4 + + +.. seealso:: + + `Multisets `_ + in the Wikipedia + + `Bag `_ + a Smalltalk class + + `C++ multisets `_ + a tutorial with standalone examples + + `Bag class `_ + an early Python recipe + + Use cases for multisets and mathematical operations on multisets. + Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19. + .. _deque-objects: Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Mon Jan 12 23:58:41 2009 @@ -9,6 +9,11 @@ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys +import heapq as _heapq +import itertools as _itertools + +######################################################################## +### namedtuple ####################################################### def namedtuple(typename, field_names, verbose=False): """Returns a new subclass of tuple with named fields. @@ -108,7 +113,160 @@ return result +######################################################################## +### Counter ########################################################## + +class Counter(dict): + '''Dict subclass for counting hashable items. Sometimes called a bag + or multiset. Elements are stored as dictionary keys and their counts + are stored as dictionary values. + + >>> c = Counter('abracadabra') # count elements from a string + + >>> c.most_common(3) # three most common elements + [('a', 5), ('r', 2), ('b', 2)] + >>> sorted(c) # list all unique elements + ['a', 'b', 'c', 'd', 'r'] + >>> ''.join(sorted(c.elements())) # list elements with repetitions + 'aaaaabbcdrr' + >>> sum(c.values()) # total of all counts + 11 + >>> c['a'] # count of letter 'a' + 5 + >>> for elem in 'shazam': # update counts from an iterable + ... c[elem] += 1 # by adding 1 to each element's count + >>> c['a'] # now there are seven 'a' + 7 + >>> del c['r'] # remove all 'r' + >>> c['r'] # now there are zero 'r' + 0 + + >>> d = Counter('simsalabim') # make another counter + >>> c.update(d) # add in the second counter + >>> c['a'] # now there are nine 'a' + 9 + + >>> c.clear() # empty the counter + >>> c + Counter() + + Note: If a count is set to zero or reduced to zero, it will remain + in the counter until the entry is deleted or the counter is cleared: + + >>> c = Counter('aaabbc') + >>> c['b'] -= 2 # reduce the count of 'b' by two + >>> c.most_common() # 'b' is still in, but its count is zero + [('a', 3), ('c', 1), ('b', 0)] + + ''' + # References: + # http://en.wikipedia.org/wiki/Multiset + # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html + # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm + # http://code.activestate.com/recipes/259174/ + # Knuth, TAOCP Vol. II section 4.6.3 + + def __init__(self, iterable=None, items=None): + '''Create a new, empty Counter object. And if given, count elements + from an input iterable. Or, initialize the count from an items list + of (element, count) pairs. + + >>> c = Counter('hocus pocus') # count elements in an iterable + >>> c = Counter(items=[('a', 4), ('b', 2)]) # take counts from an items list + + ''' + if iterable is not None: + for elem in iterable: + self[elem] += 1 + if items is not None: + for elem, count in items: + self[elem] += count + + def __missing__(self, key): + 'The count of elements not in the Counter is zero.' + # Needed so that self[missing_item] does not raise KeyError + return 0 + + def most_common(self, n=None): + '''List the n most common elements and their counts from the most + common to the least. If n is None, then list all element counts. + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + ''' + # Emulate Bag.sortedByCount from Smalltalk + if n is None: + return sorted(self.iteritems(), key=_itemgetter(1), reverse=True) + return _heapq.nlargest(n, self.iteritems(), key=_itemgetter(1)) + + def elements(self): + '''Iterator over elements repeating each as many times as its count. + + >>> c = Counter('ABCABC') + >>> sorted(c.elements()) + ['A', 'A', 'B', 'B', 'C', 'C'] + + # Knuth's example of prime factors of 1836: 2**2 * 3**3 * 17**1 + >>> import operator + >>> prime_factors = Counter(items=[(2,2), (3,3), (17,1)]) + >>> sorted(prime_factors.elements()) # list individual factors + [2, 2, 3, 3, 3, 17] + >>> reduce(operator.mul, prime_factors.elements(), 1) # multiply them + 1836 + + Note, if an element's count has been set to zero or a negative number, + elements() will ignore it. + + ''' + # Emulate Bag.do from Smalltalk and Multiset.begin from C++. + return _itertools.chain.from_iterable( + _itertools.starmap(_itertools.repeat, + self.iteritems())) + + # Override dict methods where necessary + + @classmethod + def fromkeys(cls, iterable, v=None): + # There is no equivalent method for counters because setting v=1 + # means that no element can have a count greater than one. + raise NotImplementedError( + 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') + + def update(self, mapping): + '''Like dict.update() but add counts instead of replacing them. + + Source can be another dictionary or a Counter.instance(). + + >>> c = Counter('which') + >>> d = Counter('witch') + >>> c.update(d) # Add counts from d to those in c + >>> c['h'] # Count of 'h' is now three + 3 + + ''' + # The regular dict.update() operation makes no sense here because the + # replace behavior results in the some of original untouched counts + # being mixed-in with all of the other counts for a mismash that + # doesn't have a straight-forward interpretation in most counting + # contexts. Instead, we look to Knuth for suggested operations on + # multisets and implement the union-add operation discussed in + # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for + # multisets calls that operation a sum or join. + for elem, count in mapping.iteritems(): + self[elem] += count + + def copy(self): + 'Like dict.copy() but returns a Counter instance instead of a dict.' + c = Counter() + c.update(self) + return c + + def __repr__(self): + if not self: + return '%s()' % self.__class__.__name__ + return '%s(items=%r)' % (self.__class__.__name__, self.most_common()) @@ -143,6 +301,49 @@ Point3D = namedtuple('Point3D', Point._fields + ('z',)) print Point3D.__doc__ + # Check that counters are copyable, deepcopyable, picklable, and have a + # repr/eval round-trip + import copy + words = Counter('which witch had which witches wrist watch'.split()) + update_test = Counter() + update_test.update(words) + for i, dup in enumerate([ + words.copy(), + copy.copy(words), + copy.deepcopy(words), + loads(dumps(words, 0)), + loads(dumps(words, 1)), + loads(dumps(words, 2)), + loads(dumps(words, -1)), + eval(repr(words)), + update_test, + ]): + msg = (i, dup, words) + assert dup is not words, msg + assert dup == words, msg + assert len(dup) == len(words), msg + assert type(dup) == type(words), msg + + # Verify that counters are unhashable + try: + hash(words) + except TypeError: + pass + else: + print 'Failed hashing test' + + # Verify that Counter.fromkeys() is disabled + try: + Counter.fromkeys('razmataz') + except NotImplementedError: + pass + else: + print 'Failed fromkeys() test' + + # Check ABCs + assert issubclass(Counter, Mapping) + assert isinstance(Counter('asdfasdf'), Mapping) + import doctest TestResults = namedtuple('TestResults', 'failed attempted') print TestResults(*doctest.testmod()) Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Mon Jan 12 23:58:41 2009 @@ -1,6 +1,6 @@ import unittest, doctest from test import test_support -from collections import namedtuple +from collections import namedtuple, Counter, Mapping import pickle, cPickle, copy from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable @@ -346,11 +346,107 @@ self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(basestring, MutableSequence)) +class TestCounter(unittest.TestCase): + + def test_basics(self): + c = Counter('abcaba') + self.assert_(isinstance(c, dict)) + self.assert_(isinstance(c, Mapping)) + self.assert_(issubclass(Counter, dict)) + self.assert_(issubclass(Counter, Mapping)) + self.assertEqual(len(c), 3) + self.assertEqual(sum(c.values()), 6) + self.assertEqual(sorted(c.values()), [1, 2, 3]) + self.assertEqual(sorted(c.keys()), ['a', 'b', 'c']) + self.assertEqual(sorted(c), ['a', 'b', 'c']) + self.assertEqual(sorted(c.items()), + [('a', 3), ('b', 2), ('c', 1)]) + self.assertEqual(c['b'], 2) + self.assertEqual(c['z'], 0) + self.assertEqual(c.has_key('c'), True) + self.assertEqual(c.has_key('z'), False) + self.assertEqual(c.__contains__('c'), True) + self.assertEqual(c.__contains__('z'), False) + self.assertEqual(c.get('b', 10), 2) + self.assertEqual(c.get('z', 10), 10) + self.assertEqual(c, dict(a=3, b=2, c=1)) + self.assertEqual(repr(c), + "Counter(items=[('a', 3), ('b', 2), ('c', 1)])") + self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)]) + for i in range(5): + self.assertEqual(c.most_common(i), + [('a', 3), ('b', 2), ('c', 1)][:i]) + self.assertEqual(''.join(sorted(c.elements())), 'aaabbc') + c['a'] += 1 # increment an existing value + c['b'] -= 2 # sub existing value to zero + del c['c'] # remove an entry + c['d'] -= 2 # sub from a missing value + c['e'] = -5 # directly assign a missing value + c['f'] += 4 # add to a missing value + self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4)) + self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff') + self.assertEqual(c.pop('f'), 4) + self.assertEqual('f' in c, False) + for i in range(3): + elem, cnt = c.popitem() + self.assertEqual(elem in c, False) + c.clear() + self.assertEqual(c, {}) + self.assertEqual(repr(c), 'Counter()') + self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') + self.assertRaises(TypeError, hash, c) + c.update(dict(a=5, b=3, c=1)) + c.update(Counter(items=[('a', 50), ('b', 30)])) + c.__init__(items=[('a', 500), ('b', 300)]) + c.__init__('cdc') + self.assertEqual(c, dict(a=555, b=333, c=3, d=1)) + self.assertEqual(c.setdefault('d', 5), 1) + self.assertEqual(c['d'], 1) + self.assertEqual(c.setdefault('e', 5), 5) + self.assertEqual(c['e'], 5) + + def test_copying(self): + # Check that counters are copyable, deepcopyable, picklable, and + #have a repr/eval round-trip + words = Counter('which witch had which witches wrist watch'.split()) + update_test = Counter() + update_test.update(words) + for i, dup in enumerate([ + words.copy(), + copy.copy(words), + copy.deepcopy(words), + pickle.loads(pickle.dumps(words, 0)), + pickle.loads(pickle.dumps(words, 1)), + pickle.loads(pickle.dumps(words, 2)), + pickle.loads(pickle.dumps(words, -1)), + cPickle.loads(cPickle.dumps(words, 0)), + cPickle.loads(cPickle.dumps(words, 1)), + cPickle.loads(cPickle.dumps(words, 2)), + cPickle.loads(cPickle.dumps(words, -1)), + eval(repr(words)), + update_test, + ]): + msg = (i, dup, words) + self.assert_(dup is not words) + self.assertEquals(dup, words) + self.assertEquals(len(dup), len(words)) + self.assertEquals(type(dup), type(words)) + + def test_conversions(self): + # Convert to: set, list, dict + s = 'she sells sea shells by the sea shore' + self.assertEqual(sorted(Counter(s).elements()), sorted(s)) + self.assertEqual(sorted(Counter(s)), sorted(set(s))) + self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) + self.assertEqual(set(Counter(s)), set(s)) + + import doctest, collections def test_main(verbose=None): NamedTupleDocs = doctest.DocTestSuite(module=collections) - test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs] + test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, + TestCollectionABCs, TestCounter] test_support.run_unittest(*test_classes) test_support.run_doctest(collections, verbose) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 12 23:58:41 2009 @@ -128,6 +128,9 @@ Library ------- +- Issue #1696199: Add collections.Counter() for rapid and convenient + counting. + - Issue #3860: GzipFile and BZ2File now support the context manager protocol. - Issue #4272: Add an optional argument to the GzipFile constructor to override From python-checkins at python.org Tue Jan 13 00:36:55 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Tue, 13 Jan 2009 00:36:55 +0100 (CET) Subject: [Python-checkins] r68560 - in python/trunk: Include/abstract.h Include/object.h Lib/test/crashers/iter.py Lib/test/test_iter.py Misc/NEWS Modules/itertoolsmodule.c Objects/abstract.c Objects/object.c Objects/typeobject.c Message-ID: <20090112233655.C316F1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Tue Jan 13 00:36:55 2009 New Revision: 68560 Log: #3720: Interpreter crashes when an evil iterator removes its own next function. Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0. Removed: python/trunk/Lib/test/crashers/iter.py Modified: python/trunk/Include/abstract.h python/trunk/Include/object.h python/trunk/Lib/test/test_iter.py python/trunk/Misc/NEWS python/trunk/Modules/itertoolsmodule.c python/trunk/Objects/abstract.c python/trunk/Objects/object.c python/trunk/Objects/typeobject.c Modified: python/trunk/Include/abstract.h ============================================================================== --- python/trunk/Include/abstract.h (original) +++ python/trunk/Include/abstract.h Tue Jan 13 00:36:55 2009 @@ -636,7 +636,8 @@ #define PyIter_Check(obj) \ (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_ITER) && \ - (obj)->ob_type->tp_iternext != NULL) + (obj)->ob_type->tp_iternext != NULL && \ + (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *); /* Takes an iterator object and calls its tp_iternext slot, Modified: python/trunk/Include/object.h ============================================================================== --- python/trunk/Include/object.h (original) +++ python/trunk/Include/object.h Tue Jan 13 00:36:55 2009 @@ -473,6 +473,7 @@ PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); Deleted: python/trunk/Lib/test/crashers/iter.py ============================================================================== --- python/trunk/Lib/test/crashers/iter.py Tue Jan 13 00:36:55 2009 +++ (empty file) @@ -1,53 +0,0 @@ -# Calls to PyIter_Next, or direct calls to tp_iternext, on an object -# which might no longer be an iterable because its 'next' method was -# removed. These are all variants of Issue3720. - -""" -Run this script with an argument between 1 and to test for -different crashes. -""" -N = 8 - -import sys - -class Foo(object): - def __iter__(self): - return self - def next(self): - del Foo.next - return (1, 2) - -def case1(): - list(enumerate(Foo())) - -def case2(): - x, y = Foo() - -def case3(): - filter(None, Foo()) - -def case4(): - map(None, Foo(), Foo()) - -def case5(): - max(Foo()) - -def case6(): - sum(Foo(), ()) - -def case7(): - dict(Foo()) - -def case8(): - sys.stdout.writelines(Foo()) - -# etc... - - -if __name__ == '__main__': - if len(sys.argv) < 2: - print __doc__.replace('', str(N)) - else: - n = int(sys.argv[1]) - func = globals()['case%d' % n] - func() Modified: python/trunk/Lib/test/test_iter.py ============================================================================== --- python/trunk/Lib/test/test_iter.py (original) +++ python/trunk/Lib/test/test_iter.py Tue Jan 13 00:36:55 2009 @@ -120,6 +120,13 @@ def test_seq_class_iter(self): self.check_iterator(iter(SequenceClass(10)), range(10)) + # Test a new_style class with __iter__ but no next() method + def test_new_style_iter_class(self): + class IterClass(object): + def __iter__(self): + return self + self.assertRaises(TypeError, iter, IterClass()) + # Test two-argument iter() with callable instance def test_iter_callable(self): class C: @@ -877,6 +884,21 @@ self.assertEqual(list(b), zip(range(5), range(5))) self.assertEqual(list(b), []) + def test_3720(self): + # Avoid a crash, when an iterator deletes its next() method. + class BadIterator(object): + def __iter__(self): + return self + def next(self): + del BadIterator.next + return 1 + + try: + for i in BadIterator() : + pass + except TypeError: + pass + def test_main(): run_unittest(TestCase) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 13 00:36:55 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #3720: Fix a crash when an iterator modifies its class and removes its + __next__ method. + - Issue #4893: Use NT threading on CE. - Issue #4915: Port sysmodule to Windows CE. Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Tue Jan 13 00:36:55 2009 @@ -886,7 +886,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -1031,7 +1030,6 @@ if (lz->stop == 1) return NULL; - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) return NULL; @@ -1218,7 +1216,6 @@ Py_ssize_t oldnext; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; while (lz->cnt < lz->next) { item = iternext(it); @@ -1229,7 +1226,6 @@ } if (lz->stop != -1 && lz->cnt >= lz->stop) return NULL; - assert(PyIter_Check(it)); item = iternext(it); if (item == NULL) return NULL; @@ -1361,7 +1357,6 @@ PyObject *result; PyObject *it = lz->it; - assert(PyIter_Check(it)); args = (*Py_TYPE(it)->tp_iternext)(it); if (args == NULL) return NULL; @@ -2577,7 +2572,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -2721,7 +2715,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -3059,7 +3052,6 @@ Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); @@ -3075,7 +3067,6 @@ return NULL; for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); @@ -3411,7 +3402,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; @@ -3440,7 +3430,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Tue Jan 13 00:36:55 2009 @@ -3067,7 +3067,6 @@ PyIter_Next(PyObject *iter) { PyObject *result; - assert(PyIter_Check(iter)); result = (*iter->ob_type->tp_iternext)(iter); if (result == NULL && PyErr_Occurred() && Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Tue Jan 13 00:36:55 2009 @@ -1305,6 +1305,20 @@ return obj; } +/* Helper used when the __next__ method is removed from a type: + tp_iternext is never NULL and can be safely called without checking + on every iteration. + */ + +PyObject * +_PyObject_NextNotImplemented(PyObject *self) +{ + PyErr_Format(PyExc_TypeError, + "'%.200s' object is not iterable", + Py_TYPE(self)->tp_name); + return NULL; +} + /* Generic GetAttr functions - put these in your tp_[gs]etattro slot */ PyObject * Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Tue Jan 13 00:36:55 2009 @@ -6090,8 +6090,12 @@ } do { descr = _PyType_Lookup(type, p->name_strobj); - if (descr == NULL) + if (descr == NULL) { + if (ptr == (void**)&type->tp_iternext) { + specific = _PyObject_NextNotImplemented; + } continue; + } if (Py_TYPE(descr) == &PyWrapperDescr_Type) { void **tptr = resolve_slotdups(type, p->name_strobj); if (tptr == NULL || tptr == ptr) From python-checkins at python.org Tue Jan 13 00:58:21 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Tue, 13 Jan 2009 00:58:21 +0100 (CET) Subject: [Python-checkins] r68561 - in python/branches/py3k: Include/abstract.h Include/object.h Lib/test/crashers/iter.py Lib/test/test_iter.py Misc/NEWS Modules/itertoolsmodule.c Objects/abstract.c Objects/object.c Objects/typeobject.c Python/bltinmodule.c Message-ID: <20090112235821.C44061E4002@bag.python.org> Author: amaury.forgeotdarc Date: Tue Jan 13 00:58:21 2009 New Revision: 68561 Log: Merged revisions 68560 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (mar., 13 janv. 2009) | 6 lines #3720: Interpreter crashes when an evil iterator removes its own next function. Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0. ........ Removed: python/branches/py3k/Lib/test/crashers/iter.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/abstract.h python/branches/py3k/Include/object.h python/branches/py3k/Lib/test/test_iter.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/itertoolsmodule.c 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/Include/abstract.h ============================================================================== --- python/branches/py3k/Include/abstract.h (original) +++ python/branches/py3k/Include/abstract.h Tue Jan 13 00:58:21 2009 @@ -612,7 +612,8 @@ is an iterator, this returns itself. */ #define PyIter_Check(obj) \ - ((obj)->ob_type->tp_iternext != NULL) + ((obj)->ob_type->tp_iternext != NULL && \ + (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *); /* Takes an iterator object and calls its tp_iternext slot, Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Tue Jan 13 00:58:21 2009 @@ -438,6 +438,7 @@ PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); Deleted: python/branches/py3k/Lib/test/crashers/iter.py ============================================================================== --- python/branches/py3k/Lib/test/crashers/iter.py Tue Jan 13 00:58:21 2009 +++ (empty file) @@ -1,53 +0,0 @@ -# Calls to PyIter_Next, or direct calls to tp_iternext, on an object -# which might no longer be an iterable because its 'next' method was -# removed. These are all variants of Issue3720. - -""" -Run this script with an argument between 1 and to test for -different crashes. -""" -N = 8 - -import sys - -class Foo(object): - def __iter__(self): - return self - def next(self): - del Foo.next - return (1, 2) - -def case1(): - list(enumerate(Foo())) - -def case2(): - x, y = Foo() - -def case3(): - filter(None, Foo()) - -def case4(): - map(None, Foo(), Foo()) - -def case5(): - max(Foo()) - -def case6(): - sum(Foo(), ()) - -def case7(): - dict(Foo()) - -def case8(): - sys.stdout.writelines(Foo()) - -# etc... - - -if __name__ == '__main__': - if len(sys.argv) < 2: - print(__doc__.replace('', str(N))) - else: - n = int(sys.argv[1]) - func = globals()['case%d' % n] - func() Modified: python/branches/py3k/Lib/test/test_iter.py ============================================================================== --- python/branches/py3k/Lib/test/test_iter.py (original) +++ python/branches/py3k/Lib/test/test_iter.py Tue Jan 13 00:58:21 2009 @@ -120,6 +120,13 @@ def test_seq_class_iter(self): self.check_iterator(iter(SequenceClass(10)), list(range(10))) + # Test a new_style class with __iter__ but no next() method + def test_new_style_iter_class(self): + class IterClass(object): + def __iter__(self): + return self + self.assertRaises(TypeError, iter, IterClass()) + # Test two-argument iter() with callable instance def test_iter_callable(self): class C: @@ -853,6 +860,21 @@ self.assertEqual(list(b), list(zip(range(5), range(5)))) self.assertEqual(list(b), []) + def test_3720(self): + # Avoid a crash, when an iterator deletes its next() method. + class BadIterator(object): + def __iter__(self): + return self + def __next__(self): + del BadIterator.__next__ + return 1 + + try: + for i in BadIterator() : + pass + except TypeError: + pass + def test_main(): run_unittest(TestCase) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 13 00:58:21 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #3720: Fix a crash when an iterator modifies its class and removes its + __next__ method. + - Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API function no longer attempt to call the __long__ slot to convert an object to an integer. Only the __int__ and __trunc__ slots are examined. Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Tue Jan 13 00:58:21 2009 @@ -886,7 +886,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -1031,7 +1030,6 @@ if (lz->stop == 1) return NULL; - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) return NULL; @@ -1218,7 +1216,6 @@ Py_ssize_t oldnext; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; while (lz->cnt < lz->next) { item = iternext(it); @@ -1229,7 +1226,6 @@ } if (lz->stop != -1 && lz->cnt >= lz->stop) return NULL; - assert(PyIter_Check(it)); item = iternext(it); if (item == NULL) return NULL; @@ -1361,7 +1357,6 @@ PyObject *result; PyObject *it = lz->it; - assert(PyIter_Check(it)); args = (*Py_TYPE(it)->tp_iternext)(it); if (args == NULL) return NULL; @@ -2403,7 +2398,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -2888,7 +2882,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; @@ -2917,7 +2910,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Tue Jan 13 00:58:21 2009 @@ -2736,7 +2736,6 @@ PyIter_Next(PyObject *iter) { PyObject *result; - assert(PyIter_Check(iter)); result = (*iter->ob_type->tp_iternext)(iter); if (result == NULL && PyErr_Occurred() && Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Tue Jan 13 00:58:21 2009 @@ -1020,6 +1020,20 @@ return obj; } +/* Helper used when the __next__ method is removed from a type: + tp_iternext is never NULL and can be safely called without checking + on every iteration. + */ + +PyObject * +_PyObject_NextNotImplemented(PyObject *self) +{ + PyErr_Format(PyExc_TypeError, + "'%.200s' object is not iterable", + Py_TYPE(self)->tp_name); + return NULL; +} + /* Generic GetAttr functions - put these in your tp_[gs]etattro slot */ PyObject * Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Tue Jan 13 00:58:21 2009 @@ -5630,8 +5630,12 @@ } do { descr = _PyType_Lookup(type, p->name_strobj); - if (descr == NULL) + if (descr == NULL) { + if (ptr == (void**)&type->tp_iternext) { + specific = _PyObject_NextNotImplemented; + } continue; + } if (Py_TYPE(descr) == &PyWrapperDescr_Type) { void **tptr = resolve_slotdups(type, p->name_strobj); if (tptr == NULL || tptr == ptr) Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Tue Jan 13 00:58:21 2009 @@ -375,7 +375,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -2144,7 +2143,6 @@ Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); @@ -2160,7 +2158,6 @@ return NULL; for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); From buildbot at python.org Tue Jan 13 01:45:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 00:45:26 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090113004526.BBF5A1E4033@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/104 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: 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 Jan 13 02:05:04 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 13 Jan 2009 02:05:04 +0100 (CET) Subject: [Python-checkins] r68562 - in python/trunk: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Message-ID: <20090113010504.1DE9A1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 13 02:05:03 2009 New Revision: 68562 Log: Simplify Counter() API. Replace items keyword argument with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work. Modified: python/trunk/Doc/library/collections.rst python/trunk/Lib/collections.py python/trunk/Lib/test/test_collections.py Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Tue Jan 13 02:05:03 2009 @@ -161,12 +161,12 @@ For example:: # Tally repeated words in a list - >>> words = ['red', 'blue', 'red', 'green', 'blue', blue'] + >>> words = ['red', 'blue', 'red', 'green', 'blue', 'blue'] >>> cnt = Counter() >>> for word in words: ... cnt[word] += 1 >>> cnt - Counter(items=[('blue', 3), ('red', 2), ('green', 1)]) + Counter({'blue': 3, 'red': 2, 'green': 1}) # Find the ten most common words in Hamlet >>> import re @@ -175,21 +175,20 @@ [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] -.. class:: Counter([iterable[, items]]) +.. class:: Counter([iterable]) A :class:`Counter` is a :class:`dict` subclass for counting hashable items. - Elements are stored as dictionary keys and their counts are stored as - dictionary values. Counts are allowed to be any integer value including - zero or negative counts. The :class:`Counter` class is similar to bags - or multisets in other languages. + It is an unordered collection where elements are stored as dictionary keys + and their counts are stored as dictionary values. Counts are allowed to be + any integer value including zero or negative counts. The :class:`Counter` + class is similar to bags or multisets in other languages. Elements are counted from the *iterable* if given. Also, the counts - can be initialized from an *items* list of *(element, count)* pairs. - If provided, *items* must be a keyword argument:: + can be initialized from another mapping of elements to their counts:: >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable - >>> c = Counter(items=[('a', 4), ('b', 2)]) # a new counter from an items list + >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping The returned object has a dictionary style interface except that it returns a zero count for missing items (instead of raising a :exc:`KeyError` like a @@ -222,7 +221,7 @@ Elements are returned in arbitrary order. If an element's count has been set to zero or a negative number, :meth:`elements` will ignore it. - >>> c = Counter(items=[('a', 4), ('b', 2), ('d', 0), ('e', -2)]) + >>> c = Counter({'a': 4, 'b': 2, 'd': 0, 'e': -2}) >>> list(c.elements()) ['a', 'a', 'a', 'a', 'b', 'b'] @@ -245,19 +244,20 @@ There is no equivalent class method for :class:`Counter` objects. Raises a :exc:`NotImplementedError` when called. - .. method:: update(mapping) + .. method:: update(iterable) Like :meth:`dict.update` but adds-in counts instead of replacing them. - Used for combining two independent counts. Accepts a *mapping* object - which can be another counter or can be a :class:`dict` that maps - elements to element counts:: + + Elements are counted from the *iterable* if given. Also, the counts + can be taken from another counter or mapping of elements to their + counts:: >>> c = Counter('which') # count letters in a word >>> d = Counter('witch') # count letters in another word >>> c.update(d) # add counts from d to those in c >>> c['h'] # count of 'h' is now three 3 - >>> c.update(Counter('watch')) # add in letters from another word + >>> c.update('watch') # add in letters from another word >>> c['h'] # count of 'h' is now four 4 Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 13 02:05:03 2009 @@ -167,21 +167,17 @@ # http://code.activestate.com/recipes/259174/ # Knuth, TAOCP Vol. II section 4.6.3 - def __init__(self, iterable=None, items=None): + def __init__(self, iterable=None): '''Create a new, empty Counter object. And if given, count elements - from an input iterable. Or, initialize the count from an items list - of (element, count) pairs. + from an input iterable. Or, initialize the count from another mapping + of elements to their counts. - >>> c = Counter('hocus pocus') # count elements in an iterable - >>> c = Counter(items=[('a', 4), ('b', 2)]) # take counts from an items list + >>> c = Counter() # a new, empty counter + >>> c = Counter('hocus pocus') # a new counter from an iterable + >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping ''' - if iterable is not None: - for elem in iterable: - self[elem] += 1 - if items is not None: - for elem, count in items: - self[elem] += count + self.update(iterable) def __missing__(self, key): 'The count of elements not in the Counter is zero.' @@ -210,7 +206,7 @@ # Knuth's example of prime factors of 1836: 2**2 * 3**3 * 17**1 >>> import operator - >>> prime_factors = Counter(items=[(2,2), (3,3), (17,1)]) + >>> prime_factors = Counter(dict([(2,2), (3,3), (17,1)])) >>> sorted(prime_factors.elements()) # list individual factors [2, 2, 3, 3, 3, 17] >>> reduce(operator.mul, prime_factors.elements(), 1) # multiply them @@ -234,16 +230,19 @@ raise NotImplementedError( 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') - def update(self, mapping): + def update(self, iterable=None): '''Like dict.update() but add counts instead of replacing them. - Source can be another dictionary or a Counter.instance(). + Source can be an iterable, a dictionary, or another Counter.instance(). >>> c = Counter('which') >>> d = Counter('witch') - >>> c.update(d) # Add counts from d to those in c - >>> c['h'] # Count of 'h' is now three + >>> c.update(d) # add counts from d to those in c + >>> c['h'] # count of 'h' is now three 3 + >>> c.update('watch') + >>> c['h'] + 4 ''' # The regular dict.update() operation makes no sense here because the @@ -254,19 +253,24 @@ # multisets and implement the union-add operation discussed in # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for # multisets calls that operation a sum or join. - for elem, count in mapping.iteritems(): - self[elem] += count + + if iterable is not None: + if isinstance(iterable, Mapping): + for elem, count in iterable.iteritems(): + self[elem] += count + else: + for elem in iterable: + self[elem] += 1 def copy(self): 'Like dict.copy() but returns a Counter instance instead of a dict.' - c = Counter() - c.update(self) - return c + return Counter(self) def __repr__(self): if not self: return '%s()' % self.__class__.__name__ - return '%s(items=%r)' % (self.__class__.__name__, self.most_common()) + items = ', '.join('%r: %r' % item for item in self.most_common()) + return '%s({%s})' % (self.__class__.__name__, items) Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Tue Jan 13 02:05:03 2009 @@ -370,8 +370,7 @@ self.assertEqual(c.get('b', 10), 2) self.assertEqual(c.get('z', 10), 10) self.assertEqual(c, dict(a=3, b=2, c=1)) - self.assertEqual(repr(c), - "Counter(items=[('a', 3), ('b', 2), ('c', 1)])") + self.assertEqual(repr(c), "Counter({'a': 3, 'b': 2, 'c': 1})") self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)]) for i in range(5): self.assertEqual(c.most_common(i), @@ -396,8 +395,8 @@ self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') self.assertRaises(TypeError, hash, c) c.update(dict(a=5, b=3, c=1)) - c.update(Counter(items=[('a', 50), ('b', 30)])) - c.__init__(items=[('a', 500), ('b', 300)]) + c.update(Counter('a' * 50 + 'b' * 30)) + c.__init__('a' * 500 + 'b' * 300) c.__init__('cdc') self.assertEqual(c, dict(a=555, b=333, c=3, d=1)) self.assertEqual(c.setdefault('d', 5), 1) @@ -425,6 +424,7 @@ cPickle.loads(cPickle.dumps(words, -1)), eval(repr(words)), update_test, + Counter(words), ]): msg = (i, dup, words) self.assert_(dup is not words) From python-checkins at python.org Tue Jan 13 02:49:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 02:49:10 +0100 (CET) Subject: [Python-checkins] r68563 - python/trunk/Doc/library/turtle.rst Message-ID: <20090113014910.445721E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 02:49:10 2009 New Revision: 68563 Log: small logic correction Modified: python/trunk/Doc/library/turtle.rst Modified: python/trunk/Doc/library/turtle.rst ============================================================================== --- python/trunk/Doc/library/turtle.rst (original) +++ python/trunk/Doc/library/turtle.rst Tue Jan 13 02:49:10 2009 @@ -325,8 +325,7 @@ :param y: a number (integer or float) - Set the turtle's first coordinate to *y*, leave second coordinate - unchanged. + Set the turtle's second coordinate to *y*, leave second coordinate unchanged. >>> turtle.position() (0.00, 40.00) From python-checkins at python.org Tue Jan 13 03:11:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 03:11:24 +0100 (CET) Subject: [Python-checkins] r68564 - in python/branches/py3k: Doc/c-api/init.rst Doc/whatsnew/2.7.rst Lib/test/test_capi.py Modules/_testcapimodule.c Message-ID: <20090113021124.632551E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 03:11:23 2009 New Revision: 68564 Log: Merged revisions 68425,68461,68498 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line fix markup ........ r68461 | kristjan.jonsson | 2009-01-09 15:35:16 -0600 (Fri, 09 Jan 2009) | 2 lines Issue 4293: Make Py_AddPendingCall() thread safe Add test cases and documentation ........ r68498 | benjamin.peterson | 2009-01-10 13:08:49 -0600 (Sat, 10 Jan 2009) | 1 line fix encoding ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Doc/whatsnew/2.7.rst python/branches/py3k/Lib/test/test_capi.py python/branches/py3k/Modules/_testcapimodule.c Modified: python/branches/py3k/Doc/c-api/init.rst ============================================================================== --- python/branches/py3k/Doc/c-api/init.rst (original) +++ python/branches/py3k/Doc/c-api/init.rst Tue Jan 13 03:11:23 2009 @@ -765,6 +765,50 @@ :cfunc:`PyGILState_Release` on the same thread. + +Asynchronous Notifications +========================== + +A mechanism is provided to make asynchronous notifications to the the main +interpreter thread. These notifications take the form of a function +pointer and a void argument. + +.. index:: single: setcheckinterval() (in module sys) + +Every check interval, when the interpreter lock is released and reacquired, +python will also call any such provided functions. This can be used for +example by asynchronous IO handlers. The notification can be scheduled +from a worker thread and the actual call than made at the earliest +convenience by the main thread where it has possession of the global +interpreter lock and can perform any Python API calls. + +.. cfunction:: void Py_AddPendingCall( int (*func)(void *), void *arg) ) + + .. index:: single: Py_AddPendingCall() + + Post a notification to the Python main thread. If successful, + \*:attr`func` will be called with the argument :attr:`arg` at the earliest + convenience. \*:attr:`func` will be called having the global interpreter + lock held and can thus use the full Python API and can take any + action such as setting object attributes to signal IO completion. + It must return 0 on success, or -1 signalling an exception. + The notification function won't be interrupted to perform another + asynchronous notification recursively, + but it can still be interrupted to switch threads if the interpreter + lock is released, for example, if it calls back into python code. + + This function returns 0 on success in which case the notification has been + scheduled. Otherwise, for example if the notification buffer is full, + it returns -1 without setting any exception. + + This function can be called on any thread, be it a Python thread or + some other system thread. If it is a Python thread, it doesen't matter if + it holds the global interpreter lock or not. + + .. versionadded:: 2.7 + + + .. _profiling: Profiling and Tracing 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 Tue Jan 13 03:11:23 2009 @@ -60,6 +60,11 @@ .. ======================================================================== +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 ====================== @@ -121,11 +126,10 @@ (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`.) + :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`.) .. ====================================================================== .. whole new modules get described in subsections here Modified: python/branches/py3k/Lib/test/test_capi.py ============================================================================== --- python/branches/py3k/Lib/test/test_capi.py (original) +++ python/branches/py3k/Lib/test/test_capi.py Tue Jan 13 03:11:23 2009 @@ -2,10 +2,14 @@ # these are all functions _testcapi exports whose name begins with 'test_'. import sys +import time +import random import unittest +import threading from test import support import _testcapi + def testfunction(self): """some doc""" return self @@ -28,6 +32,67 @@ self.assertRaises(AttributeError, setattr, inst.testfunction, "attribute", "test") +class TestPendingCalls(unittest.TestCase): + + def pendingcalls_submit(self, l, n): + def callback(): + #this function can be interrupted by thread switching so let's + #use an atomic operation + l.append(None) + + for i in range(n): + time.sleep(random.random()*0.02) #0.01 secs on average + #try submitting callback until successful. + #rely on regular interrupt to flush queue if we are + #unsuccessful. + while True: + if _testcapi._pending_threadfunc(callback): + break; + + def pendingcalls_wait(self, l, n): + #now, stick around until l[0] has grown to 10 + count = 0; + while len(l) != n: + #this busy loop is where we expect to be interrupted to + #run our callbacks. Note that callbacks are only run on the + #main thread + if False and test_support.verbose: + print("(%i)"%(len(l),),) + for i in range(1000): + a = i*i + count += 1 + self.failUnless(count < 10000, + "timeout waiting for %i callbacks, got %i"%(n, len(l))) + if False and test_support.verbose: + print("(%i)"%(len(l),)) + + def test_pendingcalls_threaded(self): + l = [] + + #do every callback on a separate thread + n = 32 + threads = [] + for i in range(n): + t = threading.Thread(target=self.pendingcalls_submit, args = (l, 1)) + t.start() + threads.append(t) + + self.pendingcalls_wait(l, n) + + for t in threads: + t.join() + + def test_pendingcalls_non_threaded(self): + #again, just using the main thread, likely they will all be dispathced at + #once. It is ok to ask for too many, because we loop until we find a slot. + #the loop can be interrupted to dispatch. + #there are only 32 dispatch slots, so we go for twice that! + l = [] + n = 64 + self.pendingcalls_submit(l, n) + self.pendingcalls_wait(l, n) + + def test_main(): support.run_unittest(CAPITest) @@ -71,6 +136,8 @@ t.start() t.join() + support.run_unittest(TestPendingCalls) + if __name__ == "__main__": test_main() Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Tue Jan 13 03:11:23 2009 @@ -919,6 +919,43 @@ return NULL; Py_RETURN_NONE; } + +/* test Py_AddPendingCalls using threads */ +static int _pending_callback(void *arg) +{ + /* we assume the argument is callable object to which we own a reference */ + PyObject *callable = (PyObject *)arg; + PyObject *r = PyObject_CallObject(callable, NULL); + Py_DECREF(callable); + Py_XDECREF(r); + return r != NULL ? 0 : -1; +} + +/* The following requests n callbacks to _pending_callback. It can be + * run from any python thread. + */ +PyObject *pending_threadfunc(PyObject *self, PyObject *arg) +{ + PyObject *callable; + int r; + if (PyArg_ParseTuple(arg, "O", &callable) == 0) + return NULL; + + /* create the reference for the callbackwhile we hold the lock */ + Py_INCREF(callable); + + Py_BEGIN_ALLOW_THREADS + r = Py_AddPendingCall(&_pending_callback, callable); + Py_END_ALLOW_THREADS + + if (r<0) { + Py_DECREF(callable); /* unsuccessful add, destroy the extra reference */ + Py_INCREF(Py_False); + return Py_False; + } + Py_INCREF(Py_True); + return Py_True; +} #endif /* Some tests of PyUnicode_FromFormat(). This needs more tests. */ @@ -1171,6 +1208,7 @@ {"test_Z_code", (PyCFunction)test_Z_code, METH_NOARGS}, #ifdef WITH_THREAD {"_test_thread_state", test_thread_state, METH_VARARGS}, + {"_pending_threadfunc", pending_threadfunc, METH_VARARGS}, #endif #ifdef HAVE_GETTIMEOFDAY {"profile_int", profile_int, METH_NOARGS}, From buildbot at python.org Tue Jan 13 03:47:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 02:47:30 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090113024732.F1E3F1E4002@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/108 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_capi Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_capi.py", line 104, in test_main test() _testcapi.error: test_lazy_hash_inheritance: type initialised too soon make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 13 04:49:44 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 13 Jan 2009 04:49:44 +0100 (CET) Subject: [Python-checkins] r68565 - python/trunk/Doc/library/collections.rst Message-ID: <20090113034944.2DDAB1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 13 04:49:43 2009 New Revision: 68565 Log: Minor documentation tweaks and simpler update() example. Modified: python/trunk/Doc/library/collections.rst Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Tue Jan 13 04:49:43 2009 @@ -175,7 +175,7 @@ [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] -.. class:: Counter([iterable]) +.. class:: Counter([iterable-or-mapping]) A :class:`Counter` is a :class:`dict` subclass for counting hashable items. It is an unordered collection where elements are stored as dictionary keys @@ -183,8 +183,8 @@ any integer value including zero or negative counts. The :class:`Counter` class is similar to bags or multisets in other languages. - Elements are counted from the *iterable* if given. Also, the counts - can be initialized from another mapping of elements to their counts:: + Elements are counted from an *iterable* or initialized from another + *mapping* (or counter):: >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable @@ -244,21 +244,18 @@ There is no equivalent class method for :class:`Counter` objects. Raises a :exc:`NotImplementedError` when called. - .. method:: update(iterable) + .. method:: update([iterable-or-mapping]) Like :meth:`dict.update` but adds-in counts instead of replacing them. - Elements are counted from the *iterable* if given. Also, the counts - can be taken from another counter or mapping of elements to their - counts:: - - >>> c = Counter('which') # count letters in a word - >>> d = Counter('witch') # count letters in another word - >>> c.update(d) # add counts from d to those in c - >>> c['h'] # count of 'h' is now three - 3 - >>> c.update('watch') # add in letters from another word - >>> c['h'] # count of 'h' is now four + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter):: + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch 4 From python-checkins at python.org Tue Jan 13 05:13:53 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 13 Jan 2009 05:13:53 +0100 (CET) Subject: [Python-checkins] r68566 - python/trunk/Lib/collections.py Message-ID: <20090113041353.BEBF81E4027@bag.python.org> Author: raymond.hettinger Date: Tue Jan 13 05:13:53 2009 New Revision: 68566 Log: Fixup and simplify docstrings and doctests. Modified: python/trunk/Lib/collections.py Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 13 05:13:53 2009 @@ -173,7 +173,7 @@ of elements to their counts. >>> c = Counter() # a new, empty counter - >>> c = Counter('hocus pocus') # a new counter from an iterable + >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping ''' @@ -204,16 +204,16 @@ >>> sorted(c.elements()) ['A', 'A', 'B', 'B', 'C', 'C'] - # Knuth's example of prime factors of 1836: 2**2 * 3**3 * 17**1 - >>> import operator - >>> prime_factors = Counter(dict([(2,2), (3,3), (17,1)])) - >>> sorted(prime_factors.elements()) # list individual factors - [2, 2, 3, 3, 3, 17] - >>> reduce(operator.mul, prime_factors.elements(), 1) # multiply them + # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 + >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) + >>> product = 1 + >>> for factor in prime_factors.elements(): # loop over factors + ... product *= factor # and multiply them + >>> product 1836 - Note, if an element's count has been set to zero or a negative number, - elements() will ignore it. + Note, if an element's count has been set to zero or is a negative + number, elements() will ignore it. ''' # Emulate Bag.do from Smalltalk and Multiset.begin from C++. @@ -233,15 +233,13 @@ def update(self, iterable=None): '''Like dict.update() but add counts instead of replacing them. - Source can be an iterable, a dictionary, or another Counter.instance(). + Source can be an iterable, a dictionary, or another Counter instance. >>> c = Counter('which') - >>> d = Counter('witch') - >>> c.update(d) # add counts from d to those in c - >>> c['h'] # count of 'h' is now three - 3 - >>> c.update('watch') - >>> c['h'] + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch 4 ''' From buildbot at python.org Tue Jan 13 05:19:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 04:19:02 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090113041903.5EEEC1E400C@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/0 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 svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 13 05:20:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 04:20:52 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090113042052.503531E4002@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/1777 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 13 05:25:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 04:25:33 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090113042533.9BECA1E4002@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/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Tue Jan 13 05:50:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 13 Jan 2009 05:50:35 +0100 (CET) Subject: [Python-checkins] r68567 - python/trunk/Lib/collections.py Message-ID: <20090113045035.98A041E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 13 05:50:35 2009 New Revision: 68567 Log: Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. Modified: python/trunk/Lib/collections.py Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 13 05:50:35 2009 @@ -10,7 +10,7 @@ from keyword import iskeyword as _iskeyword import sys as _sys import heapq as _heapq -import itertools as _itertools +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap ######################################################################## ### namedtuple ####################################################### @@ -217,9 +217,7 @@ ''' # Emulate Bag.do from Smalltalk and Multiset.begin from C++. - return _itertools.chain.from_iterable( - _itertools.starmap(_itertools.repeat, - self.iteritems())) + return _chain.from_iterable(_starmap(_repeat, self.iteritems())) # Override dict methods where necessary @@ -267,7 +265,7 @@ def __repr__(self): if not self: return '%s()' % self.__class__.__name__ - items = ', '.join('%r: %r' % item for item in self.most_common()) + items = ', '.join(map('%r: %r'.__mod__, self.most_common())) return '%s({%s})' % (self.__class__.__name__, items) @@ -303,49 +301,6 @@ Point3D = namedtuple('Point3D', Point._fields + ('z',)) print Point3D.__doc__ - # Check that counters are copyable, deepcopyable, picklable, and have a - # repr/eval round-trip - import copy - words = Counter('which witch had which witches wrist watch'.split()) - update_test = Counter() - update_test.update(words) - for i, dup in enumerate([ - words.copy(), - copy.copy(words), - copy.deepcopy(words), - loads(dumps(words, 0)), - loads(dumps(words, 1)), - loads(dumps(words, 2)), - loads(dumps(words, -1)), - eval(repr(words)), - update_test, - ]): - msg = (i, dup, words) - assert dup is not words, msg - assert dup == words, msg - assert len(dup) == len(words), msg - assert type(dup) == type(words), msg - - # Verify that counters are unhashable - try: - hash(words) - except TypeError: - pass - else: - print 'Failed hashing test' - - # Verify that Counter.fromkeys() is disabled - try: - Counter.fromkeys('razmataz') - except NotImplementedError: - pass - else: - print 'Failed fromkeys() test' - - # Check ABCs - assert issubclass(Counter, Mapping) - assert isinstance(Counter('asdfasdf'), Mapping) - import doctest TestResults = namedtuple('TestResults', 'failed attempted') print TestResults(*doctest.testmod()) From nnorwitz at gmail.com Tue Jan 13 07:20:06 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 13 Jan 2009 01:20:06 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090113062006.GA4923@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 g.brandl at gmx.net Tue Jan 13 08:51:17 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Tue, 13 Jan 2009 08:51:17 +0100 Subject: [Python-checkins] r68565 - python/trunk/Doc/library/collections.rst In-Reply-To: <20090113034944.2DDAB1E4002@bag.python.org> References: <20090113034944.2DDAB1E4002@bag.python.org> Message-ID: raymond.hettinger schrieb: > Author: raymond.hettinger > Date: Tue Jan 13 04:49:43 2009 > New Revision: 68565 > > Log: > Minor documentation tweaks and simpler update() example. > @@ -244,21 +244,18 @@ > There is no equivalent class method for :class:`Counter` objects. > Raises a :exc:`NotImplementedError` when called. > > - .. method:: update(iterable) > + .. method:: update([iterable-or-mapping]) Is the argument meant to be optional? Georg From python-checkins at python.org Tue Jan 13 09:11:07 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 13 Jan 2009 09:11:07 +0100 (CET) Subject: [Python-checkins] r68568 - python/trunk/Doc/c-api/init.rst Message-ID: <20090113081107.6D6271E4002@bag.python.org> Author: georg.brandl Date: Tue Jan 13 09:11:07 2009 New Revision: 68568 Log: Fix call signature and markup. 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 Tue Jan 13 09:11:07 2009 @@ -797,13 +797,13 @@ convenience by the main thread where it has possession of the global interpreter lock and can perform any Python API calls. -.. cfunction:: void Py_AddPendingCall( int (*func)(void *), void *arg) ) +.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) ) .. index:: single: Py_AddPendingCall() Post a notification to the Python main thread. If successful, - \*:attr`func` will be called with the argument :attr:`arg` at the earliest - convenience. \*:attr:`func` will be called having the global interpreter + *func* will be called with the argument *arg* at the earliest + convenience. *func* will be called having the global interpreter lock held and can thus use the full Python API and can take any action such as setting object attributes to signal IO completion. It must return 0 on success, or -1 signalling an exception. From python-checkins at python.org Tue Jan 13 09:38:14 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 13 Jan 2009 09:38:14 +0100 (CET) Subject: [Python-checkins] r68569 - python/trunk/Doc/library/collections.rst Message-ID: <20090113083814.1E6B41E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 13 09:38:14 2009 New Revision: 68569 Log: Add table of idioms/patterns for using Counter objects. Improve the appearance and flow of the References section -- it used to have a box around it that wasn't distinct from the preceding code boxes and it had a weird bolding pattern and hanging indents that made the section disproportionately large. 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 Jan 13 09:38:14 2009 @@ -258,24 +258,34 @@ >>> c['h'] # four 'h' in which, witch, and watch 4 +Common patterns for working with :class:`Counter` objects:: -.. seealso:: + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + c.most_common()[-n:] # n least common elements - `Multisets `_ - in the Wikipedia +**References**: - `Bag `_ - a Smalltalk class + * Wikipedia entry for `Multisets `_ - `C++ multisets `_ - a tutorial with standalone examples + * `Bag class `_ + in Smalltalk - `Bag class `_ - an early Python recipe + * `C++ multisets `_ + tutorial with standalone examples - Use cases for multisets and mathematical operations on multisets. + * An early Python `Bag `_ recipe + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later + + * Use cases for multisets and mathematical operations on multisets. Knuth, Donald. The Art of Computer Programming Volume II, - Section 4.6.3, Exercise 19. + Section 4.6.3, Exercise 19 .. _deque-objects: From python-checkins at python.org Tue Jan 13 10:08:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 13 Jan 2009 10:08:32 +0100 (CET) Subject: [Python-checkins] r68570 - python/trunk/Lib/_abcoll.py Message-ID: <20090113090832.50FB81E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 13 10:08:32 2009 New Revision: 68570 Log: Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. Modified: python/trunk/Lib/_abcoll.py Modified: python/trunk/Lib/_abcoll.py ============================================================================== --- python/trunk/Lib/_abcoll.py (original) +++ python/trunk/Lib/_abcoll.py Tue Jan 13 10:08:32 2009 @@ -249,12 +249,12 @@ @abstractmethod def add(self, value): - """Return True if it was added, False if already there.""" + """Add an element.""" raise NotImplementedError @abstractmethod def discard(self, value): - """Return True if it was deleted, False if not there.""" + """Remove an element. Do not raise an exception if absent.""" raise NotImplementedError def remove(self, value): From nnorwitz at gmail.com Tue Jan 13 10:09:52 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 13 Jan 2009 04:09:52 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (3) Message-ID: <20090113090952.GA17929@python.psfb.org> 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657736 refs] From nnorwitz at gmail.com Tue Jan 13 10:17:12 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 13 Jan 2009 04:17:12 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (3) Message-ID: <20090113091712.GA27753@python.psfb.org> 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16830 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657007 refs] From nnorwitz at gmail.com Tue Jan 13 11:56:40 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 13 Jan 2009 05:56:40 -0500 Subject: [Python-checkins] Python Regression Test Failures all (3) Message-ID: <20090113105640.GA14260@python.psfb.org> 331 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-11665 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 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 331 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [671608 refs] From python-checkins at python.org Tue Jan 13 12:52:23 2009 From: python-checkins at python.org (armin.ronacher) Date: Tue, 13 Jan 2009 12:52:23 +0100 (CET) Subject: [Python-checkins] r68571 - in python/trunk/Lib: ast.py test/test_ast.py Message-ID: <20090113115223.C33061E4002@bag.python.org> Author: armin.ronacher Date: Tue Jan 13 12:52:23 2009 New Revision: 68571 Log: ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. Modified: python/trunk/Lib/ast.py python/trunk/Lib/test/test_ast.py Modified: python/trunk/Lib/ast.py ============================================================================== --- python/trunk/Lib/ast.py (original) +++ python/trunk/Lib/ast.py Tue Jan 13 12:52:23 2009 @@ -64,6 +64,18 @@ elif isinstance(node, Name): if node.id in _safe_names: return _safe_names[node.id] + elif isinstance(node, BinOp) and \ + isinstance(node.op, (Add, Sub)) and \ + isinstance(node.right, Num) and \ + isinstance(node.right.n, complex) and \ + isinstance(node.left, Num) and \ + isinstance(node.left.n, (int, long, float)): + left = node.left.n + right = node.right.n + if isinstance(node.op, Add): + return left + right + else: + return left - right raise ValueError('malformed string') return _convert(node_or_string) Modified: python/trunk/Lib/test/test_ast.py ============================================================================== --- python/trunk/Lib/test/test_ast.py (original) +++ python/trunk/Lib/test/test_ast.py Tue Jan 13 12:52:23 2009 @@ -271,6 +271,17 @@ self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None)) self.assertRaises(ValueError, ast.literal_eval, 'foo()') + def test_literal_eval_issue4907(self): + self.assertEqual(ast.literal_eval('2j'), 2j) + self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j) + self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j) + try: + ast.literal_eval('2 + (3 + 4j)') + except ValueError: + pass + else: + self.fail('expected value error') + def test_main(): test_support.run_unittest(AST_Tests, ASTHelpers_Test) From ncoghlan at gmail.com Tue Jan 13 13:19:35 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Tue, 13 Jan 2009 22:19:35 +1000 Subject: [Python-checkins] r68560 - in python/trunk: Include/abstract.h Include/object.h Lib/test/crashers/iter.py Lib/test/test_iter.py Misc/NEWS Modules/itertoolsmodule.c Objects/abstract.c Objects/object.c Objects/typeobject.c In-Reply-To: <20090112233655.C316F1E4002@bag.python.org> References: <20090112233655.C316F1E4002@bag.python.org> Message-ID: <496C86D7.3050704@gmail.com> amaury.forgeotdarc wrote: > + if (descr == NULL) { > + if (ptr == (void**)&type->tp_iternext) { > + specific = _PyObject_NextNotImplemented; > + } > continue; > + } Hmm, that's a much cleaner approach than the strcmp based one currently used to check for assignments to __hash__ and __new__ in update_one_slot(). The other two slot special cases should probably be updated as well. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Tue Jan 13 14:40:55 2009 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 13 Jan 2009 14:40:55 +0100 (CET) Subject: [Python-checkins] r68572 - python/trunk/Doc/library/turtle.rst Message-ID: <20090113134055.1C0791E4002@bag.python.org> Author: andrew.kuchling Date: Tue Jan 13 14:40:54 2009 New Revision: 68572 Log: Note that first coord. is left alone Modified: python/trunk/Doc/library/turtle.rst Modified: python/trunk/Doc/library/turtle.rst ============================================================================== --- python/trunk/Doc/library/turtle.rst (original) +++ python/trunk/Doc/library/turtle.rst Tue Jan 13 14:40:54 2009 @@ -325,7 +325,7 @@ :param y: a number (integer or float) - Set the turtle's second coordinate to *y*, leave second coordinate unchanged. + Set the turtle's second coordinate to *y*, leave first coordinate unchanged. >>> turtle.position() (0.00, 40.00) From python-checkins at python.org Tue Jan 13 15:51:55 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 13 Jan 2009 15:51:55 +0100 (CET) Subject: [Python-checkins] r68573 - sandbox/trunk/io-c/test_io.py Message-ID: <20090113145155.C19F91E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 13 15:51:55 2009 New Revision: 68573 Log: Skip a test on 32-bit builds Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Tue Jan 13 15:51:55 2009 @@ -514,8 +514,11 @@ self.assertRaises(ValueError, bufio.read) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) self.assertRaises(ValueError, bufio.read) - self.assertRaises((OverflowError, MemoryError, ValueError), - bufio.__init__, rawio, sys.maxsize) + 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 = MockRawIO([b"abc"]) bufio.__init__(rawio) self.assertEquals(b"abc", bufio.read()) @@ -669,8 +672,11 @@ self.assertRaises(ValueError, bufio.write, b"def") self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) self.assertRaises(ValueError, bufio.write, b"def") - self.assertRaises((OverflowError, MemoryError, ValueError), - bufio.__init__, rawio, sys.maxsize) + 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() From python-checkins at python.org Tue Jan 13 17:09:04 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 13 Jan 2009 17:09:04 +0100 (CET) Subject: [Python-checkins] r68574 - in sandbox/trunk/io-c: _fileio.c _iomodule.h _textio.c Message-ID: <20090113160904.B5C641E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 13 17:09:03 2009 New Revision: 68574 Log: centralize Py_off_t definition in _iomodule.h Modified: sandbox/trunk/io-c/_fileio.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_fileio.c ============================================================================== --- sandbox/trunk/io-c/_fileio.c (original) +++ sandbox/trunk/io-c/_fileio.c Tue Jan 13 17:09:03 2009 @@ -588,12 +588,6 @@ /* XXX Windows support below is likely incomplete */ -#if defined(MS_WIN64) || defined(MS_WINDOWS) -typedef PY_LONG_LONG Py_off_t; -#else -typedef off_t Py_off_t; -#endif - /* Cribbed from posix_lseek() */ static PyObject * portable_lseek(int fd, PyObject *posobj, int whence) Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Tue Jan 13 17:09:03 2009 @@ -52,6 +52,27 @@ } PyBlockingIOErrorObject; PyObject *PyExc_BlockingIOError; + +#if defined(MS_WIN64) || defined(MS_WINDOWS) +typedef PY_LONG_LONG Py_off_t; +#define PyNumber_AsOff_t PyLong_AsLongLong +#define PyLong_FromOff_t PyLong_FromLongLong +#else +typedef off_t Py_off_t; +#if (SIZEOF_OFF_T == SIZEOF_SIZE_T) +#define PyNumber_AsOff_t PyNumber_AsSsize_t +#define PyLong_FromOff_t PyLong_FromSsize_t +#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG) +#define PyNumber_AsOff_t PyLong_AsLongLong +#define PyLong_FromOff_t PyLong_FromLongLong +#elif (SIZEOF_OFF_T == SIZEOF_LONG) +#define PyNumber_AsOff_t PyLong_AsLong +#define PyLong_FromOff_t PyLong_FromLong +#else +#error off_t does not have the same width as either size_t, long, or long long! +#endif +#endif + /* Implementation details */ extern PyObject *_PyIO_str_close; Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Tue Jan 13 17:09:03 2009 @@ -1313,12 +1313,6 @@ /* Seek and Tell */ -#if defined(MS_WIN64) || defined(MS_WINDOWS) -typedef PY_LONG_LONG Py_off_t; -#else -typedef off_t Py_off_t; -#endif - typedef struct { Py_off_t start_pos; int dec_flags; From python-checkins at python.org Tue Jan 13 18:32:28 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 13 Jan 2009 18:32:28 +0100 (CET) Subject: [Python-checkins] r68575 - python/trunk/Modules/_ctypes/cfield.c Message-ID: <20090113173228.41C031E4002@bag.python.org> Author: thomas.heller Date: Tue Jan 13 18:32:28 2009 New Revision: 68575 Log: Fix refcount leak in error cases. Bug found by coverity. Modified: python/trunk/Modules/_ctypes/cfield.c Modified: python/trunk/Modules/_ctypes/cfield.c ============================================================================== --- python/trunk/Modules/_ctypes/cfield.c (original) +++ python/trunk/Modules/_ctypes/cfield.c Tue Jan 13 18:32:28 2009 @@ -1452,11 +1452,14 @@ size += 1; /* terminating NUL */ size *= sizeof(wchar_t); buffer = (wchar_t *)PyMem_Malloc(size); - if (!buffer) + if (!buffer) { + Py_DECREF(value); return PyErr_NoMemory(); + } memset(buffer, 0, size); keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); if (!keep) { + Py_DECREF(value); PyMem_Free(buffer); return NULL; } From python-checkins at python.org Tue Jan 13 19:17:27 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 13 Jan 2009 19:17:27 +0100 (CET) Subject: [Python-checkins] r68576 - in sandbox/trunk/io-c: _bufferedio.c _iomodule.h io.c test_io.py Message-ID: <20090113181727.DC4C91E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 13 19:17:27 2009 New Revision: 68576 Log: Make BufferedIO pass large file tests, even on 32-bit builds (Linux). Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/io.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Tue Jan 13 19:17:27 2009 @@ -114,24 +114,24 @@ int writable; /* Absolute position inside the raw stream (-1 if unknown). */ - Py_ssize_t abs_pos; + Py_off_t abs_pos; /* A static buffer of size `buffer_size` */ char *buffer; /* Current logical position in the buffer. */ - Py_ssize_t pos; + Py_off_t pos; /* Position of the raw stream in the buffer. */ - Py_ssize_t raw_pos; + Py_off_t raw_pos; /* Just after the last buffered byte in the buffer, or -1 if the buffer isn't ready for reading. */ - Py_ssize_t read_end; + Py_off_t read_end; /* Just after the last byte actually written */ - Py_ssize_t write_pos; + Py_off_t write_pos; /* Just after the last byte waiting to be written, or -1 if the buffer isn't ready for writing. */ - Py_ssize_t write_end; + Py_off_t write_end; PyThread_type_lock lock; @@ -459,41 +459,55 @@ return &err->written; } -static Py_ssize_t +static Py_off_t _Buffered_raw_tell(BufferedObject *self) { PyObject *res; - Py_ssize_t n; + Py_off_t n; res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_tell, NULL); if (res == NULL) return -1; - n = PyNumber_AsSsize_t(res, PyExc_ValueError); + n = PyNumber_AsOff_t(res, PyExc_ValueError); Py_DECREF(res); if (n < 0) { - PyErr_Format(PyExc_IOError, - "Raw stream returned invalid position %zd", n); + if (!PyErr_Occurred()) + PyErr_Format(PyExc_IOError, + "Raw stream returned invalid position %zd", n); return -1; } self->abs_pos = n; return n; } -static Py_ssize_t -_Buffered_raw_seek(BufferedObject *self, Py_ssize_t target, int whence) +static Py_off_t +_Buffered_raw_seek(BufferedObject *self, Py_off_t target, int whence) { - PyObject *res; - Py_ssize_t n; - res = PyObject_CallMethod(self->raw, "seek", "ni", target, whence); + PyObject *res, *posobj, *whenceobj; + Py_off_t n; + + posobj = PyLong_FromOff_t(target); + if (posobj == NULL) + return -1; + whenceobj = PyLong_FromLong(whence); + if (whenceobj == NULL) { + Py_DECREF(posobj); + return -1; + } + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_seek, + posobj, whenceobj, NULL); + Py_DECREF(posobj); + Py_DECREF(whenceobj); if (res == NULL) return -1; - n = PyNumber_AsSsize_t(res, PyExc_ValueError); + n = PyNumber_AsOff_t(res, PyExc_ValueError); Py_DECREF(res); - self->abs_pos = n; if (n < 0) { - PyErr_Format(PyExc_IOError, - "Raw stream returned invalid position %zd", n); + if (!PyErr_Occurred()) + PyErr_Format(PyExc_IOError, + "Raw stream returned invalid position %zd", n); return -1; } + self->abs_pos = n; return n; } @@ -551,7 +565,7 @@ if (res != NULL && self->readable) { /* Rewind the raw stream so that its position corresponds to the current logical position. */ - Py_ssize_t n; + Py_off_t n; n = _Buffered_raw_seek(self, -RAW_OFFSET(self), 1); if (n == -1) Py_CLEAR(res); @@ -707,7 +721,7 @@ static PyObject * Buffered_tell(BufferedObject *self, PyObject *args) { - Py_ssize_t pos; + Py_off_t pos; CHECK_INITIALIZED(self) pos = _Buffered_raw_tell(self); @@ -715,18 +729,18 @@ return NULL; pos -= RAW_OFFSET(self); /* TODO: sanity check (pos >= 0) */ - return PyLong_FromSsize_t(pos); + return PyLong_FromOff_t(pos); } static PyObject * Buffered_seek(BufferedObject *self, PyObject *args) { - Py_ssize_t current, target, avail, n; + Py_off_t target, n; int whence = 0; PyObject *res = NULL; CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "n|i:seek", &target, &whence)) { + if (!PyArg_ParseTuple(args, OFF_T_ARG "|i:seek", &target, &whence)) { return NULL; } @@ -739,20 +753,21 @@ ENTER_BUFFERED(self) if (whence != 2 && self->readable) { + Py_off_t current, avail; /* Check if seeking leaves us inside the current buffer, so as to return quickly if possible. Don't know how to do that when whence == 2, though. */ current = RAW_TELL(self); avail = READAHEAD(self); if (avail > 0) { - Py_ssize_t offset; + Py_off_t offset; if (whence == 0) offset = target - (current - RAW_OFFSET(self)); else offset = target; if (offset >= -self->pos && offset <= avail) { self->pos += offset; - res = PyLong_FromSsize_t(current - avail + offset); + res = PyLong_FromOff_t(current - avail + offset); goto end; } } @@ -774,7 +789,7 @@ if (n == -1) goto end; self->raw_pos = -1; - res = PyLong_FromSsize_t(n); + res = PyLong_FromOff_t(n); if (res != NULL && self->readable) _BufferedReader_reset_buf(self); @@ -1284,7 +1299,8 @@ static PyObject * _BufferedWriter_flush_unlocked(BufferedObject *self, int restore_pos) { - Py_ssize_t written = 0, n, rewind; + Py_ssize_t written = 0; + Py_off_t n, rewind; if (!VALID_WRITE_BUFFER(self) || self->write_pos == self->write_end) goto end; @@ -1312,14 +1328,13 @@ /* Already re-raised */ goto error; } - /* TODO: sanity check with a macro */ self->write_pos += n; self->raw_pos = self->write_pos; written += n; } if (restore_pos) { - Py_ssize_t forward = rewind - written; + Py_off_t forward = rewind - written; if (forward != 0) { n = _Buffered_raw_seek(self, forward, 1); if (n < 0) { Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Tue Jan 13 19:17:27 2009 @@ -54,23 +54,33 @@ #if defined(MS_WIN64) || defined(MS_WINDOWS) + +/* Windows uses long long for offsets */ typedef PY_LONG_LONG Py_off_t; -#define PyNumber_AsOff_t PyLong_AsLongLong -#define PyLong_FromOff_t PyLong_FromLongLong +# define PyNumber_AsOff_t(o, exc) PyLong_AsLongLong(o) +# define PyLong_FromOff_t PyLong_FromLongLong +# define OFF_T_ARG "L" + #else + +/* Other platforms use off_t */ typedef off_t Py_off_t; #if (SIZEOF_OFF_T == SIZEOF_SIZE_T) -#define PyNumber_AsOff_t PyNumber_AsSsize_t -#define PyLong_FromOff_t PyLong_FromSsize_t +# define PyNumber_AsOff_t PyNumber_AsSsize_t +# define PyLong_FromOff_t PyLong_FromSsize_t +# define OFF_T_ARG "n" #elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG) -#define PyNumber_AsOff_t PyLong_AsLongLong -#define PyLong_FromOff_t PyLong_FromLongLong +# define PyNumber_AsOff_t(o, exc) PyLong_AsLongLong(o) +# define PyLong_FromOff_t PyLong_FromLongLong +# define OFF_T_ARG "L" #elif (SIZEOF_OFF_T == SIZEOF_LONG) -#define PyNumber_AsOff_t PyLong_AsLong -#define PyLong_FromOff_t PyLong_FromLong +# define PyNumber_AsOff_t(o, exc) PyLong_AsLong(o) +# define PyLong_FromOff_t PyLong_FromLong +# define OFF_T_ARG "l" #else -#error off_t does not have the same width as either size_t, long, or long long! +# error off_t does not match either size_t, long, or long long! #endif + #endif /* Implementation details */ @@ -89,6 +99,7 @@ extern PyObject *_PyIO_str_readable; extern PyObject *_PyIO_str_readinto; extern PyObject *_PyIO_str_readline; +extern PyObject *_PyIO_str_seek; extern PyObject *_PyIO_str_seekable; extern PyObject *_PyIO_str_tell; extern PyObject *_PyIO_str_truncate; Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Tue Jan 13 19:17:27 2009 @@ -28,6 +28,7 @@ PyObject *_PyIO_str_readable; PyObject *_PyIO_str_readinto; PyObject *_PyIO_str_readline; +PyObject *_PyIO_str_seek; PyObject *_PyIO_str_seekable; PyObject *_PyIO_str_tell; PyObject *_PyIO_str_truncate; @@ -658,6 +659,8 @@ goto fail; if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) goto fail; + if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) + goto fail; if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) goto fail; if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Tue Jan 13 19:17:27 2009 @@ -177,7 +177,8 @@ self.assertEqual(f.tell(), 13) self.assertEqual(f.truncate(12), 12) self.assertEqual(f.tell(), 12) - self.assertRaises(TypeError, f.seek, 0.0) + # Disabled until PyNumber_AsOff_t exists + #self.assertRaises(TypeError, f.seek, 0.0) def read_ops(self, f, buffered=False): data = f.read(5) @@ -199,7 +200,8 @@ self.assertEqual(f.seek(-6, 1), 5) self.assertEqual(f.read(5), b" worl") self.assertEqual(f.tell(), 10) - self.assertRaises(TypeError, f.seek, 0.0) + # Disabled until PyNumber_AsOff_t exists + #self.assertRaises(TypeError, f.seek, 0.0) if buffered: f.seek(0) self.assertEqual(f.read(), b"hello world\n") @@ -913,7 +915,8 @@ rw.seek(2, 1) self.assertEquals(7, rw.tell()) self.assertEquals(b"fl", rw.read(11)) - self.assertRaises(TypeError, rw.seek, 0.0) + # Disabled until PyNumber_AsOff_t exists + #self.assertRaises(TypeError, rw.seek, 0.0) def check_flush_and_read(self, read_func): raw = io.BytesIO(b"abcdefghi") From python-checkins at python.org Tue Jan 13 19:30:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 13 Jan 2009 19:30:33 +0100 (CET) Subject: [Python-checkins] r68577 - sandbox/trunk/io-c/_iobase.c Message-ID: <20090113183033.AE10F1E4026@bag.python.org> Author: antoine.pitrou Date: Tue Jan 13 19:30:33 2009 New Revision: 68577 Log: Silence some gcc warnings. Modified: sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Tue Jan 13 19:30:33 2009 @@ -214,8 +214,9 @@ Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not seekable."); } - if (args == Py_True) + if (args == Py_True) { Py_DECREF(res); + } return res; } @@ -241,8 +242,9 @@ Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not readable."); } - if (args == Py_True) + if (args == Py_True) { Py_DECREF(res); + } return res; } @@ -268,8 +270,9 @@ Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not writable."); } - if (args == Py_True) + if (args == Py_True) { Py_DECREF(res); + } return res; } From python-checkins at python.org Tue Jan 13 21:45:42 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 13 Jan 2009 21:45:42 +0100 (CET) Subject: [Python-checkins] r68578 - in sandbox/trunk/io-c: _bufferedio.c _iomodule.h io.c test_io.py Message-ID: <20090113204542.E41531E4015@bag.python.org> Author: antoine.pitrou Date: Tue Jan 13 21:45:41 2009 New Revision: 68578 Log: Define our own PyNumber_AsOff_t with the expected behaviour Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_iomodule.h sandbox/trunk/io-c/io.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Tue Jan 13 21:45:41 2009 @@ -737,10 +737,10 @@ { Py_off_t target, n; int whence = 0; - PyObject *res = NULL; + PyObject *targetobj, *res = NULL; CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, OFF_T_ARG "|i:seek", &target, &whence)) { + if (!PyArg_ParseTuple(args, "O|i:seek", &targetobj, &whence)) { return NULL; } @@ -749,6 +749,9 @@ "whence must be between 0 and 2, not %d", whence); return NULL; } + target = PyNumber_AsOff_t(targetobj, PyExc_ValueError); + if (target == -1 && PyErr_Occurred()) + return NULL; ENTER_BUFFERED(self) Modified: sandbox/trunk/io-c/_iomodule.h ============================================================================== --- sandbox/trunk/io-c/_iomodule.h (original) +++ sandbox/trunk/io-c/_iomodule.h Tue Jan 13 21:45:41 2009 @@ -53,36 +53,46 @@ PyObject *PyExc_BlockingIOError; +/* + * Offset type for positioning. + */ + #if defined(MS_WIN64) || defined(MS_WINDOWS) /* Windows uses long long for offsets */ typedef PY_LONG_LONG Py_off_t; -# define PyNumber_AsOff_t(o, exc) PyLong_AsLongLong(o) -# define PyLong_FromOff_t PyLong_FromLongLong -# define OFF_T_ARG "L" +# define PyLong_AsOff_t PyLong_AsLongLong +# define PyLong_FromOff_t PyLong_FromLongLong +# define PY_OFF_T_MAX PY_LLONG_MAX +# define PY_OFF_T_MIN PY_LLONG_MIN #else /* Other platforms use off_t */ typedef off_t Py_off_t; #if (SIZEOF_OFF_T == SIZEOF_SIZE_T) -# define PyNumber_AsOff_t PyNumber_AsSsize_t -# define PyLong_FromOff_t PyLong_FromSsize_t -# define OFF_T_ARG "n" +# define PyLong_AsOff_t PyLong_AsSsize_t +# define PyLong_FromOff_t PyLong_FromSsize_t +# define PY_OFF_T_MAX PY_SSIZE_T_MAX +# define PY_OFF_T_MIN PY_SSIZE_T_MIN #elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG) -# define PyNumber_AsOff_t(o, exc) PyLong_AsLongLong(o) -# define PyLong_FromOff_t PyLong_FromLongLong -# define OFF_T_ARG "L" +# define PyLong_AsOff_t PyLong_AsLongLong +# define PyLong_FromOff_t PyLong_FromLongLong +# define PY_OFF_T_MAX PY_LLONG_MAX +# define PY_OFF_T_MIN PY_LLONG_MIN #elif (SIZEOF_OFF_T == SIZEOF_LONG) -# define PyNumber_AsOff_t(o, exc) PyLong_AsLong(o) -# define PyLong_FromOff_t PyLong_FromLong -# define OFF_T_ARG "l" +# define PyLong_AsOff_t PyLong_AsLong +# define PyLong_FromOff_t PyLong_FromLong +# define PY_OFF_T_MAX LONG_MAX +# define PY_OFF_T_MIN LONG_MIN #else # error off_t does not match either size_t, long, or long long! #endif #endif +extern Py_off_t PyNumber_AsOff_t(PyObject *item, PyObject *err); + /* Implementation details */ extern PyObject *_PyIO_str_close; Modified: sandbox/trunk/io-c/io.c ============================================================================== --- sandbox/trunk/io-c/io.c (original) +++ sandbox/trunk/io-c/io.c Tue Jan 13 21:45:41 2009 @@ -509,6 +509,53 @@ return NULL; } +/* + * Private helpers for the io module. + */ + +Py_off_t +PyNumber_AsOff_t(PyObject *item, PyObject *err) +{ + Py_off_t result; + PyObject *runerr; + PyObject *value = PyNumber_Index(item); + if (value == NULL) + return -1; + + /* We're done if PyLong_AsSsize_t() returns without error. */ + result = PyLong_AsOff_t(value); + if (result != -1 || !(runerr = PyErr_Occurred())) + goto finish; + + /* Error handling code -- only manage OverflowError differently */ + if (!PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) + goto finish; + + PyErr_Clear(); + /* If no error-handling desired then the default clipping + is sufficient. + */ + if (!err) { + assert(PyLong_Check(value)); + /* Whether or not it is less than or equal to + zero is determined by the sign of ob_size + */ + if (_PyLong_Sign(value) < 0) + result = PY_OFF_T_MIN; + else + result = PY_OFF_T_MAX; + } + else { + /* Otherwise replace the error with caller's error object. */ + PyErr_Format(err, + "cannot fit '%.200s' into an offset-sized integer", + item->ob_type->tp_name); + } + + finish: + Py_DECREF(value); + return result; +} /* * Module definition Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Tue Jan 13 21:45:41 2009 @@ -177,8 +177,7 @@ self.assertEqual(f.tell(), 13) self.assertEqual(f.truncate(12), 12) self.assertEqual(f.tell(), 12) - # Disabled until PyNumber_AsOff_t exists - #self.assertRaises(TypeError, f.seek, 0.0) + self.assertRaises(TypeError, f.seek, 0.0) def read_ops(self, f, buffered=False): data = f.read(5) @@ -200,8 +199,7 @@ self.assertEqual(f.seek(-6, 1), 5) self.assertEqual(f.read(5), b" worl") self.assertEqual(f.tell(), 10) - # Disabled until PyNumber_AsOff_t exists - #self.assertRaises(TypeError, f.seek, 0.0) + self.assertRaises(TypeError, f.seek, 0.0) if buffered: f.seek(0) self.assertEqual(f.read(), b"hello world\n") @@ -915,8 +913,7 @@ rw.seek(2, 1) self.assertEquals(7, rw.tell()) self.assertEquals(b"fl", rw.read(11)) - # Disabled until PyNumber_AsOff_t exists - #self.assertRaises(TypeError, rw.seek, 0.0) + self.assertRaises(TypeError, rw.seek, 0.0) def check_flush_and_read(self, read_func): raw = io.BytesIO(b"abcdefghi") From nnorwitz at gmail.com Tue Jan 13 22:08:36 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 13 Jan 2009 16:08:36 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (3) Message-ID: <20090113210836.GA1763@python.psfb.org> 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657773 refs] From nnorwitz at gmail.com Tue Jan 13 22:15:22 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 13 Jan 2009 16:15:22 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (3) Message-ID: <20090113211522.GA3139@python.psfb.org> 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_xmlrpc failed -- errors occurred; run in verbose mode for details 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 326 tests OK. 3 tests failed: test_datetime test_os test_xmlrpc 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657044 refs] From python-checkins at python.org Tue Jan 13 22:42:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 22:42:23 +0100 (CET) Subject: [Python-checkins] r68579 - python/trunk/Makefile.pre.in Message-ID: <20090113214223.E4EF21E400C@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 22:42:23 2009 New Revision: 68579 Log: make bytearrayobject.o depend on the stringlib #4936 Modified: python/trunk/Makefile.pre.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Tue Jan 13 22:42:23 2009 @@ -564,6 +564,9 @@ Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ $(STRINGLIB_HEADERS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \ + $(STRINGLIB_HEADERS) + Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \ $(STRINGLIB_HEADERS) From python-checkins at python.org Tue Jan 13 22:43:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 22:43:11 +0100 (CET) Subject: [Python-checkins] r68580 - python/trunk/Makefile.pre.in Message-ID: <20090113214311.7DEE61E400C@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 22:43:11 2009 New Revision: 68580 Log: add bytearrayobject.h to PYTHON_HEADERS Modified: python/trunk/Makefile.pre.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Tue Jan 13 22:43:11 2009 @@ -587,6 +587,7 @@ Include/ast.h \ Include/bitset.h \ Include/boolobject.h \ + Include/bytearrayobject.h \ Include/bytes_methods.h \ Include/bytesobject.h \ Include/bufferobject.h \ From python-checkins at python.org Tue Jan 13 22:53:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 22:53:28 +0100 (CET) Subject: [Python-checkins] r68581 - python/branches/py3k/Makefile.pre.in Message-ID: <20090113215328.ECC251E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 22:53:28 2009 New Revision: 68581 Log: make bytearrayobject.o depend on the stringlib headers #4936 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 Jan 13 22:53:28 2009 @@ -559,9 +559,9 @@ $(srcdir)/Objects/stringlib/unicodedefs.h \ $(srcdir)/Objects/stringlib/localeutil.h -Objects/stringobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) +Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) -Objects/bytesobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ $(BYTESTR_DEPS) \ From python-checkins at python.org Tue Jan 13 23:14:01 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 13 Jan 2009 23:14:01 +0100 (CET) Subject: [Python-checkins] r68582 - python/trunk/Lib/test/test_ast.py Message-ID: <20090113221401.61E7E1E4002@bag.python.org> Author: georg.brandl Date: Tue Jan 13 23:14:01 2009 New Revision: 68582 Log: Use assertRaises. Modified: python/trunk/Lib/test/test_ast.py Modified: python/trunk/Lib/test/test_ast.py ============================================================================== --- python/trunk/Lib/test/test_ast.py (original) +++ python/trunk/Lib/test/test_ast.py Tue Jan 13 23:14:01 2009 @@ -275,12 +275,7 @@ self.assertEqual(ast.literal_eval('2j'), 2j) self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j) self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j) - try: - ast.literal_eval('2 + (3 + 4j)') - except ValueError: - pass - else: - self.fail('expected value error') + self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)') def test_main(): From python-checkins at python.org Tue Jan 13 23:15:07 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 23:15:07 +0100 (CET) Subject: [Python-checkins] r68583 - in python/branches/release30-maint: Makefile.pre.in Message-ID: <20090113221507.67D8A1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 23:15:07 2009 New Revision: 68583 Log: Merged revisions 68581 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68581 | benjamin.peterson | 2009-01-13 15:53:28 -0600 (Tue, 13 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib headers #4936 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Makefile.pre.in Modified: python/branches/release30-maint/Makefile.pre.in ============================================================================== --- python/branches/release30-maint/Makefile.pre.in (original) +++ python/branches/release30-maint/Makefile.pre.in Tue Jan 13 23:15:07 2009 @@ -560,9 +560,9 @@ $(srcdir)/Objects/stringlib/unicodedefs.h \ $(srcdir)/Objects/stringlib/localeutil.h -Objects/stringobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) +Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) -Objects/bytesobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ $(BYTESTR_DEPS) \ From python-checkins at python.org Tue Jan 13 23:22:41 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 23:22:41 +0100 (CET) Subject: [Python-checkins] r68584 - python/trunk/Makefile.pre.in Message-ID: <20090113222241.423E01E4033@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 23:22:41 2009 New Revision: 68584 Log: de-spacify Modified: python/trunk/Makefile.pre.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Tue Jan 13 23:22:41 2009 @@ -565,7 +565,7 @@ $(STRINGLIB_HEADERS) Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \ - $(STRINGLIB_HEADERS) + $(STRINGLIB_HEADERS) Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \ $(STRINGLIB_HEADERS) @@ -587,7 +587,7 @@ Include/ast.h \ Include/bitset.h \ Include/boolobject.h \ - Include/bytearrayobject.h \ + Include/bytearrayobject.h \ Include/bytes_methods.h \ Include/bytesobject.h \ Include/bufferobject.h \ From python-checkins at python.org Tue Jan 13 23:25:18 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 23:25:18 +0100 (CET) Subject: [Python-checkins] r68585 - python/branches/py3k/Makefile.pre.in Message-ID: <20090113222518.E12E21E4040@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 23:25:18 2009 New Revision: 68585 Log: de-spacify 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 Jan 13 23:25:18 2009 @@ -564,11 +564,11 @@ Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ - $(BYTESTR_DEPS) \ - $(srcdir)/Objects/stringlib/formatter.h + $(BYTESTR_DEPS) \ + $(srcdir)/Objects/stringlib/formatter.h Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ - $(BYTESTR_DEPS) + $(BYTESTR_DEPS) ############################################################################ From python-checkins at python.org Tue Jan 13 23:33:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 13 Jan 2009 23:33:14 +0100 (CET) Subject: [Python-checkins] r68586 - python/branches/py3k Message-ID: <20090113223314.5E19A1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 13 23:33:14 2009 New Revision: 68586 Log: Blocked revisions 68579-68580,68584 via svnmerge ........ r68579 | benjamin.peterson | 2009-01-13 15:42:23 -0600 (Tue, 13 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib #4936 ........ r68580 | benjamin.peterson | 2009-01-13 15:43:11 -0600 (Tue, 13 Jan 2009) | 1 line add bytearrayobject.h to PYTHON_HEADERS ........ r68584 | benjamin.peterson | 2009-01-13 16:22:41 -0600 (Tue, 13 Jan 2009) | 1 line de-spacify ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Tue Jan 13 23:33:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 22:33:37 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090113223337.5898B1E4002@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/121 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_calendar test_email make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 13 23:50:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 13 Jan 2009 22:50:53 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090113225053.948E31E4002@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/55 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 13 23:59:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 13 Jan 2009 23:59:11 +0100 (CET) Subject: [Python-checkins] r68587 - in python/branches/py3k: Misc/NEWS Objects/stringlib/transmogrify.h Message-ID: <20090113225911.688001E402C@bag.python.org> Author: antoine.pitrou Date: Tue Jan 13 23:59:11 2009 New Revision: 68587 Log: 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. (*) or at least it is our interpretation Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/stringlib/transmogrify.h Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 13 23:59:11 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- 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. + - Issue #3720: Fix a crash when an iterator modifies its class and removes its __next__ method. Modified: python/branches/py3k/Objects/stringlib/transmogrify.h ============================================================================== --- python/branches/py3k/Objects/stringlib/transmogrify.h (original) +++ python/branches/py3k/Objects/stringlib/transmogrify.h Tue Jan 13 23:59:11 2009 @@ -22,76 +22,69 @@ { const char *e, *p; char *q; - Py_ssize_t i, j, old_j; + size_t i, j; PyObject *u; int tabsize = 8; - + if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; - + return NULL; + /* First pass: determine size of output string */ - i = j = old_j = 0; + i = j = 0; e = STRINGLIB_STR(self) + STRINGLIB_LEN(self); for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - j += tabsize - (j % tabsize); - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (old_j > j) { - PyErr_SetString(PyExc_OverflowError, - "result is too long"); - return NULL; - } - old_j = j; + if (tabsize > 0) { + j += tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, + "result is too long"); + return NULL; + } } - } + } else { j++; if (*p == '\n' || *p == '\r') { i += j; - old_j = j = 0; - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (i < 0) { + j = 0; + if (i > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } } } - - if ((i + j) < 0) { - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ + + if ((i + j) > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } - + /* Second pass: create output string and fill it */ u = STRINGLIB_NEW(NULL, i + j); if (!u) return NULL; - + j = 0; q = STRINGLIB_STR(u); - + for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) - *q++ = ' '; - } - } - else { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) + *q++ = ' '; + } + } + else { j++; - *q++ = *p; + *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } - + return u; } From python-checkins at python.org Wed Jan 14 00:12:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 14 Jan 2009 00:12:24 +0100 (CET) Subject: [Python-checkins] r68588 - in python/branches/release30-maint: Misc/NEWS Objects/stringlib/transmogrify.h Message-ID: <20090113231224.712DC1E4023@bag.python.org> Author: antoine.pitrou Date: Wed Jan 14 00:12:23 2009 New Revision: 68588 Log: Merged revisions 68587 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68587 | antoine.pitrou | 2009-01-13 23:59:11 +0100 (mar., 13 janv. 2009) | 7 lines 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. (*) or at least it is our interpretation ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/stringlib/transmogrify.h Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Jan 14 00:12:23 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- 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. + - Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API function no longer attempt to call the __long__ slot to convert an object to an integer. Only the __int__ and __trunc__ slots are examined. Modified: python/branches/release30-maint/Objects/stringlib/transmogrify.h ============================================================================== --- python/branches/release30-maint/Objects/stringlib/transmogrify.h (original) +++ python/branches/release30-maint/Objects/stringlib/transmogrify.h Wed Jan 14 00:12:23 2009 @@ -22,76 +22,69 @@ { const char *e, *p; char *q; - Py_ssize_t i, j, old_j; + size_t i, j; PyObject *u; int tabsize = 8; - + if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; - + return NULL; + /* First pass: determine size of output string */ - i = j = old_j = 0; + i = j = 0; e = STRINGLIB_STR(self) + STRINGLIB_LEN(self); for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - j += tabsize - (j % tabsize); - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (old_j > j) { - PyErr_SetString(PyExc_OverflowError, - "result is too long"); - return NULL; - } - old_j = j; + if (tabsize > 0) { + j += tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, + "result is too long"); + return NULL; + } } - } + } else { j++; if (*p == '\n' || *p == '\r') { i += j; - old_j = j = 0; - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (i < 0) { + j = 0; + if (i > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } } } - - if ((i + j) < 0) { - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ + + if ((i + j) > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } - + /* Second pass: create output string and fill it */ u = STRINGLIB_NEW(NULL, i + j); if (!u) return NULL; - + j = 0; q = STRINGLIB_STR(u); - + for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) - *q++ = ' '; - } - } - else { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) + *q++ = ' '; + } + } + else { j++; - *q++ = *p; + *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } - + return u; } From python-checkins at python.org Wed Jan 14 00:13:52 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 14 Jan 2009 00:13:52 +0100 (CET) Subject: [Python-checkins] r68589 - in python/trunk: Misc/NEWS Objects/stringlib/transmogrify.h Message-ID: <20090113231352.E6BDB1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 14 00:13:52 2009 New Revision: 68589 Log: 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/trunk/Misc/NEWS python/trunk/Objects/stringlib/transmogrify.h Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 14 00:13:52 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- 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. + - Issue #3720: Fix a crash when an iterator modifies its class and removes its __next__ method. Modified: python/trunk/Objects/stringlib/transmogrify.h ============================================================================== --- python/trunk/Objects/stringlib/transmogrify.h (original) +++ python/trunk/Objects/stringlib/transmogrify.h Wed Jan 14 00:13:52 2009 @@ -22,76 +22,69 @@ { const char *e, *p; char *q; - Py_ssize_t i, j, old_j; + size_t i, j; PyObject *u; int tabsize = 8; - + if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; - + return NULL; + /* First pass: determine size of output string */ - i = j = old_j = 0; + i = j = 0; e = STRINGLIB_STR(self) + STRINGLIB_LEN(self); for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - j += tabsize - (j % tabsize); - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (old_j > j) { - PyErr_SetString(PyExc_OverflowError, - "result is too long"); - return NULL; - } - old_j = j; + if (tabsize > 0) { + j += tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, + "result is too long"); + return NULL; + } } - } + } else { j++; if (*p == '\n' || *p == '\r') { i += j; - old_j = j = 0; - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (i < 0) { + j = 0; + if (i > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } } } - - if ((i + j) < 0) { - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ + + if ((i + j) > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } - + /* Second pass: create output string and fill it */ u = STRINGLIB_NEW(NULL, i + j); if (!u) return NULL; - + j = 0; q = STRINGLIB_STR(u); - + for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) - *q++ = ' '; - } - } - else { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) + *q++ = ' '; + } + } + else { j++; - *q++ = *p; + *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } - + return u; } From python-checkins at python.org Wed Jan 14 00:14:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 14 Jan 2009 00:14:04 +0100 (CET) Subject: [Python-checkins] r68590 - python/branches/py3k/Doc/c-api/unicode.rst Message-ID: <20090113231404.497B31E4002@bag.python.org> Author: benjamin.peterson Date: Wed Jan 14 00:14:04 2009 New Revision: 68590 Log: encoding returns bytes objects Modified: python/branches/py3k/Doc/c-api/unicode.rst Modified: python/branches/py3k/Doc/c-api/unicode.rst ============================================================================== --- python/branches/py3k/Doc/c-api/unicode.rst (original) +++ python/branches/py3k/Doc/c-api/unicode.rst Wed Jan 14 00:14:04 2009 @@ -409,19 +409,19 @@ .. cfunction:: PyObject* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors) Encode the :ctype:`Py_UNICODE` buffer of the given size and return a Python - string object. *encoding* and *errors* have the same meaning as the parameters - of the same name in the Unicode :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. + bytes object. *encoding* and *errors* have the same meaning as the + parameters of the same name in the Unicode :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. .. cfunction:: PyObject* PyUnicode_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors) - Encode a Unicode object and return the result as Python string object. - *encoding* and *errors* have the same meaning as the parameters of the same name - in the Unicode :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. + Encode a Unicode object and return the result as Python bytes object. + *encoding* and *errors* have the same meaning as the parameters of the same + name in the Unicode :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. These are the UTF-8 codec APIs: @@ -444,15 +444,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and return a - Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and + return a Python bytes object. Return *NULL* if an exception was raised by + the codec. .. cfunction:: PyObject* PyUnicode_AsUTF8String(PyObject *unicode) - Encode a Unicode object using UTF-8 and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using UTF-8 and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. These are the UTF-32 codec APIs: @@ -514,9 +515,9 @@ .. cfunction:: PyObject* PyUnicode_AsUTF32String(PyObject *unicode) - Return a Python string using the UTF-32 encoding in native byte order. The - string always starts with a BOM mark. Error handling is "strict". Return - *NULL* if an exception was raised by the codec. + Return a Python byte string using the UTF-32 encoding in native byte + order. The string always starts with a BOM mark. Error handling is "strict". + Return *NULL* if an exception was raised by the codec. These are the UTF-16 codec APIs: @@ -558,7 +559,7 @@ .. cfunction:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder) - Return a Python string object holding the UTF-16 encoded value of the Unicode + Return a Python bytes object holding the UTF-16 encoded value of the Unicode data in *s*. If *byteorder* is not ``0``, output is written according to the following byte order:: @@ -578,9 +579,9 @@ .. cfunction:: PyObject* PyUnicode_AsUTF16String(PyObject *unicode) - Return a Python string using the UTF-16 encoding in native byte order. The - string always starts with a BOM mark. Error handling is "strict". Return - *NULL* if an exception was raised by the codec. + Return a Python byte string using the UTF-16 encoding in native byte + order. The string always starts with a BOM mark. Error handling is "strict". + Return *NULL* if an exception was raised by the codec. These are the "Unicode Escape" codec APIs: @@ -644,15 +645,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and return - a Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and + return a Python bytes object. Return *NULL* if an exception was raised by + the codec. .. cfunction:: PyObject* PyUnicode_AsLatin1String(PyObject *unicode) - Encode a Unicode object using Latin-1 and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using Latin-1 and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All other codes generate errors. @@ -668,15 +670,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and return a - Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and + return a Python bytes object. Return *NULL* if an exception was raised by + the codec. .. cfunction:: PyObject* PyUnicode_AsASCIIString(PyObject *unicode) - Encode a Unicode object using ASCII and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using ASCII and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. These are the mapping codec APIs: @@ -767,15 +770,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return a - Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return + a Python bytes object. Return *NULL* if an exception was raised by the + codec. .. cfunction:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode) - Encode a Unicode object using MBCS and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using MBCS and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. .. % --- Methods & Slots ---------------------------------------------------- From python-checkins at python.org Wed Jan 14 00:14:47 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 14 Jan 2009 00:14:47 +0100 (CET) Subject: [Python-checkins] r68591 - python/branches/py3k Message-ID: <20090113231447.736FE1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 14 00:14:47 2009 New Revision: 68591 Log: Blocked revisions 68589 via svnmerge ........ r68589 | antoine.pitrou | 2009-01-14 00:13:52 +0100 (mer., 14 janv. 2009) | 5 lines 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/py3k/ (props changed) From python-checkins at python.org Wed Jan 14 00:19:08 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Wed, 14 Jan 2009 00:19:08 +0100 (CET) Subject: [Python-checkins] r68592 - in python/trunk: Misc/NEWS PC/_winreg.c Message-ID: <20090113231908.51A221E4002@bag.python.org> Author: amaury.forgeotdarc Date: Wed Jan 14 00:19:08 2009 New Revision: 68592 Log: #4807: Remove a wrong usage of wsprintf in the winreg module ("windows sprintf", different than swprintf) Needed for the windows CE port. Modified: python/trunk/Misc/NEWS python/trunk/PC/_winreg.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 14 00:19:08 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4807: Port the _winreg module to Windows CE. + - 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/trunk/PC/_winreg.c ============================================================================== --- python/trunk/PC/_winreg.c (original) +++ python/trunk/PC/_winreg.c Wed Jan 14 00:19:08 2009 @@ -410,21 +410,17 @@ static int PyHKEY_printFunc(PyObject *ob, FILE *fp, int flags) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "", - ob, pyhkey->hkey); - fputs(resBuf, fp); - return 0; + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + fprintf(fp, "", + ob, pyhkey->hkey); + return 0; } static PyObject * PyHKEY_strFunc(PyObject *ob) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "", pyhkey->hkey); - return PyString_FromString(resBuf); + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + return PyString_FromFormat("", pyhkey->hkey); } static int From python-checkins at python.org Wed Jan 14 00:21:11 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Wed, 14 Jan 2009 00:21:11 +0100 (CET) Subject: [Python-checkins] r68593 - python/branches/py3k Message-ID: <20090113232111.58ABC1E403A@bag.python.org> Author: amaury.forgeotdarc Date: Wed Jan 14 00:21:11 2009 New Revision: 68593 Log: Blocked revisions 68592 via svnmerge ........ r68592 | amaury.forgeotdarc | 2009-01-14 00:19:08 +0100 (mer., 14 janv. 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. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Wed Jan 14 00:25:47 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 14 Jan 2009 00:25:47 +0100 (CET) Subject: [Python-checkins] r68594 - in python/branches/release26-maint: Misc/NEWS Objects/stringlib/transmogrify.h Message-ID: <20090113232547.A6BAA1E4030@bag.python.org> Author: antoine.pitrou Date: Wed Jan 14 00:25:47 2009 New Revision: 68594 Log: Merged revisions 68589 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68589 | antoine.pitrou | 2009-01-14 00:13:52 +0100 (mer., 14 janv. 2009) | 5 lines 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/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/stringlib/transmogrify.h Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed Jan 14 00:25:47 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- 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. + - Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the Modified: python/branches/release26-maint/Objects/stringlib/transmogrify.h ============================================================================== --- python/branches/release26-maint/Objects/stringlib/transmogrify.h (original) +++ python/branches/release26-maint/Objects/stringlib/transmogrify.h Wed Jan 14 00:25:47 2009 @@ -22,76 +22,69 @@ { const char *e, *p; char *q; - Py_ssize_t i, j, old_j; + size_t i, j; PyObject *u; int tabsize = 8; - + if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; - + return NULL; + /* First pass: determine size of output string */ - i = j = old_j = 0; + i = j = 0; e = STRINGLIB_STR(self) + STRINGLIB_LEN(self); for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - j += tabsize - (j % tabsize); - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (old_j > j) { - PyErr_SetString(PyExc_OverflowError, - "result is too long"); - return NULL; - } - old_j = j; + if (tabsize > 0) { + j += tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, + "result is too long"); + return NULL; + } } - } + } else { j++; if (*p == '\n' || *p == '\r') { i += j; - old_j = j = 0; - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (i < 0) { + j = 0; + if (i > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } } } - - if ((i + j) < 0) { - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ + + if ((i + j) > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } - + /* Second pass: create output string and fill it */ u = STRINGLIB_NEW(NULL, i + j); if (!u) return NULL; - + j = 0; q = STRINGLIB_STR(u); - + for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) - *q++ = ' '; - } - } - else { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) + *q++ = ' '; + } + } + else { j++; - *q++ = *p; + *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } - + return u; } From python-checkins at python.org Wed Jan 14 00:32:52 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 14 Jan 2009 00:32:52 +0100 (CET) Subject: [Python-checkins] r68595 - in doctools/trunk: CHANGES LICENSE MANIFEST.in doc/ext/autodoc.rst doc/markup/para.rst sphinx/addnodes.py sphinx/builders/html.py sphinx/config.py sphinx/directives/other.py sphinx/environment.py sphinx/ext/autodoc.py sphinx/ext/intersphinx.py sphinx/pycode/__init__.py sphinx/pycode/pgen2/tokenize.py sphinx/quickstart.py sphinx/static/default.css sphinx/templates/layout.html sphinx/templates/search.html sphinx/util/__init__.py sphinx/util/compat.py sphinx/writers/html.py sphinx/writers/latex.py sphinx/writers/text.py tests/root/markup.txt tests/test_build.py tests/test_quickstart.py Message-ID: <20090113233252.681EE1E4002@bag.python.org> Author: georg.brandl Date: Wed Jan 14 00:32:51 2009 New Revision: 68595 Log: Update to newest trunk. Modified: doctools/trunk/CHANGES doctools/trunk/LICENSE doctools/trunk/MANIFEST.in doctools/trunk/doc/ext/autodoc.rst doctools/trunk/doc/markup/para.rst doctools/trunk/sphinx/addnodes.py doctools/trunk/sphinx/builders/html.py doctools/trunk/sphinx/config.py doctools/trunk/sphinx/directives/other.py doctools/trunk/sphinx/environment.py doctools/trunk/sphinx/ext/autodoc.py doctools/trunk/sphinx/ext/intersphinx.py doctools/trunk/sphinx/pycode/__init__.py doctools/trunk/sphinx/pycode/pgen2/tokenize.py doctools/trunk/sphinx/quickstart.py doctools/trunk/sphinx/static/default.css doctools/trunk/sphinx/templates/layout.html doctools/trunk/sphinx/templates/search.html doctools/trunk/sphinx/util/__init__.py doctools/trunk/sphinx/util/compat.py doctools/trunk/sphinx/writers/html.py doctools/trunk/sphinx/writers/latex.py doctools/trunk/sphinx/writers/text.py doctools/trunk/tests/root/markup.txt doctools/trunk/tests/test_build.py doctools/trunk/tests/test_quickstart.py Modified: doctools/trunk/CHANGES ============================================================================== --- doctools/trunk/CHANGES (original) +++ doctools/trunk/CHANGES Wed Jan 14 00:32:51 2009 @@ -37,6 +37,9 @@ the directive -- this allows you to define your document structure, but place the links yourself. + - #52: There is now a ``hlist`` directive, creating a compact + list by placing distributing items into multiple columns. + - #77: If a description environment with info field list only contains one ``:param:`` entry, no bullet list is generated. @@ -88,6 +91,8 @@ - Source links in HTML are now generated with ``rel="nofollow"``. + - Quickstart can now generate a Windows ``make.bat`` file. + Release 0.5.2 (in development) ============================== Modified: doctools/trunk/LICENSE ============================================================================== --- doctools/trunk/LICENSE (original) +++ doctools/trunk/LICENSE Wed Jan 14 00:32:51 2009 @@ -1,9 +1,9 @@ -Copyright (c) 2007-2009 by the Sphinx team (see AUTHORS file). -All rights reserved. - License for Sphinx ================== +Copyright (c) 2007-2009 by the Sphinx team (see AUTHORS file). +All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -36,6 +36,11 @@ the PSF license agreement for Python: ---------------------------------------------------------------------- +Copyright ? 2001-2008 Python Software Foundation; All Rights Reserved. + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using Python 2.6 software in source or binary form @@ -186,3 +191,29 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ---------------------------------------------------------------------- + +The included JQuery JavaScript library is available under the MIT +license: + +---------------------------------------------------------------------- +Copyright (c) 2008 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +---------------------------------------------------------------------- Modified: doctools/trunk/MANIFEST.in ============================================================================== --- doctools/trunk/MANIFEST.in (original) +++ doctools/trunk/MANIFEST.in Wed Jan 14 00:32:51 2009 @@ -17,6 +17,7 @@ recursive-include sphinx/locale * recursive-include tests * recursive-include utils * +include sphinx/pycode/Grammar.txt recursive-include doc * prune doc/_build Modified: doctools/trunk/doc/ext/autodoc.rst ============================================================================== --- doctools/trunk/doc/ext/autodoc.rst (original) +++ doctools/trunk/doc/ext/autodoc.rst Wed Jan 14 00:32:51 2009 @@ -135,12 +135,30 @@ .. directive:: autofunction + autodata automethod autoattribute These work exactly like :dir:`autoclass` etc., but do not offer the options used for automatic member documentation. + For module data members and class attributes, documentation can either be put + into a special-formatted comment *before* the attribute definition, or in a + docstring *after* the definition. This means that in the following class + definition, both attributes can be autodocumented:: + + class Foo: + """Docstring for class Foo.""" + + #: Doc comment for attribute Foo.bar. + bar = 1 + + baz = 2 + """Docstring for attribute Foo.baz.""" + + .. versionchanged:: 0.6 + :dir:`autodata` and :dir:`autoattribute` can now extract docstrings. + .. note:: If you document decorated functions or methods, keep in mind that autodoc Modified: doctools/trunk/doc/markup/para.rst ============================================================================== --- doctools/trunk/doc/markup/para.rst (original) +++ doctools/trunk/doc/markup/para.rst Wed Jan 14 00:32:51 2009 @@ -100,6 +100,27 @@ .. centered:: LICENSE AGREEMENT +.. directive:: hlist + + This directive must contain a bullet list. It will transform it into a more + compact list by either distributing more than one item horizontally, or + reducing spacing between items, depending on the builder. + + For builders that support the horizontal distribution, there is a ``columns`` + option that specifies the number of columns; it defaults to 2. Example:: + + .. hlist:: + :columns: 3 + + * A list of + * short items + * that should be + * displayed + * horizontally + + .. versionadded:: 0.6 + + Table-of-contents markup ------------------------ Modified: doctools/trunk/sphinx/addnodes.py ============================================================================== --- doctools/trunk/sphinx/addnodes.py (original) +++ doctools/trunk/sphinx/addnodes.py Wed Jan 14 00:32:51 2009 @@ -74,6 +74,10 @@ # for the ACKS list class acks(nodes.Element): pass +# for horizontal lists +class hlist(nodes.Element): pass +class hlistcol(nodes.Element): pass + # sets the highlighting language for literal blocks class highlightlang(nodes.Element): pass @@ -99,7 +103,7 @@ # will choke at some point if these are not added nodes._add_node_class_names("""index desc desc_content desc_signature desc_type desc_returns desc_addname desc_name desc_parameterlist - desc_parameter desc_optional download_reference + desc_parameter desc_optional download_reference hlist hlistcol centered versionmodified seealso productionlist production toctree pending_xref compact_paragraph highlightlang literal_emphasis glossary acks module start_of_file tabular_col_spec meta""".split()) Modified: doctools/trunk/sphinx/builders/html.py ============================================================================== --- doctools/trunk/sphinx/builders/html.py (original) +++ doctools/trunk/sphinx/builders/html.py Wed Jan 14 00:32:51 2009 @@ -22,7 +22,8 @@ from docutils.readers.doctree import Reader as DoctreeReader from sphinx import package_dir, __version__ -from sphinx.util import SEP, os_path, relative_uri, ensuredir, ustrftime +from sphinx.util import SEP, os_path, relative_uri, ensuredir, \ + movefile, ustrftime from sphinx.search import js_index from sphinx.builders import Builder, ENV_PICKLE_FILENAME from sphinx.highlighting import PygmentsBridge @@ -504,7 +505,7 @@ self.indexer.dump(f, self.indexer_format) finally: f.close() - os.rename(searchindexfn + '.tmp', searchindexfn) + movefile(searchindexfn + '.tmp', searchindexfn) self.info('done') self.info(bold('dumping object inventory... '), nonl=True) Modified: doctools/trunk/sphinx/config.py ============================================================================== --- doctools/trunk/sphinx/config.py (original) +++ doctools/trunk/sphinx/config.py Wed Jan 14 00:32:51 2009 @@ -137,7 +137,7 @@ if name not in self.values: raise AttributeError('No such config value: %s' % name) default = self.values[name][0] - if callable(default): + if hasattr(default, '__call__'): return default(self) return default Modified: doctools/trunk/sphinx/directives/other.py ============================================================================== --- doctools/trunk/sphinx/directives/other.py (original) +++ doctools/trunk/sphinx/directives/other.py Wed Jan 14 00:32:51 2009 @@ -383,6 +383,34 @@ directives.register_directive('acks', acks_directive) +def hlist_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + ncolumns = options.get('columns', 2) + node = nodes.paragraph() + state.nested_parse(content, content_offset, node) + if len(node.children) != 1 or not isinstance(node.children[0], nodes.bullet_list): + return [state.document.reporter.warning('.. hlist content is not a list', + line=lineno)] + fulllist = node.children[0] + # create a hlist node where the items are distributed + npercol, nmore = divmod(len(fulllist), ncolumns) + index = 0 + newnode = addnodes.hlist() + for column in range(ncolumns): + endindex = index + (column < nmore and (npercol+1) or npercol) + col = addnodes.hlistcol() + col += nodes.bullet_list() + col[0] += fulllist.children[index:endindex] + index = endindex + newnode += col + return [newnode] + +hlist_directive.content = 1 +hlist_directive.arguments = (0, 0, 0) +hlist_directive.options = {'columns': int} +directives.register_directive('hlist', hlist_directive) + + def tabularcolumns_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): # support giving explicit tabulary column definition to latex Modified: doctools/trunk/sphinx/environment.py ============================================================================== --- doctools/trunk/sphinx/environment.py (original) +++ doctools/trunk/sphinx/environment.py Wed Jan 14 00:32:51 2009 @@ -43,8 +43,8 @@ from docutils.transforms.parts import ContentsFilter from sphinx import addnodes -from sphinx.util import get_matching_docs, SEP, ustrftime, docname_join, \ - FilenameUniqDict +from sphinx.util import movefile, get_matching_docs, SEP, ustrftime, \ + docname_join, FilenameUniqDict from sphinx.directives import additional_xref_types default_settings = { @@ -219,7 +219,7 @@ pickle.dump(self, picklefile, pickle.HIGHEST_PROTOCOL) finally: picklefile.close() - os.rename(filename + '.tmp', filename) + movefile(filename + '.tmp', filename) # reset attributes self.config.values = values self.set_warnfunc(warnfunc) @@ -541,7 +541,7 @@ doctree = pub.document except UnicodeError, err: from sphinx.application import SphinxError - raise SphinxError(err.message) + raise SphinxError(str(err)) self.filter_messages(doctree) self.process_dependencies(docname, doctree) self.process_images(docname, doctree) Modified: doctools/trunk/sphinx/ext/autodoc.py ============================================================================== --- doctools/trunk/sphinx/ext/autodoc.py (original) +++ doctools/trunk/sphinx/ext/autodoc.py Wed Jan 14 00:32:51 2009 @@ -166,7 +166,7 @@ def isdescriptor(x): """Check if the object is some kind of descriptor.""" for item in '__get__', '__set__', '__delete__': - if callable(getattr(x, item, None)): + if hasattr(getattr(x, item, None), '__call__'): return True return False @@ -380,6 +380,8 @@ # try to also get a source code analyzer for attribute docs try: analyzer = ModuleAnalyzer.for_module(mod) + # parse right now, to get PycodeErrors on parsing + analyzer.parse() except PycodeError, err: # no source file -- e.g. for builtin and C modules analyzer = None Modified: doctools/trunk/sphinx/ext/intersphinx.py ============================================================================== --- doctools/trunk/sphinx/ext/intersphinx.py (original) +++ doctools/trunk/sphinx/ext/intersphinx.py Wed Jan 14 00:32:51 2009 @@ -125,7 +125,7 @@ if target not in env.intersphinx_inventory: return None type, proj, version, uri = env.intersphinx_inventory[target] - print "Intersphinx hit:", target, uri + # print "Intersphinx hit:", target, uri newnode = nodes.reference('', '') newnode['refuri'] = uri + '#' + target newnode['reftitle'] = '(in %s v%s)' % (proj, version) Modified: doctools/trunk/sphinx/pycode/__init__.py ============================================================================== --- doctools/trunk/sphinx/pycode/__init__.py (original) +++ doctools/trunk/sphinx/pycode/__init__.py Wed Jan 14 00:32:51 2009 @@ -210,7 +210,10 @@ if self.parsetree is not None: return self.tokenize() - self.parsetree = pydriver.parse_tokens(self.tokens) + try: + self.parsetree = pydriver.parse_tokens(self.tokens) + except parse.ParseError, err: + raise PycodeError('parsing failed', err) # find the source code encoding encoding = sys.getdefaultencoding() comments = self.parsetree.get_prefix() Modified: doctools/trunk/sphinx/pycode/pgen2/tokenize.py ============================================================================== --- doctools/trunk/sphinx/pycode/pgen2/tokenize.py (original) +++ doctools/trunk/sphinx/pycode/pgen2/tokenize.py Wed Jan 14 00:32:51 2009 @@ -274,12 +274,17 @@ line = readline() except StopIteration: line = '' + # if we are not at the end of the file make sure the + # line ends with a newline because the parser depends + # on that. + if line: + line = line.rstrip() + '\n' lnum = lnum + 1 pos, max = 0, len(line) if contstr: # continued string if not line: - raise TokenError, ("EOF in multi-line string", strstart) + raise TokenError("EOF in multi-line string", strstart) endmatch = endprog.match(line) if endmatch: pos = end = endmatch.end(0) @@ -335,7 +340,7 @@ else: # continued statement if not line: - raise TokenError, ("EOF in multi-line statement", (lnum, 0)) + raise TokenError("EOF in multi-line statement", (lnum, 0)) continued = 0 while pos < max: Modified: doctools/trunk/sphinx/quickstart.py ============================================================================== --- doctools/trunk/sphinx/quickstart.py (original) +++ doctools/trunk/sphinx/quickstart.py Wed Jan 14 00:32:51 2009 @@ -16,7 +16,7 @@ from sphinx.util import make_filename from sphinx.util.console import purple, bold, red, turquoise, nocolor, color_terminal -from sphinx.util.texescape import tex_escape_map +from sphinx.util import texescape PROMPT_PREFIX = '> ' @@ -274,42 +274,36 @@ \t-rm -rf %(rbuilddir)s/* html: -\tmkdir -p %(rbuilddir)s/html %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) %(rbuilddir)s/html \t at echo \t at echo "Build finished. The HTML pages are in %(rbuilddir)s/html." pickle: -\tmkdir -p %(rbuilddir)s/pickle %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) %(rbuilddir)s/pickle \t at echo \t at echo "Build finished; now you can process the pickle files." json: -\tmkdir -p %(rbuilddir)s/json %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) %(rbuilddir)s/json \t at echo \t at echo "Build finished; now you can process the JSON files." htmlhelp: -\tmkdir -p %(rbuilddir)s/htmlhelp %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) %(rbuilddir)s/htmlhelp \t at echo \t at echo "Build finished; now you can run HTML Help Workshop with the" \\ \t ".hhp project file in %(rbuilddir)s/htmlhelp." qthelp: -\tmkdir -p %(rbuilddir)s/qthelp %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) %(rbuilddir)s/qthelp \t at echo \t at echo "Build finished; now you can run "qcollectiongenerator" with the" \\ \t ".qhcp project file in %(rbuilddir)s/qthelp, like this:" -\t at echo "# qcollectiongenerator %(rbuilddir)s/qthelp/Sphinx.qhcp" +\t at echo "# qcollectiongenerator %(rbuilddir)s/qthelp/%(project)s.qhcp" \t at echo "To view the help file:" \t at echo "# assistant -collectionFile %(rbuilddir)s/qthelp/%(project)s.qhc" latex: -\tmkdir -p %(rbuilddir)s/latex %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex \t at echo \t at echo "Build finished; the LaTeX files are in %(rbuilddir)s/latex." @@ -317,19 +311,115 @@ \t "run these through (pdf)latex." changes: -\tmkdir -p %(rbuilddir)s/changes %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) %(rbuilddir)s/changes \t at echo \t at echo "The overview file is in %(rbuilddir)s/changes." linkcheck: -\tmkdir -p %(rbuilddir)s/linkcheck %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) %(rbuilddir)s/linkcheck \t at echo \t at echo "Link check complete; look for any errors in the above output " \\ \t "or in %(rbuilddir)s/linkcheck/output.txt." ''' +BATCHFILE = '''\ + at ECHO OFF + +REM Command file for Sphinx documentation + +set SPHINXBUILD=sphinx-build +set ALLSPHINXOPTS=-d %(rbuilddir)s/doctrees %%SPHINXOPTS%% %(rsrcdir)s +if NOT "%%PAPER%%" == "" ( +\tset ALLSPHINXOPTS=-D latex_paper_size=%%PAPER%% %%ALLSPHINXOPTS%% +) + +if "%%1" == "" goto help + +if "%%1" == "help" ( +\t:help +\techo.Please use `make ^` where ^ is one of +\techo. html to make standalone HTML files +\techo. pickle to make pickle files +\techo. json to make JSON files +\techo. htmlhelp to make HTML files and a HTML help project +\techo. qthelp to make HTML files and a qthelp project +\techo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter +\techo. changes to make an overview over all changed/added/deprecated items +\techo. linkcheck to check all external links for integrity +\tgoto end +) + +if "%%1" == "clean" ( +\tfor /d %%%%i in (%(rbuilddir)s\*) do rmdir /q /s %%%%i +\tdel /q /s %(rbuilddir)s\* +\tgoto end +) + +if "%%1" == "html" ( +\t%%SPHINXBUILD%% -b html %%ALLSPHINXOPTS%% %(rbuilddir)s/html +\techo. +\techo.Build finished. The HTML pages are in %(rbuilddir)s/html. +\tgoto end +) + +if "%%1" == "pickle" ( +\t%%SPHINXBUILD%% -b pickle %%ALLSPHINXOPTS%% %(rbuilddir)s/pickle +\techo. +\techo.Build finished; now you can process the pickle files. +\tgoto end +) + +if "%%1" == "json" ( +\t%%SPHINXBUILD%% -b json %%ALLSPHINXOPTS%% %(rbuilddir)s/json +\techo. +\techo.Build finished; now you can process the JSON files. +\tgoto end +) + +if "%%1" == "htmlhelp" ( +\t%%SPHINXBUILD%% -b htmlhelp %%ALLSPHINXOPTS%% %(rbuilddir)s/htmlhelp +\techo. +\techo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %(rbuilddir)s/htmlhelp. +\tgoto end +) + +if "%%1" == "qthelp" ( +\t%%SPHINXBUILD%% -b qthelp %%ALLSPHINXOPTS%% %(rbuilddir)s/qthelp +\techo. +\techo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %(rbuilddir)s/qthelp, like this: +\techo.^> qcollectiongenerator %(rbuilddir)s\\qthelp\\%(project)s.qhcp +\techo.To view the help file: +\techo.^> assistant -collectionFile %(rbuilddir)s\\qthelp\\%(project)s.ghc +\tgoto end +) + +if "%%1" == "latex" ( +\t%%SPHINXBUILD%% -b latex %%ALLSPHINXOPTS%% %(rbuilddir)s/latex +\techo. +\techo.Build finished; the LaTeX files are in %(rbuilddir)s/latex. +\tgoto end +) + +if "%%1" == "changes" ( +\t%%SPHINXBUILD%% -b changes %%ALLSPHINXOPTS%% %(rbuilddir)s/changes +\techo. +\techo.The overview file is in %(rbuilddir)s/changes. +\tgoto end +) + +if "%%1" == "linkcheck" ( +\t%%SPHINXBUILD%% -b linkcheck %%ALLSPHINXOPTS%% %(rbuilddir)s/linkcheck +\techo. +\techo.Link check complete; look for any errors in the above output ^ +or in %(rbuilddir)s/linkcheck/output.txt. +\tgoto end +) + +:end +''' + def mkdir_p(dir): if path.isdir(dir): @@ -391,6 +481,7 @@ def inner_main(args): d = {} + texescape.init() if not sys.stdout.isatty() or not color_terminal(): nocolor() @@ -418,16 +509,16 @@ print ''' You have two options for placing the build directory for Sphinx output. -Either, you use a directory ".build" within the root path, or you separate +Either, you use a directory "_build" within the root path, or you separate "source" and "build" directories within the root path.''' do_prompt(d, 'sep', 'Separate source and build directories (y/N)', 'n', boolean) + print ''' -Inside the root directory, two more directories will be created; ".templates" -for custom HTML templates and ".static" for custom stylesheets and other -static files. Since the leading dot may be inconvenient for Windows users, -you can enter another prefix (such as "_") to replace the dot.''' - do_prompt(d, 'dot', 'Name prefix for templates and static dir', '.', ok) +Inside the root directory, two more directories will be created; "_templates" +for custom HTML templates and "_static" for custom stylesheets and other +static files. You can enter another prefix (such as ".") to replace the underscore.''' + do_prompt(d, 'dot', 'Name prefix for templates and static dir', '_', ok) print ''' The project name will occur in several places in the built documentation.''' @@ -461,11 +552,11 @@ do_prompt(d, 'ext_intersphinx', 'intersphinx: link between Sphinx documentation ' 'of different projects (y/N)', 'n', boolean) print ''' -If you are under Unix, a Makefile can be generated for you so that you +A Makefile and a Windows command file can be generated for you so that you only have to run e.g. `make html' instead of invoking sphinx-build directly.''' - do_prompt(d, 'makefile', 'Create Makefile? (Y/n)', - os.name == 'posix' and 'y' or 'n', boolean) + do_prompt(d, 'makefile', 'Create Makefile? (Y/n)', 'y', boolean) + do_prompt(d, 'batchfile', 'Create Windows command file? (Y/n)', 'y', boolean) d['project_fn'] = make_filename(d['project']) d['now'] = time.asctime() @@ -474,10 +565,10 @@ repr('sphinx.ext.' + name) for name in ('autodoc', 'doctest', 'intersphinx') if d['ext_' + name].upper() in ('Y', 'YES')) d['copyright'] = time.strftime('%Y') + ', ' + d['author'] - d['author_texescaped'] = unicode(d['author']).translate(tex_escape_map) + d['author_texescaped'] = unicode(d['author']).translate(texescape.tex_escape_map) d['project_doc'] = d['project'] + ' Documentation' d['project_doc_texescaped'] = \ - unicode(d['project'] + ' Documentation').translate(tex_escape_map) + unicode(d['project'] + ' Documentation').translate(texescape.tex_escape_map) if not path.isdir(d['path']): mkdir_p(d['path']) @@ -517,11 +608,19 @@ f.write((MAKEFILE % d).encode('utf-8')) f.close() + create_batch = d['batchfile'].upper() in ('Y', 'YES') + if create_batch: + d['rsrcdir'] = separate and 'source' or '.' + d['rbuilddir'] = separate and 'build' or d['dot'] + 'build' + f = open(path.join(d['path'], 'make.bat'), 'w') + f.write((BATCHFILE % d).encode('utf-8')) + f.close() + print print bold('Finished: An initial directory structure has been created.') print ''' You should now populate your master file %s and create other documentation -source files. ''' % masterfile + (create_makefile and '''\ +source files. ''' % masterfile + ((create_makefile or create_batch) and '''\ Use the Makefile to build the docs, like so: make builder ''' or '''\ Modified: doctools/trunk/sphinx/static/default.css ============================================================================== --- doctools/trunk/sphinx/static/default.css (original) +++ doctools/trunk/sphinx/static/default.css Wed Jan 14 00:32:51 2009 @@ -528,6 +528,7 @@ padding: 5px; background-color: #efc; color: #333; + line-height: 120%; border: 1px solid #ac9; border-left: none; border-right: none; Modified: doctools/trunk/sphinx/templates/layout.html ============================================================================== --- doctools/trunk/sphinx/templates/layout.html (original) +++ doctools/trunk/sphinx/templates/layout.html Wed Jan 14 00:32:51 2009 @@ -44,18 +44,21 @@ {%- block sidebarrel %} {%- if prev %}

    {{ _('Previous topic') }}

    -

    {{ prev.title }}

    +

    {{ prev.title }}

    {%- endif %} {%- if next %}

    {{ _('Next topic') }}

    -

    {{ next.title }}

    +

    {{ next.title }}

    {%- endif %} {%- endblock %} {%- block sidebarsourcelink %} {%- if show_source and has_source and sourcename %}

    {{ _('This Page') }}

    {%- endif %} {%- endblock %} @@ -63,14 +66,18 @@ {% include customsidebar %} {%- endif %} {%- block sidebarsearch %} - {%- if pagename != "search" %} -

    {{ _('Quick search') }}

    - -

    {{ _('Enter search terms or a module, class or function name.') }}

    + {%- if pagename != "search" %} + + {%- endif %} {%- endblock %}
    Modified: doctools/trunk/sphinx/templates/search.html ============================================================================== --- doctools/trunk/sphinx/templates/search.html (original) +++ doctools/trunk/sphinx/templates/search.html Wed Jan 14 00:32:51 2009 @@ -3,6 +3,13 @@ {% set script_files = script_files + ['_static/searchtools.js'] %} {% block body %}

    {{ _('Search') }}

    +
    + +

    + {% trans %}Please activate JavaScript to enable the search + functionality.{% endtrans %} +

    +

    {% trans %}From here you can search these documents. Enter your search words into the box below and click "search". Note that the search Modified: doctools/trunk/sphinx/util/__init__.py ============================================================================== --- doctools/trunk/sphinx/util/__init__.py (original) +++ doctools/trunk/sphinx/util/__init__.py Wed Jan 14 00:32:51 2009 @@ -361,3 +361,13 @@ # last resort -- can't fail string = string.decode('latin1') return string + + +def movefile(source, dest): + # move a file, removing the destination if it exists + if os.path.exists(dest): + try: + os.unlink(dest) + except OSError: + pass + os.rename(source, dest) Modified: doctools/trunk/sphinx/util/compat.py ============================================================================== --- doctools/trunk/sphinx/util/compat.py (original) +++ doctools/trunk/sphinx/util/compat.py Wed Jan 14 00:32:51 2009 @@ -27,7 +27,7 @@ textnodes, messages = state.inline_text(title_text, lineno) admonition_node += nodes.title(title_text, '', *textnodes) admonition_node += messages - if options.has_key('class'): + if 'class' in options: classes = options['class'] else: classes = ['admonition-' + nodes.make_id(title_text)] Modified: doctools/trunk/sphinx/writers/html.py ============================================================================== --- doctools/trunk/sphinx/writers/html.py (original) +++ doctools/trunk/sphinx/writers/html.py Wed Jan 14 00:32:51 2009 @@ -321,6 +321,16 @@ def depart_module(self, node): pass + def visit_hlist(self, node): + self.body.append('') + def depart_hlist(self, node): + self.body.append('
    \n') + + def visit_hlistcol(self, node): + self.body.append('') + def depart_hlistcol(self, node): + self.body.append('') + def bulk_text_processor(self, text): return text Modified: doctools/trunk/sphinx/writers/latex.py ============================================================================== --- doctools/trunk/sphinx/writers/latex.py (original) +++ doctools/trunk/sphinx/writers/latex.py Wed Jan 14 00:32:51 2009 @@ -223,6 +223,7 @@ self.this_is_the_title = 1 self.literal_whitespace = 0 self.no_contractions = 0 + self.compact_list = 0 def astext(self): return (HEADER % self.elements + self.highlighter.get_stylesheet() + @@ -652,9 +653,11 @@ raise nodes.SkipNode def visit_bullet_list(self, node): - self.body.append('\\begin{itemize}\n' ) + if not self.compact_list: + self.body.append('\\begin{itemize}\n' ) def depart_bullet_list(self, node): - self.body.append('\\end{itemize}\n' ) + if not self.compact_list: + self.body.append('\\end{itemize}\n' ) def visit_enumerated_list(self, node): self.body.append('\\begin{enumerate}\n' ) @@ -723,6 +726,21 @@ def depart_centered(self, node): self.body.append('\n\\end{centering}') + def visit_hlist(self, node): + # for now, we don't support a more compact list format + # don't add individual itemize environments, but one for all columns + self.compact_list += 1 + self.body.append('\\begin{itemize}\\setlength{\\itemsep}{0pt}' + '\\setlength{\\parskip}{0pt}\n') + def depart_hlist(self, node): + self.compact_list -= 1 + self.body.append('\\end{itemize}\n') + + def visit_hlistcol(self, node): + pass + def depart_hlistcol(self, node): + pass + def visit_module(self, node): modname = node['modname'] self.body.append('\n\\declaremodule[%s]{}{%s}' % (modname.replace('_', ''), Modified: doctools/trunk/sphinx/writers/text.py ============================================================================== --- doctools/trunk/sphinx/writers/text.py (original) +++ doctools/trunk/sphinx/writers/text.py Wed Jan 14 00:32:51 2009 @@ -516,6 +516,16 @@ def depart_centered(self, node): pass + def visit_hlist(self, node): + pass + def depart_hlist(self, node): + pass + + def visit_hlistcol(self, node): + pass + def depart_hlistcol(self, node): + pass + def visit_admonition(self, node): self.new_state(0) def depart_admonition(self, node): Modified: doctools/trunk/tests/root/markup.txt ============================================================================== --- doctools/trunk/tests/root/markup.txt (original) +++ doctools/trunk/tests/root/markup.txt Wed Jan 14 00:32:51 2009 @@ -104,6 +104,16 @@ `Google `_ For everything. +.. hlist:: + :columns: 4 + + * This + * is + * a horizontal + * list + * with several + * items + .. rubric:: Side note This is a side note. Modified: doctools/trunk/tests/test_build.py ============================================================================== --- doctools/trunk/tests/test_build.py (original) +++ doctools/trunk/tests/test_build.py Wed Jan 14 00:32:51 2009 @@ -129,7 +129,7 @@ for path, check in paths.iteritems(): nodes = list(etree.findall(path)) assert nodes != [] - if callable(check): + if hasattr(check, '__call__'): check(nodes) elif not check: # only check for node presence Modified: doctools/trunk/tests/test_quickstart.py ============================================================================== --- doctools/trunk/tests/test_quickstart.py (original) +++ doctools/trunk/tests/test_quickstart.py Wed Jan 14 00:32:51 2009 @@ -70,6 +70,7 @@ assert d['k5'] == 'no' raises(AssertionError, qs.do_prompt, d, 'k6', 'Q6', validator=qs.boolean) + @with_tempdir def test_quickstart_defaults(tempdir): answers = { @@ -86,29 +87,31 @@ ns = {} execfile(conffile, ns) assert ns['extensions'] == [] - assert ns['templates_path'] == ['.templates'] + assert ns['templates_path'] == ['_templates'] assert ns['source_suffix'] == '.rst' assert ns['master_doc'] == 'index' assert ns['project'] == 'Sphinx Test' assert ns['copyright'] == '%s, Georg Brandl' % time.strftime('%Y') assert ns['version'] == '0.1' assert ns['release'] == '0.1' - assert ns['html_static_path'] == ['.static'] + assert ns['html_static_path'] == ['_static'] assert ns['latex_documents'] == [ ('index', 'SphinxTest.tex', 'Sphinx Test Documentation', 'Georg Brandl', 'manual')] - assert (tempdir / '.static').isdir() - assert (tempdir / '.templates').isdir() + assert (tempdir / '_static').isdir() + assert (tempdir / '_templates').isdir() assert (tempdir / 'index.rst').isfile() assert (tempdir / 'Makefile').isfile() + assert (tempdir / 'make.bat').isfile() + @with_tempdir def test_quickstart_all_answers(tempdir): answers = { 'Root path': tempdir, 'Separate source and build': 'y', - 'Name prefix for templates': '_', + 'Name prefix for templates': '.', 'Project name': 'STASI\xe2\x84\xa2', 'Author name': 'Wolfgang Sch\xc3\xa4uble & G. Beckstein', 'Project version': '2.0', @@ -119,6 +122,7 @@ 'doctest': 'yes', 'intersphinx': 'no', 'Create Makefile': 'no', + 'Create Windows command file': 'no', } qs.raw_input = mock_raw_input(answers, needanswer=True) qs.TERM_ENCODING = 'utf-8' @@ -129,7 +133,7 @@ ns = {} execfile(conffile, ns) assert ns['extensions'] == ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] - assert ns['templates_path'] == ['_templates'] + assert ns['templates_path'] == ['.templates'] assert ns['source_suffix'] == '.txt' assert ns['master_doc'] == 'contents' assert ns['project'] == u'STASI?' @@ -137,12 +141,12 @@ time.strftime('%Y') assert ns['version'] == '2.0' assert ns['release'] == '2.0.1' - assert ns['html_static_path'] == ['_static'] + assert ns['html_static_path'] == ['.static'] assert ns['latex_documents'] == [ ('contents', 'STASI.tex', u'STASI? Documentation', ur'Wolfgang Sch?uble \& G. Beckstein', 'manual')] assert (tempdir / 'build').isdir() - assert (tempdir / 'source' / '_static').isdir() - assert (tempdir / 'source' / '_templates').isdir() + assert (tempdir / 'source' / '.static').isdir() + assert (tempdir / 'source' / '.templates').isdir() assert (tempdir / 'source' / 'contents.txt').isfile() From python-checkins at python.org Wed Jan 14 00:39:22 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Wed, 14 Jan 2009 00:39:22 +0100 (CET) Subject: [Python-checkins] r68596 - in python/trunk: Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS Message-ID: <20090113233922.D6A911E4002@bag.python.org> Author: amaury.forgeotdarc Date: Wed Jan 14 00:39:22 2009 New Revision: 68596 Log: #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. Modified: python/trunk/Lib/inspect.py python/trunk/Lib/test/test_inspect.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/inspect.py ============================================================================== --- python/trunk/Lib/inspect.py (original) +++ python/trunk/Lib/inspect.py Wed Jan 14 00:39:22 2009 @@ -253,7 +253,10 @@ Optionally, only return members that satisfy a given predicate.""" results = [] for key in dir(object): - value = getattr(object, key) + try: + value = getattr(object, key) + except AttributeError: + continue if not predicate or predicate(value): results.append((key, value)) results.sort() Modified: python/trunk/Lib/test/test_inspect.py ============================================================================== --- python/trunk/Lib/test/test_inspect.py (original) +++ python/trunk/Lib/test/test_inspect.py Wed Jan 14 00:39:22 2009 @@ -91,6 +91,17 @@ self.assert_(inspect.isroutine(mod.spam)) self.assert_(inspect.isroutine([].count)) + def test_get_slot_members(self): + class C(object): + __slots__ = ("a", "b") + + x = C() + x.a = 42 + members = dict(inspect.getmembers(x)) + self.assert_('a' in members) + self.assert_('b' not in members) + + class TestInterpreterStack(IsTestBase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 14 00:39:22 2009 @@ -137,7 +137,10 @@ Library ------- -- Issue #1696199: Add collections.Counter() for rapid and convenient +- Issue #1162154: inspect.getmembers() now skips attributes that raise + AttributeError, e.g. a __slots__ attribute which has not been set. + +- Issue #1696199: Add collections.Counter() for rapid and convenient counting. - Issue #3860: GzipFile and BZ2File now support the context manager protocol. From python-checkins at python.org Wed Jan 14 00:43:51 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 14 Jan 2009 00:43:51 +0100 (CET) Subject: [Python-checkins] r68597 - python/trunk/Lib/xmlrpclib.py Message-ID: <20090113234351.1B8E21E4002@bag.python.org> Author: benjamin.peterson Date: Wed Jan 14 00:43:50 2009 New Revision: 68597 Log: fix test_xmlrpc failures #4939 Modified: python/trunk/Lib/xmlrpclib.py Modified: python/trunk/Lib/xmlrpclib.py ============================================================================== --- python/trunk/Lib/xmlrpclib.py (original) +++ python/trunk/Lib/xmlrpclib.py Wed Jan 14 00:43:50 2009 @@ -1245,7 +1245,7 @@ self.verbose = verbose - return self._parse_response(h.getfile()) + return self.parse_response(h.getfile()) ## # Create parser. From python-checkins at python.org Wed Jan 14 00:44:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 14 Jan 2009 00:44:25 +0100 (CET) Subject: [Python-checkins] r68598 - doctools/trunk/sphinx/_jinja.py Message-ID: <20090113234425.B40F41E4002@bag.python.org> Author: benjamin.peterson Date: Wed Jan 14 00:44:25 2009 New Revision: 68598 Log: remove old jinja interface Removed: doctools/trunk/sphinx/_jinja.py Deleted: doctools/trunk/sphinx/_jinja.py ============================================================================== --- doctools/trunk/sphinx/_jinja.py Wed Jan 14 00:44:25 2009 +++ (empty file) @@ -1,114 +0,0 @@ -# -*- coding: utf-8 -*- -""" - sphinx._jinja - ~~~~~~~~~~~~~ - - Jinja glue. - - :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import codecs -from os import path - -from sphinx import package_dir -from sphinx.util import mtimes_of_files -from sphinx.application import TemplateBridge - -from jinja import Environment -from jinja.loaders import BaseLoader -from jinja.exceptions import TemplateNotFound - - -def babel_extract(fileobj, keywords, comment_tags, options): - """ - Simple extractor to get some basic Babel support. - """ - env = Environment() - for lineno, sg, pl in env.get_translations_for_string(fileobj.read()): - yield lineno, None, (sg, pl), '' - - -class SphinxFileSystemLoader(BaseLoader): - """ - A loader that loads templates either relative to one of a list of given - paths, or from an absolute path. - """ - - def __init__(self, basepath, extpaths): - self.basepath = path.abspath(basepath) - self.extpaths = map(path.abspath, extpaths) - self.searchpaths = self.extpaths + [self.basepath] - - def get_source(self, environment, name, parent): - name = name.replace('/', path.sep) - if name.startswith('!'): - name = name[1:] - if not path.exists(path.join(self.basepath, name)): - raise TemplateNotFound(name) - filename = path.join(self.basepath, name) - elif path.isabs(name): - if not path.exists(name): - raise TemplateNotFound(name) - filename = name - else: - for searchpath in self.searchpaths: - if path.exists(path.join(searchpath, name)): - filename = path.join(searchpath, name) - break - else: - raise TemplateNotFound(name) - f = codecs.open(filename, 'r', environment.template_charset) - try: - return f.read() - finally: - f.close() - - -class TranslatorEnvironment(Environment): - class _Translator(object): - def __init__(self, translator): - self.trans = translator - - def gettext(self, string): - return self.trans.ugettext(string) - - def ngettext(self, singular, plural, n): - return self.trans.ungettext(singular, plural, n) - - def __init__(self, *args, **kwargs): - self.translator = kwargs['translator'] - del kwargs['translator'] - super(TranslatorEnvironment, self).__init__(*args, **kwargs) - - def get_translator(self, context): - return TranslatorEnvironment._Translator(self.translator) - - -class BuiltinTemplates(TemplateBridge): - def init(self, builder): - self.templates = {} - base_templates_path = path.join(package_dir, 'templates') - ext_templates_path = [path.join(builder.confdir, dir) - for dir in builder.config.templates_path] - self.templates_path = [base_templates_path] + ext_templates_path - loader = SphinxFileSystemLoader(base_templates_path, ext_templates_path) - if builder.translator is not None: - self.jinja_env = TranslatorEnvironment(loader=loader, - friendly_traceback=False, translator=builder.translator) - else: - self.jinja_env = Environment(loader=loader, - # disable traceback, more likely that something - # in the application is broken than in the templates - friendly_traceback=False) - - def newest_template_mtime(self): - return max(mtimes_of_files(self.templates_path, '.html')) - - def render(self, template, context): - if template in self.templates: - return self.templates[template].render(context) - templateobj = self.templates[template] = \ - self.jinja_env.get_template(template) - return templateobj.render(context) From python-checkins at python.org Wed Jan 14 01:00:18 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 14 Jan 2009 01:00:18 +0100 (CET) Subject: [Python-checkins] r68599 - in python/branches/release26-maint: Doc/c-api/typeobj.rst Doc/library/logging.rst Doc/library/random.rst Doc/library/sys.rst Doc/using/cmdline.rst Include/pyport.h Include/unicodeobject.h Lib/ctypes/test/__init__.py Lib/random.py Lib/test/test_decimal.py Lib/test/test_import.py Misc/python.man Modules/main.c Modules/socketmodule.c Python/import.c Tools/scripts/patchcheck.py configure.in Message-ID: <20090114000018.910551E4002@bag.python.org> Author: georg.brandl Date: Wed Jan 14 01:00:17 2009 New Revision: 68599 Log: Merged revisions 68292,68344,68361,68378,68424,68426,68429-68430,68450,68457,68480-68481,68493,68495,68499,68501,68512,68514-68515 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68292 | skip.montanaro | 2009-01-04 11:36:58 +0100 (So, 04 Jan 2009) | 3 lines If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". ........ r68344 | marc-andre.lemburg | 2009-01-05 20:43:35 +0100 (Mo, 05 Jan 2009) | 7 lines Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. ........ r68361 | antoine.pitrou | 2009-01-06 19:34:08 +0100 (Di, 06 Jan 2009) | 3 lines Use shutil.rmtree rather than os.rmdir. ........ r68378 | mark.dickinson | 2009-01-07 18:48:33 +0100 (Mi, 07 Jan 2009) | 2 lines Issue #4869: clarify documentation for random.expovariate. ........ r68424 | benjamin.peterson | 2009-01-09 03:53:35 +0100 (Fr, 09 Jan 2009) | 1 line specify what -3 warnings are about ........ r68426 | benjamin.peterson | 2009-01-09 04:03:05 +0100 (Fr, 09 Jan 2009) | 1 line fix spelling ........ r68429 | benjamin.peterson | 2009-01-09 04:05:14 +0100 (Fr, 09 Jan 2009) | 1 line add -3 to manpage ........ r68430 | benjamin.peterson | 2009-01-09 04:07:27 +0100 (Fr, 09 Jan 2009) | 1 line be more specific in -3 option help ........ r68450 | jeffrey.yasskin | 2009-01-09 17:47:07 +0100 (Fr, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68457 | kristjan.jonsson | 2009-01-09 21:10:59 +0100 (Fr, 09 Jan 2009) | 1 line Issue 3677: Fix import from UNC paths on Windows. ........ r68480 | vinay.sajip | 2009-01-10 14:38:04 +0100 (Sa, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 14:42:04 +0100 (Sa, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 18:18:55 +0100 (Sa, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 18:36:44 +0100 (Sa, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68499 | mark.dickinson | 2009-01-10 20:14:55 +0100 (Sa, 10 Jan 2009) | 2 lines Remove an unnecessary check from test_decimal. ........ r68501 | vinay.sajip | 2009-01-10 20:22:57 +0100 (Sa, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 23:42:10 +0100 (Sa, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-11 00:41:59 +0100 (So, 11 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-11 00:49:08 +0100 (So, 11 Jan 2009) | 1 line macos 9 isn't supported ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/c-api/typeobj.rst python/branches/release26-maint/Doc/library/logging.rst python/branches/release26-maint/Doc/library/random.rst python/branches/release26-maint/Doc/library/sys.rst python/branches/release26-maint/Doc/using/cmdline.rst python/branches/release26-maint/Include/pyport.h python/branches/release26-maint/Include/unicodeobject.h python/branches/release26-maint/Lib/ctypes/test/__init__.py python/branches/release26-maint/Lib/random.py python/branches/release26-maint/Lib/test/test_decimal.py python/branches/release26-maint/Lib/test/test_import.py python/branches/release26-maint/Misc/python.man python/branches/release26-maint/Modules/main.c python/branches/release26-maint/Modules/socketmodule.c python/branches/release26-maint/Python/import.c python/branches/release26-maint/Tools/scripts/patchcheck.py python/branches/release26-maint/configure.in Modified: python/branches/release26-maint/Doc/c-api/typeobj.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/typeobj.rst (original) +++ python/branches/release26-maint/Doc/c-api/typeobj.rst Wed Jan 14 01:00:17 2009 @@ -743,7 +743,7 @@ :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its base type. -The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_CLASS` flag bit is +The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_ITER` flag bit is set. Modified: python/branches/release26-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release26-maint/Doc/library/logging.rst (original) +++ python/branches/release26-maint/Doc/library/logging.rst Wed Jan 14 01:00:17 2009 @@ -121,7 +121,7 @@ messages at different log levels. This allows you to instrument your code with debug messages, for example, but turning the log level down so that those debug messages are not written for your production system. The default levels are -``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``. +``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``. The logger, handler, and log message call each specify a level. The log message is only emitted if the handler and logger are configured to emit messages of @@ -422,6 +422,8 @@ code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties. +.. _library-config: + Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -524,6 +526,8 @@ #. :class:`FileHandler` instances send error messages to disk files. +.. currentmodule:: logging.handlers + #. :class:`BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated directly. Instead, use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. @@ -553,7 +557,12 @@ #. :class:`HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. -The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` +#. :class:`WatchedFileHandler` instances watch the file they are logging to. If +the file changes, it is closed and reopened using the file name. This handler +is only useful on Unix-like systems; Windows does not support the underlying +mechanism used. + +The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the core logging package. The other handlers are defined in a sub- module, :mod:`logging.handlers`. (There is also another sub-module, :mod:`logging.config`, for configuration functionality.) @@ -1601,6 +1610,9 @@ Outputs the record to the file. +See :ref:`library-config` for more information on how to use +:class:`NullHandler`. + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ 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 Wed Jan 14 01:00:17 2009 @@ -210,9 +210,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) Modified: python/branches/release26-maint/Doc/library/sys.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sys.rst (original) +++ python/branches/release26-maint/Doc/library/sys.rst Wed Jan 14 01:00:17 2009 @@ -566,6 +566,10 @@ .. versionchanged:: 2.3 Unicode strings are no longer ignored. + .. seealso:: + Module :mod:`site` This describes how to use .pth files to extend + :data:`sys.path`. + .. data:: platform @@ -583,7 +587,6 @@ Windows ``'win32'`` Windows/Cygwin ``'cygwin'`` Mac OS X ``'darwin'`` - Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` RiscOS ``'riscos'`` @@ -869,10 +872,3 @@ first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python. Availability: Windows. - - -.. seealso:: - - Module :mod:`site` - This describes how to use .pth files to extend ``sys.path``. - Modified: python/branches/release26-maint/Doc/using/cmdline.rst ============================================================================== --- python/branches/release26-maint/Doc/using/cmdline.rst (original) +++ python/branches/release26-maint/Doc/using/cmdline.rst Wed Jan 14 01:00:17 2009 @@ -356,7 +356,8 @@ .. cmdoption:: -3 - Warn about Python 3.x incompatibilities. Among these are: + Warn about Python 3.x incompatibilities which cannot be fixed trivially by + :ref:`2to3 <2to3-reference>`. Among these are: * :meth:`dict.has_key` * :func:`apply` Modified: python/branches/release26-maint/Include/pyport.h ============================================================================== --- python/branches/release26-maint/Include/pyport.h (original) +++ python/branches/release26-maint/Include/pyport.h Wed Jan 14 01:00:17 2009 @@ -709,6 +709,15 @@ #define Py_FORMAT_PARSETUPLE(func,p1,p2) #endif +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ Modified: python/branches/release26-maint/Include/unicodeobject.h ============================================================================== --- python/branches/release26-maint/Include/unicodeobject.h (original) +++ python/branches/release26-maint/Include/unicodeobject.h Wed Jan 14 01:00:17 2009 @@ -130,6 +130,10 @@ typedef unsigned long Py_UCS4; #endif +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + typedef PY_UNICODE_TYPE Py_UNICODE; /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ @@ -350,12 +354,12 @@ #else -/* Since splitting on whitespace is an important use case, and whitespace - in most situations is solely ASCII whitespace, we optimize for the common - case by using a quick look-up table with an inlined check. - */ -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + */ #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) @@ -389,13 +393,14 @@ #define Py_UNICODE_COPY(target, source, length) \ Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) -#define Py_UNICODE_FILL(target, value, length) do\ - {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) -/* check if substring matches at given offset. the offset must be +/* Check if substring matches at given offset. the offset must be valid, and the substring must not be empty */ + #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->str + (offset)) == *((substring)->str)) && \ ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ @@ -405,8 +410,6 @@ extern "C" { #endif -PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); - /* --- Unicode Type ------------------------------------------------------- */ typedef struct { @@ -605,6 +608,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These @@ -1323,6 +1337,10 @@ /* === Characters Type APIs =============================================== */ +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. Modified: python/branches/release26-maint/Lib/ctypes/test/__init__.py ============================================================================== --- python/branches/release26-maint/Lib/ctypes/test/__init__.py (original) +++ python/branches/release26-maint/Lib/ctypes/test/__init__.py Wed Jan 14 01:00:17 2009 @@ -67,9 +67,6 @@ if verbosity > 1: print >> sys.stderr, "Skipped %s: %s" % (modname, detail) continue - except Exception, detail: - print >> sys.stderr, "Warning: could not import %s: %s" % (modname, detail) - continue for name in dir(mod): if name.startswith("_"): continue Modified: python/branches/release26-maint/Lib/random.py ============================================================================== --- python/branches/release26-maint/Lib/random.py (original) +++ python/branches/release26-maint/Lib/random.py Wed Jan 14 01:00:17 2009 @@ -413,9 +413,11 @@ def expovariate(self, 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. + 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. """ # lambd: rate lambd = 1/mean 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 Wed Jan 14 01:00:17 2009 @@ -168,7 +168,6 @@ -context.Emin > DEC_MAX_MATH): return True if not v._is_special and v and ( - len(v._int) > DEC_MAX_MATH or v.adjusted() > DEC_MAX_MATH or v.adjusted() < 1-2*DEC_MAX_MATH): return True Modified: python/branches/release26-maint/Lib/test/test_import.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_import.py (original) +++ python/branches/release26-maint/Lib/test/test_import.py Wed Jan 14 01:00:17 2009 @@ -269,7 +269,7 @@ if os.path.exists(file_name): os.remove(file_name) if os.path.exists(self.dir_name): - os.rmdir(self.dir_name) + shutil.rmtree(self.dir_name) def import_module(self): ns = globals() Modified: python/branches/release26-maint/Misc/python.man ============================================================================== --- python/branches/release26-maint/Misc/python.man (original) +++ python/branches/release26-maint/Misc/python.man Wed Jan 14 01:00:17 2009 @@ -54,6 +54,9 @@ [ .B \-x ] +[ +.B \-3 +] .br [ .B \-c @@ -236,6 +239,9 @@ Skip the first line of the source. This is intended for a DOS specific hack only. Warning: the line numbers in error messages will be off by one! +.TP +.B \-3 +Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix. .SH INTERPRETER INTERFACE The interpreter interface resembles that of the UNIX shell: when called with standard input connected to a tty device, it prompts for Modified: python/branches/release26-maint/Modules/main.c ============================================================================== --- python/branches/release26-maint/Modules/main.c (original) +++ python/branches/release26-maint/Modules/main.c Wed Jan 14 01:00:17 2009 @@ -86,7 +86,7 @@ -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ "; static char *usage_4 = "\ --3 : warn about Python 3.x incompatibilities\n\ +-3 : warn about Python 3.x incompatibilities that 2to3 cannot trivially fix\n\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ arg ...: arguments passed to program in sys.argv[1:]\n\n\ Modified: python/branches/release26-maint/Modules/socketmodule.c ============================================================================== --- python/branches/release26-maint/Modules/socketmodule.c (original) +++ python/branches/release26-maint/Modules/socketmodule.c Wed Jan 14 01:00:17 2009 @@ -3334,7 +3334,11 @@ #ifdef HAVE_GETHOSTBYNAME_R_3_ARG struct hostent_data data; #else - char buf[16384]; + /* glibcs up to 2.10 assume that the buf argument to + gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc + does not ensure. The attribute below instructs the compiler + to maintain this alignment. */ + char buf[16384] Py_ALIGNED(8); int buf_len = (sizeof buf) - 1; int errnop; #endif Modified: python/branches/release26-maint/Python/import.c ============================================================================== --- python/branches/release26-maint/Python/import.c (original) +++ python/branches/release26-maint/Python/import.c Wed Jan 14 01:00:17 2009 @@ -3199,24 +3199,11 @@ return -1; } else { #ifndef RISCOS +#ifndef MS_WINDOWS struct stat statbuf; int rv; rv = stat(path, &statbuf); -#ifdef MS_WINDOWS - /* MS Windows stat() chokes on paths like C:\path\. Try to - * recover *one* time by stripping off a trailing slash or - * backslash. http://bugs.python.org/issue1293 - */ - if (rv != 0 && pathlen <= MAXPATHLEN && - (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { - char mangled[MAXPATHLEN+1]; - - strcpy(mangled, path); - mangled[pathlen-1] = '\0'; - rv = stat(mangled, &statbuf); - } -#endif if (rv == 0) { /* it exists */ if (S_ISDIR(statbuf.st_mode)) { @@ -3226,7 +3213,24 @@ return -1; } } -#else +#else /* MS_WINDOWS */ + DWORD rv; + /* see issue1293 and issue3677: + * stat() on Windows doesn't recognise paths like + * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. + */ + rv = GetFileAttributesA(path); + if (rv != INVALID_FILE_ATTRIBUTES) { + /* it exists */ + if (rv & FILE_ATTRIBUTE_DIRECTORY) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif +#else /* RISCOS */ if (object_exists(path)) { /* it exists */ if (isdir(path)) { Modified: python/branches/release26-maint/Tools/scripts/patchcheck.py ============================================================================== --- python/branches/release26-maint/Tools/scripts/patchcheck.py (original) +++ python/branches/release26-maint/Tools/scripts/patchcheck.py Wed Jan 14 01:00:17 2009 @@ -62,12 +62,12 @@ @status("Misc/ACKS updated", modal=True) def credit_given(file_paths): """Check if Misc/ACKS has been changed.""" - return True if 'Misc/ACKS' in file_paths else False + return 'Misc/ACKS' in file_paths @status("Misc/NEWS updated", modal=True) def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" - return True if 'Misc/NEWS' in file_paths else False + return 'Misc/NEWS' in file_paths def main(): Modified: python/branches/release26-maint/configure.in ============================================================================== --- python/branches/release26-maint/configure.in (original) +++ python/branches/release26-maint/configure.in Wed Jan 14 01:00:17 2009 @@ -407,7 +407,7 @@ AC_HELP_STRING(--without-gcc,never use gcc), [ case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; From python-checkins at python.org Wed Jan 14 01:01:13 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 14 Jan 2009 01:01:13 +0100 (CET) Subject: [Python-checkins] r68600 - python/branches/release26-maint Message-ID: <20090114000113.51B3E1E4002@bag.python.org> Author: georg.brandl Date: Wed Jan 14 01:01:13 2009 New Revision: 68600 Log: Blocked revisions 68238,68240,68243,68319,68381,68425,68432,68455,68458-68461,68484-68485,68496,68498 via svnmerge ........ r68238 | georg.brandl | 2009-01-03 23:03:11 +0100 (Sa, 03 Jan 2009) | 2 lines Manually merge r68095,68186,68187,68188,68190 from 2.6 branch. ........ r68240 | georg.brandl | 2009-01-03 23:05:22 +0100 (Sa, 03 Jan 2009) | 2 lines Manually merge r67868 from 2.6 branch. ........ r68243 | georg.brandl | 2009-01-03 23:15:42 +0100 (Sa, 03 Jan 2009) | 2 lines Add temporary code to fix the automatic doc build failure. ........ r68319 | antoine.pitrou | 2009-01-04 22:29:23 +0100 (So, 04 Jan 2009) | 3 lines Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. ........ r68381 | martin.v.loewis | 2009-01-07 19:40:40 +0100 (Mi, 07 Jan 2009) | 2 lines Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. ........ r68425 | benjamin.peterson | 2009-01-09 03:56:32 +0100 (Fr, 09 Jan 2009) | 1 line fix markup ........ r68432 | benjamin.peterson | 2009-01-09 04:15:00 +0100 (Fr, 09 Jan 2009) | 1 line remove temporary code now ........ r68455 | kristjan.jonsson | 2009-01-09 21:03:27 +0100 (Fr, 09 Jan 2009) | 1 line Issue 3582. Improved thread support and TLS for Windows ........ r68458 | kristjan.jonsson | 2009-01-09 21:23:16 +0100 (Fr, 09 Jan 2009) | 1 line Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. ........ r68459 | kristjan.jonsson | 2009-01-09 21:27:16 +0100 (Fr, 09 Jan 2009) | 1 line Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. ........ r68460 | kristjan.jonsson | 2009-01-09 21:31:26 +0100 (Fr, 09 Jan 2009) | 1 line Issue 4293: Make Py_AddPendingCall() thread safe ........ r68461 | kristjan.jonsson | 2009-01-09 22:35:16 +0100 (Fr, 09 Jan 2009) | 2 lines Issue 4293: Make Py_AddPendingCall() thread safe Add test cases and documentation ........ r68484 | antoine.pitrou | 2009-01-10 17:13:45 +0100 (Sa, 10 Jan 2009) | 3 lines Issue #3860: GzipFile and BZ2File now support the context manager protocol. ........ r68485 | antoine.pitrou | 2009-01-10 17:15:24 +0100 (Sa, 10 Jan 2009) | 1 line Add NEWS entry for r68484. ........ r68496 | antoine.pitrou | 2009-01-10 19:33:21 +0100 (Sa, 10 Jan 2009) | 3 lines Add ACKS entries for some of the patches I've been committing. ........ r68498 | benjamin.peterson | 2009-01-10 20:08:49 +0100 (Sa, 10 Jan 2009) | 1 line fix encoding ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed Jan 14 01:08:09 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 14 Jan 2009 01:08:09 +0100 (CET) Subject: [Python-checkins] r68601 - in python/branches/release26-maint: Doc/library/2to3.rst Doc/library/binascii.rst Doc/library/hashlib.rst Doc/library/io.rst Doc/library/logging.rst Doc/library/turtle.rst Doc/library/zlib.rst Lib/_abcoll.py Lib/test/test_datetime.py Lib/test/test_os.py Makefile.pre.in Misc/NEWS Modules/_ctypes/cfield.c PC/pyconfig.h Python/sysmodule.c Message-ID: <20090114000809.D8CA31E4010@bag.python.org> Author: georg.brandl Date: Wed Jan 14 01:08:09 2009 New Revision: 68601 Log: Merged revisions 68521,68527,68534-68536,68540,68547,68552,68563,68570,68572,68575,68579-68580,68584 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68521 | hirokazu.yamamoto | 2009-01-11 04:28:13 +0100 (So, 11 Jan 2009) | 1 line Fixed version number in build_ssl.bat. ........ r68527 | martin.v.loewis | 2009-01-11 10:43:55 +0100 (So, 11 Jan 2009) | 2 lines Issue #4895: Use _strdup on Windows CE. ........ r68534 | gregory.p.smith | 2009-01-11 18:53:33 +0100 (So, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 18:57:54 +0100 (So, 11 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ........ r68536 | benjamin.peterson | 2009-01-11 20:48:15 +0100 (So, 11 Jan 2009) | 1 line add email addresses ........ r68540 | martin.v.loewis | 2009-01-12 08:57:11 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4915: Port sysmodule to Windows CE. ........ r68547 | kristjan.jonsson | 2009-01-12 19:09:27 +0100 (Mo, 12 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ........ r68552 | vinay.sajip | 2009-01-12 21:36:18 +0100 (Mo, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-13 02:49:10 +0100 (Di, 13 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 10:08:32 +0100 (Di, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ........ r68572 | andrew.kuchling | 2009-01-13 14:40:54 +0100 (Di, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 18:32:28 +0100 (Di, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68579 | benjamin.peterson | 2009-01-13 22:42:23 +0100 (Di, 13 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib #4936 ........ r68580 | benjamin.peterson | 2009-01-13 22:43:11 +0100 (Di, 13 Jan 2009) | 1 line add bytearrayobject.h to PYTHON_HEADERS ........ r68584 | benjamin.peterson | 2009-01-13 23:22:41 +0100 (Di, 13 Jan 2009) | 1 line de-spacify ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/2to3.rst python/branches/release26-maint/Doc/library/binascii.rst python/branches/release26-maint/Doc/library/hashlib.rst python/branches/release26-maint/Doc/library/io.rst python/branches/release26-maint/Doc/library/logging.rst python/branches/release26-maint/Doc/library/turtle.rst python/branches/release26-maint/Doc/library/zlib.rst python/branches/release26-maint/Lib/_abcoll.py python/branches/release26-maint/Lib/test/test_datetime.py python/branches/release26-maint/Lib/test/test_os.py python/branches/release26-maint/Makefile.pre.in python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_ctypes/cfield.c python/branches/release26-maint/PC/pyconfig.h python/branches/release26-maint/Python/sysmodule.c Modified: python/branches/release26-maint/Doc/library/2to3.rst ============================================================================== --- python/branches/release26-maint/Doc/library/2to3.rst (original) +++ python/branches/release26-maint/Doc/library/2to3.rst Wed Jan 14 01:08:09 2009 @@ -3,7 +3,7 @@ 2to3 - Automated Python 2 to 3 code translation =============================================== -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson 2to3 is a Python program that reads Python 2.x source code and applies a series of *fixers* to transform it into valid Python 3.x code. The standard library 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 Wed Jan 14 01:08:09 2009 @@ -113,8 +113,25 @@ print binascii.crc32("hello world") # Or, in two pieces: crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) - print crc + crc = binascii.crc32(" world", crc) & 0xffffffff + print 'crc32 = 0x%08x' % crc + +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 2.6 + The return value will always be 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] + regardless of platform. .. function:: b2a_hex(data) Modified: python/branches/release26-maint/Doc/library/hashlib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/hashlib.rst (original) +++ python/branches/release26-maint/Doc/library/hashlib.rst Wed Jan 14 01:08:09 2009 @@ -4,8 +4,8 @@ .. module:: hashlib :synopsis: Secure hash and message digest algorithms. -.. moduleauthor:: Gregory P. Smith -.. sectionauthor:: Gregory P. Smith +.. moduleauthor:: Gregory P. Smith +.. sectionauthor:: Gregory P. Smith .. versionadded:: 2.5 Modified: python/branches/release26-maint/Doc/library/io.rst ============================================================================== --- python/branches/release26-maint/Doc/library/io.rst (original) +++ python/branches/release26-maint/Doc/library/io.rst Wed Jan 14 01:08:09 2009 @@ -6,7 +6,7 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson .. versionadded:: 2.6 The :mod:`io` module provides the Python interfaces to stream handling. The Modified: python/branches/release26-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release26-maint/Doc/library/logging.rst (original) +++ python/branches/release26-maint/Doc/library/logging.rst Wed Jan 14 01:08:09 2009 @@ -526,38 +526,37 @@ #. :class:`FileHandler` instances send error messages to disk files. -.. currentmodule:: logging.handlers +#. :class:`handlers.BaseRotatingHandler` is the base class for handlers that + rotate log files at a certain point. It is not meant to be instantiated + directly. Instead, use :class:`RotatingFileHandler` or + :class:`TimedRotatingFileHandler`. -#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log - files at a certain point. It is not meant to be instantiated directly. Instead, - use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. - -#. :class:`RotatingFileHandler` instances send error messages to disk files, +#. :class:`handlers.RotatingFileHandler` instances send error messages to disk files, with support for maximum log file sizes and log file rotation. -#. :class:`TimedRotatingFileHandler` instances send error messages to disk files +#. :class:`handlers.TimedRotatingFileHandler` instances send error messages to disk files rotating the log file at certain timed intervals. -#. :class:`SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`handlers.SocketHandler` instances send error messages to TCP/IP sockets. -#. :class:`DatagramHandler` instances send error messages to UDP sockets. +#. :class:`handlers.DatagramHandler` instances send error messages to UDP sockets. -#. :class:`SMTPHandler` instances send error messages to a designated email +#. :class:`handlers.SMTPHandler` instances send error messages to a designated email address. -#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon, +#. :class:`handlers.SysLogHandler` instances send error messages to a Unix syslog daemon, possibly on a remote machine. -#. :class:`NTEventLogHandler` instances send error messages to a Windows +#. :class:`handlers.NTEventLogHandler` instances send error messages to a Windows NT/2000/XP event log. -#. :class:`MemoryHandler` instances send error messages to a buffer in memory, +#. :class:`handlers.MemoryHandler` instances send error messages to a buffer in memory, which is flushed whenever specific criteria are met. -#. :class:`HTTPHandler` instances send error messages to an HTTP server using +#. :class:`handlers.HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. -#. :class:`WatchedFileHandler` instances watch the file they are logging to. If +#. :class:`handlers.WatchedFileHandler` instances watch the file they are logging to. If the file changes, it is closed and reopened using the file name. This handler is only useful on Unix-like systems; Windows does not support the underlying mechanism used. Modified: python/branches/release26-maint/Doc/library/turtle.rst ============================================================================== --- python/branches/release26-maint/Doc/library/turtle.rst (original) +++ python/branches/release26-maint/Doc/library/turtle.rst Wed Jan 14 01:08:09 2009 @@ -325,8 +325,7 @@ :param y: a number (integer or float) - Set the turtle's first coordinate to *y*, leave second coordinate - unchanged. + Set the turtle's second coordinate to *y*, leave first coordinate unchanged. >>> turtle.position() (0.00, 40.00) 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 Wed Jan 14 01:08:09 2009 @@ -31,22 +31,34 @@ Exception raised on compression and decompression errors. -.. function:: adler32(string[, value]) +.. function:: adler32(data[, value]) - Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as + Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much more quickly.) If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. This function always returns an integer object. - .. versionchanged:: 2.6 - For consistent cross-platform behavior we always return a signed integer. - ie: Results in the (2**31)...(2**32-1) range will be negative. +.. note:: + 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 + 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 + 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] + regardless of platform. .. function:: compress(string[, level]) @@ -66,25 +78,37 @@ ``9`` is slowest and produces the most. The default value is ``6``. -.. function:: crc32(string[, value]) +.. function:: crc32(data[, value]) .. index:: single: Cyclic Redundancy Check single: checksum; Cyclic Redundancy Check - Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is + Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. This function always returns an integer object. - .. versionchanged:: 2.6 - For consistent cross-platform behavior we always return a signed integer. - ie: Results in the (2**31)...(2**32-1) range will be negative. +.. note:: + 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 + 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 + 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] + regardless of platform. .. function:: decompress(string[, wbits[, bufsize]]) Modified: python/branches/release26-maint/Lib/_abcoll.py ============================================================================== --- python/branches/release26-maint/Lib/_abcoll.py (original) +++ python/branches/release26-maint/Lib/_abcoll.py Wed Jan 14 01:08:09 2009 @@ -249,12 +249,12 @@ @abstractmethod def add(self, value): - """Return True if it was added, False if already there.""" + """Add an element.""" raise NotImplementedError @abstractmethod def discard(self, value): - """Return True if it was deleted, False if not there.""" + """Remove an element. Do not raise an exception if absent.""" raise NotImplementedError def remove(self, value): Modified: python/branches/release26-maint/Lib/test/test_datetime.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_datetime.py (original) +++ python/branches/release26-maint/Lib/test/test_datetime.py Wed Jan 14 01:08:09 2009 @@ -856,6 +856,14 @@ # A naive object replaces %z and %Z w/ empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + #make sure that invalid format specifiers are handled correctly + self.assertRaises(ValueError, t.strftime, "%e") + self.assertRaises(ValueError, t.strftime, "%") + self.assertRaises(ValueError, t.strftime, "%#") + + #check that this standard extension works + t.strftime("%f") + def test_format(self): dt = self.theclass(2007, 9, 10) Modified: python/branches/release26-maint/Lib/test/test_os.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_os.py (original) +++ python/branches/release26-maint/Lib/test/test_os.py Wed Jan 14 01:08:09 2009 @@ -533,6 +533,55 @@ def test_chmod(self): self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) +class TestInvalidFD(unittest.TestCase): + singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat", + "fstatvfs", "fsync", "tcgetpgrp", "ttyname"] + def get_single(f): + def helper(self): + if getattr(os, f, None): + self.assertRaises(OSError, getattr(os, f), 10) + return helper + for f in singles: + locals()["test_"+f] = get_single(f) + + def test_isatty(self): + self.assertEqual(os.isatty(10), False) + + def test_closerange(self): + self.assertEqual(os.closerange(10, 20), None) + + def test_dup2(self): + self.assertRaises(OSError, os.dup2, 10, 20) + + def test_fchmod(self): + if hasattr(os, "fchmod"): + self.assertRaises(OSError, os.fchmod, 10, 0) + + def test_fchown(self): + if hasattr(os, "fchown"): + self.assertRaises(OSError, os.fchmod, 10, -1, -1) + + def test_fpathconf(self): + if hasattr(os, "fpathconf"): + self.assertRaises(OSError, os.fpathconf, 10, "foo") + + def test_ftruncate(self): + if hasattr(os, "ftruncate"): + self.assertRaises(OSError, os.ftruncate, 10, 0) + + def test_lseek(self): + self.assertRaises(OSError, os.lseek, 10, 0, 0) + + def test_read(self): + self.assertRaises(OSError, os.read, 10, 1) + + def test_tcsetpgrpt(self): + if hasattr(os, "tcsetpgrp"): + self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + + def test_write(self): + self.assertRaises(OSError, os.write, 10, " ") + if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): pass @@ -547,7 +596,8 @@ MakedirTests, DevNullTests, URandomTests, - Win32ErrorTests + Win32ErrorTests, + TestInvalidFD ) if __name__ == "__main__": Modified: python/branches/release26-maint/Makefile.pre.in ============================================================================== --- python/branches/release26-maint/Makefile.pre.in (original) +++ python/branches/release26-maint/Makefile.pre.in Wed Jan 14 01:08:09 2009 @@ -565,6 +565,9 @@ Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ $(STRINGLIB_HEADERS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \ + $(STRINGLIB_HEADERS) + Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \ $(STRINGLIB_HEADERS) @@ -585,6 +588,7 @@ Include/ast.h \ Include/bitset.h \ Include/boolobject.h \ + Include/bytearrayobject.h \ Include/bytes_methods.h \ Include/bytesobject.h \ Include/bufferobject.h \ Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed Jan 14 01:08:09 2009 @@ -16,6 +16,8 @@ to str, bytes and bytearray could be optimized away by the compiler, letting the interpreter segfault instead of raising an error. +- Issue #4915: Port sysmodule to Windows CE. + - Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the @@ -276,6 +278,8 @@ Build ----- +- Issue #4895: Use _strdup on Windows CE. + - Issue #4472: "configure --enable-shared" now works on OSX - Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. Modified: python/branches/release26-maint/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/release26-maint/Modules/_ctypes/cfield.c (original) +++ python/branches/release26-maint/Modules/_ctypes/cfield.c Wed Jan 14 01:08:09 2009 @@ -1452,11 +1452,14 @@ size += 1; /* terminating NUL */ size *= sizeof(wchar_t); buffer = (wchar_t *)PyMem_Malloc(size); - if (!buffer) + if (!buffer) { + Py_DECREF(value); return PyErr_NoMemory(); + } memset(buffer, 0, size); keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); if (!keep) { + Py_DECREF(value); PyMem_Free(buffer); return NULL; } Modified: python/branches/release26-maint/PC/pyconfig.h ============================================================================== --- python/branches/release26-maint/PC/pyconfig.h (original) +++ python/branches/release26-maint/PC/pyconfig.h Wed Jan 14 01:08:09 2009 @@ -88,6 +88,12 @@ #define USE_SOCKET #endif +/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ +#if defined(MS_WINCE) +# include +# define strdup _strdup +#endif + #ifdef MS_WINCE /* Python uses GetVersion() to distinguish between * Windows NT and 9x/ME where OS Unicode support is concerned. Modified: python/branches/release26-maint/Python/sysmodule.c ============================================================================== --- python/branches/release26-maint/Python/sysmodule.c (original) +++ python/branches/release26-maint/Python/sysmodule.c Wed Jan 14 01:08:09 2009 @@ -1296,8 +1296,13 @@ PyDict_SetItemString(sysdict, key, v); \ Py_XDECREF(v) + /* Check that stdin is not a directory + Using shell redirection, you can redirect stdin to a directory, + crashing the Python interpreter. Catch this common mistake here + and output a useful error message. Note that under MS Windows, + the shell already prevents that. */ +#if !defined(MS_WINDOWS) { - /* XXX: does this work on Win/Win64? (see posix_fstat) */ struct stat sb; if (fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { @@ -1307,6 +1312,7 @@ exit(EXIT_FAILURE); } } +#endif /* Closing the standard FILE* if sys.std* goes aways causes problems * for embedded Python usages. Closing them when somebody explicitly @@ -1526,7 +1532,7 @@ { #if defined(HAVE_REALPATH) char fullpath[MAXPATHLEN]; -#elif defined(MS_WINDOWS) +#elif defined(MS_WINDOWS) && !defined(MS_WINCE) char fullpath[MAX_PATH]; #endif PyObject *av = makeargvobject(argc, argv); @@ -1571,7 +1577,10 @@ #if SEP == '\\' /* Special case for MS filename syntax */ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { char *q; -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) && !defined(MS_WINCE) + /* This code here replaces the first element in argv with the full + path that it represents. Under CE, there are no relative paths so + the argument must be the full path anyway. */ char *ptemp; if (GetFullPathName(argv0, sizeof(fullpath), From python-checkins at python.org Wed Jan 14 01:08:45 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 14 Jan 2009 01:08:45 +0100 (CET) Subject: [Python-checkins] r68602 - python/branches/release26-maint Message-ID: <20090114000845.5A0611E4002@bag.python.org> Author: georg.brandl Date: Wed Jan 14 01:08:45 2009 New Revision: 68602 Log: Blocked revisions 68532,68542,68544-68546,68559-68560,68562,68565-68569 via svnmerge ........ r68532 | kristjan.jonsson | 2009-01-11 17:23:37 +0100 (So, 11 Jan 2009) | 1 line Issue 4879: Allow buffering for HTTPResponse ........ r68542 | martin.v.loewis | 2009-01-12 09:11:24 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4893: Use NT threading on CE. ........ r68544 | kristjan.jonsson | 2009-01-12 10:20:34 +0100 (Mo, 12 Jan 2009) | 1 line Update Misc/NEWS for issue 3582 ........ r68545 | kristjan.jonsson | 2009-01-12 10:24:04 +0100 (Mo, 12 Jan 2009) | 1 line Misc/NEWS for issue 4293 ........ r68546 | raymond.hettinger | 2009-01-12 11:37:32 +0100 (Mo, 12 Jan 2009) | 1 line Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size. ........ r68559 | raymond.hettinger | 2009-01-12 23:58:41 +0100 (Mo, 12 Jan 2009) | 1 line Issue 1696199: Add collections.Counter(). ........ r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (Di, 13 Jan 2009) | 6 lines #3720: Interpreter crashes when an evil iterator removes its own next function. Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0. ........ r68562 | raymond.hettinger | 2009-01-13 02:05:03 +0100 (Di, 13 Jan 2009) | 7 lines Simplify Counter() API. Replace items keyword argument with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work. ........ r68565 | raymond.hettinger | 2009-01-13 04:49:43 +0100 (Di, 13 Jan 2009) | 1 line Minor documentation tweaks and simpler update() example. ........ r68566 | raymond.hettinger | 2009-01-13 05:13:53 +0100 (Di, 13 Jan 2009) | 1 line Fixup and simplify docstrings and doctests. ........ r68567 | raymond.hettinger | 2009-01-13 05:50:35 +0100 (Di, 13 Jan 2009) | 1 line Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. ........ r68568 | georg.brandl | 2009-01-13 09:11:07 +0100 (Di, 13 Jan 2009) | 2 lines Fix call signature and markup. ........ r68569 | raymond.hettinger | 2009-01-13 09:38:14 +0100 (Di, 13 Jan 2009) | 7 lines Add table of idioms/patterns for using Counter objects. Improve the appearance and flow of the References section -- it used to have a box around it that wasn't distinct from the preceding code boxes and it had a weird bolding pattern and hanging indents that made the section disproportionately large. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed Jan 14 01:15:21 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 14 Jan 2009 01:15:21 +0100 (CET) Subject: [Python-checkins] r68603 - python/trunk/Doc/library/collections.rst Message-ID: <20090114001521.B15781E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 14 01:15:21 2009 New Revision: 68603 Log: Minor doc tweaks. 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 Jan 14 01:15:21 2009 @@ -188,26 +188,24 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable - >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping The returned object has a dictionary style interface except that it returns a zero count for missing items (instead of raising a :exc:`KeyError` like a dictionary would):: - >>> c = Counter(['if', 'your', 'peril', 'be']) - >>> c['questions'] # count of a missing element is zero + >>> c = Counter(['egg', 'ham']) + >>> c['bacon'] # count of a missing element is zero 0 Assigning a count of zero or reducing the count to zero leaves the element in the dictionary. Use ``del`` to remove the entry entirely: >>> c = Counter(['arthur', 'gwain']) - >>> c['arthur'] = 0 # set the count of "arthur" to zero - >>> 'arthur' in c # but "arthur" is still in the counter + >>> c['arthur'] = 0 # set the count of 'arthur' to zero + >>> 'arthur' in c # but 'arthur' is still in the counter True >>> del c['arthur'] # del will completely remove the entry - >>> 'arthur' in c - False .. versionadded:: 2.7 @@ -267,25 +265,25 @@ dict(c) # convert to a regular dictionary c.items() # convert to a list of (elem, cnt) pairs Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs - c.most_common()[-n:] # n least common elements + c.most_common()[:-n:-1] # n least common elements **References**: - * Wikipedia entry for `Multisets `_ +* Wikipedia entry for `Multisets `_ - * `Bag class `_ - in Smalltalk +* `Bag class `_ + in Smalltalk +* `C++ multisets `_ + tutorial with standalone examples + +* An early Python `Bag `_ recipe + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later + +* Use cases for multisets and mathematical operations on multisets. + Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19 - * `C++ multisets `_ - tutorial with standalone examples - - * An early Python `Bag `_ recipe - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later - - * Use cases for multisets and mathematical operations on multisets. - Knuth, Donald. The Art of Computer Programming Volume II, - Section 4.6.3, Exercise 19 .. _deque-objects: From buildbot at python.org Wed Jan 14 01:39:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 00:39:36 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090114003936.6967D1E4002@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/110 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_capi Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_capi.py", line 104, in test_main test() _testcapi.error: test_lazy_hash_inheritance: type initialised too soon make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 02:07:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 01:07:58 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090114010758.909CA1E4002@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/46 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: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_datetime test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/home/buildslave/python-trunk/2.6.norwitz-x86/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Jan 14 02:15:06 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 14 Jan 2009 02:15:06 +0100 (CET) Subject: [Python-checkins] r68604 - python/trunk/Lib/test/test_collections.py Message-ID: <20090114011506.8B1F31E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 14 02:15:06 2009 New Revision: 68604 Log: Add tests for __init__() and update() with no args. Modified: python/trunk/Lib/test/test_collections.py Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Wed Jan 14 02:15:06 2009 @@ -396,8 +396,10 @@ self.assertRaises(TypeError, hash, c) c.update(dict(a=5, b=3, c=1)) c.update(Counter('a' * 50 + 'b' * 30)) + c.update() # test case with no args c.__init__('a' * 500 + 'b' * 300) c.__init__('cdc') + c.__init__() self.assertEqual(c, dict(a=555, b=333, c=3, d=1)) self.assertEqual(c.setdefault('d', 5), 1) self.assertEqual(c['d'], 1) From buildbot at python.org Wed Jan 14 02:23:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 01:23:52 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090114012352.A3F751E4002@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/47 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: 2 tests failed: test_datetime test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Jan 14 02:39:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 14 Jan 2009 02:39:51 +0100 (CET) Subject: [Python-checkins] r68605 - python/trunk/Doc/library/collections.rst Message-ID: <20090114013951.7985B1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 14 02:39:51 2009 New Revision: 68605 Log: Fix-up indentation of sample code blocks for namedtuple mthod definitions. 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 Jan 14 02:39:51 2009 @@ -724,7 +724,7 @@ Class method that makes a new instance from an existing sequence or iterable. -.. doctest:: + .. doctest:: >>> t = [11, 22] >>> Point._make(t) @@ -740,9 +740,7 @@ .. method:: somenamedtuple._replace(kwargs) Return a new instance of the named tuple replacing specified fields with new - values: - -:: + values:: >>> p = Point(x=11, y=22) >>> p._replace(x=33) @@ -756,7 +754,7 @@ Tuple of strings listing the field names. Useful for introspection and for creating new named tuple types from existing named tuples. -.. doctest:: + .. doctest:: >>> p._fields # view the field names ('x', 'y') From buildbot at python.org Wed Jan 14 02:57:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 01:57:28 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD 3.x Message-ID: <20090114015728.3F38B1E4002@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/77 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 02:59:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 01:59:41 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090114015941.6A40A1E4031@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/46 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 BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_datetime test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor ====================================================================== FAIL: test_close (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_os.py", line 542, in helper self.assertRaises(OSError, getattr(os, f), 10) AssertionError: OSError not raised make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Jan 14 03:20:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 14 Jan 2009 03:20:09 +0100 (CET) Subject: [Python-checkins] r68606 - in python/branches/py3k: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090114022009.4E4A51E401E@bag.python.org> Author: raymond.hettinger Date: Wed Jan 14 03:20:07 2009 New Revision: 68606 Log: Issue #1696199: Add collections.Counter(). Forward port from Py2.7. Modified: python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Wed Jan 14 03:20:07 2009 @@ -140,6 +140,140 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) +.. _counter-objects: + +:class:`Counter` objects +------------------------ + +A counter tool is provided to support convenient and rapid tallies. +For example:: + + # Tally repeated words in a list + >>> words = ['red', 'blue', 'red', 'green', 'blue', 'blue'] + >>> cnt = Counter() + >>> for word in words: + ... cnt[word] += 1 + >>> cnt + Counter({'blue': 3, 'red': 2, 'green': 1}) + + # Find the ten most common words in Hamlet + >>> import re + >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) + >>> Counter(hamlet_words).most_common(10) + [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), + ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] + +.. class:: Counter([iterable-or-mapping]) + + A :class:`Counter` is a :class:`dict` subclass for counting hashable items. + It is an unordered collection where elements are stored as dictionary keys + and their counts are stored as dictionary values. Counts are allowed to be + any integer value including zero or negative counts. The :class:`Counter` + class is similar to bags or multisets in other languages. + + Elements are counted from an *iterable* or initialized from another + *mapping* (or counter):: + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + + The returned object has a dictionary style interface except that it returns + a zero count for missing items (instead of raising a :exc:`KeyError` like a + dictionary would):: + + >>> c = Counter(['egg', 'ham']) + >>> c['bacon'] # count of a missing element is zero + 0 + + Assigning a count of zero or reducing the count to zero leaves the + element in the dictionary. Use ``del`` to remove the entry entirely: + + >>> c = Counter(['arthur', 'gwain']) + >>> c['arthur'] = 0 # set the count of 'arthur' to zero + >>> 'arthur' in c # but 'arthur' is still in the counter + True + >>> del c['arthur'] # del will completely remove the entry + + .. versionadded:: 2.7 + + + Counter objects support two methods beyond those available for all + dictionaries: + + .. method:: elements() + + Return an iterator over elements repeating each as many times as its count. + Elements are returned in arbitrary order. If an element's count has been + set to zero or a negative number, :meth:`elements` will ignore it. + + >>> c = Counter({'a': 4, 'b': 2, 'd': 0, 'e': -2}) + >>> list(c.elements()) + ['a', 'a', 'a', 'a', 'b', 'b'] + + .. 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* is not specified or is ``None``, + return a list of all element counts in decreasing order of frequency. + Elements with equal counts are ordered arbitrarily:: + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + The usual dictionary methods are available for :class:`Counter` objects. + All of those work the same as they do for dictionaries except for two + which work differently for counters. + + .. method:: fromkeys(iterable) + + There is no equivalent class method for :class:`Counter` objects. + Raises a :exc:`NotImplementedError` when called. + + .. method:: update([iterable-or-mapping]) + + Like :meth:`dict.update` but adds-in counts instead of replacing them. + + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter):: + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + +Common patterns for working with :class:`Counter` objects:: + + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + c.most_common()[:-n:-1] # n least common elements + +**References**: + +* Wikipedia entry for `Multisets `_ + +* `Bag class `_ + in Smalltalk +* `C++ multisets `_ + tutorial with standalone examples + +* An early Python `Bag `_ recipe + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later + +* Use cases for multisets and mathematical operations on multisets. + Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19 + + + .. _deque-objects: :class:`deque` objects Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Wed Jan 14 03:20:07 2009 @@ -10,6 +10,9 @@ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys +import heapq as _heapq +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap + ################################################################################ ### namedtuple @@ -113,6 +116,162 @@ return result +######################################################################## +### Counter +######################################################################## + +class Counter(dict): + '''Dict subclass for counting hashable items. Sometimes called a bag + or multiset. Elements are stored as dictionary keys and their counts + are stored as dictionary values. + + >>> c = Counter('abracadabra') # count elements from a string + + >>> c.most_common(3) # three most common elements + [('a', 5), ('r', 2), ('b', 2)] + >>> sorted(c) # list all unique elements + ['a', 'b', 'c', 'd', 'r'] + >>> ''.join(sorted(c.elements())) # list elements with repetitions + 'aaaaabbcdrr' + >>> sum(c.values()) # total of all counts + 11 + + >>> c['a'] # count of letter 'a' + 5 + >>> for elem in 'shazam': # update counts from an iterable + ... c[elem] += 1 # by adding 1 to each element's count + >>> c['a'] # now there are seven 'a' + 7 + >>> del c['r'] # remove all 'r' + >>> c['r'] # now there are zero 'r' + 0 + + >>> d = Counter('simsalabim') # make another counter + >>> c.update(d) # add in the second counter + >>> c['a'] # now there are nine 'a' + 9 + + >>> c.clear() # empty the counter + >>> c + Counter() + + Note: If a count is set to zero or reduced to zero, it will remain + in the counter until the entry is deleted or the counter is cleared: + + >>> c = Counter('aaabbc') + >>> c['b'] -= 2 # reduce the count of 'b' by two + >>> c.most_common() # 'b' is still in, but its count is zero + [('a', 3), ('c', 1), ('b', 0)] + + ''' + # References: + # http://en.wikipedia.org/wiki/Multiset + # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html + # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm + # http://code.activestate.com/recipes/259174/ + # Knuth, TAOCP Vol. II section 4.6.3 + + def __init__(self, iterable=None): + '''Create a new, empty Counter object. And if given, count elements + from an input iterable. Or, initialize the count from another mapping + of elements to their counts. + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + + ''' + self.update(iterable) + + def __missing__(self, key): + 'The count of elements not in the Counter is zero.' + # Needed so that self[missing_item] does not raise KeyError + return 0 + + def most_common(self, n=None): + '''List the n most common elements and their counts from the most + common to the least. If n is None, then list all element counts. + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + ''' + # Emulate Bag.sortedByCount from Smalltalk + if n is None: + return sorted(self.items(), key=_itemgetter(1), reverse=True) + return _heapq.nlargest(n, self.items(), key=_itemgetter(1)) + + def elements(self): + '''Iterator over elements repeating each as many times as its count. + + >>> c = Counter('ABCABC') + >>> sorted(c.elements()) + ['A', 'A', 'B', 'B', 'C', 'C'] + + # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 + >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) + >>> product = 1 + >>> for factor in prime_factors.elements(): # loop over factors + ... product *= factor # and multiply them + >>> product + 1836 + + Note, if an element's count has been set to zero or is a negative + number, elements() will ignore it. + + ''' + # Emulate Bag.do from Smalltalk and Multiset.begin from C++. + return _chain.from_iterable(_starmap(_repeat, self.items())) + + # Override dict methods where necessary + + @classmethod + def fromkeys(cls, iterable, v=None): + # There is no equivalent method for counters because setting v=1 + # means that no element can have a count greater than one. + raise NotImplementedError( + 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') + + def update(self, iterable=None): + '''Like dict.update() but add counts instead of replacing them. + + Source can be an iterable, a dictionary, or another Counter instance. + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + + ''' + # The regular dict.update() operation makes no sense here because the + # replace behavior results in the some of original untouched counts + # being mixed-in with all of the other counts for a mismash that + # doesn't have a straight-forward interpretation in most counting + # contexts. Instead, we look to Knuth for suggested operations on + # multisets and implement the union-add operation discussed in + # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for + # multisets calls that operation a sum or join. + + if iterable is not None: + if isinstance(iterable, Mapping): + for elem, count in iterable.items(): + self[elem] += count + else: + for elem in iterable: + self[elem] += 1 + + def copy(self): + 'Like dict.copy() but returns a Counter instance instead of a dict.' + return Counter(self) + + def __repr__(self): + if not self: + return '%s()' % self.__class__.__name__ + items = ', '.join(map('%r: %r'.__mod__, self.most_common())) + return '%s({%s})' % (self.__class__.__name__, items) + ################################################################################ ### UserDict Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Wed Jan 14 03:20:07 2009 @@ -2,7 +2,7 @@ import unittest, doctest from test import support -from collections import namedtuple +from collections import namedtuple, Counter, Mapping import pickle, copy from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable @@ -357,11 +357,104 @@ self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(str, MutableSequence)) +class TestCounter(unittest.TestCase): + + def test_basics(self): + c = Counter('abcaba') + self.assert_(isinstance(c, dict)) + self.assert_(isinstance(c, Mapping)) + self.assert_(issubclass(Counter, dict)) + self.assert_(issubclass(Counter, Mapping)) + self.assertEqual(len(c), 3) + self.assertEqual(sum(c.values()), 6) + self.assertEqual(sorted(c.values()), [1, 2, 3]) + self.assertEqual(sorted(c.keys()), ['a', 'b', 'c']) + self.assertEqual(sorted(c), ['a', 'b', 'c']) + self.assertEqual(sorted(c.items()), + [('a', 3), ('b', 2), ('c', 1)]) + self.assertEqual(c['b'], 2) + self.assertEqual(c['z'], 0) + self.assertEqual(c.__contains__('c'), True) + self.assertEqual(c.__contains__('z'), False) + self.assertEqual(c.get('b', 10), 2) + self.assertEqual(c.get('z', 10), 10) + self.assertEqual(c, dict(a=3, b=2, c=1)) + self.assertEqual(repr(c), "Counter({'a': 3, 'b': 2, 'c': 1})") + self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)]) + for i in range(5): + self.assertEqual(c.most_common(i), + [('a', 3), ('b', 2), ('c', 1)][:i]) + self.assertEqual(''.join(sorted(c.elements())), 'aaabbc') + c['a'] += 1 # increment an existing value + c['b'] -= 2 # sub existing value to zero + del c['c'] # remove an entry + c['d'] -= 2 # sub from a missing value + c['e'] = -5 # directly assign a missing value + c['f'] += 4 # add to a missing value + self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4)) + self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff') + self.assertEqual(c.pop('f'), 4) + self.assertEqual('f' in c, False) + for i in range(3): + elem, cnt = c.popitem() + self.assertEqual(elem in c, False) + c.clear() + self.assertEqual(c, {}) + self.assertEqual(repr(c), 'Counter()') + self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') + self.assertRaises(TypeError, hash, c) + c.update(dict(a=5, b=3, c=1)) + c.update(Counter('a' * 50 + 'b' * 30)) + c.update() # test case with no args + c.__init__('a' * 500 + 'b' * 300) + c.__init__('cdc') + c.__init__() + self.assertEqual(c, dict(a=555, b=333, c=3, d=1)) + self.assertEqual(c.setdefault('d', 5), 1) + self.assertEqual(c['d'], 1) + self.assertEqual(c.setdefault('e', 5), 5) + self.assertEqual(c['e'], 5) + + def test_copying(self): + # Check that counters are copyable, deepcopyable, picklable, and + #have a repr/eval round-trip + words = Counter('which witch had which witches wrist watch'.split()) + update_test = Counter() + update_test.update(words) + for i, dup in enumerate([ + words.copy(), + copy.copy(words), + copy.deepcopy(words), + pickle.loads(pickle.dumps(words, 0)), + pickle.loads(pickle.dumps(words, 1)), + pickle.loads(pickle.dumps(words, 2)), + pickle.loads(pickle.dumps(words, -1)), + eval(repr(words)), + update_test, + Counter(words), + ]): + msg = (i, dup, words) + self.assert_(dup is not words) + self.assertEquals(dup, words) + self.assertEquals(len(dup), len(words)) + self.assertEquals(type(dup), type(words)) + + def test_conversions(self): + # Convert to: set, list, dict + s = 'she sells sea shells by the sea shore' + self.assertEqual(sorted(Counter(s).elements()), sorted(s)) + self.assertEqual(sorted(Counter(s)), sorted(set(s))) + self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) + self.assertEqual(set(Counter(s)), set(s)) + + + import doctest, collections def test_main(verbose=None): NamedTupleDocs = doctest.DocTestSuite(module=collections) - test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs] + test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, + TestCollectionABCs, TestCounter] support.run_unittest(*test_classes) support.run_doctest(collections, verbose) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 14 03:20:07 2009 @@ -130,6 +130,9 @@ appropriately when it is being used via socket.makefile() objects rather than delaying the close by waiting for garbage collection to do it. +- Issue #1696199: Add collections.Counter() for rapid and convenient + counting. + - Issue #3860: GzipFile and BZ2File now support the context manager protocol. - Issue #4867: Fixed a crash in ctypes when passing a string to a From buildbot at python.org Wed Jan 14 03:24:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 02:24:27 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 2.6 Message-ID: <20090114022427.F1F1C1E4010@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%202.6/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hotshot ====================================================================== FAIL: test_logreader_eof_error (test.test_hotshot.HotShotTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/2.6.loewis-sun/build/Lib/test/test_hotshot.py", line 130, in test_logreader_eof_error self.assertRaises((IOError, EOFError), _hotshot.logreader, ".") AssertionError: (, ) not raised sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 04:09:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 03:09:48 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090114030949.1529F1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/69 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_httpservers ====================================================================== FAIL: test_post (test.test_httpservers.CGIHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_httpservers.py", line 330, in test_post self.assertEquals(res.read(), b'1, python, 123456\n') AssertionError: b'' != b'1, python, 123456\n' sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 04:14:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 03:14:03 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090114031404.36E821E4002@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/54 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: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 683, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Wed Jan 14 04:37:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 03:37:37 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090114033737.314271E4002@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/45 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: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_datetime test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 04:56:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 03:56:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090114035659.0111E1E4002@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/108 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: 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 Jan 14 05:50:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 04:50:17 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090114045018.1E0EB1E4002@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/42 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: sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 06:24:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 05:24:11 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090114052411.EBC161E4002@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/45 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: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Jan 14 06:31:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 14 Jan 2009 05:31:59 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090114053159.8CF0F1E4002@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/8 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_datetime test_hotshot test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_logreader_eof_error (test.test_hotshot.HotShotTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_hotshot.py", line 130, in test_logreader_eof_error self.assertRaises((IOError, EOFError), _hotshot.logreader, ".") AssertionError: (, ) not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file number sincerely, -The Buildbot From nnorwitz at gmail.com Wed Jan 14 10:08:51 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 14 Jan 2009 04:08:51 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (2) Message-ID: <20090114090851.GA15253@python.psfb.org> 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657833 refs] From nnorwitz at gmail.com Wed Jan 14 10:15:36 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 14 Jan 2009 04:15:36 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (2) Message-ID: <20090114091536.GA16619@python.psfb.org> 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657104 refs] From python-checkins at python.org Wed Jan 14 11:50:57 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Wed, 14 Jan 2009 11:50:57 +0100 (CET) Subject: [Python-checkins] r68607 - python/trunk/Lib/test/test_xmlrpc.py Message-ID: <20090114105057.9D2F61E403C@bag.python.org> Author: kristjan.jonsson Date: Wed Jan 14 11:50:57 2009 New Revision: 68607 Log: Re-enable all tests for windows platforms. Also, explicitly connect to the IPV4 address. On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect. It would try connecting using AF_INET6 first and this would cause a delay of up to a second. Modified: python/trunk/Lib/test/test_xmlrpc.py Modified: python/trunk/Lib/test/test_xmlrpc.py ============================================================================== --- python/trunk/Lib/test/test_xmlrpc.py (original) +++ python/trunk/Lib/test/test_xmlrpc.py Wed Jan 14 11:50:57 2009 @@ -267,7 +267,7 @@ self.assertEqual(str(t2), d) -PORT = None +ADDR = PORT = URL = None # The evt is set twice. First when the server is ready to serve. # Second when the server has been shutdown. The user must clear @@ -293,13 +293,18 @@ s.setblocking(True) return s, port + serv = MyXMLRPCServer(("localhost", 0), + logRequests=False, bind_and_activate=False) try: - serv = MyXMLRPCServer(("localhost", 0), - logRequests=False, bind_and_activate=False) serv.socket.settimeout(3) serv.server_bind() - global PORT - PORT = serv.socket.getsockname()[1] + global ADDR, PORT, URL + ADDR, PORT = serv.socket.getsockname() + #connect to IP address directly. This avoids socket.create_connection() + #trying to connect to to "localhost" using all address families, which + #causes slowdown e.g. on vista which supports AF_INET6. The server listens + #on AF_INET only. + URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() serv.register_introspection_functions() serv.register_multicall_functions() @@ -372,7 +377,7 @@ def test_simple1(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error), e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -384,7 +389,7 @@ def XXXtest_404(self): # send POST with httplib, it should return 404 header and # 'Not Found' message. - conn = httplib.HTTPConnection('localhost', PORT) + conn = httplib.HTTPConnection(ADDR, PORT) conn.request('POST', '/this-is-not-valid') response = conn.getresponse() conn.close() @@ -394,7 +399,7 @@ def test_introspection1(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) meth = p.system.listMethods() expected_methods = set(['pow', 'div', 'my_function', 'add', 'system.listMethods', 'system.methodHelp', @@ -409,7 +414,7 @@ def test_introspection2(self): try: # test _methodHelp() - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divhelp = p.system.methodHelp('div') self.assertEqual(divhelp, 'This is the div function') except (xmlrpclib.ProtocolError, socket.error), e: @@ -421,7 +426,7 @@ def test_introspection3(self): try: # test native doc - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) myfunction = p.system.methodHelp('my_function') self.assertEqual(myfunction, 'This is my function') except (xmlrpclib.ProtocolError, socket.error), e: @@ -434,7 +439,7 @@ # the SimpleXMLRPCServer doesn't support signatures, but # at least check that we can try making the call try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') except (xmlrpclib.ProtocolError, socket.error), e: @@ -445,7 +450,7 @@ def test_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) @@ -462,7 +467,7 @@ def test_non_existing_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.this_is_not_exists() result = multicall() @@ -530,7 +535,7 @@ # test a call that shouldn't fail just as a smoke test try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error), e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -543,7 +548,7 @@ SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error), e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -563,7 +568,7 @@ SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = True try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error), e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -727,15 +732,9 @@ def test_main(): xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase, BinaryTestCase, FaultTestCase, TransportSubclassTestCase] - - # The test cases against a SimpleXMLRPCServer raise a socket error - # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when - # run on Windows. This only happens on the first test to run, but it - # fails every time and so these tests are skipped on win32 platforms. - if sys.platform != 'win32': - xmlrpc_tests.append(SimpleServerTestCase) - xmlrpc_tests.append(FailingServerTestCase) - xmlrpc_tests.append(CGIHandlerTestCase) + xmlrpc_tests.append(SimpleServerTestCase) + xmlrpc_tests.append(FailingServerTestCase) + xmlrpc_tests.append(CGIHandlerTestCase) test_support.run_unittest(*xmlrpc_tests) From python-checkins at python.org Wed Jan 14 12:44:26 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 14 Jan 2009 12:44:26 +0100 (CET) Subject: [Python-checkins] r68608 - in sandbox/trunk/decimal/decimal_in_c: README deccoeff.c Message-ID: <20090114114426.F30A41E4047@bag.python.org> Author: mark.dickinson Date: Wed Jan 14 12:44:26 2009 New Revision: 68608 Log: Reorganize Decimal coefficient code slightly, expand comments, add docstring for Deccoeff.digit_length, and call limbs_as_unicode from deccoeff_str to remove duplication of code. Modified: sandbox/trunk/decimal/decimal_in_c/README sandbox/trunk/decimal/decimal_in_c/deccoeff.c Modified: sandbox/trunk/decimal/decimal_in_c/README ============================================================================== --- sandbox/trunk/decimal/decimal_in_c/README (original) +++ sandbox/trunk/decimal/decimal_in_c/README Wed Jan 14 12:44:26 2009 @@ -129,3 +129,17 @@ >>> LIMB_DIGITS 9 + +Notes +----- +The aim is to slowly move all Decimal methods to _Decimal. However, +there's a minor problem with inheritance and subclasses of Decimal. +For example, suppose MyDecimal is a subclass of Decimal. Then if x +and y are instances of MyDecimal, x + y should produce a Decimal +instance, not a MyDecimal instance. + +However, if we move the __add__ code from Decimal to _Decimal, +we'll end up with a _Decimal instance instead. + +So all the _Decimal operations will still need to be wrapped +at the Decimal level, during the Python -> C migration period. 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 Wed Jan 14 12:44:26 2009 @@ -245,7 +245,7 @@ static long limb_hash(limb_t x) { - return (long)x; + return (long)(x % LONG_MAX); } /* smallest nonnegative i such that x < 10**i; undefined if x == 0 */ @@ -332,6 +332,8 @@ limb_lshift(limb_t *res, limb_t a, Py_ssize_t n, limb_t b) { if (!(0 <= n && n <= LIMB_DIGITS)) limb_error("limb_lshift: invalid shift index"); + if (b != limb_mask(b, n)) + limb_error("limb_lshift: b out of range"); if (LIMB_DIGITS == n) { *res = b; return a; @@ -346,7 +348,9 @@ limb_rshift(limb_t *res, limb_t a, Py_ssize_t n, limb_t b) { limb_t rem; if (!(0 <= n && n <= LIMB_DIGITS)) - limb_error("limb_lshift: invalid shift index"); + limb_error("limb_rshift: invalid shift index"); + if (b != limb_mask(b, n)) + limb_error("limb_rshift: b out of range"); if (LIMB_DIGITS == n) { *res = b; return a; @@ -412,8 +416,8 @@ #error "unrecognised value for LIMB_DIGITS" #endif -/* res[0:a_size+b_size] := a*b, assuming b_size <= MIN(MAX_PARTIALS, a_size). - This is a dropin replacement for limbs_mul. */ +/* res[0:a_size+b_size] := a*b, assuming b_size <= MIN(MAX_PARTIALS, + a_size). */ static void limbs_fastmultiply_init(limb_t *res, const limb_t *a, Py_ssize_t a_size, @@ -447,7 +451,7 @@ res[0:a_size+b_size] := a*b + res[0:a_size], - assuming b_size <= MIN(MAX_PARTIALS, a_size) */ + still assuming b_size <= MIN(MAX_PARTIALS, a_size) */ static void limbs_fastmultiply_add(limb_t *res, const limb_t *a, Py_ssize_t a_size, @@ -479,7 +483,8 @@ assert(acc == 0); } -/* res[0:a_size+b_size] := a * b */ +/* res[0:a_size+b_size] := a * b. This is a dropin replacement for + limbs_mul. */ static void limbs_fastmultiply(limb_t *res, const limb_t *a, Py_ssize_t a_size, @@ -497,6 +502,8 @@ if (b_size < MAX_PARTIALS) limbs_fastmultiply_init(res, a, a_size, b, b_size); else { + /* break b up into chunks of size <= MAX_PARTIALS, + and do a separate multiply for each chunk */ limbs_fastmultiply_init(res, a, a_size, b, MAX_PARTIALS); b_size -= MAX_PARTIALS; b += MAX_PARTIALS; @@ -511,9 +518,6 @@ } } -#undef LIMB_BASE - - /********************************* * Arithmetic on arrays of limbs * *********************************/ @@ -522,22 +526,6 @@ don't take care of memory allocation; they all assume that sufficient space is provided for their results. */ -/* Rational approximations to log(10)/log(2), used for base conversion: - 485/146 = 3.321917808219... - log2(10) = 3.321928094887... - 2136/643 = 3.321928460342... - - Note that for correctness of scale_Py_ssize_t, it's required that LOG2_10UP - * LOG2_10UQ * LIMB_DIGITS * PyLong_SHIFT and LOG2_10LP * LOG2_10LQ * - LIMB_DIGITS * PyLong_SHIFT both fit into a Py_ssize_t. The values below - are okay even if LIMB_DIGITS = 19 and PyLong_SHIFT = 64. -*/ - -#define LOG2_10LP 485 -#define LOG2_10LQ 146 -#define LOG2_10UP 2136 -#define LOG2_10UQ 643 - /* add n-limb numbers a and b, producing an n-limb result res and a carry */ static bool @@ -672,7 +660,7 @@ instead. This code left in for testing and debugging purposes. */ static void -limbs_mul(limb_t *res, const limb_t *a, Py_ssize_t a_size, +limbs_multiply(limb_t *res, const limb_t *a, Py_ssize_t a_size, const limb_t *b, Py_ssize_t b_size) { Py_ssize_t i, j; @@ -687,9 +675,9 @@ } } -/* divide a_size-limb number a by single limb x, giving a_size-limb quotient - res and returning the (single limb) remainder. If the input high is - nonzero, it's treated as digit a_size of a. */ +/* divide a_size-limb number a by single nonzero limb x, giving a_size-limb + quotient res and returning the (single limb) remainder. If the input high + is nonzero, it's treated as digit a_size of a. */ static limb_t limbs_div1(limb_t *res, const limb_t *a, Py_ssize_t a_size, @@ -707,7 +695,7 @@ standard: see Knuth, TAOCP, Volume 4. */ static void -limbs_div(limb_t *quot, limb_t *rem, const limb_t *a, Py_ssize_t a_size, +limbs_divmod(limb_t *quot, limb_t *rem, const limb_t *a, Py_ssize_t a_size, const limb_t *b, Py_ssize_t b_size, limb_t *w) { limb_t scale, top, a_top, b_top, q, dummy; @@ -949,18 +937,14 @@ assert(digits_in_limb == LIMB_DIGITS); } -/* Base conversion, from base 2**15 to base LIMB_BASE. +/* Base conversion, from base PyLong_BASE to base LIMB_BASE. - Convert an array of (base 2**15) digits for a Python long to an - array of limbs representing the same number. Returns the number of - limbs of a filled. The result is normalized, in the sense that if - the returned size a_size is nonzero then a[a_size-1] is nonzero. + Convert an array of digits for a Python long to an array of limbs + representing the same number. Returns the number of limbs of a filled. + The result is normalized, in the sense that if the returned size a_size is + nonzero then a[a_size-1] is nonzero. - a should have at least: - - ceiling(b_size * log(2**15)/log(LIMB_BASE)) - - limbs available. + a should have sufficient space to store the converted result. */ static Py_ssize_t @@ -979,7 +963,8 @@ return a_size; } -/* base conversion, from base LIMB_BASE to base 2**30. */ +/* base conversion, from base LIMB_BASE to base PyLong_BASE. + b should have sufficient space to store the converted result. */ static Py_ssize_t limbs_to_longdigits(digit *b, const limb_t *a, Py_ssize_t a_size) @@ -1017,23 +1002,17 @@ * Karatsuba multiplication * ****************************/ -/* Note that for a balanced multiplication, where you don't want to - keep the original multiplicands, one can do the multiplication - without any additional workspace necessary: - - to multiply a0 a1 * b0 b1, with result in z0 z1 z2 z3 - (1) a0 - a1 -> z2 - (2) b0 - b1 -> z3 - (3) a0 * b0 -> z0 z1 - (4) b1 -> a0 - (5) z2 * z3 -> b0 b1 - (6) a0 * a1 -> z2 z3 - (7) -*/ - +/* Karatsuba multiplication algorithm. There are two functions here: the + first, limbs_kmul, does Karatsuba multiplication in the more-or-less + balanced case, where the multiplier and multiplicand have roughly the same + number of limbs. + + The second function, limbs_mul_dispatch, performs multiplication for + arbitrary sizes, splitting one or other of the arguments if necessary + before calling the balanced Karatsuba function. */ -/* Unbalanced karatsuba multiplication: multiply a and b, putting result (of - size a_size + b_size) in res. w provides workspace. +/* Basic karatsuba multiplication: multiply a and b, putting result (of size + a_size + b_size) in res. w provides workspace. Preconditions: 1 <= k < a_size <= b_size <= 2*k, and k is a power of 2. @@ -1066,45 +1045,22 @@ +-----+-+-----+ 0 n-k k n - Sizes: - a0 k - a1 m-k - b0 n-k - b1 k - c k - d k - a0*b0 n - a1*b1 m - c*d 2*k */ - -/* notes: - - (1) there's no real need to pass w_size around, but it helps guard - against errors - (2) slice notation in the comments below is as in Python: - res[2n:4n] means the number represented by res[2*n] through - res[4*n-1], inclusive. -*/ - -/* decide how to handle a particular size of multiplication, and - dispatch to the appropriate function to do the computation */ - -/* strategy: wlog suppose 1 <= m <= n. +/* strategy for limbs_mul_dispatch: wlog suppose 1 <= m <= n. (1) if m == 1, do a basecase multiplication. Otherwise, let k be the largest power of 2 strictly less than m (so k < m <= 2*k). Then: - (2) If n <= 2*k, do a Karatsuba multiplication. Else + (2) If n <= 2*k, do a Karatsuba multiplication. (3) Otherwise, split n as n[:2k] and n[2k:], and do an m*(2k) Karatsuba multiplication and a m * (n-2k) multiplication (via a recursive call to limbs_mul_dispatch). Add the results. - Question: how much workspace do we need for this? + How much workspace do we need for this? Write W(m, n) for the amount of workspace needed; assume 1 <= m <= n. @@ -1138,6 +1094,9 @@ #define KARATSUBA_CUTOFF 72 +/* we don't absolutely have to pass w_size around, but doing so + helps guard against errors */ + /* limbs_kmul and limbs_mul_dispatch call each other recursively, so we need a forward declaration */ @@ -1280,12 +1239,22 @@ static PyTypeObject deccoeff_DeccoeffType; +/* output contents of a deccoeff, for debugging */ + +static void +deccoeff_printf(const char *name, deccoeff *v) +{ + limbs_printf(name, v->ob_limbs, Py_SIZE(v)); + printf("Number of limbs: %ld\n", Py_SIZE(v)); +} + /* allocate a new decimal integer with 'size' limbs */ static deccoeff * _deccoeff_new(Py_ssize_t size) { /* XXX check for overflow */ + assert(size >= 0); return PyObject_NEW_VAR(deccoeff, &deccoeff_DeccoeffType, size); } @@ -1302,9 +1271,10 @@ return v; } -/* returns its argument (with reference count unaffected) if the argument has - MAX_DIGITS or fewer digits. Otherwise it decrements the reference count - for its argument, sets OverflowError, and returns NULL. */ +/* deccoeff_checksize returns its argument (with reference count unaffected) + if the argument has MAX_DIGITS or fewer digits. Otherwise it decrements + the reference count for its argument, sets OverflowError, and returns + NULL. */ static deccoeff * deccoeff_checksize(deccoeff *v) @@ -1333,6 +1303,8 @@ return NULL; } +/* Make a copy of a deccoeff */ + static deccoeff * _deccoeff_copy(deccoeff *a) { @@ -1367,6 +1339,10 @@ return z; } +/* convert an array of unicode characters into a Deccoeff instance. + May raise OverflowError if the character array is too long, or + ValueError if the array is invalid. */ + static deccoeff * _deccoeff_from_unicode_and_size(const Py_UNICODE *s, Py_ssize_t s_len) { Py_ssize_t z_size; @@ -1391,9 +1367,15 @@ "nondigit character in input"); return NULL; } + return deccoeff_normalize(z); } +/* Variant of the above that converts an array of unicode digits containing a + decimal point at position int_len (but no sign). The decimal point is + simply ignored. This is used to parse the coefficient of a Decimal + instance. */ + static deccoeff * _deccoeff_from_pointed_unicode_and_size(const Py_UNICODE *s, Py_ssize_t s_len, Py_ssize_t int_len) { @@ -1416,17 +1398,109 @@ } +/*********************************** + * Deccoeff <-> PyLong conversions * + ***********************************/ + +/* Rational approximations to log2(10): + + LOG2_10LP/LOG2_10LQ is a lower bound for log2(10); + LOG2_10UP/LOG2_10UQ is an upper bound. + + 485/146 = 3.321917808219... + log2(10) = 3.321928094887... + 2136/643 = 3.321928460342... + + For correctness of scale_Py_ssize_t, it's required that LOG2_10UP * + LOG2_10UQ * LIMB_DIGITS * PyLong_SHIFT and LOG2_10LP * LOG2_10LQ * + LIMB_DIGITS * PyLong_SHIFT both fit into a Py_ssize_t. The values below + are okay even if we're using 64-bit types to hold limbs and digits: in that + case, LIMB_DIGITS <= 19 and PyLong_SHIFT <= 64. +*/ + +#define LOG2_10LP 485 +#define LOG2_10LQ 146 +#define LOG2_10UP 2136 +#define LOG2_10UQ 643 + +/* Compute ceiling(n*p/q) without intermediate overflow. If the result + would be larger than PY_SSIZE_T_MAX, return -1. Assumes that + n is nonnegative, and that (q-1)*(p+1) <= PY_SSIZE_T_MAX. */ + +static Py_ssize_t +scale_Py_ssize_t(Py_ssize_t n, int p, int q) { + Py_ssize_t hi, low; + assert (n >= 0); + hi = n/q; + if (hi > PY_SSIZE_T_MAX/p) + return -1; + hi *= p; + low = (n%q*p+q-1)/q; + if (hi > PY_SSIZE_T_MAX-low) + return -1; + return hi+low; +} + +/* Create a Deccoeff from a Python integer. */ + +static deccoeff * +deccoeff_from_PyLong(PyLongObject *a) +{ + Py_ssize_t a_size, z_size; + deccoeff *z; + + a_size = Py_SIZE(a); + if (a_size < 0) { + PyErr_SetString(PyExc_OverflowError, + "Can't convert negative integer to " CLASS_NAME); + return NULL; + } + z_size = scale_Py_ssize_t(a_size, + LOG2_10LQ * PyLong_SHIFT, + LOG2_10LP * LIMB_DIGITS); + if (z_size == -1) + PyErr_SetString(PyExc_OverflowError, + "Overflow in int to " CLASS_NAME " conversion\n"); + z = _deccoeff_new(z_size); + if (z==NULL) + return NULL; + Py_SIZE(z) = limbs_from_longdigits(z->ob_limbs, a->ob_digit, a_size); + return deccoeff_checksize(z); +} + +/* Convert a Python integer to a Deccoeff */ + +static PyLongObject * +deccoeff_long(deccoeff *a) +{ + Py_ssize_t a_size, z_size; + PyLongObject *z; + + a_size = Py_SIZE(a); + z_size = scale_Py_ssize_t(a_size, + LOG2_10UP * LIMB_DIGITS, + LOG2_10UQ * PyLong_SHIFT); + if (z_size == -1) + PyErr_SetString(PyExc_OverflowError, + "Overflow in " CLASS_NAME " to int conversion\n"); + z = _PyLong_New(z_size); + if (z == NULL) + return NULL; + Py_SIZE(z) = limbs_to_longdigits(z->ob_digit, a->ob_limbs, a_size); + return z; +} + /*************************** * Arithmetic on deccoeffs * ***************************/ -/* General rules: if the result of any arithmetic operation falls - outside the range [0, 10**MAX_DIGITS) then OverflowError is raised. - Results are always normalized. */ +/* General rules: if the result of any arithmetic operation falls outside the + range [0, 10**MAX_DIGITS) then OverflowError is raised. Results are always + normalized. */ -/* determine whether another Python object is compatible with deccoeff, in the - sense that it can be used in mixed-type arithmetic with deccoeff */ +/* determine whether another Python object can be used in mixed-type arithmetic + with deccoeff */ static bool compatible_with_deccoeff(PyObject *v) @@ -1434,11 +1508,7 @@ return (v->ob_type == &deccoeff_DeccoeffType || PyIndex_Check(v)); } -/* convert an arbitrary PyObject to a deccoeff. If conversion is implemented - for this type, return false and put the result of the attempted conversion - (which may be NULL on failure) in *z. Otherwise, return true. */ - -static deccoeff *deccoeff_from_PyLong(PyLongObject *a); +/* convert an arbitrary PyObject to a Deccoeff. Returns a new reference. */ static deccoeff * convert_to_deccoeff(PyObject *v) @@ -1465,28 +1535,31 @@ } } +/* wrap a binary operation on deccoeffs to give a binary + operation on PyObjects */ + #define DECCOEFF_WRAP_BINOP(PO_func, DC_func) \ static PyObject * \ PO_func(PyObject *v, PyObject *w) \ { \ - deccoeff *a, *b; \ - PyObject *z = NULL; \ - if (!compatible_with_deccoeff(v)) { \ - Py_INCREF(Py_NotImplemented); \ - z = Py_NotImplemented; \ - } \ - 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 = (PyObject *)(DC_func(a, b)); \ - Py_DECREF(b); \ - } \ - Py_DECREF(a); \ - } \ - return z; \ + deccoeff *a, *b; \ + PyObject *z = NULL; \ + if (!compatible_with_deccoeff(v)) { \ + Py_INCREF(Py_NotImplemented); \ + z = Py_NotImplemented; \ + } \ + 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 = (PyObject *)(DC_func(a, b)); \ + Py_DECREF(b); \ + } \ + Py_DECREF(a); \ + } \ + return z; \ } /* addition */ @@ -1635,7 +1708,7 @@ *r = NULL; return NULL; } - limbs_div(quot->ob_limbs, rem->ob_limbs, a->ob_limbs, a_size, + limbs_divmod(quot->ob_limbs, rem->ob_limbs, a->ob_limbs, a_size, b->ob_limbs, b_size, w->ob_limbs); Py_DECREF(w); } @@ -2066,71 +2139,6 @@ return z; } -/* Compute ceiling(n*p/q) without intermediate overflow. If the result - would be larger than PY_SSIZE_T_MAX, return -1. Assumes that - n is nonnegative, and that (q-1)*(p+1) <= PY_SSIZE_T_MAX. */ - -static Py_ssize_t -scale_Py_ssize_t(Py_ssize_t n, int p, int q) { - Py_ssize_t hi, low; - assert (n >= 0); - hi = n/q; - if (hi > PY_SSIZE_T_MAX/p) - return -1; - hi *= p; - low = (n%q*p+q-1)/q; - if (hi > PY_SSIZE_T_MAX-low) - return -1; - return hi+low; -} - -/* Create a deccoeff from a Python integer. */ - -static deccoeff * -deccoeff_from_PyLong(PyLongObject *a) -{ - Py_ssize_t a_size, z_size; - deccoeff *z; - - a_size = Py_SIZE(a); - if (a_size < 0) { - PyErr_SetString(PyExc_OverflowError, - "Can't convert negative integer to " CLASS_NAME); - return NULL; - } - z_size = scale_Py_ssize_t(a_size, - LOG2_10LQ * PyLong_SHIFT, - LOG2_10LP * LIMB_DIGITS); - if (z_size == -1) - PyErr_SetString(PyExc_OverflowError, - "Overflow in int to " CLASS_NAME " conversion\n"); - z = _deccoeff_new(z_size); - if (z==NULL) - return NULL; - Py_SIZE(z) = limbs_from_longdigits(z->ob_limbs, a->ob_digit, a_size); - return deccoeff_checksize(z); -} - -static PyLongObject * -deccoeff_long(deccoeff *a) -{ - Py_ssize_t a_size, z_size; - PyLongObject *z; - - a_size = Py_SIZE(a); - z_size = scale_Py_ssize_t(a_size, - LOG2_10UP * LIMB_DIGITS, - LOG2_10UQ * PyLong_SHIFT); - if (z_size == -1) - PyErr_SetString(PyExc_OverflowError, - "Overflow in " CLASS_NAME " to int conversion\n"); - z = _PyLong_New(z_size); - if (z == NULL) - return NULL; - Py_SIZE(z) = limbs_to_longdigits(z->ob_digit, a->ob_limbs, a_size); - return z; -} - static PyObject * deccoeff_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -2193,6 +2201,16 @@ return PyLong_FromSsize_t(_deccoeff_length(v)); } +PyDoc_STRVAR(deccoeff_digit_length_doc, +"\ +Deccoeff.digit_length(self) -> integer\n\ +\n\ +Number of decimal digits required to represent self.\n\ +\n\ +If self is positive, return the least nonnegative integer\n\ +k such that self < 10**k. If self is zero, return 0.\n\ +"); + static void deccoeff_dealloc(PyObject *v) { @@ -2248,7 +2266,7 @@ static PyMethodDef deccoeff_methods[] = { {"digit_length", (PyCFunction)deccoeff_digit_length, METH_NOARGS, - "Number of digits."}, + deccoeff_digit_length_doc}, {NULL, NULL} }; @@ -2276,7 +2294,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ (unaryfunc) deccoeff_long, /*nb_int*/ - (unaryfunc) deccoeff_long, /*nb_long*/ + 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ @@ -2295,18 +2313,17 @@ (unaryfunc) deccoeff_long, /*nb_index*/ }; +/* str(deccoeff) */ + static PyObject * deccoeff_str(deccoeff *v) { - Py_ssize_t sz, nlimbs; - limb_t *limb_pointer, *last_limb, limb_value; + Py_ssize_t size, nlimbs; PyObject *str; - int i; Py_UNICODE *p; nlimbs = Py_SIZE(v); if (nlimbs == 0) { - /* return empty string */ str = PyUnicode_FromUnicode(NULL, 1); if (str == NULL) return NULL; @@ -2315,35 +2332,21 @@ *--p = '0'; return str; } + size = _deccoeff_length(v); - sz = _deccoeff_length(v); - - str = PyUnicode_FromUnicode(NULL, sz); + assert(size >= 0); + str = PyUnicode_FromUnicode(NULL, size); if (str == NULL) return NULL; - p = PyUnicode_AS_UNICODE(str) + sz; - *p = '\0'; + p = PyUnicode_AS_UNICODE(str); - /* fill in digits from right to left; start with the least - significant limb_t */ - limb_pointer = v -> ob_limbs; - last_limb = limb_pointer + nlimbs - 1; - while (limb_pointer < last_limb) { - limb_value = *limb_pointer++; - for (i=0; i < LIMB_DIGITS; i++) - *--p = limb_to_wdigit( - limb_rshift(&limb_value, - limb_value, 1, LIMB_ZERO)); - } - /* most significant limb_t */ - limb_value = *limb_pointer; - assert(limb_bool(limb_value)); - while (limb_bool(limb_value)) - *--p = limb_to_wdigit( - limb_rshift(&limb_value, limb_value, 1, LIMB_ZERO)); + limbs_as_unicode(p, size, v->ob_limbs); + *(p+size) = '\0'; return str; } +/* repr(Deccoeff_instance) looks like "Deccoeff('123')" */ + static PyObject * deccoeff_repr(deccoeff *v) { @@ -2410,10 +2413,10 @@ /* A finite decimal object needs a sign, a coefficient and an exponent. An infinity has a sign and nothing more; the coefficient and exponent are ignored. A (quiet or signalling) nan has a sign, and may carry additional - information in the coefficient. The exponent is not used. */ + information (the payload) in the coefficient. The exponent is not used. */ #define DEC_FLAGS_NEG (1<<0) -#define DEC_FLAGS_NONZERO (1<<1) /* currently unused, but may want this later */ +#define DEC_FLAGS_NONZERO (1<<1) /* currently unused; may want this later */ #define DEC_FLAGS_SPECIAL (1<<2) #define DEC_FLAGS_INF (1<<3) #define DEC_FLAGS_NAN (1<<4) @@ -2505,10 +2508,14 @@ /* Macros to create finite, infinite, qnan, and snan _Decimal instances */ -#define FINITE_DECIMAL(type, sign, coeff, exp) (__Decimal_new(type, sign, coeff, exp)) -#define INF_DECIMAL(type, sign) (__Decimal_new(type, sign | INF_FLAGS, NULL, NULL)) -#define QNAN_DECIMAL(type, sign, payload) (__Decimal_new(type, sign | QNAN_FLAGS, payload, NULL)) -#define SNAN_DECIMAL(type, sign, payload) (__Decimal_new(type, sign | SNAN_FLAGS, payload, NULL)) +#define FINITE_DECIMAL(type, sign, coeff, exp) \ + (__Decimal_new(type, sign, coeff, exp)) +#define INF_DECIMAL(type, sign) \ + (__Decimal_new(type, sign | INF_FLAGS, NULL, NULL)) +#define QNAN_DECIMAL(type, sign, payload) \ + (__Decimal_new(type, sign | QNAN_FLAGS, payload, NULL)) +#define SNAN_DECIMAL(type, sign, payload) \ + (__Decimal_new(type, sign | SNAN_FLAGS, payload, NULL)) /* create a new finite _Decimal instance */ @@ -2819,7 +2826,8 @@ if (!PyArg_ParseTuple(args, "iO:" DECIMAL_NAME, &sign, &opayload)) return NULL; if (opayload->ob_type != &deccoeff_DeccoeffType) { - PyErr_SetString(PyExc_TypeError, "payload should have type " CLASS_NAME); + PyErr_SetString(PyExc_TypeError, + "payload should have type " CLASS_NAME); return NULL; } payload = (deccoeff *)opayload; @@ -2841,7 +2849,8 @@ if (!PyArg_ParseTuple(args, "iO:" DECIMAL_NAME, &sign, &opayload)) return NULL; if (opayload->ob_type != &deccoeff_DeccoeffType) { - PyErr_SetString(PyExc_TypeError, "payload should have type " CLASS_NAME); + PyErr_SetString(PyExc_TypeError, + "payload should have type " CLASS_NAME); return NULL; } payload = (deccoeff *)opayload; @@ -3053,35 +3062,35 @@ static PyTypeObject deccoeff__DecimalType = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - MODULE_NAME "." DECIMAL_NAME, /* tp_name */ - sizeof(_Decimal), /* tp_basicsize */ - 0, /* tp_itemsize */ - _Decimal_dealloc, /* tp_dealloc */ + MODULE_NAME "." DECIMAL_NAME, /* tp_name */ + sizeof(_Decimal), /* tp_basicsize */ + 0, /* tp_itemsize */ + _Decimal_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ + 0, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ 0, /* tp_call */ - 0, /* tp_str */ + 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "support for Decimal type", /* tp_doc */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + "support for Decimal type", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ - _Decimal_methods, /* tp_methods */ + _Decimal_methods, /* tp_methods */ 0, /* tp_members */ - _Decimal_getsetters, /* tp_getset */ + _Decimal_getsetters, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ @@ -3089,8 +3098,8 @@ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ - _Decimal_new, /* tp_new */ - PyObject_Del, /* tp_free */ + _Decimal_new, /* tp_new */ + PyObject_Del, /* tp_free */ }; static PyMethodDef deccoeff_module_methods[] = { From python-checkins at python.org Wed Jan 14 13:24:25 2009 From: python-checkins at python.org (thomas.lee) Date: Wed, 14 Jan 2009 13:24:25 +0100 (CET) Subject: [Python-checkins] r68609 - in python/branches/tlee-ast-optimize: Doc/ACKS.txt Doc/Makefile Doc/README.txt Doc/c-api/arg.rst Doc/c-api/buffer.rst Doc/c-api/conversion.rst Doc/c-api/exceptions.rst Doc/c-api/file.rst Doc/c-api/init.rst Doc/c-api/long.rst Doc/c-api/module.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/typeobj.rst Doc/data/refcounts.dat Doc/distutils/apiref.rst Doc/distutils/builtdist.rst Doc/distutils/configfile.rst Doc/distutils/packageindex.rst Doc/distutils/setupscript.rst Doc/distutils/uploading.rst Doc/documenting/markup.rst Doc/documenting/rest.rst Doc/extending/building.rst Doc/extending/extending.rst Doc/extending/newtypes.rst Doc/extending/windows.rst Doc/glossary.rst Doc/howto/curses.rst Doc/howto/doanddont.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/howto/urllib2.rst Doc/howto/webservers.rst Doc/includes/mp_distributing.py Doc/install/index.rst Doc/library/2to3.rst Doc/library/abc.rst Doc/library/aifc.rst Doc/library/al.rst Doc/library/ast.rst Doc/library/audioop.rst Doc/library/bastion.rst Doc/library/bdb.rst Doc/library/binascii.rst Doc/library/bsddb.rst Doc/library/bz2.rst Doc/library/cd.rst Doc/library/cmath.rst Doc/library/codeop.rst Doc/library/collections.rst Doc/library/compiler.rst Doc/library/configparser.rst Doc/library/cookielib.rst Doc/library/crypt.rst Doc/library/csv.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/decimal.rst Doc/library/difflib.rst Doc/library/dircache.rst Doc/library/dis.rst Doc/library/dl.rst Doc/library/email.mime.rst Doc/library/fileinput.rst Doc/library/fl.rst Doc/library/fm.rst Doc/library/fpformat.rst Doc/library/fractions.rst Doc/library/ftplib.rst Doc/library/functions.rst Doc/library/getopt.rst Doc/library/gettext.rst Doc/library/gl.rst Doc/library/gzip.rst Doc/library/hashlib.rst Doc/library/heapq.rst Doc/library/htmllib.rst Doc/library/idle.rst Doc/library/imageop.rst Doc/library/imgfile.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/jpeg.rst Doc/library/json.rst Doc/library/locale.rst Doc/library/logging.rst Doc/library/macos.rst Doc/library/mailbox.rst Doc/library/marshal.rst Doc/library/math.rst Doc/library/mhlib.rst Doc/library/mmap.rst Doc/library/msvcrt.rst Doc/library/multiprocessing.rst Doc/library/mutex.rst Doc/library/new.rst Doc/library/nntplib.rst Doc/library/numbers.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/ossaudiodev.rst Doc/library/othergui.rst Doc/library/parser.rst Doc/library/pdb.rst Doc/library/pickle.rst Doc/library/popen2.rst Doc/library/profile.rst Doc/library/pydoc.rst Doc/library/pyexpat.rst Doc/library/random.rst Doc/library/re.rst Doc/library/repr.rst Doc/library/rexec.rst Doc/library/rlcompleter.rst Doc/library/robotparser.rst Doc/library/sched.rst Doc/library/sgmllib.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/simplexmlrpcserver.rst Doc/library/smtplib.rst Doc/library/socket.rst Doc/library/socketserver.rst Doc/library/sqlite3.rst Doc/library/ssl.rst Doc/library/statvfs.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/stringio.rst Doc/library/subprocess.rst Doc/library/sunaudio.rst Doc/library/sys.rst Doc/library/tempfile.rst Doc/library/tk.rst Doc/library/tkinter.rst Doc/library/trace.rst Doc/library/traceback.rst Doc/library/turtle.rst Doc/library/undoc.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/urllib.rst Doc/library/urllib2.rst Doc/library/urlparse.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/library/winsound.rst Doc/library/wsgiref.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpclib.rst Doc/library/zipfile.rst Doc/library/zipimport.rst Doc/library/zlib.rst Doc/license.rst Doc/make.bat Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tools Doc/tools/rstlint.py Doc/tools/sphinx-web.py Doc/tools/sphinxext/download.html Doc/tools/sphinxext/layout.html Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/tutorial/classes.rst Doc/tutorial/controlflow.rst Doc/tutorial/datastructures.rst Doc/tutorial/errors.rst Doc/tutorial/index.rst Doc/tutorial/inputoutput.rst Doc/tutorial/interpreter.rst Doc/tutorial/introduction.rst Doc/tutorial/modules.rst Doc/tutorial/stdlib.rst Doc/tutorial/stdlib2.rst Doc/tutorial/whatnow.rst Doc/using/cmdline.rst Doc/using/unix.rst Doc/using/windows.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.1.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.3.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.6.rst Doc/whatsnew/2.7.rst Include/abstract.h Include/object.h Include/opcode.h Include/pymacconfig.h Include/pymath.h Include/pyport.h Include/unicodeobject.h LICENSE Lib/_abcoll.py Lib/ast.py Lib/bdb.py Lib/cgi.py Lib/collections.py Lib/compiler/misc.py Lib/compiler/pyassem.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Lib/compiler/transformer.py Lib/compiler/visitor.py Lib/ctypes/test/__init__.py Lib/ctypes/util.py Lib/decimal.py Lib/dis.py Lib/distutils/ccompiler.py Lib/distutils/command/register.py Lib/distutils/command/sdist.py Lib/distutils/command/upload.py Lib/distutils/config.py Lib/distutils/dist.py Lib/distutils/msvc9compiler.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_msvc9compiler.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_upload.py Lib/distutils/util.py Lib/doctest.py Lib/fractions.py Lib/getopt.py Lib/gzip.py Lib/heapq.py Lib/httplib.py Lib/idlelib/NEWS.txt Lib/idlelib/help.txt Lib/idlelib/macosxSupport.py Lib/inspect.py Lib/io.py Lib/lib-tk/ScrolledText.py Lib/lib-tk/tkColorChooser.py Lib/lib2to3 Lib/lib2to3/fixer_base.py Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_apply.py Lib/lib2to3/fixes/fix_execfile.py Lib/lib2to3/fixes/fix_has_key.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_intern.py Lib/lib2to3/fixes/fix_isinstance.py Lib/lib2to3/fixes/fix_long.py Lib/lib2to3/fixes/fix_reduce.py Lib/lib2to3/fixes/fix_repr.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/fixes/fix_xrange.py Lib/lib2to3/main.py Lib/lib2to3/pgen2/driver.py Lib/lib2to3/pygram.py Lib/lib2to3/pytree.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/benchmark.py Lib/lib2to3/tests/data/infinite_recursion.py Lib/lib2to3/tests/data/py3_test_grammar.py Lib/lib2to3/tests/test_fixers.py Lib/lib2to3/tests/test_util.py Lib/linecache.py Lib/logging/__init__.py Lib/logging/handlers.py Lib/opcode.py Lib/pdb.py Lib/plat-mac/EasyDialogs.py Lib/plat-mac/bundlebuilder.py Lib/plat-mac/macostools.py Lib/plat-mac/videoreader.py Lib/pydoc.py Lib/random.py Lib/re.py Lib/runpy.py Lib/ssl.py Lib/subprocess.py Lib/tarfile.py Lib/test/crashers/iter.py Lib/test/decimaltestdata/extra.decTest Lib/test/list_tests.py Lib/test/pickletester.py Lib/test/test_array.py Lib/test/test_ast.py Lib/test/test_bytes.py Lib/test/test_bz2.py Lib/test/test_capi.py Lib/test/test_cgi.py Lib/test/test_cmd_line_script.py Lib/test/test_collections.py Lib/test/test_datetime.py Lib/test/test_decimal.py Lib/test/test_deque.py Lib/test/test_dict.py Lib/test/test_dis.py Lib/test/test_doctest.py Lib/test/test_file.py Lib/test/test_fileio.py Lib/test/test_fractions.py Lib/test/test_generators.py Lib/test/test_getopt.py Lib/test/test_gzip.py Lib/test/test_hash.py Lib/test/test_hotshot.py Lib/test/test_import.py Lib/test/test_inspect.py Lib/test/test_int.py Lib/test/test_io.py Lib/test/test_iter.py Lib/test/test_itertools.py Lib/test/test_logging.py Lib/test/test_long.py Lib/test/test_macos.py Lib/test/test_os.py Lib/test/test_parser.py Lib/test/test_py3kwarn.py Lib/test/test_set.py Lib/test/test_struct.py Lib/test/test_subprocess.py Lib/test/test_sys.py Lib/test/test_tarfile.py Lib/test/test_textwrap.py Lib/test/test_unittest.py Lib/test/test_urllib2.py Lib/test/test_urllib2_localnet.py Lib/test/test_urllibnet.py Lib/test/test_with.py Lib/test/test_xmlrpc.py Lib/test/test_zipfile.py Lib/test/test_zipimport.py Lib/test/test_zipimport_support.py Lib/textwrap.py Lib/unittest.py Lib/urllib.py Lib/urllib2.py Lib/xmlrpclib.py Lib/zipfile.py Mac/IDLE/Makefile.in Mac/Modules/MacOS.c Mac/PythonLauncher/Makefile.in Makefile.pre.in Misc/ACKS Misc/NEWS Misc/build.sh Misc/developers.txt Misc/python.man Modules/_collectionsmodule.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_fileio.c Modules/_hotshot.c Modules/_struct.c Modules/_testcapimodule.c Modules/_tkinter.c Modules/bz2module.c Modules/cPickle.c Modules/dbmmodule.c Modules/gcmodule.c Modules/itertoolsmodule.c Modules/main.c Modules/mathmodule.c Modules/parsermodule.c Modules/posixmodule.c Modules/socketmodule.c Modules/zipimport.c Objects/abstract.c Objects/bytearrayobject.c Objects/dictobject.c Objects/fileobject.c Objects/frameobject.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Objects/object.c Objects/setobject.c Objects/stringlib/transmogrify.h Objects/stringobject.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c PC/VC6/_bsddb.dsp PC/VC6/_tkinter.dsp PC/VC6/build_tkinter.py PC/VC6/bz2.dsp PC/VC6/pythoncore.dsp PC/VC6/readme.txt PC/VC6/tcl852.patch PC/VS7.1/pythoncore.vcproj PC/VS7.1/readme.txt PC/VS8.0/build_ssl.bat PC/VS8.0/pyproject.vsprops PC/VS8.0/pythoncore.vcproj PC/_winreg.c PC/example_nt/example.vcproj PC/msvcrtmodule.c PC/os2emx/Makefile PC/os2emx/README.os2emx PC/os2emx/python26.def PC/os2emx/python27.def PC/os2vacpp/makefile PC/os2vacpp/makefile.omk PC/os2vacpp/python.def PC/pyconfig.h PCbuild/build_ssl.bat PCbuild/pythoncore.vcproj Parser/asdl.py Parser/printgrammar.c Python/ast.c Python/ceval.c Python/compile.c Python/getargs.c Python/getcopyright.c Python/getmtime.c Python/graminit.c Python/import.c Python/pythonrun.c Python/sysmodule.c Python/thread.c Python/thread_nt.h README RISCOS/Makefile RISCOS/Python/getmtime_riscos.c Tools/msi/crtlicense.txt Tools/msi/msi.py Tools/msi/uuids.py Tools/pybench/Lists.py Tools/scripts/patchcheck.py configure configure.in pyconfig.h.in setup.py Message-ID: <20090114122425.473BF1E4002@bag.python.org> Author: thomas.lee Date: Wed Jan 14 13:24:17 2009 New Revision: 68609 Log: Merged revisions 67449,67454-67455,67457-67458,67463,67467,67484,67494,67498,67511,67521,67528,67531-67532,67536-67538,67543,67553-67554,67556-67557,67571-67572,67574-67576,67579-67581,67583-67584,67587,67590-67591,67597,67601,67608,67614,67619,67628,67631,67654,67658-67659,67666,67676-67677,67681,67685,67688,67692,67694,67707,67717,67725,67746,67748,67750-67751,67761-67762,67777,67779,67784-67785,67787-67788,67790,67797,67802,67806,67818,67822,67832,67844,67848-67850,67857,67859,67862-67864,67880,67882,67885,67889-67892,67895,67898,67902,67904-67908,67912,67918,67920-67921,67923-67924,67926-67927,67930,67932,67934-67935,67943,67946,67952-67955,67957-67958,67960-67961,67963,67965,67967,67970-67971,67973,67976,67978-67980,67982,67985,67988,67990,67995,68006,68010,68014,68016,68018,68030,68033,68051,68057,68061,68081,68089,68092,68097,68099,68112,68115-68121,68123-68128,68133-68134,68141-68142,68145-68146,68148-68150,68153,68156,68158-68163,68166-68167,68171-68174,68176,68179,68182,68191,68195-68197,68203,68208-68210,68214-68215,68217-68222,68231-68232,68238,68240,68243,68276,68288-68293,68296,68299,68302,68304,68311-68312,68314,68317-68319,68325-68326,68338,68344,68360-68361,68373,68378,68381,68388,68393,68395,68415,68423-68426,68429-68430,68432,68435,68439,68450,68455,68457-68462,68468-68470,68476,68480-68481,68484-68485,68487,68493,68495-68496,68498-68499,68501,68512,68514-68515,68521,68523,68527,68532,68534-68536,68540,68542,68544-68547,68552,68559-68560,68562-68563,68565-68572,68575,68579-68580,68582,68584,68589,68592,68596-68597,68603-68605 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r67449 | martin.v.loewis | 2008-11-30 22:08:26 +1100 (Sun, 30 Nov 2008) | 3 lines Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". ................ r67454 | benjamin.peterson | 2008-12-01 01:43:23 +1100 (Mon, 01 Dec 2008) | 1 line note the version that works ................ r67455 | martin.v.loewis | 2008-12-01 06:28:27 +1100 (Mon, 01 Dec 2008) | 1 line Issue #4365: Add crtassem.h constants to the msvcrt module. ................ r67457 | christian.heimes | 2008-12-01 08:16:28 +1100 (Mon, 01 Dec 2008) | 1 line w# requires Py_ssize_t ................ r67458 | benjamin.peterson | 2008-12-01 08:46:16 +1100 (Mon, 01 Dec 2008) | 1 line fix pyspecific extensions that were broken by Sphinx's grand renaming ................ r67463 | skip.montanaro | 2008-12-01 12:55:22 +1100 (Mon, 01 Dec 2008) | 1 line typo in comment ................ r67467 | benjamin.peterson | 2008-12-01 23:52:51 +1100 (Mon, 01 Dec 2008) | 1 line let people using SVN Sphinx still build the docs ................ r67484 | christian.heimes | 2008-12-03 11:53:18 +1100 (Wed, 03 Dec 2008) | 2 lines Issue #4025 again Converted a C99 style comment to a C89 style comment (found by MAL). ................ r67494 | jeffrey.yasskin | 2008-12-03 17:46:45 +1100 (Wed, 03 Dec 2008) | 5 lines Speed up Python (according to pybench and 2to3-on-itself) by 1-2% by caching whether any thread has tracing turned on, which saves one load instruction in the fast_next_opcode path in PyEval_EvalFrameEx(). See issue 4477. ................ r67498 | raymond.hettinger | 2008-12-04 02:42:10 +1100 (Thu, 04 Dec 2008) | 1 line Backport r67478 ................ r67511 | vinay.sajip | 2008-12-04 10:22:58 +1100 (Thu, 04 Dec 2008) | 1 line Issue #4384: Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging. ................ r67521 | christian.heimes | 2008-12-05 01:34:40 +1100 (Fri, 05 Dec 2008) | 1 line Bumped up 2.6 to 2.7 ................ r67528 | fred.drake | 2008-12-05 05:25:17 +1100 (Fri, 05 Dec 2008) | 4 lines Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. ................ r67531 | georg.brandl | 2008-12-05 05:54:05 +1100 (Fri, 05 Dec 2008) | 2 lines Add reference to enumerate() to indices example. ................ r67532 | georg.brandl | 2008-12-05 05:59:16 +1100 (Fri, 05 Dec 2008) | 2 lines Add another heapq example. ................ r67536 | gregory.p.smith | 2008-12-05 07:21:09 +1100 (Fri, 05 Dec 2008) | 3 lines Adds a subprocess.check_call_output() function to return the output from a process on success or raise an exception on error. ................ r67537 | vinay.sajip | 2008-12-05 07:32:18 +1100 (Fri, 05 Dec 2008) | 1 line Took Nick Coghlan's advice about importing warnings globally in logging, to avoid the possibility of race conditions: "This could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global 'import warnings' shouldn't have any real effect on logging's import time." ................ r67538 | georg.brandl | 2008-12-05 08:28:16 +1100 (Fri, 05 Dec 2008) | 2 lines Clarification to avoid confusing output with file descriptors. ................ r67543 | gregory.p.smith | 2008-12-05 13:27:01 +1100 (Fri, 05 Dec 2008) | 2 lines rename the new check_call_output to check_output. its less ugly. ................ r67553 | georg.brandl | 2008-12-05 18:49:49 +1100 (Fri, 05 Dec 2008) | 2 lines #4408: document regex.groups. ................ r67554 | georg.brandl | 2008-12-05 18:52:26 +1100 (Fri, 05 Dec 2008) | 2 lines #4409: fix asterisks looking like footnotes. ................ r67556 | georg.brandl | 2008-12-05 19:02:17 +1100 (Fri, 05 Dec 2008) | 2 lines #4441: improve doc for os.open() flags. ................ r67557 | georg.brandl | 2008-12-05 19:06:57 +1100 (Fri, 05 Dec 2008) | 2 lines Add an index entry for "subclassing immutable types". ................ r67571 | georg.brandl | 2008-12-05 20:13:45 +1100 (Fri, 05 Dec 2008) | 2 lines Use markup. ................ r67572 | georg.brandl | 2008-12-05 20:23:14 +1100 (Fri, 05 Dec 2008) | 2 lines #4458: recognize "-" as an argument, not a malformed option in gnu_getopt(). ................ r67574 | georg.brandl | 2008-12-05 20:25:32 +1100 (Fri, 05 Dec 2008) | 2 lines #4441 followup: Add link to open() docs for Windows. ................ r67575 | georg.brandl | 2008-12-05 22:34:51 +1100 (Fri, 05 Dec 2008) | 2 lines #4544: add `dedent` to textwrap.__all__. ................ r67576 | georg.brandl | 2008-12-05 23:09:41 +1100 (Fri, 05 Dec 2008) | 2 lines #4529: fix parser's validation for try-except-finally statements. ................ r67579 | georg.brandl | 2008-12-06 02:29:39 +1100 (Sat, 06 Dec 2008) | 2 lines #4517: add "special method" glossary entry and clarify when __getattribute__ is bypassed. ................ r67580 | georg.brandl | 2008-12-06 02:32:29 +1100 (Sat, 06 Dec 2008) | 2 lines #4478: document that copyfile() can raise Error. ................ r67581 | georg.brandl | 2008-12-06 02:42:03 +1100 (Sat, 06 Dec 2008) | 2 lines #3171: document that *slice are removed in 3k. ................ r67583 | georg.brandl | 2008-12-06 02:52:20 +1100 (Sat, 06 Dec 2008) | 4 lines Move __import__ to the bottom of the functions list. It doesn't make sense for such a fundamental document to have the most obscure function listed at the top. ................ r67584 | fred.drake | 2008-12-06 02:52:25 +1100 (Sat, 06 Dec 2008) | 2 lines bump version number ................ r67587 | fred.drake | 2008-12-06 03:14:18 +1100 (Sat, 06 Dec 2008) | 2 lines be more specific, and parallel to the py3k branch ................ r67590 | mark.dickinson | 2008-12-06 04:59:46 +1100 (Sat, 06 Dec 2008) | 2 lines Issue #4461: Safety check in parsenumber (ast.c) ................ r67591 | georg.brandl | 2008-12-06 05:00:06 +1100 (Sat, 06 Dec 2008) | 2 lines Followup to #4511: add link from decorator glossary entry to definition. ................ r67597 | georg.brandl | 2008-12-06 06:03:19 +1100 (Sat, 06 Dec 2008) | 2 lines Remove confusing sentence part. ................ r67601 | mark.dickinson | 2008-12-06 08:55:28 +1100 (Sat, 06 Dec 2008) | 3 lines Issue #4445: save 3 bytes (on average, on a typical machine) per string allocation. ................ r67608 | georg.brandl | 2008-12-06 22:57:12 +1100 (Sat, 06 Dec 2008) | 2 lines Follow-up to #4488: document PIPE and STDOUT properly. ................ r67614 | skip.montanaro | 2008-12-07 04:43:30 +1100 (Sun, 07 Dec 2008) | 2 lines issue 4483 - dbm build failures on systems with gdbm_compat lib. ................ r67619 | antoine.pitrou | 2008-12-07 08:29:24 +1100 (Sun, 07 Dec 2008) | 1 line Issue #4509: bugs in bytearray with exports (buffer protocol) ................ r67628 | skip.montanaro | 2008-12-07 13:16:00 +1100 (Sun, 07 Dec 2008) | 1 line muffed the default case ................ r67631 | georg.brandl | 2008-12-07 22:54:07 +1100 (Sun, 07 Dec 2008) | 2 lines Add link to the favicon to the docs. ................ r67654 | georg.brandl | 2008-12-08 09:42:09 +1100 (Mon, 08 Dec 2008) | 2 lines #4457: rewrite __import__() documentation. ................ r67658 | martin.v.loewis | 2008-12-08 22:14:57 +1100 (Mon, 08 Dec 2008) | 1 line Add UUIDs for 2.6.1 and 2.6.2. ................ r67659 | martin.v.loewis | 2008-12-08 22:15:35 +1100 (Mon, 08 Dec 2008) | 1 line Consider micro version for name of CHM file. ................ r67666 | jeffrey.yasskin | 2008-12-09 05:55:24 +1100 (Tue, 09 Dec 2008) | 3 lines Issue 4597: Fix several cases in EvalFrameEx where an exception could be "raised" without setting x, err, or why to let the eval loop know. ................ r67676 | benjamin.peterson | 2008-12-09 13:03:03 +1100 (Tue, 09 Dec 2008) | 1 line specify how things are copied ................ r67677 | benjamin.peterson | 2008-12-09 13:05:11 +1100 (Tue, 09 Dec 2008) | 1 line revert unrelated change to installer script ................ r67681 | jeremy.hylton | 2008-12-10 08:03:10 +1100 (Wed, 10 Dec 2008) | 2 lines Add simple unittests for Request ................ r67685 | jeffrey.yasskin | 2008-12-10 18:35:02 +1100 (Wed, 10 Dec 2008) | 2 lines Update Misc/NEWS for r67666. ................ r67688 | amaury.forgeotdarc | 2008-12-11 10:22:49 +1100 (Thu, 11 Dec 2008) | 6 lines #4559: When a context manager's __exit__() method returns an object whose conversion to bool raises an exception, 'with' loses that exception. Reviewed by Jeffrey Yasskin. Already ported to 2.5, will port to 2.6 and 3.0 ................ r67692 | amaury.forgeotdarc | 2008-12-11 11:03:42 +1100 (Thu, 11 Dec 2008) | 2 lines #1030250: correctly pass the dry_run option to the mkpath() function. ................ r67694 | facundo.batista | 2008-12-11 15:19:46 +1100 (Thu, 11 Dec 2008) | 6 lines Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to give correct results in the case where one argument is a quiet NaN and the other is a finite number that requires rounding. Thanks Mark Dickinson. ................ r67707 | mark.dickinson | 2008-12-12 06:28:08 +1100 (Fri, 12 Dec 2008) | 5 lines Issues #3167, #3682: tests for math.log and math.log10 were failing on Solaris and OpenBSD. Fix this by handling special values and domain errors directly in mathmodule.c, passing only positive nonspecial floats to the system log/log10. ................ r67717 | lars.gustaebel | 2008-12-13 00:58:03 +1100 (Sat, 13 Dec 2008) | 2 lines Issue #4616: TarFile.utime(): Restore directory times on Windows. ................ r67725 | benjamin.peterson | 2008-12-13 15:02:20 +1100 (Sat, 13 Dec 2008) | 1 line fix incorrect example ................ r67746 | antoine.pitrou | 2008-12-14 10:12:30 +1100 (Sun, 14 Dec 2008) | 3 lines Issue #4163: Use unicode-friendly word splitting in the textwrap functions when given an unicode string. ................ r67748 | benjamin.peterson | 2008-12-14 12:46:11 +1100 (Sun, 14 Dec 2008) | 1 line remove has_key usage ................ r67750 | nick.coghlan | 2008-12-14 21:54:50 +1100 (Sun, 14 Dec 2008) | 1 line Fix several issues relating to access to source code inside zipfiles. Initial work by Alexander Belopolsky. See Misc/NEWS in this checkin for details. ................ r67751 | nick.coghlan | 2008-12-14 22:09:40 +1100 (Sun, 14 Dec 2008) | 1 line Add file that was missed from r67750 ................ r67761 | benjamin.peterson | 2008-12-15 04:26:04 +1100 (Mon, 15 Dec 2008) | 1 line fix missing bracket ................ r67762 | antoine.pitrou | 2008-12-15 04:40:51 +1100 (Mon, 15 Dec 2008) | 3 lines Backport r67759 (fix io.IncrementalNewlineDecoder for UTF-16 et al.). ................ r67777 | antoine.pitrou | 2008-12-15 09:33:55 +1100 (Mon, 15 Dec 2008) | 3 lines try to fix failure in test_bad_address on some buildbots ................ r67779 | antoine.pitrou | 2008-12-15 11:39:51 +1100 (Mon, 15 Dec 2008) | 1 line modify other occurrence of test_bad_address ................ r67784 | georg.brandl | 2008-12-15 19:33:58 +1100 (Mon, 15 Dec 2008) | 2 lines #4446: document "platforms" argument for setup(). ................ r67785 | georg.brandl | 2008-12-15 19:36:11 +1100 (Mon, 15 Dec 2008) | 2 lines #4611: fix typo. ................ r67787 | georg.brandl | 2008-12-15 19:58:59 +1100 (Mon, 15 Dec 2008) | 2 lines #4578: fix has_key() usage in compiler package. ................ r67788 | georg.brandl | 2008-12-15 20:07:39 +1100 (Mon, 15 Dec 2008) | 2 lines #4568: remove limitation in varargs callback example. ................ r67790 | nick.coghlan | 2008-12-15 22:41:05 +1100 (Mon, 15 Dec 2008) | 1 line Issue #4197: Fix the remaining part of the doctest-in-zipfile problem by giving linecache access to the module globals when available ................ r67797 | amaury.forgeotdarc | 2008-12-16 08:47:57 +1100 (Tue, 16 Dec 2008) | 4 lines #3954: Fix error handling code in _hotshot.logreader Will port to 2.6. hotshot was deleted from python 3. ................ r67802 | amaury.forgeotdarc | 2008-12-16 09:29:14 +1100 (Tue, 16 Dec 2008) | 4 lines #3632: the "pyo" macro from gdbinit can now run when the GIL is released. Patch by haypo. ................ r67806 | benjamin.peterson | 2008-12-16 14:35:28 +1100 (Tue, 16 Dec 2008) | 111 lines Merged revisions 67427,67431,67433,67435,67630,67652,67656-67657,67674-67675,67678-67679,67705-67706,67716,67723,67765-67771,67774,67776,67778 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67427 | benjamin.peterson | 2008-11-28 16:07:41 -0600 (Fri, 28 Nov 2008) | 1 line fix spelling in comment ........ r67431 | benjamin.peterson | 2008-11-28 17:14:08 -0600 (Fri, 28 Nov 2008) | 1 line add a scripts directory; move things to it ........ r67433 | benjamin.peterson | 2008-11-28 17:18:48 -0600 (Fri, 28 Nov 2008) | 1 line run svneol.py ........ r67435 | benjamin.peterson | 2008-11-28 17:25:03 -0600 (Fri, 28 Nov 2008) | 1 line rename pre/post_order_mapping to pre/post_order_heads ........ r67630 | alexandre.vassalotti | 2008-12-06 21:51:56 -0600 (Sat, 06 Dec 2008) | 2 lines Fix typo in the urllib2.HTTPDigestAuthHandler fixer. ........ r67652 | armin.ronacher | 2008-12-07 15:39:43 -0600 (Sun, 07 Dec 2008) | 5 lines Added a fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. ........ r67656 | armin.ronacher | 2008-12-07 16:54:16 -0600 (Sun, 07 Dec 2008) | 3 lines Added missing copyright fo 2to3 fix_isinstance. ........ r67657 | armin.ronacher | 2008-12-07 18:29:35 -0600 (Sun, 07 Dec 2008) | 3 lines 2to3: intern and reduce fixes now add the imports if missing. Because that is a common task the fixer_util module now has a function "touch_import" that adds imports if missing. ........ r67674 | benjamin.peterson | 2008-12-08 19:58:11 -0600 (Mon, 08 Dec 2008) | 1 line copy permission bits when making backup files #4602 ........ r67675 | benjamin.peterson | 2008-12-08 19:59:11 -0600 (Mon, 08 Dec 2008) | 1 line add forgotten import ........ r67678 | benjamin.peterson | 2008-12-08 20:08:30 -0600 (Mon, 08 Dec 2008) | 1 line fix #4602 for real ........ r67679 | armin.ronacher | 2008-12-09 00:54:03 -0600 (Tue, 09 Dec 2008) | 3 lines Removed redudant code from the 2to3 long fixer. This fixes #4590. ........ r67705 | benjamin.peterson | 2008-12-11 13:04:08 -0600 (Thu, 11 Dec 2008) | 1 line put trailers after a range call after the list() ........ r67706 | benjamin.peterson | 2008-12-11 13:17:57 -0600 (Thu, 11 Dec 2008) | 1 line add html related modules to the fix_imports mapping ........ r67716 | benjamin.peterson | 2008-12-11 22:16:47 -0600 (Thu, 11 Dec 2008) | 1 line consolidate tests ........ r67723 | benjamin.peterson | 2008-12-12 19:49:31 -0600 (Fri, 12 Dec 2008) | 1 line fix name ........ r67765 | benjamin.peterson | 2008-12-14 14:05:05 -0600 (Sun, 14 Dec 2008) | 1 line run fix_isinstance after fix_long and fix_unicode ........ r67766 | benjamin.peterson | 2008-12-14 14:13:05 -0600 (Sun, 14 Dec 2008) | 1 line use run_order instead of order ........ r67767 | benjamin.peterson | 2008-12-14 14:28:12 -0600 (Sun, 14 Dec 2008) | 1 line don't retain parenthesis if there is only one item left ........ r67768 | benjamin.peterson | 2008-12-14 14:32:30 -0600 (Sun, 14 Dec 2008) | 1 line use insert_child() ........ r67769 | benjamin.peterson | 2008-12-14 14:59:10 -0600 (Sun, 14 Dec 2008) | 1 line parenthesize doesn't belong in pygram or FixerBase ........ r67770 | alexandre.vassalotti | 2008-12-14 15:15:36 -0600 (Sun, 14 Dec 2008) | 2 lines Fix typo: html.paser -> html.parser. ........ r67771 | benjamin.peterson | 2008-12-14 15:22:09 -0600 (Sun, 14 Dec 2008) | 1 line altering .children needs to call changed() ........ r67774 | benjamin.peterson | 2008-12-14 15:55:38 -0600 (Sun, 14 Dec 2008) | 1 line employ an evil hack to fix multiple names in the same import statement ........ r67776 | benjamin.peterson | 2008-12-14 16:22:38 -0600 (Sun, 14 Dec 2008) | 1 line make a common mixin class for Test_imports and friends ........ r67778 | alexandre.vassalotti | 2008-12-14 17:48:20 -0600 (Sun, 14 Dec 2008) | 2 lines Make fix_imports refactor multiple imports as. ........ ................ r67818 | antoine.pitrou | 2008-12-17 11:38:28 +1100 (Wed, 17 Dec 2008) | 3 lines Issue #2183: Simplify and optimize bytecode for list comprehensions. ................ r67822 | mark.dickinson | 2008-12-18 03:14:37 +1100 (Thu, 18 Dec 2008) | 4 lines Issue #3439: add bit_length method to int and long. Thanks Fredrik Johansson and Victor Stinner for code, Raymond Hettinger for review. ................ r67832 | antoine.pitrou | 2008-12-18 09:46:54 +1100 (Thu, 18 Dec 2008) | 4 lines Issue #2467: gc.DEBUG_STATS reports invalid elapsed times. Patch by Neil Schemenauer, very slightly modified. ................ r67844 | mark.dickinson | 2008-12-19 06:46:21 +1100 (Fri, 19 Dec 2008) | 3 lines Issue 4692: bogus 'Make' in Makefile.pre.in; replace with '$MAKE'. Thanks Ned Deily. ................ r67848 | benjamin.peterson | 2008-12-19 13:28:56 +1100 (Fri, 19 Dec 2008) | 1 line fix typo ................ r67849 | benjamin.peterson | 2008-12-19 13:31:35 +1100 (Fri, 19 Dec 2008) | 1 line _call_method -> _callmethod and _get_value to _getvalue ................ r67850 | raymond.hettinger | 2008-12-19 20:06:07 +1100 (Fri, 19 Dec 2008) | 9 lines Fix-up and clean-up docs for int.bit_length(). * Replace dramatic footnote with in-line comment about possible round-off errors in logarithms of large numbers. * Add comments to the pure python code equivalent. * replace floor() with int() in the mathematical equivalent so the type is correct (should be an int, not a float). * add abs() to the mathematical equivalent so that it matches the previous line that it is supposed to be equivalent to. * make one combined example with a negative input. ................ r67857 | mark.dickinson | 2008-12-20 04:46:51 +1100 (Sat, 20 Dec 2008) | 2 lines Fix typo in Python equivalent for bit_length. ................ r67859 | amaury.forgeotdarc | 2008-12-20 09:56:48 +1100 (Sat, 20 Dec 2008) | 4 lines #4700: crtlicense.txt is displayed by the license() command and should be kept ascii-only. Will port to 3.0 ................ r67862 | benjamin.peterson | 2008-12-20 13:48:02 +1100 (Sat, 20 Dec 2008) | 1 line copy sentence from docstring ................ r67863 | benjamin.peterson | 2008-12-20 13:51:26 +1100 (Sat, 20 Dec 2008) | 1 line add headings ................ r67864 | benjamin.peterson | 2008-12-20 13:57:19 +1100 (Sat, 20 Dec 2008) | 1 line beef up docstring ................ r67880 | benjamin.peterson | 2008-12-21 09:49:24 +1100 (Sun, 21 Dec 2008) | 1 line remove redundant sentence ................ r67882 | benjamin.peterson | 2008-12-21 09:59:49 +1100 (Sun, 21 Dec 2008) | 1 line add some recent releases to the list ................ r67885 | benjamin.peterson | 2008-12-21 10:48:54 +1100 (Sun, 21 Dec 2008) | 1 line silence annoying DeprecationWarning ................ r67889 | benjamin.peterson | 2008-12-21 12:04:32 +1100 (Sun, 21 Dec 2008) | 1 line sphinx.web is long gone ................ r67890 | benjamin.peterson | 2008-12-21 12:12:26 +1100 (Sun, 21 Dec 2008) | 1 line update readme ................ r67891 | benjamin.peterson | 2008-12-21 12:14:47 +1100 (Sun, 21 Dec 2008) | 1 line there are way too many places which need to have the current version added ................ r67892 | benjamin.peterson | 2008-12-21 12:29:32 +1100 (Sun, 21 Dec 2008) | 9 lines Merged revisions 67809 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line fix logic error ........ ................ r67895 | neal.norwitz | 2008-12-22 01:28:32 +1100 (Mon, 22 Dec 2008) | 2 lines Add Tarek for work on distutils. ................ r67898 | benjamin.peterson | 2008-12-22 08:00:53 +1100 (Mon, 22 Dec 2008) | 1 line compute DISTVERSION with patchlevel.py ................ r67902 | benjamin.peterson | 2008-12-23 07:16:25 +1100 (Tue, 23 Dec 2008) | 1 line add py3k warnings to frame.f_exc_* ................ r67904 | benjamin.peterson | 2008-12-23 07:44:58 +1100 (Tue, 23 Dec 2008) | 1 line less attitude ................ r67905 | benjamin.peterson | 2008-12-23 07:51:15 +1100 (Tue, 23 Dec 2008) | 1 line fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|' ................ r67906 | benjamin.peterson | 2008-12-23 07:52:53 +1100 (Tue, 23 Dec 2008) | 1 line add NEWS note ................ r67907 | benjamin.peterson | 2008-12-23 09:12:19 +1100 (Tue, 23 Dec 2008) | 1 line silence compiler warning ................ r67908 | skip.montanaro | 2008-12-23 14:30:15 +1100 (Tue, 23 Dec 2008) | 4 lines As a result of a regression that snuck into 2.5.3 add a test case that ensures that when you try to read from a file opened for writing an IOError is raised. ................ r67912 | georg.brandl | 2008-12-23 23:37:21 +1100 (Tue, 23 Dec 2008) | 2 lines Fix missing "svn" command. ................ r67918 | georg.brandl | 2008-12-24 02:44:25 +1100 (Wed, 24 Dec 2008) | 2 lines Markup fix. ................ r67920 | benjamin.peterson | 2008-12-24 07:09:28 +1100 (Wed, 24 Dec 2008) | 1 line use a global variable, so the compiler doesn't optimize the assignment out ................ r67921 | benjamin.peterson | 2008-12-24 07:12:33 +1100 (Wed, 24 Dec 2008) | 1 line make global static ................ r67923 | benjamin.peterson | 2008-12-25 02:10:27 +1100 (Thu, 25 Dec 2008) | 1 line #4736 BufferRWPair.closed shouldn't try to call another property as a function ................ r67924 | benjamin.peterson | 2008-12-25 03:10:05 +1100 (Thu, 25 Dec 2008) | 1 line pretend exceptions don't exist a while longer ................ r67926 | tarek.ziade | 2008-12-25 06:10:05 +1100 (Thu, 25 Dec 2008) | 1 line fixed #4400 : distutils .pypirc default generated file was broken. ................ r67927 | benjamin.peterson | 2008-12-27 10:26:30 +1100 (Sat, 27 Dec 2008) | 1 line python version is included in file name now ................ r67930 | hirokazu.yamamoto | 2008-12-27 15:19:48 +1100 (Sat, 27 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2) ................ r67932 | alexandre.vassalotti | 2008-12-27 17:36:10 +1100 (Sat, 27 Dec 2008) | 5 lines Remove unnecessary casts related to unicode_decode_call_errorhandler. Make the _PyUnicode_Resize macro a static function. These changes are needed to avoid breaking strict aliasing rules. ................ r67934 | alexandre.vassalotti | 2008-12-27 18:08:47 +1100 (Sat, 27 Dec 2008) | 4 lines Fix issue #4730: cPickle corrupts high-unicode strings. Update outdated copy of PyUnicode_EncodeRawUnicodeEscape. Add a test case. ................ r67935 | alexandre.vassalotti | 2008-12-27 18:13:01 +1100 (Sat, 27 Dec 2008) | 2 lines Add Misc/NEWS entry for r67934. ................ r67943 | alexandre.vassalotti | 2008-12-27 21:02:59 +1100 (Sat, 27 Dec 2008) | 2 lines Fix bogus unicode tests in pickletester. ................ r67946 | antoine.pitrou | 2008-12-28 02:43:12 +1100 (Sun, 28 Dec 2008) | 4 lines Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by Gabriel Genellina. ................ r67952 | georg.brandl | 2008-12-28 04:42:40 +1100 (Sun, 28 Dec 2008) | 2 lines #4752: actually use custom handler in example. ................ r67953 | georg.brandl | 2008-12-28 05:20:04 +1100 (Sun, 28 Dec 2008) | 3 lines Patch #4739 by David Laban: add symbols to pydoc help topics, so that ``help('@')`` works as expected. ................ r67954 | benjamin.peterson | 2008-12-28 05:24:11 +1100 (Sun, 28 Dec 2008) | 1 line #4748 lambda generators shouldn't return values ................ r67955 | georg.brandl | 2008-12-28 05:27:53 +1100 (Sun, 28 Dec 2008) | 3 lines Follow-up to r67746 in order to restore backwards-compatibility for those who (monkey-)patch TextWrapper.wordsep_re with a custom RE. ................ r67957 | georg.brandl | 2008-12-28 05:49:19 +1100 (Sun, 28 Dec 2008) | 2 lines #4754: improve winsound documentation. ................ r67958 | georg.brandl | 2008-12-28 06:02:59 +1100 (Sun, 28 Dec 2008) | 2 lines #4682: 'b' is actually unsigned char. ................ r67960 | georg.brandl | 2008-12-28 06:04:44 +1100 (Sun, 28 Dec 2008) | 2 lines #4695: fix backslashery. ................ r67961 | georg.brandl | 2008-12-28 06:06:04 +1100 (Sun, 28 Dec 2008) | 2 lines Use :samp: role. ................ r67963 | georg.brandl | 2008-12-28 06:11:15 +1100 (Sun, 28 Dec 2008) | 2 lines #4671: document that pydoc imports modules. ................ r67965 | antoine.pitrou | 2008-12-28 07:34:52 +1100 (Sun, 28 Dec 2008) | 3 lines Issue #4677: add two list comprehension tests to pybench. ................ r67967 | benjamin.peterson | 2008-12-28 09:18:58 +1100 (Sun, 28 Dec 2008) | 1 line fix markup ................ r67970 | alexandre.vassalotti | 2008-12-28 12:52:58 +1100 (Sun, 28 Dec 2008) | 2 lines Fix name mangling of PyUnicode_ClearFreeList. ................ r67971 | alexandre.vassalotti | 2008-12-28 13:10:35 +1100 (Sun, 28 Dec 2008) | 2 lines Sort UCS-2/UCS-4 name mangling list. ................ r67973 | alexandre.vassalotti | 2008-12-28 13:58:22 +1100 (Sun, 28 Dec 2008) | 2 lines Document Py_VaBuildValue. ................ r67976 | georg.brandl | 2008-12-28 22:54:53 +1100 (Sun, 28 Dec 2008) | 7 lines Backport r67974: #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6. ................ r67978 | georg.brandl | 2008-12-28 22:58:49 +1100 (Sun, 28 Dec 2008) | 2 lines #4731: clarify message about missing module prerequisites. ................ r67979 | antoine.pitrou | 2008-12-29 01:09:36 +1100 (Mon, 29 Dec 2008) | 3 lines Issue #4444: Allow assertRaises() to be used as a context handler. ................ r67980 | antoine.pitrou | 2008-12-29 01:24:29 +1100 (Mon, 29 Dec 2008) | 1 line wrong version number in doc changes committed in r67979 ................ r67982 | benjamin.peterson | 2008-12-29 02:37:31 +1100 (Mon, 29 Dec 2008) | 1 line fix WORD_BIGEDIAN declaration in Universal builds; fixes #4060 and #4728 ................ r67985 | antoine.pitrou | 2008-12-29 03:01:11 +1100 (Mon, 29 Dec 2008) | 4 lines Issue #2153: modernize coding style of unittest.py, remove obsolete compatibility stuff. Patch by Virgil Dupras. ................ r67988 | ronald.oussoren | 2008-12-29 06:40:56 +1100 (Mon, 29 Dec 2008) | 1 line Issue4064: architecture string for universal builds on OSX ................ r67990 | ronald.oussoren | 2008-12-29 06:50:40 +1100 (Mon, 29 Dec 2008) | 3 lines Update the fix for issue4064 to deal correctly with all three variants of universal builds that are presented by the configure script. ................ r67995 | benjamin.peterson | 2008-12-29 08:16:07 +1100 (Mon, 29 Dec 2008) | 1 line #4763 PyErr_ExceptionMatches won't blow up with NULL arguments ................ r68006 | martin.v.loewis | 2008-12-30 02:51:01 +1100 (Tue, 30 Dec 2008) | 2 lines Issue #3248: Allow placing ScrolledText in a PanedWindow. ................ r68010 | martin.v.loewis | 2008-12-30 03:22:25 +1100 (Tue, 30 Dec 2008) | 2 lines Issue #3767: Convert Tk object to string in tkColorChooser. ................ r68014 | benjamin.peterson | 2008-12-30 04:47:42 +1100 (Tue, 30 Dec 2008) | 1 line #4764 set IOError.filename when trying to open a directory on POSIX platforms ................ r68016 | benjamin.peterson | 2008-12-30 04:56:58 +1100 (Tue, 30 Dec 2008) | 1 line #4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms ................ r68018 | martin.v.loewis | 2008-12-30 05:17:34 +1100 (Tue, 30 Dec 2008) | 2 lines Issue #1040026: Fix os.times result on systems where HZ is incorrect. ................ r68030 | benjamin.peterson | 2008-12-30 08:38:14 +1100 (Tue, 30 Dec 2008) | 1 line fix French ................ r68033 | tarek.ziade | 2008-12-30 09:23:53 +1100 (Tue, 30 Dec 2008) | 1 line fixed #4646 : distutils was choking on empty options arg in the setup function. ................ r68051 | nick.coghlan | 2008-12-30 12:18:48 +1100 (Tue, 30 Dec 2008) | 1 line Issue #4701: implicitly call PyType_Ready from PyObject_Hash ................ r68057 | vinay.sajip | 2008-12-30 18:01:25 +1100 (Tue, 30 Dec 2008) | 1 line Minor documentation change relating to NullHandler. ................ r68061 | georg.brandl | 2008-12-30 21:15:49 +1100 (Tue, 30 Dec 2008) | 2 lines #4778: attributes can't be called. ................ r68081 | tarek.ziade | 2008-12-31 10:03:41 +1100 (Wed, 31 Dec 2008) | 1 line Fixed #4702: Throwing DistutilsPlatformError instead of IOError under win32 if MSVC is not found ................ r68089 | benjamin.peterson | 2008-12-31 14:37:51 +1100 (Wed, 31 Dec 2008) | 1 line #4788 qualify some bare except clauses ................ r68092 | benjamin.peterson | 2008-12-31 15:08:55 +1100 (Wed, 31 Dec 2008) | 1 line fix name collision issues ................ r68097 | hirokazu.yamamoto | 2008-12-31 16:24:37 +1100 (Wed, 31 Dec 2008) | 1 line Fixed compile error on windows. ................ r68099 | hirokazu.yamamoto | 2008-12-31 16:47:19 +1100 (Wed, 31 Dec 2008) | 1 line Just inserted blank line. ................ r68112 | benjamin.peterson | 2009-01-01 10:48:39 +1100 (Thu, 01 Jan 2009) | 1 line #4795 inspect.isgeneratorfunction() should return False instead of None ................ r68115 | benjamin.peterson | 2009-01-01 15:04:41 +1100 (Thu, 01 Jan 2009) | 1 line simplfy code ................ r68116 | georg.brandl | 2009-01-01 22:46:51 +1100 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ................ r68117 | georg.brandl | 2009-01-01 22:53:55 +1100 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ................ r68118 | georg.brandl | 2009-01-01 23:00:19 +1100 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ................ r68119 | georg.brandl | 2009-01-01 23:09:40 +1100 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ................ r68120 | georg.brandl | 2009-01-01 23:15:31 +1100 (Thu, 01 Jan 2009) | 4 lines #4228: Pack negative values the same way as 2.4 in struct's L format. ................ r68121 | georg.brandl | 2009-01-01 23:43:33 +1100 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ................ r68123 | georg.brandl | 2009-01-01 23:52:29 +1100 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ................ r68124 | georg.brandl | 2009-01-01 23:53:19 +1100 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ................ r68125 | georg.brandl | 2009-01-02 00:02:09 +1100 (Fri, 02 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ................ r68126 | georg.brandl | 2009-01-02 00:05:13 +1100 (Fri, 02 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ................ r68127 | georg.brandl | 2009-01-02 00:14:49 +1100 (Fri, 02 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ................ r68128 | antoine.pitrou | 2009-01-02 01:11:22 +1100 (Fri, 02 Jan 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ................ r68133 | antoine.pitrou | 2009-01-02 02:38:03 +1100 (Fri, 02 Jan 2009) | 1 line fill in actual issue number in tests ................ r68134 | hirokazu.yamamoto | 2009-01-02 02:45:39 +1100 (Fri, 02 Jan 2009) | 2 lines Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open file with `str' filename on Windows. ................ r68141 | benjamin.peterson | 2009-01-02 03:43:12 +1100 (Fri, 02 Jan 2009) | 1 line fix highlighting ................ r68142 | benjamin.peterson | 2009-01-02 04:29:49 +1100 (Fri, 02 Jan 2009) | 2 lines welcome to 2009, Python! ................ r68145 | amaury.forgeotdarc | 2009-01-02 11:03:54 +1100 (Fri, 02 Jan 2009) | 5 lines #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. ................ r68146 | ronald.oussoren | 2009-01-02 21:44:46 +1100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4472: "configure --enable-shared doesn't work on OSX" ................ r68148 | ronald.oussoren | 2009-01-02 21:48:31 +1100 (Fri, 02 Jan 2009) | 2 lines Forgot to add a NEWS item in my previous checkin ................ r68149 | ronald.oussoren | 2009-01-02 21:50:48 +1100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4780 ................ r68150 | ronald.oussoren | 2009-01-02 22:46:05 +1100 (Fri, 02 Jan 2009) | 1 line Fix for issue 3433 ................ r68153 | ronald.oussoren | 2009-01-02 23:59:32 +1100 (Fri, 02 Jan 2009) | 10 lines Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk ................ r68156 | ronald.oussoren | 2009-01-03 01:10:20 +1100 (Sat, 03 Jan 2009) | 1 line Fix for issue1594 ................ r68158 | ronald.oussoren | 2009-01-03 01:46:19 +1100 (Sat, 03 Jan 2009) | 2 lines Fix for issue 900949 ................ r68159 | ronald.oussoren | 2009-01-03 01:48:17 +1100 (Sat, 03 Jan 2009) | 2 lines Fix for issue 1627952 ................ r68160 | ronald.oussoren | 2009-01-03 01:52:09 +1100 (Sat, 03 Jan 2009) | 2 lines Fix for issue r1737832 ................ r68161 | ronald.oussoren | 2009-01-03 02:00:05 +1100 (Sat, 03 Jan 2009) | 3 lines Fix for issue 1149804 ................ r68162 | ronald.oussoren | 2009-01-03 02:06:00 +1100 (Sat, 03 Jan 2009) | 3 lines Fix for issue 4472 is incompatible with Cygwin, this patch should fix that. ................ r68163 | ronald.oussoren | 2009-01-03 02:25:36 +1100 (Sat, 03 Jan 2009) | 2 lines Fix for issues #841800 and #900506 ................ r68166 | benjamin.peterson | 2009-01-03 05:26:23 +1100 (Sat, 03 Jan 2009) | 1 line document PyMemberDef ................ r68167 | vinay.sajip | 2009-01-03 05:53:04 +1100 (Sat, 03 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ................ r68171 | georg.brandl | 2009-01-03 07:25:14 +1100 (Sat, 03 Jan 2009) | 3 lines #4811: fix markup glitches (mostly remains of the conversion), found by Gabriel Genellina. ................ r68172 | martin.v.loewis | 2009-01-03 07:32:55 +1100 (Sat, 03 Jan 2009) | 2 lines Issue #4075: Use OutputDebugStringW in Py_FatalError. ................ r68173 | martin.v.loewis | 2009-01-03 07:40:14 +1100 (Sat, 03 Jan 2009) | 2 lines Issue #4051: Prevent conflict of UNICODE macros in cPickle. ................ r68174 | benjamin.peterson | 2009-01-03 07:47:27 +1100 (Sat, 03 Jan 2009) | 1 line fix compilation on non-Windows platforms ................ r68176 | andrew.kuchling | 2009-01-03 08:00:35 +1100 (Sat, 03 Jan 2009) | 1 line Add various items ................ r68179 | raymond.hettinger | 2009-01-03 08:26:45 +1100 (Sat, 03 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ................ r68182 | mark.dickinson | 2009-01-03 10:07:08 +1100 (Sat, 03 Jan 2009) | 4 lines Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) ................ r68191 | mark.dickinson | 2009-01-03 23:07:20 +1100 (Sat, 03 Jan 2009) | 2 lines Issue #4812: further renaming of internal Decimal constants, for clarity. ................ r68195 | georg.brandl | 2009-01-04 00:45:15 +1100 (Sun, 04 Jan 2009) | 2 lines Remove useless string literal. ................ r68196 | georg.brandl | 2009-01-04 01:29:53 +1100 (Sun, 04 Jan 2009) | 2 lines Fix indentation. ................ r68197 | benjamin.peterson | 2009-01-04 03:34:02 +1100 (Sun, 04 Jan 2009) | 55 lines Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ ................ r68203 | martin.v.loewis | 2009-01-04 04:19:26 +1100 (Sun, 04 Jan 2009) | 2 lines Issue #4817: Remove unused function PyOS_GetLastModificationTime. ................ r68208 | raymond.hettinger | 2009-01-04 06:02:23 +1100 (Sun, 04 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ................ r68209 | raymond.hettinger | 2009-01-04 06:08:10 +1100 (Sun, 04 Jan 2009) | 1 line Reapply r68191. ................ r68210 | georg.brandl | 2009-01-04 06:10:12 +1100 (Sun, 04 Jan 2009) | 2 lines Set eol-style correctly for mp_distributing.py. ................ r68214 | georg.brandl | 2009-01-04 06:44:48 +1100 (Sun, 04 Jan 2009) | 2 lines Make indentation consistent. ................ r68215 | georg.brandl | 2009-01-04 07:15:14 +1100 (Sun, 04 Jan 2009) | 2 lines Fix role name. ................ r68217 | georg.brandl | 2009-01-04 07:30:15 +1100 (Sun, 04 Jan 2009) | 2 lines Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. ................ r68218 | georg.brandl | 2009-01-04 07:38:59 +1100 (Sun, 04 Jan 2009) | 2 lines Recognize usage of the default role. ................ r68219 | georg.brandl | 2009-01-04 07:47:01 +1100 (Sun, 04 Jan 2009) | 2 lines Fix uses of the default role. ................ r68220 | georg.brandl | 2009-01-04 07:55:06 +1100 (Sun, 04 Jan 2009) | 2 lines Remove trailing whitespace. ................ r68221 | georg.brandl | 2009-01-04 08:04:55 +1100 (Sun, 04 Jan 2009) | 2 lines Remove tabs from the documentation. ................ r68222 | georg.brandl | 2009-01-04 08:11:58 +1100 (Sun, 04 Jan 2009) | 2 lines Disable the line length checker by default. ................ r68231 | guilherme.polo | 2009-01-04 08:51:09 +1100 (Sun, 04 Jan 2009) | 4 lines The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x (part of issue #3638). ................ r68232 | georg.brandl | 2009-01-04 08:52:16 +1100 (Sun, 04 Jan 2009) | 2 lines Grammar fix. ................ r68238 | georg.brandl | 2009-01-04 09:03:11 +1100 (Sun, 04 Jan 2009) | 2 lines Manually merge r68095,68186,68187,68188,68190 from 2.6 branch. ................ r68240 | georg.brandl | 2009-01-04 09:05:22 +1100 (Sun, 04 Jan 2009) | 2 lines Manually merge r67868 from 2.6 branch. ................ r68243 | georg.brandl | 2009-01-04 09:15:42 +1100 (Sun, 04 Jan 2009) | 2 lines Add temporary code to fix the automatic doc build failure. ................ r68276 | tarek.ziade | 2009-01-04 11:04:49 +1100 (Sun, 04 Jan 2009) | 1 line fixed #1702551: distutils sdist was not pruning VCS directories under win32 ................ r68288 | benjamin.peterson | 2009-01-04 11:39:07 +1100 (Sun, 04 Jan 2009) | 1 line only check the actual compile() call for a SyntaxError ................ r68289 | georg.brandl | 2009-01-04 19:26:10 +1100 (Sun, 04 Jan 2009) | 2 lines Test commit. ................ r68290 | georg.brandl | 2009-01-04 21:23:49 +1100 (Sun, 04 Jan 2009) | 4 lines Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. ................ r68291 | georg.brandl | 2009-01-04 21:24:09 +1100 (Sun, 04 Jan 2009) | 2 lines Fix two issues found by the suspicious builder. ................ r68292 | skip.montanaro | 2009-01-04 21:36:58 +1100 (Sun, 04 Jan 2009) | 3 lines If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". ................ r68293 | tarek.ziade | 2009-01-04 21:37:52 +1100 (Sun, 04 Jan 2009) | 1 line using clearer syntax ................ r68296 | mark.dickinson | 2009-01-04 23:29:36 +1100 (Sun, 04 Jan 2009) | 6 lines Add autoconf test to detect x87-style double rounding, as described in issue #2937. This information can be helpful for diagnosing platform- specific problems in math and cmath. The result of the test also serves as a fairly reliable indicator of whether the x87 floating-point instructions (as opposed to SSE2) are in use on Intel x86/x86_64 systems. ................ r68299 | mark.dickinson | 2009-01-05 00:57:26 +1100 (Mon, 05 Jan 2009) | 4 lines isinf and isnan are macros, not functions; fix configure script to use AC_CHECK_DECLS instead of AC_CHECK_FUNCS for these. (See discussion in issue #4506) ................ r68302 | mark.dickinson | 2009-01-05 03:06:40 +1100 (Mon, 05 Jan 2009) | 4 lines Oops. Need to check not only that HAVE_DECL_ISINF is defined, but also that it's equal to 1. (If isinf isn't defined, HAVE_DECL_ISINF is defined to be 0, rather than being undefined.) ................ r68304 | mark.dickinson | 2009-01-05 04:02:05 +1100 (Mon, 05 Jan 2009) | 2 lines Fix HAVE_DECL_ISINF/ISNAN test (again). ................ r68311 | mark.dickinson | 2009-01-05 06:53:00 +1100 (Mon, 05 Jan 2009) | 2 lines Use C99 'isfinite' macro in preference to BSD-derived 'finite' function. ................ r68312 | mark.dickinson | 2009-01-05 07:19:41 +1100 (Mon, 05 Jan 2009) | 4 lines It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any Python/hypot.c replacement file. Use AC_CHECK_FUNCS instead. This change should be backported to 2.6 and 3.0. ................ r68314 | mark.dickinson | 2009-01-05 08:10:56 +1100 (Mon, 05 Jan 2009) | 5 lines Fix Decimal.from_float to use valid Python 2.3 syntax, as per comments at top of decimal.py. (But note that the from_float method itself with still not be usable before Python 2.7.) See issue 4796 for discussion. ................ r68317 | mark.dickinson | 2009-01-05 08:22:02 +1100 (Mon, 05 Jan 2009) | 2 lines More Python 2.3 compatibility fixes for decimal.py. ................ r68318 | mark.dickinson | 2009-01-05 08:25:40 +1100 (Mon, 05 Jan 2009) | 2 lines Misc/NEWS entry for r68317 ................ r68319 | antoine.pitrou | 2009-01-05 08:29:23 +1100 (Mon, 05 Jan 2009) | 3 lines Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. ................ r68325 | benjamin.peterson | 2009-01-05 09:00:18 +1100 (Mon, 05 Jan 2009) | 1 line use Jinja 2.1.1 ................ r68326 | georg.brandl | 2009-01-05 09:03:10 +1100 (Mon, 05 Jan 2009) | 2 lines Update make.bat. ................ r68338 | neal.norwitz | 2009-01-05 14:57:25 +1100 (Mon, 05 Jan 2009) | 1 line Make sure to checkout any new packages ................ r68344 | marc-andre.lemburg | 2009-01-06 06:43:35 +1100 (Tue, 06 Jan 2009) | 7 lines Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. ................ r68360 | antoine.pitrou | 2009-01-07 05:10:47 +1100 (Wed, 07 Jan 2009) | 7 lines Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. ................ r68361 | antoine.pitrou | 2009-01-07 05:34:08 +1100 (Wed, 07 Jan 2009) | 3 lines Use shutil.rmtree rather than os.rmdir. ................ r68373 | hirokazu.yamamoto | 2009-01-07 20:42:28 +1100 (Wed, 07 Jan 2009) | 2 lines Issue #4864: test_msvc9compiler failed on VC6/7. Reviewed by Amaury Forgeot d'Arc. ................ r68378 | mark.dickinson | 2009-01-08 04:48:33 +1100 (Thu, 08 Jan 2009) | 2 lines Issue #4869: clarify documentation for random.expovariate. ................ r68381 | martin.v.loewis | 2009-01-08 05:40:40 +1100 (Thu, 08 Jan 2009) | 2 lines Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. ................ r68388 | benjamin.peterson | 2009-01-08 14:39:46 +1100 (Thu, 08 Jan 2009) | 1 line string exceptions are gone ................ r68393 | benjamin.peterson | 2009-01-08 15:01:00 +1100 (Thu, 08 Jan 2009) | 1 line use new sphinx modules ................ r68395 | raymond.hettinger | 2009-01-08 17:39:04 +1100 (Thu, 08 Jan 2009) | 1 line Forward port r68394 for issue 4816. ................ r68415 | tarek.ziade | 2009-01-09 10:56:31 +1100 (Fri, 09 Jan 2009) | 1 line fixed #4394 make the storage of the password optional in .pypirc ................ r68423 | benjamin.peterson | 2009-01-09 13:13:34 +1100 (Fri, 09 Jan 2009) | 29 lines Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ ................ r68424 | benjamin.peterson | 2009-01-09 13:53:35 +1100 (Fri, 09 Jan 2009) | 1 line specify what -3 warnings are about ................ r68425 | benjamin.peterson | 2009-01-09 13:56:32 +1100 (Fri, 09 Jan 2009) | 1 line fix markup ................ r68426 | benjamin.peterson | 2009-01-09 14:03:05 +1100 (Fri, 09 Jan 2009) | 1 line fix spelling ................ r68429 | benjamin.peterson | 2009-01-09 14:05:14 +1100 (Fri, 09 Jan 2009) | 1 line add -3 to manpage ................ r68430 | benjamin.peterson | 2009-01-09 14:07:27 +1100 (Fri, 09 Jan 2009) | 1 line be more specific in -3 option help ................ r68432 | benjamin.peterson | 2009-01-09 14:15:00 +1100 (Fri, 09 Jan 2009) | 1 line remove temporary code now ................ r68435 | hirokazu.yamamoto | 2009-01-09 14:32:46 +1100 (Fri, 09 Jan 2009) | 1 line Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5) ................ r68439 | hirokazu.yamamoto | 2009-01-09 15:10:40 +1100 (Fri, 09 Jan 2009) | 1 line Bump up bsddb version on VC6. (db-4.4.20 -> db-4.7.25) ................ r68450 | jeffrey.yasskin | 2009-01-10 03:47:07 +1100 (Sat, 10 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ................ r68455 | kristjan.jonsson | 2009-01-10 07:03:27 +1100 (Sat, 10 Jan 2009) | 1 line Issue 3582. Improved thread support and TLS for Windows ................ r68457 | kristjan.jonsson | 2009-01-10 07:10:59 +1100 (Sat, 10 Jan 2009) | 1 line Issue 3677: Fix import from UNC paths on Windows. ................ r68458 | kristjan.jonsson | 2009-01-10 07:23:16 +1100 (Sat, 10 Jan 2009) | 1 line Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. ................ r68459 | kristjan.jonsson | 2009-01-10 07:27:16 +1100 (Sat, 10 Jan 2009) | 1 line Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. ................ r68460 | kristjan.jonsson | 2009-01-10 07:31:26 +1100 (Sat, 10 Jan 2009) | 1 line Issue 4293: Make Py_AddPendingCall() thread safe ................ r68461 | kristjan.jonsson | 2009-01-10 08:35:16 +1100 (Sat, 10 Jan 2009) | 2 lines Issue 4293: Make Py_AddPendingCall() thread safe Add test cases and documentation ................ r68462 | antoine.pitrou | 2009-01-10 08:40:55 +1100 (Sat, 10 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. ................ r68468 | hirokazu.yamamoto | 2009-01-10 19:09:43 +1100 (Sat, 10 Jan 2009) | 1 line Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3) ................ r68469 | hirokazu.yamamoto | 2009-01-10 19:12:09 +1100 (Sat, 10 Jan 2009) | 1 line Link to debug version of Tcl/Tk when python is built as debug version. ................ r68470 | hirokazu.yamamoto | 2009-01-10 20:18:16 +1100 (Sat, 10 Jan 2009) | 1 line Added helper script to build Tcl/Tk. ................ r68476 | kristjan.jonsson | 2009-01-10 23:14:31 +1100 (Sat, 10 Jan 2009) | 1 line Issue 4906: Preserve windows error state across PyThread_get_key_value ................ r68480 | vinay.sajip | 2009-01-11 00:38:04 +1100 (Sun, 11 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ................ r68481 | vinay.sajip | 2009-01-11 00:42:04 +1100 (Sun, 11 Jan 2009) | 1 line Corrected an incorrect self-reference. ................ r68484 | antoine.pitrou | 2009-01-11 03:13:45 +1100 (Sun, 11 Jan 2009) | 3 lines Issue #3860: GzipFile and BZ2File now support the context manager protocol. ................ r68485 | antoine.pitrou | 2009-01-11 03:15:24 +1100 (Sun, 11 Jan 2009) | 1 line Add NEWS entry for r68484. ................ r68487 | matthias.klose | 2009-01-11 04:00:42 +1100 (Sun, 11 Jan 2009) | 3 lines - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. ................ r68493 | benjamin.peterson | 2009-01-11 04:18:55 +1100 (Sun, 11 Jan 2009) | 1 line rewrite verbose conditionals ................ r68495 | benjamin.peterson | 2009-01-11 04:36:44 +1100 (Sun, 11 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ................ r68496 | antoine.pitrou | 2009-01-11 05:33:21 +1100 (Sun, 11 Jan 2009) | 3 lines Add ACKS entries for some of the patches I've been committing. ................ r68498 | benjamin.peterson | 2009-01-11 06:08:49 +1100 (Sun, 11 Jan 2009) | 1 line fix encoding ................ r68499 | mark.dickinson | 2009-01-11 06:14:55 +1100 (Sun, 11 Jan 2009) | 2 lines Remove an unnecessary check from test_decimal. ................ r68501 | vinay.sajip | 2009-01-11 06:22:57 +1100 (Sun, 11 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ................ r68512 | benjamin.peterson | 2009-01-11 09:42:10 +1100 (Sun, 11 Jan 2009) | 1 line make tests fail if they can't be imported ................ r68514 | benjamin.peterson | 2009-01-11 10:41:59 +1100 (Sun, 11 Jan 2009) | 1 line move seealso to a more appropiate place ................ r68515 | benjamin.peterson | 2009-01-11 10:49:08 +1100 (Sun, 11 Jan 2009) | 1 line macos 9 isn't supported ................ r68521 | hirokazu.yamamoto | 2009-01-11 14:28:13 +1100 (Sun, 11 Jan 2009) | 1 line Fixed version number in build_ssl.bat. ................ r68523 | martin.v.loewis | 2009-01-11 20:26:54 +1100 (Sun, 11 Jan 2009) | 2 lines Issue #4279: Fix build of parsermodule under Cygwin. ................ r68527 | martin.v.loewis | 2009-01-11 20:43:55 +1100 (Sun, 11 Jan 2009) | 2 lines Issue #4895: Use _strdup on Windows CE. ................ r68532 | kristjan.jonsson | 2009-01-12 03:23:37 +1100 (Mon, 12 Jan 2009) | 1 line Issue 4879: Allow buffering for HTTPResponse ................ r68534 | gregory.p.smith | 2009-01-12 04:53:33 +1100 (Mon, 12 Jan 2009) | 2 lines correct email address ................ r68535 | gregory.p.smith | 2009-01-12 04:57:54 +1100 (Mon, 12 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ................ r68536 | benjamin.peterson | 2009-01-12 06:48:15 +1100 (Mon, 12 Jan 2009) | 1 line add email addresses ................ r68540 | martin.v.loewis | 2009-01-12 18:57:11 +1100 (Mon, 12 Jan 2009) | 2 lines Issue #4915: Port sysmodule to Windows CE. ................ r68542 | martin.v.loewis | 2009-01-12 19:11:24 +1100 (Mon, 12 Jan 2009) | 2 lines Issue #4893: Use NT threading on CE. ................ r68544 | kristjan.jonsson | 2009-01-12 20:20:34 +1100 (Mon, 12 Jan 2009) | 1 line Update Misc/NEWS for issue 3582 ................ r68545 | kristjan.jonsson | 2009-01-12 20:24:04 +1100 (Mon, 12 Jan 2009) | 1 line Misc/NEWS for issue 4293 ................ r68546 | raymond.hettinger | 2009-01-12 21:37:32 +1100 (Mon, 12 Jan 2009) | 1 line Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size. ................ r68547 | kristjan.jonsson | 2009-01-13 05:09:27 +1100 (Tue, 13 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ................ r68552 | vinay.sajip | 2009-01-13 07:36:18 +1100 (Tue, 13 Jan 2009) | 1 line Minor changes/corrections in markup. ................ r68559 | raymond.hettinger | 2009-01-13 09:58:41 +1100 (Tue, 13 Jan 2009) | 1 line Issue 1696199: Add collections.Counter(). ................ r68560 | amaury.forgeotdarc | 2009-01-13 10:36:55 +1100 (Tue, 13 Jan 2009) | 6 lines #3720: Interpreter crashes when an evil iterator removes its own next function. Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0. ................ r68562 | raymond.hettinger | 2009-01-13 12:05:03 +1100 (Tue, 13 Jan 2009) | 7 lines Simplify Counter() API. Replace items keyword argument with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work. ................ r68563 | benjamin.peterson | 2009-01-13 12:49:10 +1100 (Tue, 13 Jan 2009) | 1 line small logic correction ................ r68565 | raymond.hettinger | 2009-01-13 14:49:43 +1100 (Tue, 13 Jan 2009) | 1 line Minor documentation tweaks and simpler update() example. ................ r68566 | raymond.hettinger | 2009-01-13 15:13:53 +1100 (Tue, 13 Jan 2009) | 1 line Fixup and simplify docstrings and doctests. ................ r68567 | raymond.hettinger | 2009-01-13 15:50:35 +1100 (Tue, 13 Jan 2009) | 1 line Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. ................ r68568 | georg.brandl | 2009-01-13 19:11:07 +1100 (Tue, 13 Jan 2009) | 2 lines Fix call signature and markup. ................ r68569 | raymond.hettinger | 2009-01-13 19:38:14 +1100 (Tue, 13 Jan 2009) | 7 lines Add table of idioms/patterns for using Counter objects. Improve the appearance and flow of the References section -- it used to have a box around it that wasn't distinct from the preceding code boxes and it had a weird bolding pattern and hanging indents that made the section disproportionately large. ................ r68570 | raymond.hettinger | 2009-01-13 20:08:32 +1100 (Tue, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ................ r68571 | armin.ronacher | 2009-01-13 22:52:23 +1100 (Tue, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ................ r68572 | andrew.kuchling | 2009-01-14 00:40:54 +1100 (Wed, 14 Jan 2009) | 1 line Note that first coord. is left alone ................ r68575 | thomas.heller | 2009-01-14 04:32:28 +1100 (Wed, 14 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ................ r68579 | benjamin.peterson | 2009-01-14 08:42:23 +1100 (Wed, 14 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib #4936 ................ r68580 | benjamin.peterson | 2009-01-14 08:43:11 +1100 (Wed, 14 Jan 2009) | 1 line add bytearrayobject.h to PYTHON_HEADERS ................ r68582 | georg.brandl | 2009-01-14 09:14:01 +1100 (Wed, 14 Jan 2009) | 2 lines Use assertRaises. ................ r68584 | benjamin.peterson | 2009-01-14 09:22:41 +1100 (Wed, 14 Jan 2009) | 1 line de-spacify ................ r68589 | antoine.pitrou | 2009-01-14 10:13:52 +1100 (Wed, 14 Jan 2009) | 5 lines 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. ................ r68592 | amaury.forgeotdarc | 2009-01-14 10:19:08 +1100 (Wed, 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. ................ r68596 | amaury.forgeotdarc | 2009-01-14 10:39:22 +1100 (Wed, 14 Jan 2009) | 3 lines #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. ................ r68597 | benjamin.peterson | 2009-01-14 10:43:50 +1100 (Wed, 14 Jan 2009) | 1 line fix test_xmlrpc failures #4939 ................ r68603 | raymond.hettinger | 2009-01-14 11:15:21 +1100 (Wed, 14 Jan 2009) | 1 line Minor doc tweaks. ................ r68604 | raymond.hettinger | 2009-01-14 12:15:06 +1100 (Wed, 14 Jan 2009) | 1 line Add tests for __init__() and update() with no args. ................ r68605 | raymond.hettinger | 2009-01-14 12:39:51 +1100 (Wed, 14 Jan 2009) | 1 line Fix-up indentation of sample code blocks for namedtuple mthod definitions. ................ Added: python/branches/tlee-ast-optimize/Doc/tools/rstlint.py - copied unchanged from r68605, /python/trunk/Doc/tools/rstlint.py python/branches/tlee-ast-optimize/Doc/tools/sphinxext/susp-ignored.csv - copied unchanged from r68605, /python/trunk/Doc/tools/sphinxext/susp-ignored.csv python/branches/tlee-ast-optimize/Doc/tools/sphinxext/suspicious.py - copied unchanged from r68605, /python/trunk/Doc/tools/sphinxext/suspicious.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_msvc9compiler.py - copied unchanged from r68605, /python/trunk/Lib/distutils/tests/test_msvc9compiler.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_register.py - copied unchanged from r68605, /python/trunk/Lib/distutils/tests/test_register.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_sdist.py - copied unchanged from r68605, /python/trunk/Lib/distutils/tests/test_sdist.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_isinstance.py - copied unchanged from r68605, /python/trunk/Lib/lib2to3/fixes/fix_isinstance.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_reduce.py - copied unchanged from r68605, /python/trunk/Lib/lib2to3/fixes/fix_reduce.py python/branches/tlee-ast-optimize/Lib/test/test_zipimport_support.py - copied unchanged from r68605, /python/trunk/Lib/test/test_zipimport_support.py python/branches/tlee-ast-optimize/PC/VC6/build_tkinter.py - copied unchanged from r68605, /python/trunk/PC/VC6/build_tkinter.py python/branches/tlee-ast-optimize/PC/VC6/tcl852.patch - copied unchanged from r68605, /python/trunk/PC/VC6/tcl852.patch python/branches/tlee-ast-optimize/PC/os2emx/python27.def - copied unchanged from r68605, /python/trunk/PC/os2emx/python27.def Removed: python/branches/tlee-ast-optimize/Doc/tools/sphinx-web.py python/branches/tlee-ast-optimize/Lib/lib2to3/tests/benchmark.py python/branches/tlee-ast-optimize/Lib/test/crashers/iter.py python/branches/tlee-ast-optimize/PC/os2emx/python26.def python/branches/tlee-ast-optimize/Python/getmtime.c python/branches/tlee-ast-optimize/RISCOS/Python/getmtime_riscos.c Modified: python/branches/tlee-ast-optimize/ (props changed) python/branches/tlee-ast-optimize/Doc/ACKS.txt python/branches/tlee-ast-optimize/Doc/Makefile python/branches/tlee-ast-optimize/Doc/README.txt python/branches/tlee-ast-optimize/Doc/c-api/arg.rst python/branches/tlee-ast-optimize/Doc/c-api/buffer.rst python/branches/tlee-ast-optimize/Doc/c-api/conversion.rst python/branches/tlee-ast-optimize/Doc/c-api/exceptions.rst python/branches/tlee-ast-optimize/Doc/c-api/file.rst python/branches/tlee-ast-optimize/Doc/c-api/init.rst python/branches/tlee-ast-optimize/Doc/c-api/long.rst python/branches/tlee-ast-optimize/Doc/c-api/module.rst python/branches/tlee-ast-optimize/Doc/c-api/reflection.rst python/branches/tlee-ast-optimize/Doc/c-api/sequence.rst python/branches/tlee-ast-optimize/Doc/c-api/set.rst python/branches/tlee-ast-optimize/Doc/c-api/structures.rst python/branches/tlee-ast-optimize/Doc/c-api/sys.rst python/branches/tlee-ast-optimize/Doc/c-api/typeobj.rst python/branches/tlee-ast-optimize/Doc/data/refcounts.dat python/branches/tlee-ast-optimize/Doc/distutils/apiref.rst python/branches/tlee-ast-optimize/Doc/distutils/builtdist.rst python/branches/tlee-ast-optimize/Doc/distutils/configfile.rst python/branches/tlee-ast-optimize/Doc/distutils/packageindex.rst python/branches/tlee-ast-optimize/Doc/distutils/setupscript.rst python/branches/tlee-ast-optimize/Doc/distutils/uploading.rst python/branches/tlee-ast-optimize/Doc/documenting/markup.rst python/branches/tlee-ast-optimize/Doc/documenting/rest.rst python/branches/tlee-ast-optimize/Doc/extending/building.rst python/branches/tlee-ast-optimize/Doc/extending/extending.rst python/branches/tlee-ast-optimize/Doc/extending/newtypes.rst python/branches/tlee-ast-optimize/Doc/extending/windows.rst python/branches/tlee-ast-optimize/Doc/glossary.rst python/branches/tlee-ast-optimize/Doc/howto/curses.rst python/branches/tlee-ast-optimize/Doc/howto/doanddont.rst python/branches/tlee-ast-optimize/Doc/howto/functional.rst python/branches/tlee-ast-optimize/Doc/howto/regex.rst python/branches/tlee-ast-optimize/Doc/howto/sockets.rst python/branches/tlee-ast-optimize/Doc/howto/unicode.rst python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst python/branches/tlee-ast-optimize/Doc/howto/webservers.rst python/branches/tlee-ast-optimize/Doc/includes/mp_distributing.py (contents, props changed) python/branches/tlee-ast-optimize/Doc/install/index.rst python/branches/tlee-ast-optimize/Doc/library/2to3.rst python/branches/tlee-ast-optimize/Doc/library/abc.rst python/branches/tlee-ast-optimize/Doc/library/aifc.rst python/branches/tlee-ast-optimize/Doc/library/al.rst python/branches/tlee-ast-optimize/Doc/library/ast.rst python/branches/tlee-ast-optimize/Doc/library/audioop.rst python/branches/tlee-ast-optimize/Doc/library/bastion.rst python/branches/tlee-ast-optimize/Doc/library/bdb.rst python/branches/tlee-ast-optimize/Doc/library/binascii.rst python/branches/tlee-ast-optimize/Doc/library/bsddb.rst python/branches/tlee-ast-optimize/Doc/library/bz2.rst python/branches/tlee-ast-optimize/Doc/library/cd.rst python/branches/tlee-ast-optimize/Doc/library/cmath.rst python/branches/tlee-ast-optimize/Doc/library/codeop.rst python/branches/tlee-ast-optimize/Doc/library/collections.rst python/branches/tlee-ast-optimize/Doc/library/compiler.rst python/branches/tlee-ast-optimize/Doc/library/configparser.rst python/branches/tlee-ast-optimize/Doc/library/cookielib.rst python/branches/tlee-ast-optimize/Doc/library/crypt.rst python/branches/tlee-ast-optimize/Doc/library/csv.rst python/branches/tlee-ast-optimize/Doc/library/ctypes.rst python/branches/tlee-ast-optimize/Doc/library/datetime.rst python/branches/tlee-ast-optimize/Doc/library/decimal.rst python/branches/tlee-ast-optimize/Doc/library/difflib.rst python/branches/tlee-ast-optimize/Doc/library/dircache.rst python/branches/tlee-ast-optimize/Doc/library/dis.rst python/branches/tlee-ast-optimize/Doc/library/dl.rst python/branches/tlee-ast-optimize/Doc/library/email.mime.rst python/branches/tlee-ast-optimize/Doc/library/fileinput.rst python/branches/tlee-ast-optimize/Doc/library/fl.rst python/branches/tlee-ast-optimize/Doc/library/fm.rst python/branches/tlee-ast-optimize/Doc/library/fpformat.rst python/branches/tlee-ast-optimize/Doc/library/fractions.rst python/branches/tlee-ast-optimize/Doc/library/ftplib.rst python/branches/tlee-ast-optimize/Doc/library/functions.rst python/branches/tlee-ast-optimize/Doc/library/getopt.rst python/branches/tlee-ast-optimize/Doc/library/gettext.rst python/branches/tlee-ast-optimize/Doc/library/gl.rst python/branches/tlee-ast-optimize/Doc/library/gzip.rst python/branches/tlee-ast-optimize/Doc/library/hashlib.rst python/branches/tlee-ast-optimize/Doc/library/heapq.rst python/branches/tlee-ast-optimize/Doc/library/htmllib.rst python/branches/tlee-ast-optimize/Doc/library/idle.rst python/branches/tlee-ast-optimize/Doc/library/imageop.rst python/branches/tlee-ast-optimize/Doc/library/imgfile.rst python/branches/tlee-ast-optimize/Doc/library/io.rst python/branches/tlee-ast-optimize/Doc/library/itertools.rst python/branches/tlee-ast-optimize/Doc/library/jpeg.rst python/branches/tlee-ast-optimize/Doc/library/json.rst python/branches/tlee-ast-optimize/Doc/library/locale.rst python/branches/tlee-ast-optimize/Doc/library/logging.rst python/branches/tlee-ast-optimize/Doc/library/macos.rst python/branches/tlee-ast-optimize/Doc/library/mailbox.rst python/branches/tlee-ast-optimize/Doc/library/marshal.rst python/branches/tlee-ast-optimize/Doc/library/math.rst python/branches/tlee-ast-optimize/Doc/library/mhlib.rst python/branches/tlee-ast-optimize/Doc/library/mmap.rst python/branches/tlee-ast-optimize/Doc/library/msvcrt.rst python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst python/branches/tlee-ast-optimize/Doc/library/mutex.rst python/branches/tlee-ast-optimize/Doc/library/new.rst python/branches/tlee-ast-optimize/Doc/library/nntplib.rst python/branches/tlee-ast-optimize/Doc/library/numbers.rst python/branches/tlee-ast-optimize/Doc/library/operator.rst python/branches/tlee-ast-optimize/Doc/library/optparse.rst python/branches/tlee-ast-optimize/Doc/library/os.rst python/branches/tlee-ast-optimize/Doc/library/ossaudiodev.rst python/branches/tlee-ast-optimize/Doc/library/othergui.rst python/branches/tlee-ast-optimize/Doc/library/parser.rst python/branches/tlee-ast-optimize/Doc/library/pdb.rst python/branches/tlee-ast-optimize/Doc/library/pickle.rst python/branches/tlee-ast-optimize/Doc/library/popen2.rst python/branches/tlee-ast-optimize/Doc/library/profile.rst python/branches/tlee-ast-optimize/Doc/library/pydoc.rst python/branches/tlee-ast-optimize/Doc/library/pyexpat.rst python/branches/tlee-ast-optimize/Doc/library/random.rst python/branches/tlee-ast-optimize/Doc/library/re.rst python/branches/tlee-ast-optimize/Doc/library/repr.rst python/branches/tlee-ast-optimize/Doc/library/rexec.rst python/branches/tlee-ast-optimize/Doc/library/rlcompleter.rst python/branches/tlee-ast-optimize/Doc/library/robotparser.rst python/branches/tlee-ast-optimize/Doc/library/sched.rst python/branches/tlee-ast-optimize/Doc/library/sgmllib.rst python/branches/tlee-ast-optimize/Doc/library/shutil.rst python/branches/tlee-ast-optimize/Doc/library/signal.rst python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst python/branches/tlee-ast-optimize/Doc/library/smtplib.rst python/branches/tlee-ast-optimize/Doc/library/socket.rst python/branches/tlee-ast-optimize/Doc/library/socketserver.rst python/branches/tlee-ast-optimize/Doc/library/sqlite3.rst python/branches/tlee-ast-optimize/Doc/library/ssl.rst python/branches/tlee-ast-optimize/Doc/library/statvfs.rst python/branches/tlee-ast-optimize/Doc/library/stdtypes.rst python/branches/tlee-ast-optimize/Doc/library/string.rst python/branches/tlee-ast-optimize/Doc/library/stringio.rst python/branches/tlee-ast-optimize/Doc/library/subprocess.rst python/branches/tlee-ast-optimize/Doc/library/sunaudio.rst python/branches/tlee-ast-optimize/Doc/library/sys.rst python/branches/tlee-ast-optimize/Doc/library/tempfile.rst python/branches/tlee-ast-optimize/Doc/library/tk.rst python/branches/tlee-ast-optimize/Doc/library/tkinter.rst python/branches/tlee-ast-optimize/Doc/library/trace.rst python/branches/tlee-ast-optimize/Doc/library/traceback.rst python/branches/tlee-ast-optimize/Doc/library/turtle.rst python/branches/tlee-ast-optimize/Doc/library/undoc.rst python/branches/tlee-ast-optimize/Doc/library/unicodedata.rst python/branches/tlee-ast-optimize/Doc/library/unittest.rst python/branches/tlee-ast-optimize/Doc/library/urllib.rst python/branches/tlee-ast-optimize/Doc/library/urllib2.rst python/branches/tlee-ast-optimize/Doc/library/urlparse.rst python/branches/tlee-ast-optimize/Doc/library/warnings.rst python/branches/tlee-ast-optimize/Doc/library/webbrowser.rst python/branches/tlee-ast-optimize/Doc/library/winsound.rst python/branches/tlee-ast-optimize/Doc/library/wsgiref.rst python/branches/tlee-ast-optimize/Doc/library/xml.etree.elementtree.rst python/branches/tlee-ast-optimize/Doc/library/xmlrpclib.rst python/branches/tlee-ast-optimize/Doc/library/zipfile.rst python/branches/tlee-ast-optimize/Doc/library/zipimport.rst python/branches/tlee-ast-optimize/Doc/library/zlib.rst python/branches/tlee-ast-optimize/Doc/license.rst python/branches/tlee-ast-optimize/Doc/make.bat python/branches/tlee-ast-optimize/Doc/reference/datamodel.rst python/branches/tlee-ast-optimize/Doc/reference/expressions.rst python/branches/tlee-ast-optimize/Doc/reference/lexical_analysis.rst python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst python/branches/tlee-ast-optimize/Doc/tools/ (props changed) python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html python/branches/tlee-ast-optimize/Doc/tools/sphinxext/pyspecific.py python/branches/tlee-ast-optimize/Doc/tutorial/classes.rst python/branches/tlee-ast-optimize/Doc/tutorial/controlflow.rst python/branches/tlee-ast-optimize/Doc/tutorial/datastructures.rst python/branches/tlee-ast-optimize/Doc/tutorial/errors.rst python/branches/tlee-ast-optimize/Doc/tutorial/index.rst python/branches/tlee-ast-optimize/Doc/tutorial/inputoutput.rst python/branches/tlee-ast-optimize/Doc/tutorial/interpreter.rst python/branches/tlee-ast-optimize/Doc/tutorial/introduction.rst python/branches/tlee-ast-optimize/Doc/tutorial/modules.rst python/branches/tlee-ast-optimize/Doc/tutorial/stdlib.rst python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst python/branches/tlee-ast-optimize/Doc/tutorial/whatnow.rst python/branches/tlee-ast-optimize/Doc/using/cmdline.rst python/branches/tlee-ast-optimize/Doc/using/unix.rst python/branches/tlee-ast-optimize/Doc/using/windows.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.0.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.1.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.3.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.4.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.5.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.7.rst python/branches/tlee-ast-optimize/Include/abstract.h python/branches/tlee-ast-optimize/Include/object.h python/branches/tlee-ast-optimize/Include/opcode.h python/branches/tlee-ast-optimize/Include/pymacconfig.h python/branches/tlee-ast-optimize/Include/pymath.h python/branches/tlee-ast-optimize/Include/pyport.h python/branches/tlee-ast-optimize/Include/unicodeobject.h python/branches/tlee-ast-optimize/LICENSE python/branches/tlee-ast-optimize/Lib/_abcoll.py python/branches/tlee-ast-optimize/Lib/ast.py python/branches/tlee-ast-optimize/Lib/bdb.py python/branches/tlee-ast-optimize/Lib/cgi.py python/branches/tlee-ast-optimize/Lib/collections.py python/branches/tlee-ast-optimize/Lib/compiler/misc.py python/branches/tlee-ast-optimize/Lib/compiler/pyassem.py python/branches/tlee-ast-optimize/Lib/compiler/pycodegen.py python/branches/tlee-ast-optimize/Lib/compiler/symbols.py python/branches/tlee-ast-optimize/Lib/compiler/transformer.py python/branches/tlee-ast-optimize/Lib/compiler/visitor.py python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py python/branches/tlee-ast-optimize/Lib/ctypes/util.py python/branches/tlee-ast-optimize/Lib/decimal.py python/branches/tlee-ast-optimize/Lib/dis.py python/branches/tlee-ast-optimize/Lib/distutils/ccompiler.py python/branches/tlee-ast-optimize/Lib/distutils/command/register.py python/branches/tlee-ast-optimize/Lib/distutils/command/sdist.py python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py python/branches/tlee-ast-optimize/Lib/distutils/config.py python/branches/tlee-ast-optimize/Lib/distutils/dist.py python/branches/tlee-ast-optimize/Lib/distutils/msvc9compiler.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_config.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_dist.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_upload.py python/branches/tlee-ast-optimize/Lib/distutils/util.py python/branches/tlee-ast-optimize/Lib/doctest.py python/branches/tlee-ast-optimize/Lib/fractions.py python/branches/tlee-ast-optimize/Lib/getopt.py python/branches/tlee-ast-optimize/Lib/gzip.py python/branches/tlee-ast-optimize/Lib/heapq.py python/branches/tlee-ast-optimize/Lib/httplib.py python/branches/tlee-ast-optimize/Lib/idlelib/NEWS.txt python/branches/tlee-ast-optimize/Lib/idlelib/help.txt python/branches/tlee-ast-optimize/Lib/idlelib/macosxSupport.py python/branches/tlee-ast-optimize/Lib/inspect.py python/branches/tlee-ast-optimize/Lib/io.py python/branches/tlee-ast-optimize/Lib/lib-tk/ScrolledText.py python/branches/tlee-ast-optimize/Lib/lib-tk/tkColorChooser.py python/branches/tlee-ast-optimize/Lib/lib2to3/ (props changed) python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_base.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_util.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_apply.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_execfile.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_has_key.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports2.py (contents, props changed) python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_intern.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_long.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_repr.py python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_urllib.py (contents, props changed) python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_xrange.py python/branches/tlee-ast-optimize/Lib/lib2to3/main.py python/branches/tlee-ast-optimize/Lib/lib2to3/pgen2/driver.py python/branches/tlee-ast-optimize/Lib/lib2to3/pygram.py python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/infinite_recursion.py (props changed) python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/py3_test_grammar.py python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_util.py python/branches/tlee-ast-optimize/Lib/linecache.py python/branches/tlee-ast-optimize/Lib/logging/__init__.py python/branches/tlee-ast-optimize/Lib/logging/handlers.py python/branches/tlee-ast-optimize/Lib/opcode.py python/branches/tlee-ast-optimize/Lib/pdb.py python/branches/tlee-ast-optimize/Lib/plat-mac/EasyDialogs.py python/branches/tlee-ast-optimize/Lib/plat-mac/bundlebuilder.py python/branches/tlee-ast-optimize/Lib/plat-mac/macostools.py python/branches/tlee-ast-optimize/Lib/plat-mac/videoreader.py python/branches/tlee-ast-optimize/Lib/pydoc.py python/branches/tlee-ast-optimize/Lib/random.py python/branches/tlee-ast-optimize/Lib/re.py python/branches/tlee-ast-optimize/Lib/runpy.py python/branches/tlee-ast-optimize/Lib/ssl.py python/branches/tlee-ast-optimize/Lib/subprocess.py python/branches/tlee-ast-optimize/Lib/tarfile.py python/branches/tlee-ast-optimize/Lib/test/decimaltestdata/extra.decTest python/branches/tlee-ast-optimize/Lib/test/list_tests.py python/branches/tlee-ast-optimize/Lib/test/pickletester.py python/branches/tlee-ast-optimize/Lib/test/test_array.py python/branches/tlee-ast-optimize/Lib/test/test_ast.py python/branches/tlee-ast-optimize/Lib/test/test_bytes.py python/branches/tlee-ast-optimize/Lib/test/test_bz2.py python/branches/tlee-ast-optimize/Lib/test/test_capi.py python/branches/tlee-ast-optimize/Lib/test/test_cgi.py python/branches/tlee-ast-optimize/Lib/test/test_cmd_line_script.py python/branches/tlee-ast-optimize/Lib/test/test_collections.py python/branches/tlee-ast-optimize/Lib/test/test_datetime.py python/branches/tlee-ast-optimize/Lib/test/test_decimal.py python/branches/tlee-ast-optimize/Lib/test/test_deque.py python/branches/tlee-ast-optimize/Lib/test/test_dict.py python/branches/tlee-ast-optimize/Lib/test/test_dis.py python/branches/tlee-ast-optimize/Lib/test/test_doctest.py python/branches/tlee-ast-optimize/Lib/test/test_file.py python/branches/tlee-ast-optimize/Lib/test/test_fileio.py python/branches/tlee-ast-optimize/Lib/test/test_fractions.py python/branches/tlee-ast-optimize/Lib/test/test_generators.py python/branches/tlee-ast-optimize/Lib/test/test_getopt.py python/branches/tlee-ast-optimize/Lib/test/test_gzip.py python/branches/tlee-ast-optimize/Lib/test/test_hash.py python/branches/tlee-ast-optimize/Lib/test/test_hotshot.py python/branches/tlee-ast-optimize/Lib/test/test_import.py python/branches/tlee-ast-optimize/Lib/test/test_inspect.py python/branches/tlee-ast-optimize/Lib/test/test_int.py python/branches/tlee-ast-optimize/Lib/test/test_io.py python/branches/tlee-ast-optimize/Lib/test/test_iter.py python/branches/tlee-ast-optimize/Lib/test/test_itertools.py python/branches/tlee-ast-optimize/Lib/test/test_logging.py python/branches/tlee-ast-optimize/Lib/test/test_long.py python/branches/tlee-ast-optimize/Lib/test/test_macos.py python/branches/tlee-ast-optimize/Lib/test/test_os.py python/branches/tlee-ast-optimize/Lib/test/test_parser.py python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py python/branches/tlee-ast-optimize/Lib/test/test_set.py python/branches/tlee-ast-optimize/Lib/test/test_struct.py python/branches/tlee-ast-optimize/Lib/test/test_subprocess.py python/branches/tlee-ast-optimize/Lib/test/test_sys.py python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py python/branches/tlee-ast-optimize/Lib/test/test_textwrap.py python/branches/tlee-ast-optimize/Lib/test/test_unittest.py python/branches/tlee-ast-optimize/Lib/test/test_urllib2.py python/branches/tlee-ast-optimize/Lib/test/test_urllib2_localnet.py python/branches/tlee-ast-optimize/Lib/test/test_urllibnet.py python/branches/tlee-ast-optimize/Lib/test/test_with.py python/branches/tlee-ast-optimize/Lib/test/test_xmlrpc.py python/branches/tlee-ast-optimize/Lib/test/test_zipfile.py python/branches/tlee-ast-optimize/Lib/test/test_zipimport.py python/branches/tlee-ast-optimize/Lib/textwrap.py python/branches/tlee-ast-optimize/Lib/unittest.py python/branches/tlee-ast-optimize/Lib/urllib.py python/branches/tlee-ast-optimize/Lib/urllib2.py python/branches/tlee-ast-optimize/Lib/xmlrpclib.py python/branches/tlee-ast-optimize/Lib/zipfile.py python/branches/tlee-ast-optimize/Mac/IDLE/Makefile.in python/branches/tlee-ast-optimize/Mac/Modules/MacOS.c python/branches/tlee-ast-optimize/Mac/PythonLauncher/Makefile.in python/branches/tlee-ast-optimize/Makefile.pre.in python/branches/tlee-ast-optimize/Misc/ACKS python/branches/tlee-ast-optimize/Misc/NEWS python/branches/tlee-ast-optimize/Misc/build.sh python/branches/tlee-ast-optimize/Misc/developers.txt python/branches/tlee-ast-optimize/Misc/python.man python/branches/tlee-ast-optimize/Modules/_collectionsmodule.c python/branches/tlee-ast-optimize/Modules/_ctypes/callproc.c python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c python/branches/tlee-ast-optimize/Modules/_fileio.c python/branches/tlee-ast-optimize/Modules/_hotshot.c python/branches/tlee-ast-optimize/Modules/_struct.c python/branches/tlee-ast-optimize/Modules/_testcapimodule.c python/branches/tlee-ast-optimize/Modules/_tkinter.c python/branches/tlee-ast-optimize/Modules/bz2module.c python/branches/tlee-ast-optimize/Modules/cPickle.c python/branches/tlee-ast-optimize/Modules/dbmmodule.c python/branches/tlee-ast-optimize/Modules/gcmodule.c python/branches/tlee-ast-optimize/Modules/itertoolsmodule.c python/branches/tlee-ast-optimize/Modules/main.c python/branches/tlee-ast-optimize/Modules/mathmodule.c python/branches/tlee-ast-optimize/Modules/parsermodule.c python/branches/tlee-ast-optimize/Modules/posixmodule.c python/branches/tlee-ast-optimize/Modules/socketmodule.c python/branches/tlee-ast-optimize/Modules/zipimport.c python/branches/tlee-ast-optimize/Objects/abstract.c python/branches/tlee-ast-optimize/Objects/bytearrayobject.c python/branches/tlee-ast-optimize/Objects/dictobject.c python/branches/tlee-ast-optimize/Objects/fileobject.c python/branches/tlee-ast-optimize/Objects/frameobject.c python/branches/tlee-ast-optimize/Objects/intobject.c python/branches/tlee-ast-optimize/Objects/listobject.c python/branches/tlee-ast-optimize/Objects/longobject.c python/branches/tlee-ast-optimize/Objects/object.c python/branches/tlee-ast-optimize/Objects/setobject.c python/branches/tlee-ast-optimize/Objects/stringlib/transmogrify.h python/branches/tlee-ast-optimize/Objects/stringobject.c python/branches/tlee-ast-optimize/Objects/tupleobject.c python/branches/tlee-ast-optimize/Objects/typeobject.c python/branches/tlee-ast-optimize/Objects/unicodeobject.c python/branches/tlee-ast-optimize/PC/VC6/_bsddb.dsp python/branches/tlee-ast-optimize/PC/VC6/_tkinter.dsp python/branches/tlee-ast-optimize/PC/VC6/bz2.dsp python/branches/tlee-ast-optimize/PC/VC6/pythoncore.dsp python/branches/tlee-ast-optimize/PC/VC6/readme.txt python/branches/tlee-ast-optimize/PC/VS7.1/pythoncore.vcproj python/branches/tlee-ast-optimize/PC/VS7.1/readme.txt python/branches/tlee-ast-optimize/PC/VS8.0/build_ssl.bat python/branches/tlee-ast-optimize/PC/VS8.0/pyproject.vsprops python/branches/tlee-ast-optimize/PC/VS8.0/pythoncore.vcproj python/branches/tlee-ast-optimize/PC/_winreg.c python/branches/tlee-ast-optimize/PC/example_nt/example.vcproj python/branches/tlee-ast-optimize/PC/msvcrtmodule.c python/branches/tlee-ast-optimize/PC/os2emx/Makefile python/branches/tlee-ast-optimize/PC/os2emx/README.os2emx python/branches/tlee-ast-optimize/PC/os2vacpp/makefile python/branches/tlee-ast-optimize/PC/os2vacpp/makefile.omk python/branches/tlee-ast-optimize/PC/os2vacpp/python.def python/branches/tlee-ast-optimize/PC/pyconfig.h python/branches/tlee-ast-optimize/PCbuild/build_ssl.bat python/branches/tlee-ast-optimize/PCbuild/pythoncore.vcproj python/branches/tlee-ast-optimize/Parser/asdl.py python/branches/tlee-ast-optimize/Parser/printgrammar.c python/branches/tlee-ast-optimize/Python/ast.c python/branches/tlee-ast-optimize/Python/ceval.c python/branches/tlee-ast-optimize/Python/compile.c python/branches/tlee-ast-optimize/Python/getargs.c python/branches/tlee-ast-optimize/Python/getcopyright.c python/branches/tlee-ast-optimize/Python/graminit.c python/branches/tlee-ast-optimize/Python/import.c python/branches/tlee-ast-optimize/Python/pythonrun.c python/branches/tlee-ast-optimize/Python/sysmodule.c python/branches/tlee-ast-optimize/Python/thread.c python/branches/tlee-ast-optimize/Python/thread_nt.h python/branches/tlee-ast-optimize/README python/branches/tlee-ast-optimize/RISCOS/Makefile python/branches/tlee-ast-optimize/Tools/msi/crtlicense.txt python/branches/tlee-ast-optimize/Tools/msi/msi.py python/branches/tlee-ast-optimize/Tools/msi/uuids.py python/branches/tlee-ast-optimize/Tools/pybench/Lists.py python/branches/tlee-ast-optimize/Tools/scripts/patchcheck.py python/branches/tlee-ast-optimize/configure python/branches/tlee-ast-optimize/configure.in python/branches/tlee-ast-optimize/pyconfig.h.in python/branches/tlee-ast-optimize/setup.py Modified: python/branches/tlee-ast-optimize/Doc/ACKS.txt ============================================================================== --- python/branches/tlee-ast-optimize/Doc/ACKS.txt (original) +++ python/branches/tlee-ast-optimize/Doc/ACKS.txt Wed Jan 14 13:24:17 2009 @@ -60,6 +60,7 @@ * Peter Funk * Lele Gaifax * Matthew Gallagher + * Gabriel Genellina * Ben Gertzfield * Nadim Ghaznavi * Jonathan Giddy Modified: python/branches/tlee-ast-optimize/Doc/Makefile ============================================================================== --- python/branches/tlee-ast-optimize/Doc/Makefile (original) +++ python/branches/tlee-ast-optimize/Doc/Makefile Wed Jan 14 13:24:17 2009 @@ -9,12 +9,12 @@ SPHINXOPTS = PAPER = SOURCES = -DISTVERSION = +DISTVERSION = $(shell $(PYTHON) tools/sphinxext/patchlevel.py) ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html htmlhelp clean coverage dist +.PHONY: help checkout update build html htmlhelp clean coverage dist check help: @echo "Please use \`make ' where is one of" @@ -24,6 +24,7 @@ @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" + @echo " suspicious to check for suspicious markup in output text" @echo " coverage to check documentation coverage for library and C API" @echo " dist to create a \"dist\" directory with archived docs for download" @@ -36,9 +37,9 @@ echo "Checking out Docutils..."; \ svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \ fi - @if [ ! -d tools/jinja ]; then \ + @if [ ! -d tools/jinja2 ]; then \ echo "Checking out Jinja..."; \ - svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \ + svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \ fi @if [ ! -d tools/pygments ]; then \ echo "Checking out Pygments..."; \ @@ -48,7 +49,7 @@ update: checkout svn update tools/sphinx svn update tools/docutils - svn update tools/jinja + svn update tools/jinja2 svn update tools/pygments build: checkout @@ -84,6 +85,11 @@ @echo "Link check complete; look for any errors in the above output " \ "or in build/$(BUILDER)/output.txt" +suspicious: BUILDER = suspicious +suspicious: build + @echo "Suspicious check complete; look for any errors in the above output " \ + "or in build/$(BUILDER)/suspicious.txt" + coverage: BUILDER = coverage coverage: build @echo "Coverage finished; see c.txt and python.txt in build/coverage" @@ -111,33 +117,35 @@ # archive the HTML make html - cp -pPR build/html dist/python$(DISTVERSION)-docs-html - tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html - bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar - (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html) - rm -r dist/python$(DISTVERSION)-docs-html - rm dist/python$(DISTVERSION)-docs-html.tar + cp -pPR build/html dist/python-$(DISTVERSION)-docs-html + tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html + bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar + (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html) + rm -r dist/python-$(DISTVERSION)-docs-html + rm dist/python-$(DISTVERSION)-docs-html.tar # archive the text build make text - cp -pPR build/text dist/python$(DISTVERSION)-docs-text - tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text - bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar - (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text) - rm -r dist/python$(DISTVERSION)-docs-text - rm dist/python$(DISTVERSION)-docs-text.tar + cp -pPR build/text dist/python-$(DISTVERSION)-docs-text + tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text + bzip2 -9 -k dist/python-$(DISTVERSION)-docs-text.tar + (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text) + rm -r dist/python-$(DISTVERSION)-docs-text + rm dist/python-$(DISTVERSION)-docs-text.tar # archive the A4 latex -rm -r build/latex make latex PAPER=a4 (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) - cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-a4.zip - cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-a4.tar.bz2 + cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip + cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2 # archive the letter latex rm -r build/latex make latex PAPER=letter (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) - cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-letter.zip - cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-letter.tar.bz2 + cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip + cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 +check: + $(PYTHON) tools/rstlint.py -i tools Modified: python/branches/tlee-ast-optimize/Doc/README.txt ============================================================================== --- python/branches/tlee-ast-optimize/Doc/README.txt (original) +++ python/branches/tlee-ast-optimize/Doc/README.txt Wed Jan 14 13:24:17 2009 @@ -76,8 +76,7 @@ svn co http://svn.python.org/projects/doctools/trunk/sphinx tools/sphinx -Then, you need to install Docutils 0.4 (the SVN snapshot won't work), either -by checking it out via :: +Then, you need to install Docutils, either by checking it out via :: svn co http://svn.python.org/projects/external/docutils-0.4/docutils tools/docutils @@ -94,19 +93,18 @@ python tools/sphinx-build.py -b . build/ -where `` is one of html, web or htmlhelp (for explanations see the make -targets above). +where `` is one of html, text, latex, or htmlhelp (for explanations see +the make targets above). Contributing ============ -For bugs in the content, the online version at http://docs.python.org/ has a -"suggest change" facility that can be used to correct errors in the source text -and submit them as a patch to the maintainers. +Bugs in the content should be reported to the Python bug tracker at +http://bugs.python.org. -Bugs in the toolset should be reported in the Python bug tracker at -http://bugs.python.org/. +Bugs in the toolset should be reported in the Sphinx bug tracker at +http://www.bitbucket.org/birkenfeld/sphinx/issues/. You can also send a mail to the Python Documentation Team at docs at python.org, and we will process your request as soon as possible. Modified: python/branches/tlee-ast-optimize/Doc/c-api/arg.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/arg.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/arg.rst Wed Jan 14 13:24:17 2009 @@ -46,12 +46,12 @@ :ctype:`Py_ssize_t` rather than an int. ``s*`` (string, Unicode, or any buffer compatible object) [Py_buffer \*] - Similar to ``s#``, this code fills a Py_buffer structure provided by the caller. - The buffer gets locked, so that the caller can subsequently use the buffer even - inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling - ``PyBuffer_Release`` with the structure after it has processed the data. + Similar to ``s#``, this code fills a Py_buffer structure provided by the caller. + The buffer gets locked, so that the caller can subsequently use the buffer even + inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling + ``PyBuffer_Release`` with the structure after it has processed the data. - .. versionadded:: 2.6 + .. versionadded:: 2.6 ``z`` (string or ``None``) [const char \*] Like ``s``, but the Python object may also be ``None``, in which case the C @@ -63,7 +63,7 @@ ``z*`` (string or ``None`` or any buffer compatible object) [Py_buffer*] This is to ``s*`` as ``z`` is to ``s``. - .. versionadded:: 2.6 + .. versionadded:: 2.6 ``u`` (Unicode object) [Py_UNICODE \*] Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of @@ -136,8 +136,9 @@ them. Instead, the implementation assumes that the string object uses the encoding passed in as parameter. -``b`` (integer) [char] - Convert a Python integer to a tiny int, stored in a C :ctype:`char`. +``b`` (integer) [unsigned char] + Convert a nonnegative Python integer to an unsigned tiny int, stored in a C + :ctype:`unsigned char`. ``B`` (integer) [unsigned char] Convert a Python integer to a tiny int without overflow checking, stored in a C @@ -251,7 +252,7 @@ or use ``w#`` instead. Only single-segment buffer objects are accepted; :exc:`TypeError` is raised for all others. -``w#`` (read-write character buffer) [char \*, int] +``w#`` (read-write character buffer) [char \*, Py_ssize_t] Like ``s#``, but accepts any object which implements the read-write buffer interface. The :ctype:`char \*` variable is set to point to the first byte of the buffer, and the :ctype:`int` is set to the length of the buffer. Only @@ -260,6 +261,7 @@ ``w*`` (read-write byte-oriented buffer) [Py_buffer \*] This is to ``w`` what ``s*`` is to ``s``. + .. versionadded:: 2.6 ``(items)`` (tuple) [*matching-items*] @@ -297,8 +299,8 @@ ``;`` The list of format units ends here; the string after the semicolon is used as - the error message *instead* of the default error message. Clearly, ``:`` and - ``;`` mutually exclude each other. + the error message *instead* of the default error message. ``:`` and ``;`` + mutually exclude each other. Note that any Python object references which are provided to the caller are *borrowed* references; do not decrement their reference count! @@ -533,3 +535,8 @@ If there is an error in the format string, the :exc:`SystemError` exception is set and *NULL* returned. + +.. cfunction:: PyObject* Py_VaBuildValue(const char *format, va_list vargs) + + Identical to :cfunc:`Py_BuildValue`, except that it accepts a va_list + rather than a variable number of arguments. Modified: python/branches/tlee-ast-optimize/Doc/c-api/buffer.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/buffer.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/buffer.rst Wed Jan 14 13:24:17 2009 @@ -30,7 +30,7 @@ .. index:: single: PyBufferProcs -More information on the buffer interface is provided in the section +More information on the buffer interface is provided in the section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`. A "buffer object" is defined in the :file:`bufferobject.h` header (included by Modified: python/branches/tlee-ast-optimize/Doc/c-api/conversion.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/conversion.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/conversion.rst Wed Jan 14 13:24:17 2009 @@ -77,7 +77,7 @@ .. versionadded:: 2.4 - + .. cfunction:: double PyOS_ascii_atof(const char *nptr) Convert a string to a :ctype:`double` in a locale-independent way. @@ -86,7 +86,7 @@ See the Unix man page :manpage:`atof(2)` for details. - + .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) Case insensitive comparison of strings. The function works almost Modified: python/branches/tlee-ast-optimize/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/exceptions.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/exceptions.rst Wed Jan 14 13:24:17 2009 @@ -73,11 +73,10 @@ .. cfunction:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc) - Return true if the *given* exception matches the exception in *exc*. If *exc* - is a class object, this also returns true when *given* is an instance of a - subclass. If *exc* is a tuple, all exceptions in the tuple (and recursively in - subtuples) are searched for a match. If *given* is *NULL*, a memory access - violation will occur. + Return true if the *given* exception matches the exception in *exc*. If + *exc* is a class object, this also returns true when *given* is an instance + of a subclass. If *exc* is a tuple, all exceptions in the tuple (and + recursively in subtuples) are searched for a match. .. cfunction:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb) Modified: python/branches/tlee-ast-optimize/Doc/c-api/file.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/file.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/file.rst Wed Jan 14 13:24:17 2009 @@ -63,8 +63,8 @@ Return the file object associated with *p* as a :ctype:`FILE\*`. If the caller will ever use the returned :ctype:`FILE\*` object while - the GIL is released it must also call the `PyFile_IncUseCount` and - `PyFile_DecUseCount` functions described below as appropriate. + the GIL is released it must also call the :cfunc:`PyFile_IncUseCount` and + :cfunc:`PyFile_DecUseCount` functions described below as appropriate. .. cfunction:: void PyFile_IncUseCount(PyFileObject \*p) @@ -72,13 +72,13 @@ Increments the PyFileObject's internal use count to indicate that the underlying :ctype:`FILE\*` is being used. This prevents Python from calling f_close() on it from another thread. - Callers of this must call `PyFile_DecUseCount` when they are + Callers of this must call :cfunc:`PyFile_DecUseCount` when they are finished with the :ctype:`FILE\*`. Otherwise the file object will never be closed by Python. The GIL must be held while calling this function. - The suggested use is to call this after `PyFile_AsFile` just before + The suggested use is to call this after :cfunc:`PyFile_AsFile` just before you release the GIL. .. versionadded:: 2.6 @@ -88,7 +88,7 @@ Decrements the PyFileObject's internal unlocked_count member to indicate that the caller is done with its own use of the :ctype:`FILE\*`. - This may only be called to undo a prior call to `PyFile_IncUseCount`. + This may only be called to undo a prior call to :cfunc:`PyFile_IncUseCount`. The GIL must be held while calling this function. Modified: python/branches/tlee-ast-optimize/Doc/c-api/init.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/init.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/init.rst Wed Jan 14 13:24:17 2009 @@ -780,6 +780,50 @@ .. versionadded:: 2.3 + +Asynchronous Notifications +========================== + +A mechanism is provided to make asynchronous notifications to the the main +interpreter thread. These notifications take the form of a function +pointer and a void argument. + +.. index:: single: setcheckinterval() (in module sys) + +Every check interval, when the interpreter lock is released and reacquired, +python will also call any such provided functions. This can be used for +example by asynchronous IO handlers. The notification can be scheduled +from a worker thread and the actual call than made at the earliest +convenience by the main thread where it has possession of the global +interpreter lock and can perform any Python API calls. + +.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) ) + + .. index:: single: Py_AddPendingCall() + + Post a notification to the Python main thread. If successful, + *func* will be called with the argument *arg* at the earliest + convenience. *func* will be called having the global interpreter + lock held and can thus use the full Python API and can take any + action such as setting object attributes to signal IO completion. + It must return 0 on success, or -1 signalling an exception. + The notification function won't be interrupted to perform another + asynchronous notification recursively, + but it can still be interrupted to switch threads if the interpreter + lock is released, for example, if it calls back into python code. + + This function returns 0 on success in which case the notification has been + scheduled. Otherwise, for example if the notification buffer is full, + it returns -1 without setting any exception. + + This function can be called on any thread, be it a Python thread or + some other system thread. If it is a Python thread, it doesen't matter if + it holds the global interpreter lock or not. + + .. versionadded:: 2.7 + + + .. _profiling: Profiling and Tracing @@ -902,7 +946,7 @@ Return a tuple of function call counts. There are constants defined for the positions within the tuple: - + +-------------------------------+-------+ | Name | Value | +===============================+=======+ @@ -928,7 +972,7 @@ +-------------------------------+-------+ | :const:`PCALL_POP` | 10 | +-------------------------------+-------+ - + :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used. Modified: python/branches/tlee-ast-optimize/Doc/c-api/long.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/long.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/long.rst Wed Jan 14 13:24:17 2009 @@ -126,7 +126,7 @@ Return a C :ctype:`long` representation of the contents of *pylong*. If *pylong* is greater than :const:`LONG_MAX`, an :exc:`OverflowError` is raised - and ``-1`` will be returned. + and ``-1`` will be returned. .. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong) Modified: python/branches/tlee-ast-optimize/Doc/c-api/module.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/module.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/module.rst Wed Jan 14 13:24:17 2009 @@ -106,7 +106,7 @@ .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro) - Add an int constant to *module*. The name and the value are taken from + Add an int constant to *module*. The name and the value are taken from *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on error, ``0`` on success. Modified: python/branches/tlee-ast-optimize/Doc/c-api/reflection.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/reflection.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/reflection.rst Wed Jan 14 13:24:17 2009 @@ -15,7 +15,7 @@ Return a dictionary of the local variables in the current execution frame, or *NULL* if no frame is currently executing. - + .. cfunction:: PyObject* PyEval_GetGlobals() Modified: python/branches/tlee-ast-optimize/Doc/c-api/sequence.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/sequence.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/sequence.rst Wed Jan 14 13:24:17 2009 @@ -143,9 +143,9 @@ Return the underlying array of PyObject pointers. Assumes that *o* was returned by :cfunc:`PySequence_Fast` and *o* is not *NULL*. - + Note, if a list gets resized, the reallocation may relocate the items array. - So, only use the underlying array pointer in contexts where the sequence + So, only use the underlying array pointer in contexts where the sequence cannot change. .. versionadded:: 2.4 Modified: python/branches/tlee-ast-optimize/Doc/c-api/set.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/set.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/set.rst Wed Jan 14 13:24:17 2009 @@ -101,7 +101,7 @@ .. versionchanged:: 2.6 Now guaranteed to return a brand-new :class:`frozenset`. Formerly, - frozensets of zero-length were a singleton. This got in the way of + frozensets of zero-length were a singleton. This got in the way of building-up new frozensets with :meth:`PySet_Add`. The following functions and macros are available for instances of :class:`set` Modified: python/branches/tlee-ast-optimize/Doc/c-api/structures.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/structures.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/structures.rst Wed Jan 14 13:24:17 2009 @@ -205,6 +205,68 @@ .. versionadded:: 2.4 +.. ctype:: PyMemberDef + + Structure which describes an attribute of a type which corresponds to a C + struct member. Its fields are: + + +------------------+-------------+-------------------------------+ + | Field | C Type | Meaning | + +==================+=============+===============================+ + | :attr:`name` | char \* | name of the member | + +------------------+-------------+-------------------------------+ + | :attr:`type` | int | the type of the member in the | + | | | C struct | + +------------------+-------------+-------------------------------+ + | :attr:`offset` | Py_ssize_t | the offset in bytes that the | + | | | member is located on the | + | | | type's object struct | + +------------------+-------------+-------------------------------+ + | :attr:`flags` | int | flag bits indicating if the | + | | | field should be read-only or | + | | | writable | + +------------------+-------------+-------------------------------+ + | :attr:`doc` | char \* | points to the contents of the | + | | | docstring | + +------------------+-------------+-------------------------------+ + + :attr:`type` can be one of many ``T_`` macros corresponding to various C + types. When the member is accessed in Python, it will be converted to the + equivalent Python type. + + =============== ================== + Macro name C type + =============== ================== + T_SHORT short + T_INT int + T_LONG long + T_FLOAT float + T_DOUBLE double + T_STRING char \* + T_OBJECT PyObject \* + T_OBJECT_EX PyObject \* + T_CHAR char + T_BYTE char + T_UNBYTE unsigned char + T_UINT unsigned int + T_USHORT unsigned short + T_ULONG unsigned long + T_BOOL char + T_LONGLONG long long + T_ULONGLONG unsigned long long + T_PYSSIZET Py_ssize_t + =============== ================== + + :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that + :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and + :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. + + :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for + read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` + members can be deleted. (They are set to *NULL*). + + .. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name) Return a bound method object for an extension type implemented in C. This can Modified: python/branches/tlee-ast-optimize/Doc/c-api/sys.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/sys.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/sys.rst Wed Jan 14 13:24:17 2009 @@ -15,13 +15,6 @@ one of the strings ``''`` or ``'???'``. -.. cfunction:: long PyOS_GetLastModificationTime(char *filename) - - Return the time of last modification of the file *filename*. The result is - encoded in the same way as the timestamp returned by the standard C library - function :cfunc:`time`. - - .. cfunction:: void PyOS_AfterFork() Function to update some internal state after a process fork; this should be Modified: python/branches/tlee-ast-optimize/Doc/c-api/typeobj.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/typeobj.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/typeobj.rst Wed Jan 14 13:24:17 2009 @@ -743,7 +743,7 @@ :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its base type. -The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_CLASS` flag bit is +The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_ITER` flag bit is set. Modified: python/branches/tlee-ast-optimize/Doc/data/refcounts.dat ============================================================================== --- python/branches/tlee-ast-optimize/Doc/data/refcounts.dat (original) +++ python/branches/tlee-ast-optimize/Doc/data/refcounts.dat Wed Jan 14 13:24:17 2009 @@ -841,9 +841,6 @@ PyNumber_Xor:PyObject*:o1:0: PyNumber_Xor:PyObject*:o2:0: -PyOS_GetLastModificationTime:long::: -PyOS_GetLastModificationTime:char*:filename:: - PyObject_AsFileDescriptor:int::: PyObject_AsFileDescriptor:PyObject*:o:0: Modified: python/branches/tlee-ast-optimize/Doc/distutils/apiref.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/distutils/apiref.rst (original) +++ python/branches/tlee-ast-optimize/Doc/distutils/apiref.rst Wed Jan 14 13:24:17 2009 @@ -88,9 +88,9 @@ | *options* | default options for the setup | a string | | | script | | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *license* | The license for the package | | + | *license* | The license for the package | a string | +--------------------+--------------------------------+-------------------------------------------------------------+ - | *keywords* | Descriptive meta-data. See | | + | *keywords* | Descriptive meta-data, see | | | | :pep:`314` | | +--------------------+--------------------------------+-------------------------------------------------------------+ | *platforms* | | | @@ -98,6 +98,13 @@ | *cmdclass* | A mapping of command names to | a dictionary | | | :class:`Command` subclasses | | +--------------------+--------------------------------+-------------------------------------------------------------+ + | *data_files* | A list of data files to | a list | + | | install | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + | *package_dir* | A mapping of package to | a dictionary | + | | directory names | | + +--------------------+--------------------------------+-------------------------------------------------------------+ + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -181,9 +188,10 @@ | | for C/C++ header files (in | | | | Unix form for portability) | | +------------------------+--------------------------------+---------------------------+ - | *define_macros* | list of macros to define; each | (string,string) tuple or | - | | macro is defined using a | (name,``None``) | - | | 2-tuple, where 'value' is | | + | *define_macros* | list of macros to define; each | (string, string) tuple or | + | | macro is defined using a | (name, ``None``) | + | | 2-tuple ``(name, value)``, | | + | | where *value* is | | | | either the string to define it | | | | to or ``None`` to define it | | | | without a particular value | | @@ -747,7 +755,7 @@ standard output, otherwise do nothing. .. % \subsection{Compiler-specific modules} -.. % +.. % .. % The following modules implement concrete subclasses of the abstract .. % \class{CCompiler} class. They should not be instantiated directly, but should .. % be created using \function{distutils.ccompiler.new_compiler()} factory @@ -851,7 +859,7 @@ Macintosh. Needs work to support CW on Windows or Mac OS X. .. % \subsection{Utility modules} -.. % +.. % .. % The following modules all provide general utility functions. They haven't .. % all been documented yet. @@ -1100,6 +1108,24 @@ For non-POSIX platforms, currently just returns ``sys.platform``. + For MacOS X systems the OS version reflects the minimal version on which + binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` + during the build of Python), not the OS version of the current system. + + For universal binary builds on MacOS X the architecture value reflects + the univeral binary status instead of the architecture of the current + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. + + Examples of returned values on MacOS X: + + * ``macosx-10.3-ppc`` + + * ``macosx-10.3-fat`` + + * ``macosx-10.5-universal`` + .. % XXX isn't this also provided by some other non-distutils module? @@ -1667,7 +1693,7 @@ .. % todo .. % \section{Distutils Commands} -.. % +.. % .. % This part of Distutils implements the various Distutils commands, such .. % as \code{build}, \code{install} \&c. Each command is implemented as a .. % separate module, with the command name as the name of the module. Modified: python/branches/tlee-ast-optimize/Doc/distutils/builtdist.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/distutils/builtdist.rst (original) +++ python/branches/tlee-ast-optimize/Doc/distutils/builtdist.rst Wed Jan 14 13:24:17 2009 @@ -268,13 +268,13 @@ .. % \longprogramopt{spec-file} option; used in conjunction with .. % \longprogramopt{spec-only}, this gives you an opportunity to customize .. % the \file{.spec} file manually: -.. % +.. % .. % \ begin{verbatim} .. % > python setup.py bdist_rpm --spec-only .. % # ...edit dist/FooBar-1.0.spec .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec .. % \ end{verbatim} -.. % +.. % .. % (Although a better way to do this is probably to override the standard .. % \command{bdist\_rpm} command with one that writes whatever else you want .. % to the \file{.spec} file.) @@ -334,31 +334,31 @@ Cross-compiling on Windows ========================== -Starting with Python 2.6, distutils is capable of cross-compiling between -Windows platforms. In practice, this means that with the correct tools +Starting with Python 2.6, distutils is capable of cross-compiling between +Windows platforms. In practice, this means that with the correct tools installed, you can use a 32bit version of Windows to create 64bit extensions and vice-versa. -To build for an alternate platform, specify the :option:`--plat-name` option -to the build command. Valid values are currently 'win32', 'win-amd64' and +To build for an alternate platform, specify the :option:`--plat-name` option +to the build command. Valid values are currently 'win32', 'win-amd64' and 'win-ia64'. For example, on a 32bit version of Windows, you could execute:: python setup.py build --plat-name=win-amd64 -to build a 64bit version of your extension. The Windows Installers also +to build a 64bit version of your extension. The Windows Installers also support this option, so the command:: python setup.py build --plat-name=win-amd64 bdist_wininst would create a 64bit installation executable on your 32bit version of Windows. -To cross-compile, you must download the Python source code and cross-compile +To cross-compile, you must download the Python source code and cross-compile Python itself for the platform you are targetting - it is not possible from a binary installtion of Python (as the .lib etc file for other platforms are -not included.) In practice, this means the user of a 32 bit operating -system will need to use Visual Studio 2008 to open the -:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the -"x64" configuration of the 'pythoncore' project before cross-compiling +not included.) In practice, this means the user of a 32 bit operating +system will need to use Visual Studio 2008 to open the +:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the +"x64" configuration of the 'pythoncore' project before cross-compiling extensions is possible. Note that by default, Visual Studio 2008 does not install 64bit compilers or Modified: python/branches/tlee-ast-optimize/Doc/distutils/configfile.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/distutils/configfile.rst (original) +++ python/branches/tlee-ast-optimize/Doc/distutils/configfile.rst Wed Jan 14 13:24:17 2009 @@ -63,7 +63,7 @@ --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine - --swig-opts list of SWIG command line options + --swig-opts list of SWIG command line options [...] Note that an option spelled :option:`--foo-bar` on the command-line is spelled Modified: python/branches/tlee-ast-optimize/Doc/distutils/packageindex.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/distutils/packageindex.rst (original) +++ python/branches/tlee-ast-optimize/Doc/distutils/packageindex.rst Wed Jan 14 13:24:17 2009 @@ -8,17 +8,17 @@ packaged with distutils. The distutils command :command:`register` is used to submit your distribution's meta-data to the index. It is invoked as follows:: - python setup.py register + python setup.py register Distutils will respond with the following prompt:: - running register - We need to know who you are, so please choose either: - 1. use your existing login, - 2. register as a new user, - 3. have the server generate a new password for you (and email it to you), or - 4. quit - Your selection [default 1]: + running register + We need to know who you are, so please choose either: + 1. use your existing login, + 2. register as a new user, + 3. have the server generate a new password for you (and email it to you), or + 4. quit + Your selection [default 1]: Note: if your username and password are saved locally, you will not see this menu. @@ -55,40 +55,50 @@ The format of the :file:`.pypirc` file is as follows:: - [distutils] - index-servers = - pypi + [distutils] + index-servers = + pypi - [pypi] - repository: - username: - password: + [pypi] + repository: + username: + password: -*repository* can be omitted and defaults to ``http://www.python.org/pypi``. +The *distutils* section defines a *index-servers* variable that lists the +name of all sections describing a repository. -If you want to define another server a new section can be created:: +Each section describing a repository defines three variables: - [distutils] - index-servers = - pypi - other - - [pypi] - repository: - username: - password: +- *repository*, that defines the url of the PyPI server. Defaults to + ``http://www.python.org/pypi``. +- *username*, which is the registered username on the PyPI server. +- *password*, that will be used to authenticate. If omitted the user + will be prompt to type it when needed. - [other] - repository: http://example.com/pypi - username: - password: +If you want to define another server a new section can be created and +listed in the *index-servers* variable:: -The command can then be called with the -r option:: + [distutils] + index-servers = + pypi + other - python setup.py register -r http://example.com/pypi + [pypi] + repository: + username: + password: -Or even with the section name:: + [other] + repository: http://example.com/pypi + username: + password: - python setup.py register -r other +:command:`register` can then be called with the -r option to point the +repository to work with:: - + python setup.py register -r http://example.com/pypi + +The name of the section that describes the repository may also be used +for conveniency:: + + python setup.py register -r other Modified: python/branches/tlee-ast-optimize/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/distutils/setupscript.rst (original) +++ python/branches/tlee-ast-optimize/Doc/distutils/setupscript.rst Wed Jan 14 13:24:17 2009 @@ -213,7 +213,7 @@ this:: setup(..., - ext_modules=[Extension('_foo', ['foo.i'], + ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], ) @@ -563,6 +563,8 @@ +----------------------+---------------------------+-----------------+--------+ | ``classifiers`` | a list of classifiers | list of strings | \(4) | +----------------------+---------------------------+-----------------+--------+ +| ``platforms`` | a list of platforms | list of strings | | ++----------------------+---------------------------+-----------------+--------+ Notes: Modified: python/branches/tlee-ast-optimize/Doc/distutils/uploading.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/distutils/uploading.rst (original) +++ python/branches/tlee-ast-optimize/Doc/distutils/uploading.rst Wed Jan 14 13:24:17 2009 @@ -13,7 +13,7 @@ The command is invoked immediately after building one or more distribution files. For example, the command :: - python setup.py sdist bdist_wininst upload + python setup.py sdist bdist_wininst upload will cause the source distribution and the Windows installer to be uploaded to PyPI. Note that these will be uploaded even if they are built using an earlier @@ -22,11 +22,14 @@ The :command:`upload` command uses the username, password, and repository URL from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this -file). +file). If a :command:`register` command was previously called in the same command, +and if the password was entered in the prompt, :command:`upload` will reuse the +entered password. This is useful if you do not want to store a clear text +password in the :file:`$HOME/.pypirc` file. You can specify another PyPI server with the :option:`--repository=*url*` option:: - python setup.py sdist bdist_wininst upload -r http://example.com/pypi + python setup.py sdist bdist_wininst upload -r http://example.com/pypi See section :ref:`pypirc` for more on defining several servers. @@ -35,9 +38,8 @@ be available for execution on the system :envvar:`PATH`. You can also specify which key to use for signing using the :option:`--identity=*name*` option. -Other :command:`upload` options include :option:`--repository=*url*` -or :option:`--repository=*section*` where `url` is the url of the server -and `section` the name of the section in :file:`$HOME/.pypirc`, and +Other :command:`upload` options include :option:`--repository=` or +:option:`--repository=

    ` where *url* is the url of the server and +*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). - Modified: python/branches/tlee-ast-optimize/Doc/documenting/markup.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/documenting/markup.rst (original) +++ python/branches/tlee-ast-optimize/Doc/documenting/markup.rst Wed Jan 14 13:24:17 2009 @@ -508,7 +508,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. .. describe:: var @@ -599,7 +599,7 @@ Example:: .. versionadded:: 2.5 - The `spam` parameter. + The *spam* parameter. Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. @@ -760,14 +760,14 @@ Blank lines are not allowed within ``productionlist`` directive arguments. The definition can contain token names which are marked as interpreted text - (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references + (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references to the productions of these tokens. Note that no further reST parsing is done in the production, so that you don't have to escape ``*`` or ``|`` characters. -.. XXX describe optional first parameter +.. XXX describe optional first parameter The following is an example taken from the Python Reference Manual:: Modified: python/branches/tlee-ast-optimize/Doc/documenting/rest.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/documenting/rest.rst (original) +++ python/branches/tlee-ast-optimize/Doc/documenting/rest.rst Wed Jan 14 13:24:17 2009 @@ -98,7 +98,7 @@ ----------- Literal code blocks are introduced by ending a paragraph with the special marker -``::``. The literal block must be indented, to be able to include blank lines:: +``::``. The literal block must be indented:: This is a normal text paragraph. The next paragraph is a code sample:: Modified: python/branches/tlee-ast-optimize/Doc/extending/building.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/extending/building.rst (original) +++ python/branches/tlee-ast-optimize/Doc/extending/building.rst Wed Jan 14 13:24:17 2009 @@ -39,7 +39,7 @@ With this :file:`setup.py`, and a file :file:`demo.c`, running :: - python setup.py build + python setup.py build will compile :file:`demo.c`, and produce an extension module named ``demo`` in the :file:`build` directory. Depending on the system, the module file will end Modified: python/branches/tlee-ast-optimize/Doc/extending/extending.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/extending/extending.rst (original) +++ python/branches/tlee-ast-optimize/Doc/extending/extending.rst Wed Jan 14 13:24:17 2009 @@ -471,7 +471,7 @@ :cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of -arguments. To call the Python function with no arguments, pass in NULL, or +arguments. To call the Python function with no arguments, pass in NULL, or an empty tuple; to call it with one argument, pass a singleton tuple. :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example:: @@ -510,7 +510,7 @@ if (result == NULL) return NULL; /* Pass error back */ ...use result... - Py_DECREF(result); + Py_DECREF(result); Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases @@ -535,7 +535,7 @@ the error check! Also note that strictly speaking this code is not complete: :cfunc:`Py_BuildValue` may run out of memory, and this should be checked. -You may also call a function with keyword arguments by using +You may also call a function with keyword arguments by using :cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. :: @@ -671,7 +671,7 @@ static PyObject * keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) - { + { int voltage; char *state = "a stiff"; char *action = "voom"; @@ -679,11 +679,11 @@ static char *kwlist[] = {"voltage", "state", "action", "type", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, &voltage, &state, &action, &type)) - return NULL; + return NULL; - printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", + printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", action, voltage); printf("-- Lovely plumage, the %s -- It's %s!\n", type, state); @@ -865,7 +865,7 @@ The advantage of borrowing over owning a reference is that you don't need to take care of disposing of the reference on all possible paths through the code --- in other words, with a borrowed reference you don't run the risk of leaking -when a premature exit is taken. The disadvantage of borrowing over leaking is +when a premature exit is taken. The disadvantage of borrowing over owning is that there are some subtle situations where in seemingly correct code a borrowed reference can be used after the owner from which it was borrowed has in fact disposed of it. Modified: python/branches/tlee-ast-optimize/Doc/extending/newtypes.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/extending/newtypes.rst (original) +++ python/branches/tlee-ast-optimize/Doc/extending/newtypes.rst Wed Jan 14 13:24:17 2009 @@ -840,8 +840,8 @@ previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -854,10 +854,10 @@ static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -876,18 +876,18 @@ PyMODINIT_FUNC initshoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return; - - m = Py_InitModule3("shoddy", NULL, "Shoddy module"); - if (m == NULL) - return; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return; + + m = Py_InitModule3("shoddy", NULL, "Shoddy module"); + if (m == NULL) + return; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1167,7 +1167,7 @@ typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; @@ -1234,7 +1234,7 @@ of *NULL* is required. .. XXX Descriptors need to be explained in more detail somewhere, but not here. - + Descriptor objects have two handler functions which correspond to the \member{tp_getattro} and \member{tp_setattro} handlers. The \method{__get__()} handler is a function which is passed the descriptor, Modified: python/branches/tlee-ast-optimize/Doc/extending/windows.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/extending/windows.rst (original) +++ python/branches/tlee-ast-optimize/Doc/extending/windows.rst Wed Jan 14 13:24:17 2009 @@ -102,7 +102,7 @@ and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its first argument (use the minimal :file:`example.c` in this directory as a guide). By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. - The output file should be called :file:`spam.pyd` (in Release mode) or + The output file should be called :file:`spam.pyd` (in Release mode) or :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. Modified: python/branches/tlee-ast-optimize/Doc/glossary.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/glossary.rst (original) +++ python/branches/tlee-ast-optimize/Doc/glossary.rst Wed Jan 14 13:24:17 2009 @@ -11,7 +11,7 @@ ``>>>`` The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter. - + ``...`` The default Python prompt of the interactive shell when entering code for an indented code block or within a pair of matching left and right @@ -50,11 +50,11 @@ A value associated with an object which is referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. - + BDFL Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator. - + bytecode Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in @@ -67,11 +67,11 @@ A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class. - + classic class Any class which does not inherit from :class:`object`. See :term:`new-style class`. Classic classes will be removed in Python 3.0. - + coercion The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, @@ -84,7 +84,7 @@ ``operator.add(3.0, 4.5)``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. - + complex number An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary @@ -96,7 +96,7 @@ :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them. - + context manager An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. @@ -123,6 +123,9 @@ def f(...): ... + See :ref:`the documentation for function definition ` for more + about decorators. + descriptor Any *new-style* object which defines the methods :meth:`__get__`, :meth:`__set__`, or :meth:`__delete__`. When a class attribute is a @@ -135,7 +138,7 @@ class methods, static methods, and reference to super classes. For more information about descriptors' methods, see :ref:`descriptors`. - + dictionary An associative array, where arbitrary keys are mapped to values. The use of :class:`dict` closely resembles that for :class:`list`, but the keys can @@ -149,8 +152,8 @@ of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object. - - duck-typing + + duck-typing A pythonic programming style which determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it @@ -160,13 +163,13 @@ :func:`isinstance`. (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming. - + EAFP Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` - statements. The technique contrasts with the :term:`LBYL` style + statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C. expression @@ -192,14 +195,14 @@ which are not compatible with the current interpreter. For example, the expression ``11/4`` currently evaluates to ``2``. If the module in which it is executed had enabled *true division* by executing:: - + from __future__ import division - + the expression ``11/4`` would evaluate to ``2.75``. By importing the :mod:`__future__` module and evaluating its variables, you can see when a new feature was first added to the language and when it will become the default:: - + >>> import __future__ >>> __future__.division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) @@ -208,7 +211,7 @@ The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. - + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -218,21 +221,21 @@ stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the :meth:`next` method of the returned iterator. - + .. index:: single: generator expression - + generator expression An expression that returns a generator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: - + >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285 - + GIL See :term:`global interpreter lock`. - + global interpreter lock The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. @@ -258,21 +261,21 @@ containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`. - + IDLE An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application. - + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary. - + integer division Mathematical division discarding any remainder. For example, the expression ``11/4`` currently evaluates to ``2`` in contrast to the @@ -284,7 +287,7 @@ divided by a float will result in a float value, possibly with a decimal fraction. Integer division can be forced by using the ``//`` operator instead of the ``/`` operator. See also :term:`__future__`. - + interactive Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately @@ -292,7 +295,7 @@ arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). - + interpreted Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the @@ -301,7 +304,7 @@ Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`. - + iterable A container object capable of returning its members one at a time. Examples of iterables include all sequence types (such as @@ -317,7 +320,7 @@ statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`. - + iterator An object representing a stream of data. Repeated calls to the iterator's :meth:`next` method return successive items in the stream. When no more @@ -332,7 +335,7 @@ :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container. - + More information can be found in :ref:`typeiter`. keyword argument @@ -356,7 +359,7 @@ A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1). - + list comprehension A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ["0x%02x" % x for x in @@ -364,11 +367,11 @@ even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed. - + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. - + metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for @@ -387,7 +390,7 @@ of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`. - + mutable Mutable objects can change their value but keep their :func:`id`. See also :term:`immutable`. @@ -404,7 +407,7 @@ :func:`collections.namedtuple`. The latter approach automatically provides extra features such as a self-documenting representation like ``Employee(name='jones', title='programmer')``. - + namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and builtin namespaces as well @@ -416,7 +419,7 @@ :func:`random.seed` or :func:`itertools.izip` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively. - + nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to @@ -424,7 +427,7 @@ reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. - + new-style class Any class which inherits from :class:`object`. This includes all built-in types like :class:`list` and :class:`dict`. Only new-style classes can @@ -437,7 +440,7 @@ Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`. - + positional argument The arguments assigned to local names inside a function or method, determined by the order in which they were given in the call. ``*`` is @@ -445,7 +448,7 @@ definition), or pass several arguments as a list to a function. See :term:`argument`. - Python 3000 + Python 3000 Nickname for the next major Python version, 3.0 (coined long ago when the release of version 3 was something in the distant future.) This is also abbreviated "Py3k". @@ -457,7 +460,7 @@ to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:: - + for i in range(len(food)): print food[i] @@ -480,7 +483,7 @@ dictionaries. Though popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. - + sequence An :term:`iterable` which supports efficient element access using integer indices via the :meth:`__getitem__` special method and defines a @@ -498,6 +501,12 @@ (subscript) notation uses :class:`slice` objects internally (or in older versions, :meth:`__getslice__` and :meth:`__setslice__`). + special method + A method that is called implicitly by Python to execute a certain + operation on a type, such as addition. Such methods have names starting + and ending with double underscores. Special methods are documented in + :ref:`specialnames`. + statement A statement is part of a suite (a "block" of code). A statement is either an :term:`expression` or a one of several constructs with a keyword, such @@ -520,7 +529,7 @@ virtual machine A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler. - + Zen of Python Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing Modified: python/branches/tlee-ast-optimize/Doc/howto/curses.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/curses.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/curses.rst Wed Jan 14 13:24:17 2009 @@ -297,7 +297,7 @@ could code:: stdscr.addstr(0, 0, "Current mode: Typing mode", - curses.A_REVERSE) + curses.A_REVERSE) stdscr.refresh() The curses library also supports color on those terminals that provide it, The @@ -399,8 +399,8 @@ curses.echo() # Enable echoing of characters - # Get a 15-character string, with the cursor on the top line - s = stdscr.getstr(0,0, 15) + # Get a 15-character string, with the cursor on the top line + s = stdscr.getstr(0,0, 15) The Python :mod:`curses.textpad` module supplies something better. With it, you can turn a window into a text box that supports an Emacs-like set of Modified: python/branches/tlee-ast-optimize/Doc/howto/doanddont.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/doanddont.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/doanddont.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ ************************************ - Idioms and Anti-Idioms in Python + Idioms and Anti-Idioms in Python ************************************ :Author: Moshe Zadka @@ -127,7 +127,7 @@ # bar.py from foo import a if something(): - a = 2 # danger: foo.a != a + a = 2 # danger: foo.a != a Good example:: @@ -303,6 +303,6 @@ This version is bulletproof:: - value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + calculate_number(10, 20)*forbulate(500, 360)) Modified: python/branches/tlee-ast-optimize/Doc/howto/functional.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/functional.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/functional.rst Wed Jan 14 13:24:17 2009 @@ -145,7 +145,7 @@ functions are also easier to read and to check for errors. -Ease of debugging and testing +Ease of debugging and testing ----------------------------- Testing and debugging a functional-style program is easier. @@ -213,7 +213,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> Python expects iterable objects in several different contexts, the most important being the ``for`` statement. In the statement ``for X in Y``, Y must @@ -362,7 +362,7 @@ comprehensions are surrounded by square brackets ("[]"). Generator expressions have the form:: - ( expression for expr in sequence1 + ( expression for expr in sequence1 if condition1 for expr2 in sequence2 if condition2 @@ -404,7 +404,7 @@ if not (conditionN): continue # Skip this element - # Output the value of + # Output the value of # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` @@ -418,8 +418,8 @@ >>> seq1 = 'abc' >>> seq2 = (1,2,3) >>> [(x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), + [('a', 1), ('a', 2), ('a', 3), + ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)] To avoid introducing an ambiguity into Python's grammar, if ``expression`` is @@ -585,7 +585,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration @@ -728,7 +728,7 @@ if line.strip() == '': print 'Blank line at line #%i' % i -``sorted(iterable, [cmp=None], [key=None], [reverse=False)`` collects all the +``sorted(iterable, [cmp=None], [key=None], [reverse=False])`` collects all the elements of the iterable into a list, sorts the list, and returns the sorted result. The ``cmp``, ``key``, and ``reverse`` arguments are passed through to the constructed list's ``.sort()`` method. :: @@ -759,7 +759,7 @@ True >>> all([0,1,0]) False - >>> all([0,0,0]) + >>> all([0,0,0]) False >>> all([1,1,1]) True @@ -845,7 +845,7 @@ 4) Convert the lambda to a def statement, using that name. 5) Remove the comment. -I really like these rules, but you're free to disagree +I really like these rules, but you're free to disagree about whether this lambda-free style is better. @@ -970,7 +970,7 @@ ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream of tuples, and calls ``f()`` using these tuples as the arguments:: - itertools.starmap(os.path.join, + itertools.starmap(os.path.join, [('/usr', 'bin', 'java'), ('/bin', 'python'), ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) => @@ -1039,9 +1039,9 @@ :: - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), + city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), + ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), ... ] @@ -1056,7 +1056,7 @@ where iterator-1 => ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => + iterator-2 => ('Anchorage', 'AK'), ('Nome', 'AK') iterator-3 => ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') @@ -1150,7 +1150,7 @@ >>> double(add(5, 6)) 22 - + The ``unpack`` keyword is provided to work around the fact that Python functions are not always `fully curried `__. By default, it is expected that the ``inner`` function will return a single object @@ -1159,15 +1159,15 @@ will be expanded before being passed to ``outer``. Put simply, :: compose(f, g)(5, 6) - + is equivalent to:: f(g(5, 6)) - + while :: compose(f, g, unpack=True)(5, 6) - + is equivalent to:: f(*g(5, 6)) @@ -1178,20 +1178,20 @@ ``functional`` and ``functools``). :: from functional import compose, partial - + multi_compose = partial(reduce, compose) - - + + We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of ``"".join(...)`` that converts its arguments to string:: from functional import compose, partial - + join = compose("".join, partial(map, str)) ``flip(func)`` - + ``flip()`` wraps the callable in ``func`` and causes it to receive its non-keyword arguments in reverse order. :: @@ -1206,7 +1206,7 @@ (7, 6, 5) ``foldl(func, start, iterable)`` - + ``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable. The function is applied to the starting value and the first element of the list, then the result of that and the second element of the @@ -1220,7 +1220,7 @@ f(f(f(0, 1), 2), 3) - + ``foldl()`` is roughly equivalent to the following recursive function:: def foldl(func, start, seq): @@ -1298,7 +1298,7 @@ Text Processing". Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see +for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__, Modified: python/branches/tlee-ast-optimize/Doc/howto/regex.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/regex.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/regex.rst Wed Jan 14 13:24:17 2009 @@ -1,7 +1,7 @@ .. _regex-howto: **************************** - Regular Expression HOWTO + Regular Expression HOWTO **************************** :Author: A.M. Kuchling @@ -611,7 +611,7 @@ is to read? :: charref = re.compile(r""" - &[#] # Start of a numeric entity reference + &[#] # Start of a numeric entity reference ( 0[0-7]+ # Octal form | [0-9]+ # Decimal form @@ -732,7 +732,7 @@ >>> p = re.compile('\bclass\b') >>> print p.search('no class at all') None - >>> print p.search('\b' + 'class' + '\b') + >>> print p.search('\b' + 'class' + '\b') Second, inside a character class, where there's no use for this assertion, @@ -917,7 +917,7 @@ InternalDate = re.compile(r'INTERNALDATE "' r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-' - r'(?P[0-9][0-9][0-9][0-9])' + r'(?P[0-9][0-9][0-9][0-9])' r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])' r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])' r'"') @@ -1236,9 +1236,9 @@ only report a successful match which will start at 0; if the match wouldn't start at zero, :func:`match` will *not* report it. :: - >>> print re.match('super', 'superstition').span() + >>> print re.match('super', 'superstition').span() (0, 5) - >>> print re.match('super', 'insuperable') + >>> print re.match('super', 'insuperable') None On the other hand, :func:`search` will scan forward through the string, Modified: python/branches/tlee-ast-optimize/Doc/howto/sockets.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/sockets.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/sockets.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -63,7 +63,7 @@ #create an INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -78,7 +78,7 @@ #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -185,38 +185,38 @@ length message:: class mysocket: - '''demonstration class only + '''demonstration class only - coded for clarity, not efficiency ''' def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock def connect(self, host, port): - self.sock.connect((host, port)) + self.sock.connect((host, port)) def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError, \ - "socket connection broken" - totalsent = totalsent + sent + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError, \ + "socket connection broken" + totalsent = totalsent + sent def myreceive(self): - msg = '' - while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError, \ - "socket connection broken" - msg = msg + chunk - return msg + msg = '' + while len(msg) < MSGLEN: + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError, \ + "socket connection broken" + msg = msg + chunk + return msg The sending code here is usable for almost any messaging scheme - in Python you send strings, and you can use ``len()`` to determine its length (even if it has @@ -343,9 +343,9 @@ ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might Modified: python/branches/tlee-ast-optimize/Doc/howto/unicode.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/unicode.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/unicode.rst Wed Jan 14 13:24:17 2009 @@ -30,8 +30,8 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHER EST COMPLETE." - PRINT "CARACTERE NON ACCEPTE." + PRINT "FICHIER EST COMPLETE." + PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who can read French. @@ -89,11 +89,11 @@ character with value 0x12ca (4810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:: - 0061 'a'; LATIN SMALL LETTER A - 0062 'b'; LATIN SMALL LETTER B - 0063 'c'; LATIN SMALL LETTER C - ... - 007B '{'; LEFT CURLY BRACKET + 0061 'a'; LATIN SMALL LETTER A + 0062 'b'; LATIN SMALL LETTER B + 0063 'c'; LATIN SMALL LETTER C + ... + 007B '{'; LEFT CURLY BRACKET Strictly, these definitions imply that it's meaningless to say 'this is character U+12ca'. U+12ca is a code point, which represents some particular @@ -122,8 +122,8 @@ representation, the string "Python" would look like this:: P y t h o n - 0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 + 0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 This representation is straightforward but using it presents a number of problems. @@ -181,7 +181,7 @@ between 128 and 255. 3. Code points >0x7ff are turned into three- or four-byte sequences, where each byte of the sequence is between 128 and 255. - + UTF-8 has several convenient properties: 1. It can handle any Unicode code point. @@ -252,7 +252,7 @@ >>> unicode('abcdef' + chr(255)) Traceback (most recent call last): File "", line 1, in ? - UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 6: + UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 6: ordinal not in range(128) The ``errors`` argument specifies the response when the input string can't be @@ -264,7 +264,7 @@ >>> unicode('\x80abc', errors='strict') Traceback (most recent call last): File "", line 1, in ? - UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: + UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) >>> unicode('\x80abc', errors='replace') u'\ufffdabc' @@ -350,7 +350,7 @@ >>> u2 = utf8_version.decode('utf-8') # Decode using UTF-8 >>> u == u2 # The two strings match True - + The low-level routines for registering and accessing the available encodings are found in the :mod:`codecs` module. However, the encoding and decoding functions returned by this module are usually more low-level than is comfortable, so I'm @@ -362,8 +362,8 @@ The most commonly used part of the :mod:`codecs` module is the :func:`codecs.open` function which will be discussed in the section on input and output. - - + + Unicode Literals in Python Source Code -------------------------------------- @@ -381,10 +381,10 @@ >>> s = u"a\xac\u1234\u20ac\U00008000" ^^^^ two-digit hex escape - ^^^^^^ four-digit Unicode escape + ^^^^^^ four-digit Unicode escape ^^^^^^^^^^ eight-digit Unicode escape >>> for c in s: print ord(c), - ... + ... 97 172 4660 8364 32768 Using escape sequences for code points greater than 127 is fine in small doses, @@ -404,10 +404,10 @@ #!/usr/bin/env python # -*- coding: latin-1 -*- - + u = u'abcd??' print ord(u[-1]) - + The syntax is inspired by Emacs's notation for specifying variables local to a file. Emacs supports many different variables, but Python only supports 'coding'. The ``-*-`` symbols indicate to Emacs that the comment is special; @@ -427,10 +427,10 @@ When you run it with Python 2.4, it will output the following warning:: amk:~$ python p263.py - sys:1: DeprecationWarning: Non-ASCII character '\xe9' - in file p263.py on line 2, but no encoding declared; + sys:1: DeprecationWarning: Non-ASCII character '\xe9' + in file p263.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details - + Unicode Properties ------------------ @@ -446,13 +446,13 @@ prints the numeric value of one particular character:: import unicodedata - + u = unichr(233) + unichr(0x0bf2) + unichr(3972) + unichr(6000) + unichr(13231) - + for i, c in enumerate(u): print i, '%04x' % ord(c), unicodedata.category(c), print unicodedata.name(c) - + # Get numeric value of second character print unicodedata.numeric(u[1]) @@ -597,25 +597,25 @@ path will return the 8-bit versions of the filenames. For example, assuming the default filesystem encoding is UTF-8, running the following program:: - fn = u'filename\u4500abc' - f = open(fn, 'w') - f.close() - - import os - print os.listdir('.') - print os.listdir(u'.') + fn = u'filename\u4500abc' + f = open(fn, 'w') + f.close() + + import os + print os.listdir('.') + print os.listdir(u'.') will produce the following output:: - amk:~$ python t.py - ['.svn', 'filename\xe4\x94\x80abc', ...] - [u'.svn', u'filename\u4500abc', ...] + amk:~$ python t.py + ['.svn', 'filename\xe4\x94\x80abc', ...] + [u'.svn', u'filename\u4500abc', ...] The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions. - + Tips for Writing Unicode-aware Programs --------------------------------------- @@ -661,7 +661,7 @@ unicode_name = filename.decode(encoding) f = open(unicode_name, 'r') # ... return contents of file ... - + However, if an attacker could specify the ``'base64'`` encoding, they could pass ``'L2V0Yy9wYXNzd2Q='``, which is the base-64 encoded form of the string ``'/etc/passwd'``, to read a system file. The above code looks for ``'/'`` @@ -697,32 +697,32 @@ .. comment Describe obscure -U switch somewhere? .. comment Describe use of codecs.StreamRecoder and StreamReaderWriter -.. comment +.. comment Original outline: - [ ] Unicode introduction - [ ] ASCII - [ ] Terms - - [ ] Character - - [ ] Code point - - [ ] Encodings - - [ ] Common encodings: ASCII, Latin-1, UTF-8 + - [ ] Character + - [ ] Code point + - [ ] Encodings + - [ ] Common encodings: ASCII, Latin-1, UTF-8 - [ ] Unicode Python type - - [ ] Writing unicode literals - - [ ] Obscurity: -U switch - - [ ] Built-ins - - [ ] unichr() - - [ ] ord() - - [ ] unicode() constructor - - [ ] Unicode type - - [ ] encode(), decode() methods + - [ ] Writing unicode literals + - [ ] Obscurity: -U switch + - [ ] Built-ins + - [ ] unichr() + - [ ] ord() + - [ ] unicode() constructor + - [ ] Unicode type + - [ ] encode(), decode() methods - [ ] Unicodedata module for character properties - [ ] I/O - - [ ] Reading/writing Unicode data into files - - [ ] Byte-order marks - - [ ] Unicode filenames + - [ ] Reading/writing Unicode data into files + - [ ] Byte-order marks + - [ ] Unicode filenames - [ ] Writing Unicode programs - - [ ] Do everything in Unicode - - [ ] Declaring source code encodings (PEP 263) + - [ ] Do everything in Unicode + - [ ] Declaring source code encodings (PEP 263) - [ ] Other issues - - [ ] Building Python (UCS2, UCS4) + - [ ] Building Python (UCS2, UCS4) Modified: python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst Wed Jan 14 13:24:17 2009 @@ -10,7 +10,7 @@ HOWTO, available at `urllib2 - Le Manuel manquant `_. - + Introduction ============ @@ -19,9 +19,9 @@ You may also find useful the following article on fetching web resources with Python : - + * `Basic Authentication `_ - + A tutorial on *Basic Authentication*, with examples in Python. **urllib2** is a `Python `_ module for fetching URLs @@ -98,7 +98,7 @@ *not* from ``urllib2``. :: import urllib - import urllib2 + import urllib2 url = 'http://www.someserver.com/cgi-bin/register.cgi' values = {'name' : 'Michael Foord', @@ -161,15 +161,15 @@ Explorer [#]_. :: import urllib - import urllib2 - + import urllib2 + url = 'http://www.someserver.com/cgi-bin/register.cgi' - user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' + user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - + data = urllib.urlencode(values) req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) @@ -183,7 +183,7 @@ =================== *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as +with Python APIs, builtin exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised). @@ -309,18 +309,18 @@ geturl, and info, methods. :: >>> req = urllib2.Request('http://www.python.org/fish.html') - >>> try: + >>> try: >>> urllib2.urlopen(req) >>> except URLError, e: >>> print e.code >>> print e.read() - >>> + >>> 404 - - - Error 404: File Not Found + Error 404: File Not Found ...... etc... Wrapping it Up @@ -372,7 +372,7 @@ print 'Error code: ', e.code else: # everything is fine - + info and geturl =============== @@ -443,7 +443,7 @@ and a 'realm'. The header looks like : ``Www-authenticate: SCHEME realm="REALM"``. -e.g. :: +e.g. :: Www-authenticate: Basic realm="cPanel Users" @@ -467,24 +467,24 @@ than the URL you pass to .add_password() will also match. :: # create a password manager - password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() + password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. - # If we knew the realm, we could use it instead of ``None``. + # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) - handler = urllib2.HTTPBasicAuthHandler(password_mgr) + handler = urllib2.HTTPBasicAuthHandler(password_mgr) # create "opener" (OpenerDirector instance) - opener = urllib2.build_opener(handler) + opener = urllib2.build_opener(handler) # use the opener to fetch a URL - opener.open(a_url) + opener.open(a_url) # Install the opener. # Now all calls to urllib2.urlopen use our opener. - urllib2.install_opener(opener) + urllib2.install_opener(opener) .. note:: @@ -540,7 +540,7 @@ # timeout in seconds timeout = 10 - socket.setdefaulttimeout(timeout) + socket.setdefaulttimeout(timeout) # this call to urllib2.urlopen now uses the default timeout # we have set in the socket module @@ -557,7 +557,7 @@ This document was reviewed and revised by John Lee. .. [#] For an introduction to the CGI protocol see - `Writing Web Applications in Python `_. + `Writing Web Applications in Python `_. .. [#] Like Google for example. The *proper* way to use google from a program is to use `PyGoogle `_ of course. See `Voidspace Google `_ @@ -574,6 +574,6 @@ is set to use the proxy, which urllib2 picks up on. In order to test scripts with a localhost server, I have to prevent urllib2 from using the proxy. -.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe +.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_. - + Modified: python/branches/tlee-ast-optimize/Doc/howto/webservers.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/webservers.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/webservers.rst Wed Jan 14 13:24:17 2009 @@ -88,7 +88,7 @@ `_ with some additional information about CGI in Python. - + Simple script for testing CGI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -386,7 +386,7 @@ You might be interested in some WSGI-supporting modules already contained in the standard library, namely: - + * :mod:`wsgiref` -- some tiny utilities and servers for WSGI @@ -499,7 +499,7 @@ time in looking through the most popular ones. Some frameworks have their own template engine or have a recommentation for one. It's wise to use these. - + Popular template engines include: * Mako @@ -687,7 +687,7 @@ found in the Python wiki. .. seealso:: - + The Python wiki contains an extensive list of `web frameworks `_. Modified: python/branches/tlee-ast-optimize/Doc/includes/mp_distributing.py ============================================================================== --- python/branches/tlee-ast-optimize/Doc/includes/mp_distributing.py (original) +++ python/branches/tlee-ast-optimize/Doc/includes/mp_distributing.py Wed Jan 14 13:24:17 2009 @@ -1,364 +1,364 @@ -# -# Module to allow spawning of processes on foreign host -# -# Depends on `multiprocessing` package -- tested with `processing-0.60` -# -# Copyright (c) 2006-2008, R Oudkerk -# All rights reserved. -# - -__all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] - -# -# Imports -# - -import sys -import os -import tarfile -import shutil -import subprocess -import logging -import itertools -import Queue - -try: - import cPickle as pickle -except ImportError: - import pickle - -from multiprocessing import Process, current_process, cpu_count -from multiprocessing import util, managers, connection, forking, pool - -# -# Logging -# - -def get_logger(): - return _logger - -_logger = logging.getLogger('distributing') -_logger.propogate = 0 - -_formatter = logging.Formatter(util.DEFAULT_LOGGING_FORMAT) -_handler = logging.StreamHandler() -_handler.setFormatter(_formatter) -_logger.addHandler(_handler) - -info = _logger.info -debug = _logger.debug - -# -# Get number of cpus -# - -try: - slot_count = cpu_count() -except NotImplemented: - slot_count = 1 - -# -# Manager type which spawns subprocesses -# - -class HostManager(managers.SyncManager): - ''' - Manager type used for spawning processes on a (presumably) foreign host - ''' - def __init__(self, address, authkey): - managers.SyncManager.__init__(self, address, authkey) - self._name = 'Host-unknown' - - def Process(self, group=None, target=None, name=None, args=(), kwargs={}): - if hasattr(sys.modules['__main__'], '__file__'): - main_path = os.path.basename(sys.modules['__main__'].__file__) - else: - main_path = None - data = pickle.dumps((target, args, kwargs)) - p = self._RemoteProcess(data, main_path) - if name is None: - temp = self._name.split('Host-')[-1] + '/Process-%s' - name = temp % ':'.join(map(str, p.get_identity())) - p.set_name(name) - return p - - @classmethod - def from_address(cls, address, authkey): - manager = cls(address, authkey) - managers.transact(address, authkey, 'dummy') - manager._state.value = managers.State.STARTED - manager._name = 'Host-%s:%s' % manager.address - manager.shutdown = util.Finalize( - manager, HostManager._finalize_host, - args=(manager._address, manager._authkey, manager._name), - exitpriority=-10 - ) - return manager - - @staticmethod - def _finalize_host(address, authkey, name): - managers.transact(address, authkey, 'shutdown') - - def __repr__(self): - return '' % self._name - -# -# Process subclass representing a process on (possibly) a remote machine -# - -class RemoteProcess(Process): - ''' - Represents a process started on a remote host - ''' - def __init__(self, data, main_path): - assert not main_path or os.path.basename(main_path) == main_path - Process.__init__(self) - self._data = data - self._main_path = main_path - - def _bootstrap(self): - forking.prepare({'main_path': self._main_path}) - self._target, self._args, self._kwargs = pickle.loads(self._data) - return Process._bootstrap(self) - - def get_identity(self): - return self._identity - -HostManager.register('_RemoteProcess', RemoteProcess) - -# -# A Pool class that uses a cluster -# - -class DistributedPool(pool.Pool): - - def __init__(self, cluster, processes=None, initializer=None, initargs=()): - self._cluster = cluster - self.Process = cluster.Process - pool.Pool.__init__(self, processes or len(cluster), - initializer, initargs) - - def _setup_queues(self): - self._inqueue = self._cluster._SettableQueue() - self._outqueue = self._cluster._SettableQueue() - self._quick_put = self._inqueue.put - self._quick_get = self._outqueue.get - - @staticmethod - def _help_stuff_finish(inqueue, task_handler, size): - inqueue.set_contents([None] * size) - -# -# Manager type which starts host managers on other machines -# - -def LocalProcess(**kwds): - p = Process(**kwds) - p.set_name('localhost/' + p.name) - return p - -class Cluster(managers.SyncManager): - ''' - Represents collection of slots running on various hosts. - - `Cluster` is a subclass of `SyncManager` so it allows creation of - various types of shared objects. - ''' - def __init__(self, hostlist, modules): - managers.SyncManager.__init__(self, address=('localhost', 0)) - self._hostlist = hostlist - self._modules = modules - if __name__ not in modules: - modules.append(__name__) - files = [sys.modules[name].__file__ for name in modules] - for i, file in enumerate(files): - if file.endswith('.pyc') or file.endswith('.pyo'): - files[i] = file[:-4] + '.py' - self._files = [os.path.abspath(file) for file in files] - - def start(self): - managers.SyncManager.start(self) - - l = connection.Listener(family='AF_INET', authkey=self._authkey) - - for i, host in enumerate(self._hostlist): - host._start_manager(i, self._authkey, l.address, self._files) - - for host in self._hostlist: - if host.hostname != 'localhost': - conn = l.accept() - i, address, cpus = conn.recv() - conn.close() - other_host = self._hostlist[i] - other_host.manager = HostManager.from_address(address, - self._authkey) - other_host.slots = other_host.slots or cpus - other_host.Process = other_host.manager.Process - else: - host.slots = host.slots or slot_count - host.Process = LocalProcess - - self._slotlist = [ - Slot(host) for host in self._hostlist for i in range(host.slots) - ] - self._slot_iterator = itertools.cycle(self._slotlist) - self._base_shutdown = self.shutdown - del self.shutdown - - def shutdown(self): - for host in self._hostlist: - if host.hostname != 'localhost': - host.manager.shutdown() - self._base_shutdown() - - def Process(self, group=None, target=None, name=None, args=(), kwargs={}): - slot = self._slot_iterator.next() - return slot.Process( - group=group, target=target, name=name, args=args, kwargs=kwargs - ) - - def Pool(self, processes=None, initializer=None, initargs=()): - return DistributedPool(self, processes, initializer, initargs) - - def __getitem__(self, i): - return self._slotlist[i] - - def __len__(self): - return len(self._slotlist) - - def __iter__(self): - return iter(self._slotlist) - -# -# Queue subclass used by distributed pool -# - -class SettableQueue(Queue.Queue): - def empty(self): - return not self.queue - def full(self): - return self.maxsize > 0 and len(self.queue) == self.maxsize - def set_contents(self, contents): - # length of contents must be at least as large as the number of - # threads which have potentially called get() - self.not_empty.acquire() - try: - self.queue.clear() - self.queue.extend(contents) - self.not_empty.notifyAll() - finally: - self.not_empty.release() - -Cluster.register('_SettableQueue', SettableQueue) - -# -# Class representing a notional cpu in the cluster -# - -class Slot(object): - def __init__(self, host): - self.host = host - self.Process = host.Process - -# -# Host -# - -class Host(object): - ''' - Represents a host to use as a node in a cluster. - - `hostname` gives the name of the host. If hostname is not - "localhost" then ssh is used to log in to the host. To log in as - a different user use a host name of the form - "username at somewhere.org" - - `slots` is used to specify the number of slots for processes on - the host. This affects how often processes will be allocated to - this host. Normally this should be equal to the number of cpus on - that host. - ''' - def __init__(self, hostname, slots=None): - self.hostname = hostname - self.slots = slots - - def _start_manager(self, index, authkey, address, files): - if self.hostname != 'localhost': - tempdir = copy_to_remote_temporary_directory(self.hostname, files) - debug('startup files copied to %s:%s', self.hostname, tempdir) - p = subprocess.Popen( - ['ssh', self.hostname, 'python', '-c', - '"import os; os.chdir(%r); ' - 'from distributing import main; main()"' % tempdir], - stdin=subprocess.PIPE - ) - data = dict( - name='BoostrappingHost', index=index, - dist_log_level=_logger.getEffectiveLevel(), - dir=tempdir, authkey=str(authkey), parent_address=address - ) - pickle.dump(data, p.stdin, pickle.HIGHEST_PROTOCOL) - p.stdin.close() - -# -# Copy files to remote directory, returning name of directory -# - -unzip_code = '''" -import tempfile, os, sys, tarfile -tempdir = tempfile.mkdtemp(prefix='distrib-') -os.chdir(tempdir) -tf = tarfile.open(fileobj=sys.stdin, mode='r|gz') -for ti in tf: - tf.extract(ti) -print tempdir -"''' - -def copy_to_remote_temporary_directory(host, files): - p = subprocess.Popen( - ['ssh', host, 'python', '-c', unzip_code], - stdout=subprocess.PIPE, stdin=subprocess.PIPE - ) - tf = tarfile.open(fileobj=p.stdin, mode='w|gz') - for name in files: - tf.add(name, os.path.basename(name)) - tf.close() - p.stdin.close() - return p.stdout.read().rstrip() - -# -# Code which runs a host manager -# - -def main(): - # get data from parent over stdin - data = pickle.load(sys.stdin) - sys.stdin.close() - - # set some stuff - _logger.setLevel(data['dist_log_level']) - forking.prepare(data) - - # create server for a `HostManager` object - server = managers.Server(HostManager._registry, ('', 0), data['authkey']) - current_process()._server = server - - # report server address and number of cpus back to parent - conn = connection.Client(data['parent_address'], authkey=data['authkey']) - conn.send((data['index'], server.address, slot_count)) - conn.close() - - # set name etc - current_process().set_name('Host-%s:%s' % server.address) - util._run_after_forkers() - - # register a cleanup function - def cleanup(directory): - debug('removing directory %s', directory) - shutil.rmtree(directory) - debug('shutting down host manager') - util.Finalize(None, cleanup, args=[data['dir']], exitpriority=0) - - # start host manager - debug('remote host manager starting in %s', data['dir']) - server.serve_forever() +# +# Module to allow spawning of processes on foreign host +# +# Depends on `multiprocessing` package -- tested with `processing-0.60` +# +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# + +__all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] + +# +# Imports +# + +import sys +import os +import tarfile +import shutil +import subprocess +import logging +import itertools +import Queue + +try: + import cPickle as pickle +except ImportError: + import pickle + +from multiprocessing import Process, current_process, cpu_count +from multiprocessing import util, managers, connection, forking, pool + +# +# Logging +# + +def get_logger(): + return _logger + +_logger = logging.getLogger('distributing') +_logger.propogate = 0 + +_formatter = logging.Formatter(util.DEFAULT_LOGGING_FORMAT) +_handler = logging.StreamHandler() +_handler.setFormatter(_formatter) +_logger.addHandler(_handler) + +info = _logger.info +debug = _logger.debug + +# +# Get number of cpus +# + +try: + slot_count = cpu_count() +except NotImplemented: + slot_count = 1 + +# +# Manager type which spawns subprocesses +# + +class HostManager(managers.SyncManager): + ''' + Manager type used for spawning processes on a (presumably) foreign host + ''' + def __init__(self, address, authkey): + managers.SyncManager.__init__(self, address, authkey) + self._name = 'Host-unknown' + + def Process(self, group=None, target=None, name=None, args=(), kwargs={}): + if hasattr(sys.modules['__main__'], '__file__'): + main_path = os.path.basename(sys.modules['__main__'].__file__) + else: + main_path = None + data = pickle.dumps((target, args, kwargs)) + p = self._RemoteProcess(data, main_path) + if name is None: + temp = self._name.split('Host-')[-1] + '/Process-%s' + name = temp % ':'.join(map(str, p.get_identity())) + p.set_name(name) + return p + + @classmethod + def from_address(cls, address, authkey): + manager = cls(address, authkey) + managers.transact(address, authkey, 'dummy') + manager._state.value = managers.State.STARTED + manager._name = 'Host-%s:%s' % manager.address + manager.shutdown = util.Finalize( + manager, HostManager._finalize_host, + args=(manager._address, manager._authkey, manager._name), + exitpriority=-10 + ) + return manager + + @staticmethod + def _finalize_host(address, authkey, name): + managers.transact(address, authkey, 'shutdown') + + def __repr__(self): + return '' % self._name + +# +# Process subclass representing a process on (possibly) a remote machine +# + +class RemoteProcess(Process): + ''' + Represents a process started on a remote host + ''' + def __init__(self, data, main_path): + assert not main_path or os.path.basename(main_path) == main_path + Process.__init__(self) + self._data = data + self._main_path = main_path + + def _bootstrap(self): + forking.prepare({'main_path': self._main_path}) + self._target, self._args, self._kwargs = pickle.loads(self._data) + return Process._bootstrap(self) + + def get_identity(self): + return self._identity + +HostManager.register('_RemoteProcess', RemoteProcess) + +# +# A Pool class that uses a cluster +# + +class DistributedPool(pool.Pool): + + def __init__(self, cluster, processes=None, initializer=None, initargs=()): + self._cluster = cluster + self.Process = cluster.Process + pool.Pool.__init__(self, processes or len(cluster), + initializer, initargs) + + def _setup_queues(self): + self._inqueue = self._cluster._SettableQueue() + self._outqueue = self._cluster._SettableQueue() + self._quick_put = self._inqueue.put + self._quick_get = self._outqueue.get + + @staticmethod + def _help_stuff_finish(inqueue, task_handler, size): + inqueue.set_contents([None] * size) + +# +# Manager type which starts host managers on other machines +# + +def LocalProcess(**kwds): + p = Process(**kwds) + p.set_name('localhost/' + p.name) + return p + +class Cluster(managers.SyncManager): + ''' + Represents collection of slots running on various hosts. + + `Cluster` is a subclass of `SyncManager` so it allows creation of + various types of shared objects. + ''' + def __init__(self, hostlist, modules): + managers.SyncManager.__init__(self, address=('localhost', 0)) + self._hostlist = hostlist + self._modules = modules + if __name__ not in modules: + modules.append(__name__) + files = [sys.modules[name].__file__ for name in modules] + for i, file in enumerate(files): + if file.endswith('.pyc') or file.endswith('.pyo'): + files[i] = file[:-4] + '.py' + self._files = [os.path.abspath(file) for file in files] + + def start(self): + managers.SyncManager.start(self) + + l = connection.Listener(family='AF_INET', authkey=self._authkey) + + for i, host in enumerate(self._hostlist): + host._start_manager(i, self._authkey, l.address, self._files) + + for host in self._hostlist: + if host.hostname != 'localhost': + conn = l.accept() + i, address, cpus = conn.recv() + conn.close() + other_host = self._hostlist[i] + other_host.manager = HostManager.from_address(address, + self._authkey) + other_host.slots = other_host.slots or cpus + other_host.Process = other_host.manager.Process + else: + host.slots = host.slots or slot_count + host.Process = LocalProcess + + self._slotlist = [ + Slot(host) for host in self._hostlist for i in range(host.slots) + ] + self._slot_iterator = itertools.cycle(self._slotlist) + self._base_shutdown = self.shutdown + del self.shutdown + + def shutdown(self): + for host in self._hostlist: + if host.hostname != 'localhost': + host.manager.shutdown() + self._base_shutdown() + + def Process(self, group=None, target=None, name=None, args=(), kwargs={}): + slot = self._slot_iterator.next() + return slot.Process( + group=group, target=target, name=name, args=args, kwargs=kwargs + ) + + def Pool(self, processes=None, initializer=None, initargs=()): + return DistributedPool(self, processes, initializer, initargs) + + def __getitem__(self, i): + return self._slotlist[i] + + def __len__(self): + return len(self._slotlist) + + def __iter__(self): + return iter(self._slotlist) + +# +# Queue subclass used by distributed pool +# + +class SettableQueue(Queue.Queue): + def empty(self): + return not self.queue + def full(self): + return self.maxsize > 0 and len(self.queue) == self.maxsize + def set_contents(self, contents): + # length of contents must be at least as large as the number of + # threads which have potentially called get() + self.not_empty.acquire() + try: + self.queue.clear() + self.queue.extend(contents) + self.not_empty.notifyAll() + finally: + self.not_empty.release() + +Cluster.register('_SettableQueue', SettableQueue) + +# +# Class representing a notional cpu in the cluster +# + +class Slot(object): + def __init__(self, host): + self.host = host + self.Process = host.Process + +# +# Host +# + +class Host(object): + ''' + Represents a host to use as a node in a cluster. + + `hostname` gives the name of the host. If hostname is not + "localhost" then ssh is used to log in to the host. To log in as + a different user use a host name of the form + "username at somewhere.org" + + `slots` is used to specify the number of slots for processes on + the host. This affects how often processes will be allocated to + this host. Normally this should be equal to the number of cpus on + that host. + ''' + def __init__(self, hostname, slots=None): + self.hostname = hostname + self.slots = slots + + def _start_manager(self, index, authkey, address, files): + if self.hostname != 'localhost': + tempdir = copy_to_remote_temporary_directory(self.hostname, files) + debug('startup files copied to %s:%s', self.hostname, tempdir) + p = subprocess.Popen( + ['ssh', self.hostname, 'python', '-c', + '"import os; os.chdir(%r); ' + 'from distributing import main; main()"' % tempdir], + stdin=subprocess.PIPE + ) + data = dict( + name='BoostrappingHost', index=index, + dist_log_level=_logger.getEffectiveLevel(), + dir=tempdir, authkey=str(authkey), parent_address=address + ) + pickle.dump(data, p.stdin, pickle.HIGHEST_PROTOCOL) + p.stdin.close() + +# +# Copy files to remote directory, returning name of directory +# + +unzip_code = '''" +import tempfile, os, sys, tarfile +tempdir = tempfile.mkdtemp(prefix='distrib-') +os.chdir(tempdir) +tf = tarfile.open(fileobj=sys.stdin, mode='r|gz') +for ti in tf: + tf.extract(ti) +print tempdir +"''' + +def copy_to_remote_temporary_directory(host, files): + p = subprocess.Popen( + ['ssh', host, 'python', '-c', unzip_code], + stdout=subprocess.PIPE, stdin=subprocess.PIPE + ) + tf = tarfile.open(fileobj=p.stdin, mode='w|gz') + for name in files: + tf.add(name, os.path.basename(name)) + tf.close() + p.stdin.close() + return p.stdout.read().rstrip() + +# +# Code which runs a host manager +# + +def main(): + # get data from parent over stdin + data = pickle.load(sys.stdin) + sys.stdin.close() + + # set some stuff + _logger.setLevel(data['dist_log_level']) + forking.prepare(data) + + # create server for a `HostManager` object + server = managers.Server(HostManager._registry, ('', 0), data['authkey']) + current_process()._server = server + + # report server address and number of cpus back to parent + conn = connection.Client(data['parent_address'], authkey=data['authkey']) + conn.send((data['index'], server.address, slot_count)) + conn.close() + + # set name etc + current_process().set_name('Host-%s:%s' % server.address) + util._run_after_forkers() + + # register a cleanup function + def cleanup(directory): + debug('removing directory %s', directory) + shutil.rmtree(directory) + debug('shutting down host manager') + util.Finalize(None, cleanup, args=[data['dir']], exitpriority=0) + + # start host manager + debug('remote host manager starting in %s', data['dir']) + server.serve_forever() Modified: python/branches/tlee-ast-optimize/Doc/install/index.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/install/index.rst (original) +++ python/branches/tlee-ast-optimize/Doc/install/index.rst Wed Jan 14 13:24:17 2009 @@ -3,7 +3,7 @@ .. _install-index: ***************************** - Installing Python Modules + Installing Python Modules ***************************** :Author: Greg Ward @@ -18,7 +18,7 @@ Thus, I have to be sure to explain the basics at some point: sys.path and PYTHONPATH at least. Should probably give pointers to other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc. - + Finally, it might be useful to include all the material from my "Care and Feeding of a Python Installation" talk in here somewhere. Yow! @@ -268,7 +268,7 @@ statements shown below, and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`:: - Python 2.4 (#26, Aug 7 2004, 17:19:02) + Python 2.4 (#26, Aug 7 2004, 17:19:02) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix @@ -587,11 +587,11 @@ $ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 - Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. + Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path - ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', - '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', + ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', + '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>> Modified: python/branches/tlee-ast-optimize/Doc/library/2to3.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/2to3.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/2to3.rst Wed Jan 14 13:24:17 2009 @@ -3,7 +3,7 @@ 2to3 - Automated Python 2 to 3 code translation =============================================== -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson 2to3 is a Python program that reads Python 2.x source code and applies a series of *fixers* to transform it into valid Python 3.x code. The standard library Modified: python/branches/tlee-ast-optimize/Doc/library/abc.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/abc.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/abc.rst Wed Jan 14 13:24:17 2009 @@ -43,15 +43,15 @@ Register *subclass* as a "virtual subclass" of this ABC. For example:: - from abc import ABCMeta + from abc import ABCMeta - class MyABC: - __metaclass__ = ABCMeta + class MyABC: + __metaclass__ = ABCMeta - MyABC.register(tuple) + MyABC.register(tuple) - assert issubclass(tuple, MyABC) - assert isinstance((), MyABC) + assert issubclass(tuple, MyABC) + assert isinstance((), MyABC) You can also override this method in an abstract base class: @@ -130,7 +130,7 @@ A decorator indicating abstract methods. Using this decorator requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. @@ -166,7 +166,7 @@ A subclass of the built-in :func:`property`, indicating an abstract property. Using this function requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract properties can be called using any of the normal Modified: python/branches/tlee-ast-optimize/Doc/library/aifc.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/aifc.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/aifc.rst Wed Jan 14 13:24:17 2009 @@ -17,7 +17,7 @@ ability to compress the audio data. .. warning:: - + Some operations may only work under IRIX; these will raise :exc:`ImportError` when attempting to import the :mod:`cl` module, which is only available on IRIX. Modified: python/branches/tlee-ast-optimize/Doc/library/al.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/al.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/al.rst Wed Jan 14 13:24:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Audio functions on the SGI. :deprecated: - + .. deprecated:: 2.6 The :mod:`al` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/ast.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ast.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ast.rst Wed Jan 14 13:24:17 2009 @@ -127,7 +127,7 @@ Parse an expression into an AST node. Equivalent to ``compile(expr, filename, mode, ast.PyCF_ONLY_AST)``. - + .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python @@ -191,7 +191,7 @@ A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -205,7 +205,7 @@ .. method:: generic_visit(node) This visitor calls :meth:`visit` on all children of the node. - + Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself. @@ -220,11 +220,11 @@ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: Modified: python/branches/tlee-ast-optimize/Doc/library/audioop.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/audioop.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/audioop.rst Wed Jan 14 13:24:17 2009 @@ -265,7 +265,7 @@ in_test = inputdata[pos*2:] ipos, factor = audioop.findfit(in_test, out_test) # Optional (for better cancellation): - # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], + # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) Modified: python/branches/tlee-ast-optimize/Doc/library/bastion.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/bastion.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/bastion.rst Wed Jan 14 13:24:17 2009 @@ -5,10 +5,10 @@ .. module:: Bastion :synopsis: Providing restricted access to objects. :deprecated: - + .. deprecated:: 2.6 The :mod:`Bastion` module has been removed in Python 3.0. - + .. moduleauthor:: Barry Warsaw Modified: python/branches/tlee-ast-optimize/Doc/library/bdb.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/bdb.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/bdb.rst Wed Jan 14 13:24:17 2009 @@ -325,7 +325,7 @@ Check whether we should break here, depending on the way the breakpoint *b* was set. - + If it was set via line number, it checks if ``b.line`` is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if @@ -335,7 +335,7 @@ Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. - + Called only if we know there is a breakpoint at this location. Returns the breakpoint that was triggered and a flag that indicates if it is ok to delete a temporary breakpoint. Modified: python/branches/tlee-ast-optimize/Doc/library/binascii.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/binascii.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/binascii.rst Wed Jan 14 13:24:17 2009 @@ -113,8 +113,25 @@ print binascii.crc32("hello world") # Or, in two pieces: crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) - print crc + crc = binascii.crc32(" world", crc) & 0xffffffff + print 'crc32 = 0x%08x' % crc + +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 2.6 + The return value will always be 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] + regardless of platform. .. function:: b2a_hex(data) Modified: python/branches/tlee-ast-optimize/Doc/library/bsddb.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/bsddb.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/bsddb.rst Wed Jan 14 13:24:17 2009 @@ -172,7 +172,7 @@ >>> import bsddb >>> db = bsddb.btopen('/tmp/spam.db', 'c') >>> for i in range(10): db['%d'%i] = '%d'% (i*i) - ... + ... >>> db['3'] '9' >>> db.keys() @@ -185,7 +185,7 @@ ('9', '81') >>> db.set_location('2') ('2', '4') - >>> db.previous() + >>> db.previous() ('1', '1') >>> for k, v in db.iteritems(): ... print k, v Modified: python/branches/tlee-ast-optimize/Doc/library/bz2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/bz2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/bz2.rst Wed Jan 14 13:24:17 2009 @@ -93,7 +93,7 @@ performance optimizations previously implemented in the :mod:`xreadlines` module. - .. deprecated:: 2.3 + .. deprecated:: 2.3 This exists only for compatibility with the method by this name on :class:`file` objects, which is deprecated. Use ``for line in file`` instead. Modified: python/branches/tlee-ast-optimize/Doc/library/cd.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/cd.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/cd.rst Wed Jan 14 13:24:17 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: Interface to the CD-ROM on Silicon Graphics systems. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`cd` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/cmath.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/cmath.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/cmath.rst Wed Jan 14 13:24:17 2009 @@ -70,9 +70,9 @@ .. function:: polar(x) - Convert a :class:`complex` from rectangular coordinates to polar + Convert a :class:`complex` from rectangular coordinates to polar coordinates. The function returns a tuple with the two elements - *r* and *phi*. *r* is the distance from 0 and *phi* the phase + *r* and *phi*. *r* is the distance from 0 and *phi* the phase angle. .. versionadded:: 2.6 Modified: python/branches/tlee-ast-optimize/Doc/library/codeop.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/codeop.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/codeop.rst Wed Jan 14 13:24:17 2009 @@ -43,7 +43,7 @@ other value will cause :exc:`ValueError` to be raised. .. warning:: - + It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, Modified: python/branches/tlee-ast-optimize/Doc/library/collections.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/collections.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/collections.rst Wed Jan 14 13:24:17 2009 @@ -53,36 +53,36 @@ :class:`Hashable` ``__hash__`` :class:`Iterable` ``__iter__`` :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` -:class:`Sized` ``__len__`` +:class:`Sized` ``__len__`` :class:`Callable` ``__call__`` - + :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. :class:`Iterable`, and ``__len__`` ``index``, and ``count`` - :class:`Container` - + :class:`Container` + :class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` - + :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:`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 + ``__iter__``, and ``__len__`` - + :class:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, :class:`Set` ``__iter__`` @@ -96,7 +96,7 @@ size = None if isinstance(myvar, collections.Sized): - size = len(myvar) + size = len(myvar) Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting @@ -152,6 +152,139 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) +.. _counter-objects: + +:class:`Counter` objects +------------------------ + +A counter tool is provided to support convenient and rapid tallies. +For example:: + + # Tally repeated words in a list + >>> words = ['red', 'blue', 'red', 'green', 'blue', 'blue'] + >>> cnt = Counter() + >>> for word in words: + ... cnt[word] += 1 + >>> cnt + Counter({'blue': 3, 'red': 2, 'green': 1}) + + # Find the ten most common words in Hamlet + >>> import re + >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) + >>> Counter(hamlet_words).most_common(10) + [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), + ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] + +.. class:: Counter([iterable-or-mapping]) + + A :class:`Counter` is a :class:`dict` subclass for counting hashable items. + It is an unordered collection where elements are stored as dictionary keys + and their counts are stored as dictionary values. Counts are allowed to be + any integer value including zero or negative counts. The :class:`Counter` + class is similar to bags or multisets in other languages. + + Elements are counted from an *iterable* or initialized from another + *mapping* (or counter):: + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + + The returned object has a dictionary style interface except that it returns + a zero count for missing items (instead of raising a :exc:`KeyError` like a + dictionary would):: + + >>> c = Counter(['egg', 'ham']) + >>> c['bacon'] # count of a missing element is zero + 0 + + Assigning a count of zero or reducing the count to zero leaves the + element in the dictionary. Use ``del`` to remove the entry entirely: + + >>> c = Counter(['arthur', 'gwain']) + >>> c['arthur'] = 0 # set the count of 'arthur' to zero + >>> 'arthur' in c # but 'arthur' is still in the counter + True + >>> del c['arthur'] # del will completely remove the entry + + .. versionadded:: 2.7 + + + Counter objects support two methods beyond those available for all + dictionaries: + + .. method:: elements() + + Return an iterator over elements repeating each as many times as its count. + Elements are returned in arbitrary order. If an element's count has been + set to zero or a negative number, :meth:`elements` will ignore it. + + >>> c = Counter({'a': 4, 'b': 2, 'd': 0, 'e': -2}) + >>> list(c.elements()) + ['a', 'a', 'a', 'a', 'b', 'b'] + + .. 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* is not specified or is ``None``, + return a list of all element counts in decreasing order of frequency. + Elements with equal counts are ordered arbitrarily:: + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + The usual dictionary methods are available for :class:`Counter` objects. + All of those work the same as they do for dictionaries except for two + which work differently for counters. + + .. method:: fromkeys(iterable) + + There is no equivalent class method for :class:`Counter` objects. + Raises a :exc:`NotImplementedError` when called. + + .. method:: update([iterable-or-mapping]) + + Like :meth:`dict.update` but adds-in counts instead of replacing them. + + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter):: + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + +Common patterns for working with :class:`Counter` objects:: + + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + c.most_common()[:-n:-1] # n least common elements + +**References**: + +* Wikipedia entry for `Multisets `_ + +* `Bag class `_ + in Smalltalk +* `C++ multisets `_ + tutorial with standalone examples + +* An early Python `Bag `_ recipe + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later + +* Use cases for multisets and mathematical operations on multisets. + Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19 + + .. _deque-objects: @@ -549,8 +682,8 @@ if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result - - def __getnewargs__(self): + + def __getnewargs__(self): return tuple(self) x = property(itemgetter(0)) @@ -591,7 +724,7 @@ Class method that makes a new instance from an existing sequence or iterable. -.. doctest:: + .. doctest:: >>> t = [11, 22] >>> Point._make(t) @@ -607,9 +740,7 @@ .. method:: somenamedtuple._replace(kwargs) Return a new instance of the named tuple replacing specified fields with new - values: - -:: + values:: >>> p = Point(x=11, y=22) >>> p._replace(x=33) @@ -623,7 +754,7 @@ Tuple of strings listing the field names. Useful for introspection and for creating new named tuple types from existing named tuples. -.. doctest:: + .. doctest:: >>> p._fields # view the field names ('x', 'y') Modified: python/branches/tlee-ast-optimize/Doc/library/compiler.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/compiler.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/compiler.rst Wed Jan 14 13:24:17 2009 @@ -559,24 +559,24 @@ >>> import compiler >>> mod = compiler.parseFile("/tmp/doublelib.py") >>> mod - Module('This is an example module.\n\nThis is the docstring.\n', + Module('This is an example module.\n\nThis is the docstring.\n', Stmt([Function(None, 'double', ['x'], [], 0, - 'Return twice the argument', + 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))]))])) >>> from compiler.ast import * - >>> Module('This is an example module.\n\nThis is the docstring.\n', + >>> Module('This is an example module.\n\nThis is the docstring.\n', ... Stmt([Function(None, 'double', ['x'], [], 0, - ... 'Return twice the argument', + ... 'Return twice the argument', ... Stmt([Return(Mul((Name('x'), Const(2))))]))])) - Module('This is an example module.\n\nThis is the docstring.\n', + Module('This is an example module.\n\nThis is the docstring.\n', Stmt([Function(None, 'double', ['x'], [], 0, - 'Return twice the argument', + 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))]))])) >>> mod.doc 'This is an example module.\n\nThis is the docstring.\n' >>> for node in mod.node.nodes: ... print node - ... + ... Function(None, 'double', ['x'], [], 0, 'Return twice the argument', Stmt([Return(Mul((Name('x'), Const(2))))])) >>> func = mod.node.nodes[0] Modified: python/branches/tlee-ast-optimize/Doc/library/configparser.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/configparser.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/configparser.rst Wed Jan 14 13:24:17 2009 @@ -11,9 +11,9 @@ .. note:: - The :mod:`ConfigParser` module has been renamed to `configparser` in Python - 3.0. The :term:`2to3` tool will automatically adapt imports when converting - your sources to 3.0. + The :mod:`ConfigParser` module has been renamed to :mod:`configparser` in + Python 3.0. The :term:`2to3` tool will automatically adapt imports when + converting your sources to 3.0. .. index:: pair: .ini; file Modified: python/branches/tlee-ast-optimize/Doc/library/cookielib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/cookielib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/cookielib.rst Wed Jan 14 13:24:17 2009 @@ -733,7 +733,7 @@ The :class:`Cookie` class also defines the following method: -.. method:: Cookie.is_expired([now=:const:`None`]) +.. method:: Cookie.is_expired([now=None]) True if cookie has passed the time at which the server requested it should expire. If *now* is given (in seconds since the epoch), return whether the Modified: python/branches/tlee-ast-optimize/Doc/library/crypt.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/crypt.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/crypt.rst Wed Jan 14 13:24:17 2009 @@ -51,7 +51,7 @@ username = raw_input('Python login:') cryptedpasswd = pwd.getpwnam(username)[1] if cryptedpasswd: - if cryptedpasswd == 'x' or cryptedpasswd == '*': + if cryptedpasswd == 'x' or cryptedpasswd == '*': raise "Sorry, currently no support for shadow passwords" cleartext = getpass.getpass() return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd Modified: python/branches/tlee-ast-optimize/Doc/library/csv.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/csv.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/csv.rst Wed Jan 14 13:24:17 2009 @@ -76,7 +76,7 @@ performed. A short usage example:: - + >>> import csv >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|') >>> for row in spamReader: Modified: python/branches/tlee-ast-optimize/Doc/library/ctypes.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ctypes.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ctypes.rst Wed Jan 14 13:24:17 2009 @@ -1378,24 +1378,22 @@ The *mode* parameter can be used to specify how the library is loaded. For details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored. -The *use_errno* parameter, when set to True, enables a ctypes -mechanism that allows to access the system `errno` error number in a -safe way. `ctypes` maintains a thread-local copy of the systems -`errno` variable; if you call foreign functions created with -`use_errno=True` then the `errno` value before the function call is -swapped with the ctypes private copy, the same happens immediately -after the function call. - -The function `ctypes.get_errno()` returns the value of the ctypes -private copy, and the function `ctypes.set_errno(value)` changes the -ctypes private copy to `value` and returns the former value. - -The *use_last_error* parameter, when set to True, enables the same -mechanism for the Windows error code which is managed by the -:func:`GetLastError` and :func:`SetLastError` Windows API functions; -`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used -to request and change the ctypes private copy of the windows error -code. +The *use_errno* parameter, when set to True, enables a ctypes mechanism that +allows to access the system :data:`errno` error number in a safe way. +:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` +variable; if you call foreign functions created with ``use_errno=True`` then the +:data:`errno` value before the function call is swapped with the ctypes private +copy, the same happens immediately after the function call. + +The function :func:`ctypes.get_errno` returns the value of the ctypes private +copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy +to a new value and returns the former value. + +The *use_last_error* parameter, when set to True, enables the same mechanism for +the Windows error code which is managed by the :func:`GetLastError` and +:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and +:func:`ctypes.set_last_error` are used to request and change the ctypes private +copy of the windows error code. .. versionadded:: 2.6 The ``use_last_error`` and ``use_errno`` optional parameters @@ -1602,22 +1600,23 @@ .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) The returned function prototype creates functions that use the standard C - calling convention. The function will release the GIL during the call. - If `use_errno` is set to True, the ctypes private copy of the system `errno` - variable is exchanged with the real `errno` value bafore and after the call; - `use_last_error` does the same for the Windows error code. + calling convention. The function will release the GIL during the call. If + *use_errno* is set to True, the ctypes private copy of the system + :data:`errno` variable is exchanged with the real :data:`errno` value bafore + and after the call; *use_last_error* does the same for the Windows error + code. .. versionchanged:: 2.6 - The optional `use_errno` and `use_last_error` parameters were - added. + The optional *use_errno* and *use_last_error* parameters were added. .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) Windows only: The returned function prototype creates functions that use the - ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE` - is the same as :func:`CFUNCTYPE`. The function will release the GIL during the - call. `use_errno` and `use_last_error` have the same meaning as above. + ``stdcall`` calling convention, except on Windows CE where + :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will + release the GIL during the call. *use_errno* and *use_last_error* have the + same meaning as above. .. function:: PYFUNCTYPE(restype, *argtypes) @@ -1864,10 +1863,10 @@ .. function:: find_library(name) :module: ctypes.util - Try to find a library and return a pathname. `name` is the library name without - any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this - is the form used for the posix linker option :option:`-l`). If no library can - be found, returns ``None``. + Try to find a library and return a pathname. *name* is the library name + without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version + number (this is the form used for the posix linker option :option:`-l`). If + no library can be found, returns ``None``. The exact functionality is system dependent. @@ -1905,14 +1904,14 @@ .. function:: get_errno() Returns the current value of the ctypes-private copy of the system - `errno` variable in the calling thread. + :data:`errno` variable in the calling thread. .. versionadded:: 2.6 .. function:: get_last_error() Windows only: returns the current value of the ctypes-private copy of the system - `LastError` variable in the calling thread. + :data:`LastError` variable in the calling thread. .. versionadded:: 2.6 @@ -1969,17 +1968,16 @@ .. function:: set_errno(value) - Set the current value of the ctypes-private copy of the system - `errno` variable in the calling thread to `value` and return the - previous value. + Set the current value of the ctypes-private copy of the system :data:`errno` + variable in the calling thread to *value* and return the previous value. .. versionadded:: 2.6 .. function:: set_last_error(value) - Windows only: set the current value of the ctypes-private copy of - the system `LastError` variable in the calling thread to `value` - and return the previous value. + Windows only: set the current value of the ctypes-private copy of the system + :data:`LastError` variable in the calling thread to *value* and return the + previous value. .. versionadded:: 2.6 Modified: python/branches/tlee-ast-optimize/Doc/library/datetime.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/datetime.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/datetime.rst Wed Jan 14 13:24:17 2009 @@ -266,10 +266,10 @@ considered to be true if and only if it isn't equal to ``timedelta(0)``. Example usage: - + >>> from datetime import timedelta >>> year = timedelta(days=365) - >>> another_year = timedelta(weeks=40, days=84, hours=23, + >>> another_year = timedelta(weeks=40, days=84, hours=23, ... minutes=50, seconds=600) # adds up to 365 days >>> year == another_year True @@ -517,10 +517,10 @@ True >>> my_birthday = date(today.year, 6, 24) >>> if my_birthday < today: - ... my_birthday = my_birthday.replace(year=today.year + 1) + ... my_birthday = my_birthday.replace(year=today.year + 1) >>> my_birthday datetime.date(2008, 6, 24) - >>> time_to_birthday = abs(my_birthday - today) + >>> time_to_birthday = abs(my_birthday - today) >>> time_to_birthday.days 202 @@ -1015,7 +1015,7 @@ >>> tt = dt.timetuple() >>> for it in tt: # doctest: +SKIP ... print it - ... + ... 2006 # year 11 # month 21 # day @@ -1044,23 +1044,23 @@ ... def __init__(self): # DST starts last Sunday in March ... d = datetime(dt.year, 4, 1) # ends last Sunday in October ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) - ... def dst(self, dt): + ... def dst(self, dt): ... if self.dston <= dt.replace(tzinfo=None) < self.dstoff: ... return timedelta(hours=1) ... else: ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +1" - ... + ... >>> class GMT2(tzinfo): ... def __init__(self): - ... d = datetime(dt.year, 4, 1) + ... d = datetime(dt.year, 4, 1) ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) @@ -1071,7 +1071,7 @@ ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +2" - ... + ... >>> gmt1 = GMT1() >>> # Daylight Saving Time >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1) @@ -1092,7 +1092,7 @@ datetime.datetime(2006, 6, 14, 13, 0, tzinfo=) >>> dt2.utctimetuple() == dt3.utctimetuple() True - + .. _datetime-time: @@ -1240,12 +1240,12 @@ return ``None`` or a string object. Example: - + >>> from datetime import time, tzinfo >>> class GMT1(tzinfo): ... def utcoffset(self, dt): - ... return timedelta(hours=1) - ... def dst(self, dt): + ... return timedelta(hours=1) + ... def dst(self, dt): ... return timedelta(0) ... def tzname(self,dt): ... return "Europe/Prague" @@ -1476,7 +1476,7 @@ :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any other fixed-offset :class:`tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)). - + .. _strftime-behavior: @@ -1521,7 +1521,7 @@ The full set of format codes supported varies across platforms, because Python calls the platform C library's :func:`strftime` function, and platform -variations are common. +variations are common. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C Modified: python/branches/tlee-ast-optimize/Doc/library/decimal.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/decimal.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/decimal.rst Wed Jan 14 13:24:17 2009 @@ -328,7 +328,7 @@ infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity - numeric-string ::= [sign] numeric-value | [sign] nan + numeric-string ::= [sign] numeric-value | [sign] nan If *value* is a :class:`tuple`, it should have three components, a sign (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of @@ -484,6 +484,29 @@ .. versionadded:: 2.6 + .. method:: from_float(f) + + Classmethod that converts a float to a decimal number, exactly. + + Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + `0x1.999999999999ap-4`. That equivalent value in decimal is + `0.1000000000000000055511151231257827021181583404541015625`. + + .. doctest:: + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(float('-inf')) + Decimal('-Infinity') + + .. versionadded:: 2.7 + .. method:: fma(other, third[, context]) Fused multiply-add. Return self*other+third with no rounding of the @@ -947,7 +970,7 @@ * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer), * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or * :const:`ROUND_UP` (away from zero). - * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero + * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise towards zero) The *traps* and *flags* fields list any signals to be set. Generally, new @@ -1007,6 +1030,26 @@ If the argument is a string, no leading or trailing whitespace is permitted. + .. method:: create_decimal_from_float(f) + + Creates a new Decimal instance from a float *f* but rounding using *self* + as the context. Unlike the :meth:`Decimal.from_float` class method, + the context precision, rounding method, flags, and traps are applied to + the conversion. + + .. doctest:: + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(math.pi) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(math.pi) + Traceback (most recent call last): + ... + Inexact: None + + .. versionadded:: 2.7 + .. method:: Etiny() Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent @@ -1168,7 +1211,7 @@ .. method:: logical_and(x, y) - Applies the logical operation `and` between each operand's digits. + Applies the logical operation *and* between each operand's digits. .. method:: logical_invert(x) @@ -1178,12 +1221,12 @@ .. method:: logical_or(x, y) - Applies the logical operation `or` between each operand's digits. + Applies the logical operation *or* between each operand's digits. .. method:: logical_xor(x, y) - Applies the logical operation `xor` between each operand's digits. + Applies the logical operation *xor* between each operand's digits. .. method:: max(x, y) @@ -1270,7 +1313,7 @@ that would be obtained by computing ``(x**y) % modulo`` with unbounded precision, but is computed more efficiently. It is always exact. - .. versionchanged:: 2.6 + .. versionchanged:: 2.6 ``y`` may now be nonintegral in ``x**y``. Stricter requirements for the three-argument version. @@ -1294,8 +1337,8 @@ .. method:: remainder_near(x, y) - Returns `x - y * n`, where *n* is the integer nearest the exact value - of `x / y` (if the result is `0` then its sign will be the sign of *x*). + Returns ``x - y * n``, where *n* is the integer nearest the exact value + of ``x / y`` (if the result is 0 then its sign will be the sign of *x*). .. method:: rotate(x, y) @@ -1412,7 +1455,7 @@ sqrt(-x) and x > 0 0 ** 0 x ** (non-integer) - x ** Infinity + x ** Infinity .. class:: Overflow @@ -1515,7 +1558,7 @@ Decimal('9.51111111') >>> u + (v + w) Decimal('9.51111111') - >>> + >>> >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003') >>> (u*v) + (u*w) Decimal('0.0060000') @@ -1654,7 +1697,7 @@ """ q = Decimal(10) ** -places # 2 places --> '0.01' - sign, digits, exp = value.quantize(q).as_tuple() + sign, digits, exp = value.quantize(q).as_tuple() result = [] digits = map(str, digits) build, next = result.append, digits.pop @@ -1711,12 +1754,12 @@ getcontext().prec += 2 i, lasts, s, fact, num = 0, 0, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 1 fact *= i - num *= x - s += num / fact - getcontext().prec -= 2 + num *= x + s += num / fact + getcontext().prec -= 2 return +s def cos(x): @@ -1733,13 +1776,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s def sin(x): @@ -1756,13 +1799,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s @@ -1796,7 +1839,7 @@ >>> Decimal('3.214').quantize(TWOPLACES) Decimal('3.21') - >>> # Validate that a number does not exceed two places + >>> # Validate that a number does not exceed two places >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact])) Decimal('3.21') @@ -1880,13 +1923,14 @@ def float_to_decimal(f): "Convert a floating point number to a Decimal with no loss of information" n, d = f.as_integer_ratio() - with localcontext() as ctx: - ctx.traps[Inexact] = True - while True: - try: - return Decimal(n) / Decimal(d) - except Inexact: - ctx.prec += 1 + numerator, denominator = Decimal(n), Decimal(d) + ctx = Context(prec=60) + result = ctx.divide(numerator, denominator) + while ctx.flags[Inexact]: + ctx.flags[Inexact] = False + ctx.prec *= 2 + result = ctx.divide(numerator, denominator) + return result .. doctest:: Modified: python/branches/tlee-ast-optimize/Doc/library/difflib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/difflib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/difflib.rst Wed Jan 14 13:24:17 2009 @@ -428,7 +428,7 @@ .. XXX Explain why a dummy is used! - .. versionchanged:: 2.5 + .. versionchanged:: 2.5 The guarantee that adjacent triples always describe non-adjacent blocks was implemented. Modified: python/branches/tlee-ast-optimize/Doc/library/dircache.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/dircache.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/dircache.rst Wed Jan 14 13:24:17 2009 @@ -5,11 +5,11 @@ .. module:: dircache :synopsis: Return directory listing, with cache mechanism. :deprecated: - + .. deprecated:: 2.6 The :mod:`dircache` module has been removed in Python 3.0. - - + + .. sectionauthor:: Moshe Zadka Modified: python/branches/tlee-ast-optimize/Doc/library/dis.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/dis.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/dis.rst Wed Jan 14 13:24:17 2009 @@ -64,8 +64,21 @@ .. function:: disco(code[, lasti]) - A synonym for disassemble. It is more convenient to type, and kept for - compatibility with earlier Python releases. + A synonym for :func:`disassemble`. It is more convenient to type, and kept + for compatibility with earlier Python releases. + + +.. function:: findlinestarts(code) + + This generator function uses the ``co_firstlineno`` and ``co_lnotab`` + attributes of the code object *code* to find the offsets which are starts of + lines in the source code. They are generated as ``(offset, lineno)`` pairs. + + +.. function:: findlabels(code) + + Detect all offsets in the code object *code* which are jump targets, and + return a list of these offsets. .. data:: opname @@ -463,9 +476,11 @@ address to jump to (which should be a ``FOR_ITER`` instruction). -.. opcode:: LIST_APPEND () +.. opcode:: LIST_APPEND (i) - Calls ``list.append(TOS1, TOS)``. Used to implement list comprehensions. + Calls ``list.append(TOS[-i], TOS)``. Used to implement list comprehensions. + While the appended value is popped off, the list object remains on the + stack so that it is available for further iterations of the loop. .. opcode:: LOAD_LOCALS () @@ -755,7 +770,7 @@ opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, - the function object to call is on the stack. Pops all function arguments, and + the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value. Modified: python/branches/tlee-ast-optimize/Doc/library/dl.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/dl.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/dl.rst Wed Jan 14 13:24:17 2009 @@ -6,11 +6,11 @@ :platform: Unix :synopsis: Call C functions in shared objects. :deprecated: - + .. deprecated:: 2.6 The :mod:`dl` module has been removed in Python 3.0. Use the :mod:`ctypes` module instead. - + .. sectionauthor:: Moshe Zadka The :mod:`dl` module defines an interface to the :cfunc:`dlopen` function, which @@ -91,9 +91,9 @@ Return the pointer for the function named *name*, as a number, if it exists in the referenced shared object, otherwise ``None``. This is useful in code like:: - >>> if a.sym('time'): + >>> if a.sym('time'): ... a.call('time') - ... else: + ... else: ... time.time() (Note that this function will return a non-zero number, as zero is the *NULL* Modified: python/branches/tlee-ast-optimize/Doc/library/email.mime.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/email.mime.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/email.mime.rst Wed Jan 14 13:24:17 2009 @@ -2,7 +2,7 @@ ---------------------------------------------------------- .. module:: email.mime - :synopsis: Build MIME messages. + :synopsis: Build MIME messages. Ordinarily, you get a message object structure by passing a file or some text to @@ -19,6 +19,7 @@ Here are the classes: +.. currentmodule:: email.mime.base .. class:: MIMEBase(_maintype, _subtype, **_params) @@ -39,6 +40,8 @@ :mailheader:`MIME-Version` header (always set to ``1.0``). +.. currentmodule:: email.mime.nonmultipart + .. class:: MIMENonMultipart() Module: :mod:`email.mime.nonmultipart` @@ -52,14 +55,16 @@ .. versionadded:: 2.2.2 -.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) +.. currentmodule:: email.mime.multipart + +.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A - :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be + :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added. @@ -77,6 +82,8 @@ .. versionadded:: 2.2.2 +.. currentmodule:: email.mime.application + .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.application` @@ -99,6 +106,8 @@ .. versionadded:: 2.5 +.. currentmodule:: email.mime.audio + .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.audio` @@ -122,6 +131,8 @@ *_params* are passed straight through to the base class constructor. +.. currentmodule:: email.mime.image + .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) Module: :mod:`email.mime.image` @@ -145,6 +156,8 @@ *_params* are passed straight through to the :class:`MIMEBase` constructor. +.. currentmodule:: email.mime.message + .. class:: MIMEMessage(_msg[, _subtype]) Module: :mod:`email.mime.message` @@ -158,6 +171,8 @@ :mimetype:`rfc822`. +.. currentmodule:: email.mime.text + .. class:: MIMEText(_text[, _subtype[, _charset]]) Module: :mod:`email.mime.text` Modified: python/branches/tlee-ast-optimize/Doc/library/fileinput.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/fileinput.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/fileinput.rst Wed Jan 14 13:24:17 2009 @@ -151,7 +151,7 @@ when standard input is read. .. warning:: - + The current implementation does not work for MS-DOS 8+3 filesystems. Modified: python/branches/tlee-ast-optimize/Doc/library/fl.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/fl.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/fl.rst Wed Jan 14 13:24:17 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: FORMS library for applications with graphical user interfaces. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`fl` module has been deprecated for removal in Python 3.0. @@ -484,8 +484,8 @@ :platform: IRIX :synopsis: Constants used with the fl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`FL` module has been deprecated for removal in Python 3.0. @@ -506,8 +506,8 @@ :platform: IRIX :synopsis: Functions for loading stored FORMS designs. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`flp` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/fm.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/fm.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/fm.rst Wed Jan 14 13:24:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Font Manager interface for SGI workstations. :deprecated: - + .. deprecated:: 2.6 The :mod:`fm` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/fpformat.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/fpformat.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/fpformat.rst Wed Jan 14 13:24:17 2009 @@ -5,10 +5,10 @@ .. module:: fpformat :synopsis: General floating point formatting functions. :deprecated: - + .. deprecated:: 2.6 The :mod:`fpformat` module has been removed in Python 3.0. - + .. sectionauthor:: Moshe Zadka Modified: python/branches/tlee-ast-optimize/Doc/library/fractions.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/fractions.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/fractions.rst Wed Jan 14 13:24:17 2009 @@ -101,11 +101,11 @@ .. function:: gcd(a, b) - Return the greatest common divisor of the integers `a` and `b`. If - either `a` or `b` is nonzero, then the absolute value of `gcd(a, - b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)` - has the same sign as `b` if `b` is nonzero; otherwise it takes the sign - of `a`. `gcd(0, 0)` returns `0`. + Return the greatest common divisor of the integers *a* and *b*. If either + *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the + largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same + sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0, + 0)`` returns ``0``. .. seealso:: Modified: python/branches/tlee-ast-optimize/Doc/library/ftplib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ftplib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ftplib.rst Wed Jan 14 13:24:17 2009 @@ -1,4 +1,3 @@ - :mod:`ftplib` --- FTP protocol client ===================================== Modified: python/branches/tlee-ast-optimize/Doc/library/functions.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/functions.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/functions.rst Wed Jan 14 13:24:17 2009 @@ -8,67 +8,6 @@ available. They are listed here in alphabetical order. -.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) - - .. index:: - statement: import - module: ihooks - module: rexec - module: imp - - .. note:: - - This is an advanced function that is not needed in everyday Python - programming. - - The function is invoked by the :keyword:`import` statement. It mainly exists - so that you can replace it with another function that has a compatible - interface, in order to change the semantics of the :keyword:`import` statement. - See the built-in module :mod:`imp`, which defines some useful operations out - of which you can build your own :func:`__import__` function. - - For example, the statement ``import spam`` results in the following call: - ``__import__('spam', globals(), locals(), [], -1)``; the statement - ``from spam.ham import eggs`` results in ``__import__('spam.ham', globals(), - locals(), ['eggs'], -1)``. Note that even though ``locals()`` and ``['eggs']`` - are passed in as arguments, the :func:`__import__` function does not set the - local variable named ``eggs``; this is done by subsequent code that is generated - for the import statement. (In fact, the standard implementation does not use - its *locals* argument at all, and uses its *globals* only to determine the - package context of the :keyword:`import` statement.) - - When the *name* variable is of the form ``package.module``, normally, the - top-level package (the name up till the first dot) is returned, *not* the - module named by *name*. However, when a non-empty *fromlist* argument is - given, the module named by *name* is returned. This is done for - compatibility with the :term:`bytecode` generated for the different kinds of import - statement; when using ``import spam.ham.eggs``, the top-level package - :mod:`spam` must be placed in the importing namespace, but when using ``from - spam.ham import eggs``, the ``spam.ham`` subpackage must be used to find the - ``eggs`` variable. As a workaround for this behavior, use :func:`getattr` to - extract the desired components. For example, you could define the following - helper:: - - def my_import(name): - mod = __import__(name) - components = name.split('.') - for comp in components[1:]: - mod = getattr(mod, comp) - return mod - - *level* specifies whether to use absolute or relative imports. The default is - ``-1`` which indicates both absolute and relative imports will be attempted. - ``0`` means only perform absolute imports. Positive values for *level* indicate - the number of parent directories to search relative to the directory of the - module calling :func:`__import__`. - - .. versionchanged:: 2.5 - The level parameter was added. - - .. versionchanged:: 2.5 - Keyword support for parameters was added. - - .. function:: abs(x) Return the absolute value of a number. The argument may be a plain or long @@ -949,7 +888,7 @@ .. versionchanged:: 2.5 Use *fget*'s docstring if no *doc* given. - .. versionchanged:: 2.6 + .. versionchanged:: 2.6 The ``getter``, ``setter``, and ``deleter`` attributes were added. @@ -1239,10 +1178,10 @@ 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. - + The second use case is to support cooperative multiple inheritence 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 + 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 @@ -1303,7 +1242,7 @@ >>> class X(object): ... a = 1 - ... + ... >>> X = type('X', (object,), dict(a=1)) .. versionadded:: 2.2 @@ -1419,6 +1358,83 @@ Formerly, :func:`zip` required at least one argument and ``zip()`` raised a :exc:`TypeError` instead of returning an empty list. + +.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) + + .. index:: + statement: import + module: imp + + .. note:: + + This is an advanced function that is not needed in everyday Python + programming. + + This function is invoked by the :keyword:`import` statement. It can be + replaced (by importing the :mod:`builtins` module and assigning to + ``builtins.__import__``) in order to change semantics of the + :keyword:`import` statement, but nowadays it is usually simpler to use import + hooks (see :pep:`302`). Direct use of :func:`__import__` is rare, except in + cases where you want to import a module whose name is only known at runtime. + + The function imports the module *name*, potentially using the given *globals* + and *locals* to determine how to interpret the name in a package context. + The *fromlist* gives the names of objects or submodules that should be + imported from the module given by *name*. The standard implementation does + not use its *locals* argument at all, and uses its *globals* only to + determine the package context of the :keyword:`import` statement. + + *level* specifies whether to use absolute or relative imports. The default + is ``-1`` which indicates both absolute and relative imports will be + attempted. ``0`` means only perform absolute imports. Positive values for + *level* indicate the number of parent directories to search relative to the + directory of the module calling :func:`__import__`. + + When the *name* variable is of the form ``package.module``, normally, the + top-level package (the name up till the first dot) is returned, *not* the + module named by *name*. However, when a non-empty *fromlist* argument is + given, the module named by *name* is returned. + + For example, the statement ``import spam`` results in bytecode resembling the + following code:: + + spam = __import__('spam', globals(), locals(), [], -1) + + The statement ``import spam.ham`` results in this call:: + + spam = __import__('spam.ham', globals(), locals(), [], -1) + + Note how :func:`__import__` returns the toplevel module here because this is + the object that is bound to a name by the :keyword:`import` statement. + + On the other hand, the statement ``from spam.ham import eggs, sausage as + saus`` results in :: + + _temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], -1) + eggs = _temp.eggs + saus = _temp.sausage + + Here, the ``spam.ham`` module is returned from :func:`__import__`. From this + object, the names to import are retrieved and assigned to their respective + names. + + If you simply want to import a module (potentially within a package) by name, + you can get it from :data:`sys.modules`:: + + >>> import sys + >>> name = 'foo.bar.baz' + >>> __import__(name) + + >>> baz = sys.modules[name] + >>> baz + + + .. versionchanged:: 2.5 + The level parameter was added. + + .. versionchanged:: 2.5 + Keyword support for parameters was added. + .. --------------------------------------------------------------------------- Modified: python/branches/tlee-ast-optimize/Doc/library/getopt.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/getopt.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/getopt.rst Wed Jan 14 13:24:17 2009 @@ -63,8 +63,8 @@ non-option argument is encountered. If the first character of the option string is '+', or if the environment - variable POSIXLY_CORRECT is set, then option processing stops as soon as a - non-option argument is encountered. + variable :envvar:`POSIXLY_CORRECT` is set, then option processing stops as + soon as a non-option argument is encountered. .. versionadded:: 2.3 Modified: python/branches/tlee-ast-optimize/Doc/library/gettext.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/gettext.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/gettext.rst Wed Jan 14 13:24:17 2009 @@ -648,10 +648,9 @@ animals = ['mollusk', 'albatross', - 'rat', - 'penguin', - 'python', - ] + 'rat', + 'penguin', + 'python', ] # ... for a in animals: print a @@ -666,10 +665,9 @@ animals = [_('mollusk'), _('albatross'), - _('rat'), - _('penguin'), - _('python'), - ] + _('rat'), + _('penguin'), + _('python'), ] del _ @@ -692,10 +690,9 @@ animals = [N_('mollusk'), N_('albatross'), - N_('rat'), - N_('penguin'), - N_('python'), - ] + N_('rat'), + N_('penguin'), + N_('python'), ] # ... for a in animals: Modified: python/branches/tlee-ast-optimize/Doc/library/gl.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/gl.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/gl.rst Wed Jan 14 13:24:17 2009 @@ -6,8 +6,8 @@ :platform: IRIX :synopsis: Functions from the Silicon Graphics Graphics Library. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`gl` module has been deprecated for removal in Python 3.0. @@ -166,8 +166,8 @@ :platform: IRIX :synopsis: Constants used with the gl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`DEVICE` module has been deprecated for removal in Python 3.0. @@ -184,8 +184,8 @@ :platform: IRIX :synopsis: Constants used with the gl module. :deprecated: - - + + .. deprecated:: 2.6 The :mod:`GL` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/gzip.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/gzip.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/gzip.rst Wed Jan 14 13:24:17 2009 @@ -7,7 +7,7 @@ This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would. -The data compression is provided by the :mod:``zlib`` module. +The data compression is provided by the :mod:`zlib` module. The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled after Python's File Object. The :class:`GzipFile` class reads and writes @@ -24,7 +24,7 @@ The module defines the following items: -.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj]]]]) +.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]]) Constructor for the :class:`GzipFile` class, which simulates most of the methods of a file object, with the exception of the :meth:`readinto` and @@ -52,6 +52,15 @@ level of compression; ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. The default is ``9``. + The *mtime* argument is an optional numeric timestamp to be written to + the stream when compressing. All :program:`gzip`compressed streams are + required to contain a timestamp. If omitted or ``None``, the current + time is used. This module ignores the timestamp when decompressing; + however, some programs, such as :program:`gunzip`\ , make use of it. + The format of the timestamp is the same as that of the return value of + ``time.time()`` and of the ``st_mtime`` member of the object returned + by ``os.stat()``. + Calling a :class:`GzipFile` object's :meth:`close` method does not close *fileobj*, since you might wish to append more material after the compressed data. This also allows you to pass a :class:`StringIO` object opened for Modified: python/branches/tlee-ast-optimize/Doc/library/hashlib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/hashlib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/hashlib.rst Wed Jan 14 13:24:17 2009 @@ -4,8 +4,8 @@ .. module:: hashlib :synopsis: Secure hash and message digest algorithms. -.. moduleauthor:: Gregory P. Smith -.. sectionauthor:: Gregory P. Smith +.. moduleauthor:: Gregory P. Smith +.. sectionauthor:: Gregory P. Smith .. versionadded:: 2.5 Modified: python/branches/tlee-ast-optimize/Doc/library/heapq.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/heapq.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/heapq.rst Wed Jan 14 13:24:17 2009 @@ -88,6 +88,21 @@ >>> print data == ordered True +Using a heap to insert items at the correct place in a priority queue: + + >>> heap = [] + >>> data = [(1, 'J'), (4, 'N'), (3, 'H'), (2, 'O')] + >>> for item in data: + ... heappush(heap, item) + ... + >>> while heap: + ... print heappop(heap)[1] + J + O + H + N + + The module also offers three general purpose functions based on heaps. Modified: python/branches/tlee-ast-optimize/Doc/library/htmllib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/htmllib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/htmllib.rst Wed Jan 14 13:24:17 2009 @@ -4,7 +4,7 @@ .. module:: htmllib :synopsis: A parser for HTML documents. :deprecated: - + .. deprecated:: 2.6 The :mod:`htmllib` module has been removed in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/idle.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/idle.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/idle.rst Wed Jan 14 13:24:17 2009 @@ -230,7 +230,7 @@ Keywords orange - Strings + Strings green Comments Modified: python/branches/tlee-ast-optimize/Doc/library/imageop.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/imageop.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/imageop.rst Wed Jan 14 13:24:17 2009 @@ -5,7 +5,7 @@ .. module:: imageop :synopsis: Manipulate raw image data. :deprecated: - + .. deprecated:: 2.6 The :mod:`imageop` module has been removed in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/imgfile.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/imgfile.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/imgfile.rst Wed Jan 14 13:24:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Support for SGI imglib files. :deprecated: - + .. deprecated:: 2.6 The :mod:`imgfile` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/io.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/io.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/io.rst Wed Jan 14 13:24:17 2009 @@ -6,7 +6,7 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson .. versionadded:: 2.6 The :mod:`io` module provides the Python interfaces to stream handling. The @@ -215,7 +215,7 @@ .. method:: close() Flush and close this stream. This method has no effect if the file is - already closed. Once the file is closed, any operation on the file + already closed. Once the file is closed, any operation on the file (e.g. reading or writing) will raise an :exc:`IOError`. The internal file descriptor isn't closed if *closefd* was False. @@ -629,7 +629,7 @@ .. attribute:: line_buffering Whether line buffering is enabled. - + .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) Modified: python/branches/tlee-ast-optimize/Doc/library/itertools.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/itertools.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/itertools.rst Wed Jan 14 13:24:17 2009 @@ -76,7 +76,7 @@ .. function:: itertools.chain.from_iterable(iterable) - Alternate constructor for :func:`chain`. Gets chained inputs from a + Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Equivalent to:: @classmethod @@ -93,9 +93,9 @@ Return *r* length subsequences of elements from the input *iterable*. - Combinations are emitted in lexicographic sort order. So, if the + Combinations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the combination tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -108,6 +108,8 @@ # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) + if r > n: + return indices = range(r) yield tuple(pool[i] for i in indices) while 1: @@ -132,6 +134,9 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. + .. versionadded:: 2.6 .. function:: count([n]) @@ -314,7 +319,7 @@ for i, element in enumerate(iterable): if i == nexti: yield element - nexti = it.next() + nexti = it.next() If *start* is ``None``, then iteration starts at zero. If *step* is ``None``, then the step defaults to one. @@ -380,12 +385,12 @@ Return successive *r* length permutations of elements in the *iterable*. If *r* is not specified or is ``None``, then *r* defaults to the length - of the *iterable* and all possible full-length permutations + of the *iterable* and all possible full-length permutations are generated. - Permutations are emitted in lexicographic sort order. So, if the + Permutations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the permutation tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -399,6 +404,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) @@ -416,7 +423,7 @@ else: return - The code for :func:`permutations` can be also expressed as a subsequence of + The code for :func:`permutations` can be also expressed as a subsequence of :func:`product`, filtered to exclude entries with repeated elements (those from the same position in the input pool):: @@ -428,6 +435,9 @@ if len(set(indices)) == r: yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. + .. versionadded:: 2.6 .. function:: product(*iterables[, repeat]) @@ -547,7 +557,7 @@ .. doctest:: - # Show a dictionary sorted and grouped by value + >>> # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.iteritems(), key=itemgetter(1)) @@ -558,13 +568,13 @@ 2 ['b', 'd', 'f'] 3 ['g'] - # Find runs of consecutive numbers using groupby. The key to the solution - # is differencing with a range so that consecutive numbers all appear in - # same group. + >>> # Find runs of consecutive numbers using groupby. The key to the solution + >>> # is differencing with a range so that consecutive numbers all appear in + >>> # same group. >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x): ... print map(itemgetter(1), g) - ... + ... [1] [4, 5, 6] [10] @@ -674,7 +684,8 @@ return (d for d, s in izip(data, selectors) if s) def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) indices = [0] * r @@ -687,3 +698,27 @@ return 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 imap(next, imap(itemgetter(1), groupby(iterable, key))) Modified: python/branches/tlee-ast-optimize/Doc/library/jpeg.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/jpeg.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/jpeg.rst Wed Jan 14 13:24:17 2009 @@ -6,7 +6,7 @@ :platform: IRIX :synopsis: Read and write image files in compressed JPEG format. :deprecated: - + .. deprecated:: 2.6 The :mod:`jpeg` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/json.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/json.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/json.rst Wed Jan 14 13:24:17 2009 @@ -14,7 +14,7 @@ :mod:`marshal` and :mod:`pickle` modules. Encoding basic Python object hierarchies:: - + >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' @@ -43,12 +43,12 @@ >>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) { - "4": 5, + "4": 5, "6": 7 } Decoding JSON:: - + >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] @@ -66,7 +66,7 @@ ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct - ... + ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) @@ -75,26 +75,26 @@ Decimal('1.1') Extending :class:`JSONEncoder`:: - + >>> import json >>> class ComplexEncoder(json.JSONEncoder): ... def default(self, obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... return json.JSONEncoder.default(self, obj) - ... + ... >>> dumps(2 + 1j, cls=ComplexEncoder) '[2.0, 1.0]' >>> ComplexEncoder().encode(2 + 1j) '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[', '2.0', ', ', '1.0', ']'] - + .. highlight:: none Using json.tool from the shell to validate and pretty-print:: - + $ echo '{"json":"obj"}' | python -mjson.tool { "json": "obj" @@ -104,7 +104,7 @@ .. highlight:: python -.. note:: +.. note:: The JSON produced by this module's default settings is a subset of YAML, so it may be used as a serializer for that as well. @@ -152,7 +152,7 @@ *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. - To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the + To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the *cls* kwarg. @@ -166,7 +166,7 @@ :func:`dump`. -.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -202,7 +202,7 @@ class. -.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) +.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]]) Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON document) to a Python object. @@ -368,7 +368,7 @@ For example, to support arbitrary iterators, you could implement default like this:: - + def default(self, o): try: iterable = iter(o) @@ -392,6 +392,6 @@ Encode the given object, *o*, and yield each string representation as available. For example:: - + for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) Modified: python/branches/tlee-ast-optimize/Doc/library/locale.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/locale.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/locale.rst Wed Jan 14 13:24:17 2009 @@ -494,7 +494,7 @@ >>> import locale >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale Modified: python/branches/tlee-ast-optimize/Doc/library/logging.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/logging.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/logging.rst Wed Jan 14 13:24:17 2009 @@ -121,7 +121,7 @@ messages at different log levels. This allows you to instrument your code with debug messages, for example, but turning the log level down so that those debug messages are not written for your production system. The default levels are -``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``. +``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``. The logger, handler, and log message call each specify a level. The log message is only emitted if the handler and logger are configured to emit messages of @@ -422,6 +422,8 @@ code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties. +.. _library-config: + Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -461,6 +463,12 @@ libraries, then the logger name specified can be "orgname.foo" rather than just "foo". +.. versionadded:: 2.7 + +The :class:`NullHandler` class was not present in previous versions, but is now +included, so that it need not be defined in library code. + + Logging Levels -------------- @@ -524,39 +532,55 @@ #. :class:`FileHandler` instances send error messages to disk files. -#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log - files at a certain point. It is not meant to be instantiated directly. Instead, - use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. +#. :class:`handlers.BaseRotatingHandler` is the base class for handlers that + rotate log files at a certain point. It is not meant to be instantiated + directly. Instead, use :class:`RotatingFileHandler` or + :class:`TimedRotatingFileHandler`. -#. :class:`RotatingFileHandler` instances send error messages to disk files, +#. :class:`handlers.RotatingFileHandler` instances send error messages to disk files, with support for maximum log file sizes and log file rotation. -#. :class:`TimedRotatingFileHandler` instances send error messages to disk files +#. :class:`handlers.TimedRotatingFileHandler` instances send error messages to disk files rotating the log file at certain timed intervals. -#. :class:`SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`handlers.SocketHandler` instances send error messages to TCP/IP sockets. -#. :class:`DatagramHandler` instances send error messages to UDP sockets. +#. :class:`handlers.DatagramHandler` instances send error messages to UDP sockets. -#. :class:`SMTPHandler` instances send error messages to a designated email +#. :class:`handlers.SMTPHandler` instances send error messages to a designated email address. -#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon, +#. :class:`handlers.SysLogHandler` instances send error messages to a Unix syslog daemon, possibly on a remote machine. -#. :class:`NTEventLogHandler` instances send error messages to a Windows +#. :class:`handlers.NTEventLogHandler` instances send error messages to a Windows NT/2000/XP event log. -#. :class:`MemoryHandler` instances send error messages to a buffer in memory, +#. :class:`handlers.MemoryHandler` instances send error messages to a buffer in memory, which is flushed whenever specific criteria are met. -#. :class:`HTTPHandler` instances send error messages to an HTTP server using +#. :class:`handlers.HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. -The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the -core logging package. The other handlers are defined in a sub- module, -:mod:`logging.handlers`. (There is also another sub-module, -:mod:`logging.config`, for configuration functionality.) +#. :class:`handlers.WatchedFileHandler` instances watch the file they are logging to. If +the file changes, it is closed and reopened using the file name. This handler +is only useful on Unix-like systems; Windows does not support the underlying +mechanism used. + +#. :class:`NullHandler` instances do nothing with error messages. They are used + by library developers who want to use logging, but want to avoid the "No + handlers could be found for logger XXX" message which can be displayed if + the library user has not configured logging. See :ref:`library-config` for + more information. + +.. versionadded:: 2.7 + +The :class:`NullHandler` class was not present in previous versions. + +The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` +classes are defined in the core logging package. The other handlers are +defined in a sub- module, :mod:`logging.handlers`. (There is also another +sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the :class:`Formatter` class. They are initialized with a format string suitable for @@ -1599,11 +1623,35 @@ Outputs the record to the file. +NullHandler +^^^^^^^^^^^ + +.. versionadded:: 2.7 + +The :class:`NullHandler` class, located in the core :mod:`logging` package, +does not do any formatting or output. It is essentially a "no-op" handler +for use by library developers. + + +.. class:: NullHandler() + + Returns a new instance of the :class:`NullHandler` class. + + + .. method:: emit(record) + + This method does nothing. + +See :ref:`library-config` for more information on how to use +:class:`NullHandler`. + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ .. versionadded:: 2.6 +.. module:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. @@ -2050,6 +2098,8 @@ Formatter Objects ----------------- +.. currentmodule:: logging + :class:`Formatter`\ s have the following attributes and methods. They are responsible for converting a :class:`LogRecord` to (usually) a string which can be interpreted by either a human or an external system. The base @@ -2285,12 +2335,12 @@ .. function:: fileConfig(fname[, defaults]) - Reads the logging configuration from a ConfigParser-format file named *fname*. - This function can be called several times from an application, allowing an end - user the ability to select from various pre-canned configurations (if the - developer provides a mechanism to present the choices and load the chosen - configuration). Defaults to be passed to ConfigParser can be specified in the - *defaults* argument. + Reads the logging configuration from a :mod:`ConfigParser`\-format file named + *fname*. This function can be called several times from an application, + allowing an end user the ability to select from various pre-canned + configurations (if the developer provides a mechanism to present the choices + and load the chosen configuration). Defaults to be passed to the ConfigParser + can be specified in the *defaults* argument. .. function:: listen([port]) @@ -2321,17 +2371,17 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^ The configuration file format understood by :func:`fileConfig` is based on -ConfigParser functionality. The file must contain sections called ``[loggers]``, -``[handlers]`` and ``[formatters]`` which identify by name the entities of each -type which are defined in the file. For each such entity, there is a separate -section which identified how that entity is configured. Thus, for a logger named -``log01`` in the ``[loggers]`` section, the relevant configuration details are -held in a section ``[logger_log01]``. Similarly, a handler called ``hand01`` in -the ``[handlers]`` section will have its configuration held in a section called -``[handler_hand01]``, while a formatter called ``form01`` in the -``[formatters]`` section will have its configuration specified in a section -called ``[formatter_form01]``. The root logger configuration must be specified -in a section called ``[logger_root]``. +:mod:`ConfigParser` functionality. The file must contain sections called +``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the +entities of each type which are defined in the file. For each such entity, +there is a separate section which identifies how that entity is configured. +Thus, for a logger named ``log01`` in the ``[loggers]`` section, the relevant +configuration details are held in a section ``[logger_log01]``. Similarly, a +handler called ``hand01`` in the ``[handlers]`` section will have its +configuration held in a section called ``[handler_hand01]``, while a formatter +called ``form01`` in the ``[formatters]`` section will have its configuration +specified in a section called ``[formatter_form01]``. The root logger +configuration must be specified in a section called ``[logger_root]``. Examples of these sections in the file are given below. :: Modified: python/branches/tlee-ast-optimize/Doc/library/macos.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/macos.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/macos.rst Wed Jan 14 13:24:17 2009 @@ -82,7 +82,7 @@ parameter can be a pathname or an ``FSSpec`` or ``FSRef`` object. .. note:: - + It is not possible to use an ``FSSpec`` in 64-bit mode. @@ -93,7 +93,7 @@ strings. .. note:: - + It is not possible to use an ``FSSpec`` in 64-bit mode. .. function:: openrf(name [, mode]) Modified: python/branches/tlee-ast-optimize/Doc/library/mailbox.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/mailbox.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/mailbox.rst Wed Jan 14 13:24:17 2009 @@ -1686,7 +1686,7 @@ # that's better than losing a message completely. box.lock() box.add(message) - box.flush() + box.flush() box.unlock() # Remove original message Modified: python/branches/tlee-ast-optimize/Doc/library/marshal.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/marshal.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/marshal.rst Wed Jan 14 13:24:17 2009 @@ -45,7 +45,7 @@ (they will cause infinite loops). .. warning:: - + On machines where C's ``long int`` type has more than 32 bits (such as the DEC Alpha), it is possible to create plain Python integers that are longer than 32 bits. If such an integer is marshaled and read back in on a machine Modified: python/branches/tlee-ast-optimize/Doc/library/math.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/math.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/math.rst Wed Jan 14 13:24:17 2009 @@ -21,8 +21,9 @@ The following functions are provided by this module. Except when explicitly noted otherwise, all return values are floats. -Number-theoretic and representation functions: +Number-theoretic and representation functions +--------------------------------------------- .. function:: ceil(x) @@ -108,7 +109,7 @@ .. function:: isnan(x) Checks if the float *x* is a NaN (not a number). NaNs are part of the - IEEE 754 standards. Operation like but not limited to ``inf * 0``, + IEEE 754 standards. Operation like but not limited to ``inf * 0``, ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return a NaN. @@ -123,8 +124,8 @@ .. function:: modf(x) - Return the fractional and integer parts of *x*. Both results carry the sign of - *x*, and both are floats. + Return the fractional and integer parts of *x*. Both results carry the sign + of *x* and are floats. .. function:: trunc(x) @@ -146,7 +147,9 @@ platform C double type), in which case any float *x* with ``abs(x) >= 2**52`` necessarily has no fractional bits. -Power and logarithmic functions: + +Power and logarithmic functions +------------------------------- .. function:: exp(x) @@ -193,7 +196,8 @@ Return the square root of *x*. -Trigonometric functions: +Trigonometric functions +----------------------- .. function:: acos(x) @@ -241,7 +245,8 @@ Return the tangent of *x* radians. -Angular conversion: +Angular conversion +------------------ .. function:: degrees(x) @@ -253,7 +258,8 @@ Converts angle *x* from degrees to radians. -Hyperbolic functions: +Hyperbolic functions +-------------------- .. function:: acosh(x) @@ -291,7 +297,8 @@ Return the hyperbolic tangent of *x*. -The module also defines two mathematical constants: +Constants +--------- .. data:: pi Modified: python/branches/tlee-ast-optimize/Doc/library/mhlib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/mhlib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/mhlib.rst Wed Jan 14 13:24:17 2009 @@ -4,7 +4,7 @@ .. module:: mhlib :synopsis: Manipulate MH mailboxes from Python. :deprecated: - + .. deprecated:: 2.6 The :mod:`mhlib` module has been removed in Python 3.0. Use the :mod:`mailbox` instead. Modified: python/branches/tlee-ast-optimize/Doc/library/mmap.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/mmap.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/mmap.rst Wed Jan 14 13:24:17 2009 @@ -93,7 +93,7 @@ will be relative to the offset from the beginning of the file. *offset* defaults to 0. *offset* must be a multiple of the PAGESIZE or ALLOCATIONGRANULARITY. - + This example shows a simple way of using :class:`mmap`:: import mmap Modified: python/branches/tlee-ast-optimize/Doc/library/msvcrt.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/msvcrt.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/msvcrt.rst Wed Jan 14 13:24:17 2009 @@ -18,7 +18,7 @@ The module implements both the normal and wide char variants of the console I/O api. The normal API deals only with ASCII characters and is of limited use -for internationalized applications. The wide char API should be used where +for internationalized applications. The wide char API should be used where ever possible .. _msvcrt-files: @@ -98,13 +98,13 @@ return the keycode. The :kbd:`Control-C` keypress cannot be read with this function. - + .. function:: getwch() Wide char variant of :func:`getch`, returning a Unicode value. - + .. versionadded:: 2.6 - + .. function:: getche() @@ -115,7 +115,7 @@ .. function:: getwche() Wide char variant of :func:`getche`, returning a Unicode value. - + .. versionadded:: 2.6 @@ -123,24 +123,24 @@ Print the character *char* to the console without buffering. - + .. function:: putwch(unicode_char) Wide char variant of :func:`putch`, accepting a Unicode value. - + .. versionadded:: 2.6 - + .. function:: ungetch(char) Cause the character *char* to be "pushed back" into the console buffer; it will be the next character read by :func:`getch` or :func:`getche`. - + .. function:: ungetwch(unicode_char) Wide char variant of :func:`ungetch`, accepting a Unicode value. - + .. versionadded:: 2.6 Modified: python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst Wed Jan 14 13:24:17 2009 @@ -21,9 +21,9 @@ .. warning:: Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See :issue:`3770` for additional information. .. note:: @@ -37,8 +37,8 @@ >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): - ... return x*x - ... + ... return x*x + ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: @@ -77,11 +77,11 @@ print 'module name:', __name__ print 'parent process:', os.getppid() print 'process id:', os.getpid() - + def f(name): info('function f') print 'hello', name - + if __name__ == '__main__': info('main line') p = Process(target=f, args=('bob',)) @@ -109,12 +109,12 @@ def f(q): q.put([42, None, 'hello']) - if __name__ == '__main__': - q = Queue() - p = Process(target=f, args=(q,)) - p.start() - print q.get() # prints "[42, None, 'hello']" - p.join() + if __name__ == '__main__': + q = Queue() + p = Process(target=f, args=(q,)) + p.start() + print q.get() # prints "[42, None, 'hello']" + p.join() Queues are thread and process safe. @@ -358,7 +358,7 @@ .. attribute:: daemon - The process's daemon flag, a Boolean value. This must be called before + The process's daemon flag, a Boolean value. This must be set before :meth:`start` is called. The initial value is inherited from the creating process. @@ -543,7 +543,7 @@ .. method:: put(item[, block[, timeout]]) - Put item into the queue. If the optional argument *block* is ``True`` + Put item into the queue. If the optional argument *block* is ``True`` (the default) and *timeout* is ``None`` (the default), block if necessary until a free slot is available. If *timeout* is a positive number, it blocks at most *timeout* seconds and raises the :exc:`Queue.Full` exception if no @@ -858,7 +858,7 @@ acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it specifies a timeout in seconds. If *block* is ``False`` then *timeout* is ignored. - + Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments for these will be ignored. @@ -1135,22 +1135,22 @@ server process which is using the given address and authentication key. .. method:: get_server() - + Returns a :class:`Server` object which represents the actual server under - the control of the Manager. The :class:`Server` object supports the - :meth:`serve_forever` method:: - - >>> from multiprocessing.managers import BaseManager - >>> m = BaseManager(address=('', 50000), authkey='abc')) - >>> server = m.get_server() - >>> s.serve_forever() - - :class:`Server` additionally have an :attr:`address` attribute. + the control of the Manager. The :class:`Server` object supports the + :meth:`serve_forever` method: + + >>> from multiprocessing.managers import BaseManager + >>> m = BaseManager(address=('', 50000), authkey='abc')) + >>> server = m.get_server() + >>> s.serve_forever() + + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - - Connect a local manager object to a remote manager process:: - + + Connect a local manager object to a remote manager process: + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) >>> m.connect() @@ -1295,7 +1295,7 @@ >>>>>>>>>>>>>>>>>>> To create one's own manager, one creates a subclass of :class:`BaseManager` and -use the :meth:`~BaseManager.resgister` classmethod to register new types or +use the :meth:`~BaseManager.register` classmethod to register new types or callables with the manager class. For example:: from multiprocessing.managers import BaseManager @@ -1360,7 +1360,7 @@ >>> queue.get() 'hello' -Local processes can also access that queue, using the code from above on the +Local processes can also access that queue, using the code from above on the client to access it remotely:: >>> from multiprocessing import Process, Queue @@ -1371,12 +1371,12 @@ ... super(Worker, self).__init__() ... def run(self): ... self.q.put('local hello') - ... + ... >>> queue = Queue() >>> w = Worker(queue) >>> w.start() >>> class QueueManager(BaseManager): pass - ... + ... >>> QueueManager.register('get_queue', callable=lambda: queue) >>> m = QueueManager(address=('', 50000), authkey='abracadabra') >>> s = m.get_server() @@ -1438,13 +1438,13 @@ Proxy objects are instances of subclasses of :class:`BaseProxy`. - .. method:: _call_method(methodname[, args[, kwds]]) + .. method:: _callmethod(methodname[, args[, kwds]]) Call and return the result of a method of the proxy's referent. If ``proxy`` is a proxy whose referent is ``obj`` then the expression :: - proxy._call_method(methodname, args, kwds) + proxy._callmethod(methodname, args, kwds) will evaluate the expression :: @@ -1457,26 +1457,26 @@ argument of :meth:`BaseManager.register`. If an exception is raised by the call, then then is re-raised by - :meth:`_call_method`. If some other exception is raised in the manager's + :meth:`_callmethod`. If some other exception is raised in the manager's process then this is converted into a :exc:`RemoteError` exception and is - raised by :meth:`_call_method`. + raised by :meth:`_callmethod`. Note in particular that an exception will be raised if *methodname* has not been *exposed* - An example of the usage of :meth:`_call_method`:: + An example of the usage of :meth:`_callmethod`:: >>> l = manager.list(range(10)) - >>> l._call_method('__len__') + >>> l._callmethod('__len__') 10 - >>> l._call_method('__getslice__', (2, 7)) # equiv to `l[2:7]` + >>> l._callmethod('__getslice__', (2, 7)) # equiv to `l[2:7]` [2, 3, 4, 5, 6] - >>> l._call_method('__getitem__', (20,)) # equiv to `l[20]` + >>> l._callmethod('__getitem__', (20,)) # equiv to `l[20]` Traceback (most recent call last): ... IndexError: list index out of range - .. method:: _get_value() + .. method:: _getvalue() Return a copy of the referent. @@ -1810,9 +1810,9 @@ filesystem. * An ``'AF_PIPE'`` address is a string of the form - ``r'\\\\.\\pipe\\PipeName'``. To use :func:`Client` to connect to a named - pipe on a remote computer called ServerName* one should use an address of the - form ``r'\\\\ServerName\\pipe\\PipeName'`` instead. + :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named + pipe on a remote computer called *ServerName* one should use an address of the + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. @@ -2120,7 +2120,7 @@ .. literalinclude:: ../includes/mp_benchmarks.py An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process` -and others to build a system which can distribute processes and work via a +and others to build a system which can distribute processes and work via a distributed queue to a "cluster" of machines on a network, accessible via SSH. You will need to have private key authentication for all hosts configured for this to work. Modified: python/branches/tlee-ast-optimize/Doc/library/mutex.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/mutex.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/mutex.rst Wed Jan 14 13:24:17 2009 @@ -5,7 +5,7 @@ .. module:: mutex :synopsis: Lock and queue for mutual exclusion. :deprecated: - + .. deprecated:: The :mod:`mutex` module has been removed in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/new.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/new.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/new.rst Wed Jan 14 13:24:17 2009 @@ -1,4 +1,3 @@ - :mod:`new` --- Creation of runtime internal objects =================================================== @@ -7,7 +6,8 @@ :deprecated: .. deprecated:: 2.6 - The :mod:`new` module has been removed in Python 3.0. + The :mod:`new` module has been removed in Python 3.0. Use the :mod:`types` + module's classes instead. .. sectionauthor:: Moshe Zadka Modified: python/branches/tlee-ast-optimize/Doc/library/nntplib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/nntplib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/nntplib.rst Wed Jan 14 13:24:17 2009 @@ -24,16 +24,16 @@ Group comp.lang.python has 59 articles, range 3742 to 3803 >>> resp, subs = s.xhdr('subject', first + '-' + last) >>> for id, sub in subs[-10:]: print id, sub - ... + ... 3792 Re: Removing elements from a list while iterating... 3793 Re: Who likes Info files? 3794 Emacs and doc strings 3795 a few questions about the Mac implementation 3796 Re: executable python scripts 3797 Re: executable python scripts - 3798 Re: a few questions about the Mac implementation + 3798 Re: a few questions about the Mac implementation 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules - 3802 Re: executable python scripts + 3802 Re: executable python scripts 3803 Re: \POSIX{} wait and SIGCHLD >>> s.quit() '205 news.cwi.nl closing connection. Goodbye.' Modified: python/branches/tlee-ast-optimize/Doc/library/numbers.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/numbers.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/numbers.rst Wed Jan 14 13:24:17 2009 @@ -51,14 +51,14 @@ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``. - Real also provides defaults for :func:`complex`, :attr:`Complex.real`, - :attr:`Complex.imag`, and :meth:`Complex.conjugate`. + Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, + :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. .. class:: Rational Subtypes :class:`Real` and adds - :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which + :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which should be in lowest terms. With these, it provides a default for :func:`float`. @@ -74,8 +74,8 @@ .. class:: Integral Subtypes :class:`Rational` and adds a conversion to :class:`int`. - Provides defaults for :func:`float`, :attr:`Rational.numerator`, and - :attr:`Rational.denominator`, and bit-string operations: ``<<``, + Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and + :attr:`~Rational.denominator`, and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``. @@ -171,7 +171,7 @@ knowledge of ``A``, so it can handle those instances before delegating to :class:`Complex`. -If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, +If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``. Modified: python/branches/tlee-ast-optimize/Doc/library/operator.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/operator.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/operator.rst Wed Jan 14 13:24:17 2009 @@ -7,7 +7,7 @@ .. testsetup:: - + import operator from operator import itemgetter @@ -240,6 +240,10 @@ 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 + index. + .. function:: getitem(a, b) __getitem__(a, b) @@ -252,6 +256,10 @@ 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 + index. + .. function:: indexOf(a, b) @@ -283,6 +291,11 @@ 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 + index. + + 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 example, the :term:`statement` ``x += y`` is equivalent to @@ -424,7 +437,7 @@ >>> class C: ... pass - ... + ... >>> import operator >>> obj = C() >>> operator.isMappingType(obj) @@ -534,9 +547,9 @@ def g(obj): return tuple(obj[item] for item in items) return g - - The items can be any type accepted by the operand's :meth:`__getitem__` - method. Dictionaries accept any hashable value. Lists, tuples, and + + The items can be any type accepted by the operand's :meth:`__getitem__` + method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice: >>> itemgetter(1)('ABCDEFG') Modified: python/branches/tlee-ast-optimize/Doc/library/optparse.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/optparse.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/optparse.rst Wed Jan 14 13:24:17 2009 @@ -548,8 +548,8 @@ :class:`OptionGroup` to a parser is easy:: group = OptionGroup(parser, "Dangerous Options", - "Caution: use these options at your own risk. " - "It is believed that some of them bite.") + "Caution: use these options at your own risk. " + "It is believed that some of them bite.") group.add_option("-g", action="store_true", help="Group option.") parser.add_option_group(group) @@ -563,12 +563,12 @@ -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --file=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' - [default], 'expert' + [default], 'expert' Dangerous Options: - Caution: use of these options is at your own risk. It is believed that - some of them bite. - -g Group option. + Caution: use of these options is at your own risk. It is believed that + some of them bite. + -g Group option. .. _optparse-printing-version-string: @@ -799,7 +799,7 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an +attributes, or fail to pass required ones, :mod:`optparse` raises an :exc:`OptionError` exception explaining your mistake. An option's *action* determines what :mod:`optparse` does when it encounters @@ -1630,36 +1630,33 @@ Nevertheless, here's a stab at a callback for an option with variable arguments:: - def vararg_callback(option, opt_str, value, parser): - assert value is None - done = 0 - value = [] - rargs = parser.rargs - while rargs: - arg = rargs[0] - - # Stop if we hit an arg like "--foo", "-a", "-fx", "--file=f", - # etc. Note that this also stops on "-3" or "-3.0", so if - # your option takes numeric values, you will need to handle - # this. - if ((arg[:2] == "--" and len(arg) > 2) or - (arg[:1] == "-" and len(arg) > 1 and arg[1] != "-")): - break - else: - value.append(arg) - del rargs[0] + def vararg_callback(option, opt_str, value, parser): + assert value is None + value = [] + + def floatable(str): + try: + float(str) + return True + except ValueError: + return False + + for arg in parser.rargs: + # stop on --foo like options + if arg[:2] == "--" and len(arg) > 2: + break + # stop on -a, but not on -3 or -3.0 + if arg[:1] == "-" and len(arg) > 1 and not floatable(arg): + break + value.append(arg) - setattr(parser.values, option.dest, value) + del parser.rargs[:len(value)] + setattr(parser.values, option.dest, value)) [...] parser.add_option("-c", "--callback", dest="vararg_attr", action="callback", callback=vararg_callback) -The main weakness with this particular implementation is that negative numbers -in the arguments following ``"-c"`` will be interpreted as further options -(probably causing an error), rather than as arguments to ``"-c"``. Fixing this -is left as an exercise for the reader. - .. _optparse-extending-optparse: Modified: python/branches/tlee-ast-optimize/Doc/library/os.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/os.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/os.rst Wed Jan 14 13:24:17 2009 @@ -368,7 +368,7 @@ is returned. Availability: Unix, Windows. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. .. versionchanged:: 2.0 @@ -418,7 +418,7 @@ child_stdout)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -432,7 +432,7 @@ child_stdout, child_stderr)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -446,7 +446,7 @@ child_stdout_and_stderr)``. .. deprecated:: 2.6 - This function is obsolete. Use the :mod:`subprocess` module. Check + This function is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. Availability: Unix, Windows. @@ -681,10 +681,11 @@ :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`write` method. -The following data items are available for use in constructing the *flags* -parameter to the :func:`open` function. Some items will not be available on all -platforms. For descriptions of their availability and use, consult -:manpage:`open(2)`. +The following constants are options for the *flags* parameter to the +:func:`open` function. They can be combined using the bitwise OR operator +``|``. Some of them are not available on all platforms. For descriptions of +their availability and use, consult the :manpage:`open(2)` manual page on Unix +or `the MSDN ` on Windows. .. data:: O_RDONLY @@ -695,8 +696,7 @@ O_EXCL O_TRUNC - Options for the *flag* argument to the :func:`open` function. These can be - combined using the bitwise OR operator ``|``. Availability: Unix, Windows. + These constants are available on Unix and Windows. .. data:: O_DSYNC @@ -708,8 +708,7 @@ O_SHLOCK O_EXLOCK - More options for the *flag* argument to the :func:`open` function. Availability: - Unix. + These constants are only available on Unix. .. data:: O_BINARY @@ -720,8 +719,7 @@ O_SEQUENTIAL O_TEXT - Options for the *flag* argument to the :func:`open` function. These can be - combined using the bitwise OR operator ``|``. Availability: Windows. + These constants are only available on Windows. .. data:: O_ASYNC @@ -730,8 +728,8 @@ O_NOFOLLOW O_NOATIME - Options for the *flag* argument to the :func:`open` function. These are - GNU extensions and not present if they are not defined by the C library. + These constants are GNU extensions and not present if they are not defined by + the C library. .. data:: SEEK_SET @@ -1451,7 +1449,7 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered @@ -1483,7 +1481,7 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. + inherit the environment of the current process. Availability: Unix, Windows. @@ -1720,7 +1718,7 @@ (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is - preferable to using these functions. Check specially the *Replacing Older + preferable to using these functions. Check specially the *Replacing Older Functions with the subprocess Module* section in that documentation page.) If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new Modified: python/branches/tlee-ast-optimize/Doc/library/ossaudiodev.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ossaudiodev.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ossaudiodev.rst Wed Jan 14 13:24:17 2009 @@ -18,26 +18,26 @@ use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast majority of Linux audio apps anyways. - + Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: - + > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial > OSS installation manual tells you to remove references to OSS/Free from the > kernel :) - + but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes from its : > * WARNING! WARNING! > * This is an OSS (Linux) audio emulator. > * Use the Native NetBSD API for developing new code, and this > * only for compiling Linux programs. - + There's also an ossaudio manpage on OpenBSD that explains things further. Presumably NetBSD and OpenBSD have a different standard audio interface. That's the great thing about standards, there are so many to choose from ... ;-) - + This probably all warrants a footnote or two, but I don't understand things well enough right now to write it! --GPW Modified: python/branches/tlee-ast-optimize/Doc/library/othergui.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/othergui.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/othergui.rst Wed Jan 14 13:24:17 2009 @@ -70,7 +70,7 @@ Robin Dunn. PyGTK, PyQt, and wxPython, all have a modern look and feel and more -widgets than Tkinter. In addition, there are many other GUI toolkits for +widgets than Tkinter. In addition, there are many other GUI toolkits for Python, both cross-platform, and platform-specific. See the `GUI Programming `_ page in the Python Wiki for a much more complete list, and also for links to documents where the Modified: python/branches/tlee-ast-optimize/Doc/library/parser.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/parser.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/parser.rst Wed Jan 14 13:24:17 2009 @@ -641,7 +641,7 @@ while the long form uses an indented block and allows nested definitions:: def make_power(exp): - "Make a function that raises an argument to the exponent `exp'." + "Make a function that raises an argument to the exponent `exp`." def raiser(x, y=exp): return x ** y return raiser Modified: python/branches/tlee-ast-optimize/Doc/library/pdb.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/pdb.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/pdb.rst Wed Jan 14 13:24:17 2009 @@ -37,7 +37,7 @@ (Pdb) continue NameError: 'spam' > (1)?() - (Pdb) + (Pdb) :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -68,7 +68,7 @@ >>> pdb.pm() > ./mymodule.py(3)test2() -> print spam - (Pdb) + (Pdb) The module defines the following functions; each enters the debugger in a slightly different way: @@ -109,7 +109,7 @@ .. function:: post_mortem([traceback]) - Enter post-mortem debugging of the given *traceback* object. If no + Enter post-mortem debugging of the given *traceback* object. If no *traceback* is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used). Modified: python/branches/tlee-ast-optimize/Doc/library/pickle.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/pickle.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/pickle.rst Wed Jan 14 13:24:17 2009 @@ -413,7 +413,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: object.__getinitargs__() - + When a pickled class instance is unpickled, its :meth:`__init__` method is normally *not* invoked. If it is desirable that the :meth:`__init__` method be called on unpickling, an old-style class can define a method @@ -430,31 +430,31 @@ is affected by the values passed to the :meth:`__new__` method for the type (as it is for tuples and strings). Instances of a :term:`new-style class` ``C`` are created using :: - + obj = C.__new__(C, *args) - + where *args* is the result of calling :meth:`__getnewargs__` on the original object; if there is no :meth:`__getnewargs__`, an empty tuple is assumed. .. method:: object.__getstate__() - + Classes can further influence how their instances are pickled; if the class defines the method :meth:`__getstate__`, it is called and the return state is pickled as the contents for the instance, instead of the contents of the instance's dictionary. If there is no :meth:`__getstate__` method, the instance's :attr:`__dict__` is pickled. -.. method:: object.__setstate__() - +.. method:: object.__setstate__() + Upon unpickling, if the class also defines the method :meth:`__setstate__`, it is called with the unpickled state. [#]_ If there is no :meth:`__setstate__` method, the pickled state must be a dictionary and its items are assigned to the new instance's dictionary. If a class defines both :meth:`__getstate__` and :meth:`__setstate__`, the state object needn't be a dictionary and these methods can do what they want. [#]_ - + .. warning:: - + For :term:`new-style class`\es, if :meth:`__getstate__` returns a false value, the :meth:`__setstate__` method will not be called. @@ -463,7 +463,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: object.__reduce__() - + When the :class:`Pickler` encounters an object of a type it knows nothing about --- such as an extension type --- it looks in two places for a hint of how to pickle it. One alternative is for the object to implement a @@ -518,7 +518,7 @@ is primarily used for dictionary subclasses, but may be used by other classes as long as they implement :meth:`__setitem__`. -.. method:: object.__reduce_ex__(protocol) +.. method:: object.__reduce_ex__(protocol) It is sometimes useful to know the protocol version when implementing :meth:`__reduce__`. This can be done by implementing a method named Modified: python/branches/tlee-ast-optimize/Doc/library/popen2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/popen2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/popen2.rst Wed Jan 14 13:24:17 2009 @@ -9,7 +9,7 @@ .. deprecated:: 2.6 - This module is obsolete. Use the :mod:`subprocess` module. Check + This module is obsolete. Use the :mod:`subprocess` module. Check especially the :ref:`subprocess-replacements` section. This module allows you to spawn processes and connect to their Modified: python/branches/tlee-ast-optimize/Doc/library/profile.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/profile.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/profile.rst Wed Jan 14 13:24:17 2009 @@ -51,17 +51,17 @@ The Python standard library provides three different profilers: -#. :mod:`cProfile` is recommended for most users; it's a C extension +#. :mod:`cProfile` is recommended for most users; it's a C extension with reasonable overhead - that makes it suitable for profiling long-running programs. + that makes it suitable for profiling long-running programs. Based on :mod:`lsprof`, - contributed by Brett Rosen and Ted Czotter. + contributed by Brett Rosen and Ted Czotter. .. versionadded:: 2.5 #. :mod:`profile`, a pure Python module whose interface is imitated by - :mod:`cProfile`. Adds significant overhead to profiled programs. - If you're trying to extend + :mod:`cProfile`. Adds significant overhead to profiled programs. + If you're trying to extend the profiler in some way, the task might be easier with this module. Copyright ?? 1994, by InfoSeek Corporation. @@ -72,7 +72,7 @@ the overhead of profiling, at the expense of longer data post-processing times. It is no longer maintained and may be dropped in a future version of Python. - + .. versionchanged:: 2.5 The results should be more meaningful than in the past: the timing core @@ -276,24 +276,24 @@ that the text string in the far right column was used to sort the output. The column headings include: - ncalls + ncalls for the number of calls, - tottime + tottime for the total time spent in the given function (and excluding time made in calls to sub-functions), - percall + percall is the quotient of ``tottime`` divided by ``ncalls`` - cumtime + cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate *even* for recursive functions. - percall + percall is the quotient of ``cumtime`` divided by primitive calls - filename:lineno(function) + filename:lineno(function) provides the respective data of each function When there are two numbers in the first column (for example, ``43/3``), then the Modified: python/branches/tlee-ast-optimize/Doc/library/pydoc.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/pydoc.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/pydoc.rst Wed Jan 14 13:24:17 2009 @@ -36,6 +36,13 @@ Unix), and refers to an existing Python source file, then documentation is produced for that file. +.. note:: + + In order to find objects and their documentation, :mod:`pydoc` imports the + module(s) to be documented. Therefore, any code on module level will be + executed on that occasion. Use an ``if __name__ == '__main__':`` guard to + only execute code when a file is invoked as a script and not just imported. + Specifying a :option:`-w` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text on the console. Modified: python/branches/tlee-ast-optimize/Doc/library/pyexpat.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/pyexpat.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/pyexpat.rst Wed Jan 14 13:24:17 2009 @@ -182,9 +182,9 @@ .. attribute:: xmlparser.buffer_size - The size of the buffer used when :attr:`buffer_text` is true. - A new buffer size can be set by assigning a new integer value - to this attribute. + The size of the buffer used when :attr:`buffer_text` is true. + A new buffer size can be set by assigning a new integer value + to this attribute. When the size is changed, the buffer will be flushed. .. versionadded:: 2.3 Modified: python/branches/tlee-ast-optimize/Doc/library/random.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/random.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/random.rst Wed Jan 14 13:24:17 2009 @@ -210,9 +210,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) Modified: python/branches/tlee-ast-optimize/Doc/library/re.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/re.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/re.rst Wed Jan 14 13:24:17 2009 @@ -750,6 +750,11 @@ were provided. +.. attribute:: RegexObject.groups + + The number of capturing groups in the pattern. + + .. attribute:: RegexObject.groupindex A dictionary mapping any symbolic group names defined by ``(?P)`` to group @@ -989,14 +994,14 @@ >>> pair.match("717ak").group(1) '7' - + # Error because re.match() returns None, which doesn't have a group() method: >>> pair.match("718ak").group(1) Traceback (most recent call last): File "", line 1, in re.match(r".*(.).*\1", "718ak").group(1) AttributeError: 'NoneType' object has no attribute 'group' - + >>> pair.match("354aa").group(1) 'a' @@ -1105,7 +1110,7 @@ Making a Phonebook ^^^^^^^^^^^^^^^^^^ -:func:`split` splits a string into a list delimited by the passed pattern. The +:func:`split` splits a string into a list delimited by the passed pattern. The method is invaluable for converting textual data into data structures that can be easily read and modified by Python as demonstrated in the following example that creates a phonebook. @@ -1114,7 +1119,7 @@ triple-quoted string syntax: >>> input = """Ross McFluff: 834.345.1254 155 Elm Street - ... + ... ... Ronald Heathmore: 892.345.3428 436 Finley Avenue ... Frank Burger: 925.541.7625 662 South Dogwood Way ... Modified: python/branches/tlee-ast-optimize/Doc/library/repr.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/repr.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/repr.rst Wed Jan 14 13:24:17 2009 @@ -125,15 +125,15 @@ the handling of types already supported. This example shows how special support for file objects could be added:: - import repr + import repr as reprlib import sys - class MyRepr(repr.Repr): + class MyRepr(reprlib.Repr): def repr_file(self, obj, level): if obj.name in ['', '', '']: return obj.name else: - return `obj` + return repr(obj) aRepr = MyRepr() print aRepr.repr(sys.stdin) # prints '' Modified: python/branches/tlee-ast-optimize/Doc/library/rexec.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/rexec.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/rexec.rst Wed Jan 14 13:24:17 2009 @@ -5,7 +5,7 @@ .. module:: rexec :synopsis: Basic restricted execution framework. :deprecated: - + .. deprecated:: 2.6 The :mod:`rexec` module has been removed in Python 3.0. @@ -272,7 +272,7 @@ pass elif mode in ('w', 'wb', 'a', 'ab'): # check filename : must begin with /tmp/ - if file[:5]!='/tmp/': + if file[:5]!='/tmp/': raise IOError, "can't write outside /tmp" elif (string.find(file, '/../') >= 0 or file[:3] == '../' or file[-3:] == '/..'): Modified: python/branches/tlee-ast-optimize/Doc/library/rlcompleter.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/rlcompleter.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/rlcompleter.rst Wed Jan 14 13:24:17 2009 @@ -61,6 +61,6 @@ If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`__getattr__`) up to the last part, and find matches for the rest via the - :func:`dir` function. Any exception raised during the evaluation of the + :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned. Modified: python/branches/tlee-ast-optimize/Doc/library/robotparser.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/robotparser.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/robotparser.rst Wed Jan 14 13:24:17 2009 @@ -13,7 +13,7 @@ single: World Wide Web single: URL single: robots.txt - + .. note:: The :mod:`robotparser` module has been renamed :mod:`urllib.robotparser` in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/sched.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/sched.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/sched.rst Wed Jan 14 13:24:17 2009 @@ -42,7 +42,7 @@ 930343700.276 In multi-threaded environments, the :class:`scheduler` class has limitations -with respect to thread-safety, inability to insert a new task before +with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the :class:`threading.Timer` class instead. @@ -58,8 +58,8 @@ ... print time.time() ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() - ... time.sleep(11) # sleep while time-delay events execute - ... print time.time() + ... time.sleep(11) # sleep while time-delay events execute + ... print time.time() ... >>> print_some_times() 930343690.257 Modified: python/branches/tlee-ast-optimize/Doc/library/sgmllib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/sgmllib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/sgmllib.rst Wed Jan 14 13:24:17 2009 @@ -4,7 +4,7 @@ .. module:: sgmllib :synopsis: Only as much of an SGML parser as needed to parse HTML. :deprecated: - + .. deprecated:: 2.6 The :mod:`sgmllib` module has been removed in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/shutil.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/shutil.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/shutil.rst Wed Jan 14 13:24:17 2009 @@ -20,7 +20,7 @@ Even the higher-level file copying functions (:func:`copy`, :func:`copy2`) can't copy all file metadata. - + On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will @@ -43,7 +43,8 @@ Copy the contents (no metadata) of the file named *src* to a file named *dst*. *dst* must be the complete target file name; look at :func:`copy` for a copy that - accepts a target directory path. + accepts a target directory path. If *src* and *dst* are the same files, + :exc:`Error` is raised. The destination location must be writable; otherwise, an :exc:`IOError` exception will be raised. If *dst* already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this @@ -123,7 +124,7 @@ error. Copy permissions and times of directories using :func:`copystat`. .. versionchanged:: 2.6 - Added the *ignore* argument to be able to influence what is being copied. + Added the *ignore* argument to be able to influence what is being copied. .. function:: rmtree(path[, ignore_errors[, onerror]]) @@ -155,7 +156,7 @@ Recursively move a file or directory to another location. If the destination is on the current filesystem, then simply use rename. - Otherwise, copy src to the dst and then remove src. + Otherwise, copy src (with :func:`copy2`) to the dst and then remove src. .. versionadded:: 2.3 @@ -188,7 +189,7 @@ os.makedirs(dst) errors = [] for name in names: - if name in ignored_names: + if name in ignored_names: continue srcname = os.path.join(src, name) dstname = os.path.join(dst, name) @@ -220,7 +221,7 @@ Another example that uses the :func:`ignore_patterns` helper:: from shutil import copytree, ignore_patterns - + copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*')) This will copy everything except ``.pyc`` files and files or directories whose @@ -230,7 +231,7 @@ from shutil import copytree import logging - + def _logpath(path, names): logging.info('Working in %s' % path) return [] # nothing will be ignored Modified: python/branches/tlee-ast-optimize/Doc/library/signal.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/signal.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/signal.rst Wed Jan 14 13:24:17 2009 @@ -39,12 +39,12 @@ * Some care must be taken if both signals and threads are used in the same program. The fundamental thing to remember in using signals and threads simultaneously is: always perform :func:`signal` operations in the main thread - of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, - :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread - can set a new signal handler, and the main thread will be the only one to - receive signals (this is enforced by the Python :mod:`signal` module, even - if the underlying thread implementation supports sending signals to - individual threads). This means that signals can't be used as a means of + of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, + :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread + can set a new signal handler, and the main thread will be the only one to + receive signals (this is enforced by the Python :mod:`signal` module, even + if the underlying thread implementation supports sending signals to + individual threads). This means that signals can't be used as a means of inter-thread communication. Use locks instead. The variables defined in the :mod:`signal` module are: @@ -52,10 +52,10 @@ .. data:: SIG_DFL - This is one of two standard signal handling options; it will simply perform the - default function for the signal. For example, on most systems the default - action for :const:`SIGQUIT` is to dump core and exit, while the default action - for :const:`SIGCLD` is to simply ignore it. + This is one of two standard signal handling options; it will simply perform + the default function for the signal. For example, on most systems the + default action for :const:`SIGQUIT` is to dump core and exit, while the + default action for :const:`SIGCHLD` is to simply ignore it. .. data:: SIG_IGN @@ -80,22 +80,22 @@ One more than the number of the highest signal number. -.. data:: ITIMER_REAL +.. data:: ITIMER_REAL Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration. -.. data:: ITIMER_VIRTUAL +.. data:: ITIMER_VIRTUAL - Decrements interval timer only when the process is executing, and delivers + Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration. .. data:: ITIMER_PROF - - Decrements interval timer both when the process executes and when the - system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, - this timer is usually used to profile the time spent by the application + + Decrements interval timer both when the process executes and when the + system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, + this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration. @@ -105,7 +105,7 @@ Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid - interval timer or a negative time is passed to :func:`setitimer`. + interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`IOError`. @@ -143,21 +143,21 @@ .. function:: setitimer(which, seconds[, interval]) - Sets given interval timer (one of :const:`signal.ITIMER_REAL`, + Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified - by *which* to fire after *seconds* (float is accepted, different from + by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds. The interval timer specified by *which* can be cleared by setting seconds to zero. When an interval timer fires, a signal is sent to the process. - The signal sent is dependent on the timer being used; - :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, + The signal sent is dependent on the timer being used; + :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`. The old values are returned as a tuple: (delay, interval). - Attempting to pass an invalid interval timer will cause a + Attempting to pass an invalid interval timer will cause a :exc:`ItimerError`. .. versionadded:: 2.6 @@ -190,7 +190,7 @@ will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing. Availability: Unix (see the man page :manpage:`siginterrupt(3)` for further information). - + Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag* value for the given signal. @@ -239,7 +239,7 @@ signal.alarm(5) # This open() may hang indefinitely - fd = os.open('/dev/ttyS0', os.O_RDWR) + fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm Modified: python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst Wed Jan 14 13:24:17 2009 @@ -151,7 +151,7 @@ requestHandler=RequestHandler) server.register_introspection_functions() - # Register pow() function; this will use the value of + # Register pow() function; this will use the value of # pow.__name__ as the name, which is just 'pow'. server.register_function(pow) @@ -160,10 +160,10 @@ return x + y server.register_function(adder_function, 'add') - # Register an instance; all the methods of the instance are + # Register an instance; all the methods of the instance are # published as XML-RPC methods (in this case, just 'div'). class MyFuncs: - def div(self, x, y): + def div(self, x, y): return x // y server.register_instance(MyFuncs()) Modified: python/branches/tlee-ast-optimize/Doc/library/smtplib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/smtplib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/smtplib.rst Wed Jan 14 13:24:17 2009 @@ -189,9 +189,9 @@ Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the - response for ESMTP option and store them for use by :meth:`has_extn`. - Also sets several informational attributes: the message returned by - the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` + response for ESMTP option and store them for use by :meth:`has_extn`. + Also sets several informational attributes: the message returned by + the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to true or false depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their @@ -207,7 +207,7 @@ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. - :exc:SMTPHeloError + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. .. versionadded:: 2.6 Modified: python/branches/tlee-ast-optimize/Doc/library/socket.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/socket.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/socket.rst Wed Jan 14 13:24:17 2009 @@ -184,10 +184,10 @@ .. data:: SIO_* RCVALL_* - + Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`ioctl` method of socket objects. - + .. versionadded:: 2.6 .. data:: TIPC_* @@ -222,7 +222,7 @@ all the necessary arguments for creating the corresponding socket. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. - The rest of the arguments are optional and must be numeric if specified. + The rest of the arguments are optional and must be numeric if specified. By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following @@ -588,14 +588,14 @@ contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as strings). - + .. method:: socket.ioctl(control, option) - :platform: Windows - + :platform: Windows + The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the MSDN documentation for more information. - + .. versionadded:: 2.6 @@ -852,20 +852,21 @@ HOST = None # Symbolic name meaning all available interfaces PORT = 50007 # Arbitrary non-privileged port s = None - for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE): + for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, + socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error, msg: - s = None - continue + s = None + continue try: - s.bind(sa) - s.listen(1) + s.bind(sa) + s.listen(1) except socket.error, msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print 'could not open socket' @@ -890,16 +891,16 @@ for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error, msg: - s = None - continue + s = None + continue try: - s.connect(sa) + s.connect(sa) except socket.error, msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print 'could not open socket' @@ -909,7 +910,7 @@ s.close() print 'Received', repr(data) - + The last example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface:: @@ -918,19 +919,19 @@ # the public network interface HOST = socket.gethostbyname(socket.gethostname()) - + # create a raw socket and bind it to the public interface s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) s.bind((HOST, 0)) - + # Include IP headers s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) - + # receive all packages s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) - + # receive a package print s.recvfrom(65565) - + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) Modified: python/branches/tlee-ast-optimize/Doc/library/socketserver.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/socketserver.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/socketserver.rst Wed Jan 14 13:24:17 2009 @@ -7,9 +7,9 @@ .. note:: - The :mod:`SocketServer` module has been renamed to `socketserver` in Python - 3.0. The :term:`2to3` tool will automatically adapt imports when converting - your sources to 3.0. + The :mod:`SocketServer` module has been renamed to :mod:`socketserver` in + Python 3.0. The :term:`2to3` tool will automatically adapt imports when + converting your sources to 3.0. The :mod:`SocketServer` module simplifies the task of writing network servers. @@ -448,7 +448,7 @@ if __name__ == "__main__": HOST, PORT = "localhost", 9999 - server = SocketServer.UDPServer((HOST, PORT), BaseUDPRequestHandler) + server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler) server.serve_forever() This is the client side:: Modified: python/branches/tlee-ast-optimize/Doc/library/sqlite3.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/sqlite3.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/sqlite3.rst Wed Jan 14 13:24:17 2009 @@ -244,7 +244,7 @@ .. method:: Connection.rollback() - This method rolls back any changes to the database since the last call to + This method rolls back any changes to the database since the last call to :meth:`commit`. .. method:: Connection.close() @@ -487,29 +487,29 @@ .. literalinclude:: ../includes/sqlite3/executescript.py -.. method:: Cursor.fetchone() - +.. method:: Cursor.fetchone() + Fetches the next row of a query result set, returning a single sequence, or :const:`None` when no more data is available. .. method:: Cursor.fetchmany([size=cursor.arraysize]) - + Fetches the next set of rows of a query result, returning a list. An empty list is returned when no more rows are available. - + The number of rows to fetch per call is specified by the *size* parameter. If it is not given, the cursor's arraysize determines the number of rows to be fetched. The method should try to fetch as many rows as indicated by the size parameter. If this is not possible due to the specified number of rows not being available, fewer rows may be returned. - + Note there are performance considerations involved with the *size* parameter. For optimal performance, it is usually best to use the arraysize attribute. If the *size* parameter is used, then it is best for it to retain the same value from one :meth:`fetchmany` call to the next. - -.. method:: Cursor.fetchall() + +.. method:: Cursor.fetchall() Fetches all (remaining) rows of a query result, returning a list. Note that the cursor's arraysize attribute can affect the performance of this operation. @@ -546,8 +546,8 @@ This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each - column where the last six items of each tuple are :const:`None`. - + column where the last six items of each tuple are :const:`None`. + It is set for ``SELECT`` statements without any matching rows as well. .. _sqlite3-row-objects: @@ -558,7 +558,7 @@ .. class:: Row A :class:`Row` instance serves as a highly optimized - :attr:`~Connection.row_factory` for :class:`Connection` objects. + :attr:`~Connection.row_factory` for :class:`Connection` objects. It tries to mimic a tuple in most of its features. It supports mapping access by column name and index, iteration, @@ -566,7 +566,7 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - + .. versionchanged:: 2.6 Added iteration and equality (hashability). @@ -793,7 +793,7 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. +Data Modification Language (DML) statement (i.e. ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions implicitly before a non-DML, non-query statement (i. e. anything other than ``SELECT`` or the aforementioned). Modified: python/branches/tlee-ast-optimize/Doc/library/ssl.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ssl.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ssl.rst Wed Jan 14 13:24:17 2009 @@ -48,7 +48,7 @@ .. exception:: SSLError - Raised to signal an error from the underlying SSL implementation. This + Raised to signal an error from the underlying SSL implementation. This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`socket.error`, which @@ -173,7 +173,7 @@ >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' - >>> + >>> .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None) @@ -385,7 +385,7 @@ the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, -that is, a certificate which has the same subject and issuer, +that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the @@ -422,13 +422,13 @@ you only need the root certificates, and the remote peer is supposed to furnish the other certificates necessary to chain from its certificate to a root certificate. -See :rfc:`4158` for more discussion of the way in which +See :rfc:`4158` for more discussion of the way in which certification chains can be built. If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, -such as buying one from a certification authority. Another common +such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following:: @@ -570,7 +570,7 @@ And go back to listening for new client connections. - + .. seealso:: Class :class:`socket.socket` Modified: python/branches/tlee-ast-optimize/Doc/library/statvfs.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/statvfs.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/statvfs.rst Wed Jan 14 13:24:17 2009 @@ -4,7 +4,7 @@ .. module:: statvfs :synopsis: Constants for interpreting the result of os.statvfs(). :deprecated: - + .. deprecated:: 2.6 The :mod:`statvfs` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/stdtypes.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/stdtypes.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/stdtypes.rst Wed Jan 14 13:24:17 2009 @@ -338,15 +338,13 @@ module: math single: floor() (in module math) single: ceil() (in module math) + single: trunc() (in module math) pair: numeric; conversions - pair: C; language - Conversion from floating point to (long or plain) integer may round or - truncate as in C; see functions :func:`math.floor` and :func:`math.ceil` for - well-defined conversions. - - .. deprecated:: 2.6 - Instead, convert floats to long explicitly with :func:`trunc`. + Conversion from floats using :func:`int` or :func:`long` truncates toward + zero like the related function, :func:`math.trunc`. Use the function + :func:`math.floor` to round downward and :func:`math.ceil` to round + upward. (3) See :ref:`built-in-funcs` for a full description. @@ -362,9 +360,9 @@ though the result's type is not necessarily int. (6) - float also accepts the strings "nan" and "inf" with an optional prefix "+" + float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity. - + .. versionadded:: 2.6 (7) @@ -447,6 +445,37 @@ A right shift by *n* bits is equivalent to division by ``pow(2, n)``. +Additional Methods on Integer Types +----------------------------------- + +.. method:: int.bit_length() +.. method:: long.bit_length() + + Return the number of bits necessary to represent an integer in binary, + excluding the sign and leading zeros:: + + >>> n = -37 + >>> bin(n) + '-0b100101' + >>> n.bit_length() + 6 + + More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the + unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. + Equivalently, when ``abs(x)`` is small enough to have a correctly + rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. + If ``x`` is zero, then ``x.bit_length()`` returns ``0``. + + Equivalent to:: + + def bit_length(self): + s = bin(self) # binary representation: bin(-37) --> '-0b100101' + s = s.lstrip('-0b') # remove leading zeros and minus sign + return len(s) # len('100101') --> 6 + + .. versionadded:: 2.7 + + Additional Methods on Float --------------------------- @@ -458,7 +487,7 @@ original float and with a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - + .. versionadded:: 2.6 Two methods support conversion to @@ -1178,7 +1207,7 @@ Return the numeric string left filled with zeros in a string of length *width*. A sign prefix is handled correctly. The original string is returned if *width* is less than ``len(s)``. - + .. versionadded:: 2.2.2 @@ -1190,7 +1219,7 @@ otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. - + .. method:: unicode.isdecimal() Return ``True`` if there are only decimal characters in S, ``False`` @@ -1867,7 +1896,7 @@ Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map. - .. versionadded:: 2.5 + .. versionadded:: 2.5 If a subclass of dict defines a method :meth:`__missing__`, if the key *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or @@ -2186,7 +2215,7 @@ positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). There is no return value. - + For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last. Modified: python/branches/tlee-ast-optimize/Doc/library/string.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/string.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/string.rst Wed Jan 14 13:24:17 2009 @@ -126,7 +126,7 @@ :meth:`format` is just a wrapper that calls :meth:`vformat`. .. method:: vformat(format_string, args, kwargs) - + This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the @@ -139,12 +139,12 @@ intended to be replaced by subclasses: .. method:: parse(format_string) - + Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string in to either literal text, or replacement fields. - + The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then @@ -162,7 +162,7 @@ *key* parameter to :meth:`get_value`. .. method:: get_value(key, args, kwargs) - + Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a @@ -200,7 +200,7 @@ method is provided so that subclasses can override it. .. method:: convert_field(value, conversion) - + Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method.) The default version understands 'r' (repr) and 's' (str) conversion types. @@ -229,7 +229,7 @@ element_index: `integer` conversion: "r" | "s" format_spec: - + In less formal terms, the replacement field starts with a *field_name*, which can either be a number (for a positional argument), or an identifier (for keyword arguments). Following this is an optional *conversion* field, which is @@ -249,7 +249,7 @@ "My quest is {name}" # References keyword argument 'name' "Weight in tons {0.weight}" # 'weight' attribute of first positional arg "Units destroyed: {players[0]}" # First element of keyword argument 'players'. - + The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted @@ -292,11 +292,11 @@ Then the outer replacement field would be evaluated, producing:: "noses " - + Which is substituted into the string, yielding:: - + "A man with two noses " - + (The extra space is because we specified a field width of 10, and because left alignment is the default for strings.) @@ -328,7 +328,7 @@ width: `integer` precision: `integer` type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - + The *fill* character can be any character other than '}' (which signifies the end of the field). The presence of a fill character is signaled by the *next* character, which must be one of the alignment options. If the second character @@ -421,9 +421,9 @@ +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ - + The available presentation types for floating point and decimal values are: - + +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ Modified: python/branches/tlee-ast-optimize/Doc/library/stringio.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/stringio.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/stringio.rst Wed Jan 14 13:24:17 2009 @@ -52,7 +52,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() @@ -81,7 +81,7 @@ Calling :func:`StringIO` with a Unicode string parameter populates the object with the buffer representation of the Unicode string, instead of -encoding the string. +encoding the string. Another difference from the :mod:`StringIO` module is that calling :func:`StringIO` with a string parameter creates a read-only object. Unlike an @@ -118,7 +118,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() Modified: python/branches/tlee-ast-optimize/Doc/library/subprocess.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/subprocess.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/subprocess.rst Wed Jan 14 13:24:17 2009 @@ -73,13 +73,13 @@ specified by the :envvar:`COMSPEC` environment variable. *stdin*, *stdout* and *stderr* specify the executed programs' standard input, - standard output and standard error file handles, respectively. Valid values are - ``PIPE``, an existing file descriptor (a positive integer), an existing file - object, and ``None``. ``PIPE`` indicates that a new pipe to the child should be - created. With ``None``, no redirection will occur; the child's file handles - will be inherited from the parent. Additionally, *stderr* can be ``STDOUT``, - which indicates that the stderr data from the applications should be captured - into the same file handle as for stdout. + standard output and standard error file handles, respectively. Valid values + are :data:`PIPE`, an existing file descriptor (a positive integer), an + existing file object, and ``None``. :data:`PIPE` indicates that a new pipe + to the child should be created. With ``None``, no redirection will occur; + the child's file handles will be inherited from the parent. Additionally, + *stderr* can be :data:`STDOUT`, which indicates that the stderr data from the + applications should be captured into the same file handle as for stdout. If *preexec_fn* is set to a callable object, this object will be called in the child process just before the child is executed. (Unix only) @@ -119,6 +119,20 @@ of the main window and priority for the new process. (Windows only) +.. data:: PIPE + + Special value that can be used as the *stdin*, *stdout* or *stderr* argument + to :class:`Popen` and indicates that a pipe to the standard stream should be + opened. + + +.. data:: STDOUT + + Special value that can be used as the *stderr* argument to :class:`Popen` and + indicates that standard error should go into the same handle as standard + output. + + Convenience Functions ^^^^^^^^^^^^^^^^^^^^^ @@ -149,6 +163,30 @@ .. versionadded:: 2.5 +.. function:: check_output(*popenargs, **kwargs) + + Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + >>> subprocess.check_output(["ls", "-l", "/dev/null"]) + 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' + + The stdout argument is not allowed as it is used internally. + To capture standard error in the result, use stderr=subprocess.STDOUT. + + >>> subprocess.check_output( + ["/bin/sh", "-c", "ls non_existant_file ; exit 0"], + stderr=subprocess.STDOUT) + 'ls: non_existant_file: No such file or directory\n' + + .. versionadded:: 2.7 + + Exceptions ^^^^^^^^^^ @@ -207,7 +245,7 @@ *input* argument should be a string to be sent to the child process, or ``None``, if no data should be sent to the child. - :meth:`communicate` returns a tuple ``(stdout, stderr)``. + :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``. Note that if you want to send data to the process's stdin, you need to create the Popen object with ``stdin=PIPE``. Similarly, to get anything other than @@ -261,20 +299,21 @@ .. attribute:: Popen.stdin - If the *stdin* argument is ``PIPE``, this attribute is a file object that - provides input to the child process. Otherwise, it is ``None``. + If the *stdin* argument was :data:`PIPE`, this attribute is a file object + that provides input to the child process. Otherwise, it is ``None``. .. attribute:: Popen.stdout - If the *stdout* argument is ``PIPE``, this attribute is a file object that - provides output from the child process. Otherwise, it is ``None``. + If the *stdout* argument was :data:`PIPE`, this attribute is a file object + that provides output from the child process. Otherwise, it is ``None``. .. attribute:: Popen.stderr - If the *stderr* argument is ``PIPE``, this attribute is file object that - provides error output from the child process. Otherwise, it is ``None``. + If the *stderr* argument was :data:`PIPE`, this attribute is a file object + that provides error output from the child process. Otherwise, it is + ``None``. .. attribute:: Popen.pid @@ -287,7 +326,7 @@ The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly by :meth:`communicate`). A ``None`` value indicates that the process hasn't terminated yet. - + A negative value ``-N`` indicates that the child was terminated by signal ``N`` (Unix only). @@ -358,8 +397,8 @@ print >>sys.stderr, "Execution failed:", e -Replacing os.spawn\* -^^^^^^^^^^^^^^^^^^^^ +Replacing the os.spawn family +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ P_NOWAIT example:: @@ -386,8 +425,8 @@ Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"}) -Replacing os.popen\* -^^^^^^^^^^^^^^^^^^^^ +Replacing os.popen, os.popen2, os.popen3 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: @@ -430,8 +469,8 @@ (child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout) -Replacing popen2.\* -^^^^^^^^^^^^^^^^^^^ +Replacing functions from the popen2 module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: @@ -454,15 +493,15 @@ stdin=PIPE, stdout=PIPE, close_fds=True) (child_stdout, child_stdin) = (p.stdout, p.stdin) -The popen2.Popen3 and popen2.Popen4 basically works as subprocess.Popen, except -that: +:class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as +:class:`subprocess.Popen`, except that: -* subprocess.Popen raises an exception if the execution fails +* :class:`Popen` raises an exception if the execution fails. * the *capturestderr* argument is replaced with the *stderr* argument. -* stdin=PIPE and stdout=PIPE must be specified. +* ``stdin=PIPE`` and ``stdout=PIPE`` must be specified. * popen2 closes all file descriptors by default, but you have to specify - close_fds=True with subprocess.Popen. + ``close_fds=True`` with :class:`Popen`. Modified: python/branches/tlee-ast-optimize/Doc/library/sunaudio.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/sunaudio.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/sunaudio.rst Wed Jan 14 13:24:17 2009 @@ -6,7 +6,7 @@ :platform: SunOS :synopsis: Access to Sun audio hardware. :deprecated: - + .. deprecated:: 2.6 The :mod:`sunaudiodev` module has been deprecated for removal in Python 3.0. @@ -151,7 +151,7 @@ :platform: SunOS :synopsis: Constants for use with sunaudiodev. :deprecated: - + .. deprecated:: 2.6 The :mod:`SUNAUDIODEV` module has been deprecated for removal in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/sys.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/sys.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/sys.rst Wed Jan 14 13:24:17 2009 @@ -402,7 +402,7 @@ The *default* argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would - cause a `TypeError`. + cause a `TypeError`. func:`getsizeof` calls the object's __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. @@ -566,6 +566,10 @@ .. versionchanged:: 2.3 Unicode strings are no longer ignored. + .. seealso:: + Module :mod:`site` This describes how to use .pth files to extend + :data:`sys.path`. + .. data:: platform @@ -583,7 +587,6 @@ Windows ``'win32'`` Windows/Cygwin ``'cygwin'`` Mac OS X ``'darwin'`` - Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` RiscOS ``'riscos'`` @@ -731,7 +734,7 @@ The events have the following meaning: - ``'call'`` + ``'call'`` A function is called (or some other code block entered). The global trace function is called; *arg* is ``None``; the return value specifies the local trace function. @@ -799,7 +802,7 @@ prompts of :func:`input` and :func:`raw_input`. The interpreter's own prompts and (almost all of) its error messages go to ``stderr``. ``stdout`` and ``stderr`` needn't be built-in file objects: any object is acceptable as long - as it has a :meth:`write` method that takes a string argument. (Changing these + as it has a :meth:`write` method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) @@ -869,10 +872,3 @@ first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python. Availability: Windows. - - -.. seealso:: - - Module :mod:`site` - This describes how to use .pth files to extend ``sys.path``. - Modified: python/branches/tlee-ast-optimize/Doc/library/tempfile.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/tempfile.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/tempfile.rst Wed Jan 14 13:24:17 2009 @@ -164,11 +164,11 @@ .. warning:: - Use of this function may introduce a security hole in your program. - By the time you get around to doing anything with the file name it - returns, someone else may have beaten you to the punch. - :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + Use of this function may introduce a security hole in your program. By + the time you get around to doing anything with the file name it returns, + someone else may have beaten you to the punch. :func:`mktemp` usage can + be replaced easily with :func:`NamedTemporaryFile`, passing it the + ``delete=False`` parameter:: >>> f = NamedTemporaryFile(delete=False) >>> f Modified: python/branches/tlee-ast-optimize/Doc/library/tk.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/tk.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/tk.rst Wed Jan 14 13:24:17 2009 @@ -22,15 +22,15 @@ mechanism which allows Python and Tcl to interact. :mod:`Tkinter`'s chief virtues are that it is fast, and that it usually comes -bundled with Python. Although its standard documentation is weak, good -material is available, which includes: references, tutorials, a book and -others. :mod:`Tkinter` is also famous for having an outdated look and feel, -which has been vastly improved in Tk 8.5. Nevertheless, there are many other -GUI libraries that you could be interested in. For more information about +bundled with Python. Although its standard documentation is weak, good +material is available, which includes: references, tutorials, a book and +others. :mod:`Tkinter` is also famous for having an outdated look and feel, +which has been vastly improved in Tk 8.5. Nevertheless, there are many other +GUI libraries that you could be interested in. For more information about alternatives, see the :ref:`other-gui-packages` section. .. toctree:: - + tkinter.rst tix.rst scrolledtext.rst Modified: python/branches/tlee-ast-optimize/Doc/library/tkinter.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/tkinter.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/tkinter.rst Wed Jan 14 13:24:17 2009 @@ -284,7 +284,7 @@ someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say:: - .fred someAction someOptions + .fred someAction someOptions Note that the object name, ``.fred``, starts with a dot. @@ -490,7 +490,7 @@ For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout's book. -anchor +anchor Anchor type. Denotes where the packer is to place each slave in its parcel. expand @@ -720,7 +720,7 @@ they are denoted in Tk, which can be useful when referring to the Tk man pages. :: - Tk Tkinter Event Field Tk Tkinter Event Field + Tk Tkinter Event Field Tk Tkinter Event Field -- ------------------- -- ------------------- %f focus %A char %h height %E send_event Modified: python/branches/tlee-ast-optimize/Doc/library/trace.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/trace.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/trace.rst Wed Jan 14 13:24:17 2009 @@ -65,13 +65,13 @@ :option:`--ignore-module` Accepts comma separated list of module names. Ignore each of the named - module and its submodules (if it is a package). May be given + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` Ignore all modules and packages in the named directory and subdirectories (multiple directories can be joined by os.pathsep). May be given multiple - times. + times. .. _trace-api: Modified: python/branches/tlee-ast-optimize/Doc/library/traceback.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/traceback.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/traceback.rst Wed Jan 14 13:24:17 2009 @@ -169,10 +169,10 @@ def lumberjack(): bright_side_of_death() - + def bright_side_of_death(): return tuple()[0] - + try: lumberjack() except: @@ -251,12 +251,12 @@ >>> import traceback >>> def another_function(): ... lumberstack() - ... + ... >>> def lumberstack(): ... traceback.print_stack() ... print repr(traceback.extract_stack()) ... print repr(traceback.format_stack()) - ... + ... >>> another_function() File "", line 10, in another_function() Modified: python/branches/tlee-ast-optimize/Doc/library/turtle.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/turtle.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/turtle.rst Wed Jan 14 13:24:17 2009 @@ -325,8 +325,7 @@ :param y: a number (integer or float) - Set the turtle's first coordinate to *y*, leave second coordinate - unchanged. + Set the turtle's second coordinate to *y*, leave first coordinate unchanged. >>> turtle.position() (0.00, 40.00) @@ -1587,7 +1586,7 @@ Subclass of TurtleScreen, with :ref:`four methods added `. - + .. class:: ScrolledCavas(master) :param master: some Tkinter widget to contain the ScrolledCanvas, i.e. @@ -1612,13 +1611,13 @@ "compound" ``None`` (a compund shape has to be constructed using the :meth:`addcomponent` method) =========== =========== - + .. method:: addcomponent(poly, fill, outline=None) :param poly: a polygon, i.e. a tuple of pairs of numbers :param fill: a color the *poly* will be filled with :param outline: a color for the poly's outline (if given) - + Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1662,31 +1661,31 @@ >>> help(Screen.bgcolor) Help on method bgcolor in module turtle: - + bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - - + + >>> screen.bgcolor("orange") >>> screen.bgcolor() "orange" >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() "#800080" - + >>> help(Turtle.penup) Help on method penup in module turtle: - + penup(self) unbound turtle.Turtle method Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + >>> turtle.penup() - The docstrings of the functions which are derived from methods have a modified @@ -1694,32 +1693,32 @@ >>> help(bgcolor) Help on function bgcolor in module turtle: - + bgcolor(*args) Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - + Example:: - + >>> bgcolor("orange") >>> bgcolor() "orange" >>> bgcolor(0.5,0,0.5) >>> bgcolor() "#800080" - + >>> help(penup) Help on function penup in module turtle: - + penup() Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + Example: >>> penup() Modified: python/branches/tlee-ast-optimize/Doc/library/undoc.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/undoc.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/undoc.rst Wed Jan 14 13:24:17 2009 @@ -21,7 +21,7 @@ :mod:`ihooks` --- Import hook support (for :mod:`rexec`; may become obsolete). - + .. warning:: The :mod:`ihooks` module has been removed in Python 3.0. @@ -54,7 +54,7 @@ :mod:`linuxaudiodev` --- Play audio data on the Linux audio device. Replaced in Python 2.3 by the :mod:`ossaudiodev` module. - + .. warning:: The :mod:`linuxaudiodev` module has been removed in Python 3.0. :mod:`sunaudio` @@ -240,7 +240,7 @@ :mod:`timing` --- Measure time intervals to high resolution (use :func:`time.clock` instead). - + .. warning:: The :mod:`timing` module has been removed in Python 3.0. @@ -255,6 +255,6 @@ :mod:`sv` --- Interface to the "simple video" board on SGI Indigo (obsolete hardware). - + .. warning:: The :mod:`sv` module has been removed in Python 3.0. Modified: python/branches/tlee-ast-optimize/Doc/library/unicodedata.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/unicodedata.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/unicodedata.rst Wed Jan 14 13:24:17 2009 @@ -164,7 +164,7 @@ File "", line 1, in ? ValueError: not a decimal >>> unicodedata.category(u'A') # 'L'etter, 'u'ppercase - 'Lu' + 'Lu' >>> unicodedata.bidirectional(u'\u0660') # 'A'rabic, 'N'umber 'AN' Modified: python/branches/tlee-ast-optimize/Doc/library/unittest.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/unittest.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/unittest.rst Wed Jan 14 13:24:17 2009 @@ -595,7 +595,7 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare @@ -606,15 +606,15 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare equal, the test will fail with the explanation given by *msg*, or :const:`None`. -.. method:: TestCase.assertRaises(exception, callable, ...) - TestCase.failUnlessRaises(exception, callable, ...) +.. method:: TestCase.assertRaises(exception[, callable, ...]) + TestCase.failUnlessRaises(exception[, callable, ...]) Test that an exception is raised when *callable* is called with any positional or keyword arguments that are also passed to :meth:`assertRaises`. The test @@ -622,6 +622,13 @@ fails if no exception is raised. To catch any of a group of exceptions, a tuple containing the exception classes may be passed as *exception*. + .. versionchanged:: 2.7 + + If *callable* is omitted or None, returns a context manager so that the code + under test can be written inline rather than as a function:: + + with self.failUnlessRaises(some_error_class): + do_something() .. method:: TestCase.failIf(expr[, msg]) TestCase.assertFalse(expr[, msg]) Modified: python/branches/tlee-ast-optimize/Doc/library/urllib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/urllib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/urllib.rst Wed Jan 14 13:24:17 2009 @@ -123,7 +123,7 @@ .. versionchanged:: 2.6 Added :meth:`getcode` to returned object and support for the :envvar:`no_proxy` environment variable. - + .. deprecated:: 2.6 The :func:`urlopen` function has been removed in Python 3.0 in favor of :func:`urllib2.urlopen`. Modified: python/branches/tlee-ast-optimize/Doc/library/urllib2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/urllib2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/urllib2.rst Wed Jan 14 13:24:17 2009 @@ -109,7 +109,7 @@ .. attribute:: code - An HTTP status code as defined in `RFC 2616 `_. + An HTTP status code as defined in `RFC 2616 `_. This numeric value corresponds to a value found in the dictionary of codes as found in :attr:`BaseHTTPServer.BaseHTTPRequestHandler.responses`. @@ -391,23 +391,23 @@ .. method:: OpenerDirector.add_handler(handler) - *handler* should be an instance of :class:`BaseHandler`. The following methods - are searched, and added to the possible chains (note that HTTP errors are a - special case). + *handler* should be an instance of :class:`BaseHandler`. The following + methods are searched, and added to the possible chains (note that HTTP errors + are a special case). - * :meth:`protocol_open` --- signal that the handler knows how to open *protocol* - URLs. + * :samp:`{protocol}_open` --- signal that the handler knows how to open + *protocol* URLs. - * :meth:`http_error_type` --- signal that the handler knows how to handle HTTP - errors with HTTP error code *type*. + * :samp:`http_error_{type}` --- signal that the handler knows how to handle + HTTP errors with HTTP error code *type*. - * :meth:`protocol_error` --- signal that the handler knows how to handle errors - from (non-\ ``http``) *protocol*. + * :samp:`{protocol}_error` --- signal that the handler knows how to handle + errors from (non-\ ``http``) *protocol*. - * :meth:`protocol_request` --- signal that the handler knows how to pre-process - *protocol* requests. + * :samp:`{protocol}_request` --- signal that the handler knows how to + pre-process *protocol* requests. - * :meth:`protocol_response` --- signal that the handler knows how to + * :samp:`{protocol}_response` --- signal that the handler knows how to post-process *protocol* responses. @@ -441,24 +441,24 @@ The order in which these methods are called within each stage is determined by sorting the handler instances. -#. Every handler with a method named like :meth:`protocol_request` has that +#. Every handler with a method named like :samp:`{protocol}_request` has that method called to pre-process the request. -#. Handlers with a method named like :meth:`protocol_open` are called to handle +#. Handlers with a method named like :samp:`{protocol}_open` are called to handle the request. This stage ends when a handler either returns a non-\ :const:`None` value (ie. a response), or raises an exception (usually :exc:`URLError`). Exceptions are allowed to propagate. In fact, the above algorithm is first tried for methods named - :meth:`default_open`. If all such methods return :const:`None`, the algorithm - is repeated for methods named like :meth:`protocol_open`. If all such methods - return :const:`None`, the algorithm is repeated for methods named - :meth:`unknown_open`. + :meth:`default_open`. If all such methods return :const:`None`, the + algorithm is repeated for methods named like :samp:`{protocol}_open`. If all + such methods return :const:`None`, the algorithm is repeated for methods + named :meth:`unknown_open`. Note that the implementation of these methods may involve calls of the parent :class:`OpenerDirector` instance's :meth:`.open` and :meth:`.error` methods. -#. Every handler with a method named like :meth:`protocol_response` has that +#. Every handler with a method named like :samp:`{protocol}_response` has that method called to post-process the response. @@ -514,8 +514,10 @@ .. method:: BaseHandler.protocol_open(req) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to handle URLs with the given protocol. + define it if they want to handle URLs with the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. Return values should be the same as for :meth:`default_open`. @@ -563,8 +565,10 @@ .. method:: BaseHandler.protocol_request(req) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to pre-process requests of the given protocol. + define it if they want to pre-process requests of the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a @@ -574,8 +578,10 @@ .. method:: BaseHandler.protocol_response(req, response) :noindex: + ("protocol" is to be replaced by the protocol name.) + This method is *not* defined in :class:`BaseHandler`, but subclasses should - define it if they want to post-process responses of the given protocol. + define it if they want to post-process responses of the given *protocol*. This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. *response* will be an object @@ -660,7 +666,9 @@ .. method:: ProxyHandler.protocol_open(request) :noindex: - The :class:`ProxyHandler` will have a method :meth:`protocol_open` for every + ("protocol" is to be replaced by the protocol name.) + + The :class:`ProxyHandler` will have a method :samp:`{protocol}_open` for every *protocol* which has a proxy in the *proxies* dictionary given in the constructor. The method will modify requests to go through the proxy, by calling ``request.set_proxy()``, and call the next handler in the chain to @@ -865,9 +873,10 @@ For 200 error codes, the response object is returned immediately. For non-200 error codes, this simply passes the job on to the - :meth:`protocol_error_code` handler methods, via :meth:`OpenerDirector.error`. - Eventually, :class:`urllib2.HTTPDefaultErrorHandler` will raise an - :exc:`HTTPError` if no other handler handles the error. + :samp:`{protocol}_error_code` handler methods, via + :meth:`OpenerDirector.error`. Eventually, + :class:`urllib2.HTTPDefaultErrorHandler` will raise an :exc:`HTTPError` if no + other handler handles the error. .. _urllib2-examples: Modified: python/branches/tlee-ast-optimize/Doc/library/urlparse.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/urlparse.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/urlparse.rst Wed Jan 14 13:24:17 2009 @@ -290,7 +290,7 @@ .. versionadded:: 2.5 -The following classes provide the implementations of the parse results:: +The following classes provide the implementations of the parse results: .. class:: BaseResult Modified: python/branches/tlee-ast-optimize/Doc/library/warnings.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/warnings.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/warnings.rst Wed Jan 14 13:24:17 2009 @@ -274,7 +274,7 @@ .. function:: warnpy3k(message[, category[, stacklevel]]) - Issue a warning related to Python 3.x deprecation. Warnings are only shown + Issue a warning related to Python 3.x deprecation. Warnings are only shown when Python is started with the -3 option. Like :func:`warn` *message* must be a string and *category* a subclass of :exc:`Warning`. :func:`warnpy3k` is using :exc:`DeprecationWarning` as default warning class. @@ -288,7 +288,7 @@ this function with an alternative implementation by assigning to ``warnings.showwarning``. *line* is a line of source code to be included in the warning - message; if *line* is not supplied, :func:`showwarning` will + message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. versionchanged:: 2.6 @@ -299,8 +299,8 @@ .. function:: formatwarning(message, category, filename, lineno[, line]) Format a warning the standard way. This returns a string which may contain - embedded newlines and ends in a newline. *line* is - a line of source code to be included in the warning message; if *line* is not supplied, + embedded newlines and ends in a newline. *line* is + a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. .. versionchanged:: 2.6 Modified: python/branches/tlee-ast-optimize/Doc/library/webbrowser.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/webbrowser.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/webbrowser.rst Wed Jan 14 13:24:17 2009 @@ -160,7 +160,7 @@ url = 'http://www.python.org' - # Open URL in a new tab, if a browser window is already open. + # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(url + '/doc') # Open URL in new window, raising the window if possible. @@ -172,7 +172,7 @@ Browser Controller Objects -------------------------- -Browser controllers provide two methods which parallel two of the module-level +Browser controllers provide these methods which parallel two of the module-level convenience functions: Modified: python/branches/tlee-ast-optimize/Doc/library/winsound.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/winsound.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/winsound.rst Wed Jan 14 13:24:17 2009 @@ -30,8 +30,9 @@ Call the underlying :cfunc:`PlaySound` function from the Platform API. The *sound* parameter may be a filename, audio data as a string, or ``None``. Its interpretation depends on the value of *flags*, which can be a bitwise ORed - combination of the constants described below. If the system indicates an error, - :exc:`RuntimeError` is raised. + combination of the constants described below. If the *sound* parameter is + ``None``, any currently playing waveform sound is stopped. If the system + indicates an error, :exc:`RuntimeError` is raised. .. function:: MessageBeep([type=MB_OK]) @@ -108,6 +109,10 @@ Stop playing all instances of the specified sound. + .. note:: + + This flag is not supported on modern Windows platforms. + .. data:: SND_ASYNC Modified: python/branches/tlee-ast-optimize/Doc/library/wsgiref.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/wsgiref.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/wsgiref.rst Wed Jan 14 13:24:17 2009 @@ -170,7 +170,7 @@ filelike = StringIO("This is an example file-like object"*10) wrapper = FileWrapper(filelike, blksize=5) - for chunk in wrapper: + for chunk in wrapper: print chunk @@ -415,7 +415,7 @@ from wsgiref.validate import validator from wsgiref.simple_server import make_server - # Our callable object which is intentionally not compliant to the + # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): status = '200 OK' # HTTP Status Modified: python/branches/tlee-ast-optimize/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/xml.etree.elementtree.rst Wed Jan 14 13:24:17 2009 @@ -34,7 +34,7 @@ A C implementation of this API is available as :mod:`xml.etree.cElementTree`. See http://effbot.org/zone/element-index.htm for tutorials and links to other -docs. Fredrik Lundh's page is also the location of the development version of the +docs. Fredrik Lundh's page is also the location of the development version of the xml.etree.ElementTree. .. _elementtree-functions: @@ -94,6 +94,16 @@ *events* is a list of events to report back. If omitted, only "end" events are reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs. + .. note:: + + :func:`iterparse` only guarantees that it has seen the ">" + character of a starting tag when it emits a "start" event, so the + attributes are defined, but the contents of the text and tail attributes + are undefined at that point. The same applies to the element children; + they may or may not be present. + + If you need a fully populated element, look for "end" events instead. + .. function:: parse(source[, parser]) @@ -369,7 +379,7 @@ Example page -

    Moved to example.org +

    Moved to example.org or example.com.

    @@ -476,9 +486,9 @@ :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method for each opening tag, its :meth:`end` method for each closing tag, -and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` -calls *target*\'s method :meth:`close`. -:class:`XMLTreeBuilder` can be used not only for building a tree structure. +and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` +calls *target*\'s method :meth:`close`. +:class:`XMLTreeBuilder` can be used not only for building a tree structure. This is an example of counting the maximum depth of an XML file:: >>> from xml.etree.ElementTree import XMLTreeBuilder @@ -486,16 +496,16 @@ ... maxDepth = 0 ... depth = 0 ... def start(self, tag, attrib): # Called for each opening tag. - ... self.depth += 1 + ... self.depth += 1 ... if self.depth > self.maxDepth: ... self.maxDepth = self.depth ... def end(self, tag): # Called for each closing tag. ... self.depth -= 1 - ... def data(self, data): + ... def data(self, data): ... pass # We do not need to do anything with data. ... def close(self): # Called when all data has been parsed. ... return self.maxDepth - ... + ... >>> target = MaxDepth() >>> parser = XMLTreeBuilder(target=target) >>> exampleXml = """ Modified: python/branches/tlee-ast-optimize/Doc/library/xmlrpclib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/xmlrpclib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/xmlrpclib.rst Wed Jan 14 13:24:17 2009 @@ -560,8 +560,8 @@ self.proxy = proxy def make_connection(self, host): self.realhost = host - h = httplib.HTTP(self.proxy) - return h + h = httplib.HTTP(self.proxy) + return h def send_request(self, connection, handler, request_body): connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) def send_host(self, connection, host): Modified: python/branches/tlee-ast-optimize/Doc/library/zipfile.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/zipfile.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/zipfile.rst Wed Jan 14 13:24:17 2009 @@ -66,9 +66,11 @@ .. function:: is_zipfile(filename) Returns ``True`` if *filename* is a valid ZIP file based on its magic number, - otherwise returns ``False``. This module does not currently handle ZIP files - which have appended comments. + otherwise returns ``False``. *filename* may be a file or file-like object too. + This module does not currently handle ZIP files which have appended comments. + .. versionchanged:: 2.7 + Support for file and file-like objects. .. data:: ZIP_STORED @@ -200,7 +202,7 @@ .. method:: ZipFile.extractall([path[, members[, pwd]]]) - Extract all members from the archive to the current working directory. *path* + Extract all members from the archive to the current working directory. *path* specifies a different directory to extract to. *members* is optional and must be a subset of the list returned by :meth:`namelist`. *pwd* is the password used for encrypted files. @@ -280,9 +282,9 @@ .. note:: - When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, - the compression method used will be that specified in the *compress_type* - member of the given :class:`ZipInfo` instance. By default, the + When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, + the compression method used will be that specified in the *compress_type* + member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. The following data attributes are also available: @@ -296,9 +298,9 @@ .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a - :class:`ZipFile` instance created with mode 'a' or 'w', this should be a - string no longer than 65535 bytes. Comments longer than this will be + The comment text associated with the ZIP file. If assigning a comment to a + :class:`ZipFile` instance created with mode 'a' or 'w', this should be a + string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when :meth:`ZipFile.close` is called. .. _pyzipfile-objects: @@ -327,10 +329,10 @@ internal use only. The :meth:`writepy` method makes archives with file names like this:: - string.pyc # Top level name - test/__init__.pyc # Package directory + string.pyc # Top level name + test/__init__.pyc # Package directory test/test_support.pyc # Module test.test_support - test/bogus/__init__.pyc # Subpackage directory + test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile Modified: python/branches/tlee-ast-optimize/Doc/library/zipimport.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/zipimport.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/zipimport.rst Wed Jan 14 13:24:17 2009 @@ -148,7 +148,7 @@ -------- ------- 8467 1 file $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading Modified: python/branches/tlee-ast-optimize/Doc/library/zlib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/zlib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/zlib.rst Wed Jan 14 13:24:17 2009 @@ -31,22 +31,34 @@ Exception raised on compression and decompression errors. -.. function:: adler32(string[, value]) +.. function:: adler32(data[, value]) - Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as + Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much more quickly.) If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. This function always returns an integer object. - .. versionchanged:: 2.6 - For consistent cross-platform behavior we always return a signed integer. - ie: Results in the (2**31)...(2**32-1) range will be negative. +.. note:: + 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 + 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 + 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] + regardless of platform. .. function:: compress(string[, level]) @@ -66,25 +78,37 @@ ``9`` is slowest and produces the most. The default value is ``6``. -.. function:: crc32(string[, value]) +.. function:: crc32(data[, value]) .. index:: single: Cyclic Redundancy Check single: checksum; Cyclic Redundancy Check - Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is + Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. This function always returns an integer object. - .. versionchanged:: 2.6 - For consistent cross-platform behavior we always return a signed integer. - ie: Results in the (2**31)...(2**32-1) range will be negative. +.. note:: + 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 + 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 + 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] + regardless of platform. .. function:: decompress(string[, wbits[, bufsize]]) Modified: python/branches/tlee-ast-optimize/Doc/license.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/license.rst (original) +++ python/branches/tlee-ast-optimize/Doc/license.rst Wed Jan 14 13:24:17 2009 @@ -88,8 +88,14 @@ +----------------+--------------+-----------+------------+-----------------+ | 2.5.1 | 2.5 | 2007 | PSF | yes | +----------------+--------------+-----------+------------+-----------------+ +| 2.5.2 | 2.5.1 | 2008 | PSF | yes | ++----------------+--------------+-----------+------------+-----------------+ +| 2.5.3 | 2.5.2 | 2008 | PSF | yes | ++----------------+--------------+-----------+------------+-----------------+ | 2.6 | 2.5 | 2008 | PSF | yes | +----------------+--------------+-----------+------------+-----------------+ +| 2.6.1 | 2.6 | 2008 | PSF | yes | ++----------------+--------------+-----------+------------+-----------------+ .. note:: @@ -118,7 +124,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ?? 2001-2008 Python Software Foundation; All Rights + copyright, i.e., "Copyright ?? 2001-2009 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. @@ -380,8 +386,8 @@ The source for the :mod:`fpectl` module includes the following notice:: - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -413,7 +419,7 @@ | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / + \ endorsement purposes. / --------------------------------------------------------------------- @@ -447,7 +453,7 @@ This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at - http://www.ietf.org/rfc/rfc1321.txt + http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being @@ -458,12 +464,12 @@ that follows (in reverse chronological order): 2002-04-13 lpd Removed support for non-ANSI compilers; removed - references to Ghostscript; clarified derivation from RFC 1321; - now handles byte order either statically or dynamically. + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); - added conditionalization for C++ compilation from Martin - Purschke . + added conditionalization for C++ compilation from Martin + Purschke . 1999-05-03 lpd Original version. Modified: python/branches/tlee-ast-optimize/Doc/make.bat ============================================================================== --- python/branches/tlee-ast-optimize/Doc/make.bat (original) +++ python/branches/tlee-ast-optimize/Doc/make.bat Wed Jan 14 13:24:17 2009 @@ -8,34 +8,41 @@ if "%1" EQU "" goto help if "%1" EQU "html" goto build if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun +if "%1" EQU "latex" goto build +if "%1" EQU "text" goto build +if "%1" EQU "suspicious" goto build +if "%1" EQU "linkcheck" goto build +if "%1" EQU "changes" goto build if "%1" EQU "checkout" goto checkout if "%1" EQU "update" goto update :help +set this=%~n0 echo HELP echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun +echo %this% checkout +echo %this% update +echo %this% html +echo %this% htmlhelp +echo %this% latex +echo %this% text +echo %this% suspicious +echo %this% linkcheck +echo %this% changes echo. goto end :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments +svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils +svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2 +svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update svn update tools/sphinx svn update tools/docutils -svn update tools/jinja +svn update tools/jinja2 svn update tools/pygments goto end @@ -43,13 +50,8 @@ if not exist build mkdir build if not exist build\%1 mkdir build\%1 if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 +cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%* if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - :end Modified: python/branches/tlee-ast-optimize/Doc/reference/datamodel.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/reference/datamodel.rst (original) +++ python/branches/tlee-ast-optimize/Doc/reference/datamodel.rst Wed Jan 14 13:24:17 2009 @@ -1162,9 +1162,10 @@ Basic customization ------------------- - .. method:: object.__new__(cls[, ...]) + .. index:: pair: subclassing; immutable types + Called to create a new instance of class *cls*. :meth:`__new__` is a static method (special-cased so you need not declare it as such) that takes the class of which an instance was requested as its first argument. The remaining @@ -2369,7 +2370,7 @@ True In addition to bypassing any instance attributes in the interest of -correctness, implicit special method lookup may also bypass the +correctness, implicit special method lookup generally also bypasses the :meth:`__getattribute__` method even of the object's metaclass:: >>> class Meta(type): Modified: python/branches/tlee-ast-optimize/Doc/reference/expressions.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/reference/expressions.rst (original) +++ python/branches/tlee-ast-optimize/Doc/reference/expressions.rst Wed Jan 14 13:24:17 2009 @@ -560,7 +560,7 @@ .. productionlist:: slicing: `simple_slicing` | `extended_slicing` simple_slicing: `primary` "[" `short_slice` "]" - extended_slicing: `primary` "[" `slice_list` "]" + extended_slicing: `primary` "[" `slice_list` "]" slice_list: `slice_item` ("," `slice_item`)* [","] slice_item: `expression` | `proper_slice` | `ellipsis` proper_slice: `short_slice` | `long_slice` @@ -664,7 +664,7 @@ the call. .. note:: - + An implementation may provide builtin functions whose positional parameters do not have names, even if they are 'named' for the purpose of documentation, and which therefore cannot be supplied by keyword. In CPython, this is the case for @@ -1321,7 +1321,7 @@ .. rubric:: Footnotes .. [#] In Python 2.3 and later releases, a list comprehension "leaks" the control - variables of each ``for`` it contains into the containing scope. However, this + variables of each ``for`` it contains into the containing scope. However, this behavior is deprecated, and relying on it will not work in Python 3.0 .. [#] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be @@ -1354,7 +1354,7 @@ only, but this caused surprises because people expected to be able to test a dictionary for emptiness by comparing it to ``{}``. -.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of +.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 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. Modified: python/branches/tlee-ast-optimize/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/reference/lexical_analysis.rst (original) +++ python/branches/tlee-ast-optimize/Doc/reference/lexical_analysis.rst Wed Jan 14 13:24:17 2009 @@ -341,13 +341,13 @@ language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:: - and del from not while - as elif global or with - assert else if pass yield - break except import print - class exec in raise - continue finally is return - def for lambda try + and del from not while + as elif global or with + assert else if pass yield + break except import print + class exec in raise + continue finally is return + def for lambda try .. versionchanged:: 2.4 :const:`None` became a constant and is now recognized by the compiler as a name @@ -654,7 +654,7 @@ 7 2147483647 0177 3L 79228162514264337593543950336L 0377L 0x100000000L - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: @@ -701,7 +701,7 @@ part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of imaginary literals:: - 3.14j 10.j 10j .001j 1e100j 3.14e-10j + 3.14j 10.j 10j .001j 1e100j 3.14e-10j .. _operators: Modified: python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst (original) +++ python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst Wed Jan 14 13:24:17 2009 @@ -745,7 +745,7 @@ searched inside the package. A package is generally a subdirectory of a directory on ``sys.path`` that has a file :file:`__init__.py`. -.. +.. [XXX Can't be bothered to spell this out right now; see the URL http://www.python.org/doc/essays/packages.html for more details, also about how Deleted: python/branches/tlee-ast-optimize/Doc/tools/sphinx-web.py ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinx-web.py Wed Jan 14 13:24:17 2009 +++ (empty file) @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -""" - Sphinx - Python documentation webserver - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - :copyright: 2007 by Georg Brandl. - :license: Python license. -""" - -import sys - -if __name__ == '__main__': - from sphinx.web import main - sys.exit(main(sys.argv)) Modified: python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html (original) +++ python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html Wed Jan 14 13:24:17 2009 @@ -19,20 +19,20 @@ - - + + - - + + - - + + - +
    FormatPacked as .zipPacked as .tar.bz2
    PDF (US-Letter paper size)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)
    PDF (A4 paper size)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)Download (ca. 8 MB)
    HTMLDownload (ca. 6 MB)Download (ca. 4 MB)Download (ca. 6 MB)Download (ca. 4 MB)
    Plain Text Download (ca. 2 MB)Download (ca. 1.5 MB)Download (ca. 1.5 MB)
    Modified: python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html (original) +++ python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html Wed Jan 14 13:24:17 2009 @@ -1,4 +1,10 @@ {% extends "!layout.html" %} {% block rootrellink %} -
  • {{ shorttitle }}{{ reldelim1 }}
  • +
  • +
  • {{ shorttitle }}{{ reldelim1 }}
  • +{% endblock %} +{% block extrahead %} + +{{ super() }} {% endblock %} Modified: python/branches/tlee-ast-optimize/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/tlee-ast-optimize/Doc/tools/sphinxext/pyspecific.py Wed Jan 14 13:24:17 2009 @@ -47,8 +47,10 @@ from pprint import pformat from docutils.io import StringOutput from docutils.utils import new_document -from sphinx.builder import Builder -from sphinx.textwriter import TextWriter + +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + class PydocTopicsBuilder(Builder): name = 'pydoc-topics' @@ -84,6 +86,9 @@ finally: f.close() +# Support for checking for suspicious markup + +import suspicious # Support for documenting Opcodes @@ -108,5 +113,6 @@ def setup(app): app.add_role('issue', issue_role) app.add_builder(PydocTopicsBuilder) + app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) Modified: python/branches/tlee-ast-optimize/Doc/tutorial/classes.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/classes.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/classes.rst Wed Jan 14 13:24:17 2009 @@ -250,7 +250,7 @@ ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -481,7 +481,7 @@ ``issubclass(unicode, str)`` is ``False`` since :class:`unicode` is not a subclass of :class:`str` (they only share a common ancestor, :class:`basestring`). - + .. _tut-multiple: @@ -743,7 +743,7 @@ f l o - g + g Anything that can be done with generators can also be done with class based iterators as described in the previous section. What makes generators so Modified: python/branches/tlee-ast-optimize/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/controlflow.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/controlflow.rst Wed Jan 14 13:24:17 2009 @@ -62,7 +62,7 @@ ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print x, len(x) - ... + ... cat 3 window 6 defenestrate 12 @@ -75,7 +75,7 @@ >>> for x in a[:]: # make a slice copy of the entire list ... if len(x) > 6: a.insert(0, x) - ... + ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] @@ -104,19 +104,22 @@ >>> range(-10, -100, -30) [-10, -40, -70] -To iterate over the indices of a sequence, combine :func:`range` and :func:`len` -as follows:: +To iterate over the indices of a sequence, you can combine :func:`range` and +:func:`len` as follows:: >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print i, a[i] - ... + ... 0 Mary 1 had 2 a 3 little 4 lamb +In most such cases, however, it is convenient to use the :func:`enumerate` +function, see :ref:`tut-loopidioms`. + .. _tut-break: @@ -143,7 +146,7 @@ ... else: ... # loop fell through without finding a factor ... print n, 'is a prime number' - ... + ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 @@ -164,43 +167,21 @@ >>> while True: ... pass # Busy-wait for keyboard interrupt (Ctrl+C) - ... + ... -This is commonly used for creating minimal classes such as exceptions, or -for ignoring unwanted exceptions:: +This is commonly used for creating minimal classes:: - >>> class ParserError(Exception): - ... pass - ... - >>> try: - ... import audioop - ... except ImportError: + >>> class MyEmptyClass: ... pass - ... + ... Another place :keyword:`pass` can be used is as a place-holder for a function or -conditional body when you are working on new code, allowing you to keep -thinking at a more abstract level. However, as :keyword:`pass` is silently -ignored, a better choice may be to raise a :exc:`NotImplementedError` -exception:: +conditional body when you are working on new code, allowing you to keep thinking +at a more abstract level. The :keyword:`pass` is silently ignored:: >>> def initlog(*args): - ... raise NotImplementedError # Open logfile if not already open - ... if not logfp: - ... raise NotImplementedError # Set up dummy log back-end - ... raise NotImplementedError('Call log initialization handler') - ... - -If :keyword:`pass` were used here and you later ran tests, they may fail -without indicating why. Using :exc:`NotImplementedError` causes this code -to raise an exception, telling you exactly where the incomplete code -is. Note the two calling styles of the exceptions above. -The first style, with no message but with an accompanying comment, -lets you easily leave the comment when you remove the exception, -which ideally would be a good description for -the block of code the exception is a placeholder for. However, the -third example, providing a message for the exception, will produce -a more useful traceback. + ... pass # Remember to implement this! + ... .. _tut-functions: @@ -216,7 +197,7 @@ ... while b < n: ... print b, ... a, b = b, a+b - ... + ... >>> # Now call the function we just defined: ... fib(2000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 @@ -287,7 +268,7 @@ ... result.append(b) # see below ... a, b = b, a+b ... return result - ... + ... >>> f100 = fib2(100) # call it >>> f100 # write the result [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -422,7 +403,7 @@ >>> def function(a): ... pass - ... + ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in ? @@ -475,7 +456,7 @@ ------------------------ .. index:: - statement: * + statement: * Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -584,11 +565,11 @@ >>> def my_function(): ... """Do nothing, but document it. - ... + ... ... No, really, it doesn't do anything. ... """ ... pass - ... + ... >>> print my_function.__doc__ Do nothing, but document it. Modified: python/branches/tlee-ast-optimize/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/datastructures.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/datastructures.rst Wed Jan 14 13:24:17 2009 @@ -214,7 +214,7 @@ >>> def sum(seq): ... def add(x,y): return x+y ... return reduce(add, seq, 0) - ... + ... >>> sum(range(1, 11)) 55 >>> sum([]) @@ -251,7 +251,7 @@ [] >>> [[x,x**2] for x in vec] [[2, 4], [4, 16], [6, 36]] - >>> [x, x**2 for x in vec] # error - parens required for tuples + >>> [x, x**2 for x in vec] # error - parens required for tuples File "", line 1, in ? [x, x**2 for x in vec] ^ @@ -281,7 +281,7 @@ powerful tool but -- like all powerful tools -- they need to be used carefully, if at all. -Consider the following example of a 3x3 matrix held as a list containing three +Consider the following example of a 3x3 matrix held as a list containing three lists, one list per row:: >>> mat = [ @@ -290,7 +290,7 @@ ... [7, 8, 9], ... ] -Now, if you wanted to swap rows and columns, you could use a list +Now, if you wanted to swap rows and columns, you could use a list comprehension:: >>> print [[row[i] for row in mat] for i in [0, 1, 2]] @@ -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 builtin functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> zip(*mat) @@ -551,7 +551,7 @@ >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print 'What is your {0}? It is {1}.'.format(q, a) - ... + ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. @@ -574,7 +574,7 @@ >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print f - ... + ... apple banana orange Modified: python/branches/tlee-ast-optimize/Doc/tutorial/errors.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/errors.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/errors.rst Wed Jan 14 13:24:17 2009 @@ -91,7 +91,7 @@ ... break ... except ValueError: ... print "Oops! That was no valid number. Try again..." - ... + ... The :keyword:`try` statement works as follows. @@ -199,12 +199,12 @@ >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as detail: ... print 'Handling run-time error:', detail - ... + ... Handling run-time error: integer division or modulo by zero @@ -256,12 +256,12 @@ ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print 'My exception occurred, value:', e.value - ... + ... My exception occurred, value: 4 >>> raise MyError, 'oops!' Traceback (most recent call last): @@ -331,7 +331,7 @@ ... raise KeyboardInterrupt ... finally: ... print 'Goodbye, world!' - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? Modified: python/branches/tlee-ast-optimize/Doc/tutorial/index.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/index.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/index.rst Wed Jan 14 13:24:17 2009 @@ -1,7 +1,7 @@ .. _tutorial-index: ###################### - The Python Tutorial + The Python Tutorial ###################### :Release: |version| Modified: python/branches/tlee-ast-optimize/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/inputoutput.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/inputoutput.rst Wed Jan 14 13:24:17 2009 @@ -87,7 +87,7 @@ >>> for x in range(1,11): ... print '{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x) - ... + ... 1 1 1 2 4 8 3 9 27 @@ -148,7 +148,7 @@ ... other='Georg') The story of Bill, Manfred, and Georg. -An optional ``':``` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This also greater control over how the value is formatted. The following example truncates the Pi to three places after the decimal. @@ -162,7 +162,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): ... print '{0:10} ==> {1:10d}'.format(name, phone) - ... + ... Jack ==> 4098 Dcab ==> 7678 Sjoerd ==> 4127 @@ -330,7 +330,7 @@ >>> f = open('/tmp/workfile', 'r+') >>> f.write('0123456789abcdef') >>> f.seek(5) # Go to the 6th byte in the file - >>> f.read(1) + >>> f.read(1) '5' >>> f.seek(-3, 2) # Go to the 3rd byte before the end >>> f.read(1) Modified: python/branches/tlee-ast-optimize/Doc/tutorial/interpreter.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/interpreter.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/interpreter.rst Wed Jan 14 13:24:17 2009 @@ -112,7 +112,7 @@ >>> the_world_is_flat = 1 >>> if the_world_is_flat: ... print "Be careful not to fall off!" - ... + ... Be careful not to fall off! @@ -180,7 +180,7 @@ best way to do it is to put one more special comment line right after the ``#!`` line to define the source file encoding:: - # -*- coding: encoding -*- + # -*- coding: encoding -*- With that declaration, all characters in the source file will be treated as Modified: python/branches/tlee-ast-optimize/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/introduction.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/introduction.rst Wed Jan 14 13:24:17 2009 @@ -84,7 +84,7 @@ >>> # try to access an undefined variable ... n - Traceback (most recent call last): + Traceback (most recent call last): File "", line 1, in NameError: name 'n' is not defined @@ -219,14 +219,14 @@ they will be included in the string. :: print """ - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """ produces the following output:: - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to @@ -350,10 +350,10 @@ Then the right edge of the last character of a string of *n* characters has index *n*, for example:: - +---+---+---+---+---+ + +---+---+---+---+---+ | H | e | l | p | A | - +---+---+---+---+---+ - 0 1 2 3 4 5 + +---+---+---+---+---+ + 0 1 2 3 4 5 -5 -4 -3 -2 -1 The first row of numbers gives the position of the indices 0...5 in the string; @@ -595,7 +595,7 @@ >>> while b < 10: ... print b ... a, b = b, a+b - ... + ... 1 1 2 @@ -645,7 +645,7 @@ >>> while b < 1000: ... print b, ... a, b = b, a+b - ... + ... 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Note that the interpreter inserts a newline before it prints the next prompt if Modified: python/branches/tlee-ast-optimize/Doc/tutorial/modules.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/modules.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/modules.rst Wed Jan 14 13:24:17 2009 @@ -281,7 +281,7 @@ ['__name__', 'fib', 'fib2'] >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', + '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'callstats', 'copyright', 'displayhook', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', @@ -314,7 +314,7 @@ 'FloatingPointError', 'FutureWarning', 'IOError', 'ImportError', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImplemented', - 'NotImplementedError', 'OSError', 'OverflowError', + 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', Modified: python/branches/tlee-ast-optimize/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/stdlib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/stdlib.rst Wed Jan 14 13:24:17 2009 @@ -136,7 +136,7 @@ >>> random.random() # random float 0.17970987693706186 >>> random.randrange(6) # random integer chosen from range(6) - 4 + 4 .. _tut-internet-access: Modified: python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst Wed Jan 14 13:24:17 2009 @@ -62,7 +62,7 @@ >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], - ... conv['frac_digits'], x), grouping=True) + ... conv['frac_digits'], x), grouping=True) '$1,234,567.80' Modified: python/branches/tlee-ast-optimize/Doc/tutorial/whatnow.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tutorial/whatnow.rst (original) +++ python/branches/tlee-ast-optimize/Doc/tutorial/whatnow.rst Wed Jan 14 13:24:17 2009 @@ -63,6 +63,6 @@ .. Postings figure based on average of last six months activity as reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182 - days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) + days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) Modified: python/branches/tlee-ast-optimize/Doc/using/cmdline.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/using/cmdline.rst (original) +++ python/branches/tlee-ast-optimize/Doc/using/cmdline.rst Wed Jan 14 13:24:17 2009 @@ -8,8 +8,8 @@ The CPython interpreter scans the command line and the environment for various settings. -.. note:: - +.. note:: + Other implementations' command line schemes may differ. See :ref:`implementations` for further resources. @@ -61,7 +61,7 @@ Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code. - + If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top @@ -72,7 +72,7 @@ Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module. - + Since the argument is a *module* name, you must not give a file extension (``.py``). The ``module-name`` should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to @@ -84,18 +84,18 @@ written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available. - + If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. - + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details - .. seealso:: + .. seealso:: :func:`runpy.run_module` The actual implementation of this feature. @@ -163,7 +163,7 @@ --version Print the Python version number and exit. Example output could be:: - + Python 2.5.1 .. versionchanged:: 2.5 @@ -201,7 +201,7 @@ enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal. The :envvar:`PYTHONSTARTUP` file is not read. - + This can be useful to inspect global variables or a stack trace when a script raises an exception. See also :envvar:`PYTHONINSPECT`. @@ -221,7 +221,7 @@ .. cmdoption:: -Q Division control. The argument must be one of the following: - + ``old`` division of int/int and long/long return an int or long (*default*) ``new`` @@ -264,10 +264,10 @@ .. cmdoption:: -u - + Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. - + Note that there is internal buffering in :meth:`file.readlines` and :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced by this option. To work around this, you will want to use @@ -279,7 +279,7 @@ .. XXX should the -U option be documented? .. cmdoption:: -v - + Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (:option:`-vv`), print a message for each file that is checked for when @@ -288,13 +288,13 @@ .. cmdoption:: -W arg - + Warning control. Python's warning machinery by default prints warning messages to :data:`sys.stderr`. A typical warning message has the following form:: file:line: category: message - + By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. @@ -302,13 +302,13 @@ one option, the action for the last matching option is performed. Invalid :option:`-W` options are ignored (though, a warning message is printed about invalid options when the first warning is issued). - + Warnings can also be controlled from within a Python program using the :mod:`warnings` module. The simplest form of argument is one of the following action strings (or a unique abbreviation): - + ``ignore`` Ignore all warnings. ``default`` @@ -324,9 +324,9 @@ Print each warning only the first time it occurs in the program. ``error`` Raise an exception instead of printing a warning message. - - The full form of argument is:: - + + The full form of argument is:: + action:message:category:module:line Here, *action* is as explained above but only applies to messages that match @@ -347,16 +347,17 @@ .. cmdoption:: -x - + Skip the first line of the source, allowing use of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only. - + .. warning:: The line numbers in error messages will be off by one! .. cmdoption:: -3 - Warn about Python 3.x incompatibilities. Among these are: + Warn about Python 3.x incompatibilities which cannot be fixed trivially by + :ref:`2to3 <2to3-reference>`. Among these are: * :meth:`dict.has_key` * :func:`apply` @@ -380,13 +381,13 @@ These environment variables influence Python's behavior. .. envvar:: PYTHONHOME - + Change the location of the standard Python libraries. By default, the libraries are searched in :file:`{prefix}/lib/python{version}` and :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and :file:`{exec_prefix}` are installation-dependent directories, both defaulting to :file:`/usr/local`. - + When :envvar:`PYTHONHOME` is set to a single directory, its value replaces both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`. @@ -402,11 +403,11 @@ In addition to normal directories, individual :envvar:`PYTHONPATH` entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. - + The default search path is installation dependent, but generally begins with - :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It + :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. - + An additional directory will be inserted in the search path in front of :envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-options`. The search path can be manipulated from @@ -414,7 +415,7 @@ .. envvar:: PYTHONSTARTUP - + If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so @@ -424,7 +425,7 @@ .. envvar:: PYTHONY2K - + Set this to a non-empty string to cause the :mod:`time` module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the :mod:`time` module @@ -432,21 +433,21 @@ .. envvar:: PYTHONOPTIMIZE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-O` option. If set to an integer, it is equivalent to specifying :option:`-O` multiple times. .. envvar:: PYTHONDEBUG - + If this is set to a non-empty string it is equivalent to specifying the :option:`-d` option. If set to an integer, it is equivalent to specifying :option:`-d` multiple times. .. envvar:: PYTHONINSPECT - + If this is set to a non-empty string it is equivalent to specifying the :option:`-i` option. @@ -455,20 +456,20 @@ .. envvar:: PYTHONUNBUFFERED - + If this is set to a non-empty string it is equivalent to specifying the :option:`-u` option. .. envvar:: PYTHONVERBOSE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-v` option. If set to an integer, it is equivalent to specifying :option:`-v` multiple times. .. envvar:: PYTHONCASEOK - + If this is set, Python ignores case in :keyword:`import` statements. This only works on Windows. Modified: python/branches/tlee-ast-optimize/Doc/using/unix.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/using/unix.rst (original) +++ python/branches/tlee-ast-optimize/Doc/using/unix.rst Wed Jan 14 13:24:17 2009 @@ -19,7 +19,7 @@ package on all others. However there are certain features you might want to use that are not available on your distro's package. You can easily compile the latest version of Python from source. - + In the event that Python doesn't come preinstalled and isn't in the repositories as well, you can easily make packages for your own distro. Have a look at the following links: @@ -45,8 +45,8 @@ * OpenBSD users use:: - pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz - + pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz + For example i386 users get the 2.5.1 version of Python using:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz @@ -87,7 +87,7 @@ Python-related paths and files ============================== - + These are subject to difference depending on local installation conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``) are installation-dependent and should be interpreted as for GNU software; they @@ -112,7 +112,7 @@ | | by the user module; not used by default | | | or by most applications. | +-----------------------------------------------+------------------------------------------+ - + Miscellaneous ============= @@ -140,8 +140,8 @@ Vim and Emacs are excellent editors which support Python very well. For more information on how to code in python in these editors, look at: -http://www.vim.org/scripts/script.php?script_id=790 -http://sourceforge.net/projects/python-mode +* http://www.vim.org/scripts/script.php?script_id=790 +* http://sourceforge.net/projects/python-mode Geany is an excellent IDE with support for a lot of languages. For more information, read: http://geany.uvena.de/ Modified: python/branches/tlee-ast-optimize/Doc/using/windows.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/using/windows.rst (original) +++ python/branches/tlee-ast-optimize/Doc/using/windows.rst Wed Jan 14 13:24:17 2009 @@ -88,9 +88,9 @@ --------------------------------------- Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab +guide applies to XP classical view): Right-click the icon for your machine +(usually located on your Desktop and called "My Computer") and choose +:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab and click the :guilabel:`Environment Variables` button. In short, your path is: @@ -193,11 +193,11 @@ #. Launch a command prompt. #. Associate the correct file group with ``.py`` scripts:: - + assoc .py=Python.File #. Redirect all Python files to the new executable:: - + ftype Python.File=C:\Path\to\pythonw.exe "%1" %* Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.0.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.0.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.0 + What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka @@ -277,11 +277,11 @@ finding all the strings in the list containing a given substring. You could write the following to do it:: - # Given the list L, make a list of all strings + # Given the list L, make a list of all strings # containing the substring S. - sublist = filter( lambda s, substring=S: + sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, - L) + L) Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` statement knows what @@ -291,9 +291,9 @@ List comprehensions have the form:: - [ expression for expr in sequence1 + [ expression for expr in sequence1 for expr2 in sequence2 ... - for exprN in sequenceN + for exprN in sequenceN if condition ] The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be @@ -312,8 +312,8 @@ ... for exprN in sequenceN: if (condition): - # Append the value of - # the expression to the + # Append the value of + # the expression to the # resulting list. This means that when there are multiple :keyword:`for`...\ :keyword:`in` @@ -368,7 +368,7 @@ def __init__(self, value): self.value = value def __iadd__(self, increment): - return Number( self.value + increment) + return Number( self.value + increment) n = Number(5) n += 3 @@ -590,7 +590,7 @@ def f(): print "i=",i - i = i + 1 + i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been @@ -627,7 +627,7 @@ the following lines of code:: if dict.has_key( key ): return dict[key] - else: + else: dict[key] = [] return dict[key] @@ -836,14 +836,14 @@ :file:`setup.py` can be just a few lines long:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:`setup.py` file isn't much more complicated if the software consists of a few packages:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", packages = ["package", "package.subpackage"]) A C extension can be the most complicated case; here's an example taken from @@ -852,15 +852,14 @@ from distutils.core import setup, Extension expat_extension = Extension('xml.parsers.pyexpat', - define_macros = [('XML_NS', None)], - include_dirs = [ 'extensions/expat/xmltok', - 'extensions/expat/xmlparse' ], - sources = [ 'extensions/pyexpat.c', - 'extensions/expat/xmltok/xmltok.c', - 'extensions/expat/xmltok/xmlrole.c', - ] + define_macros = [('XML_NS', None)], + include_dirs = [ 'extensions/expat/xmltok', + 'extensions/expat/xmlparse' ], + sources = [ 'extensions/pyexpat.c', + 'extensions/expat/xmltok/xmltok.c', + 'extensions/expat/xmltok/xmlrole.c', ] ) - setup (name = "PyXML", version = "0.5.4", + setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) The Distutils can also take care of creating source and binary distributions. Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.1.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.1.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.1.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.1 + What's New in Python 2.1 **************************** :Author: A.M. Kuchling @@ -98,7 +98,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.2 + What's New in Python 2.2 **************************** :Author: A.M. Kuchling @@ -295,7 +295,7 @@ class D (B,C): def save (self): - # Call superclass .save() + # Call superclass .save() super(D, self).save() # Save D's private information here ... @@ -473,7 +473,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it expects something for which :func:`iter` will return an iterator. For backward @@ -909,7 +909,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x @@ -952,8 +952,8 @@ items = s.meerkat.getItems( {'channel': 4} ) # 'items' is another list of dictionaries, like this: - # [{'link': 'http://freshmeat.net/releases/52719/', - # 'description': 'A utility which converts HTML to XSL FO.', + # [{'link': 'http://freshmeat.net/releases/52719/', + # 'description': 'A utility which converts HTML to XSL FO.', # 'title': 'html2fo 0.3 (Default)'}, ... ] The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.3.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.3.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.3.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.3 + What's New in Python 2.3 **************************** :Author: A.M. Kuchling @@ -301,7 +301,7 @@ -------- ------- 8467 1 file amk at nyman:~/src/python$ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading @@ -671,7 +671,7 @@ # ... } - if (hasattr(core, 'setup_keywords') and + if (hasattr(core, 'setup_keywords') and 'classifiers' in core.setup_keywords): kw['classifiers'] = \ ['Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -1027,7 +1027,7 @@ creating small dictionaries:: >>> dict(red=1, blue=2, green=3, black=4) - {'blue': 2, 'black': 4, 'green': 3, 'red': 1} + {'blue': 2, 'black': 4, 'green': 3, 'red': 1} (Contributed by Just van Rossum.) @@ -1622,7 +1622,7 @@ ... self.valuelist.pop(i) ... def keys(self): ... return list(self.keylist) - ... + ... >>> s = SeqDict() >>> dir(s) # See that other dictionary methods are implemented ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__', @@ -1779,7 +1779,7 @@ set input filename -lLENGTH, --length=LENGTH set maximum length of output - $ + $ See the module's documentation for more details. Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.4.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.4.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.4 + What's New in Python 2.4 **************************** :Author: A.M. Kuchling @@ -63,10 +63,10 @@ >>> a.add('z') # add a new element >>> a.update('wxy') # add multiple new elements >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) >>> a.remove('x') # take one element out >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) The :func:`frozenset` type is an immutable version of :func:`set`. Since it is immutable and hashable, it may be used as a dictionary key or as a member of @@ -351,7 +351,7 @@ >>> for i in reversed(xrange(1,4)): ... print i - ... + ... 3 2 1 @@ -366,7 +366,7 @@ >>> input = open('/etc/passwd', 'r') >>> for line in reversed(list(input)): ... print line - ... + ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... @@ -396,10 +396,10 @@ different keyword arguments. :: class Popen(args, bufsize=0, executable=None, - stdin=None, stdout=None, stderr=None, - preexec_fn=None, close_fds=False, shell=False, - cwd=None, env=None, universal_newlines=False, - startupinfo=None, creationflags=0): + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): *args* is commonly a sequence of strings that will be the arguments to the program executed as the subprocess. (If the *shell* argument is true, *args* @@ -650,7 +650,7 @@ 28 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.1428571428571428571428571429") - >>> decimal.getcontext().prec = 9 + >>> decimal.getcontext().prec = 9 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.142857143") @@ -665,7 +665,7 @@ >>> decimal.getcontext().traps[decimal.DivisionByZero] = False >>> decimal.Decimal(1) / decimal.Decimal(0) Decimal("Infinity") - >>> + >>> The :class:`Context` instance also has various methods for formatting numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`. @@ -803,7 +803,7 @@ >>> 'www.python.org'.split('.', 1) ['www', 'python.org'] 'www.python.org'.rsplit('.', 1) - ['www.python', 'org'] + ['www.python', 'org'] * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :meth:`sort` method of lists. These parameters make some common usages of @@ -1045,7 +1045,7 @@ >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque - True + True Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take advantage of :class:`collections.deque` for improved performance. (Contributed @@ -1106,13 +1106,13 @@ >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14] >>> for key_val, it in itertools.groupby(L, lambda x: x % 2): ... print key_val, list(it) - ... + ... 0 [2, 4, 6] 1 [7] 0 [8] 1 [9, 11] 0 [12, 14] - >>> + >>> :func:`groupby` is typically used with sorted input. The logic for :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for @@ -1120,21 +1120,21 @@ >>> word = 'abracadabra' >>> letters = sorted(word) # Turn string into a sorted list of letters - >>> letters + >>> letters ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r'] >>> for k, g in itertools.groupby(letters): ... print k, list(g) - ... + ... a ['a', 'a', 'a', 'a', 'a'] b ['b', 'b'] c ['c'] d ['d'] r ['r', 'r'] >>> # List unique letters - >>> [k for k, g in groupby(letters)] + >>> [k for k, g in groupby(letters)] ['a', 'b', 'c', 'd', 'r'] >>> # Count letter occurrences - >>> [(k, len(list(g))) for k, g in groupby(letters)] + >>> [(k, len(list(g))) for k, g in groupby(letters)] [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)] (Contributed by Hye-Shik Chang.) @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that @@ -1428,7 +1428,7 @@ you get the following output:: ********************************************************************** - File ``t.py'', line 15, in g + File "t.py", line 15, in g Failed example: g(4) Differences (unified diff with -expected +actual): Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.5.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.5.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.5.rst Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.5 + What's New in Python 2.5 **************************** :Author: A.M. Kuchling @@ -220,7 +220,7 @@ required packages. :: VERSION = '1.0' - setup(name='PyPackage', + setup(name='PyPackage', version=VERSION, requires=['numarray', 'zlib (>=1.1.4)'], obsoletes=['OldPackage'] @@ -388,7 +388,7 @@ else: else-block finally: - final-block + final-block The code in *block-1* is executed. If the code raises an exception, the various :keyword:`except` blocks are tested: if the exception is of class @@ -485,7 +485,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration @@ -835,8 +835,8 @@ ... except (KeyboardInterrupt, SystemExit): raise - except: - # Log error... + except: + # Log error... # Continue running program... In Python 2.5, you can now write ``except Exception`` to achieve the same @@ -947,7 +947,7 @@ class C: def __index__ (self): - return self.value + return self.value The return value must be either a Python integer or long integer. The interpreter will check that the type returned is correct, and raises a @@ -1035,9 +1035,9 @@ L = ['medium', 'longest', 'short'] # Prints 'longest' - print max(L, key=len) + print max(L, key=len) # Prints 'short', because lexicographically 'short' has the largest value - print max(L) + print max(L) (Contributed by Steven Bethard and Raymond Hettinger.) @@ -1070,8 +1070,8 @@ using the default ASCII encoding. The result of the comparison is false:: >>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode - __main__:1: UnicodeWarning: Unicode equal comparison failed - to convert both arguments to Unicode - interpreting them + __main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them as being unequal False >>> chr(127) == unichr(127) # chr(127) can be converted @@ -1259,10 +1259,10 @@ Printing ``index`` results in the following output:: - defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], - 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], - 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], - 'p': ['per'], 's': ['selva', 'smarrita'], + defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], + 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], + 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], + 'p': ['per'], 's': ['selva', 'smarrita'], 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} (Contributed by Guido van Rossum.) @@ -1884,17 +1884,17 @@ differently. :: # Old versions - h = md5.md5() - h = md5.new() + h = md5.md5() + h = md5.new() - # New version + # New version h = hashlib.md5() # Old versions - h = sha.sha() - h = sha.new() + h = sha.sha() + h = sha.new() - # New version + # New version h = hashlib.sha1() # Hash that weren't previously available @@ -2191,7 +2191,7 @@ case that your extensions were using it, you can replace it by something like the following:: - range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", + range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", start, stop, step); .. ====================================================================== Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst Wed Jan 14 13:24:17 2009 @@ -586,30 +586,30 @@ def factorial(queue, N): - "Compute a factorial." - # If N is a multiple of 4, this function will take much longer. - if (N % 4) == 0: - time.sleep(.05 * N/4) - - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # If N is a multiple of 4, this function will take much longer. + if (N % 4) == 0: + time.sleep(.05 * N/4) + + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i - # Put the result on the queue - queue.put(fact) + # Put the result on the queue + queue.put(fact) if __name__ == '__main__': - queue = Queue() + queue = Queue() - N = 5 + N = 5 - p = Process(target=factorial, args=(queue, N)) - p.start() - p.join() + p = Process(target=factorial, args=(queue, N)) + p.start() + p.join() - result = queue.get() - print 'Factorial', N, '=', result + result = queue.get() + print 'Factorial', N, '=', result A :class:`Queue` is used to communicate the input parameter *N* and the result. The :class:`Queue` object is stored in a global variable. @@ -630,12 +630,12 @@ from multiprocessing import Pool def factorial(N, dictionary): - "Compute a factorial." - ... + "Compute a factorial." + ... p = Pool(5) result = p.map(factorial, range(1, 1000, 10)) for v in result: - print v + print v This produces the following output:: @@ -734,7 +734,7 @@ Curly brackets can be escaped by doubling them:: - >>> format("Empty dict: {{}}") + >>> "Empty dict: {{}}".format() "Empty dict: {}" Field names can be integers indicating positional arguments, such as @@ -744,7 +744,7 @@ >>> import sys >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) Platform: darwin - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' >>> import mimetypes @@ -958,8 +958,8 @@ The primary use of :class:`bytes` in 2.6 will be to write tests of object type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, which can't tell whether 2.x code intends strings to -contain either characters or 8-bit bytes; you can now -use either :class:`bytes` or :class:`str` to represent your intention +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention exactly, and the resulting code will also be correct in Python 3.0. There's also a ``__future__`` import that causes all string literals @@ -1834,9 +1834,9 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) - The :func:`parse_qs` and :func:`parse_qsl` functions have been + The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated from the :mod:`cgi` module to the :mod:`urlparse` module. - The versions still available in the :mod:`cgi` module will + The versions still available in the :mod:`cgi` module will trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`). @@ -1885,9 +1885,9 @@ ('id', 'name', 'type', 'size') >>> var = var_type(1, 'frequency', 'int', 4) - >>> print var[0], var.id # Equivalent + >>> print var[0], var.id # Equivalent 1 1 - >>> print var[2], var.type # Equivalent + >>> print var[2], var.type # Equivalent int int >>> var._asdict() {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'} @@ -1931,7 +1931,7 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) - + :: # Boldface text starting at y=0,x=21 @@ -2046,8 +2046,8 @@ >>> list(itertools.product([1,2,3], [4,5,6])) [(1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6)] + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, @@ -2428,9 +2428,9 @@ :issue:`742598`, :issue:`1193577`.) * The :mod:`sqlite3` module, maintained by Gerhard Haering, - has been updated from version 2.3.2 in Python 2.5 to + has been updated from version 2.3.2 in Python 2.5 to version 2.4.1. - + * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type, using the format character ``'?'``. (Contributed by David Remahl.) @@ -2525,9 +2525,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module gained a number - of context managers useful for writing tests. - :func:`EnvironmentVarGuard` is a +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2542,7 +2542,7 @@ f = urllib.urlopen('https://sf.net') ... - Finally, :func:`check_warnings` resets the :mod:`warning` module's + Finally, :func:`check_warnings` resets the :mod:`warning` module's warning filters and returns an object that will record all warning messages triggered (:issue:`3781`):: @@ -2582,7 +2582,7 @@ :meth:`activeCount` method is renamed to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module support the same properties and renamed methods, but don't remove the old methods. No date has been set - for the deprecation of the old APIs in Python 3.x; the old APIs won't + for the deprecation of the old APIs in Python 3.x; the old APIs won't be removed in any 2.x version. (Carried out by several people, most notably Benjamin Peterson.) @@ -2639,7 +2639,7 @@ (Added by Facundo Batista.) * The Unicode database provided by the :mod:`unicodedata` module - has been updated to version 5.1.0. (Updated by + has been updated to version 5.1.0. (Updated by Martin von Loewis; :issue:`3811`.) * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` @@ -2650,7 +2650,7 @@ A new function, :func:`catch_warnings`, is a context manager intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). - + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` @@ -3213,6 +3213,9 @@ set ``__hash__ = None`` in their definitions to indicate the fact. +* String exceptions have been removed. Attempting to use them raises a + :exc:`TypeError`. + * The :meth:`__init__` method of :class:`collections.deque` now clears any existing contents of the deque before adding elements from the iterable. This change makes the @@ -3220,8 +3223,8 @@ * :meth:`object.__init__` previously accepted arbitrary arguments and keyword arguments, ignoring them. In Python 2.6, this is no longer - allowed and will result in a :exc:`TypeError`. This will affect - :meth:`__init__` methods that end up calling the corresponding + allowed and will result in a :exc:`TypeError`. This will affect + :meth:`__init__` methods that end up calling the corresponding method on :class:`object` (perhaps through using :func:`super`). See :issue:`1683368` for discussion. @@ -3281,7 +3284,7 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, -Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner. Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.7.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.7.rst Wed Jan 14 13:24:17 2009 @@ -60,13 +60,34 @@ .. ======================================================================== +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 ====================== Some smaller changes made to the core Python language are: -* List of changes to be written here. +* The :func:`int` and :func:`long` types gained a ``bit_length`` + method that returns the number of bits necessary to represent + its argument in binary:: + + >>> n = 37 + >>> bin(37) + '0b100101' + >>> n.bit_length() + 6 + >>> n = 2**123-1 + >>> n.bit_length() + 123 + >>> (n+1).bit_length() + 124 + + (Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.) + .. ====================================================================== @@ -87,7 +108,28 @@ :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. -* To be written. +* 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 + error, or raises a :exc:`CalledProcessError` exception otherwise. + + :: + + >>> subprocess.check_output(['df', '-h', '.']) + 'Filesystem Size Used Avail Capacity Mounted on\n + /dev/disk0s2 52G 49G 3.0G 94% /\n' + + >>> subprocess.check_output(['df', '-h', '/bogus']) + ... + subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1 + + (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`.) .. ====================================================================== .. whole new modules get described in subsections here @@ -100,13 +142,22 @@ Changes to Python's build process and to the C API include: -* To be written. +* 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`.) .. ====================================================================== Port-Specific Changes: Windows ----------------------------------- +* The :mod:`msvcrt` module now contains some constants from + the :file:`crtassem.h` header file: + :data:`CRT_ASSEMBLY_VERSION`, + :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`, + and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. + (Added by Martin von Loewis (XXX check); :issue:`4365`.) .. ====================================================================== Modified: python/branches/tlee-ast-optimize/Include/abstract.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/abstract.h (original) +++ python/branches/tlee-ast-optimize/Include/abstract.h Wed Jan 14 13:24:17 2009 @@ -636,7 +636,8 @@ #define PyIter_Check(obj) \ (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_ITER) && \ - (obj)->ob_type->tp_iternext != NULL) + (obj)->ob_type->tp_iternext != NULL && \ + (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *); /* Takes an iterator object and calls its tp_iternext slot, Modified: python/branches/tlee-ast-optimize/Include/object.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/object.h (original) +++ python/branches/tlee-ast-optimize/Include/object.h Wed Jan 14 13:24:17 2009 @@ -473,6 +473,7 @@ PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); Modified: python/branches/tlee-ast-optimize/Include/opcode.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/opcode.h (original) +++ python/branches/tlee-ast-optimize/Include/opcode.h Wed Jan 14 13:24:17 2009 @@ -22,7 +22,6 @@ #define UNARY_INVERT 15 -#define LIST_APPEND 18 #define BINARY_POWER 19 #define BINARY_MULTIPLY 20 @@ -89,6 +88,7 @@ #define DELETE_NAME 91 /* "" */ #define UNPACK_SEQUENCE 92 /* Number of sequence items */ #define FOR_ITER 93 +#define LIST_APPEND 94 #define STORE_ATTR 95 /* Index in name list */ #define DELETE_ATTR 96 /* "" */ Modified: python/branches/tlee-ast-optimize/Include/pymacconfig.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/pymacconfig.h (original) +++ python/branches/tlee-ast-optimize/Include/pymacconfig.h Wed Jan 14 13:24:17 2009 @@ -15,6 +15,8 @@ # undef SIZEOF_SIZE_T # undef SIZEOF_TIME_T # undef SIZEOF_VOID_P +# undef SIZEOF__BOOL +# undef WORDS_BIGENDIAN # undef VA_LIST_IS_ARRAY # if defined(__LP64__) && defined(__x86_64__) @@ -28,12 +30,19 @@ # undef SIZEOF_LONG # ifdef __LP64__ +# define SIZEOF__BOOL 1 +# define SIZEOF__BOOL 1 # define SIZEOF_LONG 8 # define SIZEOF_PTHREAD_T 8 # define SIZEOF_SIZE_T 8 # define SIZEOF_TIME_T 8 # define SIZEOF_VOID_P 8 # else +# ifdef __ppc__ +# define SIZEOF__BOOL 4 +# else +# define SIZEOF__BOOL 1 +# endif # define SIZEOF_LONG 4 # define SIZEOF_PTHREAD_T 4 # define SIZEOF_SIZE_T 4 @@ -54,6 +63,11 @@ # endif +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#endif /* __BIG_ENDIAN */ + + #endif /* defined(_APPLE__) */ #endif /* PYMACCONFIG_H */ Modified: python/branches/tlee-ast-optimize/Include/pymath.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/pymath.h (original) +++ python/branches/tlee-ast-optimize/Include/pymath.h Wed Jan 14 13:24:17 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_ISNAN +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_ISINF +#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)) @@ -118,7 +118,9 @@ * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE -#ifdef HAVE_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) Modified: python/branches/tlee-ast-optimize/Include/pyport.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/pyport.h (original) +++ python/branches/tlee-ast-optimize/Include/pyport.h Wed Jan 14 13:24:17 2009 @@ -709,6 +709,15 @@ #define Py_FORMAT_PARSETUPLE(func,p1,p2) #endif +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ Modified: python/branches/tlee-ast-optimize/Include/unicodeobject.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/unicodeobject.h (original) +++ python/branches/tlee-ast-optimize/Include/unicodeobject.h Wed Jan 14 13:24:17 2009 @@ -130,6 +130,10 @@ typedef unsigned long Py_UCS4; #endif +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + typedef PY_UNICODE_TYPE Py_UNICODE; /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ @@ -153,6 +157,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS2_Compare # define PyUnicode_Concat PyUnicodeUCS2_Concat # define PyUnicode_Contains PyUnicodeUCS2_Contains @@ -182,13 +187,13 @@ # define PyUnicode_Find PyUnicodeUCS2_Find # define PyUnicode_Format PyUnicodeUCS2_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS2_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromString PyUnicodeUCS2_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS2_GetMax @@ -209,7 +214,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS2_Fini # define _PyUnicode_Init _PyUnicodeUCS2_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit @@ -240,6 +244,7 @@ # define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist # define PyUnicode_Compare PyUnicodeUCS4_Compare # define PyUnicode_Concat PyUnicodeUCS4_Concat # define PyUnicode_Contains PyUnicodeUCS4_Contains @@ -269,13 +274,13 @@ # define PyUnicode_Find PyUnicodeUCS4_Find # define PyUnicode_Format PyUnicodeUCS4_Format # define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV # define PyUnicode_FromObject PyUnicodeUCS4_FromObject # define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal -# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromString PyUnicodeUCS4_FromString # define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize -# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV -# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS4_GetMax @@ -296,7 +301,6 @@ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString # define _PyUnicode_Fini _PyUnicodeUCS4_Fini # define _PyUnicode_Init _PyUnicodeUCS4_Init -# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit @@ -350,12 +354,12 @@ #else -/* Since splitting on whitespace is an important use case, and whitespace - in most situations is solely ASCII whitespace, we optimize for the common - case by using a quick look-up table with an inlined check. - */ -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + */ #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) @@ -389,13 +393,14 @@ #define Py_UNICODE_COPY(target, source, length) \ Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) -#define Py_UNICODE_FILL(target, value, length) do\ - {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) -/* check if substring matches at given offset. the offset must be +/* Check if substring matches at given offset. the offset must be valid, and the substring must not be empty */ + #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->str + (offset)) == *((substring)->str)) && \ ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ @@ -405,8 +410,6 @@ extern "C" { #endif -PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); - /* --- Unicode Type ------------------------------------------------------- */ typedef struct { @@ -605,6 +608,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These @@ -1323,6 +1337,10 @@ /* === Characters Type APIs =============================================== */ +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. Modified: python/branches/tlee-ast-optimize/LICENSE ============================================================================== --- python/branches/tlee-ast-optimize/LICENSE (original) +++ python/branches/tlee-ast-optimize/LICENSE Wed Jan 14 13:24:17 2009 @@ -55,7 +55,10 @@ 2.4.4 2.4.3 2006 PSF yes 2.5 2.4 2006 PSF yes 2.5.1 2.5 2007 PSF yes + 2.5.2 2.5.1 2008 PSF yes + 2.5.3 2.5.2 2008 PSF yes 2.6 2.5 2008 PSF yes + 2.6.1 2.6 2008 PSF yes Footnotes: @@ -85,15 +88,14 @@ otherwise using this software ("Python") in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative -version prepared by Licensee. +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python +Software Foundation; All Rights Reserved" are retained in Python alone or in any +derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/branches/tlee-ast-optimize/Lib/_abcoll.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/_abcoll.py (original) +++ python/branches/tlee-ast-optimize/Lib/_abcoll.py Wed Jan 14 13:24:17 2009 @@ -249,12 +249,12 @@ @abstractmethod def add(self, value): - """Return True if it was added, False if already there.""" + """Add an element.""" raise NotImplementedError @abstractmethod def discard(self, value): - """Return True if it was deleted, False if not there.""" + """Remove an element. Do not raise an exception if absent.""" raise NotImplementedError def remove(self, value): Modified: python/branches/tlee-ast-optimize/Lib/ast.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ast.py (original) +++ python/branches/tlee-ast-optimize/Lib/ast.py Wed Jan 14 13:24:17 2009 @@ -69,6 +69,18 @@ return _safe_names[node.id] elif isinstance(node, Const): return node.value + elif isinstance(node, BinOp) and \ + isinstance(node.op, (Add, Sub)) and \ + isinstance(node.right, Num) and \ + isinstance(node.right.n, complex) and \ + isinstance(node.left, Num) and \ + isinstance(node.left.n, (int, long, float)): + left = node.left.n + right = node.right.n + if isinstance(node.op, Add): + return left + right + else: + return left - right raise ValueError('malformed string') return _convert(node_or_string) Modified: python/branches/tlee-ast-optimize/Lib/bdb.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/bdb.py (original) +++ python/branches/tlee-ast-optimize/Lib/bdb.py Wed Jan 14 13:24:17 2009 @@ -347,7 +347,7 @@ rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) - line = linecache.getline(filename, lineno) + line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s @@ -589,7 +589,7 @@ name = frame.f_code.co_name if not name: name = '???' fn = self.canonic(frame.f_code.co_filename) - line = linecache.getline(fn, frame.f_lineno) + line = linecache.getline(fn, frame.f_lineno, frame.f_globals) print '+++', fn, frame.f_lineno, name, ':', line.strip() def user_return(self, frame, retval): print '+++ return', retval Modified: python/branches/tlee-ast-optimize/Lib/cgi.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/cgi.py (original) +++ python/branches/tlee-ast-optimize/Lib/cgi.py Wed Jan 14 13:24:17 2009 @@ -289,16 +289,28 @@ return partdict +def _parseparam(s): + while s[:1] == ';': + s = s[1:] + end = s.find(';') + while end > 0 and s.count('"', 0, end) % 2: + end = s.find(';', end + 1) + if end < 0: + end = len(s) + f = s[:end] + yield f.strip() + s = s[end:] + def parse_header(line): """Parse a Content-type like header. Return the main content-type and a dictionary of options. """ - plist = [x.strip() for x in line.split(';')] - key = plist.pop(0).lower() + parts = _parseparam(';' + line) + key = parts.next() pdict = {} - for p in plist: + for p in parts: i = p.find('=') if i >= 0: name = p[:i].strip().lower() Modified: python/branches/tlee-ast-optimize/Lib/collections.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/collections.py (original) +++ python/branches/tlee-ast-optimize/Lib/collections.py Wed Jan 14 13:24:17 2009 @@ -9,6 +9,11 @@ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys +import heapq as _heapq +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap + +######################################################################## +### namedtuple ####################################################### def namedtuple(typename, field_names, verbose=False): """Returns a new subclass of tuple with named fields. @@ -108,7 +113,160 @@ return result +######################################################################## +### Counter ########################################################## + +class Counter(dict): + '''Dict subclass for counting hashable items. Sometimes called a bag + or multiset. Elements are stored as dictionary keys and their counts + are stored as dictionary values. + + >>> c = Counter('abracadabra') # count elements from a string + + >>> c.most_common(3) # three most common elements + [('a', 5), ('r', 2), ('b', 2)] + >>> sorted(c) # list all unique elements + ['a', 'b', 'c', 'd', 'r'] + >>> ''.join(sorted(c.elements())) # list elements with repetitions + 'aaaaabbcdrr' + >>> sum(c.values()) # total of all counts + 11 + >>> c['a'] # count of letter 'a' + 5 + >>> for elem in 'shazam': # update counts from an iterable + ... c[elem] += 1 # by adding 1 to each element's count + >>> c['a'] # now there are seven 'a' + 7 + >>> del c['r'] # remove all 'r' + >>> c['r'] # now there are zero 'r' + 0 + + >>> d = Counter('simsalabim') # make another counter + >>> c.update(d) # add in the second counter + >>> c['a'] # now there are nine 'a' + 9 + + >>> c.clear() # empty the counter + >>> c + Counter() + + Note: If a count is set to zero or reduced to zero, it will remain + in the counter until the entry is deleted or the counter is cleared: + + >>> c = Counter('aaabbc') + >>> c['b'] -= 2 # reduce the count of 'b' by two + >>> c.most_common() # 'b' is still in, but its count is zero + [('a', 3), ('c', 1), ('b', 0)] + + ''' + # References: + # http://en.wikipedia.org/wiki/Multiset + # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html + # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm + # http://code.activestate.com/recipes/259174/ + # Knuth, TAOCP Vol. II section 4.6.3 + + def __init__(self, iterable=None): + '''Create a new, empty Counter object. And if given, count elements + from an input iterable. Or, initialize the count from another mapping + of elements to their counts. + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + + ''' + self.update(iterable) + + def __missing__(self, key): + 'The count of elements not in the Counter is zero.' + # Needed so that self[missing_item] does not raise KeyError + return 0 + + def most_common(self, n=None): + '''List the n most common elements and their counts from the most + common to the least. If n is None, then list all element counts. + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + ''' + # Emulate Bag.sortedByCount from Smalltalk + if n is None: + return sorted(self.iteritems(), key=_itemgetter(1), reverse=True) + return _heapq.nlargest(n, self.iteritems(), key=_itemgetter(1)) + + def elements(self): + '''Iterator over elements repeating each as many times as its count. + + >>> c = Counter('ABCABC') + >>> sorted(c.elements()) + ['A', 'A', 'B', 'B', 'C', 'C'] + + # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 + >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) + >>> product = 1 + >>> for factor in prime_factors.elements(): # loop over factors + ... product *= factor # and multiply them + >>> product + 1836 + + Note, if an element's count has been set to zero or is a negative + number, elements() will ignore it. + + ''' + # Emulate Bag.do from Smalltalk and Multiset.begin from C++. + return _chain.from_iterable(_starmap(_repeat, self.iteritems())) + + # Override dict methods where necessary + + @classmethod + def fromkeys(cls, iterable, v=None): + # There is no equivalent method for counters because setting v=1 + # means that no element can have a count greater than one. + raise NotImplementedError( + 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') + + def update(self, iterable=None): + '''Like dict.update() but add counts instead of replacing them. + + Source can be an iterable, a dictionary, or another Counter instance. + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + + ''' + # The regular dict.update() operation makes no sense here because the + # replace behavior results in the some of original untouched counts + # being mixed-in with all of the other counts for a mismash that + # doesn't have a straight-forward interpretation in most counting + # contexts. Instead, we look to Knuth for suggested operations on + # multisets and implement the union-add operation discussed in + # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for + # multisets calls that operation a sum or join. + + if iterable is not None: + if isinstance(iterable, Mapping): + for elem, count in iterable.iteritems(): + self[elem] += count + else: + for elem in iterable: + self[elem] += 1 + + def copy(self): + 'Like dict.copy() but returns a Counter instance instead of a dict.' + return Counter(self) + + def __repr__(self): + if not self: + return '%s()' % self.__class__.__name__ + items = ', '.join(map('%r: %r'.__mod__, self.most_common())) + return '%s({%s})' % (self.__class__.__name__, items) Modified: python/branches/tlee-ast-optimize/Lib/compiler/misc.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/compiler/misc.py (original) +++ python/branches/tlee-ast-optimize/Lib/compiler/misc.py Wed Jan 14 13:24:17 2009 @@ -14,13 +14,13 @@ def __len__(self): return len(self.elts) def __contains__(self, elt): - return self.elts.has_key(elt) + return elt in self.elts def add(self, elt): self.elts[elt] = elt def elements(self): return self.elts.keys() def has_elt(self, elt): - return self.elts.has_key(elt) + return elt in self.elts def remove(self, elt): del self.elts[elt] def copy(self): Modified: python/branches/tlee-ast-optimize/Lib/compiler/pyassem.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/compiler/pyassem.py (original) +++ python/branches/tlee-ast-optimize/Lib/compiler/pyassem.py Wed Jan 14 13:24:17 2009 @@ -210,7 +210,7 @@ order = [] seen[b] = b for c in b.get_children(): - if seen.has_key(c): + if c in seen: continue order = order + dfs_postorder(c, seen) order.append(b) @@ -406,7 +406,7 @@ seen = {} def max_depth(b, d): - if seen.has_key(b): + if b in seen: return d seen[b] = 1 d = d + depth[b] @@ -482,7 +482,7 @@ for name in self.cellvars: cells[name] = 1 self.cellvars = [name for name in self.varnames - if cells.has_key(name)] + if name in cells] for name in self.cellvars: del cells[name] self.cellvars = self.cellvars + cells.keys() Modified: python/branches/tlee-ast-optimize/Lib/compiler/pycodegen.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/compiler/pycodegen.py (original) +++ python/branches/tlee-ast-optimize/Lib/compiler/pycodegen.py Wed Jan 14 13:24:17 2009 @@ -570,16 +570,10 @@ self.nextBlock(end) # list comprehensions - __list_count = 0 - def visitListComp(self, node): self.set_lineno(node) # setup list - tmpname = "$list%d" % self.__list_count - self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) - self.emit('DUP_TOP') - self._implicitNameOp('STORE', tmpname) stack = [] for i, for_ in zip(range(len(node.quals)), node.quals): @@ -591,9 +585,8 @@ self.visit(if_, cont) stack.insert(0, (start, cont, anchor)) - self._implicitNameOp('LOAD', tmpname) self.visit(node.expr) - self.emit('LIST_APPEND') + self.emit('LIST_APPEND', len(node.quals) + 1) for start, cont, anchor in stack: if cont: @@ -604,9 +597,6 @@ self.nextBlock(skip_one) self.emit('JUMP_ABSOLUTE', start) self.startBlock(anchor) - self._implicitNameOp('DELETE', tmpname) - - self.__list_count = self.__list_count - 1 def visitListCompFor(self, node): start = self.newBlock() Modified: python/branches/tlee-ast-optimize/Lib/compiler/symbols.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/compiler/symbols.py (original) +++ python/branches/tlee-ast-optimize/Lib/compiler/symbols.py Wed Jan 14 13:24:17 2009 @@ -49,9 +49,9 @@ def add_global(self, name): name = self.mangle(name) - if self.uses.has_key(name) or self.defs.has_key(name): + if name in self.uses or name in self.defs: pass # XXX warn about global following def/use - if self.params.has_key(name): + if name in self.params: raise SyntaxError, "%s in %s is global and parameter" % \ (name, self.name) self.globals[name] = 1 @@ -88,14 +88,13 @@ The scope of a name could be LOCAL, GLOBAL, FREE, or CELL. """ - if self.globals.has_key(name): + if name in self.globals: return SC_GLOBAL - if self.cells.has_key(name): + if name in self.cells: return SC_CELL - if self.defs.has_key(name): + if name in self.defs: return SC_LOCAL - if self.nested and (self.frees.has_key(name) or - self.uses.has_key(name)): + if self.nested and (name in self.frees or name in self.uses): return SC_FREE if self.nested: return SC_UNKNOWN @@ -108,8 +107,7 @@ free = {} free.update(self.frees) for name in self.uses.keys(): - if not (self.defs.has_key(name) or - self.globals.has_key(name)): + if name not in self.defs and name not in self.globals: free[name] = 1 return free.keys() @@ -134,7 +132,7 @@ free. """ self.globals[name] = 1 - if self.frees.has_key(name): + if name in self.frees: del self.frees[name] for child in self.children: if child.check_name(name) == SC_FREE: Modified: python/branches/tlee-ast-optimize/Lib/compiler/transformer.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/compiler/transformer.py (original) +++ python/branches/tlee-ast-optimize/Lib/compiler/transformer.py Wed Jan 14 13:24:17 2009 @@ -81,7 +81,7 @@ def Node(*args): kind = args[0] - if nodes.has_key(kind): + if kind in nodes: try: return nodes[kind](*args[1:]) except TypeError: @@ -120,7 +120,7 @@ def transform(self, tree): """Transform an AST into a modified parse tree.""" if not (isinstance(tree, tuple) or isinstance(tree, list)): - tree = parser.ast2tuple(tree, line_info=1) + tree = parser.st2tuple(tree, line_info=1) return self.compile_node(tree) def parsesuite(self, text): Modified: python/branches/tlee-ast-optimize/Lib/compiler/visitor.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/compiler/visitor.py (original) +++ python/branches/tlee-ast-optimize/Lib/compiler/visitor.py Wed Jan 14 13:24:17 2009 @@ -84,7 +84,7 @@ meth(node, *args) elif self.VERBOSE > 0: klass = node.__class__ - if not self.examples.has_key(klass): + if klass not in self.examples: self.examples[klass] = klass print print self.visitor Modified: python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py (original) +++ python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py Wed Jan 14 13:24:17 2009 @@ -67,9 +67,6 @@ if verbosity > 1: print >> sys.stderr, "Skipped %s: %s" % (modname, detail) continue - except Exception, detail: - print >> sys.stderr, "Warning: could not import %s: %s" % (modname, detail) - continue for name in dir(mod): if name.startswith("_"): continue Modified: python/branches/tlee-ast-optimize/Lib/ctypes/util.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ctypes/util.py (original) +++ python/branches/tlee-ast-optimize/Lib/ctypes/util.py Wed Jan 14 13:24:17 2009 @@ -92,18 +92,20 @@ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) - cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ + cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) trace = f.read() - f.close() + rv = f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise + if rv == 10: + raise OSError, 'gcc or cc command not found' res = re.search(expr, trace) if not res: return None @@ -125,7 +127,13 @@ # assuming GNU binutils / ELF if not f: return None - cmd = "objdump -p -j .dynamic 2>/dev/null " + f + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ + "objdump -p -j .dynamic 2>/dev/null " + f + f = os.popen(cmd) + dump = f.read() + rv = f.close() + if rv == 10: + raise OSError, 'objdump command not found' res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: return None @@ -171,8 +179,32 @@ return None return res.group(0) + def _findSoname_ldconfig(name): + import struct + if struct.calcsize('l') == 4: + machine = os.uname()[4] + '-32' + else: + machine = os.uname()[4] + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', + } + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) + expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ + % (abi_type, re.escape(name)) + res = re.search(expr, + os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + if not res: + return None + return res.group(1) + def find_library(name): - return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name)) + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code Modified: python/branches/tlee-ast-optimize/Lib/decimal.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/decimal.py (original) +++ python/branches/tlee-ast-optimize/Lib/decimal.py Wed Jan 14 13:24:17 2009 @@ -135,6 +135,7 @@ ] import copy as _copy +import math as _math try: from collections import namedtuple as _namedtuple @@ -216,7 +217,7 @@ if args: ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) return ans._fix_nan(context) - return NaN + return _NaN class ConversionSyntax(InvalidOperation): """Trying to convert badly formed string. @@ -226,7 +227,7 @@ syntax. The result is [0,qNaN]. """ def handle(self, context, *args): - return NaN + return _NaN class DivisionByZero(DecimalException, ZeroDivisionError): """Division by 0. @@ -242,7 +243,7 @@ """ def handle(self, context, sign, *args): - return Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -253,7 +254,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class DivisionUndefined(InvalidOperation, ZeroDivisionError): """Undefined result of division. @@ -264,7 +265,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Inexact(DecimalException): """Had to round, losing information. @@ -290,7 +291,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Rounded(DecimalException): """Number got rounded (not necessarily changed during rounding). @@ -340,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -653,6 +654,46 @@ raise TypeError("Cannot convert %r to Decimal" % value) + # @classmethod, but @decorator is not valid Python 2.3 syntax, so + # don't use it (see notes on Py2.3 compatibility at top of file) + def from_float(cls, f): + """Converts a float to a decimal number, exactly. + + Note that Decimal.from_float(0.1) is not the same as Decimal('0.1'). + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + 0x1.999999999999ap-4. The exact equivalent of the value in decimal + is 0.1000000000000000055511151231257827021181583404541015625. + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(-float('inf')) + Decimal('-Infinity') + >>> Decimal.from_float(-0.0) + Decimal('-0') + + """ + if isinstance(f, (int, long)): # handle integer inputs + return cls(f) + if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float + return cls(repr(f)) + if _math.copysign(1.0, f) == 1.0: + sign = 0 + else: + sign = 1 + n, d = abs(f).as_integer_ratio() + k = d.bit_length() - 1 + result = _dec_from_triple(sign, str(n*5**k), -k) + if cls is Decimal: + return result + else: + return cls(result) + from_float = classmethod(from_float) + def _isnan(self): """Returns whether the number is not actually one. @@ -1171,12 +1212,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1226,7 +1267,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1329,7 +1370,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1477,7 +1518,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1515,13 +1556,13 @@ __trunc__ = __int__ - @property def real(self): return self + real = property(real) - @property def imag(self): return Decimal(0) + imag = property(imag) def conjugate(self): return self @@ -1732,12 +1773,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2087,7 +2128,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2109,19 +2150,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2154,7 +2195,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2563,10 +2604,10 @@ sn = self._isnan() on = other._isnan() if sn or on: - if on == 1 and sn != 2: - return self._fix_nan(context) - if sn == 1 and on != 2: - return other._fix_nan(context) + if on == 1 and sn == 0: + return self._fix(context) + if sn == 1 and on == 0: + return other._fix(context) return self._check_nans(other, context) c = self._cmp(other) @@ -2605,10 +2646,10 @@ sn = self._isnan() on = other._isnan() if sn or on: - if on == 1 and sn != 2: - return self._fix_nan(context) - if sn == 1 and on != 2: - return other._fix_nan(context) + if on == 1 and sn == 0: + return self._fix(context) + if sn == 1 and on == 0: + return other._fix(context) return self._check_nans(other, context) c = self._cmp(other) @@ -2674,9 +2715,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2686,51 +2727,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return Dec_p1 + return _One else: - return Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return Dec_n1 + return _NegativeOne else: - return Dec_p1 - return Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return Dec_n1 + return _NegativeOne if other_nan == 1: - return Dec_p1 + return _One if self_nan == 2: - return Dec_n1 + return _NegativeOne if other_nan == 2: - return Dec_p1 + return _One else: if self_nan == 1: - return Dec_p1 + return _One if other_nan == 1: - return Dec_n1 + return _NegativeOne if self_nan == 2: - return Dec_p1 + return _One if other_nan == 2: - return Dec_n1 + return _NegativeOne if self < other: - return Dec_n1 + return _NegativeOne if self > other: - return Dec_p1 + return _One if self._exp < other._exp: if sign: - return Dec_p1 + return _One else: - return Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return Dec_n1 + return _NegativeOne else: - return Dec_p1 - return Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2771,11 +2812,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return Dec_0 + return _Zero # exp(0) = 1 if not self: - return Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -2927,15 +2968,15 @@ # ln(0.0) == -Infinity if not self: - return negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Infinity # ln(1.0) == 0.0 - if self == Dec_p1: - return Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3007,11 +3048,11 @@ # log10(0.0) == -Infinity if not self: - return negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3063,7 +3104,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3133,7 +3174,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def logical_xor(self, other, context=None): @@ -3147,7 +3188,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def max_mag(self, other, context=None): @@ -3163,10 +3204,10 @@ sn = self._isnan() on = other._isnan() if sn or on: - if on == 1 and sn != 2: - return self._fix_nan(context) - if sn == 1 and on != 2: - return other._fix_nan(context) + if on == 1 and sn == 0: + return self._fix(context) + if sn == 1 and on == 0: + return other._fix(context) return self._check_nans(other, context) c = self.copy_abs()._cmp(other.copy_abs()) @@ -3193,10 +3234,10 @@ sn = self._isnan() on = other._isnan() if sn or on: - if on == 1 and sn != 2: - return self._fix_nan(context) - if sn == 1 and on != 2: - return other._fix_nan(context) + if on == 1 and sn == 0: + return self._fix(context) + if sn == 1 and on == 0: + return other._fix(context) return self._check_nans(other, context) c = self.copy_abs()._cmp(other.copy_abs()) @@ -3220,7 +3261,7 @@ return ans if self._isinfinity() == -1: - return negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3243,7 +3284,7 @@ return ans if self._isinfinity() == 1: - return Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -3744,6 +3785,23 @@ "diagnostic info too long in NaN") return d._fix(self) + def create_decimal_from_float(self, f): + """Creates a new Decimal instance from a float but rounding using self + as the context. + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(3.1415926535897932) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(3.1415926535897932) + Traceback (most recent call last): + ... + Inexact: None + + """ + d = Decimal.from_float(f) # An exact conversion + return d._fix(self) # Apply the context rounding + # Methods def abs(self, a): """Returns the absolute value of the operand. @@ -5490,15 +5548,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -Inf = Decimal('Inf') -negInf = Decimal('-Inf') -NaN = Decimal('NaN') -Dec_0 = Decimal(0) -Dec_p1 = Decimal(1) -Dec_n1 = Decimal(-1) +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') +_NaN = Decimal('NaN') +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# Infsign[sign] is infinity w/ that sign -Infsign = (Inf, negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) Modified: python/branches/tlee-ast-optimize/Lib/dis.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/dis.py (original) +++ python/branches/tlee-ast-optimize/Lib/dis.py Wed Jan 14 13:24:17 2009 @@ -6,7 +6,8 @@ from opcode import * from opcode import __all__ as _opcodes_all -__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all +__all__ = ["dis", "disassemble", "distb", "disco", + "findlinestarts", "findlabels"] + _opcodes_all del _opcodes_all def dis(x=None): Modified: python/branches/tlee-ast-optimize/Lib/distutils/ccompiler.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/ccompiler.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/ccompiler.py Wed Jan 14 13:24:17 2009 @@ -1041,7 +1041,7 @@ return move_file (src, dst, dry_run=self.dry_run) def mkpath (self, name, mode=0777): - mkpath (name, mode, self.dry_run) + mkpath (name, mode, dry_run=self.dry_run) # class CCompiler Modified: python/branches/tlee-ast-optimize/Lib/distutils/command/register.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/command/register.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/command/register.py Wed Jan 14 13:24:17 2009 @@ -141,12 +141,14 @@ # get the user's login info choices = '1 2 3 4'.split() while choice not in choices: - print '''We need to know who you are, so please choose either: + self.announce('''\ +We need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit -Your selection [default 1]: ''', +Your selection [default 1]: ''', log.INFO) + choice = raw_input() if not choice: choice = '1' @@ -167,19 +169,27 @@ # send the info to the server and report the result code, result = self.post_to_server(self.build_post_data('submit'), auth) - print 'Server response (%s): %s' % (code, result) + self.announce('Server response (%s): %s' % (code, result), + log.INFO) # possibly save the login - if not self.has_config and code == 200: - print 'I can store your PyPI login so future submissions will be faster.' - print '(the login will be stored in %s)' % self._get_rc_file() - choice = 'X' - while choice.lower() not in 'yn': - choice = raw_input('Save your login (y/N)?') - if not choice: - choice = 'n' - if choice.lower() == 'y': - self._store_pypirc(username, password) + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = raw_input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} Modified: python/branches/tlee-ast-optimize/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/command/sdist.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/command/sdist.py Wed Jan 14 13:24:17 2009 @@ -7,6 +7,7 @@ __revision__ = "$Id$" import os, string +import sys from types import * from glob import glob from distutils.core import Command @@ -354,8 +355,18 @@ self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) + # pruning out vcs directories + # both separators are used under win32 + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in Modified: python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py Wed Jan 14 13:24:17 2009 @@ -50,6 +50,11 @@ self.repository = config['repository'] self.realm = config['realm'] + # getting the password from the distribution + # if previously set by the register command + if not self.password and self.distribution.password: + self.password = self.distribution.password + def run(self): if not self.distribution.dist_files: raise DistutilsOptionError("No dist file created in earlier command") Modified: python/branches/tlee-ast-optimize/Lib/distutils/config.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/config.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/config.py Wed Jan 14 13:24:17 2009 @@ -10,8 +10,8 @@ from distutils.cmd import Command DEFAULT_PYPIRC = """\ -[pypirc] -servers = +[distutils] +index-servers = pypi [pypi] @@ -82,12 +82,12 @@ for server in _servers: current = {'server': server} current['username'] = config.get(server, 'username') - current['password'] = config.get(server, 'password') # optional params for key, default in (('repository', self.DEFAULT_REPOSITORY), - ('realm', self.DEFAULT_REALM)): + ('realm', self.DEFAULT_REALM), + ('password', None)): if config.has_option(server, key): current[key] = config.get(server, key) else: Modified: python/branches/tlee-ast-optimize/Lib/distutils/dist.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/dist.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/dist.py Wed Jan 14 13:24:17 2009 @@ -206,6 +206,7 @@ self.extra_path = None self.scripts = None self.data_files = None + self.password = '' # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to @@ -235,7 +236,7 @@ # command options will override any supplied redundantly # through the general options dictionary. options = attrs.get('options') - if options: + if options is not None: del attrs['options'] for (command, cmd_options) in options.items(): opt_dict = self.get_option_dict(command) Modified: python/branches/tlee-ast-optimize/Lib/distutils/msvc9compiler.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/msvc9compiler.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/msvc9compiler.py Wed Jan 14 13:24:17 2009 @@ -247,7 +247,7 @@ result = {} if vcvarsall is None: - raise IOError("Unable to find vcvarsall.bat") + raise DistutilsPlatformError("Unable to find vcvarsall.bat") log.debug("Calling 'vcvarsall.bat %s' (version=%s)", arch, version) popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch), stdout=subprocess.PIPE, @@ -255,7 +255,7 @@ stdout, stderr = popen.communicate() if popen.wait() != 0: - raise IOError(stderr.decode("mbcs")) + raise DistutilsPlatformError(stderr.decode("mbcs")) stdout = stdout.decode("mbcs") for line in stdout.split("\n"): Modified: python/branches/tlee-ast-optimize/Lib/distutils/tests/test_config.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/tests/test_config.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/tests/test_config.py Wed Jan 14 13:24:17 2009 @@ -5,6 +5,8 @@ from distutils.core import PyPIRCCommand from distutils.core import Distribution +from distutils.log import set_threshold +from distutils.log import WARN from distutils.tests import support @@ -32,6 +34,17 @@ password:secret """ +WANTED = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:xxx +""" + + class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): @@ -53,6 +66,7 @@ finalize_options = initialize_options self._cmd = command + self.old_threshold = set_threshold(WARN) def tearDown(self): """Removes the patch.""" @@ -62,6 +76,7 @@ os.environ['HOME'] = self._old_home if os.path.exists(self.rc): os.remove(self.rc) + set_threshold(self.old_threshold) def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: @@ -98,6 +113,20 @@ ('server', 'server-login'), ('username', 'tarek')] self.assertEquals(config, waited) + def test_server_empty_registration(self): + + cmd = self._cmd(self.dist) + rc = cmd._get_rc_file() + self.assert_(not os.path.exists(rc)) + + cmd._store_pypirc('tarek', 'xxx') + + self.assert_(os.path.exists(rc)) + content = open(rc).read() + + self.assertEquals(content, WANTED) + + def test_suite(): return unittest.makeSuite(PyPIRCCommandTestCase) Modified: python/branches/tlee-ast-optimize/Lib/distutils/tests/test_dist.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/tests/test_dist.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/tests/test_dist.py Wed Jan 14 13:24:17 2009 @@ -8,6 +8,7 @@ import StringIO import sys import unittest +import warnings from test.test_support import TESTFN @@ -131,6 +132,29 @@ if os.path.exists(my_file): os.remove(my_file) + def test_empty_options(self): + # an empty options dictionary should not stay in the + # list of attributes + klass = distutils.dist.Distribution + + # catching warnings + warns = [] + def _warn(msg): + warns.append(msg) + + old_warn = warnings.warn + warnings.warn = _warn + try: + dist = klass(attrs={'author': 'xxx', + 'name': 'xxx', + 'version': 'xxx', + 'url': 'xxxx', + 'options': {}}) + finally: + warnings.warn = old_warn + + self.assertEquals(len(warns), 0) + class MetadataTestCase(unittest.TestCase): def test_simple_metadata(self): Modified: python/branches/tlee-ast-optimize/Lib/distutils/tests/test_upload.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/tests/test_upload.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/tests/test_upload.py Wed Jan 14 13:24:17 2009 @@ -9,6 +9,17 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + + class uploadTestCase(PyPIRCCommandTestCase): def test_finalize_options(self): @@ -26,6 +37,24 @@ ('repository', 'http://pypi.python.org/pypi')): self.assertEquals(getattr(cmd, attr), waited) + def test_saved_password(self): + # file with no password + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + # make sure it passes + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, None) + + # make sure we get it as well, if another command + # initialized it at the dist level + dist.password = 'xxx' + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, 'xxx') def test_suite(): return unittest.makeSuite(uploadTestCase) Modified: python/branches/tlee-ast-optimize/Lib/distutils/util.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/util.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/util.py Wed Jan 14 13:24:17 2009 @@ -100,7 +100,11 @@ if not macver: macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET') - if not macver: + if 1: + # Always calculate the release of the running machine, + # needed to determine if we can build fat binaries or not. + + macrelease = macver # Get the system version. Reading this plist is a documented # way to get the system version (see the documentation for # the Gestalt Manager) @@ -116,16 +120,18 @@ r'(.*?)', f.read()) f.close() if m is not None: - macver = '.'.join(m.group(1).split('.')[:2]) + macrelease = '.'.join(m.group(1).split('.')[:2]) # else: fall back to the default behaviour + if not macver: + macver = macrelease + if macver: from distutils.sysconfig import get_config_vars release = macver osname = "macosx" - - if (release + '.') >= '10.4.' and \ + if (macrelease + '.') >= '10.4.' and \ '-arch' in get_config_vars().get('CFLAGS', '').strip(): # The universal build will build fat binaries, but not on # systems before 10.4 @@ -134,9 +140,13 @@ # 'universal' instead of 'fat'. machine = 'fat' + cflags = get_config_vars().get('CFLAGS') - if '-arch x86_64' in get_config_vars().get('CFLAGS'): - machine = 'universal' + if '-arch x86_64' in cflags: + if '-arch i386' in cflags: + machine = 'universal' + else: + machine = 'fat64' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. Modified: python/branches/tlee-ast-optimize/Lib/doctest.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/doctest.py (original) +++ python/branches/tlee-ast-optimize/Lib/doctest.py Wed Jan 14 13:24:17 2009 @@ -820,7 +820,15 @@ # given object's docstring. try: file = inspect.getsourcefile(obj) or inspect.getfile(obj) - source_lines = linecache.getlines(file) + if module is not None: + # Supply the module globals in case the module was + # originally loaded via a PEP 302 loader and + # file is not a valid filesystem path + source_lines = linecache.getlines(file, module.__dict__) + else: + # No access to a loader, so assume it's a normal + # filesystem path + source_lines = linecache.getlines(file) if not source_lines: source_lines = None except TypeError: @@ -1433,8 +1441,10 @@ d = self._name2ft for name, (f, t) in other._name2ft.items(): if name in d: - print "*** DocTestRunner.merge: '" + name + "' in both" \ - " testers; summing outcomes." + # Don't print here by default, since doing + # so breaks some of the buildbots + #print "*** DocTestRunner.merge: '" + name + "' in both" \ + # " testers; summing outcomes." f2, t2 = d[name] f = f + f2 t = t + t2 Modified: python/branches/tlee-ast-optimize/Lib/fractions.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/fractions.py (original) +++ python/branches/tlee-ast-optimize/Lib/fractions.py Wed Jan 14 13:24:17 2009 @@ -111,7 +111,7 @@ """ if isinstance(f, numbers.Integral): - f = float(f) + return cls(f) elif not isinstance(f, float): raise TypeError("%s.from_float() only takes floats, not %r (%s)" % (cls.__name__, f, type(f).__name__)) Modified: python/branches/tlee-ast-optimize/Lib/getopt.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/getopt.py (original) +++ python/branches/tlee-ast-optimize/Lib/getopt.py Wed Jan 14 13:24:17 2009 @@ -130,7 +130,7 @@ if args[0][:2] == '--': opts, args = do_longs(opts, args[0][2:], longopts, args[1:]) - elif args[0][:1] == '-': + elif args[0][:1] == '-' and args[0] != '-': opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:]) else: if all_options_first: Modified: python/branches/tlee-ast-optimize/Lib/gzip.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/gzip.py (original) +++ python/branches/tlee-ast-optimize/Lib/gzip.py Wed Jan 14 13:24:17 2009 @@ -42,7 +42,7 @@ max_read_chunk = 10 * 1024 * 1024 # 10Mb def __init__(self, filename=None, mode=None, - compresslevel=9, fileobj=None): + compresslevel=9, fileobj=None, mtime=None): """Constructor for the GzipFile class. At least one of fileobj and filename must be given a @@ -69,6 +69,15 @@ level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. The default is 9. + The mtime argument is an optional numeric timestamp to be written + to the stream when compressing. All gzip compressed streams + are required to contain a timestamp. If omitted or None, the + current time is used. This module ignores the timestamp when + decompressing; however, some programs, such as gunzip, make use + of it. The format of the timestamp is the same as that of the + return value of time.time() and of the st_mtime member of the + object returned by os.stat(). + """ # guarantee the file is opened in binary mode on platforms @@ -107,6 +116,7 @@ self.fileobj = fileobj self.offset = 0 + self.mtime = mtime if self.mode == WRITE: self._write_gzip_header() @@ -140,7 +150,10 @@ if fname: flags = FNAME self.fileobj.write(chr(flags)) - write32u(self.fileobj, long(time.time())) + mtime = self.mtime + if mtime is None: + mtime = time.time() + write32u(self.fileobj, long(mtime)) self.fileobj.write('\002') self.fileobj.write('\377') if fname: @@ -158,10 +171,10 @@ if method != 8: raise IOError, 'Unknown compression method' flag = ord( self.fileobj.read(1) ) - # modtime = self.fileobj.read(4) + self.mtime = read32(self.fileobj) # extraflag = self.fileobj.read(1) # os = self.fileobj.read(1) - self.fileobj.read(6) + self.fileobj.read(2) if flag & FEXTRA: # Read & discard the extra field, if present @@ -441,6 +454,14 @@ else: raise StopIteration + def __enter__(self): + if self.fileobj is None: + raise ValueError("I/O operation on closed GzipFile object") + return self + + def __exit__(self, *args): + self.close() + def _test(): # Act like gzip; with -d, act like gunzip. Modified: python/branches/tlee-ast-optimize/Lib/heapq.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/heapq.py (original) +++ python/branches/tlee-ast-optimize/Lib/heapq.py Wed Jan 14 13:24:17 2009 @@ -129,7 +129,7 @@ __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge', 'nlargest', 'nsmallest', 'heappushpop'] -from itertools import islice, repeat, count, imap, izip, tee +from itertools import islice, repeat, count, imap, izip, tee, chain from operator import itemgetter, neg import bisect @@ -354,6 +354,32 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + # Short-cut for n==1 is to use min() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [min(chain(head, it))] + return [min(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key)[:n] + + # When key is none, use simpler decoration + if key is None: + it = izip(iterable, count()) # decorate + result = _nsmallest(n, it) + return map(itemgetter(0), result) # undecorate + + # General case, slowest method in1, in2 = tee(iterable) it = izip(imap(key, in1), count(), in2) # decorate result = _nsmallest(n, it) @@ -365,6 +391,33 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + + # Short-cut for n==1 is to use max() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [max(chain(head, it))] + return [max(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key, reverse=True)[:n] + + # When key is none, use simpler decoration + if key is None: + it = izip(iterable, imap(neg, count())) # 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 result = _nlargest(n, it) Modified: python/branches/tlee-ast-optimize/Lib/httplib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/httplib.py (original) +++ python/branches/tlee-ast-optimize/Lib/httplib.py Wed Jan 14 13:24:17 2009 @@ -325,13 +325,18 @@ # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details. - def __init__(self, sock, debuglevel=0, strict=0, method=None): - # The buffer size is specified as zero, because the headers of - # the response are read with readline(). If the reads were - # buffered the readline() calls could consume some of the - # response, which make be read via a recv() on the underlying - # socket. - self.fp = sock.makefile('rb', 0) + def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering=False): + if buffering: + # The caller won't be using any sock.recv() calls, so buffering + # is fine and recommendef for performance + self.fp = sock.makefile('rb') + else: + # The buffer size is specified as zero, because the headers of + # the response are read with readline(). If the reads were + # buffered the readline() calls could consume some of the + # response, which make be read via a recv() on the underlying + # socket. + self.fp = sock.makefile('rb', 0) self.debuglevel = debuglevel self.strict = strict self._method = method @@ -738,6 +743,7 @@ """Send the currently buffered request and clear the buffer. Appends an extra \\r\\n to the buffer. + A message_body may be specified, to be appended to the request. """ self._buffer.extend(("", "")) msg = "\r\n".join(self._buffer) @@ -745,9 +751,14 @@ # If msg and message_body are sent in a single send() call, # it will avoid performance problems caused by the interaction # between delayed ack and the Nagle algorithim. - if message_body is not None: + if isinstance(message_body, str): msg += message_body + message_body = None self.send(msg) + if message_body is not None: + #message_body was not a string (i.e. it is a file) and + #we must run the risk of Nagle + self.send(message_body) def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): """Send a request to the server. @@ -927,14 +938,9 @@ self._set_content_length(body) for hdr, value in headers.iteritems(): self.putheader(hdr, value) - if isinstance(body, str): - self.endheaders(body) - else: - self.endheaders() - if body: # when body is a file rather than a string - self.send(body) + self.endheaders(body) - def getresponse(self): + def getresponse(self, buffering=False): "Get the response from the server." # if a prior response has been completed, then forget about it. @@ -960,13 +966,15 @@ if self.__state != _CS_REQ_SENT or self.__response: raise ResponseNotReady() + args = (self.sock,) + kwds = {"strict":self.strict, "method":self._method} if self.debuglevel > 0: - response = self.response_class(self.sock, self.debuglevel, - strict=self.strict, - method=self._method) - else: - response = self.response_class(self.sock, strict=self.strict, - method=self._method) + args += (self.debuglevel,) + if buffering: + #only add this keyword if non-default, for compatibility with + #other response_classes. + kwds["buffering"] = True; + response = self.response_class(*args, **kwds) response.begin() assert response.will_close != _UNKNOWN @@ -1030,7 +1038,7 @@ "Provide a getfile, since the superclass' does not use this concept." return self.file - def getreply(self): + def getreply(self, buffering=False): """Compat definition since superclass does not define it. Returns a tuple consisting of: @@ -1039,7 +1047,12 @@ - any RFC822 headers in the response from the server """ try: - response = self._conn.getresponse() + if not buffering: + response = self._conn.getresponse() + else: + #only add this keyword if non-default for compatibility + #with other connection classes + response = self._conn.getresponse(buffering) except BadStatusLine, e: ### hmm. if getresponse() ever closes the socket on a bad request, ### then we are going to have problems with self.sock Modified: python/branches/tlee-ast-optimize/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/tlee-ast-optimize/Lib/idlelib/NEWS.txt (original) +++ python/branches/tlee-ast-optimize/Lib/idlelib/NEWS.txt Wed Jan 14 13:24:17 2009 @@ -3,6 +3,8 @@ *Release date: XX-XXX-2008* +- Issue #3549: On MacOS the preferences menu was not present + - Issue #2665: On Windows, an IDLE installation upgraded from an old version would not start if a custom theme was defined. Modified: python/branches/tlee-ast-optimize/Lib/idlelib/help.txt ============================================================================== --- python/branches/tlee-ast-optimize/Lib/idlelib/help.txt (original) +++ python/branches/tlee-ast-optimize/Lib/idlelib/help.txt Wed Jan 14 13:24:17 2009 @@ -90,7 +90,10 @@ Configure IDLE -- Open a configuration dialog. Fonts, indentation, keybindings, and color themes may be altered. Startup Preferences may be set, and Additional Help - Souces can be specified. + Sources can be specified. + + On MacOS X this menu is not present, use + menu 'IDLE -> Preferences...' instead. --- Code Context -- Open a pane at the top of the edit window which shows the block context of the section of code Modified: python/branches/tlee-ast-optimize/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/idlelib/macosxSupport.py (original) +++ python/branches/tlee-ast-optimize/Lib/idlelib/macosxSupport.py Wed Jan 14 13:24:17 2009 @@ -89,7 +89,9 @@ ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding tkversion = root.tk.eval('info patchlevel') - if tkversion >= '8.4.14': + # Note: we cannot check if the string tkversion >= '8.4.14', because + # the string '8.4.7' is greater than the string '8.4.14'. + if map(int, tkversion.split('.')) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, Modified: python/branches/tlee-ast-optimize/Lib/inspect.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/inspect.py (original) +++ python/branches/tlee-ast-optimize/Lib/inspect.py Wed Jan 14 13:24:17 2009 @@ -158,9 +158,8 @@ Generator function objects provides same attributes as functions. See isfunction.__doc__ for attributes listing.""" - if (isfunction(object) or ismethod(object)) and \ - object.func_code.co_flags & CO_GENERATOR: - return True + return bool((isfunction(object) or ismethod(object)) and + object.func_code.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. @@ -254,7 +253,10 @@ Optionally, only return members that satisfy a given predicate.""" results = [] for key in dir(object): - value = getattr(object, key) + try: + value = getattr(object, key) + except AttributeError: + continue if not predicate or predicate(value): results.append((key, value)) results.sort() Modified: python/branches/tlee-ast-optimize/Lib/io.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/io.py (original) +++ python/branches/tlee-ast-optimize/Lib/io.py Wed Jan 14 13:24:17 2009 @@ -1167,7 +1167,7 @@ @property def closed(self): - return self.writer.closed() + return self.writer.closed class BufferedRandom(BufferedWriter, BufferedReader): @@ -1292,25 +1292,23 @@ """ def __init__(self, decoder, translate, errors='strict'): codecs.IncrementalDecoder.__init__(self, errors=errors) - self.buffer = b'' 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) - if self.buffer: - input = self.buffer + input - 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.buffer = b'\r' - else: - self.buffer = b'' + self.pendingcr = True # Record which newlines are read crlf = output.count('\r\n') @@ -1329,20 +1327,19 @@ def getstate(self): buf, flag = self.decoder.getstate() - return buf + self.buffer, flag + flag <<= 1 + if self.pendingcr: + flag |= 1 + return buf, flag def setstate(self, state): buf, flag = state - if buf.endswith(b'\r'): - self.buffer = b'\r' - buf = buf[:-1] - else: - self.buffer = b'' - self.decoder.setstate((buf, flag)) + self.pendingcr = bool(flag & 1) + self.decoder.setstate((buf, flag >> 1)) def reset(self): self.seennl = 0 - self.buffer = b'' + self.pendingcr = False self.decoder.reset() _LF = 1 Modified: python/branches/tlee-ast-optimize/Lib/lib-tk/ScrolledText.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib-tk/ScrolledText.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib-tk/ScrolledText.py Wed Jan 14 13:24:17 2009 @@ -1,43 +1,52 @@ -# A ScrolledText widget feels like a text widget but also has a -# vertical scroll bar on its right. (Later, options may be added to -# add a horizontal bar as well, to make the bars disappear -# automatically when not needed, to move them to the other side of the -# window, etc.) -# -# Configuration options are passed to the Text widget. -# A Frame widget is inserted between the master and the text, to hold -# the Scrollbar widget. -# Most methods calls are inherited from the Text widget; Pack methods -# are redirected to the Frame widget however. +"""A ScrolledText widget feels like a text widget but also has a +vertical scroll bar on its right. (Later, options may be added to +add a horizontal bar as well, to make the bars disappear +automatically when not needed, to move them to the other side of the +window, etc.) -from Tkinter import * -from Tkinter import _cnfmerge +Configuration options are passed to the Text widget. +A Frame widget is inserted between the master and the text, to hold +the Scrollbar widget. +Most methods calls are inherited from the Text widget; Pack, Grid and +Place methods are redirected to the Frame widget however. +""" + +__all__ = ['ScrolledText'] + +from Tkinter import Frame, Text, Scrollbar, Pack, Grid, Place +from Tkconstants import RIGHT, LEFT, Y, BOTH class ScrolledText(Text): - def __init__(self, master=None, cnf=None, **kw): - if cnf is None: - cnf = {} - if kw: - cnf = _cnfmerge((cnf, kw)) - fcnf = {} - for k in cnf.keys(): - if type(k) == ClassType or k == 'name': - fcnf[k] = cnf[k] - del cnf[k] - self.frame = Frame(master, **fcnf) - self.vbar = Scrollbar(self.frame, name='vbar') + def __init__(self, master=None, **kw): + self.frame = Frame(master) + self.vbar = Scrollbar(self.frame) self.vbar.pack(side=RIGHT, fill=Y) - cnf['name'] = 'text' - Text.__init__(self, self.frame, **cnf) - self.pack(side=LEFT, fill=BOTH, expand=1) - self['yscrollcommand'] = self.vbar.set + + kw.update({'yscrollcommand': self.vbar.set}) + Text.__init__(self, self.frame, **kw) + self.pack(side=LEFT, fill=BOTH, expand=True) self.vbar['command'] = self.yview # Copy geometry methods of self.frame -- hack! - methods = Pack.__dict__.keys() - methods = methods + Grid.__dict__.keys() - methods = methods + Place.__dict__.keys() + methods = vars(Pack).keys() + vars(Grid).keys() + vars(Place).keys() for m in methods: if m[0] != '_' and m != 'config' and m != 'configure': setattr(self, m, getattr(self.frame, m)) + + def __str__(self): + return str(self.frame) + + +def example(): + import __main__ + from Tkconstants import END + + stext = ScrolledText(bg='white', height=10) + stext.insert(END, __main__.__doc__) + stext.pack(fill=BOTH, side=LEFT, expand=True) + stext.focus_set() + stext.mainloop() + +if __name__ == "__main__": + example() Modified: python/branches/tlee-ast-optimize/Lib/lib-tk/tkColorChooser.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib-tk/tkColorChooser.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib-tk/tkColorChooser.py Wed Jan 14 13:24:17 2009 @@ -34,19 +34,22 @@ try: # make sure initialcolor is a tk color string color = self.options["initialcolor"] - if type(color) == type(()): + if isinstance(color, tuple): # assume an RGB triplet self.options["initialcolor"] = "#%02x%02x%02x" % color except KeyError: pass def _fixresult(self, widget, result): + # result can be somethings: an empty tuple, an empty string or + # a Tcl_Obj, so this somewhat weird check handles that + if not result or not str(result): + return None, None # canceled + # to simplify application code, the color chooser returns # an RGB tuple together with the Tk color string - if not result: - return None, None # canceled r, g, b = widget.winfo_rgb(result) - return (r/256, g/256, b/256), result + return (r/256, g/256, b/256), str(result) # @@ -66,5 +69,4 @@ # test stuff if __name__ == "__main__": - print "color", askcolor() Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_base.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_base.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_base.py Wed Jan 14 13:24:17 2009 @@ -94,10 +94,6 @@ """ raise NotImplementedError() - def parenthesize(self, node): - """Wrapper around pygram.parenthesize().""" - return pygram.parenthesize(node) - def new_name(self, template="xxx_todo_changeme"): """Return a string suitable for use as an identifier Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_util.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_util.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixer_util.py Wed Jan 14 13:24:17 2009 @@ -158,6 +158,9 @@ ### Misc ########################################################### +def parenthesize(node): + return Node(syms.atom, [LParen(), node, RParen()]) + consuming_calls = set(["sorted", "list", "set", "any", "all", "tuple", "sum", "min", "max"]) @@ -219,6 +222,29 @@ return True return False +def is_probably_builtin(node): + """ + Check that something isn't an attribute or function name etc. + """ + prev = node.get_prev_sibling() + if prev is not None and prev.type == token.DOT: + # Attribute lookup. + return False + parent = node.parent + if parent.type in (syms.funcdef, syms.classdef): + return False + if parent.type == syms.expr_stmt and parent.children[0] is node: + # Assignment. + return False + if parent.type == syms.parameters or \ + (parent.type == syms.typedargslist and ( + (prev is not None and prev.type == token.COMMA) or + parent.children[0] is node + )): + # The name of an argument. + return False + return True + ########################################################### ### The following functions are to find bindings in a suite ########################################################### @@ -232,20 +258,77 @@ suite.parent = parent return suite -def does_tree_import(package, name, node): - """ Returns true if name is imported from package at the - top level of the tree which node belongs to. - To cover the case of an import like 'import foo', use - Null for the package and 'foo' for the name. """ +def find_root(node): + """Find the top level namespace.""" # Scamper up to the top level namespace while node.type != syms.file_input: assert node.parent, "Tree is insane! root found before "\ "file_input node was found." node = node.parent + return node - binding = find_binding(name, node, package) +def does_tree_import(package, name, node): + """ Returns true if name is imported from package at the + top level of the tree which node belongs to. + To cover the case of an import like 'import foo', use + None for the package and 'foo' for the name. """ + binding = find_binding(name, find_root(node), package) return bool(binding) +def is_import(node): + """Returns true if the node is an import statement.""" + return node.type in (syms.import_name, syms.import_from) + +def touch_import(package, name, node): + """ Works like `does_tree_import` but adds an import statement + if it was not imported. """ + def is_import_stmt(node): + return node.type == syms.simple_stmt and node.children and \ + is_import(node.children[0]) + + root = find_root(node) + + if does_tree_import(package, name, root): + return + + add_newline_before = False + + # figure out where to insert the new import. First try to find + # the first import and then skip to the last one. + insert_pos = offset = 0 + for idx, node in enumerate(root.children): + if not is_import_stmt(node): + continue + for offset, node2 in enumerate(root.children[idx:]): + if not is_import_stmt(node2): + break + insert_pos = idx + offset + break + + # if there are no imports where we can insert, find the docstring. + # if that also fails, we stick to the beginning of the file + if insert_pos == 0: + for idx, node in enumerate(root.children): + if node.type == syms.simple_stmt and node.children and \ + node.children[0].type == token.STRING: + insert_pos = idx + 1 + add_newline_before + break + + if package is None: + import_ = Node(syms.import_name, [ + Leaf(token.NAME, 'import'), + Leaf(token.NAME, name, prefix=' ') + ]) + else: + import_ = FromImport(package, [Leaf(token.NAME, name, prefix=' ')]) + + children = [import_, Newline()] + if add_newline_before: + children.insert(0, Newline()) + root.insert_child(insert_pos, Node(syms.simple_stmt, children)) + + _def_syms = set([syms.classdef, syms.funcdef]) def find_binding(name, node, package=None): """ Returns the node which binds variable name, otherwise None. @@ -285,7 +368,7 @@ if ret: if not package: return ret - if ret.type in (syms.import_name, syms.import_from): + if is_import(ret): return ret return None Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_apply.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_apply.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_apply.py Wed Jan 14 13:24:17 2009 @@ -9,7 +9,7 @@ from .. import pytree from ..pgen2 import token from .. import fixer_base -from ..fixer_util import Call, Comma +from ..fixer_util import Call, Comma, parenthesize class FixApply(fixer_base.BaseFix): @@ -39,7 +39,7 @@ (func.type != syms.power or func.children[-2].type == token.DOUBLESTAR)): # Need to parenthesize - func = self.parenthesize(func) + func = parenthesize(func) func.set_prefix("") args = args.clone() args.set_prefix("") Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_execfile.py Wed Jan 14 13:24:17 2009 @@ -7,9 +7,9 @@ exec() function. """ -from .. import pytree from .. import fixer_base -from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) class FixExecfile(fixer_base.BaseFix): @@ -22,16 +22,30 @@ def transform(self, node, results): assert results - syms = self.syms filename = results["filename"] globals = results.get("globals") locals = results.get("locals") - args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(), - Name('read'), LParen(), RParen()] - args[0].set_prefix("") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.set_prefix(" ") + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_has_key.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_has_key.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_has_key.py Wed Jan 14 13:24:17 2009 @@ -33,7 +33,7 @@ from .. import pytree from ..pgen2 import token from .. import fixer_base -from ..fixer_util import Name +from ..fixer_util import Name, parenthesize class FixHasKey(fixer_base.BaseFix): @@ -86,7 +86,7 @@ after = [n.clone() for n in after] if arg.type in (syms.comparison, syms.not_test, syms.and_test, syms.or_test, syms.test, syms.lambdef, syms.argument): - arg = self.parenthesize(arg) + arg = parenthesize(arg) if len(before) == 1: before = before[0] else: @@ -98,12 +98,12 @@ n_op = pytree.Node(syms.comp_op, (n_not, n_op)) new = pytree.Node(syms.comparison, (arg, n_op, before)) if after: - new = self.parenthesize(new) + new = parenthesize(new) new = pytree.Node(syms.power, (new,) + tuple(after)) if node.parent.type in (syms.comparison, syms.expr, syms.xor_expr, syms.and_expr, syms.shift_expr, syms.arith_expr, syms.term, syms.factor, syms.power): - new = self.parenthesize(new) + new = parenthesize(new) new.set_prefix(prefix) return new Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py Wed Jan 14 13:24:17 2009 @@ -13,55 +13,78 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport, syms +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unkown node type") + class FixImport(fixer_base.BaseFix): PATTERN = """ - import_from< type='from' imp=any 'import' ['('] any [')'] > + import_from< 'from' imp=any 'import' ['('] any [')'] > | - import_name< type='import' imp=any > + import_name< 'import' imp=any > """ def transform(self, node, results): imp = results['imp'] - mod_name = unicode(imp.children[0] if imp.type == syms.dotted_as_name \ - else imp) - - if mod_name.startswith('.'): - # Already a new-style import - return - - if not probably_a_local_import(mod_name, self.filename): - # I guess this is a global import -- skip it! - return - - if results['type'].value == 'from': + if node.type == syms.import_from: # Some imps are top-level (eg: 'import ham') # some are first level (eg: 'import ham.eggs') # some are third level (eg: 'import ham.eggs as spam') # Hence, the loop while not hasattr(imp, 'value'): imp = imp.children[0] - imp.value = "." + imp.value - node.changed() + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + return node else: - new = FromImport('.', getattr(imp, 'content', None) or [imp]) + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport('.', [imp]) new.set_prefix(node.get_prefix()) - node = new - return node + return new -def probably_a_local_import(imp_name, file_path): - # Must be stripped because the right space is included by the parser - imp_name = imp_name.split('.', 1)[0].strip() - base_path = dirname(file_path) - base_path = join(base_path, imp_name) - # If there is no __init__.py next to the file its not in a package - # so can't be a relative import. - if not exists(join(dirname(base_path), '__init__.py')): + def probably_a_local_import(self, imp_name): + imp_name = imp_name.split('.', 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False + for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: + if exists(base_path + ext): + return True return False - for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: - if exists(base_path + ext): - return True - return False Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports.py Wed Jan 14 13:24:17 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', @@ -42,6 +41,8 @@ 'DocXMLRPCServer': 'xmlrpc.server', 'SimpleXMLRPCServer': 'xmlrpc.server', 'httplib': 'http.client', + 'htmlentitydefs' : 'html.entities', + 'HTMLParser' : 'html.parser', 'Cookie': 'http.cookies', 'cookielib': 'http.cookiejar', 'BaseHTTPServer': 'http.server', @@ -64,16 +65,17 @@ mod_list = ' | '.join(["module_name='%s'" % key for key in mapping]) bare_names = alternates(mapping.keys()) - yield """name_import=import_name< 'import' ((%s) - | dotted_as_names< any* (%s) any* >) > + yield """name_import=import_name< 'import' ((%s) | + multiple_imports=dotted_as_names< any* (%s) any* >) > """ % (mod_list, mod_list) yield """import_from< 'from' (%s) 'import' ['('] ( any | import_as_name< any 'as' any > | import_as_names< any* >) [')'] > """ % mod_list - yield """import_name< 'import' - dotted_as_name< (%s) 'as' any > > - """ % mod_list + yield """import_name< 'import' (dotted_as_name< (%s) 'as' any > | + multiple_imports=dotted_as_names< + any* dotted_as_name< (%s) 'as' any > any* >) > + """ % (mod_list, mod_list) # Find usages of module members in code e.g. thread.foo(bar) yield "power< bare_with_attr=(%s) trailer<'.' any > any* >" % bare_names @@ -86,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) @@ -100,8 +106,8 @@ match = super(FixImports, self).match results = match(node) if results: - # Module usage could be in the trailier of an attribute lookup, so - # we might have nested matches when "bare_with_attr" is present. + # Module usage could be in the trailer of an attribute lookup, so we + # might have nested matches when "bare_with_attr" is present. if "bare_with_attr" not in results and \ any([match(obj) for obj in attr_chain(node, "parent")]): return False @@ -115,12 +121,20 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[(import_mod or mod_name).value] + new_name = self.mapping[import_mod.value] + import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, # marked its usage to be replaced. self.replace[import_mod.value] = new_name - import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) + if "multiple_imports" in results: + # This is a nasty hack to fix multiple imports on a + # line (e.g., "import StringIO, urlparse"). The problem is that I + # can't figure out an easy way to make a pattern recognize the + # keys of MAPPING randomly sprinkled in an import statement. + results = self.match(node) + if results: + self.transform(node, results) else: # Replace usage of the module. bare_name = results["bare_with_attr"][0] Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports2.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports2.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_imports2.py Wed Jan 14 13:24:17 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - order = "post" + run_order = 7 mapping = MAPPING Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_intern.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_intern.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_intern.py Wed Jan 14 13:24:17 2009 @@ -8,7 +8,7 @@ # Local imports from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Attr +from ..fixer_util import Name, Attr, touch_import class FixIntern(fixer_base.BaseFix): @@ -40,4 +40,5 @@ newarglist, results["rpar"].clone()])] + after) new.set_prefix(node.get_prefix()) + touch_import(None, 'sys', node) return new Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_long.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_long.py Wed Jan 14 13:24:17 2009 @@ -2,34 +2,21 @@ # Licensed to PSF under a Contributor Agreement. """Fixer that turns 'long' into 'int' everywhere. - -This also strips the trailing 'L' or 'l' from long loterals. """ # Local imports -from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Number +from ..fixer_util import Name, Number, is_probably_builtin class FixLong(fixer_base.BaseFix): - PATTERN = """ - (long_type = 'long' | number = NUMBER) - """ + PATTERN = "'long'" - static_long = Name("long") static_int = Name("int") def transform(self, node, results): - long_type = results.get("long_type") - number = results.get("number") - new = None - if long_type: - assert node == self.static_long, node + if is_probably_builtin(node): new = self.static_int.clone() - if number and node.value[-1] in ("l", "L"): - new = Number(node.value[:-1]) - if new is not None: new.set_prefix(node.get_prefix()) return new Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_repr.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_repr.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_repr.py Wed Jan 14 13:24:17 2009 @@ -5,7 +5,7 @@ # Local imports from .. import fixer_base -from ..fixer_util import Call, Name +from ..fixer_util import Call, Name, parenthesize class FixRepr(fixer_base.BaseFix): @@ -18,5 +18,5 @@ expr = results["expr"].clone() if expr.type == self.syms.testlist1: - expr = self.parenthesize(expr) + expr = parenthesize(expr) return Call(Name("repr"), [expr], prefix=node.get_prefix()) Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_urllib.py Wed Jan 14 13:24:17 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -29,17 +32,17 @@ 'AbstractBasicAuthHandler', 'HTTPBasicAuthHandler', 'ProxyBasicAuthHandler', 'AbstractDigestAuthHandler', - 'HTTPDigestAuthHander', 'ProxyDigestAuthHandler', + 'HTTPDigestAuthHandler', 'ProxyDigestAuthHandler', 'HTTPHandler', 'HTTPSHandler', 'FileHandler', 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } - -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) def build_pattern(): Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_xrange.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_xrange.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_xrange.py Wed Jan 14 13:24:17 2009 @@ -12,7 +12,9 @@ class FixXrange(fixer_base.BaseFix): PATTERN = """ - power< (name='range'|name='xrange') trailer< '(' [any] ')' > any* > + power< + (name='range'|name='xrange') trailer< '(' args=any ')' > + rest=any* > """ def transform(self, node, results): @@ -30,11 +32,14 @@ def transform_range(self, node, results): if not self.in_special_context(node): - arg = node.clone() - arg.set_prefix("") - call = Call(Name("list"), [arg]) - call.set_prefix(node.get_prefix()) - return call + range_call = Call(Name("range"), [results["args"].clone()]) + # Encase the range call in list(). + list_call = Call(Name("list"), [range_call], + prefix=node.get_prefix()) + # Put things that were after the range() call after the list call. + for n in results["rest"]: + list_call.append_child(n) + return list_call return node P1 = "power< func=NAME trailer< '(' node=any ')' > any* >" Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/main.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/main.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/main.py Wed Jan 14 13:24:17 2009 @@ -5,6 +5,7 @@ import sys import os import logging +import shutil import optparse from . import refactor @@ -39,6 +40,8 @@ # Actually write the new file super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) + if not self.nobackups: + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: @@ -56,7 +59,7 @@ Returns a suggested exit status (0, 1, 2). """ # Set up option parser - parser = optparse.OptionParser(usage="refactor.py [options] file|dir ...") + parser = optparse.OptionParser(usage="2to3 [options] file|dir ...") parser.add_option("-d", "--doctests_only", action="store_true", help="Fix up doctests only") parser.add_option("-f", "--fix", action="append", default=[], Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/pgen2/driver.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/pgen2/driver.py Wed Jan 14 13:24:17 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/pygram.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/pygram.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/pygram.py Wed Jan 14 13:24:17 2009 @@ -29,10 +29,3 @@ python_grammar = driver.load_grammar(_GRAMMAR_FILE) python_symbols = Symbols(python_grammar) - - -def parenthesize(node): - return pytree.Node(python_symbols.atom, - (pytree.Leaf(token.LPAR, "("), - node, - pytree.Leaf(token.RPAR, ")"))) Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py Wed Jan 14 13:24:17 2009 @@ -279,18 +279,21 @@ 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.""" 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.""" child.parent = self self.children.append(child) + self.changed() class Leaf(Base): Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py Wed Jan 14 13:24:17 2009 @@ -123,8 +123,8 @@ logger=self.logger) self.pre_order, self.post_order = self.get_fixers() - self.pre_order_mapping = get_headnode_dict(self.pre_order) - self.post_order_mapping = get_headnode_dict(self.post_order) + self.pre_order_heads = get_headnode_dict(self.pre_order) + self.post_order_heads = get_headnode_dict(self.post_order) self.files = [] # List of files that were or should be modified @@ -287,17 +287,13 @@ Returns: True if the tree was modified, False otherwise. """ - # Two calls to chain are required because pre_order.values() - # will be a list of lists of fixers: - # [[, ], []] - all_fixers = chain(self.pre_order, self.post_order) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.start_tree(tree, name) - self.traverse_by(self.pre_order_mapping, tree.pre_order()) - self.traverse_by(self.post_order_mapping, tree.post_order()) + self.traverse_by(self.pre_order_heads, tree.pre_order()) + self.traverse_by(self.post_order_heads, tree.post_order()) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.finish_tree(tree, name) return tree.was_changed Deleted: python/branches/tlee-ast-optimize/Lib/lib2to3/tests/benchmark.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/tests/benchmark.py Wed Jan 14 13:24:17 2009 +++ (empty file) @@ -1,58 +0,0 @@ -#!/usr/bin/env python2.5 -""" -This is a benchmarking script to test the speed of 2to3's pattern matching -system. It's equivalent to "refactor.py -f all" for every Python module -in sys.modules, but without engaging the actual transformations. -""" - -__author__ = "Collin Winter " - -# Python imports -import os.path -import sys -from time import time - -# Test imports -from .support import adjust_path -adjust_path() - -# Local imports -from .. import refactor - -### Mock code for refactor.py and the fixers -############################################################################### -class Options: - def __init__(self, **kwargs): - for k, v in kwargs.items(): - setattr(self, k, v) - - self.verbose = False - -def dummy_transform(*args, **kwargs): - pass - -### Collect list of modules to match against -############################################################################### -files = [] -for mod in sys.modules.values(): - if mod is None or not hasattr(mod, '__file__'): - continue - f = mod.__file__ - if f.endswith('.pyc'): - f = f[:-1] - if f.endswith('.py'): - files.append(f) - -### Set up refactor and run the benchmark -############################################################################### -options = Options(fix=["all"], print_function=False, doctests_only=False) -refactor = refactor.RefactoringTool(options) -for fixer in refactor.fixers: - # We don't want them to actually fix the tree, just match against it. - fixer.transform = dummy_transform - -t = time() -for f in files: - print "Matching", f - refactor.refactor_file(f) -print "%d seconds to match %d files" % (time() - t, len(sys.modules)) Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/py3_test_grammar.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/py3_test_grammar.py Wed Jan 14 13:24:17 2009 @@ -485,6 +485,14 @@ global a, b global one, two, three, four, five, six, seven, eight, nine, ten + def testNonlocal(self): + # 'nonlocal' NAME (',' NAME)* + x = 0 + y = 0 + def f(): + nonlocal x + nonlocal x, y + def testAssert(self): # assert_stmt: 'assert' test [',' test] assert 1 Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py Wed Jan 14 13:24:17 2009 @@ -293,30 +293,30 @@ def test_prefix_preservation(self): b = """x = intern( a )""" - a = """x = sys.intern( a )""" + a = """import sys\nx = sys.intern( a )""" self.check(b, a) b = """y = intern("b" # test )""" - a = """y = sys.intern("b" # test + a = """import sys\ny = sys.intern("b" # test )""" self.check(b, a) b = """z = intern(a+b+c.d, )""" - a = """z = sys.intern(a+b+c.d, )""" + a = """import sys\nz = sys.intern(a+b+c.d, )""" self.check(b, a) def test(self): b = """x = intern(a)""" - a = """x = sys.intern(a)""" + a = """import sys\nx = sys.intern(a)""" self.check(b, a) b = """z = intern(a+b+c.d,)""" - a = """z = sys.intern(a+b+c.d,)""" + a = """import sys\nz = sys.intern(a+b+c.d,)""" self.check(b, a) b = """intern("y%s" % 5).replace("y", "")""" - a = """sys.intern("y%s" % 5).replace("y", "")""" + a = """import sys\nsys.intern("y%s" % 5).replace("y", "")""" self.check(b, a) # These should not be refactored @@ -337,6 +337,35 @@ s = """intern()""" self.unchanged(s) +class Test_reduce(FixerTestCase): + fixer = "reduce" + + def test_simple_call(self): + b = "reduce(a, b, c)" + a = "from functools import reduce\nreduce(a, b, c)" + self.check(b, a) + + def test_call_with_lambda(self): + b = "reduce(lambda x, y: x + y, seq)" + a = "from functools import reduce\nreduce(lambda x, y: x + y, seq)" + self.check(b, a) + + def test_unchanged(self): + s = "reduce(a)" + self.unchanged(s) + + s = "reduce(a, b=42)" + self.unchanged(s) + + s = "reduce(a, b, c, d)" + self.unchanged(s) + + s = "reduce(**c)" + self.unchanged(s) + + s = "reduce()" + self.unchanged(s) + class Test_print(FixerTestCase): fixer = "print" @@ -1044,26 +1073,26 @@ a = """z = type(x) in (int, int)""" self.check(b, a) - def test_4(self): - b = """a = 12L""" - a = """a = 12""" - self.check(b, a) + def test_unchanged(self): + s = """long = True""" + self.unchanged(s) - def test_5(self): - b = """b = 0x12l""" - a = """b = 0x12""" - self.check(b, a) + s = """s.long = True""" + self.unchanged(s) - def test_unchanged_1(self): - s = """a = 12""" + s = """def long(): pass""" self.unchanged(s) - def test_unchanged_2(self): - s = """b = 0x12""" + s = """class long(): pass""" self.unchanged(s) - def test_unchanged_3(self): - s = """c = 3.14""" + s = """def f(long): pass""" + self.unchanged(s) + + s = """def f(g, long): pass""" + self.unchanged(s) + + s = """def f(x, long=True): pass""" self.unchanged(s) def test_prefix_preservation(self): @@ -1071,6 +1100,73 @@ a = """x = int( x )""" self.check(b, a) + +class Test_execfile(FixerTestCase): + fixer = "execfile" + + def test_conversion(self): + b = """execfile("fn")""" + a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + self.check(b, a) + + b = """execfile("fn", glob, loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + self.check(b, a) + + b = """execfile("fn", locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob, locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + self.check(b, a) + + def test_spacing(self): + b = """execfile( "fn" )""" + a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", globals = glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + self.check(b, a) + + +class Test_isinstance(FixerTestCase): + fixer = "isinstance" + + def test_remove_multiple_items(self): + b = """isinstance(x, (int, int, int))""" + a = """isinstance(x, int)""" + self.check(b, a) + + b = """isinstance(x, (int, float, int, int, float))""" + a = """isinstance(x, (int, float))""" + self.check(b, a) + + b = """isinstance(x, (int, float, int, int, float, str))""" + a = """isinstance(x, (int, float, str))""" + self.check(b, a) + + b = """isinstance(foo() + bar(), (x(), y(), x(), int, int))""" + a = """isinstance(foo() + bar(), (x(), y(), x(), int))""" + self.check(b, a) + + def test_prefix_preservation(self): + b = """if isinstance( foo(), ( bar, bar, baz )) : pass""" + a = """if isinstance( foo(), ( bar, baz )) : pass""" + self.check(b, a) + + def test_unchanged(self): + self.unchanged("isinstance(x, (str, int))") + class Test_dict(FixerTestCase): fixer = "dict" @@ -1287,6 +1383,14 @@ a = """x = list(range(10, 3, 9)) + [4]""" self.check(b, a) + b = """x = range(10)[::-1]""" + a = """x = list(range(10))[::-1]""" + self.check(b, a) + + b = """x = range(10) [3]""" + a = """x = list(range(10)) [3]""" + self.check(b, a) + def test_xrange_in_for(self): b = """for i in xrange(10):\n j=i""" a = """for i in range(10):\n j=i""" @@ -1422,9 +1526,8 @@ s = "foo(xreadlines)" self.unchanged(s) -class Test_imports(FixerTestCase): - fixer = "imports" - from ..fixes.fix_imports import MAPPING as modules + +class ImportsFixerTests: def test_import_module(self): for old, new in self.modules.items(): @@ -1522,18 +1625,36 @@ self.check(b, a) +class Test_imports(FixerTestCase, ImportsFixerTests): + fixer = "imports" + from ..fixes.fix_imports import MAPPING as modules + + def test_multiple_imports(self): + b = """import urlparse, cStringIO""" + a = """import urllib.parse, io""" + self.check(b, a) + + def test_multiple_imports_as(self): + b = """ + import copy_reg as bar, HTMLParser as foo, urlparse + s = urlparse.spam(bar.foo()) + """ + a = """ + import copyreg as bar, html.parser as foo, urllib.parse + s = urllib.parse.spam(bar.foo()) + """ + self.check(b, a) -class Test_imports2(Test_imports): + +class Test_imports2(FixerTestCase, ImportsFixerTests): fixer = "imports2" from ..fixes.fix_imports2 import MAPPING as modules -class Test_imports_fixer_order(Test_imports): - - fixer = None +class Test_imports_fixer_order(FixerTestCase, ImportsFixerTests): def setUp(self): - Test_imports.setUp(self, ['imports', 'imports2']) + super(Test_imports_fixer_order, self).setUp(['imports', 'imports2']) from ..fixes.fix_imports2 import MAPPING as mapping2 self.modules = mapping2.copy() from ..fixes.fix_imports import MAPPING as mapping1 @@ -3406,11 +3527,30 @@ a = "from . import foo, bar" self.check_both(b, a) + b = "import foo, bar, x" + a = "from . import foo, bar, x" + self.check_both(b, a) + + b = "import x, y, z" + a = "from . import x, y, z" + self.check_both(b, a) + def test_import_as(self): b = "import foo as x" a = "from . import foo as x" self.check_both(b, a) + b = "import a as b, b as c, c as d" + a = "from . import a as b, b as c, c as d" + self.check_both(b, a) + + def test_local_and_absolute(self): + self.always_exists = False + self.present_files = set(["foo.py", "__init__.py"]) + + s = "import foo, bar" + self.warns_unchanged(s, "absolute and local imports together") + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_util.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_util.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_util.py Wed Jan 14 13:24:17 2009 @@ -526,6 +526,33 @@ b = 7""" self.failIf(self.find_binding("a", s)) +class Test_touch_import(support.TestCase): + + def test_after_docstring(self): + node = parse('"""foo"""\nbar()') + fixer_util.touch_import(None, "foo", node) + self.assertEqual(str(node), '"""foo"""\nimport foo\nbar()\n\n') + + def test_after_imports(self): + node = parse('"""foo"""\nimport bar\nbar()') + fixer_util.touch_import(None, "foo", node) + self.assertEqual(str(node), '"""foo"""\nimport bar\nimport foo\nbar()\n\n') + + def test_beginning(self): + node = parse('bar()') + fixer_util.touch_import(None, "foo", node) + self.assertEqual(str(node), 'import foo\nbar()\n\n') + + def test_from_import(self): + node = parse('bar()') + fixer_util.touch_import("cgi", "escape", node) + self.assertEqual(str(node), 'from cgi import escape\nbar()\n\n') + + def test_name_import(self): + node = parse('bar()') + fixer_util.touch_import(None, "cgi", node) + self.assertEqual(str(node), 'import cgi\nbar()\n\n') + if __name__ == "__main__": import __main__ Modified: python/branches/tlee-ast-optimize/Lib/linecache.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/linecache.py (original) +++ python/branches/tlee-ast-optimize/Lib/linecache.py Wed Jan 14 13:24:17 2009 @@ -88,21 +88,20 @@ get_source = getattr(loader, 'get_source', None) if name and get_source: - if basename.startswith(name.split('.')[-1]+'.'): - try: - data = get_source(name) - except (ImportError, IOError): - pass - else: - if data is None: - # No luck, the PEP302 loader cannot find the source - # for this module. - return [] - cache[filename] = ( - len(data), None, - [line+'\n' for line in data.splitlines()], fullname - ) - return cache[filename][2] + try: + data = get_source(name) + except (ImportError, IOError): + pass + else: + if data is None: + # No luck, the PEP302 loader cannot find the source + # for this module. + return [] + cache[filename] = ( + len(data), None, + [line+'\n' for line in data.splitlines()], fullname + ) + return cache[filename][2] # Try looking through the module search path. Modified: python/branches/tlee-ast-optimize/Lib/logging/__init__.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/logging/__init__.py (original) +++ python/branches/tlee-ast-optimize/Lib/logging/__init__.py Wed Jan 14 13:24:17 2009 @@ -31,7 +31,7 @@ 'INFO', 'LogRecord', 'Logger', 'Manager', 'NOTSET', 'PlaceHolder', 'RootLogger', 'StreamHandler', 'WARN', 'WARNING'] -import sys, os, types, time, string, cStringIO, traceback +import sys, os, types, time, string, cStringIO, traceback, warnings try: import codecs @@ -46,8 +46,8 @@ __author__ = "Vinay Sajip " __status__ = "production" -__version__ = "0.5.0.5" -__date__ = "24 January 2008" +__version__ = "0.5.0.6" +__date__ = "03 December 2008" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -846,7 +846,7 @@ Add the specified logger as a child of this placeholder. """ #if alogger not in self.loggers: - if not self.loggerMap.has_key(alogger): + if alogger not in self.loggerMap: #self.loggers.append(alogger) self.loggerMap[alogger] = None @@ -1488,3 +1488,56 @@ old_exit(status) sys.exit = exithook + +# Null handler + +class NullHandler(Handler): + """ + This handler does nothing. It's intended to be used to avoid the + "No handlers could be found for logger XXX" one-off warning. This is + important for library code, which may contain code to log events. If a user + of the library does not configure logging, the one-off warning might be + produced; to avoid this, the library developer simply needs to instantiate + a NullHandler and add it to the top-level logger of the library module or + package. + """ + def emit(self, record): + pass + +# Warnings integration + +_warnings_showwarning = None + +def _showwarning(message, category, filename, lineno, file=None, line=None): + """ + Implementation of showwarnings which redirects to logging, which will first + check to see if the file parameter is None. If a file is specified, it will + delegate to the original warnings implementation of showwarning. Otherwise, + it will call warnings.formatwarning and will log the resulting string to a + warnings logger named "py.warnings" with level logging.WARNING. + """ + if file is not None: + if _warnings_showwarning is not None: + _warnings_showwarning(message, category, filename, lineno, file, line) + else: + s = warnings.formatwarning(message, category, filename, lineno, line) + logger = getLogger("py.warnings") + if not logger.handlers: + logger.addHandler(NullHandler()) + logger.warning("%s", s) + +def captureWarnings(capture): + """ + If capture is true, redirect all warnings to the logging package. + If capture is False, ensure that warnings are not redirected to logging + but to their original destinations. + """ + global _warnings_showwarning + if capture: + if _warnings_showwarning is None: + _warnings_showwarning = warnings.showwarning + warnings.showwarning = _showwarning + else: + if _warnings_showwarning is not None: + warnings.showwarning = _warnings_showwarning + _warnings_showwarning = None Modified: python/branches/tlee-ast-optimize/Lib/logging/handlers.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/logging/handlers.py (original) +++ python/branches/tlee-ast-optimize/Lib/logging/handlers.py Wed Jan 14 13:24:17 2009 @@ -1027,9 +1027,7 @@ h.putheader("Content-type", "application/x-www-form-urlencoded") h.putheader("Content-length", str(len(data))) - h.endheaders() - if self.method == "POST": - h.send(data) + h.endheaders(data if self.method == "POST" else None) h.getreply() #can't do anything with the result except (KeyboardInterrupt, SystemExit): raise Modified: python/branches/tlee-ast-optimize/Lib/opcode.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/opcode.py (original) +++ python/branches/tlee-ast-optimize/Lib/opcode.py Wed Jan 14 13:24:17 2009 @@ -58,7 +58,6 @@ def_op('UNARY_INVERT', 15) -def_op('LIST_APPEND', 18) def_op('BINARY_POWER', 19) def_op('BINARY_MULTIPLY', 20) def_op('BINARY_DIVIDE', 21) @@ -128,7 +127,7 @@ name_op('DELETE_NAME', 91) # "" def_op('UNPACK_SEQUENCE', 92) # Number of tuple items jrel_op('FOR_ITER', 93) - +def_op('LIST_APPEND', 94) name_op('STORE_ATTR', 95) # Index in name list name_op('DELETE_ATTR', 96) # "" name_op('STORE_GLOBAL', 97) # "" Modified: python/branches/tlee-ast-optimize/Lib/pdb.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/pdb.py (original) +++ python/branches/tlee-ast-optimize/Lib/pdb.py Wed Jan 14 13:24:17 2009 @@ -440,7 +440,7 @@ Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank line or EOF). Warning: testing is not comprehensive. """ - line = linecache.getline(filename, lineno) + line = linecache.getline(filename, lineno, self.curframe.f_globals) if not line: print >>self.stdout, 'End of file' return 0 @@ -768,7 +768,7 @@ breaklist = self.get_file_breaks(filename) try: for lineno in range(first, last+1): - line = linecache.getline(filename, lineno) + line = linecache.getline(filename, lineno, self.curframe.f_globals) if not line: print >>self.stdout, '[EOF]' break Modified: python/branches/tlee-ast-optimize/Lib/plat-mac/EasyDialogs.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/plat-mac/EasyDialogs.py (original) +++ python/branches/tlee-ast-optimize/Lib/plat-mac/EasyDialogs.py Wed Jan 14 13:24:17 2009 @@ -573,7 +573,7 @@ del d def _process_Nav_args(dftflags, **args): - import aepack + import Carbon.AppleEvents import Carbon.AE import Carbon.File for k in args.keys(): @@ -585,11 +585,14 @@ if args.has_key('defaultLocation') and \ not isinstance(args['defaultLocation'], Carbon.AE.AEDesc): defaultLocation = args['defaultLocation'] - if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): - args['defaultLocation'] = aepack.pack(defaultLocation) + if isinstance(defaultLocation, Carbon.File.FSSpec): + args['defaultLocation'] = Carbon.AE.AECreateDesc( + Carbon.AppleEvents.typeFSS, defaultLocation.data) else: - defaultLocation = Carbon.File.FSRef(defaultLocation) - args['defaultLocation'] = aepack.pack(defaultLocation) + if not isinstance(defaultLocation, Carbon.File.FSRef): + defaultLocation = Carbon.File.FSRef(defaultLocation) + args['defaultLocation'] = Carbon.AE.AECreateDesc( + Carbon.AppleEvents.typeFSRef, defaultLocation.data) if args.has_key('typeList') and not isinstance(args['typeList'], Carbon.Res.ResourceType): typeList = args['typeList'][:] # Workaround for OSX typeless files: Modified: python/branches/tlee-ast-optimize/Lib/plat-mac/bundlebuilder.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/plat-mac/bundlebuilder.py (original) +++ python/branches/tlee-ast-optimize/Lib/plat-mac/bundlebuilder.py Wed Jan 14 13:24:17 2009 @@ -245,14 +245,14 @@ del sys.path[1:] # sys.path[0] is Contents/Resources/ """ -if USE_ZIPIMPORT: - ZIP_ARCHIVE = "Modules.zip" - SITE_PY += "sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE - def getPycData(fullname, code, ispkg): - if ispkg: - fullname += ".__init__" - path = fullname.replace(".", os.sep) + PYC_EXT - return path, MAGIC + '\0\0\0\0' + marshal.dumps(code) +ZIP_ARCHIVE = "Modules.zip" +SITE_PY_ZIP = SITE_PY + ("sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE) + +def getPycData(fullname, code, ispkg): + if ispkg: + fullname += ".__init__" + path = fullname.replace(".", os.sep) + PYC_EXT + return path, MAGIC + '\0\0\0\0' + marshal.dumps(code) # # Extension modules can't be in the modules zip archive, so a placeholder @@ -301,6 +301,9 @@ libdir = os.path.join(os.path.dirname(execdir), "Frameworks") mainprogram = os.path.join(resdir, "%(mainprogram)s") +if %(optimize)s: + sys.argv.insert(1, '-O') + sys.argv.insert(1, mainprogram) if %(standalone)s or %(semi_standalone)s: os.environ["PYTHONPATH"] = resdir @@ -311,6 +314,7 @@ if pypath: pypath = ":" + pypath os.environ["PYTHONPATH"] = resdir + pypath + os.environ["PYTHONEXECUTABLE"] = executable os.environ["DYLD_LIBRARY_PATH"] = libdir os.environ["DYLD_FRAMEWORK_PATH"] = libdir @@ -350,6 +354,8 @@ class AppBuilder(BundleBuilder): + use_zipimport = USE_ZIPIMPORT + # Override type of the bundle. type = "APPL" @@ -506,6 +512,7 @@ hashbang = os.path.realpath(sys.executable) standalone = self.standalone semi_standalone = self.semi_standalone + optimize = sys.flags.optimize open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals()) os.chmod(bootstrappath, 0775) @@ -552,13 +559,14 @@ self.files.append((src, dst)) def _getSiteCode(self): - return compile(SITE_PY % {"semi_standalone": self.semi_standalone}, + if self.use_zipimport: + return compile(SITE_PY % {"semi_standalone": self.semi_standalone}, "<-bundlebuilder.py->", "exec") def addPythonModules(self): self.message("Adding Python modules", 1) - if USE_ZIPIMPORT: + if self.use_zipimport: # Create a zip file containing all modules as pyc. import zipfile relpath = pathjoin("Contents", "Resources", ZIP_ARCHIVE) @@ -624,7 +632,7 @@ self.message("Finding module dependencies", 1) import modulefinder mf = modulefinder.ModuleFinder(excludes=self.excludeModules) - if USE_ZIPIMPORT: + if self.use_zipimport: # zipimport imports zlib, must add it manually mf.import_hook("zlib") # manually add our own site.py @@ -658,7 +666,7 @@ filename = os.path.basename(path) pathitems = name.split(".")[:-1] + [filename] dstpath = pathjoin(*pathitems) - if USE_ZIPIMPORT: + if self.use_zipimport: if name != "zlib": # neatly pack all extension modules in a subdirectory, # except zlib, since it's neccesary for bootstrapping. @@ -672,9 +680,9 @@ self.files.append((path, pathjoin("Contents", "Resources", dstpath))) if mod.__code__ is not None: ispkg = mod.__path__ is not None - if not USE_ZIPIMPORT or name != "site": + if not self.use_zipimport or name != "site": # Our site.py is doing the bootstrapping, so we must - # include a real .pyc file if USE_ZIPIMPORT is True. + # include a real .pyc file if self.use_zipimport is True. self.pymodules.append((name, mod.__code__, ispkg)) if hasattr(mf, "any_missing_maybe"): @@ -820,6 +828,7 @@ --semi-standalone build a standalone application, which depends on an installed Python, yet includes all third-party modules. + --no-zipimport Do not copy code into a zip file --python=FILE Python to use in #! line in stead of current Python --lib=FILE shared library or framework to be copied into the bundle @@ -847,7 +856,9 @@ "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "argv", "standalone", "exclude=", "include=", "package=", "strip", "iconfile=", - "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=") + "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=" + "no-zipimport" + ) try: options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) @@ -911,6 +922,8 @@ builder.strip = 1 elif opt == '--destroot': builder.destroot = arg + elif opt == '--no-zipimport': + builder.use_zipimport = False if len(args) != 1: usage("Must specify one command ('build', 'report' or 'help')") Modified: python/branches/tlee-ast-optimize/Lib/plat-mac/macostools.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/plat-mac/macostools.py (original) +++ python/branches/tlee-ast-optimize/Lib/plat-mac/macostools.py Wed Jan 14 13:24:17 2009 @@ -62,7 +62,14 @@ if os.sep == ':' and not ':' in head: head = head + ':' mkdirs(head) - os.mkdir(dst, 0777) + + try: + os.mkdir(dst, 0777) + except OSError, e: + # be happy if someone already created the path + if e.errno != errno.EEXIST: + raise + def touched(dst): """Tell the finder a file has changed. No-op on MacOSX.""" Modified: python/branches/tlee-ast-optimize/Lib/plat-mac/videoreader.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/plat-mac/videoreader.py (original) +++ python/branches/tlee-ast-optimize/Lib/plat-mac/videoreader.py Wed Jan 14 13:24:17 2009 @@ -18,7 +18,7 @@ from Carbon import QDOffscreen from Carbon import Res try: - import MediaDescr + from Carbon import MediaDescr except ImportError: def _audiodescr(data): return None @@ -238,12 +238,12 @@ width = self.videodescr['width'] height = self.videodescr['height'] start = 0 - rv = '' + rv = [] for i in range(height): nextline = Qdoffs.GetPixMapBytes(self.pixmap, start, width*4) start = start + rowbytes - rv = rv + nextline - return rv + rv.append(nextline) + return ''.join(rv) def reader(url): try: @@ -255,9 +255,9 @@ def _test(): import EasyDialogs try: - import img + from PIL import Image except ImportError: - img = None + Image = None import MacOS Qt.EnterMovies() path = EasyDialogs.AskFileForOpen(message='Video to convert') @@ -277,13 +277,11 @@ fname = 'frame%04.4d.jpg'%num num = num+1 pname = os.path.join(dstdir, fname) - if not img: print 'Not', + if not Image: print 'Not', print 'Writing %s, size %dx%d, %d bytes'%(fname, imgw, imgh, len(data)) - if img: - wrt = img.writer(imgfmt, pname) - wrt.width = imgw - wrt.height = imgh - wrt.write(data) + if Image: + img = Image.fromstring("RGBA", (imgw, imgh), data) + img.save(pname, 'JPEG') timestamp, data = rdr.ReadVideo() MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG') if num > 20: Modified: python/branches/tlee-ast-optimize/Lib/pydoc.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/pydoc.py (original) +++ python/branches/tlee-ast-optimize/Lib/pydoc.py Wed Jan 14 13:24:17 2009 @@ -1574,6 +1574,42 @@ 'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'), 'yield': ('yield', ''), } + # Either add symbols to this dictionary or to the symbols dictionary + # directly: Whichever is easier. They are merged later. + _symbols_inverse = { + 'STRINGS' : ("'", "'''", "r'", "u'", '"""', '"', 'r"', 'u"'), + 'OPERATORS' : ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&', + '|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'), + 'COMPARISON' : ('<', '>', '<=', '>=', '==', '!=', '<>'), + 'UNARY' : ('-', '~'), + 'AUGMENTEDASSIGNMENT' : ('+=', '-=', '*=', '/=', '%=', '&=', '|=', + '^=', '<<=', '>>=', '**=', '//='), + 'BITWISE' : ('<<', '>>', '&', '|', '^', '~'), + 'COMPLEX' : ('j', 'J') + } + symbols = { + '%': 'OPERATORS FORMATTING', + '**': 'POWER', + ',': 'TUPLES LISTS FUNCTIONS', + '.': 'ATTRIBUTES FLOAT MODULES OBJECTS', + '...': 'ELLIPSIS', + ':': 'SLICINGS DICTIONARYLITERALS', + '@': 'def class', + '\\': 'STRINGS', + '_': 'PRIVATENAMES', + '__': 'PRIVATENAMES SPECIALMETHODS', + '`': 'BACKQUOTES', + '(': 'TUPLES FUNCTIONS CALLS', + ')': 'TUPLES FUNCTIONS CALLS', + '[': 'LISTS SUBSCRIPTS SLICINGS', + ']': 'LISTS SUBSCRIPTS SLICINGS' + } + for topic, symbols_ in _symbols_inverse.iteritems(): + for symbol in symbols_: + topics = symbols.get(symbol, topic) + if topic not in topics: + topics = topics + ' ' + topic + symbols[symbol] = topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS ' @@ -1717,10 +1753,12 @@ if type(request) is type(''): if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() + elif request == 'symbols': self.listsymbols() elif request == 'topics': self.listtopics() elif request == 'modules': self.listmodules() elif request[:8] == 'modules ': self.listmodules(split(request)[1]) + elif request in self.symbols: self.showsymbol(request) elif request in self.keywords: self.showtopic(request) elif request in self.topics: self.showtopic(request) elif request: doc(request, 'Help on %s:') @@ -1766,6 +1804,14 @@ ''') self.list(self.keywords.keys()) + def listsymbols(self): + self.output.write(''' +Here is a list of the punctuation symbols which Python assigns special meaning +to. Enter any symbol to get more help. + +''') + self.list(self.symbols.keys()) + def listtopics(self): self.output.write(''' Here is a list of available topics. Enter any topic name to get more help. @@ -1773,7 +1819,7 @@ ''') self.list(self.topics.keys()) - def showtopic(self, topic): + def showtopic(self, topic, more_xrefs=''): try: import pydoc_topics except ImportError: @@ -1787,7 +1833,7 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return if type(target) is type(''): - return self.showtopic(target) + return self.showtopic(target, more_xrefs) label, xrefs = target try: @@ -1796,6 +1842,8 @@ self.output.write('no documentation found for %s\n' % repr(topic)) return pager(strip(doc) + '\n') + if more_xrefs: + xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: import StringIO, formatter buffer = StringIO.StringIO() @@ -1803,6 +1851,11 @@ 'Related help topics: ' + join(split(xrefs), ', ') + '\n') self.output.write('\n%s\n' % buffer.getvalue()) + def showsymbol(self, symbol): + target = self.symbols[symbol] + topic, _, xrefs = target.partition(' ') + self.showtopic(topic, xrefs) + def listmodules(self, key=''): if key: self.output.write(''' Modified: python/branches/tlee-ast-optimize/Lib/random.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/random.py (original) +++ python/branches/tlee-ast-optimize/Lib/random.py Wed Jan 14 13:24:17 2009 @@ -413,9 +413,11 @@ def expovariate(self, 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. + 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. """ # lambd: rate lambd = 1/mean Modified: python/branches/tlee-ast-optimize/Lib/re.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/re.py (original) +++ python/branches/tlee-ast-optimize/Lib/re.py Wed Jan 14 13:24:17 2009 @@ -145,7 +145,8 @@ """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; - if a callable, it's passed the match object and must return + if a string, backslash escapes in it are processed. If it is + a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).sub(repl, string, count) @@ -155,7 +156,8 @@ non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a string or a - callable; if a callable, it's passed the match object and must + callable; if a string, backslash escapes in it are processed. + If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, 0).subn(repl, string, count) Modified: python/branches/tlee-ast-optimize/Lib/runpy.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/runpy.py (original) +++ python/branches/tlee-ast-optimize/Lib/runpy.py Wed Jan 14 13:24:17 2009 @@ -65,13 +65,14 @@ # This helper is needed due to a missing component in the PEP 302 # loader protocol (specifically, "get_filename" is non-standard) +# Since we can't introduce new features in maintenance releases, +# support was added to zipimporter under the name '_get_filename' def _get_filename(loader, mod_name): - try: - get_filename = loader.get_filename - except AttributeError: - return None - else: - return get_filename(mod_name) + for attr in ("get_filename", "_get_filename"): + meth = getattr(loader, attr, None) + if meth is not None: + return meth(mod_name) + return None # Helper to get the loader, code and filename for a module def _get_module_details(mod_name): Modified: python/branches/tlee-ast-optimize/Lib/ssl.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ssl.py (original) +++ python/branches/tlee-ast-optimize/Lib/ssl.py Wed Jan 14 13:24:17 2009 @@ -74,7 +74,7 @@ SSL_ERROR_EOF, \ SSL_ERROR_INVALID_ERROR_CODE -from socket import socket, _fileobject +from socket import socket, _fileobject, error as socket_error from socket import getnameinfo as _getnameinfo import base64 # for DER-to-PEM translation @@ -103,7 +103,7 @@ # see if it's connected try: socket.getpeername(self) - except: + except socket_error: # no, no connection yet self._sslobj = None else: @@ -441,7 +441,7 @@ PROTOCOL_SSLv23, None) try: sock.getpeername() - except: + except socket_error: # no, no connection yet pass else: Modified: python/branches/tlee-ast-optimize/Lib/subprocess.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/subprocess.py (original) +++ python/branches/tlee-ast-optimize/Lib/subprocess.py Wed Jan 14 13:24:17 2009 @@ -107,7 +107,7 @@ (Windows only) -This module also defines two shortcut functions: +This module also defines some shortcut functions: call(*popenargs, **kwargs): Run command with arguments. Wait for command to complete, then @@ -127,6 +127,17 @@ check_call(["ls", "-l"]) +check_output(*popenargs, **kwargs): + Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + output = subprocess.check_output(["ls", "-l", "/dev/null"]) + Exceptions ---------- Exceptions raised in the child process, before the new program has @@ -141,8 +152,8 @@ A ValueError will be raised if Popen is called with invalid arguments. -check_call() will raise CalledProcessError, if the called process -returns a non-zero return code. +check_call() and check_output() will raise CalledProcessError, if the +called process returns a non-zero return code. Security @@ -361,12 +372,15 @@ # Exception classes used by this module. class CalledProcessError(Exception): - """This exception is raised when a process run by check_call() returns - a non-zero exit status. The exit status will be stored in the - returncode attribute.""" - def __init__(self, returncode, cmd): + """This exception is raised when a process run by check_call() or + check_output() returns a non-zero exit status. + The exit status will be stored in the returncode attribute; + check_output() will also store the output in the output attribute. + """ + def __init__(self, returncode, cmd, output=None): self.returncode = returncode self.cmd = cmd + self.output = output def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) @@ -403,7 +417,8 @@ import fcntl import pickle -__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "CalledProcessError"] +__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", + "check_output", "CalledProcessError"] try: MAXFD = os.sysconf("SC_OPEN_MAX") @@ -455,12 +470,45 @@ check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) - cmd = kwargs.get("args") - if cmd is None: - cmd = popenargs[0] if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] raise CalledProcessError(retcode, cmd) - return retcode + return 0 + + +def check_output(*popenargs, **kwargs): + """Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + >>> check_output(["ls", "-l", "/dev/null"]) + 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' + + The stdout argument is not allowed as it is used internally. + To capture standard error in the result, use stderr=subprocess.STDOUT. + + >>> check_output(["/bin/sh", "-c", + "ls -l non_existant_file ; exit 0"], + stderr=subprocess.STDOUT) + 'ls: non_existant_file: No such file or directory\n' + """ + if 'stdout' in kwargs: + raise ValueError('stdout argument not allowed, it will be overridden.') + process = Popen(*popenargs, stdout=PIPE, **kwargs) + output, unused_err = process.communicate() + retcode = process.poll() + if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] + raise CalledProcessError(retcode, cmd, output=output) + return output def list2cmdline(seq): Modified: python/branches/tlee-ast-optimize/Lib/tarfile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/tarfile.py (original) +++ python/branches/tlee-ast-optimize/Lib/tarfile.py Wed Jan 14 13:24:17 2009 @@ -2284,10 +2284,6 @@ """ if not hasattr(os, 'utime'): return - if sys.platform == "win32" and tarinfo.isdir(): - # According to msdn.microsoft.com, it is an error (EACCES) - # to use utime() on directories. - return try: os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime)) except EnvironmentError, e: Deleted: python/branches/tlee-ast-optimize/Lib/test/crashers/iter.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/crashers/iter.py Wed Jan 14 13:24:17 2009 +++ (empty file) @@ -1,53 +0,0 @@ -# Calls to PyIter_Next, or direct calls to tp_iternext, on an object -# which might no longer be an iterable because its 'next' method was -# removed. These are all variants of Issue3720. - -""" -Run this script with an argument between 1 and to test for -different crashes. -""" -N = 8 - -import sys - -class Foo(object): - def __iter__(self): - return self - def next(self): - del Foo.next - return (1, 2) - -def case1(): - list(enumerate(Foo())) - -def case2(): - x, y = Foo() - -def case3(): - filter(None, Foo()) - -def case4(): - map(None, Foo(), Foo()) - -def case5(): - max(Foo()) - -def case6(): - sum(Foo(), ()) - -def case7(): - dict(Foo()) - -def case8(): - sys.stdout.writelines(Foo()) - -# etc... - - -if __name__ == '__main__': - if len(sys.argv) < 2: - print __doc__.replace('', str(N)) - else: - n = int(sys.argv[1]) - func = globals()['case%d' % n] - func() Modified: python/branches/tlee-ast-optimize/Lib/test/decimaltestdata/extra.decTest ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/decimaltestdata/extra.decTest (original) +++ python/branches/tlee-ast-optimize/Lib/test/decimaltestdata/extra.decTest Wed Jan 14 13:24:17 2009 @@ -154,6 +154,23 @@ extr1302 fma 0E123 -Inf sNaN789 -> NaN Invalid_operation extr1302 fma -Inf 0E-456 sNaN148 -> NaN Invalid_operation +-- max/min/max_mag/min_mag bug in 2.5.2/2.6/3.0: max(NaN, finite) gave +-- incorrect answers when the finite number required rounding; similarly +-- for the other thre functions +maxexponent: 999 +minexponent: -999 +precision: 6 +rounding: half_even +extr1400 max NaN 1234567 -> 1.23457E+6 Inexact Rounded +extr1401 max 3141590E-123 NaN1729 -> 3.14159E-117 Rounded +extr1402 max -7.654321 -NaN -> -7.65432 Inexact Rounded +extr1410 min -NaN -765432.1 -> -765432 Inexact Rounded +extr1411 min 3141592 NaN -> 3.14159E+6 Inexact Rounded +extr1420 max_mag 0.1111111 -NaN123 -> 0.111111 Inexact Rounded +extr1421 max_mag NaN999999999 0.001234567 -> 0.00123457 Inexact Rounded +extr1430 min_mag 9181716151 -NaN -> 9.18172E+9 Inexact Rounded +extr1431 min_mag NaN4 1.818180E100 -> 1.81818E+100 Rounded + -- Tests for the is_* boolean operations precision: 9 maxExponent: 999 Modified: python/branches/tlee-ast-optimize/Lib/test/list_tests.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/list_tests.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/list_tests.py Wed Jan 14 13:24:17 2009 @@ -84,6 +84,8 @@ self.assertRaises(StopIteration, r.next) self.assertEqual(list(reversed(self.type2test())), self.type2test()) + # Bug 3689: make sure list-reversed-iterator doesn't have __len__ + self.assertRaises(TypeError, len, reversed([1,2,3])) def test_setitem(self): a = self.type2test([0, 1]) Modified: python/branches/tlee-ast-optimize/Lib/test/pickletester.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/pickletester.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/pickletester.py Wed Jan 14 13:24:17 2009 @@ -480,14 +480,21 @@ if have_unicode: def test_unicode(self): - endcases = [unicode(''), unicode('<\\u>'), unicode('<\\\u1234>'), - unicode('<\n>'), unicode('<\\>')] + endcases = [u'', u'<\\u>', u'<\\\u1234>', u'<\n>', + u'<\\>', u'<\\\U00012345>'] for proto in protocols: for u in endcases: p = self.dumps(u, proto) u2 = self.loads(p) self.assertEqual(u2, u) + def test_unicode_high_plane(self): + t = u'\U00012345' + for proto in protocols: + p = self.dumps(t, proto) + t2 = self.loads(p) + self.assertEqual(t2, t) + def test_ints(self): import sys for proto in protocols: Modified: python/branches/tlee-ast-optimize/Lib/test/test_array.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_array.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_array.py Wed Jan 14 13:24:17 2009 @@ -7,7 +7,7 @@ from test import test_support from weakref import proxy import array, cStringIO -from cPickle import loads, dumps +from cPickle import loads, dumps, HIGHEST_PROTOCOL class ArraySubclass(array.array): pass @@ -97,7 +97,7 @@ self.assertEqual(a, b) def test_pickle(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode, self.example) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) @@ -112,7 +112,7 @@ self.assertEqual(type(a), type(b)) def test_pickle_for_empty_array(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) Modified: python/branches/tlee-ast-optimize/Lib/test/test_ast.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_ast.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_ast.py Wed Jan 14 13:24:17 2009 @@ -272,6 +272,12 @@ self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None)) self.assertRaises(ValueError, ast.literal_eval, 'foo()') + def test_literal_eval_issue4907(self): + self.assertEqual(ast.literal_eval('2j'), 2j) + self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j) + self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j) + self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)') + def test_main(): test_support.run_unittest(AST_Tests, ASTHelpers_Test) Modified: python/branches/tlee-ast-optimize/Lib/test/test_bytes.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_bytes.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_bytes.py Wed Jan 14 13:24:17 2009 @@ -752,6 +752,38 @@ self.assertEqual(b, b"") self.assertEqual(c, b"") + # XXX memoryview not available + def XXXtest_resize_forbidden(self): + # #4509: can't resize a bytearray when there are buffer exports, even + # if it wouldn't reallocate the underlying buffer. + # Furthermore, no destructive changes to the buffer may be applied + # before raising the error. + b = bytearray(range(10)) + v = memoryview(b) + def resize(n): + b[1:-1] = range(n + 1, 2*n - 1) + resize(10) + orig = b[:] + self.assertRaises(BufferError, resize, 11) + self.assertEquals(b, orig) + self.assertRaises(BufferError, resize, 9) + self.assertEquals(b, orig) + self.assertRaises(BufferError, resize, 0) + self.assertEquals(b, orig) + # Other operations implying resize + self.assertRaises(BufferError, b.pop, 0) + self.assertEquals(b, orig) + self.assertRaises(BufferError, b.remove, b[1]) + self.assertEquals(b, orig) + def delitem(): + del b[1] + self.assertRaises(BufferError, delitem) + self.assertEquals(b, orig) + # deleting a non-contiguous slice + def delslice(): + b[1:-1:2] = b"" + self.assertRaises(BufferError, delslice) + self.assertEquals(b, orig) class AssortedBytesTest(unittest.TestCase): # @@ -840,11 +872,21 @@ def test_translate(self): b = b'hello' + ba = bytearray(b) rosetta = bytearray(range(0, 256)) rosetta[ord('o')] = ord('e') c = b.translate(rosetta, b'l') self.assertEqual(b, b'hello') self.assertEqual(c, b'hee') + c = ba.translate(rosetta, b'l') + self.assertEqual(ba, b'hello') + self.assertEqual(c, b'hee') + c = b.translate(None, b'e') + self.assertEqual(c, b'hllo') + c = ba.translate(None, b'e') + self.assertEqual(c, b'hllo') + self.assertRaises(TypeError, b.translate, None, None) + self.assertRaises(TypeError, ba.translate, None, None) def test_split_bytearray(self): self.assertEqual(b'a b'.split(memoryview(b' ')), [b'a', b'b']) Modified: python/branches/tlee-ast-optimize/Lib/test/test_bz2.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_bz2.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_bz2.py Wed Jan 14 13:24:17 2009 @@ -284,6 +284,28 @@ bz2f.close() self.assertEqual(xlines, ['Test']) + def testContextProtocol(self): + # BZ2File supports the context management protocol + f = None + with BZ2File(self.filename, "wb") as f: + f.write(b"xxx") + f = BZ2File(self.filename, "rb") + f.close() + try: + with f: + pass + except ValueError: + pass + else: + self.fail("__enter__ on a closed file didn't raise an exception") + try: + with BZ2File(self.filename, "wb") as f: + 1/0 + except ZeroDivisionError: + pass + else: + self.fail("1/0 didn't raise an exception") + class BZ2CompressorTest(BaseTest): def testCompress(self): Modified: python/branches/tlee-ast-optimize/Lib/test/test_capi.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_capi.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_capi.py Wed Jan 14 13:24:17 2009 @@ -2,9 +2,74 @@ # these are all functions _testcapi exports whose name begins with 'test_'. import sys +import time +import random +import unittest +import threading from test import test_support import _testcapi +class TestPendingCalls(unittest.TestCase): + + def pendingcalls_submit(self, l, n): + def callback(): + #this function can be interrupted by thread switching so let's + #use an atomic operation + l.append(None) + + for i in range(n): + time.sleep(random.random()*0.02) #0.01 secs on average + #try submitting callback until successful. + #rely on regular interrupt to flush queue if we are + #unsuccessful. + while True: + if _testcapi._pending_threadfunc(callback): + break; + + def pendingcalls_wait(self, l, n): + #now, stick around until l[0] has grown to 10 + count = 0; + while len(l) != n: + #this busy loop is where we expect to be interrupted to + #run our callbacks. Note that callbacks are only run on the + #main thread + if False and test_support.verbose: + print "(%i)"%(len(l),), + for i in xrange(1000): + a = i*i + count += 1 + self.failUnless(count < 10000, + "timeout waiting for %i callbacks, got %i"%(n, len(l))) + if False and test_support.verbose: + print "(%i)"%(len(l),) + + def test_pendingcalls_threaded(self): + l = [] + + #do every callback on a separate thread + n = 32 + threads = [] + for i in range(n): + t = threading.Thread(target=self.pendingcalls_submit, args = (l, 1)) + t.start() + threads.append(t) + + self.pendingcalls_wait(l, n) + + for t in threads: + t.join() + + def test_pendingcalls_non_threaded(self): + #again, just using the main thread, likely they will all be dispathced at + #once. It is ok to ask for too many, because we loop until we find a slot. + #the loop can be interrupted to dispatch. + #there are only 32 dispatch slots, so we go for twice that! + l = [] + n = 64 + self.pendingcalls_submit(l, n) + self.pendingcalls_wait(l, n) + + def test_main(): for name in dir(_testcapi): @@ -50,5 +115,7 @@ t.start() t.join() + test_support.run_unittest(TestPendingCalls) + if __name__ == "__main__": test_main() Modified: python/branches/tlee-ast-optimize/Lib/test/test_cgi.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_cgi.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_cgi.py Wed Jan 14 13:24:17 2009 @@ -354,6 +354,32 @@ self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], cgi.parse_qsl('a=A1&b=B2&B=B3')) + def test_parse_header(self): + self.assertEqual( + cgi.parse_header("text/plain"), + ("text/plain", {})) + self.assertEqual( + cgi.parse_header("text/vnd.just.made.this.up ; "), + ("text/vnd.just.made.this.up", {})) + self.assertEqual( + cgi.parse_header("text/plain;charset=us-ascii"), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"'), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"; another=opt'), + ("text/plain", {"charset": "us-ascii", "another": "opt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="silly.txt"'), + ("attachment", {"filename": "silly.txt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name"'), + ("attachment", {"filename": "strange;name"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name";size=123;'), + ("attachment", {"filename": "strange;name", "size": "123"})) + def test_main(): run_unittest(CgiTests) Modified: python/branches/tlee-ast-optimize/Lib/test/test_cmd_line_script.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_cmd_line_script.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_cmd_line_script.py Wed Jan 14 13:24:17 2009 @@ -75,36 +75,66 @@ compiled_name = script_name + 'o' return compiled_name -def _make_test_zip(zip_dir, zip_basename, script_name): +def _make_test_zip(zip_dir, zip_basename, script_name, name_in_zip=None): zip_filename = zip_basename+os.extsep+'zip' zip_name = os.path.join(zip_dir, zip_filename) zip_file = zipfile.ZipFile(zip_name, 'w') - zip_file.write(script_name, os.path.basename(script_name)) + if name_in_zip is None: + name_in_zip = os.path.basename(script_name) + zip_file.write(script_name, name_in_zip) zip_file.close() - # if verbose: + #if verbose: # zip_file = zipfile.ZipFile(zip_name, 'r') # print 'Contents of %r:' % zip_name # zip_file.printdir() # zip_file.close() - return zip_name + return zip_name, os.path.join(zip_name, name_in_zip) def _make_test_pkg(pkg_dir): os.mkdir(pkg_dir) _make_test_script(pkg_dir, '__init__', '') +def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, + source=test_source, depth=1): + init_name = _make_test_script(zip_dir, '__init__', '') + init_basename = os.path.basename(init_name) + script_name = _make_test_script(zip_dir, script_basename, source) + pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)] + script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name)) + zip_filename = zip_basename+os.extsep+'zip' + zip_name = os.path.join(zip_dir, zip_filename) + zip_file = zipfile.ZipFile(zip_name, 'w') + for name in pkg_names: + init_name_in_zip = os.path.join(name, init_basename) + zip_file.write(init_name, init_name_in_zip) + zip_file.write(script_name, script_name_in_zip) + zip_file.close() + os.unlink(init_name) + os.unlink(script_name) + #if verbose: + # zip_file = zipfile.ZipFile(zip_name, 'r') + # print 'Contents of %r:' % zip_name + # zip_file.printdir() + # zip_file.close() + return zip_name, os.path.join(zip_name, script_name_in_zip) + # There's no easy way to pass the script directory in to get # -m to work (avoiding that is the whole point of making # directories and zipfiles executable!) # So we fake it for testing purposes with a custom launch script launch_source = """\ import sys, os.path, runpy -sys.path[0:0] = os.path.dirname(__file__) +sys.path.insert(0, %s) runpy._run_module_as_main(%r) """ -def _make_launch_script(script_dir, script_basename, module_name): - return _make_test_script(script_dir, script_basename, - launch_source % module_name) +def _make_launch_script(script_dir, script_basename, module_name, path=None): + if path is None: + path = "os.path.dirname(__file__)" + else: + path = repr(path) + source = launch_source % (path, module_name) + return _make_test_script(script_dir, script_basename, source) class CmdLineTest(unittest.TestCase): def _check_script(self, script_name, expected_file, @@ -155,15 +185,15 @@ def test_zipfile(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') - zip_name = _make_test_zip(script_dir, 'test_zip', script_name) - self._check_script(zip_name, None, zip_name, '') + zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name) + self._check_script(zip_name, run_name, zip_name, '') def test_zipfile_compiled(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') compiled_name = _compile_test_script(script_name) - zip_name = _make_test_zip(script_dir, 'test_zip', compiled_name) - self._check_script(zip_name, None, zip_name, '') + zip_name, run_name = _make_test_zip(script_dir, 'test_zip', compiled_name) + self._check_script(zip_name, run_name, zip_name, '') def test_module_in_package(self): with temp_dir() as script_dir: @@ -171,8 +201,19 @@ _make_test_pkg(pkg_dir) script_name = _make_test_script(pkg_dir, 'script') launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script') - self._check_script(launch_name, script_name, - script_name, 'test_pkg') + self._check_script(launch_name, script_name, script_name, 'test_pkg') + + def test_module_in_package_in_zipfile(self): + with temp_dir() as script_dir: + zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script') + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script', zip_name) + self._check_script(launch_name, run_name, run_name, 'test_pkg') + + def test_module_in_subpackage_in_zipfile(self): + with temp_dir() as script_dir: + zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script', depth=2) + 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_main(): Modified: python/branches/tlee-ast-optimize/Lib/test/test_collections.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_collections.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_collections.py Wed Jan 14 13:24:17 2009 @@ -1,6 +1,6 @@ import unittest, doctest from test import test_support -from collections import namedtuple +from collections import namedtuple, Counter, Mapping import pickle, cPickle, copy from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable @@ -346,11 +346,109 @@ self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(basestring, MutableSequence)) +class TestCounter(unittest.TestCase): + + def test_basics(self): + c = Counter('abcaba') + self.assert_(isinstance(c, dict)) + self.assert_(isinstance(c, Mapping)) + self.assert_(issubclass(Counter, dict)) + self.assert_(issubclass(Counter, Mapping)) + self.assertEqual(len(c), 3) + self.assertEqual(sum(c.values()), 6) + self.assertEqual(sorted(c.values()), [1, 2, 3]) + self.assertEqual(sorted(c.keys()), ['a', 'b', 'c']) + self.assertEqual(sorted(c), ['a', 'b', 'c']) + self.assertEqual(sorted(c.items()), + [('a', 3), ('b', 2), ('c', 1)]) + self.assertEqual(c['b'], 2) + self.assertEqual(c['z'], 0) + self.assertEqual(c.has_key('c'), True) + self.assertEqual(c.has_key('z'), False) + self.assertEqual(c.__contains__('c'), True) + self.assertEqual(c.__contains__('z'), False) + self.assertEqual(c.get('b', 10), 2) + self.assertEqual(c.get('z', 10), 10) + self.assertEqual(c, dict(a=3, b=2, c=1)) + self.assertEqual(repr(c), "Counter({'a': 3, 'b': 2, 'c': 1})") + self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)]) + for i in range(5): + self.assertEqual(c.most_common(i), + [('a', 3), ('b', 2), ('c', 1)][:i]) + self.assertEqual(''.join(sorted(c.elements())), 'aaabbc') + c['a'] += 1 # increment an existing value + c['b'] -= 2 # sub existing value to zero + del c['c'] # remove an entry + c['d'] -= 2 # sub from a missing value + c['e'] = -5 # directly assign a missing value + c['f'] += 4 # add to a missing value + self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4)) + self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff') + self.assertEqual(c.pop('f'), 4) + self.assertEqual('f' in c, False) + for i in range(3): + elem, cnt = c.popitem() + self.assertEqual(elem in c, False) + c.clear() + self.assertEqual(c, {}) + self.assertEqual(repr(c), 'Counter()') + self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') + self.assertRaises(TypeError, hash, c) + c.update(dict(a=5, b=3, c=1)) + c.update(Counter('a' * 50 + 'b' * 30)) + c.update() # test case with no args + c.__init__('a' * 500 + 'b' * 300) + c.__init__('cdc') + c.__init__() + self.assertEqual(c, dict(a=555, b=333, c=3, d=1)) + self.assertEqual(c.setdefault('d', 5), 1) + self.assertEqual(c['d'], 1) + self.assertEqual(c.setdefault('e', 5), 5) + self.assertEqual(c['e'], 5) + + def test_copying(self): + # Check that counters are copyable, deepcopyable, picklable, and + #have a repr/eval round-trip + words = Counter('which witch had which witches wrist watch'.split()) + update_test = Counter() + update_test.update(words) + for i, dup in enumerate([ + words.copy(), + copy.copy(words), + copy.deepcopy(words), + pickle.loads(pickle.dumps(words, 0)), + pickle.loads(pickle.dumps(words, 1)), + pickle.loads(pickle.dumps(words, 2)), + pickle.loads(pickle.dumps(words, -1)), + cPickle.loads(cPickle.dumps(words, 0)), + cPickle.loads(cPickle.dumps(words, 1)), + cPickle.loads(cPickle.dumps(words, 2)), + cPickle.loads(cPickle.dumps(words, -1)), + eval(repr(words)), + update_test, + Counter(words), + ]): + msg = (i, dup, words) + self.assert_(dup is not words) + self.assertEquals(dup, words) + self.assertEquals(len(dup), len(words)) + self.assertEquals(type(dup), type(words)) + + def test_conversions(self): + # Convert to: set, list, dict + s = 'she sells sea shells by the sea shore' + self.assertEqual(sorted(Counter(s).elements()), sorted(s)) + self.assertEqual(sorted(Counter(s)), sorted(set(s))) + self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) + self.assertEqual(set(Counter(s)), set(s)) + + import doctest, collections def test_main(verbose=None): NamedTupleDocs = doctest.DocTestSuite(module=collections) - test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs] + test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, + TestCollectionABCs, TestCounter] test_support.run_unittest(*test_classes) test_support.run_doctest(collections, verbose) Modified: python/branches/tlee-ast-optimize/Lib/test/test_datetime.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_datetime.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_datetime.py Wed Jan 14 13:24:17 2009 @@ -856,6 +856,14 @@ # A naive object replaces %z and %Z w/ empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + #make sure that invalid format specifiers are handled correctly + self.assertRaises(ValueError, t.strftime, "%e") + self.assertRaises(ValueError, t.strftime, "%") + self.assertRaises(ValueError, t.strftime, "%#") + + #check that this standard extension works + t.strftime("%f") + def test_format(self): dt = self.theclass(2007, 9, 10) Modified: python/branches/tlee-ast-optimize/Lib/test/test_decimal.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_decimal.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_decimal.py Wed Jan 14 13:24:17 2009 @@ -168,7 +168,6 @@ -context.Emin > DEC_MAX_MATH): return True if not v._is_special and v and ( - len(v._int) > DEC_MAX_MATH or v.adjusted() > DEC_MAX_MATH or v.adjusted() < 1-2*DEC_MAX_MATH): return True @@ -1361,6 +1360,55 @@ r = d.to_integral(ROUND_DOWN) self.assertEqual(Decimal(math.trunc(d)), r) + def test_from_float(self): + + class MyDecimal(Decimal): + pass + + r = MyDecimal.from_float(0.1) + self.assertEqual(type(r), MyDecimal) + self.assertEqual(str(r), + '0.1000000000000000055511151231257827021181583404541015625') + bigint = 12345678901234567890123456789 + self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) + self.assert_(MyDecimal.from_float(float('nan')).is_qnan()) + self.assert_(MyDecimal.from_float(float('inf')).is_infinite()) + self.assert_(MyDecimal.from_float(float('-inf')).is_infinite()) + self.assertEqual(str(MyDecimal.from_float(float('nan'))), + str(Decimal('NaN'))) + self.assertEqual(str(MyDecimal.from_float(float('inf'))), + str(Decimal('Infinity'))) + self.assertEqual(str(MyDecimal.from_float(float('-inf'))), + str(Decimal('-Infinity'))) + self.assertRaises(TypeError, MyDecimal.from_float, 'abc') + for i in range(200): + x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0) + self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip + + def test_create_decimal_from_float(self): + context = Context(prec=5, rounding=ROUND_DOWN) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1415') + ) + context = Context(prec=5, rounding=ROUND_UP) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1416') + ) + context = Context(prec=5, traps=[Inexact]) + self.assertRaises( + Inexact, + context.create_decimal_from_float, + math.pi + ) + self.assertEqual(repr(context.create_decimal_from_float(-0.0)), + "Decimal('-0')") + self.assertEqual(repr(context.create_decimal_from_float(1.0)), + "Decimal('1')") + self.assertEqual(repr(context.create_decimal_from_float(10)), + "Decimal('10')") + class ContextAPItests(unittest.TestCase): def test_pickle(self): Modified: python/branches/tlee-ast-optimize/Lib/test/test_deque.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_deque.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_deque.py Wed Jan 14 13:24:17 2009 @@ -1,7 +1,8 @@ from collections import deque import unittest from test import test_support, seq_tests -from weakref import proxy +import gc +import weakref import copy import cPickle as pickle import random @@ -373,7 +374,7 @@ def test_pickle(self): d = deque(xrange(200)) - for i in (0, 1, 2): + for i in range(pickle.HIGHEST_PROTOCOL + 1): s = pickle.dumps(d, i) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) @@ -382,7 +383,7 @@ ## def test_pickle_recursive(self): ## d = deque('abc') ## d.append(d) -## for i in (0, 1, 2): +## for i in range(pickle.HIGHEST_PROTOCOL + 1): ## e = pickle.loads(pickle.dumps(d, i)) ## self.assertNotEqual(id(d), id(e)) ## self.assertEqual(id(e), id(e[-1])) @@ -418,6 +419,22 @@ d.append(1) gc.collect() + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for deque iterator objects + class C(object): + pass + for i in range(2): + obj = C() + ref = weakref.ref(obj) + if i == 0: + container = deque([obj, 1]) + else: + container = reversed(deque([obj, 1])) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): @@ -528,7 +545,7 @@ def test_weakref(self): d = deque('gallahad') - p = proxy(d) + p = weakref.proxy(d) self.assertEqual(str(p), str(d)) d = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/tlee-ast-optimize/Lib/test/test_dict.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_dict.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_dict.py Wed Jan 14 13:24:17 2009 @@ -2,6 +2,7 @@ from test import test_support import UserDict, random, string +import gc, weakref class DictTest(unittest.TestCase): @@ -554,6 +555,19 @@ pass d = {} + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for dictiter objects + class C(object): + pass + iterators = (dict.iteritems, dict.itervalues, dict.iterkeys) + for i in iterators: + obj = C() + ref = weakref.ref(obj) + container = {obj: 1} + obj.x = i(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") from test import mapping_tests Modified: python/branches/tlee-ast-optimize/Lib/test/test_dis.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_dis.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_dis.py Wed Jan 14 13:24:17 2009 @@ -54,29 +54,25 @@ dis_bug1333982 = """\ %-4d 0 LOAD_CONST 1 (0) - 3 JUMP_IF_TRUE 41 (to 47) + 3 JUMP_IF_TRUE 33 (to 39) 6 POP_TOP 7 LOAD_GLOBAL 0 (AssertionError) 10 BUILD_LIST 0 - 13 DUP_TOP - 14 STORE_FAST 1 (_[1]) - 17 LOAD_FAST 0 (x) - 20 GET_ITER - >> 21 FOR_ITER 13 (to 37) - 24 STORE_FAST 2 (s) - 27 LOAD_FAST 1 (_[1]) - 30 LOAD_FAST 2 (s) - 33 LIST_APPEND - 34 JUMP_ABSOLUTE 21 - >> 37 DELETE_FAST 1 (_[1]) - - %-4d 40 LOAD_CONST 2 (1) - 43 BINARY_ADD - 44 RAISE_VARARGS 2 - >> 47 POP_TOP + 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 - %-4d 48 LOAD_CONST 0 (None) - 51 RETURN_VALUE + %-4d 40 LOAD_CONST 0 (None) + 43 RETURN_VALUE """%(bug1333982.func_code.co_firstlineno + 1, bug1333982.func_code.co_firstlineno + 2, bug1333982.func_code.co_firstlineno + 3) Modified: python/branches/tlee-ast-optimize/Lib/test/test_doctest.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_doctest.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_doctest.py Wed Jan 14 13:24:17 2009 @@ -6,6 +6,9 @@ import doctest import warnings +# NOTE: There are some additional tests relating to interaction with +# zipimport in the test_zipimport_support test module. + ###################################################################### ## Sample Objects (used by test cases) ###################################################################### @@ -369,7 +372,7 @@ >>> tests = finder.find(sample_func) >>> print tests # doctest: +ELLIPSIS - [] + [] The exact name depends on how test_doctest was invoked, so allow for leading path components. Modified: python/branches/tlee-ast-optimize/Lib/test/test_file.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_file.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_file.py Wed Jan 14 13:24:17 2009 @@ -120,9 +120,24 @@ except: self.assertEquals(self.f.__exit__(*sys.exc_info()), None) + def testReadWhenWriting(self): + self.assertRaises(IOError, self.f.read) class OtherFileTests(unittest.TestCase): + def testOpenDir(self): + this_dir = os.path.dirname(__file__) + for mode in (None, "w"): + try: + if mode: + f = open(this_dir, mode) + else: + f = open(this_dir) + except IOError as e: + self.assertEqual(e.filename, this_dir) + else: + self.fail("opening a directory didn't raise an IOError") + def testModeStrings(self): # check invalid mode strings for mode in ("", "aU", "wU+"): @@ -531,6 +546,20 @@ finally: sys.stdout = save_stdout + def test_del_stdout_before_print(self): + # Issue 4597: 'print' with no argument wasn't reporting when + # sys.stdout was deleted. + save_stdout = sys.stdout + del sys.stdout + try: + print + except RuntimeError as e: + self.assertEquals(str(e), "lost sys.stdout") + else: + self.fail("Expected RuntimeError") + finally: + sys.stdout = save_stdout + def test_main(): # Historically, these tests have been sloppy about removing TESTFN. Modified: python/branches/tlee-ast-optimize/Lib/test/test_fileio.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_fileio.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_fileio.py Wed Jan 14 13:24:17 2009 @@ -109,6 +109,7 @@ _fileio._FileIO('.', 'r') except IOError as e: self.assertNotEqual(e.errno, 0) + self.assertEqual(e.filename, ".") else: self.fail("Should have raised IOError") Modified: python/branches/tlee-ast-optimize/Lib/test/test_fractions.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_fractions.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_fractions.py Wed Jan 14 13:24:17 2009 @@ -139,6 +139,8 @@ def testFromFloat(self): self.assertRaises(TypeError, F.from_float, 3+4j) self.assertEquals((10, 1), _components(F.from_float(10))) + bigint = 1234567890123456789 + self.assertEquals((bigint, 1), _components(F.from_float(bigint))) self.assertEquals((0, 1), _components(F.from_float(-0.0))) self.assertEquals((10, 1), _components(F.from_float(10.0))) self.assertEquals((-5, 2), _components(F.from_float(-2.5))) Modified: python/branches/tlee-ast-optimize/Lib/test/test_generators.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_generators.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_generators.py Wed Jan 14 13:24:17 2009 @@ -928,6 +928,16 @@ 'f' >>> repr(g) # doctest: +ELLIPSIS '' + +Lambdas shouldn't have their usual return behavior. + +>>> x = lambda: (yield 1) +>>> list(x()) +[1] + +>>> x = lambda: ((yield 1), (yield 2)) +>>> list(x()) +[1, 2] """ # conjoin is a simple backtracking generator, named in honor of Icon's Modified: python/branches/tlee-ast-optimize/Lib/test/test_getopt.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_getopt.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_getopt.py Wed Jan 14 13:24:17 2009 @@ -124,6 +124,11 @@ self.assertEqual(opts, [('-a', ''), ('-b', '1'), ('--alpha', ''), ('--beta', '2')]) + # recognize "-" as an argument + opts, args = getopt.gnu_getopt(['-a', '-', '-b', '-'], 'ab:', []) + self.assertEqual(args, ['-']) + self.assertEqual(opts, [('-a', ''), ('-b', '-')]) + # Posix style via + opts, args = getopt.gnu_getopt(cmdline, '+ab:', ['alpha', 'beta=']) self.assertEqual(opts, [('-a', '')]) Modified: python/branches/tlee-ast-optimize/Lib/test/test_gzip.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_gzip.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_gzip.py Wed Jan 14 13:24:17 2009 @@ -6,6 +6,7 @@ from test import test_support import os import gzip +import struct data1 = """ int length=DEFAULTALLOC, err = Z_OK; @@ -160,6 +161,87 @@ self.assertEqual(f.name, self.filename) f.close() + def test_mtime(self): + mtime = 123456789 + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + fRead = gzip.GzipFile(self.filename) + dataRead = fRead.read() + self.assertEqual(dataRead, data1) + self.assert_(hasattr(fRead, 'mtime')) + self.assertEqual(fRead.mtime, mtime) + fRead.close() + + def test_metadata(self): + mtime = 123456789 + + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + + fRead = open(self.filename, 'rb') + + # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html + + idBytes = fRead.read(2) + self.assertEqual(idBytes, '\x1f\x8b') # gzip ID + + cmByte = fRead.read(1) + self.assertEqual(cmByte, '\x08') # deflate + + flagsByte = fRead.read(1) + self.assertEqual(flagsByte, '\x08') # only the FNAME flag is set + + mtimeBytes = fRead.read(4) + self.assertEqual(mtimeBytes, struct.pack(' n self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) @@ -83,6 +83,8 @@ 'Pure python version shown in the docs' pool = tuple(iterable) n = len(pool) + if r > n: + return indices = range(r) yield tuple(pool[i] for i in indices) while 1: @@ -106,9 +108,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(combinations(values, r)) - self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for c in result: @@ -119,7 +121,7 @@ self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version - self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version + self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -130,7 +132,7 @@ self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, permutations, None) # pool is not iterable self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative - self.assertRaises(ValueError, permutations, 'abc', 32) # r is too big + self.assertEqual(list(permutations('abc', 32)), []) # r > n self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None self.assertEqual(list(permutations(range(3), 2)), [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)]) @@ -140,6 +142,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = range(n) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) @@ -168,9 +172,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(permutations(values, r)) - self.assertEqual(len(result), fact(n) / fact(n-r)) # right number of perms + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r)) # right number of perms self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for p in result: @@ -178,7 +182,7 @@ self.assertEqual(len(set(p)), r) # no duplicate elements self.assert_(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version - self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version + self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: self.assertEqual(result, list(permutations(values, None))) # test r as None self.assertEqual(result, list(permutations(values))) # test default r @@ -1277,6 +1281,30 @@ ... 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 imap(next, imap(itemgetter(1), groupby(iterable, key))) + This is not part of the examples but it tests to make sure the definitions perform as purported. @@ -1339,6 +1367,38 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(combinations_with_replacement('01', 3)) +[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] + +>>> def combinations_with_replacement2(iterable, r): +... 'Alternate version that filters from product()' +... pool = tuple(iterable) +... n = len(pool) +... for indices in product(range(n), repeat=r): +... if sorted(indices) == list(indices): +... yield tuple(pool[i] for i in indices) + +>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) +True + +>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +True + +>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +True + +>>> list(unique_everseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D'] + +>>> list(unique_everseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'D'] + +>>> list(unique_justseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D', 'A', 'B'] + +>>> list(unique_justseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'A', 'D'] + """ __test__ = {'libreftest' : libreftest} Modified: python/branches/tlee-ast-optimize/Lib/test/test_logging.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_logging.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_logging.py Wed Jan 14 13:24:17 2009 @@ -18,7 +18,7 @@ """Test harness for the logging module. Run all tests. -Copyright (C) 2001-2002 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. """ import logging @@ -44,6 +44,7 @@ import time import types import unittest +import warnings import weakref @@ -885,6 +886,32 @@ if os.path.isfile(fn): os.remove(fn) +class WarningsTest(BaseTest): + def test_warnings(self): + logging.captureWarnings(True) + warnings.filterwarnings("always", category=UserWarning) + try: + file = cStringIO.StringIO() + h = logging.StreamHandler(file) + logger = logging.getLogger("py.warnings") + logger.addHandler(h) + warnings.warn("I'm warning you...") + logger.removeHandler(h) + s = file.getvalue() + h.close() + self.assertTrue(s.find("UserWarning: I'm warning you...\n") > 0) + + #See if an explicit file uses the original implementation + file = cStringIO.StringIO() + warnings.showwarning("Explicit", UserWarning, "dummy.py", 42, file, + "Dummy line") + s = file.getvalue() + file.close() + self.assertEqual(s, "dummy.py:42: UserWarning: Explicit\n Dummy line\n") + finally: + warnings.resetwarnings() + logging.captureWarnings(False) + # 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. @@ -893,7 +920,7 @@ run_unittest(BuiltinLevelsTest, BasicFilterTest, CustomLevelsAndFiltersTest, MemoryHandlerTest, ConfigFileTest, SocketHandlerTest, MemoryTest, - EncodingTest) + EncodingTest, WarningsTest) if __name__ == "__main__": test_main() Modified: python/branches/tlee-ast-optimize/Lib/test/test_long.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_long.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_long.py Wed Jan 14 13:24:17 2009 @@ -3,6 +3,7 @@ import sys import random +import math # Used for lazy formatting of failure messages class Frm(object): @@ -752,6 +753,42 @@ self.assertRaises(OverflowError, long, float('-inf')) self.assertRaises(ValueError, long, float('nan')) + def test_bit_length(self): + tiny = 1e-10 + for x in xrange(-65000, 65000): + x = long(x) + k = x.bit_length() + # Check equivalence with Python version + self.assertEqual(k, len(bin(x).lstrip('-0b'))) + # Behaviour as specified in the docs + if x != 0: + self.assert_(2**(k-1) <= abs(x) < 2**k) + else: + self.assertEqual(k, 0) + # Alternative definition: x.bit_length() == 1 + floor(log_2(x)) + if x != 0: + # When x is an exact power of 2, numeric errors can + # cause floor(log(x)/log(2)) to be one too small; for + # small x this can be fixed by adding a small quantity + # to the quotient before taking the floor. + self.assertEqual(k, 1 + math.floor( + math.log(abs(x))/math.log(2) + tiny)) + + self.assertEqual((0L).bit_length(), 0) + self.assertEqual((1L).bit_length(), 1) + self.assertEqual((-1L).bit_length(), 1) + self.assertEqual((2L).bit_length(), 2) + self.assertEqual((-2L).bit_length(), 2) + for i in [2, 3, 15, 16, 17, 31, 32, 33, 63, 64, 234]: + a = 2L**i + self.assertEqual((a-1).bit_length(), i) + self.assertEqual((1-a).bit_length(), i) + self.assertEqual((a).bit_length(), i+1) + self.assertEqual((-a).bit_length(), i+1) + self.assertEqual((a+1).bit_length(), i+1) + self.assertEqual((-a-1).bit_length(), i+1) + + def test_main(): test_support.run_unittest(LongTest) Modified: python/branches/tlee-ast-optimize/Lib/test/test_macos.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_macos.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_macos.py Wed Jan 14 13:24:17 2009 @@ -3,11 +3,66 @@ import Carbon.File from test import test_support import os +import subprocess TESTFN2 = test_support.TESTFN + '2' class TestMacOS(unittest.TestCase): + def testGetCreatorAndType(self): + if not os.path.exists('/Developer/Tools/SetFile'): + return + + try: + fp = open(test_support.TESTFN, 'w') + fp.write('\n') + fp.close() + + subprocess.call( + ['/Developer/Tools/SetFile', '-t', 'ABCD', '-c', 'EFGH', + test_support.TESTFN]) + + cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN) + self.assertEquals(tp, 'ABCD') + self.assertEquals(cr, 'EFGH') + + finally: + os.unlink(test_support.TESTFN) + + def testSetCreatorAndType(self): + if not os.path.exists('/Developer/Tools/GetFileInfo'): + return + + try: + fp = open(test_support.TESTFN, 'w') + fp.write('\n') + fp.close() + + MacOS.SetCreatorAndType(test_support.TESTFN, + 'ABCD', 'EFGH') + + cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN) + self.assertEquals(cr, 'ABCD') + self.assertEquals(tp, 'EFGH') + + data = subprocess.Popen(["/Developer/Tools/GetFileInfo", test_support.TESTFN], + stdout=subprocess.PIPE).communicate()[0] + + tp = None + cr = None + for ln in data.splitlines(): + if ln.startswith('type:'): + tp = ln.split()[-1][1:-1] + if ln.startswith('creator:'): + cr = ln.split()[-1][1:-1] + + self.assertEquals(cr, 'ABCD') + self.assertEquals(tp, 'EFGH') + + finally: + os.unlink(test_support.TESTFN) + + def testOpenRF(self): try: fp = open(test_support.TESTFN, 'w') Modified: python/branches/tlee-ast-optimize/Lib/test/test_os.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_os.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_os.py Wed Jan 14 13:24:17 2009 @@ -533,6 +533,55 @@ def test_chmod(self): self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) +class TestInvalidFD(unittest.TestCase): + singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat", + "fstatvfs", "fsync", "tcgetpgrp", "ttyname"] + def get_single(f): + def helper(self): + if getattr(os, f, None): + self.assertRaises(OSError, getattr(os, f), 10) + return helper + for f in singles: + locals()["test_"+f] = get_single(f) + + def test_isatty(self): + self.assertEqual(os.isatty(10), False) + + def test_closerange(self): + self.assertEqual(os.closerange(10, 20), None) + + def test_dup2(self): + self.assertRaises(OSError, os.dup2, 10, 20) + + def test_fchmod(self): + if hasattr(os, "fchmod"): + self.assertRaises(OSError, os.fchmod, 10, 0) + + def test_fchown(self): + if hasattr(os, "fchown"): + self.assertRaises(OSError, os.fchmod, 10, -1, -1) + + def test_fpathconf(self): + if hasattr(os, "fpathconf"): + self.assertRaises(OSError, os.fpathconf, 10, "foo") + + def test_ftruncate(self): + if hasattr(os, "ftruncate"): + self.assertRaises(OSError, os.ftruncate, 10, 0) + + def test_lseek(self): + self.assertRaises(OSError, os.lseek, 10, 0, 0) + + def test_read(self): + self.assertRaises(OSError, os.read, 10, 1) + + def test_tcsetpgrpt(self): + if hasattr(os, "tcsetpgrp"): + self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + + def test_write(self): + self.assertRaises(OSError, os.write, 10, " ") + if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): pass @@ -547,7 +596,8 @@ MakedirTests, DevNullTests, URandomTests, - Win32ErrorTests + Win32ErrorTests, + TestInvalidFD ) if __name__ == "__main__": Modified: python/branches/tlee-ast-optimize/Lib/test/test_parser.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_parser.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_parser.py Wed Jan 14 13:24:17 2009 @@ -200,6 +200,16 @@ self.check_suite("with open('x'): pass\n") self.check_suite("with open('x') as f: pass\n") + def test_try_stmt(self): + self.check_suite("try: pass\nexcept: pass\n") + self.check_suite("try: pass\nfinally: pass\n") + self.check_suite("try: pass\nexcept A: pass\nfinally: pass\n") + self.check_suite("try: pass\nexcept A: pass\nexcept: pass\n" + "finally: pass\n") + self.check_suite("try: pass\nexcept: pass\nelse: pass\n") + self.check_suite("try: pass\nexcept: pass\nelse: pass\n" + "finally: pass\n") + def test_position(self): # An absolutely minimal test of position information. Better # tests would be a big project. Modified: python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py Wed Jan 14 13:24:17 2009 @@ -126,6 +126,16 @@ w.reset() self.assertWarning(meth >= func, w, expected) + def test_frame_attributes(self): + template = "%s has been removed in 3.x" + f = sys._getframe(0) + for attr in ("f_exc_traceback", "f_exc_value", "f_exc_type"): + expected = template % attr + with check_warnings() as w: + self.assertWarning(getattr(f, attr), w, expected) + w.reset() + self.assertWarning(setattr(f, attr, None), w, expected) + def test_sort_cmp_arg(self): expected = "the cmp argument is not supported in 3.x" lst = range(5) Modified: python/branches/tlee-ast-optimize/Lib/test/test_set.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_set.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_set.py Wed Jan 14 13:24:17 2009 @@ -1,6 +1,7 @@ import unittest from test import test_support -from weakref import proxy +import gc +import weakref import operator import copy import pickle @@ -221,7 +222,7 @@ self.failIf(set('cbs').issuperset('a')) def test_pickling(self): - for i in (0, 1, 2): + for i in range(pickle.HIGHEST_PROTOCOL + 1): p = pickle.dumps(self.s, i) dup = pickle.loads(p) self.assertEqual(self.s, dup, "%s != %s" % (self.s, dup)) @@ -322,6 +323,18 @@ self.assertEqual(sum(elem.hash_count for elem in d), n) self.assertEqual(d3, dict.fromkeys(d, 123)) + def test_container_iterator(self): + # Bug #3680: tp_traverse was not implemented for set iterator object + class C(object): + pass + obj = C() + ref = weakref.ref(obj) + container = set([obj, 1]) + obj.x = iter(container) + del obj, container + gc.collect() + self.assert_(ref() is None, "Cycle was not collected") + class TestSet(TestJointOps): thetype = set @@ -538,7 +551,7 @@ def test_weakref(self): s = self.thetype('gallahad') - p = proxy(s) + p = weakref.proxy(s) self.assertEqual(str(p), str(s)) s = None self.assertRaises(ReferenceError, str, p) Modified: python/branches/tlee-ast-optimize/Lib/test/test_struct.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_struct.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_struct.py Wed Jan 14 13:24:17 2009 @@ -2,6 +2,8 @@ import unittest import struct import warnings +warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated", + DeprecationWarning) from functools import wraps from test.test_support import TestFailed, verbose, run_unittest @@ -461,6 +463,11 @@ self.check_float_coerce(endian + fmt, 1.0) self.check_float_coerce(endian + fmt, 1.5) + def test_issue4228(self): + # Packing a long may yield either 32 or 64 bits + x = struct.pack('L', -1)[:4] + self.assertEqual(x, '\xff'*4) + def test_unpack_from(self): test_string = 'abcd01234' fmt = '4s' Modified: python/branches/tlee-ast-optimize/Lib/test/test_subprocess.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_subprocess.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_subprocess.py Wed Jan 14 13:24:17 2009 @@ -72,6 +72,40 @@ else: self.fail("Expected CalledProcessError") + def test_check_output(self): + # check_output() function with zero return code + output = subprocess.check_output( + [sys.executable, "-c", "print 'BDFL'"]) + self.assertTrue('BDFL' in output) + + def test_check_output_nonzero(self): + # check_call() function with non-zero return code + try: + subprocess.check_output( + [sys.executable, "-c", "import sys; sys.exit(5)"]) + except subprocess.CalledProcessError, e: + self.assertEqual(e.returncode, 5) + else: + self.fail("Expected CalledProcessError") + + def test_check_output_stderr(self): + # check_output() function stderr redirected to stdout + output = subprocess.check_output( + [sys.executable, "-c", "import sys; sys.stderr.write('BDFL')"], + stderr=subprocess.STDOUT) + self.assertTrue('BDFL' in output) + + def test_check_output_stdout_arg(self): + # check_output() function stderr redirected to stdout + try: + output = subprocess.check_output( + [sys.executable, "-c", "print 'will not be run'"], + stdout=sys.stdout) + except ValueError, e: + self.assertTrue('stdout' in e.args[0]) + else: + self.fail("Expected ValueError when stdout arg supplied.") + def test_call_kwargs(self): # call() function with keyword args newenv = os.environ.copy() Modified: python/branches/tlee-ast-optimize/Lib/test/test_sys.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_sys.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_sys.py Wed Jan 14 13:24:17 2009 @@ -631,8 +631,8 @@ # slice check(slice(1), size(h + '3P')) # str - check('', size(vh + 'lic')) - check('abc', size(vh + 'lic') + 3*self.c) + check('', struct.calcsize(vh + 'li') + 1) + check('abc', struct.calcsize(vh + 'li') + 1 + 3*self.c) # super check(super(int), size(h + '3P')) # tuple Modified: python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py Wed Jan 14 13:24:17 2009 @@ -256,17 +256,14 @@ def test_extractall(self): # Test if extractall() correctly restores directory permissions # and times (see issue1735). - if sys.platform == "win32": - # Win32 has no support for utime() on directories or - # fine grained permissions. - return - tar = tarfile.open(tarname, encoding="iso8859-1") directories = [t for t in tar if t.isdir()] tar.extractall(TEMPDIR, directories) for tarinfo in directories: path = os.path.join(TEMPDIR, tarinfo.name) - self.assertEqual(tarinfo.mode & 0777, os.stat(path).st_mode & 0777) + if sys.platform != "win32": + # Win32 has no support for fine grained permissions. + self.assertEqual(tarinfo.mode & 0777, os.stat(path).st_mode & 0777) self.assertEqual(tarinfo.mtime, os.path.getmtime(path)) tar.close() Modified: python/branches/tlee-ast-optimize/Lib/test/test_textwrap.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_textwrap.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_textwrap.py Wed Jan 14 13:24:17 2009 @@ -174,7 +174,7 @@ text = ("Python 1.0.0 was released on 1994-01-26. Python 1.0.1 was\n" "released on 1994-02-15.") - self.check_wrap(text, 30, ['Python 1.0.0 was released on', + self.check_wrap(text, 35, ['Python 1.0.0 was released on', '1994-01-26. Python 1.0.1 was', 'released on 1994-02-15.']) self.check_wrap(text, 40, ['Python 1.0.0 was released on 1994-01-26.', @@ -353,6 +353,14 @@ otext = self.wrapper.fill(text) assert isinstance(otext, unicode) + def test_no_split_at_umlaut(self): + text = u"Die Empf\xe4nger-Auswahl" + self.check_wrap(text, 13, [u"Die", u"Empf\xe4nger-", u"Auswahl"]) + + def test_umlaut_followed_by_dash(self): + text = u"aa \xe4\xe4-\xe4\xe4" + self.check_wrap(text, 7, [u"aa \xe4\xe4-", u"\xe4\xe4"]) + def test_split(self): # Ensure that the standard _split() method works as advertised # in the comments Modified: python/branches/tlee-ast-optimize/Lib/test/test_unittest.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_unittest.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_unittest.py Wed Jan 14 13:24:17 2009 @@ -2284,6 +2284,43 @@ self.assertRaises(AssertionError, self.failIfAlmostEqual, 0, .1+.1j, places=0) + def test_assertRaises(self): + def _raise(e): + raise e + self.assertRaises(KeyError, _raise, KeyError) + self.assertRaises(KeyError, _raise, KeyError("key")) + try: + self.assertRaises(KeyError, lambda: None) + except AssertionError as e: + self.assert_("KeyError not raised" in e, str(e)) + else: + self.fail("assertRaises() didn't fail") + try: + self.assertRaises(KeyError, _raise, ValueError) + except ValueError: + pass + else: + self.fail("assertRaises() didn't let exception pass through") + with self.assertRaises(KeyError): + raise KeyError + with self.assertRaises(KeyError): + raise KeyError("key") + try: + with self.assertRaises(KeyError): + pass + except AssertionError as e: + self.assert_("KeyError not raised" in e, str(e)) + else: + self.fail("assertRaises() didn't fail") + try: + with self.assertRaises(KeyError): + raise ValueError + except ValueError: + pass + else: + self.fail("assertRaises() didn't let exception pass through") + + ###################################################################### ## Main ###################################################################### Modified: python/branches/tlee-ast-optimize/Lib/test/test_urllib2.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_urllib2.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_urllib2.py Wed Jan 14 13:24:17 2009 @@ -1104,6 +1104,51 @@ else: self.assert_(False) +class RequestTests(unittest.TestCase): + + def setUp(self): + self.get = urllib2.Request("http://www.python.org/~jeremy/") + self.post = urllib2.Request("http://www.python.org/~jeremy/", + "data", + headers={"X-Test": "test"}) + + def test_method(self): + self.assertEqual("POST", self.post.get_method()) + self.assertEqual("GET", self.get.get_method()) + + def test_add_data(self): + self.assert_(not self.get.has_data()) + self.assertEqual("GET", self.get.get_method()) + self.get.add_data("spam") + self.assert_(self.get.has_data()) + self.assertEqual("POST", self.get.get_method()) + + def test_get_full_url(self): + self.assertEqual("http://www.python.org/~jeremy/", + self.get.get_full_url()) + + def test_selector(self): + self.assertEqual("/~jeremy/", self.get.get_selector()) + req = urllib2.Request("http://www.python.org/") + self.assertEqual("/", req.get_selector()) + + def test_get_type(self): + self.assertEqual("http", self.get.get_type()) + + def test_get_host(self): + self.assertEqual("www.python.org", self.get.get_host()) + + def test_get_host_unquote(self): + req = urllib2.Request("http://www.%70ython.org/") + self.assertEqual("www.python.org", req.get_host()) + + def test_proxy(self): + self.assert_(not self.get.has_proxy()) + self.get.set_proxy("www.perl.org", "http") + self.assert_(self.get.has_proxy()) + self.assertEqual("www.python.org", self.get.get_origin_req_host()) + self.assertEqual("www.perl.org", self.get.get_host()) + def test_main(verbose=None): from test import test_urllib2 @@ -1112,7 +1157,8 @@ tests = (TrivialTests, OpenerDirectorTests, HandlerTests, - MiscTests) + MiscTests, + RequestTests) test_support.run_unittest(*tests) if __name__ == "__main__": Modified: python/branches/tlee-ast-optimize/Lib/test/test_urllib2_localnet.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_urllib2_localnet.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_urllib2_localnet.py Wed Jan 14 13:24:17 2009 @@ -474,7 +474,7 @@ # domain will be spared to serve its defined # purpose. # urllib2.urlopen, "http://www.sadflkjsasadf.com/") - urllib2.urlopen, "http://www.python.invalid./") + urllib2.urlopen, "http://sadflkjsasf.i.nvali.d/") def test_main(): Modified: python/branches/tlee-ast-optimize/Lib/test/test_urllibnet.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_urllibnet.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_urllibnet.py Wed Jan 14 13:24:17 2009 @@ -137,7 +137,7 @@ # domain will be spared to serve its defined # purpose. # urllib.urlopen, "http://www.sadflkjsasadf.com/") - urllib.urlopen, "http://www.python.invalid./") + urllib.urlopen, "http://sadflkjsasf.i.nvali.d/") class urlretrieveNetworkTests(unittest.TestCase): """Tests urllib.urlretrieve using the network.""" Modified: python/branches/tlee-ast-optimize/Lib/test/test_with.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_with.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_with.py Wed Jan 14 13:24:17 2009 @@ -503,6 +503,36 @@ self.assertRaises(GeneratorExit, shouldThrow) + def testErrorsInBool(self): + # issue4589: __exit__ return code may raise an exception + # when looking at its truth value. + + class cm(object): + def __init__(self, bool_conversion): + class Bool: + def __nonzero__(self): + return bool_conversion() + self.exit_result = Bool() + def __enter__(self): + return 3 + def __exit__(self, a, b, c): + return self.exit_result + + def trueAsBool(): + with cm(lambda: True): + self.fail("Should NOT see this") + trueAsBool() + + def falseAsBool(): + with cm(lambda: False): + self.fail("Should raise") + self.assertRaises(AssertionError, falseAsBool) + + def failAsBool(): + with cm(lambda: 1//0): + self.fail("Should NOT see this") + self.assertRaises(ZeroDivisionError, failAsBool) + class NonLocalFlowControlTestCase(unittest.TestCase): Modified: python/branches/tlee-ast-optimize/Lib/test/test_xmlrpc.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_xmlrpc.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_xmlrpc.py Wed Jan 14 13:24:17 2009 @@ -655,7 +655,7 @@ def getvalue(self): return self.data.getvalue() - def makefile(self, x, y): + def makefile(self, x='r', y=-1): raise RuntimeError class FakeTransport(xmlrpclib.Transport): Modified: python/branches/tlee-ast-optimize/Lib/test/test_zipfile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_zipfile.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_zipfile.py Wed Jan 14 13:24:17 2009 @@ -634,20 +634,49 @@ def testIsZipErroneousFile(self): # This test checks that the is_zipfile function correctly identifies # a file that is not a zip file - fp = open(TESTFN, "w") - fp.write("this is not a legal zip file\n") - fp.close() + + # - passing a filename + with open(TESTFN, "w") as fp: + fp.write("this is not a legal zip file\n") chk = zipfile.is_zipfile(TESTFN) - self.assert_(chk is False) + self.assert_(not chk) + # - passing a file object + with open(TESTFN, "rb") as fp: + chk = zipfile.is_zipfile(fp) + self.assert_(not chk) + # - passing a file-like object + fp = StringIO() + fp.write("this is not a legal zip file\n") + chk = zipfile.is_zipfile(fp) + self.assert_(not chk) + fp.seek(0,0) + chk = zipfile.is_zipfile(fp) + self.assert_(not chk) def testIsZipValidFile(self): # This test checks that the is_zipfile function correctly identifies # a file that is a zip file + + # - passing a filename zipf = zipfile.ZipFile(TESTFN, mode="w") zipf.writestr("foo.txt", "O, for a Muse of Fire!") zipf.close() chk = zipfile.is_zipfile(TESTFN) - self.assert_(chk is True) + self.assert_(chk) + # - passing a file object + with open(TESTFN, "rb") as fp: + chk = zipfile.is_zipfile(fp) + self.assert_(chk) + fp.seek(0,0) + zip_contents = fp.read() + # - passing a file-like object + fp = StringIO() + fp.write(zip_contents) + chk = zipfile.is_zipfile(fp) + self.assert_(chk) + fp.seek(0,0) + chk = zipfile.is_zipfile(fp) + self.assert_(chk) def testNonExistentFileRaisesIOError(self): # make sure we don't raise an AttributeError when a partially-constructed Modified: python/branches/tlee-ast-optimize/Lib/test/test_zipimport.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_zipimport.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_zipimport.py Wed Jan 14 13:24:17 2009 @@ -214,16 +214,24 @@ zi = zipimport.zipimporter(TEMP_ZIP) self.assertEquals(zi.archive, TEMP_ZIP) self.assertEquals(zi.is_package(TESTPACK), True) - zi.load_module(TESTPACK) + mod = zi.load_module(TESTPACK) + self.assertEquals(zi._get_filename(TESTPACK), mod.__file__) self.assertEquals(zi.is_package(packdir + '__init__'), False) self.assertEquals(zi.is_package(packdir + TESTPACK2), True) self.assertEquals(zi.is_package(packdir2 + TESTMOD), False) - mod_name = packdir2 + TESTMOD - mod = __import__(module_path_to_dotted_name(mod_name)) + mod_path = packdir2 + TESTMOD + mod_name = module_path_to_dotted_name(mod_path) + pkg = __import__(mod_name) + mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK), None) - self.assertEquals(zi.get_source(mod_name), None) + self.assertEquals(zi.get_source(mod_path), None) + 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__) # test prefix and archivepath members zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK) @@ -251,15 +259,23 @@ self.assertEquals(zi.archive, TEMP_ZIP) self.assertEquals(zi.prefix, packdir) self.assertEquals(zi.is_package(TESTPACK2), True) - zi.load_module(TESTPACK2) + mod = zi.load_module(TESTPACK2) + 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) - mod_name = TESTPACK2 + os.sep + TESTMOD - mod = __import__(module_path_to_dotted_name(mod_name)) + mod_path = TESTPACK2 + os.sep + TESTMOD + mod_name = module_path_to_dotted_name(mod_path) + pkg = __import__(mod_name) + mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK2), None) - self.assertEquals(zi.get_source(mod_name), None) + self.assertEquals(zi.get_source(mod_path), None) + 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__) finally: z.close() os.remove(TEMP_ZIP) Modified: python/branches/tlee-ast-optimize/Lib/textwrap.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/textwrap.py (original) +++ python/branches/tlee-ast-optimize/Lib/textwrap.py Wed Jan 14 13:24:17 2009 @@ -17,7 +17,7 @@ #except NameError: # (True, False) = (1, 0) -__all__ = ['TextWrapper', 'wrap', 'fill'] +__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent'] # Hardcode the recognized whitespace characters to the US-ASCII # whitespace characters. The main reason for doing this is that in @@ -86,7 +86,7 @@ # (after stripping out empty strings). wordsep_re = re.compile( r'(\s+|' # any whitespace - r'[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|' # hyphenated words + r'[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|' # hyphenated words r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash # This less funky little regex just split on recognized spaces. E.g. @@ -124,6 +124,13 @@ self.drop_whitespace = drop_whitespace self.break_on_hyphens = break_on_hyphens + # recompile the regexes for Unicode mode -- done in this clumsy way for + # backwards compatibility because it's rather common to monkey-patch + # the TextWrapper class' wordsep_re attribute. + self.wordsep_re_uni = re.compile(self.wordsep_re.pattern, re.U) + self.wordsep_simple_re_uni = re.compile( + self.wordsep_simple_re.pattern, re.U) + # -- Private methods ----------------------------------------------- # (possibly useful for subclasses to override) @@ -160,10 +167,17 @@ 'use', ' ', 'the', ' ', '-b', ' ', option!' otherwise. """ - if self.break_on_hyphens is True: - chunks = self.wordsep_re.split(text) + if isinstance(text, unicode): + if self.break_on_hyphens: + pat = self.wordsep_re_uni + else: + pat = self.wordsep_simple_re_uni else: - chunks = self.wordsep_simple_re.split(text) + if self.break_on_hyphens: + pat = self.wordsep_re + else: + pat = self.wordsep_simple_re + chunks = pat.split(text) chunks = filter(None, chunks) # remove empty chunks return chunks Modified: python/branches/tlee-ast-optimize/Lib/unittest.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/unittest.py (original) +++ python/branches/tlee-ast-optimize/Lib/unittest.py Wed Jan 14 13:24:17 2009 @@ -67,16 +67,6 @@ ############################################################################## # Backward compatibility ############################################################################## -if sys.version_info[:2] < (2, 2): - def isinstance(obj, clsinfo): - import __builtin__ - if type(clsinfo) in (tuple, list): - for cls in clsinfo: - if cls is type: cls = types.ClassType - if __builtin__.isinstance(obj, cls): - return 1 - return 0 - else: return __builtin__.isinstance(obj, clsinfo) def _CmpToKey(mycmp): 'Convert a cmp= function into a key= function' @@ -91,15 +81,12 @@ # Test framework core ############################################################################## -# All classes defined herein are 'new-style' classes, allowing use of 'super()' -__metaclass__ = type - def _strclass(cls): return "%s.%s" % (cls.__module__, cls.__name__) __unittest = 1 -class TestResult: +class TestResult(object): """Holder for test result information. Test results are automatically managed by the TestCase and TestSuite @@ -174,7 +161,26 @@ (_strclass(self.__class__), self.testsRun, len(self.errors), len(self.failures)) -class TestCase: +class AssertRaisesContext(object): + def __init__(self, expected, test_case): + self.expected = expected + self.failureException = test_case.failureException + def __enter__(self): + pass + def __exit__(self, exc_type, exc_value, traceback): + if exc_type is None: + try: + exc_name = self.expected.__name__ + except AttributeError: + exc_name = str(self.expected) + raise self.failureException( + "{0} not raised".format(exc_name)) + if issubclass(exc_type, self.expected): + return True + # Let unexpected exceptions skip through + return False + +class TestCase(object): """A class whose instances are single test cases. By default, the test code itself should be placed in a method named @@ -212,8 +218,8 @@ testMethod = getattr(self, methodName) self._testMethodDoc = testMethod.__doc__ except AttributeError: - raise ValueError, "no such test method in %s: %s" % \ - (self.__class__, methodName) + raise ValueError("no such test method in %s: %s" % \ + (self.__class__, methodName)) def setUp(self): "Hook method for setting up the test fixture before exercising it." @@ -268,9 +274,7 @@ try: try: self.setUp() - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) return @@ -280,16 +284,12 @@ ok = True except self.failureException: result.addFailure(self, self._exc_info()) - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) try: self.tearDown() - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) ok = False if ok: result.addSuccess(self) @@ -314,48 +314,49 @@ def fail(self, msg=None): """Fail immediately, with the given message.""" - raise self.failureException, msg + raise self.failureException(msg) def failIf(self, expr, msg=None): "Fail the test if the expression is true." - if expr: raise self.failureException, msg + if expr: raise self.failureException(msg) def failUnless(self, expr, msg=None): """Fail the test unless the expression is true.""" - if not expr: raise self.failureException, msg + if not expr: raise self.failureException(msg) - def failUnlessRaises(self, excClass, callableObj, *args, **kwargs): + def failUnlessRaises(self, excClass, callableObj=None, *args, **kwargs): """Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception. + + If called with callableObj omitted or None, will return a + context object used like this:: + + with self.failUnlessRaises(some_error_class): + do_something() """ - try: + context = AssertRaisesContext(excClass, self) + if callableObj is None: + return context + with context: callableObj(*args, **kwargs) - except excClass: - return - else: - if hasattr(excClass,'__name__'): excName = excClass.__name__ - else: excName = str(excClass) - raise self.failureException, "%s not raised" % excName def failUnlessEqual(self, first, second, msg=None): """Fail if the two objects are unequal as determined by the '==' operator. """ if not first == second: - raise self.failureException, \ - (msg or '%r != %r' % (first, second)) + raise self.failureException(msg or '%r != %r' % (first, second)) def failIfEqual(self, first, second, msg=None): """Fail if the two objects are equal as determined by the '==' operator. """ if first == second: - raise self.failureException, \ - (msg or '%r == %r' % (first, second)) + raise self.failureException(msg or '%r == %r' % (first, second)) def failUnlessAlmostEqual(self, first, second, places=7, msg=None): """Fail if the two objects are unequal as determined by their @@ -366,8 +367,8 @@ as significant digits (measured from the most signficant digit). """ if round(abs(second-first), places) != 0: - raise self.failureException, \ - (msg or '%r != %r within %r places' % (first, second, places)) + raise self.failureException( + msg or '%r != %r within %r places' % (first, second, places)) def failIfAlmostEqual(self, first, second, places=7, msg=None): """Fail if the two objects are equal as determined by their @@ -378,8 +379,8 @@ as significant digits (measured from the most signficant digit). """ if round(abs(second-first), places) == 0: - raise self.failureException, \ - (msg or '%r == %r within %r places' % (first, second, places)) + raise self.failureException( + msg or '%r == %r within %r places' % (first, second, places)) # Synonyms for assertion methods @@ -399,7 +400,7 @@ -class TestSuite: +class TestSuite(object): """A test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. @@ -532,7 +533,7 @@ # Locating and loading tests ############################################################################## -class TestLoader: +class TestLoader(object): """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ @@ -583,12 +584,12 @@ for part in parts: parent, obj = obj, getattr(obj, part) - if type(obj) == types.ModuleType: + if isinstance(obj, types.ModuleType): return self.loadTestsFromModule(obj) elif (isinstance(obj, (type, types.ClassType)) and issubclass(obj, TestCase)): return self.loadTestsFromTestCase(obj) - elif (type(obj) == types.UnboundMethodType and + elif (isinstance(obj, types.UnboundMethodType) and isinstance(parent, (type, types.ClassType)) and issubclass(parent, TestCase)): return TestSuite([parent(obj.__name__)]) @@ -653,7 +654,7 @@ # Text UI ############################################################################## -class _WritelnDecorator: +class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream @@ -732,7 +733,7 @@ self.stream.writeln("%s" % err) -class TextTestRunner: +class TextTestRunner(object): """A test runner class that displays results in textual form. It prints out the names of tests as they are run, errors as they @@ -778,7 +779,7 @@ # Facilities for running tests from the command line ############################################################################## -class TestProgram: +class TestProgram(object): """A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. """ @@ -800,7 +801,7 @@ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=defaultTestLoader): - if type(module) == type(''): + if isinstance(module, basestring): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) Modified: python/branches/tlee-ast-optimize/Lib/urllib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/urllib.py (original) +++ python/branches/tlee-ast-optimize/Lib/urllib.py Wed Jan 14 13:24:17 2009 @@ -335,9 +335,7 @@ if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) - h.endheaders() - if data is not None: - h.send(data) + h.endheaders(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == -1: @@ -430,9 +428,7 @@ if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) - h.endheaders() - if data is not None: - h.send(data) + h.endheaders(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == -1: Modified: python/branches/tlee-ast-optimize/Lib/urllib2.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/urllib2.py (original) +++ python/branches/tlee-ast-optimize/Lib/urllib2.py Wed Jan 14 13:24:17 2009 @@ -1100,7 +1100,10 @@ (name.title(), val) for name, val in headers.items()) try: h.request(req.get_method(), req.get_selector(), req.data, headers) - r = h.getresponse() + try: + r = h.getresponse(buffering=True) + except TypeError: #buffering kw not supported + r = h.getresponse() except socket.error, err: # XXX what error? raise URLError(err) Modified: python/branches/tlee-ast-optimize/Lib/xmlrpclib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/xmlrpclib.py (original) +++ python/branches/tlee-ast-optimize/Lib/xmlrpclib.py Wed Jan 14 13:24:17 2009 @@ -1234,7 +1234,7 @@ self.send_user_agent(h) self.send_content(h, request_body) - errcode, errmsg, headers = h.getreply() + errcode, errmsg, headers = h.getreply(buffering=True) if errcode != 200: raise ProtocolError( @@ -1245,12 +1245,7 @@ self.verbose = verbose - try: - sock = h._conn.sock - except AttributeError: - sock = None - - return self._parse_response(h.getfile(), sock) + return self.parse_response(h.getfile()) ## # Create parser. @@ -1355,29 +1350,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/tlee-ast-optimize/Lib/zipfile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/zipfile.py (original) +++ python/branches/tlee-ast-optimize/Lib/zipfile.py Wed Jan 14 13:24:17 2009 @@ -128,18 +128,30 @@ _CD64_DIRECTORY_SIZE = 8 _CD64_OFFSET_START_CENTDIR = 9 -def is_zipfile(filename): - """Quickly see if file is a ZIP file by checking the magic number.""" +def _check_zipfile(fp): try: - fpin = open(filename, "rb") - endrec = _EndRecData(fpin) - fpin.close() - if endrec: - return True # file has correct magic number + if _EndRecData(fp): + return True # file has correct magic number except IOError: pass return False +def is_zipfile(filename): + """Quickly see if a file is a ZIP file by checking the magic number. + + The filename argument may be a file or file-like object too. + """ + result = False + try: + if hasattr(filename, "read"): + result = _check_zipfile(fp=filename) + else: + with open(filename, "rb") as fp: + result = _check_zipfile(fp) + except IOError: + pass + return result + def _EndRecData64(fpin, offset, endrec): """ Read the ZIP64 end-of-archive records and use that to update endrec Modified: python/branches/tlee-ast-optimize/Mac/IDLE/Makefile.in ============================================================================== --- python/branches/tlee-ast-optimize/Mac/IDLE/Makefile.in (original) +++ python/branches/tlee-ast-optimize/Mac/IDLE/Makefile.in Wed Jan 14 13:24:17 2009 @@ -29,10 +29,10 @@ install: IDLE.app $(srcdir)/config-main.def $(srcdir)/config-extensions.def test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" - cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" + /bin/cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" + /bin/cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" clean: rm -rf IDLE.app Modified: python/branches/tlee-ast-optimize/Mac/Modules/MacOS.c ============================================================================== --- python/branches/tlee-ast-optimize/Mac/Modules/MacOS.c (original) +++ python/branches/tlee-ast-optimize/Mac/Modules/MacOS.c Wed Jan 14 13:24:17 2009 @@ -30,6 +30,9 @@ #include #include +#include /* for ntohl, htonl */ + + #ifndef HAVE_OSX105_SDK typedef SInt16 FSIORefNum; #endif @@ -310,6 +313,10 @@ if ((err = FSpGetFInfo(&fss, &info)) != noErr) { return PyErr_Mac(MacOS_Error, err); } + + info.fdCreator = ntohl(info.fdCreator); + info.fdType = ntohl(info.fdType); + creator = PyString_FromStringAndSize( (char *)&info.fdCreator, 4); type = PyString_FromStringAndSize((char *)&info.fdType, 4); @@ -341,6 +348,8 @@ } finfo = (FileInfo*)&(cataloginfo.finderInfo); + finfo->fileCreator = ntohl(finfo->fileCreator); + finfo->fileType = ntohl(finfo->fileType); creator = PyString_FromStringAndSize((char*)&(finfo->fileCreator), 4); type = PyString_FromStringAndSize((char*)&(finfo->fileType), 4); Modified: python/branches/tlee-ast-optimize/Mac/PythonLauncher/Makefile.in ============================================================================== --- python/branches/tlee-ast-optimize/Mac/PythonLauncher/Makefile.in (original) +++ python/branches/tlee-ast-optimize/Mac/PythonLauncher/Makefile.in Wed Jan 14 13:24:17 2009 @@ -29,7 +29,7 @@ install: Python\ Launcher.app test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" + /bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" clean: Modified: python/branches/tlee-ast-optimize/Makefile.pre.in ============================================================================== --- python/branches/tlee-ast-optimize/Makefile.pre.in (original) +++ python/branches/tlee-ast-optimize/Makefile.pre.in Wed Jan 14 13:24:17 2009 @@ -265,7 +265,6 @@ Python/getargs.o \ Python/getcompiler.o \ Python/getcopyright.o \ - Python/getmtime.o \ Python/getplatform.o \ Python/getversion.o \ Python/graminit.o \ @@ -415,10 +414,14 @@ if test $(INSTSONAME) != $(LDLIBRARY); then \ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ - else\ + else \ $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi +libpython$(VERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) @@ -562,6 +565,9 @@ Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ $(STRINGLIB_HEADERS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \ + $(STRINGLIB_HEADERS) + Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \ $(STRINGLIB_HEADERS) @@ -582,6 +588,7 @@ Include/ast.h \ Include/bitset.h \ Include/boolobject.h \ + Include/bytearrayobject.h \ Include/bytes_methods.h \ Include/bytesobject.h \ Include/bufferobject.h \ @@ -769,13 +776,13 @@ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) - if test -f libpython$(VERSION)$(SO); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ + if test -f $(LDLIBRARY); then \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ - if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ - (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ @@ -906,7 +913,7 @@ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(BUILDEXE)"; \ - cd $(srcdir)/Lib/$(PLATDIR); ./regen + cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) @@ -1069,7 +1076,7 @@ # This installs the Demos and Tools into the applications directory. # It is not part of a normal frameworkinstall frameworkinstallextras: - cd Mac && Make installextras DESTDIR="$(DESTDIR)" + cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)" # This installs a few of the useful scripts in Tools/scripts scriptsinstall: Modified: python/branches/tlee-ast-optimize/Misc/ACKS ============================================================================== --- python/branches/tlee-ast-optimize/Misc/ACKS (original) +++ python/branches/tlee-ast-optimize/Misc/ACKS Wed Jan 14 13:24:17 2009 @@ -84,6 +84,7 @@ Sebastian Boving Monty Brandenberg Georg Brandl +Christopher Brannon Terrence Brannon Dave Brennan Tom Bridgman @@ -178,6 +179,7 @@ Quinn Dunkan Robin Dunn Luke Dunstan +Virgil Dupras Andy Dustman Gary Duzan Eugene Dvurechenski @@ -245,6 +247,7 @@ Harry Henry Gebel Marius Gedminas Thomas Gellekum +Gabriel Genellina Christos Georgiou Ben Gertzfield Dinu Gherman @@ -312,6 +315,7 @@ Naofumi Honda Jeffrey Honig Rob Hooft +Michiel de Hoon Brian Hooper Randall Hopper Nadav Horesh @@ -343,6 +347,7 @@ Flemming Kj?r Jensen Jiba Orjan Johansen +Fredrik Johansson Gregory K. Johnson Simon Johnston Evan Jones @@ -371,6 +376,7 @@ Taek Joo Kim Paul Kippes Steve Kirsch +Sebastian Kirsche Ron Klatchko Bastian Kleineidam Bob Kline @@ -426,6 +432,7 @@ Jason Lowe Tony Lownds Ray Loyzaga +Lukas Lueg Loren Luke Fredrik Lundh Mark Lutz Modified: python/branches/tlee-ast-optimize/Misc/NEWS ============================================================================== --- python/branches/tlee-ast-optimize/Misc/NEWS (original) +++ python/branches/tlee-ast-optimize/Misc/NEWS Wed Jan 14 13:24:17 2009 @@ -12,14 +12,87 @@ Core and Builtins ----------------- +- Issue #4807: Port the _winreg module to Windows CE. + +- 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. + +- Issue #3720: Fix a crash when an iterator modifies its class and removes its + __next__ method. + +- Issue #4893: Use NT threading on CE. + +- Issue #4915: Port sysmodule to Windows CE. + +- 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. + +- Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. + +- Issue #1180193: When importing a module from a .pyc (or .pyo) file with + an existing .py counterpart, override the co_filename attributes of all + code objects if the original filename is obsolete (which can happen if the + file has been renamed, moved, or if it is accessed through different paths). + Patch by Ziga Seilnacht and Jean-Paul Calderone. + +- Issue #4075: Use OutputDebugStringW in Py_FatalError. + +- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open + file with `str' filename on Windows. + +- Issue #3680: Reference cycles created through a dict, set or deque iterator + did not get collected. + +- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types + where the tp_hash and tp_dict slots are both NULL. + +- Issue #4764: With io.open, IOError.filename is set when trying to open a + directory on POSIX systems. + +- Issue #4764: IOError.filename is set when trying to open a directory on POSIX + systems. + +- Issue #4759: None is now allowed as the first argument of + bytearray.translate(). It was always allowed for bytes.translate(). + +- Added test case to ensure attempts to read from a file opened for writing + fail. + +- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always + print elapsed times, not only when some objects are uncollectable / + unreachable. Original patch by Neil Schemenauer. + +- Issue #3439: Add a bit_length method to int and long. + +- Issue #2183: Simplify and optimize bytecode for list comprehensions. + Original patch by Neal Norwitz. + +- Issue #4597: Fixed exception handling when the __exit__ function of a + context manager returns a value that cannot be converted to a bool. + +- Issue #4597: Fixed several opcodes that weren't always propagating + exceptions. + +- Issue #4445: Replace "sizeof(PyStringObject)" with + "offsetof(PyStringObject, ob_sval) + 1" when allocating memory for + str instances. On a typical machine this saves 3 bytes of memory + (on average) per string allocation. + - Issue #3996: On Windows, the PyOS_CheckStack function would cause the interpreter to abort ("Fatal Python error: Could not reset the stack!") instead of throwing a MemoryError. +- Issue #3689: The list reversed iterator now supports __length_hint__ + instead of __len__. Behavior now matches other reversed iterators. + - Issue #4367: Python would segfault during compiling when the unicodedata module couldn't be imported and \N escapes were present. -- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` +- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` method on file objects with closefd=False. The file descriptor is still kept open but the file object behaves like a closed file. The ``FileIO`` object also got a new readonly attribute ``closefd``. @@ -54,9 +127,136 @@ KeyError would always report the empty frozenset([]) as the missing key. Now it correctly refers to the initial element. +- Issue #4509: Various issues surrounding resize of bytearray objects to + which there are buffer exports. + +- Issue #4748: Lambda generators no longer return a value. + +- Issue #3582: Use native TLS functions on Windows + Library ------- +- Issue #1162154: inspect.getmembers() now skips attributes that raise + AttributeError, e.g. a __slots__ attribute which has not been set. + +- Issue #1696199: Add collections.Counter() for rapid and convenient + counting. + +- Issue #3860: GzipFile and BZ2File now support the context manager protocol. + +- Issue #4272: Add an optional argument to the GzipFile constructor to override + the timestamp in the gzip stream. The default value remains the current time. + The information can be used by e.g. gunzip when decompressing. Patch by + Jacques Frechet. + +- Restore Python 2.3 compatibility for decimal.py. + +- Issue #1702551: distutils sdist was not excluding VCS directories under + Windows. Inital solution by Guy Dalberto. + +- The _tkinter module functions "createfilehandler", "deletefilehandler", + "createtimerhandler", "mainloop", "dooneevent" and "quit" have been + deprecated for removal in 3.x + +- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() + to the decimal module. + +- Issue #4812: add missing underscore prefix to some internal-use-only + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) + +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. + +- Issue #4646: distutils was choking on empty options arg in the setup + function. Original patch by Thomas Heller. + +- Fractions.from_float() no longer loses precision for integers too big to + cast as floats. + +- Issue 4790: The nsmallest() and nlargest() functions in the heapq module + did unnecessary work in the common case where no key function was specified. + +- Issue #3767: Convert Tk object to string in tkColorChooser. + +- Issue #3248: Allow placing ScrolledText in a PanedWindow. + +- Issue #4444: Allow assertRaises() to be used as a context handler, so that + the code under test can be written inline if more practical. + +- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') + works as expected in the interactive environment. + +- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by + Gabriel Genellina. + +- Issue #4400: .pypirc default generated file was broken in distutils. + +- Issue #4736: io.BufferedRWPair's closed property now functions properly. + +- Issue #3954: Fix a potential SystemError in _hotshot.logreader error + handling. + +- Issue #4574: fix a crash in io.IncrementalNewlineDecoder when a carriage + return encodes to more than one byte in the source encoding (e.g. UTF-16) + and gets split on a chunk boundary. + +- Issue #4223: inspect.getsource() will now correctly display source code + for packages loaded via zipimport (or any other conformant PEP 302 + loader). Original patch by Alexander Belopolsky. + +- Issue #4201: pdb can now access and display source code loaded via + zipimport (or any other conformant PEP 302 loader). Original patch by + Alexander Belopolsky. + +- Issue #4197: doctests in modules loaded via zipimport (or any other PEP + 302 conformant loader) will now work correctly in most cases (they + are still subject to the constraints that exist for all code running + from inside a module loaded via a PEP 302 loader and attempting to + perform IO operations based on __file__). Original patch by + Alexander Belopolsky. + +- Issues #4082 and #4512: Add runpy support to zipimport in a manner that + allows backporting to maintenance branches. Original patch by + Alexander Belopolsky. + +- Issue #4163: Use unicode-friendly word splitting in the textwrap functions + when given an unicode string. + +- Issue #4616: TarFile.utime(): Restore directory times on Windows. + +- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to + give correct results in the case where one argument is a quiet NaN + and the other is a finite number that requires rounding. + +- Issue #1030250: Distutils created directories even when run with the + --dry-run option. + +- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat + libs. + +- Issue #4529: fix the parser module's validation of try-except-finally + statements. + +- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument, + not a malformed option. + +- Added the subprocess.check_output() convenience function to get output + from a subprocess on success or raise an exception on error. + +- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to + support unusual filenames (such as those containing semi-colons) in + Content-Disposition headers. + +- Issue #4384: Added logging integration with warnings module using + captureWarnings(). This change includes a NullHandler which does nothing; + it will be of use to library developers who want to avoid the "No handlers + could be found for logger XXX" message which can appear if the library user + doesn't configure logging. + - Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception. @@ -86,9 +286,46 @@ - Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. +- Issue #4730: Fixed the cPickle module to handle correctly astral characters + when protocol 0 is used. + +- Issue #1594: MacOS.GetCreatorAndType now always returns a big-endian result, + to be consistent with Apple tools. + +- Issue #900949: plat-mac/videoreader.py no longer relies on a non-existing + module. + +- Issue #16278952: plat-mac/videoreader.py now correctly imports MediaDescr + +- Issue #1737832 : plat-mac/EasyDialog.py no longer uses the broken aepack + module. + +- Issue #1149804: macostools.mkdirs now even works when another process + creates one of the needed subdirectories. + +- Issue #900506: added --no-zipimport flag to the bundlebuilder script + +- Issue #841800: bundlebuilder now works with 'python -O' + +- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on + biarch systems. Try to rely on ldconfig only, without using objdump and gcc. + +Tools/Demos +----------- + +- Issue #4677: add two list comprehension tests to pybench. + Build ----- +- Issue #4895: Use _strdup on Windows CE. + +- Issue #4472: "configure --enable-shared" now works on OSX + +- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. + +- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". + - Issue #4289: Remove Cancel button from AdvancedDlg. - Issue #1656675: Register a drop handler for .py* files on Windows. @@ -106,12 +343,33 @@ C-API ----- +- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. + +- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when + the GIL is released, or owned by another thread. + - Issue #4122: On Windows, fix a compilation error when using the Py_UNICODE_ISSPACE macro in an extension module. + +- Issue #4293: Py_AddPendingCall is now thread safe and can be used for + asynchronous notifications to python from any thread. Documentation added. Extension Modules ----------------- +- Issue #4279: Fix build of parsermodule under Cygwin. + +- Issue #4051: Prevent conflict of UNICODE macros in cPickle. + +- Issue #4228: Pack negative values the same way as 2.4 in struct's L format. + +- Issue #1040026: Fix os.times result on systems where HZ is incorrect. + +- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, + OpenBSD. + +- Issue #4365: Add crtassem.h constants to the msvcrt module. + - Issue #4396: The parser module now correctly validates the with statement. Modified: python/branches/tlee-ast-optimize/Misc/build.sh ============================================================================== --- python/branches/tlee-ast-optimize/Misc/build.sh (original) +++ python/branches/tlee-ast-optimize/Misc/build.sh Wed Jan 14 13:24:17 2009 @@ -262,7 +262,7 @@ echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F err=1 else - make update html >& ../build/$F + make checkout update html >& ../build/$F err=$? fi update_status "Making doc" "$F" $start Modified: python/branches/tlee-ast-optimize/Misc/developers.txt ============================================================================== --- python/branches/tlee-ast-optimize/Misc/developers.txt (original) +++ python/branches/tlee-ast-optimize/Misc/developers.txt Wed Jan 14 13:24:17 2009 @@ -17,6 +17,9 @@ Permissions History ------------------- +- Tarek Ziad? as given SVN access on Decmeber 21 2008 by NCN, + for maintenance of distutils. + - Hirokazu Yamamoto was given SVN access on August 12 2008 by MvL, for contributions to the Windows build. Modified: python/branches/tlee-ast-optimize/Misc/python.man ============================================================================== --- python/branches/tlee-ast-optimize/Misc/python.man (original) +++ python/branches/tlee-ast-optimize/Misc/python.man Wed Jan 14 13:24:17 2009 @@ -54,6 +54,9 @@ [ .B \-x ] +[ +.B \-3 +] .br [ .B \-c @@ -236,6 +239,9 @@ Skip the first line of the source. This is intended for a DOS specific hack only. Warning: the line numbers in error messages will be off by one! +.TP +.B \-3 +Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix. .SH INTERPRETER INTERFACE The interpreter interface resembles that of the UNIX shell: when called with standard input connected to a tty device, it prompts for Modified: python/branches/tlee-ast-optimize/Modules/_collectionsmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_collectionsmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/_collectionsmodule.c Wed Jan 14 13:24:17 2009 @@ -958,7 +958,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequeiter_type); + it = PyObject_GC_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; @@ -967,14 +967,22 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + PyObject_GC_Track(it); return (PyObject *)it; } +static int +dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg) +{ + Py_VISIT(dio->deque); + return 0; +} + static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); - Py_TYPE(dio)->tp_free(dio); + PyObject_GC_Del(dio); } static PyObject * @@ -1039,9 +1047,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -1060,7 +1068,7 @@ { dequeiterobject *it; - it = PyObject_New(dequeiterobject, &dequereviter_type); + it = PyObject_GC_New(dequeiterobject, &dequereviter_type); if (it == NULL) return NULL; it->b = deque->rightblock; @@ -1069,6 +1077,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; + PyObject_GC_Track(it); return (PyObject *)it; } @@ -1121,9 +1130,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dequeiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_ctypes/callproc.c (original) +++ python/branches/tlee-ast-optimize/Modules/_ctypes/callproc.c Wed Jan 14 13:24:17 2009 @@ -221,7 +221,7 @@ n = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ (LPTSTR) &lpMsgBuf, 0, NULL); Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c (original) +++ python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c Wed Jan 14 13:24:17 2009 @@ -1452,11 +1452,14 @@ size += 1; /* terminating NUL */ size *= sizeof(wchar_t); buffer = (wchar_t *)PyMem_Malloc(size); - if (!buffer) + if (!buffer) { + Py_DECREF(value); return PyErr_NoMemory(); + } memset(buffer, 0, size); keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); if (!keep) { + Py_DECREF(value); PyMem_Free(buffer); return NULL; } Modified: python/branches/tlee-ast-optimize/Modules/_fileio.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_fileio.c (original) +++ python/branches/tlee-ast-optimize/Modules/_fileio.c Wed Jan 14 13:24:17 2009 @@ -98,7 +98,7 @@ directories, so we need a check. */ static int -dircheck(PyFileIOObject* self) +dircheck(PyFileIOObject* self, char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -109,8 +109,8 @@ PyObject *exc; internal_close(self); - exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + exc = PyObject_CallFunction(PyExc_IOError, "(iss)", + EISDIR, msg, name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return -1; @@ -265,13 +265,14 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } - if(dircheck(self) < 0) + if(dircheck(self, name) < 0) goto error; } Modified: python/branches/tlee-ast-optimize/Modules/_hotshot.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_hotshot.c (original) +++ python/branches/tlee-ast-optimize/Modules/_hotshot.c Wed Jan 14 13:24:17 2009 @@ -1357,20 +1357,16 @@ self->logfp = fopen(filename, "rb"); if (self->logfp == NULL) { PyErr_SetFromErrnoWithFilename(PyExc_IOError, filename); - Py_DECREF(self); - self = NULL; - goto finally; + goto error; } self->info = PyDict_New(); - if (self->info == NULL) { - Py_DECREF(self); - goto finally; - } + if (self->info == NULL) + goto error; /* read initial info */ for (;;) { if ((c = fgetc(self->logfp)) == EOF) { eof_error(self); - break; + goto error; } if (c != WHAT_ADD_INFO) { ungetc(c, self->logfp); @@ -1383,13 +1379,15 @@ else PyErr_SetString(PyExc_RuntimeError, "unexpected error"); - break; + goto error; } } } } - finally: return (PyObject *) self; + error: + Py_DECREF(self); + return NULL; } Modified: python/branches/tlee-ast-optimize/Modules/_struct.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_struct.c (original) +++ python/branches/tlee-ast-optimize/Modules/_struct.c Wed Jan 14 13:24:17 2009 @@ -663,7 +663,7 @@ return -1; #if (SIZEOF_LONG > SIZEOF_INT) if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX))) - return _range_error(f, 0); + RANGE_ERROR(x, f, 0, -1); #endif y = (int)x; memcpy(p, (char *)&y, sizeof y); @@ -675,12 +675,12 @@ { unsigned long x; unsigned int y; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; y = (unsigned int)x; #if (SIZEOF_LONG > SIZEOF_INT) if (x > ((unsigned long)UINT_MAX)) - return _range_error(f, 1); + RANGE_ERROR(y, f, 1, -1); #endif memcpy(p, (char *)&y, sizeof y); return 0; @@ -700,8 +700,8 @@ np_ulong(char *p, PyObject *v, const formatdef *f) { unsigned long x; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; memcpy(p, (char *)&x, sizeof x); return 0; } Modified: python/branches/tlee-ast-optimize/Modules/_testcapimodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_testcapimodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/_testcapimodule.c Wed Jan 14 13:24:17 2009 @@ -173,6 +173,106 @@ } +/* Issue #4701: Check that PyObject_Hash implicitly calls + * PyType_Ready if it hasn't already been called + */ +static PyTypeObject _HashInheritanceTester_Type = { + PyObject_HEAD_INIT(NULL) + 0, /* Number of items for varobject */ + "hashinheritancetester", /* Name of this type */ + sizeof(PyObject), /* Basic object size */ + 0, /* Item size for varobject */ + (destructor)PyObject_Del, /* 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, /* 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 */ + 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 */ + PyType_GenericNew, /* tp_new */ +}; + +static PyObject* +test_lazy_hash_inheritance(PyObject* self) +{ + PyTypeObject *type; + PyObject *obj; + long hash; + + type = &_HashInheritanceTester_Type; + obj = PyObject_New(PyObject, type); + if (obj == NULL) { + PyErr_Clear(); + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: failed to create object"); + return NULL; + } + + if (type->tp_dict != NULL) { + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: type initialised too soon"); + Py_DECREF(obj); + return NULL; + } + + hash = PyObject_Hash(obj); + if ((hash == -1) && PyErr_Occurred()) { + PyErr_Clear(); + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: could not hash object"); + Py_DECREF(obj); + return NULL; + } + + if (type->tp_dict == NULL) { + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: type not initialised by hash()"); + Py_DECREF(obj); + return NULL; + } + + if (type->tp_hash != PyType_Type.tp_hash) { + PyErr_SetString( + TestError, + "test_lazy_hash_inheritance: unexpected hash function"); + Py_DECREF(obj); + return NULL; + } + + Py_RETURN_NONE; +} + + /* Tests of PyLong_{As, From}{Unsigned,}Long(), and (#ifdef HAVE_LONG_LONG) PyLong_{As, From}{Unsigned,}LongLong(). @@ -474,6 +574,8 @@ #ifdef Py_USING_UNICODE +static volatile int x; + /* Test the u and u# codes for PyArg_ParseTuple. May leak memory in case of an error. */ @@ -486,7 +588,7 @@ /* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */ /* Just use the macro and check that it compiles */ - int x = Py_UNICODE_ISSPACE(25); + x = Py_UNICODE_ISSPACE(25); tuple = PyTuple_New(1); if (tuple == NULL) @@ -519,6 +621,32 @@ } static PyObject * +test_empty_argparse(PyObject *self) +{ + /* Test that formats can begin with '|'. See issue #4720. */ + PyObject *tuple, *dict = NULL; + static char *kwlist[] = {NULL}; + int result; + tuple = PyTuple_New(0); + if (!tuple) + return NULL; + if ((result = PyArg_ParseTuple(tuple, "|:test_empty_argparse")) < 0) + goto done; + dict = PyDict_New(); + if (!dict) + goto done; + result = PyArg_ParseTupleAndKeywords(tuple, dict, "|:test_empty_argparse", kwlist); + done: + Py_DECREF(tuple); + Py_XDECREF(dict); + if (result < 0) + return NULL; + else { + Py_RETURN_NONE; + } +} + +static PyObject * codec_incrementalencoder(PyObject *self, PyObject *args) { const char *encoding, *errors = NULL; @@ -709,6 +837,43 @@ return NULL; Py_RETURN_NONE; } + +/* test Py_AddPendingCalls using threads */ +static int _pending_callback(void *arg) +{ + /* we assume the argument is callable object to which we own a reference */ + PyObject *callable = (PyObject *)arg; + PyObject *r = PyObject_CallObject(callable, NULL); + Py_DECREF(callable); + Py_XDECREF(r); + return r != NULL ? 0 : -1; +} + +/* The following requests n callbacks to _pending_callback. It can be + * run from any python thread. + */ +PyObject *pending_threadfunc(PyObject *self, PyObject *arg) +{ + PyObject *callable; + int r; + if (PyArg_ParseTuple(arg, "O", &callable) == 0) + return NULL; + + /* create the reference for the callbackwhile we hold the lock */ + Py_INCREF(callable); + + Py_BEGIN_ALLOW_THREADS + r = Py_AddPendingCall(&_pending_callback, callable); + Py_END_ALLOW_THREADS + + if (r<0) { + Py_DECREF(callable); /* unsuccessful add, destroy the extra reference */ + Py_INCREF(Py_False); + return Py_False; + } + Py_INCREF(Py_True); + return Py_True; +} #endif /* Some tests of PyString_FromFormat(). This needs more tests. */ @@ -777,9 +942,11 @@ {"test_config", (PyCFunction)test_config, METH_NOARGS}, {"test_list_api", (PyCFunction)test_list_api, METH_NOARGS}, {"test_dict_iteration", (PyCFunction)test_dict_iteration,METH_NOARGS}, + {"test_lazy_hash_inheritance", (PyCFunction)test_lazy_hash_inheritance,METH_NOARGS}, {"test_long_api", (PyCFunction)test_long_api, METH_NOARGS}, {"test_long_numbits", (PyCFunction)test_long_numbits, METH_NOARGS}, {"test_k_code", (PyCFunction)test_k_code, METH_NOARGS}, + {"test_empty_argparse", (PyCFunction)test_empty_argparse,METH_NOARGS}, {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, {"test_string_from_format", (PyCFunction)test_string_from_format, METH_NOARGS}, {"test_with_docstring", (PyCFunction)test_with_docstring, METH_NOARGS, @@ -811,6 +978,7 @@ #endif #ifdef WITH_THREAD {"_test_thread_state", test_thread_state, METH_VARARGS}, + {"_pending_threadfunc", pending_threadfunc, METH_VARARGS}, #endif {"traceback_print", traceback_print, METH_VARARGS}, {NULL, NULL} /* sentinel */ @@ -962,6 +1130,8 @@ if (m == NULL) return; + Py_TYPE(&_HashInheritanceTester_Type)=&PyType_Type; + Py_TYPE(&test_structmembersType)=&PyType_Type; Py_INCREF(&test_structmembersType); PyModule_AddObject(m, "test_structmembersType", (PyObject *)&test_structmembersType); Modified: python/branches/tlee-ast-optimize/Modules/_tkinter.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_tkinter.c (original) +++ python/branches/tlee-ast-optimize/Modules/_tkinter.c Wed Jan 14 13:24:17 2009 @@ -2255,6 +2255,12 @@ PyObject *file, *func; int mask, tfile; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.createfilehandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "OiO:createfilehandler", &file, &mask, &func)) return NULL; @@ -2299,6 +2305,12 @@ PyObject *file; int tfile; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.deletefilehandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) return NULL; @@ -2472,6 +2484,12 @@ PyObject *func; TkttObject *v; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.createtimerhandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "iO:createtimerhandler", &milliseconds, &func)) return NULL; @@ -2515,6 +2533,12 @@ PyThreadState *tstate = PyThreadState_Get(); #endif + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.mainloop is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold)) return NULL; @@ -2590,6 +2614,12 @@ int flags = 0; int rv; + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.dooneevent is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, "|i:dooneevent", &flags)) return NULL; @@ -2603,6 +2633,12 @@ Tkapp_Quit(PyObject *self, PyObject *args) { + if (!self && Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "_tkinter.createfilehandler is gone in 3.x") < 0) + return NULL; + } + if (!PyArg_ParseTuple(args, ":quit")) return NULL; Modified: python/branches/tlee-ast-optimize/Modules/bz2module.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/bz2module.c (original) +++ python/branches/tlee-ast-optimize/Modules/bz2module.c Wed Jan 14 13:24:17 2009 @@ -1201,6 +1201,36 @@ return ret; } +PyDoc_STRVAR(BZ2File_enter_doc, +"__enter__() -> self."); + +static PyObject * +BZ2File_enter(BZ2FileObject *self) +{ + if (self->mode == MODE_CLOSED) { + PyErr_SetString(PyExc_ValueError, + "I/O operation on closed file"); + return NULL; + } + Py_INCREF(self); + return (PyObject *) self; +} + +PyDoc_STRVAR(BZ2File_exit_doc, +"__exit__(*excinfo) -> None. Closes the file."); + +static PyObject * +BZ2File_exit(BZ2FileObject *self, PyObject *args) +{ + PyObject *ret = PyObject_CallMethod((PyObject *) self, "close", NULL); + if (!ret) + /* If error occurred, pass through */ + return NULL; + Py_DECREF(ret); + Py_RETURN_NONE; +} + + static PyObject *BZ2File_getiter(BZ2FileObject *self); static PyMethodDef BZ2File_methods[] = { @@ -1213,6 +1243,8 @@ {"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__}, {"tell", (PyCFunction)BZ2File_tell, METH_NOARGS, BZ2File_tell__doc__}, {"close", (PyCFunction)BZ2File_close, METH_NOARGS, BZ2File_close__doc__}, + {"__enter__", (PyCFunction)BZ2File_enter, METH_NOARGS, BZ2File_enter_doc}, + {"__exit__", (PyCFunction)BZ2File_exit, METH_VARARGS, BZ2File_exit_doc}, {NULL, NULL} /* sentinel */ }; Modified: python/branches/tlee-ast-optimize/Modules/cPickle.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/cPickle.c (original) +++ python/branches/tlee-ast-optimize/Modules/cPickle.c Wed Jan 14 13:24:17 2009 @@ -18,6 +18,14 @@ #define HIGHEST_PROTOCOL 2 /* + * Note: The UNICODE macro controls the TCHAR meaning of the win32 API. Since + * all headers have already been included here, we can safely redefine it. + */ +#ifdef UNICODE +# undef UNICODE +#endif + +/* * Pickle opcodes. These must be kept in synch with pickle.py. Extensive * docs are in pickletools.py. */ @@ -1255,42 +1263,91 @@ /* A copy of PyUnicode_EncodeRawUnicodeEscape() that also translates backslash and newline characters to \uXXXX escapes. */ static PyObject * -modified_EncodeRawUnicodeEscape(const Py_UNICODE *s, int size) +modified_EncodeRawUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size) { - PyObject *repr; - char *p; - char *q; + PyObject *repr; + char *p; + char *q; + + static const char *hexdigit = "0123456789abcdef"; +#ifdef Py_UNICODE_WIDE + const Py_ssize_t expandsize = 10; +#else + const Py_ssize_t expandsize = 6; +#endif - static const char *hexdigit = "0123456789ABCDEF"; + if (size > PY_SSIZE_T_MAX / expandsize) + return PyErr_NoMemory(); - repr = PyString_FromStringAndSize(NULL, 6 * size); - if (repr == NULL) - return NULL; - if (size == 0) - return repr; + repr = PyString_FromStringAndSize(NULL, expandsize * size); + if (repr == NULL) + return NULL; + if (size == 0) + return repr; - p = q = PyString_AS_STRING(repr); - while (size-- > 0) { - Py_UNICODE ch = *s++; - /* Map 16-bit characters to '\uxxxx' */ - if (ch >= 256 || ch == '\\' || ch == '\n') { - *p++ = '\\'; - *p++ = 'u'; - *p++ = hexdigit[(ch >> 12) & 0xf]; - *p++ = hexdigit[(ch >> 8) & 0xf]; - *p++ = hexdigit[(ch >> 4) & 0xf]; - *p++ = hexdigit[ch & 15]; - } - /* Copy everything else as-is */ - else - *p++ = (char) ch; + p = q = PyString_AS_STRING(repr); + while (size-- > 0) { + Py_UNICODE ch = *s++; +#ifdef Py_UNICODE_WIDE + /* Map 32-bit characters to '\Uxxxxxxxx' */ + if (ch >= 0x10000) { + *p++ = '\\'; + *p++ = 'U'; + *p++ = hexdigit[(ch >> 28) & 0xf]; + *p++ = hexdigit[(ch >> 24) & 0xf]; + *p++ = hexdigit[(ch >> 20) & 0xf]; + *p++ = hexdigit[(ch >> 16) & 0xf]; + *p++ = hexdigit[(ch >> 12) & 0xf]; + *p++ = hexdigit[(ch >> 8) & 0xf]; + *p++ = hexdigit[(ch >> 4) & 0xf]; + *p++ = hexdigit[ch & 15]; + } + 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++ = hexdigit[(ucs >> 28) & 0xf]; + *p++ = hexdigit[(ucs >> 24) & 0xf]; + *p++ = hexdigit[(ucs >> 20) & 0xf]; + *p++ = hexdigit[(ucs >> 16) & 0xf]; + *p++ = hexdigit[(ucs >> 12) & 0xf]; + *p++ = hexdigit[(ucs >> 8) & 0xf]; + *p++ = hexdigit[(ucs >> 4) & 0xf]; + *p++ = hexdigit[ucs & 0xf]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; } - *p = '\0'; - _PyString_Resize(&repr, p - q); - return repr; +#endif + /* Map 16-bit characters to '\uxxxx' */ + if (ch >= 256 || ch == '\\' || ch == '\n') { + *p++ = '\\'; + *p++ = 'u'; + *p++ = hexdigit[(ch >> 12) & 0xf]; + *p++ = hexdigit[(ch >> 8) & 0xf]; + *p++ = hexdigit[(ch >> 4) & 0xf]; + *p++ = hexdigit[ch & 15]; + } + /* Copy everything else as-is */ + else + *p++ = (char) ch; + } + *p = '\0'; + _PyString_Resize(&repr, p - q); + return repr; } - static int save_unicode(Picklerobject *self, PyObject *args, int doput) { Modified: python/branches/tlee-ast-optimize/Modules/dbmmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/dbmmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/dbmmodule.c Wed Jan 14 13:24:17 2009 @@ -21,6 +21,9 @@ #elif defined(HAVE_GDBM_NDBM_H) #include static char *which_dbm = "GNU gdbm"; +#elif defined(HAVE_GDBM_DASH_NDBM_H) +#include +static char *which_dbm = "GNU gdbm"; #elif defined(HAVE_BERKDB_H) #include static char *which_dbm = "Berkeley DB"; Modified: python/branches/tlee-ast-optimize/Modules/gcmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/gcmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/gcmodule.c Wed Jan 14 13:24:17 2009 @@ -63,6 +63,55 @@ /* Python string used to look for __del__ attribute. */ static PyObject *delstr = NULL; +/* This is the number of objects who survived the last full collection. It + approximates the number of long lived objects tracked by the GC. + + (by "full collection", we mean a collection of the oldest generation). +*/ +static Py_ssize_t long_lived_total = 0; + +/* This is the number of objects who survived all "non-full" collections, + and are awaiting to undergo a full collection for the first time. + +*/ +static Py_ssize_t long_lived_pending = 0; + +/* + NOTE: about the counting of long-lived objects. + + To limit the cost of garbage collection, there are two strategies; + - make each collection faster, e.g. by scanning fewer objects + - do less collections + This heuristic is about the latter strategy. + + In addition to the various configurable thresholds, we only trigger a + full collection if the ratio + long_lived_pending / long_lived_total + is above a given value (hardwired to 25%). + + The reason is that, while "non-full" collections (i.e., collections of + the young and middle generations) will always examine roughly the same + number of objects -- determined by the aforementioned thresholds --, + the cost of a full collection is proportional to the total number of + long-lived objects, which is virtually unbounded. + + Indeed, it has been remarked that doing a full collection every + of object creations entails a dramatic performance + degradation in workloads which consist in creating and storing lots of + long-lived objects (e.g. building a large list of GC-tracked objects would + show quadratic performance, instead of linear as expected: see issue #4074). + + Using the above ratio, instead, yields amortized linear performance in + the total number of objects (the effect of which can be summarized + thusly: "each full garbage collection is more and more costly as the + number of objects grows, but we do fewer and fewer of them"). + + This heuristic was suggested by Martin von L??wis on python-dev in + June 2008. His original analysis and proposal can be found at: + http://mail.python.org/pipermail/python-dev/2008-June/080579.html +*/ + + /* set for debugging information */ #define DEBUG_STATS (1<<0) /* print collection statistics */ #define DEBUG_COLLECTABLE (1<<1) /* print collectable objects */ @@ -740,6 +789,24 @@ (void)PyFloat_ClearFreeList(); } +static double +get_time(void) +{ + double result = 0; + if (tmod != NULL) { + PyObject *f = PyObject_CallMethod(tmod, "time", NULL); + if (f == NULL) { + PyErr_Clear(); + } + else { + if (PyFloat_Check(f)) + result = PyFloat_AsDouble(f); + Py_DECREF(f); + } + } + return result; +} + /* This is the main function. Read this to understand how the * collection process works. */ static Py_ssize_t @@ -762,16 +829,7 @@ } if (debug & DEBUG_STATS) { - if (tmod != NULL) { - PyObject *f = PyObject_CallMethod(tmod, "time", NULL); - if (f == NULL) { - PyErr_Clear(); - } - else { - t1 = PyFloat_AsDouble(f); - Py_DECREF(f); - } - } + t1 = get_time(); PySys_WriteStderr("gc: collecting generation %d...\n", generation); PySys_WriteStderr("gc: objects in each generation:"); @@ -817,8 +875,16 @@ move_unreachable(young, &unreachable); /* Move reachable objects to next generation. */ - if (young != old) + if (young != old) { + if (generation == NUM_GENERATIONS - 2) { + long_lived_pending += gc_list_size(young); + } gc_list_merge(young, old); + } + else { + long_lived_pending = 0; + long_lived_total = gc_list_size(young); + } /* All objects in unreachable are trash, but objects reachable from * finalizers can't safely be deleted. Python programmers should take @@ -844,17 +910,6 @@ if (debug & DEBUG_COLLECTABLE) { debug_cycle("collectable", FROM_GC(gc)); } - if (tmod != NULL && (debug & DEBUG_STATS)) { - PyObject *f = PyObject_CallMethod(tmod, "time", NULL); - if (f == NULL) { - PyErr_Clear(); - } - else { - t1 = PyFloat_AsDouble(f)-t1; - Py_DECREF(f); - PySys_WriteStderr("gc: %.4fs elapsed.\n", t1); - } - } } /* Clear weakrefs and invoke callbacks as necessary. */ @@ -876,14 +931,19 @@ debug_cycle("uncollectable", FROM_GC(gc)); } if (debug & DEBUG_STATS) { + double t2 = get_time(); if (m == 0 && n == 0) - PySys_WriteStderr("gc: done.\n"); + PySys_WriteStderr("gc: done"); else PySys_WriteStderr( "gc: done, " "%" PY_FORMAT_SIZE_T "d unreachable, " - "%" PY_FORMAT_SIZE_T "d uncollectable.\n", + "%" PY_FORMAT_SIZE_T "d uncollectable", n+m, n); + if (t1 && t2) { + PySys_WriteStderr(", %.4fs elapsed", t2-t1); + } + PySys_WriteStderr(".\n"); } /* Append instances in the uncollectable set to a Python @@ -918,6 +978,13 @@ * generations younger than it will be collected. */ for (i = NUM_GENERATIONS-1; i >= 0; i--) { if (generations[i].count > generations[i].threshold) { + /* Avoid quadratic performance degradation in number + of tracked objects. See comments at the beginning + of this file, and issue #4074. + */ + if (i == NUM_GENERATIONS - 1 + && long_lived_pending < long_lived_total / 4) + continue; n = collect(i); break; } Modified: python/branches/tlee-ast-optimize/Modules/itertoolsmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/itertoolsmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/itertoolsmodule.c Wed Jan 14 13:24:17 2009 @@ -886,7 +886,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -1031,7 +1030,6 @@ if (lz->stop == 1) return NULL; - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) return NULL; @@ -1218,7 +1216,6 @@ Py_ssize_t oldnext; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; while (lz->cnt < lz->next) { item = iternext(it); @@ -1229,7 +1226,6 @@ } if (lz->stop != -1 && lz->cnt >= lz->stop) return NULL; - assert(PyIter_Check(it)); item = iternext(it); if (item == NULL) return NULL; @@ -1361,7 +1357,6 @@ PyObject *result; PyObject *it = lz->it; - assert(PyIter_Check(it)); args = (*Py_TYPE(it)->tp_iternext)(it); if (args == NULL) return NULL; @@ -2059,10 +2054,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); if (indices == NULL) { @@ -2082,7 +2073,7 @@ co->indices = indices; co->result = NULL; co->r = r; - co->stopped = 0; + co->stopped = r > n ? 1 : 0; return (PyObject *)co; @@ -2318,10 +2309,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(n * sizeof(Py_ssize_t)); cycles = PyMem_Malloc(r * sizeof(Py_ssize_t)); @@ -2345,7 +2332,7 @@ po->cycles = cycles; po->result = NULL; po->r = r; - po->stopped = 0; + po->stopped = r > n ? 1 : 0; return (PyObject *)po; @@ -2585,7 +2572,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -2729,7 +2715,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -3067,7 +3052,6 @@ Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); @@ -3083,7 +3067,6 @@ return NULL; for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); @@ -3419,7 +3402,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; @@ -3448,7 +3430,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; Modified: python/branches/tlee-ast-optimize/Modules/main.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/main.c (original) +++ python/branches/tlee-ast-optimize/Modules/main.c Wed Jan 14 13:24:17 2009 @@ -86,7 +86,7 @@ -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ "; static char *usage_4 = "\ --3 : warn about Python 3.x incompatibilities\n\ +-3 : warn about Python 3.x incompatibilities that 2to3 cannot trivially fix\n\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ arg ...: arguments passed to program in sys.argv[1:]\n\n\ Modified: python/branches/tlee-ast-optimize/Modules/mathmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/mathmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/mathmodule.c Wed Jan 14 13:24:17 2009 @@ -137,6 +137,58 @@ } /* + Various platforms (Solaris, OpenBSD) do nonstandard things for log(0), + log(-ve), log(NaN). Here are wrappers for log and log10 that deal with + special values directly, passing positive non-special values through to + the system log/log10. + */ + +static double +m_log(double x) +{ + if (Py_IS_FINITE(x)) { + if (x > 0.0) + return log(x); + errno = EDOM; + if (x == 0.0) + return -Py_HUGE_VAL; /* log(0) = -inf */ + else + return Py_NAN; /* log(-ve) = nan */ + } + else if (Py_IS_NAN(x)) + return x; /* log(nan) = nan */ + else if (x > 0.0) + return x; /* log(inf) = inf */ + else { + errno = EDOM; + return Py_NAN; /* log(-inf) = nan */ + } +} + +static double +m_log10(double x) +{ + if (Py_IS_FINITE(x)) { + if (x > 0.0) + return log10(x); + errno = EDOM; + if (x == 0.0) + return -Py_HUGE_VAL; /* log10(0) = -inf */ + else + return Py_NAN; /* log10(-ve) = nan */ + } + else if (Py_IS_NAN(x)) + return x; /* log10(nan) = nan */ + else if (x > 0.0) + return x; /* log10(inf) = inf */ + else { + errno = EDOM; + return Py_NAN; /* log10(-inf) = nan */ + } +} + + +/* math_1 is used to wrap a libm function f that takes a double arguments and returns a double. @@ -578,7 +630,10 @@ return NULL; } -PyDoc_STRVAR(math_factorial_doc, "Return n!"); +PyDoc_STRVAR(math_factorial_doc, +"factorial(x) -> Integral\n" +"\n" +"Find x!. Raise a ValueError if x is negative or non-integral."); static PyObject * math_trunc(PyObject *self, PyObject *number) @@ -712,7 +767,7 @@ "modf(x)\n" "\n" "Return the fractional and integer parts of x. Both results carry the sign\n" -"of x. The integer part is returned as a real."); +"of x and are floats."); /* A decent logarithm is easy to compute even for huge longs, but libm can't do that by itself -- loghelper can. func is log or log10, and name is @@ -758,11 +813,11 @@ if (!PyArg_UnpackTuple(args, "log", 1, 2, &arg, &base)) return NULL; - num = loghelper(arg, log, "log"); + num = loghelper(arg, m_log, "log"); if (num == NULL || base == NULL) return num; - den = loghelper(base, log, "log"); + den = loghelper(base, m_log, "log"); if (den == NULL) { Py_DECREF(num); return NULL; @@ -781,7 +836,7 @@ static PyObject * math_log10(PyObject *self, PyObject *arg) { - return loghelper(arg, log10, "log10"); + return loghelper(arg, m_log10, "log10"); } PyDoc_STRVAR(math_log10_doc, Modified: python/branches/tlee-ast-optimize/Modules/parsermodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/parsermodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/parsermodule.c Wed Jan 14 13:24:17 2009 @@ -2057,6 +2057,7 @@ /* try_stmt: * 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite] + ['finally' ':' suite] * | 'try' ':' suite 'finally' ':' suite * */ @@ -2082,35 +2083,34 @@ PyErr_Format(parser_error, "Illegal number of children for try/%s node.", name); } - /* Skip past except_clause sections: */ + /* Handle try/finally statement */ + if (res && (TYPE(CHILD(tree, pos)) == NAME) && + (strcmp(STR(CHILD(tree, pos)), "finally") == 0)) { + res = (validate_numnodes(tree, 6, "try/finally") + && validate_colon(CHILD(tree, 4)) + && validate_suite(CHILD(tree, 5))); + return (res); + } + /* try/except statement: skip past except_clause sections */ while (res && (TYPE(CHILD(tree, pos)) == except_clause)) { res = (validate_except_clause(CHILD(tree, pos)) && validate_colon(CHILD(tree, pos + 1)) && validate_suite(CHILD(tree, pos + 2))); pos += 3; } - if (res && (pos < nch)) { - res = validate_ntype(CHILD(tree, pos), NAME); - if (res && (strcmp(STR(CHILD(tree, pos)), "finally") == 0)) - res = (validate_numnodes(tree, 6, "try/finally") - && validate_colon(CHILD(tree, 4)) - && validate_suite(CHILD(tree, 5))); - else if (res) { - if (nch == (pos + 3)) { - res = ((strcmp(STR(CHILD(tree, pos)), "except") == 0) - || (strcmp(STR(CHILD(tree, pos)), "else") == 0)); - if (!res) - err_string("illegal trailing triple in try statement"); - } - else if (nch == (pos + 6)) { - res = (validate_name(CHILD(tree, pos), "except") - && validate_colon(CHILD(tree, pos + 1)) - && validate_suite(CHILD(tree, pos + 2)) - && validate_name(CHILD(tree, pos + 3), "else")); - } - else - res = validate_numnodes(tree, pos + 3, "try/except"); - } + /* skip else clause */ + if (res && (TYPE(CHILD(tree, pos)) == NAME) && + (strcmp(STR(CHILD(tree, pos)), "else") == 0)) { + res = (validate_colon(CHILD(tree, pos + 1)) + && validate_suite(CHILD(tree, pos + 2))); + pos += 3; + } + if (res && pos < nch) { + /* last clause must be a finally */ + res = (validate_name(CHILD(tree, pos), "finally") + && validate_numnodes(tree, pos + 3, "try/except/finally") + && validate_colon(CHILD(tree, pos + 1)) + && validate_suite(CHILD(tree, pos + 2))); } return (res); } Modified: python/branches/tlee-ast-optimize/Modules/posixmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/posixmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/posixmodule.c Wed Jan 14 13:24:17 2009 @@ -5957,10 +5957,6 @@ #ifdef HAVE_TIMES -#ifndef HZ -#define HZ 60 /* Universal constant :-) */ -#endif /* HZ */ - #if defined(PYCC_VACPP) && defined(PYOS_OS2) static long system_uptime(void) @@ -5986,6 +5982,8 @@ (double)system_uptime() / 1000); } #else /* not OS2 */ +#define NEED_TICKS_PER_SECOND +static long ticks_per_second = -1; static PyObject * posix_times(PyObject *self, PyObject *noargs) { @@ -5996,11 +5994,11 @@ if (c == (clock_t) -1) return posix_error(); return Py_BuildValue("ddddd", - (double)t.tms_utime / HZ, - (double)t.tms_stime / HZ, - (double)t.tms_cutime / HZ, - (double)t.tms_cstime / HZ, - (double)c / HZ); + (double)t.tms_utime / ticks_per_second, + (double)t.tms_stime / ticks_per_second, + (double)t.tms_cutime / ticks_per_second, + (double)t.tms_cstime / ticks_per_second, + (double)c / ticks_per_second); } #endif /* not OS2 */ #endif /* HAVE_TIMES */ @@ -8962,6 +8960,15 @@ statvfs_result_desc.name = MODNAME ".statvfs_result"; PyStructSequence_InitType(&StatVFSResultType, &statvfs_result_desc); +#ifdef NEED_TICKS_PER_SECOND +# if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK) + ticks_per_second = sysconf(_SC_CLK_TCK); +# elif defined(HZ) + ticks_per_second = HZ; +# else + ticks_per_second = 60; /* magic fallback value; may be bogus */ +# endif +#endif } Py_INCREF((PyObject*) &StatResultType); PyModule_AddObject(m, "stat_result", (PyObject*) &StatResultType); Modified: python/branches/tlee-ast-optimize/Modules/socketmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/socketmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/socketmodule.c Wed Jan 14 13:24:17 2009 @@ -3334,7 +3334,11 @@ #ifdef HAVE_GETHOSTBYNAME_R_3_ARG struct hostent_data data; #else - char buf[16384]; + /* glibcs up to 2.10 assume that the buf argument to + gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc + does not ensure. The attribute below instructs the compiler + to maintain this alignment. */ + char buf[16384] Py_ALIGNED(8); int buf_len = (sizeof buf) - 1; int errnop; #endif Modified: python/branches/tlee-ast-optimize/Modules/zipimport.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/zipimport.c (original) +++ python/branches/tlee-ast-optimize/Modules/zipimport.c Wed Jan 14 13:24:17 2009 @@ -369,6 +369,29 @@ return NULL; } +/* Return a string matching __file__ for the named module */ +static PyObject * +zipimporter_get_filename(PyObject *obj, PyObject *args) +{ + ZipImporter *self = (ZipImporter *)obj; + PyObject *code; + char *fullname, *modpath; + int ispackage; + + if (!PyArg_ParseTuple(args, "s:zipimporter._get_filename", + &fullname)) + return NULL; + + /* Deciding the filename requires working out where the code + would come from if the module was actually loaded */ + code = get_module_code(self, fullname, &ispackage, &modpath); + if (code == NULL) + return NULL; + Py_DECREF(code); /* Only need the path info */ + + return PyString_FromString(modpath); +} + /* Return a bool signifying whether the module is a package or not. */ static PyObject * zipimporter_is_package(PyObject *obj, PyObject *args) @@ -528,6 +551,12 @@ is the module couldn't be found, return None if the archive does\n\ contain the module, but has no source for it."); + +PyDoc_STRVAR(doc_get_filename, +"_get_filename(fullname) -> filename string.\n\ +\n\ +Return the filename for the specified module."); + static PyMethodDef zipimporter_methods[] = { {"find_module", zipimporter_find_module, METH_VARARGS, doc_find_module}, @@ -539,6 +568,8 @@ doc_get_code}, {"get_source", zipimporter_get_source, METH_VARARGS, doc_get_source}, + {"_get_filename", zipimporter_get_filename, METH_VARARGS, + doc_get_filename}, {"is_package", zipimporter_is_package, METH_VARARGS, doc_is_package}, {NULL, NULL} /* sentinel */ Modified: python/branches/tlee-ast-optimize/Objects/abstract.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/abstract.c (original) +++ python/branches/tlee-ast-optimize/Objects/abstract.c Wed Jan 14 13:24:17 2009 @@ -3067,7 +3067,6 @@ PyIter_Next(PyObject *iter) { PyObject *result; - assert(PyIter_Check(iter)); result = (*iter->ob_type->tp_iternext)(iter); if (result == NULL && PyErr_Occurred() && Modified: python/branches/tlee-ast-optimize/Objects/bytearrayobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/bytearrayobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/bytearrayobject.c Wed Jan 14 13:24:17 2009 @@ -154,6 +154,17 @@ return view->len; } +static int +_canresize(PyByteArrayObject *self) +{ + if (self->ob_exports > 0) { + PyErr_SetString(PyExc_BufferError, + "Existing exports of data: object cannot be re-sized"); + return 0; + } + return 1; +} + /* Direct API functions */ PyObject * @@ -229,6 +240,13 @@ assert(PyByteArray_Check(self)); assert(size >= 0); + if (size == Py_SIZE(self)) { + return 0; + } + if (!_canresize((PyByteArrayObject *)self)) { + return -1; + } + if (size < alloc / 2) { /* Major downsize; resize down to exact size */ alloc = size + 1; @@ -248,16 +266,6 @@ alloc = size + 1; } - if (((PyByteArrayObject *)self)->ob_exports > 0) { - /* - fprintf(stderr, "%d: %s", ((PyByteArrayObject *)self)->ob_exports, - ((PyByteArrayObject *)self)->ob_bytes); - */ - PyErr_SetString(PyExc_BufferError, - "Existing exports of data: object cannot be re-sized"); - return -1; - } - sval = PyMem_Realloc(((PyByteArrayObject *)self)->ob_bytes, alloc); if (sval == NULL) { PyErr_NoMemory(); @@ -522,6 +530,10 @@ if (avail != needed) { if (avail > needed) { + if (!_canresize(self)) { + res = -1; + goto finish; + } /* 0 lo hi old_size | |<----avail----->|<-----tomove------>| @@ -654,6 +666,8 @@ stop = start; if (step == 1) { if (slicelen != needed) { + if (!_canresize(self)) + return -1; if (slicelen > needed) { /* 0 start stop old_size @@ -689,6 +703,8 @@ /* Delete slice */ Py_ssize_t cur, i; + if (!_canresize(self)) + return -1; if (step < 0) { stop = start + 1; start = stop + step * (slicelen - 1) - 1; @@ -1427,28 +1443,32 @@ PyObject *input_obj = (PyObject*)self; const char *output_start; Py_ssize_t inlen; - PyObject *result; + PyObject *result = NULL; int trans_table[256]; - PyObject *tableobj, *delobj = NULL; + PyObject *tableobj = NULL, *delobj = NULL; Py_buffer vtable, vdel; if (!PyArg_UnpackTuple(args, "translate", 1, 2, &tableobj, &delobj)) return NULL; - if (_getbuffer(tableobj, &vtable) < 0) + if (tableobj == Py_None) { + table = NULL; + tableobj = NULL; + } else if (_getbuffer(tableobj, &vtable) < 0) { return NULL; - - if (vtable.len != 256) { - PyErr_SetString(PyExc_ValueError, - "translation table must be 256 characters long"); - result = NULL; - goto done; + } else { + if (vtable.len != 256) { + PyErr_SetString(PyExc_ValueError, + "translation table must be 256 characters long"); + goto done; + } + table = (const char*)vtable.buf; } if (delobj != NULL) { if (_getbuffer(delobj, &vdel) < 0) { - result = NULL; + delobj = NULL; /* don't try to release vdel buffer on exit */ goto done; } } @@ -1457,7 +1477,6 @@ vdel.len = 0; } - table = (const char *)vtable.buf; inlen = PyByteArray_GET_SIZE(input_obj); result = PyByteArray_FromStringAndSize((char *)NULL, inlen); if (result == NULL) @@ -1465,7 +1484,7 @@ output_start = output = PyByteArray_AsString(result); input = PyByteArray_AS_STRING(input_obj); - if (vdel.len == 0) { + if (vdel.len == 0 && table != NULL) { /* If no deletions are required, use faster code */ for (i = inlen; --i >= 0; ) { c = Py_CHARMASK(*input++); @@ -1474,8 +1493,13 @@ goto done; } - for (i = 0; i < 256; i++) - trans_table[i] = Py_CHARMASK(table[i]); + if (table == NULL) { + for (i = 0; i < 256; i++) + trans_table[i] = Py_CHARMASK(i); + } else { + for (i = 0; i < 256; i++) + trans_table[i] = Py_CHARMASK(table[i]); + } for (i = 0; i < vdel.len; i++) trans_table[(int) Py_CHARMASK( ((unsigned char*)vdel.buf)[i] )] = -1; @@ -1491,7 +1515,8 @@ PyByteArray_Resize(result, output - output_start); done: - PyBuffer_Release(&vtable); + if (tableobj != NULL) + PyBuffer_Release(&vtable); if (delobj != NULL) PyBuffer_Release(&vdel); return result; @@ -2730,6 +2755,8 @@ PyErr_SetString(PyExc_IndexError, "pop index out of range"); return NULL; } + if (!_canresize(self)) + return NULL; value = self->ob_bytes[where]; memmove(self->ob_bytes + where, self->ob_bytes + where + 1, n - where); @@ -2760,6 +2787,8 @@ PyErr_SetString(PyExc_ValueError, "value not found in bytes"); return NULL; } + if (!_canresize(self)) + return NULL; memmove(self->ob_bytes + where, self->ob_bytes + where + 1, n - where); if (PyByteArray_Resize((PyObject *)self, n - 1) < 0) Modified: python/branches/tlee-ast-optimize/Objects/dictobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/dictobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/dictobject.c Wed Jan 14 13:24:17 2009 @@ -2331,7 +2331,7 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; - di = PyObject_New(dictiterobject, itertype); + di = PyObject_GC_New(dictiterobject, itertype); if (di == NULL) return NULL; Py_INCREF(dict); @@ -2348,6 +2348,7 @@ } else di->di_result = NULL; + _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -2356,7 +2357,15 @@ { Py_XDECREF(di->di_dict); Py_XDECREF(di->di_result); - PyObject_Del(di); + PyObject_GC_Del(di); +} + +static int +dictiter_traverse(dictiterobject *di, visitproc visit, void *arg) +{ + Py_VISIT(di->di_dict); + Py_VISIT(di->di_result); + return 0; } static PyObject * @@ -2435,9 +2444,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2507,9 +2516,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -2593,9 +2602,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)dictiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ Modified: python/branches/tlee-ast-optimize/Objects/fileobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/fileobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/fileobject.c Wed Jan 14 13:24:17 2009 @@ -132,8 +132,8 @@ if (fstat(fileno(f->f_fp), &buf) == 0 && S_ISDIR(buf.st_mode)) { char *msg = strerror(EISDIR); - PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)", + EISDIR, msg, f->f_name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return NULL; Modified: python/branches/tlee-ast-optimize/Objects/frameobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/frameobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/frameobject.c Wed Jan 14 13:24:17 2009 @@ -20,12 +20,38 @@ {"f_builtins", T_OBJECT, OFF(f_builtins),RO}, {"f_globals", T_OBJECT, OFF(f_globals), RO}, {"f_lasti", T_INT, OFF(f_lasti), RO}, - {"f_exc_type", T_OBJECT, OFF(f_exc_type)}, - {"f_exc_value", T_OBJECT, OFF(f_exc_value)}, - {"f_exc_traceback", T_OBJECT, OFF(f_exc_traceback)}, {NULL} /* Sentinel */ }; +#define WARN_GET_SET(NAME) \ +static PyObject * frame_get_ ## NAME(PyFrameObject *f) { \ + if (PyErr_WarnPy3k(#NAME " has been removed in 3.x", 2) < 0) \ + return NULL; \ + if (f->NAME) { \ + Py_INCREF(f->NAME); \ + return f->NAME; \ + } \ + Py_RETURN_NONE; \ +} \ +static int frame_set_ ## NAME(PyFrameObject *f, PyObject *new) { \ + if (PyErr_WarnPy3k(#NAME " has been removed in 3.x", 2) < 0) \ + return -1; \ + if (f->NAME) { \ + Py_CLEAR(f->NAME); \ + } \ + if (new == Py_None) \ + new = NULL; \ + Py_XINCREF(new); \ + f->NAME = new; \ + return 0; \ +} + + +WARN_GET_SET(f_exc_traceback) +WARN_GET_SET(f_exc_type) +WARN_GET_SET(f_exc_value) + + static PyObject * frame_getlocals(PyFrameObject *f, void *closure) { @@ -353,6 +379,12 @@ (setter)frame_setlineno, NULL}, {"f_trace", (getter)frame_gettrace, (setter)frame_settrace, NULL}, {"f_restricted",(getter)frame_getrestricted,NULL, NULL}, + {"f_exc_traceback", (getter)frame_get_f_exc_traceback, + (setter)frame_set_f_exc_traceback, NULL}, + {"f_exc_type", (getter)frame_get_f_exc_type, + (setter)frame_set_f_exc_type, NULL}, + {"f_exc_value", (getter)frame_get_f_exc_value, + (setter)frame_set_f_exc_value, NULL}, {0} }; Modified: python/branches/tlee-ast-optimize/Objects/intobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/intobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/intobject.c Wed Jan 14 13:24:17 2009 @@ -78,7 +78,8 @@ static PyIntObject *small_ints[NSMALLNEGINTS + NSMALLPOSINTS]; #endif #ifdef COUNT_ALLOCS -int quick_int_allocs, quick_neg_int_allocs; +Py_ssize_t quick_int_allocs; +Py_ssize_t quick_neg_int_allocs; #endif PyObject * @@ -1138,6 +1139,40 @@ return NULL; } +static const unsigned char BitLengthTable[32] = { + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 +}; + +static PyObject * +int_bit_length(PyIntObject *v) +{ + unsigned long n; + long r = 0; + + if (v->ob_ival < 0) + /* avoid undefined behaviour when v->ob_ival == -LONG_MAX-1 */ + n = 0U-(unsigned long)v->ob_ival; + else + n = (unsigned long)v->ob_ival; + + while (n >= 32) { + r += 6; + n >>= 6; + } + r += (long)(BitLengthTable[n]); + return PyInt_FromLong(r); +} + +PyDoc_STRVAR(int_bit_length_doc, +"int.bit_length() -> int\n\ +\n\ +Number of bits necessary to represent self in binary.\n\ +>>> bin(37)\n\ +'0b100101'\n\ +>>> (37).bit_length()\n\ +6"); + #if 0 static PyObject * int_is_finite(PyObject *v) @@ -1149,6 +1184,8 @@ static PyMethodDef int_methods[] = { {"conjugate", (PyCFunction)int_int, METH_NOARGS, "Returns self, the complex conjugate of any int."}, + {"bit_length", (PyCFunction)int_bit_length, METH_NOARGS, + int_bit_length_doc}, #if 0 {"is_finite", (PyCFunction)int_is_finite, METH_NOARGS, "Returns always True."}, Modified: python/branches/tlee-ast-optimize/Objects/listobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/listobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/listobject.c Wed Jan 14 13:24:17 2009 @@ -2911,11 +2911,11 @@ static void listreviter_dealloc(listreviterobject *); static int listreviter_traverse(listreviterobject *, visitproc, void *); static PyObject *listreviter_next(listreviterobject *); -static Py_ssize_t listreviter_len(listreviterobject *); +static PyObject *listreviter_len(listreviterobject *); -static PySequenceMethods listreviter_as_sequence = { - (lenfunc)listreviter_len, /* sq_length */ - 0, /* sq_concat */ +static PyMethodDef listreviter_methods[] = { + {"__length_hint__", (PyCFunction)listreviter_len, METH_NOARGS, length_hint_doc}, + {NULL, NULL} /* sentinel */ }; PyTypeObject PyListRevIter_Type = { @@ -2931,7 +2931,7 @@ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ - &listreviter_as_sequence, /* tp_as_sequence */ + 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ @@ -2947,6 +2947,7 @@ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)listreviter_next, /* tp_iternext */ + listreviter_methods, /* tp_methods */ 0, }; @@ -3002,11 +3003,11 @@ return NULL; } -static Py_ssize_t +static PyObject * listreviter_len(listreviterobject *it) { Py_ssize_t len = it->it_index + 1; if (it->it_seq == NULL || PyList_GET_SIZE(it->it_seq) < len) - return 0; - return len; + len = 0; + return PyLong_FromSsize_t(len); } Modified: python/branches/tlee-ast-optimize/Objects/longobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/longobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/longobject.c Wed Jan 14 13:24:17 2009 @@ -3451,6 +3451,75 @@ return PyInt_FromSsize_t(res); } +static const unsigned char BitLengthTable[32] = { + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 +}; + +static PyObject * +long_bit_length(PyLongObject *v) +{ + PyLongObject *result, *x, *y; + Py_ssize_t ndigits, msd_bits = 0; + digit msd; + + assert(v != NULL); + assert(PyLong_Check(v)); + + ndigits = ABS(Py_SIZE(v)); + if (ndigits == 0) + return PyInt_FromLong(0); + + msd = v->ob_digit[ndigits-1]; + while (msd >= 32) { + msd_bits += 6; + msd >>= 6; + } + msd_bits += (long)(BitLengthTable[msd]); + + if (ndigits <= PY_SSIZE_T_MAX/PyLong_SHIFT) + return PyInt_FromSsize_t((ndigits-1)*PyLong_SHIFT + msd_bits); + + /* expression above may overflow; use Python integers instead */ + result = (PyLongObject *)PyLong_FromSsize_t(ndigits - 1); + if (result == NULL) + return NULL; + x = (PyLongObject *)PyLong_FromLong(PyLong_SHIFT); + if (x == NULL) + goto error; + y = (PyLongObject *)long_mul(result, x); + Py_DECREF(x); + if (y == NULL) + goto error; + Py_DECREF(result); + result = y; + + x = (PyLongObject *)PyLong_FromLong(msd_bits); + if (x == NULL) + goto error; + y = (PyLongObject *)long_add(result, x); + Py_DECREF(x); + if (y == NULL) + goto error; + Py_DECREF(result); + result = y; + + return (PyObject *)result; + +error: + Py_DECREF(result); + return NULL; +} + +PyDoc_STRVAR(long_bit_length_doc, +"long.bit_length() -> int or long\n\ +\n\ +Number of bits necessary to represent self in binary.\n\ +>>> bin(37L)\n\ +'0b100101'\n\ +>>> (37L).bit_length()\n\ +6"); + #if 0 static PyObject * long_is_finite(PyObject *v) @@ -3462,6 +3531,8 @@ static PyMethodDef long_methods[] = { {"conjugate", (PyCFunction)long_long, METH_NOARGS, "Returns self, the complex conjugate of any long."}, + {"bit_length", (PyCFunction)long_bit_length, METH_NOARGS, + long_bit_length_doc}, #if 0 {"is_finite", (PyCFunction)long_is_finite, METH_NOARGS, "Returns always True."}, Modified: python/branches/tlee-ast-optimize/Objects/object.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/object.c (original) +++ python/branches/tlee-ast-optimize/Objects/object.c Wed Jan 14 13:24:17 2009 @@ -81,24 +81,29 @@ garbage itself. If unlist_types_without_objects is set, they will be removed from the type_list once the last object is deallocated. */ -int unlist_types_without_objects; -extern int tuple_zero_allocs, fast_tuple_allocs; -extern int quick_int_allocs, quick_neg_int_allocs; -extern int null_strings, one_strings; +static int unlist_types_without_objects; +extern Py_ssize_t tuple_zero_allocs, fast_tuple_allocs; +extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs; +extern Py_ssize_t null_strings, one_strings; void dump_counts(FILE* f) { PyTypeObject *tp; for (tp = type_list; tp; tp = tp->tp_next) - fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n", + fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, " + "freed: %" PY_FORMAT_SIZE_T "d, " + "max in use: %" PY_FORMAT_SIZE_T "d\n", tp->tp_name, tp->tp_allocs, tp->tp_frees, tp->tp_maxalloc); - fprintf(f, "fast tuple allocs: %d, empty: %d\n", + fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, " + "empty: %" PY_FORMAT_SIZE_T "d\n", fast_tuple_allocs, tuple_zero_allocs); - fprintf(f, "fast int allocs: pos: %d, neg: %d\n", + fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, " + "neg: %" PY_FORMAT_SIZE_T "d\n", quick_int_allocs, quick_neg_int_allocs); - fprintf(f, "null strings: %d, 1-strings: %d\n", + fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, " + "1-strings: %" PY_FORMAT_SIZE_T "d\n", null_strings, one_strings); } @@ -331,8 +336,11 @@ if (op == NULL) fprintf(stderr, "NULL\n"); else { + PyGILState_STATE gil; fprintf(stderr, "object : "); + gil = PyGILState_Ensure(); (void)PyObject_Print(op, stderr, 0); + PyGILState_Release(gil); /* XXX(twouters) cast refcount to long until %zd is universally available */ fprintf(stderr, "\n" @@ -1097,6 +1105,17 @@ PyTypeObject *tp = v->ob_type; if (tp->tp_hash != NULL) return (*tp->tp_hash)(v); + /* To keep to the general practice that inheriting + * solely from object in C code should work without + * an explicit call to PyType_Ready, we implicitly call + * PyType_Ready here and then check the tp_hash slot again + */ + if (tp->tp_dict == NULL) { + if (PyType_Ready(tp) < 0) + return -1; + if (tp->tp_hash != NULL) + return (*tp->tp_hash)(v); + } if (tp->tp_compare == NULL && RICHCOMPARE(tp) == NULL) { return _Py_HashPointer(v); /* Use address as hash value */ } @@ -1286,6 +1305,20 @@ return obj; } +/* Helper used when the __next__ method is removed from a type: + tp_iternext is never NULL and can be safely called without checking + on every iteration. + */ + +PyObject * +_PyObject_NextNotImplemented(PyObject *self) +{ + PyErr_Format(PyExc_TypeError, + "'%.200s' object is not iterable", + Py_TYPE(self)->tp_name); + return NULL; +} + /* Generic GetAttr functions - put these in your tp_[gs]etattro slot */ PyObject * Modified: python/branches/tlee-ast-optimize/Objects/setobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/setobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/setobject.c Wed Jan 14 13:24:17 2009 @@ -810,7 +810,14 @@ setiter_dealloc(setiterobject *si) { Py_XDECREF(si->si_set); - PyObject_Del(si); + PyObject_GC_Del(si); +} + +static int +setiter_traverse(setiterobject *si, visitproc visit, void *arg) +{ + Py_VISIT(si->si_set); + return 0; } static PyObject * @@ -888,9 +895,9 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)setiter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -903,7 +910,7 @@ static PyObject * set_iter(PySetObject *so) { - setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type); + setiterobject *si = PyObject_GC_New(setiterobject, &PySetIter_Type); if (si == NULL) return NULL; Py_INCREF(so); @@ -911,6 +918,7 @@ si->si_used = so->used; si->si_pos = 0; si->len = so->used; + _PyObject_GC_TRACK(si); return (PyObject *)si; } Modified: python/branches/tlee-ast-optimize/Objects/stringlib/transmogrify.h ============================================================================== --- python/branches/tlee-ast-optimize/Objects/stringlib/transmogrify.h (original) +++ python/branches/tlee-ast-optimize/Objects/stringlib/transmogrify.h Wed Jan 14 13:24:17 2009 @@ -22,76 +22,69 @@ { const char *e, *p; char *q; - Py_ssize_t i, j, old_j; + size_t i, j; PyObject *u; int tabsize = 8; - + if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; - + return NULL; + /* First pass: determine size of output string */ - i = j = old_j = 0; + i = j = 0; e = STRINGLIB_STR(self) + STRINGLIB_LEN(self); for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - j += tabsize - (j % tabsize); - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (old_j > j) { - PyErr_SetString(PyExc_OverflowError, - "result is too long"); - return NULL; - } - old_j = j; + if (tabsize > 0) { + j += tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, + "result is too long"); + return NULL; + } } - } + } else { j++; if (*p == '\n' || *p == '\r') { i += j; - old_j = j = 0; - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (i < 0) { + j = 0; + if (i > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } } } - - if ((i + j) < 0) { - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ + + if ((i + j) > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } - + /* Second pass: create output string and fill it */ u = STRINGLIB_NEW(NULL, i + j); if (!u) return NULL; - + j = 0; q = STRINGLIB_STR(u); - + for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) - *q++ = ' '; - } - } - else { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) + *q++ = ' '; + } + } + else { j++; - *q++ = *p; + *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } - + return u; } Modified: python/branches/tlee-ast-optimize/Objects/stringobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/stringobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/stringobject.c Wed Jan 14 13:24:17 2009 @@ -4,9 +4,10 @@ #include "Python.h" #include +#include #ifdef COUNT_ALLOCS -int null_strings, one_strings; +Py_ssize_t null_strings, one_strings; #endif static PyStringObject *characters[UCHAR_MAX + 1]; @@ -22,6 +23,14 @@ */ static PyObject *interned; +/* PyStringObject_SIZE gives the basic size of a string; any memory allocation + for a string of length n should request PyStringObject_SIZE + n bytes. + + Using PyStringObject_SIZE instead of sizeof(PyStringObject) saves + 3 bytes per string allocation on a typical system. +*/ +#define PyStringObject_SIZE (offsetof(PyStringObject, ob_sval) + 1) + /* For both PyString_FromString() and PyString_FromStringAndSize(), the parameter `size' denotes number of characters to allocate, not counting any @@ -74,13 +83,13 @@ return (PyObject *)op; } - if (size > PY_SSIZE_T_MAX - sizeof(PyStringObject)) { + if (size > PY_SSIZE_T_MAX - PyStringObject_SIZE) { PyErr_SetString(PyExc_OverflowError, "string is too large"); return NULL; } /* Inline PyObject_NewVar */ - op = (PyStringObject *)PyObject_MALLOC(sizeof(PyStringObject) + size); + op = (PyStringObject *)PyObject_MALLOC(PyStringObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -114,7 +123,7 @@ assert(str != NULL); size = strlen(str); - if (size > PY_SSIZE_T_MAX - sizeof(PyStringObject)) { + if (size > PY_SSIZE_T_MAX - PyStringObject_SIZE) { PyErr_SetString(PyExc_OverflowError, "string is too long for a Python string"); return NULL; @@ -135,7 +144,7 @@ } /* Inline PyObject_NewVar */ - op = (PyStringObject *)PyObject_MALLOC(sizeof(PyStringObject) + size); + op = (PyStringObject *)PyObject_MALLOC(PyStringObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -992,14 +1001,14 @@ "strings are too large to concat"); return NULL; } - + /* Inline PyObject_NewVar */ - if (size > PY_SSIZE_T_MAX - sizeof(PyStringObject)) { + if (size > PY_SSIZE_T_MAX - PyStringObject_SIZE) { PyErr_SetString(PyExc_OverflowError, "strings are too large to concat"); return NULL; } - op = (PyStringObject *)PyObject_MALLOC(sizeof(PyStringObject) + size); + op = (PyStringObject *)PyObject_MALLOC(PyStringObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -1036,13 +1045,12 @@ return (PyObject *)a; } nbytes = (size_t)size; - if (nbytes + sizeof(PyStringObject) <= nbytes) { + if (nbytes + PyStringObject_SIZE <= nbytes) { PyErr_SetString(PyExc_OverflowError, "repeated string is too long"); return NULL; } - op = (PyStringObject *) - PyObject_MALLOC(sizeof(PyStringObject) + nbytes); + op = (PyStringObject *)PyObject_MALLOC(PyStringObject_SIZE + nbytes); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -3940,7 +3948,7 @@ string_sizeof(PyStringObject *v) { Py_ssize_t res; - res = sizeof(PyStringObject) + v->ob_size * v->ob_type->tp_itemsize; + res = PyStringObject_SIZE + v->ob_size * v->ob_type->tp_itemsize; return PyInt_FromSsize_t(res); } @@ -4179,7 +4187,7 @@ PyTypeObject PyString_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "str", - sizeof(PyStringObject), + PyStringObject_SIZE, sizeof(char), string_dealloc, /* tp_dealloc */ (printfunc)string_print, /* tp_print */ @@ -4275,7 +4283,7 @@ _Py_DEC_REFTOTAL; _Py_ForgetReference(v); *pv = (PyObject *) - PyObject_REALLOC((char *)v, sizeof(PyStringObject) + newsize); + PyObject_REALLOC((char *)v, PyStringObject_SIZE + newsize); if (*pv == NULL) { PyObject_Del(v); PyErr_NoMemory(); Modified: python/branches/tlee-ast-optimize/Objects/tupleobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/tupleobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/tupleobject.c Wed Jan 14 13:24:17 2009 @@ -19,8 +19,8 @@ static int numfree[PyTuple_MAXSAVESIZE]; #endif #ifdef COUNT_ALLOCS -int fast_tuple_allocs; -int tuple_zero_allocs; +Py_ssize_t fast_tuple_allocs; +Py_ssize_t tuple_zero_allocs; #endif PyObject * Modified: python/branches/tlee-ast-optimize/Objects/typeobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/typeobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/typeobject.c Wed Jan 14 13:24:17 2009 @@ -6090,8 +6090,12 @@ } do { descr = _PyType_Lookup(type, p->name_strobj); - if (descr == NULL) + if (descr == NULL) { + if (ptr == (void**)&type->tp_iternext) { + specific = _PyObject_NextNotImplemented; + } continue; + } if (Py_TYPE(descr) == &PyWrapperDescr_Type) { void **tptr = resolve_slotdups(type, p->name_strobj); if (tptr == NULL || tptr == ptr) Modified: python/branches/tlee-ast-optimize/Objects/unicodeobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/unicodeobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/unicodeobject.c Wed Jan 14 13:24:17 2009 @@ -386,7 +386,8 @@ } } -int PyUnicode_Resize(PyObject **unicode, Py_ssize_t length) +static +int _PyUnicode_Resize(PyUnicodeObject **unicode, Py_ssize_t length) { register PyUnicodeObject *v; @@ -395,7 +396,7 @@ PyErr_BadInternalCall(); return -1; } - v = (PyUnicodeObject *)*unicode; + v = *unicode; if (v == NULL || !PyUnicode_Check(v) || Py_REFCNT(v) != 1 || length < 0) { PyErr_BadInternalCall(); return -1; @@ -412,7 +413,7 @@ Py_UNICODE_COPY(w->str, v->str, length < v->length ? length : v->length); Py_DECREF(*unicode); - *unicode = (PyObject *)w; + *unicode = w; return 0; } @@ -421,9 +422,10 @@ return unicode_resize(v, length); } -/* Internal API for use in unicodeobject.c only ! */ -#define _PyUnicode_Resize(unicodevar, length) \ - PyUnicode_Resize(((PyObject **)(unicodevar)), length) +int PyUnicode_Resize(PyObject **unicode, Py_ssize_t length) +{ + return _PyUnicode_Resize((PyUnicodeObject **)unicode, length); +} PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size) @@ -937,7 +939,7 @@ PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); - _PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); + PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; fail: if (callresults) { @@ -1345,7 +1347,7 @@ const char *encoding, const char *reason, const char *input, Py_ssize_t insize, Py_ssize_t *startinpos, Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr, - PyObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) + PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) { static char *argparse = "O!n;decoding error handler must return (unicode, int) tuple"; @@ -1405,7 +1407,7 @@ if (requiredsize > outsize) { if (requiredsize<2*outsize) requiredsize = 2*outsize; - if (PyUnicode_Resize(output, requiredsize) < 0) + if (_PyUnicode_Resize(output, requiredsize) < 0) goto onError; *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; } @@ -1604,7 +1606,7 @@ errors, &errorHandler, "utf7", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -1615,7 +1617,7 @@ errors, &errorHandler, "utf7", "unterminated shift sequence", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; if (s < e) goto restart; @@ -1942,7 +1944,7 @@ errors, &errorHandler, "utf8", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } if (consumed) @@ -2222,7 +2224,7 @@ errors, &errorHandler, "utf32", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -2496,7 +2498,7 @@ errors, &errorHandler, "utf16", errmsg, starts, size, &startinpos, &endinpos, &exc, (const char **)&q, - (PyObject **)&unicode, &outpos, &p)) + &unicode, &outpos, &p)) goto onError; } @@ -2717,7 +2719,7 @@ errors, &errorHandler, "unicodeescape", "end of string in escape sequence", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2729,7 +2731,7 @@ errors, &errorHandler, "unicodeescape", message, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2768,7 +2770,7 @@ errors, &errorHandler, "unicodeescape", "illegal Unicode character", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } break; @@ -2810,7 +2812,7 @@ errors, &errorHandler, "unicodeescape", message, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; break; @@ -2824,7 +2826,7 @@ errors, &errorHandler, "unicodeescape", message, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } else { @@ -3113,7 +3115,7 @@ errors, &errorHandler, "rawunicodeescape", "truncated \\uXXXX", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3145,7 +3147,7 @@ errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } nextByte: @@ -3315,7 +3317,7 @@ errors, &errorHandler, "unicode_internal", reason, starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { goto onError; } } @@ -3695,7 +3697,7 @@ errors, &errorHandler, "ascii", "ordinal not in range(128)", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) + &v, &outpos, &p)) goto onError; } } @@ -3996,7 +3998,7 @@ errors, &errorHandler, "charmap", "character maps to ", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { goto onError; } continue; @@ -4046,7 +4048,7 @@ errors, &errorHandler, "charmap", "character maps to ", starts, size, &startinpos, &endinpos, &exc, &s, - (PyObject **)&v, &outpos, &p)) { + &v, &outpos, &p)) { Py_DECREF(x); goto onError; } @@ -4797,7 +4799,7 @@ /* exponentially overallocate to minimize reallocations */ if (requiredsize < 2 * oldsize) requiredsize = 2 * oldsize; - if (_PyUnicode_Resize(outobj, requiredsize) < 0) + if (PyUnicode_Resize(outobj, requiredsize) < 0) return -1; *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; } @@ -4976,7 +4978,7 @@ /* Resize if we allocated to much */ respos = str-PyUnicode_AS_UNICODE(res); if (respos @@ -99,15 +99,15 @@ @@ -166,15 +166,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python26.dll" + OutputFile="./python27.dll" LinkIncremental="1" SuppressStartupBanner="FALSE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python26.pdb" + ProgramDatabaseFile=".\./python27.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python26.lib" + ImportLibrary=".\./python27.lib" TargetMachine="0"/> @@ -233,15 +233,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python26.dll" + OutputFile="./python27.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python26.pdb" + ProgramDatabaseFile=".\./python27.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python26.lib" + ImportLibrary=".\./python27.lib" TargetMachine="0"/> @@ -569,9 +569,6 @@ RelativePath="..\..\Python\getcopyright.c"> - - - - Modified: python/branches/tlee-ast-optimize/PC/_winreg.c ============================================================================== --- python/branches/tlee-ast-optimize/PC/_winreg.c (original) +++ python/branches/tlee-ast-optimize/PC/_winreg.c Wed Jan 14 13:24:17 2009 @@ -410,21 +410,17 @@ static int PyHKEY_printFunc(PyObject *ob, FILE *fp, int flags) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "", - ob, pyhkey->hkey); - fputs(resBuf, fp); - return 0; + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + fprintf(fp, "", + ob, pyhkey->hkey); + return 0; } static PyObject * PyHKEY_strFunc(PyObject *ob) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "", pyhkey->hkey); - return PyString_FromString(resBuf); + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + return PyString_FromFormat("", pyhkey->hkey); } static int Modified: python/branches/tlee-ast-optimize/PC/example_nt/example.vcproj ============================================================================== --- python/branches/tlee-ast-optimize/PC/example_nt/example.vcproj (original) +++ python/branches/tlee-ast-optimize/PC/example_nt/example.vcproj Wed Jan 14 13:24:17 2009 @@ -39,7 +39,7 @@ #include +#ifdef _MSC_VER +#if _MSC_VER >= 1500 +#include +#endif +#endif + // Force the malloc heap to clean itself up, and free unused blocks // back to the OS. (According to the docs, only works on NT.) static PyObject * @@ -298,6 +304,7 @@ PyMODINIT_FUNC initmsvcrt(void) { + int st; PyObject *d; PyObject *m = Py_InitModule("msvcrt", msvcrt_functions); if (m == NULL) @@ -310,4 +317,21 @@ insertint(d, "LK_NBRLCK", _LK_NBRLCK); insertint(d, "LK_RLCK", _LK_RLCK); insertint(d, "LK_UNLCK", _LK_UNLCK); + + /* constants for the crt versions */ +#ifdef _VC_ASSEMBLY_PUBLICKEYTOKEN + st = PyModule_AddStringConstant(m, "VC_ASSEMBLY_PUBLICKEYTOKEN", + _VC_ASSEMBLY_PUBLICKEYTOKEN); + if (st < 0)return; +#endif +#ifdef _CRT_ASSEMBLY_VERSION + st = PyModule_AddStringConstant(m, "CRT_ASSEMBLY_VERSION", + _CRT_ASSEMBLY_VERSION); + if (st < 0)return; +#endif +#ifdef __LIBRARIES_ASSEMBLY_NAME_PREFIX + st = PyModule_AddStringConstant(m, "LIBRARIES_ASSEMBLY_NAME_PREFIX", + __LIBRARIES_ASSEMBLY_NAME_PREFIX); + if (st < 0)return; +#endif } Modified: python/branches/tlee-ast-optimize/PC/os2emx/Makefile ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2emx/Makefile (original) +++ python/branches/tlee-ast-optimize/PC/os2emx/Makefile Wed Jan 14 13:24:17 2009 @@ -237,7 +237,7 @@ # Output file names PYTHON_VER= 2.6 -PYTHON_LIB= python26 +PYTHON_LIB= python27 PYTHON.LIB= $(PYTHON_LIB)_s$A PYTHON.IMPLIB= $(PYTHON_LIB)$A ifeq ($(EXEOMF),yes) @@ -351,7 +351,6 @@ Python/getargs.c \ Python/getcompiler.c \ Python/getcopyright.c \ - Python/getmtime.c \ Python/getplatform.c \ Python/getversion.c \ Python/graminit.c \ Modified: python/branches/tlee-ast-optimize/PC/os2emx/README.os2emx ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2emx/README.os2emx (original) +++ python/branches/tlee-ast-optimize/PC/os2emx/README.os2emx Wed Jan 14 13:24:17 2009 @@ -309,7 +309,7 @@ to be installed in a directory other than the PYTHONHOME directory, set the value of the Makefile variable EXE_DIR to the appropriate directory. -3. If you wish the Python core DLL (python26.dll) to be installed in a +3. If you wish the Python core DLL (python27.dll) to be installed in a directory other than the directory in which the Python executables are installed (by default, the PYTHONHOME directory), set the value of the Makefile variable DLL_DIR to the appropriate directory. This DLL must Deleted: python/branches/tlee-ast-optimize/PC/os2emx/python26.def ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2emx/python26.def Wed Jan 14 13:24:17 2009 +++ (empty file) @@ -1,1314 +0,0 @@ -LIBRARY python26 INITINSTANCE TERMINSTANCE -DESCRIPTION "Python 2.6 Core DLL" -PROTMODE -DATA MULTIPLE NONSHARED -EXPORTS - -; From python26_s.lib(config) - "_PyImport_Inittab" - -; From python26_s.lib(dlfcn) -; "dlopen" -; "dlsym" -; "dlclose" -; "dlerror" - -; From python26_s.lib(getpathp) - "Py_GetProgramFullPath" - "Py_GetPrefix" - "Py_GetExecPrefix" - "Py_GetPath" - -; From python26_s.lib(getbuildinfo) - "Py_GetBuildInfo" - "_Py_svnversion" - -; From python26_s.lib(main) - "Py_Main" - "Py_GetArgcArgv" - -; From python26_s.lib(acceler) - "PyGrammar_AddAccelerators" - "PyGrammar_RemoveAccelerators" - -; From python26_s.lib(grammar1) - "PyGrammar_FindDFA" - "PyGrammar_LabelRepr" - -; From python26_s.lib(listnode) - "PyNode_ListTree" - -; From python26_s.lib(node) - "PyNode_New" - "PyNode_AddChild" - "PyNode_Free" - -; From python26_s.lib(parser) - "PyParser_AddToken" - "PyParser_New" - "PyParser_Delete" - -; From python26_s.lib(parsetok) - "Py_TabcheckFlag" - "PyParser_ParseString" - "PyParser_ParseStringFlagsFilename" - "PyParser_ParseFile" - "PyParser_ParseFileFlags" - "PyParser_ParseStringFlags" - -; From python26_s.lib(bitset) - "_Py_newbitset" - "_Py_delbitset" - "_Py_addbit" - "_Py_samebitset" - "_Py_mergebitset" - -; From python26_s.lib(metagrammar) - "_Py_meta_grammar" - "Py_meta_grammar" - -; From python26_s.lib(tokenizer) - "PyToken_OneChar" - "PyToken_TwoChars" - "PyToken_ThreeChars" - "PyTokenizer_FromString" - "PyTokenizer_Free" - "PyTokenizer_FromFile" - "PyTokenizer_Get" - "_PyParser_TokenNames" - -; From python26_s.lib(myreadline) - "_PyOS_ReadlineTState" - "PyOS_ReadlineFunctionPointer" - "PyOS_StdioReadline" - "PyOS_Readline" - "PyOS_InputHook" - -; From python26_s.lib(abstract) - "_PyObject_LengthHint" - "PyMapping_Size" - "PyObject_CallMethod" - "PyObject_GetItem" - "PySequence_GetItem" - "PyObject_SetItem" - "PySequence_SetItem" - "PyObject_DelItem" - "PySequence_DelItem" - "PyNumber_Multiply" - "PyNumber_InPlaceAdd" - "PyNumber_InPlaceMultiply" - "PyNumber_Int" - "PyNumber_Long" - "PyNumber_Float" - "PySequence_Concat" - "PySequence_Repeat" - "PySequence_InPlaceConcat" - "PySequence_InPlaceRepeat" - "PySequence_GetSlice" - "PySequence_SetSlice" - "PySequence_Tuple" - "PyObject_GetIter" - "PyIter_Next" - "PySequence_Fast" - "_PySequence_IterSearch" - "PyObject_CallFunction" - "_PyObject_CallFunction_SizeT" - "_PyObject_CallMethod_SizeT" - "PyObject_CallMethodObjArgs" - "PyObject_CallFunctionObjArgs" - "PyObject_Cmp" - "PyObject_Call" - "PyObject_CallObject" - "PyObject_Type" - "PyObject_Size" - "PyObject_Length" - "PyObject_DelItemString" - "PyObject_AsCharBuffer" - "PyObject_CheckReadBuffer" - "PyObject_AsReadBuffer" - "PyObject_AsWriteBuffer" - "PyNumber_Check" - "PyNumber_Add" - "PyNumber_Subtract" - "PyNumber_Divide" - "PyNumber_FloorDivide" - "PyNumber_TrueDivide" - "PyNumber_Remainder" - "PyNumber_Divmod" - "PyNumber_Power" - "PyNumber_Negative" - "PyNumber_Positive" - "PyNumber_Absolute" - "PyNumber_Invert" - "PyNumber_Lshift" - "PyNumber_Rshift" - "PyNumber_And" - "PyNumber_Xor" - "PyNumber_Or" - "PyNumber_Index" - "PyNumber_InPlaceSubtract" - "PyNumber_InPlaceDivide" - "PyNumber_InPlaceFloorDivide" - "PyNumber_InPlaceTrueDivide" - "PyNumber_InPlaceRemainder" - "PyNumber_InPlacePower" - "PyNumber_InPlaceLshift" - "PyNumber_InPlaceRshift" - "PyNumber_InPlaceAnd" - "PyNumber_InPlaceXor" - "PyNumber_InPlaceOr" - "PySequence_Check" - "PySequence_Size" - "PySequence_Length" - "PySequence_DelSlice" - "PySequence_List" - "PySequence_Count" - "PySequence_Contains" - "PySequence_In" - "PySequence_Index" - "PyMapping_Check" - "PyMapping_Length" - "PyMapping_HasKeyString" - "PyMapping_HasKey" - "PyMapping_GetItemString" - "PyMapping_SetItemString" - "PyObject_IsInstance" - "PyObject_IsSubclass" - -; From python26_s.lib(boolobject) - "PyBool_FromLong" - "PyBool_Type" - "_Py_ZeroStruct" - "_Py_TrueStruct" - -; From python26_s.lib(bufferobject) - "PyBuffer_FromObject" - "PyBuffer_FromReadWriteObject" - "PyBuffer_FromMemory" - "PyBuffer_FromReadWriteMemory" - "PyBuffer_New" - "PyBuffer_Type" - -; From python26_s.lib(cellobject) - "PyCell_New" - "PyCell_Get" - "PyCell_Set" - "PyCell_Type" - -; From python26_s.lib(classobject) - "PyClass_New" - "PyClass_IsSubclass" - "PyInstance_New" - "PyInstance_NewRaw" - "PyMethod_New" - "PyMethod_Function" - "PyMethod_Self" - "PyMethod_Class" - "_PyInstance_Lookup" - "PyMethod_Fini" - "PyClass_Type" - "PyInstance_Type" - "PyMethod_Type" - -; From python26_s.lib(cobject) - "PyCObject_FromVoidPtr" - "PyCObject_FromVoidPtrAndDesc" - "PyCObject_AsVoidPtr" - "PyCObject_GetDesc" - "PyCObject_Import" - "PyCObject_SetVoidPtr" - "PyCObject_Type" - -; From python26_s.lib(codeobject) - "PyCode_New" - "PyCode_Addr2Line" - "PyCode_CheckLineNumber" - "PyCode_Type" - -; From python26_s.lib(complexobject) - "_Py_c_pow" - "_Py_c_sum" - "_Py_c_diff" - "_Py_c_neg" - "_Py_c_prod" - "_Py_c_quot" - "PyComplex_FromCComplex" - "PyComplex_FromDoubles" - "PyComplex_RealAsDouble" - "PyComplex_ImagAsDouble" - "PyComplex_AsCComplex" - "PyComplex_Type" - -; From python26_s.lib(descrobject) - "PyWrapper_New" - "PyDescr_NewMethod" - "PyDescr_NewClassMethod" - "PyDescr_NewMember" - "PyDescr_NewGetSet" - "PyDescr_NewWrapper" - "PyDictProxy_New" - "PyWrapperDescr_Type" - "PyProperty_Type" - -; From python26_s.lib(dictobject) - "PyDict_New" - "PyDict_GetItem" - "PyDict_SetItem" - "PyDict_DelItem" - "PyDict_Clear" - "PyDict_MergeFromSeq2" - "PyDict_Merge" - "PyDict_Keys" - "PyDict_Values" - "PyDict_Contains" - "PyDict_Next" - "PyDict_Items" - "PyDict_Size" - "PyDict_Copy" - "PyDict_Update" - "PyDict_GetItemString" - "PyDict_SetItemString" - "PyDict_DelItemString" - "PyDict_Type" - "PyDictIterKey_Type" - "PyDictIterValue_Type" - "PyDictIterItem_Type" - -; From python26_s.lib(enumobject) - "PyEnum_Type" - "PyReversed_Type" - -; From python26_s.lib(fileobject) - "PyFile_FromString" - "Py_UniversalNewlineFread" - "PyFile_GetLine" - "PyFile_SoftSpace" - "PyFile_WriteObject" - "PyFile_WriteString" - "PyObject_AsFileDescriptor" - "Py_UniversalNewlineFgets" - "PyFile_SetBufSize" - "PyFile_SetEncoding" - "PyFile_FromFile" - "PyFile_AsFile" - "PyFile_Name" - "PyFile_Type" - -; From python26_s.lib(floatobject) - "PyFloat_FromString" - "PyFloat_AsDouble" - "PyFloat_Fini" - "_PyFloat_Pack4" - "_PyFloat_Pack8" - "_PyFloat_Unpack4" - "_PyFloat_Unpack8" - "PyFloat_FromDouble" - "PyFloat_AsReprString" - "PyFloat_AsString" - "_PyFloat_Init" - "PyFloat_AsStringEx" - "PyFloat_Type" - -; From python26_s.lib(frameobject) - "PyFrame_New" - "PyFrame_FastToLocals" - "PyFrame_LocalsToFast" - "_PyFrame_Init" - "PyFrame_Fini" - "PyFrame_BlockSetup" - "PyFrame_BlockPop" - "PyFrame_Type" - -; From python26_s.lib(funcobject) - "PyFunction_New" - "PyFunction_GetCode" - "PyFunction_GetGlobals" - "PyFunction_GetModule" - "PyFunction_GetDefaults" - "PyFunction_SetDefaults" - "PyFunction_GetClosure" - "PyFunction_SetClosure" - "PyClassMethod_New" - "PyStaticMethod_New" - "PyFunction_Type" - "PyClassMethod_Type" - "PyStaticMethod_Type" - -; From python26_s.lib(genobject) - "PyGen_New" - "PyGen_NeedsFinalizing" - "PyGen_Type" - -; From python26_s.lib(intobject) - "PyInt_AsLong" - "PyInt_AsUnsignedLongMask" - "PyInt_AsUnsignedLongLongMask" - "PyInt_FromString" - "PyInt_AsSsize_t" - "PyInt_Fini" - "PyInt_FromUnicode" - "PyInt_FromLong" - "PyInt_FromSize_t" - "PyInt_FromSsize_t" - "PyInt_GetMax" - "_PyInt_Init" - "PyInt_Type" - -; From python26_s.lib(iterobject) - "PySeqIter_New" - "PyCallIter_New" - "PySeqIter_Type" - "PyCallIter_Type" - -; From python26_s.lib(listobject) - "PyList_New" - "PyList_Append" - "PyList_Size" - "PyList_GetItem" - "PyList_SetItem" - "PyList_Insert" - "PyList_GetSlice" - "PyList_SetSlice" - "PyList_Sort" - "PyList_Reverse" - "PyList_AsTuple" - "_PyList_Extend" - "PyList_Fini" - "PyList_Type" - "PyListIter_Type" - "PyListRevIter_Type" - -; From python26_s.lib(longobject) - "PyLong_FromDouble" - "PyLong_AsLong" - "_PyLong_AsSsize_t" - "PyLong_AsUnsignedLong" - "_PyLong_FromByteArray" - "_PyLong_AsByteArray" - "PyLong_AsDouble" - "PyLong_FromLongLong" - "PyLong_AsLongLong" - "PyLong_FromString" - "PyLong_FromLong" - "PyLong_FromUnsignedLong" - "PyLong_AsUnsignedLongMask" - "_PyLong_FromSize_t" - "_PyLong_FromSsize_t" - "_PyLong_AsScaledDouble" - "PyLong_FromVoidPtr" - "PyLong_AsVoidPtr" - "PyLong_FromUnsignedLongLong" - "PyLong_AsUnsignedLongLong" - "PyLong_AsUnsignedLongLongMask" - "PyLong_FromUnicode" - "_PyLong_Sign" - "_PyLong_NumBits" - "_PyLong_New" - "_PyLong_Copy" - "PyLong_Type" - "_PyLong_DigitValue" - -; From python26_s.lib(methodobject) - "PyCFunction_Call" - "Py_FindMethodInChain" - "PyCFunction_GetFunction" - "PyCFunction_GetSelf" - "PyCFunction_GetFlags" - "Py_FindMethod" - "PyCFunction_NewEx" - "PyCFunction_Fini" - "PyCFunction_New" - "PyCFunction_Type" - -; From python26_s.lib(moduleobject) - "PyModule_New" - "_PyModule_Clear" - "PyModule_GetDict" - "PyModule_GetName" - "PyModule_GetFilename" - "PyModule_Type" - -; From python26_s.lib(object) - "Py_DivisionWarningFlag" - "PyObject_Str" - "PyObject_Repr" - "_PyObject_Str" - "PyObject_Unicode" - "PyObject_GetAttr" - "PyObject_IsTrue" - "PyNumber_CoerceEx" - "PyObject_Compare" - "PyObject_RichCompare" - "_Py_HashDouble" - "PyObject_Hash" - "PyObject_SetAttr" - "PyObject_GenericGetAttr" - "PyObject_GenericSetAttr" - "PyCallable_Check" - "PyObject_Dir" - "PyMem_Malloc" - "PyMem_Realloc" - "PyMem_Free" - "PyObject_Print" - "_PyObject_Dump" - "PyObject_RichCompareBool" - "PyObject_GetAttrString" - "PyObject_SetAttrString" - "PyObject_HasAttrString" - "PyObject_HasAttr" - "_PyObject_GetDictPtr" - "PyObject_SelfIter" - "PyObject_Not" - "PyNumber_Coerce" - "Py_ReprEnter" - "Py_ReprLeave" - "_Py_HashPointer" - "Py_IncRef" - "Py_DecRef" - "_PyTrash_deposit_object" - "_PyTrash_destroy_chain" - "PyObject_Init" - "PyObject_InitVar" - "_PyObject_New" - "_PyObject_NewVar" - "_PyObject_Del" - "_Py_ReadyTypes" - "_Py_SwappedOp" - "_Py_NotImplementedStruct" - "_Py_NoneStruct" - "_Py_cobject_hack" - "_Py_abstract_hack" - "_PyTrash_delete_nesting" - "_PyTrash_delete_later" - -; From python26_s.lib(obmalloc) - "PyObject_Malloc" - "PyObject_Free" - "PyObject_Realloc" - -; From python26_s.lib(rangeobject) - "PyRange_Type" - -; From python26_s.lib(setobject) - "PySet_Pop" - "PySet_New" - "PyFrozenSet_New" - "PySet_Size" - "PySet_Clear" - "PySet_Contains" - "PySet_Discard" - "PySet_Add" - "_PySet_Next" - "_PySet_Update" - "PySet_Fini" - "PySet_Type" - "PyFrozenSet_Type" - -; From python26_s.lib(sliceobject) - "_PySlice_FromIndices" - "PySlice_GetIndices" - "PySlice_GetIndicesEx" - "PySlice_New" - "_Py_EllipsisObject" - "PySlice_Type" - -; From python26_s.lib(stringobject) - "PyString_FromStringAndSize" - "PyString_InternInPlace" - "PyString_FromString" - "PyString_FromFormatV" - "PyString_AsString" - "_PyString_Resize" - "PyString_FromFormat" - "PyString_AsDecodedString" - "PyString_AsEncodedString" - "PyString_DecodeEscape" - "PyString_Repr" - "PyString_AsStringAndSize" - "_PyString_FormatLong" - "PyString_Format" - "_Py_ReleaseInternedStrings" - "PyString_Size" - "PyString_Concat" - "PyString_ConcatAndDel" - "_PyString_Eq" - "PyString_InternImmortal" - "PyString_InternFromString" - "_PyString_Join" - "PyString_Decode" - "PyString_Encode" - "PyString_AsEncodedObject" - "PyString_AsDecodedObject" - "PyString_Fini" - "PyString_Type" - "PyBaseString_Type" - -; From python26_s.lib(structseq) - "PyStructSequence_InitType" - "PyStructSequence_New" - "PyStructSequence_UnnamedField" - -; From python26_s.lib(tupleobject) - "PyTuple_New" - "PyTuple_Pack" - "_PyTuple_Resize" - "PyTuple_Size" - "PyTuple_GetItem" - "PyTuple_SetItem" - "PyTuple_GetSlice" - "PyTuple_Fini" - "PyTuple_Type" - "PyTupleIter_Type" - -; From python26_s.lib(typeobject) - "PyType_IsSubtype" - "_PyType_Lookup" - "PyType_Ready" - "PyType_GenericAlloc" - "_PyObject_SlotCompare" - "PyType_GenericNew" - "PyType_Type" - "PyBaseObject_Type" - "PySuper_Type" - -; From python26_s.lib(unicodeobject) - "PyUnicodeUCS2_Resize" - "PyUnicodeUCS2_FromOrdinal" - "PyUnicodeUCS2_FromObject" - "PyUnicodeUCS2_FromEncodedObject" - "PyUnicodeUCS2_Decode" - "PyUnicodeUCS2_GetDefaultEncoding" - "PyUnicodeUCS2_DecodeUTF8" - "PyUnicodeUCS2_DecodeLatin1" - "PyUnicodeUCS2_DecodeASCII" - "PyUnicodeUCS2_AsEncodedString" - "PyUnicodeUCS2_AsUTF8String" - "PyUnicodeUCS2_AsLatin1String" - "PyUnicodeUCS2_AsASCIIString" - "PyUnicode_DecodeUTF7" - "PyUnicode_EncodeUTF7" - "PyUnicodeUCS2_DecodeUTF8Stateful" - "PyUnicodeUCS2_EncodeUTF8" - "PyUnicodeUCS2_DecodeUTF16Stateful" - "PyUnicodeUCS2_AsUTF16String" - "PyUnicodeUCS2_DecodeUnicodeEscape" - "PyUnicodeUCS2_DecodeRawUnicodeEscape" - "PyUnicodeUCS2_EncodeRawUnicodeEscape" - "_PyUnicode_DecodeUnicodeInternal" - "PyUnicodeUCS2_DecodeCharmap" - "PyUnicode_BuildEncodingMap" - "PyUnicodeUCS2_EncodeCharmap" - "PyUnicodeUCS2_TranslateCharmap" - "PyUnicodeUCS2_EncodeDecimal" - "PyUnicodeUCS2_Count" - "PyUnicodeUCS2_Find" - "PyUnicodeUCS2_Join" - "PyUnicodeUCS2_Splitlines" - "PyUnicodeUCS2_Compare" - "PyUnicodeUCS2_Contains" - "PyUnicodeUCS2_Concat" - "_PyUnicode_XStrip" - "PyUnicodeUCS2_Replace" - "PyUnicodeUCS2_Split" - "PyUnicodeUCS2_RSplit" - "PyUnicodeUCS2_Format" - "_PyUnicodeUCS2_Init" - "_PyUnicodeUCS2_Fini" - "PyUnicodeUCS2_FromUnicode" - "PyUnicodeUCS2_AsUnicode" - "PyUnicodeUCS2_GetSize" - "PyUnicodeUCS2_GetMax" - "_PyUnicodeUCS2_AsDefaultEncodedString" - "PyUnicodeUCS2_SetDefaultEncoding" - "PyUnicodeUCS2_Encode" - "PyUnicodeUCS2_AsEncodedObject" - "PyUnicodeUCS2_DecodeUTF16" - "PyUnicodeUCS2_EncodeUTF16" - "PyUnicodeUCS2_AsUnicodeEscapeString" - "PyUnicodeUCS2_EncodeUnicodeEscape" - "PyUnicodeUCS2_AsRawUnicodeEscapeString" - "PyUnicodeUCS2_EncodeLatin1" - "PyUnicodeUCS2_EncodeASCII" - "PyUnicodeUCS2_AsCharmapString" - "PyUnicodeUCS2_Partition" - "PyUnicodeUCS2_RPartition" - "PyUnicodeUCS2_Translate" - "PyUnicodeUCS2_Tailmatch" - "PyUnicode_AsDecodedObject" - "PyUnicode_Type" - -; From python26_s.lib(unicodectype) - "_PyUnicode_TypeRecords" - "_PyUnicodeUCS2_ToNumeric" - "_PyUnicodeUCS2_IsLowercase" - "_PyUnicodeUCS2_IsUppercase" - "_PyUnicodeUCS2_IsTitlecase" - "_PyUnicodeUCS2_IsWhitespace" - "_PyUnicodeUCS2_IsLinebreak" - "_PyUnicodeUCS2_ToLowercase" - "_PyUnicodeUCS2_ToUppercase" - "_PyUnicodeUCS2_ToTitlecase" - "_PyUnicodeUCS2_ToDecimalDigit" - "_PyUnicodeUCS2_ToDigit" - "_PyUnicodeUCS2_IsDecimalDigit" - "_PyUnicodeUCS2_IsDigit" - "_PyUnicodeUCS2_IsNumeric" - "_PyUnicodeUCS2_IsAlpha" - -; From python26_s.lib(weakrefobject) - "PyWeakref_NewRef" - "PyWeakref_NewProxy" - "PyObject_ClearWeakRefs" - "PyWeakref_GetObject" - "_PyWeakref_GetWeakrefCount" - "_PyWeakref_ClearRef" - "_PyWeakref_RefType" - "_PyWeakref_ProxyType" - "_PyWeakref_CallableProxyType" - -; From python26_s.lib(Python-ast) -; "init_ast" - "Module" - "Interactive" - "Expression" - "Suite" - "FunctionDef" - "ClassDef" - "Return" - "Delete" - "Assign" - "AugAssign" - "Print" - "For" - "While" - "If" - "With" - "Raise" - "TryExcept" - "TryFinally" - "Assert" - "Import" - "ImportFrom" - "Exec" - "Global" - "Expr" - "Pass" - "Break" - "Continue" - "BoolOp" - "BinOp" - "UnaryOp" - "Lambda" - "IfExp" - "Dict" - "ListComp" - "GeneratorExp" - "Yield" - "Compare" - "Call" - "Repr" - "Num" - "Str" - "Attribute" - "Subscript" - "Name" - "List" - "Tuple" - "Ellipsis" - "Slice" - "ExtSlice" - "Index" - "comprehension" - "excepthandler" - "arguments" - "keyword" - "alias" - "PyAST_mod2obj" - -; From python26_s.lib(asdl) - "asdl_seq_new" - "asdl_int_seq_new" - -; From python26_s.lib(ast) - "PyAST_FromNode" - -; From python26_s.lib(bltinmodule) - "_PyBuiltin_Init" - "Py_FileSystemDefaultEncoding" - -; From python26_s.lib(exceptions) - "PyUnicodeEncodeError_GetStart" - "PyUnicodeDecodeError_GetStart" - "PyUnicodeEncodeError_GetEnd" - "PyUnicodeDecodeError_GetEnd" - "_PyExc_Init" - "PyUnicodeDecodeError_Create" - "PyUnicodeEncodeError_Create" - "PyUnicodeTranslateError_Create" - "PyUnicodeEncodeError_GetEncoding" - "PyUnicodeDecodeError_GetEncoding" - "PyUnicodeEncodeError_GetObject" - "PyUnicodeDecodeError_GetObject" - "PyUnicodeTranslateError_GetObject" - "PyUnicodeTranslateError_GetStart" - "PyUnicodeEncodeError_SetStart" - "PyUnicodeDecodeError_SetStart" - "PyUnicodeTranslateError_SetStart" - "PyUnicodeTranslateError_GetEnd" - "PyUnicodeEncodeError_SetEnd" - "PyUnicodeDecodeError_SetEnd" - "PyUnicodeTranslateError_SetEnd" - "PyUnicodeEncodeError_GetReason" - "PyUnicodeDecodeError_GetReason" - "PyUnicodeTranslateError_GetReason" - "PyUnicodeEncodeError_SetReason" - "PyUnicodeDecodeError_SetReason" - "PyUnicodeTranslateError_SetReason" - "_PyExc_Fini" - "PyExc_BaseException" - "PyExc_Exception" - "PyExc_StandardError" - "PyExc_TypeError" - "PyExc_StopIteration" - "PyExc_GeneratorExit" - "PyExc_SystemExit" - "PyExc_KeyboardInterrupt" - "PyExc_ImportError" - "PyExc_EnvironmentError" - "PyExc_IOError" - "PyExc_OSError" - "PyExc_EOFError" - "PyExc_RuntimeError" - "PyExc_NotImplementedError" - "PyExc_NameError" - "PyExc_UnboundLocalError" - "PyExc_AttributeError" - "PyExc_IndexError" - "PyExc_SyntaxError" - "PyExc_IndentationError" - "PyExc_TabError" - "PyExc_LookupError" - "PyExc_KeyError" - "PyExc_ValueError" - "PyExc_UnicodeError" - "PyExc_UnicodeEncodeError" - "PyExc_UnicodeDecodeError" - "PyExc_UnicodeTranslateError" - "PyExc_AssertionError" - "PyExc_ArithmeticError" - "PyExc_FloatingPointError" - "PyExc_OverflowError" - "PyExc_ZeroDivisionError" - "PyExc_SystemError" - "PyExc_ReferenceError" - "PyExc_MemoryError" - "PyExc_Warning" - "PyExc_UserWarning" - "PyExc_DeprecationWarning" - "PyExc_PendingDeprecationWarning" - "PyExc_SyntaxWarning" - "PyExc_RuntimeWarning" - "PyExc_FutureWarning" - "PyExc_ImportWarning" - "PyExc_MemoryErrorInst" - -; From python26_s.lib(ceval) - "PyEval_EvalFrameEx" - "PyEval_CallObjectWithKeywords" - "PyEval_EvalCodeEx" - "PyEval_GetFrame" - "PyEval_CallObject" - "PyEval_SetProfile" - "PyEval_SetTrace" - "PyEval_GetBuiltins" - "PyEval_GetGlobals" - "PyEval_GetLocals" - "PyEval_GetRestricted" - "PyEval_MergeCompilerFlags" - "Py_FlushLine" - "Py_AddPendingCall" - "Py_MakePendingCalls" - "Py_SetRecursionLimit" - "Py_GetRecursionLimit" - "_Py_CheckRecursiveCall" - "PyEval_GetFuncName" - "PyEval_GetFuncDesc" - "PyEval_GetCallStats" - "PyEval_EvalFrame" - "PyEval_SaveThread" - "PyEval_RestoreThread" - "PyEval_ThreadsInitialized" - "PyEval_InitThreads" - "PyEval_AcquireLock" - "PyEval_ReleaseLock" - "PyEval_AcquireThread" - "PyEval_ReleaseThread" - "PyEval_ReInitThreads" - "_PyEval_SliceIndex" - "PyEval_EvalCode" - "_PyEval_CallTracing" - "_Py_CheckRecursionLimit" - "_Py_CheckInterval" - "_Py_Ticker" - -; From python26_s.lib(compile) - "_Py_Mangle" - "PyAST_Compile" - "PyNode_Compile" - "Py_OptimizeFlag" - -; From python26_s.lib(codecs) - "_PyCodec_Lookup" - "PyCodec_Encode" - "PyCodec_Decode" - "PyCodec_IgnoreErrors" - "PyCodec_ReplaceErrors" - "PyCodec_XMLCharRefReplaceErrors" - "PyCodec_BackslashReplaceErrors" - "PyCodec_Register" - "PyCodec_Encoder" - "PyCodec_Decoder" - "PyCodec_IncrementalEncoder" - "PyCodec_IncrementalDecoder" - "PyCodec_StreamReader" - "PyCodec_StreamWriter" - "PyCodec_RegisterError" - "PyCodec_LookupError" - "PyCodec_StrictErrors" - -; From python26_s.lib(errors) - "PyErr_SetNone" - "PyErr_SetString" - "PyErr_GivenExceptionMatches" - "PyErr_NormalizeException" - "PyErr_Fetch" - "PyErr_Clear" - "PyErr_NoMemory" - "PyErr_SetFromErrnoWithFilenameObject" - "PyErr_Format" - "PyErr_NewException" - "PyErr_WriteUnraisable" - "PyErr_SyntaxLocation" - "PyErr_ProgramText" - "PyErr_SetObject" - "PyErr_Occurred" - "PyErr_Restore" - "PyErr_ExceptionMatches" - "PyErr_BadArgument" - "PyErr_SetFromErrno" - "PyErr_SetFromErrnoWithFilename" - "PyErr_BadInternalCall" - "_PyErr_BadInternalCall" - "PyErr_Warn" - "PyErr_WarnExplicit" - -; From python26_s.lib(frozen) - "PyImport_FrozenModules" - -; From python26_s.lib(frozenmain) - "Py_FrozenMain" - -; From python26_s.lib(future) - "PyFuture_FromAST" - -; From python26_s.lib(getargs) - "PyArg_Parse" - "_PyArg_Parse_SizeT" - "PyArg_ParseTuple" - "_PyArg_ParseTuple_SizeT" - "PyArg_ParseTupleAndKeywords" - "_PyArg_ParseTupleAndKeywords_SizeT" - "PyArg_UnpackTuple" - "_PyArg_NoKeywords" - "PyArg_VaParse" - "PyArg_VaParseTupleAndKeywords" - "_PyArg_VaParse_SizeT" - "_PyArg_VaParseTupleAndKeywords_SizeT" - -; From python26_s.lib(getcompiler) - "Py_GetCompiler" - -; From python26_s.lib(getcopyright) - "Py_GetCopyright" - -; From python26_s.lib(getmtime) - "PyOS_GetLastModificationTime" - -; From python26_s.lib(getplatform) - "Py_GetPlatform" - -; From python26_s.lib(getversion) - "Py_GetVersion" - -; From python26_s.lib(graminit) - "_PyParser_Grammar" - -; From python26_s.lib(import) - "_PyImport_Init" - "_PyImportHooks_Init" - "PyImport_ImportModule" - "PyImport_Cleanup" - "_PyImport_FixupExtension" - "PyImport_AddModule" - "PyImport_ExecCodeModuleEx" - "PyImport_ImportFrozenModule" - "PyImport_ImportModuleEx" - "PyImport_ImportModuleLevel" - "PyImport_ReloadModule" - "PyImport_Import" -; "initimp" - "_PyImport_Fini" - "PyImport_GetMagicNumber" - "PyImport_ExecCodeModule" - "PyImport_GetModuleDict" - "_PyImport_FindModule" - "_PyImport_IsScript" - "_PyImport_ReInitLock" - "_PyImport_FindExtension" - "PyImport_AppendInittab" - "PyImport_ExtendInittab" - "PyImport_Inittab" - "_PyImport_Filetab" - -; From python26_s.lib(importdl) - "_PyImport_LoadDynamicModule" - -; From python26_s.lib(marshal) - "PyMarshal_ReadLongFromFile" - "PyMarshal_WriteObjectToString" - "PyMarshal_WriteLongToFile" - "PyMarshal_WriteObjectToFile" - "PyMarshal_ReadShortFromFile" - "PyMarshal_ReadObjectFromFile" - "PyMarshal_ReadLastObjectFromFile" - "PyMarshal_ReadObjectFromString" - "PyMarshal_Init" - -; From python26_s.lib(modsupport) - "Py_InitModule4" - "Py_BuildValue" - "_Py_BuildValue_SizeT" - "PyEval_CallFunction" - "PyEval_CallMethod" - "_Py_VaBuildValue_SizeT" - "Py_VaBuildValue" - "PyModule_AddObject" - "PyModule_AddIntConstant" - "PyModule_AddStringConstant" - "_Py_PackageContext" - -; From python26_s.lib(mysnprintf) - "PyOS_snprintf" - "PyOS_vsnprintf" - -; From python26_s.lib(mystrtoul) - "PyOS_strtoul" - "PyOS_strtol" - -; From python26_s.lib(pyarena) - "PyArena_New" - "PyArena_Free" - "PyArena_Malloc" - "PyArena_AddPyObject" - -; From python26_s.lib(pyfpe) - "PyFPE_dummy" - -; From python26_s.lib(pystate) - "PyInterpreterState_Clear" - "PyThreadState_Clear" - "_PyThread_CurrentFrames" - "PyGILState_Ensure" - "PyGILState_Release" - "PyInterpreterState_New" - "PyInterpreterState_Delete" - "PyThreadState_Delete" - "PyThreadState_New" - "PyThreadState_DeleteCurrent" - "PyThreadState_Get" - "PyThreadState_Swap" - "PyThreadState_GetDict" - "PyThreadState_SetAsyncExc" - "PyGILState_GetThisThreadState" - "PyInterpreterState_Head" - "PyInterpreterState_Next" - "PyInterpreterState_ThreadHead" - "PyThreadState_Next" - "_PyGILState_Init" - "_PyGILState_Fini" - "_PyThreadState_Current" - "_PyThreadState_GetFrame" - -; From python26_s.lib(pystrtod) - "PyOS_ascii_strtod" - "PyOS_ascii_formatd" - "PyOS_ascii_atof" - -; From python26_s.lib(pythonrun) - "Py_IgnoreEnvironmentFlag" - "Py_DebugFlag" - "Py_VerboseFlag" - "Py_NoSiteFlag" - "Py_InteractiveFlag" - "Py_FrozenFlag" - "Py_InitializeEx" - "Py_FatalError" - "Py_NewInterpreter" - "PyErr_Print" - "PyRun_InteractiveOneFlags" - "PyParser_ASTFromFile" - "PyRun_SimpleFileExFlags" - "PyRun_FileExFlags" - "Py_Exit" - "PyErr_PrintEx" - "PyErr_Display" - "Py_SetProgramName" - "Py_GetProgramName" - "Py_SetPythonHome" - "Py_GetPythonHome" - "Py_Initialize" - "Py_Finalize" - "Py_IsInitialized" - "Py_EndInterpreter" - "PyRun_AnyFileFlags" - "Py_FdIsInteractive" - "PyRun_InteractiveLoopFlags" - "PyRun_AnyFileExFlags" - "PyRun_SimpleStringFlags" - "PyRun_StringFlags" - "PyParser_ASTFromString" - "PyParser_SimpleParseStringFlags" - "PyParser_SimpleParseFileFlags" - "Py_CompileStringFlags" - "Py_SymtableString" - "Py_AtExit" - "PyOS_getsig" - "PyOS_setsig" - "PyParser_SetError" - "PyModule_GetWarningsModule" - "PyParser_SimpleParseStringFlagsFilename" - "PyParser_SimpleParseStringFilename" - "PyParser_SimpleParseFile" - "PyParser_SimpleParseString" - "PyRun_AnyFile" - "PyRun_AnyFileEx" - "PyRun_File" - "PyRun_FileEx" - "PyRun_FileFlags" - "PyRun_SimpleFile" - "PyRun_SimpleFileEx" - "PyRun_String" - "PyRun_SimpleString" - "Py_CompileString" - "PyRun_InteractiveOne" - "PyRun_InteractiveLoop" - "Py_UseClassExceptionsFlag" - "Py_UnicodeFlag" - "_Py_QnewFlag" - -; From python26_s.lib(structmember) - "PyMember_Get" - "PyMember_GetOne" - "PyMember_SetOne" - "PyMember_Set" - -; From python26_s.lib(symtable) - "PySymtable_Build" - "PySymtable_Free" - "PyST_GetScope" - "PySymtable_Lookup" - "PySTEntry_Type" - -; From python26_s.lib(sysmodule) - "_PySys_Init" - "PySys_WriteStderr" - "PySys_SetPath" - "PySys_SetArgv" - "PySys_WriteStdout" - "Py_SubversionRevision" - "Py_SubversionShortBranch" - "PySys_GetObject" - "PySys_SetObject" - "PySys_GetFile" - "PySys_ResetWarnOptions" - "PySys_AddWarnOption" - -; From python26_s.lib(traceback) - "PyTraceBack_Here" - "PyTraceBack_Print" - "PyTraceBack_Type" - -; From python26_s.lib(getopt) - "_PyOS_GetOpt" - "_PyOS_opterr" - "_PyOS_optind" - "_PyOS_optarg" - -; From python26_s.lib(dynload_shlib) - "_PyImport_DynLoadFiletab" - "_PyImport_GetDynLoadFunc" - -; From python26_s.lib(thread) - "PyThread_delete_key_value" - "PyThread_init_thread" - "PyThread_start_new_thread" - "PyThread_exit_thread" - "PyThread_get_thread_ident" - "PyThread_allocate_lock" - "PyThread_free_lock" - "PyThread_acquire_lock" - "PyThread_release_lock" - "PyThread_get_stacksize" - "PyThread_set_stacksize" - "PyThread_create_key" - "PyThread_delete_key" - "PyThread_set_key_value" - "PyThread_get_key_value" - "PyThread__exit_thread" - -; From python26_s.lib(gcmodule) -; "initgc" - "_PyObject_GC_New" - "_PyObject_GC_NewVar" - "PyGC_Collect" - "_PyObject_GC_Resize" - "_PyObject_GC_Malloc" - "PyObject_GC_Track" - "PyObject_GC_UnTrack" - "PyObject_GC_Del" - "_PyGC_Dump" - "_PyObject_GC_Track" - "_PyObject_GC_UnTrack" - "_PyObject_GC_Del" - "_PyGC_generation0" - -; From python26_s.lib(signalmodule) -; "initsignal" - "PyErr_CheckSignals" - "PyErr_SetInterrupt" - "PyOS_FiniInterrupts" - "PyOS_InterruptOccurred" - "PyOS_InitInterrupts" - "PyOS_AfterFork" - -; From python26_s.lib(posixmodule) -; "initos2" - -; From python26_s.lib(threadmodule) -; "initthread" - -; From python26_s.lib(arraymodule) -; "initarray" -; "array_methods" - -; From python26_s.lib(binascii) -; "initbinascii" - -; From python26_s.lib(cmathmodule) -; "initcmath" - -; From python26_s.lib(_codecsmodule) -; "init_codecs" - -; From python26_s.lib(collectionsmodule) -; "initcollections" - "dequeiter_type" - "dequereviter_type" - -; From python26_s.lib(cPickle) -; "initcPickle" -; "fast_save_leave" - -; From python26_s.lib(cStringIO) -; "initcStringIO" - -; From python26_s.lib(_csv) -; "init_csv" - -; From python26_s.lib(datetimemodule) -; "initdatetime" - -; From python26_s.lib(dlmodule) -; "initdl" - -; From python26_s.lib(errnomodule) -; "initerrno" - -; From python26_s.lib(fcntlmodule) -; "initfcntl" - -; From python26_s.lib(_functoolsmodule) -; "init_functools" - -; From python26_s.lib(_heapqmodule) -; "init_heapq" - -; From python26_s.lib(imageop) -; "initimageop" - -; From python26_s.lib(itertoolsmodule) -; "inititertools" - -; From python26_s.lib(_localemodule) -; "init_locale" - -; From python26_s.lib(mathmodule) -; "initmath" - -; From python26_s.lib(md5) - "md5_finish" - "md5_init" - "md5_append" - -; From python26_s.lib(md5module) -; "init_md5" - -; From python26_s.lib(operator) -; "initoperator" - -; From python26_s.lib(_randommodule) -; "init_random" - -; From python26_s.lib(rgbimgmodule) -; "initrgbimg" - -; From python26_s.lib(shamodule) -; "init_sha" - -; From python26_s.lib(sha256module) -; "init_sha256" - -; From python26_s.lib(sha512module) -; "init_sha512" - -; From python26_s.lib(_sre) -; "init_sre" - -; From python26_s.lib(stropmodule) -; "initstrop" - -; From python26_s.lib(_struct) -; "init_struct" - -; From python26_s.lib(symtablemodule) -; "init_symtable" - -; From python26_s.lib(termios) -; "inittermios" - -; From python26_s.lib(timemodule) -; "inittime" - "_PyTime_DoubleToTimet" -; "inittimezone" - -; From python26_s.lib(timingmodule) -; "inittiming" - -; From python26_s.lib(_weakref) -; "init_weakref" - -; From python26_s.lib(xxsubtype) -; "initxxsubtype" - -; From python26_s.lib(zipimport) -; "initzipimport" Modified: python/branches/tlee-ast-optimize/PC/os2vacpp/makefile ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2vacpp/makefile (original) +++ python/branches/tlee-ast-optimize/PC/os2vacpp/makefile Wed Jan 14 13:24:17 2009 @@ -1693,8 +1693,6 @@ $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \ $(PY_INCLUDE)\tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \ $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \ pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \ Modified: python/branches/tlee-ast-optimize/PC/os2vacpp/makefile.omk ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2vacpp/makefile.omk (original) +++ python/branches/tlee-ast-optimize/PC/os2vacpp/makefile.omk Wed Jan 14 13:24:17 2009 @@ -1155,8 +1155,6 @@ pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \ stringobject.h sysmodule.h traceback.h tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \ pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \ import.h intobject.h intrcheck.h listobject.h longobject.h \ Modified: python/branches/tlee-ast-optimize/PC/os2vacpp/python.def ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2vacpp/python.def (original) +++ python/branches/tlee-ast-optimize/PC/os2vacpp/python.def Wed Jan 14 13:24:17 2009 @@ -284,7 +284,6 @@ PyNumber_Xor PyOS_AfterFork PyOS_FiniInterrupts - PyOS_GetLastModificationTime PyOS_InitInterrupts PyOS_InterruptOccurred PyOS_Readline Modified: python/branches/tlee-ast-optimize/PC/pyconfig.h ============================================================================== --- python/branches/tlee-ast-optimize/PC/pyconfig.h (original) +++ python/branches/tlee-ast-optimize/PC/pyconfig.h Wed Jan 14 13:24:17 2009 @@ -88,6 +88,12 @@ #define USE_SOCKET #endif +/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ +#if defined(MS_WINCE) +# include +# define strdup _strdup +#endif + #ifdef MS_WINCE /* Python uses GetVersion() to distinguish between * Windows NT and 9x/ME where OS Unicode support is concerned. @@ -399,11 +405,11 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 -/* Define to 1 if you have the `isinf' function. */ -#define HAVE_ISINF 1 +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 /* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 +#define HAVE_DECL_ISNAN 1 /* Define if on AIX 3. System headers sometimes define this. Modified: python/branches/tlee-ast-optimize/PCbuild/build_ssl.bat ============================================================================== --- python/branches/tlee-ast-optimize/PCbuild/build_ssl.bat (original) +++ python/branches/tlee-ast-optimize/PCbuild/build_ssl.bat Wed Jan 14 13:24:17 2009 @@ -2,10 +2,10 @@ if not defined HOST_PYTHON ( if %1 EQU Debug ( set HOST_PYTHON=python_d.exe - if not exist python30_d.dll exit 1 + if not exist python27_d.dll exit 1 ) ELSE ( set HOST_PYTHON=python.exe - if not exist python30.dll exit 1 + if not exist python27.dll exit 1 ) ) %HOST_PYTHON% build_ssl.py %1 %2 %3 Modified: python/branches/tlee-ast-optimize/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/tlee-ast-optimize/PCbuild/pythoncore.vcproj (original) +++ python/branches/tlee-ast-optimize/PCbuild/pythoncore.vcproj Wed Jan 14 13:24:17 2009 @@ -1687,10 +1687,6 @@ > - - Modified: python/branches/tlee-ast-optimize/Parser/asdl.py ============================================================================== --- python/branches/tlee-ast-optimize/Parser/asdl.py (original) +++ python/branches/tlee-ast-optimize/Parser/asdl.py Wed Jan 14 13:24:17 2009 @@ -167,7 +167,7 @@ return Product(fields) def p_sum_0(self, (constructor,)): - " sum ::= constructor """ + " sum ::= constructor " return [constructor] def p_sum_1(self, (constructor, _, sum)): Modified: python/branches/tlee-ast-optimize/Parser/printgrammar.c ============================================================================== --- python/branches/tlee-ast-optimize/Parser/printgrammar.c (original) +++ python/branches/tlee-ast-optimize/Parser/printgrammar.c Wed Jan 14 13:24:17 2009 @@ -16,6 +16,7 @@ fprintf(fp, "/* Generated by Parser/pgen */\n\n"); fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n"); + fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); printdfas(g, fp); printlabels(g, fp); fprintf(fp, "grammar _PyParser_Grammar = {\n"); Modified: python/branches/tlee-ast-optimize/Python/ast.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/ast.c (original) +++ python/branches/tlee-ast-optimize/Python/ast.c Wed Jan 14 13:24:17 2009 @@ -3184,6 +3184,7 @@ int imflag; #endif + assert(s != NULL); errno = 0; end = s + strlen(s) - 1; #ifndef WITHOUT_COMPLEX Modified: python/branches/tlee-ast-optimize/Python/ceval.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/ceval.c (original) +++ python/branches/tlee-ast-optimize/Python/ceval.c Wed Jan 14 13:24:17 2009 @@ -213,6 +213,7 @@ #include "pythread.h" static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */ +static PyThread_type_lock pending_lock = 0; /* for pending calls */ static long main_thread = 0; int @@ -284,6 +285,7 @@ adding a new function to each thread_*.h. Instead, just create a new lock and waste a little bit of memory */ interpreter_lock = PyThread_allocate_lock(); + pending_lock = PyThread_allocate_lock(); PyThread_acquire_lock(interpreter_lock, 1); main_thread = PyThread_get_thread_ident(); @@ -356,19 +358,145 @@ #ifdef WITH_THREAD Any thread can schedule pending calls, but only the main thread will execute them. + There is no facility to schedule calls to a particular thread, but + that should be easy to change, should that ever be required. In + that case, the static variables here should go into the python + threadstate. #endif +*/ + +#ifdef WITH_THREAD + +/* The WITH_THREAD implementation is thread-safe. It allows + scheduling to be made from any thread, and even from an executing + callback. + */ + +#define NPENDINGCALLS 32 +static struct { + int (*func)(void *); + void *arg; +} pendingcalls[NPENDINGCALLS]; +static int pendingfirst = 0; +static int pendinglast = 0; +static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */ +static char pendingbusy = 0; + +int +Py_AddPendingCall(int (*func)(void *), void *arg) +{ + int i, j, result=0; + PyThread_type_lock lock = pending_lock; + + /* try a few times for the lock. Since this mechanism is used + * for signal handling (on the main thread), there is a (slim) + * chance that a signal is delivered on the same thread while we + * hold the lock during the Py_MakePendingCalls() function. + * This avoids a deadlock in that case. + * Note that signals can be delivered on any thread. In particular, + * on Windows, a SIGINT is delivered on a system-created worker + * thread. + * We also check for lock being NULL, in the unlikely case that + * this function is called before any bytecode evaluation takes place. + */ + if (lock != NULL) { + for (i = 0; i<100; i++) { + if (PyThread_acquire_lock(lock, NOWAIT_LOCK)) + break; + } + if (i == 100) + return -1; + } + + i = pendinglast; + j = (i + 1) % NPENDINGCALLS; + if (j == pendingfirst) { + result = -1; /* Queue full */ + } else { + pendingcalls[i].func = func; + pendingcalls[i].arg = arg; + pendinglast = j; + } + /* signal main loop */ + _Py_Ticker = 0; + pendingcalls_to_do = 1; + if (lock != NULL) + PyThread_release_lock(lock); + return result; +} + +int +Py_MakePendingCalls(void) +{ + int i; + int r = 0; + + if (!pending_lock) { + /* initial allocation of the lock */ + pending_lock = PyThread_allocate_lock(); + if (pending_lock == NULL) + return -1; + } - XXX WARNING! ASYNCHRONOUSLY EXECUTING CODE! + /* only service pending calls on main thread */ + if (main_thread && PyThread_get_thread_ident() != main_thread) + return 0; + /* don't perform recursive pending calls */ + if (pendingbusy) + return 0; + pendingbusy = 1; + /* perform a bounded number of calls, in case of recursion */ + for (i=0; ic_tracefunc is non-NULL, so if the value + is 0, we know we don't have to check this thread's c_tracefunc. + This speeds up the if statement in PyEval_EvalFrameEx() after + fast_next_opcode*/ +static int _Py_TracingPossible = 0; + /* for manipulating the thread switch and periodic "stuff" - used to be per thread, now just a pair o' globals */ int _Py_CheckInterval = 100; -volatile int _Py_Ticker = 100; +volatile int _Py_Ticker = 0; /* so that we hit a "tick" first thing */ PyObject * PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals) @@ -825,7 +956,7 @@ /* Do periodic things. Doing this every time through the loop would add too much overhead, so we do it only every Nth instruction. We also do it if - ``things_to_do'' is set, i.e. when an asynchronous + ``pendingcalls_to_do'' is set, i.e. when an asynchronous event needs attention (e.g. a signal handler or async I/O handler); see Py_AddPendingCall() and Py_MakePendingCalls() above. */ @@ -841,12 +972,12 @@ #ifdef WITH_TSC ticked = 1; #endif - if (things_to_do) { + if (pendingcalls_to_do) { if (Py_MakePendingCalls() < 0) { why = WHY_EXCEPTION; goto on_error; } - if (things_to_do) + if (pendingcalls_to_do) /* MakePendingCalls() didn't succeed. Force early re-execution of this "periodic" code, possibly after @@ -886,7 +1017,8 @@ /* line-by-line tracing support */ - if (tstate->c_tracefunc != NULL && !tstate->tracing) { + if (_Py_TracingPossible && + tstate->c_tracefunc != NULL && !tstate->tracing) { /* see maybe_call_line_trace for expository comments */ f->f_stacktop = stack_pointer; @@ -1041,6 +1173,7 @@ } Py_FatalError("invalid argument to DUP_TOPX" " (bytecode corruption?)"); + /* Never returns, so don't bother to set why. */ break; case UNARY_POSITIVE: @@ -1285,9 +1418,8 @@ case LIST_APPEND: w = POP(); - v = POP(); + v = stack_pointer[-oparg]; err = PyList_Append(v, w); - Py_DECREF(v); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); @@ -1634,9 +1766,11 @@ case PRINT_NEWLINE: if (stream == NULL || stream == Py_None) { w = PySys_GetObject("stdout"); - if (w == NULL) + if (w == NULL) { PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + why = WHY_EXCEPTION; + } } if (w != NULL) { /* w.write() may replace sys.stdout, so we @@ -1862,6 +1996,7 @@ PyErr_Format(PyExc_SystemError, "no locals when loading %s", PyObject_REPR(w)); + why = WHY_EXCEPTION; break; } if (PyDict_CheckExact(v)) { @@ -2337,11 +2472,20 @@ /* XXX Not the fastest way to call it... */ x = PyObject_CallFunctionObjArgs(exit_func, u, v, w, NULL); - if (x == NULL) { - Py_DECREF(exit_func); + Py_DECREF(exit_func); + if (x == NULL) break; /* Go to error exit */ - } - if (u != Py_None && PyObject_IsTrue(x)) { + + if (u != Py_None) + err = PyObject_IsTrue(x); + else + err = 0; + Py_DECREF(x); + + if (err < 0) + break; /* Go to error exit */ + else if (err > 0) { + err = 0; /* There was an exception and a true return */ STACKADJ(-2); Py_INCREF(Py_None); @@ -2353,8 +2497,6 @@ /* The stack was rearranged to remove EXIT above. Let END_FINALLY do its thing */ } - Py_DECREF(x); - Py_DECREF(exit_func); PREDICT(END_FINALLY); break; } @@ -2451,7 +2593,10 @@ Py_DECREF(v); if (x != NULL) { v = POP(); - err = PyFunction_SetClosure(x, v); + if (PyFunction_SetClosure(x, v) != 0) { + /* Can't happen unless bytecode is corrupt. */ + why = WHY_EXCEPTION; + } Py_DECREF(v); } if (x != NULL && oparg > 0) { @@ -2465,7 +2610,11 @@ w = POP(); PyTuple_SET_ITEM(v, oparg, w); } - err = PyFunction_SetDefaults(x, v); + if (PyFunction_SetDefaults(x, v) != 0) { + /* Can't happen unless + PyFunction_SetDefaults changes. */ + why = WHY_EXCEPTION; + } Py_DECREF(v); } PUSH(x); @@ -3414,6 +3563,7 @@ { PyThreadState *tstate = PyThreadState_GET(); PyObject *temp = tstate->c_traceobj; + _Py_TracingPossible += (func != NULL) - (tstate->c_tracefunc != NULL); Py_XINCREF(arg); tstate->c_tracefunc = NULL; tstate->c_traceobj = NULL; Modified: python/branches/tlee-ast-optimize/Python/compile.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/compile.c (original) +++ python/branches/tlee-ast-optimize/Python/compile.c Wed Jan 14 13:24:17 2009 @@ -739,7 +739,7 @@ return 0; case LIST_APPEND: - return -2; + return -1; case BINARY_POWER: case BINARY_MULTIPLY: @@ -1589,7 +1589,12 @@ c->u->u_argcount = asdl_seq_LEN(args->args); VISIT_IN_SCOPE(c, expr, e->v.Lambda.body); - ADDOP_IN_SCOPE(c, RETURN_VALUE); + if (c->u->u_ste->ste_generator) { + ADDOP_IN_SCOPE(c, POP_TOP); + } + else { + ADDOP_IN_SCOPE(c, RETURN_VALUE); + } co = assemble(c, 1); compiler_exit_scope(c); if (co == NULL) @@ -2654,9 +2659,8 @@ } static int -compiler_listcomp_generator(struct compiler *c, PyObject *tmpname, - asdl_seq *generators, int gen_index, - expr_ty elt) +compiler_listcomp_generator(struct compiler *c, asdl_seq *generators, + int gen_index, expr_ty elt) { /* generate code for the iterator, then each of the ifs, and then write to the element */ @@ -2693,16 +2697,13 @@ } if (++gen_index < asdl_seq_LEN(generators)) - if (!compiler_listcomp_generator(c, tmpname, - generators, gen_index, elt)) + if (!compiler_listcomp_generator(c, generators, gen_index, elt)) return 0; /* only append after the last for generator */ if (gen_index >= asdl_seq_LEN(generators)) { - if (!compiler_nameop(c, tmpname, Load)) - return 0; VISIT(c, expr, elt); - ADDOP(c, LIST_APPEND); + ADDOP_I(c, LIST_APPEND, gen_index+1); compiler_use_next_block(c, skip); } @@ -2714,10 +2715,6 @@ } ADDOP_JABS(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, anchor); - /* delete the temporary list name added to locals */ - if (gen_index == 1) - if (!compiler_nameop(c, tmpname, Del)) - return 0; return 1; } @@ -2725,21 +2722,10 @@ static int compiler_listcomp(struct compiler *c, expr_ty e) { - identifier tmp; - int rc = 0; - asdl_seq *generators = e->v.ListComp.generators; - assert(e->kind == ListComp_kind); - tmp = compiler_new_tmpname(c); - if (!tmp) - return 0; ADDOP_I(c, BUILD_LIST, 0); - ADDOP(c, DUP_TOP); - if (compiler_nameop(c, tmp, Store)) - rc = compiler_listcomp_generator(c, tmp, generators, 0, - e->v.ListComp.elt); - Py_DECREF(tmp); - return rc; + return compiler_listcomp_generator(c, e->v.ListComp.generators, 0, + e->v.ListComp.elt); } static int Modified: python/branches/tlee-ast-optimize/Python/getargs.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/getargs.c (original) +++ python/branches/tlee-ast-optimize/Python/getargs.c Wed Jan 14 13:24:17 2009 @@ -1601,7 +1601,7 @@ } } - if (!IS_END_OF_FORMAT(*format)) { + if (!IS_END_OF_FORMAT(*format) && *format != '|') { PyErr_Format(PyExc_RuntimeError, "more argument specifiers than keyword list entries " "(remaining format:'%s')", format); Modified: python/branches/tlee-ast-optimize/Python/getcopyright.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/getcopyright.c (original) +++ python/branches/tlee-ast-optimize/Python/getcopyright.c Wed Jan 14 13:24:17 2009 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ Deleted: python/branches/tlee-ast-optimize/Python/getmtime.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/getmtime.c Wed Jan 14 13:24:17 2009 +++ (empty file) @@ -1,26 +0,0 @@ - -/* Subroutine to get the last modification time of a file */ - -/* (A separate file because this may be OS dependent) */ - -#include "Python.h" -#include "pyconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -time_t -PyOS_GetLastModificationTime(char *path, FILE *fp) -{ - struct stat st; - if (fstat(fileno(fp), &st) != 0) - return -1; - else - return st.st_mtime; -} - -#ifdef __cplusplus -} -#endif - Modified: python/branches/tlee-ast-optimize/Python/graminit.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/graminit.c (original) +++ python/branches/tlee-ast-optimize/Python/graminit.c Wed Jan 14 13:24:17 2009 @@ -2,6 +2,7 @@ #include "pgenheaders.h" #include "grammar.h" +PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, Modified: python/branches/tlee-ast-optimize/Python/import.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/import.c (original) +++ python/branches/tlee-ast-optimize/Python/import.c Wed Jan 14 13:24:17 2009 @@ -29,8 +29,6 @@ typedef unsigned short mode_t; #endif -extern time_t PyOS_GetLastModificationTime(char *, FILE *); - /* In getmtime.c */ /* Magic word to reject .pyc files generated by other Python versions. It should change for each incompatible change to the bytecode. @@ -75,9 +73,10 @@ Python 2.5c2: 62131 (fix wrong code: for x, in ... in listcomp/genexp) 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) . */ -#define MAGIC (62161 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (62171 | ((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 @@ -930,6 +929,49 @@ PySys_WriteStderr("# wrote %s\n", cpathname); } +static void +update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname) +{ + PyObject *constants, *tmp; + Py_ssize_t i, n; + + if (!_PyString_Eq(co->co_filename, oldname)) + return; + + tmp = co->co_filename; + co->co_filename = newname; + Py_INCREF(co->co_filename); + Py_DECREF(tmp); + + constants = co->co_consts; + n = PyTuple_GET_SIZE(constants); + for (i = 0; i < n; i++) { + tmp = PyTuple_GET_ITEM(constants, i); + if (PyCode_Check(tmp)) + update_code_filenames((PyCodeObject *)tmp, + oldname, newname); + } +} + +static int +update_compiled_module(PyCodeObject *co, char *pathname) +{ + PyObject *oldname, *newname; + + if (strcmp(PyString_AsString(co->co_filename), pathname) == 0) + return 0; + + newname = PyString_FromString(pathname); + if (newname == NULL) + return -1; + + oldname = co->co_filename; + Py_INCREF(oldname); + update_code_filenames(co, oldname, newname); + Py_DECREF(oldname); + Py_DECREF(newname); + return 1; +} /* Load a source module from a given file and return its module object WITH INCREMENTED REFERENCE COUNT. If there's a matching @@ -970,6 +1012,8 @@ fclose(fpc); if (co == NULL) return NULL; + if (update_compiled_module(co, pathname) < 0) + return NULL; if (Py_VerboseFlag) PySys_WriteStderr("import %s # precompiled from %s\n", name, cpathname); @@ -3174,24 +3218,11 @@ return -1; } else { #ifndef RISCOS +#ifndef MS_WINDOWS struct stat statbuf; int rv; rv = stat(path, &statbuf); -#ifdef MS_WINDOWS - /* MS Windows stat() chokes on paths like C:\path\. Try to - * recover *one* time by stripping off a trailing slash or - * backslash. http://bugs.python.org/issue1293 - */ - if (rv != 0 && pathlen <= MAXPATHLEN && - (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { - char mangled[MAXPATHLEN+1]; - - strcpy(mangled, path); - mangled[pathlen-1] = '\0'; - rv = stat(mangled, &statbuf); - } -#endif if (rv == 0) { /* it exists */ if (S_ISDIR(statbuf.st_mode)) { @@ -3201,7 +3232,24 @@ return -1; } } -#else +#else /* MS_WINDOWS */ + DWORD rv; + /* see issue1293 and issue3677: + * stat() on Windows doesn't recognise paths like + * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. + */ + rv = GetFileAttributesA(path); + if (rv != INVALID_FILE_ATTRIBUTES) { + /* it exists */ + if (rv & FILE_ATTRIBUTE_DIRECTORY) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif +#else /* RISCOS */ if (object_exists(path)) { /* it exists */ if (isdir(path)) { Modified: python/branches/tlee-ast-optimize/Python/pythonrun.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/pythonrun.c (original) +++ python/branches/tlee-ast-optimize/Python/pythonrun.c Wed Jan 14 13:24:17 2009 @@ -22,6 +22,10 @@ #include #endif +#ifdef MS_WINDOWS +#include "malloc.h" /* for alloca */ +#endif + #ifdef HAVE_LANGINFO_H #include #include @@ -1670,9 +1674,21 @@ { fprintf(stderr, "Fatal Python error: %s\n", msg); #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif Modified: python/branches/tlee-ast-optimize/Python/sysmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/sysmodule.c (original) +++ python/branches/tlee-ast-optimize/Python/sysmodule.c Wed Jan 14 13:24:17 2009 @@ -1296,8 +1296,13 @@ PyDict_SetItemString(sysdict, key, v); \ Py_XDECREF(v) + /* Check that stdin is not a directory + Using shell redirection, you can redirect stdin to a directory, + crashing the Python interpreter. Catch this common mistake here + and output a useful error message. Note that under MS Windows, + the shell already prevents that. */ +#if !defined(MS_WINDOWS) { - /* XXX: does this work on Win/Win64? (see posix_fstat) */ struct stat sb; if (fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { @@ -1307,6 +1312,7 @@ exit(EXIT_FAILURE); } } +#endif /* Closing the standard FILE* if sys.std* goes aways causes problems * for embedded Python usages. Closing them when somebody explicitly @@ -1526,7 +1532,7 @@ { #if defined(HAVE_REALPATH) char fullpath[MAXPATHLEN]; -#elif defined(MS_WINDOWS) +#elif defined(MS_WINDOWS) && !defined(MS_WINCE) char fullpath[MAX_PATH]; #endif PyObject *av = makeargvobject(argc, argv); @@ -1571,7 +1577,10 @@ #if SEP == '\\' /* Special case for MS filename syntax */ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { char *q; -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) && !defined(MS_WINCE) + /* This code here replaces the first element in argv with the full + path that it represents. Under CE, there are no relative paths so + the argument must be the full path anyway. */ char *ptemp; if (GetFullPathName(argv0, sizeof(fullpath), Modified: python/branches/tlee-ast-optimize/Python/thread.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/thread.c (original) +++ python/branches/tlee-ast-optimize/Python/thread.c Wed Jan 14 13:24:17 2009 @@ -137,10 +137,6 @@ #include "thread_beos.h" #endif -#ifdef WINCE_THREADS -#include "thread_wince.h" -#endif - #ifdef PLAN9_THREADS #include "thread_plan9.h" #endif Modified: python/branches/tlee-ast-optimize/Python/thread_nt.h ============================================================================== --- python/branches/tlee-ast-optimize/Python/thread_nt.h (original) +++ python/branches/tlee-ast-optimize/Python/thread_nt.h Wed Jan 14 13:24:17 2009 @@ -104,20 +104,21 @@ typedef struct { void (*func)(void*); void *arg; - long id; - HANDLE done; } callobj; -static int +/* thunker to call adapt between the function type used by the system's +thread start function and the internally used one. */ +#if defined(MS_WINCE) +static DWORD WINAPI +#else +static unsigned __stdcall +#endif bootstrap(void *call) { callobj *obj = (callobj*)call; - /* copy callobj since other thread might free it before we're done */ void (*func)(void*) = obj->func; void *arg = obj->arg; - - obj->id = PyThread_get_thread_ident(); - ReleaseSemaphore(obj->done, 1, NULL); + HeapFree(GetProcessHeap(), 0, obj); func(arg); return 0; } @@ -125,42 +126,55 @@ long PyThread_start_new_thread(void (*func)(void *), void *arg) { - Py_uintptr_t rv; - callobj obj; - + HANDLE hThread; + unsigned threadID; + callobj *obj; + dprintf(("%ld: PyThread_start_new_thread called\n", PyThread_get_thread_ident())); if (!initialized) PyThread_init_thread(); - obj.id = -1; /* guilty until proved innocent */ - obj.func = func; - obj.arg = arg; - obj.done = CreateSemaphore(NULL, 0, 1, NULL); - if (obj.done == NULL) + obj = (callobj*)HeapAlloc(GetProcessHeap(), 0, sizeof(*obj)); + if (!obj) return -1; - - rv = _beginthread(bootstrap, + obj->func = func; + obj->arg = arg; +#if defined(MS_WINCE) + hThread = CreateThread(NULL, + Py_SAFE_DOWNCAST(_pythread_stacksize, Py_ssize_t, SIZE_T), + bootstrap, obj, 0, &threadID); +#else + hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(_pythread_stacksize, - Py_ssize_t, int), - &obj); - if (rv == (Py_uintptr_t)-1) { + Py_ssize_t, unsigned int), + bootstrap, obj, + 0, &threadID); +#endif + if (hThread == 0) { +#if defined(MS_WINCE) + /* Save error in variable, to prevent PyThread_get_thread_ident + from clobbering it. */ + unsigned e = GetLastError(); + dprintf(("%ld: PyThread_start_new_thread failed, win32 error code %u\n", + PyThread_get_thread_ident(), e)); +#else /* I've seen errno == EAGAIN here, which means "there are * too many threads". */ - dprintf(("%ld: PyThread_start_new_thread failed: %p errno %d\n", - PyThread_get_thread_ident(), (void*)rv, errno)); - obj.id = -1; + int e = errno; + dprintf(("%ld: PyThread_start_new_thread failed, errno %d\n", + PyThread_get_thread_ident(), e)); +#endif + threadID = (unsigned)-1; + HeapFree(GetProcessHeap(), 0, obj); } else { dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", - PyThread_get_thread_ident(), (void*)rv)); - /* wait for thread to initialize, so we can get its id */ - WaitForSingleObject(obj.done, INFINITE); - assert(obj.id != -1); + PyThread_get_thread_ident(), (void*)hThread)); + CloseHandle(hThread); } - CloseHandle((HANDLE)obj.done); - return obj.id; + return (long) threadID; } /* @@ -176,52 +190,26 @@ return GetCurrentThreadId(); } -static void -do_PyThread_exit_thread(int no_cleanup) -{ - dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); - if (!initialized) - if (no_cleanup) - _exit(0); - else - exit(0); - _endthread(); -} - void PyThread_exit_thread(void) { - do_PyThread_exit_thread(0); -} - -void -PyThread__exit_thread(void) -{ - do_PyThread_exit_thread(1); -} - -#ifndef NO_EXIT_PROG -static void -do_PyThread_exit_prog(int status, int no_cleanup) -{ - dprintf(("PyThread_exit_prog(%d) called\n", status)); + dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); if (!initialized) - if (no_cleanup) - _exit(status); - else - exit(status); + exit(0); +#if defined(MS_WINCE) + ExitThread(0); +#else + _endthreadex(0); +#endif } +#ifndef NO_EXIT_PROG void PyThread_exit_prog(int status) { - do_PyThread_exit_prog(status, 0); -} - -void -PyThread__exit_prog(int status) -{ - do_PyThread_exit_prog(status, 1); + dprintf(("PyThread_exit_prog(%d) called\n", status)); + if (!initialized) + exit(status); } #endif /* NO_EXIT_PROG */ @@ -309,3 +297,73 @@ } #define THREAD_SET_STACKSIZE(x) _pythread_nt_set_stacksize(x) + + +/* use native Windows TLS functions */ +#define Py_HAVE_NATIVE_TLS + +#ifdef Py_HAVE_NATIVE_TLS +int +PyThread_create_key(void) +{ + return (int) TlsAlloc(); +} + +void +PyThread_delete_key(int key) +{ + TlsFree(key); +} + +/* We must be careful to emulate the strange semantics implemented in thread.c, + * where the value is only set if it hasn't been set before. + */ +int +PyThread_set_key_value(int key, void *value) +{ + BOOL ok; + void *oldvalue; + + assert(value != NULL); + oldvalue = TlsGetValue(key); + if (oldvalue != NULL) + /* ignore value if already set */ + return 0; + ok = TlsSetValue(key, value); + if (!ok) + return -1; + return 0; +} + +void * +PyThread_get_key_value(int key) +{ + /* because TLS is used in the Py_END_ALLOW_THREAD macro, + * it is necessary to preserve the windows error state, because + * it is assumed to be preserved across the call to the macro. + * Ideally, the macro should be fixed, but it is simpler to + * do it here. + */ + DWORD error = GetLastError(); + void *result = TlsGetValue(key); + SetLastError(error); + return result; +} + +void +PyThread_delete_key_value(int key) +{ + /* NULL is used as "key missing", and it is also the default + * given by TlsGetValue() if nothing has been set yet. + */ + TlsSetValue(key, NULL); +} + +/* reinitialization of TLS is not necessary after fork when using + * the native TLS functions. And forking isn't supported on Windows either. + */ +void +PyThread_ReInitTLS(void) +{} + +#endif Modified: python/branches/tlee-ast-optimize/README ============================================================================== --- python/branches/tlee-ast-optimize/README (original) +++ python/branches/tlee-ast-optimize/README Wed Jan 14 13:24:17 2009 @@ -1,7 +1,7 @@ -This is Python version 2.6 -========================== +This is Python version 2.7 alpha 0 +================================== -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. Modified: python/branches/tlee-ast-optimize/RISCOS/Makefile ============================================================================== --- python/branches/tlee-ast-optimize/RISCOS/Makefile (original) +++ python/branches/tlee-ast-optimize/RISCOS/Makefile Wed Jan 14 13:24:17 2009 @@ -135,7 +135,6 @@ OBJECTS_RISCOS = \ @.Python.o.dynload_riscos\ @.Python.o.getcwd_riscos\ - @.Python.o.getmtime_riscos\ @.o.unixstuff Deleted: python/branches/tlee-ast-optimize/RISCOS/Python/getmtime_riscos.c ============================================================================== --- python/branches/tlee-ast-optimize/RISCOS/Python/getmtime_riscos.c Wed Jan 14 13:24:17 2009 +++ (empty file) @@ -1,20 +0,0 @@ -#include - -#define __swi -#include "oslib/osfile.h" - -long PyOS_GetLastModificationTime(char *path, FILE *fp) -{ - int obj; - bits load, exec, ftype; - - if (xosfile_read_stamped_no_path(path, &obj, &load, &exec, 0, 0, &ftype)) return -1; - if (obj != osfile_IS_FILE) return -1; - if (ftype == osfile_TYPE_UNTYPED) return -1; - - load &= 0xFF; - load -= 51; - if (exec < 1855548004U) load--; - exec -= 1855548004U; - return exec/100+42949672*load+(95*load)/100; -} Modified: python/branches/tlee-ast-optimize/Tools/msi/crtlicense.txt ============================================================================== --- python/branches/tlee-ast-optimize/Tools/msi/crtlicense.txt (original) +++ python/branches/tlee-ast-optimize/Tools/msi/crtlicense.txt Wed Jan 14 13:24:17 2009 @@ -26,7 +26,7 @@ - alter any copyright, trademark or patent notice in Microsoft's Distributable Code; -- use Microsoft?s trademarks in your programs? names or in a way that +- use Microsoft's trademarks in your programs' names or in a way that suggests your programs come from or are endorsed by Microsoft; - distribute Microsoft's Distributable Code to run on a platform other Modified: python/branches/tlee-ast-optimize/Tools/msi/msi.py ============================================================================== --- python/branches/tlee-ast-optimize/Tools/msi/msi.py (original) +++ python/branches/tlee-ast-optimize/Tools/msi/msi.py Wed Jan 14 13:24:17 2009 @@ -116,6 +116,8 @@ # Compute the name that Sphinx gives to the docfile docfile = "" +if micro: + docfile = str(micro) if level < 0xf: docfile = '%x%s' % (level, serial) docfile = 'python%s%s%s.chm' % (major, minor, docfile) @@ -1248,7 +1250,10 @@ "[TARGETDIR]Doc\\"+docfile , "REGISTRY.doc"), ("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"), ("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe", - "", r"[TARGETDIR]Python.exe", "REGISTRY.def") + "", r"[TARGETDIR]Python.exe", "REGISTRY.def"), + ("DisplayIcon", -1, + r"Software\Microsoft\Windows\CurrentVersion\Uninstall\%s" % product_code, + "DisplayIcon", "[TARGETDIR]python.exe", "REGISTRY.def") ]) # Shortcuts, see "Shortcut Table" add_data(db, "Directory", Modified: python/branches/tlee-ast-optimize/Tools/msi/uuids.py ============================================================================== --- python/branches/tlee-ast-optimize/Tools/msi/uuids.py (original) +++ python/branches/tlee-ast-optimize/Tools/msi/uuids.py Wed Jan 14 13:24:17 2009 @@ -47,4 +47,7 @@ '2.6.121': '{bbd34464-ddeb-4028-99e5-f16c4a8fbdb3}', # 2.6c1 '2.6.122': '{8f64787e-a023-4c60-bfee-25d3a3f592c6}', # 2.6c2 '2.6.150': '{110eb5c4-e995-4cfb-ab80-a5f315bea9e8}', # 2.6.0 + '2.6.1150':'{9cc89170-000b-457d-91f1-53691f85b223}', # 2.6.1 + '2.6.2121':'{adac412b-b209-4c15-b6ab-dca1b6e47144}', # 2.6.2c1 + '2.6.2150':'{24aab420-4e30-4496-9739-3e216f3de6ae}', # 2.6.2 } Modified: python/branches/tlee-ast-optimize/Tools/pybench/Lists.py ============================================================================== --- python/branches/tlee-ast-optimize/Tools/pybench/Lists.py (original) +++ python/branches/tlee-ast-optimize/Tools/pybench/Lists.py Wed Jan 14 13:24:17 2009 @@ -293,3 +293,58 @@ for i in xrange(self.rounds): pass + +class SimpleListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + n = range(10) * 10 + + for i in xrange(self.rounds): + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + l = [x for x in n] + l = [x for x in n if x] + l = [x for x in n if not x] + + def calibrate(self): + + n = range(10) * 10 + + for i in xrange(self.rounds): + pass + +class NestedListComprehensions(Test): + + version = 2.0 + operations = 6 + rounds = 20000 + + def test(self): + + m = range(10) + n = range(10) + + for i in xrange(self.rounds): + l = [x for x in n for y in m] + l = [y for x in n for y in m] + + l = [x for x in n for y in m if y] + l = [y for x in n for y in m if x] + + l = [x for x in n for y in m if not y] + l = [y for x in n for y in m if not x] + + def calibrate(self): + + m = range(10) + n = range(10) + + for i in xrange(self.rounds): + pass Modified: python/branches/tlee-ast-optimize/Tools/scripts/patchcheck.py ============================================================================== --- python/branches/tlee-ast-optimize/Tools/scripts/patchcheck.py (original) +++ python/branches/tlee-ast-optimize/Tools/scripts/patchcheck.py Wed Jan 14 13:24:17 2009 @@ -62,12 +62,12 @@ @status("Misc/ACKS updated", modal=True) def credit_given(file_paths): """Check if Misc/ACKS has been changed.""" - return True if 'Misc/ACKS' in file_paths else False + return 'Misc/ACKS' in file_paths @status("Misc/NEWS updated", modal=True) def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" - return True if 'Misc/NEWS' in file_paths else False + return 'Misc/NEWS' in file_paths def main(): Modified: python/branches/tlee-ast-optimize/configure ============================================================================== --- python/branches/tlee-ast-optimize/configure (original) +++ python/branches/tlee-ast-optimize/configure Wed Jan 14 13:24:17 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67227 . +# From configure.in Revision: 68299 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -2256,7 +2256,7 @@ if test "${with_gcc+set}" = set; then withval=$with_gcc; case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -4139,6 +4139,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -13003,6 +13009,7 @@ { echo "$as_me:$LINENO: result: $SO" >&5 echo "${ECHO_T}$SO" >&6; } + cat >>confdefs.h <<_ACEOF #define SHLIB_EXT "$SO" _ACEOF @@ -13403,7 +13410,7 @@ fi # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } @@ -21516,6 +21523,94 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +if test "${ac_cv_x87_double_rounding+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +if test "$cross_compiling" = yes; then + ac_cv_x87_double_rounding=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_x87_double_rounding=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_x87_double_rounding=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +if test "$ac_cv_x87_double_rounding" = yes +then + +cat >>confdefs.h <<\_ACEOF +#define X87_DOUBLE_ROUNDING 1 +_ACEOF + +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. { echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 @@ -21593,7 +21688,14 @@ fi -for ac_func in hypot + + + + + + + +for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21683,33 +21785,79 @@ #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - fi done +{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isinf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +#ifndef isinf + (void) isinf; +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isinf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_have_decl_isinf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } +if test $ac_cv_have_decl_isinf = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 1 +_ACEOF +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 0 +_ACEOF - - -for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +fi +{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isnan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21718,53 +21866,94 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +#include -#ifdef __STDC__ -# include -#else -# include +int +main () +{ +#ifndef isnan + (void) isnan; #endif -#undef $ac_func + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isnan=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif + ac_cv_have_decl_isnan=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } +if test $ac_cv_have_decl_isnan = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isfinite+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include int main () { -return $ac_func (); +#ifndef isfinite + (void) isfinite; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21773,29 +21962,34 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isfinite=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_have_decl_isfinite=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } +if test $ac_cv_have_decl_isfinite = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 1 +_ACEOF + + +else cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_DECL_ISFINITE 0 _ACEOF + fi -done + LIBS=$LIBS_SAVE Modified: python/branches/tlee-ast-optimize/configure.in ============================================================================== --- python/branches/tlee-ast-optimize/configure.in (original) +++ python/branches/tlee-ast-optimize/configure.in Wed Jan 14 13:24:17 2009 @@ -1,7 +1,7 @@ dnl *********************************************** dnl * Please run autoreconf to test your changes! * dnl *********************************************** -dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63). +dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.61). # Set VERSION so we only need to edit in one place (i.e., here) m4_define(PYTHON_VERSION, 2.7) @@ -407,7 +407,7 @@ AC_HELP_STRING(--without-gcc,never use gcc), [ case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -737,6 +737,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -1597,6 +1603,7 @@ sleep 10 fi AC_MSG_RESULT($SO) + AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 @@ -1844,7 +1851,7 @@ AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 @@ -3136,6 +3143,44 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +AC_MSG_CHECKING(for x87-style double rounding) +AC_CACHE_VAL(ac_cv_x87_double_rounding, [ +AC_TRY_RUN([ +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} +], +ac_cv_x87_double_rounding=no, +ac_cv_x87_double_rounding=yes, +ac_cv_x87_double_rounding=no)]) +AC_MSG_RESULT($ac_cv_x87_double_rounding) +if test "$ac_cv_x87_double_rounding" = yes +then + AC_DEFINE(X87_DOUBLE_ROUNDING, 1, + [Define if arithmetic is subject to x87-style double rounding issue]) +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. AC_MSG_CHECKING(whether tanh preserves the sign of zero) @@ -3162,9 +3207,8 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_REPLACE_FUNCS(hypot) - -AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p]) +AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE Modified: python/branches/tlee-ast-optimize/pyconfig.h.in ============================================================================== --- python/branches/tlee-ast-optimize/pyconfig.h.in (original) +++ python/branches/tlee-ast-optimize/pyconfig.h.in Wed Jan 14 13:24:17 2009 @@ -115,6 +115,18 @@ /* Define if you have the 'resize_term' function. */ #undef HAVE_CURSES_RESIZE_TERM +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#undef HAVE_DECL_ISNAN + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -315,12 +327,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -983,6 +989,9 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if arithmetic is subject to x87-style double rounding issue */ +#undef X87_DOUBLE_ROUNDING + /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ Modified: python/branches/tlee-ast-optimize/setup.py ============================================================================== --- python/branches/tlee-ast-optimize/setup.py (original) +++ python/branches/tlee-ast-optimize/setup.py Wed Jan 14 13:24:17 2009 @@ -215,7 +215,8 @@ if missing: print - print "Failed to find the necessary bits to build these modules:" + print ("Python build finished, but the necessary bits to build " + "these modules were not found:") print_three_column(missing) print ("To find the necessary bits, look in setup.py in" " detect_modules() for the module's name.") @@ -1019,11 +1020,22 @@ exts.append( Extension('dbm', ['dbmmodule.c'], define_macros=[('HAVE_NDBM_H',None)], libraries = ndbm_libs ) ) - elif (self.compiler.find_library_file(lib_dirs, 'gdbm') - and find_file("gdbm/ndbm.h", inc_dirs, []) is not None): - exts.append( Extension('dbm', ['dbmmodule.c'], - define_macros=[('HAVE_GDBM_NDBM_H',None)], - libraries = ['gdbm'] ) ) + elif self.compiler.find_library_file(lib_dirs, 'gdbm'): + gdbm_libs = ['gdbm'] + if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): + gdbm_libs.append('gdbm_compat') + if find_file("gdbm/ndbm.h", inc_dirs, []) is not None: + exts.append( Extension( + 'dbm', ['dbmmodule.c'], + define_macros=[('HAVE_GDBM_NDBM_H',None)], + libraries = gdbm_libs ) ) + elif find_file("gdbm-ndbm.h", inc_dirs, []) is not None: + exts.append( Extension( + 'dbm', ['dbmmodule.c'], + define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)], + libraries = gdbm_libs ) ) + else: + missing.append('dbm') elif db_incs is not None: exts.append( Extension('dbm', ['dbmmodule.c'], library_dirs=dblib_dir, From nnorwitz at gmail.com Wed Jan 14 22:08:21 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 14 Jan 2009 16:08:21 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (2) Message-ID: <20090114210821.GA21788@python.psfb.org> 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657832 refs] From nnorwitz at gmail.com Wed Jan 14 22:15:07 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 14 Jan 2009 16:15:07 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (2) Message-ID: <20090114211507.GA23156@python.psfb.org> 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16830 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657100 refs] From nnorwitz at gmail.com Wed Jan 14 23:32:35 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 14 Jan 2009 17:32:35 -0500 Subject: [Python-checkins] Python Regression Test Failures all (2) Message-ID: <20090114223235.GA4440@python.psfb.org> 332 tests OK. 2 tests failed: test_datetime test_os 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-1832 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 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 332 tests OK. 2 tests failed: test_datetime test_os 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [671704 refs] From buildbot at python.org Thu Jan 15 01:22:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 00:22:43 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 2.6 Message-ID: <20090115002243.A743A1E4002@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/20 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: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_datetime test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor ====================================================================== FAIL: test_close (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/2.6.klose-debian-alpha/build/Lib/test/test_os.py", line 542, in helper self.assertRaises(OSError, getattr(os, f), 10) AssertionError: OSError not raised make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Thu Jan 15 10:08:31 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 15 Jan 2009 04:08:31 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (2) Message-ID: <20090115090831.GA19208@python.psfb.org> 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657826 refs] From python-checkins at python.org Thu Jan 15 10:09:13 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Thu, 15 Jan 2009 10:09:13 +0100 (CET) Subject: [Python-checkins] r68610 - in python/trunk/Lib/test: test_datetime.py test_os.py Message-ID: <20090115090913.870A31E4020@bag.python.org> Author: kristjan.jonsson Date: Thu Jan 15 10:09:13 2009 New Revision: 68610 Log: Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. Modified: python/trunk/Lib/test/test_datetime.py python/trunk/Lib/test/test_os.py Modified: python/trunk/Lib/test/test_datetime.py ============================================================================== --- python/trunk/Lib/test/test_datetime.py (original) +++ python/trunk/Lib/test/test_datetime.py Thu Jan 15 10:09:13 2009 @@ -857,9 +857,18 @@ self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") #make sure that invalid format specifiers are handled correctly - self.assertRaises(ValueError, t.strftime, "%e") - self.assertRaises(ValueError, t.strftime, "%") - self.assertRaises(ValueError, t.strftime, "%#") + #self.assertRaises(ValueError, t.strftime, "%e") + #self.assertRaises(ValueError, t.strftime, "%") + #self.assertRaises(ValueError, t.strftime, "%#") + + #oh well, some systems just ignore those invalid ones. + #at least, excercise them to make sure that no crashes + #are generated + for f in ["%e", "%", "%#"]: + try: + t.strftime(f) + except ValueError: + pass #check that this standard extension works t.strftime("%f") Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Thu Jan 15 10:09:13 2009 @@ -559,11 +559,11 @@ def test_fchown(self): if hasattr(os, "fchown"): - self.assertRaises(OSError, os.fchmod, 10, -1, -1) + self.assertRaises(OSError, os.fchown, 10, -1, -1) def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "foo") + self.assertRaises(OSError, os.fpathconf, 10, "PC_FILESIZEBITS") def test_ftruncate(self): if hasattr(os, "ftruncate"): From nnorwitz at gmail.com Thu Jan 15 10:15:16 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 15 Jan 2009 04:15:16 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (2) Message-ID: <20090115091516.GA26820@python.psfb.org> 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 test_datetime failed -- errors occurred; run in verbose mode for details test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 327 tests OK. 2 tests failed: test_datetime test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657102 refs] From nnorwitz at gmail.com Thu Jan 15 11:53:06 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 15 Jan 2009 05:53:06 -0500 Subject: [Python-checkins] Python Regression Test Failures all (2) Message-ID: <20090115105306.GA15549@python.psfb.org> 332 tests OK. 2 tests failed: test_datetime test_os 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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-12943 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 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 test_datetime failed -- errors occurred; run in verbose mode for details 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- errors occurred; run in verbose mode for details 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 refs] 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer 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 332 tests OK. 2 tests failed: test_datetime test_os 25 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_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [671703 refs] From python-checkins at python.org Thu Jan 15 15:54:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 15:54:37 +0100 (CET) Subject: [Python-checkins] r68611 - in python/trunk: Lib/test/test_socket.py Misc/NEWS Message-ID: <20090115145437.D49BF1E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 15:54:37 2009 New Revision: 68611 Log: Issue #4397. Fix occasional test_socket failure on OS X. Modified: python/trunk/Lib/test/test_socket.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/test/test_socket.py ============================================================================== --- python/trunk/Lib/test/test_socket.py (original) +++ python/trunk/Lib/test/test_socket.py Thu Jan 15 15:54:37 2009 @@ -584,6 +584,10 @@ # Testing shutdown() msg = self.cli_conn.recv(1024) self.assertEqual(msg, MSG) + # wait for _testShutdown to finish: on OS X, when the server + # closes the connection the client also becomes disconnected, + # and the client's shutdown call will fail. (Issue #4937.) + self.done.wait() def _testShutdown(self): self.serv_conn.send(MSG) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 15 15:54:37 2009 @@ -357,6 +357,8 @@ Extension Modules ----------------- +- Issue #4937: Fix occasional test_socket failure on OS X. + - Issue #4279: Fix build of parsermodule under Cygwin. - Issue #4051: Prevent conflict of UNICODE macros in cPickle. From python-checkins at python.org Thu Jan 15 15:58:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 15:58:28 +0100 (CET) Subject: [Python-checkins] r68612 - python/trunk/Lib/test/test_socket.py Message-ID: <20090115145828.DFBBF1E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 15:58:28 2009 New Revision: 68612 Log: Comment typo Modified: python/trunk/Lib/test/test_socket.py Modified: python/trunk/Lib/test/test_socket.py ============================================================================== --- python/trunk/Lib/test/test_socket.py (original) +++ python/trunk/Lib/test/test_socket.py Thu Jan 15 15:58:28 2009 @@ -586,7 +586,7 @@ self.assertEqual(msg, MSG) # wait for _testShutdown to finish: on OS X, when the server # closes the connection the client also becomes disconnected, - # and the client's shutdown call will fail. (Issue #4937.) + # and the client's shutdown call will fail. (Issue #4397.) self.done.wait() def _testShutdown(self): From python-checkins at python.org Thu Jan 15 16:17:43 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 16:17:43 +0100 (CET) Subject: [Python-checkins] r68613 - python/trunk/Misc/NEWS Message-ID: <20090115151743.3FC4B1E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 16:17:43 2009 New Revision: 68613 Log: Another typo fix. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 15 16:17:43 2009 @@ -357,7 +357,7 @@ Extension Modules ----------------- -- Issue #4937: Fix occasional test_socket failure on OS X. +- Issue #4397: Fix occasional test_socket failure on OS X. - Issue #4279: Fix build of parsermodule under Cygwin. From python-checkins at python.org Thu Jan 15 16:25:52 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 16:25:52 +0100 (CET) Subject: [Python-checkins] r68614 - in python/branches/release26-maint: Lib/test/test_socket.py Misc/NEWS Message-ID: <20090115152552.049CE1E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 16:25:51 2009 New Revision: 68614 Log: Merged revisions 68611-68613 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68611 | mark.dickinson | 2009-01-15 14:54:37 +0000 (Thu, 15 Jan 2009) | 2 lines Issue #4397. Fix occasional test_socket failure on OS X. ........ r68612 | mark.dickinson | 2009-01-15 14:58:28 +0000 (Thu, 15 Jan 2009) | 2 lines Comment typo ........ r68613 | mark.dickinson | 2009-01-15 15:17:43 +0000 (Thu, 15 Jan 2009) | 2 lines Another typo fix. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_socket.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/test/test_socket.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_socket.py (original) +++ python/branches/release26-maint/Lib/test/test_socket.py Thu Jan 15 16:25:51 2009 @@ -584,6 +584,10 @@ # Testing shutdown() msg = self.cli_conn.recv(1024) self.assertEqual(msg, MSG) + # wait for _testShutdown to finish: on OS X, when the server + # closes the connection the client also becomes disconnected, + # and the client's shutdown call will fail. (Issue #4397.) + self.done.wait() def _testShutdown(self): self.serv_conn.send(MSG) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Jan 15 16:25:51 2009 @@ -314,6 +314,8 @@ Extension Modules ----------------- +- Issue #4397: Fix occasional test_socket failure on OS X. + - Issue #4279: Fix build of parsermodule under Cygwin. - Issue #4051: Prevent conflict of UNICODE macros in cPickle. From python-checkins at python.org Thu Jan 15 16:36:10 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 16:36:10 +0100 (CET) Subject: [Python-checkins] r68615 - in python/branches/py3k: Lib/test/test_socket.py Misc/NEWS Message-ID: <20090115153610.A07951E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 16:36:10 2009 New Revision: 68615 Log: Merged revisions 68611-68613 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68611 | mark.dickinson | 2009-01-15 14:54:37 +0000 (Thu, 15 Jan 2009) | 2 lines Issue #4397. Fix occasional test_socket failure on OS X. ........ r68612 | mark.dickinson | 2009-01-15 14:58:28 +0000 (Thu, 15 Jan 2009) | 2 lines Comment typo ........ r68613 | mark.dickinson | 2009-01-15 15:17:43 +0000 (Thu, 15 Jan 2009) | 2 lines Another typo fix. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_socket.py python/branches/py3k/Misc/NEWS 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 Thu Jan 15 16:36:10 2009 @@ -603,6 +603,10 @@ # Testing shutdown() msg = self.cli_conn.recv(1024) self.assertEqual(msg, MSG) + # wait for _testShutdown to finish: on OS X, when the server + # closes the connection the client also becomes disconnected, + # and the client's shutdown call will fail. (Issue #4397.) + self.done.wait() def _testShutdown(self): self.serv_conn.send(MSG) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 15 16:36:10 2009 @@ -308,6 +308,8 @@ Extension Modules ----------------- +- Issue #4397: Fix occasional test_socket failure on OS X. + - Issue #4279: Fix build of parsermodule under Cygwin. - Issue #4751: hashlib now releases the GIL when hashing large buffers From python-checkins at python.org Thu Jan 15 16:37:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 16:37:41 +0100 (CET) Subject: [Python-checkins] r68616 - in python/branches/release30-maint: Lib/test/test_socket.py Misc/NEWS Message-ID: <20090115153741.77C381E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 16:37:41 2009 New Revision: 68616 Log: Merged revisions 68615 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68615 | mark.dickinson | 2009-01-15 15:36:10 +0000 (Thu, 15 Jan 2009) | 17 lines Merged revisions 68611-68613 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68611 | mark.dickinson | 2009-01-15 14:54:37 +0000 (Thu, 15 Jan 2009) | 2 lines Issue #4397. Fix occasional test_socket failure on OS X. ........ r68612 | mark.dickinson | 2009-01-15 14:58:28 +0000 (Thu, 15 Jan 2009) | 2 lines Comment typo ........ r68613 | mark.dickinson | 2009-01-15 15:17:43 +0000 (Thu, 15 Jan 2009) | 2 lines Another typo fix. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_socket.py python/branches/release30-maint/Misc/NEWS 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 Thu Jan 15 16:37:41 2009 @@ -603,6 +603,10 @@ # Testing shutdown() msg = self.cli_conn.recv(1024) self.assertEqual(msg, MSG) + # wait for _testShutdown to finish: on OS X, when the server + # closes the connection the client also becomes disconnected, + # and the client's shutdown call will fail. (Issue #4397.) + self.done.wait() def _testShutdown(self): self.serv_conn.send(MSG) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Jan 15 16:37:41 2009 @@ -225,6 +225,8 @@ Extension Modules ----------------- +- Issue #4397: Fix occasional test_socket failure on OS X. + - Issue #4279: Fix build of parsermodule under Cygwin. - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. From python-checkins at python.org Thu Jan 15 16:43:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 15 Jan 2009 16:43:14 +0100 (CET) Subject: [Python-checkins] r68617 - sandbox/trunk/io-c/_textio.c Message-ID: <20090115154314.512541E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 15 16:43:14 2009 New Revision: 68617 Log: Speedup TextIOWrapper.write() a bit Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Thu Jan 15 16:43:14 2009 @@ -567,9 +567,10 @@ if (newline) self->readnl = PyUnicode_FromString(newline); self->writetranslate = (newline == NULL || newline[0] != '\0'); - if (!self->readuniversal) { - if (self->readnl) - self->writenl = _PyUnicode_AsString(self->readnl); + if (!self->readuniversal && self->readnl) { + self->writenl = _PyUnicode_AsString(self->readnl); + if (!strcmp(self->writenl, "\n")) + self->writenl = NULL; } #ifdef MS_WINDOWS else @@ -743,7 +744,7 @@ textlen = PyUnicode_GetSize(text); - if (self->writetranslate || self->line_buffering) + if ((self->writetranslate && self->writenl != NULL) || self->line_buffering) if (findchar(PyUnicode_AS_UNICODE(text), PyUnicode_GET_SIZE(text), '\n')) haslf = 1; @@ -764,19 +765,19 @@ needflush = 1; /* XXX What if we were just reading? */ - b = PyObject_CallMethod(self->encoder, "encode", "O", text); + b = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_encode, text, NULL); Py_DECREF(text); if (b == NULL) return NULL; - ret = PyObject_CallMethod(self->buffer, "write", "O", b); + ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_write, b, NULL); Py_DECREF(b); if (ret == NULL) return NULL; Py_DECREF(ret); if (needflush) { - ret = PyObject_CallMethod(self->buffer, "flush", NULL); + ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_flush, NULL); if (ret == NULL) return NULL; Py_DECREF(ret); From python-checkins at python.org Thu Jan 15 18:20:21 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Thu, 15 Jan 2009 18:20:21 +0100 (CET) Subject: [Python-checkins] r68618 - python/trunk/Lib/smtplib.py Message-ID: <20090115172021.66C031E4002@bag.python.org> Author: kristjan.jonsson Date: Thu Jan 15 18:20:21 2009 New Revision: 68618 Log: Issue 4929: Handle socket errors when receiving Modified: python/trunk/Lib/smtplib.py Modified: python/trunk/Lib/smtplib.py ============================================================================== --- python/trunk/Lib/smtplib.py (original) +++ python/trunk/Lib/smtplib.py Thu Jan 15 18:20:21 2009 @@ -334,7 +334,10 @@ if self.file is None: self.file = self.sock.makefile('rb') while 1: - line = self.file.readline() + try: + line = self.file.readline() + except socket.error: + line = '' if line == '': self.close() raise SMTPServerDisconnected("Connection unexpectedly closed") From buildbot at python.org Thu Jan 15 18:29:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 17:29:55 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090115172956.155191E400C@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/110 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_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Thu Jan 15 20:32:24 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 20:32:24 +0100 (CET) Subject: [Python-checkins] r68619 - in python/branches/py3k: Lib/test/test_binop.py Lib/test/test_cmath.py Modules/_struct.c Objects/complexobject.c Objects/floatobject.c Objects/longobject.c Objects/weakrefobject.c PC/winreg.c Message-ID: <20090115193224.2D1B51E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 20:32:23 2009 New Revision: 68619 Log: Issue 4910, patch 2 of (probably) 3: pave the way for renaming of nb_long: remove last remaining use of nb_long (in the struct module) from the core, set nb_long slots on all builtin and extension types to 0, and remove uses of __long__ in test_complex and test_binop. Reviewed by Benjamin Peterson. Modified: python/branches/py3k/Lib/test/test_binop.py python/branches/py3k/Lib/test/test_cmath.py python/branches/py3k/Modules/_struct.c python/branches/py3k/Objects/complexobject.c python/branches/py3k/Objects/floatobject.c python/branches/py3k/Objects/longobject.c python/branches/py3k/Objects/weakrefobject.c python/branches/py3k/PC/winreg.c Modified: python/branches/py3k/Lib/test/test_binop.py ============================================================================== --- python/branches/py3k/Lib/test/test_binop.py (original) +++ python/branches/py3k/Lib/test/test_binop.py Thu Jan 15 20:32:23 2009 @@ -77,12 +77,6 @@ repr(self)) raise ValueError("can't convert %s to int" % repr(self)) - def __long__(self): - """Convert a Rat to an long; self.den must be 1.""" - if self.__den == 1: - return int(self.__num) - raise ValueError("can't convert %s to long" % repr(self)) - def __add__(self, other): """Add two Rats, or a Rat and a number.""" if isint(other): Modified: python/branches/py3k/Lib/test/test_cmath.py ============================================================================== --- python/branches/py3k/Lib/test/test_cmath.py (original) +++ python/branches/py3k/Lib/test/test_cmath.py Thu Jan 15 20:32:23 2009 @@ -182,11 +182,9 @@ pass class MyInt(object): def __int__(self): return 2 - def __long__(self): return 2 def __index__(self): return 2 class MyIntOS: def __int__(self): return 2 - def __long__(self): return 2 def __index__(self): return 2 # other possible combinations of __float__ and __complex__ @@ -219,7 +217,7 @@ self.assertEqual(f(JustFloatOS()), f(flt_arg)) # TypeError should be raised for classes not providing # either __complex__ or __float__, even if they provide - # __int__, __long__ or __index__. An old-style class + # __int__ or __index__. An old-style class # currently raises AttributeError instead of a TypeError; # this could be considered a bug. self.assertRaises(TypeError, f, NeitherComplexNorFloat()) Modified: python/branches/py3k/Modules/_struct.c ============================================================================== --- python/branches/py3k/Modules/_struct.c (original) +++ python/branches/py3k/Modules/_struct.c Thu Jan 15 20:32:23 2009 @@ -127,8 +127,8 @@ return v; } m = Py_TYPE(v)->tp_as_number; - if (m != NULL && m->nb_long != NULL) { - v = m->nb_long(v); + if (m != NULL && m->nb_int != NULL) { + v = m->nb_int(v); if (v == NULL) return NULL; if (PyLong_Check(v)) Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Thu Jan 15 20:32:23 2009 @@ -661,14 +661,6 @@ } static PyObject * -complex_long(PyObject *v) -{ - PyErr_SetString(PyExc_TypeError, - "can't convert complex to long; use long(abs(z))"); - return NULL; -} - -static PyObject * complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, @@ -1068,7 +1060,7 @@ 0, /* nb_xor */ 0, /* nb_or */ complex_int, /* nb_int */ - complex_long, /* nb_long */ + 0, /* nb_long */ complex_float, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Thu Jan 15 20:32:23 2009 @@ -1798,7 +1798,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ float_trunc, /*nb_int*/ - float_trunc, /*nb_long*/ + 0, /*nb_long*/ float_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Thu Jan 15 20:32:23 2009 @@ -3830,7 +3830,7 @@ long_xor, /*nb_xor*/ long_or, /*nb_or*/ long_long, /*nb_int*/ - long_long, /*nb_long*/ + 0, /*nb_long*/ long_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/weakrefobject.c ============================================================================== --- python/branches/py3k/Objects/weakrefobject.c (original) +++ python/branches/py3k/Objects/weakrefobject.c Thu Jan 15 20:32:23 2009 @@ -489,7 +489,6 @@ WRAP_BINARY(proxy_xor, PyNumber_Xor) WRAP_BINARY(proxy_or, PyNumber_Or) WRAP_UNARY(proxy_int, PyNumber_Int) -WRAP_UNARY(proxy_long, PyNumber_Long) WRAP_UNARY(proxy_float, PyNumber_Float) WRAP_BINARY(proxy_iadd, PyNumber_InPlaceAdd) WRAP_BINARY(proxy_isub, PyNumber_InPlaceSubtract) @@ -595,7 +594,7 @@ proxy_xor, /*nb_xor*/ proxy_or, /*nb_or*/ proxy_int, /*nb_int*/ - proxy_long, /*nb_long*/ + 0, /*nb_long*/ proxy_float, /*nb_float*/ proxy_iadd, /*nb_inplace_add*/ proxy_isub, /*nb_inplace_subtract*/ Modified: python/branches/py3k/PC/winreg.c ============================================================================== --- python/branches/py3k/PC/winreg.c (original) +++ python/branches/py3k/PC/winreg.c Thu Jan 15 20:32:23 2009 @@ -451,7 +451,7 @@ PyHKEY_binaryFailureFunc, /* nb_xor */ PyHKEY_binaryFailureFunc, /* nb_or */ PyHKEY_intFunc, /* nb_int */ - PyHKEY_unaryFailureFunc, /* nb_long */ + 0, /* nb_long */ PyHKEY_unaryFailureFunc, /* nb_float */ }; From buildbot at python.org Thu Jan 15 20:49:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 19:49:01 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090115194901.CF92F1E4002@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/124 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_capi Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_capi.py", line 104, in test_main test() _testcapi.error: test_lazy_hash_inheritance: type initialised too soon make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 15 21:08:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 20:08:53 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090115200853.DAAD51E4002@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/114 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_capi Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_capi.py", line 104, in test_main test() _testcapi.error: test_lazy_hash_inheritance: type initialised too soon make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Thu Jan 15 22:08:44 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 15 Jan 2009 16:08:44 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090115210844.GA5539@python.psfb.org> 328 tests OK. 1 test failed: test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 328 tests OK. 1 test failed: test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657840 refs] From python-checkins at python.org Thu Jan 15 22:13:53 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 15 Jan 2009 22:13:53 +0100 (CET) Subject: [Python-checkins] r68620 - in python/branches/release30-maint: Lib/test/test_binop.py Lib/test/test_cmath.py Modules/_struct.c Objects/complexobject.c Objects/floatobject.c Objects/longobject.c Objects/weakrefobject.c PC/winreg.c Message-ID: <20090115211353.A08C51E4002@bag.python.org> Author: mark.dickinson Date: Thu Jan 15 22:13:53 2009 New Revision: 68620 Log: Merged revisions 68619 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68619 | mark.dickinson | 2009-01-15 19:32:23 +0000 (Thu, 15 Jan 2009) | 8 lines Issue 4910, patch 2 of (probably) 3: pave the way for renaming of nb_long: remove last remaining use of nb_long (in the struct module) from the core, set nb_long slots on all builtin and extension types to 0, and remove uses of __long__ in test_complex and test_binop. Reviewed by Benjamin Peterson. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_binop.py python/branches/release30-maint/Lib/test/test_cmath.py python/branches/release30-maint/Modules/_struct.c python/branches/release30-maint/Objects/complexobject.c python/branches/release30-maint/Objects/floatobject.c python/branches/release30-maint/Objects/longobject.c python/branches/release30-maint/Objects/weakrefobject.c python/branches/release30-maint/PC/winreg.c Modified: python/branches/release30-maint/Lib/test/test_binop.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_binop.py (original) +++ python/branches/release30-maint/Lib/test/test_binop.py Thu Jan 15 22:13:53 2009 @@ -77,12 +77,6 @@ repr(self)) raise ValueError("can't convert %s to int" % repr(self)) - def __long__(self): - """Convert a Rat to an long; self.den must be 1.""" - if self.__den == 1: - return int(self.__num) - raise ValueError("can't convert %s to long" % repr(self)) - def __add__(self, other): """Add two Rats, or a Rat and a number.""" if isint(other): Modified: python/branches/release30-maint/Lib/test/test_cmath.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_cmath.py (original) +++ python/branches/release30-maint/Lib/test/test_cmath.py Thu Jan 15 22:13:53 2009 @@ -182,11 +182,9 @@ pass class MyInt(object): def __int__(self): return 2 - def __long__(self): return 2 def __index__(self): return 2 class MyIntOS: def __int__(self): return 2 - def __long__(self): return 2 def __index__(self): return 2 # other possible combinations of __float__ and __complex__ @@ -219,7 +217,7 @@ self.assertEqual(f(JustFloatOS()), f(flt_arg)) # TypeError should be raised for classes not providing # either __complex__ or __float__, even if they provide - # __int__, __long__ or __index__. An old-style class + # __int__ or __index__. An old-style class # currently raises AttributeError instead of a TypeError; # this could be considered a bug. self.assertRaises(TypeError, f, NeitherComplexNorFloat()) Modified: python/branches/release30-maint/Modules/_struct.c ============================================================================== --- python/branches/release30-maint/Modules/_struct.c (original) +++ python/branches/release30-maint/Modules/_struct.c Thu Jan 15 22:13:53 2009 @@ -127,8 +127,8 @@ return v; } m = Py_TYPE(v)->tp_as_number; - if (m != NULL && m->nb_long != NULL) { - v = m->nb_long(v); + if (m != NULL && m->nb_int != NULL) { + v = m->nb_int(v); if (v == NULL) return NULL; if (PyLong_Check(v)) Modified: python/branches/release30-maint/Objects/complexobject.c ============================================================================== --- python/branches/release30-maint/Objects/complexobject.c (original) +++ python/branches/release30-maint/Objects/complexobject.c Thu Jan 15 22:13:53 2009 @@ -661,14 +661,6 @@ } static PyObject * -complex_long(PyObject *v) -{ - PyErr_SetString(PyExc_TypeError, - "can't convert complex to long; use long(abs(z))"); - return NULL; -} - -static PyObject * complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, @@ -1068,7 +1060,7 @@ 0, /* nb_xor */ 0, /* nb_or */ complex_int, /* nb_int */ - complex_long, /* nb_long */ + 0, /* nb_long */ complex_float, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/floatobject.c ============================================================================== --- python/branches/release30-maint/Objects/floatobject.c (original) +++ python/branches/release30-maint/Objects/floatobject.c Thu Jan 15 22:13:53 2009 @@ -1798,7 +1798,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ float_trunc, /*nb_int*/ - float_trunc, /*nb_long*/ + 0, /*nb_long*/ float_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Thu Jan 15 22:13:53 2009 @@ -3759,7 +3759,7 @@ long_xor, /*nb_xor*/ long_or, /*nb_or*/ long_long, /*nb_int*/ - long_long, /*nb_long*/ + 0, /*nb_long*/ long_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/weakrefobject.c ============================================================================== --- python/branches/release30-maint/Objects/weakrefobject.c (original) +++ python/branches/release30-maint/Objects/weakrefobject.c Thu Jan 15 22:13:53 2009 @@ -489,7 +489,6 @@ WRAP_BINARY(proxy_xor, PyNumber_Xor) WRAP_BINARY(proxy_or, PyNumber_Or) WRAP_UNARY(proxy_int, PyNumber_Int) -WRAP_UNARY(proxy_long, PyNumber_Long) WRAP_UNARY(proxy_float, PyNumber_Float) WRAP_BINARY(proxy_iadd, PyNumber_InPlaceAdd) WRAP_BINARY(proxy_isub, PyNumber_InPlaceSubtract) @@ -595,7 +594,7 @@ proxy_xor, /*nb_xor*/ proxy_or, /*nb_or*/ proxy_int, /*nb_int*/ - proxy_long, /*nb_long*/ + 0, /*nb_long*/ proxy_float, /*nb_float*/ proxy_iadd, /*nb_inplace_add*/ proxy_isub, /*nb_inplace_subtract*/ Modified: python/branches/release30-maint/PC/winreg.c ============================================================================== --- python/branches/release30-maint/PC/winreg.c (original) +++ python/branches/release30-maint/PC/winreg.c Thu Jan 15 22:13:53 2009 @@ -451,7 +451,7 @@ PyHKEY_binaryFailureFunc, /* nb_xor */ PyHKEY_binaryFailureFunc, /* nb_or */ PyHKEY_intFunc, /* nb_int */ - PyHKEY_unaryFailureFunc, /* nb_long */ + 0, /* nb_long */ PyHKEY_unaryFailureFunc, /* nb_float */ }; From nnorwitz at gmail.com Thu Jan 15 22:15:24 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 15 Jan 2009 16:15:24 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090115211524.GA7238@python.psfb.org> 328 tests OK. 1 test failed: test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test test_os failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/tmp/python-test/local/lib/python2.7/unittest.py", line 345, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 328 tests OK. 1 test failed: test_os 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657108 refs] From buildbot at python.org Thu Jan 15 23:00:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 22:00:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090115220056.CD11C1E4011@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/56 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 683, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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' sincerely, -The Buildbot From buildbot at python.org Thu Jan 15 23:06:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 22:06:01 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090115220601.70F5A1E403C@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/37 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: sincerely, -The Buildbot From python-checkins at python.org Thu Jan 15 23:40:03 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Thu, 15 Jan 2009 23:40:03 +0100 (CET) Subject: [Python-checkins] r68621 - python/trunk/Lib/test/test_os.py Message-ID: <20090115224003.7E5FB1E4002@bag.python.org> Author: kristjan.jonsson Date: Thu Jan 15 23:40:03 2009 New Revision: 68621 Log: Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. 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 Thu Jan 15 23:40:03 2009 @@ -534,8 +534,10 @@ self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): - singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat", + singles = ["fchdir", "fdopen", "dup", "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 getattr(os, f, None): @@ -565,9 +567,10 @@ if hasattr(os, "fpathconf"): self.assertRaises(OSError, os.fpathconf, 10, "PC_FILESIZEBITS") + #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(OSError, os.ftruncate, 10, 0) + self.assertRaises(IOError, os.ftruncate, 10, 0) def test_lseek(self): self.assertRaises(OSError, os.lseek, 10, 0, 0) From python-checkins at python.org Thu Jan 15 23:46:27 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Thu, 15 Jan 2009 23:46:27 +0100 (CET) Subject: [Python-checkins] r68622 - python/trunk/Lib/test/test_os.py Message-ID: <20090115224627.0F2431E403A@bag.python.org> Author: kristjan.jonsson Date: Thu Jan 15 23:46:26 2009 New Revision: 68622 Log: Make all the invalid fd tests for os subject to the function being available. 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 Thu Jan 15 23:46:26 2009 @@ -547,13 +547,16 @@ locals()["test_"+f] = get_single(f) def test_isatty(self): - self.assertEqual(os.isatty(10), False) + if hasattr(os, "isatty"): + self.assertEqual(os.isatty(10), False) def test_closerange(self): - self.assertEqual(os.closerange(10, 20), None) + if hasattr(os, "closerange"): + self.assertEqual(os.closerange(10, 20), None) def test_dup2(self): - self.assertRaises(OSError, os.dup2, 10, 20) + if hasattr(os, "dup2"): + self.assertRaises(OSError, os.dup2, 10, 20) def test_fchmod(self): if hasattr(os, "fchmod"): @@ -573,17 +576,20 @@ self.assertRaises(IOError, os.ftruncate, 10, 0) def test_lseek(self): - self.assertRaises(OSError, os.lseek, 10, 0, 0) + if hasattr(os, "lseek"): + self.assertRaises(OSError, os.lseek, 10, 0, 0) def test_read(self): - self.assertRaises(OSError, os.read, 10, 1) + if hasattr(os, "read"): + self.assertRaises(OSError, os.read, 10, 1) def test_tcsetpgrpt(self): if hasattr(os, "tcsetpgrp"): self.assertRaises(OSError, os.tcsetpgrp, 10, 0) def test_write(self): - self.assertRaises(OSError, os.write, 10, " ") + if hasattr(os, "write"): + self.assertRaises(OSError, os.write, 10, " ") if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): From python-checkins at python.org Thu Jan 15 23:48:14 2009 From: python-checkins at python.org (vinay.sajip) Date: Thu, 15 Jan 2009 23:48:14 +0100 (CET) Subject: [Python-checkins] r68623 - python/trunk/Doc/library/logging.rst Message-ID: <20090115224814.183881E4002@bag.python.org> Author: vinay.sajip Date: Thu Jan 15 23:48:13 2009 New Revision: 68623 Log: Made minor changes/corrections in markup. Added a couple of section headings. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Thu Jan 15 23:48:13 2009 @@ -524,6 +524,9 @@ the message to its destination. Most user-defined subclasses of :class:`Handler` will need to override this :meth:`emit`. +Useful Handlers +--------------- + In addition to the base :class:`Handler` class, many useful subclasses are provided: @@ -532,40 +535,42 @@ #. :class:`FileHandler` instances send error messages to disk files. -#. :class:`handlers.BaseRotatingHandler` is the base class for handlers that +#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated directly. Instead, use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. -#. :class:`handlers.RotatingFileHandler` instances send error messages to disk files, - with support for maximum log file sizes and log file rotation. +#. :class:`RotatingFileHandler` instances send error messages to disk + files, with support for maximum log file sizes and log file rotation. -#. :class:`handlers.TimedRotatingFileHandler` instances send error messages to disk files - rotating the log file at certain timed intervals. +#. :class:`TimedRotatingFileHandler` instances send error messages to + disk files, rotating the log file at certain timed intervals. -#. :class:`handlers.SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`SocketHandler` instances send error messages to TCP/IP + sockets. -#. :class:`handlers.DatagramHandler` instances send error messages to UDP sockets. +#. :class:`DatagramHandler` instances send error messages to UDP + sockets. -#. :class:`handlers.SMTPHandler` instances send error messages to a designated email - address. +#. :class:`SMTPHandler` instances send error messages to a designated + email address. -#. :class:`handlers.SysLogHandler` instances send error messages to a Unix syslog daemon, - possibly on a remote machine. +#. :class:`SysLogHandler` instances send error messages to a Unix + syslog daemon, possibly on a remote machine. -#. :class:`handlers.NTEventLogHandler` instances send error messages to a Windows - NT/2000/XP event log. +#. :class:`NTEventLogHandler` instances send error messages to a + Windows NT/2000/XP event log. -#. :class:`handlers.MemoryHandler` instances send error messages to a buffer in memory, - which is flushed whenever specific criteria are met. +#. :class:`MemoryHandler` instances send error messages to a buffer + in memory, which is flushed whenever specific criteria are met. -#. :class:`handlers.HTTPHandler` instances send error messages to an HTTP server using - either ``GET`` or ``POST`` semantics. +#. :class:`HTTPHandler` instances send error messages to an HTTP + server using either ``GET`` or ``POST`` semantics. -#. :class:`handlers.WatchedFileHandler` instances watch the file they are logging to. If -the file changes, it is closed and reopened using the file name. This handler -is only useful on Unix-like systems; Windows does not support the underlying -mechanism used. +#. :class:`WatchedFileHandler` instances watch the file they are + logging to. If the file changes, it is closed and reopened using the file + name. This handler is only useful on Unix-like systems; Windows does not + support the underlying mechanism used. #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No @@ -602,6 +607,9 @@ name. If this feature is used, messages sent to the named logger and its children are allowed through the filter, and all others dropped. +Module-Level Functions +---------------------- + In addition to the classes described above, there are a number of module- level functions. From buildbot at python.org Thu Jan 15 23:55:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 15 Jan 2009 22:55:14 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090115225514.DB83A1E400C@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/44 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: 1 test failed: test_httpservers ====================================================================== FAIL: test_post (test.test_httpservers.CGIHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_httpservers.py", line 330, in test_post self.assertEquals(res.read(), b'1, python, 123456\n') AssertionError: b'' != b'1, python, 123456\n' sincerely, -The Buildbot From python-checkins at python.org Fri Jan 16 00:04:47 2009 From: python-checkins at python.org (vinay.sajip) Date: Fri, 16 Jan 2009 00:04:47 +0100 (CET) Subject: [Python-checkins] r68624 - python/trunk/Doc/library/logging.rst Message-ID: <20090115230447.BD48E1E4002@bag.python.org> Author: vinay.sajip Date: Fri Jan 16 00:04:47 2009 New Revision: 68624 Log: Minor changes/corrections in markup. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Fri Jan 16 00:04:47 2009 @@ -535,6 +535,8 @@ #. :class:`FileHandler` instances send error messages to disk files. +.. module:: logging.handlers + #. :class:`BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated directly. Instead, use :class:`RotatingFileHandler` or @@ -572,6 +574,8 @@ name. This handler is only useful on Unix-like systems; Windows does not support the underlying mechanism used. +.. currentmodule:: logging + #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if @@ -1658,7 +1662,7 @@ .. versionadded:: 2.6 -.. module:: logging.handlers +.. currentmodule:: logging.handlers The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If From python-checkins at python.org Fri Jan 16 01:28:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 16 Jan 2009 01:28:23 +0100 (CET) Subject: [Python-checkins] r68625 - sandbox/trunk/io-c/_textio.c Message-ID: <20090116002823.6DA181E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 16 01:28:23 2009 New Revision: 68625 Log: Text I/O: speed up small writes by buffering them instead of sending them immediately. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 16 01:28:23 2009 @@ -473,8 +473,20 @@ int seekable:1; int telling:1; + /* Reads and writes are internally buffered in order to speed things up. + However, any read will first flush the write buffer if itsn't empty. + + Please also note that text to be written is first encoded before being + buffered. This is necessary so that encoding errors are immediately + reported to the caller, but it unfortunately means that the + IncrementalEncoder (whose encode() method is always written in Python) + becomes a bottleneck for small writes. + */ PyObject *decoded_chars; /* buffer for text returned from decoder */ Py_ssize_t decoded_chars_used; /* offset into _decoded_chars for read() */ + PyObject *pending_bytes; /* list of bytes objects waiting to be + written, or NULL */ + Py_ssize_t pending_bytes_count; PyObject *snapshot; /* snapshot is either None, or a tuple (dec_flags, next_input) where * dec_flags is the second (integer) item of the decoder state and @@ -521,6 +533,11 @@ Py_CLEAR(self->encoder); Py_CLEAR(self->decoder); Py_CLEAR(self->readnl); + Py_CLEAR(self->decoded_chars); + Py_CLEAR(self->pending_bytes); + Py_CLEAR(self->snapshot); + self->decoded_chars_used = 0; + self->pending_bytes_count = 0; if (encoding == NULL) { /* Try os.device_encoding(fileno) */ @@ -722,6 +739,29 @@ return NULL; } +/* Flush the internal write buffer. This doesn't explicitly flush the + underlying buffered object, though. */ +static int +_TextIOWrapper_writeflush(PyTextIOWrapperObject *self) +{ + PyObject *b, *ret; + + if (self->pending_bytes == NULL) + return 0; + b = _PyBytes_Join(PyBytes_FromStringAndSize(NULL, 0), self->pending_bytes); + if (b == NULL) + return -1; + ret = PyObject_CallMethodObjArgs(self->buffer, + _PyIO_str_write, b, NULL); + Py_DECREF(b); + if (ret == NULL) + return -1; + Py_DECREF(ret); + Py_CLEAR(self->pending_bytes); + self->pending_bytes_count = 0; + return 0; +} + static PyObject * TextIOWrapper_write(PyTextIOWrapperObject *self, PyObject *args) { @@ -770,12 +810,25 @@ if (b == NULL) return NULL; - ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_write, b, NULL); - Py_DECREF(b); - if (ret == NULL) + if (self->pending_bytes == NULL) { + self->pending_bytes = PyList_New(0); + if (self->pending_bytes == NULL) { + Py_DECREF(b); + return NULL; + } + self->pending_bytes_count = 0; + } + if (PyList_Append(self->pending_bytes, b) < 0) { + Py_DECREF(b); return NULL; - Py_DECREF(ret); - + } + self->pending_bytes_count += PyBytes_GET_SIZE(b); + Py_DECREF(b); + if (self->pending_bytes_count > self->chunk_size || needflush) { + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + } + if (needflush) { ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_flush, NULL); if (ret == NULL) @@ -968,6 +1021,9 @@ CHECK_CLOSED(self); + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + if (n < 0) { /* Read everything */ PyObject *bytes = PyObject_CallMethod(self->buffer, "read", NULL); @@ -1160,6 +1216,9 @@ CHECK_CLOSED(self); + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + chunked = 0; while (1) { @@ -1594,6 +1653,8 @@ goto fail; } + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; res = PyObject_CallMethod((PyObject *)self, "flush", NULL); if (res == NULL) goto fail; @@ -1783,6 +1844,8 @@ CHECK_INITIALIZED(self); CHECK_CLOSED(self); self->telling = self->seekable; + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; return PyObject_CallMethod(self->buffer, "flush", NULL); } From python-checkins at python.org Fri Jan 16 03:24:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 16 Jan 2009 03:24:24 +0100 (CET) Subject: [Python-checkins] r68626 - sandbox/trunk/io-c/_textio.c Message-ID: <20090116022424.2D9D01E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 16 03:24:23 2009 New Revision: 68626 Log: Speedup small writes a lot for a few common encodings + fix utf-16 BOM read problem when seeking to the start of the file Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 16 03:24:23 2009 @@ -428,7 +428,6 @@ PyType_GenericNew, /* tp_new */ }; - /* TextIOWrapper */ @@ -455,6 +454,9 @@ "write contains a newline character." ); +typedef PyObject * + (*encodefunc_t)(PyObject *, PyObject *); + typedef struct { PyObject_HEAD @@ -465,6 +467,7 @@ PyObject *encoder; PyObject *decoder; PyObject *readnl; + PyObject *errors; const char *writenl; /* utf-8 encoded, NULL stands for \n */ int line_buffering:1; int readuniversal:1; @@ -472,6 +475,8 @@ int writetranslate:1; int seekable:1; int telling:1; + /* Specialized encoding func (see below) */ + encodefunc_t encodefunc; /* Reads and writes are internally buffered in order to speed things up. However, any read will first flush the write buffer if itsn't empty. @@ -498,6 +503,87 @@ PyObject *dict; } PyTextIOWrapperObject; + +/* A couple of specialized cases in order to bypass the slow incremental + encoding methods for the most popular encodings. */ + +static PyObject * +ascii_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors)); +} + +static PyObject * +utf16be_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 1); +} + +static PyObject * +utf16le_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), -1); +} + +static PyObject * +utf16_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + PyObject *res; + res = PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 0); + if (res == NULL) + return NULL; + /* Next writes will skip the BOM and use native byte ordering */ +#if defined(WORDS_BIGENDIAN) + self->encodefunc = (encodefunc_t) utf16be_encode; +#else + self->encodefunc = (encodefunc_t) utf16le_encode; +#endif + return res; +} + + +static PyObject * +utf8_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors)); +} + +static PyObject * +latin1_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors)); +} + +/* Map normalized encoding names onto the specialized encoding funcs */ + +typedef struct { + const char *name; + encodefunc_t encodefunc; +} encodefuncentry; + +encodefuncentry encodefuncs[] = { + {"ascii", (encodefunc_t) ascii_encode}, + {"iso8859-1", (encodefunc_t) latin1_encode}, + {"utf-16-be", (encodefunc_t) utf16be_encode}, + {"utf-16-le", (encodefunc_t) utf16le_encode}, + {"utf-16", (encodefunc_t) utf16_encode}, + {"utf-8", (encodefunc_t) utf8_encode}, + {NULL, NULL} +}; + + static int TextIOWrapper_init(PyTextIOWrapperObject *self, PyObject *args, PyObject *kwds) { @@ -536,14 +622,16 @@ Py_CLEAR(self->decoded_chars); Py_CLEAR(self->pending_bytes); Py_CLEAR(self->snapshot); + Py_CLEAR(self->errors); self->decoded_chars_used = 0; self->pending_bytes_count = 0; + self->encodefunc = NULL; if (encoding == NULL) { /* Try os.device_encoding(fileno) */ PyObject *os = PyImport_ImportModule("os"); if (os == NULL) - return -1; + goto error; self->encoding = PyObject_CallMethod( os, "device_encoding", "N", PyObject_CallMethod(buffer, "fileno", NULL)); @@ -566,7 +654,7 @@ locale, "getpreferredencoding", NULL); Py_DECREF(locale); if (self->encoding == NULL) - return -1; + goto error; if (!PyUnicode_Check(self->encoding)) Py_CLEAR(self->encoding); } @@ -576,6 +664,9 @@ if (errors == NULL) errors = "strict"; + self->errors = PyBytes_FromString(errors); + if (self->errors == NULL) + goto error; self->chunk_size = 8192; self->readuniversal = (newline == NULL || newline[0] == '\0'); @@ -628,10 +719,30 @@ if (r == -1) goto error; if (r == 1) { + PyObject *ci; self->encoder = PyCodec_IncrementalEncoder( encoding, errors); if (self->encoder == NULL) goto error; + /* Get the normalized named of the codec */ + ci = _PyCodec_Lookup(encoding); + if (ci == NULL) + goto error; + res = PyObject_GetAttrString(ci, "name"); + Py_DECREF(ci); + if (res == NULL) + PyErr_Clear(); + else if (PyUnicode_Check(res)) { + encodefuncentry *e = encodefuncs; + while (e->name != NULL) { + if (!PyUnicode_CompareWithASCIIString(res, e->name)) { + self->encodefunc = e->encodefunc; + break; + } + e++; + } + Py_DECREF(res); + } } self->buffer = buffer; @@ -805,7 +916,11 @@ needflush = 1; /* XXX What if we were just reading? */ - b = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_encode, text, NULL); + if (self->encodefunc != NULL) + b = (*self->encodefunc)((PyObject *) self, text); + else + b = PyObject_CallMethodObjArgs(self->encoder, + _PyIO_str_encode, text, NULL); Py_DECREF(text); if (b == NULL) return NULL; @@ -1458,6 +1573,28 @@ } #undef IS_LITTLE_ENDIAN +static int +_TextIOWrapper_decoder_setstate(PyTextIOWrapperObject *self, + CookieStruct *cookie) +{ + PyObject *res; + /* When seeking to the start of the stream, we call decoder.reset() + rather than decoder.getstate(). + This is for a few decoders such as utf-16 for which the state value + at start is not (b"", 0) but e.g. (b"", 2) (meaning, in the case of + utf-16, that we are expecting a BOM). + */ + if (cookie->start_pos == 0 && cookie->dec_flags == 0) + res = PyObject_CallMethod(self->decoder, "reset", NULL); + else + res = PyObject_CallMethod(self->decoder, "setstate", + "((yi))", "", cookie->dec_flags); + if (res == NULL) + return -1; + Py_DECREF(res); + return 0; +} + static PyObject * TextIOWrapper_seek(PyTextIOWrapperObject *self, PyObject *args) { @@ -1576,13 +1713,9 @@ Py_CLEAR(self->snapshot); /* Restore the decoder to its state from the safe start point. */ - if (self->decoder || cookie.dec_flags || cookie.chars_to_skip) { - res = PyObject_CallMethod(self->decoder, "setstate", - "((yi))", "", cookie.dec_flags); - if (res == NULL) + if (self->decoder) { + if (_TextIOWrapper_decoder_setstate(self, &cookie) < 0) goto fail; - Py_DECREF(res); - self->snapshot = Py_BuildValue("iy", cookie.dec_flags, ""); if (self->snapshot == NULL) goto fail; @@ -1703,11 +1836,8 @@ goto fail; /* Note our initial start point. */ - res = PyObject_CallMethod(self->decoder, "setstate", - "((yi))", "", cookie.dec_flags); - if (res == NULL) + if (_TextIOWrapper_decoder_setstate(self, &cookie) < 0) goto fail; - Py_DECREF(res); /* Feed the decoder one byte at a time. As we go, note the * nearest "safe start point" before the current location From python-checkins at python.org Fri Jan 16 03:32:36 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 16 Jan 2009 03:32:36 +0100 (CET) Subject: [Python-checkins] r68627 - sandbox/trunk/io-c/_textio.c Message-ID: <20090116023236.AA8CB1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Jan 16 03:32:36 2009 New Revision: 68627 Log: Fix a small leak Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Fri Jan 16 03:32:36 2009 @@ -741,8 +741,8 @@ } e++; } - Py_DECREF(res); } + Py_XDECREF(res); } self->buffer = buffer; From python-checkins at python.org Fri Jan 16 03:55:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 16 Jan 2009 03:55:24 +0100 (CET) Subject: [Python-checkins] r68628 - python/trunk/Lib/test/test__locale.py Message-ID: <20090116025524.AABF31E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 16 03:55:24 2009 New Revision: 68628 Log: compare with == not is #4946 Modified: python/trunk/Lib/test/test__locale.py Modified: python/trunk/Lib/test/test__locale.py ============================================================================== --- python/trunk/Lib/test/test__locale.py (original) +++ python/trunk/Lib/test/test__locale.py Fri Jan 16 03:55:24 2009 @@ -45,7 +45,7 @@ except Error: set_locale = "" known_value = known_numerics.get(used_locale, - ('', ''))[data_type is 'thousands_sep'] + ('', ''))[data_type == 'thousands_sep'] if known_value and calc_value: self.assertEquals(calc_value, known_value, self.lc_numeric_err_msg % ( From python-checkins at python.org Fri Jan 16 04:06:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 16 Jan 2009 04:06:58 +0100 (CET) Subject: [Python-checkins] r68629 - python/branches/py3k/Include/pyerrors.h Message-ID: <20090116030658.405BA1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 16 04:06:57 2009 New Revision: 68629 Log: remove duplicate definition of PyExc_BufferError #4950 Modified: python/branches/py3k/Include/pyerrors.h Modified: python/branches/py3k/Include/pyerrors.h ============================================================================== --- python/branches/py3k/Include/pyerrors.h (original) +++ python/branches/py3k/Include/pyerrors.h Fri Jan 16 04:06:57 2009 @@ -144,7 +144,6 @@ PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError; PyAPI_DATA(PyObject *) PyExc_ValueError; PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError; -PyAPI_DATA(PyObject *) PyExc_BufferError; #ifdef MS_WINDOWS PyAPI_DATA(PyObject *) PyExc_WindowsError; #endif From python-checkins at python.org Fri Jan 16 04:54:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 16 Jan 2009 04:54:08 +0100 (CET) Subject: [Python-checkins] r68630 - in python/branches/py3k: Doc/c-api/typeobj.rst Doc/library/2to3.rst Doc/library/binascii.rst Doc/library/hashlib.rst Doc/library/io.rst Doc/library/logging.rst Doc/library/sys.rst Doc/library/turtle.rst Doc/library/zlib.rst Include/pyport.h Lib/_abcoll.py Lib/ast.py Lib/ctypes/test/__init__.py Lib/inspect.py Lib/test/test_ast.py Lib/test/test_inspect.py Modules/_ctypes/cfield.c Modules/socketmodule.c Tools/scripts/patchcheck.py Message-ID: <20090116035408.8E7611E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 16 04:54:08 2009 New Revision: 68630 Log: Merged revisions 68450,68480-68481,68493,68495,68501,68512,68514-68515,68534-68536,68552,68563,68570-68572,68575,68582,68596,68623-68624,68628 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68450 | jeffrey.yasskin | 2009-01-09 10:47:07 -0600 (Fri, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68480 | vinay.sajip | 2009-01-10 07:38:04 -0600 (Sat, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 07:42:04 -0600 (Sat, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 11:18:55 -0600 (Sat, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 11:36:44 -0600 (Sat, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68501 | vinay.sajip | 2009-01-10 13:22:57 -0600 (Sat, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 16:42:10 -0600 (Sat, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-10 17:41:59 -0600 (Sat, 10 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-10 17:49:08 -0600 (Sat, 10 Jan 2009) | 1 line macos 9 isn't supported ........ r68534 | gregory.p.smith | 2009-01-11 11:53:33 -0600 (Sun, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 11:57:54 -0600 (Sun, 11 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ........ r68536 | benjamin.peterson | 2009-01-11 13:48:15 -0600 (Sun, 11 Jan 2009) | 1 line add email addresses ........ r68552 | vinay.sajip | 2009-01-12 14:36:18 -0600 (Mon, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-12 19:49:10 -0600 (Mon, 12 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 03:08:32 -0600 (Tue, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ........ r68571 | armin.ronacher | 2009-01-13 05:52:23 -0600 (Tue, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ........ r68572 | andrew.kuchling | 2009-01-13 07:40:54 -0600 (Tue, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 11:32:28 -0600 (Tue, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68582 | georg.brandl | 2009-01-13 16:14:01 -0600 (Tue, 13 Jan 2009) | 2 lines Use assertRaises. ........ r68596 | amaury.forgeotdarc | 2009-01-13 17:39:22 -0600 (Tue, 13 Jan 2009) | 3 lines #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. ........ r68623 | vinay.sajip | 2009-01-15 16:48:13 -0600 (Thu, 15 Jan 2009) | 1 line Made minor changes/corrections in markup. Added a couple of section headings. ........ r68624 | vinay.sajip | 2009-01-15 17:04:47 -0600 (Thu, 15 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68628 | benjamin.peterson | 2009-01-15 20:55:24 -0600 (Thu, 15 Jan 2009) | 1 line compare with == not is #4946 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/typeobj.rst python/branches/py3k/Doc/library/2to3.rst python/branches/py3k/Doc/library/binascii.rst python/branches/py3k/Doc/library/hashlib.rst python/branches/py3k/Doc/library/io.rst python/branches/py3k/Doc/library/logging.rst python/branches/py3k/Doc/library/sys.rst python/branches/py3k/Doc/library/turtle.rst python/branches/py3k/Doc/library/zlib.rst python/branches/py3k/Include/pyport.h python/branches/py3k/Lib/_abcoll.py python/branches/py3k/Lib/ast.py python/branches/py3k/Lib/ctypes/test/__init__.py python/branches/py3k/Lib/inspect.py python/branches/py3k/Lib/test/test_ast.py python/branches/py3k/Lib/test/test_inspect.py python/branches/py3k/Modules/_ctypes/cfield.c python/branches/py3k/Modules/socketmodule.c python/branches/py3k/Tools/scripts/patchcheck.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 Fri Jan 16 04:54:08 2009 @@ -652,7 +652,6 @@ :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its base type. - .. cmember:: getiterfunc PyTypeObject.tp_iter An optional pointer to a function that returns an iterator for the object. Its Modified: python/branches/py3k/Doc/library/2to3.rst ============================================================================== --- python/branches/py3k/Doc/library/2to3.rst (original) +++ python/branches/py3k/Doc/library/2to3.rst Fri Jan 16 04:54:08 2009 @@ -3,7 +3,7 @@ 2to3 - Automated Python 2 to 3 code translation =============================================== -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson 2to3 is a Python program that reads Python 2.x source code and applies a series of *fixers* to transform it into valid Python 3.x code. The standard library Modified: python/branches/py3k/Doc/library/binascii.rst ============================================================================== --- python/branches/py3k/Doc/library/binascii.rst (original) +++ python/branches/py3k/Doc/library/binascii.rst Fri Jan 16 04:54:08 2009 @@ -113,8 +113,19 @@ print(binascii.crc32("hello world")) # Or, in two pieces: crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) - print(crc) + crc = binascii.crc32(" world", crc) & 0xffffffff + print('crc32 = 0x%08x' % crc) + +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. .. function:: b2a_hex(data) Modified: python/branches/py3k/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k/Doc/library/hashlib.rst (original) +++ python/branches/py3k/Doc/library/hashlib.rst Fri Jan 16 04:54:08 2009 @@ -4,8 +4,8 @@ .. module:: hashlib :synopsis: Secure hash and message digest algorithms. -.. moduleauthor:: Gregory P. Smith -.. sectionauthor:: Gregory P. Smith +.. moduleauthor:: Gregory P. Smith +.. sectionauthor:: Gregory P. Smith .. index:: Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Fri Jan 16 04:54:08 2009 @@ -6,7 +6,7 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The builtin :func:`open` function is defined in this module. Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Fri Jan 16 04:54:08 2009 @@ -522,6 +522,9 @@ the message to its destination. Most user-defined subclasses of :class:`Handler` will need to override this :meth:`emit`. +Useful Handlers +--------------- + In addition to the base :class:`Handler` class, many useful subclasses are provided: @@ -530,41 +533,44 @@ #. :class:`FileHandler` instances send error messages to disk files. -.. currentmodule:: logging.handlers +.. module:: logging.handlers -#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log - files at a certain point. It is not meant to be instantiated directly. Instead, - use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. +#. :class:`BaseRotatingHandler` is the base class for handlers that + rotate log files at a certain point. It is not meant to be instantiated + directly. Instead, use :class:`RotatingFileHandler` or + :class:`TimedRotatingFileHandler`. -#. :class:`RotatingFileHandler` instances send error messages to disk files, - with support for maximum log file sizes and log file rotation. +#. :class:`RotatingFileHandler` instances send error messages to disk + files, with support for maximum log file sizes and log file rotation. -#. :class:`TimedRotatingFileHandler` instances send error messages to disk files - rotating the log file at certain timed intervals. +#. :class:`TimedRotatingFileHandler` instances send error messages to + disk files, rotating the log file at certain timed intervals. -#. :class:`SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`SocketHandler` instances send error messages to TCP/IP + sockets. -#. :class:`DatagramHandler` instances send error messages to UDP sockets. +#. :class:`DatagramHandler` instances send error messages to UDP + sockets. -#. :class:`SMTPHandler` instances send error messages to a designated email - address. +#. :class:`SMTPHandler` instances send error messages to a designated + email address. -#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon, - possibly on a remote machine. +#. :class:`SysLogHandler` instances send error messages to a Unix + syslog daemon, possibly on a remote machine. -#. :class:`NTEventLogHandler` instances send error messages to a Windows - NT/2000/XP event log. +#. :class:`NTEventLogHandler` instances send error messages to a + Windows NT/2000/XP event log. -#. :class:`MemoryHandler` instances send error messages to a buffer in memory, - which is flushed whenever specific criteria are met. +#. :class:`MemoryHandler` instances send error messages to a buffer + in memory, which is flushed whenever specific criteria are met. -#. :class:`HTTPHandler` instances send error messages to an HTTP server using - either ``GET`` or ``POST`` semantics. +#. :class:`HTTPHandler` instances send error messages to an HTTP + server using either ``GET`` or ``POST`` semantics. -#. :class:`WatchedFileHandler` instances watch the file they are logging to. If -the file changes, it is closed and reopened using the file name. This handler -is only useful on Unix-like systems; Windows does not support the underlying -mechanism used. +#. :class:`WatchedFileHandler` instances watch the file they are + logging to. If the file changes, it is closed and reopened using the file + name. This handler is only useful on Unix-like systems; Windows does not + support the underlying mechanism used. .. currentmodule:: logging @@ -603,6 +609,9 @@ name. If this feature is used, messages sent to the named logger and its children are allowed through the filter, and all others dropped. +Module-Level Functions +---------------------- + In addition to the classes described above, there are a number of module- level functions. @@ -1626,7 +1635,7 @@ WatchedFileHandler ^^^^^^^^^^^^^^^^^^ -.. module:: logging.handlers +.. currentmodule:: logging.handlers The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Fri Jan 16 04:54:08 2009 @@ -484,6 +484,11 @@ A program is free to modify this list for its own purposes. + .. seealso:: + Module :mod:`site` This describes how to use .pth files to extend + :data:`sys.path`. + + .. data:: platform This string contains a platform identifier that can be used to append @@ -500,7 +505,6 @@ Windows ``'win32'`` Windows/Cygwin ``'cygwin'`` Mac OS X ``'darwin'`` - Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` AtheOS ``'atheos'`` @@ -782,11 +786,3 @@ first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python. Availability: Windows. - - -.. seealso:: - - Module :mod:`site` - This describes how to use .pth files to extend ``sys.path``. - - Modified: python/branches/py3k/Doc/library/turtle.rst ============================================================================== --- python/branches/py3k/Doc/library/turtle.rst (original) +++ python/branches/py3k/Doc/library/turtle.rst Fri Jan 16 04:54:08 2009 @@ -322,8 +322,7 @@ :param y: a number (integer or float) - Set the turtle's first coordinate to *y*, leave second coordinate - unchanged. + Set the turtle's second coordinate to *y*, leave first coordinate unchanged. >>> turtle.position() (0.00, 40.00) Modified: python/branches/py3k/Doc/library/zlib.rst ============================================================================== --- python/branches/py3k/Doc/library/zlib.rst (original) +++ python/branches/py3k/Doc/library/zlib.rst Fri Jan 16 04:54:08 2009 @@ -31,19 +31,30 @@ Exception raised on compression and decompression errors. -.. function:: adler32(string[, value]) +.. function:: adler32(data[, value]) - Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as + Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much more quickly.) If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Always returns an unsigned 32-bit integer. +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. + .. function:: compress(string[, level]) @@ -62,22 +73,33 @@ ``9`` is slowest and produces the most. The default value is ``6``. -.. function:: crc32(string[, value]) +.. function:: crc32(data[, value]) .. index:: single: Cyclic Redundancy Check single: checksum; Cyclic Redundancy Check - Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is + Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Always returns an unsigned 32-bit integer. +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. + .. function:: decompress(string[, wbits[, bufsize]]) Modified: python/branches/py3k/Include/pyport.h ============================================================================== --- python/branches/py3k/Include/pyport.h (original) +++ python/branches/py3k/Include/pyport.h Fri Jan 16 04:54:08 2009 @@ -616,6 +616,15 @@ #define Py_FORMAT_PARSETUPLE(func,p1,p2) #endif +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ Modified: python/branches/py3k/Lib/_abcoll.py ============================================================================== --- python/branches/py3k/Lib/_abcoll.py (original) +++ python/branches/py3k/Lib/_abcoll.py Fri Jan 16 04:54:08 2009 @@ -283,12 +283,12 @@ @abstractmethod def add(self, value): - """Return True if it was added, False if already there.""" + """Add an element.""" raise NotImplementedError @abstractmethod def discard(self, value): - """Return True if it was deleted, False if not there.""" + """Remove an element. Do not raise an exception if absent.""" raise NotImplementedError def remove(self, value): Modified: python/branches/py3k/Lib/ast.py ============================================================================== --- python/branches/py3k/Lib/ast.py (original) +++ python/branches/py3k/Lib/ast.py Fri Jan 16 04:54:08 2009 @@ -64,6 +64,18 @@ elif isinstance(node, Name): if node.id in _safe_names: return _safe_names[node.id] + elif isinstance(node, BinOp) and \ + isinstance(node.op, (Add, Sub)) and \ + isinstance(node.right, Num) and \ + isinstance(node.right.n, complex) and \ + isinstance(node.left, Num) and \ + isinstance(node.left.n, (int, float)): + left = node.left.n + right = node.right.n + if isinstance(node.op, Add): + return left + right + else: + return left - right raise ValueError('malformed string') return _convert(node_or_string) Modified: python/branches/py3k/Lib/ctypes/test/__init__.py ============================================================================== --- python/branches/py3k/Lib/ctypes/test/__init__.py (original) +++ python/branches/py3k/Lib/ctypes/test/__init__.py Fri Jan 16 04:54:08 2009 @@ -67,9 +67,6 @@ if verbosity > 1: print("Skipped %s: %s" % (modname, detail), file=sys.stderr) continue - except Exception as detail: - print("Warning: could not import %s: %s" % (modname, detail), file=sys.stderr) - continue for name in dir(mod): if name.startswith("_"): continue Modified: python/branches/py3k/Lib/inspect.py ============================================================================== --- python/branches/py3k/Lib/inspect.py (original) +++ python/branches/py3k/Lib/inspect.py Fri Jan 16 04:54:08 2009 @@ -249,7 +249,10 @@ Optionally, only return members that satisfy a given predicate.""" results = [] for key in dir(object): - value = getattr(object, key) + try: + value = getattr(object, key) + except AttributeError: + continue if not predicate or predicate(value): results.append((key, value)) results.sort() Modified: python/branches/py3k/Lib/test/test_ast.py ============================================================================== --- python/branches/py3k/Lib/test/test_ast.py (original) +++ python/branches/py3k/Lib/test/test_ast.py Fri Jan 16 04:54:08 2009 @@ -265,6 +265,12 @@ self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None)) self.assertRaises(ValueError, ast.literal_eval, 'foo()') + def test_literal_eval_issue4907(self): + self.assertEqual(ast.literal_eval('2j'), 2j) + self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j) + self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j) + self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)') + def test_main(): support.run_unittest(AST_Tests, ASTHelpers_Test) Modified: python/branches/py3k/Lib/test/test_inspect.py ============================================================================== --- python/branches/py3k/Lib/test/test_inspect.py (original) +++ python/branches/py3k/Lib/test/test_inspect.py Fri Jan 16 04:54:08 2009 @@ -99,6 +99,17 @@ self.assert_(inspect.isroutine(mod.spam)) self.assert_(inspect.isroutine([].count)) + def test_get_slot_members(self): + class C(object): + __slots__ = ("a", "b") + + x = C() + x.a = 42 + members = dict(inspect.getmembers(x)) + self.assert_('a' in members) + self.assert_('b' not in members) + + class TestInterpreterStack(IsTestBase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) Modified: python/branches/py3k/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/cfield.c (original) +++ python/branches/py3k/Modules/_ctypes/cfield.c Fri Jan 16 04:54:08 2009 @@ -1472,11 +1472,14 @@ size += 1; /* terminating NUL */ size *= sizeof(wchar_t); buffer = (wchar_t *)PyMem_Malloc(size); - if (!buffer) + if (!buffer) { + Py_DECREF(value); return PyErr_NoMemory(); + } memset(buffer, 0, size); keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); if (!keep) { + Py_DECREF(value); PyMem_Free(buffer); return NULL; } Modified: python/branches/py3k/Modules/socketmodule.c ============================================================================== --- python/branches/py3k/Modules/socketmodule.c (original) +++ python/branches/py3k/Modules/socketmodule.c Fri Jan 16 04:54:08 2009 @@ -3159,7 +3159,11 @@ #ifdef HAVE_GETHOSTBYNAME_R_3_ARG struct hostent_data data; #else - char buf[16384]; + /* glibcs up to 2.10 assume that the buf argument to + gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc + does not ensure. The attribute below instructs the compiler + to maintain this alignment. */ + char buf[16384] Py_ALIGNED(8); int buf_len = (sizeof buf) - 1; int errnop; #endif Modified: python/branches/py3k/Tools/scripts/patchcheck.py ============================================================================== --- python/branches/py3k/Tools/scripts/patchcheck.py (original) +++ python/branches/py3k/Tools/scripts/patchcheck.py Fri Jan 16 04:54:08 2009 @@ -62,12 +62,12 @@ @status("Misc/ACKS updated", modal=True) def credit_given(file_paths): """Check if Misc/ACKS has been changed.""" - return True if 'Misc/ACKS' in file_paths else False + return 'Misc/ACKS' in file_paths @status("Misc/NEWS updated", modal=True) def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" - return True if 'Misc/NEWS' in file_paths else False + return 'Misc/NEWS' in file_paths def main(): From python-checkins at python.org Fri Jan 16 05:13:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 16 Jan 2009 05:13:19 +0100 (CET) Subject: [Python-checkins] r68631 - in python/branches/release30-maint: Doc/c-api/typeobj.rst Doc/library/2to3.rst Doc/library/binascii.rst Doc/library/hashlib.rst Doc/library/io.rst Doc/library/logging.rst Doc/library/sys.rst Doc/library/turtle.rst Doc/library/zlib.rst Include/pyport.h Lib/_abcoll.py Lib/ast.py Lib/ctypes/test/__init__.py Lib/inspect.py Lib/test/test_ast.py Lib/test/test_inspect.py Modules/_ctypes/cfield.c Modules/socketmodule.c Tools/scripts/patchcheck.py Message-ID: <20090116041319.7B24C1E402E@bag.python.org> Author: benjamin.peterson Date: Fri Jan 16 05:13:17 2009 New Revision: 68631 Log: Merged revisions 68630 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68630 | benjamin.peterson | 2009-01-15 21:54:08 -0600 (Thu, 15 Jan 2009) | 108 lines Merged revisions 68450,68480-68481,68493,68495,68501,68512,68514-68515,68534-68536,68552,68563,68570-68572,68575,68582,68596,68623-68624,68628 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68450 | jeffrey.yasskin | 2009-01-09 10:47:07 -0600 (Fri, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68480 | vinay.sajip | 2009-01-10 07:38:04 -0600 (Sat, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 07:42:04 -0600 (Sat, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 11:18:55 -0600 (Sat, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 11:36:44 -0600 (Sat, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68501 | vinay.sajip | 2009-01-10 13:22:57 -0600 (Sat, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 16:42:10 -0600 (Sat, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-10 17:41:59 -0600 (Sat, 10 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-10 17:49:08 -0600 (Sat, 10 Jan 2009) | 1 line macos 9 isn't supported ........ r68534 | gregory.p.smith | 2009-01-11 11:53:33 -0600 (Sun, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 11:57:54 -0600 (Sun, 11 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ........ r68536 | benjamin.peterson | 2009-01-11 13:48:15 -0600 (Sun, 11 Jan 2009) | 1 line add email addresses ........ r68552 | vinay.sajip | 2009-01-12 14:36:18 -0600 (Mon, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-12 19:49:10 -0600 (Mon, 12 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 03:08:32 -0600 (Tue, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ........ r68571 | armin.ronacher | 2009-01-13 05:52:23 -0600 (Tue, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ........ r68572 | andrew.kuchling | 2009-01-13 07:40:54 -0600 (Tue, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 11:32:28 -0600 (Tue, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68582 | georg.brandl | 2009-01-13 16:14:01 -0600 (Tue, 13 Jan 2009) | 2 lines Use assertRaises. ........ r68596 | amaury.forgeotdarc | 2009-01-13 17:39:22 -0600 (Tue, 13 Jan 2009) | 3 lines #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. ........ r68623 | vinay.sajip | 2009-01-15 16:48:13 -0600 (Thu, 15 Jan 2009) | 1 line Made minor changes/corrections in markup. Added a couple of section headings. ........ r68624 | vinay.sajip | 2009-01-15 17:04:47 -0600 (Thu, 15 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68628 | benjamin.peterson | 2009-01-15 20:55:24 -0600 (Thu, 15 Jan 2009) | 1 line compare with == not is #4946 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/typeobj.rst python/branches/release30-maint/Doc/library/2to3.rst python/branches/release30-maint/Doc/library/binascii.rst python/branches/release30-maint/Doc/library/hashlib.rst python/branches/release30-maint/Doc/library/io.rst python/branches/release30-maint/Doc/library/logging.rst python/branches/release30-maint/Doc/library/sys.rst python/branches/release30-maint/Doc/library/turtle.rst python/branches/release30-maint/Doc/library/zlib.rst python/branches/release30-maint/Include/pyport.h python/branches/release30-maint/Lib/_abcoll.py python/branches/release30-maint/Lib/ast.py python/branches/release30-maint/Lib/ctypes/test/__init__.py python/branches/release30-maint/Lib/inspect.py python/branches/release30-maint/Lib/test/test_ast.py python/branches/release30-maint/Lib/test/test_inspect.py python/branches/release30-maint/Modules/_ctypes/cfield.c python/branches/release30-maint/Modules/socketmodule.c python/branches/release30-maint/Tools/scripts/patchcheck.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 Fri Jan 16 05:13:17 2009 @@ -652,7 +652,6 @@ :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its base type. - .. cmember:: getiterfunc PyTypeObject.tp_iter An optional pointer to a function that returns an iterator for the object. Its 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 Fri Jan 16 05:13:17 2009 @@ -3,7 +3,7 @@ 2to3 - Automated Python 2 to 3 code translation =============================================== -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson 2to3 is a Python program that reads Python 2.x source code and applies a series of *fixers* to transform it into valid Python 3.x code. The standard library 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 Fri Jan 16 05:13:17 2009 @@ -113,8 +113,19 @@ print(binascii.crc32("hello world")) # Or, in two pieces: crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) - print(crc) + crc = binascii.crc32(" world", crc) & 0xffffffff + print('crc32 = 0x%08x' % crc) + +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. .. function:: b2a_hex(data) Modified: python/branches/release30-maint/Doc/library/hashlib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/hashlib.rst (original) +++ python/branches/release30-maint/Doc/library/hashlib.rst Fri Jan 16 05:13:17 2009 @@ -4,8 +4,8 @@ .. module:: hashlib :synopsis: Secure hash and message digest algorithms. -.. moduleauthor:: Gregory P. Smith -.. sectionauthor:: Gregory P. Smith +.. moduleauthor:: Gregory P. Smith +.. sectionauthor:: Gregory P. Smith .. index:: Modified: python/branches/release30-maint/Doc/library/io.rst ============================================================================== --- python/branches/release30-maint/Doc/library/io.rst (original) +++ python/branches/release30-maint/Doc/library/io.rst Fri Jan 16 05:13:17 2009 @@ -6,7 +6,7 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The builtin :func:`open` function is defined in this module. Modified: python/branches/release30-maint/Doc/library/logging.rst ============================================================================== --- python/branches/release30-maint/Doc/library/logging.rst (original) +++ python/branches/release30-maint/Doc/library/logging.rst Fri Jan 16 05:13:17 2009 @@ -119,7 +119,7 @@ messages at different log levels. This allows you to instrument your code with debug messages, for example, but turning the log level down so that those debug messages are not written for your production system. The default levels are -``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``. +``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``. The logger, handler, and log message call each specify a level. The log message is only emitted if the handler and logger are configured to emit messages of @@ -420,6 +420,8 @@ code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties. +.. _library-config: + Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -459,6 +461,12 @@ libraries, then the logger name specified can be "orgname.foo" rather than just "foo". +.. versionadded:: 3.1 + +The :class:`NullHandler` class was not present in previous versions, but is now +included, so that it need not be defined in library code. + + Logging Levels -------------- @@ -514,6 +522,9 @@ the message to its destination. Most user-defined subclasses of :class:`Handler` will need to override this :meth:`emit`. +Useful Handlers +--------------- + In addition to the base :class:`Handler` class, many useful subclasses are provided: @@ -522,39 +533,61 @@ #. :class:`FileHandler` instances send error messages to disk files. -#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log - files at a certain point. It is not meant to be instantiated directly. Instead, - use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. +.. module:: logging.handlers -#. :class:`RotatingFileHandler` instances send error messages to disk files, - with support for maximum log file sizes and log file rotation. +#. :class:`BaseRotatingHandler` is the base class for handlers that + rotate log files at a certain point. It is not meant to be instantiated + directly. Instead, use :class:`RotatingFileHandler` or + :class:`TimedRotatingFileHandler`. -#. :class:`TimedRotatingFileHandler` instances send error messages to disk files - rotating the log file at certain timed intervals. +#. :class:`RotatingFileHandler` instances send error messages to disk + files, with support for maximum log file sizes and log file rotation. -#. :class:`SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`TimedRotatingFileHandler` instances send error messages to + disk files, rotating the log file at certain timed intervals. -#. :class:`DatagramHandler` instances send error messages to UDP sockets. +#. :class:`SocketHandler` instances send error messages to TCP/IP + sockets. -#. :class:`SMTPHandler` instances send error messages to a designated email - address. +#. :class:`DatagramHandler` instances send error messages to UDP + sockets. -#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon, - possibly on a remote machine. +#. :class:`SMTPHandler` instances send error messages to a designated + email address. -#. :class:`NTEventLogHandler` instances send error messages to a Windows - NT/2000/XP event log. +#. :class:`SysLogHandler` instances send error messages to a Unix + syslog daemon, possibly on a remote machine. -#. :class:`MemoryHandler` instances send error messages to a buffer in memory, - which is flushed whenever specific criteria are met. +#. :class:`NTEventLogHandler` instances send error messages to a + Windows NT/2000/XP event log. -#. :class:`HTTPHandler` instances send error messages to an HTTP server using - either ``GET`` or ``POST`` semantics. +#. :class:`MemoryHandler` instances send error messages to a buffer + in memory, which is flushed whenever specific criteria are met. -The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the -core logging package. The other handlers are defined in a sub- module, -:mod:`logging.handlers`. (There is also another sub-module, -:mod:`logging.config`, for configuration functionality.) +#. :class:`HTTPHandler` instances send error messages to an HTTP + server using either ``GET`` or ``POST`` semantics. + +#. :class:`WatchedFileHandler` instances watch the file they are + logging to. If the file changes, it is closed and reopened using the file + name. This handler is only useful on Unix-like systems; Windows does not + support the underlying mechanism used. + +.. currentmodule:: logging + +#. :class:`NullHandler` instances do nothing with error messages. They are used + by library developers who want to use logging, but want to avoid the "No + handlers could be found for logger XXX" message which can be displayed if + the library user has not configured logging. See :ref:`library-config` for + more information. + +.. versionadded:: 3.1 + +The :class:`NullHandler` class was not present in previous versions. + +The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` +classes are defined in the core logging package. The other handlers are +defined in a sub- module, :mod:`logging.handlers`. (There is also another +sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the :class:`Formatter` class. They are initialized with a format string suitable for @@ -576,6 +609,9 @@ name. If this feature is used, messages sent to the named logger and its children are allowed through the filter, and all others dropped. +Module-Level Functions +---------------------- + In addition to the classes described above, there are a number of module- level functions. @@ -1519,8 +1555,6 @@ StreamHandler ^^^^^^^^^^^^^ -.. module:: logging.handlers - The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -1576,11 +1610,33 @@ Outputs the record to the file. +NullHandler +^^^^^^^^^^^ + +.. versionadded:: 3.1 + +The :class:`NullHandler` class, located in the core :mod:`logging` package, +does not do any formatting or output. It is essentially a "no-op" handler +for use by library developers. + + +.. class:: NullHandler() + Returns a new instance of the :class:`NullHandler` class. + + + .. method:: emit(record) + + This method does nothing. + +See :ref:`library-config` for more information on how to use +:class:`NullHandler`. WatchedFileHandler ^^^^^^^^^^^^^^^^^^ +.. currentmodule:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. Modified: python/branches/release30-maint/Doc/library/sys.rst ============================================================================== --- python/branches/release30-maint/Doc/library/sys.rst (original) +++ python/branches/release30-maint/Doc/library/sys.rst Fri Jan 16 05:13:17 2009 @@ -484,6 +484,11 @@ A program is free to modify this list for its own purposes. + .. seealso:: + Module :mod:`site` This describes how to use .pth files to extend + :data:`sys.path`. + + .. data:: platform This string contains a platform identifier that can be used to append @@ -500,7 +505,6 @@ Windows ``'win32'`` Windows/Cygwin ``'cygwin'`` Mac OS X ``'darwin'`` - Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` RiscOS ``'riscos'`` @@ -783,11 +787,3 @@ first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python. Availability: Windows. - - -.. seealso:: - - Module :mod:`site` - This describes how to use .pth files to extend ``sys.path``. - - Modified: python/branches/release30-maint/Doc/library/turtle.rst ============================================================================== --- python/branches/release30-maint/Doc/library/turtle.rst (original) +++ python/branches/release30-maint/Doc/library/turtle.rst Fri Jan 16 05:13:17 2009 @@ -322,8 +322,7 @@ :param y: a number (integer or float) - Set the turtle's first coordinate to *y*, leave second coordinate - unchanged. + Set the turtle's second coordinate to *y*, leave first coordinate unchanged. >>> turtle.position() (0.00, 40.00) 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 Fri Jan 16 05:13:17 2009 @@ -31,19 +31,30 @@ Exception raised on compression and decompression errors. -.. function:: adler32(string[, value]) +.. function:: adler32(data[, value]) - Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as + Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much more quickly.) If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Always returns an unsigned 32-bit integer. +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. + .. function:: compress(string[, level]) @@ -62,22 +73,33 @@ ``9`` is slowest and produces the most. The default value is ``6``. -.. function:: crc32(string[, value]) +.. function:: crc32(data[, value]) .. index:: single: Cyclic Redundancy Check single: checksum; Cyclic Redundancy Check - Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is + Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Always returns an unsigned 32-bit integer. +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. + .. function:: decompress(string[, wbits[, bufsize]]) Modified: python/branches/release30-maint/Include/pyport.h ============================================================================== --- python/branches/release30-maint/Include/pyport.h (original) +++ python/branches/release30-maint/Include/pyport.h Fri Jan 16 05:13:17 2009 @@ -616,6 +616,15 @@ #define Py_FORMAT_PARSETUPLE(func,p1,p2) #endif +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ Modified: python/branches/release30-maint/Lib/_abcoll.py ============================================================================== --- python/branches/release30-maint/Lib/_abcoll.py (original) +++ python/branches/release30-maint/Lib/_abcoll.py Fri Jan 16 05:13:17 2009 @@ -283,12 +283,12 @@ @abstractmethod def add(self, value): - """Return True if it was added, False if already there.""" + """Add an element.""" raise NotImplementedError @abstractmethod def discard(self, value): - """Return True if it was deleted, False if not there.""" + """Remove an element. Do not raise an exception if absent.""" raise NotImplementedError def remove(self, value): Modified: python/branches/release30-maint/Lib/ast.py ============================================================================== --- python/branches/release30-maint/Lib/ast.py (original) +++ python/branches/release30-maint/Lib/ast.py Fri Jan 16 05:13:17 2009 @@ -64,6 +64,18 @@ elif isinstance(node, Name): if node.id in _safe_names: return _safe_names[node.id] + elif isinstance(node, BinOp) and \ + isinstance(node.op, (Add, Sub)) and \ + isinstance(node.right, Num) and \ + isinstance(node.right.n, complex) and \ + isinstance(node.left, Num) and \ + isinstance(node.left.n, (int, float)): + left = node.left.n + right = node.right.n + if isinstance(node.op, Add): + return left + right + else: + return left - right raise ValueError('malformed string') return _convert(node_or_string) Modified: python/branches/release30-maint/Lib/ctypes/test/__init__.py ============================================================================== --- python/branches/release30-maint/Lib/ctypes/test/__init__.py (original) +++ python/branches/release30-maint/Lib/ctypes/test/__init__.py Fri Jan 16 05:13:17 2009 @@ -67,9 +67,6 @@ if verbosity > 1: print("Skipped %s: %s" % (modname, detail), file=sys.stderr) continue - except Exception as detail: - print("Warning: could not import %s: %s" % (modname, detail), file=sys.stderr) - continue for name in dir(mod): if name.startswith("_"): continue Modified: python/branches/release30-maint/Lib/inspect.py ============================================================================== --- python/branches/release30-maint/Lib/inspect.py (original) +++ python/branches/release30-maint/Lib/inspect.py Fri Jan 16 05:13:17 2009 @@ -249,7 +249,10 @@ Optionally, only return members that satisfy a given predicate.""" results = [] for key in dir(object): - value = getattr(object, key) + try: + value = getattr(object, key) + except AttributeError: + continue if not predicate or predicate(value): results.append((key, value)) results.sort() Modified: python/branches/release30-maint/Lib/test/test_ast.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_ast.py (original) +++ python/branches/release30-maint/Lib/test/test_ast.py Fri Jan 16 05:13:17 2009 @@ -265,6 +265,12 @@ self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None)) self.assertRaises(ValueError, ast.literal_eval, 'foo()') + def test_literal_eval_issue4907(self): + self.assertEqual(ast.literal_eval('2j'), 2j) + self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j) + self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j) + self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)') + def test_main(): support.run_unittest(AST_Tests, ASTHelpers_Test) Modified: python/branches/release30-maint/Lib/test/test_inspect.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_inspect.py (original) +++ python/branches/release30-maint/Lib/test/test_inspect.py Fri Jan 16 05:13:17 2009 @@ -99,6 +99,17 @@ self.assert_(inspect.isroutine(mod.spam)) self.assert_(inspect.isroutine([].count)) + def test_get_slot_members(self): + class C(object): + __slots__ = ("a", "b") + + x = C() + x.a = 42 + members = dict(inspect.getmembers(x)) + self.assert_('a' in members) + self.assert_('b' not in members) + + class TestInterpreterStack(IsTestBase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) 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 Fri Jan 16 05:13:17 2009 @@ -1472,11 +1472,14 @@ size += 1; /* terminating NUL */ size *= sizeof(wchar_t); buffer = (wchar_t *)PyMem_Malloc(size); - if (!buffer) + if (!buffer) { + Py_DECREF(value); return PyErr_NoMemory(); + } memset(buffer, 0, size); keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); if (!keep) { + Py_DECREF(value); PyMem_Free(buffer); return NULL; } Modified: python/branches/release30-maint/Modules/socketmodule.c ============================================================================== --- python/branches/release30-maint/Modules/socketmodule.c (original) +++ python/branches/release30-maint/Modules/socketmodule.c Fri Jan 16 05:13:17 2009 @@ -3159,7 +3159,11 @@ #ifdef HAVE_GETHOSTBYNAME_R_3_ARG struct hostent_data data; #else - char buf[16384]; + /* glibcs up to 2.10 assume that the buf argument to + gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc + does not ensure. The attribute below instructs the compiler + to maintain this alignment. */ + char buf[16384] Py_ALIGNED(8); int buf_len = (sizeof buf) - 1; int errnop; #endif Modified: python/branches/release30-maint/Tools/scripts/patchcheck.py ============================================================================== --- python/branches/release30-maint/Tools/scripts/patchcheck.py (original) +++ python/branches/release30-maint/Tools/scripts/patchcheck.py Fri Jan 16 05:13:17 2009 @@ -62,12 +62,12 @@ @status("Misc/ACKS updated", modal=True) def credit_given(file_paths): """Check if Misc/ACKS has been changed.""" - return True if 'Misc/ACKS' in file_paths else False + return 'Misc/ACKS' in file_paths @status("Misc/NEWS updated", modal=True) def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" - return True if 'Misc/NEWS' in file_paths else False + return 'Misc/NEWS' in file_paths def main(): From buildbot at python.org Fri Jan 16 05:38:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 16 Jan 2009 04:38:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090116043812.671561E4002@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/112 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 Jan 16 05:49:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 16 Jan 2009 04:49:50 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090116044951.CE83A1E4002@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/128 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Jan 16 19:53:44 2009 From: python-checkins at python.org (thomas.heller) Date: Fri, 16 Jan 2009 19:53:44 +0100 (CET) Subject: [Python-checkins] r68633 - python/trunk/Doc/library/ctypes.rst Message-ID: <20090116185344.80A511E4002@bag.python.org> Author: thomas.heller Date: Fri Jan 16 19:53:44 2009 New Revision: 68633 Log: Change an example in the docs to avoid a mistake when the code is copy pasted and changed afterwards. Modified: python/trunk/Doc/library/ctypes.rst Modified: python/trunk/Doc/library/ctypes.rst ============================================================================== --- python/trunk/Doc/library/ctypes.rst (original) +++ python/trunk/Doc/library/ctypes.rst Fri Jan 16 19:53:44 2009 @@ -2441,10 +2441,10 @@ ("hreftype", HREFTYPE)] class TYPEDESC(Structure): + _anonymous_ = ("u",) _fields_ = [("u", _U), ("vt", VARTYPE)] - _anonymous_ = ("u",) The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field From python-checkins at python.org Fri Jan 16 20:31:13 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 16 Jan 2009 20:31:13 +0100 (CET) Subject: [Python-checkins] r68638 - python/branches/py3k/Modules/_dbmmodule.c Message-ID: <20090116193113.924471E4002@bag.python.org> Author: mark.dickinson Date: Fri Jan 16 20:31:13 2009 New Revision: 68638 Log: Define PY_SSIZE_T_CLEAN at the top of the dbm module. This should fix the segfaults on the PPC64/Debian buildbots. Modified: python/branches/py3k/Modules/_dbmmodule.c Modified: python/branches/py3k/Modules/_dbmmodule.c ============================================================================== --- python/branches/py3k/Modules/_dbmmodule.c (original) +++ python/branches/py3k/Modules/_dbmmodule.c Fri Jan 16 20:31:13 2009 @@ -2,6 +2,7 @@ /* DBM module using dictionary interface */ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include From buildbot at python.org Fri Jan 16 21:17:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 16 Jan 2009 20:17:48 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090116201749.104A61E4002@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/114 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Fri Jan 16 21:25:36 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 16 Jan 2009 21:25:36 +0100 (CET) Subject: [Python-checkins] r68639 - in python/branches/release30-maint: Modules/_dbmmodule.c Message-ID: <20090116202536.19B571E4014@bag.python.org> Author: mark.dickinson Date: Fri Jan 16 21:25:35 2009 New Revision: 68639 Log: Merged revisions 68638 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68638 | mark.dickinson | 2009-01-16 19:31:13 +0000 (Fri, 16 Jan 2009) | 3 lines Define PY_SSIZE_T_CLEAN at the top of the dbm module. This should fix the segfaults on the PPC64/Debian buildbots. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/_dbmmodule.c Modified: python/branches/release30-maint/Modules/_dbmmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_dbmmodule.c (original) +++ python/branches/release30-maint/Modules/_dbmmodule.c Fri Jan 16 21:25:35 2009 @@ -2,6 +2,7 @@ /* DBM module using dictionary interface */ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include From buildbot at python.org Fri Jan 16 22:13:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 16 Jan 2009 21:13:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090116211323.AA3AD1E4002@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/58 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 683, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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' sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 01:46:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 01:46:30 +0100 (CET) Subject: [Python-checkins] r68640 - in sandbox/trunk/io-c: _bufferedio.c _textio.c test_io.py Message-ID: <20090117004630.958B81E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 01:46:30 2009 New Revision: 68640 Log: deallocating a Buffered or Text IO object could clear the err status Modified: sandbox/trunk/io-c/_bufferedio.c sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Sat Jan 17 01:46:30 2009 @@ -226,6 +226,8 @@ PyObject *res; /* XXX this is inelegant */ if (Py_TYPE(self)->tp_del == NULL) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); /* We need to resurrect the object as calling close() can invoke arbitrary code. */ ((PyObject *) self)->ob_refcnt++; @@ -237,6 +239,7 @@ PyErr_Clear(); } Py_XDECREF(res); + PyErr_Restore(tp, v, tb); if (--((PyObject *) self)->ob_refcnt != 0) return; } Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 17 01:46:30 2009 @@ -767,6 +767,8 @@ PyObject *res; /* XXX this is inelegant */ if (Py_TYPE(self)->tp_del == NULL && self->ok) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); /* We need to resurrect the object as calling close() can invoke arbitrary code. */ ((PyObject *) self)->ob_refcnt++; @@ -778,6 +780,7 @@ PyErr_Clear(); } Py_XDECREF(res); + PyErr_Restore(tp, v, tb); if (--((PyObject *) self)->ob_refcnt != 0) return; } Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Sat Jan 17 01:46:30 2009 @@ -97,6 +97,12 @@ def readinto(self, buf): MockRawIO.readinto(self, buf) return len(buf) * 5 + + +class CloseFailureIO(MockRawIO): + + def close(self): + raise IOError class MockFileIO(io.BytesIO): @@ -495,6 +501,14 @@ # bufio should now be closed, and using it a second time should raise # a ValueError. self.assertRaises(ValueError, _with) + + def testErrorThroughDestructor(self): + # Test that the exception state is not modified by a destructor, + # even if close() fails. + rawio = CloseFailureIO() + def f(): + self.tp(rawio).xyzzy + self.assertRaises(AttributeError, f) class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): @@ -1333,6 +1347,14 @@ del t self.assertEqual(record, [1, 2, 3]) + def testErrorThroughDestructor(self): + # Test that the exception state is not modified by a destructor, + # even if close() fails. + rawio = CloseFailureIO() + def f(): + io.TextIOWrapper(rawio).xyzzy + self.assertRaises(AttributeError, f) + # Systematic tests of the text I/O API def testBasicIO(self): From python-checkins at python.org Sat Jan 17 01:54:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 01:54:59 +0100 (CET) Subject: [Python-checkins] r68641 - sandbox/trunk/io-c/_textio.c Message-ID: <20090117005459.D7BCF1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 01:54:59 2009 New Revision: 68641 Log: Don't forget to clear the err status if we fail to import the locale module. This solves a bunch of (bootstrap-related) test failures in the regression suite here. Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 17 01:54:59 2009 @@ -647,6 +647,7 @@ /* try locale.getpreferredencoding() */ PyObject *locale = PyImport_ImportModule("locale"); if (locale == NULL) { + PyErr_Clear(); self->encoding = PyUnicode_FromString("ascii"); } else { From python-checkins at python.org Sat Jan 17 02:01:07 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 02:01:07 +0100 (CET) Subject: [Python-checkins] r68642 - sandbox/trunk/io-c/_textio.c Message-ID: <20090117010107.D2C4F1E403C@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 02:01:07 2009 New Revision: 68642 Log: fix gcc warnings about signedness mismatch Modified: sandbox/trunk/io-c/_textio.c Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 17 02:01:07 2009 @@ -1541,7 +1541,7 @@ static int TextIOWrapper_parseCookie(CookieStruct *cookie, PyObject *cookieObj) { - char buffer[COOKIE_BUF_LEN]; + unsigned char buffer[COOKIE_BUF_LEN]; PyLongObject *cookieLong = (PyLongObject *)PyNumber_Long(cookieObj); if (cookieLong == NULL) return -1; @@ -1565,7 +1565,7 @@ static PyObject * TextIOWrapper_buildCookie(CookieStruct *cookie) { - char buffer[COOKIE_BUF_LEN]; + unsigned char buffer[COOKIE_BUF_LEN]; * (Py_off_t *)(buffer + OFF_START_POS) = cookie->start_pos; * (int *) (buffer + OFF_DEC_FLAGS) = cookie->dec_flags; From python-checkins at python.org Sat Jan 17 03:40:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 03:40:14 +0100 (CET) Subject: [Python-checkins] r68643 - python/branches/py3k/Lib/test/test_io.py Message-ID: <20090117024014.1E45E1E402D@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 03:40:13 2009 New Revision: 68643 Log: Make test_io faster Modified: python/branches/py3k/Lib/test/test_io.py Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Sat Jan 17 03:40:13 2009 @@ -1021,6 +1021,10 @@ def testSeekAndTell(self): """Test seek/tell using the StatefulIncrementalDecoder.""" + # Make this test faster by forcing a smaller (but large enough) + # chunk size. The bigger the chunker size, the slower seek() is, + # as it tries to replay character decoding one byte at a time. + CHUNK_SIZE = 256 def testSeekAndTellWithData(data, min_pos=0): """Tell/seek to various points within a data stream and ensure @@ -1035,6 +1039,7 @@ 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._CHUNK_SIZE = CHUNK_SIZE self.assertEquals(f.read(i), decoded[:i]) cookie = f.tell() self.assertEquals(f.read(j), decoded[i:i + j]) @@ -1052,7 +1057,6 @@ testSeekAndTellWithData(input) # Position each test case so that it crosses a chunk boundary. - CHUNK_SIZE = io.TextIOWrapper._CHUNK_SIZE for input, _, _ in StatefulIncrementalDecoderTest.test_cases: offset = CHUNK_SIZE - len(input)//2 prefix = b'.'*offset From python-checkins at python.org Sat Jan 17 03:52:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 03:52:25 +0100 (CET) Subject: [Python-checkins] r68644 - sandbox/trunk/io-c/_bufferedio.c Message-ID: <20090117025225.ABDC71E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 03:52:25 2009 New Revision: 68644 Log: This TODO has been done. Modified: sandbox/trunk/io-c/_bufferedio.c Modified: sandbox/trunk/io-c/_bufferedio.c ============================================================================== --- sandbox/trunk/io-c/_bufferedio.c (original) +++ sandbox/trunk/io-c/_bufferedio.c Sat Jan 17 03:52:25 2009 @@ -3,8 +3,6 @@ #include "pythread.h" #include "_iomodule.h" -/* TODO: offsets must be off_t, not Py_ssize_t. See _fileio.c for examples */ - /* * BufferedIOBase class, inherits from IOBase. */ @@ -591,7 +589,7 @@ } ENTER_BUFFERED(self) - + if (self->writable) { res = _BufferedWriter_flush_unlocked(self, 1); if (res == NULL) From python-checkins at python.org Sat Jan 17 03:53:40 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 03:53:40 +0100 (CET) Subject: [Python-checkins] r68645 - sandbox/trunk/io-c/test_io.py Message-ID: <20090117025340.16F471E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 03:53:39 2009 New Revision: 68645 Log: Add a test for non-blocking peek() Modified: sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Sat Jan 17 03:53:39 2009 @@ -597,12 +597,13 @@ def testReadNonBlocking(self): # Inject some None's in there to simulate EWOULDBLOCK - rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None)) + rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None, None)) bufio = self.tp(rawio) self.assertEquals(b"abcd", bufio.read(6)) self.assertEquals(b"e", bufio.read(1)) self.assertEquals(b"fg", bufio.read()) + self.assertEquals(b"", bufio.peek(1)) self.assert_(None is bufio.read()) self.assertEquals(b"", bufio.read()) From python-checkins at python.org Sat Jan 17 03:57:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 03:57:24 +0100 (CET) Subject: [Python-checkins] r68646 - sandbox/trunk/io-c/_iobase.c Message-ID: <20090117025724.AED7D1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 03:57:24 2009 New Revision: 68646 Log: Make IOBase.readline() much more robust Modified: sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Sat Jan 17 03:57:24 2009 @@ -363,9 +363,15 @@ if (has_peek) { PyObject *readahead = PyObject_CallMethod(self, "peek", "i", 1); - assert(PyBytes_Check(readahead)); if (readahead == NULL) goto fail; + if (!PyBytes_Check(readahead)) { + PyErr_Format(PyExc_IOError, + "peek() should have returned a bytes object, " + "not '%.200s'", Py_TYPE(readahead)->tp_name); + Py_DECREF(readahead); + goto fail; + } if (PyBytes_GET_SIZE(readahead) > 0) { Py_ssize_t n = 0; const char *buf = PyBytes_AS_STRING(readahead); @@ -393,15 +399,22 @@ b = PyObject_CallMethod(self, "read", "n", nreadahead); if (b == NULL) goto fail; - assert(PyBytes_Check(b)); - if (Py_SIZE(b) == 0) { + if (!PyBytes_Check(b)) { + PyErr_Format(PyExc_IOError, + "read() should have returned a bytes object, " + "not '%.200s'", Py_TYPE(b)->tp_name); + Py_DECREF(b); + goto fail; + } + if (PyBytes_GET_SIZE(b) == 0) { Py_DECREF(b); break; } - old_size = Py_SIZE(buffer); - PyByteArray_Resize(buffer, old_size + Py_SIZE(b)); - memcpy(PyByteArray_AS_STRING(buffer) + old_size, PyBytes_AS_STRING(b), Py_SIZE(b)); + old_size = PyByteArray_GET_SIZE(buffer); + PyByteArray_Resize(buffer, old_size + PyBytes_GET_SIZE(b)); + memcpy(PyByteArray_AS_STRING(buffer) + old_size, + PyBytes_AS_STRING(b), PyBytes_GET_SIZE(b)); Py_DECREF(b); @@ -414,6 +427,7 @@ Py_DECREF(buffer); return result; fail: + printf("ERROR %d\n", !!PyErr_Occurred()); Py_DECREF(buffer); return NULL; } From buildbot at python.org Sat Jan 17 04:17:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 03:17:19 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090117031719.EECFF1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/122 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 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_capi Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/test/test_capi.py", line 104, in test_main test() _testcapi.error: test_lazy_hash_inheritance: type initialised too soon make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 05:15:01 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 17 Jan 2009 05:15:01 +0100 (CET) Subject: [Python-checkins] r68647 - in python/branches/py3k: Lib/inspect.py Lib/test/inspect_fodder2.py Lib/test/test_inspect.py Misc/NEWS Message-ID: <20090117041502.014741E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 17 05:15:01 2009 New Revision: 68647 Log: fix inspect.formatargspec on functions with keyword-only arguments without defaults #4959 Modified: python/branches/py3k/Lib/inspect.py python/branches/py3k/Lib/test/inspect_fodder2.py python/branches/py3k/Lib/test/test_inspect.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/inspect.py ============================================================================== --- python/branches/py3k/Lib/inspect.py (original) +++ python/branches/py3k/Lib/inspect.py Sat Jan 17 05:15:01 2009 @@ -894,7 +894,7 @@ if kwonlyargs: for kwonlyarg in kwonlyargs: spec = formatargandannotation(kwonlyarg) - if kwonlyarg in kwonlydefaults: + if kwonlydefaults and kwonlyarg in kwonlydefaults: spec += formatvalue(kwonlydefaults[kwonlyarg]) specs.append(spec) if varkw is not None: Modified: python/branches/py3k/Lib/test/inspect_fodder2.py ============================================================================== --- python/branches/py3k/Lib/test/inspect_fodder2.py (original) +++ python/branches/py3k/Lib/test/inspect_fodder2.py Sat Jan 17 05:15:01 2009 @@ -105,3 +105,7 @@ #line 105 def annotated(arg1: list): pass + +#line 109 +def keyword_only_arg(*, arg): + pass Modified: python/branches/py3k/Lib/test/test_inspect.py ============================================================================== --- python/branches/py3k/Lib/test/test_inspect.py (original) +++ python/branches/py3k/Lib/test/test_inspect.py Sat Jan 17 05:15:01 2009 @@ -386,6 +386,9 @@ self.assertRaises(ValueError, self.assertArgSpecEquals, mod2.annotated, []) + self.assertRaises(ValueError, self.assertArgSpecEquals, + mod2.keyword_only_arg, []) + def test_getfullargspec(self): self.assertFullArgSpecEquals(mod2.keyworded, [], varargs_e='arg1', @@ -396,6 +399,10 @@ self.assertFullArgSpecEquals(mod2.annotated, ['arg1'], ann_e={'arg1' : list}, formatted='(arg1: list)') + self.assertFullArgSpecEquals(mod2.keyword_only_arg, [], + kwonlyargs_e=['arg'], + formatted='(*, arg)') + def test_getargspec_method(self): class A(object): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 17 05:15:01 2009 @@ -126,6 +126,9 @@ Library ------- +- Issue #4959: inspect.formatargspec now works for keyword only arguments + without defaults. + - Issue #3826 and #4791: The socket module now closes the underlying socket appropriately when it is being used via socket.makefile() objects rather than delaying the close by waiting for garbage collection to do it. From python-checkins at python.org Sat Jan 17 05:28:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 17 Jan 2009 05:28:57 +0100 (CET) Subject: [Python-checkins] r68648 - python/trunk/Lib/inspect.py Message-ID: <20090117042857.3CE831E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 17 05:28:57 2009 New Revision: 68648 Log: use enumerate Modified: python/trunk/Lib/inspect.py Modified: python/trunk/Lib/inspect.py ============================================================================== --- python/trunk/Lib/inspect.py (original) +++ python/trunk/Lib/inspect.py Sat Jan 17 05:28:57 2009 @@ -851,8 +851,8 @@ specs = [] if defaults: firstdefault = len(args) - len(defaults) - for i in range(len(args)): - spec = strseq(args[i], formatarg, join) + for i, arg in enumerate(args): + spec = strseq(arg, formatarg, join) if defaults and i >= firstdefault: spec = spec + formatvalue(defaults[i - firstdefault]) specs.append(spec) From python-checkins at python.org Sat Jan 17 05:39:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 17 Jan 2009 05:39:06 +0100 (CET) Subject: [Python-checkins] r68649 - python/trunk/Lib/test/test_os.py Message-ID: <20090117043906.025471E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 17 05:39:05 2009 New Revision: 68649 Log: trying to find some fpathconf() settings that all unixs support... Modified: python/trunk/Lib/test/test_os.py Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Sat Jan 17 05:39:05 2009 @@ -568,7 +568,7 @@ def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "PC_FILESIZEBITS") + self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): From buildbot at python.org Sat Jan 17 06:06:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 05:06:48 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090117050648.725421E4002@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/116 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_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 695, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Sat Jan 17 06:27:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 05:27:16 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090117052717.12A031E4002@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/17 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 10:45:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 17 Jan 2009 10:45:37 +0100 (CET) Subject: [Python-checkins] r68650 - python/branches/py3k/Doc/c-api/number.rst Message-ID: <20090117094537.AE80C1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 17 10:45:37 2009 New Revision: 68650 Log: Remove a couple of references to long in the c-api docs Modified: python/branches/py3k/Doc/c-api/number.rst 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 Sat Jan 17 10:45:37 2009 @@ -252,7 +252,7 @@ .. cfunction:: PyObject* PyNumber_Index(PyObject *o) - Returns the *o* converted to a Python int or long on success or *NULL* with a + Returns the *o* converted to a Python int on success or *NULL* with a :exc:`TypeError` exception raised on failure. @@ -268,7 +268,7 @@ .. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc) Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an - integer. If *o* can be converted to a Python int or long but the attempt to + integer. If *o* can be converted to a Python int but the attempt to convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the *exc* argument is the type of exception that will be raised (usually :exc:`IndexError` or :exc:`OverflowError`). If *exc* is *NULL*, then the From python-checkins at python.org Sat Jan 17 11:04:46 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 17 Jan 2009 11:04:46 +0100 (CET) Subject: [Python-checkins] r68651 - in python/branches/py3k: Doc/c-api/typeobj.rst Include/object.h Misc/NEWS Modules/datetimemodule.c Objects/boolobject.c Objects/complexobject.c Objects/floatobject.c Objects/longobject.c Objects/setobject.c Objects/typeobject.c Objects/weakrefobject.c PC/winreg.c Message-ID: <20090117100446.ADDF61E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 17 11:04:45 2009 New Revision: 68651 Log: Issue #4910, patch 3/3: rename nb_long to nb_reserved Modified: python/branches/py3k/Doc/c-api/typeobj.rst python/branches/py3k/Include/object.h python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/datetimemodule.c python/branches/py3k/Objects/boolobject.c python/branches/py3k/Objects/complexobject.c python/branches/py3k/Objects/floatobject.c python/branches/py3k/Objects/longobject.c python/branches/py3k/Objects/setobject.c python/branches/py3k/Objects/typeobject.c python/branches/py3k/Objects/weakrefobject.c python/branches/py3k/PC/winreg.c 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 Sat Jan 17 11:04:45 2009 @@ -1057,7 +1057,7 @@ binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; - unaryfunc nb_long; + void *nb_reserved; unaryfunc nb_float; binaryfunc nb_inplace_add; @@ -1088,6 +1088,12 @@ ``Py_NotImplemented``, if another error occurred they must return ``NULL`` and set an exception. + .. note:: + + The :cdata:`nb_reserved` field should always be ``NULL``. It + was previously called :cdata:`nb_long`, and was renamed in + Python 3.0.1. + .. _mapping-structs: Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Sat Jan 17 11:04:45 2009 @@ -219,7 +219,7 @@ binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; - unaryfunc nb_long; + void *nb_reserved; /* the slot formerly known as nb_long */ unaryfunc nb_float; binaryfunc nb_inplace_add; Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 17 11:04:45 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4910: Rename nb_long slot to nb_reserved, and change its + type to (void *). + - 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/py3k/Modules/datetimemodule.c ============================================================================== --- python/branches/py3k/Modules/datetimemodule.c (original) +++ python/branches/py3k/Modules/datetimemodule.c Sat Jan 17 11:04:45 2009 @@ -2111,7 +2111,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ Modified: python/branches/py3k/Objects/boolobject.c ============================================================================== --- python/branches/py3k/Objects/boolobject.c (original) +++ python/branches/py3k/Objects/boolobject.c Sat Jan 17 11:04:45 2009 @@ -109,7 +109,7 @@ bool_xor, /* nb_xor */ bool_or, /* nb_or */ 0, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ 0, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Sat Jan 17 11:04:45 2009 @@ -1060,7 +1060,7 @@ 0, /* nb_xor */ 0, /* nb_or */ complex_int, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ complex_float, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Sat Jan 17 11:04:45 2009 @@ -1798,7 +1798,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ float_trunc, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ float_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Sat Jan 17 11:04:45 2009 @@ -3830,7 +3830,7 @@ long_xor, /*nb_xor*/ long_or, /*nb_or*/ long_long, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ long_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k/Objects/setobject.c ============================================================================== --- python/branches/py3k/Objects/setobject.c (original) +++ python/branches/py3k/Objects/setobject.c Sat Jan 17 11:04:45 2009 @@ -2082,7 +2082,7 @@ (binaryfunc)set_xor, /*nb_xor*/ (binaryfunc)set_or, /*nb_or*/ 0, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ (binaryfunc)set_isub, /*nb_inplace_subtract*/ Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sat Jan 17 11:04:45 2009 @@ -3602,7 +3602,6 @@ COPYNUM(nb_xor); COPYNUM(nb_or); COPYNUM(nb_int); - COPYNUM(nb_long); COPYNUM(nb_float); COPYNUM(nb_inplace_add); COPYNUM(nb_inplace_subtract); @@ -4827,7 +4826,6 @@ SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__") SLOT0(slot_nb_int, "__int__") -SLOT0(slot_nb_long, "__long__") SLOT0(slot_nb_float, "__float__") SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O") SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O") @@ -5443,8 +5441,6 @@ RBINSLOT("__ror__", nb_or, slot_nb_or, "|"), UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc, "int(x)"), - UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc, - "int(x)"), UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc, "float(x)"), NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, Modified: python/branches/py3k/Objects/weakrefobject.c ============================================================================== --- python/branches/py3k/Objects/weakrefobject.c (original) +++ python/branches/py3k/Objects/weakrefobject.c Sat Jan 17 11:04:45 2009 @@ -594,7 +594,7 @@ proxy_xor, /*nb_xor*/ proxy_or, /*nb_or*/ proxy_int, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ proxy_float, /*nb_float*/ proxy_iadd, /*nb_inplace_add*/ proxy_isub, /*nb_inplace_subtract*/ Modified: python/branches/py3k/PC/winreg.c ============================================================================== --- python/branches/py3k/PC/winreg.c (original) +++ python/branches/py3k/PC/winreg.c Sat Jan 17 11:04:45 2009 @@ -451,7 +451,7 @@ PyHKEY_binaryFailureFunc, /* nb_xor */ PyHKEY_binaryFailureFunc, /* nb_or */ PyHKEY_intFunc, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ PyHKEY_unaryFailureFunc, /* nb_float */ }; From python-checkins at python.org Sat Jan 17 11:21:24 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 17 Jan 2009 11:21:24 +0100 (CET) Subject: [Python-checkins] r68652 - in python/branches/py3k/Doc: c-api/arg.rst c-api/intro.rst c-api/typeobj.rst library/math.rst library/reprlib.rst Message-ID: <20090117102124.2D95B1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 17 11:21:23 2009 New Revision: 68652 Log: Fix a few more references to long integers in the docs. Modified: python/branches/py3k/Doc/c-api/arg.rst python/branches/py3k/Doc/c-api/intro.rst python/branches/py3k/Doc/c-api/typeobj.rst python/branches/py3k/Doc/library/math.rst python/branches/py3k/Doc/library/reprlib.rst Modified: python/branches/py3k/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k/Doc/c-api/arg.rst (original) +++ python/branches/py3k/Doc/c-api/arg.rst Sat Jan 17 11:21:23 2009 @@ -489,11 +489,11 @@ ``H`` (integer) [unsigned short int] Convert a C :ctype:`unsigned short int` to a Python integer object. - ``I`` (integer/long) [unsigned int] - Convert a C :ctype:`unsigned int` to a Python long integer object. + ``I`` (integer) [unsigned int] + Convert a C :ctype:`unsigned int` to a Python integer object. - ``k`` (integer/long) [unsigned long] - Convert a C :ctype:`unsigned long` to a Python long integer object. + ``k`` (integer) [unsigned long] + Convert a C :ctype:`unsigned long` to a Python integer object. ``L`` (long) [PY_LONG_LONG] Convert a C :ctype:`long long` to a Python integer object. Only available 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 Sat Jan 17 11:21:23 2009 @@ -607,7 +607,7 @@ * Sanity checks of the input arguments are added to frame creation. -* The storage for long ints is initialized with a known invalid pattern to catch +* The storage for ints is initialized with a known invalid pattern to catch reference to uninitialized digits. * Low-level tracing and extra exception checking are added to the runtime 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 Sat Jan 17 11:21:23 2009 @@ -135,7 +135,7 @@ :attr:`ob_size` field, and the instance size is :attr:`tp_basicsize` plus N times :attr:`tp_itemsize`, where N is the "length" of the object. The value of N is typically stored in the instance's :attr:`ob_size` field. There are - exceptions: for example, long ints use a negative :attr:`ob_size` to indicate a + exceptions: for example, ints use a negative :attr:`ob_size` to indicate a negative number, and N is ``abs(ob_size)`` there. Also, the presence of an :attr:`ob_size` field in the instance layout doesn't mean that the instance structure is variable-length (for example, the structure for the list type has @@ -812,7 +812,7 @@ where :attr:`tp_basicsize`, :attr:`tp_itemsize` and :attr:`tp_dictoffset` are taken from the type object, and :attr:`ob_size` is taken from the instance. The - absolute value is taken because long ints use the sign of :attr:`ob_size` to + absolute value is taken because ints use the sign of :attr:`ob_size` to store the sign of the number. (There's never a need to do this calculation yourself; it is done for you by :cfunc:`_PyObject_GetDictPtr`.) Modified: python/branches/py3k/Doc/library/math.rst ============================================================================== --- python/branches/py3k/Doc/library/math.rst (original) +++ python/branches/py3k/Doc/library/math.rst Sat Jan 17 11:21:23 2009 @@ -118,7 +118,7 @@ .. function:: trunc(x) Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually - a long integer). Delegates to ``x.__trunc__()``. + an integer). Delegates to ``x.__trunc__()``. Note that :func:`frexp` and :func:`modf` have a different call/return pattern Modified: python/branches/py3k/Doc/library/reprlib.rst ============================================================================== --- python/branches/py3k/Doc/library/reprlib.rst (original) +++ python/branches/py3k/Doc/library/reprlib.rst Sat Jan 17 11:21:23 2009 @@ -65,7 +65,7 @@ .. attribute:: Repr.maxlong - Maximum number of characters in the representation for a long integer. Digits + Maximum number of characters in the representation for an integer. Digits are dropped from the middle. The default is ``40``. From python-checkins at python.org Sat Jan 17 11:48:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 17 Jan 2009 11:48:28 +0100 (CET) Subject: [Python-checkins] r68653 - python/branches/py3k/Objects/floatobject.c Message-ID: <20090117104828.BB9071E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 17 11:48:28 2009 New Revision: 68653 Log: Remove attempted long->int conversions in py3k version of float.as_integer_ratio. Modified: python/branches/py3k/Objects/floatobject.c Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Sat Jan 17 11:48:28 2009 @@ -1495,12 +1495,6 @@ py_exponent = NULL; } - /* Returns ints instead of longs where possible */ - INPLACE_UPDATE(numerator, PyNumber_Int(numerator)); - if (numerator == NULL) goto error; - INPLACE_UPDATE(denominator, PyNumber_Int(denominator)); - if (denominator == NULL) goto error; - result_pair = PyTuple_Pack(2, numerator, denominator); #undef INPLACE_UPDATE From buildbot at python.org Sat Jan 17 12:22:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 11:22:14 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090117112214.6A3AC1E4002@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/121 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_capi Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_capi.py", line 104, in test_main test() _testcapi.error: test_lazy_hash_inheritance: type initialised too soon make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 12:32:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 11:32:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090117113211.946291E4002@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/118 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 17 12:36:36 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 17 Jan 2009 12:36:36 +0100 (CET) Subject: [Python-checkins] r68654 - in tracker/instances/spambayes_integration: detectors/spambayes.py extensions/spambayes.py Message-ID: <20090117113636.124361E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 17 12:36:35 2009 New Revision: 68654 Log: Issue 215: add hasrev token. Modified: tracker/instances/spambayes_integration/detectors/spambayes.py tracker/instances/spambayes_integration/extensions/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 Sat Jan 17 12:36:35 2009 @@ -3,9 +3,12 @@ import socket import time import math +import re from roundup.exceptions import Reject +REVPAT = re.compile(r'(r[0-9]+\b|rev(ision)? [0-9]+\b)') + def extract_classinfo(db, klass, nodeid, newvalues): if None == nodeid: node = newvalues @@ -28,7 +31,8 @@ tokens = ["klass:%s" % klass.classname, "author:%s" % authorid, - "authorage:%d" % int(math.log(authorage))] + "authorage:%d" % int(math.log(authorage)), + "hasrev:%s" % REVPAT.search(content) is not None] return (content, tokens) Modified: tracker/instances/spambayes_integration/extensions/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/extensions/spambayes.py (original) +++ tracker/instances/spambayes_integration/extensions/spambayes.py Sat Jan 17 12:36:35 2009 @@ -3,15 +3,20 @@ import xmlrpclib, socket +REVPAT = re.compile(r'(r[0-9]+\b|rev(ision)? [0-9]+\b)') + def extract_classinfo(db, classname, nodeid): node = db.getnode(classname, nodeid) authorage = node['creation'].timestamp() - \ db.getnode('user', node.get('author', node.get('creator')))['creation'].timestamp() + authorid = node.get('author', node.get('creator') + tokens = ["klass:%s" % classname, - "author:%s" % node.get('author', node.get('creator')), - "authorage:%d" % int(authorage)] + "author:%s" % authorid, + "authorage:%d" % int(math.log(authorage)), + "hasrev:%s" % REVPAT.search(content) is not None] klass = db.getclass(classname) return (klass.get(nodeid, 'content'), tokens) From python-checkins at python.org Sat Jan 17 12:40:23 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 17 Jan 2009 12:40:23 +0100 (CET) Subject: [Python-checkins] r68655 - tracker/instances/spambayes_integration/extensions/spambayes.py Message-ID: <20090117114023.D6EB01E4020@bag.python.org> Author: martin.v.loewis Date: Sat Jan 17 12:40:23 2009 New Revision: 68655 Log: Fix syntax errors. Modified: tracker/instances/spambayes_integration/extensions/spambayes.py Modified: tracker/instances/spambayes_integration/extensions/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/extensions/spambayes.py (original) +++ tracker/instances/spambayes_integration/extensions/spambayes.py Sat Jan 17 12:40:23 2009 @@ -1,3 +1,4 @@ +import re from roundup.cgi.actions import Action from roundup.cgi.exceptions import * @@ -11,7 +12,7 @@ authorage = node['creation'].timestamp() - \ db.getnode('user', node.get('author', node.get('creator')))['creation'].timestamp() - authorid = node.get('author', node.get('creator') + authorid = node.get('author', node.get('creator')) tokens = ["klass:%s" % classname, "author:%s" % authorid, From python-checkins at python.org Sat Jan 17 12:42:13 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 17 Jan 2009 12:42:13 +0100 (CET) Subject: [Python-checkins] r68656 - tracker/instances/spambayes_integration/extensions/spambayes.py Message-ID: <20090117114213.79D161E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 17 12:42:13 2009 New Revision: 68656 Log: Add missing import. Modified: tracker/instances/spambayes_integration/extensions/spambayes.py Modified: tracker/instances/spambayes_integration/extensions/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/extensions/spambayes.py (original) +++ tracker/instances/spambayes_integration/extensions/spambayes.py Sat Jan 17 12:42:13 2009 @@ -1,4 +1,4 @@ -import re +import re, math from roundup.cgi.actions import Action from roundup.cgi.exceptions import * From python-checkins at python.org Sat Jan 17 12:44:51 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 17 Jan 2009 12:44:51 +0100 (CET) Subject: [Python-checkins] r68657 - tracker/instances/spambayes_integration/extensions/spambayes.py Message-ID: <20090117114451.4349E1E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 17 12:44:51 2009 New Revision: 68657 Log: Add content field. Modified: tracker/instances/spambayes_integration/extensions/spambayes.py Modified: tracker/instances/spambayes_integration/extensions/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/extensions/spambayes.py (original) +++ tracker/instances/spambayes_integration/extensions/spambayes.py Sat Jan 17 12:44:51 2009 @@ -14,6 +14,8 @@ authorid = node.get('author', node.get('creator')) + content = node['content'] + tokens = ["klass:%s" % classname, "author:%s" % authorid, "authorage:%d" % int(math.log(authorage)), From python-checkins at python.org Sat Jan 17 12:51:51 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 17 Jan 2009 12:51:51 +0100 (CET) Subject: [Python-checkins] r68658 - tracker/instances/spambayes_integration/extensions/spambayes.py Message-ID: <20090117115151.287181E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 17 12:51:50 2009 New Revision: 68658 Log: Fix access to content. Modified: tracker/instances/spambayes_integration/extensions/spambayes.py Modified: tracker/instances/spambayes_integration/extensions/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/extensions/spambayes.py (original) +++ tracker/instances/spambayes_integration/extensions/spambayes.py Sat Jan 17 12:51:50 2009 @@ -14,15 +14,14 @@ authorid = node.get('author', node.get('creator')) - content = node['content'] + content = db.getclass(classname).get(nodeid, 'content') tokens = ["klass:%s" % classname, "author:%s" % authorid, "authorage:%d" % int(math.log(authorage)), "hasrev:%s" % REVPAT.search(content) is not None] - klass = db.getclass(classname) - return (klass.get(nodeid, 'content'), tokens) + return (content, tokens) def train_spambayes(db, content, tokens, is_spam): spambayes_uri = db.config.detectors['SPAMBAYES_URI'] From python-checkins at python.org Sat Jan 17 13:09:46 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 17 Jan 2009 13:09:46 +0100 (CET) Subject: [Python-checkins] r68659 - in tracker/instances/spambayes_integration: detectors/spambayes.py extensions/spambayes.py Message-ID: <20090117120946.F41E81E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 17 13:09:46 2009 New Revision: 68659 Log: Correctly parenthize. Modified: tracker/instances/spambayes_integration/detectors/spambayes.py tracker/instances/spambayes_integration/extensions/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 Sat Jan 17 13:09:46 2009 @@ -32,7 +32,7 @@ tokens = ["klass:%s" % klass.classname, "author:%s" % authorid, "authorage:%d" % int(math.log(authorage)), - "hasrev:%s" % REVPAT.search(content) is not None] + "hasrev:%s" % (REVPAT.search(content) is not None)] return (content, tokens) Modified: tracker/instances/spambayes_integration/extensions/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/extensions/spambayes.py (original) +++ tracker/instances/spambayes_integration/extensions/spambayes.py Sat Jan 17 13:09:46 2009 @@ -19,7 +19,7 @@ tokens = ["klass:%s" % classname, "author:%s" % authorid, "authorage:%d" % int(math.log(authorage)), - "hasrev:%s" % REVPAT.search(content) is not None] + "hasrev:%s" % (REVPAT.search(content) is not None)] return (content, tokens) From python-checkins at python.org Sat Jan 17 13:46:58 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 13:46:58 +0100 (CET) Subject: [Python-checkins] r68660 - sandbox/trunk/io-c/_iobase.c Message-ID: <20090117124658.1C96F1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 13:46:57 2009 New Revision: 68660 Log: Remove debug helper... Modified: sandbox/trunk/io-c/_iobase.c Modified: sandbox/trunk/io-c/_iobase.c ============================================================================== --- sandbox/trunk/io-c/_iobase.c (original) +++ sandbox/trunk/io-c/_iobase.c Sat Jan 17 13:46:57 2009 @@ -427,7 +427,6 @@ Py_DECREF(buffer); return result; fail: - printf("ERROR %d\n", !!PyErr_Occurred()); Py_DECREF(buffer); return NULL; } From python-checkins at python.org Sat Jan 17 17:40:19 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 17:40:19 +0100 (CET) Subject: [Python-checkins] r68661 - in python/trunk: Lib/zipfile.py Misc/NEWS Message-ID: <20090117164019.4F36D1E401B@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 17:40:17 2009 New Revision: 68661 Log: #3997: zipfiles generated with more than 65536 files could not be opened with other applications. Reviewed by Martin, will backport to 2.6 and 3.0 Modified: python/trunk/Lib/zipfile.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Sat Jan 17 17:40:17 2009 @@ -26,7 +26,7 @@ error = BadZipfile # The exception raised by this module -ZIP64_LIMIT= (1 << 31) - 1 +ZIP64_LIMIT = (1 << 31) - 1 ZIP_FILECOUNT_LIMIT = 1 << 16 ZIP_MAX_COMMENT = (1 << 16) - 1 @@ -1187,19 +1187,26 @@ pos2 = self.fp.tell() # Write end-of-zip-archive record + centDirCount = count + centDirSize = pos2 - pos1 centDirOffset = pos1 - if pos1 > ZIP64_LIMIT: + if (centDirCount >= ZIP_FILECOUNT_LIMIT or + centDirOffset > ZIP64_LIMIT or + centDirSize > ZIP64_LIMIT): # Need to write the ZIP64 end-of-archive records zip64endrec = struct.pack( structEndArchive64, stringEndArchive64, - 44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1) + 44, 45, 45, 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset) self.fp.write(zip64endrec) zip64locrec = struct.pack( structEndArchive64Locator, stringEndArchive64Locator, 0, pos2, 1) self.fp.write(zip64locrec) - centDirOffset = 0xFFFFFFFF + centDirCount = min(centDirCount, 0xFFFF) + centDirSize = min(centDirSize, 0xFFFFFFFF) + centDirOffset = min(centDirOffset, 0xFFFFFFFF) # check for valid comment length if len(self.comment) >= ZIP_MAX_COMMENT: @@ -1209,9 +1216,8 @@ self.comment = self.comment[:ZIP_MAX_COMMENT] endrec = struct.pack(structEndArchive, stringEndArchive, - 0, 0, count % ZIP_FILECOUNT_LIMIT, - count % ZIP_FILECOUNT_LIMIT, pos2 - pos1, - centDirOffset, len(self.comment)) + 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset, len(self.comment)) self.fp.write(endrec) self.fp.write(self.comment) self.fp.flush() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 17 17:40:17 2009 @@ -137,6 +137,9 @@ Library ------- +- Issue #3997: zipfiles generated with more than 65536 files could not be + opened with other applications. + - Issue #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. From python-checkins at python.org Sat Jan 17 17:42:27 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 17:42:27 +0100 (CET) Subject: [Python-checkins] r68662 - in python/branches/py3k: Lib/zipfile.py Message-ID: <20090117164227.2795A1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 17:42:26 2009 New Revision: 68662 Log: Merged revisions 68661 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68661 | amaury.forgeotdarc | 2009-01-17 17:40:17 +0100 (Sat, 17 Jan 2009) | 5 lines #3997: zipfiles generated with more than 65536 files could not be opened with other applications. Reviewed by Martin, will backport to 2.6 and 3.0 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/zipfile.py Modified: python/branches/py3k/Lib/zipfile.py ============================================================================== --- python/branches/py3k/Lib/zipfile.py (original) +++ python/branches/py3k/Lib/zipfile.py Sat Jan 17 17:42:26 2009 @@ -28,7 +28,7 @@ error = BadZipfile # The exception raised by this module -ZIP64_LIMIT= (1 << 31) - 1 +ZIP64_LIMIT = (1 << 31) - 1 ZIP_FILECOUNT_LIMIT = 1 << 16 ZIP_MAX_COMMENT = (1 << 16) - 1 @@ -1198,19 +1198,26 @@ pos2 = self.fp.tell() # Write end-of-zip-archive record + centDirCount = count + centDirSize = pos2 - pos1 centDirOffset = pos1 - if pos1 > ZIP64_LIMIT: + if (centDirCount >= ZIP_FILECOUNT_LIMIT or + centDirOffset > ZIP64_LIMIT or + centDirSize > ZIP64_LIMIT): # Need to write the ZIP64 end-of-archive records zip64endrec = struct.pack( structEndArchive64, stringEndArchive64, - 44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1) + 44, 45, 45, 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset) self.fp.write(zip64endrec) zip64locrec = struct.pack( structEndArchive64Locator, stringEndArchive64Locator, 0, pos2, 1) self.fp.write(zip64locrec) - centDirOffset = 0xFFFFFFFF + centDirCount = min(centDirCount, 0xFFFF) + centDirSize = min(centDirSize, 0xFFFFFFFF) + centDirOffset = min(centDirOffset, 0xFFFFFFFF) # check for valid comment length if len(self.comment) >= ZIP_MAX_COMMENT: @@ -1220,9 +1227,8 @@ self.comment = self.comment[:ZIP_MAX_COMMENT] endrec = struct.pack(structEndArchive, stringEndArchive, - 0, 0, count % ZIP_FILECOUNT_LIMIT, - count % ZIP_FILECOUNT_LIMIT, pos2 - pos1, - centDirOffset, len(self.comment)) + 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset, len(self.comment)) self.fp.write(endrec) self.fp.write(self.comment) self.fp.flush() From python-checkins at python.org Sat Jan 17 17:46:36 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 17:46:36 +0100 (CET) Subject: [Python-checkins] r68663 - in python/branches/release26-maint: Lib/zipfile.py Misc/NEWS Message-ID: <20090117164636.081561E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 17:46:35 2009 New Revision: 68663 Log: Merged revisions 68661 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68661 | amaury.forgeotdarc | 2009-01-17 17:40:17 +0100 (Sat, 17 Jan 2009) | 5 lines #3997: zipfiles generated with more than 65536 files could not be opened with other applications. Reviewed by Martin, will backport to 2.6 and 3.0 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/zipfile.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/zipfile.py (original) +++ python/branches/release26-maint/Lib/zipfile.py Sat Jan 17 17:46:35 2009 @@ -26,7 +26,7 @@ error = BadZipfile # The exception raised by this module -ZIP64_LIMIT= (1 << 31) - 1 +ZIP64_LIMIT = (1 << 31) - 1 ZIP_FILECOUNT_LIMIT = 1 << 16 ZIP_MAX_COMMENT = (1 << 16) - 1 @@ -1175,19 +1175,26 @@ pos2 = self.fp.tell() # Write end-of-zip-archive record + centDirCount = count + centDirSize = pos2 - pos1 centDirOffset = pos1 - if pos1 > ZIP64_LIMIT: + if (centDirCount >= ZIP_FILECOUNT_LIMIT or + centDirOffset > ZIP64_LIMIT or + centDirSize > ZIP64_LIMIT): # Need to write the ZIP64 end-of-archive records zip64endrec = struct.pack( structEndArchive64, stringEndArchive64, - 44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1) + 44, 45, 45, 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset) self.fp.write(zip64endrec) zip64locrec = struct.pack( structEndArchive64Locator, stringEndArchive64Locator, 0, pos2, 1) self.fp.write(zip64locrec) - centDirOffset = 0xFFFFFFFF + centDirCount = min(centDirCount, 0xFFFF) + centDirSize = min(centDirSize, 0xFFFFFFFF) + centDirOffset = min(centDirOffset, 0xFFFFFFFF) # check for valid comment length if len(self.comment) >= ZIP_MAX_COMMENT: @@ -1197,9 +1204,8 @@ self.comment = self.comment[:ZIP_MAX_COMMENT] endrec = struct.pack(structEndArchive, stringEndArchive, - 0, 0, count % ZIP_FILECOUNT_LIMIT, - count % ZIP_FILECOUNT_LIMIT, pos2 - pos1, - centDirOffset, len(self.comment)) + 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset, len(self.comment)) self.fp.write(endrec) self.fp.write(self.comment) self.fp.flush() Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 17 17:46:35 2009 @@ -73,6 +73,9 @@ Library ------- +- Issue #3997: zipfiles generated with more than 65536 files could not be + opened with other applications. + - Issue 4816: itertools.combinations() and itertools.product were raising a ValueError for values of *r* larger than the input iterable. They now correctly return an empty iterator. From python-checkins at python.org Sat Jan 17 17:54:09 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 17:54:09 +0100 (CET) Subject: [Python-checkins] r68664 - in python/branches/release30-maint: Lib/zipfile.py Message-ID: <20090117165409.89AA71E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 17:54:09 2009 New Revision: 68664 Log: Merged revisions 68662 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68662 | amaury.forgeotdarc | 2009-01-17 17:42:26 +0100 (Sat, 17 Jan 2009) | 12 lines Merged revisions 68661 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68661 | amaury.forgeotdarc | 2009-01-17 17:40:17 +0100 (Sat, 17 Jan 2009) | 5 lines #3997: zipfiles generated with more than 65536 files could not be opened with other applications. Reviewed by Martin, will backport to 2.6 and 3.0 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/zipfile.py Modified: python/branches/release30-maint/Lib/zipfile.py ============================================================================== --- python/branches/release30-maint/Lib/zipfile.py (original) +++ python/branches/release30-maint/Lib/zipfile.py Sat Jan 17 17:54:09 2009 @@ -28,7 +28,7 @@ error = BadZipfile # The exception raised by this module -ZIP64_LIMIT= (1 << 31) - 1 +ZIP64_LIMIT = (1 << 31) - 1 ZIP_FILECOUNT_LIMIT = 1 << 16 ZIP_MAX_COMMENT = (1 << 16) - 1 @@ -1186,19 +1186,26 @@ pos2 = self.fp.tell() # Write end-of-zip-archive record + centDirCount = count + centDirSize = pos2 - pos1 centDirOffset = pos1 - if pos1 > ZIP64_LIMIT: + if (centDirCount >= ZIP_FILECOUNT_LIMIT or + centDirOffset > ZIP64_LIMIT or + centDirSize > ZIP64_LIMIT): # Need to write the ZIP64 end-of-archive records zip64endrec = struct.pack( structEndArchive64, stringEndArchive64, - 44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1) + 44, 45, 45, 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset) self.fp.write(zip64endrec) zip64locrec = struct.pack( structEndArchive64Locator, stringEndArchive64Locator, 0, pos2, 1) self.fp.write(zip64locrec) - centDirOffset = 0xFFFFFFFF + centDirCount = min(centDirCount, 0xFFFF) + centDirSize = min(centDirSize, 0xFFFFFFFF) + centDirOffset = min(centDirOffset, 0xFFFFFFFF) # check for valid comment length if len(self.comment) >= ZIP_MAX_COMMENT: @@ -1208,9 +1215,8 @@ self.comment = self.comment[:ZIP_MAX_COMMENT] endrec = struct.pack(structEndArchive, stringEndArchive, - 0, 0, count % ZIP_FILECOUNT_LIMIT, - count % ZIP_FILECOUNT_LIMIT, pos2 - pos1, - centDirOffset, len(self.comment)) + 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset, len(self.comment)) self.fp.write(endrec) self.fp.write(self.comment) self.fp.flush() From buildbot at python.org Sat Jan 17 18:07:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 17:07:40 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090117170740.A7B1B1E4002@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/4486 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_zipfile.py", line 506, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_zipfile.py", line 499, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_zipfile.py", line 434, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_zipfile.py", line 493, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_zipfile.py", line 434, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 18:11:51 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 18:11:51 +0100 (CET) Subject: [Python-checkins] r68665 - python/trunk/Objects/typeobject.c Message-ID: <20090117171151.4286E1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 18:11:50 2009 New Revision: 68665 Log: #4930: Slightly cleaner (and faster) code in type creation: compare slots by address, not by name. Modified: python/trunk/Objects/typeobject.c Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Sat Jan 17 18:11:50 2009 @@ -6114,7 +6114,7 @@ else if (Py_TYPE(descr) == &PyCFunction_Type && PyCFunction_GET_FUNCTION(descr) == (PyCFunction)tp_new_wrapper && - strcmp(p->name, "__new__") == 0) + ptr == (void**)&type->tp_new) { /* The __new__ wrapper is not a wrapper descriptor, so must be special-cased differently. @@ -6134,7 +6134,7 @@ point out a bug in this reasoning a beer. */ } else if (descr == Py_None && - strcmp(p->name, "__hash__") == 0) { + ptr == (void**)&type->tp_hash) { /* We specifically allow __hash__ to be set to None to prevent inheritance of the default implementation from object.__hash__ */ From buildbot at python.org Sat Jan 17 18:34:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 17:34:50 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090117173450.B50EB1E4002@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/910 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib2 test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 506, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 499, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 434, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 493, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 434, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 18:41:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 17:41:02 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090117174103.190A01E4002@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/714 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 506, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 499, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 434, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 493, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 434, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 710, in __init__ self._GetContents() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 730, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/zipfile.py", line 767, in _RealGetContents raise BadZipfile, "Bad magic number for central directory" BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 19:00:58 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 17 Jan 2009 19:00:58 +0100 (CET) Subject: [Python-checkins] r68666 - in python/branches/release30-maint: Doc/c-api/arg.rst Doc/c-api/intro.rst Doc/c-api/number.rst Doc/c-api/typeobj.rst Doc/library/math.rst Doc/library/reprlib.rst Include/object.h Misc/NEWS Modules/datetimemodule.c Objects/boolobject.c Objects/complexobject.c Objects/floatobject.c Objects/longobject.c Objects/setobject.c Objects/typeobject.c Objects/weakrefobject.c PC/winreg.c Message-ID: <20090117180058.EF1481E4038@bag.python.org> Author: mark.dickinson Date: Sat Jan 17 19:00:58 2009 New Revision: 68666 Log: Merged revisions 68650-68653 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68650 | mark.dickinson | 2009-01-17 09:45:37 +0000 (Sat, 17 Jan 2009) | 2 lines Remove a couple of references to long in the c-api docs ........ r68651 | mark.dickinson | 2009-01-17 10:04:45 +0000 (Sat, 17 Jan 2009) | 2 lines Issue #4910, patch 3/3: rename nb_long to nb_reserved ........ r68652 | mark.dickinson | 2009-01-17 10:21:23 +0000 (Sat, 17 Jan 2009) | 2 lines Fix a few more references to long integers in the docs. ........ r68653 | mark.dickinson | 2009-01-17 10:48:28 +0000 (Sat, 17 Jan 2009) | 2 lines Remove attempted long->int conversions in py3k version of float.as_integer_ratio. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/arg.rst python/branches/release30-maint/Doc/c-api/intro.rst python/branches/release30-maint/Doc/c-api/number.rst python/branches/release30-maint/Doc/c-api/typeobj.rst python/branches/release30-maint/Doc/library/math.rst python/branches/release30-maint/Doc/library/reprlib.rst python/branches/release30-maint/Include/object.h python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/datetimemodule.c python/branches/release30-maint/Objects/boolobject.c python/branches/release30-maint/Objects/complexobject.c python/branches/release30-maint/Objects/floatobject.c python/branches/release30-maint/Objects/longobject.c python/branches/release30-maint/Objects/setobject.c python/branches/release30-maint/Objects/typeobject.c python/branches/release30-maint/Objects/weakrefobject.c python/branches/release30-maint/PC/winreg.c Modified: python/branches/release30-maint/Doc/c-api/arg.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/arg.rst (original) +++ python/branches/release30-maint/Doc/c-api/arg.rst Sat Jan 17 19:00:58 2009 @@ -489,11 +489,11 @@ ``H`` (integer) [unsigned short int] Convert a C :ctype:`unsigned short int` to a Python integer object. - ``I`` (integer/long) [unsigned int] - Convert a C :ctype:`unsigned int` to a Python long integer object. + ``I`` (integer) [unsigned int] + Convert a C :ctype:`unsigned int` to a Python integer object. - ``k`` (integer/long) [unsigned long] - Convert a C :ctype:`unsigned long` to a Python long integer object. + ``k`` (integer) [unsigned long] + Convert a C :ctype:`unsigned long` to a Python integer object. ``L`` (long) [PY_LONG_LONG] Convert a C :ctype:`long long` to a Python integer object. Only available 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 Sat Jan 17 19:00:58 2009 @@ -607,7 +607,7 @@ * Sanity checks of the input arguments are added to frame creation. -* The storage for long ints is initialized with a known invalid pattern to catch +* The storage for ints is initialized with a known invalid pattern to catch reference to uninitialized digits. * Low-level tracing and extra exception checking are added to the runtime 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 Sat Jan 17 19:00:58 2009 @@ -252,7 +252,7 @@ .. cfunction:: PyObject* PyNumber_Index(PyObject *o) - Returns the *o* converted to a Python int or long on success or *NULL* with a + Returns the *o* converted to a Python int on success or *NULL* with a :exc:`TypeError` exception raised on failure. @@ -268,7 +268,7 @@ .. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc) Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an - integer. If *o* can be converted to a Python int or long but the attempt to + integer. If *o* can be converted to a Python int but the attempt to convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the *exc* argument is the type of exception that will be raised (usually :exc:`IndexError` or :exc:`OverflowError`). If *exc* is *NULL*, then the 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 Sat Jan 17 19:00:58 2009 @@ -135,7 +135,7 @@ :attr:`ob_size` field, and the instance size is :attr:`tp_basicsize` plus N times :attr:`tp_itemsize`, where N is the "length" of the object. The value of N is typically stored in the instance's :attr:`ob_size` field. There are - exceptions: for example, long ints use a negative :attr:`ob_size` to indicate a + exceptions: for example, ints use a negative :attr:`ob_size` to indicate a negative number, and N is ``abs(ob_size)`` there. Also, the presence of an :attr:`ob_size` field in the instance layout doesn't mean that the instance structure is variable-length (for example, the structure for the list type has @@ -812,7 +812,7 @@ where :attr:`tp_basicsize`, :attr:`tp_itemsize` and :attr:`tp_dictoffset` are taken from the type object, and :attr:`ob_size` is taken from the instance. The - absolute value is taken because long ints use the sign of :attr:`ob_size` to + absolute value is taken because ints use the sign of :attr:`ob_size` to store the sign of the number. (There's never a need to do this calculation yourself; it is done for you by :cfunc:`_PyObject_GetDictPtr`.) @@ -1057,7 +1057,7 @@ binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; - unaryfunc nb_long; + void *nb_reserved; unaryfunc nb_float; binaryfunc nb_inplace_add; @@ -1088,6 +1088,12 @@ ``Py_NotImplemented``, if another error occurred they must return ``NULL`` and set an exception. + .. note:: + + The :cdata:`nb_reserved` field should always be ``NULL``. It + was previously called :cdata:`nb_long`, and was renamed in + Python 3.0.1. + .. _mapping-structs: 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 Sat Jan 17 19:00:58 2009 @@ -118,7 +118,7 @@ .. function:: trunc(x) Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually - a long integer). Delegates to ``x.__trunc__()``. + an integer). Delegates to ``x.__trunc__()``. Note that :func:`frexp` and :func:`modf` have a different call/return pattern Modified: python/branches/release30-maint/Doc/library/reprlib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/reprlib.rst (original) +++ python/branches/release30-maint/Doc/library/reprlib.rst Sat Jan 17 19:00:58 2009 @@ -65,7 +65,7 @@ .. attribute:: Repr.maxlong - Maximum number of characters in the representation for a long integer. Digits + Maximum number of characters in the representation for an integer. Digits are dropped from the middle. The default is ``40``. Modified: python/branches/release30-maint/Include/object.h ============================================================================== --- python/branches/release30-maint/Include/object.h (original) +++ python/branches/release30-maint/Include/object.h Sat Jan 17 19:00:58 2009 @@ -219,7 +219,7 @@ binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; - unaryfunc nb_long; + void *nb_reserved; /* the slot formerly known as nb_long */ unaryfunc nb_float; binaryfunc nb_inplace_add; Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 17 19:00:58 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4910: Rename nb_long slot to nb_reserved, and change its + type to (void *). + - 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/release30-maint/Modules/datetimemodule.c ============================================================================== --- python/branches/release30-maint/Modules/datetimemodule.c (original) +++ python/branches/release30-maint/Modules/datetimemodule.c Sat Jan 17 19:00:58 2009 @@ -2111,7 +2111,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ Modified: python/branches/release30-maint/Objects/boolobject.c ============================================================================== --- python/branches/release30-maint/Objects/boolobject.c (original) +++ python/branches/release30-maint/Objects/boolobject.c Sat Jan 17 19:00:58 2009 @@ -109,7 +109,7 @@ bool_xor, /* nb_xor */ bool_or, /* nb_or */ 0, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ 0, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/complexobject.c ============================================================================== --- python/branches/release30-maint/Objects/complexobject.c (original) +++ python/branches/release30-maint/Objects/complexobject.c Sat Jan 17 19:00:58 2009 @@ -1060,7 +1060,7 @@ 0, /* nb_xor */ 0, /* nb_or */ complex_int, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ complex_float, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/floatobject.c ============================================================================== --- python/branches/release30-maint/Objects/floatobject.c (original) +++ python/branches/release30-maint/Objects/floatobject.c Sat Jan 17 19:00:58 2009 @@ -1495,12 +1495,6 @@ py_exponent = NULL; } - /* Returns ints instead of longs where possible */ - INPLACE_UPDATE(numerator, PyNumber_Int(numerator)); - if (numerator == NULL) goto error; - INPLACE_UPDATE(denominator, PyNumber_Int(denominator)); - if (denominator == NULL) goto error; - result_pair = PyTuple_Pack(2, numerator, denominator); #undef INPLACE_UPDATE @@ -1798,7 +1792,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ float_trunc, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ float_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Sat Jan 17 19:00:58 2009 @@ -3759,7 +3759,7 @@ long_xor, /*nb_xor*/ long_or, /*nb_or*/ long_long, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ long_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/release30-maint/Objects/setobject.c ============================================================================== --- python/branches/release30-maint/Objects/setobject.c (original) +++ python/branches/release30-maint/Objects/setobject.c Sat Jan 17 19:00:58 2009 @@ -2082,7 +2082,7 @@ (binaryfunc)set_xor, /*nb_xor*/ (binaryfunc)set_or, /*nb_or*/ 0, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ (binaryfunc)set_isub, /*nb_inplace_subtract*/ Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sat Jan 17 19:00:58 2009 @@ -3602,7 +3602,6 @@ COPYNUM(nb_xor); COPYNUM(nb_or); COPYNUM(nb_int); - COPYNUM(nb_long); COPYNUM(nb_float); COPYNUM(nb_inplace_add); COPYNUM(nb_inplace_subtract); @@ -4827,7 +4826,6 @@ SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__") SLOT0(slot_nb_int, "__int__") -SLOT0(slot_nb_long, "__long__") SLOT0(slot_nb_float, "__float__") SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O") SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O") @@ -5443,8 +5441,6 @@ RBINSLOT("__ror__", nb_or, slot_nb_or, "|"), UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc, "int(x)"), - UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc, - "int(x)"), UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc, "float(x)"), NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, Modified: python/branches/release30-maint/Objects/weakrefobject.c ============================================================================== --- python/branches/release30-maint/Objects/weakrefobject.c (original) +++ python/branches/release30-maint/Objects/weakrefobject.c Sat Jan 17 19:00:58 2009 @@ -594,7 +594,7 @@ proxy_xor, /*nb_xor*/ proxy_or, /*nb_or*/ proxy_int, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ proxy_float, /*nb_float*/ proxy_iadd, /*nb_inplace_add*/ proxy_isub, /*nb_inplace_subtract*/ Modified: python/branches/release30-maint/PC/winreg.c ============================================================================== --- python/branches/release30-maint/PC/winreg.c (original) +++ python/branches/release30-maint/PC/winreg.c Sat Jan 17 19:00:58 2009 @@ -451,7 +451,7 @@ PyHKEY_binaryFailureFunc, /* nb_xor */ PyHKEY_binaryFailureFunc, /* nb_or */ PyHKEY_intFunc, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ PyHKEY_unaryFailureFunc, /* nb_float */ }; From buildbot at python.org Sat Jan 17 19:08:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 18:08:25 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090117180825.A91EE1E4002@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/132 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 19:10:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 18:10:27 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090117181027.5328F1E4002@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/108 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 19:14:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 18:14:22 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090117181422.DCF541E400C@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/126 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/pybot/buildarea64/3.x.klose-debian-ppc64/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 20:39:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 19:39:45 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090117193945.F0AF91E4002@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/58 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 20:44:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 19:44:07 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090117194407.D7DA91E4002@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/62 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 17 20:56:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 19:56:47 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20090117195647.B2FE51E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.0/builds/58 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 21:19:00 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 21:19:00 +0100 (CET) Subject: [Python-checkins] r68667 - in python/trunk: Modules/_ctypes/libffi_msvc/ffi.c Objects/exceptions.c Python/ast.c Python/compile.c Message-ID: <20090117201900.8B06E1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 21:18:59 2009 New Revision: 68667 Log: #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.c python/trunk/Objects/exceptions.c python/trunk/Python/ast.c python/trunk/Python/compile.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 Sat Jan 17 21:18:59 2009 @@ -34,7 +34,7 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -extern void Py_FatalError(char *msg); +extern void Py_FatalError(const char *msg); /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) Modified: python/trunk/Objects/exceptions.c ============================================================================== --- python/trunk/Objects/exceptions.c (original) +++ python/trunk/Objects/exceptions.c Sat Jan 17 21:18:59 2009 @@ -2127,7 +2127,7 @@ PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) - Py_FatalError("Cannot pre-allocate MemoryError instance\n"); + Py_FatalError("Cannot pre-allocate MemoryError instance"); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) Modified: python/trunk/Python/ast.c ============================================================================== --- python/trunk/Python/ast.c (original) +++ python/trunk/Python/ast.c Sat Jan 17 21:18:59 2009 @@ -197,7 +197,7 @@ default: { char buf[128]; - sprintf(buf, "Non-statement found: %d %d\n", + sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Sat Jan 17 21:18:59 2009 @@ -1254,7 +1254,7 @@ char buf[350]; PyOS_snprintf(buf, sizeof(buf), "unknown scope for %.100s in %.100s(%s) in %s\n" - "symbols: %s\nlocals: %s\nglobals: %s\n", + "symbols: %s\nlocals: %s\nglobals: %s", PyString_AS_STRING(name), PyString_AS_STRING(c->u->u_name), PyObject_REPR(c->u->u_ste->ste_id), From buildbot at python.org Sat Jan 17 21:24:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 20:24:24 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090117202424.2E4881E4002@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/55 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_robotparser test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 21:59:16 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 21:59:16 +0100 (CET) Subject: [Python-checkins] r68668 - in sandbox/trunk/io-c: _textio.c test_io.py Message-ID: <20090117205916.73EC01E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 21:59:16 2009 New Revision: 68668 Log: Be sure the encoding attribute on TextIOWrapper objects is always non-NULL Modified: sandbox/trunk/io-c/_textio.c sandbox/trunk/io-c/test_io.py Modified: sandbox/trunk/io-c/_textio.c ============================================================================== --- sandbox/trunk/io-c/_textio.c (original) +++ sandbox/trunk/io-c/_textio.c Sat Jan 17 21:59:16 2009 @@ -629,19 +629,26 @@ if (encoding == NULL) { /* Try os.device_encoding(fileno) */ - PyObject *os = PyImport_ImportModule("os"); - if (os == NULL) - goto error; - self->encoding = PyObject_CallMethod( - os, "device_encoding", "N", - PyObject_CallMethod(buffer, "fileno", NULL)); - Py_DECREF(os); + PyObject *fileno, *os;; + fileno = PyObject_CallMethod(buffer, "fileno", NULL); /* Ignore any error */ /* XXX only AttributeError and UnsupportedOperation */ - if (self->encoding == NULL) + if (fileno == NULL) PyErr_Clear(); - else if (!PyUnicode_Check(self->encoding)) - Py_CLEAR(self->encoding); + else { + os = PyImport_ImportModule("os"); + if (os == NULL) { + Py_DECREF(fileno); + goto error; + } + self->encoding = PyObject_CallMethod(os, "device_encoding", + "N", fileno); + Py_DECREF(os); + if (self->encoding == NULL) + goto error; + else if (!PyUnicode_Check(self->encoding)) + Py_CLEAR(self->encoding); + } } if (encoding == NULL && self->encoding == NULL) { /* try locale.getpreferredencoding() */ @@ -662,6 +669,15 @@ } if (self->encoding != NULL) encoding = _PyUnicode_AsString(self->encoding); + else if (encoding != NULL) { + self->encoding = PyUnicode_FromString(encoding); + if (self->encoding == NULL) + goto error; + } + else { + PyErr_SetString(PyExc_IOError, + "could not determine default encoding"); + } if (errors == NULL) errors = "strict"; Modified: sandbox/trunk/io-c/test_io.py ============================================================================== --- sandbox/trunk/io-c/test_io.py (original) +++ sandbox/trunk/io-c/test_io.py Sat Jan 17 21:59:16 2009 @@ -1196,6 +1196,15 @@ t.write("A\rB") self.assertEquals(r.getvalue(), b"XY\nZA\rB") + def testEncoding(self): + # Check the encoding attribute is always set, and valid + b = io.BytesIO() + t = io.TextIOWrapper(b, encoding="utf8") + self.assertEqual(t.encoding, "utf8") + t = io.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") From python-checkins at python.org Sat Jan 17 22:06:43 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 22:06:43 +0100 (CET) Subject: [Python-checkins] r68669 - in python/branches/py3k: Misc/NEWS Objects/moduleobject.c Message-ID: <20090117210643.376EA1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 22:06:43 2009 New Revision: 68669 Log: Issue #4838: When a module is deallocated, free the memory backing the optional module state data. Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/moduleobject.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 17 22:06:43 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4838: When a module is deallocated, free the memory backing the + optional module state data. + - Issue #4910: Rename nb_long slot to nb_reserved, and change its type to (void *). Modified: python/branches/py3k/Objects/moduleobject.c ============================================================================== --- python/branches/py3k/Objects/moduleobject.c (original) +++ python/branches/py3k/Objects/moduleobject.c Sat Jan 17 22:06:43 2009 @@ -315,6 +315,8 @@ _PyModule_Clear((PyObject *)m); Py_DECREF(m->md_dict); } + if (m->md_state != NULL) + PyMem_FREE(m->md_state); Py_TYPE(m)->tp_free((PyObject *)m); } From nnorwitz at gmail.com Sat Jan 17 22:08:29 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 17 Jan 2009 16:08:29 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090117210829.GA19113@python.psfb.org> 328 tests OK. 1 test failed: test_zipfile 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [17675 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_zipfile failed -- errors occurred; run in verbose mode for details 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 328 tests OK. 1 test failed: test_zipfile 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657835 refs] From nnorwitz at gmail.com Sat Jan 17 22:15:38 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 17 Jan 2009 16:15:38 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090117211538.GA30070@python.psfb.org> 328 tests OK. 1 test failed: test_zipfile 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [22225 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17721 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16830 refs] [16646 refs] [16646 refs] [16646 refs] [16646 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_zipfile failed -- errors occurred; run in verbose mode for details 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 328 tests OK. 1 test failed: test_zipfile 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [657103 refs] From python-checkins at python.org Sat Jan 17 22:40:04 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 22:40:04 +0100 (CET) Subject: [Python-checkins] r68672 - in python/branches/release30-maint: Misc/NEWS Objects/moduleobject.c Message-ID: <20090117214004.B1B6C1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 22:40:04 2009 New Revision: 68672 Log: Merged revisions 68669 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68669 | antoine.pitrou | 2009-01-17 22:06:43 +0100 (sam., 17 janv. 2009) | 3 lines Issue #4838: When a module is deallocated, free the memory backing the optional module state data. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/moduleobject.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 17 22:40:04 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4838: When a module is deallocated, free the memory backing the + optional module state data. + - Issue #4910: Rename nb_long slot to nb_reserved, and change its type to (void *). Modified: python/branches/release30-maint/Objects/moduleobject.c ============================================================================== --- python/branches/release30-maint/Objects/moduleobject.c (original) +++ python/branches/release30-maint/Objects/moduleobject.c Sat Jan 17 22:40:04 2009 @@ -315,6 +315,8 @@ _PyModule_Clear((PyObject *)m); Py_DECREF(m->md_dict); } + if (m->md_state != NULL) + PyMem_FREE(m->md_state); Py_TYPE(m)->tp_free((PyObject *)m); } From python-checkins at python.org Sat Jan 17 22:41:56 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 22:41:56 +0100 (CET) Subject: [Python-checkins] r68673 - sandbox/trunk/io-c/_fileio.c Message-ID: <20090117214156.4B37E1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 22:41:56 2009 New Revision: 68673 Log: Backport some FileIO changes, and fix its name and repr Modified: sandbox/trunk/io-c/_fileio.c Modified: sandbox/trunk/io-c/_fileio.c ============================================================================== --- sandbox/trunk/io-c/_fileio.c (original) +++ sandbox/trunk/io-c/_fileio.c Sat Jan 17 22:41:56 2009 @@ -57,20 +57,27 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) -/* Returns 0 on success, errno (which is < 0) on failure. */ +/* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) { - int save_errno = 0; + int err = 0; + int save_errno; if (self->fd >= 0) { int fd = self->fd; self->fd = -1; Py_BEGIN_ALLOW_THREADS - if (close(fd) < 0) + err = close(fd); + if (err < 0) save_errno = errno; Py_END_ALLOW_THREADS } - return save_errno; + if (err < 0) { + errno = save_errno; + PyErr_SetFromErrno(PyExc_IOError); + return -1; + } + return 0; } static PyObject * @@ -115,7 +122,7 @@ directories, so we need a check. */ static int -dircheck(PyFileIOObject* self) +dircheck(PyFileIOObject* self, const char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -124,10 +131,11 @@ if (fstat(self->fd, &buf) == 0 && S_ISDIR(buf.st_mode)) { char *msg = strerror(EISDIR); PyObject *exc; - internal_close(self); + if (internal_close(self)) + return -1; - exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + exc = PyObject_CallFunction(PyExc_IOError, "(iss)", + EISDIR, msg, name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return -1; @@ -301,13 +309,14 @@ Py_END_ALLOW_THREADS if (self->fd < 0) { #ifdef MS_WINDOWS - PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); -#else - PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + if (widename != NULL) + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); + else #endif + PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto error; } - if(dircheck(self) < 0) + if(dircheck(self, name) < 0) goto error; } @@ -330,11 +339,8 @@ PyObject_ClearWeakRefs((PyObject *) self); if (self->fd >= 0 && self->closefd) { - errno = internal_close(self); - if (errno < 0) { - PySys_WriteStderr("close failed: [Errno %d] %s\n", - errno, strerror(errno)); - } + if(internal_close(self)) + PyErr_WriteUnraisable((PyObject*)self); } Py_CLEAR(self->dict); @@ -754,9 +760,9 @@ fileio_repr(PyFileIOObject *self) { if (self->fd < 0) - return PyUnicode_FromFormat("_fileio._FileIO(-1)"); + return PyUnicode_FromFormat("io.FileIO(-1)"); - return PyUnicode_FromFormat("_fileio._FileIO(%d, '%s')", + return PyUnicode_FromFormat("io.FileIO(%d, '%s')", self->fd, mode_string(self)); } @@ -899,7 +905,7 @@ PyTypeObject PyFileIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "_FileIO", + "FileIO", sizeof(PyFileIOObject), 0, (destructor)fileio_dealloc, /* tp_dealloc */ From python-checkins at python.org Sat Jan 17 22:57:08 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 22:57:08 +0100 (CET) Subject: [Python-checkins] r68674 - sandbox/trunk/io-c/_bytesio.c Message-ID: <20090117215708.BE5671E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 22:57:08 2009 New Revision: 68674 Log: Backport some changes to BytesIO Modified: sandbox/trunk/io-c/_bytesio.c Modified: sandbox/trunk/io-c/_bytesio.c ============================================================================== --- sandbox/trunk/io-c/_bytesio.c (original) +++ sandbox/trunk/io-c/_bytesio.c Sat Jan 17 22:57:08 2009 @@ -225,6 +225,8 @@ if (PyLong_Check(arg)) { size = PyLong_AsSsize_t(arg); + if (size == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* Read until EOF is reached, by default. */ @@ -292,6 +294,8 @@ if (PyLong_Check(arg)) { size = PyLong_AsSsize_t(arg); + if (size == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* No size limit, by default. */ @@ -336,6 +340,8 @@ if (PyLong_Check(arg)) { maxsize = PyLong_AsSsize_t(arg); + if (maxsize == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* No size limit, by default. */ @@ -419,6 +425,8 @@ if (PyLong_Check(arg)) { size = PyLong_AsSsize_t(arg); + if (size == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* Truncate to current position if no argument is passed. */ From python-checkins at python.org Sat Jan 17 22:57:11 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 17 Jan 2009 22:57:11 +0100 (CET) Subject: [Python-checkins] r68675 - in python/branches/py3k: Modules/_struct.c Modules/grpmodule.c Modules/selectmodule.c Objects/weakrefobject.c Message-ID: <20090117215711.E54001E4011@bag.python.org> Author: mark.dickinson Date: Sat Jan 17 22:57:11 2009 New Revision: 68675 Log: Replace PyNumber_Int with PyNumber_Long. Modified: python/branches/py3k/Modules/_struct.c python/branches/py3k/Modules/grpmodule.c python/branches/py3k/Modules/selectmodule.c python/branches/py3k/Objects/weakrefobject.c Modified: python/branches/py3k/Modules/_struct.c ============================================================================== --- python/branches/py3k/Modules/_struct.c (original) +++ python/branches/py3k/Modules/_struct.c Sat Jan 17 22:57:11 2009 @@ -155,7 +155,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_long(o, p); @@ -260,7 +260,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_wrapped_long(o, p); @@ -299,7 +299,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_wrapped_ulong(o, p); Modified: python/branches/py3k/Modules/grpmodule.c ============================================================================== --- python/branches/py3k/Modules/grpmodule.c (original) +++ python/branches/py3k/Modules/grpmodule.c Sat Jan 17 22:57:11 2009 @@ -90,7 +90,7 @@ unsigned int gid; struct group *p; - py_int_id = PyNumber_Int(pyo_id); + py_int_id = PyNumber_Long(pyo_id); if (!py_int_id) return NULL; gid = PyLong_AS_LONG(py_int_id); Modified: python/branches/py3k/Modules/selectmodule.c ============================================================================== --- python/branches/py3k/Modules/selectmodule.c (original) +++ python/branches/py3k/Modules/selectmodule.c Sat Jan 17 22:57:11 2009 @@ -515,7 +515,7 @@ return NULL; } else { - tout = PyNumber_Int(tout); + tout = PyNumber_Long(tout); if (!tout) return NULL; timeout = PyLong_AsLong(tout); Modified: python/branches/py3k/Objects/weakrefobject.c ============================================================================== --- python/branches/py3k/Objects/weakrefobject.c (original) +++ python/branches/py3k/Objects/weakrefobject.c Sat Jan 17 22:57:11 2009 @@ -488,7 +488,7 @@ WRAP_BINARY(proxy_and, PyNumber_And) WRAP_BINARY(proxy_xor, PyNumber_Xor) WRAP_BINARY(proxy_or, PyNumber_Or) -WRAP_UNARY(proxy_int, PyNumber_Int) +WRAP_UNARY(proxy_int, PyNumber_Long) WRAP_UNARY(proxy_float, PyNumber_Float) WRAP_BINARY(proxy_iadd, PyNumber_InPlaceAdd) WRAP_BINARY(proxy_isub, PyNumber_InPlaceSubtract) From python-checkins at python.org Sat Jan 17 23:27:54 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 17 Jan 2009 23:27:54 +0100 (CET) Subject: [Python-checkins] r68676 - in python/trunk: Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS Message-ID: <20090117222754.93E911E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 17 23:27:54 2009 New Revision: 68676 Log: fix inspect.isclass() on instances with a custom __getattr__ #1225107 Modified: python/trunk/Lib/inspect.py python/trunk/Lib/test/test_inspect.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/inspect.py ============================================================================== --- python/trunk/Lib/inspect.py (original) +++ python/trunk/Lib/inspect.py Sat Jan 17 23:27:54 2009 @@ -62,7 +62,7 @@ Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" - return isinstance(object, types.ClassType) or hasattr(object, '__bases__') + return isinstance(object, (type, types.ClassType)) def ismethod(object): """Return true if the object is an instance method. Modified: python/trunk/Lib/test/test_inspect.py ============================================================================== --- python/trunk/Lib/test/test_inspect.py (original) +++ python/trunk/Lib/test/test_inspect.py Sat Jan 17 23:27:54 2009 @@ -65,7 +65,6 @@ def test_excluding_predicates(self): self.istest(inspect.isbuiltin, 'sys.exit') self.istest(inspect.isbuiltin, '[].append') - self.istest(inspect.isclass, 'mod.StupidGit') self.istest(inspect.iscode, 'mod.spam.func_code') self.istest(inspect.isframe, 'tb.tb_frame') self.istest(inspect.isfunction, 'mod.spam') @@ -91,6 +90,18 @@ self.assert_(inspect.isroutine(mod.spam)) self.assert_(inspect.isroutine([].count)) + def test_isclass(self): + self.istest(inspect.isclass, 'mod.StupidGit') + self.assertTrue(inspect.isclass(list)) + + class newstyle(object): pass + self.assertTrue(inspect.isclass(newstyle)) + + class CustomGetattr(object): + def __getattr__(self, attr): + return None + self.assertFalse(inspect.isclass(CustomGetattr())) + def test_get_slot_members(self): class C(object): __slots__ = ("a", "b") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 17 23:27:54 2009 @@ -137,6 +137,9 @@ Library ------- +- Issue #1225107: inspect.isclass() returned True for instances with a custom + __getattr__. + - Issue #3997: zipfiles generated with more than 65536 files could not be opened with other applications. From python-checkins at python.org Sat Jan 17 23:41:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 17 Jan 2009 23:41:19 +0100 (CET) Subject: [Python-checkins] r68677 - in python/branches/py3k: Lib/inspect.py Lib/test/test_inspect.py Message-ID: <20090117224119.88B621E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 17 23:41:18 2009 New Revision: 68677 Log: Merged revisions 68676 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68676 | benjamin.peterson | 2009-01-17 16:27:54 -0600 (Sat, 17 Jan 2009) | 1 line fix inspect.isclass() on instances with a custom __getattr__ #1225107 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/inspect.py python/branches/py3k/Lib/test/test_inspect.py Modified: python/branches/py3k/Lib/inspect.py ============================================================================== --- python/branches/py3k/Lib/inspect.py (original) +++ python/branches/py3k/Lib/inspect.py Sat Jan 17 23:41:18 2009 @@ -63,7 +63,7 @@ Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" - return isinstance(object, type) or hasattr(object, '__bases__') + return isinstance(object, type) def ismethod(object): """Return true if the object is an instance method. Modified: python/branches/py3k/Lib/test/test_inspect.py ============================================================================== --- python/branches/py3k/Lib/test/test_inspect.py (original) +++ python/branches/py3k/Lib/test/test_inspect.py Sat Jan 17 23:41:18 2009 @@ -74,7 +74,6 @@ def test_excluding_predicates(self): self.istest(inspect.isbuiltin, 'sys.exit') self.istest(inspect.isbuiltin, '[].append') - self.istest(inspect.isclass, 'mod.StupidGit') self.istest(inspect.iscode, 'mod.spam.__code__') self.istest(inspect.isframe, 'tb.tb_frame') self.istest(inspect.isfunction, 'mod.spam') @@ -99,6 +98,15 @@ self.assert_(inspect.isroutine(mod.spam)) self.assert_(inspect.isroutine([].count)) + def test_isclass(self): + self.istest(inspect.isclass, 'mod.StupidGit') + self.assertTrue(inspect.isclass(list)) + + class CustomGetattr(object): + def __getattr__(self, attr): + return None + self.assertFalse(inspect.isclass(CustomGetattr())) + def test_get_slot_members(self): class C(object): __slots__ = ("a", "b") From buildbot at python.org Sat Jan 17 23:41:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 22:41:57 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090117224158.23DAE1E4002@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/25 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: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 708, in __init__ self._GetContents() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 728, in _GetContents self._RealGetContents() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/zipfile.py", line 765, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 17 23:43:51 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sat, 17 Jan 2009 23:43:51 +0100 (CET) Subject: [Python-checkins] r68678 - python/trunk/Lib/zipfile.py Message-ID: <20090117224351.983E21E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sat Jan 17 23:43:50 2009 New Revision: 68678 Log: follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format, always try to read the "zip64 end of directory structure". Modified: python/trunk/Lib/zipfile.py Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Sat Jan 17 23:43:50 2009 @@ -208,13 +208,9 @@ # Append a blank comment and record start offset endrec.append("") endrec.append(filesize - sizeEndCentDir) - if endrec[_ECD_OFFSET] == 0xffffffff: - # the value for the "offset of the start of the central directory" - # indicates that there is a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, -sizeEndCentDir, endrec) - return endrec + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, -sizeEndCentDir, endrec) # Either this is not a ZIP file, or it is a ZIP file with an archive # comment. Search the end of the file for the "end of central directory" @@ -235,11 +231,10 @@ # Append the archive comment and start offset endrec.append(comment) endrec.append(maxCommentStart + start) - if endrec[_ECD_OFFSET] == 0xffffffff: - # There is apparently a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, start - filesize, endrec) - return endrec + + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, maxCommentStart + start - filesize, + endrec) # Unable to find a valid end of central directory structure return From python-checkins at python.org Sat Jan 17 23:47:52 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 17 Jan 2009 23:47:52 +0100 (CET) Subject: [Python-checkins] r68679 - python/branches/io-c Message-ID: <20090117224752.6C9051E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 17 23:47:52 2009 New Revision: 68679 Log: Now that we can fully bootstrap it, create a branch for the IO-in-C py3k interpreter Added: python/branches/io-c/ - copied from r68678, /python/branches/py3k/ From python-checkins at python.org Sun Jan 18 00:00:55 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:00:55 +0100 (CET) Subject: [Python-checkins] r68680 - python/branches/io-c Message-ID: <20090117230055.5B9091E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:00:54 2009 New Revision: 68680 Log: Initialized merge tracking via "svnmerge" with revisions "1-68678" from svn+ssh://pythondev at svn.python.org/python/branches/py3k Modified: python/branches/io-c/ (props changed) From python-checkins at python.org Sun Jan 18 00:01:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 00:01:43 +0100 (CET) Subject: [Python-checkins] r68681 - in python/branches/release30-maint: Lib/inspect.py Lib/test/test_inspect.py Message-ID: <20090117230143.D08891E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 00:01:43 2009 New Revision: 68681 Log: Merged revisions 68677 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68677 | benjamin.peterson | 2009-01-17 16:41:18 -0600 (Sat, 17 Jan 2009) | 9 lines Merged revisions 68676 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68676 | benjamin.peterson | 2009-01-17 16:27:54 -0600 (Sat, 17 Jan 2009) | 1 line fix inspect.isclass() on instances with a custom __getattr__ #1225107 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/inspect.py python/branches/release30-maint/Lib/test/test_inspect.py Modified: python/branches/release30-maint/Lib/inspect.py ============================================================================== --- python/branches/release30-maint/Lib/inspect.py (original) +++ python/branches/release30-maint/Lib/inspect.py Sun Jan 18 00:01:43 2009 @@ -63,7 +63,7 @@ Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" - return isinstance(object, type) or hasattr(object, '__bases__') + return isinstance(object, type) def ismethod(object): """Return true if the object is an instance method. Modified: python/branches/release30-maint/Lib/test/test_inspect.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_inspect.py (original) +++ python/branches/release30-maint/Lib/test/test_inspect.py Sun Jan 18 00:01:43 2009 @@ -74,7 +74,6 @@ def test_excluding_predicates(self): self.istest(inspect.isbuiltin, 'sys.exit') self.istest(inspect.isbuiltin, '[].append') - self.istest(inspect.isclass, 'mod.StupidGit') self.istest(inspect.iscode, 'mod.spam.__code__') self.istest(inspect.isframe, 'tb.tb_frame') self.istest(inspect.isfunction, 'mod.spam') @@ -99,6 +98,15 @@ self.assert_(inspect.isroutine(mod.spam)) self.assert_(inspect.isroutine([].count)) + def test_isclass(self): + self.istest(inspect.isclass, 'mod.StupidGit') + self.assertTrue(inspect.isclass(list)) + + class CustomGetattr(object): + def __getattr__(self, attr): + return None + self.assertFalse(inspect.isclass(CustomGetattr())) + def test_get_slot_members(self): class C(object): __slots__ = ("a", "b") From python-checkins at python.org Sun Jan 18 00:03:06 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:03:06 +0100 (CET) Subject: [Python-checkins] r68682 - python/branches/io-c Message-ID: <20090117230306.43F0F1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:03:05 2009 New Revision: 68682 Log: Removed merge tracking for "svnmerge" for svn+ssh://pythondev at svn.python.org/python/trunk Modified: python/branches/io-c/ (props changed) From python-checkins at python.org Sun Jan 18 00:13:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:13:50 +0100 (CET) Subject: [Python-checkins] r68683 - in python/branches/io-c: Lib/io.py Modules/Setup.dist Modules/_bufferedio.c Modules/_bytesio.c Modules/_fileio.c Modules/_iobase.c Modules/_iomodule.h Modules/_textio.c Modules/io.c setup.py Message-ID: <20090117231350.9ECA11E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:13:48 2009 New Revision: 68683 Log: Merge in changes from the io-c sandbox. Tests will follow in separate commits. Added: python/branches/io-c/Modules/_bufferedio.c (contents, props changed) python/branches/io-c/Modules/_iobase.c (contents, props changed) python/branches/io-c/Modules/_iomodule.h (contents, props changed) python/branches/io-c/Modules/_textio.c (contents, props changed) python/branches/io-c/Modules/io.c (contents, props changed) Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Modules/Setup.dist python/branches/io-c/Modules/_bytesio.c python/branches/io-c/Modules/_fileio.c python/branches/io-c/setup.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 Jan 18 00:13:48 2009 @@ -58,7 +58,7 @@ import os import abc import codecs -import _fileio +#import _fileio # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock @@ -70,7 +70,7 @@ DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes -class BlockingIOError(IOError): +class unused_BlockingIOError(IOError): """Exception raised when I/O would block on a non-blocking I/O stream.""" @@ -79,7 +79,7 @@ self.characters_written = characters_written -def open(file, mode="r", buffering=None, encoding=None, errors=None, +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. @@ -254,8 +254,12 @@ 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 _DocDescriptor: +class unused_DocDescriptor: """Helper for builtins.open.__doc__ """ def __get__(self, obj, typ): @@ -264,7 +268,7 @@ "errors=None, newline=None, closefd=True)\n\n" + open.__doc__) -class OpenWrapper: +class unused_OpenWrapper: """Wrapper for builtins.open Trick so that open won't become a bound method when stored @@ -272,17 +276,18 @@ See initstdio() in Python/pythonrun.c. """ - __doc__ = _DocDescriptor() + __doc__ = unused_DocDescriptor() def __new__(cls, *args, **kwargs): return open(*args, **kwargs) +OpenWrapper = _io.open -class UnsupportedOperation(ValueError, IOError): +class unused_UnsupportedOperation(ValueError, IOError): pass -class IOBase(metaclass=abc.ABCMeta): +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. @@ -340,7 +345,6 @@ def tell(self) -> int: """Return current stream position.""" - self._checkClosed() return self.seek(0, 1) def truncate(self, pos: int = None) -> int: @@ -359,8 +363,6 @@ This is not implemented for read-only and non-blocking streams. """ # XXX Should this return the number of bytes written??? - if self.__closed: - raise ValueError("I/O operation on closed file.") __closed = False @@ -533,7 +535,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 @@ -549,9 +550,10 @@ self._checkClosed() for line in lines: self.write(line) +IOBase = _io.IOBase -class RawIOBase(IOBase): +class unused_RawIOBase(IOBase): """Base class for raw binary I/O.""" @@ -571,7 +573,6 @@ Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read. """ - self._checkClosed() if n is None: n = -1 if n < 0: @@ -583,7 +584,6 @@ def readall(self): """Read until EOF, using multiple read() call.""" - self._checkClosed() res = bytearray() while True: data = self.read(DEFAULT_BUFFER_SIZE) @@ -606,31 +606,35 @@ Returns the number of bytes written, which may be less than len(b). """ self._unsupported("write") +RawIOBase = _io.RawIOBase -class FileIO(_fileio._FileIO, RawIOBase): +if 0: + class unused_FileIO(_fileio._FileIO, RawIOBase): - """Raw I/O implementation for OS files.""" + """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 + # 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 close(self): - _fileio._FileIO.close(self) - RawIOBase.close(self) + def __init__(self, name, mode="r", closefd=True): + _fileio._FileIO.__init__(self, name, mode, closefd) + self._name = name - @property - def name(self): - return self._name + def close(self): + _fileio._FileIO.close(self) + RawIOBase.close(self) + + @property + def name(self): + return self._name + +FileIO = _io.FileIO -class BufferedIOBase(IOBase): +class unused_BufferedIOBase(IOBase): """Base class for buffered IO objects. @@ -679,7 +683,6 @@ data at the moment. """ # XXX This ought to work with anything that supports the buffer API - self._checkClosed() data = self.read(len(b)) n = len(data) try: @@ -701,9 +704,10 @@ underlying raw stream cannot accept more data at the moment. """ self._unsupported("write") +BufferedIOBase = _io.BufferedIOBase -class _BufferedIOMixin(BufferedIOBase): +class unused_BufferedIOMixin(BufferedIOBase): """A mixin implementation of BufferedIOBase with an underlying raw stream. @@ -780,7 +784,7 @@ return self.raw.isatty() -class _BytesIO(BufferedIOBase): +class unused_BytesIO(BufferedIOBase): """Buffered I/O implementation using an in-memory bytes buffer.""" @@ -794,11 +798,13 @@ def getvalue(self): """Return the bytes value (contents) of the buffer """ - self._checkClosed() + if self.closed: + raise ValueError("getvalue on closed file") return bytes(self._buffer) def read(self, n=None): - self._checkClosed() + if self.closed: + raise ValueError("read from closed file") if n is None: n = -1 if n < 0: @@ -816,7 +822,8 @@ return self.read(n) def write(self, b): - self._checkClosed() + 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) @@ -833,7 +840,8 @@ return n def seek(self, pos, whence=0): - self._checkClosed() + if self.closed: + raise ValueError("seek on closed file") try: pos = pos.__index__() except AttributeError as err: @@ -851,11 +859,13 @@ return self._pos def tell(self): - self._checkClosed() + if self.closed: + raise ValueError("tell on closed file") return self._pos def truncate(self, pos=None): - self._checkClosed() + if self.closed: + raise ValueError("truncate on closed file") if pos is None: pos = self._pos elif pos < 0: @@ -873,17 +883,19 @@ return True # Use the faster implementation of BytesIO if available -try: - import _bytesio +if 0: + try: + import _bytesio - class BytesIO(_bytesio._BytesIO, BufferedIOBase): - __doc__ = _bytesio._BytesIO.__doc__ + class BytesIO(_bytesio._BytesIO, BufferedIOBase): + __doc__ = _bytesio._BytesIO.__doc__ -except ImportError: - BytesIO = _BytesIO + except ImportError: + BytesIO = _BytesIO +BytesIO = _io.BytesIO -class BufferedReader(_BufferedIOMixin): +class unused_BufferedReader(unused_BufferedIOMixin): """BufferedReader(raw[, buffer_size]) @@ -915,7 +927,6 @@ mode. If n is negative, read until EOF or until read() would block. """ - self._checkClosed() with self._read_lock: return self._read_unlocked(n) @@ -972,7 +983,6 @@ do at most one raw read to satisfy it. We never return more than self.buffer_size. """ - self._checkClosed() with self._read_lock: return self._peek_unlocked(n) @@ -991,7 +1001,6 @@ """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. - self._checkClosed() if n <= 0: return b"" with self._read_lock: @@ -1000,20 +1009,19 @@ min(n, len(self._read_buf) - self._read_pos)) def tell(self): - self._checkClosed() return self.raw.tell() - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): - self._checkClosed() 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 +BufferedReader = _io.BufferedReader -class BufferedWriter(_BufferedIOMixin): +class unused_BufferedWriter(unused_BufferedIOMixin): """A buffer for a writeable sequential RawIO object. @@ -1035,7 +1043,8 @@ self._write_lock = Lock() def write(self, b): - self._checkClosed() + 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: @@ -1065,7 +1074,6 @@ return written def truncate(self, pos=None): - self._checkClosed() with self._write_lock: self._flush_unlocked() if pos is None: @@ -1073,11 +1081,12 @@ return self.raw.truncate(pos) def flush(self): - self._checkClosed() 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: @@ -1091,17 +1100,16 @@ raise BlockingIOError(e.errno, e.strerror, written) def tell(self): - self._checkClosed() return self.raw.tell() + len(self._write_buf) def seek(self, pos, whence=0): - self._checkClosed() with self._write_lock: self._flush_unlocked() return self.raw.seek(pos, whence) +BufferedWriter = _io.BufferedWriter -class BufferedRWPair(BufferedIOBase): +class unused_BufferedRWPair(BufferedIOBase): """A buffered reader and writer object together. @@ -1164,10 +1172,10 @@ @property def closed(self): - return self.writer.closed - + return self.writer.closed() +BufferedRWPair = _io.BufferedRWPair -class BufferedRandom(BufferedWriter, BufferedReader): +class unused_BufferedRandom(unused_BufferedWriter, unused_BufferedReader): """A buffered interface to random access streams. @@ -1193,7 +1201,6 @@ return pos def tell(self): - self._checkClosed() if self._write_buf: return self.raw.tell() + len(self._write_buf) else: @@ -1225,13 +1232,13 @@ return BufferedReader.read1(self, n) def write(self, b): - self._checkClosed() 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 TextIOBase(IOBase): @@ -1282,7 +1289,8 @@ return None -class IncrementalNewlineDecoder(codecs.IncrementalDecoder): +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 @@ -1358,7 +1366,8 @@ )[self.seennl] -class TextIOWrapper(TextIOBase): +TextIOWrapper = _io.TextIOWrapper +class unusedTextIOWrapper(TextIOBase): r"""Character and line based layer over a BufferedIOBase object, buffer. @@ -1382,7 +1391,7 @@ write contains a newline character. """ - _CHUNK_SIZE = 2048 + _CHUNK_SIZE = 128 def __init__(self, buffer, encoding=None, errors=None, newline=None, line_buffering=False): @@ -1483,7 +1492,8 @@ return self.buffer.isatty() def write(self, s: str): - self._checkClosed() + 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__) @@ -1591,7 +1601,6 @@ return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip def tell(self): - self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if not self._telling: @@ -1662,7 +1671,8 @@ return self.buffer.truncate() def seek(self, cookie, whence=0): - self._checkClosed() + 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 @@ -1720,7 +1730,6 @@ return cookie def read(self, n=None): - self._checkClosed() if n is None: n = -1 decoder = self._decoder or self._get_decoder() @@ -1741,7 +1750,6 @@ return result def __next__(self): - self._checkClosed() self._telling = False line = self.readline() if not line: @@ -1751,7 +1759,8 @@ return line def readline(self, limit=None): - self._checkClosed() + if self.closed: + raise ValueError("read from closed file") if limit is None: limit = -1 @@ -1838,7 +1847,7 @@ def newlines(self): return self._decoder.newlines if self._decoder else None -class _StringIO(TextIOWrapper): +class unused_StringIO(TextIOWrapper): """Text I/O implementation using an in-memory buffer. The initial_value argument sets the value of object. The newline @@ -1972,7 +1981,8 @@ def getvalue(self) -> str: """Retrieve the entire contents of the object.""" - self._checkClosed() + if self.closed: + raise ValueError("read on closed file") return self._getvalue() def write(self, s: str) -> int: @@ -1980,7 +1990,8 @@ Returns the number of characters written. """ - self._checkClosed() + 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__) @@ -1997,7 +2008,8 @@ If the argument is negative or omitted, read until EOF is reached. Return an empty string at EOF. """ - self._checkClosed() + if self.closed: + raise ValueError("read to closed file") if n is None: n = -1 res = self._pending @@ -2012,7 +2024,8 @@ def tell(self) -> int: """Tell the current file position.""" - self._checkClosed() + if self.closed: + raise ValueError("tell from closed file") if self._pending: return self._tell() - len(self._pending) else: @@ -2027,7 +2040,8 @@ 2 End of stream - pos must be 0. Returns the new absolute position. """ - self._checkClosed() + if self.closed: + raise ValueError("seek from closed file") self._pending = "" return self._seek(pos, whence) @@ -2038,12 +2052,14 @@ returned by tell(). Imply an absolute seek to pos. Returns the new absolute position. """ - self._checkClosed() + if self.closed: + raise ValueError("truncate from closed file") self._pending = "" return self._truncate(pos) def readline(self, limit: int = None) -> str: - self._checkClosed() + if self.closed: + raise ValueError("read from closed file") if limit is None: limit = -1 if limit >= 0: @@ -2138,3 +2154,7 @@ except ImportError: StringIO = _StringIO + +# make test_memoryio happy! +_BytesIO = BytesIO +_StringIO = StringIO Modified: python/branches/io-c/Modules/Setup.dist ============================================================================== --- python/branches/io-c/Modules/Setup.dist (original) +++ python/branches/io-c/Modules/Setup.dist Sun Jan 18 00:13:48 2009 @@ -111,10 +111,11 @@ # if $HOME is not set _sre _sre.c # Fredrik Lundh's new regular expressions _codecs _codecsmodule.c # access to the builtin codecs and codec registry -_fileio _fileio.c # Standard I/O baseline _weakref _weakref.c # weak references -_bytesio _bytesio.c # For Lib/io.py -_stringio _stringio.c # For Lib/io.py + +# Standard I/O baseline +_io io.c _iobase.c _fileio.c _bytesio.c _bufferedio.c _textio.c +_stringio _stringio.c # The zipimport module is always imported at startup. Having it as a # builtin module avoids some bootstrapping problems and reduces overhead. @@ -164,7 +165,6 @@ #_collections _collectionsmodule.c # Container types #itertools itertoolsmodule.c # Functions creating iterators for efficient looping #atexit atexitmodule.c # Register functions to be run at interpreter-shutdown -#_functools _functoolsmodule.c # Tools for working with functions and callable objects #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator #_pickle _pickle.c # pickle accelerator #datetime datetimemodule.c # date/time type Added: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- (empty file) +++ python/branches/io-c/Modules/_bufferedio.c Sun Jan 18 00:13:48 2009 @@ -0,0 +1,1904 @@ +#include "Python.h" +#include "structmember.h" +#include "pythread.h" +#include "_iomodule.h" + +/* + * BufferedIOBase class, inherits from IOBase. + */ +PyDoc_STRVAR(BufferedIOBase_doc, + "Base class for buffered IO objects.\n" + "\n" + "The main difference with RawIOBase is that the read() method\n" + "supports omitting the size argument, and does not have a default\n" + "implementation that defers to readinto().\n" + "\n" + "In addition, read(), readinto() and write() may raise\n" + "BlockingIOError if the underlying raw stream is in non-blocking\n" + "mode and not ready; unlike their raw counterparts, they will never\n" + "return None.\n" + "\n" + "A typical implementation should not inherit from a RawIOBase\n" + "implementation, but wrap one.\n" + ); + +static PyObject * +BufferedIOBase_readinto(PyObject *self, PyObject *args) +{ + Py_buffer buf; + Py_ssize_t len; + PyObject *data; + + if (!PyArg_ParseTuple(args, "w*:readinto", &buf)) { + return NULL; + } + + data = PyObject_CallMethod(self, "read", "n", buf.len); + if (data == NULL) + goto error; + + if (!PyBytes_Check(data)) { + Py_DECREF(data); + PyErr_SetString(PyExc_TypeError, "read() should return bytes"); + goto error; + } + + len = Py_SIZE(data); + memcpy(buf.buf, PyBytes_AS_STRING(data), len); + + PyBuffer_Release(&buf); + Py_DECREF(data); + + return PyLong_FromSsize_t(len); + + error: + PyBuffer_Release(&buf); + return NULL; +} + +static PyMethodDef BufferedIOBase_methods[] = { + {"readinto", BufferedIOBase_readinto, METH_VARARGS}, + {NULL, NULL} +}; + +PyTypeObject PyBufferedIOBase_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "BufferedIOBase", /*tp_name*/ + 0, /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + BufferedIOBase_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + BufferedIOBase_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyIOBase_Type, /* 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 */ +}; + + +typedef struct { + PyObject_HEAD + + PyObject *raw; + int ok; /* Initialized? */ + int readable; + int writable; + + /* Absolute position inside the raw stream (-1 if unknown). */ + Py_off_t abs_pos; + + /* A static buffer of size `buffer_size` */ + char *buffer; + /* Current logical position in the buffer. */ + Py_off_t pos; + /* Position of the raw stream in the buffer. */ + Py_off_t raw_pos; + + /* Just after the last buffered byte in the buffer, or -1 if the buffer + isn't ready for reading. */ + Py_off_t read_end; + + /* Just after the last byte actually written */ + Py_off_t write_pos; + /* Just after the last byte waiting to be written, or -1 if the buffer + isn't ready for writing. */ + Py_off_t write_end; + + PyThread_type_lock lock; + + Py_ssize_t buffer_size; + Py_ssize_t buffer_mask; + + PyObject *dict; + PyObject *weakreflist; +} BufferedObject; + +/* + Implementation notes: + + * BufferedReader, BufferedWriter and BufferedRandom try to share most + methods (this is helped by the members `readable` and `writable`, which + are initialized in the respective constructors) + * They also share a single buffer for reading and writing. This enables + interleaved reads and writes without flushing. It also makes the logic + a bit trickier to get right. + * The absolute position of the raw stream is cached, if possible, in the + `abs_pos` member. It must be updated every time an operation is done + on the raw stream. If not sure, it can be reinitialized by calling + _Buffered_raw_tell(), which queries the raw stream (_Buffered_raw_seek() + also does it). To read it, use RAW_TELL(). + * Three helpers, _BufferedReader_raw_read, _BufferedWriter_raw_write and + _BufferedWriter_flush_unlocked do a lot of useful housekeeping. + + NOTE: we should try to maintain block alignment of reads and writes to the + raw stream (according to the buffer size), but for now it is only done + in read() and friends. + + XXX: method naming is a bit messy. +*/ + +/* These macros protect the BufferedObject against concurrent operations. */ + +#define ENTER_BUFFERED(self) \ + Py_BEGIN_ALLOW_THREADS \ + PyThread_acquire_lock(self->lock, 1); \ + Py_END_ALLOW_THREADS + +#define LEAVE_BUFFERED(self) \ + PyThread_release_lock(self->lock); + +#define CHECK_INITIALIZED(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return NULL; \ + } + +#define CHECK_INITIALIZED_INT(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return -1; \ + } + +#define VALID_READ_BUFFER(self) \ + (self->readable && self->read_end != -1) + +#define VALID_WRITE_BUFFER(self) \ + (self->writable && self->write_end != -1) + +#define ADJUST_POSITION(self, _new_pos) \ + do { \ + self->pos = _new_pos; \ + if (VALID_READ_BUFFER(self) && self->read_end < self->pos) \ + self->read_end = self->pos; \ + } while(0) + +#define READAHEAD(self) \ + ((self->readable && VALID_READ_BUFFER(self)) \ + ? (self->read_end - self->pos) : 0) + +#define RAW_OFFSET(self) \ + (((VALID_READ_BUFFER(self) || VALID_WRITE_BUFFER(self)) \ + && self->raw_pos >= 0) ? self->raw_pos - self->pos : 0) + +#define RAW_TELL(self) \ + (self->abs_pos != -1 ? self->abs_pos : _Buffered_raw_tell(self)) + +#define MINUS_LAST_BLOCK(self, size) \ + (self->buffer_mask ? \ + (size & ~self->buffer_mask) : \ + (self->buffer_size * (size / self->buffer_size))) + + +static void +BufferedObject_dealloc(BufferedObject *self) +{ + PyObject *res; + /* XXX this is inelegant */ + if (Py_TYPE(self)->tp_del == NULL) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + /* We need to resurrect the object as calling close() can invoke + arbitrary code. */ + ((PyObject *) self)->ob_refcnt++; + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, + NULL); + if (res == NULL) { + /* XXX dump exception on terminal? + But IOBase.__del__ prefers to remain silent... */ + PyErr_Clear(); + } + Py_XDECREF(res); + PyErr_Restore(tp, v, tb); + if (--((PyObject *) self)->ob_refcnt != 0) + return; + } + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *)self); + Py_CLEAR(self->raw); + if (self->buffer) { + PyMem_Free(self->buffer); + self->buffer = NULL; + } + if (self->lock) { + PyThread_free_lock(self->lock); + self->lock = NULL; + } + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *)self); +} + + +/* + * _BufferedIOMixin methods + * This is not a class, just a collection of methods that will be reused + * 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. + */ + /* FIXME: raw objects don't have flush() + */ + 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); + 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 * +BufferedIOMixin_flush(BufferedObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self) + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); +} + +static int +BufferedIOMixin_closed(BufferedObject *self) +{ + int closed; + PyObject *res; + CHECK_INITIALIZED_INT(self) + res = PyObject_GetAttr(self->raw, _PyIO_str_closed); + if (res == NULL) + return -1; + closed = PyObject_IsTrue(res); + Py_DECREF(res); + return closed; +} + +static PyObject * +BufferedIOMixin_closed_get(BufferedObject *self, void *context) +{ + CHECK_INITIALIZED(self) + return PyObject_GetAttr(self->raw, _PyIO_str_closed); +} + +static PyObject * +BufferedIOMixin_close(BufferedObject *self, PyObject *args) +{ + PyObject *res = NULL; + int r; + + CHECK_INITIALIZED(self) + ENTER_BUFFERED(self) + + r = BufferedIOMixin_closed(self); + if (r < 0) + goto end; + if (r > 0) { + res = Py_None; + Py_INCREF(res); + goto end; + } + /* flush() will most probably re-take the lock, so drop it first */ + LEAVE_BUFFERED(self) + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + ENTER_BUFFERED(self) + if (res == NULL) { + /* If flush() fails, just give up */ + if (PyErr_ExceptionMatches(PyExc_IOError)) + PyErr_Clear(); + else + goto end; + } + Py_XDECREF(res); + + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL); + +end: + LEAVE_BUFFERED(self) + return res; +} + +/* Inquiries */ + +static PyObject * +BufferedIOMixin_seekable(BufferedObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self) + 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, _PyIO_str_readable, NULL); +} + +static PyObject * +BufferedIOMixin_writable(BufferedObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self) + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_writable, NULL); +} + +static PyObject * +BufferedIOMixin_name_get(BufferedObject *self, void *context) +{ + CHECK_INITIALIZED(self) + return PyObject_GetAttrString(self->raw, "name"); +} + +static PyObject * +BufferedIOMixin_mode_get(BufferedObject *self, void *context) +{ + CHECK_INITIALIZED(self) + return PyObject_GetAttrString(self->raw, "mode"); +} + +/* Lower-level APIs */ + +static PyObject * +BufferedIOMixin_fileno(BufferedObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self) + 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, _PyIO_str_isatty, NULL); +} + + +/* Forward decls */ +static PyObject * +_BufferedWriter_flush_unlocked(BufferedObject *, int); +static Py_ssize_t +_BufferedReader_fill_buffer(BufferedObject *self); +static void +_BufferedReader_reset_buf(BufferedObject *self); +static void +_BufferedWriter_reset_buf(BufferedObject *self); +static PyObject * +_BufferedReader_peek_unlocked(BufferedObject *self, Py_ssize_t); +static PyObject * +_BufferedReader_read_unlocked(BufferedObject *self, Py_ssize_t); + + +/* + * Helpers + */ + +/* Returns the address of the `written` member if a BlockingIOError was + raised, NULL otherwise. The error is always re-raised. */ +static Py_ssize_t * +_Buffered_check_blocking_error(void) +{ + PyObject *t, *v, *tb; + PyBlockingIOErrorObject *err; + + PyErr_Fetch(&t, &v, &tb); + if (v == NULL || !PyErr_GivenExceptionMatches(v, PyExc_BlockingIOError)) { + PyErr_Restore(t, v, tb); + return NULL; + } + err = (PyBlockingIOErrorObject *) v; + /* TODO: sanity check (err->written >= 0) */ + PyErr_Restore(t, v, tb); + return &err->written; +} + +static Py_off_t +_Buffered_raw_tell(BufferedObject *self) +{ + PyObject *res; + Py_off_t n; + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_tell, NULL); + if (res == NULL) + return -1; + n = PyNumber_AsOff_t(res, PyExc_ValueError); + Py_DECREF(res); + if (n < 0) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_IOError, + "Raw stream returned invalid position %zd", n); + return -1; + } + self->abs_pos = n; + return n; +} + +static Py_off_t +_Buffered_raw_seek(BufferedObject *self, Py_off_t target, int whence) +{ + PyObject *res, *posobj, *whenceobj; + Py_off_t n; + + posobj = PyLong_FromOff_t(target); + if (posobj == NULL) + return -1; + whenceobj = PyLong_FromLong(whence); + if (whenceobj == NULL) { + Py_DECREF(posobj); + return -1; + } + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_seek, + posobj, whenceobj, NULL); + Py_DECREF(posobj); + Py_DECREF(whenceobj); + if (res == NULL) + return -1; + n = PyNumber_AsOff_t(res, PyExc_ValueError); + Py_DECREF(res); + if (n < 0) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_IOError, + "Raw stream returned invalid position %zd", n); + return -1; + } + self->abs_pos = n; + return n; +} + +static int +_Buffered_init(BufferedObject *self) +{ + Py_ssize_t n; + if (self->buffer_size <= 0) { + PyErr_SetString(PyExc_ValueError, + "buffer size must be strictly positive"); + return -1; + } + if (self->buffer) + PyMem_Free(self->buffer); + self->buffer = PyMem_Malloc(self->buffer_size); + if (self->buffer == NULL) { + PyErr_NoMemory(); + return -1; + } + self->lock = PyThread_allocate_lock(); + if (self->lock == NULL) { + PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock"); + return -1; + } + /* Find out whether buffer_size is a power of 2 */ + /* XXX is this optimization useful? */ + for (n = self->buffer_size - 1; n & 1; n >>= 1) + ; + if (n == 0) + self->buffer_mask = self->buffer_size - 1; + else + self->buffer_mask = 0; + if (_Buffered_raw_tell(self) == -1) + PyErr_Clear(); + return 0; +} + +/* + * Shared methods and wrappers + */ + +static PyObject * +Buffered_flush(BufferedObject *self, PyObject *args) +{ + PyObject *res; + + CHECK_INITIALIZED(self) + if (BufferedIOMixin_closed(self)) { + PyErr_SetString(PyExc_ValueError, "flush of closed file"); + return NULL; + } + + ENTER_BUFFERED(self) + res = _BufferedWriter_flush_unlocked(self, 0); + if (res != NULL && self->readable) { + /* Rewind the raw stream so that its position corresponds to + the current logical position. */ + Py_off_t n; + n = _Buffered_raw_seek(self, -RAW_OFFSET(self), 1); + if (n == -1) + Py_CLEAR(res); + _BufferedReader_reset_buf(self); + } + LEAVE_BUFFERED(self) + + return res; +} + +static PyObject * +Buffered_peek(BufferedObject *self, PyObject *args) +{ + Py_ssize_t n = 0; + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|n:peek", &n)) { + return NULL; + } + + ENTER_BUFFERED(self) + + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + res = _BufferedReader_peek_unlocked(self, n); + +end: + LEAVE_BUFFERED(self) + return res; +} + +static PyObject * +Buffered_read(BufferedObject *self, PyObject *args) +{ + Py_ssize_t n = -1; + PyObject *res; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|n:read", &n)) { + return NULL; + } + if (n < -1) { + PyErr_SetString(PyExc_ValueError, + "read length must be positive or -1"); + return NULL; + } + + if (BufferedIOMixin_closed(self)) { + PyErr_SetString(PyExc_ValueError, "read of closed file"); + return NULL; + } + + ENTER_BUFFERED(self) + res = _BufferedReader_read_unlocked(self, n); + LEAVE_BUFFERED(self) + + return res; +} + +static PyObject * +Buffered_read1(BufferedObject *self, PyObject *args) +{ + Py_ssize_t n, have, r; + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "n:read1", &n)) { + return NULL; + } + + if (n < 0) { + PyErr_SetString(PyExc_ValueError, + "read length must be positive"); + return NULL; + } + if (n == 0) + return PyBytes_FromStringAndSize(NULL, 0); + + ENTER_BUFFERED(self) + + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + + /* Return up to n bytes. If at least one byte is buffered, we + only return buffered bytes. Otherwise, we do one raw read. */ + + /* XXX: this mimicks the io.py implementation but is probably wrong. + If we need to read from the raw stream, then we could actually read + all `n` bytes asked by the caller (and possibly more, so as to fill + our buffer for the next reads). */ + + have = READAHEAD(self); + if (have > 0) { + if (n > have) + n = have; + res = PyBytes_FromStringAndSize(self->buffer + self->pos, n); + if (res == NULL) + goto end; + self->pos += n; + goto end; + } + + /* Fill the buffer from the raw stream, and copy it to the result. */ + _BufferedReader_reset_buf(self); + r = _BufferedReader_fill_buffer(self); + if (r == -1) + goto end; + if (r == -2) + r = 0; + if (n > r) + n = r; + res = PyBytes_FromStringAndSize(self->buffer, n); + if (res == NULL) + goto end; + self->pos = n; + +end: + LEAVE_BUFFERED(self) + return res; +} + +static PyObject * +Buffered_readinto(BufferedObject *self, PyObject *args) +{ + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + + /* TODO: use raw.readinto() instead! */ + if (self->writable) { + ENTER_BUFFERED(self) + res = _BufferedWriter_flush_unlocked(self, 0); + LEAVE_BUFFERED(self) + if (res == NULL) + goto end; + Py_DECREF(res); + } + res = BufferedIOBase_readinto((PyObject *)self, args); + +end: + return res; +} + +static PyObject * +Buffered_tell(BufferedObject *self, PyObject *args) +{ + Py_off_t pos; + + CHECK_INITIALIZED(self) + pos = _Buffered_raw_tell(self); + if (pos == -1) + return NULL; + pos -= RAW_OFFSET(self); + /* TODO: sanity check (pos >= 0) */ + return PyLong_FromOff_t(pos); +} + +static PyObject * +Buffered_seek(BufferedObject *self, PyObject *args) +{ + Py_off_t target, n; + int whence = 0; + PyObject *targetobj, *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "O|i:seek", &targetobj, &whence)) { + return NULL; + } + + if (whence < 0 || whence > 2) { + PyErr_Format(PyExc_ValueError, + "whence must be between 0 and 2, not %d", whence); + return NULL; + } + target = PyNumber_AsOff_t(targetobj, PyExc_ValueError); + if (target == -1 && PyErr_Occurred()) + return NULL; + + ENTER_BUFFERED(self) + + if (whence != 2 && self->readable) { + Py_off_t current, avail; + /* Check if seeking leaves us inside the current buffer, + so as to return quickly if possible. + Don't know how to do that when whence == 2, though. */ + current = RAW_TELL(self); + avail = READAHEAD(self); + if (avail > 0) { + Py_off_t offset; + if (whence == 0) + offset = target - (current - RAW_OFFSET(self)); + else + offset = target; + if (offset >= -self->pos && offset <= avail) { + self->pos += offset; + res = PyLong_FromOff_t(current - avail + offset); + goto end; + } + } + } + + /* Fallback: invoke raw seek() method and clear buffer */ + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 0); + if (res == NULL) + goto end; + Py_CLEAR(res); + _BufferedWriter_reset_buf(self); + } + + /* TODO: align on block boundary and read buffer if needed? */ + if (whence == 1) + target -= RAW_OFFSET(self); + n = _Buffered_raw_seek(self, target, whence); + if (n == -1) + goto end; + self->raw_pos = -1; + res = PyLong_FromOff_t(n); + if (res != NULL && self->readable) + _BufferedReader_reset_buf(self); + +end: + LEAVE_BUFFERED(self) + return res; +} + +static PyObject * +Buffered_truncate(BufferedObject *self, PyObject *args) +{ + PyObject *pos = Py_None; + PyObject *res = NULL; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { + return NULL; + } + + if (pos != Py_None) + Py_INCREF(pos); + + ENTER_BUFFERED(self) + + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 0); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + if (self->readable) { + if (pos == Py_None) { + /* Rewind the raw stream so that its position corresponds to + the current logical position. */ + if (_Buffered_raw_seek(self, -RAW_OFFSET(self), 1) == -1) + goto end; + } + _BufferedReader_reset_buf(self); + } + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); + if (res == NULL) + goto end; + /* Reset cached position */ + if (_Buffered_raw_tell(self) == -1) + PyErr_Clear(); + +end: + LEAVE_BUFFERED(self) + return res; +} + + +/* + * class BufferedReader + */ + +PyDoc_STRVAR(BufferedReader_doc, + "Create a new buffered reader using the given readable raw IO object."); + +static void _BufferedReader_reset_buf(BufferedObject *self) +{ + self->read_end = -1; +} + +static int +BufferedReader_init(BufferedObject *self, PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"raw", "buffer_size", NULL}; + Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; + PyObject *raw; + + self->ok = 0; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:BufferedReader", kwlist, + &raw, &buffer_size)) { + return -1; + } + + if (_PyIOBase_checkReadable(raw, Py_True) == NULL) + return -1; + + Py_CLEAR(self->raw); + Py_INCREF(raw); + self->raw = raw; + self->buffer_size = buffer_size; + self->readable = 1; + self->writable = 0; + + if (_Buffered_init(self) < 0) + return -1; + _BufferedReader_reset_buf(self); + + self->ok = 1; + return 0; +} + +static Py_ssize_t +_BufferedReader_raw_read(BufferedObject *self, char *start, Py_ssize_t len) +{ + Py_buffer buf; + PyObject *memobj, *res; + Py_ssize_t n; + /* NOTE: the buffer needn't be released as its object is NULL. */ + if (PyBuffer_FillInfo(&buf, NULL, start, len, 0, PyBUF_CONTIG) == -1) + return -1; + memobj = PyMemoryView_FromBuffer(&buf); + if (memobj == NULL) + return -1; + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL); + Py_DECREF(memobj); + if (res == NULL) + return -1; + if (res == Py_None) { + /* Non-blocking stream would have blocked. Special return code! */ + Py_DECREF(res); + return -2; + } + n = PyNumber_AsSsize_t(res, PyExc_ValueError); + Py_DECREF(res); + if (n < 0 || n > len) { + PyErr_Format(PyExc_IOError, + "raw readinto() returned invalid length %zd " + "(should have been between 0 and %zd)", n, len); + return -1; + } + if (n > 0 && self->abs_pos != -1) + self->abs_pos += n; + return n; +} + +static Py_ssize_t +_BufferedReader_fill_buffer(BufferedObject *self) +{ + Py_ssize_t start, len, n; + if (VALID_READ_BUFFER(self)) + start = self->read_end; + else + start = 0; + len = self->buffer_size - start; + n = _BufferedReader_raw_read(self, self->buffer + start, len); + if (n <= 0) + return n; + self->read_end = start + n; + self->raw_pos = start + n; + return n; +} + +static PyObject * +_BufferedReader_read_unlocked(BufferedObject *self, Py_ssize_t n) +{ + PyObject *data, *res = NULL; + Py_ssize_t current_size, remaining, written; + char *out; + static PyObject *sep = NULL; + + /* Special case for when the number of bytes to read is unspecified. */ + if (n == -1) { + PyObject *chunks = PyList_New(0); + if (chunks == NULL) + return NULL; + + /* First copy what we have in the current buffer. */ + current_size = READAHEAD(self); + data = NULL; + if (current_size) { + data = PyBytes_FromStringAndSize( + self->buffer + self->pos, current_size); + if (data == NULL) { + Py_DECREF(chunks); + return NULL; + } + } + _BufferedReader_reset_buf(self); + /* We're going past the buffer's bounds, flush it */ + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) { + Py_DECREF(chunks); + return NULL; + } + Py_CLEAR(res); + } + while (1) { + if (data) { + if (PyList_Append(chunks, data) < 0) { + Py_DECREF(data); + Py_DECREF(chunks); + return NULL; + } + Py_DECREF(data); + } + + /* Read until EOF or until read() would block. */ + data = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_read, NULL); + if (data == NULL) { + Py_DECREF(chunks); + return NULL; + } + if (data != Py_None && !PyBytes_Check(data)) { + Py_DECREF(data); + Py_DECREF(chunks); + PyErr_SetString(PyExc_TypeError, "read() should return bytes"); + return NULL; + } + if (data == Py_None || PyBytes_GET_SIZE(data) == 0) { + if (current_size == 0) { + Py_DECREF(chunks); + return data; + } + else { + if (sep == NULL) { + sep = PyBytes_FromStringAndSize(NULL, 0); + if (sep == NULL) { + Py_DECREF(data); + Py_DECREF(chunks); + return NULL; + } + } + res =_PyBytes_Join(sep, chunks); + Py_DECREF(data); + Py_DECREF(chunks); + return res; + } + } + current_size += PyBytes_GET_SIZE(data); + if (self->abs_pos != -1) + self->abs_pos += PyBytes_GET_SIZE(data); + } + } + + /* The number of bytes to read is specified, return at most n bytes. */ + current_size = READAHEAD(self); + if (n <= current_size) { + /* Fast path: the data to read is fully buffered. */ + res = PyBytes_FromStringAndSize(self->buffer + self->pos, n); + if (res == NULL) + goto error; + self->pos += n; + return res; + } + + /* Slow path: read from the stream until enough bytes are read, + * or until an EOF occurs or until read() would block. + */ + res = PyBytes_FromStringAndSize(NULL, n); + if (res == NULL) + goto error; + out = PyBytes_AS_STRING(res); + remaining = n; + written = 0; + if (current_size > 0) { + memcpy(out, self->buffer + self->pos, current_size); + remaining -= current_size; + written += current_size; + } + _BufferedReader_reset_buf(self); + while (remaining > 0) { + /* We want to read a whole block at the end into buffer. + If we had readv() we could do this in one pass. */ + Py_ssize_t r = MINUS_LAST_BLOCK(self, remaining); + if (r == 0) + break; + r = _BufferedReader_raw_read(self, out + written, r); + if (r == -1) + goto error; + if (r == 0 || r == -2) { + /* EOF occurred or read() would block. */ + if (r == 0 || written > 0) { + if (_PyBytes_Resize(&res, written)) + goto error; + return res; + } + Py_DECREF(res); + Py_INCREF(Py_None); + return Py_None; + } + remaining -= r; + written += r; + } + assert(remaining <= self->buffer_size); + self->pos = 0; + self->raw_pos = 0; + self->read_end = 0; + while (self->read_end < self->buffer_size) { + Py_ssize_t r = _BufferedReader_fill_buffer(self); + if (r == -1) + goto error; + if (r == 0 || r == -2) { + /* EOF occurred or read() would block. */ + if (r == 0 || written > 0) { + if (_PyBytes_Resize(&res, written)) + goto error; + return res; + } + Py_DECREF(res); + Py_INCREF(Py_None); + return Py_None; + } + if (remaining > r) { + memcpy(out + written, self->buffer + self->pos, r); + written += r; + self->pos += r; + remaining -= r; + } + else if (remaining > 0) { + memcpy(out + written, self->buffer + self->pos, remaining); + written += remaining; + self->pos += remaining; + remaining = 0; + } + if (remaining == 0) + break; + } + + return res; + +error: + Py_XDECREF(res); + return NULL; +} + +static PyObject * +_BufferedReader_peek_unlocked(BufferedObject *self, Py_ssize_t n) +{ + Py_ssize_t have, r; + + have = READAHEAD(self); + /* 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 + to make some place. + Therefore, we either return `have` bytes (if > 0), or a full buffer. + */ + if (have > 0) { + return PyBytes_FromStringAndSize(self->buffer + self->pos, have); + } + + /* Fill the buffer from the raw stream, and copy it to the result. */ + _BufferedReader_reset_buf(self); + r = _BufferedReader_fill_buffer(self); + if (r == -1) + return NULL; + if (r == -2) + r = 0; + self->pos = 0; + return PyBytes_FromStringAndSize(self->buffer, r); +} + +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}, + {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, + {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, + {"fileno", (PyCFunction)BufferedIOMixin_fileno, METH_NOARGS}, + {"isatty", (PyCFunction)BufferedIOMixin_isatty, METH_NOARGS}, + + {"read", (PyCFunction)Buffered_read, METH_VARARGS}, + {"peek", (PyCFunction)Buffered_peek, METH_VARARGS}, + {"read1", (PyCFunction)Buffered_read1, METH_VARARGS}, + {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, + {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, + {NULL, NULL} +}; + +static PyMemberDef BufferedReader_members[] = { + {"raw", T_OBJECT, offsetof(BufferedObject, raw), 0}, + {NULL} +}; + +static PyGetSetDef BufferedReader_getset[] = { + {"closed", (getter)BufferedIOMixin_closed_get, NULL, NULL}, + {"name", (getter)BufferedIOMixin_name_get, NULL, NULL}, + {"mode", (getter)BufferedIOMixin_mode_get, NULL, NULL}, + {0} +}; + + +PyTypeObject PyBufferedReader_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "BufferedReader", /*tp_name*/ + sizeof(BufferedObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)BufferedObject_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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + BufferedReader_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ + 0, /* tp_iter */ + 0, /* tp_iternext */ + BufferedReader_methods, /* tp_methods */ + BufferedReader_members, /* tp_members */ + BufferedReader_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(BufferedObject, dict), /* tp_dictoffset */ + (initproc)BufferedReader_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ +}; + + +/* + * class BufferedWriter + */ +PyDoc_STRVAR(BufferedWriter_doc, + "A buffer for a writeable sequential RawIO object.\n" + "\n" + "The constructor creates a BufferedWriter for the given writeable raw\n" + "stream. If the buffer_size is not given, it defaults to\n" + "DEFAULT_BUFFER_SIZE. max_buffer_size isn't used anymore.\n" + ); + +static void +_BufferedWriter_reset_buf(BufferedObject *self) +{ + self->write_pos = 0; + self->write_end = -1; +} + +static int +BufferedWriter_init(BufferedObject *self, PyObject *args, PyObject *kwds) +{ + /* TODO: properly deprecate max_buffer_size */ + char *kwlist[] = {"raw", "buffer_size", "max_buffer_size", NULL}; + Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; + Py_ssize_t max_buffer_size = -1; + PyObject *raw; + + self->ok = 0; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|nn:BufferedReader", kwlist, + &raw, &buffer_size, &max_buffer_size)) { + return -1; + } + + if (_PyIOBase_checkWritable(raw, Py_True) == NULL) + return -1; + + Py_CLEAR(self->raw); + Py_INCREF(raw); + self->raw = raw; + self->readable = 0; + self->writable = 1; + + self->buffer_size = buffer_size; + if (_Buffered_init(self) < 0) + return -1; + _BufferedWriter_reset_buf(self); + self->pos = 0; + + self->ok = 1; + return 0; +} + +static Py_ssize_t +_BufferedWriter_raw_write(BufferedObject *self, char *start, Py_ssize_t len) +{ + Py_buffer buf; + PyObject *memobj, *res; + Py_ssize_t n; + /* NOTE: the buffer needn't be released as its object is NULL. */ + if (PyBuffer_FillInfo(&buf, NULL, start, len, 1, PyBUF_CONTIG_RO) == -1) + return -1; + memobj = PyMemoryView_FromBuffer(&buf); + if (memobj == NULL) + return -1; + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL); + Py_DECREF(memobj); + if (res == NULL) + return -1; + n = PyNumber_AsSsize_t(res, PyExc_ValueError); + Py_DECREF(res); + if (n < 0 || n > len) { + PyErr_Format(PyExc_IOError, + "raw write() returned invalid length %zd " + "(should have been between 0 and %zd)", n, len); + return -1; + } + if (n > 0 && self->abs_pos != -1) + self->abs_pos += n; + return n; +} + +/* `restore_pos` is 1 if we need to restore the raw stream position at + the end, 0 otherwise. */ +static PyObject * +_BufferedWriter_flush_unlocked(BufferedObject *self, int restore_pos) +{ + Py_ssize_t written = 0; + Py_off_t n, rewind; + + if (!VALID_WRITE_BUFFER(self) || self->write_pos == self->write_end) + goto end; + /* First, rewind */ + rewind = RAW_OFFSET(self) + (self->pos - self->write_pos); + if (rewind != 0) { + n = _Buffered_raw_seek(self, -rewind, 1); + if (n < 0) { + goto error; + } + self->raw_pos -= rewind; + } + while (self->write_pos < self->write_end) { + n = _BufferedWriter_raw_write(self, + self->buffer + self->write_pos, + self->write_end - self->write_pos); + if (n == -1) { + Py_ssize_t *w = _Buffered_check_blocking_error(); + if (w == NULL) + goto error; + self->write_pos += *w; + self->raw_pos = self->write_pos; + written += *w; + *w = written; + /* Already re-raised */ + goto error; + } + self->write_pos += n; + self->raw_pos = self->write_pos; + written += n; + } + + if (restore_pos) { + Py_off_t forward = rewind - written; + if (forward != 0) { + n = _Buffered_raw_seek(self, forward, 1); + if (n < 0) { + goto error; + } + self->raw_pos += forward; + } + } + _BufferedWriter_reset_buf(self); + +end: + Py_RETURN_NONE; + +error: + return NULL; +} + +static PyObject * +BufferedWriter_write(BufferedObject *self, PyObject *args) +{ + PyObject *res = NULL; + Py_buffer buf; + Py_ssize_t written, avail, remaining, n; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "y*:write", &buf)) { + return NULL; + } + + if (BufferedIOMixin_closed(self)) { + PyErr_SetString(PyExc_ValueError, "write to closed file"); + PyBuffer_Release(&buf); + return NULL; + } + + ENTER_BUFFERED(self) + + /* Fast path: the data to write can be fully buffered. */ + if (!VALID_READ_BUFFER(self) && !VALID_WRITE_BUFFER(self)) { + self->pos = 0; + self->raw_pos = 0; + } + avail = self->buffer_size - self->pos; + if (buf.len <= avail) { + memcpy(self->buffer + self->pos, buf.buf, buf.len); + if (!VALID_WRITE_BUFFER(self)) { + self->write_pos = self->pos; + } + ADJUST_POSITION(self, self->pos + buf.len); + if (self->pos > self->write_end) + self->write_end = self->pos; + written = buf.len; + goto end; + } + + /* First write the current buffer */ + res = _BufferedWriter_flush_unlocked(self, 0); + if (res == NULL) { + Py_ssize_t *w = _Buffered_check_blocking_error(); + if (w == NULL) + goto error; + if (self->readable) + _BufferedReader_reset_buf(self); + /* 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); + 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; + if (buf.len <= avail) { + /* Everything can be buffered */ + PyErr_Clear(); + memcpy(self->buffer + self->write_end, buf.buf, buf.len); + self->write_end += buf.len; + written = buf.len; + goto end; + } + /* Buffer as much as possible. */ + memcpy(self->buffer + self->write_end, buf.buf, avail); + self->write_end += avail; + /* Already re-raised */ + *w = avail; + goto error; + } + Py_CLEAR(res); + + /* Then write buf itself. At this point the buffer has been emptied. */ + remaining = buf.len; + written = 0; + while (remaining > self->buffer_size) { + n = _BufferedWriter_raw_write( + self, (char *) buf.buf + written, buf.len - written); + if (n == -1) { + Py_ssize_t *w = _Buffered_check_blocking_error(); + if (w == NULL) + goto error; + written += *w; + remaining -= *w; + if (remaining > self->buffer_size) { + /* Can't buffer everything, still buffer as much as possible */ + memcpy(self->buffer, + (char *) buf.buf + written, self->buffer_size); + self->raw_pos = 0; + ADJUST_POSITION(self, self->buffer_size); + self->write_end = self->buffer_size; + *w = written + self->buffer_size; + /* Already re-raised */ + goto error; + } + PyErr_Clear(); + break; + } + written += n; + remaining -= n; + } + if (self->readable) + _BufferedReader_reset_buf(self); + if (remaining > 0) { + memcpy(self->buffer, (char *) buf.buf + written, remaining); + written += remaining; + } + self->write_pos = 0; + /* TODO: sanity check (remaining >= 0) */ + self->write_end = remaining; + ADJUST_POSITION(self, remaining); + self->raw_pos = 0; + +end: + res = PyLong_FromSsize_t(written); + +error: + LEAVE_BUFFERED(self) + PyBuffer_Release(&buf); + return res; +} + +static PyMethodDef BufferedWriter_methods[] = { + /* BufferedIOMixin methods */ + {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, + {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, + {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, + {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, + {"fileno", (PyCFunction)BufferedIOMixin_fileno, METH_NOARGS}, + {"isatty", (PyCFunction)BufferedIOMixin_isatty, METH_NOARGS}, + + {"write", (PyCFunction)BufferedWriter_write, METH_VARARGS}, + {"truncate", (PyCFunction)Buffered_truncate, METH_VARARGS}, + {"flush", (PyCFunction)Buffered_flush, METH_NOARGS}, + {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, + {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, + {NULL, NULL} +}; + +static PyMemberDef BufferedWriter_members[] = { + {"raw", T_OBJECT, offsetof(BufferedObject, raw), 0}, + {NULL} +}; + +static PyGetSetDef BufferedWriter_getset[] = { + {"closed", (getter)BufferedIOMixin_closed_get, NULL, NULL}, + {"name", (getter)BufferedIOMixin_name_get, NULL, NULL}, + {"mode", (getter)BufferedIOMixin_mode_get, NULL, NULL}, + {0} +}; + + +PyTypeObject PyBufferedWriter_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "BufferedWriter", /*tp_name*/ + sizeof(BufferedObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)BufferedObject_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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + BufferedWriter_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ + 0, /* tp_iter */ + 0, /* tp_iternext */ + BufferedWriter_methods, /* tp_methods */ + BufferedWriter_members, /* tp_members */ + BufferedWriter_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(BufferedObject, dict), /* tp_dictoffset */ + (initproc)BufferedWriter_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ +}; + + + +/* + * BufferedRWPair + */ + +PyDoc_STRVAR(BufferedRWPair_doc, + "A buffered reader and writer object together.\n" + "\n" + "A buffered reader object and buffered writer object put together to\n" + "form a sequential IO object that can read and write. This is typically\n" + "used with a socket or two-way pipe.\n" + "\n" + "reader and writer are RawIOBase objects that are readable and\n" + "writeable respectively. If the buffer_size is omitted it defaults to\n" + "DEFAULT_BUFFER_SIZE. The max_buffer_size (for the buffered writer)\n" + "defaults to twice the buffer size.\n" + ); + +/* XXX The usefulness of this (compared to having two separate IO objects) is + * questionable. + */ + +typedef struct { + PyObject_HEAD + BufferedObject *reader; + BufferedObject *writer; + PyObject *dict; +} BufferedRWPairObject; + +static int +BufferedRWPair_init(BufferedRWPairObject *self, PyObject *args, + PyObject *kwds) +{ + PyObject *reader, *writer; + Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; + Py_ssize_t max_buffer_size = -1; + + if (!PyArg_ParseTuple(args, "OO|nn:BufferedRWPair", &reader, &writer, + &buffer_size, &max_buffer_size)) { + return -1; + } + + if (_PyIOBase_checkReadable(reader, Py_True) == NULL) + return -1; + if (_PyIOBase_checkWritable(writer, Py_True) == NULL) + return -1; + + args = Py_BuildValue("(n)", buffer_size); + if (args == NULL) { + Py_CLEAR(self->reader); + return -1; + } + self->reader = (BufferedObject *)PyType_GenericNew( + &PyBufferedReader_Type, args, NULL); + Py_DECREF(args); + if (self->reader == NULL) + return -1; + + args = Py_BuildValue("(nn)", buffer_size, max_buffer_size); + if (args == NULL) { + Py_CLEAR(self->reader); + return -1; + } + self->writer = (BufferedObject *)PyType_GenericNew( + &PyBufferedWriter_Type, args, NULL); + Py_DECREF(args); + if (self->writer == NULL) { + Py_CLEAR(self->reader); + return -1; + } + return 0; +} + +static void +BufferedRWPair_dealloc(BufferedRWPairObject *self) +{ + Py_CLEAR(self->reader); + Py_CLEAR(self->writer); +} + +static PyObject * +_forward_call(BufferedObject *self, const char *name, PyObject *args) +{ + PyObject *func = PyObject_GetAttrString((PyObject *)self, name); + PyObject *ret; + + if (func == NULL) { + PyErr_SetString(PyExc_AttributeError, name); + return NULL; + } + + ret = PyObject_CallObject(func, args); + Py_DECREF(func); + return ret; +} + +static PyObject * +BufferedRWPair_read(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->reader, "read", args); +} + +static PyObject * +BufferedRWPair_peek(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->reader, "peek", args); +} + +static PyObject * +BufferedRWPair_read1(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->reader, "read1", args); +} + +static PyObject * +BufferedRWPair_write(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->writer, "write", args); +} + +static PyObject * +BufferedRWPair_flush(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->writer, "flush", args); +} + +static PyObject * +BufferedRWPair_readable(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->reader, "readable", args); +} + +static PyObject * +BufferedRWPair_writable(BufferedRWPairObject *self, PyObject *args) +{ + return _forward_call(self->writer, "writable", args); +} + +static PyObject * +BufferedRWPair_close(BufferedRWPairObject *self, PyObject *args) +{ + PyObject *ret = _forward_call(self->writer, "close", args); + if (ret == NULL) + return NULL; + Py_DECREF(ret); + + return _forward_call(self->reader, "close", args); +} + +static PyObject * +BufferedRWPair_isatty(BufferedRWPairObject *self, PyObject *args) +{ + PyObject *ret = _forward_call(self->writer, "isatty", args); + + if (ret != Py_False) { + /* either True or exception */ + return ret; + } + Py_DECREF(ret); + + return _forward_call(self->reader, "isatty", args); +} + + +static PyMethodDef BufferedRWPair_methods[] = { + {"read", (PyCFunction)BufferedRWPair_read, METH_VARARGS}, + {"peek", (PyCFunction)BufferedRWPair_peek, METH_VARARGS}, + {"read1", (PyCFunction)BufferedRWPair_read1, METH_VARARGS}, + {"readinto", (PyCFunction)Buffered_readinto, METH_VARARGS}, + + {"write", (PyCFunction)BufferedRWPair_write, METH_VARARGS}, + {"flush", (PyCFunction)BufferedRWPair_flush, METH_NOARGS}, + + {"readable", (PyCFunction)BufferedRWPair_readable, METH_NOARGS}, + {"writable", (PyCFunction)BufferedRWPair_writable, METH_NOARGS}, + + {"close", (PyCFunction)BufferedRWPair_close, METH_NOARGS}, + {"isatty", (PyCFunction)BufferedRWPair_isatty, METH_NOARGS}, + + {NULL, NULL} +}; + +PyTypeObject PyBufferedRWPair_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "BufferedRWPair", /*tp_name*/ + sizeof(BufferedRWPairObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)BufferedRWPair_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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + BufferedRWPair_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ + 0, /* tp_iter */ + 0, /* tp_iternext */ + BufferedRWPair_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(BufferedRWPairObject, dict), /* tp_dictoffset */ + (initproc)BufferedRWPair_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ +}; + + + +/* + * BufferedRandom + */ + +PyDoc_STRVAR(BufferedRandom_doc, + "A buffered interface to random access streams.\n" + "\n" + "The constructor creates a reader and writer for a seekable stream,\n" + "raw, given in the first argument. If the buffer_size is omitted it\n" + "defaults to DEFAULT_BUFFER_SIZE. max_buffer_size isn't used anymore.\n" + ); + +static int +BufferedRandom_init(BufferedObject *self, PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"raw", "buffer_size", "max_buffer_size", NULL}; + Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; + Py_ssize_t max_buffer_size = -1; + PyObject *raw; + + self->ok = 0; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|nn:BufferedReader", kwlist, + &raw, &buffer_size, &max_buffer_size)) { + return -1; + } + + if (_PyIOBase_checkSeekable(raw, Py_True) == NULL) + return -1; + if (_PyIOBase_checkReadable(raw, Py_True) == NULL) + return -1; + if (_PyIOBase_checkWritable(raw, Py_True) == NULL) + return -1; + + Py_CLEAR(self->raw); + Py_INCREF(raw); + self->raw = raw; + self->buffer_size = buffer_size; + self->readable = 1; + self->writable = 1; + + if (_Buffered_init(self) < 0) + return -1; + _BufferedReader_reset_buf(self); + _BufferedWriter_reset_buf(self); + self->pos = 0; + + self->ok = 1; + return 0; +} + +static PyMethodDef BufferedRandom_methods[] = { + /* BufferedIOMixin methods */ + {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, + {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, + {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, + {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, + {"fileno", (PyCFunction)BufferedIOMixin_fileno, METH_NOARGS}, + {"isatty", (PyCFunction)BufferedIOMixin_isatty, METH_NOARGS}, + + {"flush", (PyCFunction)Buffered_flush, METH_NOARGS}, + + {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, + {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, + {"truncate", (PyCFunction)Buffered_truncate, METH_VARARGS}, + {"read", (PyCFunction)Buffered_read, METH_VARARGS}, + {"read1", (PyCFunction)Buffered_read1, METH_VARARGS}, + {"readinto", (PyCFunction)Buffered_readinto, METH_VARARGS}, + {"peek", (PyCFunction)Buffered_peek, METH_VARARGS}, + {"write", (PyCFunction)BufferedWriter_write, METH_VARARGS}, + {NULL, NULL} +}; + +static PyMemberDef BufferedRandom_members[] = { + {"raw", T_OBJECT, offsetof(BufferedObject, raw), 0}, + {NULL} +}; + +static PyGetSetDef BufferedRandom_getset[] = { + {"closed", (getter)BufferedIOMixin_closed_get, NULL, NULL}, + {"name", (getter)BufferedIOMixin_name_get, NULL, NULL}, + {"mode", (getter)BufferedIOMixin_mode_get, NULL, NULL}, + {0} +}; + + +PyTypeObject PyBufferedRandom_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "BufferedRandom", /*tp_name*/ + sizeof(BufferedObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)BufferedObject_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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + BufferedRandom_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ + 0, /* tp_iter */ + 0, /* tp_iternext */ + BufferedRandom_methods, /* tp_methods */ + BufferedRandom_members, /* tp_members */ + BufferedRandom_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /*tp_dict*/ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(BufferedObject, dict), /*tp_dictoffset*/ + (initproc)BufferedRandom_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ +}; + Modified: python/branches/io-c/Modules/_bytesio.c ============================================================================== --- python/branches/io-c/Modules/_bytesio.c (original) +++ python/branches/io-c/Modules/_bytesio.c Sun Jan 18 00:13:48 2009 @@ -1,4 +1,6 @@ #include "Python.h" +#include "structmember.h" /* for offsetof() */ +#include "_iomodule.h" typedef struct { PyObject_HEAD @@ -6,6 +8,8 @@ Py_ssize_t pos; Py_ssize_t string_size; size_t buf_size; + PyObject *dict; + PyObject *weakreflist; } BytesIOObject; #define CHECK_CLOSED(self) \ @@ -689,7 +693,7 @@ "Create a buffered I/O implementation using an in-memory bytes\n" "buffer, ready for reading and writing."); -static PyTypeObject BytesIO_Type = { +PyTypeObject PyBytesIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) "_bytesio._BytesIO", /*tp_name*/ sizeof(BytesIOObject), /*tp_basicsize*/ @@ -714,7 +718,7 @@ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ + offsetof(BytesIOObject, weakreflist), /*tp_weaklistoffset*/ PyObject_SelfIter, /*tp_iter*/ (iternextfunc)bytesio_iternext, /*tp_iternext*/ bytesio_methods, /*tp_methods*/ @@ -724,36 +728,8 @@ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ + offsetof(BytesIOObject, dict), /*tp_dictoffset*/ (initproc)bytesio_init, /*tp_init*/ 0, /*tp_alloc*/ bytesio_new, /*tp_new*/ }; - - -static struct PyModuleDef _bytesiomodule = { - PyModuleDef_HEAD_INIT, - "_bytesio", - NULL, - -1, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit__bytesio(void) -{ - PyObject *m; - - if (PyType_Ready(&BytesIO_Type) < 0) - return NULL; - m = PyModule_Create(&_bytesiomodule); - if (m == NULL) - return NULL; - Py_INCREF(&BytesIO_Type); - PyModule_AddObject(m, "_BytesIO", (PyObject *)&BytesIO_Type); - return m; -} Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Sun Jan 18 00:13:48 2009 @@ -6,6 +6,7 @@ #include #include #include /* For offsetof */ +#include "_iomodule.h" /* * Known likely problems: @@ -49,6 +50,7 @@ int seekable : 2; /* -1 means unknown */ int closefd : 1; PyObject *weakreflist; + PyObject *dict; } PyFileIOObject; PyTypeObject PyFileIO_Type; @@ -85,14 +87,18 @@ self->fd = -1; Py_RETURN_NONE; } - if (internal_close(self)) + errno = internal_close(self); + if (errno < 0) { + PyErr_SetFromErrno(PyExc_IOError); return NULL; + } - Py_RETURN_NONE; + return PyObject_CallMethod((PyObject*)&PyRawIOBase_Type, + "close", "O", self); } static PyObject * -fileio_new(PyTypeObject *type, PyObject *args, PyObject *kews) +fileio_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyFileIOObject *self; @@ -116,7 +122,7 @@ directories, so we need a check. */ static int -dircheck(PyFileIOObject* self, char *name) +dircheck(PyFileIOObject* self, const char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -144,7 +150,8 @@ { PyFileIOObject *self = (PyFileIOObject *) oself; static char *kwlist[] = {"file", "mode", "closefd", NULL}; - char *name = NULL; + const char *name = NULL; + PyObject *nameobj; char *mode = "r"; char *s; #ifdef MS_WINDOWS @@ -163,40 +170,58 @@ return -1; } - if (PyArg_ParseTupleAndKeywords(args, kwds, "i|si:fileio", - kwlist, &fd, &mode, &closefd)) { - if (fd < 0) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|si:fileio", + kwlist, &nameobj, &mode, &closefd)) + return -1; + + if (PyFloat_Check(nameobj)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float"); + return -1; + } + + fd = PyLong_AsLong(nameobj); + if (fd < 0) { + if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ValueError, "Negative filedescriptor"); return -1; } - } - else { PyErr_Clear(); + } #ifdef Py_WIN_WIDE_FILENAMES - if (GetVersion() < 0x80000000) { + if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ - PyObject *po; - if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:fileio", - kwlist, &po, &mode, &closefd) - ) { - widename = PyUnicode_AS_UNICODE(po); - } else { - /* Drop the argument parsing error as narrow - strings are also valid. */ - PyErr_Clear(); - } - } - if (widename == NULL) -#endif - { - if (!PyArg_ParseTupleAndKeywords(args, kwds, "et|si:fileio", - kwlist, - Py_FileSystemDefaultEncoding, - &name, &mode, &closefd)) - return -1; - } + if (PyUnicode_Check(nameobj)) + widename = PyUnicode_AS_UNICODE(nameobj); + } + if (widename == NULL) +#endif + if (fd < 0) + { + if (PyBytes_Check(nameobj) || PyByteArray_Check(nameobj)) { + if (PyObject_AsCharBuffer(nameobj, &name, NULL) < 0) + return -1; + } + else { + PyObject *s; + PyObject *u = PyUnicode_FromObject(nameobj); + + if (u == NULL) + return -1; + + s = PyUnicode_AsEncodedString( + u, Py_FileSystemDefaultEncoding, NULL); + Py_DECREF(u); + if (s == NULL) + return -1; + if (!PyBytes_Check(s)) { + PyErr_SetString(PyExc_TypeError, + "encoder failed to return bytes"); + } + name = PyBytes_AS_STRING(s); + } } s = mode; @@ -295,13 +320,15 @@ goto error; } + if (PyObject_SetAttrString((PyObject *)self, "name", nameobj) < 0) + goto error; + goto done; error: ret = -1; done: - PyMem_Free(name); return ret; } @@ -316,6 +343,8 @@ PyErr_WriteUnraisable((PyObject*)self); } + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *)self); } @@ -404,6 +433,31 @@ return PyLong_FromSsize_t(n); } +static size_t +new_buffersize(PyFileIOObject *self, size_t currentsize) +{ +#ifdef HAVE_FSTAT + off_t pos, end; + struct stat st; + if (fstat(self->fd, &st) == 0) { + end = st.st_size; + pos = lseek(self->fd, 0L, SEEK_CUR); + if (end >= pos && pos >= 0) + return currentsize + end - pos + 1; + /* Add 1 so if the file were to grow we'd notice. */ + } +#endif + if (currentsize > SMALLCHUNK) { + /* Keep doubling until we reach BIGCHUNK; + then keep adding BIGCHUNK. */ + if (currentsize <= BIGCHUNK) + return currentsize + currentsize; + else + return currentsize + BIGCHUNK; + } + return currentsize + SMALLCHUNK; +} + static PyObject * fileio_readall(PyFileIOObject *self) { @@ -416,17 +470,7 @@ return NULL; while (1) { - Py_ssize_t newsize = (total < SMALLCHUNK) ? SMALLCHUNK : total; - - /* Keep doubling until we reach BIGCHUNK; - then keep adding BIGCHUNK. */ - if (newsize <= BIGCHUNK) { - newsize += newsize; - } - else { - /* NOTE: overflow impossible due to limits on BUFSIZ */ - newsize += BIGCHUNK; - } + Py_ssize_t newsize = new_buffersize(self, total); if (PyBytes_GET_SIZE(result) < newsize) { if (_PyBytes_Resize(&result, newsize) < 0) { @@ -550,12 +594,6 @@ /* XXX Windows support below is likely incomplete */ -#if defined(MS_WIN64) || defined(MS_WINDOWS) -typedef PY_LONG_LONG Py_off_t; -#else -typedef off_t Py_off_t; -#endif - /* Cribbed from posix_lseek() */ static PyObject * portable_lseek(int fd, PyObject *posobj, int whence) @@ -722,9 +760,9 @@ fileio_repr(PyFileIOObject *self) { if (self->fd < 0) - return PyUnicode_FromFormat("_fileio._FileIO(-1)"); + return PyUnicode_FromFormat("io.FileIO(-1)"); - return PyUnicode_FromFormat("_fileio._FileIO(%d, '%s')", + return PyUnicode_FromFormat("io.FileIO(%d, '%s')", self->fd, mode_string(self)); } @@ -866,8 +904,8 @@ }; PyTypeObject PyFileIO_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "_FileIO", + PyVarObject_HEAD_INIT(NULL, 0) + "FileIO", sizeof(PyFileIOObject), 0, (destructor)fileio_dealloc, /* tp_dealloc */ @@ -890,7 +928,7 @@ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ - offsetof(PyFileIOObject, weakreflist), /* tp_weaklistoffset */ + offsetof(PyFileIOObject, weakreflist), /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ fileio_methods, /* tp_methods */ @@ -900,40 +938,9 @@ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ + offsetof(PyFileIOObject, dict), /* tp_dictoffset */ fileio_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ fileio_new, /* tp_new */ PyObject_Del, /* tp_free */ }; - -static PyMethodDef module_methods[] = { - {NULL, NULL} -}; - -static struct PyModuleDef fileiomodule = { - PyModuleDef_HEAD_INIT, - "_fileio", - "Fast implementation of io.FileIO.", - -1, - module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit__fileio(void) -{ - PyObject *m; /* a module object */ - - m = PyModule_Create(&fileiomodule); - if (m == NULL) - return NULL; - if (PyType_Ready(&PyFileIO_Type) < 0) - return NULL; - Py_INCREF(&PyFileIO_Type); - PyModule_AddObject(m, "_FileIO", (PyObject *) &PyFileIO_Type); - return m; -} Added: python/branches/io-c/Modules/_iobase.c ============================================================================== --- (empty file) +++ python/branches/io-c/Modules/_iobase.c Sun Jan 18 00:13:48 2009 @@ -0,0 +1,798 @@ +#include "Python.h" +#include "structmember.h" +#include "_iomodule.h" + +/* + * IOBase class, an abstract class + */ + +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" + "\n" + "This class provides dummy implementations for many methods that\n" + "derived classes can override selectively; the default implementations\n" + "represent a file that cannot be read, written or seeked.\n" + "\n" + "Even though IOBase does not declare read, readinto, or write because\n" + "their signatures will vary, implementations and clients should\n" + "consider those methods part of the interface. Also, implementations\n" + "may raise a IOError when operations they do not support are called.\n" + "\n" + "The basic type used for binary data read from or written to a file is\n" + "bytes. bytearrays are accepted too, and in some cases (such as\n" + "readinto) needed. Text I/O classes work with str data.\n" + "\n" + "Note that calling any method (even inquiries) on a closed stream is\n" + "undefined. Implementations may raise IOError in this case.\n" + "\n" + "IOBase (and its subclasses) support the iterator protocol, meaning\n" + "that an IOBase object can be iterated over yielding the lines in a\n" + "stream.\n" + "\n" + "IOBase also supports the :keyword:`with` statement. In this example,\n" + "fp is closed after the suite of the with statment is complete:\n" + "\n" + "with open('spam.txt', 'r') as fp:\n" + " fp.write('Spam and eggs!')\n"); + +/* Use this macro whenever you want to check the internal `closed` status + of the IOBase object rather than the virtual `closed` attribute as returned + by whatever subclass. */ + +#define IS_CLOSED(self) \ + PyObject_HasAttrString(self, "__IOBase_closed") + +/* Internal methods */ +static PyObject * +IOBase_unsupported(const char *message) +{ + PyErr_SetString(PyIOExc_UnsupportedOperation, message); + return NULL; +} + +/* Positionning */ + +PyDoc_STRVAR(IOBase_seek_doc, + "Change stream position.\n" + "\n" + "Change the stream position to byte offset offset. offset is\n" + "interpreted relative to the position indicated by whence. Values\n" + "for whence are:\n" + "\n" + "* 0 -- start of stream (the default); offset should be zero or positive\n" + "* 1 -- current stream position; offset may be negative\n" + "* 2 -- end of stream; offset is usually negative\n" + "\n" + "Return the new absolute position."); + +static PyObject * +IOBase_seek(PyObject *self, PyObject *args) +{ + return IOBase_unsupported("seek"); +} + +PyDoc_STRVAR(IOBase_tell_doc, + "Return current stream position."); + +static PyObject * +IOBase_tell(PyObject *self, PyObject *args) +{ + return PyObject_CallMethod(self, "seek", "ii", 0, 1); +} + +PyDoc_STRVAR(IOBase_truncate_doc, + "Truncate file to size bytes.\n" + "\n" + "Size defaults to the current IO position as reported by tell(). Return\n" + "the new size."); + +static PyObject * +IOBase_truncate(PyObject *self, PyObject *args) +{ + return IOBase_unsupported("seek"); +} + +/* Flush and close methods */ + +PyDoc_STRVAR(IOBase_flush_doc, + "Flush write buffers, if applicable.\n" + "\n" + "This is not implemented for read-only and non-blocking streams.\n"); + +static PyObject * +IOBase_flush(PyObject *self, PyObject *args) +{ + /* XXX Should this return the number of bytes written??? */ + Py_RETURN_NONE; +} + +PyDoc_STRVAR(IOBase_close_doc, + "Flush and close the IO object.\n" + "\n" + "This method has no effect if the file is already closed.\n"); + +static int +IOBase_closed(PyObject *self) +{ + PyObject *res; + int closed; + /* This gets the derived attribute, which is *not* __IOBase_closed + in most cases! */ + res = PyObject_GetAttr(self, _PyIO_str_closed); + closed = PyObject_IsTrue(res); + Py_DECREF(res); + return closed; +} + +static PyObject * +IOBase_closed_get(PyObject *self, void *context) +{ + return PyBool_FromLong(IS_CLOSED(self)); +} + + +PyObject * +_PyIOBase_checkClosed(PyObject *self, PyObject *args) +{ + if (IOBase_closed(self)) { + PyErr_SetString(PyExc_ValueError, "I/O operation on closed file."); + return NULL; + } + if (args == Py_True) + return Py_None; + else + Py_RETURN_NONE; +} + +/* XXX: IOBase thinks it has to maintain its own internal state in + `__IOBase_closed` and call flush() by itself, but it is redundant with + whatever behaviour a non-trivial derived class will implement. */ + +static PyObject * +IOBase_close(PyObject *self, PyObject *args) +{ + PyObject *res; + + if (IS_CLOSED(self)) + Py_RETURN_NONE; + + res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL); + PyObject_SetAttrString(self, "__IOBase_closed", Py_True); + if (res == NULL) { + /* If flush() fails, just give up */ + if (PyErr_ExceptionMatches(PyExc_IOError)) + PyErr_Clear(); + else + return NULL; + } + Py_XDECREF(res); + Py_RETURN_NONE; +} + +static PyObject * +IOBase_del(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + res = PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); + if (res == NULL) { + /* At program exit time, 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. + * + * XXX: this function can be called at other times and what if the + * error is genuine? + */ + PyErr_Clear(); + } + Py_XDECREF(res); + Py_RETURN_NONE; +} + +/* Inquiry methods */ + +PyDoc_STRVAR(IOBase_seekable_doc, + "Return whether object supports random access.\n" + "\n" + "If False, seek(), tell() and truncate() will raise IOError.\n" + "This method may need to do a test seek()."); + +static PyObject * +IOBase_seekable(PyObject *self, PyObject *args) +{ + Py_RETURN_FALSE; +} + +PyObject * +_PyIOBase_checkSeekable(PyObject *self, PyObject *args) +{ + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_seekable, NULL); + if (res == NULL) + return NULL; + if (res != Py_True) { + Py_CLEAR(res); + PyErr_SetString(PyExc_IOError, "File or stream is not seekable."); + } + if (args == Py_True) { + Py_DECREF(res); + } + return res; +} + +PyDoc_STRVAR(IOBase_readable_doc, + "Return whether object was opened for reading.\n" + "\n" + "If False, read() will raise IOError."); + +static PyObject * +IOBase_readable(PyObject *self, PyObject *args) +{ + Py_RETURN_FALSE; +} + +/* May be called with any object */ +PyObject * +_PyIOBase_checkReadable(PyObject *self, PyObject *args) +{ + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_readable, NULL); + if (res == NULL) + return NULL; + if (res != Py_True) { + Py_CLEAR(res); + PyErr_SetString(PyExc_IOError, "File or stream is not readable."); + } + if (args == Py_True) { + Py_DECREF(res); + } + return res; +} + +PyDoc_STRVAR(IOBase_writable_doc, + "Return whether object was opened for writing.\n" + "\n" + "If False, read() will raise IOError."); + +static PyObject * +IOBase_writable(PyObject *self, PyObject *args) +{ + Py_RETURN_FALSE; +} + +/* May be called with any object */ +PyObject * +_PyIOBase_checkWritable(PyObject *self, PyObject *args) +{ + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_writable, NULL); + if (res == NULL) + return NULL; + if (res != Py_True) { + Py_CLEAR(res); + PyErr_SetString(PyExc_IOError, "File or stream is not writable."); + } + if (args == Py_True) { + Py_DECREF(res); + } + return res; +} + +/* Context manager */ + +static PyObject * +IOBase_enter(PyObject *self, PyObject *args) +{ + if (_PyIOBase_checkClosed(self, Py_True) == NULL) + return NULL; + + Py_INCREF(self); + return self; +} + +static PyObject * +IOBase_exit(PyObject *self, PyObject *args) +{ + return PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); +} + +/* Lower-level APIs */ + +/* XXX Should these be present even if unimplemented? */ + +PyDoc_STRVAR(IOBase_fileno_doc, + "Returns underlying file descriptor if one exists.\n" + "\n" + "An IOError is raised if the IO object does not use a file descriptor.\n"); + +static PyObject * +IOBase_fileno(PyObject *self, PyObject *args) +{ + return IOBase_unsupported("fileno"); +} + +PyDoc_STRVAR(IOBase_isatty_doc, + "Return whether this is an 'interactive' stream.\n" + "\n" + "Return False if it can't be determined.\n"); + +static PyObject * +IOBase_isatty(PyObject *self, PyObject *args) +{ + if (_PyIOBase_checkClosed(self, Py_True) == NULL) + return NULL; + Py_RETURN_FALSE; +} + +/* Readline(s) and writelines */ + +PyDoc_STRVAR(IOBase_readline_doc, + "Read and return a line from the stream.\n" + "\n" + "If limit is specified, at most limit bytes will be read.\n" + "\n" + "The line terminator is always b'\n' for binary files; for text\n" + "files, the newlines argument to open can be used to select the line\n" + "terminator(s) recognized.\n"); + +static PyObject * +IOBase_readline(PyObject *self, PyObject *args) +{ + /* For backwards compatibility, a (slowish) readline(). */ + + Py_ssize_t limit = -1; + int has_peek = 0; + PyObject *buffer, *result; + Py_ssize_t old_size = -1; + + if (!PyArg_ParseTuple(args, "|n:readline", &limit)) { + return NULL; + } + + if (_PyIOBase_checkClosed(self, Py_True) == NULL) + return NULL; + + if (PyObject_HasAttrString(self, "peek")) + has_peek = 1; + + buffer = PyByteArray_FromStringAndSize(NULL, 0); + if (buffer == NULL) + return NULL; + + while (limit < 0 || Py_SIZE(buffer) < limit) { + Py_ssize_t nreadahead = 1; + PyObject *b; + + if (has_peek) { + PyObject *readahead = PyObject_CallMethod(self, "peek", "i", 1); + if (readahead == NULL) + goto fail; + if (!PyBytes_Check(readahead)) { + PyErr_Format(PyExc_IOError, + "peek() should have returned a bytes object, " + "not '%.200s'", Py_TYPE(readahead)->tp_name); + Py_DECREF(readahead); + goto fail; + } + if (PyBytes_GET_SIZE(readahead) > 0) { + Py_ssize_t n = 0; + const char *buf = PyBytes_AS_STRING(readahead); + if (limit >= 0) { + do { + if (n >= PyBytes_GET_SIZE(readahead) || n >= limit) + break; + if (buf[n++] == '\n') + break; + } while (1); + } + else { + do { + if (n >= PyBytes_GET_SIZE(readahead)) + break; + if (buf[n++] == '\n') + break; + } while (1); + } + nreadahead = n; + } + Py_DECREF(readahead); + } + + b = PyObject_CallMethod(self, "read", "n", nreadahead); + if (b == NULL) + goto fail; + if (!PyBytes_Check(b)) { + PyErr_Format(PyExc_IOError, + "read() should have returned a bytes object, " + "not '%.200s'", Py_TYPE(b)->tp_name); + Py_DECREF(b); + goto fail; + } + if (PyBytes_GET_SIZE(b) == 0) { + Py_DECREF(b); + break; + } + + old_size = PyByteArray_GET_SIZE(buffer); + PyByteArray_Resize(buffer, old_size + PyBytes_GET_SIZE(b)); + memcpy(PyByteArray_AS_STRING(buffer) + old_size, + PyBytes_AS_STRING(b), PyBytes_GET_SIZE(b)); + + Py_DECREF(b); + + if (PyByteArray_AS_STRING(buffer)[PyByteArray_GET_SIZE(buffer) - 1] == '\n') + break; + } + + result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(buffer), + PyByteArray_GET_SIZE(buffer)); + Py_DECREF(buffer); + return result; + fail: + Py_DECREF(buffer); + return NULL; +} + +static PyObject * +IOBase_iter(PyObject *self) +{ + if (_PyIOBase_checkClosed(self, Py_True) == NULL) + return NULL; + + Py_INCREF(self); + return self; +} + +static PyObject * +IOBase_iternext(PyObject *self) +{ + PyObject *line = PyObject_CallMethodObjArgs(self, _PyIO_str_readline, NULL); + + if (line == NULL) + return NULL; + + if (PyObject_Size(line) == 0) { + Py_DECREF(line); + return NULL; + } + + return line; +} + +PyDoc_STRVAR(IOBase_readlines_doc, + "Return a list of lines from the stream.\n" + "\n" + "hint can be specified to control the number of lines read: no more\n" + "lines will be read if the total size (in bytes/characters) of all\n" + "lines so far exceeds hint."); + +static PyObject * +IOBase_readlines(PyObject *self, PyObject *args) +{ + Py_ssize_t hint = -1, length = 0; + PyObject *hintobj = Py_None, *result; + + if (!PyArg_ParseTuple(args, "|O:readlines", &hintobj)) { + return NULL; + } + if (hintobj != Py_None) { + hint = PyNumber_AsSsize_t(hintobj, PyExc_ValueError); + if (hint == -1 && PyErr_Occurred()) + return NULL; + } + + result = PyList_New(0); + if (result == NULL) + return NULL; + + if (hint <= 0) { + PyObject *ret = PyObject_CallMethod(result, "extend", "O", self); + if( ret == NULL) { + Py_DECREF(result); + return NULL; + } + Py_DECREF(ret); + return result; + } + + while (1) { + PyObject *line = PyIter_Next(self); + if (line == NULL) { + if (PyErr_Occurred()) { + Py_DECREF(result); + return NULL; + } + else + break; /* SopIteration raised */ + } + + if (PyList_Append(result, line) < 0) { + Py_DECREF(line); + Py_DECREF(result); + return NULL; + } + length += PyObject_Size(line); + Py_DECREF(line); + + if (length > hint) + break; + } + return result; +} + +static PyObject * +IOBase_writelines(PyObject *self, PyObject *args) +{ + PyObject *lines, *iter, *res; + + if (!PyArg_ParseTuple(args, "O:writelines", &lines)) { + return NULL; + } + + if (_PyIOBase_checkClosed(self, Py_True) == NULL) + return NULL; + + iter = PyObject_GetIter(lines); + if (iter == NULL) + return NULL; + + while (1) { + PyObject *line = PyIter_Next(iter); + if(line == NULL) { + if (PyErr_Occurred()) { + Py_DECREF(iter); + return NULL; + } + else + break; /* Stop Iteration */ + } + + res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); + Py_DECREF(line); + if (res == NULL) { + Py_DECREF(iter); + return NULL; + } + Py_DECREF(res); + } + Py_RETURN_NONE; +} + +static PyMethodDef IOBase_methods[] = { + {"seek", IOBase_seek, METH_VARARGS, IOBase_seek_doc}, + {"tell", IOBase_tell, METH_NOARGS, IOBase_tell_doc}, + {"truncate", IOBase_truncate, METH_VARARGS, IOBase_truncate_doc}, + {"flush", IOBase_flush, METH_NOARGS, IOBase_flush_doc}, + {"close", IOBase_close, METH_NOARGS, IOBase_close_doc}, + + {"seekable", IOBase_seekable, METH_NOARGS, IOBase_seekable_doc}, + {"readable", IOBase_readable, METH_NOARGS, IOBase_readable_doc}, + {"writable", IOBase_writable, METH_NOARGS, IOBase_writable_doc}, + + {"_checkClosed", _PyIOBase_checkClosed, METH_NOARGS}, + {"_checkSeekable", _PyIOBase_checkSeekable, METH_NOARGS}, + {"_checkReadable", _PyIOBase_checkReadable, METH_NOARGS}, + {"_checkWritable", _PyIOBase_checkWritable, METH_NOARGS}, + + {"fileno", IOBase_fileno, METH_NOARGS, IOBase_fileno_doc}, + {"isatty", IOBase_isatty, METH_NOARGS, IOBase_isatty_doc}, + + {"__del__", IOBase_del, METH_NOARGS}, + {"__enter__", IOBase_enter, METH_NOARGS}, + {"__exit__", IOBase_exit, METH_VARARGS}, + + {"readline", IOBase_readline, METH_VARARGS, IOBase_readline_doc}, + {"readlines", IOBase_readlines, METH_VARARGS, IOBase_readlines_doc}, + {"writelines", IOBase_writelines, METH_VARARGS}, + + {NULL, NULL} +}; + +static PyGetSetDef IOBase_getset[] = { + {"closed", (getter)IOBase_closed_get, NULL, NULL}, + {0} +}; + + +PyTypeObject PyIOBase_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "IOBase", /*tp_name*/ + 0, /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + IOBase_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + IOBase_iter, /* tp_iter */ + IOBase_iternext, /* tp_iternext */ + IOBase_methods, /* tp_methods */ + 0, /* tp_members */ + IOBase_getset, /* 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 */ + 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 */ +}; + + + +/* + * RawIOBase class, Inherits from IOBase. + */ +PyDoc_STRVAR(RawIOBase_doc, + "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.) +*/ + +static PyObject * +RawIOBase_read(PyObject *self, PyObject *args) +{ + Py_ssize_t n = -1; + PyObject *b, *res; + + if (!PyArg_ParseTuple(args, "|n:read", &n)) { + return NULL; + } + + if (n < 0) + return PyObject_CallMethod(self, "readall", NULL); + + /* TODO: allocate a bytes object directly instead and manually construct + a writable memoryview pointing to it. */ + b = PyByteArray_FromStringAndSize(NULL, n); + if (b == NULL) + return NULL; + + res = PyObject_CallMethodObjArgs(self, _PyIO_str_readinto, b, NULL); + if (res == NULL) { + Py_DECREF(b); + return NULL; + } + + n = PyNumber_AsSsize_t(res, PyExc_ValueError); + Py_DECREF(res); + if (n == -1 && PyErr_Occurred()) { + Py_DECREF(b); + return NULL; + } + + res = PyBytes_FromStringAndSize(PyByteArray_AsString(b), n); + Py_DECREF(b); + return res; +} + + +PyDoc_STRVAR(RawIOBase_readall_doc, + "Read until EOF, using multiple read() call."); + +static PyObject * +RawIOBase_readall(PyObject *self, PyObject *args) +{ + PyObject *b = NULL; + Py_ssize_t cursize = 0; + + while (1) { + Py_ssize_t length; + PyObject *data = PyObject_CallMethod(self, "read", + "i", DEFAULT_BUFFER_SIZE); + + if (!data) { + Py_XDECREF(b); + return NULL; + } + + if (!PyBytes_Check(data)) { + Py_XDECREF(b); + Py_DECREF(data); + PyErr_SetString(PyExc_TypeError, "read() should return bytes"); + return NULL; + } + + length = Py_SIZE(data); + + if (b == NULL) + b = data; + else if (length != 0) { + + _PyBytes_Resize(&b, cursize + length); + if (b == NULL) { + Py_DECREF(data); + return NULL; + } + + memcpy(PyBytes_AS_STRING(b) + cursize, + PyBytes_AS_STRING(data), length); + Py_DECREF(data); + } + + if (length == 0) + break; + } + + return b; + +} + +static PyMethodDef RawIOBase_methods[] = { + {"read", RawIOBase_read, METH_VARARGS}, + {"readall", RawIOBase_readall, METH_NOARGS, RawIOBase_readall_doc}, + {NULL, NULL} +}; + +PyTypeObject PyRawIOBase_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "RawIOBase", /*tp_name*/ + 0, /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + RawIOBase_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + RawIOBase_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyIOBase_Type, /* 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 */ +}; Added: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- (empty file) +++ python/branches/io-c/Modules/_iomodule.h Sun Jan 18 00:13:48 2009 @@ -0,0 +1,117 @@ +/* + * Temporarily rename symbols, to avoid mismatches with the main executable + */ +#define PyRawIOBase_Type _newio_PyRawIOBase_Type +#define PyFileIO_Type _newio_PyFileIO_Type +#define PyBytesIO_Type _newio_PyBytesIO_Type +#define PyIOBase_Type _newio_PyIOBase_Type +#define PyRawIOBase_Type _newio_PyRawIOBase_Type +#define PyBufferedIOBase_Type _newio_PyBufferedIOBase_Type +#define PyBufferedReader_Type _newio_PyBufferedReader_Type +#define PyBufferedWriter_Type _newio_PyBufferedWriter_Type +#define PyBufferedRWPair_Type _newio_PyBufferedRWPair_Type +#define PyBufferedRandom_Type _newio_PyBufferedRandom_Type +#define PyTextIOWrapper_Type _newio_PyTextIOWrapper_Type +#define PyIncrementalNewlineDecoder_Type _newio_PyIncrementalNewlineDecoder_Type + +/* + * Declarations shared between the different parts of the io module + */ + +extern PyTypeObject PyFileIO_Type; +extern PyTypeObject PyBytesIO_Type; +extern PyTypeObject PyIOBase_Type; +extern PyTypeObject PyRawIOBase_Type; +extern PyTypeObject PyBufferedIOBase_Type; +extern PyTypeObject PyBufferedReader_Type; +extern PyTypeObject PyBufferedWriter_Type; +extern PyTypeObject PyBufferedRWPair_Type; +extern PyTypeObject PyBufferedRandom_Type; +extern PyTypeObject PyTextIOWrapper_Type; +extern PyTypeObject PyIncrementalNewlineDecoder_Type; + +/* These functions are used as METH_NOARGS methods, are normally called + * with args=NULL, and return a new reference. + * BUT when args=Py_True is passed, they return a borrowed reference. + */ +extern PyObject* _PyIOBase_checkReadable(PyObject *self, PyObject *args); +extern PyObject* _PyIOBase_checkWritable(PyObject *self, PyObject *args); +extern PyObject* _PyIOBase_checkSeekable(PyObject *self, PyObject *args); +extern PyObject* _PyIOBase_checkClosed(PyObject *self, PyObject *args); + +extern PyObject* PyIOExc_UnsupportedOperation; + +#define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */ + +typedef struct { + PyException_HEAD + PyObject *myerrno; + PyObject *strerror; + PyObject *filename; /* Not used, but part of the IOError object */ + Py_ssize_t written; +} PyBlockingIOErrorObject; +PyObject *PyExc_BlockingIOError; + + +/* + * Offset type for positioning. + */ + +#if defined(MS_WIN64) || defined(MS_WINDOWS) + +/* Windows uses long long for offsets */ +typedef PY_LONG_LONG Py_off_t; +# define PyLong_AsOff_t PyLong_AsLongLong +# define PyLong_FromOff_t PyLong_FromLongLong +# define PY_OFF_T_MAX PY_LLONG_MAX +# define PY_OFF_T_MIN PY_LLONG_MIN + +#else + +/* Other platforms use off_t */ +typedef off_t Py_off_t; +#if (SIZEOF_OFF_T == SIZEOF_SIZE_T) +# define PyLong_AsOff_t PyLong_AsSsize_t +# define PyLong_FromOff_t PyLong_FromSsize_t +# define PY_OFF_T_MAX PY_SSIZE_T_MAX +# define PY_OFF_T_MIN PY_SSIZE_T_MIN +#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG) +# define PyLong_AsOff_t PyLong_AsLongLong +# define PyLong_FromOff_t PyLong_FromLongLong +# define PY_OFF_T_MAX PY_LLONG_MAX +# define PY_OFF_T_MIN PY_LLONG_MIN +#elif (SIZEOF_OFF_T == SIZEOF_LONG) +# define PyLong_AsOff_t PyLong_AsLong +# define PyLong_FromOff_t PyLong_FromLong +# define PY_OFF_T_MAX LONG_MAX +# define PY_OFF_T_MIN LONG_MIN +#else +# error off_t does not match either size_t, long, or long long! +#endif + +#endif + +extern Py_off_t PyNumber_AsOff_t(PyObject *item, PyObject *err); + +/* Implementation details */ + +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_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; Added: python/branches/io-c/Modules/_textio.c ============================================================================== --- (empty file) +++ python/branches/io-c/Modules/_textio.c Sun Jan 18 00:13:48 2009 @@ -0,0 +1,2185 @@ +#include "Python.h" +#include "structmember.h" +#include "_iomodule.h" + +/* TextIOBase */ + +PyDoc_STRVAR(TextIOBase_doc, + "Base class for text I/O.\n" + "\n" + "This class provides a character and line based interface to stream\n" + "I/O. There is no readinto method because Python's character strings\n" + "are immutable. There is no public constructor.\n" + ); + +static PyObject * +_unsupported(const char *message) +{ + PyErr_SetString(PyIOExc_UnsupportedOperation, message); + return NULL; +} + +static PyObject * +TextIOBase_read(PyObject *self, PyObject *args) +{ + return _unsupported("read"); +} + +static PyObject * +TextIOBase_write(PyObject *self, PyObject *args) +{ + return _unsupported("read"); +} + +static PyObject * +TextIOBase_readline(PyObject *self, PyObject *args) +{ + return _unsupported("read"); +} + +/* XXX properties: encoding, newlines */ + + +/* IncrementalNewlineDecoder */ + +PyDoc_STRVAR(IncrementalNewlineDecoder_doc, + "Codec used when reading a file in universal newlines mode. It wraps\n" + "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" + ); + +typedef struct { + PyObject_HEAD + PyObject *decoder; + PyObject *errors; + int pendingcr:1; + int translate:1; + unsigned int seennl:3; +} PyNewLineDecoderObject; + +static int +IncrementalNewlineDecoder_init(PyNewLineDecoderObject *self, + PyObject *args, PyObject *kwds) +{ + PyObject *decoder; + int translate; + PyObject *errors = NULL; + char *kwlist[] = {"decoder", "translate", "errors", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi|O:IncrementalNewlineDecoder", + kwlist, &decoder, &translate, &errors)) + return -1; + + self->decoder = decoder; + Py_INCREF(decoder); + + if (errors == NULL) { + self->errors = PyUnicode_FromString("strict"); + if (self->errors == NULL) + return -1; + } + else { + Py_INCREF(errors); + self->errors = errors; + } + + self->translate = translate; + self->seennl = 0; + self->pendingcr = 0; + + return 0; +} + +static void +IncrementalNewlineDecoder_dealloc(PyNewLineDecoderObject *self) +{ + Py_CLEAR(self->decoder); + Py_CLEAR(self->errors); + Py_TYPE(self)->tp_free((PyObject *)self); +} + +#define SEEN_CR 1 +#define SEEN_LF 2 +#define SEEN_CRLF 4 +#define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF) + +static PyObject * +_IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, + PyObject *input, int final) +{ + PyObject *output; + Py_ssize_t output_len; + + if (self->decoder == NULL) { + PyErr_SetString(PyExc_ValueError, + "IncrementalNewlineDecoder.__init__ not called"); + return NULL; + } + + /* 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 (output == NULL) + return NULL; + + if (!PyUnicode_Check(output)) { + PyErr_SetString(PyExc_TypeError, + "decoder should return a string result"); + goto error; + } + + output_len = PyUnicode_GET_SIZE(output); + if (self->pendingcr && (final || output_len > 0)) { + Py_UNICODE *out; + PyObject *modified = PyUnicode_FromUnicode(NULL, output_len + 1); + if (modified == NULL) + goto error; + out = PyUnicode_AS_UNICODE(modified); + out[0] = '\r'; + memcpy(out + 1, PyUnicode_AS_UNICODE(output), + output_len * sizeof(Py_UNICODE)); + Py_DECREF(output); + output = modified; + self->pendingcr = 0; + output_len++; + } + + /* retain last \r even when not translating data: + * then readline() is sure to get \r\n in one pass + */ + if (!final) { + if (output_len > 0 + && PyUnicode_AS_UNICODE(output)[output_len - 1] == '\r') { + + if (Py_REFCNT(output) == 1) { + if (PyUnicode_Resize(&output, output_len - 1) < 0) + goto error; + } + else { + PyObject *modified = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(output), + output_len - 1); + if (modified == NULL) + goto error; + Py_DECREF(output); + output = modified; + } + self->pendingcr = 1; + } + } + + /* Record which newlines are read and do newline translation if desired, + all in one pass. */ + { + Py_UNICODE *in_str; + Py_ssize_t len; + int seennl = self->seennl; + int only_lf; + + in_str = PyUnicode_AS_UNICODE(output); + len = PyUnicode_GET_SIZE(output); + + if (len == 0) + return output; + + /* If, up to now, newlines are consistently \n, do a quick check + for the \r *byte* with the libc's optimized memchr. + */ + only_lf = ((seennl == SEEN_LF) + && !memchr(in_str, '\r', len * sizeof(Py_UNICODE))); + + if (!self->translate) { + Py_UNICODE *s, *end; + if (seennl == SEEN_ALL) + goto endscan; + if (only_lf) + goto endscan; + s = in_str; + end = in_str + len; + for (;;) { + Py_UNICODE c; + /* Fast loop for non-control characters */ + while (*s > '\r') + s++; + c = *s++; + if (c == '\n') + seennl |= SEEN_LF; + else if (c == '\r') { + if (*s == '\n') { + seennl |= SEEN_CRLF; + s++; + } + else + seennl |= SEEN_CR; + } + if (s > end) + break; + if (seennl == SEEN_ALL) + break; + } + endscan: + ; + } + else if (!only_lf) { + PyObject *translated = NULL; + Py_UNICODE *out_str; + Py_UNICODE *in, *out, *end; + if (Py_REFCNT(output) != 1) { + /* We could try to optimize this so that we only do a copy + when there is something to translate. On the other hand, + most decoders should only output non-shared strings, i.e. + translation is done in place. */ + translated = PyUnicode_FromUnicode(NULL, len); + if (translated == NULL) + goto error; + assert(Py_REFCNT(translated) == 1); + memcpy(PyUnicode_AS_UNICODE(translated), + PyUnicode_AS_UNICODE(output), + len * sizeof(Py_UNICODE)); + } + else { + translated = output; + } + out_str = PyUnicode_AS_UNICODE(translated); + in = in_str; + out = out_str; + end = in_str + len; + for (;;) { + Py_UNICODE c; + /* Fast loop for non-control characters */ + while ((c = *in++) > '\r') + *out++ = c; + if (c == '\n') { + *out++ = c; + seennl |= SEEN_LF; + continue; + } + if (c == '\r') { + if (*in == '\n') { + in++; + seennl |= SEEN_CRLF; + } + else + seennl |= SEEN_CR; + *out++ = '\n'; + continue; + } + if (in > end) + break; + *out++ = c; + } + if (translated != output) { + Py_DECREF(output); + output = translated; + } + if (out - out_str != len) { + if (PyUnicode_Resize(&output, out - out_str) < 0) + goto error; + } + } + self->seennl |= seennl; + } + + return output; + + error: + Py_DECREF(output); + return NULL; +} + +static PyObject * +IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, + PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"input", "final", NULL}; + PyObject *input; + int final = 0; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i:IncrementalNewlineDecoder", + kwlist, &input, &final)) + return NULL; + return _IncrementalNewlineDecoder_decode(self, input, final); +} + +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)) { + Py_DECREF(state); + return NULL; + } + Py_INCREF(buffer); + Py_DECREF(state); + flag <<= 1; + if (self->pendingcr) + flag |= 1; + return Py_BuildValue("NK", buffer, flag); +} + +static PyObject * +IncrementalNewlineDecoder_setstate(PyNewLineDecoderObject *self, PyObject *state) +{ + PyObject *buffer; + unsigned PY_LONG_LONG flag; + + if (!PyArg_Parse(state, "(OK)", &buffer, &flag)) + return NULL; + + self->pendingcr = (int) flag & 1; + flag >>= 1; + + return PyObject_CallMethod(self->decoder, "setstate", "((OK))", buffer, flag); +} + +static PyObject * +IncrementalNewlineDecoder_reset(PyNewLineDecoderObject *self, PyObject *args) +{ + self->seennl = 0; + self->pendingcr = 0; + return PyObject_CallMethod(self->decoder, "reset", NULL); +} + +static PyObject * +IncrementalNewlineDecoder_newlines_get(PyNewLineDecoderObject *self, void *context) +{ + switch (self->seennl) { + case SEEN_CR: + return PyUnicode_FromString("\r"); + case SEEN_LF: + return PyUnicode_FromString("\n"); + case SEEN_CRLF: + return PyUnicode_FromString("\r\n"); + case SEEN_CR | SEEN_LF: + return Py_BuildValue("ss", "\r", "\n"); + case SEEN_CR | SEEN_CRLF: + return Py_BuildValue("ss", "\r", "\r\n"); + case SEEN_LF | SEEN_CRLF: + return Py_BuildValue("ss", "\n", "\r\n"); + case SEEN_CR | SEEN_LF | SEEN_CRLF: + return Py_BuildValue("sss", "\r", "\n", "\r\n"); + default: + Py_RETURN_NONE; + } + +} + + +static PyMethodDef IncrementalNewlineDecoder_methods[] = { + {"decode", (PyCFunction)IncrementalNewlineDecoder_decode, METH_VARARGS|METH_KEYWORDS}, + {"getstate", (PyCFunction)IncrementalNewlineDecoder_getstate, METH_NOARGS}, + {"setstate", (PyCFunction)IncrementalNewlineDecoder_setstate, METH_O}, + {"reset", (PyCFunction)IncrementalNewlineDecoder_reset, METH_NOARGS}, + {0} +}; + +static PyGetSetDef IncrementalNewlineDecoder_getset[] = { + {"newlines", (getter)IncrementalNewlineDecoder_newlines_get, NULL, NULL}, + {0} +}; + +PyTypeObject PyIncrementalNewlineDecoder_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "IncrementalNewlineDecoder", /*tp_name*/ + sizeof(PyNewLineDecoderObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)IncrementalNewlineDecoder_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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + IncrementalNewlineDecoder_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /*tp_weaklistoffset*/ + 0, /* tp_iter */ + 0, /* tp_iternext */ + IncrementalNewlineDecoder_methods, /* tp_methods */ + 0, /* tp_members */ + IncrementalNewlineDecoder_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)IncrementalNewlineDecoder_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ +}; + + +/* TextIOWrapper */ + +PyDoc_STRVAR(TextIOWrapper_doc, + "Character and line based layer over a BufferedIOBase object, buffer.\n" + "\n" + "encoding gives the name of the encoding that the stream will be\n" + "decoded or encoded with. It defaults to locale.getpreferredencoding.\n" + "\n" + "errors determines the strictness of encoding and decoding (see the\n" + "codecs.register) and defaults to \"strict\".\n" + "\n" + "newline can be None, '', '\\n', '\\r', or '\\r\\n'. It controls the\n" + "handling of line endings. If it is None, universal newlines is\n" + "enabled. With this enabled, on input, the lines endings '\\n', '\\r',\n" + "or '\\r\\n' are translated to '\\n' before being returned to the\n" + "caller. Conversely, on output, '\\n' is translated to the system\n" + "default line seperator, os.linesep. If newline is any other of its\n" + "legal values, that newline becomes the newline when the file is read\n" + "and it is returned untranslated. On output, '\\n' is converted to the\n" + "newline.\n" + "\n" + "If line_buffering is True, a call to flush is implied when a call to\n" + "write contains a newline character." + ); + +typedef PyObject * + (*encodefunc_t)(PyObject *, PyObject *); + +typedef struct +{ + PyObject_HEAD + int ok; /* initialized? */ + Py_ssize_t chunk_size; + PyObject *buffer; + PyObject *encoding; + PyObject *encoder; + PyObject *decoder; + 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; + /* Specialized encoding func (see below) */ + encodefunc_t encodefunc; + + /* Reads and writes are internally buffered in order to speed things up. + However, any read will first flush the write buffer if itsn't empty. + + Please also note that text to be written is first encoded before being + buffered. This is necessary so that encoding errors are immediately + reported to the caller, but it unfortunately means that the + IncrementalEncoder (whose encode() method is always written in Python) + becomes a bottleneck for small writes. + */ + PyObject *decoded_chars; /* buffer for text returned from decoder */ + Py_ssize_t decoded_chars_used; /* offset into _decoded_chars for read() */ + PyObject *pending_bytes; /* list of bytes objects waiting to be + written, or NULL */ + Py_ssize_t pending_bytes_count; + PyObject *snapshot; + /* 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(). + */ + + PyObject *weakreflist; + PyObject *dict; +} PyTextIOWrapperObject; + + +/* A couple of specialized cases in order to bypass the slow incremental + encoding methods for the most popular encodings. */ + +static PyObject * +ascii_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors)); +} + +static PyObject * +utf16be_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 1); +} + +static PyObject * +utf16le_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), -1); +} + +static PyObject * +utf16_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + PyObject *res; + res = PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 0); + if (res == NULL) + return NULL; + /* Next writes will skip the BOM and use native byte ordering */ +#if defined(WORDS_BIGENDIAN) + self->encodefunc = (encodefunc_t) utf16be_encode; +#else + self->encodefunc = (encodefunc_t) utf16le_encode; +#endif + return res; +} + + +static PyObject * +utf8_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors)); +} + +static PyObject * +latin1_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors)); +} + +/* Map normalized encoding names onto the specialized encoding funcs */ + +typedef struct { + const char *name; + encodefunc_t encodefunc; +} encodefuncentry; + +encodefuncentry encodefuncs[] = { + {"ascii", (encodefunc_t) ascii_encode}, + {"iso8859-1", (encodefunc_t) latin1_encode}, + {"utf-16-be", (encodefunc_t) utf16be_encode}, + {"utf-16-le", (encodefunc_t) utf16le_encode}, + {"utf-16", (encodefunc_t) utf16_encode}, + {"utf-8", (encodefunc_t) utf8_encode}, + {NULL, NULL} +}; + + +static int +TextIOWrapper_init(PyTextIOWrapperObject *self, PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"buffer", "encoding", "errors", + "newline", "line_buffering", + NULL}; + PyObject *buffer; + char *encoding = NULL; + char *errors = NULL; + char *newline = NULL; + int line_buffering = 0; + + PyObject *res; + int r; + + self->ok = 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|zzzi:fileio", + kwlist, &buffer, &encoding, &errors, + &newline, &line_buffering)) + 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; + } + + Py_CLEAR(self->buffer); + Py_CLEAR(self->encoding); + Py_CLEAR(self->encoder); + Py_CLEAR(self->decoder); + Py_CLEAR(self->readnl); + Py_CLEAR(self->decoded_chars); + Py_CLEAR(self->pending_bytes); + Py_CLEAR(self->snapshot); + Py_CLEAR(self->errors); + self->decoded_chars_used = 0; + self->pending_bytes_count = 0; + self->encodefunc = NULL; + + if (encoding == NULL) { + /* 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(); + else { + os = PyImport_ImportModule("os"); + if (os == NULL) { + Py_DECREF(fileno); + goto error; + } + self->encoding = PyObject_CallMethod(os, "device_encoding", + "N", fileno); + Py_DECREF(os); + if (self->encoding == NULL) + goto error; + else if (!PyUnicode_Check(self->encoding)) + Py_CLEAR(self->encoding); + } + } + if (encoding == NULL && self->encoding == NULL) { + /* try locale.getpreferredencoding() */ + PyObject *locale = PyImport_ImportModule("locale"); + if (locale == NULL) { + PyErr_Clear(); + self->encoding = PyUnicode_FromString("ascii"); + } + else { + self->encoding = PyObject_CallMethod( + locale, "getpreferredencoding", NULL); + Py_DECREF(locale); + if (self->encoding == NULL) + goto error; + if (!PyUnicode_Check(self->encoding)) + Py_CLEAR(self->encoding); + } + } + if (self->encoding != NULL) + encoding = _PyUnicode_AsString(self->encoding); + else if (encoding != NULL) { + self->encoding = PyUnicode_FromString(encoding); + if (self->encoding == NULL) + goto error; + } + else { + PyErr_SetString(PyExc_IOError, + "could not determine default encoding"); + } + + if (errors == NULL) + errors = "strict"; + self->errors = PyBytes_FromString(errors); + if (self->errors == NULL) + goto error; + + self->chunk_size = 8192; + self->readuniversal = (newline == NULL || newline[0] == '\0'); + self->line_buffering = line_buffering; + self->readtranslate = (newline == NULL); + if (newline) + self->readnl = PyUnicode_FromString(newline); + self->writetranslate = (newline == NULL || newline[0] != '\0'); + if (!self->readuniversal && self->readnl) { + self->writenl = _PyUnicode_AsString(self->readnl); + if (!strcmp(self->writenl, "\n")) + self->writenl = NULL; + } +#ifdef MS_WINDOWS + else + self->writenl = "\r\n"; +#endif + + /* Build the decoder object */ + res = PyObject_CallMethod(buffer, "readable", NULL); + if (res == NULL) + goto error; + r = PyObject_IsTrue(res); + Py_DECREF(res); + if (r == -1) + goto error; + if (r == 1) { + self->decoder = PyCodec_IncrementalDecoder( + encoding, errors); + if (self->decoder == NULL) + goto error; + + if (self->readuniversal) { + PyObject *incrementalDecoder = PyObject_CallFunction( + (PyObject *)&PyIncrementalNewlineDecoder_Type, + "Oi", self->decoder, (int)self->readtranslate); + if (incrementalDecoder == NULL) + goto error; + Py_CLEAR(self->decoder); + self->decoder = incrementalDecoder; + } + } + + /* Build the encoder object */ + res = PyObject_CallMethod(buffer, "writable", NULL); + if (res == NULL) + goto error; + r = PyObject_IsTrue(res); + Py_DECREF(res); + if (r == -1) + goto error; + if (r == 1) { + PyObject *ci; + self->encoder = PyCodec_IncrementalEncoder( + encoding, errors); + if (self->encoder == NULL) + goto error; + /* Get the normalized named of the codec */ + ci = _PyCodec_Lookup(encoding); + if (ci == NULL) + goto error; + res = PyObject_GetAttrString(ci, "name"); + Py_DECREF(ci); + if (res == NULL) + PyErr_Clear(); + else if (PyUnicode_Check(res)) { + encodefuncentry *e = encodefuncs; + while (e->name != NULL) { + if (!PyUnicode_CompareWithASCIIString(res, e->name)) { + self->encodefunc = e->encodefunc; + break; + } + e++; + } + } + Py_XDECREF(res); + } + + self->buffer = buffer; + Py_INCREF(buffer); + + res = PyObject_CallMethod(buffer, "seekable", NULL); + if (res == NULL) + goto error; + self->seekable = self->telling = PyObject_IsTrue(res); + Py_DECREF(res); + + self->ok = 1; + return 0; + + error: + return -1; +} + +static void +TextIOWrapper_dealloc(PyTextIOWrapperObject *self) +{ + PyObject *res; + /* XXX this is inelegant */ + if (Py_TYPE(self)->tp_del == NULL && self->ok) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + /* We need to resurrect the object as calling close() can invoke + arbitrary code. */ + ((PyObject *) self)->ob_refcnt++; + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, + NULL); + if (res == NULL) { + /* XXX dump exception on terminal? + But IOBase.__del__ prefers to remain silent... */ + PyErr_Clear(); + } + Py_XDECREF(res); + PyErr_Restore(tp, v, tb); + if (--((PyObject *) self)->ob_refcnt != 0) + return; + } + self->ok = 0; + Py_CLEAR(self->buffer); + Py_CLEAR(self->encoding); + Py_CLEAR(self->encoder); + Py_CLEAR(self->decoder); + Py_CLEAR(self->readnl); + Py_CLEAR(self->decoded_chars); + Py_CLEAR(self->snapshot); + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *)self); + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *)self); +} + +static PyObject * +TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context); + +/* This macro takes some shortcuts to make the common case faster. We could + specialize even more, by detecting that the underlying buffer is a + BufferedObject. */ +#define CHECK_CLOSED(self) \ + do { \ + int r; \ + PyObject *_res; \ + if (Py_TYPE(self) == &PyTextIOWrapper_Type) { \ + _res = TextIOWrapper_closed_get(self, NULL); \ + if (_res == NULL) \ + return NULL; \ + r = PyObject_IsTrue(_res); \ + Py_DECREF(_res); \ + if (r < 0) \ + return NULL; \ + if (r > 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on closed file."); \ + return NULL; \ + } \ + } \ + else if (_PyIOBase_checkClosed((PyObject *)self, Py_True) == NULL) \ + return NULL; \ + } while (0) + +#define CHECK_INITIALIZED(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return NULL; \ + } + +#define CHECK_INITIALIZED_INT(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return -1; \ + } + + +Py_LOCAL_INLINE(const Py_UNICODE *) +findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) +{ + /* like wcschr, but doesn't stop at NULL characters */ + while (size-- > 0) { + if (*s == ch) + return s; + s++; + } + return NULL; +} + +/* Flush the internal write buffer. This doesn't explicitly flush the + underlying buffered object, though. */ +static int +_TextIOWrapper_writeflush(PyTextIOWrapperObject *self) +{ + PyObject *b, *ret; + + if (self->pending_bytes == NULL) + return 0; + b = _PyBytes_Join(PyBytes_FromStringAndSize(NULL, 0), self->pending_bytes); + if (b == NULL) + return -1; + ret = PyObject_CallMethodObjArgs(self->buffer, + _PyIO_str_write, b, NULL); + Py_DECREF(b); + if (ret == NULL) + return -1; + Py_DECREF(ret); + Py_CLEAR(self->pending_bytes); + self->pending_bytes_count = 0; + return 0; +} + +static PyObject * +TextIOWrapper_write(PyTextIOWrapperObject *self, PyObject *args) +{ + PyObject *ret; + PyObject *text; /* owned reference */ + PyObject *b; + Py_ssize_t textlen; + int haslf = 0; + int needflush = 0; + + CHECK_INITIALIZED(self); + + if (!PyArg_ParseTuple(args, "U:write", &text)) { + return NULL; + } + + CHECK_CLOSED(self); + + Py_INCREF(text); + + textlen = PyUnicode_GetSize(text); + + if ((self->writetranslate && self->writenl != NULL) || self->line_buffering) + if (findchar(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), '\n')) + haslf = 1; + + if (haslf && self->writetranslate && self->writenl != NULL) { + PyObject *newtext = PyObject_CallMethod( + text, "replace", "ss", "\n", self->writenl); + Py_DECREF(text); + if (newtext == NULL) + return NULL; + text = newtext; + } + + if (self->line_buffering && + (haslf || + findchar(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), '\r'))) + needflush = 1; + + /* XXX What if we were just reading? */ + if (self->encodefunc != NULL) + b = (*self->encodefunc)((PyObject *) self, text); + else + b = PyObject_CallMethodObjArgs(self->encoder, + _PyIO_str_encode, text, NULL); + Py_DECREF(text); + if (b == NULL) + return NULL; + + if (self->pending_bytes == NULL) { + self->pending_bytes = PyList_New(0); + if (self->pending_bytes == NULL) { + Py_DECREF(b); + return NULL; + } + self->pending_bytes_count = 0; + } + if (PyList_Append(self->pending_bytes, b) < 0) { + Py_DECREF(b); + return NULL; + } + self->pending_bytes_count += PyBytes_GET_SIZE(b); + Py_DECREF(b); + if (self->pending_bytes_count > self->chunk_size || needflush) { + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + } + + if (needflush) { + ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_flush, NULL); + if (ret == NULL) + return NULL; + Py_DECREF(ret); + } + + Py_CLEAR(self->snapshot); + + if (self->decoder) { + ret = PyObject_CallMethod(self->decoder, "reset", NULL); + if (ret == NULL) + return NULL; + Py_DECREF(ret); + } + + return PyLong_FromSsize_t(textlen); +} + +/* Steal a reference to chars and store it in the decoded_char buffer; + */ +static void +TextIOWrapper_set_decoded_chars(PyTextIOWrapperObject *self, PyObject *chars) +{ + Py_CLEAR(self->decoded_chars); + self->decoded_chars = chars; + self->decoded_chars_used = 0; +} + +static PyObject * +TextIOWrapper_get_decoded_chars(PyTextIOWrapperObject *self, Py_ssize_t n) +{ + PyObject *chars; + Py_ssize_t avail; + + if (self->decoded_chars == NULL) + return PyUnicode_FromStringAndSize(NULL, 0); + + avail = (PyUnicode_GET_SIZE(self->decoded_chars) + - self->decoded_chars_used); + + assert(avail >= 0); + + if (n < 0 || n > avail) + n = avail; + + if (self->decoded_chars_used > 0 || n < avail) { + chars = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(self->decoded_chars) + + self->decoded_chars_used, n); + if (chars == NULL) + return NULL; + } + else { + chars = self->decoded_chars; + Py_INCREF(chars); + } + + self->decoded_chars_used += n; + return chars; +} + +/* Rewind the _decoded_chars buffer. */ +static int +TextIOWrapper_rewind_decoded_chars(PyTextIOWrapperObject *self, Py_ssize_t n) +{ + if (self->decoded_chars_used < n) { + PyErr_SetString(PyExc_ValueError, + "rewind decoded_chars out of bounds"); + return -1; + } + self->decoded_chars_used -= n; + return self->decoded_chars_used; +} + +static Py_ssize_t +TextIOWrapper_decoded_chars_length(PyTextIOWrapperObject *self, Py_ssize_t n) +{ + if (self->decoded_chars == NULL) + return 0; + return PyUnicode_GetSize(self->decoded_chars) - self->decoded_chars_used; +} + + +/* Read and decode the next chunk of data from the BufferedReader. + */ +static int +TextIOWrapper_read_chunk(PyTextIOWrapperObject *self) +{ + PyObject *dec_buffer = NULL; + PyObject *dec_flags = NULL; + PyObject *input_chunk = NULL; + PyObject *decoded_chars, *chunk_size; + int eof; + + /* 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 == NULL) { + PyErr_SetString(PyExc_ValueError, "no decoder"); + return -1; + } + + if (self->telling) { + /* To prepare for tell(), we need to snapshot a point in the file + * where the decoder's input buffer is empty. + */ + + PyObject *state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); + if (state == NULL) + return -1; + /* Given this, we know there was a valid snapshot point + * len(dec_buffer) bytes ago with decoder state (b'', dec_flags). + */ + if (PyArg_Parse(state, "(OO)", &dec_buffer, &dec_flags) < 0) { + Py_DECREF(state); + return -1; + } + Py_INCREF(dec_buffer); + Py_INCREF(dec_flags); + Py_DECREF(state); + } + + /* Read a chunk, decode it, and put the result in self._decoded_chars. */ + chunk_size = PyLong_FromSsize_t(self->chunk_size); + if (chunk_size == NULL) + goto fail; + input_chunk = PyObject_CallMethodObjArgs(self->buffer, + _PyIO_str_read1, chunk_size, NULL); + Py_DECREF(chunk_size); + if (input_chunk == NULL) + goto fail; + assert(PyBytes_Check(input_chunk)); + + eof = (PyBytes_Size(input_chunk) == 0); + + if (Py_TYPE(self->decoder) == &PyIncrementalNewlineDecoder_Type) { + decoded_chars = _IncrementalNewlineDecoder_decode( + (PyNewLineDecoderObject *) self->decoder, input_chunk, eof); + } + else { + decoded_chars = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_decode, input_chunk, eof ? Py_True : Py_False, NULL); + } + + /* TODO sanity check: isinstance(decoded_chars, unicode) */ + if (decoded_chars == NULL) + goto fail; + TextIOWrapper_set_decoded_chars(self, decoded_chars); + if (PyUnicode_GET_SIZE(decoded_chars) > 0) + eof = 0; + + 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. + */ + PyObject *next_input = PyNumber_Add(dec_buffer, input_chunk); + if (next_input == NULL) + goto fail; + assert (PyBytes_Check(next_input)); + Py_DECREF(dec_buffer); + Py_CLEAR(self->snapshot); + self->snapshot = Py_BuildValue("NN", dec_flags, next_input); + } + Py_DECREF(input_chunk); + + return (eof == 0); + + fail: + Py_XDECREF(dec_buffer); + Py_XDECREF(dec_flags); + Py_XDECREF(input_chunk); + return -1; +} + +static PyObject * +TextIOWrapper_read(PyTextIOWrapperObject *self, PyObject *args) +{ + Py_ssize_t n = -1; + PyObject *result = NULL, *chunks = NULL; + + CHECK_INITIALIZED(self); + + if (!PyArg_ParseTuple(args, "|n:read", &n)) + return NULL; + + CHECK_CLOSED(self); + + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + + if (n < 0) { + /* Read everything */ + PyObject *bytes = PyObject_CallMethod(self->buffer, "read", NULL); + PyObject *decoded; + if (bytes == NULL) + goto fail; + decoded = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, + bytes, Py_True, NULL); + Py_DECREF(bytes); + if (decoded == NULL) + goto fail; + + result = TextIOWrapper_get_decoded_chars(self, -1); + + if (result == NULL) { + Py_DECREF(decoded); + return NULL; + } + + PyUnicode_AppendAndDel(&result, decoded); + if (result == NULL) + goto fail; + + Py_CLEAR(self->snapshot); + return result; + } + else { + int res = 1; + Py_ssize_t remaining = n; + + result = TextIOWrapper_get_decoded_chars(self, n); + if (result == NULL) + goto fail; + remaining -= PyUnicode_GET_SIZE(result); + + /* Keep reading chunks until we have n characters to return */ + while (remaining > 0) { + res = TextIOWrapper_read_chunk(self); + if (res < 0) + goto fail; + if (res == 0) /* EOF */ + break; + if (chunks == NULL) { + chunks = PyList_New(0); + if (chunks == NULL) + goto fail; + } + if (PyList_Append(chunks, result) < 0) + goto fail; + Py_DECREF(result); + result = TextIOWrapper_get_decoded_chars(self, remaining); + if (result == NULL) + goto fail; + remaining -= PyUnicode_GET_SIZE(result); + } + if (chunks != NULL) { + if (result != NULL && PyList_Append(chunks, result) < 0) + goto fail; + Py_CLEAR(result); + result = PyUnicode_Join(PyUnicode_FromStringAndSize(NULL, 0), + chunks); + if (result == NULL) + goto fail; + Py_CLEAR(chunks); + } + return result; + } + fail: + Py_XDECREF(result); + Py_XDECREF(chunks); + return NULL; +} + + +/* 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_UNICODE * +find_control_char(Py_UNICODE *start, Py_UNICODE *end, Py_UNICODE ch) +{ + Py_UNICODE *s = start; + for (;;) { + while (*s > ch) + s++; + if (*s == ch) + return s; + if (s == end) + return NULL; + s++; + } +} + +/* 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 len = end - start; + + if (self->readtranslate) { + /* Newlines are already translated, only search for \n */ + Py_UNICODE *pos = find_control_char(start, end, '\n'); + if (pos != NULL) + return pos - start + 1; + else { + *consumed = len; + return -1; + } + } + else if (self->readuniversal) { + /* Universal newline search. Find any of \r, \r\n, \n + * The decoder ensures that \r\n are not split in two pieces + */ + Py_UNICODE *s = start; + for (;;) { + Py_UNICODE ch; + /* Fast path for non-control chars. The loop always ends + since the Py_UNICODE storage is NUL-terminated. */ + while (*s > '\r') + s++; + if (s >= end) { + *consumed = len; + return -1; + } + ch = *s++; + if (ch == '\n') + return s - start; + if (ch == '\r') { + if (*s == '\n') + return s - start + 1; + else + return s - start; + } + } + } + else { + /* Non-universal mode. */ + Py_ssize_t readnl_len = PyUnicode_GET_SIZE(self->readnl); + Py_UNICODE *nl = PyUnicode_AS_UNICODE(self->readnl); + if (readnl_len == 1) { + Py_UNICODE *pos = find_control_char(start, end, nl[0]); + if (pos != NULL) + return pos - start + 1; + *consumed = len; + return -1; + } + else { + Py_UNICODE *s = start; + Py_UNICODE *e = end - readnl_len + 1; + Py_UNICODE *pos; + if (e < s) + e = s; + while (s < e) { + Py_ssize_t i; + Py_UNICODE *pos = find_control_char(s, end, nl[0]); + if (pos == NULL || pos >= e) + break; + for (i = 1; i < readnl_len; i++) { + if (pos[i] != nl[i]) + break; + } + if (i == readnl_len) + return pos - start + readnl_len; + s = pos + 1; + } + pos = find_control_char(e, end, nl[0]); + if (pos == NULL) + *consumed = len; + else + *consumed = pos - start; + return -1; + } + } +} + +static PyObject * +_TextIOWrapper_readline(PyTextIOWrapperObject *self, Py_ssize_t limit) +{ + PyObject *line = NULL, *chunks = NULL, *remaining = NULL; + Py_ssize_t start, endpos, chunked, offset_to_buffer; + int res; + + CHECK_CLOSED(self); + + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + + chunked = 0; + + while (1) { + Py_UNICODE *ptr; + Py_ssize_t line_len; + Py_ssize_t consumed = 0; + + /* First, get some data if necessary */ + res = 1; + while (!self->decoded_chars || + !PyUnicode_GET_SIZE(self->decoded_chars)) { + res = TextIOWrapper_read_chunk(self); + if (res < 0) + goto error; + if (res == 0) + break; + } + if (res == 0) { + /* end of file */ + TextIOWrapper_set_decoded_chars(self, NULL); + Py_CLEAR(self->snapshot); + start = endpos = offset_to_buffer = 0; + break; + } + + if (remaining == NULL) { + line = self->decoded_chars; + start = self->decoded_chars_used; + offset_to_buffer = 0; + Py_INCREF(line); + } + else { + assert(self->decoded_chars_used == 0); + line = PyUnicode_Concat(remaining, self->decoded_chars); + start = 0; + offset_to_buffer = PyUnicode_GET_SIZE(remaining); + Py_CLEAR(remaining); + if (line == NULL) + goto error; + } + + ptr = PyUnicode_AS_UNICODE(line); + line_len = PyUnicode_GET_SIZE(line); + + endpos = find_line_ending(self, ptr + start, ptr + line_len, &consumed); + if (endpos >= 0) { + endpos += start; + if (limit >= 0 && (endpos - start) + chunked >= limit) + endpos = start + limit - chunked; + break; + } + + /* We can put aside up to `endpos` */ + endpos = consumed + start; + if (limit >= 0 && (endpos - start) + chunked >= limit) { + /* Didn't find line ending, but reached length limit */ + endpos = start + limit - chunked; + break; + } + + if (endpos > start) { + /* No line ending seen yet - put aside current data */ + PyObject *s; + if (chunks == NULL) { + chunks = PyList_New(0); + if (chunks == NULL) + goto error; + } + s = PyUnicode_FromUnicode(ptr + start, endpos - start); + if (s == NULL) + goto error; + if (PyList_Append(chunks, s) < 0) { + Py_DECREF(s); + goto error; + } + chunked += PyUnicode_GET_SIZE(s); + Py_DECREF(s); + } + /* There may be some remaining bytes we'll have to prepend to the + next chunk of data */ + if (endpos < line_len) { + remaining = PyUnicode_FromUnicode( + ptr + endpos, line_len - endpos); + if (remaining == NULL) + goto error; + } + Py_CLEAR(line); + /* We have consumed the buffer */ + TextIOWrapper_set_decoded_chars(self, NULL); + } + + if (line != NULL) { + /* Our line ends in the current buffer */ + self->decoded_chars_used = endpos - offset_to_buffer; + if (start > 0 || endpos < PyUnicode_GET_SIZE(line)) { + if (start == 0 && Py_REFCNT(line) == 1) { + if (PyUnicode_Resize(&line, endpos) < 0) + goto error; + } + else { + PyObject *s = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(line) + start, endpos - start); + Py_CLEAR(line); + if (s == NULL) + goto error; + line = s; + } + } + } + if (remaining != NULL) { + if (chunks == NULL) { + chunks = PyList_New(0); + if (chunks == NULL) + goto error; + } + if (PyList_Append(chunks, remaining) < 0) + goto error; + Py_CLEAR(remaining); + } + if (chunks != NULL) { + if (line != NULL && PyList_Append(chunks, line) < 0) + goto error; + Py_CLEAR(line); + line = PyUnicode_Join(PyUnicode_FromStringAndSize(NULL, 0), chunks); + if (line == NULL) + goto error; + Py_DECREF(chunks); + } + if (line == NULL) + line = PyUnicode_FromStringAndSize(NULL, 0); + + return line; + + error: + Py_XDECREF(chunks); + Py_XDECREF(remaining); + Py_XDECREF(line); + return NULL; +} + +static PyObject * +TextIOWrapper_readline(PyTextIOWrapperObject *self, PyObject *args) +{ + Py_ssize_t limit = -1; + + CHECK_INITIALIZED(self); + if (!PyArg_ParseTuple(args, "|n:readline", &limit)) { + return NULL; + } + return _TextIOWrapper_readline(self, limit); +} + +/* Seek and Tell */ + +typedef struct { + Py_off_t start_pos; + int dec_flags; + int bytes_to_feed; + int chars_to_skip; + char need_eof; +} CookieStruct; + +/* + To speed up cookie packing/unpacking, we store the fields in a temporary + string and call _PyLong_FromByteArray() or _PyLong_AsByteArray (resp.). + The following macros define at which offsets in the intermediary byte + string the various CookieStruct fields will be stored. + */ + +#define COOKIE_BUF_LEN (sizeof(Py_off_t) + 3 * sizeof(int) + sizeof(char)) + +#if defined(WORDS_BIGENDIAN) + +# define IS_LITTLE_ENDIAN 0 + +/* We want the least significant byte of start_pos to also be the least + significant byte of the cookie, which means that in big-endian mode we + must copy the fields in reverse order. */ + +# define OFF_START_POS (sizeof(char) + 3 * sizeof(int)) +# define OFF_DEC_FLAGS (sizeof(char) + 2 * sizeof(int)) +# define OFF_BYTES_TO_FEED (sizeof(char) + sizeof(int)) +# define OFF_CHARS_TO_SKIP (sizeof(char)) +# define OFF_NEED_EOF 0 + +#else + +# define IS_LITTLE_ENDIAN 1 + +/* Little-endian mode: the least significant byte of start_pos will + naturally end up the least significant byte of the cookie. */ + +# define OFF_START_POS 0 +# define OFF_DEC_FLAGS (sizeof(Py_off_t)) +# define OFF_BYTES_TO_FEED (sizeof(Py_off_t) + sizeof(int)) +# define OFF_CHARS_TO_SKIP (sizeof(Py_off_t) + 2 * sizeof(int)) +# define OFF_NEED_EOF (sizeof(Py_off_t) + 3 * sizeof(int)) + +#endif + +static int +TextIOWrapper_parseCookie(CookieStruct *cookie, PyObject *cookieObj) +{ + unsigned char buffer[COOKIE_BUF_LEN]; + PyLongObject *cookieLong = (PyLongObject *)PyNumber_Long(cookieObj); + if (cookieLong == NULL) + return -1; + + if (_PyLong_AsByteArray(cookieLong, buffer, sizeof(buffer), + IS_LITTLE_ENDIAN, 0) < 0) { + Py_DECREF(cookieLong); + return -1; + } + Py_DECREF(cookieLong); + + cookie->start_pos = * (Py_off_t *)(buffer + OFF_START_POS); + cookie->dec_flags = * (int *) (buffer + OFF_DEC_FLAGS); + cookie->bytes_to_feed = * (int *) (buffer + OFF_BYTES_TO_FEED); + cookie->chars_to_skip = * (int *) (buffer + OFF_CHARS_TO_SKIP); + cookie->need_eof = * (char *) (buffer + OFF_NEED_EOF); + + return 0; +} + +static PyObject * +TextIOWrapper_buildCookie(CookieStruct *cookie) +{ + unsigned char buffer[COOKIE_BUF_LEN]; + + * (Py_off_t *)(buffer + OFF_START_POS) = cookie->start_pos; + * (int *) (buffer + OFF_DEC_FLAGS) = cookie->dec_flags; + * (int *) (buffer + OFF_BYTES_TO_FEED) = cookie->bytes_to_feed; + * (int *) (buffer + OFF_CHARS_TO_SKIP) = cookie->chars_to_skip; + * (char *) (buffer + OFF_NEED_EOF) = cookie->need_eof; + + return _PyLong_FromByteArray(buffer, sizeof(buffer), IS_LITTLE_ENDIAN, 0); +} +#undef IS_LITTLE_ENDIAN + +static int +_TextIOWrapper_decoder_setstate(PyTextIOWrapperObject *self, + CookieStruct *cookie) +{ + PyObject *res; + /* When seeking to the start of the stream, we call decoder.reset() + rather than decoder.getstate(). + This is for a few decoders such as utf-16 for which the state value + at start is not (b"", 0) but e.g. (b"", 2) (meaning, in the case of + utf-16, that we are expecting a BOM). + */ + if (cookie->start_pos == 0 && cookie->dec_flags == 0) + res = PyObject_CallMethod(self->decoder, "reset", NULL); + else + res = PyObject_CallMethod(self->decoder, "setstate", + "((yi))", "", cookie->dec_flags); + if (res == NULL) + return -1; + Py_DECREF(res); + return 0; +} + +static PyObject * +TextIOWrapper_seek(PyTextIOWrapperObject *self, PyObject *args) +{ + PyObject *cookieObj; + CookieStruct cookie; + int whence = 0; + static PyObject *zero = NULL; + PyObject *res; + int cmp; + + CHECK_INITIALIZED(self); + + if (zero == NULL) { + zero = PyLong_FromLong(0L); + if (zero == NULL) + return NULL; + } + + if (!PyArg_ParseTuple(args, "O|i:seek", &cookieObj, &whence)) + return NULL; + Py_INCREF(cookieObj); + + CHECK_CLOSED(self); + + if (!self->seekable) { + PyErr_SetString(PyExc_IOError, + "underlying stream is not seekable"); + goto fail; + } + + if (whence == 1) { + /* seek relative to current position */ + cmp = PyObject_RichCompareBool(cookieObj, zero, Py_EQ); + if (cmp < 0) + goto fail; + + if (cmp == 0) { + PyErr_SetString(PyExc_IOError, + "can't do nonzero cur-relative seeks"); + goto fail; + } + + /* Seeking to the current position should attempt to + * sync the underlying buffer with the current position. + */ + Py_DECREF(cookieObj); + cookieObj = PyObject_CallMethod((PyObject *)self, "tell", NULL); + if (cookieObj == NULL) + goto fail; + } + else if (whence == 2) { + /* seek relative to end of file */ + + cmp = PyObject_RichCompareBool(cookieObj, zero, Py_EQ); + if (cmp < 0) + goto fail; + + if (cmp == 0) { + PyErr_SetString(PyExc_IOError, + "can't do nonzero end-relative seeks"); + goto fail; + } + + res = PyObject_CallMethod((PyObject *)self, "flush", NULL); + if (res == NULL) + goto fail; + Py_DECREF(res); + + TextIOWrapper_set_decoded_chars(self, NULL); + Py_CLEAR(self->snapshot); + if (self->decoder) { + res = PyObject_CallMethod(self->decoder, "reset", NULL); + if (res == NULL) + goto fail; + Py_DECREF(res); + } + + res = PyObject_CallMethod(self->buffer, "seek", "ii", 0, 2); + return res; + } + else if (whence != 0) { + PyErr_Format(PyExc_ValueError, + "invalid whence (%d, should be 0, 1 or 2)", whence); + goto fail; + } + + cmp = PyObject_RichCompareBool(cookieObj, zero, Py_LT); + if (cmp < 0) + goto fail; + + if (cmp == 1) { + PyErr_Format(PyExc_ValueError, + "negative seek position %R", cookieObj); + goto fail; + } + + res = PyObject_CallMethod((PyObject *)self, "flush", NULL); + if (res == NULL) + goto fail; + Py_DECREF(res); + + /* The strategy of seek() is to go back to the safe start point + * and replay the effect of read(chars_to_skip) from there. + */ + if (TextIOWrapper_parseCookie(&cookie, cookieObj) < 0) + goto fail; + + /* Seek back to the safe start point. */ + res = PyObject_CallMethod(self->buffer, "seek", + "L", (PY_LONG_LONG)cookie.start_pos); + if (res == NULL) + goto fail; + Py_DECREF(res); + + TextIOWrapper_set_decoded_chars(self, NULL); + Py_CLEAR(self->snapshot); + + /* Restore the decoder to its state from the safe start point. */ + if (self->decoder) { + if (_TextIOWrapper_decoder_setstate(self, &cookie) < 0) + goto fail; + self->snapshot = Py_BuildValue("iy", cookie.dec_flags, ""); + if (self->snapshot == NULL) + goto fail; + } + + if (cookie.chars_to_skip) { + /* Just like _read_chunk, feed the decoder and save a snapshot. */ + PyObject *input_chunk = PyObject_CallMethod( + self->buffer, "read", "i", cookie.bytes_to_feed); + PyObject *decoded; + + if (input_chunk == NULL) + goto fail; + + assert (PyBytes_Check(input_chunk)); + + self->snapshot = Py_BuildValue("iO", cookie.dec_flags, input_chunk); + if (self->snapshot == NULL) { + Py_DECREF(input_chunk); + goto fail; + } + + decoded = PyObject_CallMethod(self->decoder, "decode", + "Ni", input_chunk, (int)cookie.need_eof); + + if (decoded == NULL) + goto fail; + + TextIOWrapper_set_decoded_chars(self, decoded); + + /* Skip chars_to_skip of the decoded characters. */ + if (PyUnicode_GetSize(self->decoded_chars) < cookie.chars_to_skip) { + PyErr_SetString(PyExc_IOError, "can't restore logical file position"); + goto fail; + } + self->decoded_chars_used = cookie.chars_to_skip; + } + + return cookieObj; + fail: + Py_XDECREF(cookieObj); + return NULL; + +} + +static PyObject * +TextIOWrapper_tell(PyTextIOWrapperObject *self, PyObject *args) +{ + PyObject *res; + PyObject *posobj = NULL; + CookieStruct cookie = {0,0,0,0,0}; + PyObject *next_input; + Py_ssize_t chars_to_skip, chars_decoded; + PyObject *saved_state = NULL; + char *input, *input_end; + + CHECK_INITIALIZED(self); + CHECK_CLOSED(self); + + if (!self->seekable) { + PyErr_SetString(PyExc_IOError, + "underlying stream is not seekable"); + goto fail; + } + if (!self->telling) { + PyErr_SetString(PyExc_IOError, + "telling position disabled by next() call"); + goto fail; + } + + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + res = PyObject_CallMethod((PyObject *)self, "flush", NULL); + if (res == NULL) + goto fail; + Py_DECREF(res); + + posobj = PyObject_CallMethod(self->buffer, "tell", NULL); + if (posobj == NULL) + goto fail; + + if (self->decoder == NULL || self->snapshot == NULL) { + assert (self->decoded_chars == NULL || PyUnicode_GetSize(self->decoded_chars) == 0); + return posobj; + } + +#if defined(HAVE_LARGEFILE_SUPPORT) + cookie.start_pos = PyLong_AsLongLong(posobj); +#else + cookie.start_pos = PyLong_AsLong(posobj); +#endif + if (PyErr_Occurred()) + goto fail; + + /* Skip backward to the snapshot point (see _read_chunk). */ + if (!PyArg_Parse(self->snapshot, "(iO)", &cookie.dec_flags, &next_input)) + goto fail; + + assert (PyBytes_Check(next_input)); + + cookie.start_pos -= PyBytes_GET_SIZE(next_input); + + /* How many decoded characters have been used up since the snapshot? */ + if (self->decoded_chars_used == 0) { + /* We haven't moved from the snapshot point. */ + Py_DECREF(posobj); + return TextIOWrapper_buildCookie(&cookie); + } + + chars_to_skip = self->decoded_chars_used; + + /* Starting from the snapshot position, we will walk the decoder + * forward until it gives us enough decoded characters. + */ + saved_state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); + if (saved_state == NULL) + goto fail; + + /* Note our initial start point. */ + if (_TextIOWrapper_decoder_setstate(self, &cookie) < 0) + goto fail; + + /* 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). + */ + chars_decoded = 0; + input = PyBytes_AS_STRING(next_input); + input_end = input + PyBytes_GET_SIZE(next_input); + while (input < input_end) { + PyObject *state; + char *dec_buffer; + int dec_buffer_len; + int dec_flags; + + PyObject *decoded = PyObject_CallMethod( + self->decoder, "decode", "y#", input, 1); + if (decoded == NULL) + goto fail; + assert (PyUnicode_Check(decoded)); + chars_decoded += PyUnicode_GET_SIZE(decoded); + Py_DECREF(decoded); + + cookie.bytes_to_feed += 1; + + state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); + if (state == NULL) + goto fail; + if (!PyArg_Parse(state, "(y#i)", &dec_buffer, &dec_buffer_len, &dec_flags)) { + Py_DECREF(state); + goto fail; + } + Py_DECREF(state); + + if (dec_buffer_len == 0 && chars_decoded <= chars_to_skip) { + /* Decoder buffer is empty, so this is a safe start point. */ + cookie.start_pos += cookie.bytes_to_feed; + chars_to_skip -= chars_decoded; + cookie.dec_flags = dec_flags; + cookie.bytes_to_feed = 0; + chars_decoded = 0; + } + if (chars_decoded >= chars_to_skip) + break; + input++; + } + if (input == input_end) { + /* We didn't get enough decoded data; signal EOF to get more. */ + PyObject *decoded = PyObject_CallMethod( + self->decoder, "decode", "yi", "", /* final = */ 1); + if (decoded == NULL) + goto fail; + assert (PyUnicode_Check(decoded)); + chars_decoded += PyUnicode_GET_SIZE(decoded); + cookie.need_eof = 1; + + if (chars_decoded < chars_to_skip) { + PyErr_SetString(PyExc_IOError, + "can't reconstruct logical file position"); + goto fail; + } + } + + /* finally */ + Py_XDECREF(posobj); + res = PyObject_CallMethod(self->decoder, "setstate", "(O)", saved_state); + Py_DECREF(saved_state); + if (res == NULL) + return NULL; + Py_DECREF(res); + + /* The returned cookie corresponds to the last safe start point. */ + cookie.chars_to_skip = Py_SAFE_DOWNCAST(chars_to_skip, Py_ssize_t, int); + return TextIOWrapper_buildCookie(&cookie); + + fail: + Py_XDECREF(posobj); + if (saved_state) { + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + + res = PyObject_CallMethod(self->decoder, "setstate", "(O)", saved_state); + Py_DECREF(saved_state); + if (res == NULL) + return NULL; + Py_DECREF(res); + + PyErr_Restore(type, value, traceback); + } + return NULL; +} + +/* Inquiries */ + +static PyObject * +TextIOWrapper_fileno(PyTextIOWrapperObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self); + return PyObject_CallMethod(self->buffer, "fileno", NULL); +} + +static PyObject * +TextIOWrapper_seekable(PyTextIOWrapperObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self); + return PyObject_CallMethod(self->buffer, "seekable", NULL); +} + +static PyObject * +TextIOWrapper_readable(PyTextIOWrapperObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self); + return PyObject_CallMethod(self->buffer, "readable", NULL); +} + +static PyObject * +TextIOWrapper_writable(PyTextIOWrapperObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self); + return PyObject_CallMethod(self->buffer, "writable", NULL); +} + +static PyObject * +TextIOWrapper_isatty(PyTextIOWrapperObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self); + return PyObject_CallMethod(self->buffer, "isatty", NULL); +} + +static PyObject * +TextIOWrapper_flush(PyTextIOWrapperObject *self, PyObject *args) +{ + CHECK_INITIALIZED(self); + CHECK_CLOSED(self); + self->telling = self->seekable; + if (_TextIOWrapper_writeflush(self) < 0) + return NULL; + return PyObject_CallMethod(self->buffer, "flush", NULL); +} + +static PyObject * +TextIOWrapper_close(PyTextIOWrapperObject *self, PyObject *args) +{ + PyObject *res; + CHECK_INITIALIZED(self); + res = PyObject_CallMethod((PyObject *)self, "flush", NULL); + if (res == NULL) { + /* If flush() fails, just give up */ + PyErr_Clear(); + } + else + Py_DECREF(res); + + return PyObject_CallMethod(self->buffer, "close", NULL); +} + +static PyObject * +TextIOWrapper_iternext(PyTextIOWrapperObject *self) +{ + PyObject *line; + + CHECK_INITIALIZED(self); + + self->telling = 0; + if (Py_TYPE(self) == &PyTextIOWrapper_Type) { + /* Skip method call overhead for speed */ + line = _TextIOWrapper_readline(self, -1); + } + else { + line = PyObject_CallMethodObjArgs((PyObject *)self, + _PyIO_str_readline, NULL); + /* TODO: check return type */ + } + + if (line == NULL) + return NULL; + + assert (PyUnicode_Check(line)); + + if (PyUnicode_GET_SIZE(line) == 0) { + /* Reached EOF or would have blocked */ + Py_DECREF(line); + Py_CLEAR(self->snapshot); + self->telling = self->seekable; + return NULL; + } + + return line; +} + +static PyObject * +TextIOWrapper_name_get(PyTextIOWrapperObject *self, void *context) +{ + CHECK_INITIALIZED(self); + return PyObject_GetAttrString(self->buffer, "name"); +} + +static PyObject * +TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context) +{ + CHECK_INITIALIZED(self); + return PyObject_GetAttr(self->buffer, _PyIO_str_closed); +} + +static PyObject * +TextIOWrapper_newlines_get(PyTextIOWrapperObject *self, void *context) +{ + PyObject *res; + CHECK_INITIALIZED(self); + if (self->decoder == NULL) + Py_RETURN_NONE; + res = PyObject_GetAttr(self->decoder, _PyIO_str_newlines); + if (res == NULL) { + PyErr_Clear(); + Py_RETURN_NONE; + } + return res; +} + +static PyObject * +TextIOWrapper_chunk_size_get(PyTextIOWrapperObject *self, void *context) +{ + CHECK_INITIALIZED(self); + return PyLong_FromSsize_t(self->chunk_size); +} + +static int +TextIOWrapper_chunk_size_set(PyTextIOWrapperObject *self, + PyObject *arg, void *context) +{ + Py_ssize_t n; + CHECK_INITIALIZED_INT(self); + n = PyNumber_AsSsize_t(arg, PyExc_TypeError); + if (n == -1 && PyErr_Occurred()) + return -1; + if (n <= 0) { + PyErr_SetString(PyExc_ValueError, + "a strictly positive integer is required"); + return -1; + } + self->chunk_size = n; + return 0; +} + +static PyMethodDef TextIOWrapper_methods[] = { + {"write", (PyCFunction)TextIOWrapper_write, METH_VARARGS}, + {"read", (PyCFunction)TextIOWrapper_read, METH_VARARGS}, + {"readline", (PyCFunction)TextIOWrapper_readline, METH_VARARGS}, + {"flush", (PyCFunction)TextIOWrapper_flush, METH_NOARGS}, + {"close", (PyCFunction)TextIOWrapper_close, METH_NOARGS}, + + {"fileno", (PyCFunction)TextIOWrapper_fileno, METH_NOARGS}, + {"seekable", (PyCFunction)TextIOWrapper_seekable, METH_NOARGS}, + {"readable", (PyCFunction)TextIOWrapper_readable, METH_NOARGS}, + {"writable", (PyCFunction)TextIOWrapper_writable, METH_NOARGS}, + {"isatty", (PyCFunction)TextIOWrapper_isatty, METH_NOARGS}, + + {"seek", (PyCFunction)TextIOWrapper_seek, METH_VARARGS}, + {"tell", (PyCFunction)TextIOWrapper_tell, METH_NOARGS}, +/* {"truncate", (PyCFunction)TextIOWrapper_truncate, METH_VARARGS}, + {"readinto", (PyCFunction)TextIOWrapper_readinto, METH_VARARGS}, + {"peek", (PyCFunction)TextIOWrapper_peek, METH_VARARGS}, + {"read1", (PyCFunction)TextIOWrapper_read1, METH_VARARGS}, +*/ + {NULL, NULL} +}; + +static PyMemberDef TextIOWrapper_members[] = { + {"encoding", T_OBJECT, offsetof(PyTextIOWrapperObject, encoding), READONLY}, + {"buffer", T_OBJECT, offsetof(PyTextIOWrapperObject, buffer), READONLY}, + {NULL} +}; + +static PyGetSetDef TextIOWrapper_getset[] = { + {"name", (getter)TextIOWrapper_name_get, NULL, NULL}, + {"closed", (getter)TextIOWrapper_closed_get, NULL, NULL}, +/* {"mode", (getter)TextIOWrapper_mode_get, NULL, NULL}, +*/ + {"newlines", (getter)TextIOWrapper_newlines_get, NULL, NULL}, + {"_CHUNK_SIZE", (getter)TextIOWrapper_chunk_size_get, + (setter)TextIOWrapper_chunk_size_set, NULL}, + {0} +}; + +PyTypeObject PyTextIOWrapper_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "TextIOWrapper", /*tp_name*/ + sizeof(PyTextIOWrapperObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)TextIOWrapper_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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + TextIOWrapper_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(PyTextIOWrapperObject, weakreflist), /*tp_weaklistoffset*/ + 0, /* tp_iter */ + (iternextfunc)TextIOWrapper_iternext, /* tp_iternext */ + TextIOWrapper_methods, /* tp_methods */ + TextIOWrapper_members, /* tp_members */ + TextIOWrapper_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(PyTextIOWrapperObject, dict), /*tp_dictoffset*/ + (initproc)TextIOWrapper_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ +}; Added: python/branches/io-c/Modules/io.c ============================================================================== --- (empty file) +++ python/branches/io-c/Modules/io.c Sun Jan 18 00:13:48 2009 @@ -0,0 +1,727 @@ +#include "Python.h" +#include "structmember.h" +#include "_iomodule.h" + +#ifdef HAVE_SYS_TYPES_H +#include +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_SYS_STAT_H +#include +#endif /* HAVE_SYS_STAT_H */ + +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_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" +"builtin open function is defined in this module.\n" +"\n" +"At the top of the I/O hierarchy is the abstract base class IOBase. It\n" +"defines the basic interface to a stream. Note, however, that there is no\n" +"seperation between reading and writing to streams; implementations are\n" +"allowed to throw an IOError if they do not support a given operation.\n" +"\n" +"Extending IOBase is RawIOBase which deals simply with the reading and\n" +"writing of raw bytes to a stream. FileIO subc lasses RawIOBase to provide\n" +"an interface to OS files.\n" +"\n" +"BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its\n" +"subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer\n" +"streams that are readable, writable, and both respectively.\n" +"BufferedRandom provides a buffered interface to random access\n" +"streams. BytesIO is a simple stream of in-memory bytes.\n" +"\n" +"Another IOBase subclass, TextIOBase, deals with the encoding and decoding\n" +"of streams into text. TextIOWrapper, which extends it, is a buffered text\n" +"interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO\n" +"is a in-memory stream for text.\n" +"\n" +"Argument names are not part of the specification, and only the arguments\n" +"of open() are intended to be used as keyword arguments.\n" +"\n" +"data:\n" +"\n" +"DEFAULT_BUFFER_SIZE\n" +"\n" +" An int containing the default buffer size used by the module's buffered\n" +" I/O classes. open() uses the file's blksize (as obtained by os.stat) if\n" +" possible.\n" + ); + + +/* + * BlockingIOError extends IOError + */ + +static int +BlockingIOError_init(PyBlockingIOErrorObject *self, PyObject *args, + PyObject *kwds) +{ + PyObject *myerrno = NULL, *strerror = NULL, *written; + PyObject *baseargs = NULL; + + assert(PyTuple_Check(args)); + + if (PyTuple_GET_SIZE(args) <= 1 || PyTuple_GET_SIZE(args) > 3) + return 0; + + baseargs = PyTuple_GetSlice(args, 0, 2); + if (baseargs == NULL) + return -1; + + if (((PyTypeObject *)PyExc_IOError)->tp_init( + (PyObject *)self, baseargs, kwds) == -1) { + Py_DECREF(baseargs); + return -1; + } + + Py_DECREF(baseargs); + + if (!PyArg_UnpackTuple(args, "BlockingIOError", 2, 3, + &myerrno, &strerror, &written)) { + return -1; + } + + Py_INCREF(myerrno); + self->myerrno = myerrno; + + Py_INCREF(strerror); + self->strerror = strerror; + + self->written = PyNumber_AsSsize_t(written, PyExc_ValueError); + if(self->written == -1 && PyErr_Occurred()) + return -1; + + return 0; +} + +static PyMemberDef BlockingIOError_members[] = { + {"characters_written", T_PYSSIZET, offsetof(PyBlockingIOErrorObject, written), 0}, + {NULL} /* Sentinel */ +}; + + +static PyTypeObject _PyExc_BlockingIOError = { + PyVarObject_HEAD_INIT(NULL, 0) + "BlockingIOError", /*tp_name*/ + sizeof(PyBlockingIOErrorObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*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 | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + PyDoc_STR("Exception raised when I/O would block on a non-blocking I/O stream"), /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + BlockingIOError_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)BlockingIOError_init, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ +}; +PyObject *PyExc_BlockingIOError = (PyObject *)&_PyExc_BlockingIOError; + + +/* + * The main open() function + */ +PyDoc_STRVAR(open_doc, +"Open file and return a stream. Raise IOError upon failure.\n" +"\n" +"file is either a text or byte string giving the name (and the path\n" +"if the file isn't in the current working directory) of the file to\n" +"be opened or an integer file descriptor of the file to be\n" +"wrapped. (If a file descriptor is given, it is closed when the\n" +"returned I/O object is closed, unless closefd is set to False.)\n" +"\n" +"mode is an optional string that specifies the mode in which the file\n" +"is opened. It defaults to 'r' which means open for reading in text\n" +"mode. Other common values are 'w' for writing (truncating the file if\n" +"it already exists), and 'a' for appending (which on some Unix systems,\n" +"means that all writes append to the end of the file regardless of the\n" +"current seek position). In text mode, if encoding is not specified the\n" +"encoding used is platform dependent. (For reading and writing raw\n" +"bytes use binary mode and leave encoding unspecified.) The available\n" +"modes are:\n" +"\n" +"========= ===============================================================\n" +"Character Meaning\n" +"--------- ---------------------------------------------------------------\n" +"'r' open for reading (default)\n" +"'w' open for writing, truncating the file first\n" +"'a' open for writing, appending to the end of the file if it exists\n" +"'b' binary mode\n" +"'t' text mode (default)\n" +"'+' open a disk file for updating (reading and writing)\n" +"'U' universal newline mode (for backwards compatibility; unneeded\n" +" for new code)\n" +"========= ===============================================================\n" +"\n" +"The default mode is 'rt' (open for reading text). For binary random\n" +"access, the mode 'w+b' opens and truncates the file to 0 bytes, while\n" +"'r+b' opens the file without truncation.\n" +"\n" +"Python distinguishes between files opened in binary and text modes,\n" +"even when the underlying operating system doesn't. Files opened in\n" +"binary mode (appending 'b' to the mode argument) return contents as\n" +"bytes objects without any decoding. In text mode (the default, or when\n" +"'t' is appended to the mode argument), the contents of the file are\n" +"returned as strings, the bytes having been first decoded using a\n" +"platform-dependent encoding or using the specified encoding if given.\n" +"\n" +"buffering is an optional integer used to set the buffering policy. By\n" +"default full buffering is on. Pass 0 to switch buffering off (only\n" +"allowed in binary mode), 1 to set line buffering, and an integer > 1\n" +"for full buffering.\n" +"\n" +"encoding is the name of the encoding used to decode or encode the\n" +"file. This should only be used in text mode. The default encoding is\n" +"platform dependent, but any encoding supported by Python can be\n" +"passed. See the codecs module for the list of supported encodings.\n" +"\n" +"errors is an optional string that specifies how encoding errors are to\n" +"be handled---this argument should not be used in binary mode. Pass\n" +"'strict' to raise a ValueError exception if there is an encoding error\n" +"(the default of None has the same effect), or pass 'ignore' to ignore\n" +"errors. (Note that ignoring encoding errors can lead to data loss.)\n" +"See the documentation for codecs.register for a list of the permitted\n" +"encoding error strings.\n" +"\n" +"newline controls how universal newlines works (it only applies to text\n" +"mode). It can be None, '', '\\n', '\\r', and '\\r\\n'. It works as\n" +"follows:\n" +"\n" +"* On input, if newline is None, universal newlines mode is\n" +" enabled. Lines in the input can end in '\\n', '\\r', or '\\r\\n', and\n" +" these are translated into '\\n' before being returned to the\n" +" caller. If it is '', universal newline mode is enabled, but line\n" +" endings are returned to the caller untranslated. If it has any of\n" +" the other legal values, input lines are only terminated by the given\n" +" string, and the line ending is returned to the caller untranslated.\n" +"\n" +"* On output, if newline is None, any '\\n' characters written are\n" +" translated to the system default line separator, os.linesep. If\n" +" newline is '', no translation takes place. If newline is any of the\n" +" other legal values, any '\\n' characters written are translated to\n" +" the given string.\n" +"\n" +"If closefd is False, the underlying file descriptor will be kept open\n" +"when the file is closed. This does not work when a file name is given\n" +"and must be True in that case.\n" +"\n" +"open() returns a file object whose type depends on the mode, and\n" +"through which the standard file operations such as reading and writing\n" +"are performed. When open() is used to open a file in a text mode ('w',\n" +"'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open\n" +"a file in a binary mode, the returned class varies: in read binary\n" +"mode, it returns a BufferedReader; in write binary and append binary\n" +"modes, it returns a BufferedWriter, and in read/write mode, it returns\n" +"a BufferedRandom.\n" +"\n" +"It is also possible to use a string or bytearray as a file for both\n" +"reading and writing. For strings StringIO can be used like a file\n" +"opened in a text mode, and for bytes a BytesIO can be used like a file\n" +"opened in a binary mode.\n" + ); + +static PyObject * +io_open(PyObject *self, PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"file", "mode", "buffering", + "encoding", "errors", "newline", + "closefd", NULL}; + PyObject *file; + char *mode = "r"; + int buffering = -1, closefd = 1; + char *encoding = NULL, *errors = NULL, *newline = NULL; + unsigned i; + + int reading = 0, writing = 0, appending = 0, updating = 0; + int text = 0, binary = 0, universal = 0; + + char rawmode[5], *m; + int line_buffering, isatty; + + PyObject *raw, *modeobj = NULL, *buffer = NULL, *wrapper = NULL; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|sizzzi:open", kwlist, + &file, &mode, &buffering, + &encoding, &errors, &newline, + &closefd)) { + return NULL; + } + + if (!PyUnicode_Check(file) && + !PyBytes_Check(file) && + !PyNumber_Check(file)) { + PyErr_Format(PyExc_TypeError, "invalid file: %R", file); + return NULL; + } + + /* Decode mode */ + for (i = 0; i < strlen(mode); i++) { + char c = mode[i]; + + switch (c) { + case 'r': + reading = 1; + break; + case 'w': + writing = 1; + break; + case 'a': + appending = 1; + break; + case '+': + updating = 1; + break; + case 't': + text = 1; + break; + case 'b': + binary = 1; + break; + case 'U': + universal = 1; + reading = 1; + break; + default: + goto invalid_mode; + } + + /* c must not be duplicated */ + if (strchr(mode+i+1, c)) { + invalid_mode: + PyErr_Format(PyExc_ValueError, "invalid mode: '%s'", mode); + return NULL; + } + + } + + m = rawmode; + if (reading) *(m++) = 'r'; + if (writing) *(m++) = 'w'; + if (appending) *(m++) = 'a'; + if (updating) *(m++) = '+'; + *m = '\0'; + + /* Parameters validation */ + if (universal) { + if (writing || appending) { + PyErr_SetString(PyExc_ValueError, + "can't use U and writing mode at once"); + return NULL; + } + reading = 1; + } + + if (text && binary) { + PyErr_SetString(PyExc_ValueError, + "can't have text and binary mode at once"); + return NULL; + } + + if (reading + writing + appending > 1) { + PyErr_SetString(PyExc_ValueError, + "must have exactly one of read/write/append mode"); + return NULL; + } + + if (binary && encoding != NULL) { + PyErr_SetString(PyExc_ValueError, + "binary mode doesn't take an encoding argument"); + return NULL; + } + + if (binary && errors != NULL) { + PyErr_SetString(PyExc_ValueError, + "binary mode doesn't take an errors argument"); + return NULL; + } + + if (binary && newline != NULL) { + PyErr_SetString(PyExc_ValueError, + "binary mode doesn't take a newline argument"); + return NULL; + } + + /* Create the Raw file stream */ + raw = PyObject_CallFunction((PyObject *)&PyFileIO_Type, + "Osi", file, rawmode, closefd); + if (raw == NULL) + return NULL; + + modeobj = PyUnicode_FromString(mode); + if (modeobj == NULL) + goto error; + + /* buffering */ + { + PyObject *res = PyObject_CallMethod(raw, "isatty", NULL); + if (res == NULL) + goto error; + isatty = PyLong_AsLong(res); + Py_DECREF(res); + if (isatty == -1 && PyErr_Occurred()) + goto error; + } + + if (buffering == 1 || (buffering < 0 && isatty)) { + buffering = -1; + line_buffering = 1; + } + else + line_buffering = 0; + + if (buffering < 0) { + buffering = DEFAULT_BUFFER_SIZE; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + { + struct stat st; + long fileno; + PyObject *res = PyObject_CallMethod(raw, "fileno", NULL); + if (res == NULL) + goto error; + + fileno = PyLong_AsLong(res); + Py_DECREF(res); + if (fileno == -1 && PyErr_Occurred()) + goto error; + + if (fstat(fileno, &st) >= 0) + buffering = st.st_blksize; + } +#endif + } + if (buffering < 0) { + PyErr_SetString(PyExc_ValueError, + "invalid buffering size"); + goto error; + } + + /* if not buffering, returns the raw file object */ + if (buffering == 0) { + if (!binary) { + PyErr_SetString(PyExc_ValueError, + "can't have unbuffered text I/O"); + goto error; + } + + Py_DECREF(modeobj); + return raw; + } + + /* wraps into a buffered file */ + { + PyObject *Buffered_class; + + if (updating) + Buffered_class = (PyObject *)&PyBufferedRandom_Type; + else if (writing || appending) + Buffered_class = (PyObject *)&PyBufferedWriter_Type; + else if (reading) + Buffered_class = (PyObject *)&PyBufferedReader_Type; + else { + PyErr_Format(PyExc_ValueError, + "unknown mode: '%s'", mode); + goto error; + } + + buffer = PyObject_CallFunction(Buffered_class, "Oi", raw, buffering); + } + Py_CLEAR(raw); + if (buffer == NULL) + goto error; + + + /* if binary, returns the buffered file */ + if (binary) { + Py_DECREF(modeobj); + return buffer; + } + + /* wraps into a TextIOWrapper */ + wrapper = PyObject_CallFunction((PyObject *)&PyTextIOWrapper_Type, + "Osssi", + buffer, + encoding, errors, newline, + line_buffering); + Py_CLEAR(buffer); + if (wrapper == NULL) + goto error; + + if (PyObject_SetAttrString(wrapper, "mode", modeobj) < 0) + goto error; + Py_DECREF(modeobj); + return wrapper; + + error: + Py_XDECREF(raw); + Py_XDECREF(modeobj); + Py_XDECREF(buffer); + Py_XDECREF(wrapper); + return NULL; +} + +/* + * Private helpers for the io module. + */ + +Py_off_t +PyNumber_AsOff_t(PyObject *item, PyObject *err) +{ + Py_off_t result; + PyObject *runerr; + PyObject *value = PyNumber_Index(item); + if (value == NULL) + return -1; + + /* We're done if PyLong_AsSsize_t() returns without error. */ + result = PyLong_AsOff_t(value); + if (result != -1 || !(runerr = PyErr_Occurred())) + goto finish; + + /* Error handling code -- only manage OverflowError differently */ + if (!PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) + goto finish; + + PyErr_Clear(); + /* If no error-handling desired then the default clipping + is sufficient. + */ + if (!err) { + assert(PyLong_Check(value)); + /* Whether or not it is less than or equal to + zero is determined by the sign of ob_size + */ + if (_PyLong_Sign(value) < 0) + result = PY_OFF_T_MIN; + else + result = PY_OFF_T_MAX; + } + else { + /* Otherwise replace the error with caller's error object. */ + PyErr_Format(err, + "cannot fit '%.200s' into an offset-sized integer", + item->ob_type->tp_name); + } + + finish: + Py_DECREF(value); + return result; +} + +/* + * Module definition + */ + +static PyMethodDef module_methods[] = { + {"open", (PyCFunction)io_open, METH_VARARGS|METH_KEYWORDS, open_doc}, + {NULL, NULL} +}; + +static struct PyModuleDef iomodule = { + PyModuleDef_HEAD_INIT, + "io", + module_doc, + -1, + module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC +PyInit__io(void) +{ + PyObject *m = PyModule_Create(&iomodule); + PyTypeObject *base; + if (m == NULL) + goto fail; + + /* UnsupportedOperation inherits from ValueError and IOError */ + PyIOExc_UnsupportedOperation = PyObject_CallFunction( + (PyObject *)&PyType_Type, "s(OO){}", + "UnsupportedOperation", PyExc_ValueError, PyExc_IOError); + if (PyIOExc_UnsupportedOperation == NULL) + goto fail; + PyModule_AddObject(m, "UnsupportedOperation", + PyIOExc_UnsupportedOperation); + + /* BlockingIOError */ + base = (PyTypeObject *)PyExc_IOError; + _PyExc_BlockingIOError.tp_base = base; + if (PyType_Ready(&_PyExc_BlockingIOError) < 0) + goto fail; + Py_INCREF(&_PyExc_BlockingIOError); + PyModule_AddObject(m, "BlockingIOError", + (PyObject *)&_PyExc_BlockingIOError); + + if (PyType_Ready(&PyIOBase_Type) < 0) + goto fail; + Py_INCREF(&PyIOBase_Type); + PyModule_AddObject(m, "IOBase", + (PyObject *)&PyIOBase_Type); + + if (PyType_Ready(&PyRawIOBase_Type) < 0) + goto fail; + Py_INCREF(&PyRawIOBase_Type); + PyModule_AddObject(m, "RawIOBase", + (PyObject *)&PyRawIOBase_Type); + + /* 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); + + /* 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) + goto fail; + Py_INCREF(&PyBytesIO_Type); + PyModule_AddObject(m, "BytesIO", (PyObject *) &PyBytesIO_Type); + + /* 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); + + /* 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); + + /* 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); + + /* 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); + + /* TextIOWrapper */ + PyTextIOWrapper_Type.tp_base = &PyIOBase_Type; + if (PyType_Ready(&PyTextIOWrapper_Type) < 0) + goto fail; + Py_INCREF(&PyTextIOWrapper_Type); + PyModule_AddObject(m, "TextIOWrapper", (PyObject *) &PyTextIOWrapper_Type); + + /* TextIOWrapper */ + if (PyType_Ready(&PyIncrementalNewlineDecoder_Type) < 0) + goto fail; + Py_INCREF(&PyIncrementalNewlineDecoder_Type); + PyModule_AddObject(m, "IncrementalNewlineDecoder", (PyObject *) &PyIncrementalNewlineDecoder_Type); + + /* Interned strings */ + if (!(_PyIO_str_close = PyUnicode_InternFromString("close"))) + goto fail; + if (!(_PyIO_str_closed = PyUnicode_InternFromString("closed"))) + goto fail; + if (!(_PyIO_str_decode = PyUnicode_InternFromString("decode"))) + goto fail; + if (!(_PyIO_str_encode = PyUnicode_InternFromString("encode"))) + goto fail; + if (!(_PyIO_str_fileno = PyUnicode_InternFromString("fileno"))) + goto fail; + if (!(_PyIO_str_flush = PyUnicode_InternFromString("flush"))) + goto fail; + if (!(_PyIO_str_getstate = PyUnicode_InternFromString("getstate"))) + goto fail; + if (!(_PyIO_str_isatty = PyUnicode_InternFromString("isatty"))) + goto fail; + if (!(_PyIO_str_newlines = PyUnicode_InternFromString("newlines"))) + goto fail; + if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) + goto fail; + if (!(_PyIO_str_read1 = PyUnicode_InternFromString("read1"))) + goto fail; + if (!(_PyIO_str_readable = PyUnicode_InternFromString("readable"))) + goto fail; + if (!(_PyIO_str_readinto = PyUnicode_InternFromString("readinto"))) + goto fail; + if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) + goto fail; + if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) + goto fail; + if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) + goto fail; + if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) + goto fail; + if (!(_PyIO_str_truncate = PyUnicode_InternFromString("truncate"))) + goto fail; + if (!(_PyIO_str_write = PyUnicode_InternFromString("write"))) + goto fail; + if (!(_PyIO_str_writable = PyUnicode_InternFromString("writable"))) + goto fail; + + return m; + + fail: + Py_XDECREF(m); + return NULL; +} Modified: python/branches/io-c/setup.py ============================================================================== --- python/branches/io-c/setup.py (original) +++ python/branches/io-c/setup.py Sun Jan 18 00:13:48 2009 @@ -996,8 +996,6 @@ # Thomas Heller's _ctypes module self.detect_ctypes(inc_dirs, lib_dirs) - # _fileio -- supposedly cross platform - exts.append(Extension('_fileio', ['_fileio.c'])) # Richard Oudkerk's multiprocessing module if platform == 'win32': # Windows macros = dict() From python-checkins at python.org Sun Jan 18 00:17:27 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:17:27 +0100 (CET) Subject: [Python-checkins] r68684 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090117231727.676BA1E403A@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:17:26 2009 New Revision: 68684 Log: Fixes and additions to test_io.py 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 Jan 18 00:17:26 2009 @@ -7,27 +7,36 @@ import threading import random import unittest -from itertools import chain, cycle +from itertools import chain, cycle, count +from collections import deque from test import support import codecs import io # The module under test +def _default_chunk_size(): + """Get the default TextIOWrapper chunk size""" + with open(__file__, "r", encoding="latin1") as f: + return f._CHUNK_SIZE + + class MockRawIO(io.RawIOBase): def __init__(self, read_stack=()): self._read_stack = list(read_stack) self._write_stack = [] + self._reads = 0 def read(self, n=None): + self._reads += 1 try: return self._read_stack.pop(0) except: return b"" def write(self, b): - self._write_stack.append(b[:]) + self._write_stack.append(bytes(b)) return len(b) def writable(self): @@ -43,10 +52,57 @@ return True def seek(self, pos, whence): - pass + return 0 # wrong but we gotta return something def tell(self): - return 42 + return 0 # same comment as above + + def readinto(self, buf): + self._reads += 1 + max_len = len(buf) + try: + data = self._read_stack[0] + except IndexError: + return 0 + if data is None: + del self._read_stack[0] + return None + n = len(data) + if len(data) <= max_len: + del self._read_stack[0] + buf[:n] = data + return n + else: + buf[:] = data[:max_len] + self._read_stack[0] = data[max_len:] + return max_len + + def truncate(self, pos=None): + return pos + + +class MisbehavedRawIO(MockRawIO): + def write(self, b): + return MockRawIO.write(self, b) * 2 + + def read(self, n=None): + return MockRawIO.read(self, n) * 2 + + def seek(self, pos, whence): + return -123 + + def tell(self): + return -456 + + def readinto(self, buf): + MockRawIO.readinto(self, buf) + return len(buf) * 5 + + +class CloseFailureIO(MockRawIO): + + def close(self): + raise IOError class MockFileIO(io.BytesIO): @@ -60,24 +116,50 @@ self.read_history.append(None if res is None else len(res)) return res + def readinto(self, b): + res = io.BytesIO.readinto(self, b) + self.read_history.append(res) + return res class MockNonBlockWriterIO(io.RawIOBase): - def __init__(self, blocking_script): - self._blocking_script = list(blocking_script) + def __init__(self): self._write_stack = [] + self._blocker_char = None - def write(self, b): - self._write_stack.append(b[:]) - n = self._blocking_script.pop(0) - if (n < 0): - raise io.BlockingIOError(0, "test blocking", -n) - else: - return n + def pop_written(self): + s = b"".join(self._write_stack) + self._write_stack[:] = [] + return s + + def block_on(self, char): + """Block when a given char is encountered.""" + self._blocker_char = char + + def readable(self): + return True + + def seekable(self): + return True def writable(self): return True + def write(self, b): + b = bytes(b) + n = -1 + if self._blocker_char: + try: + n = b.index(self._blocker_char) + except ValueError: + pass + else: + self._blocker_char = None + self._write_stack.append(b[:n]) + raise io.BlockingIOError(0, "test blocking", n) + self._write_stack.append(b) + return len(b) + class IOTest(unittest.TestCase): @@ -180,14 +262,15 @@ def test_readline(self): f = io.open(support.TESTFN, "wb") - f.write(b"abc\ndef\nxyzzy\nfoo") + f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line") f.close() f = io.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") self.assertEqual(f.readline(4), b"zzy\n") - self.assertEqual(f.readline(), b"foo") + self.assertEqual(f.readline(), b"foo\x00bar\n") + self.assertEqual(f.readline(), b"another line") f.close() def test_raw_bytes_io(self): @@ -238,15 +321,20 @@ class MyFileIO(io.FileIO): def __del__(self): record.append(1) - io.FileIO.__del__(self) + try: + f = io.FileIO.__del__ + except AttributeError: + pass + else: + f(self) def close(self): record.append(2) io.FileIO.close(self) def flush(self): record.append(3) io.FileIO.flush(self) - f = MyFileIO(support.TESTFN, "w") - f.write("xxx") + f = MyFileIO(support.TESTFN, "wb") + f.write(b"xxx") del f self.assertEqual(record, [1, 2, 3]) @@ -354,13 +442,138 @@ EOF = "" -class BufferedReaderTest(unittest.TestCase): +class CommonBufferedTests: + # Tests common to BufferedReader, BufferedWriter and BufferedRandom + + def testFileno(self): + rawio = MockRawIO() + bufio = self.tp(rawio) + + self.assertEquals(42, bufio.fileno()) + + def testFilenoNoFileno(self): + # XXX will we always have fileno() function? If so, kill + # this test. Else, write it. + pass + + def testInvalidArgs(self): + rawio = MockRawIO() + bufio = self.tp(rawio) + # Invalid whence + self.assertRaises(ValueError, bufio.seek, 0, -1) + self.assertRaises(ValueError, bufio.seek, 0, 3) + + def testOverrideDestructor(self): + tp = self.tp + record = [] + class MyBufferedIO(tp): + def __del__(self): + record.append(1) + try: + f = tp.__del__ + except AttributeError: + pass + else: + f(self) + def close(self): + record.append(2) + tp.close(self) + def flush(self): + record.append(3) + tp.flush(self) + rawio = MockRawIO() + bufio = MyBufferedIO(rawio) + writable = bufio.writable() + del bufio + if writable: + self.assertEqual(record, [1, 2, 3]) + else: + self.assertEqual(record, [1, 2]) + + def testContext(self): + # Test usability as a context manager + rawio = MockRawIO() + bufio = self.tp(rawio) + def _with(): + with bufio: + pass + _with() + # bufio should now be closed, and using it a second time should raise + # a ValueError. + self.assertRaises(ValueError, _with) + + def testErrorThroughDestructor(self): + # Test that the exception state is not modified by a destructor, + # even if close() fails. + rawio = CloseFailureIO() + def f(): + self.tp(rawio).xyzzy + self.assertRaises(AttributeError, f) + + +class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): + tp = io.BufferedReader + read_mode = "rb" + + def testConstructor(self): + rawio = MockRawIO([b"abc"]) + bufio = self.tp(rawio) + bufio.__init__(rawio) + bufio.__init__(rawio, buffer_size=1024) + 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. + self.assertRaises((OverflowError, MemoryError, ValueError), + bufio.__init__, rawio, sys.maxsize) + rawio = MockRawIO([b"abc"]) + bufio.__init__(rawio) + self.assertEquals(b"abc", bufio.read()) def testRead(self): rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) - + 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")) + bufio = self.tp(rawio) + self.assertEquals(b"a", bufio.read(1)) + self.assertEquals(b"b", bufio.read1(1)) + self.assertEquals(rawio._reads, 1) + self.assertEquals(b"c", bufio.read1(100)) + self.assertEquals(rawio._reads, 1) + self.assertEquals(b"d", bufio.read1(100)) + self.assertEquals(rawio._reads, 2) + self.assertEquals(b"efg", bufio.read1(100)) + self.assertEquals(rawio._reads, 3) + self.assertEquals(b"", bufio.read1(100)) + # Invalid args + self.assertRaises(ValueError, bufio.read1, -1) + + def testReadinto(self): + rawio = MockRawIO((b"abc", b"d", b"efg")) + bufio = self.tp(rawio) + b = bytearray(2) + self.assertEquals(bufio.readinto(b), 2) + self.assertEquals(b, b"ab") + self.assertEquals(bufio.readinto(b), 2) + self.assertEquals(b, b"cd") + self.assertEquals(bufio.readinto(b), 2) + self.assertEquals(b, b"ef") + self.assertEquals(bufio.readinto(b), 1) + self.assertEquals(b, b"gf") + self.assertEquals(bufio.readinto(b), 0) + self.assertEquals(b, b"gf") def testBuffering(self): data = b"abcdefghi" @@ -374,47 +587,38 @@ for bufsize, buf_read_sizes, raw_read_sizes in tests: rawio = MockFileIO(data) - bufio = io.BufferedReader(rawio, buffer_size=bufsize) + bufio = self.tp(rawio, buffer_size=bufsize) pos = 0 for nbytes in buf_read_sizes: self.assertEquals(bufio.read(nbytes), data[pos:pos+nbytes]) pos += nbytes + # this is mildly implementation-dependent self.assertEquals(rawio.read_history, raw_read_sizes) def testReadNonBlocking(self): # Inject some None's in there to simulate EWOULDBLOCK - rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None)) - bufio = io.BufferedReader(rawio) + rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None, None)) + bufio = self.tp(rawio) self.assertEquals(b"abcd", bufio.read(6)) self.assertEquals(b"e", bufio.read(1)) self.assertEquals(b"fg", bufio.read()) + self.assertEquals(b"", bufio.peek(1)) self.assert_(None is bufio.read()) self.assertEquals(b"", bufio.read()) def testReadToEof(self): rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read(9000)) def testReadNoArgs(self): rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) + bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read()) - def testFileno(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedReader(rawio) - - self.assertEquals(42, bufio.fileno()) - - def testFilenoNoFileno(self): - # XXX will we always have fileno() function? If so, kill - # this test. Else, write it. - pass - def testThreads(self): try: # Write out many bytes with exactly the same number of 0's, @@ -426,8 +630,8 @@ s = bytes(bytearray(l)) with io.open(support.TESTFN, "wb") as f: f.write(s) - with io.open(support.TESTFN, "rb", buffering=0) as raw: - bufio = io.BufferedReader(raw, 8) + with io.open(support.TESTFN, self.read_mode, buffering=0) as raw: + bufio = self.tp(raw, 8) errors = [] results = [] def f(): @@ -457,80 +661,196 @@ finally: support.unlink(support.TESTFN) - - -class BufferedWriterTest(unittest.TestCase): + def testMisbehavedRawIO(self): + rawio = MisbehavedRawIO((b"abc", b"d", b"efg")) + bufio = self.tp(rawio) + self.assertRaises(IOError, bufio.seek, 0) + self.assertRaises(IOError, bufio.tell) + self.assertRaises(IOError, bufio.read, 10) + + +class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): + tp = io.BufferedWriter + write_mode = "wb" + + def testConstructor(self): + rawio = MockRawIO() + bufio = self.tp(rawio) + bufio.__init__(rawio) + bufio.__init__(rawio, buffer_size=1024) + bufio.__init__(rawio, buffer_size=16) + 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. + self.assertRaises((OverflowError, MemoryError, ValueError), + bufio.__init__, rawio, sys.maxsize) + bufio.__init__(rawio) + self.assertEquals(3, bufio.write(b"ghi")) + bufio.flush() + self.assertEquals(b"".join(rawio._write_stack), b"abcghi") def testWrite(self): # Write to the buffered IO but don't overflow the buffer. writer = MockRawIO() - bufio = io.BufferedWriter(writer, 8) - + bufio = self.tp(writer, 8) bufio.write(b"abc") - self.assertFalse(writer._write_stack) def testWriteOverflow(self): writer = MockRawIO() - bufio = io.BufferedWriter(writer, 8) + bufio = self.tp(writer, 8) + contents = b"abcdefghijklmnop" + for n in range(0, len(contents), 3): + bufio.write(contents[n:n+3]) + flushed = b"".join(writer._write_stack) + # At least (total - 8) bytes were implicitly flushed, perhaps more + # depending on the implementation. + self.assert_(flushed.startswith(contents[:-8]), flushed) + + def check_writes(self, intermediate_func): + # Lots of writes, test the flushed output is as expected. + contents = bytes(range(256)) * 1000 + n = 0 + writer = MockRawIO() + bufio = self.tp(writer, 13) + # Generator of write sizes: repeat each N 15 times then proceed to N+1 + def gen_sizes(): + for size in count(1): + for i in range(15): + yield size + sizes = gen_sizes() + while n < len(contents): + size = min(next(sizes), len(contents) - n) + self.assertEquals(bufio.write(contents[n:n+size]), size) + intermediate_func(bufio) + n += size + bufio.flush() + self.assertEquals(contents, b"".join(writer._write_stack)) - bufio.write(b"abc") - bufio.write(b"defghijkl") + def testWrites(self): + self.check_writes(lambda bufio: None) - self.assertEquals(b"abcdefghijkl", writer._write_stack[0]) + def testWritesAndFlushes(self): + self.check_writes(lambda bufio: bufio.flush()) - def testWriteNonBlocking(self): - raw = MockNonBlockWriterIO((9, 2, 22, -6, 10, 12, 12)) - bufio = io.BufferedWriter(raw, 8, 16) + def testWritesAndSeeks(self): + def _seekabs(bufio): + pos = bufio.tell() + bufio.seek(pos + 1, 0) + bufio.seek(pos - 1, 0) + bufio.seek(pos, 0) + self.check_writes(_seekabs) + def _seekrel(bufio): + pos = bufio.seek(0, 1) + bufio.seek(+1, 1) + bufio.seek(-1, 1) + bufio.seek(pos, 0) + self.check_writes(_seekrel) - bufio.write(b"asdf") - bufio.write(b"asdfa") - self.assertEquals(b"asdfasdfa", raw._write_stack[0]) - - bufio.write(b"asdfasdfasdf") - self.assertEquals(b"asdfasdfasdf", raw._write_stack[1]) - bufio.write(b"asdfasdfasdf") - self.assertEquals(b"dfasdfasdf", raw._write_stack[2]) - self.assertEquals(b"asdfasdfasdf", raw._write_stack[3]) - - bufio.write(b"asdfasdfasdf") - - # XXX I don't like this test. It relies too heavily on how the - # algorithm actually works, which we might change. Refactor - # later. + def testWritesAndTruncates(self): + self.check_writes(lambda bufio: bufio.truncate(bufio.tell())) - def testFileno(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) - bufio = io.BufferedWriter(rawio) + def testWriteNonBlocking(self): + raw = MockNonBlockWriterIO() + bufio = self.tp(raw, 8, 8) - self.assertEquals(42, bufio.fileno()) + self.assertEquals(bufio.write(b"abcd"), 4) + self.assertEquals(bufio.write(b"efghi"), 5) + # 1 byte will be written, the rest will be buffered + raw.block_on(b"k") + self.assertEquals(bufio.write(b"jklmn"), 5) + + # 8 bytes will be written, 8 will be buffered and the rest will be lost + raw.block_on(b"0") + try: + bufio.write(b"opqrwxyz0123456789") + except io.BlockingIOError as e: + written = e.characters_written + else: + self.fail("BlockingIOError should have been raised") + self.assertEquals(written, 16) + self.assertEquals(raw.pop_written(), + b"abcdefghijklmnopqrwxyz") + + self.assertEquals(bufio.write(b"ABCDEFGHI"), 9) + s = raw.pop_written() + # Previously buffered bytes were flushed + self.assertTrue(s.startswith(b"01234567A"), s) + + def testWriteAndRewind(self): + raw = io.BytesIO() + bufio = self.tp(raw, 4) + self.assertEqual(bufio.write(b"abcdef"), 6) + self.assertEqual(bufio.tell(), 6) + bufio.seek(0, 0) + self.assertEqual(bufio.write(b"XY"), 2) + bufio.seek(6, 0) + self.assertEqual(raw.getvalue(), b"XYcdef") + self.assertEqual(bufio.write(b"123456"), 6) + bufio.flush() + self.assertEqual(raw.getvalue(), b"XYcdef123456") def testFlush(self): writer = MockRawIO() - bufio = io.BufferedWriter(writer, 8) - + bufio = self.tp(writer, 8) bufio.write(b"abc") bufio.flush() + self.assertEquals(b"abc", writer._write_stack[0]) + def testDestructor(self): + writer = MockRawIO() + bufio = self.tp(writer, 8) + bufio.write(b"abc") + del bufio self.assertEquals(b"abc", writer._write_stack[0]) + def testTruncate(self): + # Truncate implicitly flushes the buffer. + with io.open(support.TESTFN, self.write_mode, buffering=0) as raw: + bufio = self.tp(raw, 8) + bufio.write(b"abcdef") + self.assertEqual(bufio.truncate(3), 3) + self.assertEqual(bufio.tell(), 3) + with io.open(support.TESTFN, "rb", buffering=0) as f: + self.assertEqual(f.read(), b"abc") + def testThreads(self): - # BufferedWriter should not raise exceptions or crash - # when called from multiple threads. try: + # Write out many bytes from many threads and test they were + # all flushed. + N = 1000 + contents = bytes(range(256)) * N + sizes = cycle([1, 19]) + n = 0 + queue = deque() + while n < len(contents): + size = next(sizes) + queue.append(contents[n:n+size]) + n += size + del contents # We use a real file object because it allows us to # exercise situations where the GIL is released before # writing the buffer to the raw streams. This is in addition # to concurrency issues due to switching threads in the middle # of Python code. - with io.open(support.TESTFN, "wb", buffering=0) as raw: - bufio = io.BufferedWriter(raw, 8) + with io.open(support.TESTFN, self.write_mode, buffering=0) as raw: + bufio = self.tp(raw, 8) errors = [] def f(): try: - # Write enough bytes to flush the buffer - s = b"a" * 19 - for i in range(50): + while True: + try: + s = queue.popleft() + except IndexError: + return bufio.write(s) except Exception as e: errors.append(e) @@ -543,9 +863,21 @@ t.join() self.assertFalse(errors, "the following exceptions were caught: %r" % errors) + bufio.close() + with io.open(support.TESTFN, "rb") as f: + s = f.read() + for i in range(256): + self.assertEquals(s.count(bytes([i])), N) finally: support.unlink(support.TESTFN) + def testMisbehavedRawIO(self): + rawio = MisbehavedRawIO() + bufio = self.tp(rawio, 5) + self.assertRaises(IOError, bufio.seek, 0) + self.assertRaises(IOError, bufio.tell) + self.assertRaises(IOError, bufio.write, b"abcdef") + class BufferedRWPairTest(unittest.TestCase): @@ -558,22 +890,29 @@ # XXX More Tests -class BufferedRandomTest(unittest.TestCase): +class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest): + tp = io.BufferedRandom + read_mode = "rb+" + write_mode = "wb+" + + def testConstructor(self): + BufferedReaderTest.testConstructor(self) + BufferedWriterTest.testConstructor(self) def testReadAndWrite(self): raw = MockRawIO((b"asdf", b"ghjk")) - rw = io.BufferedRandom(raw, 8, 12) + rw = self.tp(raw, 8, 12) self.assertEqual(b"as", rw.read(2)) rw.write(b"ddd") rw.write(b"eee") self.assertFalse(raw._write_stack) # Buffer writes - self.assertEqual(b"ghjk", rw.read()) # This read forces write flush + self.assertEqual(b"ghjk", rw.read()) self.assertEquals(b"dddeee", raw._write_stack[0]) def testSeekAndTell(self): raw = io.BytesIO(b"asdfghjkl") - rw = io.BufferedRandom(raw) + rw = self.tp(raw) self.assertEquals(b"as", rw.read(2)) self.assertEquals(2, rw.tell()) @@ -591,6 +930,95 @@ self.assertEquals(b"fl", rw.read(11)) self.assertRaises(TypeError, rw.seek, 0.0) + def check_flush_and_read(self, read_func): + raw = io.BytesIO(b"abcdefghi") + bufio = self.tp(raw) + + self.assertEquals(b"ab", read_func(bufio, 2)) + bufio.write(b"12") + self.assertEquals(b"ef", read_func(bufio, 2)) + self.assertEquals(6, bufio.tell()) + bufio.flush() + self.assertEquals(6, bufio.tell()) + self.assertEquals(b"ghi", read_func(bufio)) + raw.seek(0, 0) + raw.write(b"XYZ") + # flush() resets the read buffer + bufio.flush() + bufio.seek(0, 0) + self.assertEquals(b"XYZ", read_func(bufio, 3)) + + def testFlushAndRead(self): + self.check_flush_and_read(lambda bufio, *args: bufio.read(*args)) + + def testFlushAndReadinto(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 _peek(bufio, n=-1): + # This relies on the fact that the buffer can contain the whole + # raw stream, otherwise peek() can return less. + b = bufio.peek(n) + if n != -1: + b = b[:n] + bufio.seek(len(b), 1) + return b + self.check_flush_and_read(_peek) + + def testFlushAndWrite(self): + raw = io.BytesIO(b"abcdefghi") + bufio = self.tp(raw) + + bufio.write(b"123") + bufio.flush() + bufio.write(b"45") + bufio.flush() + bufio.seek(0, 0) + self.assertEquals(b"12345fghi", raw.getvalue()) + self.assertEquals(b"12345fghi", bufio.read()) + + def testThreads(self): + BufferedReaderTest.testThreads(self) + BufferedWriterTest.testThreads(self) + + def testWritesAndPeeks(self): + def _peek(bufio): + bufio.peek(1) + self.check_writes(_peek) + def _peek(bufio): + pos = bufio.tell() + bufio.seek(-1, 1) + bufio.peek(1) + bufio.seek(pos, 0) + self.check_writes(_peek) + + def testWritesAndReads(self): + def _read(bufio): + bufio.seek(-1, 1) + bufio.read(1) + self.check_writes(_read) + + def testWritesAndRead1s(self): + def _read1(bufio): + bufio.seek(-1, 1) + bufio.read1(1) + self.check_writes(_read1) + + def testWritesAndReadintos(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) + + # To fully exercise seek/tell, the StatefulIncrementalDecoder has these # properties: # - A single output character can correspond to many bytes of input. @@ -745,6 +1173,18 @@ def tearDown(self): support.unlink(support.TESTFN) + def testConstructor(self): + r = io.BytesIO(b"\xc3\xa9\n\n") + b = io.BufferedReader(r, 1000) + t = io.TextIOWrapper(b) + t.__init__(b, encoding="latin1", newline="\r\n") + t.__init__(b, encoding="utf8") + 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 = io.BytesIO() b = io.BufferedWriter(r, 1000) @@ -756,6 +1196,15 @@ t.write("A\rB") self.assertEquals(r.getvalue(), b"XY\nZA\rB") + def testEncoding(self): + # Check the encoding attribute is always set, and valid + b = io.BytesIO() + t = io.TextIOWrapper(b, encoding="utf8") + self.assertEqual(t.encoding, "utf8") + t = io.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") @@ -798,40 +1247,6 @@ t.flush() self.assertEquals(b.getvalue(), b"abc?def\n") - def testNewlinesInput(self): - testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" - normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n") - for newline, expected in [ - (None, normalized.decode("ascii").splitlines(True)), - ("", testdata.decode("ascii").splitlines(True)), - ("\n", ["AAA\n", "BBB\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r\n", ["AAA\nBBB\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r", ["AAA\nBBB\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]), - ]: - buf = io.BytesIO(testdata) - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) - self.assertEquals(txt.readlines(), expected) - txt.seek(0) - self.assertEquals(txt.read(), "".join(expected)) - - def testNewlinesOutput(self): - testdict = { - "": b"AAA\nBBB\nCCC\nX\rY\r\nZ", - "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ", - "\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ", - "\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ", - } - tests = [(None, testdict[os.linesep])] + sorted(testdict.items()) - for newline, expected in tests: - buf = io.BytesIO() - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) - txt.write("AAA\nB") - txt.write("BB\nCCC\n") - txt.write("X\rY\r\nZ") - txt.flush() - self.assertEquals(buf.closed, False) - self.assertEquals(buf.getvalue(), expected) - def testNewlines(self): input_lines = [ "unix\n", "windows\r\n", "os9\r", "last\n", "nonl" ] @@ -875,14 +1290,14 @@ self.assertEquals(len(got_lines), len(exp_lines)) def testNewlinesInput(self): - testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" + 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 [ (None, normalized.decode("ascii").splitlines(True)), ("", testdata.decode("ascii").splitlines(True)), - ("\n", ["AAA\n", "BBB\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r\n", ["AAA\nBBB\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), - ("\r", ["AAA\nBBB\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]), + ("\n", ["AAA\n", "BB\x00B\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), + ("\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) @@ -891,32 +1306,64 @@ self.assertEquals(txt.read(), "".join(expected)) def testNewlinesOutput(self): - data = "AAA\nBBB\rCCC\n" - data_lf = b"AAA\nBBB\rCCC\n" - data_cr = b"AAA\rBBB\rCCC\r" - data_crlf = b"AAA\r\nBBB\rCCC\r\n" - save_linesep = os.linesep - try: - for os.linesep, newline, expected in [ - ("\n", None, data_lf), - ("\r\n", None, data_crlf), - ("\n", "", data_lf), - ("\r\n", "", data_lf), - ("\n", "\n", data_lf), - ("\r\n", "\n", data_lf), - ("\n", "\r", data_cr), - ("\r\n", "\r", data_cr), - ("\n", "\r\n", data_crlf), - ("\r\n", "\r\n", data_crlf), - ]: - buf = io.BytesIO() - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) - txt.write(data) - txt.close() - self.assertEquals(buf.closed, True) - self.assertRaises(ValueError, buf.getvalue) - finally: - os.linesep = save_linesep + testdict = { + "": b"AAA\nBBB\nCCC\nX\rY\r\nZ", + "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ", + "\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ", + "\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ", + } + tests = [(None, testdict[os.linesep])] + sorted(testdict.items()) + for newline, expected in tests: + buf = io.BytesIO() + txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) + txt.write("AAA\nB") + txt.write("BB\nCCC\n") + txt.write("X\rY\r\nZ") + txt.flush() + self.assertEquals(buf.closed, False) + self.assertEquals(buf.getvalue(), expected) + + def testDestructor(self): + l = [] + class MyBytesIO(io.BytesIO): + def close(self): + l.append(self.getvalue()) + io.BytesIO.close(self) + b = MyBytesIO() + t = io.TextIOWrapper(b, encoding="ascii") + t.write("abc") + del t + self.assertEquals([b"abc"], l) + + def testOverrideDestructor(self): + record = [] + class MyTextIO(io.TextIOWrapper): + def __del__(self): + record.append(1) + try: + f = io.TextIOWrapper.__del__ + except AttributeError: + pass + else: + f(self) + def close(self): + record.append(2) + io.TextIOWrapper.close(self) + def flush(self): + record.append(3) + io.TextIOWrapper.flush(self) + b = io.BytesIO() + t = MyTextIO(b, encoding="ascii") + del t + self.assertEqual(record, [1, 2, 3]) + + def testErrorThroughDestructor(self): + # Test that the exception state is not modified by a destructor, + # even if close() fails. + rawio = CloseFailureIO() + def f(): + io.TextIOWrapper(rawio).xyzzy + self.assertRaises(AttributeError, f) # Systematic tests of the text I/O API @@ -990,7 +1437,7 @@ f.close() def testSeeking(self): - chunk_size = io.TextIOWrapper._CHUNK_SIZE + chunk_size = _default_chunk_size() prefix_size = chunk_size - 2 u_prefix = "a" * prefix_size prefix = bytes(u_prefix.encode("utf-8")) @@ -1021,9 +1468,7 @@ def testSeekAndTell(self): """Test seek/tell using the StatefulIncrementalDecoder.""" - # Make this test faster by forcing a smaller (but large enough) - # chunk size. The bigger the chunker size, the slower seek() is, - # as it tries to replay character decoding one byte at a time. + # Make test faster by doing smaller seeks CHUNK_SIZE = 256 def testSeekAndTellWithData(data, min_pos=0): @@ -1033,13 +1478,13 @@ f.write(data) f.close() f = io.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._CHUNK_SIZE = CHUNK_SIZE self.assertEquals(f.read(i), decoded[:i]) cookie = f.tell() self.assertEquals(f.read(j), decoded[i:i + j]) @@ -1057,6 +1502,7 @@ testSeekAndTellWithData(input) # Position each test case so that it crosses a chunk boundary. + #CHUNK_SIZE = _default_chunk_size() for input, _, _ in StatefulIncrementalDecoderTest.test_cases: offset = CHUNK_SIZE - len(input)//2 prefix = b'.'*offset @@ -1328,52 +1774,16 @@ f.close() g.close() - def test_io_after_close(self): - for kwargs in [ - {"mode": "w"}, - {"mode": "wb"}, - {"mode": "w", "buffering": 1}, - {"mode": "w", "buffering": 2}, - {"mode": "wb", "buffering": 0}, - {"mode": "r"}, - {"mode": "rb"}, - {"mode": "r", "buffering": 1}, - {"mode": "r", "buffering": 2}, - {"mode": "rb", "buffering": 0}, - {"mode": "w+"}, - {"mode": "w+b"}, - {"mode": "w+", "buffering": 1}, - {"mode": "w+", "buffering": 2}, - {"mode": "w+b", "buffering": 0}, - ]: - f = io.open(support.TESTFN, **kwargs) - f.close() - self.assertRaises(ValueError, f.flush) - self.assertRaises(ValueError, f.fileno) - self.assertRaises(ValueError, f.isatty) - self.assertRaises(ValueError, f.__iter__) - if hasattr(f, "peek"): - self.assertRaises(ValueError, f.peek, 1) - self.assertRaises(ValueError, f.read) - if hasattr(f, "read1"): - self.assertRaises(ValueError, f.read1, 1024) - if hasattr(f, "readinto"): - self.assertRaises(ValueError, f.readinto, bytearray(1024)) - self.assertRaises(ValueError, f.readline) - self.assertRaises(ValueError, f.readlines) - self.assertRaises(ValueError, f.seek, 0) - self.assertRaises(ValueError, f.tell) - self.assertRaises(ValueError, f.truncate) - self.assertRaises(ValueError, f.write, "") - self.assertRaises(ValueError, f.writelines, []) - def test_main(): - support.run_unittest(IOTest, BytesIOTest, StringIOTest, + support.run_unittest( + IOTest, BytesIOTest, StringIOTest, BufferedReaderTest, BufferedWriterTest, BufferedRWPairTest, BufferedRandomTest, StatefulIncrementalDecoderTest, - TextIOWrapperTest, MiscIOTest) + TextIOWrapperTest, MiscIOTest + ) if __name__ == "__main__": - unittest.main() + test_main() + #unittest.main() From python-checkins at python.org Sun Jan 18 00:22:04 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:22:04 +0100 (CET) Subject: [Python-checkins] r68685 - python/branches/io-c/Lib/test/test_fileio.py Message-ID: <20090117232204.DFB521E4026@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:22:04 2009 New Revision: 68685 Log: Fix test_fileio Modified: python/branches/io-c/Lib/test/test_fileio.py 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 Jan 18 00:22:04 2009 @@ -9,13 +9,13 @@ from test.support import TESTFN, findfile, check_warnings, run_unittest from collections import UserList -import _fileio +from _io import FileIO as _FileIO class AutoFileTests(unittest.TestCase): # file tests for which a test file is automatically set up def setUp(self): - self.f = _fileio._FileIO(TESTFN, 'w') + self.f = _FileIO(TESTFN, 'w') def tearDown(self): if self.f: @@ -62,13 +62,13 @@ self.f.write(bytes([1, 2])) self.f.close() a = array('b', b'x'*10) - self.f = _fileio._FileIO(TESTFN, 'r') + self.f = _FileIO(TESTFN, 'r') n = self.f.readinto(a) self.assertEquals(array('b', [1, 2]), a[:n]) def testRepr(self): self.assertEquals(repr(self.f), - "_fileio._FileIO(%d, %s)" % (self.f.fileno(), + "io.FileIO(%d, %s)" % (self.f.fileno(), repr(self.f.mode))) def testErrors(self): @@ -79,7 +79,7 @@ self.assertRaises(ValueError, f.read, 10) # Open for reading f.close() self.assert_(f.closed) - f = _fileio._FileIO(TESTFN, 'r') + f = _FileIO(TESTFN, 'r') self.assertRaises(TypeError, f.readinto, "") self.assert_(not f.closed) f.close() @@ -105,7 +105,7 @@ # Windows always returns "[Errno 13]: Permission denied # Unix calls dircheck() and returns "[Errno 21]: Is a directory" try: - _fileio._FileIO('.', 'r') + _FileIO('.', 'r') except IOError as e: self.assertNotEqual(e.errno, 0) self.assertEqual(e.filename, ".") @@ -117,19 +117,19 @@ def testAbles(self): try: - f = _fileio._FileIO(TESTFN, "w") + f = _FileIO(TESTFN, "w") self.assertEquals(f.readable(), False) self.assertEquals(f.writable(), True) self.assertEquals(f.seekable(), True) f.close() - f = _fileio._FileIO(TESTFN, "r") + f = _FileIO(TESTFN, "r") self.assertEquals(f.readable(), True) self.assertEquals(f.writable(), False) self.assertEquals(f.seekable(), True) f.close() - f = _fileio._FileIO(TESTFN, "a+") + f = _FileIO(TESTFN, "a+") self.assertEquals(f.readable(), True) self.assertEquals(f.writable(), True) self.assertEquals(f.seekable(), True) @@ -138,14 +138,14 @@ if sys.platform != "win32": try: - f = _fileio._FileIO("/dev/tty", "a") + f = _FileIO("/dev/tty", "a") except EnvironmentError: # When run in a cron job there just aren't any # ttys, so skip the test. This also handles other # OS'es that don't support /dev/tty. pass else: - f = _fileio._FileIO("/dev/tty", "a") + f = _FileIO("/dev/tty", "a") self.assertEquals(f.readable(), False) self.assertEquals(f.writable(), True) if sys.platform != "darwin" and \ @@ -162,7 +162,7 @@ # check invalid mode strings for mode in ("", "aU", "wU+", "rw", "rt"): try: - f = _fileio._FileIO(TESTFN, mode) + f = _FileIO(TESTFN, mode) except ValueError: pass else: @@ -171,7 +171,7 @@ def testUnicodeOpen(self): # verify repr works for unicode too - f = _fileio._FileIO(str(TESTFN), "w") + f = _FileIO(str(TESTFN), "w") f.close() os.unlink(TESTFN) @@ -179,7 +179,7 @@ # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" try: - f = _fileio._FileIO(TESTFN, bad_mode) + f = _FileIO(TESTFN, bad_mode) except ValueError as msg: if msg.args[0] != 0: s = str(msg) @@ -195,11 +195,11 @@ def bug801631(): # SF bug # "file.truncate fault on windows" - f = _fileio._FileIO(TESTFN, 'w') + f = _FileIO(TESTFN, 'w') f.write(bytes(range(11))) f.close() - f = _fileio._FileIO(TESTFN,'r+') + f = _FileIO(TESTFN,'r+') data = f.read(5) if data != bytes(range(5)): self.fail("Read on file opened for update failed %r" % data) @@ -239,14 +239,14 @@ pass def testInvalidInit(self): - self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0) + self.assertRaises(TypeError, _FileIO, "1", 0, 0) def testWarnings(self): with check_warnings() as w: self.assertEqual(w.warnings, []) - self.assertRaises(TypeError, _fileio._FileIO, []) + self.assertRaises(TypeError, _FileIO, []) self.assertEqual(w.warnings, []) - self.assertRaises(ValueError, _fileio._FileIO, "/some/invalid/name", "rt") + self.assertRaises(ValueError, _FileIO, "/some/invalid/name", "rt") self.assertEqual(w.warnings, []) From buildbot at python.org Sun Jan 18 00:24:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 17 Jan 2009 23:24:06 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.0 Message-ID: <20090117232406.A15EC1E4010@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/24 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: amaury.forgeotdarc,antoine.pitrou,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile ====================================================================== ERROR: testAbsoluteArcnames (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 494, in testAbsoluteArcnames zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testDeflated (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 487, in testDeflated self.zipTest(f, zipfile.ZIP_DEFLATED) File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory ====================================================================== ERROR: testStored (test.test_zipfile.TestZip64InSmallFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 481, in testStored self.zipTest(f, zipfile.ZIP_STORED) File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/test/test_zipfile.py", line 428, in zipTest zipfp = zipfile.ZipFile(f, "r", compression) File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 696, in __init__ self._GetContents() File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/zipfile.py", line 753, in _RealGetContents raise BadZipfile("Bad magic number for central directory") zipfile.BadZipfile: Bad magic number for central directory make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 18 00:28:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 00:28:17 +0100 (CET) Subject: [Python-checkins] r68686 - python/branches/py3k Message-ID: <20090117232817.4D18A1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 00:28:17 2009 New Revision: 68686 Log: I'm just going to assume that all of these revisions don't need to be merge, since it's not indicated: Blocked revisions 68559,68562,68565-68567,68569,68603-68605 via svnmerge ........ r68559 | raymond.hettinger | 2009-01-12 16:58:41 -0600 (Mon, 12 Jan 2009) | 1 line Issue 1696199: Add collections.Counter(). ........ r68562 | raymond.hettinger | 2009-01-12 19:05:03 -0600 (Mon, 12 Jan 2009) | 7 lines Simplify Counter() API. Replace items keyword argument with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work. ........ r68565 | raymond.hettinger | 2009-01-12 21:49:43 -0600 (Mon, 12 Jan 2009) | 1 line Minor documentation tweaks and simpler update() example. ........ r68566 | raymond.hettinger | 2009-01-12 22:13:53 -0600 (Mon, 12 Jan 2009) | 1 line Fixup and simplify docstrings and doctests. ........ r68567 | raymond.hettinger | 2009-01-12 22:50:35 -0600 (Mon, 12 Jan 2009) | 1 line Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. ........ r68569 | raymond.hettinger | 2009-01-13 02:38:14 -0600 (Tue, 13 Jan 2009) | 7 lines Add table of idioms/patterns for using Counter objects. Improve the appearance and flow of the References section -- it used to have a box around it that wasn't distinct from the preceding code boxes and it had a weird bolding pattern and hanging indents that made the section disproportionately large. ........ r68603 | raymond.hettinger | 2009-01-13 18:15:21 -0600 (Tue, 13 Jan 2009) | 1 line Minor doc tweaks. ........ r68604 | raymond.hettinger | 2009-01-13 19:15:06 -0600 (Tue, 13 Jan 2009) | 1 line Add tests for __init__() and update() with no args. ........ r68605 | raymond.hettinger | 2009-01-13 19:39:51 -0600 (Tue, 13 Jan 2009) | 1 line Fix-up indentation of sample code blocks for namedtuple mthod definitions. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun Jan 18 00:35:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:35:11 +0100 (CET) Subject: [Python-checkins] r68687 - python/branches/io-c/Makefile.pre.in Message-ID: <20090117233511.A02291E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:35:11 2009 New Revision: 68687 Log: Add dependency to _iomodule.h for the various C sources Modified: python/branches/io-c/Makefile.pre.in Modified: python/branches/io-c/Makefile.pre.in ============================================================================== --- python/branches/io-c/Makefile.pre.in (original) +++ python/branches/io-c/Makefile.pre.in Sun Jan 18 00:35:11 2009 @@ -193,6 +193,15 @@ # Used of signalmodule.o is not available SIGNAL_OBJS= @SIGNAL_OBJS@ +IO_H= Modules/_iomodule.h + +IO_OBJS= \ + Modules/io.o \ + Modules/_iobase.o \ + Modules/_fileio.o \ + Modules/_bufferedio.o \ + Modules/_textio.o \ + Modules/_bytesio.o ########################################################################## # Grammar @@ -511,6 +520,7 @@ Modules/python.o: $(srcdir)/Modules/python.c $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c +$(IO_OBJS): $(IO_H) $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) -@$(INSTALL) -d Include From python-checkins at python.org Sun Jan 18 00:38:18 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:38:18 +0100 (CET) Subject: [Python-checkins] r68688 - python/branches/io-c/Modules/_iomodule.h Message-ID: <20090117233818.8ADF91E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:38:18 2009 New Revision: 68688 Log: These precautions are not needed anymore! Modified: python/branches/io-c/Modules/_iomodule.h Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sun Jan 18 00:38:18 2009 @@ -1,20 +1,4 @@ /* - * Temporarily rename symbols, to avoid mismatches with the main executable - */ -#define PyRawIOBase_Type _newio_PyRawIOBase_Type -#define PyFileIO_Type _newio_PyFileIO_Type -#define PyBytesIO_Type _newio_PyBytesIO_Type -#define PyIOBase_Type _newio_PyIOBase_Type -#define PyRawIOBase_Type _newio_PyRawIOBase_Type -#define PyBufferedIOBase_Type _newio_PyBufferedIOBase_Type -#define PyBufferedReader_Type _newio_PyBufferedReader_Type -#define PyBufferedWriter_Type _newio_PyBufferedWriter_Type -#define PyBufferedRWPair_Type _newio_PyBufferedRWPair_Type -#define PyBufferedRandom_Type _newio_PyBufferedRandom_Type -#define PyTextIOWrapper_Type _newio_PyTextIOWrapper_Type -#define PyIncrementalNewlineDecoder_Type _newio_PyIncrementalNewlineDecoder_Type - -/* * Declarations shared between the different parts of the io module */ From python-checkins at python.org Sun Jan 18 00:41:48 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:41:48 +0100 (CET) Subject: [Python-checkins] r68689 - python/branches/io-c/Lib/test/test_descr.py Message-ID: <20090117234148.67F6C1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:41:48 2009 New Revision: 68689 Log: Fix another test Modified: python/branches/io-c/Lib/test/test_descr.py 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 Jan 18 00:41:48 2009 @@ -2623,10 +2623,10 @@ def test_descrdoc(self): # Testing descriptor doc strings... - from _fileio import _FileIO + from _io import FileIO def check(descr, what): self.assertEqual(descr.__doc__, what) - check(_FileIO.closed, "True if the file is closed") # getset descriptor + check(FileIO.closed, "True if the file is closed") # getset descriptor check(complex.real, "the real part of a complex number") # member descriptor def test_doc_descriptor(self): From python-checkins at python.org Sun Jan 18 00:43:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 00:43:59 +0100 (CET) Subject: [Python-checkins] r68690 - in python/branches/py3k: Python/ceval.c Message-ID: <20090117234359.53BD41E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 00:43:58 2009 New Revision: 68690 Log: Merged revisions 68460 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68460 | kristjan.jonsson | 2009-01-09 14:31:26 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4293: Make Py_AddPendingCall() thread safe ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Python/ceval.c Modified: python/branches/py3k/Python/ceval.c ============================================================================== --- python/branches/py3k/Python/ceval.c (original) +++ python/branches/py3k/Python/ceval.c Sun Jan 18 00:43:58 2009 @@ -205,6 +205,7 @@ #include "pythread.h" static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */ +static PyThread_type_lock pending_lock = 0; /* for pending calls */ static long main_thread = 0; int @@ -276,6 +277,7 @@ adding a new function to each thread_*.h. Instead, just create a new lock and waste a little bit of memory */ interpreter_lock = PyThread_allocate_lock(); + pending_lock = PyThread_allocate_lock(); PyThread_acquire_lock(interpreter_lock, 1); main_thread = PyThread_get_thread_ident(); @@ -348,19 +350,145 @@ #ifdef WITH_THREAD Any thread can schedule pending calls, but only the main thread will execute them. + There is no facility to schedule calls to a particular thread, but + that should be easy to change, should that ever be required. In + that case, the static variables here should go into the python + threadstate. #endif +*/ + +#ifdef WITH_THREAD + +/* The WITH_THREAD implementation is thread-safe. It allows + scheduling to be made from any thread, and even from an executing + callback. + */ + +#define NPENDINGCALLS 32 +static struct { + int (*func)(void *); + void *arg; +} pendingcalls[NPENDINGCALLS]; +static int pendingfirst = 0; +static int pendinglast = 0; +static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */ +static char pendingbusy = 0; + +int +Py_AddPendingCall(int (*func)(void *), void *arg) +{ + int i, j, result=0; + PyThread_type_lock lock = pending_lock; + + /* try a few times for the lock. Since this mechanism is used + * for signal handling (on the main thread), there is a (slim) + * chance that a signal is delivered on the same thread while we + * hold the lock during the Py_MakePendingCalls() function. + * This avoids a deadlock in that case. + * Note that signals can be delivered on any thread. In particular, + * on Windows, a SIGINT is delivered on a system-created worker + * thread. + * We also check for lock being NULL, in the unlikely case that + * this function is called before any bytecode evaluation takes place. + */ + if (lock != NULL) { + for (i = 0; i<100; i++) { + if (PyThread_acquire_lock(lock, NOWAIT_LOCK)) + break; + } + if (i == 100) + return -1; + } - XXX WARNING! ASYNCHRONOUSLY EXECUTING CODE! + i = pendinglast; + j = (i + 1) % NPENDINGCALLS; + if (j == pendingfirst) { + result = -1; /* Queue full */ + } else { + pendingcalls[i].func = func; + pendingcalls[i].arg = arg; + pendinglast = j; + } + /* signal main loop */ + _Py_Ticker = 0; + pendingcalls_to_do = 1; + if (lock != NULL) + PyThread_release_lock(lock); + return result; +} + +int +Py_MakePendingCalls(void) +{ + int i; + int r = 0; + + if (!pending_lock) { + /* initial allocation of the lock */ + pending_lock = PyThread_allocate_lock(); + if (pending_lock == NULL) + return -1; + } + + /* only service pending calls on main thread */ + if (main_thread && PyThread_get_thread_ident() != main_thread) + return 0; + /* don't perform recursive pending calls */ + if (pendingbusy) + return 0; + pendingbusy = 1; + /* perform a bounded number of calls, in case of recursion */ + for (i=0; i Author: benjamin.peterson Date: Sun Jan 18 00:46:54 2009 New Revision: 68691 Log: fix compiler warning Modified: python/branches/py3k/Python/ceval.c Modified: python/branches/py3k/Python/ceval.c ============================================================================== --- python/branches/py3k/Python/ceval.c (original) +++ python/branches/py3k/Python/ceval.c Sun Jan 18 00:46:54 2009 @@ -441,7 +441,7 @@ for (i=0; i Author: benjamin.peterson Date: Sun Jan 18 00:48:19 2009 New Revision: 68692 Log: Blocked revisions 68690-68691 via svnmerge ................ r68690 | benjamin.peterson | 2009-01-17 17:43:58 -0600 (Sat, 17 Jan 2009) | 9 lines Merged revisions 68460 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68460 | kristjan.jonsson | 2009-01-09 14:31:26 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4293: Make Py_AddPendingCall() thread safe ........ ................ r68691 | benjamin.peterson | 2009-01-17 17:46:54 -0600 (Sat, 17 Jan 2009) | 1 line fix compiler warning ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 18 00:49:58 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 00:49:58 +0100 (CET) Subject: [Python-checkins] r68693 - python/branches/io-c/Lib/test/test_uu.py Message-ID: <20090117234958.62C981E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 00:49:58 2009 New Revision: 68693 Log: Fix test_uu (which was using private attributes of TextIOWrapper) Modified: python/branches/io-c/Lib/test/test_uu.py Modified: python/branches/io-c/Lib/test/test_uu.py ============================================================================== --- python/branches/io-c/Lib/test/test_uu.py (original) +++ python/branches/io-c/Lib/test/test_uu.py Sun Jan 18 00:49:58 2009 @@ -32,6 +32,8 @@ encoding=encoding, errors=errors, newline=newline) + self._encoding = encoding + self._errors = errors if initial_value: if not isinstance(initial_value, str): initial_value = str(initial_value) From python-checkins at python.org Sun Jan 18 00:56:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 00:56:00 +0100 (CET) Subject: [Python-checkins] r68694 - sandbox/trunk/2to3/lib2to3/fixes/fix_except.py Message-ID: <20090117235600.29AA81E4015@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 00:55:59 2009 New Revision: 68694 Log: test for specific node type Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_except.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_except.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_except.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_except.py Sun Jan 18 00:55:59 2009 @@ -25,11 +25,11 @@ from .. import pytree from ..pgen2 import token from .. import fixer_base -from ..fixer_util import Assign, Attr, Name, is_tuple, is_list +from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms def find_excepts(nodes): for i, n in enumerate(nodes): - if isinstance(n, pytree.Node): + if n.type == syms.except_clause: if n.children[0].value == 'except': yield (n, nodes[i+2]) From python-checkins at python.org Sun Jan 18 01:04:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 01:04:57 +0100 (CET) Subject: [Python-checkins] r68695 - in python/branches/py3k: Lib/http/client.py Message-ID: <20090118000457.DF56D1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 01:04:57 2009 New Revision: 68695 Log: Merged revisions 68458 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68458 | kristjan.jonsson | 2009-01-09 14:23:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. ........ Modified: python/branches/py3k/ (props changed) 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 Jan 18 01:04:57 2009 @@ -697,6 +697,7 @@ """Send the currently buffered request and clear the buffer. Appends an extra \\r\\n to the buffer. + A message_body may be specified, to be appended to the request. """ self._buffer.extend((b"", b"")) msg = b"\r\n".join(self._buffer) @@ -704,9 +705,14 @@ # If msg and message_body are sent in a single send() call, # it will avoid performance problems caused by the interaction # between delayed ack and the Nagle algorithim. - if message_body is not None: + if isinstance(message_body, bytes): msg += message_body + message_body = None self.send(msg) + if message_body is not None: + #message_body was not a string (i.e. it is a file) and + #we must run the risk of Nagle + self.send(message_body) def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): """Send a request to the server. @@ -894,12 +900,7 @@ self._set_content_length(body) for hdr, value in headers.items(): self.putheader(hdr, value) - if isinstance(body, str): - self.endheaders(body.encode('ascii')) - else: - self.endheaders() - if body: # when body is a file rather than a string - self.send(body) + self.endheaders(body.encode('ascii') if isinstance(body, str) else body) def getresponse(self): """Get the response from the server.""" From python-checkins at python.org Sun Jan 18 01:08:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 01:08:45 +0100 (CET) Subject: [Python-checkins] r68696 - in python/branches/py3k: Lib/logging/handlers.py Message-ID: <20090118000845.513FF1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 01:08:45 2009 New Revision: 68696 Log: Merged revisions 68459 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68459 | kristjan.jonsson | 2009-01-09 14:27:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/logging/handlers.py Modified: python/branches/py3k/Lib/logging/handlers.py ============================================================================== --- python/branches/py3k/Lib/logging/handlers.py (original) +++ python/branches/py3k/Lib/logging/handlers.py Sun Jan 18 01:08:45 2009 @@ -1024,9 +1024,7 @@ h.putheader("Content-type", "application/x-www-form-urlencoded") h.putheader("Content-length", str(len(data))) - h.endheaders() - if self.method == "POST": - h.send(data) + h.endheaders(data if self.method == "POST" else None) h.getreply() #can't do anything with the result except (KeyboardInterrupt, SystemExit): raise From python-checkins at python.org Sun Jan 18 01:10:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 01:10:27 +0100 (CET) Subject: [Python-checkins] r68697 - python/branches/release30-maint Message-ID: <20090118001027.70E081E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 01:10:27 2009 New Revision: 68697 Log: Blocked revisions 68695-68696 via svnmerge ................ r68695 | benjamin.peterson | 2009-01-17 18:04:57 -0600 (Sat, 17 Jan 2009) | 9 lines Merged revisions 68458 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68458 | kristjan.jonsson | 2009-01-09 14:23:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. ........ ................ r68696 | benjamin.peterson | 2009-01-17 18:08:45 -0600 (Sat, 17 Jan 2009) | 9 lines Merged revisions 68459 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68459 | kristjan.jonsson | 2009-01-09 14:27:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. ........ ................ Modified: python/branches/release30-maint/ (props changed) From brett at python.org Sun Jan 18 01:16:18 2009 From: brett at python.org (Brett Cannon) Date: Sat, 17 Jan 2009 16:16:18 -0800 Subject: [Python-checkins] r68662 - in python/branches/py3k: Lib/zipfile.py In-Reply-To: <20090117164227.2795A1E4002@bag.python.org> References: <20090117164227.2795A1E4002@bag.python.org> Message-ID: test_zipfile has been failing forpy3k. Is this the cause or one of the other zipfile patches? On Sat, Jan 17, 2009 at 08:42, amaury. forgeotdarc wrote: > Author: amaury.forgeotdarc > Date: Sat Jan 17 17:42:26 2009 > New Revision: 68662 > > Log: > Merged revisions 68661 via svnmerge from > svn+ssh://pythondev at svn.python.org/python/trunk > > ........ > r68661 | amaury.forgeotdarc | 2009-01-17 17:40:17 +0100 (Sat, 17 Jan 2009) | 5 lines > > #3997: zipfiles generated with more than 65536 files could not be opened > with other applications. > > Reviewed by Martin, will backport to 2.6 and 3.0 > ........ > > > Modified: > python/branches/py3k/ (props changed) > python/branches/py3k/Lib/zipfile.py > > Modified: python/branches/py3k/Lib/zipfile.py > ============================================================================== > --- python/branches/py3k/Lib/zipfile.py (original) > +++ python/branches/py3k/Lib/zipfile.py Sat Jan 17 17:42:26 2009 > @@ -28,7 +28,7 @@ > > error = BadZipfile # The exception raised by this module > > -ZIP64_LIMIT= (1 << 31) - 1 > +ZIP64_LIMIT = (1 << 31) - 1 > ZIP_FILECOUNT_LIMIT = 1 << 16 > ZIP_MAX_COMMENT = (1 << 16) - 1 > > @@ -1198,19 +1198,26 @@ > > pos2 = self.fp.tell() > # Write end-of-zip-archive record > + centDirCount = count > + centDirSize = pos2 - pos1 > centDirOffset = pos1 > - if pos1 > ZIP64_LIMIT: > + if (centDirCount >= ZIP_FILECOUNT_LIMIT or > + centDirOffset > ZIP64_LIMIT or > + centDirSize > ZIP64_LIMIT): > # Need to write the ZIP64 end-of-archive records > zip64endrec = struct.pack( > structEndArchive64, stringEndArchive64, > - 44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1) > + 44, 45, 45, 0, 0, centDirCount, centDirCount, > + centDirSize, centDirOffset) > self.fp.write(zip64endrec) > > zip64locrec = struct.pack( > structEndArchive64Locator, > stringEndArchive64Locator, 0, pos2, 1) > self.fp.write(zip64locrec) > - centDirOffset = 0xFFFFFFFF > + centDirCount = min(centDirCount, 0xFFFF) > + centDirSize = min(centDirSize, 0xFFFFFFFF) > + centDirOffset = min(centDirOffset, 0xFFFFFFFF) > > # check for valid comment length > if len(self.comment) >= ZIP_MAX_COMMENT: > @@ -1220,9 +1227,8 @@ > self.comment = self.comment[:ZIP_MAX_COMMENT] > > endrec = struct.pack(structEndArchive, stringEndArchive, > - 0, 0, count % ZIP_FILECOUNT_LIMIT, > - count % ZIP_FILECOUNT_LIMIT, pos2 - pos1, > - centDirOffset, len(self.comment)) > + 0, 0, centDirCount, centDirCount, > + centDirSize, centDirOffset, len(self.comment)) > self.fp.write(endrec) > self.fp.write(self.comment) > self.fp.flush() > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From python-checkins at python.org Sun Jan 18 01:24:30 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 18 Jan 2009 01:24:30 +0100 (CET) Subject: [Python-checkins] r68698 - in python/branches/py3k/Lib: importlib importlib/NOTES importlib/__init__.py importlib/_bootstrap.py importlib/test importlib/test/__init__.py importlib/test/builtin importlib/test/builtin/__init__.py importlib/test/builtin/test_finder.py importlib/test/builtin/test_loader.py importlib/test/extension importlib/test/extension/__init__.py importlib/test/extension/test_case_sensitivity.py importlib/test/extension/test_finder.py importlib/test/extension/test_loader.py importlib/test/extension/test_path_hook.py importlib/test/finder_tests.py importlib/test/frozen importlib/test/frozen/__init__.py importlib/test/frozen/support.py importlib/test/frozen/test_finder.py importlib/test/frozen/test_loader.py importlib/test/import_ importlib/test/import_/__init__.py importlib/test/import_/test___package__.py importlib/test/import_/test_caching.py importlib/test/import_/test_fromlist.py importlib/test/import_/test_meta_path.py importlib/test/import_/test_packages.py importlib/test/import_/test_path.py importlib/test/import_/test_relative_imports.py importlib/test/source importlib/test/source/__init__.py importlib/test/source/test_case_sensitivity.py importlib/test/source/test_finder.py importlib/test/source/test_loader.py importlib/test/source/test_path_hook.py importlib/test/source/test_reload.py importlib/test/source/test_source_encoding.py importlib/test/support.py importlib/test/test_api.py test/test_importlib.py Message-ID: <20090118002430.AF9711E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 18 01:24:28 2009 New Revision: 68698 Log: Add initial implementation of importlib. See the NOTES files for what is planned for the package. There are no docs yet, but they are coming once the API for the first new function, importlib.import_module() is finalized. Added: python/branches/py3k/Lib/importlib/ 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/ python/branches/py3k/Lib/importlib/test/__init__.py python/branches/py3k/Lib/importlib/test/builtin/ python/branches/py3k/Lib/importlib/test/builtin/__init__.py 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/ python/branches/py3k/Lib/importlib/test/extension/__init__.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_loader.py python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py python/branches/py3k/Lib/importlib/test/finder_tests.py python/branches/py3k/Lib/importlib/test/frozen/ python/branches/py3k/Lib/importlib/test/frozen/__init__.py python/branches/py3k/Lib/importlib/test/frozen/support.py python/branches/py3k/Lib/importlib/test/frozen/test_finder.py python/branches/py3k/Lib/importlib/test/frozen/test_loader.py python/branches/py3k/Lib/importlib/test/import_/ python/branches/py3k/Lib/importlib/test/import_/__init__.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/ python/branches/py3k/Lib/importlib/test/source/__init__.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_reload.py python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py python/branches/py3k/Lib/importlib/test/support.py python/branches/py3k/Lib/importlib/test/test_api.py python/branches/py3k/Lib/test/test_importlib.py Added: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/NOTES Sun Jan 18 01:24:28 2009 @@ -0,0 +1,78 @@ +to do +///// + +* Write importlib.__import__ + +* Document + + Package. + + import_module + + __import__ + +* Create reasonable base tests that all finders and loaders must pass so + that various implementations can just subclass as needed. + +* Expose built-in and frozen importers. + + Make staticmethods so that class can be used directly. + +* 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. + +* Implement PEP 302 protocol for loaders (should just be a matter of testing). + + Built-in. + + Frozen. + + Extension. + + Source/bytecode. + +* 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. + +* Public API (w/ docs!) + + abc + - Finder + * find_module + - Loader + * load_module + - ResourceLoader(Loader) + * get_data + - InspectLoader(Loader) + * is_package + * get_code + * get_source + - (?) SourceLoader(ResourceLoader) + * source_path + * bytecode_path + * write_bytecode + + util + - get_module decorator (new name) + - check_name decorator (new name) + + hooks (?) + - (?) Chained path hook/finder + - BuiltinImporter + - FrozenImporter + - (?) FileFinder + - Extensions importers + * ExtensionFinder + * (?) Loader + - Source/bytecode importers + * SourceFinder + * (?) Loader + + __init__ + - __import__ + - import_module (backport to 2.7) + - resolve_name (backport to 2.7) Added: python/branches/py3k/Lib/importlib/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,133 @@ +"""A pure Python implementation of import. + +References on import: + + * Language reference + http://docs.python.org/ref/import.html + * __import__ function + http://docs.python.org/lib/built-in-funcs.html + * Packages + http://www.python.org/doc/essays/packages.html + * PEP 235: Import on Case-Insensitive Platforms + http://www.python.org/dev/peps/pep-0235 + * PEP 275: Import Modules from Zip Archives + http://www.python.org/dev/peps/pep-0273 + * PEP 302: New Import Hooks + http://www.python.org/dev/peps/pep-0302/ + * PEP 328: Imports: Multi-line and Absolute/Relative + http://www.python.org/dev/peps/pep-0328 + +""" +from . import _bootstrap + +# XXX Temporary functions that should eventually be removed. +import os +import re +import tokenize + +def _set__import__(): + """Set __import__ to an instance of Import.""" + global original__import__ + original__import__ = __import__ + __builtins__['__import__'] = Import() + + +def _reset__import__(): + """Set __import__ back to the original implementation (assumes + _set__import__ was called previously).""" + __builtins__['__import__'] = original__import__ + + +def _case_ok(directory, check): + """Check if the directory contains something matching 'check'. + + No check is done if the file/directory exists or not. + + """ + if 'PYTHONCASEOK' in os.environ: + return True + elif check in os.listdir(directory): + return True + return False + + +def _w_long(x): + """Convert a 32-bit integer to little-endian. + + XXX Temporary until marshal's long functions are exposed. + + """ + x = int(x) + int_bytes = [] + int_bytes.append(x & 0xFF) + int_bytes.append((x >> 8) & 0xFF) + int_bytes.append((x >> 16) & 0xFF) + int_bytes.append((x >> 24) & 0xFF) + return bytearray(int_bytes) + + +def _r_long(int_bytes): + """Convert 4 bytes in little-endian to an integer. + + XXX Temporary until marshal's long function are exposed. + + """ + x = int_bytes[0] + x |= int_bytes[1] << 8 + x |= int_bytes[2] << 16 + x |= int_bytes[3] << 24 + return x + + +def import_module(name, package=None): + """Import a module. + + The 'package' argument is used to resolve relative import names. Typically + this is the __package__ attribute of the module making the function call. + + """ + 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] + + + +# Required built-in modules. +try: + import posix as _os +except ImportError: + try: + import nt as _os + except ImportError: + try: + import os2 as _os + except ImportError: + raise ImportError('posix, nt, or os2 module required for importlib') +_bootstrap._os = _os +import imp, sys, marshal, errno, _fileio +_bootstrap.imp = imp +_bootstrap.sys = sys +_bootstrap.marshal = marshal +_bootstrap.errno = errno +_bootstrap._fileio = _fileio +import _warnings +_bootstrap._warnings = _warnings + + +from os import sep +# For os.path.join replacement; pull from Include/osdefs.h:SEP . +_bootstrap.path_sep = sep + +_bootstrap._case_ok = _case_ok +marshal._w_long = _w_long +marshal._r_long = _r_long + +from ._bootstrap import * Added: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,997 @@ +"""Core implementation of import. + +This module is NOT meant to be directly imported! It has been designed such +that it can be bootstrapped into Python as the implementation of import. As +such it requires the injection of specific modules and attributes in order to +work. One should use importlib as the public-facing version of this module. + +""" + +# Injected modules are '_warnings', 'imp', 'sys', 'marshal', 'errno', and '_os' +# (a.k.a. 'posix', 'nt' or 'os2'). +# Injected attribute is path_sep. +# +# When editing this code be aware that code executed at import time CANNOT +# reference any injected objects! This includes not only global code but also +# anything specified at the class level. + + +# XXX Could also expose Modules/getpath.c:joinpath() +def _path_join(*args): + """Replacement for os.path.join.""" + return path_sep.join(x[:-len(path_sep)] if x.endswith(path_sep) else x + for x in args) + + +def _path_exists(path): + """Replacement for os.path.exists.""" + try: + _os.stat(path) + except OSError: + return False + else: + return True + + +def _path_is_mode_type(path, mode): + """Test whether the path is the specified mode type.""" + try: + stat_info = _os.stat(path) + except OSError: + return False + return (stat_info.st_mode & 0o170000) == mode + + +# XXX Could also expose Modules/getpath.c:isfile() +def _path_isfile(path): + """Replacement for os.path.isfile.""" + return _path_is_mode_type(path, 0o100000) + + +# XXX Could also expose Modules/getpath.c:isdir() +def _path_isdir(path): + """Replacement for os.path.isdir.""" + return _path_is_mode_type(path, 0o040000) + + +def _path_without_ext(path, ext_type): + """Replacement for os.path.splitext()[0].""" + for suffix in suffix_list(ext_type): + if path.endswith(suffix): + return path[:-len(suffix)] + else: + raise ValueError("path is not of the specified type") + + +def _path_absolute(path): + """Replacement for os.path.abspath.""" + if not path: + path = _os.getcwd() + try: + return _os._getfullpathname(path) + except AttributeError: + if path.startswith('/'): + return path + else: + return _path_join(_os.getcwd(), path) + + +class closing: + + """Simple replacement for contextlib.closing.""" + + def __init__(self, obj): + self.obj = obj + + def __enter__(self): + return self.obj + + def __exit__(self, *args): + self.obj.close() + + +class _BuiltinFrozenBaseLoader(object): + + """Base class for meta_path loaders for built-in and frozen modules. + + Subclasses must implement: + + * _find(fullname:str) -> bool + Finder which returns whether the class can handle the module. + + * _load(fullname:str) -> module + Loader which returns the loaded module. The check for sys.modules + does not need to be handled by this method. + + * type_:str + Name of the type of module being handled. Used in error messages. + + """ + + def find_module(self, fullname, path=None): + """Find a module.""" + if not self._find(fullname): + return None + return self + + def load_module(self, fullname): + """Load a module.""" + try: + return sys.modules[fullname] + except KeyError: + pass + mod = self._load(fullname) + if not mod: + raise ImportError("expected {0} module not " + "loaded".format(self.type_)) + return mod + + +class BuiltinImporter(_BuiltinFrozenBaseLoader): + + """Meta path loader for built-in modules.""" + + type_ = "built-in" + + def __init__(self): + """Set the methods needed by the class. + + Cannot be set at the class level because the imp module is not + necessarily injected until after the class is created. + + """ + self._find = imp.is_builtin + self._load = imp.init_builtin + + def find_module(self, fullname, path=None): + """Try to find the built-in module. + + If 'path' is ever specified then the search is considered a failure. + + """ + if path is not None: + return None + return super().find_module(fullname, path) + + def load_module(self, 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 super().load_module(fullname) + + +class FrozenImporter(_BuiltinFrozenBaseLoader): + + """Meta path class for importing frozen modules.""" + + type_ = 'frozen' + + def __init__(self): + """Specify the methods needed by the superclass. + + Because imp may not be injected until after class creation these + methods cannot be set at the class level. + + """ + self._find = imp.is_frozen + self._load = imp.init_frozen + + def load_module(self, fullname): + """Load a frozen module.""" + if not self.find_module(fullname): + raise ImportError("{0} is not a frozen module".format(fullname)) + return super().load_module(fullname) + + +class ChainedImporter(object): + + """Finder that sequentially calls other finders.""" + + def __init__(self, *importers): + self._importers = importers + + def find_module(self, fullname, path=None): + for importer in self._importers: + result = importer.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. + + The first argument (self) must define _name which the second argument is + comapred against. If the comparison fails then ImportError is raised. + + """ + def inner(self, name, *args, **kwargs): + 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__) + return inner + + +class _ExtensionFileLoader(object): + + """Loader for extension modules. + + The constructor is designed to work with FileImporter. + + """ + + def __init__(self, name, path, is_pkg): + """Initialize the loader. + + If is_pkg is True then an exception is raised as extension modules + cannot be the __init__ module for an extension module. + + """ + self._name = name + self._path = path + if is_pkg: + raise ValueError("extension modules cannot be packages") + + @check_name + def load_module(self, fullname): + """Load an extension module.""" + assert self._name == fullname + 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: + del sys.modules[fullname] + raise + + @check_name + def is_package(self, fullname): + """Return False as an extension module can never be a package.""" + return False + + @check_name + def get_code(self, fullname): + """Return None as an extension module cannot create a code object.""" + return None + + @check_name + def get_source(self, fullname): + """Return None as extension modules have no source code.""" + return None + + +def suffix_list(suffix_type): + """Return a list of file suffixes based on the imp file type.""" + return [suffix[0] for suffix in imp.get_suffixes() + 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. + + 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. + + """ + def decorated(self, fullname): + module = sys.modules.get(fullname) + is_reload = bool(module) + if not is_reload: + # This must be done before open() is called as the 'io' module + # 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 + 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). + + """Load a Python source or bytecode 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 + + def _source_path(self): + """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): + """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 + def load_module(self, module): + """Load a Python source or bytecode module.""" + source_path = self._source_path() + bytecode_path = self._bytecode_path() + 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 + 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() + 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. + + Return None if the source is not available. Raise ImportError if the + laoder cannot handle the specified module. + + """ + source_path = self._source_path() + if source_path is None: + return None + import tokenize + with closing(_fileio_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() + + @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 + 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() + 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: + if exc.errno == errno.EACCES: + return False + 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. + + """ + # 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 + 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, source_path = self.read_source(name) + # 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 = marshal.dumps(code_object) + self.write_bytecode(name, imp.get_magic(), source_timestamp, 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 FileImporter(object): + + """Base class for file importers. + + Subclasses are expected to define the following attributes: + + * _suffixes + Sequence of file suffixes whose order will be followed. + + * _possible_package + True if importer should check for packages. + + * _loader + A callable that takes the module name, a file path, and whether + the path points to a package and returns a loader for the module + found at that path. + + """ + + def __init__(self, path_entry): + """Initialize an importer for the passed-in sys.path entry (which is + assumed to have already been verified as an existing directory). + + Can be used as an entry on sys.path_hook. + + """ + self._path_entry = path_entry + + def find_module(self, fullname, path=None): + tail_module = fullname.rsplit('.', 1)[-1] + package_directory = None + if self._possible_package: + for ext in self._suffixes: + package_directory = _path_join(self._path_entry, tail_module) + init_filename = '__init__' + ext + package_init = _path_join(package_directory, init_filename) + if (_path_isfile(package_init) and + _case_ok(self._path_entry, tail_module) and + _case_ok(package_directory, init_filename)): + return self._loader(fullname, package_init, True) + for ext in self._suffixes: + file_name = tail_module + ext + file_path = _path_join(self._path_entry, file_name) + if (_path_isfile(file_path) and + _case_ok(self._path_entry, file_name)): + return self._loader(fullname, file_path, False) + else: + # Raise a warning if it matches a directory w/o an __init__ file. + if (package_directory is not None and + _path_isdir(package_directory) and + _case_ok(self._path_entry, tail_module)): + _warnings.warn("Not importing directory %s: missing __init__" + % package_directory, ImportWarning) + return None + + +class ExtensionFileImporter(FileImporter): + + """Importer for extension files.""" + + _possible_package = False + _loader = _ExtensionFileLoader + + def __init__(self, path_entry): + # 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) + + +class PyFileImporter(FileImporter): + + """Importer for source/bytecode files.""" + + _possible_package = True + _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) + self._suffixes += suffix_list(imp.PY_COMPILED) + 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 Import(object): + + """Class that implements the __import__ interface. + + 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. + + """ + + 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. + + """ + 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 + 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 + 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 + 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``). + + """ + 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('__')] Added: python/branches/py3k/Lib/importlib/test/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,26 @@ +import os.path +import sys +import unittest + + +def test_suite(package=__package__, directory=os.path.dirname(__file__)): + suite = unittest.TestSuite() + for name in os.listdir(directory): + path = os.path.join(directory, name) + if os.path.isfile(path) and name.startswith('test_'): + submodule_name = os.path.splitext(name)[0] + module_name = "{0}.{1}".format(package, submodule_name) + __import__(module_name, level=0) + module_tests = unittest.findTestCases(sys.modules[module_name]) + suite.addTest(module_tests) + elif os.path.isdir(path): + package_name = "{0}.{1}".format(package, name) + __import__(package_name, level=0) + package_tests = getattr(sys.modules[package_name], 'test_suite')() + suite.addTest(package_tests) + return suite + + +if __name__ == '__main__': + from test.support import run_unittest + run_unittest(test_suite('importlib.test')) Added: python/branches/py3k/Lib/importlib/test/builtin/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/builtin/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,12 @@ +import importlib.test +import os + + +def test_suite(): + directory = os.path.dirname(__file__) + return importlib.test.test_suite('importlib.test.builtin', directory) + + +if __name__ == '__main__': + from test.support import run_unittest + run_unittest(test_suite()) Added: python/branches/py3k/Lib/importlib/test/builtin/test_finder.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/builtin/test_finder.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,36 @@ +import importlib +from .. import support + +import sys +import unittest + +class FinderTests(unittest.TestCase): + + """Test find_module() for built-in modules.""" + + assert 'errno' in sys.builtin_module_names + name = 'errno' + + find_module = staticmethod(lambda name, path=None: + importlib.BuiltinImporter().find_module(name, path)) + + + def test_find_module(self): + # Common case. + with support.uncache(self.name): + self.assert_(self.find_module(self.name)) + + def test_ignore_path(self): + # The value for 'path' should always trigger a failed import. + with support.uncache(self.name): + self.assert_(self.find_module(self.name, ['pkg']) is None) + + + +def test_main(): + from test.support import run_unittest + run_unittest(FinderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/builtin/test_loader.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/builtin/test_loader.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,52 @@ +import importlib +from .. import support + +import sys +import types +import unittest + + +class LoaderTests(unittest.TestCase): + + """Test load_module() for built-in modules.""" + + assert 'errno' in sys.builtin_module_names + name = 'errno' + + verification = {'__name__': 'errno', '__package__': None} + + def verify(self, module): + """Verify that the module matches against what it should have.""" + self.assert_(isinstance(module, types.ModuleType)) + for attr, value in self.verification.items(): + self.assertEqual(getattr(module, attr), value) + self.assert_(module.__name__ in sys.modules) + + load_module = staticmethod(lambda name: + importlib.BuiltinImporter().load_module(name)) + + def test_load_module(self): + # Common case. + with support.uncache(self.name): + module = self.load_module(self.name) + self.verify(module) + + def test_nonexistent(self): + name = 'dssdsdfff' + assert name not in sys.builtin_module_names + self.assertRaises(ImportError, self.load_module, name) + + def test_already_imported(self): + # Using the name of a module already imported but not a built-in should + # still fail. + assert hasattr(importlib, '__file__') # Not a built-in. + self.assertRaises(ImportError, self.load_module, 'importlib') + + +def test_main(): + from test.support import run_unittest + run_unittest(LoaderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/extension/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/extension/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,13 @@ +import importlib.test +import os.path +import unittest + + +def test_suite(): + directory = os.path.dirname(__file__) + return importlib.test.test_suite('importlib.test.extension', directory) + + +if __name__ == '__main__': + from test.support import run_unittest + run_unittest(test_suite()) Added: python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,39 @@ +import sys +from test import support as test_support +import unittest +import importlib +from . import test_path_hook + + +class ExtensionModuleCaseSensitivityTest(unittest.TestCase): + + def find_module(self): + good_name = test_path_hook.NAME + bad_name = good_name.upper() + assert good_name != bad_name + finder = importlib.ExtensionFileImporter(test_path_hook.PATH) + return finder.find_module(bad_name) + + def test_case_sensitive(self): + with test_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: + env.set('PYTHONCASEOK', '1') + loader = self.find_module() + self.assert_(hasattr(loader, 'load_module')) + + + + +def test_main(): + if sys.platform not in ('win32', 'darwin', 'cygwin'): + return + test_support.run_unittest(ExtensionModuleCaseSensitivityTest) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/extension/test_finder.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/extension/test_finder.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,29 @@ +import importlib +from . import test_path_hook + +import unittest + +class FinderTests(unittest.TestCase): + + """Test the finder for extension modules.""" + + def find_module(self, fullname): + importer = importlib.ExtensionFileImporter(test_path_hook.PATH) + return importer.find_module(fullname) + + def test_success(self): + self.assert_(self.find_module(test_path_hook.NAME)) + + def test_failure(self): + self.assert_(self.find_module('asdfjkl;') is None) + + # XXX Raise an exception if someone tries to use the 'path' argument? + + +def test_main(): + from test.support import run_unittest + run_unittest(FinderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/extension/test_loader.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/extension/test_loader.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,37 @@ +import importlib +from . import test_path_hook +from .. import support + +import sys +import unittest + + +class LoaderTests(unittest.TestCase): + + """Test load_module() for extension modules.""" + + def load_module(self, fullname): + loader = importlib._ExtensionFileLoader(test_path_hook.NAME, + test_path_hook.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)]: + self.assertEqual(getattr(module, attr), value) + self.assert_(test_path_hook.NAME in sys.modules) + + def test_failure(self): + self.assertRaises(ImportError, self.load_module, 'asdfjkl;') + + +def test_main(): + from test.support import run_unittest + run_unittest(LoaderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,50 @@ +import importlib + +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.""" + # XXX Should it only succeed for pre-existing directories? + # XXX Should it only work for directories containing an extension module? + + def hook(self, entry): + return importlib.ExtensionFileImporter(entry) + + def test_success(self): + # Path hook should handle a directory where a known extension module + # exists. + self.assert_(hasattr(self.hook(PATH), 'find_module')) + + +def test_main(): + from test.support import run_unittest + run_unittest(PathHookTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/finder_tests.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/finder_tests.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,39 @@ +# top-level. +# Package. +# module in pacakge. +# Package within a package. +# At least one tests with 'path'. +# Module that is not handled. + +import unittest + + +class FinderTests(unittest.TestCase): + + """Basic tests for a finder to pass.""" + + def test_module(self): + # Test importing a top-level module. + raise NotImplementedError + + def test_package(self): + # Test importing a package. + raise NotImplementedError + + 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. + raise NotImplementedError + + def test_package_in_package(self): + # Test importing a subpackage. + # A value for 'path' should be used if for a meta_path finder. + raise NotImplementedError + + def test_package_over_module(self): + # Test that packages are chosen over modules. + raise NotImplementedError + + def test_failure(self): + # Test trying to find a module that cannot be handled. + raise NotImplementedError Added: python/branches/py3k/Lib/importlib/test/frozen/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/frozen/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,13 @@ +import importlib.test +import os.path +import unittest + + +def test_suite(): + directory = os.path.dirname(__file__) + return importlib.test.test_suite('importlib.test.frozen', directory) + + +if __name__ == '__main__': + from test.support import run_unittest + run_unittest(test_suite()) Added: python/branches/py3k/Lib/importlib/test/frozen/support.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/frozen/support.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,24 @@ +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() Added: python/branches/py3k/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/frozen/test_finder.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,44 @@ +import importlib +from ..builtin import test_finder +from .. import support + +import unittest + + +class FinderTests(test_finder.FinderTests): + + """Test finding frozen modules.""" + + def find(self, name, path=None): + finder = importlib.FrozenImporter() + return finder.find_module(name, path) + + + def test_module(self): + name = '__hello__' + loader = self.find(name) + self.assert_(hasattr(loader, 'load_module')) + + def test_package(self): + loader = self.find('__phello__') + self.assert_(hasattr(loader, 'load_module')) + + def test_module_in_package(self): + loader = self.find('__phello__.spam', ['__phello__']) + self.assert_(hasattr(loader, 'load_module')) + + def test_package_in_package(self): + pass + + def test_failure(self): + loader = self.find('') + self.assert_(loader is None) + + +def test_main(): + from test.support import run_unittest + run_unittest(FinderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/frozen/test_loader.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/frozen/test_loader.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,27 @@ +import importlib +from ..builtin import test_loader + + +class LoaderTests(test_loader.LoaderTests): + + name = '__phello__' + load_module = staticmethod(lambda name: + importlib.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_main(): + from test.support import run_unittest + run_unittest(LoaderTests, SubmoduleLoaderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,13 @@ +import importlib.test +import os.path +import unittest + + +def test_suite(): + directory = os.path.dirname(__file__) + return importlib.test.test_suite('importlib.test.import_', directory) + + +if __name__ == '__main__': + from test.support import run_unittest + run_unittest(test_suite()) Added: python/branches/py3k/Lib/importlib/test/import_/test___package__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test___package__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,110 @@ +"""PEP 366 ("Main module explicit relative imports") specifies the +semantics for the __package__ attribute on modules. This attribute is +used, when available, to detect which package a module belongs to (instead +of using the typical __path__/__name__ test). + +""" +import unittest +from .. import support + + +class Using__package__(unittest.TestCase): + + """Use of __package__ supercedes the use of __name__/__path__ to calculate + what package a module belongs to. The basic algorithm is [__package__]:: + + def resolve_name(name, package, level): + level -= 1 + base = package.rsplit('.', level)[0] + return '{0}.{1}'.format(base, name) + + But since there is no guarantee that __package__ has been set, there has to + be a way to calculate the attribute's value [__name__]:: + + def calc_package(caller_name, has___path__): + if has__path__: + return caller_name + else: + return caller_name.rsplit('.', 1)[0] + + Then the normal algorithm for relative name imports can proceed as if + __package__ had been set. + + """ + + 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) + 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_('', + globals={'__name__': 'pkg.fake', + '__path__': []}, + fromlist=['attr'], level=2) + self.assertEquals(module.__name__, 'pkg') + + def test_bad__package__(self): + globals = {'__package__': ''} + self.assertRaises(SystemError, support.import_,'', globals, {}, + ['relimport'], 1) + + def test_bunk__package__(self): + globals = {'__package__': 42} + self.assertRaises(ValueError, support.import_, '', globals, {}, + ['relimport'], 1) + + +class Setting__package__(unittest.TestCase): + + """Because __package__ is a new feature, it is not always set by a loader. + Import will set it as needed to help with the transition to relying on + __package__. + + For a top-level module, __package__ is set to None [top-level]. For a + package __name__ is used for __package__ [package]. For submodules the + value is __name__.rsplit('.', 1)[0] [submodule]. + + """ + + # [top-level] + def test_top_level(self): + with support.mock_modules('top_level') as mock: + with support.import_state(meta_path=[mock]): + del mock['top_level'].__package__ + module = support.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]): + del mock['pkg'].__package__ + module = support.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]): + del mock['pkg.mod'].__package__ + pkg = support.import_('pkg.mod') + module = getattr(pkg, 'mod') + self.assertEqual(module.__package__, 'pkg') + + +def test_main(): + from test.support import run_unittest + run_unittest(Using__package__, Setting__package__) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/test_caching.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test_caching.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,75 @@ +"""Test that sys.modules is used properly by import.""" +from ..support import import_, mock_modules, importlib_only, import_state + +import sys +from types import MethodType +import unittest + + +class UseCache(unittest.TestCase): + + """When it comes to sys.modules, import prefers it over anything else. + + Once a name has been resolved, sys.modules is checked to see if it contains + the module desired. If so, then it is returned [use cache]. If it is not + found, then the proper steps are taken to perform the import, but + sys.modules is still used to return the imported module (e.g., not what a + loader returns) [from cache on return]. This also applies to imports of + things contained within a package and thus get assigned as an attribute + [from cache to attribute] or pulled in thanks to a fromlist import + [from cache for fromlist]. + + """ + def test_using_cache(self): + # [use cache] + module_to_use = "some module found!" + sys.modules['some_module'] = module_to_use + module = import_('some_module') + self.assertEqual(id(module_to_use), id(module)) + + def create_mock(self, *names, return_=None): + mock = mock_modules(*names) + original_load = mock.load_module + def load_module(self, fullname): + original_load(fullname) + return return_ + mock.load_module = MethodType(load_module, mock) + return mock + + # __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 + 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') + self.assertEquals(id(module), id(sys.modules['module'])) + + # See test_using_cache_after_loader() for reasoning. + @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') + 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 + 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']) + self.assert_(hasattr(module, 'module')) + self.assertEquals(id(module.module), id(sys.modules['pkg.module'])) + + +def test_main(): + from test.support import run_unittest + run_unittest(UseCache) + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,116 @@ +"""Test that the semantics relating to the 'fromlist' argument are correct.""" +from ..support import import_, mock_modules, import_state + +import unittest + +class ReturnValue(unittest.TestCase): + + """The use of fromlist influences what import returns. + + If direct ``import ...`` statement is used, the root module or package is + returned [import return]. But if fromlist is set, then the specified module + is actually returned (whether it is a relative import or not) + [from return]. + + """ + + 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') + 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']) + self.assertEquals(module.__name__, 'pkg.module') + + +class HandlingFromlist(unittest.TestCase): + + """Using fromlist triggers different actions based on what is being asked + of it. + + If fromlist specifies an object on a module, nothing special happens + [object case]. This is even true if the object does not exist [bad object]. + + If a package is being imported, then what is listed in fromlist may be + treated as a module to be imported [module]. But once again, even if + something in fromlist does not exist as a module, no error is thrown + [no module]. And this extends to what is contained in __all__ when '*' is + imported [using *]. And '*' does not need to be the only name in the + fromlist [using * with others]. + + """ + + def test_object(self): + # [object case] + with mock_modules('module') as importer: + with import_state(meta_path=[importer]): + module = 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']) + 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']) + 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') + 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=['']) + 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]): + mock['pkg'].__all__ = ['module'] + module = 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') + with context as mock: + with import_state(meta_path=[mock]): + mock['pkg'].__all__ = ['module1'] + module = import_('pkg', fromlist=['module2', '*']) + self.assertEquals(module.__name__, 'pkg') + self.assert_(hasattr(module, 'module1')) + self.assert_(hasattr(module, 'module2')) + self.assertEquals(module.module1.__name__, 'pkg.module1') + self.assertEquals(module.module2.__name__, 'pkg.module2') + + +def test_main(): + from test.support import run_unittest + run_unittest(ReturnValue, HandlingFromlist) + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,99 @@ +from ..support import import_state, mock_modules, import_ + +from contextlib import nested +from types import MethodType +import unittest + + +class CallingOrder(unittest.TestCase): + + """Calls to the importers on sys.meta_path happen in order that they are + specified in the sequence, starting with the first importer + [first called], and then continuing on down until one is found that doesn't + return None [continuing].""" + + + 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.modules[mod] = 42 + second.modules[mod] = -13 + with import_state(meta_path=[first, second]): + self.assertEquals(import_(mod), 42) + + def test_continuing(self): + # [continuing] + mod_name = 'for_real' + first = mock_modules('nonexistent') + second = 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) + + +class CallSignature(unittest.TestCase): + + """If there is no __path__ entry on the parent module, then 'path' is None + [no path]. Otherwise, the value for __path__ is passed in for the 'path' + argument [path set].""" + + def log(self, fxn): + log = [] + def wrapper(self, *args, **kwargs): + log.append([args, kwargs]) + return fxn(*args, **kwargs) + return log, wrapper + + + def test_no_path(self): + # [no path] + mod_name = 'top_level' + assert '.' not in mod_name + with 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) + assert len(log) == 1 + args = log[0][0] + kwargs = log[0][1] + # Assuming all arguments are positional. + self.assertEquals(len(args), 2) + self.assertEquals(len(kwargs), 0) + self.assertEquals(args[0], mod_name) + self.assert_(args[1] is None) + + def test_with_path(self): + # [path set] + pkg_name = 'pkg' + mod_name = pkg_name + '.module' + path = [42] + assert '.' in mod_name + with 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) + assert len(log) == 2 + args = log[1][0] + kwargs = log[1][1] + # Assuming all arguments are positional. + self.assert_(not kwargs) + self.assertEquals(args[0], mod_name) + self.assert_(args[1] is path) + + + +def test_main(): + from test.support import run_unittest + run_unittest(CallingOrder, CallSignature) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/test_packages.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test_packages.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,29 @@ +import sys +import unittest +import importlib +from .. import support + + +class ParentModuleTests(unittest.TestCase): + + """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') + 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') + + +def test_main(): + from test.support import run_unittest + run_unittest(ParentModuleTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,158 @@ +from ..support import (mock_modules, import_state, import_, mock_path_hook, + importlib_only, uncache) + +from contextlib import nested +from imp import new_module +import sys +from types import MethodType +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(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 + + 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) + + +def test_main(): + from test.support import run_unittest + run_unittest(PathTests, __path__Tests) + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,199 @@ +"""Test relative imports (PEP 328).""" + +from ..support import uncache, import_, mock_modules, import_state + +import sys +import unittest + +class RelativeImports(unittest.TestCase): + + """PEP 328 introduced relative imports. This allows for imports to occur + from within a package without having to specify the actual package name. + + A simple example is to import another module within the same package + [module from module]:: + + # From pkg.mod1 with pkg.mod2 being a module. + from . import mod2 + + This also works for getting an attribute from a module that is specified + in a relative fashion [attr from module]:: + + # From pkg.mod1. + from .mod2 import attr + + But this is in no way restricted to working between modules; it works + from [package to module],:: + + # From pkg, importing pkg.module which is a module. + from . import module + + [module to package],:: + + # Pull attr from pkg, called from pkg.module which is a module. + from . import attr + + and [package to package]:: + + # From pkg.subpkg1 (both pkg.subpkg[1,2] are packages). + from .. import subpkg2 + + The number of dots used is in no way restricted [deep import]:: + + # Import pkg.attr from pkg.pkg1.pkg2.pkg3.pkg4.pkg5. + from ...... import attr + + To prevent someone from accessing code that is outside of a package, one + cannot reach the location containing the root package itself:: + + # From pkg.__init__ [too high from package] + from .. import top_level + + # From pkg.module [too high from module] + from .. import top_level + + Relative imports are the only type of import that allow for an empty + module name for an import [empty name]. + + """ + + def relative_import_test(self, create, globals_, callback): + """Abstract out boilerplace for setting up for an import test.""" + uncache_names = [] + for name in create: + if not name.endswith('.__init__'): + uncache_names.append(name) + else: + uncache_names.append(name[:-len('.__init__')]) + with mock_modules(*create) as importer: + with import_state(meta_path=[importer]): + for global_ in globals_: + with uncache(*uncache_names): + callback(global_) + + + def test_module_from_module(self): + # [module from module] + 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) + self.assertEqual(module.__name__, 'pkg') + self.assert_(hasattr(module, 'mod2')) + self.assertEqual(module.mod2.attr, 'pkg.mod2') + self.relative_import_test(create, globals_, callback) + + def test_attr_from_module(self): + # [attr from module] + 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) + self.assertEqual(module.__name__, 'pkg.mod2') + self.assertEqual(module.attr, 'pkg.mod2') + self.relative_import_test(create, globals_, callback) + + def test_package_to_module(self): + # [package to module] + create = 'pkg.__init__', 'pkg.module' + globals_ = ({'__package__': 'pkg'}, + {'__name__': 'pkg', '__path__': ['blah']}) + def callback(global_): + import_('pkg') # For __import__(). + module = import_('', global_, fromlist=['module'], + level=1) + self.assertEqual(module.__name__, 'pkg') + self.assert_(hasattr(module, 'module')) + self.assertEqual(module.module.attr, 'pkg.module') + self.relative_import_test(create, globals_, callback) + + def test_module_to_package(self): + # [module to package] + 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) + self.assertEqual(module.__name__, 'pkg') + self.relative_import_test(create, globals_, callback) + + def test_package_to_package(self): + # [package to package] + create = ('pkg.__init__', 'pkg.subpkg1.__init__', + 'pkg.subpkg2.__init__') + globals_ = ({'__package__': 'pkg.subpkg1'}, + {'__name__': 'pkg.subpkg1', '__path__': ['blah']}) + def callback(global_): + module = import_('', global_, fromlist=['subpkg2'], level=2) + self.assertEqual(module.__name__, 'pkg') + self.assert_(hasattr(module, 'subpkg2')) + self.assertEqual(module.subpkg2.attr, 'pkg.subpkg2.__init__') + + def test_deep_import(self): + # [deep import] + create = ['pkg.__init__'] + for count in range(1,6): + create.append('{0}.pkg{1}.__init__'.format( + create[-1][:-len('.__init__')], count)) + globals_ = ({'__package__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5'}, + {'__name__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5', + '__path__': ['blah']}) + def callback(global_): + import_(globals_[0]['__package__']) + module = import_('', global_, fromlist=['attr'], level=6) + self.assertEqual(module.__name__, 'pkg') + self.relative_import_test(create, globals_, callback) + + def test_too_high_from_package(self): + # [too high from package] + create = ['top_level', 'pkg.__init__'] + globals_ = ({'__package__': 'pkg'}, + {'__name__': 'pkg', '__path__': ['blah']}) + def callback(global_): + import_('pkg') + self.assertRaises(ValueError, import_, '', global_, + fromlist=['top_level'], level=2) + self.relative_import_test(create, globals_, callback) + + def test_too_high_from_module(self): + # [too high from module] + create = ['top_level', 'pkg.__init__', 'pkg.module'] + globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} + def callback(global_): + import_('pkg') + self.assertRaises(ValueError, 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_, '') + + def test_import_from_different_package(self): + # Test importing from a different package than the caller. + # in pkg.subpkg1.mod + # from ..subpkg2 import mod + # XXX + create = ['__runpy_pkg__.__init__', + '__runpy_pkg__.__runpy_pkg__.__init__', + '__runpy_pkg__.uncle.__init__', + '__runpy_pkg__.uncle.cousin.__init__', + '__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'], + level=2) + self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin') + self.relative_import_test(create, globals_, callback) + + + +def test_main(): + from test.support import run_unittest + run_unittest(RelativeImports) + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/source/__init__.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/__init__.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,13 @@ +import importlib.test +import os.path +import unittest + + +def test_suite(): + directory = os.path.dirname(__file__) + return importlib.test.test_suite('importlib.test.source', directory) + + +if __name__ == '__main__': + from test.support import run_unittest + run_unittest(test_suite()) Added: python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,57 @@ +"""Test case-sensitivity (PEP 235).""" +import importlib +from .. import support +import os +import sys +from test import support as test_support +import unittest + + +class CaseSensitivityTest(unittest.TestCase): + + """PEP 235 dictates that on case-preserving, case-insensitive file systems + that imports are case-sensitive unless the PYTHONCASEOK environment + variable is set.""" + + name = 'MoDuLe' + assert name != name.lower() + + def find(self, path): + finder = importlib.PyFileImporter(path) + return finder.find_module(self.name) + + def sensitivity_test(self): + """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: + 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) + + def test_sensitive(self): + with test_support.EnvironmentVarGuard() as env: + env.unset('PYTHONCASEOK') + sensitive, insensitive = self.sensitivity_test() + self.assert_(hasattr(sensitive, 'load_module')) + self.assert_(self.name in sensitive._base_path) + self.assert_(insensitive is None) + + def test_insensitive(self): + with test_support.EnvironmentVarGuard() as env: + env.set('PYTHONCASEOK', '1') + sensitive, insensitive = self.sensitivity_test() + self.assert_(hasattr(sensitive, 'load_module')) + self.assert_(self.name in sensitive._base_path) + self.assert_(hasattr(insensitive, 'load_module')) + self.assert_(self.name in insensitive._base_path) + + +def test_main(): + if sys.platform not in ('win32', 'darwin', 'cygwin'): + return + test_support.run_unittest(CaseSensitivityTest) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/source/test_finder.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/test_finder.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,130 @@ +import importlib +from .. import finder_tests +from .. import support +import os +import py_compile +import unittest +import warnings + + +class FinderTests(finder_tests.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 + [top-level source], bytecode [top-level bc], or both [top-level both]. + There is also the possibility that it is a package [top-level package], in + which case there will be a directory with the module name and an + __init__.py file. If there is a directory without an __init__.py an + ImportWarning is returned [empty dir]. + + For sub-modules and sub-packages, the same happens as above but only use + the tail end of the name [sub module] [sub package] [sub empty]. + + When there is a conflict between a package and module having the same name + in the same directory, the package wins out [package over module]. This is + so that imports of modules within the package can occur rather than trigger + an import error. + + When there is a package and module with the same name, always pick the + package over the module [package over module]. This is so that imports from + the package have the possibility of succeeding. + + """ + + def import_(self, root, module): + finder = importlib.PyFileImporter(root) + return finder.find_module(module) + + def run_test(self, test, create=None, *, compile_=None, unlink=None): + """Test the finding of 'test' with the creation of modules listed in + 'create'. + + Any names listed in 'compile_' are byte-compiled. Modules + listed in 'unlink' have their source files deleted. + + """ + if create is None: + create = {test} + with support.create_modules(*create) as mapping: + if compile_: + for name in compile_: + py_compile.compile(mapping[name]) + if unlink: + for name in unlink: + os.unlink(mapping[name]) + loader = self.import_(mapping['.root'], test) + self.assert_(hasattr(loader, 'load_module')) + return loader + + def test_module(self): + # [top-level source] + self.run_test('top_level') + # [top-level bc] + self.run_test('top_level', compile_={'top_level'}, unlink={'top_level'}) + # [top-level both] + self.run_test('top_level', compile_={'top_level'}) + + # [top-level package] + def test_package(self): + # Source. + self.run_test('pkg', {'pkg.__init__'}) + # Bytecode. + self.run_test('pkg', {'pkg.__init__'}, compile_={'pkg.__init__'}, + unlink={'pkg.__init__'}) + # Both. + self.run_test('pkg', {'pkg.__init__'}, compile_={'pkg.__init__'}) + + # [sub module] + def test_module_in_package(self): + with support.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__') + with context as mapping: + pkg_dir = os.path.dirname(mapping['pkg.__init__']) + loader = self.import_(pkg_dir, 'pkg.sub') + self.assert_(hasattr(loader, 'load_module')) + + # [sub empty] + def test_empty_sub_directory(self): + context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + with warnings.catch_warnings(): + warnings.simplefilter("error", ImportWarning) + with context as mapping: + os.unlink(mapping['pkg.sub.__init__']) + pkg_dir = os.path.dirname(mapping['pkg.__init__']) + self.assertRaises(ImportWarning, self.import_, pkg_dir, + 'pkg.sub') + + # [package over modules] + def test_package_over_module(self): + # XXX This is not a blackbox test! + name = '_temp' + loader = self.run_test(name, {'{0}.__init__'.format(name), name}) + self.assert_('__init__' in loader._base_path) + + + def test_failure(self): + with support.create_modules('blah') as mapping: + nothing = self.import_(mapping['.root'], 'sdfsadsadf') + self.assert_(nothing is None) + + # [empty dir] + def test_empty_dir(self): + with warnings.catch_warnings(): + warnings.simplefilter("error", ImportWarning) + self.assertRaises(ImportWarning, self.run_test, 'pkg', + {'pkg.__init__'}, unlink={'pkg.__init__'}) + + +def test_main(): + from test.support import run_unittest + run_unittest(FinderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/source/test_loader.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/test_loader.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,201 @@ +import importlib +from .. import support + +import imp +import os +import py_compile +import sys +import unittest + + +class SimpleTest(unittest.TestCase): + + """Should have no issue importing a source module [basic]. And if there is + a syntax error, it should raise a SyntaxError [syntax error]. + + """ + + # [basic] + def test_basic(self): + with support.create_modules('_temp') as mapping: + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader.load_module('_temp') + self.assert_('_temp' in sys.modules) + + # [syntax error] + def test_bad_syntax(self): + with support.create_modules('_temp') as mapping: + with open(mapping['_temp'], 'w') as file: + file.write('=') + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + self.assertRaises(SyntaxError, loader.load_module, '_temp') + self.assert_('_temp' not in sys.modules) + + +class DontWriteBytecodeTest(unittest.TestCase): + + """If sys.dont_write_bytcode is true then no bytecode should be created.""" + + def tearDown(self): + sys.dont_write_bytecode = False + + @support.writes_bytecode + def run_test(self, assertion): + with support.create_modules('_temp') as mapping: + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader.load_module('_temp') + bytecode_path = support.bytecode_path(mapping['_temp']) + assertion(bytecode_path) + + def test_bytecode_written(self): + fxn = lambda bc_path: self.assert_(os.path.exists(bc_path)) + self.run_test(fxn) + + def test_bytecode_not_written(self): + sys.dont_write_bytecode = True + fxn = lambda bc_path: self.assert_(not os.path.exists(bc_path)) + self.run_test(fxn) + + +class BadDataTest(unittest.TestCase): + + """If the bytecode has a magic number that does not match the + interpreters', ImportError is raised [bad magic]. The timestamp can have + any value. And bad marshal data raises ValueError. + + """ + + # [bad magic] + def test_bad_magic(self): + with support.create_modules('_temp') as mapping: + py_compile.compile(mapping['_temp']) + os.unlink(mapping['_temp']) + bytecode_path = support.bytecode_path(mapping['_temp']) + 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) + self.assertRaises(ImportError, loader.load_module, '_temp') + self.assert_('_temp' not in sys.modules) + + +class SourceBytecodeInteraction(unittest.TestCase): + + """When both source and bytecode are present, certain rules dictate which + version of the code takes precedent. All things being equal, the bytecode + is used with the value of __file__ set to the source [basic top-level], + [basic package], [basic sub-module], [basic sub-package]. + + """ + + def import_(self, file, module, *, pkg=False): + loader = importlib._PyFileLoader(module, file, pkg) + return loader.load_module(module) + + def run_test(self, test, *create, pkg=False): + create += (test,) + with support.create_modules(*create) as mapping: + for name in create: + py_compile.compile(mapping[name]) + if pkg: + import_name = test.rsplit('.', 1)[0] + else: + import_name = test + loader = importlib._PyFileLoader(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. + loader.get_source = lambda self, x: 42 + module = loader.load_module(import_name) + self.assertEqual(module.__file__, mapping[name]) + self.assert_(import_name in sys.modules) + self.assertEqual(id(module), id(sys.modules[import_name])) + + # [basic top-level] + def test_basic_top_level(self): + self.run_test('top_level') + + # [basic package] + def test_basic_package(self): + self.run_test('pkg.__init__', pkg=True) + + # [basic sub-module] + def test_basic_sub_module(self): + self.run_test('pkg.sub', 'pkg.__init__') + + # [basic sub-package] + def test_basic_sub_package(self): + self.run_test('pkg.sub.__init__', 'pkg.__init__', pkg=True) + + +class BadBytecodeTest(unittest.TestCase): + + """But there are several things about the bytecode which might lead to the + source being preferred. If the magic number differs from what the + interpreter uses, then the source is used with the bytecode regenerated. + If the timestamp is older than the modification time for the source then + the bytecode is not used [bad timestamp]. + + But if the marshal data is bad, even if the magic number and timestamp + work, a ValueError is raised and the source is not used [bad marshal]. + + """ + + def import_(self, file, module_name): + loader = importlib._PyFileLoader(module_name, file, False) + module = loader.load_module(module_name) + self.assert_(module_name in sys.modules) + + # [bad magic] + @support.writes_bytecode + def test_bad_magic(self): + with support.create_modules('_temp') as mapping: + py_compile.compile(mapping['_temp']) + bytecode_path = support.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') + self.import_(mapping['_temp'], '_temp') + with open(bytecode_path, 'rb') as bytecode_file: + self.assertEqual(bytecode_file.read(4), imp.get_magic()) + + # [bad timestamp] + @support.writes_bytecode + def test_bad_bytecode(self): + zeros = b'\x00\x00\x00\x00' + with support.create_modules('_temp') as mapping: + py_compile.compile(mapping['_temp']) + bytecode_path = support.bytecode_path(mapping['_temp']) + with open(bytecode_path, 'r+b') as bytecode_file: + bytecode_file.seek(4) + bytecode_file.write(zeros) + self.import_(mapping['_temp'], '_temp') + source_mtime = os.path.getmtime(mapping['_temp']) + source_timestamp = importlib._w_long(source_mtime) + with open(bytecode_path, 'rb') as bytecode_file: + bytecode_file.seek(4) + self.assertEqual(bytecode_file.read(4), source_timestamp) + + # [bad marshal] + def test_bad_marshal(self): + with support.create_modules('_temp') as mapping: + bytecode_path = support.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: + bytecode_file.write(imp.get_magic()) + bytecode_file.write(source_timestamp) + bytecode_file.write(b'AAAA') + self.assertRaises(ValueError, self.import_, mapping['_temp'], + '_temp') + self.assert_('_temp' not in sys.modules) + + +def test_main(): + from test.support import run_unittest + run_unittest(SimpleTest, DontWriteBytecodeTest, BadDataTest, + SourceBytecodeInteraction, BadBytecodeTest) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/test_path_hook.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,23 @@ +import importlib +from .. import support +import unittest + + +class PathHookTest(unittest.TestCase): + + """Test the path hook for source.""" + + def test_success(self): + # XXX Only work on existing directories? + with support.create_modules('dummy') as mapping: + self.assert_(hasattr(importlib.FileImporter(mapping['.root']), + 'find_module')) + + +def test_main(): + from test.support import run_unittest + run_unittest(PathHookTest) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/source/test_reload.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/test_reload.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,71 @@ +"""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() Added: python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,122 @@ +import importlib +from .. import support + +import codecs +import re +import sys +# Because sys.path gets essentially blanked, need to have unicodedata already +# imported for the parser to use. +import unicodedata +import unittest + + +CODING_RE = re.compile(r'coding[:=]\s*([-\w.]+)') + + +class EncodingTest(unittest.TestCase): + + """PEP 3120 makes UTF-8 the default encoding for source code + [default encoding]. + + PEP 263 specifies how that can change on a per-file basis. Either the first + or second line can contain the encoding line [encoding first line] + encoding second line]. If the file has the BOM marker it is considered UTF-8 + implicitly [BOM]. If any encoding is specified it must be UTF-8, else it is + an error [BOM and utf-8][BOM conflict]. + + """ + + variable = '\u00fc' + character = '\u00c9' + source_line = "{0} = '{1}'\n".format(variable, character) + module_name = '_temp' + + def run_test(self, source): + with support.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, + mapping[self.module_name], False) + return loader.load_module(self.module_name) + + def create_source(self, encoding): + encoding_line = "# coding={0}".format(encoding) + assert CODING_RE.search(encoding_line) + source_lines = [encoding_line.encode('utf-8')] + source_lines.append(self.source_line.encode(encoding)) + return b'\n'.join(source_lines) + + def test_non_obvious_encoding(self): + # Make sure that an encoding that has never been a standard one for + # Python works. + encoding_line = "# coding=koi8-r" + assert CODING_RE.search(encoding_line) + source = "{0}\na=42\n".format(encoding_line).encode("koi8-r") + self.run_test(source) + + # [default encoding] + def test_default_encoding(self): + self.run_test(self.source_line.encode('utf-8')) + + # [encoding first line] + def test_encoding_on_first_line(self): + encoding = 'Latin-1' + source = self.create_source(encoding) + self.run_test(source) + + # [encoding second line] + def test_encoding_on_second_line(self): + source = b"#/usr/bin/python\n" + self.create_source('Latin-1') + self.run_test(source) + + # [BOM] + def test_bom(self): + self.run_test(codecs.BOM_UTF8 + self.source_line.encode('utf-8')) + + # [BOM and utf-8] + def test_bom_and_utf_8(self): + source = codecs.BOM_UTF8 + self.create_source('utf-8') + self.run_test(source) + + # [BOM conflict] + def test_bom_conflict(self): + source = codecs.BOM_UTF8 + self.create_source('latin-1') + self.assertRaises(SyntaxError, self.run_test, source) + + +class LineEndingTest(unittest.TestCase): + + r"""Source written with the three types of line endings (\n, \r\n, \r) + need to be readable [cr][crlf][lf].""" + + def run_test(self, line_ending): + 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 open(mapping[module_name], 'wb') as file: + file.write(source) + loader = importlib._PyFileLoader(module_name, mapping[module_name], + False) + return loader.load_module(module_name) + + # [cr] + def test_cr(self): + self.run_test(b'\r') + + # [crlf] + def test_crlf(self): + self.run_test(b'\r\n') + + # [lf] + def test_lf(self): + self.run_test(b'\n') + + +def test_main(): + from test.support import run_unittest + run_unittest(EncodingTest, LineEndingTest) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/test/support.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/support.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,223 @@ +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 + + 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 Added: python/branches/py3k/Lib/importlib/test/test_api.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/test_api.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,62 @@ +import unittest +import importlib +from . import support + + +class ImportModuleTests(unittest.TestCase): + + """Test importlib.import_module.""" + + 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]): + module = importlib.import_module('top_level') + self.assertEqual(module.__name__, 'top_level') + + def test_absolute_package_import(self): + # Test importing a module from a package with an absolute name. + 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]): + module = importlib.import_module(name) + self.assertEqual(module.__name__, name) + + def test_relative_package_import(self): + # Test importing a module from a package through a relatve import. + pkg_name = 'pkg' + pkg_long_name = '{0}.__init__'.format(pkg_name) + 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]): + module = importlib.import_module(relative_name, pkg_name) + self.assertEqual(module.__name__, absolute_name) + + def test_absolute_import_with_package(self): + # Test importing a module from a package with an absolute name with + # the 'package' argument given. + 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]): + module = importlib.import_module(name, pkg_name) + self.assertEqual(module.__name__, name) + + def test_relative_import_wo_package(self): + # Relative imports cannot happen without the 'package' argument being + # set. + self.assertRaises(TypeError, importlib.import_module, '.support') + + +def test_main(): + from test.support import run_unittest + run_unittest(ImportModuleTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/test/test_importlib.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/test/test_importlib.py Sun Jan 18 01:24:28 2009 @@ -0,0 +1,10 @@ +from test.support import run_unittest +import importlib.test + + +def test_main(): + run_unittest(importlib.test.test_suite('importlib.test')) + + +if __name__ == '__main__': + test_main() From benjamin at python.org Sun Jan 18 01:18:57 2009 From: benjamin at python.org (Benjamin Peterson) Date: Sat, 17 Jan 2009 18:18:57 -0600 Subject: [Python-checkins] r68662 - in python/branches/py3k: Lib/zipfile.py In-Reply-To: References: <20090117164227.2795A1E4002@bag.python.org> Message-ID: <1afaf6160901171618n65b5bf7by4474866b43f47158@mail.gmail.com> On Sat, Jan 17, 2009 at 6:16 PM, Brett Cannon wrote: > test_zipfile has been failing forpy3k. Is this the cause or one of the > other zipfile patches? It looks like the attempt to correct this in the trunk, r68678 has worked, so maybe it should be merged. -- Regards, Benjamin From python-checkins at python.org Sun Jan 18 01:27:57 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 18 Jan 2009 01:27:57 +0100 (CET) Subject: [Python-checkins] r68699 - python/branches/release30-maint Message-ID: <20090118002757.E273B1E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 18 01:27:57 2009 New Revision: 68699 Log: Blocked revisions 68698 via svnmerge ........ r68698 | brett.cannon | 2009-01-17 16:24:28 -0800 (Sat, 17 Jan 2009) | 6 lines Add initial implementation of importlib. See the NOTES files for what is planned for the package. There are no docs yet, but they are coming once the API for the first new function, importlib.import_module() is finalized. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 18 01:29:03 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sun, 18 Jan 2009 01:29:03 +0100 (CET) Subject: [Python-checkins] r68700 - in python/branches/py3k: Lib/zipfile.py Message-ID: <20090118002903.186D91E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sun Jan 18 01:29:02 2009 New Revision: 68700 Log: Merged revisions 68678 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68678 | amaury.forgeotdarc | 2009-01-17 23:43:50 +0100 (Sat, 17 Jan 2009) | 3 lines follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format, always try to read the "zip64 end of directory structure". ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/zipfile.py Modified: python/branches/py3k/Lib/zipfile.py ============================================================================== --- python/branches/py3k/Lib/zipfile.py (original) +++ python/branches/py3k/Lib/zipfile.py Sun Jan 18 01:29:02 2009 @@ -210,13 +210,9 @@ # Append a blank comment and record start offset endrec.append(b"") endrec.append(filesize - sizeEndCentDir) - if endrec[_ECD_OFFSET] == 0xffffffff: - # the value for the "offset of the start of the central directory" - # indicates that there is a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, -sizeEndCentDir, endrec) - return endrec + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, -sizeEndCentDir, endrec) # Either this is not a ZIP file, or it is a ZIP file with an archive # comment. Search the end of the file for the "end of central directory" @@ -237,11 +233,10 @@ # Append the archive comment and start offset endrec.append(comment) endrec.append(maxCommentStart + start) - if endrec[_ECD_OFFSET] == 0xffffffff: - # There is apparently a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, start - filesize, endrec) - return endrec + + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, maxCommentStart + start - filesize, + endrec) # Unable to find a valid end of central directory structure return From python-checkins at python.org Sun Jan 18 01:36:23 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 18 Jan 2009 01:36:23 +0100 (CET) Subject: [Python-checkins] r68701 - python/branches/py3k/Lib/importlib/test/__init__.py Message-ID: <20090118003623.272091E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 18 01:36:22 2009 New Revision: 68701 Log: Skip over any file or folder that starts with a dot (e.g. .svn). 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 Jan 18 01:36:22 2009 @@ -6,6 +6,8 @@ def test_suite(package=__package__, directory=os.path.dirname(__file__)): suite = unittest.TestSuite() for name in os.listdir(directory): + if name.startswith('.'): + continue path = os.path.join(directory, name) if os.path.isfile(path) and name.startswith('test_'): submodule_name = os.path.splitext(name)[0] @@ -15,6 +17,7 @@ suite.addTest(module_tests) elif os.path.isdir(path): package_name = "{0}.{1}".format(package, name) + print(package_name) __import__(package_name, level=0) package_tests = getattr(sys.modules[package_name], 'test_suite')() suite.addTest(package_tests) From python-checkins at python.org Sun Jan 18 01:36:55 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 18 Jan 2009 01:36:55 +0100 (CET) Subject: [Python-checkins] r68702 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090118003655.3346B1E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 18 01:36:55 2009 New Revision: 68702 Log: NOTES for importlib should mention the ultimate end-goal for the package. 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 Jan 18 01:36:55 2009 @@ -76,3 +76,5 @@ - __import__ - import_module (backport to 2.7) - resolve_name (backport to 2.7) + +* Bootstrap importlib as implementation of builtins.__import__ From python-checkins at python.org Sun Jan 18 01:39:07 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 18 Jan 2009 01:39:07 +0100 (CET) Subject: [Python-checkins] r68703 - python/branches/release30-maint Message-ID: <20090118003907.39EA51E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 18 01:39:07 2009 New Revision: 68703 Log: Blocked revisions 68701-68702 via svnmerge ........ r68701 | brett.cannon | 2009-01-17 16:36:22 -0800 (Sat, 17 Jan 2009) | 2 lines Skip over any file or folder that starts with a dot (e.g. .svn). ........ r68702 | brett.cannon | 2009-01-17 16:36:55 -0800 (Sat, 17 Jan 2009) | 2 lines NOTES for importlib should mention the ultimate end-goal for the package. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 18 01:45:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 01:45:30 +0100 (CET) Subject: [Python-checkins] r68704 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c _textio.c io.c Message-ID: <20090118004530.05AF11E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 01:45:29 2009 New Revision: 68704 Log: Most io sources are Py_ssize_t-clean (I don't know about bytesio and stringio) Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c 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 Jan 18 01:45:29 2009 @@ -1,3 +1,4 @@ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #include "pythread.h" Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Jan 18 01:45:29 2009 @@ -1,3 +1,4 @@ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #include "_iomodule.h" Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Jan 18 01:45:29 2009 @@ -1,3 +1,4 @@ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #include "_iomodule.h" @@ -1870,7 +1871,7 @@ while (input < input_end) { PyObject *state; char *dec_buffer; - int dec_buffer_len; + Py_ssize_t dec_buffer_len; int dec_flags; PyObject *decoded = PyObject_CallMethod( Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Jan 18 01:45:29 2009 @@ -1,3 +1,4 @@ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #include "_iomodule.h" From python-checkins at python.org Sun Jan 18 02:28:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 02:28:09 +0100 (CET) Subject: [Python-checkins] r68705 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20090118012809.E18231E4019@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 02:28:09 2009 New Revision: 68705 Log: bytearrays are mutable sequences 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 Sun Jan 18 02:28:09 2009 @@ -368,12 +368,20 @@ comma-separated list of expressions in square brackets. (Note that there are no special cases needed to form lists of length 0 or 1.) + Byte Arrays + .. index:: bytearray + + A bytearray object is a mutable array. They are created by the built-in + :func:`bytearray` constructor. Aside from being mutable (and hence + unhashable), byte arrays otherwise provide the same interface and + functionality as immutable bytes objects. + .. index:: module: array The extension module :mod:`array` provides an additional example of a mutable sequence type. -Set types +Set types../ .. index:: builtin: len object: set type From python-checkins at python.org Sun Jan 18 02:28:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 02:28:46 +0100 (CET) Subject: [Python-checkins] r68706 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20090118012846.558FD1E4040@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 02:28:46 2009 New Revision: 68706 Log: fix grammar 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 Sun Jan 18 02:28:46 2009 @@ -359,7 +359,7 @@ slicing notations can be used as the target of assignment and :keyword:`del` (delete) statements. - There is currently a single intrinsic mutable sequence type: + There are currently two intrinsic mutable sequence types: Lists .. index:: object: list From python-checkins at python.org Sun Jan 18 02:29:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 02:29:28 +0100 (CET) Subject: [Python-checkins] r68707 - python/branches/py3k Message-ID: <20090118012928.D87FC1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 02:29:28 2009 New Revision: 68707 Log: Blocked revisions 68705 via svnmerge ........ r68705 | benjamin.peterson | 2009-01-17 19:28:09 -0600 (Sat, 17 Jan 2009) | 1 line bytearrays are mutable sequences ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun Jan 18 03:45:39 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 18 Jan 2009 03:45:39 +0100 (CET) Subject: [Python-checkins] r68708 - in python/trunk: Doc/library/multiprocessing.rst Lib/multiprocessing/sharedctypes.py Lib/test/test_multiprocessing.py Misc/NEWS Message-ID: <20090118024539.06CE21E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 18 03:45:38 2009 New Revision: 68708 Log: Resolve issue 4449: AssertionError in mp_benchmarks.py Modified: python/trunk/Doc/library/multiprocessing.rst python/trunk/Lib/multiprocessing/sharedctypes.py python/trunk/Lib/test/test_multiprocessing.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Sun Jan 18 03:45:38 2009 @@ -880,7 +880,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, *args, lock]]) +.. function:: Value(typecode_or_type, *args[, lock]) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -962,7 +962,7 @@ *typecode_or_type* determines the type of the returned object: it is either a ctypes type or a one character typecode of the kind used by the :mod:`array` - module. */*args* is passed on to the constructor for the type. + module. *\*args* is passed on to the constructor for the type. Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized @@ -972,7 +972,7 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]]) +.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock]) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes Modified: python/trunk/Lib/multiprocessing/sharedctypes.py ============================================================================== --- python/trunk/Lib/multiprocessing/sharedctypes.py (original) +++ python/trunk/Lib/multiprocessing/sharedctypes.py Sun Jan 18 03:45:38 2009 @@ -69,9 +69,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys()) obj = RawValue(typecode_or_type, *args) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def Array(typecode_or_type, size_or_initializer, **kwds): @@ -82,9 +85,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys()) obj = RawArray(typecode_or_type, size_or_initializer) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def copy(obj): Modified: python/trunk/Lib/test/test_multiprocessing.py ============================================================================== --- python/trunk/Lib/test/test_multiprocessing.py (original) +++ python/trunk/Lib/test/test_multiprocessing.py Sun Jan 18 03:45:38 2009 @@ -829,10 +829,16 @@ obj3 = val3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawValue('i', 5) + arr4 = self.Value('i', 5, lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue') + + arr5 = self.RawValue('i', 5) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) + class _TestArray(BaseTestCase): @@ -887,9 +893,15 @@ obj3 = arr3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawArray('i', range(10)) + arr4 = self.Array('i', range(10), lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, + self.Array, 'i', range(10), lock='notalock') + + arr5 = self.RawArray('i', range(10)) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) # # Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 18 03:45:38 2009 @@ -137,6 +137,9 @@ Library ------- +- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue + in sharedctypes.py. + - Issue #1225107: inspect.isclass() returned True for instances with a custom __getattr__. From python-checkins at python.org Sun Jan 18 04:11:38 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 18 Jan 2009 04:11:38 +0100 (CET) Subject: [Python-checkins] r68709 - in python/branches/py3k: Doc/library/multiprocessing.rst Lib/multiprocessing/sharedctypes.py Lib/test/test_multiprocessing.py Misc/NEWS Message-ID: <20090118031138.A000F1E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 18 04:11:38 2009 New Revision: 68709 Log: Merge r68708 to py3k, fixes 4449 Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Lib/multiprocessing/sharedctypes.py python/branches/py3k/Lib/test/test_multiprocessing.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Sun Jan 18 04:11:38 2009 @@ -878,7 +878,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, *args, lock]]) +.. function:: Value(typecode_or_type, *args[, lock]) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -960,7 +960,7 @@ *typecode_or_type* determines the type of the returned object: it is either a ctypes type or a one character typecode of the kind used by the :mod:`array` - module. */*args* is passed on to the constructor for the type. + module. *\*args* is passed on to the constructor for the type. Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized @@ -970,7 +970,7 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]]) +.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock]) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes Modified: python/branches/py3k/Lib/multiprocessing/sharedctypes.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/sharedctypes.py (original) +++ python/branches/py3k/Lib/multiprocessing/sharedctypes.py Sun Jan 18 04:11:38 2009 @@ -66,9 +66,12 @@ Return a synchronization wrapper for a Value ''' obj = RawValue(typecode_or_type, *args) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def Array(typecode_or_type, size_or_initializer, **kwds): @@ -79,9 +82,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % list(kwds.keys())) obj = RawArray(typecode_or_type, size_or_initializer) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def copy(obj): Modified: python/branches/py3k/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/py3k/Lib/test/test_multiprocessing.py (original) +++ python/branches/py3k/Lib/test/test_multiprocessing.py Sun Jan 18 04:11:38 2009 @@ -830,10 +830,16 @@ obj3 = val3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawValue('i', 5) + arr4 = self.Value('i', 5, lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue') + + arr5 = self.RawValue('i', 5) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) + class _TestArray(BaseTestCase): @@ -888,9 +894,15 @@ obj3 = arr3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawArray('i', list(range(10))) + arr4 = self.Array('i', range(10), lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, + self.Array, 'i', range(10), lock='notalock') + + arr5 = self.RawArray('i', range(10)) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) # # Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 18 04:11:38 2009 @@ -135,6 +135,12 @@ - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. +- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue + in sharedctypes.py. + +- Issue #1225107: inspect.isclass() returned True for instances with a custom + __getattr__. + - Issue #3826 and #4791: The socket module now closes the underlying socket appropriately when it is being used via socket.makefile() objects rather than delaying the close by waiting for garbage collection to do it. From jimjjewett at gmail.com Sun Jan 18 04:13:58 2009 From: jimjjewett at gmail.com (Jim Jewett) Date: Sat, 17 Jan 2009 22:13:58 -0500 Subject: [Python-checkins] r68698 - in python/branches/py3k/Lib: importlib importlib/NOTES importlib/__init__.py importlib/_bootstrap.py importlib/test importlib/test/__init__.py importlib/test/builtin importlib/test/builtin/__init__.py importlib/test/bui Message-ID: (1) Shouldn't bytecode and data files be opened binary? And as long as I'm picking nits anyhow... (2) Some of the docstrings are a bit awkward around when to return None. Consider "returning None ... unless ... " "returns None when ... not", or even "when none of ...", though I'll grant that distinguishing between "None" and "none" is also suboptimal. (3) A spell check would get inerally and laoder, but would probably still miss "their" vs "there" -jJ From python-checkins at python.org Sun Jan 18 04:31:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 04:31:53 +0100 (CET) Subject: [Python-checkins] r68710 - in python/branches/release30-maint: Doc/library/multiprocessing.rst Lib/multiprocessing/sharedctypes.py Lib/test/test_multiprocessing.py Message-ID: <20090118033153.302ED1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 04:31:52 2009 New Revision: 68710 Log: Merged revisions 68709 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68709 | jesse.noller | 2009-01-17 21:11:38 -0600 (Sat, 17 Jan 2009) | 1 line Merge r68708 to py3k, fixes 4449 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/multiprocessing.rst python/branches/release30-maint/Lib/multiprocessing/sharedctypes.py python/branches/release30-maint/Lib/test/test_multiprocessing.py Modified: python/branches/release30-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release30-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release30-maint/Doc/library/multiprocessing.rst Sun Jan 18 04:31:52 2009 @@ -878,7 +878,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, *args, lock]]) +.. function:: Value(typecode_or_type, *args[, lock]) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -960,7 +960,7 @@ *typecode_or_type* determines the type of the returned object: it is either a ctypes type or a one character typecode of the kind used by the :mod:`array` - module. */*args* is passed on to the constructor for the type. + module. *\*args* is passed on to the constructor for the type. Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized @@ -970,7 +970,7 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]]) +.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock]) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes Modified: python/branches/release30-maint/Lib/multiprocessing/sharedctypes.py ============================================================================== --- python/branches/release30-maint/Lib/multiprocessing/sharedctypes.py (original) +++ python/branches/release30-maint/Lib/multiprocessing/sharedctypes.py Sun Jan 18 04:31:52 2009 @@ -66,9 +66,12 @@ Return a synchronization wrapper for a Value ''' obj = RawValue(typecode_or_type, *args) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def Array(typecode_or_type, size_or_initializer, **kwds): @@ -79,9 +82,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % list(kwds.keys())) obj = RawArray(typecode_or_type, size_or_initializer) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def copy(obj): 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 Sun Jan 18 04:31:52 2009 @@ -830,10 +830,16 @@ obj3 = val3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawValue('i', 5) + arr4 = self.Value('i', 5, lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue') + + arr5 = self.RawValue('i', 5) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) + class _TestArray(BaseTestCase): @@ -888,9 +894,15 @@ obj3 = arr3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawArray('i', list(range(10))) + arr4 = self.Array('i', range(10), lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, + self.Array, 'i', range(10), lock='notalock') + + arr5 = self.RawArray('i', range(10)) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) # # From buildbot at python.org Sun Jan 18 04:43:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 18 Jan 2009 03:43:47 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090118034347.680D31E4002@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/719 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,jesse.noller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sun Jan 18 05:01:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 05:01:28 +0100 (CET) Subject: [Python-checkins] r68711 - in python/branches/release26-maint: Doc/library/multiprocessing.rst Lib/multiprocessing/sharedctypes.py Lib/test/test_multiprocessing.py Message-ID: <20090118040128.52C611E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 05:01:18 2009 New Revision: 68711 Log: Merged revisions 68708 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68708 | jesse.noller | 2009-01-17 20:45:38 -0600 (Sat, 17 Jan 2009) | 1 line Resolve issue 4449: AssertionError in mp_benchmarks.py ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/multiprocessing.rst python/branches/release26-maint/Lib/multiprocessing/sharedctypes.py python/branches/release26-maint/Lib/test/test_multiprocessing.py Modified: python/branches/release26-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release26-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release26-maint/Doc/library/multiprocessing.rst Sun Jan 18 05:01:18 2009 @@ -880,7 +880,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, *args, lock]]) +.. function:: Value(typecode_or_type, *args[, lock]) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -962,7 +962,7 @@ *typecode_or_type* determines the type of the returned object: it is either a ctypes type or a one character typecode of the kind used by the :mod:`array` - module. */*args* is passed on to the constructor for the type. + module. *\*args* is passed on to the constructor for the type. Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized @@ -972,7 +972,7 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]]) +.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock]) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes Modified: python/branches/release26-maint/Lib/multiprocessing/sharedctypes.py ============================================================================== --- python/branches/release26-maint/Lib/multiprocessing/sharedctypes.py (original) +++ python/branches/release26-maint/Lib/multiprocessing/sharedctypes.py Sun Jan 18 05:01:18 2009 @@ -69,9 +69,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys()) obj = RawValue(typecode_or_type, *args) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def Array(typecode_or_type, size_or_initializer, **kwds): @@ -82,9 +85,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys()) obj = RawArray(typecode_or_type, size_or_initializer) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def copy(obj): Modified: python/branches/release26-maint/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_multiprocessing.py (original) +++ python/branches/release26-maint/Lib/test/test_multiprocessing.py Sun Jan 18 05:01:18 2009 @@ -829,10 +829,16 @@ obj3 = val3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawValue('i', 5) + arr4 = self.Value('i', 5, lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue') + + arr5 = self.RawValue('i', 5) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) + class _TestArray(BaseTestCase): @@ -887,9 +893,15 @@ obj3 = arr3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawArray('i', range(10)) + arr4 = self.Array('i', range(10), lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, + self.Array, 'i', range(10), lock='notalock') + + arr5 = self.RawArray('i', range(10)) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) # # From jimjjewett at gmail.com Sun Jan 18 06:45:52 2009 From: jimjjewett at gmail.com (Jim Jewett) Date: Sun, 18 Jan 2009 00:45:52 -0500 Subject: [Python-checkins] r68686 - python/branches/py3k In-Reply-To: <20090117232817.4D18A1E4002@bag.python.org> References: <20090117232817.4D18A1E4002@bag.python.org> Message-ID: > I'm just going to assume that all of these > revisions don't need to be merge, since it's > not indicated: Based on the commit messages, I would assume that they *did* need to be merged, unless Raymond is known to generally develop first in 3.0 and backport. -jJ On Sat, Jan 17, 2009 at 6:28 PM, benjamin. peterson wrote: > Author: benjamin.peterson > Date: Sun Jan 18 00:28:17 2009 > New Revision: 68686 > > Log: > I'm just going to assume that all of these revisions don't need to be merge, since it's not indicated: > > Blocked revisions 68559,68562,68565-68567,68569,68603-68605 via svnmerge > > ........ > r68559 | raymond.hettinger | 2009-01-12 16:58:41 -0600 (Mon, 12 Jan 2009) | 1 line > > Issue 1696199: Add collections.Counter(). > ........ > r68562 | raymond.hettinger | 2009-01-12 19:05:03 -0600 (Mon, 12 Jan 2009) | 7 lines > > Simplify Counter() API. Replace items keyword argument > with a mapping. Makes Counter() idempotent, makes update() > API the same as Counter.__init__(), makes a more readable > repr, makes the API more dict-like, and allows Steven > Bethard's update() example to work. > ........ > r68565 | raymond.hettinger | 2009-01-12 21:49:43 -0600 (Mon, 12 Jan 2009) | 1 line > > Minor documentation tweaks and simpler update() example. > ........ > r68566 | raymond.hettinger | 2009-01-12 22:13:53 -0600 (Mon, 12 Jan 2009) | 1 line > > Fixup and simplify docstrings and doctests. > ........ > r68567 | raymond.hettinger | 2009-01-12 22:50:35 -0600 (Mon, 12 Jan 2009) | 1 line > > Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. > ........ > r68569 | raymond.hettinger | 2009-01-13 02:38:14 -0600 (Tue, 13 Jan 2009) | 7 lines > > Add table of idioms/patterns for using Counter objects. > Improve the appearance and flow of the References section -- it used > to have a box around it that wasn't distinct from the preceding code > boxes and it had a weird bolding pattern and hanging indents that > made the section disproportionately large. > ........ > r68603 | raymond.hettinger | 2009-01-13 18:15:21 -0600 (Tue, 13 Jan 2009) | 1 line > > Minor doc tweaks. > ........ > r68604 | raymond.hettinger | 2009-01-13 19:15:06 -0600 (Tue, 13 Jan 2009) | 1 line > > Add tests for __init__() and update() with no args. > ........ > r68605 | raymond.hettinger | 2009-01-13 19:39:51 -0600 (Tue, 13 Jan 2009) | 1 line > > Fix-up indentation of sample code blocks for namedtuple mthod definitions. > ........ > > > Modified: > python/branches/py3k/ (props changed) > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From bcannon at gmail.com Sun Jan 18 07:38:55 2009 From: bcannon at gmail.com (Brett Cannon) Date: Sat, 17 Jan 2009 22:38:55 -0800 Subject: [Python-checkins] r68698 - in python/branches/py3k/Lib: importlib importlib/NOTES importlib/__init__.py importlib/_bootstrap.py importlib/test importlib/test/__init__.py importlib/test/builtin importlib/test/builtin/__init__.py importlib/test/bui In-Reply-To: References: Message-ID: On Sat, Jan 17, 2009 at 19:13, Jim Jewett wrote: > (1) Shouldn't bytecode and data files be opened binary? > Yes, which is why they are. =) I assume you are talking about _fileio.FileIO, which only does bytes and thus does not need the 'b' argument when opening. > And as long as I'm picking nits anyhow... > > (2) Some of the docstrings are a bit awkward around when to return > None. Consider "returning None ... unless ... " "returns None when > ... not", or even "when none of ...", though I'll grant that > distinguishing between "None" and "none" is also suboptimal. > > (3) A spell check would get inerally and laoder, but would probably > still miss "their" vs "there" I am not worrying about the docstrings right now as they will be cleaned up when I start to write the documentation and finish up the refactorings I have planned. -Brett From python-checkins at python.org Sun Jan 18 07:55:05 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 18 Jan 2009 07:55:05 +0100 (CET) Subject: [Python-checkins] r68712 - in python/branches/py3k/Lib/importlib/test: extension/test_case_sensitivity.py source/test_case_sensitivity.py support.py Message-ID: <20090118065505.9AF511E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 18 07:55:05 2009 New Revision: 68712 Log: Tests of case-sensitivity were being executed on OSs which did not have a case-insensitive file system, leading to test failures. This was due to using the TestCase objects directly instead of the guard in the test_main() function. Move over to a class decorator instead to control if the tests should be run. Modified: python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/support.py 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 Jan 18 07:55:05 2009 @@ -2,9 +2,11 @@ from test import support as test_support import unittest import importlib +from .. import support from . import test_path_hook + at support.case_insensitive_tests class ExtensionModuleCaseSensitivityTest(unittest.TestCase): def find_module(self): @@ -30,8 +32,6 @@ def test_main(): - if sys.platform not in ('win32', 'darwin', 'cygwin'): - return test_support.run_unittest(ExtensionModuleCaseSensitivityTest) 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 Jan 18 07:55:05 2009 @@ -7,6 +7,7 @@ import unittest + at support.case_insensitive_tests class CaseSensitivityTest(unittest.TestCase): """PEP 235 dictates that on case-preserving, case-insensitive file systems @@ -48,8 +49,6 @@ def test_main(): - if sys.platform not in ('win32', 'darwin', 'cygwin'): - return test_support.run_unittest(CaseSensitivityTest) 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 Jan 18 07:55:05 2009 @@ -36,6 +36,16 @@ 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_ + + @contextmanager def uncache(*names): """Uncache a module from sys.modules. From python-checkins at python.org Sun Jan 18 10:47:54 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 10:47:54 +0100 (CET) Subject: [Python-checkins] r68713 - in peps/trunk: pep-0279.txt pep-0289.txt pep-0319.txt Message-ID: <20090118094754.740691E400C@bag.python.org> Author: georg.brandl Date: Sun Jan 18 10:47:54 2009 New Revision: 68713 Log: Update old PEP URL. Modified: peps/trunk/pep-0279.txt peps/trunk/pep-0289.txt peps/trunk/pep-0319.txt Modified: peps/trunk/pep-0279.txt ============================================================================== --- peps/trunk/pep-0279.txt (original) +++ peps/trunk/pep-0279.txt Sun Jan 18 10:47:54 2009 @@ -179,13 +179,13 @@ References [1] PEP 255 Simple Generators - http://python.sourceforge.net/peps/pep-0255.html + http://www.python.org/dev/peps/pep-0255/ [2] PEP 212 Loop Counter Iteration - http://python.sourceforge.net/peps/pep-0212.html + http://www.python.org/dev/peps/pep-0212/ [3] PEP 234 Iterators - http://python.sourceforge.net/peps/pep-0234.html + http://www.python.org/dev/peps/pep-0234/ Copyright Modified: peps/trunk/pep-0289.txt ============================================================================== --- peps/trunk/pep-0289.txt (original) +++ peps/trunk/pep-0289.txt Sun Jan 18 10:47:54 2009 @@ -288,10 +288,10 @@ ========== .. [1] PEP 202 List Comprehensions - http://python.sourceforge.net/peps/pep-0202.html + http://www.python.org/dev/peps/pep-0202/ .. [2] PEP 255 Simple Generators - http://python.sourceforge.net/peps/pep-0255.html + http://www.python.org/dev/peps/pep-0255/ .. [3] Peter Norvig's Accumulation Display Proposal http://www.norvig.com/pyacc.html Modified: peps/trunk/pep-0319.txt ============================================================================== --- peps/trunk/pep-0319.txt (original) +++ peps/trunk/pep-0319.txt Sun Jan 18 10:47:54 2009 @@ -477,13 +477,13 @@ http://docs.python.org/reference/ [2] PEP 236, Back to the __future__, Peters - http://python.sourceforge.net/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ [3] PEP 230, Warning Framework, van Rossum - http://python.sourceforge.net/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0230/ [4] PEP 310, Reliable Acquisition/Release Pairs, Hudson, Moore - http://www.python.org/peps/pep-0310.html + http://www.python.org/dev/peps/pep-0310/ Copyright From python-checkins at python.org Sun Jan 18 10:50:43 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 10:50:43 +0100 (CET) Subject: [Python-checkins] r68714 - in peps/trunk: pep-0200.txt pep-0203.txt pep-0211.txt pep-0225.txt pep-0231.txt pep-0236.txt pep-0238.txt pep-0239.txt pep-0240.txt pep-0243.txt pep-0244.txt pep-0245.txt pep-0246.txt pep-0251.txt pep-0255.txt pep-0256.txt pep-0257.txt pep-0258.txt pep-0269.txt pep-0274.txt pep-0276.txt pep-0281.txt pep-0284.txt pep-0287.txt pep-0288.txt pep-0290.txt pep-0298.txt pep-0301.txt pep-0302.txt pep-0313.txt pep-0314.txt pep-0317.txt pep-0323.txt pep-0325.txt pep-0329.txt pep-0331.txt pep-0334.txt pep-0337.txt pep-0338.txt pep-0340.txt pep-0346.txt pep-0348.txt pep-0352.txt pep-0666.txt pep-3126.txt Message-ID: <20090118095043.667E01E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 10:50:42 2009 New Revision: 68714 Log: Update not-so-old PEP URL. Modified: peps/trunk/pep-0200.txt peps/trunk/pep-0203.txt peps/trunk/pep-0211.txt peps/trunk/pep-0225.txt peps/trunk/pep-0231.txt peps/trunk/pep-0236.txt peps/trunk/pep-0238.txt peps/trunk/pep-0239.txt peps/trunk/pep-0240.txt peps/trunk/pep-0243.txt peps/trunk/pep-0244.txt peps/trunk/pep-0245.txt peps/trunk/pep-0246.txt peps/trunk/pep-0251.txt peps/trunk/pep-0255.txt peps/trunk/pep-0256.txt peps/trunk/pep-0257.txt peps/trunk/pep-0258.txt peps/trunk/pep-0269.txt peps/trunk/pep-0274.txt peps/trunk/pep-0276.txt peps/trunk/pep-0281.txt peps/trunk/pep-0284.txt peps/trunk/pep-0287.txt peps/trunk/pep-0288.txt peps/trunk/pep-0290.txt peps/trunk/pep-0298.txt peps/trunk/pep-0301.txt peps/trunk/pep-0302.txt peps/trunk/pep-0313.txt peps/trunk/pep-0314.txt peps/trunk/pep-0317.txt peps/trunk/pep-0323.txt peps/trunk/pep-0325.txt peps/trunk/pep-0329.txt peps/trunk/pep-0331.txt peps/trunk/pep-0334.txt peps/trunk/pep-0337.txt peps/trunk/pep-0338.txt peps/trunk/pep-0340.txt peps/trunk/pep-0346.txt peps/trunk/pep-0348.txt peps/trunk/pep-0352.txt peps/trunk/pep-0666.txt peps/trunk/pep-3126.txt Modified: peps/trunk/pep-0200.txt ============================================================================== --- peps/trunk/pep-0200.txt (original) +++ peps/trunk/pep-0200.txt Sun Jan 18 10:50:42 2009 @@ -314,7 +314,7 @@ * Extended print statement - Barry Warsaw PEP 214 - http://www.python.org/peps/pep-0214.html + http://www.python.org/dev/peps/pep-0214/ SF Patch #100970 http://sourceforge.net/patch/?func=detailpatch&patch_id=100970&group_id=5470 Modified: peps/trunk/pep-0203.txt ============================================================================== --- peps/trunk/pep-0203.txt (original) +++ peps/trunk/pep-0203.txt Sun Jan 18 10:50:42 2009 @@ -336,7 +336,7 @@ [2] http://sourceforge.net/patch?func=detailpatch&patch_id=100699&group_id=5470 [3] PEP 211, Adding A New Outer Product Operator, Wilson - http://www.python.org/peps/pep-0211.html + http://www.python.org/dev/peps/pep-0211/ Modified: peps/trunk/pep-0211.txt ============================================================================== --- peps/trunk/pep-0211.txt (original) +++ peps/trunk/pep-0211.txt Sun Jan 18 10:50:42 2009 @@ -174,14 +174,14 @@ References [1] PEP 225, Elementwise/Objectwise Operators, Zhu, Lielens - http://www.python.org/peps/pep-0225.html + http://www.python.org/dev/peps/pep-0225/ [2] http://bevo.che.wisc.edu/octave/ [3] http://www.egroups.com/message/python-numeric/4 [4] PEP 201, Lockstep Iteration, Warsaw - http://www.python.org/peps/pep-0201.html + http://www.python.org/dev/peps/pep-0201/ [5] http://mail.python.org/pipermail/python-dev/2000-July/006427.html Modified: peps/trunk/pep-0225.txt ============================================================================== --- peps/trunk/pep-0225.txt (original) +++ peps/trunk/pep-0225.txt Sun Jan 18 10:50:42 2009 @@ -767,7 +767,7 @@ Its first (and current) version is at: http://www.python.org/pipermail/python-dev/2000-August/014876.html - http://www.python.org/peps/pep-0211.html + http://www.python.org/dev/peps/pep-0211/ Additional References Modified: peps/trunk/pep-0231.txt ============================================================================== --- peps/trunk/pep-0231.txt (original) +++ peps/trunk/pep-0231.txt Sun Jan 18 10:50:42 2009 @@ -602,7 +602,7 @@ [7] http://www.foretec.com/python/workshops/1998-11/dd-ascher-sum.html [8] http://docs.python.org/howto/regex.html [9] PEP 213, Attribute Access Handlers, Prescod - http://www.python.org/peps/pep-0213.html + http://www.python.org/dev/peps/pep-0213/ Rejection Modified: peps/trunk/pep-0236.txt ============================================================================== --- peps/trunk/pep-0236.txt (original) +++ peps/trunk/pep-0236.txt Sun Jan 18 10:50:42 2009 @@ -345,13 +345,13 @@ References and Footnotes [1] PEP 5, Guidelines for Language Evolution, Prescod - http://www.python.org/peps/pep-0005.html + http://www.python.org/dev/peps/pep-0005/ [2] PEP 227, Statically Nested Scopes, Hylton - http://www.python.org/peps/pep-0227.html + http://www.python.org/dev/peps/pep-0227/ [3] PEP 230, Warning Framework, Van Rossum - http://www.python.org/peps/pep-0230.html + http://www.python.org/dev/peps/pep-0230/ [4] Note that this is "may" and not "will": better safe than sorry. Of course spurious warnings won't be generated when avoidable with Modified: peps/trunk/pep-0238.txt ============================================================================== --- peps/trunk/pep-0238.txt (original) +++ peps/trunk/pep-0238.txt Sun Jan 18 10:50:42 2009 @@ -498,22 +498,22 @@ References [0] PEP 228, Reworking Python's Numeric Model - http://www.python.org/peps/pep-0228.html + http://www.python.org/dev/peps/pep-0228/ [1] PEP 237, Unifying Long Integers and Integers, Zadka, - http://www.python.org/peps/pep-0237.html + http://www.python.org/dev/peps/pep-0237/ [2] PEP 239, Adding a Rational Type to Python, Zadka, - http://www.python.org/peps/pep-0239.html + http://www.python.org/dev/peps/pep-0239/ [3] PEP 240, Adding a Rational Literal to Python, Zadka, - http://www.python.org/peps/pep-0240.html + http://www.python.org/dev/peps/pep-0240/ [4] PEP 236, Back to the __future__, Peters, - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ [5] PEP 264, Future statements in simulated shells - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ Copyright Modified: peps/trunk/pep-0239.txt ============================================================================== --- peps/trunk/pep-0239.txt (original) +++ peps/trunk/pep-0239.txt Sun Jan 18 10:50:42 2009 @@ -115,7 +115,7 @@ References [1] PEP 240, Adding a Rational Literal to Python, Zadka, - http://www.python.org/peps/pep-0240.html + http://www.python.org/dev/peps/pep-0240/ Copyright Modified: peps/trunk/pep-0240.txt ============================================================================== --- peps/trunk/pep-0240.txt (original) +++ peps/trunk/pep-0240.txt Sun Jan 18 10:50:42 2009 @@ -80,7 +80,7 @@ References [1] PEP 239, Adding a Rational Type to Python, Zadka, - http://www.python.org/peps/pep-0239.html + http://www.python.org/dev/peps/pep-0239/ Copyright Modified: peps/trunk/pep-0243.txt ============================================================================== --- peps/trunk/pep-0243.txt (original) +++ peps/trunk/pep-0243.txt Sun Jan 18 10:50:42 2009 @@ -163,7 +163,7 @@ References [1] Metadata for Python Software Package, Kuchling, - http://www.python.org/peps/pep-0241.html + http://www.python.org/dev/peps/pep-0241/ [2] RFC 1867, Form-based File Upload in HTML http://www.faqs.org/rfcs/rfc1867.html Modified: peps/trunk/pep-0244.txt ============================================================================== --- peps/trunk/pep-0244.txt (original) +++ peps/trunk/pep-0244.txt Sun Jan 18 10:50:42 2009 @@ -153,13 +153,13 @@ References and Footnotes [1] PEP 5, Guidelines for Language Evolution, Prescod - http://www.python.org/peps/pep-0005.html + http://www.python.org/dev/peps/pep-0005/ [2] PEP 227, Statically Nested Scopes, Hylton - http://www.python.org/peps/pep-0227.html + http://www.python.org/dev/peps/pep-0227/ [3] PEP 236, Back to the __future__, Peters - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ Copyright Modified: peps/trunk/pep-0245.txt ============================================================================== --- peps/trunk/pep-0245.txt (original) +++ peps/trunk/pep-0245.txt Sun Jan 18 10:50:42 2009 @@ -478,18 +478,18 @@ [2] http://www.zope.org [3] PEP 232, Function Attributes, Warsaw - http://www.python.org/peps/pep-0232.html + http://www.python.org/dev/peps/pep-0232/ [4] PEP 233, Python Online Help, Prescod - http://www.python.org/peps/pep-0233.html + http://www.python.org/dev/peps/pep-0233/ [5] http://www.lemburg.com/files/python/mxProxy.html [6] PEP 236, Back to the __future__, Peters - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ [7] PEP 230, Warning Framework, van Rossum - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ Copyright Modified: peps/trunk/pep-0246.txt ============================================================================== --- peps/trunk/pep-0246.txt (original) +++ peps/trunk/pep-0246.txt Sun Jan 18 10:50:42 2009 @@ -720,7 +720,7 @@ References and Footnotes [1] PEP 245, Python Interface Syntax, Pelletier - http://www.python.org/peps/pep-0245.html + http://www.python.org/dev/peps/pep-0245/ [2] http://www.zope.org/Wikis/Interfaces/FrontPage Modified: peps/trunk/pep-0251.txt ============================================================================== --- peps/trunk/pep-0251.txt (original) +++ peps/trunk/pep-0251.txt Sun Jan 18 10:50:42 2009 @@ -68,7 +68,7 @@ References [1] PEP 101, Doing Python Releases 101 - http://www.python.org/peps/pep-0101.html + http://www.python.org/dev/peps/pep-0101/ [2] Misc/NEWS file from CVS http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Misc/NEWS?rev=1.337.2.4&content-type=text/vnd.viewcvs-markup Modified: peps/trunk/pep-0255.txt ============================================================================== --- peps/trunk/pep-0255.txt (original) +++ peps/trunk/pep-0255.txt Sun Jan 18 10:50:42 2009 @@ -472,12 +472,12 @@ Footnotes and References [1] PEP 234, Iterators, Yee, Van Rossum - http://www.python.org/peps/pep-0234.html + http://www.python.org/dev/peps/pep-0234/ [2] http://www.stackless.com/ [3] PEP 219, Stackless Python, McMillan - http://www.python.org/peps/pep-0219.html + http://www.python.org/dev/peps/pep-0219/ [4] "Iteration Abstraction in Sather" Murer , Omohundro, Stoutamire and Szyperski @@ -490,7 +490,7 @@ [7] http://python.ca/nas/python/generator.diff [8] PEP 236, Back to the __future__, Peters - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ [9] To experiment with this implementation, check out Python from CVS according to the instructions at Modified: peps/trunk/pep-0256.txt ============================================================================== --- peps/trunk/pep-0256.txt (original) +++ peps/trunk/pep-0256.txt Sun Jan 18 10:50:42 2009 @@ -242,13 +242,13 @@ ======================== .. [#PEP-287] PEP 287, reStructuredText Docstring Format, Goodger - (http://www.python.org/peps/pep-0287.html) + (http://www.python.org/dev/peps/pep-0287/) .. [#PEP-257] PEP 257, Docstring Conventions, Goodger, Van Rossum - (http://www.python.org/peps/pep-0257.html) + (http://www.python.org/dev/peps/pep-0257/) .. [#PEP-258] PEP 258, Docutils Design Specification, Goodger - (http://www.python.org/peps/pep-0258.html) + (http://www.python.org/dev/peps/pep-0258/) .. _Literate Programming: http://www.literateprogramming.com/ Modified: peps/trunk/pep-0257.txt ============================================================================== --- peps/trunk/pep-0257.txt (original) +++ peps/trunk/pep-0257.txt Sun Jan 18 10:50:42 2009 @@ -286,10 +286,10 @@ ======================== .. [1] PEP 256, Docstring Processing System Framework, Goodger - (http://www.python.org/peps/pep-0256.html) + (http://www.python.org/dev/peps/pep-0256/) .. [2] PEP 258, Docutils Design Specification, Goodger - (http://www.python.org/peps/pep-0258.html) + (http://www.python.org/dev/peps/pep-0258/) .. [3] Guido van Rossum, Python's creator and Benevolent Dictator For Life. Modified: peps/trunk/pep-0258.txt ============================================================================== --- peps/trunk/pep-0258.txt (original) +++ peps/trunk/pep-0258.txt Sun Jan 18 10:50:42 2009 @@ -951,13 +951,13 @@ ========================== .. [#PEP-256] PEP 256, Docstring Processing System Framework, Goodger - (http://www.python.org/peps/pep-0256.html) + (http://www.python.org/dev/peps/pep-0256/) .. [#PEP-224] PEP 224, Attribute Docstrings, Lemburg - (http://www.python.org/peps/pep-0224.html) + (http://www.python.org/dev/peps/pep-0224/) .. [#PEP-216] PEP 216, Docstring Format, Zadka - (http://www.python.org/peps/pep-0216.html) + (http://www.python.org/dev/peps/pep-0216/) .. _docutils.dtd: http://docutils.sourceforge.net/docs/ref/docutils.dtd Modified: peps/trunk/pep-0269.txt ============================================================================== --- peps/trunk/pep-0269.txt (original) +++ peps/trunk/pep-0269.txt Sun Jan 18 10:50:42 2009 @@ -169,7 +169,7 @@ http://docs.python.org/library/compiler.html [4] Pelletier, Michel. "Python Interface Syntax", PEP-245. - http://www.python.org/peps/pep-0245.html + http://www.python.org/dev/peps/pep-0245/ [5] The Python Types-SIG http://www.python.org/sigs/types-sig/ Modified: peps/trunk/pep-0274.txt ============================================================================== --- peps/trunk/pep-0274.txt (original) +++ peps/trunk/pep-0274.txt Sun Jan 18 10:50:42 2009 @@ -139,7 +139,7 @@ References [1] PEP 202, List Comprehensions - http://www.python.org/peps/pep-0202.html + http://www.python.org/dev/peps/pep-0202/ Copyright Modified: peps/trunk/pep-0276.txt ============================================================================== --- peps/trunk/pep-0276.txt (original) +++ peps/trunk/pep-0276.txt Sun Jan 18 10:50:42 2009 @@ -407,13 +407,13 @@ References [1] PEP 234, Iterators - http://www.python.org/peps/pep-0234.html + http://www.python.org/dev/peps/pep-0234/ [2] PEP 204, Range Literals - http://www.python.org/peps/pep-0204.html + http://www.python.org/dev/peps/pep-0204/ [3] PEP 212, Loop Counter Iteration - http://www.python.org/peps/pep-0212.html + http://www.python.org/dev/peps/pep-0212/ Copyright Modified: peps/trunk/pep-0281.txt ============================================================================== --- peps/trunk/pep-0281.txt (original) +++ peps/trunk/pep-0281.txt Sun Jan 18 10:50:42 2009 @@ -131,7 +131,7 @@ References and Footnotes [1] PEP 212, Loop Counter Iteration - http://www.python.org/peps/pep-0212.html + http://www.python.org/dev/peps/pep-0212/ Copyright Modified: peps/trunk/pep-0284.txt ============================================================================== --- peps/trunk/pep-0284.txt (original) +++ peps/trunk/pep-0284.txt Sun Jan 18 10:50:42 2009 @@ -247,16 +247,16 @@ References [1] PEP 204, Range Literals - http://www.python.org/peps/pep-0204.html + http://www.python.org/dev/peps/pep-0204/ [2] PEP 212, Loop Counter Iteration - http://www.python.org/peps/pep-0212.html + http://www.python.org/dev/peps/pep-0212/ [3] PEP 281, Loop Counter Iteration with range and xrange - http://www.python.org/peps/pep-0281.html + http://www.python.org/dev/peps/pep-0281/ [4] PEP 276, Simple Iterator for ints - http://www.python.org/peps/pep-0276.html + http://www.python.org/dev/peps/pep-0276/ Copyright Modified: peps/trunk/pep-0287.txt ============================================================================== --- peps/trunk/pep-0287.txt (original) +++ peps/trunk/pep-0287.txt Sun Jan 18 10:50:42 2009 @@ -564,7 +564,7 @@ [1] http://www.example.org/ [2] PEP 9876, Let's Hope We Never Get Here - http://www.python.org/peps/pep-9876.html + http://www.python.org/dev/peps/pep-9876/ [3] "Bogus Complexity Addition" @@ -728,10 +728,10 @@ ====================== .. [#PEP-1] PEP 1, PEP Guidelines, Warsaw, Hylton - (http://www.python.org/peps/pep-0001.html) + (http://www.python.org/dev/peps/pep-0001/) .. [#PEP-9] PEP 9, Sample PEP Template, Warsaw - (http://www.python.org/peps/pep-0009.html) + (http://www.python.org/dev/peps/pep-0009/) .. [#Zen] From `The Zen of Python (by Tim Peters)`__ (or just "``import this``" in Python) @@ -739,7 +739,7 @@ __ http://www.python.org/doc/Humor.html#zen .. [#PEP-216] PEP 216, Docstring Format, Zadka - (http://www.python.org/peps/pep-0216.html) + (http://www.python.org/dev/peps/pep-0216/) .. _reStructuredText markup: http://docutils.sourceforge.net/rst.html Modified: peps/trunk/pep-0288.txt ============================================================================== --- peps/trunk/pep-0288.txt (original) +++ peps/trunk/pep-0288.txt Sun Jan 18 10:50:42 2009 @@ -143,7 +143,7 @@ http://gnosis.cx/publish/programming/charming_python_b7.txt [2] PEP 255 Simple Generators: - http://www.python.org/peps/pep-0255.html + http://www.python.org/dev/peps/pep-0255/ [3] Proof-of-concept recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/164044 Modified: peps/trunk/pep-0290.txt ============================================================================== --- peps/trunk/pep-0290.txt (original) +++ peps/trunk/pep-0290.txt Sun Jan 18 10:50:42 2009 @@ -452,7 +452,7 @@ ========== .. [1] PEP 4, Deprecation of Standard Modules, von Loewis - (http://www.python.org/peps/pep-0004.html) + (http://www.python.org/dev/peps/pep-0004/) .. _PyChecker: http://pychecker.sourceforge.net/ Modified: peps/trunk/pep-0298.txt ============================================================================== --- peps/trunk/pep-0298.txt (original) +++ peps/trunk/pep-0298.txt Sun Jan 18 10:50:42 2009 @@ -216,7 +216,7 @@ http://mail.python.org/pipermail/python-dev/2000-October/009974.html [2] The Buffer Problem - http://www.python.org/peps/pep-0296.html + http://www.python.org/dev/peps/pep-0296/ Copyright Modified: peps/trunk/pep-0301.txt ============================================================================== --- peps/trunk/pep-0301.txt (original) +++ peps/trunk/pep-0301.txt Sun Jan 18 10:50:42 2009 @@ -365,10 +365,10 @@ (http://pause.cpan.org/) .. [6] PEP 243, Module Repository Upload Mechanism - (http://www.python.org/peps/pep-0243.html) + (http://www.python.org/dev/peps/pep-0243/) .. [7] PEP 262, A Database of Installed Python Packages - (http://www.python.org/peps/pep-0262.html) + (http://www.python.org/dev/peps/pep-0262/) .. [8] [PEP243] upload status is bogus (http://mail.python.org/pipermail/distutils-sig/2001-March/002262.html) Modified: peps/trunk/pep-0302.txt ============================================================================== --- peps/trunk/pep-0302.txt (original) +++ peps/trunk/pep-0302.txt Sun Jan 18 10:50:42 2009 @@ -553,7 +553,7 @@ http://www.mcmillan-inc.com/install1.html [2] PEP 273, Import Modules from Zip Archives, Ahlstrom - http://www.python.org/peps/pep-0273.html + http://www.python.org/dev/peps/pep-0273/ [3] The Freeze tool Tools/freeze/ in a Python source distribution Modified: peps/trunk/pep-0313.txt ============================================================================== --- peps/trunk/pep-0313.txt (original) +++ peps/trunk/pep-0313.txt Sun Jan 18 10:50:42 2009 @@ -105,13 +105,13 @@ References [1] PEP 239, Adding a Rational Type to Python - http://www.python.org/peps/pep-0239.html + http://www.python.org/dev/peps/pep-0239/ [2] PEP 240, Adding a Rational Literal to Python - http://www.python.org/peps/pep-0240.html + http://www.python.org/dev/peps/pep-0240/ [3] PEP 8, Style Guide for Python Code - http://www.python.org/peps/pep-0008.html + http://www.python.org/dev/peps/pep-0008/ Copyright Modified: peps/trunk/pep-0314.txt ============================================================================== --- peps/trunk/pep-0314.txt (original) +++ peps/trunk/pep-0314.txt Sun Jan 18 10:50:42 2009 @@ -300,7 +300,7 @@ http://docutils.sourceforge.net/ [2] PEP 301 - http://www.python.org/peps/pep-0301.html + http://www.python.org/dev/peps/pep-0301/ Copyright Modified: peps/trunk/pep-0317.txt ============================================================================== --- peps/trunk/pep-0317.txt (original) +++ peps/trunk/pep-0317.txt Sun Jan 18 10:50:42 2009 @@ -434,16 +434,16 @@ http://www.python.org/doc/essays/stdexceptions.html .. [2] "Guidelines for Language Evolution", Paul Prescod. - http://www.python.org/peps/pep-0005.html + http://www.python.org/dev/peps/pep-0005/ .. [3] "Python Language Reference", Guido van Rossum. http://docs.python.org/reference/simple_stmts.html#raise .. [4] PEP 236 "Back to the __future__", Tim Peters. - http://www.python.org/peps/pep-0236.html + http://www.python.org/dev/peps/pep-0236/ .. [5] PEP 230 "Warning Framework", Guido van Rossum. - http://www.python.org/peps/pep-0230.html + http://www.python.org/dev/peps/pep-0230/ .. [6] Guido van Rossum, 11 June 2003 post to ``python-dev``. http://mail.python.org/pipermail/python-dev/2003-June/036176.html Modified: peps/trunk/pep-0323.txt ============================================================================== --- peps/trunk/pep-0323.txt (original) +++ peps/trunk/pep-0323.txt Sun Jan 18 10:50:42 2009 @@ -466,7 +466,7 @@ http://docs.python.org/library/copy.html [3] PEP 289, Generator Expressions, Hettinger - http://www.python.org/peps/pep-0289.html + http://www.python.org/dev/peps/pep-0289/ Copyright Modified: peps/trunk/pep-0325.txt ============================================================================== --- peps/trunk/pep-0325.txt (original) +++ peps/trunk/pep-0325.txt Sun Jan 18 10:50:42 2009 @@ -266,10 +266,10 @@ References [1] PEP 255 Simple Generators - http://www.python.org/peps/pep-0255.html + http://www.python.org/dev/peps/pep-0255/ [2] PEP 288 Generators Attributes and Exceptions - http://www.python.org/peps/pep-0288.html + http://www.python.org/dev/peps/pep-0288/ Copyright Modified: peps/trunk/pep-0329.txt ============================================================================== --- peps/trunk/pep-0329.txt (original) +++ peps/trunk/pep-0329.txt Sun Jan 18 10:50:42 2009 @@ -256,7 +256,7 @@ ========== .. [1] Optimizing Global Variable/Attribute Access - http://www.python.org/peps/pep-0266.html + http://www.python.org/dev/peps/pep-0266/ .. [2] ASPN Recipe for a non-private implementation http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 Modified: peps/trunk/pep-0331.txt ============================================================================== --- peps/trunk/pep-0331.txt (original) +++ peps/trunk/pep-0331.txt Sun Jan 18 10:50:42 2009 @@ -164,7 +164,7 @@ References [1] PEP 1, PEP Purpose and Guidelines, Warsaw, Hylton - http://www.python.org/peps/pep-0001.html + http://www.python.org/dev/peps/pep-0001/ [2] Python locale documentation for embedding, http://docs.python.org/library/locale.html Modified: peps/trunk/pep-0334.txt ============================================================================== --- peps/trunk/pep-0334.txt (original) +++ peps/trunk/pep-0334.txt Sun Jan 18 10:50:42 2009 @@ -382,7 +382,7 @@ (http://c2.com/cgi/wiki?CallWithCurrentContinuation) .. [5] PEP 234, Iterators - (http://www.python.org/peps/pep-0234.html) + (http://www.python.org/dev/peps/pep-0234/) .. [6] Stackless Python (http://stackless.com) @@ -391,7 +391,7 @@ (http://www.sidhe.org/~dan/blog/archives/000178.html) .. [8] PEP 255, Simple Generators - (http://www.python.org/peps/pep-0255.html) + (http://www.python.org/dev/peps/pep-0255/) .. [9] itertools - Functions creating iterators (http://docs.python.org/library/itertools.html) Modified: peps/trunk/pep-0337.txt ============================================================================== --- peps/trunk/pep-0337.txt (original) +++ peps/trunk/pep-0337.txt Sun Jan 18 10:50:42 2009 @@ -171,7 +171,7 @@ References [1] PEP 282, A Logging System, Vinay Sajip, Trent Mick - http://www.python.org/peps/pep-0282.html + http://www.python.org/dev/peps/pep-0282/ [2] http://mail.python.org/pipermail/python-dev/2004-October/049282.html Modified: peps/trunk/pep-0338.txt ============================================================================== --- peps/trunk/pep-0338.txt (original) +++ peps/trunk/pep-0338.txt Sun Jan 18 10:50:42 2009 @@ -306,7 +306,7 @@ ========== .. [1] Special __main__() function in modules - (http://www.python.org/peps/pep-0299.html) + (http://www.python.org/dev/peps/pep-0299/) .. [2] PEP 338 implementation (runpy module and ``-m`` update) (http://www.python.org/sf/1429601) @@ -315,7 +315,7 @@ (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307772) .. [4] New import hooks - (http://www.python.org/peps/pep-0302.html) + (http://www.python.org/dev/peps/pep-0302/) .. [5] PEP 338 documentation (for runpy module) (http://www.python.org/sf/1429605) Modified: peps/trunk/pep-0340.txt ============================================================================== --- peps/trunk/pep-0340.txt (original) +++ peps/trunk/pep-0340.txt Sun Jan 18 10:50:42 2009 @@ -451,7 +451,7 @@ Used as follows: block auto_retry(3, IOError): - f = urllib.urlopen("http://python.org/peps/pep-0340.html") + f = urllib.urlopen("http://www.python.org/dev/peps/pep-0340/") print f.read() 5. It is possible to nest blocks and combine templates: Modified: peps/trunk/pep-0346.txt ============================================================================== --- peps/trunk/pep-0346.txt (original) +++ peps/trunk/pep-0346.txt Sun Jan 18 10:50:42 2009 @@ -1264,22 +1264,22 @@ ========== .. [1] Reliable Acquisition/Release Pairs - (http://www.python.org/peps/pep-0310.html) + (http://www.python.org/dev/peps/pep-0310/) .. [2] Anonymous block statements - (http://www.python.org/peps/pep-0340.html) + (http://www.python.org/dev/peps/pep-0340/) .. [3] Anonymous blocks, redux - (http://www.python.org/peps/pep-0343.html) + (http://www.python.org/dev/peps/pep-0343/) .. [4] Enhanced Iterators - (http://www.python.org/peps/pep-0342.html) + (http://www.python.org/dev/peps/pep-0342/) .. [5] Generator Attributes and Exceptions - (http://www.python.org/peps/pep-0288.html) + (http://www.python.org/dev/peps/pep-0288/) .. [6] Resource-Release Support for Generators - (http://www.python.org/peps/pep-0325.html) + (http://www.python.org/dev/peps/pep-0325/) .. [7] A rant against flow control macros (http://blogs.msdn.com/oldnewthing/archive/2005/01/06/347666.aspx) Modified: peps/trunk/pep-0348.txt ============================================================================== --- peps/trunk/pep-0348.txt (original) +++ peps/trunk/pep-0348.txt Sun Jan 18 10:50:42 2009 @@ -447,13 +447,13 @@ ========== .. [#PEP342] PEP 342 (Coroutines via Enhanced Generators) - http://www.python.org/peps/pep-0342.html + http://www.python.org/dev/peps/pep-0342/ .. [#PEP344] PEP 344 (Exception Chaining and Embedded Tracebacks) - http://www.python.org/peps/pep-0344.html + http://www.python.org/dev/peps/pep-0344/ .. [#PEP290] PEP 290 (Code Migration and Modernization) - http://www.python.org/peps/pep-0290.html + http://www.python.org/dev/peps/pep-0290/ .. [#Summary2004-08-01] python-dev Summary (An exception is an exception, unless it doesn't inherit from Exception) @@ -505,7 +505,7 @@ http://mail.python.org/pipermail/python-dev/2005-August/055423.html .. [#zen] PEP 20 (The Zen of Python) - http://www.python.org/peps/pep-0020.html + http://www.python.org/dev/peps/pep-0020/ .. [#tutorial] Python Tutorial http://docs.python.org/tutorial/ Modified: peps/trunk/pep-0352.txt ============================================================================== --- peps/trunk/pep-0352.txt (original) +++ peps/trunk/pep-0352.txt Sun Jan 18 10:50:42 2009 @@ -283,7 +283,7 @@ ========== .. [#pep348] PEP 348 (Exception Reorganization for Python 3.0) - http://www.python.org/peps/pep-0348.html + http://www.python.org/dev/peps/pep-0348/ .. [#hierarchy-good] python-dev Summary for 2004-08-01 through 2004-08-15 http://www.python.org/dev/summary/2004-08-01_2004-08-15.html#an-exception-is-an-exception-unless-it-doesn-t-inherit-from-exception Modified: peps/trunk/pep-0666.txt ============================================================================== --- peps/trunk/pep-0666.txt (original) +++ peps/trunk/pep-0666.txt Sun Jan 18 10:50:42 2009 @@ -82,7 +82,7 @@ References [1] PEP 1, PEP Purpose and Guidelines - http://www.python.org/peps/pep-0001.html + http://www.python.org/dev/peps/pep-0001/ [2] Tim Peters already has (private correspondence). My early 2.2 didn't have a __getattribute__, and __getattr__ was Modified: peps/trunk/pep-3126.txt ============================================================================== --- peps/trunk/pep-3126.txt (original) +++ peps/trunk/pep-3126.txt Sun Jan 18 10:50:42 2009 @@ -353,7 +353,7 @@ http://mail.python.org/pipermail/python-3000/2007-April/006563.html .. [#PEP3101] PEP 3101, Advanced String Formatting, Talin - http://www.python.org/peps/pep-3101.html + http://www.python.org/dev/peps/pep-3101/ .. [#elimpercent] ps to question Re: Need help completing ABC pep, van Rossum From python-checkins at python.org Sun Jan 18 11:28:20 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:28:20 +0100 (CET) Subject: [Python-checkins] r68715 - peps/trunk/pep-3142.txt Message-ID: <20090118102820.CBD111E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:28:20 2009 New Revision: 68715 Log: Add PEP 3142. Added: peps/trunk/pep-3142.txt (contents, props changed) Added: peps/trunk/pep-3142.txt ============================================================================== --- (empty file) +++ peps/trunk/pep-3142.txt Sun Jan 18 11:28:20 2009 @@ -0,0 +1,127 @@ +PEP: 3142 +Title: Add a "while" clause to generator expressions +Version: $Revision$ +Last-Modified: $Date$ +Author: Gerald Britton +Status: Draft +Type: Standards Track +Content-Type: text/plain +Created: 12-Jan-2009 +Python-Version: 3.0 +Post-History: + + +Abstract + + This PEP proposes an enhancement to generator expressions, adding a + "while" clause to complement the existing "if" clause. + + +Rationale + + A generator expression (PEP 289 [1]) is a concise method to serve + dynamically-generated objects to list comprehensions (PEP 202 [2]). + Current generator expressions allow for an "if" clause to filter + the objects that are returned to those meeting some set of + criteria. However, since the "if" clause is evaluated for every + object that may be returned, in some cases it is possible that all + objects would be rejected after a certain point. For example: + + g = (n for n in range(100) if n*n < 50) + + which is equivalent to the using a generator function + (PEP 255 [3]): + + def __gen(exp): + for n in exp: + if n*n < 50: + yield n + g = __gen(iter(range(10))) + + would yield 0, 1, 2, 3, 4, 5, 6 and 7, but would also consider + the numbers from 8 to 99 and reject them all since n*n >= 50 for + numbers in that range. Allowing for a "while" clause would allow + the redundant tests to be short-circuited: + + g = (n for n in range(100) while n*n < 50) + + would also yield 0, 1, 2, 3, 4, 5, 6 and 7, but would stop at 8 + since the condition (n*n < 50) is no longer true. This would be + equivalent to the generator function: + + def __gen(exp): + for n in exp: + if n*n < 50: + yield n + else: + break + g = __gen(iter(range(100))) + + Currently, in order to achieve the same result, one would need to + either write a generator function such as the one above or use the + takewhile function from itertools: + + from itertools import takewhile + g = takewhile(lambda n: n*n < 50, range(100)) + + The takewhile code achieves the same result as the proposed syntax, + albeit in a longer (some would say "less-elegant") fashion. Also, + the takewhile version requires an extra function call (the lambda + in the example above) with the associated performance penalty. + A simple test shows that: + + for n in (n for n in range(100) if 1): pass + + performs about 10% better than: + + for n in takewhile(lambda n: 1, range(100)): pass + + though they achieve similar results. (The first example uses a + generator; takewhile is an iterator). If similarly implemented, + a "while" clause should perform about the same as the "if" clause + does today. + + The reader may ask if the "if" and "while" clauses should be + mutually exclusive. There are good examples that show that there + are times when both may be used to good advantage. For example: + + p = (p for p in primes() if p > 100 while p < 1000) + + should return prime numbers found between 100 and 1000, assuming + I have a primes() generator that yields prime numbers. + + Adding a "while" clause to generator expressions maintains the + compact form while adding a useful facility for short-circuiting + the expression. + + +Acknowledgements + + Raymond Hettinger first proposed the concept of generator + expressions in January 2002. + + +References + + [1] PEP 289: Generator Expressions + http://www.python.org/dev/peps/pep-0289/ + + [2] PEP 202: List Comprehensions + http://www.python.org/dev/peps/pep-0202/ + + [3] PEP 255: Simple Generators + http://www.python.org/dev/peps/pep-0255/ + + +Copyright + + This document has been placed in the public domain. + + +Local Variables: +mode: indented-text +indent-tabs-mode: nil +sentence-end-double-space: t +fill-column: 70 +coding: utf-8 +End: From python-checkins at python.org Sun Jan 18 11:38:17 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:38:17 +0100 (CET) Subject: [Python-checkins] r68716 - python/branches/py3k/Doc/library/stdtypes.rst Message-ID: <20090118103817.0FDF91E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:38:16 2009 New Revision: 68716 Log: #4984: fix number of types. Modified: python/branches/py3k/Doc/library/stdtypes.rst Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sun Jan 18 11:38:16 2009 @@ -594,7 +594,7 @@ Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`list`, :class:`tuple`, :class:`range` ================================================================================================================== -There are five sequence types: strings, byte sequences, byte arrays, lists, +There are six sequence types: strings, byte sequences, byte arrays, lists, tuples, and range objects. (For other containers see the built-in :class:`dict`, :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.) From python-checkins at python.org Sun Jan 18 11:40:25 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:40:25 +0100 (CET) Subject: [Python-checkins] r68717 - python/branches/py3k/Doc/library/stdtypes.rst Message-ID: <20090118104025.B5FDD1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:40:25 2009 New Revision: 68717 Log: #4983: clarify what "byte sequence" is. Modified: python/branches/py3k/Doc/library/stdtypes.rst Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sun Jan 18 11:40:25 2009 @@ -594,16 +594,17 @@ Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`list`, :class:`tuple`, :class:`range` ================================================================================================================== -There are six sequence types: strings, byte sequences, byte arrays, lists, -tuples, and range objects. (For other containers see the built-in -:class:`dict`, :class:`list`, :class:`set`, and :class:`tuple` classes, and the -:mod:`collections` module.) +There are six sequence types: strings, byte sequences (:class:`bytes` objects), +byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. + +For other containers see the built-in :class:`dict`, :class:`list`, +:class:`set`, and :class:`tuple` classes, and the :mod:`collections` module. .. index:: object: sequence object: string object: bytes - object: buffer + object: bytearray object: tuple object: list object: range From python-checkins at python.org Sun Jan 18 11:42:36 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:42:36 +0100 (CET) Subject: [Python-checkins] r68718 - in python/trunk/Doc: library/stdtypes.rst tools/rstlint.py Message-ID: <20090118104236.006881E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:42:35 2009 New Revision: 68718 Log: #4976: union() and intersection() take multiple args, but talk about "the other". Modified: python/trunk/Doc/library/stdtypes.rst python/trunk/Doc/tools/rstlint.py Modified: python/trunk/Doc/library/stdtypes.rst ============================================================================== --- python/trunk/Doc/library/stdtypes.rst (original) +++ python/trunk/Doc/library/stdtypes.rst Sun Jan 18 11:42:35 2009 @@ -1679,7 +1679,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. @@ -1687,7 +1687,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/trunk/Doc/tools/rstlint.py ============================================================================== --- python/trunk/Doc/tools/rstlint.py (original) +++ python/trunk/Doc/tools/rstlint.py Sun Jan 18 11:42:35 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 From python-checkins at python.org Sun Jan 18 11:43:58 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:43:58 +0100 (CET) Subject: [Python-checkins] r68719 - python/branches/py3k/Doc/library/base64.rst Message-ID: <20090118104358.DC6861E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:43:58 2009 New Revision: 68719 Log: #4975: fix bytes/str issue. Modified: python/branches/py3k/Doc/library/base64.rst Modified: python/branches/py3k/Doc/library/base64.rst ============================================================================== --- python/branches/py3k/Doc/library/base64.rst (original) +++ python/branches/py3k/Doc/library/base64.rst Sun Jan 18 11:43:58 2009 @@ -154,7 +154,7 @@ >>> import base64 >>> encoded = base64.b64encode('data to be encoded') >>> encoded - 'ZGF0YSB0byBiZSBlbmNvZGVk' + b'ZGF0YSB0byBiZSBlbmNvZGVk' >>> data = base64.b64decode(encoded) >>> data 'data to be encoded' From python-checkins at python.org Sun Jan 18 11:45:22 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:45:22 +0100 (CET) Subject: [Python-checkins] r68720 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090118104522.BAD001E4023@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:45:22 2009 New Revision: 68720 Log: #4974: fix redundant mention of lists and tuples. Modified: python/trunk/Doc/library/stdtypes.rst Modified: python/trunk/Doc/library/stdtypes.rst ============================================================================== --- python/trunk/Doc/library/stdtypes.rst (original) +++ python/trunk/Doc/library/stdtypes.rst Sun Jan 18 11:45:22 2009 @@ -632,9 +632,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:: From python-checkins at python.org Sun Jan 18 11:48:16 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 11:48:16 +0100 (CET) Subject: [Python-checkins] r68721 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090118104816.4597B1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 11:48:16 2009 New Revision: 68721 Log: #4914: trunc is in math. Modified: python/trunk/Doc/library/stdtypes.rst Modified: python/trunk/Doc/library/stdtypes.rst ============================================================================== --- python/trunk/Doc/library/stdtypes.rst (original) +++ python/trunk/Doc/library/stdtypes.rst Sun Jan 18 11:48:16 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 | | From python-checkins at python.org Sun Jan 18 11:58:44 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Sun, 18 Jan 2009 11:58:44 +0100 (CET) Subject: [Python-checkins] r68722 - python/trunk/Lib/test/test_capi.py Message-ID: <20090118105844.90F391E4002@bag.python.org> Author: kristjan.jonsson Date: Sun Jan 18 11:58:44 2009 New Revision: 68722 Log: issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16. Modified: python/trunk/Lib/test/test_capi.py Modified: python/trunk/Lib/test/test_capi.py ============================================================================== --- python/trunk/Lib/test/test_capi.py (original) +++ python/trunk/Lib/test/test_capi.py Sun Jan 18 11:58:44 2009 @@ -1,6 +1,7 @@ # Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. +from __future__ import with_statement import sys import time import random @@ -26,7 +27,7 @@ if _testcapi._pending_threadfunc(callback): break; - def pendingcalls_wait(self, l, n): + def pendingcalls_wait(self, l, n, context = None): #now, stick around until l[0] has grown to 10 count = 0; while len(l) != n: @@ -37,6 +38,8 @@ print "(%i)"%(len(l),), for i in xrange(1000): a = i*i + if context and not context.event.is_set(): + continue count += 1 self.failUnless(count < 10000, "timeout waiting for %i callbacks, got %i"%(n, len(l))) @@ -44,21 +47,41 @@ print "(%i)"%(len(l),) def test_pendingcalls_threaded(self): - l = [] #do every callback on a separate thread - n = 32 + n = 32 #total callbacks threads = [] - for i in range(n): - t = threading.Thread(target=self.pendingcalls_submit, args = (l, 1)) + class foo(object):pass + context = foo() + context.l = [] + context.n = 2 #submits per thread + context.nThreads = n / context.n + context.nFinished = 0 + context.lock = threading.Lock() + context.event = threading.Event() + + for i in range(context.nThreads): + t = threading.Thread(target=self.pendingcalls_thread, args = (context,)) t.start() threads.append(t) - self.pendingcalls_wait(l, n) + self.pendingcalls_wait(context.l, n, context) for t in threads: t.join() + def pendingcalls_thread(self, context): + try: + self.pendingcalls_submit(context.l, context.n) + finally: + with context.lock: + context.nFinished += 1 + nFinished = context.nFinished + if False and test_support.verbose: + print "finished threads: ", nFinished + if nFinished == context.nThreads: + context.event.set() + def test_pendingcalls_non_threaded(self): #again, just using the main thread, likely they will all be dispathced at #once. It is ok to ask for too many, because we loop until we find a slot. From python-checkins at python.org Sun Jan 18 12:01:51 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 18 Jan 2009 12:01:51 +0100 (CET) Subject: [Python-checkins] r68723 - in python/branches/release30-maint: Modules/_struct.c Modules/grpmodule.c Modules/selectmodule.c Objects/weakrefobject.c Message-ID: <20090118110151.35E041E4097@bag.python.org> Author: mark.dickinson Date: Sun Jan 18 12:01:50 2009 New Revision: 68723 Log: Merged revisions 68675 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68675 | mark.dickinson | 2009-01-17 21:57:11 +0000 (Sat, 17 Jan 2009) | 2 lines Replace PyNumber_Int with PyNumber_Long. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/_struct.c python/branches/release30-maint/Modules/grpmodule.c python/branches/release30-maint/Modules/selectmodule.c python/branches/release30-maint/Objects/weakrefobject.c Modified: python/branches/release30-maint/Modules/_struct.c ============================================================================== --- python/branches/release30-maint/Modules/_struct.c (original) +++ python/branches/release30-maint/Modules/_struct.c Sun Jan 18 12:01:50 2009 @@ -155,7 +155,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_long(o, p); @@ -260,7 +260,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_wrapped_long(o, p); @@ -299,7 +299,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_wrapped_ulong(o, p); Modified: python/branches/release30-maint/Modules/grpmodule.c ============================================================================== --- python/branches/release30-maint/Modules/grpmodule.c (original) +++ python/branches/release30-maint/Modules/grpmodule.c Sun Jan 18 12:01:50 2009 @@ -90,7 +90,7 @@ unsigned int gid; struct group *p; - py_int_id = PyNumber_Int(pyo_id); + py_int_id = PyNumber_Long(pyo_id); if (!py_int_id) return NULL; gid = PyLong_AS_LONG(py_int_id); Modified: python/branches/release30-maint/Modules/selectmodule.c ============================================================================== --- python/branches/release30-maint/Modules/selectmodule.c (original) +++ python/branches/release30-maint/Modules/selectmodule.c Sun Jan 18 12:01:50 2009 @@ -515,7 +515,7 @@ return NULL; } else { - tout = PyNumber_Int(tout); + tout = PyNumber_Long(tout); if (!tout) return NULL; timeout = PyLong_AsLong(tout); Modified: python/branches/release30-maint/Objects/weakrefobject.c ============================================================================== --- python/branches/release30-maint/Objects/weakrefobject.c (original) +++ python/branches/release30-maint/Objects/weakrefobject.c Sun Jan 18 12:01:50 2009 @@ -488,7 +488,7 @@ WRAP_BINARY(proxy_and, PyNumber_And) WRAP_BINARY(proxy_xor, PyNumber_Xor) WRAP_BINARY(proxy_or, PyNumber_Or) -WRAP_UNARY(proxy_int, PyNumber_Int) +WRAP_UNARY(proxy_int, PyNumber_Long) WRAP_UNARY(proxy_float, PyNumber_Float) WRAP_BINARY(proxy_iadd, PyNumber_InPlaceAdd) WRAP_BINARY(proxy_isub, PyNumber_InPlaceSubtract) From python-checkins at python.org Sun Jan 18 14:24:10 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 14:24:10 +0100 (CET) Subject: [Python-checkins] r68724 - python/trunk/Doc/library/random.rst Message-ID: <20090118132410.E99401E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 14:24:10 2009 New Revision: 68724 Log: #4979: correct result range for some random functions. Modified: python/trunk/Doc/library/random.rst Modified: python/trunk/Doc/library/random.rst ============================================================================== --- python/trunk/Doc/library/random.rst (original) +++ python/trunk/Doc/library/random.rst Sun Jan 18 14:24:10 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) From python-checkins at python.org Sun Jan 18 14:47:26 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 14:47:26 +0100 (CET) Subject: [Python-checkins] r68725 - python/trunk/Doc/reference/simple_stmts.rst Message-ID: <20090118134726.DE09F1E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 14:47:26 2009 New Revision: 68725 Log: #4857: fix augmented assignment target spec. 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 Sun Jan 18 14:47:26 2009 @@ -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: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**=" : | ">>=" | "<<=" | "&=" | "^=" | "|=" From python-checkins at python.org Sun Jan 18 15:41:52 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 15:41:52 +0100 (CET) Subject: [Python-checkins] r68726 - python/trunk/Doc/library/datetime.rst Message-ID: <20090118144152.E80C51E4002@bag.python.org> Author: georg.brandl Date: Sun Jan 18 15:41:52 2009 New Revision: 68726 Log: #4923: clarify what was added. Modified: python/trunk/Doc/library/datetime.rst Modified: python/trunk/Doc/library/datetime.rst ============================================================================== --- python/trunk/Doc/library/datetime.rst (original) +++ python/trunk/Doc/library/datetime.rst Sun Jan 18 15:41:52 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 From python-checkins at python.org Sun Jan 18 19:25:31 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 18 Jan 2009 19:25:31 +0100 (CET) Subject: [Python-checkins] r68727 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20090118182531.22A211E4012@bag.python.org> Author: georg.brandl Date: Sun Jan 18 19:25:30 2009 New Revision: 68727 Log: #4986: augassigns are not expressions. 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 Sun Jan 18 19:25:30 2009 @@ -2084,13 +2084,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``. From python-checkins at python.org Sun Jan 18 20:44:02 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 18 Jan 2009 20:44:02 +0100 (CET) Subject: [Python-checkins] r68728 - in python/branches/py3k: Lib/multiprocessing/forking.py Lib/multiprocessing/managers.py Misc/NEWS Message-ID: <20090118194402.F28FC1E4036@bag.python.org> Author: jesse.noller Date: Sun Jan 18 20:44:02 2009 New Revision: 68728 Log: Issues #10867: remove old cPickle imports from multiprocessing Modified: python/branches/py3k/Lib/multiprocessing/forking.py python/branches/py3k/Lib/multiprocessing/managers.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/multiprocessing/forking.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/forking.py (original) +++ python/branches/py3k/Lib/multiprocessing/forking.py Sun Jan 18 20:44:02 2009 @@ -151,14 +151,10 @@ import _subprocess import time + from pickle import dump, load, HIGHEST_PROTOCOL from ._multiprocessing import win32, Connection, PipeConnection from .util import Finalize - #try: - # from cPickle import dump, load, HIGHEST_PROTOCOL - #except ImportError: - from pickle import load, HIGHEST_PROTOCOL - def dump(obj, file, protocol=None): ForkingPickler(file, protocol).dump(obj) Modified: python/branches/py3k/Lib/multiprocessing/managers.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/managers.py (original) +++ python/branches/py3k/Lib/multiprocessing/managers.py Sun Jan 18 20:44:02 2009 @@ -21,16 +21,12 @@ import queue from traceback import format_exc +from pickle import PicklingError from multiprocessing import Process, current_process, active_children, Pool, util, connection from multiprocessing.process import AuthenticationString from multiprocessing.forking import exit, Popen, assert_spawning, ForkingPickler from multiprocessing.util import Finalize, info -try: - from cPickle import PicklingError -except ImportError: - from pickle import PicklingError - # # Register some things for pickling # Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 18 20:44:02 2009 @@ -132,6 +132,9 @@ Library ------- +- Issue #10867: Remove python2.x try: except: imports for old cPickle from + multiprocessing. + - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. From python-checkins at python.org Sun Jan 18 20:45:18 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 18 Jan 2009 20:45:18 +0100 (CET) Subject: [Python-checkins] r68729 - python/branches/py3k/Misc/NEWS Message-ID: <20090118194518.49F431E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 18 20:45:18 2009 New Revision: 68729 Log: Correct issue number for 68728 checkin Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 18 20:45:18 2009 @@ -132,7 +132,7 @@ Library ------- -- Issue #10867: Remove python2.x try: except: imports for old cPickle from +- Issue #3325: Remove python2.x try: except: imports for old cPickle from multiprocessing. - Issue #4959: inspect.formatargspec now works for keyword only arguments From python-checkins at python.org Sun Jan 18 21:15:42 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 18 Jan 2009 21:15:42 +0100 (CET) Subject: [Python-checkins] r68730 - in python/branches/py3k/Lib/idlelib: IOBinding.py NEWS.txt ScriptBinding.py Message-ID: <20090118201542.DFFAC1E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 18 21:15:42 2009 New Revision: 68730 Log: Issue #4008: Fix problems with non-ASCII source files. Modified: python/branches/py3k/Lib/idlelib/IOBinding.py python/branches/py3k/Lib/idlelib/NEWS.txt python/branches/py3k/Lib/idlelib/ScriptBinding.py Modified: python/branches/py3k/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/py3k/Lib/idlelib/IOBinding.py (original) +++ python/branches/py3k/Lib/idlelib/IOBinding.py Sun Jan 18 21:15:42 2009 @@ -74,10 +74,11 @@ Raise a LookupError if the encoding is declared but unknown. """ if isinstance(data, bytes): - try: - lines = data.decode('utf-8') - except UnicodeDecodeError: - return None + # This encoding might be wrong. However, the coding + # spec must be ASCII-only, so any non-ASCII characters + # around here will be ignored. Decoding to Latin-1 should + # never fail (except for memory outage) + lines = data.decode('iso-8859-1') else: lines = data # consider only the first two lines Modified: python/branches/py3k/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k/Lib/idlelib/NEWS.txt Sun Jan 18 21:15:42 2009 @@ -3,6 +3,8 @@ *Release date: XX-XXX-XXXX* +- Issue #4008: Fix problems with non-ASCII source files. + - Issue #4323: Always encode source as UTF-8 without asking the user (unless a different encoding is declared); remove user configuration of source encoding; all according to Modified: python/branches/py3k/Lib/idlelib/ScriptBinding.py ============================================================================== --- python/branches/py3k/Lib/idlelib/ScriptBinding.py (original) +++ python/branches/py3k/Lib/idlelib/ScriptBinding.py Sun Jan 18 21:15:42 2009 @@ -24,7 +24,7 @@ import tokenize import tkinter.messagebox as tkMessageBox from idlelib.EditorWindow import EditorWindow -from idlelib import PyShell +from idlelib import PyShell, IOBinding from idlelib.configHandler import idleConf @@ -62,7 +62,13 @@ return 'break' def tabnanny(self, filename): - f = open(filename, 'r') + # XXX: tabnanny should work on binary files as well + with open(filename, 'r', encoding='iso-8859-1') as f: + two_lines = f.readline() + f.readline() + encoding = IOBinding.coding_spec(two_lines) + if not encoding: + encoding = 'utf-8' + f = open(filename, 'r', encoding=encoding) try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError as msg: @@ -82,14 +88,14 @@ self.shell = shell = self.flist.open_shell() saved_stream = shell.get_warning_stream() shell.set_warning_stream(shell.stderr) - f = open(filename, 'r') + f = open(filename, 'rb') source = f.read() f.close() - if '\r' in source: - source = re.sub(r"\r\n", "\n", source) - source = re.sub(r"\r", "\n", source) - if source and source[-1] != '\n': - source = source + '\n' + if b'\r' in source: + source = source.replace(b'\r\n', b'\n') + source = source.replace(b'\r', b'\n') + if source and source[-1] != ord(b'\n'): + source = source + b'\n' editwin = self.editwin text = editwin.text text.tag_remove("ERROR", "1.0", "end") From python-checkins at python.org Sun Jan 18 21:17:45 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 18 Jan 2009 21:17:45 +0100 (CET) Subject: [Python-checkins] r68731 - in python/branches/release30-maint: Lib/idlelib/IOBinding.py Lib/idlelib/NEWS.txt Lib/idlelib/ScriptBinding.py Message-ID: <20090118201745.2CF991E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 18 21:17:44 2009 New Revision: 68731 Log: Merged revisions 68730 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68730 | martin.v.loewis | 2009-01-18 21:15:42 +0100 (So, 18 Jan 2009) | 2 lines Issue #4008: Fix problems with non-ASCII source files. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/idlelib/IOBinding.py python/branches/release30-maint/Lib/idlelib/NEWS.txt python/branches/release30-maint/Lib/idlelib/ScriptBinding.py Modified: python/branches/release30-maint/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/IOBinding.py (original) +++ python/branches/release30-maint/Lib/idlelib/IOBinding.py Sun Jan 18 21:17:44 2009 @@ -74,10 +74,11 @@ Raise a LookupError if the encoding is declared but unknown. """ if isinstance(data, bytes): - try: - lines = data.decode('utf-8') - except UnicodeDecodeError: - return None + # This encoding might be wrong. However, the coding + # spec must be ASCII-only, so any non-ASCII characters + # around here will be ignored. Decoding to Latin-1 should + # never fail (except for memory outage) + lines = data.decode('iso-8859-1') else: lines = data # consider only the first two lines Modified: python/branches/release30-maint/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/release30-maint/Lib/idlelib/NEWS.txt (original) +++ python/branches/release30-maint/Lib/idlelib/NEWS.txt Sun Jan 18 21:17:44 2009 @@ -3,6 +3,8 @@ *Release date: XX-XXX-XXXX* +- Issue #4008: Fix problems with non-ASCII source files. + - Issue #4323: Always encode source as UTF-8 without asking the user (unless a different encoding is declared); remove user configuration of source encoding; all according to Modified: python/branches/release30-maint/Lib/idlelib/ScriptBinding.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/ScriptBinding.py (original) +++ python/branches/release30-maint/Lib/idlelib/ScriptBinding.py Sun Jan 18 21:17:44 2009 @@ -24,7 +24,7 @@ import tokenize import tkinter.messagebox as tkMessageBox from idlelib.EditorWindow import EditorWindow -from idlelib import PyShell +from idlelib import PyShell, IOBinding from idlelib.configHandler import idleConf @@ -62,7 +62,13 @@ return 'break' def tabnanny(self, filename): - f = open(filename, 'r') + # XXX: tabnanny should work on binary files as well + with open(filename, 'r', encoding='iso-8859-1') as f: + two_lines = f.readline() + f.readline() + encoding = IOBinding.coding_spec(two_lines) + if not encoding: + encoding = 'utf-8' + f = open(filename, 'r', encoding=encoding) try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError as msg: @@ -82,14 +88,14 @@ self.shell = shell = self.flist.open_shell() saved_stream = shell.get_warning_stream() shell.set_warning_stream(shell.stderr) - f = open(filename, 'r') + f = open(filename, 'rb') source = f.read() f.close() - if '\r' in source: - source = re.sub(r"\r\n", "\n", source) - source = re.sub(r"\r", "\n", source) - if source and source[-1] != '\n': - source = source + '\n' + if b'\r' in source: + source = source.replace(b'\r\n', b'\n') + source = source.replace(b'\r', b'\n') + if source and source[-1] != ord(b'\n'): + source = source + b'\n' editwin = self.editwin text = editwin.text text.tag_remove("ERROR", "1.0", "end") From python-checkins at python.org Sun Jan 18 21:23:36 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 18 Jan 2009 21:23:36 +0100 (CET) Subject: [Python-checkins] r68732 - in python/branches/py3k/Lib/idlelib: IOBinding.py NEWS.txt Message-ID: <20090118202336.693701E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 18 21:23:36 2009 New Revision: 68732 Log: Issue #4815: Offer conversion to UTF-8 if source files have no encoding declaration and are not encoded in UTF-8. Modified: python/branches/py3k/Lib/idlelib/IOBinding.py python/branches/py3k/Lib/idlelib/NEWS.txt Modified: python/branches/py3k/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/py3k/Lib/idlelib/IOBinding.py (original) +++ python/branches/py3k/Lib/idlelib/IOBinding.py Sun Jan 18 21:23:36 2009 @@ -7,7 +7,7 @@ import tkinter.messagebox as tkMessageBox import re from tkinter import * -from tkinter.simpledialog import SimpleDialog +from tkinter.simpledialog import askstring from idlelib.configHandler import idleConf @@ -211,7 +211,7 @@ except IOError as msg: tkMessageBox.showerror("I/O Error", str(msg), master=self.text) return False - chars = self._decode(two_lines, bytes) + chars, converted = self._decode(two_lines, bytes) if chars is None: tkMessageBox.showerror("Decoding Error", "File %s\nFailed to Decode" % filename, @@ -227,6 +227,10 @@ self.text.insert("1.0", chars) self.reset_undo() self.set_filename(filename) + if converted: + # We need to save the conversion results first + # before being able to execute the code + self.set_saved(False) self.text.mark_set("insert", "1.0") self.text.see("insert") self.updaterecentfileslist(filename) @@ -241,11 +245,11 @@ chars = bytes[3:].decode("utf-8") except UnicodeDecodeError: # has UTF-8 signature, but fails to decode... - return None + return None, False else: # Indicates that this file originally had a BOM self.fileencoding = 'BOM' - return chars + return chars, False # Next look for coding specification try: enc = coding_spec(two_lines) @@ -257,36 +261,48 @@ master = self.text) enc = None except UnicodeDecodeError: - return None + return None, False if enc: try: chars = str(bytes, enc) self.fileencoding = enc - return chars + return chars, False except UnicodeDecodeError: pass # Try ascii: try: chars = str(bytes, 'ascii') self.fileencoding = None - return chars + return chars, False except UnicodeDecodeError: pass # Try utf-8: try: chars = str(bytes, 'utf-8') self.fileencoding = 'utf-8' - return chars + return chars, False except UnicodeDecodeError: pass # Finally, try the locale's encoding. This is deprecated; # the user should declare a non-ASCII encoding try: - chars = str(bytes, locale_encoding) - self.fileencoding = locale_encoding - except UnicodeDecodeError: + # Wait for the editor window to appear + self.editwin.text.update() + enc = askstring( + "Specify file encoding", + "The file's encoding is invalid for Python 3.x.\n" + "IDLE will convert it to UTF-8.\n" + "What is the current encoding of the file?", + initialvalue = locale_encoding, + parent = self.editwin.text) + + if enc: + chars = str(bytes, enc) + self.fileencoding = None + return chars, True + except (UnicodeDecodeError, LookupError): pass - return chars # None on failure + return None, False # None on failure def maybesave(self): if self.get_saved(): Modified: python/branches/py3k/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k/Lib/idlelib/NEWS.txt Sun Jan 18 21:23:36 2009 @@ -3,6 +3,9 @@ *Release date: XX-XXX-XXXX* +- Issue #4815: Offer conversion to UTF-8 if source files have + no encoding declaration and are not encoded in UTF-8. + - Issue #4008: Fix problems with non-ASCII source files. - Issue #4323: Always encode source as UTF-8 without asking From python-checkins at python.org Sun Jan 18 21:25:57 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 18 Jan 2009 21:25:57 +0100 (CET) Subject: [Python-checkins] r68733 - in python/branches/release30-maint: Lib/idlelib/IOBinding.py Lib/idlelib/NEWS.txt Message-ID: <20090118202557.80B391E4002@bag.python.org> Author: martin.v.loewis Date: Sun Jan 18 21:25:57 2009 New Revision: 68733 Log: Merged revisions 68732 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68732 | martin.v.loewis | 2009-01-18 21:23:36 +0100 (So, 18 Jan 2009) | 3 lines Issue #4815: Offer conversion to UTF-8 if source files have no encoding declaration and are not encoded in UTF-8. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/idlelib/IOBinding.py python/branches/release30-maint/Lib/idlelib/NEWS.txt Modified: python/branches/release30-maint/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/IOBinding.py (original) +++ python/branches/release30-maint/Lib/idlelib/IOBinding.py Sun Jan 18 21:25:57 2009 @@ -7,7 +7,7 @@ import tkinter.messagebox as tkMessageBox import re from tkinter import * -from tkinter.simpledialog import SimpleDialog +from tkinter.simpledialog import askstring from idlelib.configHandler import idleConf @@ -211,7 +211,7 @@ except IOError as msg: tkMessageBox.showerror("I/O Error", str(msg), master=self.text) return False - chars = self._decode(two_lines, bytes) + chars, converted = self._decode(two_lines, bytes) if chars is None: tkMessageBox.showerror("Decoding Error", "File %s\nFailed to Decode" % filename, @@ -227,6 +227,10 @@ self.text.insert("1.0", chars) self.reset_undo() self.set_filename(filename) + if converted: + # We need to save the conversion results first + # before being able to execute the code + self.set_saved(False) self.text.mark_set("insert", "1.0") self.text.see("insert") self.updaterecentfileslist(filename) @@ -241,11 +245,11 @@ chars = bytes[3:].decode("utf-8") except UnicodeDecodeError: # has UTF-8 signature, but fails to decode... - return None + return None, False else: # Indicates that this file originally had a BOM self.fileencoding = 'BOM' - return chars + return chars, False # Next look for coding specification try: enc = coding_spec(two_lines) @@ -257,36 +261,48 @@ master = self.text) enc = None except UnicodeDecodeError: - return None + return None, False if enc: try: chars = str(bytes, enc) self.fileencoding = enc - return chars + return chars, False except UnicodeDecodeError: pass # Try ascii: try: chars = str(bytes, 'ascii') self.fileencoding = None - return chars + return chars, False except UnicodeDecodeError: pass # Try utf-8: try: chars = str(bytes, 'utf-8') self.fileencoding = 'utf-8' - return chars + return chars, False except UnicodeDecodeError: pass # Finally, try the locale's encoding. This is deprecated; # the user should declare a non-ASCII encoding try: - chars = str(bytes, locale_encoding) - self.fileencoding = locale_encoding - except UnicodeDecodeError: + # Wait for the editor window to appear + self.editwin.text.update() + enc = askstring( + "Specify file encoding", + "The file's encoding is invalid for Python 3.x.\n" + "IDLE will convert it to UTF-8.\n" + "What is the current encoding of the file?", + initialvalue = locale_encoding, + parent = self.editwin.text) + + if enc: + chars = str(bytes, enc) + self.fileencoding = None + return chars, True + except (UnicodeDecodeError, LookupError): pass - return chars # None on failure + return None, False # None on failure def maybesave(self): if self.get_saved(): Modified: python/branches/release30-maint/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/release30-maint/Lib/idlelib/NEWS.txt (original) +++ python/branches/release30-maint/Lib/idlelib/NEWS.txt Sun Jan 18 21:25:57 2009 @@ -3,6 +3,9 @@ *Release date: XX-XXX-XXXX* +- Issue #4815: Offer conversion to UTF-8 if source files have + no encoding declaration and are not encoded in UTF-8. + - Issue #4008: Fix problems with non-ASCII source files. - Issue #4323: Always encode source as UTF-8 without asking From python-checkins at python.org Sun Jan 18 21:27:45 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sun, 18 Jan 2009 21:27:45 +0100 (CET) Subject: [Python-checkins] r68734 - in python/branches/release26-maint: Lib/zipfile.py Message-ID: <20090118202745.2FE5C1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sun Jan 18 21:27:45 2009 New Revision: 68734 Log: Merged revisions 68678 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68678 | amaury.forgeotdarc | 2009-01-17 23:43:50 +0100 (Sat, 17 Jan 2009) | 3 lines follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format, always try to read the "zip64 end of directory structure". ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/zipfile.py Modified: python/branches/release26-maint/Lib/zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/zipfile.py (original) +++ python/branches/release26-maint/Lib/zipfile.py Sun Jan 18 21:27:45 2009 @@ -196,13 +196,9 @@ # Append a blank comment and record start offset endrec.append("") endrec.append(filesize - sizeEndCentDir) - if endrec[_ECD_OFFSET] == 0xffffffff: - # the value for the "offset of the start of the central directory" - # indicates that there is a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, -sizeEndCentDir, endrec) - return endrec + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, -sizeEndCentDir, endrec) # Either this is not a ZIP file, or it is a ZIP file with an archive # comment. Search the end of the file for the "end of central directory" @@ -223,11 +219,10 @@ # Append the archive comment and start offset endrec.append(comment) endrec.append(maxCommentStart + start) - if endrec[_ECD_OFFSET] == 0xffffffff: - # There is apparently a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, start - filesize, endrec) - return endrec + + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, maxCommentStart + start - filesize, + endrec) # Unable to find a valid end of central directory structure return From python-checkins at python.org Sun Jan 18 21:34:58 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Sun, 18 Jan 2009 21:34:58 +0100 (CET) Subject: [Python-checkins] r68735 - in python/branches/release30-maint: Lib/zipfile.py Message-ID: <20090118203458.9AC381E4002@bag.python.org> Author: amaury.forgeotdarc Date: Sun Jan 18 21:34:58 2009 New Revision: 68735 Log: Merged revisions 68700 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68700 | amaury.forgeotdarc | 2009-01-18 01:29:02 +0100 (Sun, 18 Jan 2009) | 10 lines Merged revisions 68678 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68678 | amaury.forgeotdarc | 2009-01-17 23:43:50 +0100 (Sat, 17 Jan 2009) | 3 lines follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format, always try to read the "zip64 end of directory structure". ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/zipfile.py Modified: python/branches/release30-maint/Lib/zipfile.py ============================================================================== --- python/branches/release30-maint/Lib/zipfile.py (original) +++ python/branches/release30-maint/Lib/zipfile.py Sun Jan 18 21:34:58 2009 @@ -198,13 +198,9 @@ # Append a blank comment and record start offset endrec.append(b"") endrec.append(filesize - sizeEndCentDir) - if endrec[_ECD_OFFSET] == 0xffffffff: - # the value for the "offset of the start of the central directory" - # indicates that there is a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, -sizeEndCentDir, endrec) - return endrec + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, -sizeEndCentDir, endrec) # Either this is not a ZIP file, or it is a ZIP file with an archive # comment. Search the end of the file for the "end of central directory" @@ -225,11 +221,10 @@ # Append the archive comment and start offset endrec.append(comment) endrec.append(maxCommentStart + start) - if endrec[_ECD_OFFSET] == 0xffffffff: - # There is apparently a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, start - filesize, endrec) - return endrec + + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, maxCommentStart + start - filesize, + endrec) # Unable to find a valid end of central directory structure return From python-checkins at python.org Sun Jan 18 22:02:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 22:02:38 +0100 (CET) Subject: [Python-checkins] r68736 - in python/branches/py3k: Lib/smtplib.py Lib/test/test_capi.py Lib/test/test_datetime.py Lib/test/test_os.py Lib/test/test_xmlrpc.py Message-ID: <20090118210238.33EB01E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 22:02:37 2009 New Revision: 68736 Log: Merged revisions 68547,68607,68610,68618,68621-68622,68649,68722 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68547 | kristjan.jonsson | 2009-01-12 12:09:27 -0600 (Mon, 12 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ........ r68607 | kristjan.jonsson | 2009-01-14 04:50:57 -0600 (Wed, 14 Jan 2009) | 2 lines Re-enable all tests for windows platforms. Also, explicitly connect to the IPV4 address. On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect. It would try connecting using AF_INET6 first and this would cause a delay of up to a second. ........ r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. ........ r68618 | kristjan.jonsson | 2009-01-15 11:20:21 -0600 (Thu, 15 Jan 2009) | 1 line Issue 4929: Handle socket errors when receiving ........ r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. ........ r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line Make all the invalid fd tests for os subject to the function being available. ........ r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line trying to find some fpathconf() settings that all unixs support... ........ r68722 | kristjan.jonsson | 2009-01-18 04:58:44 -0600 (Sun, 18 Jan 2009) | 1 line issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/smtplib.py python/branches/py3k/Lib/test/test_capi.py python/branches/py3k/Lib/test/test_datetime.py python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Lib/test/test_xmlrpc.py Modified: python/branches/py3k/Lib/smtplib.py ============================================================================== --- python/branches/py3k/Lib/smtplib.py (original) +++ python/branches/py3k/Lib/smtplib.py Sun Jan 18 22:02:37 2009 @@ -336,7 +336,10 @@ if self.file is None: self.file = self.sock.makefile('rb') while 1: - line = self.file.readline() + try: + line = self.file.readline() + except socket.error: + line = '' if not line: self.close() raise SMTPServerDisconnected("Connection unexpectedly closed") Modified: python/branches/py3k/Lib/test/test_capi.py ============================================================================== --- python/branches/py3k/Lib/test/test_capi.py (original) +++ python/branches/py3k/Lib/test/test_capi.py Sun Jan 18 22:02:37 2009 @@ -1,6 +1,7 @@ # Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. +from __future__ import with_statement import sys import time import random @@ -49,39 +50,61 @@ if _testcapi._pending_threadfunc(callback): break; - def pendingcalls_wait(self, l, n): + def pendingcalls_wait(self, l, n, context = None): #now, stick around until l[0] has grown to 10 count = 0; while len(l) != n: #this busy loop is where we expect to be interrupted to #run our callbacks. Note that callbacks are only run on the #main thread - if False and test_support.verbose: + if False and support.verbose: print("(%i)"%(len(l),),) for i in range(1000): a = i*i + if context and not context.event.is_set(): + continue count += 1 self.failUnless(count < 10000, "timeout waiting for %i callbacks, got %i"%(n, len(l))) - if False and test_support.verbose: + if False and support.verbose: print("(%i)"%(len(l),)) def test_pendingcalls_threaded(self): - l = [] #do every callback on a separate thread - n = 32 + n = 32 #total callbacks threads = [] - for i in range(n): - t = threading.Thread(target=self.pendingcalls_submit, args = (l, 1)) + class foo(object):pass + context = foo() + context.l = [] + context.n = 2 #submits per thread + context.nThreads = n // context.n + context.nFinished = 0 + context.lock = threading.Lock() + context.event = threading.Event() + + for i in range(context.nThreads): + t = threading.Thread(target=self.pendingcalls_thread, args = (context,)) t.start() threads.append(t) - self.pendingcalls_wait(l, n) + self.pendingcalls_wait(context.l, n, context) for t in threads: t.join() + def pendingcalls_thread(self, context): + try: + self.pendingcalls_submit(context.l, context.n) + finally: + with context.lock: + context.nFinished += 1 + nFinished = context.nFinished + if False and support.verbose: + print("finished threads: ", nFinished) + if nFinished == context.nThreads: + context.event.set() + def test_pendingcalls_non_threaded(self): #again, just using the main thread, likely they will all be dispathced at #once. It is ok to ask for too many, because we loop until we find a slot. Modified: python/branches/py3k/Lib/test/test_datetime.py ============================================================================== --- python/branches/py3k/Lib/test/test_datetime.py (original) +++ python/branches/py3k/Lib/test/test_datetime.py Sun Jan 18 22:02:37 2009 @@ -851,6 +851,23 @@ # A naive object replaces %z and %Z w/ empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + #make sure that invalid format specifiers are handled correctly + #self.assertRaises(ValueError, t.strftime, "%e") + #self.assertRaises(ValueError, t.strftime, "%") + #self.assertRaises(ValueError, t.strftime, "%#") + + #oh well, some systems just ignore those invalid ones. + #at least, excercise them to make sure that no crashes + #are generated + for f in ["%e", "%", "%#"]: + try: + t.strftime(f) + except ValueError: + pass + + #check that this standard extension works + t.strftime("%f") + def test_format(self): dt = self.theclass(2007, 9, 10) Modified: python/branches/py3k/Lib/test/test_os.py ============================================================================== --- python/branches/py3k/Lib/test/test_os.py (original) +++ python/branches/py3k/Lib/test/test_os.py Sun Jan 18 22:02:37 2009 @@ -587,6 +587,64 @@ def test_chmod(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) +class TestInvalidFD(unittest.TestCase): + singles = ["fchdir", "dup", "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 getattr(os, f, None): + self.assertRaises(OSError, getattr(os, f), 10) + return helper + for f in singles: + locals()["test_"+f] = get_single(f) + + def test_isatty(self): + if hasattr(os, "isatty"): + self.assertEqual(os.isatty(10), False) + + def test_closerange(self): + if hasattr(os, "closerange"): + self.assertEqual(os.closerange(10, 20), None) + + def test_dup2(self): + if hasattr(os, "dup2"): + self.assertRaises(OSError, os.dup2, 10, 20) + + def test_fchmod(self): + if hasattr(os, "fchmod"): + self.assertRaises(OSError, os.fchmod, 10, 0) + + def test_fchown(self): + if hasattr(os, "fchown"): + self.assertRaises(OSError, os.fchown, 10, -1, -1) + + def test_fpathconf(self): + if hasattr(os, "fpathconf"): + self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + + #this is a weird one, it raises IOError unlike the others + def test_ftruncate(self): + if hasattr(os, "ftruncate"): + self.assertRaises(IOError, os.ftruncate, 10, 0) + + def test_lseek(self): + if hasattr(os, "lseek"): + self.assertRaises(OSError, os.lseek, 10, 0, 0) + + def test_read(self): + if hasattr(os, "read"): + self.assertRaises(OSError, os.read, 10, 1) + + def test_tcsetpgrpt(self): + if hasattr(os, "tcsetpgrp"): + self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + + def test_write(self): + if hasattr(os, "write"): + self.assertRaises(OSError, os.write, 10, b" ") + if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): pass @@ -601,7 +659,8 @@ DevNullTests, URandomTests, ExecTests, - Win32ErrorTests + Win32ErrorTests, + TestInvalidFD ) if __name__ == "__main__": 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 Sun Jan 18 22:02:37 2009 @@ -232,7 +232,7 @@ self.assertEqual(str(t2), str(d, "latin-1")) -PORT = None +ADDR = PORT = URL = None # The evt is set twice. First when the server is ready to serve. # Second when the server has been shutdown. The user must clear @@ -258,12 +258,17 @@ s.setblocking(True) return s, port + serv = MyXMLRPCServer(("localhost", 0), + logRequests=False, bind_and_activate=False) try: - serv = MyXMLRPCServer(("localhost", 0), - logRequests=False, bind_and_activate=False) serv.server_bind() - global PORT - PORT = serv.socket.getsockname()[1] + global ADDR, PORT, URL + ADDR, PORT = serv.socket.getsockname() + #connect to IP address directly. This avoids socket.create_connection() + #trying to connect to to "localhost" using all address families, which + #causes slowdown e.g. on vista which supports AF_INET6. The server listens + #on AF_INET only. + URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() serv.register_introspection_functions() serv.register_multicall_functions() @@ -331,7 +336,7 @@ def test_simple1(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -343,7 +348,7 @@ def XXXtest_404(self): # send POST with http.client, it should return 404 header and # 'Not Found' message. - conn = http.client.HTTPConnection('localhost', PORT) + conn = httplib.client.HTTPConnection(ADDR, PORT) conn.request('POST', '/this-is-not-valid') response = conn.getresponse() conn.close() @@ -356,7 +361,7 @@ 'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall']) try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) meth = p.system.listMethods() self.assertEqual(set(meth), expected_methods) except (xmlrpclib.ProtocolError, socket.error) as e: @@ -369,7 +374,7 @@ def test_introspection2(self): try: # test _methodHelp() - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divhelp = p.system.methodHelp('div') self.assertEqual(divhelp, 'This is the div function') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -381,7 +386,7 @@ def test_introspection3(self): try: # test native doc - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) myfunction = p.system.methodHelp('my_function') self.assertEqual(myfunction, 'This is my function') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -394,7 +399,7 @@ # the SimpleXMLRPCServer doesn't support signatures, but # at least check that we can try making the call try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -405,7 +410,7 @@ def test_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) @@ -422,7 +427,7 @@ def test_non_existing_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.this_is_not_exists() result = multicall() @@ -491,7 +496,7 @@ # test a call that shouldn't fail just as a smoke test try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -504,7 +509,7 @@ xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -524,7 +529,7 @@ xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = True try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -605,15 +610,9 @@ def test_main(): xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase, BinaryTestCase, FaultTestCase] - - # The test cases against a SimpleXMLRPCServer raise a socket error - # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when - # run on Windows. This only happens on the first test to run, but it - # fails every time and so these tests are skipped on win32 platforms. - if sys.platform != 'win32': - xmlrpc_tests.append(SimpleServerTestCase) - xmlrpc_tests.append(FailingServerTestCase) - xmlrpc_tests.append(CGIHandlerTestCase) + xmlrpc_tests.append(SimpleServerTestCase) + xmlrpc_tests.append(FailingServerTestCase) + xmlrpc_tests.append(CGIHandlerTestCase) support.run_unittest(*xmlrpc_tests) From python-checkins at python.org Sun Jan 18 22:04:36 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 18 Jan 2009 22:04:36 +0100 (CET) Subject: [Python-checkins] r68737 - in python/trunk: Lib/logging/__init__.py Lib/multiprocessing/util.py Misc/NEWS Message-ID: <20090118210436.C7F631E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 18 22:04:36 2009 New Revision: 68737 Log: issue 4301: patch logging to add processName, remove the old _check_logger_class code Modified: python/trunk/Lib/logging/__init__.py python/trunk/Lib/multiprocessing/util.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 Jan 18 22:04:36 2009 @@ -100,6 +100,11 @@ logThreads = 1 # +# If you don't want multiprocessing information in the log, set this to zero +# +logMultiprocessing = 1 + +# # If you don't want process information in the log, set this to zero # logProcesses = 1 @@ -266,6 +271,11 @@ else: self.thread = None self.threadName = None + if logMultiprocessing: + from multiprocessing import current_process + self.processName = current_process().name + else: + self.processName = None if logProcesses and hasattr(os, 'getpid'): self.process = os.getpid() else: Modified: python/trunk/Lib/multiprocessing/util.py ============================================================================== --- python/trunk/Lib/multiprocessing/util.py (original) +++ python/trunk/Lib/multiprocessing/util.py Sun Jan 18 22:04:36 2009 @@ -69,34 +69,10 @@ atexit._exithandlers.remove((_exit_function, (), {})) atexit._exithandlers.append((_exit_function, (), {})) - _check_logger_class() _logger = logging.getLogger(LOGGER_NAME) return _logger -def _check_logger_class(): - ''' - Make sure process name is recorded when loggers are used - ''' - # XXX This function is unnecessary once logging is patched - import logging - if hasattr(logging, 'multiprocessing'): - return - - logging._acquireLock() - try: - OldLoggerClass = logging.getLoggerClass() - if not getattr(OldLoggerClass, '_process_aware', False): - class ProcessAwareLogger(OldLoggerClass): - _process_aware = True - def makeRecord(self, *args, **kwds): - record = OldLoggerClass.makeRecord(self, *args, **kwds) - record.processName = current_process()._name - return record - logging.setLoggerClass(ProcessAwareLogger) - finally: - logging._releaseLock() - def log_to_stderr(level=None): ''' Turn on logging and add a handler which prints to stderr Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 18 22:04:36 2009 @@ -596,6 +596,9 @@ Extension Modules ----------------- +- Issue #4301: Patch the logging module to add processName support, remove + _check_logger_class from multiprocessing. + - Issue #2975: When compiling several extension modules with Visual Studio 2008 from the same python interpreter, some environment variables would grow without limit. From python-checkins at python.org Sun Jan 18 22:07:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 22:07:47 +0100 (CET) Subject: [Python-checkins] r68738 - python/branches/release30-maint Message-ID: <20090118210747.6FC2E1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 22:07:47 2009 New Revision: 68738 Log: Blocked revisions 68736 via svnmerge ................ r68736 | benjamin.peterson | 2009-01-18 15:02:37 -0600 (Sun, 18 Jan 2009) | 40 lines Merged revisions 68547,68607,68610,68618,68621-68622,68649,68722 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68547 | kristjan.jonsson | 2009-01-12 12:09:27 -0600 (Mon, 12 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ........ r68607 | kristjan.jonsson | 2009-01-14 04:50:57 -0600 (Wed, 14 Jan 2009) | 2 lines Re-enable all tests for windows platforms. Also, explicitly connect to the IPV4 address. On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect. It would try connecting using AF_INET6 first and this would cause a delay of up to a second. ........ r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. ........ r68618 | kristjan.jonsson | 2009-01-15 11:20:21 -0600 (Thu, 15 Jan 2009) | 1 line Issue 4929: Handle socket errors when receiving ........ r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. ........ r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line Make all the invalid fd tests for os subject to the function being available. ........ r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line trying to find some fpathconf() settings that all unixs support... ........ r68722 | kristjan.jonsson | 2009-01-18 04:58:44 -0600 (Sun, 18 Jan 2009) | 1 line issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Jan 18 22:11:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 22:11:38 +0100 (CET) Subject: [Python-checkins] r68739 - python/trunk/Lib/test/test_codeccallbacks.py Message-ID: <20090118211138.6B23B1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 22:11:38 2009 New Revision: 68739 Log: fix test that wasn't working as expected #4990 Modified: python/trunk/Lib/test/test_codeccallbacks.py Modified: python/trunk/Lib/test/test_codeccallbacks.py ============================================================================== --- python/trunk/Lib/test/test_codeccallbacks.py (original) +++ python/trunk/Lib/test/test_codeccallbacks.py Sun Jan 18 22:11:38 2009 @@ -579,7 +579,7 @@ encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15") for res in results: - codecs.register_error("test.badhandler", lambda: res) + codecs.register_error("test.badhandler", lambda x: res) for enc in encs: self.assertRaises( TypeError, From python-checkins at python.org Sun Jan 18 22:12:59 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 18 Jan 2009 22:12:59 +0100 (CET) Subject: [Python-checkins] r68740 - in python/branches/py3k: Lib/logging/__init__.py Lib/multiprocessing/util.py Misc/NEWS Message-ID: <20090118211259.0B41F1E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 18 22:12:58 2009 New Revision: 68740 Log: merge cl r68737 to py3k Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/logging/__init__.py python/branches/py3k/Lib/multiprocessing/util.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 Sun Jan 18 22:12:58 2009 @@ -99,6 +99,11 @@ logThreads = 1 # +# If you don't want multiprocessing information in the log, set this to zero +# +logMultiprocessing = 1 + +# # If you don't want process information in the log, set this to zero # logProcesses = 1 @@ -263,6 +268,11 @@ else: self.thread = None self.threadName = None + if logMultiprocessing: + from multiprocessing import current_process + self.processName = current_process().name + else: + self.processName = None if logProcesses and hasattr(os, 'getpid'): self.process = os.getpid() else: Modified: python/branches/py3k/Lib/multiprocessing/util.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/util.py (original) +++ python/branches/py3k/Lib/multiprocessing/util.py Sun Jan 18 22:12:58 2009 @@ -69,34 +69,10 @@ atexit._exithandlers.remove((_exit_function, (), {})) atexit._exithandlers.append((_exit_function, (), {})) - _check_logger_class() _logger = logging.getLogger(LOGGER_NAME) return _logger -def _check_logger_class(): - ''' - Make sure process name is recorded when loggers are used - ''' - # XXX This function is unnecessary once logging is patched - import logging - if hasattr(logging, 'multiprocessing'): - return - - logging._acquireLock() - try: - OldLoggerClass = logging.getLoggerClass() - if not getattr(OldLoggerClass, '_process_aware', False): - class ProcessAwareLogger(OldLoggerClass): - _process_aware = True - def makeRecord(self, *args, **kwds): - record = OldLoggerClass.makeRecord(self, *args, **kwds) - record.processName = current_process()._name - return record - logging.setLoggerClass(ProcessAwareLogger) - finally: - logging._releaseLock() - def log_to_stderr(level=None): ''' Turn on logging and add a handler which prints to stderr Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 18 22:12:58 2009 @@ -132,6 +132,9 @@ Library ------- +- Issue #4301: Patch the logging module to add processName support, remove + _check_logger_class from multiprocessing. + - Issue #3325: Remove python2.x try: except: imports for old cPickle from multiprocessing. From python-checkins at python.org Sun Jan 18 22:20:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 22:20:30 +0100 (CET) Subject: [Python-checkins] r68741 - python/branches/io-c/Modules/_textio.c Message-ID: <20090118212030.EFB061E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 22:20:30 2009 New Revision: 68741 Log: Check return type in TextIOWrapper.__next__ 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 Jan 18 22:20:30 2009 @@ -2031,14 +2031,18 @@ else { line = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_readline, NULL); - /* TODO: check return type */ + 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; - assert (PyUnicode_Check(line)); - if (PyUnicode_GET_SIZE(line) == 0) { /* Reached EOF or would have blocked */ Py_DECREF(line); From python-checkins at python.org Sun Jan 18 22:28:48 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 22:28:48 +0100 (CET) Subject: [Python-checkins] r68742 - python/branches/io-c/Modules/_bufferedio.c Message-ID: <20090118212848.E4ED91E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 22:28:48 2009 New Revision: 68742 Log: Make binary buffered readline and iteration much faster (8x as fast as the IOBase generic implementation) 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 Jan 18 22:28:48 2009 @@ -721,6 +721,132 @@ } static PyObject * +_Buffered_readline(BufferedObject *self, Py_ssize_t limit) +{ + PyObject *res = NULL; + PyObject *chunks = NULL; + Py_ssize_t n, written = 0; + const char *start, *s, *end; + + if (BufferedIOMixin_closed(self)) { + PyErr_SetString(PyExc_ValueError, "readline of closed file"); + return NULL; + } + + ENTER_BUFFERED(self) + + /* First, try to find a line in the buffer */ + n = READAHEAD(self); + if (limit >= 0 && n > limit) + n = limit; + start = self->buffer + self->pos; + end = start + n; + s = start; + while (s < end) { + if (*s++ == '\n') { + res = PyBytes_FromStringAndSize(start, s - start); + if (res != NULL) + self->pos += s - start; + goto end; + } + } + if (n == limit) { + res = PyBytes_FromStringAndSize(start, n); + if (res != NULL) + self->pos += n; + goto end; + } + + /* Now we try to get some more from the raw stream */ + if (self->writable) { + res = _BufferedWriter_flush_unlocked(self, 1); + if (res == NULL) + goto end; + Py_CLEAR(res); + } + chunks = PyList_New(0); + if (chunks == NULL) + goto end; + if (n > 0) { + res = PyBytes_FromStringAndSize(start, n); + if (res == NULL) + goto end; + if (PyList_Append(chunks, res) < 0) { + Py_CLEAR(res); + goto end; + } + Py_CLEAR(res); + written += n; + if (limit >= 0) + limit -= n; + } + + for (;;) { + _BufferedReader_reset_buf(self); + n = _BufferedReader_fill_buffer(self); + if (n == -1) + goto end; + if (n <= 0) + break; + if (limit >= 0 && n > limit) + n = limit; + start = self->buffer; + end = start + n; + s = start; + while (s < end) { + if (*s++ == '\n') { + res = PyBytes_FromStringAndSize(start, s - start); + if (res == NULL) + goto end; + self->pos = s - start; + goto found; + } + } + res = PyBytes_FromStringAndSize(start, n); + if (res == NULL) + goto end; + if (n == limit) { + self->pos = n; + break; + } + if (PyList_Append(chunks, res) < 0) { + Py_CLEAR(res); + goto end; + } + Py_CLEAR(res); + written += n; + if (limit >= 0) + limit -= n; + } +found: + if (res != NULL && PyList_Append(chunks, res) < 0) { + Py_CLEAR(res); + goto end; + } + Py_CLEAR(res); + res = _PyBytes_Join(PyBytes_FromStringAndSize(NULL, 0), chunks); + +end: + LEAVE_BUFFERED(self) + Py_XDECREF(chunks); + return res; +} + +static PyObject * +Buffered_readline(BufferedObject *self, PyObject *args) +{ + Py_ssize_t limit = -1; + + CHECK_INITIALIZED(self) + + if (!PyArg_ParseTuple(args, "|n:readline", &limit)) { + return NULL; + } + return _Buffered_readline(self, limit); +} + + +static PyObject * Buffered_tell(BufferedObject *self, PyObject *args) { Py_off_t pos; @@ -846,6 +972,43 @@ return res; } +static PyObject * +Buffered_iternext(BufferedObject *self) +{ + PyObject *line; + PyTypeObject *tp; + + CHECK_INITIALIZED(self); + + tp = Py_TYPE(self); + if (tp == &PyBufferedReader_Type || + tp == &PyBufferedRandom_Type) { + /* Skip method call overhead for speed */ + line = _Buffered_readline(self, -1); + } + else { + line = PyObject_CallMethodObjArgs((PyObject *)self, + _PyIO_str_readline, NULL); + if (line && !PyBytes_Check(line)) { + PyErr_Format(PyExc_IOError, + "readline() should have returned a bytes object, " + "not '%.200s'", Py_TYPE(line)->tp_name); + Py_DECREF(line); + return NULL; + } + } + + if (line == NULL) + return NULL; + + if (PyBytes_GET_SIZE(line) == 0) { + /* Reached EOF or would have blocked */ + Py_DECREF(line); + return NULL; + } + + return line; +} /* * class BufferedReader @@ -1157,6 +1320,7 @@ {"read", (PyCFunction)Buffered_read, METH_VARARGS}, {"peek", (PyCFunction)Buffered_peek, METH_VARARGS}, {"read1", (PyCFunction)Buffered_read1, METH_VARARGS}, + {"readline", (PyCFunction)Buffered_readline, METH_VARARGS}, {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, {NULL, NULL} @@ -1202,7 +1366,7 @@ 0, /* tp_richcompare */ offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ - 0, /* tp_iternext */ + (iternextfunc)Buffered_iternext, /* tp_iternext */ BufferedReader_methods, /* tp_methods */ BufferedReader_members, /* tp_members */ BufferedReader_getset, /* tp_getset */ @@ -1844,6 +2008,7 @@ {"read", (PyCFunction)Buffered_read, METH_VARARGS}, {"read1", (PyCFunction)Buffered_read1, METH_VARARGS}, {"readinto", (PyCFunction)Buffered_readinto, METH_VARARGS}, + {"readline", (PyCFunction)Buffered_readline, METH_VARARGS}, {"peek", (PyCFunction)Buffered_peek, METH_VARARGS}, {"write", (PyCFunction)BufferedWriter_write, METH_VARARGS}, {NULL, NULL} @@ -1889,7 +2054,7 @@ 0, /* tp_richcompare */ offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ - 0, /* tp_iternext */ + (iternextfunc)Buffered_iternext, /* tp_iternext */ BufferedRandom_methods, /* tp_methods */ BufferedRandom_members, /* tp_members */ BufferedRandom_getset, /* tp_getset */ From python-checkins at python.org Sun Jan 18 22:47:48 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 22:47:48 +0100 (CET) Subject: [Python-checkins] r68743 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090118214748.177441E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 22:47:47 2009 New Revision: 68743 Log: Reinsert test_io_after_close (was removed by mistake) 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 Jan 18 22:47:47 2009 @@ -1746,7 +1746,6 @@ else: self.assert_(issubclass(obj, io.IOBase)) - def test_attributes(self): f = io.open(support.TESTFN, "wb", buffering=0) self.assertEquals(f.mode, "wb") @@ -1774,6 +1773,45 @@ f.close() g.close() + def test_io_after_close(self): + for kwargs in [ + {"mode": "w"}, + {"mode": "wb"}, + {"mode": "w", "buffering": 1}, + {"mode": "w", "buffering": 2}, + {"mode": "wb", "buffering": 0}, + {"mode": "r"}, + {"mode": "rb"}, + {"mode": "r", "buffering": 1}, + {"mode": "r", "buffering": 2}, + {"mode": "rb", "buffering": 0}, + {"mode": "w+"}, + {"mode": "w+b"}, + {"mode": "w+", "buffering": 1}, + {"mode": "w+", "buffering": 2}, + {"mode": "w+b", "buffering": 0}, + ]: + f = io.open(support.TESTFN, **kwargs) + f.close() + self.assertRaises(ValueError, f.flush) + self.assertRaises(ValueError, f.fileno) + self.assertRaises(ValueError, f.isatty) + self.assertRaises(ValueError, f.__iter__) + if hasattr(f, "peek"): + self.assertRaises(ValueError, f.peek, 1) + self.assertRaises(ValueError, f.read) + if hasattr(f, "read1"): + self.assertRaises(ValueError, f.read1, 1024) + if hasattr(f, "readinto"): + self.assertRaises(ValueError, f.readinto, bytearray(1024)) + self.assertRaises(ValueError, f.readline) + self.assertRaises(ValueError, f.readlines) + self.assertRaises(ValueError, f.seek, 0) + self.assertRaises(ValueError, f.tell) + self.assertRaises(ValueError, f.truncate) + self.assertRaises(ValueError, f.write, "") + self.assertRaises(ValueError, f.writelines, []) + def test_main(): support.run_unittest( From python-checkins at python.org Sun Jan 18 23:11:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 23:11:59 +0100 (CET) Subject: [Python-checkins] r68744 - in python/branches/py3k: Doc/c-api/init.rst Objects/typeobject.c Message-ID: <20090118221159.20C5B1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 23:10:38 2009 New Revision: 68744 Log: Merged revisions 68568,68665 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68568 | georg.brandl | 2009-01-13 02:11:07 -0600 (Tue, 13 Jan 2009) | 2 lines Fix call signature and markup. ........ r68665 | amaury.forgeotdarc | 2009-01-17 11:11:50 -0600 (Sat, 17 Jan 2009) | 3 lines #4930: Slightly cleaner (and faster) code in type creation: compare slots by address, not by name. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Objects/typeobject.c 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 Sun Jan 18 23:10:38 2009 @@ -782,13 +782,13 @@ convenience by the main thread where it has possession of the global interpreter lock and can perform any Python API calls. -.. cfunction:: void Py_AddPendingCall( int (*func)(void *), void *arg) ) +.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) ) .. index:: single: Py_AddPendingCall() Post a notification to the Python main thread. If successful, - \*:attr`func` will be called with the argument :attr:`arg` at the earliest - convenience. \*:attr:`func` will be called having the global interpreter + *func* will be called with the argument *arg* at the earliest + convenience. *func* will be called having the global interpreter lock held and can thus use the full Python API and can take any action such as setting object attributes to signal IO completion. It must return 0 on success, or -1 signalling an exception. Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sun Jan 18 23:10:38 2009 @@ -5650,7 +5650,7 @@ else if (Py_TYPE(descr) == &PyCFunction_Type && PyCFunction_GET_FUNCTION(descr) == (PyCFunction)tp_new_wrapper && - strcmp(p->name, "__new__") == 0) + ptr == (void**)&type->tp_new) { /* The __new__ wrapper is not a wrapper descriptor, so must be special-cased differently. @@ -5670,7 +5670,7 @@ point out a bug in this reasoning a beer. */ } else if (descr == Py_None && - strcmp(p->name, "__hash__") == 0) { + ptr == (void**)&type->tp_hash) { /* We specifically allow __hash__ to be set to None to prevent inheritance of the default implementation from object.__hash__ */ From python-checkins at python.org Sun Jan 18 23:16:37 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 23:16:37 +0100 (CET) Subject: [Python-checkins] r68745 - python/branches/io-c/Modules/_bufferedio.c Message-ID: <20090118221637.4887F1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 23:16:06 2009 New Revision: 68745 Log: Add read, read1 and write methods to BufferedIOBase 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 Jan 18 23:16:06 2009 @@ -57,8 +57,71 @@ return NULL; } +static PyObject * +BufferedIOBase_unsupported(const char *message) +{ + PyErr_SetString(PyIOExc_UnsupportedOperation, message); + return NULL; +} + +PyDoc_STRVAR(BufferedIOBase_read_doc, + "Read and return up to n bytes.\n" + "\n" + "If the argument is omitted, None, or negative, reads and\n" + "returns all data until EOF.\n" + "\n" + "If the argument is positive, and the underlying raw stream is\n" + "not 'interactive', multiple raw reads may be issued to satisfy\n" + "the byte count (unless EOF is reached first). But for\n" + "interactive raw streams (as well as sockets and pipes), at most\n" + "one raw read will be issued, and a short result does not imply\n" + "that EOF is imminent.\n" + "\n" + "Returns an empty bytes object on EOF.\n" + "\n" + "Returns None if the underlying raw stream was open in non-blocking\n" + "mode and no data is available at the moment.\n"); + +static PyObject * +BufferedIOBase_read(PyObject *self, PyObject *args) +{ + return BufferedIOBase_unsupported("read"); +} + +PyDoc_STRVAR(BufferedIOBase_read1_doc, + "Read and return up to n bytes, with at most one read() call\n" + "to the underlying raw stream. A short result does not imply\n" + "that EOF is imminent.\n" + "\n" + "Returns an empty bytes object on EOF.\n"); + +static PyObject * +BufferedIOBase_read1(PyObject *self, PyObject *args) +{ + return BufferedIOBase_unsupported("read1"); +} + +PyDoc_STRVAR(BufferedIOBase_write_doc, + "Write the given buffer to the IO stream.\n" + "\n" + "Returns the number of bytes written, which is never less than\n" + "len(b).\n" + "\n" + "Raises BlockingIOError if the buffer is full and the\n" + "underlying raw stream cannot accept more data at the moment.\n"); + +static PyObject * +BufferedIOBase_write(PyObject *self, PyObject *args) +{ + return BufferedIOBase_unsupported("write"); +} + + static PyMethodDef BufferedIOBase_methods[] = { - {"readinto", BufferedIOBase_readinto, METH_VARARGS}, + {"read", BufferedIOBase_read, METH_VARARGS, BufferedIOBase_read_doc}, + {"read1", BufferedIOBase_read1, METH_VARARGS, BufferedIOBase_read1_doc}, + {"readinto", BufferedIOBase_readinto, METH_VARARGS, NULL}, + {"write", BufferedIOBase_write, METH_VARARGS, BufferedIOBase_write_doc}, {NULL, NULL} }; From python-checkins at python.org Sun Jan 18 23:27:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 23:27:05 +0100 (CET) Subject: [Python-checkins] r68746 - in python/branches/py3k: Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/random.rst Doc/library/stdtypes.rst Doc/reference/datamodel.rst Doc/reference/simple_stmts.rst Doc/tools/rstlint.py Lib/inspect.py Lib/test/test_codeccallbacks.py Modules/_ctypes/libffi_msvc/ffi.c Objects/exceptions.c Python/ast.c Python/compile.c Message-ID: <20090118222705.3A0921E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 23:27:04 2009 New Revision: 68746 Log: Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines Change an example in the docs to avoid a mistake when the code is copy pasted and changed afterwards. ........ r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line use enumerate ........ r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h ........ r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line fix grammar ........ r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line #4976: union() and intersection() take multiple args, but talk about "the other". ........ r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line #4974: fix redundant mention of lists and tuples. ........ r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line #4914: trunc is in math. ........ r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line #4979: correct result range for some random functions. ........ r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line #4857: fix augmented assignment target spec. ........ r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line #4923: clarify what was added. ........ r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line #4986: augassigns are not expressions. ........ r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line fix test that wasn't working as expected #4990 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/ctypes.rst python/branches/py3k/Doc/library/datetime.rst python/branches/py3k/Doc/library/random.rst python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Doc/reference/datamodel.rst python/branches/py3k/Doc/reference/simple_stmts.rst python/branches/py3k/Doc/tools/rstlint.py python/branches/py3k/Lib/inspect.py python/branches/py3k/Lib/test/test_codeccallbacks.py python/branches/py3k/Modules/_ctypes/libffi_msvc/ffi.c python/branches/py3k/Objects/exceptions.c python/branches/py3k/Python/ast.c python/branches/py3k/Python/compile.c Modified: python/branches/py3k/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k/Doc/library/ctypes.rst (original) +++ python/branches/py3k/Doc/library/ctypes.rst Sun Jan 18 23:27:04 2009 @@ -2406,10 +2406,10 @@ ("hreftype", HREFTYPE)] class TYPEDESC(Structure): + _anonymous_ = ("u",) _fields_ = [("u", _U), ("vt", VARTYPE)] - _anonymous_ = ("u",) The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field Modified: python/branches/py3k/Doc/library/datetime.rst ============================================================================== --- python/branches/py3k/Doc/library/datetime.rst (original) +++ python/branches/py3k/Doc/library/datetime.rst Sun Jan 18 23:27:04 2009 @@ -1494,10 +1494,6 @@ 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. - For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty strings. @@ -1616,7 +1612,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/py3k/Doc/library/random.rst ============================================================================== --- python/branches/py3k/Doc/library/random.rst (original) +++ python/branches/py3k/Doc/library/random.rst Sun Jan 18 23:27:04 2009 @@ -149,13 +149,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. @@ -163,8 +163,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) @@ -178,14 +178,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/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sun Jan 18 23:27:04 2009 @@ -343,19 +343,19 @@ All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+--------------------------------+--------+ -| Operation | Result | Notes | -+====================+================================+========+ -| ``trunc(x)`` | *x* truncated to Integral | | -+--------------------+--------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+--------------------------------+--------+ -| ``math.floor(x)`` | the greatest Integral <= *x* | | -+--------------------+--------------------------------+--------+ -| ``math.ceil(x)`` | the least Integral >= *x* | | -+--------------------+--------------------------------+--------+ ++--------------------+------------------------------------+--------+ +| Operation | Result | Notes | ++====================+====================================+========+ +| ``math.trunc(x)`` | *x* truncated to Integral | | ++--------------------+------------------------------------+--------+ +| ``round(x[, n])`` | *x* rounded to n digits, | | +| | rounding half to even. If n is | | +| | omitted, it defaults to 0. | | ++--------------------+------------------------------------+--------+ +| ``math.floor(x)`` | the greatest integral float <= *x* | | ++--------------------+------------------------------------+--------+ +| ``math.ceil(x)`` | the least integral float >= *x* | | ++--------------------+------------------------------------+--------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. @@ -595,10 +595,10 @@ ================================================================================================================== There are six sequence types: strings, byte sequences (:class:`bytes` objects), -byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. +byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. For +other containers see the built in :class:`dict` and :class:`set` classes, and +the :mod:`collections` module. -For other containers see the built-in :class:`dict`, :class:`list`, -:class:`set`, and :class:`tuple` classes, and the :mod:`collections` module. .. index:: object: sequence @@ -1623,12 +1623,12 @@ .. 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. .. 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. .. method:: difference(other, ...) set - other - ... Modified: python/branches/py3k/Doc/reference/datamodel.rst ============================================================================== --- python/branches/py3k/Doc/reference/datamodel.rst (original) +++ python/branches/py3k/Doc/reference/datamodel.rst Sun Jan 18 23:27:04 2009 @@ -317,7 +317,7 @@ slicing notations can be used as the target of assignment and :keyword:`del` (delete) statements. - There is currently a single intrinsic mutable sequence type: + There are currently two intrinsic mutable sequence types: Lists .. index:: object: list @@ -1777,13 +1777,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``. 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 Sun Jan 18 23:27:04 2009 @@ -246,7 +246,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/py3k/Doc/tools/rstlint.py ============================================================================== --- python/branches/py3k/Doc/tools/rstlint.py (original) +++ python/branches/py3k/Doc/tools/rstlint.py Sun Jan 18 23:27:04 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/py3k/Lib/inspect.py ============================================================================== --- python/branches/py3k/Lib/inspect.py (original) +++ python/branches/py3k/Lib/inspect.py Sun Jan 18 23:27:04 2009 @@ -881,8 +881,8 @@ specs = [] if defaults: firstdefault = len(args) - len(defaults) - for i in range(len(args)): - spec = strseq(args[i], formatargandannotation, join) + for i, arg in enumerate(args): + spec = strseq(arg, formatargandannotation, join) if defaults and i >= firstdefault: spec = spec + formatvalue(defaults[i - firstdefault]) specs.append(spec) 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 Sun Jan 18 23:27:04 2009 @@ -592,7 +592,7 @@ encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15") for res in results: - codecs.register_error("test.badhandler", lambda: res) + codecs.register_error("test.badhandler", lambda x: res) for enc in encs: self.assertRaises( TypeError, 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 Sun Jan 18 23:27:04 2009 @@ -34,7 +34,7 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -extern void Py_FatalError(char *msg); +extern void Py_FatalError(const char *msg); /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) Modified: python/branches/py3k/Objects/exceptions.c ============================================================================== --- python/branches/py3k/Objects/exceptions.c (original) +++ python/branches/py3k/Objects/exceptions.c Sun Jan 18 23:27:04 2009 @@ -1923,7 +1923,7 @@ PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) - Py_FatalError("Cannot pre-allocate MemoryError instance\n"); + Py_FatalError("Cannot pre-allocate MemoryError instance"); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) Modified: python/branches/py3k/Python/ast.c ============================================================================== --- python/branches/py3k/Python/ast.c (original) +++ python/branches/py3k/Python/ast.c Sun Jan 18 23:27:04 2009 @@ -191,7 +191,7 @@ default: { char buf[128]; - sprintf(buf, "Non-statement found: %d %d\n", + sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } Modified: python/branches/py3k/Python/compile.c ============================================================================== --- python/branches/py3k/Python/compile.c (original) +++ python/branches/py3k/Python/compile.c Sun Jan 18 23:27:04 2009 @@ -1239,7 +1239,7 @@ char buf[350]; PyOS_snprintf(buf, sizeof(buf), "unknown scope for %.100s in %.100s(%s) in %s\n" - "symbols: %s\nlocals: %s\nglobals: %s\n", + "symbols: %s\nlocals: %s\nglobals: %s", PyBytes_AS_STRING(name), PyBytes_AS_STRING(c->u->u_name), PyObject_REPR(c->u->u_ste->ste_id), From python-checkins at python.org Sun Jan 18 23:35:58 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 18 Jan 2009 23:35:58 +0100 (CET) Subject: [Python-checkins] r68747 - in python/branches/io-c: Lib/test/test_io.py Modules/_iobase.c Message-ID: <20090118223558.465B31E4002@bag.python.org> Author: antoine.pitrou Date: Sun Jan 18 23:35:58 2009 New Revision: 68747 Log: Kill test failure Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_iobase.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 Jan 18 23:35:58 2009 @@ -1809,7 +1809,8 @@ self.assertRaises(ValueError, f.seek, 0) self.assertRaises(ValueError, f.tell) self.assertRaises(ValueError, f.truncate) - self.assertRaises(ValueError, f.write, "") + self.assertRaises(ValueError, f.write, + b"" if "b" in kwargs['mode'] else "") self.assertRaises(ValueError, f.writelines, []) Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Jan 18 23:35:58 2009 @@ -105,6 +105,10 @@ IOBase_flush(PyObject *self, PyObject *args) { /* XXX Should this return the number of bytes written??? */ + if (IS_CLOSED(self)) { + PyErr_SetString(PyExc_ValueError, "I/O operation on closed file."); + return NULL; + } Py_RETURN_NONE; } @@ -132,7 +136,6 @@ return PyBool_FromLong(IS_CLOSED(self)); } - PyObject * _PyIOBase_checkClosed(PyObject *self, PyObject *args) { @@ -171,10 +174,14 @@ Py_RETURN_NONE; } +/* Destructor */ + static PyObject * IOBase_del(PyObject *self, PyObject *args) { PyObject *res = NULL; + if (IOBase_closed(self)) + Py_RETURN_NONE; res = PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); if (res == NULL) { /* At program exit time, it's possible that globals have already been From python-checkins at python.org Sun Jan 18 23:40:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 23:40:43 +0100 (CET) Subject: [Python-checkins] r68748 - in python/branches/release30-maint: Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/random.rst Doc/library/stdtypes.rst Doc/reference/datamodel.rst Doc/reference/simple_stmts.rst Doc/tools/rstlint.py Lib/inspect.py Lib/test/test_codeccallbacks.py Modules/_ctypes/libffi_msvc/ffi.c Objects/exceptions.c Python/ast.c Python/compile.c Message-ID: <20090118224043.94C401E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 23:40:43 2009 New Revision: 68748 Log: Merged revisions 68746 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68746 | benjamin.peterson | 2009-01-18 16:27:04 -0600 (Sun, 18 Jan 2009) | 55 lines Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines Change an example in the docs to avoid a mistake when the code is copy pasted and changed afterwards. ........ r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line use enumerate ........ r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h ........ r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line fix grammar ........ r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line #4976: union() and intersection() take multiple args, but talk about "the other". ........ r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line #4974: fix redundant mention of lists and tuples. ........ r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line #4914: trunc is in math. ........ r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line #4979: correct result range for some random functions. ........ r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line #4857: fix augmented assignment target spec. ........ r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line #4923: clarify what was added. ........ r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line #4986: augassigns are not expressions. ........ r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line fix test that wasn't working as expected #4990 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/ctypes.rst python/branches/release30-maint/Doc/library/datetime.rst python/branches/release30-maint/Doc/library/random.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/reference/datamodel.rst python/branches/release30-maint/Doc/reference/simple_stmts.rst python/branches/release30-maint/Doc/tools/rstlint.py python/branches/release30-maint/Lib/inspect.py python/branches/release30-maint/Lib/test/test_codeccallbacks.py python/branches/release30-maint/Modules/_ctypes/libffi_msvc/ffi.c python/branches/release30-maint/Objects/exceptions.c python/branches/release30-maint/Python/ast.c python/branches/release30-maint/Python/compile.c 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 Sun Jan 18 23:40:43 2009 @@ -2406,10 +2406,10 @@ ("hreftype", HREFTYPE)] class TYPEDESC(Structure): + _anonymous_ = ("u",) _fields_ = [("u", _U), ("vt", VARTYPE)] - _anonymous_ = ("u",) The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field Modified: python/branches/release30-maint/Doc/library/datetime.rst ============================================================================== --- python/branches/release30-maint/Doc/library/datetime.rst (original) +++ python/branches/release30-maint/Doc/library/datetime.rst Sun Jan 18 23:40:43 2009 @@ -1494,10 +1494,6 @@ 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. - For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty strings. @@ -1616,7 +1612,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/release30-maint/Doc/library/random.rst ============================================================================== --- python/branches/release30-maint/Doc/library/random.rst (original) +++ python/branches/release30-maint/Doc/library/random.rst Sun Jan 18 23:40:43 2009 @@ -149,13 +149,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. @@ -163,8 +163,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) @@ -176,14 +176,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/release30-maint/Doc/library/stdtypes.rst ============================================================================== --- python/branches/release30-maint/Doc/library/stdtypes.rst (original) +++ python/branches/release30-maint/Doc/library/stdtypes.rst Sun Jan 18 23:40:43 2009 @@ -343,19 +343,19 @@ All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+--------------------------------+--------+ -| Operation | Result | Notes | -+====================+================================+========+ -| ``trunc(x)`` | *x* truncated to Integral | | -+--------------------+--------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+--------------------------------+--------+ -| ``math.floor(x)`` | the greatest Integral <= *x* | | -+--------------------+--------------------------------+--------+ -| ``math.ceil(x)`` | the least Integral >= *x* | | -+--------------------+--------------------------------+--------+ ++--------------------+------------------------------------+--------+ +| Operation | Result | Notes | ++====================+====================================+========+ +| ``math.trunc(x)`` | *x* truncated to Integral | | ++--------------------+------------------------------------+--------+ +| ``round(x[, n])`` | *x* rounded to n digits, | | +| | rounding half to even. If n is | | +| | omitted, it defaults to 0. | | ++--------------------+------------------------------------+--------+ +| ``math.floor(x)`` | the greatest integral float <= *x* | | ++--------------------+------------------------------------+--------+ +| ``math.ceil(x)`` | the least integral float >= *x* | | ++--------------------+------------------------------------+--------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. @@ -420,6 +420,36 @@ overflow check. +Additional Methods on Integer Types +----------------------------------- + +.. method:: int.bit_length() + + Return the number of bits necessary to represent an integer in binary, + excluding the sign and leading zeros:: + + >>> n = -37 + >>> bin(n) + '-0b100101' + >>> n.bit_length() + 6 + + More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the + unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. + Equivalently, when ``abs(x)`` is small enough to have a correctly + rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. + If ``x`` is zero, then ``x.bit_length()`` returns ``0``. + + Equivalent to:: + + def bit_length(self): + s = bin(x) # binary representation: bin(-37) --> '-0b100101' + s = s.lstrip('-0b') # remove leading zeros and minus sign + return len(s) # len('100101') --> 6 + + .. versionadded:: 3.1 + + Additional Methods on Float --------------------------- @@ -564,16 +594,17 @@ Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`list`, :class:`tuple`, :class:`range` ================================================================================================================== -There are five sequence types: strings, byte sequences, byte arrays, lists, -tuples, and range objects. (For other containers see the built-in -:class:`dict`, :class:`list`, :class:`set`, and :class:`tuple` classes, and the -:mod:`collections` module.) +There are six sequence types: strings, byte sequences (:class:`bytes` objects), +byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. For +other containers see the built in :class:`dict` and :class:`set` classes, and +the :mod:`collections` module. + .. index:: object: sequence object: string object: bytes - object: buffer + object: bytearray object: tuple object: list object: range @@ -1592,12 +1623,12 @@ .. 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. .. 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. .. method:: difference(other, ...) set - other - ... Modified: python/branches/release30-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release30-maint/Doc/reference/datamodel.rst Sun Jan 18 23:40:43 2009 @@ -317,7 +317,7 @@ slicing notations can be used as the target of assignment and :keyword:`del` (delete) statements. - There is currently a single intrinsic mutable sequence type: + There are currently two intrinsic mutable sequence types: Lists .. index:: object: list @@ -1777,13 +1777,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``. 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 Sun Jan 18 23:40:43 2009 @@ -246,7 +246,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/release30-maint/Doc/tools/rstlint.py ============================================================================== --- python/branches/release30-maint/Doc/tools/rstlint.py (original) +++ python/branches/release30-maint/Doc/tools/rstlint.py Sun Jan 18 23:40:43 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/release30-maint/Lib/inspect.py ============================================================================== --- python/branches/release30-maint/Lib/inspect.py (original) +++ python/branches/release30-maint/Lib/inspect.py Sun Jan 18 23:40:43 2009 @@ -881,8 +881,8 @@ specs = [] if defaults: firstdefault = len(args) - len(defaults) - for i in range(len(args)): - spec = strseq(args[i], formatargandannotation, join) + for i, arg in enumerate(args): + spec = strseq(arg, formatargandannotation, join) if defaults and i >= firstdefault: spec = spec + formatvalue(defaults[i - firstdefault]) specs.append(spec) Modified: python/branches/release30-maint/Lib/test/test_codeccallbacks.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_codeccallbacks.py (original) +++ python/branches/release30-maint/Lib/test/test_codeccallbacks.py Sun Jan 18 23:40:43 2009 @@ -592,7 +592,7 @@ encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15") for res in results: - codecs.register_error("test.badhandler", lambda: res) + codecs.register_error("test.badhandler", lambda x: res) for enc in encs: self.assertRaises( TypeError, Modified: python/branches/release30-maint/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/branches/release30-maint/Modules/_ctypes/libffi_msvc/ffi.c Sun Jan 18 23:40:43 2009 @@ -34,7 +34,7 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -extern void Py_FatalError(char *msg); +extern void Py_FatalError(const char *msg); /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) Modified: python/branches/release30-maint/Objects/exceptions.c ============================================================================== --- python/branches/release30-maint/Objects/exceptions.c (original) +++ python/branches/release30-maint/Objects/exceptions.c Sun Jan 18 23:40:43 2009 @@ -1923,7 +1923,7 @@ PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) - Py_FatalError("Cannot pre-allocate MemoryError instance\n"); + Py_FatalError("Cannot pre-allocate MemoryError instance"); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) Modified: python/branches/release30-maint/Python/ast.c ============================================================================== --- python/branches/release30-maint/Python/ast.c (original) +++ python/branches/release30-maint/Python/ast.c Sun Jan 18 23:40:43 2009 @@ -191,7 +191,7 @@ default: { char buf[128]; - sprintf(buf, "Non-statement found: %d %d\n", + sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } Modified: python/branches/release30-maint/Python/compile.c ============================================================================== --- python/branches/release30-maint/Python/compile.c (original) +++ python/branches/release30-maint/Python/compile.c Sun Jan 18 23:40:43 2009 @@ -1237,7 +1237,7 @@ char buf[350]; PyOS_snprintf(buf, sizeof(buf), "unknown scope for %.100s in %.100s(%s) in %s\n" - "symbols: %s\nlocals: %s\nglobals: %s\n", + "symbols: %s\nlocals: %s\nglobals: %s", PyBytes_AS_STRING(name), PyBytes_AS_STRING(c->u->u_name), PyObject_REPR(c->u->u_ste->ste_id), From python-checkins at python.org Sun Jan 18 23:46:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 23:46:34 +0100 (CET) Subject: [Python-checkins] r68749 - in python/branches/py3k: Lib/heapq.py Message-ID: <20090118224634.235B11E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 23:46:33 2009 New Revision: 68749 Log: Merged revisions 68546 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68546 | raymond.hettinger | 2009-01-12 04:37:32 -0600 (Mon, 12 Jan 2009) | 1 line Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size. ........ Modified: python/branches/py3k/ (props changed) 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 Jan 18 23:46:33 2009 @@ -129,7 +129,7 @@ __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge', 'nlargest', 'nsmallest', 'heappushpop'] -from itertools import islice, repeat, count, tee +from itertools import islice, repeat, count, tee, chain from operator import itemgetter, neg import bisect @@ -354,10 +354,32 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + # Short-cut for n==1 is to use min() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [min(chain(head, it))] + return [min(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key)[:n] + + # When key is none, use simpler decoration if key is None: it = zip(iterable, count()) # decorate result = _nsmallest(n, it) return list(map(itemgetter(0), result)) # undecorate + + # General case, slowest method in1, in2 = tee(iterable) it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) @@ -369,10 +391,33 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + + # Short-cut for n==1 is to use max() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [max(chain(head, it))] + return [max(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key, reverse=True)[:n] + + # When key is none, use simpler decoration if key is None: it = zip(iterable, map(neg, count())) # 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 result = _nlargest(n, it) From python-checkins at python.org Sun Jan 18 23:47:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 23:47:05 +0100 (CET) Subject: [Python-checkins] r68750 - python/trunk/Lib/heapq.py Message-ID: <20090118224705.21A3D1E4010@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 23:47:04 2009 New Revision: 68750 Log: fix encoding cookie case Modified: python/trunk/Lib/heapq.py Modified: python/trunk/Lib/heapq.py ============================================================================== --- python/trunk/Lib/heapq.py (original) +++ python/trunk/Lib/heapq.py Sun Jan 18 23:47:04 2009 @@ -1,4 +1,4 @@ -# -*- coding: Latin-1 -*- +# -*- coding: latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). From python-checkins at python.org Sun Jan 18 23:58:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 18 Jan 2009 23:58:55 +0100 (CET) Subject: [Python-checkins] r68751 - python/branches/py3k Message-ID: <20090118225855.D86171E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 18 23:58:55 2009 New Revision: 68751 Log: Blocked revisions 68544-68545,68597 via svnmerge ........ r68544 | kristjan.jonsson | 2009-01-12 03:20:34 -0600 (Mon, 12 Jan 2009) | 1 line Update Misc/NEWS for issue 3582 ........ r68545 | kristjan.jonsson | 2009-01-12 03:24:04 -0600 (Mon, 12 Jan 2009) | 1 line Misc/NEWS for issue 4293 ........ r68597 | benjamin.peterson | 2009-01-13 17:43:50 -0600 (Tue, 13 Jan 2009) | 1 line fix test_xmlrpc failures #4939 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Mon Jan 19 00:05:43 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Mon, 19 Jan 2009 00:05:43 +0100 (CET) Subject: [Python-checkins] r68752 - python/branches/io-c/Modules/_iobase.c Message-ID: <20090118230543.6BE441E4013@bag.python.org> Author: amaury.forgeotdarc Date: Mon Jan 19 00:05:43 2009 New Revision: 68752 Log: Fix a segfault when e.g a BufferedReader is created with a FileIO in read mode. 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 Jan 19 00:05:43 2009 @@ -125,6 +125,8 @@ /* This gets the derived attribute, which is *not* __IOBase_closed in most cases! */ res = PyObject_GetAttr(self, _PyIO_str_closed); + if (res == NULL) + return 0; closed = PyObject_IsTrue(res); Py_DECREF(res); return closed; @@ -221,6 +223,7 @@ if (res != Py_True) { Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not seekable."); + return NULL; } if (args == Py_True) { Py_DECREF(res); @@ -249,6 +252,7 @@ if (res != Py_True) { Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not readable."); + return NULL; } if (args == Py_True) { Py_DECREF(res); @@ -277,6 +281,7 @@ if (res != Py_True) { Py_CLEAR(res); PyErr_SetString(PyExc_IOError, "File or stream is not writable."); + return NULL; } if (args == Py_True) { Py_DECREF(res); From python-checkins at python.org Mon Jan 19 00:13:10 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 19 Jan 2009 00:13:10 +0100 (CET) Subject: [Python-checkins] r68753 - in python/branches/io-c/Modules: _bufferedio.c _textio.c Message-ID: <20090118231310.2E0AC1E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 19 00:13:09 2009 New Revision: 68753 Log: Add truncate() to text IO objects Modified: python/branches/io-c/Modules/_bufferedio.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 Jan 19 00:13:09 2009 @@ -344,8 +344,6 @@ * and a flush may be necessary to synch both views of the current * file state. */ - /* FIXME: raw objects don't have flush() - */ res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); if (res == NULL) return NULL; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Mon Jan 19 00:13:09 2009 @@ -1952,6 +1952,33 @@ return NULL; } +static PyObject * +TextIOWrapper_truncate(PyTextIOWrapperObject *self, PyObject *args) +{ + PyObject *pos = Py_None; + PyObject *res; + + CHECK_INITIALIZED(self) + if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { + return 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, + _PyIO_str_seek, pos, NULL); + if (res == NULL) + return NULL; + Py_DECREF(res); + } + + return PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_truncate, NULL); +} + /* Inquiries */ static PyObject * @@ -2123,11 +2150,7 @@ {"seek", (PyCFunction)TextIOWrapper_seek, METH_VARARGS}, {"tell", (PyCFunction)TextIOWrapper_tell, METH_NOARGS}, -/* {"truncate", (PyCFunction)TextIOWrapper_truncate, METH_VARARGS}, - {"readinto", (PyCFunction)TextIOWrapper_readinto, METH_VARARGS}, - {"peek", (PyCFunction)TextIOWrapper_peek, METH_VARARGS}, - {"read1", (PyCFunction)TextIOWrapper_read1, METH_VARARGS}, -*/ + {"truncate", (PyCFunction)TextIOWrapper_truncate, METH_VARARGS}, {NULL, NULL} }; From buildbot at python.org Mon Jan 19 00:26:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 18 Jan 2009 23:26:21 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090118232622.359D51E4002@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/0 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: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,georg.brandl,mark.dickinson BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 00:26:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 18 Jan 2009 23:26:21 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 3.x Message-ID: <20090118232622.B715E1E400C@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/0 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: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,brett.cannon,georg.brandl,jesse.noller,mark.dickinson,martin.v.loewis,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 9 tests failed: test_cmd_line test_importlib test_normalization test_robotparser test_socket test_ssl test_timeout test_urllib2net test_urllibnet ====================================================================== 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 Traceback (most recent call last): 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner indirect_test() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_normalization.py", line 99, in test_main open_urlresource(TESTDATAURL) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/support.py", line 367, in open_urlresource fn, _ = urllib.request.urlretrieve(url, filename) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 134, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1476, in retrieve fp = self.open(url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1448, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: testPasswordProtectedSite (test.test_robotparser.NetworkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_robotparser.py", line 217, in testPasswordProtectedSite parser.read() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/robotparser.py", line 56, in read f = urllib.request.urlopen(self.url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: testPythonOrg (test.test_robotparser.NetworkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_robotparser.py", line 225, in testPythonOrg parser.read() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/robotparser.py", line 56, in read f = urllib.request.urlopen(self.url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: testSockName (test.test_socket.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_socket.py", line 484, in testSockName my_ip_addr = socket.gethostbyname(socket.gethostname()) socket.gaierror: [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: testSSLconnect (test.test_ssl.BasicTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_ssl.py", line 44, in testSSLconnect s.connect(("svn.python.org", 443)) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/ssl.py", line 339, in connect socket.connect(self, addr) socket.gaierror: [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: testConnect (test.test_ssl.NetworkedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_ssl.py", line 105, in testConnect s.connect(("svn.python.org", 443)) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/ssl.py", line 339, in connect socket.connect(self, addr) socket.gaierror: [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: testFetchServerCert (test.test_ssl.NetworkedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_ssl.py", line 158, in testFetchServerCert pem = ssl.get_server_certificate(("svn.python.org", 443)) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/ssl.py", line 431, in get_server_certificate s.connect(addr) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/ssl.py", line 339, in connect socket.connect(self, addr) socket.gaierror: [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: testNonBlockingHandshake (test.test_ssl.NetworkedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_ssl.py", line 134, in testNonBlockingHandshake s.connect(("svn.python.org", 443)) socket.gaierror: [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: testRecvTimeout (test.test_timeout.TimeoutTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_timeout.py", line 133, in testRecvTimeout self.sock.connect(self.addr_remote) socket.gaierror: [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: test_close (test.test_urllib2net.CloseSocketTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 83, in test_close response = _urlopen_with_retry("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_ftp_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1246, in ftp_open host = socket.gethostbyname(host) socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 226, in test_ftp_basic u = _urlopen_with_retry(self.FTP_HOST) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1248, in ftp_open raise URLError(msg) urllib.error.URLError: ====================================================================== ERROR: test_ftp_default_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1246, in ftp_open host = socket.gethostbyname(host) socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 233, in test_ftp_default_timeout u = _urlopen_with_retry(self.FTP_HOST) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1248, in ftp_open raise URLError(msg) urllib.error.URLError: ====================================================================== ERROR: test_ftp_no_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1246, in ftp_open host = socket.gethostbyname(host) socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 242, in test_ftp_no_timeout u = _urlopen_with_retry(self.FTP_HOST, timeout=None) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1248, in ftp_open raise URLError(msg) urllib.error.URLError: ====================================================================== ERROR: test_ftp_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1246, in ftp_open host = socket.gethostbyname(host) socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 248, in test_ftp_timeout u = _urlopen_with_retry(self.FTP_HOST, timeout=60) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1248, in ftp_open raise URLError(msg) urllib.error.URLError: ====================================================================== ERROR: test_http_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 197, in test_http_basic u = _urlopen_with_retry("http://www.python.org") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_http_default_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 204, in test_http_default_timeout u = _urlopen_with_retry("http://www.python.org") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_http_no_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 213, in test_http_no_timeout u = _urlopen_with_retry("http://www.python.org", timeout=None) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_http_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 219, in test_http_timeout u = _urlopen_with_retry("http://www.python.org", timeout=120) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: testURLread (test.test_urllibnet.URLTimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 39, in testURLread f = _open_with_retry(urllib.request.urlopen, "http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_basic (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 62, in test_basic open_url = self.urlopen("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 58, in urlopen return _open_with_retry(urllib.request.urlopen, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_fileno (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 121, in test_fileno open_url = self.urlopen("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 58, in urlopen return _open_with_retry(urllib.request.urlopen, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_getcode (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 108, in test_getcode open_url = urllib.request.FancyURLopener().open(URL) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1448, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: test_geturl (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 98, in test_geturl open_url = self.urlopen(URL) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 58, in urlopen return _open_with_retry(urllib.request.urlopen, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_info (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 85, in test_info open_url = self.urlopen("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 58, in urlopen return _open_with_retry(urllib.request.urlopen, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_readlines (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 74, in test_readlines open_url = self.urlopen("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 58, in urlopen return _open_with_retry(urllib.request.urlopen, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: ====================================================================== ERROR: test_basic (test.test_urllibnet.urlretrieveNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 152, in test_basic file_location,info = self.urlretrieve("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 148, in urlretrieve return _open_with_retry(urllib.request.urlretrieve, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 134, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1476, in retrieve fp = self.open(url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1448, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: test_header (test.test_urllibnet.urlretrieveNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 178, in test_header file_location, header = self.urlretrieve("http://www.python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 148, in urlretrieve return _open_with_retry(urllib.request.urlretrieve, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 134, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1476, in retrieve fp = self.open(url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1448, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 2] Temporary failure in name resolution ====================================================================== ERROR: test_specified_path (test.test_urllibnet.urlretrieveNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno 2] Temporary failure in name resolution Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 166, in test_specified_path support.TESTFN) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 148, in urlretrieve return _open_with_retry(urllib.request.urlretrieve, *args) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 134, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1476, in retrieve fp = self.open(url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1448, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) 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 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 862, in request self._send_request(method, url, body, headers) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 903, in _send_request self.endheaders(body.encode('ascii') if isinstance(body, str) else body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 857, in endheaders self._send_output(message_body) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 711, in _send_output self.send(msg) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 663, in send self.connect() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 647, in connect self.timeout) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/socket.py", line 292, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 2] Temporary failure in name resolution make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 00:26:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 18 Jan 2009 23:26:40 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090118232640.80F801E400C@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/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,antoine.pitrou,armin.ronacher,benjamin.peterson,georg.brandl,jesse.noller,kristjan.jonsson,mark.dickinson,raymond.hettinger,thomas.heller,vinay.sajip BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 00:27:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 18 Jan 2009 23:27:13 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 3.0 Message-ID: <20090118232714.153781E400C@bag.python.org> The Buildbot has detected a new failure of OS X x86 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%203.0/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,brett.cannon,mark.dickinson,martin.v.loewis BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 00:30:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 18 Jan 2009 23:30:07 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090118233007.746F21E4002@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/723 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 19 00:51:08 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 19 Jan 2009 00:51:08 +0100 (CET) Subject: [Python-checkins] r68754 - in python/branches/io-c: Lib/test/test_io.py Modules/_bufferedio.c Modules/_fileio.c Modules/_iobase.c Modules/_iomodule.h Modules/_textio.c Message-ID: <20090118235108.95E411E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 19 00:51:08 2009 New Revision: 68754 Log: Remove IOBase.__del__ and replace it with custom code with tp_dealloc Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_iomodule.h 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 Mon Jan 19 00:51:08 2009 @@ -338,6 +338,29 @@ del f self.assertEqual(record, [1, 2, 3]) + def test_IOBase_destructor(self): + record = [] + class MyIO(io.IOBase): + def __init__(self): + pass + def __del__(self): + record.append(1) + try: + f = io.IOBase.__del__ + except AttributeError: + pass + else: + f(self) + def close(self): + record.append(2) + io.IOBase.close(self) + def flush(self): + record.append(3) + io.IOBase.flush(self) + f = MyIO() + del f + self.assertEqual(record, [1, 2, 3]) + def test_close_flushes(self): f = io.open(support.TESTFN, "wb") f.write(b"xxx") Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Mon Jan 19 00:51:08 2009 @@ -285,26 +285,9 @@ static void BufferedObject_dealloc(BufferedObject *self) { - PyObject *res; - /* XXX this is inelegant */ - if (Py_TYPE(self)->tp_del == NULL) { - PyObject *tp, *v, *tb; - PyErr_Fetch(&tp, &v, &tb); - /* We need to resurrect the object as calling close() can invoke - arbitrary code. */ - ((PyObject *) self)->ob_refcnt++; - res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, - NULL); - if (res == NULL) { - /* XXX dump exception on terminal? - But IOBase.__del__ prefers to remain silent... */ - PyErr_Clear(); - } - Py_XDECREF(res); - PyErr_Restore(tp, v, tb); - if (--((PyObject *) self)->ob_refcnt != 0) - return; - } + if (_PyIOBase_finalize((PyObject *) self) < 0) + return; + self->ok = 0; if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *)self); Py_CLEAR(self->raw); @@ -342,15 +325,18 @@ /* 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. + * file state. */ res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); if (res == NULL) return NULL; Py_DECREF(res); - if (pos == Py_None) + if (pos == Py_None) { pos = PyObject_CallMethod(self->raw, "tell", NULL); + if (pos == NULL) + return NULL; + } else Py_INCREF(pos); Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Mon Jan 19 00:51:08 2009 @@ -335,16 +335,11 @@ static void fileio_dealloc(PyFileIOObject *self) { + if (_PyIOBase_finalize((PyObject *) self) < 0) + return; if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *) self); - - if (self->fd >= 0 && self->closefd) { - if(internal_close(self)) - PyErr_WriteUnraisable((PyObject*)self); - } - Py_CLEAR(self->dict); - Py_TYPE(self)->tp_free((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 Jan 19 00:51:08 2009 @@ -178,26 +178,48 @@ /* Destructor */ -static PyObject * -IOBase_del(PyObject *self, PyObject *args) +int +_PyIOBase_finalize(PyObject *self) { - PyObject *res = NULL; - if (IOBase_closed(self)) - Py_RETURN_NONE; - res = PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); - if (res == NULL) { - /* At program exit time, 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. - * - * XXX: this function can be called at other times and what if the - * error is genuine? - */ + PyObject *res; + PyObject *tp, *v, *tb; + int closed = 1; + 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); + if (res == NULL) PyErr_Clear(); + else { + closed = PyObject_IsTrue(res); + Py_DECREF(res); + if (closed == -1) + PyErr_Clear(); } - Py_XDECREF(res); - Py_RETURN_NONE; + if (closed == 0) { + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, + NULL); + if (res == NULL) { + /* XXX dump exception on terminal? + But IOBase.__del__ prefers to remain silent... */ + PyErr_Clear(); + } + Py_XDECREF(res); + } + PyErr_Restore(tp, v, tb); + if (--((PyObject *) self)->ob_refcnt != 0) + return -1; + return 0; +} + +static void +IOBase_dealloc(PyObject *self) +{ + if (_PyIOBase_finalize(self) == 0) + Py_TYPE(self)->tp_free(self); } /* Inquiry methods */ @@ -588,7 +610,6 @@ {"fileno", IOBase_fileno, METH_NOARGS, IOBase_fileno_doc}, {"isatty", IOBase_isatty, METH_NOARGS, IOBase_isatty_doc}, - {"__del__", IOBase_del, METH_NOARGS}, {"__enter__", IOBase_enter, METH_NOARGS}, {"__exit__", IOBase_exit, METH_VARARGS}, @@ -610,7 +631,7 @@ "IOBase", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ - 0, /*tp_dealloc*/ + IOBase_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Mon Jan 19 00:51:08 2009 @@ -25,6 +25,12 @@ 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 + is alive again. */ +extern int _PyIOBase_finalize(PyObject *self); + #define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */ typedef struct { @@ -36,7 +42,6 @@ } PyBlockingIOErrorObject; PyObject *PyExc_BlockingIOError; - /* * Offset type for positioning. */ Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Mon Jan 19 00:51:08 2009 @@ -782,26 +782,8 @@ static void TextIOWrapper_dealloc(PyTextIOWrapperObject *self) { - PyObject *res; - /* XXX this is inelegant */ - if (Py_TYPE(self)->tp_del == NULL && self->ok) { - PyObject *tp, *v, *tb; - PyErr_Fetch(&tp, &v, &tb); - /* We need to resurrect the object as calling close() can invoke - arbitrary code. */ - ((PyObject *) self)->ob_refcnt++; - res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, - NULL); - if (res == NULL) { - /* XXX dump exception on terminal? - But IOBase.__del__ prefers to remain silent... */ - PyErr_Clear(); - } - Py_XDECREF(res); - PyErr_Restore(tp, v, tb); - if (--((PyObject *) self)->ob_refcnt != 0) - return; - } + if (_PyIOBase_finalize((PyObject *) self) < 0) + return; self->ok = 0; Py_CLEAR(self->buffer); Py_CLEAR(self->encoding); From python-checkins at python.org Mon Jan 19 01:08:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 01:08:08 +0100 (CET) Subject: [Python-checkins] r68755 - in python/trunk: Lib/test/test_fileio.py Misc/NEWS Modules/_fileio.c Message-ID: <20090119000808.E1E9C1E400C@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 01:08:08 2009 New Revision: 68755 Log: raise an OSError for invalid fds #4991 Modified: python/trunk/Lib/test/test_fileio.py python/trunk/Misc/NEWS python/trunk/Modules/_fileio.c Modified: python/trunk/Lib/test/test_fileio.py ============================================================================== --- python/trunk/Lib/test/test_fileio.py (original) +++ python/trunk/Lib/test/test_fileio.py Mon Jan 19 01:08:08 2009 @@ -176,6 +176,10 @@ f.close() os.unlink(TESTFN) + def testInvalidFd(self): + self.assertRaises(ValueError, _fileio._FileIO, -10) + self.assertRaises(OSError, _fileio._FileIO, 10) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 19 01:08:08 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4991: Passing invalid file descriptors to io.FileIO now raises an + OSError. + - Issue #4807: Port the _winreg module to Windows CE. - Issue #4935: The overflow checking code in the expandtabs() method common Modified: python/trunk/Modules/_fileio.c ============================================================================== --- python/trunk/Modules/_fileio.c (original) +++ python/trunk/Modules/_fileio.c Mon Jan 19 01:08:08 2009 @@ -119,6 +119,24 @@ return 0; } +static int +check_fd(int fd) +{ +#if defined(HAVE_FSTAT) + struct stat buf; + if (fstat(fd, &buf) < 0 && errno == EBADF) { + PyObject *exc; + char *msg = strerror(EBADF); + exc = PyObject_CallFunction(PyExc_OSError, "(is)", + EBADF, msg); + PyErr_SetObject(PyExc_OSError, exc); + Py_XDECREF(exc); + return -1; + } +#endif + return 0; +} + static int fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) @@ -151,6 +169,8 @@ "Negative filedescriptor"); return -1; } + if (check_fd(fd)) + return -1; } else { PyErr_Clear(); From buildbot at python.org Mon Jan 19 01:09:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 00:09:40 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 2.6 Message-ID: <20090119000940.6C6BC1E4002@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/20 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: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,georg.brandl,mark.dickinson 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') 2 tests failed: test_datetime test_os ====================================================================== FAIL: test_strftime (test.test_datetime.TestDate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTime) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== FAIL: test_strftime (test.test_datetime.TestDateTimeTZ) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_datetime.py", line 860, in test_strftime self.assertRaises(ValueError, t.strftime, "%e") AssertionError: ValueError not raised ====================================================================== ERROR: test_fchown (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_os.py", line 562, in test_fchown self.assertRaises(OSError, os.fchmod, 10, -1, -1) File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) TypeError: fchmod() takes exactly 2 arguments (3 given) ====================================================================== ERROR: test_fpathconf (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_os.py", line 566, in test_fpathconf self.assertRaises(OSError, os.fpathconf, 10, "foo") File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) ValueError: unrecognized configuration name ====================================================================== ERROR: test_ftruncate (test.test_os.TestInvalidFD) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_os.py", line 570, in test_ftruncate self.assertRaises(OSError, os.ftruncate, 10, 0) File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/unittest.py", line 336, in failUnlessRaises callableObj(*args, **kwargs) IOError: [Errno 9] Bad file descriptor make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 19 01:10:16 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 19 Jan 2009 01:10:16 +0100 (CET) Subject: [Python-checkins] r68756 - python/branches/io-c/Modules/_iobase.c Message-ID: <20090119001016.8D26A1E4029@bag.python.org> Author: antoine.pitrou Date: Mon Jan 19 01:10:16 2009 New Revision: 68756 Log: Remove irrelevant comment. 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 Jan 19 01:10:16 2009 @@ -202,12 +202,10 @@ if (closed == 0) { res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, NULL); - if (res == NULL) { - /* XXX dump exception on terminal? - But IOBase.__del__ prefers to remain silent... */ + if (res == NULL) PyErr_Clear(); - } - Py_XDECREF(res); + else + Py_DECREF(res); } PyErr_Restore(tp, v, tb); if (--((PyObject *) self)->ob_refcnt != 0) From buildbot at python.org Mon Jan 19 01:28:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 00:28:39 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090119002839.F10AD1E4002@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/48 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: amaury.forgeotdarc,antoine.pitrou,benjamin.peterson,brett.cannon,georg.brandl,jesse.noller,mark.dickinson,martin.v.loewis,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_importlib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 19 01:31:46 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 19 Jan 2009 01:31:46 +0100 (CET) Subject: [Python-checkins] r68757 - in python/branches/io-c: Doc/c-api/init.rst Doc/library/base64.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/multiprocessing.rst Doc/library/random.rst Doc/library/stdtypes.rst Doc/reference/datamodel.rst Doc/reference/simple_stmts.rst Doc/tools/rstlint.py Lib/heapq.py Lib/http/client.py Lib/idlelib/IOBinding.py Lib/idlelib/NEWS.txt Lib/idlelib/ScriptBinding.py Lib/importlib Lib/inspect.py Lib/logging/__init__.py Lib/logging/handlers.py Lib/multiprocessing/forking.py Lib/multiprocessing/managers.py Lib/multiprocessing/sharedctypes.py Lib/multiprocessing/util.py Lib/smtplib.py Lib/test/test_capi.py Lib/test/test_codeccallbacks.py Lib/test/test_datetime.py Lib/test/test_importlib.py Lib/test/test_multiprocessing.py Lib/test/test_os.py Lib/test/test_xmlrpc.py Lib/zipfile.py Misc/NEWS Modules/_ctypes/libffi_msvc/ffi.c Objects/exceptions.c Objects/typeobject.c Python/ast.c Python/ceval.c Python/compile.c Message-ID: <20090119003146.D9F7D1E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 19 01:31:45 2009 New Revision: 68757 Log: Merged revisions 68686,68690-68691,68695-68696,68698,68700-68702,68707,68709,68712,68716-68717,68719,68728-68730,68732,68736,68740,68744,68746,68749,68751 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68686 | benjamin.peterson | 2009-01-18 00:28:17 +0100 (dim., 18 janv. 2009) | 50 lines I'm just going to assume that all of these revisions don't need to be merge, since it's not indicated: Blocked revisions 68559,68562,68565-68567,68569,68603-68605 via svnmerge ........ r68559 | raymond.hettinger | 2009-01-12 16:58:41 -0600 (Mon, 12 Jan 2009) | 1 line Issue 1696199: Add collections.Counter(). ........ r68562 | raymond.hettinger | 2009-01-12 19:05:03 -0600 (Mon, 12 Jan 2009) | 7 lines Simplify Counter() API. Replace items keyword argument with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work. ........ r68565 | raymond.hettinger | 2009-01-12 21:49:43 -0600 (Mon, 12 Jan 2009) | 1 line Minor documentation tweaks and simpler update() example. ........ r68566 | raymond.hettinger | 2009-01-12 22:13:53 -0600 (Mon, 12 Jan 2009) | 1 line Fixup and simplify docstrings and doctests. ........ r68567 | raymond.hettinger | 2009-01-12 22:50:35 -0600 (Mon, 12 Jan 2009) | 1 line Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. ........ r68569 | raymond.hettinger | 2009-01-13 02:38:14 -0600 (Tue, 13 Jan 2009) | 7 lines Add table of idioms/patterns for using Counter objects. Improve the appearance and flow of the References section -- it used to have a box around it that wasn't distinct from the preceding code boxes and it had a weird bolding pattern and hanging indents that made the section disproportionately large. ........ r68603 | raymond.hettinger | 2009-01-13 18:15:21 -0600 (Tue, 13 Jan 2009) | 1 line Minor doc tweaks. ........ r68604 | raymond.hettinger | 2009-01-13 19:15:06 -0600 (Tue, 13 Jan 2009) | 1 line Add tests for __init__() and update() with no args. ........ r68605 | raymond.hettinger | 2009-01-13 19:39:51 -0600 (Tue, 13 Jan 2009) | 1 line Fix-up indentation of sample code blocks for namedtuple mthod definitions. ........ ................ r68690 | benjamin.peterson | 2009-01-18 00:43:58 +0100 (dim., 18 janv. 2009) | 9 lines Merged revisions 68460 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68460 | kristjan.jonsson | 2009-01-09 14:31:26 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4293: Make Py_AddPendingCall() thread safe ........ ................ r68691 | benjamin.peterson | 2009-01-18 00:46:54 +0100 (dim., 18 janv. 2009) | 1 line fix compiler warning ................ r68695 | benjamin.peterson | 2009-01-18 01:04:57 +0100 (dim., 18 janv. 2009) | 9 lines Merged revisions 68458 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68458 | kristjan.jonsson | 2009-01-09 14:23:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. ........ ................ r68696 | benjamin.peterson | 2009-01-18 01:08:45 +0100 (dim., 18 janv. 2009) | 9 lines Merged revisions 68459 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68459 | kristjan.jonsson | 2009-01-09 14:27:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. ........ ................ r68698 | brett.cannon | 2009-01-18 01:24:28 +0100 (dim., 18 janv. 2009) | 6 lines Add initial implementation of importlib. See the NOTES files for what is planned for the package. There are no docs yet, but they are coming once the API for the first new function, importlib.import_module() is finalized. ................ r68700 | amaury.forgeotdarc | 2009-01-18 01:29:02 +0100 (dim., 18 janv. 2009) | 10 lines Merged revisions 68678 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68678 | amaury.forgeotdarc | 2009-01-17 23:43:50 +0100 (Sat, 17 Jan 2009) | 3 lines follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format, always try to read the "zip64 end of directory structure". ........ ................ r68701 | brett.cannon | 2009-01-18 01:36:22 +0100 (dim., 18 janv. 2009) | 2 lines Skip over any file or folder that starts with a dot (e.g. .svn). ................ r68702 | brett.cannon | 2009-01-18 01:36:55 +0100 (dim., 18 janv. 2009) | 2 lines NOTES for importlib should mention the ultimate end-goal for the package. ................ r68707 | benjamin.peterson | 2009-01-18 02:29:28 +0100 (dim., 18 janv. 2009) | 8 lines Blocked revisions 68705 via svnmerge ........ r68705 | benjamin.peterson | 2009-01-17 19:28:09 -0600 (Sat, 17 Jan 2009) | 1 line bytearrays are mutable sequences ........ ................ r68709 | jesse.noller | 2009-01-18 04:11:38 +0100 (dim., 18 janv. 2009) | 1 line Merge r68708 to py3k, fixes 4449 ................ r68712 | brett.cannon | 2009-01-18 07:55:05 +0100 (dim., 18 janv. 2009) | 5 lines Tests of case-sensitivity were being executed on OSs which did not have a case-insensitive file system, leading to test failures. This was due to using the TestCase objects directly instead of the guard in the test_main() function. Move over to a class decorator instead to control if the tests should be run. ................ r68716 | georg.brandl | 2009-01-18 11:38:16 +0100 (dim., 18 janv. 2009) | 1 line #4984: fix number of types. ................ r68717 | georg.brandl | 2009-01-18 11:40:25 +0100 (dim., 18 janv. 2009) | 1 line #4983: clarify what "byte sequence" is. ................ r68719 | georg.brandl | 2009-01-18 11:43:58 +0100 (dim., 18 janv. 2009) | 1 line #4975: fix bytes/str issue. ................ r68728 | jesse.noller | 2009-01-18 20:44:02 +0100 (dim., 18 janv. 2009) | 1 line Issues #10867: remove old cPickle imports from multiprocessing ................ r68729 | jesse.noller | 2009-01-18 20:45:18 +0100 (dim., 18 janv. 2009) | 1 line Correct issue number for 68728 checkin ................ r68730 | martin.v.loewis | 2009-01-18 21:15:42 +0100 (dim., 18 janv. 2009) | 2 lines Issue #4008: Fix problems with non-ASCII source files. ................ r68732 | martin.v.loewis | 2009-01-18 21:23:36 +0100 (dim., 18 janv. 2009) | 3 lines Issue #4815: Offer conversion to UTF-8 if source files have no encoding declaration and are not encoded in UTF-8. ................ r68736 | benjamin.peterson | 2009-01-18 22:02:37 +0100 (dim., 18 janv. 2009) | 40 lines Merged revisions 68547,68607,68610,68618,68621-68622,68649,68722 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68547 | kristjan.jonsson | 2009-01-12 12:09:27 -0600 (Mon, 12 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ........ r68607 | kristjan.jonsson | 2009-01-14 04:50:57 -0600 (Wed, 14 Jan 2009) | 2 lines Re-enable all tests for windows platforms. Also, explicitly connect to the IPV4 address. On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect. It would try connecting using AF_INET6 first and this would cause a delay of up to a second. ........ r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. ........ r68618 | kristjan.jonsson | 2009-01-15 11:20:21 -0600 (Thu, 15 Jan 2009) | 1 line Issue 4929: Handle socket errors when receiving ........ r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. ........ r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line Make all the invalid fd tests for os subject to the function being available. ........ r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line trying to find some fpathconf() settings that all unixs support... ........ r68722 | kristjan.jonsson | 2009-01-18 04:58:44 -0600 (Sun, 18 Jan 2009) | 1 line issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16. ........ ................ r68740 | jesse.noller | 2009-01-18 22:12:58 +0100 (dim., 18 janv. 2009) | 1 line merge cl r68737 to py3k ................ r68744 | benjamin.peterson | 2009-01-18 23:10:38 +0100 (dim., 18 janv. 2009) | 14 lines Merged revisions 68568,68665 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68568 | georg.brandl | 2009-01-13 02:11:07 -0600 (Tue, 13 Jan 2009) | 2 lines Fix call signature and markup. ........ r68665 | amaury.forgeotdarc | 2009-01-17 11:11:50 -0600 (Sat, 17 Jan 2009) | 3 lines #4930: Slightly cleaner (and faster) code in type creation: compare slots by address, not by name. ........ ................ r68746 | benjamin.peterson | 2009-01-18 23:27:04 +0100 (dim., 18 janv. 2009) | 55 lines Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines Change an example in the docs to avoid a mistake when the code is copy pasted and changed afterwards. ........ r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line use enumerate ........ r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h ........ r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line fix grammar ........ r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line #4976: union() and intersection() take multiple args, but talk about "the other". ........ r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line #4974: fix redundant mention of lists and tuples. ........ r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line #4914: trunc is in math. ........ r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line #4979: correct result range for some random functions. ........ r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line #4857: fix augmented assignment target spec. ........ r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line #4923: clarify what was added. ........ r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line #4986: augassigns are not expressions. ........ r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line fix test that wasn't working as expected #4990 ........ ................ r68749 | benjamin.peterson | 2009-01-18 23:46:33 +0100 (dim., 18 janv. 2009) | 9 lines Merged revisions 68546 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68546 | raymond.hettinger | 2009-01-12 04:37:32 -0600 (Mon, 12 Jan 2009) | 1 line Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size. ........ ................ r68751 | benjamin.peterson | 2009-01-18 23:58:55 +0100 (dim., 18 janv. 2009) | 16 lines Blocked revisions 68544-68545,68597 via svnmerge ........ r68544 | kristjan.jonsson | 2009-01-12 03:20:34 -0600 (Mon, 12 Jan 2009) | 1 line Update Misc/NEWS for issue 3582 ........ r68545 | kristjan.jonsson | 2009-01-12 03:24:04 -0600 (Mon, 12 Jan 2009) | 1 line Misc/NEWS for issue 4293 ........ r68597 | benjamin.peterson | 2009-01-13 17:43:50 -0600 (Tue, 13 Jan 2009) | 1 line fix test_xmlrpc failures #4939 ........ ................ Added: python/branches/io-c/Lib/importlib/ - copied from r68751, /python/branches/py3k/Lib/importlib/ python/branches/io-c/Lib/test/test_importlib.py - copied unchanged from r68751, /python/branches/py3k/Lib/test/test_importlib.py Modified: python/branches/io-c/ (props changed) python/branches/io-c/Doc/c-api/init.rst python/branches/io-c/Doc/library/base64.rst python/branches/io-c/Doc/library/ctypes.rst python/branches/io-c/Doc/library/datetime.rst python/branches/io-c/Doc/library/multiprocessing.rst python/branches/io-c/Doc/library/random.rst python/branches/io-c/Doc/library/stdtypes.rst python/branches/io-c/Doc/reference/datamodel.rst python/branches/io-c/Doc/reference/simple_stmts.rst python/branches/io-c/Doc/tools/rstlint.py python/branches/io-c/Lib/heapq.py python/branches/io-c/Lib/http/client.py python/branches/io-c/Lib/idlelib/IOBinding.py python/branches/io-c/Lib/idlelib/NEWS.txt python/branches/io-c/Lib/idlelib/ScriptBinding.py python/branches/io-c/Lib/inspect.py python/branches/io-c/Lib/logging/__init__.py python/branches/io-c/Lib/logging/handlers.py python/branches/io-c/Lib/multiprocessing/forking.py python/branches/io-c/Lib/multiprocessing/managers.py python/branches/io-c/Lib/multiprocessing/sharedctypes.py python/branches/io-c/Lib/multiprocessing/util.py python/branches/io-c/Lib/smtplib.py python/branches/io-c/Lib/test/test_capi.py python/branches/io-c/Lib/test/test_codeccallbacks.py python/branches/io-c/Lib/test/test_datetime.py python/branches/io-c/Lib/test/test_multiprocessing.py python/branches/io-c/Lib/test/test_os.py python/branches/io-c/Lib/test/test_xmlrpc.py python/branches/io-c/Lib/zipfile.py python/branches/io-c/Misc/NEWS python/branches/io-c/Modules/_ctypes/libffi_msvc/ffi.c python/branches/io-c/Objects/exceptions.c python/branches/io-c/Objects/typeobject.c python/branches/io-c/Python/ast.c python/branches/io-c/Python/ceval.c python/branches/io-c/Python/compile.c 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 Mon Jan 19 01:31:45 2009 @@ -782,13 +782,13 @@ convenience by the main thread where it has possession of the global interpreter lock and can perform any Python API calls. -.. cfunction:: void Py_AddPendingCall( int (*func)(void *), void *arg) ) +.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) ) .. index:: single: Py_AddPendingCall() Post a notification to the Python main thread. If successful, - \*:attr`func` will be called with the argument :attr:`arg` at the earliest - convenience. \*:attr:`func` will be called having the global interpreter + *func* will be called with the argument *arg* at the earliest + convenience. *func* will be called having the global interpreter lock held and can thus use the full Python API and can take any action such as setting object attributes to signal IO completion. It must return 0 on success, or -1 signalling an exception. 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 Mon Jan 19 01:31:45 2009 @@ -154,7 +154,7 @@ >>> import base64 >>> encoded = base64.b64encode('data to be encoded') >>> encoded - 'ZGF0YSB0byBiZSBlbmNvZGVk' + b'ZGF0YSB0byBiZSBlbmNvZGVk' >>> data = base64.b64decode(encoded) >>> data 'data to be encoded' 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 Mon Jan 19 01:31:45 2009 @@ -2406,10 +2406,10 @@ ("hreftype", HREFTYPE)] class TYPEDESC(Structure): + _anonymous_ = ("u",) _fields_ = [("u", _U), ("vt", VARTYPE)] - _anonymous_ = ("u",) The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field 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 Mon Jan 19 01:31:45 2009 @@ -1494,10 +1494,6 @@ 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. - For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty strings. @@ -1616,7 +1612,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/io-c/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/io-c/Doc/library/multiprocessing.rst (original) +++ python/branches/io-c/Doc/library/multiprocessing.rst Mon Jan 19 01:31:45 2009 @@ -878,7 +878,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, *args, lock]]) +.. function:: Value(typecode_or_type, *args[, lock]) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -960,7 +960,7 @@ *typecode_or_type* determines the type of the returned object: it is either a ctypes type or a one character typecode of the kind used by the :mod:`array` - module. */*args* is passed on to the constructor for the type. + module. *\*args* is passed on to the constructor for the type. Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized @@ -970,7 +970,7 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]]) +.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock]) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes 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 Mon Jan 19 01:31:45 2009 @@ -149,13 +149,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. @@ -163,8 +163,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) @@ -178,14 +178,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/io-c/Doc/library/stdtypes.rst ============================================================================== --- python/branches/io-c/Doc/library/stdtypes.rst (original) +++ python/branches/io-c/Doc/library/stdtypes.rst Mon Jan 19 01:31:45 2009 @@ -343,19 +343,19 @@ All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+--------------------------------+--------+ -| Operation | Result | Notes | -+====================+================================+========+ -| ``trunc(x)`` | *x* truncated to Integral | | -+--------------------+--------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+--------------------------------+--------+ -| ``math.floor(x)`` | the greatest Integral <= *x* | | -+--------------------+--------------------------------+--------+ -| ``math.ceil(x)`` | the least Integral >= *x* | | -+--------------------+--------------------------------+--------+ ++--------------------+------------------------------------+--------+ +| Operation | Result | Notes | ++====================+====================================+========+ +| ``math.trunc(x)`` | *x* truncated to Integral | | ++--------------------+------------------------------------+--------+ +| ``round(x[, n])`` | *x* rounded to n digits, | | +| | rounding half to even. If n is | | +| | omitted, it defaults to 0. | | ++--------------------+------------------------------------+--------+ +| ``math.floor(x)`` | the greatest integral float <= *x* | | ++--------------------+------------------------------------+--------+ +| ``math.ceil(x)`` | the least integral float >= *x* | | ++--------------------+------------------------------------+--------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. @@ -594,16 +594,17 @@ Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`list`, :class:`tuple`, :class:`range` ================================================================================================================== -There are five sequence types: strings, byte sequences, byte arrays, lists, -tuples, and range objects. (For other containers see the built-in -:class:`dict`, :class:`list`, :class:`set`, and :class:`tuple` classes, and the -:mod:`collections` module.) +There are six sequence types: strings, byte sequences (:class:`bytes` objects), +byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. For +other containers see the built in :class:`dict` and :class:`set` classes, and +the :mod:`collections` module. + .. index:: object: sequence object: string object: bytes - object: buffer + object: bytearray object: tuple object: list object: range @@ -1622,12 +1623,12 @@ .. 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. .. 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. .. method:: difference(other, ...) set - other - ... 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 Mon Jan 19 01:31:45 2009 @@ -317,7 +317,7 @@ slicing notations can be used as the target of assignment and :keyword:`del` (delete) statements. - There is currently a single intrinsic mutable sequence type: + There are currently two intrinsic mutable sequence types: Lists .. index:: object: list @@ -1777,13 +1777,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``. 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 Mon Jan 19 01:31:45 2009 @@ -246,7 +246,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/io-c/Doc/tools/rstlint.py ============================================================================== --- python/branches/io-c/Doc/tools/rstlint.py (original) +++ python/branches/io-c/Doc/tools/rstlint.py Mon Jan 19 01:31:45 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/io-c/Lib/heapq.py ============================================================================== --- python/branches/io-c/Lib/heapq.py (original) +++ python/branches/io-c/Lib/heapq.py Mon Jan 19 01:31:45 2009 @@ -129,7 +129,7 @@ __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge', 'nlargest', 'nsmallest', 'heappushpop'] -from itertools import islice, repeat, count, tee +from itertools import islice, repeat, count, tee, chain from operator import itemgetter, neg import bisect @@ -354,10 +354,32 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + # Short-cut for n==1 is to use min() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [min(chain(head, it))] + return [min(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key)[:n] + + # When key is none, use simpler decoration if key is None: it = zip(iterable, count()) # decorate result = _nsmallest(n, it) return list(map(itemgetter(0), result)) # undecorate + + # General case, slowest method in1, in2 = tee(iterable) it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) @@ -369,10 +391,33 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + + # Short-cut for n==1 is to use max() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [max(chain(head, it))] + return [max(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key, reverse=True)[:n] + + # When key is none, use simpler decoration if key is None: it = zip(iterable, map(neg, count())) # 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 result = _nlargest(n, it) 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 Mon Jan 19 01:31:45 2009 @@ -697,6 +697,7 @@ """Send the currently buffered request and clear the buffer. Appends an extra \\r\\n to the buffer. + A message_body may be specified, to be appended to the request. """ self._buffer.extend((b"", b"")) msg = b"\r\n".join(self._buffer) @@ -704,9 +705,14 @@ # If msg and message_body are sent in a single send() call, # it will avoid performance problems caused by the interaction # between delayed ack and the Nagle algorithim. - if message_body is not None: + if isinstance(message_body, bytes): msg += message_body + message_body = None self.send(msg) + if message_body is not None: + #message_body was not a string (i.e. it is a file) and + #we must run the risk of Nagle + self.send(message_body) def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): """Send a request to the server. @@ -894,12 +900,7 @@ self._set_content_length(body) for hdr, value in headers.items(): self.putheader(hdr, value) - if isinstance(body, str): - self.endheaders(body.encode('ascii')) - else: - self.endheaders() - if body: # when body is a file rather than a string - self.send(body) + self.endheaders(body.encode('ascii') if isinstance(body, str) else body) def getresponse(self): """Get the response from the server.""" Modified: python/branches/io-c/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/io-c/Lib/idlelib/IOBinding.py (original) +++ python/branches/io-c/Lib/idlelib/IOBinding.py Mon Jan 19 01:31:45 2009 @@ -7,7 +7,7 @@ import tkinter.messagebox as tkMessageBox import re from tkinter import * -from tkinter.simpledialog import SimpleDialog +from tkinter.simpledialog import askstring from idlelib.configHandler import idleConf @@ -74,10 +74,11 @@ Raise a LookupError if the encoding is declared but unknown. """ if isinstance(data, bytes): - try: - lines = data.decode('utf-8') - except UnicodeDecodeError: - return None + # This encoding might be wrong. However, the coding + # spec must be ASCII-only, so any non-ASCII characters + # around here will be ignored. Decoding to Latin-1 should + # never fail (except for memory outage) + lines = data.decode('iso-8859-1') else: lines = data # consider only the first two lines @@ -210,7 +211,7 @@ except IOError as msg: tkMessageBox.showerror("I/O Error", str(msg), master=self.text) return False - chars = self._decode(two_lines, bytes) + chars, converted = self._decode(two_lines, bytes) if chars is None: tkMessageBox.showerror("Decoding Error", "File %s\nFailed to Decode" % filename, @@ -226,6 +227,10 @@ self.text.insert("1.0", chars) self.reset_undo() self.set_filename(filename) + if converted: + # We need to save the conversion results first + # before being able to execute the code + self.set_saved(False) self.text.mark_set("insert", "1.0") self.text.see("insert") self.updaterecentfileslist(filename) @@ -240,11 +245,11 @@ chars = bytes[3:].decode("utf-8") except UnicodeDecodeError: # has UTF-8 signature, but fails to decode... - return None + return None, False else: # Indicates that this file originally had a BOM self.fileencoding = 'BOM' - return chars + return chars, False # Next look for coding specification try: enc = coding_spec(two_lines) @@ -256,36 +261,48 @@ master = self.text) enc = None except UnicodeDecodeError: - return None + return None, False if enc: try: chars = str(bytes, enc) self.fileencoding = enc - return chars + return chars, False except UnicodeDecodeError: pass # Try ascii: try: chars = str(bytes, 'ascii') self.fileencoding = None - return chars + return chars, False except UnicodeDecodeError: pass # Try utf-8: try: chars = str(bytes, 'utf-8') self.fileencoding = 'utf-8' - return chars + return chars, False except UnicodeDecodeError: pass # Finally, try the locale's encoding. This is deprecated; # the user should declare a non-ASCII encoding try: - chars = str(bytes, locale_encoding) - self.fileencoding = locale_encoding - except UnicodeDecodeError: + # Wait for the editor window to appear + self.editwin.text.update() + enc = askstring( + "Specify file encoding", + "The file's encoding is invalid for Python 3.x.\n" + "IDLE will convert it to UTF-8.\n" + "What is the current encoding of the file?", + initialvalue = locale_encoding, + parent = self.editwin.text) + + if enc: + chars = str(bytes, enc) + self.fileencoding = None + return chars, True + except (UnicodeDecodeError, LookupError): pass - return chars # None on failure + return None, False # None on failure def maybesave(self): if self.get_saved(): 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 Mon Jan 19 01:31:45 2009 @@ -3,6 +3,11 @@ *Release date: XX-XXX-XXXX* +- Issue #4815: Offer conversion to UTF-8 if source files have + no encoding declaration and are not encoded in UTF-8. + +- Issue #4008: Fix problems with non-ASCII source files. + - Issue #4323: Always encode source as UTF-8 without asking the user (unless a different encoding is declared); remove user configuration of source encoding; all according to Modified: python/branches/io-c/Lib/idlelib/ScriptBinding.py ============================================================================== --- python/branches/io-c/Lib/idlelib/ScriptBinding.py (original) +++ python/branches/io-c/Lib/idlelib/ScriptBinding.py Mon Jan 19 01:31:45 2009 @@ -24,7 +24,7 @@ import tokenize import tkinter.messagebox as tkMessageBox from idlelib.EditorWindow import EditorWindow -from idlelib import PyShell +from idlelib import PyShell, IOBinding from idlelib.configHandler import idleConf @@ -62,7 +62,13 @@ return 'break' def tabnanny(self, filename): - f = open(filename, 'r') + # XXX: tabnanny should work on binary files as well + with open(filename, 'r', encoding='iso-8859-1') as f: + two_lines = f.readline() + f.readline() + encoding = IOBinding.coding_spec(two_lines) + if not encoding: + encoding = 'utf-8' + f = open(filename, 'r', encoding=encoding) try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError as msg: @@ -82,14 +88,14 @@ self.shell = shell = self.flist.open_shell() saved_stream = shell.get_warning_stream() shell.set_warning_stream(shell.stderr) - f = open(filename, 'r') + f = open(filename, 'rb') source = f.read() f.close() - if '\r' in source: - source = re.sub(r"\r\n", "\n", source) - source = re.sub(r"\r", "\n", source) - if source and source[-1] != '\n': - source = source + '\n' + if b'\r' in source: + source = source.replace(b'\r\n', b'\n') + source = source.replace(b'\r', b'\n') + if source and source[-1] != ord(b'\n'): + source = source + b'\n' editwin = self.editwin text = editwin.text text.tag_remove("ERROR", "1.0", "end") Modified: python/branches/io-c/Lib/inspect.py ============================================================================== --- python/branches/io-c/Lib/inspect.py (original) +++ python/branches/io-c/Lib/inspect.py Mon Jan 19 01:31:45 2009 @@ -881,8 +881,8 @@ specs = [] if defaults: firstdefault = len(args) - len(defaults) - for i in range(len(args)): - spec = strseq(args[i], formatargandannotation, join) + for i, arg in enumerate(args): + spec = strseq(arg, formatargandannotation, join) if defaults and i >= firstdefault: spec = spec + formatvalue(defaults[i - firstdefault]) specs.append(spec) 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 Mon Jan 19 01:31:45 2009 @@ -99,6 +99,11 @@ logThreads = 1 # +# If you don't want multiprocessing information in the log, set this to zero +# +logMultiprocessing = 1 + +# # If you don't want process information in the log, set this to zero # logProcesses = 1 @@ -263,6 +268,11 @@ else: self.thread = None self.threadName = None + if logMultiprocessing: + from multiprocessing import current_process + self.processName = current_process().name + else: + self.processName = None if logProcesses and hasattr(os, 'getpid'): self.process = os.getpid() else: Modified: python/branches/io-c/Lib/logging/handlers.py ============================================================================== --- python/branches/io-c/Lib/logging/handlers.py (original) +++ python/branches/io-c/Lib/logging/handlers.py Mon Jan 19 01:31:45 2009 @@ -1024,9 +1024,7 @@ h.putheader("Content-type", "application/x-www-form-urlencoded") h.putheader("Content-length", str(len(data))) - h.endheaders() - if self.method == "POST": - h.send(data) + h.endheaders(data if self.method == "POST" else None) h.getreply() #can't do anything with the result except (KeyboardInterrupt, SystemExit): raise Modified: python/branches/io-c/Lib/multiprocessing/forking.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/forking.py (original) +++ python/branches/io-c/Lib/multiprocessing/forking.py Mon Jan 19 01:31:45 2009 @@ -151,14 +151,10 @@ import _subprocess import time + from pickle import dump, load, HIGHEST_PROTOCOL from ._multiprocessing import win32, Connection, PipeConnection from .util import Finalize - #try: - # from cPickle import dump, load, HIGHEST_PROTOCOL - #except ImportError: - from pickle import load, HIGHEST_PROTOCOL - def dump(obj, file, protocol=None): ForkingPickler(file, protocol).dump(obj) Modified: python/branches/io-c/Lib/multiprocessing/managers.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/managers.py (original) +++ python/branches/io-c/Lib/multiprocessing/managers.py Mon Jan 19 01:31:45 2009 @@ -21,16 +21,12 @@ import queue from traceback import format_exc +from pickle import PicklingError from multiprocessing import Process, current_process, active_children, Pool, util, connection from multiprocessing.process import AuthenticationString from multiprocessing.forking import exit, Popen, assert_spawning, ForkingPickler from multiprocessing.util import Finalize, info -try: - from cPickle import PicklingError -except ImportError: - from pickle import PicklingError - # # Register some things for pickling # Modified: python/branches/io-c/Lib/multiprocessing/sharedctypes.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/sharedctypes.py (original) +++ python/branches/io-c/Lib/multiprocessing/sharedctypes.py Mon Jan 19 01:31:45 2009 @@ -66,9 +66,12 @@ Return a synchronization wrapper for a Value ''' obj = RawValue(typecode_or_type, *args) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def Array(typecode_or_type, size_or_initializer, **kwds): @@ -79,9 +82,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % list(kwds.keys())) obj = RawArray(typecode_or_type, size_or_initializer) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def copy(obj): Modified: python/branches/io-c/Lib/multiprocessing/util.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/util.py (original) +++ python/branches/io-c/Lib/multiprocessing/util.py Mon Jan 19 01:31:45 2009 @@ -69,34 +69,10 @@ atexit._exithandlers.remove((_exit_function, (), {})) atexit._exithandlers.append((_exit_function, (), {})) - _check_logger_class() _logger = logging.getLogger(LOGGER_NAME) return _logger -def _check_logger_class(): - ''' - Make sure process name is recorded when loggers are used - ''' - # XXX This function is unnecessary once logging is patched - import logging - if hasattr(logging, 'multiprocessing'): - return - - logging._acquireLock() - try: - OldLoggerClass = logging.getLoggerClass() - if not getattr(OldLoggerClass, '_process_aware', False): - class ProcessAwareLogger(OldLoggerClass): - _process_aware = True - def makeRecord(self, *args, **kwds): - record = OldLoggerClass.makeRecord(self, *args, **kwds) - record.processName = current_process()._name - return record - logging.setLoggerClass(ProcessAwareLogger) - finally: - logging._releaseLock() - def log_to_stderr(level=None): ''' Turn on logging and add a handler which prints to stderr Modified: python/branches/io-c/Lib/smtplib.py ============================================================================== --- python/branches/io-c/Lib/smtplib.py (original) +++ python/branches/io-c/Lib/smtplib.py Mon Jan 19 01:31:45 2009 @@ -336,7 +336,10 @@ if self.file is None: self.file = self.sock.makefile('rb') while 1: - line = self.file.readline() + try: + line = self.file.readline() + except socket.error: + line = '' if not line: self.close() raise SMTPServerDisconnected("Connection unexpectedly closed") Modified: python/branches/io-c/Lib/test/test_capi.py ============================================================================== --- python/branches/io-c/Lib/test/test_capi.py (original) +++ python/branches/io-c/Lib/test/test_capi.py Mon Jan 19 01:31:45 2009 @@ -1,6 +1,7 @@ # Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. +from __future__ import with_statement import sys import time import random @@ -49,39 +50,61 @@ if _testcapi._pending_threadfunc(callback): break; - def pendingcalls_wait(self, l, n): + def pendingcalls_wait(self, l, n, context = None): #now, stick around until l[0] has grown to 10 count = 0; while len(l) != n: #this busy loop is where we expect to be interrupted to #run our callbacks. Note that callbacks are only run on the #main thread - if False and test_support.verbose: + if False and support.verbose: print("(%i)"%(len(l),),) for i in range(1000): a = i*i + if context and not context.event.is_set(): + continue count += 1 self.failUnless(count < 10000, "timeout waiting for %i callbacks, got %i"%(n, len(l))) - if False and test_support.verbose: + if False and support.verbose: print("(%i)"%(len(l),)) def test_pendingcalls_threaded(self): - l = [] #do every callback on a separate thread - n = 32 + n = 32 #total callbacks threads = [] - for i in range(n): - t = threading.Thread(target=self.pendingcalls_submit, args = (l, 1)) + class foo(object):pass + context = foo() + context.l = [] + context.n = 2 #submits per thread + context.nThreads = n // context.n + context.nFinished = 0 + context.lock = threading.Lock() + context.event = threading.Event() + + for i in range(context.nThreads): + t = threading.Thread(target=self.pendingcalls_thread, args = (context,)) t.start() threads.append(t) - self.pendingcalls_wait(l, n) + self.pendingcalls_wait(context.l, n, context) for t in threads: t.join() + def pendingcalls_thread(self, context): + try: + self.pendingcalls_submit(context.l, context.n) + finally: + with context.lock: + context.nFinished += 1 + nFinished = context.nFinished + if False and support.verbose: + print("finished threads: ", nFinished) + if nFinished == context.nThreads: + context.event.set() + def test_pendingcalls_non_threaded(self): #again, just using the main thread, likely they will all be dispathced at #once. It is ok to ask for too many, because we loop until we find a slot. 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 Mon Jan 19 01:31:45 2009 @@ -592,7 +592,7 @@ encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15") for res in results: - codecs.register_error("test.badhandler", lambda: res) + codecs.register_error("test.badhandler", lambda x: res) for enc in encs: self.assertRaises( TypeError, Modified: python/branches/io-c/Lib/test/test_datetime.py ============================================================================== --- python/branches/io-c/Lib/test/test_datetime.py (original) +++ python/branches/io-c/Lib/test/test_datetime.py Mon Jan 19 01:31:45 2009 @@ -851,6 +851,23 @@ # A naive object replaces %z and %Z w/ empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + #make sure that invalid format specifiers are handled correctly + #self.assertRaises(ValueError, t.strftime, "%e") + #self.assertRaises(ValueError, t.strftime, "%") + #self.assertRaises(ValueError, t.strftime, "%#") + + #oh well, some systems just ignore those invalid ones. + #at least, excercise them to make sure that no crashes + #are generated + for f in ["%e", "%", "%#"]: + try: + t.strftime(f) + except ValueError: + pass + + #check that this standard extension works + t.strftime("%f") + def test_format(self): dt = self.theclass(2007, 9, 10) Modified: python/branches/io-c/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/io-c/Lib/test/test_multiprocessing.py (original) +++ python/branches/io-c/Lib/test/test_multiprocessing.py Mon Jan 19 01:31:45 2009 @@ -830,10 +830,16 @@ obj3 = val3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawValue('i', 5) + arr4 = self.Value('i', 5, lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue') + + arr5 = self.RawValue('i', 5) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) + class _TestArray(BaseTestCase): @@ -888,9 +894,15 @@ obj3 = arr3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawArray('i', list(range(10))) + arr4 = self.Array('i', range(10), lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, + self.Array, 'i', range(10), lock='notalock') + + arr5 = self.RawArray('i', range(10)) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) # # 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 Mon Jan 19 01:31:45 2009 @@ -587,6 +587,64 @@ def test_chmod(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) +class TestInvalidFD(unittest.TestCase): + singles = ["fchdir", "dup", "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 getattr(os, f, None): + self.assertRaises(OSError, getattr(os, f), 10) + return helper + for f in singles: + locals()["test_"+f] = get_single(f) + + def test_isatty(self): + if hasattr(os, "isatty"): + self.assertEqual(os.isatty(10), False) + + def test_closerange(self): + if hasattr(os, "closerange"): + self.assertEqual(os.closerange(10, 20), None) + + def test_dup2(self): + if hasattr(os, "dup2"): + self.assertRaises(OSError, os.dup2, 10, 20) + + def test_fchmod(self): + if hasattr(os, "fchmod"): + self.assertRaises(OSError, os.fchmod, 10, 0) + + def test_fchown(self): + if hasattr(os, "fchown"): + self.assertRaises(OSError, os.fchown, 10, -1, -1) + + def test_fpathconf(self): + if hasattr(os, "fpathconf"): + self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + + #this is a weird one, it raises IOError unlike the others + def test_ftruncate(self): + if hasattr(os, "ftruncate"): + self.assertRaises(IOError, os.ftruncate, 10, 0) + + def test_lseek(self): + if hasattr(os, "lseek"): + self.assertRaises(OSError, os.lseek, 10, 0, 0) + + def test_read(self): + if hasattr(os, "read"): + self.assertRaises(OSError, os.read, 10, 1) + + def test_tcsetpgrpt(self): + if hasattr(os, "tcsetpgrp"): + self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + + def test_write(self): + if hasattr(os, "write"): + self.assertRaises(OSError, os.write, 10, b" ") + if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): pass @@ -601,7 +659,8 @@ DevNullTests, URandomTests, ExecTests, - Win32ErrorTests + Win32ErrorTests, + TestInvalidFD ) if __name__ == "__main__": 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 Mon Jan 19 01:31:45 2009 @@ -232,7 +232,7 @@ self.assertEqual(str(t2), str(d, "latin-1")) -PORT = None +ADDR = PORT = URL = None # The evt is set twice. First when the server is ready to serve. # Second when the server has been shutdown. The user must clear @@ -258,12 +258,17 @@ s.setblocking(True) return s, port + serv = MyXMLRPCServer(("localhost", 0), + logRequests=False, bind_and_activate=False) try: - serv = MyXMLRPCServer(("localhost", 0), - logRequests=False, bind_and_activate=False) serv.server_bind() - global PORT - PORT = serv.socket.getsockname()[1] + global ADDR, PORT, URL + ADDR, PORT = serv.socket.getsockname() + #connect to IP address directly. This avoids socket.create_connection() + #trying to connect to to "localhost" using all address families, which + #causes slowdown e.g. on vista which supports AF_INET6. The server listens + #on AF_INET only. + URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() serv.register_introspection_functions() serv.register_multicall_functions() @@ -331,7 +336,7 @@ def test_simple1(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -343,7 +348,7 @@ def XXXtest_404(self): # send POST with http.client, it should return 404 header and # 'Not Found' message. - conn = http.client.HTTPConnection('localhost', PORT) + conn = httplib.client.HTTPConnection(ADDR, PORT) conn.request('POST', '/this-is-not-valid') response = conn.getresponse() conn.close() @@ -356,7 +361,7 @@ 'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall']) try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) meth = p.system.listMethods() self.assertEqual(set(meth), expected_methods) except (xmlrpclib.ProtocolError, socket.error) as e: @@ -369,7 +374,7 @@ def test_introspection2(self): try: # test _methodHelp() - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divhelp = p.system.methodHelp('div') self.assertEqual(divhelp, 'This is the div function') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -381,7 +386,7 @@ def test_introspection3(self): try: # test native doc - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) myfunction = p.system.methodHelp('my_function') self.assertEqual(myfunction, 'This is my function') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -394,7 +399,7 @@ # the SimpleXMLRPCServer doesn't support signatures, but # at least check that we can try making the call try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -405,7 +410,7 @@ def test_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) @@ -422,7 +427,7 @@ def test_non_existing_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.this_is_not_exists() result = multicall() @@ -491,7 +496,7 @@ # test a call that shouldn't fail just as a smoke test try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -504,7 +509,7 @@ xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -524,7 +529,7 @@ xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = True try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -605,15 +610,9 @@ def test_main(): xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase, BinaryTestCase, FaultTestCase] - - # The test cases against a SimpleXMLRPCServer raise a socket error - # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when - # run on Windows. This only happens on the first test to run, but it - # fails every time and so these tests are skipped on win32 platforms. - if sys.platform != 'win32': - xmlrpc_tests.append(SimpleServerTestCase) - xmlrpc_tests.append(FailingServerTestCase) - xmlrpc_tests.append(CGIHandlerTestCase) + xmlrpc_tests.append(SimpleServerTestCase) + xmlrpc_tests.append(FailingServerTestCase) + xmlrpc_tests.append(CGIHandlerTestCase) support.run_unittest(*xmlrpc_tests) Modified: python/branches/io-c/Lib/zipfile.py ============================================================================== --- python/branches/io-c/Lib/zipfile.py (original) +++ python/branches/io-c/Lib/zipfile.py Mon Jan 19 01:31:45 2009 @@ -210,13 +210,9 @@ # Append a blank comment and record start offset endrec.append(b"") endrec.append(filesize - sizeEndCentDir) - if endrec[_ECD_OFFSET] == 0xffffffff: - # the value for the "offset of the start of the central directory" - # indicates that there is a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, -sizeEndCentDir, endrec) - return endrec + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, -sizeEndCentDir, endrec) # Either this is not a ZIP file, or it is a ZIP file with an archive # comment. Search the end of the file for the "end of central directory" @@ -237,11 +233,10 @@ # Append the archive comment and start offset endrec.append(comment) endrec.append(maxCommentStart + start) - if endrec[_ECD_OFFSET] == 0xffffffff: - # There is apparently a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, start - filesize, endrec) - return endrec + + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, maxCommentStart + start - filesize, + endrec) # Unable to find a valid end of central directory structure return Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Mon Jan 19 01:31:45 2009 @@ -132,9 +132,21 @@ Library ------- +- Issue #4301: Patch the logging module to add processName support, remove + _check_logger_class from multiprocessing. + +- Issue #3325: Remove python2.x try: except: imports for old cPickle from + multiprocessing. + - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. +- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue + in sharedctypes.py. + +- Issue #1225107: inspect.isclass() returned True for instances with a custom + __getattr__. + - Issue #3826 and #4791: The socket module now closes the underlying socket appropriately when it is being used via socket.makefile() objects rather than delaying the close by waiting for garbage collection to do it. 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 Mon Jan 19 01:31:45 2009 @@ -34,7 +34,7 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -extern void Py_FatalError(char *msg); +extern void Py_FatalError(const char *msg); /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) Modified: python/branches/io-c/Objects/exceptions.c ============================================================================== --- python/branches/io-c/Objects/exceptions.c (original) +++ python/branches/io-c/Objects/exceptions.c Mon Jan 19 01:31:45 2009 @@ -1923,7 +1923,7 @@ PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) - Py_FatalError("Cannot pre-allocate MemoryError instance\n"); + Py_FatalError("Cannot pre-allocate MemoryError instance"); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) Modified: python/branches/io-c/Objects/typeobject.c ============================================================================== --- python/branches/io-c/Objects/typeobject.c (original) +++ python/branches/io-c/Objects/typeobject.c Mon Jan 19 01:31:45 2009 @@ -5650,7 +5650,7 @@ else if (Py_TYPE(descr) == &PyCFunction_Type && PyCFunction_GET_FUNCTION(descr) == (PyCFunction)tp_new_wrapper && - strcmp(p->name, "__new__") == 0) + ptr == (void**)&type->tp_new) { /* The __new__ wrapper is not a wrapper descriptor, so must be special-cased differently. @@ -5670,7 +5670,7 @@ point out a bug in this reasoning a beer. */ } else if (descr == Py_None && - strcmp(p->name, "__hash__") == 0) { + ptr == (void**)&type->tp_hash) { /* We specifically allow __hash__ to be set to None to prevent inheritance of the default implementation from object.__hash__ */ Modified: python/branches/io-c/Python/ast.c ============================================================================== --- python/branches/io-c/Python/ast.c (original) +++ python/branches/io-c/Python/ast.c Mon Jan 19 01:31:45 2009 @@ -191,7 +191,7 @@ default: { char buf[128]; - sprintf(buf, "Non-statement found: %d %d\n", + sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } Modified: python/branches/io-c/Python/ceval.c ============================================================================== --- python/branches/io-c/Python/ceval.c (original) +++ python/branches/io-c/Python/ceval.c Mon Jan 19 01:31:45 2009 @@ -205,6 +205,7 @@ #include "pythread.h" static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */ +static PyThread_type_lock pending_lock = 0; /* for pending calls */ static long main_thread = 0; int @@ -276,6 +277,7 @@ adding a new function to each thread_*.h. Instead, just create a new lock and waste a little bit of memory */ interpreter_lock = PyThread_allocate_lock(); + pending_lock = PyThread_allocate_lock(); PyThread_acquire_lock(interpreter_lock, 1); main_thread = PyThread_get_thread_ident(); @@ -348,19 +350,145 @@ #ifdef WITH_THREAD Any thread can schedule pending calls, but only the main thread will execute them. + There is no facility to schedule calls to a particular thread, but + that should be easy to change, should that ever be required. In + that case, the static variables here should go into the python + threadstate. #endif +*/ + +#ifdef WITH_THREAD + +/* The WITH_THREAD implementation is thread-safe. It allows + scheduling to be made from any thread, and even from an executing + callback. + */ + +#define NPENDINGCALLS 32 +static struct { + int (*func)(void *); + void *arg; +} pendingcalls[NPENDINGCALLS]; +static int pendingfirst = 0; +static int pendinglast = 0; +static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */ +static char pendingbusy = 0; + +int +Py_AddPendingCall(int (*func)(void *), void *arg) +{ + int i, j, result=0; + PyThread_type_lock lock = pending_lock; + + /* try a few times for the lock. Since this mechanism is used + * for signal handling (on the main thread), there is a (slim) + * chance that a signal is delivered on the same thread while we + * hold the lock during the Py_MakePendingCalls() function. + * This avoids a deadlock in that case. + * Note that signals can be delivered on any thread. In particular, + * on Windows, a SIGINT is delivered on a system-created worker + * thread. + * We also check for lock being NULL, in the unlikely case that + * this function is called before any bytecode evaluation takes place. + */ + if (lock != NULL) { + for (i = 0; i<100; i++) { + if (PyThread_acquire_lock(lock, NOWAIT_LOCK)) + break; + } + if (i == 100) + return -1; + } + + i = pendinglast; + j = (i + 1) % NPENDINGCALLS; + if (j == pendingfirst) { + result = -1; /* Queue full */ + } else { + pendingcalls[i].func = func; + pendingcalls[i].arg = arg; + pendinglast = j; + } + /* signal main loop */ + _Py_Ticker = 0; + pendingcalls_to_do = 1; + if (lock != NULL) + PyThread_release_lock(lock); + return result; +} - XXX WARNING! ASYNCHRONOUSLY EXECUTING CODE! +int +Py_MakePendingCalls(void) +{ + int i; + int r = 0; + + if (!pending_lock) { + /* initial allocation of the lock */ + pending_lock = PyThread_allocate_lock(); + if (pending_lock == NULL) + return -1; + } + + /* only service pending calls on main thread */ + if (main_thread && PyThread_get_thread_ident() != main_thread) + return 0; + /* don't perform recursive pending calls */ + if (pendingbusy) + return 0; + pendingbusy = 1; + /* perform a bounded number of calls, in case of recursion */ + for (i=0; iu->u_name), PyObject_REPR(c->u->u_ste->ste_id), From python-checkins at python.org Mon Jan 19 01:36:16 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 19 Jan 2009 01:36:16 +0100 (CET) Subject: [Python-checkins] r68758 - in python/branches/io-c/Lib/importlib: __init__.py _bootstrap.py Message-ID: <20090119003616.5784B1E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 19 01:36:16 2009 New Revision: 68758 Log: in importlib:_fileio._FileIO -> _io.FileIO Modified: python/branches/io-c/Lib/importlib/__init__.py python/branches/io-c/Lib/importlib/_bootstrap.py 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 Mon Jan 19 01:36:16 2009 @@ -112,12 +112,12 @@ except ImportError: raise ImportError('posix, nt, or os2 module required for importlib') _bootstrap._os = _os -import imp, sys, marshal, errno, _fileio +import imp, sys, marshal, errno, _io _bootstrap.imp = imp _bootstrap.sys = sys _bootstrap.marshal = marshal _bootstrap.errno = errno -_bootstrap._fileio = _fileio +_bootstrap._io = _io import _warnings _bootstrap._warnings = _warnings 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 Mon Jan 19 01:36:16 2009 @@ -431,7 +431,7 @@ if source_path is None: return None import tokenize - with closing(_fileio_FileIO(source_path, 'r')) as file: + with closing(_ioFileIO(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. @@ -448,7 +448,7 @@ source_path = self._source_path() if source_path is None: return None - with closing(_fileio._FileIO(source_path, 'r')) as bytes_file: + with closing(_io.FileIO(source_path, 'r')) as bytes_file: return bytes_file.read(), source_path @check_name @@ -463,7 +463,7 @@ path = self._bytecode_path() if path is None: return None - file = _fileio._FileIO(path, 'r') + file = _io.FileIO(path, 'r') try: with closing(file) as bytecode_file: data = bytecode_file.read() @@ -484,7 +484,7 @@ bytecode_path = self._bytecode_path() if not bytecode_path: bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0] - file = _fileio._FileIO(bytecode_path, 'w') + file = _io.FileIO(bytecode_path, 'w') try: with closing(file) as bytecode_file: bytecode_file.write(magic) @@ -579,7 +579,7 @@ def get_data(self, path): """Return the data from path as raw bytes.""" - return _fileio._FileIO(path, 'r').read() + return _io.FileIO(path, 'r').read() @check_name def is_package(self, fullname): From buildbot at python.org Mon Jan 19 02:30:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 01:30:48 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090119013049.0C7961E4002@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/46 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_bsddb3 test_datetime ====================================================================== 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 sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/68 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: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 19 07:33:19 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 19 Jan 2009 07:33:19 +0100 (CET) Subject: [Python-checkins] r68759 - in python/branches/release30-maint: Lib/tkinter/tix.py Message-ID: <20090119063319.DE3511E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Jan 19 07:33:19 2009 New Revision: 68759 Log: Merged revisions 68477 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68477 | hirokazu.yamamoto | 2009-01-10 21:15:23 +0900 | 1 line Fixed 2to3 issue on tix module. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/tkinter/tix.py Modified: python/branches/release30-maint/Lib/tkinter/tix.py ============================================================================== --- python/branches/release30-maint/Lib/tkinter/tix.py (original) +++ python/branches/release30-maint/Lib/tkinter/tix.py Mon Jan 19 07:33:19 2009 @@ -293,7 +293,7 @@ else: static_options = ['options'] - for k,v in cnf.items()[:]: + for k,v in list(cnf.items()): if k in static_options: extra = extra + ('-' + k, v) del cnf[k] @@ -448,7 +448,7 @@ # we must be careful not to destroy the frame widget since this # also destroys the parent NoteBook thus leading to an exception # in Tkinter when it finally calls Tcl to destroy the NoteBook - for c in self.children.values(): c.destroy() + for c in list(self.children.values()): c.destroy() if self._name in self.master.children: del self.master.children[self._name] if self._name in self.master.subwidget_list: From python-checkins at python.org Mon Jan 19 07:49:20 2009 From: python-checkins at python.org (vinay.sajip) Date: Mon, 19 Jan 2009 07:49:20 +0100 (CET) Subject: [Python-checkins] r68760 - python/trunk/Doc/library/logging.rst Message-ID: <20090119064920.1A18F1E4002@bag.python.org> Author: vinay.sajip Date: Mon Jan 19 07:49:19 2009 New Revision: 68760 Log: Added more cross-reference targets and tidied up list of useful handlers. Modified: python/trunk/Doc/library/logging.rst Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Mon Jan 19 07:49:19 2009 @@ -310,7 +310,7 @@ with the milliseconds tacked on at the end. The message format string uses ``%()s`` styled string -substitution; the possible keys are documented in :ref:`formatter-objects`. +substitution; the possible keys are documented in :ref:`formatter`. The following message format string will log the time in a human-readable format, the severity of the message, and the contents of the message, in that @@ -530,53 +530,49 @@ In addition to the base :class:`Handler` class, many useful subclasses are provided: -#. :class:`StreamHandler` instances send error messages to streams (file-like +#. :ref:`stream-handler` instances send error messages to streams (file-like objects). -#. :class:`FileHandler` instances send error messages to disk files. - -.. module:: logging.handlers +#. :ref:`file-handler` instances send error messages to disk files. #. :class:`BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated - directly. Instead, use :class:`RotatingFileHandler` or - :class:`TimedRotatingFileHandler`. + directly. Instead, use :ref:`rotating-file-handler` or + :ref:`timed-rotating-file-handler`. -#. :class:`RotatingFileHandler` instances send error messages to disk +#. :ref:`rotating-file-handler` instances send error messages to disk files, with support for maximum log file sizes and log file rotation. -#. :class:`TimedRotatingFileHandler` instances send error messages to +#. :ref:`timed-rotating-file-handler` instances send error messages to disk files, rotating the log file at certain timed intervals. -#. :class:`SocketHandler` instances send error messages to TCP/IP +#. :ref:`socket-handler` instances send error messages to TCP/IP sockets. -#. :class:`DatagramHandler` instances send error messages to UDP +#. :ref:`datagram-handler` instances send error messages to UDP sockets. -#. :class:`SMTPHandler` instances send error messages to a designated +#. :ref:`smtp-handler` instances send error messages to a designated email address. -#. :class:`SysLogHandler` instances send error messages to a Unix +#. :ref:`syslog-handler` instances send error messages to a Unix syslog daemon, possibly on a remote machine. -#. :class:`NTEventLogHandler` instances send error messages to a +#. :ref:`nt-eventlog-handler` instances send error messages to a Windows NT/2000/XP event log. -#. :class:`MemoryHandler` instances send error messages to a buffer +#. :ref:`memory-handler` instances send error messages to a buffer in memory, which is flushed whenever specific criteria are met. -#. :class:`HTTPHandler` instances send error messages to an HTTP +#. :ref:`http-handler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. -#. :class:`WatchedFileHandler` instances watch the file they are +#. :ref:`watched-file-handler` instances watch the file they are logging to. If the file changes, it is closed and reopened using the file name. This handler is only useful on Unix-like systems; Windows does not support the underlying mechanism used. -.. currentmodule:: logging - -#. :class:`NullHandler` instances do nothing with error messages. They are used +#. :ref:`null-handler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if the library user has not configured logging. See :ref:`library-config` for @@ -834,6 +830,7 @@ and 2.2.x, which do not include the :mod:`logging` package in the standard library. +.. _logger: Logger Objects -------------- @@ -1472,6 +1469,8 @@ 69 myapp.area2 ERROR The five boxing wizards jump quickly. +.. _handler: + Handler Objects --------------- @@ -1577,6 +1576,8 @@ :exc:`NotImplementedError`. +.. _stream-handler: + StreamHandler ^^^^^^^^^^^^^ @@ -1608,6 +1609,8 @@ no output, so an explicit :meth:`flush` call may be needed at times. +.. _file-handler: + FileHandler ^^^^^^^^^^^ @@ -1634,6 +1637,7 @@ Outputs the record to the file. +.. _null-handler: NullHandler ^^^^^^^^^^^ @@ -1657,6 +1661,8 @@ See :ref:`library-config` for more information on how to use :class:`NullHandler`. +.. _watched-file-handler: + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ @@ -1697,6 +1703,7 @@ changed. If it has, the existing stream is flushed and closed and the file opened again, before outputting the record to the file. +.. _rotating-file-handler: RotatingFileHandler ^^^^^^^^^^^^^^^^^^^ @@ -1737,6 +1744,7 @@ Outputs the record to the file, catering for rollover as described previously. +.. _timed-rotating-file-handler: TimedRotatingFileHandler ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1795,6 +1803,8 @@ Outputs the record to the file, catering for rollover as described above. +.. _socket-handler: + SocketHandler ^^^^^^^^^^^^^ @@ -1848,6 +1858,8 @@ partial sends which can happen when the network is busy. +.. _datagram-handler: + DatagramHandler ^^^^^^^^^^^^^^^ @@ -1881,6 +1893,8 @@ Send a pickled string to a socket. +.. _syslog-handler: + SysLogHandler ^^^^^^^^^^^^^ @@ -1918,6 +1932,8 @@ used to convert them to integers. +.. _nt-eventlog-handler: + NTEventLogHandler ^^^^^^^^^^^^^^^^^ @@ -1983,6 +1999,7 @@ lookup to get the message ID. This version returns 1, which is the base message ID in :file:`win32service.pyd`. +.. _smtp-handler: SMTPHandler ^^^^^^^^^^^ @@ -2014,6 +2031,7 @@ If you want to specify a subject line which is record-dependent, override this method. +.. _memory-handler: MemoryHandler ^^^^^^^^^^^^^ @@ -2084,6 +2102,8 @@ Checks for buffer full or a record at the *flushLevel* or higher. +.. _http-handler: + HTTPHandler ^^^^^^^^^^^ @@ -2105,7 +2125,7 @@ Sends the record to the Web server as an URL-encoded dictionary. -.. _formatter-objects: +.. _formatter: Formatter Objects ----------------- @@ -2229,11 +2249,12 @@ just uses :func:`traceback.print_exception`. The resulting string is returned. +.. _filter: Filter Objects -------------- -:class:`Filter`\ s can be used by :class:`Handler`\ s and :class:`Logger`\ s for +Filters can be used by :class:`Handler`\ s and :class:`Logger`\ s for more sophisticated filtering than is provided by levels. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with "A.B" will allow events logged by loggers @@ -2254,6 +2275,7 @@ yes. If deemed appropriate, the record may be modified in-place by this method. +.. _log-record: LogRecord Objects ----------------- @@ -2288,6 +2310,7 @@ Returns the message for this :class:`LogRecord` instance after merging any user-supplied arguments with the message. +.. _logger-adapter: LoggerAdapter Objects --------------------- From python-checkins at python.org Mon Jan 19 07:56:16 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 19 Jan 2009 07:56:16 +0100 (CET) Subject: [Python-checkins] r68761 - python/branches/py3k/Lib/importlib/_bootstrap.py Message-ID: <20090119065616.EFF651E4002@bag.python.org> Author: brett.cannon Date: Mon Jan 19 07:56:16 2009 New Revision: 68761 Log: Fix a typo in some code that is not tested or supported yet. Closes issue 4993. Thanks Antoine Pitrou for the catch. 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 Jan 19 07:56:16 2009 @@ -431,7 +431,7 @@ if source_path is None: return None import tokenize - with closing(_fileio_FileIO(source_path, 'r')) as file: + with closing(_fileio._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. From python-checkins at python.org Mon Jan 19 08:07:59 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 19 Jan 2009 08:07:59 +0100 (CET) Subject: [Python-checkins] r68762 - python/branches/py3k/Lib/importlib/test/__init__.py Message-ID: <20090119070759.4A7931E4002@bag.python.org> Author: brett.cannon Date: Mon Jan 19 08:07:58 2009 New Revision: 68762 Log: Remove a debugging print statement that accidentally got left in. 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 Mon Jan 19 08:07:58 2009 @@ -17,7 +17,6 @@ suite.addTest(module_tests) elif os.path.isdir(path): package_name = "{0}.{1}".format(package, name) - print(package_name) __import__(package_name, level=0) package_tests = getattr(sys.modules[package_name], 'test_suite')() suite.addTest(package_tests) From python-checkins at python.org Mon Jan 19 14:10:27 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Mon, 19 Jan 2009 14:10:27 +0100 (CET) Subject: [Python-checkins] r68763 - in python/trunk: Lib/test/test_os.py Modules/posixmodule.c Message-ID: <20090119131027.D27521E4002@bag.python.org> Author: kristjan.jonsson Date: Mon Jan 19 14:10:27 2009 New Revision: 68763 Log: Issue 4957 Let os.ftruncate raise OSError like documented. Modified: python/trunk/Lib/test/test_os.py python/trunk/Modules/posixmodule.c Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Mon Jan 19 14:10:27 2009 @@ -570,10 +570,9 @@ if hasattr(os, "fpathconf"): self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") - #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(IOError, os.ftruncate, 10, 0) + self.assertRaises(OSError, os.ftruncate, 10, 0) def test_lseek(self): if hasattr(os, "lseek"): Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Mon Jan 19 14:10:27 2009 @@ -6633,7 +6633,7 @@ res = ftruncate(fd, length); Py_END_ALLOW_THREADS if (res < 0) { - PyErr_SetFromErrno(PyExc_IOError); + posix_error(); return NULL; } Py_INCREF(Py_None); From buildbot at python.org Mon Jan 19 14:36:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 13:36:11 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090119133611.59ED21E4002@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/4497 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,vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 15:04:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 14:04:09 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090119140409.C50281E4002@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/917 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: kristjan.jonsson,vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ia64/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-ia64/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_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 19 16:04:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:04:35 +0100 (CET) Subject: [Python-checkins] r68764 - python/trunk Message-ID: <20090119150435.73AA11E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:04:35 2009 New Revision: 68764 Log: Removed merge tracking for "svnmerge" for svn+ssh://pythondev at svn.python.org/python/branches/trunk-math Modified: python/trunk/ (props changed) From python-checkins at python.org Mon Jan 19 16:06:01 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:06:01 +0100 (CET) Subject: [Python-checkins] r68765 - in python/branches/release26-maint: Lib/test/test_datetime.py Lib/test/test_os.py Message-ID: <20090119150601.755F81E4012@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:06:00 2009 New Revision: 68765 Log: Merged revisions 68610,68621-68622,68649 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. ........ r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. ........ r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line Make all the invalid fd tests for os subject to the function being available. ........ r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line trying to find some fpathconf() settings that all unixs support... ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_datetime.py python/branches/release26-maint/Lib/test/test_os.py Modified: python/branches/release26-maint/Lib/test/test_datetime.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_datetime.py (original) +++ python/branches/release26-maint/Lib/test/test_datetime.py Mon Jan 19 16:06:00 2009 @@ -857,9 +857,18 @@ self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") #make sure that invalid format specifiers are handled correctly - self.assertRaises(ValueError, t.strftime, "%e") - self.assertRaises(ValueError, t.strftime, "%") - self.assertRaises(ValueError, t.strftime, "%#") + #self.assertRaises(ValueError, t.strftime, "%e") + #self.assertRaises(ValueError, t.strftime, "%") + #self.assertRaises(ValueError, t.strftime, "%#") + + #oh well, some systems just ignore those invalid ones. + #at least, excercise them to make sure that no crashes + #are generated + for f in ["%e", "%", "%#"]: + try: + t.strftime(f) + except ValueError: + pass #check that this standard extension works t.strftime("%f") Modified: python/branches/release26-maint/Lib/test/test_os.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_os.py (original) +++ python/branches/release26-maint/Lib/test/test_os.py Mon Jan 19 16:06:00 2009 @@ -534,8 +534,10 @@ self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): - singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat", + singles = ["fchdir", "fdopen", "dup", "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 getattr(os, f, None): @@ -545,13 +547,16 @@ locals()["test_"+f] = get_single(f) def test_isatty(self): - self.assertEqual(os.isatty(10), False) + if hasattr(os, "isatty"): + self.assertEqual(os.isatty(10), False) def test_closerange(self): - self.assertEqual(os.closerange(10, 20), None) + if hasattr(os, "closerange"): + self.assertEqual(os.closerange(10, 20), None) def test_dup2(self): - self.assertRaises(OSError, os.dup2, 10, 20) + if hasattr(os, "dup2"): + self.assertRaises(OSError, os.dup2, 10, 20) def test_fchmod(self): if hasattr(os, "fchmod"): @@ -559,28 +564,32 @@ def test_fchown(self): if hasattr(os, "fchown"): - self.assertRaises(OSError, os.fchmod, 10, -1, -1) + self.assertRaises(OSError, os.fchown, 10, -1, -1) def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "foo") + self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(OSError, os.ftruncate, 10, 0) + self.assertRaises(IOError, os.ftruncate, 10, 0) def test_lseek(self): - self.assertRaises(OSError, os.lseek, 10, 0, 0) + if hasattr(os, "lseek"): + self.assertRaises(OSError, os.lseek, 10, 0, 0) def test_read(self): - self.assertRaises(OSError, os.read, 10, 1) + if hasattr(os, "read"): + self.assertRaises(OSError, os.read, 10, 1) def test_tcsetpgrpt(self): if hasattr(os, "tcsetpgrp"): self.assertRaises(OSError, os.tcsetpgrp, 10, 0) def test_write(self): - self.assertRaises(OSError, os.write, 10, " ") + if hasattr(os, "write"): + self.assertRaises(OSError, os.write, 10, " ") if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): From python-checkins at python.org Mon Jan 19 16:06:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:06:33 +0100 (CET) Subject: [Python-checkins] r68766 - python/trunk Message-ID: <20090119150633.E1C761E403B@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:06:33 2009 New Revision: 68766 Log: Removed merge tracking for "svnmerge" for svn+ssh://pythondev at svn.python.org/python/branches/tnelson-trunk-bsddb-47-upgrade Modified: python/trunk/ (props changed) From python-checkins at python.org Mon Jan 19 16:11:52 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:11:52 +0100 (CET) Subject: [Python-checkins] r68767 - in python/branches/py3k: Lib/test/test_fileio.py Modules/_fileio.c Message-ID: <20090119151152.0F05F1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:11:51 2009 New Revision: 68767 Log: Merged revisions 68755 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68755 | benjamin.peterson | 2009-01-18 18:08:08 -0600 (Sun, 18 Jan 2009) | 1 line raise an OSError for invalid fds #4991 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_fileio.py python/branches/py3k/Modules/_fileio.c Modified: python/branches/py3k/Lib/test/test_fileio.py ============================================================================== --- python/branches/py3k/Lib/test/test_fileio.py (original) +++ python/branches/py3k/Lib/test/test_fileio.py Mon Jan 19 16:11:51 2009 @@ -175,6 +175,10 @@ f.close() os.unlink(TESTFN) + def testInvalidFd(self): + self.assertRaises(ValueError, _fileio._FileIO, -10) + self.assertRaises(OSError, _fileio._FileIO, 10) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Mon Jan 19 16:11:51 2009 @@ -138,6 +138,24 @@ return 0; } +static int +check_fd(int fd) +{ +#if defined(HAVE_FSTAT) + struct stat buf; + if (fstat(fd, &buf) < 0 && errno == EBADF) { + PyObject *exc; + char *msg = strerror(EBADF); + exc = PyObject_CallFunction(PyExc_OSError, "(is)", + EBADF, msg); + PyErr_SetObject(PyExc_OSError, exc); + Py_XDECREF(exc); + return -1; + } +#endif + return 0; +} + static int fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) @@ -170,6 +188,8 @@ "Negative filedescriptor"); return -1; } + if (check_fd(fd)) + return -1; } else { PyErr_Clear(); From python-checkins at python.org Mon Jan 19 16:12:23 2009 From: python-checkins at python.org (jesse.noller) Date: Mon, 19 Jan 2009 16:12:23 +0100 (CET) Subject: [Python-checkins] r68768 - in python/trunk: Lib/test/test_multiprocessing.py Misc/NEWS Modules/_multiprocessing/connection.h Modules/_multiprocessing/socket_connection.c Message-ID: <20090119151223.07BAC1E4002@bag.python.org> Author: jesse.noller Date: Mon Jan 19 16:12:22 2009 New Revision: 68768 Log: Resolve issue 3321: (segfault) _multiprocessing.Connection() doesn't check handle Modified: python/trunk/Lib/test/test_multiprocessing.py python/trunk/Misc/NEWS python/trunk/Modules/_multiprocessing/connection.h python/trunk/Modules/_multiprocessing/socket_connection.c Modified: python/trunk/Lib/test/test_multiprocessing.py ============================================================================== --- python/trunk/Lib/test/test_multiprocessing.py (original) +++ python/trunk/Lib/test/test_multiprocessing.py Mon Jan 19 16:12:22 2009 @@ -61,6 +61,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 # @@ -1682,6 +1684,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 # @@ -1785,7 +1799,7 @@ multiprocessing.connection.answer_challenge, _FakeConnection(), b'abc') -testcases_other = [OtherTest] +testcases_other = [OtherTest, TestInvalidHandle] # # Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 19 16:12:22 2009 @@ -140,6 +140,10 @@ Library ------- +- 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. Modified: python/trunk/Modules/_multiprocessing/connection.h ============================================================================== --- python/trunk/Modules/_multiprocessing/connection.h (original) +++ python/trunk/Modules/_multiprocessing/connection.h Mon Jan 19 16:12:22 2009 @@ -354,7 +354,7 @@ } Py_BEGIN_ALLOW_THREADS - res = conn_poll(self, timeout); + res = conn_poll(self, timeout, _save); Py_END_ALLOW_THREADS switch (res) { Modified: python/trunk/Modules/_multiprocessing/socket_connection.c ============================================================================== --- python/trunk/Modules/_multiprocessing/socket_connection.c (original) +++ python/trunk/Modules/_multiprocessing/socket_connection.c Mon Jan 19 16:12:22 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 python-checkins at python.org Mon Jan 19 16:15:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:15:02 +0100 (CET) Subject: [Python-checkins] r68769 - in python/branches/py3k: Lib/test/test_os.py Misc/NEWS Message-ID: <20090119151502.8B7401E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:15:02 2009 New Revision: 68769 Log: reenable the invalid fd test for fdopen Modified: python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Misc/NEWS 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 Mon Jan 19 16:15:02 2009 @@ -588,7 +588,7 @@ self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): - singles = ["fchdir", "dup", "fdatasync", "fstat", + 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 Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 19 16:15:02 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors. + - Issue #4838: When a module is deallocated, free the memory backing the optional module state data. From python-checkins at python.org Mon Jan 19 16:19:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:19:47 +0100 (CET) Subject: [Python-checkins] r68770 - python/branches/py3k/Modules/_fileio.c Message-ID: <20090119151947.0C1E11E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:19:46 2009 New Revision: 68770 Log: fix compiler warning Modified: python/branches/py3k/Modules/_fileio.c Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Mon Jan 19 16:19:46 2009 @@ -60,7 +60,7 @@ internal_close(PyFileIOObject *self) { int err = 0; - int save_errno; + int save_errno = 0; if (self->fd >= 0) { int fd = self->fd; self->fd = -1; From python-checkins at python.org Mon Jan 19 16:35:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:35:29 +0100 (CET) Subject: [Python-checkins] r68771 - in python/branches/release30-maint: Lib/test/test_fileio.py Misc/NEWS Modules/_fileio.c Message-ID: <20090119153530.000311E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:35:29 2009 New Revision: 68771 Log: Merged revisions 68767,68769-68770 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68767 | benjamin.peterson | 2009-01-19 09:11:51 -0600 (Mon, 19 Jan 2009) | 9 lines Merged revisions 68755 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68755 | benjamin.peterson | 2009-01-18 18:08:08 -0600 (Sun, 18 Jan 2009) | 1 line raise an OSError for invalid fds #4991 ........ ................ r68769 | benjamin.peterson | 2009-01-19 09:15:02 -0600 (Mon, 19 Jan 2009) | 1 line reenable the invalid fd test for fdopen ................ r68770 | benjamin.peterson | 2009-01-19 09:19:46 -0600 (Mon, 19 Jan 2009) | 1 line fix compiler warning ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_fileio.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_fileio.c Modified: python/branches/release30-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_fileio.py (original) +++ python/branches/release30-maint/Lib/test/test_fileio.py Mon Jan 19 16:35:29 2009 @@ -175,6 +175,10 @@ f.close() os.unlink(TESTFN) + def testInvalidFd(self): + self.assertRaises(ValueError, _fileio._FileIO, -10) + self.assertRaises(OSError, _fileio._FileIO, 10) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Jan 19 16:35:29 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors. + - Issue #4838: When a module is deallocated, free the memory backing the optional module state data. Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Mon Jan 19 16:35:29 2009 @@ -60,7 +60,7 @@ internal_close(PyFileIOObject *self) { int err = 0; - int save_errno; + int save_errno = 0; if (self->fd >= 0) { int fd = self->fd; self->fd = -1; @@ -138,6 +138,24 @@ return 0; } +static int +check_fd(int fd) +{ +#if defined(HAVE_FSTAT) + struct stat buf; + if (fstat(fd, &buf) < 0 && errno == EBADF) { + PyObject *exc; + char *msg = strerror(EBADF); + exc = PyObject_CallFunction(PyExc_OSError, "(is)", + EBADF, msg); + PyErr_SetObject(PyExc_OSError, exc); + Py_XDECREF(exc); + return -1; + } +#endif + return 0; +} + static int fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) @@ -170,6 +188,8 @@ "Negative filedescriptor"); return -1; } + if (check_fd(fd)) + return -1; } else { PyErr_Clear(); From python-checkins at python.org Mon Jan 19 16:42:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:42:23 +0100 (CET) Subject: [Python-checkins] r68772 - python/trunk/Misc/NEWS Message-ID: <20090119154223.9331F1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:42:23 2009 New Revision: 68772 Log: add a note about the ftruncate change Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 19 16:42:23 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- os.ftruncate raises OSErrors instead of IOErrors for consistency with other os + functions. + - Issue #4991: Passing invalid file descriptors to io.FileIO now raises an OSError. From python-checkins at python.org Mon Jan 19 16:51:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:51:28 +0100 (CET) Subject: [Python-checkins] r68773 - python/trunk/Modules/posixmodule.c Message-ID: <20090119155128.4C08A1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:51:27 2009 New Revision: 68773 Log: simplify code Modified: python/trunk/Modules/posixmodule.c Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Mon Jan 19 16:51:27 2009 @@ -6632,10 +6632,8 @@ Py_BEGIN_ALLOW_THREADS res = ftruncate(fd, length); Py_END_ALLOW_THREADS - if (res < 0) { - posix_error(); - return NULL; - } + if (res < 0) + return posix_error(); Py_INCREF(Py_None); return Py_None; } From python-checkins at python.org Mon Jan 19 16:59:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 16:59:37 +0100 (CET) Subject: [Python-checkins] r68774 - in python/branches/release26-maint: Lib/test/test_fileio.py Modules/_fileio.c Message-ID: <20090119155937.3F5781E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 16:59:36 2009 New Revision: 68774 Log: Merged revisions 68755 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68755 | benjamin.peterson | 2009-01-18 18:08:08 -0600 (Sun, 18 Jan 2009) | 1 line raise an OSError for invalid fds #4991 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_fileio.py python/branches/release26-maint/Modules/_fileio.c Modified: python/branches/release26-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fileio.py (original) +++ python/branches/release26-maint/Lib/test/test_fileio.py Mon Jan 19 16:59:36 2009 @@ -176,6 +176,10 @@ f.close() os.unlink(TESTFN) + def testInvalidFd(self): + self.assertRaises(ValueError, _fileio._FileIO, -10) + self.assertRaises(OSError, _fileio._FileIO, 10) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" Modified: python/branches/release26-maint/Modules/_fileio.c ============================================================================== --- python/branches/release26-maint/Modules/_fileio.c (original) +++ python/branches/release26-maint/Modules/_fileio.c Mon Jan 19 16:59:36 2009 @@ -119,6 +119,24 @@ return 0; } +static int +check_fd(int fd) +{ +#if defined(HAVE_FSTAT) + struct stat buf; + if (fstat(fd, &buf) < 0 && errno == EBADF) { + PyObject *exc; + char *msg = strerror(EBADF); + exc = PyObject_CallFunction(PyExc_OSError, "(is)", + EBADF, msg); + PyErr_SetObject(PyExc_OSError, exc); + Py_XDECREF(exc); + return -1; + } +#endif + return 0; +} + static int fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) @@ -151,6 +169,8 @@ "Negative filedescriptor"); return -1; } + if (check_fd(fd)) + return -1; } else { PyErr_Clear(); From python-checkins at python.org Mon Jan 19 17:08:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 17:08:46 +0100 (CET) Subject: [Python-checkins] r68775 - in peps/trunk: pep-0358.txt pep-0370.txt pep-0371.txt pep-3101.txt pep-3102.txt pep-3104.txt pep-3106.txt pep-3116.txt pep-3119.txt pep-3134.txt pep-3137.txt pep-3141.txt Message-ID: <20090119160846.38CD11E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 17:08:45 2009 New Revision: 68775 Log: a whole slew of peps that are (I believe) implemented Modified: peps/trunk/pep-0358.txt peps/trunk/pep-0370.txt peps/trunk/pep-0371.txt peps/trunk/pep-3101.txt peps/trunk/pep-3102.txt peps/trunk/pep-3104.txt peps/trunk/pep-3106.txt peps/trunk/pep-3116.txt peps/trunk/pep-3119.txt peps/trunk/pep-3134.txt peps/trunk/pep-3137.txt peps/trunk/pep-3141.txt Modified: peps/trunk/pep-0358.txt ============================================================================== --- peps/trunk/pep-0358.txt (original) +++ peps/trunk/pep-0358.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Neil Schemenauer , Guido van Rossum -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/plain Created: 15-Feb-2006 Modified: peps/trunk/pep-0370.txt ============================================================================== --- peps/trunk/pep-0370.txt (original) +++ peps/trunk/pep-0370.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Christian Heimes -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 11-Jan-2008 Modified: peps/trunk/pep-0371.txt ============================================================================== --- peps/trunk/pep-0371.txt (original) +++ peps/trunk/pep-0371.txt Mon Jan 19 17:08:45 2009 @@ -4,7 +4,7 @@ Last-Modified: $Date$ Author: Jesse Noller , Richard Oudkerk -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/plain Created: 06-May-2008 Modified: peps/trunk/pep-3101.txt ============================================================================== --- peps/trunk/pep-3101.txt (original) +++ peps/trunk/pep-3101.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Talin -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/plain Created: 16-Apr-2006 Modified: peps/trunk/pep-3102.txt ============================================================================== --- peps/trunk/pep-3102.txt (original) +++ peps/trunk/pep-3102.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Talin -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/plain Created: 22-Apr-2006 Modified: peps/trunk/pep-3104.txt ============================================================================== --- peps/trunk/pep-3104.txt (original) +++ peps/trunk/pep-3104.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Ka-Ping Yee -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 12-Oct-2006 Modified: peps/trunk/pep-3106.txt ============================================================================== --- peps/trunk/pep-3106.txt (original) +++ peps/trunk/pep-3106.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Guido van Rossum -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 19-Dec-2006 Modified: peps/trunk/pep-3116.txt ============================================================================== --- peps/trunk/pep-3116.txt (original) +++ peps/trunk/pep-3116.txt Mon Jan 19 17:08:45 2009 @@ -5,7 +5,7 @@ Author: Daniel Stutzbach , Guido van Rossum , Mike Verdone -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 26-Feb-2007 Modified: peps/trunk/pep-3119.txt ============================================================================== --- peps/trunk/pep-3119.txt (original) +++ peps/trunk/pep-3119.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Guido van Rossum , Talin -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 18-Apr-2007 Modified: peps/trunk/pep-3134.txt ============================================================================== --- peps/trunk/pep-3134.txt (original) +++ peps/trunk/pep-3134.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Ka-Ping Yee -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/plain Created: 12-May-2005 Modified: peps/trunk/pep-3137.txt ============================================================================== --- peps/trunk/pep-3137.txt (original) +++ peps/trunk/pep-3137.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Guido van Rossum -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 26-Sep-2007 Modified: peps/trunk/pep-3141.txt ============================================================================== --- peps/trunk/pep-3141.txt (original) +++ peps/trunk/pep-3141.txt Mon Jan 19 17:08:45 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Jeffrey Yasskin -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 23-Apr-2007 From python-checkins at python.org Mon Jan 19 17:17:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 17:17:55 +0100 (CET) Subject: [Python-checkins] r68776 - python/trunk/Doc/library/io.rst Message-ID: <20090119161755.03ABA1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 17:17:54 2009 New Revision: 68776 Log: move BufferedIOBase into the base class section 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 Mon Jan 19 17:17:54 2009 @@ -329,59 +329,6 @@ ``len(b)``, since if the write fails, an :exc:`IOError` will be raised). -Raw File I/O ------------- - -.. class:: FileIO(name[, mode]) - - :class:`FileIO` represents a file containing bytes data. It implements - the :class:`RawIOBase` interface (and therefore the :class:`IOBase` - interface, too). - - The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, - or appending. The file will be created if it doesn't exist when opened for - writing or appending; it will be truncated when opened for writing. Add a - ``'+'`` to the mode to allow simultaneous reading and writing. - - In addition to the attributes and methods from :class:`IOBase` and - :class:`RawIOBase`, :class:`FileIO` provides the following data - attributes and methods: - - .. attribute:: mode - - The mode as given in the constructor. - - .. attribute:: name - - The file name. This is the file descriptor of the file when no name is - given in the constructor. - - .. method:: read([n]) - - Read and return at most *n* bytes. Only one system call is made, so it is - possible that less data than was requested is returned. Use :func:`len` - on the returned bytes object to see how many bytes were actually returned. - (In non-blocking mode, ``None`` is returned when no data is available.) - - .. method:: readall() - - Read and return the entire file's contents in a single bytes object. As - much as immediately available is returned in non-blocking mode. If the - EOF has been reached, ``b''`` is returned. - - .. method:: write(b) - - Write the bytes or bytearray object, *b*, to the file, and return - the number actually written. Only one system call is made, so it - is possible that only some of the data is written. - - Note that the inherited ``readinto()`` method should not be used on - :class:`FileIO` objects. - - -Buffered Streams ----------------- - .. class:: BufferedIOBase Base class for streams that support buffering. It inherits :class:`IOBase`. @@ -439,6 +386,59 @@ underlying raw stream cannot accept more data at the moment. +Raw File I/O +------------ + +.. class:: FileIO(name[, mode]) + + :class:`FileIO` represents a file containing bytes data. It implements + the :class:`RawIOBase` interface (and therefore the :class:`IOBase` + interface, too). + + The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, + or appending. The file will be created if it doesn't exist when opened for + writing or appending; it will be truncated when opened for writing. Add a + ``'+'`` to the mode to allow simultaneous reading and writing. + + In addition to the attributes and methods from :class:`IOBase` and + :class:`RawIOBase`, :class:`FileIO` provides the following data + attributes and methods: + + .. attribute:: mode + + The mode as given in the constructor. + + .. attribute:: name + + The file name. This is the file descriptor of the file when no name is + given in the constructor. + + .. method:: read([n]) + + Read and return at most *n* bytes. Only one system call is made, so it is + possible that less data than was requested is returned. Use :func:`len` + on the returned bytes object to see how many bytes were actually returned. + (In non-blocking mode, ``None`` is returned when no data is available.) + + .. method:: readall() + + Read and return the entire file's contents in a single bytes object. As + much as immediately available is returned in non-blocking mode. If the + EOF has been reached, ``b''`` is returned. + + .. method:: write(b) + + Write the bytes or bytearray object, *b*, to the file, and return + the number actually written. Only one system call is made, so it + is possible that only some of the data is written. + + Note that the inherited ``readinto()`` method should not be used on + :class:`FileIO` objects. + + +Buffered Streams +---------------- + .. class:: BytesIO([initial_bytes]) A stream implementation using an in-memory bytes buffer. It inherits From python-checkins at python.org Mon Jan 19 17:18:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 17:18:28 +0100 (CET) Subject: [Python-checkins] r68777 - python/trunk/Doc/library/symtable.rst Message-ID: <20090119161828.061AE1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 17:18:27 2009 New Revision: 68777 Log: add email address Modified: python/trunk/Doc/library/symtable.rst Modified: python/trunk/Doc/library/symtable.rst ============================================================================== --- python/trunk/Doc/library/symtable.rst (original) +++ python/trunk/Doc/library/symtable.rst Mon Jan 19 17:18:27 2009 @@ -5,7 +5,7 @@ :synopsis: Interface to the compiler's internal symbol tables. .. moduleauthor:: Jeremy Hylton -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson Symbol tables are generated by the compiler from AST just before bytecode is From python-checkins at python.org Mon Jan 19 17:23:53 2009 From: python-checkins at python.org (jesse.noller) Date: Mon, 19 Jan 2009 17:23:53 +0100 (CET) Subject: [Python-checkins] r68778 - in python/branches/py3k: Lib/test/test_multiprocessing.py Misc/NEWS Modules/_multiprocessing/connection.h Modules/_multiprocessing/socket_connection.c Message-ID: <20090119162353.785CC1E4002@bag.python.org> Author: jesse.noller Date: Mon Jan 19 17:23:53 2009 New Revision: 68778 Log: merge r68768 to py3k Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_multiprocessing.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_multiprocessing/connection.h python/branches/py3k/Modules/_multiprocessing/socket_connection.c Modified: python/branches/py3k/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/py3k/Lib/test/test_multiprocessing.py (original) +++ python/branches/py3k/Lib/test/test_multiprocessing.py Mon Jan 19 17:23:53 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/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 19 17:23:53 2009 @@ -143,6 +143,10 @@ - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. +- 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. Modified: python/branches/py3k/Modules/_multiprocessing/connection.h ============================================================================== --- python/branches/py3k/Modules/_multiprocessing/connection.h (original) +++ python/branches/py3k/Modules/_multiprocessing/connection.h Mon Jan 19 17:23:53 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/py3k/Modules/_multiprocessing/socket_connection.c ============================================================================== --- python/branches/py3k/Modules/_multiprocessing/socket_connection.c (original) +++ python/branches/py3k/Modules/_multiprocessing/socket_connection.c Mon Jan 19 17:23:53 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 Mon Jan 19 17:37:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 16:37:48 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090119163749.356B91E4040@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/22 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_fileio test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 17:48:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 16:48:20 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090119164820.BA6111E4002@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/52 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: 1 test failed: test_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 18:08:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 17:08:29 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090119170829.C96451E4002@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/4500 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fileio ====================================================================== FAIL: testInvalidFd (test.test_fileio.OtherFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_fileio.py", line 181, in testInvalidFd self.assertRaises(OSError, _fileio._FileIO, 10) AssertionError: OSError not raised make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 18:10:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 17:10:42 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090119171042.C6F891E400C@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/152 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: jesse.noller BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 18:22:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 17:22:32 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090119172232.36D8B1E4002@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/121 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_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 18:32:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 17:32:00 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090119173200.6AEB31E4002@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/52 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: benjamin.peterson 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 Mon Jan 19 18:33:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 17:33:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090119173322.EC17B1E4002@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/132 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 python-checkins at python.org Mon Jan 19 18:37:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 18:37:42 +0100 (CET) Subject: [Python-checkins] r68779 - in python/trunk/Lib/test: test_fileio.py test_os.py test_support.py Message-ID: <20090119173742.F25891E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 18:37:42 2009 New Revision: 68779 Log: make bad file descriptor tests more robust Modified: python/trunk/Lib/test/test_fileio.py python/trunk/Lib/test/test_os.py python/trunk/Lib/test/test_support.py Modified: python/trunk/Lib/test/test_fileio.py ============================================================================== --- python/trunk/Lib/test/test_fileio.py (original) +++ python/trunk/Lib/test/test_fileio.py Mon Jan 19 18:37:42 2009 @@ -7,7 +7,8 @@ from array import array from weakref import proxy -from test.test_support import TESTFN, findfile, check_warnings, run_unittest +from test.test_support import (TESTFN, findfile, check_warnings, run_unittest, + make_bad_fd) from UserList import UserList import _fileio @@ -178,7 +179,7 @@ def testInvalidFd(self): self.assertRaises(ValueError, _fileio._FileIO, -10) - self.assertRaises(OSError, _fileio._FileIO, 10) + self.assertRaises(OSError, _fileio._FileIO, make_bad_fd()) def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Mon Jan 19 18:37:42 2009 @@ -540,55 +540,59 @@ #We omit close because it doesn'r raise an exception on some platforms def get_single(f): def helper(self): - if getattr(os, f, None): - self.assertRaises(OSError, getattr(os, f), 10) + 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): + self.assertRaises(OSError, f, test_support.make_bad_fd(), *args) + def test_isatty(self): if hasattr(os, "isatty"): - self.assertEqual(os.isatty(10), False) + self.assertEqual(os.isatty(test_support.make_bad_fd()), False) def test_closerange(self): if hasattr(os, "closerange"): - self.assertEqual(os.closerange(10, 20), None) + fd = test_support.make_bad_fd() + self.assertEqual(os.closerange(fd, fd + 10), None) def test_dup2(self): if hasattr(os, "dup2"): - self.assertRaises(OSError, os.dup2, 10, 20) + self.check(os.dup2, 20) def test_fchmod(self): if hasattr(os, "fchmod"): - self.assertRaises(OSError, os.fchmod, 10, 0) + self.check(os.fchmod, 0) def test_fchown(self): if hasattr(os, "fchown"): - self.assertRaises(OSError, os.fchown, 10, -1, -1) + self.check(os.fchown, -1, -1) def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + self.check(os.fpathconf, "PC_NAME_MAX") def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(OSError, os.ftruncate, 10, 0) + self.check(os.ftruncate, 0) def test_lseek(self): if hasattr(os, "lseek"): - self.assertRaises(OSError, os.lseek, 10, 0, 0) + self.check(os.lseek, 0, 0) def test_read(self): if hasattr(os, "read"): - self.assertRaises(OSError, os.read, 10, 1) + self.check(os.read, 1) def test_tcsetpgrpt(self): if hasattr(os, "tcsetpgrp"): - self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + self.check(os.tcsetpgrp, 0) def test_write(self): if hasattr(os, "write"): - self.assertRaises(OSError, os.write, 10, " ") + self.check(os.write, " ") if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): Modified: python/trunk/Lib/test/test_support.py ============================================================================== --- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Mon Jan 19 18:37:42 2009 @@ -357,6 +357,18 @@ withcommas = ", ".join(reprpairs) return "{%s}" % withcommas +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + def check_syntax_error(testcase, statement): try: compile(statement, '', 'exec') From python-checkins at python.org Mon Jan 19 18:53:36 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 18:53:36 +0100 (CET) Subject: [Python-checkins] r68780 - in python/branches/py3k: Lib/test/test_os.py Modules/posixmodule.c Message-ID: <20090119175336.A28771E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 18:53:36 2009 New Revision: 68780 Log: Merged revisions 68763,68773 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines Issue 4957 Let os.ftruncate raise OSError like documented. ........ r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line simplify code ........ Modified: python/branches/py3k/ (props changed) 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 Mon Jan 19 18:53:36 2009 @@ -624,10 +624,9 @@ if hasattr(os, "fpathconf"): self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") - #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(IOError, os.ftruncate, 10, 0) + self.assertRaises(OSError, os.ftruncate, 10, 0) def test_lseek(self): if hasattr(os, "lseek"): Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Mon Jan 19 18:53:36 2009 @@ -5114,10 +5114,8 @@ Py_BEGIN_ALLOW_THREADS res = ftruncate(fd, length); Py_END_ALLOW_THREADS - if (res < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; - } + if (res < 0) + return posix_error(); Py_INCREF(Py_None); return Py_None; } From python-checkins at python.org Mon Jan 19 18:56:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 18:56:17 +0100 (CET) Subject: [Python-checkins] r68781 - python/branches/release30-maint Message-ID: <20090119175617.056DC1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 18:56:16 2009 New Revision: 68781 Log: Blocked revisions 68780 via svnmerge ................ r68780 | benjamin.peterson | 2009-01-19 11:53:36 -0600 (Mon, 19 Jan 2009) | 14 lines Merged revisions 68763,68773 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines Issue 4957 Let os.ftruncate raise OSError like documented. ........ r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line simplify code ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon Jan 19 19:13:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 18:13:08 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090119181308.CEB5F1E4002@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/70 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: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 19:47:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 18:47:51 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090119184752.3092D1E4002@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/30 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,jesse.noller BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 20:35:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 19:35:30 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090119193530.EDFEC1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/140 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: jesse.noller BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 19 21:09:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 20:09:21 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20090119200921.374FF1E405D@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.0/builds/70 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 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_fileio make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 19 22:00:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 22:00:11 +0100 (CET) Subject: [Python-checkins] r68782 - in python/branches/py3k: Lib/test/support.py Lib/test/test_fileio.py Lib/test/test_os.py Message-ID: <20090119210011.12FDA1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 22:00:09 2009 New Revision: 68782 Log: Merged revisions 68779 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line make bad file descriptor tests more robust ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/support.py python/branches/py3k/Lib/test/test_fileio.py python/branches/py3k/Lib/test/test_os.py Modified: python/branches/py3k/Lib/test/support.py ============================================================================== --- python/branches/py3k/Lib/test/support.py (original) +++ python/branches/py3k/Lib/test/support.py Mon Jan 19 22:00:09 2009 @@ -344,6 +344,18 @@ withcommas = ", ".join(reprpairs) return "{%s}" % withcommas +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + def check_syntax_error(testcase, statement): try: compile(statement, '', 'exec') Modified: python/branches/py3k/Lib/test/test_fileio.py ============================================================================== --- python/branches/py3k/Lib/test/test_fileio.py (original) +++ python/branches/py3k/Lib/test/test_fileio.py Mon Jan 19 22:00:09 2009 @@ -6,7 +6,8 @@ from array import array from weakref import proxy -from test.support import TESTFN, findfile, check_warnings, run_unittest +from test.support import (TESTFN, findfile, check_warnings, run_unittest, + make_bad_fd) from collections import UserList import _fileio @@ -177,7 +178,7 @@ def testInvalidFd(self): self.assertRaises(ValueError, _fileio._FileIO, -10) - self.assertRaises(OSError, _fileio._FileIO, 10) + self.assertRaises(OSError, _fileio._FileIO, make_bad_fd()) def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument 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 Mon Jan 19 22:00:09 2009 @@ -594,55 +594,59 @@ #We omit close because it doesn'r raise an exception on some platforms def get_single(f): def helper(self): - if getattr(os, f, None): - self.assertRaises(OSError, getattr(os, f), 10) + 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): + self.assertRaises(OSError, f, support.make_bad_fd(), *args) + def test_isatty(self): if hasattr(os, "isatty"): - self.assertEqual(os.isatty(10), False) + self.assertEqual(os.isatty(support.make_bad_fd()), False) def test_closerange(self): if hasattr(os, "closerange"): - self.assertEqual(os.closerange(10, 20), None) + fd = support.make_bad_fd() + self.assertEqual(os.closerange(fd, fd + 10), None) def test_dup2(self): if hasattr(os, "dup2"): - self.assertRaises(OSError, os.dup2, 10, 20) + self.check(os.dup2, 20) def test_fchmod(self): if hasattr(os, "fchmod"): - self.assertRaises(OSError, os.fchmod, 10, 0) + self.check(os.fchmod, 0) def test_fchown(self): if hasattr(os, "fchown"): - self.assertRaises(OSError, os.fchown, 10, -1, -1) + self.check(os.fchown, -1, -1) def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + self.check(os.fpathconf, "PC_NAME_MAX") def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(OSError, os.ftruncate, 10, 0) + self.check(os.ftruncate, 0) def test_lseek(self): if hasattr(os, "lseek"): - self.assertRaises(OSError, os.lseek, 10, 0, 0) + self.check(os.lseek, 0, 0) def test_read(self): if hasattr(os, "read"): - self.assertRaises(OSError, os.read, 10, 1) + self.check(os.read, 1) def test_tcsetpgrpt(self): if hasattr(os, "tcsetpgrp"): - self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + self.check(os.tcsetpgrp, 0) def test_write(self): if hasattr(os, "write"): - self.assertRaises(OSError, os.write, 10, b" ") + self.check(os.write, b" ") if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): From python-checkins at python.org Mon Jan 19 22:02:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 22:02:47 +0100 (CET) Subject: [Python-checkins] r68783 - in python/branches/release26-maint: Lib/test/test_fileio.py Lib/test/test_os.py Lib/test/test_support.py Message-ID: <20090119210247.133CE1E4022@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 22:02:45 2009 New Revision: 68783 Log: Merged revisions 68779 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line make bad file descriptor tests more robust ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_fileio.py python/branches/release26-maint/Lib/test/test_os.py python/branches/release26-maint/Lib/test/test_support.py Modified: python/branches/release26-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fileio.py (original) +++ python/branches/release26-maint/Lib/test/test_fileio.py Mon Jan 19 22:02:45 2009 @@ -7,7 +7,8 @@ from array import array from weakref import proxy -from test.test_support import TESTFN, findfile, check_warnings, run_unittest +from test.test_support import (TESTFN, findfile, check_warnings, run_unittest, + make_bad_fd) from UserList import UserList import _fileio @@ -178,7 +179,7 @@ def testInvalidFd(self): self.assertRaises(ValueError, _fileio._FileIO, -10) - self.assertRaises(OSError, _fileio._FileIO, 10) + self.assertRaises(OSError, _fileio._FileIO, make_bad_fd()) def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument Modified: python/branches/release26-maint/Lib/test/test_os.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_os.py (original) +++ python/branches/release26-maint/Lib/test/test_os.py Mon Jan 19 22:02:45 2009 @@ -540,56 +540,61 @@ #We omit close because it doesn'r raise an exception on some platforms def get_single(f): def helper(self): - if getattr(os, f, None): - self.assertRaises(OSError, getattr(os, f), 10) + 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): + self.assertRaises(OSError, f, test_support.make_bad_fd(), *args) + def test_isatty(self): if hasattr(os, "isatty"): - self.assertEqual(os.isatty(10), False) + self.assertEqual(os.isatty(test_support.make_bad_fd()), False) def test_closerange(self): if hasattr(os, "closerange"): - self.assertEqual(os.closerange(10, 20), None) + fd = test_support.make_bad_fd() + self.assertEqual(os.closerange(fd, fd + 10), None) def test_dup2(self): if hasattr(os, "dup2"): - self.assertRaises(OSError, os.dup2, 10, 20) + self.check(os.dup2, 20) def test_fchmod(self): if hasattr(os, "fchmod"): - self.assertRaises(OSError, os.fchmod, 10, 0) + self.check(os.fchmod, 0) def test_fchown(self): if hasattr(os, "fchown"): - self.assertRaises(OSError, os.fchown, 10, -1, -1) + self.check(os.fchown, -1, -1) def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + self.check(os.fpathconf, "PC_NAME_MAX") #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(IOError, os.ftruncate, 10, 0) + self.assertRaises(IOError, os.ftruncate, test_support.make_bad_fd(), + 0) def test_lseek(self): if hasattr(os, "lseek"): - self.assertRaises(OSError, os.lseek, 10, 0, 0) + self.check(os.lseek, 0, 0) def test_read(self): if hasattr(os, "read"): - self.assertRaises(OSError, os.read, 10, 1) + self.check(os.read, 1) def test_tcsetpgrpt(self): if hasattr(os, "tcsetpgrp"): - self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + self.check(os.tcsetpgrp, 0) def test_write(self): if hasattr(os, "write"): - self.assertRaises(OSError, os.write, 10, " ") + self.check(os.write, " ") if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): Modified: python/branches/release26-maint/Lib/test/test_support.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_support.py (original) +++ python/branches/release26-maint/Lib/test/test_support.py Mon Jan 19 22:02:45 2009 @@ -357,6 +357,18 @@ withcommas = ", ".join(reprpairs) return "{%s}" % withcommas +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + def check_syntax_error(testcase, statement): try: compile(statement, '', 'exec') From python-checkins at python.org Mon Jan 19 22:07:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 22:07:05 +0100 (CET) Subject: [Python-checkins] r68784 - in python/branches/release30-maint: Lib/test/support.py Lib/test/test_fileio.py Message-ID: <20090119210705.C720A1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 22:07:05 2009 New Revision: 68784 Log: Merged revisions 68782 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68782 | benjamin.peterson | 2009-01-19 15:00:09 -0600 (Mon, 19 Jan 2009) | 9 lines Merged revisions 68779 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line make bad file descriptor tests more robust ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/support.py python/branches/release30-maint/Lib/test/test_fileio.py Modified: python/branches/release30-maint/Lib/test/support.py ============================================================================== --- python/branches/release30-maint/Lib/test/support.py (original) +++ python/branches/release30-maint/Lib/test/support.py Mon Jan 19 22:07:05 2009 @@ -344,6 +344,18 @@ withcommas = ", ".join(reprpairs) return "{%s}" % withcommas +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + def check_syntax_error(testcase, statement): try: compile(statement, '', 'exec') Modified: python/branches/release30-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_fileio.py (original) +++ python/branches/release30-maint/Lib/test/test_fileio.py Mon Jan 19 22:07:05 2009 @@ -6,7 +6,8 @@ from array import array from weakref import proxy -from test.support import TESTFN, findfile, check_warnings, run_unittest +from test.support import (TESTFN, findfile, check_warnings, run_unittest, + make_bad_fd) from collections import UserList import _fileio @@ -177,7 +178,7 @@ def testInvalidFd(self): self.assertRaises(ValueError, _fileio._FileIO, -10) - self.assertRaises(OSError, _fileio._FileIO, 10) + self.assertRaises(OSError, _fileio._FileIO, make_bad_fd()) def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument From python-checkins at python.org Mon Jan 19 22:08:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 22:08:37 +0100 (CET) Subject: [Python-checkins] r68785 - python/trunk/Lib/test/test_os.py Message-ID: <20090119210837.4D4CA1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 22:08:37 2009 New Revision: 68785 Log: I'm sick of these deprecations warnings in test_os 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 Mon Jan 19 22:08:37 2009 @@ -505,9 +505,11 @@ self.assertEqual(len(os.urandom(100)), 100) self.assertEqual(len(os.urandom(1000)), 1000) # see http://bugs.python.org/issue3708 - self.assertEqual(len(os.urandom(0.9)), 0) - self.assertEqual(len(os.urandom(1.1)), 1) - self.assertEqual(len(os.urandom(2.0)), 2) + with test_support.check_warnings(): + # silence deprecation warnings about float arguments + self.assertEqual(len(os.urandom(0.9)), 0) + self.assertEqual(len(os.urandom(1.1)), 1) + self.assertEqual(len(os.urandom(2.0)), 2) except NotImplementedError: pass From python-checkins at python.org Mon Jan 19 22:11:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 19 Jan 2009 22:11:06 +0100 (CET) Subject: [Python-checkins] r68786 - python/branches/py3k Message-ID: <20090119211106.7B4471E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 19 22:11:05 2009 New Revision: 68786 Log: Blocked revisions 68785 via svnmerge ........ r68785 | benjamin.peterson | 2009-01-19 15:08:37 -0600 (Mon, 19 Jan 2009) | 1 line I'm sick of these deprecations warnings in test_os ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Mon Jan 19 23:13:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 22:13:44 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090119221344.A50D21E4002@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/730 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pydoc ====================================================================== FAIL: test_html_doc (test.test_pydoc.PyDocDocTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_pydoc.py", line 223, in test_html_doc self.fail("outputs are not equal, see diff above") AssertionError: outputs are not equal, see diff above ====================================================================== FAIL: test_text_doc (test.test_pydoc.PyDocDocTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_pydoc.py", line 231, in test_text_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 Mon Jan 19 23:33:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 22:33:25 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090119223325.6BD691E4002@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/134 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Mon Jan 19 23:52:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 22:52:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090119225231.174C91E400C@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/56 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 Jan 20 00:59:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 19 Jan 2009 23:59:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090119235907.EC8571E4002@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/72 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: 2 tests failed: test_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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' sincerely, -The Buildbot From python-checkins at python.org Tue Jan 20 01:16:39 2009 From: python-checkins at python.org (jesse.noller) Date: Tue, 20 Jan 2009 01:16:39 +0100 (CET) Subject: [Python-checkins] r68787 - python/trunk/Modules/_multiprocessing/pipe_connection.c Message-ID: <20090120001639.3AD121E4002@bag.python.org> Author: jesse.noller Date: Tue Jan 20 01:16:38 2009 New Revision: 68787 Log: issue 5002: fix windows warning that I intro'ed with r68768 Modified: python/trunk/Modules/_multiprocessing/pipe_connection.c Modified: python/trunk/Modules/_multiprocessing/pipe_connection.c ============================================================================== --- python/trunk/Modules/_multiprocessing/pipe_connection.c (original) +++ python/trunk/Modules/_multiprocessing/pipe_connection.c Tue Jan 20 01:16:38 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; From python-checkins at python.org Tue Jan 20 01:23:01 2009 From: python-checkins at python.org (jesse.noller) Date: Tue, 20 Jan 2009 01:23:01 +0100 (CET) Subject: [Python-checkins] r68788 - in python/branches/py3k: Modules/_multiprocessing/pipe_connection.c Message-ID: <20090120002301.AD77B1E4002@bag.python.org> Author: jesse.noller Date: Tue Jan 20 01:23:01 2009 New Revision: 68788 Log: merge r68787 to py3k Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_multiprocessing/pipe_connection.c Modified: python/branches/py3k/Modules/_multiprocessing/pipe_connection.c ============================================================================== --- python/branches/py3k/Modules/_multiprocessing/pipe_connection.c (original) +++ python/branches/py3k/Modules/_multiprocessing/pipe_connection.c Tue Jan 20 01:23:01 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; From buildbot at python.org Tue Jan 20 02:01:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 01:01:03 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090120010104.131271E4002@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/124 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 buildbot at python.org Tue Jan 20 02:14:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 01:14:06 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090120011406.8DBCE1E402F@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/87 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: jesse.noller 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 Tue Jan 20 02:19:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 02:19:26 +0100 (CET) Subject: [Python-checkins] r68789 - in python/trunk: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Message-ID: <20090120011926.BA9C71E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 02:19:26 2009 New Revision: 68789 Log: 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__. Modified: python/trunk/Doc/library/collections.rst python/trunk/Lib/collections.py python/trunk/Lib/test/test_collections.py Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Tue Jan 20 02:19:26 2009 @@ -189,6 +189,7 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args The returned object has a dictionary style interface except that it returns a zero count for missing items (instead of raising a :exc:`KeyError` like a @@ -219,7 +220,7 @@ Elements are returned in arbitrary order. If an element's count has been set to zero or a negative number, :meth:`elements` will ignore it. - >>> c = Counter({'a': 4, 'b': 2, 'd': 0, 'e': -2}) + >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) ['a', 'a', 'a', 'a', 'b', 'b'] @@ -244,10 +245,10 @@ .. method:: update([iterable-or-mapping]) - Like :meth:`dict.update` but adds-in counts instead of replacing them. - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter):: + *mapping* (or counter). Like :meth:`dict.update` but adds-in counts + instead of replacing them, and the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs:: >>> c = Counter('which') >>> c.update('witch') # add elements from another iterable @@ -267,6 +268,34 @@ Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs c.most_common()[:-n:-1] # n least common elements +Several multiset mathematical operations are provided for combining +:class:`Counter` objects. Multisets are like regular sets but 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:: + + >>> c = Counter('a': 3, 'b': 1}) + >>> d = Counter({'a': 1, 'b': 2}) + >>> c + d # add two counters together: c[x] + d[x] + Counter({'a': 4, 'b': 3}) + >>> c - d # subtract (keeping only positive counts) + Counter({'a': 2}) + >>> c & d # interection: min(c[x], d[x]) + Counter({'a': 1, 'b': 1}) + >>> c | d # union: max(c[x], d[x]) + Counter({'a': 3, 'b': 2}) + +All four multiset operations produce only positive counts (negative and zero +results are skipped). If inputs include negative counts, addition will sum +both counts and then exclude non-positive results. The other three operations +are undefined for negative inputs:: + + >>> e = Counter(a=8, b=-2, c=0) + >>> e += Counter() # remove zero and negative counts + >>> e + Counter({'a': 8}) + **References**: * Wikipedia entry for `Multisets `_ Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 20 02:19:26 2009 @@ -10,7 +10,7 @@ from keyword import iskeyword as _iskeyword import sys as _sys import heapq as _heapq -from itertools import repeat as _repeat, chain as _chain, starmap as _starmap +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap, ifilter as _ifilter ######################################################################## ### namedtuple ####################################################### @@ -167,7 +167,7 @@ # http://code.activestate.com/recipes/259174/ # Knuth, TAOCP Vol. II section 4.6.3 - def __init__(self, iterable=None): + def __init__(self, iterable=None, **kwds): '''Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. @@ -175,9 +175,10 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + >>> c = Counter(a=4, b=2) # a new counter from keyword args ''' - self.update(iterable) + self.update(iterable, **kwds) def __missing__(self, key): 'The count of elements not in the Counter is zero.' @@ -228,7 +229,7 @@ raise NotImplementedError( 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') - def update(self, iterable=None): + def update(self, iterable=None, **kwds): '''Like dict.update() but add counts instead of replacing them. Source can be an iterable, a dictionary, or another Counter instance. @@ -245,10 +246,8 @@ # replace behavior results in the some of original untouched counts # being mixed-in with all of the other counts for a mismash that # doesn't have a straight-forward interpretation in most counting - # contexts. Instead, we look to Knuth for suggested operations on - # multisets and implement the union-add operation discussed in - # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for - # multisets calls that operation a sum or join. + # contexts. Instead, we implement straight-addition. Both the inputs + # and outputs are allowed to contain zero and negative counts. if iterable is not None: if isinstance(iterable, Mapping): @@ -257,17 +256,101 @@ else: for elem in iterable: self[elem] += 1 + if kwds: + self.update(kwds) def copy(self): 'Like dict.copy() but returns a Counter instance instead of a dict.' return Counter(self) + def __delitem__(self, elem): + 'Like dict.__delitem__() but does not raise KeyError for missing values.' + if elem in self: + dict.__delitem__(self, elem) + def __repr__(self): if not self: return '%s()' % self.__class__.__name__ items = ', '.join(map('%r: %r'.__mod__, self.most_common())) return '%s({%s})' % (self.__class__.__name__, items) + # Multiset-style mathematical operations discussed in: + # Knuth TAOCP Volume II section 4.6.3 exercise 19 + # and at http://en.wikipedia.org/wiki/Multiset + # + # Results are undefined when inputs contain negative counts. + # Outputs guaranteed to only include positive counts. + # + # To strip negative and zero counts, add-in an empty counter: + # c += Counter() + + def __add__(self, other): + '''Add counts from two counters. + + >>> Counter('abbb') + Counter('bcc') + Counter({'b': 4, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem in set(self) | set(other): + newcount = self[elem] + other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __sub__(self, other): + ''' Subtract count, but keep only results with positive counts. + + >>> Counter('abbbc') - Counter('bccd') + Counter({'b': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.iteritems(): + newcount = count - other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __or__(self, other): + '''Union is the maximum of value in either of the input counters. + + >>> Counter('abbb') | Counter('bcc') + Counter({'b': 3, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _max = max + result = Counter() + for elem in set(self) | set(other): + newcount = _max(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + + def __and__(self, other): + ''' Intersection is the minimum of corresponding counts. + + >>> Counter('abbb') & Counter('bcc') + Counter({'b': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _min = min + result = Counter() + if len(self) < len(other): + self, other = other, self + for elem in _ifilter(self.__contains__, other): + newcount = _min(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result if __name__ == '__main__': Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Tue Jan 20 02:19:26 2009 @@ -2,6 +2,8 @@ from test import test_support from collections import namedtuple, Counter, Mapping import pickle, cPickle, copy +from random import randrange +import operator from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -350,6 +352,8 @@ def test_basics(self): c = Counter('abcaba') + self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1})) + self.assertEqual(c, Counter(a=3, b=2, c=1)) self.assert_(isinstance(c, dict)) self.assert_(isinstance(c, Mapping)) self.assert_(issubclass(Counter, dict)) @@ -379,6 +383,7 @@ c['a'] += 1 # increment an existing value c['b'] -= 2 # sub existing value to zero del c['c'] # remove an entry + del c['c'] # make sure that del doesn't raise KeyError c['d'] -= 2 # sub from a missing value c['e'] = -5 # directly assign a missing value c['f'] += 4 # add to a missing value @@ -394,7 +399,8 @@ self.assertEqual(repr(c), 'Counter()') self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') self.assertRaises(TypeError, hash, c) - c.update(dict(a=5, b=3, c=1)) + c.update(dict(a=5, b=3)) + c.update(c=1) c.update(Counter('a' * 50 + 'b' * 30)) c.update() # test case with no args c.__init__('a' * 500 + 'b' * 300) @@ -442,6 +448,43 @@ self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) self.assertEqual(set(Counter(s)), set(s)) + def test_multiset_operations(self): + # Verify that adding a zero counter will strip zeros and negatives + c = Counter(a=10, b=-2, c=0) + Counter() + self.assertEqual(dict(c), dict(a=10)) + + elements = 'abcd' + for i in range(1000): + # test random pairs of multisets + p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + for counterop, numberop, defneg in [ + (Counter.__add__, lambda x, y: x+y if x+y>0 else 0, True), + (Counter.__sub__, lambda x, y: x-y if x-y>0 else 0, False), + (Counter.__or__, max, False), + (Counter.__and__, min, False), + ]: + result = counterop(p, q) + for x in elements: + # all except __add__ are undefined for negative inputs + if defneg or (p[x] >= 0 and q[x] >= 0): + self.assertEqual(numberop(p[x], q[x]), result[x]) + # verify that results exclude non-positive counts + self.assert_(x>0 for x in result.values()) + + elements = 'abcdef' + for i in range(100): + # verify that random multisets with no repeats are exactly like sets + p = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + q = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + for counterop, setop in [ + (Counter.__sub__, set.__sub__), + (Counter.__or__, set.__or__), + (Counter.__and__, set.__and__), + ]: + counter_result = counterop(p, q) + set_result = setop(set(p.elements()), set(q.elements())) + self.assertEqual(counter_result, dict.fromkeys(set_result, 1)) import doctest, collections From python-checkins at python.org Tue Jan 20 03:09:18 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 20 Jan 2009 03:09:18 +0100 (CET) Subject: [Python-checkins] r68790 - python/branches/py3k/Doc/documenting/markup.rst Message-ID: <20090120020918.CEC451E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 20 03:09:18 2009 New Revision: 68790 Log: Clarify how the specify the name of a module with the 'module' directive. Modified: python/branches/py3k/Doc/documenting/markup.rst Modified: python/branches/py3k/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k/Doc/documenting/markup.rst (original) +++ python/branches/py3k/Doc/documenting/markup.rst Tue Jan 20 03:09:18 2009 @@ -53,9 +53,9 @@ .. describe:: module - This directive marks the beginning of the description of a module (or package - submodule, in which case the name should be fully qualified, including the - package name). + This directive marks the beginning of the description of a module, package, + or submodule. The name should be fully qualified (i.e. including the + package name for submodules). The ``platform`` option, if present, is a comma-separated list of the platforms on which the module is available (if it is available on all From python-checkins at python.org Tue Jan 20 03:21:28 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 20 Jan 2009 03:21:28 +0100 (CET) Subject: [Python-checkins] r68791 - in python/branches/py3k: Doc/library/importlib.rst Doc/library/modules.rst Lib/importlib/NOTES Lib/importlib/__init__.py Misc/NEWS Message-ID: <20090120022128.124701E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 20 03:21:27 2009 New Revision: 68791 Log: Document the (very small) public API for importlib. As time goes on and some key refactorings occur more of the API will be exposed and documented. Added: python/branches/py3k/Doc/library/importlib.rst Modified: python/branches/py3k/Doc/library/modules.rst python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/__init__.py python/branches/py3k/Misc/NEWS Added: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- (empty file) +++ python/branches/py3k/Doc/library/importlib.rst Tue Jan 20 03:21:27 2009 @@ -0,0 +1,78 @@ +:mod:`importlib` -- An implementation of :keyword:`import` +========================================================== + +.. module:: importlib + :synopsis: An implementation of the import machinery. + +.. moduleauthor:: Brett Cannon +.. sectionauthor:: Brett Cannon + +.. versionadded:: 3.1 + + +Introduction +------------ + +The purpose of the :mod:`importlib` package is two-fold. One is to provide an +implementation of the :keyword:`import` statement (and thus, by extension, the +:func:`__import__` function) in Python source code. This provides an +implementaiton of :keyword:`import` which is portable to any Python +interpreter. This also provides a reference implementation which is easier to +read 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`. + +.. seealso:: + + :ref:`import` + The language reference for the :keyword:`import` statement. + + `Packages specification `__ + Original specification of packages. Some semantics have changed since + the writing of this document (e.g. redirecting based on :keyword:`None` + in :data:`sys.modules`). + + The :func:`.__import__` function + The built-in function for which the :keyword:`import` statement is + syntactic sugar for. + + :pep:`235` + Import on Case-Insensitive Platforms + + :pep:`263` + Defining Python Source Code Encodings + + :pep:`302` + New Import Hooks. + + :pep:`328` + Imports: Multi-Line and Absolute/Relative + + :pep:`366` + Main module explicit relative imports + + :pep:`3128` + Using UTF-8 as the Default Source Encoding + + +Functions +--------- + +.. function:: __import__(name, globals={}, locals={}, fromlist=\[\], level=0) + + An implementation of the built-in :func:`__import__` function. See the + built-in function's documentation for usage instructions. + +.. function:: import_module(name, package=None) + + Import a module. The ``name`` argument specifies what module to + 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 + 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. Modified: python/branches/py3k/Doc/library/modules.rst ============================================================================== --- python/branches/py3k/Doc/library/modules.rst (original) +++ python/branches/py3k/Doc/library/modules.rst Tue Jan 20 03:21:27 2009 @@ -18,3 +18,4 @@ pkgutil.rst modulefinder.rst runpy.rst + importlib.rst Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Tue Jan 20 03:21:27 2009 @@ -1,12 +1,11 @@ to do ///// -* Write importlib.__import__ +* Expose resolve_name(). -* Document - + Package. +* Backport to Python 2.7. + import_module - + __import__ + + resolve_name * Create reasonable base tests that all finders and loaders must pass so that various implementations can just subclass as needed. @@ -42,7 +41,7 @@ - Absolute name from sys.path. - Relative name from sys.path. -* Public API (w/ docs!) +* Public API to expose (w/ docs!) + abc - Finder * find_module @@ -72,9 +71,5 @@ - Source/bytecode importers * SourceFinder * (?) Loader - + __init__ - - __import__ - - import_module (backport to 2.7) - - resolve_name (backport to 2.7) * Bootstrap importlib as implementation of builtins.__import__ Modified: python/branches/py3k/Lib/importlib/__init__.py ============================================================================== --- python/branches/py3k/Lib/importlib/__init__.py (original) +++ python/branches/py3k/Lib/importlib/__init__.py Tue Jan 20 03:21:27 2009 @@ -79,27 +79,6 @@ return x -def import_module(name, package=None): - """Import a module. - - The 'package' argument is used to resolve relative import names. Typically - this is the __package__ attribute of the module making the function call. - - """ - 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] - - - # Required built-in modules. try: import posix as _os @@ -130,4 +109,30 @@ marshal._w_long = _w_long marshal._r_long = _r_long + +__import__ = _bootstrap.Import().__call__ + + +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 = Import._resolve_name(name[level:], package, level) + __import__(name) + return sys.modules[name] + + + from ._bootstrap import * Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 20 03:21:27 2009 @@ -134,6 +134,8 @@ Library ------- +- Add the importlib package. + - Issue #4301: Patch the logging module to add processName support, remove _check_logger_class from multiprocessing. From python-checkins at python.org Tue Jan 20 03:24:38 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 03:24:38 +0100 (CET) Subject: [Python-checkins] r68792 - python/trunk/Lib/collections.py Message-ID: <20090120022438.DCABF1E4035@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 03:24:38 2009 New Revision: 68792 Log: Add Counter() to __all__. Modified: python/trunk/Lib/collections.py Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 20 03:24:38 2009 @@ -1,4 +1,4 @@ -__all__ = ['deque', 'defaultdict', 'namedtuple'] +__all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * From buildbot at python.org Tue Jan 20 03:50:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 02:50:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090120025052.7F53C1E401D@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/136 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: jesse.noller 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 Tue Jan 20 03:56:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 02:56:08 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090120025608.B15BC1E4002@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/733 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_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 20 04:36:37 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 04:36:37 +0100 (CET) Subject: [Python-checkins] r68793 - python/trunk/Lib/collections.py Message-ID: <20090120033637.290441E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 04:36:36 2009 New Revision: 68793 Log: Make merging easier by formattng comment blocks the same in Py3.1 Modified: python/trunk/Lib/collections.py Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 20 04:36:36 2009 @@ -12,8 +12,9 @@ import heapq as _heapq from itertools import repeat as _repeat, chain as _chain, starmap as _starmap, ifilter as _ifilter -######################################################################## -### namedtuple ####################################################### +################################################################################ +### namedtuple +################################################################################ def namedtuple(typename, field_names, verbose=False): """Returns a new subclass of tuple with named fields. @@ -114,7 +115,8 @@ ######################################################################## -### Counter ########################################################## +### Counter +######################################################################## class Counter(dict): '''Dict subclass for counting hashable items. Sometimes called a bag From python-checkins at python.org Tue Jan 20 04:41:23 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 04:41:23 +0100 (CET) Subject: [Python-checkins] r68794 - in python/branches/py3k: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Message-ID: <20090120034123.3CCDA1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 04:41:22 2009 New Revision: 68794 Log: Forward port r68792 and r68789 putting Counter in __all__ and adding Counter buildouts. Modified: python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Tue Jan 20 04:41:22 2009 @@ -177,6 +177,7 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args The returned object has a dictionary style interface except that it returns a zero count for missing items (instead of raising a :exc:`KeyError` like a @@ -207,7 +208,7 @@ Elements are returned in arbitrary order. If an element's count has been set to zero or a negative number, :meth:`elements` will ignore it. - >>> c = Counter({'a': 4, 'b': 2, 'd': 0, 'e': -2}) + >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) ['a', 'a', 'a', 'a', 'b', 'b'] @@ -232,10 +233,10 @@ .. method:: update([iterable-or-mapping]) - Like :meth:`dict.update` but adds-in counts instead of replacing them. - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter):: + *mapping* (or counter). Like :meth:`dict.update` but adds-in counts + instead of replacing them, and the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs:: >>> c = Counter('which') >>> c.update('witch') # add elements from another iterable @@ -255,6 +256,34 @@ Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs c.most_common()[:-n:-1] # n least common elements +Several multiset mathematical operations are provided for combining +:class:`Counter` objects. Multisets are like regular sets but 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:: + + >>> c = Counter('a': 3, 'b': 1}) + >>> d = Counter({'a': 1, 'b': 2}) + >>> c + d # add two counters together: c[x] + d[x] + Counter({'a': 4, 'b': 3}) + >>> c - d # subtract (keeping only positive counts) + Counter({'a': 2}) + >>> c & d # interection: min(c[x], d[x]) + Counter({'a': 1, 'b': 1}) + >>> c | d # union: max(c[x], d[x]) + Counter({'a': 3, 'b': 2}) + +All four multiset operations produce only positive counts (negative and zero +results are skipped). If inputs include negative counts, addition will sum +both counts and then exclude non-positive results. The other three operations +are undefined for negative inputs:: + + >>> e = Counter(a=8, b=-2, c=0) + >>> e += Counter() # remove zero and negative counts + >>> e + Counter({'a': 8}) + **References**: * Wikipedia entry for `Multisets `_ Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Tue Jan 20 04:41:22 2009 @@ -1,5 +1,5 @@ __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', - 'UserString'] + 'UserString', 'Counter'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * @@ -171,7 +171,7 @@ # http://code.activestate.com/recipes/259174/ # Knuth, TAOCP Vol. II section 4.6.3 - def __init__(self, iterable=None): + def __init__(self, iterable=None, **kwds): '''Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. @@ -179,9 +179,10 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + >>> c = Counter(a=4, b=2) # a new counter from keyword args ''' - self.update(iterable) + self.update(iterable, **kwds) def __missing__(self, key): 'The count of elements not in the Counter is zero.' @@ -232,7 +233,7 @@ raise NotImplementedError( 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') - def update(self, iterable=None): + def update(self, iterable=None, **kwds): '''Like dict.update() but add counts instead of replacing them. Source can be an iterable, a dictionary, or another Counter instance. @@ -249,10 +250,8 @@ # replace behavior results in the some of original untouched counts # being mixed-in with all of the other counts for a mismash that # doesn't have a straight-forward interpretation in most counting - # contexts. Instead, we look to Knuth for suggested operations on - # multisets and implement the union-add operation discussed in - # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for - # multisets calls that operation a sum or join. + # contexts. Instead, we implement straight-addition. Both the inputs + # and outputs are allowed to contain zero and negative counts. if iterable is not None: if isinstance(iterable, Mapping): @@ -261,17 +260,102 @@ else: for elem in iterable: self[elem] += 1 + if kwds: + self.update(kwds) def copy(self): 'Like dict.copy() but returns a Counter instance instead of a dict.' return Counter(self) + def __delitem__(self, elem): + 'Like dict.__delitem__() but does not raise KeyError for missing values.' + if elem in self: + dict.__delitem__(self, elem) + def __repr__(self): if not self: return '%s()' % self.__class__.__name__ items = ', '.join(map('%r: %r'.__mod__, self.most_common())) return '%s({%s})' % (self.__class__.__name__, items) + # Multiset-style mathematical operations discussed in: + # Knuth TAOCP Volume II section 4.6.3 exercise 19 + # and at http://en.wikipedia.org/wiki/Multiset + # + # Results are undefined when inputs contain negative counts. + # Outputs guaranteed to only include positive counts. + # + # To strip negative and zero counts, add-in an empty counter: + # c += Counter() + + def __add__(self, other): + '''Add counts from two counters. + + >>> Counter('abbb') + Counter('bcc') + Counter({'b': 4, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem in set(self) | set(other): + newcount = self[elem] + other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __sub__(self, other): + ''' Subtract count, but keep only results with positive counts. + + >>> Counter('abbbc') - Counter('bccd') + Counter({'b': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.items(): + newcount = count - other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __or__(self, other): + '''Union is the maximum of value in either of the input counters. + + >>> Counter('abbb') | Counter('bcc') + Counter({'b': 3, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _max = max + result = Counter() + for elem in set(self) | set(other): + newcount = _max(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + + def __and__(self, other): + ''' Intersection is the minimum of corresponding counts. + + >>> Counter('abbb') & Counter('bcc') + Counter({'b': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _min = min + result = Counter() + if len(self) < len(other): + self, other = other, self + for elem in filter(self.__contains__, other): + newcount = _min(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + ################################################################################ ### UserDict 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 Jan 20 04:41:22 2009 @@ -4,6 +4,8 @@ from test import support from collections import namedtuple, Counter, Mapping import pickle, copy +from random import randrange +import operator from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -361,6 +363,8 @@ def test_basics(self): c = Counter('abcaba') + self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1})) + self.assertEqual(c, Counter(a=3, b=2, c=1)) self.assert_(isinstance(c, dict)) self.assert_(isinstance(c, Mapping)) self.assert_(issubclass(Counter, dict)) @@ -388,6 +392,7 @@ c['a'] += 1 # increment an existing value c['b'] -= 2 # sub existing value to zero del c['c'] # remove an entry + del c['c'] # make sure that del doesn't raise KeyError c['d'] -= 2 # sub from a missing value c['e'] = -5 # directly assign a missing value c['f'] += 4 # add to a missing value @@ -403,7 +408,8 @@ self.assertEqual(repr(c), 'Counter()') self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') self.assertRaises(TypeError, hash, c) - c.update(dict(a=5, b=3, c=1)) + c.update(dict(a=5, b=3)) + c.update(c=1) c.update(Counter('a' * 50 + 'b' * 30)) c.update() # test case with no args c.__init__('a' * 500 + 'b' * 300) @@ -447,7 +453,43 @@ self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) self.assertEqual(set(Counter(s)), set(s)) - + def test_multiset_operations(self): + # Verify that adding a zero counter will strip zeros and negatives + c = Counter(a=10, b=-2, c=0) + Counter() + self.assertEqual(dict(c), dict(a=10)) + + elements = 'abcd' + for i in range(1000): + # test random pairs of multisets + p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + for counterop, numberop, defneg in [ + (Counter.__add__, lambda x, y: x+y if x+y>0 else 0, True), + (Counter.__sub__, lambda x, y: x-y if x-y>0 else 0, False), + (Counter.__or__, max, False), + (Counter.__and__, min, False), + ]: + result = counterop(p, q) + for x in elements: + # all except __add__ are undefined for negative inputs + if defneg or (p[x] >= 0 and q[x] >= 0): + self.assertEqual(numberop(p[x], q[x]), result[x]) + # verify that results exclude non-positive counts + self.assert_(x>0 for x in result.values()) + + elements = 'abcdef' + for i in range(100): + # verify that random multisets with no repeats are exactly like sets + p = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + q = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + for counterop, setop in [ + (Counter.__sub__, set.__sub__), + (Counter.__or__, set.__or__), + (Counter.__and__, set.__and__), + ]: + counter_result = counterop(p, q) + set_result = setop(set(p.elements()), set(q.elements())) + self.assertEqual(counter_result, dict.fromkeys(set_result, 1)) import doctest, collections From python-checkins at python.org Tue Jan 20 05:02:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 05:02:27 +0100 (CET) Subject: [Python-checkins] r68795 - python/branches/py3k Message-ID: <20090120040227.58C1C1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 05:02:27 2009 New Revision: 68795 Log: Blocked revisions 68789,68792 via svnmerge ........ r68789 | raymond.hettinger | 2009-01-19 19:19:26 -0600 (Mon, 19 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-19 20:24:38 -0600 (Mon, 19 Jan 2009) | 1 line Add Counter() to __all__. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Jan 20 05:02:33 2009 From: python-checkins at python.org (gregory.p.smith) Date: Tue, 20 Jan 2009 05:02:33 +0100 (CET) Subject: [Python-checkins] r68796 - in python/branches/release30-maint: Lib/socket.py Lib/test/test_socket.py Misc/NEWS Message-ID: <20090120040233.A31D01E4002@bag.python.org> Author: gregory.p.smith Date: Tue Jan 20 05:02:33 2009 New Revision: 68796 Log: Backport r68539, Fixes issue #3826 and #4791: Have SocketIO objects update their reference count in the underlying socket object on close() so that the underlying socket object is closed immediately when the last user is done rather than at an unknown later time when garbage collection can do it. Modified: python/branches/release30-maint/Lib/socket.py python/branches/release30-maint/Lib/test/test_socket.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/socket.py ============================================================================== --- python/branches/release30-maint/Lib/socket.py (original) +++ python/branches/release30-maint/Lib/socket.py Tue Jan 20 05:02:33 2009 @@ -225,11 +225,12 @@ return self._writing and not self.closed def fileno(self): + self._checkClosed() return self._sock.fileno() @property def name(self): - return self._sock.fileno() + return self.fileno() @property def mode(self): @@ -239,9 +240,12 @@ if self.closed: return io.RawIOBase.close(self) + self._sock._decref_socketios() + self._sock = None def __del__(self): - self._sock._decref_socketios() + if not self.closed: + self._sock._decref_socketios() def getfqdn(name=''): 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 Tue Jan 20 05:02:33 2009 @@ -860,6 +860,16 @@ self.assertEqual(self.cli_file.mode, 'wb') self.assertEqual(self.cli_file.name, self.serv_conn.fileno()) + def testRealClose(self): + self.serv_file.close() + self.assertRaises(ValueError, self.serv_file.fileno) + self.cli_conn.close() + self.assertRaises(socket.error, self.cli_conn.getsockname) + + def _testRealClose(self): + pass + + class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase): """Repeat the tests from FileObjectClassTestCase with bufsize==0. @@ -885,6 +895,29 @@ self.cli_file.write(b"B. " + MSG) self.cli_file.flush() + def testMakefileClose(self): + # The file returned by makefile should keep the socket open... + self.cli_conn.close() + msg = self.cli_conn.recv(1024) + self.assertEqual(msg, MSG) + # ...until the file is itself closed + self.serv_file.close() + self.assertRaises(socket.error, self.cli_conn.recv, 1024) + + def _testMakefileClose(self): + self.cli_file.write(MSG) + self.cli_file.flush() + + def testMakefileCloseSocketDestroy(self): + refcount_before = sys.getrefcount(self.cli_conn) + self.serv_file.close() + refcount_after = sys.getrefcount(self.cli_conn) + self.assertEqual(refcount_before - 1, refcount_after) + + def _testMakefileCloseSocketDestroy(self): + pass + + class LineBufferedFileObjectClassTestCase(FileObjectClassTestCase): bufsize = 1 # Default-buffered for reading; line-buffered for writing Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Jan 20 05:02:33 2009 @@ -95,6 +95,10 @@ Library ------- +- Issue #3826 and #4791: The socket module now closes the underlying socket + appropriately when it is being used via socket.makefile() objects + rather than delaying the close by waiting for garbage collection to do it. + - Issue #4867: Fixed a crash in ctypes when passing a string to a function without defining argtypes. From buildbot at python.org Tue Jan 20 06:28:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 05:28:04 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090120052804.A50931E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/146 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 07:29:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 06:29:20 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090120062921.453DF1E4002@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/138 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: 4 tests failed: test_distutils test_io test_posix test_traceback ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 928, in testBasicIO self.assertEquals(f.write("abc"), 3) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 763, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1730, in read decoder.decode(self.buffer.read(), final=True)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 781, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 889, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 538, in readlines return list(self) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1746, in __next__ line = self.readline() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1819, in readline while self._read_chunk(): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 914, in testNewlinesOutput txt.write(data) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 1154, in test_issue1395_1 c = txt.read(1) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 1166, in test_issue1395_2 c = txt.read(4) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 1176, in test_issue1395_3 reads = txt.read(4) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 1187, in test_issue1395_4 reads = txt.read(4) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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 "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_io.py", line 1195, in test_issue1395_5 reads = txt.read(4) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home2/buildbot/slave/3.x.loewis-sun/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_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' ====================================================================== ERROR: test_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home2/buildbot/slave/3.x.loewis-sun/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 Tue Jan 20 08:11:48 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 08:11:48 +0100 (CET) Subject: [Python-checkins] r68797 - python/trunk/Doc/library/collections.rst Message-ID: <20090120071148.438E81E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 08:11:47 2009 New Revision: 68797 Log: Don't disrupt automatic url target name generation with manually specified, conflicting names. Before: http://docs.python.org/dev/library/collections.html#id1 After: http://docs.python.org/dev/library/collections.html#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 Tue Jan 20 08:11:47 2009 @@ -152,8 +152,6 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) -.. _counter-objects: - :class:`Counter` objects ------------------------ @@ -281,7 +279,7 @@ Counter({'a': 4, 'b': 3}) >>> c - d # subtract (keeping only positive counts) Counter({'a': 2}) - >>> c & d # interection: min(c[x], d[x]) + >>> c & d # intersection: min(c[x], d[x]) Counter({'a': 1, 'b': 1}) >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) @@ -314,13 +312,9 @@ Section 4.6.3, Exercise 19 - -.. _deque-objects: - :class:`deque` objects ---------------------- - .. class:: deque([iterable[, maxlen]]) Returns a new deque object initialized left-to-right (using :meth:`append`) with @@ -469,8 +463,6 @@ deque(['c', 'b', 'a']) -.. _deque-recipes: - :class:`deque` Recipes ^^^^^^^^^^^^^^^^^^^^^^ @@ -518,12 +510,10 @@ 'Return the last n lines of a file' return deque(open(filename), n) -.. _defaultdict-objects: :class:`defaultdict` objects ---------------------------- - .. class:: defaultdict([default_factory[, ...]]) Returns a new dictionary-like object. :class:`defaultdict` is a subclass of the @@ -569,8 +559,6 @@ ``None``, if absent. -.. _defaultdict-examples: - :class:`defaultdict` Examples ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -640,8 +628,6 @@ [('blue', set([2, 4])), ('red', set([1, 3]))] -.. _named-tuple-factory: - :func:`namedtuple` Factory Function for Tuples with Named Fields ---------------------------------------------------------------- From python-checkins at python.org Tue Jan 20 08:15:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 08:15:22 +0100 (CET) Subject: [Python-checkins] r68798 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090120071522.DCC221E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 08:15:22 2009 New Revision: 68798 Log: Forward port r68797: Fix-up jump targets in 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 Jan 20 08:15:22 2009 @@ -140,8 +140,6 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) -.. _counter-objects: - :class:`Counter` objects ------------------------ @@ -269,7 +267,7 @@ Counter({'a': 4, 'b': 3}) >>> c - d # subtract (keeping only positive counts) Counter({'a': 2}) - >>> c & d # interection: min(c[x], d[x]) + >>> c & d # intersection: min(c[x], d[x]) Counter({'a': 1, 'b': 1}) >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) @@ -302,13 +300,9 @@ Section 4.6.3, Exercise 19 - -.. _deque-objects: - :class:`deque` objects ---------------------- - .. class:: deque([iterable[, maxlen]]) Returns a new deque object initialized left-to-right (using :meth:`append`) with @@ -451,8 +445,6 @@ deque(['c', 'b', 'a']) -.. _deque-recipes: - :class:`deque` Recipes ^^^^^^^^^^^^^^^^^^^^^^ @@ -500,12 +492,10 @@ 'Return the last n lines of a file' return deque(open(filename), n) -.. _defaultdict-objects: :class:`defaultdict` objects ---------------------------- - .. class:: defaultdict([default_factory[, ...]]) Returns a new dictionary-like object. :class:`defaultdict` is a subclass of the @@ -549,8 +539,6 @@ ``None``, if absent. -.. _defaultdict-examples: - :class:`defaultdict` Examples ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -620,8 +608,6 @@ [('blue', set([2, 4])), ('red', set([1, 3]))] -.. _named-tuple-factory: - :func:`namedtuple` Factory Function for Tuples with Named Fields ---------------------------------------------------------------- From python-checkins at python.org Tue Jan 20 08:24:44 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 08:24:44 +0100 (CET) Subject: [Python-checkins] r68799 - in python/branches/py3k/Lib: decimal.py distutils/command/wininst-8.0.exe Message-ID: <20090120072444.8524E1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 08:24:44 2009 New Revision: 68799 Log: Issue 4998: Decimal should not subclass or register with numbers.Real. Modified: python/branches/py3k/Lib/decimal.py python/branches/py3k/Lib/distutils/command/wininst-8.0.exe Modified: python/branches/py3k/Lib/decimal.py ============================================================================== --- python/branches/py3k/Lib/decimal.py (original) +++ python/branches/py3k/Lib/decimal.py Tue Jan 20 08:24:44 2009 @@ -134,7 +134,6 @@ 'setcontext', 'getcontext', 'localcontext' ] -import numbers as _numbers import copy as _copy import math as _math @@ -501,7 +500,11 @@ ##### Decimal class ####################################################### -class 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(object): """Floating point class for decimal arithmetic.""" __slots__ = ('_exp','_int','_sign', '_is_special') @@ -1757,14 +1760,10 @@ >>> round(Decimal('Inf')) Traceback (most recent call last): ... - ... - ... OverflowError: cannot round an infinity >>> round(Decimal('NaN')) Traceback (most recent call last): ... - ... - ... ValueError: cannot round a NaN If a second argument n is supplied, self is rounded to n Modified: python/branches/py3k/Lib/distutils/command/wininst-8.0.exe ============================================================================== Binary files. No diff available. From python-checkins at python.org Tue Jan 20 08:27:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 08:27:47 +0100 (CET) Subject: [Python-checkins] r68800 - in python/branches/release30-maint: Lib/decimal.py Misc/NEWS Message-ID: <20090120072747.B4C6B1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 08:27:47 2009 New Revision: 68800 Log: Issue 4998: Decimal should not subclass or register with numbers.Real. Modified: python/branches/release30-maint/Lib/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 Jan 20 08:27:47 2009 @@ -134,7 +134,6 @@ 'setcontext', 'getcontext', 'localcontext' ] -import numbers as _numbers import copy as _copy try: @@ -500,7 +499,11 @@ ##### Decimal class ####################################################### -class 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(object): """Floating point class for decimal arithmetic.""" __slots__ = ('_exp','_int','_sign', '_is_special') @@ -1716,14 +1719,10 @@ >>> round(Decimal('Inf')) Traceback (most recent call last): ... - ... - ... OverflowError: cannot round an infinity >>> round(Decimal('NaN')) Traceback (most recent call last): ... - ... - ... ValueError: cannot round a NaN If a second argument n is supplied, self is rounded to n Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Jan 20 08:27:47 2009 @@ -99,6 +99,9 @@ appropriately when it is being used via socket.makefile() objects 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. + - Issue #4867: Fixed a crash in ctypes when passing a string to a function without defining argtypes. From buildbot at python.org Tue Jan 20 09:43:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 08:43:02 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090120084302.A204C1E4002@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/56 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: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/multiprocessing/managers.py", line 188, in handle_request result = func(c, *args, **kwds) File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/multiprocessing/managers.py", line 306, in debug_info keys.sort() TypeError: unorderable types: str() < int() 1 test failed: test_multiprocessing sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 09:56:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 08:56:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090120085636.A6F431E4002@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/74 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: 4 tests failed: test_distutils test_posix test_smtplib test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 ncoghlan at gmail.com Tue Jan 20 11:00:35 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Tue, 20 Jan 2009 20:00:35 +1000 Subject: [Python-checkins] r68785 - python/trunk/Lib/test/test_os.py In-Reply-To: <20090119210837.4D4CA1E4002@bag.python.org> References: <20090119210837.4D4CA1E4002@bag.python.org> Message-ID: <4975A0C3.5020103@gmail.com> benjamin.peterson wrote: > + with test_support.check_warnings(): > + # silence deprecation warnings about float arguments > + self.assertEqual(len(os.urandom(0.9)), 0) > + self.assertEqual(len(os.urandom(1.1)), 1) > + self.assertEqual(len(os.urandom(2.0)), 2) > except NotImplementedError: > pass If you're going to add the check_warnings call, you might as well add the corresponding asserts to check that the DeprecationWarnings are actually being emitted... Cheers, Nick. P.S. I found those DeprecationWarnings annoying as well, I just never thought to do anything about it -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Tue Jan 20 11:46:23 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 11:46:23 +0100 (CET) Subject: [Python-checkins] r68801 - python/trunk/Lib/idlelib/EditorWindow.py Message-ID: <20090120104623.E00C71E400C@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 11:46:23 2009 New Revision: 68801 Log: Use Georg's new permalinks to documentation by version number. That assures that IDLE's help always points to the correct version and the latest update with all bug fixes. Modified: python/trunk/Lib/idlelib/EditorWindow.py Modified: python/trunk/Lib/idlelib/EditorWindow.py ============================================================================== --- python/trunk/Lib/idlelib/EditorWindow.py (original) +++ python/trunk/Lib/idlelib/EditorWindow.py Tue Jan 20 11:46:23 2009 @@ -80,7 +80,7 @@ # Safari requires real file:-URLs EditorWindow.help_url = 'file://' + EditorWindow.help_url else: - EditorWindow.help_url = "http://www.python.org/doc/current" + EditorWindow.help_url = "http://docs.python.org/%d.%d" % sys.version_info[:2] currentTheme=idleConf.CurrentTheme() self.flist = flist root = root or flist.root From python-checkins at python.org Tue Jan 20 12:42:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 12:42:11 +0100 (CET) Subject: [Python-checkins] r68802 - python/branches/py3k/Modules/_fileio.c Message-ID: <20090120114211.D7DBB1E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 12:42:11 2009 New Revision: 68802 Log: Fix typo Modified: python/branches/py3k/Modules/_fileio.c Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Tue Jan 20 12:42:11 2009 @@ -591,7 +591,7 @@ #if SEEK_CUR != 1 case 1: whence = SEEK_CUR; break; #endif -#if SEEL_END != 2 +#if SEEK_END != 2 case 2: whence = SEEK_END; break; #endif } From buildbot at python.org Tue Jan 20 12:56:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 11:56:04 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090120115604.8FFFB1E403E@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/37 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: 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/test/test_poplib.py", line 131, in run asyncore.loop(timeout=0.1, count=1) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 141, in poll read(obj) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/home/pybot/buildarea/trunk.klose-debian-ppc/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 Tue Jan 20 13:26:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 12:26:30 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090120122630.E36EB1E4002@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/140 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 20 13:59:37 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 13:59:37 +0100 (CET) Subject: [Python-checkins] r68803 - python/trunk/Doc/library/collections.rst Message-ID: <20090120125937.141BC1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 13:59:36 2009 New Revision: 68803 Log: Fix typos. 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 Jan 20 13:59:36 2009 @@ -169,7 +169,7 @@ # Find the ten most common words in Hamlet >>> import re >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) - >>> Counter(hamlet_words).most_common(10) + >>> Counter(words).most_common(10) [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] @@ -218,7 +218,7 @@ Elements are returned in arbitrary order. If an element's count has been set to zero or a negative number, :meth:`elements` will ignore it. - >>> c = Counter(a=4, b=2, c=0, d=-2) + >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) ['a', 'a', 'a', 'a', 'b', 'b'] @@ -273,7 +273,7 @@ corresponding elements. Intersection and union return the minimum and maximum of corresponding counts:: - >>> c = Counter('a': 3, 'b': 1}) + >>> c = Counter({'a': 3, 'b': 1}) >>> d = Counter({'a': 1, 'b': 2}) >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) From python-checkins at python.org Tue Jan 20 14:00:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 14:00:59 +0100 (CET) Subject: [Python-checkins] r68804 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090120130059.437151E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 14:00:59 2009 New Revision: 68804 Log: Fix typos. 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 Jan 20 14:00:59 2009 @@ -157,7 +157,7 @@ # Find the ten most common words in Hamlet >>> import re >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) - >>> Counter(hamlet_words).most_common(10) + >>> Counter(words).most_common(10) [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] @@ -206,7 +206,7 @@ Elements are returned in arbitrary order. If an element's count has been set to zero or a negative number, :meth:`elements` will ignore it. - >>> c = Counter(a=4, b=2, c=0, d=-2) + >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) ['a', 'a', 'a', 'a', 'b', 'b'] @@ -261,7 +261,7 @@ corresponding elements. Intersection and union return the minimum and maximum of corresponding counts:: - >>> c = Counter('a': 3, 'b': 1}) + >>> c = Counter({'a': 3, 'b': 1}) >>> d = Counter({'a': 1, 'b': 2}) >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) From benjamin at python.org Tue Jan 20 15:13:27 2009 From: benjamin at python.org (Benjamin Peterson) Date: Tue, 20 Jan 2009 08:13:27 -0600 Subject: [Python-checkins] r68785 - python/trunk/Lib/test/test_os.py In-Reply-To: <4975A0C3.5020103@gmail.com> References: <20090119210837.4D4CA1E4002@bag.python.org> <4975A0C3.5020103@gmail.com> Message-ID: <1afaf6160901200613w644dff90n1a0702f70830b57f@mail.gmail.com> On Tue, Jan 20, 2009 at 4:00 AM, Nick Coghlan wrote: > benjamin.peterson wrote: >> + with test_support.check_warnings(): >> + # silence deprecation warnings about float arguments >> + self.assertEqual(len(os.urandom(0.9)), 0) >> + self.assertEqual(len(os.urandom(1.1)), 1) >> + self.assertEqual(len(os.urandom(2.0)), 2) >> except NotImplementedError: >> pass > > > If you're going to add the check_warnings call, you might as well add > the corresponding asserts to check that the DeprecationWarnings are > actually being emitted... The deprecation warnings aren't the point of the test; it's to make sure os.urandom doesn't go into an infinite loop when its passed float arguments. I assume the actual deprecation of coercing floats to ints is tested elsewhere. -- Regards, Benjamin From python-checkins at python.org Tue Jan 20 15:21:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 15:21:17 +0100 (CET) Subject: [Python-checkins] r68805 - in python/trunk: Lib/test/test_extcall.py Misc/NEWS Python/ceval.c Message-ID: <20090120142117.358231E403E@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 15:21:16 2009 New Revision: 68805 Log: allow unicode keyword arguments for the ** syntax #4978 Modified: python/trunk/Lib/test/test_extcall.py python/trunk/Misc/NEWS python/trunk/Python/ceval.c Modified: python/trunk/Lib/test/test_extcall.py ============================================================================== --- python/trunk/Lib/test/test_extcall.py (original) +++ python/trunk/Lib/test/test_extcall.py Tue Jan 20 15:21:16 2009 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """Doctest for method/function calls. We're going the use these types for extra testing @@ -252,11 +253,30 @@ """ +import unittest from test import test_support + +class UnicodeKeywordArgsTest(unittest.TestCase): + + def test_unicode_keywords(self): + def f(a): + return a + self.assertEqual(f(**{u'a': 4}), 4) + self.assertRaises(TypeError, f, **{u'st?ren': 4}) + self.assertRaises(TypeError, f, **{u'someLongString':2}) + try: + f(a=4, **{u'a': 4}) + except TypeError: + pass + else: + self.fail("duplicate arguments didn't raise") + + def test_main(): from test import test_extcall # self import test_support.run_doctest(test_extcall, True) + test_support.run_unittest(UnicodeKeywordArgsTest) if __name__ == '__main__': test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 20 15:21:16 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4978: Passing keyword arguments as unicode strings is now allowed. + - os.ftruncate raises OSErrors instead of IOErrors for consistency with other os functions. Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Tue Jan 20 15:21:16 2009 @@ -127,6 +127,7 @@ static void format_exc_check_arg(PyObject *, char *, PyObject *); static PyObject * string_concatenate(PyObject *, PyObject *, PyFrameObject *, unsigned char *); +static PyObject * kwd_as_string(PyObject *); #define NAME_ERROR_MSG \ "name '%.200s' is not defined" @@ -2932,7 +2933,8 @@ PyObject *keyword = kws[2*i]; PyObject *value = kws[2*i + 1]; int j; - if (keyword == NULL || !PyString_Check(keyword)) { + if (keyword == NULL || !(PyString_Check(keyword) || + PyUnicode_Check(keyword))) { PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", PyString_AsString(co->co_name)); @@ -2961,11 +2963,15 @@ goto fail; if (j >= co->co_argcount) { if (kwdict == NULL) { - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected " - "keyword argument '%.400s'", - PyString_AsString(co->co_name), - PyString_AsString(keyword)); + PyObject *kwd_str = kwd_as_string(keyword); + if (kwd_str) { + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected " + "keyword argument '%.400s'", + PyString_AsString(co->co_name), + PyString_AsString(kwd_str)); + Py_DECREF(kwd_str); + } goto fail; } PyDict_SetItem(kwdict, keyword, value); @@ -2973,12 +2979,16 @@ } kw_found: if (GETLOCAL(j) != NULL) { - PyErr_Format(PyExc_TypeError, - "%.200s() got multiple " - "values for keyword " - "argument '%.400s'", - PyString_AsString(co->co_name), - PyString_AsString(keyword)); + PyObject *kwd_str = kwd_as_string(keyword); + if (kwd_str) { + PyErr_Format(PyExc_TypeError, + "%.200s() got multiple " + "values for keyword " + "argument '%.400s'", + PyString_AsString(co->co_name), + PyString_AsString(kwd_str)); + Py_DECREF(kwd_str); + } goto fail; } Py_INCREF(value); @@ -3105,6 +3115,17 @@ } +static PyObject * +kwd_as_string(PyObject *kwd) { + if (PyString_Check(kwd)) { + Py_INCREF(kwd); + return kwd; + } + else + return _PyUnicode_AsDefaultEncodedString(kwd, "replace"); +} + + /* Implementation notes for set_exc_info() and reset_exc_info(): - Below, 'exc_ZZZ' stands for 'exc_type', 'exc_value' and From python-checkins at python.org Tue Jan 20 15:24:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 15:24:13 +0100 (CET) Subject: [Python-checkins] r68806 - python/branches/py3k Message-ID: <20090120142413.D41921E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 15:24:13 2009 New Revision: 68806 Log: Blocked revisions 68803,68805 via svnmerge ........ r68803 | raymond.hettinger | 2009-01-20 06:59:36 -0600 (Tue, 20 Jan 2009) | 1 line Fix typos. ........ r68805 | benjamin.peterson | 2009-01-20 08:21:16 -0600 (Tue, 20 Jan 2009) | 1 line allow unicode keyword arguments for the ** syntax #4978 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Jan 20 15:31:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 15:31:08 +0100 (CET) Subject: [Python-checkins] r68807 - python/trunk/Modules/_fileio.c Message-ID: <20090120143108.622331E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 15:31:08 2009 New Revision: 68807 Log: backport r68802 (bugfix) Modified: python/trunk/Modules/_fileio.c Modified: python/trunk/Modules/_fileio.c ============================================================================== --- python/trunk/Modules/_fileio.c (original) +++ python/trunk/Modules/_fileio.c Tue Jan 20 15:31:08 2009 @@ -566,7 +566,7 @@ #if SEEK_CUR != 1 case 1: whence = SEEK_CUR; break; #endif -#if SEEL_END != 2 +#if SEEK_END != 2 case 2: whence = SEEK_END; break; #endif } From python-checkins at python.org Tue Jan 20 15:33:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 15:33:16 +0100 (CET) Subject: [Python-checkins] r68808 - python/branches/py3k Message-ID: <20090120143316.195CA1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 15:33:15 2009 New Revision: 68808 Log: Blocked revisions 68807 via svnmerge ........ r68807 | benjamin.peterson | 2009-01-20 08:31:08 -0600 (Tue, 20 Jan 2009) | 1 line backport r68802 (bugfix) ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Jan 20 16:01:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 16:01:55 +0100 (CET) Subject: [Python-checkins] r68809 - in python/branches/py3k: Lib/idlelib/EditorWindow.py Message-ID: <20090120150155.0EB731E4036@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 16:01:54 2009 New Revision: 68809 Log: Merged revisions 68797,68801 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68797 | raymond.hettinger | 2009-01-20 01:11:47 -0600 (Tue, 20 Jan 2009) | 11 lines Don't disrupt automatic url target name generation with manually specified, conflicting names. Before: http://docs.python.org/dev/library/collections.html#id1 After: http://docs.python.org/dev/library/collections.html#counter-objects ........ r68801 | raymond.hettinger | 2009-01-20 04:46:23 -0600 (Tue, 20 Jan 2009) | 5 lines Use Georg's new permalinks to documentation by version number. That assures that IDLE's help always points to the correct version and the latest update with all bug fixes. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/idlelib/EditorWindow.py Modified: python/branches/py3k/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/py3k/Lib/idlelib/EditorWindow.py (original) +++ python/branches/py3k/Lib/idlelib/EditorWindow.py Tue Jan 20 16:01:54 2009 @@ -82,7 +82,7 @@ # Safari requires real file:-URLs EditorWindow.help_url = 'file://' + EditorWindow.help_url else: - EditorWindow.help_url = "http://docs.python.org/dev/3.0/" + EditorWindow.help_url = "http://docs.python.org/%d.%d" % sys.version_info[:2] currentTheme=idleConf.CurrentTheme() self.flist = flist root = root or flist.root From buildbot at python.org Tue Jan 20 16:12:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 15:12:59 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090120151259.D53F01E402F@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/927 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: benjamin.peterson,raymond.hettinger BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 16:18:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 15:18:37 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090120151837.2A97F1E4002@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/160 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: benjamin.peterson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 18:08:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 17:08:53 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090120170853.365A21E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/150 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 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 buildbot at python.org Tue Jan 20 18:35:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 17:35:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090120173522.CEB9B1E402A@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/142 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: 4 tests failed: test_distutils test_httpservers test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Tue Jan 20 19:50:52 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 19:50:52 +0100 (CET) Subject: [Python-checkins] r68810 - python/branches/py3k Message-ID: <20090120185052.4B3AE1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 19:50:52 2009 New Revision: 68810 Log: Blocked revisions 68764,68766 via svnmerge ........ r68764 | benjamin.peterson | 2009-01-19 09:04:35 -0600 (Mon, 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 09:06:33 -0600 (Mon, 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 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Jan 20 19:58:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 20 Jan 2009 19:58:27 +0100 (CET) Subject: [Python-checkins] r68811 - python/trunk/Objects/stringlib/fastsearch.h Message-ID: <20090120185827.99E7D1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 20 19:58:27 2009 New Revision: 68811 Log: fix url Modified: python/trunk/Objects/stringlib/fastsearch.h Modified: python/trunk/Objects/stringlib/fastsearch.h ============================================================================== --- python/trunk/Objects/stringlib/fastsearch.h (original) +++ python/trunk/Objects/stringlib/fastsearch.h Tue Jan 20 19:58:27 2009 @@ -5,7 +5,7 @@ /* fast search/count implementation, based on a mix between boyer- moore and horspool, with a few more bells and whistles on the top. - for some more background, see: http://effbot.org/stringlib */ + for some more background, see: http://effbot.org/stringlib.htm */ /* note: fastsearch may access s[n], which isn't a problem when using Python's ordinary string types, but may cause problems if you're From buildbot at python.org Tue Jan 20 20:28:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 19:28:02 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090120192803.043AD1E4002@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/149 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_tarfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 20:38:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 19:38:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090120193818.5F5F91E4002@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/1728 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 20:39:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 19:39:38 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090120193938.EA3641E4002@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/162 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Tue Jan 20 21:07:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 20:07:39 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090120200739.44F991E4002@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/40 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 20 21:15:52 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 21:15:52 +0100 (CET) Subject: [Python-checkins] r68812 - in python/branches/io-c: Lib/test/test_io.py Modules/_fileio.c Message-ID: <20090120201552.05C131E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 21:15:51 2009 New Revision: 68812 Log: Add garbage collection support to FileIO objects Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_fileio.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 Tue Jan 20 21:15:51 2009 @@ -7,6 +7,8 @@ import threading import random import unittest +import weakref +import gc from itertools import chain, cycle, count from collections import deque from test import support @@ -405,6 +407,21 @@ file = io.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. + class MyFileIO(io.FileIO): + pass + f = MyFileIO(support.TESTFN, "wb") + f.write(b"abcxxx") + f.f = 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"abcxxx") + class MemorySeekTestMixin: Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Tue Jan 20 21:15:51 2009 @@ -332,11 +332,26 @@ return ret; } +static int +fileio_traverse(PyFileIOObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->dict); + return 0; +} + +static int +fileio_clear(PyFileIOObject *self) +{ + Py_CLEAR(self->dict); + return 0; +} + static void fileio_dealloc(PyFileIOObject *self) { if (_PyIOBase_finalize((PyObject *) self) < 0) return; + _PyObject_GC_UNTRACK(self); if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *) self); Py_CLEAR(self->dict); @@ -918,12 +933,13 @@ PyObject_GenericGetAttr, /* 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 */ fileio_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)fileio_traverse, /* tp_traverse */ + (inquiry)fileio_clear, /* tp_clear */ 0, /* tp_richcompare */ - offsetof(PyFileIOObject, weakreflist), /* tp_weaklistoffset */ + offsetof(PyFileIOObject, weakreflist), /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ fileio_methods, /* tp_methods */ @@ -937,5 +953,5 @@ fileio_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ fileio_new, /* tp_new */ - PyObject_Del, /* tp_free */ + PyObject_GC_Del, /* tp_free */ }; From python-checkins at python.org Tue Jan 20 21:34:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 21:34:19 +0100 (CET) Subject: [Python-checkins] r68813 - in python/trunk: Lib/numbers.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090120203419.DDD371E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 21:34:19 2009 New Revision: 68813 Log: Issue 4998: __slots__ on Fractions was useless. Modified: python/trunk/Lib/numbers.py python/trunk/Lib/test/test_fractions.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/numbers.py ============================================================================== --- python/trunk/Lib/numbers.py (original) +++ python/trunk/Lib/numbers.py Tue Jan 20 21:34:19 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/trunk/Lib/test/test_fractions.py ============================================================================== --- python/trunk/Lib/test/test_fractions.py (original) +++ python/trunk/Lib/test/test_fractions.py Tue Jan 20 21:34:19 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/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 20 21:34:19 2009 @@ -145,6 +145,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 heirarchy 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 it is possible to segfault the interpreter. From python-checkins at python.org Tue Jan 20 21:43:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 20 Jan 2009 21:43:59 +0100 (CET) Subject: [Python-checkins] r68814 - in python/branches/py3k: Lib/pickle.py Lib/pickletools.py Lib/test/pickletester.py Misc/NEWS Modules/_pickle.c Message-ID: <20090120204359.24CDB1E4002@bag.python.org> Author: mark.dickinson Date: Tue Jan 20 21:43:58 2009 New Revision: 68814 Log: Issue #4842, patch 1/2: fix pickle in Python 3.x so that pickling with the 'L' opcode always appends an 'L' on output, just as 2.x does. When unpickling, remove the trailing 'L' (if present) before passing the result to PyLong_FromString. Modified: python/branches/py3k/Lib/pickle.py python/branches/py3k/Lib/pickletools.py python/branches/py3k/Lib/test/pickletester.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Lib/pickle.py ============================================================================== --- python/branches/py3k/Lib/pickle.py (original) +++ python/branches/py3k/Lib/pickle.py Tue Jan 20 21:43:58 2009 @@ -470,7 +470,7 @@ else: self.write(LONG4 + pack(">> dis(pickle.dumps(x, 1)) Modified: python/branches/py3k/Lib/test/pickletester.py ============================================================================== --- python/branches/py3k/Lib/test/pickletester.py (original) +++ python/branches/py3k/Lib/test/pickletester.py Tue Jan 20 21:43:58 2009 @@ -90,21 +90,21 @@ # the object returned by create_data(). DATA0 = ( - b'(lp0\nL0\naL1\naF2.0\nac' + b'(lp0\nL0L\naL1L\naF2.0\nac' b'builtins\ncomplex\n' b'p1\n(F3.0\nF0.0\ntp2\nRp' - b'3\naL1\naL-1\naL255\naL-' - b'255\naL-256\naL65535\na' - b'L-65535\naL-65536\naL2' - b'147483647\naL-2147483' - b'647\naL-2147483648\na(' + b'3\naL1L\naL-1L\naL255L\naL-' + b'255L\naL-256L\naL65535L\na' + b'L-65535L\naL-65536L\naL2' + b'147483647L\naL-2147483' + b'647L\naL-2147483648L\na(' b'Vabc\np4\ng4\nccopyreg' b'\n_reconstructor\np5\n(' b'c__main__\nC\np6\ncbu' b'iltins\nobject\np7\nNt' b'p8\nRp9\n(dp10\nVfoo\np1' - b'1\nL1\nsVbar\np12\nL2\nsb' - b'g9\ntp13\nag13\naL5\na.' + b'1\nL1L\nsVbar\np12\nL2L\nsb' + b'g9\ntp13\nag13\naL5L\na.' ) # Disassembly of DATA0 @@ -113,80 +113,80 @@ 1: l LIST (MARK at 0) 2: p PUT 0 5: L LONG 0 - 8: a APPEND - 9: L LONG 1 - 12: a APPEND - 13: F FLOAT 2.0 - 18: a APPEND - 19: c GLOBAL 'builtins complex' - 37: p PUT 1 - 40: ( MARK - 41: F FLOAT 3.0 - 46: F FLOAT 0.0 - 51: t TUPLE (MARK at 40) - 52: p PUT 2 - 55: R REDUCE - 56: p PUT 3 - 59: a APPEND - 60: L LONG 1 - 63: a APPEND - 64: L LONG -1 - 68: a APPEND - 69: L LONG 255 - 74: a APPEND - 75: L LONG -255 - 81: a APPEND - 82: L LONG -256 - 88: a APPEND - 89: L LONG 65535 - 96: a APPEND - 97: L LONG -65535 - 105: a APPEND - 106: L LONG -65536 + 9: a APPEND + 10: L LONG 1 + 14: a APPEND + 15: F FLOAT 2.0 + 20: a APPEND + 21: c GLOBAL 'builtins complex' + 39: p PUT 1 + 42: ( MARK + 43: F FLOAT 3.0 + 48: F FLOAT 0.0 + 53: t TUPLE (MARK at 42) + 54: p PUT 2 + 57: R REDUCE + 58: p PUT 3 + 61: a APPEND + 62: L LONG 1 + 66: a APPEND + 67: L LONG -1 + 72: a APPEND + 73: L LONG 255 + 79: a APPEND + 80: L LONG -255 + 87: a APPEND + 88: L LONG -256 + 95: a APPEND + 96: L LONG 65535 + 104: a APPEND + 105: L LONG -65535 114: a APPEND - 115: L LONG 2147483647 - 127: a APPEND - 128: L LONG -2147483647 - 141: a APPEND - 142: L LONG -2147483648 - 155: a APPEND - 156: ( MARK - 157: V UNICODE 'abc' - 162: p PUT 4 - 165: g GET 4 - 168: c GLOBAL 'copyreg _reconstructor' - 192: p PUT 5 - 195: ( MARK - 196: c GLOBAL '__main__ C' - 208: p PUT 6 - 211: c GLOBAL 'builtins object' - 228: p PUT 7 - 231: N NONE - 232: t TUPLE (MARK at 195) - 233: p PUT 8 - 236: R REDUCE - 237: p PUT 9 - 240: ( MARK - 241: d DICT (MARK at 240) - 242: p PUT 10 - 246: V UNICODE 'foo' - 251: p PUT 11 - 255: L LONG 1 - 258: s SETITEM - 259: V UNICODE 'bar' - 264: p PUT 12 - 268: L LONG 2 - 271: s SETITEM - 272: b BUILD - 273: g GET 9 - 276: t TUPLE (MARK at 156) - 277: p PUT 13 - 281: a APPEND - 282: g GET 13 - 286: a APPEND - 287: L LONG 5 - 290: a APPEND - 291: . STOP + 115: L LONG -65536 + 124: a APPEND + 125: L LONG 2147483647 + 138: a APPEND + 139: L LONG -2147483647 + 153: a APPEND + 154: L LONG -2147483648 + 168: a APPEND + 169: ( MARK + 170: V UNICODE 'abc' + 175: p PUT 4 + 178: g GET 4 + 181: c GLOBAL 'copyreg _reconstructor' + 205: p PUT 5 + 208: ( MARK + 209: c GLOBAL '__main__ C' + 221: p PUT 6 + 224: c GLOBAL 'builtins object' + 241: p PUT 7 + 244: N NONE + 245: t TUPLE (MARK at 208) + 246: p PUT 8 + 249: R REDUCE + 250: p PUT 9 + 253: ( MARK + 254: d DICT (MARK at 253) + 255: p PUT 10 + 259: V UNICODE 'foo' + 264: p PUT 11 + 268: L LONG 1 + 272: s SETITEM + 273: V UNICODE 'bar' + 278: p PUT 12 + 282: L LONG 2 + 286: s SETITEM + 287: b BUILD + 288: g GET 9 + 291: t TUPLE (MARK at 169) + 292: p PUT 13 + 296: a APPEND + 297: g GET 13 + 301: a APPEND + 302: L LONG 5 + 306: a APPEND + 307: . STOP highest protocol among opcodes = 0 """ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 20 21:43:58 2009 @@ -134,6 +134,9 @@ Library ------- +- Issue #4842: Always append a trailing 'L' when pickling longs using + pickle protocol 0. When reading, the 'L' is optional. + - Add the importlib package. - Issue #4301: Patch the logging module to add processName support, remove Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Tue Jan 20 21:43:58 2009 @@ -846,8 +846,8 @@ /* Text-mode pickle, or long too big to fit in the 4-byte * signed BININT format: store as a string. */ - pdata[0] = LONG; /* use LONG for consistence with pickle.py */ - PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", x); + pdata[0] = LONG; /* use LONG for consistency with pickle.py */ + PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x); if (pickler_write(self, pdata, strlen(pdata)) < 0) return -1; } @@ -977,8 +977,9 @@ else { char *string; - /* proto < 2: write the repr and newline. This is quadratic-time - (in the number of digits), in both directions. */ + /* proto < 2: write the repr and newline. This is quadratic-time (in + the number of digits), in both directions. We add a trailing 'L' + to the repr, for compatibility with Python 2.x. */ repr = PyObject_Repr(obj); if (repr == NULL) @@ -990,7 +991,7 @@ if (pickler_write(self, &long_op, 1) < 0 || pickler_write(self, string, size) < 0 || - pickler_write(self, "\n", 1) < 0) + pickler_write(self, "L\n", 2) < 0) goto error; } @@ -2880,7 +2881,7 @@ load_long(UnpicklerObject *self) { PyObject *value; - char *s; + char *s, *ss; Py_ssize_t len; if ((len = unpickler_readline(self, &s)) < 0) @@ -2888,8 +2889,27 @@ if (len < 2) return bad_readline(); - /* XXX: Should the base argument explicitly set to 10? */ - if ((value = PyLong_FromString(s, NULL, 0)) == NULL) + /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove + the 'L' before calling PyLong_FromString. In order to maintain + compatibility with Python 3.0.0, we don't actually *require* + the 'L' to be present. */ + if (s[len-2] == 'L') { + ss = (char *)PyMem_Malloc(len-1); + if (ss == NULL) { + PyErr_NoMemory(); + return -1; + } + strncpy(ss, s, len-2); + ss[len-2] = '\0'; + + /* XXX: Should the base argument explicitly set to 10? */ + value = PyLong_FromString(ss, NULL, 0); + PyMem_Free(ss); + } + else { + value = PyLong_FromString(s, NULL, 0); + } + if (value == NULL) return -1; PDATA_PUSH(self->stack, value, -1); From python-checkins at python.org Tue Jan 20 21:45:53 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 20 Jan 2009 21:45:53 +0100 (CET) Subject: [Python-checkins] r68815 - in python/branches/py3k: Lib/test/test_long.py Misc/NEWS Objects/longobject.c Message-ID: <20090120204553.EAFD31E4038@bag.python.org> Author: mark.dickinson Date: Tue Jan 20 21:45:53 2009 New Revision: 68815 Log: Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x. Modified: python/branches/py3k/Lib/test/test_long.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Lib/test/test_long.py ============================================================================== --- python/branches/py3k/Lib/test/test_long.py (original) +++ python/branches/py3k/Lib/test/test_long.py Tue Jan 20 21:45:53 2009 @@ -284,6 +284,16 @@ self.assertRaises(ValueError, int, '123\0') self.assertRaises(ValueError, int, '53', 40) + # trailing L should no longer be accepted... + self.assertRaises(ValueError, int, '123L') + self.assertRaises(ValueError, int, '123l') + self.assertRaises(ValueError, int, '0L') + self.assertRaises(ValueError, int, '-37L') + self.assertRaises(ValueError, int, '0x32L', 16) + self.assertRaises(ValueError, int, '1L', 21) + # ... but it's just a normal digit if base >= 22 + self.assertEqual(int('1L', 22), 43) + self.assertRaises(TypeError, int, 1, 12) # SF patch #1638879: embedded NULs were not detected with Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 20 21:45:53 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4842: Don't allow trailing 'L' when constructing an integer + from a string. + - Issue #4991: os.fdopen now raises an OSError for invalid file descriptors. - Issue #4838: When a module is deallocated, free the memory backing the Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Tue Jan 20 21:45:53 2009 @@ -1990,8 +1990,6 @@ goto onError; if (sign < 0) Py_SIZE(z) = -(Py_SIZE(z)); - if (*str == 'L' || *str == 'l') - str++; while (*str && isspace(Py_CHARMASK(*str))) str++; if (*str != '\0') From buildbot at python.org Tue Jan 20 21:54:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 20:54:00 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090120205400.9AF8E1E4002@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/930 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: ======= Backtrace: ========= /lib/libc.so.6.1[0x200000000025ade0] /lib/libc.so.6.1(cfree-0x7352760)[0x200000000025f460] /usr/lib/libdb-4.7.so(__os_free+0x24da5d0)[0x2000000009a8c1a0] /usr/lib/libdb-4.7.so(__os_closehandle+0x24dcb10)[0x2000000009a8e6f0] /usr/lib/libdb-4.7.so(__fop_file_setup+0x249b400)[0x2000000009a4cff0] /usr/lib/libdb-4.7.so(__db_open+0x243ec60)[0x20000000099f0860] /usr/lib/libdb-4.7.so(__db_open_pp+0x2433540)[0x20000000099e11f0] /home/pybot/buildarea/trunk.klose-debian-ia64/build/build/lib.linux-ia64-2.7-pydebug/_bsddb.so[0x20000000097ae6f0] ./python(PyCFunction_Call+0x20000000003cb660)[0x4000000000415ff0] ./python[0x400000000027b560] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x400000000027c7f0] ./python[0x400000000027bb50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x400000000027c7f0] ./python[0x400000000027bb50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x400000000027c7f0] ./python[0x400000000027bb50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x4000000000413a70] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x4000000000065f70] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python(PyEval_CallObjectWithKeywords+0x1ffffffff8cc7cd0)[0x4000000000279910] ./python(PyInstance_New+0x20000000000040a0)[0x400000000004e820] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x400000000027de70] ./python[0x400000000027bbb0] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x4000000000413a70] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x400000000027ed50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9c20)[0x400000000026b830] ./python[0x400000000027c470] ./python[0x400000000027bb50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x400000000027c7f0] ./python[0x400000000027bb50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x4000000000413a70] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x400000000027ed50] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9c20)[0x400000000026b830] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x4000000000413a70] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x4000000000065f70] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x40000000001bbd10] ./python(PyObject_Call+0x1ffffffff8a915c0)[0x40000000000431f0] ./python[0x400000000027de70] ./python[0x400000000027bbb0] ./python(PyEval_EvalFrameEx+0x1ffffffff8cb9440)[0x400000000026b050] ./python(PyEval_EvalCodeEx+0x1ffffffff8cc1330)[0x4000000000272f50] ./python[0x4000000000413a70] ======= Memory map: ======== 00000000-00004000 r--p 00000000 00:00 0 2000000000000000-200000000003c000 r-xp 00000000 03:05 2420685 /lib/ld-2.8.so 2000000000048000-2000000000050000 rw-p 00038000 03:05 2420685 /lib/ld-2.8.so 2000000000050000-2000000000078000 r-xp 00000000 03:05 2420667 /lib/libpthread-2.8.so 2000000000078000-2000000000084000 ---p 00028000 03:05 2420667 /lib/libpthread-2.8.so 2000000000084000-200000000008c000 rw-p 00024000 03:05 2420667 /lib/libpthread-2.8.so 200000000008c000-2000000000094000 rw-p 200000000008c000 00:00 0 2000000000094000-200000000009c000 r-xp 00000000 03:05 2420682 /lib/libdl-2.8.so 200000000009c000-20000000000a8000 ---p 00008make: *** [buildbottest] Aborted sincerely, -The Buildbot From python-checkins at python.org Tue Jan 20 21:56:29 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 21:56:29 +0100 (CET) Subject: [Python-checkins] r68816 - in python/branches/io-c: Lib/test/test_io.py Modules/_bufferedio.c Modules/_textio.c Message-ID: <20090120205629.1224B1E4042@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 21:56:28 2009 New Revision: 68816 Log: Add GC support to Buffered and Text IO objects Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_bufferedio.c 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 Tue Jan 20 21:56:28 2009 @@ -410,9 +410,7 @@ def test_garbage_collection(self): # FileIO objects are collected, and collecting them flushes # all data to disk. - class MyFileIO(io.FileIO): - pass - f = MyFileIO(support.TESTFN, "wb") + f = io.FileIO(support.TESTFN, "wb") f.write(b"abcxxx") f.f = f wr = weakref.ref(f) @@ -708,6 +706,16 @@ self.assertRaises(IOError, bufio.tell) self.assertRaises(IOError, bufio.read, 10) + def test_garbage_collection(self): + # BufferedReader objects are collected + rawio = io.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 BufferedWriterTest(unittest.TestCase, CommonBufferedTests): tp = io.BufferedWriter @@ -918,6 +926,20 @@ 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 = io.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 BufferedRWPairTest(unittest.TestCase): @@ -1058,6 +1080,10 @@ BufferedReaderTest.testMisbehavedRawIO(self) BufferedWriterTest.testMisbehavedRawIO(self) + def test_garbage_collection(self): + BufferedReaderTest.test_garbage_collection(self) + BufferedWriterTest.test_garbage_collection(self) + # To fully exercise seek/tell, the StatefulIncrementalDecoder has these # properties: @@ -1405,6 +1431,21 @@ io.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") + 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): Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Tue Jan 20 21:56:28 2009 @@ -285,7 +285,7 @@ static void BufferedObject_dealloc(BufferedObject *self) { - if (_PyIOBase_finalize((PyObject *) self) < 0) + if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0) return; self->ok = 0; if (self->weakreflist != NULL) @@ -303,6 +303,24 @@ Py_TYPE(self)->tp_free((PyObject *)self); } +static int +Buffered_traverse(BufferedObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->raw); + Py_VISIT(self->dict); + return 0; +} + +static int +Buffered_clear(BufferedObject *self) +{ + if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0) + return -1; + self->ok = 0; + Py_CLEAR(self->raw); + Py_CLEAR(self->dict); + return 0; +} /* * _BufferedIOMixin methods @@ -1406,12 +1424,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*/ BufferedReader_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)Buffered_traverse, /* tp_traverse */ + (inquiry)Buffered_clear, /* tp_clear */ 0, /* tp_richcompare */ - offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ + offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ (iternextfunc)Buffered_iternext, /* tp_iternext */ BufferedReader_methods, /* tp_methods */ @@ -1740,10 +1759,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*/ BufferedWriter_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)Buffered_traverse, /* tp_traverse */ + (inquiry)Buffered_clear, /* tp_clear */ 0, /* tp_richcompare */ offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ @@ -2094,10 +2114,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*/ BufferedRandom_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)Buffered_traverse, /* tp_traverse */ + (inquiry)Buffered_clear, /* tp_clear */ 0, /* tp_richcompare */ offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Tue Jan 20 21:56:28 2009 @@ -779,11 +779,11 @@ return -1; } -static void -TextIOWrapper_dealloc(PyTextIOWrapperObject *self) +static int +_TextIOWrapper_clear(PyTextIOWrapperObject *self) { - if (_PyIOBase_finalize((PyObject *) self) < 0) - return; + if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0) + return -1; self->ok = 0; Py_CLEAR(self->buffer); Py_CLEAR(self->encoding); @@ -792,12 +792,43 @@ Py_CLEAR(self->readnl); Py_CLEAR(self->decoded_chars); Py_CLEAR(self->snapshot); + return 0; +} + +static void +TextIOWrapper_dealloc(PyTextIOWrapperObject *self) +{ + if (_TextIOWrapper_clear(self) < 0) + return; if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *)self); Py_CLEAR(self->dict); Py_TYPE(self)->tp_free((PyObject *)self); } +static int +TextIOWrapper_traverse(PyTextIOWrapperObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->buffer); + Py_VISIT(self->encoding); + Py_VISIT(self->encoder); + Py_VISIT(self->decoder); + Py_VISIT(self->readnl); + Py_VISIT(self->decoded_chars); + Py_VISIT(self->snapshot); + Py_VISIT(self->dict); + return 0; +} + +static int +TextIOWrapper_clear(PyTextIOWrapperObject *self) +{ + if (_TextIOWrapper_clear(self) < 0) + return -1; + Py_CLEAR(self->dict); + return 0; +} + static PyObject * TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context); @@ -2173,10 +2204,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*/ TextIOWrapper_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)TextIOWrapper_traverse, /* tp_traverse */ + (inquiry)TextIOWrapper_clear, /* tp_clear */ 0, /* tp_richcompare */ offsetof(PyTextIOWrapperObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ From python-checkins at python.org Tue Jan 20 22:19:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 22:19:45 +0100 (CET) Subject: [Python-checkins] r68817 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c _textio.c io.c Message-ID: <20090120211945.E7E491E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 22:19:45 2009 New Revision: 68817 Log: Add some file headers Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c 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 Tue Jan 20 22:19:45 2009 @@ -1,3 +1,12 @@ +/* + An implementation of Buffered I/O as defined by PEP 3116 - "New I/O" + + Classes defined here: BufferedIOBase, BufferedReader, BufferedWriter, + BufferedRandom. + + Written by Amaury Forgeot d'Arc and Antoine Pitrou +*/ + #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Tue Jan 20 22:19:45 2009 @@ -1,3 +1,13 @@ +/* + An implementation of the I/O abstract base classes hierarchy + as defined by PEP 3116 - "New I/O" + + Classes defined here: IOBase, RawIOBase. + + Written by Amaury Forgeot d'Arc and Antoine Pitrou +*/ + + #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Tue Jan 20 22:19:45 2009 @@ -1,3 +1,11 @@ +/* + An implementation of Text I/O as defined by PEP 3116 - "New I/O" + + Classes defined here: TextIOBase, IncrementalNewlineDecoder, TextIOWrapper. + + Written by Amaury Forgeot d'Arc and Antoine Pitrou +*/ + #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Tue Jan 20 22:19:45 2009 @@ -1,3 +1,12 @@ +/* + An implementation of the new I/O lib as defined by PEP 3116 - "New I/O" + + Classes defined here: UnsupportedOperation, BlockingIOError. + Functions defined here: open(). + + Mostly written by Amaury Forgeot d'Arc +*/ + #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" From python-checkins at python.org Tue Jan 20 22:20:01 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 20 Jan 2009 22:20:01 +0100 (CET) Subject: [Python-checkins] r68818 - in python/branches/release30-maint: Lib/pickle.py Lib/pickletools.py Lib/test/pickletester.py Lib/test/test_long.py Misc/NEWS Modules/_pickle.c Objects/longobject.c Message-ID: <20090120212001.AE1AC1E4002@bag.python.org> Author: mark.dickinson Date: Tue Jan 20 22:20:01 2009 New Revision: 68818 Log: Merged revisions 68814-68815 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68814 | mark.dickinson | 2009-01-20 20:43:58 +0000 (Tue, 20 Jan 2009) | 5 lines Issue #4842, patch 1/2: fix pickle in Python 3.x so that pickling with the 'L' opcode always appends an 'L' on output, just as 2.x does. When unpickling, remove the trailing 'L' (if present) before passing the result to PyLong_FromString. ........ r68815 | mark.dickinson | 2009-01-20 20:45:53 +0000 (Tue, 20 Jan 2009) | 2 lines Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/pickle.py python/branches/release30-maint/Lib/pickletools.py python/branches/release30-maint/Lib/test/pickletester.py python/branches/release30-maint/Lib/test/test_long.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_pickle.c python/branches/release30-maint/Objects/longobject.c Modified: python/branches/release30-maint/Lib/pickle.py ============================================================================== --- python/branches/release30-maint/Lib/pickle.py (original) +++ python/branches/release30-maint/Lib/pickle.py Tue Jan 20 22:20:01 2009 @@ -470,7 +470,7 @@ else: self.write(LONG4 + pack(">> dis(pickle.dumps(x, 1)) Modified: python/branches/release30-maint/Lib/test/pickletester.py ============================================================================== --- python/branches/release30-maint/Lib/test/pickletester.py (original) +++ python/branches/release30-maint/Lib/test/pickletester.py Tue Jan 20 22:20:01 2009 @@ -90,21 +90,21 @@ # the object returned by create_data(). DATA0 = ( - b'(lp0\nL0\naL1\naF2.0\nac' + b'(lp0\nL0L\naL1L\naF2.0\nac' b'builtins\ncomplex\n' b'p1\n(F3.0\nF0.0\ntp2\nRp' - b'3\naL1\naL-1\naL255\naL-' - b'255\naL-256\naL65535\na' - b'L-65535\naL-65536\naL2' - b'147483647\naL-2147483' - b'647\naL-2147483648\na(' + b'3\naL1L\naL-1L\naL255L\naL-' + b'255L\naL-256L\naL65535L\na' + b'L-65535L\naL-65536L\naL2' + b'147483647L\naL-2147483' + b'647L\naL-2147483648L\na(' b'Vabc\np4\ng4\nccopyreg' b'\n_reconstructor\np5\n(' b'c__main__\nC\np6\ncbu' b'iltins\nobject\np7\nNt' b'p8\nRp9\n(dp10\nVfoo\np1' - b'1\nL1\nsVbar\np12\nL2\nsb' - b'g9\ntp13\nag13\naL5\na.' + b'1\nL1L\nsVbar\np12\nL2L\nsb' + b'g9\ntp13\nag13\naL5L\na.' ) # Disassembly of DATA0 @@ -113,80 +113,80 @@ 1: l LIST (MARK at 0) 2: p PUT 0 5: L LONG 0 - 8: a APPEND - 9: L LONG 1 - 12: a APPEND - 13: F FLOAT 2.0 - 18: a APPEND - 19: c GLOBAL 'builtins complex' - 37: p PUT 1 - 40: ( MARK - 41: F FLOAT 3.0 - 46: F FLOAT 0.0 - 51: t TUPLE (MARK at 40) - 52: p PUT 2 - 55: R REDUCE - 56: p PUT 3 - 59: a APPEND - 60: L LONG 1 - 63: a APPEND - 64: L LONG -1 - 68: a APPEND - 69: L LONG 255 - 74: a APPEND - 75: L LONG -255 - 81: a APPEND - 82: L LONG -256 - 88: a APPEND - 89: L LONG 65535 - 96: a APPEND - 97: L LONG -65535 - 105: a APPEND - 106: L LONG -65536 + 9: a APPEND + 10: L LONG 1 + 14: a APPEND + 15: F FLOAT 2.0 + 20: a APPEND + 21: c GLOBAL 'builtins complex' + 39: p PUT 1 + 42: ( MARK + 43: F FLOAT 3.0 + 48: F FLOAT 0.0 + 53: t TUPLE (MARK at 42) + 54: p PUT 2 + 57: R REDUCE + 58: p PUT 3 + 61: a APPEND + 62: L LONG 1 + 66: a APPEND + 67: L LONG -1 + 72: a APPEND + 73: L LONG 255 + 79: a APPEND + 80: L LONG -255 + 87: a APPEND + 88: L LONG -256 + 95: a APPEND + 96: L LONG 65535 + 104: a APPEND + 105: L LONG -65535 114: a APPEND - 115: L LONG 2147483647 - 127: a APPEND - 128: L LONG -2147483647 - 141: a APPEND - 142: L LONG -2147483648 - 155: a APPEND - 156: ( MARK - 157: V UNICODE 'abc' - 162: p PUT 4 - 165: g GET 4 - 168: c GLOBAL 'copyreg _reconstructor' - 192: p PUT 5 - 195: ( MARK - 196: c GLOBAL '__main__ C' - 208: p PUT 6 - 211: c GLOBAL 'builtins object' - 228: p PUT 7 - 231: N NONE - 232: t TUPLE (MARK at 195) - 233: p PUT 8 - 236: R REDUCE - 237: p PUT 9 - 240: ( MARK - 241: d DICT (MARK at 240) - 242: p PUT 10 - 246: V UNICODE 'foo' - 251: p PUT 11 - 255: L LONG 1 - 258: s SETITEM - 259: V UNICODE 'bar' - 264: p PUT 12 - 268: L LONG 2 - 271: s SETITEM - 272: b BUILD - 273: g GET 9 - 276: t TUPLE (MARK at 156) - 277: p PUT 13 - 281: a APPEND - 282: g GET 13 - 286: a APPEND - 287: L LONG 5 - 290: a APPEND - 291: . STOP + 115: L LONG -65536 + 124: a APPEND + 125: L LONG 2147483647 + 138: a APPEND + 139: L LONG -2147483647 + 153: a APPEND + 154: L LONG -2147483648 + 168: a APPEND + 169: ( MARK + 170: V UNICODE 'abc' + 175: p PUT 4 + 178: g GET 4 + 181: c GLOBAL 'copyreg _reconstructor' + 205: p PUT 5 + 208: ( MARK + 209: c GLOBAL '__main__ C' + 221: p PUT 6 + 224: c GLOBAL 'builtins object' + 241: p PUT 7 + 244: N NONE + 245: t TUPLE (MARK at 208) + 246: p PUT 8 + 249: R REDUCE + 250: p PUT 9 + 253: ( MARK + 254: d DICT (MARK at 253) + 255: p PUT 10 + 259: V UNICODE 'foo' + 264: p PUT 11 + 268: L LONG 1 + 272: s SETITEM + 273: V UNICODE 'bar' + 278: p PUT 12 + 282: L LONG 2 + 286: s SETITEM + 287: b BUILD + 288: g GET 9 + 291: t TUPLE (MARK at 169) + 292: p PUT 13 + 296: a APPEND + 297: g GET 13 + 301: a APPEND + 302: L LONG 5 + 306: a APPEND + 307: . STOP highest protocol among opcodes = 0 """ Modified: python/branches/release30-maint/Lib/test/test_long.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_long.py (original) +++ python/branches/release30-maint/Lib/test/test_long.py Tue Jan 20 22:20:01 2009 @@ -283,6 +283,16 @@ self.assertRaises(ValueError, int, '123\0') self.assertRaises(ValueError, int, '53', 40) + # trailing L should no longer be accepted... + self.assertRaises(ValueError, int, '123L') + self.assertRaises(ValueError, int, '123l') + self.assertRaises(ValueError, int, '0L') + self.assertRaises(ValueError, int, '-37L') + self.assertRaises(ValueError, int, '0x32L', 16) + self.assertRaises(ValueError, int, '1L', 21) + # ... but it's just a normal digit if base >= 22 + self.assertEqual(int('1L', 22), 43) + self.assertRaises(TypeError, int, 1, 12) # SF patch #1638879: embedded NULs were not detected with Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Jan 20 22:20:01 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4842: Don't allow trailing 'L' when constructing an integer + from a string. + - Issue #4991: os.fdopen now raises an OSError for invalid file descriptors. - Issue #4838: When a module is deallocated, free the memory backing the @@ -95,6 +98,9 @@ Library ------- +- Issue #4842: Always append a trailing 'L' when pickling longs using + pickle protocol 0. When reading, the 'L' is optional. + - Issue #3826 and #4791: The socket module now closes the underlying socket appropriately when it is being used via socket.makefile() objects rather than delaying the close by waiting for garbage collection to do it. Modified: python/branches/release30-maint/Modules/_pickle.c ============================================================================== --- python/branches/release30-maint/Modules/_pickle.c (original) +++ python/branches/release30-maint/Modules/_pickle.c Tue Jan 20 22:20:01 2009 @@ -846,8 +846,8 @@ /* Text-mode pickle, or long too big to fit in the 4-byte * signed BININT format: store as a string. */ - pdata[0] = LONG; /* use LONG for consistence with pickle.py */ - PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", x); + pdata[0] = LONG; /* use LONG for consistency with pickle.py */ + PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x); if (pickler_write(self, pdata, strlen(pdata)) < 0) return -1; } @@ -977,8 +977,9 @@ else { char *string; - /* proto < 2: write the repr and newline. This is quadratic-time - (in the number of digits), in both directions. */ + /* proto < 2: write the repr and newline. This is quadratic-time (in + the number of digits), in both directions. We add a trailing 'L' + to the repr, for compatibility with Python 2.x. */ repr = PyObject_Repr(obj); if (repr == NULL) @@ -990,7 +991,7 @@ if (pickler_write(self, &long_op, 1) < 0 || pickler_write(self, string, size) < 0 || - pickler_write(self, "\n", 1) < 0) + pickler_write(self, "L\n", 2) < 0) goto error; } @@ -2880,7 +2881,7 @@ load_long(UnpicklerObject *self) { PyObject *value; - char *s; + char *s, *ss; Py_ssize_t len; if ((len = unpickler_readline(self, &s)) < 0) @@ -2888,8 +2889,27 @@ if (len < 2) return bad_readline(); - /* XXX: Should the base argument explicitly set to 10? */ - if ((value = PyLong_FromString(s, NULL, 0)) == NULL) + /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove + the 'L' before calling PyLong_FromString. In order to maintain + compatibility with Python 3.0.0, we don't actually *require* + the 'L' to be present. */ + if (s[len-2] == 'L') { + ss = (char *)PyMem_Malloc(len-1); + if (ss == NULL) { + PyErr_NoMemory(); + return -1; + } + strncpy(ss, s, len-2); + ss[len-2] = '\0'; + + /* XXX: Should the base argument explicitly set to 10? */ + value = PyLong_FromString(ss, NULL, 0); + PyMem_Free(ss); + } + else { + value = PyLong_FromString(s, NULL, 0); + } + if (value == NULL) return -1; PDATA_PUSH(self->stack, value, -1); Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Tue Jan 20 22:20:01 2009 @@ -1990,8 +1990,6 @@ goto onError; if (sign < 0) Py_SIZE(z) = -(Py_SIZE(z)); - if (*str == 'L' || *str == 'l') - str++; while (*str && isspace(Py_CHARMASK(*str))) str++; if (*str != '\0') From python-checkins at python.org Tue Jan 20 22:25:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 20 Jan 2009 22:25:32 +0100 (CET) Subject: [Python-checkins] r68819 - python/branches/py3k/Lib/distutils/command/wininst-8.0.exe Message-ID: <20090120212532.E22131E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 20 22:25:32 2009 New Revision: 68819 Log: Revert part of r68799 which unintentionally updated this file. Modified: python/branches/py3k/Lib/distutils/command/wininst-8.0.exe Modified: python/branches/py3k/Lib/distutils/command/wininst-8.0.exe ============================================================================== Binary files. No diff available. From python-checkins at python.org Tue Jan 20 22:29:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 22:29:59 +0100 (CET) Subject: [Python-checkins] r68820 - in python/branches/io-c/Modules: _iomodule.h _textio.c io.c Message-ID: <20090120212959.8E2CF1E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 22:29:59 2009 New Revision: 68820 Log: Add class TextIOBase 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 Tue Jan 20 22:29:59 2009 @@ -2,11 +2,15 @@ * Declarations shared between the different parts of the io module */ -extern PyTypeObject PyFileIO_Type; -extern PyTypeObject PyBytesIO_Type; +/* ABCs */ extern PyTypeObject PyIOBase_Type; extern PyTypeObject PyRawIOBase_Type; extern PyTypeObject PyBufferedIOBase_Type; +extern PyTypeObject PyTextIOBase_Type; + +/* Concrete classes */ +extern PyTypeObject PyFileIO_Type; +extern PyTypeObject PyBytesIO_Type; extern PyTypeObject PyBufferedReader_Type; extern PyTypeObject PyBufferedWriter_Type; extern PyTypeObject PyBufferedRWPair_Type; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Tue Jan 20 22:29:59 2009 @@ -28,26 +28,93 @@ return NULL; } +PyDoc_STRVAR(TextIOBase_read_doc, + "Read at most n characters from stream.\n" + "\n" + "Read from underlying buffer until we have n characters or we hit EOF.\n" + "If n is negative or omitted, read until EOF.\n" + ); + static PyObject * TextIOBase_read(PyObject *self, PyObject *args) { return _unsupported("read"); } +PyDoc_STRVAR(TextIOBase_readline_doc, + "Read until newline or EOF.\n" + "\n" + "Returns an empty string if EOF is hit immediately.\n" + ); + static PyObject * -TextIOBase_write(PyObject *self, PyObject *args) +TextIOBase_readline(PyObject *self, PyObject *args) { return _unsupported("read"); } +PyDoc_STRVAR(TextIOBase_write_doc, + "Write string to stream.\n" + "Returns the number of characters written (which is always equal to\n" + "the length of the string).\n" + ); + static PyObject * -TextIOBase_readline(PyObject *self, PyObject *args) +TextIOBase_write(PyObject *self, PyObject *args) { return _unsupported("read"); } /* XXX properties: encoding, newlines */ +static PyMethodDef TextIOBase_methods[] = { + {"read", TextIOBase_read, METH_VARARGS, TextIOBase_read_doc}, + {"readline", TextIOBase_readline, METH_VARARGS, TextIOBase_readline_doc}, + {"write", TextIOBase_write, METH_VARARGS, TextIOBase_write_doc}, + {NULL, NULL} +}; + +PyTypeObject PyTextIOBase_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "TextIOBase", /*tp_name*/ + 0, /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*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 | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + TextIOBase_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + TextIOBase_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyIOBase_Type, /* 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 */ +}; + /* IncrementalNewlineDecoder */ Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Tue Jan 20 22:29:59 2009 @@ -674,8 +674,14 @@ 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 = &PyIOBase_Type; + PyTextIOWrapper_Type.tp_base = &PyTextIOBase_Type; if (PyType_Ready(&PyTextIOWrapper_Type) < 0) goto fail; Py_INCREF(&PyTextIOWrapper_Type); From python-checkins at python.org Tue Jan 20 22:36:17 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 22:36:17 +0100 (CET) Subject: [Python-checkins] r68821 - python/branches/io-c/Modules/_textio.c Message-ID: <20090120213617.2415B1E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 22:36:16 2009 New Revision: 68821 Log: Add properties to TextIOBase 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 Tue Jan 20 22:36:16 2009 @@ -65,8 +65,33 @@ return _unsupported("read"); } -/* XXX properties: encoding, newlines */ - +PyDoc_STRVAR(TextIOBase_encoding_doc, + "Encoding of the text stream.\n" + "\n" + "Subclasses should override.\n" + ); + +static PyObject * +TextIOBase_encoding_get(PyObject *self, void *context) +{ + Py_RETURN_NONE; +} + +PyDoc_STRVAR(TextIOBase_newlines_doc, + "Line endings translated so far.\n" + "\n" + "Only line endings translated during reading are considered.\n" + "\n" + "Subclasses should override.\n" + ); + +static PyObject * +TextIOBase_newlines_get(PyObject *self, void *context) +{ + Py_RETURN_NONE; +} + + static PyMethodDef TextIOBase_methods[] = { {"read", TextIOBase_read, METH_VARARGS, TextIOBase_read_doc}, {"readline", TextIOBase_readline, METH_VARARGS, TextIOBase_readline_doc}, @@ -74,6 +99,12 @@ {NULL, NULL} }; +static PyGetSetDef TextIOBase_getset[] = { + {"encoding", (getter)TextIOBase_encoding_get, NULL, TextIOBase_encoding_doc}, + {"newlines", (getter)TextIOBase_newlines_get, NULL, TextIOBase_newlines_doc}, + {0} +}; + PyTypeObject PyTextIOBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) "TextIOBase", /*tp_name*/ @@ -104,7 +135,7 @@ 0, /* tp_iternext */ TextIOBase_methods, /* tp_methods */ 0, /* tp_members */ - 0, /* tp_getset */ + TextIOBase_getset, /* tp_getset */ &PyIOBase_Type, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ From python-checkins at python.org Tue Jan 20 22:41:19 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 22:41:19 +0100 (CET) Subject: [Python-checkins] r68822 - python/branches/io-c/Lib/io.py Message-ID: <20090120214119.2DA721E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 22:41:19 2009 New Revision: 68822 Log: Disable the pure Python TextIOBase class, and inject C the implementation instead Modified: python/branches/io-c/Lib/io.py Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Tue Jan 20 22:41:19 2009 @@ -1241,7 +1241,7 @@ BufferedRandom = _io.BufferedRandom -class TextIOBase(IOBase): +class unused_TextIOBase(IOBase): """Base class for text I/O. @@ -1287,6 +1287,7 @@ Subclasses should override. """ return None +TextIOBase = _io.TextIOBase IncrementalNewlineDecoder = _io.IncrementalNewlineDecoder From buildbot at python.org Tue Jan 20 23:00:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 22:00:23 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090120220024.12AAD1E4044@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/80 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: sincerely, -The Buildbot From python-checkins at python.org Tue Jan 20 23:08:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 23:08:30 +0100 (CET) Subject: [Python-checkins] r68823 - in python/branches/io-c: Doc/documenting/markup.rst Doc/library/collections.rst Doc/library/importlib.rst Doc/library/modules.rst Lib/collections.py Lib/decimal.py Lib/idlelib/EditorWindow.py Lib/importlib/NOTES Lib/importlib/__init__.py Lib/importlib/_bootstrap.py Lib/importlib/test/__init__.py Lib/pickle.py Lib/pickletools.py Lib/test/pickletester.py Lib/test/support.py Lib/test/test_collections.py Lib/test/test_fileio.py Lib/test/test_long.py Lib/test/test_multiprocessing.py Lib/test/test_os.py Misc/NEWS Modules/_fileio.c Modules/_multiprocessing/connection.h Modules/_multiprocessing/pipe_connection.c Modules/_multiprocessing/socket_connection.c Modules/_pickle.c Modules/posixmodule.c Objects/longobject.c Message-ID: <20090120220830.CB9191E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 23:08:29 2009 New Revision: 68823 Log: Merged revisions 68761-68762,68767,68769-68770,68778,68780,68782,68786,68788,68790-68791,68794-68795,68798-68799,68802,68804,68806,68808-68810,68814-68815,68819 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68761 | brett.cannon | 2009-01-19 07:56:16 +0100 (lun., 19 janv. 2009) | 4 lines Fix a typo in some code that is not tested or supported yet. Closes issue 4993. Thanks Antoine Pitrou for the catch. ................ r68762 | brett.cannon | 2009-01-19 08:07:58 +0100 (lun., 19 janv. 2009) | 2 lines Remove a debugging print statement that accidentally got left in. ................ r68767 | benjamin.peterson | 2009-01-19 16:11:51 +0100 (lun., 19 janv. 2009) | 9 lines Merged revisions 68755 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68755 | benjamin.peterson | 2009-01-18 18:08:08 -0600 (Sun, 18 Jan 2009) | 1 line raise an OSError for invalid fds #4991 ........ ................ r68769 | benjamin.peterson | 2009-01-19 16:15:02 +0100 (lun., 19 janv. 2009) | 1 line reenable the invalid fd test for fdopen ................ r68770 | benjamin.peterson | 2009-01-19 16:19:46 +0100 (lun., 19 janv. 2009) | 1 line fix compiler warning ................ r68778 | jesse.noller | 2009-01-19 17:23:53 +0100 (lun., 19 janv. 2009) | 1 line merge r68768 to py3k ................ r68780 | benjamin.peterson | 2009-01-19 18:53:36 +0100 (lun., 19 janv. 2009) | 14 lines Merged revisions 68763,68773 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines Issue 4957 Let os.ftruncate raise OSError like documented. ........ r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line simplify code ........ ................ r68782 | benjamin.peterson | 2009-01-19 22:00:09 +0100 (lun., 19 janv. 2009) | 9 lines Merged revisions 68779 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line make bad file descriptor tests more robust ........ ................ r68786 | benjamin.peterson | 2009-01-19 22:11:05 +0100 (lun., 19 janv. 2009) | 8 lines Blocked revisions 68785 via svnmerge ........ r68785 | benjamin.peterson | 2009-01-19 15:08:37 -0600 (Mon, 19 Jan 2009) | 1 line I'm sick of these deprecations warnings in test_os ........ ................ r68788 | jesse.noller | 2009-01-20 01:23:01 +0100 (mar., 20 janv. 2009) | 1 line merge r68787 to py3k ................ r68790 | brett.cannon | 2009-01-20 03:09:18 +0100 (mar., 20 janv. 2009) | 2 lines Clarify how the specify the name of a module with the 'module' directive. ................ r68791 | brett.cannon | 2009-01-20 03:21:27 +0100 (mar., 20 janv. 2009) | 3 lines Document the (very small) public API for importlib. As time goes on and some key refactorings occur more of the API will be exposed and documented. ................ r68794 | raymond.hettinger | 2009-01-20 04:41:22 +0100 (mar., 20 janv. 2009) | 1 line Forward port r68792 and r68789 putting Counter in __all__ and adding Counter buildouts. ................ r68795 | benjamin.peterson | 2009-01-20 05:02:27 +0100 (mar., 20 janv. 2009) | 15 lines Blocked revisions 68789,68792 via svnmerge ........ r68789 | raymond.hettinger | 2009-01-19 19:19:26 -0600 (Mon, 19 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-19 20:24:38 -0600 (Mon, 19 Jan 2009) | 1 line Add Counter() to __all__. ........ ................ r68798 | raymond.hettinger | 2009-01-20 08:15:22 +0100 (mar., 20 janv. 2009) | 1 line Forward port r68797: Fix-up jump targets in collections docs. ................ r68799 | raymond.hettinger | 2009-01-20 08:24:44 +0100 (mar., 20 janv. 2009) | 1 line Issue 4998: Decimal should not subclass or register with numbers.Real. ................ r68802 | antoine.pitrou | 2009-01-20 12:42:11 +0100 (mar., 20 janv. 2009) | 3 lines Fix typo ................ r68804 | raymond.hettinger | 2009-01-20 14:00:59 +0100 (mar., 20 janv. 2009) | 1 line Fix typos. ................ r68806 | benjamin.peterson | 2009-01-20 15:24:13 +0100 (mar., 20 janv. 2009) | 12 lines Blocked revisions 68803,68805 via svnmerge ........ r68803 | raymond.hettinger | 2009-01-20 06:59:36 -0600 (Tue, 20 Jan 2009) | 1 line Fix typos. ........ r68805 | benjamin.peterson | 2009-01-20 08:21:16 -0600 (Tue, 20 Jan 2009) | 1 line allow unicode keyword arguments for the ** syntax #4978 ........ ................ r68808 | benjamin.peterson | 2009-01-20 15:33:15 +0100 (mar., 20 janv. 2009) | 8 lines Blocked revisions 68807 via svnmerge ........ r68807 | benjamin.peterson | 2009-01-20 08:31:08 -0600 (Tue, 20 Jan 2009) | 1 line backport r68802 (bugfix) ........ ................ r68809 | benjamin.peterson | 2009-01-20 16:01:54 +0100 (mar., 20 janv. 2009) | 22 lines Merged revisions 68797,68801 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68797 | raymond.hettinger | 2009-01-20 01:11:47 -0600 (Tue, 20 Jan 2009) | 11 lines Don't disrupt automatic url target name generation with manually specified, conflicting names. Before: http://docs.python.org/dev/library/collections.html#id1 After: http://docs.python.org/dev/library/collections.html#counter-objects ........ r68801 | raymond.hettinger | 2009-01-20 04:46:23 -0600 (Tue, 20 Jan 2009) | 5 lines Use Georg's new permalinks to documentation by version number. That assures that IDLE's help always points to the correct version and the latest update with all bug fixes. ........ ................ r68810 | benjamin.peterson | 2009-01-20 19:50:52 +0100 (mar., 20 janv. 2009) | 14 lines Blocked revisions 68764,68766 via svnmerge ........ r68764 | benjamin.peterson | 2009-01-19 09:04:35 -0600 (Mon, 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 09:06:33 -0600 (Mon, 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 ........ ................ r68814 | mark.dickinson | 2009-01-20 21:43:58 +0100 (mar., 20 janv. 2009) | 5 lines Issue #4842, patch 1/2: fix pickle in Python 3.x so that pickling with the 'L' opcode always appends an 'L' on output, just as 2.x does. When unpickling, remove the trailing 'L' (if present) before passing the result to PyLong_FromString. ................ r68815 | mark.dickinson | 2009-01-20 21:45:53 +0100 (mar., 20 janv. 2009) | 2 lines Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x. ................ r68819 | raymond.hettinger | 2009-01-20 22:25:32 +0100 (mar., 20 janv. 2009) | 1 line Revert part of r68799 which unintentionally updated this file. ................ Added: python/branches/io-c/Doc/library/importlib.rst - copied unchanged from r68819, /python/branches/py3k/Doc/library/importlib.rst Modified: python/branches/io-c/ (props changed) python/branches/io-c/Doc/documenting/markup.rst python/branches/io-c/Doc/library/collections.rst python/branches/io-c/Doc/library/modules.rst python/branches/io-c/Lib/collections.py python/branches/io-c/Lib/decimal.py python/branches/io-c/Lib/idlelib/EditorWindow.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/test/__init__.py python/branches/io-c/Lib/pickle.py python/branches/io-c/Lib/pickletools.py python/branches/io-c/Lib/test/pickletester.py python/branches/io-c/Lib/test/support.py python/branches/io-c/Lib/test/test_collections.py python/branches/io-c/Lib/test/test_fileio.py python/branches/io-c/Lib/test/test_long.py python/branches/io-c/Lib/test/test_multiprocessing.py python/branches/io-c/Lib/test/test_os.py python/branches/io-c/Misc/NEWS python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_multiprocessing/connection.h python/branches/io-c/Modules/_multiprocessing/pipe_connection.c python/branches/io-c/Modules/_multiprocessing/socket_connection.c python/branches/io-c/Modules/_pickle.c python/branches/io-c/Modules/posixmodule.c python/branches/io-c/Objects/longobject.c 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 Tue Jan 20 23:08:29 2009 @@ -53,9 +53,9 @@ .. describe:: module - This directive marks the beginning of the description of a module (or package - submodule, in which case the name should be fully qualified, including the - package name). + This directive marks the beginning of the description of a module, package, + or submodule. The name should be fully qualified (i.e. including the + package name for submodules). The ``platform`` option, if present, is a comma-separated list of the platforms on which the module is available (if it is available on all 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 Tue Jan 20 23:08:29 2009 @@ -140,8 +140,6 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) -.. _counter-objects: - :class:`Counter` objects ------------------------ @@ -159,7 +157,7 @@ # Find the ten most common words in Hamlet >>> import re >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) - >>> Counter(hamlet_words).most_common(10) + >>> Counter(words).most_common(10) [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] @@ -177,6 +175,7 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args The returned object has a dictionary style interface except that it returns a zero count for missing items (instead of raising a :exc:`KeyError` like a @@ -207,7 +206,7 @@ Elements are returned in arbitrary order. If an element's count has been set to zero or a negative number, :meth:`elements` will ignore it. - >>> c = Counter({'a': 4, 'b': 2, 'd': 0, 'e': -2}) + >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) ['a', 'a', 'a', 'a', 'b', 'b'] @@ -232,10 +231,10 @@ .. method:: update([iterable-or-mapping]) - Like :meth:`dict.update` but adds-in counts instead of replacing them. - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter):: + *mapping* (or counter). Like :meth:`dict.update` but adds-in counts + instead of replacing them, and the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs:: >>> c = Counter('which') >>> c.update('witch') # add elements from another iterable @@ -255,6 +254,34 @@ Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs c.most_common()[:-n:-1] # n least common elements +Several multiset mathematical operations are provided for combining +:class:`Counter` objects. Multisets are like regular sets but 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:: + + >>> c = Counter({'a': 3, 'b': 1}) + >>> d = Counter({'a': 1, 'b': 2}) + >>> c + d # add two counters together: c[x] + d[x] + Counter({'a': 4, 'b': 3}) + >>> c - d # subtract (keeping only positive counts) + Counter({'a': 2}) + >>> c & d # intersection: min(c[x], d[x]) + Counter({'a': 1, 'b': 1}) + >>> c | d # union: max(c[x], d[x]) + Counter({'a': 3, 'b': 2}) + +All four multiset operations produce only positive counts (negative and zero +results are skipped). If inputs include negative counts, addition will sum +both counts and then exclude non-positive results. The other three operations +are undefined for negative inputs:: + + >>> e = Counter(a=8, b=-2, c=0) + >>> e += Counter() # remove zero and negative counts + >>> e + Counter({'a': 8}) + **References**: * Wikipedia entry for `Multisets `_ @@ -273,13 +300,9 @@ Section 4.6.3, Exercise 19 - -.. _deque-objects: - :class:`deque` objects ---------------------- - .. class:: deque([iterable[, maxlen]]) Returns a new deque object initialized left-to-right (using :meth:`append`) with @@ -422,8 +445,6 @@ deque(['c', 'b', 'a']) -.. _deque-recipes: - :class:`deque` Recipes ^^^^^^^^^^^^^^^^^^^^^^ @@ -471,12 +492,10 @@ 'Return the last n lines of a file' return deque(open(filename), n) -.. _defaultdict-objects: :class:`defaultdict` objects ---------------------------- - .. class:: defaultdict([default_factory[, ...]]) Returns a new dictionary-like object. :class:`defaultdict` is a subclass of the @@ -520,8 +539,6 @@ ``None``, if absent. -.. _defaultdict-examples: - :class:`defaultdict` Examples ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -591,8 +608,6 @@ [('blue', set([2, 4])), ('red', set([1, 3]))] -.. _named-tuple-factory: - :func:`namedtuple` Factory Function for Tuples with Named Fields ---------------------------------------------------------------- Modified: python/branches/io-c/Doc/library/modules.rst ============================================================================== --- python/branches/io-c/Doc/library/modules.rst (original) +++ python/branches/io-c/Doc/library/modules.rst Tue Jan 20 23:08:29 2009 @@ -18,3 +18,4 @@ pkgutil.rst modulefinder.rst runpy.rst + importlib.rst Modified: python/branches/io-c/Lib/collections.py ============================================================================== --- python/branches/io-c/Lib/collections.py (original) +++ python/branches/io-c/Lib/collections.py Tue Jan 20 23:08:29 2009 @@ -1,5 +1,5 @@ __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', - 'UserString'] + 'UserString', 'Counter'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * @@ -171,7 +171,7 @@ # http://code.activestate.com/recipes/259174/ # Knuth, TAOCP Vol. II section 4.6.3 - def __init__(self, iterable=None): + def __init__(self, iterable=None, **kwds): '''Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. @@ -179,9 +179,10 @@ >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + >>> c = Counter(a=4, b=2) # a new counter from keyword args ''' - self.update(iterable) + self.update(iterable, **kwds) def __missing__(self, key): 'The count of elements not in the Counter is zero.' @@ -232,7 +233,7 @@ raise NotImplementedError( 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') - def update(self, iterable=None): + def update(self, iterable=None, **kwds): '''Like dict.update() but add counts instead of replacing them. Source can be an iterable, a dictionary, or another Counter instance. @@ -249,10 +250,8 @@ # replace behavior results in the some of original untouched counts # being mixed-in with all of the other counts for a mismash that # doesn't have a straight-forward interpretation in most counting - # contexts. Instead, we look to Knuth for suggested operations on - # multisets and implement the union-add operation discussed in - # TAOCP Volume II section 4.6.3 exercise 19. The Wikipedia entry for - # multisets calls that operation a sum or join. + # contexts. Instead, we implement straight-addition. Both the inputs + # and outputs are allowed to contain zero and negative counts. if iterable is not None: if isinstance(iterable, Mapping): @@ -261,17 +260,102 @@ else: for elem in iterable: self[elem] += 1 + if kwds: + self.update(kwds) def copy(self): 'Like dict.copy() but returns a Counter instance instead of a dict.' return Counter(self) + def __delitem__(self, elem): + 'Like dict.__delitem__() but does not raise KeyError for missing values.' + if elem in self: + dict.__delitem__(self, elem) + def __repr__(self): if not self: return '%s()' % self.__class__.__name__ items = ', '.join(map('%r: %r'.__mod__, self.most_common())) return '%s({%s})' % (self.__class__.__name__, items) + # Multiset-style mathematical operations discussed in: + # Knuth TAOCP Volume II section 4.6.3 exercise 19 + # and at http://en.wikipedia.org/wiki/Multiset + # + # Results are undefined when inputs contain negative counts. + # Outputs guaranteed to only include positive counts. + # + # To strip negative and zero counts, add-in an empty counter: + # c += Counter() + + def __add__(self, other): + '''Add counts from two counters. + + >>> Counter('abbb') + Counter('bcc') + Counter({'b': 4, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem in set(self) | set(other): + newcount = self[elem] + other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __sub__(self, other): + ''' Subtract count, but keep only results with positive counts. + + >>> Counter('abbbc') - Counter('bccd') + Counter({'b': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.items(): + newcount = count - other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __or__(self, other): + '''Union is the maximum of value in either of the input counters. + + >>> Counter('abbb') | Counter('bcc') + Counter({'b': 3, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _max = max + result = Counter() + for elem in set(self) | set(other): + newcount = _max(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + + def __and__(self, other): + ''' Intersection is the minimum of corresponding counts. + + >>> Counter('abbb') & Counter('bcc') + Counter({'b': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _min = min + result = Counter() + if len(self) < len(other): + self, other = other, self + for elem in filter(self.__contains__, other): + newcount = _min(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + ################################################################################ ### UserDict Modified: python/branches/io-c/Lib/decimal.py ============================================================================== --- python/branches/io-c/Lib/decimal.py (original) +++ python/branches/io-c/Lib/decimal.py Tue Jan 20 23:08:29 2009 @@ -134,7 +134,6 @@ 'setcontext', 'getcontext', 'localcontext' ] -import numbers as _numbers import copy as _copy import math as _math @@ -501,7 +500,11 @@ ##### Decimal class ####################################################### -class 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(object): """Floating point class for decimal arithmetic.""" __slots__ = ('_exp','_int','_sign', '_is_special') @@ -1757,14 +1760,10 @@ >>> round(Decimal('Inf')) Traceback (most recent call last): ... - ... - ... OverflowError: cannot round an infinity >>> round(Decimal('NaN')) Traceback (most recent call last): ... - ... - ... ValueError: cannot round a NaN If a second argument n is supplied, self is rounded to n 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 Tue Jan 20 23:08:29 2009 @@ -82,7 +82,7 @@ # Safari requires real file:-URLs EditorWindow.help_url = 'file://' + EditorWindow.help_url else: - EditorWindow.help_url = "http://docs.python.org/dev/3.0/" + EditorWindow.help_url = "http://docs.python.org/%d.%d" % sys.version_info[:2] currentTheme=idleConf.CurrentTheme() self.flist = flist root = root or flist.root Modified: python/branches/io-c/Lib/importlib/NOTES ============================================================================== --- python/branches/io-c/Lib/importlib/NOTES (original) +++ python/branches/io-c/Lib/importlib/NOTES Tue Jan 20 23:08:29 2009 @@ -1,12 +1,11 @@ to do ///// -* Write importlib.__import__ +* Expose resolve_name(). -* Document - + Package. +* Backport to Python 2.7. + import_module - + __import__ + + resolve_name * Create reasonable base tests that all finders and loaders must pass so that various implementations can just subclass as needed. @@ -42,7 +41,7 @@ - Absolute name from sys.path. - Relative name from sys.path. -* Public API (w/ docs!) +* Public API to expose (w/ docs!) + abc - Finder * find_module @@ -72,9 +71,5 @@ - Source/bytecode importers * SourceFinder * (?) Loader - + __init__ - - __import__ - - import_module (backport to 2.7) - - resolve_name (backport to 2.7) * Bootstrap importlib as implementation of builtins.__import__ 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 Tue Jan 20 23:08:29 2009 @@ -79,27 +79,6 @@ return x -def import_module(name, package=None): - """Import a module. - - The 'package' argument is used to resolve relative import names. Typically - this is the __package__ attribute of the module making the function call. - - """ - 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] - - - # Required built-in modules. try: import posix as _os @@ -130,4 +109,30 @@ marshal._w_long = _w_long marshal._r_long = _r_long + +__import__ = _bootstrap.Import().__call__ + + +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 = Import._resolve_name(name[level:], package, level) + __import__(name) + return sys.modules[name] + + + from ._bootstrap import * 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 Tue Jan 20 23:08:29 2009 @@ -431,7 +431,7 @@ if source_path is None: return None import tokenize - with closing(_ioFileIO(source_path, 'r')) as file: + 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. 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 Tue Jan 20 23:08:29 2009 @@ -17,7 +17,6 @@ suite.addTest(module_tests) elif os.path.isdir(path): package_name = "{0}.{1}".format(package, name) - print(package_name) __import__(package_name, level=0) package_tests = getattr(sys.modules[package_name], 'test_suite')() suite.addTest(package_tests) Modified: python/branches/io-c/Lib/pickle.py ============================================================================== --- python/branches/io-c/Lib/pickle.py (original) +++ python/branches/io-c/Lib/pickle.py Tue Jan 20 23:08:29 2009 @@ -470,7 +470,7 @@ else: self.write(LONG4 + pack(">> dis(pickle.dumps(x, 1)) Modified: python/branches/io-c/Lib/test/pickletester.py ============================================================================== --- python/branches/io-c/Lib/test/pickletester.py (original) +++ python/branches/io-c/Lib/test/pickletester.py Tue Jan 20 23:08:29 2009 @@ -90,21 +90,21 @@ # the object returned by create_data(). DATA0 = ( - b'(lp0\nL0\naL1\naF2.0\nac' + b'(lp0\nL0L\naL1L\naF2.0\nac' b'builtins\ncomplex\n' b'p1\n(F3.0\nF0.0\ntp2\nRp' - b'3\naL1\naL-1\naL255\naL-' - b'255\naL-256\naL65535\na' - b'L-65535\naL-65536\naL2' - b'147483647\naL-2147483' - b'647\naL-2147483648\na(' + b'3\naL1L\naL-1L\naL255L\naL-' + b'255L\naL-256L\naL65535L\na' + b'L-65535L\naL-65536L\naL2' + b'147483647L\naL-2147483' + b'647L\naL-2147483648L\na(' b'Vabc\np4\ng4\nccopyreg' b'\n_reconstructor\np5\n(' b'c__main__\nC\np6\ncbu' b'iltins\nobject\np7\nNt' b'p8\nRp9\n(dp10\nVfoo\np1' - b'1\nL1\nsVbar\np12\nL2\nsb' - b'g9\ntp13\nag13\naL5\na.' + b'1\nL1L\nsVbar\np12\nL2L\nsb' + b'g9\ntp13\nag13\naL5L\na.' ) # Disassembly of DATA0 @@ -113,80 +113,80 @@ 1: l LIST (MARK at 0) 2: p PUT 0 5: L LONG 0 - 8: a APPEND - 9: L LONG 1 - 12: a APPEND - 13: F FLOAT 2.0 - 18: a APPEND - 19: c GLOBAL 'builtins complex' - 37: p PUT 1 - 40: ( MARK - 41: F FLOAT 3.0 - 46: F FLOAT 0.0 - 51: t TUPLE (MARK at 40) - 52: p PUT 2 - 55: R REDUCE - 56: p PUT 3 - 59: a APPEND - 60: L LONG 1 - 63: a APPEND - 64: L LONG -1 - 68: a APPEND - 69: L LONG 255 - 74: a APPEND - 75: L LONG -255 - 81: a APPEND - 82: L LONG -256 - 88: a APPEND - 89: L LONG 65535 - 96: a APPEND - 97: L LONG -65535 - 105: a APPEND - 106: L LONG -65536 + 9: a APPEND + 10: L LONG 1 + 14: a APPEND + 15: F FLOAT 2.0 + 20: a APPEND + 21: c GLOBAL 'builtins complex' + 39: p PUT 1 + 42: ( MARK + 43: F FLOAT 3.0 + 48: F FLOAT 0.0 + 53: t TUPLE (MARK at 42) + 54: p PUT 2 + 57: R REDUCE + 58: p PUT 3 + 61: a APPEND + 62: L LONG 1 + 66: a APPEND + 67: L LONG -1 + 72: a APPEND + 73: L LONG 255 + 79: a APPEND + 80: L LONG -255 + 87: a APPEND + 88: L LONG -256 + 95: a APPEND + 96: L LONG 65535 + 104: a APPEND + 105: L LONG -65535 114: a APPEND - 115: L LONG 2147483647 - 127: a APPEND - 128: L LONG -2147483647 - 141: a APPEND - 142: L LONG -2147483648 - 155: a APPEND - 156: ( MARK - 157: V UNICODE 'abc' - 162: p PUT 4 - 165: g GET 4 - 168: c GLOBAL 'copyreg _reconstructor' - 192: p PUT 5 - 195: ( MARK - 196: c GLOBAL '__main__ C' - 208: p PUT 6 - 211: c GLOBAL 'builtins object' - 228: p PUT 7 - 231: N NONE - 232: t TUPLE (MARK at 195) - 233: p PUT 8 - 236: R REDUCE - 237: p PUT 9 - 240: ( MARK - 241: d DICT (MARK at 240) - 242: p PUT 10 - 246: V UNICODE 'foo' - 251: p PUT 11 - 255: L LONG 1 - 258: s SETITEM - 259: V UNICODE 'bar' - 264: p PUT 12 - 268: L LONG 2 - 271: s SETITEM - 272: b BUILD - 273: g GET 9 - 276: t TUPLE (MARK at 156) - 277: p PUT 13 - 281: a APPEND - 282: g GET 13 - 286: a APPEND - 287: L LONG 5 - 290: a APPEND - 291: . STOP + 115: L LONG -65536 + 124: a APPEND + 125: L LONG 2147483647 + 138: a APPEND + 139: L LONG -2147483647 + 153: a APPEND + 154: L LONG -2147483648 + 168: a APPEND + 169: ( MARK + 170: V UNICODE 'abc' + 175: p PUT 4 + 178: g GET 4 + 181: c GLOBAL 'copyreg _reconstructor' + 205: p PUT 5 + 208: ( MARK + 209: c GLOBAL '__main__ C' + 221: p PUT 6 + 224: c GLOBAL 'builtins object' + 241: p PUT 7 + 244: N NONE + 245: t TUPLE (MARK at 208) + 246: p PUT 8 + 249: R REDUCE + 250: p PUT 9 + 253: ( MARK + 254: d DICT (MARK at 253) + 255: p PUT 10 + 259: V UNICODE 'foo' + 264: p PUT 11 + 268: L LONG 1 + 272: s SETITEM + 273: V UNICODE 'bar' + 278: p PUT 12 + 282: L LONG 2 + 286: s SETITEM + 287: b BUILD + 288: g GET 9 + 291: t TUPLE (MARK at 169) + 292: p PUT 13 + 296: a APPEND + 297: g GET 13 + 301: a APPEND + 302: L LONG 5 + 306: a APPEND + 307: . STOP highest protocol among opcodes = 0 """ Modified: python/branches/io-c/Lib/test/support.py ============================================================================== --- python/branches/io-c/Lib/test/support.py (original) +++ python/branches/io-c/Lib/test/support.py Tue Jan 20 23:08:29 2009 @@ -344,6 +344,18 @@ withcommas = ", ".join(reprpairs) return "{%s}" % withcommas +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + def check_syntax_error(testcase, statement): try: compile(statement, '', 'exec') 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 Tue Jan 20 23:08:29 2009 @@ -4,6 +4,8 @@ from test import support from collections import namedtuple, Counter, Mapping import pickle, copy +from random import randrange +import operator from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -361,6 +363,8 @@ def test_basics(self): c = Counter('abcaba') + self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1})) + self.assertEqual(c, Counter(a=3, b=2, c=1)) self.assert_(isinstance(c, dict)) self.assert_(isinstance(c, Mapping)) self.assert_(issubclass(Counter, dict)) @@ -388,6 +392,7 @@ c['a'] += 1 # increment an existing value c['b'] -= 2 # sub existing value to zero del c['c'] # remove an entry + del c['c'] # make sure that del doesn't raise KeyError c['d'] -= 2 # sub from a missing value c['e'] = -5 # directly assign a missing value c['f'] += 4 # add to a missing value @@ -403,7 +408,8 @@ self.assertEqual(repr(c), 'Counter()') self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') self.assertRaises(TypeError, hash, c) - c.update(dict(a=5, b=3, c=1)) + c.update(dict(a=5, b=3)) + c.update(c=1) c.update(Counter('a' * 50 + 'b' * 30)) c.update() # test case with no args c.__init__('a' * 500 + 'b' * 300) @@ -447,7 +453,43 @@ self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) self.assertEqual(set(Counter(s)), set(s)) - + def test_multiset_operations(self): + # Verify that adding a zero counter will strip zeros and negatives + c = Counter(a=10, b=-2, c=0) + Counter() + self.assertEqual(dict(c), dict(a=10)) + + elements = 'abcd' + for i in range(1000): + # test random pairs of multisets + p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + for counterop, numberop, defneg in [ + (Counter.__add__, lambda x, y: x+y if x+y>0 else 0, True), + (Counter.__sub__, lambda x, y: x-y if x-y>0 else 0, False), + (Counter.__or__, max, False), + (Counter.__and__, min, False), + ]: + result = counterop(p, q) + for x in elements: + # all except __add__ are undefined for negative inputs + if defneg or (p[x] >= 0 and q[x] >= 0): + self.assertEqual(numberop(p[x], q[x]), result[x]) + # verify that results exclude non-positive counts + self.assert_(x>0 for x in result.values()) + + elements = 'abcdef' + for i in range(100): + # verify that random multisets with no repeats are exactly like sets + p = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + q = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + for counterop, setop in [ + (Counter.__sub__, set.__sub__), + (Counter.__or__, set.__or__), + (Counter.__and__, set.__and__), + ]: + counter_result = counterop(p, q) + set_result = setop(set(p.elements()), set(q.elements())) + self.assertEqual(counter_result, dict.fromkeys(set_result, 1)) import doctest, collections 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 Tue Jan 20 23:08:29 2009 @@ -6,7 +6,8 @@ from array import array from weakref import proxy -from test.support import TESTFN, findfile, check_warnings, run_unittest +from test.support import (TESTFN, findfile, check_warnings, run_unittest, + make_bad_fd) from collections import UserList from _io import FileIO as _FileIO @@ -175,6 +176,10 @@ f.close() os.unlink(TESTFN) + def testInvalidFd(self): + self.assertRaises(ValueError, _FileIO, -10) + self.assertRaises(OSError, _FileIO, make_bad_fd()) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" 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 Tue Jan 20 23:08:29 2009 @@ -284,6 +284,16 @@ self.assertRaises(ValueError, int, '123\0') self.assertRaises(ValueError, int, '53', 40) + # trailing L should no longer be accepted... + self.assertRaises(ValueError, int, '123L') + self.assertRaises(ValueError, int, '123l') + self.assertRaises(ValueError, int, '0L') + self.assertRaises(ValueError, int, '-37L') + self.assertRaises(ValueError, int, '0x32L', 16) + self.assertRaises(ValueError, int, '1L', 21) + # ... but it's just a normal digit if base >= 22 + self.assertEqual(int('1L', 22), 43) + self.assertRaises(TypeError, int, 1, 12) # SF patch #1638879: embedded NULs were not detected with Modified: python/branches/io-c/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/io-c/Lib/test/test_multiprocessing.py (original) +++ python/branches/io-c/Lib/test/test_multiprocessing.py Tue Jan 20 23:08:29 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/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 Tue Jan 20 23:08:29 2009 @@ -588,62 +588,65 @@ self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): - singles = ["fchdir", "dup", "fdatasync", "fstat", + 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 getattr(os, f, None): - self.assertRaises(OSError, getattr(os, f), 10) + 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): + self.assertRaises(OSError, f, support.make_bad_fd(), *args) + def test_isatty(self): if hasattr(os, "isatty"): - self.assertEqual(os.isatty(10), False) + self.assertEqual(os.isatty(support.make_bad_fd()), False) def test_closerange(self): if hasattr(os, "closerange"): - self.assertEqual(os.closerange(10, 20), None) + fd = support.make_bad_fd() + self.assertEqual(os.closerange(fd, fd + 10), None) def test_dup2(self): if hasattr(os, "dup2"): - self.assertRaises(OSError, os.dup2, 10, 20) + self.check(os.dup2, 20) def test_fchmod(self): if hasattr(os, "fchmod"): - self.assertRaises(OSError, os.fchmod, 10, 0) + self.check(os.fchmod, 0) def test_fchown(self): if hasattr(os, "fchown"): - self.assertRaises(OSError, os.fchown, 10, -1, -1) + self.check(os.fchown, -1, -1) def test_fpathconf(self): if hasattr(os, "fpathconf"): - self.assertRaises(OSError, os.fpathconf, 10, "PC_NAME_MAX") + self.check(os.fpathconf, "PC_NAME_MAX") - #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(IOError, os.ftruncate, 10, 0) + self.check(os.ftruncate, 0) def test_lseek(self): if hasattr(os, "lseek"): - self.assertRaises(OSError, os.lseek, 10, 0, 0) + self.check(os.lseek, 0, 0) def test_read(self): if hasattr(os, "read"): - self.assertRaises(OSError, os.read, 10, 1) + self.check(os.read, 1) def test_tcsetpgrpt(self): if hasattr(os, "tcsetpgrp"): - self.assertRaises(OSError, os.tcsetpgrp, 10, 0) + self.check(os.tcsetpgrp, 0) def test_write(self): if hasattr(os, "write"): - self.assertRaises(OSError, os.write, 10, b" ") + self.check(os.write, b" ") if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Tue Jan 20 23:08:29 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4842: Don't allow trailing 'L' when constructing an integer + from a string. + +- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors. + - Issue #4838: When a module is deallocated, free the memory backing the optional module state data. @@ -132,6 +137,11 @@ Library ------- +- Issue #4842: Always append a trailing 'L' when pickling longs using + pickle protocol 0. When reading, the 'L' is optional. + +- Add the importlib package. + - Issue #4301: Patch the logging module to add processName support, remove _check_logger_class from multiprocessing. @@ -141,6 +151,10 @@ - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. +- 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. Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Tue Jan 20 23:08:29 2009 @@ -62,7 +62,7 @@ internal_close(PyFileIOObject *self) { int err = 0; - int save_errno; + int save_errno = 0; if (self->fd >= 0) { int fd = self->fd; self->fd = -1; @@ -144,6 +144,24 @@ return 0; } +static int +check_fd(int fd) +{ +#if defined(HAVE_FSTAT) + struct stat buf; + if (fstat(fd, &buf) < 0 && errno == EBADF) { + PyObject *exc; + char *msg = strerror(EBADF); + exc = PyObject_CallFunction(PyExc_OSError, "(is)", + EBADF, msg); + PyErr_SetObject(PyExc_OSError, exc); + Py_XDECREF(exc); + return -1; + } +#endif + return 0; +} + static int fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) @@ -289,6 +307,8 @@ if (fd >= 0) { self->fd = fd; self->closefd = closefd; + if (check_fd(fd)) + goto error; } else { self->closefd = 1; @@ -619,7 +639,7 @@ #if SEEK_CUR != 1 case 1: whence = SEEK_CUR; break; #endif -#if SEEL_END != 2 +#if SEEK_END != 2 case 2: whence = SEEK_END; break; #endif } 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 Tue Jan 20 23:08:29 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/io-c/Modules/_multiprocessing/pipe_connection.c ============================================================================== --- python/branches/io-c/Modules/_multiprocessing/pipe_connection.c (original) +++ python/branches/io-c/Modules/_multiprocessing/pipe_connection.c Tue Jan 20 23:08:29 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/io-c/Modules/_multiprocessing/socket_connection.c ============================================================================== --- python/branches/io-c/Modules/_multiprocessing/socket_connection.c (original) +++ python/branches/io-c/Modules/_multiprocessing/socket_connection.c Tue Jan 20 23:08:29 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); Modified: python/branches/io-c/Modules/_pickle.c ============================================================================== --- python/branches/io-c/Modules/_pickle.c (original) +++ python/branches/io-c/Modules/_pickle.c Tue Jan 20 23:08:29 2009 @@ -846,8 +846,8 @@ /* Text-mode pickle, or long too big to fit in the 4-byte * signed BININT format: store as a string. */ - pdata[0] = LONG; /* use LONG for consistence with pickle.py */ - PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", x); + pdata[0] = LONG; /* use LONG for consistency with pickle.py */ + PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x); if (pickler_write(self, pdata, strlen(pdata)) < 0) return -1; } @@ -977,8 +977,9 @@ else { char *string; - /* proto < 2: write the repr and newline. This is quadratic-time - (in the number of digits), in both directions. */ + /* proto < 2: write the repr and newline. This is quadratic-time (in + the number of digits), in both directions. We add a trailing 'L' + to the repr, for compatibility with Python 2.x. */ repr = PyObject_Repr(obj); if (repr == NULL) @@ -990,7 +991,7 @@ if (pickler_write(self, &long_op, 1) < 0 || pickler_write(self, string, size) < 0 || - pickler_write(self, "\n", 1) < 0) + pickler_write(self, "L\n", 2) < 0) goto error; } @@ -2880,7 +2881,7 @@ load_long(UnpicklerObject *self) { PyObject *value; - char *s; + char *s, *ss; Py_ssize_t len; if ((len = unpickler_readline(self, &s)) < 0) @@ -2888,8 +2889,27 @@ if (len < 2) return bad_readline(); - /* XXX: Should the base argument explicitly set to 10? */ - if ((value = PyLong_FromString(s, NULL, 0)) == NULL) + /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove + the 'L' before calling PyLong_FromString. In order to maintain + compatibility with Python 3.0.0, we don't actually *require* + the 'L' to be present. */ + if (s[len-2] == 'L') { + ss = (char *)PyMem_Malloc(len-1); + if (ss == NULL) { + PyErr_NoMemory(); + return -1; + } + strncpy(ss, s, len-2); + ss[len-2] = '\0'; + + /* XXX: Should the base argument explicitly set to 10? */ + value = PyLong_FromString(ss, NULL, 0); + PyMem_Free(ss); + } + else { + value = PyLong_FromString(s, NULL, 0); + } + if (value == NULL) return -1; PDATA_PUSH(self->stack, value, -1); Modified: python/branches/io-c/Modules/posixmodule.c ============================================================================== --- python/branches/io-c/Modules/posixmodule.c (original) +++ python/branches/io-c/Modules/posixmodule.c Tue Jan 20 23:08:29 2009 @@ -5114,10 +5114,8 @@ Py_BEGIN_ALLOW_THREADS res = ftruncate(fd, length); Py_END_ALLOW_THREADS - if (res < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; - } + if (res < 0) + return posix_error(); Py_INCREF(Py_None); return Py_None; } Modified: python/branches/io-c/Objects/longobject.c ============================================================================== --- python/branches/io-c/Objects/longobject.c (original) +++ python/branches/io-c/Objects/longobject.c Tue Jan 20 23:08:29 2009 @@ -1990,8 +1990,6 @@ goto onError; if (sign < 0) Py_SIZE(z) = -(Py_SIZE(z)); - if (*str == 'L' || *str == 'l') - str++; while (*str && isspace(Py_CHARMASK(*str))) str++; if (*str != '\0') From buildbot at python.org Tue Jan 20 23:13:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 22:13:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090120221336.8C2931E4002@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/144 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_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Tue Jan 20 23:36:28 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 23:36:28 +0100 (CET) Subject: [Python-checkins] r68824 - python/branches/io-c/Modules/_textio.c Message-ID: <20090120223628.606F91E4002@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 23:36:28 2009 New Revision: 68824 Log: Fix two leaks 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 Tue Jan 20 23:36:28 2009 @@ -897,7 +897,9 @@ Py_CLEAR(self->decoder); Py_CLEAR(self->readnl); Py_CLEAR(self->decoded_chars); + Py_CLEAR(self->pending_bytes); Py_CLEAR(self->snapshot); + Py_CLEAR(self->errors); return 0; } @@ -921,7 +923,9 @@ Py_VISIT(self->decoder); Py_VISIT(self->readnl); Py_VISIT(self->decoded_chars); + Py_VISIT(self->pending_bytes); Py_VISIT(self->snapshot); + Py_VISIT(self->errors); Py_VISIT(self->dict); return 0; } From python-checkins at python.org Tue Jan 20 23:38:29 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 20 Jan 2009 23:38:29 +0100 (CET) Subject: [Python-checkins] r68825 - python/branches/io-c/Python/pythonrun.c Message-ID: <20090120223829.D4D3E1E4014@bag.python.org> Author: antoine.pitrou Date: Tue Jan 20 23:38:29 2009 New Revision: 68825 Log: FileIO.name is just a plain attribute, we can set it directly Modified: python/branches/io-c/Python/pythonrun.c Modified: python/branches/io-c/Python/pythonrun.c ============================================================================== --- python/branches/io-c/Python/pythonrun.c (original) +++ python/branches/io-c/Python/pythonrun.c Tue Jan 20 23:38:29 2009 @@ -764,7 +764,7 @@ } text = PyUnicode_FromString(name); - if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0) + if (text == NULL || PyObject_SetAttrString(raw, "name", text) < 0) goto error; res = PyObject_CallMethod(raw, "isatty", ""); if (res == NULL) From python-checkins at python.org Tue Jan 20 23:43:17 2009 From: python-checkins at python.org (vinay.sajip) Date: Tue, 20 Jan 2009 23:43:17 +0100 (CET) Subject: [Python-checkins] r68826 - in python/trunk: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090120224317.E76291E4002@bag.python.org> Author: vinay.sajip Date: Tue Jan 20 23:43:17 2009 New Revision: 68826 Log: Issue 5013: Fixed bug in FileHandler when delay was set. 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 Tue Jan 20 23:43:17 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, @@ -21,7 +21,7 @@ Should work under Python versions >= 1.5.2, except that source line information is not available unless 'sys._getframe()' is. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ @@ -46,8 +46,8 @@ __author__ = "Vinay Sajip " __status__ = "production" -__version__ = "0.5.0.6" -__date__ = "03 December 2008" +__version__ = "0.5.0.7" +__date__ = "20 January 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -740,7 +740,6 @@ if strm is None: strm = sys.stderr self.stream = strm - self.formatter = None def flush(self): """ @@ -795,10 +794,12 @@ self.mode = mode self.encoding = encoding if delay: + #We don't open the stream, but we still need to call the + #Handler constructor to set level, formatter, lock etc. + Handler.__init__(self) self.stream = None else: - stream = self._open() - StreamHandler.__init__(self, stream) + StreamHandler.__init__(self, self._open()) def close(self): """ @@ -830,8 +831,7 @@ constructor, open it before calling the superclass's emit. """ if self.stream is None: - stream = self._open() - StreamHandler.__init__(self, stream) + self.stream = self._open() StreamHandler.emit(self, record) #--------------------------------------------------------------------------- Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 20 23:43:17 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue #5013: Fixed a bug in FileHandler which occurred when the delay + parameter was set. + - 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. @@ -177,7 +180,7 @@ - Restore Python 2.3 compatibility for decimal.py. -- Issue #1702551: distutils sdist was not excluding VCS directories under +- Issue #1702551: distutils sdist was not excluding VCS directories under Windows. Inital solution by Guy Dalberto. - The _tkinter module functions "createfilehandler", "deletefilehandler", @@ -193,10 +196,10 @@ - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. -- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case - no MSVC compiler is found under Windows. Original patch by Philip Jenvey. +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. -- Issue #4646: distutils was choking on empty options arg in the setup +- Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. - Fractions.from_float() no longer loses precision for integers too big to @@ -318,7 +321,7 @@ to be consistent with Apple tools. - Issue #900949: plat-mac/videoreader.py no longer relies on a non-existing - module. + module. - Issue #16278952: plat-mac/videoreader.py now correctly imports MediaDescr @@ -375,7 +378,7 @@ - Issue #4122: On Windows, fix a compilation error when using the Py_UNICODE_ISSPACE macro in an extension module. - + - Issue #4293: Py_AddPendingCall is now thread safe and can be used for asynchronous notifications to python from any thread. Documentation added. From python-checkins at python.org Tue Jan 20 23:49:14 2009 From: python-checkins at python.org (vinay.sajip) Date: Tue, 20 Jan 2009 23:49:14 +0100 (CET) Subject: [Python-checkins] r68827 - in python/branches/release26-maint: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090120224914.2E5481E4002@bag.python.org> Author: vinay.sajip Date: Tue Jan 20 23:49:13 2009 New Revision: 68827 Log: Issue 5013: Fixed bug in FileHandler when delay was set. 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 Jan 20 23:49:13 2009 @@ -21,7 +21,7 @@ Should work under Python versions >= 1.5.2, except that source line information is not available unless 'sys._getframe()' is. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ @@ -47,7 +47,7 @@ __author__ = "Vinay Sajip " __status__ = "production" __version__ = "0.5.0.5" -__date__ = "24 January 2008" +__date__ = "20 January 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -730,7 +730,6 @@ if strm is None: strm = sys.stderr self.stream = strm - self.formatter = None def flush(self): """ @@ -785,10 +784,12 @@ self.mode = mode self.encoding = encoding if delay: + #We don't open the stream, but we still need to call the + #Handler constructor to set level, formatter, lock etc. + Handler.__init__(self) self.stream = None else: - stream = self._open() - StreamHandler.__init__(self, stream) + StreamHandler.__init__(self, self._open()) def close(self): """ @@ -820,8 +821,7 @@ constructor, open it before calling the superclass's emit. """ if self.stream is None: - stream = self._open() - StreamHandler.__init__(self, stream) + self.stream = self._open() StreamHandler.emit(self, record) #--------------------------------------------------------------------------- Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Jan 20 23:49:13 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5013: Fixed a bug in FileHandler which occurred when the delay + parameter was set. + - 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. @@ -59,7 +62,7 @@ - Issue #4589: Fixed exception handling when the __exit__ function of a context manager returns a value that cannot be converted to a bool. -- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` +- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` method on file objects with closefd=False. The file descriptor is still kept open but the file object behaves like a closed file. The ``FileIO`` object also got a new readonly attribute ``closefd``. @@ -182,7 +185,7 @@ - Restore Python 2.3 compatibility for decimal.py. -- Issue #1702551: distutils sdist was not excluding VCS directories under +- Issue #1702551: distutils sdist was not excluding VCS directories under Windows. Inital solution by Guy Dalberto. - Issue #4812: add missing underscore prefix to some internal-use-only @@ -191,8 +194,8 @@ - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. -- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case - no MSVC compiler is found under Windows. Original patch by Philip Jenvey. +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. - Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') works as expected in the interactive environment. @@ -200,7 +203,7 @@ - Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by Gabriel Genellina. -- Issue #4646: distutils was choking on empty options arg in the setup +- Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. - Issue #4400: .pypirc default generated file was broken in distutils. From python-checkins at python.org Wed Jan 21 00:06:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 21 Jan 2009 00:06:33 +0100 (CET) Subject: [Python-checkins] r68828 - in python/branches/io-c/Modules: _fileio.c _iomodule.h _textio.c Message-ID: <20090120230633.BCE7B1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 21 00:06:33 2009 New Revision: 68828 Log: Speed up closed checks on text IO objects. Good for a 25% speedup on small ops. Modified: python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Wed Jan 21 00:06:33 2009 @@ -57,6 +57,13 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) + +int +_PyFileIO_closed(PyObject *self) +{ + return ((PyFileIOObject *)self)->fd < 0; +} + /* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Wed Jan 21 00:06:33 2009 @@ -35,6 +35,11 @@ is alive again. */ extern int _PyIOBase_finalize(PyObject *self); +/* Returns true if the given FileIO object is closed. + Doesn't check the argument type, so be careful! */ +extern int _PyFileIO_closed(PyObject *self); + + #define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */ typedef struct { Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Wed Jan 21 00:06:33 2009 @@ -606,6 +606,9 @@ * snapshot point. We use this to reconstruct decoder states in tell(). */ + /* Cache raw object if it's a FileIO object */ + PyObject *raw; + PyObject *weakreflist; PyObject *dict; } PyTextIOWrapperObject; @@ -697,7 +700,7 @@ char *kwlist[] = {"buffer", "encoding", "errors", "newline", "line_buffering", NULL}; - PyObject *buffer; + PyObject *buffer, *raw; char *encoding = NULL; char *errors = NULL; char *newline = NULL; @@ -730,6 +733,7 @@ Py_CLEAR(self->pending_bytes); Py_CLEAR(self->snapshot); Py_CLEAR(self->errors); + Py_CLEAR(self->raw); self->decoded_chars_used = 0; self->pending_bytes_count = 0; self->encodefunc = NULL; @@ -871,6 +875,19 @@ self->buffer = buffer; Py_INCREF(buffer); + + if (Py_TYPE(buffer) == &PyBufferedReader_Type || + Py_TYPE(buffer) == &PyBufferedWriter_Type || + Py_TYPE(buffer) == &PyBufferedRandom_Type) { + raw = PyObject_GetAttrString(buffer, "raw"); + /* Cache the raw FileIO object to speed up 'closed' checks */ + if (raw == NULL) + PyErr_Clear(); + else if (Py_TYPE(raw) == &PyFileIO_Type) + self->raw = raw; + else + Py_DECREF(raw); + } res = PyObject_CallMethod(buffer, "seekable", NULL); if (res == NULL) @@ -900,6 +917,7 @@ Py_CLEAR(self->pending_bytes); Py_CLEAR(self->snapshot); Py_CLEAR(self->errors); + Py_CLEAR(self->raw); return 0; } @@ -926,6 +944,8 @@ Py_VISIT(self->pending_bytes); Py_VISIT(self->snapshot); Py_VISIT(self->errors); + Py_VISIT(self->raw); + Py_VISIT(self->dict); return 0; } @@ -942,21 +962,23 @@ static PyObject * TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context); -/* This macro takes some shortcuts to make the common case faster. We could - specialize even more, by detecting that the underlying buffer is a - BufferedObject. */ +/* This macro takes some shortcuts to make the common case faster. */ #define CHECK_CLOSED(self) \ do { \ int r; \ PyObject *_res; \ if (Py_TYPE(self) == &PyTextIOWrapper_Type) { \ - _res = TextIOWrapper_closed_get(self, NULL); \ - if (_res == NULL) \ - return NULL; \ - r = PyObject_IsTrue(_res); \ - Py_DECREF(_res); \ - if (r < 0) \ - return NULL; \ + if (self->raw != NULL) \ + r = _PyFileIO_closed(self->raw); \ + else { \ + _res = TextIOWrapper_closed_get(self, NULL); \ + if (_res == NULL) \ + return NULL; \ + r = PyObject_IsTrue(_res); \ + Py_DECREF(_res); \ + if (r < 0) \ + return NULL; \ + } \ if (r > 0) { \ PyErr_SetString(PyExc_ValueError, \ "I/O operation on closed file."); \ From python-checkins at python.org Wed Jan 21 00:16:09 2009 From: python-checkins at python.org (vinay.sajip) Date: Wed, 21 Jan 2009 00:16:09 +0100 (CET) Subject: [Python-checkins] r68829 - in python/trunk/Lib/logging: __init__.py handlers.py Message-ID: <20090120231609.109C61E4016@bag.python.org> Author: vinay.sajip Date: Wed Jan 21 00:16:08 2009 New Revision: 68829 Log: Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. Modified: python/trunk/Lib/logging/__init__.py python/trunk/Lib/logging/handlers.py Modified: python/trunk/Lib/logging/__init__.py ============================================================================== --- python/trunk/Lib/logging/__init__.py (original) +++ python/trunk/Lib/logging/__init__.py Wed Jan 21 00:16:08 2009 @@ -18,9 +18,6 @@ Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Should work under Python versions >= 1.5.2, except that source line -information is not available unless 'sys._getframe()' is. - Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! Modified: python/trunk/Lib/logging/handlers.py ============================================================================== --- python/trunk/Lib/logging/handlers.py (original) +++ python/trunk/Lib/logging/handlers.py Wed Jan 21 00:16:08 2009 @@ -1,4 +1,4 @@ -# Copyright 2001-2007 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, @@ -19,12 +19,9 @@ based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Should work under Python versions >= 1.5.2, except that source line -information is not available unless 'sys._getframe()' is. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. - -To use, simply 'import logging' and log away! +To use, simply 'import logging.handlers' and log away! """ import logging, socket, types, os, string, cPickle, struct, time, re @@ -115,8 +112,8 @@ """ Do a rollover, as described in __init__(). """ - - self.stream.close() + if self.stream: + self.stream.close() if self.backupCount > 0: for i in range(self.backupCount - 1, 0, -1): sfn = "%s.%d" % (self.baseFilename, i) @@ -141,6 +138,8 @@ Basically, see if the supplied record would cause the file to exceed the size limit we have. """ + if self.stream is None: # delay was set... + self.stream = self._open() if self.maxBytes > 0: # are we rolling over? msg = "%s\n" % self.format(record) self.stream.seek(0, 2) #due to non-posix-compliant Windows feature @@ -305,7 +304,8 @@ then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ - self.stream.close() + if self.stream: + self.stream.close() # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: From python-checkins at python.org Wed Jan 21 00:20:02 2009 From: python-checkins at python.org (vinay.sajip) Date: Wed, 21 Jan 2009 00:20:02 +0100 (CET) Subject: [Python-checkins] r68830 - in python/branches/release26-maint/Lib/logging: __init__.py handlers.py Message-ID: <20090120232002.C73151E4002@bag.python.org> Author: vinay.sajip Date: Wed Jan 21 00:20:02 2009 New Revision: 68830 Log: Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. Modified: python/branches/release26-maint/Lib/logging/__init__.py python/branches/release26-maint/Lib/logging/handlers.py 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 Wed Jan 21 00:20:02 2009 @@ -18,9 +18,6 @@ Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Should work under Python versions >= 1.5.2, except that source line -information is not available unless 'sys._getframe()' is. - Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! Modified: python/branches/release26-maint/Lib/logging/handlers.py ============================================================================== --- python/branches/release26-maint/Lib/logging/handlers.py (original) +++ python/branches/release26-maint/Lib/logging/handlers.py Wed Jan 21 00:20:02 2009 @@ -19,12 +19,9 @@ based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Should work under Python versions >= 1.5.2, except that source line -information is not available unless 'sys._getframe()' is. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. - -To use, simply 'import logging' and log away! +To use, simply 'import logging.handlers' and log away! """ import logging, socket, types, os, string, cPickle, struct, time, re @@ -141,6 +138,8 @@ Basically, see if the supplied record would cause the file to exceed the size limit we have. """ + if self.stream is None: # delay was set... + self.stream = self._open() if self.maxBytes > 0: # are we rolling over? msg = "%s\n" % self.format(record) self.stream.seek(0, 2) #due to non-posix-compliant Windows feature @@ -305,7 +304,8 @@ then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ - self.stream.close() + if self.stream: + self.stream.close() # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: From buildbot at python.org Wed Jan 21 00:34:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 23:34:47 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090120233448.0ECB11E4002@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/42 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: 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') sincerely, -The Buildbot From buildbot at python.org Wed Jan 21 00:42:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 23:42:28 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD trunk Message-ID: <20090120234228.6AF7B1E4002@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/1785 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Jan 21 00:42:55 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 21 Jan 2009 00:42:55 +0100 (CET) Subject: [Python-checkins] r68831 - python/trunk/Doc/library/collections.rst Message-ID: <20090120234255.268211E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 21 00:42:54 2009 New Revision: 68831 Log: Beautify and cleanup the references section. 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 Jan 21 00:42:54 2009 @@ -294,22 +294,29 @@ >>> e Counter({'a': 8}) -**References**: +.. seealso:: -* Wikipedia entry for `Multisets `_ + * `Bag class `_ + in Smalltalk. -* `Bag class `_ - in Smalltalk -* `C++ multisets `_ - tutorial with standalone examples - -* An early Python `Bag `_ recipe - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later - -* Use cases for multisets and mathematical operations on multisets. - Knuth, Donald. The Art of Computer Programming Volume II, - Section 4.6.3, Exercise 19 + * An early Python `Bag recipe `_ + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later. + + * Wikipedia entry for `Multisets `_\. + + * `C++ multisets `_ + tutorial with standalone examples. + + * For use cases for multisets and mathematical operations on multisets, see + *Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19*\. + + * To enumerate all possible distinct multisets of a given size over a given + set of inputs, see the :func:`combinations_with_replacement` function in + the :ref:`itertools-recipes` for itertools:: + + map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC :class:`deque` objects From python-checkins at python.org Wed Jan 21 00:44:31 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 21 Jan 2009 00:44:31 +0100 (CET) Subject: [Python-checkins] r68832 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090120234431.CECFA1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 21 00:44:31 2009 New Revision: 68832 Log: Beautify and cleanup the references section. 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 Jan 21 00:44:31 2009 @@ -282,22 +282,29 @@ >>> e Counter({'a': 8}) -**References**: +.. seealso:: -* Wikipedia entry for `Multisets `_ + * `Bag class `_ + in Smalltalk. -* `Bag class `_ - in Smalltalk -* `C++ multisets `_ - tutorial with standalone examples - -* An early Python `Bag `_ recipe - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later - -* Use cases for multisets and mathematical operations on multisets. - Knuth, Donald. The Art of Computer Programming Volume II, - Section 4.6.3, Exercise 19 + * An early Python `Bag recipe `_ + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later. + + * Wikipedia entry for `Multisets `_\. + + * `C++ multisets `_ + tutorial with standalone examples. + + * For use cases for multisets and mathematical operations on multisets, see + *Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19*\. + + * To enumerate all possible distinct multisets of a given size over a given + set of inputs, see the :func:`combinations_with_replacement` function in + the :ref:`itertools-recipes` for itertools:: + + map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC :class:`deque` objects From buildbot at python.org Wed Jan 21 00:58:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 20 Jan 2009 23:58:58 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090120235858.BF9B41E4002@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/1731 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Jan 21 01:19:28 2009 From: python-checkins at python.org (vinay.sajip) Date: Wed, 21 Jan 2009 01:19:28 +0100 (CET) Subject: [Python-checkins] r68833 - in python/branches/py3k: Lib/logging/__init__.py Lib/logging/handlers.py Misc/NEWS Message-ID: <20090121001929.0869A1E4002@bag.python.org> Author: vinay.sajip Date: Wed Jan 21 01:19:28 2009 New Revision: 68833 Log: Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. Modified: python/branches/py3k/Lib/logging/__init__.py python/branches/py3k/Lib/logging/handlers.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 Wed Jan 21 01:19:28 2009 @@ -18,7 +18,7 @@ Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ @@ -43,8 +43,8 @@ __author__ = "Vinay Sajip " __status__ = "production" -__version__ = "0.5.0.6" -__date__ = "03 December 2008" +__version__ = "0.5.0.7" +__date__ = "20 January 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -737,7 +737,6 @@ if strm is None: strm = sys.stderr self.stream = strm - self.formatter = None def flush(self): """ @@ -792,10 +791,12 @@ self.mode = mode self.encoding = encoding if delay: + #We don't open the stream, but we still need to call the + #Handler constructor to set level, formatter, lock etc. + Handler.__init__(self) self.stream = None else: - stream = self._open() - StreamHandler.__init__(self, stream) + StreamHandler.__init__(self, self._open()) def close(self): """ @@ -827,8 +828,7 @@ constructor, open it before calling the superclass's emit. """ if self.stream is None: - stream = self._open() - StreamHandler.__init__(self, stream) + self.stream = self._open() StreamHandler.emit(self, record) #--------------------------------------------------------------------------- Modified: python/branches/py3k/Lib/logging/handlers.py ============================================================================== --- python/branches/py3k/Lib/logging/handlers.py (original) +++ python/branches/py3k/Lib/logging/handlers.py Wed Jan 21 01:19:28 2009 @@ -19,9 +19,9 @@ based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. -To use, simply 'import logging' and log away! +To use, simply 'import logging.handlers' and log away! """ import logging, socket, os, pickle, struct, time, re @@ -112,8 +112,8 @@ """ Do a rollover, as described in __init__(). """ - - self.stream.close() + if self.stream: + self.stream.close() if self.backupCount > 0: for i in range(self.backupCount - 1, 0, -1): sfn = "%s.%d" % (self.baseFilename, i) @@ -138,6 +138,8 @@ Basically, see if the supplied record would cause the file to exceed the size limit we have. """ + if self.stream is None: # delay was set... + self.stream = self._open() if self.maxBytes > 0: # are we rolling over? msg = "%s\n" % self.format(record) self.stream.seek(0, 2) #due to non-posix-compliant Windows feature @@ -302,7 +304,8 @@ then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ - self.stream.close() + if self.stream: + self.stream.close() # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 21 01:19:28 2009 @@ -48,7 +48,7 @@ Martin von L?wis at http://mail.python.org/pipermail/python-dev/2008-June/080579.html. -- Issue #4604: Some objects of the I/O library could still be used after +- Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. @@ -137,6 +137,9 @@ Library ------- +- Issue #5013: Fixed a bug in FileHandler which occurred when the delay + parameter was set. + - Issue #4842: Always append a trailing 'L' when pickling longs using pickle protocol 0. When reading, the 'L' is optional. @@ -146,7 +149,7 @@ _check_logger_class from multiprocessing. - Issue #3325: Remove python2.x try: except: imports for old cPickle from - multiprocessing. + multiprocessing. - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. @@ -183,8 +186,8 @@ - Issue #3638: Remove functions from _tkinter module level that depend on TkappObject to work with multiple threads. -- Issue #4718: Adapt the wsgiref package so that it actually works with - Python 3.x, in accordance with the `official amendments of the spec +- Issue #4718: Adapt the wsgiref package so that it actually works with + Python 3.x, in accordance with the `official amendments of the spec `_. - Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() @@ -202,10 +205,10 @@ - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. -- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case - no MSVC compiler is found under Windows. Original patch by Philip Jenvey. +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. -- Issue #4646: distutils was choking on empty options arg in the setup +- Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. - Issue #3767: Convert Tk object to string in tkColorChooser. From python-checkins at python.org Wed Jan 21 01:26:02 2009 From: python-checkins at python.org (vinay.sajip) Date: Wed, 21 Jan 2009 01:26:02 +0100 (CET) Subject: [Python-checkins] r68834 - in python/branches/release30-maint: Lib/logging/__init__.py Lib/logging/handlers.py Misc/NEWS Message-ID: <20090121002602.D74D81E4002@bag.python.org> Author: vinay.sajip Date: Wed Jan 21 01:26:02 2009 New Revision: 68834 Log: Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. Modified: python/branches/release30-maint/Lib/logging/__init__.py python/branches/release30-maint/Lib/logging/handlers.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/logging/__init__.py ============================================================================== --- python/branches/release30-maint/Lib/logging/__init__.py (original) +++ python/branches/release30-maint/Lib/logging/__init__.py Wed Jan 21 01:26:02 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, @@ -18,7 +18,7 @@ Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ @@ -43,7 +43,7 @@ __author__ = "Vinay Sajip " __status__ = "production" __version__ = "0.5.0.5" -__date__ = "24 January 2008" +__date__ = "20 January 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -726,7 +726,6 @@ if strm is None: strm = sys.stderr self.stream = strm - self.formatter = None def flush(self): """ @@ -781,10 +780,12 @@ self.mode = mode self.encoding = encoding if delay: + #We don't open the stream, but we still need to call the + #Handler constructor to set level, formatter, lock etc. + Handler.__init__(self) self.stream = None else: - stream = self._open() - StreamHandler.__init__(self, stream) + StreamHandler.__init__(self, self._open()) def close(self): """ @@ -816,8 +817,7 @@ constructor, open it before calling the superclass's emit. """ if self.stream is None: - stream = self._open() - StreamHandler.__init__(self, stream) + self.stream = self._open() StreamHandler.emit(self, record) #--------------------------------------------------------------------------- Modified: python/branches/release30-maint/Lib/logging/handlers.py ============================================================================== --- python/branches/release30-maint/Lib/logging/handlers.py (original) +++ python/branches/release30-maint/Lib/logging/handlers.py Wed Jan 21 01:26:02 2009 @@ -1,4 +1,4 @@ -# Copyright 2001-2007 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, @@ -19,9 +19,9 @@ based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. -To use, simply 'import logging' and log away! +To use, simply 'import logging.handlers' and log away! """ import logging, socket, os, pickle, struct, time, re @@ -112,8 +112,8 @@ """ Do a rollover, as described in __init__(). """ - - self.stream.close() + if self.stream: + self.stream.close() if self.backupCount > 0: for i in range(self.backupCount - 1, 0, -1): sfn = "%s.%d" % (self.baseFilename, i) @@ -138,6 +138,8 @@ Basically, see if the supplied record would cause the file to exceed the size limit we have. """ + if self.stream is None: # delay was set... + self.stream = self._open() if self.maxBytes > 0: # are we rolling over? msg = "%s\n" % self.format(record) self.stream.seek(0, 2) #due to non-posix-compliant Windows feature @@ -302,7 +304,8 @@ then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ - self.stream.close() + if self.stream: + self.stream.close() # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Jan 21 01:26:02 2009 @@ -31,7 +31,7 @@ function no longer attempt to call the __long__ slot to convert an object to an integer. Only the __int__ and __trunc__ slots are examined. -- Issue #4604: Some objects of the I/O library could still be used after +- Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. @@ -98,6 +98,9 @@ Library ------- +- Issue #5013: Fixed a bug in FileHandler which occurred when the delay + parameter was set. + - Issue #4842: Always append a trailing 'L' when pickling longs using pickle protocol 0. When reading, the 'L' is optional. @@ -116,8 +119,8 @@ - Issue #3638: Remove functions from _tkinter module level that depend on TkappObject to work with multiple threads. -- Issue #4718: Adapt the wsgiref package so that it actually works with - Python 3.x, in accordance with the `official amendments of the spec +- Issue #4718: Adapt the wsgiref package so that it actually works with + Python 3.x, in accordance with the `official amendments of the spec `_. - Fractions.from_float() no longer loses precision for integers too big to @@ -132,10 +135,10 @@ - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. -- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case - no MSVC compiler is found under Windows. Original patch by Philip Jenvey. +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. -- Issue #4646: distutils was choking on empty options arg in the setup +- Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. - Issue #3767: Convert Tk object to string in tkColorChooser. @@ -410,7 +413,7 @@ - Issue #1210: Fixed imaplib and its documentation. -- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` +- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` method on file objects with closefd=False. The file descriptor is still kept open but the file object behaves like a closed file. The ``FileIO`` object also got a new readonly attribute ``closefd``. @@ -554,13 +557,13 @@ cyclic garbage collection. - Issue #3668: Fix a memory leak with the "s*" argument parser in - PyArg_ParseTuple and friends, which occurred when the argument for "s*" + PyArg_ParseTuple and friends, which occurred when the argument for "s*" was correctly parsed but parsing of subsequent arguments failed. - Issue #3611: An exception __context__ could be cleared in a complex pattern involving a __del__ method re-raising an exception. -- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to +- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up @@ -638,7 +641,7 @@ - The deprecation warnings for the camelCase threading API names were removed. -- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing +- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing SEM_VALUE_MAX. Extension Modules From python-checkins at python.org Wed Jan 21 01:45:37 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 21 Jan 2009 01:45:37 +0100 (CET) Subject: [Python-checkins] r68835 - in python/trunk: Lib/test/test_io.py Misc/NEWS Modules/_fileio.c Message-ID: <20090121004537.280651E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 21 01:45:36 2009 New Revision: 68835 Log: Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object. Modified: python/trunk/Lib/test/test_io.py python/trunk/Misc/NEWS python/trunk/Modules/_fileio.c Modified: python/trunk/Lib/test/test_io.py ============================================================================== --- python/trunk/Lib/test/test_io.py (original) +++ python/trunk/Lib/test/test_io.py Wed Jan 21 01:45:36 2009 @@ -232,6 +232,17 @@ else: self.fail("1/0 didn't raise an exception") + # issue 5008 + def test_append_mode_tell(self): + with io.open(test_support.TESTFN, "wb") as f: + f.write(b"xxx") + with io.open(test_support.TESTFN, "ab", buffering=0) as f: + self.assertEqual(f.tell(), 3) + with io.open(test_support.TESTFN, "ab") as f: + self.assertEqual(f.tell(), 3) + with io.open(test_support.TESTFN, "a") as f: + self.assert_(f.tell() > 0) + def test_destructor(self): record = [] class MyFileIO(io.FileIO): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 21 01:45:36 2009 @@ -145,6 +145,11 @@ Library ------- +- Issue #5008: When a file is opened in append mode with the new IO library, + do an explicit seek to the end of file (so that e.g. tell() returns the + file size rather than 0). This is consistent with the behaviour of the + traditional 2.x file object. + - Issue #5013: Fixed a bug in FileHandler which occurred when the delay parameter was set. Modified: python/trunk/Modules/_fileio.c ============================================================================== --- python/trunk/Modules/_fileio.c (original) +++ python/trunk/Modules/_fileio.c Wed Jan 21 01:45:36 2009 @@ -41,6 +41,9 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) +static PyObject * +portable_lseek(int fd, PyObject *posobj, int whence); + /* Returns 0 on success, errno (which is < 0) on failure. */ static int internal_close(PyFileIOObject *self) @@ -296,6 +299,16 @@ goto error; } + if (append) { + /* For consistent behaviour, we explicitly seek to the + end of file (otherwise, it might be done only on the + first write()). */ + PyObject *pos = portable_lseek(self->fd, NULL, 2); + if (pos == NULL) + goto error; + Py_DECREF(pos); + } + goto done; error: From buildbot at python.org Wed Jan 21 01:50:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 00:50:20 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090121005020.44AD31E4024@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/53 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Jan 21 01:55:13 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 21 Jan 2009 01:55:13 +0100 (CET) Subject: [Python-checkins] r68836 - in python/branches/py3k: Lib/test/test_io.py Misc/NEWS Modules/_fileio.c Message-ID: <20090121005513.48F7F1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 21 01:55:13 2009 New Revision: 68836 Log: Merged revisions 68835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_fileio.c Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Wed Jan 21 01:55:13 2009 @@ -233,6 +233,17 @@ else: self.fail("1/0 didn't raise an exception") + # issue 5008 + def test_append_mode_tell(self): + with io.open(support.TESTFN, "wb") as f: + f.write(b"xxx") + with io.open(support.TESTFN, "ab", buffering=0) as f: + self.assertEqual(f.tell(), 3) + with io.open(support.TESTFN, "ab") as f: + self.assertEqual(f.tell(), 3) + with io.open(support.TESTFN, "a") as f: + self.assert_(f.tell() > 0) + def test_destructor(self): record = [] class MyFileIO(io.FileIO): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 21 01:55:13 2009 @@ -137,6 +137,11 @@ Library ------- +- Issue #5008: When a file is opened in append mode with the new IO library, + do an explicit seek to the end of file (so that e.g. tell() returns the + file size rather than 0). This is consistent with the behaviour of the + traditional 2.x file object. + - Issue #5013: Fixed a bug in FileHandler which occurred when the delay parameter was set. Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Wed Jan 21 01:55:13 2009 @@ -55,6 +55,9 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) +static PyObject * +portable_lseek(int fd, PyObject *posobj, int whence); + /* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) @@ -315,6 +318,16 @@ goto error; } + if (append) { + /* For consistent behaviour, we explicitly seek to the + end of file (otherwise, it might be done only on the + first write()). */ + PyObject *pos = portable_lseek(self->fd, NULL, 2); + if (pos == NULL) + goto error; + Py_DECREF(pos); + } + goto done; error: From python-checkins at python.org Wed Jan 21 01:56:37 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 21 Jan 2009 01:56:37 +0100 (CET) Subject: [Python-checkins] r68837 - in python/branches/release26-maint: Lib/test/test_io.py Misc/NEWS Modules/_fileio.c Message-ID: <20090121005637.851561E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 21 01:56:37 2009 New Revision: 68837 Log: Merged revisions 68835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_io.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_fileio.c Modified: python/branches/release26-maint/Lib/test/test_io.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_io.py (original) +++ python/branches/release26-maint/Lib/test/test_io.py Wed Jan 21 01:56:37 2009 @@ -232,6 +232,17 @@ else: self.fail("1/0 didn't raise an exception") + # issue 5008 + def test_append_mode_tell(self): + with io.open(test_support.TESTFN, "wb") as f: + f.write(b"xxx") + with io.open(test_support.TESTFN, "ab", buffering=0) as f: + self.assertEqual(f.tell(), 3) + with io.open(test_support.TESTFN, "ab") as f: + self.assertEqual(f.tell(), 3) + with io.open(test_support.TESTFN, "a") as f: + self.assert_(f.tell() > 0) + def test_destructor(self): record = [] class MyFileIO(io.FileIO): Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed Jan 21 01:56:37 2009 @@ -76,6 +76,11 @@ Library ------- +- Issue #5008: When a file is opened in append mode with the new IO library, + do an explicit seek to the end of file (so that e.g. tell() returns the + file size rather than 0). This is consistent with the behaviour of the + traditional 2.x file object. + - Issue #3997: zipfiles generated with more than 65536 files could not be opened with other applications. Modified: python/branches/release26-maint/Modules/_fileio.c ============================================================================== --- python/branches/release26-maint/Modules/_fileio.c (original) +++ python/branches/release26-maint/Modules/_fileio.c Wed Jan 21 01:56:37 2009 @@ -41,6 +41,9 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) +static PyObject * +portable_lseek(int fd, PyObject *posobj, int whence); + /* Returns 0 on success, errno (which is < 0) on failure. */ static int internal_close(PyFileIOObject *self) @@ -296,6 +299,16 @@ goto error; } + if (append) { + /* For consistent behaviour, we explicitly seek to the + end of file (otherwise, it might be done only on the + first write()). */ + PyObject *pos = portable_lseek(self->fd, NULL, 2); + if (pos == NULL) + goto error; + Py_DECREF(pos); + } + goto done; error: From python-checkins at python.org Wed Jan 21 02:05:40 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 21 Jan 2009 02:05:40 +0100 (CET) Subject: [Python-checkins] r68838 - in python/branches/release30-maint: Lib/test/test_io.py Misc/NEWS Modules/_fileio.c Message-ID: <20090121010540.86C791E4015@bag.python.org> Author: antoine.pitrou Date: Wed Jan 21 02:05:40 2009 New Revision: 68838 Log: Merged revisions 68836 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68836 | antoine.pitrou | 2009-01-21 01:55:13 +0100 (mer., 21 janv. 2009) | 12 lines Merged revisions 68835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_io.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_fileio.c 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 Jan 21 02:05:40 2009 @@ -233,6 +233,17 @@ else: self.fail("1/0 didn't raise an exception") + # issue 5008 + def test_append_mode_tell(self): + with io.open(support.TESTFN, "wb") as f: + f.write(b"xxx") + with io.open(support.TESTFN, "ab", buffering=0) as f: + self.assertEqual(f.tell(), 3) + with io.open(support.TESTFN, "ab") as f: + self.assertEqual(f.tell(), 3) + with io.open(support.TESTFN, "a") as f: + self.assert_(f.tell() > 0) + def test_destructor(self): record = [] class MyFileIO(io.FileIO): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Jan 21 02:05:40 2009 @@ -98,6 +98,11 @@ Library ------- +- Issue #5008: When a file is opened in append mode with the new IO library, + do an explicit seek to the end of file (so that e.g. tell() returns the + file size rather than 0). This is consistent with the behaviour of the + traditional 2.x file object. + - Issue #5013: Fixed a bug in FileHandler which occurred when the delay parameter was set. Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Wed Jan 21 02:05:40 2009 @@ -55,6 +55,9 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) +static PyObject * +portable_lseek(int fd, PyObject *posobj, int whence); + /* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) @@ -315,6 +318,16 @@ goto error; } + if (append) { + /* For consistent behaviour, we explicitly seek to the + end of file (otherwise, it might be done only on the + first write()). */ + PyObject *pos = portable_lseek(self->fd, NULL, 2); + if (pos == NULL) + goto error; + Py_DECREF(pos); + } + goto done; error: From buildbot at python.org Wed Jan 21 02:22:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 01:22:27 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090121012227.CCC7C1E4002@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/169 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 test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 21 02:51:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 01:51:24 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090121015125.105281E4002@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/56 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Jan 21 02:59:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 01:59:38 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090121015938.713F81E4002@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/166 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: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Jan 21 03:08:17 2009 From: python-checkins at python.org (jesse.noller) Date: Wed, 21 Jan 2009 03:08:17 +0100 (CET) Subject: [Python-checkins] r68839 - in python/trunk/Lib: multiprocessing/managers.py test/test_multiprocessing.py Message-ID: <20090121020817.93F871E4002@bag.python.org> Author: jesse.noller Date: Wed Jan 21 03:08:17 2009 New Revision: 68839 Log: Issue 5009: multiprocessing: failure in manager._debug_info() Modified: python/trunk/Lib/multiprocessing/managers.py python/trunk/Lib/test/test_multiprocessing.py Modified: python/trunk/Lib/multiprocessing/managers.py ============================================================================== --- python/trunk/Lib/multiprocessing/managers.py (original) +++ python/trunk/Lib/multiprocessing/managers.py Wed Jan 21 03:08:17 2009 @@ -136,7 +136,7 @@ self.listener = Listener(address=address, backlog=5) self.address = self.listener.address - self.id_to_obj = {0: (None, ())} + self.id_to_obj = {'0': (None, ())} self.id_to_refcount = {} self.mutex = threading.RLock() self.stop = 0 @@ -298,7 +298,7 @@ keys = self.id_to_obj.keys() keys.sort() for ident in keys: - if ident != 0: + if ident != '0': result.append(' %s: refcount=%s\n %s' % (ident, self.id_to_refcount[ident], str(self.id_to_obj[ident][0])[:75])) @@ -310,7 +310,7 @@ ''' Number of shared objects ''' - return len(self.id_to_obj) - 1 # don't count ident=0 + return len(self.id_to_obj) - 1 # don't count ident='0' def shutdown(self, c): ''' Modified: python/trunk/Lib/test/test_multiprocessing.py ============================================================================== --- python/trunk/Lib/test/test_multiprocessing.py (original) +++ python/trunk/Lib/test/test_multiprocessing.py Wed Jan 21 03:08:17 2009 @@ -1057,8 +1057,10 @@ multiprocessing.active_children() # discard dead process objs gc.collect() # do garbage collection refs = self.manager._number_of_objects() + debug_info = self.manager._debug_info() if refs != EXPECTED_NUMBER: print self.manager._debug_info() + print debug_info self.assertEqual(refs, EXPECTED_NUMBER) From python-checkins at python.org Wed Jan 21 03:15:44 2009 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 21 Jan 2009 03:15:44 +0100 (CET) Subject: [Python-checkins] r68840 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090121021544.05B991E4002@bag.python.org> Author: andrew.kuchling Date: Wed Jan 21 03:15:43 2009 New Revision: 68840 Log: Add some items Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Wed Jan 21 03:15:43 2009 @@ -108,6 +108,16 @@ :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:`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,11 +135,9 @@ (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 From python-checkins at python.org Wed Jan 21 03:15:48 2009 From: python-checkins at python.org (jesse.noller) Date: Wed, 21 Jan 2009 03:15:48 +0100 (CET) Subject: [Python-checkins] r68841 - in python/branches/py3k: Lib/multiprocessing/managers.py Lib/test/test_multiprocessing.py Message-ID: <20090121021548.A888A1E402E@bag.python.org> Author: jesse.noller Date: Wed Jan 21 03:15:48 2009 New Revision: 68841 Log: merge r68839 forward to py3k Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/multiprocessing/managers.py python/branches/py3k/Lib/test/test_multiprocessing.py Modified: python/branches/py3k/Lib/multiprocessing/managers.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/managers.py (original) +++ python/branches/py3k/Lib/multiprocessing/managers.py Wed Jan 21 03:15:48 2009 @@ -139,7 +139,7 @@ self.listener = Listener(address=address, backlog=5) self.address = self.listener.address - self.id_to_obj = {0: (None, ())} + self.id_to_obj = {'0': (None, ())} self.id_to_refcount = {} self.mutex = threading.RLock() self.stop = 0 @@ -301,7 +301,7 @@ keys = list(self.id_to_obj.keys()) keys.sort() for ident in keys: - if ident != 0: + if ident != '0': result.append(' %s: refcount=%s\n %s' % (ident, self.id_to_refcount[ident], str(self.id_to_obj[ident][0])[:75])) @@ -313,7 +313,7 @@ ''' Number of shared objects ''' - return len(self.id_to_obj) - 1 # don't count ident=0 + return len(self.id_to_obj) - 1 # don't count ident='0' def shutdown(self, c): ''' Modified: python/branches/py3k/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/py3k/Lib/test/test_multiprocessing.py (original) +++ python/branches/py3k/Lib/test/test_multiprocessing.py Wed Jan 21 03:15:48 2009 @@ -1058,8 +1058,10 @@ multiprocessing.active_children() # discard dead process objs gc.collect() # do garbage collection refs = self.manager._number_of_objects() + debug_info = self.manager._debug_info() if refs != EXPECTED_NUMBER: print(self.manager._debug_info()) + print(debug_info) self.assertEqual(refs, EXPECTED_NUMBER) From python-checkins at python.org Wed Jan 21 03:16:26 2009 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 21 Jan 2009 03:16:26 +0100 (CET) Subject: [Python-checkins] r68842 - python/trunk/Doc/library/subprocess.rst Message-ID: <20090121021626.49ECD1E4002@bag.python.org> Author: andrew.kuchling Date: Wed Jan 21 03:16:26 2009 New Revision: 68842 Log: Markup fixes Modified: python/trunk/Doc/library/subprocess.rst Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Wed Jan 21 03:16:26 2009 @@ -167,11 +167,12 @@ Run command with arguments and return its output as a byte string. - If the exit code was non-zero it raises a CalledProcessError. The - CalledProcessError object will have the return code in the returncode - attribute and output in the output attribute. + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + :exc:`CalledProcessError` object will have the return code in the + :attr:`returncode` + attribute and output in the :attr:`output` attribute. - The arguments are the same as for the Popen constructor. Example: + The arguments are the same as for the :class:`Popen` constructor. Example: >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' From buildbot at python.org Wed Jan 21 03:24:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 02:24:13 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090121022413.3A20A1E4002@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/57 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: gregory.p.smith,mark.dickinson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_codecs test_httpservers test_io ====================================================================== 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' ====================================================================== FAIL: test_post (test.test_httpservers.CGIHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_httpservers.py", line 330, in test_post self.assertEquals(res.read(), b'1, python, 123456\n') AssertionError: b'' != b'1, python, 123456\n' ====================================================================== 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 928, 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 763, 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 781, 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 889, 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 914, 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 1150, 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 1162, 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 1172, 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 1183, 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 1191, 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' sincerely, -The Buildbot From buildbot at python.org Wed Jan 21 03:43:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 02:43:01 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090121024301.DB7D21E4002@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/146 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,vinay.sajip 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 Wed Jan 21 04:25:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 03:25:06 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090121032506.6EAF81E401A@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/76 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: vinay.sajip 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 Wed Jan 21 06:10:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 05:10:13 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090121051014.003AE1E4002@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/50 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: vinay.sajip 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 ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/76 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: antoine.pitrou 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 Wed Jan 21 06:37:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 05:37:35 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20090121053735.A876B1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.0/builds/76 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 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_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 21 11:50:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 10:50:51 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090121105051.B62011E4002@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/1805 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou,jesse.noller,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Jan 21 21:31:50 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 21 Jan 2009 21:31:50 +0100 (CET) Subject: [Python-checkins] r68843 - in python/trunk: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Message-ID: <20090121203150.CC1D51E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 21 21:31:50 2009 New Revision: 68843 Log: Simplify explanation of multiset operations by removing restrictions on negative inputs. Modified: python/trunk/Doc/library/collections.rst python/trunk/Lib/collections.py python/trunk/Lib/test/test_collections.py Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Wed Jan 21 21:31:50 2009 @@ -265,16 +265,18 @@ c.items() # convert to a list of (elem, cnt) pairs Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs 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 allowed to +: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:: +of corresponding counts. All four multiset operations exclude results with +zero or negative counts:: - >>> c = Counter({'a': 3, 'b': 1}) - >>> d = Counter({'a': 1, 'b': 2}) + >>> c = Counter(a=3, b=1) + >>> d = Counter(a=1, b=2) >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) >>> c - d # subtract (keeping only positive counts) @@ -284,16 +286,6 @@ >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) -All four multiset operations produce only positive counts (negative and zero -results are skipped). If inputs include negative counts, addition will sum -both counts and then exclude non-positive results. The other three operations -are undefined for negative inputs:: - - >>> e = Counter(a=8, b=-2, c=0) - >>> e += Counter() # remove zero and negative counts - >>> e - Counter({'a': 8}) - .. seealso:: * `Bag class `_ Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Wed Jan 21 21:31:50 2009 @@ -312,8 +312,8 @@ if not isinstance(other, Counter): return NotImplemented result = Counter() - for elem, count in self.iteritems(): - newcount = count - other[elem] + for elem in set(self) | set(other): + newcount = self[elem] - other[elem] if newcount > 0: result[elem] = newcount return result Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Wed Jan 21 21:31:50 2009 @@ -457,18 +457,19 @@ for i in range(1000): # test random pairs of multisets p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + p.update(e=1, f=-1, g=0) q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) - for counterop, numberop, defneg in [ - (Counter.__add__, lambda x, y: x+y if x+y>0 else 0, True), - (Counter.__sub__, lambda x, y: x-y if x-y>0 else 0, False), - (Counter.__or__, max, False), - (Counter.__and__, min, False), + q.update(h=1, i=-1, j=0) + for counterop, numberop in [ + (Counter.__add__, lambda x, y: max(0, x+y)), + (Counter.__sub__, lambda x, y: max(0, x-y)), + (Counter.__or__, lambda x, y: max(0,x,y)), + (Counter.__and__, lambda x, y: max(0, min(x,y))), ]: result = counterop(p, q) for x in elements: - # all except __add__ are undefined for negative inputs - if defneg or (p[x] >= 0 and q[x] >= 0): - self.assertEqual(numberop(p[x], q[x]), result[x]) + self.assertEqual(numberop(p[x], q[x]), result[x], + (counterop, x, p, q)) # verify that results exclude non-positive counts self.assert_(x>0 for x in result.values()) From python-checkins at python.org Wed Jan 21 21:36:27 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 21 Jan 2009 21:36:27 +0100 (CET) Subject: [Python-checkins] r68844 - in python/branches/py3k: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Message-ID: <20090121203627.E9A091E4002@bag.python.org> Author: raymond.hettinger Date: Wed Jan 21 21:36:27 2009 New Revision: 68844 Log: Simplify explanation of multiset operations by removing restrictions on negative inputs. Modified: python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Wed Jan 21 21:36:27 2009 @@ -253,16 +253,18 @@ c.items() # convert to a list of (elem, cnt) pairs Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs 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 allowed to +: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:: +of corresponding counts. All four multiset operations exclude results with +zero or negative counts:: - >>> c = Counter({'a': 3, 'b': 1}) - >>> d = Counter({'a': 1, 'b': 2}) + >>> c = Counter(a=3, b=1) + >>> d = Counter(a=1, b=2) >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) >>> c - d # subtract (keeping only positive counts) @@ -272,16 +274,6 @@ >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) -All four multiset operations produce only positive counts (negative and zero -results are skipped). If inputs include negative counts, addition will sum -both counts and then exclude non-positive results. The other three operations -are undefined for negative inputs:: - - >>> e = Counter(a=8, b=-2, c=0) - >>> e += Counter() # remove zero and negative counts - >>> e - Counter({'a': 8}) - .. seealso:: * `Bag class `_ Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Wed Jan 21 21:36:27 2009 @@ -314,8 +314,8 @@ if not isinstance(other, Counter): return NotImplemented result = Counter() - for elem, count in self.items(): - newcount = count - other[elem] + for elem in set(self) | set(other): + newcount = self[elem] - other[elem] if newcount > 0: result[elem] = newcount return result Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Wed Jan 21 21:36:27 2009 @@ -462,18 +462,19 @@ for i in range(1000): # test random pairs of multisets p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + p.update(e=1, f=-1, g=0) q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) - for counterop, numberop, defneg in [ - (Counter.__add__, lambda x, y: x+y if x+y>0 else 0, True), - (Counter.__sub__, lambda x, y: x-y if x-y>0 else 0, False), - (Counter.__or__, max, False), - (Counter.__and__, min, False), + q.update(h=1, i=-1, j=0) + for counterop, numberop in [ + (Counter.__add__, lambda x, y: max(0, x+y)), + (Counter.__sub__, lambda x, y: max(0, x-y)), + (Counter.__or__, lambda x, y: max(0,x,y)), + (Counter.__and__, lambda x, y: max(0, min(x,y))), ]: result = counterop(p, q) for x in elements: - # all except __add__ are undefined for negative inputs - if defneg or (p[x] >= 0 and q[x] >= 0): - self.assertEqual(numberop(p[x], q[x]), result[x]) + self.assertEqual(numberop(p[x], q[x]), result[x], + (counterop, x, p, q)) # verify that results exclude non-positive counts self.assert_(x>0 for x in result.values()) From buildbot at python.org Wed Jan 21 23:09:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 21 Jan 2009 22:09:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090121220919.633301E4002@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/148 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: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Thu Jan 22 00:12:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 22 Jan 2009 00:12:51 +0100 (CET) Subject: [Python-checkins] r68845 - in python/trunk: Doc/library/collections.rst Lib/test/test_collections.py Message-ID: <20090121231251.A325E1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 22 00:12:51 2009 New Revision: 68845 Log: Tighten-up the docs for Counter(). Modified: python/trunk/Doc/library/collections.rst python/trunk/Lib/test/test_collections.py Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Thu Jan 22 00:12:51 2009 @@ -158,10 +158,9 @@ A counter tool is provided to support convenient and rapid tallies. For example:: - # Tally repeated words in a list - >>> words = ['red', 'blue', 'red', 'green', 'blue', 'blue'] + # Tally occurrences of words in a list >>> cnt = Counter() - >>> for word in words: + >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: ... cnt[word] += 1 >>> cnt Counter({'blue': 3, 'red': 2, 'green': 1}) @@ -175,7 +174,7 @@ .. class:: Counter([iterable-or-mapping]) - A :class:`Counter` is a :class:`dict` subclass for counting hashable items. + A :class:`Counter` is a :class:`dict` subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The :class:`Counter` @@ -189,16 +188,15 @@ >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args - The returned object has a dictionary style interface except that it returns - a zero count for missing items (instead of raising a :exc:`KeyError` like a - dictionary would):: + Counter objects have a dictionary interface except that they return a zero + count for missing items instead of raising a :exc:`KeyError`:: >>> c = Counter(['egg', 'ham']) >>> c['bacon'] # count of a missing element is zero 0 - Assigning a count of zero or reducing the count to zero leaves the - element in the dictionary. Use ``del`` to remove the entry entirely: + Setting a count to zero still leaves an element in the dictionary. Use + ``del`` to remove it entirely: >>> c = Counter(['arthur', 'gwain']) >>> c['arthur'] = 0 # set the count of 'arthur' to zero @@ -214,9 +212,9 @@ .. method:: elements() - Return an iterator over elements repeating each as many times as its count. - Elements are returned in arbitrary order. If an element's count has been - set to zero or a negative number, :meth:`elements` will ignore it. + Return an iterator over elements repeating each as many times as its + count. Elements are returned in arbitrary order. If an element's count + is less than one, :meth:`elements` will ignore it. >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) @@ -232,20 +230,18 @@ >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] - The usual dictionary methods are available for :class:`Counter` objects. - All of those work the same as they do for dictionaries except for two - which work differently for counters. + The usual dictionary methods are available for :class:`Counter` objects + except for two which work differently for counters. .. method:: fromkeys(iterable) - There is no equivalent class method for :class:`Counter` objects. - Raises a :exc:`NotImplementedError` when called. + This class method is not implemented for :class:`Counter` objects. .. method:: update([iterable-or-mapping]) Elements are counted from an *iterable* or added-in from another *mapping* (or counter). Like :meth:`dict.update` but adds-in counts - instead of replacing them, and the *iterable* is expected to be a + instead of replacing them. Also, the *iterable* is expected to be a sequence of elements, not a sequence of ``(key, value)`` pairs:: >>> c = Counter('which') @@ -273,7 +269,7 @@ 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 -zero or negative counts:: +counts less than one:: >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) @@ -291,9 +287,9 @@ * `Bag class `_ in Smalltalk. - * An early Python `Bag recipe `_ - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later. + * A `Counter `_ conformant + recipe for Python 2.5 and an early Python `Bag recipe + `_ for Python 2.4. * Wikipedia entry for `Multisets `_\. @@ -304,9 +300,9 @@ *Knuth, Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise 19*\. - * To enumerate all possible distinct multisets of a given size over a given - set of inputs, see the :func:`combinations_with_replacement` function in - the :ref:`itertools-recipes` for itertools:: + * To enumerate all distinct multisets of a given size over a given set of + elements, see the :func:`combinations_with_replacement` function in the + :ref:`itertools-recipes` for itertools:: map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Thu Jan 22 00:12:51 2009 @@ -448,6 +448,11 @@ self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) self.assertEqual(set(Counter(s)), set(s)) + def test_invariant_for_the_in_operator(self): + c = Counter(a=10, b=-2, c=0) + for elem in c: + self.assert_(elem in c) + def test_multiset_operations(self): # Verify that adding a zero counter will strip zeros and negatives c = Counter(a=10, b=-2, c=0) + Counter() From python-checkins at python.org Thu Jan 22 00:14:07 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 22 Jan 2009 00:14:07 +0100 (CET) Subject: [Python-checkins] r68846 - in python/branches/py3k: Doc/library/collections.rst Lib/test/test_collections.py Message-ID: <20090121231407.C18291E400C@bag.python.org> Author: raymond.hettinger Date: Thu Jan 22 00:14:07 2009 New Revision: 68846 Log: Tighten-up the docs for Counter(). Modified: python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Thu Jan 22 00:14:07 2009 @@ -146,10 +146,9 @@ A counter tool is provided to support convenient and rapid tallies. For example:: - # Tally repeated words in a list - >>> words = ['red', 'blue', 'red', 'green', 'blue', 'blue'] + # Tally occurrences of words in a list >>> cnt = Counter() - >>> for word in words: + >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: ... cnt[word] += 1 >>> cnt Counter({'blue': 3, 'red': 2, 'green': 1}) @@ -163,7 +162,7 @@ .. class:: Counter([iterable-or-mapping]) - A :class:`Counter` is a :class:`dict` subclass for counting hashable items. + A :class:`Counter` is a :class:`dict` subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The :class:`Counter` @@ -177,16 +176,15 @@ >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args - The returned object has a dictionary style interface except that it returns - a zero count for missing items (instead of raising a :exc:`KeyError` like a - dictionary would):: + Counter objects have a dictionary interface except that they return a zero + count for missing items instead of raising a :exc:`KeyError`:: >>> c = Counter(['egg', 'ham']) >>> c['bacon'] # count of a missing element is zero 0 - Assigning a count of zero or reducing the count to zero leaves the - element in the dictionary. Use ``del`` to remove the entry entirely: + Setting a count to zero still leaves an element in the dictionary. Use + ``del`` to remove it entirely: >>> c = Counter(['arthur', 'gwain']) >>> c['arthur'] = 0 # set the count of 'arthur' to zero @@ -202,9 +200,9 @@ .. method:: elements() - Return an iterator over elements repeating each as many times as its count. - Elements are returned in arbitrary order. If an element's count has been - set to zero or a negative number, :meth:`elements` will ignore it. + Return an iterator over elements repeating each as many times as its + count. Elements are returned in arbitrary order. If an element's count + is less than one, :meth:`elements` will ignore it. >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) @@ -220,20 +218,18 @@ >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] - The usual dictionary methods are available for :class:`Counter` objects. - All of those work the same as they do for dictionaries except for two - which work differently for counters. + The usual dictionary methods are available for :class:`Counter` objects + except for two which work differently for counters. .. method:: fromkeys(iterable) - There is no equivalent class method for :class:`Counter` objects. - Raises a :exc:`NotImplementedError` when called. + This class method is not implemented for :class:`Counter` objects. .. method:: update([iterable-or-mapping]) Elements are counted from an *iterable* or added-in from another *mapping* (or counter). Like :meth:`dict.update` but adds-in counts - instead of replacing them, and the *iterable* is expected to be a + instead of replacing them. Also, the *iterable* is expected to be a sequence of elements, not a sequence of ``(key, value)`` pairs:: >>> c = Counter('which') @@ -261,7 +257,7 @@ 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 -zero or negative counts:: +counts less than one:: >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) @@ -279,9 +275,9 @@ * `Bag class `_ in Smalltalk. - * An early Python `Bag recipe `_ - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later. + * A `Counter `_ conformant + recipe for Python 2.5 and an early Python `Bag recipe + `_ for Python 2.4. * Wikipedia entry for `Multisets `_\. @@ -292,9 +288,9 @@ *Knuth, Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise 19*\. - * To enumerate all possible distinct multisets of a given size over a given - set of inputs, see the :func:`combinations_with_replacement` function in - the :ref:`itertools-recipes` for itertools:: + * To enumerate all distinct multisets of a given size over a given set of + elements, see the :func:`combinations_with_replacement` function in the + :ref:`itertools-recipes` for itertools:: map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC 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 Thu Jan 22 00:14:07 2009 @@ -453,6 +453,11 @@ self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) self.assertEqual(set(Counter(s)), set(s)) + def test_invariant_for_the_in_operator(self): + c = Counter(a=10, b=-2, c=0) + for elem in c: + self.assert_(elem in c) + def test_multiset_operations(self): # Verify that adding a zero counter will strip zeros and negatives c = Counter(a=10, b=-2, c=0) + Counter() From python-checkins at python.org Thu Jan 22 03:24:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 22 Jan 2009 03:24:33 +0100 (CET) Subject: [Python-checkins] r68847 - python/branches/py3k Message-ID: <20090122022433.0FFE01E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 22 03:24:32 2009 New Revision: 68847 Log: Blocked revisions 68843,68845 via svnmerge ........ r68843 | raymond.hettinger | 2009-01-21 14:31:50 -0600 (Wed, 21 Jan 2009) | 1 line Simplify explanation of multiset operations by removing restrictions on negative inputs. ........ r68845 | raymond.hettinger | 2009-01-21 17:12:51 -0600 (Wed, 21 Jan 2009) | 1 line Tighten-up the docs for Counter(). ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Thu Jan 22 03:48:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 02:48:09 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090122024810.11E3A1E4002@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/73 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 Thu Jan 22 04:07:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 03:07:38 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090122030738.A48541E4002@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/150 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Thu Jan 22 04:10:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 03:10:32 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090122031032.A4D291E4012@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/173 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Thu Jan 22 04:12:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 03:12:22 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090122031222.894411E4012@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/140 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 python-checkins at python.org Thu Jan 22 04:21:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 22 Jan 2009 04:21:11 +0100 (CET) Subject: [Python-checkins] r68848 - python/branches/py3k Message-ID: <20090122032111.4DE311E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 22 04:21:11 2009 New Revision: 68848 Log: Blocked revisions 68760,68793,68813,68826,68829,68831 via svnmerge ........ r68760 | vinay.sajip | 2009-01-19 00:49:19 -0600 (Mon, 19 Jan 2009) | 1 line Added more cross-reference targets and tidied up list of useful handlers. ........ r68793 | raymond.hettinger | 2009-01-19 21:36:36 -0600 (Mon, 19 Jan 2009) | 1 line Make merging easier by formattng comment blocks the same in Py3.1 ........ r68813 | raymond.hettinger | 2009-01-20 14:34:19 -0600 (Tue, 20 Jan 2009) | 3 lines Issue 4998: __slots__ on Fractions was useless. ........ r68826 | vinay.sajip | 2009-01-20 16:43:17 -0600 (Tue, 20 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set. ........ r68829 | vinay.sajip | 2009-01-20 17:16:08 -0600 (Tue, 20 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. ........ r68831 | raymond.hettinger | 2009-01-20 17:42:54 -0600 (Tue, 20 Jan 2009) | 1 line Beautify and cleanup the references section. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Jan 22 04:33:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 22 Jan 2009 04:33:57 +0100 (CET) Subject: [Python-checkins] r68849 - peps/trunk/pep-0008.txt Message-ID: <20090122033357.C55251E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 22 04:33:57 2009 New Revision: 68849 Log: add a note about constant conventions Modified: peps/trunk/pep-0008.txt Modified: peps/trunk/pep-0008.txt ============================================================================== --- peps/trunk/pep-0008.txt (original) +++ peps/trunk/pep-0008.txt Thu Jan 22 04:33:57 2009 @@ -563,6 +563,12 @@ Note: there is some controversy about the use of __names (see below). + Constants + + Constants are usually declared on a module level and written in all + capital letter with underscores separating words. Examples include + MAX_OVERFLOW and TOTAL. + Designing for inheritance Always decide whether a class's methods and instance variables From python-checkins at python.org Thu Jan 22 06:20:48 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 22 Jan 2009 06:20:48 +0100 (CET) Subject: [Python-checkins] r68850 - python/trunk/Doc/library/collections.rst Message-ID: <20090122052048.1CB441E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 22 06:20:47 2009 New Revision: 68850 Log: More doc tweaks. 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 Thu Jan 22 06:20:47 2009 @@ -191,18 +191,15 @@ Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:: - >>> c = Counter(['egg', 'ham']) + >>> c = Counter(['eggs', 'ham']) >>> c['bacon'] # count of a missing element is zero 0 - Setting a count to zero still leaves an element in the dictionary. Use - ``del`` to remove it entirely: + Setting a count to zero does not remove an element from a counter. + Use ``del`` to remove it entirely: - >>> c = Counter(['arthur', 'gwain']) - >>> c['arthur'] = 0 # set the count of 'arthur' to zero - >>> 'arthur' in c # but 'arthur' is still in the counter - True - >>> del c['arthur'] # del will completely remove the entry + >>> c['sausage'] = 0 # counter entry with a zero count + >>> del c['sausage'] # del actually removes the entry .. versionadded:: 2.7 @@ -284,19 +281,19 @@ .. seealso:: + * `Counter class `_ + adapted for Python 2.5 and an early `Bag recipe + `_ for Python 2.4. + * `Bag class `_ in Smalltalk. - * A `Counter `_ conformant - recipe for Python 2.5 and an early Python `Bag recipe - `_ for Python 2.4. - * Wikipedia entry for `Multisets `_\. * `C++ multisets `_ - tutorial with standalone examples. + tutorial with examples. - * For use cases for multisets and mathematical operations on multisets, see + * For mathematical operations on multisets and their use cases, see *Knuth, Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise 19*\. @@ -304,7 +301,7 @@ elements, see the :func:`combinations_with_replacement` function in the :ref:`itertools-recipes` for itertools:: - map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC + map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC :class:`deque` objects From python-checkins at python.org Thu Jan 22 06:27:38 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 22 Jan 2009 06:27:38 +0100 (CET) Subject: [Python-checkins] r68851 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090122052738.0A9171E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 22 06:27:37 2009 New Revision: 68851 Log: More doc tweaks. 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 Thu Jan 22 06:27:37 2009 @@ -179,18 +179,15 @@ Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:: - >>> c = Counter(['egg', 'ham']) + >>> c = Counter(['eggs', 'ham']) >>> c['bacon'] # count of a missing element is zero 0 - Setting a count to zero still leaves an element in the dictionary. Use - ``del`` to remove it entirely: + Setting a count to zero does not remove an element from a counter. + Use ``del`` to remove it entirely: - >>> c = Counter(['arthur', 'gwain']) - >>> c['arthur'] = 0 # set the count of 'arthur' to zero - >>> 'arthur' in c # but 'arthur' is still in the counter - True - >>> del c['arthur'] # del will completely remove the entry + >>> c['sausage'] = 0 # counter entry with a zero count + >>> del c['sausage'] # del actually removes the entry .. versionadded:: 2.7 @@ -272,19 +269,19 @@ .. seealso:: + * `Counter class `_ + adapted for Python 2.5 and an early `Bag recipe + `_ for Python 2.4. + * `Bag class `_ in Smalltalk. - * A `Counter `_ conformant - recipe for Python 2.5 and an early Python `Bag recipe - `_ for Python 2.4. - * Wikipedia entry for `Multisets `_\. * `C++ multisets `_ - tutorial with standalone examples. + tutorial with examples. - * For use cases for multisets and mathematical operations on multisets, see + * For mathematical operations on multisets and their use cases, see *Knuth, Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise 19*\. @@ -292,7 +289,7 @@ elements, see the :func:`combinations_with_replacement` function in the :ref:`itertools-recipes` for itertools:: - map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC + map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC :class:`deque` objects From python-checkins at python.org Thu Jan 22 09:36:40 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 22 Jan 2009 09:36:40 +0100 (CET) Subject: [Python-checkins] r68852 - peps/trunk/pep-0008.txt Message-ID: <20090122083640.2E2931E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 22 09:36:39 2009 New Revision: 68852 Log: Fix typo. Modified: peps/trunk/pep-0008.txt Modified: peps/trunk/pep-0008.txt ============================================================================== --- peps/trunk/pep-0008.txt (original) +++ peps/trunk/pep-0008.txt Thu Jan 22 09:36:39 2009 @@ -566,7 +566,7 @@ Constants Constants are usually declared on a module level and written in all - capital letter with underscores separating words. Examples include + capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL. Designing for inheritance From python-checkins at python.org Thu Jan 22 10:05:43 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 22 Jan 2009 10:05:43 +0100 (CET) Subject: [Python-checkins] r68853 - python/trunk/Lib/collections.py Message-ID: <20090122090543.6E2391E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 22 10:05:43 2009 New Revision: 68853 Log: Update comments and add an optimized path for Counter.update(). Modified: python/trunk/Lib/collections.py Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Thu Jan 22 10:05:43 2009 @@ -253,8 +253,11 @@ if iterable is not None: if isinstance(iterable, Mapping): - for elem, count in iterable.iteritems(): - self[elem] += count + if self: + for elem, count in iterable.iteritems(): + self[elem] += count + else: + dict.update(self, iterable) # fast path when counter is empty else: for elem in iterable: self[elem] += 1 @@ -280,7 +283,6 @@ # Knuth TAOCP Volume II section 4.6.3 exercise 19 # and at http://en.wikipedia.org/wiki/Multiset # - # Results are undefined when inputs contain negative counts. # Outputs guaranteed to only include positive counts. # # To strip negative and zero counts, add-in an empty counter: From python-checkins at python.org Thu Jan 22 10:09:55 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 22 Jan 2009 10:09:55 +0100 (CET) Subject: [Python-checkins] r68854 - python/branches/py3k/Lib/collections.py Message-ID: <20090122090955.7B1EC1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 22 10:09:55 2009 New Revision: 68854 Log: Update comments and add an optimized path for Counter.update(). Modified: python/branches/py3k/Lib/collections.py Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Thu Jan 22 10:09:55 2009 @@ -255,8 +255,11 @@ if iterable is not None: if isinstance(iterable, Mapping): - for elem, count in iterable.items(): - self[elem] += count + if self: + for elem, count in iterable.items(): + self[elem] += count + else: + dict.update(self, iterable) # fast path when counter is empty else: for elem in iterable: self[elem] += 1 @@ -282,7 +285,6 @@ # Knuth TAOCP Volume II section 4.6.3 exercise 19 # and at http://en.wikipedia.org/wiki/Multiset # - # Results are undefined when inputs contain negative counts. # Outputs guaranteed to only include positive counts. # # To strip negative and zero counts, add-in an empty counter: From buildbot at python.org Thu Jan 22 10:36:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 09:36:57 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090122093657.443631E4002@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/172 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: 1 test failed: test_kqueue make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 22 11:11:36 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 22 Jan 2009 11:11:36 +0100 (CET) Subject: [Python-checkins] r68855 - in python/branches/py3k: Lib/test/test_codecs.py Misc/NEWS Modules/_codecsmodule.c Message-ID: <20090122101136.CED951E400C@bag.python.org> Author: antoine.pitrou Date: Thu Jan 22 11:11:36 2009 New Revision: 68855 Log: Issue #4874: Most builtin decoders now reject unicode input. Modified: python/branches/py3k/Lib/test/test_codecs.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_codecsmodule.c Modified: python/branches/py3k/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k/Lib/test/test_codecs.py (original) +++ python/branches/py3k/Lib/test/test_codecs.py Thu Jan 22 11:11:36 2009 @@ -1475,6 +1475,36 @@ info.streamwriter, 'strict') as srw: self.assertEquals(srw.read(), "\xfc") +class TypesTest(unittest.TestCase): + def test_decode_unicode(self): + # Most decoders don't accept unicode input + decoders = [ + codecs.utf_7_decode, + codecs.utf_8_decode, + codecs.utf_16_le_decode, + codecs.utf_16_be_decode, + codecs.utf_16_ex_decode, + codecs.utf_32_decode, + codecs.utf_32_le_decode, + codecs.utf_32_be_decode, + codecs.utf_32_ex_decode, + codecs.latin_1_decode, + codecs.ascii_decode, + codecs.charmap_decode, + ] + if hasattr(codecs, "mbcs_decode"): + decoders.append(codecs.mbcs_decode) + for decoder in decoders: + self.assertRaises(TypeError, decoder, "xxx") + + def test_unicode_escape(self): + # Escape-decoding an unicode string is supported ang gives the same + # result as decoding the equivalent ASCII bytes string. + self.assertEquals(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + def test_main(): support.run_unittest( @@ -1501,6 +1531,7 @@ BasicUnicodeTest, CharmapTest, WithStmtTest, + TypesTest, ) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 22 11:11:36 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4874: Most builtin decoders now reject unicode input. + - Issue #4842: Don't allow trailing 'L' when constructing an integer from a string. Modified: python/branches/py3k/Modules/_codecsmodule.c ============================================================================== --- python/branches/py3k/Modules/_codecsmodule.c (original) +++ python/branches/py3k/Modules/_codecsmodule.c Thu Jan 22 11:11:36 2009 @@ -258,7 +258,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_7_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -281,7 +281,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_8_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -305,7 +305,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -328,7 +328,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode", &pbuf, &errors, &final)) return NULL; @@ -352,7 +352,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode", &pbuf, &errors, &final)) return NULL; @@ -384,7 +384,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_16_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -409,7 +409,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -432,7 +432,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -455,7 +455,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -486,7 +486,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_32_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -542,7 +542,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:latin_1_decode", + if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode", &pbuf, &errors)) return NULL; @@ -559,7 +559,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:ascii_decode", + if (!PyArg_ParseTuple(args, "y*|z:ascii_decode", &pbuf, &errors)) return NULL; @@ -577,7 +577,7 @@ const char *errors = NULL; PyObject *mapping = NULL; - if (!PyArg_ParseTuple(args, "s*|zO:charmap_decode", + if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode", &pbuf, &errors, &mapping)) return NULL; if (mapping == Py_None) @@ -600,7 +600,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:mbcs_decode", + if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; From python-checkins at python.org Thu Jan 22 11:31:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 22 Jan 2009 11:31:34 +0100 (CET) Subject: [Python-checkins] r68856 - in python/branches/release30-maint: Lib/test/test_codecs.py Misc/NEWS Modules/_codecsmodule.c Message-ID: <20090122103134.0E4601E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 22 11:31:33 2009 New Revision: 68856 Log: Merged revisions 68855 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68855 | antoine.pitrou | 2009-01-22 11:11:36 +0100 (jeu., 22 janv. 2009) | 3 lines Issue #4874: Most builtin decoders now reject unicode input. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_codecs.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_codecsmodule.c Modified: python/branches/release30-maint/Lib/test/test_codecs.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_codecs.py (original) +++ python/branches/release30-maint/Lib/test/test_codecs.py Thu Jan 22 11:31:33 2009 @@ -1475,6 +1475,36 @@ info.streamwriter, 'strict') as srw: self.assertEquals(srw.read(), "\xfc") +class TypesTest(unittest.TestCase): + def test_decode_unicode(self): + # Most decoders don't accept unicode input + decoders = [ + codecs.utf_7_decode, + codecs.utf_8_decode, + codecs.utf_16_le_decode, + codecs.utf_16_be_decode, + codecs.utf_16_ex_decode, + codecs.utf_32_decode, + codecs.utf_32_le_decode, + codecs.utf_32_be_decode, + codecs.utf_32_ex_decode, + codecs.latin_1_decode, + codecs.ascii_decode, + codecs.charmap_decode, + ] + if hasattr(codecs, "mbcs_decode"): + decoders.append(codecs.mbcs_decode) + for decoder in decoders: + self.assertRaises(TypeError, decoder, "xxx") + + def test_unicode_escape(self): + # Escape-decoding an unicode string is supported ang gives the same + # result as decoding the equivalent ASCII bytes string. + self.assertEquals(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + def test_main(): support.run_unittest( @@ -1501,6 +1531,7 @@ BasicUnicodeTest, CharmapTest, WithStmtTest, + TypesTest, ) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Jan 22 11:31:33 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #4874: Most builtin decoders now reject unicode input. + - Issue #4842: Don't allow trailing 'L' when constructing an integer from a string. Modified: python/branches/release30-maint/Modules/_codecsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_codecsmodule.c (original) +++ python/branches/release30-maint/Modules/_codecsmodule.c Thu Jan 22 11:31:33 2009 @@ -258,7 +258,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_7_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -281,7 +281,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_8_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -305,7 +305,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -328,7 +328,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode", &pbuf, &errors, &final)) return NULL; @@ -352,7 +352,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode", &pbuf, &errors, &final)) return NULL; @@ -384,7 +384,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_16_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -409,7 +409,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -432,7 +432,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -455,7 +455,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -486,7 +486,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_32_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -542,7 +542,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:latin_1_decode", + if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode", &pbuf, &errors)) return NULL; @@ -559,7 +559,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:ascii_decode", + if (!PyArg_ParseTuple(args, "y*|z:ascii_decode", &pbuf, &errors)) return NULL; @@ -577,7 +577,7 @@ const char *errors = NULL; PyObject *mapping = NULL; - if (!PyArg_ParseTuple(args, "s*|zO:charmap_decode", + if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode", &pbuf, &errors, &mapping)) return NULL; if (mapping == Py_None) @@ -600,7 +600,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:mbcs_decode", + if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; From buildbot at python.org Thu Jan 22 11:35:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 10:35:03 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090122103503.97FDE1E4002@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/76 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_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 22 11:46:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 10:46:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090122104619.ECB301E401D@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/152 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 Jan 22 12:36:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 11:36:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090122113612.1D7EE1E4002@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/78 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: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Thu Jan 22 12:59:56 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 22 Jan 2009 12:59:56 +0100 (CET) Subject: [Python-checkins] r68857 - in python/branches/py3k: Lib/test/test_multibytecodec.py Modules/cjkcodecs/multibytecodec.c Message-ID: <20090122115956.2B9B11E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 22 12:59:55 2009 New Revision: 68857 Log: Followup of #4874: also fix multibytecodec.c Modified: python/branches/py3k/Lib/test/test_multibytecodec.py python/branches/py3k/Modules/cjkcodecs/multibytecodec.c Modified: python/branches/py3k/Lib/test/test_multibytecodec.py ============================================================================== --- python/branches/py3k/Lib/test/test_multibytecodec.py (original) +++ python/branches/py3k/Lib/test/test_multibytecodec.py Thu Jan 22 12:59:55 2009 @@ -44,7 +44,7 @@ myreplace = lambda exc: ('', sys.maxsize+1) codecs.register_error('test.cjktest', myreplace) self.assertRaises(IndexError, dec, - 'apple\x92ham\x93spam', 'test.cjktest') + b'apple\x92ham\x93spam', 'test.cjktest') def test_codingspec(self): try: @@ -61,6 +61,10 @@ self.assertRaises(AttributeError, _multibytecodec.MultibyteStreamWriter, None) + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + self.assertRaises(TypeError, codecs.getdecoder(enc), "") class Test_IncrementalEncoder(unittest.TestCase): @@ -146,6 +150,12 @@ self.assertRaises(UnicodeDecodeError, decoder.decode, b'', True) self.assertEqual(decoder.decode(b'B@$'), '\u4e16') + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + decoder = codecs.getincrementaldecoder(enc)() + self.assertRaises(TypeError, decoder.decode, "") + class Test_StreamReader(unittest.TestCase): def test_bug1728403(self): try: Modified: python/branches/py3k/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/py3k/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/py3k/Modules/cjkcodecs/multibytecodec.c Thu Jan 22 12:59:55 2009 @@ -612,7 +612,7 @@ const char *data, *errors = NULL; Py_ssize_t datalen, finalsize; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|z:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode", codeckwarglist, &pdata, &errors)) return NULL; data = pdata.buf; @@ -1038,7 +1038,7 @@ Py_ssize_t wsize, finalsize = 0, size, origpending; int final = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode", incrementalkwarglist, &pdata, &final)) return NULL; data = pdata.buf; From python-checkins at python.org Thu Jan 22 13:09:38 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 22 Jan 2009 13:09:38 +0100 (CET) Subject: [Python-checkins] r68858 - in python/branches/release30-maint: Lib/test/test_multibytecodec.py Modules/cjkcodecs/multibytecodec.c Message-ID: <20090122120938.4FFED1E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 22 13:09:38 2009 New Revision: 68858 Log: Merged revisions 68857 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68857 | antoine.pitrou | 2009-01-22 12:59:55 +0100 (jeu., 22 janv. 2009) | 3 lines Followup of #4874: also fix multibytecodec.c ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_multibytecodec.py python/branches/release30-maint/Modules/cjkcodecs/multibytecodec.c Modified: python/branches/release30-maint/Lib/test/test_multibytecodec.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_multibytecodec.py (original) +++ python/branches/release30-maint/Lib/test/test_multibytecodec.py Thu Jan 22 13:09:38 2009 @@ -44,7 +44,7 @@ myreplace = lambda exc: ('', sys.maxsize+1) codecs.register_error('test.cjktest', myreplace) self.assertRaises(IndexError, dec, - 'apple\x92ham\x93spam', 'test.cjktest') + b'apple\x92ham\x93spam', 'test.cjktest') def test_codingspec(self): try: @@ -61,6 +61,10 @@ self.assertRaises(AttributeError, _multibytecodec.MultibyteStreamWriter, None) + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + self.assertRaises(TypeError, codecs.getdecoder(enc), "") class Test_IncrementalEncoder(unittest.TestCase): @@ -146,6 +150,12 @@ self.assertRaises(UnicodeDecodeError, decoder.decode, b'', True) self.assertEqual(decoder.decode(b'B@$'), '\u4e16') + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + decoder = codecs.getincrementaldecoder(enc)() + self.assertRaises(TypeError, decoder.decode, "") + class Test_StreamReader(unittest.TestCase): def test_bug1728403(self): try: 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 Thu Jan 22 13:09:38 2009 @@ -612,7 +612,7 @@ const char *data, *errors = NULL; Py_ssize_t datalen, finalsize; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|z:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode", codeckwarglist, &pdata, &errors)) return NULL; data = pdata.buf; @@ -1038,7 +1038,7 @@ Py_ssize_t wsize, finalsize = 0, size, origpending; int final = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode", incrementalkwarglist, &pdata, &final)) return NULL; data = pdata.buf; From buildbot at python.org Thu Jan 22 14:00:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 13:00:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090122130011.44ABB1E4002@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/154 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: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Thu Jan 22 19:29:28 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 22 Jan 2009 19:29:28 +0100 (CET) Subject: [Python-checkins] r68859 - python/trunk/Doc/documenting/markup.rst Message-ID: <20090122182928.AE9C11E4002@bag.python.org> Author: georg.brandl Date: Thu Jan 22 19:29:28 2009 New Revision: 68859 Log: Clarify wording. Modified: python/trunk/Doc/documenting/markup.rst Modified: python/trunk/Doc/documenting/markup.rst ============================================================================== --- python/trunk/Doc/documenting/markup.rst (original) +++ python/trunk/Doc/documenting/markup.rst Thu Jan 22 19:29:28 2009 @@ -285,7 +285,8 @@ 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```. @@ -310,7 +311,7 @@ .. describe:: data - The name of a module-level variable. + The name of a module-level variable or constant. .. describe:: const From python-checkins at python.org Thu Jan 22 19:37:20 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 22 Jan 2009 19:37:20 +0100 (CET) Subject: [Python-checkins] r68860 - python/branches/py3k/Doc/library/importlib.rst Message-ID: <20090122183720.D29E61E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 22 19:37:20 2009 New Revision: 68860 Log: Fix markup for arguments in importlib docs. Modified: python/branches/py3k/Doc/library/importlib.rst Modified: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k/Doc/library/importlib.rst (original) +++ python/branches/py3k/Doc/library/importlib.rst Thu Jan 22 19:37:20 2009 @@ -68,10 +68,10 @@ .. function:: import_module(name, package=None) - Import a module. The ``name`` argument specifies what module to + Import a module. The *name* argument specifies what module to 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 in relative terms, then the *package* argument must be specified 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 From pierremonetta at free.fr Thu Jan 22 22:12:11 2009 From: pierremonetta at free.fr (Pierre Monetta) Date: Thu, 22 Jan 2009 22:12:11 +0100 Subject: [Python-checkins] =?iso-8859-1?q?L=27aspirateur_indispensable_=E0?= =?iso-8859-1?q?_votre_piscine?= Message-ID: <6460A3B063504ACDA494513075BC3809@athlonyv> An HTML attachment was scrubbed... URL: From pierremonetta at free.fr Thu Jan 22 22:12:30 2009 From: pierremonetta at free.fr (Pierre Monetta) Date: Thu, 22 Jan 2009 22:12:30 +0100 Subject: [Python-checkins] =?iso-8859-1?q?L=27aspirateur_indispensable_=E0?= =?iso-8859-1?q?_votre_piscine?= Message-ID: <6961D533D49D4464A22E9438D1FA4957@athlonyv> An HTML attachment was scrubbed... URL: From pierremonetta at free.fr Thu Jan 22 22:12:05 2009 From: pierremonetta at free.fr (Pierre Monetta) Date: Thu, 22 Jan 2009 22:12:05 +0100 Subject: [Python-checkins] =?iso-8859-1?q?L=27aspirateur_indispensable_=E0?= =?iso-8859-1?q?_votre_piscine?= Message-ID: <58B1FC2A91124E228B23BDB57C6AAB7A@athlonyv> ?,? PIERRE MONETTA A M I C A L -------------- next part -------------- An HTML attachment was scrubbed... URL: From python-checkins at python.org Thu Jan 22 22:50:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 22 Jan 2009 22:50:28 +0100 (CET) Subject: [Python-checkins] r68861 - python/branches/py3k Message-ID: <20090122215028.224A91E4016@bag.python.org> Author: benjamin.peterson Date: Thu Jan 22 22:50:27 2009 New Revision: 68861 Log: Blocked revisions 68850,68853 via svnmerge ........ r68850 | raymond.hettinger | 2009-01-21 23:20:47 -0600 (Wed, 21 Jan 2009) | 1 line More doc tweaks. ........ r68853 | raymond.hettinger | 2009-01-22 03:05:43 -0600 (Thu, 22 Jan 2009) | 1 line Update comments and add an optimized path for Counter.update(). ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Jan 22 22:53:22 2009 From: python-checkins at python.org (jesse.noller) Date: Thu, 22 Jan 2009 22:53:22 +0100 (CET) Subject: [Python-checkins] r68862 - python/trunk/Doc/library/multiprocessing.rst Message-ID: <20090122215322.DEB621E4002@bag.python.org> Author: jesse.noller Date: Thu Jan 22 22:53:22 2009 New Revision: 68862 Log: Issue 4593: apply() documentation is unclear Modified: python/trunk/Doc/library/multiprocessing.rst Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Thu Jan 22 22:53:22 2009 @@ -1524,7 +1524,9 @@ .. method:: apply(func[, args[, kwds]]) Equivalent of the :func:`apply` builtin function. It blocks till the - result is ready. + result is ready. Given this blocks - :meth:`apply_async` is better suited + for performing work in parallel. Additionally, the passed + in function is only executed in one of the workers of the pool. .. method:: apply_async(func[, args[, kwds[, callback]]]) From python-checkins at python.org Thu Jan 22 22:56:14 2009 From: python-checkins at python.org (jesse.noller) Date: Thu, 22 Jan 2009 22:56:14 +0100 (CET) Subject: [Python-checkins] r68863 - in python/branches/py3k: Doc/library/multiprocessing.rst Message-ID: <20090122215614.1C0111E4002@bag.python.org> Author: jesse.noller Date: Thu Jan 22 22:56:13 2009 New Revision: 68863 Log: merge r68862 to py3k Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/multiprocessing.rst Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Thu Jan 22 22:56:13 2009 @@ -1522,7 +1522,9 @@ .. method:: apply(func[, args[, kwds]]) Call *func* with arguments *args* and keyword arguments *kwds*. It blocks - till the result is ready. + till the result is ready. Given this blocks - :meth:`apply_async` is better suited + for performing work in parallel. Additionally, the passed + in function is only executed in one of the workers of the pool. .. method:: apply_async(func[, args[, kwds[, callback]]]) From pierremonetta at free.fr Thu Jan 22 22:12:12 2009 From: pierremonetta at free.fr (Pierre Monetta) Date: Thu, 22 Jan 2009 22:12:12 +0100 Subject: [Python-checkins] =?iso-8859-1?q?L=27aspirateur_indispensable_=E0?= =?iso-8859-1?q?_votre_piscine?= Message-ID: An HTML attachment was scrubbed... URL: From buildbot at python.org Thu Jan 22 23:06:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 22:06:18 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090122220618.ECDAE1E4002@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/178 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,brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 22 23:11:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 22:11:09 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 3.x Message-ID: <20090122221109.686601E4002@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/31 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,brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_cmd_line ====================================================================== 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 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 22 23:17:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 22:17:14 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090122221714.9BB7E1E4002@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/175 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: benjamin.peterson,brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 22 23:32:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 22:32:53 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090122223253.37E511E4002@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/79 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: jesse.noller 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 Jan 22 23:43:07 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 22 Jan 2009 23:43:07 +0100 (CET) Subject: [Python-checkins] r68864 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py machinery.py test/builtin/test_finder.py test/builtin/test_loader.py test/frozen/test_finder.py test/frozen/test_loader.py Message-ID: <20090122224307.5F5901E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 22 23:43:07 2009 New Revision: 68864 Log: Add importlib.machinery with its first tenants, BuitinImporter and FrozenImporter. Docs forthcoming. I plan on all finders and loaders (and most likely hooks) to live in imoprtlib.machinery. Utility stuff will end up in importlib.util. Higher-level API stuff will stay on imoprtlib directly (e.g. import_module). Added: python/branches/py3k/Lib/importlib/machinery.py Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py 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/frozen/test_finder.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 Thu Jan 22 23:43:07 2009 @@ -1,9 +1,16 @@ to do ///// +* Document: + + + The terms "importer", "finder", and "loader". + + machinery.BuiltinImporter. + + machinery.FrozenImporter. + * Expose resolve_name(). * Backport to Python 2.7. + + import_module + resolve_name @@ -11,9 +18,11 @@ that various implementations can just subclass as needed. * Expose built-in and frozen importers. + + Make staticmethods so that class can be used directly. * Reorganize support code. + + Separate general support code and importer-specific (e.g. source) support code. - Create support modules for each subdirectory (as needed). @@ -22,12 +31,14 @@ - 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. * Implement PEP 302 protocol for loaders (should just be a matter of testing). + + Built-in. + Frozen. + Extension. @@ -36,39 +47,59 @@ * 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. * Public API to expose (w/ docs!) + + abc + - Finder + * find_module + - Loader + * load_module + - ResourceLoader(Loader) + * get_data + - InspectLoader(Loader) + * is_package * get_code * get_source + - (?) SourceLoader(ResourceLoader) + * source_path * bytecode_path * write_bytecode + + util + - get_module decorator (new name) - check_name decorator (new name) - + hooks (?) + + + machinery + - (?) Chained path hook/finder - BuiltinImporter - FrozenImporter - (?) FileFinder - Extensions importers + * ExtensionFinder * (?) Loader + - Source/bytecode importers + * SourceFinder * (?) Loader Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Thu Jan 22 23:43:07 2009 @@ -90,60 +90,17 @@ self.obj.close() -class _BuiltinFrozenBaseLoader(object): +class BuiltinImporter: - """Base class for meta_path loaders for built-in and frozen modules. + """Meta path loader for built-in modules. - Subclasses must implement: - - * _find(fullname:str) -> bool - Finder which returns whether the class can handle the module. - - * _load(fullname:str) -> module - Loader which returns the loaded module. The check for sys.modules - does not need to be handled by this method. - - * type_:str - Name of the type of module being handled. Used in error messages. + All methods are either class or static methods, allowing direct use of the + class. """ - def find_module(self, fullname, path=None): - """Find a module.""" - if not self._find(fullname): - return None - return self - - def load_module(self, fullname): - """Load a module.""" - try: - return sys.modules[fullname] - except KeyError: - pass - mod = self._load(fullname) - if not mod: - raise ImportError("expected {0} module not " - "loaded".format(self.type_)) - return mod - - -class BuiltinImporter(_BuiltinFrozenBaseLoader): - - """Meta path loader for built-in modules.""" - - type_ = "built-in" - - def __init__(self): - """Set the methods needed by the class. - - Cannot be set at the class level because the imp module is not - necessarily injected until after the class is created. - - """ - self._find = imp.is_builtin - self._load = imp.init_builtin - - def find_module(self, fullname, path=None): + @classmethod + def find_module(cls, fullname, path=None): """Try to find the built-in module. If 'path' is ever specified then the search is considered a failure. @@ -151,36 +108,36 @@ """ if path is not None: return None - return super().find_module(fullname, path) + return cls if imp.is_builtin(fullname) else None - def load_module(self, fullname): + @staticmethod + def load_module(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 super().load_module(fullname) - + return imp.init_builtin(fullname) -class FrozenImporter(_BuiltinFrozenBaseLoader): - """Meta path class for importing frozen modules.""" +class FrozenImporter: - type_ = 'frozen' + """Meta path class for importing frozen modules. - def __init__(self): - """Specify the methods needed by the superclass. + All methods are either class or static method to allow direct use of the + class. - Because imp may not be injected until after class creation these - methods cannot be set at the class level. + """ - """ - self._find = imp.is_frozen - self._load = imp.init_frozen + @classmethod + def find_module(cls, fullname, path=None): + """Find a frozen module.""" + return cls if imp.is_frozen(fullname) else None - def load_module(self, fullname): + @classmethod + def load_module(cls, fullname): """Load a frozen module.""" - if not self.find_module(fullname): + if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - return super().load_module(fullname) + return imp.init_frozen(fullname) class ChainedImporter(object): @@ -707,7 +664,7 @@ """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() + self.extended_meta_path = BuiltinImporter, FrozenImporter else: self.extended_meta_path = extended_meta_path self.default_path_hook = default_path_hook Added: python/branches/py3k/Lib/importlib/machinery.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/machinery.py Thu Jan 22 23:43:07 2009 @@ -0,0 +1,4 @@ +"""The machinery of importlib: finders, loaders, hooks, etc.""" + +from ._bootstrap import BuiltinImporter +from ._bootstrap import FrozenImporter 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 Thu Jan 22 23:43:07 2009 @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from .. import support import sys @@ -12,7 +12,7 @@ name = 'errno' find_module = staticmethod(lambda name, path=None: - importlib.BuiltinImporter().find_module(name, path)) + machinery.BuiltinImporter.find_module(name, path)) def test_find_module(self): 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 Thu Jan 22 23:43:07 2009 @@ -1,4 +1,5 @@ import importlib +from importlib import machinery from .. import support import sys @@ -23,7 +24,7 @@ self.assert_(module.__name__ in sys.modules) load_module = staticmethod(lambda name: - importlib.BuiltinImporter().load_module(name)) + machinery.BuiltinImporter.load_module(name)) def test_load_module(self): # Common case. Modified: python/branches/py3k/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/frozen/test_finder.py Thu Jan 22 23:43:07 2009 @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from ..builtin import test_finder from .. import support @@ -10,7 +10,7 @@ """Test finding frozen modules.""" def find(self, name, path=None): - finder = importlib.FrozenImporter() + finder = machinery.FrozenImporter return finder.find_module(name, path) 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 Thu Jan 22 23:43:07 2009 @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from ..builtin import test_loader @@ -6,7 +6,7 @@ name = '__phello__' load_module = staticmethod(lambda name: - importlib.FrozenImporter().load_module(name)) + machinery.FrozenImporter.load_module(name)) verification = {'__name__': '__phello__', '__file__': '', '__package__': None, '__path__': ['__phello__']} From python-checkins at python.org Thu Jan 22 23:44:05 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 22 Jan 2009 23:44:05 +0100 (CET) Subject: [Python-checkins] r68865 - python/branches/py3k/Lib/importlib/__init__.py Message-ID: <20090122224405.0FFB31E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 22 23:44:04 2009 New Revision: 68865 Log: Add some comment markers to more clearly delineate what different parts of the code are for. Also add a note that the import * at the end of the file should eventually go away. Modified: python/branches/py3k/Lib/importlib/__init__.py Modified: python/branches/py3k/Lib/importlib/__init__.py ============================================================================== --- python/branches/py3k/Lib/importlib/__init__.py (original) +++ python/branches/py3k/Lib/importlib/__init__.py Thu Jan 22 23:44:04 2009 @@ -38,6 +38,8 @@ __builtins__['__import__'] = original__import__ +# Bootstrap help ##################################################### + def _case_ok(directory, check): """Check if the directory contains something matching 'check'. @@ -110,6 +112,8 @@ marshal._r_long = _r_long +# Public API ######################################################### + __import__ = _bootstrap.Import().__call__ @@ -134,5 +138,5 @@ return sys.modules[name] - +# XXX This should go away once the public API is done. from ._bootstrap import * From python-checkins at python.org Thu Jan 22 23:45:01 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 22 Jan 2009 23:45:01 +0100 (CET) Subject: [Python-checkins] r68866 - in python/branches/py3k/Lib/importlib: test test/builtin test/extension test/frozen test/import_ test/source Message-ID: <20090122224501.0D6B71E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 22 23:45:00 2009 New Revision: 68866 Log: Ignore pyc and pyo files. Modified: python/branches/py3k/Lib/importlib/ (props changed) python/branches/py3k/Lib/importlib/test/ (props changed) python/branches/py3k/Lib/importlib/test/builtin/ (props changed) python/branches/py3k/Lib/importlib/test/extension/ (props changed) python/branches/py3k/Lib/importlib/test/frozen/ (props changed) python/branches/py3k/Lib/importlib/test/import_/ (props changed) python/branches/py3k/Lib/importlib/test/source/ (props changed) From buildbot at python.org Fri Jan 23 00:11:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 22 Jan 2009 23:11:59 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090122231159.2C9051E401F@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/156 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: jesse.noller 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 Jan 23 01:43:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 00:43:23 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD trunk Message-ID: <20090123004323.2B1581E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%20trunk/builds/512 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: The web-page 'force build' button was pressed by 'Dave': testing Build Source Stamp: [branch trunk] HEAD Blamelist: BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri Jan 23 04:26:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 23 Jan 2009 04:26:37 +0100 (CET) Subject: [Python-checkins] r68867 - in python/branches/py3k: Doc/documenting/markup.rst Doc/library/io.rst Doc/library/subprocess.rst Doc/library/symtable.rst Lib/heapq.py Objects/stringlib/fastsearch.h Message-ID: <20090123032637.3EEFE1E4010@bag.python.org> Author: benjamin.peterson Date: Fri Jan 23 04:26:36 2009 New Revision: 68867 Log: Merged revisions 68750,68776-68777,68811,68842,68859 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68750 | benjamin.peterson | 2009-01-18 16:47:04 -0600 (Sun, 18 Jan 2009) | 1 line fix encoding cookie case ........ r68776 | benjamin.peterson | 2009-01-19 10:17:54 -0600 (Mon, 19 Jan 2009) | 1 line move BufferedIOBase into the base class section ........ r68777 | benjamin.peterson | 2009-01-19 10:18:27 -0600 (Mon, 19 Jan 2009) | 1 line add email address ........ r68811 | benjamin.peterson | 2009-01-20 12:58:27 -0600 (Tue, 20 Jan 2009) | 1 line fix url ........ r68842 | andrew.kuchling | 2009-01-20 20:16:26 -0600 (Tue, 20 Jan 2009) | 1 line Markup fixes ........ r68859 | georg.brandl | 2009-01-22 12:29:28 -0600 (Thu, 22 Jan 2009) | 2 lines Clarify wording. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/documenting/markup.rst python/branches/py3k/Doc/library/io.rst python/branches/py3k/Doc/library/subprocess.rst python/branches/py3k/Doc/library/symtable.rst python/branches/py3k/Lib/heapq.py python/branches/py3k/Objects/stringlib/fastsearch.h Modified: python/branches/py3k/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k/Doc/documenting/markup.rst (original) +++ python/branches/py3k/Doc/documenting/markup.rst Fri Jan 23 04:26:36 2009 @@ -285,7 +285,8 @@ 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```. @@ -310,7 +311,7 @@ .. describe:: data - The name of a module-level variable. + The name of a module-level variable or constant. .. describe:: const Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Fri Jan 23 04:26:36 2009 @@ -328,59 +328,6 @@ ``len(b)``, since if the write fails, an :exc:`IOError` will be raised). -Raw File I/O ------------- - -.. class:: FileIO(name[, mode]) - - :class:`FileIO` represents a file containing bytes data. It implements - the :class:`RawIOBase` interface (and therefore the :class:`IOBase` - interface, too). - - The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, - or appending. The file will be created if it doesn't exist when opened for - writing or appending; it will be truncated when opened for writing. Add a - ``'+'`` to the mode to allow simultaneous reading and writing. - - In addition to the attributes and methods from :class:`IOBase` and - :class:`RawIOBase`, :class:`FileIO` provides the following data - attributes and methods: - - .. attribute:: mode - - The mode as given in the constructor. - - .. attribute:: name - - The file name. This is the file descriptor of the file when no name is - given in the constructor. - - .. method:: read([n]) - - Read and return at most *n* bytes. Only one system call is made, so it is - possible that less data than was requested is returned. Use :func:`len` - on the returned bytes object to see how many bytes were actually returned. - (In non-blocking mode, ``None`` is returned when no data is available.) - - .. method:: readall() - - Read and return the entire file's contents in a single bytes object. As - much as immediately available is returned in non-blocking mode. If the - EOF has been reached, ``b''`` is returned. - - .. method:: write(b) - - Write the bytes or bytearray object, *b*, to the file, and return - the number actually written. Only one system call is made, so it - is possible that only some of the data is written. - - Note that the inherited ``readinto()`` method should not be used on - :class:`FileIO` objects. - - -Buffered Streams ----------------- - .. class:: BufferedIOBase Base class for streams that support buffering. It inherits :class:`IOBase`. @@ -438,6 +385,59 @@ underlying raw stream cannot accept more data at the moment. +Raw File I/O +------------ + +.. class:: FileIO(name[, mode]) + + :class:`FileIO` represents a file containing bytes data. It implements + the :class:`RawIOBase` interface (and therefore the :class:`IOBase` + interface, too). + + The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, + or appending. The file will be created if it doesn't exist when opened for + writing or appending; it will be truncated when opened for writing. Add a + ``'+'`` to the mode to allow simultaneous reading and writing. + + In addition to the attributes and methods from :class:`IOBase` and + :class:`RawIOBase`, :class:`FileIO` provides the following data + attributes and methods: + + .. attribute:: mode + + The mode as given in the constructor. + + .. attribute:: name + + The file name. This is the file descriptor of the file when no name is + given in the constructor. + + .. method:: read([n]) + + Read and return at most *n* bytes. Only one system call is made, so it is + possible that less data than was requested is returned. Use :func:`len` + on the returned bytes object to see how many bytes were actually returned. + (In non-blocking mode, ``None`` is returned when no data is available.) + + .. method:: readall() + + Read and return the entire file's contents in a single bytes object. As + much as immediately available is returned in non-blocking mode. If the + EOF has been reached, ``b''`` is returned. + + .. method:: write(b) + + Write the bytes or bytearray object, *b*, to the file, and return + the number actually written. Only one system call is made, so it + is possible that only some of the data is written. + + Note that the inherited ``readinto()`` method should not be used on + :class:`FileIO` objects. + + +Buffered Streams +---------------- + .. class:: BytesIO([initial_bytes]) A stream implementation using an in-memory bytes buffer. It inherits Modified: python/branches/py3k/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k/Doc/library/subprocess.rst (original) +++ python/branches/py3k/Doc/library/subprocess.rst Fri Jan 23 04:26:36 2009 @@ -160,11 +160,12 @@ Run command with arguments and return its output as a byte string. - If the exit code was non-zero it raises a CalledProcessError. The - CalledProcessError object will have the return code in the returncode - attribute and output in the output attribute. + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + :exc:`CalledProcessError` object will have the return code in the + :attr:`returncode` + attribute and output in the :attr:`output` attribute. - The arguments are the same as for the Popen constructor. Example: + The arguments are the same as for the :class:`Popen` constructor. Example: >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' Modified: python/branches/py3k/Doc/library/symtable.rst ============================================================================== --- python/branches/py3k/Doc/library/symtable.rst (original) +++ python/branches/py3k/Doc/library/symtable.rst Fri Jan 23 04:26:36 2009 @@ -5,7 +5,7 @@ :synopsis: Interface to the compiler's internal symbol tables. .. moduleauthor:: Jeremy Hylton -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson Symbol tables are generated by the compiler from AST just before bytecode is Modified: python/branches/py3k/Lib/heapq.py ============================================================================== --- python/branches/py3k/Lib/heapq.py (original) +++ python/branches/py3k/Lib/heapq.py Fri Jan 23 04:26:36 2009 @@ -1,4 +1,4 @@ -# -*- coding: Latin-1 -*- +# -*- coding: latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). Modified: python/branches/py3k/Objects/stringlib/fastsearch.h ============================================================================== --- python/branches/py3k/Objects/stringlib/fastsearch.h (original) +++ python/branches/py3k/Objects/stringlib/fastsearch.h Fri Jan 23 04:26:36 2009 @@ -5,7 +5,7 @@ /* fast search/count implementation, based on a mix between boyer- moore and horspool, with a few more bells and whistles on the top. - for some more background, see: http://effbot.org/stringlib */ + for some more background, see: http://effbot.org/stringlib.htm */ /* note: fastsearch may access s[n], which isn't a problem when using Python's ordinary string types, but may cause problems if you're From buildbot at python.org Fri Jan 23 04:50:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 03:50:41 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090123035041.920DB1E4002@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/81 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 Fri Jan 23 05:11:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 04:11:38 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090123041138.DD49A1E4002@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/158 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Fri Jan 23 05:43:46 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Fri, 23 Jan 2009 05:43:46 +0100 (CET) Subject: [Python-checkins] r68868 - python/branches/py3k/Modules/_pickle.c Message-ID: <20090123044346.DB7171E400C@bag.python.org> Author: alexandre.vassalotti Date: Fri Jan 23 05:43:46 2009 New Revision: 68868 Log: Remove unnecessary copying in load_long(). Modified: python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Fri Jan 23 05:43:46 2009 @@ -2881,7 +2881,7 @@ load_long(UnpicklerObject *self) { PyObject *value; - char *s, *ss; + char *s; Py_ssize_t len; if ((len = unpickler_readline(self, &s)) < 0) @@ -2894,17 +2894,9 @@ compatibility with Python 3.0.0, we don't actually *require* the 'L' to be present. */ if (s[len-2] == 'L') { - ss = (char *)PyMem_Malloc(len-1); - if (ss == NULL) { - PyErr_NoMemory(); - return -1; - } - strncpy(ss, s, len-2); - ss[len-2] = '\0'; - + s[len-2] = '\0'; /* XXX: Should the base argument explicitly set to 10? */ - value = PyLong_FromString(ss, NULL, 0); - PyMem_Free(ss); + value = PyLong_FromString(s, NULL, 0); } else { value = PyLong_FromString(s, NULL, 0); From python-checkins at python.org Fri Jan 23 05:46:05 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Fri, 23 Jan 2009 05:46:05 +0100 (CET) Subject: [Python-checkins] r68869 - python/branches/py3k/Doc/library/pickle.rst Message-ID: <20090123044605.B16B01E4002@bag.python.org> Author: alexandre.vassalotti Date: Fri Jan 23 05:46:05 2009 New Revision: 68869 Log: Remove obsolete note on binary-mode vs. text-mode file. Modified: python/branches/py3k/Doc/library/pickle.rst Modified: python/branches/py3k/Doc/library/pickle.rst ============================================================================== --- python/branches/py3k/Doc/library/pickle.rst (original) +++ python/branches/py3k/Doc/library/pickle.rst Fri Jan 23 05:46:05 2009 @@ -130,16 +130,6 @@ The highest protocol version available. This value can be passed as a *protocol* value. -.. note:: - - Be sure to always open pickle files created with protocols >= 1 in binary mode. - For the old ASCII-based pickle protocol 0 you can use either text mode or binary - mode as long as you stay consistent. - - A pickle file written with protocol 0 in binary mode will contain lone linefeeds - as line terminators and therefore will look "funny" when viewed in Notepad or - other editors which do not support this format. - .. data:: DEFAULT_PROTOCOL The default protocol used for pickling. May be less than HIGHEST_PROTOCOL. From python-checkins at python.org Fri Jan 23 05:50:05 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Fri, 23 Jan 2009 05:50:05 +0100 (CET) Subject: [Python-checkins] r68870 - python/branches/py3k/Doc/library/pickle.rst Message-ID: <20090123045005.B239B1E4002@bag.python.org> Author: alexandre.vassalotti Date: Fri Jan 23 05:50:05 2009 New Revision: 68870 Log: Issue 2980: Protocol 0 is not truly restricted to ASCII. Modified: python/branches/py3k/Doc/library/pickle.rst Modified: python/branches/py3k/Doc/library/pickle.rst ============================================================================== --- python/branches/py3k/Doc/library/pickle.rst (original) +++ python/branches/py3k/Doc/library/pickle.rst Fri Jan 23 05:50:05 2009 @@ -98,8 +98,8 @@ There are currently 4 different protocols which can be used for pickling. -* Protocol version 0 is the original ASCII protocol and is backwards compatible - with earlier versions of Python. +* Protocol version 0 is the original human-readable protocol and is + backwards compatible with earlier versions of Python. * Protocol version 1 is the old binary format which is also compatible with earlier versions of Python. From python-checkins at python.org Fri Jan 23 06:02:26 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 23 Jan 2009 06:02:26 +0100 (CET) Subject: [Python-checkins] r68871 - peps/trunk/pep-0374.txt Message-ID: <20090123050226.CA79E1E4002@bag.python.org> Author: brett.cannon Date: Fri Jan 23 06:02:26 2009 New Revision: 68871 Log: Conversion of PEP 374 from Google Docs to reST. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Fri Jan 23 06:02:26 2009 @@ -2,13 +2,1448 @@ Title: Migrating from svn to a distributed VCS Version: $Revision: 65628 $ Last-Modified: $Date: 2008-08-10 06:59:20 -0700 (Sun, 10 Aug 2008) $ -Author: Brett Cannon -Status: Draft +Author: Brett Cannon , + Stephen J. Turnbull , + Alexandre Vassalotti , + Barry Warsaw +Status: Active Type: Process Content-Type: text/x-rst Created: 07-Nov-2008 Post-History: 07-Nov-2008 + 22-Jan-2009 -.. note:: - While the PEP is under active editing, it can be viewed at - http://docs.google.com/Doc?id=dg7fctr4_40dvjkdg64 . + +Rationale +========= + +Python has been using a centralized version control system (VCS; +first CVS, now Subversion) for years to great effect. Having a master +copy of the official version of Python provides people with a single +place to always get the official Python source code. It has also +allowed for the storage of the history of the language, mostly for +help with development, but also for posterity. And of course the V in +VCS is very helpful when developing. + +But a centralized version control system has its drawbacks. First and +foremost, in order to have the benefits of version control with +Python in a seamless fashion, one must be a "core developer" (i.e. +someone with commit privileges on the master copy of Python). People +who are not core developers but who wish to work with Python's +revision tree, e.g. anyone writing a patch for Python or creating a +custom version, do not have direct tool support for revisions. This +can be quite a limitation, since these non-core developers cannot do +easily do basic tasks such as reverting changes to a previously +saved state, creating branches, publishing one's changes with full +revision history, etc.? For non-core developers, the last safe tree +state is one the Python developers happen to set, and this prevents +safe development. This second-class citizenship is a hindrance to +people who wish to contribute to Python with a patch of any +complexity and want a way to incrementally save their progress to +make their development lives easier. + +There is also the issue of having to be online to be able to commit +one's work. Because centralized VCSs keep a central copy that stores +all revisions, one must have Internet access in order for their +revisions to be stored; no Net, no commit. This can be annoying if +you happen to be traveling and lack any Internet. There is also the +situation of someone wishing to contribute to Python but having a +bad Internet connection where committing is time-consuming and +expensive and it might work out better to do it in a single step. + +Another drawback to a centralized VCS is that a common use case is +for a developer to revise patches in response to review comments.? +This is more difficult with a centralized model because there's no +place to contain intermediate work.? It's either all checked in or +none of it is checked in.? In the centralized VCS, it's also very +difficult to track changes to the trunk as they are committed, while +you're working on your feature or bug fix branch.? This increases +the risk that such branches will grow stale, out-dated, or that +merging them into the trunk will generate too may conflicts to be +easily resolved. + +Lastly, there is the issue of maintenance of Python. At any one time +there is at least one major version of Python under development (at +the time of this writing there are two). For each major version of +Python under development there is at least the maintenance version +of the last minor version and the in-development minor version (e.g. +with 2.6 just released, that means that both 2.6 and 2.7 are being +worked on). Once a release is done, a branch is created between the +code bases where changes in one version do not (but could) belong in +the other version. As of right now there is no natural support for +this branch in time in central VCSs; you must use tools that +simulate the branching.? Tracking merges is similarly painful for +developers, as revisions often need to be merged between four active +branches (e.g. 2.6 maintenance, 3.0 maintenance, 2.7 development, +3.1 development).? In this case, VCSs such as Subversion only handle +this through arcane third party tools. + +Distributed VCSs (DVCSs) solve all of these problems. While one can +keep a master copy of a revision tree, anyone is free to copy that +tree for their own use. This gives everyone the power to commit +changes to their copy, online or offline. It also more naturally +ties into the idea of branching in the history of a revision tree +for maintenance and the development of new features bound for +Python.? DVCSs also provide a great many additional features that +centralized VCSs don't or can't provide. + +This PEP explores the issue of changing Python's use of Subversion +for any of the current Python-implemented DVCSs, in order to gain +the benefits outlined above. + + +Terminology +=========== + +Agreeing on a common terminology is surprisingly difficult, +primarily because each VCS uses these terms when describing subtly +different tasks, objects, and concepts.? Where possible, we try to +provide a generic definition of the concepts, but you should consult +the individual system's glossaries for details. ?Here are some basic +references for terminology, from some of the standard web-based +references on each VCS. You can also refer to glossaries for each +DVCS: + +* Subversion : http://svnbook.red-bean.com/en/1.5/svn.basic.html +* Bazaar : http://bazaar-vcs.org/BzrGlossary +* Mercurial : http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial +* git : http://book.git-scm.com/1_the_git_object_model.html + + + + +branch + A line of development; a collection of revisions, ordered by + time. + +checkout/working copy/working tree + A tree of code the developer can edit, linked to a branch. + +index + A "staging area" where a revision is built (unique to git). + +repository + A collection of revisions, organized into branches. + +clone + A complete copy of a branch or repository. + +commit + To record a revision in a repository. + +merge + Applying all the changes and history from one branch/repository + to another. + +pull + To update a checkout/clone from the original branch/repository, + which can be remote or local + +push/publish + To copy a revision, and all revisions it depends on, from a one + repository to another. + +cherry-pick + To merge one or more specific revisions from one branch to + another, possibly in a different repository, possibly without its + dependent revisions. + +rebase + To "detach" a branch, and move it to a new branch point; move + commits to the beginning of a branch instead of where they + happened in time. + + +Typical Workflow +================ + +At the moment, the typical workflow for a Python core developer is: + + +* Edit code in a checkout until it is stable enough to commit/push. +* Commit to the master repository. + +It is a rather simple workflow, but it has drawbacks. For one, +because any work that involves the repository takes time thanks to +the network, commits/pushes tend to not necessarily be as atomic as +possible. There is also the drawback of there not being a +necessarily cheap way to create new checkouts beyond a recursive +copy of the checkout directory. + +A DVCS would lead to a workflow more like this: + +* Branch off of a local clone of the master repository. +* Edit code, committing in atomic pieces. +* Merge the branch into the mainline, and +* Push all commits to the master repository. + +While there are more possible steps, the workflow is much more +independent of the master repository than is currently possible. By +being able to commit locally at the speed of your disk, a core +developer is able to do atomic commits much more frequently, +minimizing having commits that do multiple things to the code. Also +by using a branch, the changes are isolated (if desired) from other +changes being made by other developers.? Because branches are cheap, +it is easy to create and maintain many smaller branches that address +one specific issue, e.g. one bug or one new feature.? More +sophisticated features of DVCSs allow the developer to more easily +track long running development branches as the official mainline +progresses. + + +Contenders +========== + +========== ========== ======= =================================== ========================================== +Name Short Name Version 2.x Trunk Mirror 3.x Trunk Mirror +---------- ---------- ------- ----------------------------------- ------------------------------------------ +Bazaar_ bzr 1.10 http://code.python.org/python/trunk http://code.python.org/python/3.0 +Mercurial_ hg 1.1 http://code.python.org/hg/trunk/ http://code.python.org/hg/branches/py3k/ +git_ N/A 1.6.0.6 git://code.python.org/python/trunk git://code.python.org/python/branches/py3k +========== ========== ======= =================================== ========================================== + +.. _Bazaar: http://bazaar-vcs.org/ +.. _Mercurial: http://www.selenic.com/mercurial/ +.. _git: http://www.git-scm.com/ + +This PEP does not consider darcs, arch, or monotone. The main +problem with these DVCSs is that they are simply not popular enough +to bother supporting when they do not provide some very compelling +features that the other DVCSs provide. ?Arch and darcs also have +significant performance problems which seem unlikely to be addressed +in the near future. + + +Usage Scenarios +=============== + +Probably the best way to help decide on whether/which DVCS should +replace Subversion is to see what it takes to perform some +real-world usage scenarios that developers (core and non-core) have +to work with. Each usage scenario outlines what it is, a bullet list +of what the basic steps are (which can vary slightly per VCS), and +how to perform the usage scenario in the various VCSs +(including Subversion). + +Each VCS had a single author in charge of writing implementations +for each scenario (unless otherwise noted). + +========= === +Name VCS +--------- --- +Brett svn +Barry bzr +Alexandre hg +Stephen git +========= === + + +Initial Setup +------------- + +Some DVCSs have some perks if you do some initial setup upfront. +This section covers what can be done before any of the usage +scenarios are run in order to take better advantage of the tools. + +All of the DVCSs support configuring your project identification. +Unlike the centralized systems, they use your email address to +identify your commits. ?(Access control is generally done by +mechanisms external to the DVCS, such as ssh or console login). +This identity may be associated with a full name.? + +All of the DVCSs will query the system to get some approximation to +this information, but that may not be what you want. ?They also +support setting this information on a per-user basis, and on a per- +project basis. ?Convenience commands to set these attributes vary, +but all allow direct editing of configuration files. + +Some VCSs support end-of-line (EOL) conversions on checkout/checkin. ? + + +svn +''' + +None required, but it is recommended you follow the +`guidelines `_ +in the dev FAQ. + + +bzr +''' + +No setup is required, but for much quicker and space-efficient local +branching, you should create a shared repository to hold all your +Python branches.? A shared repository is really just a parent +directory containing a .bzr directory.? When bzr commits a revision, +it searches from the local directory on up the file system for a .bzr +directory to hold the revision.? By sharing revisions across multiple +branches, you cut down on the amount of disk space used.? Do this:: + + ? cd ~/projects + ? bzr init-repo python + ? cd python + +Now, all your Python branches should be created inside of +``~/projects/python``. + +There are also some settings you can put in your +``~/.bzr/bazaar.conf`` +and ``~/.bzr/locations.conf`` file to set up defaults for interacting +with Python code.? None of them are required, although some are +recommended.? E.g. I would suggest gpg signing all commits, but that +might be too high a barrier for developers.? Also, you can set up +default push locations depending on where you want to push branches +by default.? If you have write access to the master branches, that +push location could be code.python.org.? Otherwise, it might be a +free Bazaar code hosting service such as Launchpad.? If Bazaar is +chosen, we should decide what the policies and recommendations are. + +At a minimum, I would set up your email address:: + + ? bzr whoami "Firstname Lastname " + + +hg +'' + +Minimally, you should set your user name. To do so, create the file +``.hgrc`` in your home directory and add the following:: + + ?[ui] + ?username = Firstname Lastname + +If you are using Windows, enable the win32text extension to use +Unix-style newlines by adding to your configuration:: + + ?[extensions] + ?win32text = + +These options can also be set locally to a given repository by +customizing ``/.hg/hgrc``, instead of ``~/.hgrc``. + + +git +''' + +None needed. ?However, git supports a number of features that can +smooth your work, with a little preparation. ?git supports setting +defaults at the workspace, user, and system levels. ?The system +level is out of scope of this PEP. ?The user configuration file is +``$HOME/.gitconfig`` on Unix-like systems, and the workspace +configuration file is ``$REPOSITORY/.git/config``. + +You can use the ``git-config`` tool to set preferences for user.name and +user.email either globally (for your system login account) or +locally (to a given git working copy), or you can edit the +configuration files (which have the same format as shown in the +Mercurial section above).:: + + # my full name doesn't change + # note "--global" flag means per user + # (system-wide configuration is set with "--system") + git config --global user.name 'Firstname Lastname' + # but use my Pythonic email address + cd /path/to/python/repository + git config user.email email.address at python.example.com + +If you are using Windows, you probably want to set the core.autocrlf +and core.safecrlf?preferences to true using ``git-config``.:: + + # check out files with CRLF line endings rather than Unix-style LF only + git config --global core.autocrlf true + # scream if a transformation would be ambiguous + # (eg, a working file contains both naked LF and CRLF) + # and check them back in with the reverse transformation + git config --global core.safecrlf true + +Although the repository will usually contain a .gitignore file +specifying file names that rarely if ever should be registered in the +VCS, you may have personal conventions (e.g., always editing log +messages in a temporary file named ".msg") that you may wish to +specify.:: + + # tell git where my personal ignores are + git config --global core.excludesfile ~/.gitignore + # I use .msg for my long commit logs, and Emacs makes backups in + # files ending with ~ + # these are globs, not regular expressions + echo '*~' >> ~/.gitignore + echo '.msg' >> ~/.gitignore + +If you use multiple branches, 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. + + +One-Off Checkout +---------------- + +As a non-core developer, I want to create and publish a one-off patch +that fixes a bug, so that a core developer can review it for +inclusion in the mainline. + +* Checkout/branch/clone trunk. +* Edit some code. +* Generate a patch (based on what is best supported by the VCS, e.g. + branch history). +* Receive reviewer comments and address the issues. +* Generate a second patch for the core developer to commit. + + +svn +''' +:: + + svn checkout http://svn.python.org/projects/python/trunk + cd trunk + # Edit some code. + echo "The cake is a lie!" > README + # Since svn lacks support for local commits, we fake it with patches. + svn diff ? commit-1.diff + svn diff ? patch-1.diff + # Upload the patch-1 to bugs.python.org. + # Receive reviewer comments. + # Edit some code. + echo "The cake is real!" > README + # Since svn lacks support for local commits, we fake it with patches. + svn diff ? commit-2.diff + svn diff ? patch-2.diff + # Upload patch-2 to bugs.python.org + + +bzr +''' +:: + + bzr branch http://code.python.org/python/trunk + cd trunk + # Edit some code. + bzr commit -m 'Stuff I did' + bzr send -o bundle + # Upload bundle to bugs.python.org + # Receive reviewer comments + # Edit some code + bzr commit -m 'Respond to reviewer comments' + bzr send -o bundle + # Upload updated bundle to bugs.python.org + + +hg +'' +:: + + hg clone http://code.python.org/hg/trunk + 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 + # Upload patch to bugs.python.org + # Receive reviewer comments + # Edit some code + hg commit -m "Address reviewer comments." + hg export tip ? additional-fixes.patch + # Upload patch to bugs.python.org + + +git +''' + +The patches could be created with +``git diff master > stuff-i-did.patch``, too,?but +``git format-patch | git am`` knows some tricks +(empty files, renames, etc) that?ordinary patch can't handle.? git +grabs "Stuff I did" out of the the commit message to create the file +name 0001-Stuff-I-did.patch. ?See Patch Review below for a +description of the?git-format-patch format.:: + + # Get the mainline code. + git clone git://code.python.org/python/trunk + cd trunk + # 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). + git format-patch master + git tag stuff-v1 + # Upload 0001-Stuff-I-did.patch to bugs.python.org. + # Time passes ... receive reviewer comments. + # Edit more code. + git commit -a -m 'Address reviewer comments.' + # Make an add-on patch to apply on top of the original. + git format-patch stuff-v1 + # Upload 0001-Address-reviewer-comments.patch to bugs.python.org. + + +Backing Out Changes +------------------- + +As a core developer, I want to undo a change that was not ready for +inclusion in the mainline. + +* Back out the unwanted change. +* Push patch to server. + + +svn +''' +:: + + # Assume the change to revert is in revision 40 + svn merge -r40:39 . + # Resolve conflicts, if any. + svn commit -m "Reverted revision 40" + + +bzr +''' +:: + + # Assume the change to revert is in revision 40 + bzr merge -r 40..39 + # Resolve conflicts, if any. + bzr commit -m "Reverted revision 40" + +Note that if the change you want revert is the last one that was +made, you can just use ``bzr uncommit``. + + +hg +'' +:: + + # Assume the change to revert is in revision 9150dd9c6d30 + hg backout --merge -r 9150dd9c6d30 + # Resolve conflicts, if any. + hg commit -m "Reverted changeset 9150dd9c6d30" + hg push + + +git +''' +:: + + # Assume the change to revert is the grandfather of a revision tagged "newhotness". + git revert newhotness~2 + #if CONFLICTS + # ? ?Resolve conflicts if any. + git commit -m "Reverted changeset?9150dd9c6d30." + #else + # ? ?Edit log message, commit will be done automatically. + #endif + git push + + +Patch Review +------------ + +As a core developer, I want to review patches submitted by other +people, so that I can make sure that only approved changes are added +to Python. + +Core developers have to review patches as submitted by other people. +This requires applying the patch, testing it, and then tossing away +the changes. The assumption can be made that a core developer already +has a checkout/branch/clone of the trunk. + +* Branch off of trunk. +* Apply patch w/o any comments as generated by the patch submitter. +* Push patch to server. +* Delete now-useless branch. + + +svn +''' + +Subversion does not exactly fit into this development style very well +as there are no such thing as a "branch" as has been defined in this +PEP. Instead a developer either needs to create another checkout for +testing a patch or create a branch on the server. Up to this point, +core developers have not taken the "branch on the server" approach to +dealing with individual patches. For this scenario the assumption +will be the developer creates a local checkout of the trunk to work +with.:: + + cp -r trunk issue0000 + cd issue0000 + patch -p0 < __patch__ + # Review patch. + svn commit -m "Some patch." + cd .. + rm -r issue0000 + + +bzr +''' +:: + + bzr branch trunk issueNNNN + # Download `patch` bundle from Roundup + bzr merge patch + # Review patch + bzr commit -m'Patch NNN by So N. So' --fixes python:NNNN + bzr push bzr+ssh://trunk + rm -rf ../issueNNNN + +Alternatively, since you're probably going to commit these changes to +the trunk, you could just do a checkout.? That would give you a local +working tree while the branch (i.e. all revisions) would continue to +live on the server.? This is similar to the svn model and might allow +you to more quickly review the patch.? There's no need for the push +in this case.:: + + bzr checkout trunk issueNNNN + # Download `patch` bundle from Roundup + bzr merge patch + # Review patch + bzr commit -m'Patch NNNN by So N. So' --fixes python:NNNN + rm -rf ../issueNNNN + + +hg +'' +:: + + hg clone trunk issue0000 + cd issue0000 + # If the patch was generated using hg export, the user name of the + # submitter is automatically recorded. Otherwise, + # use hg import --no-commit submitted.diff and commit with + # hg commit -u "Firstname Lastname " + hg import submitted.diff + # Review patch. + hg push ssh://alexandre at code.python.org/hg/trunk/ + + +git +''' +We assume a patch created by git-format-patch. ?This is a Unix mbox +file containing one or more patches, each formatted as an RFC 2822 +message. ?git-am interprets each message as a commit as follows. ?The +author of the patch is taken from the From: header, the date from the +Date header. ?The commit log is created by concatenating the content +of the subject line, a blank line, and the message body up to the +start of the patch.:: + + cd trunk + # Create a branch in case we don't like the patch. + git checkout -b patch-review + # Download patch from bugs.python.org to submitted.patch. + git am ? submitted.patch + # Review and approve patch. + # Merge into master and push. + git checkout master + git merge patch-review + git push + + +Backport +-------- + +As a core developer, I want to apply a patch to 2.6, 2.7 and 3.0, so +that I can fix a problem in all three versions. + +Python always has at least the trunk and the last major release to +potentially backport patches to. Currently, though, the situation is +even more complicated than that as we also have to port forward +changes as well. This scenario assumes one needs to apply a patch to +2.6, 2.7, and 3.0, but not necessarily in that order (which is why +there is no list of required steps for this scenario). It is assumed +a developer has a checkout/clone of all three versions. There is also +a revision that needs to be prevented from ever being merged into +another branch. + + +svn +''' +:: + + # Assume patch applied to 2.7 in revision 0000. + cd release26-maint + svnmerge merge -r 0000 + # Resolve merge conflicts and make sure patch works. + svn commit -F svnmerge-commit-message.txt + cd ../py3k + svnmerge merge -r 0000 + # Same as for 2.6, except Misc/NEWS changes are reverted. + svn revert Misc/NEWS + svn commit -F svnmerge-commit-message.txt + # Block revision 0001 from being merged from 2.7 into 3.0. + svnmerge block -r 0001 + svn ci -F svnmerge-commit-message.txt + + +bzr +''' + +Bazaar is pretty straightforward here, since it supports cherry +picking revisions manually.? In the example below, we could have +given a revision id instead of a revision number, but that's usually +not necessary.? Martin Pool suggests "We'd generally recommend doing +the fix first in the oldest supported branch, and then merging it +forward to the later releases.":: + + # Assume patch applied to 2.7 in revision 0000 + cd release26-main + bzr merge ../trunk -c 0000 + # Resolve conflicts and make sure patch works + bzr commit -m'Backport patch NNNN' + bzr push bzr+ssh://trunk + cd ../py3k + bzr merge ../trunk -r 0000 + # Same as for 2.6 except Misc/NEWS changes are reverted + bzr revert Misc/NEWS + bzr commit -m'Forward port patch NNNN' + bzr push bzr+ssh://py3k + + +hg +'' + +Mercurial, like other DVCS, does not well support the current +workflow used by Python core developers to backport patches. Right +now, bug fixes are first applied to the development mainline +(i.e., trunk), then back-ported to the maintenance branches and +forward-ported, as necessary, to the py3k branch. This workflow +requires the ability to cherry-pick individual changes. Mercurial's +transplant extension provides this ability. Here is an example of +the scenario using this workflow:: + + cd release26-maint + # Assume patch applied to 2.7 in revision 0000 + hg transplant -s ../trunk 0000 + # Resolve conflicts, if any. + cd ../py3k + hg pull ../trunk + hg merge + hg revert Misc/NEWS + hg commit -m "Merged trunk" + hg push + +In the above example, transplant acts much like the current svnmerge +command. When transplant is invoked without the revision, the command +launches an interactive loop useful for transplanting multiple +changes. Another useful feature is the --filter option which can be +used to modify changesets programmatically (e.g., it could be used +for removing changes to Misc/NEWS automatically). + +Alternatively to the traditional workflow, we could avoid +transplanting changesets by committing bug fixes to the oldest +supported release, then merge these fixes upward to the more recent +branches. +:: + + cd release25-maint + hg import fix_some_bug.diff + # Review patch and run test suite. Revert if failure. + hg push + cd ../release26-maint + hg pull ../release25-maint + hg merge + # Resolve conflicts, if any. Then, review patch and run test suite. + hg commit -m "Merged patches from release25-maint." + hg push + cd ../trunk + hg pull ../release26-maint + hg merge + # Resolve conflicts, if any, then review. + hg commit -m "Merged patches from release26-maint." + hg push + +Although this approach makes the history non-linear and slightly +more difficult to follow, it encourages fixing bugs across all +supported releases. Furthermore, it scales better when there is many +changes to backport, because we do not need to seek the specific +revision IDs to merge. + + +git +''' + +In git I would have an "integration" workspace which contains all of +the relevant master repository branches. ?git cherry-pick doesn't +work across repositories; you need to have the branches in the same +repository. +:: + + # Assume patch applied to 2.7 in revision release27~3 (4th patch back from tip). + cd integration + git checkout release26 + # The "-x" option automatically notes which commit is being + # cherry-picked in the log. + git cherry-pick -x 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 + # 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 + +If you are regularly?merging?(rather than?cherry-picking) from a +given branch, then you can block a given commit from being +accidentally merged in the future by merging, then reverting it. +This does not prevent a cherry-pick from pulling in the unwanted +patch, and this technique requires blocking everything that you don't +want merged. ?I'm not sure if this differs from svn on this point. +:: + + cd trunk + # Merge in the alpha tested code. + git merge experimental-branch + # We don't want the 3rd-to-last commit from the experimental-branch, + # and we don't want it to ever be merged. + # The notation "^N" means Nth parent of the current commit. ?Thus HEAD^2^1^1 + # means the first parent of the first parent of the second parent of HEAD. + git revert HEAD^2^1^1 + # Propagate the merge and the prohibition to the public repository. + git push + + +Coordinated Development of a New Feature +---------------------------------------- + +Sometimes core developers end up working on a major feature with +several developers.??As a core developer, I want to be able to +publish feature branches to a common public location so that I can +collaborate with other developers. + +This requires creating a branch on a server that other developers +can access. ?All of the DVCSs support creating new repositories on +hosts where the developer is already able to commit, with +appropriate configuration of the repository?host. This is +similar in concept to the existing sandbox in svn, although details +of repository initialization may differ. + +For non-developers, there are various more-or-less public-access +repository-hosting services. +Bazaar has +Launchpad_, +Mercurial has +`bitbucket.org`_, +and git has +GitHub_. +All also have easy-to-use +CGI interfaces for developers who maintain their own servers. + + +.. _Launchpad: http://www.launchpad.net/ +.. _bitbucket.org: http://www.bitbucket.org/ +.. _GitHub: http://www.github.com/ + +* Branch trunk. +* Pull from branch on the server. +* Pull from trunk. +* Push merge to trunk. + + +svn +''' +:: + + # Create branch. + svn copy svn+ssh://pythondev at svn.python.org/python/trunk svn+ssh://pythondev at svn.python.org/python/branches/NewHotness + svn checkout svn+ssh://pythondev at svn.python.org/python/branches/NewHotness + cd NewHotness + svnmerge init + svn commit -m "Initialize svnmerge." + # Pull in changes from other developers. + svn update + # Pull in trunk and merge to the branch. + svnmerge merge + svn commit -F svnmerge-commit-message.txt + + +bzr +''' +:: + + XXX To be done by Brett as a test of knowledge and online documentation/community. + + +hg +'' +:: + + XXX To be done by Brett as a test of knowledge and online documentation/community. + + +git +''' +:: + + XXX To be done by Brett as a test of knowledge and online documentation/community. + + +Separation of Issue Dependencies +-------------------------------- + +Sometimes, while working on an issue, it becomes apparent that the +problem being worked on is actually a compound issue of various +smaller issues. Being able to take the current work and then begin +working on a separate issue is very helpful to separate out issues +into individual units of work instead of compounding them into a +single, large unit. + +* Create a branch A (e.g. urllib has a bug). +* Edit some code. +* Create a new branch B that branch A depends on (e.g. the urllib + bug exposes a socket bug). +* Edit some code in branch B. +* Commit branch B. +* Edit some code in branch A. +* Commit branch A. +* Clean up. + + +svn +''' + +To make up for svn's lack of cheap branching, it has a changelist +option to associate a file with a single changelist. This is not as +powerful as being able to associate at the commit level. There is +also no way to express dependencies between changelists. +:: + + cp -r trunk issue0000 + cd issue0000 + # Edit some code. + echo "The cake is a lie!" > README + svn changelist A README + # Edit some other code. + echo "I own Python!" . LICENSE + svn changelist B LICENSE + svn ci -m "Tell it how it is." --changelist B + # Edit changelist A some more. + svn ci -m "Speak the truth." --changelist A + cd .. + rm -rf issue0000 + + +bzr +''' +Here's an approach that uses bzr shelf (now a standard part of bzr) +to squirrel away some changes temporarily while you take a detour to +fix the socket bugs. +:: + + bzr branch bzr+svn://trunk bug-0000 + cd bug-0000 + # Edit some code.? Dang, we need to fix the socket module. + bzr shelve --all + # Edit some code. + bzr commit -m "Socket module fixes" + # Detour over, now resume fixing urllib + bzr unshelve + # Edit some code + +Another approach one might take uses the loom plugin.? Looms can +greatly simply 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 +thread, merge changes up the stack to descendant threads, create +diffs between threads, etc.? Occasionally, you may need or want to +export your loom threads into separate branches, either for review +or commit.? Higher threads incorporate all the changes in the lower +threads, automatically. +:: + + bzr branch bzr+svn://trunk bug-0000 + cd bug-0000 + bzr loomify trunk + bzr create-thread fix-urllib + # Edit some code.? Dang, we need to fix the socket module. + bzr commit -m "Checkpointing my work so far" + bzr down-thread + bzr create-thread fix-socket + # Edit some code + bzr commit -m "Socket module fixes" + bzr up-thread + # Manually resolve conflicts if necessary + bzr commit -m 'Merge in socket fixes' + # Edit me some more code + bzr commit -m "Now that socket is fixed, complete the urllib fixes" + bzr record done + +For bonus points, let's say someone else fixes the socket module in +exactly the same way you did.? Perhaps this person even grabbed your +fix-socket thread and applied just that to the trunk.? You'd like to +be able to merge their changes into your loom and delete your +now-redundant fix-socket thread. +:: + + bzr down-thread trunk + # Get all new revisions to the trunk.? If you've done things + # correctly, this must succeed without conflict. + bzr pull + bzr up-thread + # See?? The fix-socket thread is now identical to the trunk + bzr commit -m 'Merge in trunk changes' + bzr diff -r thread: | wc -l? # returns 0 + bzr combine-thread + bzr up-thread + # Resolve any conflicts + bzr commit -m 'Merge trunk' + # Now our top-thread has an up-to-date trunk and just the urllib fix. + + +hg +'' +:: + + hg clone trunk issue0000 + cd issue0000 + # Edit some code (e.g. urllib). + cd .. + hg clone trunk fix-socket-bug + cd fix-socket-bug + # Edit some other code (e.g. socket). + hg commit + cd ../issue0000 + hg fetch ../fix-socket-bug + # Edit some more code. + hg commit + cd ../trunk + hg fetch ../issue0000 + hg push + cd .. + rm -rf?issue0000?fix-socket-bug + + +git +''' +:: + + 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, 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. + 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. + 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." + 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 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. + + +Doing a Python Release +---------------------- + +How does PEP 101 change when using a DVCS? + + +bzr +''' + +It will change, but not substantially so.? When doing the +maintenance branch, we'll just push to the new location instead of +doing an svn cp.? Tags are totally different, since in svn they are +directory copies, but in bzr (and I'm guessing hg), they are just +symbolic names for revisions on a particular branch.? The release.py +script will have to change to use bzr commands instead.? It's +possible that because DVCS (in particular, bzr) does cherry picking +and merging well enough that we'll be able to create the maint +branches sooner.? It would be a useful exercise to try to do a +release off the bzr/hg mirrors. + + +hg +'' + +Clearly, details specific to Subversion in PEP 101 and in the +release script will need to be updated. In particular, release +tagging and maintenance branches creation process will have to be +modified to use Mercurial's features; this will simplify and +streamline certain aspects of the release process. For example, +tagging and re-tagging a release will become a trivial operation +since a tag, in Mercurial, is simply a symbolic name for a given +revision. + + +git +''' + +It will change, but not substantially so.? When doing the +maintenance branch, we'll just git push to the new location instead +of doing an svn cp.? Tags are totally different, since in svn they +are directory copies, but in git they are just symbolic names for +revisions, as are branches. ?(The difference between a tag and a +branch is that tags refer to a particular commit, and will never +change unless you use git tag -f to force them to move. ?The +checked-out branch, on the other hand, is automatically updated by +git commit.) ?The release.py script will have to change to use git +commands instead. ?With git I would create a (local) maintenance +branch as soon as the release engineer is chosen. ?Then I'd "git +pull" until I didn't like a patch, when it would be "git pull; git +revert ugly-patch", until it started to look like the sensible thing +is to fork off, and start doing "git cherry-pick" on the good +patches. + + +Platform/Tool Support +===================== + +Operating Systems +----------------- +==== ======================================= ============================================= ============================= +DVCS Windows OS X UNIX +---- --------------------------------------- --------------------------------------------- ----------------------------- +bzr yes (installer) w/ tortoise yes (installer, fink or MacPorts) yes (various package formats) +hg yes (third-party installer) w/ tortoise yes (third-party installer, fink or MacPorts) yes (various package formats) +git yes (third-party installer) yes (third-party installer, fink or MacPorts) yes (.deb or .rpm) +==== ======================================= ============================================= ============================= + +As the above table shows, all three DVCSs are available on all three +major OS platforms. But what it also shows is that Bazaar is the +only DVCS that directly supports Windows with a binary installer +while Mercurial and git require you to rely on a third-party for +binaries. Both bzr and hg have a tortoise version while git does not. + +Bazaar also has the benefit of being written in pure Python, making +a Python VM the bare minimum requirement to work. It does have Pyrex +extensions which are optional, but highly recommended for +performance reasons. Mercurial requires the compilation of an +extension module and git is pure C and thus also requires a compiler. + + +CRLF -> LF Support +------------------ + +bzr + My understanding is that support for this is being worked on as + I type, landing in a version RSN.? I will try to dig up details. + +hg + Supported via the win32text extension. + +git + I can't say from personal experience, but it looks like there's + pretty good support via the core.autocrlf and core.safecrlf + configuration attributes. + + +Case-insensitive filesystem support +----------------------------------- + +bzr + Should be OK.? I share branches between Linux and OS all the + time.? I've done case changes (e.g. bzr mv Mailman mailman) and + as long as I did it on Linux (obviously), when I pulled in the + changes on OS X everything was hunky dory. + +hg + Mercurial uses a case safe repository mechanism and detects case + folding collisions. + +git + Since OS X preserves case, you can do case changes there too. + git does not have a problem with renames in either direction. + However, case-insensitive filesystem support is usually taken + to mean complaining about collisions on case-sensitive files + systems. ?git does not do that. + + +Tools +----- + +In terms of code review tools such as `Review Board`_ and Rietveld_, +the former supports all three while the latter supports hg and git but +not bzr.? Bazaar does not yet have an online review board, but it +has several ways to manage email based reviews and trunk merging.? +There's?`Bundle Buggy`_, `Patch Queue Manager`_ (PQM), and +`Launchpad's code reviews `_. + +.. _Review Board: http://www.review-board.org/ +.. _Rietveld: http://code.google.com/p/rietveld/ + +.. _Bundle Buggy: http://code.aaronbentley.com/bundlebuggy/ +.. _Patch Queue Manager: http://bazaar-vcs.org/PatchQueueManager + +All three have some web site online that provides basic hosting +support for people who want to put a repository online. Bazaar has +Launchpad, Mercurial has bitbucket.org, and git has GitHub. Google +Code also has instructions on how to use git with the service, both +to hold a repository and how to act as a read-only mirror. + +All three also `appear to be supported +`_ +by Buildbot_. + +.. _Buildbot: http://buildbot.net + + +Usage On Top Of Subversion +========================== + +==== ============ +DVCS svn support +---- ------------ +bzr bzr-svn_ (third-party) +hg `multiple third-parties `__ +git git-svn_ +==== ============ + +.. _bzr-svn: http://bazaar-vcs.org/BzrForeignBranches/Subversion +.. _git-svn: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html + +All three DVCSs have svn support, although git is the only one to +come with that support out-of-the-box. + + +Server Support +============== + +==== ================== +DVCS Web page interface +---- ------------------ +bzr loggerhead_ +hg hgweb_ +git gitweb_ +==== ================== + +.. _loggerhead: https://launchpad.net/loggerhead +.. _hgweb: http://www.selenic.com/mercurial/wiki/index.cgi/HgWebDirStepByStep +.. _gitweb: http://git.or.cz/gitwiki/Gitweb + +All three DVCSs support various hooks on the client and server side +for e.g. pre/post-commit verifications. + + +Development +=========== + +All three projects are under active development to some degree. Both +Git and Bazaar seem to release on a monthly schedule. Mercurial, on +the other hand, seems to release roughly once a quarter. + +For the two Python-based DVCSs, the amount of time until a release +that is compatible with Python 2.6 can also be a sign of how active +the development is. Bazaar was compatible with 2.6 as of version 1.8 +which was released two weeks after 2.6 came out. Mercurial, on the +other hand, took two months to be compatible with its 1.1 release. + + +Special Features +================ + +bzr +--- + +Martin Pool adds: "bzr has a stable Python scripting interface, with +a distinction between public and private interfaces and a +deprecation window for APIs that are changing.? Some plugins are +listed in https://edge.launchpad.net/bazaar and +http://bazaar-vcs.org/Documentation". + + +hg +-- + +N/A + + +git +--- + +git has a cvsserver mode, ie, you can check out a tree from git +using CVS. ?You can even commit to the tree, but features like +merging are absent, and branches are handled as CVS modules, which +is likely to shock a veteran CVS user. + + +Impressions +=========== +As I (Brett Cannon) am left with the task of of making the final +decision of which/any DVCS to go with and not my co-authors, I felt +it only fair to write down my impressions as I evaluate the various +tools so as to be as transparent as possible. + +To begin, I measured the checking out of code as if I was a non-core +developer. This is important as this is the first impression +developers have when they decide they wish to contribute a patch to +Python. 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 2:29:24 or 8:46 275 M or 596 M +hg 2:30 171 M +git 2:54 134 M +======= ================ ============== + +The svn measurements are not exactly a 1:1 comparison to the DVCSs. +For one, svn does not download the entire revision history, and thus +(should) have the least amount to download. And two, because various +calculation steps are left up to the server the entire process of +checking out code (should) be faster. + +But the svn measurements should be considered as what developers are +used to. Thus they act as a reference point for what people tend to +expect in terms of performance. + +Looking at bzr, I have listed two numbers. The first values are for +running ``bzr branch`` as outlined in the `One-Off Checkout`_ +scenario. When the +timings came back in hours (I used Launchpad as code.python.org is +not running the newest version of bzr and I wanted to use its latest +networking protocol), I decided to try using the steps outlined when +the experimental bzr branches were first created. That second +approach is what the second set of values for bzr represent. + +While both the hg and git numbers are perfectly acceptable, the bzr +numbers not necessarily. The raw ``bzr branch`` approach is entirely +not acceptable as no one wants to wait over two hours to write a +potentially one line change to some code for the benefit of Python. +Assuming 8:46 is a reasonable amount of time (I believe it in +general is, but it is teetering on not), the 596 M space requirement +could be an issue for some. While we typically view disk space as +cheap, for some people it might be an issue (e.g. the person who did +the schedule for PyCon 2008 did it over a connection so badly that +Google Spreadsheets didn't work for him and he had to submit the +schedule in another form than the one original used). Once again I +think the space usage is acceptable, but it is close to being too +much. + +To see if bzr's performance would be acceptable once at least the +branch was downloaded, I decided to see how long it would take to +get the change log for a file. I chose the README file as it sees +regular changes for every release and has a revision history going +back to 1993 and thus would have a fair number of revisions. +It should be mentioned that while git had the nicest output thanks to +its color terminal output, it also took a while to find the +``--no-pager`` flag in order to get just a stream of text instead of +having the output sent to the pager. + +Overall the numbers were all acceptable: + +* bzr: 4.5 seconds +* hg: 1.1 seconds +* git: 1.5 seconds + +While having bzr be over 3x slower than its nearest neighbor, it +must be kept in mind that the total performance time is still +acceptable, regardless of the multiplier. + +Because a DVCS keeps its revision history on disk, it also means +that typically they can be zipped up for direct downloading. At +least in bzr's case that would solve the performance issue for +initial checkout if the zip file could be generate constantly. But +that didn't address the cost of pulling in new revisions when a +checkout has gone stale. To measure this I decided I would check out +the repositories back about 700 revisions which represented the +amount of change made since the beginning of the month and time how +long they took to update. + +For this to happen I first had to remember the URLs for the +repositories. Instead of simply looking in this PEP, though, I +decided to try to figure it out from the command-line help for each +tool or simply guessing. Bzr worked out great with ``bzr info``. Git +took a little poking around, but I figured out ``git remote show +origin`` told me what I needed. For hg, though, I couldn't figure it +out short of running ``hg pull`` and denoting the status information +during the pull (turns out ``hg paths`` is what I was looking for). + +With the repository locations known I then had to perform a checkout +to a certain revision. Turns out that git will not clone a +repository to only a specific revision, although from personal +experience git's pull facility is very fast. Bzr was able to perform +its update in just over 39 seconds. Hg did its update in just over +17 seconds. Much like the log test, while the multiplier of slowness +seems high, in real life terms al DVCSs performed within reason. + +In my mind this means that bzr is only an acceptable candidate as +long as an fairly up-to-date archive of Python's key branches are +made available for people to download to avoid bzr's very so remote +branching. + +XXX ... to be continued + + +Chosen DVCS +=========== + +XXX + + +Transition Plan +=============== + +XXX From nnorwitz at gmail.com Fri Jan 23 06:26:14 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 22 Jan 2009 21:26:14 -0800 Subject: [Python-checkins] r68868 - python/branches/py3k/Modules/_pickle.c In-Reply-To: <20090123044346.DB7171E400C@bag.python.org> References: <20090123044346.DB7171E400C@bag.python.org> Message-ID: On Thu, Jan 22, 2009 at 8:43 PM, alexandre. vassalotti wrote: > Author: alexandre.vassalotti > Date: Fri Jan 23 05:43:46 2009 > New Revision: 68868 > > Log: > Remove unnecessary copying in load_long(). > > > Modified: > python/branches/py3k/Modules/_pickle.c > > Modified: python/branches/py3k/Modules/_pickle.c > ============================================================================== > --- python/branches/py3k/Modules/_pickle.c (original) > +++ python/branches/py3k/Modules/_pickle.c Fri Jan 23 05:43:46 2009 > @@ -2881,7 +2881,7 @@ > load_long(UnpicklerObject *self) > { > PyObject *value; > - char *s, *ss; > + char *s; > Py_ssize_t len; > > if ((len = unpickler_readline(self, &s)) < 0) > @@ -2894,17 +2894,9 @@ > compatibility with Python 3.0.0, we don't actually *require* > the 'L' to be present. */ > if (s[len-2] == 'L') { > - ss = (char *)PyMem_Malloc(len-1); > - if (ss == NULL) { > - PyErr_NoMemory(); > - return -1; > - } > - strncpy(ss, s, len-2); > - ss[len-2] = '\0'; > - > + s[len-2] = '\0'; > /* XXX: Should the base argument explicitly set to 10? */ > - value = PyLong_FromString(ss, NULL, 0); > - PyMem_Free(ss); > + value = PyLong_FromString(s, NULL, 0); > } > else { > value = PyLong_FromString(s, NULL, 0); Why not simplify further and bottom factor out the common line: value = PyLong_FromString(s, NULL, 0); n From buildbot at python.org Fri Jan 23 06:26:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 05:26:24 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090123052624.DF73E1E4018@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/168 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: alexandre.vassalotti BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Jan 23 06:28:16 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Fri, 23 Jan 2009 06:28:16 +0100 (CET) Subject: [Python-checkins] r68872 - python/branches/py3k/Doc/library/pickle.rst Message-ID: <20090123052816.8A66C1E4002@bag.python.org> Author: alexandre.vassalotti Date: Fri Jan 23 06:28:16 2009 New Revision: 68872 Log: Clean up pickle usage examples. Modified: python/branches/py3k/Doc/library/pickle.rst Modified: python/branches/py3k/Doc/library/pickle.rst ============================================================================== --- python/branches/py3k/Doc/library/pickle.rst (original) +++ python/branches/py3k/Doc/library/pickle.rst Fri Jan 23 06:28:16 2009 @@ -560,10 +560,8 @@ Here is a comprehensive example presenting how persistent ID can be used to pickle external objects by reference. -.. XXX Work around for some bug in sphinx/pygments. -.. highlightlang:: python .. literalinclude:: ../includes/dbpickle.py -.. highlightlang:: python3 + .. _pickle-state: @@ -715,46 +713,35 @@ .. _pickle-example: -Example -------- +Usage Examples +-------------- For the simplest code, use the :func:`dump` and :func:`load` functions. Note that a self-referencing list is pickled and restored correctly. :: import pickle - data1 = {'a': [1, 2.0, 3, 4+6j], - 'b': ("string", "string using Unicode features \u0394"), - 'c': None} - - selfref_list = [1, 2, 3] - selfref_list.append(selfref_list) - - output = open('data.pkl', 'wb') - - # Pickle dictionary using protocol 2. - pickle.dump(data1, output, 2) - - # Pickle the list using the highest protocol available. - pickle.dump(selfref_list, output, -1) - - output.close() + # An arbitrary collection of objects supported by pickle. + data = { + 'a': [1, 2.0, 3, 4+6j], + 'b': ("character string", b"byte string"), + 'c': set([None, True, False]) + } -The following example reads the resulting pickled data. When reading a -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. :: + with open('data.pickle', 'wb') as f: + # Pickle the 'data' dictionary using the highest protocol available. + pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) - import pprint, pickle - pkl_file = open('data.pkl', 'rb') +The following example reads the resulting pickled data. :: - data1 = pickle.load(pkl_file) - pprint.pprint(data1) + import pickle - data2 = pickle.load(pkl_file) - pprint.pprint(data2) + with open('data.pickle', 'rb') as f: + # The protocol version used is detected automatically, so we do not + # have to specify it. + data = pickle.load(f) - pkl_file.close() .. seealso:: From buildbot at python.org Fri Jan 23 06:29:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 05:29:43 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090123052943.605AF1E4002@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/182 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: alexandre.vassalotti BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Jan 23 08:23:03 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 23 Jan 2009 08:23:03 +0100 (CET) Subject: [Python-checkins] r68873 - in python/branches/py3k: Python/import.c Message-ID: <20090123072303.3FF1C1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 23 08:23:03 2009 New Revision: 68873 Log: Merged revisions 68457 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68457 | kristjan.jonsson | 2009-01-10 05:10:59 +0900 | 1 line Issue 3677: Fix import from UNC paths on Windows. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Python/import.c Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Fri Jan 23 08:23:03 2009 @@ -3233,24 +3233,11 @@ PyErr_SetString(PyExc_ImportError, "empty pathname"); return -1; } else { +#ifndef MS_WINDOWS struct stat statbuf; int rv; rv = stat(path, &statbuf); -#ifdef MS_WINDOWS - /* MS Windows stat() chokes on paths like C:\path\. Try to - * recover *one* time by stripping off a trailing slash or - * backslash. http://bugs.python.org/issue1293 - */ - if (rv != 0 && pathlen <= MAXPATHLEN && - (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { - char mangled[MAXPATHLEN+1]; - - strcpy(mangled, path); - mangled[pathlen-1] = '\0'; - rv = stat(mangled, &statbuf); - } -#endif PyMem_Free(path); if (rv == 0) { /* it exists */ @@ -3261,6 +3248,23 @@ return -1; } } +#else /* MS_WINDOWS */ + DWORD rv; + /* see issue1293 and issue3677: + * stat() on Windows doesn't recognise paths like + * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. + */ + rv = GetFileAttributesA(path); + if (rv != INVALID_FILE_ATTRIBUTES) { + /* it exists */ + if (rv & FILE_ATTRIBUTE_DIRECTORY) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif } return 0; } From buildbot at python.org Fri Jan 23 09:13:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 08:13:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090123081307.DC8FF1E4002@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/160 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: alexandre.vassalotti,hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Fri Jan 23 09:54:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 08:54:25 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 3.x Message-ID: <20090123085425.DD2D21E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%203.x/builds/49 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi 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 Fri Jan 23 15:04:41 2009 From: python-checkins at python.org (jesse.noller) Date: Fri, 23 Jan 2009 15:04:41 +0100 (CET) Subject: [Python-checkins] r68874 - in python/trunk: Misc/NEWS setup.py Message-ID: <20090123140441.982F41E4002@bag.python.org> Author: jesse.noller Date: Fri Jan 23 15:04:41 2009 New Revision: 68874 Log: Issue 3807: multiprocessing fails to compile under --without-threads Modified: python/trunk/Misc/NEWS python/trunk/setup.py Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jan 23 15:04:41 2009 @@ -145,6 +145,10 @@ Library ------- +- Issue #3807: _multiprocessing build fails when configure is passed + --without-threads argument. When this occurs, _multiprocessing will + be disabled, and not compiled. + - Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Fri Jan 23 15:04:41 2009 @@ -1315,9 +1315,13 @@ if macros.get('HAVE_SEM_OPEN', False): multiprocessing_srcs.append('_multiprocessing/semaphore.c') - exts.append ( Extension('_multiprocessing', multiprocessing_srcs, - define_macros=macros.items(), - include_dirs=["Modules/_multiprocessing"])) + if sysconfig.get_config_var('WITH_THREAD'): + exts.append ( Extension('_multiprocessing', multiprocessing_srcs, + define_macros=macros.items(), + include_dirs=["Modules/_multiprocessing"])) + else: + missing.append('_multiprocessing') + # End multiprocessing From python-checkins at python.org Fri Jan 23 15:09:11 2009 From: python-checkins at python.org (jesse.noller) Date: Fri, 23 Jan 2009 15:09:11 +0100 (CET) Subject: [Python-checkins] r68875 - in python/branches/py3k: Misc/NEWS setup.py Message-ID: <20090123140911.C37201E4002@bag.python.org> Author: jesse.noller Date: Fri Jan 23 15:09:08 2009 New Revision: 68875 Log: merge 68874 to py3kwq! Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/setup.py Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 23 15:09:08 2009 @@ -139,6 +139,10 @@ Library ------- +- Issue #3807: _multiprocessing build fails when configure is passed + --without-threads argument. When this occurs, _multiprocessing will + be disabled, and not compiled. + - Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Fri Jan 23 15:09:08 2009 @@ -1063,9 +1063,12 @@ if macros.get('HAVE_SEM_OPEN', False): multiprocessing_srcs.append('_multiprocessing/semaphore.c') - exts.append ( Extension('_multiprocessing', multiprocessing_srcs, - define_macros=list(macros.items()), - include_dirs=["Modules/_multiprocessing"])) + if sysconfig.get_config_var('WITH_THREAD'): + exts.append ( Extension('_multiprocessing', multiprocessing_srcs, + define_macros=list(macros.items()), + include_dirs=["Modules/_multiprocessing"])) + else: + missing.append('_multiprocessing') # End multiprocessing # Platform-specific libraries From buildbot at python.org Fri Jan 23 15:34:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 14:34:57 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090123143532.01FE81E4002@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/536 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,jesse.noller 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 Jan 23 16:53:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 23 Jan 2009 15:53:21 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090123155345.BCABD1E404A@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/151 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: jesse.noller 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 Sat Jan 24 00:01:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 24 Jan 2009 00:01:25 +0100 (CET) Subject: [Python-checkins] r68876 - python/branches/io-c/Modules/_textio.c Message-ID: <20090123230125.8F8B61E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 24 00:01:25 2009 New Revision: 68876 Log: Two typos 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 Sat Jan 24 00:01:25 2009 @@ -50,7 +50,7 @@ static PyObject * TextIOBase_readline(PyObject *self, PyObject *args) { - return _unsupported("read"); + return _unsupported("readline"); } PyDoc_STRVAR(TextIOBase_write_doc, @@ -62,7 +62,7 @@ static PyObject * TextIOBase_write(PyObject *self, PyObject *args) { - return _unsupported("read"); + return _unsupported("write"); } PyDoc_STRVAR(TextIOBase_encoding_doc, From python-checkins at python.org Sat Jan 24 01:13:20 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 24 Jan 2009 01:13:20 +0100 (CET) Subject: [Python-checkins] r68877 - python/branches/io-c/Modules/_textio.c Message-ID: <20090124001320.4E2421E4002@bag.python.org> Author: antoine.pitrou Date: Sat Jan 24 01:13:20 2009 New Revision: 68877 Log: Remove two unused functions 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 Sat Jan 24 01:13:20 2009 @@ -1172,28 +1172,6 @@ return chars; } -/* Rewind the _decoded_chars buffer. */ -static int -TextIOWrapper_rewind_decoded_chars(PyTextIOWrapperObject *self, Py_ssize_t n) -{ - if (self->decoded_chars_used < n) { - PyErr_SetString(PyExc_ValueError, - "rewind decoded_chars out of bounds"); - return -1; - } - self->decoded_chars_used -= n; - return self->decoded_chars_used; -} - -static Py_ssize_t -TextIOWrapper_decoded_chars_length(PyTextIOWrapperObject *self, Py_ssize_t n) -{ - if (self->decoded_chars == NULL) - return 0; - return PyUnicode_GetSize(self->decoded_chars) - self->decoded_chars_used; -} - - /* Read and decode the next chunk of data from the BufferedReader. */ static int From python-checkins at python.org Sat Jan 24 02:47:57 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Sat, 24 Jan 2009 02:47:57 +0100 (CET) Subject: [Python-checkins] r68878 - python/branches/py3k/Modules/_pickle.c Message-ID: <20090124014757.3D45A1E4002@bag.python.org> Author: alexandre.vassalotti Date: Sat Jan 24 02:47:57 2009 New Revision: 68878 Log: Factor common branch in load_long(). Suggested by Neal Norwitz. Modified: python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Sat Jan 24 02:47:57 2009 @@ -2895,12 +2895,9 @@ the 'L' to be present. */ if (s[len-2] == 'L') { s[len-2] = '\0'; - /* XXX: Should the base argument explicitly set to 10? */ - value = PyLong_FromString(s, NULL, 0); - } - else { - value = PyLong_FromString(s, NULL, 0); } + /* XXX: Should the base argument explicitly set to 10? */ + value = PyLong_FromString(s, NULL, 0); if (value == NULL) return -1; From buildbot at python.org Sat Jan 24 03:11:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 02:11:49 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090124021149.391801E4002@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/85 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: alexandre.vassalotti 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 Sat Jan 24 03:14:29 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Sat, 24 Jan 2009 03:14:29 +0100 (CET) Subject: [Python-checkins] r68879 - peps/trunk/pep-0374.txt Message-ID: <20090124021429.71AA81E4002@bag.python.org> Author: alexandre.vassalotti Date: Sat Jan 24 03:14:29 2009 New Revision: 68879 Log: Remove French quotation marks used as redirect operator. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 03:14:29 2009 @@ -426,15 +426,15 @@ # Edit some code. echo "The cake is a lie!" > README # Since svn lacks support for local commits, we fake it with patches. - svn diff ? commit-1.diff - svn diff ? patch-1.diff + svn diff >> commit-1.diff + svn diff >> patch-1.diff # Upload the patch-1 to bugs.python.org. # Receive reviewer comments. # Edit some code. echo "The cake is real!" > README # Since svn lacks support for local commits, we fake it with patches. - svn diff ? commit-2.diff - svn diff ? patch-2.diff + svn diff >> commit-2.diff + svn diff >> patch-2.diff # Upload patch-2 to bugs.python.org @@ -465,12 +465,12 @@ 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 export tip >> stuff-i-did.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 export tip >> additional-fixes.patch # Upload patch to bugs.python.org From buildbot at python.org Sat Jan 24 03:38:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 02:38:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090124023824.379EB1E4024@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/162 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: alexandre.vassalotti BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 python-checkins at python.org Sat Jan 24 04:08:24 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Sat, 24 Jan 2009 04:08:24 +0100 (CET) Subject: [Python-checkins] r68880 - peps/trunk/pep-0374.txt Message-ID: <20090124030824.453C71E4002@bag.python.org> Author: alexandre.vassalotti Date: Sat Jan 24 04:08:24 2009 New Revision: 68880 Log: Address some of the comments made by Alexander Solovyov. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 04:08:24 2009 @@ -547,6 +547,8 @@ hg commit -m "Reverted changeset 9150dd9c6d30" hg push +Note, you can use "hg rollback" to revert the last change you committed in +your local repository. git ''' @@ -784,7 +786,7 @@ supported releases. Furthermore, it scales better when there is many changes to backport, because we do not need to seek the specific revision IDs to merge. - + git ''' @@ -1038,11 +1040,13 @@ # Edit some other code (e.g. socket). hg commit cd ../issue0000 - hg fetch ../fix-socket-bug + hg pull ../fix-socket-bug + hg merge # Edit some more code. hg commit cd ../trunk - hg fetch ../issue0000 + hg pull ../issue0000 + hg merge hg push cd .. rm -rf?issue0000?fix-socket-bug @@ -1315,7 +1319,12 @@ hg -- -N/A +Alexander Solovyov comments: + + Mercurial has easy to use extensive API with hooks for main events + and ability to extend commands. Also there is mq (mercurial queues) + extension, distributed with Mercurial, which simplifies work with + patches. git From buildbot at python.org Sat Jan 24 04:09:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 03:09:15 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090124030915.E91DC1E4002@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/169 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: alexandre.vassalotti BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 04:28:18 2009 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 24 Jan 2009 04:28:18 +0100 (CET) Subject: [Python-checkins] r68881 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090124032818.8AC3A1E4002@bag.python.org> Author: andrew.kuchling Date: Sat Jan 24 04:28:18 2009 New Revision: 68881 Log: Add various items Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sat Jan 24 04:28:18 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`.) + .. ====================================================================== @@ -114,6 +123,52 @@ 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`.) @@ -153,7 +208,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`.) + .. ====================================================================== @@ -165,7 +226,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`.) .. ====================================================================== From nnorwitz at gmail.com Sat Jan 24 07:23:40 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 24 Jan 2009 01:23:40 -0500 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20090124062340.GA27411@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-2.6.1-docs-html tar -C dist -cf dist/python-2.6.1-docs-html.tar python-2.6.1-docs-html bzip2 -9 -k dist/python-2.6.1-docs-html.tar (cd dist; zip -q -r -9 python-2.6.1-docs-html.zip python-2.6.1-docs-html) rm -r dist/python-2.6.1-docs-html rm dist/python-2.6.1-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.6 (hg), building text loading pickled environment... done building [text]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-2.6.1-docs-text tar -C dist -cf dist/python-2.6.1-docs-text.tar python-2.6.1-docs-text bzip2 -9 -k dist/python-2.6.1-docs-text.tar (cd dist; zip -q -r -9 python-2.6.1-docs-text.zip python-2.6.1-docs-text) rm -r dist/python-2.6.1-docs-text rm dist/python-2.6.1-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.6 (hg), building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: refcounting#Py_INCREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: int#PyInt_FromLong WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: refcounting#Py_INCREF WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: list#PyList_New WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: exceptions#PyErr_SetString WARNING: unusable reference target found: exceptions#PyErr_Clear WARNING: unusable reference target found: exceptions#PyErr_ExceptionMatches WARNING: unusable reference target found: exceptions#PyErr_Clear WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_GetPath WARNING: unusable reference target found: init#Py_GetPrefix WARNING: unusable reference target found: init#Py_GetExecPrefix WARNING: unusable reference target found: init#Py_GetProgramFullPath WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_IsInitialized WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: veryhigh#Py_eval_input WARNING: unusable reference target found: veryhigh#Py_file_input WARNING: unusable reference target found: veryhigh#Py_single_input WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveLoop WARNING: unusable reference target found: veryhigh#PyRun_SimpleFile WARNING: unusable reference target found: veryhigh#PyRun_SimpleStringFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleStringFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveOneFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveLoopFlags WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseFileFlags WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyRun_StringFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_StringFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#Py_CompileStringFlags WARNING: unusable reference target found: veryhigh#Py_eval_input WARNING: unusable reference target found: veryhigh#Py_file_input WARNING: unusable reference target found: veryhigh#Py_single_input WARNING: unusable reference target found: veryhigh#PyEval_EvalCodeEx WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: refcounting#Py_XINCREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XINCREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: exceptions#PyErr_Restore WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: exceptions#PyErr_ExceptionMatches WARNING: unusable reference target found: exceptions#PyErr_Fetch WARNING: unusable reference target found: exceptions#PyErr_Fetch WARNING: unusable reference target found: exceptions#PyErr_SetString WARNING: unusable reference target found: exceptions#PyErr_CheckSignals WARNING: unusable reference target found: exceptions#PyErr_SetFromErrno WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErr WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErr WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErrWithFilename WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: exceptions#PyErr_Warn WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: exceptions#PyErr_CheckSignals WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: sys#Py_AtExit WARNING: unusable reference target found: import#PyImport_ImportModuleEx WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ImportModuleNoBlock WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ImportModuleLevel WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ExecCodeModule WARNING: unusable reference target found: import#PyImport_ReloadModule WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ExtendInittab WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: import#PyImport_ExtendInittab WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: marshal#PyMarshal_ReadObjectFromFile WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: structures#METH_OLDARGS WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_UnpackTuple WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: conversion#PyOS_snprintf WARNING: unusable reference target found: conversion#PyOS_vsnprintf WARNING: unusable reference target found: conversion#PyOS_ascii_strtod WARNING: unusable reference target found: reflection#PyEval_GetFuncName WARNING: unusable reference target found: list#PyList_New WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_IsInstance WARNING: unusable reference target found: object#PyObject_IsSubclass WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: object#PyObject_CallFunctionObjArgs WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: object#PyObject_CallMethodObjArgs WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: number#PyNumber_Coerce WARNING: unusable reference target found: number#PyNumber_Index WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: sequence#PySequence_Fast_GET_ITEM WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: sequence#PySequence_Fast_GET_SIZE WARNING: unusable reference target found: dict#PyDict_Check WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLong_AsVoidPtr WARNING: unusable reference target found: long#PyLong_FromVoidPtr WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: bytearray#PyByteArray_Size WARNING: unusable reference target found: bytearray#PyByteArray_AsString WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: string#PyString_FromFormat WARNING: unusable reference target found: string#PyString_Size WARNING: unusable reference target found: string#PyString_AsString WARNING: unusable reference target found: string#PyString_AsString WARNING: unusable reference target found: string#PyString_AsStringAndSize WARNING: unusable reference target found: string#PyString_FromString WARNING: unusable reference target found: string#PyString_InternInPlace WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF8 WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF32 WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF32Stateful WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF16 WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF16Stateful WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeMBCS WARNING: unusable reference target found: unicode#PyUnicode_DecodeMBCSStateful WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: typeobj#buffer-structs WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: buffer#PyBuffer_FromObject WARNING: unusable reference target found: buffer#PyBuffer_FromReadWriteObject WARNING: unusable reference target found: buffer#PyBufferObject WARNING: unusable reference target found: buffer#PyBuffer_Type WARNING: unusable reference target found: buffer#Py_END_OF_BUFFER WARNING: unusable reference target found: buffer#PyBuffer_FromObject WARNING: unusable reference target found: buffer#Py_END_OF_BUFFER WARNING: unusable reference target found: buffer#PyBuffer_FromMemory WARNING: unusable reference target found: objbuffer#PyObject_AsWriteBuffer WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: tuple#PyTuple_GetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: list#PyList_Size WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: dict#PyDict_GetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: mapping#PyMapping_Keys WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: type#typeobjects WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: function#PyFunction_Type WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: method#PyMethod_Type WARNING: unusable reference target found: method#PyMethod_Class WARNING: unusable reference target found: method#PyMethod_Function WARNING: unusable reference target found: method#PyMethod_Self WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFile_IncUseCount WARNING: unusable reference target found: file#PyFile_DecUseCount WARNING: unusable reference target found: file#PyFile_DecUseCount WARNING: unusable reference target found: file#PyFile_AsFile WARNING: unusable reference target found: file#PyFile_IncUseCount WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: module#PyModule_Type WARNING: unusable reference target found: iterator#PySeqIter_New WARNING: unusable reference target found: iterator#PySeqIter_Type WARNING: unusable reference target found: iterator#PyCallIter_New WARNING: unusable reference target found: iterator#PyCallIter_Type WARNING: unusable reference target found: slice#PySlice_GetIndicesEx WARNING: unusable reference target found: slice#PySlice_GetIndices WARNING: unusable reference target found: weakref#PyWeakref_GetObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: gen#PyGen_New WARNING: unusable reference target found: object#PyObject_CallMethod WARNING: unusable reference target found: object#PyObject_RichCompareBool WARNING: unusable reference target found: object#PyObject_Hash WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: object#PyObject_IsTrue WARNING: unusable reference target found: object#PyObject_Print WARNING: unusable reference target found: object#PyObject_GetIter WARNING: unusable reference target found: number#PyNumber_And WARNING: unusable reference target found: number#PyNumber_Subtract WARNING: unusable reference target found: number#PyNumber_Or WARNING: unusable reference target found: number#PyNumber_Xor WARNING: unusable reference target found: number#PyNumber_InPlaceAnd WARNING: unusable reference target found: number#PyNumber_InPlaceSubtract WARNING: unusable reference target found: number#PyNumber_InPlaceOr WARNING: unusable reference target found: number#PyNumber_InPlaceXor WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: dict#PyDictObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: set#PySet_Add WARNING: unusable reference target found: set#PySet_Size WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_AcquireLock WARNING: unusable reference target found: init#PySys_SetArgv WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_NewInterpreter WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_GetPath WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: sys#Py_FatalError WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#PyEval_SaveThread WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_AcquireLock WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_NewInterpreter WARNING: unusable reference target found: init#PyInterpreterState WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_SaveThread WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: sys#PyOS_AfterFork WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#PyInterpreterState_Clear WARNING: unusable reference target found: init#PyThreadState_Clear WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyEval_SetProfile WARNING: unusable reference target found: init#PyEval_SetTrace WARNING: unusable reference target found: init#PyTrace_CALL WARNING: unusable reference target found: init#PyTrace_EXCEPTION WARNING: unusable reference target found: init#PyTrace_LINE WARNING: unusable reference target found: init#PyTrace_RETURN WARNING: unusable reference target found: init#PyTrace_C_CALL WARNING: unusable reference target found: init#PyTrace_C_EXCEPTION WARNING: unusable reference target found: init#PyTrace_C_RETURN WARNING: unusable reference target found: init#PyTrace_CALL WARNING: unusable reference target found: init#PyTrace_EXCEPTION WARNING: unusable reference target found: init#PyTrace_LINE WARNING: unusable reference target found: init#PyTrace_RETURN WARNING: unusable reference target found: init#PyTrace_C_CALL WARNING: unusable reference target found: init#PyTrace_C_EXCEPTION WARNING: unusable reference target found: init#PyTrace_C_RETURN WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#PyEval_SetProfile WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#PyInterpreterState WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: memory#memoryoverview WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: allocation#PyObject_Del WARNING: unusable reference target found: allocation#PyObject_Init WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: allocation#Py_InitModule3 WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: structures#METH_KEYWORDS WARNING: unusable reference target found: structures#METH_KEYWORDS WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: allocation#Py_InitModule4 WARNING: unusable reference target found: allocation#Py_InitModule WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_UnpackTuple WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: structures#METH_NOARGS WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#METH_O WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: type#PyType_Type WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_name WARNING: unusable reference target found: typeobj#tp_name WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyObject_VAR_HEAD WARNING: unusable reference target found: typeobj#_ob_prev WARNING: unusable reference target found: typeobj#_ob_next WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: typeobj#Py_TPFLAGS_BASETYPE WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: allocation#PyObject_Del WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: object#PyObject_Print WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: object#PyObject_GetAttrString WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: object#PyObject_SetAttrString WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: object#PyObject_Compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: typeobj#number-structs WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#sequence-structs WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#mapping-structs WARNING: unusable reference target found: typeobj#tp_as_mapping WARNING: unusable reference target found: object#PyObject_Hash WARNING: unusable reference target found: object#PyObject_HashNotImplemented WARNING: unusable reference target found: object#PyObject_HashNotImplemented WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: object#PyObject_Call WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: object#PyObject_GetAttr WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: object#PyObject_SetAttr WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#buffer-structs WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#tp_as_mapping WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: type#PyType_HasFeature WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#sq_contains WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#sq_inplace_concat WARNING: unusable reference target found: typeobj#sq_inplace_repeat WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_iter WARNING: unusable reference target found: typeobj#tp_iternext WARNING: unusable reference target found: typeobj#tp_methods WARNING: unusable reference target found: typeobj#tp_members WARNING: unusable reference target found: typeobj#tp_getset WARNING: unusable reference target found: typeobj#tp_base WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_descr_get WARNING: unusable reference target found: typeobj#tp_descr_set WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_alloc WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: typeobj#tp_is_gc WARNING: unusable reference target found: typeobj#tp_bases WARNING: unusable reference target found: typeobj#tp_mro WARNING: unusable reference target found: typeobj#tp_cache WARNING: unusable reference target found: typeobj#tp_subclasses WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GETCHARBUFFER WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_SEQUENCE_IN WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_INPLACEOPS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_WEAKREFS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_ITER WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: refcounting#Py_CLEAR WARNING: unusable reference target found: refcounting#Py_CLEAR WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: object#PyObject_RichCompare WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_WEAKREFS WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_ITER WARNING: unusable reference target found: object#PyObject_GetIter WARNING: unusable reference target found: typeobj#tp_iter WARNING: unusable reference target found: iter#PyIter_Next WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: structures#PyMethodDef WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: structures#PyMemberDef WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#ob_refcnt WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: type#PyType_GenericAlloc WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_base WARNING: unusable reference target found: type#PyType_GenericAlloc WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: type#PyType_Type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_allocs WARNING: unusable reference target found: number#number WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: typeobj#nb_coerce WARNING: unusable reference target found: number#PyNumber_CoerceEx WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: mapping#PyMapping_Length WARNING: unusable reference target found: object#PyObject_Size WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: mapping#PyMapping_Check WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: object#PyObject_Size WARNING: unusable reference target found: sequence#PySequence_Concat WARNING: unusable reference target found: sequence#PySequence_Repeat WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: sequence#PySequence_Check WARNING: unusable reference target found: typeobj#sq_length WARNING: unusable reference target found: typeobj#sq_item WARNING: unusable reference target found: typeobj#sq_length WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: sequence#PySequence_Contains WARNING: unusable reference target found: sequence#PySequence_Contains WARNING: unusable reference target found: sequence#PySequence_InPlaceConcat WARNING: unusable reference target found: sequence#PySequence_InPlaceRepeat WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: typeobj#Py_TPFLAGS_DEFAULT WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: string#PyString_Type WARNING: unusable reference target found: buffer#PyBuffer_Type WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GETCHARBUFFER WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyType_HasFeature WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: gcsupport#PyObject_GC_UnTrack WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_NewVar WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#PyObject_GC_UnTrack WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#inquiry WARNING: unusable reference target found: refcounting#Py_DECREF done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... WARNING: unusable reference target found: setupscript#setup-script WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: setupscript#meta-data WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: commandref#sdist-cmd WARNING: unusable reference target found: setupscript#setup-script WARNING: unusable reference target found: configfile#setup-config WARNING: unusable reference target found: packageindex#pypirc WARNING: unusable reference target found: packageindex#pypirc WARNING: unusable reference target found: apiref#module-distutils.cmd WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#module-distutils.version WARNING: unusable reference target found: apiref#distutils.core.Extension WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#distutils.core.Extension WARNING: unusable reference target found: apiref#module-distutils.extension WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#module-distutils.cmd WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#module-distutils.dist WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_include_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_library_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.define_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.undefine_macro WARNING: unusable reference target found: apiref#distutils.util.split_quoted WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_link_object WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_link_objects WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_library_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.create_static_lib WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.create_static_lib WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.define_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.undefine_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.util.execute WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#distutils.file_util.move_file WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.dep_util.newer WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#module-distutils.file_util WARNING: unusable reference target found: apiref#distutils.file_util.copy_file WARNING: unusable reference target found: apiref#distutils.file_util.copy_file WARNING: unusable reference target found: apiref#distutils.util.get_platform WARNING: unusable reference target found: apiref#distutils.util.check_environ WARNING: unusable reference target found: apiref#distutils.util.byte_compile WARNING: unusable reference target found: apiref#distutils.fancy_getopt.fancy_getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.sysconfig.PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.EXEC_PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.EXEC_PREFIX WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.warn WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.close WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.warn WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.finalize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.run done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex resolving references... writing... WARNING: unusable reference target found: markup#doc-ref-role done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... WARNING: unusable reference target found: building#building WARNING: unusable reference target found: windows#building-on-windows WARNING: unusable reference target found: extending#methodtable WARNING: unusable reference target found: extending#parsetuple WARNING: unusable reference target found: extending#refcounts WARNING: unusable reference target found: extending#methodtable WARNING: unusable reference target found: extending#extending-simpleexample done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... WARNING: unusable reference target found: random#module-random WARNING: unusable reference target found: objects#builtin WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#unichr WARNING: unusable reference target found: functions#staticmethod WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: ast#module-ast WARNING: unusable reference target found: __future__#module-__future__ WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: stdtypes#str.replace WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: functions#setattr WARNING: unusable reference target found: stdtypes#typesmapping WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#divmod WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#globals WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#execfile WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: stdtypes#types-set WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: functions#id WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#locals WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: stdtypes#typesnumeric WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: fileinput#module-fileinput WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: functions#chr WARNING: unusable reference target found: functions#unichr WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: sys#sys.stdout WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: sys#module-sys WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: functions#reload WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: stdtypes#types-set WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: stdtypes#typesseq-mutable WARNING: unusable reference target found: functions#classmethod WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: strings#stringservices WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#super WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: functions#isinstance WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#chr WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: strings#stringservices WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#range WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#range WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: functions#__import__ WARNING: unusable reference target found: sys#sys.modules WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#intern WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: types#types.NoneType WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: constants#__debug__ WARNING: unusable reference target found: exceptions#exceptions.SyntaxError WARNING: unusable reference target found: site#module-site WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#print WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: math#math.trunc WARNING: unusable reference target found: math#math.floor WARNING: unusable reference target found: math#math.ceil WARNING: unusable reference target found: functions#built-in-funcs WARNING: unusable reference target found: functions#divmod WARNING: unusable reference target found: functions#abs WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stdtypes#float.hex WARNING: unusable reference target found: stdtypes#float.fromhex WARNING: unusable reference target found: stdtypes#float.hex WARNING: unusable reference target found: stdtypes#float.fromhex WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: stdtypes#typesseq-mutable WARNING: unusable reference target found: stdtypes#str.join WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codec-base-classes WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codec-base-classes WARNING: unusable reference target found: codecs#standard-encodings WARNING: unusable reference target found: string#formatstrings WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: sets#comparison-to-builtin-set WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: stdtypes#dict.items WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: contextlib#contextlib.closing WARNING: unusable reference target found: fcntl#module-fcntl WARNING: unusable reference target found: os#os.read WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: decimal#decimal.localcontext WARNING: unusable reference target found: contextlib#module-contextlib WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: code#module-code WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: types#module-types WARNING: unusable reference target found: constants#Ellipsis WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: exceptions#module-exceptions WARNING: unusable reference target found: exceptions#module-exceptions WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StopIteration WARNING: unusable reference target found: exceptions#exceptions.GeneratorExit WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ZeroDivisionError WARNING: unusable reference target found: exceptions#exceptions.FloatingPointError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: sys#sys.setdefaultencoding WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: stdtypes#file.read WARNING: unusable reference target found: stdtypes#file.readline WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.EnvironmentError WARNING: unusable reference target found: errno#module-errno WARNING: unusable reference target found: exceptions#exceptions.MemoryError WARNING: unusable reference target found: weakref#weakref.proxy WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: weakref#weakref.ReferenceError WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.StandardError WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: exceptions#exceptions.BaseException WARNING: unusable reference target found: exceptions#exceptions.NameError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: warnings#module-warnings WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: string#string.ascii_lowercase WARNING: unusable reference target found: string#string.ascii_uppercase WARNING: unusable reference target found: string#string.lowercase WARNING: unusable reference target found: string#string.uppercase WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.upper WARNING: unusable reference target found: string#string.swapcase WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.digits WARNING: unusable reference target found: string#string.letters WARNING: unusable reference target found: string#string.punctuation WARNING: unusable reference target found: string#string.whitespace WARNING: unusable reference target found: string#string.lower WARNING: unusable reference target found: string#string.swapcase WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: string#string.strip WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: stdtypes#str.format WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#string.Formatter.format WARNING: unusable reference target found: string#string.Formatter.format WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.parse WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.get_value WARNING: unusable reference target found: string#string.Formatter.vformat WARNING: unusable reference target found: string#string.Formatter.get_value WARNING: unusable reference target found: string#string.Formatter.get_value WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: string#string.Formatter.check_unused_args WARNING: unusable reference target found: string#string.Formatter.format_field WARNING: unusable reference target found: string#string.Formatter.format WARNING: unusable reference target found: string#string.Formatter.get_field WARNING: unusable reference target found: string#string.Formatter.parse WARNING: unusable reference target found: stdtypes#str.format WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: string#string.Formatter WARNING: unusable reference target found: ../@token#grammar-token-field_name WARNING: unusable reference target found: ../@token#grammar-token-conversion WARNING: unusable reference target found: ../@token#grammar-token-format_spec WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: ../@token#grammar-token-attribute_name WARNING: unusable reference target found: ../@token#grammar-token-identifier WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: string#formatstrings WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: ../@token#grammar-token-fill WARNING: unusable reference target found: ../@token#grammar-token-align WARNING: unusable reference target found: ../@token#grammar-token-sign WARNING: unusable reference target found: ../@token#grammar-token-width WARNING: unusable reference target found: ../@token#grammar-token-precision WARNING: unusable reference target found: ../@token#grammar-token-type WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: ../@token#grammar-token-integer WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: string#string.Template.substitute WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: string#string.Template.substitute WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#string.Template.safe_substitute WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: string#string.Template WARNING: unusable reference target found: re#re.escape WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.capitalize WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: string#string.translate WARNING: unusable reference target found: string#string.lowercase WARNING: unusable reference target found: string#string.uppercase WARNING: unusable reference target found: string#string.lower WARNING: unusable reference target found: string#string.upper WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: string#string.atoi WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: string#string.find WARNING: unusable reference target found: string#string.find WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#string.rfind WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.split WARNING: unusable reference target found: string#string.splitfields WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: string#string.joinfields WARNING: unusable reference target found: string#string.joinfields WARNING: unusable reference target found: string#string.join WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: re#re.DOTALL WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.I WARNING: unusable reference target found: re#re.L WARNING: unusable reference target found: re#re.M WARNING: unusable reference target found: re#re.S WARNING: unusable reference target found: re#re.U WARNING: unusable reference target found: re#re.X WARNING: unusable reference target found: re#contents-of-module-re WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.LOCALE WARNING: unusable reference target found: re#re.UNICODE WARNING: unusable reference target found: re#re.MULTILINE WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.split WARNING: unusable reference target found: re#re.findall WARNING: unusable reference target found: re#re.finditer WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.subn WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.match WARNING: unusable reference target found: re#re.split WARNING: unusable reference target found: re#re.split WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.sub WARNING: unusable reference target found: re#re.findall WARNING: unusable reference target found: re#re.search WARNING: unusable reference target found: re#re.findall WARNING: unusable reference target found: re#re.finditer WARNING: unusable reference target found: re#re.finditer WARNING: unusable reference target found: struct#struct.pack WARNING: unusable reference target found: struct#struct.unpack WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: struct#struct.pack WARNING: unusable reference target found: struct#struct.pack_into WARNING: unusable reference target found: struct#struct.unpack WARNING: unusable reference target found: struct#struct.unpack_from WARNING: unusable reference target found: struct#struct.Struct.format WARNING: unusable reference target found: filecmp#module-filecmp WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.HtmlDiff WARNING: unusable reference target found: difflib#difflib.HtmlDiff WARNING: unusable reference target found: difflib#difflib.HtmlDiff.make_file WARNING: unusable reference target found: stdtypes#file.readlines WARNING: unusable reference target found: stdtypes#file.writelines WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: difflib#difflib-interface WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.IS_LINE_JUNK WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.IS_CHARACTER_JUNK WARNING: unusable reference target found: difflib#difflib.Differ.compare WARNING: unusable reference target found: difflib#difflib.ndiff WARNING: unusable reference target found: stdtypes#file.readlines WARNING: unusable reference target found: stdtypes#file.writelines WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: difflib#difflib-interface WARNING: unusable reference target found: difflib#difflib.ndiff WARNING: unusable reference target found: difflib#difflib.ndiff WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.set_seq2 WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.set_seq1 WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.find_longest_match WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_opcodes WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_opcodes WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_matching_blocks WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.get_opcodes WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.quick_ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.real_quick_ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.ratio WARNING: unusable reference target found: difflib#difflib.SequenceMatcher.quick_ratio WARNING: unusable reference target found: difflib#difflib.get_close_matches WARNING: unusable reference target found: difflib#difflib.SequenceMatcher WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: difflib#difflib.Differ WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: stringio#StringIO.StringIO.getvalue WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO.close WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stringio#module-cStringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#StringIO.StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: textwrap#module-textwrap WARNING: unusable reference target found: textwrap#textwrap.wrap WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.dedent WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.wrap WARNING: unusable reference target found: textwrap#textwrap.wrap WARNING: unusable reference target found: textwrap#textwrap.fill WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.break_long_words WARNING: unusable reference target found: textwrap#textwrap.dedent WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.expand_tabs WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.replace_whitespace WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.fix_sentence_endings WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.break_long_words WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: textwrap#textwrap.TextWrapper.width WARNING: unusable reference target found: textwrap#textwrap.TextWrapper WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: codecs#codecs.lookup WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.UnicodeEncodeError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.UnicodeDecodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeTranslateError WARNING: unusable reference target found: exceptions#exceptions.LookupError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.BOM_UTF16 WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_BE WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_LE WARNING: unusable reference target found: codecs#codecs.BOM WARNING: unusable reference target found: codecs#codecs.BOM_UTF16 WARNING: unusable reference target found: codecs#codecs.BOM_LE WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_LE WARNING: unusable reference target found: codecs#codecs.BOM_BE WARNING: unusable reference target found: codecs#codecs.BOM_UTF16_BE WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.IncrementalEncoder.encode WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder.decode WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.StreamWriter.write WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: codecs#codecs.StreamReader.read WARNING: unusable reference target found: codecs#codecs.StreamReader.readline WARNING: unusable reference target found: codecs#codecs.StreamReader.read WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamReaderWriter WARNING: unusable reference target found: codecs#codecs.lookup WARNING: unusable reference target found: codecs#codecs.StreamReaderWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamReaderWriter WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamRecoder WARNING: unusable reference target found: codecs#codecs.lookup WARNING: unusable reference target found: codecs#codecs.StreamRecoder WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: codecs#codecs.StreamRecoder WARNING: unusable reference target found: codecs#codecs.StreamReader WARNING: unusable reference target found: codecs#codecs.StreamWriter WARNING: unusable reference target found: exceptions#exceptions.UnicodeEncodeError WARNING: unusable reference target found: codecs#module-encodings.idna WARNING: unusable reference target found: stringprep#module-stringprep WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: httplib#module-httplib WARNING: unusable reference target found: ftplib#module-ftplib WARNING: unusable reference target found: httplib#module-httplib WARNING: unusable reference target found: codecs#module-encodings.idna WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stringprep#module-stringprep WARNING: unusable reference target found: stringprep#module-stringprep WARNING: unusable reference target found: fpformat#module-fpformat WARNING: unusable reference target found: fpformat#module-fpformat WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: fpformat#module-fpformat WARNING: unusable reference target found: fpformat#fpformat.fix WARNING: unusable reference target found: fpformat#fpformat.sci WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: datetime#datetime.date.year WARNING: unusable reference target found: datetime#datetime.date.month WARNING: unusable reference target found: datetime#datetime.date.day WARNING: unusable reference target found: datetime#datetime.time.hour WARNING: unusable reference target found: datetime#datetime.time.minute WARNING: unusable reference target found: datetime#datetime.time.second WARNING: unusable reference target found: datetime#datetime.time.microsecond WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.year WARNING: unusable reference target found: datetime#datetime.datetime.month WARNING: unusable reference target found: datetime#datetime.datetime.day WARNING: unusable reference target found: datetime#datetime.datetime.hour WARNING: unusable reference target found: datetime#datetime.datetime.minute WARNING: unusable reference target found: datetime#datetime.datetime.second WARNING: unusable reference target found: datetime#datetime.datetime.microsecond WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: exceptions#exceptions.ZeroDivisionError WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.date.fromtimestamp WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date.isoweekday WARNING: unusable reference target found: datetime#datetime.date.weekday WARNING: unusable reference target found: datetime#datetime.date.isocalendar WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: datetime#datetime.date.ctime WARNING: unusable reference target found: datetime#strftime-behavior WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.now WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime.today WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.today WARNING: unusable reference target found: datetime#datetime.datetime.utcnow WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.now WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime.now WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime.utcfromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.datetime.fromtimestamp WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.timetz WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.utcoffset WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.datetime.dst WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: datetime#datetime.MINYEAR WARNING: unusable reference target found: datetime#datetime.MAXYEAR WARNING: unusable reference target found: datetime#datetime.datetime.isoweekday WARNING: unusable reference target found: datetime#datetime.datetime.weekday WARNING: unusable reference target found: datetime#datetime.datetime.isocalendar WARNING: unusable reference target found: datetime#datetime.datetime.microsecond WARNING: unusable reference target found: datetime#datetime.datetime.utcoffset WARNING: unusable reference target found: datetime#datetime.datetime.microsecond WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: datetime#datetime.datetime.ctime WARNING: unusable reference target found: datetime#strftime-behavior WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.time.utcoffset WARNING: unusable reference target found: datetime#strftime-behavior WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: datetime#datetime.timedelta WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.utcoffset WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.datetime.timetuple WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.tzname WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.datetime.astimezone WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo.fromutc WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo.dst WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.tzinfo WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.time WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: calendar#calendar.Calendar WARNING: unusable reference target found: calendar#calendar.Calendar WARNING: unusable reference target found: calendar#calendar.Calendar WARNING: unusable reference target found: calendar#calendar.firstweekday WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: calendar#calendar.Calendar.itermonthdates WARNING: unusable reference target found: calendar#calendar.Calendar.itermonthdates WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: calendar#calendar.Calendar.yeardatescalendar WARNING: unusable reference target found: calendar#calendar.Calendar.yeardatescalendar WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: calendar#calendar.TextCalendar.formatmonth WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: calendar#calendar.TextCalendar.formatyear WARNING: unusable reference target found: calendar#calendar.HTMLCalendar WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: calendar#calendar.HTMLCalendar WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: calendar#calendar.setfirstweekday WARNING: unusable reference target found: calendar#calendar.month WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: calendar#calendar.calendar WARNING: unusable reference target found: calendar#calendar.TextCalendar WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: calendar#calendar.timegm WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: collections#collections.deque WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: collections#collections.namedtuple WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: collections#collections.namedtuple WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#bsddb.btopen WARNING: unusable reference target found: abc#module-abc WARNING: unusable reference target found: collections#collections.deque.append WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: collections#collections.deque WARNING: unusable reference target found: collections#collections.deque WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: collections#collections.defaultdict.default_factory WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: collections#collections.defaultdict.__missing__ WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict.setdefault WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: itertools#itertools.repeat WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: collections#collections.defaultdict WARNING: unusable reference target found: keyword#module-keyword WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: heapq#heapq.heapify WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: heapq#heapq.heappush WARNING: unusable reference target found: heapq#heapq.heappop WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: heapq#heapq.heappop WARNING: unusable reference target found: heapq#heapq.heappush WARNING: unusable reference target found: functions#sorted WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: bisect#module-bisect WARNING: unusable reference target found: bisect#bisect.bisect_left WARNING: unusable reference target found: bisect#bisect.bisect_right WARNING: unusable reference target found: bisect#bisect.insort_left WARNING: unusable reference target found: bisect#bisect.insort_right WARNING: unusable reference target found: bisect#bisect.bisect WARNING: unusable reference target found: bisect#bisect.bisect WARNING: unusable reference target found: array#array.array WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: array#array.array.read WARNING: unusable reference target found: array#array.array.fromfile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: array#array.array.fromfile WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: array#array.array.read WARNING: unusable reference target found: array#array.array.tofile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: array#array.array.tofile WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: array#array.array WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#immutable-transforms WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#immutable-transforms WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: sets#module-sets WARNING: unusable reference target found: sets#sets.Set WARNING: unusable reference target found: sets#sets.ImmutableSet WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#sorted WARNING: unusable reference target found: sched#module-sched WARNING: unusable reference target found: sched#sched.scheduler WARNING: unusable reference target found: sched#sched.scheduler WARNING: unusable reference target found: threading#threading.Timer WARNING: unusable reference target found: sched#sched.scheduler WARNING: unusable reference target found: sched#sched.scheduler.cancel WARNING: unusable reference target found: sched#sched.scheduler.enterabs WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: sched#sched.scheduler.run WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: mutex#mutex.mutex.lock WARNING: unusable reference target found: mutex#mutex.mutex WARNING: unusable reference target found: mutex#mutex.mutex.unlock WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: heapq#module-heapq WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.LifoQueue WARNING: unusable reference target found: queue#Queue.PriorityQueue WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Queue.get WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.join WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.put WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#module-weakref WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#hash WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: weakref#weakref.ref WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.WeakKeyDictionary WARNING: unusable reference target found: weakref#weakref.ReferenceError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: weakref#weakref.ref WARNING: unusable reference target found: weakref#weakref.WeakValueDictionary WARNING: unusable reference target found: weakref#weakref.ref WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#module-UserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: stdtypes#typesmapping WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.IterableUserDict WARNING: unusable reference target found: userdict#UserDict.UserDict WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: userdict#module-UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList.data WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: stdtypes#typesseq WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserList.UserList WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.MutableString WARNING: unusable reference target found: userdict#UserString.MutableString WARNING: unusable reference target found: userdict#module-UserString WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: collections#module-collections WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.MutableString WARNING: unusable reference target found: stdtypes#string-methods WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: userdict#UserString.UserString WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: types#module-types WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: functions#compile WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: functions#slice WARNING: unusable reference target found: functions#slice WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: functions#property WARNING: unusable reference target found: new#module-new WARNING: unusable reference target found: types#module-types WARNING: unusable reference target found: new#module-new WARNING: unusable reference target found: new#module-new WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: stdtypes#dict.copy WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pprint#module-pprint WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#frozenset WARNING: unusable reference target found: pprint#module-pprint WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: pprint#pprint.PrettyPrinter WARNING: unusable reference target found: pprint#pprint.saferepr WARNING: unusable reference target found: functions#id WARNING: unusable reference target found: pprint#pprint.PrettyPrinter.format WARNING: unusable reference target found: pprint#pprint.pprint WARNING: unusable reference target found: repr#module-repr WARNING: unusable reference target found: repr#module-repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: repr#repr.Repr.maxdict WARNING: unusable reference target found: repr#repr.Repr.maxarray WARNING: unusable reference target found: repr#repr.Repr.maxset WARNING: unusable reference target found: repr#repr.Repr.maxfrozenset WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: repr#repr.Repr.maxstring WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: repr#repr.Repr.repr1 WARNING: unusable reference target found: repr#repr.Repr.repr1 WARNING: unusable reference target found: repr#repr.Repr.repr1 WARNING: unusable reference target found: repr#repr.Repr WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: math#module-math WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: numbers#numbers.Complex.real WARNING: unusable reference target found: numbers#numbers.Complex.imag WARNING: unusable reference target found: functions#abs WARNING: unusable reference target found: numbers#numbers.Complex.conjugate WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#round WARNING: unusable reference target found: math#math.floor WARNING: unusable reference target found: math#math.ceil WARNING: unusable reference target found: functions#divmod WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: numbers#numbers.Complex.real WARNING: unusable reference target found: numbers#numbers.Complex.imag WARNING: unusable reference target found: numbers#numbers.Complex.conjugate WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Rational.numerator WARNING: unusable reference target found: numbers#numbers.Rational.denominator WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: numbers#numbers.Rational WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: numbers#numbers.Rational.numerator WARNING: unusable reference target found: numbers#numbers.Rational.denominator WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: functions#hash WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: numbers#numbers.Real WARNING: unusable reference target found: numbers#numbers.Integral WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: constants#NotImplemented WARNING: unusable reference target found: numbers#numbers.Complex WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: math#math.fmod WARNING: unusable reference target found: math#math.frexp WARNING: unusable reference target found: math#math.frexp WARNING: unusable reference target found: math#math.modf WARNING: unusable reference target found: math#math.ceil WARNING: unusable reference target found: math#math.floor WARNING: unusable reference target found: math#math.modf WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: math#math.atan2 WARNING: unusable reference target found: math#module-math WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: cmath#cmath.phase WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: functions#complex WARNING: unusable reference target found: cmath#cmath.acos WARNING: unusable reference target found: cmath#cmath.log WARNING: unusable reference target found: cmath#cmath.log WARNING: unusable reference target found: math#module-math WARNING: unusable reference target found: cmath#module-cmath WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: decimal#decimal.Clamped WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Subnormal WARNING: unusable reference target found: decimal#decimal.Overflow WARNING: unusable reference target found: decimal#decimal.Underflow WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.BasicContext WARNING: unusable reference target found: decimal#decimal.ExtendedContext WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: functions#tuple WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal.compare WARNING: unusable reference target found: decimal#decimal.Decimal.compare WARNING: unusable reference target found: decimal#decimal.Decimal.compare WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal.compare_total WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.Decimal.logical_and WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: decimal#decimal.Decimal.logical_invert WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: decimal#decimal.Decimal.logical_or WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: decimal#decimal.Decimal.logical_xor WARNING: unusable reference target found: decimal#logical-operands-label WARNING: unusable reference target found: functions#max WARNING: unusable reference target found: functions#min WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal.to_integral_value WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.localcontext WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Subnormal WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: decimal#decimal.DefaultContext WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Context.Etiny WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: exceptions#exceptions.ArithmeticError WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Rounded WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Subnormal WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: decimal#module-decimal WARNING: unusable reference target found: decimal#decimal.DivisionByZero WARNING: unusable reference target found: decimal#decimal.Overflow WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: decimal#decimal.InvalidOperation WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.Context WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.setcontext WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.getcontext WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: decimal#decimal.Inexact WARNING: unusable reference target found: decimal#decimal.Context.create_decimal WARNING: unusable reference target found: fractions#module-fractions WARNING: unusable reference target found: numbers#numbers.Integral WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: exceptions#exceptions.ZeroDivisionError WARNING: unusable reference target found: numbers#numbers.Rational WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: numbers#numbers.Rational WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: fractions#fractions.Fraction WARNING: unusable reference target found: numbers#module-numbers WARNING: unusable reference target found: random#random.random WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: random#random.random WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.getstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: random#random.getrandbits WARNING: unusable reference target found: random#random.randrange WARNING: unusable reference target found: random#random.getrandbits WARNING: unusable reference target found: random#module-random WARNING: unusable reference target found: random#random.WichmannHill WARNING: unusable reference target found: os#os.urandom WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.getstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: random#random.getrandbits WARNING: unusable reference target found: random#random.randrange WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: random#random.random WARNING: unusable reference target found: functions#xrange WARNING: unusable reference target found: random#random.normalvariate WARNING: unusable reference target found: random#random.whseed WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.whseed WARNING: unusable reference target found: os#os.urandom WARNING: unusable reference target found: random#random.seed WARNING: unusable reference target found: random#random.jumpahead WARNING: unusable reference target found: random#random.getstate WARNING: unusable reference target found: random#random.setstate WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.count WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: itertools#itertools.chain WARNING: unusable reference target found: itertools#itertools.combinations WARNING: unusable reference target found: itertools#itertools.permutations WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.islice WARNING: unusable reference target found: functions#zip WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: itertools#itertools.izip_longest WARNING: unusable reference target found: itertools#itertools.izip_longest WARNING: unusable reference target found: itertools#itertools.islice WARNING: unusable reference target found: itertools#itertools.takewhile WARNING: unusable reference target found: itertools#itertools.permutations WARNING: unusable reference target found: itertools#itertools.product WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.izip WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: itertools#itertools.starmap WARNING: unusable reference target found: itertools#itertools.starmap WARNING: unusable reference target found: itertools#itertools.tee WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: itertools#itertools.tee WARNING: unusable reference target found: functools#module-functools WARNING: unusable reference target found: functools#module-functools WARNING: unusable reference target found: functions#reduce WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial.func WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: functools#functools.partial WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: functions#cmp WARNING: unusable reference target found: operator#operator.__not__ WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: operator#operator.invert WARNING: unusable reference target found: operator#operator.__invert__ WARNING: unusable reference target found: operator#operator.__contains__ WARNING: unusable reference target found: operator#operator.delitem WARNING: unusable reference target found: operator#operator.getitem WARNING: unusable reference target found: operator#operator.contains WARNING: unusable reference target found: operator#operator.contains WARNING: unusable reference target found: operator#operator.setitem WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: operator#operator.isCallable WARNING: unusable reference target found: functions#callable WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#sorted WARNING: unusable reference target found: itertools#itertools.groupby WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#operator.__getitem__ WARNING: unusable reference target found: operator#operator.itemgetter WARNING: unusable reference target found: operator#module-operator WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os.path#os.path.splitunc WARNING: unusable reference target found: os.path#os.path.ismount WARNING: unusable reference target found: os.path#os.path.basename WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os.path#os.path.exists WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: pwd#module-pwd WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os.path#os.path.islink WARNING: unusable reference target found: os.path#os.path.isfile WARNING: unusable reference target found: os.path#os.path.islink WARNING: unusable reference target found: os.path#os.path.isdir WARNING: unusable reference target found: os.path#os.path.normcase WARNING: unusable reference target found: os#os.curdir WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os.path#os.path.samefile WARNING: unusable reference target found: os.path#os.path.sameopenfile WARNING: unusable reference target found: os.path#os.path.walk WARNING: unusable reference target found: os.path#os.path.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: fileinput#fileinput.input WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.input WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: fileinput#fileinput.filename WARNING: unusable reference target found: fileinput#fileinput.fileno WARNING: unusable reference target found: fileinput#fileinput.lineno WARNING: unusable reference target found: fileinput#fileinput.filelineno WARNING: unusable reference target found: fileinput#fileinput.isfirstline WARNING: unusable reference target found: fileinput#fileinput.isstdin WARNING: unusable reference target found: fileinput#fileinput.nextfile WARNING: unusable reference target found: fileinput#fileinput.close WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: fileinput#fileinput.input WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: codecs#codecs.open WARNING: unusable reference target found: fileinput#fileinput.FileInput WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: os#os.lstat WARNING: unusable reference target found: statvfs#module-statvfs WARNING: unusable reference target found: statvfs#module-statvfs WARNING: unusable reference target found: os#os.statvfs WARNING: unusable reference target found: os#os.statvfs WARNING: unusable reference target found: filecmp#module-filecmp WARNING: unusable reference target found: difflib#module-difflib WARNING: unusable reference target found: filecmp#module-filecmp WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: filecmp#filecmp.cmp WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: filecmp#filecmp.dircmp.common_dirs WARNING: unusable reference target found: filecmp#filecmp.dircmp WARNING: unusable reference target found: tempfile#tempfile.NamedTemporaryFile WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: os#os.O_EXCL WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: tempfile#tempfile.TemporaryFile WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: tempfile#tempfile.NamedTemporaryFile WARNING: unusable reference target found: tempfile#tempfile.tempdir WARNING: unusable reference target found: tempfile#tempfile.gettempprefix WARNING: unusable reference target found: tempfile#tempfile.mktemp WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: fnmatch#fnmatch.fnmatch WARNING: unusable reference target found: os.path#os.path.expanduser WARNING: unusable reference target found: os.path#os.path.expandvars WARNING: unusable reference target found: glob#glob.glob WARNING: unusable reference target found: glob#glob.glob WARNING: unusable reference target found: fnmatch#module-fnmatch WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: fnmatch#fnmatch.fnmatch WARNING: unusable reference target found: fnmatch#fnmatch.fnmatchcase WARNING: unusable reference target found: glob#module-glob WARNING: unusable reference target found: linecache#module-linecache WARNING: unusable reference target found: traceback#module-traceback WARNING: unusable reference target found: linecache#module-linecache WARNING: unusable reference target found: linecache#linecache.getline WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.copy2 WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.Error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.copy WARNING: unusable reference target found: shutil#shutil.copystat WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.copystat WARNING: unusable reference target found: shutil#shutil.copy2 WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.ignore_patterns WARNING: unusable reference target found: shutil#shutil.Error WARNING: unusable reference target found: shutil#shutil.Error WARNING: unusable reference target found: shutil#shutil.copystat WARNING: unusable reference target found: os.path#os.path.islink WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: os#os.remove WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: shutil#shutil.copy2 WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.copytree WARNING: unusable reference target found: shutil#shutil.ignore_patterns WARNING: unusable reference target found: dircache#module-dircache WARNING: unusable reference target found: dircache#module-dircache WARNING: unusable reference target found: dircache#module-dircache WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: dircache#dircache.listdir WARNING: unusable reference target found: dircache#dircache.listdir WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.HIGHEST_PROTOCOL WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.Pickler.clear_memo WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Pickler.clear_memo WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.dump WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.Pickler WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.load WARNING: unusable reference target found: pickle#pickle-protocol WARNING: unusable reference target found: pickle#pickle.Unpickler.noload WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#pickle.Unpickler WARNING: unusable reference target found: pickle#pickle.Unpickler.noload WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#pickle-protocol WARNING: unusable reference target found: pickle#pickle.PicklingError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: sys#sys.setrecursionlimit WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#pickle-sub WARNING: unusable reference target found: pickle#object.__getinitargs__ WARNING: unusable reference target found: pickle#object.__getinitargs__ WARNING: unusable reference target found: pickle#object.__getnewargs__ WARNING: unusable reference target found: pickle#object.__getnewargs__ WARNING: unusable reference target found: pickle#object.__getnewargs__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#pickle-inst WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce_ex__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: pickle#object.__reduce__ WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#object.__setstate__ WARNING: unusable reference target found: pickle#object.__getstate__ WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#pickle-sub WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: copy_reg#module-copy_reg WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: copy#module-copy WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: anydbm#anydbm.open WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#bsddb.hashopen WARNING: unusable reference target found: bsddb#bsddb.btopen WARNING: unusable reference target found: bsddb#bsddb.rnopen WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: anydbm#anydbm.open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: shelve#shelve.Shelf WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: pickle#module-cPickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: marshal#marshal.load WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: marshal#marshal.dump WARNING: unusable reference target found: marshal#marshal.load WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: anydbm#anydbm.error WARNING: unusable reference target found: anydbm#anydbm.error WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: gdbm#gdbm.error WARNING: unusable reference target found: gdbm#gdbm.nextkey WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: dbhash#dbhash.dbhash.previous WARNING: unusable reference target found: dbhash#dbhash.dbhash.last WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: marshal#marshal.dumps WARNING: unusable reference target found: pickle#pickle.dumps WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: dbhash#module-dbhash WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: bsddb#bsddb.btopen WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: bsddb#bsddb.hashopen WARNING: unusable reference target found: bsddb#bsddb.hashopen WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: dumbdbm#module-dumbdbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: bsddb#module-bsddb WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: anydbm#module-anydbm WARNING: unusable reference target found: dbm#module-dbm WARNING: unusable reference target found: gdbm#module-gdbm WARNING: unusable reference target found: shelve#module-shelve WARNING: unusable reference target found: whichdb#module-whichdb WARNING: unusable reference target found: userdict#UserDict.DictMixin WARNING: unusable reference target found: dumbdbm#dumbdbm.dumbdbm.sync WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.fetchone WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.fetchall WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.description WARNING: unusable reference target found: sqlite3#sqlite3.Connection.isolation_level WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.register_converter WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_DECLTYPES WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_COLNAMES WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#sqlite3-types WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3-controlling-transactions WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Connection.commit WARNING: unusable reference target found: sqlite3#sqlite3.Connection.commit WARNING: unusable reference target found: sqlite3#sqlite3.Connection.commit WARNING: unusable reference target found: sqlite3#sqlite3.Connection.execute WARNING: unusable reference target found: sqlite3#sqlite3.Connection.executemany WARNING: unusable reference target found: sqlite3#sqlite3.Connection.executescript WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3.Connection.row_factory WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.executescript WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.fetchmany WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.rowcount WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.executemany WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.rowcount WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.rowcount WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.execute WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.executemany WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.lastrowid WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: sqlite3#sqlite3.Connection.row_factory WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: sqlite3#sqlite3.Cursor.description WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: sqlite3#sqlite3.Connection.text_factory WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#buffer WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.register_adapter WARNING: unusable reference target found: functions#object WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3-module-contents WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_DECLTYPES WARNING: unusable reference target found: sqlite3#sqlite3.PARSE_COLNAMES WARNING: unusable reference target found: datetime#datetime.date WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.connect WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Cursor WARNING: unusable reference target found: sqlite3#sqlite3.Connection WARNING: unusable reference target found: sqlite3#module-sqlite3 WARNING: unusable reference target found: sqlite3#sqlite3.Row WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zlib#zlib.error WARNING: unusable reference target found: zlib#zlib.error WARNING: unusable reference target found: zlib#zlib.compress WARNING: unusable reference target found: zlib#zlib.Compress.flush WARNING: unusable reference target found: zlib#zlib.compress WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.Decompress.unused_data WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.Decompress.unconsumed_tail WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: zlib#zlib.Decompress.unconsumed_tail WARNING: unusable reference target found: zlib#zlib.Decompress.flush WARNING: unusable reference target found: zlib#zlib.decompress WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: gzip#gzip.GzipFile WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: bz2#bz2.BZ2Compressor WARNING: unusable reference target found: bz2#bz2.BZ2Decompressor WARNING: unusable reference target found: bz2#bz2.compress WARNING: unusable reference target found: bz2#bz2.decompress WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: bz2#bz2.BZ2File.close WARNING: unusable reference target found: bz2#bz2.BZ2File WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: bz2#bz2.BZ2File.close WARNING: unusable reference target found: bz2#bz2.BZ2Compressor WARNING: unusable reference target found: bz2#bz2.BZ2Decompressor WARNING: unusable reference target found: bz2#bz2.compress WARNING: unusable reference target found: bz2#bz2.BZ2Compressor.flush WARNING: unusable reference target found: bz2#bz2.decompress WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: bz2#bz2.compress WARNING: unusable reference target found: bz2#bz2.decompress WARNING: unusable reference target found: bz2#bz2.BZ2Compressor WARNING: unusable reference target found: bz2#bz2.BZ2Decompressor WARNING: unusable reference target found: zipfile#zipinfo-objects WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zipfile#zipfile-objects WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#zipinfo-objects WARNING: unusable reference target found: zipfile#zipfile.ZIP_STORED WARNING: unusable reference target found: zipfile#zipfile.ZIP_DEFLATED WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZIP_DEFLATED WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZIP_STORED WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#zipfile.ZipFile.close WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.getinfo WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.read WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: zipfile#zipfile.ZipFile.open WARNING: unusable reference target found: zipfile#zipfile.ZipFile.open WARNING: unusable reference target found: zipfile#zipfile.ZipFile.open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: zipfile#zipfile.ZipFile.read WARNING: unusable reference target found: zipfile#zipfile.ZipFile.extract WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.namelist WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.setpassword WARNING: unusable reference target found: zipfile#zipfile.ZipFile.read WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.testzip WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.write WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.write WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.write WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile.writestr WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipFile.writestr WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZIP_STORED WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: zipfile#zipfile.ZipFile.close WARNING: unusable reference target found: zipfile#zipfile.PyZipFile WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: zipfile#zipfile.PyZipFile.writepy WARNING: unusable reference target found: zipfile#zipfile.ZipInfo WARNING: unusable reference target found: zipfile#zipfile.ZipFile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: bz2#module-bz2 WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile-objects WARNING: unusable reference target found: tarfile#tarfile.ReadError WARNING: unusable reference target found: tarfile#tarfile.CompressionError WARNING: unusable reference target found: tarfile#tarfile.open WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tar-examples WARNING: unusable reference target found: tarfile#tarfile.open WARNING: unusable reference target found: tarfile#tarfile-objects WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: gzip#module-gzip WARNING: unusable reference target found: tarfile#tarfile.TarFileCompat WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarFile.extract WARNING: unusable reference target found: tarfile#tarfile.TarInfo.frombuf WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tar-formats WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: sys#sys.getfilesystemencoding WARNING: unusable reference target found: sys#sys.getdefaultencoding WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: zipfile#module-zipfile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarinfo-objects WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.USTAR_FORMAT WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarFile.extract WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: tarfile#tarfile.TarError WARNING: unusable reference target found: tarfile#tar-unicode WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: tarfile#tarfile.open WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.getmembers WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: tarfile#tarfile.TarFile.getmembers WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.extract WARNING: unusable reference target found: tarfile#tarfile.TarFile.extractall WARNING: unusable reference target found: tarfile#tarfile.TarFile.extractall WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.gettarinfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: os#os.fstat WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile.addfile WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.USTAR_FORMAT WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.HeaderError WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: tarfile#tarfile.TarInfo WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarInfo.isfile WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: tarfile#tarfile.TarFile.extractall WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tarfile.USTAR_FORMAT WARNING: unusable reference target found: tarfile#tarfile.GNU_FORMAT WARNING: unusable reference target found: tarfile#module-tarfile WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: tarfile#tarfile.TarFile WARNING: unusable reference target found: sys#sys.getfilesystemencoding WARNING: unusable reference target found: sys#sys.getdefaultencoding WARNING: unusable reference target found: tarfile#tarfile.PAX_FORMAT WARNING: unusable reference target found: codecs#codec-base-classes WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.DictReader WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv-examples WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.list_dialects WARNING: unusable reference target found: csv#csv-fmt-params WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.list_dialects WARNING: unusable reference target found: csv#csv-fmt-params WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv-fmt-params WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.DictReader WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.excel WARNING: unusable reference target found: csv#csv.excel_tab WARNING: unusable reference target found: csv#csv.Sniffer WARNING: unusable reference target found: csv#csv.Sniffer WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: csv#csv.Sniffer WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: csv#csv.Dialect WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: csv#csv.Error WARNING: unusable reference target found: csv#csv.QUOTE_NONE WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv-contents WARNING: unusable reference target found: csv#csv.QUOTE_MINIMAL WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: csv#csv.DictReader WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: csv#csv.writer WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: csv#csv.DictWriter WARNING: unusable reference target found: csv#module-csv WARNING: unusable reference target found: csv#csv.reader WARNING: unusable reference target found: configparser#module-ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser.get WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser.items WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.MAX_INTERPOLATION_DEPTH WARNING: unusable reference target found: configparser#ConfigParser.InterpolationError WARNING: unusable reference target found: configparser#ConfigParser.InterpolationError WARNING: unusable reference target found: configparser#ConfigParser.InterpolationError WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: shlex#module-shlex WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.DuplicateSectionError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser.readfp WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser.read WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: configparser#ConfigParser.NoSectionError WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser.read WARNING: unusable reference target found: configparser#ConfigParser.NoSectionError WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.RawConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser.get WARNING: unusable reference target found: configparser#ConfigParser.SafeConfigParser WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.NoSectionError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: configparser#ConfigParser.ConfigParser WARNING: unusable reference target found: configparser#ConfigParser.SafeConfigParser WARNING: unusable reference target found: robotparser#module-robotparser WARNING: unusable reference target found: robotparser#robotparser.RobotFileParser WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.NetrcParseError WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: netrc#netrc.netrc WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: xdrlib#module-xdrlib WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_string WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_string WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: xdrlib#xdrlib.Packer.pack_farray WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.get_position WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.set_position WARNING: unusable reference target found: xdrlib#xdrlib.Error WARNING: unusable reference target found: xdrlib#xdrlib.Packer WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_float WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_fstring WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_string WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_string WARNING: unusable reference target found: xdrlib#xdrlib.Unpacker.unpack_farray WARNING: unusable reference target found: xdrlib#xdrlib.Error WARNING: unusable reference target found: xdrlib#xdrlib.Error WARNING: unusable reference target found: plistlib#plistlib.Data WARNING: unusable reference target found: datetime#datetime.datetime WARNING: unusable reference target found: plistlib#plistlib.Data WARNING: unusable reference target found: plistlib#plistlib.Data WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: zlib#module-zlib WARNING: unusable reference target found: hashlib#hashlib.hash.update WARNING: unusable reference target found: hashlib#hashlib.digest_size WARNING: unusable reference target found: hashlib#hashlib.hash.digest WARNING: unusable reference target found: hmac#module-hmac WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: hmac#hmac.hmac.update WARNING: unusable reference target found: hmac#hmac.hmac.digest WARNING: unusable reference target found: hashlib#module-hashlib WARNING: unusable reference target found: hashlib#module-hashlib WARNING: unusable reference target found: md5#md5.new WARNING: unusable reference target found: md5#md5.new WARNING: unusable reference target found: md5#md5.new WARNING: unusable reference target found: md5#md5.md5.update WARNING: unusable reference target found: md5#md5.md5.digest WARNING: unusable reference target found: sha#module-sha WARNING: unusable reference target found: hashlib#module-hashlib WARNING: unusable reference target found: md5#module-md5 WARNING: unusable reference target found: sha#sha.new WARNING: unusable reference target found: sha#sha.new WARNING: unusable reference target found: sha#sha.sha.update WARNING: unusable reference target found: sha#sha.sha.digest WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: fileinput#module-fileinput WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: shutil#module-shutil WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os-file-dir WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: os#os.putenv WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: socket#socket.gethostname WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: os#os.unsetenv WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: os#os.close WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: popen2#popen2-flow-control WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: popen2#module-popen2 WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.pipe WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: os#os.close WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: errno#errno.EINVAL WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.statvfs WARNING: unusable reference target found: os#os.SEEK_SET WARNING: unusable reference target found: os#os.SEEK_CUR WARNING: unusable reference target found: os#os.SEEK_END WARNING: unusable reference target found: os#os.O_RDONLY WARNING: unusable reference target found: os#os.O_WRONLY WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.read WARNING: unusable reference target found: os#os.write WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: pty#module-pty WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.pipe WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: sys#sys.stdin WARNING: unusable reference target found: os#os.read WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.pipe WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: sys#sys.stdout WARNING: unusable reference target found: sys#sys.stderr WARNING: unusable reference target found: os#os.write WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.lseek WARNING: unusable reference target found: os#os.F_OK WARNING: unusable reference target found: os#os.R_OK WARNING: unusable reference target found: os#os.W_OK WARNING: unusable reference target found: os#os.X_OK WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: os#os.access WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: os#os.chflags WARNING: unusable reference target found: os#os.chmod WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.unlink WARNING: unusable reference target found: os#os.mkfifo WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.makedev WARNING: unusable reference target found: tempfile#module-tempfile WARNING: unusable reference target found: tempfile#tempfile.mkdtemp WARNING: unusable reference target found: os#os.mkdir WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: os#os.makedirs WARNING: unusable reference target found: os#os.pardir WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: errno#errno.EINVAL WARNING: unusable reference target found: os#os.pathconf WARNING: unusable reference target found: os#os.fpathconf WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: os#os.unlink WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: os#os.removedirs WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.rename WARNING: unusable reference target found: os#os.removedirs WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: os#os.stat_float_times WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: stat#module-stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: statvfs#module-statvfs WARNING: unusable reference target found: os#os.tempnam WARNING: unusable reference target found: os#os.tempnam WARNING: unusable reference target found: os#os.tmpfile WARNING: unusable reference target found: os#os-newstreams WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.tmpfile WARNING: unusable reference target found: os#os-newstreams WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.tmpnam WARNING: unusable reference target found: os#os.remove WARNING: unusable reference target found: os#os.unlink WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.listdir WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.walk WARNING: unusable reference target found: os#os.rmdir WARNING: unusable reference target found: signal#signal.signal WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.fsync WARNING: unusable reference target found: os#os.execlp WARNING: unusable reference target found: os#os.execlpe WARNING: unusable reference target found: os#os.execvp WARNING: unusable reference target found: os#os.execvpe WARNING: unusable reference target found: os#os.execl WARNING: unusable reference target found: os#os.execle WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.execve WARNING: unusable reference target found: os#os.execle WARNING: unusable reference target found: os#os.execlpe WARNING: unusable reference target found: os#os.execve WARNING: unusable reference target found: os#os.execvpe WARNING: unusable reference target found: os#os.execl WARNING: unusable reference target found: os#os.execlp WARNING: unusable reference target found: os#os.execv WARNING: unusable reference target found: os#os.execvp WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: os#os._exit WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: pty#module-pty WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: os#os-newstreams WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: os#os.P_NOWAIT WARNING: unusable reference target found: os#os.P_WAIT WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnlpe WARNING: unusable reference target found: os#os.spawnvp WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.spawnl WARNING: unusable reference target found: os#os.spawnle WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.spawnve WARNING: unusable reference target found: os#os.spawnle WARNING: unusable reference target found: os#os.spawnlpe WARNING: unusable reference target found: os#os.spawnve WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.spawnl WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.spawnvp WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.spawnlp WARNING: unusable reference target found: os#os.spawnlpe WARNING: unusable reference target found: os#os.spawnvp WARNING: unusable reference target found: os#os.spawnvpe WARNING: unusable reference target found: os#os.P_DETACH WARNING: unusable reference target found: os#os.P_NOWAIT WARNING: unusable reference target found: os#os.P_OVERLAY WARNING: unusable reference target found: os#os.startfile WARNING: unusable reference target found: os.path#os.path.normpath WARNING: unusable reference target found: os#os.environ WARNING: unusable reference target found: sys#sys.stdin WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.P_NOWAIT WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: resource#module-resource WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.wait4 WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: resource#module-resource WARNING: unusable reference target found: os#os.wait4 WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: os#os.wait WARNING: unusable reference target found: os#os.waitpid WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: errno#errno.EINVAL WARNING: unusable reference target found: os#os.confstr WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: os#os.confstr WARNING: unusable reference target found: os#os.sysconf WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#os.path.split WARNING: unusable reference target found: os.path#os.path.join WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: os.path#module-os.path WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: io#module-io WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedRWPair WARNING: unusable reference target found: io#io.BufferedRandom WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.StringIO WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.stat WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: os#os.linesep WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedRandom WARNING: unusable reference target found: io#io.StringIO WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: io#io.IOBase.seek WARNING: unusable reference target found: io#io.IOBase.tell WARNING: unusable reference target found: io#io.IOBase.truncate WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase.tell WARNING: unusable reference target found: io#io.IOBase.truncate WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: io#io.FileIO WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedIOBase.read WARNING: unusable reference target found: io#io.BufferedIOBase.readinto WARNING: unusable reference target found: io#io.BufferedIOBase.read WARNING: unusable reference target found: io#io.BufferedIOBase.readinto WARNING: unusable reference target found: io#io.BufferedIOBase.write WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BufferedIOBase.read WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BytesIO WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.DEFAULT_BUFFER_SIZE WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BlockingIOError WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.RawIOBase WARNING: unusable reference target found: io#io.DEFAULT_BUFFER_SIZE WARNING: unusable reference target found: io#io.BufferedRWPair WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.DEFAULT_BUFFER_SIZE WARNING: unusable reference target found: io#io.BufferedRandom WARNING: unusable reference target found: io#io.BufferedReader WARNING: unusable reference target found: io#io.BufferedWriter WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: io#io.IOBase WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: io#io.BufferedIOBase WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: locale#locale.getpreferredencoding WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: codecs#codecs.register_error WARNING: unusable reference target found: os#os.linesep WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.TextIOBase WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: io#io.StringIO WARNING: unusable reference target found: io#io.TextIOWrapper WARNING: unusable reference target found: codecs#codecs.IncrementalDecoder WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.asctime WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.asctime WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: calendar#calendar.timegm WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.struct_time WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.ctime WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.strptime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: time#time.tzset WARNING: unusable reference target found: datetime#module-datetime WARNING: unusable reference target found: locale#module-locale WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: calendar#module-calendar WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: getopt#module-getopt WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-extending-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-extending-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-reference-guide WARNING: unusable reference target found: optparse#optparse-option-callbacks WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: constants#exit WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-conflicts-between-options WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-tutorial WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#optparse-option-callbacks WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-option-callbacks WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: functions#help WARNING: unusable reference target found: optparse#optparse-tutorial WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#optparse-extending-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#type WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: functions#getattr WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: getopt#getopt.GetoptError WARNING: unusable reference target found: getopt#getopt.getopt WARNING: unusable reference target found: getopt#getopt.getopt WARNING: unusable reference target found: getopt#getopt.GetoptError WARNING: unusable reference target found: getopt#getopt.error WARNING: unusable reference target found: getopt#getopt.GetoptError WARNING: unusable reference target found: optparse#module-optparse WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.log WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.Logger.setLevel WARNING: unusable reference target found: logging#logging.Logger.addFilter WARNING: unusable reference target found: logging#logging.Logger.removeFilter WARNING: unusable reference target found: logging#logging.Logger.debug WARNING: unusable reference target found: logging#logging.Logger.info WARNING: unusable reference target found: logging#logging.Logger.warning WARNING: unusable reference target found: logging#logging.Logger.error WARNING: unusable reference target found: logging#logging.Logger.critical WARNING: unusable reference target found: logging#logging.Logger.exception WARNING: unusable reference target found: logging#logging.Logger.error WARNING: unusable reference target found: logging#logging.Logger.exception WARNING: unusable reference target found: logging#logging.Logger.log WARNING: unusable reference target found: logging#logging.getLogger WARNING: unusable reference target found: logging#logging.getLogger WARNING: unusable reference target found: logging#logging.Handler.setLevel WARNING: unusable reference target found: logging#formatter-objects WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler WARNING: unusable reference target found: logging#logging.handlers.TimedRotatingFileHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#logging.handlers.DatagramHandler WARNING: unusable reference target found: logging#logging.handlers.SMTPHandler WARNING: unusable reference target found: logging#logging.handlers.SysLogHandler WARNING: unusable reference target found: logging#logging.handlers.NTEventLogHandler WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.HTTPHandler WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.setLoggerClass WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.addLevelName WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.Logger.getEffectiveLevel WARNING: unusable reference target found: logging#logging.Logger.setLevel WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: functions#filter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: time#module-time WARNING: unusable reference target found: logging#logging.basicConfig WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.exception WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.log WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: socketserver#module-SocketServer WARNING: unusable reference target found: logging#logging.Handler.__init__ WARNING: unusable reference target found: logging#logging.Handler.createLock WARNING: unusable reference target found: logging#logging.Handler.createLock WARNING: unusable reference target found: logging#logging.Handler.acquire WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.shutdown WARNING: unusable reference target found: logging#logging.Handler.close WARNING: unusable reference target found: logging#logging.Handler.emit WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: logging#logging.handlers.StreamHandler WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.handlers.StreamHandler WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: logging#logging.handlers.StreamHandler.flush WARNING: unusable reference target found: logging#logging.handlers.StreamHandler.flush WARNING: unusable reference target found: logging#logging.handlers.FileHandler WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#logging.handlers.StreamHandler WARNING: unusable reference target found: logging#logging.handlers.FileHandler WARNING: unusable reference target found: logging#logging.handlers.FileHandler.emit WARNING: unusable reference target found: logging#library-config WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.FileHandler WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler WARNING: unusable reference target found: logging#logging.handlers.WatchedFileHandler.emit WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler WARNING: unusable reference target found: logging#logging.handlers.RotatingFileHandler.emit WARNING: unusable reference target found: logging#logging.handlers.TimedRotatingFileHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.TimedRotatingFileHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler.emit WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: logging#logging.handlers.DatagramHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: logging#logging.handlers.DatagramHandler WARNING: unusable reference target found: logging#logging.handlers.SocketHandler WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: logging#logging.handlers.SysLogHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SysLogHandler WARNING: unusable reference target found: logging#logging.handlers.NTEventLogHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.NTEventLogHandler WARNING: unusable reference target found: logging#logging.handlers.SMTPHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.SMTPHandler WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.BufferingHandler WARNING: unusable reference target found: logging#logging.handlers.BufferingHandler.shouldFlush WARNING: unusable reference target found: logging#logging.handlers.BufferingHandler.flush WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler.setTarget WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler.flush WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: logging#logging.handlers.MemoryHandler WARNING: unusable reference target found: logging#logging.handlers.HTTPHandler WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.handlers.HTTPHandler WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: stdtypes#string-formatting WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: time#time.time WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter.formatTime WARNING: unusable reference target found: logging#logging.Formatter.formatException WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter.format WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: traceback#traceback.print_exception WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.Filter WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: sys#sys.exc_info WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: logging#logging.LogRecord WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.LoggerAdapter WARNING: unusable reference target found: logging#logging.debug WARNING: unusable reference target found: logging#logging.info WARNING: unusable reference target found: logging#logging.warning WARNING: unusable reference target found: logging#logging.error WARNING: unusable reference target found: logging#logging.exception WARNING: unusable reference target found: logging#logging.critical WARNING: unusable reference target found: logging#logging.log WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: logging#module-logging.handlers WARNING: unusable reference target found: logging#logging.fileConfig WARNING: unusable reference target found: logging#logging.stopListening WARNING: unusable reference target found: logging#logging.listen WARNING: unusable reference target found: logging#logging.listen WARNING: unusable reference target found: logging#logging.fileConfig WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: functions#eval WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: logging#logging.Formatter WARNING: unusable reference target found: getpass#module-getpass WARNING: unusable reference target found: getpass#getpass.GetPassWarning WARNING: unusable reference target found: exceptions#exceptions.UserWarning WARNING: unusable reference target found: pwd#module-pwd WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: locale#locale.setlocale WARNING: unusable reference target found: stdtypes#str.encode WARNING: unusable reference target found: curses.ascii#module-curses.ascii WARNING: unusable reference target found: curses.panel#module-curses.panel WARNING: unusable reference target found: curses#module-curses.textpad WARNING: unusable reference target found: curses#module-curses.wrapper WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.raw WARNING: unusable reference target found: curses#curses.cbreak WARNING: unusable reference target found: curses#curses.pair_number WARNING: unusable reference target found: curses#curses.reset_prog_mode WARNING: unusable reference target found: curses#curses.reset_shell_mode WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: functions#filter WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.beep WARNING: unusable reference target found: curses#curses.nocbreak WARNING: unusable reference target found: curses#curses.init_color WARNING: unusable reference target found: curses#curses.can_change_color WARNING: unusable reference target found: curses#curses.endwin WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.noqiflush WARNING: unusable reference target found: curses#curses.color_pair WARNING: unusable reference target found: curses#curses.noqiflush WARNING: unusable reference target found: curses#curses.def_prog_mode WARNING: unusable reference target found: curses#curses.def_shell_mode WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.start_color WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#curses.newwin WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: curses#curses.window.border WARNING: unusable reference target found: curses#curses.window.touchline WARNING: unusable reference target found: curses#curses.window.erase WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.clrtoeol WARNING: unusable reference target found: curses#curses.window.derwin WARNING: unusable reference target found: curses#curses.window.subwin WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.instr WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.error WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses#curses.window.overlay WARNING: unusable reference target found: curses#curses.window.overwrite WARNING: unusable reference target found: curses#curses.getwin WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.newpad WARNING: unusable reference target found: curses#curses.window.idlok WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#curses.window.syncup WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#curses.window.getch WARNING: unusable reference target found: curses#curses.window.refresh WARNING: unusable reference target found: curses#module-curses WARNING: unusable reference target found: curses#curses.ERR WARNING: unusable reference target found: curses#curses.napms WARNING: unusable reference target found: curses#curses.OK WARNING: unusable reference target found: curses#curses.initscr WARNING: unusable reference target found: curses#module-curses.textpad WARNING: unusable reference target found: curses#curses.textpad.Textbox WARNING: unusable reference target found: curses#module-curses.textpad WARNING: unusable reference target found: curses#curses.textpad.Textbox WARNING: unusable reference target found: curses#curses.textpad.Textbox.stripspaces WARNING: unusable reference target found: curses#curses.textpad.Textbox WARNING: unusable reference target found: curses#curses.textpad.Textbox.stripspaces WARNING: unusable reference target found: curses#curses.textpad.Textbox.stripspaces WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses#curses.wrapper.wrapper WARNING: unusable reference target found: curses.ascii#module-curses.ascii WARNING: unusable reference target found: functions#ord WARNING: unusable reference target found: string#module-string WARNING: unusable reference target found: curses.panel#module-curses.panel WARNING: unusable reference target found: curses#curses.doupdate WARNING: unusable reference target found: curses.panel#curses.panel.new_panel WARNING: unusable reference target found: platform#platform.system_alias WARNING: unusable reference target found: platform#platform.machine WARNING: unusable reference target found: os#os.uname WARNING: unusable reference target found: platform#platform.popen WARNING: unusable reference target found: platform#platform.linux_distribution WARNING: unusable reference target found: os#os.strerror WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: ctypes#ctypes.c_wchar WARNING: unusable reference target found: ctypes#ctypes.c_byte WARNING: unusable reference target found: ctypes#ctypes.c_ubyte WARNING: unusable reference target found: ctypes#ctypes.c_short WARNING: unusable reference target found: ctypes#ctypes.c_ushort WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_uint WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_ulong WARNING: unusable reference target found: ctypes#ctypes.c_longlong WARNING: unusable reference target found: ctypes#ctypes.c_ulonglong WARNING: unusable reference target found: ctypes#ctypes.c_float WARNING: unusable reference target found: ctypes#ctypes.c_double WARNING: unusable reference target found: ctypes#ctypes.c_longdouble WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_wchar_p WARNING: unusable reference target found: ctypes#ctypes.c_void_p WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_wchar_p WARNING: unusable reference target found: ctypes#ctypes.c_void_p WARNING: unusable reference target found: ctypes#ctypes.GetLastError WARNING: unusable reference target found: ctypes#ctypes.byref WARNING: unusable reference target found: ctypes#ctypes.byref WARNING: unusable reference target found: ctypes#ctypes.Structure WARNING: unusable reference target found: ctypes#ctypes.Union WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.WinDLL WARNING: unusable reference target found: ctypes#ctypes.OleDLL WARNING: unusable reference target found: ctypes#ctypes.CDLL WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: ctypes#ctypes.get_errno WARNING: unusable reference target found: ctypes#ctypes.set_errno WARNING: unusable reference target found: ctypes#ctypes.GetLastError WARNING: unusable reference target found: ctypes#ctypes.get_last_error WARNING: unusable reference target found: ctypes#ctypes.set_last_error WARNING: unusable reference target found: ctypes#ctypes.LibraryLoader WARNING: unusable reference target found: ctypes#ctypes.CDLL WARNING: unusable reference target found: ctypes#ctypes.PyDLL WARNING: unusable reference target found: ctypes#ctypes.WinDLL WARNING: unusable reference target found: ctypes#ctypes.OleDLL WARNING: unusable reference target found: ctypes#ctypes.CDLL WARNING: unusable reference target found: ctypes#ctypes.WinDLL WARNING: unusable reference target found: ctypes#ctypes.OleDLL WARNING: unusable reference target found: ctypes#ctypes.PyDLL WARNING: unusable reference target found: ctypes#ctypes.PyDLL WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.restype WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.errcheck WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.argtypes WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.argtypes WARNING: unusable reference target found: ctypes#ctypes._FuncPtr.restype WARNING: unusable reference target found: ctypes#ctypes.WINFUNCTYPE WARNING: unusable reference target found: ctypes#ctypes.CFUNCTYPE WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: ctypes#ctypes.c_wchar WARNING: unusable reference target found: ctypes#ctypes.FormatError WARNING: unusable reference target found: ctypes#ctypes._CData._objects WARNING: unusable reference target found: ctypes#ctypes._CData._b_base_ WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_char_p WARNING: unusable reference target found: ctypes#ctypes.c_void_p WARNING: unusable reference target found: ctypes#ctypes.c_double WARNING: unusable reference target found: ctypes#ctypes.c_long WARNING: unusable reference target found: ctypes#ctypes.c_byte WARNING: unusable reference target found: ctypes#ctypes.c_short WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.c_longlong WARNING: unusable reference target found: ctypes#ctypes.c_ulong WARNING: unusable reference target found: ctypes#ctypes.c_ubyte WARNING: unusable reference target found: ctypes#ctypes.c_ushort WARNING: unusable reference target found: ctypes#ctypes.c_uint WARNING: unusable reference target found: ctypes#ctypes.c_ulonglong WARNING: unusable reference target found: ctypes#ctypes.HRESULT WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.c_int WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._pack_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes.Structure._fields_ WARNING: unusable reference target found: ctypes#ctypes-pointers WARNING: unusable reference target found: ctypes#ctypes-arrays WARNING: unusable reference target found: select#epoll-objects WARNING: unusable reference target found: select#poll-objects WARNING: unusable reference target found: select#kqueue-objects WARNING: unusable reference target found: select#kevent-objects WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: os#os.popen WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: select#select.poll WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: select#select.poll.register WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: mutex#module-mutex WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: dummy_threading#module-dummy_threading WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.current_thread WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: threading#threading.local WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: sys#sys.settrace WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: sys#sys.setprofile WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.isAlive WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Thread.join WARNING: unusable reference target found: threading#threading.Thread.name WARNING: unusable reference target found: thread#thread.get_ident WARNING: unusable reference target found: threading#threading.Thread.start WARNING: unusable reference target found: threading#threading.Thread.run WARNING: unusable reference target found: functions#enumerate WARNING: unusable reference target found: threading#threading.Thread.daemon WARNING: unusable reference target found: threading#threading.Thread.start WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Condition.notify WARNING: unusable reference target found: threading#threading.Condition.notifyAll WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Condition.release WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: threading#threading.Condition.wait WARNING: unusable reference target found: threading#threading.Condition.notify WARNING: unusable reference target found: threading#threading.Condition.notify WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: threading#threading.Semaphore.release WARNING: unusable reference target found: threading#threading.Semaphore.acquire WARNING: unusable reference target found: threading#threading.Semaphore.release WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: threading#threading.Event.wait WARNING: unusable reference target found: threading#threading.Event.wait WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: stdtypes#set WARNING: unusable reference target found: threading#threading.Timer WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Condition WARNING: unusable reference target found: threading#threading.Semaphore WARNING: unusable reference target found: threading#threading.BoundedSemaphore WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: dummy_thread#module-dummy_thread WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: thread#thread.error WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: sys#sys.exit WARNING: unusable reference target found: exceptions#exceptions.SystemExit WARNING: unusable reference target found: constants#exit WARNING: unusable reference target found: time#time.sleep WARNING: unusable reference target found: stdtypes#file.read WARNING: unusable reference target found: select#select.select WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: dummy_thread#module-dummy_thread WARNING: unusable reference target found: dummy_threading#module-dummy_threading WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: thread#module-thread WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: multiprocessing#multiprocessing-programming WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: multiprocessing#multiprocessing-programming WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.send WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Value WARNING: unusable reference target found: multiprocessing#multiprocessing.Array WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#module-multiprocessing.sharedctypes WARNING: unusable reference target found: functions#list WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: multiprocessing#multiprocessing.Semaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.BoundedSemaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.Condition WARNING: unusable reference target found: multiprocessing#multiprocessing.Event WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Value WARNING: unusable reference target found: multiprocessing#multiprocessing.Array WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: threading#threading.Thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.run WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.run WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.run WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.join WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.authkey WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.start WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.join WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.is_alive WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv_bytes_into WARNING: unusable reference target found: multiprocessing#multiprocessing.BufferTooShort WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.join WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing-managers WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Process.terminate WARNING: unusable reference target found: os#os.kill WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing-programming WARNING: unusable reference target found: multiprocessing#multiprocessing-examples WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#module-Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: queue#Queue.Queue.task_done WARNING: unusable reference target found: queue#Queue.Queue.join WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Full WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: queue#Queue.Empty WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.close WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.cancel_join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.join_thread WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.join WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.get WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: multiprocessing#multiprocessing.Queue.put WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: multiprocessing#multiprocessing.JoinableQueue.task_done WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: threading#threading.current_thread WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: multiprocessing#multiprocessing.freeze_support WARNING: unusable reference target found: sys#sys.executable WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#threading.active_count WARNING: unusable reference target found: threading#threading.enumerate WARNING: unusable reference target found: threading#threading.settrace WARNING: unusable reference target found: threading#threading.setprofile WARNING: unusable reference target found: threading#threading.Timer WARNING: unusable reference target found: threading#threading.local WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing-listeners-clients WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.send WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: exceptions#exceptions.EOFError WARNING: unusable reference target found: multiprocessing#multiprocessing.BufferTooShort WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#multiprocessing.Pipe WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.recv WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection.send WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#multiprocessing-managers WARNING: unusable reference target found: threading#threading.BoundedSemaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.Semaphore WARNING: unusable reference target found: threading#threading.Condition WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#threading.Event WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Semaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.BoundedSemaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: multiprocessing#multiprocessing.Semaphore WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: multiprocessing#module-multiprocessing.sharedctypes WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.Array WARNING: unusable reference target found: array#module-array WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.Value WARNING: unusable reference target found: ctypes#ctypes.c_char WARNING: unusable reference target found: ctypes#module-ctypes WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.RawArray WARNING: unusable reference target found: multiprocessing#multiprocessing.sharedctypes.RawValue WARNING: unusable reference target found: multiprocessing#multiprocessing.RLock WARNING: unusable reference target found: ctypes#ctypes.Structure WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.SyncManager WARNING: unusable reference target found: multiprocessing#module-multiprocessing.managers WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.start WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.serve_forever WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.serve_forever WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.address WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.start WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.from_address WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager WARNING: unusable reference target found: threading#threading.BoundedSemaphore WARNING: unusable reference target found: threading#threading.Condition WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Event WARNING: unusable reference target found: threading#threading.Lock WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.SyncManager.Namespace WARNING: unusable reference target found: queue#Queue.Queue WARNING: unusable reference target found: threading#threading.RLock WARNING: unusable reference target found: threading#threading.Semaphore WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.register WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#repr WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseManager.register WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy._callmethod WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy._callmethod WARNING: unusable reference target found: multiprocessing#multiprocessing.managers.BaseProxy._callmethod WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: functions#apply WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: functions#map WARNING: unusable reference target found: itertools#itertools.imap WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.map WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.imap WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.imap WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.terminate WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.close WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.terminate WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.multiprocessing.Pool.join WARNING: unusable reference target found: multiprocessing#multiprocessing.pool.AsyncResult.get WARNING: unusable reference target found: exceptions#exceptions.AssertionError WARNING: unusable reference target found: multiprocessing#module-multiprocessing.connection WARNING: unusable reference target found: hmac#module-hmac WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing.Connection WARNING: unusable reference target found: multiprocessing#multiprocessing-address-formats WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: multiprocessing#multiprocessing-address-formats WARNING: unusable reference target found: tempfile#tempfile.mkstemp WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing-auth-keys WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.AuthenticationError WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.Client WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.Listener WARNING: unusable reference target found: multiprocessing#multiprocessing.connection.Client WARNING: unusable reference target found: hmac#module-hmac WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: multiprocessing#multiprocessing.Process WARNING: unusable reference target found: os#os.urandom WARNING: unusable reference target found: logging#module-logging WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: sys#sys.stderr WARNING: unusable reference target found: multiprocessing#module-multiprocessing.dummy WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: os#os.fork WARNING: unusable reference target found: exceptions#exceptions.RuntimeError WARNING: unusable reference target found: multiprocessing#module-multiprocessing WARNING: unusable reference target found: threading#module-threading WARNING: unusable reference target found: re#module-re WARNING: unusable reference target found: mmap#mmap.seek WARNING: unusable reference target found: mmap#mmap.mmap WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: mmap#mmap.mmap WARNING: unusable reference target found: mmap#mmap.mmap WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: functions#raw_input WARNING: unusable reference target found: functions#input WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: readline#readline.write_history_file WARNING: unusable reference target found: readline#readline.get_history_length WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: code#code.InteractiveConsole WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: rlcompleter#module-rlcompleter WARNING: unusable reference target found: readline#module-readline WARNING: unusable reference target found: __main__#module-__main__ WARNING: unusable reference target found: __builtin__#module-__builtin__ WARNING: unusable reference target found: keyword#module-keyword WARNING: unusable reference target found: functions#dir WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: os#os.execvp WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.STDOUT WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: subprocess#subprocess.Popen.stdout WARNING: unusable reference target found: subprocess#subprocess.Popen.stdin WARNING: unusable reference target found: subprocess#subprocess.Popen.stderr WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen.returncode WARNING: unusable reference target found: subprocess#subprocess.Popen.returncode WARNING: unusable reference target found: subprocess#subprocess.Popen.communicate WARNING: unusable reference target found: subprocess#subprocess.Popen.communicate WARNING: unusable reference target found: subprocess#subprocess.Popen.terminate WARNING: unusable reference target found: subprocess#subprocess.Popen.kill WARNING: unusable reference target found: subprocess#subprocess.Popen.terminate WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.PIPE WARNING: unusable reference target found: subprocess#subprocess.Popen.poll WARNING: unusable reference target found: subprocess#subprocess.Popen.wait WARNING: unusable reference target found: subprocess#subprocess.Popen.communicate WARNING: unusable reference target found: exceptions#exceptions.OSError WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: subprocess#subprocess.Popen WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: os#os.error WARNING: unusable reference target found: errno#module-errno WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: socket#socket.gethostbyname_ex WARNING: unusable reference target found: socket#socket.gethostbyaddr WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.getnameinfo WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: socket#socket.getdefaulttimeout WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: socket#socket.gethostbyaddr WARNING: unusable reference target found: socket#socket.gethostname WARNING: unusable reference target found: socket#socket.gethostbyname_ex WARNING: unusable reference target found: socket#socket.gethostbyname WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.gethostbyname_ex WARNING: unusable reference target found: socket#socket.getaddrinfo WARNING: unusable reference target found: socket#socket.gethostname WARNING: unusable reference target found: socket#socket.getfqdn WARNING: unusable reference target found: socket#socket.gethostbyaddr WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.SOCK_RAW WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.SOCK_STREAM WARNING: unusable reference target found: socket#socket.SOCK_DGRAM WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.AF_UNIX WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_aton WARNING: unusable reference target found: socket#socket.getnameinfo WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_ntoa WARNING: unusable reference target found: socket#socket.getnameinfo WARNING: unusable reference target found: socket#socket.inet_pton WARNING: unusable reference target found: socket#socket.inet_aton WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_ntop WARNING: unusable reference target found: socket#socket.inet_ntoa WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET6 WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.inet_ntop WARNING: unusable reference target found: socketserver#module-SocketServer WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: socket#socket.AF_INET WARNING: unusable reference target found: select#select.select WARNING: unusable reference target found: os#os.fdopen WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: socket#socket.socket.ioctl WARNING: unusable reference target found: stdtypes#bltin-file-objects WARNING: unusable reference target found: functions#file WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.send WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.recv WARNING: unusable reference target found: socket#socket.socket.send WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: socket#socket.timeout WARNING: unusable reference target found: socket#socket.socket.setblocking WARNING: unusable reference target found: socket#socket.socket.settimeout WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: struct#module-struct WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.error WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: ssl#ssl.wrap_socket WARNING: unusable reference target found: ssl#ssl.SSLError WARNING: unusable reference target found: ssl#ssl-certificates WARNING: unusable reference target found: ssl#ssl.CERT_NONE WARNING: unusable reference target found: ssl#ssl.CERT_OPTIONAL WARNING: unusable reference target found: ssl#ssl.CERT_REQUIRED WARNING: unusable reference target found: ssl#ssl.CERT_NONE WARNING: unusable reference target found: ssl#ssl-certificates WARNING: unusable reference target found: ssl#ssl.SSLSocket.do_handshake WARNING: unusable reference target found: ssl#ssl.SSLSocket.do_handshake WARNING: unusable reference target found: ssl#ssl.SSLSocket.read WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: ssl#ssl.RAND_egd WARNING: unusable reference target found: ssl#ssl.RAND_add WARNING: unusable reference target found: ssl#ssl.wrap_socket WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: ssl#ssl.CERT_OPTIONAL WARNING: unusable reference target found: ssl#ssl.CERT_REQUIRED WARNING: unusable reference target found: ssl#ssl.CERT_NONE WARNING: unusable reference target found: ssl#ssl.SSLError WARNING: unusable reference target found: ssl#ssl.wrap_socket WARNING: unusable reference target found: socket#socket.socket WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: exceptions#exceptions.KeyboardInterrupt WARNING: unusable reference target found: signal#signal.signal WARNING: unusable reference target found: signal#signal.alarm WARNING: unusable reference target found: signal#signal.getsignal WARNING: unusable reference target found: signal#signal.pause WARNING: unusable reference target found: signal#signal.setitimer WARNING: unusable reference target found: signal#signal.getitimer WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#signal.setitimer WARNING: unusable reference target found: signal#signal.getitimer WARNING: unusable reference target found: signal#signal.setitimer WARNING: unusable reference target found: exceptions#exceptions.IOError WARNING: unusable reference target found: signal#module-signal WARNING: unusable reference target found: signal#signal.SIG_IGN WARNING: unusable reference target found: signal#signal.SIG_DFL WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: signal#signal.SIG_IGN WARNING: unusable reference target found: signal#signal.SIG_DFL WARNING: unusable reference target found: signal#signal.ITIMER_REAL WARNING: unusable reference target found: signal#signal.ITIMER_VIRTUAL WARNING: unusable reference target found: signal#signal.ITIMER_PROF WARNING: unusable reference target found: signal#signal.alarm WARNING: unusable reference target found: signal#signal.ITIMER_REAL WARNING: unusable reference target found: signal#signal.ITIMER_VIRTUAL WARNING: unusable reference target found: signal#signal.ITIMER_PROF WARNING: unusable reference target found: signal#signal.ItimerError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: signal#signal.signal WARNING: unusable reference target found: signal#signal.SIG_IGN WARNING: unusable reference target found: signal#signal.SIG_DFL WARNING: unusable reference target found: signal#signal.getsignal WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: inspect#module-inspect WARNING: unusable reference target found: signal#signal.alarm WARNING: unusable reference target found: os#os.open WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#subprocess-replacements WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: popen2#module-popen2 WARNING: unusable reference target found: os#os.spawnv WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: popen2#popen2.popen2 WARNING: unusable reference target found: popen2#popen2.popen3 WARNING: unusable reference target found: popen2#popen2.popen4 WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: popen2#module-popen2 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.popen2 WARNING: unusable reference target found: popen2#popen2.popen3 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.popen4 WARNING: unusable reference target found: popen2#popen2.Popen3 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: popen2#popen2.Popen3.wait WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os-process WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: popen2#popen2.Popen4 WARNING: unusable reference target found: os#module-os WARNING: unusable reference target found: os#os.close WARNING: unusable reference target found: subprocess#module-subprocess WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: asynchat#module-asynchat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.loop WARNING: unusable reference target found: asyncore#asyncore.loop WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#asyncore.dispatcher.readable WARNING: unusable reference target found: asyncore#asyncore.dispatcher.writable WARNING: unusable reference target found: asyncore#asyncore.dispatcher.connect WARNING: unusable reference target found: socket#module-socket WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#asyncore.file_wrapper WARNING: unusable reference target found: os#os.dup WARNING: unusable reference target found: asyncore#asyncore.file_dispatcher WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: asynchat#module-asynchat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#module-asyncore WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat.collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asyncore#asyncore.dispatcher WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat.handle_write WARNING: unusable reference target found: asynchat#asynchat.async_chat.set_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: asynchat#asynchat.async_chat.collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: asynchat#asynchat.async_chat._get_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.set_terminator WARNING: unusable reference target found: exceptions#exceptions.NotImplementedError WARNING: unusable reference target found: asynchat#asynchat.async_chat._collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.set_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.handle_read WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.collect_incoming_data WARNING: unusable reference target found: asynchat#asynchat.async_chat.refill_buffer WARNING: unusable reference target found: asynchat#asynchat.simple_producer WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.async_chat.found_terminator WARNING: unusable reference target found: asynchat#asynchat.simple_producer WARNING: unusable reference target found: asynchat#asynchat.simple_producer.more WARNING: unusable reference target found: asynchat#asynchat.fifo WARNING: unusable reference target found: asynchat#asynchat.fifo WARNING: unusable reference target found: asynchat#asynchat.fifo.push WARNING: unusable reference target found: asynchat#module-asynchat WARNING: unusable reference target found: asynchat#asynchat.async_chat WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message.set_payload WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: email.message#email.message.Message.get_payload WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: exceptions#exceptions.IndexError WARNING: unusable reference target found: email.message#email.message.Message.is_multipart WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.message#email.message.Message.set_charset WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.message#email.message.Message.keys WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: email.message#email.message.Message.get_all WARNING: unusable reference target found: email.message#email.message.Message.__getitem__ WARNING: unusable reference target found: email.message#email.message.Message.__setitem__ WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: email.message#email.message.Message.get_default_type WARNING: unusable reference target found: email.message#email.message.Message.get_content_type WARNING: unusable reference target found: email.message#email.message.Message.get_content_type WARNING: unusable reference target found: email.message#email.message.Message.get_content_type WARNING: unusable reference target found: email.message#email.message.Message.get_param WARNING: unusable reference target found: email.message#email.message.Message.get_param WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: email.message#email.message.Message.set_boundary WARNING: unusable reference target found: email.message#email.message.Message.add_header WARNING: unusable reference target found: email.message#email.message.Message.set_boundary WARNING: unusable reference target found: email.message#email.message.Message.get_charset WARNING: unusable reference target found: email.message#email.message.Message.walk WARNING: unusable reference target found: email.message#email.message.Message.walk WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.message#email.message.Message WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.FeedParser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.Parser WARNING: unusable reference target found: email.parser#email.parser.Parser.parse WARNING: unusable reference target found: email.parser#email.parser.Parser.parse WARNING: unusable reference target found: email.parser#email.parser.Parser.parse WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.parser#module-email.parser WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator.write WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.generator#email.generator.DecodedGenerator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email.generator#email.generator.Generator WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.mime#email.mime.base.MIMEBase WARNING: unusable reference target found: email.mime#email.mime.base.MIMEBase WARNING: unusable reference target found: email.mime#email.mime.base.MIMEBase WARNING: unusable reference target found: email.mime#email.mime.application.MIMEApplication WARNING: unusable reference target found: email.mime#email.mime.application.MIMEApplication WARNING: unusable reference target found: email.encoders#module-email.encoders WARNING: unusable reference target found: email.mime#email.mime.audio.MIMEAudio WARNING: unusable reference target found: sndhdr#module-sndhdr WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.mime#email.mime.audio.MIMEAudio WARNING: unusable reference target found: email.encoders#module-email.encoders WARNING: unusable reference target found: email.mime#email.mime.image.MIMEImage WARNING: unusable reference target found: imghdr#module-imghdr WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.mime#email.mime.image.MIMEImage WARNING: unusable reference target found: email.encoders#module-email.encoders WARNING: unusable reference target found: email.mime#email.mime.message.MIMEMessage WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.mime#email.mime.text.MIMEText WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.header#email.header.Header.append WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header.encode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.decode_header WARNING: unusable reference target found: email.header#email.header.decode_header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.header#email.header.Header WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.header#module-email.header WARNING: unusable reference target found: email.charset#email.charset.Charset.header_encode WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset.__str__ WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#email.charset.Charset WARNING: unusable reference target found: email.charset#module-email.charset WARNING: unusable reference target found: email.charset#email.charset.Charset.convert WARNING: unusable reference target found: email.charset#email.charset.add_codec WARNING: unusable reference target found: codecs#module-codecs WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.encoders#email.encoders.encode_quopri WARNING: unusable reference target found: email.errors#module-email.errors WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: email.errors#email.errors.MessageError WARNING: unusable reference target found: email.errors#email.errors.MessageParseError WARNING: unusable reference target found: email.errors#email.errors.MessageParseError WARNING: unusable reference target found: email.errors#email.errors.MultipartConversionError WARNING: unusable reference target found: email.errors#email.errors.MessageError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: email.util#module-email.utils WARNING: unusable reference target found: email.util#email.utils.parseaddr WARNING: unusable reference target found: email.util#email.utils.parsedate WARNING: unusable reference target found: email.util#email.utils.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: email.util#email.utils.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: email.util#email.utils.parsedate_tz WARNING: unusable reference target found: email.util#email.utils.mktime_tz WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: time#time.localtime WARNING: unusable reference target found: email.util#email.utils.collapse_rfc2231_value WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: email.util#email.utils.collapse_rfc2231_value WARNING: unusable reference target found: email.util#email.utils.formataddr WARNING: unusable reference target found: email.iterators#module-email.iterators WARNING: unusable reference target found: email.iterators#email.iterators.typed_subpart_iterator WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: smtplib#module-smtplib WARNING: unusable reference target found: nntplib#module-nntplib WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.message#module-email.message WARNING: unusable reference target found: email.mime#module-email.mime WARNING: unusable reference target found: email.mime#module-email.mime WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: exceptions#exceptions.DeprecationWarning WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.message_from_file WARNING: unusable reference target found: email.parser#email.message_from_string WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: email.parser#email.message_from_string WARNING: unusable reference target found: email.parser#email.message_from_file WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: email.iterators#module-email.iterators WARNING: unusable reference target found: email.generator#module-email.generator WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: email.util#module-email.utils WARNING: unusable reference target found: email.iterators#module-email.iterators WARNING: unusable reference target found: json#module-json WARNING: unusable reference target found: marshal#module-marshal WARNING: unusable reference target found: pickle#module-pickle WARNING: unusable reference target found: json#json.JSONEncoder WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#int WARNING: unusable reference target found: functions#long WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#bool WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: codecs#codecs.getwriter WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: json#json.JSONEncoder WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.dump WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.loads WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: json#json.JSONDecoder WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.dump WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: stdtypes#dict WARNING: unusable reference target found: decimal#decimal.Decimal WARNING: unusable reference target found: functions#float WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: functions#unicode WARNING: unusable reference target found: json#json.JSONEncoder.default WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: exceptions#exceptions.OverflowError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: os#os.system WARNING: unusable reference target found: mailcap#mailcap.findmatch WARNING: unusable reference target found: mailcap#mailcap.findmatch WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.add WARNING: unusable reference target found: mailbox#mailbox.Mailbox.remove WARNING: unusable reference target found: mailbox#mailbox.Mailbox.discard WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.lock WARNING: unusable reference target found: mailbox#mailbox.Mailbox.unlock WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.remove WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__delitem__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.discard WARNING: unusable reference target found: mailbox#mailbox.Mailbox.discard WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.add WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.iterkeys WARNING: unusable reference target found: mailbox#mailbox.Mailbox.keys WARNING: unusable reference target found: mailbox#mailbox.Mailbox.itervalues WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__iter__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.values WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__iter__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.iteritems WARNING: unusable reference target found: mailbox#mailbox.Mailbox.items WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.get WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__getitem__ WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__setitem__ WARNING: unusable reference target found: mailbox#mailbox.Mailbox.__setitem__ WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox.flush WARNING: unusable reference target found: mailbox#mailbox.ExternalClashError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.NoSuchMailboxError WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.NotEmptyError WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.mbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.NoSuchMailboxError WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.NotEmptyError WARNING: unusable reference target found: mailbox#mailbox.MH.get_sequences WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#mailbox.MH.unlock WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Babyl WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Babyl WARNING: unusable reference target found: stringio#module-StringIO WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MMDF WARNING: unusable reference target found: mailbox#mailbox.MMDF WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.Message WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: time#time.strftime WARNING: unusable reference target found: time#time.gmtime WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MaildirMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MHMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.BabylMessage WARNING: unusable reference target found: mailbox#mailbox.MMDFMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#mailbox.mboxMessage WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: mailbox#mailbox.Mailbox WARNING: unusable reference target found: mailbox#mailbox.MH WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: mailbox#mailbox.Maildir WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.PortableUnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: mailbox#mailbox.BabylMailbox WARNING: unusable reference target found: mailbox#mailbox.UnixMailbox WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mhlib#module-mhlib WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: mhlib#module-mhlib WARNING: unusable reference target found: mhlib#mhlib.MH WARNING: unusable reference target found: mhlib#mhlib.Folder WARNING: unusable reference target found: mhlib#mhlib.Message WARNING: unusable reference target found: mhlib#mhlib.MH WARNING: unusable reference target found: mhlib#mhlib.Folder WARNING: unusable reference target found: mhlib#mhlib.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: mhlib#mhlib.MH WARNING: unusable reference target found: mhlib#mhlib.Folder WARNING: unusable reference target found: mhlib#mhlib.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mimetools#mimetools.decode WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: mimetools#mimetools.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: mimetools#mimetools.Message.getplist WARNING: unusable reference target found: mimetools#mimetools.Message.getplist WARNING: unusable reference target found: mimetypes#module-mimetypes WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.knownfiles WARNING: unusable reference target found: mimetypes#mimetypes.knownfiles WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.init WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes.read WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes.readfp WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes WARNING: unusable reference target found: mimetypes#module-mimetypes WARNING: unusable reference target found: mimetypes#mimetypes.guess_extension WARNING: unusable reference target found: mimetypes#mimetypes.guess_type WARNING: unusable reference target found: mimetypes#mimetypes.MimeTypes.readfp WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimewriter#module-MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.addheader WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.startbody WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.nextpart WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.startmultipartbody WARNING: unusable reference target found: mimewriter#MimeWriter.MimeWriter.nextpart WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: mimify#module-mimify WARNING: unusable reference target found: mimify#module-mimify WARNING: unusable reference target found: mimify#mimify.MAXLEN WARNING: unusable reference target found: mimify#mimify.CHARSET WARNING: unusable reference target found: quopri#module-quopri WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: functions#open WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile.readline WARNING: unusable reference target found: multifile#multifile.MultiFile.seek WARNING: unusable reference target found: multifile#multifile.MultiFile.tell WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile.seek WARNING: unusable reference target found: multifile#multifile.MultiFile.tell WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: multifile#module-multifile WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: multifile#multifile.MultiFile.pop WARNING: unusable reference target found: functions#next WARNING: unusable reference target found: multifile#multifile.MultiFile WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message.rewindbody WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.parseaddr WARNING: unusable reference target found: rfc822#rfc822.parsedate WARNING: unusable reference target found: rfc822#rfc822.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.parsedate WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.parsedate_tz WARNING: unusable reference target found: email#module-email WARNING: unusable reference target found: rfc822#module-rfc822 WARNING: unusable reference target found: mailbox#module-mailbox WARNING: unusable reference target found: mimetools#module-mimetools WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message.getheader WARNING: unusable reference target found: rfc822#rfc822.Message.getheader WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.Message.getheader WARNING: unusable reference target found: time#time.mktime WARNING: unusable reference target found: rfc822#rfc822.Message.getdate WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: exceptions#exceptions.KeyError WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.Message WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList.__add__ WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: rfc822#rfc822.AddressList.__sub__ WARNING: unusable reference target found: rfc822#rfc822.AddressList WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: base64#base64.encode WARNING: unusable reference target found: base64#base64.encodestring WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binhex#module-binhex WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binhex#binhex.hexbin WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: uu#module-uu WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: binhex#module-binhex WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: binascii#binascii.Incomplete WARNING: unusable reference target found: binascii#binascii.b2a_hex WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: binhex#module-binhex WARNING: unusable reference target found: uu#module-uu WARNING: unusable reference target found: quopri#module-quopri WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: quopri#quopri.decode WARNING: unusable reference target found: quopri#quopri.encode WARNING: unusable reference target found: quopri#quopri.encode WARNING: unusable reference target found: mimify#module-mimify WARNING: unusable reference target found: base64#module-base64 WARNING: unusable reference target found: uu#module-uu WARNING: unusable reference target found: uu#uu.Error WARNING: unusable reference target found: uu#uu.decode WARNING: unusable reference target found: exceptions#exceptions.Exception WARNING: unusable reference target found: uu#uu.decode WARNING: unusable reference target found: binascii#module-binascii WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: htmlparser#module-HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.close WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.close WARNING: unusable reference target found: htmllib#module-htmlentitydefs WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.handle_starttag WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.handle_starttag WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser.handle_endtag WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: htmlparser#HTMLParser.HTMLParser WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmlparser#module-HTMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.close WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.close WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_charref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_data WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_charref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_codepoint WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_charref WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_entityref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_data WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.convert_entityref WARNING: unusable reference target found: functions#str WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_entityref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_charref WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_starttag WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser.handle_starttag WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: formatter#module-formatter WARNING: unusable reference target found: sgmllib#sgmllib.SGMLParser WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: formatter#module-formatter WARNING: unusable reference target found: htmlparser#module-HTMLParser WARNING: unusable reference target found: htmllib#module-htmlentitydefs WARNING: unusable reference target found: sgmllib#module-sgmllib WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: htmllib#htmllib.HTMLParser WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_end WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.anchor_bgn WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_end WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_bgn WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_end WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_bgn WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.nofill WARNING: unusable reference target found: htmllib#htmllib.HTMLParser.save_bgn WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: htmllib#module-htmlentitydefs WARNING: unusable reference target found: htmllib#module-htmllib WARNING: unusable reference target found: htmllib#htmlentitydefs.entitydefs WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: pyexpat#expaterror-objects WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ParserCreate WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.NotationDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.UnparsedEntityDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.SetBase WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.SetBase WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ordered_attributes WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.returns_unicode WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.specified_attributes WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: constants#None WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ExternalEntityRefHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartDoctypeDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndDoctypeDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.Parse WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ParseFile WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.buffer_text WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.CharacterDataHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.buffer_text WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.buffer_text WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.returns_unicode WARNING: unusable reference target found: constants#False WARNING: unusable reference target found: constants#True WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ErrorString WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.returns_unicode WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartCdataSectionHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndCdataSectionHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.ElementDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EntityDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartElementHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.StartNamespaceDeclHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndElementHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.EndCdataSectionHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.DefaultHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.SetBase WARNING: unusable reference target found: pyexpat#xml.parsers.expat.xmlparser.DefaultHandler WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: pyexpat#xml.parsers.expat.ExpatError WARNING: unusable reference target found: pyexpat#module-xml.parsers.expat WARNING: unusable reference target found: xml.dom#xml.dom.getDOMImplementation WARNING: unusable reference target found: xml.dom#dom-conformance WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: exceptions#exceptions.ImportError WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom#dom-implementation-objects WARNING: unusable reference target found: xml.dom#dom-node-objects WARNING: unusable reference target found: xml.dom#dom-nodelist-objects WARNING: unusable reference target found: xml.dom#dom-documenttype-objects WARNING: unusable reference target found: xml.dom#dom-document-objects WARNING: unusable reference target found: xml.dom#dom-element-objects WARNING: unusable reference target found: xml.dom#dom-attr-objects WARNING: unusable reference target found: xml.dom#dom-comment-objects WARNING: unusable reference target found: xml.dom#dom-text-objects WARNING: unusable reference target found: xml.dom#dom-pi-objects WARNING: unusable reference target found: xml.dom#xml.dom.DOMImplementation.createDocumentType WARNING: unusable reference target found: xml.dom#xml.dom.Node.previousSibling WARNING: unusable reference target found: xml.dom#xml.dom.Node.nodeName WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: exceptions#exceptions.ValueError WARNING: unusable reference target found: functions#len WARNING: unusable reference target found: xml.dom#xml.dom.NotFoundErr WARNING: unusable reference target found: xml.dom#xml.dom.NotFoundErr WARNING: unusable reference target found: xml.dom#xml.dom.InuseAttributeErr WARNING: unusable reference target found: xml.dom#xml.dom.InuseAttributeErr WARNING: unusable reference target found: xml.dom#xml.dom.DOMException WARNING: unusable reference target found: xml.dom#xml.dom.DOMException WARNING: unusable reference target found: xml.dom#xml.dom.DomstringSizeErr WARNING: unusable reference target found: xml.dom#xml.dom.HierarchyRequestErr WARNING: unusable reference target found: xml.dom#xml.dom.IndexSizeErr WARNING: unusable reference target found: xml.dom#xml.dom.InuseAttributeErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidAccessErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidCharacterErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidModificationErr WARNING: unusable reference target found: xml.dom#xml.dom.InvalidStateErr WARNING: unusable reference target found: xml.dom#xml.dom.NamespaceErr WARNING: unusable reference target found: xml.dom#xml.dom.NotFoundErr WARNING: unusable reference target found: xml.dom#xml.dom.NotSupportedErr WARNING: unusable reference target found: xml.dom#xml.dom.NoDataAllowedErr WARNING: unusable reference target found: xml.dom#xml.dom.NoModificationAllowedErr WARNING: unusable reference target found: xml.dom#xml.dom.SyntaxErr WARNING: unusable reference target found: xml.dom#xml.dom.WrongDocumentErr WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parse WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parseString WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parse WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parse WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.parseString WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom#module-xml.dom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: exceptions#exceptions.UnicodeError WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.Node.writexml WARNING: unusable reference target found: xml.dom.minidom#xml.dom.minidom.Node.writexml WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: exceptions#exceptions.TypeError WARNING: unusable reference target found: exceptions#exceptions.AttributeError WARNING: unusable reference target found: xml.dom.minidom#module-xml.dom.minidom WARNING: unusable reference target found: xml.dom.pulldom#module-xml.dom.pulldom WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler WARNING: unusable reference target found: xml.dom.pulldom#xml.dom.pulldom.parse WARNING: unusable reference target found: xml.dom.pulldom#xml.dom.pulldom.parse WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: xml.sax#xml.sax.SAXParseException WARNING: unusable reference target found: xml.sax#xml.sax.parse WARNING: unusable reference target found: xml.sax.reader#module-xml.sax.xmlreader WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: xml.sax#module-xml.sax WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.utils#module-xml.sax.saxutils WARNING: unusable reference target found: xml.sax.reader#module-xml.sax.xmlreader WARNING: unusable reference target found: xml.sax#xml.sax.SAXException WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.setDocumentLocator WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startElement WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endElement WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startPrefixMapping WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endElement WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.endPrefixMapping WARNING: unusable reference target found: xml.sax.reader#attributes-objects WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startElement WARNING: unusable reference target found: xml.sax.reader#attributes-ns-objects WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.ContentHandler.startElementNS WARNING: unusable reference target found: xml.sax.handler#xml.sax.handler.DTDHandler WARNING: unusable reference target found: xml.sax.utils#module-xml.sax.saxutils WARNING: unusable reference target found: xml.sax.utils#xml.sax.saxutils.escape WARNING: unusable reference target found: xml.sax.utils#xml.sax.saxutils.quoteattr WARNING: unusable reference target found: xml.sax.utils#xml.sax.saxutils.XMLGenerator WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax#xml.sax.make_parser WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader.parse WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#attributes-objects WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.AttributesImpl WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.AttributesImpl WARNING: unusable reference target found: xml.sax.reader#attributes-ns-objects WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.InputSource WARNING: unusable reference target found: xml.sax.reader#xml.sax.xmlreader.XMLReader.parse WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler WARNING: unusable reference target found: xml.sax.handler#module-xml.sax.handler make[1]: *** [build] Killed make[1]: Leaving directory `/home/neal/python/r26/Doc' make: *** [dist] Error 2 From python-checkins at python.org Sat Jan 24 11:33:25 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Sat, 24 Jan 2009 11:33:25 +0100 (CET) Subject: [Python-checkins] r68882 - python/branches/py3k/Python/import.c Message-ID: <20090124103325.9F2BC1E4002@bag.python.org> Author: kristjan.jonsson Date: Sat Jan 24 11:33:25 2009 New Revision: 68882 Log: Issue 3677: Release the path string on py3k Modified: python/branches/py3k/Python/import.c Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Sat Jan 24 11:33:25 2009 @@ -3255,6 +3255,7 @@ * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. */ rv = GetFileAttributesA(path); + PyMem_Free(path); if (rv != INVALID_FILE_ATTRIBUTES) { /* it exists */ if (rv & FILE_ATTRIBUTE_DIRECTORY) { From python-checkins at python.org Sat Jan 24 11:50:45 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Sat, 24 Jan 2009 11:50:45 +0100 (CET) Subject: [Python-checkins] r68883 - python/branches/py3k/Lib/test/test_import.py Message-ID: <20090124105045.87D7F1E4002@bag.python.org> Author: kristjan.jonsson Date: Sat Jan 24 11:50:45 2009 New Revision: 68883 Log: Add a test for UNC import paths, see issue 3677 Modified: python/branches/py3k/Lib/test/test_import.py Modified: python/branches/py3k/Lib/test/test_import.py ============================================================================== --- python/branches/py3k/Lib/test/test_import.py (original) +++ python/branches/py3k/Lib/test/test_import.py Sat Jan 24 11:50:45 2009 @@ -346,6 +346,27 @@ self.assertEqual(mod.testdata, 'test_trailing_slash') unload("test_trailing_slash") + # http://bugs.python.org/issue3677 + def _test_UNC_path(self): + f = open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') + f.write("testdata = 'test_trailing_slash'") + f.close() + #create the UNC path, like \\myhost\c$\foo\bar + path = os.path.abspath(self.path) + import socket + hn = socket.gethostname() + drive = path[0] + unc = "\\\\%s\\%s$"%(hn, drive) + unc += path[2:] + sys.path.append(path) + mod = __import__("test_trailing_slash") + self.assertEqual(mod.testdata, 'test_trailing_slash') + unload("test_trailing_slash") + + if sys.platform == "win32": + test_UNC_path = _test_UNC_path + + class RelativeImport(unittest.TestCase): def tearDown(self): try: From python-checkins at python.org Sat Jan 24 11:52:27 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Sat, 24 Jan 2009 11:52:27 +0100 (CET) Subject: [Python-checkins] r68884 - python/trunk/Lib/test/test_import.py Message-ID: <20090124105227.0AC591E400C@bag.python.org> Author: kristjan.jonsson Date: Sat Jan 24 11:52:26 2009 New Revision: 68884 Log: Add a test for UNC import paths, see issue 3677 Modified: python/trunk/Lib/test/test_import.py Modified: python/trunk/Lib/test/test_import.py ============================================================================== --- python/trunk/Lib/test/test_import.py (original) +++ python/trunk/Lib/test/test_import.py Sat Jan 24 11:52:26 2009 @@ -344,6 +344,27 @@ self.assertEqual(mod.testdata, 'test_trailing_slash') unload("test_trailing_slash") + # http://bugs.python.org/issue3677 + def _test_UNC_path(self): + f = open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') + f.write("testdata = 'test_trailing_slash'") + f.close() + #create the UNC path, like \\myhost\c$\foo\bar + path = os.path.abspath(self.path) + import socket + hn = socket.gethostname() + drive = path[0] + unc = "\\\\%s\\%s$"%(hn, drive) + unc += path[2:] + sys.path.append(path) + mod = __import__("test_trailing_slash") + self.assertEqual(mod.testdata, 'test_trailing_slash') + unload("test_trailing_slash") + + if sys.platform == "win32": + test_UNC_path = _test_UNC_path + + class RelativeImport(unittest.TestCase): def tearDown(self): try: From buildbot at python.org Sat Jan 24 12:13:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 11:13:48 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.x Message-ID: <20090124111348.2F5D41E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.x/builds/172 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: kristjan.jonsson 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 Jan 24 12:15:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 11:15:25 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090124111525.E3C7A1E4002@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/87 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 test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 24 13:53:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 12:53:18 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090124125318.847EE1E4002@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/164 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: kristjan.jonsson 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 Sat Jan 24 15:00:47 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 15:00:47 +0100 (CET) Subject: [Python-checkins] r68885 - in python/trunk: Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/zipfile.py Misc/NEWS Message-ID: <20090124140047.8C6F31E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 15:00:33 2009 New Revision: 68885 Log: Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. Added: python/trunk/Lib/test/zipdir.zip (contents, props changed) Modified: python/trunk/Lib/test/test_zipfile.py python/trunk/Lib/zipfile.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/test/test_zipfile.py ============================================================================== --- python/trunk/Lib/test/test_zipfile.py (original) +++ python/trunk/Lib/test/test_zipfile.py Sat Jan 24 15:00:33 2009 @@ -11,9 +11,10 @@ from random import randint, random import test.test_support as support -from test.test_support import TESTFN, run_unittest +from test.test_support import TESTFN, run_unittest, findfile TESTFN2 = TESTFN + "2" +TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), @@ -1011,6 +1012,28 @@ def tearDown(self): os.remove(TESTFN2) +class TestWithDirectory(unittest.TestCase): + def setUp(self): + os.mkdir(TESTFN2) + + def testExtractDir(self): + zipf = zipfile.ZipFile(findfile("zipdir.zip")) + zipf.extractall(TESTFN2) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a"))) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) + self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + + def testStoreDir(self): + os.mkdir(os.path.join(TESTFN2, "x")) + zipf = zipfile.ZipFile(TESTFN, "w") + zipf.write(os.path.join(TESTFN2, "x"), "x") + self.assertTrue(zipf.filelist[0].filename.endswith("x/")) + + def tearDown(self): + shutil.rmtree(TESTFN2) + if os.path.exists(TESTFN): + os.remove(TESTFN) + class UniversalNewlineTests(unittest.TestCase): def setUp(self): @@ -1119,6 +1142,7 @@ def test_main(): run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests, PyZipFileTests, DecryptionTests, TestsWithMultipleOpens, + TestWithDirectory, UniversalNewlineTests, TestsWithRandomBinaryFiles) if __name__ == "__main__": Added: python/trunk/Lib/test/zipdir.zip ============================================================================== Binary file. No diff available. Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Sat Jan 24 15:00:33 2009 @@ -2,7 +2,7 @@ Read and write ZIP files. """ import struct, os, time, sys, shutil -import binascii, cStringIO +import binascii, cStringIO, stat try: import zlib # We may need its compression method @@ -952,11 +952,11 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] == "/": + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present - if os.path.isabs(member.filename): + if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) @@ -968,6 +968,10 @@ if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) + if member.filename[-1] == '/': + os.mkdir(targetpath) + return targetpath + source = self.open(member, pwd=pwd) target = file(targetpath, "wb") shutil.copyfileobj(source, target) @@ -1007,6 +1011,7 @@ "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) + isdir = stat.S_ISDIR(st.st_mode) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information @@ -1015,6 +1020,8 @@ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] + if isdir: + arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes if compress_type is None: @@ -1028,6 +1035,16 @@ self._writecheck(zinfo) self._didModify = True + + if isdir: + zinfo.file_size = 0 + zinfo.compress_size = 0 + zinfo.CRC = 0 + self.filelist.append(zinfo) + self.NameToInfo[zinfo.filename] = zinfo + self.fp.write(zinfo.FileHeader()) + return + fp = open(filename, "rb") # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 24 15:00:33 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue #4710: Extract directories properly in the zipfile module; + allow adding directories to a zipfile. + - 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 Sat Jan 24 15:04:36 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 15:04:36 +0100 (CET) Subject: [Python-checkins] r68886 - in python/branches/release26-maint: Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/zipfile.py Misc/NEWS Message-ID: <20090124140436.4E42E1E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 15:04:33 2009 New Revision: 68886 Log: Merged revisions 68885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68885 | martin.v.loewis | 2009-01-24 15:00:33 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. ........ Added: python/branches/release26-maint/Lib/test/zipdir.zip - copied unchanged from r68885, /python/trunk/Lib/test/zipdir.zip Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_zipfile.py python/branches/release26-maint/Lib/zipfile.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/test/test_zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_zipfile.py (original) +++ python/branches/release26-maint/Lib/test/test_zipfile.py Sat Jan 24 15:04:33 2009 @@ -11,9 +11,10 @@ from random import randint, random import test.test_support as support -from test.test_support import TESTFN, run_unittest +from test.test_support import TESTFN, run_unittest, findfile TESTFN2 = TESTFN + "2" +TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), @@ -982,6 +983,28 @@ def tearDown(self): os.remove(TESTFN2) +class TestWithDirectory(unittest.TestCase): + def setUp(self): + os.mkdir(TESTFN2) + + def testExtractDir(self): + zipf = zipfile.ZipFile(findfile("zipdir.zip")) + zipf.extractall(TESTFN2) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a"))) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) + self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + + def testStoreDir(self): + os.mkdir(os.path.join(TESTFN2, "x")) + zipf = zipfile.ZipFile(TESTFN, "w") + zipf.write(os.path.join(TESTFN2, "x"), "x") + self.assertTrue(zipf.filelist[0].filename.endswith("x/")) + + def tearDown(self): + shutil.rmtree(TESTFN2) + if os.path.exists(TESTFN): + os.remove(TESTFN) + class UniversalNewlineTests(unittest.TestCase): def setUp(self): @@ -1090,6 +1113,7 @@ def test_main(): run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests, PyZipFileTests, DecryptionTests, TestsWithMultipleOpens, + TestWithDirectory, UniversalNewlineTests, TestsWithRandomBinaryFiles) if __name__ == "__main__": Modified: python/branches/release26-maint/Lib/zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/zipfile.py (original) +++ python/branches/release26-maint/Lib/zipfile.py Sat Jan 24 15:04:33 2009 @@ -2,7 +2,7 @@ Read and write ZIP files. """ import struct, os, time, sys, shutil -import binascii, cStringIO +import binascii, cStringIO, stat try: import zlib # We may need its compression method @@ -940,11 +940,11 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] == "/": + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present - if os.path.isabs(member.filename): + if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) @@ -956,6 +956,10 @@ if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) + if member.filename[-1] == '/': + os.mkdir(targetpath) + return targetpath + source = self.open(member, pwd=pwd) target = file(targetpath, "wb") shutil.copyfileobj(source, target) @@ -995,6 +999,7 @@ "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) + isdir = stat.S_ISDIR(st.st_mode) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information @@ -1003,6 +1008,8 @@ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] + if isdir: + arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes if compress_type is None: @@ -1016,6 +1023,16 @@ self._writecheck(zinfo) self._didModify = True + + if isdir: + zinfo.file_size = 0 + zinfo.compress_size = 0 + zinfo.CRC = 0 + self.filelist.append(zinfo) + self.NameToInfo[zinfo.filename] = zinfo + self.fp.write(zinfo.FileHeader()) + return + fp = open(filename, "rb") # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 24 15:04:33 2009 @@ -76,6 +76,9 @@ Library ------- +- Issue #4710: Extract directories properly in the zipfile module; + allow adding directories to a zipfile. + - Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the From python-checkins at python.org Sat Jan 24 15:10:31 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 15:10:31 +0100 (CET) Subject: [Python-checkins] r68887 - in python/branches/py3k: Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/zipfile.py Misc/NEWS Message-ID: <20090124141031.592881E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 15:10:07 2009 New Revision: 68887 Log: Merged revisions 68885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68885 | martin.v.loewis | 2009-01-24 15:00:33 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. ........ Added: python/branches/py3k/Lib/test/zipdir.zip - copied unchanged from r68885, /python/trunk/Lib/test/zipdir.zip Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_zipfile.py python/branches/py3k/Lib/zipfile.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/test_zipfile.py ============================================================================== --- python/branches/py3k/Lib/test/test_zipfile.py (original) +++ python/branches/py3k/Lib/test/test_zipfile.py Sat Jan 24 15:10:07 2009 @@ -9,9 +9,10 @@ from random import randint, random import test.support as support -from test.support import TESTFN, run_unittest +from test.support import TESTFN, run_unittest, findfile TESTFN2 = TESTFN + "2" +TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), @@ -1000,6 +1001,28 @@ def tearDown(self): os.remove(TESTFN2) +class TestWithDirectory(unittest.TestCase): + def setUp(self): + os.mkdir(TESTFN2) + + def testExtractDir(self): + zipf = zipfile.ZipFile(findfile("zipdir.zip")) + zipf.extractall(TESTFN2) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a"))) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) + self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + + def testStoreDir(self): + os.mkdir(os.path.join(TESTFN2, "x")) + zipf = zipfile.ZipFile(TESTFN, "w") + zipf.write(os.path.join(TESTFN2, "x"), "x") + self.assertTrue(zipf.filelist[0].filename.endswith("x/")) + + def tearDown(self): + shutil.rmtree(TESTFN2) + if os.path.exists(TESTFN): + os.remove(TESTFN) + class UniversalNewlineTests(unittest.TestCase): def setUp(self): @@ -1114,6 +1137,7 @@ def test_main(): run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests, PyZipFileTests, DecryptionTests, TestsWithMultipleOpens, + TestWithDirectory, UniversalNewlineTests, TestsWithRandomBinaryFiles) if __name__ == "__main__": Modified: python/branches/py3k/Lib/zipfile.py ============================================================================== --- python/branches/py3k/Lib/zipfile.py (original) +++ python/branches/py3k/Lib/zipfile.py Sat Jan 24 15:10:07 2009 @@ -4,7 +4,7 @@ XXX references to utf-8 need further investigation. """ import struct, os, time, sys, shutil -import binascii, io +import binascii, io, stat try: import zlib # We may need its compression method @@ -959,11 +959,11 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] == "/": + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present - if os.path.isabs(member.filename): + if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) @@ -975,6 +975,10 @@ if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) + if member.filename[-1] == '/': + os.mkdir(targetpath) + return targetpath + source = self.open(member, pwd=pwd) target = open(targetpath, "wb") shutil.copyfileobj(source, target) @@ -1014,6 +1018,7 @@ "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) + isdir = stat.S_ISDIR(st.st_mode) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information @@ -1022,6 +1027,8 @@ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] + if isdir: + arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes if compress_type is None: @@ -1035,6 +1042,16 @@ self._writecheck(zinfo) self._didModify = True + + if isdir: + zinfo.file_size = 0 + zinfo.compress_size = 0 + zinfo.CRC = 0 + self.filelist.append(zinfo) + self.NameToInfo[zinfo.filename] = zinfo + self.fp.write(zinfo.FileHeader()) + return + fp = io.open(filename, "rb") # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 24 15:10:07 2009 @@ -139,6 +139,9 @@ Library ------- +- Issue #4710: Extract directories properly in the zipfile module; + allow adding directories to a zipfile. + - 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 Sat Jan 24 15:18:27 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 15:18:27 +0100 (CET) Subject: [Python-checkins] r68888 - in python/branches/release30-maint: Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/zipfile.py Misc/NEWS Message-ID: <20090124141827.68D661E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 15:18:13 2009 New Revision: 68888 Log: Merged revisions 68887 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68887 | martin.v.loewis | 2009-01-24 15:10:07 +0100 (Sa, 24 Jan 2009) | 10 lines Merged revisions 68885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68885 | martin.v.loewis | 2009-01-24 15:00:33 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. ........ ................ Added: python/branches/release30-maint/Lib/test/zipdir.zip - copied unchanged from r68887, /python/branches/py3k/Lib/test/zipdir.zip Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_zipfile.py python/branches/release30-maint/Lib/zipfile.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/test/test_zipfile.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_zipfile.py (original) +++ python/branches/release30-maint/Lib/test/test_zipfile.py Sat Jan 24 15:18:13 2009 @@ -9,9 +9,10 @@ from random import randint, random import test.support as support -from test.support import TESTFN, run_unittest +from test.support import TESTFN, run_unittest, findfile TESTFN2 = TESTFN + "2" +TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), @@ -971,6 +972,28 @@ def tearDown(self): os.remove(TESTFN2) +class TestWithDirectory(unittest.TestCase): + def setUp(self): + os.mkdir(TESTFN2) + + def testExtractDir(self): + zipf = zipfile.ZipFile(findfile("zipdir.zip")) + zipf.extractall(TESTFN2) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a"))) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) + self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + + def testStoreDir(self): + os.mkdir(os.path.join(TESTFN2, "x")) + zipf = zipfile.ZipFile(TESTFN, "w") + zipf.write(os.path.join(TESTFN2, "x"), "x") + self.assertTrue(zipf.filelist[0].filename.endswith("x/")) + + def tearDown(self): + shutil.rmtree(TESTFN2) + if os.path.exists(TESTFN): + os.remove(TESTFN) + class UniversalNewlineTests(unittest.TestCase): def setUp(self): @@ -1085,6 +1108,7 @@ def test_main(): run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests, PyZipFileTests, DecryptionTests, TestsWithMultipleOpens, + TestWithDirectory, UniversalNewlineTests, TestsWithRandomBinaryFiles) if __name__ == "__main__": Modified: python/branches/release30-maint/Lib/zipfile.py ============================================================================== --- python/branches/release30-maint/Lib/zipfile.py (original) +++ python/branches/release30-maint/Lib/zipfile.py Sat Jan 24 15:18:13 2009 @@ -4,7 +4,7 @@ XXX references to utf-8 need further investigation. """ import struct, os, time, sys, shutil -import binascii, io +import binascii, io, stat try: import zlib # We may need its compression method @@ -947,11 +947,11 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] == "/": + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present - if os.path.isabs(member.filename): + if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) @@ -963,6 +963,10 @@ if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) + if member.filename[-1] == '/': + os.mkdir(targetpath) + return targetpath + source = self.open(member, pwd=pwd) target = open(targetpath, "wb") shutil.copyfileobj(source, target) @@ -1002,6 +1006,7 @@ "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) + isdir = stat.S_ISDIR(st.st_mode) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information @@ -1010,6 +1015,8 @@ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] + if isdir: + arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes if compress_type is None: @@ -1023,6 +1030,16 @@ self._writecheck(zinfo) self._didModify = True + + if isdir: + zinfo.file_size = 0 + zinfo.compress_size = 0 + zinfo.CRC = 0 + self.filelist.append(zinfo) + self.NameToInfo[zinfo.filename] = zinfo + self.fp.write(zinfo.FileHeader()) + return + fp = io.open(filename, "rb") # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 24 15:18:13 2009 @@ -100,6 +100,9 @@ Library ------- +- Issue #4710: Extract directories properly in the zipfile module; + allow adding directories to a zipfile. + - Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the From python-checkins at python.org Sat Jan 24 16:02:35 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 16:02:35 +0100 (CET) Subject: [Python-checkins] r68889 - python/branches/py3k/Objects/longobject.c Message-ID: <20090124150235.994911E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 16:02:35 2009 New Revision: 68889 Log: Some minor cleanups in PyLong_FromLong: - fast path wasn't being properly taken for negative ints; thanks Victor Stinner for pointing this out. - use Py_SAFE_DOWNCAST instead of direct casting to digit (it's safer, especially if we ever consider moving to 30-bit digits) - cleaner way to write negation 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 Sat Jan 24 16:02:35 2009 @@ -175,7 +175,7 @@ PyLong_FromLong(long ival) { PyLongObject *v; - unsigned long abs_ival; + unsigned long abs_ival; unsigned long t; /* unsigned so >> doesn't propagate sign bit */ int ndigits = 0; int sign = 1; @@ -183,33 +183,35 @@ CHECK_SMALL_INT(ival); if (ival < 0) { - /* if LONG_MIN == -LONG_MAX-1 (true on most platforms) then - ANSI C says that the result of -ival is undefined when ival - == LONG_MIN. Hence the following workaround. */ - abs_ival = (unsigned long)(-1-ival) + 1; + /* negate: can't write this as abs_ival = -ival since that + invokes undefined behaviour when ival is LONG_MIN */ + abs_ival = 0U-(unsigned long)ival; sign = -1; } else { abs_ival = (unsigned long)ival; } - /* Fast path for single-digits ints */ - if (!(ival>>PyLong_SHIFT)) { + /* Fast path for single-digit ints */ + if (!(abs_ival >> PyLong_SHIFT)) { v = _PyLong_New(1); if (v) { Py_SIZE(v) = sign; - v->ob_digit[0] = (digit)ival; + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival, unsigned long, digit); } return (PyObject*)v; } /* 2 digits */ - if (!(ival >> 2*PyLong_SHIFT)) { + if (!(abs_ival >> 2*PyLong_SHIFT)) { v = _PyLong_New(2); if (v) { Py_SIZE(v) = 2*sign; - v->ob_digit[0] = (digit)ival & PyLong_MASK; - v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT); + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival & PyLong_MASK, unsigned long, digit); + v->ob_digit[1] = Py_SAFE_DOWNCAST( + abs_ival >> PyLong_SHIFT, unsigned long, digit); } return (PyObject*)v; } @@ -226,7 +228,8 @@ Py_SIZE(v) = ndigits*sign; t = abs_ival; while (t) { - *p++ = (digit)(t & PyLong_MASK); + *p++ = Py_SAFE_DOWNCAST( + t & PyLong_MASK, unsigned long, digit); t >>= PyLong_SHIFT; } } From buildbot at python.org Sat Jan 24 16:11:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 15:11:38 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 2.6 Message-ID: <20090124151138.7FC3A1E4002@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/18 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: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 16:27:44 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 16:27:44 +0100 (CET) Subject: [Python-checkins] r68890 - python/trunk/Objects/longobject.c Message-ID: <20090124152744.D2DF91E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 16:27:44 2009 New Revision: 68890 Log: Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values Modified: python/trunk/Objects/longobject.c Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Sat Jan 24 16:27:44 2009 @@ -513,7 +513,7 @@ /* Because we're going LSB to MSB, thisbyte is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisbyte << accumbits; + accum |= (twodigits)thisbyte << accumbits; accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ @@ -542,7 +542,7 @@ unsigned char* bytes, size_t n, int little_endian, int is_signed) { - int i; /* index into v->ob_digit */ + Py_ssize_t i; /* index into v->ob_digit */ Py_ssize_t ndigits; /* |v->ob_size| */ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ @@ -587,7 +587,7 @@ accumbits = 0; carry = do_twos_comp ? 1 : 0; for (i = 0; i < ndigits; ++i) { - twodigits thisdigit = v->ob_digit[i]; + digit thisdigit = v->ob_digit[i]; if (do_twos_comp) { thisdigit = (thisdigit ^ PyLong_MASK) + carry; carry = thisdigit >> PyLong_SHIFT; @@ -596,26 +596,23 @@ /* Because we're going LSB to MSB, thisdigit is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisdigit << accumbits; - accumbits += PyLong_SHIFT; + accum |= (twodigits)thisdigit << accumbits; /* The most-significant digit may be (probably is) at least partly empty. */ if (i == ndigits - 1) { /* Count # of sign bits -- they needn't be stored, * although for signed conversion we need later to - * make sure at least one sign bit gets stored. - * First shift conceptual sign bit to real sign bit. - */ - stwodigits s = (stwodigits)(thisdigit << - (8*sizeof(stwodigits) - PyLong_SHIFT)); - unsigned int nsignbits = 0; - while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) { - ++nsignbits; - s <<= 1; + * make sure at least one sign bit gets stored. */ + digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : + thisdigit; + while (s != 0) { + s >>= 1; + accumbits++; } - accumbits -= nsignbits; } + else + accumbits += PyLong_SHIFT; /* Store as many bytes as possible. */ while (accumbits >= 8) { @@ -1079,7 +1076,7 @@ static digit v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit carry = 0; assert(m >= n); @@ -1105,7 +1102,7 @@ static digit v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit borrow = 0; assert(m >= n); @@ -1171,7 +1168,7 @@ digit hi; rem = (rem << PyLong_SHIFT) + *--pin; *--pout = hi = (digit)(rem / n); - rem -= hi * n; + rem -= (twodigits)hi * n; } return (digit)rem; } @@ -1436,11 +1433,11 @@ while (--p >= start) { int k = _PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); - accum |= (twodigits)(k << bits_in_accum); + accum |= (twodigits)k << bits_in_accum; bits_in_accum += bits_per_char; if (bits_in_accum >= PyLong_SHIFT) { *pdigit++ = (digit)(accum & PyLong_MASK); - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); accum >>= PyLong_SHIFT; bits_in_accum -= PyLong_SHIFT; assert(bits_in_accum < PyLong_SHIFT); @@ -1449,7 +1446,7 @@ if (bits_in_accum) { assert(bits_in_accum <= PyLong_SHIFT); *pdigit++ = (digit)accum; - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); } while (pdigit - z->ob_digit < n) *pdigit++ = 0; @@ -1846,7 +1843,7 @@ digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; twodigits q; stwodigits carry = 0; - int i; + Py_ssize_t i; SIGCHECK({ Py_DECREF(a); @@ -2008,7 +2005,7 @@ { Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b)); PyLongObject *z; - int i; + Py_ssize_t i; digit carry = 0; /* Ensure a is the larger of the two: */ From buildbot at python.org Sat Jan 24 16:31:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 15:31:00 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090124153101.295FB1E4002@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/56 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: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 24 16:33:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 15:33:05 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090124153306.1C5A41E4002@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/57 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: martin.v.loewis 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 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 16:42:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 16:42:34 +0100 (CET) Subject: [Python-checkins] r68891 - in python/branches/release26-maint: Objects/longobject.c Message-ID: <20090124154234.AE5DA1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 16:42:34 2009 New Revision: 68891 Log: Merged revisions 68890 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Objects/longobject.c Modified: python/branches/release26-maint/Objects/longobject.c ============================================================================== --- python/branches/release26-maint/Objects/longobject.c (original) +++ python/branches/release26-maint/Objects/longobject.c Sat Jan 24 16:42:34 2009 @@ -513,7 +513,7 @@ /* Because we're going LSB to MSB, thisbyte is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisbyte << accumbits; + accum |= (twodigits)thisbyte << accumbits; accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ @@ -542,7 +542,7 @@ unsigned char* bytes, size_t n, int little_endian, int is_signed) { - int i; /* index into v->ob_digit */ + Py_ssize_t i; /* index into v->ob_digit */ Py_ssize_t ndigits; /* |v->ob_size| */ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ @@ -587,7 +587,7 @@ accumbits = 0; carry = do_twos_comp ? 1 : 0; for (i = 0; i < ndigits; ++i) { - twodigits thisdigit = v->ob_digit[i]; + digit thisdigit = v->ob_digit[i]; if (do_twos_comp) { thisdigit = (thisdigit ^ PyLong_MASK) + carry; carry = thisdigit >> PyLong_SHIFT; @@ -596,26 +596,23 @@ /* Because we're going LSB to MSB, thisdigit is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisdigit << accumbits; - accumbits += PyLong_SHIFT; + accum |= (twodigits)thisdigit << accumbits; /* The most-significant digit may be (probably is) at least partly empty. */ if (i == ndigits - 1) { /* Count # of sign bits -- they needn't be stored, * although for signed conversion we need later to - * make sure at least one sign bit gets stored. - * First shift conceptual sign bit to real sign bit. - */ - stwodigits s = (stwodigits)(thisdigit << - (8*sizeof(stwodigits) - PyLong_SHIFT)); - unsigned int nsignbits = 0; - while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) { - ++nsignbits; - s <<= 1; + * make sure at least one sign bit gets stored. */ + digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : + thisdigit; + while (s != 0) { + s >>= 1; + accumbits++; } - accumbits -= nsignbits; } + else + accumbits += PyLong_SHIFT; /* Store as many bytes as possible. */ while (accumbits >= 8) { @@ -1079,7 +1076,7 @@ static digit v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit carry = 0; assert(m >= n); @@ -1105,7 +1102,7 @@ static digit v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit borrow = 0; assert(m >= n); @@ -1171,7 +1168,7 @@ digit hi; rem = (rem << PyLong_SHIFT) + *--pin; *--pout = hi = (digit)(rem / n); - rem -= hi * n; + rem -= (twodigits)hi * n; } return (digit)rem; } @@ -1436,11 +1433,11 @@ while (--p >= start) { int k = _PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); - accum |= (twodigits)(k << bits_in_accum); + accum |= (twodigits)k << bits_in_accum; bits_in_accum += bits_per_char; if (bits_in_accum >= PyLong_SHIFT) { *pdigit++ = (digit)(accum & PyLong_MASK); - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); accum >>= PyLong_SHIFT; bits_in_accum -= PyLong_SHIFT; assert(bits_in_accum < PyLong_SHIFT); @@ -1449,7 +1446,7 @@ if (bits_in_accum) { assert(bits_in_accum <= PyLong_SHIFT); *pdigit++ = (digit)accum; - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); } while (pdigit - z->ob_digit < n) *pdigit++ = 0; @@ -1846,7 +1843,7 @@ digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; twodigits q; stwodigits carry = 0; - int i; + Py_ssize_t i; SIGCHECK({ Py_DECREF(a); @@ -2008,7 +2005,7 @@ { Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b)); PyLongObject *z; - int i; + Py_ssize_t i; digit carry = 0; /* Ensure a is the larger of the two: */ From python-checkins at python.org Sat Jan 24 16:45:18 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 16:45:18 +0100 (CET) Subject: [Python-checkins] r68892 - python/trunk/Lib/idlelib/NEWS.txt Message-ID: <20090124154518.A5FC31E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 16:45:18 2009 New Revision: 68892 Log: Add heading for 2.7a0. Modified: python/trunk/Lib/idlelib/NEWS.txt Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Sat Jan 24 16:45:18 2009 @@ -1,10 +1,16 @@ -What's New in IDLE 2.6a3? +What's New in IDLE 2.7a0? ========================= -*Release date: XX-XXX-2008* +*Release date: XX-XXX-2009* - Issue #3549: On MacOS the preferences menu was not present + +What's New in IDLE 2.6? +======================= + +*Release date: 01-Oct-2008* + - Issue #2665: On Windows, an IDLE installation upgraded from an old version would not start if a custom theme was defined. From python-checkins at python.org Sat Jan 24 16:47:28 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 16:47:28 +0100 (CET) Subject: [Python-checkins] r68893 - in python/trunk: Lib/lib-tk/FixTk.py Misc/NEWS Message-ID: <20090124154728.188FB1E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 16:47:27 2009 New Revision: 68893 Log: Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. Modified: python/trunk/Lib/lib-tk/FixTk.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/lib-tk/FixTk.py ============================================================================== --- python/trunk/Lib/lib-tk/FixTk.py (original) +++ python/trunk/Lib/lib-tk/FixTk.py Sat Jan 24 16:47:27 2009 @@ -10,6 +10,40 @@ # \..\tcl, so anything close to # the real Tcl library will do. +# Expand symbolic links on Vista +try: + import ctypes + ctypes.windll.kernel32.GetFinalPathNameByHandleW +except (ImportError, AttributeError): + def convert_path(s): + return s +else: + def convert_path(s): + if isinstance(s, str): + s = s.decode("mbcs") + hdir = ctypes.windll.kernel32.\ + CreateFileW(s, 0x80, # FILE_READ_ATTRIBUTES + 1, # FILE_SHARE_READ + None, 3, # OPEN_EXISTING + 0x02000000, # FILE_FLAG_BACKUP_SEMANTICS + None) + if hdir == -1: + # Cannot open directory, give up + return s + buf = ctypes.create_unicode_buffer(u"", 32768) + res = ctypes.windll.kernel32.\ + GetFinalPathNameByHandleW(hdir, buf, len(buf), + 0) # VOLUME_NAME_DOS + ctypes.windll.kernel32.CloseHandle(hdir) + if res == 0: + # Conversion failed (e.g. network location) + return s + s = buf[:res] + # Ignore leading \\?\ + if s.startswith(u"\\\\?\\"): + s = s[4:] + return s + prefix = os.path.join(sys.prefix,"tcl") if not os.path.exists(prefix): # devdir/../tcltk/lib @@ -17,6 +51,7 @@ prefix = os.path.abspath(prefix) # if this does not exist, no further search is needed if os.path.exists(prefix): + prefix = convert_path(prefix) if not os.environ.has_key("TCL_LIBRARY"): for name in os.listdir(prefix): if name.startswith("tcl"): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 24 16:47:27 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue #3881: Help Tcl to load even when started through the + unreadable local symlink to "Program Files" on Vista. + - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. From python-checkins at python.org Sat Jan 24 16:50:00 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 16:50:00 +0100 (CET) Subject: [Python-checkins] r68894 - in python/branches/release26-maint: Lib/lib-tk/FixTk.py Misc/NEWS Message-ID: <20090124155000.95ED31E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 16:50:00 2009 New Revision: 68894 Log: Merged revisions 68893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68893 | martin.v.loewis | 2009-01-24 16:47:27 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/lib-tk/FixTk.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/lib-tk/FixTk.py ============================================================================== --- python/branches/release26-maint/Lib/lib-tk/FixTk.py (original) +++ python/branches/release26-maint/Lib/lib-tk/FixTk.py Sat Jan 24 16:50:00 2009 @@ -10,6 +10,40 @@ # \..\tcl, so anything close to # the real Tcl library will do. +# Expand symbolic links on Vista +try: + import ctypes + ctypes.windll.kernel32.GetFinalPathNameByHandleW +except (ImportError, AttributeError): + def convert_path(s): + return s +else: + def convert_path(s): + if isinstance(s, str): + s = s.decode("mbcs") + hdir = ctypes.windll.kernel32.\ + CreateFileW(s, 0x80, # FILE_READ_ATTRIBUTES + 1, # FILE_SHARE_READ + None, 3, # OPEN_EXISTING + 0x02000000, # FILE_FLAG_BACKUP_SEMANTICS + None) + if hdir == -1: + # Cannot open directory, give up + return s + buf = ctypes.create_unicode_buffer(u"", 32768) + res = ctypes.windll.kernel32.\ + GetFinalPathNameByHandleW(hdir, buf, len(buf), + 0) # VOLUME_NAME_DOS + ctypes.windll.kernel32.CloseHandle(hdir) + if res == 0: + # Conversion failed (e.g. network location) + return s + s = buf[:res] + # Ignore leading \\?\ + if s.startswith(u"\\\\?\\"): + s = s[4:] + return s + prefix = os.path.join(sys.prefix,"tcl") if not os.path.exists(prefix): # devdir/../tcltk/lib @@ -17,6 +51,7 @@ prefix = os.path.abspath(prefix) # if this does not exist, no further search is needed if os.path.exists(prefix): + prefix = convert_path(prefix) if not os.environ.has_key("TCL_LIBRARY"): for name in os.listdir(prefix): if name.startswith("tcl"): Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 24 16:50:00 2009 @@ -76,6 +76,9 @@ Library ------- +- Issue #3881: Help Tcl to load even when started through the + unreadable local symlink to "Program Files" on Vista. + - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. From python-checkins at python.org Sat Jan 24 16:56:57 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 16:56:57 +0100 (CET) Subject: [Python-checkins] r68895 - in python/branches/py3k: Objects/longobject.c Message-ID: <20090124155657.EA6D71E400C@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 16:56:57 2009 New Revision: 68895 Log: Merged revisions 68890 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Sat Jan 24 16:56:57 2009 @@ -742,7 +742,7 @@ /* Because we're going LSB to MSB, thisbyte is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisbyte << accumbits; + accum |= (twodigits)thisbyte << accumbits; accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ @@ -771,7 +771,7 @@ unsigned char* bytes, size_t n, int little_endian, int is_signed) { - int i; /* index into v->ob_digit */ + Py_ssize_t i; /* index into v->ob_digit */ Py_ssize_t ndigits; /* |v->ob_size| */ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ @@ -816,7 +816,7 @@ accumbits = 0; carry = do_twos_comp ? 1 : 0; for (i = 0; i < ndigits; ++i) { - twodigits thisdigit = v->ob_digit[i]; + digit thisdigit = v->ob_digit[i]; if (do_twos_comp) { thisdigit = (thisdigit ^ PyLong_MASK) + carry; carry = thisdigit >> PyLong_SHIFT; @@ -825,26 +825,23 @@ /* Because we're going LSB to MSB, thisdigit is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisdigit << accumbits; - accumbits += PyLong_SHIFT; + accum |= (twodigits)thisdigit << accumbits; /* The most-significant digit may be (probably is) at least partly empty. */ if (i == ndigits - 1) { /* Count # of sign bits -- they needn't be stored, * although for signed conversion we need later to - * make sure at least one sign bit gets stored. - * First shift conceptual sign bit to real sign bit. - */ - stwodigits s = (stwodigits)(thisdigit << - (8*sizeof(stwodigits) - PyLong_SHIFT)); - unsigned int nsignbits = 0; - while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) { - ++nsignbits; - s <<= 1; + * make sure at least one sign bit gets stored. */ + digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : + thisdigit; + while (s != 0) { + s >>= 1; + accumbits++; } - accumbits -= nsignbits; } + else + accumbits += PyLong_SHIFT; /* Store as many bytes as possible. */ while (accumbits >= 8) { @@ -1364,7 +1361,7 @@ static digit v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit carry = 0; assert(m >= n); @@ -1390,7 +1387,7 @@ static digit v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit borrow = 0; assert(m >= n); @@ -1456,7 +1453,7 @@ digit hi; rem = (rem << PyLong_SHIFT) + *--pin; *--pout = hi = (digit)(rem / n); - rem -= hi * n; + rem -= (twodigits)hi * n; } return (digit)rem; } @@ -1715,11 +1712,11 @@ while (--p >= start) { int k = (int)_PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); - accum |= (twodigits)(k << bits_in_accum); + accum |= (twodigits)k << bits_in_accum; bits_in_accum += bits_per_char; if (bits_in_accum >= PyLong_SHIFT) { *pdigit++ = (digit)(accum & PyLong_MASK); - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); accum >>= PyLong_SHIFT; bits_in_accum -= PyLong_SHIFT; assert(bits_in_accum < PyLong_SHIFT); @@ -1728,7 +1725,7 @@ if (bits_in_accum) { assert(bits_in_accum <= PyLong_SHIFT); *pdigit++ = (digit)accum; - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); } while (pdigit - z->ob_digit < n) *pdigit++ = 0; @@ -2123,7 +2120,7 @@ digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; twodigits q; stwodigits carry = 0; - int i; + Py_ssize_t i; SIGCHECK({ Py_DECREF(a); @@ -2325,7 +2322,7 @@ { Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b)); PyLongObject *z; - int i; + Py_ssize_t i; digit carry = 0; /* Ensure a is the larger of the two: */ From python-checkins at python.org Sat Jan 24 16:59:42 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 16:59:42 +0100 (CET) Subject: [Python-checkins] r68896 - in python/branches/release30-maint: Objects/longobject.c Message-ID: <20090124155942.3C01A1E4038@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 16:59:38 2009 New Revision: 68896 Log: Merged revisions 68895 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68895 | mark.dickinson | 2009-01-24 15:56:57 +0000 (Sat, 24 Jan 2009) | 13 lines Merged revisions 68890 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/longobject.c Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Sat Jan 24 16:59:38 2009 @@ -739,7 +739,7 @@ /* Because we're going LSB to MSB, thisbyte is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisbyte << accumbits; + accum |= (twodigits)thisbyte << accumbits; accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ @@ -768,7 +768,7 @@ unsigned char* bytes, size_t n, int little_endian, int is_signed) { - int i; /* index into v->ob_digit */ + Py_ssize_t i; /* index into v->ob_digit */ Py_ssize_t ndigits; /* |v->ob_size| */ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ @@ -813,7 +813,7 @@ accumbits = 0; carry = do_twos_comp ? 1 : 0; for (i = 0; i < ndigits; ++i) { - twodigits thisdigit = v->ob_digit[i]; + digit thisdigit = v->ob_digit[i]; if (do_twos_comp) { thisdigit = (thisdigit ^ PyLong_MASK) + carry; carry = thisdigit >> PyLong_SHIFT; @@ -822,26 +822,23 @@ /* Because we're going LSB to MSB, thisdigit is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisdigit << accumbits; - accumbits += PyLong_SHIFT; + accum |= (twodigits)thisdigit << accumbits; /* The most-significant digit may be (probably is) at least partly empty. */ if (i == ndigits - 1) { /* Count # of sign bits -- they needn't be stored, * although for signed conversion we need later to - * make sure at least one sign bit gets stored. - * First shift conceptual sign bit to real sign bit. - */ - stwodigits s = (stwodigits)(thisdigit << - (8*sizeof(stwodigits) - PyLong_SHIFT)); - unsigned int nsignbits = 0; - while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) { - ++nsignbits; - s <<= 1; + * make sure at least one sign bit gets stored. */ + digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : + thisdigit; + while (s != 0) { + s >>= 1; + accumbits++; } - accumbits -= nsignbits; } + else + accumbits += PyLong_SHIFT; /* Store as many bytes as possible. */ while (accumbits >= 8) { @@ -1361,7 +1358,7 @@ static digit v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit carry = 0; assert(m >= n); @@ -1387,7 +1384,7 @@ static digit v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit borrow = 0; assert(m >= n); @@ -1453,7 +1450,7 @@ digit hi; rem = (rem << PyLong_SHIFT) + *--pin; *--pout = hi = (digit)(rem / n); - rem -= hi * n; + rem -= (twodigits)hi * n; } return (digit)rem; } @@ -1712,11 +1709,11 @@ while (--p >= start) { int k = _PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); - accum |= (twodigits)(k << bits_in_accum); + accum |= (twodigits)k << bits_in_accum; bits_in_accum += bits_per_char; if (bits_in_accum >= PyLong_SHIFT) { *pdigit++ = (digit)(accum & PyLong_MASK); - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); accum >>= PyLong_SHIFT; bits_in_accum -= PyLong_SHIFT; assert(bits_in_accum < PyLong_SHIFT); @@ -1725,7 +1722,7 @@ if (bits_in_accum) { assert(bits_in_accum <= PyLong_SHIFT); *pdigit++ = (digit)accum; - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); } while (pdigit - z->ob_digit < n) *pdigit++ = 0; @@ -2120,7 +2117,7 @@ digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; twodigits q; stwodigits carry = 0; - int i; + Py_ssize_t i; SIGCHECK({ Py_DECREF(a); @@ -2322,7 +2319,7 @@ { Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b)); PyLongObject *z; - int i; + Py_ssize_t i; digit carry = 0; /* Ensure a is the larger of the two: */ From buildbot at python.org Sat Jan 24 17:06:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 16:06:09 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090124160642.955151E4002@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/189 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 python-checkins at python.org Sat Jan 24 17:17:27 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 17:17:27 +0100 (CET) Subject: [Python-checkins] r68897 - python/trunk/Lib/test/test_kqueue.py Message-ID: <20090124161727.DF13F1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 17:17:27 2009 New Revision: 68897 Log: Issue #5025: Fix occasional test_kqueue failure on OS X. Modified: python/trunk/Lib/test/test_kqueue.py Modified: python/trunk/Lib/test/test_kqueue.py ============================================================================== --- python/trunk/Lib/test/test_kqueue.py (original) +++ python/trunk/Lib/test/test_kqueue.py Sat Jan 24 17:17:27 2009 @@ -120,12 +120,15 @@ client.send("Hello!") server.send("world!!!") - events = kq.control(None, 4, 1) # We may need to call it several times - for i in range(5): + for i in range(10): + events = kq.control(None, 4, 1) if len(events) == 4: break - events = kq.control(None, 4, 1) + time.sleep(1.0) + else: + self.fail('timeout waiting for event notifications') + events = [(e.ident, e.filter, e.flags) for e in events] events.sort() From python-checkins at python.org Sat Jan 24 17:20:06 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 17:20:06 +0100 (CET) Subject: [Python-checkins] r68898 - in python/branches/py3k: Lib/tkinter/_fix.py Misc/NEWS Message-ID: <20090124162006.60F611E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 17:19:45 2009 New Revision: 68898 Log: Merged revisions 68893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68893 | martin.v.loewis | 2009-01-24 16:47:27 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/tkinter/_fix.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/tkinter/_fix.py ============================================================================== --- python/branches/py3k/Lib/tkinter/_fix.py (original) +++ python/branches/py3k/Lib/tkinter/_fix.py Sat Jan 24 17:19:45 2009 @@ -10,6 +10,40 @@ # \..\tcl, so anything close to # the real Tcl library will do. +# Expand symbolic links on Vista +try: + import ctypes + ctypes.windll.kernel32.GetFinalPathNameByHandleW +except (ImportError, AttributeError): + def convert_path(s): + return s +else: + def convert_path(s): + if isinstance(s, bytes): + s = s.decode("mbcs") + hdir = ctypes.windll.kernel32.\ + CreateFileW(s, 0x80, # FILE_READ_ATTRIBUTES + 1, # FILE_SHARE_READ + None, 3, # OPEN_EXISTING + 0x02000000, # FILE_FLAG_BACKUP_SEMANTICS + None) + if hdir == -1: + # Cannot open directory, give up + return s + buf = ctypes.create_unicode_buffer("", 32768) + res = ctypes.windll.kernel32.\ + GetFinalPathNameByHandleW(hdir, buf, len(buf), + 0) # VOLUME_NAME_DOS + ctypes.windll.kernel32.CloseHandle(hdir) + if res == 0: + # Conversion failed (e.g. network location) + return s + s = buf[:res] + # Ignore leading \\?\ + if s.startswith("\\\\?\\"): + s = s[4:] + return s + prefix = os.path.join(sys.prefix,"tcl") if not os.path.exists(prefix): # devdir/../tcltk/lib @@ -17,6 +51,7 @@ prefix = os.path.abspath(prefix) # if this does not exist, no further search is needed if os.path.exists(prefix): + prefix = convert_path(prefix) if "TCL_LIBRARY" not in os.environ: for name in os.listdir(prefix): if name.startswith("tcl"): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 24 17:19:45 2009 @@ -139,6 +139,9 @@ Library ------- +- Issue #3881: Help Tcl to load even when started through the + unreadable local symlink to "Program Files" on Vista. + - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. From python-checkins at python.org Sat Jan 24 17:20:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 17:20:59 +0100 (CET) Subject: [Python-checkins] r68899 - in python/branches/release26-maint: Lib/test/test_kqueue.py Message-ID: <20090124162059.F40DF1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 17:20:50 2009 New Revision: 68899 Log: Merged revisions 68897 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68897 | mark.dickinson | 2009-01-24 16:17:27 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #5025: Fix occasional test_kqueue failure on OS X. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_kqueue.py Modified: python/branches/release26-maint/Lib/test/test_kqueue.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_kqueue.py (original) +++ python/branches/release26-maint/Lib/test/test_kqueue.py Sat Jan 24 17:20:50 2009 @@ -120,12 +120,15 @@ client.send("Hello!") server.send("world!!!") - events = kq.control(None, 4, 1) # We may need to call it several times - for i in range(5): + for i in range(10): + events = kq.control(None, 4, 1) if len(events) == 4: break - events = kq.control(None, 4, 1) + time.sleep(1.0) + else: + self.fail('timeout waiting for event notifications') + events = [(e.ident, e.filter, e.flags) for e in events] events.sort() From python-checkins at python.org Sat Jan 24 17:22:40 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 17:22:40 +0100 (CET) Subject: [Python-checkins] r68900 - in python/branches/py3k: Lib/test/test_kqueue.py Message-ID: <20090124162240.E10C51E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 17:22:21 2009 New Revision: 68900 Log: Merged revisions 68897 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68897 | mark.dickinson | 2009-01-24 16:17:27 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #5025: Fix occasional test_kqueue failure on OS X. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_kqueue.py Modified: python/branches/py3k/Lib/test/test_kqueue.py ============================================================================== --- python/branches/py3k/Lib/test/test_kqueue.py (original) +++ python/branches/py3k/Lib/test/test_kqueue.py Sat Jan 24 17:22:21 2009 @@ -120,12 +120,15 @@ client.send(b"Hello!") server.send(b"world!!!") - events = kq.control(None, 4, 1) # We may need to call it several times - for i in range(5): + for i in range(10): + events = kq.control(None, 4, 1) if len(events) == 4: break - events = kq.control(None, 4, 1) + time.sleep(1.0) + else: + self.fail('timeout waiting for event notifications') + events = [(e.ident, e.filter, e.flags) for e in events] events.sort() From python-checkins at python.org Sat Jan 24 17:25:44 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 24 Jan 2009 17:25:44 +0100 (CET) Subject: [Python-checkins] r68901 - in python/branches/release30-maint: Lib/tkinter/_fix.py Misc/NEWS Message-ID: <20090124162544.E39551E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 24 17:25:04 2009 New Revision: 68901 Log: Merged revisions 68898 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68898 | martin.v.loewis | 2009-01-24 17:19:45 +0100 (Sa, 24 Jan 2009) | 10 lines Merged revisions 68893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68893 | martin.v.loewis | 2009-01-24 16:47:27 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/tkinter/_fix.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/tkinter/_fix.py ============================================================================== --- python/branches/release30-maint/Lib/tkinter/_fix.py (original) +++ python/branches/release30-maint/Lib/tkinter/_fix.py Sat Jan 24 17:25:04 2009 @@ -10,6 +10,40 @@ # \..\tcl, so anything close to # the real Tcl library will do. +# Expand symbolic links on Vista +try: + import ctypes + ctypes.windll.kernel32.GetFinalPathNameByHandleW +except (ImportError, AttributeError): + def convert_path(s): + return s +else: + def convert_path(s): + if isinstance(s, bytes): + s = s.decode("mbcs") + hdir = ctypes.windll.kernel32.\ + CreateFileW(s, 0x80, # FILE_READ_ATTRIBUTES + 1, # FILE_SHARE_READ + None, 3, # OPEN_EXISTING + 0x02000000, # FILE_FLAG_BACKUP_SEMANTICS + None) + if hdir == -1: + # Cannot open directory, give up + return s + buf = ctypes.create_unicode_buffer("", 32768) + res = ctypes.windll.kernel32.\ + GetFinalPathNameByHandleW(hdir, buf, len(buf), + 0) # VOLUME_NAME_DOS + ctypes.windll.kernel32.CloseHandle(hdir) + if res == 0: + # Conversion failed (e.g. network location) + return s + s = buf[:res] + # Ignore leading \\?\ + if s.startswith("\\\\?\\"): + s = s[4:] + return s + prefix = os.path.join(sys.prefix,"tcl") if not os.path.exists(prefix): # devdir/../tcltk/lib @@ -17,6 +51,7 @@ prefix = os.path.abspath(prefix) # if this does not exist, no further search is needed if os.path.exists(prefix): + prefix = convert_path(prefix) if "TCL_LIBRARY" not in os.environ: for name in os.listdir(prefix): if name.startswith("tcl"): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 24 17:25:04 2009 @@ -100,6 +100,9 @@ Library ------- +- Issue #3881: Help Tcl to load even when started through the + unreadable local symlink to "Program Files" on Vista. + - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. From python-checkins at python.org Sat Jan 24 17:27:06 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 17:27:06 +0100 (CET) Subject: [Python-checkins] r68902 - in python/branches/release30-maint: Lib/test/test_kqueue.py Message-ID: <20090124162706.6892A1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 17:26:46 2009 New Revision: 68902 Log: Merged revisions 68900 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68900 | mark.dickinson | 2009-01-24 16:22:21 +0000 (Sat, 24 Jan 2009) | 9 lines Merged revisions 68897 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68897 | mark.dickinson | 2009-01-24 16:17:27 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #5025: Fix occasional test_kqueue failure on OS X. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_kqueue.py Modified: python/branches/release30-maint/Lib/test/test_kqueue.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_kqueue.py (original) +++ python/branches/release30-maint/Lib/test/test_kqueue.py Sat Jan 24 17:26:46 2009 @@ -120,12 +120,15 @@ client.send(b"Hello!") server.send(b"world!!!") - events = kq.control(None, 4, 1) # We may need to call it several times - for i in range(5): + for i in range(10): + events = kq.control(None, 4, 1) if len(events) == 4: break - events = kq.control(None, 4, 1) + time.sleep(1.0) + else: + self.fail('timeout waiting for event notifications') + events = [(e.ident, e.filter, e.flags) for e in events] events.sort() From buildbot at python.org Sat Jan 24 17:38:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 16:38:32 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090124163842.678F91E4002@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/750 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 17:40:29 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 17:40:29 +0100 (CET) Subject: [Python-checkins] r68903 - in python/trunk: Lib/test/pickletester.py Misc/NEWS Modules/cPickle.c Message-ID: <20090124164029.BC8961E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 17:40:29 2009 New Revision: 68903 Log: Issue #1672332: Fix unpickling of subnormal floats, which was raising ValueError on some platforms as a result of the platform strtod setting errno on underflow. Modified: python/trunk/Lib/test/pickletester.py python/trunk/Misc/NEWS python/trunk/Modules/cPickle.c Modified: python/trunk/Lib/test/pickletester.py ============================================================================== --- python/trunk/Lib/test/pickletester.py (original) +++ python/trunk/Lib/test/pickletester.py Sat Jan 24 17:40:29 2009 @@ -535,6 +535,16 @@ got = self.loads(p) self.assertEqual(n, got) + def test_float(self): + test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5, + 3.14, 263.44582062374053, 6.022e23, 1e30] + test_values = test_values + [-x for x in test_values] + for proto in protocols: + for value in test_values: + pickle = self.dumps(value, proto) + got = self.loads(pickle) + self.assertEqual(value, got) + @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_float_format(self): # make sure that floats are formatted locale independent Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 24 17:40:29 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue #1672332: fix unpickling of subnormal floats, which was + producing a ValueError on some platforms. + - Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. Modified: python/trunk/Modules/cPickle.c ============================================================================== --- python/trunk/Modules/cPickle.c (original) +++ python/trunk/Modules/cPickle.c Sat Jan 24 17:40:29 2009 @@ -3465,7 +3465,8 @@ errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); goto finally; From buildbot at python.org Sat Jan 24 17:58:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 16:58:09 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090124165810.20FD51E4002@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/90 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 Sat Jan 24 17:58:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 16:58:57 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 3.0 Message-ID: <20090124165857.9FFC61E4002@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/20 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: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Jan 24 18:01:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 17:01:26 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090124170126.E23921E4002@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/80 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 18:16:17 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 18:16:17 +0100 (CET) Subject: [Python-checkins] r68904 - in python/branches/release30-maint: Objects/longobject.c Message-ID: <20090124171617.BC5EB1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 18:16:17 2009 New Revision: 68904 Log: Merged revisions 68889 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68889 | mark.dickinson | 2009-01-24 15:02:35 +0000 (Sat, 24 Jan 2009) | 9 lines Some minor cleanups in PyLong_FromLong: - fast path wasn't being properly taken for negative ints; thanks Victor Stinner for pointing this out. - use Py_SAFE_DOWNCAST instead of direct casting to digit (it's safer, especially if we ever consider moving to 30-bit digits) - cleaner way to write negation ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/longobject.c Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Sat Jan 24 18:16:17 2009 @@ -175,7 +175,7 @@ PyLong_FromLong(long ival) { PyLongObject *v; - unsigned long abs_ival; + unsigned long abs_ival; unsigned long t; /* unsigned so >> doesn't propagate sign bit */ int ndigits = 0; int sign = 1; @@ -183,33 +183,35 @@ CHECK_SMALL_INT(ival); if (ival < 0) { - /* if LONG_MIN == -LONG_MAX-1 (true on most platforms) then - ANSI C says that the result of -ival is undefined when ival - == LONG_MIN. Hence the following workaround. */ - abs_ival = (unsigned long)(-1-ival) + 1; + /* negate: can't write this as abs_ival = -ival since that + invokes undefined behaviour when ival is LONG_MIN */ + abs_ival = 0U-(unsigned long)ival; sign = -1; } else { abs_ival = (unsigned long)ival; } - /* Fast path for single-digits ints */ - if (!(ival>>PyLong_SHIFT)) { + /* Fast path for single-digit ints */ + if (!(abs_ival >> PyLong_SHIFT)) { v = _PyLong_New(1); if (v) { Py_SIZE(v) = sign; - v->ob_digit[0] = (digit)ival; + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival, unsigned long, digit); } return (PyObject*)v; } /* 2 digits */ - if (!(ival >> 2*PyLong_SHIFT)) { + if (!(abs_ival >> 2*PyLong_SHIFT)) { v = _PyLong_New(2); if (v) { Py_SIZE(v) = 2*sign; - v->ob_digit[0] = (digit)ival & PyLong_MASK; - v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT); + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival & PyLong_MASK, unsigned long, digit); + v->ob_digit[1] = Py_SAFE_DOWNCAST( + abs_ival >> PyLong_SHIFT, unsigned long, digit); } return (PyObject*)v; } @@ -226,7 +228,8 @@ Py_SIZE(v) = ndigits*sign; t = abs_ival; while (t) { - *p++ = (digit)(t & PyLong_MASK); + *p++ = Py_SAFE_DOWNCAST( + t & PyLong_MASK, unsigned long, digit); t >>= PyLong_SHIFT; } } From buildbot at python.org Sat Jan 24 19:47:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 18:47:50 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090124184750.D03561E4021@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/4526 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 19:55:29 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 24 Jan 2009 19:55:29 +0100 (CET) Subject: [Python-checkins] r68905 - peps/trunk/pep-0374.txt Message-ID: <20090124185529.25D281E4018@bag.python.org> Author: georg.brandl Date: Sat Jan 24 19:55:28 2009 New Revision: 68905 Log: Note on hg strip. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 19:55:28 2009 @@ -547,8 +547,8 @@ hg commit -m "Reverted changeset 9150dd9c6d30" hg push -Note, you can use "hg rollback" to revert the last change you committed in -your local repository. +Note, you can use "hg rollback" and "hg strip" to revert changes you committed +in your local repository, but did not yet push to other repositories. git ''' @@ -1322,9 +1322,9 @@ Alexander Solovyov comments: Mercurial has easy to use extensive API with hooks for main events - and ability to extend commands. Also there is mq (mercurial queues) - extension, distributed with Mercurial, which simplifies work with - patches. + and ability to extend commands. Also there is the mq (mercurial + queues) extension, distributed with Mercurial, which simplifies + work with patches. git From buildbot at python.org Sat Jan 24 20:01:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 19:01:41 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090124190141.AB42B1E405B@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/540 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,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 Sat Jan 24 20:28:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 19:28:12 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090124192812.9C8AB1E4002@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/35 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 24 20:33:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 19:33:41 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090124193341.BDE9F1E4002@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/57 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_sax Traceback (most recent call last): File "./Lib/test/regrtest.py", line 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_sax.py", line 7, in make_parser() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/__init__.py", line 81, in make_parser return _create_parser(parser_name) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/__init__.py", line 105, in _create_parser drv_module = __import__(parser_name,{},{},['create_parser']) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/expatreader.py", line 28, in from xml.sax import xmlreader, saxutils, handler File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/saxutils.py", line 84, in class XMLGenerator(handler.ContentHandler): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/saxutils.py", line 129, in XMLGenerator def startElement(self, name, attrs): NameError: name 'de' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Jan 24 21:40:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 20:40:26 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090124204026.3785B1E4002@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/187 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,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 22:08:39 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 22:08:39 +0100 (CET) Subject: [Python-checkins] r68906 - python/trunk/Lib/pickletools.py Message-ID: <20090124210839.40C0E1E4029@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 22:08:38 2009 New Revision: 68906 Log: Issue #3657: fix occasional test_pickletools failures. Modified: python/trunk/Lib/pickletools.py Modified: python/trunk/Lib/pickletools.py ============================================================================== --- python/trunk/Lib/pickletools.py (original) +++ python/trunk/Lib/pickletools.py Sat Jan 24 22:08:38 2009 @@ -2083,11 +2083,11 @@ Exercise the INST/OBJ/BUILD family. ->>> import random ->>> dis(pickle.dumps(random.random, 0)) - 0: c GLOBAL 'random random' - 15: p PUT 0 - 18: . STOP +>>> import pickletools +>>> dis(pickle.dumps(pickletools.dis, 0)) + 0: c GLOBAL 'pickletools dis' + 17: p PUT 0 + 20: . STOP highest protocol among opcodes = 0 >>> from pickletools import _Example From buildbot at python.org Sat Jan 24 22:12:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 21:12:51 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090124211251.DBC2A1E4002@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/63 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: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 22:30:16 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 22:30:16 +0100 (CET) Subject: [Python-checkins] r68907 - in python/branches/release26-maint: Lib/pickletools.py Lib/test/pickletester.py Misc/NEWS Modules/cPickle.c Message-ID: <20090124213016.0B18F1E402F@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 22:30:14 2009 New Revision: 68907 Log: Merged revisions 68903,68906 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines Issue #1672332: Fix unpickling of subnormal floats, which was raising ValueError on some platforms as a result of the platform strtod setting errno on underflow. ........ r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #3657: fix occasional test_pickletools failures. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/pickletools.py python/branches/release26-maint/Lib/test/pickletester.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/cPickle.c Modified: python/branches/release26-maint/Lib/pickletools.py ============================================================================== --- python/branches/release26-maint/Lib/pickletools.py (original) +++ python/branches/release26-maint/Lib/pickletools.py Sat Jan 24 22:30:14 2009 @@ -2083,11 +2083,11 @@ Exercise the INST/OBJ/BUILD family. ->>> import random ->>> dis(pickle.dumps(random.random, 0)) - 0: c GLOBAL 'random random' - 15: p PUT 0 - 18: . STOP +>>> import pickletools +>>> dis(pickle.dumps(pickletools.dis, 0)) + 0: c GLOBAL 'pickletools dis' + 17: p PUT 0 + 20: . STOP highest protocol among opcodes = 0 >>> from pickletools import _Example Modified: python/branches/release26-maint/Lib/test/pickletester.py ============================================================================== --- python/branches/release26-maint/Lib/test/pickletester.py (original) +++ python/branches/release26-maint/Lib/test/pickletester.py Sat Jan 24 22:30:14 2009 @@ -535,6 +535,16 @@ got = self.loads(p) self.assertEqual(n, got) + def test_float(self): + test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5, + 3.14, 263.44582062374053, 6.022e23, 1e30] + test_values = test_values + [-x for x in test_values] + for proto in protocols: + for value in test_values: + pickle = self.dumps(value, proto) + got = self.loads(pickle) + self.assertEqual(value, got) + @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_float_format(self): # make sure that floats are formatted locale independent Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Jan 24 22:30:14 2009 @@ -194,6 +194,9 @@ Library ------- +- Issue #1672332: fix unpickling of subnormal floats, which was + producing a ValueError on some platforms. + - Restore Python 2.3 compatibility for decimal.py. - Issue #1702551: distutils sdist was not excluding VCS directories under Modified: python/branches/release26-maint/Modules/cPickle.c ============================================================================== --- python/branches/release26-maint/Modules/cPickle.c (original) +++ python/branches/release26-maint/Modules/cPickle.c Sat Jan 24 22:30:14 2009 @@ -3465,7 +3465,8 @@ errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); goto finally; From buildbot at python.org Sat Jan 24 22:42:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 21:42:45 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090124214245.5F0AA1E4002@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/174 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,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 22:46:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 22:46:34 +0100 (CET) Subject: [Python-checkins] r68908 - in python/branches/py3k: Lib/pickletools.py Lib/test/pickletester.py Misc/NEWS Modules/_pickle.c Message-ID: <20090124214634.434EB1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 22:46:33 2009 New Revision: 68908 Log: Merged revisions 68903,68906 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines Issue #1672332: Fix unpickling of subnormal floats, which was raising ValueError on some platforms as a result of the platform strtod setting errno on underflow. ........ r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #3657: fix occasional test_pickletools failures. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/pickletools.py python/branches/py3k/Lib/test/pickletester.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Lib/pickletools.py ============================================================================== --- python/branches/py3k/Lib/pickletools.py (original) +++ python/branches/py3k/Lib/pickletools.py Sat Jan 24 22:46:33 2009 @@ -2128,11 +2128,11 @@ Exercise the INST/OBJ/BUILD family. ->>> import random ->>> dis(pickle.dumps(random.getrandbits, 0)) - 0: c GLOBAL 'random getrandbits' - 20: p PUT 0 - 23: . STOP +>>> import pickletools +>>> dis(pickle.dumps(pickletools.dis, 0)) + 0: c GLOBAL 'pickletools dis' + 17: p PUT 0 + 20: . STOP highest protocol among opcodes = 0 >>> from pickletools import _Example Modified: python/branches/py3k/Lib/test/pickletester.py ============================================================================== --- python/branches/py3k/Lib/test/pickletester.py (original) +++ python/branches/py3k/Lib/test/pickletester.py Sat Jan 24 22:46:33 2009 @@ -545,6 +545,16 @@ got = self.loads(p) self.assertEqual(n, got) + def test_float(self): + test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5, + 3.14, 263.44582062374053, 6.022e23, 1e30] + test_values = test_values + [-x for x in test_values] + for proto in protocols: + for value in test_values: + pickle = self.dumps(value, proto) + got = self.loads(pickle) + self.assertEqual(value, got) + @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_float_format(self): # make sure that floats are formatted locale independent with proto 0 Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 24 22:46:33 2009 @@ -139,6 +139,9 @@ Library ------- +- Issue #1672332: fix unpickling of subnormal floats, which was + producing a ValueError on some platforms. + - Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Sat Jan 24 22:46:33 2009 @@ -2958,7 +2958,8 @@ errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); return -1; } From python-checkins at python.org Sat Jan 24 22:47:45 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 24 Jan 2009 22:47:45 +0100 (CET) Subject: [Python-checkins] r68909 - in python/branches/release30-maint: Lib/pickletools.py Lib/test/pickletester.py Misc/NEWS Modules/_pickle.c Message-ID: <20090124214745.60D1E1E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 24 22:47:45 2009 New Revision: 68909 Log: Merged revisions 68908 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68908 | mark.dickinson | 2009-01-24 21:46:33 +0000 (Sat, 24 Jan 2009) | 15 lines Merged revisions 68903,68906 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines Issue #1672332: Fix unpickling of subnormal floats, which was raising ValueError on some platforms as a result of the platform strtod setting errno on underflow. ........ r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #3657: fix occasional test_pickletools failures. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/pickletools.py python/branches/release30-maint/Lib/test/pickletester.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_pickle.c Modified: python/branches/release30-maint/Lib/pickletools.py ============================================================================== --- python/branches/release30-maint/Lib/pickletools.py (original) +++ python/branches/release30-maint/Lib/pickletools.py Sat Jan 24 22:47:45 2009 @@ -2128,11 +2128,11 @@ Exercise the INST/OBJ/BUILD family. ->>> import random ->>> dis(pickle.dumps(random.getrandbits, 0)) - 0: c GLOBAL 'random getrandbits' - 20: p PUT 0 - 23: . STOP +>>> import pickletools +>>> dis(pickle.dumps(pickletools.dis, 0)) + 0: c GLOBAL 'pickletools dis' + 17: p PUT 0 + 20: . STOP highest protocol among opcodes = 0 >>> from pickletools import _Example Modified: python/branches/release30-maint/Lib/test/pickletester.py ============================================================================== --- python/branches/release30-maint/Lib/test/pickletester.py (original) +++ python/branches/release30-maint/Lib/test/pickletester.py Sat Jan 24 22:47:45 2009 @@ -545,6 +545,16 @@ got = self.loads(p) self.assertEqual(n, got) + def test_float(self): + test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5, + 3.14, 263.44582062374053, 6.022e23, 1e30] + test_values = test_values + [-x for x in test_values] + for proto in protocols: + for value in test_values: + pickle = self.dumps(value, proto) + got = self.loads(pickle) + self.assertEqual(value, got) + @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_float_format(self): # make sure that floats are formatted locale independent with proto 0 Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Jan 24 22:47:45 2009 @@ -100,6 +100,9 @@ Library ------- +- Issue #1672332: fix unpickling of subnormal floats, which was + producing a ValueError on some platforms. + - Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. Modified: python/branches/release30-maint/Modules/_pickle.c ============================================================================== --- python/branches/release30-maint/Modules/_pickle.c (original) +++ python/branches/release30-maint/Modules/_pickle.c Sat Jan 24 22:47:45 2009 @@ -2969,7 +2969,8 @@ errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); return -1; } From python-checkins at python.org Sat Jan 24 23:16:53 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 24 Jan 2009 23:16:53 +0100 (CET) Subject: [Python-checkins] r68910 - peps/trunk/pep-0374.txt Message-ID: <20090124221653.62D551E4002@bag.python.org> Author: brett.cannon Date: Sat Jan 24 23:16:53 2009 New Revision: 68910 Log: Add a warning that the PEP is still under active development. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 23:16:53 2009 @@ -13,6 +13,10 @@ Post-History: 07-Nov-2008 22-Jan-2009 +.. warning:: + This PEP is in the draft stages and is still under active + development. + Rationale ========= From python-checkins at python.org Sat Jan 24 23:19:46 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 24 Jan 2009 23:19:46 +0100 (CET) Subject: [Python-checkins] r68911 - peps/trunk/pep-0374.txt Message-ID: <20090124221946.C31561E4002@bag.python.org> Author: brett.cannon Date: Sat Jan 24 23:19:46 2009 New Revision: 68911 Log: Add a note that it is possible no switch will occur. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 23:19:46 2009 @@ -93,7 +93,11 @@ This PEP explores the issue of changing Python's use of Subversion for any of the current Python-implemented DVCSs, in order to gain -the benefits outlined above. +the benefits outlined above. This PEP does not guarantee that a switch +to a DVCS will occur at the conclusion of this PEP. It is quite +possible that no clear winner will be found and that svn will continue +to be used. If this happens, this PEP will be revisited and revised in +the future as the state of DVCSs evolves. Terminology From python-checkins at python.org Sat Jan 24 23:23:24 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 24 Jan 2009 23:23:24 +0100 (CET) Subject: [Python-checkins] r68912 - peps/trunk/pep-0374.txt Message-ID: <20090124222324.11C191E4002@bag.python.org> Author: brett.cannon Date: Sat Jan 24 23:23:23 2009 New Revision: 68912 Log: Tweaking "Backing Out Changes" scenario for svn to use the -c flag. Thanks Benji York for the tip. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 23:23:23 2009 @@ -527,7 +527,7 @@ :: # Assume the change to revert is in revision 40 - svn merge -r40:39 . + svn merge -c -40 . # Resolve conflicts, if any. svn commit -m "Reverted revision 40" From buildbot at python.org Sat Jan 24 23:23:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 22:23:32 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 2.6 Message-ID: <20090124222332.4ACB61E4002@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/28 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Jan 24 23:24:48 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 24 Jan 2009 23:24:48 +0100 (CET) Subject: [Python-checkins] r68913 - peps/trunk/pep-0374.txt Message-ID: <20090124222448.819201E400C@bag.python.org> Author: brett.cannon Date: Sat Jan 24 23:24:46 2009 New Revision: 68913 Log: Update DVCS versions. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 24 23:24:46 2009 @@ -205,9 +205,9 @@ ========== ========== ======= =================================== ========================================== Name Short Name Version 2.x Trunk Mirror 3.x Trunk Mirror ---------- ---------- ------- ----------------------------------- ------------------------------------------ -Bazaar_ bzr 1.10 http://code.python.org/python/trunk http://code.python.org/python/3.0 -Mercurial_ hg 1.1 http://code.python.org/hg/trunk/ http://code.python.org/hg/branches/py3k/ -git_ N/A 1.6.0.6 git://code.python.org/python/trunk git://code.python.org/python/branches/py3k +Bazaar_ bzr 1.11 http://code.python.org/python/trunk http://code.python.org/python/3.0 +Mercurial_ hg 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 ========== ========== ======= =================================== ========================================== .. _Bazaar: http://bazaar-vcs.org/ From buildbot at python.org Sat Jan 24 23:51:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 22:51:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090124225140.C12921E402A@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/82 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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' sincerely, -The Buildbot From buildbot at python.org Sun Jan 25 00:00:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 24 Jan 2009 23:00:29 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090124230029.DA7221E4020@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/33 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_docxmlrpc make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 00:06:33 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 25 Jan 2009 00:06:33 +0100 (CET) Subject: [Python-checkins] r68914 - peps/trunk/pep-0374.txt Message-ID: <20090124230633.9B1801E4026@bag.python.org> Author: brett.cannon Date: Sun Jan 25 00:06:31 2009 New Revision: 68914 Log: Thoroughly clean up what impressions I have written so far. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sun Jan 25 00:06:31 2009 @@ -1344,120 +1344,136 @@ is likely to shock a veteran CVS user. -Impressions -=========== +Tests/Impressions +================= + As I (Brett Cannon) am left with the task of of making the final decision of which/any DVCS to go with and not my co-authors, I felt -it only fair to write down my impressions as I evaluate the various -tools so as to be as transparent as possible. +it only fair to write down what tests I ran and my impressions as I +evaluate the various tools so as to be as transparent as possible. + + +Barrier to Entry +---------------- -To begin, I measured the checking out of code as if I was a non-core -developer. This is important as this is the first impression -developers have when they decide they wish to contribute a patch to -Python. Timings were done using the ``time`` command in zsh and +The amount of time and effort it takes to get a checkout of Python's +repository is critical. If the difficulty or time is too great then a +person wishing to contribute to Python may very well give up. That +cannot be allowed to happen. + +I measured the checking out of code 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 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 ======= ================ ============== -The svn measurements are not exactly a 1:1 comparison to the DVCSs. -For one, svn does not download the entire revision history, and thus -(should) have the least amount to download. And two, because various -calculation steps are left up to the server the entire process of -checking out code (should) be faster. - -But the svn measurements should be considered as what developers are -used to. Thus they act as a reference point for what people tend to -expect in terms of performance. - -Looking at bzr, I have listed two numbers. The first values are for -running ``bzr branch`` as outlined in the `One-Off Checkout`_ -scenario. When the -timings came back in hours (I used Launchpad as code.python.org is -not running the newest version of bzr and I wanted to use its latest -networking protocol), I decided to try using the steps outlined when -the experimental bzr branches were first created. That second -approach is what the second set of values for bzr represent. - -While both the hg and git numbers are perfectly acceptable, the bzr -numbers not necessarily. The raw ``bzr branch`` approach is entirely -not acceptable as no one wants to wait over two hours to write a -potentially one line change to some code for the benefit of Python. -Assuming 8:46 is a reasonable amount of time (I believe it in -general is, but it is teetering on not), the 596 M space requirement -could be an issue for some. While we typically view disk space as -cheap, for some people it might be an issue (e.g. the person who did -the schedule for PyCon 2008 did it over a connection so badly that -Google Spreadsheets didn't work for him and he had to submit the -schedule in another form than the one original used). Once again I -think the space usage is acceptable, but it is close to being too -much. - -To see if bzr's performance would be acceptable once at least the -branch was downloaded, I decided to see how long it would take to -get the change log for a file. I chose the README file as it sees -regular changes for every release and has a revision history going -back to 1993 and thus would have a fair number of revisions. -It should be mentioned that while git had the nicest output thanks to -its color terminal output, it also took a while to find the -``--no-pager`` flag in order to get just a stream of text instead of -having the output sent to the pager. - -Overall the numbers were all acceptable: - -* bzr: 4.5 seconds -* hg: 1.1 seconds -* git: 1.5 seconds - -While having bzr be over 3x slower than its nearest neighbor, it -must be kept in mind that the total performance time is still -acceptable, regardless of the multiplier. - -Because a DVCS keeps its revision history on disk, it also means -that typically they can be zipped up for direct downloading. At -least in bzr's case that would solve the performance issue for -initial checkout if the zip file could be generate constantly. But -that didn't address the cost of pulling in new revisions when a -checkout has gone stale. To measure this I decided I would check out -the repositories back about 700 revisions which represented the -amount of change made since the beginning of the month and time how -long they took to update. - -For this to happen I first had to remember the URLs for the -repositories. Instead of simply looking in this PEP, though, I -decided to try to figure it out from the command-line help for each -tool or simply guessing. Bzr worked out great with ``bzr info``. Git -took a little poking around, but I figured out ``git remote show -origin`` told me what I needed. For hg, though, I couldn't figure it -out short of running ``hg pull`` and denoting the status information -during the pull (turns out ``hg paths`` is what I was looking for). - -With the repository locations known I then had to perform a checkout -to a certain revision. Turns out that git will not clone a -repository to only a specific revision, although from personal -experience git's pull facility is very fast. Bzr was able to perform -its update in just over 39 seconds. Hg did its update in just over -17 seconds. Much like the log test, while the multiplier of slowness -seems high, in real life terms al DVCSs performed within reason. - -In my mind this means that bzr is only an acceptable candidate as -long as an fairly up-to-date archive of Python's key branches are -made available for people to download to avoid bzr's very so remote -branching. +.. note:: + The *bzr 1* entry is for + following the instructions in the `One-Off Checkout`_ scenario + instructions pulling from Launchpad_ in mid-January. + The *bzr 2* entry is based on following the instructions + for the `experimental Bazaar branches + `_ and pulling from + http://code.python.org/python/trunk/. + +When comparing these numbers to svn, it is important to realize that +it is not a 1:1 comparison. Svn does not pull down the entire revision +history like all of the DVCSs do. That means svn can perform an +initial checkout much faster than the DVCS purely based on the fact +that it has less information to worry about. + + +Performance of basic information functionality +---------------------------------------------- + +To see how the tools did for performing a command that required +querying the history, the log for the ``README`` file was timed. + +==== ===== +DVCS Time +---- ----- +bzr 4.5 s +hg 1.1 s +git 1.5 s +==== ===== + +One thing of note during this test was that git took longer than the +other three tools to figure out how to get the log without it using a +pager. While the pager use is a nice touch in general, not having it +automatically turn on took some time (turns out the main ``git`` +command has a ``--no-pager`` flag to disable use of the pager). + + +Figuring out what command to use from built-in help +---------------------------------------------------- + +I ended up trying to find out what the command was to see what URL the +repository was cloned from. To do this I used nothing more than the +help provided by the tool itself or its man pages. + +Bzr was the easiest: ``bzr info``. Running ``bzr help`` didn't show +what I wanted, but mentioned ``bzr help commands``. That list had the +command with a description that made sense. + +Git was the second easiest. The command ``git help`` didn't show much +and did not have a way of listing all commands. That is when I viewed +the man page. Reading through the various commands I discovered ``git +remote``. The command itself spit out nothing more than ``origin``. +Trying ``git remote origin`` said it was an error and printed out the +command usage. That is when I noticed ``git remote show``. Running +``git remote show origin`` gave me the information I wanted. + +For hg, I never found the information I wanted on my own. It turns out +I wanted ``hg paths``, but that was not obvious from the description +of "show definition of symbolic path names" as printed by ``hg help``. + + +Updating a checkout +--------------------- + +To see how long it takes to update an outdated repository I timed both +updating a repository 700 commits behind and 50 commits behind (three +weeks stale and 1 week stale, respectively). + +==== =========== ========== +DVCS 700 commits 50 commits +---- ----------- ---------- +bzr 39 s 7 s +hg 17 s 3 s +git N/A 4 s +==== =========== ========== + +.. note:: + Git lacks a value for the *700 commits* scenario as it does + not seem to allow checking out a repository at a specific + revision. + +Git deserves special mention for its output from ``git pull``. It +not only lists the delta change information for each file but also +color-codes the information. + + +XXX ... usage on top of svn, filling in `Coordinated Development of a +New Feature`_ scenario -XXX ... to be continued Chosen DVCS =========== XXX +:: + + import random + print(random.choice(['svn', 'bzr', 'hg', 'git'])) Transition Plan From python at rcn.com Sun Jan 25 00:40:59 2009 From: python at rcn.com (Raymond Hettinger) Date: Sat, 24 Jan 2009 15:40:59 -0800 Subject: [Python-checkins] PEP 374 References: <20090124230633.9B1801E4026@bag.python.org> Message-ID: <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> Somewhere near the top of the PEP, I think there should be a discussion of reasons not to change at all. Everytime we alter the tool chain, it disrupts developers lives. When I was working mainly under Windows, I was at one time the most active contributor by a huge margin. Then Martin switched the build to VC7 which caused me to go over year before I could make another checkin to CPython. By then VC8 was out and VC7 was hard to find. It crippled my development. When we switch tools, *every* developer will have to go through an install, switchover, and learn a new set of commands and checkin practices. The is a huge PITA and it is almost certain that some developers won't bother. For many of the developers that do bother, it will cost them a day of their lives getting switched over and working through the learning curve -- that is a day that could have been spent fixing bugs or doing something non-administrative that actually adds value. Before we boot SVN, I think we need to be damned sure that there will be HUGE offsetting benefits to a DVCS and be pretty sure that our little community is actually ready for a distributed process. I'm concerned that over time we're moving towards a process that has a lot more admin than we used to. Changes to PEP 8, rules on indentation, review rules, etc seem to be driven by the least active developers. Most of the folks who do most of the work rarely ask for more restrictions, more admin, etc. Even little things like automatically rejecting submissios without whitespace normalization add to the admin burden (time spent doing something that doesn't actually improve lives for end-users). SVN is relatively simple. DVCS systems are much more process oriented and aimed at professional developers. I think we will lose many newbie patches if the person is forced to use an unfamiliar version control system. I like the quality of the research that you're doing but suspect that the end goal of switching away from SVN may not be worth the disruption and effects on real developers. My two cents, Raymond From python at rcn.com Sun Jan 25 00:47:19 2009 From: python at rcn.com (Raymond Hettinger) Date: Sat, 24 Jan 2009 15:47:19 -0800 Subject: [Python-checkins] PEP 374 addenda References: <20090124230633.9B1801E4026@bag.python.org> Message-ID: <8D05F27DD8E640749774E2B6D34F0293@RaymondLaptop1> You're added space/time measurements to the PEP. I think you ought to add another more subjective measurement for each system. How long did it take you to learn the new commands and ways of working with the system. How long did it take to get it configured and working on your system? What would be the impact on your life as a developer if you had to switchover? Talking about the Python language itself, we often make the point that developer time is far more important than saving a few clock cycles on a computer. The real impact of a switchover is the learning curve and configuration time multiplied by the number of developers. Also, how many developers or casual contributors will we lose because they simply aren't willing to bear the transition costs? Raymond From buildbot at python.org Sun Jan 25 01:15:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 00:15:47 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090125001547.67DFB1E401C@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/168 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 martin at v.loewis.de Sun Jan 25 01:17:57 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 25 Jan 2009 01:17:57 +0100 Subject: [Python-checkins] PEP 374 In-Reply-To: <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> References: <20090124230633.9B1801E4026@bag.python.org> <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> Message-ID: <497BAFB5.5090804@v.loewis.de> > I'm concerned that over time we're moving towards a process that has a > lot more admin than we used to. Changes to PEP 8, rules on indentation, > review rules, etc seem to be driven by the least active developers. > Most of the folks who do most of the work rarely ask for more > restrictions, more admin, etc. Even little things like automatically > rejecting submissios without whitespace normalization add to the admin > burden (time spent doing something that doesn't actually improve lives > for end-users). I think this is unfair. I added the whitespace checking, and Benjamin Peterson revised it to be more verbose; Georg Brandl extended it to check the documentation as well. Which of us three do you consider the least active developer? Regards, Martin From python-checkins at python.org Sun Jan 25 04:36:13 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 25 Jan 2009 04:36:13 +0100 (CET) Subject: [Python-checkins] r68915 - in python/trunk: Doc/library/multiprocessing.rst Lib/multiprocessing/__init__.py Lib/multiprocessing/util.py Misc/ACKS Misc/NEWS Message-ID: <20090125033613.9D7351E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 25 04:36:13 2009 New Revision: 68915 Log: Properly document multiprocessing's logging support, resolve outstanding issues with the custom levels Modified: python/trunk/Doc/library/multiprocessing.rst python/trunk/Lib/multiprocessing/__init__.py python/trunk/Lib/multiprocessing/util.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/multiprocessing.rst ============================================================================== --- python/trunk/Doc/library/multiprocessing.rst (original) +++ python/trunk/Doc/library/multiprocessing.rst Sun Jan 25 04:36:13 2009 @@ -1859,30 +1859,74 @@ Returns the logger used by :mod:`multiprocessing`. If necessary, a new one will be created. - When first created the logger has level :data:`logging.NOTSET` and has a - handler which sends output to :data:`sys.stderr` using format - ``'[%(levelname)s/%(processName)s] %(message)s'``. (The logger allows use of - the non-standard ``'%(processName)s'`` format.) Message sent to this logger - will not by default propagate to the root logger. + When first created the logger has level :data:`logging.NOTSET` and no + default handler. Messages sent to this logger will not by default propagate + to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherited. +.. currentmodule:: multiprocessing +.. function:: log_to_stderr() + + This function performs a call to :func:`get_logger` but in addition to + returning the logger created by get_logger, it adds a handler which sends + output to :data:`sys.stderr` using format + ``'[%(levelname)s/%(processName)s] %(message)s'``. + Below is an example session with logging turned on:: >>> import multiprocessing, logging - >>> logger = multiprocessing.get_logger() + >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-1] child process calling self.run() - [INFO/SyncManager-1] manager bound to '\\\\.\\pipe\\pyc-2776-0-lj0tfa' + [INFO/SyncManager-1] created temp directory /.../pymp-Wh47O_ + [INFO/SyncManager-1] manager serving at '/.../listener-lWsERs' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-1] manager exiting with exitcode 0 +In addition to having these two logging functions, the multiprocessing also +exposes two additional logging level attributes. These are :const:`SUBWARNING` +and :const:`SUBDEBUG`. The table below illustrates where theses fit in the +normal level hierarchy. + ++----------------+----------------+ +| Level | Numeric value | ++================+================+ +| ``SUBWARNING`` | 25 | ++----------------+----------------+ +| ``SUBDEBUG`` | 5 | ++----------------+----------------+ + +For a full table of logging levels, see the :mod:`logging` module. + +These additional logging levels are used primarily for certain debug messages +within the multiprocessing module. Below is the same example as above, except +with :const:`SUBDEBUG` enabled:: + + >>> import multiprocessing, logging + >>> logger = multiprocessing.log_to_stderr() + >>> logger.setLevel(multiprocessing.SUBDEBUG) + >>> logger.warning('doomed') + [WARNING/MainProcess] doomed + >>> m = multiprocessing.Manager() + [INFO/SyncManager-1] child process calling self.run() + [INFO/SyncManager-1] created temp directory /.../pymp-djGBXN + [INFO/SyncManager-1] manager serving at '/.../pymp-djGBXN/listener-knBYGe' + >>> del m + [SUBDEBUG/MainProcess] finalizer calling ... + [INFO/MainProcess] sending shutdown message to manager + [DEBUG/SyncManager-1] manager received shutdown message + [SUBDEBUG/SyncManager-1] calling ... + [SUBDEBUG/SyncManager-1] calling + [SUBDEBUG/SyncManager-1] finalizer calling ... + [INFO/SyncManager-1] manager exiting with exitcode 0 The :mod:`multiprocessing.dummy` module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modified: python/trunk/Lib/multiprocessing/__init__.py ============================================================================== --- python/trunk/Lib/multiprocessing/__init__.py (original) +++ python/trunk/Lib/multiprocessing/__init__.py Sun Jan 25 04:36:13 2009 @@ -48,7 +48,7 @@ 'allow_connection_pickling', 'BufferTooShort', 'TimeoutError', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array', - 'RawValue', 'RawArray' + 'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING', ] __author__ = 'R. Oudkerk (r.m.oudkerk at gmail.com)' @@ -61,6 +61,7 @@ import sys from multiprocessing.process import Process, current_process, active_children +from multiprocessing.util import SUBDEBUG, SUBWARNING # # Exceptions Modified: python/trunk/Lib/multiprocessing/util.py ============================================================================== --- python/trunk/Lib/multiprocessing/util.py (original) +++ python/trunk/Lib/multiprocessing/util.py Sun Jan 25 04:36:13 2009 @@ -17,7 +17,8 @@ __all__ = [ 'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger', 'log_to_stderr', 'get_temp_dir', 'register_after_fork', - 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal' + 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal', + 'SUBDEBUG', 'SUBWARNING', ] # @@ -57,19 +58,27 @@ Returns logger used by multiprocessing ''' global _logger + import logging, atexit - if not _logger: - import logging, atexit + logging._acquireLock() + try: + if not _logger: + + _logger = logging.getLogger(LOGGER_NAME) + _logger.propagate = 0 + logging.addLevelName(SUBDEBUG, 'SUBDEBUG') + logging.addLevelName(SUBWARNING, 'SUBWARNING') + + # XXX multiprocessing should cleanup before logging + if hasattr(atexit, 'unregister'): + atexit.unregister(_exit_function) + atexit.register(_exit_function) + else: + atexit._exithandlers.remove((_exit_function, (), {})) + atexit._exithandlers.append((_exit_function, (), {})) - # XXX multiprocessing should cleanup before logging - if hasattr(atexit, 'unregister'): - atexit.unregister(_exit_function) - atexit.register(_exit_function) - else: - atexit._exithandlers.remove((_exit_function, (), {})) - atexit._exithandlers.append((_exit_function, (), {})) - - _logger = logging.getLogger(LOGGER_NAME) + finally: + logging._releaseLock() return _logger @@ -79,14 +88,17 @@ ''' global _log_to_stderr import logging + logger = get_logger() formatter = logging.Formatter(DEFAULT_LOGGING_FORMAT) handler = logging.StreamHandler() handler.setFormatter(formatter) logger.addHandler(handler) - if level is not None: + + if level: logger.setLevel(level) _log_to_stderr = True + return _logger # # Function returning a temp directory which will be removed on exit Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sun Jan 25 04:36:13 2009 @@ -783,3 +783,4 @@ Uwe Zessin Tarek Ziad? Peter ?strand +Jesse Noller Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 25 04:36:13 2009 @@ -145,6 +145,10 @@ Library ------- +- Fix and properly document the multiprocessing module's logging + support, expose the internal levels and provide proper usage + examples. + - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. From python-checkins at python.org Sun Jan 25 04:45:53 2009 From: python-checkins at python.org (jesse.noller) Date: Sun, 25 Jan 2009 04:45:53 +0100 (CET) Subject: [Python-checkins] r68916 - in python/branches/py3k: Doc/library/multiprocessing.rst Lib/multiprocessing/__init__.py Lib/multiprocessing/util.py Misc/ACKS Misc/NEWS Message-ID: <20090125034553.4302F1E4002@bag.python.org> Author: jesse.noller Date: Sun Jan 25 04:45:53 2009 New Revision: 68916 Log: merge r68915 to py3k Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/multiprocessing.rst python/branches/py3k/Lib/multiprocessing/__init__.py python/branches/py3k/Lib/multiprocessing/util.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k/Doc/library/multiprocessing.rst Sun Jan 25 04:45:53 2009 @@ -1857,30 +1857,74 @@ Returns the logger used by :mod:`multiprocessing`. If necessary, a new one will be created. - When first created the logger has level :data:`logging.NOTSET` and has a - handler which sends output to :data:`sys.stderr` using format - ``'[%(levelname)s/%(processName)s] %(message)s'``. (The logger allows use of - the non-standard ``'%(processName)s'`` format.) Message sent to this logger - will not by default propagate to the root logger. + When first created the logger has level :data:`logging.NOTSET` and no + default handler. Messages sent to this logger will not by default propagate + to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherited. +.. currentmodule:: multiprocessing +.. function:: log_to_stderr() + + This function performs a call to :func:`get_logger` but in addition to + returning the logger created by get_logger, it adds a handler which sends + output to :data:`sys.stderr` using format + ``'[%(levelname)s/%(processName)s] %(message)s'``. + Below is an example session with logging turned on:: >>> import multiprocessing, logging - >>> logger = multiprocessing.get_logger() + >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-1] child process calling self.run() - [INFO/SyncManager-1] manager bound to '\\\\.\\pipe\\pyc-2776-0-lj0tfa' + [INFO/SyncManager-1] created temp directory /.../pymp-Wh47O_ + [INFO/SyncManager-1] manager serving at '/.../listener-lWsERs' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-1] manager exiting with exitcode 0 +In addition to having these two logging functions, the multiprocessing also +exposes two additional logging level attributes. These are :const:`SUBWARNING` +and :const:`SUBDEBUG`. The table below illustrates where theses fit in the +normal level hierarchy. + ++----------------+----------------+ +| Level | Numeric value | ++================+================+ +| ``SUBWARNING`` | 25 | ++----------------+----------------+ +| ``SUBDEBUG`` | 5 | ++----------------+----------------+ + +For a full table of logging levels, see the :mod:`logging` module. + +These additional logging levels are used primarily for certain debug messages +within the multiprocessing module. Below is the same example as above, except +with :const:`SUBDEBUG` enabled:: + + >>> import multiprocessing, logging + >>> logger = multiprocessing.log_to_stderr() + >>> logger.setLevel(multiprocessing.SUBDEBUG) + >>> logger.warning('doomed') + [WARNING/MainProcess] doomed + >>> m = multiprocessing.Manager() + [INFO/SyncManager-1] child process calling self.run() + [INFO/SyncManager-1] created temp directory /.../pymp-djGBXN + [INFO/SyncManager-1] manager serving at '/.../pymp-djGBXN/listener-knBYGe' + >>> del m + [SUBDEBUG/MainProcess] finalizer calling ... + [INFO/MainProcess] sending shutdown message to manager + [DEBUG/SyncManager-1] manager received shutdown message + [SUBDEBUG/SyncManager-1] calling ... + [SUBDEBUG/SyncManager-1] calling + [SUBDEBUG/SyncManager-1] finalizer calling ... + [INFO/SyncManager-1] manager exiting with exitcode 0 The :mod:`multiprocessing.dummy` module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modified: python/branches/py3k/Lib/multiprocessing/__init__.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/__init__.py (original) +++ python/branches/py3k/Lib/multiprocessing/__init__.py Sun Jan 25 04:45:53 2009 @@ -48,7 +48,7 @@ 'allow_connection_pickling', 'BufferTooShort', 'TimeoutError', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array', - 'RawValue', 'RawArray' + 'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING', ] __author__ = 'R. Oudkerk (r.m.oudkerk at gmail.com)' @@ -61,6 +61,7 @@ import sys from multiprocessing.process import Process, current_process, active_children +from multiprocessing.util import SUBDEBUG, SUBWARNING # # Exceptions Modified: python/branches/py3k/Lib/multiprocessing/util.py ============================================================================== --- python/branches/py3k/Lib/multiprocessing/util.py (original) +++ python/branches/py3k/Lib/multiprocessing/util.py Sun Jan 25 04:45:53 2009 @@ -17,7 +17,8 @@ __all__ = [ 'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger', 'log_to_stderr', 'get_temp_dir', 'register_after_fork', - 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal' + 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal', + 'SUBDEBUG', 'SUBWARNING', ] # @@ -57,19 +58,27 @@ Returns logger used by multiprocessing ''' global _logger + import logging, atexit - if not _logger: - import logging, atexit + logging._acquireLock() + try: + if not _logger: + + _logger = logging.getLogger(LOGGER_NAME) + _logger.propagate = 0 + logging.addLevelName(SUBDEBUG, 'SUBDEBUG') + logging.addLevelName(SUBWARNING, 'SUBWARNING') + + # XXX multiprocessing should cleanup before logging + if hasattr(atexit, 'unregister'): + atexit.unregister(_exit_function) + atexit.register(_exit_function) + else: + atexit._exithandlers.remove((_exit_function, (), {})) + atexit._exithandlers.append((_exit_function, (), {})) - # XXX multiprocessing should cleanup before logging - if hasattr(atexit, 'unregister'): - atexit.unregister(_exit_function) - atexit.register(_exit_function) - else: - atexit._exithandlers.remove((_exit_function, (), {})) - atexit._exithandlers.append((_exit_function, (), {})) - - _logger = logging.getLogger(LOGGER_NAME) + finally: + logging._releaseLock() return _logger @@ -79,14 +88,17 @@ ''' global _log_to_stderr import logging + logger = get_logger() formatter = logging.Formatter(DEFAULT_LOGGING_FORMAT) handler = logging.StreamHandler() handler.setFormatter(formatter) logger.addHandler(handler) - if level is not None: + + if level: logger.setLevel(level) _log_to_stderr = True + return _logger # # Function returning a temp directory which will be removed on exit Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Sun Jan 25 04:45:53 2009 @@ -785,3 +785,4 @@ Uwe Zessin Tarek Ziad? Peter ?strand +Jesse Noller Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 25 04:45:53 2009 @@ -139,6 +139,10 @@ Library ------- +- Fix and properly document the multiprocessing module's logging + support, expose the internal levels and provide proper usage + examples. + - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. From python-checkins at python.org Sun Jan 25 04:55:05 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 25 Jan 2009 04:55:05 +0100 (CET) Subject: [Python-checkins] r68917 - peps/trunk/pep-0374.txt Message-ID: <20090125035505.561C31E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 25 04:55:05 2009 New Revision: 68917 Log: Mention another style of dealing with patches for svn by heavy use of ``svn revert -R``. Also make it more clear how in svn we don't follow a port-forward strategy but instead a tree-like one. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sun Jan 25 04:55:05 2009 @@ -610,6 +610,10 @@ svn commit -m "Some patch." cd .. rm -r issue0000 + +Another option is to only have a single checkout running at any one +time and use ``svn diff`` along with ``svn revert -R`` to store away +independent changes you may have made. bzr @@ -679,37 +683,41 @@ Backport -------- -As a core developer, I want to apply a patch to 2.6, 2.7 and 3.0, so -that I can fix a problem in all three versions. - -Python always has at least the trunk and the last major release to -potentially backport patches to. Currently, though, the situation is -even more complicated than that as we also have to port forward -changes as well. This scenario assumes one needs to apply a patch to -2.6, 2.7, and 3.0, but not necessarily in that order (which is why -there is no list of required steps for this scenario). It is assumed -a developer has a checkout/clone of all three versions. There is also -a revision that needs to be prevented from ever being merged into -another branch. +As a core developer, I want to apply a patch to 2.6, 2.7, 3.0, and 3.1 +so that I can fix a problem in all three versions. +Thanks to always having the cutting-edge and the latest release +version under development, Python currently has four branches being +worked on simultaneously. That makes it important for a change to +propagate easily through various branches. svn ''' + +Because of Python's use of svnmerge, changes start with the trunk +(2.7) and then get merged to the release version of 2.6. To get the +change into the 3.x series, the change is merged into 3.1, fixed up, +and then merged into 3.0 (2.7 -> 2.6; 2.7 -> 3.1 -> 3.0). + +This is in contrast to a port-forward strategy where the patch would +have been added to 2.6 and then pulled forward into newer versions +(2.6 -> 2.7 -> 3.0 -> 3.1). + :: # Assume patch applied to 2.7 in revision 0000. cd release26-maint svnmerge merge -r 0000 # Resolve merge conflicts and make sure patch works. - svn commit -F svnmerge-commit-message.txt + svn commit -F svnmerge-commit-message.txt # revision 0001. cd ../py3k svnmerge merge -r 0000 # Same as for 2.6, except Misc/NEWS changes are reverted. svn revert Misc/NEWS - svn commit -F svnmerge-commit-message.txt - # Block revision 0001 from being merged from 2.7 into 3.0. - svnmerge block -r 0001 - svn ci -F svnmerge-commit-message.txt + svn commit -F svnmerge-commit-message.txt # revision 0002. + cd ../release30-maint + svnmerge merge -r 0002 + svn commit -F svnmerge-commit-message.txt # revision 0003. bzr From brett at python.org Sun Jan 25 05:00:42 2009 From: brett at python.org (Brett Cannon) Date: Sat, 24 Jan 2009 20:00:42 -0800 Subject: [Python-checkins] PEP 374 addenda In-Reply-To: <8D05F27DD8E640749774E2B6D34F0293@RaymondLaptop1> References: <20090124230633.9B1801E4026@bag.python.org> <8D05F27DD8E640749774E2B6D34F0293@RaymondLaptop1> Message-ID: [in the future, Raymond, can you send these to python-dev? I don't think python-checkins is the right place to have over-arching discussions about stuff] On Sat, Jan 24, 2009 at 15:47, Raymond Hettinger wrote: > You're added space/time measurements to the PEP. > I think you ought to add another more subjective > measurement for each system. How long did it take > you to learn the new commands and ways of working > with the system. How long did it take to get it configured > and working on your system? What would be the impact > on your life as a developer if you had to switchover? > > Talking about the Python language itself, we often make the > point that developer time is far more important than saving > a few clock cycles on a computer. > The real impact of a switchover is the learning curve and > configuration time multiplied by the number of developers. > My impressions are not done yet. If you look at what I checked in earlier today you will notice I discuss how long it took to figure stuff out, etc. I am keeping it simple for now but I will discuss subjective things in more detail at a larger context when I come closer to reaching a conclusion. > Also, how many developers or casual contributors will we > lose because they simply aren't willing to bear the transition costs? That's an unmeasurable number short of seeing how large of an outcry there is against something. And since I have not even made a case for one DVCS over another it isn't worth worrying about this number quite yet. -Brett From python-checkins at python.org Sun Jan 25 05:21:40 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 25 Jan 2009 05:21:40 +0100 (CET) Subject: [Python-checkins] r68918 - python/branches/py3k/Doc/glossary.rst Message-ID: <20090125042140.319E91E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 25 05:21:39 2009 New Revision: 68918 Log: Add the terms "finder", "loader", and "importer" to the glossary. 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 Sun Jan 25 05:21:39 2009 @@ -179,6 +179,11 @@ A module written in C or C++, using Python's C API to interact with the core and with user code. + finder + An object that tries to find the :term:`loader` for a module. It must + implement a method named :meth:`find_module`. See :pep:`302` for + details. + floor division Mathematical division discarding any remainder. The floor division operator is ``//``. For example, the expression ``11//4`` evaluates to @@ -270,6 +275,10 @@ role in places where a constant hash value is needed, for example as a key in a dictionary. + importer + An object that both finds and loads a module; both a + :term:`finder` and :term:`loader` object. + interactive Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately @@ -351,6 +360,11 @@ clause is optional. If omitted, all elements in ``range(256)`` are processed. + loader + An object that loads a module. It must define a method named + :meth:`load_module`. A loader is typically returned by a + :term:`finder`. See :pep:`302` for details. + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. From buildbot at python.org Sun Jan 25 05:32:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 04:32:53 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090125043253.DACB01E4002@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/92 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: jesse.noller BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_long make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 05:56:31 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 25 Jan 2009 05:56:31 +0100 (CET) Subject: [Python-checkins] r68919 - in python/branches/py3k: Doc/library/importlib.rst Lib/importlib/NOTES Lib/importlib/_bootstrap.py Message-ID: <20090125045631.31A691E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 25 05:56:30 2009 New Revision: 68919 Log: Document both importlib.machinery.BuiltinImporter and FrozenImporter. 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 Sun Jan 25 05:56:30 2009 @@ -61,7 +61,7 @@ Functions --------- -.. function:: __import__(name, globals={}, locals={}, fromlist=\[\], level=0) +.. function:: __import__(name, globals={}, locals={}, fromlist=list(), level=0) An implementation of the built-in :func:`__import__` function. See the built-in function's documentation for usage instructions. @@ -76,3 +76,49 @@ 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. + + +:mod:`importlib.machinery` -- Importers and path hooks +------------------------------------------------------ + +.. module:: importlib.machinery + :synopsis: Importers and path hooks + +This module contains the various objects that help :keyword:`import` +find and load modules. + +.. class:: BuiltinImporter + + :term:`Importer` for built-in modules. All known built-in modules are + listed in :data:`sys.builtin_module_names`. + + Only class methods are defined by this class to alleviate the need for + instantiation. + + .. method:: find_module(fullname, path=None) + + Class method that allows this class to be a :term:`finder` for built-in + modules. + + .. method:: load_module(fullname) + + Class method that allows this class to be a :term:`loader` for built-in + modules. + + +.. class:: FrozenImporter + + :term:`Importer` for frozen modules. + + Only class methods are defined by this class to alleviate the need for + instantiation. + + .. method:: find_module(fullname, path=None) + + Class method that allows this class to be a :term:`finder` for frozen + modules. + + .. method:: load_module(fullname) + + Class method that allows this class to be a :term:`loader` for frozen + modules. Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Jan 25 05:56:30 2009 @@ -1,12 +1,6 @@ to do ///// -* Document: - - + The terms "importer", "finder", and "loader". - + machinery.BuiltinImporter. - + machinery.FrozenImporter. - * Expose resolve_name(). * Backport to Python 2.7. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Jan 25 05:56:30 2009 @@ -110,8 +110,8 @@ return None return cls if imp.is_builtin(fullname) else None - @staticmethod - def load_module(fullname): + @classmethod + 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)) From buildbot at python.org Sun Jan 25 06:19:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 05:19:52 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090125051952.2CAB71E4002@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/94 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: 4 tests failed: test_codecs test_io test_smtplib test_traceback ====================================================================== 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' ====================================================================== ERROR: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 939, in testBasicIO self.assertEquals(f.write("abc"), 3) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testEncodingErrorsReading (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 774, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) 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/io.py", line 1730, in read decoder.decode(self.buffer.read(), final=True)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testEncodingErrorsWriting (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 792, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") 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/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testNewlinesInput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 900, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 538, in readlines return list(self) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1746, in __next__ line = self.readline() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1819, in readline while self._read_chunk(): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testNewlinesOutput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 925, in testNewlinesOutput txt.write(data) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1165, in test_issue1395_1 c = txt.read(1) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1177, in test_issue1395_2 c = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1187, in test_issue1395_3 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1198, in test_issue1395_4 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1206, in test_issue1395_5 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 25 06:23:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 05:23:20 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090125052320.3ABA91E4002@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/190 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_calendar test_email make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 25 06:56:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 05:56:17 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090125055617.47B161E4019@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/170 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 nnorwitz at gmail.com Sun Jan 25 07:22:43 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 01:22:43 -0500 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20090125062242.GA9184@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.6 (hg), building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-2.6.1-docs-html tar -C dist -cf dist/python-2.6.1-docs-html.tar python-2.6.1-docs-html bzip2 -9 -k dist/python-2.6.1-docs-html.tar (cd dist; zip -q -r -9 python-2.6.1-docs-html.zip python-2.6.1-docs-html) rm -r dist/python-2.6.1-docs-html rm dist/python-2.6.1-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.6 (hg), building text loading pickled environment... done building [text]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-2.6.1-docs-text tar -C dist -cf dist/python-2.6.1-docs-text.tar python-2.6.1-docs-text bzip2 -9 -k dist/python-2.6.1-docs-text.tar (cd dist; zip -q -r -9 python-2.6.1-docs-text.zip python-2.6.1-docs-text) rm -r dist/python-2.6.1-docs-text rm dist/python-2.6.1-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.6 (hg), building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: refcounting#Py_INCREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: int#PyInt_FromLong WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: refcounting#Py_INCREF WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: list#PyList_New WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: exceptions#PyErr_SetString WARNING: unusable reference target found: exceptions#PyErr_Clear WARNING: unusable reference target found: exceptions#PyErr_ExceptionMatches WARNING: unusable reference target found: exceptions#PyErr_Clear WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_GetPath WARNING: unusable reference target found: init#Py_GetPrefix WARNING: unusable reference target found: init#Py_GetExecPrefix WARNING: unusable reference target found: init#Py_GetProgramFullPath WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_IsInitialized WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: veryhigh#Py_eval_input WARNING: unusable reference target found: veryhigh#Py_file_input WARNING: unusable reference target found: veryhigh#Py_single_input WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_AnyFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveLoop WARNING: unusable reference target found: veryhigh#PyRun_SimpleFile WARNING: unusable reference target found: veryhigh#PyRun_SimpleStringFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleFileExFlags WARNING: unusable reference target found: veryhigh#PyRun_SimpleStringFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveOneFlags WARNING: unusable reference target found: veryhigh#PyRun_InteractiveLoopFlags WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseFileFlags WARNING: unusable reference target found: veryhigh#PyParser_SimpleParseStringFlagsFilename WARNING: unusable reference target found: veryhigh#PyRun_StringFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#PyRun_StringFlags WARNING: unusable reference target found: veryhigh#PyRun_FileExFlags WARNING: unusable reference target found: veryhigh#Py_CompileStringFlags WARNING: unusable reference target found: veryhigh#Py_eval_input WARNING: unusable reference target found: veryhigh#Py_file_input WARNING: unusable reference target found: veryhigh#Py_single_input WARNING: unusable reference target found: veryhigh#PyEval_EvalCodeEx WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: veryhigh#Py_CompileString WARNING: unusable reference target found: refcounting#Py_XINCREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XINCREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: exceptions#PyErr_Restore WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: exceptions#PyErr_ExceptionMatches WARNING: unusable reference target found: exceptions#PyErr_Fetch WARNING: unusable reference target found: exceptions#PyErr_Fetch WARNING: unusable reference target found: exceptions#PyErr_SetString WARNING: unusable reference target found: exceptions#PyErr_CheckSignals WARNING: unusable reference target found: exceptions#PyErr_SetFromErrno WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErr WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErr WARNING: unusable reference target found: exceptions#PyErr_SetFromWindowsErrWithFilename WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: exceptions#PyErr_Warn WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: exceptions#PyErr_WarnEx WARNING: unusable reference target found: exceptions#PyErr_CheckSignals WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: sys#Py_AtExit WARNING: unusable reference target found: import#PyImport_ImportModuleEx WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ImportModuleNoBlock WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ImportModuleLevel WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ExecCodeModule WARNING: unusable reference target found: import#PyImport_ReloadModule WARNING: unusable reference target found: import#PyImport_ImportModule WARNING: unusable reference target found: import#PyImport_ExtendInittab WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: import#PyImport_ExtendInittab WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: marshal#PyMarshal_ReadObjectFromFile WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: structures#METH_OLDARGS WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: arg#PyArg_UnpackTuple WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_Parse WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: conversion#PyOS_snprintf WARNING: unusable reference target found: conversion#PyOS_vsnprintf WARNING: unusable reference target found: conversion#PyOS_ascii_strtod WARNING: unusable reference target found: reflection#PyEval_GetFuncName WARNING: unusable reference target found: list#PyList_New WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_IsInstance WARNING: unusable reference target found: object#PyObject_IsSubclass WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: object#PyObject_CallFunctionObjArgs WARNING: unusable reference target found: arg#Py_BuildValue WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: object#PyObject_CallMethodObjArgs WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: exceptions#PyErr_Occurred WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: number#PyNumber_Coerce WARNING: unusable reference target found: number#PyNumber_Index WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: sequence#PySequence_Fast_GET_ITEM WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: sequence#PySequence_Fast WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: sequence#PySequence_Fast_GET_SIZE WARNING: unusable reference target found: dict#PyDict_Check WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: none#Py_None WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyInt_Type WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: int#PyIntObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLongObject WARNING: unusable reference target found: long#PyLong_AsVoidPtr WARNING: unusable reference target found: long#PyLong_FromVoidPtr WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: float#PyFloatObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: complex#PyComplexObject WARNING: unusable reference target found: complex#Py_complex WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: bytearray#PyByteArray_Size WARNING: unusable reference target found: bytearray#PyByteArray_AsString WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: string#PyString_FromFormat WARNING: unusable reference target found: string#PyString_Size WARNING: unusable reference target found: string#PyString_AsString WARNING: unusable reference target found: string#PyString_AsString WARNING: unusable reference target found: string#PyString_AsStringAndSize WARNING: unusable reference target found: string#PyString_FromString WARNING: unusable reference target found: string#PyString_InternInPlace WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#PyUnicodeObject WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF8 WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF32 WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF32Stateful WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF16 WARNING: unusable reference target found: unicode#PyUnicode_DecodeUTF16Stateful WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: unicode#PyUnicode_DecodeMBCS WARNING: unusable reference target found: unicode#PyUnicode_DecodeMBCSStateful WARNING: unusable reference target found: unicode#Py_UNICODE WARNING: unusable reference target found: bool#Py_True WARNING: unusable reference target found: bool#Py_False WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: typeobj#buffer-structs WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: buffer#PyBuffer_FromObject WARNING: unusable reference target found: buffer#PyBuffer_FromReadWriteObject WARNING: unusable reference target found: buffer#PyBufferObject WARNING: unusable reference target found: buffer#PyBuffer_Type WARNING: unusable reference target found: buffer#Py_END_OF_BUFFER WARNING: unusable reference target found: buffer#PyBuffer_FromObject WARNING: unusable reference target found: buffer#Py_END_OF_BUFFER WARNING: unusable reference target found: buffer#PyBuffer_FromMemory WARNING: unusable reference target found: objbuffer#PyObject_AsWriteBuffer WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: tuple#PyTuple_GetItem WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: list#PyList_Size WARNING: unusable reference target found: list#PyList_GetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: list#PyList_SetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: dict#PyDict_GetItem WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: list#PyListObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: mapping#PyMapping_Keys WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: type#typeobjects WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: function#PyFunction_Type WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: method#PyMethod_Type WARNING: unusable reference target found: method#PyMethod_Class WARNING: unusable reference target found: method#PyMethod_Function WARNING: unusable reference target found: method#PyMethod_Self WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFileObject WARNING: unusable reference target found: file#PyFile_IncUseCount WARNING: unusable reference target found: file#PyFile_DecUseCount WARNING: unusable reference target found: file#PyFile_DecUseCount WARNING: unusable reference target found: file#PyFile_AsFile WARNING: unusable reference target found: file#PyFile_IncUseCount WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: module#PyModule_Type WARNING: unusable reference target found: iterator#PySeqIter_New WARNING: unusable reference target found: iterator#PySeqIter_Type WARNING: unusable reference target found: iterator#PyCallIter_New WARNING: unusable reference target found: iterator#PyCallIter_Type WARNING: unusable reference target found: slice#PySlice_GetIndicesEx WARNING: unusable reference target found: slice#PySlice_GetIndices WARNING: unusable reference target found: weakref#PyWeakref_GetObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: cobject#PyCObject WARNING: unusable reference target found: gen#PyGen_New WARNING: unusable reference target found: object#PyObject_CallMethod WARNING: unusable reference target found: object#PyObject_RichCompareBool WARNING: unusable reference target found: object#PyObject_Hash WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: object#PyObject_IsTrue WARNING: unusable reference target found: object#PyObject_Print WARNING: unusable reference target found: object#PyObject_GetIter WARNING: unusable reference target found: number#PyNumber_And WARNING: unusable reference target found: number#PyNumber_Subtract WARNING: unusable reference target found: number#PyNumber_Or WARNING: unusable reference target found: number#PyNumber_Xor WARNING: unusable reference target found: number#PyNumber_InPlaceAnd WARNING: unusable reference target found: number#PyNumber_InPlaceSubtract WARNING: unusable reference target found: number#PyNumber_InPlaceOr WARNING: unusable reference target found: number#PyNumber_InPlaceXor WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: dict#PyDictObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: set#PySet_Add WARNING: unusable reference target found: set#PySet_Size WARNING: unusable reference target found: tuple#PyTuple_SetItem WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_AcquireLock WARNING: unusable reference target found: init#PySys_SetArgv WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_NewInterpreter WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_Finalize WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_GetPath WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: init#Py_SetProgramName WARNING: unusable reference target found: sys#Py_FatalError WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#PyEval_SaveThread WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_AcquireLock WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#Py_NewInterpreter WARNING: unusable reference target found: init#PyInterpreterState WARNING: unusable reference target found: init#PyEval_ReleaseLock WARNING: unusable reference target found: init#PyEval_SaveThread WARNING: unusable reference target found: init#PyEval_RestoreThread WARNING: unusable reference target found: init#Py_Initialize WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: init#PyEval_InitThreads WARNING: unusable reference target found: sys#PyOS_AfterFork WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#PyInterpreterState_Clear WARNING: unusable reference target found: init#PyThreadState_Clear WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#Py_BEGIN_ALLOW_THREADS WARNING: unusable reference target found: init#Py_END_ALLOW_THREADS WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Ensure WARNING: unusable reference target found: init#PyGILState_Release WARNING: unusable reference target found: init#PyEval_SetProfile WARNING: unusable reference target found: init#PyEval_SetTrace WARNING: unusable reference target found: init#PyTrace_CALL WARNING: unusable reference target found: init#PyTrace_EXCEPTION WARNING: unusable reference target found: init#PyTrace_LINE WARNING: unusable reference target found: init#PyTrace_RETURN WARNING: unusable reference target found: init#PyTrace_C_CALL WARNING: unusable reference target found: init#PyTrace_C_EXCEPTION WARNING: unusable reference target found: init#PyTrace_C_RETURN WARNING: unusable reference target found: init#PyTrace_CALL WARNING: unusable reference target found: init#PyTrace_EXCEPTION WARNING: unusable reference target found: init#PyTrace_LINE WARNING: unusable reference target found: init#PyTrace_RETURN WARNING: unusable reference target found: init#PyTrace_C_CALL WARNING: unusable reference target found: init#PyTrace_C_EXCEPTION WARNING: unusable reference target found: init#PyTrace_C_RETURN WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#Py_tracefunc WARNING: unusable reference target found: init#PyEval_SetProfile WARNING: unusable reference target found: init#PyThreadState WARNING: unusable reference target found: init#PyInterpreterState WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Malloc WARNING: unusable reference target found: memory#PyMem_Realloc WARNING: unusable reference target found: memory#PyMem_Free WARNING: unusable reference target found: memory#memoryoverview WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: allocation#PyObject_Del WARNING: unusable reference target found: allocation#PyObject_Init WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: allocation#Py_InitModule3 WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: structures#METH_KEYWORDS WARNING: unusable reference target found: structures#METH_KEYWORDS WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: allocation#Py_InitModule4 WARNING: unusable reference target found: allocation#Py_InitModule WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: arg#PyArg_UnpackTuple WARNING: unusable reference target found: structures#METH_VARARGS WARNING: unusable reference target found: arg#PyArg_ParseTupleAndKeywords WARNING: unusable reference target found: structures#METH_NOARGS WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#METH_O WARNING: unusable reference target found: arg#PyArg_ParseTuple WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: structures#PyCFunction WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: structures#PyVarObject WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: type#PyType_Type WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_name WARNING: unusable reference target found: typeobj#tp_name WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: structures#PyObject_HEAD WARNING: unusable reference target found: structures#PyObject_VAR_HEAD WARNING: unusable reference target found: typeobj#_ob_prev WARNING: unusable reference target found: typeobj#_ob_next WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: refcounting#Py_DECREF WARNING: unusable reference target found: refcounting#Py_XDECREF WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: typeobj#Py_TPFLAGS_BASETYPE WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: allocation#PyObject_Del WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: object#PyObject_Print WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_print WARNING: unusable reference target found: typeobj#tp_repr WARNING: unusable reference target found: typeobj#tp_str WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: object#PyObject_GetAttrString WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: object#PyObject_SetAttrString WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: object#PyObject_Compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: typeobj#number-structs WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#sequence-structs WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#mapping-structs WARNING: unusable reference target found: typeobj#tp_as_mapping WARNING: unusable reference target found: object#PyObject_Hash WARNING: unusable reference target found: object#PyObject_HashNotImplemented WARNING: unusable reference target found: object#PyObject_HashNotImplemented WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: object#PyObject_Call WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Str WARNING: unusable reference target found: object#PyObject_Repr WARNING: unusable reference target found: object#PyObject_GetAttr WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: typeobj#tp_getattr WARNING: unusable reference target found: typeobj#tp_getattro WARNING: unusable reference target found: object#PyObject_SetAttr WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#tp_setattr WARNING: unusable reference target found: typeobj#tp_setattro WARNING: unusable reference target found: typeobj#buffer-structs WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#tp_as_mapping WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: type#PyType_HasFeature WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#sq_contains WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#tp_as_sequence WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#PySequenceMethods WARNING: unusable reference target found: typeobj#sq_inplace_concat WARNING: unusable reference target found: typeobj#sq_inplace_repeat WARNING: unusable reference target found: typeobj#PyNumberMethods WARNING: unusable reference target found: typeobj#tp_as_number WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_iter WARNING: unusable reference target found: typeobj#tp_iternext WARNING: unusable reference target found: typeobj#tp_methods WARNING: unusable reference target found: typeobj#tp_members WARNING: unusable reference target found: typeobj#tp_getset WARNING: unusable reference target found: typeobj#tp_base WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_descr_get WARNING: unusable reference target found: typeobj#tp_descr_set WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_alloc WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_free WARNING: unusable reference target found: typeobj#tp_is_gc WARNING: unusable reference target found: typeobj#tp_bases WARNING: unusable reference target found: typeobj#tp_mro WARNING: unusable reference target found: typeobj#tp_cache WARNING: unusable reference target found: typeobj#tp_subclasses WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GETCHARBUFFER WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_SEQUENCE_IN WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_INPLACEOPS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_WEAKREFS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_ITER WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: refcounting#Py_CLEAR WARNING: unusable reference target found: refcounting#Py_CLEAR WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#supporting-cycle-detection WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_RICHCOMPARE WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_compare WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: typeobj#tp_hash WARNING: unusable reference target found: typeobj#tp_richcompare WARNING: unusable reference target found: object#PyObject_RichCompare WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_WEAKREFS WARNING: unusable reference target found: structures#PyObject WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#tp_weaklistoffset WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_ITER WARNING: unusable reference target found: object#PyObject_GetIter WARNING: unusable reference target found: typeobj#tp_iter WARNING: unusable reference target found: iter#PyIter_Next WARNING: unusable reference target found: typeobj#tp_weaklist WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_CLASS WARNING: unusable reference target found: structures#PyMethodDef WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: structures#PyMemberDef WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_dict WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_dictoffset WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#ob_refcnt WARNING: unusable reference target found: typeobj#ob_type WARNING: unusable reference target found: typeobj#tp_itemsize WARNING: unusable reference target found: typeobj#ob_size WARNING: unusable reference target found: typeobj#tp_basicsize WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: type#PyType_GenericAlloc WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_new WARNING: unusable reference target found: typeobj#tp_init WARNING: unusable reference target found: typeobj#tp_base WARNING: unusable reference target found: type#PyType_GenericAlloc WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: type#PyType_Type WARNING: unusable reference target found: type#PyType_Ready WARNING: unusable reference target found: typeobj#tp_allocs WARNING: unusable reference target found: number#number WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: typeobj#nb_coerce WARNING: unusable reference target found: number#PyNumber_CoerceEx WARNING: unusable reference target found: typeobj#Py_TPFLAGS_CHECKTYPES WARNING: unusable reference target found: mapping#PyMapping_Length WARNING: unusable reference target found: object#PyObject_Size WARNING: unusable reference target found: object#PyObject_GetItem WARNING: unusable reference target found: mapping#PyMapping_Check WARNING: unusable reference target found: object#PyObject_SetItem WARNING: unusable reference target found: sequence#PySequence_Size WARNING: unusable reference target found: object#PyObject_Size WARNING: unusable reference target found: sequence#PySequence_Concat WARNING: unusable reference target found: sequence#PySequence_Repeat WARNING: unusable reference target found: sequence#PySequence_GetItem WARNING: unusable reference target found: sequence#PySequence_Check WARNING: unusable reference target found: typeobj#sq_length WARNING: unusable reference target found: typeobj#sq_item WARNING: unusable reference target found: typeobj#sq_length WARNING: unusable reference target found: sequence#PySequence_SetItem WARNING: unusable reference target found: sequence#PySequence_Contains WARNING: unusable reference target found: sequence#PySequence_Contains WARNING: unusable reference target found: sequence#PySequence_InPlaceConcat WARNING: unusable reference target found: sequence#PySequence_InPlaceRepeat WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: typeobj#tp_as_buffer WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: typeobj#Py_TPFLAGS_DEFAULT WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#PyBufferProcs WARNING: unusable reference target found: string#PyString_Type WARNING: unusable reference target found: buffer#PyBuffer_Type WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GETCHARBUFFER WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: type#PyTypeObject WARNING: unusable reference target found: type#PyType_HasFeature WARNING: unusable reference target found: typeobj#tp_flags WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: allocation#PyObject_New WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#Py_TPFLAGS_HAVE_GC WARNING: unusable reference target found: allocation#PyObject_NewVar WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: gcsupport#PyObject_GC_UnTrack WARNING: unusable reference target found: gcsupport#PyObject_GC_Del WARNING: unusable reference target found: gcsupport#PyObject_GC_New WARNING: unusable reference target found: gcsupport#PyObject_GC_NewVar WARNING: unusable reference target found: gcsupport#PyObject_GC_Track WARNING: unusable reference target found: typeobj#tp_dealloc WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#PyObject_GC_UnTrack WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: gcsupport#Py_VISIT WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_traverse WARNING: unusable reference target found: typeobj#tp_clear WARNING: unusable reference target found: gcsupport#inquiry WARNING: unusable reference target found: refcounting#Py_DECREF done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... WARNING: unusable reference target found: setupscript#setup-script WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: setupscript#meta-data WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: introduction#distutils-simple-example WARNING: unusable reference target found: commandref#sdist-cmd WARNING: unusable reference target found: setupscript#setup-script WARNING: unusable reference target found: configfile#setup-config WARNING: unusable reference target found: packageindex#pypirc WARNING: unusable reference target found: packageindex#pypirc WARNING: unusable reference target found: apiref#module-distutils.cmd WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#module-distutils.version WARNING: unusable reference target found: apiref#distutils.core.Extension WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#module-distutils.core WARNING: unusable reference target found: apiref#distutils.core.Extension WARNING: unusable reference target found: apiref#module-distutils.extension WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#module-distutils.cmd WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#module-distutils.dist WARNING: unusable reference target found: apiref#distutils.core.Distribution WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.setup WARNING: unusable reference target found: apiref#distutils.core.Command WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_include_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_library_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.define_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.undefine_macro WARNING: unusable reference target found: apiref#distutils.util.split_quoted WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_link_object WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_link_objects WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_libraries WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_library_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.set_library_dirs WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.create_static_lib WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.create_static_lib WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.link WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.define_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.undefine_macro WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler.add_include_dir WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.util.execute WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#distutils.file_util.move_file WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#distutils.dep_util.newer WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#distutils.dir_util.mkpath WARNING: unusable reference target found: apiref#module-distutils.file_util WARNING: unusable reference target found: apiref#distutils.file_util.copy_file WARNING: unusable reference target found: apiref#distutils.file_util.copy_file WARNING: unusable reference target found: apiref#distutils.util.get_platform WARNING: unusable reference target found: apiref#distutils.util.check_environ WARNING: unusable reference target found: apiref#distutils.util.byte_compile WARNING: unusable reference target found: apiref#distutils.fancy_getopt.fancy_getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt.getopt WARNING: unusable reference target found: apiref#distutils.fancy_getopt.FancyGetopt WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.sysconfig.PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.EXEC_PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.PREFIX WARNING: unusable reference target found: apiref#distutils.sysconfig.EXEC_PREFIX WARNING: unusable reference target found: apiref#distutils.ccompiler.CCompiler WARNING: unusable reference target found: apiref#module-distutils.sysconfig WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.warn WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.close WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.warn WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.unreadline WARNING: unusable reference target found: apiref#distutils.text_file.TextFile.readline WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#module-distutils.command WARNING: unusable reference target found: apiref#distutils.cmd.Command WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.initialize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.finalize_options WARNING: unusable reference target found: apiref#distutils.command.register.Command.run done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex resolving references... writing... WARNING: unusable reference target found: markup#doc-ref-role done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... WARNING: unusable reference target found: building#building WARNING: unusable reference target found: windows#building-on-windows WARNING: unusable reference target found: extending#methodtable WARNING: unusable reference target found: extending#parsetuple WARNING: unusable reference target found: extending#refcounts WARNING: unusable reference target found: extending#methodtable WARNING: unusable reference target found: extending#extending-simpleexample done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle make[1]: *** [build] Killed make[1]: Leaving directory `/home/neal/python/r26/Doc' make: *** [dist] Error 2 From buildbot at python.org Sun Jan 25 09:25:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 08:25:47 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090125082547.BD1021E4002@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/1814 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jesse.noller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From solipsis at pitrou.net Sun Jan 25 11:35:58 2009 From: solipsis at pitrou.net (Antoine Pitrou) Date: Sun, 25 Jan 2009 10:35:58 +0000 (UTC) Subject: [Python-checkins] =?utf-8?q?r68919_-_in_python/branches/py3k=3A?= =?utf-8?q?=09Doc/library/importlib=2ErstLib/importlib/NOTES=09Lib/?= =?utf-8?q?importlib/=5Fbootstrap=2Epy?= References: <20090125045631.31A691E4002@bag.python.org> Message-ID: writes: > + Only class methods are defined by this class to alleviate the need for > + instantiation. Why is it so? Is there some obvious performance improvement? Instantiation and normal methods are generally a more intuitive coding style than having only classmethods. Also, it means you can have several instances with different parameters each, and it eases testing (you can monkeypatch a test-specific instance without disrupting the whole stuff). From python-checkins at python.org Sun Jan 25 11:39:16 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 11:39:16 +0100 (CET) Subject: [Python-checkins] r68920 - python/trunk/Lib/decimal.py Message-ID: <20090125103916.33B6A1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 11:39:15 2009 New Revision: 68920 Log: Remove uses of cmp from the decimal module. Modified: python/trunk/Lib/decimal.py Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Sun Jan 25 11:39:15 2009 @@ -801,9 +801,16 @@ if self > other. This routine is for internal use only.""" if self._is_special or other._is_special: - return cmp(self._isinfinity(), other._isinfinity()) + self_inf = self._isinfinity() + other_inf = other._isinfinity() + if self_inf == other_inf: + return 0 + elif self_inf < other_inf: + return -1 + else: + return 1 - # check for zeros; note that cmp(0, -0) should return 0 + # check for zeros; Decimal('0') == Decimal('-0') if not self: if not other: return 0 @@ -823,7 +830,12 @@ if self_adjusted == other_adjusted: self_padded = self._int + '0'*(self._exp - other._exp) other_padded = other._int + '0'*(other._exp - self._exp) - return cmp(self_padded, other_padded) * (-1)**self._sign + if self_padded == other_padded: + return 0 + elif self_padded < other_padded: + return -(-1)**self._sign + else: + return (-1)**self._sign elif self_adjusted > other_adjusted: return (-1)**self._sign else: # self_adjusted < other_adjusted From python-checkins at python.org Sun Jan 25 11:47:45 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 11:47:45 +0100 (CET) Subject: [Python-checkins] r68921 - in python/branches/release26-maint: Lib/decimal.py Message-ID: <20090125104745.4775E1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 11:47:45 2009 New Revision: 68921 Log: Merged revisions 68920 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68920 | mark.dickinson | 2009-01-25 10:39:15 +0000 (Sun, 25 Jan 2009) | 2 lines Remove uses of cmp from the decimal module. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/decimal.py Modified: python/branches/release26-maint/Lib/decimal.py ============================================================================== --- python/branches/release26-maint/Lib/decimal.py (original) +++ python/branches/release26-maint/Lib/decimal.py Sun Jan 25 11:47:45 2009 @@ -760,9 +760,16 @@ if self > other. This routine is for internal use only.""" if self._is_special or other._is_special: - return cmp(self._isinfinity(), other._isinfinity()) + self_inf = self._isinfinity() + other_inf = other._isinfinity() + if self_inf == other_inf: + return 0 + elif self_inf < other_inf: + return -1 + else: + return 1 - # check for zeros; note that cmp(0, -0) should return 0 + # check for zeros; Decimal('0') == Decimal('-0') if not self: if not other: return 0 @@ -782,7 +789,12 @@ if self_adjusted == other_adjusted: self_padded = self._int + '0'*(self._exp - other._exp) other_padded = other._int + '0'*(other._exp - self._exp) - return cmp(self_padded, other_padded) * (-1)**self._sign + if self_padded == other_padded: + return 0 + elif self_padded < other_padded: + return -(-1)**self._sign + else: + return (-1)**self._sign elif self_adjusted > other_adjusted: return (-1)**self._sign else: # self_adjusted < other_adjusted From python-checkins at python.org Sun Jan 25 11:48:51 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 11:48:51 +0100 (CET) Subject: [Python-checkins] r68922 - in python/branches/py3k: Lib/decimal.py Message-ID: <20090125104851.B64AD1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 11:48:51 2009 New Revision: 68922 Log: Merged revisions 68920 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68920 | mark.dickinson | 2009-01-25 10:39:15 +0000 (Sun, 25 Jan 2009) | 2 lines Remove uses of cmp from the decimal module. ........ Modified: python/branches/py3k/ (props changed) 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 Sun Jan 25 11:48:51 2009 @@ -805,9 +805,16 @@ if self > other. This routine is for internal use only.""" if self._is_special or other._is_special: - return cmp(self._isinfinity(), other._isinfinity()) + self_inf = self._isinfinity() + other_inf = other._isinfinity() + if self_inf == other_inf: + return 0 + elif self_inf < other_inf: + return -1 + else: + return 1 - # check for zeros; note that cmp(0, -0) should return 0 + # check for zeros; Decimal('0') == Decimal('-0') if not self: if not other: return 0 @@ -827,7 +834,12 @@ if self_adjusted == other_adjusted: self_padded = self._int + '0'*(self._exp - other._exp) other_padded = other._int + '0'*(other._exp - self._exp) - return cmp(self_padded, other_padded) * (-1)**self._sign + if self_padded == other_padded: + return 0 + elif self_padded < other_padded: + return -(-1)**self._sign + else: + return (-1)**self._sign elif self_adjusted > other_adjusted: return (-1)**self._sign else: # self_adjusted < other_adjusted From python-checkins at python.org Sun Jan 25 11:50:40 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 11:50:40 +0100 (CET) Subject: [Python-checkins] r68923 - in python/branches/release30-maint: Lib/decimal.py Message-ID: <20090125105040.81F111E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 11:50:40 2009 New Revision: 68923 Log: Merged revisions 68922 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68922 | mark.dickinson | 2009-01-25 10:48:51 +0000 (Sun, 25 Jan 2009) | 9 lines Merged revisions 68920 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68920 | mark.dickinson | 2009-01-25 10:39:15 +0000 (Sun, 25 Jan 2009) | 2 lines Remove uses of cmp from the decimal module. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/decimal.py Modified: python/branches/release30-maint/Lib/decimal.py ============================================================================== --- python/branches/release30-maint/Lib/decimal.py (original) +++ python/branches/release30-maint/Lib/decimal.py Sun Jan 25 11:50:40 2009 @@ -764,9 +764,16 @@ if self > other. This routine is for internal use only.""" if self._is_special or other._is_special: - return cmp(self._isinfinity(), other._isinfinity()) + self_inf = self._isinfinity() + other_inf = other._isinfinity() + if self_inf == other_inf: + return 0 + elif self_inf < other_inf: + return -1 + else: + return 1 - # check for zeros; note that cmp(0, -0) should return 0 + # check for zeros; Decimal('0') == Decimal('-0') if not self: if not other: return 0 @@ -786,7 +793,12 @@ if self_adjusted == other_adjusted: self_padded = self._int + '0'*(self._exp - other._exp) other_padded = other._int + '0'*(other._exp - self._exp) - return cmp(self_padded, other_padded) * (-1)**self._sign + if self_padded == other_padded: + return 0 + elif self_padded < other_padded: + return -(-1)**self._sign + else: + return (-1)**self._sign elif self_adjusted > other_adjusted: return (-1)**self._sign else: # self_adjusted < other_adjusted From buildbot at python.org Sun Jan 25 12:14:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 11:14:29 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090125111429.9625E1E4002@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/12 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_json make: *** [buildbottest] Error 1 sincerely, -The Buildbot From ncoghlan at gmail.com Sun Jan 25 14:34:54 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sun, 25 Jan 2009 23:34:54 +1000 Subject: [Python-checkins] r68919 - in python/branches/py3k: Doc/library/importlib.rstLib/importlib/NOTES Lib/importlib/_bootstrap.py In-Reply-To: References: <20090125045631.31A691E4002@bag.python.org> Message-ID: <497C6A7E.80605@gmail.com> Antoine Pitrou wrote: > writes: >> + Only class methods are defined by this class to alleviate the need for >> + instantiation. > > Why is it so? Is there some obvious performance improvement? > Instantiation and normal methods are generally a more intuitive coding style > than having only classmethods. > Also, it means you can have several instances with different parameters each, > and it eases testing (you can monkeypatch a test-specific instance without > disrupting the whole stuff). Using a class with only class methods is the easiest way to implement a singleton in Python. Since the BuiltinImporter and FrozenImporter are singletons by definition, it makes sense to implement them that way. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From buildbot at python.org Sun Jan 25 14:42:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 13:42:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090125134219.C83B61E4002@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/84 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From barry at python.org Sun Jan 25 16:06:09 2009 From: barry at python.org (Barry Warsaw) Date: Sun, 25 Jan 2009 10:06:09 -0500 Subject: [Python-checkins] PEP 374 In-Reply-To: <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> References: <20090124230633.9B1801E4026@bag.python.org> <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> Message-ID: <6FC2E18B-F3FD-4B3F-90C0-4EA611AF93ED@python.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jan 24, 2009, at 6:40 PM, Raymond Hettinger wrote: > Somewhere near the top of the PEP, I think there should be a > discussion of reasons not to change at all. > > Everytime we alter the tool chain, it disrupts developers lives. > When I was working mainly under Windows, I was at one time the most > active contributor by a huge margin. Then Martin switched the build > to VC7 which caused me to go over year before I could make another > checkin to CPython. By then VC8 was out and VC7 was hard to find. > It crippled my development. When we switch tools, *every* developer > will have to go through an install, switchover, and learn a new set > of commands and checkin practices. The is a huge PITA and it is > almost certain that some developers won't bother. For many of the > developers that do bother, it will cost them a day of their lives > getting switched over and working through the learning curve -- that > is a day that could have been spent fixing bugs or doing something > non-administrative that actually adds value. > > Before we boot SVN, I think we need to be damned sure that there > will be HUGE offsetting benefits to a DVCS and be pretty sure that > our little community is actually ready for a distributed process. > > I'm concerned that over time we're moving towards a process that has > a lot more admin than we used to. Changes to PEP 8, rules on > indentation, review rules, etc seem to be driven by the least active > developers. Most of the folks who do most of the work rarely ask > for more restrictions, more admin, etc. Even little things like > automatically rejecting submissios without whitespace normalization > add to the admin burden (time spent doing something that doesn't > actually improve lives for end-users). > > SVN is relatively simple. DVCS systems are much more process > oriented and aimed at professional developers. I think we will lose > many newbie patches if the person is forced to use an unfamiliar > version control system. > > I like the quality of the research that you're doing but suspect > that the end goal of switching away from SVN may not be worth the > disruption and effects on real developers. I think it's proper and worthwhile to consider development process changes that a DVCS would afford or require, and the impact on contributions both from current core developers and future ones. Let's be sure to examine all aspects though. I happen to think that a dvcs will be only slightly more painful for core developers but that pain will be more than offset by providing non-core developers near first-class status in the development ecosystem. Non-core developers do not have that now and there are many times the number of potential contributors than there are current contributors. So yes, let's definitely think about the collateral changes that moving to a DVCS will entail. But let's be sure to look at it from both sides. Besides, certain developments like support for the svn wire protocol in bzr would make the WFC (we fear change :) argument moot. Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSXx/4XEjvBPtnXfVAQLDkwP/WI70x1UEjxMsL8YB+3H5ELRMhgaDVbdf IkodOEb0+NxXalyLfQavZylTV5NFgJ3v0kA76WhfqsNLEc7v7K2O6Ub1UDYL453M d9Z1+ok+t6U0XqfGbI6t8cMzMoqItIlyrDqpWApKrjnezkpT7x/PgSGzvZNGqrUl dGXagEqQ2ew= =SjJn -----END PGP SIGNATURE----- From barry at python.org Sun Jan 25 16:07:22 2009 From: barry at python.org (Barry Warsaw) Date: Sun, 25 Jan 2009 10:07:22 -0500 Subject: [Python-checkins] PEP 374 addenda In-Reply-To: <8D05F27DD8E640749774E2B6D34F0293@RaymondLaptop1> References: <20090124230633.9B1801E4026@bag.python.org> <8D05F27DD8E640749774E2B6D34F0293@RaymondLaptop1> Message-ID: <672A3BDD-D7BC-48E6-AE6A-B74B2EC266BD@python.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jan 24, 2009, at 6:47 PM, Raymond Hettinger wrote: > Also, how many developers or casual contributors will we > lose because they simply aren't willing to bear the transition costs? And how many will we gain with tools that allow them to participate more fully? Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSXyAKnEjvBPtnXfVAQLztAP/QAbhSG8Dn1OLlQZiaKJ8wg4dGCMKp4q+ xIgSrzLg72OfVAa/mxNdu6lYVIpiMiZNI8g/J2ZtRjr/ww+WPTA6wPhvcR8b+slh p+eBbuw4Qz+rjXk5bQxV6+HpvmqhmqBAE2XucuXxlaDDONSQV6busGu1mlBxVycM kjxOzSO634I= =pWrI -----END PGP SIGNATURE----- From python-checkins at python.org Sun Jan 25 17:34:27 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 25 Jan 2009 17:34:27 +0100 (CET) Subject: [Python-checkins] r68924 - in python/branches/py3k: Makefile.pre.in Misc/NEWS Python/ceval.c Python/makeopcodetargets.py Python/opcode_targets.h configure configure.in pyconfig.h.in Message-ID: <20090125163427.843B91E4010@bag.python.org> Author: antoine.pitrou Date: Sun Jan 25 17:34:23 2009 New Revision: 68924 Log: 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 speedups of up to 20%, depending on the system, on various benchmarks. Added: python/branches/py3k/Python/makeopcodetargets.py (contents, props changed) python/branches/py3k/Python/opcode_targets.h (contents, props changed) Modified: python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/NEWS python/branches/py3k/Python/ceval.c python/branches/py3k/configure python/branches/py3k/configure.in python/branches/py3k/pyconfig.h.in Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sun Jan 25 17:34:23 2009 @@ -247,6 +247,16 @@ ########################################################################## # Python + +OPCODETARGETS_H= \ + $(srcdir)/Python/opcode_targets.h + +OPCODETARGETGEN= \ + $(srcdir)/Python/makeopcodetargets.py + +OPCODETARGETGEN_FILES= \ + $(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py + PYTHON_OBJS= \ Python/_warnings.o \ Python/Python-ast.o \ @@ -567,6 +577,11 @@ $(BYTESTR_DEPS) \ $(srcdir)/Objects/stringlib/formatter.h +$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) + $(OPCODETARGETGEN) $(OPCODETARGETS_H) + +Python/ceval.o: $(OPCODETARGETS_H) + Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ $(BYTESTR_DEPS) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 25 17:34:23 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- 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 + speedups of up to 20%, depending on the system, on various benchmarks. + - Issue #4874: Most builtin decoders now reject unicode input. - Issue #4842: Don't allow trailing 'L' when constructing an integer Modified: python/branches/py3k/Python/ceval.c ============================================================================== --- python/branches/py3k/Python/ceval.c (original) +++ python/branches/py3k/Python/ceval.c Sun Jan 25 17:34:23 2009 @@ -705,6 +705,114 @@ char *filename; #endif +/* Computed GOTOs, or + the-optimization-commonly-but-improperly-known-as-"threaded code" + using gcc's labels-as-values extension + (http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html). + + The traditional bytecode evaluation loop uses a "switch" statement, which + decent compilers will optimize as a single indirect branch instruction + combined with a lookup table of jump addresses. However, since the + indirect jump instruction is shared by all opcodes, the CPU will have a + hard time making the right prediction for where to jump next (actually, + it will be always wrong except in the uncommon case of a sequence of + several identical opcodes). + + "Threaded code" in contrast, uses an explicit jump table and an explicit + indirect jump instruction at the end of each opcode. Since the jump + instruction is at a different address for each opcode, the CPU will make a + separate prediction for each of these instructions, which is equivalent to + predicting the second opcode of each opcode pair. These predictions have + a much better chance to turn out valid, especially in small bytecode loops. + + A mispredicted branch on a modern CPU flushes the whole pipeline and + can cost several CPU cycles (depending on the pipeline depth), + and potentially many more instructions (depending on the pipeline width). + A correctly predicted branch, however, is nearly free. + + At the time of this writing, the "threaded code" version is up to 15-20% + faster than the normal "switch" version, depending on the compiler and the + CPU architecture. + + We disable the optimization if DYNAMIC_EXECUTION_PROFILE is defined, + because it would render the measurements invalid. + + + NOTE: care must be taken that the compiler doesn't try to "optimize" the + indirect jumps by sharing them between all opcodes. Such optimizations + can be disabled on gcc by using the -fno-gcse flag (or possibly + -fno-crossjumping). +*/ + +#if defined(USE_COMPUTED_GOTOS) && defined(DYNAMIC_EXECUTION_PROFILE) +#undef USE_COMPUTED_GOTOS +#endif + +#ifdef USE_COMPUTED_GOTOS +/* Import the static jump table */ +#include "opcode_targets.h" + +/* This macro is used when several opcodes defer to the same implementation + (e.g. SETUP_LOOP, SETUP_FINALLY) */ +#define TARGET_WITH_IMPL(op, impl) \ + TARGET_##op: \ + opcode = op; \ + if (HAS_ARG(op)) \ + oparg = NEXTARG(); \ + case op: \ + goto impl; \ + +#define TARGET(op) \ + TARGET_##op: \ + opcode = op; \ + if (HAS_ARG(op)) \ + oparg = NEXTARG(); \ + case op: + + +#define DISPATCH() \ + { \ + /* Avoid multiple loads from _Py_Ticker despite `volatile` */ \ + int _tick = _Py_Ticker - 1; \ + _Py_Ticker = _tick; \ + if (_tick >= 0) { \ + FAST_DISPATCH(); \ + } \ + continue; \ + } + +#ifdef LLTRACE +#define FAST_DISPATCH() \ + { \ + if (!lltrace && !_Py_TracingPossible) { \ + f->f_lasti = INSTR_OFFSET(); \ + goto *opcode_targets[*next_instr++]; \ + } \ + goto fast_next_opcode; \ + } +#else +#define FAST_DISPATCH() \ + { \ + if (!_Py_TracingPossible) { \ + f->f_lasti = INSTR_OFFSET(); \ + goto *opcode_targets[*next_instr++]; \ + } \ + goto fast_next_opcode; \ + } +#endif + +#else +#define TARGET(op) \ + case op: +#define TARGET_WITH_IMPL(op, impl) \ + /* silence compiler warnings about `impl` unused */ \ + if (0) goto impl; \ + case op: +#define DISPATCH() continue +#define FAST_DISPATCH() goto fast_next_opcode +#endif + + /* Tuple access macros */ #ifndef Py_DEBUG @@ -782,16 +890,23 @@ predictions turned-on and interpret the results as if some opcodes had been combined or turn-off predictions so that the opcode frequency counter updates for both opcodes. + + Opcode prediction is disabled with threaded code, since the latter allows + the CPU to record separate branch prediction information for each + opcode. + */ -#ifdef DYNAMIC_EXECUTION_PROFILE +#if defined(DYNAMIC_EXECUTION_PROFILE) || defined(USE_COMPUTED_GOTOS) #define PREDICT(op) if (0) goto PRED_##op +#define PREDICTED(op) PRED_##op: +#define PREDICTED_WITH_ARG(op) PRED_##op: #else #define PREDICT(op) if (*next_instr == op) goto PRED_##op -#endif - #define PREDICTED(op) PRED_##op: next_instr++ #define PREDICTED_WITH_ARG(op) PRED_##op: oparg = PEEKARG(); next_instr += 3 +#endif + /* Stack manipulation macros */ @@ -1153,56 +1268,56 @@ /* case STOP_CODE: this is an error! */ - case NOP: - goto fast_next_opcode; + TARGET(NOP) + FAST_DISPATCH(); - case LOAD_FAST: + TARGET(LOAD_FAST) x = GETLOCAL(oparg); if (x != NULL) { Py_INCREF(x); PUSH(x); - goto fast_next_opcode; + FAST_DISPATCH(); } format_exc_check_arg(PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, PyTuple_GetItem(co->co_varnames, oparg)); break; - case LOAD_CONST: + TARGET(LOAD_CONST) x = GETITEM(consts, oparg); Py_INCREF(x); PUSH(x); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED_WITH_ARG(STORE_FAST); - case STORE_FAST: + TARGET(STORE_FAST) v = POP(); SETLOCAL(oparg, v); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED(POP_TOP); - case POP_TOP: + TARGET(POP_TOP) v = POP(); Py_DECREF(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_TWO: + TARGET(ROT_TWO) v = TOP(); w = SECOND(); SET_TOP(w); SET_SECOND(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_THREE: + TARGET(ROT_THREE) v = TOP(); w = SECOND(); x = THIRD(); SET_TOP(w); SET_SECOND(x); SET_THIRD(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_FOUR: + TARGET(ROT_FOUR) u = TOP(); v = SECOND(); w = THIRD(); @@ -1211,15 +1326,15 @@ SET_SECOND(w); SET_THIRD(x); SET_FOURTH(u); - goto fast_next_opcode; + FAST_DISPATCH(); - case DUP_TOP: + TARGET(DUP_TOP) v = TOP(); Py_INCREF(v); PUSH(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case DUP_TOPX: + TARGET(DUP_TOPX) if (oparg == 2) { x = TOP(); Py_INCREF(x); @@ -1228,7 +1343,7 @@ STACKADJ(2); SET_TOP(x); SET_SECOND(w); - goto fast_next_opcode; + FAST_DISPATCH(); } else if (oparg == 3) { x = TOP(); Py_INCREF(x); @@ -1240,106 +1355,106 @@ SET_TOP(x); SET_SECOND(w); SET_THIRD(v); - goto fast_next_opcode; + FAST_DISPATCH(); } Py_FatalError("invalid argument to DUP_TOPX" " (bytecode corruption?)"); /* Never returns, so don't bother to set why. */ break; - case UNARY_POSITIVE: + TARGET(UNARY_POSITIVE) v = TOP(); x = PyNumber_Positive(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case UNARY_NEGATIVE: + TARGET(UNARY_NEGATIVE) v = TOP(); x = PyNumber_Negative(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case UNARY_NOT: + TARGET(UNARY_NOT) v = TOP(); err = PyObject_IsTrue(v); Py_DECREF(v); if (err == 0) { Py_INCREF(Py_True); SET_TOP(Py_True); - continue; + DISPATCH(); } else if (err > 0) { Py_INCREF(Py_False); SET_TOP(Py_False); err = 0; - continue; + DISPATCH(); } STACKADJ(-1); break; - case UNARY_INVERT: + TARGET(UNARY_INVERT) v = TOP(); x = PyNumber_Invert(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_POWER: + TARGET(BINARY_POWER) w = POP(); v = TOP(); x = PyNumber_Power(v, w, Py_None); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_MULTIPLY: + TARGET(BINARY_MULTIPLY) w = POP(); v = TOP(); x = PyNumber_Multiply(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_TRUE_DIVIDE: + TARGET(BINARY_TRUE_DIVIDE) w = POP(); v = TOP(); x = PyNumber_TrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_FLOOR_DIVIDE: + TARGET(BINARY_FLOOR_DIVIDE) w = POP(); v = TOP(); x = PyNumber_FloorDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_MODULO: + TARGET(BINARY_MODULO) w = POP(); v = TOP(); x = PyNumber_Remainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_ADD: + TARGET(BINARY_ADD) w = POP(); v = TOP(); if (PyUnicode_CheckExact(v) && @@ -1355,152 +1470,152 @@ skip_decref_vx: Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_SUBTRACT: + TARGET(BINARY_SUBTRACT) w = POP(); v = TOP(); x = PyNumber_Subtract(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_SUBSCR: + TARGET(BINARY_SUBSCR) w = POP(); v = TOP(); x = PyObject_GetItem(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_LSHIFT: + TARGET(BINARY_LSHIFT) w = POP(); v = TOP(); x = PyNumber_Lshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_RSHIFT: + TARGET(BINARY_RSHIFT) w = POP(); v = TOP(); x = PyNumber_Rshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_AND: + TARGET(BINARY_AND) w = POP(); v = TOP(); x = PyNumber_And(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_XOR: + TARGET(BINARY_XOR) w = POP(); v = TOP(); x = PyNumber_Xor(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_OR: + TARGET(BINARY_OR) w = POP(); v = TOP(); x = PyNumber_Or(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case LIST_APPEND: + TARGET(LIST_APPEND) w = POP(); v = stack_pointer[-oparg]; err = PyList_Append(v, w); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case SET_ADD: + TARGET(SET_ADD) w = POP(); v = stack_pointer[-oparg]; err = PySet_Add(v, w); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case INPLACE_POWER: + TARGET(INPLACE_POWER) w = POP(); v = TOP(); x = PyNumber_InPlacePower(v, w, Py_None); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_MULTIPLY: + TARGET(INPLACE_MULTIPLY) w = POP(); v = TOP(); x = PyNumber_InPlaceMultiply(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_TRUE_DIVIDE: + TARGET(INPLACE_TRUE_DIVIDE) w = POP(); v = TOP(); x = PyNumber_InPlaceTrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_FLOOR_DIVIDE: + TARGET(INPLACE_FLOOR_DIVIDE) w = POP(); v = TOP(); x = PyNumber_InPlaceFloorDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_MODULO: + TARGET(INPLACE_MODULO) w = POP(); v = TOP(); x = PyNumber_InPlaceRemainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_ADD: + TARGET(INPLACE_ADD) w = POP(); v = TOP(); if (PyUnicode_CheckExact(v) && @@ -1516,70 +1631,70 @@ skip_decref_v: Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_SUBTRACT: + TARGET(INPLACE_SUBTRACT) w = POP(); v = TOP(); x = PyNumber_InPlaceSubtract(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_LSHIFT: + TARGET(INPLACE_LSHIFT) w = POP(); v = TOP(); x = PyNumber_InPlaceLshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_RSHIFT: + TARGET(INPLACE_RSHIFT) w = POP(); v = TOP(); x = PyNumber_InPlaceRshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_AND: + TARGET(INPLACE_AND) w = POP(); v = TOP(); x = PyNumber_InPlaceAnd(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_XOR: + TARGET(INPLACE_XOR) w = POP(); v = TOP(); x = PyNumber_InPlaceXor(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_OR: + TARGET(INPLACE_OR) w = POP(); v = TOP(); x = PyNumber_InPlaceOr(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case STORE_SUBSCR: + TARGET(STORE_SUBSCR) w = TOP(); v = SECOND(); u = THIRD(); @@ -1589,10 +1704,10 @@ Py_DECREF(u); Py_DECREF(v); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_SUBSCR: + TARGET(DELETE_SUBSCR) w = TOP(); v = SECOND(); STACKADJ(-2); @@ -1600,10 +1715,10 @@ err = PyObject_DelItem(v, w); Py_DECREF(v); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case PRINT_EXPR: + TARGET(PRINT_EXPR) v = POP(); w = PySys_GetObject("displayhook"); if (w == NULL) { @@ -1630,7 +1745,7 @@ #ifdef CASE_TOO_BIG default: switch (opcode) { #endif - case RAISE_VARARGS: + TARGET(RAISE_VARARGS) v = w = NULL; switch (oparg) { case 2: @@ -1648,19 +1763,19 @@ } break; - case STORE_LOCALS: + TARGET(STORE_LOCALS) x = POP(); v = f->f_locals; Py_XDECREF(v); f->f_locals = x; - continue; + DISPATCH(); - case RETURN_VALUE: + TARGET(RETURN_VALUE) retval = POP(); why = WHY_RETURN; goto fast_block_end; - case YIELD_VALUE: + TARGET(YIELD_VALUE) retval = POP(); f->f_stacktop = stack_pointer; why = WHY_YIELD; @@ -1670,7 +1785,7 @@ SWAP_EXC_STATE(); goto fast_yield; - case POP_EXCEPT: + TARGET(POP_EXCEPT) { PyTryBlock *b = PyFrame_BlockPop(f); if (b->b_type != EXCEPT_HANDLER) { @@ -1681,17 +1796,17 @@ } UNWIND_EXCEPT_HANDLER(b); } - continue; + DISPATCH(); - case POP_BLOCK: + TARGET(POP_BLOCK) { PyTryBlock *b = PyFrame_BlockPop(f); UNWIND_BLOCK(b); } - continue; + DISPATCH(); PREDICTED(END_FINALLY); - case END_FINALLY: + TARGET(END_FINALLY) v = POP(); if (PyLong_Check(v)) { why = (enum why_code) PyLong_AS_LONG(v); @@ -1731,7 +1846,7 @@ Py_DECREF(v); break; - case LOAD_BUILD_CLASS: + TARGET(LOAD_BUILD_CLASS) x = PyDict_GetItemString(f->f_builtins, "__build_class__"); if (x == NULL) { @@ -1743,7 +1858,7 @@ PUSH(x); break; - case STORE_NAME: + TARGET(STORE_NAME) w = GETITEM(names, oparg); v = POP(); if ((x = f->f_locals) != NULL) { @@ -1752,14 +1867,14 @@ else err = PyObject_SetItem(x, w, v); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; } PyErr_Format(PyExc_SystemError, "no locals found when storing %R", w); break; - case DELETE_NAME: + TARGET(DELETE_NAME) w = GETITEM(names, oparg); if ((x = f->f_locals) != NULL) { if ((err = PyObject_DelItem(x, w)) != 0) @@ -1773,7 +1888,7 @@ break; PREDICTED_WITH_ARG(UNPACK_SEQUENCE); - case UNPACK_SEQUENCE: + TARGET(UNPACK_SEQUENCE) v = POP(); if (PyTuple_CheckExact(v) && PyTuple_GET_SIZE(v) == oparg) { @@ -1785,7 +1900,7 @@ PUSH(w); } Py_DECREF(v); - continue; + DISPATCH(); } else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) { PyObject **items = \ @@ -1805,7 +1920,7 @@ Py_DECREF(v); break; - case UNPACK_EX: + TARGET(UNPACK_EX) { int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); v = POP(); @@ -1820,7 +1935,7 @@ break; } - case STORE_ATTR: + TARGET(STORE_ATTR) w = GETITEM(names, oparg); v = TOP(); u = SECOND(); @@ -1828,10 +1943,10 @@ err = PyObject_SetAttr(v, w, u); /* v.w = u */ Py_DECREF(v); Py_DECREF(u); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_ATTR: + TARGET(DELETE_ATTR) w = GETITEM(names, oparg); v = POP(); err = PyObject_SetAttr(v, w, (PyObject *)NULL); @@ -1839,22 +1954,22 @@ Py_DECREF(v); break; - case STORE_GLOBAL: + TARGET(STORE_GLOBAL) w = GETITEM(names, oparg); v = POP(); err = PyDict_SetItem(f->f_globals, w, v); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_GLOBAL: + TARGET(DELETE_GLOBAL) w = GETITEM(names, oparg); if ((err = PyDict_DelItem(f->f_globals, w)) != 0) format_exc_check_arg( PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w); break; - case LOAD_NAME: + TARGET(LOAD_NAME) w = GETITEM(names, oparg); if ((v = f->f_locals) == NULL) { PyErr_Format(PyExc_SystemError, @@ -1889,9 +2004,9 @@ Py_INCREF(x); } PUSH(x); - continue; + DISPATCH(); - case LOAD_GLOBAL: + TARGET(LOAD_GLOBAL) w = GETITEM(names, oparg); if (PyUnicode_CheckExact(w)) { /* Inline the PyDict_GetItem() calls. @@ -1911,7 +2026,7 @@ if (x != NULL) { Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); } d = (PyDictObject *)(f->f_builtins); e = d->ma_lookup(d, w, hash); @@ -1923,7 +2038,7 @@ if (x != NULL) { Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); } goto load_global_error; } @@ -1942,13 +2057,13 @@ } Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); - case DELETE_FAST: + TARGET(DELETE_FAST) x = GETLOCAL(oparg); if (x != NULL) { SETLOCAL(oparg, NULL); - continue; + DISPATCH(); } format_exc_check_arg( PyExc_UnboundLocalError, @@ -1957,19 +2072,19 @@ ); break; - case LOAD_CLOSURE: + TARGET(LOAD_CLOSURE) x = freevars[oparg]; Py_INCREF(x); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case LOAD_DEREF: + TARGET(LOAD_DEREF) x = freevars[oparg]; w = PyCell_Get(x); if (w != NULL) { PUSH(w); - continue; + DISPATCH(); } err = -1; /* Don't stomp existing exception */ @@ -1990,14 +2105,14 @@ } break; - case STORE_DEREF: + TARGET(STORE_DEREF) w = POP(); x = freevars[oparg]; PyCell_Set(x, w); Py_DECREF(w); - continue; + DISPATCH(); - case BUILD_TUPLE: + TARGET(BUILD_TUPLE) x = PyTuple_New(oparg); if (x != NULL) { for (; --oparg >= 0;) { @@ -2005,11 +2120,11 @@ PyTuple_SET_ITEM(x, oparg, w); } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_LIST: + TARGET(BUILD_LIST) x = PyList_New(oparg); if (x != NULL) { for (; --oparg >= 0;) { @@ -2017,11 +2132,11 @@ PyList_SET_ITEM(x, oparg, w); } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_SET: + TARGET(BUILD_SET) x = PySet_New(NULL); if (x != NULL) { for (; --oparg >= 0;) { @@ -2035,17 +2150,17 @@ break; } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_MAP: + TARGET(BUILD_MAP) x = _PyDict_NewPresized((Py_ssize_t)oparg); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case STORE_MAP: + TARGET(STORE_MAP) w = TOP(); /* key */ u = SECOND(); /* value */ v = THIRD(); /* dict */ @@ -2054,10 +2169,10 @@ err = PyDict_SetItem(v, w, u); /* v[w] = u */ Py_DECREF(u); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case MAP_ADD: + TARGET(MAP_ADD) w = TOP(); /* key */ u = SECOND(); /* value */ STACKADJ(-2); @@ -2068,20 +2183,20 @@ Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case LOAD_ATTR: + TARGET(LOAD_ATTR) w = GETITEM(names, oparg); v = TOP(); x = PyObject_GetAttr(v, w); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case COMPARE_OP: + TARGET(COMPARE_OP) w = POP(); v = TOP(); x = cmp_outcome(oparg, v, w); @@ -2091,9 +2206,9 @@ if (x == NULL) break; PREDICT(JUMP_IF_FALSE); PREDICT(JUMP_IF_TRUE); - continue; + DISPATCH(); - case IMPORT_NAME: + TARGET(IMPORT_NAME) w = GETITEM(names, oparg); x = PyDict_GetItemString(f->f_builtins, "__import__"); if (x == NULL) { @@ -2134,10 +2249,10 @@ READ_TIMESTAMP(intr1); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case IMPORT_STAR: + TARGET(IMPORT_STAR) v = POP(); PyFrame_FastToLocals(f); if ((x = f->f_locals) == NULL) { @@ -2150,33 +2265,33 @@ READ_TIMESTAMP(intr1); PyFrame_LocalsToFast(f, 0); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case IMPORT_FROM: + TARGET(IMPORT_FROM) w = GETITEM(names, oparg); v = TOP(); READ_TIMESTAMP(intr0); x = import_from(v, w); READ_TIMESTAMP(intr1); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case JUMP_FORWARD: + TARGET(JUMP_FORWARD) JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED_WITH_ARG(JUMP_IF_FALSE); - case JUMP_IF_FALSE: + TARGET(JUMP_IF_FALSE) w = TOP(); if (w == Py_True) { PREDICT(POP_TOP); - goto fast_next_opcode; + FAST_DISPATCH(); } if (w == Py_False) { JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); } err = PyObject_IsTrue(w); if (err > 0) @@ -2185,18 +2300,18 @@ JUMPBY(oparg); else break; - continue; + DISPATCH(); PREDICTED_WITH_ARG(JUMP_IF_TRUE); - case JUMP_IF_TRUE: + TARGET(JUMP_IF_TRUE) w = TOP(); if (w == Py_False) { PREDICT(POP_TOP); - goto fast_next_opcode; + FAST_DISPATCH(); } if (w == Py_True) { JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); } err = PyObject_IsTrue(w); if (err > 0) { @@ -2207,10 +2322,10 @@ ; else break; - continue; + DISPATCH(); PREDICTED_WITH_ARG(JUMP_ABSOLUTE); - case JUMP_ABSOLUTE: + TARGET(JUMP_ABSOLUTE) JUMPTO(oparg); #if FAST_LOOPS /* Enabling this path speeds-up all while and for-loops by bypassing @@ -2218,14 +2333,14 @@ because it prevents detection of a control-break in tight loops like "while 1: pass". Compile with this option turned-on when you need the speed-up and do not need break checking inside tight loops (ones - that contain only instructions ending with goto fast_next_opcode). + that contain only instructions ending with FAST_DISPATCH). */ - goto fast_next_opcode; + FAST_DISPATCH(); #else - continue; + DISPATCH(); #endif - case GET_ITER: + TARGET(GET_ITER) /* before: [obj]; after [getiter(obj)] */ v = TOP(); x = PyObject_GetIter(v); @@ -2233,13 +2348,13 @@ if (x != NULL) { SET_TOP(x); PREDICT(FOR_ITER); - continue; + DISPATCH(); } STACKADJ(-1); break; PREDICTED_WITH_ARG(FOR_ITER); - case FOR_ITER: + TARGET(FOR_ITER) /* before: [iter]; after: [iter, iter()] *or* [] */ v = TOP(); x = (*v->ob_type->tp_iternext)(v); @@ -2247,7 +2362,7 @@ PUSH(x); PREDICT(STORE_FAST); PREDICT(UNPACK_SEQUENCE); - continue; + DISPATCH(); } if (PyErr_Occurred()) { if (!PyErr_ExceptionMatches( @@ -2259,13 +2374,13 @@ x = v = POP(); Py_DECREF(v); JUMPBY(oparg); - continue; + DISPATCH(); - case BREAK_LOOP: + TARGET(BREAK_LOOP) why = WHY_BREAK; goto fast_block_end; - case CONTINUE_LOOP: + TARGET(CONTINUE_LOOP) retval = PyLong_FromLong(oparg); if (!retval) { x = NULL; @@ -2274,9 +2389,10 @@ why = WHY_CONTINUE; goto fast_block_end; - case SETUP_LOOP: - case SETUP_EXCEPT: - case SETUP_FINALLY: + TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally) + TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally) + TARGET(SETUP_FINALLY) + _setup_finally: /* NOTE: If you add any new block-setup opcodes that are not try/except/finally handlers, you may need to update the PyGen_NeedsFinalizing() function. @@ -2284,9 +2400,9 @@ PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg, STACK_LEVEL()); - continue; + DISPATCH(); - case WITH_CLEANUP: + TARGET(WITH_CLEANUP) { /* At the top of the stack are 1-3 values indicating how/why we entered the finally clause: @@ -2350,7 +2466,7 @@ break; } - case CALL_FUNCTION: + TARGET(CALL_FUNCTION) { PyObject **sp; PCALL(PCALL_ALL); @@ -2363,13 +2479,14 @@ stack_pointer = sp; PUSH(x); if (x != NULL) - continue; + DISPATCH(); break; } - case CALL_FUNCTION_VAR: - case CALL_FUNCTION_KW: - case CALL_FUNCTION_VAR_KW: + TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw) + TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw) + TARGET(CALL_FUNCTION_VAR_KW) + _call_function_var_kw: { int na = oparg & 0xff; int nk = (oparg>>8) & 0xff; @@ -2409,12 +2526,13 @@ } PUSH(x); if (x != NULL) - continue; + DISPATCH(); break; } - case MAKE_CLOSURE: - case MAKE_FUNCTION: + TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function) + TARGET(MAKE_FUNCTION) + _make_function: { int posdefaults = oparg & 0xff; int kwdefaults = (oparg>>8) & 0xff; @@ -2507,7 +2625,7 @@ break; } - case BUILD_SLICE: + TARGET(BUILD_SLICE) if (oparg == 3) w = POP(); else @@ -2519,14 +2637,17 @@ Py_DECREF(v); Py_XDECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case EXTENDED_ARG: + TARGET(EXTENDED_ARG) opcode = NEXTOP(); oparg = oparg<<16 | NEXTARG(); goto dispatch_opcode; +#ifdef USE_COMPUTED_GOTOS + _unknown_opcode: +#endif default: fprintf(stderr, "XXX lineno: %d, opcode: %d\n", Added: python/branches/py3k/Python/makeopcodetargets.py ============================================================================== --- (empty file) +++ python/branches/py3k/Python/makeopcodetargets.py Sun Jan 25 17:34:23 2009 @@ -0,0 +1,43 @@ +#! /usr/bin/env python +"""Generate C code for the jump table of the threaded code interpreter +(for compilers supporting computed gotos or "labels-as-values", such as gcc). +""" + +import imp +import os + + +def find_module(modname): + """Finds and returns a module in the local dist/checkout. + """ + modpath = os.path.join( + os.path.dirname(os.path.dirname(__file__)), "Lib") + return imp.load_module(modname, *imp.find_module(modname, [modpath])) + +def write_contents(f): + """Write C code contents to the target file object. + """ + opcode = find_module("opcode") + targets = ['_unknown_opcode'] * 256 + for opname, op in opcode.opmap.items(): + if opname == "STOP_CODE": + # XXX opcode not implemented + 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};\n") + + +if __name__ == "__main__": + import sys + assert len(sys.argv) < 3, "Too many arguments" + if len(sys.argv) == 2: + target = sys.argv[1] + else: + target = "Python/opcode_targets.h" + f = open(target, "w") + try: + write_contents(f) + finally: + f.close() Added: python/branches/py3k/Python/opcode_targets.h ============================================================================== --- (empty file) +++ python/branches/py3k/Python/opcode_targets.h Sun Jan 25 17:34:23 2009 @@ -0,0 +1,258 @@ +static void *opcode_targets[256] = { + &&_unknown_opcode, + &&TARGET_POP_TOP, + &&TARGET_ROT_TWO, + &&TARGET_ROT_THREE, + &&TARGET_DUP_TOP, + &&TARGET_ROT_FOUR, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_NOP, + &&TARGET_UNARY_POSITIVE, + &&TARGET_UNARY_NEGATIVE, + &&TARGET_UNARY_NOT, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_UNARY_INVERT, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_BINARY_POWER, + &&TARGET_BINARY_MULTIPLY, + &&_unknown_opcode, + &&TARGET_BINARY_MODULO, + &&TARGET_BINARY_ADD, + &&TARGET_BINARY_SUBTRACT, + &&TARGET_BINARY_SUBSCR, + &&TARGET_BINARY_FLOOR_DIVIDE, + &&TARGET_BINARY_TRUE_DIVIDE, + &&TARGET_INPLACE_FLOOR_DIVIDE, + &&TARGET_INPLACE_TRUE_DIVIDE, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_STORE_MAP, + &&TARGET_INPLACE_ADD, + &&TARGET_INPLACE_SUBTRACT, + &&TARGET_INPLACE_MULTIPLY, + &&_unknown_opcode, + &&TARGET_INPLACE_MODULO, + &&TARGET_STORE_SUBSCR, + &&TARGET_DELETE_SUBSCR, + &&TARGET_BINARY_LSHIFT, + &&TARGET_BINARY_RSHIFT, + &&TARGET_BINARY_AND, + &&TARGET_BINARY_XOR, + &&TARGET_BINARY_OR, + &&TARGET_INPLACE_POWER, + &&TARGET_GET_ITER, + &&TARGET_STORE_LOCALS, + &&TARGET_PRINT_EXPR, + &&TARGET_LOAD_BUILD_CLASS, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_INPLACE_LSHIFT, + &&TARGET_INPLACE_RSHIFT, + &&TARGET_INPLACE_AND, + &&TARGET_INPLACE_XOR, + &&TARGET_INPLACE_OR, + &&TARGET_BREAK_LOOP, + &&TARGET_WITH_CLEANUP, + &&_unknown_opcode, + &&TARGET_RETURN_VALUE, + &&TARGET_IMPORT_STAR, + &&_unknown_opcode, + &&TARGET_YIELD_VALUE, + &&TARGET_POP_BLOCK, + &&TARGET_END_FINALLY, + &&TARGET_POP_EXCEPT, + &&TARGET_STORE_NAME, + &&TARGET_DELETE_NAME, + &&TARGET_UNPACK_SEQUENCE, + &&TARGET_FOR_ITER, + &&TARGET_UNPACK_EX, + &&TARGET_STORE_ATTR, + &&TARGET_DELETE_ATTR, + &&TARGET_STORE_GLOBAL, + &&TARGET_DELETE_GLOBAL, + &&TARGET_DUP_TOPX, + &&TARGET_LOAD_CONST, + &&TARGET_LOAD_NAME, + &&TARGET_BUILD_TUPLE, + &&TARGET_BUILD_LIST, + &&TARGET_BUILD_SET, + &&TARGET_BUILD_MAP, + &&TARGET_LOAD_ATTR, + &&TARGET_COMPARE_OP, + &&TARGET_IMPORT_NAME, + &&TARGET_IMPORT_FROM, + &&TARGET_JUMP_FORWARD, + &&TARGET_JUMP_IF_FALSE, + &&TARGET_JUMP_IF_TRUE, + &&TARGET_JUMP_ABSOLUTE, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_LOAD_GLOBAL, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_CONTINUE_LOOP, + &&TARGET_SETUP_LOOP, + &&TARGET_SETUP_EXCEPT, + &&TARGET_SETUP_FINALLY, + &&_unknown_opcode, + &&TARGET_LOAD_FAST, + &&TARGET_STORE_FAST, + &&TARGET_DELETE_FAST, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_RAISE_VARARGS, + &&TARGET_CALL_FUNCTION, + &&TARGET_MAKE_FUNCTION, + &&TARGET_BUILD_SLICE, + &&TARGET_MAKE_CLOSURE, + &&TARGET_LOAD_CLOSURE, + &&TARGET_LOAD_DEREF, + &&TARGET_STORE_DEREF, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_CALL_FUNCTION_VAR, + &&TARGET_CALL_FUNCTION_KW, + &&TARGET_CALL_FUNCTION_VAR_KW, + &&TARGET_EXTENDED_ARG, + &&_unknown_opcode, + &&TARGET_LIST_APPEND, + &&TARGET_SET_ADD, + &&TARGET_MAP_ADD, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode +}; Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sun Jan 25 17:34:23 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 68300 . +# From configure.in Revision: 68440 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for python 3.1. +# Generated by GNU Autoconf 2.63 for python 3.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,7 +18,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -40,17 +40,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -66,8 +94,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -90,7 +116,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -103,17 +129,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -135,7 +154,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -161,7 +180,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -243,7 +262,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -264,7 +283,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -344,10 +363,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -416,9 +435,10 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf at gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -454,7 +474,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -482,7 +502,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -495,19 +514,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -532,10 +554,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -616,123 +638,153 @@ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -VERSION -SOVERSION -CONFIG_ARGS -UNIVERSALSDK -ARCH_RUN_32BIT -PYTHONFRAMEWORK -PYTHONFRAMEWORKIDENTIFIER -PYTHONFRAMEWORKDIR -PYTHONFRAMEWORKPREFIX -PYTHONFRAMEWORKINSTALLDIR -FRAMEWORKINSTALLFIRST -FRAMEWORKINSTALLLAST -FRAMEWORKALTINSTALLFIRST -FRAMEWORKALTINSTALLLAST -FRAMEWORKUNIXTOOLSPREFIX -MACHDEP -SGI_ABI -CONFIGURE_MACOSX_DEPLOYMENT_TARGET -EXPORT_MACOSX_DEPLOYMENT_TARGET -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CXX -MAINCC -CPP -GREP -EGREP -BUILDEXEEXT -LIBRARY -LDLIBRARY -DLLLIBRARY -BLDLIBRARY -LDLIBRARYDIR -INSTSONAME -RUNSHARED -LINKCC -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 +ac_subst_vars='LTLIBOBJS SRCDIRS -LTLIBOBJS' +THREADHEADERS +LIBC +LIBM +HAVE_GETHOSTBYNAME +HAVE_GETHOSTBYNAME_R +HAVE_GETHOSTBYNAME_R_3_ARG +HAVE_GETHOSTBYNAME_R_5_ARG +HAVE_GETHOSTBYNAME_R_6_ARG +LIBOBJS +TRUE +MACHDEP_OBJS +DYNLOADFILE +DLINCLDIR +THREADOBJ +LDLAST +USE_THREAD_MODULE +SIGNAL_OBJS +USE_SIGNAL_MODULE +SHLIBS +CFLAGSFORSHARED +LINKFORSHARED +CCSHARED +BLDSHARED +LDSHARED +SO +LIBTOOL_CRUFT +OTHER_LIBTOOL_OPT +UNIVERSAL_ARCH_FLAGS +BASECFLAGS +OPT +LN +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SVNVERSION +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 +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_universalsdk +with_universal_archs +with_framework_name +enable_framework +with_gcc +with_cxx_main +with_suffix +enable_shared +enable_profiling +with_pydebug +with_libs +with_system_ffi +with_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 @@ -747,6 +799,8 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -845,13 +899,21 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -864,13 +926,21 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1061,22 +1131,38 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1096,7 +1182,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1105,16 +1191,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1123,22 +1209,38 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1153,7 +1255,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1169,10 +1271,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1180,12 +1282,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1212,12 +1314,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1266,9 +1368,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 @@ -1278,25 +1380,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 @@ -1310,6 +1412,7 @@ cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-universalsdk[=SDKDIR] @@ -1353,6 +1456,8 @@ --with-libm=STRING math library --with-libc=STRING C library --with-wide-unicode Use 4-byte Unicode characters (default is 2 bytes) + --with-computed-gotos Use computed gotos / threaded dispatch in evaluation + loop (not available on all compilers) Some influential environment variables: CC C compiler command @@ -1375,15 +1480,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1419,7 +1526,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1429,10 +1536,10 @@ if $ac_init_version; then cat <<\_ACEOF python configure 3.1 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1443,7 +1550,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1479,7 +1586,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1514,7 +1621,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1566,11 +1673,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1600,9 +1708,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1617,9 +1725,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1635,8 +1743,8 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1678,21 +1786,24 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1702,16 +1813,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1725,29 +1836,38 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1757,10 +1877,12 @@ fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1897,20 +2019,20 @@ UNIVERSAL_ARCHS="32-bit" -{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 -echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 +$as_echo_n "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. if test "${with_universal_archs+set}" = set; then withval=$with_universal_archs; - { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } UNIVERSAL_ARCHS="$withval" else - { echo "$as_me:$LINENO: result: 32-bit" >&5 -echo "${ECHO_T}32-bit" >&6; } + { $as_echo "$as_me:$LINENO: result: 32-bit" >&5 +$as_echo "32-bit" >&6; } fi @@ -2030,8 +2152,8 @@ ## # Set name for machine-dependent library files -{ echo "$as_me:$LINENO: checking MACHDEP" >&5 -echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5 +$as_echo_n "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then ac_sys_system=`uname -s` @@ -2194,8 +2316,8 @@ LDFLAGS="$SGI_ABI $LDFLAGS" MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` fi -{ echo "$as_me:$LINENO: result: $MACHDEP" >&5 -echo "${ECHO_T}$MACHDEP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5 +$as_echo "$MACHDEP" >&6; } # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils @@ -2205,11 +2327,11 @@ CONFIGURE_MACOSX_DEPLOYMENT_TARGET= EXPORT_MACOSX_DEPLOYMENT_TARGET='#' -{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 -echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 +$as_echo_n "checking machine type as reported by uname -m... " >&6; } ac_sys_machine=`uname -m` -{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 -echo "${ECHO_T}$ac_sys_machine" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 +$as_echo "$ac_sys_machine" >&6; } # checks for alternative programs @@ -2221,14 +2343,14 @@ # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? -{ echo "$as_me:$LINENO: checking for --without-gcc" >&5 -echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5 +$as_echo_n "checking for --without-gcc... " >&6; } # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then withval=$with_gcc; case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -2247,15 +2369,15 @@ esac fi -{ echo "$as_me:$LINENO: result: $without_gcc" >&5 -echo "${ECHO_T}$without_gcc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5 +$as_echo "$without_gcc" >&6; } # If the user switches compilers, we can't believe the cache if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then - { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file + { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&5 -echo "$as_me: error: cached CC is different -- throw away $cache_file +$as_echo "$as_me: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&2;} { (exit 1); exit 1; }; } fi @@ -2268,10 +2390,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2284,7 +2406,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2295,11 +2417,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2308,10 +2430,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2324,7 +2446,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2335,11 +2457,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2347,12 +2469,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2365,10 +2483,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2381,7 +2499,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2392,11 +2510,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2405,10 +2523,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2426,7 +2544,7 @@ continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2449,11 +2567,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2464,10 +2582,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2480,7 +2598,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2491,11 +2609,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2508,10 +2626,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2524,7 +2642,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2535,11 +2653,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2551,12 +2669,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2566,44 +2680,50 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2622,27 +2742,22 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2653,10 +2768,11 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2667,7 +2783,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2694,25 +2810,27 @@ ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2721,49 +2839,53 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2772,31 +2894,33 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2819,40 +2943,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2878,20 +3005,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2901,15 +3029,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -2936,20 +3068,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -2974,20 +3107,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3013,20 +3147,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3041,8 +3176,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3058,10 +3193,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3132,20 +3267,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3161,15 +3297,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3182,8 +3318,8 @@ -{ echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 -echo $ECHO_N "checking for --with-cxx-main=... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 +$as_echo_n "checking for --with-cxx-main=... " >&6; } # Check whether --with-cxx_main was given. if test "${with_cxx_main+set}" = set; then @@ -3208,8 +3344,8 @@ fi -{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5 -echo "${ECHO_T}$with_cxx_main" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5 +$as_echo "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -3217,10 +3353,10 @@ case "$CC" in gcc) # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3235,7 +3371,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3248,20 +3384,20 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; cc) # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3276,7 +3412,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3289,11 +3425,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; @@ -3309,10 +3445,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3325,7 +3461,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3336,11 +3472,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3355,12 +3491,12 @@ fi if test "$preset_cxx" != "$CXX" then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -3375,15 +3511,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3415,20 +3551,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3452,13 +3589,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3466,7 +3604,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3491,8 +3629,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3520,20 +3658,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3557,13 +3696,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3571,7 +3711,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3587,11 +3727,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3601,42 +3743,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3651,74 +3788,60 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3733,63 +3856,510 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done +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 -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; }; } +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 + + + 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 - ac_cv_path_EGREP=$EGREP -fi - + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - fi + ac_cv_safe_to_define___extensions__=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF -{ echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif + cat >>confdefs.h <<\_ACEOF +#define _GNU_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 + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest* + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF @@ -3802,8 +4372,8 @@ esac -{ echo "$as_me:$LINENO: checking for --with-suffix" >&5 -echo $ECHO_N "checking for --with-suffix... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5 +$as_echo_n "checking for --with-suffix... " >&6; } # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then @@ -3815,26 +4385,26 @@ esac fi -{ echo "$as_me:$LINENO: result: $EXEEXT" >&5 -echo "${ECHO_T}$EXEEXT" >&6; } +{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5 +$as_echo "$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 -echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 +$as_echo_n "checking for case-insensitive build directory... " >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILDEXEEXT=.exe else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -3867,14 +4437,14 @@ -{ echo "$as_me:$LINENO: checking LIBRARY" >&5 -echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5 +$as_echo_n "checking LIBRARY... " >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION).a' fi -{ echo "$as_me:$LINENO: result: $LIBRARY" >&5 -echo "${ECHO_T}$LIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5 +$as_echo "$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -3909,8 +4479,8 @@ # This is altered for AIX in order to build the export list before # linking. -{ echo "$as_me:$LINENO: checking LINKCC" >&5 -echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5 +$as_echo_n "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -3930,11 +4500,11 @@ LINKCC=qcc;; esac fi -{ echo "$as_me:$LINENO: result: $LINKCC" >&5 -echo "${ECHO_T}$LINKCC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5 +$as_echo "$LINKCC" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-shared" >&5 -echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5 +$as_echo_n "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; @@ -3950,11 +4520,11 @@ enable_shared="no";; esac fi -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5 -echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5 +$as_echo_n "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; ac_save_cc="$CC" @@ -3976,29 +4546,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_enable_profiling="yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_enable_profiling="no" fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4006,8 +4579,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 -echo "${ECHO_T}$ac_enable_profiling" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 +$as_echo "$ac_enable_profiling" >&6; } case "$ac_enable_profiling" in "yes") @@ -4016,8 +4589,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5 -echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5 +$as_echo_n "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -4101,16 +4674,16 @@ esac fi -{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 -echo "${ECHO_T}$LDLIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 +$as_echo "$LDLIBRARY" >&6; } if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4123,7 +4696,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4134,11 +4707,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4147,10 +4720,10 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4163,7 +4736,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4174,11 +4747,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4186,12 +4759,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -4205,10 +4774,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4221,7 +4790,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4232,11 +4801,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4248,10 +4817,10 @@ # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_SVNVERSION+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$SVNVERSION"; then ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. @@ -4264,7 +4833,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SVNVERSION="found" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4276,11 +4845,11 @@ fi SVNVERSION=$ac_cv_prog_SVNVERSION if test -n "$SVNVERSION"; then - { echo "$as_me:$LINENO: result: $SVNVERSION" >&5 -echo "${ECHO_T}$SVNVERSION" >&6; } + { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5 +$as_echo "$SVNVERSION" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4316,8 +4885,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -4343,11 +4912,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4376,17 +4946,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -4399,8 +4981,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4422,8 +5004,8 @@ fi # Check for --with-pydebug -{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5 -echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5 +$as_echo_n "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. if test "${with_pydebug+set}" = set; then @@ -4435,15 +5017,15 @@ #define Py_DEBUG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; }; + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; }; Py_DEBUG='true' -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; Py_DEBUG='false' +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; Py_DEBUG='false' fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4521,8 +5103,8 @@ # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. - { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 -echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then @@ -4542,36 +5124,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_no_strict_aliasing_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_no_strict_aliasing_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 -echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 +$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } if test $ac_cv_no_strict_aliasing_ok = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -4610,8 +5195,8 @@ ARCH_RUN_32BIT="arch -i386 -ppc" else - { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 -echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 +$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} { (exit 1); exit 1; }; } fi @@ -4685,10 +5270,10 @@ ac_cv_opt_olimit_ok=no fi -{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 -echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 +$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; } if test "${ac_cv_opt_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -OPT:Olimit=0" @@ -4709,29 +5294,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_opt_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_opt_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4739,8 +5327,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 +$as_echo "$ac_cv_opt_olimit_ok" >&6; } if test $ac_cv_opt_olimit_ok = yes; then case $ac_sys_system in # XXX is this branch needed? On MacOSX 10.2.2 the result of the @@ -4753,10 +5341,10 @@ ;; esac else - { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 -echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 +$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; } if test "${ac_cv_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Olimit 1500" @@ -4777,29 +5365,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4807,8 +5398,8 @@ CC="$ac_save_cc" fi - { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_olimit_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 +$as_echo "$ac_cv_olimit_ok" >&6; } if test $ac_cv_olimit_ok = yes; then BASECFLAGS="$BASECFLAGS -Olimit 1500" fi @@ -4817,8 +5408,8 @@ # Check whether GCC supports PyArg_ParseTuple format if test "$GCC" = "yes" then - { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 -echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -4844,13 +5435,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4860,14 +5452,14 @@ #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4880,10 +5472,10 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 -echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 +$as_echo_n "checking whether pthreads are available without options... " >&6; } if test "${ac_cv_pthread_is_default+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_is_default=no @@ -4914,19 +5506,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_is_default=yes @@ -4934,13 +5528,14 @@ ac_cv_pthread=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_is_default=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4948,8 +5543,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 -echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 +$as_echo "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -4961,10 +5556,10 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 +$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } if test "${ac_cv_kpthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kpthread" @@ -4997,29 +5592,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kpthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kpthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5027,8 +5625,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 -echo "${ECHO_T}$ac_cv_kpthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 +$as_echo "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -5038,10 +5636,10 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 +$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } if test "${ac_cv_kthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kthread" @@ -5074,29 +5672,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5104,8 +5705,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 -echo "${ECHO_T}$ac_cv_kthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 +$as_echo "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -5115,10 +5716,10 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 -echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 +$as_echo_n "checking whether $CC accepts -pthread... " >&6; } if test "${ac_cv_thread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -pthread" @@ -5151,29 +5752,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5181,8 +5785,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 -echo "${ECHO_T}$ac_cv_pthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 +$as_echo "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -5190,8 +5794,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 -echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 +$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -5221,17 +5825,17 @@ fi rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 -echo "${ECHO_T}$ac_cv_cxx_thread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 +$as_echo "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5258,20 +5862,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -5363,37 +5968,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -5402,75 +6010,6 @@ fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - @@ -5538,20 +6077,21 @@ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5567,32 +6107,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5606,51 +6147,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -5659,21 +6201,24 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5687,11 +6232,11 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5717,20 +6262,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -5738,12 +6284,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5752,10 +6301,10 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5793,26 +6342,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5827,8 +6380,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5836,10 +6389,10 @@ fi else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5877,26 +6430,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5911,8 +6468,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5921,10 +6478,10 @@ fi -{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 -echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5947,46 +6504,50 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_header_sys_types_h_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +$as_echo_n "checking sys/mkdev.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6002,32 +6563,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +$as_echo_n "checking sys/mkdev.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6041,51 +6603,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -6094,18 +6657,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } fi -if test $ac_cv_header_sys_mkdev_h = yes; then +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 @@ -6117,17 +6680,17 @@ if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +$as_echo_n "checking sys/sysmacros.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6143,32 +6706,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +$as_echo_n "checking sys/sysmacros.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6182,51 +6746,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -6235,18 +6800,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } fi -if test $ac_cv_header_sys_sysmacros_h = yes; then +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 @@ -6263,11 +6828,11 @@ for ac_header in term.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6289,20 +6854,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6310,12 +6876,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6327,11 +6896,11 @@ for ac_header in linux/netlink.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6356,20 +6925,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6377,12 +6947,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6392,8 +6965,8 @@ # checks for typedefs was_it_defined=no -{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 -echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 +$as_echo_n "checking for clock_t in time.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6417,12 +6990,12 @@ fi rm -f conftest* -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } # Check whether using makedev requires defining _OSF_SOURCE -{ echo "$as_me:$LINENO: checking for makedev" >&5 -echo $ECHO_N "checking for makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for makedev" >&5 +$as_echo_n "checking for makedev... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6444,26 +7017,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "no"; then @@ -6492,26 +7069,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "yes"; then @@ -6522,8 +7103,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 -echo "${ECHO_T}$ac_cv_has_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 +$as_echo "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -6540,8 +7121,8 @@ # work-around, disable LFS on such configurations use_lfs=yes -{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 -echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 +$as_echo_n "checking Solaris LFS bug... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6567,28 +7148,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sol_lfs_bug=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sol_lfs_bug=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 -echo "${ECHO_T}$sol_lfs_bug" >&6; } +{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 +$as_echo "$sol_lfs_bug" >&6; } if test "$sol_lfs_bug" = "yes"; then use_lfs=no fi @@ -6616,26 +7198,58 @@ EOF # Type availability checks -{ echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 +$as_echo_n "checking for mode_t... " >&6; } if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_mode_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef mode_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (mode_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((mode_t))) + return 0; ; return 0; } @@ -6646,30 +7260,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_mode_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mode_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } -if test $ac_cv_type_mode_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +$as_echo "$ac_cv_type_mode_t" >&6; } +if test "x$ac_cv_type_mode_t" = x""yes; then : else @@ -6679,26 +7302,58 @@ fi -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -6709,30 +7364,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then : else @@ -6742,26 +7406,58 @@ fi -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -6772,30 +7468,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -6805,10 +7510,10 @@ fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6833,20 +7538,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -6854,34 +7560,66 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (size_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -6892,30 +7630,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then : else @@ -6925,10 +7672,10 @@ fi -{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6948,8 +7695,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -6963,26 +7710,24 @@ fi -{ echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_ssize_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef ssize_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (ssize_t)) + return 0; ; return 0; } @@ -6993,45 +7738,18 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_ssize_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } -if test $ac_cv_type_ssize_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SSIZE_T 1 -_ACEOF - -fi - - -# Sizes of various common basic types -# ANSI C requires sizeof(char) == 1, so no need to check it -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7039,14 +7757,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((ssize_t))) + return 0; ; return 0; } @@ -7057,38 +7772,57 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_ssize_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +$as_echo "$ac_cv_type_ssize_t" >&6; } +if test "x$ac_cv_type_ssize_t" = x""yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_SSIZE_T 1 +_ACEOF + +fi + + +# Sizes of various common basic types +# ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7099,11 +7833,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; test_array [0] = 0 ; @@ -7116,13 +7849,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7136,11 +7870,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7153,20 +7886,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7180,7 +7914,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7190,11 +7924,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; test_array [0] = 0 ; @@ -7207,13 +7940,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7227,11 +7961,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7244,20 +7977,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7271,7 +8005,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7291,11 +8025,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7308,20 +8041,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7332,11 +8066,13 @@ case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi ;; @@ -7349,9 +8085,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (int)); } +static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int @@ -7361,20 +8096,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7387,43 +8124,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } @@ -7432,68 +8174,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7504,11 +8192,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -7521,13 +8208,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7541,11 +8229,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7558,20 +8245,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7585,7 +8273,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7595,11 +8283,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -7612,13 +8299,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7632,11 +8320,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7649,20 +8336,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7676,7 +8364,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7696,11 +8384,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7713,20 +8400,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7737,11 +8425,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -7754,9 +8444,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -7766,20 +8455,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7792,43 +8483,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -7837,68 +8533,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7909,11 +8551,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -7926,13 +8567,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7946,11 +8588,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7963,20 +8604,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7990,7 +8632,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8000,11 +8642,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -8017,13 +8658,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8037,11 +8679,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8054,20 +8695,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8081,7 +8723,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8101,11 +8743,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8118,20 +8759,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8142,11 +8784,13 @@ case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -8159,9 +8803,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -8171,20 +8814,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8197,43 +8842,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -8242,68 +8892,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6; } -if test "${ac_cv_type_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef short ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_short=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_short=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8314,11 +8910,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; test_array [0] = 0 ; @@ -8331,13 +8926,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8351,11 +8947,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8368,20 +8963,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8395,7 +8991,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8405,11 +9001,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; test_array [0] = 0 ; @@ -8422,13 +9017,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8442,11 +9038,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8459,20 +9054,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8486,7 +9082,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8506,11 +9102,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8523,20 +9118,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8547,11 +9143,13 @@ case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi ;; @@ -8564,9 +9162,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (short)); } +static unsigned long int ulongval () { return (long int) (sizeof (short)); } #include #include int @@ -8576,20 +9173,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (short))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8602,43 +9201,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } @@ -8647,68 +9251,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for float" >&5 -echo $ECHO_N "checking for float... $ECHO_C" >&6; } -if test "${ac_cv_type_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef float ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_float=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_float=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 -echo "${ECHO_T}$ac_cv_type_float" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of float" >&5 -echo $ECHO_N "checking size of float... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } if test "${ac_cv_sizeof_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8719,11 +9269,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; test_array [0] = 0 ; @@ -8736,13 +9285,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8756,11 +9306,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8773,20 +9322,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8800,7 +9350,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8810,11 +9360,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; test_array [0] = 0 ; @@ -8827,13 +9376,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8847,11 +9397,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8864,20 +9413,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8891,7 +9441,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8911,11 +9461,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8928,20 +9477,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8952,11 +9502,13 @@ case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi ;; @@ -8969,9 +9521,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (float)); } +static unsigned long int ulongval () { return (long int) (sizeof (float)); } #include #include int @@ -8981,20 +9532,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (float))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9007,113 +9560,64 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF - - -{ echo "$as_me:$LINENO: checking for double" >&5 -echo $ECHO_N "checking for double... $ECHO_C" >&6; } -if test "${ac_cv_type_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_double=no +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 core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 -echo "${ECHO_T}$ac_cv_type_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of double" >&5 -echo $ECHO_N "checking size of double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } if test "${ac_cv_sizeof_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9124,11 +9628,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; test_array [0] = 0 ; @@ -9141,13 +9644,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9161,11 +9665,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9178,20 +9681,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9205,7 +9709,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9215,11 +9719,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; test_array [0] = 0 ; @@ -9232,13 +9735,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9252,11 +9756,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9269,20 +9772,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9296,7 +9800,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9316,11 +9820,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9333,20 +9836,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9357,11 +9861,13 @@ case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi ;; @@ -9374,9 +9880,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (double)); } +static unsigned long int ulongval () { return (long int) (sizeof (double)); } #include #include int @@ -9386,20 +9891,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9412,43 +9919,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } @@ -9457,68 +9969,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for fpos_t" >&5 -echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } -if test "${ac_cv_type_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef fpos_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_fpos_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_fpos_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of fpos_t" >&5 -echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 +$as_echo_n "checking size of fpos_t... " >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9529,11 +9987,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; test_array [0] = 0 ; @@ -9546,13 +10003,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9566,11 +10024,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9583,20 +10040,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9610,7 +10068,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9620,11 +10078,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; test_array [0] = 0 ; @@ -9637,13 +10094,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9657,11 +10115,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9674,20 +10131,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9701,7 +10159,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9721,11 +10179,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9738,20 +10195,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9762,11 +10220,13 @@ case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi ;; @@ -9779,9 +10239,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (fpos_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } #include #include int @@ -9791,20 +10250,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (fpos_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9817,43 +10278,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +$as_echo "$ac_cv_sizeof_fpos_t" >&6; } @@ -9862,68 +10328,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9934,11 +10346,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; @@ -9951,13 +10362,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9971,11 +10383,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9988,20 +10399,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10015,7 +10427,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10025,11 +10437,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; @@ -10042,13 +10453,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10062,11 +10474,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10079,20 +10490,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10106,7 +10518,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10126,11 +10538,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10143,20 +10554,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10167,11 +10579,13 @@ case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -10184,9 +10598,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (size_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int @@ -10196,20 +10609,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10222,43 +10637,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } @@ -10267,68 +10687,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of pid_t" >&5 -echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5 +$as_echo_n "checking size of pid_t... " >&6; } if test "${ac_cv_sizeof_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10339,11 +10705,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)]; test_array [0] = 0 ; @@ -10356,13 +10721,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10376,11 +10742,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10393,20 +10758,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10420,7 +10786,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10430,11 +10796,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)]; test_array [0] = 0 ; @@ -10447,13 +10812,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10467,11 +10833,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10484,20 +10849,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10511,7 +10877,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10531,11 +10897,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10548,20 +10913,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10572,11 +10938,13 @@ case $ac_lo in ?*) ac_cv_sizeof_pid_t=$ac_lo;; '') if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi ;; @@ -10589,9 +10957,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (pid_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); } #include #include int @@ -10601,20 +10968,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (pid_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10627,43 +10996,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pid_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +$as_echo "$ac_cv_sizeof_pid_t" >&6; } @@ -10673,8 +11047,8 @@ -{ echo "$as_me:$LINENO: checking for long long support" >&5 -echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long long support" >&5 +$as_echo_n "checking for long long support... " >&6; } have_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10697,13 +11071,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10717,78 +11092,24 @@ have_long_long=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_long" >&5 -echo "${ECHO_T}$have_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5 +$as_echo "$have_long_long" >&6; } if test "$have_long_long" = yes ; then -{ echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10799,11 +11120,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; test_array [0] = 0 ; @@ -10816,13 +11136,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10836,11 +11157,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10853,20 +11173,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10880,7 +11201,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10890,11 +11211,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; test_array [0] = 0 ; @@ -10907,13 +11227,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10927,11 +11248,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10944,20 +11264,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10971,7 +11292,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10991,11 +11312,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11008,20 +11328,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11032,11 +11353,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi ;; @@ -11049,9 +11372,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long long)); } #include #include int @@ -11061,20 +11383,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11087,43 +11411,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } @@ -11134,8 +11463,8 @@ fi -{ echo "$as_me:$LINENO: checking for long double support" >&5 -echo $ECHO_N "checking for long double support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long double support" >&5 +$as_echo_n "checking for long double support... " >&6; } have_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11158,13 +11487,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11178,78 +11508,24 @@ have_long_double=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_double" >&5 -echo "${ECHO_T}$have_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5 +$as_echo "$have_long_double" >&6; } if test "$have_long_double" = yes ; then -{ echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; } -if test "${ac_cv_type_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_double=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 -echo "${ECHO_T}$ac_cv_type_long_double" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long double" >&5 -echo $ECHO_N "checking size of long double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11260,11 +11536,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; @@ -11277,13 +11552,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11297,11 +11573,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11314,20 +11589,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11341,7 +11617,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11351,11 +11627,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; test_array [0] = 0 ; @@ -11368,13 +11643,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11388,11 +11664,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11405,20 +11680,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11432,7 +11708,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11452,11 +11728,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11469,20 +11744,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11493,11 +11769,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi ;; @@ -11510,9 +11788,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long double)); } +static unsigned long int ulongval () { return (long int) (sizeof (long double)); } #include #include int @@ -11522,20 +11799,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11548,43 +11827,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } @@ -11596,8 +11880,8 @@ fi -{ echo "$as_me:$LINENO: checking for _Bool support" >&5 -echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5 +$as_echo_n "checking for _Bool support... " >&6; } have_c99_bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11620,13 +11904,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11636,82 +11921,28 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_C99_BOOL 1 _ACEOF - - have_c99_bool=yes - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5 -echo "${ECHO_T}$have_c99_bool" >&6; } -if test "$have_c99_bool" = yes ; then -{ echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + + have_c99_bool=yes + else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5 +$as_echo "$have_c99_bool" >&6; } +if test "$have_c99_bool" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of _Bool" >&5 -echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5 +$as_echo_n "checking size of _Bool... " >&6; } if test "${ac_cv_sizeof__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11722,11 +11953,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)]; test_array [0] = 0 ; @@ -11739,13 +11969,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11759,11 +11990,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11776,20 +12006,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11803,7 +12034,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11813,11 +12044,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)]; test_array [0] = 0 ; @@ -11830,13 +12060,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11850,11 +12081,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11867,20 +12097,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11894,7 +12125,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11914,11 +12145,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11931,20 +12161,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11955,11 +12186,13 @@ case $ac_lo in ?*) ac_cv_sizeof__Bool=$ac_lo;; '') if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi ;; @@ -11972,9 +12205,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (_Bool)); } +static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); } #include #include int @@ -11984,20 +12216,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (_Bool))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12010,43 +12244,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof__Bool=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 -echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 +$as_echo "$ac_cv_sizeof__Bool" >&6; } @@ -12057,12 +12296,13 @@ fi -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 +$as_echo_n "checking for uintptr_t... " >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_uintptr_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12072,14 +12312,11 @@ #include #endif -typedef uintptr_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (uintptr_t)) + return 0; ; return 0; } @@ -12090,55 +12327,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } -if test $ac_cv_type_uintptr_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF - -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef uintptr_t ac__type_new_; +#ifdef HAVE_STDINT_H + #include + #endif + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((uintptr_t))) + return 0; ; return 0; } @@ -12149,38 +12364,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_uintptr_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uintptr_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +$as_echo "$ac_cv_type_uintptr_t" >&6; } +if test "x$ac_cv_type_uintptr_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5 -echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +$as_echo_n "checking size of uintptr_t... " >&6; } if test "${ac_cv_sizeof_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12191,11 +12420,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)]; test_array [0] = 0 ; @@ -12208,13 +12436,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12228,11 +12457,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12245,20 +12473,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12272,7 +12501,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12282,11 +12511,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)]; test_array [0] = 0 ; @@ -12299,13 +12527,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12319,11 +12548,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12336,20 +12564,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12363,7 +12592,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12383,11 +12612,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12400,20 +12628,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12424,11 +12653,13 @@ case $ac_lo in ?*) ac_cv_sizeof_uintptr_t=$ac_lo;; '') if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi ;; @@ -12441,9 +12672,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (uintptr_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); } #include #include int @@ -12453,20 +12683,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (uintptr_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12479,43 +12711,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uintptr_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } @@ -12529,10 +12766,10 @@ # Hmph. AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_off_t=4 @@ -12559,29 +12796,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_off_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12589,16 +12829,16 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5 -echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -12607,18 +12847,18 @@ #define HAVE_LARGEFILE_SUPPORT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_time_t=4 @@ -12645,29 +12885,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_time_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12675,8 +12918,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t @@ -12693,8 +12936,8 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ echo "$as_me:$LINENO: checking for pthread_t" >&5 -echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5 +$as_echo_n "checking for pthread_t... " >&6; } have_pthread_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12717,34 +12960,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_pthread_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5 -echo "${ECHO_T}$have_pthread_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5 +$as_echo "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # AC_CHECK_SIZEOF() doesn't include . - { echo "$as_me:$LINENO: checking size of pthread_t" >&5 -echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } if test "${ac_cv_sizeof_pthread_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_pthread_t=4 @@ -12771,29 +13015,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pthread_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_pthread_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12801,8 +13048,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t @@ -12847,8 +13094,8 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ echo "$as_me:$LINENO: checking for --enable-framework" >&5 -echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5 +$as_echo_n "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" @@ -12859,15 +13106,15 @@ #define WITH_NEXT_FRAMEWORK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for dyld" >&5 -echo $ECHO_N "checking for dyld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dyld" >&5 +$as_echo_n "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -12875,12 +13122,12 @@ #define WITH_DYLD 1 _ACEOF - { echo "$as_me:$LINENO: result: always on for Darwin" >&5 -echo "${ECHO_T}always on for Darwin" >&6; } + { $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5 +$as_echo "always on for Darwin" >&6; } ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac @@ -12892,8 +13139,8 @@ # SO is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ echo "$as_me:$LINENO: checking SO" >&5 -echo $ECHO_N "checking SO... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SO" >&5 +$as_echo_n "checking SO... " >&6; } if test -z "$SO" then case $ac_sys_system in @@ -12918,8 +13165,8 @@ echo '=====================================================================' sleep 10 fi -{ echo "$as_me:$LINENO: result: $SO" >&5 -echo "${ECHO_T}$SO" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SO" >&5 +$as_echo "$SO" >&6; } cat >>confdefs.h <<_ACEOF @@ -12930,8 +13177,8 @@ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ echo "$as_me:$LINENO: checking LDSHARED" >&5 -echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13033,13 +13280,13 @@ *) LDSHARED="ld";; esac fi -{ echo "$as_me:$LINENO: result: $LDSHARED" >&5 -echo "${ECHO_T}$LDSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking CCSHARED" >&5 -echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13074,12 +13321,12 @@ atheos*) CCSHARED="-fPIC";; esac fi -{ echo "$as_me:$LINENO: result: $CCSHARED" >&5 -echo "${ECHO_T}$CCSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 -echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13134,13 +13381,13 @@ LINKFORSHARED='-Wl,-E -N 2048K';; esac fi -{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 -echo "${ECHO_T}$LINKFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } -{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 -echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 +$as_echo_n "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -13152,8 +13399,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 -echo "${ECHO_T}$CFLAGSFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 +$as_echo "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -13164,22 +13411,22 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ echo "$as_me:$LINENO: checking SHLIBS" >&5 -echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5 +$as_echo_n "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ echo "$as_me:$LINENO: result: $SHLIBS" >&5 -echo "${ECHO_T}$SHLIBS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5 +$as_echo "$SHLIBS" >&6; } # checks for libraries -{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13211,33 +13458,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -13247,10 +13498,10 @@ fi # Dynamic linking for SunOS/Solaris and SYSV -{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13282,33 +13533,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF @@ -13320,10 +13575,10 @@ # only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then - { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 -echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } if test "${ac_cv_search_sem_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -13361,26 +13616,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_sem_init=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sem_init+set}" = set; then @@ -13395,8 +13654,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 -echo "${ECHO_T}$ac_cv_search_sem_init" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -13408,10 +13667,10 @@ fi # check if we need libintl for locale functions -{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 -echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 +$as_echo_n "checking for textdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_textdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -13443,33 +13702,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_textdomain=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_textdomain=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; } -if test $ac_cv_lib_intl_textdomain = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 +$as_echo "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_LIBINTL 1 @@ -13480,8 +13743,8 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 -echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; } + AIX*) { $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 +$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13503,43 +13766,47 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define AIX_GENUINE_CPLUSPLUS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext;; *) ;; esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 -echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_t_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -13571,40 +13838,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_t_open=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_open=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; } -if test $ac_cv_lib_nsl_t_open = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = x""yes; then LIBS="-lnsl $LIBS" fi # SVR4 -{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" @@ -13636,56 +13907,60 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_socket=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } -if test $ac_cv_lib_socket_socket = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = x""yes; then LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ echo "$as_me:$LINENO: checking for --with-libs" >&5 -echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5 +$as_echo_n "checking for --with-libs... " >&6; } # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LIBS="$withval $LIBS" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for use of the system libffi library -{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 -echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 +$as_echo_n "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. if test "${with_system_ffi+set}" = set; then @@ -13693,14 +13968,14 @@ fi -{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5 -echo "${ECHO_T}$with_system_ffi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5 +$as_echo "$with_system_ffi" >&6; } # Determine if signalmodule should be used. -{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5 -echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5 +$as_echo_n "checking for --with-signal-module... " >&6; } # Check whether --with-signal-module was given. if test "${with_signal_module+set}" = set; then @@ -13711,8 +13986,8 @@ if test -z "$with_signal_module" then with_signal_module="yes" fi -{ echo "$as_me:$LINENO: result: $with_signal_module" >&5 -echo "${ECHO_T}$with_signal_module" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5 +$as_echo "$with_signal_module" >&6; } if test "${with_signal_module}" = "yes"; then USE_SIGNAL_MODULE="" @@ -13726,22 +14001,22 @@ USE_THREAD_MODULE="" -{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 -echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 +$as_echo_n "checking for --with-dec-threads... " >&6; } # Check whether --with-dec-threads was given. if test "${with_dec_threads+set}" = set; then withval=$with_dec_threads; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LDLAST=-threads if test "${with_thread+set}" != set; then with_thread="$withval"; fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -13754,8 +14029,8 @@ -{ echo "$as_me:$LINENO: checking for --with-threads" >&5 -echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5 +$as_echo_n "checking for --with-threads... " >&6; } # Check whether --with-threads was given. if test "${with_threads+set}" = set; then @@ -13774,8 +14049,8 @@ if test -z "$with_threads" then with_threads="yes" fi -{ echo "$as_me:$LINENO: result: $with_threads" >&5 -echo "${ECHO_T}$with_threads" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5 +$as_echo "$with_threads" >&6; } if test "$with_threads" = "no" @@ -13841,8 +14116,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 -echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 +$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13864,25 +14139,25 @@ fi rm -f conftest* - { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 -echo "${ECHO_T}$unistd_defines_pthreads" >&6; } + { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 +$as_echo "$unistd_defines_pthreads" >&6; } cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "${ac_cv_header_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5 -echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5 +$as_echo_n "checking cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13898,32 +14173,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5 -echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5 +$as_echo_n "checking cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13937,51 +14213,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -13990,18 +14267,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } fi -if test $ac_cv_header_cthreads_h = yes; then +if test "x$ac_cv_header_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14020,17 +14297,17 @@ else if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 -echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 +$as_echo_n "checking mach/cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14046,32 +14323,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 -echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 +$as_echo_n "checking mach/cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14085,51 +14363,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -14138,18 +14417,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mach_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } fi -if test $ac_cv_header_mach_cthreads_h = yes; then +if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14166,13 +14445,13 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for --with-pth" >&5 -echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5 +$as_echo_n "checking for --with-pth... " >&6; } # Check whether --with-pth was given. if test "${with_pth+set}" = set; then - withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14185,16 +14464,16 @@ LIBS="-lpth $LIBS" THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14219,21 +14498,24 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14241,15 +14523,15 @@ posix_threads=yes THREADOBJ="Python/thread.o" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$_libs - { echo "$as_me:$LINENO: checking for pthread_detach" >&5 -echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5 +$as_echo_n "checking for pthread_detach... " >&6; } if test "${ac_cv_func_pthread_detach+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14302,32 +14584,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_pthread_detach=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pthread_detach=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 -echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; } -if test $ac_cv_func_pthread_detach = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 +$as_echo "$ac_cv_func_pthread_detach" >&6; } +if test "x$ac_cv_func_pthread_detach" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14337,17 +14623,17 @@ else if test "${ac_cv_header_atheos_threads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 -echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 +$as_echo_n "checking atheos/threads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14363,32 +14649,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 -echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 +$as_echo_n "checking atheos/threads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14402,51 +14689,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -14455,18 +14743,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_atheos_threads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } fi -if test $ac_cv_header_atheos_threads_h = yes; then +if test "x$ac_cv_header_atheos_threads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14479,10 +14767,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 +$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" @@ -14514,33 +14802,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthreads_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; } -if test $ac_cv_lib_pthreads_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14550,10 +14842,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 -echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +$as_echo_n "checking for pthread_create in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -14585,33 +14877,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_r_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } -if test $ac_cv_lib_c_r_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14621,10 +14917,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 +$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -14656,33 +14952,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread___pthread_create_system=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_create_system=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test $ac_cv_lib_pthread___pthread_create_system = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14692,10 +14992,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 -echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 +$as_echo_n "checking for pthread_create in -lcma... " >&6; } if test "${ac_cv_lib_cma_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" @@ -14727,33 +15027,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cma_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cma_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; } -if test $ac_cv_lib_cma_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 +$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14780,6 +15084,7 @@ fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -14791,10 +15096,10 @@ - { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 -echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 +$as_echo_n "checking for usconfig in -lmpc... " >&6; } if test "${ac_cv_lib_mpc_usconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" @@ -14826,33 +15131,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mpc_usconfig=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpc_usconfig=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 -echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; } -if test $ac_cv_lib_mpc_usconfig = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 +$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14864,10 +15173,10 @@ if test "$posix_threads" != "yes"; then - { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 -echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 +$as_echo_n "checking for thr_create in -lthread... " >&6; } if test "${ac_cv_lib_thread_thr_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" @@ -14899,33 +15208,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_thread_thr_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thread_thr_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 -echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; } -if test $ac_cv_lib_thread_thr_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 +$as_echo "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14978,10 +15291,10 @@ ;; esac - { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } if test "${ac_cv_pthread_system_supported+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_system_supported=no @@ -15011,29 +15324,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_system_supported=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_system_supported=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -15041,8 +15357,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 -echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 +$as_echo "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -15053,11 +15369,11 @@ for ac_func in pthread_sigmask do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15110,35 +15426,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF case $ac_sys_system in CYGWIN*) @@ -15158,18 +15481,18 @@ # Check for enable-ipv6 -{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 -echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 +$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; case "$enableval" in no) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no ;; - *) { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + *) { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF @@ -15180,8 +15503,8 @@ else if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no else @@ -15209,41 +15532,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 -echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 +$as_echo_n "checking if RFC2553 API is available... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15267,26 +15593,27 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi @@ -15308,8 +15635,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking ipv6 stack type" >&5 -echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5 +$as_echo_n "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -15465,8 +15792,8 @@ break fi done - { echo "$as_me:$LINENO: result: $ipv6type" >&5 -echo "${ECHO_T}$ipv6type" >&6; } + { $as_echo "$as_me:$LINENO: result: $ipv6type" >&5 +$as_echo "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -15485,8 +15812,8 @@ fi fi -{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 -echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15508,13 +15835,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -15524,22 +15852,22 @@ #define HAVE_OSX105_SDK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 -echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 +$as_echo_n "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. if test "${with_doc_strings+set}" = set; then @@ -15558,12 +15886,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 -echo "${ECHO_T}$with_doc_strings" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5 +$as_echo "$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-tsc" >&5 -echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5 +$as_echo_n "checking for --with-tsc... " >&6; } # Check whether --with-tsc was given. if test "${with_tsc+set}" = set; then @@ -15575,20 +15903,20 @@ #define WITH_TSC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 -echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 +$as_echo_n "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. if test "${with_pymalloc+set}" = set; then @@ -15607,12 +15935,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5 -echo "${ECHO_T}$with_pymalloc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5 +$as_echo "$with_pymalloc" >&6; } # Check for --with-wctype-functions -{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 -echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 +$as_echo_n "checking for --with-wctype-functions... " >&6; } # Check whether --with-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then @@ -15624,14 +15952,14 @@ #define WANT_WCTYPE_FUNCTIONS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -15644,11 +15972,11 @@ for ac_func in dlopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15701,35 +16029,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -15739,8 +16074,8 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 -echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 +$as_echo_n "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -15764,8 +16099,8 @@ ;; esac fi -{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 -echo "${ECHO_T}$DYNLOADFILE" >&6; } +{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 +$as_echo "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -15778,16 +16113,16 @@ # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 -echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 +$as_echo_n "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi -{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 -echo "${ECHO_T}MACHDEP_OBJS" >&6; } +{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 +$as_echo "MACHDEP_OBJS" >&6; } # checks for library functions @@ -15886,11 +16221,11 @@ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15943,35 +16278,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -15980,8 +16322,8 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ echo "$as_me:$LINENO: checking for chroot" >&5 -echo $ECHO_N "checking for chroot... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chroot" >&5 +$as_echo_n "checking for chroot... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16003,13 +16345,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16019,20 +16362,20 @@ #define HAVE_CHROOT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for link" >&5 -echo $ECHO_N "checking for link... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for link" >&5 +$as_echo_n "checking for link... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16054,13 +16397,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16070,20 +16414,20 @@ #define HAVE_LINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for symlink" >&5 -echo $ECHO_N "checking for symlink... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for symlink" >&5 +$as_echo_n "checking for symlink... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16105,13 +16449,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16121,20 +16466,20 @@ #define HAVE_SYMLINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fchdir" >&5 -echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5 +$as_echo_n "checking for fchdir... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16156,13 +16501,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16172,20 +16518,20 @@ #define HAVE_FCHDIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fsync" >&5 -echo $ECHO_N "checking for fsync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fsync" >&5 +$as_echo_n "checking for fsync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16207,13 +16553,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16223,20 +16570,20 @@ #define HAVE_FSYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fdatasync" >&5 -echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5 +$as_echo_n "checking for fdatasync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16258,13 +16605,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16274,20 +16622,20 @@ #define HAVE_FDATASYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for epoll" >&5 -echo $ECHO_N "checking for epoll... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for epoll" >&5 +$as_echo_n "checking for epoll... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16309,13 +16657,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16325,20 +16674,20 @@ #define HAVE_EPOLL 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for kqueue" >&5 -echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5 +$as_echo_n "checking for kqueue... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16363,13 +16712,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16379,14 +16729,14 @@ #define HAVE_KQUEUE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16397,8 +16747,8 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ echo "$as_me:$LINENO: checking for ctermid_r" >&5 -echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5 +$as_echo_n "checking for ctermid_r... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16423,13 +16773,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16439,21 +16790,21 @@ #define HAVE_CTERMID_R 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for flock" >&5 -echo $ECHO_N "checking for flock... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for flock" >&5 +$as_echo_n "checking for flock... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16478,13 +16829,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16494,21 +16846,21 @@ #define HAVE_FLOCK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for getpagesize" >&5 -echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16533,13 +16885,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16549,14 +16902,14 @@ #define HAVE_GETPAGESIZE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16566,10 +16919,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TRUE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. @@ -16582,7 +16935,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TRUE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16593,11 +16946,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { echo "$as_me:$LINENO: result: $TRUE" >&5 -echo "${ECHO_T}$TRUE" >&6; } + { $as_echo "$as_me:$LINENO: result: $TRUE" >&5 +$as_echo "$TRUE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16606,10 +16959,10 @@ test -n "$TRUE" || TRUE="/bin/true" -{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 -echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 +$as_echo_n "checking for inet_aton in -lc... " >&6; } if test "${ac_cv_lib_c_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" @@ -16641,40 +16994,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; } -if test $ac_cv_lib_c_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 +$as_echo "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = x""yes; then $ac_cv_prog_TRUE else -{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 -echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -16706,33 +17063,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_resolv_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; } -if test $ac_cv_lib_resolv_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -16747,14 +17108,16 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ echo "$as_me:$LINENO: checking for chflags" >&5 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chflags" >&5 +$as_echo_n "checking for chflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16779,50 +17142,55 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for lchflags" >&5 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5 +$as_echo_n "checking for lchflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16847,37 +17215,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -16892,10 +17263,10 @@ ;; esac -{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 -echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 +$as_echo_n "checking for inflateCopy in -lz... " >&6; } if test "${ac_cv_lib_z_inflateCopy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -16927,33 +17298,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_inflateCopy=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateCopy=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; } -if test $ac_cv_lib_z_inflateCopy = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 +$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_COPY 1 @@ -16969,8 +17344,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking for hstrerror" >&5 -echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5 +$as_echo_n "checking for hstrerror... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16995,39 +17370,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_HSTRERROR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_aton" >&5 -echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17055,39 +17434,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_pton" >&5 -echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5 +$as_echo_n "checking for inet_pton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17115,13 +17498,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17131,22 +17515,22 @@ #define HAVE_INET_PTON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ echo "$as_me:$LINENO: checking for setgroups" >&5 -echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5 +$as_echo_n "checking for setgroups... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17174,13 +17558,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17190,14 +17575,14 @@ #define HAVE_SETGROUPS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17208,11 +17593,11 @@ for ac_func in openpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17265,42 +17650,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 -echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +$as_echo_n "checking for openpty in -lutil... " >&6; } if test "${ac_cv_lib_util_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17332,42 +17724,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; } -if test $ac_cv_lib_util_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +$as_echo "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 -echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 +$as_echo_n "checking for openpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17399,33 +17795,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; } -if test $ac_cv_lib_bsd_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 +$as_echo "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF @@ -17442,11 +17842,11 @@ for ac_func in forkpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17499,42 +17899,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 -echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 +$as_echo_n "checking for forkpty in -lutil... " >&6; } if test "${ac_cv_lib_util_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17566,42 +17973,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; } -if test $ac_cv_lib_util_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 +$as_echo "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 -echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 +$as_echo_n "checking for forkpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17633,33 +18044,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; } -if test $ac_cv_lib_bsd_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 +$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -17678,11 +18093,11 @@ for ac_func in memmove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17735,35 +18150,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -17779,11 +18201,11 @@ for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17836,35 +18258,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -17876,11 +18305,11 @@ for ac_func in dup2 getcwd strdup do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17933,35 +18362,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -17978,11 +18414,11 @@ for ac_func in getpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18035,35 +18471,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18086,13 +18529,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18104,7 +18548,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18118,11 +18562,11 @@ for ac_func in setpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18175,35 +18619,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18226,13 +18677,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18244,7 +18696,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18258,11 +18710,11 @@ for ac_func in gettimeofday do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18315,35 +18767,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18366,20 +18825,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18396,8 +18856,8 @@ done -{ echo "$as_me:$LINENO: checking for major" >&5 -echo $ECHO_N "checking for major... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for major" >&5 +$as_echo_n "checking for major... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18429,44 +18889,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MACROS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18495,26 +18959,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 -echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 +$as_echo_n "checking getaddrinfo bug... " >&6; } if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } + { $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes else cat >conftest.$ac_ext <<_ACEOF @@ -18617,48 +19084,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: good" >&5 -echo "${ECHO_T}good" >&6; } + { $as_echo "$as_me:$LINENO: result: good" >&5 +$as_echo "good" >&6; } buggygetaddrinfo=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } +{ $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -18678,11 +19149,11 @@ for ac_func in getnameinfo do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18735,35 +19206,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18771,10 +19249,10 @@ # checks for structures -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18801,20 +19279,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -18822,8 +19301,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -18832,10 +19311,10 @@ fi -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18851,7 +19330,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -18862,20 +19341,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -18883,8 +19363,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -18893,10 +19373,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18924,20 +19404,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -18966,20 +19447,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -18990,9 +19472,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -19008,10 +19490,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19038,20 +19520,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -19059,9 +19542,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -19077,10 +19560,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19107,31 +19590,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -19141,10 +19628,10 @@ fi fi -{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +$as_echo_n "checking for struct stat.st_rdev... " >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19169,20 +19656,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19208,20 +19696,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no @@ -19232,9 +19721,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } -if test $ac_cv_member_struct_stat_st_rdev = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } +if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 @@ -19243,10 +19732,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +$as_echo_n "checking for struct stat.st_blksize... " >&6; } if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19271,20 +19760,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19310,20 +19800,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no @@ -19334,9 +19825,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } -if test $ac_cv_member_struct_stat_st_blksize = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; } +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -19345,10 +19836,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 -echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 +$as_echo_n "checking for struct stat.st_flags... " >&6; } if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19373,20 +19864,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19412,20 +19904,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_flags=no @@ -19436,9 +19929,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; } -if test $ac_cv_member_struct_stat_st_flags = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 +$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; } +if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 @@ -19447,10 +19940,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 -echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 +$as_echo_n "checking for struct stat.st_gen... " >&6; } if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19475,20 +19968,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19514,20 +20008,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_gen=no @@ -19538,9 +20033,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; } -if test $ac_cv_member_struct_stat_st_gen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 +$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; } +if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 @@ -19549,10 +20044,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 -echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 +$as_echo_n "checking for struct stat.st_birthtime... " >&6; } if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19577,20 +20072,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19616,20 +20112,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_birthtime=no @@ -19640,9 +20137,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; } -if test $ac_cv_member_struct_stat_st_birthtime = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; } +if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -19651,10 +20148,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +$as_echo_n "checking for struct stat.st_blocks... " >&6; } if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19679,20 +20176,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19718,20 +20216,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no @@ -19742,9 +20241,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } -if test $ac_cv_member_struct_stat_st_blocks = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -19766,10 +20265,10 @@ -{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 -echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 +$as_echo_n "checking for time.h that defines altzone... " >&6; } if test "${ac_cv_header_time_altzone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19792,20 +20291,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time_altzone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_altzone=no @@ -19814,8 +20314,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 -echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 +$as_echo "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then cat >>confdefs.h <<\_ACEOF @@ -19825,8 +20325,8 @@ fi was_it_defined=no -{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19852,13 +20352,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -19872,20 +20373,20 @@ was_it_defined=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ echo "$as_me:$LINENO: checking for addrinfo" >&5 -echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5 +$as_echo_n "checking for addrinfo... " >&6; } if test "${ac_cv_struct_addrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19909,20 +20410,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_addrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_addrinfo=no @@ -19931,8 +20433,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 +$as_echo "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then cat >>confdefs.h <<\_ACEOF @@ -19941,10 +20443,10 @@ fi -{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 -echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 +$as_echo_n "checking for sockaddr_storage... " >&6; } if test "${ac_cv_struct_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19969,20 +20471,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_sockaddr_storage=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no @@ -19991,8 +20494,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then cat >>confdefs.h <<\_ACEOF @@ -20004,10 +20507,10 @@ # checks for compiler characteristics -{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20032,20 +20535,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes @@ -20053,8 +20557,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 @@ -20062,10 +20566,10 @@ fi -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20137,20 +20641,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -20158,20 +20663,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const +#define const /**/ _ACEOF fi works=no -{ echo "$as_me:$LINENO: checking for working volatile" >&5 -echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20193,37 +20698,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define volatile +#define volatile /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } works=no -{ echo "$as_me:$LINENO: checking for working signed char" >&5 -echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5 +$as_echo_n "checking for working signed char... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20245,37 +20751,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define signed +#define signed /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } have_prototypes=no -{ echo "$as_me:$LINENO: checking for prototypes" >&5 -echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5 +$as_echo_n "checking for prototypes... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20297,13 +20804,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20317,19 +20825,19 @@ have_prototypes=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_prototypes" >&5 -echo "${ECHO_T}$have_prototypes" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5 +$as_echo "$have_prototypes" >&6; } works=no -{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 -echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 +$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20361,13 +20869,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20381,19 +20890,19 @@ works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } # check for socketpair -{ echo "$as_me:$LINENO: checking for socketpair" >&5 -echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5 +$as_echo_n "checking for socketpair... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20418,13 +20927,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20434,22 +20944,22 @@ #define HAVE_SOCKETPAIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 -echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 +$as_echo_n "checking if sockaddr has sa_len member... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20473,37 +20983,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext va_list_is_array=no -{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5 -echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5 +$as_echo_n "checking whether va_list is an array... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20531,20 +21042,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -20558,17 +21070,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5 -echo "${ECHO_T}$va_list_is_array" >&6; } +{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5 +$as_echo "$va_list_is_array" >&6; } # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( -{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 -echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 +$as_echo_n "checking for gethostbyname_r... " >&6; } if test "${ac_cv_func_gethostbyname_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20621,39 +21133,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname_r=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; } -if test $ac_cv_func_gethostbyname_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 +$as_echo "$ac_cv_func_gethostbyname_r" >&6; } +if test "x$ac_cv_func_gethostbyname_r" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF - { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 +$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat >conftest.$ac_ext <<_ACEOF @@ -20687,13 +21203,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20708,18 +21225,18 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 +$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20751,13 +21268,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20772,18 +21290,18 @@ #define HAVE_GETHOSTBYNAME_R_5_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 +$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20813,13 +21331,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20834,16 +21353,16 @@ #define HAVE_GETHOSTBYNAME_R_3_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -20863,11 +21382,11 @@ for ac_func in gethostbyname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20920,35 +21439,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -20967,10 +21493,10 @@ # (none yet) # Linux requires this for correct f.p. operations -{ echo "$as_me:$LINENO: checking for __fpu_control" >&5 -echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5 +$as_echo_n "checking for __fpu_control... " >&6; } if test "${ac_cv_func___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21023,39 +21549,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; } -if test $ac_cv_func___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 +$as_echo "$ac_cv_func___fpu_control" >&6; } +if test "x$ac_cv_func___fpu_control" = x""yes; then : else -{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 -echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 +$as_echo_n "checking for __fpu_control in -lieee... " >&6; } if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" @@ -21087,33 +21617,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ieee___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; } -if test $ac_cv_lib_ieee___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 +$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF @@ -21127,8 +21661,8 @@ # Check for --with-fpectl -{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5 -echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5 +$as_echo_n "checking for --with-fpectl... " >&6; } # Check whether --with-fpectl was given. if test "${with_fpectl+set}" = set; then @@ -21140,14 +21674,14 @@ #define WANT_SIGFPE_HANDLER 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21157,53 +21691,53 @@ Darwin) ;; *) LIBM=-lm esac -{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 -echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 +$as_echo_n "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. if test "${with_libm+set}" = set; then withval=$with_libm; if test "$withval" = no then LIBM= - { echo "$as_me:$LINENO: result: force LIBM empty" >&5 -echo "${ECHO_T}force LIBM empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5 +$as_echo "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 -echo "${ECHO_T}set LIBM=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 -echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 +$as_echo "set LIBM=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 -echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 +$as_echo "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 -echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 +$as_echo_n "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. if test "${with_libc+set}" = set; then withval=$with_libc; if test "$withval" = no then LIBC= - { echo "$as_me:$LINENO: result: force LIBC empty" >&5 -echo "${ECHO_T}force LIBC empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5 +$as_echo "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 -echo "${ECHO_T}set LIBC=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 -echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 +$as_echo "set LIBC=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 -echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 +$as_echo "default LIBC=\"$LIBC\"" >&6; } fi @@ -21219,10 +21753,10 @@ # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 -echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +$as_echo_n "checking for x87-style double rounding... " >&6; } if test "${ac_cv_x87_double_rounding+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21261,37 +21795,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_x87_double_rounding=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_x87_double_rounding=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 -echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +$as_echo "$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then @@ -21304,10 +21841,10 @@ # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. -{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 -echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 +$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; } if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21338,37 +21875,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_tanh_preserves_zero_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_tanh_preserves_zero_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 -echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 +$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; } if test "$ac_cv_tanh_preserves_zero_sign" = yes then @@ -21388,11 +21928,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21445,44 +21985,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done -{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 -echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +$as_echo_n "checking whether isinf is declared... " >&6; } if test "${ac_cv_have_decl_isinf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21509,20 +22056,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isinf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isinf=no @@ -21530,9 +22078,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } -if test $ac_cv_have_decl_isinf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +$as_echo "$ac_cv_have_decl_isinf" >&6; } +if test "x$ac_cv_have_decl_isinf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISINF 1 @@ -21546,10 +22094,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 -echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +$as_echo_n "checking whether isnan is declared... " >&6; } if test "${ac_cv_have_decl_isnan+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21576,20 +22124,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isnan=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isnan=no @@ -21597,9 +22146,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } -if test $ac_cv_have_decl_isnan = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +$as_echo "$ac_cv_have_decl_isnan" >&6; } +if test "x$ac_cv_have_decl_isnan" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISNAN 1 @@ -21613,10 +22162,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 -echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +$as_echo_n "checking whether isfinite is declared... " >&6; } if test "${ac_cv_have_decl_isfinite+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21643,20 +22192,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isfinite=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isfinite=no @@ -21664,9 +22214,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } -if test $ac_cv_have_decl_isfinite = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +$as_echo "$ac_cv_have_decl_isfinite" >&6; } +if test "x$ac_cv_have_decl_isfinite" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISFINITE 1 @@ -21687,17 +22237,17 @@ # check for wchar.h if test "${ac_cv_header_wchar_h+set}" = set; then - { echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking wchar.h usability" >&5 -echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5 +$as_echo_n "checking wchar.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21713,32 +22263,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking wchar.h presence" >&5 -echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5 +$as_echo_n "checking wchar.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21752,51 +22303,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -21805,18 +22357,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } fi -if test $ac_cv_header_wchar_h = yes; then +if test "x$ac_cv_header_wchar_h" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -21835,69 +22387,14 @@ # determine wchar_t size if test "$wchar_h" = yes then - { echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } -if test "${ac_cv_type_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -typedef wchar_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_wchar_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; } - -# The cast to long int works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of wchar_t" >&5 -echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } if test "${ac_cv_sizeof_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -21909,11 +22406,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; test_array [0] = 0 ; @@ -21926,13 +22422,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21947,11 +22444,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -21964,20 +22460,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -21991,7 +22488,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -22002,11 +22499,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; test_array [0] = 0 ; @@ -22019,13 +22515,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22040,11 +22537,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -22057,20 +22553,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -22084,7 +22581,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -22105,11 +22602,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22122,20 +22618,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -22146,11 +22643,13 @@ case $ac_lo in ?*) ac_cv_sizeof_wchar_t=$ac_lo;; '') if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi ;; @@ -22164,9 +22663,8 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (wchar_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } #include #include int @@ -22176,20 +22674,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (wchar_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -22202,43 +22702,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_wchar_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } @@ -22249,8 +22754,8 @@ fi -{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 -echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 +$as_echo_n "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22277,13 +22782,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22297,24 +22803,24 @@ have_ucs4_tcl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 -echo "${ECHO_T}$have_ucs4_tcl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 +$as_echo "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 -echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 +$as_echo_n "checking whether wchar_t is signed... " >&6; } if test "${ac_cv_wchar_t_signed+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22341,41 +22847,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_wchar_t_signed=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_wchar_t_signed=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 -echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 +$as_echo "$ac_cv_wchar_t_signed" >&6; } fi -{ echo "$as_me:$LINENO: checking what type to use for str" >&5 -echo $ECHO_N "checking what type to use for str... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking what type to use for str" >&5 +$as_echo_n "checking what type to use for str... " >&6; } # Check whether --with-wide-unicode was given. if test "${with_wide_unicode+set}" = set; then @@ -22421,53 +22930,199 @@ #define HAVE_USABLE_WCHAR_T 1 _ACEOF - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE wchar_t -_ACEOF + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE wchar_t +_ACEOF + +elif test "$ac_cv_sizeof_short" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned short" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned short +_ACEOF + +elif test "$ac_cv_sizeof_long" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned long" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned long +_ACEOF + +else + PY_UNICODE_TYPE="no type found" +fi +{ $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 +$as_echo "$PY_UNICODE_TYPE" >&6; } + +# check for endianness + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi -elif test "$ac_cv_sizeof_short" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned short" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned short -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -elif test "$ac_cv_sizeof_long" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned long" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned long -_ACEOF -else - PY_UNICODE_TYPE="no type found" fi -{ echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 -echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; } -# check for endianness -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -22479,33 +23134,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; @@ -22517,20 +23172,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -22538,29 +23194,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - _ascii (); _ebcdic (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } @@ -22571,30 +23242,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22613,14 +23285,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; @@ -22632,63 +23304,70 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 -echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 +$as_echo_n "checking whether right shift extends the sign bit... " >&6; } if test "${ac_cv_rshift_extends_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22713,37 +23392,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_rshift_extends_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_rshift_extends_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 -echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 +$as_echo "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -22754,10 +23436,10 @@ fi # check for getc_unlocked and related locking functions -{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 -echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 +$as_echo_n "checking for getc_unlocked() and friends... " >&6; } if test "${ac_cv_have_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22786,32 +23468,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_have_getc_unlocked=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_getc_unlocked=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 +$as_echo "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -22829,8 +23515,8 @@ # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. py_cv_lib_readline=no -{ echo "$as_me:$LINENO: checking how to link readline libs" >&5 -echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5 +$as_echo_n "checking how to link readline libs... " >&6; } for py_libtermcap in "" ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-lreadline" @@ -22866,26 +23552,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then py_cv_lib_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then @@ -22895,11 +23585,11 @@ # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 -echo "${ECHO_T}$READLINE_LIBS" >&6; } + { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 +$as_echo "$READLINE_LIBS" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 @@ -22908,10 +23598,10 @@ fi # check for readline 2.1 -{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 -echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 +$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -22943,33 +23633,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_callback_handler_install=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; } -if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 +$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } +if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_CALLBACK 1 @@ -22992,20 +23686,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23036,10 +23731,10 @@ fi # check for readline 4.0 -{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 +$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23071,33 +23766,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_pre_input_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_pre_input_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; } -if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_PRE_INPUT_HOOK 1 @@ -23107,10 +23806,10 @@ # also in 4.0 -{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 +$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23142,33 +23841,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_display_matches_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_display_matches_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } -if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 @@ -23178,10 +23881,10 @@ # check for readline 4.2 -{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 +$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23213,33 +23916,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_matches=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_matches=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test $ac_cv_lib_readline_rl_completion_matches = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_MATCHES 1 @@ -23262,20 +23969,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23308,10 +24016,10 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ echo "$as_me:$LINENO: checking for broken nice()" >&5 -echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5 +$as_echo_n "checking for broken nice()... " >&6; } if test "${ac_cv_broken_nice+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23339,37 +24047,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_nice=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_nice=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 -echo "${ECHO_T}$ac_cv_broken_nice" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 +$as_echo "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -23379,8 +24090,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken poll()" >&5 -echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5 +$as_echo_n "checking for broken poll()... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_poll=no else @@ -23422,35 +24133,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_poll=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_poll=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 -echo "${ECHO_T}$ac_cv_broken_poll" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 +$as_echo "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -23463,10 +24177,10 @@ # Before we can test tzset, we need to check if struct tm has a tm_zone # (which is not required by ISO C or UNIX spec) and/or if we support # tzname[] -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23494,20 +24208,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -23536,20 +24251,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -23560,9 +24276,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -23578,10 +24294,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23608,20 +24324,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -23629,9 +24346,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -23647,10 +24364,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23677,31 +24394,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -23713,10 +24434,10 @@ # check tzset(3) exists and works like we expect it to -{ echo "$as_me:$LINENO: checking for working tzset()" >&5 -echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5 +$as_echo_n "checking for working tzset()... " >&6; } if test "${ac_cv_working_tzset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23799,37 +24520,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_tzset=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_working_tzset=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 -echo "${ECHO_T}$ac_cv_working_tzset" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 +$as_echo "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -23840,10 +24564,10 @@ fi # Look for subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 +$as_echo_n "checking for tv_nsec in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23869,20 +24593,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec=no @@ -23891,8 +24616,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 +$as_echo "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -23903,10 +24628,10 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 +$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23932,20 +24657,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec2=no @@ -23954,8 +24680,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 +$as_echo "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -23966,10 +24692,10 @@ fi # On HP/UX 11.0, mvwdelch is a block with a return statement -{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 -echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 +$as_echo_n "checking whether mvwdelch is an expression... " >&6; } if test "${ac_cv_mvwdelch_is_expression+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23995,20 +24721,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_mvwdelch_is_expression=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_mvwdelch_is_expression=no @@ -24017,8 +24744,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 -echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 +$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -24029,10 +24756,10 @@ fi -{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 -echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 +$as_echo_n "checking whether WINDOW has _flags... " >&6; } if test "${ac_cv_window_has_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24058,20 +24785,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_window_has_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_window_has_flags=no @@ -24080,8 +24808,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 -echo "${ECHO_T}$ac_cv_window_has_flags" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 +$as_echo "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes @@ -24093,8 +24821,8 @@ fi -{ echo "$as_me:$LINENO: checking for is_term_resized" >&5 -echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5 +$as_echo_n "checking for is_term_resized... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24116,13 +24844,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24132,21 +24861,21 @@ #define HAVE_CURSES_IS_TERM_RESIZED 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resize_term" >&5 -echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5 +$as_echo_n "checking for resize_term... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24168,13 +24897,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24184,21 +24914,21 @@ #define HAVE_CURSES_RESIZE_TERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resizeterm" >&5 -echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5 +$as_echo_n "checking for resizeterm... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24220,13 +24950,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24236,61 +24967,63 @@ #define HAVE_CURSES_RESIZETERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 -echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } if test -r /dev/ptmx then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5 -echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } if test -r /dev/ptc then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 +$as_echo_n "checking for %zd printf() format support... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24339,47 +25072,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PY_FORMAT_SIZE_T "z" _ACEOF else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -24394,14 +25131,53 @@ #endif -typedef socklen_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (socklen_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; ; return 0; } @@ -24412,30 +25188,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_socklen_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then : else @@ -24446,8 +25231,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 -echo $ECHO_N "checking for broken mbstowcs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 +$as_echo_n "checking for broken mbstowcs... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_mbstowcs=no else @@ -24473,35 +25258,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_mbstowcs=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_mbstowcs=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 -echo "${ECHO_T}$ac_cv_broken_mbstowcs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 +$as_echo "$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then @@ -24511,6 +25299,32 @@ 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; } + +# Check whether --with-computed-gotos was given. +if test "${with_computed_gotos+set}" = set; then + withval=$with_computed_gotos; +if test "$withval" != no +then + +cat >>confdefs.h <<\_ACEOF +#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; } +fi +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for h in `(cd $srcdir;echo Python/thread_*.h)` @@ -24520,15 +25334,15 @@ SRCDIRS="Parser Grammar Objects Python Modules Mac" -{ echo "$as_me:$LINENO: checking for build directories" >&5 -echo $ECHO_N "checking for build directories... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for build directories" >&5 +$as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6; } +{ $as_echo "$as_me:$LINENO: result: done" >&5 +$as_echo "done" >&6; } # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" @@ -24560,11 +25374,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -24597,12 +25412,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -24618,7 +25433,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -24630,12 +25445,14 @@ + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -24648,7 +25465,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24658,7 +25475,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -24680,17 +25497,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -24706,8 +25551,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -24730,7 +25573,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -24743,17 +25586,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -24775,7 +25611,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -24826,7 +25662,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -24854,7 +25690,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -24867,19 +25702,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -24904,10 +25742,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 @@ -24930,7 +25768,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -24943,29 +25781,39 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -24976,24 +25824,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ python config.status 3.1 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -25015,30 +25863,36 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -25057,30 +25911,32 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -25094,8 +25950,8 @@ "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -25135,222 +25991,145 @@ (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF +ac_cr=' +' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -VERSION!$VERSION$ac_delim -SOVERSION!$SOVERSION$ac_delim -CONFIG_ARGS!$CONFIG_ARGS$ac_delim -UNIVERSALSDK!$UNIVERSALSDK$ac_delim -ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim -PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim -PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim -PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim -PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim -PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim -FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim -FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim -FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim -FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim -FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim -MACHDEP!$MACHDEP$ac_delim -SGI_ABI!$SGI_ABI$ac_delim -CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim -EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CXX!$CXX$ac_delim -MAINCC!$MAINCC$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -BUILDEXEEXT!$BUILDEXEEXT$ac_delim -LIBRARY!$LIBRARY$ac_delim -LDLIBRARY!$LDLIBRARY$ac_delim -DLLLIBRARY!$DLLLIBRARY$ac_delim -BLDLIBRARY!$BLDLIBRARY$ac_delim -LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim -INSTSONAME!$INSTSONAME$ac_delim -RUNSHARED!$RUNSHARED$ac_delim -LINKCC!$LINKCC$ac_delim -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 + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + print line +} -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim -USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim -LDLAST!$LDLAST$ac_delim -THREADOBJ!$THREADOBJ$ac_delim -DLINCLDIR!$DLINCLDIR$ac_delim -DYNLOADFILE!$DYNLOADFILE$ac_delim -MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim -TRUE!$TRUE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim -HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim -HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim -LIBM!$LIBM$ac_delim -LIBC!$LIBC$ac_delim -THREADHEADERS!$THREADHEADERS$ac_delim -SRCDIRS!$SRCDIRS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACAWK _ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 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;} +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof _ACEOF - # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -25366,19 +26145,133 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -25407,26 +26300,38 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -25436,7 +26341,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -25462,7 +26367,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -25471,7 +26376,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -25492,17 +26397,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -25542,12 +26447,13 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -25556,13 +26462,14 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -25576,15 +26483,16 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -25594,119 +26502,58 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; @@ -25720,6 +26567,11 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -25741,6 +26593,10 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi echo "creating Modules/Setup" Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sun Jan 25 17:34:23 2009 @@ -3660,6 +3660,22 @@ wide chars that would be converted.]) fi +# Check for --with-computed-gotos +AC_MSG_CHECKING(for --with-computed-gotos) +AC_ARG_WITH(computed-gotos, + AC_HELP_STRING(--with-computed-gotos, + Use computed gotos / threaded dispatch in evaluation loop (not available on all compilers)), +[ +if test "$withval" != no +then + AC_DEFINE(USE_COMPUTED_GOTOS, 1, + [Define if you want to use computed gotos in ceval.c.]) + AC_MSG_RESULT(yes) +else AC_MSG_RESULT(no) +fi], +[AC_MSG_RESULT(no)]) + + AC_SUBST(THREADHEADERS) for h in `(cd $srcdir;echo Python/thread_*.h)` Modified: python/branches/py3k/pyconfig.h.in ============================================================================== --- python/branches/py3k/pyconfig.h.in (original) +++ python/branches/py3k/pyconfig.h.in Sun Jan 25 17:34:23 2009 @@ -5,6 +5,9 @@ #define Py_PYCONFIG_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -949,6 +952,31 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* 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 @@ -986,20 +1014,21 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif /* Define if arithmetic is subject to x87-style double rounding issue */ #undef X87_DOUBLE_ROUNDING -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Define on OpenBSD to activate all library features */ #undef _BSD_SOURCE @@ -1018,15 +1047,25 @@ /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX + /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE /* Define _OSF_SOURCE to get the makedev macro. */ #undef _OSF_SOURCE +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS From solipsis at pitrou.net Sun Jan 25 17:49:43 2009 From: solipsis at pitrou.net (Antoine Pitrou) Date: Sun, 25 Jan 2009 16:49:43 +0000 (UTC) Subject: [Python-checkins] PEP 374 References: <20090124230633.9B1801E4026@bag.python.org> <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> <6FC2E18B-F3FD-4B3F-90C0-4EA611AF93ED@python.org> Message-ID: Barry Warsaw python.org> writes: > > Besides, certain developments like support for the svn wire protocol > in bzr would make the WFC (we fear change :) argument moot. This is an argument *against* the usefulness of switching! Regards Antoine. From buildbot at python.org Sun Jan 25 18:01:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 17:01:56 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090125170156.769B91E4037@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/192 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: antoine.pitrou 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 Jan 25 18:15:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 25 Jan 2009 18:15:10 +0100 (CET) Subject: [Python-checkins] r68925 - in python/trunk: Lib/test/test_bytes.py Modules/gcmodule.c Objects/abstract.c Objects/bytearrayobject.c Objects/typeobject.c Python/ceval.c Python/formatter_unicode.c Message-ID: <20090125171510.9D73A1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 25 18:15:10 2009 New Revision: 68925 Log: 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 Modified: python/trunk/Lib/test/test_bytes.py python/trunk/Modules/gcmodule.c python/trunk/Objects/abstract.c python/trunk/Objects/bytearrayobject.c python/trunk/Objects/typeobject.c python/trunk/Python/ceval.c python/trunk/Python/formatter_unicode.c Modified: python/trunk/Lib/test/test_bytes.py ============================================================================== --- python/trunk/Lib/test/test_bytes.py (original) +++ python/trunk/Lib/test/test_bytes.py Sun Jan 25 18:15:10 2009 @@ -250,7 +250,6 @@ self.assertEquals(self.type2test.fromhex(u'1a2B30'), b) self.assertEquals(self.type2test.fromhex(u' 1A 2B 30 '), b) self.assertEquals(self.type2test.fromhex(u'0000'), b'\0\0') - self.assertRaises(TypeError, self.type2test.fromhex, b'1B') self.assertRaises(ValueError, self.type2test.fromhex, u'a') self.assertRaises(ValueError, self.type2test.fromhex, u'rt') self.assertRaises(ValueError, self.type2test.fromhex, u'1a b cd') Modified: python/trunk/Modules/gcmodule.c ============================================================================== --- python/trunk/Modules/gcmodule.c (original) +++ python/trunk/Modules/gcmodule.c Sun Jan 25 18:15:10 2009 @@ -784,7 +784,9 @@ (void)PyFrame_ClearFreeList(); (void)PyCFunction_ClearFreeList(); (void)PyTuple_ClearFreeList(); +#ifdef Py_USING_UNICODE (void)PyUnicode_ClearFreeList(); +#endif (void)PyInt_ClearFreeList(); (void)PyFloat_ClearFreeList(); } Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sun Jan 25 18:15:10 2009 @@ -720,8 +720,10 @@ static PyObject * str__format__ = NULL; PyObject *empty = NULL; PyObject *result = NULL; +#ifdef Py_USING_UNICODE int spec_is_unicode; int result_is_unicode; +#endif /* Initialize cached value */ if (str__format__ == NULL) { @@ -738,11 +740,15 @@ } /* Check the format_spec type, and make sure it's str or unicode */ +#if Py_USING_UNICODE if (PyUnicode_Check(format_spec)) spec_is_unicode = 1; else if (PyString_Check(format_spec)) spec_is_unicode = 0; else { +#else + if (!PyString_Check(format_spec)) { +#endif PyErr_Format(PyExc_TypeError, "format expects arg 2 to be string " "or unicode, not %.100s", Py_TYPE(format_spec)->tp_name); @@ -773,9 +779,11 @@ depending on the type of the format specifier). For new-style classes, this logic is done by object.__format__(). */ +#ifdef Py_USING_UNICODE if (spec_is_unicode) self_as_str = PyObject_Unicode(obj); else +#endif self_as_str = PyObject_Str(obj); if (self_as_str == NULL) goto done; @@ -818,11 +826,15 @@ goto done; /* Check the result type, and make sure it's str or unicode */ +#ifdef Py_USING_UNICODE if (PyUnicode_Check(result)) result_is_unicode = 1; else if (PyString_Check(result)) result_is_unicode = 0; else { +#else + if (!PyString_Check(result)) { +#endif PyErr_Format(PyExc_TypeError, "%.100s.__format__ must return string or " "unicode, not %.100s", Py_TYPE(obj)->tp_name, @@ -834,12 +846,14 @@ /* Convert to unicode, if needed. Required if spec is unicode and result is str */ +#ifdef Py_USING_UNICODE if (spec_is_unicode && !result_is_unicode) { PyObject *tmp = PyObject_Unicode(result); /* This logic works whether or not tmp is NULL */ Py_DECREF(result); result = tmp; } +#endif done: Py_XDECREF(empty); Modified: python/trunk/Objects/bytearrayobject.c ============================================================================== --- python/trunk/Objects/bytearrayobject.c (original) +++ python/trunk/Objects/bytearrayobject.c Sun Jan 25 18:15:10 2009 @@ -803,6 +803,7 @@ return 0; } +#ifdef Py_USING_UNICODE if (PyUnicode_Check(arg)) { /* Encode via the codec registry */ PyObject *encoded, *new; @@ -822,6 +823,7 @@ Py_DECREF(new); return 0; } +#endif /* If it's not unicode, there can't be encoding or errors */ if (encoding != NULL || errors != NULL) { @@ -929,14 +931,14 @@ "bytearray object is too large to make repr"); return NULL; } - v = PyUnicode_FromUnicode(NULL, newsize); + v = PyString_FromStringAndSize(NULL, newsize); if (v == NULL) { return NULL; } else { register Py_ssize_t i; - register Py_UNICODE c; - register Py_UNICODE *p; + register char c; + register char *p; int quote; /* Figure out which quote to use; single is preferred */ @@ -956,7 +958,7 @@ ; } - p = PyUnicode_AS_UNICODE(v); + p = PyString_AS_STRING(v); while (*quote_prefix) *p++ = *quote_prefix++; *p++ = quote; @@ -964,7 +966,7 @@ for (i = 0; i < length; i++) { /* There's at least enough room for a hex escape and a closing quote. */ - assert(newsize - (p - PyUnicode_AS_UNICODE(v)) >= 5); + assert(newsize - (p - PyString_AS_STRING(v)) >= 5); c = self->ob_bytes[i]; if (c == '\'' || c == '\\') *p++ = '\\', *p++ = c; @@ -985,13 +987,13 @@ else *p++ = c; } - assert(newsize - (p - PyUnicode_AS_UNICODE(v)) >= 1); + assert(newsize - (p - PyString_AS_STRING(v)) >= 1); *p++ = quote; while (*quote_postfix) { *p++ = *quote_postfix++; } *p = '\0'; - if (PyUnicode_Resize(&v, (p - PyUnicode_AS_UNICODE(v)))) { + if (_PyString_Resize(&v, (p - PyString_AS_STRING(v)))) { Py_DECREF(v); return NULL; } @@ -1025,6 +1027,7 @@ /* Bytes can be compared to anything that supports the (binary) buffer API. Except that a comparison with Unicode is always an error, even if the comparison is for equality. */ +#ifdef Py_USING_UNICODE if (PyObject_IsInstance(self, (PyObject*)&PyUnicode_Type) || PyObject_IsInstance(other, (PyObject*)&PyUnicode_Type)) { if (Py_BytesWarningFlag && op == Py_EQ) { @@ -1036,6 +1039,7 @@ Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } +#endif self_size = _getbuffer(self, &self_bytes); if (self_size < 0) { @@ -2939,8 +2943,14 @@ if (!PyArg_ParseTuple(args, "|ss:decode", &encoding, &errors)) return NULL; - if (encoding == NULL) + if (encoding == NULL) { +#ifdef Py_USING_UNICODE encoding = PyUnicode_GetDefaultEncoding(); +#else + PyErr_SetString(PyExc_ValueError, "no encoding specified"); + return NULL; +#endif + } return PyCodec_Decode(self, encoding, errors); } @@ -3038,10 +3048,8 @@ Example: bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef')."); static int -hex_digit_to_int(Py_UNICODE c) +hex_digit_to_int(char c) { - if (c >= 128) - return -1; if (ISDIGIT(c)) return c - '0'; else { @@ -3056,17 +3064,14 @@ static PyObject * bytes_fromhex(PyObject *cls, PyObject *args) { - PyObject *newbytes, *hexobj; + PyObject *newbytes; char *buf; - Py_UNICODE *hex; + char *hex; Py_ssize_t hexlen, byteslen, i, j; int top, bot; - if (!PyArg_ParseTuple(args, "U:fromhex", &hexobj)) + if (!PyArg_ParseTuple(args, "s#:fromhex", &hex, &hexlen)) return NULL; - assert(PyUnicode_Check(hexobj)); - hexlen = PyUnicode_GET_SIZE(hexobj); - hex = PyUnicode_AS_UNICODE(hexobj); byteslen = hexlen/2; /* This overestimates if there are spaces */ newbytes = PyByteArray_FromStringAndSize(NULL, byteslen); if (!newbytes) @@ -3104,10 +3109,18 @@ { PyObject *latin1, *dict; if (self->ob_bytes) +#ifdef Py_USING_UNICODE latin1 = PyUnicode_DecodeLatin1(self->ob_bytes, Py_SIZE(self), NULL); +#else + latin1 = PyString_FromStringAndSize(self->ob_bytes, Py_SIZE(self)) +#endif else +#ifdef Py_USING_UNICODE latin1 = PyUnicode_FromString(""); +#else + latin1 = PyString_FromString(""); +#endif dict = PyObject_GetAttrString((PyObject *)self, "__dict__"); if (dict == NULL) { Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Sun Jan 25 18:15:10 2009 @@ -3418,9 +3418,13 @@ if (!PyArg_ParseTuple(args, "O:__format__", &format_spec)) return NULL; +#ifdef Py_USING_UNICODE if (PyUnicode_Check(format_spec)) { self_as_str = PyObject_Unicode(self); } else if (PyString_Check(format_spec)) { +#else + if (PyString_Check(format_spec)) { +#endif self_as_str = PyObject_Str(self); } else { PyErr_SetString(PyExc_TypeError, "argument to __format__ must be unicode or str"); Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sun Jan 25 18:15:10 2009 @@ -2933,8 +2933,11 @@ PyObject *keyword = kws[2*i]; PyObject *value = kws[2*i + 1]; int j; - if (keyword == NULL || !(PyString_Check(keyword) || - PyUnicode_Check(keyword))) { + if (keyword == NULL || !(PyString_Check(keyword) +#ifdef Py_USING_UNICODE + || PyUnicode_Check(keyword) +#endif + )) { PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", PyString_AsString(co->co_name)); @@ -3115,14 +3118,20 @@ } + static PyObject * kwd_as_string(PyObject *kwd) { +#ifdef Py_USING_UNICODE if (PyString_Check(kwd)) { +#else + assert(PyString_Check(kwd)); +#endif Py_INCREF(kwd); return kwd; +#ifdef Py_USING_UNICODE } - else - return _PyUnicode_AsDefaultEncodedString(kwd, "replace"); + return _PyUnicode_AsDefaultEncodedString(kwd, "replace"); +#endif } @@ -4503,7 +4512,9 @@ else if (locals == Py_None) locals = globals; if (!PyString_Check(prog) && +#ifdef Py_USING_UNICODE !PyUnicode_Check(prog) && +#endif !PyCode_Check(prog) && !PyFile_Check(prog)) { PyErr_SetString(PyExc_TypeError, Modified: python/trunk/Python/formatter_unicode.c ============================================================================== --- python/trunk/Python/formatter_unicode.c (original) +++ python/trunk/Python/formatter_unicode.c Sun Jan 25 18:15:10 2009 @@ -2,6 +2,9 @@ built-in formatter for unicode. That is, unicode.__format__(). */ #include "Python.h" + +#ifdef Py_USING_UNICODE + #include "../Objects/stringlib/unicodedefs.h" #define FORMAT_STRING _PyUnicode_FormatAdvanced @@ -11,3 +14,5 @@ will convert them to unicode. */ #include "../Objects/stringlib/formatter.h" + +#endif From python-checkins at python.org Sun Jan 25 18:19:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 25 Jan 2009 18:19:17 +0100 (CET) Subject: [Python-checkins] r68926 - python/branches/py3k Message-ID: <20090125171917.C8DCE1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 25 18:19:17 2009 New Revision: 68926 Log: Blocked revisions 68925 via svnmerge ........ r68925 | benjamin.peterson | 2009-01-25 11:15:10 -0600 (Sun, 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 ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sun Jan 25 18:35:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 17:35:23 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090125173524.63F161E4050@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/33 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 BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_threadedtempfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 18:46:48 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 25 Jan 2009 18:46:48 +0100 (CET) Subject: [Python-checkins] r68927 - python/trunk/Objects/abstract.c Message-ID: <20090125174648.DCD7A1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sun Jan 25 18:46:48 2009 New Revision: 68927 Log: Fixed compile error on windows. Modified: python/trunk/Objects/abstract.c Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sun Jan 25 18:46:48 2009 @@ -740,7 +740,7 @@ } /* Check the format_spec type, and make sure it's str or unicode */ -#if Py_USING_UNICODE +#ifdef Py_USING_UNICODE if (PyUnicode_Check(format_spec)) spec_is_unicode = 1; else if (PyString_Check(format_spec)) From python-checkins at python.org Sun Jan 25 18:50:07 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 25 Jan 2009 18:50:07 +0100 (CET) Subject: [Python-checkins] r68928 - python/branches/py3k Message-ID: <20090125175007.D52161E4019@bag.python.org> Author: hirokazu.yamamoto Date: Sun Jan 25 18:50:07 2009 New Revision: 68928 Log: Blocked revisions 68927 via svnmerge ........ r68927 | hirokazu.yamamoto | 2009-01-26 02:46:48 +0900 | 1 line Fixed compile error on windows. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sun Jan 25 19:08:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 18:08:13 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090125180813.739B81E4002@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/756 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 19:19:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 19:19:25 +0100 (CET) Subject: [Python-checkins] r68929 - in python/trunk: Lib/distutils/ccompiler.py Lib/distutils/mwerkscompiler.py Misc/NEWS Message-ID: <20090125181925.5A64D1E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 19:19:25 2009 New Revision: 68929 Log: Fixed #4863: removed distutils.mwerkscompiler Removed: python/trunk/Lib/distutils/mwerkscompiler.py Modified: python/trunk/Lib/distutils/ccompiler.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/ccompiler.py ============================================================================== --- python/trunk/Lib/distutils/ccompiler.py (original) +++ python/trunk/Lib/distutils/ccompiler.py Sun Jan 25 19:19:25 2009 @@ -1063,7 +1063,6 @@ # OS name mappings ('posix', 'unix'), ('nt', 'msvc'), - ('mac', 'mwerks'), ) @@ -1103,8 +1102,6 @@ "Mingw32 port of GNU C Compiler for Win32"), 'bcpp': ('bcppcompiler', 'BCPPCompiler', "Borland C++ Compiler"), - 'mwerks': ('mwerkscompiler', 'MWerksCompiler', - "MetroWerks CodeWarrior"), 'emx': ('emxccompiler', 'EMXCCompiler', "EMX port of GNU C Compiler for OS/2"), } Deleted: python/trunk/Lib/distutils/mwerkscompiler.py ============================================================================== --- python/trunk/Lib/distutils/mwerkscompiler.py Sun Jan 25 19:19:25 2009 +++ (empty file) @@ -1,248 +0,0 @@ -"""distutils.mwerkscompiler - -Contains MWerksCompiler, an implementation of the abstract CCompiler class -for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on -Windows.""" - -# This module should be kept compatible with Python 2.1. - -__revision__ = "$Id$" - -import sys, os, string -from types import * -from distutils.errors import \ - DistutilsExecError, DistutilsPlatformError, \ - CompileError, LibError, LinkError -from distutils.ccompiler import \ - CCompiler, gen_preprocess_options, gen_lib_options -import distutils.util -import distutils.dir_util -from distutils import log - -class MWerksCompiler (CCompiler) : - """Concrete class that implements an interface to MetroWerks CodeWarrior, - as defined by the CCompiler abstract class.""" - - compiler_type = 'mwerks' - - # Just set this so CCompiler's constructor doesn't barf. We currently - # don't use the 'set_executables()' bureaucracy provided by CCompiler, - # as it really isn't necessary for this sort of single-compiler class. - # Would be nice to have a consistent interface with UnixCCompiler, - # though, so it's worth thinking about. - executables = {} - - # Private class data (need to distinguish C from C++ source for compiler) - _c_extensions = ['.c'] - _cpp_extensions = ['.cc', '.cpp', '.cxx'] - _rc_extensions = ['.r'] - _exp_extension = '.exp' - - # Needed for the filename generation methods provided by the - # base class, CCompiler. - src_extensions = (_c_extensions + _cpp_extensions + - _rc_extensions) - res_extension = '.rsrc' - obj_extension = '.obj' # Not used, really - static_lib_extension = '.lib' - shared_lib_extension = '.slb' - static_lib_format = shared_lib_format = '%s%s' - exe_extension = '' - - - def __init__ (self, - verbose=0, - dry_run=0, - force=0): - - CCompiler.__init__ (self, verbose, dry_run, force) - - - def compile (self, - sources, - output_dir=None, - macros=None, - include_dirs=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - depends=None): - (output_dir, macros, include_dirs) = \ - self._fix_compile_args (output_dir, macros, include_dirs) - self.__sources = sources - self.__macros = macros - self.__include_dirs = include_dirs - # Don't need extra_preargs and extra_postargs for CW - return [] - - def link (self, - target_desc, - objects, - output_filename, - output_dir=None, - libraries=None, - library_dirs=None, - runtime_library_dirs=None, - export_symbols=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - build_temp=None, - target_lang=None): - # First fixup. - (objects, output_dir) = self._fix_object_args (objects, output_dir) - (libraries, library_dirs, runtime_library_dirs) = \ - self._fix_lib_args (libraries, library_dirs, runtime_library_dirs) - - # First examine a couple of options for things that aren't implemented yet - if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT): - raise DistutilsPlatformError, 'Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac' - if runtime_library_dirs: - raise DistutilsPlatformError, 'Runtime library dirs not implemented yet' - if extra_preargs or extra_postargs: - raise DistutilsPlatformError, 'Runtime library dirs not implemented yet' - if len(export_symbols) != 1: - raise DistutilsPlatformError, 'Need exactly one export symbol' - # Next there are various things for which we need absolute pathnames. - # This is because we (usually) create the project in a subdirectory of - # where we are now, and keeping the paths relative is too much work right - # now. - sources = map(self._filename_to_abs, self.__sources) - include_dirs = map(self._filename_to_abs, self.__include_dirs) - if objects: - objects = map(self._filename_to_abs, objects) - else: - objects = [] - if build_temp: - build_temp = self._filename_to_abs(build_temp) - else: - build_temp = os.curdir() - if output_dir: - output_filename = os.path.join(output_dir, output_filename) - # The output filename needs special handling: splitting it into dir and - # filename part. Actually I'm not sure this is really needed, but it - # can't hurt. - output_filename = self._filename_to_abs(output_filename) - output_dir, output_filename = os.path.split(output_filename) - # Now we need the short names of a couple of things for putting them - # into the project. - if output_filename[-8:] == '.ppc.slb': - basename = output_filename[:-8] - elif output_filename[-11:] == '.carbon.slb': - basename = output_filename[:-11] - else: - basename = os.path.strip(output_filename)[0] - projectname = basename + '.mcp' - targetname = basename - xmlname = basename + '.xml' - exportname = basename + '.mcp.exp' - prefixname = 'mwerks_%s_config.h'%basename - # Create the directories we need - distutils.dir_util.mkpath(build_temp, dry_run=self.dry_run) - distutils.dir_util.mkpath(output_dir, dry_run=self.dry_run) - # And on to filling in the parameters for the project builder - settings = {} - settings['mac_exportname'] = exportname - settings['mac_outputdir'] = output_dir - settings['mac_dllname'] = output_filename - settings['mac_targetname'] = targetname - settings['sysprefix'] = sys.prefix - settings['mac_sysprefixtype'] = 'Absolute' - sourcefilenames = [] - sourcefiledirs = [] - for filename in sources + objects: - dirname, filename = os.path.split(filename) - sourcefilenames.append(filename) - if not dirname in sourcefiledirs: - sourcefiledirs.append(dirname) - settings['sources'] = sourcefilenames - settings['libraries'] = libraries - settings['extrasearchdirs'] = sourcefiledirs + include_dirs + library_dirs - if self.dry_run: - print 'CALLING LINKER IN', os.getcwd() - for key, value in settings.items(): - print '%20.20s %s'%(key, value) - return - # Build the export file - exportfilename = os.path.join(build_temp, exportname) - log.debug("\tCreate export file %s", exportfilename) - fp = open(exportfilename, 'w') - fp.write('%s\n'%export_symbols[0]) - fp.close() - # Generate the prefix file, if needed, and put it in the settings - if self.__macros: - prefixfilename = os.path.join(os.getcwd(), os.path.join(build_temp, prefixname)) - fp = open(prefixfilename, 'w') - fp.write('#include "mwerks_shcarbon_config.h"\n') - for name, value in self.__macros: - if value is None: - fp.write('#define %s\n'%name) - else: - fp.write('#define %s %s\n'%(name, value)) - fp.close() - settings['prefixname'] = prefixname - - # Build the XML file. We need the full pathname (only lateron, really) - # because we pass this pathname to CodeWarrior in an AppleEvent, and CW - # doesn't have a clue about our working directory. - xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname)) - log.debug("\tCreate XML file %s", xmlfilename) - import mkcwproject - xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings) - xmlbuilder.generate() - xmldata = settings['tmp_projectxmldata'] - fp = open(xmlfilename, 'w') - fp.write(xmldata) - fp.close() - # Generate the project. Again a full pathname. - projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname)) - log.debug('\tCreate project file %s', projectfilename) - mkcwproject.makeproject(xmlfilename, projectfilename) - # And build it - log.debug('\tBuild project') - mkcwproject.buildproject(projectfilename) - - def _filename_to_abs(self, filename): - # Some filenames seem to be unix-like. Convert to Mac names. -## if '/' in filename and ':' in filename: -## raise DistutilsPlatformError, 'Filename may be Unix or Mac style: %s'%filename -## if '/' in filename: -## filename = macurl2path(filename) - filename = distutils.util.convert_path(filename) - if not os.path.isabs(filename): - curdir = os.getcwd() - filename = os.path.join(curdir, filename) - # Finally remove .. components - components = string.split(filename, ':') - for i in range(1, len(components)): - if components[i] == '..': - components[i] = '' - return string.join(components, ':') - - def library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for libraries. - """ - return # XXXX Not correct... - - def runtime_library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for runtime libraries. - """ - # Nothing needed or Mwerks/Mac. - return - - def library_option (self, lib): - """Return the compiler option to add 'dir' to the list of libraries - linked into the shared library or executable. - """ - return - - def find_library_file (self, dirs, lib, debug=0): - """Search the specified list of directories for a static or shared - library file 'lib' and return the full path to that file. If - 'debug' true, look for a debugging version (if that makes sense on - the current platform). Return None if 'lib' wasn't found in any of - the specified directories. - """ - return 0 Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 25 19:19:25 2009 @@ -145,6 +145,8 @@ Library ------- +- Issue #4863: distutils.mwerkscompiler has been removed. + - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage examples. From python-checkins at python.org Sun Jan 25 19:21:04 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 19:21:04 +0100 (CET) Subject: [Python-checkins] r68930 - python/branches/release26-maint Message-ID: <20090125182104.A1FCB1E4013@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 19:21:04 2009 New Revision: 68930 Log: Blocked revisions 68929 via svnmerge ........ r68929 | tarek.ziade | 2009-01-25 19:19:25 +0100 (Sun, 25 Jan 2009) | 1 line Fixed #4863: removed distutils.mwerkscompiler ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Jan 25 19:27:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 19:27:46 +0100 (CET) Subject: [Python-checkins] r68931 - in python/branches/py3k: Lib/distutils/ccompiler.py Lib/distutils/mwerkscompiler.py Misc/NEWS Message-ID: <20090125182746.321351E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 19:27:45 2009 New Revision: 68931 Log: Merged revisions 68929 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68929 | tarek.ziade | 2009-01-25 19:19:25 +0100 (Sun, 25 Jan 2009) | 1 line Fixed #4863: removed distutils.mwerkscompiler ........ Removed: python/branches/py3k/Lib/distutils/mwerkscompiler.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/ccompiler.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/ccompiler.py ============================================================================== --- python/branches/py3k/Lib/distutils/ccompiler.py (original) +++ python/branches/py3k/Lib/distutils/ccompiler.py Sun Jan 25 19:27:45 2009 @@ -1004,7 +1004,6 @@ # OS name mappings ('posix', 'unix'), ('nt', 'msvc'), - ('mac', 'mwerks'), ) @@ -1042,8 +1041,6 @@ "Mingw32 port of GNU C Compiler for Win32"), 'bcpp': ('bcppcompiler', 'BCPPCompiler', "Borland C++ Compiler"), - 'mwerks': ('mwerkscompiler', 'MWerksCompiler', - "MetroWerks CodeWarrior"), 'emx': ('emxccompiler', 'EMXCCompiler', "EMX port of GNU C Compiler for OS/2"), } Deleted: python/branches/py3k/Lib/distutils/mwerkscompiler.py ============================================================================== --- python/branches/py3k/Lib/distutils/mwerkscompiler.py Sun Jan 25 19:27:45 2009 +++ (empty file) @@ -1,245 +0,0 @@ -"""distutils.mwerkscompiler - -Contains MWerksCompiler, an implementation of the abstract CCompiler class -for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on -Windows.""" - -__revision__ = "$Id$" - -import sys, os -from distutils.errors import \ - DistutilsExecError, DistutilsPlatformError, \ - CompileError, LibError, LinkError -from distutils.ccompiler import \ - CCompiler, gen_preprocess_options, gen_lib_options -import distutils.util -import distutils.dir_util -from distutils import log - -class MWerksCompiler (CCompiler) : - """Concrete class that implements an interface to MetroWerks CodeWarrior, - as defined by the CCompiler abstract class.""" - - compiler_type = 'mwerks' - - # Just set this so CCompiler's constructor doesn't barf. We currently - # don't use the 'set_executables()' bureaucracy provided by CCompiler, - # as it really isn't necessary for this sort of single-compiler class. - # Would be nice to have a consistent interface with UnixCCompiler, - # though, so it's worth thinking about. - executables = {} - - # Private class data (need to distinguish C from C++ source for compiler) - _c_extensions = ['.c'] - _cpp_extensions = ['.cc', '.cpp', '.cxx'] - _rc_extensions = ['.r'] - _exp_extension = '.exp' - - # Needed for the filename generation methods provided by the - # base class, CCompiler. - src_extensions = (_c_extensions + _cpp_extensions + - _rc_extensions) - res_extension = '.rsrc' - obj_extension = '.obj' # Not used, really - static_lib_extension = '.lib' - shared_lib_extension = '.slb' - static_lib_format = shared_lib_format = '%s%s' - exe_extension = '' - - - def __init__ (self, - verbose=0, - dry_run=0, - force=0): - - CCompiler.__init__ (self, verbose, dry_run, force) - - - def compile (self, - sources, - output_dir=None, - macros=None, - include_dirs=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - depends=None): - (output_dir, macros, include_dirs) = \ - self._fix_compile_args (output_dir, macros, include_dirs) - self.__sources = sources - self.__macros = macros - self.__include_dirs = include_dirs - # Don't need extra_preargs and extra_postargs for CW - return [] - - def link (self, - target_desc, - objects, - output_filename, - output_dir=None, - libraries=None, - library_dirs=None, - runtime_library_dirs=None, - export_symbols=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - build_temp=None, - target_lang=None): - # First fixup. - (objects, output_dir) = self._fix_object_args (objects, output_dir) - (libraries, library_dirs, runtime_library_dirs) = \ - self._fix_lib_args (libraries, library_dirs, runtime_library_dirs) - - # First examine a couple of options for things that aren't implemented yet - if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT): - raise DistutilsPlatformError('Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac') - if runtime_library_dirs: - raise DistutilsPlatformError('Runtime library dirs not implemented yet') - if extra_preargs or extra_postargs: - raise DistutilsPlatformError('Runtime library dirs not implemented yet') - if len(export_symbols) != 1: - raise DistutilsPlatformError('Need exactly one export symbol') - # Next there are various things for which we need absolute pathnames. - # This is because we (usually) create the project in a subdirectory of - # where we are now, and keeping the paths relative is too much work right - # now. - sources = [self._filename_to_abs(s) for s in self.__sources] - include_dirs = [self._filename_to_abs(d) for d in self.__include_dirs] - if objects: - objects = [self._filename_to_abs(o) for o in objects] - else: - objects = [] - if build_temp: - build_temp = self._filename_to_abs(build_temp) - else: - build_temp = os.curdir() - if output_dir: - output_filename = os.path.join(output_dir, output_filename) - # The output filename needs special handling: splitting it into dir and - # filename part. Actually I'm not sure this is really needed, but it - # can't hurt. - output_filename = self._filename_to_abs(output_filename) - output_dir, output_filename = os.path.split(output_filename) - # Now we need the short names of a couple of things for putting them - # into the project. - if output_filename[-8:] == '.ppc.slb': - basename = output_filename[:-8] - elif output_filename[-11:] == '.carbon.slb': - basename = output_filename[:-11] - else: - basename = os.path.strip(output_filename)[0] - projectname = basename + '.mcp' - targetname = basename - xmlname = basename + '.xml' - exportname = basename + '.mcp.exp' - prefixname = 'mwerks_%s_config.h'%basename - # Create the directories we need - distutils.dir_util.mkpath(build_temp, dry_run=self.dry_run) - distutils.dir_util.mkpath(output_dir, dry_run=self.dry_run) - # And on to filling in the parameters for the project builder - settings = {} - settings['mac_exportname'] = exportname - settings['mac_outputdir'] = output_dir - settings['mac_dllname'] = output_filename - settings['mac_targetname'] = targetname - settings['sysprefix'] = sys.prefix - settings['mac_sysprefixtype'] = 'Absolute' - sourcefilenames = [] - sourcefiledirs = [] - for filename in sources + objects: - dirname, filename = os.path.split(filename) - sourcefilenames.append(filename) - if not dirname in sourcefiledirs: - sourcefiledirs.append(dirname) - settings['sources'] = sourcefilenames - settings['libraries'] = libraries - settings['extrasearchdirs'] = sourcefiledirs + include_dirs + library_dirs - if self.dry_run: - print('CALLING LINKER IN', os.getcwd()) - for key, value in settings.items(): - print('%20.20s %s'%(key, value)) - return - # Build the export file - exportfilename = os.path.join(build_temp, exportname) - log.debug("\tCreate export file %s", exportfilename) - fp = open(exportfilename, 'w') - fp.write('%s\n'%export_symbols[0]) - fp.close() - # Generate the prefix file, if needed, and put it in the settings - if self.__macros: - prefixfilename = os.path.join(os.getcwd(), os.path.join(build_temp, prefixname)) - fp = open(prefixfilename, 'w') - fp.write('#include "mwerks_shcarbon_config.h"\n') - for name, value in self.__macros: - if value is None: - fp.write('#define %s\n'%name) - else: - fp.write('#define %s %s\n'%(name, value)) - fp.close() - settings['prefixname'] = prefixname - - # Build the XML file. We need the full pathname (only lateron, really) - # because we pass this pathname to CodeWarrior in an AppleEvent, and CW - # doesn't have a clue about our working directory. - xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname)) - log.debug("\tCreate XML file %s", xmlfilename) - import mkcwproject - xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings) - xmlbuilder.generate() - xmldata = settings['tmp_projectxmldata'] - fp = open(xmlfilename, 'w') - fp.write(xmldata) - fp.close() - # Generate the project. Again a full pathname. - projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname)) - log.debug('\tCreate project file %s', projectfilename) - mkcwproject.makeproject(xmlfilename, projectfilename) - # And build it - log.debug('\tBuild project') - mkcwproject.buildproject(projectfilename) - - def _filename_to_abs(self, filename): - # Some filenames seem to be unix-like. Convert to Mac names. -## if '/' in filename and ':' in filename: -## raise DistutilsPlatformError, 'Filename may be Unix or Mac style: %s'%filename -## if '/' in filename: -## filename = macurl2path(filename) - filename = distutils.util.convert_path(filename) - if not os.path.isabs(filename): - curdir = os.getcwd() - filename = os.path.join(curdir, filename) - # Finally remove .. components - components = filename.split(':') - for i in range(1, len(components)): - if components[i] == '..': - components[i] = '' - return ':'.join(components) - - def library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for libraries. - """ - return # XXXX Not correct... - - def runtime_library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for runtime libraries. - """ - # Nothing needed or Mwerks/Mac. - return - - def library_option (self, lib): - """Return the compiler option to add 'dir' to the list of libraries - linked into the shared library or executable. - """ - return - - def find_library_file (self, dirs, lib, debug=0): - """Search the specified list of directories for a static or shared - library file 'lib' and return the full path to that file. If - 'debug' true, look for a debugging version (if that makes sense on - the current platform). Return None if 'lib' wasn't found in any of - the specified directories. - """ - return 0 Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Jan 25 19:27:45 2009 @@ -144,6 +144,8 @@ Library ------- +- Issue #4863: distutils.mwerkscompiler has been removed. + - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage examples. From python-checkins at python.org Sun Jan 25 19:28:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 19:28:48 +0100 (CET) Subject: [Python-checkins] r68932 - python/branches/release30-maint Message-ID: <20090125182848.92EA01E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 19:28:48 2009 New Revision: 68932 Log: Blocked revisions 68931 via svnmerge ................ r68931 | tarek.ziade | 2009-01-25 19:27:45 +0100 (Sun, 25 Jan 2009) | 9 lines Merged revisions 68929 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68929 | tarek.ziade | 2009-01-25 19:19:25 +0100 (Sun, 25 Jan 2009) | 1 line Fixed #4863: removed distutils.mwerkscompiler ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun Jan 25 19:44:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 18:44:57 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090125184457.C45751E4015@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/4532 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_sundry ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_sundry.py", line 27, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler make: *** [buildbottest] Error 1 sincerely, -The Buildbot From guido at python.org Sun Jan 25 19:56:34 2009 From: guido at python.org (Guido van Rossum) Date: Sun, 25 Jan 2009 10:56:34 -0800 Subject: [Python-checkins] PEP 374 In-Reply-To: <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> References: <20090124230633.9B1801E4026@bag.python.org> <6247AFD31A7A43E7AAB7109012EFBF7C@RaymondLaptop1> Message-ID: On Sat, Jan 24, 2009 at 3:40 PM, Raymond Hettinger wrote: > Somewhere near the top of the PEP, I think there should be a discussion of > reasons not to change at all. The possibility of rejection is an implicit part of every PEP. PEP 374 contains a long rationale section. If you disagree, fine, but I don't think you need to criticize the PEP's form. > Everytime we alter the tool chain, it disrupts developers lives. When I was > working mainly under Windows, I was at one time the most active contributor > by a huge margin. Then Martin switched the build to VC7 which caused me to > go over year before I could make another checkin to CPython. By then VC8 > was out and VC7 was hard to find. It crippled my development. When we > switch tools, *every* developer will have to go through an install, > switchover, and learn a new set of commands and checkin practices. You forget that many developers are *already* using a DVCS, either for other projects, or using some kind of bridge. Otherwise the PEP wouldn't have gotten so much traction already! > The is a > huge PITA and it is almost certain that some developers won't bother. The same can be said for any change, including Python 3000 (or 2.6 for that matter). You seem to be seeing it as exclusively a PITA with no payback. That seems rather short-sighted. DVCS can have huge benefits for cooperative development. (Maybe the PEP could be extended with some examples? I believe Mozilla uses Mercurial for example. And you know the Linux kernel uses Git.) > For > many of the developers that do bother, it will cost them a day of their > lives getting switched over and working through the learning curve -- that > is a day that could have been spent fixing bugs or doing something > non-administrative that actually adds value. Oh come on. I installed Mercurial (from source!) on two different machines and started being productive in half an hour (including the research to find where to download it, and how to configure the username). Learning all the ins and outs will take longer, for sure -- but you get the time back by having a much better way for managing tentative patches or multiple branches, for example. > Before we boot SVN, I think we need to be damned sure that there will be > HUGE offsetting benefits to a DVCS and be pretty sure that our little > community is actually ready for a distributed process. "Our little community"? I see Python as one of the major open source projects, with an influence way beyond just the Python language users. There's probably only a dozen larger projects. > I'm concerned that over time we're moving towards a process that has a lot > more admin than we used to. Changes to PEP 8, rules on indentation, review > rules, etc seem to be driven by the least active developers. Most of the > folks who do most of the work rarely ask for more restrictions, more admin, > etc. Even little things like automatically rejecting submissions without > whitespace normalization add to the admin burden (time spent doing something > that doesn't actually improve lives for end-users). (Some) more admin is the price we pay for our success. I recall the days when there was *no* admin needed and I could do everything myself. Frankly, I do *not* want to go back there. > SVN is relatively simple. DVCS systems are much more process oriented and > aimed at professional developers. I think you have this backwards. Most professionals (people coding for money in a company) are using more centralized VCSes (often because their management wants to know what the engineers are doing). To the contrary, it's the open source hobbyists who've taken up DVCSes, because they facilitate the *distributed* (get it? :-) way of working in such project.s > I think we will lose many newbie patches > if the person is forced to use an unfamiliar version control system. Newbies by definition don't use VCSes; they patch the source code of a two-year-old download in place and send us a new file, marked up with comments indicating where they made changes (and forgetting some other file they also patched earlier). Or if we're lucky they saved the original file and send us a diff -- in a format we cannot read. I was going to say that the one thing that's easier with svn is that it comes pre-installed on most Linuxes, while hg and bzr don't; but remember that 70% or moreof our users are on Windows -- the great equalizer, where they have to install whatever [D]VCS we tell them to use anyways. > I like the quality of the research that you're doing but suspect that the > end goal of switching away from SVN may not be worth the disruption and > effects on real developers. > > My two cents, Sorry, most of that sounds like FUD to me. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From buildbot at python.org Sun Jan 25 20:13:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 19:13:05 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090125191305.8BFC71E403A@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/544 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 Sun Jan 25 20:29:11 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 20:29:11 +0100 (CET) Subject: [Python-checkins] r68933 - in python/trunk: Doc/distutils/apiref.rst Lib/test/test_sundry.py Message-ID: <20090125192911.1ECB21E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 20:29:10 2009 New Revision: 68933 Log: Issue #4863, removing remaining bits Modified: python/trunk/Doc/distutils/apiref.rst python/trunk/Lib/test/test_sundry.py Modified: python/trunk/Doc/distutils/apiref.rst ============================================================================== --- python/trunk/Doc/distutils/apiref.rst (original) +++ python/trunk/Doc/distutils/apiref.rst Sun Jan 25 20:29:10 2009 @@ -847,23 +847,6 @@ :class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2. -:mod:`distutils.mwerkscompiler` --- Metrowerks CodeWarrior support -================================================================== - -.. module:: distutils.mwerkscompiler - :synopsis: Metrowerks CodeWarrior support - - -Contains :class:`MWerksCompiler`, an implementation of the abstract -:class:`CCompiler` class for MetroWerks CodeWarrior on the pre-Mac OS X -Macintosh. Needs work to support CW on Windows or Mac OS X. - -.. % \subsection{Utility modules} -.. % -.. % The following modules all provide general utility functions. They haven't -.. % all been documented yet. - - :mod:`distutils.archive_util` --- Archiving utilities ====================================================== Modified: python/trunk/Lib/test/test_sundry.py ============================================================================== --- python/trunk/Lib/test/test_sundry.py (original) +++ python/trunk/Lib/test/test_sundry.py Sun Jan 25 20:29:10 2009 @@ -24,7 +24,6 @@ import distutils.filelist if sys.platform.startswith('win'): import distutils.msvccompiler - import distutils.mwerkscompiler import distutils.text_file import distutils.unixccompiler From python-checkins at python.org Sun Jan 25 20:30:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 20:30:17 +0100 (CET) Subject: [Python-checkins] r68934 - python/branches/release26-maint Message-ID: <20090125193017.989921E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 20:30:17 2009 New Revision: 68934 Log: Blocked revisions 68933 via svnmerge ........ r68933 | tarek.ziade | 2009-01-25 20:29:10 +0100 (Sun, 25 Jan 2009) | 1 line Issue #4863, removing remaining bits ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Jan 25 20:31:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 20:31:23 +0100 (CET) Subject: [Python-checkins] r68935 - in python/branches/py3k: Doc/distutils/apiref.rst Lib/test/test_sundry.py Message-ID: <20090125193123.005F41E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 20:31:22 2009 New Revision: 68935 Log: Merged revisions 68933 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68933 | tarek.ziade | 2009-01-25 20:29:10 +0100 (Sun, 25 Jan 2009) | 1 line Issue #4863, removing remaining bits ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/apiref.rst python/branches/py3k/Lib/test/test_sundry.py Modified: python/branches/py3k/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k/Doc/distutils/apiref.rst (original) +++ python/branches/py3k/Doc/distutils/apiref.rst Sun Jan 25 20:31:22 2009 @@ -847,23 +847,6 @@ :class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2. -:mod:`distutils.mwerkscompiler` --- Metrowerks CodeWarrior support -================================================================== - -.. module:: distutils.mwerkscompiler - :synopsis: Metrowerks CodeWarrior support - - -Contains :class:`MWerksCompiler`, an implementation of the abstract -:class:`CCompiler` class for MetroWerks CodeWarrior on the pre-Mac OS X -Macintosh. Needs work to support CW on Windows or Mac OS X. - -.. % \subsection{Utility modules} -.. % -.. % The following modules all provide general utility functions. They haven't -.. % all been documented yet. - - :mod:`distutils.archive_util` --- Archiving utilities ====================================================== Modified: python/branches/py3k/Lib/test/test_sundry.py ============================================================================== --- python/branches/py3k/Lib/test/test_sundry.py (original) +++ python/branches/py3k/Lib/test/test_sundry.py Sun Jan 25 20:31:22 2009 @@ -21,7 +21,6 @@ import distutils.filelist if sys.platform.startswith('win'): import distutils.msvccompiler - import distutils.mwerkscompiler import distutils.text_file import distutils.unixccompiler From python-checkins at python.org Sun Jan 25 20:32:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 20:32:09 +0100 (CET) Subject: [Python-checkins] r68936 - python/branches/release30-maint Message-ID: <20090125193209.F21F01E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 20:32:09 2009 New Revision: 68936 Log: Blocked revisions 68935 via svnmerge ................ r68935 | tarek.ziade | 2009-01-25 20:31:22 +0100 (Sun, 25 Jan 2009) | 9 lines Merged revisions 68933 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68933 | tarek.ziade | 2009-01-25 20:29:10 +0100 (Sun, 25 Jan 2009) | 1 line Issue #4863, removing remaining bits ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun Jan 25 20:34:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 19:34:53 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090125193453.64AFE1E4054@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/1747 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: Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_sundry ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_sundry.py", line 27, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Jan 25 20:34:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 19:34:55 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090125193455.25CB41E4014@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/199 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_sundry ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_sundry.py", line 24, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 20:44:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 25 Jan 2009 20:44:16 +0100 (CET) Subject: [Python-checkins] r68937 - python/branches/py3k/Doc/library/importlib.rst Message-ID: <20090125194416.D9C4A1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Jan 25 20:44:16 2009 New Revision: 68937 Log: use the classmethod directive Modified: python/branches/py3k/Doc/library/importlib.rst Modified: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k/Doc/library/importlib.rst (original) +++ python/branches/py3k/Doc/library/importlib.rst Sun Jan 25 20:44:16 2009 @@ -95,12 +95,12 @@ Only class methods are defined by this class to alleviate the need for instantiation. - .. method:: find_module(fullname, path=None) + .. classmethod:: find_module(fullname, path=None) Class method that allows this class to be a :term:`finder` for built-in modules. - .. method:: load_module(fullname) + .. classmethod:: load_module(fullname) Class method that allows this class to be a :term:`loader` for built-in modules. @@ -113,12 +113,12 @@ Only class methods are defined by this class to alleviate the need for instantiation. - .. method:: find_module(fullname, path=None) + .. classmethod:: find_module(fullname, path=None) Class method that allows this class to be a :term:`finder` for frozen modules. - .. method:: load_module(fullname) + .. classmethod:: load_module(fullname) Class method that allows this class to be a :term:`loader` for frozen modules. From buildbot at python.org Sun Jan 25 20:50:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 19:50:47 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090125195047.9E00D1E4002@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/61 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_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 21:08:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 21:08:28 +0100 (CET) Subject: [Python-checkins] r68938 - in python/branches/py3k-issue1717: Demo/classes/Complex.py Demo/classes/bitvec.py Demo/tix/grid.py Demo/tix/samples/Balloon.py Demo/tix/samples/BtnBox.py Demo/tix/samples/CmpImg.py Demo/tix/samples/ComboBox.py Demo/tix/samples/Control.py Demo/tix/samples/DirList.py Demo/tix/samples/DirTree.py Demo/tix/samples/NoteBook.py Demo/tix/samples/OptMenu.py Demo/tix/samples/PanedWin.py Demo/tix/samples/PopMenu.py Demo/tix/samples/SHList1.py Demo/tix/samples/SHList2.py Demo/tix/samples/Tree.py Demo/tix/tixwidgets.py Demo/tkinter/guido/AttrDialog.py Demo/tkinter/guido/ManPage.py Demo/tkinter/guido/MimeViewer.py Demo/tkinter/guido/ShellWindow.py Demo/tkinter/guido/brownian.py Demo/tkinter/guido/brownian2.py Demo/tkinter/guido/canvasevents.py Demo/tkinter/guido/dialog.py Demo/tkinter/guido/electrons.py Demo/tkinter/guido/hanoi.py Demo/tkinter/guido/hello.py Demo/tkinter/guido/imagedraw.py Demo/tkinter/guido/imageview.py Demo/tkinter/guido/kill.py Demo/tkinter/guido/listtree.py Demo/tkinter/guido/mbox.py Demo/tkinter/guido/newmenubardemo.py Demo/tkinter/guido/optionmenu.py Demo/tkinter/guido/paint.py Demo/tkinter/guido/rmt.py Demo/tkinter/guido/solitaire.py Demo/tkinter/guido/sortvisu.py Demo/tkinter/guido/ss1.py Demo/tkinter/guido/svkill.py Demo/tkinter/guido/switch.py Demo/tkinter/guido/tkman.py Demo/tkinter/matt/00-HELLO-WORLD.py Demo/tkinter/matt/animation-simple.py Demo/tkinter/matt/animation-w-velocity-ctrl.py Demo/tkinter/matt/bind-w-mult-calls-p-type.py Demo/tkinter/matt/canvas-demo-simple.py Demo/tkinter/matt/canvas-gridding.py Demo/tkinter/matt/canvas-moving-or-creating.py Demo/tkinter/matt/canvas-moving-w-mouse.py Demo/tkinter/matt/canvas-mult-item-sel.py Demo/tkinter/matt/canvas-reading-tag-info.py Demo/tkinter/matt/canvas-w-widget-draw-el.py Demo/tkinter/matt/canvas-with-scrollbars.py Demo/tkinter/matt/dialog-box.py Demo/tkinter/matt/entry-simple.py Demo/tkinter/matt/entry-with-shared-variable.py Demo/tkinter/matt/killing-window-w-wm.py Demo/tkinter/matt/menu-all-types-of-entries.py Demo/tkinter/matt/menu-simple.py Demo/tkinter/matt/not-what-you-might-think-1.py Demo/tkinter/matt/not-what-you-might-think-2.py Demo/tkinter/matt/packer-and-placer-together.py Demo/tkinter/matt/packer-simple.py Demo/tkinter/matt/placer-simple.py Demo/tkinter/matt/pong-demo-1.py Demo/tkinter/matt/printing-coords-of-items.py Demo/tkinter/matt/radiobutton-simple.py Demo/tkinter/matt/rubber-band-box-demo-1.py Demo/tkinter/matt/rubber-line-demo-1.py Demo/tkinter/matt/slider-demo-1.py Demo/tkinter/matt/subclass-existing-widgets.py Demo/tkinter/matt/two-radio-groups.py Demo/tkinter/matt/window-creation-more.py Demo/tkinter/matt/window-creation-simple.py Demo/tkinter/matt/window-creation-w-location.py Doc/ACKS.txt Doc/Makefile Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/buffer.rst Doc/c-api/bytes.rst Doc/c-api/conversion.rst Doc/c-api/file.rst Doc/c-api/init.rst Doc/c-api/intro.rst Doc/c-api/long.rst Doc/c-api/module.rst Doc/c-api/number.rst Doc/c-api/object.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/data/refcounts.dat Doc/distutils/apiref.rst Doc/distutils/builtdist.rst Doc/distutils/configfile.rst Doc/distutils/packageindex.rst Doc/distutils/setupscript.rst Doc/distutils/uploading.rst Doc/documenting/markup.rst Doc/extending/building.rst Doc/extending/extending.rst Doc/extending/newtypes.rst Doc/extending/windows.rst Doc/glossary.rst Doc/howto/curses.rst Doc/howto/doanddont.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/howto/urllib2.rst Doc/howto/webservers.rst Doc/install/index.rst Doc/library/2to3.rst Doc/library/abc.rst Doc/library/aifc.rst Doc/library/array.rst Doc/library/ast.rst Doc/library/audioop.rst Doc/library/base64.rst Doc/library/bdb.rst Doc/library/binascii.rst Doc/library/cmath.rst Doc/library/codeop.rst Doc/library/collections.rst Doc/library/configparser.rst Doc/library/constants.rst Doc/library/crypt.rst Doc/library/csv.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/decimal.rst Doc/library/dis.rst Doc/library/email.mime.rst Doc/library/fileinput.rst Doc/library/fractions.rst Doc/library/ftplib.rst Doc/library/functions.rst Doc/library/gettext.rst Doc/library/gzip.rst Doc/library/hashlib.rst Doc/library/heapq.rst Doc/library/http.cookiejar.rst Doc/library/http.cookies.rst Doc/library/idle.rst Doc/library/importlib.rst Doc/library/inspect.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/json.rst Doc/library/locale.rst Doc/library/logging.rst Doc/library/mailbox.rst Doc/library/math.rst Doc/library/mmap.rst Doc/library/modules.rst Doc/library/msvcrt.rst Doc/library/multiprocessing.rst Doc/library/nntplib.rst Doc/library/numbers.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/ossaudiodev.rst Doc/library/othergui.rst Doc/library/parser.rst Doc/library/pdb.rst Doc/library/pickle.rst Doc/library/profile.rst Doc/library/pyexpat.rst Doc/library/queue.rst Doc/library/random.rst Doc/library/re.rst Doc/library/reprlib.rst Doc/library/rlcompleter.rst Doc/library/sched.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/smtplib.rst Doc/library/socket.rst Doc/library/sqlite3.rst Doc/library/ssl.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/subprocess.rst Doc/library/symtable.rst Doc/library/sys.rst Doc/library/tempfile.rst Doc/library/test.rst Doc/library/threading.rst Doc/library/tk.rst Doc/library/tkinter.rst Doc/library/tkinter.tix.rst Doc/library/tokenize.rst Doc/library/trace.rst Doc/library/traceback.rst Doc/library/turtle.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/urllib.parse.rst Doc/library/urllib.request.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/library/wsgiref.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpc.client.rst Doc/library/xmlrpc.server.rst Doc/library/zipfile.rst Doc/library/zipimport.rst Doc/library/zlib.rst Doc/license.rst Doc/make.bat Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tools Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/tutorial/classes.rst Doc/tutorial/controlflow.rst Doc/tutorial/datastructures.rst Doc/tutorial/errors.rst Doc/tutorial/index.rst Doc/tutorial/inputoutput.rst Doc/tutorial/interpreter.rst Doc/tutorial/introduction.rst Doc/tutorial/modules.rst Doc/tutorial/stdlib.rst Doc/tutorial/stdlib2.rst Doc/tutorial/whatnow.rst Doc/using/cmdline.rst Doc/using/unix.rst Doc/using/windows.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.1.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.3.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.6.rst Doc/whatsnew/2.7.rst Doc/whatsnew/3.0.rst Doc/whatsnew/3.1.rst Include/abstract.h Include/longobject.h Include/memoryobject.h Include/object.h Include/pydebug.h Include/pyerrors.h Include/pymath.h Include/pyport.h Include/unicodeobject.h LICENSE Lib/_abcoll.py Lib/ast.py Lib/collections.py Lib/ctypes/test/__init__.py Lib/ctypes/test/test_pep3118.py Lib/ctypes/util.py Lib/decimal.py Lib/distutils/command/register.py Lib/distutils/command/sdist.py Lib/distutils/command/upload.py Lib/distutils/config.py Lib/distutils/dist.py Lib/distutils/tests/test_msvc9compiler.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_upload.py Lib/fractions.py Lib/gzip.py Lib/heapq.py Lib/http/client.py Lib/idlelib/EditorWindow.py Lib/idlelib/IOBinding.py Lib/idlelib/NEWS.txt Lib/idlelib/ScriptBinding.py Lib/idlelib/help.txt Lib/idlelib/macosxSupport.py Lib/importlib Lib/importlib/test Lib/importlib/test/builtin Lib/importlib/test/extension Lib/importlib/test/frozen Lib/importlib/test/import_ Lib/importlib/test/source Lib/inspect.py Lib/io.py Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_execfile.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_long.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/main.py Lib/lib2to3/pgen2/driver.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/py3_test_grammar.py Lib/lib2to3/tests/test_fixers.py Lib/logging/__init__.py Lib/logging/handlers.py Lib/multiprocessing/__init__.py Lib/multiprocessing/forking.py Lib/multiprocessing/managers.py Lib/multiprocessing/sharedctypes.py Lib/multiprocessing/util.py Lib/pickle.py Lib/pickletools.py Lib/random.py Lib/smtplib.py Lib/socket.py Lib/test/crashers/iter.py Lib/test/inspect_fodder2.py Lib/test/pickletester.py Lib/test/support.py Lib/test/test_ast.py Lib/test/test_binop.py Lib/test/test_bz2.py Lib/test/test_capi.py Lib/test/test_cmath.py Lib/test/test_cmd_line.py Lib/test/test_codeccallbacks.py Lib/test/test_codecs.py Lib/test/test_collections.py Lib/test/test_datetime.py Lib/test/test_decimal.py Lib/test/test_fileio.py Lib/test/test_fractions.py Lib/test/test_gzip.py Lib/test/test_hashlib.py Lib/test/test_import.py Lib/test/test_importlib.py Lib/test/test_inspect.py Lib/test/test_io.py Lib/test/test_iter.py Lib/test/test_itertools.py Lib/test/test_kqueue.py Lib/test/test_long.py Lib/test/test_memoryview.py Lib/test/test_multibytecodec.py Lib/test/test_multiprocessing.py Lib/test/test_os.py Lib/test/test_socket.py Lib/test/test_struct.py Lib/test/test_sys.py Lib/test/test_urllib.py Lib/test/test_wsgiref.py Lib/test/test_xmlrpc.py Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/tkinter/__init__.py Lib/tkinter/_fix.py Lib/tkinter/tix.py Lib/unittest.py Lib/wsgiref/handlers.py Lib/wsgiref/headers.py Lib/wsgiref/simple_server.py Lib/wsgiref/util.py Lib/wsgiref/validate.py Lib/zipfile.py Makefile.pre.in Misc/ACKS Misc/NEWS Misc/build.sh Modules/_codecsmodule.c Modules/_collectionsmodule.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/libffi_msvc/ffi.c Modules/_dbmmodule.c Modules/_fileio.c Modules/_hashopenssl.c Modules/_multiprocessing/connection.h Modules/_multiprocessing/pipe_connection.c Modules/_multiprocessing/socket_connection.c Modules/_pickle.c Modules/_struct.c Modules/_testcapimodule.c Modules/_tkinter.c Modules/bz2module.c Modules/cjkcodecs/multibytecodec.c Modules/datetimemodule.c Modules/gcmodule.c Modules/grpmodule.c Modules/itertoolsmodule.c Modules/main.c Modules/posixmodule.c Modules/selectmodule.c Modules/socketmodule.c Modules/zlibmodule.c Objects/abstract.c Objects/boolobject.c Objects/bytesobject.c Objects/complexobject.c Objects/exceptions.c Objects/floatobject.c Objects/longobject.c Objects/memoryobject.c Objects/moduleobject.c Objects/object.c Objects/setobject.c Objects/stringlib/fastsearch.h Objects/stringlib/transmogrify.h Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c PC/VC6/_tkinter.dsp PC/VC6/build_tkinter.py PC/VC6/bz2.dsp PC/VC6/pythoncore.dsp PC/VC6/readme.txt PC/VC6/tcl852.patch PC/VS7.1/pythoncore.vcproj PC/VS8.0/pythoncore.vcproj PC/example_nt/example.c PC/os2emx/Makefile PC/os2emx/python27.def PC/os2vacpp/makefile PC/os2vacpp/makefile.omk PC/os2vacpp/python.def PC/pyconfig.h PC/winreg.c PCbuild/pythoncore.vcproj Parser/asdl.py Parser/printgrammar.c Python/Python-ast.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/getcopyright.c Python/getmtime.c Python/graminit.c Python/import.c Python/makeopcodetargets.py Python/opcode_targets.h Python/pythonrun.c Python/sysmodule.c Python/thread.c Python/thread_nt.h README Tools/scripts/patchcheck.py configure configure.in pyconfig.h.in setup.py Message-ID: <20090125200828.E80031E400C@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 21:08:20 2009 New Revision: 68938 Log: Merged revisions 68155,68165,68168-68170,68175,68178,68181,68184,68193,68198,68200,68204-68206,68211-68212,68216,68223-68229,68233,68237,68241-68242,68245-68249,68285,68300-68301,68303,68305,68309,68315-68316,68321,68323,68327,68341-68342,68359,68363,68375,68379,68401,68409,68411,68417,68427,68433-68434,68436,68438,68440,68443,68445,68451,68453-68454,68463,68465,68467,68474-68475,68477,68479,68482-68483,68486,68488-68489,68491,68497,68500,68502,68508,68511,68516,68525,68528-68529,68533,68537-68539,68541,68543,68553,68561,68564,68581,68585-68587,68590-68591,68593,68606,68615,68619,68629-68630,68638,68643,68647,68650-68653,68662,68669,68675,68677,68686,68690-68691,68695-68696,68698,68700-68702,68707,68709,68712,68716-68717,68719,68728-68730,68732,68736,68740,68744,68746,68749,68751,68761-68762,68767,68769-68770,68778,68780,68782,68786,68788,68790-68791,68794-68795,68798-68799,68802,68804,68806,68808-68810,68814-68815,68819,68832-68833,68836,68841,68844,68846-68848,68851,68854-68855,68857,68860-68861,68863-68870,68872-68873,68875,68878,68882-68883,68887,68889,68895,68898,68900,68908,68916,68918-68919,68922,68924,68926 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68155 | ronald.oussoren | 2009-01-02 13:10:34 +0000 (Fri, 02 Jan 2009) | 17 lines Recorded merge of revisions 68153 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68153 | ronald.oussoren | 2009-01-02 13:59:32 +0100 (Fri, 02 Jan 2009) | 10 lines Fix for issue3559: No preferences menu in IDLE on OSX 1) Add a comment to the help file to that points to the preferences menu. 2) An earlier checkin tried to detect Tk >= 8.10.14, but did this in the wrong way. The end result of this was that the IDLE->Preferences... menu got surpressed when using the system version of Tcl/Tk ........ ................ r68165 | antoine.pitrou | 2009-01-02 17:34:35 +0000 (Fri, 02 Jan 2009) | 3 lines Issue #4738: finer-grained locking in the zlib module. ................ r68168 | vinay.sajip | 2009-01-02 18:53:45 +0000 (Fri, 02 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ................ r68169 | georg.brandl | 2009-01-02 19:20:26 +0000 (Fri, 02 Jan 2009) | 2 lines Remove traces of Py_InitModule*. ................ r68170 | georg.brandl | 2009-01-02 20:10:05 +0000 (Fri, 02 Jan 2009) | 2 lines #4808: move old API below new API doc. ................ r68175 | martin.v.loewis | 2009-01-02 20:47:48 +0000 (Fri, 02 Jan 2009) | 13 lines Merged revisions 68172-68173 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68172 | martin.v.loewis | 2009-01-02 21:32:55 +0100 (Fr, 02 Jan 2009) | 2 lines Issue #4075: Use OutputDebugStringW in Py_FatalError. ........ r68173 | martin.v.loewis | 2009-01-02 21:40:14 +0100 (Fr, 02 Jan 2009) | 2 lines Issue #4051: Prevent conflict of UNICODE macros in cPickle. ........ ................ r68178 | benjamin.peterson | 2009-01-02 21:24:04 +0000 (Fri, 02 Jan 2009) | 9 lines Merged revisions 68174 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68174 | benjamin.peterson | 2009-01-02 14:47:27 -0600 (Fri, 02 Jan 2009) | 1 line fix compilation on non-Windows platforms ........ ................ r68181 | raymond.hettinger | 2009-01-02 21:39:07 +0000 (Fri, 02 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ................ r68184 | mark.dickinson | 2009-01-02 23:23:21 +0000 (Fri, 02 Jan 2009) | 10 lines Merged revisions 68182 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68182 | mark.dickinson | 2009-01-02 23:07:08 +0000 (Fri, 02 Jan 2009) | 4 lines Issue #4812: add missing underscore prefix to some internal-use-only constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) ........ ................ r68193 | mark.dickinson | 2009-01-03 12:11:47 +0000 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68191 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68191 | mark.dickinson | 2009-01-03 12:07:20 +0000 (Sat, 03 Jan 2009) | 2 lines Issue #4812: further renaming of internal Decimal constants, for clarity. ........ ................ r68198 | benjamin.peterson | 2009-01-03 16:53:14 +0000 (Sat, 03 Jan 2009) | 62 lines Merged revisions 68197 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68197 | benjamin.peterson | 2009-01-03 10:34:02 -0600 (Sat, 03 Jan 2009) | 55 lines Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved also add unittests for the fixer ........ r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line remove unused import ........ r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line copy permission bits from the backup to the original ........ r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line ........ r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line don't need loop ........ r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line actually call finish_tree() ........ r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line remove useless test ........ r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line update pyk3's test grammar ........ r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line #2734 don't convert every instance of long (eg if it's an attribute) ........ r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line add another test ........ r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line don't change long even if it's the only argument name ........ r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line remove unused import ........ ................ ................ r68200 | antoine.pitrou | 2009-01-03 16:59:18 +0000 (Sat, 03 Jan 2009) | 8 lines Issue #4580: slicing of memoryviews when itemsize != 1 is wrong. Also fix len() to return number of items rather than length in bytes. I'm sorry it was not possible for me to work on this without reindenting a bit some stuff around. The indentation in memoryobject.c is a mess, I'll open a separate bug for it. ................ r68204 | martin.v.loewis | 2009-01-03 17:22:40 +0000 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68203 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68203 | martin.v.loewis | 2009-01-03 18:19:26 +0100 (Sa, 03 Jan 2009) | 2 lines Issue #4817: Remove unused function PyOS_GetLastModificationTime. ........ ................ r68205 | antoine.pitrou | 2009-01-03 18:41:49 +0000 (Sat, 03 Jan 2009) | 4 lines Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x, in accordance with http://www.wsgi.org/wsgi/Amendments_1.0 ................ r68206 | antoine.pitrou | 2009-01-03 18:49:41 +0000 (Sat, 03 Jan 2009) | 3 lines Actually make test_wsgiref independent from the Python version. ................ r68211 | raymond.hettinger | 2009-01-03 19:20:32 +0000 (Sat, 03 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ................ r68212 | antoine.pitrou | 2009-01-03 19:20:36 +0000 (Sat, 03 Jan 2009) | 4 lines Issue #4822: fix messy indentation in memoryobject.c/.h, before we may backport it to trunk. Reviewed on IRC by Georg Brandl, with assistance by Benjamin Peterson. ................ r68216 | antoine.pitrou | 2009-01-03 20:28:05 +0000 (Sat, 03 Jan 2009) | 3 lines Fix BytesWarning with -bb in wsgiref.headers.Headers. ................ r68223 | georg.brandl | 2009-01-03 21:15:20 +0000 (Sat, 03 Jan 2009) | 21 lines Merged revisions 68214-68215,68217-68218 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines Make indentation consistent. ........ r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines Fix role name. ........ r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. ........ r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines Recognize usage of the default role. ........ ................ r68224 | georg.brandl | 2009-01-03 21:17:04 +0000 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68219 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines Fix uses of the default role. ........ ................ r68225 | georg.brandl | 2009-01-03 21:17:44 +0000 (Sat, 03 Jan 2009) | 8 lines Blocked revisions 68220 via svnmerge ........ r68220 | georg.brandl | 2009-01-03 21:55:06 +0100 (Sat, 03 Jan 2009) | 2 lines Remove trailing whitespace. ........ ................ r68226 | georg.brandl | 2009-01-03 21:18:54 +0000 (Sat, 03 Jan 2009) | 2 lines Remove trailing whitespace. ................ r68227 | georg.brandl | 2009-01-03 21:26:05 +0000 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68221 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines Remove tabs from the documentation. ........ ................ r68228 | georg.brandl | 2009-01-03 21:30:40 +0000 (Sat, 03 Jan 2009) | 9 lines Merged revisions 68222 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines Disable the line length checker by default. ........ ................ r68229 | georg.brandl | 2009-01-03 21:31:47 +0000 (Sat, 03 Jan 2009) | 2 lines Fix a few remaining problems found by rstlint. ................ r68233 | guilherme.polo | 2009-01-03 21:53:34 +0000 (Sat, 03 Jan 2009) | 10 lines Blocked revisions 68231 via svnmerge ........ r68231 | guilherme.polo | 2009-01-03 19:51:09 -0200 (Sat, 03 Jan 2009) | 4 lines The _tkinter module functions "createfilehandler", "deletefilehandler", "createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated for removal in 3.x (part of issue #3638). ........ ................ r68237 | guilherme.polo | 2009-01-03 22:00:39 +0000 (Sat, 03 Jan 2009) | 3 lines Fix for issue #3638: Remove module level functions in _tkinter that depend on TkappObject ................ r68241 | georg.brandl | 2009-01-03 22:07:57 +0000 (Sat, 03 Jan 2009) | 2 lines Manually merge r68096,68189 from 3.0 branch. ................ r68242 | guilherme.polo | 2009-01-03 22:13:31 +0000 (Sat, 03 Jan 2009) | 2 lines Forgot to remove no longer needed code since r68237 ................ r68245 | georg.brandl | 2009-01-03 22:33:39 +0000 (Sat, 03 Jan 2009) | 49 lines Merged revisions 68112,68115,68120,68133,68141-68142,68145-68146,68148-68149 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line #4795 inspect.isgeneratorfunction() should return False instead of None ........ r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line simplfy code ........ r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines #4228: Pack negative values the same way as 2.4 in struct's L format. ........ r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line fill in actual issue number in tests ........ r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line fix highlighting ........ r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines welcome to 2009, Python! ........ r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. ........ r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4472: "configure --enable-shared doesn't work on OSX" ........ r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines Forgot to add a NEWS item in my previous checkin ........ r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4780 ........ ................ r68246 | georg.brandl | 2009-01-03 22:37:17 +0000 (Sat, 03 Jan 2009) | 32 lines Blocked revisions 68150,68156,68158-68161,68163 via svnmerge ........ r68150 | ronald.oussoren | 2009-01-02 12:46:05 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue 3433 ........ r68156 | ronald.oussoren | 2009-01-02 15:10:20 +0100 (Fri, 02 Jan 2009) | 1 line Fix for issue1594 ........ r68158 | ronald.oussoren | 2009-01-02 15:46:19 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 900949 ........ r68159 | ronald.oussoren | 2009-01-02 15:48:17 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue 1627952 ........ r68160 | ronald.oussoren | 2009-01-02 15:52:09 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue r1737832 ........ r68161 | ronald.oussoren | 2009-01-02 16:00:05 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 1149804 ........ r68163 | ronald.oussoren | 2009-01-02 16:25:36 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issues #841800 and #900506 ........ ................ r68247 | georg.brandl | 2009-01-03 22:47:39 +0000 (Sat, 03 Jan 2009) | 39 lines Merged revisions 68162,68166,68171,68176,68195-68196,68210,68232 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68162 | ronald.oussoren | 2009-01-02 16:06:00 +0100 (Fri, 02 Jan 2009) | 3 lines Fix for issue 4472 is incompatible with Cygwin, this patch should fix that. ........ r68166 | benjamin.peterson | 2009-01-02 19:26:23 +0100 (Fri, 02 Jan 2009) | 1 line document PyMemberDef ........ r68171 | georg.brandl | 2009-01-02 21:25:14 +0100 (Fri, 02 Jan 2009) | 3 lines #4811: fix markup glitches (mostly remains of the conversion), found by Gabriel Genellina. ........ r68176 | andrew.kuchling | 2009-01-02 22:00:35 +0100 (Fri, 02 Jan 2009) | 1 line Add various items ........ r68195 | georg.brandl | 2009-01-03 14:45:15 +0100 (Sat, 03 Jan 2009) | 2 lines Remove useless string literal. ........ r68196 | georg.brandl | 2009-01-03 15:29:53 +0100 (Sat, 03 Jan 2009) | 2 lines Fix indentation. ........ r68210 | georg.brandl | 2009-01-03 20:10:12 +0100 (Sat, 03 Jan 2009) | 2 lines Set eol-style correctly for mp_distributing.py. ........ r68232 | georg.brandl | 2009-01-03 22:52:16 +0100 (Sat, 03 Jan 2009) | 2 lines Grammar fix. ........ ................ r68248 | georg.brandl | 2009-01-03 22:48:18 +0000 (Sat, 03 Jan 2009) | 24 lines Blocked revisions 68179,68208-68209,68238,68240 via svnmerge ........ r68179 | raymond.hettinger | 2009-01-02 22:26:45 +0100 (Fri, 02 Jan 2009) | 1 line Issue #4615. Document how to use itertools for de-duping. ........ r68208 | raymond.hettinger | 2009-01-03 20:02:23 +0100 (Sat, 03 Jan 2009) | 1 line Issue 4796: Add from_float methods to the decimal module. ........ r68209 | raymond.hettinger | 2009-01-03 20:08:10 +0100 (Sat, 03 Jan 2009) | 1 line Reapply r68191. ........ r68238 | georg.brandl | 2009-01-03 23:03:11 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r68095,68186,68187,68188,68190 from 2.6 branch. ........ r68240 | georg.brandl | 2009-01-03 23:05:22 +0100 (Sat, 03 Jan 2009) | 2 lines Manually merge r67868 from 2.6 branch. ........ ................ r68249 | antoine.pitrou | 2009-01-03 22:55:38 +0000 (Sat, 03 Jan 2009) | 3 lines test_urllib would set environment variable NO_PROXY without removing it afterwards. ................ r68285 | georg.brandl | 2009-01-04 00:28:14 +0000 (Sun, 04 Jan 2009) | 2 lines Remove 2.6 versionchanges, turn 2.7 ones into 3.1. ................ r68300 | mark.dickinson | 2009-01-04 15:09:02 +0000 (Sun, 04 Jan 2009) | 19 lines Merged revisions 68296,68299 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68296 | mark.dickinson | 2009-01-04 12:29:36 +0000 (Sun, 04 Jan 2009) | 6 lines Add autoconf test to detect x87-style double rounding, as described in issue #2937. This information can be helpful for diagnosing platform- specific problems in math and cmath. The result of the test also serves as a fairly reliable indicator of whether the x87 floating-point instructions (as opposed to SSE2) are in use on Intel x86/x86_64 systems. ........ r68299 | mark.dickinson | 2009-01-04 13:57:26 +0000 (Sun, 04 Jan 2009) | 4 lines isinf and isnan are macros, not functions; fix configure script to use AC_CHECK_DECLS instead of AC_CHECK_FUNCS for these. (See discussion in issue #4506) ........ ................ r68301 | benjamin.peterson | 2009-01-04 15:30:39 +0000 (Sun, 04 Jan 2009) | 1 line #4826 exec() doesn't take a file object anymore ................ r68303 | mark.dickinson | 2009-01-04 16:41:08 +0000 (Sun, 04 Jan 2009) | 11 lines Merged revisions 68302 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68302 | mark.dickinson | 2009-01-04 16:06:40 +0000 (Sun, 04 Jan 2009) | 4 lines Oops. Need to check not only that HAVE_DECL_ISINF is defined, but also that it's equal to 1. (If isinf isn't defined, HAVE_DECL_ISINF is defined to be 0, rather than being undefined.) ........ ................ r68305 | mark.dickinson | 2009-01-04 17:02:56 +0000 (Sun, 04 Jan 2009) | 9 lines Merged revisions 68304 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68304 | mark.dickinson | 2009-01-04 17:02:05 +0000 (Sun, 04 Jan 2009) | 2 lines Fix HAVE_DECL_ISINF/ISNAN test (again). ........ ................ r68309 | benjamin.peterson | 2009-01-04 18:53:28 +0000 (Sun, 04 Jan 2009) | 1 line fix a lot of Tkinter imports ................ r68315 | antoine.pitrou | 2009-01-04 21:11:10 +0000 (Sun, 04 Jan 2009) | 3 lines Buglet: restore functioning of gzip as an executable when (de)compressing from stdin to stdout ................ r68316 | mark.dickinson | 2009-01-04 21:17:43 +0000 (Sun, 04 Jan 2009) | 12 lines Merged revisions 68314 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68314 | mark.dickinson | 2009-01-04 21:10:56 +0000 (Sun, 04 Jan 2009) | 5 lines Fix Decimal.from_float to use valid Python 2.3 syntax, as per comments at top of decimal.py. (But note that the from_float method itself with still not be usable before Python 2.7.) See issue 4796 for discussion. ........ ................ r68321 | mark.dickinson | 2009-01-04 21:34:18 +0000 (Sun, 04 Jan 2009) | 13 lines Merged revisions 68317-68318 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68317 | mark.dickinson | 2009-01-04 21:22:02 +0000 (Sun, 04 Jan 2009) | 2 lines More Python 2.3 compatibility fixes for decimal.py. ........ r68318 | mark.dickinson | 2009-01-04 21:25:40 +0000 (Sun, 04 Jan 2009) | 2 lines Misc/NEWS entry for r68317 ........ ................ r68323 | antoine.pitrou | 2009-01-04 21:37:59 +0000 (Sun, 04 Jan 2009) | 9 lines Merged revisions 68319 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68319 | antoine.pitrou | 2009-01-04 22:29:23 +0100 (dim., 04 janv. 2009) | 3 lines Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. ........ ................ r68327 | georg.brandl | 2009-01-04 23:20:14 +0000 (Sun, 04 Jan 2009) | 1 line #4614: document PyModule_Create and PyModuleDef struct. ................ r68341 | mark.dickinson | 2009-01-05 17:08:27 +0000 (Mon, 05 Jan 2009) | 9 lines Merged revisions 68311 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68311 | mark.dickinson | 2009-01-04 19:53:00 +0000 (Sun, 04 Jan 2009) | 2 lines Use C99 'isfinite' macro in preference to BSD-derived 'finite' function. ........ ................ r68342 | mark.dickinson | 2009-01-05 17:10:09 +0000 (Mon, 05 Jan 2009) | 11 lines Merged revisions 68312 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68312 | mark.dickinson | 2009-01-04 20:19:41 +0000 (Sun, 04 Jan 2009) | 4 lines It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any Python/hypot.c replacement file. Use AC_CHECK_FUNCS instead. This change should be backported to 2.6 and 3.0. ........ ................ r68359 | raymond.hettinger | 2009-01-06 09:37:13 +0000 (Tue, 06 Jan 2009) | 1 line Mini-optimization: use pack/unpack functions for argument tuples. ................ r68363 | antoine.pitrou | 2009-01-06 19:02:24 +0000 (Tue, 06 Jan 2009) | 17 lines Merged revisions 68360-68361 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68360 | antoine.pitrou | 2009-01-06 19:10:47 +0100 (mar., 06 janv. 2009) | 7 lines Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. ........ r68361 | antoine.pitrou | 2009-01-06 19:34:08 +0100 (mar., 06 janv. 2009) | 3 lines Use shutil.rmtree rather than os.rmdir. ........ ................ r68375 | hirokazu.yamamoto | 2009-01-07 10:11:17 +0000 (Wed, 07 Jan 2009) | 10 lines Merged revisions 68373 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68373 | hirokazu.yamamoto | 2009-01-07 18:42:28 +0900 | 2 lines Issue #4864: test_msvc9compiler failed on VC6/7. Reviewed by Amaury Forgeot d'Arc. ........ ................ r68379 | mark.dickinson | 2009-01-07 17:54:07 +0000 (Wed, 07 Jan 2009) | 9 lines Merged revisions 68378 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68378 | mark.dickinson | 2009-01-07 17:48:33 +0000 (Wed, 07 Jan 2009) | 2 lines Issue #4869: clarify documentation for random.expovariate. ........ ................ r68401 | thomas.heller | 2009-01-08 09:34:20 +0000 (Thu, 08 Jan 2009) | 2 lines Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false. Fixes issue #4867. ................ r68409 | raymond.hettinger | 2009-01-08 21:01:54 +0000 (Thu, 08 Jan 2009) | 1 line Merge in r68394 fixing itertools.permutations() and combinations(). ................ r68411 | antoine.pitrou | 2009-01-08 21:17:16 +0000 (Thu, 08 Jan 2009) | 5 lines Issue #4751: hashlib now releases the GIL when hashing large buffers (with a hardwired threshold of 2048 bytes), allowing better parallelization on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner. ................ r68417 | tarek.ziade | 2009-01-09 00:15:45 +0000 (Fri, 09 Jan 2009) | 9 lines Merged revisions 68415 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line fixed #4394 make the storage of the password optional in .pypirc ........ ................ r68427 | benjamin.peterson | 2009-01-09 03:03:23 +0000 (Fri, 09 Jan 2009) | 74 lines Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line only check the actual compile() call for a SyntaxError ................ r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines Test commit. ................ r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. ................ r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines Fix two issues found by the suspicious builder. ................ r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line use Jinja 2.1.1 ................ r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines Update make.bat. ................ r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line Make sure to checkout any new packages ................ r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line string exceptions are gone ................ r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line use new sphinx modules ................ r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ ................ ................ r68433 | benjamin.peterson | 2009-01-09 03:16:55 +0000 (Fri, 09 Jan 2009) | 24 lines Blocked revisions 68424-68426,68429-68430 via svnmerge ........ r68424 | benjamin.peterson | 2009-01-08 20:53:35 -0600 (Thu, 08 Jan 2009) | 1 line specify what -3 warnings are about ........ r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line fix markup ........ r68426 | benjamin.peterson | 2009-01-08 21:03:05 -0600 (Thu, 08 Jan 2009) | 1 line fix spelling ........ r68429 | benjamin.peterson | 2009-01-08 21:05:14 -0600 (Thu, 08 Jan 2009) | 1 line add -3 to manpage ........ r68430 | benjamin.peterson | 2009-01-08 21:07:27 -0600 (Thu, 08 Jan 2009) | 1 line be more specific in -3 option help ........ ................ r68434 | benjamin.peterson | 2009-01-09 03:24:29 +0000 (Fri, 09 Jan 2009) | 16 lines Blocked revisions 68243,68395,68432 via svnmerge ........ r68243 | georg.brandl | 2009-01-03 16:15:42 -0600 (Sat, 03 Jan 2009) | 2 lines Add temporary code to fix the automatic doc build failure. ........ r68395 | raymond.hettinger | 2009-01-08 00:39:04 -0600 (Thu, 08 Jan 2009) | 1 line Forward port r68394 for issue 4816. ........ r68432 | benjamin.peterson | 2009-01-08 21:15:00 -0600 (Thu, 08 Jan 2009) | 1 line remove temporary code now ........ ................ r68436 | benjamin.peterson | 2009-01-09 03:42:38 +0000 (Fri, 09 Jan 2009) | 10 lines Merged revisions 67985 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67985 | antoine.pitrou | 2008-12-28 10:01:11 -0600 (Sun, 28 Dec 2008) | 4 lines Issue #2153: modernize coding style of unittest.py, remove obsolete compatibility stuff. Patch by Virgil Dupras. ........ ................ r68438 | raymond.hettinger | 2009-01-09 03:58:09 +0000 (Fri, 09 Jan 2009) | 1 line Reduce the size of the _PyLong_DigitValue table. ................ r68440 | benjamin.peterson | 2009-01-09 04:11:44 +0000 (Fri, 09 Jan 2009) | 30 lines Merged revisions 68167,68276,68292-68293,68344 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68167 | vinay.sajip | 2009-01-02 12:53:04 -0600 (Fri, 02 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ........ r68276 | tarek.ziade | 2009-01-03 18:04:49 -0600 (Sat, 03 Jan 2009) | 1 line fixed #1702551: distutils sdist was not pruning VCS directories under win32 ........ r68292 | skip.montanaro | 2009-01-04 04:36:58 -0600 (Sun, 04 Jan 2009) | 3 lines If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". ........ r68293 | tarek.ziade | 2009-01-04 04:37:52 -0600 (Sun, 04 Jan 2009) | 1 line using clearer syntax ........ r68344 | marc-andre.lemburg | 2009-01-05 13:43:35 -0600 (Mon, 05 Jan 2009) | 7 lines Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. ........ ................ r68443 | hirokazu.yamamoto | 2009-01-09 04:41:03 +0000 (Fri, 09 Jan 2009) | 9 lines Merged revisions 68435 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68435 | hirokazu.yamamoto | 2009-01-09 12:32:46 +0900 | 1 line Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5) ........ ................ r68445 | hirokazu.yamamoto | 2009-01-09 04:48:19 +0000 (Fri, 09 Jan 2009) | 8 lines Blocked revisions 68439 via svnmerge ........ r68439 | hirokazu.yamamoto | 2009-01-09 13:10:40 +0900 | 1 line Bump up bsddb version on VC6. (db-4.4.20 -> db-4.7.25) ........ ................ r68451 | antoine.pitrou | 2009-01-09 18:53:14 +0000 (Fri, 09 Jan 2009) | 6 lines Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being to buffer arbitrary chunks of data). Patch by Victor Stinner, test by me. ................ r68453 | antoine.pitrou | 2009-01-09 19:29:16 +0000 (Fri, 09 Jan 2009) | 3 lines Buglet: fix unittest.main() ................ r68454 | antoine.pitrou | 2009-01-09 19:54:29 +0000 (Fri, 09 Jan 2009) | 5 lines Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. ................ r68463 | antoine.pitrou | 2009-01-09 22:12:30 +0000 (Fri, 09 Jan 2009) | 4 lines Fix bug introduced in r68451: stdio must always be opened in line-buffered mode if isatty() is true. ................ r68465 | antoine.pitrou | 2009-01-09 22:27:08 +0000 (Fri, 09 Jan 2009) | 12 lines Merged revisions 68462 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68462 | antoine.pitrou | 2009-01-09 22:40:55 +0100 (ven., 09 janv. 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. ........ ................ r68467 | benjamin.peterson | 2009-01-10 04:11:21 +0000 (Sat, 10 Jan 2009) | 8 lines Unblocked revisions 68425 via svnmerge ........ r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line fix markup ........ ................ r68474 | hirokazu.yamamoto | 2009-01-10 11:48:27 +0000 (Sat, 10 Jan 2009) | 17 lines Merged revisions 68468-68470 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68468 | hirokazu.yamamoto | 2009-01-10 17:09:43 +0900 | 1 line Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3) ........ r68469 | hirokazu.yamamoto | 2009-01-10 17:12:09 +0900 | 1 line Link to debug version of Tcl/Tk when python is built as debug version. ........ r68470 | hirokazu.yamamoto | 2009-01-10 18:18:16 +0900 | 1 line Added helper script to build Tcl/Tk. ........ ................ r68475 | hirokazu.yamamoto | 2009-01-10 11:55:57 +0000 (Sat, 10 Jan 2009) | 1 line Commit miss. ................ r68477 | hirokazu.yamamoto | 2009-01-10 12:15:23 +0000 (Sat, 10 Jan 2009) | 1 line Fixed 2to3 issue on tix module. ................ r68479 | vinay.sajip | 2009-01-10 13:37:26 +0000 (Sat, 10 Jan 2009) | 1 line Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser. ................ r68482 | vinay.sajip | 2009-01-10 13:42:23 +0000 (Sat, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ................ r68483 | antoine.pitrou | 2009-01-10 15:40:25 +0000 (Sat, 10 Jan 2009) | 8 lines Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The common cases are optimized thanks to a dedicated fast path and a moderate amount of loop unrolling. This will especially help text I/O (we already register a 30% speedup on large reads on the io-c branch). ................ r68486 | antoine.pitrou | 2009-01-10 16:22:51 +0000 (Sat, 10 Jan 2009) | 13 lines Merged revisions 68484-68485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68484 | antoine.pitrou | 2009-01-10 17:13:45 +0100 (sam., 10 janv. 2009) | 3 lines Issue #3860: GzipFile and BZ2File now support the context manager protocol. ........ r68485 | antoine.pitrou | 2009-01-10 17:15:24 +0100 (sam., 10 janv. 2009) | 1 line Add NEWS entry for r68484. ........ ................ r68488 | benjamin.peterson | 2009-01-10 17:05:44 +0000 (Sat, 10 Jan 2009) | 1 line fix typo #4904 ................ r68489 | matthias.klose | 2009-01-10 17:08:25 +0000 (Sat, 10 Jan 2009) | 5 lines Merge r68487 from svn+ssh://pythondev at svn.python.org/python/trunk: - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. ................ r68491 | benjamin.peterson | 2009-01-10 17:14:04 +0000 (Sat, 10 Jan 2009) | 9 lines Blocked revisions 68487 via svnmerge ........ r68487 | matthias.klose | 2009-01-10 11:00:42 -0600 (Sat, 10 Jan 2009) | 3 lines - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. ........ ................ r68497 | antoine.pitrou | 2009-01-10 18:38:45 +0000 (Sat, 10 Jan 2009) | 9 lines Merged revisions 68496 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68496 | antoine.pitrou | 2009-01-10 19:33:21 +0100 (sam., 10 janv. 2009) | 3 lines Add ACKS entries for some of the patches I've been committing. ........ ................ r68500 | mark.dickinson | 2009-01-10 19:16:40 +0000 (Sat, 10 Jan 2009) | 9 lines Merged revisions 68499 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68499 | mark.dickinson | 2009-01-10 19:14:55 +0000 (Sat, 10 Jan 2009) | 2 lines Remove an unnecessary check from test_decimal. ........ ................ r68502 | vinay.sajip | 2009-01-10 19:23:34 +0000 (Sat, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ................ r68508 | mark.dickinson | 2009-01-10 22:14:33 +0000 (Sat, 10 Jan 2009) | 3 lines Issue #4910: replace "long" with "int" in docstring for __long__ slot and in documentation for PyNumber_Long. ................ r68511 | benjamin.peterson | 2009-01-10 22:37:11 +0000 (Sat, 10 Jan 2009) | 1 line fix syntax in ctypes.util ................ r68516 | benjamin.peterson | 2009-01-10 23:49:20 +0000 (Sat, 10 Jan 2009) | 1 line ricos isn't supported ................ r68525 | martin.v.loewis | 2009-01-11 09:30:50 +0000 (Sun, 11 Jan 2009) | 9 lines Merged revisions 68523 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68523 | martin.v.loewis | 2009-01-11 10:26:54 +0100 (So, 11 Jan 2009) | 2 lines Issue #4279: Fix build of parsermodule under Cygwin. ........ ................ r68528 | martin.v.loewis | 2009-01-11 09:45:11 +0000 (Sun, 11 Jan 2009) | 9 lines Merged revisions 68527 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68527 | martin.v.loewis | 2009-01-11 10:43:55 +0100 (So, 11 Jan 2009) | 2 lines Issue #4895: Use _strdup on Windows CE. ........ ................ r68529 | mark.dickinson | 2009-01-11 11:54:02 +0000 (Sun, 11 Jan 2009) | 2 lines Remove __long__ methods from UserString and from Demo/ classes. ................ r68533 | benjamin.peterson | 2009-01-11 17:13:55 +0000 (Sun, 11 Jan 2009) | 9 lines Merged revisions 68381 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68381 | martin.v.loewis | 2009-01-07 12:40:40 -0600 (Wed, 07 Jan 2009) | 2 lines Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. ........ ................ r68537 | antoine.pitrou | 2009-01-11 23:56:55 +0000 (Sun, 11 Jan 2009) | 3 lines Issue #4916: fix little-endian UTF-16 decoding bug on big-endian UCS-4 builds, introduced by r68483. ................ r68538 | benjamin.peterson | 2009-01-12 00:28:16 +0000 (Mon, 12 Jan 2009) | 1 line remove docs for PyBytes_Format #4917 ................ r68539 | gregory.p.smith | 2009-01-12 04:50:11 +0000 (Mon, 12 Jan 2009) | 6 lines Fixes issue #3826 and #4791: Have SocketIO objects update their reference count in the underlying socket object on close() so that the underlying socket object is closed immediately when the last user is done rather than at an unknown later time when garbage collection can do it. ................ r68541 | martin.v.loewis | 2009-01-12 07:59:10 +0000 (Mon, 12 Jan 2009) | 9 lines Merged revisions 68540 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68540 | martin.v.loewis | 2009-01-12 08:57:11 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4915: Port sysmodule to Windows CE. ........ ................ r68543 | martin.v.loewis | 2009-01-12 08:21:03 +0000 (Mon, 12 Jan 2009) | 17 lines Merged revisions 68455,68476,68542 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68455 | kristjan.jonsson | 2009-01-09 21:03:27 +0100 (Fr, 09 Jan 2009) | 1 line Issue 3582. Improved thread support and TLS for Windows ........ r68476 | kristjan.jonsson | 2009-01-10 13:14:31 +0100 (Sa, 10 Jan 2009) | 1 line Issue 4906: Preserve windows error state across PyThread_get_key_value ........ r68542 | martin.v.loewis | 2009-01-12 09:11:24 +0100 (Mo, 12 Jan 2009) | 2 lines Issue #4893: Use NT threading on CE. ........ ................ r68553 | mark.dickinson | 2009-01-12 20:49:19 +0000 (Mon, 12 Jan 2009) | 8 lines Issue #4910 (1st patch of a series): fix int() and the corresponding PyNumber_Int/PyNumber_Long API function so that it no longer attempts to call the __long__ method for conversion. Only the __int__ and __trunc__ methods are used. (This removes a major remaining use of the nb_long slot from the Python 3.x core.) Thanks Benjamin for review. ................ r68561 | amaury.forgeotdarc | 2009-01-12 23:58:21 +0000 (Mon, 12 Jan 2009) | 13 lines Merged revisions 68560 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (mar., 13 janv. 2009) | 6 lines #3720: Interpreter crashes when an evil iterator removes its own next function. Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0. ........ ................ r68564 | benjamin.peterson | 2009-01-13 02:11:23 +0000 (Tue, 13 Jan 2009) | 18 lines Merged revisions 68425,68461,68498 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line fix markup ........ r68461 | kristjan.jonsson | 2009-01-09 15:35:16 -0600 (Fri, 09 Jan 2009) | 2 lines Issue 4293: Make Py_AddPendingCall() thread safe Add test cases and documentation ........ r68498 | benjamin.peterson | 2009-01-10 13:08:49 -0600 (Sat, 10 Jan 2009) | 1 line fix encoding ........ ................ r68581 | benjamin.peterson | 2009-01-13 21:53:28 +0000 (Tue, 13 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib headers #4936 ................ r68585 | benjamin.peterson | 2009-01-13 22:25:18 +0000 (Tue, 13 Jan 2009) | 1 line de-spacify ................ r68586 | benjamin.peterson | 2009-01-13 22:33:14 +0000 (Tue, 13 Jan 2009) | 16 lines Blocked revisions 68579-68580,68584 via svnmerge ........ r68579 | benjamin.peterson | 2009-01-13 15:42:23 -0600 (Tue, 13 Jan 2009) | 1 line make bytearrayobject.o depend on the stringlib #4936 ........ r68580 | benjamin.peterson | 2009-01-13 15:43:11 -0600 (Tue, 13 Jan 2009) | 1 line add bytearrayobject.h to PYTHON_HEADERS ........ r68584 | benjamin.peterson | 2009-01-13 16:22:41 -0600 (Tue, 13 Jan 2009) | 1 line de-spacify ........ ................ r68587 | antoine.pitrou | 2009-01-13 22:59:11 +0000 (Tue, 13 Jan 2009) | 7 lines 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. (*) or at least it is our interpretation ................ r68590 | benjamin.peterson | 2009-01-13 23:14:04 +0000 (Tue, 13 Jan 2009) | 1 line encoding returns bytes objects ................ r68591 | antoine.pitrou | 2009-01-13 23:14:47 +0000 (Tue, 13 Jan 2009) | 10 lines Blocked revisions 68589 via svnmerge ........ r68589 | antoine.pitrou | 2009-01-14 00:13:52 +0100 (mer., 14 janv. 2009) | 5 lines 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. ........ ................ r68593 | amaury.forgeotdarc | 2009-01-13 23:21:11 +0000 (Tue, 13 Jan 2009) | 11 lines Blocked revisions 68592 via svnmerge ........ r68592 | amaury.forgeotdarc | 2009-01-14 00:19:08 +0100 (mer., 14 janv. 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. ........ ................ r68606 | raymond.hettinger | 2009-01-14 02:20:07 +0000 (Wed, 14 Jan 2009) | 5 lines Issue #1696199: Add collections.Counter(). Forward port from Py2.7. ................ r68615 | mark.dickinson | 2009-01-15 15:36:10 +0000 (Thu, 15 Jan 2009) | 17 lines Merged revisions 68611-68613 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68611 | mark.dickinson | 2009-01-15 14:54:37 +0000 (Thu, 15 Jan 2009) | 2 lines Issue #4397. Fix occasional test_socket failure on OS X. ........ r68612 | mark.dickinson | 2009-01-15 14:58:28 +0000 (Thu, 15 Jan 2009) | 2 lines Comment typo ........ r68613 | mark.dickinson | 2009-01-15 15:17:43 +0000 (Thu, 15 Jan 2009) | 2 lines Another typo fix. ........ ................ r68619 | mark.dickinson | 2009-01-15 19:32:23 +0000 (Thu, 15 Jan 2009) | 8 lines Issue 4910, patch 2 of (probably) 3: pave the way for renaming of nb_long: remove last remaining use of nb_long (in the struct module) from the core, set nb_long slots on all builtin and extension types to 0, and remove uses of __long__ in test_complex and test_binop. Reviewed by Benjamin Peterson. ................ r68629 | benjamin.peterson | 2009-01-16 03:06:57 +0000 (Fri, 16 Jan 2009) | 1 line remove duplicate definition of PyExc_BufferError #4950 ................ r68630 | benjamin.peterson | 2009-01-16 03:54:08 +0000 (Fri, 16 Jan 2009) | 108 lines Merged revisions 68450,68480-68481,68493,68495,68501,68512,68514-68515,68534-68536,68552,68563,68570-68572,68575,68582,68596,68623-68624,68628 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68450 | jeffrey.yasskin | 2009-01-09 10:47:07 -0600 (Fri, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68480 | vinay.sajip | 2009-01-10 07:38:04 -0600 (Sat, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 07:42:04 -0600 (Sat, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 11:18:55 -0600 (Sat, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 11:36:44 -0600 (Sat, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68501 | vinay.sajip | 2009-01-10 13:22:57 -0600 (Sat, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 16:42:10 -0600 (Sat, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-10 17:41:59 -0600 (Sat, 10 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-10 17:49:08 -0600 (Sat, 10 Jan 2009) | 1 line macos 9 isn't supported ........ r68534 | gregory.p.smith | 2009-01-11 11:53:33 -0600 (Sun, 11 Jan 2009) | 2 lines correct email address ........ r68535 | gregory.p.smith | 2009-01-11 11:57:54 -0600 (Sun, 11 Jan 2009) | 9 lines Update the documentation for binascii and zlib crc32/adler32 functions to better describe the signed vs unsigned return value behavior on different platforms and versions of python. Mention the workaround to make them all return the same thing by using & 0xffffffff. Fixes issue4903. Also needs to be merged into release26-maint, release30-maint, & py3k. ........ r68536 | benjamin.peterson | 2009-01-11 13:48:15 -0600 (Sun, 11 Jan 2009) | 1 line add email addresses ........ r68552 | vinay.sajip | 2009-01-12 14:36:18 -0600 (Mon, 12 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68563 | benjamin.peterson | 2009-01-12 19:49:10 -0600 (Mon, 12 Jan 2009) | 1 line small logic correction ........ r68570 | raymond.hettinger | 2009-01-13 03:08:32 -0600 (Tue, 13 Jan 2009) | 5 lines Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard(). Needs to be backported to 2.6 and forward ported to 3.0 and 3.1. ........ r68571 | armin.ronacher | 2009-01-13 05:52:23 -0600 (Tue, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ........ r68572 | andrew.kuchling | 2009-01-13 07:40:54 -0600 (Tue, 13 Jan 2009) | 1 line Note that first coord. is left alone ........ r68575 | thomas.heller | 2009-01-13 11:32:28 -0600 (Tue, 13 Jan 2009) | 1 line Fix refcount leak in error cases. Bug found by coverity. ........ r68582 | georg.brandl | 2009-01-13 16:14:01 -0600 (Tue, 13 Jan 2009) | 2 lines Use assertRaises. ........ r68596 | amaury.forgeotdarc | 2009-01-13 17:39:22 -0600 (Tue, 13 Jan 2009) | 3 lines #1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set. ........ r68623 | vinay.sajip | 2009-01-15 16:48:13 -0600 (Thu, 15 Jan 2009) | 1 line Made minor changes/corrections in markup. Added a couple of section headings. ........ r68624 | vinay.sajip | 2009-01-15 17:04:47 -0600 (Thu, 15 Jan 2009) | 1 line Minor changes/corrections in markup. ........ r68628 | benjamin.peterson | 2009-01-15 20:55:24 -0600 (Thu, 15 Jan 2009) | 1 line compare with == not is #4946 ........ ................ r68638 | mark.dickinson | 2009-01-16 19:31:13 +0000 (Fri, 16 Jan 2009) | 3 lines Define PY_SSIZE_T_CLEAN at the top of the dbm module. This should fix the segfaults on the PPC64/Debian buildbots. ................ r68643 | antoine.pitrou | 2009-01-17 02:40:13 +0000 (Sat, 17 Jan 2009) | 3 lines Make test_io faster ................ r68647 | benjamin.peterson | 2009-01-17 04:15:01 +0000 (Sat, 17 Jan 2009) | 1 line fix inspect.formatargspec on functions with keyword-only arguments without defaults #4959 ................ r68650 | mark.dickinson | 2009-01-17 09:45:37 +0000 (Sat, 17 Jan 2009) | 2 lines Remove a couple of references to long in the c-api docs ................ r68651 | mark.dickinson | 2009-01-17 10:04:45 +0000 (Sat, 17 Jan 2009) | 2 lines Issue #4910, patch 3/3: rename nb_long to nb_reserved ................ r68652 | mark.dickinson | 2009-01-17 10:21:23 +0000 (Sat, 17 Jan 2009) | 2 lines Fix a few more references to long integers in the docs. ................ r68653 | mark.dickinson | 2009-01-17 10:48:28 +0000 (Sat, 17 Jan 2009) | 2 lines Remove attempted long->int conversions in py3k version of float.as_integer_ratio. ................ r68662 | amaury.forgeotdarc | 2009-01-17 16:42:26 +0000 (Sat, 17 Jan 2009) | 12 lines Merged revisions 68661 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68661 | amaury.forgeotdarc | 2009-01-17 17:40:17 +0100 (Sat, 17 Jan 2009) | 5 lines #3997: zipfiles generated with more than 65536 files could not be opened with other applications. Reviewed by Martin, will backport to 2.6 and 3.0 ........ ................ r68669 | antoine.pitrou | 2009-01-17 21:06:43 +0000 (Sat, 17 Jan 2009) | 3 lines Issue #4838: When a module is deallocated, free the memory backing the optional module state data. ................ r68675 | mark.dickinson | 2009-01-17 21:57:11 +0000 (Sat, 17 Jan 2009) | 2 lines Replace PyNumber_Int with PyNumber_Long. ................ r68677 | benjamin.peterson | 2009-01-17 22:41:18 +0000 (Sat, 17 Jan 2009) | 9 lines Merged revisions 68676 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68676 | benjamin.peterson | 2009-01-17 16:27:54 -0600 (Sat, 17 Jan 2009) | 1 line fix inspect.isclass() on instances with a custom __getattr__ #1225107 ........ ................ r68686 | benjamin.peterson | 2009-01-17 23:28:17 +0000 (Sat, 17 Jan 2009) | 50 lines I'm just going to assume that all of these revisions don't need to be merge, since it's not indicated: Blocked revisions 68559,68562,68565-68567,68569,68603-68605 via svnmerge ........ r68559 | raymond.hettinger | 2009-01-12 16:58:41 -0600 (Mon, 12 Jan 2009) | 1 line Issue 1696199: Add collections.Counter(). ........ r68562 | raymond.hettinger | 2009-01-12 19:05:03 -0600 (Mon, 12 Jan 2009) | 7 lines Simplify Counter() API. Replace items keyword argument with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work. ........ r68565 | raymond.hettinger | 2009-01-12 21:49:43 -0600 (Mon, 12 Jan 2009) | 1 line Minor documentation tweaks and simpler update() example. ........ r68566 | raymond.hettinger | 2009-01-12 22:13:53 -0600 (Mon, 12 Jan 2009) | 1 line Fixup and simplify docstrings and doctests. ........ r68567 | raymond.hettinger | 2009-01-12 22:50:35 -0600 (Mon, 12 Jan 2009) | 1 line Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport. ........ r68569 | raymond.hettinger | 2009-01-13 02:38:14 -0600 (Tue, 13 Jan 2009) | 7 lines Add table of idioms/patterns for using Counter objects. Improve the appearance and flow of the References section -- it used to have a box around it that wasn't distinct from the preceding code boxes and it had a weird bolding pattern and hanging indents that made the section disproportionately large. ........ r68603 | raymond.hettinger | 2009-01-13 18:15:21 -0600 (Tue, 13 Jan 2009) | 1 line Minor doc tweaks. ........ r68604 | raymond.hettinger | 2009-01-13 19:15:06 -0600 (Tue, 13 Jan 2009) | 1 line Add tests for __init__() and update() with no args. ........ r68605 | raymond.hettinger | 2009-01-13 19:39:51 -0600 (Tue, 13 Jan 2009) | 1 line Fix-up indentation of sample code blocks for namedtuple mthod definitions. ........ ................ r68690 | benjamin.peterson | 2009-01-17 23:43:58 +0000 (Sat, 17 Jan 2009) | 9 lines Merged revisions 68460 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68460 | kristjan.jonsson | 2009-01-09 14:31:26 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4293: Make Py_AddPendingCall() thread safe ........ ................ r68691 | benjamin.peterson | 2009-01-17 23:46:54 +0000 (Sat, 17 Jan 2009) | 1 line fix compiler warning ................ r68695 | benjamin.peterson | 2009-01-18 00:04:57 +0000 (Sun, 18 Jan 2009) | 9 lines Merged revisions 68458 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68458 | kristjan.jonsson | 2009-01-09 14:23:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks. ........ ................ r68696 | benjamin.peterson | 2009-01-18 00:08:45 +0000 (Sun, 18 Jan 2009) | 9 lines Merged revisions 68459 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68459 | kristjan.jonsson | 2009-01-09 14:27:16 -0600 (Fri, 09 Jan 2009) | 1 line Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required. ........ ................ r68698 | brett.cannon | 2009-01-18 00:24:28 +0000 (Sun, 18 Jan 2009) | 6 lines Add initial implementation of importlib. See the NOTES files for what is planned for the package. There are no docs yet, but they are coming once the API for the first new function, importlib.import_module() is finalized. ................ r68700 | amaury.forgeotdarc | 2009-01-18 00:29:02 +0000 (Sun, 18 Jan 2009) | 10 lines Merged revisions 68678 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68678 | amaury.forgeotdarc | 2009-01-17 23:43:50 +0100 (Sat, 17 Jan 2009) | 3 lines follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format, always try to read the "zip64 end of directory structure". ........ ................ r68701 | brett.cannon | 2009-01-18 00:36:22 +0000 (Sun, 18 Jan 2009) | 2 lines Skip over any file or folder that starts with a dot (e.g. .svn). ................ r68702 | brett.cannon | 2009-01-18 00:36:55 +0000 (Sun, 18 Jan 2009) | 2 lines NOTES for importlib should mention the ultimate end-goal for the package. ................ r68707 | benjamin.peterson | 2009-01-18 01:29:28 +0000 (Sun, 18 Jan 2009) | 8 lines Blocked revisions 68705 via svnmerge ........ r68705 | benjamin.peterson | 2009-01-17 19:28:09 -0600 (Sat, 17 Jan 2009) | 1 line bytearrays are mutable sequences ........ ................ r68709 | jesse.noller | 2009-01-18 03:11:38 +0000 (Sun, 18 Jan 2009) | 1 line Merge r68708 to py3k, fixes 4449 ................ r68712 | brett.cannon | 2009-01-18 06:55:05 +0000 (Sun, 18 Jan 2009) | 5 lines Tests of case-sensitivity were being executed on OSs which did not have a case-insensitive file system, leading to test failures. This was due to using the TestCase objects directly instead of the guard in the test_main() function. Move over to a class decorator instead to control if the tests should be run. ................ r68716 | georg.brandl | 2009-01-18 10:38:16 +0000 (Sun, 18 Jan 2009) | 1 line #4984: fix number of types. ................ r68717 | georg.brandl | 2009-01-18 10:40:25 +0000 (Sun, 18 Jan 2009) | 1 line #4983: clarify what "byte sequence" is. ................ r68719 | georg.brandl | 2009-01-18 10:43:58 +0000 (Sun, 18 Jan 2009) | 1 line #4975: fix bytes/str issue. ................ r68728 | jesse.noller | 2009-01-18 19:44:02 +0000 (Sun, 18 Jan 2009) | 1 line Issues #10867: remove old cPickle imports from multiprocessing ................ r68729 | jesse.noller | 2009-01-18 19:45:18 +0000 (Sun, 18 Jan 2009) | 1 line Correct issue number for 68728 checkin ................ r68730 | martin.v.loewis | 2009-01-18 20:15:42 +0000 (Sun, 18 Jan 2009) | 2 lines Issue #4008: Fix problems with non-ASCII source files. ................ r68732 | martin.v.loewis | 2009-01-18 20:23:36 +0000 (Sun, 18 Jan 2009) | 3 lines Issue #4815: Offer conversion to UTF-8 if source files have no encoding declaration and are not encoded in UTF-8. ................ r68736 | benjamin.peterson | 2009-01-18 21:02:37 +0000 (Sun, 18 Jan 2009) | 40 lines Merged revisions 68547,68607,68610,68618,68621-68622,68649,68722 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68547 | kristjan.jonsson | 2009-01-12 12:09:27 -0600 (Mon, 12 Jan 2009) | 1 line Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module. ........ r68607 | kristjan.jonsson | 2009-01-14 04:50:57 -0600 (Wed, 14 Jan 2009) | 2 lines Re-enable all tests for windows platforms. Also, explicitly connect to the IPV4 address. On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect. It would try connecting using AF_INET6 first and this would cause a delay of up to a second. ........ r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines Fix recently introduced test cases. For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash. For test_os, two cases were incorrect. ........ r68618 | kristjan.jonsson | 2009-01-15 11:20:21 -0600 (Thu, 15 Jan 2009) | 1 line Issue 4929: Handle socket errors when receiving ........ r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor. ........ r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line Make all the invalid fd tests for os subject to the function being available. ........ r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line trying to find some fpathconf() settings that all unixs support... ........ r68722 | kristjan.jonsson | 2009-01-18 04:58:44 -0600 (Sun, 18 Jan 2009) | 1 line issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16. ........ ................ r68740 | jesse.noller | 2009-01-18 21:12:58 +0000 (Sun, 18 Jan 2009) | 1 line merge cl r68737 to py3k ................ r68744 | benjamin.peterson | 2009-01-18 22:10:38 +0000 (Sun, 18 Jan 2009) | 14 lines Merged revisions 68568,68665 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68568 | georg.brandl | 2009-01-13 02:11:07 -0600 (Tue, 13 Jan 2009) | 2 lines Fix call signature and markup. ........ r68665 | amaury.forgeotdarc | 2009-01-17 11:11:50 -0600 (Sat, 17 Jan 2009) | 3 lines #4930: Slightly cleaner (and faster) code in type creation: compare slots by address, not by name. ........ ................ r68746 | benjamin.peterson | 2009-01-18 22:27:04 +0000 (Sun, 18 Jan 2009) | 55 lines Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines Change an example in the docs to avoid a mistake when the code is copy pasted and changed afterwards. ........ r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line use enumerate ........ r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h ........ r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line fix grammar ........ r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line #4976: union() and intersection() take multiple args, but talk about "the other". ........ r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line #4974: fix redundant mention of lists and tuples. ........ r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line #4914: trunc is in math. ........ r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line #4979: correct result range for some random functions. ........ r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line #4857: fix augmented assignment target spec. ........ r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line #4923: clarify what was added. ........ r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line #4986: augassigns are not expressions. ........ r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line fix test that wasn't working as expected #4990 ........ ................ r68749 | benjamin.peterson | 2009-01-18 22:46:33 +0000 (Sun, 18 Jan 2009) | 9 lines Merged revisions 68546 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68546 | raymond.hettinger | 2009-01-12 04:37:32 -0600 (Mon, 12 Jan 2009) | 1 line Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size. ........ ................ r68751 | benjamin.peterson | 2009-01-18 22:58:55 +0000 (Sun, 18 Jan 2009) | 16 lines Blocked revisions 68544-68545,68597 via svnmerge ........ r68544 | kristjan.jonsson | 2009-01-12 03:20:34 -0600 (Mon, 12 Jan 2009) | 1 line Update Misc/NEWS for issue 3582 ........ r68545 | kristjan.jonsson | 2009-01-12 03:24:04 -0600 (Mon, 12 Jan 2009) | 1 line Misc/NEWS for issue 4293 ........ r68597 | benjamin.peterson | 2009-01-13 17:43:50 -0600 (Tue, 13 Jan 2009) | 1 line fix test_xmlrpc failures #4939 ........ ................ r68761 | brett.cannon | 2009-01-19 06:56:16 +0000 (Mon, 19 Jan 2009) | 4 lines Fix a typo in some code that is not tested or supported yet. Closes issue 4993. Thanks Antoine Pitrou for the catch. ................ r68762 | brett.cannon | 2009-01-19 07:07:58 +0000 (Mon, 19 Jan 2009) | 2 lines Remove a debugging print statement that accidentally got left in. ................ r68767 | benjamin.peterson | 2009-01-19 15:11:51 +0000 (Mon, 19 Jan 2009) | 9 lines Merged revisions 68755 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68755 | benjamin.peterson | 2009-01-18 18:08:08 -0600 (Sun, 18 Jan 2009) | 1 line raise an OSError for invalid fds #4991 ........ ................ r68769 | benjamin.peterson | 2009-01-19 15:15:02 +0000 (Mon, 19 Jan 2009) | 1 line reenable the invalid fd test for fdopen ................ r68770 | benjamin.peterson | 2009-01-19 15:19:46 +0000 (Mon, 19 Jan 2009) | 1 line fix compiler warning ................ r68778 | jesse.noller | 2009-01-19 16:23:53 +0000 (Mon, 19 Jan 2009) | 1 line merge r68768 to py3k ................ r68780 | benjamin.peterson | 2009-01-19 17:53:36 +0000 (Mon, 19 Jan 2009) | 14 lines Merged revisions 68763,68773 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines Issue 4957 Let os.ftruncate raise OSError like documented. ........ r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line simplify code ........ ................ r68782 | benjamin.peterson | 2009-01-19 21:00:09 +0000 (Mon, 19 Jan 2009) | 9 lines Merged revisions 68779 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line make bad file descriptor tests more robust ........ ................ r68786 | benjamin.peterson | 2009-01-19 21:11:05 +0000 (Mon, 19 Jan 2009) | 8 lines Blocked revisions 68785 via svnmerge ........ r68785 | benjamin.peterson | 2009-01-19 15:08:37 -0600 (Mon, 19 Jan 2009) | 1 line I'm sick of these deprecations warnings in test_os ........ ................ r68788 | jesse.noller | 2009-01-20 00:23:01 +0000 (Tue, 20 Jan 2009) | 1 line merge r68787 to py3k ................ r68790 | brett.cannon | 2009-01-20 02:09:18 +0000 (Tue, 20 Jan 2009) | 2 lines Clarify how the specify the name of a module with the 'module' directive. ................ r68791 | brett.cannon | 2009-01-20 02:21:27 +0000 (Tue, 20 Jan 2009) | 3 lines Document the (very small) public API for importlib. As time goes on and some key refactorings occur more of the API will be exposed and documented. ................ r68794 | raymond.hettinger | 2009-01-20 03:41:22 +0000 (Tue, 20 Jan 2009) | 1 line Forward port r68792 and r68789 putting Counter in __all__ and adding Counter buildouts. ................ r68795 | benjamin.peterson | 2009-01-20 04:02:27 +0000 (Tue, 20 Jan 2009) | 15 lines Blocked revisions 68789,68792 via svnmerge ........ r68789 | raymond.hettinger | 2009-01-19 19:19:26 -0600 (Mon, 19 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-19 20:24:38 -0600 (Mon, 19 Jan 2009) | 1 line Add Counter() to __all__. ........ ................ r68798 | raymond.hettinger | 2009-01-20 07:15:22 +0000 (Tue, 20 Jan 2009) | 1 line Forward port r68797: Fix-up jump targets in collections docs. ................ r68799 | raymond.hettinger | 2009-01-20 07:24:44 +0000 (Tue, 20 Jan 2009) | 1 line Issue 4998: Decimal should not subclass or register with numbers.Real. ................ r68802 | antoine.pitrou | 2009-01-20 11:42:11 +0000 (Tue, 20 Jan 2009) | 3 lines Fix typo ................ r68804 | raymond.hettinger | 2009-01-20 13:00:59 +0000 (Tue, 20 Jan 2009) | 1 line Fix typos. ................ r68806 | benjamin.peterson | 2009-01-20 14:24:13 +0000 (Tue, 20 Jan 2009) | 12 lines Blocked revisions 68803,68805 via svnmerge ........ r68803 | raymond.hettinger | 2009-01-20 06:59:36 -0600 (Tue, 20 Jan 2009) | 1 line Fix typos. ........ r68805 | benjamin.peterson | 2009-01-20 08:21:16 -0600 (Tue, 20 Jan 2009) | 1 line allow unicode keyword arguments for the ** syntax #4978 ........ ................ r68808 | benjamin.peterson | 2009-01-20 14:33:15 +0000 (Tue, 20 Jan 2009) | 8 lines Blocked revisions 68807 via svnmerge ........ r68807 | benjamin.peterson | 2009-01-20 08:31:08 -0600 (Tue, 20 Jan 2009) | 1 line backport r68802 (bugfix) ........ ................ r68809 | benjamin.peterson | 2009-01-20 15:01:54 +0000 (Tue, 20 Jan 2009) | 22 lines Merged revisions 68797,68801 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68797 | raymond.hettinger | 2009-01-20 01:11:47 -0600 (Tue, 20 Jan 2009) | 11 lines Don't disrupt automatic url target name generation with manually specified, conflicting names. Before: http://docs.python.org/dev/library/collections.html#id1 After: http://docs.python.org/dev/library/collections.html#counter-objects ........ r68801 | raymond.hettinger | 2009-01-20 04:46:23 -0600 (Tue, 20 Jan 2009) | 5 lines Use Georg's new permalinks to documentation by version number. That assures that IDLE's help always points to the correct version and the latest update with all bug fixes. ........ ................ r68810 | benjamin.peterson | 2009-01-20 18:50:52 +0000 (Tue, 20 Jan 2009) | 14 lines Blocked revisions 68764,68766 via svnmerge ........ r68764 | benjamin.peterson | 2009-01-19 09:04:35 -0600 (Mon, 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 09:06:33 -0600 (Mon, 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 ........ ................ r68814 | mark.dickinson | 2009-01-20 20:43:58 +0000 (Tue, 20 Jan 2009) | 5 lines Issue #4842, patch 1/2: fix pickle in Python 3.x so that pickling with the 'L' opcode always appends an 'L' on output, just as 2.x does. When unpickling, remove the trailing 'L' (if present) before passing the result to PyLong_FromString. ................ r68815 | mark.dickinson | 2009-01-20 20:45:53 +0000 (Tue, 20 Jan 2009) | 2 lines Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x. ................ r68819 | raymond.hettinger | 2009-01-20 21:25:32 +0000 (Tue, 20 Jan 2009) | 1 line Revert part of r68799 which unintentionally updated this file. ................ r68832 | raymond.hettinger | 2009-01-20 23:44:31 +0000 (Tue, 20 Jan 2009) | 1 line Beautify and cleanup the references section. ................ r68833 | vinay.sajip | 2009-01-21 00:19:28 +0000 (Wed, 21 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. ................ r68836 | antoine.pitrou | 2009-01-21 00:55:13 +0000 (Wed, 21 Jan 2009) | 12 lines Merged revisions 68835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object. ........ ................ r68841 | jesse.noller | 2009-01-21 02:15:48 +0000 (Wed, 21 Jan 2009) | 1 line merge r68839 forward to py3k ................ r68844 | raymond.hettinger | 2009-01-21 20:36:27 +0000 (Wed, 21 Jan 2009) | 1 line Simplify explanation of multiset operations by removing restrictions on negative inputs. ................ r68846 | raymond.hettinger | 2009-01-21 23:14:07 +0000 (Wed, 21 Jan 2009) | 1 line Tighten-up the docs for Counter(). ................ r68847 | benjamin.peterson | 2009-01-22 02:24:32 +0000 (Thu, 22 Jan 2009) | 12 lines Blocked revisions 68843,68845 via svnmerge ........ r68843 | raymond.hettinger | 2009-01-21 14:31:50 -0600 (Wed, 21 Jan 2009) | 1 line Simplify explanation of multiset operations by removing restrictions on negative inputs. ........ r68845 | raymond.hettinger | 2009-01-21 17:12:51 -0600 (Wed, 21 Jan 2009) | 1 line Tighten-up the docs for Counter(). ........ ................ r68848 | benjamin.peterson | 2009-01-22 03:21:11 +0000 (Thu, 22 Jan 2009) | 28 lines Blocked revisions 68760,68793,68813,68826,68829,68831 via svnmerge ........ r68760 | vinay.sajip | 2009-01-19 00:49:19 -0600 (Mon, 19 Jan 2009) | 1 line Added more cross-reference targets and tidied up list of useful handlers. ........ r68793 | raymond.hettinger | 2009-01-19 21:36:36 -0600 (Mon, 19 Jan 2009) | 1 line Make merging easier by formattng comment blocks the same in Py3.1 ........ r68813 | raymond.hettinger | 2009-01-20 14:34:19 -0600 (Tue, 20 Jan 2009) | 3 lines Issue 4998: __slots__ on Fractions was useless. ........ r68826 | vinay.sajip | 2009-01-20 16:43:17 -0600 (Tue, 20 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set. ........ r68829 | vinay.sajip | 2009-01-20 17:16:08 -0600 (Tue, 20 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. ........ r68831 | raymond.hettinger | 2009-01-20 17:42:54 -0600 (Tue, 20 Jan 2009) | 1 line Beautify and cleanup the references section. ........ ................ r68851 | raymond.hettinger | 2009-01-22 05:27:37 +0000 (Thu, 22 Jan 2009) | 1 line More doc tweaks. ................ r68854 | raymond.hettinger | 2009-01-22 09:09:55 +0000 (Thu, 22 Jan 2009) | 1 line Update comments and add an optimized path for Counter.update(). ................ r68855 | antoine.pitrou | 2009-01-22 10:11:36 +0000 (Thu, 22 Jan 2009) | 3 lines Issue #4874: Most builtin decoders now reject unicode input. ................ r68857 | antoine.pitrou | 2009-01-22 11:59:55 +0000 (Thu, 22 Jan 2009) | 3 lines Followup of #4874: also fix multibytecodec.c ................ r68860 | brett.cannon | 2009-01-22 18:37:20 +0000 (Thu, 22 Jan 2009) | 1 line Fix markup for arguments in importlib docs. ................ r68861 | benjamin.peterson | 2009-01-22 21:50:27 +0000 (Thu, 22 Jan 2009) | 12 lines Blocked revisions 68850,68853 via svnmerge ........ r68850 | raymond.hettinger | 2009-01-21 23:20:47 -0600 (Wed, 21 Jan 2009) | 1 line More doc tweaks. ........ r68853 | raymond.hettinger | 2009-01-22 03:05:43 -0600 (Thu, 22 Jan 2009) | 1 line Update comments and add an optimized path for Counter.update(). ........ ................ r68863 | jesse.noller | 2009-01-22 21:56:13 +0000 (Thu, 22 Jan 2009) | 1 line merge r68862 to py3k ................ r68864 | brett.cannon | 2009-01-22 22:43:07 +0000 (Thu, 22 Jan 2009) | 7 lines Add importlib.machinery with its first tenants, BuitinImporter and FrozenImporter. Docs forthcoming. I plan on all finders and loaders (and most likely hooks) to live in imoprtlib.machinery. Utility stuff will end up in importlib.util. Higher-level API stuff will stay on imoprtlib directly (e.g. import_module). ................ r68865 | brett.cannon | 2009-01-22 22:44:04 +0000 (Thu, 22 Jan 2009) | 4 lines Add some comment markers to more clearly delineate what different parts of the code are for. Also add a note that the import * at the end of the file should eventually go away. ................ r68866 | brett.cannon | 2009-01-22 22:45:00 +0000 (Thu, 22 Jan 2009) | 2 lines Ignore pyc and pyo files. ................ r68867 | benjamin.peterson | 2009-01-23 03:26:36 +0000 (Fri, 23 Jan 2009) | 29 lines Merged revisions 68750,68776-68777,68811,68842,68859 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68750 | benjamin.peterson | 2009-01-18 16:47:04 -0600 (Sun, 18 Jan 2009) | 1 line fix encoding cookie case ........ r68776 | benjamin.peterson | 2009-01-19 10:17:54 -0600 (Mon, 19 Jan 2009) | 1 line move BufferedIOBase into the base class section ........ r68777 | benjamin.peterson | 2009-01-19 10:18:27 -0600 (Mon, 19 Jan 2009) | 1 line add email address ........ r68811 | benjamin.peterson | 2009-01-20 12:58:27 -0600 (Tue, 20 Jan 2009) | 1 line fix url ........ r68842 | andrew.kuchling | 2009-01-20 20:16:26 -0600 (Tue, 20 Jan 2009) | 1 line Markup fixes ........ r68859 | georg.brandl | 2009-01-22 12:29:28 -0600 (Thu, 22 Jan 2009) | 2 lines Clarify wording. ........ ................ r68868 | alexandre.vassalotti | 2009-01-23 04:43:46 +0000 (Fri, 23 Jan 2009) | 2 lines Remove unnecessary copying in load_long(). ................ r68869 | alexandre.vassalotti | 2009-01-23 04:46:05 +0000 (Fri, 23 Jan 2009) | 2 lines Remove obsolete note on binary-mode vs. text-mode file. ................ r68870 | alexandre.vassalotti | 2009-01-23 04:50:05 +0000 (Fri, 23 Jan 2009) | 2 lines Issue 2980: Protocol 0 is not truly restricted to ASCII. ................ r68872 | alexandre.vassalotti | 2009-01-23 05:28:16 +0000 (Fri, 23 Jan 2009) | 2 lines Clean up pickle usage examples. ................ r68873 | hirokazu.yamamoto | 2009-01-23 07:23:03 +0000 (Fri, 23 Jan 2009) | 9 lines Merged revisions 68457 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68457 | kristjan.jonsson | 2009-01-10 05:10:59 +0900 | 1 line Issue 3677: Fix import from UNC paths on Windows. ........ ................ r68875 | jesse.noller | 2009-01-23 14:09:08 +0000 (Fri, 23 Jan 2009) | 1 line merge 68874 to py3kwq! ................ r68878 | alexandre.vassalotti | 2009-01-24 01:47:57 +0000 (Sat, 24 Jan 2009) | 4 lines Factor common branch in load_long(). Suggested by Neal Norwitz. ................ r68882 | kristjan.jonsson | 2009-01-24 10:33:25 +0000 (Sat, 24 Jan 2009) | 1 line Issue 3677: Release the path string on py3k ................ r68883 | kristjan.jonsson | 2009-01-24 10:50:45 +0000 (Sat, 24 Jan 2009) | 1 line Add a test for UNC import paths, see issue 3677 ................ r68887 | martin.v.loewis | 2009-01-24 14:10:07 +0000 (Sat, 24 Jan 2009) | 10 lines Merged revisions 68885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68885 | martin.v.loewis | 2009-01-24 15:00:33 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. ........ ................ r68889 | mark.dickinson | 2009-01-24 15:02:35 +0000 (Sat, 24 Jan 2009) | 9 lines Some minor cleanups in PyLong_FromLong: - fast path wasn't being properly taken for negative ints; thanks Victor Stinner for pointing this out. - use Py_SAFE_DOWNCAST instead of direct casting to digit (it's safer, especially if we ever consider moving to 30-bit digits) - cleaner way to write negation ................ r68895 | mark.dickinson | 2009-01-24 15:56:57 +0000 (Sat, 24 Jan 2009) | 13 lines Merged revisions 68890 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values ........ ................ r68898 | martin.v.loewis | 2009-01-24 16:19:45 +0000 (Sat, 24 Jan 2009) | 10 lines Merged revisions 68893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68893 | martin.v.loewis | 2009-01-24 16:47:27 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. ........ ................ r68900 | mark.dickinson | 2009-01-24 16:22:21 +0000 (Sat, 24 Jan 2009) | 9 lines Merged revisions 68897 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68897 | mark.dickinson | 2009-01-24 16:17:27 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #5025: Fix occasional test_kqueue failure on OS X. ........ ................ r68908 | mark.dickinson | 2009-01-24 21:46:33 +0000 (Sat, 24 Jan 2009) | 15 lines Merged revisions 68903,68906 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines Issue #1672332: Fix unpickling of subnormal floats, which was raising ValueError on some platforms as a result of the platform strtod setting errno on underflow. ........ r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #3657: fix occasional test_pickletools failures. ........ ................ r68916 | jesse.noller | 2009-01-25 03:45:53 +0000 (Sun, 25 Jan 2009) | 1 line merge r68915 to py3k ................ r68918 | brett.cannon | 2009-01-25 04:21:39 +0000 (Sun, 25 Jan 2009) | 2 lines Add the terms "finder", "loader", and "importer" to the glossary. ................ r68919 | brett.cannon | 2009-01-25 04:56:30 +0000 (Sun, 25 Jan 2009) | 2 lines Document both importlib.machinery.BuiltinImporter and FrozenImporter. ................ r68922 | mark.dickinson | 2009-01-25 10:48:51 +0000 (Sun, 25 Jan 2009) | 9 lines Merged revisions 68920 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68920 | mark.dickinson | 2009-01-25 10:39:15 +0000 (Sun, 25 Jan 2009) | 2 lines Remove uses of cmp from the decimal module. ........ ................ r68924 | antoine.pitrou | 2009-01-25 16:34:23 +0000 (Sun, 25 Jan 2009) | 6 lines 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 speedups of up to 20%, depending on the system, on various benchmarks. ................ r68926 | benjamin.peterson | 2009-01-25 17:19:17 +0000 (Sun, 25 Jan 2009) | 11 lines Blocked revisions 68925 via svnmerge ........ r68925 | benjamin.peterson | 2009-01-25 11:15:10 -0600 (Sun, 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 ........ ................ Added: python/branches/py3k-issue1717/Doc/library/importlib.rst - copied unchanged from r68926, /python/branches/py3k/Doc/library/importlib.rst python/branches/py3k-issue1717/Doc/tools/rstlint.py - copied unchanged from r68926, /python/branches/py3k/Doc/tools/rstlint.py python/branches/py3k-issue1717/Doc/tools/sphinxext/susp-ignored.csv - copied unchanged from r68926, /python/branches/py3k/Doc/tools/sphinxext/susp-ignored.csv python/branches/py3k-issue1717/Doc/tools/sphinxext/suspicious.py - copied unchanged from r68926, /python/branches/py3k/Doc/tools/sphinxext/suspicious.py python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py - copied unchanged from r68926, /python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k-issue1717/Lib/importlib/ (props changed) - copied from r68926, /python/branches/py3k/Lib/importlib/ python/branches/py3k-issue1717/Lib/test/test_importlib.py - copied unchanged from r68926, /python/branches/py3k/Lib/test/test_importlib.py python/branches/py3k-issue1717/Lib/test/zipdir.zip - copied unchanged from r68926, /python/branches/py3k/Lib/test/zipdir.zip python/branches/py3k-issue1717/PC/VC6/build_tkinter.py - copied unchanged from r68926, /python/branches/py3k/PC/VC6/build_tkinter.py python/branches/py3k-issue1717/PC/VC6/tcl852.patch - copied unchanged from r68926, /python/branches/py3k/PC/VC6/tcl852.patch python/branches/py3k-issue1717/Python/makeopcodetargets.py - copied unchanged from r68926, /python/branches/py3k/Python/makeopcodetargets.py python/branches/py3k-issue1717/Python/opcode_targets.h - copied unchanged from r68926, /python/branches/py3k/Python/opcode_targets.h Removed: python/branches/py3k-issue1717/Lib/test/crashers/iter.py python/branches/py3k-issue1717/Python/getmtime.c Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Demo/classes/Complex.py python/branches/py3k-issue1717/Demo/classes/bitvec.py python/branches/py3k-issue1717/Demo/tix/grid.py python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py python/branches/py3k-issue1717/Demo/tix/samples/Control.py python/branches/py3k-issue1717/Demo/tix/samples/DirList.py python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py python/branches/py3k-issue1717/Demo/tix/samples/Tree.py python/branches/py3k-issue1717/Demo/tix/tixwidgets.py python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py python/branches/py3k-issue1717/Doc/ACKS.txt python/branches/py3k-issue1717/Doc/Makefile python/branches/py3k-issue1717/Doc/c-api/allocation.rst python/branches/py3k-issue1717/Doc/c-api/arg.rst python/branches/py3k-issue1717/Doc/c-api/buffer.rst python/branches/py3k-issue1717/Doc/c-api/bytes.rst python/branches/py3k-issue1717/Doc/c-api/conversion.rst python/branches/py3k-issue1717/Doc/c-api/file.rst python/branches/py3k-issue1717/Doc/c-api/init.rst python/branches/py3k-issue1717/Doc/c-api/intro.rst python/branches/py3k-issue1717/Doc/c-api/long.rst python/branches/py3k-issue1717/Doc/c-api/module.rst python/branches/py3k-issue1717/Doc/c-api/number.rst python/branches/py3k-issue1717/Doc/c-api/object.rst python/branches/py3k-issue1717/Doc/c-api/reflection.rst python/branches/py3k-issue1717/Doc/c-api/sequence.rst python/branches/py3k-issue1717/Doc/c-api/structures.rst python/branches/py3k-issue1717/Doc/c-api/sys.rst python/branches/py3k-issue1717/Doc/c-api/typeobj.rst python/branches/py3k-issue1717/Doc/c-api/unicode.rst python/branches/py3k-issue1717/Doc/data/refcounts.dat python/branches/py3k-issue1717/Doc/distutils/apiref.rst python/branches/py3k-issue1717/Doc/distutils/builtdist.rst python/branches/py3k-issue1717/Doc/distutils/configfile.rst python/branches/py3k-issue1717/Doc/distutils/packageindex.rst python/branches/py3k-issue1717/Doc/distutils/setupscript.rst python/branches/py3k-issue1717/Doc/distutils/uploading.rst python/branches/py3k-issue1717/Doc/documenting/markup.rst python/branches/py3k-issue1717/Doc/extending/building.rst python/branches/py3k-issue1717/Doc/extending/extending.rst python/branches/py3k-issue1717/Doc/extending/newtypes.rst python/branches/py3k-issue1717/Doc/extending/windows.rst python/branches/py3k-issue1717/Doc/glossary.rst python/branches/py3k-issue1717/Doc/howto/curses.rst python/branches/py3k-issue1717/Doc/howto/doanddont.rst python/branches/py3k-issue1717/Doc/howto/functional.rst python/branches/py3k-issue1717/Doc/howto/regex.rst python/branches/py3k-issue1717/Doc/howto/sockets.rst python/branches/py3k-issue1717/Doc/howto/unicode.rst python/branches/py3k-issue1717/Doc/howto/urllib2.rst python/branches/py3k-issue1717/Doc/howto/webservers.rst python/branches/py3k-issue1717/Doc/install/index.rst python/branches/py3k-issue1717/Doc/library/2to3.rst python/branches/py3k-issue1717/Doc/library/abc.rst python/branches/py3k-issue1717/Doc/library/aifc.rst python/branches/py3k-issue1717/Doc/library/array.rst python/branches/py3k-issue1717/Doc/library/ast.rst python/branches/py3k-issue1717/Doc/library/audioop.rst python/branches/py3k-issue1717/Doc/library/base64.rst python/branches/py3k-issue1717/Doc/library/bdb.rst python/branches/py3k-issue1717/Doc/library/binascii.rst python/branches/py3k-issue1717/Doc/library/cmath.rst python/branches/py3k-issue1717/Doc/library/codeop.rst python/branches/py3k-issue1717/Doc/library/collections.rst python/branches/py3k-issue1717/Doc/library/configparser.rst python/branches/py3k-issue1717/Doc/library/constants.rst python/branches/py3k-issue1717/Doc/library/crypt.rst python/branches/py3k-issue1717/Doc/library/csv.rst python/branches/py3k-issue1717/Doc/library/ctypes.rst python/branches/py3k-issue1717/Doc/library/datetime.rst python/branches/py3k-issue1717/Doc/library/decimal.rst python/branches/py3k-issue1717/Doc/library/dis.rst python/branches/py3k-issue1717/Doc/library/email.mime.rst python/branches/py3k-issue1717/Doc/library/fileinput.rst python/branches/py3k-issue1717/Doc/library/fractions.rst python/branches/py3k-issue1717/Doc/library/ftplib.rst python/branches/py3k-issue1717/Doc/library/functions.rst python/branches/py3k-issue1717/Doc/library/gettext.rst python/branches/py3k-issue1717/Doc/library/gzip.rst python/branches/py3k-issue1717/Doc/library/hashlib.rst python/branches/py3k-issue1717/Doc/library/heapq.rst python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst python/branches/py3k-issue1717/Doc/library/http.cookies.rst python/branches/py3k-issue1717/Doc/library/idle.rst python/branches/py3k-issue1717/Doc/library/inspect.rst python/branches/py3k-issue1717/Doc/library/io.rst python/branches/py3k-issue1717/Doc/library/itertools.rst python/branches/py3k-issue1717/Doc/library/json.rst python/branches/py3k-issue1717/Doc/library/locale.rst python/branches/py3k-issue1717/Doc/library/logging.rst python/branches/py3k-issue1717/Doc/library/mailbox.rst python/branches/py3k-issue1717/Doc/library/math.rst python/branches/py3k-issue1717/Doc/library/mmap.rst python/branches/py3k-issue1717/Doc/library/modules.rst python/branches/py3k-issue1717/Doc/library/msvcrt.rst python/branches/py3k-issue1717/Doc/library/multiprocessing.rst python/branches/py3k-issue1717/Doc/library/nntplib.rst python/branches/py3k-issue1717/Doc/library/numbers.rst python/branches/py3k-issue1717/Doc/library/operator.rst python/branches/py3k-issue1717/Doc/library/optparse.rst python/branches/py3k-issue1717/Doc/library/os.rst python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst python/branches/py3k-issue1717/Doc/library/othergui.rst python/branches/py3k-issue1717/Doc/library/parser.rst python/branches/py3k-issue1717/Doc/library/pdb.rst python/branches/py3k-issue1717/Doc/library/pickle.rst python/branches/py3k-issue1717/Doc/library/profile.rst python/branches/py3k-issue1717/Doc/library/pyexpat.rst python/branches/py3k-issue1717/Doc/library/queue.rst python/branches/py3k-issue1717/Doc/library/random.rst python/branches/py3k-issue1717/Doc/library/re.rst python/branches/py3k-issue1717/Doc/library/reprlib.rst python/branches/py3k-issue1717/Doc/library/rlcompleter.rst python/branches/py3k-issue1717/Doc/library/sched.rst python/branches/py3k-issue1717/Doc/library/shutil.rst python/branches/py3k-issue1717/Doc/library/signal.rst python/branches/py3k-issue1717/Doc/library/smtplib.rst python/branches/py3k-issue1717/Doc/library/socket.rst python/branches/py3k-issue1717/Doc/library/sqlite3.rst python/branches/py3k-issue1717/Doc/library/ssl.rst python/branches/py3k-issue1717/Doc/library/stdtypes.rst python/branches/py3k-issue1717/Doc/library/string.rst python/branches/py3k-issue1717/Doc/library/subprocess.rst python/branches/py3k-issue1717/Doc/library/symtable.rst python/branches/py3k-issue1717/Doc/library/sys.rst python/branches/py3k-issue1717/Doc/library/tempfile.rst python/branches/py3k-issue1717/Doc/library/test.rst python/branches/py3k-issue1717/Doc/library/threading.rst python/branches/py3k-issue1717/Doc/library/tk.rst python/branches/py3k-issue1717/Doc/library/tkinter.rst python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst python/branches/py3k-issue1717/Doc/library/tokenize.rst python/branches/py3k-issue1717/Doc/library/trace.rst python/branches/py3k-issue1717/Doc/library/traceback.rst python/branches/py3k-issue1717/Doc/library/turtle.rst python/branches/py3k-issue1717/Doc/library/unicodedata.rst python/branches/py3k-issue1717/Doc/library/unittest.rst python/branches/py3k-issue1717/Doc/library/urllib.parse.rst python/branches/py3k-issue1717/Doc/library/urllib.request.rst python/branches/py3k-issue1717/Doc/library/warnings.rst python/branches/py3k-issue1717/Doc/library/webbrowser.rst python/branches/py3k-issue1717/Doc/library/wsgiref.rst python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst python/branches/py3k-issue1717/Doc/library/zipfile.rst python/branches/py3k-issue1717/Doc/library/zipimport.rst python/branches/py3k-issue1717/Doc/library/zlib.rst python/branches/py3k-issue1717/Doc/license.rst python/branches/py3k-issue1717/Doc/make.bat python/branches/py3k-issue1717/Doc/reference/datamodel.rst python/branches/py3k-issue1717/Doc/reference/expressions.rst python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst python/branches/py3k-issue1717/Doc/tools/ (props changed) python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py python/branches/py3k-issue1717/Doc/tutorial/classes.rst python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst python/branches/py3k-issue1717/Doc/tutorial/errors.rst python/branches/py3k-issue1717/Doc/tutorial/index.rst python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst python/branches/py3k-issue1717/Doc/tutorial/introduction.rst python/branches/py3k-issue1717/Doc/tutorial/modules.rst python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst python/branches/py3k-issue1717/Doc/using/cmdline.rst python/branches/py3k-issue1717/Doc/using/unix.rst python/branches/py3k-issue1717/Doc/using/windows.rst python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst python/branches/py3k-issue1717/Include/abstract.h python/branches/py3k-issue1717/Include/longobject.h python/branches/py3k-issue1717/Include/memoryobject.h python/branches/py3k-issue1717/Include/object.h python/branches/py3k-issue1717/Include/pydebug.h python/branches/py3k-issue1717/Include/pyerrors.h python/branches/py3k-issue1717/Include/pymath.h python/branches/py3k-issue1717/Include/pyport.h python/branches/py3k-issue1717/Include/unicodeobject.h python/branches/py3k-issue1717/LICENSE python/branches/py3k-issue1717/Lib/_abcoll.py python/branches/py3k-issue1717/Lib/ast.py python/branches/py3k-issue1717/Lib/collections.py python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py python/branches/py3k-issue1717/Lib/ctypes/util.py python/branches/py3k-issue1717/Lib/decimal.py python/branches/py3k-issue1717/Lib/distutils/command/register.py python/branches/py3k-issue1717/Lib/distutils/command/sdist.py python/branches/py3k-issue1717/Lib/distutils/command/upload.py python/branches/py3k-issue1717/Lib/distutils/config.py python/branches/py3k-issue1717/Lib/distutils/dist.py python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py python/branches/py3k-issue1717/Lib/fractions.py python/branches/py3k-issue1717/Lib/gzip.py python/branches/py3k-issue1717/Lib/heapq.py python/branches/py3k-issue1717/Lib/http/client.py python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py python/branches/py3k-issue1717/Lib/idlelib/help.txt python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py python/branches/py3k-issue1717/Lib/importlib/test/ (props changed) python/branches/py3k-issue1717/Lib/importlib/test/builtin/ (props changed) python/branches/py3k-issue1717/Lib/importlib/test/extension/ (props changed) python/branches/py3k-issue1717/Lib/importlib/test/frozen/ (props changed) python/branches/py3k-issue1717/Lib/importlib/test/import_/ (props changed) python/branches/py3k-issue1717/Lib/importlib/test/source/ (props changed) python/branches/py3k-issue1717/Lib/inspect.py python/branches/py3k-issue1717/Lib/io.py python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py python/branches/py3k-issue1717/Lib/lib2to3/main.py python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py python/branches/py3k-issue1717/Lib/lib2to3/refactor.py python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py python/branches/py3k-issue1717/Lib/logging/__init__.py python/branches/py3k-issue1717/Lib/logging/handlers.py python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py python/branches/py3k-issue1717/Lib/multiprocessing/forking.py python/branches/py3k-issue1717/Lib/multiprocessing/managers.py python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py python/branches/py3k-issue1717/Lib/multiprocessing/util.py python/branches/py3k-issue1717/Lib/pickle.py python/branches/py3k-issue1717/Lib/pickletools.py python/branches/py3k-issue1717/Lib/random.py python/branches/py3k-issue1717/Lib/smtplib.py python/branches/py3k-issue1717/Lib/socket.py python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py python/branches/py3k-issue1717/Lib/test/pickletester.py python/branches/py3k-issue1717/Lib/test/support.py python/branches/py3k-issue1717/Lib/test/test_ast.py python/branches/py3k-issue1717/Lib/test/test_binop.py python/branches/py3k-issue1717/Lib/test/test_bz2.py python/branches/py3k-issue1717/Lib/test/test_capi.py python/branches/py3k-issue1717/Lib/test/test_cmath.py python/branches/py3k-issue1717/Lib/test/test_cmd_line.py python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py python/branches/py3k-issue1717/Lib/test/test_codecs.py python/branches/py3k-issue1717/Lib/test/test_collections.py python/branches/py3k-issue1717/Lib/test/test_datetime.py python/branches/py3k-issue1717/Lib/test/test_decimal.py python/branches/py3k-issue1717/Lib/test/test_fileio.py python/branches/py3k-issue1717/Lib/test/test_fractions.py python/branches/py3k-issue1717/Lib/test/test_gzip.py python/branches/py3k-issue1717/Lib/test/test_hashlib.py python/branches/py3k-issue1717/Lib/test/test_import.py python/branches/py3k-issue1717/Lib/test/test_inspect.py python/branches/py3k-issue1717/Lib/test/test_io.py python/branches/py3k-issue1717/Lib/test/test_iter.py python/branches/py3k-issue1717/Lib/test/test_itertools.py python/branches/py3k-issue1717/Lib/test/test_kqueue.py python/branches/py3k-issue1717/Lib/test/test_long.py python/branches/py3k-issue1717/Lib/test/test_memoryview.py python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py python/branches/py3k-issue1717/Lib/test/test_os.py python/branches/py3k-issue1717/Lib/test/test_socket.py python/branches/py3k-issue1717/Lib/test/test_struct.py python/branches/py3k-issue1717/Lib/test/test_sys.py python/branches/py3k-issue1717/Lib/test/test_urllib.py python/branches/py3k-issue1717/Lib/test/test_wsgiref.py python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py python/branches/py3k-issue1717/Lib/test/test_zipfile.py python/branches/py3k-issue1717/Lib/tkinter/__init__.py python/branches/py3k-issue1717/Lib/tkinter/_fix.py python/branches/py3k-issue1717/Lib/tkinter/tix.py python/branches/py3k-issue1717/Lib/unittest.py python/branches/py3k-issue1717/Lib/wsgiref/handlers.py python/branches/py3k-issue1717/Lib/wsgiref/headers.py python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py python/branches/py3k-issue1717/Lib/wsgiref/util.py python/branches/py3k-issue1717/Lib/wsgiref/validate.py python/branches/py3k-issue1717/Lib/zipfile.py python/branches/py3k-issue1717/Makefile.pre.in python/branches/py3k-issue1717/Misc/ACKS python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/Misc/build.sh python/branches/py3k-issue1717/Modules/_codecsmodule.c python/branches/py3k-issue1717/Modules/_collectionsmodule.c python/branches/py3k-issue1717/Modules/_ctypes/callproc.c python/branches/py3k-issue1717/Modules/_ctypes/cfield.c python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c python/branches/py3k-issue1717/Modules/_dbmmodule.c python/branches/py3k-issue1717/Modules/_fileio.c python/branches/py3k-issue1717/Modules/_hashopenssl.c python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c python/branches/py3k-issue1717/Modules/_pickle.c python/branches/py3k-issue1717/Modules/_struct.c python/branches/py3k-issue1717/Modules/_testcapimodule.c python/branches/py3k-issue1717/Modules/_tkinter.c python/branches/py3k-issue1717/Modules/bz2module.c python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c python/branches/py3k-issue1717/Modules/datetimemodule.c python/branches/py3k-issue1717/Modules/gcmodule.c python/branches/py3k-issue1717/Modules/grpmodule.c python/branches/py3k-issue1717/Modules/itertoolsmodule.c python/branches/py3k-issue1717/Modules/main.c python/branches/py3k-issue1717/Modules/posixmodule.c python/branches/py3k-issue1717/Modules/selectmodule.c python/branches/py3k-issue1717/Modules/socketmodule.c python/branches/py3k-issue1717/Modules/zlibmodule.c python/branches/py3k-issue1717/Objects/abstract.c python/branches/py3k-issue1717/Objects/boolobject.c python/branches/py3k-issue1717/Objects/bytesobject.c python/branches/py3k-issue1717/Objects/complexobject.c python/branches/py3k-issue1717/Objects/exceptions.c python/branches/py3k-issue1717/Objects/floatobject.c python/branches/py3k-issue1717/Objects/longobject.c python/branches/py3k-issue1717/Objects/memoryobject.c python/branches/py3k-issue1717/Objects/moduleobject.c python/branches/py3k-issue1717/Objects/object.c python/branches/py3k-issue1717/Objects/setobject.c python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h python/branches/py3k-issue1717/Objects/tupleobject.c python/branches/py3k-issue1717/Objects/typeobject.c python/branches/py3k-issue1717/Objects/unicodeobject.c python/branches/py3k-issue1717/Objects/weakrefobject.c python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp python/branches/py3k-issue1717/PC/VC6/bz2.dsp python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp python/branches/py3k-issue1717/PC/VC6/readme.txt python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj python/branches/py3k-issue1717/PC/VS8.0/pythoncore.vcproj python/branches/py3k-issue1717/PC/example_nt/example.c python/branches/py3k-issue1717/PC/os2emx/Makefile python/branches/py3k-issue1717/PC/os2emx/python27.def python/branches/py3k-issue1717/PC/os2vacpp/makefile python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk python/branches/py3k-issue1717/PC/os2vacpp/python.def python/branches/py3k-issue1717/PC/pyconfig.h python/branches/py3k-issue1717/PC/winreg.c python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj python/branches/py3k-issue1717/Parser/asdl.py python/branches/py3k-issue1717/Parser/printgrammar.c python/branches/py3k-issue1717/Python/Python-ast.c python/branches/py3k-issue1717/Python/ast.c python/branches/py3k-issue1717/Python/bltinmodule.c python/branches/py3k-issue1717/Python/ceval.c python/branches/py3k-issue1717/Python/compile.c python/branches/py3k-issue1717/Python/getcopyright.c python/branches/py3k-issue1717/Python/graminit.c python/branches/py3k-issue1717/Python/import.c python/branches/py3k-issue1717/Python/pythonrun.c python/branches/py3k-issue1717/Python/sysmodule.c python/branches/py3k-issue1717/Python/thread.c python/branches/py3k-issue1717/Python/thread_nt.h python/branches/py3k-issue1717/README python/branches/py3k-issue1717/Tools/scripts/patchcheck.py python/branches/py3k-issue1717/configure python/branches/py3k-issue1717/configure.in python/branches/py3k-issue1717/pyconfig.h.in python/branches/py3k-issue1717/setup.py Modified: python/branches/py3k-issue1717/Demo/classes/Complex.py ============================================================================== --- python/branches/py3k-issue1717/Demo/classes/Complex.py (original) +++ python/branches/py3k-issue1717/Demo/classes/Complex.py Sun Jan 25 21:08:20 2009 @@ -39,7 +39,6 @@ # # These conversions accept complex arguments only if their imaginary part is zero: # int(z) -# long(z) # float(z) # # The following operators accept two complex numbers, or one complex number @@ -147,11 +146,6 @@ raise ValueError("can't convert Complex with nonzero im to int") return int(self.re) - def __long__(self): - if self.im: - raise ValueError("can't convert Complex with nonzero im to long") - return int(self.re) - def __float__(self): if self.im: raise ValueError("can't convert Complex with nonzero im to float") Modified: python/branches/py3k-issue1717/Demo/classes/bitvec.py ============================================================================== --- python/branches/py3k-issue1717/Demo/classes/bitvec.py (original) +++ python/branches/py3k-issue1717/Demo/classes/bitvec.py Sun Jan 25 21:08:20 2009 @@ -315,9 +315,6 @@ def __int__(self): return int(self._data) - def __long__(self): - return int(self._data) - def __float__(self): return float(self._data) Modified: python/branches/py3k-issue1717/Demo/tix/grid.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/grid.py (original) +++ python/branches/py3k-issue1717/Demo/tix/grid.py Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ ### -import Tix as tk +import tkinter.tix as tk from pprint import pprint r= tk.Tk() Modified: python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py Sun Jan 25 21:08:20 2009 @@ -15,7 +15,7 @@ # Your can display the help message in a "balloon" and a status bar widget. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -32,20 +32,20 @@ z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) - status = Tix.Label(w, width=40, relief=Tix.SUNKEN, bd=1) - status.pack(side=Tix.BOTTOM, fill=Tix.Y, padx=2, pady=1) + status = tkinter.tix.Label(w, width=40, relief=tkinter.tix.SUNKEN, bd=1) + status.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.Y, padx=2, pady=1) # Create two mysterious widgets that need balloon help - button1 = Tix.Button(w, text='Something Unexpected', + button1 = tkinter.tix.Button(w, text='Something Unexpected', command=self.quitcmd) - button2 = Tix.Button(w, text='Something Else Unexpected') + button2 = tkinter.tix.Button(w, text='Something Else Unexpected') button2['command'] = lambda w=button2: w.destroy() - button1.pack(side=Tix.TOP, expand=1) - button2.pack(side=Tix.TOP, expand=1) + button1.pack(side=tkinter.tix.TOP, expand=1) + button2.pack(side=tkinter.tix.TOP, expand=1) # Create the balloon widget and associate it with the widgets that we want # to provide tips for: - b = Tix.Balloon(w, statusbar=status) + b = tkinter.tix.Balloon(w, statusbar=status) b.bind_widget(button1, balloonmsg='Close Window', statusmsg='Press this button to close this window') @@ -64,5 +64,5 @@ self.root.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py Sun Jan 25 21:08:20 2009 @@ -15,13 +15,13 @@ # for example. # -import Tix +import tkinter.tix def RunSample(w): # Create the label on the top of the dialog box # - top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED, - anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') + top = tkinter.tix.Label(w, padx=20, pady=10, bd=1, relief=tkinter.tix.RAISED, + anchor=tkinter.tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') # Create the button box and add a few buttons in it. Set the # -width of all the buttons to the same value so that they @@ -30,15 +30,15 @@ # Note that the -text, -underline, -command and -width options are all # standard options of the button widgets. # - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='OK', underline=0, width=5, command=lambda w=w: w.destroy()) box.add('close', text='Cancel', underline=0, width=5, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py Sun Jan 25 21:08:20 2009 @@ -15,7 +15,7 @@ # buttons # -import Tix +import tkinter.tix network_pixmap = """/* XPM */ static char * netw_xpm[] = { @@ -144,15 +144,15 @@ """ def RunSample(w): - w.img0 = Tix.Image('pixmap', data=network_pixmap) + w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap) if not w.img0: - w.img0 = Tix.Image('bitmap', data=network_bitmap) - w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap) + w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap) + w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap) if not w.img0: - w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap) + w.img1 = tkinter.tix.Image('bitmap', data=hard_disk_bitmap) - hdd = Tix.Button(w, padx=4, pady=1, width=120) - net = Tix.Button(w, padx=4, pady=1, width=120) + hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120) + net = tkinter.tix.Button(w, padx=4, pady=1, width=120) # Create the first image: we create a line, then put a string, # a space and a image into this line, from left to right. @@ -160,7 +160,7 @@ # individual items # # The tk.calls should be methods in Tix ... - w.hdd_img = Tix.Image('compound', window=hdd) + w.hdd_img = tkinter.tix.Image('compound', window=hdd) w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line') w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk', '-underline', '0') @@ -172,7 +172,7 @@ hdd['image'] = w.hdd_img # Next button - w.net_img = Tix.Image('compound', window=net) + w.net_img = tkinter.tix.Image('compound', window=net) w.net_img.tk.call(str(w.net_img), 'add', 'line') w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network', '-underline', '0') @@ -183,14 +183,14 @@ # net['image'] = w.net_img - close = Tix.Button(w, pady=1, text='Close', + close = tkinter.tix.Button(w, pady=1, text='Close', command=lambda w=w: w.destroy()) - hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - net.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - close.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) + hdd.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py Sun Jan 25 21:08:20 2009 @@ -13,15 +13,15 @@ # This file demonstrates the use of the tixComboBox widget, which is close # to the MS Window Combo Box control. # -import Tix +import tkinter.tix def RunSample(w): global demo_month, demo_year - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) - demo_month = Tix.StringVar() - demo_year = Tix.StringVar() + demo_month = tkinter.tix.StringVar() + demo_year = tkinter.tix.StringVar() # $w.top.a is a drop-down combo box. It is not editable -- who wants # to invent new months? @@ -30,7 +30,7 @@ # [Hint] We set the label.width subwidget option of both comboboxes to # be 10 so that their labels appear to be aligned. # - a = Tix.ComboBox(top, label="Month: ", dropdown=1, + a = tkinter.tix.ComboBox(top, label="Month: ", dropdown=1, command=select_month, editable=0, variable=demo_month, options='listbox.height 6 label.width 10 label.anchor e') @@ -43,31 +43,31 @@ # [Hint] Notice that you should use padY (the NAME of the option) and not # pady (the SWITCH of the option). # - b = Tix.ComboBox(top, label="Year: ", dropdown=0, + b = tkinter.tix.ComboBox(top, label="Year: ", dropdown=0, command=select_year, editable=1, variable=demo_year, options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne') - a.pack(side=Tix.TOP, anchor=Tix.W) - b.pack(side=Tix.TOP, anchor=Tix.W) + a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) - a.insert(Tix.END, 'January') - a.insert(Tix.END, 'February') - a.insert(Tix.END, 'March') - a.insert(Tix.END, 'April') - a.insert(Tix.END, 'May') - a.insert(Tix.END, 'June') - a.insert(Tix.END, 'July') - a.insert(Tix.END, 'August') - a.insert(Tix.END, 'September') - a.insert(Tix.END, 'October') - a.insert(Tix.END, 'November') - a.insert(Tix.END, 'December') - - b.insert(Tix.END, '1992') - b.insert(Tix.END, '1993') - b.insert(Tix.END, '1994') - b.insert(Tix.END, '1995') - b.insert(Tix.END, '1996') + a.insert(tkinter.tix.END, 'January') + a.insert(tkinter.tix.END, 'February') + a.insert(tkinter.tix.END, 'March') + a.insert(tkinter.tix.END, 'April') + a.insert(tkinter.tix.END, 'May') + a.insert(tkinter.tix.END, 'June') + a.insert(tkinter.tix.END, 'July') + a.insert(tkinter.tix.END, 'August') + a.insert(tkinter.tix.END, 'September') + a.insert(tkinter.tix.END, 'October') + a.insert(tkinter.tix.END, 'November') + a.insert(tkinter.tix.END, 'December') + + b.insert(tkinter.tix.END, '1992') + b.insert(tkinter.tix.END, '1993') + b.insert(tkinter.tix.END, '1994') + b.insert(tkinter.tix.END, '1995') + b.insert(tkinter.tix.END, '1996') # Use "tixSetSilent" to set the values of the combo box if you # don't want your -command procedures (cbx:select_month and @@ -76,13 +76,13 @@ a.set_silent('January') b.set_silent('1995') - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: ok_command(w)) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def select_month(event=None): # tixDemo:Status "Month = %s" % demo_month.get() @@ -97,6 +97,6 @@ w.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/samples/Control.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/Control.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/Control.py Sun Jan 25 21:08:20 2009 @@ -18,7 +18,7 @@ # integer values; one lets you select floating point values and the last # one lets you select a few names. -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -34,14 +34,14 @@ global demo_maker, demo_thrust, demo_num_engines - demo_maker = Tix.StringVar() - demo_thrust = Tix.DoubleVar() - demo_num_engines = Tix.IntVar() + demo_maker = tkinter.tix.StringVar() + demo_thrust = tkinter.tix.DoubleVar() + demo_num_engines = tkinter.tix.IntVar() demo_maker.set('P&W') demo_thrust.set(20000.0) demo_num_engines.set(2) - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) # $w.top.a allows only integer values # @@ -49,16 +49,16 @@ # [Hint] We set the label.width subwidget option of the Controls to # be 16 so that their labels appear to be aligned. # - a = Tix.Control(top, label='Number of Engines: ', integer=1, + a = tkinter.tix.Control(top, label='Number of Engines: ', integer=1, variable=demo_num_engines, min=1, max=4, options='entry.width 10 label.width 20 label.anchor e') - b = Tix.Control(top, label='Thrust: ', integer=0, + b = tkinter.tix.Control(top, label='Thrust: ', integer=0, min='10000.0', max='60000.0', step=500, variable=demo_thrust, options='entry.width 10 label.width 20 label.anchor e') - c = Tix.Control(top, label='Engine Maker: ', value='P&W', + c = tkinter.tix.Control(top, label='Engine Maker: ', value='P&W', variable=demo_maker, options='entry.width 10 label.width 20 label.anchor e') @@ -68,17 +68,17 @@ c['decrcmd'] = lambda w=c: adjust_maker(w, -1) c['validatecmd'] = lambda w=c: validate_maker(w) - a.pack(side=Tix.TOP, anchor=Tix.W) - b.pack(side=Tix.TOP, anchor=Tix.W) - c.pack(side=Tix.TOP, anchor=Tix.W) + a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) + c.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.okcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def okcmd (self): # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get()) @@ -118,5 +118,5 @@ return maker_list[i] if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k-issue1717/Demo/tix/samples/DirList.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/DirList.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/DirList.py Sun Jan 25 21:08:20 2009 @@ -16,8 +16,8 @@ # installation directory for an application. # -import Tix, os, copy -from Tkconstants import * +import tkinter.tix, os, copy +from tkinter.constants import * TCL_ALL_EVENTS = 0 @@ -40,25 +40,25 @@ # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 - top = Tix.Frame( w, relief=RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=RAISED, bd=1) # Create the DirList widget. By default it will show the current # directory # # - top.dir = Tix.DirList(top) + top.dir = tkinter.tix.DirList(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # - top.btn = Tix.Button(top, text = " >> ", pady = 0) + top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirList widget, or he can type in the directory # manually # - top.ent = Tix.LabelEntry(top, label="Installation Directory:", + top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 @@ -85,7 +85,7 @@ # Use a ButtonBox to hold the buttons. # - box = Tix.ButtonBox (w, orientation='horizontal') + box = tkinter.tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, @@ -118,14 +118,14 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - import tkMessageBox, traceback + import tkinter.messagebox, traceback try: - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) except: t, v, tb = sys.exc_info() text = "Error running the demo script:\n" for line in traceback.format_exception(t,v,tb): text = text + line + '\n' - d = tkMessageBox.showerror ( 'Tix Demo Error', text) + d = tkinter.messagebox.showerror ( 'Tix Demo Error', text) Modified: python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py Sun Jan 25 21:08:20 2009 @@ -16,8 +16,8 @@ # installation directory for an application. # -import Tix, os, copy -from Tkconstants import * +import tkinter.tix, os, copy +from tkinter.constants import * TCL_ALL_EVENTS = 0 @@ -40,25 +40,25 @@ # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 - top = Tix.Frame( w, relief=RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=RAISED, bd=1) # Create the DirTree widget. By default it will show the current # directory # # - top.dir = Tix.DirTree(top) + top.dir = tkinter.tix.DirTree(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # - top.btn = Tix.Button(top, text = " >> ", pady = 0) + top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirTree widget, or he can type in the directory # manually # - top.ent = Tix.LabelEntry(top, label="Installation Directory:", + top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 @@ -79,7 +79,7 @@ # Use a ButtonBox to hold the buttons. # - box = Tix.ButtonBox (w, orientation='horizontal') + box = tkinter.tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, @@ -113,5 +113,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py Sun Jan 25 21:08:20 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixNoteBook widget, which allows # you to lay out your interface using a "notebook" metaphore # -import Tix +import tkinter.tix def RunSample(w): global root @@ -21,20 +21,20 @@ # We use these options to set the sizes of the subwidgets inside the # notebook, so that they are well-aligned on the screen. - prefix = Tix.OptionName(w) + prefix = tkinter.tix.OptionName(w) if prefix: prefix = '*'+prefix else: prefix = '' w.option_add(prefix+'*TixControl*entry.width', 10) w.option_add(prefix+'*TixControl*label.width', 18) - w.option_add(prefix+'*TixControl*label.anchor', Tix.E) + w.option_add(prefix+'*TixControl*label.anchor', tkinter.tix.E) w.option_add(prefix+'*TixNoteBook*tagPadX', 8) # Create the notebook widget and set its backpagecolor to gray. # Note that the -backpagecolor option belongs to the "nbframe" # subwidget. - nb = Tix.NoteBook(w, name='nb', ipadx=6, ipady=6) + nb = tkinter.tix.NoteBook(w, name='nb', ipadx=6, ipady=6) nb['bg'] = 'gray' nb.nbframe['backpagecolor'] = 'gray' @@ -45,7 +45,7 @@ nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('network', label="Network", underline=0) - nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP) + nb.pack(expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5 ,side=tkinter.tix.TOP) #---------------------------------------- # Create the first page @@ -54,21 +54,21 @@ # other widgets # tab=nb.hard_disk - f = Tix.Frame(tab) - common = Tix.Frame(tab) + f = tkinter.tix.Frame(tab) + common = tkinter.tix.Frame(tab) - f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) - common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) + f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1) + common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y) - a = Tix.Control(f, value=12, label='Access time: ') - w = Tix.Control(f, value=400, label='Write Throughput: ') - r = Tix.Control(f, value=400, label='Read Throughput: ') - c = Tix.Control(f, value=1021, label='Capacity: ') - - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(f, value=12, label='Access time: ') + w = tkinter.tix.Control(f, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(f, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(f, value=1021, label='Capacity: ') + + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) # Create the common buttons createCommonButtons(common) @@ -79,23 +79,23 @@ tab = nb.network - f = Tix.Frame(tab) - common = Tix.Frame(tab) + f = tkinter.tix.Frame(tab) + common = tkinter.tix.Frame(tab) - f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) - common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) + f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1) + common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y) - a = Tix.Control(f, value=12, label='Access time: ') - w = Tix.Control(f, value=400, label='Write Throughput: ') - r = Tix.Control(f, value=400, label='Read Throughput: ') - c = Tix.Control(f, value=1021, label='Capacity: ') - u = Tix.Control(f, value=10, label='Users: ') - - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) - u.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(f, value=12, label='Access time: ') + w = tkinter.tix.Control(f, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(f, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(f, value=1021, label='Capacity: ') + u = tkinter.tix.Control(f, value=10, label='Users: ') + + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) + u.pack(side=tkinter.tix.TOP, padx=20, pady=2) createCommonButtons(common) @@ -104,16 +104,16 @@ root.destroy() def createCommonButtons(master): - ok = Tix.Button(master, name='ok', text='OK', width=6, + ok = tkinter.tix.Button(master, name='ok', text='OK', width=6, command=doDestroy) - cancel = Tix.Button(master, name='cancel', + cancel = tkinter.tix.Button(master, name='cancel', text='Cancel', width=6, command=doDestroy) - ok.pack(side=Tix.TOP, padx=2, pady=2) - cancel.pack(side=Tix.TOP, padx=2, pady=2) + ok.pack(side=tkinter.tix.TOP, padx=2, pady=2) + cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py Sun Jan 25 21:08:20 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixOptionMenu widget -- you can # use it for the user to choose from a fixed set of options # -import Tix +import tkinter.tix options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML', 'tex':'LaTeX', 'rtf':'Rich Text Format'} @@ -21,16 +21,16 @@ def RunSample(w): global demo_opt_from, demo_opt_to - demo_opt_from = Tix.StringVar() - demo_opt_to = Tix.StringVar() + demo_opt_from = tkinter.tix.StringVar() + demo_opt_to = tkinter.tix.StringVar() - top = Tix.Frame(w, bd=1, relief=Tix.RAISED) + top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED) - from_file = Tix.OptionMenu(top, label="From File Format : ", + from_file = tkinter.tix.OptionMenu(top, label="From File Format : ", variable=demo_opt_from, options = 'label.width 19 label.anchor e menubutton.width 15') - to_file = Tix.OptionMenu(top, label="To File Format : ", + to_file = tkinter.tix.OptionMenu(top, label="To File Format : ", variable=demo_opt_to, options='label.width 19 label.anchor e menubutton.width 15') @@ -47,22 +47,22 @@ demo_opt_from.set('html') demo_opt_to.set('post') - from_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) - to_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) + from_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6) + to_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: ok_command(w)) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def ok_command(w): # tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get()) w.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py Sun Jan 25 21:08:20 2009 @@ -15,7 +15,7 @@ # of artical names and the size of the text widget that shows the body # of the article. -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -32,30 +32,30 @@ z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) - group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') + group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') - pane = Tix.PanedWindow(w, orientation='vertical') + pane = tkinter.tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) - list = Tix.ScrolledListBox(p1) + list = tkinter.tix.ScrolledListBox(p1) list.listbox['width'] = 80 list.listbox['height'] = 5 - text = Tix.ScrolledText(p2) + text = tkinter.tix.ScrolledText(p2) text.text['width'] = 80 text.text['height'] = 20 - list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' - text.text.insert(Tix.END, """ + text.text.insert(tkinter.tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi at blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania @@ -70,18 +70,18 @@ """) text.text['state'] = 'disabled' - list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) - text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) + list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) + text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) - group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) + group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.quitcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) - box.pack(side=Tix.BOTTOM, fill=Tix.X) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) def quitcmd (self): self.exit = 0 @@ -94,5 +94,5 @@ self.root.destroy() if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py Sun Jan 25 21:08:20 2009 @@ -12,18 +12,18 @@ # This file demonstrates the use of the tixPopupMenu widget. # -import Tix +import tkinter.tix def RunSample(w): # We create the frame and the button, then we'll bind the PopupMenu # to both widgets. The result is, when you press the right mouse # button over $w.top or $w.top.but, the PopupMenu will come up. # - top = Tix.Frame(w, relief=Tix.RAISED, bd=1) - but = Tix.Button(top, text='Press the right mouse button over this button or its surrounding area') - but.pack(expand=1, fill=Tix.BOTH, padx=50, pady=50) + top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1) + but = tkinter.tix.Button(top, text='Press the right mouse button over this button or its surrounding area') + but.pack(expand=1, fill=tkinter.tix.BOTH, padx=50, pady=50) - p = Tix.PopupMenu(top, title='Popup Test') + p = tkinter.tix.PopupMenu(top, title='Popup Test') p.bind_widget(top) p.bind_widget(but) @@ -37,21 +37,21 @@ p.menu.add_command(label='Find', underline=0) p.menu.add_command(label='System', underline=1) p.menu.add_command(label='Help', underline=0) - m1 = Tix.Menu(p.menu) + m1 = tkinter.tix.Menu(p.menu) m1.add_command(label='Hello') p.menu.add_cascade(label='More', menu=m1) - but.pack(side=Tix.TOP, padx=40, pady=50) + but.pack(side=tkinter.tix.TOP, padx=40, pady=50) - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=lambda w=w: w.destroy()) box.add('cancel', text='Cancel', underline=0, width=6, command=lambda w=w: w.destroy()) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py Sun Jan 25 21:08:20 2009 @@ -13,7 +13,7 @@ # This file demonstrates the use of the tixScrolledHList widget. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -33,13 +33,13 @@ # We create the frame and the ScrolledHList widget # at the top of the dialog box # - top = Tix.Frame( w, relief=Tix.RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1) # Put a simple hierachy into the HList (two levels). Use colors and # separator widgets (frames) to make the list look fancy # - top.a = Tix.ScrolledHList(top) - top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) + top.a = tkinter.tix.ScrolledHList(top) + top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP) # This is our little relational database # @@ -68,13 +68,13 @@ count=0 for boss,name in bosses : if count : - f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150, - bd=2, relief=Tix.SUNKEN ) + f=tkinter.tix.Frame(hlist, name='sep%d' % count, height=2, width=150, + bd=2, relief=tkinter.tix.SUNKEN ) - hlist.add_child( itemtype=Tix.WINDOW, - window=f, state=Tix.DISABLED ) + hlist.add_child( itemtype=tkinter.tix.WINDOW, + window=f, state=tkinter.tix.DISABLED ) - hlist.add(boss, itemtype=Tix.TEXT, text=name) + hlist.add(boss, itemtype=tkinter.tix.TEXT, text=name) count = count+1 @@ -99,15 +99,15 @@ # Use a ButtonBox to hold the buttons. # - box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) + box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, command = self.okcmd) box.add( 'cancel', text='Cancel', underline=0, width=6, command = self.quitcmd) - box.pack( side=Tix.BOTTOM, fill=Tix.X) - top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) + box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 ) def okcmd (self): self.quitcmd() @@ -127,5 +127,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py Sun Jan 25 21:08:20 2009 @@ -16,7 +16,7 @@ # In a tixHList widget, you can have one ore more columns. # -import Tix +import tkinter.tix TCL_ALL_EVENTS = 0 @@ -36,13 +36,13 @@ # We create the frame and the ScrolledHList widget # at the top of the dialog box # - top = Tix.Frame( w, relief=Tix.RAISED, bd=1) + top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1) # Put a simple hierachy into the HList (two levels). Use colors and # separator widgets (frames) to make the list look fancy # - top.a = Tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) - top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) + top.a = tkinter.tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) + top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP) hlist=top.a.hlist @@ -55,12 +55,12 @@ # First some styles for the headers style={} - style['header'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist, - anchor=Tix.CENTER, padx=8, pady=2, font = boldfont ) + style['header'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist, + anchor=tkinter.tix.CENTER, padx=8, pady=2, font = boldfont ) - hlist.header_create(0, itemtype=Tix.TEXT, text='Name', + hlist.header_create(0, itemtype=tkinter.tix.TEXT, text='Name', style=style['header']) - hlist.header_create(1, itemtype=Tix.TEXT, text='Position', + hlist.header_create(1, itemtype=tkinter.tix.TEXT, text='Position', style=style['header']) # Notice that we use 3 columns in the hlist widget. This way when the user @@ -90,13 +90,13 @@ ('chuck', 'jeff', 'Chuck McLean', 'Cleaner') ] - style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) + style['mgr_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist) - style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) + style['mgr_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist) - style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) + style['empl_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist) - style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) + style['empl_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist) # Let configure the appearance of the HList subwidget # @@ -105,9 +105,9 @@ # Create the boss # - hlist.add ('.', itemtype=Tix.TEXT, text=boss[1], + hlist.add ('.', itemtype=tkinter.tix.TEXT, text=boss[1], style=style['mgr_name']) - hlist.item_create('.', 1, itemtype=Tix.TEXT, text=boss[2], + hlist.item_create('.', 1, itemtype=tkinter.tix.TEXT, text=boss[2], style=style['mgr_posn']) # Create the managers @@ -115,9 +115,9 @@ for key,name,posn in managers : e= '.'+ key - hlist.add(e, itemtype=Tix.TEXT, text=name, + hlist.add(e, itemtype=tkinter.tix.TEXT, text=name, style=style['mgr_name']) - hlist.item_create(e, 1, itemtype=Tix.TEXT, text=posn, + hlist.item_create(e, 1, itemtype=tkinter.tix.TEXT, text=posn, style=style['mgr_posn']) @@ -130,21 +130,21 @@ # parent entryPath / child's name hlist.add(entrypath, text=name, style=style['empl_name']) - hlist.item_create(entrypath, 1, itemtype=Tix.TEXT, + hlist.item_create(entrypath, 1, itemtype=tkinter.tix.TEXT, text = posn, style = style['empl_posn'] ) # Use a ButtonBox to hold the buttons. # - box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) + box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, command = self.okcmd ) box.add( 'cancel', text='Cancel', underline=0, width=6, command = self.quitcmd ) - box.pack( side=Tix.BOTTOM, fill=Tix.X) - top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) + box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 ) def okcmd (self): self.quitcmd() @@ -164,5 +164,5 @@ # outside of the main demo program "tixwidgets.py". # if __name__== '__main__' : - root=Tix.Tk() + root=tkinter.tix.Tk() RunSample(root) Modified: python/branches/py3k-issue1717/Demo/tix/samples/Tree.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/samples/Tree.py (original) +++ python/branches/py3k-issue1717/Demo/tix/samples/Tree.py Sun Jan 25 21:08:20 2009 @@ -14,30 +14,30 @@ # dynamic hierachical data (the files in the Unix file system) # -import Tix, os +import tkinter.tix, os def RunSample(w): - top = Tix.Frame(w, relief=Tix.RAISED, bd=1) - tree = Tix.Tree(top, options='separator "/"') - tree.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.LEFT) + top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1) + tree = tkinter.tix.Tree(top, options='separator "/"') + tree.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.LEFT) tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir) # The / directory is added in the "open" mode. The user can open it # and then browse its subdirectories ... adddir(tree, "/") - box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) + box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, command=w.destroy, width=6) box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6) - box.pack(side=Tix.BOTTOM, fill=Tix.X) - top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) + box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X) + top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1) def adddir(tree, dir): if dir == '/': text = '/' else: text = os.path.basename(dir) - tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text, + tree.hlist.add(dir, itemtype=tkinter.tix.IMAGETEXT, text=text, image=tree.tk.call('tix', 'getimage', 'folder')) try: os.listdir(dir) @@ -71,10 +71,10 @@ if os.path.isdir(dir + '/' + file): adddir(tree, dir + '/' + file) else: - tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file, + tree.hlist.add(dir + '/' + file, itemtype=tkinter.tix.IMAGETEXT, text=file, image=tree.tk.call('tix', 'getimage', 'file')) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() Modified: python/branches/py3k-issue1717/Demo/tix/tixwidgets.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tix/tixwidgets.py (original) +++ python/branches/py3k-issue1717/Demo/tix/tixwidgets.py Sun Jan 25 21:08:20 2009 @@ -12,9 +12,9 @@ # % python tixwidgets.py # -import os, os.path, sys, Tix -from Tkconstants import * -import traceback, tkMessageBox +import os, os.path, sys, tkinter.tix +from tkinter.constants import * +import traceback, tkinter.messagebox TCL_DONT_WAIT = 1<<1 TCL_WINDOW_EVENTS = 1<<2 @@ -30,7 +30,7 @@ self.dir = None # script directory self.balloon = None # balloon widget - self.useBalloons = Tix.StringVar() + self.useBalloons = tkinter.tix.StringVar() self.useBalloons.set('0') self.statusbar = None # status bar widget self.welmsg = None # Msg widget @@ -56,14 +56,14 @@ def MkMainMenu(self): top = self.root - w = Tix.Frame(top, bd=2, relief=RAISED) - file = Tix.Menubutton(w, text='File', underline=0, takefocus=0) - help = Tix.Menubutton(w, text='Help', underline=0, takefocus=0) + w = tkinter.tix.Frame(top, bd=2, relief=RAISED) + file = tkinter.tix.Menubutton(w, text='File', underline=0, takefocus=0) + help = tkinter.tix.Menubutton(w, text='Help', underline=0, takefocus=0) file.pack(side=LEFT) help.pack(side=RIGHT) - fm = Tix.Menu(file, tearoff=0) + fm = tkinter.tix.Menu(file, tearoff=0) file['menu'] = fm - hm = Tix.Menu(help, tearoff=0) + hm = tkinter.tix.Menu(help, tearoff=0) help['menu'] = hm fm.add_command(label='Exit', underline=1, @@ -77,7 +77,7 @@ def MkMainNotebook(self): top = self.root - w = Tix.NoteBook(top, ipadx=5, ipady=5, options=""" + w = tkinter.tix.NoteBook(top, ipadx=5, ipady=5, options=""" tagPadX 6 tagPadY 4 borderWidth 2 @@ -103,8 +103,8 @@ global demo top = self.root - w = Tix.Frame(top, relief=Tix.RAISED, bd=1) - demo.statusbar = Tix.Label(w, relief=Tix.SUNKEN, bd=1) + w = tkinter.tix.Frame(top, relief=tkinter.tix.RAISED, bd=1) + demo.statusbar = tkinter.tix.Label(w, relief=tkinter.tix.SUNKEN, bd=1) demo.statusbar.form(padx=3, pady=3, left=0, right='%70') return w @@ -116,7 +116,7 @@ z.geometry('790x590+10+10') else: z.geometry('890x640+10+10') - demo.balloon = Tix.Balloon(root) + demo.balloon = tkinter.tix.Balloon(root) frame1 = self.MkMainMenu() frame2 = self.MkMainNotebook() frame3 = self.MkMainStatus() @@ -152,7 +152,7 @@ self.exit = 1 return except KeyboardInterrupt: - if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes': + if tkinter.messagebox.askquestion ('Interrupt', 'Really Quit?') == 'yes': # self.tk.eval('exit') self.exit = 1 return @@ -163,7 +163,7 @@ text = "" for line in traceback.format_exception(t,v,tb): text += line + '\n' - try: tkMessageBox.showerror ('Error', text) + try: tkinter.messagebox.showerror ('Error', text) except: pass self.exit = 1 raise SystemExit(1) @@ -191,9 +191,9 @@ def MkWelcomeBar(top): global demo - w = Tix.Frame(top, bd=2, relief=Tix.GROOVE) - b1 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) - b2 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) + w = tkinter.tix.Frame(top, bd=2, relief=tkinter.tix.GROOVE) + b1 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) + b2 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w)) b1.entry['width'] = 15 b1.slistbox.listbox['height'] = 3 b2.entry['width'] = 4 @@ -202,22 +202,22 @@ demo.welfont = b1 demo.welsize = b2 - b1.insert(Tix.END, 'Courier') - b1.insert(Tix.END, 'Helvetica') - b1.insert(Tix.END, 'Lucida') - b1.insert(Tix.END, 'Times Roman') - - b2.insert(Tix.END, '8') - b2.insert(Tix.END, '10') - b2.insert(Tix.END, '12') - b2.insert(Tix.END, '14') - b2.insert(Tix.END, '18') + b1.insert(tkinter.tix.END, 'Courier') + b1.insert(tkinter.tix.END, 'Helvetica') + b1.insert(tkinter.tix.END, 'Lucida') + b1.insert(tkinter.tix.END, 'Times Roman') + + b2.insert(tkinter.tix.END, '8') + b2.insert(tkinter.tix.END, '10') + b2.insert(tkinter.tix.END, '12') + b2.insert(tkinter.tix.END, '14') + b2.insert(tkinter.tix.END, '18') b1.pick(1) b2.pick(3) - b1.pack(side=Tix.LEFT, padx=4, pady=4) - b2.pack(side=Tix.LEFT, padx=4, pady=4) + b1.pack(side=tkinter.tix.LEFT, padx=4, pady=4) + b2.pack(side=tkinter.tix.LEFT, padx=4, pady=4) demo.balloon.bind_widget(b1, msg='Choose\na font', statusmsg='Choose a font for this page') @@ -228,20 +228,20 @@ def MkWelcomeText(top): global demo - w = Tix.ScrolledWindow(top, scrollbar='auto') + w = tkinter.tix.ScrolledWindow(top, scrollbar='auto') win = w.window text = 'Welcome to TIX in Python' - title = Tix.Label(win, - bd=0, width=30, anchor=Tix.N, text=text) - msg = Tix.Message(win, - bd=0, width=400, anchor=Tix.N, + title = tkinter.tix.Label(win, + bd=0, width=30, anchor=tkinter.tix.N, text=text) + msg = tkinter.tix.Message(win, + bd=0, width=400, anchor=tkinter.tix.N, text='Tix is a set of mega-widgets based on TK. This program \ demonstrates the widgets in the Tix widget set. You can choose the pages \ in this window to look at the corresponding widgets. \n\n\ To quit this program, choose the "File | Exit" command.\n\n\ For more information, see http://tix.sourceforge.net.') - title.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10) - msg.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10) + title.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10) + msg.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10) demo.welmsg = msg return w @@ -267,14 +267,14 @@ w = nb.page(name) options = "label.padX 4" - til = Tix.LabelFrame(w, label='Chooser Widgets', options=options) - cbx = Tix.LabelFrame(w, label='tixComboBox', options=options) - ctl = Tix.LabelFrame(w, label='tixControl', options=options) - sel = Tix.LabelFrame(w, label='tixSelect', options=options) - opt = Tix.LabelFrame(w, label='tixOptionMenu', options=options) - fil = Tix.LabelFrame(w, label='tixFileEntry', options=options) - fbx = Tix.LabelFrame(w, label='tixFileSelectBox', options=options) - tbr = Tix.LabelFrame(w, label='Tool Bar', options=options) + til = tkinter.tix.LabelFrame(w, label='Chooser Widgets', options=options) + cbx = tkinter.tix.LabelFrame(w, label='tixComboBox', options=options) + ctl = tkinter.tix.LabelFrame(w, label='tixControl', options=options) + sel = tkinter.tix.LabelFrame(w, label='tixSelect', options=options) + opt = tkinter.tix.LabelFrame(w, label='tixOptionMenu', options=options) + fil = tkinter.tix.LabelFrame(w, label='tixFileEntry', options=options) + fbx = tkinter.tix.LabelFrame(w, label='tixFileSelectBox', options=options) + tbr = tkinter.tix.LabelFrame(w, label='Tool Bar', options=options) MkTitle(til.frame) MkCombo(cbx.frame) @@ -301,38 +301,38 @@ fbx.form(right=-1, top=0, left='%66') def MkCombo(w): - options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 14) + options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 14) - static = Tix.ComboBox(w, label='Static', editable=0, options=options) - editable = Tix.ComboBox(w, label='Editable', editable=1, options=options) - history = Tix.ComboBox(w, label='History', editable=1, history=1, - anchor=Tix.E, options=options) - static.insert(Tix.END, 'January') - static.insert(Tix.END, 'February') - static.insert(Tix.END, 'March') - static.insert(Tix.END, 'April') - static.insert(Tix.END, 'May') - static.insert(Tix.END, 'June') - static.insert(Tix.END, 'July') - static.insert(Tix.END, 'August') - static.insert(Tix.END, 'September') - static.insert(Tix.END, 'October') - static.insert(Tix.END, 'November') - static.insert(Tix.END, 'December') - - editable.insert(Tix.END, 'Angola') - editable.insert(Tix.END, 'Bangladesh') - editable.insert(Tix.END, 'China') - editable.insert(Tix.END, 'Denmark') - editable.insert(Tix.END, 'Ecuador') - - history.insert(Tix.END, '/usr/bin/ksh') - history.insert(Tix.END, '/usr/local/lib/python') - history.insert(Tix.END, '/var/adm') - - static.pack(side=Tix.TOP, padx=5, pady=3) - editable.pack(side=Tix.TOP, padx=5, pady=3) - history.pack(side=Tix.TOP, padx=5, pady=3) + static = tkinter.tix.ComboBox(w, label='Static', editable=0, options=options) + editable = tkinter.tix.ComboBox(w, label='Editable', editable=1, options=options) + history = tkinter.tix.ComboBox(w, label='History', editable=1, history=1, + anchor=tkinter.tix.E, options=options) + static.insert(tkinter.tix.END, 'January') + static.insert(tkinter.tix.END, 'February') + static.insert(tkinter.tix.END, 'March') + static.insert(tkinter.tix.END, 'April') + static.insert(tkinter.tix.END, 'May') + static.insert(tkinter.tix.END, 'June') + static.insert(tkinter.tix.END, 'July') + static.insert(tkinter.tix.END, 'August') + static.insert(tkinter.tix.END, 'September') + static.insert(tkinter.tix.END, 'October') + static.insert(tkinter.tix.END, 'November') + static.insert(tkinter.tix.END, 'December') + + editable.insert(tkinter.tix.END, 'Angola') + editable.insert(tkinter.tix.END, 'Bangladesh') + editable.insert(tkinter.tix.END, 'China') + editable.insert(tkinter.tix.END, 'Denmark') + editable.insert(tkinter.tix.END, 'Ecuador') + + history.insert(tkinter.tix.END, '/usr/bin/ksh') + history.insert(tkinter.tix.END, '/usr/local/lib/python') + history.insert(tkinter.tix.END, '/var/adm') + + static.pack(side=tkinter.tix.TOP, padx=5, pady=3) + editable.pack(side=tkinter.tix.TOP, padx=5, pady=3) + history.pack(side=tkinter.tix.TOP, padx=5, pady=3) states = ['Bengal', 'Delhi', 'Karnataka', 'Tamil Nadu'] @@ -359,30 +359,30 @@ def MkControl(w): global demo_spintxt - options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 13) + options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 13) - demo_spintxt = Tix.StringVar() + demo_spintxt = tkinter.tix.StringVar() demo_spintxt.set(states[0]) - simple = Tix.Control(w, label='Numbers', options=options) - spintxt = Tix.Control(w, label='States', variable=demo_spintxt, + simple = tkinter.tix.Control(w, label='Numbers', options=options) + spintxt = tkinter.tix.Control(w, label='States', variable=demo_spintxt, options=options) spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1) spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1) spintxt['validatecmd'] = lambda w=spintxt: spin_validate(w) - simple.pack(side=Tix.TOP, padx=5, pady=3) - spintxt.pack(side=Tix.TOP, padx=5, pady=3) + simple.pack(side=tkinter.tix.TOP, padx=5, pady=3) + spintxt.pack(side=tkinter.tix.TOP, padx=5, pady=3) def MkSelect(w): - options = "label.anchor %s" % Tix.CENTER + options = "label.anchor %s" % tkinter.tix.CENTER - sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1, - orientation=Tix.VERTICAL, - labelside=Tix.TOP, + sel1 = tkinter.tix.Select(w, label='Mere Mortals', allowzero=1, radio=1, + orientation=tkinter.tix.VERTICAL, + labelside=tkinter.tix.TOP, options=options) - sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0, - orientation=Tix.VERTICAL, - labelside= Tix.TOP, + sel2 = tkinter.tix.Select(w, label='Geeks', allowzero=1, radio=0, + orientation=tkinter.tix.VERTICAL, + labelside= tkinter.tix.TOP, options=options) sel1.add('eat', text='Eat') @@ -397,13 +397,13 @@ sel2.add('prog3', text='Program') sel2.add('sleep', text='Sleep') - sel1.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X) - sel2.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X) + sel1.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X) + sel2.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X) def MkOptMenu(w): - options='menubutton.width 15 label.anchor %s' % Tix.E + options='menubutton.width 15 label.anchor %s' % tkinter.tix.E - m = Tix.OptionMenu(w, label='File Format : ', options=options) + m = tkinter.tix.OptionMenu(w, label='File Format : ', options=options) m.add_command('text', label='Plain Text') m.add_command('post', label='PostScript') m.add_command('format', label='Formatted Text') @@ -412,27 +412,27 @@ m.add_command('tex', label='LaTeX') m.add_command('rtf', label='Rich Text Format') - m.pack(fill=Tix.X, padx=5, pady=3) + m.pack(fill=tkinter.tix.X, padx=5, pady=3) def MkFileEnt(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='Press the "open file" icon button and a TixFileSelectDialog will popup.') - ent = Tix.FileEntry(w, label='Select a file : ') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - ent.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) + ent = tkinter.tix.FileEntry(w, label='Select a file : ') + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + ent.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) def MkFileBox(w): """The FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.') - box = Tix.FileSelectBox(w) - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - box.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) + box = tkinter.tix.FileSelectBox(w) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + box.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) def MkToolBar(w): """The Select widget is also good for arranging buttons in a tool bar. @@ -441,12 +441,12 @@ options='frame.borderWidth 1' - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Select widget is also good for arranging buttons in a tool bar.') - bar = Tix.Frame(w, bd=2, relief=Tix.RAISED) - font = Tix.Select(w, allowzero=1, radio=0, label='', options=options) - para = Tix.Select(w, allowzero=0, radio=1, label='', options=options) + bar = tkinter.tix.Frame(w, bd=2, relief=tkinter.tix.RAISED) + font = tkinter.tix.Select(w, allowzero=1, radio=0, label='', options=options) + para = tkinter.tix.Select(w, allowzero=0, radio=1, label='', options=options) font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm') font.add('italic', bitmap='@' + demo.dir + '/bitmaps/italic.xbm') @@ -458,24 +458,24 @@ para.add('center', bitmap='@' + demo.dir + '/bitmaps/centerj.xbm') para.add('justify', bitmap='@' + demo.dir + '/bitmaps/justify.xbm') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - bar.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3) - font.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3) - para.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + bar.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3) + font.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3) + para.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3) def MkTitle(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='There are many types of "chooser" widgets that allow the user to input different types of information') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) def MkScroll(nb, name): w = nb.page(name) options='label.padX 4' - sls = Tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options) - swn = Tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options) - stx = Tix.LabelFrame(w, label='Tix.ScrolledText', options=options) + sls = tkinter.tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options) + swn = tkinter.tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options) + stx = tkinter.tix.LabelFrame(w, label='Tix.ScrolledText', options=options) MkSList(sls.frame) MkSWindow(swn.frame) @@ -490,31 +490,31 @@ """This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear. """ - top = Tix.Frame(w, width=300, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=300, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.') - list = Tix.ScrolledListBox(top, scrollbar='auto') + list = tkinter.tix.ScrolledListBox(top, scrollbar='auto') list.place(x=50, y=150, width=120, height=80) - list.listbox.insert(Tix.END, 'Alabama') - list.listbox.insert(Tix.END, 'California') - list.listbox.insert(Tix.END, 'Montana') - list.listbox.insert(Tix.END, 'New Jersey') - list.listbox.insert(Tix.END, 'New York') - list.listbox.insert(Tix.END, 'Pennsylvania') - list.listbox.insert(Tix.END, 'Washington') + list.listbox.insert(tkinter.tix.END, 'Alabama') + list.listbox.insert(tkinter.tix.END, 'California') + list.listbox.insert(tkinter.tix.END, 'Montana') + list.listbox.insert(tkinter.tix.END, 'New Jersey') + list.listbox.insert(tkinter.tix.END, 'New York') + list.listbox.insert(tkinter.tix.END, 'Pennsylvania') + list.listbox.insert(tkinter.tix.END, 'Washington') - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) list.bind('', func=lambda arg=0, rh=rh, list=list: list.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(list))) @@ -535,29 +535,29 @@ if not os.path.isfile(file): text += ' (Image missing)' - top = Tix.Frame(w, width=330, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=330, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text=text) - win = Tix.ScrolledWindow(top, scrollbar='auto') + win = tkinter.tix.ScrolledWindow(top, scrollbar='auto') image1 = win.window.image_create('photo', file=file) - lbl = Tix.Label(win.window, image=image1) - lbl.pack(expand=1, fill=Tix.BOTH) + lbl = tkinter.tix.Label(win.window, image=image1) + lbl.pack(expand=1, fill=tkinter.tix.BOTH) win.place(x=30, y=150, width=190, height=120) - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) win.bind('', func=lambda arg=0, rh=rh, win=win: win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win))) @@ -570,15 +570,15 @@ def MkSText(w): """The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.""" - top = Tix.Frame(w, width=330, height=330) - bot = Tix.Frame(w) - msg = Tix.Message(top, - relief=Tix.FLAT, width=200, anchor=Tix.N, + top = tkinter.tix.Frame(w, width=330, height=330) + bot = tkinter.tix.Frame(w) + msg = tkinter.tix.Message(top, + relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N, text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') - win = Tix.ScrolledText(top, scrollbar='auto') + win = tkinter.tix.ScrolledText(top, scrollbar='auto') win.text['wrap'] = 'none' - win.text.insert(Tix.END, '''When -scrollbar is set to "auto", the + win.text.insert(tkinter.tix.END, '''When -scrollbar is set to "auto", the scrollbars are shown only when needed. Additional modifiers can be used to force a scrollbar to be shown or hidden. For example, @@ -591,15 +591,15 @@ ) win.place(x=30, y=150, width=190, height=100) - rh = Tix.ResizeHandle(top, bg='black', - relief=Tix.RAISED, + rh = tkinter.tix.ResizeHandle(top, bg='black', + relief=tkinter.tix.RAISED, handlesize=8, gridded=1, minwidth=50, minheight=30) - btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x)) + btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x)) top.propagate(0) - msg.pack(fill=Tix.X) - btn.pack(anchor=Tix.CENTER) - top.pack(expand=1, fill=Tix.BOTH) - bot.pack(fill=Tix.BOTH) + msg.pack(fill=tkinter.tix.X) + btn.pack(anchor=tkinter.tix.CENTER) + top.pack(expand=1, fill=tkinter.tix.BOTH) + bot.pack(fill=tkinter.tix.BOTH) win.bind('', func=lambda arg=0, rh=rh, win=win: win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win))) @@ -612,8 +612,8 @@ w = nb.page(name) options='label.padX 4' - pane = Tix.LabelFrame(w, label='Tix.PanedWindow', options=options) - note = Tix.LabelFrame(w, label='Tix.NoteBook', options=options) + pane = tkinter.tix.LabelFrame(w, label='Tix.PanedWindow', options=options) + note = tkinter.tix.LabelFrame(w, label='Tix.NoteBook', options=options) MkPanedWindow(pane.frame) MkNoteBook(note.frame) @@ -626,29 +626,29 @@ the sizes of several panes. The panes can be arranged either vertically or horizontally. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') - group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') + group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') - pane = Tix.PanedWindow(w, orientation='vertical') + pane = tkinter.tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) - list = Tix.ScrolledListBox(p1) - text = Tix.ScrolledText(p2) + list = tkinter.tix.ScrolledListBox(p1) + text = tkinter.tix.ScrolledText(p2) - list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") - list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") - list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health") + list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") + list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' - text.text.insert(Tix.END, """ + text.text.insert(tkinter.tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi at blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania @@ -661,71 +661,71 @@ support the -image option. For example, you can display a text string string together with a bitmap, at the same time, inside a TK button widget. """) - list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) - text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) + list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) + text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6) - msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) + msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1) def MkNoteBook(w): - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The NoteBook widget allows you to layout a complex interface into individual pages.') # prefix = Tix.OptionName(w) # if not prefix: prefix = '' # w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8) - options = "entry.width %d label.width %d label.anchor %s" % (10, 18, Tix.E) + options = "entry.width %d label.width %d label.anchor %s" % (10, 18, tkinter.tix.E) - nb = Tix.NoteBook(w, ipadx=6, ipady=6, options=options) + nb = tkinter.tix.NoteBook(w, ipadx=6, ipady=6, options=options) nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('network', label="Network", underline=0) # Frame for the buttons that are present on all pages - common = Tix.Frame(nb.hard_disk) - common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y) + common = tkinter.tix.Frame(nb.hard_disk) + common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y) CreateCommonButtons(common) # Widgets belonging only to this page - a = Tix.Control(nb.hard_disk, value=12, label='Access Time: ') - w = Tix.Control(nb.hard_disk, value=400, label='Write Throughput: ') - r = Tix.Control(nb.hard_disk, value=400, label='Read Throughput: ') - c = Tix.Control(nb.hard_disk, value=1021, label='Capacity: ') - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(nb.hard_disk, value=12, label='Access Time: ') + w = tkinter.tix.Control(nb.hard_disk, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(nb.hard_disk, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(nb.hard_disk, value=1021, label='Capacity: ') + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) - common = Tix.Frame(nb.network) - common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y) + common = tkinter.tix.Frame(nb.network) + common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y) CreateCommonButtons(common) - a = Tix.Control(nb.network, value=12, label='Access Time: ') - w = Tix.Control(nb.network, value=400, label='Write Throughput: ') - r = Tix.Control(nb.network, value=400, label='Read Throughput: ') - c = Tix.Control(nb.network, value=1021, label='Capacity: ') - u = Tix.Control(nb.network, value=10, label='Users: ') - a.pack(side=Tix.TOP, padx=20, pady=2) - w.pack(side=Tix.TOP, padx=20, pady=2) - r.pack(side=Tix.TOP, padx=20, pady=2) - c.pack(side=Tix.TOP, padx=20, pady=2) - u.pack(side=Tix.TOP, padx=20, pady=2) + a = tkinter.tix.Control(nb.network, value=12, label='Access Time: ') + w = tkinter.tix.Control(nb.network, value=400, label='Write Throughput: ') + r = tkinter.tix.Control(nb.network, value=400, label='Read Throughput: ') + c = tkinter.tix.Control(nb.network, value=1021, label='Capacity: ') + u = tkinter.tix.Control(nb.network, value=10, label='Users: ') + a.pack(side=tkinter.tix.TOP, padx=20, pady=2) + w.pack(side=tkinter.tix.TOP, padx=20, pady=2) + r.pack(side=tkinter.tix.TOP, padx=20, pady=2) + c.pack(side=tkinter.tix.TOP, padx=20, pady=2) + u.pack(side=tkinter.tix.TOP, padx=20, pady=2) - msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) - nb.pack(side=Tix.TOP, padx=5, pady=5, fill=Tix.BOTH, expand=1) + msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH) + nb.pack(side=tkinter.tix.TOP, padx=5, pady=5, fill=tkinter.tix.BOTH, expand=1) def CreateCommonButtons(f): - ok = Tix.Button(f, text='OK', width = 6) - cancel = Tix.Button(f, text='Cancel', width = 6) - ok.pack(side=Tix.TOP, padx=2, pady=2) - cancel.pack(side=Tix.TOP, padx=2, pady=2) + ok = tkinter.tix.Button(f, text='OK', width = 6) + cancel = tkinter.tix.Button(f, text='Cancel', width = 6) + ok.pack(side=tkinter.tix.TOP, padx=2, pady=2) + cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2) def MkDirList(nb, name): w = nb.page(name) options = "label.padX 4" - dir = Tix.LabelFrame(w, label='Tix.DirList', options=options) - fsbox = Tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options) + dir = tkinter.tix.LabelFrame(w, label='Tix.DirList', options=options) + fsbox = tkinter.tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options) MkDirListWidget(dir.frame) MkExFileWidget(fsbox.frame) dir.form(top=0, left=0, right='%40', bottom=-1) @@ -736,23 +736,23 @@ system directory and makes it easy for the user to choose and access directories. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix DirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.') - dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16') - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - dirlist.pack(side=Tix.TOP, padx=3, pady=3) + dirlist = tkinter.tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16') + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + dirlist.pack(side=tkinter.tix.TOP, padx=3, pady=3) def MkExFileWidget(w): """The TixExFileSelectBox widget is more user friendly than the Motif style FileSelectBox. """ - msg = Tix.Message(w, - relief=Tix.FLAT, width=240, anchor=Tix.N, + msg = tkinter.tix.Message(w, + relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N, text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.') # There's a bug in the ComboBoxes - the scrolledlistbox is destroyed - box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED) - msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) - box.pack(side=Tix.TOP, padx=3, pady=3) + box = tkinter.tix.ExFileSelectBox(w, bd=2, relief=tkinter.tix.RAISED) + msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3) + box.pack(side=tkinter.tix.TOP, padx=3, pady=3) ### ### List of all the demos we want to show off @@ -875,39 +875,39 @@ w = nb.page(name) options = "label.padX 4" - pane = Tix.PanedWindow(w, orientation='horizontal') - pane.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH) + pane = tkinter.tix.PanedWindow(w, orientation='horizontal') + pane.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH) f1 = pane.add('list', expand='1') f2 = pane.add('text', expand='5') f1['relief'] = 'flat' f2['relief'] = 'flat' - lab = Tix.LabelFrame(f1, label='Select a sample program:') - lab.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5) - lab1 = Tix.LabelFrame(f2, label='Source:') - lab1.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5) + lab = tkinter.tix.LabelFrame(f1, label='Select a sample program:') + lab.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5) + lab1 = tkinter.tix.LabelFrame(f2, label='Source:') + lab1.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5) - slb = Tix.Tree(lab.frame, options='hlist.width 20') - slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5) + slb = tkinter.tix.Tree(lab.frame, options='hlist.width 20') + slb.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5) - stext = Tix.ScrolledText(lab1.frame, name='stext') + stext = tkinter.tix.ScrolledText(lab1.frame, name='stext') font = root.tk.eval('tix option get fixed_font') stext.text.config(font=font) - frame = Tix.Frame(lab1.frame, name='frame') + frame = tkinter.tix.Frame(lab1.frame, name='frame') - run = Tix.Button(frame, text='Run ...', name='run') - view = Tix.Button(frame, text='View Source ...', name='view') - run.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) - view.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) + run = tkinter.tix.Button(frame, text='Run ...', name='run') + view = tkinter.tix.Button(frame, text='View Source ...', name='view') + run.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE) + view.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE) stext.text['bg'] = slb.hlist['bg'] stext.text['state'] = 'disabled' stext.text['wrap'] = 'none' stext.text['width'] = 80 - frame.pack(side=Tix.BOTTOM, expand=0, fill=Tix.X, padx=7) - stext.pack(side=Tix.TOP, expand=0, fill=Tix.BOTH, padx=7) + frame.pack(side=tkinter.tix.BOTTOM, expand=0, fill=tkinter.tix.X, padx=7) + stext.pack(side=tkinter.tix.TOP, expand=0, fill=tkinter.tix.BOTH, padx=7) slb.hlist['separator'] = '.' slb.hlist['width'] = 25 @@ -922,13 +922,13 @@ for type in ['widget', 'image']: if type != 'widget': - x = Tix.Frame(slb.hlist, bd=2, height=2, width=150, - relief=Tix.SUNKEN, bg=slb.hlist['bg']) - slb.hlist.add_child(itemtype=Tix.WINDOW, window=x, state='disabled') - x = slb.hlist.add_child(itemtype=Tix.TEXT, state='disabled', + x = tkinter.tix.Frame(slb.hlist, bd=2, height=2, width=150, + relief=tkinter.tix.SUNKEN, bg=slb.hlist['bg']) + slb.hlist.add_child(itemtype=tkinter.tix.WINDOW, window=x, state='disabled') + x = slb.hlist.add_child(itemtype=tkinter.tix.TEXT, state='disabled', text=comments[type]) for key in stypes[type]: - slb.hlist.add_child(x, itemtype=Tix.TEXT, data=key, + slb.hlist.add_child(x, itemtype=tkinter.tix.TEXT, data=key, text=key) slb.hlist.selection_clear() @@ -955,12 +955,12 @@ if action == 'run': exec('import ' + prog) - w = Tix.Toplevel() + w = tkinter.tix.Toplevel() w.title(title) rtn = eval(prog + '.RunSample') rtn(w) elif action == 'view': - w = Tix.Toplevel() + w = tkinter.tix.Toplevel() w.title('Source view: ' + title) LoadFile(w, demo.dir + '/samples/' + prog + '.py') elif action == 'browse': @@ -968,8 +968,8 @@ def LoadFile(w, fname): global root - b = Tix.Button(w, text='Close', command=w.destroy) - t = Tix.ScrolledText(w) + b = tkinter.tix.Button(w, text='Close', command=w.destroy) + t = tkinter.tix.ScrolledText(w) # b.form(left=0, bottom=0, padx=4, pady=4) # t.form(left=0, bottom=b, right='-0', top=0) t.pack() @@ -985,18 +985,18 @@ def ReadFile(w, fname): old_state = w['state'] w['state'] = 'normal' - w.delete('0.0', Tix.END) + w.delete('0.0', tkinter.tix.END) try: f = open(fname) lines = f.readlines() for s in lines: - w.insert(Tix.END, s) + w.insert(tkinter.tix.END, s) f.close() finally: # w.see('1.0') w['state'] = old_state if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunMain(root) Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py Sun Jan 25 21:08:20 2009 @@ -12,7 +12,7 @@ # -- totally static, though different between PackDialog and WidgetDialog # (but even that could be unified) -from Tkinter import * +from tkinter import * class Option: Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py Sun Jan 25 21:08:20 2009 @@ -1,9 +1,9 @@ # Widget to display a man page import re -from Tkinter import * -from Tkinter import _tkinter -from ScrolledText import ScrolledText +from tkinter import * +from tkinter import _tkinter +from tkinter.scrolledtext import ScrolledText # XXX These fonts may have to be changed to match your system BOLDFONT = '*-Courier-Bold-R-Normal-*-120-*' Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py Sun Jan 25 21:08:20 2009 @@ -5,8 +5,8 @@ import string from types import * -from Tkinter import * -from ScrolledText import ScrolledText +from tkinter import * +from tkinter.scrolledtext import ScrolledText class MimeViewer: def __init__(self, parent, title, msg): Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py Sun Jan 25 21:08:20 2009 @@ -1,9 +1,9 @@ import os import sys import string -from Tkinter import * -from ScrolledText import ScrolledText -from Dialog import Dialog +from tkinter import * +from tkinter.scrolledtext import ScrolledText +from tkinter.dialog import Dialog import signal BUFSIZE = 512 Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py Sun Jan 25 21:08:20 2009 @@ -1,6 +1,6 @@ # Brownian motion -- an example of a multi-threaded Tkinter program. -from Tkinter import * +from tkinter import * import random import threading import time Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py Sun Jan 25 21:08:20 2009 @@ -1,7 +1,7 @@ # Brownian motion -- an example of a NON multi-threaded Tkinter program ;) # By Michele Simoniato, inspired by brownian.py -from Tkinter import * +from tkinter import * import random import sys Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py Sun Jan 25 21:08:20 2009 @@ -1,6 +1,6 @@ #! /usr/bin/env python -from Tkinter import * +from tkinter import * from Canvas import Oval, Group, CanvasText Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py Sun Jan 25 21:08:20 2009 @@ -4,7 +4,7 @@ # optional bitmap, and any number of buttons. # Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270. -from Tkinter import * +from tkinter import * import sys Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py Sun Jan 25 21:08:20 2009 @@ -11,7 +11,7 @@ # /usr/include/X11/bitmaps for samples); it is displayed as the # background of the animation. Default is no bitmap. -from Tkinter import * +from tkinter import * import random Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py Sun Jan 25 21:08:20 2009 @@ -10,7 +10,7 @@ # background of the animation. Default is no bitmap. # This uses Steen Lumholt's Tk interface -from Tkinter import * +from tkinter import * # Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py Sun Jan 25 21:08:20 2009 @@ -1,7 +1,7 @@ # Display hello, world in a button; clicking it quits the program import sys -from Tkinter import * +from tkinter import * def main(): root = Tk() Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py Sun Jan 25 21:08:20 2009 @@ -1,6 +1,6 @@ """Draw on top of an image""" -from Tkinter import * +from tkinter import * import sys def main(): Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import sys def main(): Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py Sun Jan 25 21:08:20 2009 @@ -1,7 +1,7 @@ #! /usr/bin/env python # Tkinter interface to Linux `kill' command. -from Tkinter import * +from tkinter import * from string import splitfields from string import split import subprocess Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py Sun Jan 25 21:08:20 2009 @@ -3,7 +3,7 @@ import sys import string -from Tkinter import * +from tkinter import * def listtree(master, app): list = Listbox(master, name='list') Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py Sun Jan 25 21:08:20 2009 @@ -9,7 +9,7 @@ import string import mhlib -from Tkinter import * +from tkinter import * from dialog import dialog Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py Sun Jan 25 21:08:20 2009 @@ -2,7 +2,7 @@ """Play with the new Tk 8.0 toplevel menu option.""" -from Tkinter import * +from tkinter import * class App: Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py Sun Jan 25 21:08:20 2009 @@ -1,6 +1,6 @@ # option menu sample (Fredrik Lundh, September 1997) -from Tkinter import * +from tkinter import * root = Tk() Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py Sun Jan 25 21:08:20 2009 @@ -20,7 +20,7 @@ davem at magnet.com """ -from Tkinter import * +from tkinter import * """paint.py: not exactly a paint program.. just a smooth line drawing demo.""" Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py Sun Jan 25 21:08:20 2009 @@ -11,7 +11,7 @@ # XXX This should be written in a more Python-like style!!! -from Tkinter import * +from tkinter import * import sys # 1. Create basic application structure: menu bar on top of Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py Sun Jan 25 21:08:20 2009 @@ -25,7 +25,7 @@ import math import random -from Tkinter import * +from tkinter import * from Canvas import Rectangle, CanvasText, Group, Window Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py Sun Jan 25 21:08:20 2009 @@ -19,7 +19,7 @@ """ -from Tkinter import * +from tkinter import * from Canvas import Line, Rectangle import random Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py Sun Jan 25 21:08:20 2009 @@ -485,7 +485,7 @@ s = chr(m+ord('A')) + s return s -import Tkinter as Tk +import tkinter as Tk class SheetGUI: Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py Sun Jan 25 21:08:20 2009 @@ -2,7 +2,7 @@ # Tkinter interface to SYSV `ps' and `kill' commands. -from Tkinter import * +from tkinter import * if TkVersion < 4.0: raise ImportError("This version of svkill requires Tk 4.0 or later") Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py Sun Jan 25 21:08:20 2009 @@ -1,6 +1,6 @@ # Show how to do switchable panels. -from Tkinter import * +from tkinter import * class App: Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py Sun Jan 25 21:08:20 2009 @@ -6,7 +6,7 @@ import os import string import re -from Tkinter import * +from tkinter import * from ManPage import ManPage MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann'] Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # note that there is no explicit call to start Tk. # Tkinter is smart enough to start the system if it's not already going. Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This program shows how to use the "after" function to make animation. Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to use a simple type-in box Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this program creates a canvas and puts a single polygon on the canvas Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates a more sophisticated movement -- # move dots or create new ones if you click outside the dots Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the movement of a single canvas item under mouse control Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # allows moving dots with multiple selection. Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the creation of widgets as part of a canvas object Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This example program creates a scroling canvas, and demonstrates # how to tie scrollbars and canvses together. The mechanism Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ -from Tkinter import * -from Dialog import Dialog +from tkinter import * +from tkinter.dialog import Dialog # this shows how to create a new window with a button in it # that can create new windows Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to use a simple type-in box Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string # This program shows how to make a typein box shadow a program variable. Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This file shows how to trap the killing of a window # when the user uses window manager menus (typ. upper left hand corner Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that tests the placer geom manager in conjunction with # the packer. The background (green) is packed, while the widget inside is placed Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that tests the placer geom manager Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import string Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this file demonstrates the creation of widgets as part of a canvas object Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a demo program that shows how to # create radio buttons and how to get other widgets to Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): def printit(self): Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * class Test(Frame): def printit(self): Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # shows how to make a slider, set and get its value under program control Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # This is a program that makes a simple two button application Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # The way to think about this is that each radio button menu # controls a different variable -- clicking on one of the Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this shows how to create a new window with a button in it # that can create new windows Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * # this shows how to spawn off new windows at a button press Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py (original) +++ python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -from Tkinter import * +from tkinter import * import sys ##sys.path.append("/users/mjc4y/projects/python/tkinter/utils") Modified: python/branches/py3k-issue1717/Doc/ACKS.txt ============================================================================== --- python/branches/py3k-issue1717/Doc/ACKS.txt (original) +++ python/branches/py3k-issue1717/Doc/ACKS.txt Sun Jan 25 21:08:20 2009 @@ -60,6 +60,7 @@ * Peter Funk * Lele Gaifax * Matthew Gallagher + * Gabriel Genellina * Ben Gertzfield * Nadim Ghaznavi * Jonathan Giddy Modified: python/branches/py3k-issue1717/Doc/Makefile ============================================================================== --- python/branches/py3k-issue1717/Doc/Makefile (original) +++ python/branches/py3k-issue1717/Doc/Makefile Sun Jan 25 21:08:20 2009 @@ -14,7 +14,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html htmlhelp clean coverage dist +.PHONY: help checkout update build html htmlhelp clean coverage dist check help: @echo "Please use \`make ' where is one of" @@ -24,6 +24,7 @@ @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" + @echo " suspicious to check for suspicious markup in output text" @echo " coverage to check documentation coverage for library and C API" @echo " dist to create a \"dist\" directory with archived docs for download" @@ -36,9 +37,9 @@ echo "Checking out Docutils..."; \ svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \ fi - @if [ ! -d tools/jinja ]; then \ + @if [ ! -d tools/jinja2 ]; then \ echo "Checking out Jinja..."; \ - svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \ + svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \ fi @if [ ! -d tools/pygments ]; then \ echo "Checking out Pygments..."; \ @@ -48,7 +49,7 @@ update: checkout svn update tools/sphinx svn update tools/docutils - svn update tools/jinja + svn update tools/jinja2 svn update tools/pygments build: checkout @@ -84,6 +85,11 @@ @echo "Link check complete; look for any errors in the above output " \ "or in build/$(BUILDER)/output.txt" +suspicious: BUILDER = suspicious +suspicious: build + @echo "Suspicious check complete; look for any errors in the above output " \ + "or in build/$(BUILDER)/suspicious.txt" + coverage: BUILDER = coverage coverage: build @echo "Coverage finished; see c.txt and python.txt in build/coverage" @@ -141,3 +147,5 @@ cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 +check: + $(PYTHON) tools/rstlint.py -i tools Modified: python/branches/py3k-issue1717/Doc/c-api/allocation.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/allocation.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/allocation.rst Sun Jan 25 21:08:20 2009 @@ -54,40 +54,15 @@ accessed after this call as the memory is no longer a valid Python object. -.. cfunction:: PyObject* Py_InitModule(char *name, PyMethodDef *methods) - - Create a new module object based on a name and table of functions, returning - the new module object; the *methods* argument can be *NULL* if no methods are - to be defined for the module. - - -.. cfunction:: PyObject* Py_InitModule3(char *name, PyMethodDef *methods, char *doc) - - Create a new module object based on a name and table of functions, returning - the new module object. The *methods* argument can be *NULL* if no methods - are to be defined for the module. If *doc* is non-*NULL*, it will be used to - define the docstring for the module. - - -.. cfunction:: PyObject* Py_InitModule4(char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver) - - Create a new module object based on a name and table of functions, returning - the new module object. The *methods* argument can be *NULL* if no methods - are to be defined for the module. If *doc* is non-*NULL*, it will be used to - define the docstring for the module. If *self* is non-*NULL*, it will passed - to the functions of the module as their (otherwise *NULL*) first parameter. - (This was added as an experimental feature, and there are no known uses in - the current version of Python.) For *apiver*, the only value which should be - passed is defined by the constant :const:`PYTHON_API_VERSION`. - - .. note:: - - Most uses of this function should probably be using the :cfunc:`Py_InitModule3` - instead; only use this if you are sure you need it. - - .. cvar:: PyObject _Py_NoneStruct Object which is visible in Python as ``None``. This should only be accessed using the :cmacro:`Py_None` macro, which evaluates to a pointer to this object. + + +.. seealso:: + + :cfunc:`PyModule_Create` + To allocate and create extension modules. + Modified: python/branches/py3k-issue1717/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/arg.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/arg.rst Sun Jan 25 21:08:20 2009 @@ -53,8 +53,9 @@ string may contain embedded null bytes. Unicode objects pass back a pointer to the default encoded string version of the object if such a conversion is possible. All other read-buffer compatible objects pass back a reference to - the raw internal data representation. Since this format doesn't allow writable buffer compatible objects like byte - arrays, ``s*`` is to be preferred. + the raw internal data representation. Since this format doesn't allow + writable buffer compatible objects like byte arrays, ``s*`` is to be + preferred. The type of the length argument (int or :ctype:`Py_ssize_t`) is controlled by defining the macro :cmacro:`PY_SSIZE_T_CLEAN` before including @@ -488,11 +489,11 @@ ``H`` (integer) [unsigned short int] Convert a C :ctype:`unsigned short int` to a Python integer object. - ``I`` (integer/long) [unsigned int] - Convert a C :ctype:`unsigned int` to a Python long integer object. + ``I`` (integer) [unsigned int] + Convert a C :ctype:`unsigned int` to a Python integer object. - ``k`` (integer/long) [unsigned long] - Convert a C :ctype:`unsigned long` to a Python long integer object. + ``k`` (integer) [unsigned long] + Convert a C :ctype:`unsigned long` to a Python integer object. ``L`` (long) [PY_LONG_LONG] Convert a C :ctype:`long long` to a Python integer object. Only available Modified: python/branches/py3k-issue1717/Doc/c-api/buffer.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/buffer.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/buffer.rst Sun Jan 25 21:08:20 2009 @@ -31,7 +31,7 @@ .. index:: single: PyBufferProcs -More information on the buffer interface is provided in the section +More information on the buffer interface is provided in the section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`. Buffer objects are useful as a way to expose the data from another object's @@ -104,7 +104,7 @@ pointer += strides[i] * indices[i]; if (suboffsets[i] >=0 ) { pointer = *((char**)pointer) + suboffsets[i]; - } + } } return (void*)pointer; } Modified: python/branches/py3k-issue1717/Doc/c-api/bytes.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/bytes.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/bytes.rst Sun Jan 25 21:08:20 2009 @@ -192,9 +192,3 @@ reallocation fails, the original bytes object at *\*bytes* is deallocated, *\*bytes* is set to *NULL*, a memory exception is set, and ``-1`` is returned. - - -.. cfunction:: PyObject* PyBytes_Format(PyObject *format, PyObject *args) - - Return a new bytes object from *format* and *args*. Analogous to ``format % - args``. The *args* argument must be a tuple. Modified: python/branches/py3k-issue1717/Doc/c-api/conversion.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/conversion.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/conversion.rst Sun Jan 25 21:08:20 2009 @@ -80,7 +80,7 @@ See the Unix man page :manpage:`atof(2)` for details. - + .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) Case insensitive comparison of strings. The function works almost Modified: python/branches/py3k-issue1717/Doc/c-api/file.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/file.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/file.rst Sun Jan 25 21:08:20 2009 @@ -22,7 +22,7 @@ .. warning:: - Take care when you are mixing streams and descriptors! For more + Take care when you are mixing streams and descriptors! For more information, see `the GNU C Library docs `_. Modified: python/branches/py3k-issue1717/Doc/c-api/init.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/init.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/init.rst Sun Jan 25 21:08:20 2009 @@ -765,6 +765,50 @@ :cfunc:`PyGILState_Release` on the same thread. + +Asynchronous Notifications +========================== + +A mechanism is provided to make asynchronous notifications to the the main +interpreter thread. These notifications take the form of a function +pointer and a void argument. + +.. index:: single: setcheckinterval() (in module sys) + +Every check interval, when the interpreter lock is released and reacquired, +python will also call any such provided functions. This can be used for +example by asynchronous IO handlers. The notification can be scheduled +from a worker thread and the actual call than made at the earliest +convenience by the main thread where it has possession of the global +interpreter lock and can perform any Python API calls. + +.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) ) + + .. index:: single: Py_AddPendingCall() + + Post a notification to the Python main thread. If successful, + *func* will be called with the argument *arg* at the earliest + convenience. *func* will be called having the global interpreter + lock held and can thus use the full Python API and can take any + action such as setting object attributes to signal IO completion. + It must return 0 on success, or -1 signalling an exception. + The notification function won't be interrupted to perform another + asynchronous notification recursively, + but it can still be interrupted to switch threads if the interpreter + lock is released, for example, if it calls back into python code. + + This function returns 0 on success in which case the notification has been + scheduled. Otherwise, for example if the notification buffer is full, + it returns -1 without setting any exception. + + This function can be called on any thread, be it a Python thread or + some other system thread. If it is a Python thread, it doesen't matter if + it holds the global interpreter lock or not. + + .. versionadded:: 2.7 + + + .. _profiling: Profiling and Tracing @@ -885,7 +929,7 @@ Return a tuple of function call counts. There are constants defined for the positions within the tuple: - + +-------------------------------+-------+ | Name | Value | +===============================+=======+ @@ -911,7 +955,7 @@ +-------------------------------+-------+ | :const:`PCALL_POP` | 10 | +-------------------------------+-------+ - + :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used. Modified: python/branches/py3k-issue1717/Doc/c-api/intro.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/intro.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/intro.rst Sun Jan 25 21:08:20 2009 @@ -607,7 +607,7 @@ * Sanity checks of the input arguments are added to frame creation. -* The storage for long ints is initialized with a known invalid pattern to catch +* The storage for ints is initialized with a known invalid pattern to catch reference to uninitialized digits. * Low-level tracing and extra exception checking are added to the runtime Modified: python/branches/py3k-issue1717/Doc/c-api/long.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/long.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/long.rst Sun Jan 25 21:08:20 2009 @@ -107,7 +107,7 @@ retrieved from the resulting value using :cfunc:`PyLong_AsVoidPtr`. -.. XXX alias PyLong_AS_LONG (for now) +.. XXX alias PyLong_AS_LONG (for now) .. cfunction:: long PyLong_AsLong(PyObject *pylong) .. index:: @@ -123,7 +123,7 @@ Return a C :ctype:`long` representation of the contents of *pylong*. If *pylong* is greater than :const:`LONG_MAX`, return -1 and - set `*overflow` to 1 (for overflow) or -1 (for underflow). + set `*overflow` to 1 (for overflow) or -1 (for underflow). If an exception is set because of type errors, also return -1. Modified: python/branches/py3k-issue1717/Doc/c-api/module.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/module.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/module.rst Sun Jan 25 21:08:20 2009 @@ -73,6 +73,101 @@ raise :exc:`SystemError` and return *NULL*. +.. cfunction:: void* PyModule_GetState(PyObject *module) + + Return the "state" of the module, that is, a pointer to the block of memory + allocated at module creation time, or *NULL*. See + :cmember:`PyModuleDef.m_size`. + + +.. cfunction:: PyModuleDef* PyModule_GetDef(PyObject *module) + + Return a pointer to the :ctype:`PyModuleDef` struct from which the module was + created, or *NULL* if the module wasn't created with + :cfunc:`PyModule_Create`. + + +Initializing C modules +^^^^^^^^^^^^^^^^^^^^^^ + +These functions are usually used in the module initialization function. + +.. cfunction:: PyObject* PyModule_Create(PyModuleDef *module) + + Create a new module object, given the definition in *module*. This behaves + like :cfunc:`PyModule_Create2` with *module_api_version* set to + :const:`PYTHON_API_VERSION`. + + +.. cfunction:: PyObject* PyModule_Create2(PyModuleDef *module, int module_api_version) + + Create a new module object, given the definition in *module*, assuming the + API version *module_api_version*. If that version does not match the version + of the running interpreter, a :exc:`RuntimeWarning` is emitted. + + .. note:: + + Most uses of this function should be using :cfunc:`PyModule_Create` + instead; only use this if you are sure you need it. + + +.. ctype:: PyModuleDef + + This struct holds all information that is needed to create a module object. + There is usually only one static variable of that type for each module, which + is statically initialized and then passed to :cfunc:`PyModule_Create` in the + module initialization function. + + .. cmember:: PyModuleDef_Base m_base + + Always initialize this member to :const:`PyModuleDef_HEAD_INIT`. + + .. cmember:: char* m_name + + Name for the new module. + + .. cmember:: char* m_doc + + Docstring for the module; usually a docstring variable created with + :cfunc:`PyDoc_STRVAR` is used. + + .. cmember:: Py_ssize_t m_size + + If the module object needs additional memory, this should be set to the + number of bytes to allocate; a pointer to the block of memory can be + retrieved with :cfunc:`PyModule_GetState`. If no memory is needed, set + this to ``-1``. + + This memory should be used, rather than static globals, to hold per-module + state, since it is then safe for use in multiple sub-interpreters. It is + freed when the module object is deallocated, after the :cmember:`m_free` + function has been called, if present. + + .. cmember:: PyMethodDef* m_methods + + A pointer to a table of module-level functions, described by + :ctype:`PyMethodDef` values. Can be *NULL* if no functions are present. + + .. cmember:: inquiry m_reload + + Currently unused, should be *NULL*. + + .. cmember:: traverseproc m_traverse + + A traversal function to call during GC traversal of the module object, or + *NULL* if not needed. + + .. cmember:: inquiry m_clear + + A clear function to call during GC clearing of the module object, or + *NULL* if not needed. + + .. cmember:: freefunc m_free + + A function to call during deallocation of the module object, or *NULL* if + not needed. + + .. cfunction:: int PyModule_AddObject(PyObject *module, const char *name, PyObject *value) Add an object to *module* as *name*. This is a convenience function which can @@ -96,7 +191,7 @@ .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro) - Add an int constant to *module*. The name and the value are taken from + Add an int constant to *module*. The name and the value are taken from *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on error, ``0`` on success. @@ -105,4 +200,3 @@ .. cfunction:: int PyModule_AddStringMacro(PyObject *module, macro) Add a string constant to *module*. - Modified: python/branches/py3k-issue1717/Doc/c-api/number.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/number.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/number.rst Sun Jan 25 21:08:20 2009 @@ -230,19 +230,16 @@ .. cfunction:: PyObject* PyNumber_Int(PyObject *o) - .. index:: builtin: int - - Returns the *o* converted to an integer object on success, or *NULL* on failure. - If the argument is outside the integer range a long object will be returned - instead. This is the equivalent of the Python expression ``int(o)``. + Returns the *o* converted to an integer object on success, or *NULL* on + failure. This is the equivalent of the Python expression ``int(o)``. .. cfunction:: PyObject* PyNumber_Long(PyObject *o) - .. index:: builtin: long + .. index:: builtin: int Returns the *o* converted to an integer object on success, or *NULL* on - failure. This is the equivalent of the Python expression ``long(o)``. + failure. This is the equivalent of the Python expression ``int(o)``. .. cfunction:: PyObject* PyNumber_Float(PyObject *o) @@ -255,7 +252,7 @@ .. cfunction:: PyObject* PyNumber_Index(PyObject *o) - Returns the *o* converted to a Python int or long on success or *NULL* with a + Returns the *o* converted to a Python int on success or *NULL* with a :exc:`TypeError` exception raised on failure. @@ -271,7 +268,7 @@ .. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc) Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an - integer. If *o* can be converted to a Python int or long but the attempt to + integer. If *o* can be converted to a Python int but the attempt to convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the *exc* argument is the type of exception that will be raised (usually :exc:`IndexError` or :exc:`OverflowError`). If *exc* is *NULL*, then the Modified: python/branches/py3k-issue1717/Doc/c-api/object.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/object.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/object.rst Sun Jan 25 21:08:20 2009 @@ -241,8 +241,6 @@ allowing a type to explicitly indicate to the interpreter that it is not hashable. - .. versionadded:: 2.6 - .. cfunction:: int PyObject_IsTrue(PyObject *o) Modified: python/branches/py3k-issue1717/Doc/c-api/reflection.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/reflection.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/reflection.rst Sun Jan 25 21:08:20 2009 @@ -15,7 +15,7 @@ Return a dictionary of the local variables in the current execution frame, or *NULL* if no frame is currently executing. - + .. cfunction:: PyObject* PyEval_GetGlobals() Modified: python/branches/py3k-issue1717/Doc/c-api/sequence.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/sequence.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/sequence.rst Sun Jan 25 21:08:20 2009 @@ -143,9 +143,9 @@ Return the underlying array of PyObject pointers. Assumes that *o* was returned by :cfunc:`PySequence_Fast` and *o* is not *NULL*. - + Note, if a list gets resized, the reallocation may relocate the items array. - So, only use the underlying array pointer in contexts where the sequence + So, only use the underlying array pointer in contexts where the sequence cannot change. Modified: python/branches/py3k-issue1717/Doc/c-api/structures.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/structures.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/structures.rst Sun Jan 25 21:08:20 2009 @@ -198,3 +198,64 @@ object and will co-exist with the slot. This is helpful because calls to PyCFunctions are optimized more than wrapper object calls. + +.. ctype:: PyMemberDef + + Structure which describes an attribute of a type which corresponds to a C + struct member. Its fields are: + + +------------------+-------------+-------------------------------+ + | Field | C Type | Meaning | + +==================+=============+===============================+ + | :attr:`name` | char \* | name of the member | + +------------------+-------------+-------------------------------+ + | :attr:`type` | int | the type of the member in the | + | | | C struct | + +------------------+-------------+-------------------------------+ + | :attr:`offset` | Py_ssize_t | the offset in bytes that the | + | | | member is located on the | + | | | type's object struct | + +------------------+-------------+-------------------------------+ + | :attr:`flags` | int | flag bits indicating if the | + | | | field should be read-only or | + | | | writable | + +------------------+-------------+-------------------------------+ + | :attr:`doc` | char \* | points to the contents of the | + | | | docstring | + +------------------+-------------+-------------------------------+ + + :attr:`type` can be one of many ``T_`` macros corresponding to various C + types. When the member is accessed in Python, it will be converted to the + equivalent Python type. + + =============== ================== + Macro name C type + =============== ================== + T_SHORT short + T_INT int + T_LONG long + T_FLOAT float + T_DOUBLE double + T_STRING char \* + T_OBJECT PyObject \* + T_OBJECT_EX PyObject \* + T_CHAR char + T_BYTE char + T_UNBYTE unsigned char + T_UINT unsigned int + T_USHORT unsigned short + T_ULONG unsigned long + T_BOOL char + T_LONGLONG long long + T_ULONGLONG unsigned long long + T_PYSSIZET Py_ssize_t + =============== ================== + + :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that + :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and + :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. + + :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for + read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies + :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` + members can be deleted. (They are set to *NULL*). Modified: python/branches/py3k-issue1717/Doc/c-api/sys.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/sys.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/sys.rst Sun Jan 25 21:08:20 2009 @@ -15,13 +15,6 @@ one of the strings ``''`` or ``'???'``. -.. cfunction:: long PyOS_GetLastModificationTime(char *filename) - - Return the time of last modification of the file *filename*. The result is - encoded in the same way as the timestamp returned by the standard C library - function :cfunc:`time`. - - .. cfunction:: void PyOS_AfterFork() Function to update some internal state after a process fork; this should be 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 Sun Jan 25 21:08:20 2009 @@ -135,7 +135,7 @@ :attr:`ob_size` field, and the instance size is :attr:`tp_basicsize` plus N times :attr:`tp_itemsize`, where N is the "length" of the object. The value of N is typically stored in the instance's :attr:`ob_size` field. There are - exceptions: for example, long ints use a negative :attr:`ob_size` to indicate a + exceptions: for example, ints use a negative :attr:`ob_size` to indicate a negative number, and N is ``abs(ob_size)`` there. Also, the presence of an :attr:`ob_size` field in the instance layout doesn't mean that the instance structure is variable-length (for example, the structure for the list type has @@ -642,7 +642,6 @@ :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its base type. - .. cmember:: getiterfunc PyTypeObject.tp_iter An optional pointer to a function that returns an iterator for the object. Its @@ -803,7 +802,7 @@ where :attr:`tp_basicsize`, :attr:`tp_itemsize` and :attr:`tp_dictoffset` are taken from the type object, and :attr:`ob_size` is taken from the instance. The - absolute value is taken because long ints use the sign of :attr:`ob_size` to + absolute value is taken because ints use the sign of :attr:`ob_size` to store the sign of the number. (There's never a need to do this calculation yourself; it is done for you by :cfunc:`_PyObject_GetDictPtr`.) @@ -1048,7 +1047,7 @@ binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; - unaryfunc nb_long; + void *nb_reserved; unaryfunc nb_float; binaryfunc nb_inplace_add; @@ -1079,6 +1078,12 @@ ``Py_NotImplemented``, if another error occurred they must return ``NULL`` and set an exception. + .. note:: + + The :cdata:`nb_reserved` field should always be ``NULL``. It + was previously called :cdata:`nb_long`, and was renamed in + Python 3.0.1. + .. _mapping-structs: Modified: python/branches/py3k-issue1717/Doc/c-api/unicode.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/unicode.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/unicode.rst Sun Jan 25 21:08:20 2009 @@ -409,19 +409,19 @@ .. cfunction:: PyObject* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors) Encode the :ctype:`Py_UNICODE` buffer of the given size and return a Python - string object. *encoding* and *errors* have the same meaning as the parameters - of the same name in the Unicode :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. + bytes object. *encoding* and *errors* have the same meaning as the + parameters of the same name in the Unicode :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. .. cfunction:: PyObject* PyUnicode_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors) - Encode a Unicode object and return the result as Python string object. - *encoding* and *errors* have the same meaning as the parameters of the same name - in the Unicode :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. + Encode a Unicode object and return the result as Python bytes object. + *encoding* and *errors* have the same meaning as the parameters of the same + name in the Unicode :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. These are the UTF-8 codec APIs: @@ -444,15 +444,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and return a - Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and + return a Python bytes object. Return *NULL* if an exception was raised by + the codec. .. cfunction:: PyObject* PyUnicode_AsUTF8String(PyObject *unicode) - Encode a Unicode object using UTF-8 and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using UTF-8 and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. These are the UTF-32 codec APIs: @@ -514,9 +515,9 @@ .. cfunction:: PyObject* PyUnicode_AsUTF32String(PyObject *unicode) - Return a Python string using the UTF-32 encoding in native byte order. The - string always starts with a BOM mark. Error handling is "strict". Return - *NULL* if an exception was raised by the codec. + Return a Python byte string using the UTF-32 encoding in native byte + order. The string always starts with a BOM mark. Error handling is "strict". + Return *NULL* if an exception was raised by the codec. These are the UTF-16 codec APIs: @@ -558,7 +559,7 @@ .. cfunction:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder) - Return a Python string object holding the UTF-16 encoded value of the Unicode + Return a Python bytes object holding the UTF-16 encoded value of the Unicode data in *s*. If *byteorder* is not ``0``, output is written according to the following byte order:: @@ -578,9 +579,9 @@ .. cfunction:: PyObject* PyUnicode_AsUTF16String(PyObject *unicode) - Return a Python string using the UTF-16 encoding in native byte order. The - string always starts with a BOM mark. Error handling is "strict". Return - *NULL* if an exception was raised by the codec. + Return a Python byte string using the UTF-16 encoding in native byte + order. The string always starts with a BOM mark. Error handling is "strict". + Return *NULL* if an exception was raised by the codec. These are the "Unicode Escape" codec APIs: @@ -644,15 +645,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and return - a Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and + return a Python bytes object. Return *NULL* if an exception was raised by + the codec. .. cfunction:: PyObject* PyUnicode_AsLatin1String(PyObject *unicode) - Encode a Unicode object using Latin-1 and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using Latin-1 and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All other codes generate errors. @@ -668,15 +670,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and return a - Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and + return a Python bytes object. Return *NULL* if an exception was raised by + the codec. .. cfunction:: PyObject* PyUnicode_AsASCIIString(PyObject *unicode) - Encode a Unicode object using ASCII and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using ASCII and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. These are the mapping codec APIs: @@ -767,15 +770,16 @@ .. cfunction:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return a - Python string object. Return *NULL* if an exception was raised by the codec. + Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return + a Python bytes object. Return *NULL* if an exception was raised by the + codec. .. cfunction:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode) - Encode a Unicode object using MBCS and return the result as Python string - object. Error handling is "strict". Return *NULL* if an exception was raised - by the codec. + Encode a Unicode object using MBCS and return the result as Python bytes + object. Error handling is "strict". Return *NULL* if an exception was + raised by the codec. .. % --- Methods & Slots ---------------------------------------------------- Modified: python/branches/py3k-issue1717/Doc/data/refcounts.dat ============================================================================== --- python/branches/py3k-issue1717/Doc/data/refcounts.dat (original) +++ python/branches/py3k-issue1717/Doc/data/refcounts.dat Sun Jan 25 21:08:20 2009 @@ -841,9 +841,6 @@ PyNumber_Xor:PyObject*:o1:0: PyNumber_Xor:PyObject*:o2:0: -PyOS_GetLastModificationTime:long::: -PyOS_GetLastModificationTime:char*:filename:: - PyObject_AsFileDescriptor:int::: PyObject_AsFileDescriptor:PyObject*:o:0: Modified: python/branches/py3k-issue1717/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/apiref.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/apiref.rst Sun Jan 25 21:08:20 2009 @@ -104,7 +104,7 @@ | *package_dir* | A mapping of package to | a dictionary | | | directory names | | +--------------------+--------------------------------+-------------------------------------------------------------+ - + .. function:: run_setup(script_name[, script_args=None, stop_after='run']) @@ -188,9 +188,10 @@ | | for C/C++ header files (in | | | | Unix form for portability) | | +------------------------+--------------------------------+---------------------------+ - | *define_macros* | list of macros to define; each | (string,string) tuple or | - | | macro is defined using a | (name,``None``) | - | | 2-tuple, where 'value' is | | + | *define_macros* | list of macros to define; each | (string, string) tuple or | + | | macro is defined using a | (name, ``None``) | + | | 2-tuple ``(name, value)``, | | + | | where *value* is | | | | either the string to define it | | | | to or ``None`` to define it | | | | without a particular value | | @@ -754,7 +755,7 @@ standard output, otherwise do nothing. .. % \subsection{Compiler-specific modules} -.. % +.. % .. % The following modules implement concrete subclasses of the abstract .. % \class{CCompiler} class. They should not be instantiated directly, but should .. % be created using \function{distutils.ccompiler.new_compiler()} factory @@ -858,7 +859,7 @@ Macintosh. Needs work to support CW on Windows or Mac OS X. .. % \subsection{Utility modules} -.. % +.. % .. % The following modules all provide general utility functions. They haven't .. % all been documented yet. @@ -1109,13 +1110,13 @@ For MacOS X systems the OS version reflects the minimal version on which binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` - during the build of Python), not the OS version of the current system. + during the build of Python), not the OS version of the current system. For universal binary builds on MacOS X the architecture value reflects the univeral binary status instead of the architecture of the current - processor. For 32-bit universal binaries the architecture is ``fat``, - for 64-bit universal binaries the architecture is ``fat64``, and - for 4-way universal binaries the architecture is ``universal``. + processor. For 32-bit universal binaries the architecture is ``fat``, + for 64-bit universal binaries the architecture is ``fat64``, and + for 4-way universal binaries the architecture is ``universal``. Examples of returned values on MacOS X: @@ -1692,7 +1693,7 @@ .. % todo .. % \section{Distutils Commands} -.. % +.. % .. % This part of Distutils implements the various Distutils commands, such .. % as \code{build}, \code{install} \&c. Each command is implemented as a .. % separate module, with the command name as the name of the module. Modified: python/branches/py3k-issue1717/Doc/distutils/builtdist.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/builtdist.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/builtdist.rst Sun Jan 25 21:08:20 2009 @@ -268,13 +268,13 @@ .. % \longprogramopt{spec-file} option; used in conjunction with .. % \longprogramopt{spec-only}, this gives you an opportunity to customize .. % the \file{.spec} file manually: -.. % +.. % .. % \ begin{verbatim} .. % > python setup.py bdist_rpm --spec-only .. % # ...edit dist/FooBar-1.0.spec .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec .. % \ end{verbatim} -.. % +.. % .. % (Although a better way to do this is probably to override the standard .. % \command{bdist\_rpm} command with one that writes whatever else you want .. % to the \file{.spec} file.) @@ -334,31 +334,31 @@ Cross-compiling on Windows ========================== -Starting with Python 2.6, distutils is capable of cross-compiling between -Windows platforms. In practice, this means that with the correct tools +Starting with Python 2.6, distutils is capable of cross-compiling between +Windows platforms. In practice, this means that with the correct tools installed, you can use a 32bit version of Windows to create 64bit extensions and vice-versa. -To build for an alternate platform, specify the :option:`--plat-name` option -to the build command. Valid values are currently 'win32', 'win-amd64' and +To build for an alternate platform, specify the :option:`--plat-name` option +to the build command. Valid values are currently 'win32', 'win-amd64' and 'win-ia64'. For example, on a 32bit version of Windows, you could execute:: python setup.py build --plat-name=win-amd64 -to build a 64bit version of your extension. The Windows Installers also +to build a 64bit version of your extension. The Windows Installers also support this option, so the command:: python setup.py build --plat-name=win-amd64 bdist_wininst would create a 64bit installation executable on your 32bit version of Windows. -To cross-compile, you must download the Python source code and cross-compile +To cross-compile, you must download the Python source code and cross-compile Python itself for the platform you are targetting - it is not possible from a binary installtion of Python (as the .lib etc file for other platforms are -not included.) In practice, this means the user of a 32 bit operating -system will need to use Visual Studio 2008 to open the -:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the -"x64" configuration of the 'pythoncore' project before cross-compiling +not included.) In practice, this means the user of a 32 bit operating +system will need to use Visual Studio 2008 to open the +:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the +"x64" configuration of the 'pythoncore' project before cross-compiling extensions is possible. Note that by default, Visual Studio 2008 does not install 64bit compilers or Modified: python/branches/py3k-issue1717/Doc/distutils/configfile.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/configfile.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/configfile.rst Sun Jan 25 21:08:20 2009 @@ -63,7 +63,7 @@ --include-dirs (-I) list of directories to search for header files --define (-D) C preprocessor macros to define --undef (-U) C preprocessor macros to undefine - --swig-opts list of SWIG command line options + --swig-opts list of SWIG command line options [...] Note that an option spelled :option:`--foo-bar` on the command-line is spelled Modified: python/branches/py3k-issue1717/Doc/distutils/packageindex.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/packageindex.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/packageindex.rst Sun Jan 25 21:08:20 2009 @@ -8,17 +8,17 @@ packaged with distutils. The distutils command :command:`register` is used to submit your distribution's meta-data to the index. It is invoked as follows:: - python setup.py register + python setup.py register Distutils will respond with the following prompt:: - running register - We need to know who you are, so please choose either: - 1. use your existing login, - 2. register as a new user, - 3. have the server generate a new password for you (and email it to you), or - 4. quit - Your selection [default 1]: + running register + We need to know who you are, so please choose either: + 1. use your existing login, + 2. register as a new user, + 3. have the server generate a new password for you (and email it to you), or + 4. quit + Your selection [default 1]: Note: if your username and password are saved locally, you will not see this menu. @@ -55,40 +55,50 @@ The format of the :file:`.pypirc` file is as follows:: - [distutils] - index-servers = - pypi + [distutils] + index-servers = + pypi - [pypi] - repository: - username: - password: + [pypi] + repository: + username: + password: -*repository* can be omitted and defaults to ``http://www.python.org/pypi``. +The *distutils* section defines a *index-servers* variable that lists the +name of all sections describing a repository. -If you want to define another server a new section can be created:: +Each section describing a repository defines three variables: - [distutils] - index-servers = - pypi - other - - [pypi] - repository: - username: - password: +- *repository*, that defines the url of the PyPI server. Defaults to + ``http://www.python.org/pypi``. +- *username*, which is the registered username on the PyPI server. +- *password*, that will be used to authenticate. If omitted the user + will be prompt to type it when needed. - [other] - repository: http://example.com/pypi - username: - password: +If you want to define another server a new section can be created and +listed in the *index-servers* variable:: -The command can then be called with the -r option:: + [distutils] + index-servers = + pypi + other - python setup.py register -r http://example.com/pypi + [pypi] + repository: + username: + password: -Or even with the section name:: + [other] + repository: http://example.com/pypi + username: + password: - python setup.py register -r other +:command:`register` can then be called with the -r option to point the +repository to work with:: - + python setup.py register -r http://example.com/pypi + +The name of the section that describes the repository may also be used +for conveniency:: + + python setup.py register -r other Modified: python/branches/py3k-issue1717/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/setupscript.rst Sun Jan 25 21:08:20 2009 @@ -213,7 +213,7 @@ this:: setup(..., - ext_modules=[Extension('_foo', ['foo.i'], + ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], ) Modified: python/branches/py3k-issue1717/Doc/distutils/uploading.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/uploading.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/uploading.rst Sun Jan 25 21:08:20 2009 @@ -11,7 +11,7 @@ The command is invoked immediately after building one or more distribution files. For example, the command :: - python setup.py sdist bdist_wininst upload + python setup.py sdist bdist_wininst upload will cause the source distribution and the Windows installer to be uploaded to PyPI. Note that these will be uploaded even if they are built using an earlier @@ -20,11 +20,14 @@ The :command:`upload` command uses the username, password, and repository URL from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this -file). +file). If a :command:`register` command was previously called in the same command, +and if the password was entered in the prompt, :command:`upload` will reuse the +entered password. This is useful if you do not want to store a clear text +password in the :file:`$HOME/.pypirc` file. You can specify another PyPI server with the :option:`--repository=*url*` option:: - python setup.py sdist bdist_wininst upload -r http://example.com/pypi + python setup.py sdist bdist_wininst upload -r http://example.com/pypi See section :ref:`pypirc` for more on defining several servers. @@ -33,9 +36,8 @@ be available for execution on the system :envvar:`PATH`. You can also specify which key to use for signing using the :option:`--identity=*name*` option. -Other :command:`upload` options include :option:`--repository=*url*` -or :option:`--repository=*section*` where `url` is the url of the server -and `section` the name of the section in :file:`$HOME/.pypirc`, and +Other :command:`upload` options include :option:`--repository=` or +:option:`--repository=
    ` where *url* is the url of the server and +*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). - Modified: python/branches/py3k-issue1717/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/documenting/markup.rst (original) +++ python/branches/py3k-issue1717/Doc/documenting/markup.rst Sun Jan 25 21:08:20 2009 @@ -53,9 +53,9 @@ .. describe:: module - This directive marks the beginning of the description of a module (or package - submodule, in which case the name should be fully qualified, including the - package name). + This directive marks the beginning of the description of a module, package, + or submodule. The name should be fully qualified (i.e. including the + package name for submodules). The ``platform`` option, if present, is a comma-separated list of the platforms on which the module is available (if it is available on all @@ -285,7 +285,8 @@ 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```. @@ -310,7 +311,7 @@ .. describe:: data - The name of a module-level variable. + The name of a module-level variable or constant. .. describe:: const @@ -508,7 +509,7 @@ curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. .. describe:: var @@ -598,8 +599,8 @@ Example:: - .. versionadded:: 2.5 - The `spam` parameter. + .. versionadded:: 3.1 + The *spam* parameter. Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. @@ -760,14 +761,14 @@ Blank lines are not allowed within ``productionlist`` directive arguments. The definition can contain token names which are marked as interpreted text - (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references + (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references to the productions of these tokens. Note that no further reST parsing is done in the production, so that you don't have to escape ``*`` or ``|`` characters. -.. XXX describe optional first parameter +.. XXX describe optional first parameter The following is an example taken from the Python Reference Manual:: Modified: python/branches/py3k-issue1717/Doc/extending/building.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/extending/building.rst (original) +++ python/branches/py3k-issue1717/Doc/extending/building.rst Sun Jan 25 21:08:20 2009 @@ -39,7 +39,7 @@ With this :file:`setup.py`, and a file :file:`demo.c`, running :: - python setup.py build + python setup.py build will compile :file:`demo.c`, and produce an extension module named ``demo`` in the :file:`build` directory. Depending on the system, the module file will end Modified: python/branches/py3k-issue1717/Doc/extending/extending.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/extending/extending.rst (original) +++ python/branches/py3k-issue1717/Doc/extending/extending.rst Sun Jan 25 21:08:20 2009 @@ -334,7 +334,7 @@ :cfunc:`PyInit_spam` is called. (See below for comments about embedding Python.) It calls :cfunc:`PyModule_Create`, which returns a module object, and inserts built-in function objects into the newly created module based upon the -table (an array of :ctype:`PyMethodDef` structures) found in the module definition. +table (an array of :ctype:`PyMethodDef` structures) found in the module definition. :cfunc:`PyModule_Create` returns a pointer to the module object that it creates. It may abort with a fatal error for certain errors, or return *NULL* if the module could not be initialized @@ -482,7 +482,7 @@ :cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of -arguments. To call the Python function with no arguments, pass in NULL, or +arguments. To call the Python function with no arguments, pass in NULL, or an empty tuple; to call it with one argument, pass a singleton tuple. :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example:: @@ -521,7 +521,7 @@ if (result == NULL) return NULL; /* Pass error back */ ...use result... - Py_DECREF(result); + Py_DECREF(result); Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases @@ -546,7 +546,7 @@ the error check! Also note that strictly speaking this code is not complete: :cfunc:`Py_BuildValue` may run out of memory, and this should be checked. -You may also call a function with keyword arguments by using +You may also call a function with keyword arguments by using :cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. :: @@ -687,7 +687,7 @@ static PyObject * keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) - { + { int voltage; char *state = "a stiff"; char *action = "voom"; @@ -695,11 +695,11 @@ static char *kwlist[] = {"voltage", "state", "action", "type", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, &voltage, &state, &action, &type)) - return NULL; + return NULL; - printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", + printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", action, voltage); printf("-- Lovely plumage, the %s -- It's %s!\n", type, state); 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 Sun Jan 25 21:08:20 2009 @@ -823,8 +823,8 @@ previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -837,10 +837,10 @@ static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -859,18 +859,18 @@ PyMODINIT_FUNC PyInit_shoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return NULL; - - m = PyModule_Create(&shoddymodule); - if (m == NULL) - return NULL; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return NULL; + + m = PyModule_Create(&shoddymodule); + if (m == NULL) + return NULL; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1113,7 +1113,7 @@ typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; @@ -1180,7 +1180,7 @@ of *NULL* is required. .. XXX Descriptors need to be explained in more detail somewhere, but not here. - + Descriptor objects have two handler functions which correspond to the \member{tp_getattro} and \member{tp_setattro} handlers. The \method{__get__()} handler is a function which is passed the descriptor, @@ -1216,7 +1216,7 @@ PyErr_Format(PyExc_AttributeError, "'%.50s' object has no attribute '%.400s'", - tp->tp_name, name); + tp->tp_name, name); return NULL; } @@ -1233,15 +1233,15 @@ return -1; } -.. XXX tp_compare is dead; need to rewrite for tp_richcompare! +.. XXX tp_compare is dead; need to rewrite for tp_richcompare! Object Comparison ----------------- - + :: - + cmpfunc tp_compare; - + The :attr:`tp_compare` handler is called when comparisons are needed and the object does not implement the specific rich comparison method which matches the requested comparison. (It is always used if defined and the @@ -1252,18 +1252,18 @@ allowed to return arbitrary negative or positive integers for less than and 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 return a negative value. The caller has to test for the exception using :cfunc:`PyErr_Occurred`. - + Here is a sample implementation:: - + static int newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) { long result; - + if (obj1->obj_UnderlyingDatatypePtr->size < obj2->obj_UnderlyingDatatypePtr->size) { result = -1; Modified: python/branches/py3k-issue1717/Doc/extending/windows.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/extending/windows.rst (original) +++ python/branches/py3k-issue1717/Doc/extending/windows.rst Sun Jan 25 21:08:20 2009 @@ -102,15 +102,11 @@ and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its first argument (use the minimal :file:`example.c` in this directory as a guide). By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. - The output file should be called :file:`spam.pyd` (in Release mode) or + The output file should be called :file:`spam.pyd` (in Release mode) or :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen to avoid confusion with a system library :file:`spam.dll` to which your module could be a Python interface. - .. versionchanged:: 2.5 - Previously, file names like :file:`spam.dll` (in release mode) or - :file:`spam_d.dll` (in debug mode) were also recognized. - Now your options are: #. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to Modified: python/branches/py3k-issue1717/Doc/glossary.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/glossary.rst (original) +++ python/branches/py3k-issue1717/Doc/glossary.rst Sun Jan 25 21:08:20 2009 @@ -11,7 +11,7 @@ ``>>>`` The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter. - + ``...`` The default Python prompt of the interactive shell when entering code for an indented code block or within a pair of matching left and right @@ -50,11 +50,11 @@ A value associated with an object which is referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. - + BDFL Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator. - + bytecode Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in @@ -67,7 +67,7 @@ A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class. - + coercion The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, @@ -77,7 +77,7 @@ will raise a ``TypeError``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. - + complex number An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary @@ -89,7 +89,7 @@ :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them. - + context manager An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. @@ -132,7 +132,7 @@ and reference to super classes. For more information about descriptors' methods, see :ref:`descriptors`. - + dictionary An associative array, where arbitrary keys are mapped to values. The use of :class:`dict` closely resembles that for :class:`list`, but the keys can @@ -146,8 +146,8 @@ of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object. - - duck-typing + + duck-typing A pythonic programming style which determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it @@ -157,13 +157,13 @@ :func:`isinstance`. (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming. - + EAFP Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` - statements. The technique contrasts with the :term:`LBYL` style + statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C. expression @@ -179,6 +179,11 @@ A module written in C or C++, using Python's C API to interact with the core and with user code. + finder + An object that tries to find the :term:`loader` for a module. It must + implement a method named :meth:`find_module`. See :pep:`302` for + details. + floor division Mathematical division discarding any remainder. The floor division operator is ``//``. For example, the expression ``11//4`` evaluates to @@ -196,7 +201,7 @@ By importing the :mod:`__future__` module and evaluating its variables, you can see when a new feature was first added to the language and when it becomes the default:: - + >>> import __future__ >>> __future__.division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) @@ -205,7 +210,7 @@ The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. - + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -215,21 +220,21 @@ stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the :meth:`__next__` method of the returned iterator. - + .. index:: single: generator expression - + generator expression An expression that returns a generator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: - + >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285 - + GIL See :term:`global interpreter lock`. - + global interpreter lock The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. @@ -255,14 +260,14 @@ containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`. - + IDLE An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application. - + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to @@ -270,6 +275,10 @@ role in places where a constant hash value is needed, for example as a key in a dictionary. + importer + An object that both finds and loads a module; both a + :term:`finder` and :term:`loader` object. + interactive Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately @@ -277,7 +286,7 @@ arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). - + interpreted Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the @@ -286,7 +295,7 @@ Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`. - + iterable A container object capable of returning its members one at a time. Examples of iterables include all sequence types (such as @@ -302,7 +311,7 @@ statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`. - + iterator An object representing a stream of data. Repeated calls to the iterator's :meth:`__next__` (or passing it to the builtin function) :func:`next` @@ -318,7 +327,7 @@ :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container. - + More information can be found in :ref:`typeiter`. keyword argument @@ -342,7 +351,7 @@ A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1). - + list comprehension A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ["0x%02x" % x for x in @@ -350,11 +359,16 @@ even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed. - + + loader + An object that loads a module. It must define a method named + :meth:`load_module`. A loader is typically returned by a + :term:`finder`. See :pep:`302` for details. + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. - + metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for @@ -373,7 +387,7 @@ of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`. - + mutable Mutable objects can change their value but keep their :func:`id`. See also :term:`immutable`. @@ -390,7 +404,7 @@ :func:`collections.namedtuple`. The latter approach automatically provides extra features such as a self-documenting representation like ``Employee(name='jones', title='programmer')``. - + namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and builtin namespaces as well @@ -402,7 +416,7 @@ :func:`random.seed` or :func:`itertools.izip` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively. - + nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to @@ -410,7 +424,7 @@ reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. - + new-style class Old name for the flavor of classes now used for all class objects. In earlier Python versions, only new-style classes could use Python's newer, @@ -421,7 +435,7 @@ Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`. - + positional argument The arguments assigned to local names inside a function or method, determined by the order in which they were given in the call. ``*`` is @@ -441,7 +455,7 @@ to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:: - + for i in range(len(food)): print(food[i]) @@ -464,7 +478,7 @@ popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. - + sequence An :term:`iterable` which supports efficient element access using integer indices via the :meth:`__getitem__` special method and defines a @@ -516,7 +530,7 @@ virtual machine A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler. - + Zen of Python Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing Modified: python/branches/py3k-issue1717/Doc/howto/curses.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/curses.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/curses.rst Sun Jan 25 21:08:20 2009 @@ -297,7 +297,7 @@ could code:: stdscr.addstr(0, 0, "Current mode: Typing mode", - curses.A_REVERSE) + curses.A_REVERSE) stdscr.refresh() The curses library also supports color on those terminals that provide it, The @@ -399,8 +399,8 @@ curses.echo() # Enable echoing of characters - # Get a 15-character string, with the cursor on the top line - s = stdscr.getstr(0,0, 15) + # Get a 15-character string, with the cursor on the top line + s = stdscr.getstr(0,0, 15) The Python :mod:`curses.textpad` module supplies something better. With it, you can turn a window into a text box that supports an Emacs-like set of Modified: python/branches/py3k-issue1717/Doc/howto/doanddont.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/doanddont.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/doanddont.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ ************************************ - Idioms and Anti-Idioms in Python + Idioms and Anti-Idioms in Python ************************************ :Author: Moshe Zadka @@ -94,7 +94,7 @@ # bar.py from foo import a if something(): - a = 2 # danger: foo.a != a + a = 2 # danger: foo.a != a Good example:: @@ -271,6 +271,6 @@ This version is bulletproof:: - value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] + calculate_number(10, 20)*forbulate(500, 360)) Modified: python/branches/py3k-issue1717/Doc/howto/functional.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/functional.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/functional.rst Sun Jan 25 21:08:20 2009 @@ -145,7 +145,7 @@ functions are also easier to read and to check for errors. -Ease of debugging and testing +Ease of debugging and testing ----------------------------- Testing and debugging a functional-style program is easier. @@ -213,7 +213,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> Python expects iterable objects in several different contexts, the most important being the ``for`` statement. In the statement ``for X in Y``, Y must @@ -363,7 +363,7 @@ comprehensions are surrounded by square brackets ("[]"). Generator expressions have the form:: - ( expression for expr in sequence1 + ( expression for expr in sequence1 if condition1 for expr2 in sequence2 if condition2 @@ -405,7 +405,7 @@ if not (conditionN): continue # Skip this element - # Output the value of + # Output the value of # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` @@ -419,8 +419,8 @@ >>> seq1 = 'abc' >>> seq2 = (1,2,3) >>> [(x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), + [('a', 1), ('a', 2), ('a', 3), + ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)] To avoid introducing an ambiguity into Python's grammar, if ``expression`` is @@ -586,7 +586,7 @@ 9 >>> next(it) Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? it.next() StopIteration @@ -627,7 +627,7 @@ Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate the features of generator expressions: -``map(f, iterA, iterB, ...)`` returns an iterator over the sequence +``map(f, iterA, iterB, ...)`` returns an iterator over the sequence ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``. >>> def upper(s): @@ -639,7 +639,7 @@ >>> [upper(s) for s in ['sentence', 'fragment']] ['SENTENCE', 'FRAGMENT'] -You can of course achieve the same effect with a list comprehension. +You can of course achieve the same effect with a list comprehension. ``filter(predicate, iter)`` returns an iterator over all the sequence elements that meet a certain condition, and is similarly duplicated by list @@ -709,7 +709,7 @@ True >>> all([0,1,0]) False - >>> all([0,0,0]) + >>> all([0,0,0]) False >>> all([1,1,1]) True @@ -827,7 +827,7 @@ ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream of tuples, and calls ``f()`` using these tuples as the arguments:: - itertools.starmap(os.path.join, + itertools.starmap(os.path.join, [('/usr', 'bin', 'java'), ('/bin', 'python'), ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) => @@ -887,9 +887,9 @@ :: - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), + city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), + ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), ... ] @@ -904,7 +904,7 @@ where iterator-1 => ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => + iterator-2 => ('Anchorage', 'AK'), ('Nome', 'AK') iterator-3 => ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') @@ -1045,7 +1045,7 @@ >>> double(add(5, 6)) 22 - + The ``unpack`` keyword is provided to work around the fact that Python functions are not always `fully curried `__. By default, it is expected that the ``inner`` function will return a single object @@ -1054,15 +1054,15 @@ will be expanded before being passed to ``outer``. Put simply, :: compose(f, g)(5, 6) - + is equivalent to:: f(g(5, 6)) - + while :: compose(f, g, unpack=True)(5, 6) - + is equivalent to:: f(*g(5, 6)) @@ -1074,21 +1074,21 @@ from functional import compose, partial import functools - + multi_compose = partial(functools.reduce, compose) - - + + We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of ``"".join(...)`` that converts its arguments to string:: from functional import compose, partial - + join = compose("".join, partial(map, str)) ``flip(func)`` - + ``flip()`` wraps the callable in ``func`` and causes it to receive its non-keyword arguments in reverse order. :: @@ -1103,7 +1103,7 @@ (7, 6, 5) ``foldl(func, start, iterable)`` - + ``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable. The function is applied to the starting value and the first element of the list, then the result of that and the second element of the @@ -1117,7 +1117,7 @@ f(f(f(0, 1), 2), 3) - + ``foldl()`` is roughly equivalent to the following recursive function:: def foldl(func, start, seq): @@ -1224,7 +1224,7 @@ 4) Convert the lambda to a def statement, using that name. 5) Remove the comment. -I really like these rules, but you're free to disagree +I really like these rules, but you're free to disagree about whether this lambda-free style is better. @@ -1282,7 +1282,7 @@ Text Processing". Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see +for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__, Modified: python/branches/py3k-issue1717/Doc/howto/regex.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/regex.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/regex.rst Sun Jan 25 21:08:20 2009 @@ -611,7 +611,7 @@ is to read? :: charref = re.compile(r""" - &[#] # Start of a numeric entity reference + &[#] # Start of a numeric entity reference ( 0[0-7]+ # Octal form | [0-9]+ # Decimal form @@ -917,7 +917,7 @@ InternalDate = re.compile(r'INTERNALDATE "' r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-' - r'(?P[0-9][0-9][0-9][0-9])' + r'(?P[0-9][0-9][0-9][0-9])' r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])' r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])' r'"') Modified: python/branches/py3k-issue1717/Doc/howto/sockets.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/sockets.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/sockets.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -62,7 +62,7 @@ #create an INET, STREAMing socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -77,7 +77,7 @@ #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -184,35 +184,35 @@ length message:: class mysocket: - """demonstration class only + """demonstration class only - coded for clarity, not efficiency """ def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock def connect(self, host, port): self.sock.connect((host, port)) def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError("socket connection broken") - totalsent = totalsent + sent + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError("socket connection broken") + totalsent = totalsent + sent def myreceive(self): msg = '' while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError("socket connection broken") - msg = msg + chunk + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError("socket connection broken") + msg = msg + chunk return msg The sending code here is usable for almost any messaging scheme - in Python you @@ -340,9 +340,9 @@ ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might Modified: python/branches/py3k-issue1717/Doc/howto/unicode.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/unicode.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/unicode.rst Sun Jan 25 21:08:20 2009 @@ -32,8 +32,8 @@ looking at Apple ][ BASIC programs, published in French-language publications in the mid-1980s, that had lines like these:: - PRINT "FICHIER EST COMPLETE." - PRINT "CARACTERE NON ACCEPTE." + PRINT "FICHIER EST COMPLETE." + PRINT "CARACTERE NON ACCEPTE." Those messages should contain accents, and they just look wrong to someone who can read French. @@ -91,11 +91,11 @@ character with value 0x12ca (4810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:: - 0061 'a'; LATIN SMALL LETTER A - 0062 'b'; LATIN SMALL LETTER B - 0063 'c'; LATIN SMALL LETTER C - ... - 007B '{'; LEFT CURLY BRACKET + 0061 'a'; LATIN SMALL LETTER A + 0062 'b'; LATIN SMALL LETTER B + 0063 'c'; LATIN SMALL LETTER C + ... + 007B '{'; LEFT CURLY BRACKET Strictly, these definitions imply that it's meaningless to say 'this is character U+12ca'. U+12ca is a code point, which represents some particular @@ -527,19 +527,19 @@ assuming the default filesystem encoding is UTF-8, running the following program:: - fn = 'filename\u4500abc' - f = open(fn, 'w') - f.close() - - import os - print(os.listdir(b'.')) - print(os.listdir('.')) + fn = 'filename\u4500abc' + f = open(fn, 'w') + f.close() + + import os + print(os.listdir(b'.')) + print(os.listdir('.')) will produce the following output:: - amk:~$ python t.py - [b'.svn', b'filename\xe4\x94\x80abc', ...] - ['.svn', 'filename\u4500abc', ...] + amk:~$ python t.py + [b'.svn', b'filename\xe4\x94\x80abc', ...] + ['.svn', 'filename\u4500abc', ...] The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions. @@ -636,26 +636,26 @@ - [ ] Unicode introduction - [ ] ASCII - [ ] Terms - - [ ] Character - - [ ] Code point - - [ ] Encodings - - [ ] Common encodings: ASCII, Latin-1, UTF-8 + - [ ] Character + - [ ] Code point + - [ ] Encodings + - [ ] Common encodings: ASCII, Latin-1, UTF-8 - [ ] Unicode Python type - - [ ] Writing unicode literals - - [ ] Obscurity: -U switch - - [ ] Built-ins - - [ ] unichr() - - [ ] ord() - - [ ] unicode() constructor - - [ ] Unicode type - - [ ] encode(), decode() methods + - [ ] Writing unicode literals + - [ ] Obscurity: -U switch + - [ ] Built-ins + - [ ] unichr() + - [ ] ord() + - [ ] unicode() constructor + - [ ] Unicode type + - [ ] encode(), decode() methods - [ ] Unicodedata module for character properties - [ ] I/O - - [ ] Reading/writing Unicode data into files - - [ ] Byte-order marks - - [ ] Unicode filenames + - [ ] Reading/writing Unicode data into files + - [ ] Byte-order marks + - [ ] Unicode filenames - [ ] Writing Unicode programs - - [ ] Do everything in Unicode - - [ ] Declaring source code encodings (PEP 263) + - [ ] Do everything in Unicode + - [ ] Declaring source code encodings (PEP 263) - [ ] Other issues - - [ ] Building Python (UCS2, UCS4) + - [ ] Building Python (UCS2, UCS4) Modified: python/branches/py3k-issue1717/Doc/howto/urllib2.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/urllib2.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/urllib2.rst Sun Jan 25 21:08:20 2009 @@ -10,7 +10,7 @@ HOWTO, available at `urllib2 - Le Manuel manquant `_. - + Introduction ============ @@ -19,9 +19,9 @@ You may also find useful the following article on fetching web resources with Python: - + * `Basic Authentication `_ - + A tutorial on *Basic Authentication*, with examples in Python. **urllib.request** is a `Python `_ module for fetching URLs @@ -98,7 +98,7 @@ library. :: import urllib.parse - import urllib.request + import urllib.request url = 'http://www.someserver.com/cgi-bin/register.cgi' values = {'name' : 'Michael Foord', @@ -161,15 +161,15 @@ Explorer [#]_. :: import urllib.parse - import urllib.request - + import urllib.request + url = 'http://www.someserver.com/cgi-bin/register.cgi' - user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' + user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - + data = urllib.parse.urlencode(values) req = urllib.request.Request(url, data, headers) response = urllib.request.urlopen(req) @@ -183,7 +183,7 @@ =================== *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as +with Python APIs, builtin exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised). @@ -311,18 +311,18 @@ geturl, and info, methods as returned by the ``urllib.response`` module:: >>> req = urllib.request.Request('http://www.python.org/fish.html') - >>> try: + >>> try: >>> urllib.request.urlopen(req) >>> except urllib.error.URLError, e: >>> print(e.code) >>> print(e.read()) - >>> + >>> 404 - - - Error 404: File Not Found + Error 404: File Not Found ...... etc... Wrapping it Up @@ -376,7 +376,7 @@ print('Error code: ', e.code) else: # everything is fine - + info and geturl =============== @@ -448,7 +448,7 @@ and a 'realm'. The header looks like : ``Www-authenticate: SCHEME realm="REALM"``. -e.g. :: +e.g. :: Www-authenticate: Basic realm="cPanel Users" @@ -472,24 +472,24 @@ than the URL you pass to .add_password() will also match. :: # create a password manager - password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() + password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() # Add the username and password. - # If we knew the realm, we could use it instead of ``None``. + # If we knew the realm, we could use it instead of None. top_level_url = "http://example.com/foo/" password_mgr.add_password(None, top_level_url, username, password) - handler = urllib.request.HTTPBasicAuthHandler(password_mgr) + handler = urllib.request.HTTPBasicAuthHandler(password_mgr) # create "opener" (OpenerDirector instance) - opener = urllib.request.build_opener(handler) + opener = urllib.request.build_opener(handler) # use the opener to fetch a URL - opener.open(a_url) + opener.open(a_url) # Install the opener. # Now all calls to urllib.request.urlopen use our opener. - urllib.request.install_opener(opener) + urllib.request.install_opener(opener) .. note:: @@ -545,7 +545,7 @@ # timeout in seconds timeout = 10 - socket.setdefaulttimeout(timeout) + socket.setdefaulttimeout(timeout) # this call to urllib.request.urlopen now uses the default timeout # we have set in the socket module @@ -562,7 +562,7 @@ This document was reviewed and revised by John Lee. .. [#] For an introduction to the CGI protocol see - `Writing Web Applications in Python `_. + `Writing Web Applications in Python `_. .. [#] Like Google for example. The *proper* way to use google from a program is to use `PyGoogle `_ of course. See `Voidspace Google `_ @@ -579,6 +579,6 @@ is set to use the proxy, which urllib picks up on. In order to test scripts with a localhost server, I have to prevent urllib from using the proxy. -.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe +.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_. - + Modified: python/branches/py3k-issue1717/Doc/howto/webservers.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/howto/webservers.rst (original) +++ python/branches/py3k-issue1717/Doc/howto/webservers.rst Sun Jan 25 21:08:20 2009 @@ -88,7 +88,7 @@ `_ with some additional information about CGI in Python. - + Simple script for testing CGI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -387,7 +387,7 @@ You might be interested in some WSGI-supporting modules already contained in the standard library, namely: - + * :mod:`wsgiref` -- some tiny utilities and servers for WSGI @@ -500,7 +500,7 @@ time in looking through the most popular ones. Some frameworks have their own template engine or have a recommentation for one. It's wise to use these. - + Popular template engines include: * Mako @@ -688,7 +688,7 @@ found in the Python wiki. .. seealso:: - + The Python wiki contains an extensive list of `web frameworks `_. Modified: python/branches/py3k-issue1717/Doc/install/index.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/install/index.rst (original) +++ python/branches/py3k-issue1717/Doc/install/index.rst Sun Jan 25 21:08:20 2009 @@ -3,7 +3,7 @@ .. _install-index: ***************************** - Installing Python Modules + Installing Python Modules ***************************** :Author: Greg Ward @@ -18,7 +18,7 @@ Thus, I have to be sure to explain the basics at some point: sys.path and PYTHONPATH at least. Should probably give pointers to other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc. - + Finally, it might be useful to include all the material from my "Care and Feeding of a Python Installation" talk in here somewhere. Yow! @@ -268,7 +268,7 @@ statements shown below, and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`:: - Python 2.4 (#26, Aug 7 2004, 17:19:02) + Python 2.4 (#26, Aug 7 2004, 17:19:02) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix @@ -584,11 +584,11 @@ $ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 - Type ``help'', ``copyright'', ``credits'' or ``license'' for more information. + Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path - ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', - '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', + ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', + '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>> Modified: python/branches/py3k-issue1717/Doc/library/2to3.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/2to3.rst (original) +++ python/branches/py3k-issue1717/Doc/library/2to3.rst Sun Jan 25 21:08:20 2009 @@ -3,7 +3,7 @@ 2to3 - Automated Python 2 to 3 code translation =============================================== -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson 2to3 is a Python program that reads Python 2.x source code and applies a series of *fixers* to transform it into valid Python 3.x code. The standard library Modified: python/branches/py3k-issue1717/Doc/library/abc.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/abc.rst (original) +++ python/branches/py3k-issue1717/Doc/library/abc.rst Sun Jan 25 21:08:20 2009 @@ -42,15 +42,15 @@ Register *subclass* as a "virtual subclass" of this ABC. For example:: - from abc import ABCMeta + from abc import ABCMeta - class MyABC(metaclass=ABCMeta): - pass + class MyABC(metaclass=ABCMeta): + pass - MyABC.register(tuple) + MyABC.register(tuple) - assert issubclass(tuple, MyABC) - assert isinstance((), MyABC) + assert issubclass(tuple, MyABC) + assert isinstance((), MyABC) You can also override this method in an abstract base class: @@ -128,7 +128,7 @@ A decorator indicating abstract methods. Using this decorator requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. @@ -163,7 +163,7 @@ A subclass of the built-in :func:`property`, indicating an abstract property. Using this function requires that the class's metaclass is :class:`ABCMeta` or - is derived from it. + is derived from it. A class that has a metaclass derived from :class:`ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract properties can be called using any of the normal Modified: python/branches/py3k-issue1717/Doc/library/aifc.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/aifc.rst (original) +++ python/branches/py3k-issue1717/Doc/library/aifc.rst Sun Jan 25 21:08:20 2009 @@ -17,7 +17,7 @@ ability to compress the audio data. .. warning:: - + Some operations may only work under IRIX; these will raise :exc:`ImportError` when attempting to import the :mod:`cl` module, which is only available on IRIX. Modified: python/branches/py3k-issue1717/Doc/library/array.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/array.rst (original) +++ python/branches/py3k-issue1717/Doc/library/array.rst Sun Jan 25 21:08:20 2009 @@ -52,7 +52,7 @@ Return a new array whose items are restricted by *typecode*, and initialized from the optional *initializer* value, which must be a list, object - supporting the buffer interface, or iterable over elements of the + supporting the buffer interface, or iterable over elements of the appropriate type. If given a list or string, the initializer is passed to the new array's Modified: python/branches/py3k-issue1717/Doc/library/ast.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/ast.rst (original) +++ python/branches/py3k-issue1717/Doc/library/ast.rst Sun Jan 25 21:08:20 2009 @@ -114,7 +114,7 @@ Parse an expression into an AST node. Equivalent to ``compile(expr, filename, mode, ast.PyCF_ONLY_AST)``. - + .. function:: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python @@ -178,7 +178,7 @@ A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -192,7 +192,7 @@ .. method:: generic_visit(node) This visitor calls :meth:`visit` on all children of the node. - + Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself. @@ -207,11 +207,11 @@ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: Modified: python/branches/py3k-issue1717/Doc/library/audioop.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/audioop.rst (original) +++ python/branches/py3k-issue1717/Doc/library/audioop.rst Sun Jan 25 21:08:20 2009 @@ -260,7 +260,7 @@ in_test = inputdata[pos*2:] ipos, factor = audioop.findfit(in_test, out_test) # Optional (for better cancellation): - # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], + # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) Modified: python/branches/py3k-issue1717/Doc/library/base64.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/base64.rst (original) +++ python/branches/py3k-issue1717/Doc/library/base64.rst Sun Jan 25 21:08:20 2009 @@ -154,7 +154,7 @@ >>> import base64 >>> encoded = base64.b64encode('data to be encoded') >>> encoded - 'ZGF0YSB0byBiZSBlbmNvZGVk' + b'ZGF0YSB0byBiZSBlbmNvZGVk' >>> data = base64.b64decode(encoded) >>> data 'data to be encoded' Modified: python/branches/py3k-issue1717/Doc/library/bdb.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/bdb.rst (original) +++ python/branches/py3k-issue1717/Doc/library/bdb.rst Sun Jan 25 21:08:20 2009 @@ -325,7 +325,7 @@ Check whether we should break here, depending on the way the breakpoint *b* was set. - + If it was set via line number, it checks if ``b.line`` is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if @@ -335,7 +335,7 @@ Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. - + Called only if we know there is a breakpoint at this location. Returns the breakpoint that was triggered and a flag that indicates if it is ok to delete a temporary breakpoint. 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 Jan 25 21:08:20 2009 @@ -113,8 +113,19 @@ print(binascii.crc32("hello world")) # Or, in two pieces: crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) - print(crc) + crc = binascii.crc32(" world", crc) & 0xffffffff + print('crc32 = 0x%08x' % crc) + +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. .. function:: b2a_hex(data) Modified: python/branches/py3k-issue1717/Doc/library/cmath.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/cmath.rst (original) +++ python/branches/py3k-issue1717/Doc/library/cmath.rst Sun Jan 25 21:08:20 2009 @@ -68,9 +68,9 @@ .. function:: polar(x) - Convert a :class:`complex` from rectangular coordinates to polar + Convert a :class:`complex` from rectangular coordinates to polar coordinates. The function returns a tuple with the two elements - *r* and *phi*. *r* is the distance from 0 and *phi* the phase + *r* and *phi*. *r* is the distance from 0 and *phi* the phase angle. Modified: python/branches/py3k-issue1717/Doc/library/codeop.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/codeop.rst (original) +++ python/branches/py3k-issue1717/Doc/library/codeop.rst Sun Jan 25 21:08:20 2009 @@ -43,7 +43,7 @@ other value will cause :exc:`ValueError` to be raised. .. warning:: - + It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, Modified: python/branches/py3k-issue1717/Doc/library/collections.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/collections.rst (original) +++ python/branches/py3k-issue1717/Doc/library/collections.rst Sun Jan 25 21:08:20 2009 @@ -41,36 +41,36 @@ :class:`Hashable` ``__hash__`` :class:`Iterable` ``__iter__`` :class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__`` -:class:`Sized` ``__len__`` +:class:`Sized` ``__len__`` :class:`Callable` ``__call__`` - + :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. :class:`Iterable`, and ``__len__`` ``index``, and ``count`` - :class:`Container` - + :class:`Container` + :class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` - + :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:`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 + ``__iter__``, and ``__len__`` - + :class:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, :class:`Set` ``__iter__`` @@ -84,7 +84,7 @@ size = None if isinstance(myvar, collections.Sized): - size = len(myvar) + size = len(myvar) Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting @@ -140,12 +140,161 @@ (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.) -.. _deque-objects: +:class:`Counter` objects +------------------------ + +A counter tool is provided to support convenient and rapid tallies. +For example:: + + # 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 + >>> import re + >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) + >>> Counter(words).most_common(10) + [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), + ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] + +.. class:: Counter([iterable-or-mapping]) + + A :class:`Counter` is a :class:`dict` subclass for counting hashable objects. + It is an unordered collection where elements are stored as dictionary keys + and their counts are stored as dictionary values. Counts are allowed to be + any integer value including zero or negative counts. The :class:`Counter` + class is similar to bags or multisets in other languages. + + Elements are counted from an *iterable* or initialized from another + *mapping* (or counter):: + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args + + Counter objects have a dictionary interface except that they return a zero + count for missing items instead of raising a :exc:`KeyError`:: + + >>> c = Counter(['eggs', 'ham']) + >>> c['bacon'] # count of a missing element is zero + 0 + + Setting a count to zero does not remove an element from a counter. + Use ``del`` to remove it entirely: + + >>> c['sausage'] = 0 # counter entry with a zero count + >>> del c['sausage'] # del actually removes the entry + + .. versionadded:: 2.7 + + + Counter objects support two methods beyond those available for all + dictionaries: + + .. method:: elements() + + Return an iterator over elements repeating each as many times as its + count. Elements are returned in arbitrary order. If an element's count + is less than one, :meth:`elements` will ignore it. + + >>> c = Counter(a=4, b=2, c=0, d=-2) + >>> list(c.elements()) + ['a', 'a', 'a', 'a', 'b', 'b'] + + .. 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* is not specified or is ``None``, + return a list of all element counts in decreasing order of frequency. + Elements with equal counts are ordered arbitrarily:: + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + The usual dictionary methods are available for :class:`Counter` objects + except for two which work differently for counters. + + .. method:: fromkeys(iterable) + + This class method is not implemented for :class:`Counter` objects. + + .. method:: update([iterable-or-mapping]) + + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter). Like :meth:`dict.update` but adds-in counts + instead of replacing them. Also, the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs:: + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + +Common patterns for working with :class:`Counter` objects:: + + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + 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. All four multiset operations exclude results with +counts less than one:: + + >>> c = Counter(a=3, b=1) + >>> d = Counter(a=1, b=2) + >>> c + d # add two counters together: c[x] + d[x] + Counter({'a': 4, 'b': 3}) + >>> c - d # subtract (keeping only positive counts) + Counter({'a': 2}) + >>> c & d # intersection: min(c[x], d[x]) + Counter({'a': 1, 'b': 1}) + >>> c | d # union: max(c[x], d[x]) + Counter({'a': 3, 'b': 2}) + +.. seealso:: + + * `Counter class `_ + adapted for Python 2.5 and an early `Bag recipe + `_ for Python 2.4. + + * `Bag class `_ + in Smalltalk. + + * Wikipedia entry for `Multisets `_\. + + * `C++ multisets `_ + tutorial with examples. + + * For mathematical operations on multisets and their use cases, see + *Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19*\. + + * To enumerate all distinct multisets of a given size over a given set of + elements, see the :func:`combinations_with_replacement` function in the + :ref:`itertools-recipes` for itertools:: + + map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC + :class:`deque` objects ---------------------- - .. class:: deque([iterable[, maxlen]]) Returns a new deque object initialized left-to-right (using :meth:`append`) with @@ -288,8 +437,6 @@ deque(['c', 'b', 'a']) -.. _deque-recipes: - :class:`deque` Recipes ^^^^^^^^^^^^^^^^^^^^^^ @@ -337,12 +484,10 @@ 'Return the last n lines of a file' return deque(open(filename), n) -.. _defaultdict-objects: :class:`defaultdict` objects ---------------------------- - .. class:: defaultdict([default_factory[, ...]]) Returns a new dictionary-like object. :class:`defaultdict` is a subclass of the @@ -386,8 +531,6 @@ ``None``, if absent. -.. _defaultdict-examples: - :class:`defaultdict` Examples ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -457,8 +600,6 @@ [('blue', set([2, 4])), ('red', set([1, 3]))] -.. _named-tuple-factory: - :func:`namedtuple` Factory Function for Tuples with Named Fields ---------------------------------------------------------------- @@ -526,8 +667,8 @@ if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result - - def __getnewargs__(self): + + def __getnewargs__(self): return tuple(self) x = property(itemgetter(0)) @@ -674,8 +815,8 @@ :class:`UserDict` objects ------------------------- -The class, :class:`UserDict` acts as a wrapper around dictionary objects. -The need for this class has been partially supplanted by the ability to +The class, :class:`UserDict` acts as a wrapper around dictionary objects. +The need for this class has been partially supplanted by the ability to subclass directly from :class:`dict`; however, this class can be easier to work with because the underlying dictionary is accessible as an attribute. @@ -688,7 +829,7 @@ initialized with its contents; note that a reference to *initialdata* will not be kept, allowing it be used for other purposes. -In addition to supporting the methods and operations of mappings, +In addition to supporting the methods and operations of mappings, :class:`UserDict` instances provide the following attribute: .. attribute:: UserDict.data @@ -701,11 +842,11 @@ ------------------------- This class acts as a wrapper around list objects. It is a useful base class -for your own list-like classes which can inherit from them and override +for your own list-like classes which can inherit from them and override existing methods or add new ones. In this way, one can add new behaviors to lists. -The need for this class has been partially supplanted by the ability to +The need for this class has been partially supplanted by the ability to subclass directly from :class:`list`; however, this class can be easier to work with because the underlying list is accessible as an attribute. @@ -717,12 +858,12 @@ defaulting to the empty list ``[]``. *list* can be any iterable, for example a real Python list or a :class:`UserList` object. -In addition to supporting the methods and operations of mutable sequences, +In addition to supporting the methods and operations of mutable sequences, :class:`UserList` instances provide the following attribute: .. attribute:: UserList.data - A real :class:`list` object used to store the contents of the + A real :class:`list` object used to store the contents of the :class:`UserList` class. **Subclassing requirements:** Subclasses of :class:`UserList` are expect to @@ -740,8 +881,8 @@ :class:`UserString` objects --------------------------- -The class, :class:`UserString` acts as a wrapper around string objects. -The need for this class has been partially supplanted by the ability to +The class, :class:`UserString` acts as a wrapper around string objects. +The need for this class has been partially supplanted by the ability to subclass directly from :class:`str`; however, this class can be easier to work with because the underlying string is accessible as an attribute. @@ -749,8 +890,8 @@ .. class:: UserString([sequence]) Class that simulates a string or a Unicode string object. The instance's - content is kept in a regular string object, which is accessible via the - :attr:`data` attribute of :class:`UserString` instances. The instance's + content is kept in a regular string object, which is accessible via the + :attr:`data` attribute of :class:`UserString` instances. The instance's contents are initially set to a copy of *sequence*. The *sequence* can be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a subclass) or an arbitrary sequence which can be converted into a string using Modified: python/branches/py3k-issue1717/Doc/library/configparser.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/configparser.rst (original) +++ python/branches/py3k-issue1717/Doc/library/configparser.rst Sun Jan 25 21:08:20 2009 @@ -344,7 +344,7 @@ import configparser config = configparser.RawConfigParser() - + # When adding sections or items, add them in the reverse order of # how you want them to be displayed in the actual file. # In addition, please note that using RawConfigParser's and the raw @@ -359,7 +359,7 @@ config.set('Section1', 'baz', 'fun') config.set('Section1', 'bar', 'Python') config.set('Section1', 'foo', '%(bar)s is %(baz)s!') - + # Writing our configuration file to 'example.cfg' with open('example.cfg', 'wb') as configfile: config.write(configfile) @@ -399,7 +399,7 @@ print(config.get('Section1', 'foo', 0, {'bar': 'Documentation', 'baz': 'evil'})) -Defaults are available in all three types of ConfigParsers. They are used in +Defaults are available in all three types of ConfigParsers. They are used in interpolation if an option used is not defined elsewhere. :: import configparser @@ -407,7 +407,7 @@ # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'}) config.read('example.cfg') - + print(config.get('Section1', 'foo')) # -> "Python is fun!" config.remove_option('Section1', 'bar') config.remove_option('Section1', 'baz') Modified: python/branches/py3k-issue1717/Doc/library/constants.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/constants.rst (original) +++ python/branches/py3k-issue1717/Doc/library/constants.rst Sun Jan 25 21:08:20 2009 @@ -14,13 +14,13 @@ .. data:: False - The false value of the :class:`bool` type. Assignments to ``False`` + The false value of the :class:`bool` type. Assignments to ``False`` are illegal and raise a :exc:`SyntaxError`. .. data:: True - The true value of the :class:`bool` type. Assignments to ``True`` + The true value of the :class:`bool` type. Assignments to ``True`` are illegal and raise a :exc:`SyntaxError`. Modified: python/branches/py3k-issue1717/Doc/library/crypt.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/crypt.rst (original) +++ python/branches/py3k-issue1717/Doc/library/crypt.rst Sun Jan 25 21:08:20 2009 @@ -51,7 +51,7 @@ username = input('Python login:') cryptedpasswd = pwd.getpwnam(username)[1] if cryptedpasswd: - if cryptedpasswd == 'x' or cryptedpasswd == '*': + if cryptedpasswd == 'x' or cryptedpasswd == '*': raise "Sorry, currently no support for shadow passwords" cleartext = getpass.getpass() return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd Modified: python/branches/py3k-issue1717/Doc/library/csv.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/csv.rst (original) +++ python/branches/py3k-issue1717/Doc/library/csv.rst Sun Jan 25 21:08:20 2009 @@ -82,7 +82,7 @@ be split into lines in a manner which preserves the newline characters. A short usage example:: - + >>> import csv >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|') >>> for row in spamReader: Modified: python/branches/py3k-issue1717/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/ctypes.rst (original) +++ python/branches/py3k-issue1717/Doc/library/ctypes.rst Sun Jan 25 21:08:20 2009 @@ -1376,24 +1376,22 @@ The *mode* parameter can be used to specify how the library is loaded. For details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored. -The *use_errno* parameter, when set to True, enables a ctypes -mechanism that allows to access the system `errno` error number in a -safe way. `ctypes` maintains a thread-local copy of the systems -`errno` variable; if you call foreign functions created with -`use_errno=True` then the `errno` value before the function call is -swapped with the ctypes private copy, the same happens immediately -after the function call. - -The function `ctypes.get_errno()` returns the value of the ctypes -private copy, and the function `ctypes.set_errno(value)` changes the -ctypes private copy to `value` and returns the former value. - -The *use_last_error* parameter, when set to True, enables the same -mechanism for the Windows error code which is managed by the -:func:`GetLastError` and :func:`SetLastError` Windows API functions; -`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used -to request and change the ctypes private copy of the windows error -code. +The *use_errno* parameter, when set to True, enables a ctypes mechanism that +allows to access the system :data:`errno` error number in a safe way. +:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` +variable; if you call foreign functions created with ``use_errno=True`` then the +:data:`errno` value before the function call is swapped with the ctypes private +copy, the same happens immediately after the function call. + +The function :func:`ctypes.get_errno` returns the value of the ctypes private +copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy +to a new value and returns the former value. + +The *use_last_error* parameter, when set to True, enables the same mechanism for +the Windows error code which is managed by the :func:`GetLastError` and +:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and +:func:`ctypes.set_last_error` are used to request and change the ctypes private +copy of the windows error code. .. data:: RTLD_GLOBAL :noindex: @@ -1596,18 +1594,20 @@ .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) The returned function prototype creates functions that use the standard C - calling convention. The function will release the GIL during the call. - If `use_errno` is set to True, the ctypes private copy of the system `errno` - variable is exchanged with the real `errno` value bafore and after the call; - `use_last_error` does the same for the Windows error code. + calling convention. The function will release the GIL during the call. If + *use_errno* is set to True, the ctypes private copy of the system + :data:`errno` variable is exchanged with the real :data:`errno` value bafore + and after the call; *use_last_error* does the same for the Windows error + code. .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) Windows only: The returned function prototype creates functions that use the - ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE` - is the same as :func:`CFUNCTYPE`. The function will release the GIL during the - call. `use_errno` and `use_last_error` have the same meaning as above. + ``stdcall`` calling convention, except on Windows CE where + :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will + release the GIL during the call. *use_errno* and *use_last_error* have the + same meaning as above. .. function:: PYFUNCTYPE(restype, *argtypes) @@ -1852,10 +1852,10 @@ .. function:: find_library(name) :module: ctypes.util - Try to find a library and return a pathname. `name` is the library name without - any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this - is the form used for the posix linker option :option:`-l`). If no library can - be found, returns ``None``. + Try to find a library and return a pathname. *name* is the library name + without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version + number (this is the form used for the posix linker option :option:`-l`). If + no library can be found, returns ``None``. The exact functionality is system dependent. @@ -1887,12 +1887,12 @@ .. function:: get_errno() Returns the current value of the ctypes-private copy of the system - `errno` variable in the calling thread. + :data:`errno` variable in the calling thread. .. function:: get_last_error() Windows only: returns the current value of the ctypes-private copy of the system - `LastError` variable in the calling thread. + :data:`LastError` variable in the calling thread. .. function:: memmove(dst, src, count) @@ -1947,15 +1947,14 @@ .. function:: set_errno(value) - Set the current value of the ctypes-private copy of the system - `errno` variable in the calling thread to `value` and return the - previous value. + Set the current value of the ctypes-private copy of the system :data:`errno` + variable in the calling thread to *value* and return the previous value. .. function:: set_last_error(value) - Windows only: set the current value of the ctypes-private copy of - the system `LastError` variable in the calling thread to `value` - and return the previous value. + Windows only: set the current value of the ctypes-private copy of the system + :data:`LastError` variable in the calling thread to *value* and return the + previous value. .. function:: sizeof(obj_or_type) @@ -2407,10 +2406,10 @@ ("hreftype", HREFTYPE)] class TYPEDESC(Structure): + _anonymous_ = ("u",) _fields_ = [("u", _U), ("vt", VARTYPE)] - _anonymous_ = ("u",) The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field Modified: python/branches/py3k-issue1717/Doc/library/datetime.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/datetime.rst (original) +++ python/branches/py3k-issue1717/Doc/library/datetime.rst Sun Jan 25 21:08:20 2009 @@ -264,10 +264,10 @@ considered to be true if and only if it isn't equal to ``timedelta(0)``. Example usage: - + >>> from datetime import timedelta >>> year = timedelta(days=365) - >>> another_year = timedelta(weeks=40, days=84, hours=23, + >>> another_year = timedelta(weeks=40, days=84, hours=23, ... minutes=50, seconds=600) # adds up to 365 days >>> year == another_year True @@ -515,10 +515,10 @@ True >>> my_birthday = date(today.year, 6, 24) >>> if my_birthday < today: - ... my_birthday = my_birthday.replace(year=today.year + 1) + ... my_birthday = my_birthday.replace(year=today.year + 1) >>> my_birthday datetime.date(2008, 6, 24) - >>> time_to_birthday = abs(my_birthday - today) + >>> time_to_birthday = abs(my_birthday - today) >>> time_to_birthday.days 202 @@ -1012,7 +1012,7 @@ >>> tt = dt.timetuple() >>> for it in tt: # doctest: +SKIP ... print(it) - ... + ... 2006 # year 11 # month 21 # day @@ -1041,23 +1041,23 @@ ... def __init__(self): # DST starts last Sunday in March ... d = datetime(dt.year, 4, 1) # ends last Sunday in October ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) - ... def dst(self, dt): + ... def dst(self, dt): ... if self.dston <= dt.replace(tzinfo=None) < self.dstoff: ... return timedelta(hours=1) ... else: ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +1" - ... + ... >>> class GMT2(tzinfo): ... def __init__(self): - ... d = datetime(dt.year, 4, 1) + ... d = datetime(dt.year, 4, 1) ... self.dston = d - timedelta(days=d.weekday() + 1) - ... d = datetime(dt.year, 11, 1) + ... d = datetime(dt.year, 11, 1) ... self.dstoff = d - timedelta(days=d.weekday() + 1) ... def utcoffset(self, dt): ... return timedelta(hours=1) + self.dst(dt) @@ -1068,7 +1068,7 @@ ... return timedelta(0) ... def tzname(self,dt): ... return "GMT +2" - ... + ... >>> gmt1 = GMT1() >>> # Daylight Saving Time >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1) @@ -1089,7 +1089,7 @@ datetime.datetime(2006, 6, 14, 13, 0, tzinfo=) >>> dt2.utctimetuple() == dt3.utctimetuple() True - + .. _datetime-time: @@ -1237,12 +1237,12 @@ return ``None`` or a string object. Example: - + >>> from datetime import time, tzinfo >>> class GMT1(tzinfo): ... def utcoffset(self, dt): - ... return timedelta(hours=1) - ... def dst(self, dt): + ... return timedelta(hours=1) + ... def dst(self, dt): ... return timedelta(0) ... def tzname(self,dt): ... return "Europe/Prague" @@ -1473,7 +1473,7 @@ :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any other fixed-offset :class:`tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)). - + .. _strftime-behavior: @@ -1494,10 +1494,6 @@ 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. - For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty strings. @@ -1516,7 +1512,7 @@ The full set of format codes supported varies across platforms, because Python calls the platform C library's :func:`strftime` function, and platform -variations are common. +variations are common. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C @@ -1616,7 +1612,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/py3k-issue1717/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/decimal.rst (original) +++ python/branches/py3k-issue1717/Doc/library/decimal.rst Sun Jan 25 21:08:20 2009 @@ -323,7 +323,7 @@ infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity - numeric-string ::= [sign] numeric-value | [sign] nan + numeric-string ::= [sign] numeric-value | [sign] nan If *value* is a :class:`tuple`, it should have three components, a sign (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of @@ -453,6 +453,29 @@ >>> Decimal(321).exp() Decimal('2.561702493119680037517373933E+139') + .. method:: from_float(f) + + Classmethod that converts a float to a decimal number, exactly. + + Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + `0x1.999999999999ap-4`. That equivalent value in decimal is + `0.1000000000000000055511151231257827021181583404541015625`. + + .. doctest:: + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(float('-inf')) + Decimal('-Infinity') + + .. versionadded:: 3.1 + .. method:: fma(other, third[, context]) Fused multiply-add. Return self*other+third with no rounding of the @@ -852,7 +875,7 @@ * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer), * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or * :const:`ROUND_UP` (away from zero). - * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero + * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise towards zero) The *traps* and *flags* fields list any signals to be set. Generally, new @@ -910,6 +933,26 @@ If the argument is a string, no leading or trailing whitespace is permitted. + .. method:: create_decimal_from_float(f) + + Creates a new Decimal instance from a float *f* but rounding using *self* + as the context. Unlike the :meth:`Decimal.from_float` class method, + the context precision, rounding method, flags, and traps are applied to + the conversion. + + .. doctest:: + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(math.pi) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(math.pi) + Traceback (most recent call last): + ... + decimal.Inexact: None + + .. versionadded:: 3.1 + .. method:: Etiny() Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent @@ -1071,7 +1114,7 @@ .. method:: logical_and(x, y) - Applies the logical operation `and` between each operand's digits. + Applies the logical operation *and* between each operand's digits. .. method:: logical_invert(x) @@ -1081,12 +1124,12 @@ .. method:: logical_or(x, y) - Applies the logical operation `or` between each operand's digits. + Applies the logical operation *or* between each operand's digits. .. method:: logical_xor(x, y) - Applies the logical operation `xor` between each operand's digits. + Applies the logical operation *xor* between each operand's digits. .. method:: max(x, y) @@ -1194,8 +1237,8 @@ .. method:: remainder_near(x, y) - Returns `x - y * n`, where *n* is the integer nearest the exact value - of `x / y` (if the result is `0` then its sign will be the sign of *x*). + Returns ``x - y * n``, where *n* is the integer nearest the exact value + of ``x / y`` (if the result is 0 then its sign will be the sign of *x*). .. method:: rotate(x, y) @@ -1312,7 +1355,7 @@ sqrt(-x) and x > 0 0 ** 0 x ** (non-integer) - x ** Infinity + x ** Infinity .. class:: Overflow @@ -1415,7 +1458,7 @@ Decimal('9.51111111') >>> u + (v + w) Decimal('9.51111111') - >>> + >>> >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003') >>> (u*v) + (u*w) Decimal('0.0060000') @@ -1554,7 +1597,7 @@ """ q = Decimal(10) ** -places # 2 places --> '0.01' - sign, digits, exp = value.quantize(q).as_tuple() + sign, digits, exp = value.quantize(q).as_tuple() result = [] digits = list(map(str, digits)) build, next = result.append, digits.pop @@ -1611,12 +1654,12 @@ getcontext().prec += 2 i, lasts, s, fact, num = 0, 0, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 1 fact *= i - num *= x - s += num / fact - getcontext().prec -= 2 + num *= x + s += num / fact + getcontext().prec -= 2 return +s def cos(x): @@ -1633,13 +1676,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s def sin(x): @@ -1656,13 +1699,13 @@ getcontext().prec += 2 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 while s != lasts: - lasts = s + lasts = s i += 2 fact *= i * (i-1) num *= x * x sign *= -1 - s += num / fact * sign - getcontext().prec -= 2 + s += num / fact * sign + getcontext().prec -= 2 return +s @@ -1696,7 +1739,7 @@ >>> Decimal('3.214').quantize(TWOPLACES) Decimal('3.21') - >>> # Validate that a number does not exceed two places + >>> # Validate that a number does not exceed two places >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact])) Decimal('3.21') Modified: python/branches/py3k-issue1717/Doc/library/dis.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/dis.rst (original) +++ python/branches/py3k-issue1717/Doc/library/dis.rst Sun Jan 25 21:08:20 2009 @@ -79,8 +79,8 @@ Detect all offsets in the code object *code* which are jump targets, and return a list of these offsets. - - + + .. data:: opname Sequence of operation names, indexable using the bytecode. @@ -502,7 +502,7 @@ The low byte of *counts* is the number of values before the list value, the high byte of *counts* the number of values after it. The resulting values are put onto the stack right-to-left. - + .. opcode:: DUP_TOPX (count) @@ -701,7 +701,7 @@ opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, - the function object to call is on the stack. Pops all function arguments, and + the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value. Modified: python/branches/py3k-issue1717/Doc/library/email.mime.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/email.mime.rst (original) +++ python/branches/py3k-issue1717/Doc/library/email.mime.rst Sun Jan 25 21:08:20 2009 @@ -2,7 +2,7 @@ ---------------------------------------------------------- .. module:: email.mime - :synopsis: Build MIME messages. + :synopsis: Build MIME messages. Ordinarily, you get a message object structure by passing a file or some text to @@ -55,14 +55,14 @@ .. currentmodule:: email.mime.multipart -.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]]) +.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) Module: :mod:`email.mime.multipart` A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A - :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be + :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added. Modified: python/branches/py3k-issue1717/Doc/library/fileinput.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/fileinput.rst (original) +++ python/branches/py3k-issue1717/Doc/library/fileinput.rst Sun Jan 25 21:08:20 2009 @@ -145,7 +145,7 @@ when standard input is read. .. warning:: - + The current implementation does not work for MS-DOS 8+3 filesystems. Modified: python/branches/py3k-issue1717/Doc/library/fractions.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/fractions.rst (original) +++ python/branches/py3k-issue1717/Doc/library/fractions.rst Sun Jan 25 21:08:20 2009 @@ -126,11 +126,11 @@ .. function:: gcd(a, b) - Return the greatest common divisor of the integers `a` and `b`. If - either `a` or `b` is nonzero, then the absolute value of `gcd(a, - b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)` - has the same sign as `b` if `b` is nonzero; otherwise it takes the sign - of `a`. `gcd(0, 0)` returns `0`. + Return the greatest common divisor of the integers *a* and *b*. If either + *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the + largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same + sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0, + 0)`` returns ``0``. .. seealso:: Modified: python/branches/py3k-issue1717/Doc/library/ftplib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/ftplib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/ftplib.rst Sun Jan 25 21:08:20 2009 @@ -1,4 +1,3 @@ - :mod:`ftplib` --- FTP protocol client ===================================== Modified: python/branches/py3k-issue1717/Doc/library/functions.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/functions.rst (original) +++ python/branches/py3k-issue1717/Doc/library/functions.rst Sun Jan 25 21:08:20 2009 @@ -95,7 +95,7 @@ the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :class:`bytearray` -- it has the same non-mutating methods and the same indexing and slicing behavior. - + Accordingly, constructor arguments are interpreted as for :func:`buffer`. Bytes objects can also be created with literals, see :ref:`strings`. @@ -271,7 +271,7 @@ Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed - operand types, the rules for binary arithmetic operators apply. For integers, + operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as ``(a // b, a % b)``. For floating point numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very close to @@ -411,12 +411,12 @@ .. index:: 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`. - + .. note:: ``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``. @@ -573,7 +573,7 @@ returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, returns a new empty list, ``[]``. - :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. + :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. .. function:: locals() @@ -654,7 +654,7 @@ .. function:: open(file[, mode='r'[, buffering=None[, encoding=None[, errors=None[, newline=None[, closefd=True]]]]]]) Open a file. If the file cannot be opened, :exc:`IOError` is raised. - + *file* is either a string or bytes object 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 @@ -699,7 +699,7 @@ *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 @@ -991,7 +991,7 @@ .. function:: str([object[, encoding[, errors]]]) Return a string version of an object, using one of the following modes: - + If *encoding* and/or *errors* are given, :func:`str` will decode the *object* which can either be a byte string or a character buffer using the codec for *encoding*. The *encoding* parameter is a string giving @@ -1002,7 +1002,7 @@ errors, while a value of ``'ignore'`` causes errors to be silently ignored, and a value of ``'replace'`` causes the official Unicode replacement character, U+FFFD, to be used to replace input characters which cannot be decoded. - See also the :mod:`codecs` module. + See also the :mod:`codecs` module. When only *object* is given, this returns its nicely printable representation. For strings, this is the string itself. The difference with ``repr(object)`` @@ -1042,10 +1042,10 @@ single inheritance, :func:`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. - + The second use case is to support cooperative multiple inheritence 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 + 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 @@ -1080,7 +1080,7 @@ 3])`` returns ``(1, 2, 3)``. If no argument is given, returns a new empty tuple, ``()``. - :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. + :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. .. function:: type(object) @@ -1110,7 +1110,7 @@ >>> class X(object): ... a = 1 - ... + ... >>> X = type('X', (object,), dict(a=1)) @@ -1125,12 +1125,12 @@ .. function:: zip(*iterables) - Make an iterator that aggregates elements from each of the iterables. + Make an iterator that aggregates elements from each of the iterables. Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th element from each of the argument sequences or iterables. The iterator stops when the shortest input iterable is exhausted. With a single - iterable argument, it returns an iterator of 1-tuples. With no arguments, + iterable argument, it returns an iterator of 1-tuples. With no arguments, it returns an empty iterator. Equivalent to:: def zip(*iterables): @@ -1199,7 +1199,7 @@ For example, the statement ``import spam`` results in bytecode resembling the following code:: - + spam = __import__('spam', globals(), locals(), [], -1) The statement ``import spam.ham`` results in this call:: Modified: python/branches/py3k-issue1717/Doc/library/gettext.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/gettext.rst (original) +++ python/branches/py3k-issue1717/Doc/library/gettext.rst Sun Jan 25 21:08:20 2009 @@ -369,7 +369,7 @@ If the message id is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's :meth:`ngettext` method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is returned in all other cases. - + Here is an example:: n = len(os.listdir('.')) @@ -551,10 +551,9 @@ animals = ['mollusk', 'albatross', - 'rat', - 'penguin', - 'python', - ] + 'rat', + 'penguin', + 'python', ] # ... for a in animals: print(a) @@ -569,10 +568,9 @@ animals = [_('mollusk'), _('albatross'), - _('rat'), - _('penguin'), - _('python'), - ] + _('rat'), + _('penguin'), + _('python'), ] del _ @@ -595,10 +593,9 @@ animals = [N_('mollusk'), N_('albatross'), - N_('rat'), - N_('penguin'), - N_('python'), - ] + N_('rat'), + N_('penguin'), + N_('python'), ] # ... for a in animals: Modified: python/branches/py3k-issue1717/Doc/library/gzip.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/gzip.rst (original) +++ python/branches/py3k-issue1717/Doc/library/gzip.rst Sun Jan 25 21:08:20 2009 @@ -7,7 +7,7 @@ This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would. -The data compression is provided by the :mod:``zlib`` module. +The data compression is provided by the :mod:`zlib` module. The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled after Python's File Object. The :class:`GzipFile` class reads and writes @@ -24,7 +24,7 @@ The module defines the following items: -.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj]]]]) +.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]]) Constructor for the :class:`GzipFile` class, which simulates most of the methods of a file object, with the exception of the :meth:`readinto` and @@ -52,6 +52,15 @@ level of compression; ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. The default is ``9``. + The *mtime* argument is an optional numeric timestamp to be written to + the stream when compressing. All :program:`gzip`compressed streams are + required to contain a timestamp. If omitted or ``None``, the current + time is used. This module ignores the timestamp when decompressing; + however, some programs, such as :program:`gunzip`\ , make use of it. + The format of the timestamp is the same as that of the return value of + ``time.time()`` and of the ``st_mtime`` member of the object returned + by ``os.stat()``. + Calling a :class:`GzipFile` object's :meth:`close` method does not close *fileobj*, since you might wish to append more material after the compressed data. This also allows you to pass a :class:`StringIO` object opened for Modified: python/branches/py3k-issue1717/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/hashlib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/hashlib.rst Sun Jan 25 21:08:20 2009 @@ -4,8 +4,8 @@ .. module:: hashlib :synopsis: Secure hash and message digest algorithms. -.. moduleauthor:: Gregory P. Smith -.. sectionauthor:: Gregory P. Smith +.. moduleauthor:: Gregory P. Smith +.. sectionauthor:: Gregory P. Smith .. index:: @@ -37,6 +37,11 @@ .. note:: + For better multithreading performance, the Python GIL is released for + strings of more than 2047 bytes at object creation or on update. + +.. note:: + Feeding string objects is to :meth:`update` is not supported, as hashes work on bytes, not on characters. Modified: python/branches/py3k-issue1717/Doc/library/heapq.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/heapq.rst (original) +++ python/branches/py3k-issue1717/Doc/library/heapq.rst Sun Jan 25 21:08:20 2009 @@ -100,7 +100,7 @@ H N - + The module also offers three general purpose functions based on heaps. Modified: python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst (original) +++ python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst Sun Jan 25 21:08:20 2009 @@ -704,7 +704,7 @@ The :class:`Cookie` class also defines the following method: -.. method:: Cookie.is_expired([now=:const:`None`]) +.. method:: Cookie.is_expired([now=None]) True if cookie has passed the time at which the server requested it should expire. If *now* is given (in seconds since the epoch), return whether the Modified: python/branches/py3k-issue1717/Doc/library/http.cookies.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/http.cookies.rst (original) +++ python/branches/py3k-issue1717/Doc/library/http.cookies.rst Sun Jan 25 21:08:20 2009 @@ -131,9 +131,6 @@ The keys are case-insensitive. - .. versionadded:: 2.6 - The :attr:`httponly` attribute was added. - .. attribute:: Morsel.value Modified: python/branches/py3k-issue1717/Doc/library/idle.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/idle.rst (original) +++ python/branches/py3k-issue1717/Doc/library/idle.rst Sun Jan 25 21:08:20 2009 @@ -230,7 +230,7 @@ Keywords orange - Strings + Strings green Comments Modified: python/branches/py3k-issue1717/Doc/library/inspect.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/inspect.rst (original) +++ python/branches/py3k-issue1717/Doc/library/inspect.rst Sun Jan 25 21:08:20 2009 @@ -384,7 +384,7 @@ .. function:: getargspec(func) - Get the names and default values of a function's arguments. A + Get the names and default values of a function's arguments. A :term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is returned. *args* is a list of the argument names. *varargs* and *varkw* are the names of the ``*`` and @@ -416,7 +416,7 @@ .. function:: getargvalues(frame) - Get information about arguments passed into a particular frame. A :term:`named tuple` + Get information about arguments passed into a particular frame. A :term:`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. *args* is a list of the argument names (it may contain nested lists). *varargs* and *varkw* are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals @@ -484,7 +484,7 @@ .. function:: getframeinfo(frame[, context]) - Get information about a frame or traceback object. A :term:`named tuple` + Get information about a frame or traceback object. A :term:`named tuple` ``Traceback(filename, lineno, function, code_context, index)`` is returned. Modified: python/branches/py3k-issue1717/Doc/library/io.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/io.rst (original) +++ python/branches/py3k-issue1717/Doc/library/io.rst Sun Jan 25 21:08:20 2009 @@ -6,7 +6,7 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The builtin :func:`open` function is defined in this module. @@ -214,7 +214,7 @@ .. method:: close() Flush and close this stream. This method has no effect if the file is - already closed. Once the file is closed, any operation on the file + already closed. Once the file is closed, any operation on the file (e.g. reading or writing) will raise an :exc:`IOError`. The internal file descriptor isn't closed if *closefd* was False. @@ -328,59 +328,6 @@ ``len(b)``, since if the write fails, an :exc:`IOError` will be raised). -Raw File I/O ------------- - -.. class:: FileIO(name[, mode]) - - :class:`FileIO` represents a file containing bytes data. It implements - the :class:`RawIOBase` interface (and therefore the :class:`IOBase` - interface, too). - - The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, - or appending. The file will be created if it doesn't exist when opened for - writing or appending; it will be truncated when opened for writing. Add a - ``'+'`` to the mode to allow simultaneous reading and writing. - - In addition to the attributes and methods from :class:`IOBase` and - :class:`RawIOBase`, :class:`FileIO` provides the following data - attributes and methods: - - .. attribute:: mode - - The mode as given in the constructor. - - .. attribute:: name - - The file name. This is the file descriptor of the file when no name is - given in the constructor. - - .. method:: read([n]) - - Read and return at most *n* bytes. Only one system call is made, so it is - possible that less data than was requested is returned. Use :func:`len` - on the returned bytes object to see how many bytes were actually returned. - (In non-blocking mode, ``None`` is returned when no data is available.) - - .. method:: readall() - - Read and return the entire file's contents in a single bytes object. As - much as immediately available is returned in non-blocking mode. If the - EOF has been reached, ``b''`` is returned. - - .. method:: write(b) - - Write the bytes or bytearray object, *b*, to the file, and return - the number actually written. Only one system call is made, so it - is possible that only some of the data is written. - - Note that the inherited ``readinto()`` method should not be used on - :class:`FileIO` objects. - - -Buffered Streams ----------------- - .. class:: BufferedIOBase Base class for streams that support buffering. It inherits :class:`IOBase`. @@ -438,6 +385,59 @@ underlying raw stream cannot accept more data at the moment. +Raw File I/O +------------ + +.. class:: FileIO(name[, mode]) + + :class:`FileIO` represents a file containing bytes data. It implements + the :class:`RawIOBase` interface (and therefore the :class:`IOBase` + interface, too). + + The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, + or appending. The file will be created if it doesn't exist when opened for + writing or appending; it will be truncated when opened for writing. Add a + ``'+'`` to the mode to allow simultaneous reading and writing. + + In addition to the attributes and methods from :class:`IOBase` and + :class:`RawIOBase`, :class:`FileIO` provides the following data + attributes and methods: + + .. attribute:: mode + + The mode as given in the constructor. + + .. attribute:: name + + The file name. This is the file descriptor of the file when no name is + given in the constructor. + + .. method:: read([n]) + + Read and return at most *n* bytes. Only one system call is made, so it is + possible that less data than was requested is returned. Use :func:`len` + on the returned bytes object to see how many bytes were actually returned. + (In non-blocking mode, ``None`` is returned when no data is available.) + + .. method:: readall() + + Read and return the entire file's contents in a single bytes object. As + much as immediately available is returned in non-blocking mode. If the + EOF has been reached, ``b''`` is returned. + + .. method:: write(b) + + Write the bytes or bytearray object, *b*, to the file, and return + the number actually written. Only one system call is made, so it + is possible that only some of the data is written. + + Note that the inherited ``readinto()`` method should not be used on + :class:`FileIO` objects. + + +Buffered Streams +---------------- + .. class:: BytesIO([initial_bytes]) A stream implementation using an in-memory bytes buffer. It inherits @@ -628,7 +628,7 @@ .. attribute:: line_buffering Whether line buffering is enabled. - + .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) @@ -659,7 +659,7 @@ # 'First line.\nSecond line.\n' contents = output.getvalue() - # Close object and discard memory buffer -- + # Close object and discard memory buffer -- # .getvalue() will now raise an exception. output.close() Modified: python/branches/py3k-issue1717/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/itertools.rst (original) +++ python/branches/py3k-issue1717/Doc/library/itertools.rst Sun Jan 25 21:08:20 2009 @@ -74,7 +74,7 @@ .. function:: itertools.chain.from_iterable(iterable) - Alternate constructor for :func:`chain`. Gets chained inputs from a + Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Equivalent to:: @classmethod @@ -89,9 +89,9 @@ Return *r* length subsequences of elements from the input *iterable*. - Combinations are emitted in lexicographic sort order. So, if the + Combinations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the combination tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -104,7 +104,9 @@ # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) - indices = range(r) + if r > n: + return + indices = list(range(r)) yield tuple(pool[i] for i in indices) while 1: for i in reversed(range(r)): @@ -128,6 +130,8 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. .. function:: count([n]) @@ -306,12 +310,12 @@ Return successive *r* length permutations of elements in the *iterable*. If *r* is not specified or is ``None``, then *r* defaults to the length - of the *iterable* and all possible full-length permutations + of the *iterable* and all possible full-length permutations are generated. - Permutations are emitted in lexicographic sort order. So, if the + Permutations are emitted in lexicographic sort order. So, if the input *iterable* is sorted, the permutation tuples will be produced - in sorted order. + in sorted order. Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat @@ -325,7 +329,9 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r - indices = range(n) + if r > n: + return + indices = list(range(n)) cycles = range(n, n-r, -1) yield tuple(pool[i] for i in indices[:r]) while n: @@ -342,7 +348,7 @@ else: return - The code for :func:`permutations` can be also expressed as a subsequence of + The code for :func:`permutations` can be also expressed as a subsequence of :func:`product`, filtered to exclude entries with repeated elements (those from the same position in the input pool):: @@ -354,6 +360,8 @@ if len(set(indices)) == r: yield tuple(pool[i] for i in indices) + The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` + or zero when ``r > n``. .. function:: product(*iterables[, repeat]) @@ -466,7 +474,7 @@ .. doctest:: - # Show a dictionary sorted and grouped by value + >>> # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.items(), key=itemgetter(1)) @@ -477,13 +485,13 @@ 2 ['b', 'd', 'f'] 3 ['g'] - # Find runs of consecutive numbers using groupby. The key to the solution - # is differencing with a range so that consecutive numbers all appear in - # same group. + >>> # Find runs of consecutive numbers using groupby. The key to the solution + >>> # is differencing with a range so that consecutive numbers all appear in + >>> # same group. >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]): ... print(map(operator.itemgetter(1), g)) - ... + ... [1] [4, 5, 6] [10] @@ -593,7 +601,8 @@ return (d for d, s in zip(data, selectors) if s) def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) indices = [0] * r @@ -606,3 +615,27 @@ return 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))) Modified: python/branches/py3k-issue1717/Doc/library/json.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/json.rst (original) +++ python/branches/py3k-issue1717/Doc/library/json.rst Sun Jan 25 21:08:20 2009 @@ -13,7 +13,7 @@ :mod:`marshal` and :mod:`pickle` modules. Encoding basic Python object hierarchies:: - + >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' @@ -42,12 +42,12 @@ >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { - "4": 5, + "4": 5, "6": 7 } Decoding JSON:: - + >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] @@ -74,7 +74,7 @@ Decimal('1.1') Extending :class:`JSONEncoder`:: - + >>> import json >>> class ComplexEncoder(json.JSONEncoder): ... def default(self, obj): @@ -88,12 +88,12 @@ '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[', '2.0', ', ', '1.0', ']'] - + .. highlight:: none Using json.tool from the shell to validate and pretty-print:: - + $ echo '{"json":"obj"}' | python -mjson.tool { "json": "obj" @@ -103,7 +103,7 @@ .. highlight:: python -.. note:: +.. note:: The JSON produced by this module's default settings is a subset of YAML, so it may be used as a serializer for that as well. @@ -151,7 +151,7 @@ *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. - To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the + To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the *cls* kwarg. @@ -367,7 +367,7 @@ For example, to support arbitrary iterators, you could implement default like this:: - + def default(self, o): try: iterable = iter(o) @@ -391,6 +391,6 @@ Encode the given object, *o*, and yield each string representation as available. For example:: - + for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) Modified: python/branches/py3k-issue1717/Doc/library/locale.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/locale.rst (original) +++ python/branches/py3k-issue1717/Doc/library/locale.rst Sun Jan 25 21:08:20 2009 @@ -473,7 +473,7 @@ >>> import locale >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale Modified: python/branches/py3k-issue1717/Doc/library/logging.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/logging.rst (original) +++ python/branches/py3k-issue1717/Doc/library/logging.rst Sun Jan 25 21:08:20 2009 @@ -119,7 +119,7 @@ messages at different log levels. This allows you to instrument your code with debug messages, for example, but turning the log level down so that those debug messages are not written for your production system. The default levels are -``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``. +``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``. The logger, handler, and log message call each specify a level. The log message is only emitted if the handler and logger are configured to emit messages of @@ -420,6 +420,8 @@ code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties. +.. _library-config: + Configuring Logging for a Library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -520,6 +522,9 @@ the message to its destination. Most user-defined subclasses of :class:`Handler` will need to override this :meth:`emit`. +Useful Handlers +--------------- + In addition to the base :class:`Handler` class, many useful subclasses are provided: @@ -528,39 +533,52 @@ #. :class:`FileHandler` instances send error messages to disk files. -#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log - files at a certain point. It is not meant to be instantiated directly. Instead, - use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`. +.. module:: logging.handlers -#. :class:`RotatingFileHandler` instances send error messages to disk files, - with support for maximum log file sizes and log file rotation. +#. :class:`BaseRotatingHandler` is the base class for handlers that + rotate log files at a certain point. It is not meant to be instantiated + directly. Instead, use :class:`RotatingFileHandler` or + :class:`TimedRotatingFileHandler`. -#. :class:`TimedRotatingFileHandler` instances send error messages to disk files - rotating the log file at certain timed intervals. +#. :class:`RotatingFileHandler` instances send error messages to disk + files, with support for maximum log file sizes and log file rotation. -#. :class:`SocketHandler` instances send error messages to TCP/IP sockets. +#. :class:`TimedRotatingFileHandler` instances send error messages to + disk files, rotating the log file at certain timed intervals. -#. :class:`DatagramHandler` instances send error messages to UDP sockets. +#. :class:`SocketHandler` instances send error messages to TCP/IP + sockets. -#. :class:`SMTPHandler` instances send error messages to a designated email - address. +#. :class:`DatagramHandler` instances send error messages to UDP + sockets. -#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon, - possibly on a remote machine. +#. :class:`SMTPHandler` instances send error messages to a designated + email address. -#. :class:`NTEventLogHandler` instances send error messages to a Windows - NT/2000/XP event log. +#. :class:`SysLogHandler` instances send error messages to a Unix + syslog daemon, possibly on a remote machine. -#. :class:`MemoryHandler` instances send error messages to a buffer in memory, - which is flushed whenever specific criteria are met. +#. :class:`NTEventLogHandler` instances send error messages to a + Windows NT/2000/XP event log. -#. :class:`HTTPHandler` instances send error messages to an HTTP server using - either ``GET`` or ``POST`` semantics. +#. :class:`MemoryHandler` instances send error messages to a buffer + in memory, which is flushed whenever specific criteria are met. + +#. :class:`HTTPHandler` instances send error messages to an HTTP + server using either ``GET`` or ``POST`` semantics. + +#. :class:`WatchedFileHandler` instances watch the file they are + logging to. If the file changes, it is closed and reopened using the file + name. This handler is only useful on Unix-like systems; Windows does not + support the underlying mechanism used. + +.. currentmodule:: logging #. :class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the "No handlers could be found for logger XXX" message which can be displayed if - the library user has not configured logging. + the library user has not configured logging. See :ref:`library-config` for + more information. .. versionadded:: 3.1 @@ -591,6 +609,9 @@ name. If this feature is used, messages sent to the named logger and its children are allowed through the filter, and all others dropped. +Module-Level Functions +---------------------- + In addition to the classes described above, there are a number of module- level functions. @@ -1534,8 +1555,6 @@ StreamHandler ^^^^^^^^^^^^^ -.. module:: logging.handlers - The :class:`StreamHandler` class, located in the core :mod:`logging` package, sends logging output to streams such as *sys.stdout*, *sys.stderr* or any file-like object (or, more precisely, any object which supports :meth:`write` @@ -1591,9 +1610,33 @@ Outputs the record to the file. +NullHandler +^^^^^^^^^^^ + +.. versionadded:: 3.1 + +The :class:`NullHandler` class, located in the core :mod:`logging` package, +does not do any formatting or output. It is essentially a "no-op" handler +for use by library developers. + + +.. class:: NullHandler() + + Returns a new instance of the :class:`NullHandler` class. + + + .. method:: emit(record) + + This method does nothing. + +See :ref:`library-config` for more information on how to use +:class:`NullHandler`. + WatchedFileHandler ^^^^^^^^^^^^^^^^^^ +.. currentmodule:: logging.handlers + The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers` module, is a :class:`FileHandler` which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. @@ -2267,7 +2310,7 @@ .. function:: fileConfig(fname[, defaults]) Reads the logging configuration from a :mod:`configparser`\-format file named - *fname*. This function can be called several times from an application, + *fname*. This function can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). Defaults to be passed to the ConfigParser @@ -2301,20 +2344,18 @@ Configuration file format ^^^^^^^^^^^^^^^^^^^^^^^^^ -The configuration file format understood by :func:`fileConfig` is -based on :mod:`configparser` functionality. The file must contain -sections called ``[loggers]``, ``[handlers]`` and ``[formatters]`` -which identify by name the entities of each type which are defined in -the file. For each such entity, there is a separate section which -identified how that entity is configured. Thus, for a logger named -``log01`` in the ``[loggers]`` section, the relevant configuration -details are held in a section ``[logger_log01]``. Similarly, a handler -called ``hand01`` in the ``[handlers]`` section will have its -configuration held in a section called ``[handler_hand01]``, while a -formatter called ``form01`` in the ``[formatters]`` section will have -its configuration specified in a section called -``[formatter_form01]``. The root logger configuration must be -specified in a section called ``[logger_root]``. +The configuration file format understood by :func:`fileConfig` is based on +:mod:`configparser` functionality. The file must contain sections called +``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the +entities of each type which are defined in the file. For each such entity, there +is a separate section which identifies how that entity is configured. Thus, for +a logger named ``log01`` in the ``[loggers]`` section, the relevant +configuration details are held in a section ``[logger_log01]``. Similarly, a +handler called ``hand01`` in the ``[handlers]`` section will have its +configuration held in a section called ``[handler_hand01]``, while a formatter +called ``form01`` in the ``[formatters]`` section will have its configuration +specified in a section called ``[formatter_form01]``. The root logger +configuration must be specified in a section called ``[logger_root]``. Examples of these sections in the file are given below. :: Modified: python/branches/py3k-issue1717/Doc/library/mailbox.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/mailbox.rst (original) +++ python/branches/py3k-issue1717/Doc/library/mailbox.rst Sun Jan 25 21:08:20 2009 @@ -1553,7 +1553,7 @@ # that's better than losing a message completely. box.lock() box.add(message) - box.flush() + box.flush() box.unlock() # Remove original message Modified: python/branches/py3k-issue1717/Doc/library/math.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/math.rst (original) +++ python/branches/py3k-issue1717/Doc/library/math.rst Sun Jan 25 21:08:20 2009 @@ -98,7 +98,7 @@ .. function:: isnan(x) Checks if the float *x* is a NaN (not a number). NaNs are part of the - IEEE 754 standards. Operation like but not limited to ``inf * 0``, + IEEE 754 standards. Operation like but not limited to ``inf * 0``, ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return a NaN. @@ -118,7 +118,7 @@ .. function:: trunc(x) Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually - a long integer). Delegates to ``x.__trunc__()``. + an integer). Delegates to ``x.__trunc__()``. Note that :func:`frexp` and :func:`modf` have a different call/return pattern Modified: python/branches/py3k-issue1717/Doc/library/mmap.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/mmap.rst (original) +++ python/branches/py3k-issue1717/Doc/library/mmap.rst Sun Jan 25 21:08:20 2009 @@ -87,7 +87,7 @@ will be relative to the offset from the beginning of the file. *offset* defaults to 0. *offset* must be a multiple of the PAGESIZE or ALLOCATIONGRANULARITY. - + This example shows a simple way of using :class:`mmap`:: import mmap Modified: python/branches/py3k-issue1717/Doc/library/modules.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/modules.rst (original) +++ python/branches/py3k-issue1717/Doc/library/modules.rst Sun Jan 25 21:08:20 2009 @@ -18,3 +18,4 @@ pkgutil.rst modulefinder.rst runpy.rst + importlib.rst Modified: python/branches/py3k-issue1717/Doc/library/msvcrt.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/msvcrt.rst (original) +++ python/branches/py3k-issue1717/Doc/library/msvcrt.rst Sun Jan 25 21:08:20 2009 @@ -18,7 +18,7 @@ The module implements both the normal and wide char variants of the console I/O api. The normal API deals only with ASCII characters and is of limited use -for internationalized applications. The wide char API should be used where +for internationalized applications. The wide char API should be used where ever possible .. _msvcrt-files: @@ -98,11 +98,11 @@ return the keycode. The :kbd:`Control-C` keypress cannot be read with this function. - + .. function:: getwch() Wide char variant of :func:`getch`, returning a Unicode value. - + .. function:: getche() @@ -113,28 +113,28 @@ .. function:: getwche() Wide char variant of :func:`getche`, returning a Unicode value. - + .. function:: putch(char) Print the character *char* to the console without buffering. - + .. function:: putwch(unicode_char) Wide char variant of :func:`putch`, accepting a Unicode value. - + .. function:: ungetch(char) Cause the character *char* to be "pushed back" into the console buffer; it will be the next character read by :func:`getch` or :func:`getche`. - + .. function:: ungetwch(unicode_char) Wide char variant of :func:`ungetch`, accepting a Unicode value. - + .. _msvcrt-other: Modified: python/branches/py3k-issue1717/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/multiprocessing.rst (original) +++ python/branches/py3k-issue1717/Doc/library/multiprocessing.rst Sun Jan 25 21:08:20 2009 @@ -19,9 +19,9 @@ .. warning:: Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See :issue:`3770` for additional information. .. note:: @@ -35,8 +35,8 @@ >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): - ... return x*x - ... + ... return x*x + ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: @@ -75,11 +75,11 @@ print 'module name:', __name__ print 'parent process:', os.getppid() print 'process id:', os.getpid() - + def f(name): info('function f') print 'hello', name - + if __name__ == '__main__': info('main line') p = Process(target=f, args=('bob',)) @@ -107,12 +107,12 @@ def f(q): q.put([42, None, 'hello']) - if __name__ == '__main__': - q = Queue() - p = Process(target=f, args=(q,)) - p.start() - print(q.get()) # prints "[42, None, 'hello']" - p.join() + if __name__ == '__main__': + q = Queue() + p = Process(target=f, args=(q,)) + p.start() + print(q.get()) # prints "[42, None, 'hello']" + p.join() Queues are thread and process safe. @@ -541,7 +541,7 @@ .. method:: put(item[, block[, timeout]]) - Put item into the queue. If the optional argument *block* is ``True`` + Put item into the queue. If the optional argument *block* is ``True`` (the default) and *timeout* is ``None`` (the default), block if necessary until a free slot is available. If *timeout* is a positive number, it blocks at most *timeout* seconds and raises the :exc:`queue.Full` exception if no @@ -856,7 +856,7 @@ acceptable. If *block* is ``True`` and *timeout* is not ``None`` then it specifies a timeout in seconds. If *block* is ``False`` then *timeout* is ignored. - + Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments for these will be ignored. @@ -878,7 +878,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, *args, lock]]) +.. function:: Value(typecode_or_type, *args[, lock]) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -960,7 +960,7 @@ *typecode_or_type* determines the type of the returned object: it is either a ctypes type or a one character typecode of the kind used by the :mod:`array` - module. */*args* is passed on to the constructor for the type. + module. *\*args* is passed on to the constructor for the type. Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized @@ -970,7 +970,7 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]]) +.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock]) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes @@ -1133,22 +1133,22 @@ server process which is using the given address and authentication key. .. method:: get_server() - + Returns a :class:`Server` object which represents the actual server under - the control of the Manager. The :class:`Server` object supports the - :meth:`serve_forever` method:: - - >>> from multiprocessing.managers import BaseManager - >>> m = BaseManager(address=('', 50000), authkey='abc')) - >>> server = m.get_server() - >>> s.serve_forever() - - :class:`Server` additionally have an :attr:`address` attribute. + the control of the Manager. The :class:`Server` object supports the + :meth:`serve_forever` method: + + >>> from multiprocessing.managers import BaseManager + >>> m = BaseManager(address=('', 50000), authkey='abc')) + >>> server = m.get_server() + >>> s.serve_forever() + + :class:`Server` additionally have an :attr:`address` attribute. .. method:: connect() - - Connect a local manager object to a remote manager process:: - + + Connect a local manager object to a remote manager process: + >>> from multiprocessing.managers import BaseManager >>> m = BaseManager(address='127.0.0.1', authkey='abc)) >>> m.connect() @@ -1293,7 +1293,7 @@ >>>>>>>>>>>>>>>>>>> To create one's own manager, one creates a subclass of :class:`BaseManager` and -use the :meth:`~BaseManager.resgister` classmethod to register new types or +use the :meth:`~BaseManager.register` classmethod to register new types or callables with the manager class. For example:: from multiprocessing.managers import BaseManager @@ -1358,7 +1358,7 @@ >>> queue.get() 'hello' -Local processes can also access that queue, using the code from above on the +Local processes can also access that queue, using the code from above on the client to access it remotely:: >>> from multiprocessing import Process, Queue @@ -1369,12 +1369,12 @@ ... super(Worker, self).__init__() ... def run(self): ... self.q.put('local hello') - ... + ... >>> queue = Queue() >>> w = Worker(queue) >>> w.start() >>> class QueueManager(BaseManager): pass - ... + ... >>> QueueManager.register('get_queue', callable=lambda: queue) >>> m = QueueManager(address=('', 50000), authkey='abracadabra') >>> s = m.get_server() @@ -1522,7 +1522,9 @@ .. method:: apply(func[, args[, kwds]]) Call *func* with arguments *args* and keyword arguments *kwds*. It blocks - till the result is ready. + till the result is ready. Given this blocks - :meth:`apply_async` is better suited + for performing work in parallel. Additionally, the passed + in function is only executed in one of the workers of the pool. .. method:: apply_async(func[, args[, kwds[, callback]]]) @@ -1809,8 +1811,8 @@ * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named - pipe on a remote computer called ServerName* one should use an address of the - form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead. + pipe on a remote computer called *ServerName* one should use an address of the + form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead. Note that any string beginning with two backslashes is assumed by default to be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address. @@ -1855,30 +1857,74 @@ Returns the logger used by :mod:`multiprocessing`. If necessary, a new one will be created. - When first created the logger has level :data:`logging.NOTSET` and has a - handler which sends output to :data:`sys.stderr` using format - ``'[%(levelname)s/%(processName)s] %(message)s'``. (The logger allows use of - the non-standard ``'%(processName)s'`` format.) Message sent to this logger - will not by default propagate to the root logger. + When first created the logger has level :data:`logging.NOTSET` and no + default handler. Messages sent to this logger will not by default propagate + to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherited. +.. currentmodule:: multiprocessing +.. function:: log_to_stderr() + + This function performs a call to :func:`get_logger` but in addition to + returning the logger created by get_logger, it adds a handler which sends + output to :data:`sys.stderr` using format + ``'[%(levelname)s/%(processName)s] %(message)s'``. + Below is an example session with logging turned on:: >>> import multiprocessing, logging - >>> logger = multiprocessing.get_logger() + >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-1] child process calling self.run() - [INFO/SyncManager-1] manager bound to '\\\\.\\pipe\\pyc-2776-0-lj0tfa' + [INFO/SyncManager-1] created temp directory /.../pymp-Wh47O_ + [INFO/SyncManager-1] manager serving at '/.../listener-lWsERs' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-1] manager exiting with exitcode 0 +In addition to having these two logging functions, the multiprocessing also +exposes two additional logging level attributes. These are :const:`SUBWARNING` +and :const:`SUBDEBUG`. The table below illustrates where theses fit in the +normal level hierarchy. + ++----------------+----------------+ +| Level | Numeric value | ++================+================+ +| ``SUBWARNING`` | 25 | ++----------------+----------------+ +| ``SUBDEBUG`` | 5 | ++----------------+----------------+ + +For a full table of logging levels, see the :mod:`logging` module. + +These additional logging levels are used primarily for certain debug messages +within the multiprocessing module. Below is the same example as above, except +with :const:`SUBDEBUG` enabled:: + + >>> import multiprocessing, logging + >>> logger = multiprocessing.log_to_stderr() + >>> logger.setLevel(multiprocessing.SUBDEBUG) + >>> logger.warning('doomed') + [WARNING/MainProcess] doomed + >>> m = multiprocessing.Manager() + [INFO/SyncManager-1] child process calling self.run() + [INFO/SyncManager-1] created temp directory /.../pymp-djGBXN + [INFO/SyncManager-1] manager serving at '/.../pymp-djGBXN/listener-knBYGe' + >>> del m + [SUBDEBUG/MainProcess] finalizer calling ... + [INFO/MainProcess] sending shutdown message to manager + [DEBUG/SyncManager-1] manager received shutdown message + [SUBDEBUG/SyncManager-1] calling ... + [SUBDEBUG/SyncManager-1] calling + [SUBDEBUG/SyncManager-1] finalizer calling ... + [INFO/SyncManager-1] manager exiting with exitcode 0 The :mod:`multiprocessing.dummy` module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2118,7 +2164,7 @@ .. literalinclude:: ../includes/mp_benchmarks.py An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process` -and others to build a system which can distribute processes and work via a +and others to build a system which can distribute processes and work via a distributed queue to a "cluster" of machines on a network, accessible via SSH. You will need to have private key authentication for all hosts configured for this to work. Modified: python/branches/py3k-issue1717/Doc/library/nntplib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/nntplib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/nntplib.rst Sun Jan 25 21:08:20 2009 @@ -24,16 +24,16 @@ Group comp.lang.python has 59 articles, range 3742 to 3803 >>> resp, subs = s.xhdr('subject', first + '-' + last) >>> for id, sub in subs[-10:]: print(id, sub) - ... + ... 3792 Re: Removing elements from a list while iterating... 3793 Re: Who likes Info files? 3794 Emacs and doc strings 3795 a few questions about the Mac implementation 3796 Re: executable python scripts 3797 Re: executable python scripts - 3798 Re: a few questions about the Mac implementation + 3798 Re: a few questions about the Mac implementation 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules - 3802 Re: executable python scripts + 3802 Re: executable python scripts 3803 Re: \POSIX{} wait and SIGCHLD >>> s.quit() '205 news.cwi.nl closing connection. Goodbye.' Modified: python/branches/py3k-issue1717/Doc/library/numbers.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/numbers.rst (original) +++ python/branches/py3k-issue1717/Doc/library/numbers.rst Sun Jan 25 21:08:20 2009 @@ -49,14 +49,14 @@ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``. - Real also provides defaults for :func:`complex`, :attr:`Complex.real`, - :attr:`Complex.imag`, and :meth:`Complex.conjugate`. + Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, + :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. .. class:: Rational Subtypes :class:`Real` and adds - :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which + :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which should be in lowest terms. With these, it provides a default for :func:`float`. @@ -72,8 +72,8 @@ .. class:: Integral Subtypes :class:`Rational` and adds a conversion to :class:`int`. - Provides defaults for :func:`float`, :attr:`Rational.numerator`, and - :attr:`Rational.denominator`, and bit-string operations: ``<<``, + Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and + :attr:`~Rational.denominator`, and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``. @@ -169,7 +169,7 @@ knowledge of ``A``, so it can handle those instances before delegating to :class:`Complex`. -If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, +If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``. Modified: python/branches/py3k-issue1717/Doc/library/operator.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/operator.rst (original) +++ python/branches/py3k-issue1717/Doc/library/operator.rst Sun Jan 25 21:08:20 2009 @@ -7,7 +7,7 @@ .. testsetup:: - + import operator from operator import itemgetter @@ -209,7 +209,7 @@ Remove the value of *a* at index *b*. - + .. function:: getitem(a, b) __getitem__(a, b) @@ -337,7 +337,7 @@ >>> class C: ... pass - ... + ... >>> import operator >>> obj = C() >>> operator.isMappingType(obj) @@ -427,9 +427,9 @@ def g(obj): return tuple(obj[item] for item in items) return g - - The items can be any type accepted by the operand's :meth:`__getitem__` - method. Dictionaries accept any hashable value. Lists, tuples, and + + The items can be any type accepted by the operand's :meth:`__getitem__` + method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice: >>> itemgetter(1)('ABCDEFG') Modified: python/branches/py3k-issue1717/Doc/library/optparse.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/optparse.rst (original) +++ python/branches/py3k-issue1717/Doc/library/optparse.rst Sun Jan 25 21:08:20 2009 @@ -543,8 +543,8 @@ :class:`OptionGroup` to a parser is easy:: group = OptionGroup(parser, "Dangerous Options", - "Caution: use these options at your own risk. " - "It is believed that some of them bite.") + "Caution: use these options at your own risk. " + "It is believed that some of them bite.") group.add_option("-g", action="store_true", help="Group option.") parser.add_option_group(group) @@ -558,12 +558,12 @@ -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --file=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' - [default], 'expert' + [default], 'expert' Dangerous Options: - Caution: use of these options is at your own risk. It is believed that - some of them bite. - -g Group option. + Caution: use of these options is at your own risk. It is believed that + some of them bite. + -g Group option. .. _optparse-printing-version-string: @@ -794,7 +794,7 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an +attributes, or fail to pass required ones, :mod:`optparse` raises an :exc:`OptionError` exception explaining your mistake. An option's *action* determines what :mod:`optparse` does when it encounters Modified: python/branches/py3k-issue1717/Doc/library/os.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/os.rst (original) +++ python/branches/py3k-issue1717/Doc/library/os.rst Sun Jan 25 21:08:20 2009 @@ -1226,7 +1226,7 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered @@ -1258,7 +1258,7 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. + inherit the environment of the current process. Availability: Unix, Windows. @@ -1456,7 +1456,7 @@ (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is - preferable to using these functions. Check specially the *Replacing Older + preferable to using these functions. Check specially the *Replacing Older Functions with the subprocess Module* section in that documentation page.) If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new Modified: python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst (original) +++ python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst Sun Jan 25 21:08:20 2009 @@ -16,26 +16,26 @@ use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast majority of Linux audio apps anyways. - + Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: - + > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial > OSS installation manual tells you to remove references to OSS/Free from the > kernel :) - + but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes from its : > * WARNING! WARNING! > * This is an OSS (Linux) audio emulator. > * Use the Native NetBSD API for developing new code, and this > * only for compiling Linux programs. - + There's also an ossaudio manpage on OpenBSD that explains things further. Presumably NetBSD and OpenBSD have a different standard audio interface. That's the great thing about standards, there are so many to choose from ... ;-) - + This probably all warrants a footnote or two, but I don't understand things well enough right now to write it! --GPW Modified: python/branches/py3k-issue1717/Doc/library/othergui.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/othergui.rst (original) +++ python/branches/py3k-issue1717/Doc/library/othergui.rst Sun Jan 25 21:08:20 2009 @@ -70,7 +70,7 @@ Robin Dunn. PyGTK, PyQt, and wxPython, all have a modern look and feel and more -widgets than Tkinter. In addition, there are many other GUI toolkits for +widgets than Tkinter. In addition, there are many other GUI toolkits for Python, both cross-platform, and platform-specific. See the `GUI Programming `_ page in the Python Wiki for a much more complete list, and also for links to documents where the Modified: python/branches/py3k-issue1717/Doc/library/parser.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/parser.rst (original) +++ python/branches/py3k-issue1717/Doc/library/parser.rst Sun Jan 25 21:08:20 2009 @@ -635,7 +635,7 @@ while the long form uses an indented block and allows nested definitions:: def make_power(exp): - "Make a function that raises an argument to the exponent `exp'." + "Make a function that raises an argument to the exponent `exp`." def raiser(x, y=exp): return x ** y return raiser Modified: python/branches/py3k-issue1717/Doc/library/pdb.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/pdb.rst (original) +++ python/branches/py3k-issue1717/Doc/library/pdb.rst Sun Jan 25 21:08:20 2009 @@ -37,7 +37,7 @@ (Pdb) continue NameError: 'spam' > (1)?() - (Pdb) + (Pdb) :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -65,7 +65,7 @@ >>> pdb.pm() > ./mymodule.py(3)test2() -> print(spam) - (Pdb) + (Pdb) The module defines the following functions; each enters the debugger in a slightly different way: @@ -105,7 +105,7 @@ .. function:: post_mortem([traceback]) - Enter post-mortem debugging of the given *traceback* object. If no + Enter post-mortem debugging of the given *traceback* object. If no *traceback* is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used). Modified: python/branches/py3k-issue1717/Doc/library/pickle.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/pickle.rst (original) +++ python/branches/py3k-issue1717/Doc/library/pickle.rst Sun Jan 25 21:08:20 2009 @@ -98,8 +98,8 @@ There are currently 4 different protocols which can be used for pickling. -* Protocol version 0 is the original ASCII protocol and is backwards compatible - with earlier versions of Python. +* Protocol version 0 is the original human-readable protocol and is + backwards compatible with earlier versions of Python. * Protocol version 1 is the old binary format which is also compatible with earlier versions of Python. @@ -130,16 +130,6 @@ The highest protocol version available. This value can be passed as a *protocol* value. -.. note:: - - Be sure to always open pickle files created with protocols >= 1 in binary mode. - For the old ASCII-based pickle protocol 0 you can use either text mode or binary - mode as long as you stay consistent. - - A pickle file written with protocol 0 in binary mode will contain lone linefeeds - as line terminators and therefore will look "funny" when viewed in Notepad or - other editors which do not support this format. - .. data:: DEFAULT_PROTOCOL The default protocol used for pickling. May be less than HIGHEST_PROTOCOL. @@ -478,7 +468,7 @@ fact, these methods are part of the copy protocol which implements the :meth:`__reduce__` special method. The copy protocol provides a unified interface for retrieving the data necessary for pickling and copying -objects. [#]_ +objects. [#]_ Although powerful, implementing :meth:`__reduce__` directly in your classes is error prone. For this reason, class designers should use the high-level @@ -570,10 +560,8 @@ Here is a comprehensive example presenting how persistent ID can be used to pickle external objects by reference. -.. XXX Work around for some bug in sphinx/pygments. -.. highlightlang:: python .. literalinclude:: ../includes/dbpickle.py -.. highlightlang:: python3 + .. _pickle-state: @@ -715,7 +703,7 @@ .. XXX Add note about how extension codes could evade our protection - mechanism (e.g. cached classes do not invokes find_class()). + mechanism (e.g. cached classes do not invokes find_class()). As our examples shows, you have to be careful with what you allow to be unpickled. Therefore if security is a concern, you may want to consider @@ -725,46 +713,35 @@ .. _pickle-example: -Example -------- +Usage Examples +-------------- For the simplest code, use the :func:`dump` and :func:`load` functions. Note that a self-referencing list is pickled and restored correctly. :: import pickle - data1 = {'a': [1, 2.0, 3, 4+6j], - 'b': ("string", "string using Unicode features \u0394"), - 'c': None} - - selfref_list = [1, 2, 3] - selfref_list.append(selfref_list) - - output = open('data.pkl', 'wb') - - # Pickle dictionary using protocol 2. - pickle.dump(data1, output, 2) - - # Pickle the list using the highest protocol available. - pickle.dump(selfref_list, output, -1) - - output.close() + # An arbitrary collection of objects supported by pickle. + data = { + 'a': [1, 2.0, 3, 4+6j], + 'b': ("character string", b"byte string"), + 'c': set([None, True, False]) + } -The following example reads the resulting pickled data. When reading a -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. :: + with open('data.pickle', 'wb') as f: + # Pickle the 'data' dictionary using the highest protocol available. + pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) - import pprint, pickle - pkl_file = open('data.pkl', 'rb') +The following example reads the resulting pickled data. :: - data1 = pickle.load(pkl_file) - pprint.pprint(data1) + import pickle - data2 = pickle.load(pkl_file) - pprint.pprint(data2) + with open('data.pickle', 'rb') as f: + # The protocol version used is detected automatically, so we do not + # have to specify it. + data = pickle.load(f) - pkl_file.close() .. seealso:: Modified: python/branches/py3k-issue1717/Doc/library/profile.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/profile.rst (original) +++ python/branches/py3k-issue1717/Doc/library/profile.rst Sun Jan 25 21:08:20 2009 @@ -51,15 +51,15 @@ The Python standard library provides two different profilers: -#. :mod:`cProfile` is recommended for most users; it's a C extension +#. :mod:`cProfile` is recommended for most users; it's a C extension with reasonable overhead - that makes it suitable for profiling long-running programs. + that makes it suitable for profiling long-running programs. Based on :mod:`lsprof`, - contributed by Brett Rosen and Ted Czotter. + contributed by Brett Rosen and Ted Czotter. #. :mod:`profile`, a pure Python module whose interface is imitated by - :mod:`cProfile`. Adds significant overhead to profiled programs. - If you're trying to extend + :mod:`cProfile`. Adds significant overhead to profiled programs. + If you're trying to extend the profiler in some way, the task might be easier with this module. Copyright ?? 1994, by InfoSeek Corporation. @@ -260,24 +260,24 @@ that the text string in the far right column was used to sort the output. The column headings include: - ncalls + ncalls for the number of calls, - tottime + tottime for the total time spent in the given function (and excluding time made in calls to sub-functions), - percall + percall is the quotient of ``tottime`` divided by ``ncalls`` - cumtime + cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate *even* for recursive functions. - percall + percall is the quotient of ``cumtime`` divided by primitive calls - filename:lineno(function) + filename:lineno(function) provides the respective data of each function When there are two numbers in the first column (for example, ``43/3``), then the Modified: python/branches/py3k-issue1717/Doc/library/pyexpat.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/pyexpat.rst (original) +++ python/branches/py3k-issue1717/Doc/library/pyexpat.rst Sun Jan 25 21:08:20 2009 @@ -177,9 +177,9 @@ .. attribute:: xmlparser.buffer_size - The size of the buffer used when :attr:`buffer_text` is true. - A new buffer size can be set by assigning a new integer value - to this attribute. + The size of the buffer used when :attr:`buffer_text` is true. + A new buffer size can be set by assigning a new integer value + to this attribute. When the size is changed, the buffer will be flushed. Modified: python/branches/py3k-issue1717/Doc/library/queue.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/queue.rst (original) +++ python/branches/py3k-issue1717/Doc/library/queue.rst Sun Jan 25 21:08:20 2009 @@ -68,7 +68,7 @@ ------------- Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`) -provide the public methods described below. +provide the public methods described below. .. method:: Queue.qsize() @@ -138,20 +138,20 @@ Example of how to wait for enqueued tasks to be completed:: - def worker(): - while True: - item = q.get() - do_work(item) - q.task_done() + def worker(): + while True: + item = q.get() + do_work(item) + q.task_done() - q = Queue() - for i in range(num_worker_threads): + q = Queue() + for i in range(num_worker_threads): t = Thread(target=worker) t.set_daemon(True) - t.start() + t.start() for item in source(): - q.put(item) + q.put(item) q.join() # block until all tasks are done Modified: python/branches/py3k-issue1717/Doc/library/random.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/random.rst (original) +++ python/branches/py3k-issue1717/Doc/library/random.rst Sun Jan 25 21:08:20 2009 @@ -149,13 +149,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. @@ -163,27 +163,30 @@ .. 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) - 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) - 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/py3k-issue1717/Doc/library/re.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/re.rst (original) +++ python/branches/py3k-issue1717/Doc/library/re.rst Sun Jan 25 21:08:20 2009 @@ -221,7 +221,7 @@ ``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters set the corresponding flags: :const:`re.a` (ASCII-only matching), :const:`re.I` (ignore case), :const:`re.L` (locale dependent), - :const:`re.M` (multi-line), :const:`re.S` (dot matches all), + :const:`re.M` (multi-line), :const:`re.S` (dot matches all), and :const:`re.X` (verbose), for the entire regular expression. (The flags are described in :ref:`contents-of-module-re`.) This is useful if you wish to include the flags as part of the regular @@ -487,7 +487,7 @@ counterpart ``(?u)``), but these are redundant in Python 3.0 since matches are Unicode by default for strings (and Unicode matching isn't allowed for bytes). - + .. data:: I IGNORECASE @@ -1011,14 +1011,14 @@ >>> pair.match("717ak").group(1) '7' - + # Error because re.match() returns None, which doesn't have a group() method: >>> pair.match("718ak").group(1) Traceback (most recent call last): File "", line 1, in re.match(r".*(.).*\1", "718ak").group(1) AttributeError: 'NoneType' object has no attribute 'group' - + >>> pair.match("354aa").group(1) 'a' @@ -1127,7 +1127,7 @@ Making a Phonebook ^^^^^^^^^^^^^^^^^^ -:func:`split` splits a string into a list delimited by the passed pattern. The +:func:`split` splits a string into a list delimited by the passed pattern. The method is invaluable for converting textual data into data structures that can be easily read and modified by Python as demonstrated in the following example that creates a phonebook. @@ -1136,7 +1136,7 @@ triple-quoted string syntax: >>> input = """Ross McFluff: 834.345.1254 155 Elm Street - ... + ... ... Ronald Heathmore: 892.345.3428 436 Finley Avenue ... Frank Burger: 925.541.7625 662 South Dogwood Way ... Modified: python/branches/py3k-issue1717/Doc/library/reprlib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/reprlib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/reprlib.rst Sun Jan 25 21:08:20 2009 @@ -65,7 +65,7 @@ .. attribute:: Repr.maxlong - Maximum number of characters in the representation for a long integer. Digits + Maximum number of characters in the representation for an integer. Digits are dropped from the middle. The default is ``40``. Modified: python/branches/py3k-issue1717/Doc/library/rlcompleter.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/rlcompleter.rst (original) +++ python/branches/py3k-issue1717/Doc/library/rlcompleter.rst Sun Jan 25 21:08:20 2009 @@ -61,6 +61,6 @@ If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`__getattr__`) up to the last part, and find matches for the rest via the - :func:`dir` function. Any exception raised during the evaluation of the + :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned. Modified: python/branches/py3k-issue1717/Doc/library/sched.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/sched.rst (original) +++ python/branches/py3k-issue1717/Doc/library/sched.rst Sun Jan 25 21:08:20 2009 @@ -42,7 +42,7 @@ 930343700.276 In multi-threaded environments, the :class:`scheduler` class has limitations -with respect to thread-safety, inability to insert a new task before +with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the :class:`threading.Timer` class instead. @@ -58,7 +58,7 @@ ... print(time.time()) ... Timer(5, print_time, ()).start() ... Timer(10, print_time, ()).start() - ... time.sleep(11) # sleep while time-delay events execute + ... time.sleep(11) # sleep while time-delay events execute ... print(time.time()) ... >>> print_some_times() Modified: python/branches/py3k-issue1717/Doc/library/shutil.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/shutil.rst (original) +++ python/branches/py3k-issue1717/Doc/library/shutil.rst Sun Jan 25 21:08:20 2009 @@ -20,7 +20,7 @@ Even the higher-level file copying functions (:func:`copy`, :func:`copy2`) can't copy all file metadata. - + On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will Modified: python/branches/py3k-issue1717/Doc/library/signal.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/signal.rst (original) +++ python/branches/py3k-issue1717/Doc/library/signal.rst Sun Jan 25 21:08:20 2009 @@ -39,12 +39,12 @@ * Some care must be taken if both signals and threads are used in the same program. The fundamental thing to remember in using signals and threads simultaneously is: always perform :func:`signal` operations in the main thread - of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, - :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread - can set a new signal handler, and the main thread will be the only one to - receive signals (this is enforced by the Python :mod:`signal` module, even - if the underlying thread implementation supports sending signals to - individual threads). This means that signals can't be used as a means of + of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`, + :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread + can set a new signal handler, and the main thread will be the only one to + receive signals (this is enforced by the Python :mod:`signal` module, even + if the underlying thread implementation supports sending signals to + individual threads). This means that signals can't be used as a means of inter-thread communication. Use locks instead. The variables defined in the :mod:`signal` module are: @@ -80,22 +80,22 @@ One more than the number of the highest signal number. -.. data:: ITIMER_REAL +.. data:: ITIMER_REAL Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration. -.. data:: ITIMER_VIRTUAL +.. data:: ITIMER_VIRTUAL - Decrements interval timer only when the process is executing, and delivers + Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration. .. data:: ITIMER_PROF - - Decrements interval timer both when the process executes and when the - system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, - this timer is usually used to profile the time spent by the application + + Decrements interval timer both when the process executes and when the + system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, + this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration. @@ -105,7 +105,7 @@ Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid - interval timer or a negative time is passed to :func:`setitimer`. + interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`IOError`. @@ -143,21 +143,21 @@ .. function:: setitimer(which, seconds[, interval]) - Sets given interval timer (one of :const:`signal.ITIMER_REAL`, + Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified - by *which* to fire after *seconds* (float is accepted, different from + by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds. The interval timer specified by *which* can be cleared by setting seconds to zero. When an interval timer fires, a signal is sent to the process. - The signal sent is dependent on the timer being used; - :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, + The signal sent is dependent on the timer being used; + :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`. The old values are returned as a tuple: (delay, interval). - Attempting to pass an invalid interval timer will cause a + Attempting to pass an invalid interval timer will cause a :exc:`ItimerError`. @@ -186,7 +186,7 @@ will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing. Availability: Unix (see the man page :manpage:`siginterrupt(3)` for further information). - + Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag* value for the given signal. @@ -233,7 +233,7 @@ signal.alarm(5) # This open() may hang indefinitely - fd = os.open('/dev/ttyS0', os.O_RDWR) + fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm Modified: python/branches/py3k-issue1717/Doc/library/smtplib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/smtplib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/smtplib.rst Sun Jan 25 21:08:20 2009 @@ -182,9 +182,9 @@ Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the - response for ESMTP option and store them for use by :meth:`has_extn`. - Also sets several informational attributes: the message returned by - the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` + response for ESMTP option and store them for use by :meth:`has_extn`. + Also sets several informational attributes: the message returned by + the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to true or false depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their @@ -200,7 +200,7 @@ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. - :exc:SMTPHeloError + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. .. method:: SMTP.has_extn(name) Modified: python/branches/py3k-issue1717/Doc/library/socket.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/socket.rst (original) +++ python/branches/py3k-issue1717/Doc/library/socket.rst Sun Jan 25 21:08:20 2009 @@ -178,10 +178,10 @@ .. data:: SIO_* RCVALL_* - + Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`ioctl` method of socket objects. - + .. data:: TIPC_* @@ -210,7 +210,7 @@ all the necessary arguments for creating the corresponding socket. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. - The rest of the arguments are optional and must be numeric if specified. + The rest of the arguments are optional and must be numeric if specified. By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following @@ -544,14 +544,14 @@ contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as byte strings). - + .. method:: socket.ioctl(control, option) - :platform: Windows - + :platform: Windows + The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the MSDN documentation for more information. - + .. method:: socket.listen(backlog) @@ -797,17 +797,17 @@ socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error as msg: - s = None - continue + s = None + continue try: - s.bind(sa) - s.listen(1) + s.bind(sa) + s.listen(1) except socket.error as msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print('could not open socket') @@ -832,16 +832,16 @@ for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: - s = socket.socket(af, socktype, proto) + s = socket.socket(af, socktype, proto) except socket.error as msg: - s = None - continue + s = None + continue try: - s.connect(sa) + s.connect(sa) except socket.error as msg: - s.close() - s = None - continue + s.close() + s = None + continue break if s is None: print('could not open socket') @@ -851,7 +851,7 @@ s.close() print('Received', repr(data)) - + The last example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface:: @@ -860,19 +860,19 @@ # the public network interface HOST = socket.gethostbyname(socket.gethostname()) - + # create a raw socket and bind it to the public interface s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) s.bind((HOST, 0)) - + # Include IP headers s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) - + # receive all packages s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) - + # receive a package print(s.recvfrom(65565)) - + # disabled promiscuous mode s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) Modified: python/branches/py3k-issue1717/Doc/library/sqlite3.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/sqlite3.rst (original) +++ python/branches/py3k-issue1717/Doc/library/sqlite3.rst Sun Jan 25 21:08:20 2009 @@ -541,8 +541,8 @@ This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each - column where the last six items of each tuple are :const:`None`. - + column where the last six items of each tuple are :const:`None`. + It is set for ``SELECT`` statements without any matching rows as well. .. _sqlite3-row-objects: @@ -553,7 +553,7 @@ .. class:: Row A :class:`Row` instance serves as a highly optimized - :attr:`~Connection.row_factory` for :class:`Connection` objects. + :attr:`~Connection.row_factory` for :class:`Connection` objects. It tries to mimic a tuple in most of its features. It supports mapping access by column name and index, iteration, @@ -561,17 +561,12 @@ If two :class:`Row` objects have exactly the same columns and their members are equal, they compare equal. - - .. versionchanged:: 2.6 - Added iteration and equality (hashability). .. method:: keys This method returns a tuple of column names. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`. - .. versionadded:: 2.6 - Let's assume we initialize a table as in the example given above:: conn = sqlite3.connect(":memory:") @@ -780,7 +775,7 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. +Data Modification Language (DML) statement (i.e. ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions implicitly before a non-DML, non-query statement (i. e. anything other than ``SELECT`` or the aforementioned). Modified: python/branches/py3k-issue1717/Doc/library/ssl.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/ssl.rst (original) +++ python/branches/py3k-issue1717/Doc/library/ssl.rst Sun Jan 25 21:08:20 2009 @@ -45,7 +45,7 @@ .. exception:: SSLError - Raised to signal an error from the underlying SSL implementation. This + Raised to signal an error from the underlying SSL implementation. This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`socket.error`, which @@ -170,7 +170,7 @@ >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' - >>> + >>> .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None) @@ -397,7 +397,7 @@ the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, -that is, a certificate which has the same subject and issuer, +that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the @@ -433,13 +433,13 @@ you only need the root certificates, and the remote peer is supposed to furnish the other certificates necessary to chain from its certificate to a root certificate. -See :rfc:`4158` for more discussion of the way in which +See :rfc:`4158` for more discussion of the way in which certification chains can be built. If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, -such as buying one from a certification authority. Another common +such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following:: @@ -581,7 +581,7 @@ And go back to listening for new client connections. - + .. seealso:: Class :class:`socket.socket` Modified: python/branches/py3k-issue1717/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/stdtypes.rst (original) +++ python/branches/py3k-issue1717/Doc/library/stdtypes.rst Sun Jan 25 21:08:20 2009 @@ -172,7 +172,7 @@ any operand is a complex number, the objects are of different types that cannot be compared, or other cases where there is no defined ordering. -.. index:: +.. index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) @@ -322,6 +322,7 @@ module: math single: floor() (in module math) single: ceil() (in module math) + single: trunc() (in module math) pair: numeric; conversions pair: C; language @@ -330,31 +331,31 @@ for well-defined conversions. (4) - float also accepts the strings "nan" and "inf" with an optional prefix "+" + float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity. (5) Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for programming languages. - + All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+--------------------------------+--------+ -| Operation | Result | Notes | -+====================+================================+========+ -| ``trunc(x)`` | *x* truncated to Integral | | -+--------------------+--------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+--------------------------------+--------+ -| ``math.floor(x)`` | the greatest Integral <= *x* | | -+--------------------+--------------------------------+--------+ -| ``math.ceil(x)`` | the least Integral >= *x* | | -+--------------------+--------------------------------+--------+ ++--------------------+------------------------------------+--------+ +| Operation | Result | Notes | ++====================+====================================+========+ +| ``math.trunc(x)`` | *x* truncated to Integral | | ++--------------------+------------------------------------+--------+ +| ``round(x[, n])`` | *x* rounded to n digits, | | +| | rounding half to even. If n is | | +| | omitted, it defaults to 0. | | ++--------------------+------------------------------------+--------+ +| ``math.floor(x)`` | the greatest integral float <= *x* | | ++--------------------+------------------------------------+--------+ +| ``math.ceil(x)`` | the least integral float >= *x* | | ++--------------------+------------------------------------+--------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. @@ -460,8 +461,6 @@ original float and with a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs. - - .. versionadded:: 2.6 Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored @@ -595,16 +594,17 @@ Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`list`, :class:`tuple`, :class:`range` ================================================================================================================== -There are five sequence types: strings, byte sequences, byte arrays, lists, -tuples, and range objects. (For other containers see the built-in -:class:`dict`, :class:`list`, :class:`set`, and :class:`tuple` classes, and the -:mod:`collections` module.) +There are six sequence types: strings, byte sequences (:class:`bytes` objects), +byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. For +other containers see the built in :class:`dict` and :class:`set` classes, and +the :mod:`collections` module. + .. index:: object: sequence object: string object: bytes - object: buffer + object: bytearray object: tuple object: list object: range @@ -875,7 +875,7 @@ otherwise. Decimal characters include digit characters, and all characters that that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. - + .. method:: str.isdigit() @@ -903,7 +903,7 @@ that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. - + .. method:: str.isprintable() Return true if all characters in the string are printable or the string is @@ -1474,7 +1474,7 @@ example, sort by department, then by salary grade). While a list is being sorted, the effect of attempting to mutate, or even - inspect, the list is undefined. The C implementation + inspect, the list is undefined. The C implementation makes the list appear empty for the duration, and raises :exc:`ValueError` if it can detect that the list has been mutated during a sort. @@ -1525,7 +1525,7 @@ b'\xf0\xf1\xf2' The translate method differs in semantics from the version available on strings: - + .. method:: bytes.translate(table[, delete]) Return a copy of the bytes or bytearray object where all bytes occurring in @@ -1623,12 +1623,12 @@ .. 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. .. 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. .. method:: difference(other, ...) set - other - ... @@ -1807,7 +1807,7 @@ Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map. - + If a subclass of dict defines a method :meth:`__missing__`, if the key *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or raises whatever is @@ -2149,7 +2149,7 @@ positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). There is no return value. - + For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last. Modified: python/branches/py3k-issue1717/Doc/library/string.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/string.rst (original) +++ python/branches/py3k-issue1717/Doc/library/string.rst Sun Jan 25 21:08:20 2009 @@ -98,7 +98,7 @@ :meth:`format` is just a wrapper that calls :meth:`vformat`. .. method:: vformat(format_string, args, kwargs) - + This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the @@ -111,12 +111,12 @@ intended to be replaced by subclasses: .. method:: parse(format_string) - + Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string in to either literal text, or replacement fields. - + The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then @@ -134,7 +134,7 @@ *key* parameter to :meth:`get_value`. .. method:: get_value(key, args, kwargs) - + Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a @@ -172,7 +172,7 @@ method is provided so that subclasses can override it. .. method:: convert_field(value, conversion) - + Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method.) The default version understands 'r' (repr) and 's' (str) conversion types. @@ -201,7 +201,7 @@ element_index: `integer` conversion: "r" | "s" | "a" format_spec: - + In less formal terms, the replacement field starts with a *field_name*, which can either be a number (for a positional argument), or an identifier (for keyword arguments). Following this is an optional *conversion* field, which is @@ -221,7 +221,7 @@ "My quest is {name}" # References keyword argument 'name' "Weight in tons {0.weight}" # 'weight' attribute of first positional arg "Units destroyed: {players[0]}" # First element of keyword argument 'players'. - + The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted @@ -265,11 +265,11 @@ Then the outer replacement field would be evaluated, producing:: "noses " - + Which is substituted into the string, yielding:: - + "A man with two noses " - + (The extra space is because we specified a field width of 10, and because left alignment is the default for strings.) @@ -301,7 +301,7 @@ width: `integer` precision: `integer` type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%" - + The *fill* character can be any character other than '}' (which signifies the end of the field). The presence of a fill character is signaled by the *next* character, which must be one of the alignment options. If the second character @@ -394,9 +394,9 @@ +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ - + The available presentation types for floating point and decimal values are: - + +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ Modified: python/branches/py3k-issue1717/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/subprocess.rst (original) +++ python/branches/py3k-issue1717/Doc/library/subprocess.rst Sun Jan 25 21:08:20 2009 @@ -126,7 +126,7 @@ Special value that can be used as the *stderr* argument to :class:`Popen` and indicates that standard error should go into the same handle as standard output. - + Convenience Functions ^^^^^^^^^^^^^^^^^^^^^ @@ -160,11 +160,12 @@ Run command with arguments and return its output as a byte string. - If the exit code was non-zero it raises a CalledProcessError. The - CalledProcessError object will have the return code in the returncode - attribute and output in the output attribute. + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + :exc:`CalledProcessError` object will have the return code in the + :attr:`returncode` + attribute and output in the :attr:`output` attribute. - The arguments are the same as for the Popen constructor. Example: + The arguments are the same as for the :class:`Popen` constructor. Example: >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' @@ -346,7 +347,7 @@ The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly by :meth:`communicate`). A ``None`` value indicates that the process hasn't terminated yet. - + A negative value ``-N`` indicates that the child was terminated by signal ``N`` (Unix only). Modified: python/branches/py3k-issue1717/Doc/library/symtable.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/symtable.rst (original) +++ python/branches/py3k-issue1717/Doc/library/symtable.rst Sun Jan 25 21:08:20 2009 @@ -5,7 +5,7 @@ :synopsis: Interface to the compiler's internal symbol tables. .. moduleauthor:: Jeremy Hylton -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson Symbol tables are generated by the compiler from AST just before bytecode is Modified: python/branches/py3k-issue1717/Doc/library/sys.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/sys.rst (original) +++ python/branches/py3k-issue1717/Doc/library/sys.rst Sun Jan 25 21:08:20 2009 @@ -327,7 +327,7 @@ The *default* argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would - cause a `TypeError`. + cause a `TypeError`. func:`getsizeof` calls the object's __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. @@ -484,6 +484,11 @@ A program is free to modify this list for its own purposes. + .. seealso:: + Module :mod:`site` This describes how to use .pth files to extend + :data:`sys.path`. + + .. data:: platform This string contains a platform identifier that can be used to append @@ -500,10 +505,8 @@ Windows ``'win32'`` Windows/Cygwin ``'cygwin'`` Mac OS X ``'darwin'`` - Mac OS 9 ``'mac'`` OS/2 ``'os2'`` OS/2 EMX ``'os2emx'`` - RiscOS ``'riscos'`` AtheOS ``'atheos'`` ================ =========================== @@ -642,7 +645,7 @@ The events have the following meaning: - ``'call'`` + ``'call'`` A function is called (or some other code block entered). The global trace function is called; *arg* is ``None``; the return value specifies the local trace function. @@ -704,7 +707,7 @@ prompts of :func:`input`. The interpreter's own prompts and (almost all of) its error messages go to ``stderr``. ``stdout`` and ``stderr`` needn't be built-in file objects: any object is acceptable as long - as it has a :meth:`write` method that takes a string argument. (Changing these + as it has a :meth:`write` method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) @@ -783,11 +786,3 @@ first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python. Availability: Windows. - - -.. seealso:: - - Module :mod:`site` - This describes how to use .pth files to extend ``sys.path``. - - Modified: python/branches/py3k-issue1717/Doc/library/tempfile.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/tempfile.rst (original) +++ python/branches/py3k-issue1717/Doc/library/tempfile.rst Sun Jan 25 21:08:20 2009 @@ -149,11 +149,11 @@ .. warning:: - Use of this function may introduce a security hole in your program. - By the time you get around to doing anything with the file name it - returns, someone else may have beaten you to the punch. - :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + Use of this function may introduce a security hole in your program. By + the time you get around to doing anything with the file name it returns, + someone else may have beaten you to the punch. :func:`mktemp` usage can + be replaced easily with :func:`NamedTemporaryFile`, passing it the + ``delete=False`` parameter:: >>> f = NamedTemporaryFile(delete=False) >>> f Modified: python/branches/py3k-issue1717/Doc/library/test.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/test.rst (original) +++ python/branches/py3k-issue1717/Doc/library/test.rst Sun Jan 25 21:08:20 2009 @@ -353,5 +353,3 @@ Class used to record warnings for unit tests. See documentation of :func:`check_warnings` above for more details. - .. versionadded:: 2.6 - Modified: python/branches/py3k-issue1717/Doc/library/threading.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/threading.rst (original) +++ python/branches/py3k-issue1717/Doc/library/threading.rst Sun Jan 25 21:08:20 2009 @@ -278,12 +278,6 @@ raises the same exception. -.. method:: Thread.getName() - Thread.setName() - - Old API for :attr:`~Thread.name`. - - .. attribute:: Thread.name A string used for identification purposes only. It has no semantics. @@ -291,6 +285,13 @@ constructor. +.. method:: Thread.getName() + Thread.setName() + + Old getter/setter API for :attr:`~Thread.name`; use it directly as a property + instead. + + .. attribute:: Thread.ident The 'thread identifier' of this thread or ``None`` if the thread has not been @@ -309,12 +310,6 @@ returns a list of all alive threads. -.. method:: Thread.isDaemon() - Thread.setDaemon() - - Old API for :attr:`~Thread.daemon`. - - .. attribute:: Thread.daemon The thread's daemon flag. This must be set before :meth:`start` is called, @@ -325,6 +320,13 @@ The entire Python program exits when no alive non-daemon threads are left. +.. method:: Thread.isDaemon() + Thread.setDaemon() + + Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a + property instead. + + .. _lock-objects: Lock Objects Modified: python/branches/py3k-issue1717/Doc/library/tk.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/tk.rst (original) +++ python/branches/py3k-issue1717/Doc/library/tk.rst Sun Jan 25 21:08:20 2009 @@ -12,7 +12,7 @@ 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` +using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix` module. The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. To @@ -23,15 +23,15 @@ mechanism which allows Python and Tcl to interact. :mod:`tkinter`'s chief virtues are that it is fast, and that it usually comes -bundled with Python. Although its standard documentation is weak, good -material is available, which includes: references, tutorials, a book and -others. :mod:`tkinter` is also famous for having an outdated look and feel, -which has been vastly improved in Tk 8.5. Nevertheless, there are many other -GUI libraries that you could be interested in. For more information about +bundled with Python. Although its standard documentation is weak, good +material is available, which includes: references, tutorials, a book and +others. :mod:`tkinter` is also famous for having an outdated look and feel, +which has been vastly improved in Tk 8.5. Nevertheless, there are many other +GUI libraries that you could be interested in. For more information about alternatives, see the :ref:`other-gui-packages` section. .. toctree:: - + tkinter.rst tkinter.tix.rst tkinter.scrolledtext.rst Modified: python/branches/py3k-issue1717/Doc/library/tkinter.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/tkinter.rst (original) +++ python/branches/py3k-issue1717/Doc/library/tkinter.rst Sun Jan 25 21:08:20 2009 @@ -41,7 +41,7 @@ linked with the Python interpreter. In addition to the Tk interface module, :mod:`tkinter` includes a number of -Python modules, :mod:`tkinter.constants` being one of the most important. +Python modules, :mod:`tkinter.constants` being one of the most important. Importing :mod:`tkinter` will automatically import :mod:`tkinter.constants`, so, usually, to use Tkinter all you need is a simple import statement:: @@ -96,7 +96,7 @@ Basic dialogs and convenience functions. :mod:`tkinter.dnd` - Drag-and-drop support for :mod:`tkinter`. This is experimental and should + Drag-and-drop support for :mod:`tkinter`. This is experimental and should become deprecated when it is replaced with the Tk DND. :mod:`turtle` @@ -156,7 +156,7 @@ the novice. The book is not exhaustive, and for many details it defers to the man pages. -* :file:`tkinter/__init__.py` is a last resort for most, but can be a good +* :file:`tkinter/__init__.py` is a last resort for most, but can be a good place to go when nothing else makes sense. @@ -271,7 +271,7 @@ someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say:: - .fred someAction someOptions + .fred someAction someOptions Note that the object name, ``.fred``, starts with a dot. @@ -320,7 +320,7 @@ arguments. In Tkinter, the Pack class holds all this functionality, and the various forms of the pack command are implemented as methods. All widgets in :mod:`tkinter` are subclassed from the Packer, and so inherit all the packing -methods. See the :mod:`tkinter.tix` module documentation for additional +methods. See the :mod:`tkinter.tix` module documentation for additional information on the Form geometry manager. :: pack .fred -side left =====> fred.pack(side = "left") @@ -477,7 +477,7 @@ For more extensive information on the packer and the options that it can take, see the man pages and page 183 of John Ousterhout's book. -anchor +anchor Anchor type. Denotes where the packer is to place each slave in its parcel. expand @@ -707,7 +707,7 @@ they are denoted in Tk, which can be useful when referring to the Tk man pages. :: - Tk Tkinter Event Field Tk Tkinter Event Field + Tk Tkinter Event Field Tk Tkinter Event Field -- ------------------- -- ------------------- %f focus %A char %h height %E send_event Modified: python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst (original) +++ python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst Sun Jan 25 21:08:20 2009 @@ -8,12 +8,12 @@ .. index:: single: Tix -The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional -rich set of widgets. Although the standard Tk library has many useful widgets, +The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional +rich set of widgets. Although the standard Tk library has many useful widgets, they are far from complete. The :mod:`tkinter.tix` library provides most of the -commonly needed widgets that are missing from standard Tk: :class:`HList`, -:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of -scrollable widgets. +commonly needed widgets that are missing from standard Tk: :class:`HList`, +:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of +scrollable widgets. :mod:`tkinter.tix` also includes many more widgets that are generally useful in a wide range of applications: :class:`NoteBook`, :class:`FileEntry`, :class:`PanedWindow`, etc; there are more than 40 of them. @@ -50,10 +50,10 @@ Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. - Classes in the :mod:`tkinter.tix` module subclasses the classes in the - :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` - with Tkinter, all you need to do is to import one module. In general, you - can just import :mod:`tkinter.tix`, and replace the toplevel call to + Classes in the :mod:`tkinter.tix` module subclasses the classes in the + :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` + with Tkinter, all you need to do is to import one module. In general, you + can just import :mod:`tkinter.tix`, and replace the toplevel call to :class:`tkinter.Tk` with :class:`tix.Tk`:: from tkinter import tix @@ -437,7 +437,7 @@ The :mod:`tkinter.tix` module adds: * `pixmap `_ - capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create + capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create color images from XPM files. .. Python Demo of: Modified: python/branches/py3k-issue1717/Doc/library/tokenize.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/tokenize.rst (original) +++ python/branches/py3k-issue1717/Doc/library/tokenize.rst Sun Jan 25 21:08:20 2009 @@ -19,16 +19,16 @@ The :func:`tokenize` generator requires one argument, *readline*, which must be a callable object which provides the same interface as the :meth:`readline` method of built-in file objects (see section - :ref:`bltin-file-objects`). Each call to the function should return one + :ref:`bltin-file-objects`). Each call to the function should return one line of input as bytes. - The generator produces 5-tuples with these members: the token type; the - token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and - column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of - ints specifying the row and column where the token ends in the source; and + The generator produces 5-tuples with these members: the token type; the + token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and + column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of + ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed (the last tuple item) is the *logical* line; continuation lines are included. - + :func:`tokenize` determines the source encoding of the file by looking for a UTF-8 BOM or encoding cookie, according to :pep:`263`. @@ -44,35 +44,35 @@ .. data:: NL Token value used to indicate a non-terminating newline. The NEWLINE token - indicates the end of a logical line of Python code; NL tokens are generated + indicates the end of a logical line of Python code; NL tokens are generated when a logical line of code is continued over multiple physical lines. .. data:: ENCODING - Token value that indicates the encoding used to decode the source bytes - into text. The first token returned by :func:`tokenize` will always be an + Token value that indicates the encoding used to decode the source bytes + into text. The first token returned by :func:`tokenize` will always be an ENCODING token. -Another function is provided to reverse the tokenization process. This is -useful for creating tools that tokenize a script, modify the token stream, and +Another function is provided to reverse the tokenization process. This is +useful for creating tools that tokenize a script, modify the token stream, and write back the modified script. .. function:: untokenize(iterable) Converts tokens back into Python source code. The *iterable* must return - sequences with at least two elements, the token type and the token string. + sequences with at least two elements, the token type and the token string. Any additional sequence elements are ignored. - + The reconstructed script is returned as a single string. The result is guaranteed to tokenize back to match the input so that the conversion is - lossless and round-trips are assured. The guarantee applies only to the - token type and token string as the spacing between tokens (column + lossless and round-trips are assured. The guarantee applies only to the + token type and token string as the spacing between tokens (column positions) may change. - - It returns bytes, encoded using the ENCODING token, which is the first + + It returns bytes, encoded using the ENCODING token, which is the first token sequence output by :func:`tokenize`. @@ -81,43 +81,43 @@ .. function:: detect_encoding(readline) - The :func:`detect_encoding` function is used to detect the encoding that - should be used to decode a Python source file. It requires one argment, + The :func:`detect_encoding` function is used to detect the encoding that + should be used to decode a Python source file. It requires one argment, readline, in the same way as the :func:`tokenize` generator. - + It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (not decoded from bytes) it has read in. - + It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. - - If no encoding is specified, then the default of 'utf-8' will be returned. - + If no encoding is specified, then the default of 'utf-8' will be returned. + + Example of a script re-writer that transforms float literals into Decimal objects:: def decistmt(s): """Substitute Decimals for floats in a string of statements. - + >>> from decimal import Decimal >>> s = 'print(+21.3e-5*-.1234/81.7)' >>> decistmt(s) "print (+Decimal ('21.3e-5')*-Decimal ('.1234')/Decimal ('81.7'))" - + The format of the exponent is inherited from the platform C library. Known cases are "e-007" (Windows) and "e-07" (not Windows). Since we're only showing 12 digits, and the 13th isn't close to 5, the rest of the output should be platform-independent. - + >>> exec(s) #doctest: +ELLIPSIS -3.21716034272e-0...7 - + Output from calculations with Decimal should be identical across all platforms. - + >>> exec(decistmt(s)) -3.217160342717258261933904529E-7 """ Modified: python/branches/py3k-issue1717/Doc/library/trace.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/trace.rst (original) +++ python/branches/py3k-issue1717/Doc/library/trace.rst Sun Jan 25 21:08:20 2009 @@ -65,13 +65,13 @@ :option:`--ignore-module` Accepts comma separated list of module names. Ignore each of the named - module and its submodules (if it is a package). May be given + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` Ignore all modules and packages in the named directory and subdirectories (multiple directories can be joined by os.pathsep). May be given multiple - times. + times. .. _trace-api: Modified: python/branches/py3k-issue1717/Doc/library/traceback.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/traceback.rst (original) +++ python/branches/py3k-issue1717/Doc/library/traceback.rst Sun Jan 25 21:08:20 2009 @@ -163,10 +163,10 @@ def lumberjack(): bright_side_of_death() - + def bright_side_of_death(): return tuple()[0] - + try: lumberjack() except: @@ -245,12 +245,12 @@ >>> import traceback >>> def another_function(): ... lumberstack() - ... + ... >>> def lumberstack(): ... traceback.print_stack() ... print(repr(traceback.extract_stack())) ... print(repr(traceback.format_stack())) - ... + ... >>> another_function() File "", line 10, in another_function() Modified: python/branches/py3k-issue1717/Doc/library/turtle.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/turtle.rst (original) +++ python/branches/py3k-issue1717/Doc/library/turtle.rst Sun Jan 25 21:08:20 2009 @@ -322,8 +322,7 @@ :param y: a number (integer or float) - Set the turtle's first coordinate to *y*, leave second coordinate - unchanged. + Set the turtle's second coordinate to *y*, leave first coordinate unchanged. >>> turtle.position() (0.00, 40.00) @@ -1563,7 +1562,7 @@ Subclass of TurtleScreen, with :ref:`four methods added `. - + .. class:: ScrolledCavas(master) :param master: some Tkinter widget to contain the ScrolledCanvas, i.e. @@ -1588,13 +1587,13 @@ "compound" ``None`` (a compund shape has to be constructed using the :meth:`addcomponent` method) =========== =========== - + .. method:: addcomponent(poly, fill, outline=None) :param poly: a polygon, i.e. a tuple of pairs of numbers :param fill: a color the *poly* will be filled with :param outline: a color for the poly's outline (if given) - + Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1638,31 +1637,31 @@ >>> help(Screen.bgcolor) Help on method bgcolor in module turtle: - + bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - - + + >>> screen.bgcolor("orange") >>> screen.bgcolor() "orange" >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() "#800080" - + >>> help(Turtle.penup) Help on method penup in module turtle: - + penup(self) unbound turtle.Turtle method Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + >>> turtle.penup() - The docstrings of the functions which are derived from methods have a modified @@ -1670,32 +1669,32 @@ >>> help(bgcolor) Help on function bgcolor in module turtle: - + bgcolor(*args) Set or return backgroundcolor of the TurtleScreen. - + Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. - + Example:: - + >>> bgcolor("orange") >>> bgcolor() "orange" >>> bgcolor(0.5,0,0.5) >>> bgcolor() "#800080" - + >>> help(penup) Help on function penup in module turtle: - + penup() Pull the pen up -- no drawing when moving. - + Aliases: penup | pu | up - + No argument - + Example: >>> penup() @@ -1871,19 +1870,19 @@ Changes since Python 2.6 ======================== -- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and - :meth:`Turtle.window_height` have been eliminated. - Methods with these names and functionality are now available only +- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and + :meth:`Turtle.window_height` have been eliminated. + Methods with these names and functionality are now available only as methods of :class:`Screen`. The functions derived from these remain - available. (In fact already in Python 2.6 these methods were merely - duplications of the corresponding + available. (In fact already in Python 2.6 these methods were merely + duplications of the corresponding :class:`TurtleScreen`/:class:`Screen`-methods.) -- The method :meth:`Turtle.fill` has been eliminated. - The behaviour of :meth:`begin_fill` and :meth:`end_fill` - have changed slightly: now every filling-process must be completed with an +- The method :meth:`Turtle.fill` has been eliminated. + The behaviour of :meth:`begin_fill` and :meth:`end_fill` + have changed slightly: now every filling-process must be completed with an ``end_fill()`` call. - + - A method :meth:`Turtle.filling` has been added. It returns a boolean value: ``True`` if a filling process is under way, ``False`` otherwise. This behaviour corresponds to a ``fill()`` call without arguments in Modified: python/branches/py3k-issue1717/Doc/library/unicodedata.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/unicodedata.rst (original) +++ python/branches/py3k-issue1717/Doc/library/unicodedata.rst Sun Jan 25 21:08:20 2009 @@ -156,7 +156,7 @@ File "", line 1, in ? ValueError: not a decimal >>> unicodedata.category('A') # 'L'etter, 'u'ppercase - 'Lu' + 'Lu' >>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber 'AN' Modified: python/branches/py3k-issue1717/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/unittest.rst (original) +++ python/branches/py3k-issue1717/Doc/library/unittest.rst Sun Jan 25 21:08:20 2009 @@ -592,7 +592,7 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare @@ -603,7 +603,7 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of decimal *places* (default 7), + difference, rounding to the given number of decimal *places* (default 7), and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare Modified: python/branches/py3k-issue1717/Doc/library/urllib.parse.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/urllib.parse.rst (original) +++ python/branches/py3k-issue1717/Doc/library/urllib.parse.rst Sun Jan 25 21:08:20 2009 @@ -365,7 +365,7 @@ 'http://www.Python.org/doc/' -The following classes provide the implementations of the parse results:: +The following classes provide the implementations of the parse results: .. class:: BaseResult Modified: python/branches/py3k-issue1717/Doc/library/urllib.request.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/urllib.request.rst (original) +++ python/branches/py3k-issue1717/Doc/library/urllib.request.rst Sun Jan 25 21:08:20 2009 @@ -49,8 +49,8 @@ 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 `ProxyHandler` - objects. + as a dict parameter to urlopen can be availed by the use of + :class:`ProxyHandler` objects. .. function:: install_opener(opener) Modified: python/branches/py3k-issue1717/Doc/library/warnings.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/warnings.rst (original) +++ python/branches/py3k-issue1717/Doc/library/warnings.rst Sun Jan 25 21:08:20 2009 @@ -279,15 +279,15 @@ this function with an alternative implementation by assigning to ``warnings.showwarning``. *line* is a line of source code to be included in the warning - message; if *line* is not supplied, :func:`showwarning` will + message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. function:: formatwarning(message, category, filename, lineno[, line]) Format a warning the standard way. This returns a string which may contain - embedded newlines and ends in a newline. *line* is - a line of source code to be included in the warning message; if *line* is not supplied, + embedded newlines and ends in a newline. *line* is + a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. @@ -335,8 +335,3 @@ module returned when you import :mod:`warnings` whose filter will be protected. This argument exists primarily for testing the :mod:`warnings` module itself. - - .. versionchanged:: 3.0 - - Constructor arguments turned into keyword-only arguments. - Modified: python/branches/py3k-issue1717/Doc/library/webbrowser.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/webbrowser.rst (original) +++ python/branches/py3k-issue1717/Doc/library/webbrowser.rst Sun Jan 25 21:08:20 2009 @@ -155,7 +155,7 @@ url = 'http://www.python.org' - # Open URL in a new tab, if a browser window is already open. + # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(url + '/doc') # Open URL in new window, raising the window if possible. Modified: python/branches/py3k-issue1717/Doc/library/wsgiref.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/wsgiref.rst (original) +++ python/branches/py3k-issue1717/Doc/library/wsgiref.rst Sun Jan 25 21:08:20 2009 @@ -122,13 +122,13 @@ def simple_app(environ, start_response): setup_testing_defaults(environ) - status = '200 OK' - headers = [('Content-type', 'text/plain')] + status = b'200 OK' + headers = [(b'Content-type', b'text/plain; charset=utf-8')] start_response(status, headers) - ret = ["%s: %s\n" % (key, value) - for key, value in environ.iteritems()] + ret = [("%s: %s\n" % (key, value)).encode("utf-8") + for key, value in environ.items()] return ret httpd = make_server('', 8000, simple_app) @@ -161,14 +161,14 @@ Example usage:: - from StringIO import StringIO + from io import StringIO from wsgiref.util import FileWrapper # We're using a StringIO-buffer for as the file-like object filelike = StringIO("This is an example file-like object"*10) wrapper = FileWrapper(filelike, blksize=5) - for chunk in wrapper: + for chunk in wrapper: print(chunk) @@ -413,16 +413,16 @@ from wsgiref.validate import validator from wsgiref.simple_server import make_server - # Our callable object which is intentionally not compliant to the + # Our callable object which is intentionally not compliant to the # standard, so the validator is going to break def simple_app(environ, start_response): - status = '200 OK' # HTTP Status - headers = [('Content-type', 'text/plain')] # HTTP Headers + status = b'200 OK' # HTTP Status + headers = [(b'Content-type', b'text/plain')] # HTTP Headers start_response(status, headers) # This is going to break because we need to return a list, and # the validator is going to inform us - return "Hello World" + return b"Hello World" # This is the application wrapped in a validator validator_app = validator(simple_app) @@ -509,7 +509,7 @@ .. method:: BaseHandler._write(data) - Buffer the string *data* for transmission to the client. It's okay if this + Buffer the bytes *data* for transmission to the client. It's okay if this method actually transmits the data; :class:`BaseHandler` just separates write and flush operations for greater efficiency when the underlying system actually has such a distinction. @@ -712,12 +712,12 @@ # is a dictionary containing CGI-style envrironment variables and the # second variable is the callable object (see PEP333) def hello_world_app(environ, start_response): - status = '200 OK' # HTTP Status - headers = [('Content-type', 'text/plain')] # HTTP Headers + status = b'200 OK' # HTTP Status + headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers start_response(status, headers) # The returned object is going to be printed - return ["Hello World"] + return [b"Hello World"] httpd = make_server('', 8000, hello_world_app) print("Serving on port 8000...") Modified: python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst Sun Jan 25 21:08:20 2009 @@ -32,7 +32,7 @@ A C implementation of this API is available as :mod:`xml.etree.cElementTree`. See http://effbot.org/zone/element-index.htm for tutorials and links to other -docs. Fredrik Lundh's page is also the location of the development version of the +docs. Fredrik Lundh's page is also the location of the development version of the xml.etree.ElementTree. .. _elementtree-functions: @@ -379,7 +379,7 @@ Example page -

    Moved to example.org +

    Moved to example.org or example.com.

    @@ -486,9 +486,9 @@ :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method for each opening tag, its :meth:`end` method for each closing tag, -and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` -calls *target*\'s method :meth:`close`. -:class:`XMLTreeBuilder` can be used not only for building a tree structure. +and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` +calls *target*\'s method :meth:`close`. +:class:`XMLTreeBuilder` can be used not only for building a tree structure. This is an example of counting the maximum depth of an XML file:: >>> from xml.etree.ElementTree import XMLTreeBuilder @@ -496,16 +496,16 @@ ... maxDepth = 0 ... depth = 0 ... def start(self, tag, attrib): # Called for each opening tag. - ... self.depth += 1 + ... self.depth += 1 ... if self.depth > self.maxDepth: ... self.maxDepth = self.depth ... def end(self, tag): # Called for each closing tag. ... self.depth -= 1 - ... def data(self, data): + ... def data(self, data): ... pass # We do not need to do anything with data. ... def close(self): # Called when all data has been parsed. ... return self.maxDepth - ... + ... >>> target = MaxDepth() >>> parser = XMLTreeBuilder(target=target) >>> exampleXml = """ Modified: python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst (original) +++ python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst Sun Jan 25 21:08:20 2009 @@ -513,8 +513,8 @@ self.proxy = proxy def make_connection(self, host): self.realhost = host - h = http.client.HTTP(self.proxy) - return h + h = http.client.HTTP(self.proxy) + return h def send_request(self, connection, handler, request_body): connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler)) def send_host(self, connection, host): Modified: python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst (original) +++ python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst Sun Jan 25 21:08:20 2009 @@ -126,7 +126,7 @@ requestHandler=RequestHandler) server.register_introspection_functions() - # Register pow() function; this will use the value of + # Register pow() function; this will use the value of # pow.__name__ as the name, which is just 'pow'. server.register_function(pow) @@ -135,10 +135,10 @@ return x + y server.register_function(adder_function, 'add') - # Register an instance; all the methods of the instance are + # Register an instance; all the methods of the instance are # published as XML-RPC methods (in this case, just 'div'). class MyFuncs: - def div(self, x, y): + def div(self, x, y): return x // y server.register_instance(MyFuncs()) Modified: python/branches/py3k-issue1717/Doc/library/zipfile.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/zipfile.rst (original) +++ python/branches/py3k-issue1717/Doc/library/zipfile.rst Sun Jan 25 21:08:20 2009 @@ -67,8 +67,8 @@ otherwise returns ``False``. *filename* may be a file or file-like object too. This module does not currently handle ZIP files which have appended comments. - .. versionchanged:: 2.7 - Support for file and file-like objects. + .. versionchanged:: 3.1 + Support for file and file-like objects. .. data:: ZIP_STORED @@ -193,7 +193,7 @@ .. method:: ZipFile.extractall([path[, members[, pwd]]]) - Extract all members from the archive to the current working directory. *path* + Extract all members from the archive to the current working directory. *path* specifies a different directory to extract to. *members* is optional and must be a subset of the list returned by :meth:`namelist`. *pwd* is the password used for encrypted files. @@ -266,9 +266,9 @@ .. note:: - When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, - the compression method used will be that specified in the *compress_type* - member of the given :class:`ZipInfo` instance. By default, the + When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, + the compression method used will be that specified in the *compress_type* + member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. The following data attributes are also available: @@ -282,9 +282,9 @@ .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a - :class:`ZipFile` instance created with mode 'a' or 'w', this should be a - string no longer than 65535 bytes. Comments longer than this will be + The comment text associated with the ZIP file. If assigning a comment to a + :class:`ZipFile` instance created with mode 'a' or 'w', this should be a + string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when :meth:`ZipFile.close` is called. .. _pyzipfile-objects: @@ -313,10 +313,10 @@ internal use only. The :meth:`writepy` method makes archives with file names like this:: - string.pyc # Top level name - test/__init__.pyc # Package directory + string.pyc # Top level name + test/__init__.pyc # Package directory test/testall.pyc # Module test.testall - test/bogus/__init__.pyc # Subpackage directory + test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile Modified: python/branches/py3k-issue1717/Doc/library/zipimport.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/zipimport.rst (original) +++ python/branches/py3k-issue1717/Doc/library/zipimport.rst Sun Jan 25 21:08:20 2009 @@ -142,7 +142,7 @@ -------- ------- 8467 1 file $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading 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 Jan 25 21:08:20 2009 @@ -31,19 +31,30 @@ Exception raised on compression and decompression errors. -.. function:: adler32(string[, value]) +.. function:: adler32(data[, value]) - Computes a Adler-32 checksum of *string*. (An Adler-32 checksum is almost as + Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much more quickly.) If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Always returns an unsigned 32-bit integer. +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. + .. function:: compress(string[, level]) @@ -62,22 +73,33 @@ ``9`` is slowest and produces the most. The default value is ``6``. -.. function:: crc32(string[, value]) +.. function:: crc32(data[, value]) .. index:: single: Cyclic Redundancy Check single: checksum; Cyclic Redundancy Check - Computes a CRC (Cyclic Redundancy Check) checksum of *string*. If *value* is + Computes a CRC (Cyclic Redundancy Check) checksum of *data*. If *value* is present, it is used as the starting value of the checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the - concatenation of several input strings. The algorithm is not cryptographically + concatenation of several inputs. The algorithm is not cryptographically strong, and should not be used for authentication or digital signatures. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Always returns an unsigned 32-bit integer. +.. note:: + 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 + regardless of sign. + +.. versionchanged:: 3.0 + The return value will always be unsigned and in the range [0, 2**32-1] + regardless of platform. + .. function:: decompress(string[, wbits[, bufsize]]) Modified: python/branches/py3k-issue1717/Doc/license.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/license.rst (original) +++ python/branches/py3k-issue1717/Doc/license.rst Sun Jan 25 21:08:20 2009 @@ -124,7 +124,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ?? 2001-2008 Python Software Foundation; All Rights + copyright, i.e., "Copyright ?? 2001-2009 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. @@ -386,8 +386,8 @@ The source for the :mod:`fpectl` module includes the following notice:: - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -419,7 +419,7 @@ | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / + \ endorsement purposes. / --------------------------------------------------------------------- Modified: python/branches/py3k-issue1717/Doc/make.bat ============================================================================== --- python/branches/py3k-issue1717/Doc/make.bat (original) +++ python/branches/py3k-issue1717/Doc/make.bat Sun Jan 25 21:08:20 2009 @@ -8,34 +8,41 @@ if "%1" EQU "" goto help if "%1" EQU "html" goto build if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun +if "%1" EQU "latex" goto build +if "%1" EQU "text" goto build +if "%1" EQU "suspicious" goto build +if "%1" EQU "linkcheck" goto build +if "%1" EQU "changes" goto build if "%1" EQU "checkout" goto checkout if "%1" EQU "update" goto update :help +set this=%~n0 echo HELP echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun +echo %this% checkout +echo %this% update +echo %this% html +echo %this% htmlhelp +echo %this% latex +echo %this% text +echo %this% suspicious +echo %this% linkcheck +echo %this% changes echo. goto end :checkout svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments +svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils +svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2 +svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments goto end :update svn update tools/sphinx svn update tools/docutils -svn update tools/jinja +svn update tools/jinja2 svn update tools/pygments goto end @@ -43,13 +50,8 @@ if not exist build mkdir build if not exist build\%1 mkdir build\%1 if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 +cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%* if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp goto end -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - :end Modified: python/branches/py3k-issue1717/Doc/reference/datamodel.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/reference/datamodel.rst (original) +++ python/branches/py3k-issue1717/Doc/reference/datamodel.rst Sun Jan 25 21:08:20 2009 @@ -317,7 +317,7 @@ slicing notations can be used as the target of assignment and :keyword:`del` (delete) statements. - There is currently a single intrinsic mutable sequence type: + There are currently two intrinsic mutable sequence types: Lists .. index:: object: list @@ -1152,7 +1152,7 @@ implementing :meth:`__format__`, however most classes will either delegate formatting to one of the built-in types, or use a similar formatting option syntax. - + See :ref:`formatspec` for a description of the standard formatting syntax. The return value must be a string object. @@ -1777,13 +1777,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``. Modified: python/branches/py3k-issue1717/Doc/reference/expressions.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/reference/expressions.rst (original) +++ python/branches/py3k-issue1717/Doc/reference/expressions.rst Sun Jan 25 21:08:20 2009 @@ -552,7 +552,7 @@ :keyword:`del` statements. The syntax for a slicing: .. productionlist:: - slicing: `primary` "[" `slice_list` "]" + slicing: `primary` "[" `slice_list` "]" slice_list: `slice_item` ("," `slice_item`)* [","] slice_item: `expression` | `proper_slice` proper_slice: [`lower_bound`] ":" [`upper_bound`] [ ":" [`stride`] ] @@ -640,7 +640,7 @@ the call. .. note:: - + An implementation may provide builtin functions whose positional parameters do not have names, even if they are 'named' for the purpose of documentation, and which therefore cannot be supplied by keyword. In CPython, this is the case for @@ -1045,7 +1045,7 @@ Comparison of objects of the differing types depends on whether either of the types provide explicit support for the comparison. Most numeric types can be compared with one another, but comparisons of :class:`float` and -:class:`Decimal` are not supported to avoid the inevitable confusion arising +:class:`Decimal` are not supported to avoid the inevitable confusion arising from representation issues such as ``float('1.1')`` being inexactly represented and therefore not exactly equal to ``Decimal('1.1')`` which is. When cross-type comparison is not supported, the comparison method returns @@ -1323,7 +1323,7 @@ identity only, but this caused surprises because people expected to be able to test a dictionary for emptiness by comparing it to ``{}``. -.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of +.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 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. Modified: python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst (original) +++ python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst Sun Jan 25 21:08:20 2009 @@ -608,7 +608,7 @@ 7 2147483647 0o177 0b100110111 3 79228162514264337593543950336 0o377 0x100000000 - 79228162514264337593543950336 0xdeadbeef + 79228162514264337593543950336 0xdeadbeef .. _floating: @@ -654,7 +654,7 @@ part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of imaginary literals:: - 3.14j 10.j 10j .001j 1e100j 3.14e-10j + 3.14j 10.j 10j .001j 1e100j 3.14e-10j .. _operators: Modified: python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst (original) +++ python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst Sun Jan 25 21:08:20 2009 @@ -246,7 +246,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: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**=" : | ">>=" | "<<=" | "&=" | "^=" | "|=" @@ -507,7 +508,7 @@ .. index:: pair: exception; chaining __cause__ (exception attribute) __context__ (exception attribute) - + The ``from`` clause is used for exception chaining: if given, the second *expression* must be another exception class or instance, which will then be attached to the raised exception as the :attr:`__cause__` attribute (which is @@ -729,7 +730,7 @@ searched inside the package. A package is generally a subdirectory of a directory on ``sys.path`` that has a file :file:`__init__.py`. -.. +.. [XXX Can't be bothered to spell this out right now; see the URL http://www.python.org/doc/essays/packages.html for more details, also about how @@ -871,12 +872,12 @@ nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)* .. XXX add when implemented - : ["=" (`target_list` "=")+ `expression_list`] - : | "nonlocal" `identifier` `augop` `expression_list` + : ["=" (`target_list` "=")+ expression_list] + : | "nonlocal" identifier augop expression_list -The :keyword:`nonlocal` statement causes the listed identifiers to refer to -previously bound variables in the nearest enclosing scope. This is important -because the default behavior for binding is to search the local namespace +The :keyword:`nonlocal` statement causes the listed identifiers to refer to +previously bound variables in the nearest enclosing scope. This is important +because the default behavior for binding is to search the local namespace first. The statement allows encapsulated code to rebind variables outside of the local scope besides the global (module) scope. @@ -889,7 +890,7 @@ enclosing scope (the scope in which a new binding should be created cannot be determined unambiguously). -Names listed in a :keyword:`nonlocal` statement must not collide with +Names listed in a :keyword:`nonlocal` statement must not collide with pre-existing bindings in the local scope. .. seealso:: Modified: python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py Sun Jan 25 21:08:20 2009 @@ -46,15 +46,9 @@ from docutils.io import StringOutput from docutils.utils import new_document -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 +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + class PydocTopicsBuilder(Builder): name = 'pydoc-topics' @@ -90,6 +84,9 @@ finally: f.close() +# Support for checking for suspicious markup + +import suspicious # Support for documenting Opcodes @@ -114,5 +111,6 @@ def setup(app): app.add_role('issue', issue_role) app.add_builder(PydocTopicsBuilder) + app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) Modified: python/branches/py3k-issue1717/Doc/tutorial/classes.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/classes.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/classes.rst Sun Jan 25 21:08:20 2009 @@ -14,7 +14,7 @@ class or classes, and a method can call the method of a base class with the same name. Objects can contain an arbitrary amount of private data. -In C++ terminology, normally class members (including the data members) are +In C++ terminology, normally class members (including the data members) are *public* (except see below :ref:`tut-private`), and all member functions are *virtual*. There are no special constructors or destructors. As in Modula-3, there are no shorthands for referencing the @@ -171,7 +171,7 @@ def do_global(): global spam spam = "global spam" - + spam = "test spam" do_local() print("After local assignment:", spam) @@ -302,7 +302,7 @@ ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -532,7 +532,7 @@ is ``True`` since :class:`bool` is a subclass of :class:`int`. However, ``issubclass(float, int)`` is ``False`` since :class:`float` is not a subclass of :class:`int`. - + .. _tut-multiple: @@ -789,7 +789,7 @@ f l o - g + g Anything that can be done with generators can also be done with class based iterators as described in the previous section. What makes generators so Modified: python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst Sun Jan 25 21:08:20 2009 @@ -61,7 +61,7 @@ ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print(x, len(x)) - ... + ... cat 3 window 6 defenestrate 12 @@ -74,7 +74,7 @@ >>> for x in a[:]: # make a slice copy of the entire list ... if len(x) > 6: a.insert(0, x) - ... + ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] @@ -96,7 +96,7 @@ 2 3 4 - + The given end point is never part of the generated list; ``range(10)`` generates @@ -104,13 +104,13 @@ is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the 'step'):: - range(5, 10) + range(5, 10) 5 through 9 - range(0, 10, 3) + range(0, 10, 3) 0, 3, 6, 9 - range(-10, -100, -30) + range(-10, -100, -30) -10, -40, -70 To iterate over the indices of a sequence, you can combine :func:`range` and @@ -119,7 +119,7 @@ >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print(i, a[i]) - ... + ... 0 Mary 1 had 2 a @@ -135,12 +135,12 @@ range(0, 10) In many ways the object returned by :func:`range` behaves as if it is a list, -but in fact it isn't. It is an object which returns the successive items of -the desired sequence when you iterate over it, but it doesn't really make -the list, thus saving space. +but in fact it isn't. It is an object which returns the successive items of +the desired sequence when you iterate over it, but it doesn't really make +the list, thus saving space. -We say such an object is *iterable*, that is, suitable as a target for -functions and constructs that expect something from which they can +We say such an object is *iterable*, that is, suitable as a target for +functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the :keyword:`for` statement is such an *iterator*. The function :func:`list` is another; it creates lists from iterables:: @@ -177,7 +177,7 @@ ... else: ... # loop fell through without finding a factor ... print(n, 'is a prime number') - ... + ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 @@ -198,7 +198,7 @@ >>> while True: ... pass # Busy-wait for keyboard interrupt (Ctrl+C) - ... + ... This is commonly used for creating minimal classes:: @@ -212,7 +212,7 @@ >>> def initlog(*args): ... pass # Remember to implement this! - ... + ... .. _tut-functions: @@ -229,7 +229,7 @@ ... print(b, end=' ') ... a, b = b, a+b ... print() - ... + ... >>> # Now call the function we just defined: ... fib(2000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 @@ -300,7 +300,7 @@ ... result.append(b) # see below ... a, b = b, a+b ... return result - ... + ... >>> f100 = fib2(100) # call it >>> f100 # write the result [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] @@ -436,7 +436,7 @@ >>> def function(a): ... pass - ... + ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in ? @@ -487,7 +487,7 @@ ------------------------ .. index:: - statement: * + statement: * Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -497,13 +497,13 @@ def write_multiple_items(file, separator, *args): file.write(separator.join(args)) - + Normally, these ``variadic`` arguments will be last in the list of formal -parameters, because they scoop up all remaining input arguments that are +parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the ``*args`` -parameter are 'keyword-only' arguments, meaning that they can only be used as +parameter are 'keyword-only' arguments, meaning that they can only be used as keywords rather than positional arguments. :: - + >>> def concat(*args, sep="/"): ... return sep.join(args) ... @@ -581,7 +581,7 @@ single: strings, documentation Here are some conventions about the content and formatting of documentation -strings. +strings. The first line should always be a short, concise summary of the object's purpose. For brevity, it should not explicitly state the object's name or type, @@ -610,11 +610,11 @@ >>> def my_function(): ... """Do nothing, but document it. - ... + ... ... No, really, it doesn't do anything. ... """ ... pass - ... + ... >>> print(my_function.__doc__) Do nothing, but document it. Modified: python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst Sun Jan 25 21:08:20 2009 @@ -159,7 +159,7 @@ List comprehensions provide a concise way to create lists from sequences. Common applications are to make lists where each element is the result of -some operations applied to each member of the sequence, or to create a +some operations applied to each member of the sequence, or to create a subsequence of those elements that satisfy a certain condition. @@ -167,7 +167,7 @@ clause, then zero or more :keyword:`for` or :keyword:`if` clauses. The result will be a list resulting from evaluating the expression in the context of the :keyword:`for` and :keyword:`if` clauses which follow it. If the expression -would evaluate to a tuple, it must be parenthesized. +would evaluate to a tuple, it must be parenthesized. Here we take a list of numbers and return a list of three times each number:: @@ -195,7 +195,7 @@ Tuples can often be created without their parentheses, but not here:: - >>> [x, x**2 for x in vec] # error - parens required for tuples + >>> [x, x**2 for x in vec] # error - parens required for tuples File "", line 1, in ? [x, x**2 for x in vec] ^ @@ -227,7 +227,7 @@ powerful tool but -- like all powerful tools -- they need to be used carefully, if at all. -Consider the following example of a 3x3 matrix held as a list containing three +Consider the following example of a 3x3 matrix held as a list containing three lists, one list per row:: >>> mat = [ @@ -236,7 +236,7 @@ ... [7, 8, 9], ... ] -Now, if you wanted to swap rows and columns, you could use a list +Now, if you wanted to swap rows and columns, you could use a list comprehension:: >>> print([[row[i] for row in mat] for i in [0, 1, 2]]) @@ -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 builtin functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> list(zip(*mat)) @@ -519,7 +519,7 @@ >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print('What is your {0}? It is {1}.'.format(q, a)) - ... + ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. @@ -542,7 +542,7 @@ >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print(f) - ... + ... apple banana orange Modified: python/branches/py3k-issue1717/Doc/tutorial/errors.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/errors.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/errors.rst Sun Jan 25 21:08:20 2009 @@ -91,7 +91,7 @@ ... break ... except ValueError: ... print("Oops! That was no valid number. Try again...") - ... + ... The :keyword:`try` statement works as follows. @@ -195,12 +195,12 @@ >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as err: ... print('Handling run-time error:', err) - ... + ... Handling run-time error: int division or modulo by zero @@ -251,12 +251,12 @@ ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print('My exception occurred, value:', e.value) - ... + ... My exception occurred, value: 4 >>> raise MyError('oops!') Traceback (most recent call last): @@ -326,7 +326,7 @@ ... raise KeyboardInterrupt ... finally: ... print('Goodbye, world!') - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? @@ -389,9 +389,9 @@ print(line) The problem with this code is that it leaves the file open for an indeterminate -amount of time after this part of the code has finished executing. -This is not an issue in simple scripts, but can be a problem for larger -applications. The :keyword:`with` statement allows objects like files to be +amount of time after this part of the code has finished executing. +This is not an issue in simple scripts, but can be a problem for larger +applications. The :keyword:`with` statement allows objects like files to be used in a way that ensures they are always cleaned up promptly and correctly. :: with open("myfile.txt") as f: Modified: python/branches/py3k-issue1717/Doc/tutorial/index.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/index.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/index.rst Sun Jan 25 21:08:20 2009 @@ -1,7 +1,7 @@ .. _tutorial-index: ###################### - The Python Tutorial + The Python Tutorial ###################### :Release: |version| Modified: python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst Sun Jan 25 21:08:20 2009 @@ -90,7 +90,7 @@ >>> for x in range(1, 11): ... print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x)) - ... + ... 1 1 1 2 4 8 3 9 27 @@ -151,7 +151,7 @@ other='Georg')) The story of Bill, Manfred, and Georg. -An optional ``':``` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This also greater control over how the value is formatted. The following example truncates the Pi to three places after the decimal. @@ -165,7 +165,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): ... print('{0:10} ==> {1:10d}'.format(name, phone)) - ... + ... Jack ==> 4098 Dcab ==> 7678 Sjoerd ==> 4127 @@ -343,7 +343,7 @@ 16 >>> f.seek(5) # Go to the 6th byte in the file 5 - >>> f.read(1) + >>> f.read(1) b'5' >>> f.seek(-3, 2) # Go to the 3rd byte before the end 13 @@ -353,7 +353,7 @@ In text files (those opened without a ``b`` in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with ``seek(0, 2)``). - + When you're done with a file, call ``f.close()`` to close it and free up any system resources taken up by the open file. After calling ``f.close()``, attempts to use the file object will automatically fail. :: Modified: python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst Sun Jan 25 21:08:20 2009 @@ -115,7 +115,7 @@ >>> the_world_is_flat = 1 >>> if the_world_is_flat: ... print("Be careful not to fall off!") - ... + ... Be careful not to fall off! @@ -191,7 +191,7 @@ to do this, put one more special comment line right after the ``#!`` line to define the source file encoding:: - # -*- coding: encoding -*- + # -*- coding: encoding -*- With that declaration, everything in the source file will be treated as having the encoding *encoding* instead of UTF-8. The list of possible encodings can be Modified: python/branches/py3k-issue1717/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/introduction.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/introduction.rst Sun Jan 25 21:08:20 2009 @@ -58,7 +58,7 @@ >>> 8/5 # Fractions aren't lost when dividing integers 1.6000000000000001 -Note: You might not see exactly the same result; floating point results can +Note: You might not see exactly the same result; floating point results can differ from one machine to another. We will say more later about controlling the appearance of floating point output; what we see here is the most informative display but not as easy to read as we would get with:: @@ -71,9 +71,9 @@ why these two ways of displaying floating point data come to be different. See :ref:`tut-fp-issues` for a full discussion. -To do integer division and get an integer result, +To do integer division and get an integer result, discarding any fractional result, there is another operator, ``//``:: - + >>> # Integer division returns the floor: ... 7//3 2 @@ -103,7 +103,7 @@ >>> # try to access an undefined variable ... n - Traceback (most recent call last): + Traceback (most recent call last): File "", line 1, in NameError: name 'n' is not defined @@ -245,14 +245,14 @@ they will be included in the string. :: print(""" - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """) produces the following output:: - Usage: thingy [OPTIONS] + Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to @@ -371,10 +371,10 @@ Then the right edge of the last character of a string of *n* characters has index *n*, for example:: - +---+---+---+---+---+ + +---+---+---+---+---+ | H | e | l | p | A | - +---+---+---+---+---+ - 0 1 2 3 4 5 + +---+---+---+---+---+ + 0 1 2 3 4 5 -5 -4 -3 -2 -1 The first row of numbers gives the position of the indices 0...5 in the string; @@ -396,7 +396,7 @@ .. seealso:: :ref:`typesseq` - Strings are examples of *sequence types*, and support the common + Strings are examples of *sequence types*, and support the common operations supported by such types. :ref:`string-methods` @@ -565,7 +565,7 @@ >>> while b < 10: ... print(b) ... a, b = b, a+b - ... + ... 1 1 2 @@ -601,8 +601,8 @@ * The :func:`print` function writes the value of the expression(s) it is given. It differs from just writing the expression you want to write (as we did - earlier in the calculator examples) in the way it handles multiple - expressions, floating point quantities, + earlier in the calculator examples) in the way it handles multiple + expressions, floating point quantities, and strings. Strings are printed without quotes, and a space is inserted between items, so you can format things nicely, like this:: @@ -617,5 +617,5 @@ >>> while b < 1000: ... print(b, end=' ') ... a, b = b, a+b - ... + ... 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Modified: python/branches/py3k-issue1717/Doc/tutorial/modules.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/modules.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/modules.rst Sun Jan 25 21:08:20 2009 @@ -103,8 +103,8 @@ 1 1 2 3 5 8 13 21 34 55 89 144 233 377 This imports all names except those beginning with an underscore (``_``). -In most cases Python programmers do not use this facility since it introduces -an unknown set of names into the interpreter, possibly hiding some things +In most cases Python programmers do not use this facility since it introduces +an unknown set of names into the interpreter, possibly hiding some things you have already defined. .. note:: @@ -287,7 +287,7 @@ ['__name__', 'fib', 'fib2'] >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', + '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'callstats', 'copyright', 'displayhook', 'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', @@ -327,10 +327,10 @@ 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', + 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', + ', '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' Modified: python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst Sun Jan 25 21:08:20 2009 @@ -136,7 +136,7 @@ >>> random.random() # random float 0.17970987693706186 >>> random.randrange(6) # random integer chosen from range(6) - 4 + 4 The SciPy project has many other modules for numerical computations. Modified: python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst Sun Jan 25 21:08:20 2009 @@ -62,7 +62,7 @@ >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], - ... conv['frac_digits'], x), grouping=True) + ... conv['frac_digits'], x), grouping=True) '$1,234,567.80' @@ -174,7 +174,7 @@ class AsyncZip(threading.Thread): def __init__(self, infile, outfile): - threading.Thread.__init__(self) + threading.Thread.__init__(self) self.infile = infile self.outfile = outfile def run(self): @@ -358,11 +358,11 @@ results in decimal floating point and binary floating point. The difference becomes significant if the results are rounded to the nearest cent:: - >>> from decimal import * + >>> from decimal import * >>> Decimal('0.70') * Decimal('1.05') Decimal("0.7350") >>> .70 * 1.05 - 0.73499999999999999 + 0.73499999999999999 The :class:`Decimal` result keeps a trailing zero, automatically inferring four place significance from multiplicands with two place significance. Decimal @@ -380,7 +380,7 @@ >>> sum([Decimal('0.1')]*10) == Decimal('1.0') True >>> sum([0.1]*10) == 1.0 - False + False The :mod:`decimal` module provides arithmetic with as much precision as needed:: Modified: python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst (original) +++ python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst Sun Jan 25 21:08:20 2009 @@ -49,8 +49,8 @@ Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.) * http://scipy.org: The Scientific Python project includes modules for fast - array computations and manipulations plus a host of packages for such - things as linear algebra, Fourier transforms, non-linear solvers, + array computations and manipulations plus a host of packages for such + things as linear algebra, Fourier transforms, non-linear solvers, random number distributions, statistical analysis and the like. For Python-related questions and problem reports, you can post to the newsgroup @@ -68,6 +68,6 @@ .. Postings figure based on average of last six months activity as reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182 - days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) + days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) Modified: python/branches/py3k-issue1717/Doc/using/cmdline.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/using/cmdline.rst (original) +++ python/branches/py3k-issue1717/Doc/using/cmdline.rst Sun Jan 25 21:08:20 2009 @@ -8,8 +8,8 @@ The CPython interpreter scans the command line and the environment for various settings. -.. note:: - +.. note:: + Other implementations' command line schemes may differ. See :ref:`implementations` for further resources. @@ -61,7 +61,7 @@ Execute the Python code in *command*. *command* can be one ore more statements separated by newlines, with significant leading whitespace as in normal module code. - + If this option is given, the first element of :data:`sys.argv` will be ``"-c"`` and the current directory will be added to the start of :data:`sys.path` (allowing modules in that directory to be imported as top @@ -72,7 +72,7 @@ Search :data:`sys.path` for the named module and execute its contents as the :mod:`__main__` module. - + Since the argument is a *module* name, you must not give a file extension (``.py``). The ``module-name`` should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to @@ -84,18 +84,18 @@ written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available. - + If this option is given, the first element of :data:`sys.argv` will be the full path to the module file. As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. - + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: python -mtimeit -s 'setup here' 'benchmarked code here' python -mtimeit -h # for details - .. seealso:: + .. seealso:: :func:`runpy.run_module` The actual implementation of this feature. @@ -152,7 +152,7 @@ --version Print the Python version number and exit. Example output could be:: - + Python 3.0 @@ -189,7 +189,7 @@ enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal. The :envvar:`PYTHONSTARTUP` file is not read. - + This can be useful to inspect global variables or a stack trace when a script raises an exception. See also :envvar:`PYTHONINSPECT`. @@ -222,10 +222,10 @@ .. cmdoption:: -u - + Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. - + Note that there is internal buffering in :meth:`file.readlines` and :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced by this option. To work around this, you will want to use @@ -237,7 +237,7 @@ .. XXX should the -U option be documented? .. cmdoption:: -v - + Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (:option:`-vv`), print a message for each file that is checked for when @@ -246,13 +246,13 @@ .. cmdoption:: -W arg - + Warning control. Python's warning machinery by default prints warning messages to :data:`sys.stderr`. A typical warning message has the following form:: file:line: category: message - + By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. @@ -260,13 +260,13 @@ one option, the action for the last matching option is performed. Invalid :option:`-W` options are ignored (though, a warning message is printed about invalid options when the first warning is issued). - + Warnings can also be controlled from within a Python program using the :mod:`warnings` module. The simplest form of argument is one of the following action strings (or a unique abbreviation): - + ``ignore`` Ignore all warnings. ``default`` @@ -282,9 +282,9 @@ Print each warning only the first time it occurs in the program. ``error`` Raise an exception instead of printing a warning message. - - The full form of argument is:: - + + The full form of argument is:: + action:message:category:module:line Here, *action* is as explained above but only applies to messages that match @@ -305,10 +305,10 @@ .. cmdoption:: -x - + Skip the first line of the source, allowing use of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only. - + .. warning:: The line numbers in error messages will be off by one! .. _using-on-envvars: @@ -319,13 +319,13 @@ These environment variables influence Python's behavior. .. envvar:: PYTHONHOME - + Change the location of the standard Python libraries. By default, the libraries are searched in :file:`{prefix}/lib/python{version}` and :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and :file:`{exec_prefix}` are installation-dependent directories, both defaulting to :file:`/usr/local`. - + When :envvar:`PYTHONHOME` is set to a single directory, its value replaces both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`. @@ -341,11 +341,11 @@ In addition to normal directories, individual :envvar:`PYTHONPATH` entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. - + The default search path is installation dependent, but generally begins with - :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above). It + :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). It is *always* appended to :envvar:`PYTHONPATH`. - + An additional directory will be inserted in the search path in front of :envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-options`. The search path can be manipulated from @@ -353,7 +353,7 @@ .. envvar:: PYTHONSTARTUP - + If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so @@ -363,7 +363,7 @@ .. envvar:: PYTHONY2K - + Set this to a non-empty string to cause the :mod:`time` module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the :mod:`time` module @@ -371,21 +371,21 @@ .. envvar:: PYTHONOPTIMIZE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-O` option. If set to an integer, it is equivalent to specifying :option:`-O` multiple times. .. envvar:: PYTHONDEBUG - + If this is set to a non-empty string it is equivalent to specifying the :option:`-d` option. If set to an integer, it is equivalent to specifying :option:`-d` multiple times. .. envvar:: PYTHONINSPECT - + If this is set to a non-empty string it is equivalent to specifying the :option:`-i` option. @@ -394,20 +394,20 @@ .. envvar:: PYTHONUNBUFFERED - + If this is set to a non-empty string it is equivalent to specifying the :option:`-u` option. .. envvar:: PYTHONVERBOSE - + If this is set to a non-empty string it is equivalent to specifying the :option:`-v` option. If set to an integer, it is equivalent to specifying :option:`-v` multiple times. .. envvar:: PYTHONCASEOK - + If this is set, Python ignores case in :keyword:`import` statements. This only works on Windows. Modified: python/branches/py3k-issue1717/Doc/using/unix.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/using/unix.rst (original) +++ python/branches/py3k-issue1717/Doc/using/unix.rst Sun Jan 25 21:08:20 2009 @@ -19,7 +19,7 @@ package on all others. However there are certain features you might want to use that are not available on your distro's package. You can easily compile the latest version of Python from source. - + In the event that Python doesn't come preinstalled and isn't in the repositories as well, you can easily make packages for your own distro. Have a look at the following links: @@ -45,8 +45,8 @@ * OpenBSD users use:: - pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz - + pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages//python-.tgz + For example i386 users get the 2.5.1 version of Python using:: pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz @@ -87,7 +87,7 @@ Python-related paths and files ============================== - + These are subject to difference depending on local installation conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``) are installation-dependent and should be interpreted as for GNU software; they @@ -112,7 +112,7 @@ | | by the user module; not used by default | | | or by most applications. | +-----------------------------------------------+------------------------------------------+ - + Miscellaneous ============= Modified: python/branches/py3k-issue1717/Doc/using/windows.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/using/windows.rst (original) +++ python/branches/py3k-issue1717/Doc/using/windows.rst Sun Jan 25 21:08:20 2009 @@ -86,9 +86,9 @@ --------------------------------------- Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab +guide applies to XP classical view): Right-click the icon for your machine +(usually located on your Desktop and called "My Computer") and choose +:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab and click the :guilabel:`Environment Variables` button. In short, your path is: @@ -191,11 +191,11 @@ #. Launch a command prompt. #. Associate the correct file group with ``.py`` scripts:: - + assoc .py=Python.File #. Redirect all Python files to the new executable:: - + ftype Python.File=C:\Path\to\pythonw.exe "%1" %* Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.0 + What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka @@ -277,11 +277,11 @@ finding all the strings in the list containing a given substring. You could write the following to do it:: - # Given the list L, make a list of all strings + # Given the list L, make a list of all strings # containing the substring S. - sublist = filter( lambda s, substring=S: + sublist = filter( lambda s, substring=S: string.find(s, substring) != -1, - L) + L) Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` statement knows what @@ -291,9 +291,9 @@ List comprehensions have the form:: - [ expression for expr in sequence1 + [ expression for expr in sequence1 for expr2 in sequence2 ... - for exprN in sequenceN + for exprN in sequenceN if condition ] The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be @@ -312,8 +312,8 @@ ... for exprN in sequenceN: if (condition): - # Append the value of - # the expression to the + # Append the value of + # the expression to the # resulting list. This means that when there are multiple :keyword:`for`...\ :keyword:`in` @@ -368,7 +368,7 @@ def __init__(self, value): self.value = value def __iadd__(self, increment): - return Number( self.value + increment) + return Number( self.value + increment) n = Number(5) n += 3 @@ -590,7 +590,7 @@ def f(): print "i=",i - i = i + 1 + i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been @@ -627,7 +627,7 @@ the following lines of code:: if dict.has_key( key ): return dict[key] - else: + else: dict[key] = [] return dict[key] @@ -836,14 +836,14 @@ :file:`setup.py` can be just a few lines long:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:`setup.py` file isn't much more complicated if the software consists of a few packages:: from distutils.core import setup - setup (name = "foo", version = "1.0", + setup (name = "foo", version = "1.0", packages = ["package", "package.subpackage"]) A C extension can be the most complicated case; here's an example taken from @@ -852,15 +852,14 @@ from distutils.core import setup, Extension expat_extension = Extension('xml.parsers.pyexpat', - define_macros = [('XML_NS', None)], - include_dirs = [ 'extensions/expat/xmltok', - 'extensions/expat/xmlparse' ], - sources = [ 'extensions/pyexpat.c', - 'extensions/expat/xmltok/xmltok.c', - 'extensions/expat/xmltok/xmlrole.c', - ] + define_macros = [('XML_NS', None)], + include_dirs = [ 'extensions/expat/xmltok', + 'extensions/expat/xmlparse' ], + sources = [ 'extensions/pyexpat.c', + 'extensions/expat/xmltok/xmltok.c', + 'extensions/expat/xmltok/xmlrole.c', ] ) - setup (name = "PyXML", version = "0.5.4", + setup (name = "PyXML", version = "0.5.4", ext_modules =[ expat_extension ] ) The Distutils can also take care of creating source and binary distributions. Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.1 + What's New in Python 2.1 **************************** :Author: A.M. Kuchling @@ -98,7 +98,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.2 + What's New in Python 2.2 **************************** :Author: A.M. Kuchling @@ -295,7 +295,7 @@ class D (B,C): def save (self): - # Call superclass .save() + # Call superclass .save() super(D, self).save() # Save D's private information here ... @@ -473,7 +473,7 @@ Traceback (most recent call last): File "", line 1, in ? StopIteration - >>> + >>> In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it expects something for which :func:`iter` will return an iterator. For backward @@ -909,7 +909,7 @@ x = 1 def f(): # The next line is a syntax error - exec 'x=2' + exec 'x=2' def g(): return x @@ -952,8 +952,8 @@ items = s.meerkat.getItems( {'channel': 4} ) # 'items' is another list of dictionaries, like this: - # [{'link': 'http://freshmeat.net/releases/52719/', - # 'description': 'A utility which converts HTML to XSL FO.', + # [{'link': 'http://freshmeat.net/releases/52719/', + # 'description': 'A utility which converts HTML to XSL FO.', # 'title': 'html2fo 0.3 (Default)'}, ... ] The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.3 + What's New in Python 2.3 **************************** :Author: A.M. Kuchling @@ -301,7 +301,7 @@ -------- ------- 8467 1 file amk at nyman:~/src/python$ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path >>> import jwzthreading @@ -671,7 +671,7 @@ # ... } - if (hasattr(core, 'setup_keywords') and + if (hasattr(core, 'setup_keywords') and 'classifiers' in core.setup_keywords): kw['classifiers'] = \ ['Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -1027,7 +1027,7 @@ creating small dictionaries:: >>> dict(red=1, blue=2, green=3, black=4) - {'blue': 2, 'black': 4, 'green': 3, 'red': 1} + {'blue': 2, 'black': 4, 'green': 3, 'red': 1} (Contributed by Just van Rossum.) @@ -1622,7 +1622,7 @@ ... self.valuelist.pop(i) ... def keys(self): ... return list(self.keylist) - ... + ... >>> s = SeqDict() >>> dir(s) # See that other dictionary methods are implemented ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__', @@ -1779,7 +1779,7 @@ set input filename -lLENGTH, --length=LENGTH set maximum length of output - $ + $ See the module's documentation for more details. Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.4 + What's New in Python 2.4 **************************** :Author: A.M. Kuchling @@ -63,10 +63,10 @@ >>> a.add('z') # add a new element >>> a.update('wxy') # add multiple new elements >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z']) >>> a.remove('x') # take one element out >>> a - set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) + set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z']) The :func:`frozenset` type is an immutable version of :func:`set`. Since it is immutable and hashable, it may be used as a dictionary key or as a member of @@ -351,7 +351,7 @@ >>> for i in reversed(xrange(1,4)): ... print i - ... + ... 3 2 1 @@ -366,7 +366,7 @@ >>> input = open('/etc/passwd', 'r') >>> for line in reversed(list(input)): ... print line - ... + ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... @@ -396,10 +396,10 @@ different keyword arguments. :: class Popen(args, bufsize=0, executable=None, - stdin=None, stdout=None, stderr=None, - preexec_fn=None, close_fds=False, shell=False, - cwd=None, env=None, universal_newlines=False, - startupinfo=None, creationflags=0): + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): *args* is commonly a sequence of strings that will be the arguments to the program executed as the subprocess. (If the *shell* argument is true, *args* @@ -650,7 +650,7 @@ 28 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.1428571428571428571428571429") - >>> decimal.getcontext().prec = 9 + >>> decimal.getcontext().prec = 9 >>> decimal.Decimal(1) / decimal.Decimal(7) Decimal("0.142857143") @@ -665,7 +665,7 @@ >>> decimal.getcontext().traps[decimal.DivisionByZero] = False >>> decimal.Decimal(1) / decimal.Decimal(0) Decimal("Infinity") - >>> + >>> The :class:`Context` instance also has various methods for formatting numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`. @@ -803,7 +803,7 @@ >>> 'www.python.org'.split('.', 1) ['www', 'python.org'] 'www.python.org'.rsplit('.', 1) - ['www.python', 'org'] + ['www.python', 'org'] * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :meth:`sort` method of lists. These parameters make some common usages of @@ -1045,7 +1045,7 @@ >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque - True + True Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take advantage of :class:`collections.deque` for improved performance. (Contributed @@ -1106,13 +1106,13 @@ >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14] >>> for key_val, it in itertools.groupby(L, lambda x: x % 2): ... print key_val, list(it) - ... + ... 0 [2, 4, 6] 1 [7] 0 [8] 1 [9, 11] 0 [12, 14] - >>> + >>> :func:`groupby` is typically used with sorted input. The logic for :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for @@ -1120,21 +1120,21 @@ >>> word = 'abracadabra' >>> letters = sorted(word) # Turn string into a sorted list of letters - >>> letters + >>> letters ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r'] >>> for k, g in itertools.groupby(letters): ... print k, list(g) - ... + ... a ['a', 'a', 'a', 'a', 'a'] b ['b', 'b'] c ['c'] d ['d'] r ['r', 'r'] >>> # List unique letters - >>> [k for k, g in groupby(letters)] + >>> [k for k, g in groupby(letters)] ['a', 'b', 'c', 'd', 'r'] >>> # Count letter occurrences - >>> [(k, len(list(g))) for k, g in groupby(letters)] + >>> [(k, len(list(g))) for k, g in groupby(letters)] [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)] (Contributed by Hye-Shik Chang.) @@ -1175,7 +1175,7 @@ import logging logging.basicConfig(filename='/var/log/application.log', level=0, # Log all messages - format='%(levelname):%(process):%(thread):%(message)') + format='%(levelname):%(process):%(thread):%(message)') Other additions to the :mod:`logging` package include a :meth:`log(level, msg)` convenience method, as well as a :class:`TimedRotatingFileHandler` class that @@ -1428,7 +1428,7 @@ you get the following output:: ********************************************************************** - File ``t.py'', line 15, in g + File "t.py", line 15, in g Failed example: g(4) Differences (unified diff with -expected +actual): Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New in Python 2.5 + What's New in Python 2.5 **************************** :Author: A.M. Kuchling @@ -220,7 +220,7 @@ required packages. :: VERSION = '1.0' - setup(name='PyPackage', + setup(name='PyPackage', version=VERSION, requires=['numarray', 'zlib (>=1.1.4)'], obsoletes=['OldPackage'] @@ -388,7 +388,7 @@ else: else-block finally: - final-block + final-block The code in *block-1* is executed. If the code raises an exception, the various :keyword:`except` blocks are tested: if the exception is of class @@ -485,7 +485,7 @@ 9 >>> print it.next() Traceback (most recent call last): - File ``t.py'', line 15, in ? + File "t.py", line 15, in ? print it.next() StopIteration @@ -835,8 +835,8 @@ ... except (KeyboardInterrupt, SystemExit): raise - except: - # Log error... + except: + # Log error... # Continue running program... In Python 2.5, you can now write ``except Exception`` to achieve the same @@ -947,7 +947,7 @@ class C: def __index__ (self): - return self.value + return self.value The return value must be either a Python integer or long integer. The interpreter will check that the type returned is correct, and raises a @@ -1035,9 +1035,9 @@ L = ['medium', 'longest', 'short'] # Prints 'longest' - print max(L, key=len) + print max(L, key=len) # Prints 'short', because lexicographically 'short' has the largest value - print max(L) + print max(L) (Contributed by Steven Bethard and Raymond Hettinger.) @@ -1070,8 +1070,8 @@ using the default ASCII encoding. The result of the comparison is false:: >>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode - __main__:1: UnicodeWarning: Unicode equal comparison failed - to convert both arguments to Unicode - interpreting them + __main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them as being unequal False >>> chr(127) == unichr(127) # chr(127) can be converted @@ -1259,10 +1259,10 @@ Printing ``index`` results in the following output:: - defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], - 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], - 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], - 'p': ['per'], 's': ['selva', 'smarrita'], + defaultdict(, {'c': ['cammin', 'che'], 'e': ['era'], + 'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], + 'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], + 'p': ['per'], 's': ['selva', 'smarrita'], 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} (Contributed by Guido van Rossum.) @@ -1884,17 +1884,17 @@ differently. :: # Old versions - h = md5.md5() - h = md5.new() + h = md5.md5() + h = md5.new() - # New version + # New version h = hashlib.md5() # Old versions - h = sha.sha() - h = sha.new() + h = sha.sha() + h = sha.new() - # New version + # New version h = hashlib.sha1() # Hash that weren't previously available @@ -2191,7 +2191,7 @@ case that your extensions were using it, you can replace it by something like the following:: - range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", + range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", start, stop, step); .. ====================================================================== Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst Sun Jan 25 21:08:20 2009 @@ -590,30 +590,30 @@ def factorial(queue, N): - "Compute a factorial." - # If N is a multiple of 4, this function will take much longer. - if (N % 4) == 0: - time.sleep(.05 * N/4) - - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # If N is a multiple of 4, this function will take much longer. + if (N % 4) == 0: + time.sleep(.05 * N/4) + + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i - # Put the result on the queue - queue.put(fact) + # Put the result on the queue + queue.put(fact) if __name__ == '__main__': - queue = Queue() + queue = Queue() - N = 5 + N = 5 - p = Process(target=factorial, args=(queue, N)) - p.start() - p.join() + p = Process(target=factorial, args=(queue, N)) + p.start() + p.join() - result = queue.get() - print 'Factorial', N, '=', result + result = queue.get() + print 'Factorial', N, '=', result A :class:`Queue` is used to communicate the input parameter *N* and the result. The :class:`Queue` object is stored in a global variable. @@ -634,12 +634,12 @@ from multiprocessing import Pool def factorial(N, dictionary): - "Compute a factorial." - ... + "Compute a factorial." + ... p = Pool(5) result = p.map(factorial, range(1, 1000, 10)) for v in result: - print v + print v This produces the following output:: @@ -748,7 +748,7 @@ >>> import sys >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) Platform: darwin - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' >>> import mimetypes @@ -962,8 +962,8 @@ The primary use of :class:`bytes` in 2.6 will be to write tests of object type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, which can't tell whether 2.x code intends strings to -contain either characters or 8-bit bytes; you can now -use either :class:`bytes` or :class:`str` to represent your intention +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention exactly, and the resulting code will also be correct in Python 3.0. There's also a ``__future__`` import that causes all string literals @@ -1838,9 +1838,9 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) - The :func:`parse_qs` and :func:`parse_qsl` functions have been + The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated from the :mod:`cgi` module to the :mod:`urlparse` module. - The versions still available in the :mod:`cgi` module will + The versions still available in the :mod:`cgi` module will trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`). @@ -1889,9 +1889,9 @@ ('id', 'name', 'type', 'size') >>> var = var_type(1, 'frequency', 'int', 4) - >>> print var[0], var.id # Equivalent + >>> print var[0], var.id # Equivalent 1 1 - >>> print var[2], var.type # Equivalent + >>> print var[2], var.type # Equivalent int int >>> var._asdict() {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'} @@ -1935,7 +1935,7 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) - + :: # Boldface text starting at y=0,x=21 @@ -2050,8 +2050,8 @@ >>> list(itertools.product([1,2,3], [4,5,6])) [(1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6)] + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, @@ -2432,9 +2432,9 @@ :issue:`742598`, :issue:`1193577`.) * The :mod:`sqlite3` module, maintained by Gerhard Haering, - has been updated from version 2.3.2 in Python 2.5 to + has been updated from version 2.3.2 in Python 2.5 to version 2.4.1. - + * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type, using the format character ``'?'``. (Contributed by David Remahl.) @@ -2529,9 +2529,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module gained a number - of context managers useful for writing tests. - :func:`EnvironmentVarGuard` is a +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2546,7 +2546,7 @@ f = urllib.urlopen('https://sf.net') ... - Finally, :func:`check_warnings` resets the :mod:`warning` module's + Finally, :func:`check_warnings` resets the :mod:`warning` module's warning filters and returns an object that will record all warning messages triggered (:issue:`3781`):: @@ -2586,7 +2586,7 @@ :meth:`activeCount` method is renamed to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module support the same properties and renamed methods, but don't remove the old methods. No date has been set - for the deprecation of the old APIs in Python 3.x; the old APIs won't + for the deprecation of the old APIs in Python 3.x; the old APIs won't be removed in any 2.x version. (Carried out by several people, most notably Benjamin Peterson.) @@ -2643,7 +2643,7 @@ (Added by Facundo Batista.) * The Unicode database provided by the :mod:`unicodedata` module - has been updated to version 5.1.0. (Updated by + has been updated to version 5.1.0. (Updated by Martin von Loewis; :issue:`3811`.) * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` @@ -2654,7 +2654,7 @@ A new function, :func:`catch_warnings`, is a context manager intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). - + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` @@ -3217,6 +3217,9 @@ set ``__hash__ = None`` in their definitions to indicate the fact. +* String exceptions have been removed. Attempting to use them raises a + :exc:`TypeError`. + * The :meth:`__init__` method of :class:`collections.deque` now clears any existing contents of the deque before adding elements from the iterable. This change makes the @@ -3224,8 +3227,8 @@ * :meth:`object.__init__` previously accepted arbitrary arguments and keyword arguments, ignoring them. In Python 2.6, this is no longer - allowed and will result in a :exc:`TypeError`. This will affect - :meth:`__init__` methods that end up calling the corresponding + allowed and will result in a :exc:`TypeError`. This will affect + :meth:`__init__` methods that end up calling the corresponding method on :class:`object` (perhaps through using :func:`super`). See :issue:`1683368` for discussion. @@ -3285,7 +3288,7 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, -Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner. Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst Sun Jan 25 21:08:20 2009 @@ -60,6 +60,11 @@ .. ======================================================================== +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 ====================== @@ -103,7 +108,28 @@ :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. -* To be written. +* 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 + error, or raises a :exc:`CalledProcessError` exception otherwise. + + :: + + >>> subprocess.check_output(['df', '-h', '.']) + 'Filesystem Size Used Avail Capacity Mounted on\n + /dev/disk0s2 52G 49G 3.0G 94% /\n' + + >>> subprocess.check_output(['df', '-h', '/bogus']) + ... + subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1 + + (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`.) .. ====================================================================== .. whole new modules get described in subsections here @@ -116,13 +142,22 @@ Changes to Python's build process and to the C API include: -* To be written. +* 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`.) .. ====================================================================== Port-Specific Changes: Windows ----------------------------------- +* The :mod:`msvcrt` module now contains some constants from + the :file:`crtassem.h` header file: + :data:`CRT_ASSEMBLY_VERSION`, + :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`, + and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. + (Added by Martin von Loewis (XXX check); :issue:`4365`.) .. ====================================================================== Modified: python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New In Python 3.0 + What's New In Python 3.0 **************************** .. XXX Add trademark info for Apple, Microsoft. @@ -10,45 +10,45 @@ .. $Id$ Rules for maintenance: - + * Anyone can add text to this document. Do not spend very much time on the wording of your changes, because your text will probably get rewritten to some degree. - + * The maintainer will go through Misc/NEWS periodically and add changes; it's therefore more important to add your changes to Misc/NEWS than to this file. (Note: I didn't get to this for 3.0. GvR.) - + * This is not a complete list of every single change; completeness is the purpose of Misc/NEWS. Some changes I consider too small or esoteric to include. If such a change is added to the text, I'll just remove it. (This is another reason you shouldn't spend too much time on writing your addition.) - + * If you want to draw your new text to the attention of the maintainer, add 'XXX' to the beginning of the paragraph or section. - + * It's OK to just add a fragmentary note about a change. For example: "XXX Describe the transmogrify() function added to the socket module." The maintainer will research the change and write the necessary text. - + * You can comment out your additions if you like, but it's not necessary (especially when a final release is some months away). - + * Credit the author of a patch or bugfix. Just the name is sufficient; the e-mail address isn't necessary. (Due to time constraints I haven't managed to do this for 3.0. GvR.) - + * It's helpful to add the bug/patch number as a comment: - + % Patch 12345 XXX Describe the transmogrify() function added to the socket module. (Contributed by P.Y. Developer.) - + This saves the maintainer the effort of going through the SVN log when researching a change. (Again, I didn't get to this for 3.0. GvR.) @@ -819,7 +819,7 @@ need it; however, 99 percent of the time an explicit :keyword:`for` loop is more readable. -* Removed :func:`reload`. Use :func:`imp.reload`. +* Removed :func:`reload`. Use :func:`imp.reload`. * Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator instead. Modified: python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ **************************** - What's New In Python 3.1 + What's New In Python 3.1 **************************** .. XXX Add trademark info for Apple, Microsoft. @@ -10,45 +10,45 @@ .. $Id$ Rules for maintenance: - + * Anyone can add text to this document. Do not spend very much time on the wording of your changes, because your text will probably get rewritten to some degree. - + * The maintainer will go through Misc/NEWS periodically and add changes; it's therefore more important to add your changes to Misc/NEWS than to this file. (Note: I didn't get to this for 3.0. GvR.) - + * This is not a complete list of every single change; completeness is the purpose of Misc/NEWS. Some changes I consider too small or esoteric to include. If such a change is added to the text, I'll just remove it. (This is another reason you shouldn't spend too much time on writing your addition.) - + * If you want to draw your new text to the attention of the maintainer, add 'XXX' to the beginning of the paragraph or section. - + * It's OK to just add a fragmentary note about a change. For example: "XXX Describe the transmogrify() function added to the socket module." The maintainer will research the change and write the necessary text. - + * You can comment out your additions if you like, but it's not necessary (especially when a final release is some months away). - + * Credit the author of a patch or bugfix. Just the name is sufficient; the e-mail address isn't necessary. (Due to time constraints I haven't managed to do this for 3.0. GvR.) - + * It's helpful to add the bug/patch number as a comment: - + % Patch 12345 XXX Describe the transmogrify() function added to the socket module. (Contributed by P.Y. Developer.) - + This saves the maintainer the effort of going through the SVN log when researching a change. (Again, I didn't get to this for 3.0. GvR.) Modified: python/branches/py3k-issue1717/Include/abstract.h ============================================================================== --- python/branches/py3k-issue1717/Include/abstract.h (original) +++ python/branches/py3k-issue1717/Include/abstract.h Sun Jan 25 21:08:20 2009 @@ -589,7 +589,8 @@ is an iterator, this returns itself. */ #define PyIter_Check(obj) \ - ((obj)->ob_type->tp_iternext != NULL) + ((obj)->ob_type->tp_iternext != NULL && \ + (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *); /* Takes an iterator object and calls its tp_iternext slot, @@ -785,20 +786,14 @@ #define PyNumber_Int PyNumber_Long + PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); + /* Returns the o converted to an integer object on success, or NULL on failure. This is the equivalent of the Python expression: int(o). */ - PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); - - /* - Returns the o converted to a long integer object on success, - or NULL on failure. This is the equivalent of the Python - expression: long(o). - */ - PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o); /* Modified: python/branches/py3k-issue1717/Include/longobject.h ============================================================================== --- python/branches/py3k-issue1717/Include/longobject.h (original) +++ python/branches/py3k-issue1717/Include/longobject.h Sun Jan 25 21:08:20 2009 @@ -41,7 +41,7 @@ #endif /* For use by intobject.c only */ -PyAPI_DATA(int) _PyLong_DigitValue[256]; +PyAPI_DATA(unsigned char) _PyLong_DigitValue[256]; /* _PyLong_AsScaledDouble returns a double x and an exponent e such that the true value is approximately equal to x * 2**(SHIFT*e). e is >= 0. Modified: python/branches/py3k-issue1717/Include/memoryobject.h ============================================================================== --- python/branches/py3k-issue1717/Include/memoryobject.h (original) +++ python/branches/py3k-issue1717/Include/memoryobject.h Sun Jan 25 21:08:20 2009 @@ -20,53 +20,53 @@ int buffertype, char fort); - /* Return a contiguous chunk of memory representing the buffer - from an object in a memory view object. If a copy is made then the - base object for the memory view will be a *new* bytes object. - - Otherwise, the base-object will be the object itself and no - data-copying will be done. - - The buffertype argument can be PyBUF_READ, PyBUF_WRITE, - PyBUF_SHADOW to determine whether the returned buffer - should be READONLY, WRITABLE, or set to update the - original buffer if a copy must be made. If buffertype is - PyBUF_WRITE and the buffer is not contiguous an error will - be raised. In this circumstance, the user can use - PyBUF_SHADOW to ensure that a a writable temporary - contiguous buffer is returned. The contents of this - contiguous buffer will be copied back into the original - object after the memoryview object is deleted as long as - the original object is writable and allows setting an - exclusive write lock. If this is not allowed by the - original object, then a BufferError is raised. - - If the object is multi-dimensional and if fortran is 'F', - the first dimension of the underlying array will vary the - fastest in the buffer. If fortran is 'C', then the last - dimension will vary the fastest (C-style contiguous). If - fortran is 'A', then it does not matter and you will get - whatever the object decides is more efficient. + /* Return a contiguous chunk of memory representing the buffer + from an object in a memory view object. If a copy is made then the + base object for the memory view will be a *new* bytes object. + + Otherwise, the base-object will be the object itself and no + data-copying will be done. + + The buffertype argument can be PyBUF_READ, PyBUF_WRITE, + PyBUF_SHADOW to determine whether the returned buffer + should be READONLY, WRITABLE, or set to update the + original buffer if a copy must be made. If buffertype is + PyBUF_WRITE and the buffer is not contiguous an error will + be raised. In this circumstance, the user can use + PyBUF_SHADOW to ensure that a a writable temporary + contiguous buffer is returned. The contents of this + contiguous buffer will be copied back into the original + object after the memoryview object is deleted as long as + the original object is writable and allows setting an + exclusive write lock. If this is not allowed by the + original object, then a BufferError is raised. + + If the object is multi-dimensional and if fortran is 'F', + the first dimension of the underlying array will vary the + fastest in the buffer. If fortran is 'C', then the last + dimension will vary the fastest (C-style contiguous). If + fortran is 'A', then it does not matter and you will get + whatever the object decides is more efficient. - A new reference is returned that must be DECREF'd when finished. - */ + A new reference is returned that must be DECREF'd when finished. + */ PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info); - /* create new if bufptr is NULL - will be a new bytesobject in base */ + /* create new if bufptr is NULL + will be a new bytesobject in base */ + - /* The struct is declared here so that macros can work, but it shouldn't be considered public. Don't access those fields directly, use the macros and functions instead! */ typedef struct { - PyObject_HEAD - PyObject *base; - Py_buffer view; + PyObject_HEAD + PyObject *base; + Py_buffer view; } PyMemoryViewObject; - + #ifdef __cplusplus } Modified: python/branches/py3k-issue1717/Include/object.h ============================================================================== --- python/branches/py3k-issue1717/Include/object.h (original) +++ python/branches/py3k-issue1717/Include/object.h Sun Jan 25 21:08:20 2009 @@ -144,16 +144,18 @@ typedef struct bufferinfo { void *buf; PyObject *obj; /* owned reference */ - Py_ssize_t len; - Py_ssize_t itemsize; /* This is Py_ssize_t so it can be - pointed to by strides in simple case.*/ - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + Py_ssize_t len; + Py_ssize_t itemsize; /* This is Py_ssize_t so it can be + pointed to by strides in simple case.*/ + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + Py_ssize_t smalltable[2]; /* static store for shape and strides of + mono-dimensional buffers. */ + void *internal; } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); @@ -217,7 +219,7 @@ binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; - unaryfunc nb_long; + void *nb_reserved; /* the slot formerly known as nb_long */ unaryfunc nb_float; binaryfunc nb_inplace_add; @@ -433,6 +435,7 @@ PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); Modified: python/branches/py3k-issue1717/Include/pydebug.h ============================================================================== --- python/branches/py3k-issue1717/Include/pydebug.h (original) +++ python/branches/py3k-issue1717/Include/pydebug.h Sun Jan 25 21:08:20 2009 @@ -18,6 +18,7 @@ PyAPI_DATA(int) Py_DivisionWarningFlag; PyAPI_DATA(int) Py_DontWriteBytecodeFlag; PyAPI_DATA(int) Py_NoUserSiteDirectory; +PyAPI_DATA(int) Py_UnbufferedStdioFlag; /* this is a wrapper around getenv() that pays attention to Py_IgnoreEnvironmentFlag. It should be used for getting variables like Modified: python/branches/py3k-issue1717/Include/pyerrors.h ============================================================================== --- python/branches/py3k-issue1717/Include/pyerrors.h (original) +++ python/branches/py3k-issue1717/Include/pyerrors.h Sun Jan 25 21:08:20 2009 @@ -144,7 +144,6 @@ PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError; PyAPI_DATA(PyObject *) PyExc_ValueError; PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError; -PyAPI_DATA(PyObject *) PyExc_BufferError; #ifdef MS_WINDOWS PyAPI_DATA(PyObject *) PyExc_WindowsError; #endif Modified: python/branches/py3k-issue1717/Include/pymath.h ============================================================================== --- python/branches/py3k-issue1717/Include/pymath.h (original) +++ python/branches/py3k-issue1717/Include/pymath.h Sun Jan 25 21:08:20 2009 @@ -87,7 +87,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_ISNAN +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -104,7 +104,7 @@ * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_ISINF +#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)) @@ -118,7 +118,9 @@ * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE -#ifdef HAVE_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) Modified: python/branches/py3k-issue1717/Include/pyport.h ============================================================================== --- python/branches/py3k-issue1717/Include/pyport.h (original) +++ python/branches/py3k-issue1717/Include/pyport.h Sun Jan 25 21:08:20 2009 @@ -616,6 +616,15 @@ #define Py_FORMAT_PARSETUPLE(func,p1,p2) #endif +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ Modified: python/branches/py3k-issue1717/Include/unicodeobject.h ============================================================================== --- python/branches/py3k-issue1717/Include/unicodeobject.h (original) +++ python/branches/py3k-issue1717/Include/unicodeobject.h Sun Jan 25 21:08:20 2009 @@ -126,6 +126,10 @@ typedef unsigned long Py_UCS4; #endif +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + typedef PY_UNICODE_TYPE Py_UNICODE; /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ @@ -369,12 +373,12 @@ #else -/* Since splitting on whitespace is an important use case, and whitespace - in most situations is solely ASCII whitespace, we optimize for the common - case by using a quick look-up table with an inlined check. - */ -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + */ #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) @@ -409,13 +413,14 @@ #define Py_UNICODE_COPY(target, source, length) \ Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) -#define Py_UNICODE_FILL(target, value, length) do\ - {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) -/* check if substring matches at given offset. the offset must be +/* Check if substring matches at given offset. the offset must be valid, and the substring must not be empty */ + #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->str + (offset)) == *((substring)->str)) && \ ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ @@ -425,8 +430,6 @@ extern "C" { #endif -PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); - /* --- Unicode Type ------------------------------------------------------- */ typedef struct { @@ -641,6 +644,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These @@ -1477,6 +1491,10 @@ /* === Characters Type APIs =============================================== */ +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. Modified: python/branches/py3k-issue1717/LICENSE ============================================================================== --- python/branches/py3k-issue1717/LICENSE (original) +++ python/branches/py3k-issue1717/LICENSE Sun Jan 25 21:08:20 2009 @@ -89,15 +89,14 @@ otherwise using this software ("Python") in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative -version prepared by Licensee. +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python +Software Foundation; All Rights Reserved" are retained in Python alone or in any +derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/branches/py3k-issue1717/Lib/_abcoll.py ============================================================================== --- python/branches/py3k-issue1717/Lib/_abcoll.py (original) +++ python/branches/py3k-issue1717/Lib/_abcoll.py Sun Jan 25 21:08:20 2009 @@ -283,12 +283,12 @@ @abstractmethod def add(self, value): - """Return True if it was added, False if already there.""" + """Add an element.""" raise NotImplementedError @abstractmethod def discard(self, value): - """Return True if it was deleted, False if not there.""" + """Remove an element. Do not raise an exception if absent.""" raise NotImplementedError def remove(self, value): Modified: python/branches/py3k-issue1717/Lib/ast.py ============================================================================== --- python/branches/py3k-issue1717/Lib/ast.py (original) +++ python/branches/py3k-issue1717/Lib/ast.py Sun Jan 25 21:08:20 2009 @@ -64,6 +64,18 @@ elif isinstance(node, Name): if node.id in _safe_names: return _safe_names[node.id] + elif isinstance(node, BinOp) and \ + isinstance(node.op, (Add, Sub)) and \ + isinstance(node.right, Num) and \ + isinstance(node.right.n, complex) and \ + isinstance(node.left, Num) and \ + isinstance(node.left.n, (int, float)): + left = node.left.n + right = node.right.n + if isinstance(node.op, Add): + return left + right + else: + return left - right raise ValueError('malformed string') return _convert(node_or_string) Modified: python/branches/py3k-issue1717/Lib/collections.py ============================================================================== --- python/branches/py3k-issue1717/Lib/collections.py (original) +++ python/branches/py3k-issue1717/Lib/collections.py Sun Jan 25 21:08:20 2009 @@ -1,5 +1,5 @@ __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', - 'UserString'] + 'UserString', 'Counter'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * @@ -10,6 +10,9 @@ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys +import heapq as _heapq +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap + ################################################################################ ### namedtuple @@ -113,6 +116,248 @@ return result +######################################################################## +### Counter +######################################################################## + +class Counter(dict): + '''Dict subclass for counting hashable items. Sometimes called a bag + or multiset. Elements are stored as dictionary keys and their counts + are stored as dictionary values. + + >>> c = Counter('abracadabra') # count elements from a string + + >>> c.most_common(3) # three most common elements + [('a', 5), ('r', 2), ('b', 2)] + >>> sorted(c) # list all unique elements + ['a', 'b', 'c', 'd', 'r'] + >>> ''.join(sorted(c.elements())) # list elements with repetitions + 'aaaaabbcdrr' + >>> sum(c.values()) # total of all counts + 11 + + >>> c['a'] # count of letter 'a' + 5 + >>> for elem in 'shazam': # update counts from an iterable + ... c[elem] += 1 # by adding 1 to each element's count + >>> c['a'] # now there are seven 'a' + 7 + >>> del c['r'] # remove all 'r' + >>> c['r'] # now there are zero 'r' + 0 + + >>> d = Counter('simsalabim') # make another counter + >>> c.update(d) # add in the second counter + >>> c['a'] # now there are nine 'a' + 9 + + >>> c.clear() # empty the counter + >>> c + Counter() + + Note: If a count is set to zero or reduced to zero, it will remain + in the counter until the entry is deleted or the counter is cleared: + + >>> c = Counter('aaabbc') + >>> c['b'] -= 2 # reduce the count of 'b' by two + >>> c.most_common() # 'b' is still in, but its count is zero + [('a', 3), ('c', 1), ('b', 0)] + + ''' + # References: + # http://en.wikipedia.org/wiki/Multiset + # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html + # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm + # http://code.activestate.com/recipes/259174/ + # Knuth, TAOCP Vol. II section 4.6.3 + + def __init__(self, iterable=None, **kwds): + '''Create a new, empty Counter object. And if given, count elements + from an input iterable. Or, initialize the count from another mapping + of elements to their counts. + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + >>> c = Counter(a=4, b=2) # a new counter from keyword args + + ''' + self.update(iterable, **kwds) + + def __missing__(self, key): + 'The count of elements not in the Counter is zero.' + # Needed so that self[missing_item] does not raise KeyError + return 0 + + def most_common(self, n=None): + '''List the n most common elements and their counts from the most + common to the least. If n is None, then list all element counts. + + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('r', 2), ('b', 2)] + + ''' + # Emulate Bag.sortedByCount from Smalltalk + if n is None: + return sorted(self.items(), key=_itemgetter(1), reverse=True) + return _heapq.nlargest(n, self.items(), key=_itemgetter(1)) + + def elements(self): + '''Iterator over elements repeating each as many times as its count. + + >>> c = Counter('ABCABC') + >>> sorted(c.elements()) + ['A', 'A', 'B', 'B', 'C', 'C'] + + # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 + >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) + >>> product = 1 + >>> for factor in prime_factors.elements(): # loop over factors + ... product *= factor # and multiply them + >>> product + 1836 + + Note, if an element's count has been set to zero or is a negative + number, elements() will ignore it. + + ''' + # Emulate Bag.do from Smalltalk and Multiset.begin from C++. + return _chain.from_iterable(_starmap(_repeat, self.items())) + + # Override dict methods where necessary + + @classmethod + def fromkeys(cls, iterable, v=None): + # There is no equivalent method for counters because setting v=1 + # means that no element can have a count greater than one. + raise NotImplementedError( + 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') + + def update(self, iterable=None, **kwds): + '''Like dict.update() but add counts instead of replacing them. + + Source can be an iterable, a dictionary, or another Counter instance. + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + + ''' + # The regular dict.update() operation makes no sense here because the + # replace behavior results in the some of original untouched counts + # being mixed-in with all of the other counts for a mismash that + # doesn't have a straight-forward interpretation in most counting + # contexts. Instead, we implement straight-addition. Both the inputs + # and outputs are allowed to contain zero and negative counts. + + if iterable is not None: + if isinstance(iterable, Mapping): + if self: + for elem, count in iterable.items(): + self[elem] += count + else: + dict.update(self, iterable) # fast path when counter is empty + else: + for elem in iterable: + self[elem] += 1 + if kwds: + self.update(kwds) + + def copy(self): + 'Like dict.copy() but returns a Counter instance instead of a dict.' + return Counter(self) + + def __delitem__(self, elem): + 'Like dict.__delitem__() but does not raise KeyError for missing values.' + if elem in self: + dict.__delitem__(self, elem) + + def __repr__(self): + if not self: + return '%s()' % self.__class__.__name__ + items = ', '.join(map('%r: %r'.__mod__, self.most_common())) + return '%s({%s})' % (self.__class__.__name__, items) + + # Multiset-style mathematical operations discussed in: + # Knuth TAOCP Volume II section 4.6.3 exercise 19 + # and at http://en.wikipedia.org/wiki/Multiset + # + # Outputs guaranteed to only include positive counts. + # + # To strip negative and zero counts, add-in an empty counter: + # c += Counter() + + def __add__(self, other): + '''Add counts from two counters. + + >>> Counter('abbb') + Counter('bcc') + Counter({'b': 4, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem in set(self) | set(other): + newcount = self[elem] + other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __sub__(self, other): + ''' Subtract count, but keep only results with positive counts. + + >>> Counter('abbbc') - Counter('bccd') + Counter({'b': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem in set(self) | set(other): + newcount = self[elem] - other[elem] + if newcount > 0: + result[elem] = newcount + return result + + def __or__(self, other): + '''Union is the maximum of value in either of the input counters. + + >>> Counter('abbb') | Counter('bcc') + Counter({'b': 3, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _max = max + result = Counter() + for elem in set(self) | set(other): + newcount = _max(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + + def __and__(self, other): + ''' Intersection is the minimum of corresponding counts. + + >>> Counter('abbb') & Counter('bcc') + Counter({'b': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + _min = min + result = Counter() + if len(self) < len(other): + self, other = other, self + for elem in filter(self.__contains__, other): + newcount = _min(self[elem], other[elem]) + if newcount > 0: + result[elem] = newcount + return result + ################################################################################ ### UserDict @@ -253,7 +498,6 @@ def __str__(self): return str(self.data) def __repr__(self): return repr(self.data) def __int__(self): return int(self.data) - def __long__(self): return int(self.data) def __float__(self): return float(self.data) def __complex__(self): return complex(self.data) def __hash__(self): return hash(self.data) Modified: python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py ============================================================================== --- python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py (original) +++ python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py Sun Jan 25 21:08:20 2009 @@ -67,9 +67,6 @@ if verbosity > 1: print("Skipped %s: %s" % (modname, detail), file=sys.stderr) continue - except Exception as detail: - print("Warning: could not import %s: %s" % (modname, detail), file=sys.stderr) - continue for name in dir(mod): if name.startswith("_"): continue Modified: python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py ============================================================================== --- python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py (original) +++ python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py Sun Jan 25 21:08:20 2009 @@ -25,7 +25,10 @@ v = memoryview(ob) try: self.failUnlessEqual(normalize(v.format), normalize(fmt)) - self.failUnlessEqual(len(v), sizeof(ob)) + if shape is not None: + self.failUnlessEqual(len(v), shape[0]) + else: + self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block @@ -37,7 +40,7 @@ n = 1 for dim in v.shape: n = n * dim - self.failUnlessEqual(v.itemsize * n, len(v)) + self.failUnlessEqual(n * v.itemsize, len(v.tobytes())) except: # so that we can see the failing type print(tp) @@ -49,7 +52,10 @@ v = memoryview(ob) try: self.failUnlessEqual(v.format, fmt) - self.failUnlessEqual(len(v), sizeof(ob)) + if shape is not None: + self.failUnlessEqual(len(v), shape[0]) + else: + self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.failUnlessEqual(v.itemsize, sizeof(itemtp)) self.failUnlessEqual(v.shape, shape) # ctypes object always have a non-strided memory block @@ -61,7 +67,7 @@ n = 1 for dim in v.shape: n = n * dim - self.failUnlessEqual(v.itemsize * n, len(v)) + self.failUnlessEqual(n, len(v)) except: # so that we can see the failing type print(tp) Modified: python/branches/py3k-issue1717/Lib/ctypes/util.py ============================================================================== --- python/branches/py3k-issue1717/Lib/ctypes/util.py (original) +++ python/branches/py3k-issue1717/Lib/ctypes/util.py Sun Jan 25 21:08:20 2009 @@ -89,20 +89,22 @@ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) - cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ + cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) try: trace = f.read() finally: - f.close() + rv = f.close() finally: try: os.unlink(ccout) except OSError as e: if e.errno != errno.ENOENT: raise + if rv == 10: + raise OSError('gcc or cc command not found') res = re.search(expr, trace) if not res: return None @@ -129,7 +131,13 @@ # assuming GNU binutils / ELF if not f: return None - cmd = "objdump -p -j .dynamic 2>/dev/null " + f + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ + "objdump -p -j .dynamic 2>/dev/null " + f + f = os.popen(cmd) + dump = f.read() + rv = f.close() + if rv == 10: + raise OSError('objdump command not found') f = os.popen(cmd) try: data = f.read() @@ -193,8 +201,32 @@ return None return res.group(0) + def _findSoname_ldconfig(name): + import struct + if struct.calcsize('l') == 4: + machine = os.uname()[4] + '-32' + else: + machine = os.uname()[4] + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', + } + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) + expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ + % (abi_type, re.escape(name)) + res = re.search(expr, + os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + if not res: + return None + return res.group(1) + def find_library(name): - return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name)) + return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code Modified: python/branches/py3k-issue1717/Lib/decimal.py ============================================================================== --- python/branches/py3k-issue1717/Lib/decimal.py (original) +++ python/branches/py3k-issue1717/Lib/decimal.py Sun Jan 25 21:08:20 2009 @@ -134,8 +134,8 @@ 'setcontext', 'getcontext', 'localcontext' ] -import numbers as _numbers import copy as _copy +import math as _math try: from collections import namedtuple as _namedtuple @@ -217,7 +217,7 @@ if args: ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) return ans._fix_nan(context) - return NaN + return _NaN class ConversionSyntax(InvalidOperation): """Trying to convert badly formed string. @@ -227,7 +227,7 @@ syntax. The result is [0,qNaN]. """ def handle(self, context, *args): - return NaN + return _NaN class DivisionByZero(DecimalException, ZeroDivisionError): """Division by 0. @@ -243,7 +243,7 @@ """ def handle(self, context, sign, *args): - return Infsign[sign] + return _SignedInfinity[sign] class DivisionImpossible(InvalidOperation): """Cannot perform the division adequately. @@ -254,7 +254,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class DivisionUndefined(InvalidOperation, ZeroDivisionError): """Undefined result of division. @@ -265,7 +265,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Inexact(DecimalException): """Had to round, losing information. @@ -291,7 +291,7 @@ """ def handle(self, context, *args): - return NaN + return _NaN class Rounded(DecimalException): """Number got rounded (not necessarily changed during rounding). @@ -341,15 +341,15 @@ def handle(self, context, sign, *args): if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_HALF_DOWN, ROUND_UP): - return Infsign[sign] + return _SignedInfinity[sign] if sign == 0: if context.rounding == ROUND_CEILING: - return Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) if sign == 1: if context.rounding == ROUND_FLOOR: - return Infsign[sign] + return _SignedInfinity[sign] return _dec_from_triple(sign, '9'*context.prec, context.Emax-context.prec+1) @@ -500,7 +500,11 @@ ##### Decimal class ####################################################### -class 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(object): """Floating point class for decimal arithmetic.""" __slots__ = ('_exp','_int','_sign', '_is_special') @@ -654,6 +658,46 @@ raise TypeError("Cannot convert %r to Decimal" % value) + # @classmethod, but @decorator is not valid Python 2.3 syntax, so + # don't use it (see notes on Py2.3 compatibility at top of file) + def from_float(cls, f): + """Converts a float to a decimal number, exactly. + + Note that Decimal.from_float(0.1) is not the same as Decimal('0.1'). + Since 0.1 is not exactly representable in binary floating point, the + value is stored as the nearest representable value which is + 0x1.999999999999ap-4. The exact equivalent of the value in decimal + is 0.1000000000000000055511151231257827021181583404541015625. + + >>> Decimal.from_float(0.1) + Decimal('0.1000000000000000055511151231257827021181583404541015625') + >>> Decimal.from_float(float('nan')) + Decimal('NaN') + >>> Decimal.from_float(float('inf')) + Decimal('Infinity') + >>> Decimal.from_float(-float('inf')) + Decimal('-Infinity') + >>> Decimal.from_float(-0.0) + Decimal('-0') + + """ + if isinstance(f, int): # handle integer inputs + return cls(f) + if _math.isinf(f) or _math.isnan(f): # raises TypeError if not a float + return cls(repr(f)) + if _math.copysign(1.0, f) == 1.0: + sign = 0 + else: + sign = 1 + n, d = abs(f).as_integer_ratio() + k = d.bit_length() - 1 + result = _dec_from_triple(sign, str(n*5**k), -k) + if cls is Decimal: + return result + else: + return cls(result) + from_float = classmethod(from_float) + def _isnan(self): """Returns whether the number is not actually one. @@ -770,7 +814,7 @@ else: return 1 - # check for zeros; note that _cmp(0, -0) should return 0 + # check for zeros; Decimal('0') == Decimal('-0') if not self: if not other: return 0 @@ -793,7 +837,7 @@ if self_padded == other_padded: return 0 elif self_padded < other_padded: - return -((-1)**self._sign) + return -(-1)**self._sign else: return (-1)**self._sign elif self_adjusted > other_adjusted: @@ -1185,12 +1229,12 @@ if self._isinfinity(): if not other: return context._raise_error(InvalidOperation, '(+-)INF * 0') - return Infsign[resultsign] + return _SignedInfinity[resultsign] if other._isinfinity(): if not self: return context._raise_error(InvalidOperation, '0 * (+-)INF') - return Infsign[resultsign] + return _SignedInfinity[resultsign] resultexp = self._exp + other._exp @@ -1240,7 +1284,7 @@ return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF') if self._isinfinity(): - return Infsign[sign] + return _SignedInfinity[sign] if other._isinfinity(): context._raise_error(Clamped, 'Division by infinity') @@ -1340,7 +1384,7 @@ ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)') return ans, ans else: - return (Infsign[sign], + return (_SignedInfinity[sign], context._raise_error(InvalidOperation, 'INF % x')) if not other: @@ -1488,7 +1532,7 @@ if other._isinfinity(): return context._raise_error(InvalidOperation, 'INF // INF') else: - return Infsign[self._sign ^ other._sign] + return _SignedInfinity[self._sign ^ other._sign] if not other: if self: @@ -1526,13 +1570,13 @@ __trunc__ = __int__ - @property def real(self): return self + real = property(real) - @property def imag(self): return Decimal(0) + imag = property(imag) def conjugate(self): return self @@ -1728,14 +1772,10 @@ >>> round(Decimal('Inf')) Traceback (most recent call last): ... - ... - ... OverflowError: cannot round an infinity >>> round(Decimal('NaN')) Traceback (most recent call last): ... - ... - ... ValueError: cannot round a NaN If a second argument n is supplied, self is rounded to n @@ -1832,12 +1872,12 @@ if not other: return context._raise_error(InvalidOperation, 'INF * 0 in fma') - product = Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] elif other._exp == 'F': if not self: return context._raise_error(InvalidOperation, '0 * INF in fma') - product = Infsign[self._sign ^ other._sign] + product = _SignedInfinity[self._sign ^ other._sign] else: product = _dec_from_triple(self._sign ^ other._sign, str(int(self._int) * int(other._int)), @@ -2187,7 +2227,7 @@ if not self: return context._raise_error(InvalidOperation, '0 ** 0') else: - return Dec_p1 + return _One # result has sign 1 iff self._sign is 1 and other is an odd integer result_sign = 0 @@ -2209,19 +2249,19 @@ if other._sign == 0: return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _SignedInfinity[result_sign] # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0 if self._isinfinity(): if other._sign == 0: - return Infsign[result_sign] + return _SignedInfinity[result_sign] else: return _dec_from_triple(result_sign, '0', 0) # 1**other = 1, but the choice of exponent and the flags # depend on the exponent of self, and on whether other is a # positive integer, a negative integer, or neither - if self == Dec_p1: + if self == _One: if other._isinteger(): # exp = max(self._exp*max(int(other), 0), # 1-context.prec) but evaluating int(other) directly @@ -2254,7 +2294,7 @@ if (other._sign == 0) == (self_adj < 0): return _dec_from_triple(result_sign, '0', 0) else: - return Infsign[result_sign] + return _SignedInfinity[result_sign] # from here on, the result always goes through the call # to _fix at the end of this function. @@ -2774,9 +2814,9 @@ """ # if one is negative and the other is positive, it's easy if self._sign and not other._sign: - return Dec_n1 + return _NegativeOne if not self._sign and other._sign: - return Dec_p1 + return _One sign = self._sign # let's handle both NaN types @@ -2786,51 +2826,51 @@ if self_nan == other_nan: if self._int < other._int: if sign: - return Dec_p1 + return _One else: - return Dec_n1 + return _NegativeOne if self._int > other._int: if sign: - return Dec_n1 + return _NegativeOne else: - return Dec_p1 - return Dec_0 + return _One + return _Zero if sign: if self_nan == 1: - return Dec_n1 + return _NegativeOne if other_nan == 1: - return Dec_p1 + return _One if self_nan == 2: - return Dec_n1 + return _NegativeOne if other_nan == 2: - return Dec_p1 + return _One else: if self_nan == 1: - return Dec_p1 + return _One if other_nan == 1: - return Dec_n1 + return _NegativeOne if self_nan == 2: - return Dec_p1 + return _One if other_nan == 2: - return Dec_n1 + return _NegativeOne if self < other: - return Dec_n1 + return _NegativeOne if self > other: - return Dec_p1 + return _One if self._exp < other._exp: if sign: - return Dec_p1 + return _One else: - return Dec_n1 + return _NegativeOne if self._exp > other._exp: if sign: - return Dec_n1 + return _NegativeOne else: - return Dec_p1 - return Dec_0 + return _One + return _Zero def compare_total_mag(self, other): @@ -2871,11 +2911,11 @@ # exp(-Infinity) = 0 if self._isinfinity() == -1: - return Dec_0 + return _Zero # exp(0) = 1 if not self: - return Dec_p1 + return _One # exp(Infinity) = Infinity if self._isinfinity() == 1: @@ -3027,15 +3067,15 @@ # ln(0.0) == -Infinity if not self: - return negInf + return _NegativeInfinity # ln(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Infinity # ln(1.0) == 0.0 - if self == Dec_p1: - return Dec_0 + if self == _One: + return _Zero # ln(negative) raises InvalidOperation if self._sign == 1: @@ -3107,11 +3147,11 @@ # log10(0.0) == -Infinity if not self: - return negInf + return _NegativeInfinity # log10(Infinity) = Infinity if self._isinfinity() == 1: - return Inf + return _Infinity # log10(negative or -Infinity) raises InvalidOperation if self._sign == 1: @@ -3163,7 +3203,7 @@ # logb(+/-Inf) = +Inf if self._isinfinity(): - return Inf + return _Infinity # logb(0) = -Inf, DivisionByZero if not self: @@ -3233,7 +3273,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def logical_xor(self, other, context=None): @@ -3247,7 +3287,7 @@ (opa, opb) = self._fill_logical(context, self._int, other._int) # make the operation, and clean starting zeroes - result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb)) + result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)]) return _dec_from_triple(0, result.lstrip('0') or '0', 0) def max_mag(self, other, context=None): @@ -3320,7 +3360,7 @@ return ans if self._isinfinity() == -1: - return negInf + return _NegativeInfinity if self._isinfinity() == 1: return _dec_from_triple(0, '9'*context.prec, context.Etop()) @@ -3343,7 +3383,7 @@ return ans if self._isinfinity() == 1: - return Inf + return _Infinity if self._isinfinity() == -1: return _dec_from_triple(1, '9'*context.prec, context.Etop()) @@ -3842,6 +3882,23 @@ "diagnostic info too long in NaN") return d._fix(self) + def create_decimal_from_float(self, f): + """Creates a new Decimal instance from a float but rounding using self + as the context. + + >>> context = Context(prec=5, rounding=ROUND_DOWN) + >>> context.create_decimal_from_float(3.1415926535897932) + Decimal('3.1415') + >>> context = Context(prec=5, traps=[Inexact]) + >>> context.create_decimal_from_float(3.1415926535897932) + Traceback (most recent call last): + ... + decimal.Inexact: None + + """ + d = Decimal.from_float(f) # An exact conversion + return d._fix(self) # Apply the context rounding + # Methods def abs(self, a): """Returns the absolute value of the operand. @@ -5584,15 +5641,15 @@ ##### Useful Constants (internal use only) ################################ # Reusable defaults -Inf = Decimal('Inf') -negInf = Decimal('-Inf') -NaN = Decimal('NaN') -Dec_0 = Decimal(0) -Dec_p1 = Decimal(1) -Dec_n1 = Decimal(-1) +_Infinity = Decimal('Inf') +_NegativeInfinity = Decimal('-Inf') +_NaN = Decimal('NaN') +_Zero = Decimal(0) +_One = Decimal(1) +_NegativeOne = Decimal(-1) -# Infsign[sign] is infinity w/ that sign -Infsign = (Inf, negInf) +# _SignedInfinity[sign] is infinity w/ that sign +_SignedInfinity = (_Infinity, _NegativeInfinity) Modified: python/branches/py3k-issue1717/Lib/distutils/command/register.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/command/register.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/command/register.py Sun Jan 25 21:08:20 2009 @@ -174,19 +174,23 @@ log.INFO) # possibly save the login - if not self.has_config and code == 200: - self.announce(('I can store your PyPI login so future ' - 'submissions will be faster.'), log.INFO) - self.announce('(the login will be stored in %s)' % \ - self._get_rc_file(), log.INFO) - - choice = 'X' - while choice.lower() not in 'yn': - choice = input('Save your login (y/N)?') - if not choice: - choice = 'n' - if choice.lower() == 'y': - self._store_pypirc(username, password) + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} Modified: python/branches/py3k-issue1717/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/command/sdist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/command/sdist.py Sun Jan 25 21:08:20 2009 @@ -4,7 +4,10 @@ __revision__ = "$Id$" -import sys, os +import os +import string +import sys +from types import * from glob import glob from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util @@ -332,9 +335,18 @@ self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) - self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1) - def write_manifest(self): + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) + + def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. Modified: python/branches/py3k-issue1717/Lib/distutils/command/upload.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/command/upload.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/command/upload.py Sun Jan 25 21:08:20 2009 @@ -48,6 +48,11 @@ self.repository = config['repository'] self.realm = config['realm'] + # getting the password from the distribution + # if previously set by the register command + if not self.password and self.distribution.password: + self.password = self.distribution.password + def run(self): if not self.distribution.dist_files: raise DistutilsOptionError("No dist file created in earlier command") Modified: python/branches/py3k-issue1717/Lib/distutils/config.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/config.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/config.py Sun Jan 25 21:08:20 2009 @@ -82,12 +82,12 @@ for server in _servers: current = {'server': server} current['username'] = config.get(server, 'username') - current['password'] = config.get(server, 'password') # optional params for key, default in (('repository', self.DEFAULT_REPOSITORY), - ('realm', self.DEFAULT_REALM)): + ('realm', self.DEFAULT_REALM), + ('password', None)): if config.has_option(server, key): current[key] = config.get(server, key) else: Modified: python/branches/py3k-issue1717/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/dist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/dist.py Sun Jan 25 21:08:20 2009 @@ -199,6 +199,7 @@ self.extra_path = None self.scripts = None self.data_files = None + self.password = '' # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py Sun Jan 25 21:08:20 2009 @@ -13,6 +13,10 @@ if sys.platform != 'win32': # this test is only for win32 return + from distutils.msvccompiler import get_build_version + if get_build_version() < 8.0: + # this test is only for MSVC8.0 or above + return from distutils.msvc9compiler import query_vcvarsall def _find_vcvarsall(version): return None Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py Sun Jan 25 21:08:20 2009 @@ -2,6 +2,7 @@ import sys import os import unittest +import getpass from distutils.command.register import register from distutils.core import Distribution @@ -9,7 +10,27 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase -class RawInputs(object): +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + +WANTED_PYPIRC = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:password +""" + +class Inputs(object): """Fakes user inputs.""" def __init__(self, *answers): self.answers = answers @@ -21,18 +42,33 @@ finally: self.index += 1 -WANTED_PYPIRC = """\ -[distutils] -index-servers = - pypi - -[pypi] -username:tarek -password:xxx -""" +class FakeServer(object): + """Fakes a PyPI server""" + def __init__(self): + self.calls = [] + + def __call__(self, *args): + # we want to compare them, so let's store + # something comparable + els = list(args[0].items()) + els.sort() + self.calls.append(tuple(els)) + return 200, 'OK' class registerTestCase(PyPIRCCommandTestCase): + def setUp(self): + PyPIRCCommandTestCase.setUp(self) + # patching the password prompt + self._old_getpass = getpass.getpass + def _getpass(prompt): + return 'password' + getpass.getpass = _getpass + + def tearDown(self): + getpass.getpass = self._old_getpass + PyPIRCCommandTestCase.tearDown(self) + def test_create_pypirc(self): # this test makes sure a .pypirc file # is created when requested. @@ -50,30 +86,17 @@ # we shouldn't have a .pypirc file yet self.assert_(not os.path.exists(self.rc)) - # patching raw_input and getpass.getpass + # patching input and getpass.getpass # so register gets happy # # Here's what we are faking : # use your existing login (choice 1.) # Username : 'tarek' - # Password : 'xxx' + # Password : 'password' # Save your login (y/N)? : 'y' - inputs = RawInputs('1', 'tarek', 'y') + inputs = Inputs('1', 'tarek', 'y') from distutils.command import register as register_module register_module.input = inputs.__call__ - def _getpass(prompt): - return 'xxx' - register_module.getpass.getpass = _getpass - class FakeServer(object): - def __init__(self): - self.calls = [] - - def __call__(self, *args): - # we want to compare them, so let's store - # something comparable - els = sorted(args[0].items()) - self.calls.append(tuple(els)) - return 200, 'OK' cmd.post_to_server = pypi_server = FakeServer() @@ -101,6 +124,24 @@ self.assert_(len(pypi_server.calls), 2) self.assert_(pypi_server.calls[0], pypi_server.calls[1]) + def test_password_not_in_file(self): + + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + dist = Distribution() + cmd = register(dist) + cmd.post_to_server = FakeServer() + + cmd._set_config() + cmd.finalize_options() + cmd.send_metadata() + + # dist.password should be set + # therefore used afterwards by other commands + self.assertEquals(dist.password, 'password') + def test_suite(): return unittest.makeSuite(registerTestCase) Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py Sun Jan 25 21:08:20 2009 @@ -9,6 +9,17 @@ from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + + class uploadTestCase(PyPIRCCommandTestCase): def test_finalize_options(self): @@ -26,6 +37,24 @@ ('repository', 'http://pypi.python.org/pypi')): self.assertEquals(getattr(cmd, attr), waited) + def test_saved_password(self): + # file with no password + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + # make sure it passes + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, None) + + # make sure we get it as well, if another command + # initialized it at the dist level + dist.password = 'xxx' + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, 'xxx') def test_suite(): return unittest.makeSuite(uploadTestCase) Modified: python/branches/py3k-issue1717/Lib/fractions.py ============================================================================== --- python/branches/py3k-issue1717/Lib/fractions.py (original) +++ python/branches/py3k-issue1717/Lib/fractions.py Sun Jan 25 21:08:20 2009 @@ -109,7 +109,7 @@ """ if isinstance(f, numbers.Integral): - f = float(f) + return cls(f) elif not isinstance(f, float): raise TypeError("%s.from_float() only takes floats, not %r (%s)" % (cls.__name__, f, type(f).__name__)) Modified: python/branches/py3k-issue1717/Lib/gzip.py ============================================================================== --- python/branches/py3k-issue1717/Lib/gzip.py (original) +++ python/branches/py3k-issue1717/Lib/gzip.py Sun Jan 25 21:08:20 2009 @@ -54,7 +54,7 @@ max_read_chunk = 10 * 1024 * 1024 # 10Mb def __init__(self, filename=None, mode=None, - compresslevel=9, fileobj=None): + compresslevel=9, fileobj=None, mtime=None): """Constructor for the GzipFile class. At least one of fileobj and filename must be given a @@ -81,6 +81,15 @@ level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. The default is 9. + The mtime argument is an optional numeric timestamp to be written + to the stream when compressing. All gzip compressed streams + are required to contain a timestamp. If omitted or None, the + current time is used. This module ignores the timestamp when + decompressing; however, some programs, such as gunzip, make use + of it. The format of the timestamp is the same as that of the + return value of time.time() and of the st_mtime member of the + object returned by os.stat(). + """ # guarantee the file is opened in binary mode on platforms @@ -119,6 +128,7 @@ self.fileobj = fileobj self.offset = 0 + self.mtime = mtime if self.mode == WRITE: self._write_gzip_header() @@ -157,7 +167,10 @@ if fname: flags = FNAME self.fileobj.write(chr(flags).encode('latin-1')) - write32u(self.fileobj, int(time.time())) + mtime = self.mtime + if mtime is None: + mtime = time.time() + write32u(self.fileobj, int(mtime)) self.fileobj.write(b'\002') self.fileobj.write(b'\377') if fname: @@ -175,10 +188,10 @@ if method != 8: raise IOError('Unknown compression method') flag = ord( self.fileobj.read(1) ) - # modtime = self.fileobj.read(4) + self.mtime = read32(self.fileobj) # extraflag = self.fileobj.read(1) # os = self.fileobj.read(1) - self.fileobj.read(6) + self.fileobj.read(2) if flag & FEXTRA: # Read & discard the extra field, if present @@ -459,6 +472,14 @@ else: raise StopIteration + def __enter__(self): + if self.fileobj is None: + raise ValueError("I/O operation on closed GzipFile object") + return self + + def __exit__(self, *args): + self.close() + def _test(): # Act like gzip; with -d, act like gunzip. @@ -473,8 +494,8 @@ for arg in args: if decompress: if arg == "-": - f = GzipFile(filename="", mode="rb", fileobj=sys.stdin) - g = sys.stdout + f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer) + g = sys.stdout.buffer else: if arg[-3:] != ".gz": print("filename doesn't end in .gz:", repr(arg)) @@ -483,8 +504,8 @@ g = builtins.open(arg[:-3], "wb") else: if arg == "-": - f = sys.stdin - g = GzipFile(filename="", mode="wb", fileobj=sys.stdout) + f = sys.stdin.buffer + g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer) else: f = builtins.open(arg, "rb") g = open(arg + ".gz", "wb") Modified: python/branches/py3k-issue1717/Lib/heapq.py ============================================================================== --- python/branches/py3k-issue1717/Lib/heapq.py (original) +++ python/branches/py3k-issue1717/Lib/heapq.py Sun Jan 25 21:08:20 2009 @@ -1,4 +1,4 @@ -# -*- coding: Latin-1 -*- +# -*- coding: latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). @@ -129,7 +129,7 @@ __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge', 'nlargest', 'nsmallest', 'heappushpop'] -from itertools import islice, repeat, count, tee +from itertools import islice, repeat, count, tee, chain from operator import itemgetter, neg import bisect @@ -354,9 +354,34 @@ Equivalent to: sorted(iterable, key=key)[:n] """ + # Short-cut for n==1 is to use min() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [min(chain(head, it))] + return [min(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key)[:n] + + # When key is none, use simpler decoration + if key is None: + it = zip(iterable, count()) # decorate + result = _nsmallest(n, it) + return list(map(itemgetter(0), result)) # undecorate + + # General case, slowest method in1, in2 = tee(iterable) - keys = in1 if key is None else map(key, in1) - it = zip(keys, count(), in2) # decorate + it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) return list(map(itemgetter(2), result)) # undecorate @@ -366,9 +391,35 @@ Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ + + # Short-cut for n==1 is to use max() when len(iterable)>0 + if n == 1: + it = iter(iterable) + head = list(islice(it, 1)) + if not head: + return [] + if key is None: + return [max(chain(head, it))] + return [max(chain(head, it), key=key)] + + # When n>=size, it's faster to use sort() + try: + size = len(iterable) + except (TypeError, AttributeError): + pass + else: + if n >= size: + return sorted(iterable, key=key, reverse=True)[:n] + + # When key is none, use simpler decoration + if key is None: + it = zip(iterable, map(neg, count())) # decorate + result = _nlargest(n, it) + return list(map(itemgetter(0), result)) # undecorate + + # General case, slowest method in1, in2 = tee(iterable) - keys = in1 if key is None else map(key, in1) - it = zip(keys, map(neg, count()), in2) # decorate + it = zip(map(key, in1), map(neg, count()), in2) # decorate result = _nlargest(n, it) return list(map(itemgetter(2), result)) # undecorate 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 Sun Jan 25 21:08:20 2009 @@ -697,6 +697,7 @@ """Send the currently buffered request and clear the buffer. Appends an extra \\r\\n to the buffer. + A message_body may be specified, to be appended to the request. """ self._buffer.extend((b"", b"")) msg = b"\r\n".join(self._buffer) @@ -704,9 +705,14 @@ # If msg and message_body are sent in a single send() call, # it will avoid performance problems caused by the interaction # between delayed ack and the Nagle algorithim. - if message_body is not None: + if isinstance(message_body, bytes): msg += message_body + message_body = None self.send(msg) + if message_body is not None: + #message_body was not a string (i.e. it is a file) and + #we must run the risk of Nagle + self.send(message_body) def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): """Send a request to the server. @@ -894,12 +900,7 @@ self._set_content_length(body) for hdr, value in headers.items(): self.putheader(hdr, value) - if isinstance(body, str): - self.endheaders(body.encode('ascii')) - else: - self.endheaders() - if body: # when body is a file rather than a string - self.send(body) + self.endheaders(body.encode('ascii') if isinstance(body, str) else body) def getresponse(self): """Get the response from the server.""" Modified: python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py Sun Jan 25 21:08:20 2009 @@ -82,7 +82,7 @@ # Safari requires real file:-URLs EditorWindow.help_url = 'file://' + EditorWindow.help_url else: - EditorWindow.help_url = "http://docs.python.org/dev/3.0/" + EditorWindow.help_url = "http://docs.python.org/%d.%d" % sys.version_info[:2] currentTheme=idleConf.CurrentTheme() self.flist = flist root = root or flist.root Modified: python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py Sun Jan 25 21:08:20 2009 @@ -7,7 +7,7 @@ import tkinter.messagebox as tkMessageBox import re from tkinter import * -from tkinter.simpledialog import SimpleDialog +from tkinter.simpledialog import askstring from idlelib.configHandler import idleConf @@ -74,10 +74,11 @@ Raise a LookupError if the encoding is declared but unknown. """ if isinstance(data, bytes): - try: - lines = data.decode('utf-8') - except UnicodeDecodeError: - return None + # This encoding might be wrong. However, the coding + # spec must be ASCII-only, so any non-ASCII characters + # around here will be ignored. Decoding to Latin-1 should + # never fail (except for memory outage) + lines = data.decode('iso-8859-1') else: lines = data # consider only the first two lines @@ -210,7 +211,7 @@ except IOError as msg: tkMessageBox.showerror("I/O Error", str(msg), master=self.text) return False - chars = self._decode(two_lines, bytes) + chars, converted = self._decode(two_lines, bytes) if chars is None: tkMessageBox.showerror("Decoding Error", "File %s\nFailed to Decode" % filename, @@ -226,6 +227,10 @@ self.text.insert("1.0", chars) self.reset_undo() self.set_filename(filename) + if converted: + # We need to save the conversion results first + # before being able to execute the code + self.set_saved(False) self.text.mark_set("insert", "1.0") self.text.see("insert") self.updaterecentfileslist(filename) @@ -240,11 +245,11 @@ chars = bytes[3:].decode("utf-8") except UnicodeDecodeError: # has UTF-8 signature, but fails to decode... - return None + return None, False else: # Indicates that this file originally had a BOM self.fileencoding = 'BOM' - return chars + return chars, False # Next look for coding specification try: enc = coding_spec(two_lines) @@ -256,36 +261,48 @@ master = self.text) enc = None except UnicodeDecodeError: - return None + return None, False if enc: try: chars = str(bytes, enc) self.fileencoding = enc - return chars + return chars, False except UnicodeDecodeError: pass # Try ascii: try: chars = str(bytes, 'ascii') self.fileencoding = None - return chars + return chars, False except UnicodeDecodeError: pass # Try utf-8: try: chars = str(bytes, 'utf-8') self.fileencoding = 'utf-8' - return chars + return chars, False except UnicodeDecodeError: pass # Finally, try the locale's encoding. This is deprecated; # the user should declare a non-ASCII encoding try: - chars = str(bytes, locale_encoding) - self.fileencoding = locale_encoding - except UnicodeDecodeError: + # Wait for the editor window to appear + self.editwin.text.update() + enc = askstring( + "Specify file encoding", + "The file's encoding is invalid for Python 3.x.\n" + "IDLE will convert it to UTF-8.\n" + "What is the current encoding of the file?", + initialvalue = locale_encoding, + parent = self.editwin.text) + + if enc: + chars = str(bytes, enc) + self.fileencoding = None + return chars, True + except (UnicodeDecodeError, LookupError): pass - return chars # None on failure + return None, False # None on failure def maybesave(self): if self.get_saved(): Modified: python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt Sun Jan 25 21:08:20 2009 @@ -3,11 +3,21 @@ *Release date: XX-XXX-XXXX* +- Issue #4815: Offer conversion to UTF-8 if source files have + no encoding declaration and are not encoded in UTF-8. + +- Issue #4008: Fix problems with non-ASCII source files. + - Issue #4323: Always encode source as UTF-8 without asking the user (unless a different encoding is declared); remove user configuration of source encoding; all according to PEP 3120. +- Issue #3549: On MacOS the preferences menu was not present + +- Issue #2665: On Windows, an IDLE installation upgraded from an old version + would not start if a custom theme was defined. + What's New in IDLE 3.0a3? ========================= Modified: python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py Sun Jan 25 21:08:20 2009 @@ -24,7 +24,7 @@ import tokenize import tkinter.messagebox as tkMessageBox from idlelib.EditorWindow import EditorWindow -from idlelib import PyShell +from idlelib import PyShell, IOBinding from idlelib.configHandler import idleConf @@ -62,7 +62,13 @@ return 'break' def tabnanny(self, filename): - f = open(filename, 'r') + # XXX: tabnanny should work on binary files as well + with open(filename, 'r', encoding='iso-8859-1') as f: + two_lines = f.readline() + f.readline() + encoding = IOBinding.coding_spec(two_lines) + if not encoding: + encoding = 'utf-8' + f = open(filename, 'r', encoding=encoding) try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError as msg: @@ -82,14 +88,14 @@ self.shell = shell = self.flist.open_shell() saved_stream = shell.get_warning_stream() shell.set_warning_stream(shell.stderr) - f = open(filename, 'r') + f = open(filename, 'rb') source = f.read() f.close() - if '\r' in source: - source = re.sub(r"\r\n", "\n", source) - source = re.sub(r"\r", "\n", source) - if source and source[-1] != '\n': - source = source + '\n' + if b'\r' in source: + source = source.replace(b'\r\n', b'\n') + source = source.replace(b'\r', b'\n') + if source and source[-1] != ord(b'\n'): + source = source + b'\n' editwin = self.editwin text = editwin.text text.tag_remove("ERROR", "1.0", "end") Modified: python/branches/py3k-issue1717/Lib/idlelib/help.txt ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/help.txt (original) +++ python/branches/py3k-issue1717/Lib/idlelib/help.txt Sun Jan 25 21:08:20 2009 @@ -90,7 +90,10 @@ Configure IDLE -- Open a configuration dialog. Fonts, indentation, keybindings, and color themes may be altered. Startup Preferences may be set, and Additional Help - Souces can be specified. + Sources can be specified. + + On MacOS X this menu is not present, use + menu 'IDLE -> Preferences...' instead. --- Code Context -- Open a pane at the top of the edit window which shows the block context of the section of code Modified: python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py Sun Jan 25 21:08:20 2009 @@ -89,7 +89,9 @@ ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding tkversion = root.tk.eval('info patchlevel') - if tkversion >= '8.4.14': + # Note: we cannot check if the string tkversion >= '8.4.14', because + # the string '8.4.7' is greater than the string '8.4.14'. + if tuple(map(int, tkversion.split('.'))) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, Modified: python/branches/py3k-issue1717/Lib/inspect.py ============================================================================== --- python/branches/py3k-issue1717/Lib/inspect.py (original) +++ python/branches/py3k-issue1717/Lib/inspect.py Sun Jan 25 21:08:20 2009 @@ -63,7 +63,7 @@ Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" - return isinstance(object, type) or hasattr(object, '__bases__') + return isinstance(object, type) def ismethod(object): """Return true if the object is an instance method. @@ -158,9 +158,8 @@ Generator function objects provides same attributes as functions. See isfunction.__doc__ for attributes listing.""" - if (isfunction(object) or ismethod(object)) and \ - object.__code__.co_flags & CO_GENERATOR: - return True + return bool((isfunction(object) or ismethod(object)) and + object.__code__.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. @@ -250,7 +249,10 @@ Optionally, only return members that satisfy a given predicate.""" results = [] for key in dir(object): - value = getattr(object, key) + try: + value = getattr(object, key) + except AttributeError: + continue if not predicate or predicate(value): results.append((key, value)) results.sort() @@ -879,8 +881,8 @@ specs = [] if defaults: firstdefault = len(args) - len(defaults) - for i in range(len(args)): - spec = strseq(args[i], formatargandannotation, join) + for i, arg in enumerate(args): + spec = strseq(arg, formatargandannotation, join) if defaults and i >= firstdefault: spec = spec + formatvalue(defaults[i - firstdefault]) specs.append(spec) @@ -892,7 +894,7 @@ if kwonlyargs: for kwonlyarg in kwonlyargs: spec = formatargandannotation(kwonlyarg) - if kwonlyarg in kwonlydefaults: + if kwonlydefaults and kwonlyarg in kwonlydefaults: spec += formatvalue(kwonlydefaults[kwonlyarg]) specs.append(spec) if varkw is not None: Modified: python/branches/py3k-issue1717/Lib/io.py ============================================================================== --- python/branches/py3k-issue1717/Lib/io.py (original) +++ python/branches/py3k-issue1717/Lib/io.py Sun Jan 25 21:08:20 2009 @@ -340,6 +340,7 @@ def tell(self) -> int: """Return current stream position.""" + self._checkClosed() return self.seek(0, 1) def truncate(self, pos: int = None) -> int: @@ -358,6 +359,8 @@ This is not implemented for read-only and non-blocking streams. """ # XXX Should this return the number of bytes written??? + if self.__closed: + raise ValueError("I/O operation on closed file.") __closed = False @@ -530,6 +533,7 @@ 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 @@ -567,6 +571,7 @@ Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read. """ + self._checkClosed() if n is None: n = -1 if n < 0: @@ -578,6 +583,7 @@ def readall(self): """Read until EOF, using multiple read() call.""" + self._checkClosed() res = bytearray() while True: data = self.read(DEFAULT_BUFFER_SIZE) @@ -673,6 +679,7 @@ data at the moment. """ # XXX This ought to work with anything that supports the buffer API + self._checkClosed() data = self.read(len(b)) n = len(data) try: @@ -787,13 +794,11 @@ def getvalue(self): """Return the bytes value (contents) of the buffer """ - if self.closed: - raise ValueError("getvalue on closed file") + self._checkClosed() return bytes(self._buffer) def read(self, n=None): - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if n is None: n = -1 if n < 0: @@ -811,8 +816,7 @@ return self.read(n) def write(self, b): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if isinstance(b, str): raise TypeError("can't write str to binary stream") n = len(b) @@ -829,8 +833,7 @@ return n def seek(self, pos, whence=0): - if self.closed: - raise ValueError("seek on closed file") + self._checkClosed() try: pos = pos.__index__() except AttributeError as err: @@ -848,13 +851,11 @@ return self._pos def tell(self): - if self.closed: - raise ValueError("tell on closed file") + self._checkClosed() return self._pos def truncate(self, pos=None): - if self.closed: - raise ValueError("truncate on closed file") + self._checkClosed() if pos is None: pos = self._pos elif pos < 0: @@ -914,6 +915,7 @@ mode. If n is negative, read until EOF or until read() would block. """ + self._checkClosed() with self._read_lock: return self._read_unlocked(n) @@ -970,6 +972,7 @@ do at most one raw read to satisfy it. We never return more than self.buffer_size. """ + self._checkClosed() with self._read_lock: return self._peek_unlocked(n) @@ -988,6 +991,7 @@ """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. + self._checkClosed() if n <= 0: return b"" with self._read_lock: @@ -996,9 +1000,11 @@ min(n, len(self._read_buf) - self._read_pos)) def tell(self): + self._checkClosed() return self.raw.tell() - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): + self._checkClosed() with self._read_lock: if whence == 1: pos -= len(self._read_buf) - self._read_pos @@ -1029,8 +1035,7 @@ self._write_lock = Lock() def write(self, b): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if isinstance(b, str): raise TypeError("can't write str to binary stream") with self._write_lock: @@ -1060,6 +1065,7 @@ return written def truncate(self, pos=None): + self._checkClosed() with self._write_lock: self._flush_unlocked() if pos is None: @@ -1067,12 +1073,11 @@ return self.raw.truncate(pos) def flush(self): + self._checkClosed() 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: @@ -1086,9 +1091,11 @@ raise BlockingIOError(e.errno, e.strerror, written) def tell(self): + self._checkClosed() return self.raw.tell() + len(self._write_buf) def seek(self, pos, whence=0): + self._checkClosed() with self._write_lock: self._flush_unlocked() return self.raw.seek(pos, whence) @@ -1186,6 +1193,7 @@ return pos def tell(self): + self._checkClosed() if self._write_buf: return self.raw.tell() + len(self._write_buf) else: @@ -1217,6 +1225,7 @@ return BufferedReader.read1(self, n) def write(self, b): + self._checkClosed() if self._read_buf: # Undo readahead with self._read_lock: @@ -1474,8 +1483,7 @@ return self.buffer.isatty() def write(self, s: str): - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if not isinstance(s, str): raise TypeError("can't write %s to text stream" % s.__class__.__name__) @@ -1583,6 +1591,7 @@ return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip def tell(self): + self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if not self._telling: @@ -1653,8 +1662,7 @@ return self.buffer.truncate() def seek(self, cookie, whence=0): - if self.closed: - raise ValueError("tell on closed file") + self._checkClosed() if not self._seekable: raise IOError("underlying stream is not seekable") if whence == 1: # seek relative to current position @@ -1712,6 +1720,7 @@ return cookie def read(self, n=None): + self._checkClosed() if n is None: n = -1 decoder = self._decoder or self._get_decoder() @@ -1732,6 +1741,7 @@ return result def __next__(self): + self._checkClosed() self._telling = False line = self.readline() if not line: @@ -1741,8 +1751,7 @@ return line def readline(self, limit=None): - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if limit is None: limit = -1 @@ -1963,8 +1972,7 @@ def getvalue(self) -> str: """Retrieve the entire contents of the object.""" - if self.closed: - raise ValueError("read on closed file") + self._checkClosed() return self._getvalue() def write(self, s: str) -> int: @@ -1972,8 +1980,7 @@ Returns the number of characters written. """ - if self.closed: - raise ValueError("write to closed file") + self._checkClosed() if not isinstance(s, str): raise TypeError("can't write %s to text stream" % s.__class__.__name__) @@ -1990,8 +1997,7 @@ 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") + self._checkClosed() if n is None: n = -1 res = self._pending @@ -2006,8 +2012,7 @@ def tell(self) -> int: """Tell the current file position.""" - if self.closed: - raise ValueError("tell from closed file") + self._checkClosed() if self._pending: return self._tell() - len(self._pending) else: @@ -2022,8 +2027,7 @@ 2 End of stream - pos must be 0. Returns the new absolute position. """ - if self.closed: - raise ValueError("seek from closed file") + self._checkClosed() self._pending = "" return self._seek(pos, whence) @@ -2034,14 +2038,12 @@ returned by tell(). Imply an absolute seek to pos. Returns the new absolute position. """ - if self.closed: - raise ValueError("truncate from closed file") + self._checkClosed() self._pending = "" return self._truncate(pos) def readline(self, limit: int = None) -> str: - if self.closed: - raise ValueError("read from closed file") + self._checkClosed() if limit is None: limit = -1 if limit >= 0: Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py Sun Jan 25 21:08:20 2009 @@ -222,6 +222,29 @@ return True return False +def is_probably_builtin(node): + """ + Check that something isn't an attribute or function name etc. + """ + prev = node.get_prev_sibling() + if prev is not None and prev.type == token.DOT: + # Attribute lookup. + return False + parent = node.parent + if parent.type in (syms.funcdef, syms.classdef): + return False + if parent.type == syms.expr_stmt and parent.children[0] is node: + # Assignment. + return False + if parent.type == syms.parameters or \ + (parent.type == syms.typedargslist and ( + (prev is not None and prev.type == token.COMMA) or + parent.children[0] is node + )): + # The name of an argument. + return False + return True + ########################################################### ### The following functions are to find bindings in a suite ########################################################### Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py Sun Jan 25 21:08:20 2009 @@ -7,9 +7,9 @@ exec() function. """ -from .. import pytree from .. import fixer_base -from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) class FixExecfile(fixer_base.BaseFix): @@ -22,16 +22,30 @@ def transform(self, node, results): assert results - syms = self.syms filename = results["filename"] globals = results.get("globals") locals = results.get("locals") - args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(), - Name('read'), LParen(), RParen()] - args[0].set_prefix("") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.set_prefix(" ") + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py Sun Jan 25 21:08:20 2009 @@ -13,55 +13,78 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport, syms +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unkown node type") + class FixImport(fixer_base.BaseFix): PATTERN = """ - import_from< type='from' imp=any 'import' ['('] any [')'] > + import_from< 'from' imp=any 'import' ['('] any [')'] > | - import_name< type='import' imp=any > + import_name< 'import' imp=any > """ def transform(self, node, results): imp = results['imp'] - mod_name = str(imp.children[0] if imp.type == syms.dotted_as_name \ - else imp) - - if str(imp).startswith('.'): - # Already a new-style import - return - - if not probably_a_local_import(str(mod_name), self.filename): - # I guess this is a global import -- skip it! - return - - if results['type'].value == 'from': + if node.type == syms.import_from: # Some imps are top-level (eg: 'import ham') # some are first level (eg: 'import ham.eggs') # some are third level (eg: 'import ham.eggs as spam') # Hence, the loop while not hasattr(imp, 'value'): imp = imp.children[0] - imp.value = "." + imp.value - node.changed() + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + return node else: - new = FromImport('.', getattr(imp, 'content', None) or [imp]) + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport('.', [imp]) new.set_prefix(node.get_prefix()) - node = new - return node + return new -def probably_a_local_import(imp_name, file_path): - # Must be stripped because the right space is included by the parser - imp_name = imp_name.split('.', 1)[0].strip() - base_path = dirname(file_path) - base_path = join(base_path, imp_name) - # If there is no __init__.py next to the file its not in a package - # so can't be a relative import. - if not exists(join(dirname(base_path), '__init__.py')): + def probably_a_local_import(self, imp_name): + imp_name = imp_name.split('.', 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False + for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: + if exists(base_path + ext): + return True return False - for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: - if exists(base_path + ext): - return True - return False Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py Sun Jan 25 21:08:20 2009 @@ -25,7 +25,6 @@ 'tkFont': 'tkinter.font', 'tkMessageBox': 'tkinter.messagebox', 'ScrolledText': 'tkinter.scrolledtext', - 'turtle': 'tkinter.turtle', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', 'Tkinter': 'tkinter', @@ -89,6 +88,10 @@ # This is overridden in fix_imports2. mapping = MAPPING + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + def build_pattern(self): return "|".join(build_pattern(self.mapping)) @@ -118,7 +121,7 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[(import_mod or mod_name).value] + new_name = self.mapping[import_mod.value] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, @@ -129,10 +132,8 @@ # line (e.g., "import StringIO, urlparse"). The problem is that I # can't figure out an easy way to make a pattern recognize the # keys of MAPPING randomly sprinkled in an import statement. - while True: - results = self.match(node) - if not results: - break + results = self.match(node) + if results: self.transform(node, results) else: # Replace usage of the module. Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py Sun Jan 25 21:08:20 2009 @@ -11,6 +11,6 @@ class FixImports2(fix_imports.FixImports): - run_order = 6 + run_order = 7 mapping = MAPPING Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py Sun Jan 25 21:08:20 2009 @@ -5,20 +5,18 @@ """ # Local imports -from .. import pytree from .. import fixer_base -from ..fixer_util import Name, Number +from ..fixer_util import Name, Number, is_probably_builtin class FixLong(fixer_base.BaseFix): PATTERN = "'long'" - static_long = Name("long") static_int = Name("int") def transform(self, node, results): - assert node == self.static_long, node - new = self.static_int.clone() - new.set_prefix(node.get_prefix()) - return new + if is_probably_builtin(node): + new = self.static_int.clone() + new.set_prefix(node.get_prefix()) + return new Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py Sun Jan 25 21:08:20 2009 @@ -15,7 +15,10 @@ '_urlopener', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', - 'urlencode', 'pahtname2url', 'url2pathname']), + 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', + 'splithost', 'splitnport', 'splitpasswd', 'splitport', + 'splitquery', 'splittag', 'splittype', 'splituser', + 'splitvalue', ]), ('urllib.error', ['ContentTooShortError'])], 'urllib2' : [ @@ -34,12 +37,12 @@ 'FTPHandler', 'CacheFTPHandler', 'UnknownHandler']), ('urllib.error', - ['URLError', 'HTTPError'])], + ['URLError', 'HTTPError']), + ] } - -# def alternates(members): -# return "(" + "|".join(map(repr, members)) + ")" +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) def build_pattern(): Modified: python/branches/py3k-issue1717/Lib/lib2to3/main.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/main.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/main.py Sun Jan 25 21:08:20 2009 @@ -41,7 +41,7 @@ super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) if not self.nobackups: - shutil.copymode(filename, backup) + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: Modified: python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py Sun Jan 25 21:08:20 2009 @@ -77,7 +77,8 @@ column = 0 else: # We never broke out -- EOF is too soon (how can this happen???) - raise parse.ParseError("incomplete input", t, v, x) + raise parse.ParseError("incomplete input", + type, value, (prefix, start)) return p.rootnode def parse_stream_raw(self, stream, debug=False): Modified: python/branches/py3k-issue1717/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/refactor.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/refactor.py Sun Jan 25 21:08:20 2009 @@ -287,17 +287,13 @@ Returns: True if the tree was modified, False otherwise. """ - # Two calls to chain are required because pre_order.values() - # will be a list of lists of fixers: - # [[, ], []] - all_fixers = chain(self.pre_order, self.post_order) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.start_tree(tree, name) self.traverse_by(self.pre_order_heads, tree.pre_order()) self.traverse_by(self.post_order_heads, tree.post_order()) - for fixer in all_fixers: + for fixer in chain(self.pre_order, self.post_order): fixer.finish_tree(tree, name) return tree.was_changed Modified: python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py Sun Jan 25 21:08:20 2009 @@ -485,6 +485,14 @@ global a, b global one, two, three, four, five, six, seven, eight, nine, ten + def testNonlocal(self): + # 'nonlocal' NAME (',' NAME)* + x = 0 + y = 0 + def f(): + nonlocal x + nonlocal x, y + def testAssert(self): # assert_stmt: 'assert' test [',' test] assert 1 Modified: python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py Sun Jan 25 21:08:20 2009 @@ -1073,11 +1073,72 @@ a = """z = type(x) in (int, int)""" self.check(b, a) + def test_unchanged(self): + s = """long = True""" + self.unchanged(s) + + s = """s.long = True""" + self.unchanged(s) + + s = """def long(): pass""" + self.unchanged(s) + + s = """class long(): pass""" + self.unchanged(s) + + s = """def f(long): pass""" + self.unchanged(s) + + s = """def f(g, long): pass""" + self.unchanged(s) + + s = """def f(x, long=True): pass""" + self.unchanged(s) + def test_prefix_preservation(self): b = """x = long( x )""" a = """x = int( x )""" self.check(b, a) + +class Test_execfile(FixerTestCase): + fixer = "execfile" + + def test_conversion(self): + b = """execfile("fn")""" + a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + self.check(b, a) + + b = """execfile("fn", glob, loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + self.check(b, a) + + b = """execfile("fn", locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + self.check(b, a) + + b = """execfile("fn", globals=glob, locals=loc)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + self.check(b, a) + + def test_spacing(self): + b = """execfile( "fn" )""" + a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + self.check(b, a) + + b = """execfile("fn", globals = glob)""" + a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + self.check(b, a) + + class Test_isinstance(FixerTestCase): fixer = "isinstance" @@ -3466,11 +3527,30 @@ a = "from . import foo, bar" self.check_both(b, a) + b = "import foo, bar, x" + a = "from . import foo, bar, x" + self.check_both(b, a) + + b = "import x, y, z" + a = "from . import x, y, z" + self.check_both(b, a) + def test_import_as(self): b = "import foo as x" a = "from . import foo as x" self.check_both(b, a) + b = "import a as b, b as c, c as d" + a = "from . import a as b, b as c, c as d" + self.check_both(b, a) + + def test_local_and_absolute(self): + self.always_exists = False + self.present_files = set(["foo.py", "__init__.py"]) + + s = "import foo, bar" + self.warns_unchanged(s, "absolute and local imports together") + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" Modified: python/branches/py3k-issue1717/Lib/logging/__init__.py ============================================================================== --- python/branches/py3k-issue1717/Lib/logging/__init__.py (original) +++ python/branches/py3k-issue1717/Lib/logging/__init__.py Sun Jan 25 21:08:20 2009 @@ -18,7 +18,7 @@ Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ @@ -43,8 +43,8 @@ __author__ = "Vinay Sajip " __status__ = "production" -__version__ = "0.5.0.6" -__date__ = "03 December 2008" +__version__ = "0.5.0.7" +__date__ = "20 January 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -99,6 +99,11 @@ logThreads = 1 # +# If you don't want multiprocessing information in the log, set this to zero +# +logMultiprocessing = 1 + +# # If you don't want process information in the log, set this to zero # logProcesses = 1 @@ -263,6 +268,11 @@ else: self.thread = None self.threadName = None + if logMultiprocessing: + from multiprocessing import current_process + self.processName = current_process().name + else: + self.processName = None if logProcesses and hasattr(os, 'getpid'): self.process = os.getpid() else: @@ -727,7 +737,6 @@ if strm is None: strm = sys.stderr self.stream = strm - self.formatter = None def flush(self): """ @@ -782,10 +791,12 @@ self.mode = mode self.encoding = encoding if delay: + #We don't open the stream, but we still need to call the + #Handler constructor to set level, formatter, lock etc. + Handler.__init__(self) self.stream = None else: - stream = self._open() - StreamHandler.__init__(self, stream) + StreamHandler.__init__(self, self._open()) def close(self): """ @@ -817,8 +828,7 @@ constructor, open it before calling the superclass's emit. """ if self.stream is None: - stream = self._open() - StreamHandler.__init__(self, stream) + self.stream = self._open() StreamHandler.emit(self, record) #--------------------------------------------------------------------------- Modified: python/branches/py3k-issue1717/Lib/logging/handlers.py ============================================================================== --- python/branches/py3k-issue1717/Lib/logging/handlers.py (original) +++ python/branches/py3k-issue1717/Lib/logging/handlers.py Sun Jan 25 21:08:20 2009 @@ -19,9 +19,9 @@ based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. -To use, simply 'import logging' and log away! +To use, simply 'import logging.handlers' and log away! """ import logging, socket, os, pickle, struct, time, re @@ -112,8 +112,8 @@ """ Do a rollover, as described in __init__(). """ - - self.stream.close() + if self.stream: + self.stream.close() if self.backupCount > 0: for i in range(self.backupCount - 1, 0, -1): sfn = "%s.%d" % (self.baseFilename, i) @@ -138,6 +138,8 @@ Basically, see if the supplied record would cause the file to exceed the size limit we have. """ + if self.stream is None: # delay was set... + self.stream = self._open() if self.maxBytes > 0: # are we rolling over? msg = "%s\n" % self.format(record) self.stream.seek(0, 2) #due to non-posix-compliant Windows feature @@ -302,7 +304,8 @@ then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ - self.stream.close() + if self.stream: + self.stream.close() # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: @@ -1024,9 +1027,7 @@ h.putheader("Content-type", "application/x-www-form-urlencoded") h.putheader("Content-length", str(len(data))) - h.endheaders() - if self.method == "POST": - h.send(data) + h.endheaders(data if self.method == "POST" else None) h.getreply() #can't do anything with the result except (KeyboardInterrupt, SystemExit): raise Modified: python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py ============================================================================== --- python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py (original) +++ python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py Sun Jan 25 21:08:20 2009 @@ -48,7 +48,7 @@ 'allow_connection_pickling', 'BufferTooShort', 'TimeoutError', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array', - 'RawValue', 'RawArray' + 'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING', ] __author__ = 'R. Oudkerk (r.m.oudkerk at gmail.com)' @@ -61,6 +61,7 @@ import sys from multiprocessing.process import Process, current_process, active_children +from multiprocessing.util import SUBDEBUG, SUBWARNING # # Exceptions Modified: python/branches/py3k-issue1717/Lib/multiprocessing/forking.py ============================================================================== --- python/branches/py3k-issue1717/Lib/multiprocessing/forking.py (original) +++ python/branches/py3k-issue1717/Lib/multiprocessing/forking.py Sun Jan 25 21:08:20 2009 @@ -151,14 +151,10 @@ import _subprocess import time + from pickle import dump, load, HIGHEST_PROTOCOL from ._multiprocessing import win32, Connection, PipeConnection from .util import Finalize - #try: - # from cPickle import dump, load, HIGHEST_PROTOCOL - #except ImportError: - from pickle import load, HIGHEST_PROTOCOL - def dump(obj, file, protocol=None): ForkingPickler(file, protocol).dump(obj) Modified: python/branches/py3k-issue1717/Lib/multiprocessing/managers.py ============================================================================== --- python/branches/py3k-issue1717/Lib/multiprocessing/managers.py (original) +++ python/branches/py3k-issue1717/Lib/multiprocessing/managers.py Sun Jan 25 21:08:20 2009 @@ -21,16 +21,12 @@ import queue from traceback import format_exc +from pickle import PicklingError from multiprocessing import Process, current_process, active_children, Pool, util, connection from multiprocessing.process import AuthenticationString from multiprocessing.forking import exit, Popen, assert_spawning, ForkingPickler from multiprocessing.util import Finalize, info -try: - from cPickle import PicklingError -except ImportError: - from pickle import PicklingError - # # Register some things for pickling # @@ -143,7 +139,7 @@ self.listener = Listener(address=address, backlog=5) self.address = self.listener.address - self.id_to_obj = {0: (None, ())} + self.id_to_obj = {'0': (None, ())} self.id_to_refcount = {} self.mutex = threading.RLock() self.stop = 0 @@ -305,7 +301,7 @@ keys = list(self.id_to_obj.keys()) keys.sort() for ident in keys: - if ident != 0: + if ident != '0': result.append(' %s: refcount=%s\n %s' % (ident, self.id_to_refcount[ident], str(self.id_to_obj[ident][0])[:75])) @@ -317,7 +313,7 @@ ''' Number of shared objects ''' - return len(self.id_to_obj) - 1 # don't count ident=0 + return len(self.id_to_obj) - 1 # don't count ident='0' def shutdown(self, c): ''' Modified: python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py ============================================================================== --- python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py (original) +++ python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py Sun Jan 25 21:08:20 2009 @@ -66,9 +66,12 @@ Return a synchronization wrapper for a Value ''' obj = RawValue(typecode_or_type, *args) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def Array(typecode_or_type, size_or_initializer, **kwds): @@ -79,9 +82,12 @@ if kwds: raise ValueError('unrecognized keyword argument(s): %s' % list(kwds.keys())) obj = RawArray(typecode_or_type, size_or_initializer) - if lock is None: + if lock is False: + return obj + if lock in (True, None): lock = RLock() - assert hasattr(lock, 'acquire') + if not hasattr(lock, 'acquire'): + raise AttributeError("'%r' has no method 'acquire'" % lock) return synchronized(obj, lock) def copy(obj): Modified: python/branches/py3k-issue1717/Lib/multiprocessing/util.py ============================================================================== --- python/branches/py3k-issue1717/Lib/multiprocessing/util.py (original) +++ python/branches/py3k-issue1717/Lib/multiprocessing/util.py Sun Jan 25 21:08:20 2009 @@ -17,7 +17,8 @@ __all__ = [ 'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger', 'log_to_stderr', 'get_temp_dir', 'register_after_fork', - 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal' + 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal', + 'SUBDEBUG', 'SUBWARNING', ] # @@ -57,60 +58,47 @@ Returns logger used by multiprocessing ''' global _logger - - if not _logger: - import logging, atexit - - # XXX multiprocessing should cleanup before logging - if hasattr(atexit, 'unregister'): - atexit.unregister(_exit_function) - atexit.register(_exit_function) - else: - atexit._exithandlers.remove((_exit_function, (), {})) - atexit._exithandlers.append((_exit_function, (), {})) - - _check_logger_class() - _logger = logging.getLogger(LOGGER_NAME) - - return _logger - -def _check_logger_class(): - ''' - Make sure process name is recorded when loggers are used - ''' - # XXX This function is unnecessary once logging is patched - import logging - if hasattr(logging, 'multiprocessing'): - return + import logging, atexit logging._acquireLock() try: - OldLoggerClass = logging.getLoggerClass() - if not getattr(OldLoggerClass, '_process_aware', False): - class ProcessAwareLogger(OldLoggerClass): - _process_aware = True - def makeRecord(self, *args, **kwds): - record = OldLoggerClass.makeRecord(self, *args, **kwds) - record.processName = current_process()._name - return record - logging.setLoggerClass(ProcessAwareLogger) + if not _logger: + + _logger = logging.getLogger(LOGGER_NAME) + _logger.propagate = 0 + logging.addLevelName(SUBDEBUG, 'SUBDEBUG') + logging.addLevelName(SUBWARNING, 'SUBWARNING') + + # XXX multiprocessing should cleanup before logging + if hasattr(atexit, 'unregister'): + atexit.unregister(_exit_function) + atexit.register(_exit_function) + else: + atexit._exithandlers.remove((_exit_function, (), {})) + atexit._exithandlers.append((_exit_function, (), {})) + finally: logging._releaseLock() + return _logger + def log_to_stderr(level=None): ''' Turn on logging and add a handler which prints to stderr ''' global _log_to_stderr import logging + logger = get_logger() formatter = logging.Formatter(DEFAULT_LOGGING_FORMAT) handler = logging.StreamHandler() handler.setFormatter(formatter) logger.addHandler(handler) - if level is not None: + + if level: logger.setLevel(level) _log_to_stderr = True + return _logger # # Function returning a temp directory which will be removed on exit Modified: python/branches/py3k-issue1717/Lib/pickle.py ============================================================================== --- python/branches/py3k-issue1717/Lib/pickle.py (original) +++ python/branches/py3k-issue1717/Lib/pickle.py Sun Jan 25 21:08:20 2009 @@ -470,7 +470,7 @@ else: self.write(LONG4 + pack(">> import random ->>> dis(pickle.dumps(random.getrandbits, 0)) - 0: c GLOBAL 'random getrandbits' - 20: p PUT 0 - 23: . STOP +>>> import pickletools +>>> dis(pickle.dumps(pickletools.dis, 0)) + 0: c GLOBAL 'pickletools dis' + 17: p PUT 0 + 20: . STOP highest protocol among opcodes = 0 >>> from pickletools import _Example @@ -2157,12 +2159,12 @@ 92: V UNICODE 'value' 99: p PUT 7 102: L LONG 42 - 106: s SETITEM - 107: b BUILD - 108: a APPEND - 109: g GET 5 - 112: a APPEND - 113: . STOP + 107: s SETITEM + 108: b BUILD + 109: a APPEND + 110: g GET 5 + 113: a APPEND + 114: . STOP highest protocol among opcodes = 0 >>> dis(pickle.dumps(x, 1)) Modified: python/branches/py3k-issue1717/Lib/random.py ============================================================================== --- python/branches/py3k-issue1717/Lib/random.py (original) +++ python/branches/py3k-issue1717/Lib/random.py Sun Jan 25 21:08:20 2009 @@ -396,9 +396,11 @@ def expovariate(self, 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. + 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. """ # lambd: rate lambd = 1/mean Modified: python/branches/py3k-issue1717/Lib/smtplib.py ============================================================================== --- python/branches/py3k-issue1717/Lib/smtplib.py (original) +++ python/branches/py3k-issue1717/Lib/smtplib.py Sun Jan 25 21:08:20 2009 @@ -336,7 +336,10 @@ if self.file is None: self.file = self.sock.makefile('rb') while 1: - line = self.file.readline() + try: + line = self.file.readline() + except socket.error: + line = '' if not line: self.close() raise SMTPServerDisconnected("Connection unexpectedly closed") Modified: python/branches/py3k-issue1717/Lib/socket.py ============================================================================== --- python/branches/py3k-issue1717/Lib/socket.py (original) +++ python/branches/py3k-issue1717/Lib/socket.py Sun Jan 25 21:08:20 2009 @@ -225,11 +225,12 @@ return self._writing and not self.closed def fileno(self): + self._checkClosed() return self._sock.fileno() @property def name(self): - return self._sock.fileno() + return self.fileno() @property def mode(self): @@ -239,9 +240,12 @@ if self.closed: return io.RawIOBase.close(self) + self._sock._decref_socketios() + self._sock = None def __del__(self): - self._sock._decref_socketios() + if not self.closed: + self._sock._decref_socketios() def getfqdn(name=''): Deleted: python/branches/py3k-issue1717/Lib/test/crashers/iter.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/crashers/iter.py Sun Jan 25 21:08:20 2009 +++ (empty file) @@ -1,53 +0,0 @@ -# Calls to PyIter_Next, or direct calls to tp_iternext, on an object -# which might no longer be an iterable because its 'next' method was -# removed. These are all variants of Issue3720. - -""" -Run this script with an argument between 1 and to test for -different crashes. -""" -N = 8 - -import sys - -class Foo(object): - def __iter__(self): - return self - def next(self): - del Foo.next - return (1, 2) - -def case1(): - list(enumerate(Foo())) - -def case2(): - x, y = Foo() - -def case3(): - filter(None, Foo()) - -def case4(): - map(None, Foo(), Foo()) - -def case5(): - max(Foo()) - -def case6(): - sum(Foo(), ()) - -def case7(): - dict(Foo()) - -def case8(): - sys.stdout.writelines(Foo()) - -# etc... - - -if __name__ == '__main__': - if len(sys.argv) < 2: - print(__doc__.replace('', str(N))) - else: - n = int(sys.argv[1]) - func = globals()['case%d' % n] - func() Modified: python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py (original) +++ python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py Sun Jan 25 21:08:20 2009 @@ -105,3 +105,7 @@ #line 105 def annotated(arg1: list): pass + +#line 109 +def keyword_only_arg(*, arg): + pass Modified: python/branches/py3k-issue1717/Lib/test/pickletester.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/pickletester.py (original) +++ python/branches/py3k-issue1717/Lib/test/pickletester.py Sun Jan 25 21:08:20 2009 @@ -90,21 +90,21 @@ # the object returned by create_data(). DATA0 = ( - b'(lp0\nL0\naL1\naF2.0\nac' + b'(lp0\nL0L\naL1L\naF2.0\nac' b'builtins\ncomplex\n' b'p1\n(F3.0\nF0.0\ntp2\nRp' - b'3\naL1\naL-1\naL255\naL-' - b'255\naL-256\naL65535\na' - b'L-65535\naL-65536\naL2' - b'147483647\naL-2147483' - b'647\naL-2147483648\na(' + b'3\naL1L\naL-1L\naL255L\naL-' + b'255L\naL-256L\naL65535L\na' + b'L-65535L\naL-65536L\naL2' + b'147483647L\naL-2147483' + b'647L\naL-2147483648L\na(' b'Vabc\np4\ng4\nccopyreg' b'\n_reconstructor\np5\n(' b'c__main__\nC\np6\ncbu' b'iltins\nobject\np7\nNt' b'p8\nRp9\n(dp10\nVfoo\np1' - b'1\nL1\nsVbar\np12\nL2\nsb' - b'g9\ntp13\nag13\naL5\na.' + b'1\nL1L\nsVbar\np12\nL2L\nsb' + b'g9\ntp13\nag13\naL5L\na.' ) # Disassembly of DATA0 @@ -113,80 +113,80 @@ 1: l LIST (MARK at 0) 2: p PUT 0 5: L LONG 0 - 8: a APPEND - 9: L LONG 1 - 12: a APPEND - 13: F FLOAT 2.0 - 18: a APPEND - 19: c GLOBAL 'builtins complex' - 37: p PUT 1 - 40: ( MARK - 41: F FLOAT 3.0 - 46: F FLOAT 0.0 - 51: t TUPLE (MARK at 40) - 52: p PUT 2 - 55: R REDUCE - 56: p PUT 3 - 59: a APPEND - 60: L LONG 1 - 63: a APPEND - 64: L LONG -1 - 68: a APPEND - 69: L LONG 255 - 74: a APPEND - 75: L LONG -255 - 81: a APPEND - 82: L LONG -256 - 88: a APPEND - 89: L LONG 65535 - 96: a APPEND - 97: L LONG -65535 - 105: a APPEND - 106: L LONG -65536 + 9: a APPEND + 10: L LONG 1 + 14: a APPEND + 15: F FLOAT 2.0 + 20: a APPEND + 21: c GLOBAL 'builtins complex' + 39: p PUT 1 + 42: ( MARK + 43: F FLOAT 3.0 + 48: F FLOAT 0.0 + 53: t TUPLE (MARK at 42) + 54: p PUT 2 + 57: R REDUCE + 58: p PUT 3 + 61: a APPEND + 62: L LONG 1 + 66: a APPEND + 67: L LONG -1 + 72: a APPEND + 73: L LONG 255 + 79: a APPEND + 80: L LONG -255 + 87: a APPEND + 88: L LONG -256 + 95: a APPEND + 96: L LONG 65535 + 104: a APPEND + 105: L LONG -65535 114: a APPEND - 115: L LONG 2147483647 - 127: a APPEND - 128: L LONG -2147483647 - 141: a APPEND - 142: L LONG -2147483648 - 155: a APPEND - 156: ( MARK - 157: V UNICODE 'abc' - 162: p PUT 4 - 165: g GET 4 - 168: c GLOBAL 'copyreg _reconstructor' - 192: p PUT 5 - 195: ( MARK - 196: c GLOBAL '__main__ C' - 208: p PUT 6 - 211: c GLOBAL 'builtins object' - 228: p PUT 7 - 231: N NONE - 232: t TUPLE (MARK at 195) - 233: p PUT 8 - 236: R REDUCE - 237: p PUT 9 - 240: ( MARK - 241: d DICT (MARK at 240) - 242: p PUT 10 - 246: V UNICODE 'foo' - 251: p PUT 11 - 255: L LONG 1 - 258: s SETITEM - 259: V UNICODE 'bar' - 264: p PUT 12 - 268: L LONG 2 - 271: s SETITEM - 272: b BUILD - 273: g GET 9 - 276: t TUPLE (MARK at 156) - 277: p PUT 13 - 281: a APPEND - 282: g GET 13 - 286: a APPEND - 287: L LONG 5 - 290: a APPEND - 291: . STOP + 115: L LONG -65536 + 124: a APPEND + 125: L LONG 2147483647 + 138: a APPEND + 139: L LONG -2147483647 + 153: a APPEND + 154: L LONG -2147483648 + 168: a APPEND + 169: ( MARK + 170: V UNICODE 'abc' + 175: p PUT 4 + 178: g GET 4 + 181: c GLOBAL 'copyreg _reconstructor' + 205: p PUT 5 + 208: ( MARK + 209: c GLOBAL '__main__ C' + 221: p PUT 6 + 224: c GLOBAL 'builtins object' + 241: p PUT 7 + 244: N NONE + 245: t TUPLE (MARK at 208) + 246: p PUT 8 + 249: R REDUCE + 250: p PUT 9 + 253: ( MARK + 254: d DICT (MARK at 253) + 255: p PUT 10 + 259: V UNICODE 'foo' + 264: p PUT 11 + 268: L LONG 1 + 272: s SETITEM + 273: V UNICODE 'bar' + 278: p PUT 12 + 282: L LONG 2 + 286: s SETITEM + 287: b BUILD + 288: g GET 9 + 291: t TUPLE (MARK at 169) + 292: p PUT 13 + 296: a APPEND + 297: g GET 13 + 301: a APPEND + 302: L LONG 5 + 306: a APPEND + 307: . STOP highest protocol among opcodes = 0 """ @@ -545,6 +545,16 @@ got = self.loads(p) self.assertEqual(n, got) + def test_float(self): + test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5, + 3.14, 263.44582062374053, 6.022e23, 1e30] + test_values = test_values + [-x for x in test_values] + for proto in protocols: + for value in test_values: + pickle = self.dumps(value, proto) + got = self.loads(pickle) + self.assertEqual(value, got) + @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_float_format(self): # make sure that floats are formatted locale independent with proto 0 Modified: python/branches/py3k-issue1717/Lib/test/support.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/support.py (original) +++ python/branches/py3k-issue1717/Lib/test/support.py Sun Jan 25 21:08:20 2009 @@ -344,6 +344,18 @@ withcommas = ", ".join(reprpairs) return "{%s}" % withcommas +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + def check_syntax_error(testcase, statement): try: compile(statement, '', 'exec') Modified: python/branches/py3k-issue1717/Lib/test/test_ast.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_ast.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_ast.py Sun Jan 25 21:08:20 2009 @@ -265,6 +265,12 @@ self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None)) self.assertRaises(ValueError, ast.literal_eval, 'foo()') + def test_literal_eval_issue4907(self): + self.assertEqual(ast.literal_eval('2j'), 2j) + self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j) + self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j) + self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)') + def test_main(): support.run_unittest(AST_Tests, ASTHelpers_Test) Modified: python/branches/py3k-issue1717/Lib/test/test_binop.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_binop.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_binop.py Sun Jan 25 21:08:20 2009 @@ -77,12 +77,6 @@ repr(self)) raise ValueError("can't convert %s to int" % repr(self)) - def __long__(self): - """Convert a Rat to an long; self.den must be 1.""" - if self.__den == 1: - return int(self.__num) - raise ValueError("can't convert %s to long" % repr(self)) - def __add__(self, other): """Add two Rats, or a Rat and a number.""" if isint(other): Modified: python/branches/py3k-issue1717/Lib/test/test_bz2.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_bz2.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_bz2.py Sun Jan 25 21:08:20 2009 @@ -258,6 +258,28 @@ bz2f.close() self.assertEqual(xlines, [b'Test']) + def testContextProtocol(self): + # BZ2File supports the context management protocol + f = None + with BZ2File(self.filename, "wb") as f: + f.write(b"xxx") + f = BZ2File(self.filename, "rb") + f.close() + try: + with f: + pass + except ValueError: + pass + else: + self.fail("__enter__ on a closed file didn't raise an exception") + try: + with BZ2File(self.filename, "wb") as f: + 1/0 + except ZeroDivisionError: + pass + else: + self.fail("1/0 didn't raise an exception") + class BZ2CompressorTest(BaseTest): def testCompress(self): Modified: python/branches/py3k-issue1717/Lib/test/test_capi.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_capi.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_capi.py Sun Jan 25 21:08:20 2009 @@ -1,11 +1,16 @@ # Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. +from __future__ import with_statement import sys +import time +import random import unittest +import threading from test import support import _testcapi + def testfunction(self): """some doc""" return self @@ -28,6 +33,89 @@ self.assertRaises(AttributeError, setattr, inst.testfunction, "attribute", "test") +class TestPendingCalls(unittest.TestCase): + + def pendingcalls_submit(self, l, n): + def callback(): + #this function can be interrupted by thread switching so let's + #use an atomic operation + l.append(None) + + for i in range(n): + time.sleep(random.random()*0.02) #0.01 secs on average + #try submitting callback until successful. + #rely on regular interrupt to flush queue if we are + #unsuccessful. + while True: + if _testcapi._pending_threadfunc(callback): + break; + + def pendingcalls_wait(self, l, n, context = None): + #now, stick around until l[0] has grown to 10 + count = 0; + while len(l) != n: + #this busy loop is where we expect to be interrupted to + #run our callbacks. Note that callbacks are only run on the + #main thread + if False and support.verbose: + print("(%i)"%(len(l),),) + for i in range(1000): + a = i*i + if context and not context.event.is_set(): + continue + count += 1 + self.failUnless(count < 10000, + "timeout waiting for %i callbacks, got %i"%(n, len(l))) + if False and support.verbose: + print("(%i)"%(len(l),)) + + def test_pendingcalls_threaded(self): + + #do every callback on a separate thread + n = 32 #total callbacks + threads = [] + class foo(object):pass + context = foo() + context.l = [] + context.n = 2 #submits per thread + context.nThreads = n // context.n + context.nFinished = 0 + context.lock = threading.Lock() + context.event = threading.Event() + + for i in range(context.nThreads): + t = threading.Thread(target=self.pendingcalls_thread, args = (context,)) + t.start() + threads.append(t) + + self.pendingcalls_wait(context.l, n, context) + + for t in threads: + t.join() + + def pendingcalls_thread(self, context): + try: + self.pendingcalls_submit(context.l, context.n) + finally: + with context.lock: + context.nFinished += 1 + nFinished = context.nFinished + if False and support.verbose: + print("finished threads: ", nFinished) + if nFinished == context.nThreads: + context.event.set() + + def test_pendingcalls_non_threaded(self): + #again, just using the main thread, likely they will all be dispathced at + #once. It is ok to ask for too many, because we loop until we find a slot. + #the loop can be interrupted to dispatch. + #there are only 32 dispatch slots, so we go for twice that! + l = [] + n = 64 + self.pendingcalls_submit(l, n) + self.pendingcalls_wait(l, n) + + def test_main(): support.run_unittest(CAPITest) @@ -71,6 +159,8 @@ t.start() t.join() + support.run_unittest(TestPendingCalls) + if __name__ == "__main__": test_main() Modified: python/branches/py3k-issue1717/Lib/test/test_cmath.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_cmath.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_cmath.py Sun Jan 25 21:08:20 2009 @@ -182,11 +182,9 @@ pass class MyInt(object): def __int__(self): return 2 - def __long__(self): return 2 def __index__(self): return 2 class MyIntOS: def __int__(self): return 2 - def __long__(self): return 2 def __index__(self): return 2 # other possible combinations of __float__ and __complex__ @@ -219,7 +217,7 @@ self.assertEqual(f(JustFloatOS()), f(flt_arg)) # TypeError should be raised for classes not providing # either __complex__ or __float__, even if they provide - # __int__, __long__ or __index__. An old-style class + # __int__ or __index__. An old-style class # currently raises AttributeError instead of a TypeError; # this could be considered a bug. self.assertRaises(TypeError, f, NeitherComplexNorFloat()) Modified: python/branches/py3k-issue1717/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_cmd_line.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_cmd_line.py Sun Jan 25 21:08:20 2009 @@ -142,6 +142,23 @@ self.exit_code('-c', command), 0) + def test_unbuffered_output(self): + # Test expected operation of the '-u' switch + for stream in ('stdout', 'stderr'): + # Binary is unbuffered + code = ("import os, sys; sys.%s.buffer.write(b'x'); os._exit(0)" + % stream) + data, rc = self.start_python_and_exit_code('-u', '-c', code) + self.assertEqual(rc, 0) + self.assertEqual(data, b'x', "binary %s not unbuffered" % stream) + # Text is line-buffered + code = ("import os, sys; sys.%s.write('x\\n'); os._exit(0)" + % stream) + data, rc = self.start_python_and_exit_code('-u', '-c', code) + self.assertEqual(rc, 0) + self.assertEqual(data.strip(), b'x', + "text %s not line-buffered" % stream) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py Sun Jan 25 21:08:20 2009 @@ -592,7 +592,7 @@ encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15") for res in results: - codecs.register_error("test.badhandler", lambda: res) + codecs.register_error("test.badhandler", lambda x: res) for enc in encs: self.assertRaises( TypeError, Modified: python/branches/py3k-issue1717/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_codecs.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_codecs.py Sun Jan 25 21:08:20 2009 @@ -1475,6 +1475,36 @@ info.streamwriter, 'strict') as srw: self.assertEquals(srw.read(), "\xfc") +class TypesTest(unittest.TestCase): + def test_decode_unicode(self): + # Most decoders don't accept unicode input + decoders = [ + codecs.utf_7_decode, + codecs.utf_8_decode, + codecs.utf_16_le_decode, + codecs.utf_16_be_decode, + codecs.utf_16_ex_decode, + codecs.utf_32_decode, + codecs.utf_32_le_decode, + codecs.utf_32_be_decode, + codecs.utf_32_ex_decode, + codecs.latin_1_decode, + codecs.ascii_decode, + codecs.charmap_decode, + ] + if hasattr(codecs, "mbcs_decode"): + decoders.append(codecs.mbcs_decode) + for decoder in decoders: + self.assertRaises(TypeError, decoder, "xxx") + + def test_unicode_escape(self): + # Escape-decoding an unicode string is supported ang gives the same + # result as decoding the equivalent ASCII bytes string. + self.assertEquals(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + def test_main(): support.run_unittest( @@ -1501,6 +1531,7 @@ BasicUnicodeTest, CharmapTest, WithStmtTest, + TypesTest, ) Modified: python/branches/py3k-issue1717/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_collections.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_collections.py Sun Jan 25 21:08:20 2009 @@ -2,8 +2,10 @@ import unittest, doctest from test import support -from collections import namedtuple +from collections import namedtuple, Counter, Mapping import pickle, copy +from random import randrange +import operator from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -357,11 +359,150 @@ self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(str, MutableSequence)) +class TestCounter(unittest.TestCase): + + def test_basics(self): + c = Counter('abcaba') + self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1})) + self.assertEqual(c, Counter(a=3, b=2, c=1)) + self.assert_(isinstance(c, dict)) + self.assert_(isinstance(c, Mapping)) + self.assert_(issubclass(Counter, dict)) + self.assert_(issubclass(Counter, Mapping)) + self.assertEqual(len(c), 3) + self.assertEqual(sum(c.values()), 6) + self.assertEqual(sorted(c.values()), [1, 2, 3]) + self.assertEqual(sorted(c.keys()), ['a', 'b', 'c']) + self.assertEqual(sorted(c), ['a', 'b', 'c']) + self.assertEqual(sorted(c.items()), + [('a', 3), ('b', 2), ('c', 1)]) + self.assertEqual(c['b'], 2) + self.assertEqual(c['z'], 0) + self.assertEqual(c.__contains__('c'), True) + self.assertEqual(c.__contains__('z'), False) + self.assertEqual(c.get('b', 10), 2) + self.assertEqual(c.get('z', 10), 10) + self.assertEqual(c, dict(a=3, b=2, c=1)) + self.assertEqual(repr(c), "Counter({'a': 3, 'b': 2, 'c': 1})") + self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)]) + for i in range(5): + self.assertEqual(c.most_common(i), + [('a', 3), ('b', 2), ('c', 1)][:i]) + self.assertEqual(''.join(sorted(c.elements())), 'aaabbc') + c['a'] += 1 # increment an existing value + c['b'] -= 2 # sub existing value to zero + del c['c'] # remove an entry + del c['c'] # make sure that del doesn't raise KeyError + c['d'] -= 2 # sub from a missing value + c['e'] = -5 # directly assign a missing value + c['f'] += 4 # add to a missing value + self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4)) + self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff') + self.assertEqual(c.pop('f'), 4) + self.assertEqual('f' in c, False) + for i in range(3): + elem, cnt = c.popitem() + self.assertEqual(elem in c, False) + c.clear() + self.assertEqual(c, {}) + self.assertEqual(repr(c), 'Counter()') + self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc') + self.assertRaises(TypeError, hash, c) + c.update(dict(a=5, b=3)) + c.update(c=1) + c.update(Counter('a' * 50 + 'b' * 30)) + c.update() # test case with no args + c.__init__('a' * 500 + 'b' * 300) + c.__init__('cdc') + c.__init__() + self.assertEqual(c, dict(a=555, b=333, c=3, d=1)) + self.assertEqual(c.setdefault('d', 5), 1) + self.assertEqual(c['d'], 1) + self.assertEqual(c.setdefault('e', 5), 5) + self.assertEqual(c['e'], 5) + + def test_copying(self): + # Check that counters are copyable, deepcopyable, picklable, and + #have a repr/eval round-trip + words = Counter('which witch had which witches wrist watch'.split()) + update_test = Counter() + update_test.update(words) + for i, dup in enumerate([ + words.copy(), + copy.copy(words), + copy.deepcopy(words), + pickle.loads(pickle.dumps(words, 0)), + pickle.loads(pickle.dumps(words, 1)), + pickle.loads(pickle.dumps(words, 2)), + pickle.loads(pickle.dumps(words, -1)), + eval(repr(words)), + update_test, + Counter(words), + ]): + msg = (i, dup, words) + self.assert_(dup is not words) + self.assertEquals(dup, words) + self.assertEquals(len(dup), len(words)) + self.assertEquals(type(dup), type(words)) + + def test_conversions(self): + # Convert to: set, list, dict + s = 'she sells sea shells by the sea shore' + self.assertEqual(sorted(Counter(s).elements()), sorted(s)) + self.assertEqual(sorted(Counter(s)), sorted(set(s))) + self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) + self.assertEqual(set(Counter(s)), set(s)) + + def test_invariant_for_the_in_operator(self): + c = Counter(a=10, b=-2, c=0) + for elem in c: + self.assert_(elem in c) + + def test_multiset_operations(self): + # Verify that adding a zero counter will strip zeros and negatives + c = Counter(a=10, b=-2, c=0) + Counter() + self.assertEqual(dict(c), dict(a=10)) + + elements = 'abcd' + for i in range(1000): + # test random pairs of multisets + p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + p.update(e=1, f=-1, g=0) + q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + q.update(h=1, i=-1, j=0) + for counterop, numberop in [ + (Counter.__add__, lambda x, y: max(0, x+y)), + (Counter.__sub__, lambda x, y: max(0, x-y)), + (Counter.__or__, lambda x, y: max(0,x,y)), + (Counter.__and__, lambda x, y: max(0, min(x,y))), + ]: + result = counterop(p, q) + for x in elements: + self.assertEqual(numberop(p[x], q[x]), result[x], + (counterop, x, p, q)) + # verify that results exclude non-positive counts + self.assert_(x>0 for x in result.values()) + + elements = 'abcdef' + for i in range(100): + # verify that random multisets with no repeats are exactly like sets + p = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + q = Counter(dict((elem, randrange(0, 2)) for elem in elements)) + for counterop, setop in [ + (Counter.__sub__, set.__sub__), + (Counter.__or__, set.__or__), + (Counter.__and__, set.__and__), + ]: + counter_result = counterop(p, q) + set_result = setop(set(p.elements()), set(q.elements())) + self.assertEqual(counter_result, dict.fromkeys(set_result, 1)) + import doctest, collections def test_main(verbose=None): NamedTupleDocs = doctest.DocTestSuite(module=collections) - test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs] + test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, + TestCollectionABCs, TestCounter] support.run_unittest(*test_classes) support.run_doctest(collections, verbose) Modified: python/branches/py3k-issue1717/Lib/test/test_datetime.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_datetime.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_datetime.py Sun Jan 25 21:08:20 2009 @@ -845,6 +845,23 @@ # A naive object replaces %z and %Z w/ empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + #make sure that invalid format specifiers are handled correctly + #self.assertRaises(ValueError, t.strftime, "%e") + #self.assertRaises(ValueError, t.strftime, "%") + #self.assertRaises(ValueError, t.strftime, "%#") + + #oh well, some systems just ignore those invalid ones. + #at least, excercise them to make sure that no crashes + #are generated + for f in ["%e", "%", "%#"]: + try: + t.strftime(f) + except ValueError: + pass + + #check that this standard extension works + t.strftime("%f") + def test_format(self): dt = self.theclass(2007, 9, 10) Modified: python/branches/py3k-issue1717/Lib/test/test_decimal.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_decimal.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_decimal.py Sun Jan 25 21:08:20 2009 @@ -168,7 +168,6 @@ -context.Emin > DEC_MAX_MATH): return True if not v._is_special and v and ( - len(v._int) > DEC_MAX_MATH or v.adjusted() > DEC_MAX_MATH or v.adjusted() < 1-2*DEC_MAX_MATH): return True @@ -1415,6 +1414,55 @@ r = d.to_integral(ROUND_DOWN) self.assertEqual(Decimal(math.trunc(d)), r) + def test_from_float(self): + + class MyDecimal(Decimal): + pass + + r = MyDecimal.from_float(0.1) + self.assertEqual(type(r), MyDecimal) + self.assertEqual(str(r), + '0.1000000000000000055511151231257827021181583404541015625') + bigint = 12345678901234567890123456789 + self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) + self.assert_(MyDecimal.from_float(float('nan')).is_qnan()) + self.assert_(MyDecimal.from_float(float('inf')).is_infinite()) + self.assert_(MyDecimal.from_float(float('-inf')).is_infinite()) + self.assertEqual(str(MyDecimal.from_float(float('nan'))), + str(Decimal('NaN'))) + self.assertEqual(str(MyDecimal.from_float(float('inf'))), + str(Decimal('Infinity'))) + self.assertEqual(str(MyDecimal.from_float(float('-inf'))), + str(Decimal('-Infinity'))) + self.assertRaises(TypeError, MyDecimal.from_float, 'abc') + for i in range(200): + x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0) + self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip + + def test_create_decimal_from_float(self): + context = Context(prec=5, rounding=ROUND_DOWN) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1415') + ) + context = Context(prec=5, rounding=ROUND_UP) + self.assertEqual( + context.create_decimal_from_float(math.pi), + Decimal('3.1416') + ) + context = Context(prec=5, traps=[Inexact]) + self.assertRaises( + Inexact, + context.create_decimal_from_float, + math.pi + ) + self.assertEqual(repr(context.create_decimal_from_float(-0.0)), + "Decimal('-0')") + self.assertEqual(repr(context.create_decimal_from_float(1.0)), + "Decimal('1')") + self.assertEqual(repr(context.create_decimal_from_float(10)), + "Decimal('10')") + class ContextAPItests(unittest.TestCase): def test_pickle(self): Modified: python/branches/py3k-issue1717/Lib/test/test_fileio.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_fileio.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_fileio.py Sun Jan 25 21:08:20 2009 @@ -6,7 +6,8 @@ from array import array from weakref import proxy -from test.support import TESTFN, findfile, check_warnings, run_unittest +from test.support import (TESTFN, findfile, check_warnings, run_unittest, + make_bad_fd) from collections import UserList import _fileio @@ -175,6 +176,10 @@ f.close() os.unlink(TESTFN) + def testInvalidFd(self): + self.assertRaises(ValueError, _fileio._FileIO, -10) + self.assertRaises(OSError, _fileio._FileIO, make_bad_fd()) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" Modified: python/branches/py3k-issue1717/Lib/test/test_fractions.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_fractions.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_fractions.py Sun Jan 25 21:08:20 2009 @@ -136,6 +136,8 @@ def testFromFloat(self): self.assertRaises(TypeError, F.from_float, 3+4j) self.assertEquals((10, 1), _components(F.from_float(10))) + bigint = 1234567890123456789 + self.assertEquals((bigint, 1), _components(F.from_float(bigint))) self.assertEquals((0, 1), _components(F.from_float(-0.0))) self.assertEquals((10, 1), _components(F.from_float(10.0))) self.assertEquals((-5, 2), _components(F.from_float(-2.5))) Modified: python/branches/py3k-issue1717/Lib/test/test_gzip.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_gzip.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_gzip.py Sun Jan 25 21:08:20 2009 @@ -6,6 +6,7 @@ from test import support import os import gzip +import struct data1 = b""" int length=DEFAULTALLOC, err = Z_OK; @@ -160,6 +161,88 @@ self.assertEqual(f.name, self.filename) f.close() + def test_mtime(self): + mtime = 123456789 + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + fRead = gzip.GzipFile(self.filename) + dataRead = fRead.read() + self.assertEqual(dataRead, data1) + self.assert_(hasattr(fRead, 'mtime')) + self.assertEqual(fRead.mtime, mtime) + fRead.close() + + def test_metadata(self): + mtime = 123456789 + + fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime) + fWrite.write(data1) + fWrite.close() + + fRead = open(self.filename, 'rb') + + # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html + + idBytes = fRead.read(2) + self.assertEqual(idBytes, b'\x1f\x8b') # gzip ID + + cmByte = fRead.read(1) + self.assertEqual(cmByte, b'\x08') # deflate + + flagsByte = fRead.read(1) + self.assertEqual(flagsByte, b'\x08') # only the FNAME flag is set + + mtimeBytes = fRead.read(4) + self.assertEqual(mtimeBytes, struct.pack(' 0) + def test_destructor(self): record = [] class MyFileIO(io.FileIO): @@ -260,7 +271,7 @@ def test_array_writes(self): a = array.array('i', range(10)) - n = len(memoryview(a)) + n = len(a.tostring()) f = io.open(support.TESTFN, "wb", 0) self.assertEqual(f.write(a), n) f.close() @@ -1021,6 +1032,10 @@ def testSeekAndTell(self): """Test seek/tell using the StatefulIncrementalDecoder.""" + # Make this test faster by forcing a smaller (but large enough) + # chunk size. The bigger the chunker size, the slower seek() is, + # as it tries to replay character decoding one byte at a time. + CHUNK_SIZE = 256 def testSeekAndTellWithData(data, min_pos=0): """Tell/seek to various points within a data stream and ensure @@ -1035,6 +1050,7 @@ 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._CHUNK_SIZE = CHUNK_SIZE self.assertEquals(f.read(i), decoded[:i]) cookie = f.tell() self.assertEquals(f.read(j), decoded[i:i + j]) @@ -1052,7 +1068,6 @@ testSeekAndTellWithData(input) # Position each test case so that it crosses a chunk boundary. - CHUNK_SIZE = io.TextIOWrapper._CHUNK_SIZE for input, _, _ in StatefulIncrementalDecoderTest.test_cases: offset = CHUNK_SIZE - len(input)//2 prefix = b'.'*offset @@ -1324,6 +1339,45 @@ f.close() g.close() + def test_io_after_close(self): + for kwargs in [ + {"mode": "w"}, + {"mode": "wb"}, + {"mode": "w", "buffering": 1}, + {"mode": "w", "buffering": 2}, + {"mode": "wb", "buffering": 0}, + {"mode": "r"}, + {"mode": "rb"}, + {"mode": "r", "buffering": 1}, + {"mode": "r", "buffering": 2}, + {"mode": "rb", "buffering": 0}, + {"mode": "w+"}, + {"mode": "w+b"}, + {"mode": "w+", "buffering": 1}, + {"mode": "w+", "buffering": 2}, + {"mode": "w+b", "buffering": 0}, + ]: + f = io.open(support.TESTFN, **kwargs) + f.close() + self.assertRaises(ValueError, f.flush) + self.assertRaises(ValueError, f.fileno) + self.assertRaises(ValueError, f.isatty) + self.assertRaises(ValueError, f.__iter__) + if hasattr(f, "peek"): + self.assertRaises(ValueError, f.peek, 1) + self.assertRaises(ValueError, f.read) + if hasattr(f, "read1"): + self.assertRaises(ValueError, f.read1, 1024) + if hasattr(f, "readinto"): + self.assertRaises(ValueError, f.readinto, bytearray(1024)) + self.assertRaises(ValueError, f.readline) + self.assertRaises(ValueError, f.readlines) + self.assertRaises(ValueError, f.seek, 0) + self.assertRaises(ValueError, f.tell) + self.assertRaises(ValueError, f.truncate) + self.assertRaises(ValueError, f.write, "") + self.assertRaises(ValueError, f.writelines, []) + def test_main(): support.run_unittest(IOTest, BytesIOTest, StringIOTest, Modified: python/branches/py3k-issue1717/Lib/test/test_iter.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_iter.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_iter.py Sun Jan 25 21:08:20 2009 @@ -120,6 +120,13 @@ def test_seq_class_iter(self): self.check_iterator(iter(SequenceClass(10)), list(range(10))) + # Test a new_style class with __iter__ but no next() method + def test_new_style_iter_class(self): + class IterClass(object): + def __iter__(self): + return self + self.assertRaises(TypeError, iter, IterClass()) + # Test two-argument iter() with callable instance def test_iter_callable(self): class C: @@ -853,6 +860,21 @@ self.assertEqual(list(b), list(zip(range(5), range(5)))) self.assertEqual(list(b), []) + def test_3720(self): + # Avoid a crash, when an iterator deletes its next() method. + class BadIterator(object): + def __iter__(self): + return self + def __next__(self): + del BadIterator.__next__ + return 1 + + try: + for i in BadIterator() : + pass + except TypeError: + pass + def test_main(): run_unittest(TestCase) Modified: python/branches/py3k-issue1717/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_itertools.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_itertools.py Sun Jan 25 21:08:20 2009 @@ -75,11 +75,11 @@ self.assertRaises(TypeError, list, chain.from_iterable([2, 3])) def test_combinations(self): - self.assertRaises(TypeError, combinations, 'abc') # missing r argument + self.assertRaises(TypeError, combinations, 'abc') # missing r argument self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, combinations, None) # pool is not iterable self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative - self.assertRaises(ValueError, combinations, 'abc', 32) # r is too big + self.assertEqual(list(combinations('abc', 32)), []) # r > n self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) @@ -87,6 +87,8 @@ 'Pure python version shown in the docs' pool = tuple(iterable) n = len(pool) + if r > n: + return indices = list(range(r)) yield tuple(pool[i] for i in indices) while 1: @@ -110,9 +112,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(combinations(values, r)) - self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for c in result: @@ -123,7 +125,7 @@ self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version - self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version + self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -134,7 +136,7 @@ self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments self.assertRaises(TypeError, permutations, None) # pool is not iterable self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative - self.assertRaises(ValueError, permutations, 'abc', 32) # r is too big + self.assertEqual(list(permutations('abc', 32)), []) # r > n self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None self.assertEqual(list(permutations(range(3), 2)), [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)]) @@ -144,6 +146,8 @@ pool = tuple(iterable) n = len(pool) r = n if r is None else r + if r > n: + return indices = list(range(n)) cycles = list(range(n-r+1, n+1))[::-1] yield tuple(pool[i] for i in indices[:r]) @@ -172,9 +176,9 @@ for n in range(7): values = [5*x-12 for x in range(n)] - for r in range(n+1): + for r in range(n+2): result = list(permutations(values, r)) - self.assertEqual(len(result), fact(n) / fact(n-r)) # right number of perms + self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r)) # right number of perms self.assertEqual(len(result), len(set(result))) # no repeats self.assertEqual(result, sorted(result)) # lexicographic order for p in result: @@ -182,7 +186,7 @@ self.assertEqual(len(set(p)), r) # no duplicate elements self.assert_(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version - self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version + self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: self.assertEqual(result, list(permutations(values, None))) # test r as None self.assertEqual(result, list(permutations(values))) # test default r @@ -1298,6 +1302,30 @@ ... 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))) + This is not part of the examples but it tests to make sure the definitions perform as purported. @@ -1360,6 +1388,38 @@ >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] +>>> list(combinations_with_replacement('01', 3)) +[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] + +>>> def combinations_with_replacement2(iterable, r): +... 'Alternate version that filters from product()' +... pool = tuple(iterable) +... n = len(pool) +... for indices in product(range(n), repeat=r): +... if sorted(indices) == list(indices): +... yield tuple(pool[i] for i in indices) + +>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) +True + +>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +True + +>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +True + +>>> list(unique_everseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D'] + +>>> list(unique_everseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'D'] + +>>> list(unique_justseen('AAAABBBCCDAABBB')) +['A', 'B', 'C', 'D', 'A', 'B'] + +>>> list(unique_justseen('ABBCcAD', str.lower)) +['A', 'B', 'C', 'A', 'D'] + """ __test__ = {'libreftest' : libreftest} Modified: python/branches/py3k-issue1717/Lib/test/test_kqueue.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_kqueue.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_kqueue.py Sun Jan 25 21:08:20 2009 @@ -121,12 +121,15 @@ client.send(b"Hello!") server.send(b"world!!!") - events = kq.control(None, 4, 1) # We may need to call it several times - for i in range(5): + for i in range(10): + events = kq.control(None, 4, 1) if len(events) == 4: break - events = kq.control(None, 4, 1) + time.sleep(1.0) + else: + self.fail('timeout waiting for event notifications') + events = [(e.ident, e.filter, e.flags) for e in events] events.sort() Modified: python/branches/py3k-issue1717/Lib/test/test_long.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_long.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_long.py Sun Jan 25 21:08:20 2009 @@ -284,6 +284,16 @@ self.assertRaises(ValueError, int, '123\0') self.assertRaises(ValueError, int, '53', 40) + # trailing L should no longer be accepted... + self.assertRaises(ValueError, int, '123L') + self.assertRaises(ValueError, int, '123l') + self.assertRaises(ValueError, int, '0L') + self.assertRaises(ValueError, int, '-37L') + self.assertRaises(ValueError, int, '0x32L', 16) + self.assertRaises(ValueError, int, '1L', 21) + # ... but it's just a normal digit if base >= 22 + self.assertEqual(int('1L', 22), 43) + self.assertRaises(TypeError, int, 1, 12) # SF patch #1638879: embedded NULs were not detected with @@ -367,7 +377,7 @@ def test_conversion(self): - # Test __long__() + # Test __int__() class ClassicMissingMethods: pass self.assertRaises(TypeError, int, ClassicMissingMethods()) @@ -410,18 +420,32 @@ class Classic: pass for base in (object, Classic): - class LongOverridesTrunc(base): - def __long__(self): + class IntOverridesTrunc(base): + def __int__(self): return 42 def __trunc__(self): return -12 - self.assertEqual(int(LongOverridesTrunc()), 42) + self.assertEqual(int(IntOverridesTrunc()), 42) class JustTrunc(base): def __trunc__(self): return 42 self.assertEqual(int(JustTrunc()), 42) + class JustLong(base): + # test that __long__ no longer used in 3.x + def __long__(self): + return 42 + self.assertRaises(TypeError, int, JustLong()) + + class LongTrunc(base): + # __long__ should be ignored in 3.x + def __long__(self): + return 42 + def __trunc__(self): + return 1729 + self.assertEqual(int(LongTrunc()), 1729) + for trunc_result_base in (object, Classic): class Integral(trunc_result_base): def __int__(self): Modified: python/branches/py3k-issue1717/Lib/test/test_memoryview.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_memoryview.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_memoryview.py Sun Jan 25 21:08:20 2009 @@ -8,24 +8,30 @@ import sys import gc import weakref +import array -class CommonMemoryTests: - # - # Tests common to direct memoryviews and sliced memoryviews - # +class AbstractMemoryTests: + source_bytes = b"abcdef" - base_object = b"abcdef" + @property + def _source(self): + return self.source_bytes + + @property + def _types(self): + return filter(None, [self.ro_type, self.rw_type]) def check_getitem_with_type(self, tp): - b = tp(self.base_object) + item = self.getitem_type + b = tp(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) - self.assertEquals(m[0], b"a") + self.assertEquals(m[0], item(b"a")) self.assert_(isinstance(m[0], bytes), type(m[0])) - self.assertEquals(m[5], b"f") - self.assertEquals(m[-1], b"f") - self.assertEquals(m[-6], b"a") + self.assertEquals(m[5], item(b"f")) + self.assertEquals(m[-1], item(b"f")) + self.assertEquals(m[-6], item(b"a")) # Bounds checking self.assertRaises(IndexError, lambda: m[6]) self.assertRaises(IndexError, lambda: m[-7]) @@ -38,14 +44,14 @@ m = None self.assertEquals(sys.getrefcount(b), oldrefcount) - def test_getitem_readonly(self): - self.check_getitem_with_type(bytes) - - def test_getitem_writable(self): - self.check_getitem_with_type(bytearray) + def test_getitem(self): + for tp in self._types: + self.check_getitem_with_type(tp) def test_setitem_readonly(self): - b = self.base_object + if not self.ro_type: + return + b = self.ro_type(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) def setitem(value): @@ -57,27 +63,30 @@ self.assertEquals(sys.getrefcount(b), oldrefcount) def test_setitem_writable(self): - b = bytearray(self.base_object) + if not self.rw_type: + return + tp = self.rw_type + b = self.rw_type(self._source) oldrefcount = sys.getrefcount(b) m = self._view(b) - m[0] = b"0" - self._check_contents(b, b"0bcdef") - m[1:3] = b"12" - self._check_contents(b, b"012def") - m[1:1] = b"" - self._check_contents(b, b"012def") - m[:] = b"abcdef" - self._check_contents(b, b"abcdef") + m[0] = tp(b"0") + self._check_contents(tp, b, b"0bcdef") + m[1:3] = tp(b"12") + self._check_contents(tp, b, b"012def") + m[1:1] = tp(b"") + self._check_contents(tp, b, b"012def") + m[:] = tp(b"abcdef") + self._check_contents(tp, b, b"abcdef") # Overlapping copies of a view into itself m[0:3] = m[2:5] - self._check_contents(b, b"cdedef") - m[:] = b"abcdef" + self._check_contents(tp, b, b"cdedef") + m[:] = tp(b"abcdef") m[2:5] = m[0:3] - self._check_contents(b, b"ababcf") + self._check_contents(tp, b, b"ababcf") def setitem(key, value): - m[key] = value + m[key] = tp(value) # Bounds checking self.assertRaises(IndexError, setitem, 6, b"a") self.assertRaises(IndexError, setitem, -7, b"a") @@ -96,159 +105,224 @@ m = None self.assertEquals(sys.getrefcount(b), oldrefcount) - def test_len(self): - self.assertEquals(len(self._view(self.base_object)), 6) - def test_tobytes(self): - m = self._view(self.base_object) - b = m.tobytes() - self.assertEquals(b, b"abcdef") - self.assert_(isinstance(b, bytes), type(b)) + for tp in self._types: + m = self._view(tp(self._source)) + b = m.tobytes() + # This calls self.getitem_type() on each separate byte of b"abcdef" + expected = b"".join( + self.getitem_type(bytes([c])) for c in b"abcdef") + self.assertEquals(b, expected) + self.assert_(isinstance(b, bytes), type(b)) def test_tolist(self): - m = self._view(self.base_object) - l = m.tolist() - self.assertEquals(l, list(b"abcdef")) + for tp in self._types: + m = self._view(tp(self._source)) + l = m.tolist() + self.assertEquals(l, list(b"abcdef")) def test_compare(self): # memoryviews can compare for equality with other objects # having the buffer interface. - m = self._view(self.base_object) - for tp in (bytes, bytearray): - self.assertTrue(m == tp(b"abcdef")) - self.assertFalse(m != tp(b"abcdef")) - self.assertFalse(m == tp(b"abcde")) - self.assertTrue(m != tp(b"abcde")) - self.assertFalse(m == tp(b"abcde1")) - self.assertTrue(m != tp(b"abcde1")) - self.assertTrue(m == m) - self.assertTrue(m == m[:]) - self.assertTrue(m[0:6] == m[:]) - self.assertFalse(m[0:5] == m) - - # Comparison with objects which don't support the buffer API - self.assertFalse(m == "abc") - self.assertTrue(m != "abc") - self.assertFalse("abc" == m) - self.assertTrue("abc" != m) - - # Unordered comparisons - for c in (m, b"abcdef"): - self.assertRaises(TypeError, lambda: m < c) - self.assertRaises(TypeError, lambda: c <= m) - self.assertRaises(TypeError, lambda: m >= c) - self.assertRaises(TypeError, lambda: c > m) + for tp in self._types: + m = self._view(tp(self._source)) + for tp_comp in self._types: + self.assertTrue(m == tp_comp(b"abcdef")) + self.assertFalse(m != tp_comp(b"abcdef")) + self.assertFalse(m == tp_comp(b"abcde")) + self.assertTrue(m != tp_comp(b"abcde")) + self.assertFalse(m == tp_comp(b"abcde1")) + self.assertTrue(m != tp_comp(b"abcde1")) + self.assertTrue(m == m) + self.assertTrue(m == m[:]) + self.assertTrue(m[0:6] == m[:]) + self.assertFalse(m[0:5] == m) + + # Comparison with objects which don't support the buffer API + self.assertFalse(m == "abcdef") + self.assertTrue(m != "abcdef") + self.assertFalse("abcdef" == m) + self.assertTrue("abcdef" != m) + + # Unordered comparisons + for c in (m, b"abcdef"): + self.assertRaises(TypeError, lambda: m < c) + self.assertRaises(TypeError, lambda: c <= m) + self.assertRaises(TypeError, lambda: m >= c) + self.assertRaises(TypeError, lambda: c > m) def check_attributes_with_type(self, tp): - b = tp(self.base_object) - m = self._view(b) - self.assertEquals(m.format, 'B') - self.assertEquals(m.itemsize, 1) + m = self._view(tp(self._source)) + self.assertEquals(m.format, self.format) + self.assertEquals(m.itemsize, self.itemsize) self.assertEquals(m.ndim, 1) self.assertEquals(m.shape, (6,)) self.assertEquals(len(m), 6) - self.assertEquals(m.strides, (1,)) + self.assertEquals(m.strides, (self.itemsize,)) self.assertEquals(m.suboffsets, None) return m def test_attributes_readonly(self): - m = self.check_attributes_with_type(bytes) + if not self.ro_type: + return + m = self.check_attributes_with_type(self.ro_type) self.assertEquals(m.readonly, True) def test_attributes_writable(self): - m = self.check_attributes_with_type(bytearray) + if not self.rw_type: + return + m = self.check_attributes_with_type(self.rw_type) self.assertEquals(m.readonly, False) def test_getbuffer(self): # Test PyObject_GetBuffer() on a memoryview object. - b = self.base_object - oldrefcount = sys.getrefcount(b) - m = self._view(b) - oldviewrefcount = sys.getrefcount(m) - s = str(m, "utf-8") - self._check_contents(b, s.encode("utf-8")) - self.assertEquals(sys.getrefcount(m), oldviewrefcount) - m = None - self.assertEquals(sys.getrefcount(b), oldrefcount) + for tp in self._types: + b = tp(self._source) + oldrefcount = sys.getrefcount(b) + m = self._view(b) + oldviewrefcount = sys.getrefcount(m) + s = str(m, "utf-8") + self._check_contents(tp, b, s.encode("utf-8")) + self.assertEquals(sys.getrefcount(m), oldviewrefcount) + m = None + self.assertEquals(sys.getrefcount(b), oldrefcount) def test_gc(self): - class MyBytes(bytes): - pass - class MyObject: - pass + for tp in self._types: + if not isinstance(tp, type): + # If tp is a factory rather than a plain type, skip + continue + + class MySource(tp): + pass + class MyObject: + pass + + # Create a reference cycle through a memoryview object + b = MySource(tp(b'abc')) + m = self._view(b) + o = MyObject() + b.m = m + b.o = o + wr = weakref.ref(o) + b = m = o = None + # The cycle must be broken + gc.collect() + self.assert_(wr() is None, wr()) + + +# Variations on source objects for the buffer: bytes-like objects, then arrays +# with itemsize > 1. +# NOTE: support for multi-dimensional objects is unimplemented. + +class BaseBytesMemoryTests(AbstractMemoryTests): + ro_type = bytes + rw_type = bytearray + getitem_type = bytes + itemsize = 1 + format = 'B' + +class BaseArrayMemoryTests(AbstractMemoryTests): + ro_type = None + rw_type = lambda self, b: array.array('i', list(b)) + getitem_type = lambda self, b: array.array('i', list(b)).tostring() + itemsize = array.array('i').itemsize + format = 'i' - # Create a reference cycle through a memoryview object - b = MyBytes(b'abc') - m = self._view(b) - o = MyObject() - b.m = m - b.o = o - wr = weakref.ref(o) - b = m = o = None - # The cycle must be broken - gc.collect() - self.assert_(wr() is None, wr()) + def test_getbuffer(self): + # XXX Test should be adapted for non-byte buffers + pass + + def test_tolist(self): + # XXX NotImplementedError: tolist() only supports byte views + pass -class MemoryviewTest(unittest.TestCase, CommonMemoryTests): +# Variations on indirection levels: memoryview, slice of memoryview, +# slice of slice of memoryview. +# This is important to test allocation subtleties. +class BaseMemoryviewTests: def _view(self, obj): return memoryview(obj) - def _check_contents(self, obj, contents): - self.assertEquals(obj, contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj, tp(contents)) - def test_constructor(self): - ob = b'test' - self.assert_(memoryview(ob)) - self.assert_(memoryview(object=ob)) - self.assertRaises(TypeError, memoryview) - self.assertRaises(TypeError, memoryview, ob, ob) - self.assertRaises(TypeError, memoryview, argument=ob) - self.assertRaises(TypeError, memoryview, ob, argument=True) - - def test_array_assign(self): - # Issue #4569: segfault when mutating a memoryview with itemsize != 1 - from array import array - a = array('i', range(10)) - m = memoryview(a) - new_a = array('i', range(9, -1, -1)) - m[:] = new_a - self.assertEquals(a, new_a) - - -class MemorySliceTest(unittest.TestCase, CommonMemoryTests): - base_object = b"XabcdefY" +class BaseMemorySliceTests: + source_bytes = b"XabcdefY" def _view(self, obj): m = memoryview(obj) return m[1:7] - def _check_contents(self, obj, contents): - self.assertEquals(obj[1:7], contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj[1:7], tp(contents)) def test_refs(self): - m = memoryview(b"ab") - oldrefcount = sys.getrefcount(m) - m[1:2] - self.assertEquals(sys.getrefcount(m), oldrefcount) - + for tp in self._types: + m = memoryview(tp(self._source)) + oldrefcount = sys.getrefcount(m) + m[1:2] + self.assertEquals(sys.getrefcount(m), oldrefcount) -class MemorySliceSliceTest(unittest.TestCase, CommonMemoryTests): - base_object = b"XabcdefY" +class BaseMemorySliceSliceTests: + source_bytes = b"XabcdefY" def _view(self, obj): m = memoryview(obj) return m[:7][1:] - def _check_contents(self, obj, contents): - self.assertEquals(obj[1:7], contents) + def _check_contents(self, tp, obj, contents): + self.assertEquals(obj[1:7], tp(contents)) -def test_main(): - test.support.run_unittest( - MemoryviewTest, MemorySliceTest, MemorySliceSliceTest) +# Concrete test classes + +class BytesMemoryviewTest(unittest.TestCase, + BaseMemoryviewTests, BaseBytesMemoryTests): + + def test_constructor(self): + for tp in self._types: + ob = tp(self._source) + self.assert_(memoryview(ob)) + self.assert_(memoryview(object=ob)) + self.assertRaises(TypeError, memoryview) + self.assertRaises(TypeError, memoryview, ob, ob) + self.assertRaises(TypeError, memoryview, argument=ob) + self.assertRaises(TypeError, memoryview, ob, argument=True) + +class ArrayMemoryviewTest(unittest.TestCase, + BaseMemoryviewTests, BaseArrayMemoryTests): + + def test_array_assign(self): + # Issue #4569: segfault when mutating a memoryview with itemsize != 1 + a = array.array('i', range(10)) + m = memoryview(a) + new_a = array.array('i', range(9, -1, -1)) + m[:] = new_a + self.assertEquals(a, new_a) +class BytesMemorySliceTest(unittest.TestCase, + BaseMemorySliceTests, BaseBytesMemoryTests): + pass + +class ArrayMemorySliceTest(unittest.TestCase, + BaseMemorySliceTests, BaseArrayMemoryTests): + pass + +class BytesMemorySliceSliceTest(unittest.TestCase, + BaseMemorySliceSliceTests, BaseBytesMemoryTests): + pass + +class ArrayMemorySliceSliceTest(unittest.TestCase, + BaseMemorySliceSliceTests, BaseArrayMemoryTests): + pass + + +def test_main(): + test.support.run_unittest(__name__) + if __name__ == "__main__": test_main() Modified: python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py Sun Jan 25 21:08:20 2009 @@ -44,7 +44,7 @@ myreplace = lambda exc: ('', sys.maxsize+1) codecs.register_error('test.cjktest', myreplace) self.assertRaises(IndexError, dec, - 'apple\x92ham\x93spam', 'test.cjktest') + b'apple\x92ham\x93spam', 'test.cjktest') def test_codingspec(self): try: @@ -61,6 +61,10 @@ self.assertRaises(AttributeError, _multibytecodec.MultibyteStreamWriter, None) + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + self.assertRaises(TypeError, codecs.getdecoder(enc), "") class Test_IncrementalEncoder(unittest.TestCase): @@ -146,6 +150,12 @@ self.assertRaises(UnicodeDecodeError, decoder.decode, b'', True) self.assertEqual(decoder.decode(b'B@$'), '\u4e16') + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + decoder = codecs.getincrementaldecoder(enc)() + self.assertRaises(TypeError, decoder.decode, "") + class Test_StreamReader(unittest.TestCase): def test_bug1728403(self): try: Modified: python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py Sun Jan 25 21:08:20 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 # @@ -830,10 +832,16 @@ obj3 = val3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawValue('i', 5) + arr4 = self.Value('i', 5, lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue') + + arr5 = self.RawValue('i', 5) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) + class _TestArray(BaseTestCase): @@ -888,9 +896,15 @@ obj3 = arr3.get_obj() self.assertEqual(lock, lock3) - arr4 = self.RawArray('i', list(range(10))) + arr4 = self.Array('i', range(10), lock=False) self.assertFalse(hasattr(arr4, 'get_lock')) self.assertFalse(hasattr(arr4, 'get_obj')) + self.assertRaises(AttributeError, + self.Array, 'i', range(10), lock='notalock') + + arr5 = self.RawArray('i', range(10)) + self.assertFalse(hasattr(arr5, 'get_lock')) + self.assertFalse(hasattr(arr5, 'get_obj')) # # @@ -1044,8 +1058,10 @@ multiprocessing.active_children() # discard dead process objs gc.collect() # do garbage collection refs = self.manager._number_of_objects() + debug_info = self.manager._debug_info() if refs != EXPECTED_NUMBER: print(self.manager._debug_info()) + print(debug_info) self.assertEqual(refs, EXPECTED_NUMBER) @@ -1671,6 +1687,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 # @@ -1774,7 +1802,7 @@ multiprocessing.connection.answer_challenge, _FakeConnection(), b'abc') -testcases_other = [OtherTest] +testcases_other = [OtherTest, TestInvalidHandle] # # Modified: python/branches/py3k-issue1717/Lib/test/test_os.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_os.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_os.py Sun Jan 25 21:08:20 2009 @@ -587,6 +587,67 @@ 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): + self.assertRaises(OSError, f, support.make_bad_fd(), *args) + + 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_ftruncate(self): + if hasattr(os, "ftruncate"): + self.check(os.ftruncate, 0) + + 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 @@ -601,7 +662,8 @@ DevNullTests, URandomTests, ExecTests, - Win32ErrorTests + Win32ErrorTests, + TestInvalidFD ) if __name__ == "__main__": Modified: python/branches/py3k-issue1717/Lib/test/test_socket.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_socket.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_socket.py Sun Jan 25 21:08:20 2009 @@ -603,6 +603,10 @@ # Testing shutdown() msg = self.cli_conn.recv(1024) self.assertEqual(msg, MSG) + # wait for _testShutdown to finish: on OS X, when the server + # closes the connection the client also becomes disconnected, + # and the client's shutdown call will fail. (Issue #4397.) + self.done.wait() def _testShutdown(self): self.serv_conn.send(MSG) @@ -856,6 +860,16 @@ self.assertEqual(self.cli_file.mode, 'wb') self.assertEqual(self.cli_file.name, self.serv_conn.fileno()) + def testRealClose(self): + self.serv_file.close() + self.assertRaises(ValueError, self.serv_file.fileno) + self.cli_conn.close() + self.assertRaises(socket.error, self.cli_conn.getsockname) + + def _testRealClose(self): + pass + + class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase): """Repeat the tests from FileObjectClassTestCase with bufsize==0. @@ -881,6 +895,29 @@ self.cli_file.write(b"B. " + MSG) self.cli_file.flush() + def testMakefileClose(self): + # The file returned by makefile should keep the socket open... + self.cli_conn.close() + msg = self.cli_conn.recv(1024) + self.assertEqual(msg, MSG) + # ...until the file is itself closed + self.serv_file.close() + self.assertRaises(socket.error, self.cli_conn.recv, 1024) + + def _testMakefileClose(self): + self.cli_file.write(MSG) + self.cli_file.flush() + + def testMakefileCloseSocketDestroy(self): + refcount_before = sys.getrefcount(self.cli_conn) + self.serv_file.close() + refcount_after = sys.getrefcount(self.cli_conn) + self.assertEqual(refcount_before - 1, refcount_after) + + def _testMakefileCloseSocketDestroy(self): + pass + + class LineBufferedFileObjectClassTestCase(FileObjectClassTestCase): bufsize = 1 # Default-buffered for reading; line-buffered for writing Modified: python/branches/py3k-issue1717/Lib/test/test_struct.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_struct.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_struct.py Sun Jan 25 21:08:20 2009 @@ -2,6 +2,8 @@ import unittest import struct import warnings +warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated", + DeprecationWarning) from functools import wraps from test.support import TestFailed, verbose, run_unittest @@ -469,6 +471,11 @@ self.check_float_coerce(endian + fmt, 1.0) self.check_float_coerce(endian + fmt, 1.5) + def test_issue4228(self): + # Packing a long may yield either 32 or 64 bits + x = struct.pack('L', -1)[:4] + self.assertEqual(x, b'\xff'*4) + def test_unpack_from(self): test_string = b'abcd01234' fmt = '4s' Modified: python/branches/py3k-issue1717/Lib/test/test_sys.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_sys.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_sys.py Sun Jan 25 21:08:20 2009 @@ -559,7 +559,7 @@ check(32768*32768-1, size(vh) + 2*self.H) check(32768*32768, size(vh) + 3*self.H) # memory - check(memoryview(b''), size(h + 'P PP2P2i5P')) + check(memoryview(b''), size(h + 'P PP2P2i7P')) # module check(unittest, size(h + '3P')) # None Modified: python/branches/py3k-issue1717/Lib/test/test_urllib.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_urllib.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_urllib.py Sun Jan 25 21:08:20 2009 @@ -130,10 +130,14 @@ os.environ[k] = v def test_getproxies_environment_keep_no_proxies(self): - os.environ['NO_PROXY'] = 'localhost' - proxies = urllib.request.getproxies_environment() - # getproxies_environment use lowered case truncated (no '_proxy') keys - self.assertEquals('localhost', proxies['no']) + try: + os.environ['NO_PROXY'] = 'localhost' + proxies = urllib.request.getproxies_environment() + # getproxies_environment use lowered case truncated (no '_proxy') keys + self.assertEquals('localhost', proxies['no']) + finally: + # The old value will be restored by tearDown, if applicable. + del os.environ['NO_PROXY'] class urlopen_HttpTests(unittest.TestCase): Modified: python/branches/py3k-issue1717/Lib/test/test_wsgiref.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_wsgiref.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_wsgiref.py Sun Jan 25 21:08:20 2009 @@ -50,7 +50,7 @@ def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"): server = make_server("", 80, app, MockServer, MockHandler) inp = BufferedReader(BytesIO(data)) - out = StringIO() + out = BytesIO() olderr = sys.stderr err = sys.stderr = StringIO() @@ -128,13 +128,13 @@ def check_hello(self, out, has_length=True): self.assertEqual(out, - "HTTP/1.0 200 OK\r\n" + ("HTTP/1.0 200 OK\r\n" "Server: WSGIServer/0.1 Python/"+sys.version.split()[0]+"\r\n" "Content-Type: text/plain\r\n" "Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" + (has_length and "Content-Length: 13\r\n" or "") + "\r\n" - "Hello, world!" + "Hello, world!").encode("iso-8859-1") ) def test_plain_hello(self): @@ -152,7 +152,7 @@ return ["Hello, world!"] out, err = run_amock(validator(bad_app)) self.failUnless(out.endswith( - "A server error occurred. Please contact the administrator." + b"A server error occurred. Please contact the administrator." )) self.assertEqual( err.splitlines()[-2], @@ -160,7 +160,37 @@ " be of type list: " ) + def test_wsgi_input(self): + def bad_app(e,s): + e["wsgi.input"].read() + s(b"200 OK", [(b"Content-Type", b"text/plain; charset=utf-8")]) + return [b"data"] + out, err = run_amock(validator(bad_app)) + self.failUnless(out.endswith( + b"A server error occurred. Please contact the administrator." + )) + self.assertEqual( + err.splitlines()[-2], "AssertionError" + ) + def test_bytes_validation(self): + def app(e, s): + s(b"200 OK", [ + (b"Content-Type", b"text/plain; charset=utf-8"), + ("Date", "Wed, 24 Dec 2008 13:29:32 GMT"), + ]) + return [b"data"] + out, err = run_amock(validator(app)) + self.failUnless(err.endswith('"GET / HTTP/1.0" 200 4\n')) + ver = sys.version.split()[0].encode('ascii') + self.assertEqual( + b"HTTP/1.0 200 OK\r\n" + b"Server: WSGIServer/0.1 Python/" + ver + b"\r\n" + b"Content-Type: text/plain; charset=utf-8\r\n" + b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n" + b"\r\n" + b"data", + out) @@ -181,6 +211,8 @@ util.setup_testing_defaults(env) if isinstance(value,StringIO): self.failUnless(isinstance(env[key],StringIO)) + elif isinstance(value,BytesIO): + self.failUnless(isinstance(env[key],BytesIO)) else: self.assertEqual(env[key],value) @@ -260,7 +292,7 @@ ('wsgi.run_once', 0), ('wsgi.multithread', 0), ('wsgi.multiprocess', 0), - ('wsgi.input', StringIO("")), + ('wsgi.input', BytesIO()), ('wsgi.errors', StringIO()), ('wsgi.url_scheme','http'), ]: @@ -386,6 +418,28 @@ '\r\n' ) + def testBytes(self): + h = Headers([ + (b"Content-Type", b"text/plain; charset=utf-8"), + ]) + self.assertEqual("text/plain; charset=utf-8", h.get("Content-Type")) + + h[b"Foo"] = bytes(b"bar") + self.assertEqual("bar", h.get("Foo")) + self.assertEqual("bar", h.get(b"Foo")) + + h.setdefault(b"Bar", b"foo") + self.assertEqual("foo", h.get("Bar")) + self.assertEqual("foo", h.get(b"Bar")) + + h.add_header(b'content-disposition', b'attachment', + filename=b'bud.gif') + self.assertEqual('attachment; filename="bud.gif"', + h.get("content-disposition")) + + del h['content-disposition'] + self.assert_(b'content-disposition' not in h) + class ErrorHandler(BaseCGIHandler): """Simple handler subclass for testing BaseHandler""" @@ -393,7 +447,7 @@ def __init__(self,**kw): setup_testing_defaults(kw) BaseCGIHandler.__init__( - self, StringIO(''), StringIO(), StringIO(), kw, + self, BytesIO(), BytesIO(), StringIO(), kw, multithread=True, multiprocess=True ) @@ -474,21 +528,32 @@ s('200 OK',[])(e['wsgi.url_scheme']) return [] + def trivial_app3(e,s): + s('200 OK',[]) + return ['\u0442\u0435\u0441\u0442'.encode("utf-8")] + h = TestHandler() h.run(trivial_app1) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "Content-Length: 4\r\n" "\r\n" - "http") + "http").encode("iso-8859-1")) h = TestHandler() h.run(trivial_app2) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "\r\n" - "http") + "http").encode("iso-8859-1")) + h = TestHandler() + h.run(trivial_app3) + self.assertEqual(h.stdout.getvalue(), + b'Status: 200 OK\r\n' + b'Content-Length: 8\r\n' + b'\r\n' + b'\xd1\x82\xd0\xb5\xd1\x81\xd1\x82') @@ -507,18 +572,19 @@ h = ErrorHandler() h.run(non_error_app) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" + ("Status: 200 OK\r\n" "Content-Length: 0\r\n" - "\r\n") + "\r\n").encode("iso-8859-1")) self.assertEqual(h.stderr.getvalue(),"") h = ErrorHandler() h.run(error_app) self.assertEqual(h.stdout.getvalue(), - "Status: %s\r\n" + ("Status: %s\r\n" "Content-Type: text/plain\r\n" "Content-Length: %d\r\n" - "\r\n%s" % (h.error_status,len(h.error_body),h.error_body)) + "\r\n%s" % (h.error_status,len(h.error_body),h.error_body) + ).encode("iso-8859-1")) self.failUnless("AssertionError" in h.stderr.getvalue()) @@ -531,8 +597,8 @@ h = ErrorHandler() h.run(error_app) self.assertEqual(h.stdout.getvalue(), - "Status: 200 OK\r\n" - "\r\n"+MSG) + ("Status: 200 OK\r\n" + "\r\n"+MSG).encode("iso-8859-1")) self.failUnless("AssertionError" in h.stderr.getvalue()) @@ -549,7 +615,7 @@ ) shortpat = ( "Status: 200 OK\r\n" "Content-Length: 0\r\n" "\r\n" - ) + ).encode("iso-8859-1") for ssw in "FooBar/1.0", None: sw = ssw and "Server: %s\r\n" % ssw or "" @@ -570,13 +636,31 @@ h.server_software = ssw h.run(non_error_app) if proto=="HTTP/0.9": - self.assertEqual(h.stdout.getvalue(),"") + self.assertEqual(h.stdout.getvalue(),b"") else: self.failUnless( - re.match(stdpat%(version,sw), h.stdout.getvalue()), - (stdpat%(version,sw), h.stdout.getvalue()) + re.match((stdpat%(version,sw)).encode("iso-8859-1"), + h.stdout.getvalue()), + ((stdpat%(version,sw)).encode("iso-8859-1"), + h.stdout.getvalue()) ) + def testBytesData(self): + def app(e, s): + s(b"200 OK", [ + (b"Content-Type", b"text/plain; charset=utf-8"), + ]) + return [b"data"] + + h = TestHandler() + h.run(app) + self.assertEqual(b"Status: 200 OK\r\n" + b"Content-Type: text/plain; charset=utf-8\r\n" + b"Content-Length: 4\r\n" + b"\r\n" + b"data", + h.stdout.getvalue()) + # This epilogue is needed for compatibility with the Python 2.5 regrtest module def test_main(): Modified: python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py Sun Jan 25 21:08:20 2009 @@ -232,7 +232,7 @@ self.assertEqual(str(t2), str(d, "latin-1")) -PORT = None +ADDR = PORT = URL = None # The evt is set twice. First when the server is ready to serve. # Second when the server has been shutdown. The user must clear @@ -258,12 +258,17 @@ s.setblocking(True) return s, port + serv = MyXMLRPCServer(("localhost", 0), + logRequests=False, bind_and_activate=False) try: - serv = MyXMLRPCServer(("localhost", 0), - logRequests=False, bind_and_activate=False) serv.server_bind() - global PORT - PORT = serv.socket.getsockname()[1] + global ADDR, PORT, URL + ADDR, PORT = serv.socket.getsockname() + #connect to IP address directly. This avoids socket.create_connection() + #trying to connect to to "localhost" using all address families, which + #causes slowdown e.g. on vista which supports AF_INET6. The server listens + #on AF_INET only. + URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() serv.register_introspection_functions() serv.register_multicall_functions() @@ -331,7 +336,7 @@ def test_simple1(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -343,7 +348,7 @@ def XXXtest_404(self): # send POST with http.client, it should return 404 header and # 'Not Found' message. - conn = http.client.HTTPConnection('localhost', PORT) + conn = httplib.client.HTTPConnection(ADDR, PORT) conn.request('POST', '/this-is-not-valid') response = conn.getresponse() conn.close() @@ -356,7 +361,7 @@ 'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall']) try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) meth = p.system.listMethods() self.assertEqual(set(meth), expected_methods) except (xmlrpclib.ProtocolError, socket.error) as e: @@ -369,7 +374,7 @@ def test_introspection2(self): try: # test _methodHelp() - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divhelp = p.system.methodHelp('div') self.assertEqual(divhelp, 'This is the div function') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -381,7 +386,7 @@ def test_introspection3(self): try: # test native doc - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) myfunction = p.system.methodHelp('my_function') self.assertEqual(myfunction, 'This is my function') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -394,7 +399,7 @@ # the SimpleXMLRPCServer doesn't support signatures, but # at least check that we can try making the call try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') except (xmlrpclib.ProtocolError, socket.error) as e: @@ -405,7 +410,7 @@ def test_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) @@ -422,7 +427,7 @@ def test_non_existing_multicall(self): try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) multicall = xmlrpclib.MultiCall(p) multicall.this_is_not_exists() result = multicall() @@ -491,7 +496,7 @@ # test a call that shouldn't fail just as a smoke test try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) self.assertEqual(p.pow(6,8), 6**8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -504,7 +509,7 @@ xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -524,7 +529,7 @@ xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = True try: - p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) + p = xmlrpclib.ServerProxy(URL) p.pow(6,8) except (xmlrpclib.ProtocolError, socket.error) as e: # ignore failures due to non-blocking socket 'unavailable' errors @@ -605,15 +610,9 @@ def test_main(): xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase, BinaryTestCase, FaultTestCase] - - # The test cases against a SimpleXMLRPCServer raise a socket error - # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when - # run on Windows. This only happens on the first test to run, but it - # fails every time and so these tests are skipped on win32 platforms. - if sys.platform != 'win32': - xmlrpc_tests.append(SimpleServerTestCase) - xmlrpc_tests.append(FailingServerTestCase) - xmlrpc_tests.append(CGIHandlerTestCase) + xmlrpc_tests.append(SimpleServerTestCase) + xmlrpc_tests.append(FailingServerTestCase) + xmlrpc_tests.append(CGIHandlerTestCase) support.run_unittest(*xmlrpc_tests) Modified: python/branches/py3k-issue1717/Lib/test/test_zipfile.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_zipfile.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_zipfile.py Sun Jan 25 21:08:20 2009 @@ -9,9 +9,10 @@ from random import randint, random import test.support as support -from test.support import TESTFN, run_unittest +from test.support import TESTFN, run_unittest, findfile TESTFN2 = TESTFN + "2" +TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), @@ -1000,6 +1001,28 @@ def tearDown(self): os.remove(TESTFN2) +class TestWithDirectory(unittest.TestCase): + def setUp(self): + os.mkdir(TESTFN2) + + def testExtractDir(self): + zipf = zipfile.ZipFile(findfile("zipdir.zip")) + zipf.extractall(TESTFN2) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a"))) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) + self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + + def testStoreDir(self): + os.mkdir(os.path.join(TESTFN2, "x")) + zipf = zipfile.ZipFile(TESTFN, "w") + zipf.write(os.path.join(TESTFN2, "x"), "x") + self.assertTrue(zipf.filelist[0].filename.endswith("x/")) + + def tearDown(self): + shutil.rmtree(TESTFN2) + if os.path.exists(TESTFN): + os.remove(TESTFN) + class UniversalNewlineTests(unittest.TestCase): def setUp(self): @@ -1114,6 +1137,7 @@ def test_main(): run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests, PyZipFileTests, DecryptionTests, TestsWithMultipleOpens, + TestWithDirectory, UniversalNewlineTests, TestsWithRandomBinaryFiles) if __name__ == "__main__": Modified: python/branches/py3k-issue1717/Lib/tkinter/__init__.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/__init__.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/__init__.py Sun Jan 25 21:08:20 2009 @@ -49,12 +49,6 @@ WRITABLE = _tkinter.WRITABLE EXCEPTION = _tkinter.EXCEPTION -# These are not always defined, e.g. not on Win32 with Tk 8.0 :-( -try: _tkinter.createfilehandler -except AttributeError: _tkinter.createfilehandler = None -try: _tkinter.deletefilehandler -except AttributeError: _tkinter.deletefilehandler = None - def _flatten(seq): """Internal function.""" Modified: python/branches/py3k-issue1717/Lib/tkinter/_fix.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/_fix.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/_fix.py Sun Jan 25 21:08:20 2009 @@ -10,6 +10,40 @@ # \..\tcl, so anything close to # the real Tcl library will do. +# Expand symbolic links on Vista +try: + import ctypes + ctypes.windll.kernel32.GetFinalPathNameByHandleW +except (ImportError, AttributeError): + def convert_path(s): + return s +else: + def convert_path(s): + if isinstance(s, bytes): + s = s.decode("mbcs") + hdir = ctypes.windll.kernel32.\ + CreateFileW(s, 0x80, # FILE_READ_ATTRIBUTES + 1, # FILE_SHARE_READ + None, 3, # OPEN_EXISTING + 0x02000000, # FILE_FLAG_BACKUP_SEMANTICS + None) + if hdir == -1: + # Cannot open directory, give up + return s + buf = ctypes.create_unicode_buffer("", 32768) + res = ctypes.windll.kernel32.\ + GetFinalPathNameByHandleW(hdir, buf, len(buf), + 0) # VOLUME_NAME_DOS + ctypes.windll.kernel32.CloseHandle(hdir) + if res == 0: + # Conversion failed (e.g. network location) + return s + s = buf[:res] + # Ignore leading \\?\ + if s.startswith("\\\\?\\"): + s = s[4:] + return s + prefix = os.path.join(sys.prefix,"tcl") if not os.path.exists(prefix): # devdir/../tcltk/lib @@ -17,6 +51,7 @@ prefix = os.path.abspath(prefix) # if this does not exist, no further search is needed if os.path.exists(prefix): + prefix = convert_path(prefix) if "TCL_LIBRARY" not in os.environ: for name in os.listdir(prefix): if name.startswith("tcl"): Modified: python/branches/py3k-issue1717/Lib/tkinter/tix.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/tix.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/tix.py Sun Jan 25 21:08:20 2009 @@ -293,7 +293,7 @@ else: static_options = ['options'] - for k,v in cnf.items()[:]: + for k,v in list(cnf.items()): if k in static_options: extra = extra + ('-' + k, v) del cnf[k] @@ -448,7 +448,7 @@ # we must be careful not to destroy the frame widget since this # also destroys the parent NoteBook thus leading to an exception # in Tkinter when it finally calls Tcl to destroy the NoteBook - for c in self.children.values(): c.destroy() + for c in list(self.children.values()): c.destroy() if self._name in self.master.children: del self.master.children[self._name] if self._name in self.master.subwidget_list: Modified: python/branches/py3k-issue1717/Lib/unittest.py ============================================================================== --- python/branches/py3k-issue1717/Lib/unittest.py (original) +++ python/branches/py3k-issue1717/Lib/unittest.py Sun Jan 25 21:08:20 2009 @@ -73,7 +73,7 @@ __unittest = 1 -class TestResult: +class TestResult(object): """Holder for test result information. Test results are automatically managed by the TestCase and TestSuite @@ -149,7 +149,7 @@ (_strclass(self.__class__), self.testsRun, len(self.errors), len(self.failures)) -class AssertRaisesContext: +class AssertRaisesContext(object): def __init__(self, expected, test_case, callable_obj=None): self.expected = expected self.failureException = test_case.failureException @@ -179,7 +179,7 @@ # Let unexpected exceptions skip through return False -class TestCase: +class TestCase(object): """A class whose instances are single test cases. By default, the test code itself should be placed in a method named @@ -217,8 +217,8 @@ testMethod = getattr(self, methodName) self._testMethodDoc = testMethod.__doc__ except AttributeError: - raise ValueError("no such test method in %s: %s" - % (self.__class__, methodName)) + raise ValueError("no such test method in %s: %s" % \ + (self.__class__, methodName)) def setUp(self): "Hook method for setting up the test fixture before exercising it." @@ -273,9 +273,7 @@ try: try: self.setUp() - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) return @@ -285,16 +283,12 @@ ok = True except self.failureException: result.addFailure(self, self._exc_info()) - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) try: self.tearDown() - except KeyboardInterrupt: - raise - except: + except Exception: result.addError(self, self._exc_info()) ok = False if ok: result.addSuccess(self) @@ -372,8 +366,8 @@ as significant digits (measured from the most signficant digit). """ if round(abs(second-first), places) != 0: - raise self.failureException(msg or '%r != %r within %r places' - % (first, second, places)) + raise self.failureException( + msg or '%r != %r within %r places' % (first, second, places)) def failIfAlmostEqual(self, first, second, *, places=7, msg=None): """Fail if the two objects are equal as determined by their @@ -384,8 +378,8 @@ as significant digits (measured from the most signficant digit). """ if round(abs(second-first), places) == 0: - raise self.failureException(msg or '%r == %r within %r places' - % (first, second, places)) + raise self.failureException( + msg or '%r == %r within %r places' % (first, second, places)) # Synonyms for assertion methods @@ -405,7 +399,7 @@ -class TestSuite: +class TestSuite(object): """A test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. @@ -548,7 +542,7 @@ def cmp(x, y): return (x > y) - (x < y) -class TestLoader: +class TestLoader(object): """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ @@ -599,7 +593,7 @@ for part in parts: parent, obj = obj, getattr(obj, part) - if type(obj) == types.ModuleType: + if isinstance(obj, types.ModuleType): return self.loadTestsFromModule(obj) elif isinstance(obj, type) and issubclass(obj, TestCase): return self.loadTestsFromTestCase(obj) @@ -675,7 +669,7 @@ # Text UI ############################################################################## -class _WritelnDecorator: +class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream @@ -754,7 +748,7 @@ self.stream.writeln("%s" % err) -class TextTestRunner: +class TextTestRunner(object): """A test runner class that displays results in textual form. It prints out the names of tests as they are run, errors as they @@ -800,7 +794,7 @@ # Facilities for running tests from the command line ############################################################################## -class TestProgram: +class TestProgram(object): """A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. """ @@ -822,7 +816,7 @@ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=defaultTestLoader): - if type(module) == type(''): + if isinstance(module, str): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) Modified: python/branches/py3k-issue1717/Lib/wsgiref/handlers.py ============================================================================== --- python/branches/py3k-issue1717/Lib/wsgiref/handlers.py (original) +++ python/branches/py3k-issue1717/Lib/wsgiref/handlers.py Sun Jan 25 21:08:20 2009 @@ -157,19 +157,29 @@ elif self.headers is not None: raise AssertionError("Headers already set!") - assert type(status) is str,"Status must be a string" + status = self._convert_string_type(status, "Status") assert len(status)>=4,"Status must be at least 4 characters" assert int(status[:3]),"Status message must begin w/3-digit code" assert status[3]==" ", "Status message must have a space after code" - if __debug__: - for name,val in headers: - assert type(name) is str,"Header names must be strings" - assert type(val) is str,"Header values must be strings" - assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" + + str_headers = [] + for name,val in headers: + name = self._convert_string_type(name, "Header name") + val = self._convert_string_type(val, "Header value") + str_headers.append((name, val)) + assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" + self.status = status - self.headers = self.headers_class(headers) + self.headers = self.headers_class(str_headers) return self.write + def _convert_string_type(self, value, title): + """Convert/check value type.""" + if isinstance(value, str): + return value + assert isinstance(value, bytes), \ + "{0} must be a string or bytes object (not {1})".format(title, value) + return str(value, "iso-8859-1") def send_preamble(self): """Transmit version/status/date/server, via self._write()""" @@ -188,7 +198,8 @@ def write(self, data): """'write()' callable as specified by PEP 333""" - assert type(data) is str,"write() argument must be string" + assert isinstance(data, (str, bytes)), \ + "write() argument must be a string or bytes" if not self.status: raise AssertionError("write() before start_response()") @@ -382,8 +393,13 @@ self.environ.update(self.base_env) def _write(self,data): + if isinstance(data, str): + try: + data = data.encode("iso-8859-1") + except UnicodeEncodeError: + raise ValueError("Unicode data must contain only code points" + " representable in ISO-8859-1 encoding") self.stdout.write(data) - self._write = self.stdout.write def _flush(self): self.stdout.flush() Modified: python/branches/py3k-issue1717/Lib/wsgiref/headers.py ============================================================================== --- python/branches/py3k-issue1717/Lib/wsgiref/headers.py (original) +++ python/branches/py3k-issue1717/Lib/wsgiref/headers.py Sun Jan 25 21:08:20 2009 @@ -44,7 +44,19 @@ def __init__(self,headers): if not isinstance(headers, list): raise TypeError("Headers must be a list of name/value tuples") - self._headers = headers + self._headers = [] + for k, v in headers: + k = self._convert_string_type(k) + v = self._convert_string_type(v) + self._headers.append((k, v)) + + def _convert_string_type(self, value): + """Convert/check value type.""" + if isinstance(value, str): + return value + assert isinstance(value, bytes), ("Header names/values must be" + " a string or bytes object (not {0})".format(value)) + return str(value, "iso-8859-1") def __len__(self): """Return the total number of headers, including duplicates.""" @@ -53,14 +65,15 @@ def __setitem__(self, name, val): """Set the value of a header.""" del self[name] - self._headers.append((name, val)) + self._headers.append( + (self._convert_string_type(name), self._convert_string_type(val))) def __delitem__(self,name): """Delete all occurrences of a header, if present. Does *not* raise an exception if the header is missing. """ - name = name.lower() + name = self._convert_string_type(name.lower()) self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] def __getitem__(self,name): @@ -91,13 +104,13 @@ fields deleted and re-inserted are always appended to the header list. If no fields exist with the given name, returns an empty list. """ - name = name.lower() + name = self._convert_string_type(name.lower()) return [kv[1] for kv in self._headers if kv[0].lower()==name] def get(self,name,default=None): """Get the first header value for 'name', or return 'default'""" - name = name.lower() + name = self._convert_string_type(name.lower()) for k,v in self._headers: if k.lower()==name: return v @@ -152,7 +165,8 @@ and value 'value'.""" result = self.get(name) if result is None: - self._headers.append((name,value)) + self._headers.append((self._convert_string_type(name), + self._convert_string_type(value))) return value else: return result @@ -176,13 +190,16 @@ """ parts = [] if _value is not None: + _value = self._convert_string_type(_value) parts.append(_value) for k, v in _params.items(): + k = self._convert_string_type(k) if v is None: parts.append(k.replace('_', '-')) else: + v = self._convert_string_type(v) parts.append(_formatparam(k.replace('_', '-'), v)) - self._headers.append((_name, "; ".join(parts))) + self._headers.append((self._convert_string_type(_name), "; ".join(parts))) Modified: python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py ============================================================================== --- python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py (original) +++ python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py Sun Jan 25 21:08:20 2009 @@ -111,8 +111,7 @@ if length: env['CONTENT_LENGTH'] = length - for h in self.headers: - k,v = h.split(':',1) + for k, v in self.headers.items(): k=k.replace('-','_').upper(); v=v.strip() if k in env: continue # skip content length, type,etc. @@ -168,11 +167,11 @@ stdout = StringIO() print("Hello world!", file=stdout) print(file=stdout) - h = environ.items(); h.sort() + h = sorted(environ.items()) for k,v in h: print(k,'=',repr(v), file=stdout) - start_response("200 OK", [('Content-Type','text/plain')]) - return [stdout.getvalue()] + start_response(b"200 OK", [(b'Content-Type',b'text/plain; charset=utf-8')]) + return [stdout.getvalue().encode("utf-8")] def make_server( Modified: python/branches/py3k-issue1717/Lib/wsgiref/util.py ============================================================================== --- python/branches/py3k-issue1717/Lib/wsgiref/util.py (original) +++ python/branches/py3k-issue1717/Lib/wsgiref/util.py Sun Jan 25 21:08:20 2009 @@ -149,8 +149,8 @@ environ.setdefault('wsgi.multithread', 0) environ.setdefault('wsgi.multiprocess', 0) - from io import StringIO - environ.setdefault('wsgi.input', StringIO("")) + from io import StringIO, BytesIO + environ.setdefault('wsgi.input', BytesIO()) environ.setdefault('wsgi.errors', StringIO()) environ.setdefault('wsgi.url_scheme',guess_scheme(environ)) Modified: python/branches/py3k-issue1717/Lib/wsgiref/validate.py ============================================================================== --- python/branches/py3k-issue1717/Lib/wsgiref/validate.py (original) +++ python/branches/py3k-issue1717/Lib/wsgiref/validate.py Sun Jan 25 21:08:20 2009 @@ -127,6 +127,13 @@ if not cond: raise AssertionError(*args) +def check_string_type(value, title): + if isinstance(value, str): + return value + assert isinstance(value, bytes), \ + "{0} must be a string or bytes object (not {1})".format(title, value) + return str(value, "iso-8859-1") + def validator(application): """ @@ -188,14 +195,14 @@ self.input = wsgi_input def read(self, *args): - assert_(len(args) <= 1) + assert_(len(args) == 1) v = self.input.read(*args) - assert_(isinstance(v, str)) + assert_(isinstance(v, bytes)) return v def readline(self): v = self.input.readline() - assert_(isinstance(v, str)) + assert_(isinstance(v, bytes)) return v def readlines(self, *args): @@ -203,7 +210,7 @@ lines = self.input.readlines(*args) assert_(isinstance(lines, list)) for line in lines: - assert_(isinstance(line, str)) + assert_(isinstance(line, bytes)) return lines def __iter__(self): @@ -241,7 +248,7 @@ self.writer = wsgi_writer def __call__(self, s): - assert_(isinstance(s, str)) + assert_(isinstance(s, (str, bytes))) self.writer(s) class PartialIteratorWrapper: @@ -364,8 +371,7 @@ % (wsgi_errors, attr)) def check_status(status): - assert_(isinstance(status, str), - "Status must be a string (not %r)" % status) + status = check_string_type(status, "Status") # Implicitly check that we can turn it into an integer: status_code = status.split(None, 1)[0] assert_(len(status_code) == 3, @@ -389,6 +395,8 @@ % (item, type(item))) assert_(len(item) == 2) name, value = item + name = check_string_type(name, "Header name") + value = check_string_type(value, "Header value") assert_(name.lower() != 'status', "The Status header cannot be used; it conflicts with CGI " "script, and HTTP status is not given through headers " @@ -404,11 +412,13 @@ % (value, bad_header_value_re.search(value).group(0))) def check_content_type(status, headers): + status = check_string_type(status, "Status") code = int(status.split(None, 1)[0]) # @@: need one more person to verify this interpretation of RFC 2616 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html NO_MESSAGE_BODY = (204, 304) for name, value in headers: + name = check_string_type(name, "Header name") if name.lower() == 'content-type': if code not in NO_MESSAGE_BODY: return @@ -426,6 +436,6 @@ # Technically a string is legal, which is why it's a really bad # idea, because it may cause the response to be returned # character-by-character - assert_(not isinstance(iterator, str), + assert_(not isinstance(iterator, (str, bytes)), "You should not return a string as your application iterator, " "instead return a single-item list containing that string.") Modified: python/branches/py3k-issue1717/Lib/zipfile.py ============================================================================== --- python/branches/py3k-issue1717/Lib/zipfile.py (original) +++ python/branches/py3k-issue1717/Lib/zipfile.py Sun Jan 25 21:08:20 2009 @@ -4,7 +4,7 @@ XXX references to utf-8 need further investigation. """ import struct, os, time, sys, shutil -import binascii, io +import binascii, io, stat try: import zlib # We may need its compression method @@ -28,7 +28,7 @@ error = BadZipfile # The exception raised by this module -ZIP64_LIMIT= (1 << 31) - 1 +ZIP64_LIMIT = (1 << 31) - 1 ZIP_FILECOUNT_LIMIT = 1 << 16 ZIP_MAX_COMMENT = (1 << 16) - 1 @@ -210,13 +210,9 @@ # Append a blank comment and record start offset endrec.append(b"") endrec.append(filesize - sizeEndCentDir) - if endrec[_ECD_OFFSET] == 0xffffffff: - # the value for the "offset of the start of the central directory" - # indicates that there is a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, -sizeEndCentDir, endrec) - return endrec + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, -sizeEndCentDir, endrec) # Either this is not a ZIP file, or it is a ZIP file with an archive # comment. Search the end of the file for the "end of central directory" @@ -237,11 +233,10 @@ # Append the archive comment and start offset endrec.append(comment) endrec.append(maxCommentStart + start) - if endrec[_ECD_OFFSET] == 0xffffffff: - # There is apparently a "Zip64 end of central directory" - # structure present, so go look for it - return _EndRecData64(fpin, start - filesize, endrec) - return endrec + + # Try to read the "Zip64 end of central directory" structure + return _EndRecData64(fpin, maxCommentStart + start - filesize, + endrec) # Unable to find a valid end of central directory structure return @@ -964,11 +959,11 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] == "/": + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present - if os.path.isabs(member.filename): + if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) @@ -980,6 +975,10 @@ if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) + if member.filename[-1] == '/': + os.mkdir(targetpath) + return targetpath + source = self.open(member, pwd=pwd) target = open(targetpath, "wb") shutil.copyfileobj(source, target) @@ -1019,6 +1018,7 @@ "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) + isdir = stat.S_ISDIR(st.st_mode) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information @@ -1027,6 +1027,8 @@ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] + if isdir: + arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes if compress_type is None: @@ -1040,6 +1042,16 @@ self._writecheck(zinfo) self._didModify = True + + if isdir: + zinfo.file_size = 0 + zinfo.compress_size = 0 + zinfo.CRC = 0 + self.filelist.append(zinfo) + self.NameToInfo[zinfo.filename] = zinfo + self.fp.write(zinfo.FileHeader()) + return + fp = io.open(filename, "rb") # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 @@ -1198,19 +1210,26 @@ pos2 = self.fp.tell() # Write end-of-zip-archive record + centDirCount = count + centDirSize = pos2 - pos1 centDirOffset = pos1 - if pos1 > ZIP64_LIMIT: + if (centDirCount >= ZIP_FILECOUNT_LIMIT or + centDirOffset > ZIP64_LIMIT or + centDirSize > ZIP64_LIMIT): # Need to write the ZIP64 end-of-archive records zip64endrec = struct.pack( structEndArchive64, stringEndArchive64, - 44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1) + 44, 45, 45, 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset) self.fp.write(zip64endrec) zip64locrec = struct.pack( structEndArchive64Locator, stringEndArchive64Locator, 0, pos2, 1) self.fp.write(zip64locrec) - centDirOffset = 0xFFFFFFFF + centDirCount = min(centDirCount, 0xFFFF) + centDirSize = min(centDirSize, 0xFFFFFFFF) + centDirOffset = min(centDirOffset, 0xFFFFFFFF) # check for valid comment length if len(self.comment) >= ZIP_MAX_COMMENT: @@ -1220,9 +1239,8 @@ self.comment = self.comment[:ZIP_MAX_COMMENT] endrec = struct.pack(structEndArchive, stringEndArchive, - 0, 0, count % ZIP_FILECOUNT_LIMIT, - count % ZIP_FILECOUNT_LIMIT, pos2 - pos1, - centDirOffset, len(self.comment)) + 0, 0, centDirCount, centDirCount, + centDirSize, centDirOffset, len(self.comment)) self.fp.write(endrec) self.fp.write(self.comment) self.fp.flush() Modified: python/branches/py3k-issue1717/Makefile.pre.in ============================================================================== --- python/branches/py3k-issue1717/Makefile.pre.in (original) +++ python/branches/py3k-issue1717/Makefile.pre.in Sun Jan 25 21:08:20 2009 @@ -247,6 +247,16 @@ ########################################################################## # Python + +OPCODETARGETS_H= \ + $(srcdir)/Python/opcode_targets.h + +OPCODETARGETGEN= \ + $(srcdir)/Python/makeopcodetargets.py + +OPCODETARGETGEN_FILES= \ + $(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py + PYTHON_OBJS= \ Python/_warnings.o \ Python/Python-ast.o \ @@ -263,7 +273,6 @@ Python/getargs.o \ Python/getcompiler.o \ Python/getcopyright.o \ - Python/getmtime.o \ Python/getplatform.o \ Python/getversion.o \ Python/graminit.o \ @@ -412,10 +421,14 @@ if test $(INSTSONAME) != $(LDLIBRARY); then \ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ - else\ + else \ $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi +libpython$(VERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) @@ -556,16 +569,21 @@ $(srcdir)/Objects/stringlib/unicodedefs.h \ $(srcdir)/Objects/stringlib/localeutil.h -Objects/stringobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) +Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) -Objects/bytesobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ - $(BYTESTR_DEPS) \ - $(srcdir)/Objects/stringlib/formatter.h + $(BYTESTR_DEPS) \ + $(srcdir)/Objects/stringlib/formatter.h + +$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) + $(OPCODETARGETGEN) $(OPCODETARGETS_H) + +Python/ceval.o: $(OPCODETARGETS_H) Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ - $(BYTESTR_DEPS) + $(BYTESTR_DEPS) ############################################################################ @@ -773,13 +791,13 @@ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) - if test -f libpython$(VERSION)$(SO); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ + if test -f $(LDLIBRARY); then \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ - if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ - (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ Modified: python/branches/py3k-issue1717/Misc/ACKS ============================================================================== --- python/branches/py3k-issue1717/Misc/ACKS (original) +++ python/branches/py3k-issue1717/Misc/ACKS Sun Jan 25 21:08:20 2009 @@ -83,6 +83,7 @@ Sebastian Boving Monty Brandenberg Georg Brandl +Christopher Brannon Terrence Brannon Dave Brennan Tom Bridgman @@ -178,6 +179,7 @@ Quinn Dunkan Robin Dunn Luke Dunstan +Virgil Dupras Andy Dustman Gary Duzan Eugene Dvurechenski @@ -246,6 +248,7 @@ Harry Henry Gebel Marius Gedminas Thomas Gellekum +Gabriel Genellina Christos Georgiou Ben Gertzfield Dinu Gherman @@ -313,6 +316,7 @@ Naofumi Honda Jeffrey Honig Rob Hooft +Michiel de Hoon Brian Hooper Randall Hopper Nadav Horesh @@ -373,6 +377,7 @@ Taek Joo Kim Paul Kippes Steve Kirsch +Sebastian Kirsche Ron Klatchko Bastian Kleineidam Bob Kline @@ -428,6 +433,7 @@ Jason Lowe Tony Lownds Ray Loyzaga +Lukas Lueg Loren Luke Fredrik Lundh Mark Lutz @@ -779,3 +785,4 @@ Uwe Zessin Tarek Ziad? Peter ?strand +Jesse Noller Modified: python/branches/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Sun Jan 25 21:08:20 2009 @@ -13,11 +13,72 @@ ----------------- - Issue #1717: Removed builtin cmp() function, dropped tp_compare - slot, the C API functions PyObject_Compare and PyUnicode_Compare - and the type definition cmpfunc. PyUnicode_CompareWithASCIIString - was replaced PyUnicode_EqualToASCIIString. - The tp_compare slot is reserved for future usage. A type definition - with an assigned tp_compare slot will raise a TypeError. + slot, the C API functions PyObject_Compare and PyUnicode_Compare and + the type definition cmpfunc. The tp_compare slot is reserved for + future usage. + +- Issue #4874: Most builtin decoders now reject unicode input. + +- Issue #4842: Don't allow trailing 'L' when constructing an integer + from a string. + +- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors. + +- Issue #4838: When a module is deallocated, free the memory backing the + optional module state data. + +- Issue #4910: Rename nb_long slot to nb_reserved, and change its + type to (void *). + +- 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. + +- Issue #3720: Fix a crash when an iterator modifies its class and removes its + __next__ method. + +- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API + function no longer attempt to call the __long__ slot to convert an object + to an integer. Only the __int__ and __trunc__ slots are examined. + +- Issue #4893: Use NT threading on CE. + +- Issue #4915: Port sysmodule to Windows CE. + +- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The + common cases are optimized thanks to a dedicated fast path and a moderate + amount of loop unrolling. + +- 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. + +- Issue #4604: Some objects of the I/O library could still be used after + having been closed (for instance, a read() call could return some + previously buffered data). Patch by Dmitry Vasiliev. + +- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line + flag to work properly. Furthermore, when specifying -u, the text stdout + and stderr streams have line-by-line buffering enabled (the default being + to buffer arbitrary chunks of data). + +- The internal table, _PyLong_DigitValue, is now an array of unsigned chars + instead of ints (reducing its size from 4 to 8 times thereby reducing + Python's overall memory). + +- Issue #1180193: When importing a module from a .pyc (or .pyo) file with + an existing .py counterpart, override the co_filename attributes of all + code objects if the original filename is obsolete (which can happen if the + file has been renamed, moved, or if it is accessed through different paths). + Patch by Ziga Seilnacht and Jean-Paul Calderone. + +- Issue #4580: Fix slicing of memoryviews when the item size is greater than + one byte. Also fixes the meaning of len() so that it returns the number of + items, rather than the size in bytes. + +- Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4747: When the terminal does not use utf-8, executing a script with non-ascii characters in its name could fail with a "SyntaxError: None" error. @@ -83,10 +144,100 @@ Library ------- -- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case - no MSVC compiler is found under Windows. Original patch by Philip Jenvey. +- Fix and properly document the multiprocessing module's logging + support, expose the internal levels and provide proper usage + examples. + +- Issue #1672332: fix unpickling of subnormal floats, which was + producing a ValueError on some platforms. + +- Issue #3881: Help Tcl to load even when started through the + unreadable local symlink to "Program Files" on Vista. + +- Issue #4710: Extract directories properly in the zipfile module; + allow adding directories to a zipfile. + +- Issue #3807: _multiprocessing build fails when configure is passed + --without-threads argument. When this occurs, _multiprocessing will + be disabled, and not compiled. + +- Issue #5008: When a file is opened in append mode with the new IO library, + do an explicit seek to the end of file (so that e.g. tell() returns the + file size rather than 0). This is consistent with the behaviour of the + traditional 2.x file object. + +- Issue #5013: Fixed a bug in FileHandler which occurred when the delay + parameter was set. + +- Issue #4842: Always append a trailing 'L' when pickling longs using + pickle protocol 0. When reading, the 'L' is optional. + +- Add the importlib package. + +- Issue #4301: Patch the logging module to add processName support, remove + _check_logger_class from multiprocessing. + +- Issue #3325: Remove python2.x try: except: imports for old cPickle from + multiprocessing. + +- Issue #4959: inspect.formatargspec now works for keyword only arguments + without defaults. + +- 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 #1225107: inspect.isclass() returned True for instances with a custom + __getattr__. + +- Issue #3826 and #4791: The socket module now closes the underlying socket + appropriately when it is being used via socket.makefile() objects + rather than delaying the close by waiting for garbage collection to do it. + +- Issue #1696199: Add collections.Counter() for rapid and convenient + counting. + +- Issue #3860: GzipFile and BZ2File now support the context manager protocol. + +- Issue #4867: Fixed a crash in ctypes when passing a string to a + function without defining argtypes. + +- Issue #4272: Add an optional argument to the GzipFile constructor to override + the timestamp in the gzip stream. The default value remains the current time. + The information can be used by e.g. gunzip when decompressing. Patch by + Jacques Frechet. + +- Restore Python 2.3 compatibility for decimal.py. + +- Issue #3638: Remove functions from _tkinter module level that depend on + TkappObject to work with multiple threads. -- Issue #4646: distutils was choking on empty options arg in the setup +- Issue #4718: Adapt the wsgiref package so that it actually works with + Python 3.x, in accordance with the `official amendments of the spec + `_. + +- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() + to the decimal module. + +- Fractions.from_float() no longer loses precision for integers too big to + cast as floats. + +- Issue #4812: add missing underscore prefix to some internal-use-only + constants in the decimal module. (Dec_0 becomes _Dec_0, etc.) + +- Issue 4790: The nsmallest() and nlargest() functions in the heapq module + did unnecessary work in the common case where no key function was specified. + +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. + +- Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. - Issue #3767: Convert Tk object to string in tkColorChooser. @@ -174,14 +325,72 @@ support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. +- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on + biarch systems. Try to rely on ldconfig only, without using objdump and gcc. + Tools/Demos ----------- - Issue #4677: add two list comprehension tests to pybench. + +Build +----- + +- Issue #4895: Use _strdup on Windows CE. + +- Issue #4472: "configure --enable-shared" now works on OSX + +- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. + +- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs". + +- Issue #4289: Remove Cancel button from AdvancedDlg. + +- Issue #1656675: Register a drop handler for .py* files on Windows. + +- Issue #4120: Exclude manifest from extension modules in VS2008. + +- Issue #4091: Install pythonxy.dll in system32 again. + +- Issue #4018: Disable "for me" installations on Vista. + +- Issue #3758: Add ``patchcheck`` build target to .PHONY. + +- Issue #4204: Fixed module build errors on FreeBSD 4. + + +C-API +----- + +- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. + +- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when + the GIL is released, or owned by another thread. + +- Issue #4122: On Windows, fix a compilation error when using the + Py_UNICODE_ISSPACE macro in an extension module. + + Extension Modules ----------------- +- Issue #4397: Fix occasional test_socket failure on OS X. + +- Issue #4279: Fix build of parsermodule under Cygwin. + +- Issue #4751: hashlib now releases the GIL when hashing large buffers + (with a hardwired threshold of 2048 bytes), allowing better parallelization + on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner. + +- Issue #4051: Prevent conflict of UNICODE macros in cPickle. + +- Issue #4738: Each zlib object now has a separate lock, allowing to compress + or decompress several streams at once on multi-CPU systems. Also, the GIL + is now released when computing the CRC of a large buffer. Patch by ebfe. + +- Issue #4228: Pack negative values the same way as 2.4 in struct's L format. + - Issue #1040026: Fix os.times result on systems where HZ is incorrect. - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris, @@ -191,9 +400,6 @@ has been exported, resulting in an interpreter crash when accessing the buffer. -Build ------ - Docs ---- Modified: python/branches/py3k-issue1717/Misc/build.sh ============================================================================== --- python/branches/py3k-issue1717/Misc/build.sh (original) +++ python/branches/py3k-issue1717/Misc/build.sh Sun Jan 25 21:08:20 2009 @@ -264,7 +264,7 @@ echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F err=1 else - make update html >& ../build/$F + make checkout update html >& ../build/$F err=$? fi update_status "Making doc" "$F" $start Modified: python/branches/py3k-issue1717/Modules/_codecsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_codecsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/_codecsmodule.c Sun Jan 25 21:08:20 2009 @@ -258,7 +258,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_7_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -281,7 +281,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_8_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -305,7 +305,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -328,7 +328,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode", &pbuf, &errors, &final)) return NULL; @@ -352,7 +352,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode", &pbuf, &errors, &final)) return NULL; @@ -384,7 +384,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_16_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -409,7 +409,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -432,7 +432,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -455,7 +455,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -486,7 +486,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_32_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -542,7 +542,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:latin_1_decode", + if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode", &pbuf, &errors)) return NULL; @@ -559,7 +559,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:ascii_decode", + if (!PyArg_ParseTuple(args, "y*|z:ascii_decode", &pbuf, &errors)) return NULL; @@ -577,7 +577,7 @@ const char *errors = NULL; PyObject *mapping = NULL; - if (!PyArg_ParseTuple(args, "s*|zO:charmap_decode", + if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode", &pbuf, &errors, &mapping)) return NULL; if (mapping == Py_None) @@ -600,7 +600,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:mbcs_decode", + if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; Modified: python/branches/py3k-issue1717/Modules/_collectionsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_collectionsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/_collectionsmodule.c Sun Jan 25 21:08:20 2009 @@ -909,7 +909,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } @@ -1019,7 +1019,7 @@ it->deque = deque; it->state = deque->state; it->counter = deque->len; - _PyObject_GC_TRACK(it); + PyObject_GC_Track(it); return (PyObject *)it; } Modified: python/branches/py3k-issue1717/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_ctypes/callproc.c (original) +++ python/branches/py3k-issue1717/Modules/_ctypes/callproc.c Sun Jan 25 21:08:20 2009 @@ -645,8 +645,8 @@ #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { -#ifdef HAVE_USABLE_WCHAR_T pa->ffi_type = &ffi_type_pointer; +#ifdef HAVE_USABLE_WCHAR_T pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; Modified: python/branches/py3k-issue1717/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_ctypes/cfield.c (original) +++ python/branches/py3k-issue1717/Modules/_ctypes/cfield.c Sun Jan 25 21:08:20 2009 @@ -1472,11 +1472,14 @@ size += 1; /* terminating NUL */ size *= sizeof(wchar_t); buffer = (wchar_t *)PyMem_Malloc(size); - if (!buffer) + if (!buffer) { + Py_DECREF(value); return PyErr_NoMemory(); + } memset(buffer, 0, size); keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); if (!keep) { + Py_DECREF(value); PyMem_Free(buffer); return NULL; } Modified: python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c Sun Jan 25 21:08:20 2009 @@ -34,7 +34,7 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -extern void Py_FatalError(char *msg); +extern void Py_FatalError(const char *msg); /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) Modified: python/branches/py3k-issue1717/Modules/_dbmmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_dbmmodule.c (original) +++ python/branches/py3k-issue1717/Modules/_dbmmodule.c Sun Jan 25 21:08:20 2009 @@ -2,6 +2,7 @@ /* DBM module using dictionary interface */ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include Modified: python/branches/py3k-issue1717/Modules/_fileio.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_fileio.c (original) +++ python/branches/py3k-issue1717/Modules/_fileio.c Sun Jan 25 21:08:20 2009 @@ -55,12 +55,15 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) +static PyObject * +portable_lseek(int fd, PyObject *posobj, int whence); + /* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) { int err = 0; - int save_errno; + int save_errno = 0; if (self->fd >= 0) { int fd = self->fd; self->fd = -1; @@ -138,6 +141,24 @@ return 0; } +static int +check_fd(int fd) +{ +#if defined(HAVE_FSTAT) + struct stat buf; + if (fstat(fd, &buf) < 0 && errno == EBADF) { + PyObject *exc; + char *msg = strerror(EBADF); + exc = PyObject_CallFunction(PyExc_OSError, "(is)", + EBADF, msg); + PyErr_SetObject(PyExc_OSError, exc); + Py_XDECREF(exc); + return -1; + } +#endif + return 0; +} + static int fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) @@ -170,6 +191,8 @@ "Negative filedescriptor"); return -1; } + if (check_fd(fd)) + return -1; } else { PyErr_Clear(); @@ -295,6 +318,16 @@ goto error; } + if (append) { + /* For consistent behaviour, we explicitly seek to the + end of file (otherwise, it might be done only on the + first write()). */ + PyObject *pos = portable_lseek(self->fd, NULL, 2); + if (pos == NULL) + goto error; + Py_DECREF(pos); + } + goto done; error: @@ -571,7 +604,7 @@ #if SEEK_CUR != 1 case 1: whence = SEEK_CUR; break; #endif -#if SEEL_END != 2 +#if SEEK_END != 2 case 2: whence = SEEK_END; break; #endif } Modified: python/branches/py3k-issue1717/Modules/_hashopenssl.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_hashopenssl.c (original) +++ python/branches/py3k-issue1717/Modules/_hashopenssl.c Sun Jan 25 21:08:20 2009 @@ -26,15 +26,35 @@ #define HASH_OBJ_CONSTRUCTOR 0 #endif +#define HASHLIB_GIL_MINSIZE 2048 + +#ifdef WITH_THREAD + #include "pythread.h" + + #define ENTER_HASHLIB(obj) \ + if ((obj)->lock) { \ + if (!PyThread_acquire_lock((obj)->lock, 0)) { \ + Py_BEGIN_ALLOW_THREADS \ + PyThread_acquire_lock((obj)->lock, 1); \ + Py_END_ALLOW_THREADS \ + } \ + } + #define LEAVE_HASHLIB(obj) \ + if ((obj)->lock) { \ + PyThread_release_lock((obj)->lock); \ + } +#else + #define ENTER_HASHLIB(obj) + #define LEAVE_HASHLIB(obj) +#endif + typedef struct { PyObject_HEAD PyObject *name; /* name of this hash algorithm */ - EVP_MD_CTX ctx; /* OpenSSL message digest context */ - /* - * TODO investigate performance impact of including a lock for this object - * here and releasing the Python GIL while hash updates are in progress. - * (perhaps only release GIL if input length will take long to process?) - */ + EVP_MD_CTX ctx; /* OpenSSL message digest context */ +#ifdef WITH_THREAD + PyThread_type_lock lock; /* OpenSSL context lock */ +#endif } EVPobject; @@ -63,19 +83,42 @@ if (retval != NULL) { Py_INCREF(name); retval->name = name; +#ifdef WITH_THREAD + retval->lock = NULL; +#endif } return retval; } +static void +EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len) +{ + unsigned int process; + const unsigned char *cp = (const unsigned char *)vp; + while (0 < len) { + if (len > (Py_ssize_t)MUNCH_SIZE) + process = MUNCH_SIZE; + else + process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int); + EVP_DigestUpdate(&self->ctx, (const void*)cp, process); + len -= process; + cp += process; + } +} + /* Internal methods for a hash object */ static void -EVP_dealloc(PyObject *ptr) +EVP_dealloc(EVPobject *self) { - EVP_MD_CTX_cleanup(&((EVPobject *)ptr)->ctx); - Py_XDECREF(((EVPobject *)ptr)->name); - PyObject_Del(ptr); +#ifdef WITH_THREAD + if (self->lock != NULL) + PyThread_free_lock(self->lock); +#endif + EVP_MD_CTX_cleanup(&self->ctx); + Py_XDECREF(self->name); + PyObject_Del(self); } @@ -91,7 +134,9 @@ if ( (newobj = newEVPobject(self->name))==NULL) return NULL; + ENTER_HASHLIB(self); EVP_MD_CTX_copy(&newobj->ctx, &self->ctx); + LEAVE_HASHLIB(self); return (PyObject *)newobj; } @@ -106,7 +151,9 @@ PyObject *retval; unsigned int digest_size; + ENTER_HASHLIB(self); EVP_MD_CTX_copy(&temp_ctx, &self->ctx); + LEAVE_HASHLIB(self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -128,7 +175,9 @@ unsigned int i, j, digest_size; /* Get the raw (binary) digest value */ + ENTER_HASHLIB(self); EVP_MD_CTX_copy(&temp_ctx, &self->ctx); + LEAVE_HASHLIB(self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -137,16 +186,16 @@ /* Allocate a new buffer */ hex_digest = PyMem_Malloc(digest_size * 2 + 1); if (!hex_digest) - return PyErr_NoMemory(); + return PyErr_NoMemory(); /* Make hex version of the digest */ for(i=j=0; i> 4) & 0xf; - c = (c>9) ? c+'a'-10 : c + '0'; + c = (c>9) ? c+'a'-10 : c + '0'; hex_digest[j++] = c; c = (digest[i] & 0xf); - c = (c>9) ? c+'a'-10 : c + '0'; + c = (c>9) ? c+'a'-10 : c + '0'; hex_digest[j++] = c; } retval = PyUnicode_FromStringAndSize(hex_digest, digest_size * 2); @@ -155,21 +204,26 @@ } #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); + 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."); @@ -184,41 +238,60 @@ return NULL; MY_GET_BUFFER_VIEW_OR_ERROUT(obj, &view); - if (view.len > 0 && view.len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, view.buf, view.len); - } else { - Py_ssize_t offset = 0, len = view.len; - while (len) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf + offset, process); - len -= process; - offset += process; + +#ifdef WITH_THREAD + if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) { + self->lock = PyThread_allocate_lock(); + if (self->lock == NULL) { + PyBuffer_Release(&view); + PyErr_SetString(PyExc_MemoryError, "unable to allocate lock"); + return NULL; } } - PyBuffer_Release(&view); - Py_INCREF(Py_None); - return Py_None; + if (self->lock != NULL) { + Py_BEGIN_ALLOW_THREADS + PyThread_acquire_lock(self->lock, 1); + EVP_hash(self, view.buf, view.len); + PyThread_release_lock(self->lock); + Py_END_ALLOW_THREADS + } else { + EVP_hash(self, view.buf, view.len); + } +#else + EVP_hash(self, view.buf, view.len); +#endif + + PyBuffer_Release(&view); + Py_RETURN_NONE; } static PyMethodDef EVP_methods[] = { - {"update", (PyCFunction)EVP_update, METH_VARARGS, EVP_update__doc__}, - {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__}, + {"update", (PyCFunction)EVP_update, METH_VARARGS, EVP_update__doc__}, + {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__}, {"hexdigest", (PyCFunction)EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__}, - {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__}, - {NULL, NULL} /* sentinel */ + {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__}, + {NULL, NULL} /* sentinel */ }; static PyObject * EVP_get_block_size(EVPobject *self, void *closure) { - return PyLong_FromLong(EVP_MD_CTX_block_size(&((EVPobject *)self)->ctx)); + long block_size; + ENTER_HASHLIB(self); + block_size = EVP_MD_CTX_block_size(&self->ctx); + LEAVE_HASHLIB(self); + return PyLong_FromLong(block_size); } static PyObject * EVP_get_digest_size(EVPobject *self, void *closure) { - return PyLong_FromLong(EVP_MD_CTX_size(&((EVPobject *)self)->ctx)); + long size; + ENTER_HASHLIB(self); + size = EVP_MD_CTX_size(&self->ctx); + LEAVE_HASHLIB(self); + return PyLong_FromLong(size); } static PyMemberDef EVP_members[] = { @@ -246,11 +319,11 @@ static PyObject * -EVP_repr(PyObject *self) +EVP_repr(EVPobject *self) { char buf[100]; PyOS_snprintf(buf, sizeof(buf), "<%s HASH object @ %p>", - _PyUnicode_AsString(((EVPobject *)self)->name), self); + _PyUnicode_AsString(self->name), self); return PyUnicode_FromString(buf); } @@ -293,21 +366,16 @@ Py_INCREF(self->name); if (data_obj) { - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + if (view.len >= HASHLIB_GIL_MINSIZE) { + Py_BEGIN_ALLOW_THREADS + EVP_hash(self, view.buf, view.len); + Py_END_ALLOW_THREADS } else { - Py_ssize_t offset = 0, len = view.len; - while (len) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf + offset, process); - len -= process; - offset += process; - } + EVP_hash(self, view.buf, view.len); } PyBuffer_Release(&view); } - + return 0; } #endif @@ -332,15 +400,15 @@ static PyTypeObject EVPtype = { PyVarObject_HEAD_INIT(NULL, 0) "_hashlib.HASH", /*tp_name*/ - sizeof(EVPobject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + sizeof(EVPobject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - EVP_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ + (destructor)EVP_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_reserved*/ - EVP_repr, /*tp_repr*/ + (reprfunc)EVP_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ @@ -353,13 +421,13 @@ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ hashtype_doc, /*tp_doc*/ 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - EVP_methods, /* tp_methods */ - EVP_members, /* tp_members */ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + EVP_methods, /* tp_methods */ + EVP_members, /* tp_members */ EVP_getseters, /* tp_getset */ #if 1 0, /* tp_base */ @@ -395,17 +463,12 @@ } if (cp && len) { - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + if (len >= HASHLIB_GIL_MINSIZE) { + Py_BEGIN_ALLOW_THREADS + EVP_hash(self, cp, len); + Py_END_ALLOW_THREADS } else { - Py_ssize_t offset = 0; - while (len) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, cp + offset, process); - len -= process; - offset += process; - } + EVP_hash(self, cp, len); } } @@ -522,7 +585,7 @@ CONSTRUCTOR_METH_DEF(sha256), CONSTRUCTOR_METH_DEF(sha384), CONSTRUCTOR_METH_DEF(sha512), - {NULL, NULL} /* Sentinel */ + {NULL, NULL} /* Sentinel */ }; @@ -530,15 +593,15 @@ static struct PyModuleDef _hashlibmodule = { - PyModuleDef_HEAD_INIT, - "_hashlib", - NULL, - -1, - EVP_functions, - NULL, - NULL, - NULL, - NULL + PyModuleDef_HEAD_INIT, + "_hashlib", + NULL, + -1, + EVP_functions, + NULL, + NULL, + NULL, + NULL }; PyMODINIT_FUNC 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 Sun Jan 25 21:08:20 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/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c (original) +++ python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c Sun Jan 25 21:08:20 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/py3k-issue1717/Modules/_multiprocessing/socket_connection.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c (original) +++ python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c Sun Jan 25 21:08:20 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); Modified: python/branches/py3k-issue1717/Modules/_pickle.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_pickle.c (original) +++ python/branches/py3k-issue1717/Modules/_pickle.c Sun Jan 25 21:08:20 2009 @@ -846,8 +846,8 @@ /* Text-mode pickle, or long too big to fit in the 4-byte * signed BININT format: store as a string. */ - pdata[0] = LONG; /* use LONG for consistence with pickle.py */ - PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", x); + pdata[0] = LONG; /* use LONG for consistency with pickle.py */ + PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x); if (pickler_write(self, pdata, strlen(pdata)) < 0) return -1; } @@ -977,8 +977,9 @@ else { char *string; - /* proto < 2: write the repr and newline. This is quadratic-time - (in the number of digits), in both directions. */ + /* proto < 2: write the repr and newline. This is quadratic-time (in + the number of digits), in both directions. We add a trailing 'L' + to the repr, for compatibility with Python 2.x. */ repr = PyObject_Repr(obj); if (repr == NULL) @@ -990,7 +991,7 @@ if (pickler_write(self, &long_op, 1) < 0 || pickler_write(self, string, size) < 0 || - pickler_write(self, "\n", 1) < 0) + pickler_write(self, "L\n", 2) < 0) goto error; } @@ -2888,8 +2889,16 @@ if (len < 2) return bad_readline(); + /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove + the 'L' before calling PyLong_FromString. In order to maintain + compatibility with Python 3.0.0, we don't actually *require* + the 'L' to be present. */ + if (s[len-2] == 'L') { + s[len-2] = '\0'; + } /* XXX: Should the base argument explicitly set to 10? */ - if ((value = PyLong_FromString(s, NULL, 0)) == NULL) + value = PyLong_FromString(s, NULL, 0); + if (value == NULL) return -1; PDATA_PUSH(self->stack, value, -1); @@ -2949,7 +2958,8 @@ errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); return -1; } Modified: python/branches/py3k-issue1717/Modules/_struct.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_struct.c (original) +++ python/branches/py3k-issue1717/Modules/_struct.c Sun Jan 25 21:08:20 2009 @@ -127,8 +127,8 @@ return v; } m = Py_TYPE(v)->tp_as_number; - if (m != NULL && m->nb_long != NULL) { - v = m->nb_long(v); + if (m != NULL && m->nb_int != NULL) { + v = m->nb_int(v); if (v == NULL) return NULL; if (PyLong_Check(v)) @@ -155,7 +155,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_long(o, p); @@ -260,7 +260,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_wrapped_long(o, p); @@ -299,7 +299,7 @@ PyErr_Clear(); if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) return -1; - o = PyNumber_Int(v); + o = PyNumber_Long(v); if (o == NULL) return -1; res = get_wrapped_ulong(o, p); @@ -661,7 +661,7 @@ return -1; #if (SIZEOF_LONG > SIZEOF_INT) if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX))) - return _range_error(f, 0); + RANGE_ERROR(x, f, 0, -1); #endif y = (int)x; memcpy(p, (char *)&y, sizeof y); @@ -673,12 +673,12 @@ { unsigned long x; unsigned int y; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; y = (unsigned int)x; #if (SIZEOF_LONG > SIZEOF_INT) if (x > ((unsigned long)UINT_MAX)) - return _range_error(f, 1); + RANGE_ERROR(y, f, 1, -1); #endif memcpy(p, (char *)&y, sizeof y); return 0; @@ -698,8 +698,8 @@ np_ulong(char *p, PyObject *v, const formatdef *f) { unsigned long x; - if (get_ulong(v, &x) < 0) - return _range_error(f, 1); + if (get_wrapped_ulong(v, &x) < 0) + return -1; memcpy(p, (char *)&x, sizeof x); return 0; } Modified: python/branches/py3k-issue1717/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_testcapimodule.c (original) +++ python/branches/py3k-issue1717/Modules/_testcapimodule.c Sun Jan 25 21:08:20 2009 @@ -919,6 +919,43 @@ return NULL; Py_RETURN_NONE; } + +/* test Py_AddPendingCalls using threads */ +static int _pending_callback(void *arg) +{ + /* we assume the argument is callable object to which we own a reference */ + PyObject *callable = (PyObject *)arg; + PyObject *r = PyObject_CallObject(callable, NULL); + Py_DECREF(callable); + Py_XDECREF(r); + return r != NULL ? 0 : -1; +} + +/* The following requests n callbacks to _pending_callback. It can be + * run from any python thread. + */ +PyObject *pending_threadfunc(PyObject *self, PyObject *arg) +{ + PyObject *callable; + int r; + if (PyArg_ParseTuple(arg, "O", &callable) == 0) + return NULL; + + /* create the reference for the callbackwhile we hold the lock */ + Py_INCREF(callable); + + Py_BEGIN_ALLOW_THREADS + r = Py_AddPendingCall(&_pending_callback, callable); + Py_END_ALLOW_THREADS + + if (r<0) { + Py_DECREF(callable); /* unsuccessful add, destroy the extra reference */ + Py_INCREF(Py_False); + return Py_False; + } + Py_INCREF(Py_True); + return Py_True; +} #endif /* Some tests of PyUnicode_FromFormat(). This needs more tests. */ @@ -1171,6 +1208,7 @@ {"test_Z_code", (PyCFunction)test_Z_code, METH_NOARGS}, #ifdef WITH_THREAD {"_test_thread_state", test_thread_state, METH_VARARGS}, + {"_pending_threadfunc", pending_threadfunc, METH_VARARGS}, #endif #ifdef HAVE_GETTIMEOFDAY {"profile_int", profile_int, METH_NOARGS}, Modified: python/branches/py3k-issue1717/Modules/_tkinter.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_tkinter.c (original) +++ python/branches/py3k-issue1717/Modules/_tkinter.c Sun Jan 25 21:08:20 2009 @@ -2160,19 +2160,7 @@ &file, &mask, &func)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.createfilehandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); if (tfile < 0) @@ -2203,19 +2191,7 @@ if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.deletefilehandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); if (tfile < 0) @@ -2389,19 +2365,7 @@ return NULL; } -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.createtimerhandler not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - } + CHECK_TCL_APPARTMENT; v = Tktt_New(func); if (v) { @@ -2427,20 +2391,8 @@ if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold)) return NULL; -#ifdef WITH_THREAD - if (!self && !tcl_lock) { - /* We don't have the Tcl lock since Tcl is threaded. */ - PyErr_SetString(PyExc_RuntimeError, - "_tkinter.mainloop not supported " - "for threaded Tcl"); - return NULL; - } -#endif - - if (self) { - CHECK_TCL_APPARTMENT; - self->dispatching = 1; - } + CHECK_TCL_APPARTMENT; + self->dispatching = 1; quitMainLoop = 0; while (Tk_GetNumMainWindows() > threshold && @@ -2450,7 +2402,7 @@ int result; #ifdef WITH_THREAD - if (self && self->threaded) { + if (self->threaded) { /* Allow other Python threads to run. */ ENTER_TCL result = Tcl_DoOneEvent(0); @@ -2472,15 +2424,13 @@ #endif if (PyErr_CheckSignals() != 0) { - if (self) - self->dispatching = 0; + self->dispatching = 0; return NULL; } if (result < 0) break; } - if (self) - self->dispatching = 0; + self->dispatching = 0; quitMainLoop = 0; if (errorInCmd) { @@ -2873,14 +2823,6 @@ { {"_flatten", Tkinter_Flatten, METH_VARARGS}, {"create", Tkinter_Create, METH_VARARGS}, -#ifdef HAVE_CREATEFILEHANDLER - {"createfilehandler", Tkapp_CreateFileHandler, METH_VARARGS}, - {"deletefilehandler", Tkapp_DeleteFileHandler, METH_VARARGS}, -#endif - {"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS}, - {"mainloop", Tkapp_MainLoop, METH_VARARGS}, - {"dooneevent", Tkapp_DoOneEvent, METH_VARARGS}, - {"quit", Tkapp_Quit, METH_VARARGS}, {"setbusywaitinterval",Tkinter_setbusywaitinterval, METH_VARARGS, setbusywaitinterval_doc}, {"getbusywaitinterval",(PyCFunction)Tkinter_getbusywaitinterval, Modified: python/branches/py3k-issue1717/Modules/bz2module.c ============================================================================== --- python/branches/py3k-issue1717/Modules/bz2module.c (original) +++ python/branches/py3k-issue1717/Modules/bz2module.c Sun Jan 25 21:08:20 2009 @@ -1086,6 +1086,36 @@ return ret; } +PyDoc_STRVAR(BZ2File_enter_doc, +"__enter__() -> self."); + +static PyObject * +BZ2File_enter(BZ2FileObject *self) +{ + if (self->mode == MODE_CLOSED) { + PyErr_SetString(PyExc_ValueError, + "I/O operation on closed file"); + return NULL; + } + Py_INCREF(self); + return (PyObject *) self; +} + +PyDoc_STRVAR(BZ2File_exit_doc, +"__exit__(*excinfo) -> None. Closes the file."); + +static PyObject * +BZ2File_exit(BZ2FileObject *self, PyObject *args) +{ + PyObject *ret = PyObject_CallMethod((PyObject *) self, "close", NULL); + if (!ret) + /* If error occurred, pass through */ + return NULL; + Py_DECREF(ret); + Py_RETURN_NONE; +} + + static PyObject *BZ2File_getiter(BZ2FileObject *self); static PyMethodDef BZ2File_methods[] = { @@ -1097,6 +1127,8 @@ {"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__}, {"tell", (PyCFunction)BZ2File_tell, METH_NOARGS, BZ2File_tell__doc__}, {"close", (PyCFunction)BZ2File_close, METH_NOARGS, BZ2File_close__doc__}, + {"__enter__", (PyCFunction)BZ2File_enter, METH_NOARGS, BZ2File_enter_doc}, + {"__exit__", (PyCFunction)BZ2File_exit, METH_VARARGS, BZ2File_exit_doc}, {NULL, NULL} /* sentinel */ }; Modified: python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c Sun Jan 25 21:08:20 2009 @@ -612,7 +612,7 @@ const char *data, *errors = NULL; Py_ssize_t datalen, finalsize; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|z:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode", codeckwarglist, &pdata, &errors)) return NULL; data = pdata.buf; @@ -1038,7 +1038,7 @@ Py_ssize_t wsize, finalsize = 0, size, origpending; int final = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode", incrementalkwarglist, &pdata, &final)) return NULL; data = pdata.buf; Modified: python/branches/py3k-issue1717/Modules/datetimemodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/datetimemodule.c (original) +++ python/branches/py3k-issue1717/Modules/datetimemodule.c Sun Jan 25 21:08:20 2009 @@ -2111,7 +2111,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ Modified: python/branches/py3k-issue1717/Modules/gcmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/gcmodule.c (original) +++ python/branches/py3k-issue1717/Modules/gcmodule.c Sun Jan 25 21:08:20 2009 @@ -68,6 +68,55 @@ /* Python string used to look for __del__ attribute. */ static PyObject *delstr = NULL; +/* This is the number of objects who survived the last full collection. It + approximates the number of long lived objects tracked by the GC. + + (by "full collection", we mean a collection of the oldest generation). +*/ +static Py_ssize_t long_lived_total = 0; + +/* This is the number of objects who survived all "non-full" collections, + and are awaiting to undergo a full collection for the first time. + +*/ +static Py_ssize_t long_lived_pending = 0; + +/* + NOTE: about the counting of long-lived objects. + + To limit the cost of garbage collection, there are two strategies; + - make each collection faster, e.g. by scanning fewer objects + - do less collections + This heuristic is about the latter strategy. + + In addition to the various configurable thresholds, we only trigger a + full collection if the ratio + long_lived_pending / long_lived_total + is above a given value (hardwired to 25%). + + The reason is that, while "non-full" collections (i.e., collections of + the young and middle generations) will always examine roughly the same + number of objects -- determined by the aforementioned thresholds --, + the cost of a full collection is proportional to the total number of + long-lived objects, which is virtually unbounded. + + Indeed, it has been remarked that doing a full collection every + of object creations entails a dramatic performance + degradation in workloads which consist in creating and storing lots of + long-lived objects (e.g. building a large list of GC-tracked objects would + show quadratic performance, instead of linear as expected: see issue #4074). + + Using the above ratio, instead, yields amortized linear performance in + the total number of objects (the effect of which can be summarized + thusly: "each full garbage collection is more and more costly as the + number of objects grows, but we do fewer and fewer of them"). + + This heuristic was suggested by Martin von L??wis on python-dev in + June 2008. His original analysis and proposal can be found at: + http://mail.python.org/pipermail/python-dev/2008-June/080579.html +*/ + + /* set for debugging information */ #define DEBUG_STATS (1<<0) /* print collection statistics */ #define DEBUG_COLLECTABLE (1<<1) /* print collectable objects */ @@ -795,8 +844,16 @@ move_unreachable(young, &unreachable); /* Move reachable objects to next generation. */ - if (young != old) + if (young != old) { + if (generation == NUM_GENERATIONS - 2) { + long_lived_pending += gc_list_size(young); + } gc_list_merge(young, old); + } + else { + long_lived_pending = 0; + long_lived_total = gc_list_size(young); + } /* All objects in unreachable are trash, but objects reachable from * finalizers can't safely be deleted. Python programmers should take @@ -890,6 +947,13 @@ * generations younger than it will be collected. */ for (i = NUM_GENERATIONS-1; i >= 0; i--) { if (generations[i].count > generations[i].threshold) { + /* Avoid quadratic performance degradation in number + of tracked objects. See comments at the beginning + of this file, and issue #4074. + */ + if (i == NUM_GENERATIONS - 1 + && long_lived_pending < long_lived_total / 4) + continue; n = collect(i); break; } Modified: python/branches/py3k-issue1717/Modules/grpmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/grpmodule.c (original) +++ python/branches/py3k-issue1717/Modules/grpmodule.c Sun Jan 25 21:08:20 2009 @@ -90,7 +90,7 @@ unsigned int gid; struct group *p; - py_int_id = PyNumber_Int(pyo_id); + py_int_id = PyNumber_Long(pyo_id); if (!py_int_id) return NULL; gid = PyLong_AS_LONG(py_int_id); Modified: python/branches/py3k-issue1717/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/itertoolsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/itertoolsmodule.c Sun Jan 25 21:08:20 2009 @@ -886,7 +886,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -1031,7 +1030,6 @@ if (lz->stop == 1) return NULL; - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) return NULL; @@ -1218,7 +1216,6 @@ Py_ssize_t oldnext; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; while (lz->cnt < lz->next) { item = iternext(it); @@ -1229,7 +1226,6 @@ } if (lz->stop != -1 && lz->cnt >= lz->stop) return NULL; - assert(PyIter_Check(it)); item = iternext(it); if (item == NULL) return NULL; @@ -1361,7 +1357,6 @@ PyObject *result; PyObject *it = lz->it; - assert(PyIter_Check(it)); args = (*Py_TYPE(it)->tp_iternext)(it); if (args == NULL) return NULL; @@ -1880,10 +1875,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); if (indices == NULL) { @@ -1903,7 +1894,7 @@ co->indices = indices; co->result = NULL; co->r = r; - co->stopped = 0; + co->stopped = r > n ? 1 : 0; return (PyObject *)co; @@ -2143,10 +2134,6 @@ PyErr_SetString(PyExc_ValueError, "r must be non-negative"); goto error; } - if (r > n) { - PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable"); - goto error; - } indices = PyMem_Malloc(n * sizeof(Py_ssize_t)); cycles = PyMem_Malloc(r * sizeof(Py_ssize_t)); @@ -2170,7 +2157,7 @@ po->cycles = cycles; po->result = NULL; po->r = r; - po->stopped = 0; + po->stopped = r > n ? 1 : 0; return (PyObject *)po; @@ -2411,7 +2398,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -2896,7 +2882,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; @@ -2925,7 +2910,6 @@ Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; Modified: python/branches/py3k-issue1717/Modules/main.c ============================================================================== --- python/branches/py3k-issue1717/Modules/main.c (original) +++ python/branches/py3k-issue1717/Modules/main.c Sun Jan 25 21:08:20 2009 @@ -292,7 +292,6 @@ wchar_t *module = NULL; FILE *fp = stdin; char *p; - int unbuffered = 0; int skipfirstline = 0; int stdin_is_interactive = 0; int help = 0; @@ -374,7 +373,7 @@ break; case 'u': - unbuffered++; + Py_UnbufferedStdioFlag = 1; saw_unbuffered_flag = 1; break; @@ -423,7 +422,7 @@ Py_InspectFlag = 1; if (!saw_unbuffered_flag && (p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0') - unbuffered = 1; + Py_UnbufferedStdioFlag = 1; if (!Py_NoUserSiteDirectory && (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0') @@ -444,7 +443,7 @@ stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); - if (unbuffered) { + if (Py_UnbufferedStdioFlag) { #if defined(MS_WINDOWS) || defined(__CYGWIN__) _setmode(fileno(stdin), O_BINARY); _setmode(fileno(stdout), O_BINARY); Modified: python/branches/py3k-issue1717/Modules/posixmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/posixmodule.c (original) +++ python/branches/py3k-issue1717/Modules/posixmodule.c Sun Jan 25 21:08:20 2009 @@ -5114,10 +5114,8 @@ Py_BEGIN_ALLOW_THREADS res = ftruncate(fd, length); Py_END_ALLOW_THREADS - if (res < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; - } + if (res < 0) + return posix_error(); Py_INCREF(Py_None); return Py_None; } Modified: python/branches/py3k-issue1717/Modules/selectmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/selectmodule.c (original) +++ python/branches/py3k-issue1717/Modules/selectmodule.c Sun Jan 25 21:08:20 2009 @@ -515,7 +515,7 @@ return NULL; } else { - tout = PyNumber_Int(tout); + tout = PyNumber_Long(tout); if (!tout) return NULL; timeout = PyLong_AsLong(tout); Modified: python/branches/py3k-issue1717/Modules/socketmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/socketmodule.c (original) +++ python/branches/py3k-issue1717/Modules/socketmodule.c Sun Jan 25 21:08:20 2009 @@ -3159,7 +3159,11 @@ #ifdef HAVE_GETHOSTBYNAME_R_3_ARG struct hostent_data data; #else - char buf[16384]; + /* glibcs up to 2.10 assume that the buf argument to + gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc + does not ensure. The attribute below instructs the compiler + to maintain this alignment. */ + char buf[16384] Py_ALIGNED(8); int buf_len = (sizeof buf) - 1; int errnop; #endif Modified: python/branches/py3k-issue1717/Modules/zlibmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/zlibmodule.c (original) +++ python/branches/py3k-issue1717/Modules/zlibmodule.c Sun Jan 25 21:08:20 2009 @@ -9,38 +9,15 @@ #include "zlib.h" #ifdef WITH_THREAD -#include "pythread.h" - -/* #defs ripped off from _tkinter.c, even though the situation here is much - simpler, because we don't have to worry about waiting for Tcl - events! And, since zlib itself is threadsafe, we don't need to worry - about re-entering zlib functions. - - N.B. - - Since ENTER_ZLIB and LEAVE_ZLIB only need to be called on functions - that modify the components of preexisting de/compress objects, it - could prove to be a performance gain on multiprocessor machines if - there was an de/compress object-specific lock. However, for the - moment the ENTER_ZLIB and LEAVE_ZLIB calls are global for ALL - de/compress objects. - */ - -static PyThread_type_lock zlib_lock = NULL; /* initialized on module load */ - -#define ENTER_ZLIB \ - Py_BEGIN_ALLOW_THREADS \ - PyThread_acquire_lock(zlib_lock, 1); \ - Py_END_ALLOW_THREADS - -#define LEAVE_ZLIB \ - PyThread_release_lock(zlib_lock); - + #include "pythread.h" + #define ENTER_ZLIB(obj) \ + Py_BEGIN_ALLOW_THREADS; \ + PyThread_acquire_lock((obj)->lock, 1); \ + Py_END_ALLOW_THREADS; + #define LEAVE_ZLIB(obj) PyThread_release_lock((obj)->lock); #else - -#define ENTER_ZLIB -#define LEAVE_ZLIB - + #define ENTER_ZLIB(obj) + #define LEAVE_ZLIB(obj) #endif /* The following parameters are copied from zutil.h, version 0.95 */ @@ -67,6 +44,9 @@ PyObject *unused_data; PyObject *unconsumed_tail; int is_initialised; + #ifdef WITH_THREAD + PyThread_type_lock lock; + #endif } compobject; static void @@ -106,6 +86,9 @@ Py_DECREF(self); return NULL; } +#ifdef WITH_THREAD + self->lock = PyThread_allocate_lock(); +#endif return self; } @@ -376,23 +359,30 @@ } static void -Comp_dealloc(compobject *self) +Dealloc(compobject *self) { - if (self->is_initialised) - deflateEnd(&self->zst); +#ifdef WITH_THREAD + PyThread_free_lock(self->lock); +#endif Py_XDECREF(self->unused_data); Py_XDECREF(self->unconsumed_tail); PyObject_Del(self); } static void +Comp_dealloc(compobject *self) +{ + if (self->is_initialised) + deflateEnd(&self->zst); + Dealloc(self); +} + +static void Decomp_dealloc(compobject *self) { if (self->is_initialised) - inflateEnd(&self->zst); - Py_XDECREF(self->unused_data); - Py_XDECREF(self->unconsumed_tail); - PyObject_Del(self); + inflateEnd(&self->zst); + Dealloc(self); } PyDoc_STRVAR(comp_compress__doc__, @@ -422,7 +412,7 @@ return NULL; } - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_in = inplen; @@ -468,7 +458,7 @@ } error: - LEAVE_ZLIB + LEAVE_ZLIB(self); PyBuffer_Release(&pinput); return RetVal; } @@ -514,7 +504,7 @@ return NULL; } - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_in = inplen; @@ -600,7 +590,7 @@ } error: - LEAVE_ZLIB + LEAVE_ZLIB(self); PyBuffer_Release(&pinput); return RetVal; } @@ -633,7 +623,7 @@ if (!(RetVal = PyBytes_FromStringAndSize(NULL, length))) return NULL; - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_in = 0; @@ -693,7 +683,7 @@ } error: - LEAVE_ZLIB + LEAVE_ZLIB(self); return RetVal; } @@ -714,7 +704,7 @@ /* Copy the zstream state * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe */ - ENTER_ZLIB + ENTER_ZLIB(self); err = deflateCopy(&retval->zst, &self->zst); switch(err) { case(Z_OK): @@ -730,7 +720,6 @@ zlib_error(self->zst, err, "while copying compression object"); goto error; } - Py_INCREF(self->unused_data); Py_INCREF(self->unconsumed_tail); Py_XDECREF(retval->unused_data); @@ -741,11 +730,11 @@ /* Mark it as being initialized */ retval->is_initialised = 1; - LEAVE_ZLIB + LEAVE_ZLIB(self); return (PyObject *)retval; error: - LEAVE_ZLIB + LEAVE_ZLIB(self); Py_XDECREF(retval); return NULL; } @@ -765,7 +754,7 @@ /* Copy the zstream state * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe */ - ENTER_ZLIB + ENTER_ZLIB(self); err = inflateCopy(&retval->zst, &self->zst); switch(err) { case(Z_OK): @@ -792,11 +781,11 @@ /* Mark it as being initialized */ retval->is_initialised = 1; - LEAVE_ZLIB + LEAVE_ZLIB(self); return (PyObject *)retval; error: - LEAVE_ZLIB + LEAVE_ZLIB(self); Py_XDECREF(retval); return NULL; } @@ -826,7 +815,7 @@ return NULL; - ENTER_ZLIB + ENTER_ZLIB(self); start_total_out = self->zst.total_out; self->zst.avail_out = length; @@ -873,7 +862,7 @@ error: - LEAVE_ZLIB + LEAVE_ZLIB(self); return retval; } @@ -921,12 +910,20 @@ PyZlib_adler32(PyObject *self, PyObject *args) { unsigned int adler32val = 1; /* adler32(0L, Z_NULL, 0) */ - Byte *buf; - int len; + Py_buffer pbuf; - if (!PyArg_ParseTuple(args, "s#|I:adler32", &buf, &len, &adler32val)) + if (!PyArg_ParseTuple(args, "s*|I:adler32", &pbuf, &adler32val)) return NULL; - adler32val = adler32(adler32val, buf, len); + /* Releasing the GIL for very small buffers is inefficient + and may lower performance */ + if (pbuf.len > 1024*5) { + Py_BEGIN_ALLOW_THREADS + adler32val = adler32(adler32val, pbuf.buf, pbuf.len); + Py_END_ALLOW_THREADS + } else { + adler32val = adler32(adler32val, pbuf.buf, pbuf.len); + } + PyBuffer_Release(&pbuf); return PyLong_FromUnsignedLong(adler32val & 0xffffffffU); } @@ -945,7 +942,15 @@ if (!PyArg_ParseTuple(args, "s*|I:crc32", &pbuf, &crc32val)) return NULL; - signed_val = crc32(crc32val, pbuf.buf, pbuf.len); + /* Releasing the GIL for very small buffers is inefficient + and may lower performance */ + if (pbuf.len > 1024*5) { + Py_BEGIN_ALLOW_THREADS + signed_val = crc32(crc32val, pbuf.buf, pbuf.len); + Py_END_ALLOW_THREADS + } else { + signed_val = crc32(crc32val, pbuf.buf, pbuf.len); + } PyBuffer_Release(&pbuf); return PyLong_FromUnsignedLong(signed_val & 0xffffffffU); } @@ -1096,8 +1101,5 @@ PyModule_AddStringConstant(m, "__version__", "1.0"); -#ifdef WITH_THREAD - zlib_lock = PyThread_allocate_lock(); -#endif /* WITH_THREAD */ return m; } Modified: python/branches/py3k-issue1717/Objects/abstract.c ============================================================================== --- python/branches/py3k-issue1717/Objects/abstract.c (original) +++ python/branches/py3k-issue1717/Objects/abstract.c Sun Jan 25 21:08:20 2009 @@ -1361,19 +1361,7 @@ } return res; } - if (m && m->nb_long) { /* This should include subclasses of long */ - /* Classic classes always take this branch. */ - PyObject *res = m->nb_long(o); - if (res && !PyLong_Check(res)) { - PyErr_Format(PyExc_TypeError, - "__long__ returned non-long (type %.200s)", - res->ob_type->tp_name); - Py_DECREF(res); - return NULL; - } - return res; - } - if (PyLong_Check(o)) /* A long subclass without nb_long */ + if (PyLong_Check(o)) /* An int subclass without nb_int */ return _PyLong_Copy((PyLongObject *)o); trunc_func = PyObject_GetAttr(o, trunc_name); if (trunc_func) { @@ -2730,7 +2718,6 @@ PyIter_Next(PyObject *iter) { PyObject *result; - assert(PyIter_Check(iter)); result = (*iter->ob_type->tp_iternext)(iter); if (result == NULL && PyErr_Occurred() && Modified: python/branches/py3k-issue1717/Objects/boolobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/boolobject.c (original) +++ python/branches/py3k-issue1717/Objects/boolobject.c Sun Jan 25 21:08:20 2009 @@ -109,7 +109,7 @@ bool_xor, /* nb_xor */ bool_or, /* nb_or */ 0, /* nb_int */ - 0, /* nb_long */ + 0, /* nb_reserved */ 0, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k-issue1717/Objects/bytesobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/bytesobject.c (original) +++ python/branches/py3k-issue1717/Objects/bytesobject.c Sun Jan 25 21:08:20 2009 @@ -26,7 +26,7 @@ } #ifdef COUNT_ALLOCS -int null_strings, one_strings; +Py_ssize_t null_strings, one_strings; #endif static PyBytesObject *characters[UCHAR_MAX + 1]; Modified: python/branches/py3k-issue1717/Objects/complexobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/complexobject.c (original) +++ python/branches/py3k-issue1717/Objects/complexobject.c Sun Jan 25 21:08:20 2009 @@ -661,14 +661,6 @@ } static PyObject * -complex_long(PyObject *v) -{ - PyErr_SetString(PyExc_TypeError, - "can't convert complex to long; use long(abs(z))"); - return NULL; -} - -static PyObject * complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, @@ -1068,7 +1060,7 @@ 0, /* nb_xor */ 0, /* nb_or */ complex_int, /* nb_int */ - complex_long, /* nb_long */ + 0, /* nb_reserved */ complex_float, /* nb_float */ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k-issue1717/Objects/exceptions.c ============================================================================== --- python/branches/py3k-issue1717/Objects/exceptions.c (original) +++ python/branches/py3k-issue1717/Objects/exceptions.c Sun Jan 25 21:08:20 2009 @@ -1923,7 +1923,7 @@ PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) - Py_FatalError("Cannot pre-allocate MemoryError instance\n"); + Py_FatalError("Cannot pre-allocate MemoryError instance"); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) Modified: python/branches/py3k-issue1717/Objects/floatobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/floatobject.c (original) +++ python/branches/py3k-issue1717/Objects/floatobject.c Sun Jan 25 21:08:20 2009 @@ -1495,12 +1495,6 @@ py_exponent = NULL; } - /* Returns ints instead of longs where possible */ - INPLACE_UPDATE(numerator, PyNumber_Int(numerator)); - if (numerator == NULL) goto error; - INPLACE_UPDATE(denominator, PyNumber_Int(denominator)); - if (denominator == NULL) goto error; - result_pair = PyTuple_Pack(2, numerator, denominator); #undef INPLACE_UPDATE @@ -1798,7 +1792,7 @@ 0, /*nb_xor*/ 0, /*nb_or*/ float_trunc, /*nb_int*/ - float_trunc, /*nb_long*/ + 0, /*nb_reserved*/ float_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k-issue1717/Objects/longobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/longobject.c (original) +++ python/branches/py3k-issue1717/Objects/longobject.c Sun Jan 25 21:08:20 2009 @@ -175,7 +175,7 @@ PyLong_FromLong(long ival) { PyLongObject *v; - unsigned long abs_ival; + unsigned long abs_ival; unsigned long t; /* unsigned so >> doesn't propagate sign bit */ int ndigits = 0; int sign = 1; @@ -183,33 +183,35 @@ CHECK_SMALL_INT(ival); if (ival < 0) { - /* if LONG_MIN == -LONG_MAX-1 (true on most platforms) then - ANSI C says that the result of -ival is undefined when ival - == LONG_MIN. Hence the following workaround. */ - abs_ival = (unsigned long)(-1-ival) + 1; + /* negate: can't write this as abs_ival = -ival since that + invokes undefined behaviour when ival is LONG_MIN */ + abs_ival = 0U-(unsigned long)ival; sign = -1; } else { abs_ival = (unsigned long)ival; } - /* Fast path for single-digits ints */ - if (!(ival>>PyLong_SHIFT)) { + /* Fast path for single-digit ints */ + if (!(abs_ival >> PyLong_SHIFT)) { v = _PyLong_New(1); if (v) { Py_SIZE(v) = sign; - v->ob_digit[0] = (digit)ival; + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival, unsigned long, digit); } return (PyObject*)v; } /* 2 digits */ - if (!(ival >> 2*PyLong_SHIFT)) { + if (!(abs_ival >> 2*PyLong_SHIFT)) { v = _PyLong_New(2); if (v) { Py_SIZE(v) = 2*sign; - v->ob_digit[0] = (digit)ival & PyLong_MASK; - v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT); + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival & PyLong_MASK, unsigned long, digit); + v->ob_digit[1] = Py_SAFE_DOWNCAST( + abs_ival >> PyLong_SHIFT, unsigned long, digit); } return (PyObject*)v; } @@ -226,7 +228,8 @@ Py_SIZE(v) = ndigits*sign; t = abs_ival; while (t) { - *p++ = (digit)(t & PyLong_MASK); + *p++ = Py_SAFE_DOWNCAST( + t & PyLong_MASK, unsigned long, digit); t >>= PyLong_SHIFT; } } @@ -739,7 +742,7 @@ /* Because we're going LSB to MSB, thisbyte is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisbyte << accumbits; + accum |= (twodigits)thisbyte << accumbits; accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ @@ -768,7 +771,7 @@ unsigned char* bytes, size_t n, int little_endian, int is_signed) { - int i; /* index into v->ob_digit */ + Py_ssize_t i; /* index into v->ob_digit */ Py_ssize_t ndigits; /* |v->ob_size| */ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ @@ -813,7 +816,7 @@ accumbits = 0; carry = do_twos_comp ? 1 : 0; for (i = 0; i < ndigits; ++i) { - twodigits thisdigit = v->ob_digit[i]; + digit thisdigit = v->ob_digit[i]; if (do_twos_comp) { thisdigit = (thisdigit ^ PyLong_MASK) + carry; carry = thisdigit >> PyLong_SHIFT; @@ -822,26 +825,23 @@ /* Because we're going LSB to MSB, thisdigit is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisdigit << accumbits; - accumbits += PyLong_SHIFT; + accum |= (twodigits)thisdigit << accumbits; /* The most-significant digit may be (probably is) at least partly empty. */ if (i == ndigits - 1) { /* Count # of sign bits -- they needn't be stored, * although for signed conversion we need later to - * make sure at least one sign bit gets stored. - * First shift conceptual sign bit to real sign bit. - */ - stwodigits s = (stwodigits)(thisdigit << - (8*sizeof(stwodigits) - PyLong_SHIFT)); - unsigned int nsignbits = 0; - while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) { - ++nsignbits; - s <<= 1; + * make sure at least one sign bit gets stored. */ + digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : + thisdigit; + while (s != 0) { + s >>= 1; + accumbits++; } - accumbits -= nsignbits; } + else + accumbits += PyLong_SHIFT; /* Store as many bytes as possible. */ while (accumbits >= 8) { @@ -1361,7 +1361,7 @@ static digit v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit carry = 0; assert(m >= n); @@ -1387,7 +1387,7 @@ static digit v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit borrow = 0; assert(m >= n); @@ -1453,7 +1453,7 @@ digit hi; rem = (rem << PyLong_SHIFT) + *--pin; *--pout = hi = (digit)(rem / n); - rem -= hi * n; + rem -= (twodigits)hi * n; } return (digit)rem; } @@ -1646,7 +1646,7 @@ * Note that when converting a base B string, a char c is a legitimate * base B digit iff _PyLong_DigitValue[Py_CHARPyLong_MASK(c)] < B. */ -int _PyLong_DigitValue[256] = { +unsigned char _PyLong_DigitValue[256] = { 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, @@ -1710,13 +1710,13 @@ bits_in_accum = 0; pdigit = z->ob_digit; while (--p >= start) { - int k = _PyLong_DigitValue[Py_CHARMASK(*p)]; + int k = (int)_PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); - accum |= (twodigits)(k << bits_in_accum); + accum |= (twodigits)k << bits_in_accum; bits_in_accum += bits_per_char; if (bits_in_accum >= PyLong_SHIFT) { *pdigit++ = (digit)(accum & PyLong_MASK); - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); accum >>= PyLong_SHIFT; bits_in_accum -= PyLong_SHIFT; assert(bits_in_accum < PyLong_SHIFT); @@ -1725,7 +1725,7 @@ if (bits_in_accum) { assert(bits_in_accum <= PyLong_SHIFT); *pdigit++ = (digit)accum; - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); } while (pdigit - z->ob_digit < n) *pdigit++ = 0; @@ -1926,7 +1926,7 @@ c = (digit)_PyLong_DigitValue[Py_CHARMASK(*str++)]; for (i = 1; i < convwidth && str != scan; ++i, ++str) { c = (twodigits)(c * base + - _PyLong_DigitValue[Py_CHARMASK(*str)]); + (int)_PyLong_DigitValue[Py_CHARMASK(*str)]); assert(c < PyLong_BASE); } @@ -1990,8 +1990,6 @@ goto onError; if (sign < 0) Py_SIZE(z) = -(Py_SIZE(z)); - if (*str == 'L' || *str == 'l') - str++; while (*str && isspace(Py_CHARMASK(*str))) str++; if (*str != '\0') @@ -2122,7 +2120,7 @@ digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; twodigits q; stwodigits carry = 0; - int i; + Py_ssize_t i; SIGCHECK({ Py_DECREF(a); @@ -2324,7 +2322,7 @@ { Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b)); PyLongObject *z; - int i; + Py_ssize_t i; digit carry = 0; /* Ensure a is the larger of the two: */ @@ -3830,7 +3828,7 @@ long_xor, /*nb_xor*/ long_or, /*nb_or*/ long_long, /*nb_int*/ - long_long, /*nb_long*/ + 0, /*nb_reserved*/ long_float, /*nb_float*/ 0, /* nb_inplace_add */ 0, /* nb_inplace_subtract */ Modified: python/branches/py3k-issue1717/Objects/memoryobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/memoryobject.c (original) +++ python/branches/py3k-issue1717/Objects/memoryobject.c Sun Jan 25 21:08:20 2009 @@ -3,46 +3,51 @@ #include "Python.h" -static void -dup_buffer(Py_buffer *dest, Py_buffer *src) -{ - *dest = *src; - if (src->shape == &(src->len)) - dest->shape = &(dest->len); - if (src->strides == &(src->itemsize)) - dest->strides = &(dest->itemsize); -} - -/* XXX The buffer API should mandate that the shape array be non-NULL, but - it would complicate some code since the (de)allocation semantics of shape - are not specified. */ static Py_ssize_t get_shape0(Py_buffer *buf) { if (buf->shape != NULL) return buf->shape[0]; - assert(buf->ndim == 1 && buf->itemsize > 0); - return buf->len / buf->itemsize; + if (buf->ndim == 0) + return 1; + PyErr_SetString(PyExc_TypeError, + "exported buffer does not have any shape information associated " + "to it"); + return -1; +} + +static void +dup_buffer(Py_buffer *dest, Py_buffer *src) +{ + *dest = *src; + if (src->ndim == 1 && src->shape != NULL) { + dest->shape = &(dest->smalltable[0]); + dest->shape[0] = get_shape0(src); + } + if (src->ndim == 1 && src->strides != NULL) { + dest->strides = &(dest->smalltable[1]); + dest->strides[0] = src->strides[0]; + } } static int memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags) { - int res = 0; - /* XXX for whatever reason fixing the flags seems necessary */ - if (self->view.readonly) - flags &= ~PyBUF_WRITABLE; - if (self->view.obj != NULL) - res = PyObject_GetBuffer(self->view.obj, view, flags); - if (view) - dup_buffer(view, &self->view); - return res; + int res = 0; + /* XXX for whatever reason fixing the flags seems necessary */ + if (self->view.readonly) + flags &= ~PyBUF_WRITABLE; + if (self->view.obj != NULL) + res = PyObject_GetBuffer(self->view.obj, view, flags); + if (view) + dup_buffer(view, &self->view); + return res; } static void memory_releasebuf(PyMemoryViewObject *self, Py_buffer *view) { - PyBuffer_Release(view); + PyBuffer_Release(view); } PyDoc_STRVAR(memory_doc, @@ -53,61 +58,61 @@ PyObject * PyMemoryView_FromBuffer(Py_buffer *info) { - PyMemoryViewObject *mview; + PyMemoryViewObject *mview; - mview = (PyMemoryViewObject *) - PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mview == NULL) - return NULL; - mview->base = NULL; - dup_buffer(&mview->view, info); - /* NOTE: mview->view.obj should already have been incref'ed as - part of PyBuffer_FillInfo(). */ - _PyObject_GC_TRACK(mview); - return (PyObject *)mview; + mview = (PyMemoryViewObject *) + PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mview == NULL) + return NULL; + mview->base = NULL; + dup_buffer(&mview->view, info); + /* NOTE: mview->view.obj should already have been incref'ed as + part of PyBuffer_FillInfo(). */ + _PyObject_GC_TRACK(mview); + return (PyObject *)mview; } PyObject * PyMemoryView_FromObject(PyObject *base) { - PyMemoryViewObject *mview; - - if (!PyObject_CheckBuffer(base)) { - PyErr_SetString(PyExc_TypeError, - "cannot make memory view because object does " - "not have the buffer interface"); - return NULL; - } + PyMemoryViewObject *mview; - mview = (PyMemoryViewObject *) - PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mview == NULL) - return NULL; - - mview->base = NULL; - if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) { - Py_DECREF(mview); - return NULL; - } - - mview->base = base; - Py_INCREF(base); - _PyObject_GC_TRACK(mview); - return (PyObject *)mview; + if (!PyObject_CheckBuffer(base)) { + PyErr_SetString(PyExc_TypeError, + "cannot make memory view because object does " + "not have the buffer interface"); + return NULL; + } + + mview = (PyMemoryViewObject *) + PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mview == NULL) + return NULL; + + mview->base = NULL; + if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) { + Py_DECREF(mview); + return NULL; + } + + mview->base = base; + Py_INCREF(base); + _PyObject_GC_TRACK(mview); + return (PyObject *)mview; } static PyObject * memory_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *obj; - static char *kwlist[] = {"object", 0}; + PyObject *obj; + static char *kwlist[] = {"object", 0}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist, - &obj)) { - return NULL; - } + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist, + &obj)) { + return NULL; + } - return PyMemoryView_FromObject(obj); + return PyMemoryView_FromObject(obj); } @@ -115,58 +120,58 @@ _strided_copy_nd(char *dest, char *src, int nd, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char fort) { - int k; - Py_ssize_t outstride; + int k; + Py_ssize_t outstride; - if (nd==0) { - memcpy(dest, src, itemsize); + if (nd==0) { + memcpy(dest, src, itemsize); + } + else if (nd == 1) { + for (k = 0; kndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { - PyErr_NoMemory(); - return -1; - } + if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { + PyErr_NoMemory(); + return -1; + } - indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); - if (indices == NULL) { - PyErr_NoMemory(); - return -1; - } - for (k=0; kndim;k++) { - indices[k] = 0; - } + indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); + if (indices == NULL) { + PyErr_NoMemory(); + return -1; + } + for (k=0; kndim;k++) { + indices[k] = 0; + } - elements = 1; - for (k=0; kndim; k++) { - elements *= view->shape[k]; - } - if (fort == 'F') { - func = _add_one_to_index_F; - } - else { - func = _add_one_to_index_C; - } - while (elements--) { - func(view->ndim, indices, view->shape); - ptr = PyBuffer_GetPointer(view, indices); - memcpy(dest, ptr, view->itemsize); - dest += view->itemsize; - } + elements = 1; + for (k=0; kndim; k++) { + elements *= view->shape[k]; + } + if (fort == 'F') { + func = _add_one_to_index_F; + } + else { + func = _add_one_to_index_C; + } + while (elements--) { + func(view->ndim, indices, view->shape); + ptr = PyBuffer_GetPointer(view, indices); + memcpy(dest, ptr, view->itemsize); + dest += view->itemsize; + } - PyMem_Free(indices); - return 0; + PyMem_Free(indices); + return 0; } /* @@ -235,181 +240,181 @@ the shadow buffer which can be written to and then will be copied back into the other buffer when the memory view is de-allocated. While the shadow buffer is - being used, it will have an exclusive write lock on - the original buffer. + being used, it will have an exclusive write lock on + the original buffer. */ PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort) { - PyMemoryViewObject *mem; - PyObject *bytes; - Py_buffer *view; - int flags; - char *dest; - - if (!PyObject_CheckBuffer(obj)) { - PyErr_SetString(PyExc_TypeError, - "object does not have the buffer interface"); - return NULL; - } + PyMemoryViewObject *mem; + PyObject *bytes; + Py_buffer *view; + int flags; + char *dest; - mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); - if (mem == NULL) - return NULL; - - view = &mem->view; - flags = PyBUF_FULL_RO; - switch(buffertype) { - case PyBUF_WRITE: - flags = PyBUF_FULL; - break; - } + if (!PyObject_CheckBuffer(obj)) { + PyErr_SetString(PyExc_TypeError, + "object does not have the buffer interface"); + return NULL; + } - if (PyObject_GetBuffer(obj, view, flags) != 0) { - Py_DECREF(mem); - return NULL; - } + mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type); + if (mem == NULL) + return NULL; - if (PyBuffer_IsContiguous(view, fort)) { - /* no copy needed */ - Py_INCREF(obj); - mem->base = obj; - _PyObject_GC_TRACK(mem); - return (PyObject *)mem; - } - /* otherwise a copy is needed */ - if (buffertype == PyBUF_WRITE) { - Py_DECREF(mem); - PyErr_SetString(PyExc_BufferError, - "writable contiguous buffer requested " - "for a non-contiguousobject."); - return NULL; - } - bytes = PyBytes_FromStringAndSize(NULL, view->len); - if (bytes == NULL) { - Py_DECREF(mem); - return NULL; - } - dest = PyBytes_AS_STRING(bytes); - /* different copying strategy depending on whether - or not any pointer de-referencing is needed - */ - /* strided or in-direct copy */ - if (view->suboffsets==NULL) { - _strided_copy_nd(dest, view->buf, view->ndim, view->shape, - view->strides, view->itemsize, fort); - } - else { - if (_indirect_copy_nd(dest, view, fort) < 0) { - Py_DECREF(bytes); - Py_DECREF(mem); - return NULL; - } - } - if (buffertype == PyBUF_SHADOW) { - /* return a shadowed memory-view object */ - view->buf = dest; - mem->base = PyTuple_Pack(2, obj, bytes); - Py_DECREF(bytes); - if (mem->base == NULL) { - Py_DECREF(mem); - return NULL; - } + view = &mem->view; + flags = PyBUF_FULL_RO; + switch(buffertype) { + case PyBUF_WRITE: + flags = PyBUF_FULL; + break; + } + + if (PyObject_GetBuffer(obj, view, flags) != 0) { + Py_DECREF(mem); + return NULL; + } + + if (PyBuffer_IsContiguous(view, fort)) { + /* no copy needed */ + Py_INCREF(obj); + mem->base = obj; + _PyObject_GC_TRACK(mem); + return (PyObject *)mem; + } + /* otherwise a copy is needed */ + if (buffertype == PyBUF_WRITE) { + Py_DECREF(mem); + PyErr_SetString(PyExc_BufferError, + "writable contiguous buffer requested " + "for a non-contiguousobject."); + return NULL; + } + bytes = PyBytes_FromStringAndSize(NULL, view->len); + if (bytes == NULL) { + Py_DECREF(mem); + return NULL; + } + dest = PyBytes_AS_STRING(bytes); + /* different copying strategy depending on whether + or not any pointer de-referencing is needed + */ + /* strided or in-direct copy */ + if (view->suboffsets==NULL) { + _strided_copy_nd(dest, view->buf, view->ndim, view->shape, + view->strides, view->itemsize, fort); + } + else { + if (_indirect_copy_nd(dest, view, fort) < 0) { + Py_DECREF(bytes); + Py_DECREF(mem); + return NULL; } - else { - PyBuffer_Release(view); /* XXX ? */ - /* steal the reference */ - mem->base = bytes; + } + if (buffertype == PyBUF_SHADOW) { + /* return a shadowed memory-view object */ + view->buf = dest; + mem->base = PyTuple_Pack(2, obj, bytes); + Py_DECREF(bytes); + if (mem->base == NULL) { + Py_DECREF(mem); + return NULL; } - _PyObject_GC_TRACK(mem); - return (PyObject *)mem; + } + else { + PyBuffer_Release(view); /* XXX ? */ + /* steal the reference */ + mem->base = bytes; + } + _PyObject_GC_TRACK(mem); + return (PyObject *)mem; } static PyObject * memory_format_get(PyMemoryViewObject *self) { - return PyUnicode_FromString(self->view.format); + return PyUnicode_FromString(self->view.format); } static PyObject * memory_itemsize_get(PyMemoryViewObject *self) { - return PyLong_FromSsize_t(self->view.itemsize); + return PyLong_FromSsize_t(self->view.itemsize); } static PyObject * _IntTupleFromSsizet(int len, Py_ssize_t *vals) { - int i; - PyObject *o; - PyObject *intTuple; - - if (vals == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - intTuple = PyTuple_New(len); - if (!intTuple) return NULL; - for(i=0; iview.ndim, self->view.shape); + return _IntTupleFromSsizet(self->view.ndim, self->view.shape); } static PyObject * memory_strides_get(PyMemoryViewObject *self) { - return _IntTupleFromSsizet(self->view.ndim, self->view.strides); + return _IntTupleFromSsizet(self->view.ndim, self->view.strides); } static PyObject * memory_suboffsets_get(PyMemoryViewObject *self) { - return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); + return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); } static PyObject * memory_readonly_get(PyMemoryViewObject *self) { - return PyBool_FromLong(self->view.readonly); + return PyBool_FromLong(self->view.readonly); } static PyObject * memory_ndim_get(PyMemoryViewObject *self) { - return PyLong_FromLong(self->view.ndim); + return PyLong_FromLong(self->view.ndim); } static PyGetSetDef memory_getsetlist[] ={ - {"format", (getter)memory_format_get, NULL, NULL}, - {"itemsize", (getter)memory_itemsize_get, NULL, NULL}, - {"shape", (getter)memory_shape_get, NULL, NULL}, - {"strides", (getter)memory_strides_get, NULL, NULL}, - {"suboffsets", (getter)memory_suboffsets_get, NULL, NULL}, - {"readonly", (getter)memory_readonly_get, NULL, NULL}, - {"ndim", (getter)memory_ndim_get, NULL, NULL}, - {NULL, NULL, NULL, NULL}, + {"format", (getter)memory_format_get, NULL, NULL}, + {"itemsize", (getter)memory_itemsize_get, NULL, NULL}, + {"shape", (getter)memory_shape_get, NULL, NULL}, + {"strides", (getter)memory_strides_get, NULL, NULL}, + {"suboffsets", (getter)memory_suboffsets_get, NULL, NULL}, + {"readonly", (getter)memory_readonly_get, NULL, NULL}, + {"ndim", (getter)memory_ndim_get, NULL, NULL}, + {NULL, NULL, NULL, NULL}, }; static PyObject * memory_tobytes(PyMemoryViewObject *mem, PyObject *noargs) { - return PyObject_CallFunctionObjArgs( - (PyObject *) &PyBytes_Type, mem, NULL); + return PyObject_CallFunctionObjArgs( + (PyObject *) &PyBytes_Type, mem, NULL); } /* TODO: rewrite this function using the struct module to unpack @@ -418,119 +423,111 @@ static PyObject * memory_tolist(PyMemoryViewObject *mem, PyObject *noargs) { - Py_buffer *view = &(mem->view); - Py_ssize_t i; - PyObject *res, *item; - char *buf; - - if (strcmp(view->format, "B") || view->itemsize != 1) { - PyErr_SetString(PyExc_NotImplementedError, - "tolist() only supports byte views"); - return NULL; - } - if (view->ndim != 1) { - PyErr_SetString(PyExc_NotImplementedError, - "tolist() only supports one-dimensional objects"); - return NULL; - } - res = PyList_New(view->len); - if (res == NULL) - return NULL; - buf = view->buf; - for (i = 0; i < view->len; i++) { - item = PyLong_FromUnsignedLong((unsigned char) *buf); - if (item == NULL) { - Py_DECREF(res); - return NULL; - } - PyList_SET_ITEM(res, i, item); - buf++; - } - return res; + Py_buffer *view = &(mem->view); + Py_ssize_t i; + PyObject *res, *item; + char *buf; + + if (strcmp(view->format, "B") || view->itemsize != 1) { + PyErr_SetString(PyExc_NotImplementedError, + "tolist() only supports byte views"); + return NULL; + } + if (view->ndim != 1) { + PyErr_SetString(PyExc_NotImplementedError, + "tolist() only supports one-dimensional objects"); + return NULL; + } + res = PyList_New(view->len); + if (res == NULL) + return NULL; + buf = view->buf; + for (i = 0; i < view->len; i++) { + item = PyLong_FromUnsignedLong((unsigned char) *buf); + if (item == NULL) { + Py_DECREF(res); + return NULL; + } + PyList_SET_ITEM(res, i, item); + buf++; + } + return res; } - - static PyMethodDef memory_methods[] = { - {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, - {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, - {NULL, NULL} /* sentinel */ + {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL}, + {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL}, + {NULL, NULL} /* sentinel */ }; static void memory_dealloc(PyMemoryViewObject *self) { - _PyObject_GC_UNTRACK(self); - if (self->view.obj != NULL) { - if (self->base && PyTuple_Check(self->base)) { - /* Special case when first element is generic object - with buffer interface and the second element is a - contiguous "shadow" that must be copied back into - the data areay of the first tuple element before - releasing the buffer on the first element. - */ - - PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), - PyTuple_GET_ITEM(self->base,1)); - - /* The view member should have readonly == -1 in - this instance indicating that the memory can - be "locked" and was locked and will be unlocked - again after this call. - */ - PyBuffer_Release(&(self->view)); - } - else { - PyBuffer_Release(&(self->view)); - } - Py_CLEAR(self->base); + _PyObject_GC_UNTRACK(self); + if (self->view.obj != NULL) { + if (self->base && PyTuple_Check(self->base)) { + /* Special case when first element is generic object + with buffer interface and the second element is a + contiguous "shadow" that must be copied back into + the data areay of the first tuple element before + releasing the buffer on the first element. + */ + + PyObject_CopyData(PyTuple_GET_ITEM(self->base,0), + PyTuple_GET_ITEM(self->base,1)); + + /* The view member should have readonly == -1 in + this instance indicating that the memory can + be "locked" and was locked and will be unlocked + again after this call. + */ + PyBuffer_Release(&(self->view)); } - PyObject_GC_Del(self); + else { + PyBuffer_Release(&(self->view)); + } + Py_CLEAR(self->base); + } + PyObject_GC_Del(self); } static PyObject * memory_repr(PyMemoryViewObject *self) { - return PyUnicode_FromFormat("", self); + return PyUnicode_FromFormat("", self); } static PyObject * memory_str(PyMemoryViewObject *self) { - Py_buffer view; - PyObject *res; + Py_buffer view; + PyObject *res; - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return NULL; + 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; + 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) { - Py_buffer view; - - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return -1; - PyBuffer_Release(&view); - return view.len; + return get_shape0(&self->view); } /* mem[obj] returns a bytes object holding the data for one element if obj fully indexes the memory view or another memory-view object - if it does not. + if it does not. - 0-d memory-view objects can be referenced using ... or () but - not with anything else. + 0-d memory-view objects can be referenced using ... or () but + not with anything else. */ static PyObject * memory_subscript(PyMemoryViewObject *self, PyObject *key) @@ -539,94 +536,91 @@ view = &(self->view); if (view->ndim == 0) { - if (key == Py_Ellipsis || - (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) { - Py_INCREF(self); - return (PyObject *)self; - } - else { - PyErr_SetString(PyExc_IndexError, - "invalid indexing of 0-dim memory"); - return NULL; - } + if (key == Py_Ellipsis || + (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) { + Py_INCREF(self); + return (PyObject *)self; + } + else { + PyErr_SetString(PyExc_IndexError, + "invalid indexing of 0-dim memory"); + return NULL; + } } if (PyIndex_Check(key)) { - Py_ssize_t result; - result = PyNumber_AsSsize_t(key, NULL); - if (result == -1 && PyErr_Occurred()) - return NULL; - if (view->ndim == 1) { - /* Return a bytes object */ - char *ptr; - ptr = (char *)view->buf; - if (result < 0) { + Py_ssize_t result; + result = PyNumber_AsSsize_t(key, NULL); + if (result == -1 && PyErr_Occurred()) + return NULL; + if (view->ndim == 1) { + /* Return a bytes object */ + char *ptr; + ptr = (char *)view->buf; + if (result < 0) { result += get_shape0(view); - } + } if ((result < 0) || (result >= get_shape0(view))) { - PyErr_SetString(PyExc_IndexError, - "index out of bounds"); - return NULL; - } - if (view->strides == NULL) - ptr += view->itemsize * result; - else - ptr += view->strides[0] * result; - if (view->suboffsets != NULL && - view->suboffsets[0] >= 0) - { - ptr = *((char **)ptr) + view->suboffsets[0]; - } - return PyBytes_FromStringAndSize(ptr, view->itemsize); - } - else { - /* Return a new memory-view object */ - Py_buffer newview; - memset(&newview, 0, sizeof(newview)); - /* XXX: This needs to be fixed so it - actually returns a sub-view - */ - return PyMemoryView_FromBuffer(&newview); - } + PyErr_SetString(PyExc_IndexError, + "index out of bounds"); + return NULL; + } + if (view->strides == NULL) + ptr += view->itemsize * result; + else + ptr += view->strides[0] * result; + if (view->suboffsets != NULL && + view->suboffsets[0] >= 0) { + ptr = *((char **)ptr) + view->suboffsets[0]; + } + return PyBytes_FromStringAndSize(ptr, view->itemsize); + } + else { + /* Return a new memory-view object */ + Py_buffer newview; + memset(&newview, 0, sizeof(newview)); + /* XXX: This needs to be fixed so it + actually returns a sub-view + */ + return PyMemoryView_FromBuffer(&newview); + } } else if (PySlice_Check(key)) { - Py_ssize_t start, stop, step, slicelength; - + Py_ssize_t start, stop, step, slicelength; + if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view), - &start, &stop, &step, &slicelength) < 0) { - return NULL; - } + &start, &stop, &step, &slicelength) < 0) { + return NULL; + } - if (step == 1 && view->ndim == 1) { - Py_buffer newview; - void *newbuf = (char *) view->buf - + start * view->itemsize; - int newflags = view->readonly - ? PyBUF_CONTIG_RO : PyBUF_CONTIG; + if (step == 1 && view->ndim == 1) { + Py_buffer newview; + void *newbuf = (char *) view->buf + + start * view->itemsize; + int newflags = view->readonly + ? PyBUF_CONTIG_RO : PyBUF_CONTIG; - /* XXX There should be an API to create a subbuffer */ - if (view->obj != NULL) { - if (PyObject_GetBuffer(view->obj, - &newview, newflags) == -1) - return NULL; - } - else { - newview = *view; - } - newview.buf = newbuf; - newview.len = slicelength; - newview.format = view->format; - if (view->shape == &(view->len)) - newview.shape = &(newview.len); - if (view->strides == &(view->itemsize)) - newview.strides = &(newview.itemsize); - return PyMemoryView_FromBuffer(&newview); - } - PyErr_SetNone(PyExc_NotImplementedError); - return NULL; + /* XXX There should be an API to create a subbuffer */ + if (view->obj != NULL) { + if (PyObject_GetBuffer(view->obj, &newview, newflags) == -1) + return NULL; + } + else { + newview = *view; + } + newview.buf = newbuf; + newview.len = slicelength * newview.itemsize; + newview.format = view->format; + newview.shape = &(newview.smalltable[0]); + newview.shape[0] = slicelength; + newview.strides = &(newview.itemsize); + return PyMemoryView_FromBuffer(&newview); + } + PyErr_SetNone(PyExc_NotImplementedError); + return NULL; } PyErr_Format(PyExc_TypeError, - "cannot index memory using \"%.200s\"", - key->ob_type->tp_name); + "cannot index memory using \"%.200s\"", + key->ob_type->tp_name); return NULL; } @@ -727,118 +721,118 @@ static PyObject * memory_richcompare(PyObject *v, PyObject *w, int op) { - Py_buffer vv, ww; - int equal = 0; - PyObject *res; - - vv.obj = NULL; - ww.obj = NULL; - if (op != Py_EQ && op != Py_NE) - goto _notimpl; - if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) { - PyErr_Clear(); - goto _notimpl; - } - if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) { - PyErr_Clear(); - goto _notimpl; - } + Py_buffer vv, ww; + int equal = 0; + PyObject *res; + + vv.obj = NULL; + ww.obj = NULL; + if (op != Py_EQ && op != Py_NE) + goto _notimpl; + if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) { + PyErr_Clear(); + goto _notimpl; + } + if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) { + PyErr_Clear(); + goto _notimpl; + } - if (vv.itemsize != ww.itemsize || vv.len != ww.len) - goto _end; + if (vv.itemsize != ww.itemsize || vv.len != ww.len) + goto _end; - equal = !memcmp(vv.buf, ww.buf, vv.len * vv.itemsize); + equal = !memcmp(vv.buf, ww.buf, vv.len); _end: - PyBuffer_Release(&vv); - PyBuffer_Release(&ww); - if ((equal && op == Py_EQ) || (!equal && op == Py_NE)) - res = Py_True; - else - res = Py_False; - Py_INCREF(res); - return res; + PyBuffer_Release(&vv); + PyBuffer_Release(&ww); + if ((equal && op == Py_EQ) || (!equal && op == Py_NE)) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; _notimpl: - PyBuffer_Release(&vv); - PyBuffer_Release(&ww); - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + PyBuffer_Release(&vv); + PyBuffer_Release(&ww); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } static int memory_traverse(PyMemoryViewObject *self, visitproc visit, void *arg) { - if (self->base != NULL) - Py_VISIT(self->base); - if (self->view.obj != NULL) - Py_VISIT(self->view.obj); - return 0; + if (self->base != NULL) + Py_VISIT(self->base); + if (self->view.obj != NULL) + Py_VISIT(self->view.obj); + return 0; } static int memory_clear(PyMemoryViewObject *self) { - Py_CLEAR(self->base); - PyBuffer_Release(&self->view); - return 0; + Py_CLEAR(self->base); + PyBuffer_Release(&self->view); + return 0; } /* As mapping */ static PyMappingMethods memory_as_mapping = { - (lenfunc)memory_length, /*mp_length*/ - (binaryfunc)memory_subscript, /*mp_subscript*/ - (objobjargproc)memory_ass_sub, /*mp_ass_subscript*/ + (lenfunc)memory_length, /* mp_length */ + (binaryfunc)memory_subscript, /* mp_subscript */ + (objobjargproc)memory_ass_sub, /* mp_ass_subscript */ }; /* Buffer methods */ static PyBufferProcs memory_as_buffer = { - (getbufferproc)memory_getbuf, /* bf_getbuffer */ - (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */ + (getbufferproc)memory_getbuf, /* bf_getbuffer */ + (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */ }; PyTypeObject PyMemoryView_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "memoryview", - sizeof(PyMemoryViewObject), - 0, - (destructor)memory_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 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 */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - &memory_as_buffer, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ - memory_doc, /* tp_doc */ - (traverseproc)memory_traverse, /* tp_traverse */ - (inquiry)memory_clear, /* tp_clear */ - memory_richcompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - memory_methods, /* tp_methods */ - 0, /* tp_members */ - memory_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 */ - memory_new, /* tp_new */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "memoryview", + sizeof(PyMemoryViewObject), + 0, + (destructor)memory_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 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 */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + &memory_as_buffer, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + memory_doc, /* tp_doc */ + (traverseproc)memory_traverse, /* tp_traverse */ + (inquiry)memory_clear, /* tp_clear */ + memory_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + memory_methods, /* tp_methods */ + 0, /* tp_members */ + memory_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 */ + memory_new, /* tp_new */ }; Modified: python/branches/py3k-issue1717/Objects/moduleobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/moduleobject.c (original) +++ python/branches/py3k-issue1717/Objects/moduleobject.c Sun Jan 25 21:08:20 2009 @@ -91,9 +91,9 @@ This is a bit of a hack: when the shared library is loaded, the module name is "package.module", but the module calls - Py_InitModule*() with just "module" for the name. The shared + PyModule_Create*() with just "module" for the name. The shared library loader squirrels away the true name of the module in - _Py_PackageContext, and Py_InitModule*() will substitute this + _Py_PackageContext, and PyModule_Create*() will substitute this (if the name actually matches). */ if (_Py_PackageContext != NULL) { @@ -315,6 +315,8 @@ _PyModule_Clear((PyObject *)m); Py_DECREF(m->md_dict); } + if (m->md_state != NULL) + PyMem_FREE(m->md_state); Py_TYPE(m)->tp_free((PyObject *)m); } Modified: python/branches/py3k-issue1717/Objects/object.c ============================================================================== --- python/branches/py3k-issue1717/Objects/object.c (original) +++ python/branches/py3k-issue1717/Objects/object.c Sun Jan 25 21:08:20 2009 @@ -81,24 +81,29 @@ garbage itself. If unlist_types_without_objects is set, they will be removed from the type_list once the last object is deallocated. */ -int unlist_types_without_objects; -extern int tuple_zero_allocs, fast_tuple_allocs; -extern int quick_int_allocs, quick_neg_int_allocs; -extern int null_strings, one_strings; +static int unlist_types_without_objects; +extern Py_ssize_t tuple_zero_allocs, fast_tuple_allocs; +extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs; +extern Py_ssize_t null_strings, one_strings; void dump_counts(FILE* f) { PyTypeObject *tp; for (tp = type_list; tp; tp = tp->tp_next) - fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n", + fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, " + "freed: %" PY_FORMAT_SIZE_T "d, " + "max in use: %" PY_FORMAT_SIZE_T "d\n", tp->tp_name, tp->tp_allocs, tp->tp_frees, tp->tp_maxalloc); - fprintf(f, "fast tuple allocs: %d, empty: %d\n", + fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, " + "empty: %" PY_FORMAT_SIZE_T "d\n", fast_tuple_allocs, tuple_zero_allocs); - fprintf(f, "fast int allocs: pos: %d, neg: %d\n", + fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, " + "neg: %" PY_FORMAT_SIZE_T "d\n", quick_int_allocs, quick_neg_int_allocs); - fprintf(f, "null strings: %d, 1-strings: %d\n", + fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, " + "1-strings: %" PY_FORMAT_SIZE_T "d\n", null_strings, one_strings); } @@ -896,6 +901,20 @@ return obj; } +/* Helper used when the __next__ method is removed from a type: + tp_iternext is never NULL and can be safely called without checking + on every iteration. + */ + +PyObject * +_PyObject_NextNotImplemented(PyObject *self) +{ + PyErr_Format(PyExc_TypeError, + "'%.200s' object is not iterable", + Py_TYPE(self)->tp_name); + return NULL; +} + /* Generic GetAttr functions - put these in your tp_[gs]etattro slot */ PyObject * Modified: python/branches/py3k-issue1717/Objects/setobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/setobject.c (original) +++ python/branches/py3k-issue1717/Objects/setobject.c Sun Jan 25 21:08:20 2009 @@ -2075,7 +2075,7 @@ (binaryfunc)set_xor, /*nb_xor*/ (binaryfunc)set_or, /*nb_or*/ 0, /*nb_int*/ - 0, /*nb_long*/ + 0, /*nb_reserved*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ (binaryfunc)set_isub, /*nb_inplace_subtract*/ Modified: python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h ============================================================================== --- python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h (original) +++ python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h Sun Jan 25 21:08:20 2009 @@ -5,7 +5,7 @@ /* fast search/count implementation, based on a mix between boyer- moore and horspool, with a few more bells and whistles on the top. - for some more background, see: http://effbot.org/stringlib */ + for some more background, see: http://effbot.org/stringlib.htm */ /* note: fastsearch may access s[n], which isn't a problem when using Python's ordinary string types, but may cause problems if you're Modified: python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h ============================================================================== --- python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h (original) +++ python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h Sun Jan 25 21:08:20 2009 @@ -22,76 +22,69 @@ { const char *e, *p; char *q; - Py_ssize_t i, j, old_j; + size_t i, j; PyObject *u; int tabsize = 8; - + if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; - + return NULL; + /* First pass: determine size of output string */ - i = j = old_j = 0; + i = j = 0; e = STRINGLIB_STR(self) + STRINGLIB_LEN(self); for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - j += tabsize - (j % tabsize); - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (old_j > j) { - PyErr_SetString(PyExc_OverflowError, - "result is too long"); - return NULL; - } - old_j = j; + if (tabsize > 0) { + j += tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, + "result is too long"); + return NULL; + } } - } + } else { j++; if (*p == '\n' || *p == '\r') { i += j; - old_j = j = 0; - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ - if (i < 0) { + j = 0; + if (i > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } } } - - if ((i + j) < 0) { - /* XXX: this depends on a signed integer overflow to < 0 */ - /* C compilers, including gcc, do -NOT- guarantee this. */ + + if ((i + j) > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "result is too long"); return NULL; } - + /* Second pass: create output string and fill it */ u = STRINGLIB_NEW(NULL, i + j); if (!u) return NULL; - + j = 0; q = STRINGLIB_STR(u); - + for (p = STRINGLIB_STR(self); p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) - *q++ = ' '; - } - } - else { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) + *q++ = ' '; + } + } + else { j++; - *q++ = *p; + *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } - + return u; } Modified: python/branches/py3k-issue1717/Objects/tupleobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/tupleobject.c (original) +++ python/branches/py3k-issue1717/Objects/tupleobject.c Sun Jan 25 21:08:20 2009 @@ -19,8 +19,8 @@ static int numfree[PyTuple_MAXSAVESIZE]; #endif #ifdef COUNT_ALLOCS -int fast_tuple_allocs; -int tuple_zero_allocs; +Py_ssize_t fast_tuple_allocs; +Py_ssize_t tuple_zero_allocs; #endif PyObject * Modified: python/branches/py3k-issue1717/Objects/typeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/typeobject.c (original) +++ python/branches/py3k-issue1717/Objects/typeobject.c Sun Jan 25 21:08:20 2009 @@ -3602,7 +3602,6 @@ COPYNUM(nb_xor); COPYNUM(nb_or); COPYNUM(nb_int); - COPYNUM(nb_long); COPYNUM(nb_float); COPYNUM(nb_inplace_add); COPYNUM(nb_inplace_subtract); @@ -4832,7 +4831,6 @@ SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__") SLOT0(slot_nb_int, "__int__") -SLOT0(slot_nb_long, "__long__") SLOT0(slot_nb_float, "__float__") SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O") SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O") @@ -5448,8 +5446,6 @@ RBINSLOT("__ror__", nb_or, slot_nb_or, "|"), UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc, "int(x)"), - UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc, - "long(x)"), UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc, "float(x)"), NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, @@ -5635,8 +5631,12 @@ } do { descr = _PyType_Lookup(type, p->name_strobj); - if (descr == NULL) + if (descr == NULL) { + if (ptr == (void**)&type->tp_iternext) { + specific = _PyObject_NextNotImplemented; + } continue; + } if (Py_TYPE(descr) == &PyWrapperDescr_Type) { void **tptr = resolve_slotdups(type, p->name_strobj); if (tptr == NULL || tptr == ptr) @@ -5655,7 +5655,7 @@ else if (Py_TYPE(descr) == &PyCFunction_Type && PyCFunction_GET_FUNCTION(descr) == (PyCFunction)tp_new_wrapper && - strcmp(p->name, "__new__") == 0) + ptr == (void**)&type->tp_new) { /* The __new__ wrapper is not a wrapper descriptor, so must be special-cased differently. @@ -5675,7 +5675,7 @@ point out a bug in this reasoning a beer. */ } else if (descr == Py_None && - strcmp(p->name, "__hash__") == 0) { + ptr == (void**)&type->tp_hash) { /* We specifically allow __hash__ to be set to None to prevent inheritance of the default implementation from object.__hash__ */ Modified: python/branches/py3k-issue1717/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/unicodeobject.c (original) +++ python/branches/py3k-issue1717/Objects/unicodeobject.c Sun Jan 25 21:08:20 2009 @@ -1205,7 +1205,7 @@ /* Decode via the codec registry */ buffer = NULL; - if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_SIMPLE) < 0) + if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_FULL_RO) < 0) goto onError; buffer = PyMemoryView_FromBuffer(&info); if (buffer == NULL) @@ -2001,6 +2001,19 @@ return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL); } +/* Mask to check or force alignment of a pointer to C 'long' boundaries */ +#define LONG_PTR_MASK (size_t) (SIZEOF_LONG - 1) + +/* Mask to quickly check whether a C 'long' contains a + non-ASCII, UTF8-encoded char. */ +#if (SIZEOF_LONG == 8) +# define ASCII_CHAR_MASK 0x8080808080808080L +#elif (SIZEOF_LONG == 4) +# define ASCII_CHAR_MASK 0x80808080L +#else +# error C 'long' size should be either 4 or 8! +#endif + PyObject *PyUnicode_DecodeUTF8Stateful(const char *s, Py_ssize_t size, const char *errors, @@ -2011,7 +2024,7 @@ Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; - const char *e; + const char *e, *aligned_end; PyUnicodeObject *unicode; Py_UNICODE *p; const char *errmsg = ""; @@ -2032,11 +2045,52 @@ /* Unpack UTF-8 encoded data */ p = unicode->str; e = s + size; + aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK); while (s < e) { Py_UCS4 ch = (unsigned char)*s; if (ch < 0x80) { + /* Fast path for runs of ASCII characters. Given that common UTF-8 + input will consist of an overwhelming majority of ASCII + characters, we try to optimize for this case by checking + as many characters as a C 'long' can contain. + First, check if we can do an aligned read, as most CPUs have + a penalty for unaligned reads. + */ + if (!((size_t) s & LONG_PTR_MASK)) { + /* Help register allocation */ + register const char *_s = s; + register Py_UNICODE *_p = p; + while (_s < aligned_end) { + /* Read a whole long at a time (either 4 or 8 bytes), + and do a fast unrolled copy if it only contains ASCII + characters. */ + unsigned long data = *(unsigned long *) _s; + if (data & ASCII_CHAR_MASK) + break; + _p[0] = (unsigned char) _s[0]; + _p[1] = (unsigned char) _s[1]; + _p[2] = (unsigned char) _s[2]; + _p[3] = (unsigned char) _s[3]; +#if (SIZEOF_LONG == 8) + _p[4] = (unsigned char) _s[4]; + _p[5] = (unsigned char) _s[5]; + _p[6] = (unsigned char) _s[6]; + _p[7] = (unsigned char) _s[7]; +#endif + _s += SIZEOF_LONG; + _p += SIZEOF_LONG; + } + s = _s; + p = _p; + if (s == e) + break; + ch = (unsigned char)*s; + } + } + + if (ch < 0x80) { *p++ = (Py_UNICODE)ch; s++; continue; @@ -2169,6 +2223,7 @@ &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; @@ -2188,6 +2243,9 @@ return NULL; } +#undef ASCII_CHAR_MASK + + /* Allocation strategy: if the string is short, convert into a stack buffer and allocate exactly as much space needed at the end. Else allocate the maximum possible needed (4 result bytes per Unicode character), and return @@ -2582,6 +2640,23 @@ return PyUnicode_DecodeUTF16Stateful(s, size, errors, byteorder, NULL); } +/* Two masks for fast checking of whether a C 'long' may contain + UTF16-encoded surrogate characters. This is an efficient heuristic, + assuming that non-surrogate characters with a code point >= 0x8000 are + 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 +#elif (SIZEOF_LONG == 4) +# define FAST_CHAR_MASK 0x80008000L +# define SWAPPED_FAST_CHAR_MASK 0x00800080L +#else +# error C 'long' size should be either 4 or 8! +#endif + PyObject * PyUnicode_DecodeUTF16Stateful(const char *s, Py_ssize_t size, @@ -2595,8 +2670,9 @@ Py_ssize_t outpos; PyUnicodeObject *unicode; Py_UNICODE *p; - const unsigned char *q, *e; + const unsigned char *q, *e, *aligned_end; int bo = 0; /* assume native ordering by default */ + int native_ordering = 0; const char *errmsg = ""; /* Offsets from q for retrieving byte pairs in the right order. */ #ifdef BYTEORDER_IS_LITTLE_ENDIAN @@ -2618,7 +2694,7 @@ /* Unpack UTF-16 encoded data */ p = unicode->str; q = (unsigned char *)s; - e = q + size; + e = q + size - 1; if (byteorder) bo = *byteorder; @@ -2662,20 +2738,86 @@ ihi = 0; ilo = 1; } +#ifdef BYTEORDER_IS_LITTLE_ENDIAN + native_ordering = ilo < ihi; +#else + native_ordering = ilo > ihi; +#endif + aligned_end = (const unsigned char *) ((size_t) e & ~LONG_PTR_MASK); while (q < e) { Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } + /* 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)) { + /* Fast path for runs of non-surrogate chars. */ + register const unsigned char *_q = q; + Py_UNICODE *_p = p; + if (native_ordering) { + /* Native ordering is simple: as long as the input cannot + possibly contain a surrogate char, do an unrolled copy + of several 16-bit code points to the target object. + The non-surrogate check is done on several input bytes + at a time (as many as a C 'long' can contain). */ + while (_q < aligned_end) { + unsigned long data = * (unsigned long *) _q; + if (data & FAST_CHAR_MASK) + break; + _p[0] = ((unsigned short *) _q)[0]; + _p[1] = ((unsigned short *) _q)[1]; +#if (SIZEOF_LONG == 8) + _p[2] = ((unsigned short *) _q)[2]; + _p[3] = ((unsigned short *) _q)[3]; +#endif + _q += SIZEOF_LONG; + _p += SIZEOF_LONG / 2; + } + } + else { + /* Byteswapped ordering is similar, but we must decompose + the copy bytewise, and take care of zero'ing out the + upper bytes if the target object is in 32-bit units + (that is, in UCS-4 builds). */ + while (_q < aligned_end) { + unsigned long data = * (unsigned long *) _q; + if (data & SWAPPED_FAST_CHAR_MASK) + break; + /* Zero upper bytes in UCS-4 builds */ +#if (Py_UNICODE_SIZE > 2) + _p[0] = 0; + _p[1] = 0; +#if (SIZEOF_LONG == 8) + _p[2] = 0; + _p[3] = 0; +#endif +#endif + /* Issue #4916; UCS-4 builds on big endian machines must + fill the two last bytes of each 4-byte unit. */ +#if (!defined(BYTEORDER_IS_LITTLE_ENDIAN) && Py_UNICODE_SIZE > 2) +# define OFF 2 +#else +# define OFF 0 +#endif + ((unsigned char *) _p)[OFF + 1] = _q[0]; + ((unsigned char *) _p)[OFF + 0] = _q[1]; + ((unsigned char *) _p)[OFF + 1 + Py_UNICODE_SIZE] = _q[2]; + ((unsigned char *) _p)[OFF + 0 + Py_UNICODE_SIZE] = _q[3]; +#if (SIZEOF_LONG == 8) + ((unsigned char *) _p)[OFF + 1 + 2 * Py_UNICODE_SIZE] = _q[4]; + ((unsigned char *) _p)[OFF + 0 + 2 * Py_UNICODE_SIZE] = _q[5]; + ((unsigned char *) _p)[OFF + 1 + 3 * Py_UNICODE_SIZE] = _q[6]; + ((unsigned char *) _p)[OFF + 0 + 3 * Py_UNICODE_SIZE] = _q[7]; +#endif +#undef OFF + _q += SIZEOF_LONG; + _p += SIZEOF_LONG / 2; + } + } + p = _p; + q = _q; + if (q >= e) + break; + } ch = (q[ihi] << 8) | q[ilo]; q += 2; @@ -2686,10 +2828,10 @@ } /* UTF-16 code pair: */ - if (q >= e) { + if (q > e) { errmsg = "unexpected end of data"; - startinpos = (((const char *)q)-2)-starts; - endinpos = ((const char *)e)-starts; + startinpos = (((const char *)q) - 2) - starts; + endinpos = ((const char *)e) + 1 - starts; goto utf16Error; } if (0xD800 <= ch && ch <= 0xDBFF) { @@ -2718,14 +2860,47 @@ /* Fall through to report the error */ utf16Error: - outpos = p-PyUnicode_AS_UNICODE(unicode); + outpos = p - PyUnicode_AS_UNICODE(unicode); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf16", errmsg, - &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) + errors, + &errorHandler, + "utf16", errmsg, + &starts, + (const char **)&e, + &startinpos, + &endinpos, + &exc, + (const char **)&q, + &unicode, + &outpos, + &p)) goto onError; } + /* remaining byte at the end? (size should be even) */ + if (e == q) { + if (!consumed) { + errmsg = "truncated data"; + startinpos = ((const char *)q) - starts; + endinpos = ((const char *)e) + 1 - starts; + outpos = p - PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, + &errorHandler, + "utf16", errmsg, + &starts, + (const char **)&e, + &startinpos, + &endinpos, + &exc, + (const char **)&q, + &unicode, + &outpos, + &p)) + goto onError; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + } if (byteorder) *byteorder = bo; @@ -2748,6 +2923,9 @@ return NULL; } +#undef FAST_CHAR_MASK +#undef SWAPPED_FAST_CHAR_MASK + PyObject * PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, @@ -3571,6 +3749,7 @@ { PyUnicodeObject *v; Py_UNICODE *p; + const char *e, *unrolled_end; /* Latin-1 is equivalent to the first 256 ordinals in Unicode. */ if (size == 1) { @@ -3584,8 +3763,20 @@ if (size == 0) return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); - while (size-- > 0) - *p++ = (unsigned char)*s++; + e = s + size; + /* Unrolling the copy makes it much faster by reducing the looping + overhead. This is similar to what many memcpy() implementations do. */ + unrolled_end = e - 4; + while (s < unrolled_end) { + p[0] = (unsigned char) s[0]; + p[1] = (unsigned char) s[1]; + p[2] = (unsigned char) s[2]; + p[3] = (unsigned char) s[3]; + s += 4; + p += 4; + } + while (s < e) + *p++ = (unsigned char) *s++; return (PyObject *)v; onError: Modified: python/branches/py3k-issue1717/Objects/weakrefobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/weakrefobject.c (original) +++ python/branches/py3k-issue1717/Objects/weakrefobject.c Sun Jan 25 21:08:20 2009 @@ -488,8 +488,7 @@ WRAP_BINARY(proxy_and, PyNumber_And) WRAP_BINARY(proxy_xor, PyNumber_Xor) WRAP_BINARY(proxy_or, PyNumber_Or) -WRAP_UNARY(proxy_int, PyNumber_Int) -WRAP_UNARY(proxy_long, PyNumber_Long) +WRAP_UNARY(proxy_int, PyNumber_Long) WRAP_UNARY(proxy_float, PyNumber_Float) WRAP_BINARY(proxy_iadd, PyNumber_InPlaceAdd) WRAP_BINARY(proxy_isub, PyNumber_InPlaceSubtract) @@ -595,7 +594,7 @@ proxy_xor, /*nb_xor*/ proxy_or, /*nb_or*/ proxy_int, /*nb_int*/ - proxy_long, /*nb_long*/ + 0, /*nb_reserved*/ proxy_float, /*nb_float*/ proxy_iadd, /*nb_inplace_add*/ proxy_isub, /*nb_inplace_subtract*/ Modified: python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp ============================================================================== --- python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp (original) +++ python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp Sun Jan 25 21:08:20 2009 @@ -54,7 +54,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" @@ -82,7 +82,7 @@ # 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 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" +# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/py3k-issue1717/PC/VC6/bz2.dsp ============================================================================== --- python/branches/py3k-issue1717/PC/VC6/bz2.dsp (original) +++ python/branches/py3k-issue1717/PC/VC6/bz2.dsp Sun Jan 25 21:08:20 2009 @@ -44,7 +44,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -54,7 +54,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" @@ -72,7 +72,7 @@ # 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 ".." /I "..\..\..\bzip2-1.0.3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /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" @@ -82,7 +82,7 @@ # 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 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept +# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp ============================================================================== --- python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp (original) +++ python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp Sun Jan 25 21:08:20 2009 @@ -402,10 +402,6 @@ # End Source File # Begin Source File -SOURCE=..\..\Python\getmtime.c -# End Source File -# Begin Source File - SOURCE=..\..\Python\getopt.c # End Source File # Begin Source File Modified: python/branches/py3k-issue1717/PC/VC6/readme.txt ============================================================================== --- python/branches/py3k-issue1717/PC/VC6/readme.txt (original) +++ python/branches/py3k-issue1717/PC/VC6/readme.txt Sun Jan 25 21:08:20 2009 @@ -64,18 +64,25 @@ _tkinter Python wrapper for the Tk windowing system. Requires building - Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.12. + Tcl/Tk first. Following are instructions for Tcl/Tk 8.5.2. Get source ---------- In the dist directory, run - svn export http://svn.python.org/projects/external/tcl8.4.12 - svn export http://svn.python.org/projects/external/tk8.4.12 - svn export http://svn.python.org/projects/external/tix-8.4.0 + svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2 + svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2 + svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3 + + Debug Build + ----------- + To build debug version, add DEBUG=1 to all nmake call bellow. Build Tcl first (done here w/ MSVC 6 on Win2K) --------------- - cd dist\tcl8.4.12\win + If your environment doesn't have struct _stat64, you need to apply + tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h. + + cd dist\tcl8.5.2\win run vcvars32.bat nmake -f makefile.vc nmake -f makefile.vc INSTALLDIR=..\..\tcltk install @@ -85,16 +92,16 @@ Optional: run tests, via nmake -f makefile.vc test - all.tcl: Total 10835 Passed 10096 Skipped 732 Failed 7 - Sourced 129 Test Files. - Files with failing tests: exec.test expr.test io.test main.test string.test stri + all.tcl: Total 24242 Passed 23358 Skipped 877 Failed 7 + Sourced 137 Test Files. + Files with failing tests: exec.test http.test io.test main.test string.test stri ngObj.test Build Tk -------- - cd dist\tk8.4.12\win - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 - nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd dist\tk8.5.2\win + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 + nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install XXX Should we compile with OPTS=threads? @@ -102,26 +109,26 @@ XXX failed. It popped up tons of little windows, and did lots of XXX stuff, and nothing blew up. - Built Tix - --------- - cd dist\tix-8.4.0\win - nmake -f python.mak - nmake -f python.mak install + Build Tix + --------- + cd dist\tix8.4.3\win + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 + nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install bz2 Python wrapper for the libbz2 compression library. Homepage - http://sources.redhat.com/bzip2/ + http://www.bzip.org/ Download the source from the python.org copy into the dist directory: - svn export http://svn.python.org/projects/external/bzip2-1.0.3 + svn export http://svn.python.org/projects/external/bzip2-1.0.5 And requires building bz2 first. - cd dist\bzip2-1.0.3 + cd dist\bzip2-1.0.5 nmake -f makefile.msc - All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python + All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python project links in. Modified: python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj ============================================================================== --- python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj (original) +++ python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj Sun Jan 25 21:08:20 2009 @@ -557,9 +557,6 @@ RelativePath="..\..\Python\getcopyright.c"> - - - - Modified: python/branches/py3k-issue1717/PC/example_nt/example.c ============================================================================== --- python/branches/py3k-issue1717/PC/example_nt/example.c (original) +++ python/branches/py3k-issue1717/PC/example_nt/example.c Sun Jan 25 21:08:20 2009 @@ -13,8 +13,20 @@ {NULL, NULL} }; +static struct PyModuleDef examplemodule = { + PyModuleDef_HEAD_INIT, + "example", + "example module doc string", + -1, + example_methods, + NULL, + NULL, + NULL, + NULL +}; + PyMODINIT_FUNC -initexample(void) +PyInit_example(void) { - Py_InitModule("example", example_methods); + return PyModule_Create(&examplemodule); } Modified: python/branches/py3k-issue1717/PC/os2emx/Makefile ============================================================================== --- python/branches/py3k-issue1717/PC/os2emx/Makefile (original) +++ python/branches/py3k-issue1717/PC/os2emx/Makefile Sun Jan 25 21:08:20 2009 @@ -339,7 +339,6 @@ Python/getargs.c \ Python/getcompiler.c \ Python/getcopyright.c \ - Python/getmtime.c \ Python/getplatform.c \ Python/getversion.c \ Python/graminit.c \ Modified: python/branches/py3k-issue1717/PC/os2emx/python27.def ============================================================================== --- python/branches/py3k-issue1717/PC/os2emx/python27.def (original) +++ python/branches/py3k-issue1717/PC/os2emx/python27.def Sun Jan 25 21:08:20 2009 @@ -930,9 +930,6 @@ ; From python26_s.lib(getcopyright) "Py_GetCopyright" -; From python26_s.lib(getmtime) - "PyOS_GetLastModificationTime" - ; From python26_s.lib(getplatform) "Py_GetPlatform" Modified: python/branches/py3k-issue1717/PC/os2vacpp/makefile ============================================================================== --- python/branches/py3k-issue1717/PC/os2vacpp/makefile (original) +++ python/branches/py3k-issue1717/PC/os2vacpp/makefile Sun Jan 25 21:08:20 2009 @@ -1377,8 +1377,6 @@ $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \ $(PY_INCLUDE)\tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \ $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \ pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \ Modified: python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk ============================================================================== --- python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk (original) +++ python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk Sun Jan 25 21:08:20 2009 @@ -939,8 +939,6 @@ pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \ stringobject.h sysmodule.h traceback.h tupleobject.h -getmtime.obj: pyconfig.h - getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \ pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \ import.h intobject.h intrcheck.h listobject.h longobject.h \ Modified: python/branches/py3k-issue1717/PC/os2vacpp/python.def ============================================================================== --- python/branches/py3k-issue1717/PC/os2vacpp/python.def (original) +++ python/branches/py3k-issue1717/PC/os2vacpp/python.def Sun Jan 25 21:08:20 2009 @@ -280,7 +280,6 @@ PyNumber_Xor PyOS_AfterFork PyOS_FiniInterrupts - PyOS_GetLastModificationTime PyOS_InitInterrupts PyOS_InterruptOccurred PyOS_Readline Modified: python/branches/py3k-issue1717/PC/pyconfig.h ============================================================================== --- python/branches/py3k-issue1717/PC/pyconfig.h (original) +++ python/branches/py3k-issue1717/PC/pyconfig.h Sun Jan 25 21:08:20 2009 @@ -88,6 +88,12 @@ #define USE_SOCKET #endif +/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ +#if defined(MS_WINCE) +# include +# define strdup _strdup +#endif + #ifdef MS_WINCE /* Python uses GetVersion() to distinguish between * Windows NT and 9x/ME where OS Unicode support is concerned. @@ -395,11 +401,11 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 -/* Define to 1 if you have the `isinf' function. */ -#define HAVE_ISINF 1 +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 /* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 +#define HAVE_DECL_ISNAN 1 /* Define if on AIX 3. System headers sometimes define this. Modified: python/branches/py3k-issue1717/PC/winreg.c ============================================================================== --- python/branches/py3k-issue1717/PC/winreg.c (original) +++ python/branches/py3k-issue1717/PC/winreg.c Sun Jan 25 21:08:20 2009 @@ -451,7 +451,7 @@ PyHKEY_binaryFailureFunc, /* nb_xor */ PyHKEY_binaryFailureFunc, /* nb_or */ PyHKEY_intFunc, /* nb_int */ - PyHKEY_unaryFailureFunc, /* nb_long */ + 0, /* nb_reserved */ PyHKEY_unaryFailureFunc, /* nb_float */ }; Modified: python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj (original) +++ python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj Sun Jan 25 21:08:20 2009 @@ -1651,10 +1651,6 @@ > - - Modified: python/branches/py3k-issue1717/Parser/asdl.py ============================================================================== --- python/branches/py3k-issue1717/Parser/asdl.py (original) +++ python/branches/py3k-issue1717/Parser/asdl.py Sun Jan 25 21:08:20 2009 @@ -176,7 +176,7 @@ return Product(fields) def p_sum_0(self, constructor): - " sum ::= constructor """ + " sum ::= constructor " return [constructor[0]] def p_sum_1(self, info): Modified: python/branches/py3k-issue1717/Parser/printgrammar.c ============================================================================== --- python/branches/py3k-issue1717/Parser/printgrammar.c (original) +++ python/branches/py3k-issue1717/Parser/printgrammar.c Sun Jan 25 21:08:20 2009 @@ -16,6 +16,7 @@ fprintf(fp, "/* Generated by Parser/pgen */\n\n"); fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n"); + fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); printdfas(g, fp); printlabels(g, fp); fprintf(fp, "grammar _PyParser_Grammar = {\n"); 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 Sun Jan 25 21:08:20 2009 @@ -479,7 +479,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_reserved */ + 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k-issue1717/Python/ast.c ============================================================================== --- python/branches/py3k-issue1717/Python/ast.c (original) +++ python/branches/py3k-issue1717/Python/ast.c Sun Jan 25 21:08:20 2009 @@ -191,7 +191,7 @@ default: { char buf[128]; - sprintf(buf, "Non-statement found: %d %d\n", + sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } Modified: python/branches/py3k-issue1717/Python/bltinmodule.c ============================================================================== --- python/branches/py3k-issue1717/Python/bltinmodule.c (original) +++ python/branches/py3k-issue1717/Python/bltinmodule.c Sun Jan 25 21:08:20 2009 @@ -112,7 +112,7 @@ ns = PyDict_New(); } else { - PyObject *pargs = Py_BuildValue("OO", name, bases); + PyObject *pargs = PyTuple_Pack(2, name, bases); if (pargs == NULL) { Py_DECREF(prep); Py_DECREF(meta); @@ -133,7 +133,7 @@ cell = PyObject_CallFunctionObjArgs(func, ns, NULL); if (cell != NULL) { PyObject *margs; - margs = Py_BuildValue("OOO", name, bases, ns); + margs = PyTuple_Pack(3, name, bases, ns); if (margs != NULL) { cls = PyEval_CallObjectWithKeywords(meta, margs, mkw); Py_DECREF(margs); @@ -375,7 +375,6 @@ long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -735,7 +734,7 @@ PyObject *prog, *globals = Py_None, *locals = Py_None; int plain = 0; - if (!PyArg_ParseTuple(args, "O|OO:exec", &prog, &globals, &locals)) + if (!PyArg_UnpackTuple(args, "exec", 1, 3, &prog, &globals, &locals)) return NULL; if (globals == Py_None) { @@ -801,8 +800,8 @@ PyDoc_STRVAR(exec_doc, "exec(object[, globals[, locals]])\n\ \n\ -Read and execute code from a object, which can be a string, a code\n\ -object or a file object.\n\ +Read and execute code from a object, which can be a string or a code\n\ +object.\n\ The globals and locals are dictionaries, defaulting to the current\n\ globals and locals. If only globals is given, locals defaults to it."); @@ -2125,7 +2124,6 @@ Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); @@ -2141,7 +2139,6 @@ return NULL; for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { Py_DECREF(result); Modified: python/branches/py3k-issue1717/Python/ceval.c ============================================================================== --- python/branches/py3k-issue1717/Python/ceval.c (original) +++ python/branches/py3k-issue1717/Python/ceval.c Sun Jan 25 21:08:20 2009 @@ -205,6 +205,7 @@ #include "pythread.h" static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */ +static PyThread_type_lock pending_lock = 0; /* for pending calls */ static long main_thread = 0; int @@ -276,6 +277,7 @@ adding a new function to each thread_*.h. Instead, just create a new lock and waste a little bit of memory */ interpreter_lock = PyThread_allocate_lock(); + pending_lock = PyThread_allocate_lock(); PyThread_acquire_lock(interpreter_lock, 1); main_thread = PyThread_get_thread_ident(); @@ -348,19 +350,145 @@ #ifdef WITH_THREAD Any thread can schedule pending calls, but only the main thread will execute them. + There is no facility to schedule calls to a particular thread, but + that should be easy to change, should that ever be required. In + that case, the static variables here should go into the python + threadstate. #endif +*/ + +#ifdef WITH_THREAD + +/* The WITH_THREAD implementation is thread-safe. It allows + scheduling to be made from any thread, and even from an executing + callback. + */ + +#define NPENDINGCALLS 32 +static struct { + int (*func)(void *); + void *arg; +} pendingcalls[NPENDINGCALLS]; +static int pendingfirst = 0; +static int pendinglast = 0; +static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */ +static char pendingbusy = 0; + +int +Py_AddPendingCall(int (*func)(void *), void *arg) +{ + int i, j, result=0; + PyThread_type_lock lock = pending_lock; + + /* try a few times for the lock. Since this mechanism is used + * for signal handling (on the main thread), there is a (slim) + * chance that a signal is delivered on the same thread while we + * hold the lock during the Py_MakePendingCalls() function. + * This avoids a deadlock in that case. + * Note that signals can be delivered on any thread. In particular, + * on Windows, a SIGINT is delivered on a system-created worker + * thread. + * We also check for lock being NULL, in the unlikely case that + * this function is called before any bytecode evaluation takes place. + */ + if (lock != NULL) { + for (i = 0; i<100; i++) { + if (PyThread_acquire_lock(lock, NOWAIT_LOCK)) + break; + } + if (i == 100) + return -1; + } + + i = pendinglast; + j = (i + 1) % NPENDINGCALLS; + if (j == pendingfirst) { + result = -1; /* Queue full */ + } else { + pendingcalls[i].func = func; + pendingcalls[i].arg = arg; + pendinglast = j; + } + /* signal main loop */ + _Py_Ticker = 0; + pendingcalls_to_do = 1; + if (lock != NULL) + PyThread_release_lock(lock); + return result; +} - XXX WARNING! ASYNCHRONOUSLY EXECUTING CODE! +int +Py_MakePendingCalls(void) +{ + int i; + int r = 0; + + if (!pending_lock) { + /* initial allocation of the lock */ + pending_lock = PyThread_allocate_lock(); + if (pending_lock == NULL) + return -1; + } + + /* only service pending calls on main thread */ + if (main_thread && PyThread_get_thread_ident() != main_thread) + return 0; + /* don't perform recursive pending calls */ + if (pendingbusy) + return 0; + pendingbusy = 1; + /* perform a bounded number of calls, in case of recursion */ + for (i=0; i= 0) { \ + FAST_DISPATCH(); \ + } \ + continue; \ + } + +#ifdef LLTRACE +#define FAST_DISPATCH() \ + { \ + if (!lltrace && !_Py_TracingPossible) { \ + f->f_lasti = INSTR_OFFSET(); \ + goto *opcode_targets[*next_instr++]; \ + } \ + goto fast_next_opcode; \ + } +#else +#define FAST_DISPATCH() \ + { \ + if (!_Py_TracingPossible) { \ + f->f_lasti = INSTR_OFFSET(); \ + goto *opcode_targets[*next_instr++]; \ + } \ + goto fast_next_opcode; \ + } +#endif + +#else +#define TARGET(op) \ + case op: +#define TARGET_WITH_IMPL(op, impl) \ + /* silence compiler warnings about `impl` unused */ \ + if (0) goto impl; \ + case op: +#define DISPATCH() continue +#define FAST_DISPATCH() goto fast_next_opcode +#endif + + /* Tuple access macros */ #ifndef Py_DEBUG @@ -658,16 +890,23 @@ predictions turned-on and interpret the results as if some opcodes had been combined or turn-off predictions so that the opcode frequency counter updates for both opcodes. + + Opcode prediction is disabled with threaded code, since the latter allows + the CPU to record separate branch prediction information for each + opcode. + */ -#ifdef DYNAMIC_EXECUTION_PROFILE +#if defined(DYNAMIC_EXECUTION_PROFILE) || defined(USE_COMPUTED_GOTOS) #define PREDICT(op) if (0) goto PRED_##op +#define PREDICTED(op) PRED_##op: +#define PREDICTED_WITH_ARG(op) PRED_##op: #else #define PREDICT(op) if (*next_instr == op) goto PRED_##op -#endif - #define PREDICTED(op) PRED_##op: next_instr++ #define PREDICTED_WITH_ARG(op) PRED_##op: oparg = PEEKARG(); next_instr += 3 +#endif + /* Stack manipulation macros */ @@ -903,7 +1142,7 @@ /* Do periodic things. Doing this every time through the loop would add too much overhead, so we do it only every Nth instruction. We also do it if - ``things_to_do'' is set, i.e. when an asynchronous + ``pendingcalls_to_do'' is set, i.e. when an asynchronous event needs attention (e.g. a signal handler or async I/O handler); see Py_AddPendingCall() and Py_MakePendingCalls() above. */ @@ -919,12 +1158,12 @@ #ifdef WITH_TSC ticked = 1; #endif - if (things_to_do) { + if (pendingcalls_to_do) { if (Py_MakePendingCalls() < 0) { why = WHY_EXCEPTION; goto on_error; } - if (things_to_do) + if (pendingcalls_to_do) /* MakePendingCalls() didn't succeed. Force early re-execution of this "periodic" code, possibly after @@ -1029,56 +1268,56 @@ /* case STOP_CODE: this is an error! */ - case NOP: - goto fast_next_opcode; + TARGET(NOP) + FAST_DISPATCH(); - case LOAD_FAST: + TARGET(LOAD_FAST) x = GETLOCAL(oparg); if (x != NULL) { Py_INCREF(x); PUSH(x); - goto fast_next_opcode; + FAST_DISPATCH(); } format_exc_check_arg(PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, PyTuple_GetItem(co->co_varnames, oparg)); break; - case LOAD_CONST: + TARGET(LOAD_CONST) x = GETITEM(consts, oparg); Py_INCREF(x); PUSH(x); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED_WITH_ARG(STORE_FAST); - case STORE_FAST: + TARGET(STORE_FAST) v = POP(); SETLOCAL(oparg, v); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED(POP_TOP); - case POP_TOP: + TARGET(POP_TOP) v = POP(); Py_DECREF(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_TWO: + TARGET(ROT_TWO) v = TOP(); w = SECOND(); SET_TOP(w); SET_SECOND(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_THREE: + TARGET(ROT_THREE) v = TOP(); w = SECOND(); x = THIRD(); SET_TOP(w); SET_SECOND(x); SET_THIRD(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_FOUR: + TARGET(ROT_FOUR) u = TOP(); v = SECOND(); w = THIRD(); @@ -1087,15 +1326,15 @@ SET_SECOND(w); SET_THIRD(x); SET_FOURTH(u); - goto fast_next_opcode; + FAST_DISPATCH(); - case DUP_TOP: + TARGET(DUP_TOP) v = TOP(); Py_INCREF(v); PUSH(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case DUP_TOPX: + TARGET(DUP_TOPX) if (oparg == 2) { x = TOP(); Py_INCREF(x); @@ -1104,7 +1343,7 @@ STACKADJ(2); SET_TOP(x); SET_SECOND(w); - goto fast_next_opcode; + FAST_DISPATCH(); } else if (oparg == 3) { x = TOP(); Py_INCREF(x); @@ -1116,106 +1355,106 @@ SET_TOP(x); SET_SECOND(w); SET_THIRD(v); - goto fast_next_opcode; + FAST_DISPATCH(); } Py_FatalError("invalid argument to DUP_TOPX" " (bytecode corruption?)"); /* Never returns, so don't bother to set why. */ break; - case UNARY_POSITIVE: + TARGET(UNARY_POSITIVE) v = TOP(); x = PyNumber_Positive(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case UNARY_NEGATIVE: + TARGET(UNARY_NEGATIVE) v = TOP(); x = PyNumber_Negative(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case UNARY_NOT: + TARGET(UNARY_NOT) v = TOP(); err = PyObject_IsTrue(v); Py_DECREF(v); if (err == 0) { Py_INCREF(Py_True); SET_TOP(Py_True); - continue; + DISPATCH(); } else if (err > 0) { Py_INCREF(Py_False); SET_TOP(Py_False); err = 0; - continue; + DISPATCH(); } STACKADJ(-1); break; - case UNARY_INVERT: + TARGET(UNARY_INVERT) v = TOP(); x = PyNumber_Invert(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_POWER: + TARGET(BINARY_POWER) w = POP(); v = TOP(); x = PyNumber_Power(v, w, Py_None); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_MULTIPLY: + TARGET(BINARY_MULTIPLY) w = POP(); v = TOP(); x = PyNumber_Multiply(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_TRUE_DIVIDE: + TARGET(BINARY_TRUE_DIVIDE) w = POP(); v = TOP(); x = PyNumber_TrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_FLOOR_DIVIDE: + TARGET(BINARY_FLOOR_DIVIDE) w = POP(); v = TOP(); x = PyNumber_FloorDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_MODULO: + TARGET(BINARY_MODULO) w = POP(); v = TOP(); x = PyNumber_Remainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_ADD: + TARGET(BINARY_ADD) w = POP(); v = TOP(); if (PyUnicode_CheckExact(v) && @@ -1231,152 +1470,152 @@ skip_decref_vx: Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_SUBTRACT: + TARGET(BINARY_SUBTRACT) w = POP(); v = TOP(); x = PyNumber_Subtract(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_SUBSCR: + TARGET(BINARY_SUBSCR) w = POP(); v = TOP(); x = PyObject_GetItem(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_LSHIFT: + TARGET(BINARY_LSHIFT) w = POP(); v = TOP(); x = PyNumber_Lshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_RSHIFT: + TARGET(BINARY_RSHIFT) w = POP(); v = TOP(); x = PyNumber_Rshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_AND: + TARGET(BINARY_AND) w = POP(); v = TOP(); x = PyNumber_And(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_XOR: + TARGET(BINARY_XOR) w = POP(); v = TOP(); x = PyNumber_Xor(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_OR: + TARGET(BINARY_OR) w = POP(); v = TOP(); x = PyNumber_Or(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case LIST_APPEND: + TARGET(LIST_APPEND) w = POP(); v = stack_pointer[-oparg]; err = PyList_Append(v, w); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case SET_ADD: + TARGET(SET_ADD) w = POP(); v = stack_pointer[-oparg]; err = PySet_Add(v, w); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case INPLACE_POWER: + TARGET(INPLACE_POWER) w = POP(); v = TOP(); x = PyNumber_InPlacePower(v, w, Py_None); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_MULTIPLY: + TARGET(INPLACE_MULTIPLY) w = POP(); v = TOP(); x = PyNumber_InPlaceMultiply(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_TRUE_DIVIDE: + TARGET(INPLACE_TRUE_DIVIDE) w = POP(); v = TOP(); x = PyNumber_InPlaceTrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_FLOOR_DIVIDE: + TARGET(INPLACE_FLOOR_DIVIDE) w = POP(); v = TOP(); x = PyNumber_InPlaceFloorDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_MODULO: + TARGET(INPLACE_MODULO) w = POP(); v = TOP(); x = PyNumber_InPlaceRemainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_ADD: + TARGET(INPLACE_ADD) w = POP(); v = TOP(); if (PyUnicode_CheckExact(v) && @@ -1392,70 +1631,70 @@ skip_decref_v: Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_SUBTRACT: + TARGET(INPLACE_SUBTRACT) w = POP(); v = TOP(); x = PyNumber_InPlaceSubtract(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_LSHIFT: + TARGET(INPLACE_LSHIFT) w = POP(); v = TOP(); x = PyNumber_InPlaceLshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_RSHIFT: + TARGET(INPLACE_RSHIFT) w = POP(); v = TOP(); x = PyNumber_InPlaceRshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_AND: + TARGET(INPLACE_AND) w = POP(); v = TOP(); x = PyNumber_InPlaceAnd(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_XOR: + TARGET(INPLACE_XOR) w = POP(); v = TOP(); x = PyNumber_InPlaceXor(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_OR: + TARGET(INPLACE_OR) w = POP(); v = TOP(); x = PyNumber_InPlaceOr(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case STORE_SUBSCR: + TARGET(STORE_SUBSCR) w = TOP(); v = SECOND(); u = THIRD(); @@ -1465,10 +1704,10 @@ Py_DECREF(u); Py_DECREF(v); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_SUBSCR: + TARGET(DELETE_SUBSCR) w = TOP(); v = SECOND(); STACKADJ(-2); @@ -1476,10 +1715,10 @@ err = PyObject_DelItem(v, w); Py_DECREF(v); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case PRINT_EXPR: + TARGET(PRINT_EXPR) v = POP(); w = PySys_GetObject("displayhook"); if (w == NULL) { @@ -1506,7 +1745,7 @@ #ifdef CASE_TOO_BIG default: switch (opcode) { #endif - case RAISE_VARARGS: + TARGET(RAISE_VARARGS) v = w = NULL; switch (oparg) { case 2: @@ -1524,19 +1763,19 @@ } break; - case STORE_LOCALS: + TARGET(STORE_LOCALS) x = POP(); v = f->f_locals; Py_XDECREF(v); f->f_locals = x; - continue; + DISPATCH(); - case RETURN_VALUE: + TARGET(RETURN_VALUE) retval = POP(); why = WHY_RETURN; goto fast_block_end; - case YIELD_VALUE: + TARGET(YIELD_VALUE) retval = POP(); f->f_stacktop = stack_pointer; why = WHY_YIELD; @@ -1546,7 +1785,7 @@ SWAP_EXC_STATE(); goto fast_yield; - case POP_EXCEPT: + TARGET(POP_EXCEPT) { PyTryBlock *b = PyFrame_BlockPop(f); if (b->b_type != EXCEPT_HANDLER) { @@ -1557,17 +1796,17 @@ } UNWIND_EXCEPT_HANDLER(b); } - continue; + DISPATCH(); - case POP_BLOCK: + TARGET(POP_BLOCK) { PyTryBlock *b = PyFrame_BlockPop(f); UNWIND_BLOCK(b); } - continue; + DISPATCH(); PREDICTED(END_FINALLY); - case END_FINALLY: + TARGET(END_FINALLY) v = POP(); if (PyLong_Check(v)) { why = (enum why_code) PyLong_AS_LONG(v); @@ -1607,7 +1846,7 @@ Py_DECREF(v); break; - case LOAD_BUILD_CLASS: + TARGET(LOAD_BUILD_CLASS) x = PyDict_GetItemString(f->f_builtins, "__build_class__"); if (x == NULL) { @@ -1619,7 +1858,7 @@ PUSH(x); break; - case STORE_NAME: + TARGET(STORE_NAME) w = GETITEM(names, oparg); v = POP(); if ((x = f->f_locals) != NULL) { @@ -1628,14 +1867,14 @@ else err = PyObject_SetItem(x, w, v); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; } PyErr_Format(PyExc_SystemError, "no locals found when storing %R", w); break; - case DELETE_NAME: + TARGET(DELETE_NAME) w = GETITEM(names, oparg); if ((x = f->f_locals) != NULL) { if ((err = PyObject_DelItem(x, w)) != 0) @@ -1649,7 +1888,7 @@ break; PREDICTED_WITH_ARG(UNPACK_SEQUENCE); - case UNPACK_SEQUENCE: + TARGET(UNPACK_SEQUENCE) v = POP(); if (PyTuple_CheckExact(v) && PyTuple_GET_SIZE(v) == oparg) { @@ -1661,7 +1900,7 @@ PUSH(w); } Py_DECREF(v); - continue; + DISPATCH(); } else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) { PyObject **items = \ @@ -1681,7 +1920,7 @@ Py_DECREF(v); break; - case UNPACK_EX: + TARGET(UNPACK_EX) { int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); v = POP(); @@ -1696,7 +1935,7 @@ break; } - case STORE_ATTR: + TARGET(STORE_ATTR) w = GETITEM(names, oparg); v = TOP(); u = SECOND(); @@ -1704,10 +1943,10 @@ err = PyObject_SetAttr(v, w, u); /* v.w = u */ Py_DECREF(v); Py_DECREF(u); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_ATTR: + TARGET(DELETE_ATTR) w = GETITEM(names, oparg); v = POP(); err = PyObject_SetAttr(v, w, (PyObject *)NULL); @@ -1715,22 +1954,22 @@ Py_DECREF(v); break; - case STORE_GLOBAL: + TARGET(STORE_GLOBAL) w = GETITEM(names, oparg); v = POP(); err = PyDict_SetItem(f->f_globals, w, v); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_GLOBAL: + TARGET(DELETE_GLOBAL) w = GETITEM(names, oparg); if ((err = PyDict_DelItem(f->f_globals, w)) != 0) format_exc_check_arg( PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w); break; - case LOAD_NAME: + TARGET(LOAD_NAME) w = GETITEM(names, oparg); if ((v = f->f_locals) == NULL) { PyErr_Format(PyExc_SystemError, @@ -1765,9 +2004,9 @@ Py_INCREF(x); } PUSH(x); - continue; + DISPATCH(); - case LOAD_GLOBAL: + TARGET(LOAD_GLOBAL) w = GETITEM(names, oparg); if (PyUnicode_CheckExact(w)) { /* Inline the PyDict_GetItem() calls. @@ -1787,7 +2026,7 @@ if (x != NULL) { Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); } d = (PyDictObject *)(f->f_builtins); e = d->ma_lookup(d, w, hash); @@ -1799,7 +2038,7 @@ if (x != NULL) { Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); } goto load_global_error; } @@ -1818,13 +2057,13 @@ } Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); - case DELETE_FAST: + TARGET(DELETE_FAST) x = GETLOCAL(oparg); if (x != NULL) { SETLOCAL(oparg, NULL); - continue; + DISPATCH(); } format_exc_check_arg( PyExc_UnboundLocalError, @@ -1833,19 +2072,19 @@ ); break; - case LOAD_CLOSURE: + TARGET(LOAD_CLOSURE) x = freevars[oparg]; Py_INCREF(x); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case LOAD_DEREF: + TARGET(LOAD_DEREF) x = freevars[oparg]; w = PyCell_Get(x); if (w != NULL) { PUSH(w); - continue; + DISPATCH(); } err = -1; /* Don't stomp existing exception */ @@ -1866,14 +2105,14 @@ } break; - case STORE_DEREF: + TARGET(STORE_DEREF) w = POP(); x = freevars[oparg]; PyCell_Set(x, w); Py_DECREF(w); - continue; + DISPATCH(); - case BUILD_TUPLE: + TARGET(BUILD_TUPLE) x = PyTuple_New(oparg); if (x != NULL) { for (; --oparg >= 0;) { @@ -1881,11 +2120,11 @@ PyTuple_SET_ITEM(x, oparg, w); } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_LIST: + TARGET(BUILD_LIST) x = PyList_New(oparg); if (x != NULL) { for (; --oparg >= 0;) { @@ -1893,11 +2132,11 @@ PyList_SET_ITEM(x, oparg, w); } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_SET: + TARGET(BUILD_SET) x = PySet_New(NULL); if (x != NULL) { for (; --oparg >= 0;) { @@ -1911,17 +2150,17 @@ break; } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_MAP: + TARGET(BUILD_MAP) x = _PyDict_NewPresized((Py_ssize_t)oparg); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case STORE_MAP: + TARGET(STORE_MAP) w = TOP(); /* key */ u = SECOND(); /* value */ v = THIRD(); /* dict */ @@ -1930,10 +2169,10 @@ err = PyDict_SetItem(v, w, u); /* v[w] = u */ Py_DECREF(u); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case MAP_ADD: + TARGET(MAP_ADD) w = TOP(); /* key */ u = SECOND(); /* value */ STACKADJ(-2); @@ -1944,20 +2183,20 @@ Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case LOAD_ATTR: + TARGET(LOAD_ATTR) w = GETITEM(names, oparg); v = TOP(); x = PyObject_GetAttr(v, w); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case COMPARE_OP: + TARGET(COMPARE_OP) w = POP(); v = TOP(); x = cmp_outcome(oparg, v, w); @@ -1967,9 +2206,9 @@ if (x == NULL) break; PREDICT(JUMP_IF_FALSE); PREDICT(JUMP_IF_TRUE); - continue; + DISPATCH(); - case IMPORT_NAME: + TARGET(IMPORT_NAME) w = GETITEM(names, oparg); x = PyDict_GetItemString(f->f_builtins, "__import__"); if (x == NULL) { @@ -2010,10 +2249,10 @@ READ_TIMESTAMP(intr1); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case IMPORT_STAR: + TARGET(IMPORT_STAR) v = POP(); PyFrame_FastToLocals(f); if ((x = f->f_locals) == NULL) { @@ -2026,33 +2265,33 @@ READ_TIMESTAMP(intr1); PyFrame_LocalsToFast(f, 0); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case IMPORT_FROM: + TARGET(IMPORT_FROM) w = GETITEM(names, oparg); v = TOP(); READ_TIMESTAMP(intr0); x = import_from(v, w); READ_TIMESTAMP(intr1); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case JUMP_FORWARD: + TARGET(JUMP_FORWARD) JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED_WITH_ARG(JUMP_IF_FALSE); - case JUMP_IF_FALSE: + TARGET(JUMP_IF_FALSE) w = TOP(); if (w == Py_True) { PREDICT(POP_TOP); - goto fast_next_opcode; + FAST_DISPATCH(); } if (w == Py_False) { JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); } err = PyObject_IsTrue(w); if (err > 0) @@ -2061,18 +2300,18 @@ JUMPBY(oparg); else break; - continue; + DISPATCH(); PREDICTED_WITH_ARG(JUMP_IF_TRUE); - case JUMP_IF_TRUE: + TARGET(JUMP_IF_TRUE) w = TOP(); if (w == Py_False) { PREDICT(POP_TOP); - goto fast_next_opcode; + FAST_DISPATCH(); } if (w == Py_True) { JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); } err = PyObject_IsTrue(w); if (err > 0) { @@ -2083,10 +2322,10 @@ ; else break; - continue; + DISPATCH(); PREDICTED_WITH_ARG(JUMP_ABSOLUTE); - case JUMP_ABSOLUTE: + TARGET(JUMP_ABSOLUTE) JUMPTO(oparg); #if FAST_LOOPS /* Enabling this path speeds-up all while and for-loops by bypassing @@ -2094,14 +2333,14 @@ because it prevents detection of a control-break in tight loops like "while 1: pass". Compile with this option turned-on when you need the speed-up and do not need break checking inside tight loops (ones - that contain only instructions ending with goto fast_next_opcode). + that contain only instructions ending with FAST_DISPATCH). */ - goto fast_next_opcode; + FAST_DISPATCH(); #else - continue; + DISPATCH(); #endif - case GET_ITER: + TARGET(GET_ITER) /* before: [obj]; after [getiter(obj)] */ v = TOP(); x = PyObject_GetIter(v); @@ -2109,13 +2348,13 @@ if (x != NULL) { SET_TOP(x); PREDICT(FOR_ITER); - continue; + DISPATCH(); } STACKADJ(-1); break; PREDICTED_WITH_ARG(FOR_ITER); - case FOR_ITER: + TARGET(FOR_ITER) /* before: [iter]; after: [iter, iter()] *or* [] */ v = TOP(); x = (*v->ob_type->tp_iternext)(v); @@ -2123,7 +2362,7 @@ PUSH(x); PREDICT(STORE_FAST); PREDICT(UNPACK_SEQUENCE); - continue; + DISPATCH(); } if (PyErr_Occurred()) { if (!PyErr_ExceptionMatches( @@ -2135,13 +2374,13 @@ x = v = POP(); Py_DECREF(v); JUMPBY(oparg); - continue; + DISPATCH(); - case BREAK_LOOP: + TARGET(BREAK_LOOP) why = WHY_BREAK; goto fast_block_end; - case CONTINUE_LOOP: + TARGET(CONTINUE_LOOP) retval = PyLong_FromLong(oparg); if (!retval) { x = NULL; @@ -2150,9 +2389,10 @@ why = WHY_CONTINUE; goto fast_block_end; - case SETUP_LOOP: - case SETUP_EXCEPT: - case SETUP_FINALLY: + TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally) + TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally) + TARGET(SETUP_FINALLY) + _setup_finally: /* NOTE: If you add any new block-setup opcodes that are not try/except/finally handlers, you may need to update the PyGen_NeedsFinalizing() function. @@ -2160,9 +2400,9 @@ PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg, STACK_LEVEL()); - continue; + DISPATCH(); - case WITH_CLEANUP: + TARGET(WITH_CLEANUP) { /* At the top of the stack are 1-3 values indicating how/why we entered the finally clause: @@ -2226,7 +2466,7 @@ break; } - case CALL_FUNCTION: + TARGET(CALL_FUNCTION) { PyObject **sp; PCALL(PCALL_ALL); @@ -2239,13 +2479,14 @@ stack_pointer = sp; PUSH(x); if (x != NULL) - continue; + DISPATCH(); break; } - case CALL_FUNCTION_VAR: - case CALL_FUNCTION_KW: - case CALL_FUNCTION_VAR_KW: + TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw) + TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw) + TARGET(CALL_FUNCTION_VAR_KW) + _call_function_var_kw: { int na = oparg & 0xff; int nk = (oparg>>8) & 0xff; @@ -2285,12 +2526,13 @@ } PUSH(x); if (x != NULL) - continue; + DISPATCH(); break; } - case MAKE_CLOSURE: - case MAKE_FUNCTION: + TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function) + TARGET(MAKE_FUNCTION) + _make_function: { int posdefaults = oparg & 0xff; int kwdefaults = (oparg>>8) & 0xff; @@ -2383,7 +2625,7 @@ break; } - case BUILD_SLICE: + TARGET(BUILD_SLICE) if (oparg == 3) w = POP(); else @@ -2395,14 +2637,17 @@ Py_DECREF(v); Py_XDECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case EXTENDED_ARG: + TARGET(EXTENDED_ARG) opcode = NEXTOP(); oparg = oparg<<16 | NEXTARG(); goto dispatch_opcode; +#ifdef USE_COMPUTED_GOTOS + _unknown_opcode: +#endif default: fprintf(stderr, "XXX lineno: %d, opcode: %d\n", Modified: python/branches/py3k-issue1717/Python/compile.c ============================================================================== --- python/branches/py3k-issue1717/Python/compile.c (original) +++ python/branches/py3k-issue1717/Python/compile.c Sun Jan 25 21:08:20 2009 @@ -1239,7 +1239,7 @@ char buf[350]; PyOS_snprintf(buf, sizeof(buf), "unknown scope for %.100s in %.100s(%s) in %s\n" - "symbols: %s\nlocals: %s\nglobals: %s\n", + "symbols: %s\nlocals: %s\nglobals: %s", PyBytes_AS_STRING(name), PyBytes_AS_STRING(c->u->u_name), PyObject_REPR(c->u->u_ste->ste_id), Modified: python/branches/py3k-issue1717/Python/getcopyright.c ============================================================================== --- python/branches/py3k-issue1717/Python/getcopyright.c (original) +++ python/branches/py3k-issue1717/Python/getcopyright.c Sun Jan 25 21:08:20 2009 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ Deleted: python/branches/py3k-issue1717/Python/getmtime.c ============================================================================== --- python/branches/py3k-issue1717/Python/getmtime.c Sun Jan 25 21:08:20 2009 +++ (empty file) @@ -1,26 +0,0 @@ - -/* Subroutine to get the last modification time of a file */ - -/* (A separate file because this may be OS dependent) */ - -#include "Python.h" -#include "pyconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -time_t -PyOS_GetLastModificationTime(char *path, FILE *fp) -{ - struct stat st; - if (fstat(fileno(fp), &st) != 0) - return -1; - else - return st.st_mtime; -} - -#ifdef __cplusplus -} -#endif - Modified: python/branches/py3k-issue1717/Python/graminit.c ============================================================================== --- python/branches/py3k-issue1717/Python/graminit.c (original) +++ python/branches/py3k-issue1717/Python/graminit.c Sun Jan 25 21:08:20 2009 @@ -2,6 +2,7 @@ #include "pgenheaders.h" #include "grammar.h" +PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, Modified: python/branches/py3k-issue1717/Python/import.c ============================================================================== --- python/branches/py3k-issue1717/Python/import.c (original) +++ python/branches/py3k-issue1717/Python/import.c Sun Jan 25 21:08:20 2009 @@ -27,8 +27,6 @@ typedef unsigned short mode_t; #endif -extern time_t PyOS_GetLastModificationTime(char *, FILE *); - /* In getmtime.c */ /* Magic word to reject .pyc files generated by other Python versions. It should change for each incompatible change to the bytecode. @@ -961,6 +959,49 @@ PySys_WriteStderr("# wrote %s\n", cpathname); } +static void +update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname) +{ + PyObject *constants, *tmp; + Py_ssize_t i, n; + + if (PyUnicode_Compare(co->co_filename, oldname)) + return; + + tmp = co->co_filename; + co->co_filename = newname; + Py_INCREF(co->co_filename); + Py_DECREF(tmp); + + constants = co->co_consts; + n = PyTuple_GET_SIZE(constants); + for (i = 0; i < n; i++) { + tmp = PyTuple_GET_ITEM(constants, i); + if (PyCode_Check(tmp)) + update_code_filenames((PyCodeObject *)tmp, + oldname, newname); + } +} + +static int +update_compiled_module(PyCodeObject *co, char *pathname) +{ + PyObject *oldname, *newname; + + if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname)) + return 0; + + newname = PyUnicode_FromString(pathname); + if (newname == NULL) + return -1; + + oldname = co->co_filename; + Py_INCREF(oldname); + update_code_filenames(co, oldname, newname); + Py_DECREF(oldname); + Py_DECREF(newname); + return 1; +} /* Load a source module from a given file and return its module object WITH INCREMENTED REFERENCE COUNT. If there's a matching @@ -1001,6 +1042,8 @@ fclose(fpc); if (co == NULL) return NULL; + if (update_compiled_module(co, pathname) < 0) + return NULL; if (Py_VerboseFlag) PySys_WriteStderr("import %s # precompiled from %s\n", name, cpathname); @@ -3190,24 +3233,11 @@ PyErr_SetString(PyExc_ImportError, "empty pathname"); return -1; } else { +#ifndef MS_WINDOWS struct stat statbuf; int rv; rv = stat(path, &statbuf); -#ifdef MS_WINDOWS - /* MS Windows stat() chokes on paths like C:\path\. Try to - * recover *one* time by stripping off a trailing slash or - * backslash. http://bugs.python.org/issue1293 - */ - if (rv != 0 && pathlen <= MAXPATHLEN && - (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { - char mangled[MAXPATHLEN+1]; - - strcpy(mangled, path); - mangled[pathlen-1] = '\0'; - rv = stat(mangled, &statbuf); - } -#endif PyMem_Free(path); if (rv == 0) { /* it exists */ @@ -3218,6 +3248,24 @@ return -1; } } +#else /* MS_WINDOWS */ + DWORD rv; + /* see issue1293 and issue3677: + * stat() on Windows doesn't recognise paths like + * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. + */ + rv = GetFileAttributesA(path); + PyMem_Free(path); + if (rv != INVALID_FILE_ATTRIBUTES) { + /* it exists */ + if (rv & FILE_ATTRIBUTE_DIRECTORY) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif } return 0; } Modified: python/branches/py3k-issue1717/Python/pythonrun.c ============================================================================== --- python/branches/py3k-issue1717/Python/pythonrun.c (original) +++ python/branches/py3k-issue1717/Python/pythonrun.c Sun Jan 25 21:08:20 2009 @@ -23,6 +23,10 @@ #include #endif +#ifdef MS_WINDOWS +#include "malloc.h" /* for alloca */ +#endif + #ifdef HAVE_LANGINFO_H #include #include @@ -84,6 +88,7 @@ int Py_FrozenFlag; /* Needed by getpath.c */ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ +int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */ /* PyModule_GetWarningsModule is no longer necessary as of 2.6 since _warnings is builtin. This API should not be used. */ @@ -724,6 +729,83 @@ } } +static PyObject* +create_stdio(PyObject* io, + int fd, int write_mode, char* name, + char* encoding, char* errors) +{ + PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL, *res; + const char* mode; + PyObject *line_buffering; + int buffering, isatty; + + if (Py_UnbufferedStdioFlag) + buffering = 0; + else + buffering = -1; + if (write_mode) + mode = "wb"; + else + mode = "rb"; + buf = PyObject_CallMethod(io, "open", "isiOOOi", + fd, mode, buffering, + Py_None, Py_None, Py_None, 0); + if (buf == NULL) + goto error; + + if (!Py_UnbufferedStdioFlag) { + raw = PyObject_GetAttrString(buf, "raw"); + if (raw == NULL) + goto error; + } + else { + raw = buf; + Py_INCREF(raw); + } + + text = PyUnicode_FromString(name); + if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0) + goto error; + res = PyObject_CallMethod(raw, "isatty", ""); + if (res == NULL) + goto error; + isatty = PyObject_IsTrue(res); + Py_DECREF(res); + if (isatty == -1) + goto error; + if (isatty || Py_UnbufferedStdioFlag) + line_buffering = Py_True; + else + line_buffering = Py_False; + + Py_CLEAR(raw); + Py_CLEAR(text); + + stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO", + buf, encoding, errors, + "\n", line_buffering); + Py_CLEAR(buf); + if (stream == NULL) + goto error; + + if (write_mode) + mode = "w"; + else + mode = "r"; + text = PyUnicode_FromString(mode); + if (!text || PyObject_SetAttrString(stream, "mode", text) < 0) + goto error; + Py_CLEAR(text); + return stream; + +error: + Py_XDECREF(buf); + Py_XDECREF(stream); + Py_XDECREF(text); + Py_XDECREF(raw); + return NULL; +} + /* Initialize sys.stdin, stdout, stderr and builtins.open */ static int initstdio(void) @@ -790,10 +872,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "r", -1, encoding, - errors, "\n", 0))) { + std = create_stdio(iomod, fd, 0, "", encoding, errors); + if (std == NULL) goto error; - } } /* if (fd < 0) */ PySys_SetObject("__stdin__", std); PySys_SetObject("stdin", std); @@ -810,10 +891,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "w", -1, encoding, - errors, "\n", 0))) { + std = create_stdio(iomod, fd, 1, "", encoding, errors); + if (std == NULL) goto error; - } } /* if (fd < 0) */ PySys_SetObject("__stdout__", std); PySys_SetObject("stdout", std); @@ -831,10 +911,9 @@ #endif } else { - if (!(std = PyFile_FromFd(fd, "", "w", -1, encoding, - "backslashreplace", "\n", 0))) { + std = create_stdio(iomod, fd, 1, "", encoding, "backslashreplace"); + if (std == NULL) goto error; - } } /* if (fd < 0) */ /* Same as hack above, pre-import stderr's codec to avoid recursion @@ -1918,9 +1997,21 @@ PyErr_Print(); } #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif Modified: python/branches/py3k-issue1717/Python/sysmodule.c ============================================================================== --- python/branches/py3k-issue1717/Python/sysmodule.c (original) +++ python/branches/py3k-issue1717/Python/sysmodule.c Sun Jan 25 21:08:20 2009 @@ -1257,8 +1257,13 @@ PyDict_SetItemString(sysdict, key, v); \ Py_XDECREF(v) + /* Check that stdin is not a directory + Using shell redirection, you can redirect stdin to a directory, + crashing the Python interpreter. Catch this common mistake here + and output a useful error message. Note that under MS Windows, + the shell already prevents that. */ +#if !defined(MS_WINDOWS) { - /* XXX: does this work on Win/Win64? (see posix_fstat) */ struct stat sb; if (fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { @@ -1268,6 +1273,7 @@ exit(EXIT_FAILURE); } } +#endif /* stdin/stdout/stderr are now set by pythonrun.c */ @@ -1483,7 +1489,7 @@ { #if defined(HAVE_REALPATH) wchar_t fullpath[MAXPATHLEN]; -#elif defined(MS_WINDOWS) +#elif defined(MS_WINDOWS) && !defined(MS_WINCE) wchar_t fullpath[MAX_PATH]; #endif PyObject *av = makeargvobject(argc, argv); @@ -1529,7 +1535,10 @@ #if SEP == '\\' /* Special case for MS filename syntax */ if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) { wchar_t *q; -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) && !defined(MS_WINCE) + /* This code here replaces the first element in argv with the full + path that it represents. Under CE, there are no relative paths so + the argument must be the full path anyway. */ wchar_t *ptemp; if (GetFullPathNameW(argv0, sizeof(fullpath)/sizeof(fullpath[0]), Modified: python/branches/py3k-issue1717/Python/thread.c ============================================================================== --- python/branches/py3k-issue1717/Python/thread.c (original) +++ python/branches/py3k-issue1717/Python/thread.c Sun Jan 25 21:08:20 2009 @@ -133,10 +133,6 @@ #include "thread_os2.h" #endif -#ifdef WINCE_THREADS -#include "thread_wince.h" -#endif - #ifdef PLAN9_THREADS #include "thread_plan9.h" #endif Modified: python/branches/py3k-issue1717/Python/thread_nt.h ============================================================================== --- python/branches/py3k-issue1717/Python/thread_nt.h (original) +++ python/branches/py3k-issue1717/Python/thread_nt.h Sun Jan 25 21:08:20 2009 @@ -104,20 +104,21 @@ typedef struct { void (*func)(void*); void *arg; - long id; - HANDLE done; } callobj; -static int +/* thunker to call adapt between the function type used by the system's +thread start function and the internally used one. */ +#if defined(MS_WINCE) +static DWORD WINAPI +#else +static unsigned __stdcall +#endif bootstrap(void *call) { callobj *obj = (callobj*)call; - /* copy callobj since other thread might free it before we're done */ void (*func)(void*) = obj->func; void *arg = obj->arg; - - obj->id = PyThread_get_thread_ident(); - ReleaseSemaphore(obj->done, 1, NULL); + HeapFree(GetProcessHeap(), 0, obj); func(arg); return 0; } @@ -125,42 +126,55 @@ long PyThread_start_new_thread(void (*func)(void *), void *arg) { - Py_uintptr_t rv; - callobj obj; - + HANDLE hThread; + unsigned threadID; + callobj *obj; + dprintf(("%ld: PyThread_start_new_thread called\n", PyThread_get_thread_ident())); if (!initialized) PyThread_init_thread(); - obj.id = -1; /* guilty until proved innocent */ - obj.func = func; - obj.arg = arg; - obj.done = CreateSemaphore(NULL, 0, 1, NULL); - if (obj.done == NULL) + obj = (callobj*)HeapAlloc(GetProcessHeap(), 0, sizeof(*obj)); + if (!obj) return -1; - - rv = _beginthread(bootstrap, + obj->func = func; + obj->arg = arg; +#if defined(MS_WINCE) + hThread = CreateThread(NULL, + Py_SAFE_DOWNCAST(_pythread_stacksize, Py_ssize_t, SIZE_T), + bootstrap, obj, 0, &threadID); +#else + hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(_pythread_stacksize, - Py_ssize_t, int), - &obj); - if (rv == (Py_uintptr_t)-1) { + Py_ssize_t, unsigned int), + bootstrap, obj, + 0, &threadID); +#endif + if (hThread == 0) { +#if defined(MS_WINCE) + /* Save error in variable, to prevent PyThread_get_thread_ident + from clobbering it. */ + unsigned e = GetLastError(); + dprintf(("%ld: PyThread_start_new_thread failed, win32 error code %u\n", + PyThread_get_thread_ident(), e)); +#else /* I've seen errno == EAGAIN here, which means "there are * too many threads". */ - dprintf(("%ld: PyThread_start_new_thread failed: %p errno %d\n", - PyThread_get_thread_ident(), (void*)rv, errno)); - obj.id = -1; + int e = errno; + dprintf(("%ld: PyThread_start_new_thread failed, errno %d\n", + PyThread_get_thread_ident(), e)); +#endif + threadID = (unsigned)-1; + HeapFree(GetProcessHeap(), 0, obj); } else { dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", - PyThread_get_thread_ident(), (void*)rv)); - /* wait for thread to initialize, so we can get its id */ - WaitForSingleObject(obj.done, INFINITE); - assert(obj.id != -1); + PyThread_get_thread_ident(), (void*)hThread)); + CloseHandle(hThread); } - CloseHandle((HANDLE)obj.done); - return obj.id; + return (long) threadID; } /* @@ -176,52 +190,26 @@ return GetCurrentThreadId(); } -static void -do_PyThread_exit_thread(int no_cleanup) -{ - dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); - if (!initialized) - if (no_cleanup) - _exit(0); - else - exit(0); - _endthread(); -} - void PyThread_exit_thread(void) { - do_PyThread_exit_thread(0); -} - -void -PyThread__exit_thread(void) -{ - do_PyThread_exit_thread(1); -} - -#ifndef NO_EXIT_PROG -static void -do_PyThread_exit_prog(int status, int no_cleanup) -{ - dprintf(("PyThread_exit_prog(%d) called\n", status)); + dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident())); if (!initialized) - if (no_cleanup) - _exit(status); - else - exit(status); + exit(0); +#if defined(MS_WINCE) + ExitThread(0); +#else + _endthreadex(0); +#endif } +#ifndef NO_EXIT_PROG void PyThread_exit_prog(int status) { - do_PyThread_exit_prog(status, 0); -} - -void -PyThread__exit_prog(int status) -{ - do_PyThread_exit_prog(status, 1); + dprintf(("PyThread_exit_prog(%d) called\n", status)); + if (!initialized) + exit(status); } #endif /* NO_EXIT_PROG */ @@ -309,3 +297,73 @@ } #define THREAD_SET_STACKSIZE(x) _pythread_nt_set_stacksize(x) + + +/* use native Windows TLS functions */ +#define Py_HAVE_NATIVE_TLS + +#ifdef Py_HAVE_NATIVE_TLS +int +PyThread_create_key(void) +{ + return (int) TlsAlloc(); +} + +void +PyThread_delete_key(int key) +{ + TlsFree(key); +} + +/* We must be careful to emulate the strange semantics implemented in thread.c, + * where the value is only set if it hasn't been set before. + */ +int +PyThread_set_key_value(int key, void *value) +{ + BOOL ok; + void *oldvalue; + + assert(value != NULL); + oldvalue = TlsGetValue(key); + if (oldvalue != NULL) + /* ignore value if already set */ + return 0; + ok = TlsSetValue(key, value); + if (!ok) + return -1; + return 0; +} + +void * +PyThread_get_key_value(int key) +{ + /* because TLS is used in the Py_END_ALLOW_THREAD macro, + * it is necessary to preserve the windows error state, because + * it is assumed to be preserved across the call to the macro. + * Ideally, the macro should be fixed, but it is simpler to + * do it here. + */ + DWORD error = GetLastError(); + void *result = TlsGetValue(key); + SetLastError(error); + return result; +} + +void +PyThread_delete_key_value(int key) +{ + /* NULL is used as "key missing", and it is also the default + * given by TlsGetValue() if nothing has been set yet. + */ + TlsSetValue(key, NULL); +} + +/* reinitialization of TLS is not necessary after fork when using + * the native TLS functions. And forking isn't supported on Windows either. + */ +void +PyThread_ReInitTLS(void) +{} + +#endif Modified: python/branches/py3k-issue1717/README ============================================================================== --- python/branches/py3k-issue1717/README (original) +++ python/branches/py3k-issue1717/README Sun Jan 25 21:08:20 2009 @@ -2,7 +2,7 @@ ================================== For notes specific to this release, see RELNOTES in this directory. -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. Modified: python/branches/py3k-issue1717/Tools/scripts/patchcheck.py ============================================================================== --- python/branches/py3k-issue1717/Tools/scripts/patchcheck.py (original) +++ python/branches/py3k-issue1717/Tools/scripts/patchcheck.py Sun Jan 25 21:08:20 2009 @@ -62,12 +62,12 @@ @status("Misc/ACKS updated", modal=True) def credit_given(file_paths): """Check if Misc/ACKS has been changed.""" - return True if 'Misc/ACKS' in file_paths else False + return 'Misc/ACKS' in file_paths @status("Misc/NEWS updated", modal=True) def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" - return True if 'Misc/NEWS' in file_paths else False + return 'Misc/NEWS' in file_paths def main(): Modified: python/branches/py3k-issue1717/configure ============================================================================== --- python/branches/py3k-issue1717/configure (original) +++ python/branches/py3k-issue1717/configure Sun Jan 25 21:08:20 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 67461 . +# From configure.in Revision: 68440 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for python 3.1. +# Generated by GNU Autoconf 2.63 for python 3.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,7 +18,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -40,17 +40,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -66,8 +94,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -90,7 +116,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -103,17 +129,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -135,7 +154,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -161,7 +180,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -243,7 +262,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -264,7 +283,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -344,10 +363,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -416,9 +435,10 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf at gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -454,7 +474,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -482,7 +502,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -495,19 +514,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -532,10 +554,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -616,123 +638,153 @@ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -VERSION -SOVERSION -CONFIG_ARGS -UNIVERSALSDK -ARCH_RUN_32BIT -PYTHONFRAMEWORK -PYTHONFRAMEWORKIDENTIFIER -PYTHONFRAMEWORKDIR -PYTHONFRAMEWORKPREFIX -PYTHONFRAMEWORKINSTALLDIR -FRAMEWORKINSTALLFIRST -FRAMEWORKINSTALLLAST -FRAMEWORKALTINSTALLFIRST -FRAMEWORKALTINSTALLLAST -FRAMEWORKUNIXTOOLSPREFIX -MACHDEP -SGI_ABI -CONFIGURE_MACOSX_DEPLOYMENT_TARGET -EXPORT_MACOSX_DEPLOYMENT_TARGET -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CXX -MAINCC -CPP -GREP -EGREP -BUILDEXEEXT -LIBRARY -LDLIBRARY -DLLLIBRARY -BLDLIBRARY -LDLIBRARYDIR -INSTSONAME -RUNSHARED -LINKCC -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 +ac_subst_vars='LTLIBOBJS SRCDIRS -LTLIBOBJS' +THREADHEADERS +LIBC +LIBM +HAVE_GETHOSTBYNAME +HAVE_GETHOSTBYNAME_R +HAVE_GETHOSTBYNAME_R_3_ARG +HAVE_GETHOSTBYNAME_R_5_ARG +HAVE_GETHOSTBYNAME_R_6_ARG +LIBOBJS +TRUE +MACHDEP_OBJS +DYNLOADFILE +DLINCLDIR +THREADOBJ +LDLAST +USE_THREAD_MODULE +SIGNAL_OBJS +USE_SIGNAL_MODULE +SHLIBS +CFLAGSFORSHARED +LINKFORSHARED +CCSHARED +BLDSHARED +LDSHARED +SO +LIBTOOL_CRUFT +OTHER_LIBTOOL_OPT +UNIVERSAL_ARCH_FLAGS +BASECFLAGS +OPT +LN +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SVNVERSION +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 +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_universalsdk +with_universal_archs +with_framework_name +enable_framework +with_gcc +with_cxx_main +with_suffix +enable_shared +enable_profiling +with_pydebug +with_libs +with_system_ffi +with_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 @@ -747,6 +799,8 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -845,13 +899,21 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -864,13 +926,21 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1061,22 +1131,38 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1096,7 +1182,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1105,16 +1191,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1123,22 +1209,38 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1153,7 +1255,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1169,10 +1271,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1180,12 +1282,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1212,12 +1314,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1266,9 +1368,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 @@ -1278,25 +1380,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 @@ -1310,6 +1412,7 @@ cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-universalsdk[=SDKDIR] @@ -1353,6 +1456,8 @@ --with-libm=STRING math library --with-libc=STRING C library --with-wide-unicode Use 4-byte Unicode characters (default is 2 bytes) + --with-computed-gotos Use computed gotos / threaded dispatch in evaluation + loop (not available on all compilers) Some influential environment variables: CC C compiler command @@ -1375,15 +1480,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1419,7 +1526,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1429,10 +1536,10 @@ if $ac_init_version; then cat <<\_ACEOF python configure 3.1 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1443,7 +1550,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1479,7 +1586,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1514,7 +1621,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1566,11 +1673,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1600,9 +1708,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1617,9 +1725,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1635,8 +1743,8 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1678,21 +1786,24 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1702,16 +1813,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1725,29 +1836,38 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1757,10 +1877,12 @@ fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1897,20 +2019,20 @@ UNIVERSAL_ARCHS="32-bit" -{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 -echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 +$as_echo_n "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. if test "${with_universal_archs+set}" = set; then withval=$with_universal_archs; - { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } UNIVERSAL_ARCHS="$withval" else - { echo "$as_me:$LINENO: result: 32-bit" >&5 -echo "${ECHO_T}32-bit" >&6; } + { $as_echo "$as_me:$LINENO: result: 32-bit" >&5 +$as_echo "32-bit" >&6; } fi @@ -2030,8 +2152,8 @@ ## # Set name for machine-dependent library files -{ echo "$as_me:$LINENO: checking MACHDEP" >&5 -echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5 +$as_echo_n "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then ac_sys_system=`uname -s` @@ -2194,8 +2316,8 @@ LDFLAGS="$SGI_ABI $LDFLAGS" MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` fi -{ echo "$as_me:$LINENO: result: $MACHDEP" >&5 -echo "${ECHO_T}$MACHDEP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5 +$as_echo "$MACHDEP" >&6; } # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils @@ -2205,11 +2327,11 @@ CONFIGURE_MACOSX_DEPLOYMENT_TARGET= EXPORT_MACOSX_DEPLOYMENT_TARGET='#' -{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 -echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 +$as_echo_n "checking machine type as reported by uname -m... " >&6; } ac_sys_machine=`uname -m` -{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 -echo "${ECHO_T}$ac_sys_machine" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 +$as_echo "$ac_sys_machine" >&6; } # checks for alternative programs @@ -2221,14 +2343,14 @@ # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? -{ echo "$as_me:$LINENO: checking for --without-gcc" >&5 -echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5 +$as_echo_n "checking for --without-gcc... " >&6; } # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then withval=$with_gcc; case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -2247,15 +2369,15 @@ esac fi -{ echo "$as_me:$LINENO: result: $without_gcc" >&5 -echo "${ECHO_T}$without_gcc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5 +$as_echo "$without_gcc" >&6; } # If the user switches compilers, we can't believe the cache if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then - { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file + { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&5 -echo "$as_me: error: cached CC is different -- throw away $cache_file +$as_echo "$as_me: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&2;} { (exit 1); exit 1; }; } fi @@ -2268,10 +2390,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2284,7 +2406,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2295,11 +2417,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2308,10 +2430,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2324,7 +2446,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2335,11 +2457,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2347,12 +2469,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2365,10 +2483,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2381,7 +2499,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2392,11 +2510,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2405,10 +2523,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2426,7 +2544,7 @@ continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2449,11 +2567,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2464,10 +2582,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2480,7 +2598,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2491,11 +2609,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2508,10 +2626,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2524,7 +2642,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2535,11 +2653,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2551,12 +2669,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2566,44 +2680,50 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2622,27 +2742,22 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2653,10 +2768,11 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2667,7 +2783,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2694,25 +2810,27 @@ ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2721,49 +2839,53 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2772,31 +2894,33 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2819,40 +2943,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2878,20 +3005,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2901,15 +3029,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -2936,20 +3068,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -2974,20 +3107,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3013,20 +3147,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3041,8 +3176,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3058,10 +3193,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3132,20 +3267,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3161,15 +3297,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3182,8 +3318,8 @@ -{ echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 -echo $ECHO_N "checking for --with-cxx-main=... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 +$as_echo_n "checking for --with-cxx-main=... " >&6; } # Check whether --with-cxx_main was given. if test "${with_cxx_main+set}" = set; then @@ -3208,8 +3344,8 @@ fi -{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5 -echo "${ECHO_T}$with_cxx_main" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5 +$as_echo "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -3217,10 +3353,10 @@ case "$CC" in gcc) # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3235,7 +3371,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3248,20 +3384,20 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; cc) # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3276,7 +3412,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3289,11 +3425,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; @@ -3309,10 +3445,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3325,7 +3461,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3336,11 +3472,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3355,12 +3491,12 @@ fi if test "$preset_cxx" != "$CXX" then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -3375,15 +3511,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3415,20 +3551,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3452,13 +3589,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3466,7 +3604,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3491,8 +3629,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3520,20 +3658,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3557,13 +3696,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3571,7 +3711,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3587,11 +3727,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3601,42 +3743,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3651,74 +3788,60 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3733,158 +3856,605 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -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;} + 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 - + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } +{ $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 -{ echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + 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. */ -#ifdef _AIX - yes -#endif +#include _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 + $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 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + 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 -# Check for unsupported systems -case $ac_sys_system/$ac_sys_release in -atheos*|Linux*/1*) - echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. - echo See README for details. - exit 1;; +#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 -{ 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 - withval=$with_suffix; - case $withval in - no) EXEEXT=;; - yes) EXEEXT=.exe;; - *) EXEEXT=$withval;; - esac 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 -{ 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 +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF -{ 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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - BUILDEXEEXT=.exe -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - BUILDEXEEXT=$EXEEXT -fi -rmdir CaseSensitiveTestDir +# On IRIX 5.3, sys/types and inttypes.h are conflicting. -case $MACHDEP in -bsdos*) - case $CC in - gcc) CC="$CC -D_HAVE_BSDI";; - esac;; -esac -case $ac_sys_system in -hp*|HP*) - case $CC in - cc|*/cc) CC="$CC -Ae";; - esac;; -Monterey*) - case $CC in - cc) CC="$CC -Wl,-Bexport";; - esac;; -SunOS*) - # Some functions have a prototype only with that define, e.g. confstr -cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 -_ACEOF - ;; -esac -{ 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 -{ 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 -# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY -# is blank as the main program is not linked directly against LDLIBRARY. -# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On -# systems without shared libraries, LDLIBRARY is the same as LIBRARY -# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library, -# DLLLIBRARY is the shared (i.e., DLL) library. -# + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_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 + + + if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF + + + +# Check for unsupported systems +case $ac_sys_system/$ac_sys_release in +atheos*|Linux*/1*) + echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. + echo See README for details. + exit 1;; +esac + + +{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5 +$as_echo_n "checking for --with-suffix... " >&6; } + +# Check whether --with-suffix was given. +if test "${with_suffix+set}" = set; then + withval=$with_suffix; + case $withval in + no) EXEEXT=;; + yes) EXEEXT=.exe;; + *) EXEEXT=$withval;; + esac +fi + +{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5 +$as_echo "$EXEEXT" >&6; } + +# Test whether we're running on a non-case-sensitive system, in which +# case we give a warning if no ext is given + +{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 +$as_echo_n "checking for case-insensitive build directory... " >&6; } +if test ! -d CaseSensitiveTestDir; then +mkdir CaseSensitiveTestDir +fi + +if test -d casesensitivetestdir +then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + BUILDEXEEXT=.exe +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + BUILDEXEEXT=$EXEEXT +fi +rmdir CaseSensitiveTestDir + +case $MACHDEP in +bsdos*) + case $CC in + gcc) CC="$CC -D_HAVE_BSDI";; + esac;; +esac + +case $ac_sys_system in +hp*|HP*) + case $CC in + cc|*/cc) CC="$CC -Ae";; + esac;; +Monterey*) + case $CC in + cc) CC="$CC -Wl,-Bexport";; + esac;; +SunOS*) + # Some functions have a prototype only with that define, e.g. confstr + +cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + ;; +esac + + + +{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5 +$as_echo_n "checking LIBRARY... " >&6; } +if test -z "$LIBRARY" +then + LIBRARY='libpython$(VERSION).a' +fi +{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5 +$as_echo "$LIBRARY" >&6; } + +# LDLIBRARY is the name of the library to link against (as opposed to the +# name of the library into which to insert object files). BLDLIBRARY is also +# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY +# is blank as the main program is not linked directly against LDLIBRARY. +# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On +# systems without shared libraries, LDLIBRARY is the same as LIBRARY +# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library, +# DLLLIBRARY is the shared (i.e., DLL) library. +# # RUNSHARED is used to run shared python without installed libraries # # INSTSONAME is the name of the shared library that will be use to install @@ -3909,8 +4479,8 @@ # This is altered for AIX in order to build the export list before # linking. -{ echo "$as_me:$LINENO: checking LINKCC" >&5 -echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5 +$as_echo_n "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -3930,11 +4500,11 @@ LINKCC=qcc;; esac fi -{ echo "$as_me:$LINENO: result: $LINKCC" >&5 -echo "${ECHO_T}$LINKCC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5 +$as_echo "$LINKCC" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-shared" >&5 -echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5 +$as_echo_n "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; @@ -3950,11 +4520,11 @@ enable_shared="no";; esac fi -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5 -echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5 +$as_echo_n "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; ac_save_cc="$CC" @@ -3976,29 +4546,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_enable_profiling="yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_enable_profiling="no" fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4006,8 +4579,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 -echo "${ECHO_T}$ac_enable_profiling" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 +$as_echo "$ac_enable_profiling" >&6; } case "$ac_enable_profiling" in "yes") @@ -4016,8 +4589,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5 -echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5 +$as_echo_n "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -4085,6 +4658,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -4095,16 +4674,16 @@ esac fi -{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 -echo "${ECHO_T}$LDLIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 +$as_echo "$LDLIBRARY" >&6; } if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4117,7 +4696,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4128,11 +4707,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4141,10 +4720,10 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4157,7 +4736,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4168,11 +4747,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4180,12 +4759,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -4199,10 +4774,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4215,7 +4790,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4226,11 +4801,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4242,10 +4817,10 @@ # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_SVNVERSION+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$SVNVERSION"; then ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. @@ -4258,7 +4833,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SVNVERSION="found" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4270,11 +4845,11 @@ fi SVNVERSION=$ac_cv_prog_SVNVERSION if test -n "$SVNVERSION"; then - { echo "$as_me:$LINENO: result: $SVNVERSION" >&5 -echo "${ECHO_T}$SVNVERSION" >&6; } + { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5 +$as_echo "$SVNVERSION" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4310,8 +4885,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -4337,11 +4912,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4370,17 +4946,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -4393,8 +4981,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4416,8 +5004,8 @@ fi # Check for --with-pydebug -{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5 -echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5 +$as_echo_n "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. if test "${with_pydebug+set}" = set; then @@ -4429,15 +5017,15 @@ #define Py_DEBUG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; }; + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; }; Py_DEBUG='true' -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; Py_DEBUG='false' +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; Py_DEBUG='false' fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4515,8 +5103,8 @@ # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. - { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 -echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then @@ -4536,36 +5124,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_no_strict_aliasing_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_no_strict_aliasing_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 -echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 +$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } if test $ac_cv_no_strict_aliasing_ok = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -4604,8 +5195,8 @@ ARCH_RUN_32BIT="arch -i386 -ppc" else - { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 -echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 +$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} { (exit 1); exit 1; }; } fi @@ -4679,10 +5270,10 @@ ac_cv_opt_olimit_ok=no fi -{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 -echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 +$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; } if test "${ac_cv_opt_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -OPT:Olimit=0" @@ -4703,29 +5294,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_opt_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_opt_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4733,8 +5327,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 +$as_echo "$ac_cv_opt_olimit_ok" >&6; } if test $ac_cv_opt_olimit_ok = yes; then case $ac_sys_system in # XXX is this branch needed? On MacOSX 10.2.2 the result of the @@ -4747,10 +5341,10 @@ ;; esac else - { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 -echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 +$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; } if test "${ac_cv_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Olimit 1500" @@ -4771,29 +5365,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4801,8 +5398,8 @@ CC="$ac_save_cc" fi - { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_olimit_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 +$as_echo "$ac_cv_olimit_ok" >&6; } if test $ac_cv_olimit_ok = yes; then BASECFLAGS="$BASECFLAGS -Olimit 1500" fi @@ -4811,8 +5408,8 @@ # Check whether GCC supports PyArg_ParseTuple format if test "$GCC" = "yes" then - { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 -echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -4838,13 +5435,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4854,14 +5452,14 @@ #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4874,10 +5472,10 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 -echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 +$as_echo_n "checking whether pthreads are available without options... " >&6; } if test "${ac_cv_pthread_is_default+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_is_default=no @@ -4908,19 +5506,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_is_default=yes @@ -4928,13 +5528,14 @@ ac_cv_pthread=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_is_default=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4942,8 +5543,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 -echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 +$as_echo "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -4955,10 +5556,10 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 +$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } if test "${ac_cv_kpthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kpthread" @@ -4991,29 +5592,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kpthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kpthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5021,8 +5625,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 -echo "${ECHO_T}$ac_cv_kpthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 +$as_echo "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -5032,10 +5636,10 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 +$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } if test "${ac_cv_kthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kthread" @@ -5068,29 +5672,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5098,8 +5705,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 -echo "${ECHO_T}$ac_cv_kthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 +$as_echo "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -5109,10 +5716,10 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 -echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 +$as_echo_n "checking whether $CC accepts -pthread... " >&6; } if test "${ac_cv_thread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -pthread" @@ -5145,29 +5752,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5175,8 +5785,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 -echo "${ECHO_T}$ac_cv_pthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 +$as_echo "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -5184,8 +5794,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 -echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 +$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -5215,17 +5825,17 @@ fi rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 -echo "${ECHO_T}$ac_cv_cxx_thread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 +$as_echo "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5252,20 +5862,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -5357,37 +5968,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -5396,75 +6010,6 @@ fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - @@ -5532,20 +6077,21 @@ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5561,32 +6107,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5600,51 +6147,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -5653,21 +6201,24 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5681,11 +6232,11 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5711,20 +6262,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -5732,12 +6284,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5746,10 +6301,10 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5787,26 +6342,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5821,8 +6380,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5830,10 +6389,10 @@ fi else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5871,26 +6430,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5905,8 +6468,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5915,10 +6478,10 @@ fi -{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 -echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5941,46 +6504,50 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_header_sys_types_h_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +$as_echo_n "checking sys/mkdev.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5996,32 +6563,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +$as_echo_n "checking sys/mkdev.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6035,51 +6603,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -6088,18 +6657,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } fi -if test $ac_cv_header_sys_mkdev_h = yes; then +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 @@ -6111,17 +6680,17 @@ if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +$as_echo_n "checking sys/sysmacros.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6137,32 +6706,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +$as_echo_n "checking sys/sysmacros.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6176,51 +6746,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -6229,18 +6800,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } fi -if test $ac_cv_header_sys_sysmacros_h = yes; then +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 @@ -6257,11 +6828,11 @@ for ac_header in term.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6283,20 +6854,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6304,12 +6876,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6321,11 +6896,11 @@ for ac_header in linux/netlink.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6350,20 +6925,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6371,12 +6947,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6386,8 +6965,8 @@ # checks for typedefs was_it_defined=no -{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 -echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 +$as_echo_n "checking for clock_t in time.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6411,12 +6990,12 @@ fi rm -f conftest* -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } # Check whether using makedev requires defining _OSF_SOURCE -{ echo "$as_me:$LINENO: checking for makedev" >&5 -echo $ECHO_N "checking for makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for makedev" >&5 +$as_echo_n "checking for makedev... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6438,26 +7017,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "no"; then @@ -6486,26 +7069,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "yes"; then @@ -6516,8 +7103,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 -echo "${ECHO_T}$ac_cv_has_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 +$as_echo "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -6534,8 +7121,8 @@ # work-around, disable LFS on such configurations use_lfs=yes -{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 -echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 +$as_echo_n "checking Solaris LFS bug... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6561,28 +7148,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sol_lfs_bug=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sol_lfs_bug=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 -echo "${ECHO_T}$sol_lfs_bug" >&6; } +{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 +$as_echo "$sol_lfs_bug" >&6; } if test "$sol_lfs_bug" = "yes"; then use_lfs=no fi @@ -6610,26 +7198,58 @@ EOF # Type availability checks -{ echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 +$as_echo_n "checking for mode_t... " >&6; } if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_mode_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef mode_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (mode_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((mode_t))) + return 0; ; return 0; } @@ -6640,30 +7260,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mode_t=no + ac_cv_type_mode_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } -if test $ac_cv_type_mode_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +$as_echo "$ac_cv_type_mode_t" >&6; } +if test "x$ac_cv_type_mode_t" = x""yes; then : else @@ -6673,26 +7302,58 @@ fi -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -6703,30 +7364,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then + +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 : else @@ -6736,26 +7406,58 @@ fi -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -6766,30 +7468,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + ac_cv_type_pid_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -6799,10 +7510,10 @@ fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6827,20 +7538,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -6848,19 +7560,54 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6868,14 +7615,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -6886,30 +7630,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then + +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 : else @@ -6919,10 +7672,10 @@ fi -{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6942,8 +7695,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -6957,26 +7710,24 @@ fi -{ echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_ssize_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef ssize_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (ssize_t)) + return 0; ; return 0; } @@ -6987,45 +7738,18 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_ssize_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } -if test $ac_cv_type_ssize_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SSIZE_T 1 -_ACEOF - -fi - - -# Sizes of various common basic types -# ANSI C requires sizeof(char) == 1, so no need to check it -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7033,14 +7757,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((ssize_t))) + return 0; ; return 0; } @@ -7051,38 +7772,57 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no + ac_cv_type_ssize_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +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. -{ echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7093,11 +7833,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; test_array [0] = 0 ; @@ -7110,13 +7849,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7130,11 +7870,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7147,20 +7886,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7174,7 +7914,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7184,11 +7924,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; test_array [0] = 0 ; @@ -7201,13 +7940,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7221,11 +7961,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7238,20 +7977,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7265,7 +8005,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7285,11 +8025,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7302,20 +8041,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7326,11 +8066,13 @@ case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi ;; @@ -7343,9 +8085,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (int)); } +static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int @@ -7355,20 +8096,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7381,43 +8124,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } @@ -7426,68 +8174,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7498,11 +8192,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -7515,13 +8208,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7535,11 +8229,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7552,20 +8245,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7579,7 +8273,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7589,11 +8283,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -7606,13 +8299,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7626,11 +8320,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7643,20 +8336,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7670,7 +8364,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7690,11 +8384,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7707,20 +8400,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7731,11 +8425,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -7748,9 +8444,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -7760,20 +8455,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7786,43 +8483,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -7831,68 +8533,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7903,11 +8551,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -7920,13 +8567,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7940,11 +8588,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7957,20 +8604,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7984,7 +8632,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7994,11 +8642,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -8011,13 +8658,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8031,11 +8679,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8048,20 +8695,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8075,7 +8723,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8095,11 +8743,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8112,20 +8759,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8136,11 +8784,13 @@ case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -8153,9 +8803,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -8165,20 +8814,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8191,43 +8842,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -8236,68 +8892,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6; } -if test "${ac_cv_type_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef short ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_short=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_short=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8308,11 +8910,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; test_array [0] = 0 ; @@ -8325,13 +8926,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8345,11 +8947,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8362,20 +8963,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8389,7 +8991,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8399,11 +9001,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; test_array [0] = 0 ; @@ -8416,13 +9017,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8436,11 +9038,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8453,20 +9054,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8480,7 +9082,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8500,11 +9102,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8517,20 +9118,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8541,11 +9143,13 @@ case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi ;; @@ -8558,9 +9162,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (short)); } +static unsigned long int ulongval () { return (long int) (sizeof (short)); } #include #include int @@ -8570,20 +9173,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (short))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8596,43 +9201,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } @@ -8641,68 +9251,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for float" >&5 -echo $ECHO_N "checking for float... $ECHO_C" >&6; } -if test "${ac_cv_type_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef float ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_float=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_float=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 -echo "${ECHO_T}$ac_cv_type_float" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of float" >&5 -echo $ECHO_N "checking size of float... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } if test "${ac_cv_sizeof_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8713,11 +9269,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; test_array [0] = 0 ; @@ -8730,13 +9285,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8750,11 +9306,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8767,20 +9322,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8794,7 +9350,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8804,11 +9360,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; test_array [0] = 0 ; @@ -8821,13 +9376,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8841,11 +9397,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8858,20 +9413,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8885,7 +9441,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8905,11 +9461,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8922,20 +9477,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8946,11 +9502,13 @@ case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi ;; @@ -8963,9 +9521,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (float)); } +static unsigned long int ulongval () { return (long int) (sizeof (float)); } #include #include int @@ -8975,20 +9532,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (float))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9001,113 +9560,64 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF - - -{ echo "$as_me:$LINENO: checking for double" >&5 -echo $ECHO_N "checking for double... $ECHO_C" >&6; } -if test "${ac_cv_type_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_double=no -fi +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 -echo "${ECHO_T}$ac_cv_type_double" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of double" >&5 -echo $ECHO_N "checking size of double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } if test "${ac_cv_sizeof_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9118,11 +9628,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; test_array [0] = 0 ; @@ -9135,13 +9644,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9155,11 +9665,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9172,20 +9681,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9199,7 +9709,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9209,11 +9719,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; test_array [0] = 0 ; @@ -9226,13 +9735,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9246,11 +9756,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9263,20 +9772,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9290,7 +9800,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9310,11 +9820,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9327,20 +9836,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9351,11 +9861,13 @@ case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi ;; @@ -9368,9 +9880,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (double)); } +static unsigned long int ulongval () { return (long int) (sizeof (double)); } #include #include int @@ -9380,20 +9891,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9406,43 +9919,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } @@ -9451,68 +9969,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for fpos_t" >&5 -echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } -if test "${ac_cv_type_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef fpos_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_fpos_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_fpos_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of fpos_t" >&5 -echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 +$as_echo_n "checking size of fpos_t... " >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9523,11 +9987,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; test_array [0] = 0 ; @@ -9540,13 +10003,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9560,11 +10024,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9577,20 +10040,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9604,7 +10068,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9614,11 +10078,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; test_array [0] = 0 ; @@ -9631,13 +10094,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9651,11 +10115,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9668,20 +10131,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9695,7 +10159,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9715,11 +10179,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9732,20 +10195,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9756,11 +10220,13 @@ case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi ;; @@ -9773,9 +10239,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (fpos_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } #include #include int @@ -9785,20 +10250,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (fpos_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9811,43 +10278,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +$as_echo "$ac_cv_sizeof_fpos_t" >&6; } @@ -9856,68 +10328,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9928,11 +10346,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; @@ -9945,13 +10362,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9965,11 +10383,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9982,20 +10399,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10009,7 +10427,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10019,11 +10437,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; @@ -10036,13 +10453,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10056,11 +10474,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10073,20 +10490,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10100,7 +10518,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10120,11 +10538,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10137,20 +10554,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10161,11 +10579,13 @@ case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -10178,9 +10598,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (size_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int @@ -10190,20 +10609,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10216,43 +10637,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } @@ -10261,68 +10687,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of pid_t" >&5 -echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5 +$as_echo_n "checking size of pid_t... " >&6; } if test "${ac_cv_sizeof_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10333,11 +10705,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)]; test_array [0] = 0 ; @@ -10350,13 +10721,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10370,11 +10742,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10387,20 +10758,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10414,7 +10786,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10424,11 +10796,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)]; test_array [0] = 0 ; @@ -10441,13 +10812,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10461,11 +10833,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10478,20 +10849,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10505,7 +10877,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10525,11 +10897,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10542,20 +10913,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10566,11 +10938,13 @@ case $ac_lo in ?*) ac_cv_sizeof_pid_t=$ac_lo;; '') if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi ;; @@ -10583,9 +10957,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (pid_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); } #include #include int @@ -10595,20 +10968,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (pid_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10621,43 +10996,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pid_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +$as_echo "$ac_cv_sizeof_pid_t" >&6; } @@ -10667,8 +11047,8 @@ -{ echo "$as_me:$LINENO: checking for long long support" >&5 -echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long long support" >&5 +$as_echo_n "checking for long long support... " >&6; } have_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10691,13 +11071,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10711,78 +11092,24 @@ have_long_long=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_long" >&5 -echo "${ECHO_T}$have_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5 +$as_echo "$have_long_long" >&6; } if test "$have_long_long" = yes ; then -{ echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10793,11 +11120,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; test_array [0] = 0 ; @@ -10810,13 +11136,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10830,11 +11157,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10847,20 +11173,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10874,7 +11201,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10884,11 +11211,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; test_array [0] = 0 ; @@ -10901,13 +11227,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10921,11 +11248,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10938,20 +11264,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10965,7 +11292,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10985,11 +11312,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11002,20 +11328,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11026,11 +11353,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi ;; @@ -11043,9 +11372,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long long)); } #include #include int @@ -11055,20 +11383,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11081,43 +11411,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } @@ -11128,8 +11463,8 @@ fi -{ echo "$as_me:$LINENO: checking for long double support" >&5 -echo $ECHO_N "checking for long double support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long double support" >&5 +$as_echo_n "checking for long double support... " >&6; } have_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11152,13 +11487,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11172,78 +11508,24 @@ have_long_double=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_double" >&5 -echo "${ECHO_T}$have_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5 +$as_echo "$have_long_double" >&6; } if test "$have_long_double" = yes ; then -{ echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; } -if test "${ac_cv_type_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_double=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 -echo "${ECHO_T}$ac_cv_type_long_double" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long double" >&5 -echo $ECHO_N "checking size of long double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11254,11 +11536,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; @@ -11271,13 +11552,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11291,11 +11573,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11308,20 +11589,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11335,7 +11617,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11345,11 +11627,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; test_array [0] = 0 ; @@ -11362,13 +11643,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11382,11 +11664,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11399,20 +11680,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11426,7 +11708,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11446,11 +11728,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11463,20 +11744,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11487,11 +11769,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi ;; @@ -11504,9 +11788,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long double)); } +static unsigned long int ulongval () { return (long int) (sizeof (long double)); } #include #include int @@ -11516,20 +11799,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11542,43 +11827,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } @@ -11590,8 +11880,8 @@ fi -{ echo "$as_me:$LINENO: checking for _Bool support" >&5 -echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5 +$as_echo_n "checking for _Bool support... " >&6; } have_c99_bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11614,98 +11904,45 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_C99_BOOL 1 -_ACEOF - - have_c99_bool=yes - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5 -echo "${ECHO_T}$have_c99_bool" >&6; } -if test "$have_c99_bool" = yes ; then -{ echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; -int -main () -{ -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_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_C99_BOOL 1 +_ACEOF + + have_c99_bool=yes + else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5 +$as_echo "$have_c99_bool" >&6; } +if test "$have_c99_bool" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of _Bool" >&5 -echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5 +$as_echo_n "checking size of _Bool... " >&6; } if test "${ac_cv_sizeof__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11716,11 +11953,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)]; test_array [0] = 0 ; @@ -11733,13 +11969,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11753,11 +11990,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11770,20 +12006,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11797,7 +12034,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11807,11 +12044,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)]; test_array [0] = 0 ; @@ -11824,13 +12060,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11844,11 +12081,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11861,20 +12097,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11888,7 +12125,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11908,11 +12145,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11925,20 +12161,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11949,11 +12186,13 @@ case $ac_lo in ?*) ac_cv_sizeof__Bool=$ac_lo;; '') if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi ;; @@ -11966,9 +12205,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (_Bool)); } +static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); } #include #include int @@ -11978,20 +12216,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (_Bool))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12004,43 +12244,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof__Bool=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 -echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 +$as_echo "$ac_cv_sizeof__Bool" >&6; } @@ -12051,12 +12296,13 @@ fi -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 +$as_echo_n "checking for uintptr_t... " >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_uintptr_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12066,14 +12312,11 @@ #include #endif -typedef uintptr_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (uintptr_t)) + return 0; ; return 0; } @@ -12084,55 +12327,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } -if test $ac_cv_type_uintptr_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF - -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef uintptr_t ac__type_new_; +#ifdef HAVE_STDINT_H + #include + #endif + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((uintptr_t))) + return 0; ; return 0; } @@ -12143,38 +12364,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_uintptr_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uintptr_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +$as_echo "$ac_cv_type_uintptr_t" >&6; } +if test "x$ac_cv_type_uintptr_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5 -echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +$as_echo_n "checking size of uintptr_t... " >&6; } if test "${ac_cv_sizeof_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12185,11 +12420,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)]; test_array [0] = 0 ; @@ -12202,13 +12436,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12222,11 +12457,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12239,20 +12473,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12266,7 +12501,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12276,11 +12511,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)]; test_array [0] = 0 ; @@ -12293,13 +12527,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12313,11 +12548,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12330,20 +12564,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12357,7 +12592,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12377,11 +12612,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12394,20 +12628,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12418,11 +12653,13 @@ case $ac_lo in ?*) ac_cv_sizeof_uintptr_t=$ac_lo;; '') if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi ;; @@ -12435,9 +12672,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (uintptr_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); } #include #include int @@ -12447,20 +12683,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (uintptr_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12473,43 +12711,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uintptr_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } @@ -12523,10 +12766,10 @@ # Hmph. AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_off_t=4 @@ -12553,29 +12796,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_off_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12583,16 +12829,16 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5 -echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -12601,18 +12847,18 @@ #define HAVE_LARGEFILE_SUPPORT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_time_t=4 @@ -12639,29 +12885,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_time_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12669,8 +12918,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t @@ -12687,8 +12936,8 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ echo "$as_me:$LINENO: checking for pthread_t" >&5 -echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5 +$as_echo_n "checking for pthread_t... " >&6; } have_pthread_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12711,34 +12960,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_pthread_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5 -echo "${ECHO_T}$have_pthread_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5 +$as_echo "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # AC_CHECK_SIZEOF() doesn't include . - { echo "$as_me:$LINENO: checking size of pthread_t" >&5 -echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } if test "${ac_cv_sizeof_pthread_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_pthread_t=4 @@ -12765,29 +13015,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pthread_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_pthread_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12795,8 +13048,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t @@ -12841,8 +13094,8 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ echo "$as_me:$LINENO: checking for --enable-framework" >&5 -echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5 +$as_echo_n "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" @@ -12853,15 +13106,15 @@ #define WITH_NEXT_FRAMEWORK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for dyld" >&5 -echo $ECHO_N "checking for dyld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dyld" >&5 +$as_echo_n "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -12869,12 +13122,12 @@ #define WITH_DYLD 1 _ACEOF - { echo "$as_me:$LINENO: result: always on for Darwin" >&5 -echo "${ECHO_T}always on for Darwin" >&6; } + { $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5 +$as_echo "always on for Darwin" >&6; } ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac @@ -12886,8 +13139,8 @@ # SO is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ echo "$as_me:$LINENO: checking SO" >&5 -echo $ECHO_N "checking SO... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SO" >&5 +$as_echo_n "checking SO... " >&6; } if test -z "$SO" then case $ac_sys_system in @@ -12912,8 +13165,9 @@ echo '=====================================================================' sleep 10 fi -{ echo "$as_me:$LINENO: result: $SO" >&5 -echo "${ECHO_T}$SO" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SO" >&5 +$as_echo "$SO" >&6; } + cat >>confdefs.h <<_ACEOF #define SHLIB_EXT "$SO" @@ -12923,8 +13177,8 @@ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ echo "$as_me:$LINENO: checking LDSHARED" >&5 -echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13026,13 +13280,13 @@ *) LDSHARED="ld";; esac fi -{ echo "$as_me:$LINENO: result: $LDSHARED" >&5 -echo "${ECHO_T}$LDSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking CCSHARED" >&5 -echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13067,12 +13321,12 @@ atheos*) CCSHARED="-fPIC";; esac fi -{ echo "$as_me:$LINENO: result: $CCSHARED" >&5 -echo "${ECHO_T}$CCSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 -echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13127,13 +13381,13 @@ LINKFORSHARED='-Wl,-E -N 2048K';; esac fi -{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 -echo "${ECHO_T}$LINKFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } -{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 -echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 +$as_echo_n "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -13145,8 +13399,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 -echo "${ECHO_T}$CFLAGSFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 +$as_echo "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -13157,22 +13411,22 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ echo "$as_me:$LINENO: checking SHLIBS" >&5 -echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5 +$as_echo_n "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ echo "$as_me:$LINENO: result: $SHLIBS" >&5 -echo "${ECHO_T}$SHLIBS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5 +$as_echo "$SHLIBS" >&6; } # checks for libraries -{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13204,33 +13458,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -13240,10 +13498,10 @@ fi # Dynamic linking for SunOS/Solaris and SYSV -{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13275,33 +13533,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF @@ -13311,12 +13573,12 @@ fi # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then - { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 -echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } if test "${ac_cv_search_sem_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -13354,26 +13616,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_sem_init=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sem_init+set}" = set; then @@ -13388,8 +13654,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 -echo "${ECHO_T}$ac_cv_search_sem_init" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -13401,10 +13667,10 @@ fi # check if we need libintl for locale functions -{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 -echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 +$as_echo_n "checking for textdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_textdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -13436,33 +13702,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_textdomain=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_textdomain=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; } -if test $ac_cv_lib_intl_textdomain = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 +$as_echo "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_LIBINTL 1 @@ -13473,8 +13743,8 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 -echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; } + AIX*) { $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 +$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13496,43 +13766,47 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define AIX_GENUINE_CPLUSPLUS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext;; *) ;; esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 -echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_t_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -13564,40 +13838,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_t_open=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_open=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; } -if test $ac_cv_lib_nsl_t_open = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = x""yes; then LIBS="-lnsl $LIBS" fi # SVR4 -{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" @@ -13629,56 +13907,60 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_socket=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } -if test $ac_cv_lib_socket_socket = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = x""yes; then LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ echo "$as_me:$LINENO: checking for --with-libs" >&5 -echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5 +$as_echo_n "checking for --with-libs... " >&6; } # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LIBS="$withval $LIBS" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for use of the system libffi library -{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 -echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 +$as_echo_n "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. if test "${with_system_ffi+set}" = set; then @@ -13686,14 +13968,14 @@ fi -{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5 -echo "${ECHO_T}$with_system_ffi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5 +$as_echo "$with_system_ffi" >&6; } # Determine if signalmodule should be used. -{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5 -echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5 +$as_echo_n "checking for --with-signal-module... " >&6; } # Check whether --with-signal-module was given. if test "${with_signal_module+set}" = set; then @@ -13704,8 +13986,8 @@ if test -z "$with_signal_module" then with_signal_module="yes" fi -{ echo "$as_me:$LINENO: result: $with_signal_module" >&5 -echo "${ECHO_T}$with_signal_module" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5 +$as_echo "$with_signal_module" >&6; } if test "${with_signal_module}" = "yes"; then USE_SIGNAL_MODULE="" @@ -13719,22 +14001,22 @@ USE_THREAD_MODULE="" -{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 -echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 +$as_echo_n "checking for --with-dec-threads... " >&6; } # Check whether --with-dec-threads was given. if test "${with_dec_threads+set}" = set; then withval=$with_dec_threads; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LDLAST=-threads if test "${with_thread+set}" != set; then with_thread="$withval"; fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -13747,8 +14029,8 @@ -{ echo "$as_me:$LINENO: checking for --with-threads" >&5 -echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5 +$as_echo_n "checking for --with-threads... " >&6; } # Check whether --with-threads was given. if test "${with_threads+set}" = set; then @@ -13767,8 +14049,8 @@ if test -z "$with_threads" then with_threads="yes" fi -{ echo "$as_me:$LINENO: result: $with_threads" >&5 -echo "${ECHO_T}$with_threads" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5 +$as_echo "$with_threads" >&6; } if test "$with_threads" = "no" @@ -13834,8 +14116,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 -echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 +$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13857,25 +14139,25 @@ fi rm -f conftest* - { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 -echo "${ECHO_T}$unistd_defines_pthreads" >&6; } + { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 +$as_echo "$unistd_defines_pthreads" >&6; } cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "${ac_cv_header_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5 -echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5 +$as_echo_n "checking cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13891,32 +14173,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5 -echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5 +$as_echo_n "checking cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13930,51 +14213,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -13983,18 +14267,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } fi -if test $ac_cv_header_cthreads_h = yes; then +if test "x$ac_cv_header_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14013,17 +14297,17 @@ else if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 -echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 +$as_echo_n "checking mach/cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14039,32 +14323,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 -echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 +$as_echo_n "checking mach/cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14078,51 +14363,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -14131,18 +14417,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mach_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } fi -if test $ac_cv_header_mach_cthreads_h = yes; then +if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14159,13 +14445,13 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for --with-pth" >&5 -echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5 +$as_echo_n "checking for --with-pth... " >&6; } # Check whether --with-pth was given. if test "${with_pth+set}" = set; then - withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14178,16 +14464,16 @@ LIBS="-lpth $LIBS" THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14212,21 +14498,24 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14234,15 +14523,15 @@ posix_threads=yes THREADOBJ="Python/thread.o" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$_libs - { echo "$as_me:$LINENO: checking for pthread_detach" >&5 -echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5 +$as_echo_n "checking for pthread_detach... " >&6; } if test "${ac_cv_func_pthread_detach+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14295,32 +14584,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_pthread_detach=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pthread_detach=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 -echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; } -if test $ac_cv_func_pthread_detach = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 +$as_echo "$ac_cv_func_pthread_detach" >&6; } +if test "x$ac_cv_func_pthread_detach" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14330,17 +14623,17 @@ else if test "${ac_cv_header_atheos_threads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 -echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 +$as_echo_n "checking atheos/threads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14356,32 +14649,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 -echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 +$as_echo_n "checking atheos/threads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14395,51 +14689,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -14448,18 +14743,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_atheos_threads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } fi -if test $ac_cv_header_atheos_threads_h = yes; then +if test "x$ac_cv_header_atheos_threads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14472,10 +14767,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 +$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" @@ -14507,33 +14802,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthreads_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; } -if test $ac_cv_lib_pthreads_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14543,10 +14842,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 -echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +$as_echo_n "checking for pthread_create in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -14578,33 +14877,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_r_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } -if test $ac_cv_lib_c_r_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14614,10 +14917,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 +$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -14649,33 +14952,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread___pthread_create_system=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_create_system=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test $ac_cv_lib_pthread___pthread_create_system = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14685,10 +14992,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 -echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 +$as_echo_n "checking for pthread_create in -lcma... " >&6; } if test "${ac_cv_lib_cma_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" @@ -14720,33 +15027,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cma_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cma_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; } -if test $ac_cv_lib_cma_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 +$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14773,6 +15084,7 @@ fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -14784,10 +15096,10 @@ - { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 -echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 +$as_echo_n "checking for usconfig in -lmpc... " >&6; } if test "${ac_cv_lib_mpc_usconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" @@ -14819,33 +15131,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mpc_usconfig=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpc_usconfig=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 -echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; } -if test $ac_cv_lib_mpc_usconfig = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 +$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14857,10 +15173,10 @@ if test "$posix_threads" != "yes"; then - { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 -echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 +$as_echo_n "checking for thr_create in -lthread... " >&6; } if test "${ac_cv_lib_thread_thr_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" @@ -14892,33 +15208,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_thread_thr_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thread_thr_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 -echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; } -if test $ac_cv_lib_thread_thr_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 +$as_echo "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14971,10 +15291,10 @@ ;; esac - { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } if test "${ac_cv_pthread_system_supported+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_system_supported=no @@ -15004,29 +15324,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_system_supported=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_system_supported=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -15034,8 +15357,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 -echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 +$as_echo "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -15046,11 +15369,11 @@ for ac_func in pthread_sigmask do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15103,35 +15426,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF case $ac_sys_system in CYGWIN*) @@ -15151,18 +15481,18 @@ # Check for enable-ipv6 -{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 -echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 +$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; case "$enableval" in no) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no ;; - *) { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + *) { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF @@ -15173,8 +15503,8 @@ else if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no else @@ -15202,41 +15532,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 -echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 +$as_echo_n "checking if RFC2553 API is available... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15260,26 +15593,27 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi @@ -15301,8 +15635,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking ipv6 stack type" >&5 -echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5 +$as_echo_n "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -15458,8 +15792,8 @@ break fi done - { echo "$as_me:$LINENO: result: $ipv6type" >&5 -echo "${ECHO_T}$ipv6type" >&6; } + { $as_echo "$as_me:$LINENO: result: $ipv6type" >&5 +$as_echo "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -15478,8 +15812,8 @@ fi fi -{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 -echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15501,13 +15835,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -15517,22 +15852,22 @@ #define HAVE_OSX105_SDK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 -echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 +$as_echo_n "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. if test "${with_doc_strings+set}" = set; then @@ -15551,12 +15886,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 -echo "${ECHO_T}$with_doc_strings" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5 +$as_echo "$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-tsc" >&5 -echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5 +$as_echo_n "checking for --with-tsc... " >&6; } # Check whether --with-tsc was given. if test "${with_tsc+set}" = set; then @@ -15568,20 +15903,20 @@ #define WITH_TSC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 -echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 +$as_echo_n "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. if test "${with_pymalloc+set}" = set; then @@ -15600,12 +15935,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5 -echo "${ECHO_T}$with_pymalloc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5 +$as_echo "$with_pymalloc" >&6; } # Check for --with-wctype-functions -{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 -echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 +$as_echo_n "checking for --with-wctype-functions... " >&6; } # Check whether --with-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then @@ -15617,14 +15952,14 @@ #define WANT_WCTYPE_FUNCTIONS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -15637,11 +15972,11 @@ for ac_func in dlopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15694,35 +16029,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -15732,8 +16074,8 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 -echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 +$as_echo_n "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -15757,8 +16099,8 @@ ;; esac fi -{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 -echo "${ECHO_T}$DYNLOADFILE" >&6; } +{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 +$as_echo "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -15771,16 +16113,16 @@ # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 -echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 +$as_echo_n "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi -{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 -echo "${ECHO_T}MACHDEP_OBJS" >&6; } +{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 +$as_echo "MACHDEP_OBJS" >&6; } # checks for library functions @@ -15879,11 +16221,11 @@ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15936,35 +16278,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -15973,8 +16322,8 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ echo "$as_me:$LINENO: checking for chroot" >&5 -echo $ECHO_N "checking for chroot... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chroot" >&5 +$as_echo_n "checking for chroot... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15996,13 +16345,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16012,20 +16362,20 @@ #define HAVE_CHROOT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for link" >&5 -echo $ECHO_N "checking for link... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for link" >&5 +$as_echo_n "checking for link... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16047,13 +16397,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16063,20 +16414,20 @@ #define HAVE_LINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for symlink" >&5 -echo $ECHO_N "checking for symlink... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for symlink" >&5 +$as_echo_n "checking for symlink... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16098,13 +16449,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16114,20 +16466,20 @@ #define HAVE_SYMLINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fchdir" >&5 -echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5 +$as_echo_n "checking for fchdir... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16149,13 +16501,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16165,20 +16518,20 @@ #define HAVE_FCHDIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fsync" >&5 -echo $ECHO_N "checking for fsync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fsync" >&5 +$as_echo_n "checking for fsync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16200,13 +16553,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16216,20 +16570,20 @@ #define HAVE_FSYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fdatasync" >&5 -echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5 +$as_echo_n "checking for fdatasync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16251,13 +16605,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16267,20 +16622,20 @@ #define HAVE_FDATASYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for epoll" >&5 -echo $ECHO_N "checking for epoll... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for epoll" >&5 +$as_echo_n "checking for epoll... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16302,13 +16657,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16318,20 +16674,20 @@ #define HAVE_EPOLL 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for kqueue" >&5 -echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5 +$as_echo_n "checking for kqueue... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16356,13 +16712,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16372,14 +16729,14 @@ #define HAVE_KQUEUE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16390,8 +16747,8 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ echo "$as_me:$LINENO: checking for ctermid_r" >&5 -echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5 +$as_echo_n "checking for ctermid_r... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16416,13 +16773,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16432,21 +16790,21 @@ #define HAVE_CTERMID_R 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for flock" >&5 -echo $ECHO_N "checking for flock... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for flock" >&5 +$as_echo_n "checking for flock... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16471,13 +16829,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16487,21 +16846,21 @@ #define HAVE_FLOCK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for getpagesize" >&5 -echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16526,13 +16885,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16542,14 +16902,14 @@ #define HAVE_GETPAGESIZE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16559,10 +16919,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TRUE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. @@ -16575,7 +16935,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TRUE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16586,11 +16946,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { echo "$as_me:$LINENO: result: $TRUE" >&5 -echo "${ECHO_T}$TRUE" >&6; } + { $as_echo "$as_me:$LINENO: result: $TRUE" >&5 +$as_echo "$TRUE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16599,10 +16959,10 @@ test -n "$TRUE" || TRUE="/bin/true" -{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 -echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 +$as_echo_n "checking for inet_aton in -lc... " >&6; } if test "${ac_cv_lib_c_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" @@ -16634,40 +16994,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; } -if test $ac_cv_lib_c_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 +$as_echo "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = x""yes; then $ac_cv_prog_TRUE else -{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 -echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -16699,33 +17063,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_resolv_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; } -if test $ac_cv_lib_resolv_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -16740,14 +17108,16 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ echo "$as_me:$LINENO: checking for chflags" >&5 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chflags" >&5 +$as_echo_n "checking for chflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16772,50 +17142,55 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for lchflags" >&5 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5 +$as_echo_n "checking for lchflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16840,37 +17215,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -16885,10 +17263,10 @@ ;; esac -{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 -echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 +$as_echo_n "checking for inflateCopy in -lz... " >&6; } if test "${ac_cv_lib_z_inflateCopy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -16920,33 +17298,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_inflateCopy=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateCopy=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; } -if test $ac_cv_lib_z_inflateCopy = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 +$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_COPY 1 @@ -16962,8 +17344,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking for hstrerror" >&5 -echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5 +$as_echo_n "checking for hstrerror... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16988,39 +17370,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_HSTRERROR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_aton" >&5 -echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17048,39 +17434,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_pton" >&5 -echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5 +$as_echo_n "checking for inet_pton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17108,13 +17498,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17124,22 +17515,22 @@ #define HAVE_INET_PTON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ echo "$as_me:$LINENO: checking for setgroups" >&5 -echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5 +$as_echo_n "checking for setgroups... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17167,13 +17558,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17183,14 +17575,14 @@ #define HAVE_SETGROUPS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17201,11 +17593,11 @@ for ac_func in openpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17258,42 +17650,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 -echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +$as_echo_n "checking for openpty in -lutil... " >&6; } if test "${ac_cv_lib_util_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17325,42 +17724,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; } -if test $ac_cv_lib_util_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +$as_echo "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 -echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 +$as_echo_n "checking for openpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17392,33 +17795,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; } -if test $ac_cv_lib_bsd_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 +$as_echo "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF @@ -17435,11 +17842,11 @@ for ac_func in forkpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17492,42 +17899,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 -echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 +$as_echo_n "checking for forkpty in -lutil... " >&6; } if test "${ac_cv_lib_util_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17559,42 +17973,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; } -if test $ac_cv_lib_util_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 +$as_echo "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 -echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 +$as_echo_n "checking for forkpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17626,33 +18044,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; } -if test $ac_cv_lib_bsd_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 +$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -17671,11 +18093,11 @@ for ac_func in memmove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17728,35 +18150,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -17772,11 +18201,11 @@ for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17829,35 +18258,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -17869,11 +18305,11 @@ for ac_func in dup2 getcwd strdup do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17926,35 +18362,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -17971,11 +18414,11 @@ for ac_func in getpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18028,35 +18471,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18079,13 +18529,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18097,7 +18548,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18111,11 +18562,11 @@ for ac_func in setpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18168,35 +18619,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18219,13 +18677,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18237,7 +18696,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18251,11 +18710,11 @@ for ac_func in gettimeofday do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18308,35 +18767,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18359,20 +18825,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18389,8 +18856,8 @@ done -{ echo "$as_me:$LINENO: checking for major" >&5 -echo $ECHO_N "checking for major... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for major" >&5 +$as_echo_n "checking for major... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18422,44 +18889,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MACROS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18488,26 +18959,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 -echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 +$as_echo_n "checking getaddrinfo bug... " >&6; } if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } + { $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes else cat >conftest.$ac_ext <<_ACEOF @@ -18610,48 +19084,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: good" >&5 -echo "${ECHO_T}good" >&6; } + { $as_echo "$as_me:$LINENO: result: good" >&5 +$as_echo "good" >&6; } buggygetaddrinfo=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } +{ $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -18671,11 +19149,11 @@ for ac_func in getnameinfo do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18728,35 +19206,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18764,10 +19249,10 @@ # checks for structures -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18794,20 +19279,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -18815,8 +19301,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -18825,10 +19311,10 @@ fi -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18844,7 +19330,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -18855,20 +19341,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -18876,8 +19363,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -18886,10 +19373,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18917,20 +19404,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -18959,20 +19447,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -18983,9 +19472,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -19001,10 +19490,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19031,20 +19520,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -19052,9 +19542,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -19070,10 +19560,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19100,31 +19590,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -19134,10 +19628,10 @@ fi fi -{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +$as_echo_n "checking for struct stat.st_rdev... " >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19162,20 +19656,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19201,20 +19696,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no @@ -19225,9 +19721,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } -if test $ac_cv_member_struct_stat_st_rdev = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } +if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 @@ -19236,10 +19732,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +$as_echo_n "checking for struct stat.st_blksize... " >&6; } if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19264,20 +19760,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19303,20 +19800,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no @@ -19327,9 +19825,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } -if test $ac_cv_member_struct_stat_st_blksize = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; } +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -19338,10 +19836,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 -echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 +$as_echo_n "checking for struct stat.st_flags... " >&6; } if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19366,20 +19864,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19405,20 +19904,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_flags=no @@ -19429,9 +19929,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; } -if test $ac_cv_member_struct_stat_st_flags = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 +$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; } +if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 @@ -19440,10 +19940,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 -echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 +$as_echo_n "checking for struct stat.st_gen... " >&6; } if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19468,20 +19968,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19507,20 +20008,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_gen=no @@ -19531,9 +20033,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; } -if test $ac_cv_member_struct_stat_st_gen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 +$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; } +if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 @@ -19542,10 +20044,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 -echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 +$as_echo_n "checking for struct stat.st_birthtime... " >&6; } if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19570,20 +20072,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19609,20 +20112,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_birthtime=no @@ -19633,9 +20137,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; } -if test $ac_cv_member_struct_stat_st_birthtime = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; } +if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -19644,10 +20148,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +$as_echo_n "checking for struct stat.st_blocks... " >&6; } if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19672,20 +20176,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19711,20 +20216,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no @@ -19735,9 +20241,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } -if test $ac_cv_member_struct_stat_st_blocks = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -19759,10 +20265,10 @@ -{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 -echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 +$as_echo_n "checking for time.h that defines altzone... " >&6; } if test "${ac_cv_header_time_altzone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19785,20 +20291,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time_altzone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_altzone=no @@ -19807,8 +20314,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 -echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 +$as_echo "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then cat >>confdefs.h <<\_ACEOF @@ -19818,8 +20325,8 @@ fi was_it_defined=no -{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19845,13 +20352,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -19865,20 +20373,20 @@ was_it_defined=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ echo "$as_me:$LINENO: checking for addrinfo" >&5 -echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5 +$as_echo_n "checking for addrinfo... " >&6; } if test "${ac_cv_struct_addrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19902,20 +20410,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_addrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_addrinfo=no @@ -19924,8 +20433,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 +$as_echo "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then cat >>confdefs.h <<\_ACEOF @@ -19934,10 +20443,10 @@ fi -{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 -echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 +$as_echo_n "checking for sockaddr_storage... " >&6; } if test "${ac_cv_struct_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19962,20 +20471,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_sockaddr_storage=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no @@ -19984,8 +20494,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then cat >>confdefs.h <<\_ACEOF @@ -19997,10 +20507,10 @@ # checks for compiler characteristics -{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20025,20 +20535,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes @@ -20046,8 +20557,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 @@ -20055,10 +20566,10 @@ fi -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20130,20 +20641,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -20151,20 +20663,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const +#define const /**/ _ACEOF fi works=no -{ echo "$as_me:$LINENO: checking for working volatile" >&5 -echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20186,37 +20698,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define volatile +#define volatile /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } works=no -{ echo "$as_me:$LINENO: checking for working signed char" >&5 -echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5 +$as_echo_n "checking for working signed char... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20238,37 +20751,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define signed +#define signed /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } have_prototypes=no -{ echo "$as_me:$LINENO: checking for prototypes" >&5 -echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5 +$as_echo_n "checking for prototypes... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20290,13 +20804,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20310,19 +20825,19 @@ have_prototypes=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_prototypes" >&5 -echo "${ECHO_T}$have_prototypes" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5 +$as_echo "$have_prototypes" >&6; } works=no -{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 -echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 +$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20354,13 +20869,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20374,19 +20890,19 @@ works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } # check for socketpair -{ echo "$as_me:$LINENO: checking for socketpair" >&5 -echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5 +$as_echo_n "checking for socketpair... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20411,13 +20927,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20427,22 +20944,22 @@ #define HAVE_SOCKETPAIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 -echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 +$as_echo_n "checking if sockaddr has sa_len member... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20466,37 +20983,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext va_list_is_array=no -{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5 -echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5 +$as_echo_n "checking whether va_list is an array... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20524,20 +21042,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -20551,17 +21070,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5 -echo "${ECHO_T}$va_list_is_array" >&6; } +{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5 +$as_echo "$va_list_is_array" >&6; } # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( -{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 -echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 +$as_echo_n "checking for gethostbyname_r... " >&6; } if test "${ac_cv_func_gethostbyname_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20614,39 +21133,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname_r=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; } -if test $ac_cv_func_gethostbyname_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 +$as_echo "$ac_cv_func_gethostbyname_r" >&6; } +if test "x$ac_cv_func_gethostbyname_r" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF - { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 +$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat >conftest.$ac_ext <<_ACEOF @@ -20680,13 +21203,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20701,18 +21225,18 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 +$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20744,13 +21268,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20765,18 +21290,18 @@ #define HAVE_GETHOSTBYNAME_R_5_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 +$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20806,13 +21331,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20827,16 +21353,16 @@ #define HAVE_GETHOSTBYNAME_R_3_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -20856,11 +21382,11 @@ for ac_func in gethostbyname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20913,35 +21439,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -20960,10 +21493,10 @@ # (none yet) # Linux requires this for correct f.p. operations -{ echo "$as_me:$LINENO: checking for __fpu_control" >&5 -echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5 +$as_echo_n "checking for __fpu_control... " >&6; } if test "${ac_cv_func___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21016,39 +21549,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; } -if test $ac_cv_func___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 +$as_echo "$ac_cv_func___fpu_control" >&6; } +if test "x$ac_cv_func___fpu_control" = x""yes; then : else -{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 -echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 +$as_echo_n "checking for __fpu_control in -lieee... " >&6; } if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" @@ -21080,33 +21617,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ieee___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; } -if test $ac_cv_lib_ieee___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 +$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF @@ -21120,8 +21661,8 @@ # Check for --with-fpectl -{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5 -echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5 +$as_echo_n "checking for --with-fpectl... " >&6; } # Check whether --with-fpectl was given. if test "${with_fpectl+set}" = set; then @@ -21133,14 +21674,14 @@ #define WANT_SIGFPE_HANDLER 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21150,53 +21691,53 @@ Darwin) ;; *) LIBM=-lm esac -{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 -echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 +$as_echo_n "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. if test "${with_libm+set}" = set; then withval=$with_libm; if test "$withval" = no then LIBM= - { echo "$as_me:$LINENO: result: force LIBM empty" >&5 -echo "${ECHO_T}force LIBM empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5 +$as_echo "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 -echo "${ECHO_T}set LIBM=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 -echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 +$as_echo "set LIBM=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 -echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 +$as_echo "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 -echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 +$as_echo_n "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. if test "${with_libc+set}" = set; then withval=$with_libc; if test "$withval" = no then LIBC= - { echo "$as_me:$LINENO: result: force LIBC empty" >&5 -echo "${ECHO_T}force LIBC empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5 +$as_echo "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 -echo "${ECHO_T}set LIBC=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 -echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 +$as_echo "set LIBC=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 -echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 +$as_echo "default LIBC=\"$LIBC\"" >&6; } fi @@ -21207,12 +21748,103 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +$as_echo_n "checking for x87-style double rounding... " >&6; } +if test "${ac_cv_x87_double_rounding+set}" = set; then + $as_echo_n "(cached) " >&6 +else + +if test "$cross_compiling" = yes; then + ac_cv_x87_double_rounding=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval 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 + 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 +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; } +if test "$ac_cv_x87_double_rounding" = yes +then + +cat >>confdefs.h <<\_ACEOF +#define X87_DOUBLE_ROUNDING 1 +_ACEOF + +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. -{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 -echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 +$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; } if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21243,37 +21875,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_tanh_preserves_zero_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_tanh_preserves_zero_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 -echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 +$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; } if test "$ac_cv_tanh_preserves_zero_sign" = yes then @@ -21284,13 +21919,20 @@ fi -for ac_func in hypot + + + + + + + +for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21343,65 +21985,187 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$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 + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_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; } +if test "${ac_cv_have_decl_isinf+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 + +int +main () +{ +#ifndef isinf + (void) isinf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + 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_have_decl_isinf=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isinf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +$as_echo "$ac_cv_have_decl_isinf" >&6; } +if test "x$ac_cv_have_decl_isinf" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +$as_echo_n "checking whether isnan is declared... " >&6; } +if test "${ac_cv_have_decl_isnan+set}" = set; then + $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 + +int +main () +{ +#ifndef isnan + (void) isnan; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isnan=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + ac_cv_have_decl_isnan=no fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -done - - - - - - - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +$as_echo "$ac_cv_have_decl_isnan" >&6; } +if test "x$ac_cv_have_decl_isnan" = x""yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 1 +_ACEOF +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 0 +_ACEOF -for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +$as_echo_n "checking whether isfinite is declared... " >&6; } +if test "${ac_cv_have_decl_isfinite+set}" = set; then + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21409,101 +22173,81 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +#include int main () { -return $ac_func (); +#ifndef isfinite + (void) isfinite; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isfinite=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_have_decl_isfinite=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +$as_echo "$ac_cv_have_decl_isfinite" >&6; } +if test "x$ac_cv_have_decl_isfinite" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 1 +_ACEOF + + +else cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_DECL_ISFINITE 0 _ACEOF + fi -done + LIBS=$LIBS_SAVE # check for wchar.h if test "${ac_cv_header_wchar_h+set}" = set; then - { echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking wchar.h usability" >&5 -echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5 +$as_echo_n "checking wchar.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21519,32 +22263,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking wchar.h presence" >&5 -echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5 +$as_echo_n "checking wchar.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21558,51 +22303,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -21611,18 +22357,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } fi -if test $ac_cv_header_wchar_h = yes; then +if test "x$ac_cv_header_wchar_h" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -21641,69 +22387,14 @@ # determine wchar_t size if test "$wchar_h" = yes then - { echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } -if test "${ac_cv_type_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -typedef wchar_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_wchar_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; } - -# The cast to long int works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of wchar_t" >&5 -echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } if test "${ac_cv_sizeof_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -21715,11 +22406,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; test_array [0] = 0 ; @@ -21732,13 +22422,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21753,11 +22444,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -21770,20 +22460,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -21797,7 +22488,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -21808,11 +22499,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; test_array [0] = 0 ; @@ -21825,13 +22515,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21846,11 +22537,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -21863,20 +22553,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -21890,7 +22581,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -21911,11 +22602,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -21928,20 +22618,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -21952,11 +22643,13 @@ case $ac_lo in ?*) ac_cv_sizeof_wchar_t=$ac_lo;; '') if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi ;; @@ -21970,9 +22663,8 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (wchar_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } #include #include int @@ -21982,20 +22674,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (wchar_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -22008,43 +22702,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_wchar_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } @@ -22055,8 +22754,8 @@ fi -{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 -echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 +$as_echo_n "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22083,13 +22782,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22103,24 +22803,24 @@ have_ucs4_tcl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 -echo "${ECHO_T}$have_ucs4_tcl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 +$as_echo "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 -echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 +$as_echo_n "checking whether wchar_t is signed... " >&6; } if test "${ac_cv_wchar_t_signed+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22147,41 +22847,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_wchar_t_signed=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_wchar_t_signed=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 -echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 +$as_echo "$ac_cv_wchar_t_signed" >&6; } fi -{ echo "$as_me:$LINENO: checking what type to use for str" >&5 -echo $ECHO_N "checking what type to use for str... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking what type to use for str" >&5 +$as_echo_n "checking what type to use for str... " >&6; } # Check whether --with-wide-unicode was given. if test "${with_wide_unicode+set}" = set; then @@ -22227,53 +22930,199 @@ #define HAVE_USABLE_WCHAR_T 1 _ACEOF - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE wchar_t -_ACEOF + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE wchar_t +_ACEOF + +elif test "$ac_cv_sizeof_short" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned short" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned short +_ACEOF + +elif test "$ac_cv_sizeof_long" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned long" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned long +_ACEOF + +else + PY_UNICODE_TYPE="no type found" +fi +{ $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 +$as_echo "$PY_UNICODE_TYPE" >&6; } + +# check for endianness + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi -elif test "$ac_cv_sizeof_short" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned short" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned short -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -elif test "$ac_cv_sizeof_long" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned long" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned long -_ACEOF -else - PY_UNICODE_TYPE="no type found" fi -{ echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 -echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; } -# check for endianness -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -22285,33 +23134,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; @@ -22323,20 +23172,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -22344,29 +23194,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - _ascii (); _ebcdic (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } @@ -22377,30 +23242,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22419,14 +23285,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; @@ -22438,63 +23304,70 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 -echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 +$as_echo_n "checking whether right shift extends the sign bit... " >&6; } if test "${ac_cv_rshift_extends_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22519,37 +23392,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_rshift_extends_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_rshift_extends_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 -echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 +$as_echo "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -22560,10 +23436,10 @@ fi # check for getc_unlocked and related locking functions -{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 -echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 +$as_echo_n "checking for getc_unlocked() and friends... " >&6; } if test "${ac_cv_have_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22592,32 +23468,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_have_getc_unlocked=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_getc_unlocked=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 +$as_echo "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -22635,8 +23515,8 @@ # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. py_cv_lib_readline=no -{ echo "$as_me:$LINENO: checking how to link readline libs" >&5 -echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5 +$as_echo_n "checking how to link readline libs... " >&6; } for py_libtermcap in "" ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-lreadline" @@ -22672,26 +23552,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then py_cv_lib_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then @@ -22701,11 +23585,11 @@ # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 -echo "${ECHO_T}$READLINE_LIBS" >&6; } + { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 +$as_echo "$READLINE_LIBS" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 @@ -22714,10 +23598,10 @@ fi # check for readline 2.1 -{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 -echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 +$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -22749,33 +23633,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_callback_handler_install=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; } -if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 +$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } +if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_CALLBACK 1 @@ -22798,20 +23686,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -22842,10 +23731,10 @@ fi # check for readline 4.0 -{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 +$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -22877,33 +23766,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_pre_input_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_pre_input_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; } -if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_PRE_INPUT_HOOK 1 @@ -22913,10 +23806,10 @@ # also in 4.0 -{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 +$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -22948,33 +23841,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_display_matches_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_display_matches_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } -if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 @@ -22984,10 +23881,10 @@ # check for readline 4.2 -{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 +$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23019,33 +23916,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_matches=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_matches=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test $ac_cv_lib_readline_rl_completion_matches = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_MATCHES 1 @@ -23068,20 +23969,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23114,10 +24016,10 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ echo "$as_me:$LINENO: checking for broken nice()" >&5 -echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5 +$as_echo_n "checking for broken nice()... " >&6; } if test "${ac_cv_broken_nice+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23145,37 +24047,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_nice=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_nice=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 -echo "${ECHO_T}$ac_cv_broken_nice" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 +$as_echo "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -23185,8 +24090,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken poll()" >&5 -echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5 +$as_echo_n "checking for broken poll()... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_poll=no else @@ -23228,35 +24133,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_poll=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_poll=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 -echo "${ECHO_T}$ac_cv_broken_poll" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 +$as_echo "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -23269,10 +24177,10 @@ # Before we can test tzset, we need to check if struct tm has a tm_zone # (which is not required by ISO C or UNIX spec) and/or if we support # tzname[] -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23300,20 +24208,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -23342,20 +24251,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -23366,9 +24276,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -23384,10 +24294,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23414,20 +24324,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -23435,9 +24346,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -23453,10 +24364,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23483,31 +24394,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -23519,10 +24434,10 @@ # check tzset(3) exists and works like we expect it to -{ echo "$as_me:$LINENO: checking for working tzset()" >&5 -echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5 +$as_echo_n "checking for working tzset()... " >&6; } if test "${ac_cv_working_tzset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23605,37 +24520,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_tzset=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_working_tzset=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 -echo "${ECHO_T}$ac_cv_working_tzset" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 +$as_echo "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -23646,10 +24564,10 @@ fi # Look for subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 +$as_echo_n "checking for tv_nsec in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23675,20 +24593,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec=no @@ -23697,8 +24616,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 +$as_echo "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -23709,10 +24628,10 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 +$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23738,20 +24657,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec2=no @@ -23760,8 +24680,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 +$as_echo "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -23772,10 +24692,10 @@ fi # On HP/UX 11.0, mvwdelch is a block with a return statement -{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 -echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 +$as_echo_n "checking whether mvwdelch is an expression... " >&6; } if test "${ac_cv_mvwdelch_is_expression+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23801,20 +24721,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_mvwdelch_is_expression=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_mvwdelch_is_expression=no @@ -23823,8 +24744,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 -echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 +$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -23835,10 +24756,10 @@ fi -{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 -echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 +$as_echo_n "checking whether WINDOW has _flags... " >&6; } if test "${ac_cv_window_has_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23864,20 +24785,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_window_has_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_window_has_flags=no @@ -23886,8 +24808,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 -echo "${ECHO_T}$ac_cv_window_has_flags" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 +$as_echo "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes @@ -23899,8 +24821,8 @@ fi -{ echo "$as_me:$LINENO: checking for is_term_resized" >&5 -echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5 +$as_echo_n "checking for is_term_resized... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23922,13 +24844,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23938,21 +24861,21 @@ #define HAVE_CURSES_IS_TERM_RESIZED 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resize_term" >&5 -echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5 +$as_echo_n "checking for resize_term... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23974,13 +24897,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23990,21 +24914,21 @@ #define HAVE_CURSES_RESIZE_TERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resizeterm" >&5 -echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5 +$as_echo_n "checking for resizeterm... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24026,13 +24950,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24042,61 +24967,63 @@ #define HAVE_CURSES_RESIZETERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 -echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } if test -r /dev/ptmx then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5 -echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } if test -r /dev/ptc then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 +$as_echo_n "checking for %zd printf() format support... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24145,47 +25072,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PY_FORMAT_SIZE_T "z" _ACEOF else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -24200,14 +25131,53 @@ #endif -typedef socklen_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (socklen_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; ; return 0; } @@ -24218,30 +25188,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_socklen_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then : else @@ -24252,8 +25231,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 -echo $ECHO_N "checking for broken mbstowcs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 +$as_echo_n "checking for broken mbstowcs... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_mbstowcs=no else @@ -24279,35 +25258,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_mbstowcs=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_mbstowcs=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 -echo "${ECHO_T}$ac_cv_broken_mbstowcs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 +$as_echo "$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then @@ -24317,6 +25299,32 @@ 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; } + +# Check whether --with-computed-gotos was given. +if test "${with_computed_gotos+set}" = set; then + withval=$with_computed_gotos; +if test "$withval" != no +then + +cat >>confdefs.h <<\_ACEOF +#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; } +fi +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for h in `(cd $srcdir;echo Python/thread_*.h)` @@ -24326,15 +25334,15 @@ SRCDIRS="Parser Grammar Objects Python Modules Mac" -{ echo "$as_me:$LINENO: checking for build directories" >&5 -echo $ECHO_N "checking for build directories... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for build directories" >&5 +$as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6; } +{ $as_echo "$as_me:$LINENO: result: done" >&5 +$as_echo "done" >&6; } # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" @@ -24366,11 +25374,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -24403,12 +25412,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -24424,7 +25433,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -24436,12 +25445,14 @@ + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -24454,7 +25465,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24464,7 +25475,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -24486,17 +25497,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -24512,8 +25551,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -24536,7 +25573,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -24549,17 +25586,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -24581,7 +25611,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -24632,7 +25662,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -24660,7 +25690,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -24673,19 +25702,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -24710,10 +25742,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 @@ -24736,7 +25768,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -24749,29 +25781,39 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -24782,24 +25824,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ python config.status 3.1 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -24821,30 +25863,36 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -24863,30 +25911,32 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -24900,8 +25950,8 @@ "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -24941,222 +25991,145 @@ (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF +ac_cr=' +' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -VERSION!$VERSION$ac_delim -SOVERSION!$SOVERSION$ac_delim -CONFIG_ARGS!$CONFIG_ARGS$ac_delim -UNIVERSALSDK!$UNIVERSALSDK$ac_delim -ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim -PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim -PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim -PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim -PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim -PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim -FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim -FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim -FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim -FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim -FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim -MACHDEP!$MACHDEP$ac_delim -SGI_ABI!$SGI_ABI$ac_delim -CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim -EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CXX!$CXX$ac_delim -MAINCC!$MAINCC$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -BUILDEXEEXT!$BUILDEXEEXT$ac_delim -LIBRARY!$LIBRARY$ac_delim -LDLIBRARY!$LDLIBRARY$ac_delim -DLLLIBRARY!$DLLLIBRARY$ac_delim -BLDLIBRARY!$BLDLIBRARY$ac_delim -LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim -INSTSONAME!$INSTSONAME$ac_delim -RUNSHARED!$RUNSHARED$ac_delim -LINKCC!$LINKCC$ac_delim -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 + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + print line +} -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim -USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim -LDLAST!$LDLAST$ac_delim -THREADOBJ!$THREADOBJ$ac_delim -DLINCLDIR!$DLINCLDIR$ac_delim -DYNLOADFILE!$DYNLOADFILE$ac_delim -MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim -TRUE!$TRUE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim -HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim -HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim -LIBM!$LIBM$ac_delim -LIBC!$LIBC$ac_delim -THREADHEADERS!$THREADHEADERS$ac_delim -SRCDIRS!$SRCDIRS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACAWK _ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 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;} +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof _ACEOF - # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -25172,19 +26145,133 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -25213,26 +26300,38 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -25242,7 +26341,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -25268,7 +26367,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -25277,7 +26376,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -25298,17 +26397,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -25348,12 +26447,13 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -25362,13 +26462,14 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -25382,15 +26483,16 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -25400,119 +26502,58 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; @@ -25526,6 +26567,11 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -25547,6 +26593,10 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi echo "creating Modules/Setup" Modified: python/branches/py3k-issue1717/configure.in ============================================================================== --- python/branches/py3k-issue1717/configure.in (original) +++ python/branches/py3k-issue1717/configure.in Sun Jan 25 21:08:20 2009 @@ -387,7 +387,7 @@ AC_HELP_STRING(--without-gcc,never use gcc), [ case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -693,6 +693,12 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; + Darwin*) + LDLIBRARY='libpython$(VERSION).dylib' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + ;; + esac else # shared is disabled case $ac_sys_system in @@ -1527,6 +1533,7 @@ sleep 10 fi AC_MSG_RESULT($SO) + AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 @@ -3049,6 +3056,44 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +AC_MSG_CHECKING(for x87-style double rounding) +AC_CACHE_VAL(ac_cv_x87_double_rounding, [ +AC_TRY_RUN([ +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} +], +ac_cv_x87_double_rounding=no, +ac_cv_x87_double_rounding=yes, +ac_cv_x87_double_rounding=no)]) +AC_MSG_RESULT($ac_cv_x87_double_rounding) +if test "$ac_cv_x87_double_rounding" = yes +then + AC_DEFINE(X87_DOUBLE_ROUNDING, 1, + [Define if arithmetic is subject to x87-style double rounding issue]) +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. AC_MSG_CHECKING(whether tanh preserves the sign of zero) @@ -3075,9 +3120,8 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_REPLACE_FUNCS(hypot) - -AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p]) +AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE @@ -3616,6 +3660,22 @@ wide chars that would be converted.]) fi +# Check for --with-computed-gotos +AC_MSG_CHECKING(for --with-computed-gotos) +AC_ARG_WITH(computed-gotos, + AC_HELP_STRING(--with-computed-gotos, + Use computed gotos / threaded dispatch in evaluation loop (not available on all compilers)), +[ +if test "$withval" != no +then + AC_DEFINE(USE_COMPUTED_GOTOS, 1, + [Define if you want to use computed gotos in ceval.c.]) + AC_MSG_RESULT(yes) +else AC_MSG_RESULT(no) +fi], +[AC_MSG_RESULT(no)]) + + AC_SUBST(THREADHEADERS) for h in `(cd $srcdir;echo Python/thread_*.h)` Modified: python/branches/py3k-issue1717/pyconfig.h.in ============================================================================== --- python/branches/py3k-issue1717/pyconfig.h.in (original) +++ python/branches/py3k-issue1717/pyconfig.h.in Sun Jan 25 21:08:20 2009 @@ -5,6 +5,9 @@ #define Py_PYCONFIG_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -58,6 +61,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BLUETOOTH_H +/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide + chars that would be converted. */ +#undef HAVE_BROKEN_MBSTOWCS + /* Define if nice() returns success/failure instead of the new priority. */ #undef HAVE_BROKEN_NICE @@ -112,6 +119,18 @@ /* Define if you have the 'resize_term' function. */ #undef HAVE_CURSES_RESIZE_TERM +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#undef HAVE_DECL_ISNAN + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -312,12 +331,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -357,7 +370,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `readline' library (-lreadline). */ +/* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ @@ -800,10 +813,6 @@ /* Define to 1 if you have the `wcsxfrm' function. */ #undef HAVE_WCSXFRM -/* Define if mbstowcs(NULL, "text", 0) does not return the number of - wide chars that would be converted */ -#undef HAVE_BROKEN_MBSTOWCS - /* Define if tzset() actually switches the local timezone in a meaningful way. */ #undef HAVE_WORKING_TZSET @@ -943,6 +952,31 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* 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 @@ -980,17 +1014,21 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Define 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 +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif #endif +/* Define if arithmetic is subject to x87-style double rounding issue */ +#undef X87_DOUBLE_ROUNDING + /* Define on OpenBSD to activate all library features */ #undef _BSD_SOURCE @@ -1009,15 +1047,25 @@ /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX + /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE /* Define _OSF_SOURCE to get the makedev macro. */ #undef _OSF_SOURCE +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS Modified: python/branches/py3k-issue1717/setup.py ============================================================================== --- python/branches/py3k-issue1717/setup.py (original) +++ python/branches/py3k-issue1717/setup.py Sun Jan 25 21:08:20 2009 @@ -1063,9 +1063,12 @@ if macros.get('HAVE_SEM_OPEN', False): multiprocessing_srcs.append('_multiprocessing/semaphore.c') - exts.append ( Extension('_multiprocessing', multiprocessing_srcs, - define_macros=list(macros.items()), - include_dirs=["Modules/_multiprocessing"])) + if sysconfig.get_config_var('WITH_THREAD'): + exts.append ( Extension('_multiprocessing', multiprocessing_srcs, + define_macros=list(macros.items()), + include_dirs=["Modules/_multiprocessing"])) + else: + missing.append('_multiprocessing') # End multiprocessing # Platform-specific libraries From buildbot at python.org Sun Jan 25 21:14:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 20:14:41 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090125201442.189C41E4002@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/99 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: 4 tests failed: test_codecs test_io test_sundry test_traceback ====================================================================== 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' ====================================================================== ERROR: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 939, in testBasicIO self.assertEquals(f.write("abc"), 3) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testEncodingErrorsReading (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 774, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) 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/io.py", line 1730, in read decoder.decode(self.buffer.read(), final=True)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testEncodingErrorsWriting (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 792, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") 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/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testNewlinesInput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 900, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 538, in readlines return list(self) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1746, in __next__ line = self.readline() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1819, in readline while self._read_chunk(): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testNewlinesOutput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 925, in testNewlinesOutput txt.write(data) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1165, in test_issue1395_1 c = txt.read(1) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1177, in test_issue1395_2 c = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1187, in test_issue1395_3 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1198, in test_issue1395_4 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1206, in test_issue1395_5 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1739, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_sundry.py", line 24, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler ====================================================================== ERROR: test_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 21:35:48 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 25 Jan 2009 21:35:48 +0100 (CET) Subject: [Python-checkins] r68939 - peps/trunk/pep-0374.txt Message-ID: <20090125203548.A7CD61E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 25 21:35:48 2009 New Revision: 68939 Log: Clarify a paragraph. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sun Jan 25 21:35:48 2009 @@ -91,8 +91,8 @@ Python.? DVCSs also provide a great many additional features that centralized VCSs don't or can't provide. -This PEP explores the issue of changing Python's use of Subversion -for any of the current Python-implemented DVCSs, in order to gain +This PEP explores the possibility of changing Python's use of Subversion +to any of the currently popular DVCSs, in order to gain the benefits outlined above. This PEP does not guarantee that a switch to a DVCS will occur at the conclusion of this PEP. It is quite possible that no clear winner will be found and that svn will continue From buildbot at python.org Sun Jan 25 21:41:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 20:41:57 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090125204157.B42021E4002@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/181 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 Sun Jan 25 21:43:49 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 21:43:49 +0100 (CET) Subject: [Python-checkins] r68940 - in python/branches/py3k-issue1717/Lib: heapq.py xmlrpc/client.py Message-ID: <20090125204349.22E6E1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 21:43:48 2009 New Revision: 68940 Log: Revert accidental modification of non-ASCII character in Lib/heapq.py Remove mention of _cmp__ from comment in Lib/heapq.py Remove __cmp__ method from Datetime class in Lib/xmlrpc/client.py Modified: python/branches/py3k-issue1717/Lib/heapq.py python/branches/py3k-issue1717/Lib/xmlrpc/client.py Modified: python/branches/py3k-issue1717/Lib/heapq.py ============================================================================== --- python/branches/py3k-issue1717/Lib/heapq.py (original) +++ python/branches/py3k-issue1717/Lib/heapq.py Sun Jan 25 21:43:48 2009 @@ -34,7 +34,7 @@ __about__ = """Heap queues -[explanation by Fran???ois Pinard] +[explanation by Fran?ois Pinard] Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, @@ -262,7 +262,7 @@ # # Cutting the # of comparisons is important, since these routines have no # way to extract "the priority" from an array element, so that intelligence -# is likely to be hiding in custom _cmp__ methods, or in array elements +# is likely to be hiding in custom comparison methods, or in array elements # storing (priority, record) tuples. Comparisons are thus potentially # expensive. # 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 Sun Jan 25 21:43:48 2009 @@ -349,10 +349,6 @@ def timetuple(self): return time.strptime(self.value, "%Y%m%dT%H:%M:%S") - def __cmp__(self, other): - s, o = self.make_comparable(other) - return (s > o) - (s < o) - ## # Get date/time value. # From python-checkins at python.org Sun Jan 25 22:04:14 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 25 Jan 2009 22:04:14 +0100 (CET) Subject: [Python-checkins] r68941 - in python/trunk: Doc/library/collections.rst Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090125210414.C00F31E403E@bag.python.org> Author: raymond.hettinger Date: Sun Jan 25 22:04:14 2009 New Revision: 68941 Log: Promote combine() from a recipe to being a regular itertool. Modified: python/trunk/Doc/library/collections.rst 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/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Sun Jan 25 22:04:14 2009 @@ -298,7 +298,7 @@ Section 4.6.3, Exercise 19*\. * To enumerate all distinct multisets of a given size over a given set of - elements, see the :func:`combinations_with_replacement` function in the + elements, see :func:`combinations_with_replacement` in the :ref:`itertools-recipes` for itertools:: map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Sun Jan 25 22:04:14 2009 @@ -139,6 +139,20 @@ .. versionadded:: 2.6 +.. function:: compress(data, selectors) + + Make an iterator that filters elements from *data* returning only those that + have a corresponding element in *selectors* that evaluates to ``True``. + Stops when either the *data* or *selectors* iterables have been exhausted. + Equivalent to:: + + def compress(data, selectors): + # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F + return (d for d, s in izip(data, selectors) if s) + + .. versionadded:: 2.7 + + .. function:: count([n]) Make an iterator that returns consecutive integers starting with *n*. If not @@ -679,10 +693,6 @@ for n in xrange(2**len(pairs)): yield set(x for m, x in pairs if m&n) - def compress(data, selectors): - "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" - return (d for d, s in izip(data, selectors) if s) - def combinations_with_replacement(iterable, r): "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" # number items returned: (n+r-1)! / r! / (n-1)! Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Sun Jan 25 22:04:14 2009 @@ -191,6 +191,21 @@ self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1) + def test_compress(self): + 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')) + self.assertEqual(list(compress('ABCDEF', [1,0,1])), list('AC')) + self.assertEqual(list(compress('ABC', [0,1,1,1,1,1])), list('BC')) + n = 10000 + data = chain.from_iterable(repeat(range(6), n)) + selectors = chain.from_iterable(repeat((0, 1))) + self.assertEqual(list(compress(data, selectors)), [1,3,5] * n) + self.assertRaises(TypeError, compress, None, range(6)) # 1st arg not iterable + self.assertRaises(TypeError, compress, range(6), None) # 2nd arg not iterable + self.assertRaises(TypeError, compress, range(6)) # too few args + self.assertRaises(TypeError, compress, range(6), None) # too many args + def test_count(self): self.assertEqual(zip('abc',count()), [('a', 0), ('b', 1), ('c', 2)]) self.assertEqual(zip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)]) @@ -701,6 +716,9 @@ self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) + def test_compress(self): + self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) + def test_count(self): self.assertEqual(list(islice(count(10), 5)), [10, 11, 12, 13, 14]) @@ -781,6 +799,10 @@ a = [] self.makecycle(combinations([1,2,a,3], 3), a) + def test_compress(self): + a = [] + self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) @@ -934,6 +956,15 @@ self.assertRaises(TypeError, list, chain(N(s))) self.assertRaises(ZeroDivisionError, list, chain(E(s))) + def test_compress(self): + for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): + n = len(s) + for g in (G, I, Ig, S, L, R): + self.assertEqual(list(compress(g(s), repeat(1))), list(g(s))) + self.assertRaises(TypeError, compress, X(s), repeat(1)) + self.assertRaises(TypeError, list, compress(N(s), repeat(1))) + self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1))) + def test_product(self): for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): self.assertRaises(TypeError, product, X(s)) @@ -1125,7 +1156,7 @@ def test_keywords_in_subclass(self): # count is not subclassable... for cls in (repeat, izip, ifilter, ifilterfalse, chain, imap, - starmap, islice, takewhile, dropwhile, cycle): + starmap, islice, takewhile, dropwhile, cycle, compress): class Subclass(cls): def __init__(self, newarg=None, *args): cls.__init__(self, *args) @@ -1262,10 +1293,6 @@ ... for n in xrange(2**len(pairs)): ... yield set(x for m, x in pairs if m&n) ->>> def compress(data, selectors): -... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" -... return (d for d, s in izip(data, selectors) if s) - >>> def combinations_with_replacement(iterable, r): ... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" ... pool = tuple(iterable) @@ -1361,9 +1388,6 @@ >>> map(sorted, powerset('ab')) [[], ['a'], ['b'], ['a', 'b']] ->>> list(compress('abcdef', [1,0,1,0,1,1])) -['a', 'c', 'e', 'f'] - >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 25 22:04:14 2009 @@ -147,6 +147,8 @@ - Issue #4863: distutils.mwerkscompiler has been removed. +- Added a new function: itertools.compress(). + - 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 Sun Jan 25 22:04:14 2009 @@ -2506,6 +2506,162 @@ }; +/* compress object ************************************************************/ + +/* Equivalent to: + + def compress(data, selectors): + "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" + return (d for d, s in izip(data, selectors) if s) +*/ + +typedef struct { + PyObject_HEAD + PyObject *data; + PyObject *selectors; +} compressobject; + +static PyTypeObject compress_type; + +static PyObject * +compress_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + 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)) + return NULL; + + data = PyObject_GetIter(seq1); + if (data == NULL) + goto fail; + selectors = PyObject_GetIter(seq2); + if (selectors == NULL) + goto fail; + + /* create compressobject structure */ + lz = (compressobject *)type->tp_alloc(type, 0); + if (lz == NULL) + goto fail; + lz->data = data; + lz->selectors = selectors; + return (PyObject *)lz; + +fail: + Py_XDECREF(data); + Py_XDECREF(selectors); + return NULL; +} + +static void +compress_dealloc(compressobject *lz) +{ + PyObject_GC_UnTrack(lz); + Py_XDECREF(lz->data); + Py_XDECREF(lz->selectors); + Py_TYPE(lz)->tp_free(lz); +} + +static int +compress_traverse(compressobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->data); + Py_VISIT(lz->selectors); + return 0; +} + +static PyObject * +compress_next(compressobject *lz) +{ + PyObject *data = lz->data, *selectors = lz->selectors; + PyObject *datum, *selector; + PyObject *(*datanext)(PyObject *) = *Py_TYPE(data)->tp_iternext; + PyObject *(*selectornext)(PyObject *) = *Py_TYPE(selectors)->tp_iternext; + int ok; + + while (1) { + /* Steps: get datum, get selector, evaluate selector. + Order is important (to match the pure python version + in terms of which input gets a chance to raise an + exception first). + */ + + datum = datanext(data); + if (datum == NULL) + return NULL; + + selector = selectornext(selectors); + if (selector == NULL) { + Py_DECREF(datum); + return NULL; + } + + ok = PyObject_IsTrue(selector); + Py_DECREF(selector); + if (ok == 1) + return datum; + Py_DECREF(datum); + if (ok == -1) + return NULL; + } +} + +PyDoc_STRVAR(compress_doc, +"compress(data sequence, selector sequence) --> 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\ +selectors to choose the data elements."); + +static PyTypeObject compress_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.compress", /* tp_name */ + sizeof(compressobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)compress_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + compress_doc, /* tp_doc */ + (traverseproc)compress_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)compress_next, /* tp_iternext */ + 0, /* 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 */ + compress_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* ifilter object ************************************************************/ typedef struct { @@ -3552,6 +3708,7 @@ &starmap_type, &imap_type, &chain_type, + &compress_type, &ifilter_type, &ifilterfalse_type, &count_type, From python-checkins at python.org Sun Jan 25 22:10:08 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 25 Jan 2009 22:10:08 +0100 (CET) Subject: [Python-checkins] r68941 - svn:log Message-ID: <20090125211008.343C01E401D@bag.python.org> Author: raymond.hettinger Revision: 68941 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -Promote combine() from a recipe to being a regular itertool. \ No newline at end of file +Promote compress() from a recipe to being a regular itertool. \ No newline at end of file From brett at python.org Sun Jan 25 22:14:11 2009 From: brett at python.org (Brett Cannon) Date: Sun, 25 Jan 2009 13:14:11 -0800 Subject: [Python-checkins] r68919 - in python/branches/py3k: Doc/library/importlib.rstLib/importlib/NOTES Lib/importlib/_bootstrap.py In-Reply-To: <497C6A7E.80605@gmail.com> References: <20090125045631.31A691E4002@bag.python.org> <497C6A7E.80605@gmail.com> Message-ID: On Sun, Jan 25, 2009 at 05:34, Nick Coghlan wrote: > Antoine Pitrou wrote: >> writes: >>> + Only class methods are defined by this class to alleviate the need for >>> + instantiation. >> >> Why is it so? Is there some obvious performance improvement? >> Instantiation and normal methods are generally a more intuitive coding style >> than having only classmethods. >> Also, it means you can have several instances with different parameters each, >> and it eases testing (you can monkeypatch a test-specific instance without >> disrupting the whole stuff). > > Using a class with only class methods is the easiest way to implement a > singleton in Python. > > Since the BuiltinImporter and FrozenImporter are singletons by > definition, it makes sense to implement them that way. What Nick said: there is absolutely no state needed for these importers to work so I didn't feel the need to require instantiation. Just because the methods are all class methods doesn't mean you can't instantiate the classes and use them, it just is superfluous. As a perk it (will) also simplify the import code thanks to these two importers being implicitly on sys.meta_path. By not having to instantiate them there is that much less overhead, plus it helps do away with implicit state for import which makes it more fragile. -Brett From nnorwitz at gmail.com Sun Jan 25 22:19:34 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 16:19:34 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090125211934.GA3563@python.psfb.org> 328 tests OK. 1 test failed: test_wait4 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl 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 [17051 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 [12871 refs] [12871 refs] [22375 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks 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 [14526 refs] [14526 refs] test_plistlib test_poll test_popen [12876 refs] [12876 refs] [12876 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 [17871 refs] test_pyexpat test_queue test_quopri [15396 refs] [15396 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 [12871 refs] [12871 refs] [12874 refs] [12871 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 [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [14771 refs] [13086 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] [12871 refs] . [12871 refs] [12871 refs] this bit of output is from a test of stdout in a different process ... [12871 refs] [12871 refs] [13086 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 [12871 refs] [12871 refs] [13100 refs] [12894 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12874 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16367 refs] [16980 refs] [16796 refs] [16796 refs] [16796 refs] [16796 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer 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 test_wait4 failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/fork_wait.py", line 55, in test_wait self.assertEquals(a, range(NUM_THREADS)) AssertionError: [] != [0, 1, 2, 3] 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 328 tests OK. 1 test failed: test_wait4 33 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_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [658383 refs] From python-checkins at python.org Sun Jan 25 22:31:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 25 Jan 2009 22:31:47 +0100 (CET) Subject: [Python-checkins] r68942 - in python/trunk: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090125213147.BD6FC1E4002@bag.python.org> Author: raymond.hettinger Date: Sun Jan 25 22:31:47 2009 New Revision: 68942 Log: Improved itertools recipe for generating powerset(). Modified: python/trunk/Doc/library/itertools.rst python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Sun Jan 25 22:31:47 2009 @@ -687,11 +687,9 @@ nexts = cycle(islice(nexts, pending)) def powerset(iterable): - "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" - # Recipe credited to Eric Raymond - pairs = [(2**i, x) for i, x in enumerate(iterable)] - for n in xrange(2**len(pairs)): - yield set(x for m, x in pairs if m&n) + "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 combinations_with_replacement(iterable, r): "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Sun Jan 25 22:31:47 2009 @@ -1287,11 +1287,9 @@ ... nexts = cycle(islice(nexts, pending)) >>> def powerset(iterable): -... "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" -... # Recipe credited to Eric Raymond -... pairs = [(2**i, x) for i, x in enumerate(iterable)] -... for n in xrange(2**len(pairs)): -... yield set(x for m, x in pairs if m&n) +... "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 combinations_with_replacement(iterable, r): ... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" @@ -1385,8 +1383,8 @@ >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] ->>> map(sorted, powerset('ab')) -[[], ['a'], ['b'], ['a', 'b']] +>>> list(powerset([1,2,3])) +[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] From buildbot at python.org Sun Jan 25 22:40:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 21:40:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090125214009.B64E11E4002@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/174 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_sundry ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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' ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_sundry.py", line 24, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler sincerely, -The Buildbot From buildbot at python.org Sun Jan 25 22:49:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 21:49:02 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090125214903.2DC361E4002@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/58 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_sundry ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_sundry.py", line 27, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 23:09:11 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 23:09:11 +0100 (CET) Subject: [Python-checkins] r68943 - in python/trunk/Lib/distutils: __init__.py archive_util.py bcppcompiler.py ccompiler.py cmd.py command/__init__.py command/bdist.py command/bdist_dumb.py command/bdist_rpm.py command/bdist_wininst.py command/build.py command/build_clib.py command/build_ext.py command/build_py.py command/build_scripts.py command/clean.py command/config.py command/install.py command/install_data.py command/install_headers.py command/install_lib.py command/install_scripts.py command/sdist.py core.py cygwinccompiler.py debug.py dep_util.py dir_util.py dist.py errors.py fancy_getopt.py file_util.py filelist.py log.py msvccompiler.py spawn.py Message-ID: <20090125220911.2660B1E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 23:09:10 2009 New Revision: 68943 Log: Issue #5052: removed backward compatibility information (out of date) Modified: python/trunk/Lib/distutils/__init__.py python/trunk/Lib/distutils/archive_util.py python/trunk/Lib/distutils/bcppcompiler.py python/trunk/Lib/distutils/ccompiler.py python/trunk/Lib/distutils/cmd.py python/trunk/Lib/distutils/command/__init__.py python/trunk/Lib/distutils/command/bdist.py python/trunk/Lib/distutils/command/bdist_dumb.py python/trunk/Lib/distutils/command/bdist_rpm.py python/trunk/Lib/distutils/command/bdist_wininst.py python/trunk/Lib/distutils/command/build.py python/trunk/Lib/distutils/command/build_clib.py python/trunk/Lib/distutils/command/build_ext.py python/trunk/Lib/distutils/command/build_py.py python/trunk/Lib/distutils/command/build_scripts.py python/trunk/Lib/distutils/command/clean.py python/trunk/Lib/distutils/command/config.py python/trunk/Lib/distutils/command/install.py python/trunk/Lib/distutils/command/install_data.py python/trunk/Lib/distutils/command/install_headers.py python/trunk/Lib/distutils/command/install_lib.py python/trunk/Lib/distutils/command/install_scripts.py python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/core.py python/trunk/Lib/distutils/cygwinccompiler.py python/trunk/Lib/distutils/debug.py python/trunk/Lib/distutils/dep_util.py python/trunk/Lib/distutils/dir_util.py python/trunk/Lib/distutils/dist.py python/trunk/Lib/distutils/errors.py python/trunk/Lib/distutils/fancy_getopt.py python/trunk/Lib/distutils/file_util.py python/trunk/Lib/distutils/filelist.py python/trunk/Lib/distutils/log.py python/trunk/Lib/distutils/msvccompiler.py python/trunk/Lib/distutils/spawn.py Modified: python/trunk/Lib/distutils/__init__.py ============================================================================== --- python/trunk/Lib/distutils/__init__.py (original) +++ python/trunk/Lib/distutils/__init__.py Sun Jan 25 23:09:10 2009 @@ -8,8 +8,6 @@ setup (...) """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" # Distutils version Modified: python/trunk/Lib/distutils/archive_util.py ============================================================================== --- python/trunk/Lib/distutils/archive_util.py (original) +++ python/trunk/Lib/distutils/archive_util.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/bcppcompiler.py ============================================================================== --- python/trunk/Lib/distutils/bcppcompiler.py (original) +++ python/trunk/Lib/distutils/bcppcompiler.py Sun Jan 25 23:09:10 2009 @@ -11,8 +11,6 @@ # someone should sit down and factor out the common code as # WindowsCCompiler! --GPW -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" Modified: python/trunk/Lib/distutils/ccompiler.py ============================================================================== --- python/trunk/Lib/distutils/ccompiler.py (original) +++ python/trunk/Lib/distutils/ccompiler.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, re Modified: python/trunk/Lib/distutils/cmd.py ============================================================================== --- python/trunk/Lib/distutils/cmd.py (original) +++ python/trunk/Lib/distutils/cmd.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ in the distutils.command package. """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string, re Modified: python/trunk/Lib/distutils/command/__init__.py ============================================================================== --- python/trunk/Lib/distutils/command/__init__.py (original) +++ python/trunk/Lib/distutils/command/__init__.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Package containing implementation of all the standard Distutils commands.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" __all__ = ['build', Modified: python/trunk/Lib/distutils/command/bdist.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist.py (original) +++ python/trunk/Lib/distutils/command/bdist.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Implements the Distutils 'bdist' command (create a built [binary] distribution).""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/command/bdist_dumb.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist_dumb.py (original) +++ python/trunk/Lib/distutils/command/bdist_dumb.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os 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 Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string Modified: python/trunk/Lib/distutils/command/bdist_wininst.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist_wininst.py (original) +++ python/trunk/Lib/distutils/command/bdist_wininst.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string Modified: python/trunk/Lib/distutils/command/build.py ============================================================================== --- python/trunk/Lib/distutils/command/build.py (original) +++ python/trunk/Lib/distutils/command/build.py Sun Jan 25 23:09:10 2009 @@ -2,8 +2,6 @@ Implements the Distutils 'build' command.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os Modified: python/trunk/Lib/distutils/command/build_clib.py ============================================================================== --- python/trunk/Lib/distutils/command/build_clib.py (original) +++ python/trunk/Lib/distutils/command/build_clib.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ that is included in the module distribution and needed by an extension module.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$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 Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string, re Modified: python/trunk/Lib/distutils/command/build_py.py ============================================================================== --- python/trunk/Lib/distutils/command/build_py.py (original) +++ python/trunk/Lib/distutils/command/build_py.py Sun Jan 25 23:09:10 2009 @@ -2,8 +2,6 @@ Implements the Distutils 'build_py' command.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import string, os 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 Sun Jan 25 23:09:10 2009 @@ -2,8 +2,6 @@ Implements the Distutils 'build_scripts' command.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os, re Modified: python/trunk/Lib/distutils/command/clean.py ============================================================================== --- python/trunk/Lib/distutils/command/clean.py (original) +++ python/trunk/Lib/distutils/command/clean.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ # contributed by Bastian Kleineidam , added 2000-03-18 -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/command/config.py ============================================================================== --- python/trunk/Lib/distutils/command/config.py (original) +++ python/trunk/Lib/distutils/command/config.py Sun Jan 25 23:09:10 2009 @@ -9,8 +9,6 @@ this header file lives". """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string, re Modified: python/trunk/Lib/distutils/command/install.py ============================================================================== --- python/trunk/Lib/distutils/command/install.py (original) +++ python/trunk/Lib/distutils/command/install.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ from distutils import log -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string Modified: python/trunk/Lib/distutils/command/install_data.py ============================================================================== --- python/trunk/Lib/distutils/command/install_data.py (original) +++ python/trunk/Lib/distutils/command/install_data.py Sun Jan 25 23:09:10 2009 @@ -5,8 +5,6 @@ # contributed by Bastian Kleineidam -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/command/install_headers.py ============================================================================== --- python/trunk/Lib/distutils/command/install_headers.py (original) +++ python/trunk/Lib/distutils/command/install_headers.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" from distutils.core import Command Modified: python/trunk/Lib/distutils/command/install_lib.py ============================================================================== --- python/trunk/Lib/distutils/command/install_lib.py (original) +++ python/trunk/Lib/distutils/command/install_lib.py Sun Jan 25 23:09:10 2009 @@ -1,5 +1,3 @@ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/command/install_scripts.py ============================================================================== --- python/trunk/Lib/distutils/command/install_scripts.py (original) +++ python/trunk/Lib/distutils/command/install_scripts.py Sun Jan 25 23:09:10 2009 @@ -5,8 +5,6 @@ # contributed by Bastian Kleineidam -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Sun Jan 25 23:09:10 2009 @@ -2,8 +2,6 @@ Implements the Distutils 'sdist' command (create a source distribution).""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os, string Modified: python/trunk/Lib/distutils/core.py ============================================================================== --- python/trunk/Lib/distutils/core.py (original) +++ python/trunk/Lib/distutils/core.py Sun Jan 25 23:09:10 2009 @@ -6,8 +6,6 @@ really defined in distutils.dist and distutils.cmd. """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os Modified: python/trunk/Lib/distutils/cygwinccompiler.py ============================================================================== --- python/trunk/Lib/distutils/cygwinccompiler.py (original) +++ python/trunk/Lib/distutils/cygwinccompiler.py Sun Jan 25 23:09:10 2009 @@ -45,8 +45,6 @@ # * mingw gcc 3.2/ld 2.13 works # (ld supports -shared) -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os,sys,copy Modified: python/trunk/Lib/distutils/debug.py ============================================================================== --- python/trunk/Lib/distutils/debug.py (original) +++ python/trunk/Lib/distutils/debug.py Sun Jan 25 23:09:10 2009 @@ -1,7 +1,5 @@ import os -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" # If DISTUTILS_DEBUG is anything other than the empty string, we run in Modified: python/trunk/Lib/distutils/dep_util.py ============================================================================== --- python/trunk/Lib/distutils/dep_util.py (original) +++ python/trunk/Lib/distutils/dep_util.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ and groups of files; also, function based entirely on such timestamp dependency analysis.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/dir_util.py ============================================================================== --- python/trunk/Lib/distutils/dir_util.py (original) +++ python/trunk/Lib/distutils/dir_util.py Sun Jan 25 23:09:10 2009 @@ -2,8 +2,6 @@ Utility functions for manipulating directories and directory trees.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os, sys Modified: python/trunk/Lib/distutils/dist.py ============================================================================== --- python/trunk/Lib/distutils/dist.py (original) +++ python/trunk/Lib/distutils/dist.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ being built/installed/distributed. """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string, re Modified: python/trunk/Lib/distutils/errors.py ============================================================================== --- python/trunk/Lib/distutils/errors.py (original) +++ python/trunk/Lib/distutils/errors.py Sun Jan 25 23:09:10 2009 @@ -8,8 +8,6 @@ This module is safe to use in "from ... import *" mode; it only exports symbols whose names start with "Distutils" and end with "Error".""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" class DistutilsError (Exception): Modified: python/trunk/Lib/distutils/fancy_getopt.py ============================================================================== --- python/trunk/Lib/distutils/fancy_getopt.py (original) +++ python/trunk/Lib/distutils/fancy_getopt.py Sun Jan 25 23:09:10 2009 @@ -8,8 +8,6 @@ * options set attributes of a passed-in object """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, string, re Modified: python/trunk/Lib/distutils/file_util.py ============================================================================== --- python/trunk/Lib/distutils/file_util.py (original) +++ python/trunk/Lib/distutils/file_util.py Sun Jan 25 23:09:10 2009 @@ -3,8 +3,6 @@ Utility functions for operating on single files. """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os Modified: python/trunk/Lib/distutils/filelist.py ============================================================================== --- python/trunk/Lib/distutils/filelist.py (original) +++ python/trunk/Lib/distutils/filelist.py Sun Jan 25 23:09:10 2009 @@ -4,8 +4,6 @@ and building lists of files. """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os, string, re Modified: python/trunk/Lib/distutils/log.py ============================================================================== --- python/trunk/Lib/distutils/log.py (original) +++ python/trunk/Lib/distutils/log.py Sun Jan 25 23:09:10 2009 @@ -1,7 +1,5 @@ """A simple log mechanism styled after PEP 282.""" -# This module should be kept compatible with Python 2.1. - # The class here is styled after PEP 282 so that it could later be # replaced with a standard Python logging implementation. Modified: python/trunk/Lib/distutils/msvccompiler.py ============================================================================== --- python/trunk/Lib/distutils/msvccompiler.py (original) +++ python/trunk/Lib/distutils/msvccompiler.py Sun Jan 25 23:09:10 2009 @@ -8,8 +8,6 @@ # hacked by Robin Becker and Thomas Heller to do a better job of # finding DevStudio (through the registry) -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string Modified: python/trunk/Lib/distutils/spawn.py ============================================================================== --- python/trunk/Lib/distutils/spawn.py (original) +++ python/trunk/Lib/distutils/spawn.py Sun Jan 25 23:09:10 2009 @@ -6,8 +6,6 @@ executable name. """ -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import sys, os, string From python-checkins at python.org Sun Jan 25 23:10:34 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 25 Jan 2009 23:10:34 +0100 (CET) Subject: [Python-checkins] r68944 - peps/trunk/pep-0374.txt Message-ID: <20090125221034.E8CAB1E4002@bag.python.org> Author: brett.cannon Date: Sun Jan 25 23:10:34 2009 New Revision: 68944 Log: Fix a typo in hg's newest version. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sun Jan 25 23:10:34 2009 @@ -206,7 +206,7 @@ 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.2 http://code.python.org/hg/trunk/ http://code.python.org/hg/branches/py3k/ +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 ========== ========== ======= =================================== ========================================== From python-checkins at python.org Sun Jan 25 23:11:04 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 23:11:04 +0100 (CET) Subject: [Python-checkins] r68945 - python/trunk/Lib/distutils/command/install_lib.py Message-ID: <20090125221104.BEF191E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 23:11:04 2009 New Revision: 68945 Log: added missing module docstring Modified: python/trunk/Lib/distutils/command/install_lib.py Modified: python/trunk/Lib/distutils/command/install_lib.py ============================================================================== --- python/trunk/Lib/distutils/command/install_lib.py (original) +++ python/trunk/Lib/distutils/command/install_lib.py Sun Jan 25 23:11:04 2009 @@ -1,3 +1,8 @@ +"""distutils.command.install_lib + +Implements the Distutils 'install_lib' command +(install all Python modules).""" + __revision__ = "$Id$" import os From python-checkins at python.org Sun Jan 25 23:12:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 25 Jan 2009 23:12:09 +0100 (CET) Subject: [Python-checkins] r68946 - python/branches/release26-maint Message-ID: <20090125221209.7F21E1E4002@bag.python.org> Author: tarek.ziade Date: Sun Jan 25 23:12:09 2009 New Revision: 68946 Log: Blocked revisions 68943 via svnmerge ........ r68943 | tarek.ziade | 2009-01-25 23:09:10 +0100 (Sun, 25 Jan 2009) | 1 line Issue #5052: removed backward compatibility information (out of date) ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Jan 25 23:12:32 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 23:12:32 +0100 (CET) Subject: [Python-checkins] r68947 - python/trunk/Objects/longobject.c Message-ID: <20090125221232.16B4E1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 23:12:31 2009 New Revision: 68947 Log: No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. Modified: python/trunk/Objects/longobject.c Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Sun Jan 25 23:12:31 2009 @@ -547,7 +547,7 @@ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */ - twodigits carry; /* for computing 2's-comp */ + digit carry; /* for computing 2's-comp */ size_t j; /* # bytes filled */ unsigned char* p; /* pointer to next byte in bytes */ int pincr; /* direction to move p */ From buildbot at python.org Sun Jan 25 23:12:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 22:12:55 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090125221255.BDAD41E4002@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/163 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_sundry ====================================================================== ERROR: test_at_least_import_untested_modules (test.test_sundry.TestUntestedModules) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_sundry.py", line 24, in test_at_least_import_untested_modules import distutils.mwerkscompiler ImportError: No module named mwerkscompiler make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Jan 25 23:20:40 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 23:20:40 +0100 (CET) Subject: [Python-checkins] r68948 - in python/branches/release26-maint: Objects/longobject.c Message-ID: <20090125222040.37C211E401A@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 23:20:39 2009 New Revision: 68948 Log: Merged revisions 68947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68947 | mark.dickinson | 2009-01-25 22:12:31 +0000 (Sun, 25 Jan 2009) | 3 lines No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Objects/longobject.c Modified: python/branches/release26-maint/Objects/longobject.c ============================================================================== --- python/branches/release26-maint/Objects/longobject.c (original) +++ python/branches/release26-maint/Objects/longobject.c Sun Jan 25 23:20:39 2009 @@ -547,7 +547,7 @@ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */ - twodigits carry; /* for computing 2's-comp */ + digit carry; /* for computing 2's-comp */ size_t j; /* # bytes filled */ unsigned char* p; /* pointer to next byte in bytes */ int pincr; /* direction to move p */ From python-checkins at python.org Sun Jan 25 23:25:06 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 23:25:06 +0100 (CET) Subject: [Python-checkins] r68949 - in python/branches/py3k: Objects/longobject.c Message-ID: <20090125222506.CE2571E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 23:25:06 2009 New Revision: 68949 Log: Merged revisions 68947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68947 | mark.dickinson | 2009-01-25 22:12:31 +0000 (Sun, 25 Jan 2009) | 3 lines No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. ........ 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 Sun Jan 25 23:25:06 2009 @@ -776,7 +776,7 @@ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */ - twodigits carry; /* for computing 2's-comp */ + digit carry; /* for computing 2's-comp */ size_t j; /* # bytes filled */ unsigned char* p; /* pointer to next byte in bytes */ int pincr; /* direction to move p */ From python-checkins at python.org Sun Jan 25 23:26:39 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 25 Jan 2009 23:26:39 +0100 (CET) Subject: [Python-checkins] r68950 - in python/branches/release30-maint: Objects/longobject.c Message-ID: <20090125222639.500ED1E4002@bag.python.org> Author: mark.dickinson Date: Sun Jan 25 23:26:28 2009 New Revision: 68950 Log: Merged revisions 68949 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68949 | mark.dickinson | 2009-01-25 22:25:06 +0000 (Sun, 25 Jan 2009) | 10 lines Merged revisions 68947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68947 | mark.dickinson | 2009-01-25 22:12:31 +0000 (Sun, 25 Jan 2009) | 3 lines No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/longobject.c Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Sun Jan 25 23:26:28 2009 @@ -776,7 +776,7 @@ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */ - twodigits carry; /* for computing 2's-comp */ + digit carry; /* for computing 2's-comp */ size_t j; /* # bytes filled */ unsigned char* p; /* pointer to next byte in bytes */ int pincr; /* direction to move p */ From buildbot at python.org Sun Jan 25 23:52:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 25 Jan 2009 22:52:38 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090125225238.E7D901E402E@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/63 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 python-checkins at python.org Mon Jan 26 00:34:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 26 Jan 2009 00:34:00 +0100 (CET) Subject: [Python-checkins] r68951 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090125233400.5BA361E4030@bag.python.org> Author: tarek.ziade Date: Mon Jan 26 00:34:00 2009 New Revision: 68951 Log: Fixed #1885: --formats=tar,gztar was not working properly in the sdist command Modified: python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/tests/test_sdist.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Mon Jan 26 00:34:00 2009 @@ -456,6 +456,10 @@ self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) 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 Jan 26 00:34:00 2009 @@ -4,10 +4,13 @@ import shutil import zipfile from os.path import join +import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase +from distutils.errors import DistutilsExecError +from distutils.spawn import spawn CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -35,6 +38,19 @@ 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: @@ -46,15 +62,7 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - if not os.path.exists(TEMP_PKG): - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - - # 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) + self._init_tmp_pkg() # creating VCS directories with some files in them os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) @@ -68,8 +76,6 @@ self._write(join(TEMP_PKG, 'somecode', '.git', 'ok'), 'xxx') - os.chdir(TEMP_PKG) - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -103,6 +109,55 @@ # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + def test_make_distribution(self): + + self._init_tmp_pkg() + + # 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 + + # 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' + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.run() + + # making sure we have two files + dist_folder = join(TEMP_PKG, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz'] ) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 26 00:34:00 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue #1885: distutils. When running sdist with --formats=tar,gztar + the tar file was overriden by the gztar one. + - Issue #4863: distutils.mwerkscompiler has been removed. - Added a new function: itertools.compress(). From python-checkins at python.org Mon Jan 26 00:40:29 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 26 Jan 2009 00:40:29 +0100 (CET) Subject: [Python-checkins] r68952 - peps/trunk/pep-0374.txt Message-ID: <20090125234029.1FF531E4010@bag.python.org> Author: brett.cannon Date: Mon Jan 26 00:40:28 2009 New Revision: 68952 Log: So it turns out the horrible checkout numbers for bzr were somewhat bogus; I apparently have a connection to Launchpad worse than a 56K modem. Using my much better connection to code.python.org I did the simple case for bzr and recorded only that number. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon Jan 26 00:40:28 2009 @@ -1377,20 +1377,14 @@ DVCS Time Space ------- ---------------- -------------- svn 1:04 139 M -bzr 1 2:29:24 275 M -bzr 2 8:46 596 M +bzr 10:45 276 M hg 2:30 171 M git 2:54 134 M ======= ================ ============== .. note:: - The *bzr 1* entry is for - following the instructions in the `One-Off Checkout`_ scenario - instructions pulling from Launchpad_ in mid-January. - The *bzr 2* entry is based on following the instructions - for the `experimental Bazaar branches - `_ and pulling from - http://code.python.org/python/trunk/. + The version of bzr running on code.python.org is 1.5. Changes were + made in bzr 1.9 that should bring down the reported numbers. 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 From buildbot at python.org Mon Jan 26 01:04:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 00:04:05 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090126000406.178441E4002@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/86 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 ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Jan 26 02:16:51 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 26 Jan 2009 02:16:51 +0100 (CET) Subject: [Python-checkins] r68953 - in python/trunk: Doc/library/importlib.rst Doc/library/modules.rst Lib/importlib.py Lib/test/test_importlib.py Misc/NEWS Message-ID: <20090126011651.729081E400C@bag.python.org> Author: brett.cannon Date: Mon Jan 26 02:16:50 2009 New Revision: 68953 Log: Backport importlib in the form of providing importlib.import_module(). This has been done purely to help transitions from 2.7 to 3.1. Added: python/trunk/Doc/library/importlib.rst python/trunk/Lib/importlib.py python/trunk/Lib/test/test_importlib.py Modified: python/trunk/Doc/library/modules.rst python/trunk/Misc/NEWS Added: python/trunk/Doc/library/importlib.rst ============================================================================== --- (empty file) +++ python/trunk/Doc/library/importlib.rst Mon Jan 26 02:16:50 2009 @@ -0,0 +1,27 @@ +:mod:`importlib` -- Convenience wrappers for :func:`__import__` +=============================================================== + +.. module:: importlib + :synopsis: Convenience wrappers for __import__ + +.. moduleauthor:: Brett Cannon +.. sectionauthor:: Brett Cannon + +.. versionadded:: 2.7 + +This module is a minor subset of what is available in the more full-featured +package of the same name from Python 3.1 that provides a complete +implementation of :keyword:`import`. What is here has been provided to +help ease in transitioning from 2.7 to 3.1. + + +.. function:: import_module(name, package=None) + + Import a module. The *name* argument specifies what module to + 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 + 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. Modified: python/trunk/Doc/library/modules.rst ============================================================================== --- python/trunk/Doc/library/modules.rst (original) +++ python/trunk/Doc/library/modules.rst Mon Jan 26 02:16:50 2009 @@ -14,6 +14,7 @@ .. toctree:: imp.rst + importlib.rst imputil.rst zipimport.rst pkgutil.rst Added: python/trunk/Lib/importlib.py ============================================================================== --- (empty file) +++ python/trunk/Lib/importlib.py Mon Jan 26 02:16:50 2009 @@ -0,0 +1,38 @@ +"""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] Added: python/trunk/Lib/test/test_importlib.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_importlib.py Mon Jan 26 02:16:50 2009 @@ -0,0 +1,173 @@ +import contextlib +import imp +import importlib +import sys +import unittest + + + at contextlib.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 contextlib.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(object): + + """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) + + + +class ImportModuleTests(unittest.TestCase): + + """Test importlib.import_module.""" + + def test_module_import(self): + # Test importing a top-level module. + with mock_modules('top_level') as mock: + with import_state(meta_path=[mock]): + module = importlib.import_module('top_level') + self.assertEqual(module.__name__, 'top_level') + + def test_absolute_package_import(self): + # Test importing a module from a package with an absolute name. + pkg_name = 'pkg' + pkg_long_name = '{0}.__init__'.format(pkg_name) + name = '{0}.mod'.format(pkg_name) + with mock_modules(pkg_long_name, name) as mock: + with import_state(meta_path=[mock]): + module = importlib.import_module(name) + self.assertEqual(module.__name__, name) + + def test_relative_package_import(self): + # Test importing a module from a package through a relatve import. + pkg_name = 'pkg' + pkg_long_name = '{0}.__init__'.format(pkg_name) + module_name = 'mod' + 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: + with import_state(meta_path=[mock]): + module = importlib.import_module(relative_name, pkg_name) + self.assertEqual(module.__name__, absolute_name) + + def test_absolute_import_with_package(self): + # Test importing a module from a package with an absolute name with + # the 'package' argument given. + pkg_name = 'pkg' + pkg_long_name = '{0}.__init__'.format(pkg_name) + name = '{0}.mod'.format(pkg_name) + with mock_modules(pkg_long_name, name) as mock: + with import_state(meta_path=[mock]): + module = importlib.import_module(name, pkg_name) + self.assertEqual(module.__name__, name) + + def test_relative_import_wo_package(self): + # Relative imports cannot happen without the 'package' argument being + # set. + self.assertRaises(TypeError, importlib.import_module, '.support') + + +def test_main(): + from test.test_support import run_unittest + run_unittest(ImportModuleTests) + + +if __name__ == '__main__': + test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Jan 26 02:16:50 2009 @@ -145,6 +145,9 @@ Library ------- +- Backport importlib from Python 3.1. Only the import_module() function has + been backported to help facilitate transitions from 2.7 to 3.1. + - Issue #1885: distutils. When running sdist with --formats=tar,gztar the tar file was overriden by the gztar one. From python-checkins at python.org Mon Jan 26 02:21:48 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 26 Jan 2009 02:21:48 +0100 (CET) Subject: [Python-checkins] r68954 - python/branches/py3k Message-ID: <20090126012148.13CCD1E4002@bag.python.org> Author: brett.cannon Date: Mon Jan 26 02:21:47 2009 New Revision: 68954 Log: Blocked revisions 68953 via svnmerge ........ r68953 | brett.cannon | 2009-01-25 17:16:50 -0800 (Sun, 25 Jan 2009) | 3 lines Backport importlib in the form of providing importlib.import_module(). This has been done purely to help transitions from 2.7 to 3.1. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Mon Jan 26 02:21:54 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 26 Jan 2009 02:21:54 +0100 (CET) Subject: [Python-checkins] r68955 - python/branches/release26-maint Message-ID: <20090126012154.CF4521E4002@bag.python.org> Author: brett.cannon Date: Mon Jan 26 02:21:54 2009 New Revision: 68955 Log: Blocked revisions 68953 via svnmerge ........ r68953 | brett.cannon | 2009-01-25 17:16:50 -0800 (Sun, 25 Jan 2009) | 3 lines Backport importlib in the form of providing importlib.import_module(). This has been done purely to help transitions from 2.7 to 3.1. ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Mon Jan 26 02:37:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 01:37:00 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090126013700.E75E51E4002@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/41 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_urllib2_localnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1286@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1244@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1280@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1262@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1292@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1304@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1274@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1256@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1250@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1268@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1310@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1298@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From nnorwitz at gmail.com Mon Jan 26 02:08:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 25 Jan 2009 20:08:08 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090126010808.GA1316@python.psfb.org> svn update tools/sphinx svn: Working copy 'tools/sphinx' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) make: *** [update] Error 1 From python-checkins at python.org Mon Jan 26 02:54:41 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 26 Jan 2009 02:54:41 +0100 (CET) Subject: [Python-checkins] r68956 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090126015441.EF8D31E4002@bag.python.org> Author: brett.cannon Date: Mon Jan 26 02:54:40 2009 New Revision: 68956 Log: Update NOTES 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 Mon Jan 26 02:54:40 2009 @@ -1,20 +1,9 @@ to do ///// -* Expose resolve_name(). - -* Backport to Python 2.7. - - + import_module - + resolve_name - * Create reasonable base tests that all finders and loaders must pass so that various implementations can just subclass as needed. -* Expose built-in and frozen importers. - - + Make staticmethods so that class can be used directly. - * Reorganize support code. + Separate general support code and importer-specific (e.g. source) support @@ -31,13 +20,6 @@ + write_bytecode -> complete set of bytes for bytecode instead of individual arguments. -* Implement PEP 302 protocol for loaders (should just be a matter of testing). - - + Built-in. - + Frozen. - + Extension. - + Source/bytecode. - * Create meta_path importer for sys.path. * OPTIMIZE! @@ -48,6 +30,13 @@ - 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. + + Frozen. + + Extension. + + Source/bytecode. + * Public API to expose (w/ docs!) + abc @@ -80,6 +69,7 @@ - get_module decorator (new name) - check_name decorator (new name) + - resolve_name + machinery From buildbot at python.org Mon Jan 26 02:57:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 01:57:11 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090126015711.B7F8B1E4002@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/4536 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon,mark.dickinson,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Killed sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 03:07:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 02:07:40 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090126020740.C9D221E401B@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/102 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_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Jan 26 03:09:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 03:09:03 +0100 (CET) Subject: [Python-checkins] r68957 - in python/branches/py3k: Doc/library/operator.rst Lib/locale.py Lib/test/test_array.py Lib/test/test_bool.py Lib/test/test_operator.py Misc/NEWS Modules/operator.c Message-ID: <20090126020903.D17FE1E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 03:09:03 2009 New Revision: 68957 Log: As discussed on python-dev, remove several operator functions isSequenceType(), isMappingType(), and isNumberType() in favor of using abstract base classes. Also, remove repeat() and irepeat() in favor of mul() and imul(). After the buildbots have had a go at this. Will backport to Py3.0.1. For Py2.7, will just mark as deprecated. Modified: python/branches/py3k/Doc/library/operator.rst python/branches/py3k/Lib/locale.py python/branches/py3k/Lib/test/test_array.py python/branches/py3k/Lib/test/test_bool.py python/branches/py3k/Lib/test/test_operator.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/operator.c Modified: python/branches/py3k/Doc/library/operator.rst ============================================================================== --- python/branches/py3k/Doc/library/operator.rst (original) +++ python/branches/py3k/Doc/library/operator.rst Mon Jan 26 03:09:03 2009 @@ -221,12 +221,6 @@ Return the index of the first of occurrence of *b* in *a*. -.. function:: repeat(a, b) - __repeat__(a, b) - - Return ``a * b`` where *a* is a sequence and *b* is an integer. - - .. function:: setitem(a, b, c) __setitem__(a, b, c) @@ -294,13 +288,6 @@ ``a = ipow(a, b)`` is equivalent to ``a **= b``. -.. function:: irepeat(a, b) - __irepeat__(a, b) - - ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and - *b* is an integer. - - .. function:: irshift(a, b) __irshift__(a, b) @@ -324,67 +311,6 @@ ``a = ixor(a, b)`` is equivalent to ``a ^= b``. - -The :mod:`operator` module also defines a few predicates to test the type of -objects. - -.. XXX just remove them? -.. note:: - - Be careful not to misinterpret the results of these functions; none have any - measure of reliability with instance objects. - For example: - - >>> class C: - ... pass - ... - >>> import operator - >>> obj = C() - >>> operator.isMappingType(obj) - True - -.. note:: - - Since there are now abstract classes for collection types, you should write, - for example, ``isinstance(obj, collections.Mapping)`` and ``isinstance(obj, - collections.Sequence)``. - -.. function:: isMappingType(obj) - - 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) - - 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) - - 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__`. - - .. 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. @@ -513,8 +439,6 @@ +-----------------------+-------------------------+---------------------------------+ | Right Shift | ``a >> b`` | ``rshift(a, b)`` | +-----------------------+-------------------------+---------------------------------+ -| Sequence Repetition | ``seq * i`` | ``repeat(seq, i)`` | -+-----------------------+-------------------------+---------------------------------+ | String Formatting | ``s % obj`` | ``mod(s, obj)`` | +-----------------------+-------------------------+---------------------------------+ | Subtraction | ``a - b`` | ``sub(a, b)`` | Modified: python/branches/py3k/Lib/locale.py ============================================================================== --- python/branches/py3k/Lib/locale.py (original) +++ python/branches/py3k/Lib/locale.py Mon Jan 26 03:09:03 2009 @@ -187,7 +187,7 @@ formatted = _group(formatted, monetary=monetary)[0] return formatted -import re, operator +import re, collections _percent_re = re.compile(r'%(?:\((?P.*?)\))?' r'(?P[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]') @@ -207,7 +207,7 @@ del new_val[i+1:i+1+starcount] i += (1 + starcount) val = tuple(new_val) - elif operator.isMappingType(val): + elif isinstance(val, collections.Mapping): for perc in percents: key = perc.group("key") val[key] = format(perc.group(), val[key], grouping) Modified: python/branches/py3k/Lib/test/test_array.py ============================================================================== --- python/branches/py3k/Lib/test/test_array.py (original) +++ python/branches/py3k/Lib/test/test_array.py Mon Jan 26 03:09:03 2009 @@ -725,8 +725,6 @@ self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) self.assertRaises(BufferError, operator.delitem, a, 0) self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) - self.assertRaises(BufferError, operator.irepeat, a, 2) - self.assertRaises(BufferError, operator.irepeat, a, 0) def test_weakref(self): s = array.array(self.typecode, self.example) Modified: python/branches/py3k/Lib/test/test_bool.py ============================================================================== --- python/branches/py3k/Lib/test/test_bool.py (original) +++ python/branches/py3k/Lib/test/test_bool.py Mon Jan 26 03:09:03 2009 @@ -245,16 +245,10 @@ import operator self.assertIs(operator.truth(0), False) self.assertIs(operator.truth(1), True) - self.assertIs(operator.isNumberType(None), False) - self.assertIs(operator.isNumberType(0), True) self.assertIs(operator.not_(1), False) self.assertIs(operator.not_(0), True) - self.assertIs(operator.isSequenceType(0), False) - self.assertIs(operator.isSequenceType([]), True) self.assertIs(operator.contains([], 1), False) self.assertIs(operator.contains([1], 1), True) - self.assertIs(operator.isMappingType(1), False) - self.assertIs(operator.isMappingType({}), True) self.assertIs(operator.lt(0, 0), False) self.assertIs(operator.lt(0, 1), True) self.assertIs(operator.is_(True, True), True) Modified: python/branches/py3k/Lib/test/test_operator.py ============================================================================== --- python/branches/py3k/Lib/test/test_operator.py (original) +++ python/branches/py3k/Lib/test/test_operator.py Mon Jan 26 03:09:03 2009 @@ -164,31 +164,6 @@ self.failUnlessRaises(TypeError, operator.invert, None) self.assertEqual(operator.inv(4), -5) - def test_isMappingType(self): - self.failUnlessRaises(TypeError, operator.isMappingType) - self.failIf(operator.isMappingType(1)) - self.failIf(operator.isMappingType(operator.isMappingType)) - self.failUnless(operator.isMappingType(operator.__dict__)) - self.failUnless(operator.isMappingType({})) - - def test_isNumberType(self): - self.failUnlessRaises(TypeError, operator.isNumberType) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8j)) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8.3)) - self.failIf(operator.isNumberType(dir())) - - def test_isSequenceType(self): - self.failUnlessRaises(TypeError, operator.isSequenceType) - self.failUnless(operator.isSequenceType(dir())) - self.failUnless(operator.isSequenceType(())) - self.failUnless(operator.isSequenceType(range(10))) - self.failUnless(operator.isSequenceType('yeahbuddy')) - self.failIf(operator.isSequenceType(3)) - class Dict(dict): pass - self.failIf(operator.isSequenceType(Dict())) - def test_lshift(self): self.failUnlessRaises(TypeError, operator.lshift) self.failUnlessRaises(TypeError, operator.lshift, None, 42) @@ -235,31 +210,6 @@ self.assertRaises(TypeError, operator.pow, 1) self.assertRaises(TypeError, operator.pow, 1, 2, 3) - def test_repeat(self): - a = list(range(3)) - self.failUnlessRaises(TypeError, operator.repeat) - self.failUnlessRaises(TypeError, operator.repeat, a, None) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == []) - a = (1, 2, 3) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == ()) - a = '123' - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == '') - a = Seq1([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - a = Seq2([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - self.failUnlessRaises(TypeError, operator.repeat, 6, 7) - def test_rshift(self): self.failUnlessRaises(TypeError, operator.rshift) self.failUnlessRaises(TypeError, operator.rshift, None, 42) @@ -443,7 +393,6 @@ self.assertEqual(operator.itruediv (c, 5), "itruediv") self.assertEqual(operator.ixor (c, 5), "ixor") self.assertEqual(operator.iconcat (c, c), "iadd") - self.assertEqual(operator.irepeat (c, 5), "imul") self.assertEqual(operator.__iadd__ (c, 5), "iadd") self.assertEqual(operator.__iand__ (c, 5), "iand") self.assertEqual(operator.__ifloordiv__(c, 5), "ifloordiv") @@ -457,7 +406,6 @@ self.assertEqual(operator.__itruediv__ (c, 5), "itruediv") self.assertEqual(operator.__ixor__ (c, 5), "ixor") self.assertEqual(operator.__iconcat__ (c, c), "iadd") - self.assertEqual(operator.__irepeat__ (c, 5), "imul") def test_main(verbose=None): import sys Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 26 03:09:03 2009 @@ -144,6 +144,10 @@ Library ------- +- Removed isSequenceType(), isMappingType, and isNumberType() from the + operator module; use the abstract base classes instead. Also removed + the repeat() function; use mul() instead. + - Issue #4863: distutils.mwerkscompiler has been removed. - Fix and properly document the multiprocessing module's logging Modified: python/branches/py3k/Modules/operator.c ============================================================================== --- python/branches/py3k/Modules/operator.c (original) +++ python/branches/py3k/Modules/operator.c Mon Jan 26 03:09:03 2009 @@ -65,7 +65,6 @@ if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \ return PyObject_RichCompare(a1,a2,A); } -spami(isNumberType , PyNumber_Check) spami(truth , PyObject_IsTrue) spam2(op_add , PyNumber_Add) spam2(op_sub , PyNumber_Subtract) @@ -95,15 +94,11 @@ spam2(op_iand , PyNumber_InPlaceAnd) spam2(op_ixor , PyNumber_InPlaceXor) spam2(op_ior , PyNumber_InPlaceOr) -spami(isSequenceType , PySequence_Check) spam2(op_concat , PySequence_Concat) -spamoi(op_repeat , PySequence_Repeat) spam2(op_iconcat , PySequence_InPlaceConcat) -spamoi(op_irepeat , PySequence_InPlaceRepeat) spami2b(op_contains , PySequence_Contains) spamn2(indexOf , PySequence_Index) spamn2(countOf , PySequence_Count) -spami(isMappingType , PyMapping_Check) spam2(op_getitem , PyObject_GetItem) spam2n(op_delitem , PyObject_DelItem) spam3n(op_setitem , PyObject_SetItem) @@ -173,10 +168,6 @@ static struct PyMethodDef operator_methods[] = { -spam1o(isNumberType, - "isNumberType(a) -- Return True if a has a numeric type, False otherwise.") -spam1o(isSequenceType, - "isSequenceType(a) -- Return True if a has a sequence type, False otherwise.") spam1o(truth, "truth(a) -- Return True if a is true, False otherwise.") spam2(contains,__contains__, @@ -185,8 +176,6 @@ "indexOf(a, b) -- Return the first index of b in a.") spam1(countOf, "countOf(a, b) -- Return the number of times b occurs in a.") -spam1o(isMappingType, - "isMappingType(a) -- Return True if a has a mapping type, False otherwise.") spam1(is_, "is_(a, b) -- Same as a is b.") spam1(is_not, "is_not(a, b) -- Same as a is not b.") @@ -221,12 +210,8 @@ spam2(ior,__ior__, "ior(a, b) -- Same as a |= b.") spam2(concat,__concat__, "concat(a, b) -- Same as a + b, for a and b sequences.") -spam2(repeat,__repeat__, - "repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.") spam2(iconcat,__iconcat__, "iconcat(a, b) -- Same as a += b, for a and b sequences.") -spam2(irepeat,__irepeat__, - "irepeat(a, b) -- Same as a *= b, where a is a sequence, and b is an integer.") spam2(getitem,__getitem__, "getitem(a, b) -- Same as a[b].") spam2(setitem,__setitem__, From python-checkins at python.org Mon Jan 26 03:17:53 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 03:17:53 +0100 (CET) Subject: [Python-checkins] r68958 - in python/branches/release26-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090126021753.74C7D1E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 03:17:52 2009 New Revision: 68958 Log: Backport r68942: update powerset() recipe. Modified: python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Lib/test/test_itertools.py 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 Jan 26 03:17:52 2009 @@ -673,11 +673,9 @@ nexts = cycle(islice(nexts, pending)) def powerset(iterable): - "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" - # Recipe credited to Eric Raymond - pairs = [(2**i, x) for i, x in enumerate(iterable)] - for n in xrange(2**len(pairs)): - yield set(x for m, x in pairs if m&n) + "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 compress(data, selectors): "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" 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 Mon Jan 26 03:17:52 2009 @@ -1256,11 +1256,9 @@ ... nexts = cycle(islice(nexts, pending)) >>> def powerset(iterable): -... "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" -... # Recipe credited to Eric Raymond -... pairs = [(2**i, x) for i, x in enumerate(iterable)] -... for n in xrange(2**len(pairs)): -... yield set(x for m, x in pairs if m&n) +... "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 compress(data, selectors): ... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" @@ -1358,8 +1356,8 @@ >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] ->>> map(sorted, powerset('ab')) -[[], ['a'], ['b'], ['a', 'b']] +>>> list(powerset([1,2,3])) +[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] >>> list(compress('abcdef', [1,0,1,0,1,1])) ['a', 'c', 'e', 'f'] From python-checkins at python.org Mon Jan 26 03:22:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 03:22:03 +0100 (CET) Subject: [Python-checkins] r68959 - in python/branches/release30-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090126022203.C28841E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 03:22:01 2009 New Revision: 68959 Log: Backport r68942: update powerset() recipe. Modified: python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Lib/test/test_itertools.py 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 Jan 26 03:22:01 2009 @@ -590,11 +590,9 @@ nexts = cycle(islice(nexts, pending)) def powerset(iterable): - "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" - # Recipe credited to Eric Raymond - pairs = [(2**i, x) for i, x in enumerate(iterable)] - for n in xrange(2**len(pairs)): - yield set(x for m, x in pairs if m&n) + "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 compress(data, selectors): "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" 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 Mon Jan 26 03:22:01 2009 @@ -1277,11 +1277,9 @@ ... nexts = cycle(islice(nexts, pending)) >>> def powerset(iterable): -... "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" -... # Recipe credited to Eric Raymond -... pairs = [(2**i, x) for i, x in enumerate(iterable)] -... for n in range(2**len(pairs)): -... yield set(x for m, x in pairs if m&n) +... "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 compress(data, selectors): ... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" @@ -1379,8 +1377,8 @@ >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] ->>> list(map(sorted, powerset('ab'))) -[[], ['a'], ['b'], ['a', 'b']] +>>> list(powerset([1,2,3])) +[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] >>> list(compress('abcdef', [1,0,1,0,1,1])) ['a', 'c', 'e', 'f'] From python-checkins at python.org Mon Jan 26 03:23:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 03:23:51 +0100 (CET) Subject: [Python-checkins] r68960 - in python/branches/py3k: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090126022351.114061E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 03:23:50 2009 New Revision: 68960 Log: Backport r68942: update powerset() recipe. Modified: python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.py Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Mon Jan 26 03:23:50 2009 @@ -590,11 +590,9 @@ nexts = cycle(islice(nexts, pending)) def powerset(iterable): - "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" - # Recipe credited to Eric Raymond - pairs = [(2**i, x) for i, x in enumerate(iterable)] - for n in xrange(2**len(pairs)): - yield set(x for m, x in pairs if m&n) + "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 compress(data, selectors): "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" 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 Jan 26 03:23:50 2009 @@ -1277,11 +1277,9 @@ ... nexts = cycle(islice(nexts, pending)) >>> def powerset(iterable): -... "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" -... # Recipe credited to Eric Raymond -... pairs = [(2**i, x) for i, x in enumerate(iterable)] -... for n in range(2**len(pairs)): -... yield set(x for m, x in pairs if m&n) +... "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 compress(data, selectors): ... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" @@ -1379,8 +1377,8 @@ >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] ->>> list(map(sorted, powerset('ab'))) -[[], ['a'], ['b'], ['a', 'b']] +>>> list(powerset([1,2,3])) +[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] >>> list(compress('abcdef', [1,0,1,0,1,1])) ['a', 'c', 'e', 'f'] From python-checkins at python.org Mon Jan 26 03:56:58 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 03:56:58 +0100 (CET) Subject: [Python-checkins] r68961 - in python/branches/py3k: Doc/library/collections.rst Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090126025658.CF05D1E4018@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 03:56:58 2009 New Revision: 68961 Log: Forward port r68941 adding itertools.compress(). Modified: python/branches/py3k/Doc/library/collections.rst 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/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Mon Jan 26 03:56:58 2009 @@ -286,7 +286,7 @@ Section 4.6.3, Exercise 19*\. * To enumerate all distinct multisets of a given size over a given set of - elements, see the :func:`combinations_with_replacement` function in the + elements, see :func:`combinations_with_replacement` in the :ref:`itertools-recipes` for itertools:: map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Mon Jan 26 03:56:58 2009 @@ -133,6 +133,20 @@ The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` or zero when ``r > n``. +.. function:: compress(data, selectors) + + Make an iterator that filters elements from *data* returning only those that + have a corresponding element in *selectors* that evaluates to ``True``. + Stops when either the *data* or *selectors* iterables have been exhausted. + Equivalent to:: + + def compress(data, selectors): + # 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 + + .. function:: count([n]) Make an iterator that returns consecutive integers starting with *n*. If not @@ -594,10 +608,6 @@ s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) - def compress(data, selectors): - "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" - return (d for d, s in zip(data, selectors) if s) - def combinations_with_replacement(iterable, r): "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" # number items returned: (n+r-1)! / r! / (n-1)! 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 Jan 26 03:56:58 2009 @@ -195,6 +195,21 @@ self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1) + def test_compress(self): + 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')) + self.assertEqual(list(compress('ABCDEF', [1,0,1])), list('AC')) + self.assertEqual(list(compress('ABC', [0,1,1,1,1,1])), list('BC')) + n = 10000 + data = chain.from_iterable(repeat(range(6), n)) + selectors = chain.from_iterable(repeat((0, 1))) + self.assertEqual(list(compress(data, selectors)), [1,3,5] * n) + self.assertRaises(TypeError, compress, None, range(6)) # 1st arg not iterable + self.assertRaises(TypeError, compress, range(6), None) # 2nd arg not iterable + self.assertRaises(TypeError, compress, range(6)) # too few args + self.assertRaises(TypeError, compress, range(6), None) # too many args + def test_count(self): self.assertEqual(lzip('abc',count()), [('a', 0), ('b', 1), ('c', 2)]) self.assertEqual(lzip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)]) @@ -715,6 +730,9 @@ self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) + def test_compress(self): + self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) + def test_count(self): self.assertEqual(list(islice(count(10), 5)), [10, 11, 12, 13, 14]) @@ -795,6 +813,10 @@ a = [] self.makecycle(combinations([1,2,a,3], 3), a) + def test_compress(self): + a = [] + self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) @@ -948,6 +970,15 @@ self.assertRaises(TypeError, list, chain(N(s))) self.assertRaises(ZeroDivisionError, list, chain(E(s))) + def test_compress(self): + for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)): + n = len(s) + for g in (G, I, Ig, S, L, R): + self.assertEqual(list(compress(g(s), repeat(1))), list(g(s))) + self.assertRaises(TypeError, compress, X(s), repeat(1)) + self.assertRaises(TypeError, compress, N(s), repeat(1)) + self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1))) + def test_product(self): for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)): self.assertRaises(TypeError, product, X(s)) @@ -1144,7 +1175,7 @@ def test_keywords_in_subclass(self): # count is not subclassable... for cls in (repeat, zip, filter, filterfalse, chain, map, - starmap, islice, takewhile, dropwhile, cycle): + starmap, islice, takewhile, dropwhile, cycle, compress): class Subclass(cls): def __init__(self, newarg=None, *args): cls.__init__(self, *args) @@ -1281,10 +1312,6 @@ ... s = list(iterable) ... return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) ->>> def compress(data, selectors): -... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" -... return (d for d, s in zip(data, selectors) if s) - >>> def combinations_with_replacement(iterable, r): ... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" ... pool = tuple(iterable) @@ -1380,9 +1407,6 @@ >>> list(powerset([1,2,3])) [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] ->>> list(compress('abcdef', [1,0,1,0,1,1])) -['a', 'c', 'e', 'f'] - >>> list(combinations_with_replacement('abc', 2)) [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Jan 26 03:56:58 2009 @@ -150,6 +150,8 @@ - Issue #4863: distutils.mwerkscompiler has been removed. +- Added a new function: itertools.compress(). + - 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 Mon Jan 26 03:56:58 2009 @@ -2331,6 +2331,162 @@ }; +/* compress object ************************************************************/ + +/* Equivalent to: + + def compress(data, selectors): + "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" + return (d for d, s in zip(data, selectors) if s) +*/ + +typedef struct { + PyObject_HEAD + PyObject *data; + PyObject *selectors; +} compressobject; + +static PyTypeObject compress_type; + +static PyObject * +compress_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + 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)) + return NULL; + + data = PyObject_GetIter(seq1); + if (data == NULL) + goto fail; + selectors = PyObject_GetIter(seq2); + if (selectors == NULL) + goto fail; + + /* create compressobject structure */ + lz = (compressobject *)type->tp_alloc(type, 0); + if (lz == NULL) + goto fail; + lz->data = data; + lz->selectors = selectors; + return (PyObject *)lz; + +fail: + Py_XDECREF(data); + Py_XDECREF(selectors); + return NULL; +} + +static void +compress_dealloc(compressobject *lz) +{ + PyObject_GC_UnTrack(lz); + Py_XDECREF(lz->data); + Py_XDECREF(lz->selectors); + Py_TYPE(lz)->tp_free(lz); +} + +static int +compress_traverse(compressobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->data); + Py_VISIT(lz->selectors); + return 0; +} + +static PyObject * +compress_next(compressobject *lz) +{ + PyObject *data = lz->data, *selectors = lz->selectors; + PyObject *datum, *selector; + PyObject *(*datanext)(PyObject *) = *Py_TYPE(data)->tp_iternext; + PyObject *(*selectornext)(PyObject *) = *Py_TYPE(selectors)->tp_iternext; + int ok; + + while (1) { + /* Steps: get datum, get selector, evaluate selector. + Order is important (to match the pure python version + in terms of which input gets a chance to raise an + exception first). + */ + + datum = datanext(data); + if (datum == NULL) + return NULL; + + selector = selectornext(selectors); + if (selector == NULL) { + Py_DECREF(datum); + return NULL; + } + + ok = PyObject_IsTrue(selector); + Py_DECREF(selector); + if (ok == 1) + return datum; + Py_DECREF(datum); + if (ok == -1) + return NULL; + } +} + +PyDoc_STRVAR(compress_doc, +"compress(data sequence, selector sequence) --> 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\ +selectors to choose the data elements."); + +static PyTypeObject compress_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.compress", /* tp_name */ + sizeof(compressobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)compress_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + compress_doc, /* tp_doc */ + (traverseproc)compress_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)compress_next, /* tp_iternext */ + 0, /* 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 */ + compress_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* filterfalse object ************************************************************/ typedef struct { @@ -3041,6 +3197,7 @@ &islice_type, &starmap_type, &chain_type, + &compress_type, &filterfalse_type, &count_type, &ziplongest_type, From buildbot at python.org Mon Jan 26 04:00:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 03:00:19 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090126030020.1A5291E4002@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/64 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: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 04:12:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 03:12:13 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090126031213.8D0F01E4002@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/41 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 04:16:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 03:16:31 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090126031631.B06731E4002@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/67 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 BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 04:16:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 03:16:34 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090126031635.0EED41E4024@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/548 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_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 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 04:29:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 03:29:53 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.x Message-ID: <20090126032953.F2D161E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.x/builds/204 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 04:35:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 03:35:49 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090126033549.9C4AA1E4002@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/176 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,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 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 Jan 26 04:44:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 04:44:49 +0100 (CET) Subject: [Python-checkins] r68962 - in python/branches/release30-maint: Doc/library/operator.rst Lib/locale.py Lib/test/test_array.py Lib/test/test_bool.py Lib/test/test_operator.py Misc/NEWS Modules/operator.c Message-ID: <20090126034449.5D2C71E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 04:44:49 2009 New Revision: 68962 Log: As discussed on python-dev, remove several operator functions isSequenceType(), isMappingType(), and isNumberType() in favor of using abstract base classes. Also, remove repeat() and irepeat() in favor of mul() and imul(). Modified: python/branches/release30-maint/Doc/library/operator.rst python/branches/release30-maint/Lib/locale.py python/branches/release30-maint/Lib/test/test_array.py python/branches/release30-maint/Lib/test/test_bool.py python/branches/release30-maint/Lib/test/test_operator.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/operator.c 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 Mon Jan 26 04:44:49 2009 @@ -221,12 +221,6 @@ Return the index of the first of occurrence of *b* in *a*. -.. function:: repeat(a, b) - __repeat__(a, b) - - Return ``a * b`` where *a* is a sequence and *b* is an integer. - - .. function:: setitem(a, b, c) __setitem__(a, b, c) @@ -294,13 +288,6 @@ ``a = ipow(a, b)`` is equivalent to ``a **= b``. -.. function:: irepeat(a, b) - __irepeat__(a, b) - - ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and - *b* is an integer. - - .. function:: irshift(a, b) __irshift__(a, b) @@ -324,67 +311,6 @@ ``a = ixor(a, b)`` is equivalent to ``a ^= b``. - -The :mod:`operator` module also defines a few predicates to test the type of -objects. - -.. XXX just remove them? -.. note:: - - Be careful not to misinterpret the results of these functions; none have any - measure of reliability with instance objects. - For example: - - >>> class C: - ... pass - ... - >>> import operator - >>> obj = C() - >>> operator.isMappingType(obj) - True - -.. note:: - - Since there are now abstract classes for collection types, you should write, - for example, ``isinstance(obj, collections.Mapping)`` and ``isinstance(obj, - collections.Sequence)``. - -.. function:: isMappingType(obj) - - 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) - - 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) - - 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__`. - - .. 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. @@ -513,8 +439,6 @@ +-----------------------+-------------------------+---------------------------------+ | Right Shift | ``a >> b`` | ``rshift(a, b)`` | +-----------------------+-------------------------+---------------------------------+ -| Sequence Repetition | ``seq * i`` | ``repeat(seq, i)`` | -+-----------------------+-------------------------+---------------------------------+ | String Formatting | ``s % obj`` | ``mod(s, obj)`` | +-----------------------+-------------------------+---------------------------------+ | Subtraction | ``a - b`` | ``sub(a, b)`` | Modified: python/branches/release30-maint/Lib/locale.py ============================================================================== --- python/branches/release30-maint/Lib/locale.py (original) +++ python/branches/release30-maint/Lib/locale.py Mon Jan 26 04:44:49 2009 @@ -187,7 +187,7 @@ formatted = _group(formatted, monetary=monetary)[0] return formatted -import re, operator +import re, collections _percent_re = re.compile(r'%(?:\((?P.*?)\))?' r'(?P[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]') @@ -207,7 +207,7 @@ del new_val[i+1:i+1+starcount] i += (1 + starcount) val = tuple(new_val) - elif operator.isMappingType(val): + elif isinstance(val, collections.Mapping): for perc in percents: key = perc.group("key") val[key] = format(perc.group(), val[key], grouping) Modified: python/branches/release30-maint/Lib/test/test_array.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_array.py (original) +++ python/branches/release30-maint/Lib/test/test_array.py Mon Jan 26 04:44:49 2009 @@ -725,8 +725,6 @@ self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) self.assertRaises(BufferError, operator.delitem, a, 0) self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) - self.assertRaises(BufferError, operator.irepeat, a, 2) - self.assertRaises(BufferError, operator.irepeat, a, 0) def test_weakref(self): s = array.array(self.typecode, self.example) Modified: python/branches/release30-maint/Lib/test/test_bool.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_bool.py (original) +++ python/branches/release30-maint/Lib/test/test_bool.py Mon Jan 26 04:44:49 2009 @@ -245,16 +245,10 @@ import operator self.assertIs(operator.truth(0), False) self.assertIs(operator.truth(1), True) - self.assertIs(operator.isNumberType(None), False) - self.assertIs(operator.isNumberType(0), True) self.assertIs(operator.not_(1), False) self.assertIs(operator.not_(0), True) - self.assertIs(operator.isSequenceType(0), False) - self.assertIs(operator.isSequenceType([]), True) self.assertIs(operator.contains([], 1), False) self.assertIs(operator.contains([1], 1), True) - self.assertIs(operator.isMappingType(1), False) - self.assertIs(operator.isMappingType({}), True) self.assertIs(operator.lt(0, 0), False) self.assertIs(operator.lt(0, 1), True) self.assertIs(operator.is_(True, True), True) Modified: python/branches/release30-maint/Lib/test/test_operator.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_operator.py (original) +++ python/branches/release30-maint/Lib/test/test_operator.py Mon Jan 26 04:44:49 2009 @@ -164,31 +164,6 @@ self.failUnlessRaises(TypeError, operator.invert, None) self.assertEqual(operator.inv(4), -5) - def test_isMappingType(self): - self.failUnlessRaises(TypeError, operator.isMappingType) - self.failIf(operator.isMappingType(1)) - self.failIf(operator.isMappingType(operator.isMappingType)) - self.failUnless(operator.isMappingType(operator.__dict__)) - self.failUnless(operator.isMappingType({})) - - def test_isNumberType(self): - self.failUnlessRaises(TypeError, operator.isNumberType) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8j)) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8.3)) - self.failIf(operator.isNumberType(dir())) - - def test_isSequenceType(self): - self.failUnlessRaises(TypeError, operator.isSequenceType) - self.failUnless(operator.isSequenceType(dir())) - self.failUnless(operator.isSequenceType(())) - self.failUnless(operator.isSequenceType(range(10))) - self.failUnless(operator.isSequenceType('yeahbuddy')) - self.failIf(operator.isSequenceType(3)) - class Dict(dict): pass - self.failIf(operator.isSequenceType(Dict())) - def test_lshift(self): self.failUnlessRaises(TypeError, operator.lshift) self.failUnlessRaises(TypeError, operator.lshift, None, 42) @@ -235,31 +210,6 @@ self.assertRaises(TypeError, operator.pow, 1) self.assertRaises(TypeError, operator.pow, 1, 2, 3) - def test_repeat(self): - a = list(range(3)) - self.failUnlessRaises(TypeError, operator.repeat) - self.failUnlessRaises(TypeError, operator.repeat, a, None) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == []) - a = (1, 2, 3) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == ()) - a = '123' - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == '') - a = Seq1([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - a = Seq2([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - self.failUnlessRaises(TypeError, operator.repeat, 6, 7) - def test_rshift(self): self.failUnlessRaises(TypeError, operator.rshift) self.failUnlessRaises(TypeError, operator.rshift, None, 42) @@ -443,7 +393,6 @@ self.assertEqual(operator.itruediv (c, 5), "itruediv") self.assertEqual(operator.ixor (c, 5), "ixor") self.assertEqual(operator.iconcat (c, c), "iadd") - self.assertEqual(operator.irepeat (c, 5), "imul") self.assertEqual(operator.__iadd__ (c, 5), "iadd") self.assertEqual(operator.__iand__ (c, 5), "iand") self.assertEqual(operator.__ifloordiv__(c, 5), "ifloordiv") @@ -457,7 +406,6 @@ self.assertEqual(operator.__itruediv__ (c, 5), "itruediv") self.assertEqual(operator.__ixor__ (c, 5), "ixor") self.assertEqual(operator.__iconcat__ (c, c), "iadd") - self.assertEqual(operator.__irepeat__ (c, 5), "imul") def test_main(verbose=None): import sys Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Jan 26 04:44:49 2009 @@ -100,6 +100,10 @@ Library ------- +- Removed isSequenceType(), isMappingType, and isNumberType() from the + operator module; use the abstract base classes instead. Also removed + the repeat() function; use mul() instead. + - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. Modified: python/branches/release30-maint/Modules/operator.c ============================================================================== --- python/branches/release30-maint/Modules/operator.c (original) +++ python/branches/release30-maint/Modules/operator.c Mon Jan 26 04:44:49 2009 @@ -65,7 +65,6 @@ if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \ return PyObject_RichCompare(a1,a2,A); } -spami(isNumberType , PyNumber_Check) spami(truth , PyObject_IsTrue) spam2(op_add , PyNumber_Add) spam2(op_sub , PyNumber_Subtract) @@ -95,15 +94,11 @@ spam2(op_iand , PyNumber_InPlaceAnd) spam2(op_ixor , PyNumber_InPlaceXor) spam2(op_ior , PyNumber_InPlaceOr) -spami(isSequenceType , PySequence_Check) spam2(op_concat , PySequence_Concat) -spamoi(op_repeat , PySequence_Repeat) spam2(op_iconcat , PySequence_InPlaceConcat) -spamoi(op_irepeat , PySequence_InPlaceRepeat) spami2b(op_contains , PySequence_Contains) spamn2(indexOf , PySequence_Index) spamn2(countOf , PySequence_Count) -spami(isMappingType , PyMapping_Check) spam2(op_getitem , PyObject_GetItem) spam2n(op_delitem , PyObject_DelItem) spam3n(op_setitem , PyObject_SetItem) @@ -173,10 +168,6 @@ static struct PyMethodDef operator_methods[] = { -spam1o(isNumberType, - "isNumberType(a) -- Return True if a has a numeric type, False otherwise.") -spam1o(isSequenceType, - "isSequenceType(a) -- Return True if a has a sequence type, False otherwise.") spam1o(truth, "truth(a) -- Return True if a is true, False otherwise.") spam2(contains,__contains__, @@ -185,8 +176,6 @@ "indexOf(a, b) -- Return the first index of b in a.") spam1(countOf, "countOf(a, b) -- Return the number of times b occurs in a.") -spam1o(isMappingType, - "isMappingType(a) -- Return True if a has a mapping type, False otherwise.") spam1(is_, "is_(a, b) -- Same as a is b.") spam1(is_not, "is_not(a, b) -- Same as a is not b.") @@ -221,12 +210,8 @@ spam2(ior,__ior__, "ior(a, b) -- Same as a |= b.") spam2(concat,__concat__, "concat(a, b) -- Same as a + b, for a and b sequences.") -spam2(repeat,__repeat__, - "repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.") spam2(iconcat,__iconcat__, "iconcat(a, b) -- Same as a += b, for a and b sequences.") -spam2(irepeat,__irepeat__, - "irepeat(a, b) -- Same as a *= b, where a is a sequence, and b is an integer.") spam2(getitem,__getitem__, "getitem(a, b) -- Same as a[b].") spam2(setitem,__setitem__, From python-checkins at python.org Mon Jan 26 04:50:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 26 Jan 2009 04:50:45 +0100 (CET) Subject: [Python-checkins] r68963 - python/branches/py3k Message-ID: <20090126035045.7E18E1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Jan 26 04:50:45 2009 New Revision: 68963 Log: Blocked revisions 68941-68942 via svnmerge ........ r68941 | raymond.hettinger | 2009-01-25 15:04:14 -0600 (Sun, 25 Jan 2009) | 1 line Promote compress() from a recipe to being a regular itertool. ........ r68942 | raymond.hettinger | 2009-01-25 15:31:47 -0600 (Sun, 25 Jan 2009) | 1 line Improved itertools recipe for generating powerset(). ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Mon Jan 26 05:03:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 04:03:43 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090126040344.B38571E4002@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/66 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: 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 Mon Jan 26 05:26:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 04:26:33 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090126042633.EC7461E4002@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/69 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: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 05:38:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 04:38:23 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090126043823.841831E4002@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/105 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_traceback ====================================================================== ERROR: test_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/io.py", line 1496, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 06:54:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 05:54:23 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090126055424.0824B1E4002@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/185 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,raymond.hettinger 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 Mon Jan 26 07:01:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 06:01:31 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090126060132.03BCB1E4002@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/88 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: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 Mon Jan 26 09:53:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 08:53:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090126085310.1954C1E4002@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/178 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_distutils test_posix test_subprocess ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/zipfile.py", line 690, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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 solipsis at pitrou.net Mon Jan 26 15:52:40 2009 From: solipsis at pitrou.net (Antoine Pitrou) Date: Mon, 26 Jan 2009 14:52:40 +0000 (UTC) Subject: [Python-checkins] =?utf-8?q?r68962_-_in_python/branches/release30?= =?utf-8?q?-maint=3A=09Doc/library/operator=2Erst_Lib/locale=2Epy_L?= =?utf-8?q?ib/test/test=5Farray=2Epy=09Lib/test/test=5Fbool=2EpyLib?= =?utf-8?q?/test/test=5Foperator=2EpyMisc/NEWS=09Modules/operator?= =?utf-8?q?=2Ec?= References: <20090126034449.5D2C71E4002@bag.python.org> Message-ID: > Modified: python/branches/release30-maint/Lib/test/test_array.py > ============================================================================== > --- python/branches/release30-maint/Lib/test/test_array.py (original) > +++ python/branches/release30-maint/Lib/test/test_array.py Mon Jan 26 04:44:49 2009 > @@ -725,8 +725,6 @@ > self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) > self.assertRaises(BufferError, operator.delitem, a, 0) > self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) > - self.assertRaises(BufferError, operator.irepeat, a, 2) > - self.assertRaises(BufferError, operator.irepeat, a, 0) I think these tests should have been written differently, rather than removed. While operator.irepeat has disappeared, the operation being tested still exists. Regards Antoine. From python-checkins at python.org Mon Jan 26 17:52:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 17:52:22 +0100 (CET) Subject: [Python-checkins] r68964 - python/trunk/Modules/_ssl.c Message-ID: <20090126165222.F18711E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 17:52:22 2009 New Revision: 68964 Log: Fix signed/unsigned mismatch. Modified: python/trunk/Modules/_ssl.c Modified: python/trunk/Modules/_ssl.c ============================================================================== --- python/trunk/Modules/_ssl.c (original) +++ python/trunk/Modules/_ssl.c Mon Jan 26 17:52:22 2009 @@ -1542,7 +1542,7 @@ for (i = 0; i < _ssl_locks_count; i++) { _ssl_locks[i] = PyThread_allocate_lock(); if (_ssl_locks[i] == NULL) { - int j; + unsigned int j; for (j = 0; j < i; j++) { PyThread_free_lock(_ssl_locks[j]); } From python-checkins at python.org Mon Jan 26 17:53:29 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 17:53:29 +0100 (CET) Subject: [Python-checkins] r68965 - python/branches/py3k/Modules/_ssl.c Message-ID: <20090126165329.452B81E4002@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 17:53:29 2009 New Revision: 68965 Log: Fix signed/unsigned mismatch. 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 Mon Jan 26 17:53:29 2009 @@ -1592,7 +1592,7 @@ for (i = 0; i < _ssl_locks_count; i++) { _ssl_locks[i] = PyThread_allocate_lock(); if (_ssl_locks[i] == NULL) { - int j; + unsigned int j; for (j = 0; j < i; j++) { PyThread_free_lock(_ssl_locks[j]); } From python-checkins at python.org Mon Jan 26 17:54:24 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 17:54:24 +0100 (CET) Subject: [Python-checkins] r68966 - python/branches/release30-maint/Modules/_ssl.c Message-ID: <20090126165424.707FC1E4031@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 17:54:24 2009 New Revision: 68966 Log: Fix signed/unsigned mismatch. Modified: 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 Mon Jan 26 17:54:24 2009 @@ -1592,7 +1592,7 @@ for (i = 0; i < _ssl_locks_count; i++) { _ssl_locks[i] = PyThread_allocate_lock(); if (_ssl_locks[i] == NULL) { - int j; + unsigned int j; for (j = 0; j < i; j++) { PyThread_free_lock(_ssl_locks[j]); } From python-checkins at python.org Mon Jan 26 17:55:41 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 26 Jan 2009 17:55:41 +0100 (CET) Subject: [Python-checkins] r68967 - python/branches/release26-maint/Modules/_ssl.c Message-ID: <20090126165541.ABD7F1E4058@bag.python.org> Author: raymond.hettinger Date: Mon Jan 26 17:55:41 2009 New Revision: 68967 Log: Fix signed/unsigned mismatch. Modified: python/branches/release26-maint/Modules/_ssl.c Modified: python/branches/release26-maint/Modules/_ssl.c ============================================================================== --- python/branches/release26-maint/Modules/_ssl.c (original) +++ python/branches/release26-maint/Modules/_ssl.c Mon Jan 26 17:55:41 2009 @@ -1542,7 +1542,7 @@ for (i = 0; i < _ssl_locks_count; i++) { _ssl_locks[i] = PyThread_allocate_lock(); if (_ssl_locks[i] == NULL) { - int j; + unsigned int j; for (j = 0; j < i; j++) { PyThread_free_lock(_ssl_locks[j]); } From python-checkins at python.org Mon Jan 26 18:20:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 26 Jan 2009 18:20:15 +0100 (CET) Subject: [Python-checkins] r68968 - in python/branches/release26-maint: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090126172015.924391E4025@bag.python.org> Author: tarek.ziade Date: Mon Jan 26 18:20:15 2009 New Revision: 68968 Log: Merged revisions 68951 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68951 | tarek.ziade | 2009-01-26 00:34:00 +0100 (Mon, 26 Jan 2009) | 1 line Fixed #1885: --formats=tar,gztar was not working properly in the sdist command ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/sdist.py python/branches/release26-maint/Lib/distutils/tests/test_sdist.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/command/sdist.py Mon Jan 26 18:20:15 2009 @@ -458,6 +458,10 @@ self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) Modified: python/branches/release26-maint/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_sdist.py Mon Jan 26 18:20:15 2009 @@ -4,10 +4,13 @@ import shutil import zipfile from os.path import join +import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase +from distutils.errors import DistutilsExecError +from distutils.spawn import spawn CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -35,6 +38,19 @@ 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: @@ -46,15 +62,7 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - if not os.path.exists(TEMP_PKG): - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - - # 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) + self._init_tmp_pkg() # creating VCS directories with some files in them os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) @@ -68,8 +76,6 @@ self._write(join(TEMP_PKG, 'somecode', '.git', 'ok'), 'xxx') - os.chdir(TEMP_PKG) - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -103,6 +109,55 @@ # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + def test_make_distribution(self): + + self._init_tmp_pkg() + + # 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 + + # 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' + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.run() + + # making sure we have two files + dist_folder = join(TEMP_PKG, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz'] ) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Jan 26 18:20:15 2009 @@ -194,6 +194,9 @@ Library ------- +- Issue #1885: distutils. When running sdist with --formats=tar,gztar + the tar file was overriden by the gztar one. + - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. From python-checkins at python.org Mon Jan 26 18:23:20 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 26 Jan 2009 18:23:20 +0100 (CET) Subject: [Python-checkins] r68969 - in python/branches/py3k: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090126172320.7FC211E4002@bag.python.org> Author: tarek.ziade Date: Mon Jan 26 18:23:20 2009 New Revision: 68969 Log: Merged revisions 68951 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68951 | tarek.ziade | 2009-01-26 00:34:00 +0100 (Mon, 26 Jan 2009) | 1 line Fixed #1885: --formats=tar,gztar was not working properly in the sdist command ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k/Misc/NEWS 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 Jan 26 18:23:20 2009 @@ -428,6 +428,10 @@ self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) 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 Jan 26 18:23:20 2009 @@ -4,10 +4,13 @@ import shutil import zipfile from os.path import join +import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase +from distutils.errors import DistutilsExecError +from distutils.spawn import spawn CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -35,6 +38,19 @@ 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: @@ -46,15 +62,7 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - if not os.path.exists(TEMP_PKG): - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - - # 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) + self._init_tmp_pkg() # creating VCS directories with some files in them os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) @@ -68,8 +76,6 @@ self._write(join(TEMP_PKG, 'somecode', '.git', 'ok'), 'xxx') - os.chdir(TEMP_PKG) - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -103,6 +109,55 @@ # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + def test_make_distribution(self): + + self._init_tmp_pkg() + + # 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 + + # 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' + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.run() + + # making sure we have two files + dist_folder = join(TEMP_PKG, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz'] ) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz']) + 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 Jan 26 18:23:20 2009 @@ -148,6 +148,9 @@ operator module; use the abstract base classes instead. Also removed the repeat() function; use mul() instead. +- Issue #1885: distutils. When running sdist with --formats=tar,gztar + the tar file was overriden by the gztar one. + - Issue #4863: distutils.mwerkscompiler has been removed. - Added a new function: itertools.compress(). From python-checkins at python.org Mon Jan 26 18:25:44 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 26 Jan 2009 18:25:44 +0100 (CET) Subject: [Python-checkins] r68970 - in python/branches/release30-maint: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090126172544.AE53A1E4002@bag.python.org> Author: tarek.ziade Date: Mon Jan 26 18:25:44 2009 New Revision: 68970 Log: Merged revisions 68969 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68969 | tarek.ziade | 2009-01-26 18:23:20 +0100 (Mon, 26 Jan 2009) | 9 lines Merged revisions 68951 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68951 | tarek.ziade | 2009-01-26 00:34:00 +0100 (Mon, 26 Jan 2009) | 1 line Fixed #1885: --formats=tar,gztar was not working properly in the sdist command ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/sdist.py python/branches/release30-maint/Lib/distutils/tests/test_sdist.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/sdist.py (original) +++ python/branches/release30-maint/Lib/distutils/command/sdist.py Mon Jan 26 18:25:44 2009 @@ -428,6 +428,10 @@ self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) Modified: python/branches/release30-maint/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_sdist.py Mon Jan 26 18:25:44 2009 @@ -4,10 +4,13 @@ import shutil import zipfile from os.path import join +import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase +from distutils.errors import DistutilsExecError +from distutils.spawn import spawn CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -35,6 +38,19 @@ 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: @@ -46,15 +62,7 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - if not os.path.exists(TEMP_PKG): - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - - # 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) + self._init_tmp_pkg() # creating VCS directories with some files in them os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) @@ -68,8 +76,6 @@ self._write(join(TEMP_PKG, 'somecode', '.git', 'ok'), 'xxx') - os.chdir(TEMP_PKG) - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -103,6 +109,55 @@ # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + def test_make_distribution(self): + + self._init_tmp_pkg() + + # 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 + + # 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' + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.run() + + # making sure we have two files + dist_folder = join(TEMP_PKG, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz'] ) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Jan 26 18:25:44 2009 @@ -104,6 +104,9 @@ operator module; use the abstract base classes instead. Also removed the repeat() function; use mul() instead. +- Issue #1885: distutils. When running sdist with --formats=tar,gztar + the tar file was overriden by the gztar one. + - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. From buildbot at python.org Mon Jan 26 19:06:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 18:06:48 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090126180648.48DC91E4002@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/201 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: 1 test failed: test_email make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 19:40:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 18:40:13 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090126184013.85A831E4002@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/20 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: 1 test failed: test_sqlite make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 20:04:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 19:04:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090126190458.AB0121E4002@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/90 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: 2 tests failed: test_distutils test_posix ====================================================================== ERROR: test_prune_file_list (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sdist.py", line 90, in test_prune_file_list cmd.run() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 150, in run self.make_distribution() File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/command/sdist.py", line 432, in make_distribution file = self.make_archive(base_name, fmt, base_dir=base_dir) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/cmd.py", line 373, in make_archive dry_run=self.dry_run) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 160, in make_archive filename = func(base_name, base_dir, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/archive_util.py", line 97, in make_zipfile compression=zipfile.ZIP_DEFLATED) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/zipfile.py", line 678, in __init__ self.fp = io.open(file, modeDict[mode]) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 222, in open closefd) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/io.py", line 621, in __init__ _fileio._FileIO.__init__(self, name, mode, closefd) IOError: [Errno 2] No such file or directory: 'dist/fake-1.0.zip' ====================================================================== 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' sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 21:30:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 20:30:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090126203012.E05D41E4043@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/180 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 Jan 26 22:08:02 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 26 Jan 2009 22:08:02 +0100 (CET) Subject: [Python-checkins] r68972 - in doctools/converter/converter: __init__.py latexparser.py restwriter.py tokenizer.py Message-ID: <20090126210802.DF5991E4002@bag.python.org> Author: georg.brandl Date: Mon Jan 26 22:08:02 2009 New Revision: 68972 Log: add some support for math. Modified: doctools/converter/converter/__init__.py doctools/converter/converter/latexparser.py doctools/converter/converter/restwriter.py doctools/converter/converter/tokenizer.py Modified: doctools/converter/converter/__init__.py ============================================================================== --- doctools/converter/converter/__init__.py (original) +++ doctools/converter/converter/__init__.py Mon Jan 26 22:08:02 2009 @@ -3,7 +3,7 @@ Documentation converter - high level functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2007-2008 by Georg Brandl. + :copyright: 2007-2009 by Georg Brandl. :license: BSD. """ @@ -42,6 +42,7 @@ coutf.close() else: outf.close() + p.finish() # print warnings about unrecognized commands return 1, r.warnings except Exception, err: if doraise: Modified: doctools/converter/converter/latexparser.py ============================================================================== --- doctools/converter/converter/latexparser.py (original) +++ doctools/converter/converter/latexparser.py Mon Jan 26 22:08:02 2009 @@ -5,7 +5,7 @@ For more documentation, look into the ``restwriter.py`` file. - :copyright: 2007-2008 by Georg Brandl. + :copyright: 2007-2009 by Georg Brandl. :license: BSD. """ @@ -84,6 +84,16 @@ def __init__(self, tokenstream, filename): self.tokens = tokenstream self.filename = filename + self.unrecognized = set() + + def finish(self): + if len(self.unrecognized) != 0: + print '\n\nWARNING:\nThe following latex commands are not recognized and are ' \ + 'ignored by this script. You may want to extend the DocParser class and ' \ + 'define functions such as handle_CMD to handle them. You can also override '\ + 'handle_unrecognized.\n' + for cmd in self.unrecognized: + print cmd def parse(self): self.rootnode = RootNode(self.filename, None) @@ -94,16 +104,25 @@ def parse_until(self, condition=None, endatbrace=False): nodelist = NodeList() bracelevel = 0 + mathmode = False + math = '' for l, t, v, r in self.tokens: if condition and condition(t, v, bracelevel): return nodelist.flatten() - if t == 'command': + if mathmode: + if t == 'mathmode': + nodelist.append(InlineNode('math', [TextNode(math)])) + math = '' + mathmode = False + else: + math += r + elif t == 'command': if len(v) == 1 and not v.isalpha(): nodelist.append(self.handle_special_command(v)) continue handler = getattr(self, 'handle_' + v, None) if not handler: - raise ParserError('no handler for \\%s command' % v, l) + handler = self.handle_unrecognized(v, l) nodelist.append(handler()) elif t == 'bgroup': bracelevel += 1 @@ -116,7 +135,7 @@ elif t == 'tilde': nodelist.append(NbspNode()) elif t == 'mathmode': - pass # ignore math mode + mathmode = True elif t == 'parasep': nodelist.append(ParaSepNode()) else: @@ -412,6 +431,11 @@ } # ------------------------- special handlers ----------------------------- + def handle_unrecognized(self, name, line): + def handler(): + self.unrecognized.add(name) + return EmptyNode() + return handler def handle_special_command(self, cmdname): if cmdname in '{}%$^#&_ ': Modified: doctools/converter/converter/restwriter.py ============================================================================== --- doctools/converter/converter/restwriter.py (original) +++ doctools/converter/converter/restwriter.py Mon Jan 26 22:08:02 2009 @@ -956,6 +956,9 @@ # stray commands from distutils elif cmdname in ('argument name', 'value', 'attribute', 'option name'): self.visit_wrapped('*', content, '*') + elif cmdname == 'math': + math = node.args[0] + self.visit_wrapped(':math:`', math, '`') else: self.visit_wrapped(':%s:`' % (self.role_mapping[cmdname] or cmdname), self.get_textonly_node( Modified: doctools/converter/converter/tokenizer.py ============================================================================== --- doctools/converter/converter/tokenizer.py (original) +++ doctools/converter/converter/tokenizer.py Mon Jan 26 22:08:02 2009 @@ -60,7 +60,7 @@ elif self.scan(r'\n[ \t]*'): yield lineno, 'text', ' ', self.mtext lineno += 1 - elif self.scan(r'[^\\%}{\[\]~\n]+'): + elif self.scan(r'[^\\%}{\[\]~\n\$]+'): yield lineno, 'text', self.mtext, self.mtext else: raise RuntimeError('unexpected text on line %d: %r' % From python-checkins at python.org Mon Jan 26 22:29:38 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 26 Jan 2009 22:29:38 +0100 (CET) Subject: [Python-checkins] r68973 - python/trunk/Doc/documenting/markup.rst Message-ID: <20090126212938.577A21E4002@bag.python.org> Author: georg.brandl Date: Mon Jan 26 22:29:38 2009 New Revision: 68973 Log: Copy over docs on advanced role features from Sphinx docs. Modified: python/trunk/Doc/documenting/markup.rst Modified: python/trunk/Doc/documenting/markup.rst ============================================================================== --- python/trunk/Doc/documenting/markup.rst (original) +++ python/trunk/Doc/documenting/markup.rst Mon Jan 26 22:29:38 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: From python-checkins at python.org Mon Jan 26 22:36:30 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 22:36:30 +0100 (CET) Subject: [Python-checkins] r68974 - python/trunk/Objects/longobject.c Message-ID: <20090126213630.7ACFA1E400C@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 22:36:30 2009 New Revision: 68974 Log: Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. Modified: python/trunk/Objects/longobject.c Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Mon Jan 26 22:36:30 2009 @@ -1962,7 +1962,7 @@ static long long_hash(PyLongObject *v) { - long x; + unsigned long x; Py_ssize_t i; int sign; @@ -1977,17 +1977,18 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C long x such that (unsigned long)x - is congruent to the absolute value of v modulo ULONG_MAX. The - resulting x is nonzero if and only if v is. */ + /* The following loop produces a C 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 << PyLong_SHIFT) & ~PyLong_MASK) | + ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); x += v->ob_digit[i]; - /* If the addition above overflowed (thinking of x as - unsigned), we compensate by incrementing. This preserves - the value modulo ULONG_MAX. */ - if ((unsigned long)x < v->ob_digit[i]) + /* If the addition above overflowed we compensate by + incrementing. This preserves the value modulo + ULONG_MAX. */ + if (x < v->ob_digit[i]) x++; } #undef LONG_BIT_PyLong_SHIFT From python-checkins at python.org Mon Jan 26 22:40:08 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 22:40:08 +0100 (CET) Subject: [Python-checkins] r68975 - python/trunk/Objects/longobject.c Message-ID: <20090126214008.5E74E1E4042@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 22:40:08 2009 New Revision: 68975 Log: Fix comment. Modified: python/trunk/Objects/longobject.c Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Mon Jan 26 22:40:08 2009 @@ -1977,9 +1977,9 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C 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. */ + /* 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) | From python-checkins at python.org Mon Jan 26 22:43:42 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 22:43:42 +0100 (CET) Subject: [Python-checkins] r68976 - in python/branches/release26-maint: Objects/longobject.c Message-ID: <20090126214342.D1CC11E4002@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 22:43:42 2009 New Revision: 68976 Log: Merged revisions 68974-68975 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68974 | mark.dickinson | 2009-01-26 21:36:30 +0000 (Mon, 26 Jan 2009) | 4 lines Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. ........ r68975 | mark.dickinson | 2009-01-26 21:40:08 +0000 (Mon, 26 Jan 2009) | 2 lines Fix comment. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Objects/longobject.c Modified: python/branches/release26-maint/Objects/longobject.c ============================================================================== --- python/branches/release26-maint/Objects/longobject.c (original) +++ python/branches/release26-maint/Objects/longobject.c Mon Jan 26 22:43:42 2009 @@ -1962,7 +1962,7 @@ static long long_hash(PyLongObject *v) { - long x; + unsigned long x; Py_ssize_t i; int sign; @@ -1977,17 +1977,18 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C long x such that (unsigned long)x - is congruent to the absolute value of v modulo ULONG_MAX. The + /* 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 << PyLong_SHIFT) & ~PyLong_MASK) | + ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); x += v->ob_digit[i]; - /* If the addition above overflowed (thinking of x as - unsigned), we compensate by incrementing. This preserves - the value modulo ULONG_MAX. */ - if ((unsigned long)x < v->ob_digit[i]) + /* If the addition above overflowed we compensate by + incrementing. This preserves the value modulo + ULONG_MAX. */ + if (x < v->ob_digit[i]) x++; } #undef LONG_BIT_PyLong_SHIFT From python-checkins at python.org Mon Jan 26 22:48:00 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 26 Jan 2009 22:48:00 +0100 (CET) Subject: [Python-checkins] r68977 - in python/branches/py3k: Lib/test/test_cmd_line.py Python/pythonrun.c Message-ID: <20090126214800.EFF281E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 26 22:48:00 2009 New Revision: 68977 Log: Followup of #4705: we can't skip the binary buffering layer for stdin because FileIO doesn't have a read1() method Modified: python/branches/py3k/Lib/test/test_cmd_line.py python/branches/py3k/Python/pythonrun.c Modified: python/branches/py3k/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/py3k/Lib/test/test_cmd_line.py (original) +++ python/branches/py3k/Lib/test/test_cmd_line.py Mon Jan 26 22:48:00 2009 @@ -159,6 +159,16 @@ self.assertEqual(data.strip(), b'x', "text %s not line-buffered" % stream) + def test_unbuffered_input(self): + # sys.stdin still works with '-u' + code = ("import sys; sys.stdout.write(sys.stdin.read(1))") + p = _spawn_python('-u', '-c', code) + p.stdin.write(b'x') + p.stdin.flush() + data, rc = _kill_python_and_exit_code(p) + self.assertEqual(rc, 0) + self.assertEqual(data.strip(), b'x') + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Mon Jan 26 22:48:00 2009 @@ -739,7 +739,12 @@ PyObject *line_buffering; int buffering, isatty; - if (Py_UnbufferedStdioFlag) + /* stdin is always opened in buffered mode, first because it shouldn't + make a difference in common use cases, second because TextIOWrapper + depends on the presence of a read1() method which only exists on + buffered streams. + */ + if (Py_UnbufferedStdioFlag && write_mode) buffering = 0; else buffering = -1; @@ -753,7 +758,7 @@ if (buf == NULL) goto error; - if (!Py_UnbufferedStdioFlag) { + if (buffering) { raw = PyObject_GetAttrString(buf, "raw"); if (raw == NULL) goto error; From python-checkins at python.org Mon Jan 26 22:51:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 22:51:56 +0100 (CET) Subject: [Python-checkins] r68978 - python/trunk/Lib/bsddb/test/test_lock.py Message-ID: <20090126215156.C2AF61E406A@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 22:51:56 2009 New Revision: 68978 Log: Issue #5073: Fix occasional failure of bsddb/test/test_lock.py. Thanks Hirokazu Yamamoto for the patch. Modified: python/trunk/Lib/bsddb/test/test_lock.py Modified: python/trunk/Lib/bsddb/test/test_lock.py ============================================================================== --- python/trunk/Lib/bsddb/test/test_lock.py (original) +++ python/trunk/Lib/bsddb/test/test_lock.py Mon Jan 26 22:51:56 2009 @@ -124,7 +124,7 @@ self.env.lock_get,anID2, "shared lock", db.DB_LOCK_READ) end_time=time.time() deadlock_detection.end=True - self.assertTrue((end_time-start_time) >= 0.1) + self.assertTrue((end_time-start_time) >= 0.0999) self.env.lock_put(lock) t.join() From python-checkins at python.org Mon Jan 26 22:53:32 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 22:53:32 +0100 (CET) Subject: [Python-checkins] r68979 - in python/branches/release26-maint: Lib/bsddb/test/test_lock.py Message-ID: <20090126215332.541C01E400C@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 22:53:32 2009 New Revision: 68979 Log: Merged revisions 68978 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68978 | mark.dickinson | 2009-01-26 21:51:56 +0000 (Mon, 26 Jan 2009) | 3 lines Issue #5073: Fix occasional failure of bsddb/test/test_lock.py. Thanks Hirokazu Yamamoto for the patch. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/bsddb/test/test_lock.py Modified: python/branches/release26-maint/Lib/bsddb/test/test_lock.py ============================================================================== --- python/branches/release26-maint/Lib/bsddb/test/test_lock.py (original) +++ python/branches/release26-maint/Lib/bsddb/test/test_lock.py Mon Jan 26 22:53:32 2009 @@ -124,7 +124,7 @@ self.env.lock_get,anID2, "shared lock", db.DB_LOCK_READ) end_time=time.time() deadlock_detection.end=True - self.assertTrue((end_time-start_time) >= 0.1) + self.assertTrue((end_time-start_time) >= 0.0999) self.env.lock_put(lock) t.join() From python-checkins at python.org Mon Jan 26 22:56:07 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 22:56:07 +0100 (CET) Subject: [Python-checkins] r68980 - in python/branches/py3k: Objects/longobject.c Message-ID: <20090126215607.3C0591E4002@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 22:56:07 2009 New Revision: 68980 Log: Merged revisions 68974-68975 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68974 | mark.dickinson | 2009-01-26 21:36:30 +0000 (Mon, 26 Jan 2009) | 4 lines Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. ........ r68975 | mark.dickinson | 2009-01-26 21:40:08 +0000 (Mon, 26 Jan 2009) | 2 lines Fix comment. ........ 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 Mon Jan 26 22:56:07 2009 @@ -2274,7 +2274,7 @@ static long long_hash(PyLongObject *v) { - long x; + unsigned long x; Py_ssize_t i; int sign; @@ -2294,17 +2294,18 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C long x such that (unsigned long)x - is congruent to the absolute value of v modulo ULONG_MAX. The + /* 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 << PyLong_SHIFT) & ~PyLong_MASK) | + ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); x += v->ob_digit[i]; - /* If the addition above overflowed (thinking of x as - unsigned), we compensate by incrementing. This preserves - the value modulo ULONG_MAX. */ - if ((unsigned long)x < v->ob_digit[i]) + /* If the addition above overflowed we compensate by + incrementing. This preserves the value modulo + ULONG_MAX. */ + if (x < v->ob_digit[i]) x++; } #undef LONG_BIT_PyLong_SHIFT From python-checkins at python.org Mon Jan 26 23:00:21 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 26 Jan 2009 23:00:21 +0100 (CET) Subject: [Python-checkins] r68981 - python/branches/py3k/Lib/test/test_cmd_line.py Message-ID: <20090126220021.E10AC1E4030@bag.python.org> Author: antoine.pitrou Date: Mon Jan 26 23:00:21 2009 New Revision: 68981 Log: Fix test so as to also pass in debug mode Modified: python/branches/py3k/Lib/test/test_cmd_line.py Modified: python/branches/py3k/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/py3k/Lib/test/test_cmd_line.py (original) +++ python/branches/py3k/Lib/test/test_cmd_line.py Mon Jan 26 23:00:21 2009 @@ -167,7 +167,7 @@ p.stdin.flush() data, rc = _kill_python_and_exit_code(p) self.assertEqual(rc, 0) - self.assertEqual(data.strip(), b'x') + self.assert_(data.startswith(b'x'), data) def test_main(): From python-checkins at python.org Mon Jan 26 23:03:09 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 26 Jan 2009 23:03:09 +0100 (CET) Subject: [Python-checkins] r68982 - in python/branches/release30-maint: Lib/test/test_cmd_line.py Python/pythonrun.c Message-ID: <20090126220309.46AB91E4002@bag.python.org> Author: antoine.pitrou Date: Mon Jan 26 23:03:09 2009 New Revision: 68982 Log: Merged revisions 68977,68981 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r68977 | antoine.pitrou | 2009-01-26 22:48:00 +0100 (lun., 26 janv. 2009) | 3 lines Followup of #4705: we can't skip the binary buffering layer for stdin because FileIO doesn't have a read1() method ........ r68981 | antoine.pitrou | 2009-01-26 23:00:21 +0100 (lun., 26 janv. 2009) | 3 lines Fix test so as to also pass in debug mode ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_cmd_line.py python/branches/release30-maint/Python/pythonrun.c Modified: python/branches/release30-maint/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_cmd_line.py (original) +++ python/branches/release30-maint/Lib/test/test_cmd_line.py Mon Jan 26 23:03:09 2009 @@ -159,6 +159,16 @@ self.assertEqual(data.strip(), b'x', "text %s not line-buffered" % stream) + def test_unbuffered_input(self): + # sys.stdin still works with '-u' + code = ("import sys; sys.stdout.write(sys.stdin.read(1))") + p = _spawn_python('-u', '-c', code) + p.stdin.write(b'x') + p.stdin.flush() + data, rc = _kill_python_and_exit_code(p) + self.assertEqual(rc, 0) + self.assert_(data.startswith(b'x'), data) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/release30-maint/Python/pythonrun.c ============================================================================== --- python/branches/release30-maint/Python/pythonrun.c (original) +++ python/branches/release30-maint/Python/pythonrun.c Mon Jan 26 23:03:09 2009 @@ -739,7 +739,12 @@ PyObject *line_buffering; int buffering, isatty; - if (Py_UnbufferedStdioFlag) + /* stdin is always opened in buffered mode, first because it shouldn't + make a difference in common use cases, second because TextIOWrapper + depends on the presence of a read1() method which only exists on + buffered streams. + */ + if (Py_UnbufferedStdioFlag && write_mode) buffering = 0; else buffering = -1; @@ -753,7 +758,7 @@ if (buf == NULL) goto error; - if (!Py_UnbufferedStdioFlag) { + if (buffering) { raw = PyObject_GetAttrString(buf, "raw"); if (raw == NULL) goto error; From python-checkins at python.org Mon Jan 26 23:05:51 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 26 Jan 2009 23:05:51 +0100 (CET) Subject: [Python-checkins] r68983 - in python/branches/release30-maint: Objects/longobject.c Message-ID: <20090126220551.994E71E4030@bag.python.org> Author: mark.dickinson Date: Mon Jan 26 23:05:51 2009 New Revision: 68983 Log: Merged revisions 68980 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68980 | mark.dickinson | 2009-01-26 21:56:07 +0000 (Mon, 26 Jan 2009) | 14 lines Merged revisions 68974-68975 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68974 | mark.dickinson | 2009-01-26 21:36:30 +0000 (Mon, 26 Jan 2009) | 4 lines Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. ........ r68975 | mark.dickinson | 2009-01-26 21:40:08 +0000 (Mon, 26 Jan 2009) | 2 lines Fix comment. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/longobject.c Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Mon Jan 26 23:05:51 2009 @@ -2274,7 +2274,7 @@ static long long_hash(PyLongObject *v) { - long x; + unsigned long x; Py_ssize_t i; int sign; @@ -2294,17 +2294,18 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C long x such that (unsigned long)x - is congruent to the absolute value of v modulo ULONG_MAX. The + /* 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 << PyLong_SHIFT) & ~PyLong_MASK) | + ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); x += v->ob_digit[i]; - /* If the addition above overflowed (thinking of x as - unsigned), we compensate by incrementing. This preserves - the value modulo ULONG_MAX. */ - if ((unsigned long)x < v->ob_digit[i]) + /* If the addition above overflowed we compensate by + incrementing. This preserves the value modulo + ULONG_MAX. */ + if (x < v->ob_digit[i]) x++; } #undef LONG_BIT_PyLong_SHIFT From buildbot at python.org Mon Jan 26 23:26:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 22:26:56 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090126222656.3AB711E4002@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/210 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 test Excerpt from the test logfile: 1 test failed: test_cmd_line ====================================================================== FAIL: test_unbuffered_input (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_cmd_line.py", line 170, in test_unbuffered_input self.assertEqual(data.strip(), b'x') AssertionError: b'x[31484 refs]' != b'x' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Jan 26 23:35:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 22:35:15 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090126223516.0F41B1E4002@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/69 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 Mon Jan 26 23:36:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 22:36:42 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090126223642.6B2CE1E4002@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/67 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 Mon Jan 26 23:52:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 22:52:54 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090126225254.869981E4002@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/108 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_cmd_line ====================================================================== FAIL: test_unbuffered_input (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_cmd_line.py", line 170, in test_unbuffered_input self.assertEqual(data.strip(), b'x') AssertionError: b'x[31503 refs]' != b'x' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 00:06:18 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 27 Jan 2009 00:06:18 +0100 (CET) Subject: [Python-checkins] r68984 - in python/branches/release26-maint/Doc/tools/sphinxext: pyspecific.py suspicious.py Message-ID: <20090126230618.03F121E4002@bag.python.org> Author: georg.brandl Date: Tue Jan 27 00:06:17 2009 New Revision: 68984 Log: Allow docs to be built with Sphinx 0.5.x. Modified: python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py python/branches/release26-maint/Doc/tools/sphinxext/suspicious.py 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 Tue Jan 27 00:06:17 2009 @@ -48,8 +48,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/release26-maint/Doc/tools/sphinxext/suspicious.py ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/suspicious.py (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/suspicious.py Tue Jan 27 00:06:17 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 Tue Jan 27 00:21:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 23:21:48 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090126232148.C22781E4002@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/68 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') sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 00:29:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 00:29:09 +0100 (CET) Subject: [Python-checkins] r68985 - python/trunk/Lib/idlelib/PyShell.py Message-ID: <20090126232909.93C121E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 00:29:09 2009 New Revision: 68985 Log: 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. Modified: python/trunk/Lib/idlelib/PyShell.py Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Tue Jan 27 00:29:09 2009 @@ -973,15 +973,6 @@ COPYRIGHT = \ 'Type "copyright", "credits" or "license()" for more information.' - firewallmessage = """ - **************************************************************** - Personal firewall software may warn about the connection IDLE - makes to its subprocess using this computer's internal loopback - interface. This connection is not visible on any external - interface and no data is sent to or received from the Internet. - **************************************************************** - """ - def begin(self): self.resetoutput() if use_subprocess: @@ -992,9 +983,8 @@ return False else: nosub = "==== No Subprocess ====" - self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % - (sys.version, sys.platform, self.COPYRIGHT, - self.firewallmessage, idlever.IDLE_VERSION, nosub)) + self.write("Python %s on %s\n%s\n%s" % + (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.showprompt() import Tkinter Tkinter._default_root = None # 03Jan04 KBK What's this? From buildbot at python.org Tue Jan 27 00:44:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 23:44:28 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090126234428.E1D0F1E402F@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/35 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: antoine.pitrou,benjamin.peterson,brett.cannon,mark.dickinson,raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_cmd_line ====================================================================== FAIL: test_unbuffered_input (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_cmd_line.py", line 170, in test_unbuffered_input self.assertEqual(data.strip(), b'x') AssertionError: b'x[31490 refs]' != b'x' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 00:51:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 26 Jan 2009 23:51:12 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090126235112.B313F1E4024@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/189 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_cmd_line ====================================================================== FAIL: test_unbuffered_input (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_cmd_line.py", line 170, in test_unbuffered_input self.assertEqual(data.strip(), b'x') AssertionError: b'x[31484 refs]' != b'x' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 01:19:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 00:19:05 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090127001905.5A2531E402B@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/169 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_cmd_line ====================================================================== FAIL: test_unbuffered_input (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_cmd_line.py", line 170, in test_unbuffered_input self.assertEqual(data.strip(), b'x') AssertionError: b'x[31484 refs]' != b'x' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 01:28:37 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 01:28:37 +0100 (CET) Subject: [Python-checkins] r68986 - python/branches/py3k/Lib/idlelib/PyShell.py Message-ID: <20090127002837.1622D1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 01:28:36 2009 New Revision: 68986 Log: Forward port r68985: Idle startup message. Modified: python/branches/py3k/Lib/idlelib/PyShell.py Modified: python/branches/py3k/Lib/idlelib/PyShell.py ============================================================================== --- python/branches/py3k/Lib/idlelib/PyShell.py (original) +++ python/branches/py3k/Lib/idlelib/PyShell.py Tue Jan 27 01:28:36 2009 @@ -963,15 +963,6 @@ COPYRIGHT = \ 'Type "copyright", "credits" or "license()" for more information.' - firewallmessage = """ - **************************************************************** - Personal firewall software may warn about the connection IDLE - makes to its subprocess using this computer's internal loopback - interface. This connection is not visible on any external - interface and no data is sent to or received from the Internet. - **************************************************************** - """ - def begin(self): self.text.mark_set("iomark", "insert") self.resetoutput() @@ -983,9 +974,8 @@ return False else: nosub = "==== No Subprocess ====" - self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % - (sys.version, sys.platform, self.COPYRIGHT, - self.firewallmessage, idlever.IDLE_VERSION, nosub)) + self.write("Python %s on %s\n%s\n%s" % + (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.showprompt() import tkinter tkinter._default_root = None # 03Jan04 KBK What's this? From python-checkins at python.org Tue Jan 27 01:29:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 01:29:35 +0100 (CET) Subject: [Python-checkins] r68987 - python/branches/release30-maint/Lib/idlelib/PyShell.py Message-ID: <20090127002935.DED7F1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 01:29:35 2009 New Revision: 68987 Log: Forward port r68985: Idle startup message. Modified: python/branches/release30-maint/Lib/idlelib/PyShell.py Modified: python/branches/release30-maint/Lib/idlelib/PyShell.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/PyShell.py (original) +++ python/branches/release30-maint/Lib/idlelib/PyShell.py Tue Jan 27 01:29:35 2009 @@ -963,15 +963,6 @@ COPYRIGHT = \ 'Type "copyright", "credits" or "license()" for more information.' - firewallmessage = """ - **************************************************************** - Personal firewall software may warn about the connection IDLE - makes to its subprocess using this computer's internal loopback - interface. This connection is not visible on any external - interface and no data is sent to or received from the Internet. - **************************************************************** - """ - def begin(self): self.text.mark_set("iomark", "insert") self.resetoutput() @@ -983,9 +974,8 @@ return False else: nosub = "==== No Subprocess ====" - self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % - (sys.version, sys.platform, self.COPYRIGHT, - self.firewallmessage, idlever.IDLE_VERSION, nosub)) + self.write("Python %s on %s\n%s\n%s" % + (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.showprompt() import tkinter tkinter._default_root = None # 03Jan04 KBK What's this? From buildbot at python.org Tue Jan 27 02:00:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 01:00:25 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090127010025.1B2A51E4002@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/92 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,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 Tue Jan 27 02:04:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 01:04:57 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090127010457.7D6ED1E4002@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/110 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 02:18:41 2009 From: python-checkins at python.org (guilherme.polo) Date: Tue, 27 Jan 2009 02:18:41 +0100 (CET) Subject: [Python-checkins] r68988 - sandbox/trunk/ttk-gsoc/README Message-ID: <20090127011841.EFE7D1E400C@bag.python.org> Author: guilherme.polo Date: Tue Jan 27 02:18:41 2009 New Revision: 68988 Log: Some small fixes and updated the list of Python versions tested. Modified: sandbox/trunk/ttk-gsoc/README Modified: sandbox/trunk/ttk-gsoc/README ============================================================================== --- sandbox/trunk/ttk-gsoc/README (original) +++ sandbox/trunk/ttk-gsoc/README Tue Jan 27 02:18:41 2009 @@ -4,15 +4,17 @@ Testing Code ------------ -You will need Python with a _tkinter compiled against Tcl/Tk 8.5[1] +You will need Python with a _tkinter compiled against Tcl/Tk 8.5[1], otherwise Tile[2] has to be installed. I have tested it under Linux -with python 2.5.2 (Ubuntu package), python-trunk, release25-maint and -py3k repos and under Windows XP with python 2.5.1 and python 2.6b1. +with all the Python 2.5.x releases, Python 2.6, Python 3.0, as well +the python-trunk and py3k repos, and, under Windows XP with python 2.5.1 +and python 2.6. Given that your system meet the requirements, you should be able to run -the samples passing the appropriate PYTHONPATH (ttk-gsoc/src/2.x or -ttk-gsoc/src/3.x depending on your python version) or placing the ttk -module somewhere in sys.path. +the tests with an appropriated PYTHONPATH (ttk-gsoc/src/2.x or +ttk-gsoc/src/3.x depending on your Python version) or placing the ttk +module somewhere in sys.path. If any test fail, report it as a bug. + If you are not sure if you have Tile installed correctly or if your tkinter is compiled against Tk 8.5, try running the test suite: @@ -34,13 +36,13 @@ There are just ttk.rst and tk.rst.diff files at Doc/library and while you could read the ttk.rst with any editor you will probably want to read it -nicely formatted as html. -To generate this html, you will have to checkout the python trunk +in a better format. +To generate html from ttk.rst you will need to checkout the python trunk repository (the one I tested with the docs): $ svn co http://svn.python.org/projects/python/trunk python-trunk -And then, optionally, apply tk.rst.diff using patch -p0 < file.diff. Next +And then, optionally, apply tk.rst.diff using patch -p0 < tk.rst.diff. Next you have to place ttk-gsoc/Doc/library/ttk.rst in python-trunk/Doc/library and then cd into python-trunk/Doc/library and do: From python-checkins at python.org Tue Jan 27 02:20:08 2009 From: python-checkins at python.org (guilherme.polo) Date: Tue, 27 Jan 2009 02:20:08 +0100 (CET) Subject: [Python-checkins] r68989 - in sandbox/trunk/ttk-gsoc: Doc/library/ttk.rst src/2.x/test/test_treeview.py src/2.x/ttk.py src/3.x/test/test_treeview.py src/3.x/ttk.py Message-ID: <20090127012008.D8D351E4030@bag.python.org> Author: guilherme.polo Date: Tue Jan 27 02:20:08 2009 New Revision: 68989 Log: Changed signature of Treeview.delete (to better), added tests for it and updated doc to match current code. Modified: sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py sandbox/trunk/ttk-gsoc/src/2.x/ttk.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Modified: sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst ============================================================================== --- sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst (original) +++ sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst Tue Jan 27 02:20:08 2009 @@ -11,7 +11,7 @@ The :mod:`ttk` module provides access to the Tk themed widget set, which has been introduced in Tk 8.5. If you do not have Python compiled against Tk 8.5 you may still use this module as long as you have Tile installed, but -then you will miss some features of the new Tk, like anti-aliased font +then you will miss some features provided by the new Tk, like anti-aliased font rendering under X11, window transparency (on X11 you will need a composition window manager) and others. @@ -274,7 +274,7 @@ which flags were changed. If *statespec* is not specified, returns the currently-enabled state flags. - Note that *statespec* is always expected to be a sequence. + *statespec* will usually be a list or a tuple. Combobox @@ -890,7 +890,7 @@ To configure the tree column, call this with column = "#0" - .. method:: delete(items) + .. method:: delete(*items) Delete all specified *items* and all their descendants. @@ -1009,14 +1009,14 @@ See `Item Options`_ for the list of available points. - .. method:: item(item, **kw) + .. method:: item(item[, option[, **kw]]) Query or modify the options for the specified *item*. - If no options are specified, returns a dictionary of option/value pairs. - If a single option is specified with value None, returns the value of - that option. Otherwise, the item's options are updated with the specified - values. + If no options are given, a dict with options/values for the item is + returned. + If *option* is specified then the value for that option is returned. + Otherwise, sets the options to the corresponding values as given by *kw*. .. method:: move(item, parent, index) Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py Tue Jan 27 02:20:08 2009 @@ -110,6 +110,14 @@ self.failUnlessRaises(Tkinter.TclError, self.tv.reattach, item_id, '', 'end') + # test multiple item delete + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + self.failUnlessEqual(self.tv.get_children(), (item1, item2)) + + self.tv.delete(item1, item2) + self.failIf(self.tv.get_children()) + def test_detach_reattach(self): item_id = self.tv.insert('', 'end') Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py Tue Jan 27 02:20:08 2009 @@ -1222,7 +1222,7 @@ return _val_or_dict(kw, self.tk.call, self._w, "column", column) - def delete(self, items): + def delete(self, *items): """Delete all specified items and all their descendants. The root item may not be deleted.""" self.tk.call(self._w, "delete", items) @@ -1351,9 +1351,10 @@ def item(self, item, option=None, **kw): """Query or modify the options for the specified item. - If kw is not given, returns a dict of item option values. If option - is specified then the value for that option is returned. Otherwise, - sets the options to the corresponding values.""" + If no options are given, a dict with options/values for the item + is returned. If option is specified then the value for that option + is returned. Otherwise, sets the options to the corresponding + values as given by kw.""" if option is not None: kw[option] = None return _val_or_dict(kw, self.tk.call, self._w, "item", item) Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py Tue Jan 27 02:20:08 2009 @@ -110,6 +110,14 @@ self.failUnlessRaises(tkinter.TclError, self.tv.reattach, item_id, '', 'end') + # test multiple item delete + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + self.failUnlessEqual(self.tv.get_children(), (item1, item2)) + + self.tv.delete(item1, item2) + self.failIf(self.tv.get_children()) + def test_detach_reattach(self): item_id = self.tv.insert('', 'end') Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Tue Jan 27 02:20:08 2009 @@ -1222,7 +1222,7 @@ return _val_or_dict(kw, self.tk.call, self._w, "column", column) - def delete(self, items): + def delete(self, *items): """Delete all specified items and all their descendants. The root item may not be deleted.""" self.tk.call(self._w, "delete", items) @@ -1351,9 +1351,10 @@ def item(self, item, option=None, **kw): """Query or modify the options for the specified item. - If kw is not given, returns a dict of item option values. If option - is specified then the value for that option is returned. Otherwise, - sets the options to the corresponding values.""" + If no options are given, a dict with options/values for the item + is returned. If option is specified then the value for that option + is returned. Otherwise, sets the options to the corresponding + values as given by kw.""" if option is not None: kw[option] = None return _val_or_dict(kw, self.tk.call, self._w, "item", item) From python-checkins at python.org Tue Jan 27 02:22:20 2009 From: python-checkins at python.org (guilherme.polo) Date: Tue, 27 Jan 2009 02:22:20 +0100 (CET) Subject: [Python-checkins] r68990 - in sandbox/trunk/ttk-gsoc/samples: theming.py ttkcalendar.py widget_state.py Message-ID: <20090127012220.499191E4002@bag.python.org> Author: guilherme.polo Date: Tue Jan 27 02:22:20 2009 New Revision: 68990 Log: Bug fix on samples/widget_state.py and other minor fixes. Modified: sandbox/trunk/ttk-gsoc/samples/theming.py sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py sandbox/trunk/ttk-gsoc/samples/widget_state.py Modified: sandbox/trunk/ttk-gsoc/samples/theming.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/theming.py (original) +++ sandbox/trunk/ttk-gsoc/samples/theming.py Tue Jan 27 02:22:20 2009 @@ -215,7 +215,7 @@ sbar.grid_remove() else: sbar.grid() - + sbar.set(first, last) return wrapped Modified: sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py (original) +++ sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py Tue Jan 27 02:22:20 2009 @@ -14,6 +14,13 @@ import ttk +def get_calendar(locale, fwday): + # instantiate proper calendar class + if locale is None: + return calendar.TextCalendar(fwday) + else: + return calendar.LocaleTextCalendar(fwday, locale) + class Calendar(ttk.Frame): # XXX ToDo: critical: cget and configure @@ -40,11 +47,7 @@ ttk.Frame.__init__(self, master, **kw) - # instantiate proper calendar class - if locale is None: - self._cal = calendar.TextCalendar(fwday) - else: - self._cal = calendar.LocaleTextCalendar(fwday, locale) + self._cal = get_calendar(locale, fwday) self.__setup_styles() # creates custom styles self.__place_widgets() # pack/grid used widgets Modified: sandbox/trunk/ttk-gsoc/samples/widget_state.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/widget_state.py (original) +++ sandbox/trunk/ttk-gsoc/samples/widget_state.py Tue Jan 27 02:22:20 2009 @@ -20,7 +20,7 @@ # get default font size and family btn_font = self.style.lookup("TButton", "-font") - fsize = self.tk.eval("font configure %s -size" % btn_font) + fsize = str(self.tk.eval("font configure %s -size" % btn_font)) self.font_family = self.tk.eval("font configure %s -family" % btn_font) if ' ' in self.font_family: self.font_family = '{%s}' % self.font_family From buildbot at python.org Tue Jan 27 02:25:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 01:25:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090127012518.433A51E4002@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/46 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 Jan 27 02:33:54 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 02:33:54 +0100 (CET) Subject: [Python-checkins] r68991 - python/branches/py3k/Lib/importlib/test/extension/test_finder.py Message-ID: <20090127013354.A00611E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 27 02:33:54 2009 New Revision: 68991 Log: Move importlib.test.extension.test_finder over to importlib.test.finder_tests. Modified: python/branches/py3k/Lib/importlib/test/extension/test_finder.py 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 Tue Jan 27 02:33:54 2009 @@ -1,9 +1,10 @@ import importlib +from .. import finder_tests from . import test_path_hook import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test the finder for extension modules.""" @@ -11,9 +12,25 @@ importer = importlib.ExtensionFileImporter(test_path_hook.PATH) return importer.find_module(fullname) - def test_success(self): + def test_module(self): self.assert_(self.find_module(test_path_hook.NAME)) + def test_package(self): + # Extension modules cannot be an __init__ for a package. + pass + + def test_module_in_package(self): + # No extension module in a package available for testing. + pass + + def test_package_in_package(self): + # Extension modules cannot be an __init__ for a package. + pass + + def test_package_over_module(self): + # Extension modules cannot be an __init__ for a package. + pass + def test_failure(self): self.assert_(self.find_module('asdfjkl;') is None) From python-checkins at python.org Tue Jan 27 02:34:30 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 02:34:30 +0100 (CET) Subject: [Python-checkins] r68992 - python/branches/py3k/Lib/importlib/test/finder_tests.py Message-ID: <20090127013430.A26531E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 27 02:34:30 2009 New Revision: 68992 Log: Make importlib.test.finder_tests an ABC. Modified: python/branches/py3k/Lib/importlib/test/finder_tests.py Modified: python/branches/py3k/Lib/importlib/test/finder_tests.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/finder_tests.py (original) +++ python/branches/py3k/Lib/importlib/test/finder_tests.py Tue Jan 27 02:34:30 2009 @@ -1,39 +1,39 @@ -# top-level. -# Package. -# module in pacakge. -# Package within a package. -# At least one tests with 'path'. -# Module that is not handled. - +import abc import unittest -class FinderTests(unittest.TestCase): +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. - raise NotImplementedError + pass + @abc.abstractmethod def test_package(self): # Test importing a package. - raise NotImplementedError + 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. - raise NotImplementedError + 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. - raise NotImplementedError + pass + @abc.abstractmethod def test_package_over_module(self): # Test that packages are chosen over modules. - raise NotImplementedError + pass + @abc.abstractmethod def test_failure(self): # Test trying to find a module that cannot be handled. - raise NotImplementedError + pass From ncoghlan at gmail.com Tue Jan 27 02:36:18 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Tue, 27 Jan 2009 11:36:18 +1000 Subject: [Python-checkins] r68962 - in python/branches/release30-maint: Doc/library/operator.rst Lib/locale.py Lib/test/test_array.py Lib/test/test_bool.pyLib/test/test_operator.pyMisc/NEWS Modules/operator.c In-Reply-To: References: <20090126034449.5D2C71E4002@bag.python.org> Message-ID: <497E6512.7060200@gmail.com> Antoine Pitrou wrote: >> Modified: python/branches/release30-maint/Lib/test/test_array.py >> ============================================================================== >> --- python/branches/release30-maint/Lib/test/test_array.py (original) >> +++ python/branches/release30-maint/Lib/test/test_array.py Mon Jan 26 04:44:49 > 2009 >> @@ -725,8 +725,6 @@ >> self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) >> self.assertRaises(BufferError, operator.delitem, a, 0) >> self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) >> - self.assertRaises(BufferError, operator.irepeat, a, 2) >> - self.assertRaises(BufferError, operator.irepeat, a, 0) > > I think these tests should have been written differently, rather than removed. > While operator.irepeat has disappeared, the operation being tested still exists. Indeed, irepeat->imul would be a much better change than deleting them. One thing I was actually wondering was whether or not 2to3 can do something about these removals? That is, is it able to make the following transformations?: operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence) operator.isMappingType(obj) -> isinstance(obj, collections.Mapping) operator.isNumberType(obj) -> isinstance(obj, numbers.Number) operator.repeat(obj, n) -> operator.mul(obj, n) operator.irepeat(obj, n) -> operator.imul(obj, n) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Tue Jan 27 02:41:57 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 02:41:57 +0100 (CET) Subject: [Python-checkins] r68993 - python/branches/py3k/Lib/importlib/test/builtin/test_finder.py Message-ID: <20090127014157.DCFCB1E405E@bag.python.org> Author: brett.cannon Date: Tue Jan 27 02:41:57 2009 New Revision: 68993 Log: Move importlib.test.builtin.test_finder over to importlib.test.finder_tests. Modified: python/branches/py3k/Lib/importlib/test/builtin/test_finder.py 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 Tue Jan 27 02:41:57 2009 @@ -1,29 +1,48 @@ from importlib import machinery +from .. import finder_tests from .. import support import sys import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test find_module() for built-in modules.""" assert 'errno' in sys.builtin_module_names name = 'errno' - find_module = staticmethod(lambda name, path=None: - machinery.BuiltinImporter.find_module(name, path)) - - - def test_find_module(self): + def test_module(self): # Common case. with support.uncache(self.name): - self.assert_(self.find_module(self.name)) + self.assert_(machinery.BuiltinImporter.find_module(self.name)) + + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_module_in_package(self): + # Built-in modules cannobt be in a package. + pass + + def test_package_in_package(self): + # Built-in modules cannot be a package. + pass + + def test_package_over_module(self): + # Built-in modules cannot be a package. + pass + + def test_failure(self): + assert 'importlib' not in sys.builtin_module_names + loader = machinery.BuiltinImporter.find_module('importlib') + self.assert_(loader is None) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with support.uncache(self.name): - self.assert_(self.find_module(self.name, ['pkg']) is None) + loader = machinery.BuiltinImporter.find_module(self.name, ['pkg']) + self.assert_(loader is None) From python-checkins at python.org Tue Jan 27 02:44:41 2009 From: python-checkins at python.org (guilherme.polo) Date: Tue, 27 Jan 2009 02:44:41 +0100 (CET) Subject: [Python-checkins] r68994 - in sandbox/trunk/ttk-gsoc/src: 2.x/test/README 2.x/test/test_notebook.py 2.x/test/test_other_widgets.py 2.x/test/test_treeview.py 2.x/test/test_widgets.py 3.x/test/README 3.x/test/test_notebook.py 3.x/test/test_other_widgets.py 3.x/test/test_treeview.py 3.x/test/test_widgets.py Message-ID: <20090127014441.78E461E4002@bag.python.org> Author: guilherme.polo Date: Tue Jan 27 02:44:40 2009 New Revision: 68994 Log: Combined test_notebook, test_treeview and test_other_widgets into test_widgets. Added: sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py (contents, props changed) sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py (contents, props changed) Removed: sandbox/trunk/ttk-gsoc/src/2.x/test/test_notebook.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_other_widgets.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_notebook.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_other_widgets.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/README sandbox/trunk/ttk-gsoc/src/3.x/test/README Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/README ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/README (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/README Tue Jan 27 02:44:40 2009 @@ -9,5 +9,5 @@ before creating another one, and clean up after the test. The motivation behind this is that some tests may depend on having its window focused while it is running to work properly, and it may be hard to force focus on your - window across platforms (right now only test_traversal at test_notebook - depends on this). + window across platforms (right now only test_traversal at + test_widgets.NotebookTest depends on this). Deleted: sandbox/trunk/ttk-gsoc/src/2.x/test/test_notebook.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_notebook.py Tue Jan 27 02:44:40 2009 +++ (empty file) @@ -1,200 +0,0 @@ -import unittest -import Tkinter -import ttk - -import support - -class NotebookTest(unittest.TestCase): - - def setUp(self): - self.nb = ttk.Notebook() - self.child1 = ttk.Label() - self.child2 = ttk.Label() - self.nb.add(self.child1, text='a') - self.nb.add(self.child2, text='b') - - def tearDown(self): - self.child1.destroy() - self.child2.destroy() - self.nb.destroy() - - - def test_tab_identifiers(self): - self.nb.forget(0) - self.nb.hide(self.child2) - self.failUnlessRaises(Tkinter.TclError, self.nb.tab, self.child1) - self.failUnlessEqual(self.nb.index('end'), 1) - self.nb.add(self.child2) - self.failUnlessEqual(self.nb.index('end'), 1) - self.nb.select(self.child2) - - self.failUnless(self.nb.tab('current')) - self.nb.add(self.child1, text='a') - - self.nb.pack() - self.nb.wait_visibility() - self.failUnlessEqual(self.nb.tab('@5,5'), self.nb.tab('current')) - - for i in range(5, 100, 5): - if self.nb.tab('@%d, 5' % i, text=None) == 'a': - break - else: - self.fail("Tab with text 'a' not found") - - - def test_add_and_hidden(self): - self.failUnlessRaises(Tkinter.TclError, self.nb.hide, -1) - self.failUnlessRaises(Tkinter.TclError, self.nb.hide, 'hi') - self.failUnlessRaises(Tkinter.TclError, self.nb.hide, None) - self.failUnlessRaises(Tkinter.TclError, self.nb.add, None) - self.failUnlessRaises(Tkinter.TclError, self.nb.add, ttk.Label(), - unknown='option') - - tabs = self.nb.tabs() - self.nb.hide(self.child1) - self.nb.add(self.child1) - self.failUnlessEqual(self.nb.tabs(), tabs) - - child = ttk.Label() - self.nb.add(child, text='c') - tabs = self.nb.tabs() - - curr = self.nb.index('current') - # verify that the tab gets readded at its previous position - child2_index = self.nb.index(self.child2) - self.nb.hide(self.child2) - self.nb.add(self.child2) - self.failUnlessEqual(self.nb.tabs(), tabs) - self.failUnlessEqual(self.nb.index(self.child2), child2_index) - self.failUnless(str(self.child2) == self.nb.tabs()[child2_index]) - # but the tab next to it (not hidden) is the one selected now - self.failUnlessEqual(self.nb.index('current'), curr + 1) - - - def test_forget(self): - self.failUnlessRaises(Tkinter.TclError, self.nb.forget, -1) - self.failUnlessRaises(Tkinter.TclError, self.nb.forget, 'hi') - self.failUnlessRaises(Tkinter.TclError, self.nb.forget, None) - - tabs = self.nb.tabs() - child1_index = self.nb.index(self.child1) - self.nb.forget(self.child1) - self.failIf(str(self.child1) in self.nb.tabs()) - self.failUnlessEqual(len(tabs) - 1, len(self.nb.tabs())) - - self.nb.add(self.child1) - self.failUnlessEqual(self.nb.index(self.child1), 1) - self.failIf(child1_index == self.nb.index(self.child1)) - - - def test_index(self): - self.failUnlessRaises(Tkinter.TclError, self.nb.index, -1) - self.failUnlessRaises(Tkinter.TclError, self.nb.index, None) - - self.failUnless(isinstance(self.nb.index('end'), int)) - self.failUnlessEqual(self.nb.index(self.child1), 0) - self.failUnlessEqual(self.nb.index(self.child2), 1) - self.failUnlessEqual(self.nb.index('end'), 2) - - - def test_insert(self): - # moving tabs - tabs = self.nb.tabs() - self.nb.insert(1, tabs[0]) - self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) - self.nb.insert(self.child1, self.child2) - self.failUnlessEqual(self.nb.tabs(), tabs) - self.nb.insert('end', self.child1) - self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) - self.nb.insert('end', 0) - self.failUnlessEqual(self.nb.tabs(), tabs) - # bad moves - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 2, tabs[0]) - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, -1, tabs[0]) - - # new tab - child3 = ttk.Label() - self.nb.insert(1, child3) - self.failUnlessEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1])) - self.nb.forget(child3) - self.failUnlessEqual(self.nb.tabs(), tabs) - self.nb.insert(self.child1, child3) - self.failUnlessEqual(self.nb.tabs(), (str(child3), ) + tabs) - self.nb.forget(child3) - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 2, child3) - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, -1, child3) - - # bad inserts - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 'end', None) - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, None, 0) - self.failUnlessRaises(Tkinter.TclError, self.nb.insert, None, None) - - - def test_select(self): - self.nb.pack() - self.nb.wait_visibility() - - success = [] - tab_changed = [] - - self.child1.bind('', lambda evt: success.append(True)) - self.nb.bind('<>', - lambda evt: tab_changed.append(True)) - - self.failUnlessEqual(self.nb.select(), str(self.child1)) - self.nb.select(self.child2) - self.failUnless(success) - self.failUnlessEqual(self.nb.select(), str(self.child2)) - - self.nb.update() - self.failUnless(tab_changed) - - - def test_tab(self): - self.failUnlessRaises(Tkinter.TclError, self.nb.tab, -1) - self.failUnlessRaises(Tkinter.TclError, self.nb.tab, 'notab') - self.failUnlessRaises(Tkinter.TclError, self.nb.tab, None) - - self.failUnless(isinstance(self.nb.tab(self.child1), dict)) - self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'a') - # newer form for querying a single option - self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'a') - self.nb.tab(self.child1, text='abc') - self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'abc') - self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'abc') - - - def test_tabs(self): - self.failUnlessEqual(len(self.nb.tabs()), 2) - - self.nb.forget(self.child1) - self.nb.forget(self.child2) - - self.failUnlessEqual(self.nb.tabs(), ()) - - - def test_traversal(self): - self.nb.pack() - self.nb.wait_visibility() - - self.nb.select(0) - - support.simulate_mouse_click(self.nb, 5, 5) - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child2)) - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child1)) - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child2)) - - self.nb.tab(self.child1, text='a', underline=0) - self.nb.enable_traversal() - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child1)) - - -def test_main(): - support.run(NotebookTest) - -if __name__ == "__main__": - test_main() Deleted: sandbox/trunk/ttk-gsoc/src/2.x/test/test_other_widgets.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_other_widgets.py Tue Jan 27 02:44:40 2009 +++ (empty file) @@ -1,520 +0,0 @@ -import unittest -import Tkinter -import ttk - -import support - -class WidgetTest(unittest.TestCase): - """Tests methods available in every ttk widget.""" - - def setUp(self): - self.widget = ttk.Button() - self.widget.pack() - self.widget.wait_visibility() - - def tearDown(self): - self.widget.destroy() - - - def test_identify(self): - self.widget.update_idletasks() - self.failUnlessEqual(self.widget.identify(5, 5), "label") - self.failUnlessEqual(self.widget.identify(-1, -1), "") - - self.failUnlessRaises(Tkinter.TclError, self.widget.identify, None, 5) - self.failUnlessRaises(Tkinter.TclError, self.widget.identify, 5, None) - self.failUnlessRaises(Tkinter.TclError, self.widget.identify, 5, '') - - - def test_widget_state(self): - # XXX not sure about the portability of all these tests - self.failUnlessEqual(self.widget.state(), ()) - self.failUnlessEqual(self.widget.instate(['!disabled']), True) - - # changing from !disabled to disabled - self.failUnlessEqual(self.widget.state(['disabled']), ('!disabled', )) - # no state change - self.failUnlessEqual(self.widget.state(['disabled']), ()) - # change back to !disable but also active - self.failUnlessEqual(self.widget.state(['!disabled', 'active']), - ('!active', 'disabled')) - # no state changes, again - self.failUnlessEqual(self.widget.state(['!disabled', 'active']), ()) - self.failUnlessEqual(self.widget.state(['active', '!disabled']), ()) - - def test_cb(arg1, **kw): - return arg1, kw - self.failUnlessEqual(self.widget.instate(['!disabled'], - test_cb, "hi", **{"msg": "there"}), - ('hi', {'msg': 'there'})) - - # attempt to set invalid statespec - currstate = self.widget.state() - self.failUnlessRaises(Tkinter.TclError, self.widget.instate, - ['badstate']) - self.failUnlessRaises(Tkinter.TclError, self.widget.instate, - ['disabled', 'badstate']) - # verify that widget didn't change its state - self.failUnlessEqual(currstate, self.widget.state()) - - # ensuring that passing None as state doesn't modify current state - self.widget.state(['active', '!disabled']) - self.failUnlessEqual(self.widget.state(), ('active', )) - - -class ButtonTest(unittest.TestCase): - - def test_invoke(self): - success = [] - btn = ttk.Button(command=lambda: success.append(1)) - btn.invoke() - self.failUnless(success) - - -class CheckbuttonTest(unittest.TestCase): - - def test_invoke(self): - success = [] - def cb_test(): - success.append(1) - return "cb test called" - - cbtn = ttk.Checkbutton(command=cb_test) - # the variable automatically created by ttk.Checkbutton is actually - # undefined till we invoke the Checkbutton - self.failUnlessEqual(cbtn.state(), ('alternate', )) - self.failUnlessRaises(Tkinter.TclError, cbtn.tk.globalgetvar, - cbtn['variable']) - - res = cbtn.invoke() - self.failUnlessEqual(res, "cb test called") - self.failUnlessEqual(cbtn['onvalue'], - cbtn.tk.globalgetvar(cbtn['variable'])) - self.failUnless(success) - - cbtn['command'] = '' - res = cbtn.invoke() - self.failUnlessEqual(res, '') - self.failIf(len(success) > 1) - self.failUnlessEqual(cbtn['offvalue'], - cbtn.tk.globalgetvar(cbtn['variable'])) - - -class ComboboxTest(unittest.TestCase): - - def setUp(self): - self.combo = ttk.Combobox() - - def tearDown(self): - self.combo.destroy() - - def _show_drop_down_listbox(self): - width = self.combo.winfo_width() - self.combo.event_generate('', x=width - 5, y=5) - self.combo.event_generate('', x=width - 5, y=5) - self.combo.update_idletasks() - - - def test_virtual_event(self): - success = [] - - self.combo['values'] = [1] - self.combo.bind('<>', - lambda evt: success.append(True)) - self.combo.pack() - self.combo.wait_visibility() - - height = self.combo.winfo_height() - self._show_drop_down_listbox() - self.combo.update() - self.combo.event_generate('') - self.combo.update() - - self.failUnless(success) - - - def test_postcommand(self): - success = [] - - self.combo['postcommand'] = lambda: success.append(True) - self.combo.pack() - self.combo.wait_visibility() - - self._show_drop_down_listbox() - self.failUnless(success) - - # testing postcommand removal - self.combo['postcommand'] = '' - self._show_drop_down_listbox() - self.failUnlessEqual(len(success), 1) - - - def test_values(self): - def check_get_current(getval, currval): - self.failUnlessEqual(self.combo.get(), getval) - self.failUnlessEqual(self.combo.current(), currval) - - check_get_current('', -1) - - self.combo['values'] = ['a', 1, 'c'] - - self.combo.set('c') - check_get_current('c', 2) - - self.combo.current(0) - check_get_current('a', 0) - - self.combo.set('d') - check_get_current('d', -1) - - # testing values with empty string - self.combo.set('') - self.combo['values'] = (1, 2, '', 3) - check_get_current('', 2) - - # testing values with empty string set through configure - self.combo.configure(values=[1, '', 2]) - self.failUnlessEqual(self.combo['values'], ('1', '', '2')) - - # out of range - self.failUnlessRaises(Tkinter.TclError, self.combo.current, - len(self.combo['values'])) - # it expects an integer (or something that can be converted to int) - self.failUnlessRaises(Tkinter.TclError, self.combo.current, '') - - # testing creating combobox with empty string in values - combo2 = ttk.Combobox(values=[1, 2, '']) - self.failUnlessEqual(combo2['values'], ('1', '2', '')) - combo2.destroy() - - -class EntryTest(unittest.TestCase): - - def setUp(self): - self.entry = ttk.Entry() - - def tearDown(self): - self.entry.destroy() - - - def test_bbox(self): - self.failUnlessEqual(len(self.entry.bbox(0)), 4) - for item in self.entry.bbox(0): - self.failUnless(isinstance(item, int)) - - self.failUnlessRaises(Tkinter.TclError, self.entry.bbox, 'noindex') - self.failUnlessRaises(Tkinter.TclError, self.entry.bbox, None) - - - def test_identify(self): - self.entry.pack() - self.entry.wait_visibility() - self.entry.update_idletasks() - - self.failUnlessEqual(self.entry.identify(5, 5), "textarea") - self.failUnlessEqual(self.entry.identify(-1, -1), "") - - self.failUnlessRaises(Tkinter.TclError, self.entry.identify, None, 5) - self.failUnlessRaises(Tkinter.TclError, self.entry.identify, 5, None) - self.failUnlessRaises(Tkinter.TclError, self.entry.identify, 5, '') - - - def test_validation_options(self): - success = [] - test_invalid = lambda: success.append(True) - - self.entry['validate'] = 'none' - self.entry['validatecommand'] = lambda: False - - self.entry['invalidcommand'] = test_invalid - self.entry.validate() - self.failUnless(success) - - self.entry['invalidcommand'] = '' - self.entry.validate() - self.failUnlessEqual(len(success), 1) - - self.entry['invalidcommand'] = test_invalid - self.entry['validatecommand'] = lambda: True - self.entry.validate() - self.failUnlessEqual(len(success), 1) - - self.entry['validatecommand'] = '' - self.entry.validate() - self.failUnlessEqual(len(success), 1) - - self.entry['validatecommand'] = True - self.failUnlessRaises(Tkinter.TclError, self.entry.validate) - - - def test_validation(self): - validation = [] - def validate(to_insert): - if not 'a' <= to_insert.lower() <= 'z': - validation.append(False) - return False - validation.append(True) - return True - - self.entry['validate'] = 'key' - self.entry['validatecommand'] = self.entry.register(validate), '%S' - - self.entry.insert('end', 1) - self.entry.insert('end', 'a') - self.failUnlessEqual(validation, [False, True]) - self.failUnlessEqual(self.entry.get(), 'a') - - - def test_revalidation(self): - def validate(content): - for letter in content: - if not 'a' <= letter.lower() <= 'z': - return False - return True - - self.entry['validatecommand'] = self.entry.register(validate), '%P' - - self.entry.insert('end', 'avocado') - self.failUnlessEqual(self.entry.validate(), True) - self.failUnlessEqual(self.entry.state(), ()) - - self.entry.delete(0, 'end') - self.failUnlessEqual(self.entry.get(), '') - - self.entry.insert('end', 'a1b') - self.failUnlessEqual(self.entry.validate(), False) - self.failUnlessEqual(self.entry.state(), ('invalid', )) - - self.entry.delete(1) - self.failUnlessEqual(self.entry.validate(), True) - self.failUnlessEqual(self.entry.state(), ()) - - -class PanedwindowTest(unittest.TestCase): - - def setUp(self): - self.paned = ttk.Panedwindow() - - def tearDown(self): - self.paned.destroy() - - - def test_add(self): - # attempt to add a child that is not a direct child of the paned window - label = ttk.Label(self.paned) - child = ttk.Label(label) - self.failUnlessRaises(Tkinter.TclError, self.paned.add, child) - label.destroy() - child.destroy() - # another attempt - label = ttk.Label() - child = ttk.Label(label) - self.failUnlessRaises(Tkinter.TclError, self.paned.add, child) - child.destroy() - label.destroy() - - good_child = ttk.Label() - self.paned.add(good_child) - # re-adding a child is not accepted - self.failUnlessRaises(Tkinter.TclError, self.paned.add, good_child) - - other_child = ttk.Label(self.paned) - self.paned.add(other_child) - self.failUnlessEqual(self.paned.pane(0), self.paned.pane(1)) - self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 2) - good_child.destroy() - other_child.destroy() - self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0) - - - def test_forget(self): - self.failUnlessRaises(Tkinter.TclError, self.paned.forget, None) - self.failUnlessRaises(Tkinter.TclError, self.paned.forget, 0) - - self.paned.add(ttk.Label()) - self.paned.forget(0) - self.failUnlessRaises(Tkinter.TclError, self.paned.forget, 0) - - - def test_insert(self): - self.failUnlessRaises(Tkinter.TclError, self.paned.insert, None, 0) - self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, None) - self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, 0) - - child = ttk.Label() - child2 = ttk.Label() - child3 = ttk.Label() - - self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, child) - - self.paned.insert('end', child2) - self.paned.insert(0, child) - self.failUnlessEqual(self.paned.panes(), (str(child), str(child2))) - - self.paned.insert(0, child2) - self.failUnlessEqual(self.paned.panes(), (str(child2), str(child))) - - self.paned.insert('end', child3) - self.failUnlessEqual(self.paned.panes(), - (str(child2), str(child), str(child3))) - - # reinserting a child should move it to its current position - panes = self.paned.panes() - self.paned.insert('end', child3) - self.failUnlessEqual(panes, self.paned.panes()) - - # moving child3 to child2 position should result in child2 ending up - # in previous child position and child ending up in previous child3 - # position - self.paned.insert(child2, child3) - self.failUnlessEqual(self.paned.panes(), - (str(child3), str(child2), str(child))) - - - def test_pane(self): - self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0) - - child = ttk.Label() - self.paned.add(child) - self.failUnless(isinstance(self.paned.pane(0), dict)) - self.failUnlessEqual(self.paned.pane(0, weight=None), 0) - # newer form for querying a single option - self.failUnlessEqual(self.paned.pane(0, 'weight'), 0) - self.failUnlessEqual(self.paned.pane(0), self.paned.pane(str(child))) - - self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0, - badoption='somevalue') - - - def test_sashpos(self): - self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, None) - self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, '') - self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 0) - - child = ttk.Label(self.paned, text='a') - self.paned.add(child, weight=1) - self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 0) - child2 = ttk.Label(self.paned, text='b') - self.paned.add(child2) - self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 1) - - self.paned.pack(expand=True, fill='both') - self.paned.wait_visibility() - - curr_pos = self.paned.sashpos(0) - self.paned.sashpos(0, 1000) - self.failUnless(curr_pos != self.paned.sashpos(0)) - self.failUnless(isinstance(self.paned.sashpos(0), int)) - - -class RadiobuttonTest(unittest.TestCase): - - def test_invoke(self): - success = [] - def cb_test(): - success.append(1) - return "cb test called" - - myvar = Tkinter.IntVar() - cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0) - cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1) - - res = cbtn.invoke() - self.failUnlessEqual(res, "cb test called") - self.failUnlessEqual(cbtn['value'], myvar.get()) - self.failUnlessEqual(myvar.get(), - cbtn.tk.globalgetvar(cbtn['variable'])) - self.failUnless(success) - - cbtn2['command'] = '' - res = cbtn2.invoke() - self.failUnlessEqual(res, '') - self.failIf(len(success) > 1) - self.failUnlessEqual(cbtn2['value'], myvar.get()) - self.failUnlessEqual(myvar.get(), - cbtn.tk.globalgetvar(cbtn['variable'])) - - self.failUnlessEqual(str(cbtn['variable']), str(cbtn2['variable'])) - - - -class ScaleTest(unittest.TestCase): - - def setUp(self): - self.scale = ttk.Scale() - self.scale.pack() - self.scale.update() - - def tearDown(self): - self.scale.destroy() - - - def test_custom_event(self): - failure = [1, 1, 1] # will need to be empty - - funcid = self.scale.bind('<>', lambda evt: failure.pop()) - - self.scale['from'] = 10 - self.scale['from_'] = 10 - self.scale['to'] = 3 - - self.failIf(failure) - - failure = [1, 1, 1] - self.scale.configure(from_=2, to=5) - self.scale.configure(from_=0, to=-2) - self.scale.configure(to=10) - - self.failIf(failure) - - - def test_get(self): - scale_width = self.scale.winfo_width() - self.failUnlessEqual(self.scale.get(scale_width, 0), self.scale['to']) - - self.failUnlessEqual(self.scale.get(0, 0), self.scale['from']) - self.failUnlessEqual(self.scale.get(), self.scale['value']) - self.scale['value'] = 30 - self.failUnlessEqual(self.scale.get(), self.scale['value']) - - self.failUnlessRaises(Tkinter.TclError, self.scale.get, '', 0) - self.failUnlessRaises(Tkinter.TclError, self.scale.get, 0, '') - - - def test_set(self): - # set restricts the max/min values according to the current range - max = self.scale['to'] - new_max = max + 10 - self.scale.set(new_max) - self.failUnlessEqual(self.scale.get(), max) - min = self.scale['from'] - self.scale.set(min - 1) - self.failUnlessEqual(self.scale.get(), min) - - # changing directly the variable doesn't impose this limitation tho - var = Tkinter.DoubleVar() - self.scale['variable'] = var - var.set(max + 5) - self.failUnlessEqual(self.scale.get(), var.get()) - self.failUnlessEqual(self.scale.get(), max + 5) - del var - - # the same happens with the value option - self.scale['value'] = max + 10 - self.failUnlessEqual(self.scale.get(), max + 10) - self.failUnlessEqual(self.scale.get(), self.scale['value']) - - # nevertheless, note that the max/min values we can get specifying - # x, y coords are the ones according to the current range - self.failUnlessEqual(self.scale.get(0, 0), min) - self.failUnlessEqual(self.scale.get(self.scale.winfo_width(), 0), max) - - self.failUnlessRaises(Tkinter.TclError, self.scale.set, None) - - -def test_main(): - support.run(WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, - ComboboxTest, EntryTest, PanedwindowTest, ScaleTest) - -if __name__ == "__main__": - test_main() Deleted: sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_treeview.py Tue Jan 27 02:44:40 2009 +++ (empty file) @@ -1,412 +0,0 @@ -import unittest -import Tkinter -import ttk - -import support -from test_functions import MockTclObj, MockStateSpec - -class TreeviewTest(unittest.TestCase): - - def setUp(self): - self.tv = ttk.Treeview() - - def tearDown(self): - self.tv.destroy() - - - def test_bbox(self): - self.tv.pack() - self.failUnlessEqual(self.tv.bbox(''), '') - self.tv.wait_visibility() - self.tv.update() - - item_id = self.tv.insert('', 'end') - children = self.tv.get_children() - self.failUnless(children) - - bbox = self.tv.bbox(children[0]) - self.failUnlessEqual(len(bbox), 4) - self.failUnless(isinstance(bbox, tuple)) - for item in bbox: - if not isinstance(item, int): - self.fail("Invalid bounding box: %s" % bbox) - break - - # compare width in bboxes - self.tv['columns'] = ['test'] - self.tv.column('test', width=50) - bbox_column0 = self.tv.bbox(children[0], 0) - root_width = self.tv.column('#0', width=None) - self.failUnlessEqual(bbox_column0[0], bbox[0] + root_width) - - # verify that bbox of a closed item is the empty string - child1 = self.tv.insert(item_id, 'end') - self.failUnlessEqual(self.tv.bbox(child1), '') - - - def test_children(self): - # no children yet, should get an empty tuple - self.failUnlessEqual(self.tv.get_children(), ()) - - item_id = self.tv.insert('', 'end') - self.failUnless(isinstance(self.tv.get_children(), tuple)) - self.failUnlessEqual(self.tv.get_children()[0], item_id) - - # add item_id and child3 as children of child2 - child2 = self.tv.insert('', 'end') - child3 = self.tv.insert('', 'end') - self.tv.set_children(child2, item_id, child3) - self.failUnlessEqual(self.tv.get_children(child2), (item_id, child3)) - - # child3 has child2 as parent, thus trying to set child2 as a children - # of child3 should result in an error - self.failUnlessRaises(Tkinter.TclError, - self.tv.set_children, child3, child2) - - # remove child2 children - self.tv.set_children(child2) - self.failUnlessEqual(self.tv.get_children(child2), ()) - - # remove root's children - self.tv.set_children('') - self.failUnlessEqual(self.tv.get_children(), ()) - - - def test_column(self): - # return a dict with all options/values - self.failUnless(isinstance(self.tv.column('#0'), dict)) - # return a single value of the given option - self.failUnless(isinstance(self.tv.column('#0', width=None), int)) - # set a new value for an option - self.tv.column('#0', width=10) - # testing new way to get option value - self.failUnlessEqual(self.tv.column('#0', 'width'), 10) - self.failUnlessEqual(self.tv.column('#0', width=None), 10) - # check read-only option - self.failUnlessRaises(Tkinter.TclError, self.tv.column, '#0', id='X') - - self.failUnlessRaises(Tkinter.TclError, self.tv.column, 'invalid') - invalid_kws = [ - {'unknown_option': 'some value'}, {'stretch': 'wrong'}, - {'anchor': 'wrong'}, {'width': 'wrong'}, {'minwidth': 'wrong'} - ] - for kw in invalid_kws: - self.failUnlessRaises(Tkinter.TclError, self.tv.column, '#0', - **kw) - - - def test_delete(self): - self.failUnlessRaises(Tkinter.TclError, self.tv.delete, '#0') - - item_id = self.tv.insert('', 'end') - item2 = self.tv.insert(item_id, 'end') - self.failUnlessEqual(self.tv.get_children(), (item_id, )) - self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) - - self.tv.delete(item_id) - self.failIf(self.tv.get_children()) - - # reattach should fail - self.failUnlessRaises(Tkinter.TclError, - self.tv.reattach, item_id, '', 'end') - - # test multiple item delete - item1 = self.tv.insert('', 'end') - item2 = self.tv.insert('', 'end') - self.failUnlessEqual(self.tv.get_children(), (item1, item2)) - - self.tv.delete(item1, item2) - self.failIf(self.tv.get_children()) - - - def test_detach_reattach(self): - item_id = self.tv.insert('', 'end') - item2 = self.tv.insert(item_id, 'end') - - # calling detach without items is valid, although it does nothing - prev = self.tv.get_children() - self.tv.detach() # this should do nothing - self.failUnlessEqual(prev, self.tv.get_children()) - - self.failUnlessEqual(self.tv.get_children(), (item_id, )) - self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) - - # detach item with children - self.tv.detach(item_id) - self.failIf(self.tv.get_children()) - - # reattach item with children - self.tv.reattach(item_id, '', 'end') - self.failUnlessEqual(self.tv.get_children(), (item_id, )) - self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) - - # move a children to the root - self.tv.move(item2, '', 'end') - self.failUnlessEqual(self.tv.get_children(), (item_id, item2)) - self.failUnlessEqual(self.tv.get_children(item_id), ()) - - # bad values - self.failUnlessRaises(Tkinter.TclError, - self.tv.reattach, 'nonexistant', '', 'end') - self.failUnlessRaises(Tkinter.TclError, - self.tv.detach, 'nonexistant') - self.failUnlessRaises(Tkinter.TclError, - self.tv.reattach, item2, 'otherparent', 'end') - self.failUnlessRaises(Tkinter.TclError, - self.tv.reattach, item2, '', 'invalid') - - # multiple detach - self.tv.detach(item_id, item2) - self.failUnlessEqual(self.tv.get_children(), ()) - self.failUnlessEqual(self.tv.get_children(item_id), ()) - - - def test_exists(self): - self.failUnlessEqual(self.tv.exists('something'), False) - self.failUnlessEqual(self.tv.exists(''), True) - self.failUnlessEqual(self.tv.exists({}), False) - - # the following will make a tk.call equivalent to - # tk.call(treeview, "exists") which should result in an error - # in the tcl interpreter since tk requires an item. - self.failUnlessRaises(Tkinter.TclError, self.tv.exists, None) - - - def test_focus(self): - # nothing is focused right now - self.failUnlessEqual(self.tv.focus(), '') - - item1 = self.tv.insert('', 'end') - self.tv.focus(item1) - self.failUnlessEqual(self.tv.focus(), item1) - - self.tv.delete(item1) - self.failUnlessEqual(self.tv.focus(), '') - - # try focusing inexistant item - self.failUnlessRaises(Tkinter.TclError, self.tv.focus, 'hi') - - - def test_heading(self): - # check a dict is returned - self.failUnless(isinstance(self.tv.heading('#0'), dict)) - - # check a value is returned - self.tv.heading('#0', text='hi') - self.failUnlessEqual(self.tv.heading('#0', 'text'), 'hi') - self.failUnlessEqual(self.tv.heading('#0', text=None), 'hi') - - # invalid option - self.failUnlessRaises(Tkinter.TclError, self.tv.heading, '#0', - background=None) - # invalid value - self.failUnlessRaises(Tkinter.TclError, self.tv.heading, '#0', - anchor=1) - - - def test_heading_callback(self): - def simulate_heading_click(x, y): - support.simulate_mouse_click(self.tv, x, y) - self.tv.update_idletasks() - - success = [] # no success for now - - self.tv.pack() - self.tv.wait_visibility() - self.tv.heading('#0', command=lambda: success.append(True)) - self.tv.column('#0', width=100) - self.tv.update() - - # assuming that the coords (5, 5) fall into heading #0 - simulate_heading_click(5, 5) - if not success: - self.fail("The command associated to the treeview heading wasn't " - "invoked.") - - success = [] - commands = self.tv.master._tclCommands - self.tv.heading('#0', command=str(self.tv.heading('#0', command=None))) - self.failUnlessEqual(commands, self.tv.master._tclCommands) - simulate_heading_click(5, 5) - if not success: - self.fail("The command associated to the treeview heading wasn't " - "invoked.") - - # XXX The following raises an error in a tcl interpreter, but not in - # Python - #self.tv.heading('#0', command='I dont exist') - #simulate_heading_click(5, 5) - - - def test_index(self): - # item 'what' doesn't exist - self.failUnlessRaises(Tkinter.TclError, self.tv.index, 'what') - - self.failUnlessEqual(self.tv.index(''), 0) - - item1 = self.tv.insert('', 'end') - item2 = self.tv.insert('', 'end') - c1 = self.tv.insert(item1, 'end') - c2 = self.tv.insert(item1, 'end') - self.failUnlessEqual(self.tv.index(item1), 0) - self.failUnlessEqual(self.tv.index(c1), 0) - self.failUnlessEqual(self.tv.index(c2), 1) - self.failUnlessEqual(self.tv.index(item2), 1) - - self.tv.move(item2, '', 0) - self.failUnlessEqual(self.tv.index(item2), 0) - self.failUnlessEqual(self.tv.index(item1), 1) - - # check that index still works even after its parent and siblings - # have been detached - self.tv.detach(item1) - self.failUnlessEqual(self.tv.index(c2), 1) - self.tv.detach(c1) - self.failUnlessEqual(self.tv.index(c2), 0) - - # but it fails after item has been deleted - self.tv.delete(item1) - self.failUnlessRaises(Tkinter.TclError, self.tv.index, c2) - - - def test_insert_item(self): - # parent 'none' doesn't exist - self.failUnlessRaises(Tkinter.TclError, self.tv.insert, 'none', 'end') - - # open values - self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', - open='') - self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', - open='please') - self.failIf(self.tv.delete(self.tv.insert('', 'end', open=True))) - self.failIf(self.tv.delete(self.tv.insert('', 'end', open=False))) - - # invalid index - self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'middle') - - # trying to duplicate item id is invalid - itemid = self.tv.insert('', 'end', 'first-item') - self.failUnlessEqual(itemid, 'first-item') - self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', - 'first-item') - self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', - MockTclObj('first-item')) - - # unicode values - value = u'\xe1ba' - item = self.tv.insert('', 'end', values=(value, )) - self.failUnlessEqual(self.tv.item(item, 'values'), (value, )) - self.failUnlessEqual(self.tv.item(item, values=None), (value, )) - - self.tv.item(item, values=list(self.tv.item(item, values=None))) - self.failUnlessEqual(self.tv.item(item, values=None), (value, )) - - self.failUnless(isinstance(self.tv.item(item), dict)) - - # erase item values - self.tv.item(item, values='') - self.failIf(self.tv.item(item, values=None)) - - # item tags - item = self.tv.insert('', 'end', tags=[1, 2, value]) - self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2', value)) - self.tv.item(item, tags=[]) - self.failIf(self.tv.item(item, tags=None)) - self.tv.item(item, tags=(1, 2)) - self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2')) - - # values with spaces - item = self.tv.insert('', 'end', values=('a b c', - '%s %s' % (value, value))) - self.failUnlessEqual(self.tv.item(item, values=None), - ('a b c', '%s %s' % (value, value))) - - # text - self.failUnlessEqual(self.tv.item( - self.tv.insert('', 'end', text="Label here"), text=None), - "Label here") - self.failUnlessEqual(self.tv.item( - self.tv.insert('', 'end', text=value), text=None), - value) - - - def test_set(self): - self.tv['columns'] = ['A', 'B'] - item = self.tv.insert('', 'end', values=['a', 'b']) - self.failUnlessEqual(self.tv.set(item), {'A': 'a', 'B': 'b'}) - - self.tv.set(item, 'B', 'a') - self.failUnlessEqual(self.tv.item(item, values=None), ('a', 'a')) - - self.tv['columns'] = ['B'] - self.failUnlessEqual(self.tv.set(item), {'B': 'a'}) - - self.tv.set(item, 'B', 'b') - self.failUnlessEqual(self.tv.set(item, column='B'), 'b') - self.failUnlessEqual(self.tv.item(item, values=None), ('b', 'a')) - - self.tv.set(item, 'B', 123) - self.failUnlessEqual(self.tv.set(item, 'B'), 123) - self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) - self.failUnlessEqual(self.tv.set(item), {'B': 123}) - - # inexistant column - self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A') - self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A', 'b') - - # inexistant item - self.failUnlessRaises(Tkinter.TclError, self.tv.set, 'notme') - - - def test_tag_bind(self): - events = [] - item1 = self.tv.insert('', 'end', tags=['call']) - item2 = self.tv.insert('', 'end', tags=['call']) - self.tv.tag_bind('call', '', - lambda evt: events.append(1)) - self.tv.tag_bind('call', '', - lambda evt: events.append(2)) - - self.tv.pack() - self.tv.wait_visibility() - self.tv.update() - - pos_y = set() - found = set() - for i in range(0, 100, 10): - if len(found) == 2: # item1 and item2 already found - break - item_id = self.tv.identify_row(i) - if item_id and item_id not in found: - pos_y.add(i) - found.add(item_id) - - self.failUnlessEqual(len(pos_y), 2) # item1 and item2 y pos - for y in pos_y: - support.simulate_mouse_click(self.tv, 0, y) - - # by now there should be 4 things in the events list, since each - # item had a bind for two events that were simulated above - self.failUnlessEqual(len(events), 4) - for evt in zip(events[::2], events[1::2]): - self.failUnlessEqual(evt, (1, 2)) - - - def test_tag_configure(self): - # Just testing parameter passing for now - self.failUnlessRaises(TypeError, self.tv.tag_configure) - self.failUnlessRaises(Tkinter.TclError, self.tv.tag_configure, - 'test', sky='blue') - self.tv.tag_configure('test', foreground='blue') - self.failUnlessEqual(self.tv.tag_configure('test', 'foreground'), - 'blue') - self.failUnlessEqual(self.tv.tag_configure('test', foreground=None), - 'blue') - self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) - - -def test_main(): - support.run(TreeviewTest) - -if __name__ == "__main__": - test_main() Added: sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py ============================================================================== --- (empty file) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py Tue Jan 27 02:44:40 2009 @@ -0,0 +1,1111 @@ +import unittest +import Tkinter +import ttk + +import support +from test_functions import MockTclObj, MockStateSpec + +class WidgetTest(unittest.TestCase): + """Tests methods available in every ttk widget.""" + + def setUp(self): + self.widget = ttk.Button() + self.widget.pack() + self.widget.wait_visibility() + + def tearDown(self): + self.widget.destroy() + + + def test_identify(self): + self.widget.update_idletasks() + self.failUnlessEqual(self.widget.identify(5, 5), "label") + self.failUnlessEqual(self.widget.identify(-1, -1), "") + + self.failUnlessRaises(Tkinter.TclError, self.widget.identify, None, 5) + self.failUnlessRaises(Tkinter.TclError, self.widget.identify, 5, None) + self.failUnlessRaises(Tkinter.TclError, self.widget.identify, 5, '') + + + def test_widget_state(self): + # XXX not sure about the portability of all these tests + self.failUnlessEqual(self.widget.state(), ()) + self.failUnlessEqual(self.widget.instate(['!disabled']), True) + + # changing from !disabled to disabled + self.failUnlessEqual(self.widget.state(['disabled']), ('!disabled', )) + # no state change + self.failUnlessEqual(self.widget.state(['disabled']), ()) + # change back to !disable but also active + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), + ('!active', 'disabled')) + # no state changes, again + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), ()) + self.failUnlessEqual(self.widget.state(['active', '!disabled']), ()) + + def test_cb(arg1, **kw): + return arg1, kw + self.failUnlessEqual(self.widget.instate(['!disabled'], + test_cb, "hi", **{"msg": "there"}), + ('hi', {'msg': 'there'})) + + # attempt to set invalid statespec + currstate = self.widget.state() + self.failUnlessRaises(Tkinter.TclError, self.widget.instate, + ['badstate']) + self.failUnlessRaises(Tkinter.TclError, self.widget.instate, + ['disabled', 'badstate']) + # verify that widget didn't change its state + self.failUnlessEqual(currstate, self.widget.state()) + + # ensuring that passing None as state doesn't modify current state + self.widget.state(['active', '!disabled']) + self.failUnlessEqual(self.widget.state(), ('active', )) + + +class ButtonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + btn = ttk.Button(command=lambda: success.append(1)) + btn.invoke() + self.failUnless(success) + + +class CheckbuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + cbtn = ttk.Checkbutton(command=cb_test) + # the variable automatically created by ttk.Checkbutton is actually + # undefined till we invoke the Checkbutton + self.failUnlessEqual(cbtn.state(), ('alternate', )) + self.failUnlessRaises(Tkinter.TclError, cbtn.tk.globalgetvar, + cbtn['variable']) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['onvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn['command'] = '' + res = cbtn.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn['offvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + + +class ComboboxTest(unittest.TestCase): + + def setUp(self): + self.combo = ttk.Combobox() + + def tearDown(self): + self.combo.destroy() + + def _show_drop_down_listbox(self): + width = self.combo.winfo_width() + self.combo.event_generate('', x=width - 5, y=5) + self.combo.event_generate('', x=width - 5, y=5) + self.combo.update_idletasks() + + + def test_virtual_event(self): + success = [] + + self.combo['values'] = [1] + self.combo.bind('<>', + lambda evt: success.append(True)) + self.combo.pack() + self.combo.wait_visibility() + + height = self.combo.winfo_height() + self._show_drop_down_listbox() + self.combo.update() + self.combo.event_generate('') + self.combo.update() + + self.failUnless(success) + + + def test_postcommand(self): + success = [] + + self.combo['postcommand'] = lambda: success.append(True) + self.combo.pack() + self.combo.wait_visibility() + + self._show_drop_down_listbox() + self.failUnless(success) + + # testing postcommand removal + self.combo['postcommand'] = '' + self._show_drop_down_listbox() + self.failUnlessEqual(len(success), 1) + + + def test_values(self): + def check_get_current(getval, currval): + self.failUnlessEqual(self.combo.get(), getval) + self.failUnlessEqual(self.combo.current(), currval) + + check_get_current('', -1) + + self.combo['values'] = ['a', 1, 'c'] + + self.combo.set('c') + check_get_current('c', 2) + + self.combo.current(0) + check_get_current('a', 0) + + self.combo.set('d') + check_get_current('d', -1) + + # testing values with empty string + self.combo.set('') + self.combo['values'] = (1, 2, '', 3) + check_get_current('', 2) + + # testing values with empty string set through configure + self.combo.configure(values=[1, '', 2]) + self.failUnlessEqual(self.combo['values'], ('1', '', '2')) + + # out of range + self.failUnlessRaises(Tkinter.TclError, self.combo.current, + len(self.combo['values'])) + # it expects an integer (or something that can be converted to int) + self.failUnlessRaises(Tkinter.TclError, self.combo.current, '') + + # testing creating combobox with empty string in values + combo2 = ttk.Combobox(values=[1, 2, '']) + self.failUnlessEqual(combo2['values'], ('1', '2', '')) + combo2.destroy() + + +class EntryTest(unittest.TestCase): + + def setUp(self): + self.entry = ttk.Entry() + + def tearDown(self): + self.entry.destroy() + + + def test_bbox(self): + self.failUnlessEqual(len(self.entry.bbox(0)), 4) + for item in self.entry.bbox(0): + self.failUnless(isinstance(item, int)) + + self.failUnlessRaises(Tkinter.TclError, self.entry.bbox, 'noindex') + self.failUnlessRaises(Tkinter.TclError, self.entry.bbox, None) + + + def test_identify(self): + self.entry.pack() + self.entry.wait_visibility() + self.entry.update_idletasks() + + self.failUnlessEqual(self.entry.identify(5, 5), "textarea") + self.failUnlessEqual(self.entry.identify(-1, -1), "") + + self.failUnlessRaises(Tkinter.TclError, self.entry.identify, None, 5) + self.failUnlessRaises(Tkinter.TclError, self.entry.identify, 5, None) + self.failUnlessRaises(Tkinter.TclError, self.entry.identify, 5, '') + + + def test_validation_options(self): + success = [] + test_invalid = lambda: success.append(True) + + self.entry['validate'] = 'none' + self.entry['validatecommand'] = lambda: False + + self.entry['invalidcommand'] = test_invalid + self.entry.validate() + self.failUnless(success) + + self.entry['invalidcommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['invalidcommand'] = test_invalid + self.entry['validatecommand'] = lambda: True + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = True + self.failUnlessRaises(Tkinter.TclError, self.entry.validate) + + + def test_validation(self): + validation = [] + def validate(to_insert): + if not 'a' <= to_insert.lower() <= 'z': + validation.append(False) + return False + validation.append(True) + return True + + self.entry['validate'] = 'key' + self.entry['validatecommand'] = self.entry.register(validate), '%S' + + self.entry.insert('end', 1) + self.entry.insert('end', 'a') + self.failUnlessEqual(validation, [False, True]) + self.failUnlessEqual(self.entry.get(), 'a') + + + def test_revalidation(self): + def validate(content): + for letter in content: + if not 'a' <= letter.lower() <= 'z': + return False + return True + + self.entry['validatecommand'] = self.entry.register(validate), '%P' + + self.entry.insert('end', 'avocado') + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + self.entry.delete(0, 'end') + self.failUnlessEqual(self.entry.get(), '') + + self.entry.insert('end', 'a1b') + self.failUnlessEqual(self.entry.validate(), False) + self.failUnlessEqual(self.entry.state(), ('invalid', )) + + self.entry.delete(1) + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + +class PanedwindowTest(unittest.TestCase): + + def setUp(self): + self.paned = ttk.Panedwindow() + + def tearDown(self): + self.paned.destroy() + + + def test_add(self): + # attempt to add a child that is not a direct child of the paned window + label = ttk.Label(self.paned) + child = ttk.Label(label) + self.failUnlessRaises(Tkinter.TclError, self.paned.add, child) + label.destroy() + child.destroy() + # another attempt + label = ttk.Label() + child = ttk.Label(label) + self.failUnlessRaises(Tkinter.TclError, self.paned.add, child) + child.destroy() + label.destroy() + + good_child = ttk.Label() + self.paned.add(good_child) + # re-adding a child is not accepted + self.failUnlessRaises(Tkinter.TclError, self.paned.add, good_child) + + other_child = ttk.Label(self.paned) + self.paned.add(other_child) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(1)) + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 2) + good_child.destroy() + other_child.destroy() + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0) + + + def test_forget(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.forget, None) + self.failUnlessRaises(Tkinter.TclError, self.paned.forget, 0) + + self.paned.add(ttk.Label()) + self.paned.forget(0) + self.failUnlessRaises(Tkinter.TclError, self.paned.forget, 0) + + + def test_insert(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, None, 0) + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, None) + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, 0) + + child = ttk.Label() + child2 = ttk.Label() + child3 = ttk.Label() + + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, child) + + self.paned.insert('end', child2) + self.paned.insert(0, child) + self.failUnlessEqual(self.paned.panes(), (str(child), str(child2))) + + self.paned.insert(0, child2) + self.failUnlessEqual(self.paned.panes(), (str(child2), str(child))) + + self.paned.insert('end', child3) + self.failUnlessEqual(self.paned.panes(), + (str(child2), str(child), str(child3))) + + # reinserting a child should move it to its current position + panes = self.paned.panes() + self.paned.insert('end', child3) + self.failUnlessEqual(panes, self.paned.panes()) + + # moving child3 to child2 position should result in child2 ending up + # in previous child position and child ending up in previous child3 + # position + self.paned.insert(child2, child3) + self.failUnlessEqual(self.paned.panes(), + (str(child3), str(child2), str(child))) + + + def test_pane(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0) + + child = ttk.Label() + self.paned.add(child) + self.failUnless(isinstance(self.paned.pane(0), dict)) + self.failUnlessEqual(self.paned.pane(0, weight=None), 0) + # newer form for querying a single option + self.failUnlessEqual(self.paned.pane(0, 'weight'), 0) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(str(child))) + + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0, + badoption='somevalue') + + + def test_sashpos(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, None) + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, '') + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 0) + + child = ttk.Label(self.paned, text='a') + self.paned.add(child, weight=1) + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 0) + child2 = ttk.Label(self.paned, text='b') + self.paned.add(child2) + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 1) + + self.paned.pack(expand=True, fill='both') + self.paned.wait_visibility() + + curr_pos = self.paned.sashpos(0) + self.paned.sashpos(0, 1000) + self.failUnless(curr_pos != self.paned.sashpos(0)) + self.failUnless(isinstance(self.paned.sashpos(0), int)) + + +class RadiobuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + myvar = Tkinter.IntVar() + cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0) + cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn2['command'] = '' + res = cbtn2.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn2['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + + self.failUnlessEqual(str(cbtn['variable']), str(cbtn2['variable'])) + + + +class ScaleTest(unittest.TestCase): + + def setUp(self): + self.scale = ttk.Scale() + self.scale.pack() + self.scale.update() + + def tearDown(self): + self.scale.destroy() + + + def test_custom_event(self): + failure = [1, 1, 1] # will need to be empty + + funcid = self.scale.bind('<>', lambda evt: failure.pop()) + + self.scale['from'] = 10 + self.scale['from_'] = 10 + self.scale['to'] = 3 + + self.failIf(failure) + + failure = [1, 1, 1] + self.scale.configure(from_=2, to=5) + self.scale.configure(from_=0, to=-2) + self.scale.configure(to=10) + + self.failIf(failure) + + + def test_get(self): + scale_width = self.scale.winfo_width() + self.failUnlessEqual(self.scale.get(scale_width, 0), self.scale['to']) + + self.failUnlessEqual(self.scale.get(0, 0), self.scale['from']) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + self.scale['value'] = 30 + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + self.failUnlessRaises(Tkinter.TclError, self.scale.get, '', 0) + self.failUnlessRaises(Tkinter.TclError, self.scale.get, 0, '') + + + def test_set(self): + # set restricts the max/min values according to the current range + max = self.scale['to'] + new_max = max + 10 + self.scale.set(new_max) + self.failUnlessEqual(self.scale.get(), max) + min = self.scale['from'] + self.scale.set(min - 1) + self.failUnlessEqual(self.scale.get(), min) + + # changing directly the variable doesn't impose this limitation tho + var = Tkinter.DoubleVar() + self.scale['variable'] = var + var.set(max + 5) + self.failUnlessEqual(self.scale.get(), var.get()) + self.failUnlessEqual(self.scale.get(), max + 5) + del var + + # the same happens with the value option + self.scale['value'] = max + 10 + self.failUnlessEqual(self.scale.get(), max + 10) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + # nevertheless, note that the max/min values we can get specifying + # x, y coords are the ones according to the current range + self.failUnlessEqual(self.scale.get(0, 0), min) + self.failUnlessEqual(self.scale.get(self.scale.winfo_width(), 0), max) + + self.failUnlessRaises(Tkinter.TclError, self.scale.set, None) + + +class NotebookTest(unittest.TestCase): + + def setUp(self): + self.nb = ttk.Notebook() + self.child1 = ttk.Label() + self.child2 = ttk.Label() + self.nb.add(self.child1, text='a') + self.nb.add(self.child2, text='b') + + def tearDown(self): + self.child1.destroy() + self.child2.destroy() + self.nb.destroy() + + + def test_tab_identifiers(self): + self.nb.forget(0) + self.nb.hide(self.child2) + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, self.child1) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.select(self.child2) + + self.failUnless(self.nb.tab('current')) + self.nb.add(self.child1, text='a') + + self.nb.pack() + self.nb.wait_visibility() + self.failUnlessEqual(self.nb.tab('@5,5'), self.nb.tab('current')) + + for i in range(5, 100, 5): + if self.nb.tab('@%d, 5' % i, text=None) == 'a': + break + else: + self.fail("Tab with text 'a' not found") + + + def test_add_and_hidden(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.hide, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.hide, 'hi') + self.failUnlessRaises(Tkinter.TclError, self.nb.hide, None) + self.failUnlessRaises(Tkinter.TclError, self.nb.add, None) + self.failUnlessRaises(Tkinter.TclError, self.nb.add, ttk.Label(), + unknown='option') + + tabs = self.nb.tabs() + self.nb.hide(self.child1) + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.tabs(), tabs) + + child = ttk.Label() + self.nb.add(child, text='c') + tabs = self.nb.tabs() + + curr = self.nb.index('current') + # verify that the tab gets readded at its previous position + child2_index = self.nb.index(self.child2) + self.nb.hide(self.child2) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.failUnlessEqual(self.nb.index(self.child2), child2_index) + self.failUnless(str(self.child2) == self.nb.tabs()[child2_index]) + # but the tab next to it (not hidden) is the one selected now + self.failUnlessEqual(self.nb.index('current'), curr + 1) + + + def test_forget(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.forget, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.forget, 'hi') + self.failUnlessRaises(Tkinter.TclError, self.nb.forget, None) + + tabs = self.nb.tabs() + child1_index = self.nb.index(self.child1) + self.nb.forget(self.child1) + self.failIf(str(self.child1) in self.nb.tabs()) + self.failUnlessEqual(len(tabs) - 1, len(self.nb.tabs())) + + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.index(self.child1), 1) + self.failIf(child1_index == self.nb.index(self.child1)) + + + def test_index(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.index, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.index, None) + + self.failUnless(isinstance(self.nb.index('end'), int)) + self.failUnlessEqual(self.nb.index(self.child1), 0) + self.failUnlessEqual(self.nb.index(self.child2), 1) + self.failUnlessEqual(self.nb.index('end'), 2) + + + def test_insert(self): + # moving tabs + tabs = self.nb.tabs() + self.nb.insert(1, tabs[0]) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert(self.child1, self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert('end', self.child1) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert('end', 0) + self.failUnlessEqual(self.nb.tabs(), tabs) + # bad moves + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 2, tabs[0]) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, -1, tabs[0]) + + # new tab + child3 = ttk.Label() + self.nb.insert(1, child3) + self.failUnlessEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1])) + self.nb.forget(child3) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert(self.child1, child3) + self.failUnlessEqual(self.nb.tabs(), (str(child3), ) + tabs) + self.nb.forget(child3) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 2, child3) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, -1, child3) + + # bad inserts + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 'end', None) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, None, 0) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, None, None) + + + def test_select(self): + self.nb.pack() + self.nb.wait_visibility() + + success = [] + tab_changed = [] + + self.child1.bind('', lambda evt: success.append(True)) + self.nb.bind('<>', + lambda evt: tab_changed.append(True)) + + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.select(self.child2) + self.failUnless(success) + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.update() + self.failUnless(tab_changed) + + + def test_tab(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, 'notab') + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, None) + + self.failUnless(isinstance(self.nb.tab(self.child1), dict)) + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'a') + # newer form for querying a single option + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'a') + self.nb.tab(self.child1, text='abc') + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'abc') + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'abc') + + + def test_tabs(self): + self.failUnlessEqual(len(self.nb.tabs()), 2) + + self.nb.forget(self.child1) + self.nb.forget(self.child2) + + self.failUnlessEqual(self.nb.tabs(), ()) + + + def test_traversal(self): + self.nb.pack() + self.nb.wait_visibility() + + self.nb.select(0) + + support.simulate_mouse_click(self.nb, 5, 5) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.tab(self.child1, text='a', underline=0) + self.nb.enable_traversal() + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + + +class TreeviewTest(unittest.TestCase): + + def setUp(self): + self.tv = ttk.Treeview() + + def tearDown(self): + self.tv.destroy() + + + def test_bbox(self): + self.tv.pack() + self.failUnlessEqual(self.tv.bbox(''), '') + self.tv.wait_visibility() + self.tv.update() + + item_id = self.tv.insert('', 'end') + children = self.tv.get_children() + self.failUnless(children) + + bbox = self.tv.bbox(children[0]) + self.failUnlessEqual(len(bbox), 4) + self.failUnless(isinstance(bbox, tuple)) + for item in bbox: + if not isinstance(item, int): + self.fail("Invalid bounding box: %s" % bbox) + break + + # compare width in bboxes + self.tv['columns'] = ['test'] + self.tv.column('test', width=50) + bbox_column0 = self.tv.bbox(children[0], 0) + root_width = self.tv.column('#0', width=None) + self.failUnlessEqual(bbox_column0[0], bbox[0] + root_width) + + # verify that bbox of a closed item is the empty string + child1 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.bbox(child1), '') + + + def test_children(self): + # no children yet, should get an empty tuple + self.failUnlessEqual(self.tv.get_children(), ()) + + item_id = self.tv.insert('', 'end') + self.failUnless(isinstance(self.tv.get_children(), tuple)) + self.failUnlessEqual(self.tv.get_children()[0], item_id) + + # add item_id and child3 as children of child2 + child2 = self.tv.insert('', 'end') + child3 = self.tv.insert('', 'end') + self.tv.set_children(child2, item_id, child3) + self.failUnlessEqual(self.tv.get_children(child2), (item_id, child3)) + + # child3 has child2 as parent, thus trying to set child2 as a children + # of child3 should result in an error + self.failUnlessRaises(Tkinter.TclError, + self.tv.set_children, child3, child2) + + # remove child2 children + self.tv.set_children(child2) + self.failUnlessEqual(self.tv.get_children(child2), ()) + + # remove root's children + self.tv.set_children('') + self.failUnlessEqual(self.tv.get_children(), ()) + + + def test_column(self): + # return a dict with all options/values + self.failUnless(isinstance(self.tv.column('#0'), dict)) + # return a single value of the given option + self.failUnless(isinstance(self.tv.column('#0', width=None), int)) + # set a new value for an option + self.tv.column('#0', width=10) + # testing new way to get option value + self.failUnlessEqual(self.tv.column('#0', 'width'), 10) + self.failUnlessEqual(self.tv.column('#0', width=None), 10) + # check read-only option + self.failUnlessRaises(Tkinter.TclError, self.tv.column, '#0', id='X') + + self.failUnlessRaises(Tkinter.TclError, self.tv.column, 'invalid') + invalid_kws = [ + {'unknown_option': 'some value'}, {'stretch': 'wrong'}, + {'anchor': 'wrong'}, {'width': 'wrong'}, {'minwidth': 'wrong'} + ] + for kw in invalid_kws: + self.failUnlessRaises(Tkinter.TclError, self.tv.column, '#0', + **kw) + + + def test_delete(self): + self.failUnlessRaises(Tkinter.TclError, self.tv.delete, '#0') + + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + self.tv.delete(item_id) + self.failIf(self.tv.get_children()) + + # reattach should fail + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, item_id, '', 'end') + + # test multiple item delete + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + self.failUnlessEqual(self.tv.get_children(), (item1, item2)) + + self.tv.delete(item1, item2) + self.failIf(self.tv.get_children()) + + + def test_detach_reattach(self): + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + + # calling detach without items is valid, although it does nothing + prev = self.tv.get_children() + self.tv.detach() # this should do nothing + self.failUnlessEqual(prev, self.tv.get_children()) + + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # detach item with children + self.tv.detach(item_id) + self.failIf(self.tv.get_children()) + + # reattach item with children + self.tv.reattach(item_id, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # move a children to the root + self.tv.move(item2, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, item2)) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + # bad values + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, 'nonexistant', '', 'end') + self.failUnlessRaises(Tkinter.TclError, + self.tv.detach, 'nonexistant') + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, item2, 'otherparent', 'end') + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, item2, '', 'invalid') + + # multiple detach + self.tv.detach(item_id, item2) + self.failUnlessEqual(self.tv.get_children(), ()) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + + def test_exists(self): + self.failUnlessEqual(self.tv.exists('something'), False) + self.failUnlessEqual(self.tv.exists(''), True) + self.failUnlessEqual(self.tv.exists({}), False) + + # the following will make a tk.call equivalent to + # tk.call(treeview, "exists") which should result in an error + # in the tcl interpreter since tk requires an item. + self.failUnlessRaises(Tkinter.TclError, self.tv.exists, None) + + + def test_focus(self): + # nothing is focused right now + self.failUnlessEqual(self.tv.focus(), '') + + item1 = self.tv.insert('', 'end') + self.tv.focus(item1) + self.failUnlessEqual(self.tv.focus(), item1) + + self.tv.delete(item1) + self.failUnlessEqual(self.tv.focus(), '') + + # try focusing inexistant item + self.failUnlessRaises(Tkinter.TclError, self.tv.focus, 'hi') + + + def test_heading(self): + # check a dict is returned + self.failUnless(isinstance(self.tv.heading('#0'), dict)) + + # check a value is returned + self.tv.heading('#0', text='hi') + self.failUnlessEqual(self.tv.heading('#0', 'text'), 'hi') + self.failUnlessEqual(self.tv.heading('#0', text=None), 'hi') + + # invalid option + self.failUnlessRaises(Tkinter.TclError, self.tv.heading, '#0', + background=None) + # invalid value + self.failUnlessRaises(Tkinter.TclError, self.tv.heading, '#0', + anchor=1) + + + def test_heading_callback(self): + def simulate_heading_click(x, y): + support.simulate_mouse_click(self.tv, x, y) + self.tv.update_idletasks() + + success = [] # no success for now + + self.tv.pack() + self.tv.wait_visibility() + self.tv.heading('#0', command=lambda: success.append(True)) + self.tv.column('#0', width=100) + self.tv.update() + + # assuming that the coords (5, 5) fall into heading #0 + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + success = [] + commands = self.tv.master._tclCommands + self.tv.heading('#0', command=str(self.tv.heading('#0', command=None))) + self.failUnlessEqual(commands, self.tv.master._tclCommands) + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + # XXX The following raises an error in a tcl interpreter, but not in + # Python + #self.tv.heading('#0', command='I dont exist') + #simulate_heading_click(5, 5) + + + def test_index(self): + # item 'what' doesn't exist + self.failUnlessRaises(Tkinter.TclError, self.tv.index, 'what') + + self.failUnlessEqual(self.tv.index(''), 0) + + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + c1 = self.tv.insert(item1, 'end') + c2 = self.tv.insert(item1, 'end') + self.failUnlessEqual(self.tv.index(item1), 0) + self.failUnlessEqual(self.tv.index(c1), 0) + self.failUnlessEqual(self.tv.index(c2), 1) + self.failUnlessEqual(self.tv.index(item2), 1) + + self.tv.move(item2, '', 0) + self.failUnlessEqual(self.tv.index(item2), 0) + self.failUnlessEqual(self.tv.index(item1), 1) + + # check that index still works even after its parent and siblings + # have been detached + self.tv.detach(item1) + self.failUnlessEqual(self.tv.index(c2), 1) + self.tv.detach(c1) + self.failUnlessEqual(self.tv.index(c2), 0) + + # but it fails after item has been deleted + self.tv.delete(item1) + self.failUnlessRaises(Tkinter.TclError, self.tv.index, c2) + + + def test_insert_item(self): + # parent 'none' doesn't exist + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, 'none', 'end') + + # open values + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + open='') + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + open='please') + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=True))) + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=False))) + + # invalid index + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'middle') + + # trying to duplicate item id is invalid + itemid = self.tv.insert('', 'end', 'first-item') + self.failUnlessEqual(itemid, 'first-item') + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + 'first-item') + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + MockTclObj('first-item')) + + # unicode values + value = u'\xe1ba' + item = self.tv.insert('', 'end', values=(value, )) + self.failUnlessEqual(self.tv.item(item, 'values'), (value, )) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.tv.item(item, values=list(self.tv.item(item, values=None))) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.failUnless(isinstance(self.tv.item(item), dict)) + + # erase item values + self.tv.item(item, values='') + self.failIf(self.tv.item(item, values=None)) + + # item tags + item = self.tv.insert('', 'end', tags=[1, 2, value]) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2', value)) + self.tv.item(item, tags=[]) + self.failIf(self.tv.item(item, tags=None)) + self.tv.item(item, tags=(1, 2)) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2')) + + # values with spaces + item = self.tv.insert('', 'end', values=('a b c', + '%s %s' % (value, value))) + self.failUnlessEqual(self.tv.item(item, values=None), + ('a b c', '%s %s' % (value, value))) + + # text + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text="Label here"), text=None), + "Label here") + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text=value), text=None), + value) + + + def test_set(self): + self.tv['columns'] = ['A', 'B'] + item = self.tv.insert('', 'end', values=['a', 'b']) + self.failUnlessEqual(self.tv.set(item), {'A': 'a', 'B': 'b'}) + + self.tv.set(item, 'B', 'a') + self.failUnlessEqual(self.tv.item(item, values=None), ('a', 'a')) + + self.tv['columns'] = ['B'] + self.failUnlessEqual(self.tv.set(item), {'B': 'a'}) + + self.tv.set(item, 'B', 'b') + self.failUnlessEqual(self.tv.set(item, column='B'), 'b') + self.failUnlessEqual(self.tv.item(item, values=None), ('b', 'a')) + + self.tv.set(item, 'B', 123) + self.failUnlessEqual(self.tv.set(item, 'B'), 123) + self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) + self.failUnlessEqual(self.tv.set(item), {'B': 123}) + + # inexistant column + self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A') + self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A', 'b') + + # inexistant item + self.failUnlessRaises(Tkinter.TclError, self.tv.set, 'notme') + + + def test_tag_bind(self): + events = [] + item1 = self.tv.insert('', 'end', tags=['call']) + item2 = self.tv.insert('', 'end', tags=['call']) + self.tv.tag_bind('call', '', + lambda evt: events.append(1)) + self.tv.tag_bind('call', '', + lambda evt: events.append(2)) + + self.tv.pack() + self.tv.wait_visibility() + self.tv.update() + + pos_y = set() + found = set() + for i in range(0, 100, 10): + if len(found) == 2: # item1 and item2 already found + break + item_id = self.tv.identify_row(i) + if item_id and item_id not in found: + pos_y.add(i) + found.add(item_id) + + self.failUnlessEqual(len(pos_y), 2) # item1 and item2 y pos + for y in pos_y: + support.simulate_mouse_click(self.tv, 0, y) + + # by now there should be 4 things in the events list, since each + # item had a bind for two events that were simulated above + self.failUnlessEqual(len(events), 4) + for evt in zip(events[::2], events[1::2]): + self.failUnlessEqual(evt, (1, 2)) + + + def test_tag_configure(self): + # Just testing parameter passing for now + self.failUnlessRaises(TypeError, self.tv.tag_configure) + self.failUnlessRaises(Tkinter.TclError, self.tv.tag_configure, + 'test', sky='blue') + self.tv.tag_configure('test', foreground='blue') + self.failUnlessEqual(self.tv.tag_configure('test', 'foreground'), + 'blue') + self.failUnlessEqual(self.tv.tag_configure('test', foreground=None), + 'blue') + self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) + + +def test_main(): + support.run(WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, + ComboboxTest, EntryTest, PanedwindowTest, ScaleTest, NotebookTest, + TreeviewTest) + +if __name__ == "__main__": + test_main() Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/README ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/README (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/README Tue Jan 27 02:44:40 2009 @@ -9,5 +9,5 @@ before creating another one, and clean up after the test. The motivation behind this is that some tests may depend on having its window focused while it is running to work properly, and it may be hard to force focus on your - window across platforms (right now only test_traversal at test_notebook - depends on this). + window across platforms (right now only test_traversal at + test_widgets.NotebookTest depends on this). Deleted: sandbox/trunk/ttk-gsoc/src/3.x/test/test_notebook.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_notebook.py Tue Jan 27 02:44:40 2009 +++ (empty file) @@ -1,200 +0,0 @@ -import unittest -import tkinter -import ttk - -import support - -class NotebookTest(unittest.TestCase): - - def setUp(self): - self.nb = ttk.Notebook() - self.child1 = ttk.Label() - self.child2 = ttk.Label() - self.nb.add(self.child1, text='a') - self.nb.add(self.child2, text='b') - - def tearDown(self): - self.child1.destroy() - self.child2.destroy() - self.nb.destroy() - - - def test_tab_identifiers(self): - self.nb.forget(0) - self.nb.hide(self.child2) - self.failUnlessRaises(tkinter.TclError, self.nb.tab, self.child1) - self.failUnlessEqual(self.nb.index('end'), 1) - self.nb.add(self.child2) - self.failUnlessEqual(self.nb.index('end'), 1) - self.nb.select(self.child2) - - self.failUnless(self.nb.tab('current')) - self.nb.add(self.child1, text='a') - - self.nb.pack() - self.nb.wait_visibility() - self.failUnlessEqual(self.nb.tab('@5,5'), self.nb.tab('current')) - - for i in range(5, 100, 5): - if self.nb.tab('@%d, 5' % i, text=None) == 'a': - break - else: - self.fail("Tab with text 'a' not found") - - - def test_add_and_hidden(self): - self.failUnlessRaises(tkinter.TclError, self.nb.hide, -1) - self.failUnlessRaises(tkinter.TclError, self.nb.hide, 'hi') - self.failUnlessRaises(tkinter.TclError, self.nb.hide, None) - self.failUnlessRaises(tkinter.TclError, self.nb.add, None) - self.failUnlessRaises(tkinter.TclError, self.nb.add, ttk.Label(), - unknown='option') - - tabs = self.nb.tabs() - self.nb.hide(self.child1) - self.nb.add(self.child1) - self.failUnlessEqual(self.nb.tabs(), tabs) - - child = ttk.Label() - self.nb.add(child, text='c') - tabs = self.nb.tabs() - - curr = self.nb.index('current') - # verify that the tab gets readded at its previous position - child2_index = self.nb.index(self.child2) - self.nb.hide(self.child2) - self.nb.add(self.child2) - self.failUnlessEqual(self.nb.tabs(), tabs) - self.failUnlessEqual(self.nb.index(self.child2), child2_index) - self.failUnless(str(self.child2) == self.nb.tabs()[child2_index]) - # but the tab next to it (not hidden) is the one selected now - self.failUnlessEqual(self.nb.index('current'), curr + 1) - - - def test_forget(self): - self.failUnlessRaises(tkinter.TclError, self.nb.forget, -1) - self.failUnlessRaises(tkinter.TclError, self.nb.forget, 'hi') - self.failUnlessRaises(tkinter.TclError, self.nb.forget, None) - - tabs = self.nb.tabs() - child1_index = self.nb.index(self.child1) - self.nb.forget(self.child1) - self.failIf(str(self.child1) in self.nb.tabs()) - self.failUnlessEqual(len(tabs) - 1, len(self.nb.tabs())) - - self.nb.add(self.child1) - self.failUnlessEqual(self.nb.index(self.child1), 1) - self.failIf(child1_index == self.nb.index(self.child1)) - - - def test_index(self): - self.failUnlessRaises(tkinter.TclError, self.nb.index, -1) - self.failUnlessRaises(tkinter.TclError, self.nb.index, None) - - self.failUnless(isinstance(self.nb.index('end'), int)) - self.failUnlessEqual(self.nb.index(self.child1), 0) - self.failUnlessEqual(self.nb.index(self.child2), 1) - self.failUnlessEqual(self.nb.index('end'), 2) - - - def test_insert(self): - # moving tabs - tabs = self.nb.tabs() - self.nb.insert(1, tabs[0]) - self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) - self.nb.insert(self.child1, self.child2) - self.failUnlessEqual(self.nb.tabs(), tabs) - self.nb.insert('end', self.child1) - self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) - self.nb.insert('end', 0) - self.failUnlessEqual(self.nb.tabs(), tabs) - # bad moves - self.failUnlessRaises(tkinter.TclError, self.nb.insert, 2, tabs[0]) - self.failUnlessRaises(tkinter.TclError, self.nb.insert, -1, tabs[0]) - - # new tab - child3 = ttk.Label() - self.nb.insert(1, child3) - self.failUnlessEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1])) - self.nb.forget(child3) - self.failUnlessEqual(self.nb.tabs(), tabs) - self.nb.insert(self.child1, child3) - self.failUnlessEqual(self.nb.tabs(), (str(child3), ) + tabs) - self.nb.forget(child3) - self.failUnlessRaises(tkinter.TclError, self.nb.insert, 2, child3) - self.failUnlessRaises(tkinter.TclError, self.nb.insert, -1, child3) - - # bad inserts - self.failUnlessRaises(tkinter.TclError, self.nb.insert, 'end', None) - self.failUnlessRaises(tkinter.TclError, self.nb.insert, None, 0) - self.failUnlessRaises(tkinter.TclError, self.nb.insert, None, None) - - - def test_select(self): - self.nb.pack() - self.nb.wait_visibility() - - success = [] - tab_changed = [] - - self.child1.bind('', lambda evt: success.append(True)) - self.nb.bind('<>', - lambda evt: tab_changed.append(True)) - - self.failUnlessEqual(self.nb.select(), str(self.child1)) - self.nb.select(self.child2) - self.failUnless(success) - self.failUnlessEqual(self.nb.select(), str(self.child2)) - - self.nb.update() - self.failUnless(tab_changed) - - - def test_tab(self): - self.failUnlessRaises(tkinter.TclError, self.nb.tab, -1) - self.failUnlessRaises(tkinter.TclError, self.nb.tab, 'notab') - self.failUnlessRaises(tkinter.TclError, self.nb.tab, None) - - self.failUnless(isinstance(self.nb.tab(self.child1), dict)) - self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'a') - # newer form for querying a single option - self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'a') - self.nb.tab(self.child1, text='abc') - self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'abc') - self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'abc') - - - def test_tabs(self): - self.failUnlessEqual(len(self.nb.tabs()), 2) - - self.nb.forget(self.child1) - self.nb.forget(self.child2) - - self.failUnlessEqual(self.nb.tabs(), ()) - - - def test_traversal(self): - self.nb.pack() - self.nb.wait_visibility() - - self.nb.select(0) - - support.simulate_mouse_click(self.nb, 5, 5) - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child2)) - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child1)) - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child2)) - - self.nb.tab(self.child1, text='a', underline=0) - self.nb.enable_traversal() - self.nb.event_generate('') - self.failUnlessEqual(self.nb.select(), str(self.child1)) - - -def test_main(): - support.run(NotebookTest) - -if __name__ == "__main__": - test_main() Deleted: sandbox/trunk/ttk-gsoc/src/3.x/test/test_other_widgets.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_other_widgets.py Tue Jan 27 02:44:40 2009 +++ (empty file) @@ -1,520 +0,0 @@ -import unittest -import tkinter -import ttk - -import support - -class WidgetTest(unittest.TestCase): - """Tests methods available in every ttk widget.""" - - def setUp(self): - self.widget = ttk.Button() - self.widget.pack() - self.widget.wait_visibility() - - def tearDown(self): - self.widget.destroy() - - - def test_identify(self): - self.widget.update_idletasks() - self.failUnlessEqual(self.widget.identify(5, 5), "label") - self.failUnlessEqual(self.widget.identify(-1, -1), "") - - self.failUnlessRaises(tkinter.TclError, self.widget.identify, None, 5) - self.failUnlessRaises(tkinter.TclError, self.widget.identify, 5, None) - self.failUnlessRaises(tkinter.TclError, self.widget.identify, 5, '') - - - def test_widget_state(self): - # XXX not sure about the portability of all these tests - self.failUnlessEqual(self.widget.state(), ()) - self.failUnlessEqual(self.widget.instate(['!disabled']), True) - - # changing from !disabled to disabled - self.failUnlessEqual(self.widget.state(['disabled']), ('!disabled', )) - # no state change - self.failUnlessEqual(self.widget.state(['disabled']), ()) - # change back to !disable but also active - self.failUnlessEqual(self.widget.state(['!disabled', 'active']), - ('!active', 'disabled')) - # no state changes, again - self.failUnlessEqual(self.widget.state(['!disabled', 'active']), ()) - self.failUnlessEqual(self.widget.state(['active', '!disabled']), ()) - - def test_cb(arg1, **kw): - return arg1, kw - self.failUnlessEqual(self.widget.instate(['!disabled'], - test_cb, "hi", **{"msg": "there"}), - ('hi', {'msg': 'there'})) - - # attempt to set invalid statespec - currstate = self.widget.state() - self.failUnlessRaises(tkinter.TclError, self.widget.instate, - ['badstate']) - self.failUnlessRaises(tkinter.TclError, self.widget.instate, - ['disabled', 'badstate']) - # verify that widget didn't change its state - self.failUnlessEqual(currstate, self.widget.state()) - - # ensuring that passing None as state doesn't modify current state - self.widget.state(['active', '!disabled']) - self.failUnlessEqual(self.widget.state(), ('active', )) - - -class ButtonTest(unittest.TestCase): - - def test_invoke(self): - success = [] - btn = ttk.Button(command=lambda: success.append(1)) - btn.invoke() - self.failUnless(success) - - -class CheckbuttonTest(unittest.TestCase): - - def test_invoke(self): - success = [] - def cb_test(): - success.append(1) - return "cb test called" - - cbtn = ttk.Checkbutton(command=cb_test) - # the variable automatically created by ttk.Checkbutton is actually - # undefined till we invoke the Checkbutton - self.failUnlessEqual(cbtn.state(), ('alternate', )) - self.failUnlessRaises(tkinter.TclError, cbtn.tk.globalgetvar, - cbtn['variable']) - - res = cbtn.invoke() - self.failUnlessEqual(res, "cb test called") - self.failUnlessEqual(cbtn['onvalue'], - cbtn.tk.globalgetvar(cbtn['variable'])) - self.failUnless(success) - - cbtn['command'] = '' - res = cbtn.invoke() - self.failUnlessEqual(res, '') - self.failIf(len(success) > 1) - self.failUnlessEqual(cbtn['offvalue'], - cbtn.tk.globalgetvar(cbtn['variable'])) - - -class ComboboxTest(unittest.TestCase): - - def setUp(self): - self.combo = ttk.Combobox() - - def tearDown(self): - self.combo.destroy() - - def _show_drop_down_listbox(self): - width = self.combo.winfo_width() - self.combo.event_generate('', x=width - 5, y=5) - self.combo.event_generate('', x=width - 5, y=5) - self.combo.update_idletasks() - - - def test_virtual_event(self): - success = [] - - self.combo['values'] = [1] - self.combo.bind('<>', - lambda evt: success.append(True)) - self.combo.pack() - self.combo.wait_visibility() - - height = self.combo.winfo_height() - self._show_drop_down_listbox() - self.combo.update() - self.combo.event_generate('') - self.combo.update() - - self.failUnless(success) - - - def test_postcommand(self): - success = [] - - self.combo['postcommand'] = lambda: success.append(True) - self.combo.pack() - self.combo.wait_visibility() - - self._show_drop_down_listbox() - self.failUnless(success) - - # testing postcommand removal - self.combo['postcommand'] = '' - self._show_drop_down_listbox() - self.failUnlessEqual(len(success), 1) - - - def test_values(self): - def check_get_current(getval, currval): - self.failUnlessEqual(self.combo.get(), getval) - self.failUnlessEqual(self.combo.current(), currval) - - check_get_current('', -1) - - self.combo['values'] = ['a', 1, 'c'] - - self.combo.set('c') - check_get_current('c', 2) - - self.combo.current(0) - check_get_current('a', 0) - - self.combo.set('d') - check_get_current('d', -1) - - # testing values with empty string - self.combo.set('') - self.combo['values'] = (1, 2, '', 3) - check_get_current('', 2) - - # testing values with empty string set through configure - self.combo.configure(values=[1, '', 2]) - self.failUnlessEqual(self.combo['values'], ('1', '', '2')) - - # out of range - self.failUnlessRaises(tkinter.TclError, self.combo.current, - len(self.combo['values'])) - # it expects an integer (or something that can be converted to int) - self.failUnlessRaises(tkinter.TclError, self.combo.current, '') - - # testing creating combobox with empty string in values - combo2 = ttk.Combobox(values=[1, 2, '']) - self.failUnlessEqual(combo2['values'], ('1', '2', '')) - combo2.destroy() - - -class EntryTest(unittest.TestCase): - - def setUp(self): - self.entry = ttk.Entry() - - def tearDown(self): - self.entry.destroy() - - - def test_bbox(self): - self.failUnlessEqual(len(self.entry.bbox(0)), 4) - for item in self.entry.bbox(0): - self.failUnless(isinstance(item, int)) - - self.failUnlessRaises(tkinter.TclError, self.entry.bbox, 'noindex') - self.failUnlessRaises(tkinter.TclError, self.entry.bbox, None) - - - def test_identify(self): - self.entry.pack() - self.entry.wait_visibility() - self.entry.update_idletasks() - - self.failUnlessEqual(self.entry.identify(5, 5), "textarea") - self.failUnlessEqual(self.entry.identify(-1, -1), "") - - self.failUnlessRaises(tkinter.TclError, self.entry.identify, None, 5) - self.failUnlessRaises(tkinter.TclError, self.entry.identify, 5, None) - self.failUnlessRaises(tkinter.TclError, self.entry.identify, 5, '') - - - def test_validation_options(self): - success = [] - test_invalid = lambda: success.append(True) - - self.entry['validate'] = 'none' - self.entry['validatecommand'] = lambda: False - - self.entry['invalidcommand'] = test_invalid - self.entry.validate() - self.failUnless(success) - - self.entry['invalidcommand'] = '' - self.entry.validate() - self.failUnlessEqual(len(success), 1) - - self.entry['invalidcommand'] = test_invalid - self.entry['validatecommand'] = lambda: True - self.entry.validate() - self.failUnlessEqual(len(success), 1) - - self.entry['validatecommand'] = '' - self.entry.validate() - self.failUnlessEqual(len(success), 1) - - self.entry['validatecommand'] = True - self.failUnlessRaises(tkinter.TclError, self.entry.validate) - - - def test_validation(self): - validation = [] - def validate(to_insert): - if not 'a' <= to_insert.lower() <= 'z': - validation.append(False) - return False - validation.append(True) - return True - - self.entry['validate'] = 'key' - self.entry['validatecommand'] = self.entry.register(validate), '%S' - - self.entry.insert('end', 1) - self.entry.insert('end', 'a') - self.failUnlessEqual(validation, [False, True]) - self.failUnlessEqual(self.entry.get(), 'a') - - - def test_revalidation(self): - def validate(content): - for letter in content: - if not 'a' <= letter.lower() <= 'z': - return False - return True - - self.entry['validatecommand'] = self.entry.register(validate), '%P' - - self.entry.insert('end', 'avocado') - self.failUnlessEqual(self.entry.validate(), True) - self.failUnlessEqual(self.entry.state(), ()) - - self.entry.delete(0, 'end') - self.failUnlessEqual(self.entry.get(), '') - - self.entry.insert('end', 'a1b') - self.failUnlessEqual(self.entry.validate(), False) - self.failUnlessEqual(self.entry.state(), ('invalid', )) - - self.entry.delete(1) - self.failUnlessEqual(self.entry.validate(), True) - self.failUnlessEqual(self.entry.state(), ()) - - -class PanedwindowTest(unittest.TestCase): - - def setUp(self): - self.paned = ttk.Panedwindow() - - def tearDown(self): - self.paned.destroy() - - - def test_add(self): - # attempt to add a child that is not a direct child of the paned window - label = ttk.Label(self.paned) - child = ttk.Label(label) - self.failUnlessRaises(tkinter.TclError, self.paned.add, child) - label.destroy() - child.destroy() - # another attempt - label = ttk.Label() - child = ttk.Label(label) - self.failUnlessRaises(tkinter.TclError, self.paned.add, child) - child.destroy() - label.destroy() - - good_child = ttk.Label() - self.paned.add(good_child) - # re-adding a child is not accepted - self.failUnlessRaises(tkinter.TclError, self.paned.add, good_child) - - other_child = ttk.Label(self.paned) - self.paned.add(other_child) - self.failUnlessEqual(self.paned.pane(0), self.paned.pane(1)) - self.failUnlessRaises(tkinter.TclError, self.paned.pane, 2) - good_child.destroy() - other_child.destroy() - self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0) - - - def test_forget(self): - self.failUnlessRaises(tkinter.TclError, self.paned.forget, None) - self.failUnlessRaises(tkinter.TclError, self.paned.forget, 0) - - self.paned.add(ttk.Label()) - self.paned.forget(0) - self.failUnlessRaises(tkinter.TclError, self.paned.forget, 0) - - - def test_insert(self): - self.failUnlessRaises(tkinter.TclError, self.paned.insert, None, 0) - self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, None) - self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, 0) - - child = ttk.Label() - child2 = ttk.Label() - child3 = ttk.Label() - - self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, child) - - self.paned.insert('end', child2) - self.paned.insert(0, child) - self.failUnlessEqual(self.paned.panes(), (str(child), str(child2))) - - self.paned.insert(0, child2) - self.failUnlessEqual(self.paned.panes(), (str(child2), str(child))) - - self.paned.insert('end', child3) - self.failUnlessEqual(self.paned.panes(), - (str(child2), str(child), str(child3))) - - # reinserting a child should move it to its current position - panes = self.paned.panes() - self.paned.insert('end', child3) - self.failUnlessEqual(panes, self.paned.panes()) - - # moving child3 to child2 position should result in child2 ending up - # in previous child position and child ending up in previous child3 - # position - self.paned.insert(child2, child3) - self.failUnlessEqual(self.paned.panes(), - (str(child3), str(child2), str(child))) - - - def test_pane(self): - self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0) - - child = ttk.Label() - self.paned.add(child) - self.failUnless(isinstance(self.paned.pane(0), dict)) - self.failUnlessEqual(self.paned.pane(0, weight=None), 0) - # newer form for querying a single option - self.failUnlessEqual(self.paned.pane(0, 'weight'), 0) - self.failUnlessEqual(self.paned.pane(0), self.paned.pane(str(child))) - - self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0, - badoption='somevalue') - - - def test_sashpos(self): - self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, None) - self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, '') - self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 0) - - child = ttk.Label(self.paned, text='a') - self.paned.add(child, weight=1) - self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 0) - child2 = ttk.Label(self.paned, text='b') - self.paned.add(child2) - self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 1) - - self.paned.pack(expand=True, fill='both') - self.paned.wait_visibility() - - curr_pos = self.paned.sashpos(0) - self.paned.sashpos(0, 1000) - self.failUnless(curr_pos != self.paned.sashpos(0)) - self.failUnless(isinstance(self.paned.sashpos(0), int)) - - -class RadiobuttonTest(unittest.TestCase): - - def test_invoke(self): - success = [] - def cb_test(): - success.append(1) - return "cb test called" - - myvar = tkinter.IntVar() - cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0) - cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1) - - res = cbtn.invoke() - self.failUnlessEqual(res, "cb test called") - self.failUnlessEqual(cbtn['value'], myvar.get()) - self.failUnlessEqual(myvar.get(), - cbtn.tk.globalgetvar(cbtn['variable'])) - self.failUnless(success) - - cbtn2['command'] = '' - res = cbtn2.invoke() - self.failUnlessEqual(res, '') - self.failIf(len(success) > 1) - self.failUnlessEqual(cbtn2['value'], myvar.get()) - self.failUnlessEqual(myvar.get(), - cbtn.tk.globalgetvar(cbtn['variable'])) - - self.failUnlessEqual(str(cbtn['variable']), str(cbtn2['variable'])) - - - -class ScaleTest(unittest.TestCase): - - def setUp(self): - self.scale = ttk.Scale() - self.scale.pack() - self.scale.update() - - def tearDown(self): - self.scale.destroy() - - - def test_custom_event(self): - failure = [1, 1, 1] # will need to be empty - - funcid = self.scale.bind('<>', lambda evt: failure.pop()) - - self.scale['from'] = 10 - self.scale['from_'] = 10 - self.scale['to'] = 3 - - self.failIf(failure) - - failure = [1, 1, 1] - self.scale.configure(from_=2, to=5) - self.scale.configure(from_=0, to=-2) - self.scale.configure(to=10) - - self.failIf(failure) - - - def test_get(self): - scale_width = self.scale.winfo_width() - self.failUnlessEqual(self.scale.get(scale_width, 0), self.scale['to']) - - self.failUnlessEqual(self.scale.get(0, 0), self.scale['from']) - self.failUnlessEqual(self.scale.get(), self.scale['value']) - self.scale['value'] = 30 - self.failUnlessEqual(self.scale.get(), self.scale['value']) - - self.failUnlessRaises(tkinter.TclError, self.scale.get, '', 0) - self.failUnlessRaises(tkinter.TclError, self.scale.get, 0, '') - - - def test_set(self): - # set restricts the max/min values according to the current range - max = self.scale['to'] - new_max = max + 10 - self.scale.set(new_max) - self.failUnlessEqual(self.scale.get(), max) - min = self.scale['from'] - self.scale.set(min - 1) - self.failUnlessEqual(self.scale.get(), min) - - # changing directly the variable doesn't impose this limitation tho - var = tkinter.DoubleVar() - self.scale['variable'] = var - var.set(max + 5) - self.failUnlessEqual(self.scale.get(), var.get()) - self.failUnlessEqual(self.scale.get(), max + 5) - del var - - # the same happens with the value option - self.scale['value'] = max + 10 - self.failUnlessEqual(self.scale.get(), max + 10) - self.failUnlessEqual(self.scale.get(), self.scale['value']) - - # nevertheless, note that the max/min values we can get specifying - # x, y coords are the ones according to the current range - self.failUnlessEqual(self.scale.get(0, 0), min) - self.failUnlessEqual(self.scale.get(self.scale.winfo_width(), 0), max) - - self.failUnlessRaises(tkinter.TclError, self.scale.set, None) - - -def test_main(): - support.run(WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, - ComboboxTest, EntryTest, PanedwindowTest, ScaleTest) - -if __name__ == "__main__": - test_main() Deleted: sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_treeview.py Tue Jan 27 02:44:40 2009 +++ (empty file) @@ -1,412 +0,0 @@ -import unittest -import tkinter -import ttk - -import support -from test_functions import MockTclObj, MockStateSpec - -class TreeviewTest(unittest.TestCase): - - def setUp(self): - self.tv = ttk.Treeview() - - def tearDown(self): - self.tv.destroy() - - - def test_bbox(self): - self.tv.pack() - self.failUnlessEqual(self.tv.bbox(''), '') - self.tv.wait_visibility() - self.tv.update() - - item_id = self.tv.insert('', 'end') - children = self.tv.get_children() - self.failUnless(children) - - bbox = self.tv.bbox(children[0]) - self.failUnlessEqual(len(bbox), 4) - self.failUnless(isinstance(bbox, tuple)) - for item in bbox: - if not isinstance(item, int): - self.fail("Invalid bounding box: %s" % bbox) - break - - # compare width in bboxes - self.tv['columns'] = ['test'] - self.tv.column('test', width=50) - bbox_column0 = self.tv.bbox(children[0], 0) - root_width = self.tv.column('#0', width=None) - self.failUnlessEqual(bbox_column0[0], bbox[0] + root_width) - - # verify that bbox of a closed item is the empty string - child1 = self.tv.insert(item_id, 'end') - self.failUnlessEqual(self.tv.bbox(child1), '') - - - def test_children(self): - # no children yet, should get an empty tuple - self.failUnlessEqual(self.tv.get_children(), ()) - - item_id = self.tv.insert('', 'end') - self.failUnless(isinstance(self.tv.get_children(), tuple)) - self.failUnlessEqual(self.tv.get_children()[0], item_id) - - # add item_id and child3 as children of child2 - child2 = self.tv.insert('', 'end') - child3 = self.tv.insert('', 'end') - self.tv.set_children(child2, item_id, child3) - self.failUnlessEqual(self.tv.get_children(child2), (item_id, child3)) - - # child3 has child2 as parent, thus trying to set child2 as a children - # of child3 should result in an error - self.failUnlessRaises(tkinter.TclError, - self.tv.set_children, child3, child2) - - # remove child2 children - self.tv.set_children(child2) - self.failUnlessEqual(self.tv.get_children(child2), ()) - - # remove root's children - self.tv.set_children('') - self.failUnlessEqual(self.tv.get_children(), ()) - - - def test_column(self): - # return a dict with all options/values - self.failUnless(isinstance(self.tv.column('#0'), dict)) - # return a single value of the given option - self.failUnless(isinstance(self.tv.column('#0', width=None), int)) - # set a new value for an option - self.tv.column('#0', width=10) - # testing new way to get option value - self.failUnlessEqual(self.tv.column('#0', 'width'), 10) - self.failUnlessEqual(self.tv.column('#0', width=None), 10) - # check read-only option - self.failUnlessRaises(tkinter.TclError, self.tv.column, '#0', id='X') - - self.failUnlessRaises(tkinter.TclError, self.tv.column, 'invalid') - invalid_kws = [ - {'unknown_option': 'some value'}, {'stretch': 'wrong'}, - {'anchor': 'wrong'}, {'width': 'wrong'}, {'minwidth': 'wrong'} - ] - for kw in invalid_kws: - self.failUnlessRaises(tkinter.TclError, self.tv.column, '#0', - **kw) - - - def test_delete(self): - self.failUnlessRaises(tkinter.TclError, self.tv.delete, '#0') - - item_id = self.tv.insert('', 'end') - item2 = self.tv.insert(item_id, 'end') - self.failUnlessEqual(self.tv.get_children(), (item_id, )) - self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) - - self.tv.delete(item_id) - self.failIf(self.tv.get_children()) - - # reattach should fail - self.failUnlessRaises(tkinter.TclError, - self.tv.reattach, item_id, '', 'end') - - # test multiple item delete - item1 = self.tv.insert('', 'end') - item2 = self.tv.insert('', 'end') - self.failUnlessEqual(self.tv.get_children(), (item1, item2)) - - self.tv.delete(item1, item2) - self.failIf(self.tv.get_children()) - - - def test_detach_reattach(self): - item_id = self.tv.insert('', 'end') - item2 = self.tv.insert(item_id, 'end') - - # calling detach without items is valid, although it does nothing - prev = self.tv.get_children() - self.tv.detach() # this should do nothing - self.failUnlessEqual(prev, self.tv.get_children()) - - self.failUnlessEqual(self.tv.get_children(), (item_id, )) - self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) - - # detach item with children - self.tv.detach(item_id) - self.failIf(self.tv.get_children()) - - # reattach item with children - self.tv.reattach(item_id, '', 'end') - self.failUnlessEqual(self.tv.get_children(), (item_id, )) - self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) - - # move a children to the root - self.tv.move(item2, '', 'end') - self.failUnlessEqual(self.tv.get_children(), (item_id, item2)) - self.failUnlessEqual(self.tv.get_children(item_id), ()) - - # bad values - self.failUnlessRaises(tkinter.TclError, - self.tv.reattach, 'nonexistant', '', 'end') - self.failUnlessRaises(tkinter.TclError, - self.tv.detach, 'nonexistant') - self.failUnlessRaises(tkinter.TclError, - self.tv.reattach, item2, 'otherparent', 'end') - self.failUnlessRaises(tkinter.TclError, - self.tv.reattach, item2, '', 'invalid') - - # multiple detach - self.tv.detach(item_id, item2) - self.failUnlessEqual(self.tv.get_children(), ()) - self.failUnlessEqual(self.tv.get_children(item_id), ()) - - - def test_exists(self): - self.failUnlessEqual(self.tv.exists('something'), False) - self.failUnlessEqual(self.tv.exists(''), True) - self.failUnlessEqual(self.tv.exists({}), False) - - # the following will make a tk.call equivalent to - # tk.call(treeview, "exists") which should result in an error - # in the tcl interpreter since tk requires an item. - self.failUnlessRaises(tkinter.TclError, self.tv.exists, None) - - - def test_focus(self): - # nothing is focused right now - self.failUnlessEqual(self.tv.focus(), '') - - item1 = self.tv.insert('', 'end') - self.tv.focus(item1) - self.failUnlessEqual(self.tv.focus(), item1) - - self.tv.delete(item1) - self.failUnlessEqual(self.tv.focus(), '') - - # try focusing inexistant item - self.failUnlessRaises(tkinter.TclError, self.tv.focus, 'hi') - - - def test_heading(self): - # check a dict is returned - self.failUnless(isinstance(self.tv.heading('#0'), dict)) - - # check a value is returned - self.tv.heading('#0', text='hi') - self.failUnlessEqual(self.tv.heading('#0', 'text'), 'hi') - self.failUnlessEqual(self.tv.heading('#0', text=None), 'hi') - - # invalid option - self.failUnlessRaises(tkinter.TclError, self.tv.heading, '#0', - background=None) - # invalid value - self.failUnlessRaises(tkinter.TclError, self.tv.heading, '#0', - anchor=1) - - - def test_heading_callback(self): - def simulate_heading_click(x, y): - support.simulate_mouse_click(self.tv, x, y) - self.tv.update_idletasks() - - success = [] # no success for now - - self.tv.pack() - self.tv.wait_visibility() - self.tv.heading('#0', command=lambda: success.append(True)) - self.tv.column('#0', width=100) - self.tv.update() - - # assuming that the coords (5, 5) fall into heading #0 - simulate_heading_click(5, 5) - if not success: - self.fail("The command associated to the treeview heading wasn't " - "invoked.") - - success = [] - commands = self.tv.master._tclCommands - self.tv.heading('#0', command=str(self.tv.heading('#0', command=None))) - self.failUnlessEqual(commands, self.tv.master._tclCommands) - simulate_heading_click(5, 5) - if not success: - self.fail("The command associated to the treeview heading wasn't " - "invoked.") - - # XXX The following raises an error in a tcl interpreter, but not in - # Python - #self.tv.heading('#0', command='I dont exist') - #simulate_heading_click(5, 5) - - - def test_index(self): - # item 'what' doesn't exist - self.failUnlessRaises(tkinter.TclError, self.tv.index, 'what') - - self.failUnlessEqual(self.tv.index(''), 0) - - item1 = self.tv.insert('', 'end') - item2 = self.tv.insert('', 'end') - c1 = self.tv.insert(item1, 'end') - c2 = self.tv.insert(item1, 'end') - self.failUnlessEqual(self.tv.index(item1), 0) - self.failUnlessEqual(self.tv.index(c1), 0) - self.failUnlessEqual(self.tv.index(c2), 1) - self.failUnlessEqual(self.tv.index(item2), 1) - - self.tv.move(item2, '', 0) - self.failUnlessEqual(self.tv.index(item2), 0) - self.failUnlessEqual(self.tv.index(item1), 1) - - # check that index still works even after its parent and siblings - # have been detached - self.tv.detach(item1) - self.failUnlessEqual(self.tv.index(c2), 1) - self.tv.detach(c1) - self.failUnlessEqual(self.tv.index(c2), 0) - - # but it fails after item has been deleted - self.tv.delete(item1) - self.failUnlessRaises(tkinter.TclError, self.tv.index, c2) - - - def test_insert_item(self): - # parent 'none' doesn't exist - self.failUnlessRaises(tkinter.TclError, self.tv.insert, 'none', 'end') - - # open values - self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', - open='') - self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', - open='please') - self.failIf(self.tv.delete(self.tv.insert('', 'end', open=True))) - self.failIf(self.tv.delete(self.tv.insert('', 'end', open=False))) - - # invalid index - self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'middle') - - # trying to duplicate item id is invalid - itemid = self.tv.insert('', 'end', 'first-item') - self.failUnlessEqual(itemid, 'first-item') - self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', - 'first-item') - self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', - MockTclObj('first-item')) - - # unicode values - value = '\xe1ba' - item = self.tv.insert('', 'end', values=(value, )) - self.failUnlessEqual(self.tv.item(item, 'values'), (value, )) - self.failUnlessEqual(self.tv.item(item, values=None), (value, )) - - self.tv.item(item, values=list(self.tv.item(item, values=None))) - self.failUnlessEqual(self.tv.item(item, values=None), (value, )) - - self.failUnless(isinstance(self.tv.item(item), dict)) - - # erase item values - self.tv.item(item, values='') - self.failIf(self.tv.item(item, values=None)) - - # item tags - item = self.tv.insert('', 'end', tags=[1, 2, value]) - self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2', value)) - self.tv.item(item, tags=[]) - self.failIf(self.tv.item(item, tags=None)) - self.tv.item(item, tags=(1, 2)) - self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2')) - - # values with spaces - item = self.tv.insert('', 'end', values=('a b c', - '%s %s' % (value, value))) - self.failUnlessEqual(self.tv.item(item, values=None), - ('a b c', '%s %s' % (value, value))) - - # text - self.failUnlessEqual(self.tv.item( - self.tv.insert('', 'end', text="Label here"), text=None), - "Label here") - self.failUnlessEqual(self.tv.item( - self.tv.insert('', 'end', text=value), text=None), - value) - - - def test_set(self): - self.tv['columns'] = ['A', 'B'] - item = self.tv.insert('', 'end', values=['a', 'b']) - self.failUnlessEqual(self.tv.set(item), {'A': 'a', 'B': 'b'}) - - self.tv.set(item, 'B', 'a') - self.failUnlessEqual(self.tv.item(item, values=None), ('a', 'a')) - - self.tv['columns'] = ['B'] - self.failUnlessEqual(self.tv.set(item), {'B': 'a'}) - - self.tv.set(item, 'B', 'b') - self.failUnlessEqual(self.tv.set(item, column='B'), 'b') - self.failUnlessEqual(self.tv.item(item, values=None), ('b', 'a')) - - self.tv.set(item, 'B', 123) - self.failUnlessEqual(self.tv.set(item, 'B'), 123) - self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) - self.failUnlessEqual(self.tv.set(item), {'B': 123}) - - # inexistant column - self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A') - self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A', 'b') - - # inexistant item - self.failUnlessRaises(tkinter.TclError, self.tv.set, 'notme') - - - def test_tag_bind(self): - events = [] - item1 = self.tv.insert('', 'end', tags=['call']) - item2 = self.tv.insert('', 'end', tags=['call']) - self.tv.tag_bind('call', '', - lambda evt: events.append(1)) - self.tv.tag_bind('call', '', - lambda evt: events.append(2)) - - self.tv.pack() - self.tv.wait_visibility() - self.tv.update() - - pos_y = set() - found = set() - for i in range(0, 100, 10): - if len(found) == 2: # item1 and item2 already found - break - item_id = self.tv.identify_row(i) - if item_id and item_id not in found: - pos_y.add(i) - found.add(item_id) - - self.failUnlessEqual(len(pos_y), 2) # item1 and item2 y pos - for y in pos_y: - support.simulate_mouse_click(self.tv, 0, y) - - # by now there should be 4 things in the events list, since each - # item had a bind for two events that were simulated above - self.failUnlessEqual(len(events), 4) - for evt in zip(events[::2], events[1::2]): - self.failUnlessEqual(evt, (1, 2)) - - - def test_tag_configure(self): - # Just testing parameter passing for now - self.failUnlessRaises(TypeError, self.tv.tag_configure) - self.failUnlessRaises(tkinter.TclError, self.tv.tag_configure, - 'test', sky='blue') - self.tv.tag_configure('test', foreground='blue') - self.failUnlessEqual(self.tv.tag_configure('test', 'foreground'), - 'blue') - self.failUnlessEqual(self.tv.tag_configure('test', foreground=None), - 'blue') - self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) - - -def test_main(): - support.run(TreeviewTest) - -if __name__ == "__main__": - test_main() Added: sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py ============================================================================== --- (empty file) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py Tue Jan 27 02:44:40 2009 @@ -0,0 +1,1111 @@ +import unittest +import tkinter +import ttk + +import support +from test_functions import MockTclObj, MockStateSpec + +class WidgetTest(unittest.TestCase): + """Tests methods available in every ttk widget.""" + + def setUp(self): + self.widget = ttk.Button() + self.widget.pack() + self.widget.wait_visibility() + + def tearDown(self): + self.widget.destroy() + + + def test_identify(self): + self.widget.update_idletasks() + self.failUnlessEqual(self.widget.identify(5, 5), "label") + self.failUnlessEqual(self.widget.identify(-1, -1), "") + + self.failUnlessRaises(tkinter.TclError, self.widget.identify, None, 5) + self.failUnlessRaises(tkinter.TclError, self.widget.identify, 5, None) + self.failUnlessRaises(tkinter.TclError, self.widget.identify, 5, '') + + + def test_widget_state(self): + # XXX not sure about the portability of all these tests + self.failUnlessEqual(self.widget.state(), ()) + self.failUnlessEqual(self.widget.instate(['!disabled']), True) + + # changing from !disabled to disabled + self.failUnlessEqual(self.widget.state(['disabled']), ('!disabled', )) + # no state change + self.failUnlessEqual(self.widget.state(['disabled']), ()) + # change back to !disable but also active + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), + ('!active', 'disabled')) + # no state changes, again + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), ()) + self.failUnlessEqual(self.widget.state(['active', '!disabled']), ()) + + def test_cb(arg1, **kw): + return arg1, kw + self.failUnlessEqual(self.widget.instate(['!disabled'], + test_cb, "hi", **{"msg": "there"}), + ('hi', {'msg': 'there'})) + + # attempt to set invalid statespec + currstate = self.widget.state() + self.failUnlessRaises(tkinter.TclError, self.widget.instate, + ['badstate']) + self.failUnlessRaises(tkinter.TclError, self.widget.instate, + ['disabled', 'badstate']) + # verify that widget didn't change its state + self.failUnlessEqual(currstate, self.widget.state()) + + # ensuring that passing None as state doesn't modify current state + self.widget.state(['active', '!disabled']) + self.failUnlessEqual(self.widget.state(), ('active', )) + + +class ButtonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + btn = ttk.Button(command=lambda: success.append(1)) + btn.invoke() + self.failUnless(success) + + +class CheckbuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + cbtn = ttk.Checkbutton(command=cb_test) + # the variable automatically created by ttk.Checkbutton is actually + # undefined till we invoke the Checkbutton + self.failUnlessEqual(cbtn.state(), ('alternate', )) + self.failUnlessRaises(tkinter.TclError, cbtn.tk.globalgetvar, + cbtn['variable']) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['onvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn['command'] = '' + res = cbtn.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn['offvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + + +class ComboboxTest(unittest.TestCase): + + def setUp(self): + self.combo = ttk.Combobox() + + def tearDown(self): + self.combo.destroy() + + def _show_drop_down_listbox(self): + width = self.combo.winfo_width() + self.combo.event_generate('', x=width - 5, y=5) + self.combo.event_generate('', x=width - 5, y=5) + self.combo.update_idletasks() + + + def test_virtual_event(self): + success = [] + + self.combo['values'] = [1] + self.combo.bind('<>', + lambda evt: success.append(True)) + self.combo.pack() + self.combo.wait_visibility() + + height = self.combo.winfo_height() + self._show_drop_down_listbox() + self.combo.update() + self.combo.event_generate('') + self.combo.update() + + self.failUnless(success) + + + def test_postcommand(self): + success = [] + + self.combo['postcommand'] = lambda: success.append(True) + self.combo.pack() + self.combo.wait_visibility() + + self._show_drop_down_listbox() + self.failUnless(success) + + # testing postcommand removal + self.combo['postcommand'] = '' + self._show_drop_down_listbox() + self.failUnlessEqual(len(success), 1) + + + def test_values(self): + def check_get_current(getval, currval): + self.failUnlessEqual(self.combo.get(), getval) + self.failUnlessEqual(self.combo.current(), currval) + + check_get_current('', -1) + + self.combo['values'] = ['a', 1, 'c'] + + self.combo.set('c') + check_get_current('c', 2) + + self.combo.current(0) + check_get_current('a', 0) + + self.combo.set('d') + check_get_current('d', -1) + + # testing values with empty string + self.combo.set('') + self.combo['values'] = (1, 2, '', 3) + check_get_current('', 2) + + # testing values with empty string set through configure + self.combo.configure(values=[1, '', 2]) + self.failUnlessEqual(self.combo['values'], ('1', '', '2')) + + # out of range + self.failUnlessRaises(tkinter.TclError, self.combo.current, + len(self.combo['values'])) + # it expects an integer (or something that can be converted to int) + self.failUnlessRaises(tkinter.TclError, self.combo.current, '') + + # testing creating combobox with empty string in values + combo2 = ttk.Combobox(values=[1, 2, '']) + self.failUnlessEqual(combo2['values'], ('1', '2', '')) + combo2.destroy() + + +class EntryTest(unittest.TestCase): + + def setUp(self): + self.entry = ttk.Entry() + + def tearDown(self): + self.entry.destroy() + + + def test_bbox(self): + self.failUnlessEqual(len(self.entry.bbox(0)), 4) + for item in self.entry.bbox(0): + self.failUnless(isinstance(item, int)) + + self.failUnlessRaises(tkinter.TclError, self.entry.bbox, 'noindex') + self.failUnlessRaises(tkinter.TclError, self.entry.bbox, None) + + + def test_identify(self): + self.entry.pack() + self.entry.wait_visibility() + self.entry.update_idletasks() + + self.failUnlessEqual(self.entry.identify(5, 5), "textarea") + self.failUnlessEqual(self.entry.identify(-1, -1), "") + + self.failUnlessRaises(tkinter.TclError, self.entry.identify, None, 5) + self.failUnlessRaises(tkinter.TclError, self.entry.identify, 5, None) + self.failUnlessRaises(tkinter.TclError, self.entry.identify, 5, '') + + + def test_validation_options(self): + success = [] + test_invalid = lambda: success.append(True) + + self.entry['validate'] = 'none' + self.entry['validatecommand'] = lambda: False + + self.entry['invalidcommand'] = test_invalid + self.entry.validate() + self.failUnless(success) + + self.entry['invalidcommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['invalidcommand'] = test_invalid + self.entry['validatecommand'] = lambda: True + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = True + self.failUnlessRaises(tkinter.TclError, self.entry.validate) + + + def test_validation(self): + validation = [] + def validate(to_insert): + if not 'a' <= to_insert.lower() <= 'z': + validation.append(False) + return False + validation.append(True) + return True + + self.entry['validate'] = 'key' + self.entry['validatecommand'] = self.entry.register(validate), '%S' + + self.entry.insert('end', 1) + self.entry.insert('end', 'a') + self.failUnlessEqual(validation, [False, True]) + self.failUnlessEqual(self.entry.get(), 'a') + + + def test_revalidation(self): + def validate(content): + for letter in content: + if not 'a' <= letter.lower() <= 'z': + return False + return True + + self.entry['validatecommand'] = self.entry.register(validate), '%P' + + self.entry.insert('end', 'avocado') + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + self.entry.delete(0, 'end') + self.failUnlessEqual(self.entry.get(), '') + + self.entry.insert('end', 'a1b') + self.failUnlessEqual(self.entry.validate(), False) + self.failUnlessEqual(self.entry.state(), ('invalid', )) + + self.entry.delete(1) + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + +class PanedwindowTest(unittest.TestCase): + + def setUp(self): + self.paned = ttk.Panedwindow() + + def tearDown(self): + self.paned.destroy() + + + def test_add(self): + # attempt to add a child that is not a direct child of the paned window + label = ttk.Label(self.paned) + child = ttk.Label(label) + self.failUnlessRaises(tkinter.TclError, self.paned.add, child) + label.destroy() + child.destroy() + # another attempt + label = ttk.Label() + child = ttk.Label(label) + self.failUnlessRaises(tkinter.TclError, self.paned.add, child) + child.destroy() + label.destroy() + + good_child = ttk.Label() + self.paned.add(good_child) + # re-adding a child is not accepted + self.failUnlessRaises(tkinter.TclError, self.paned.add, good_child) + + other_child = ttk.Label(self.paned) + self.paned.add(other_child) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(1)) + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 2) + good_child.destroy() + other_child.destroy() + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0) + + + def test_forget(self): + self.failUnlessRaises(tkinter.TclError, self.paned.forget, None) + self.failUnlessRaises(tkinter.TclError, self.paned.forget, 0) + + self.paned.add(ttk.Label()) + self.paned.forget(0) + self.failUnlessRaises(tkinter.TclError, self.paned.forget, 0) + + + def test_insert(self): + self.failUnlessRaises(tkinter.TclError, self.paned.insert, None, 0) + self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, None) + self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, 0) + + child = ttk.Label() + child2 = ttk.Label() + child3 = ttk.Label() + + self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, child) + + self.paned.insert('end', child2) + self.paned.insert(0, child) + self.failUnlessEqual(self.paned.panes(), (str(child), str(child2))) + + self.paned.insert(0, child2) + self.failUnlessEqual(self.paned.panes(), (str(child2), str(child))) + + self.paned.insert('end', child3) + self.failUnlessEqual(self.paned.panes(), + (str(child2), str(child), str(child3))) + + # reinserting a child should move it to its current position + panes = self.paned.panes() + self.paned.insert('end', child3) + self.failUnlessEqual(panes, self.paned.panes()) + + # moving child3 to child2 position should result in child2 ending up + # in previous child position and child ending up in previous child3 + # position + self.paned.insert(child2, child3) + self.failUnlessEqual(self.paned.panes(), + (str(child3), str(child2), str(child))) + + + def test_pane(self): + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0) + + child = ttk.Label() + self.paned.add(child) + self.failUnless(isinstance(self.paned.pane(0), dict)) + self.failUnlessEqual(self.paned.pane(0, weight=None), 0) + # newer form for querying a single option + self.failUnlessEqual(self.paned.pane(0, 'weight'), 0) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(str(child))) + + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0, + badoption='somevalue') + + + def test_sashpos(self): + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, None) + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, '') + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 0) + + child = ttk.Label(self.paned, text='a') + self.paned.add(child, weight=1) + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 0) + child2 = ttk.Label(self.paned, text='b') + self.paned.add(child2) + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 1) + + self.paned.pack(expand=True, fill='both') + self.paned.wait_visibility() + + curr_pos = self.paned.sashpos(0) + self.paned.sashpos(0, 1000) + self.failUnless(curr_pos != self.paned.sashpos(0)) + self.failUnless(isinstance(self.paned.sashpos(0), int)) + + +class RadiobuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + myvar = tkinter.IntVar() + cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0) + cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn2['command'] = '' + res = cbtn2.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn2['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + + self.failUnlessEqual(str(cbtn['variable']), str(cbtn2['variable'])) + + + +class ScaleTest(unittest.TestCase): + + def setUp(self): + self.scale = ttk.Scale() + self.scale.pack() + self.scale.update() + + def tearDown(self): + self.scale.destroy() + + + def test_custom_event(self): + failure = [1, 1, 1] # will need to be empty + + funcid = self.scale.bind('<>', lambda evt: failure.pop()) + + self.scale['from'] = 10 + self.scale['from_'] = 10 + self.scale['to'] = 3 + + self.failIf(failure) + + failure = [1, 1, 1] + self.scale.configure(from_=2, to=5) + self.scale.configure(from_=0, to=-2) + self.scale.configure(to=10) + + self.failIf(failure) + + + def test_get(self): + scale_width = self.scale.winfo_width() + self.failUnlessEqual(self.scale.get(scale_width, 0), self.scale['to']) + + self.failUnlessEqual(self.scale.get(0, 0), self.scale['from']) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + self.scale['value'] = 30 + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + self.failUnlessRaises(tkinter.TclError, self.scale.get, '', 0) + self.failUnlessRaises(tkinter.TclError, self.scale.get, 0, '') + + + def test_set(self): + # set restricts the max/min values according to the current range + max = self.scale['to'] + new_max = max + 10 + self.scale.set(new_max) + self.failUnlessEqual(self.scale.get(), max) + min = self.scale['from'] + self.scale.set(min - 1) + self.failUnlessEqual(self.scale.get(), min) + + # changing directly the variable doesn't impose this limitation tho + var = tkinter.DoubleVar() + self.scale['variable'] = var + var.set(max + 5) + self.failUnlessEqual(self.scale.get(), var.get()) + self.failUnlessEqual(self.scale.get(), max + 5) + del var + + # the same happens with the value option + self.scale['value'] = max + 10 + self.failUnlessEqual(self.scale.get(), max + 10) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + # nevertheless, note that the max/min values we can get specifying + # x, y coords are the ones according to the current range + self.failUnlessEqual(self.scale.get(0, 0), min) + self.failUnlessEqual(self.scale.get(self.scale.winfo_width(), 0), max) + + self.failUnlessRaises(tkinter.TclError, self.scale.set, None) + + +class NotebookTest(unittest.TestCase): + + def setUp(self): + self.nb = ttk.Notebook() + self.child1 = ttk.Label() + self.child2 = ttk.Label() + self.nb.add(self.child1, text='a') + self.nb.add(self.child2, text='b') + + def tearDown(self): + self.child1.destroy() + self.child2.destroy() + self.nb.destroy() + + + def test_tab_identifiers(self): + self.nb.forget(0) + self.nb.hide(self.child2) + self.failUnlessRaises(tkinter.TclError, self.nb.tab, self.child1) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.select(self.child2) + + self.failUnless(self.nb.tab('current')) + self.nb.add(self.child1, text='a') + + self.nb.pack() + self.nb.wait_visibility() + self.failUnlessEqual(self.nb.tab('@5,5'), self.nb.tab('current')) + + for i in range(5, 100, 5): + if self.nb.tab('@%d, 5' % i, text=None) == 'a': + break + else: + self.fail("Tab with text 'a' not found") + + + def test_add_and_hidden(self): + self.failUnlessRaises(tkinter.TclError, self.nb.hide, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.hide, 'hi') + self.failUnlessRaises(tkinter.TclError, self.nb.hide, None) + self.failUnlessRaises(tkinter.TclError, self.nb.add, None) + self.failUnlessRaises(tkinter.TclError, self.nb.add, ttk.Label(), + unknown='option') + + tabs = self.nb.tabs() + self.nb.hide(self.child1) + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.tabs(), tabs) + + child = ttk.Label() + self.nb.add(child, text='c') + tabs = self.nb.tabs() + + curr = self.nb.index('current') + # verify that the tab gets readded at its previous position + child2_index = self.nb.index(self.child2) + self.nb.hide(self.child2) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.failUnlessEqual(self.nb.index(self.child2), child2_index) + self.failUnless(str(self.child2) == self.nb.tabs()[child2_index]) + # but the tab next to it (not hidden) is the one selected now + self.failUnlessEqual(self.nb.index('current'), curr + 1) + + + def test_forget(self): + self.failUnlessRaises(tkinter.TclError, self.nb.forget, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.forget, 'hi') + self.failUnlessRaises(tkinter.TclError, self.nb.forget, None) + + tabs = self.nb.tabs() + child1_index = self.nb.index(self.child1) + self.nb.forget(self.child1) + self.failIf(str(self.child1) in self.nb.tabs()) + self.failUnlessEqual(len(tabs) - 1, len(self.nb.tabs())) + + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.index(self.child1), 1) + self.failIf(child1_index == self.nb.index(self.child1)) + + + def test_index(self): + self.failUnlessRaises(tkinter.TclError, self.nb.index, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.index, None) + + self.failUnless(isinstance(self.nb.index('end'), int)) + self.failUnlessEqual(self.nb.index(self.child1), 0) + self.failUnlessEqual(self.nb.index(self.child2), 1) + self.failUnlessEqual(self.nb.index('end'), 2) + + + def test_insert(self): + # moving tabs + tabs = self.nb.tabs() + self.nb.insert(1, tabs[0]) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert(self.child1, self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert('end', self.child1) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert('end', 0) + self.failUnlessEqual(self.nb.tabs(), tabs) + # bad moves + self.failUnlessRaises(tkinter.TclError, self.nb.insert, 2, tabs[0]) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, -1, tabs[0]) + + # new tab + child3 = ttk.Label() + self.nb.insert(1, child3) + self.failUnlessEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1])) + self.nb.forget(child3) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert(self.child1, child3) + self.failUnlessEqual(self.nb.tabs(), (str(child3), ) + tabs) + self.nb.forget(child3) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, 2, child3) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, -1, child3) + + # bad inserts + self.failUnlessRaises(tkinter.TclError, self.nb.insert, 'end', None) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, None, 0) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, None, None) + + + def test_select(self): + self.nb.pack() + self.nb.wait_visibility() + + success = [] + tab_changed = [] + + self.child1.bind('', lambda evt: success.append(True)) + self.nb.bind('<>', + lambda evt: tab_changed.append(True)) + + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.select(self.child2) + self.failUnless(success) + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.update() + self.failUnless(tab_changed) + + + def test_tab(self): + self.failUnlessRaises(tkinter.TclError, self.nb.tab, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.tab, 'notab') + self.failUnlessRaises(tkinter.TclError, self.nb.tab, None) + + self.failUnless(isinstance(self.nb.tab(self.child1), dict)) + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'a') + # newer form for querying a single option + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'a') + self.nb.tab(self.child1, text='abc') + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'abc') + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'abc') + + + def test_tabs(self): + self.failUnlessEqual(len(self.nb.tabs()), 2) + + self.nb.forget(self.child1) + self.nb.forget(self.child2) + + self.failUnlessEqual(self.nb.tabs(), ()) + + + def test_traversal(self): + self.nb.pack() + self.nb.wait_visibility() + + self.nb.select(0) + + support.simulate_mouse_click(self.nb, 5, 5) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.tab(self.child1, text='a', underline=0) + self.nb.enable_traversal() + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + + +class TreeviewTest(unittest.TestCase): + + def setUp(self): + self.tv = ttk.Treeview() + + def tearDown(self): + self.tv.destroy() + + + def test_bbox(self): + self.tv.pack() + self.failUnlessEqual(self.tv.bbox(''), '') + self.tv.wait_visibility() + self.tv.update() + + item_id = self.tv.insert('', 'end') + children = self.tv.get_children() + self.failUnless(children) + + bbox = self.tv.bbox(children[0]) + self.failUnlessEqual(len(bbox), 4) + self.failUnless(isinstance(bbox, tuple)) + for item in bbox: + if not isinstance(item, int): + self.fail("Invalid bounding box: %s" % bbox) + break + + # compare width in bboxes + self.tv['columns'] = ['test'] + self.tv.column('test', width=50) + bbox_column0 = self.tv.bbox(children[0], 0) + root_width = self.tv.column('#0', width=None) + self.failUnlessEqual(bbox_column0[0], bbox[0] + root_width) + + # verify that bbox of a closed item is the empty string + child1 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.bbox(child1), '') + + + def test_children(self): + # no children yet, should get an empty tuple + self.failUnlessEqual(self.tv.get_children(), ()) + + item_id = self.tv.insert('', 'end') + self.failUnless(isinstance(self.tv.get_children(), tuple)) + self.failUnlessEqual(self.tv.get_children()[0], item_id) + + # add item_id and child3 as children of child2 + child2 = self.tv.insert('', 'end') + child3 = self.tv.insert('', 'end') + self.tv.set_children(child2, item_id, child3) + self.failUnlessEqual(self.tv.get_children(child2), (item_id, child3)) + + # child3 has child2 as parent, thus trying to set child2 as a children + # of child3 should result in an error + self.failUnlessRaises(tkinter.TclError, + self.tv.set_children, child3, child2) + + # remove child2 children + self.tv.set_children(child2) + self.failUnlessEqual(self.tv.get_children(child2), ()) + + # remove root's children + self.tv.set_children('') + self.failUnlessEqual(self.tv.get_children(), ()) + + + def test_column(self): + # return a dict with all options/values + self.failUnless(isinstance(self.tv.column('#0'), dict)) + # return a single value of the given option + self.failUnless(isinstance(self.tv.column('#0', width=None), int)) + # set a new value for an option + self.tv.column('#0', width=10) + # testing new way to get option value + self.failUnlessEqual(self.tv.column('#0', 'width'), 10) + self.failUnlessEqual(self.tv.column('#0', width=None), 10) + # check read-only option + self.failUnlessRaises(tkinter.TclError, self.tv.column, '#0', id='X') + + self.failUnlessRaises(tkinter.TclError, self.tv.column, 'invalid') + invalid_kws = [ + {'unknown_option': 'some value'}, {'stretch': 'wrong'}, + {'anchor': 'wrong'}, {'width': 'wrong'}, {'minwidth': 'wrong'} + ] + for kw in invalid_kws: + self.failUnlessRaises(tkinter.TclError, self.tv.column, '#0', + **kw) + + + def test_delete(self): + self.failUnlessRaises(tkinter.TclError, self.tv.delete, '#0') + + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + self.tv.delete(item_id) + self.failIf(self.tv.get_children()) + + # reattach should fail + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, item_id, '', 'end') + + # test multiple item delete + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + self.failUnlessEqual(self.tv.get_children(), (item1, item2)) + + self.tv.delete(item1, item2) + self.failIf(self.tv.get_children()) + + + def test_detach_reattach(self): + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + + # calling detach without items is valid, although it does nothing + prev = self.tv.get_children() + self.tv.detach() # this should do nothing + self.failUnlessEqual(prev, self.tv.get_children()) + + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # detach item with children + self.tv.detach(item_id) + self.failIf(self.tv.get_children()) + + # reattach item with children + self.tv.reattach(item_id, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # move a children to the root + self.tv.move(item2, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, item2)) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + # bad values + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, 'nonexistant', '', 'end') + self.failUnlessRaises(tkinter.TclError, + self.tv.detach, 'nonexistant') + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, item2, 'otherparent', 'end') + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, item2, '', 'invalid') + + # multiple detach + self.tv.detach(item_id, item2) + self.failUnlessEqual(self.tv.get_children(), ()) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + + def test_exists(self): + self.failUnlessEqual(self.tv.exists('something'), False) + self.failUnlessEqual(self.tv.exists(''), True) + self.failUnlessEqual(self.tv.exists({}), False) + + # the following will make a tk.call equivalent to + # tk.call(treeview, "exists") which should result in an error + # in the tcl interpreter since tk requires an item. + self.failUnlessRaises(tkinter.TclError, self.tv.exists, None) + + + def test_focus(self): + # nothing is focused right now + self.failUnlessEqual(self.tv.focus(), '') + + item1 = self.tv.insert('', 'end') + self.tv.focus(item1) + self.failUnlessEqual(self.tv.focus(), item1) + + self.tv.delete(item1) + self.failUnlessEqual(self.tv.focus(), '') + + # try focusing inexistant item + self.failUnlessRaises(tkinter.TclError, self.tv.focus, 'hi') + + + def test_heading(self): + # check a dict is returned + self.failUnless(isinstance(self.tv.heading('#0'), dict)) + + # check a value is returned + self.tv.heading('#0', text='hi') + self.failUnlessEqual(self.tv.heading('#0', 'text'), 'hi') + self.failUnlessEqual(self.tv.heading('#0', text=None), 'hi') + + # invalid option + self.failUnlessRaises(tkinter.TclError, self.tv.heading, '#0', + background=None) + # invalid value + self.failUnlessRaises(tkinter.TclError, self.tv.heading, '#0', + anchor=1) + + + def test_heading_callback(self): + def simulate_heading_click(x, y): + support.simulate_mouse_click(self.tv, x, y) + self.tv.update_idletasks() + + success = [] # no success for now + + self.tv.pack() + self.tv.wait_visibility() + self.tv.heading('#0', command=lambda: success.append(True)) + self.tv.column('#0', width=100) + self.tv.update() + + # assuming that the coords (5, 5) fall into heading #0 + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + success = [] + commands = self.tv.master._tclCommands + self.tv.heading('#0', command=str(self.tv.heading('#0', command=None))) + self.failUnlessEqual(commands, self.tv.master._tclCommands) + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + # XXX The following raises an error in a tcl interpreter, but not in + # Python + #self.tv.heading('#0', command='I dont exist') + #simulate_heading_click(5, 5) + + + def test_index(self): + # item 'what' doesn't exist + self.failUnlessRaises(tkinter.TclError, self.tv.index, 'what') + + self.failUnlessEqual(self.tv.index(''), 0) + + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + c1 = self.tv.insert(item1, 'end') + c2 = self.tv.insert(item1, 'end') + self.failUnlessEqual(self.tv.index(item1), 0) + self.failUnlessEqual(self.tv.index(c1), 0) + self.failUnlessEqual(self.tv.index(c2), 1) + self.failUnlessEqual(self.tv.index(item2), 1) + + self.tv.move(item2, '', 0) + self.failUnlessEqual(self.tv.index(item2), 0) + self.failUnlessEqual(self.tv.index(item1), 1) + + # check that index still works even after its parent and siblings + # have been detached + self.tv.detach(item1) + self.failUnlessEqual(self.tv.index(c2), 1) + self.tv.detach(c1) + self.failUnlessEqual(self.tv.index(c2), 0) + + # but it fails after item has been deleted + self.tv.delete(item1) + self.failUnlessRaises(tkinter.TclError, self.tv.index, c2) + + + def test_insert_item(self): + # parent 'none' doesn't exist + self.failUnlessRaises(tkinter.TclError, self.tv.insert, 'none', 'end') + + # open values + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + open='') + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + open='please') + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=True))) + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=False))) + + # invalid index + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'middle') + + # trying to duplicate item id is invalid + itemid = self.tv.insert('', 'end', 'first-item') + self.failUnlessEqual(itemid, 'first-item') + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + 'first-item') + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + MockTclObj('first-item')) + + # unicode values + value = '\xe1ba' + item = self.tv.insert('', 'end', values=(value, )) + self.failUnlessEqual(self.tv.item(item, 'values'), (value, )) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.tv.item(item, values=list(self.tv.item(item, values=None))) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.failUnless(isinstance(self.tv.item(item), dict)) + + # erase item values + self.tv.item(item, values='') + self.failIf(self.tv.item(item, values=None)) + + # item tags + item = self.tv.insert('', 'end', tags=[1, 2, value]) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2', value)) + self.tv.item(item, tags=[]) + self.failIf(self.tv.item(item, tags=None)) + self.tv.item(item, tags=(1, 2)) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2')) + + # values with spaces + item = self.tv.insert('', 'end', values=('a b c', + '%s %s' % (value, value))) + self.failUnlessEqual(self.tv.item(item, values=None), + ('a b c', '%s %s' % (value, value))) + + # text + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text="Label here"), text=None), + "Label here") + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text=value), text=None), + value) + + + def test_set(self): + self.tv['columns'] = ['A', 'B'] + item = self.tv.insert('', 'end', values=['a', 'b']) + self.failUnlessEqual(self.tv.set(item), {'A': 'a', 'B': 'b'}) + + self.tv.set(item, 'B', 'a') + self.failUnlessEqual(self.tv.item(item, values=None), ('a', 'a')) + + self.tv['columns'] = ['B'] + self.failUnlessEqual(self.tv.set(item), {'B': 'a'}) + + self.tv.set(item, 'B', 'b') + self.failUnlessEqual(self.tv.set(item, column='B'), 'b') + self.failUnlessEqual(self.tv.item(item, values=None), ('b', 'a')) + + self.tv.set(item, 'B', 123) + self.failUnlessEqual(self.tv.set(item, 'B'), 123) + self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) + self.failUnlessEqual(self.tv.set(item), {'B': 123}) + + # inexistant column + self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A') + self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A', 'b') + + # inexistant item + self.failUnlessRaises(tkinter.TclError, self.tv.set, 'notme') + + + def test_tag_bind(self): + events = [] + item1 = self.tv.insert('', 'end', tags=['call']) + item2 = self.tv.insert('', 'end', tags=['call']) + self.tv.tag_bind('call', '', + lambda evt: events.append(1)) + self.tv.tag_bind('call', '', + lambda evt: events.append(2)) + + self.tv.pack() + self.tv.wait_visibility() + self.tv.update() + + pos_y = set() + found = set() + for i in range(0, 100, 10): + if len(found) == 2: # item1 and item2 already found + break + item_id = self.tv.identify_row(i) + if item_id and item_id not in found: + pos_y.add(i) + found.add(item_id) + + self.failUnlessEqual(len(pos_y), 2) # item1 and item2 y pos + for y in pos_y: + support.simulate_mouse_click(self.tv, 0, y) + + # by now there should be 4 things in the events list, since each + # item had a bind for two events that were simulated above + self.failUnlessEqual(len(events), 4) + for evt in zip(events[::2], events[1::2]): + self.failUnlessEqual(evt, (1, 2)) + + + def test_tag_configure(self): + # Just testing parameter passing for now + self.failUnlessRaises(TypeError, self.tv.tag_configure) + self.failUnlessRaises(tkinter.TclError, self.tv.tag_configure, + 'test', sky='blue') + self.tv.tag_configure('test', foreground='blue') + self.failUnlessEqual(self.tv.tag_configure('test', 'foreground'), + 'blue') + self.failUnlessEqual(self.tv.tag_configure('test', foreground=None), + 'blue') + self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) + + +def test_main(): + support.run(WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, + ComboboxTest, EntryTest, PanedwindowTest, ScaleTest, NotebookTest, + TreeviewTest) + +if __name__ == "__main__": + test_main() From python-checkins at python.org Tue Jan 27 02:44:50 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 02:44:50 +0100 (CET) Subject: [Python-checkins] r68995 - python/branches/py3k/Lib/importlib/test/frozen/test_finder.py Message-ID: <20090127014450.5F2851E4021@bag.python.org> Author: brett.cannon Date: Tue Jan 27 02:44:50 2009 New Revision: 68995 Log: Move importlib.test.frozen.test_finder over to importlib.test.finder_tests. Modified: python/branches/py3k/Lib/importlib/test/frozen/test_finder.py Modified: python/branches/py3k/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/frozen/test_finder.py Tue Jan 27 02:44:50 2009 @@ -1,11 +1,10 @@ -from importlib import machinery -from ..builtin import test_finder -from .. import support +from ... import machinery +from .. import finder_tests import unittest -class FinderTests(test_finder.FinderTests): +class FinderTests(finder_tests.FinderTests): """Test finding frozen modules.""" @@ -13,7 +12,6 @@ finder = machinery.FrozenImporter return finder.find_module(name, path) - def test_module(self): name = '__hello__' loader = self.find(name) @@ -28,6 +26,11 @@ self.assert_(hasattr(loader, 'load_module')) def test_package_in_package(self): + # No frozen package within another package to test with. + pass + + def test_package_over_module(self): + # No easy way to test. pass def test_failure(self): From python-checkins at python.org Tue Jan 27 02:46:05 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 02:46:05 +0100 (CET) Subject: [Python-checkins] r68996 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090127014605.23E141E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 27 02:46:04 2009 New Revision: 68996 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 Tue Jan 27 02:46:04 2009 @@ -1,8 +1,15 @@ to do ///// -* Create reasonable base tests that all finders and loaders must pass so - that various implementations can just subclass as needed. +* Standardized loader tests. + + + Create test.loader_tests. + + Use + + - builtin + - frozen + - extension + -source * Reorganize support code. From buildbot at python.org Tue Jan 27 02:50:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 01:50:26 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090127015026.CC3931E400C@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/552 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 buildbot at python.org Tue Jan 27 03:13:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 02:13:20 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090127021321.169861E4002@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/74 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: 2 tests failed: test_calendar test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python at rcn.com Tue Jan 27 03:20:41 2009 From: python at rcn.com (Raymond Hettinger) Date: Mon, 26 Jan 2009 18:20:41 -0800 Subject: [Python-checkins] r68962 - in python/branches/release30-maint: Doc/library/operator.rst Lib/locale.py Lib/test/test_array.py Lib/test/test_bool.pyLib/test/test_operator.pyMisc/NEWS Modules/operator.c References: <20090126034449.5D2C71E4002@bag.python.org> Message-ID: >> Modified: python/branches/release30-maint/Lib/test/test_array.py >> ============================================================================== >> --- python/branches/release30-maint/Lib/test/test_array.py (original) >> +++ python/branches/release30-maint/Lib/test/test_array.py Mon Jan 26 04:44:49 > 2009 >> @@ -725,8 +725,6 @@ >> self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) >> self.assertRaises(BufferError, operator.delitem, a, 0) >> self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) >> - self.assertRaises(BufferError, operator.irepeat, a, 2) >> - self.assertRaises(BufferError, operator.irepeat, a, 0) > > I think these tests should have been written differently, rather than removed. > While operator.irepeat has disappeared, the operation being tested still exists. I will rewrite the tests. Raymond From python-checkins at python.org Tue Jan 27 03:30:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 27 Jan 2009 03:30:47 +0100 (CET) Subject: [Python-checkins] r68997 - python/branches/py3k Message-ID: <20090127023047.B269E1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 27 03:30:47 2009 New Revision: 68997 Log: Blocked revisions 68964,68985 via svnmerge ........ r68964 | raymond.hettinger | 2009-01-26 10:52:22 -0600 (Mon, 26 Jan 2009) | 1 line Fix signed/unsigned mismatch. ........ r68985 | raymond.hettinger | 2009-01-26 17:29:09 -0600 (Mon, 26 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. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Jan 27 03:36:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 03:36:33 +0100 (CET) Subject: [Python-checkins] r68998 - python/trunk/Doc/library/collections.rst Message-ID: <20090127023633.EB5B61E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 03:36:33 2009 New Revision: 68998 Log: Tweak column alignment 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 Jan 27 03:36:33 2009 @@ -183,10 +183,10 @@ Elements are counted from an *iterable* or initialized from another *mapping* (or counter):: - >>> c = Counter() # a new, empty counter - >>> c = Counter('gallahad') # a new counter from an iterable - >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping - >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(cats=4, dogs=8) # a new counter from keyword args Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:: @@ -219,10 +219,10 @@ .. 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* is not specified or is ``None``, - return a list of all element counts in decreasing order of frequency. - Elements with equal counts are ordered arbitrarily:: + 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` + returns *all* elements in the counter. Elements with equal counts are + ordered arbitrarily:: >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] @@ -232,33 +232,26 @@ .. method:: fromkeys(iterable) - This class method is not implemented for :class:`Counter` objects. + This class method is not implemented for :class:`Counter` objects. .. method:: update([iterable-or-mapping]) - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter). Like :meth:`dict.update` but adds-in counts - instead of replacing them. Also, the *iterable* is expected to be a - sequence of elements, not a sequence of ``(key, value)`` pairs:: - - >>> c = Counter('which') - >>> c.update('witch') # add elements from another iterable - >>> d = Counter('watch') - >>> c.update(d) # add elements from another counter - >>> c['h'] # four 'h' in which, witch, and watch - 4 + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter). Like :meth:`dict.update` but adds counts + instead of replacing them. Also, the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs. Common patterns for working with :class:`Counter` objects:: - sum(c.values()) # total of all counts - c.clear() # reset all counts - list(c) # list unique elements - set(c) # convert to a set - dict(c) # convert to a regular dictionary - c.items() # convert to a list of (elem, cnt) pairs - Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs - c.most_common()[:-n:-1] # n least common elements - c += Counter() # remove zero and negative counts + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + 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 @@ -270,13 +263,13 @@ >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) - >>> c + d # add two counters together: c[x] + d[x] + >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) - >>> c - d # subtract (keeping only positive counts) + >>> c - d # subtract (keeping only positive counts) Counter({'a': 2}) - >>> c & d # intersection: min(c[x], d[x]) + >>> c & d # intersection: min(c[x], d[x]) Counter({'a': 1, 'b': 1}) - >>> c | d # union: max(c[x], d[x]) + >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) .. seealso:: From python-checkins at python.org Tue Jan 27 03:38:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 03:38:22 +0100 (CET) Subject: [Python-checkins] r68999 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090127023822.C67C31E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 03:38:22 2009 New Revision: 68999 Log: Tweak column alignment in 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 Jan 27 03:38:22 2009 @@ -171,10 +171,10 @@ Elements are counted from an *iterable* or initialized from another *mapping* (or counter):: - >>> c = Counter() # a new, empty counter - >>> c = Counter('gallahad') # a new counter from an iterable - >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping - >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(cats=4, dogs=8) # a new counter from keyword args Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:: @@ -207,10 +207,10 @@ .. 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* is not specified or is ``None``, - return a list of all element counts in decreasing order of frequency. - Elements with equal counts are ordered arbitrarily:: + 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` + returns *all* elements in the counter. Elements with equal counts are + ordered arbitrarily:: >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] @@ -220,33 +220,26 @@ .. method:: fromkeys(iterable) - This class method is not implemented for :class:`Counter` objects. + This class method is not implemented for :class:`Counter` objects. .. method:: update([iterable-or-mapping]) - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter). Like :meth:`dict.update` but adds-in counts - instead of replacing them. Also, the *iterable* is expected to be a - sequence of elements, not a sequence of ``(key, value)`` pairs:: - - >>> c = Counter('which') - >>> c.update('witch') # add elements from another iterable - >>> d = Counter('watch') - >>> c.update(d) # add elements from another counter - >>> c['h'] # four 'h' in which, witch, and watch - 4 + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter). Like :meth:`dict.update` but adds counts + instead of replacing them. Also, the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs. Common patterns for working with :class:`Counter` objects:: - sum(c.values()) # total of all counts - c.clear() # reset all counts - list(c) # list unique elements - set(c) # convert to a set - dict(c) # convert to a regular dictionary - c.items() # convert to a list of (elem, cnt) pairs - Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs - c.most_common()[:-n:-1] # n least common elements - c += Counter() # remove zero and negative counts + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + 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 @@ -258,13 +251,13 @@ >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) - >>> c + d # add two counters together: c[x] + d[x] + >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) - >>> c - d # subtract (keeping only positive counts) + >>> c - d # subtract (keeping only positive counts) Counter({'a': 2}) - >>> c & d # intersection: min(c[x], d[x]) + >>> c & d # intersection: min(c[x], d[x]) Counter({'a': 1, 'b': 1}) - >>> c | d # union: max(c[x], d[x]) + >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) .. seealso:: From python-checkins at python.org Tue Jan 27 03:39:33 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 03:39:33 +0100 (CET) Subject: [Python-checkins] r69000 - in python/branches/py3k/Lib/importlib: NOTES test/loader_tests.py Message-ID: <20090127023933.A04561E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 27 03:39:33 2009 New Revision: 69000 Log: Initial take on importlib.test.loader_tests. Added: python/branches/py3k/Lib/importlib/test/loader_tests.py 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 Jan 27 03:39:33 2009 @@ -1,15 +1,12 @@ to do ///// -* Standardized loader tests. +* Use test.loader_tests - + Create test.loader_tests. - + Use - - - builtin - - frozen - - extension - -source + + builtin + + frozen + + extension + + source * Reorganize support code. Added: python/branches/py3k/Lib/importlib/test/loader_tests.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/loader_tests.py Tue Jan 27 03:39:33 2009 @@ -0,0 +1,61 @@ +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 From python-checkins at python.org Tue Jan 27 03:58:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 03:58:49 +0100 (CET) Subject: [Python-checkins] r69001 - in python/trunk: Doc/library/collections.rst Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090127025849.ABCDF1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 03:58:49 2009 New Revision: 69001 Log: Promote combinations_with_replacement() from a recipe to a regular itertool. Modified: python/trunk/Doc/library/collections.rst 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/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Tue Jan 27 03:58:49 2009 @@ -291,8 +291,7 @@ Section 4.6.3, Exercise 19*\. * To enumerate all distinct multisets of a given size over a given set of - elements, see :func:`combinations_with_replacement` in the - :ref:`itertools-recipes` for itertools:: + elements, see :func:`itertools.combinations_with_replacement`. map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Tue Jan 27 03:58:49 2009 @@ -139,6 +139,53 @@ .. versionadded:: 2.6 +.. function:: combinations_with_replacement(iterable, r) + + Return *r* length subsequences of elements from the input *iterable* + allowing individual elements to be repeated more than once. + + Combinations are emitted in lexicographic sort order. So, if the + input *iterable* is sorted, the combination tuples will be produced + in sorted order. + + Elements are treated as unique based on their position, not on their + value. So if the input elements are unique, the generated combinations + will also be unique. + + Equivalent to:: + + def combinations_with_replacement(iterable, r): + # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + The code for :func:`combinations_with_replacement` can be also expressed as + a subsequence of :func:`product` after filtering entries where the elements + are not in sorted order (according to their position in the input pool):: + + def combinations_with_replacement(iterable, r): + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``. + + .. versionadded:: 2.7 + .. function:: compress(data, selectors) Make an iterator that filters elements from *data* returning only those that @@ -691,22 +738,6 @@ s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) - def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" - # number items returned: (n+r-1)! / r! / (n-1)! - pool = tuple(iterable) - n = len(pool) - indices = [0] * r - yield tuple(pool[i] for i in indices) - while 1: - for i in reversed(range(r)): - if indices[i] != n - 1: - break - else: - return - 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 Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Tue Jan 27 03:58:49 2009 @@ -127,6 +127,76 @@ self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(combinations('abcde', 3))))), 1) + def test_combinations_with_replacement(self): + cwr = combinations_with_replacement + self.assertRaises(TypeError, cwr, 'abc') # missing r argument + self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments + self.assertRaises(TypeError, cwr, None) # pool is not iterable + self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative + self.assertEqual(list(cwr('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + + def cwr1(iterable, r): + 'Pure python version shown in the docs' + # number items returned: (n+r-1)! / r! / (n-1)! when n>0 + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def cwr2(iterable, r): + 'Pure python version shown in the docs' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + def numcombs(n, r): + if not n: + return 0 if r else 1 + return fact(n+r-1) / fact(r)/ fact(n-1) + + for n in range(7): + values = [5*x-12 for x in range(n)] + for r in range(n+2): + result = list(cwr(values, r)) + + self.assertEqual(len(result), numcombs(n, r)) # right number of combs + self.assertEqual(len(result), len(set(result))) # no repeats + self.assertEqual(result, sorted(result)) # lexicographic order + + regular_combs = list(combinations(values, r)) # compare to combs without replacement + if n == 0 or r <= 1: + self.assertEquals(result, regular_combs) # cases that should be identical + else: + self.assert_(set(result) >= set(regular_combs)) # rest should be supersets of regular combs + + for c in result: + self.assertEqual(len(c), r) # r-length combinations + noruns = [k for k,v in groupby(c)] # combo without consecutive repeats + self.assertEqual(len(noruns), len(set(noruns))) # no repeats other than consecutive + self.assertEqual(list(c), sorted(c)) # keep original ordering + self.assert_(all(e in values for e in c)) # elements taken from input iterable + self.assertEqual(noruns, + [e for e in values if e in c]) # comb is a subsequence of the input iterable + self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version + self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version + + # Test implementation detail: tuple re-use + self.assertEqual(len(set(map(id, cwr('abcde', 3)))), 1) + self.assertNotEqual(len(set(map(id, list(cwr('abcde', 3))))), 1) + def test_permutations(self): self.assertRaises(TypeError, permutations) # too few arguments self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments @@ -716,6 +786,10 @@ self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) + def test_combinations_with_replacement(self): + self.assertEqual(list(combinations_with_replacement('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + def test_compress(self): self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) @@ -799,6 +873,10 @@ a = [] self.makecycle(combinations([1,2,a,3], 3), a) + def test_combinations_with_replacement(self): + a = [] + self.makecycle(combinations_with_replacement([1,2,a,3], 3), a) + def test_compress(self): a = [] self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) @@ -1291,21 +1369,6 @@ ... s = list(iterable) ... return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) ->>> def combinations_with_replacement(iterable, r): -... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" -... pool = tuple(iterable) -... n = len(pool) -... indices = [0] * r -... yield tuple(pool[i] for i in indices) -... while 1: -... for i in reversed(range(r)): -... if indices[i] != n - 1: -... break -... else: -... return -... 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 @@ -1386,29 +1449,6 @@ >>> list(powerset([1,2,3])) [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] ->>> list(combinations_with_replacement('abc', 2)) -[('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] - ->>> list(combinations_with_replacement('01', 3)) -[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] - ->>> def combinations_with_replacement2(iterable, r): -... 'Alternate version that filters from product()' -... pool = tuple(iterable) -... n = len(pool) -... for indices in product(range(n), repeat=r): -... if sorted(indices) == list(indices): -... yield tuple(pool[i] for i in indices) - ->>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) -True - ->>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) -True - ->>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) -True - >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 27 03:58:49 2009 @@ -153,7 +153,8 @@ - Issue #4863: distutils.mwerkscompiler has been removed. -- Added a new function: itertools.compress(). +- Added a new itertools functions: combinations_with_replacement() + and compress(). - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Tue Jan 27 03:58:49 2009 @@ -1862,7 +1862,8 @@ PyObject_GC_UnTrack(lz); Py_XDECREF(lz->pools); Py_XDECREF(lz->result); - PyMem_Free(lz->indices); + if (lz->indices != NULL) + PyMem_Free(lz->indices); Py_TYPE(lz)->tp_free(lz); } @@ -2090,7 +2091,8 @@ PyObject_GC_UnTrack(co); Py_XDECREF(co->pool); Py_XDECREF(co->result); - PyMem_Free(co->indices); + if (co->indices != NULL) + PyMem_Free(co->indices); Py_TYPE(co)->tp_free(co); } @@ -2239,6 +2241,252 @@ }; +/* combinations with replacement object *******************************************/ + +/* Equivalent to: + + def combinations_with_replacement(iterable, r): + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! + pool = tuple(iterable) + n = len(pool) + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def combinations_with_replacement2(iterable, r): + 'Alternate version that filters from product()' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) +*/ +typedef struct { + PyObject_HEAD + PyObject *pool; /* input converted to a tuple */ + Py_ssize_t *indices; /* one index per result element */ + PyObject *result; /* most recently returned result tuple */ + Py_ssize_t r; /* size of result tuple */ + int stopped; /* set to 1 when the cwr iterator is exhausted */ +} cwrobject; + +static PyTypeObject cwr_type; + +static PyObject * +cwr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + cwrobject *co; + Py_ssize_t n; + Py_ssize_t r; + PyObject *pool = NULL; + PyObject *iterable = NULL; + Py_ssize_t *indices = NULL; + Py_ssize_t i; + static char *kwargs[] = {"iterable", "r", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:combinations_with_replacement", kwargs, + &iterable, &r)) + return NULL; + + pool = PySequence_Tuple(iterable); + if (pool == NULL) + goto error; + n = PyTuple_GET_SIZE(pool); + if (r < 0) { + PyErr_SetString(PyExc_ValueError, "r must be non-negative"); + goto error; + } + + indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); + if (indices == NULL) { + PyErr_NoMemory(); + goto error; + } + + for (i=0 ; itp_alloc(type, 0); + if (co == NULL) + goto error; + + co->pool = pool; + co->indices = indices; + co->result = NULL; + co->r = r; + co->stopped = !n && r; + + return (PyObject *)co; + +error: + if (indices != NULL) + PyMem_Free(indices); + Py_XDECREF(pool); + return NULL; +} + +static void +cwr_dealloc(cwrobject *co) +{ + PyObject_GC_UnTrack(co); + Py_XDECREF(co->pool); + Py_XDECREF(co->result); + if (co->indices != NULL) + PyMem_Free(co->indices); + Py_TYPE(co)->tp_free(co); +} + +static int +cwr_traverse(cwrobject *co, visitproc visit, void *arg) +{ + Py_VISIT(co->pool); + Py_VISIT(co->result); + return 0; +} + +static PyObject * +cwr_next(cwrobject *co) +{ + PyObject *elem; + PyObject *oldelem; + PyObject *pool = co->pool; + Py_ssize_t *indices = co->indices; + PyObject *result = co->result; + Py_ssize_t n = PyTuple_GET_SIZE(pool); + Py_ssize_t r = co->r; + Py_ssize_t i, j, index; + + if (co->stopped) + return NULL; + + if (result == NULL) { + /* On the first pass, initialize result tuple using the indices */ + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i 1) { + PyObject *old_result = result; + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i= 0 && indices[i] == n-1; i--) + ; + + /* If i is negative, then the indices are all at + their maximum value and we're done. */ + if (i < 0) + goto empty; + + /* Increment the current index which we know is not at its + maximum. Then set all to the right to the same value. */ + indices[i]++; + for (j=i+1 ; jstopped = 1; + return NULL; +} + +PyDoc_STRVAR(cwr_doc, +"combinations_with_replacement(iterable[, r]) --> combinations_with_replacement object\n\ +\n\ +Return successive r-length combinations of elements in the iterable\n\ +allowing individual elements to have successive repeats.\n\ +combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"); + +static PyTypeObject cwr_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.combinations_with_replacement", /* tp_name */ + sizeof(cwrobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)cwr_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + cwr_doc, /* tp_doc */ + (traverseproc)cwr_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)cwr_next, /* tp_iternext */ + 0, /* 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 */ + cwr_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* permutations object ************************************************************ def permutations(iterable, r=None): @@ -3701,6 +3949,7 @@ char *name; PyTypeObject *typelist[] = { &combinations_type, + &cwr_type, &cycle_type, &dropwhile_type, &takewhile_type, From buildbot at python.org Tue Jan 27 03:58:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 02:58:54 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090127025854.C2E881E4024@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/92 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: 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 Jan 27 04:02:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 27 Jan 2009 04:02:38 +0100 (CET) Subject: [Python-checkins] r69002 - python/branches/py3k Message-ID: <20090127030238.9A6B51E400C@bag.python.org> Author: benjamin.peterson Date: Tue Jan 27 04:02:38 2009 New Revision: 69002 Log: Blocked revisions 68998 via svnmerge ........ r68998 | raymond.hettinger | 2009-01-26 20:36:33 -0600 (Mon, 26 Jan 2009) | 3 lines Tweak column alignment for collections docs. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Jan 27 04:07:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 27 Jan 2009 04:07:53 +0100 (CET) Subject: [Python-checkins] r69003 - python/trunk/Lib/posixpath.py Message-ID: <20090127030753.43B6C1E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 27 04:07:53 2009 New Revision: 69003 Log: excellent place to use a set() #5069 Modified: python/trunk/Lib/posixpath.py Modified: python/trunk/Lib/posixpath.py ============================================================================== --- python/trunk/Lib/posixpath.py (original) +++ python/trunk/Lib/posixpath.py Tue Jan 27 04:07:53 2009 @@ -369,12 +369,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): From buildbot at python.org Tue Jan 27 04:19:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 03:19:10 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090127031910.B6AF81E4002@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/46 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: 8 tests failed: test___all__ test_anydbm test_bsddb test_bsddb185 test_calendar test_lib2to3 test_shelve test_whichdb ====================================================================== ERROR: test_all (test.test___all__.AllTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test___all__.py", line 66, in test_all self.check_all("dbhash") File "/Users/buildbot/buildarea/trunk.noller-osx86/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.noller-osx86/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 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_anydbm.py", line 8, in import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/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 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_bsddb.py", line 8, in import dbhash # Just so we know it's imported File "/Users/buildbot/buildarea/trunk.noller-osx86/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 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_bsddb185.py", line 10, in import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_bool (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 135, in test_bool self.assert_(not self._empty_mapping()) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_constructor (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 132, in test_constructor self.assertEqual(self._empty_mapping(), self._empty_mapping()) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_get (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 270, in test_get d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_items (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 155, in test_items d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_keys (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 141, in test_keys d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_len (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 161, in test_len d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_pop (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 291, in test_pop d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_popitem (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 286, in test_popitem d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_read (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 44, in test_read p = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_setdefault (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 282, in test_setdefault d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_update (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 172, in test_update d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_values (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 149, in test_values d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_write (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 91, in test_write p = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_bool (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 135, in test_bool self.assert_(not self._empty_mapping()) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_constructor (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 132, in test_constructor self.assertEqual(self._empty_mapping(), self._empty_mapping()) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_get (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 270, in test_get d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_items (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 155, in test_items d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_keys (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 141, in test_keys d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_len (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 161, in test_len d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_pop (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 291, in test_pop d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) ====================================================================== ERROR: test_popitem (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 286, in test_popitem d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_read (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 44, in test_read p = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_setdefault (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 282, in test_setdefault d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_update (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 172, in test_update d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_values (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 149, in test_values d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_write (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 91, in test_write p = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_bool (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 135, in test_bool self.assert_(not self._empty_mapping()) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_constructor (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 132, in test_constructor self.assertEqual(self._empty_mapping(), self._empty_mapping()) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_get (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 270, in test_get d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_items (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 155, in test_items d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_keys (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 141, in test_keys d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_len (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 161, in test_len d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_pop (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 291, in test_pop d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_popitem (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 286, in test_popitem d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_read (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 44, in test_read p = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_setdefault (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 282, in test_setdefault d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_update (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 172, in test_update d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_values (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 149, in test_values d = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_write (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/mapping_tests.py", line 91, in test_write p = self._empty_mapping() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_ascii_file_shelf (test.test_shelve.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 28, in test_ascii_file_shelf s = shelve.open(self.fn, protocol=0) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_binary_file_shelf (test.test_shelve.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 38, in test_binary_file_shelf s = shelve.open(self.fn, protocol=1) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' ====================================================================== ERROR: test_proto2_file_shelf (test.test_shelve.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_shelve.py", line 48, in test_proto2_file_shelf s = shelve.open(self.fn, protocol=2) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/shelve.py", line 217, in __init__ import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/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 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_whichdb.py", line 10, in import anydbm File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/anydbm.py", line 54, in _mod = __import__(_name) File "/Users/buildbot/buildarea/trunk.noller-osx86/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 Tue Jan 27 04:45:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 03:45:05 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090127034505.317BE1E4002@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/4541 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: sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 05:20:44 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 05:20:44 +0100 (CET) Subject: [Python-checkins] r69004 - in python/branches/py3k: Doc/library/collections.rst Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090127042044.9AF081E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 05:20:44 2009 New Revision: 69004 Log: Forward port r69001: itertools.combinations_with_replacement(). Modified: python/branches/py3k/Doc/library/collections.rst 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/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Tue Jan 27 05:20:44 2009 @@ -279,8 +279,7 @@ Section 4.6.3, Exercise 19*\. * To enumerate all distinct multisets of a given size over a given set of - elements, see :func:`combinations_with_replacement` in the - :ref:`itertools-recipes` for itertools:: + elements, see :func:`itertools.combinations_with_replacement`. map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Tue Jan 27 05:20:44 2009 @@ -133,6 +133,53 @@ The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` or zero when ``r > n``. +.. function:: combinations_with_replacement(iterable, r) + + Return *r* length subsequences of elements from the input *iterable* + allowing individual elements to be repeated more than once. + + Combinations are emitted in lexicographic sort order. So, if the + input *iterable* is sorted, the combination tuples will be produced + in sorted order. + + Elements are treated as unique based on their position, not on their + value. So if the input elements are unique, the generated combinations + will also be unique. + + Equivalent to:: + + def combinations_with_replacement(iterable, r): + # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + The code for :func:`combinations_with_replacement` can be also expressed as + a subsequence of :func:`product` after filtering entries where the elements + are not in sorted order (according to their position in the input pool):: + + def combinations_with_replacement(iterable, r): + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``. + + .. versionadded:: 2.7 + .. function:: compress(data, selectors) Make an iterator that filters elements from *data* returning only those that @@ -608,22 +655,6 @@ s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) - def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" - # number items returned: (n+r-1)! / r! / (n-1)! - pool = tuple(iterable) - n = len(pool) - indices = [0] * r - yield tuple(pool[i] for i in indices) - while True: - for i in reversed(range(r)): - if indices[i] != n - 1: - break - else: - return - 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 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 Tue Jan 27 05:20:44 2009 @@ -131,6 +131,76 @@ self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(combinations('abcde', 3))))), 1) + def test_combinations_with_replacement(self): + cwr = combinations_with_replacement + self.assertRaises(TypeError, cwr, 'abc') # missing r argument + self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments + self.assertRaises(TypeError, cwr, None) # pool is not iterable + self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative + self.assertEqual(list(cwr('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + + def cwr1(iterable, r): + 'Pure python version shown in the docs' + # number items returned: (n+r-1)! / r! / (n-1)! when n>0 + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def cwr2(iterable, r): + 'Pure python version shown in the docs' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + def numcombs(n, r): + if not n: + return 0 if r else 1 + return fact(n+r-1) / fact(r)/ fact(n-1) + + for n in range(7): + values = [5*x-12 for x in range(n)] + for r in range(n+2): + result = list(cwr(values, r)) + + self.assertEqual(len(result), numcombs(n, r)) # right number of combs + self.assertEqual(len(result), len(set(result))) # no repeats + self.assertEqual(result, sorted(result)) # lexicographic order + + regular_combs = list(combinations(values, r)) # compare to combs without replacement + if n == 0 or r <= 1: + self.assertEquals(result, regular_combs) # cases that should be identical + else: + self.assert_(set(result) >= set(regular_combs)) # rest should be supersets of regular combs + + for c in result: + self.assertEqual(len(c), r) # r-length combinations + noruns = [k for k,v in groupby(c)] # combo without consecutive repeats + self.assertEqual(len(noruns), len(set(noruns))) # no repeats other than consecutive + self.assertEqual(list(c), sorted(c)) # keep original ordering + self.assert_(all(e in values for e in c)) # elements taken from input iterable + self.assertEqual(noruns, + [e for e in values if e in c]) # comb is a subsequence of the input iterable + self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version + self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version + + # Test implementation detail: tuple re-use + self.assertEqual(len(set(map(id, cwr('abcde', 3)))), 1) + self.assertNotEqual(len(set(map(id, list(cwr('abcde', 3))))), 1) + def test_permutations(self): self.assertRaises(TypeError, permutations) # too few arguments self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments @@ -730,6 +800,10 @@ self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) + def test_combinations_with_replacement(self): + self.assertEqual(list(combinations_with_replacement('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + def test_compress(self): self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) @@ -813,6 +887,10 @@ a = [] self.makecycle(combinations([1,2,a,3], 3), a) + def test_combinations_with_replacement(self): + a = [] + self.makecycle(combinations_with_replacement([1,2,a,3], 3), a) + def test_compress(self): a = [] self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) @@ -1312,21 +1390,6 @@ ... s = list(iterable) ... return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) ->>> def combinations_with_replacement(iterable, r): -... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" -... pool = tuple(iterable) -... n = len(pool) -... indices = [0] * r -... yield tuple(pool[i] for i in indices) -... while 1: -... for i in reversed(range(r)): -... if indices[i] != n - 1: -... break -... else: -... return -... 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 @@ -1407,29 +1470,6 @@ >>> list(powerset([1,2,3])) [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] ->>> list(combinations_with_replacement('abc', 2)) -[('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] - ->>> list(combinations_with_replacement('01', 3)) -[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] - ->>> def combinations_with_replacement2(iterable, r): -... 'Alternate version that filters from product()' -... pool = tuple(iterable) -... n = len(pool) -... for indices in product(range(n), repeat=r): -... if sorted(indices) == list(indices): -... yield tuple(pool[i] for i in indices) - ->>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) -True - ->>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) -True - ->>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) -True - >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 27 05:20:44 2009 @@ -153,7 +153,8 @@ - Issue #4863: distutils.mwerkscompiler has been removed. -- Added a new function: itertools.compress(). +- Added a new itertools functions: combinations_with_replacement() + and compress(). - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Tue Jan 27 05:20:44 2009 @@ -1683,7 +1683,8 @@ PyObject_GC_UnTrack(lz); Py_XDECREF(lz->pools); Py_XDECREF(lz->result); - PyMem_Free(lz->indices); + if (lz->indices != NULL) + PyMem_Free(lz->indices); Py_TYPE(lz)->tp_free(lz); } @@ -1911,7 +1912,8 @@ PyObject_GC_UnTrack(co); Py_XDECREF(co->pool); Py_XDECREF(co->result); - PyMem_Free(co->indices); + if (co->indices != NULL) + PyMem_Free(co->indices); Py_TYPE(co)->tp_free(co); } @@ -2060,6 +2062,252 @@ }; +/* combinations with replacement object *******************************************/ + +/* Equivalent to: + + def combinations_with_replacement(iterable, r): + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! + pool = tuple(iterable) + n = len(pool) + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def combinations_with_replacement2(iterable, r): + 'Alternate version that filters from product()' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) +*/ +typedef struct { + PyObject_HEAD + PyObject *pool; /* input converted to a tuple */ + Py_ssize_t *indices; /* one index per result element */ + PyObject *result; /* most recently returned result tuple */ + Py_ssize_t r; /* size of result tuple */ + int stopped; /* set to 1 when the cwr iterator is exhausted */ +} cwrobject; + +static PyTypeObject cwr_type; + +static PyObject * +cwr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + cwrobject *co; + Py_ssize_t n; + Py_ssize_t r; + PyObject *pool = NULL; + PyObject *iterable = NULL; + Py_ssize_t *indices = NULL; + Py_ssize_t i; + static char *kwargs[] = {"iterable", "r", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:combinations_with_replacement", kwargs, + &iterable, &r)) + return NULL; + + pool = PySequence_Tuple(iterable); + if (pool == NULL) + goto error; + n = PyTuple_GET_SIZE(pool); + if (r < 0) { + PyErr_SetString(PyExc_ValueError, "r must be non-negative"); + goto error; + } + + indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); + if (indices == NULL) { + PyErr_NoMemory(); + goto error; + } + + for (i=0 ; itp_alloc(type, 0); + if (co == NULL) + goto error; + + co->pool = pool; + co->indices = indices; + co->result = NULL; + co->r = r; + co->stopped = !n && r; + + return (PyObject *)co; + +error: + if (indices != NULL) + PyMem_Free(indices); + Py_XDECREF(pool); + return NULL; +} + +static void +cwr_dealloc(cwrobject *co) +{ + PyObject_GC_UnTrack(co); + Py_XDECREF(co->pool); + Py_XDECREF(co->result); + if (co->indices != NULL) + PyMem_Free(co->indices); + Py_TYPE(co)->tp_free(co); +} + +static int +cwr_traverse(cwrobject *co, visitproc visit, void *arg) +{ + Py_VISIT(co->pool); + Py_VISIT(co->result); + return 0; +} + +static PyObject * +cwr_next(cwrobject *co) +{ + PyObject *elem; + PyObject *oldelem; + PyObject *pool = co->pool; + Py_ssize_t *indices = co->indices; + PyObject *result = co->result; + Py_ssize_t n = PyTuple_GET_SIZE(pool); + Py_ssize_t r = co->r; + Py_ssize_t i, j, index; + + if (co->stopped) + return NULL; + + if (result == NULL) { + /* On the first pass, initialize result tuple using the indices */ + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i 1) { + PyObject *old_result = result; + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i= 0 && indices[i] == n-1; i--) + ; + + /* If i is negative, then the indices are all at + their maximum value and we're done. */ + if (i < 0) + goto empty; + + /* Increment the current index which we know is not at its + maximum. Then set all to the right to the same value. */ + indices[i]++; + for (j=i+1 ; jstopped = 1; + return NULL; +} + +PyDoc_STRVAR(cwr_doc, +"combinations_with_replacement(iterable[, r]) --> combinations_with_replacement object\n\ +\n\ +Return successive r-length combinations of elements in the iterable\n\ +allowing individual elements to have successive repeats.\n\ +combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"); + +static PyTypeObject cwr_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.combinations_with_replacement", /* tp_name */ + sizeof(cwrobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)cwr_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + cwr_doc, /* tp_doc */ + (traverseproc)cwr_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)cwr_next, /* tp_iternext */ + 0, /* 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 */ + cwr_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* permutations object ************************************************************ def permutations(iterable, r=None): @@ -3191,6 +3439,7 @@ char *name; PyTypeObject *typelist[] = { &combinations_type, + &cwr_type, &cycle_type, &dropwhile_type, &takewhile_type, From python-checkins at python.org Tue Jan 27 05:42:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 05:42:49 +0100 (CET) Subject: [Python-checkins] r69005 - python/branches/py3k/Doc/library/itertools.rst Message-ID: <20090127044249.2D2601E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 05:42:48 2009 New Revision: 69005 Log: Put functions back in alphabetical order. 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 Jan 27 05:42:48 2009 @@ -245,6 +245,20 @@ for x in iterable: yield x +.. function:: filterfalse(predicate, iterable) + + Make an iterator that filters elements from iterable returning only those for + which the predicate is ``False``. If *predicate* is ``None``, return the items + that are false. Equivalent to:: + + def filterfalse(predicate, iterable): + # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 + if predicate is None: + predicate = bool + for x in iterable: + if not predicate(x): + yield x + .. function:: groupby(iterable[, key]) @@ -298,21 +312,6 @@ self.currkey = self.keyfunc(self.currvalue) -.. function:: filterfalse(predicate, iterable) - - Make an iterator that filters elements from iterable returning only those for - which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: - - def filterfalse(predicate, iterable): - # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 - if predicate is None: - predicate = bool - for x in iterable: - if not predicate(x): - yield x - - .. function:: islice(iterable, [start,] stop [, step]) Make an iterator that returns selected elements from the iterable. If *start* is @@ -342,30 +341,6 @@ then the step defaults to one. -.. function:: zip_longest(*iterables[, fillvalue]) - - Make an iterator that aggregates elements from each of the iterables. If the - iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: - - def zip_longest(*args, fillvalue=None): - # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- - def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): - yield counter() # yields the fillvalue, or raises IndexError - fillers = repeat(fillvalue) - iters = [chain(it, sentinel(), fillers) for it in args] - try: - for tup in zip(*iters): - yield tup - except IndexError: - pass - - If one of the iterables is potentially infinite, then the :func:`zip_longest` - function should be wrapped with something that limits the number of calls - (for example :func:`islice` or :func:`takewhile`). If not specified, - *fillvalue* defaults to ``None``. - - .. function:: permutations(iterable[, r]) Return successive *r* length permutations of elements in the *iterable*. @@ -525,6 +500,30 @@ is faster to use :func:`list` instead of :func:`tee`. +.. function:: zip_longest(*iterables[, fillvalue]) + + Make an iterator that aggregates elements from each of the iterables. If the + iterables are of uneven length, missing values are filled-in with *fillvalue*. + Iteration continues until the longest iterable is exhausted. Equivalent to:: + + def zip_longest(*args, fillvalue=None): + # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- + def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): + yield counter() # yields the fillvalue, or raises IndexError + fillers = repeat(fillvalue) + iters = [chain(it, sentinel(), fillers) for it in args] + try: + for tup in zip(*iters): + yield tup + except IndexError: + pass + + If one of the iterables is potentially infinite, then the :func:`zip_longest` + function should be wrapped with something that limits the number of calls + (for example :func:`islice` or :func:`takewhile`). If not specified, + *fillvalue* defaults to ``None``. + + .. _itertools-example: Examples From python-checkins at python.org Tue Jan 27 05:44:17 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 05:44:17 +0100 (CET) Subject: [Python-checkins] r69006 - python/branches/release30-maint/Doc/library/itertools.rst Message-ID: <20090127044417.71BE51E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 05:44:17 2009 New Revision: 69006 Log: Put functions back in alphabetical order. 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 Tue Jan 27 05:44:17 2009 @@ -184,6 +184,20 @@ for x in iterable: yield x +.. function:: filterfalse(predicate, iterable) + + Make an iterator that filters elements from iterable returning only those for + which the predicate is ``False``. If *predicate* is ``None``, return the items + that are false. Equivalent to:: + + def filterfalse(predicate, iterable): + # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 + if predicate is None: + predicate = bool + for x in iterable: + if not predicate(x): + yield x + .. function:: groupby(iterable[, key]) @@ -237,21 +251,6 @@ self.currkey = self.keyfunc(self.currvalue) -.. function:: filterfalse(predicate, iterable) - - Make an iterator that filters elements from iterable returning only those for - which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: - - def filterfalse(predicate, iterable): - # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 - if predicate is None: - predicate = bool - for x in iterable: - if not predicate(x): - yield x - - .. function:: islice(iterable, [start,] stop [, step]) Make an iterator that returns selected elements from the iterable. If *start* is @@ -281,30 +280,6 @@ then the step defaults to one. -.. function:: zip_longest(*iterables[, fillvalue]) - - Make an iterator that aggregates elements from each of the iterables. If the - iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: - - def zip_longest(*args, fillvalue=None): - # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- - def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): - yield counter() # yields the fillvalue, or raises IndexError - fillers = repeat(fillvalue) - iters = [chain(it, sentinel(), fillers) for it in args] - try: - for tup in zip(*iters): - yield tup - except IndexError: - pass - - If one of the iterables is potentially infinite, then the :func:`zip_longest` - function should be wrapped with something that limits the number of calls - (for example :func:`islice` or :func:`takewhile`). If not specified, - *fillvalue* defaults to ``None``. - - .. function:: permutations(iterable[, r]) Return successive *r* length permutations of elements in the *iterable*. @@ -464,6 +439,30 @@ is faster to use :func:`list` instead of :func:`tee`. +.. function:: zip_longest(*iterables[, fillvalue]) + + Make an iterator that aggregates elements from each of the iterables. If the + iterables are of uneven length, missing values are filled-in with *fillvalue*. + Iteration continues until the longest iterable is exhausted. Equivalent to:: + + def zip_longest(*args, fillvalue=None): + # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- + def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): + yield counter() # yields the fillvalue, or raises IndexError + fillers = repeat(fillvalue) + iters = [chain(it, sentinel(), fillers) for it in args] + try: + for tup in zip(*iters): + yield tup + except IndexError: + pass + + If one of the iterables is potentially infinite, then the :func:`zip_longest` + function should be wrapped with something that limits the number of calls + (for example :func:`islice` or :func:`takewhile`). If not specified, + *fillvalue* defaults to ``None``. + + .. _itertools-example: Examples From buildbot at python.org Tue Jan 27 05:57:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 04:57:50 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090127045751.1CFDD1E4002@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/209 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 python-checkins at python.org Tue Jan 27 05:57:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 05:57:51 +0100 (CET) Subject: [Python-checkins] r69007 - in python/branches/py3k: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090127045751.D14601E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 05:57:51 2009 New Revision: 69007 Log: Beautify grouper() recipe in docs. Modified: python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.py Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Tue Jan 27 05:57:51 2009 @@ -634,7 +634,7 @@ def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n - return zip_longest(fillvalue=fillvalue, *args) + return zip_longest(*args, fillvalue=fillvalue) def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F 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 Tue Jan 27 05:57:51 2009 @@ -1370,7 +1370,7 @@ >>> def grouper(n, iterable, fillvalue=None): ... "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" ... args = [iter(iterable)] * n -... return zip_longest(fillvalue=fillvalue, *args) +... return zip_longest(*args, fillvalue=fillvalue) >>> def roundrobin(*iterables): ... "roundrobin('ABC', 'D', 'EF') --> A D E B F C" From buildbot at python.org Tue Jan 27 05:58:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 04:58:32 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090127045833.09C9B1E4002@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/94 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,georg.brandl,mark.dickinson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 06:00:57 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 06:00:57 +0100 (CET) Subject: [Python-checkins] r69008 - in python/branches/release30-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090127050057.885061E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 06:00:57 2009 New Revision: 69008 Log: Beautify grouper() recipe in docs. Modified: python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Lib/test/test_itertools.py 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 Tue Jan 27 06:00:57 2009 @@ -573,7 +573,7 @@ def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n - return zip_longest(fillvalue=fillvalue, *args) + return zip_longest(*args, fillvalue=fillvalue) def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" 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 Tue Jan 27 06:00:57 2009 @@ -1261,7 +1261,7 @@ >>> def grouper(n, iterable, fillvalue=None): ... "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" ... args = [iter(iterable)] * n -... return zip_longest(fillvalue=fillvalue, *args) +... return zip_longest(*args, fillvalue=fillvalue) >>> def roundrobin(*iterables): ... "roundrobin('ABC', 'D', 'EF') --> A D E B F C" From buildbot at python.org Tue Jan 27 06:05:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 05:05:16 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.x Message-ID: <20090127050516.A38D51E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.x/builds/218 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 06:28:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 05:28:01 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090127052801.404031E4002@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/193 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 svn sincerely, -The Buildbot From alexandre at peadrop.com Tue Jan 27 07:15:29 2009 From: alexandre at peadrop.com (Alexandre Vassalotti) Date: Tue, 27 Jan 2009 01:15:29 -0500 Subject: [Python-checkins] r68962 - in python/branches/release30-maint: Doc/library/operator.rst Lib/locale.py Lib/test/test_array.py Lib/test/test_bool.pyLib/test/test_operator.pyMisc/NEWS Modules/operator.c In-Reply-To: <497E6512.7060200@gmail.com> References: <20090126034449.5D2C71E4002@bag.python.org> <497E6512.7060200@gmail.com> Message-ID: On Mon, Jan 26, 2009 at 8:36 PM, Nick Coghlan wrote: > One thing I was actually wondering was whether or not 2to3 can do > something about these removals? > I posted a 2to3 fixer for this in http://bugs.python.org/issue5077 -- Alexandre From python-checkins at python.org Tue Jan 27 07:38:01 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 07:38:01 +0100 (CET) Subject: [Python-checkins] r69009 - in python/branches/release26-maint: Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090127063801.17D131E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 07:38:00 2009 New Revision: 69009 Log: Fixup itertools recipe to cover a corner case. Modified: python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Lib/test/test_itertools.py 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 Tue Jan 27 07:38:00 2009 @@ -686,6 +686,8 @@ # number items returned: (n+r-1)! / r! / (n-1)! pool = tuple(iterable) n = len(pool) + if not n and r: + return indices = [0] * r yield tuple(pool[i] for i in indices) while 1: 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 Tue Jan 27 07:38:00 2009 @@ -1268,6 +1268,8 @@ ... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" ... pool = tuple(iterable) ... n = len(pool) +... if not n and r: +... return ... indices = [0] * r ... yield tuple(pool[i] for i in indices) ... while 1: From buildbot at python.org Tue Jan 27 07:55:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 06:55:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090127065556.9E6A51E4002@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/94 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: 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 Tue Jan 27 08:34:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 07:34:05 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090127073405.A57F41E4002@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/71 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 08:41:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 07:41:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090127074155.133771E4002@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/184 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,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.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 Tue Jan 27 09:27:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 08:27:10 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090127082710.C64E61E400C@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/119 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: The web-page 'force build' button was pressed by 'Martin von Loewis': Test configure Build Source Stamp: [branch py3k] HEAD Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 10:33:06 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 10:33:06 +0100 (CET) Subject: [Python-checkins] r69010 - python/trunk/Lib/test/test_itertools.py Message-ID: <20090127093306.8D9AE1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 10:33:06 2009 New Revision: 69010 Log: Add tests to verify combinatoric relationships. 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 Tue Jan 27 10:33:06 2009 @@ -106,6 +106,14 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + def combinations3(iterable, r): + 'Pure python version from cwr()' + pool = tuple(iterable) + n = len(pool) + for indices in combinations_with_replacement(range(n), r): + if len(set(indices)) == r: + yield tuple(pool[i] for i in indices) + for n in range(7): values = [5*x-12 for x in range(n)] for r in range(n+2): @@ -122,6 +130,7 @@ [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version + self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -261,6 +270,23 @@ self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1) + def test_combinatorics(self): + # Test relationships between product(), permutations(), + # combinations() and combinations_with_replacement(). + + s = 'ABCDE' + for r in range(8): + prod = list(product(s, repeat=r)) + cwr = list(combinations_with_replacement(s, r)) + perm = list(permutations(s, r)) + comb = list(combinations(s, r)) + + self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted + self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups + self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted + self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups + self.assertEqual(set(comb), set(cwr) & set(perm)) # comb: both a cwr and a perm + def test_compress(self): 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('')) From python-checkins at python.org Tue Jan 27 10:35:21 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 10:35:21 +0100 (CET) Subject: [Python-checkins] r69011 - python/branches/py3k/Lib/test/test_itertools.py Message-ID: <20090127093521.DAB5C1E4017@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 10:35:21 2009 New Revision: 69011 Log: Add tests to verify combinatoric relationships. 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 Tue Jan 27 10:35:21 2009 @@ -110,6 +110,14 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + def combinations3(iterable, r): + 'Pure python version from cwr()' + pool = tuple(iterable) + n = len(pool) + for indices in combinations_with_replacement(range(n), r): + if len(set(indices)) == r: + yield tuple(pool[i] for i in indices) + for n in range(7): values = [5*x-12 for x in range(n)] for r in range(n+2): @@ -126,6 +134,7 @@ [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version + self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) @@ -265,6 +274,23 @@ self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1) + def test_combinatorics(self): + # Test relationships between product(), permutations(), + # combinations() and combinations_with_replacement(). + + s = 'ABCDE' + for r in range(8): + prod = list(product(s, repeat=r)) + cwr = list(combinations_with_replacement(s, r)) + perm = list(permutations(s, r)) + comb = list(combinations(s, r)) + + self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted + self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups + self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted + self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups + self.assertEqual(set(comb), set(cwr) & set(perm)) # comb: both a cwr and a perm + def test_compress(self): 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('')) From python-checkins at python.org Tue Jan 27 10:52:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 10:52:35 +0100 (CET) Subject: [Python-checkins] r69012 - in python/trunk/Lib: doctest.py test/test_itertools.py Message-ID: <20090127095235.8DD071E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 10:52:35 2009 New Revision: 69012 Log: Stronger tests for combinatoric relationships. Modified: python/trunk/Lib/doctest.py python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Lib/doctest.py ============================================================================== --- python/trunk/Lib/doctest.py (original) +++ python/trunk/Lib/doctest.py Tue Jan 27 10:52:35 2009 @@ -844,6 +844,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' # provide a default module name # Recursively expore `obj`, extracting DocTests. tests = [] @@ -1937,6 +1939,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Tue Jan 27 10:52:35 2009 @@ -281,11 +281,15 @@ perm = list(permutations(s, r)) comb = list(combinations(s, r)) + self.assertEquals(len(prod), len(s)**r) + self.assertEquals(prod, sorted(set(prod))) # prod in lexicographic order without repeats self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups - self.assertEqual(set(comb), set(cwr) & set(perm)) # comb: both a cwr and a perm + self.assertEqual(comb, filter(set(cwr).__contains__, perm)) # comb: perm that is a cwr + self.assertEqual(comb, filter(set(perm).__contains__, cwr)) # comb: cwr that is a perm + self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) From python-checkins at python.org Tue Jan 27 10:56:30 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 10:56:30 +0100 (CET) Subject: [Python-checkins] r69013 - python/branches/py3k/Lib/test/test_itertools.py Message-ID: <20090127095630.D06C31E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 10:56:30 2009 New Revision: 69013 Log: Stronger tests for combinatoric relationships. 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 Tue Jan 27 10:56:30 2009 @@ -285,11 +285,15 @@ perm = list(permutations(s, r)) comb = list(combinations(s, r)) + self.assertEquals(len(prod), len(s)**r) + self.assertEquals(prod, sorted(set(prod))) # prod in lexicographic order without repeats self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups - self.assertEqual(set(comb), set(cwr) & set(perm)) # comb: both a cwr and a perm + self.assertEqual(comb, list(filter(set(cwr).__contains__, perm))) # comb: perm that is a cwr + self.assertEqual(comb, list(filter(set(perm).__contains__, cwr))) # comb: cwr that is a perm + self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) From python-checkins at python.org Tue Jan 27 11:03:04 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 11:03:04 +0100 (CET) Subject: [Python-checkins] r69014 - in python/trunk: Lib/collections.py Misc/NEWS Message-ID: <20090127100304.805381E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 11:03:04 2009 New Revision: 69014 Log: Issue 5021: doctest.testfile should set __name__ Modified: python/trunk/Lib/collections.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Jan 27 11:03:04 2009 @@ -109,7 +109,7 @@ # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Jan 27 11:03:04 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue 5021: doctest.testfile() did not create __name__ and + collections.namedtuple() relied on __name__ being defined. + - Backport importlib from Python 3.1. Only the import_module() function has been backported to help facilitate transitions from 2.7 to 3.1. From python-checkins at python.org Tue Jan 27 11:06:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 11:06:09 +0100 (CET) Subject: [Python-checkins] r69015 - in python/branches/py3k: Lib/collections.py Lib/doctest.py Misc/NEWS Message-ID: <20090127100609.A3DE61E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 11:06:09 2009 New Revision: 69015 Log: Issue 5021: doctest.testfile should set __name__ Modified: python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/doctest.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Tue Jan 27 11:06:09 2009 @@ -111,7 +111,7 @@ # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result Modified: python/branches/py3k/Lib/doctest.py ============================================================================== --- python/branches/py3k/Lib/doctest.py (original) +++ python/branches/py3k/Lib/doctest.py Tue Jan 27 11:06:09 2009 @@ -837,6 +837,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' # provide a default module name # Recursively expore `obj`, extracting DocTests. tests = [] @@ -1947,6 +1949,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Jan 27 11:06:09 2009 @@ -148,6 +148,12 @@ operator module; use the abstract base classes instead. Also removed the repeat() function; use mul() instead. +- Issue 5021: doctest.testfile() did not create __name__ and + collections.namedtuple() relied on __name__ being defined. + +- Backport importlib from Python 3.1. Only the import_module() function has + been backported to help facilitate transitions from 2.7 to 3.1. + - Issue #1885: distutils. When running sdist with --formats=tar,gztar the tar file was overriden by the gztar one. From python-checkins at python.org Tue Jan 27 11:13:46 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 11:13:46 +0100 (CET) Subject: [Python-checkins] r69016 - in python/branches/release30-maint: Lib/collections.py Lib/doctest.py Misc/NEWS Message-ID: <20090127101346.2CA211E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 11:13:45 2009 New Revision: 69016 Log: Issue 5021: doctest.testfile should set __name__ Modified: python/branches/release30-maint/Lib/collections.py python/branches/release30-maint/Lib/doctest.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/collections.py ============================================================================== --- python/branches/release30-maint/Lib/collections.py (original) +++ python/branches/release30-maint/Lib/collections.py Tue Jan 27 11:13:45 2009 @@ -108,7 +108,7 @@ # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result Modified: python/branches/release30-maint/Lib/doctest.py ============================================================================== --- python/branches/release30-maint/Lib/doctest.py (original) +++ python/branches/release30-maint/Lib/doctest.py Tue Jan 27 11:13:45 2009 @@ -837,6 +837,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' # provide a default module name # Recursively expore `obj`, extracting DocTests. tests = [] @@ -1947,6 +1949,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Jan 27 11:13:45 2009 @@ -104,6 +104,9 @@ operator module; use the abstract base classes instead. Also removed the repeat() function; use mul() instead. +- Issue 5021: doctest.testfile() did not create __name__ and + collections.namedtuple() relied on __name__ being defined. + - Issue #1885: distutils. When running sdist with --formats=tar,gztar the tar file was overriden by the gztar one. From python-checkins at python.org Tue Jan 27 11:30:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 11:30:26 +0100 (CET) Subject: [Python-checkins] r69017 - in python/branches/release26-maint: Lib/collections.py Lib/doctest.py Misc/NEWS Message-ID: <20090127103026.A99CA1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 11:30:26 2009 New Revision: 69017 Log: Issue 5021: doctest.testfile should set __name__ Modified: python/branches/release26-maint/Lib/collections.py python/branches/release26-maint/Lib/doctest.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/collections.py ============================================================================== --- python/branches/release26-maint/Lib/collections.py (original) +++ python/branches/release26-maint/Lib/collections.py Tue Jan 27 11:30:26 2009 @@ -103,7 +103,7 @@ # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result Modified: python/branches/release26-maint/Lib/doctest.py ============================================================================== --- python/branches/release26-maint/Lib/doctest.py (original) +++ python/branches/release26-maint/Lib/doctest.py Tue Jan 27 11:30:26 2009 @@ -844,6 +844,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' # provide a default module name # Recursively expore `obj`, extracting DocTests. tests = [] @@ -1937,6 +1939,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Jan 27 11:30:26 2009 @@ -76,6 +76,9 @@ Library ------- +- Issue 5021: doctest.testfile() did not create __name__ and + collections.namedtuple() relied on __name__ being defined. + - Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. From python-checkins at python.org Tue Jan 27 11:36:14 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 11:36:14 +0100 (CET) Subject: [Python-checkins] r69018 - python/trunk/Lib/test/test_itertools.py Message-ID: <20090127103614.46D6B1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 11:36:14 2009 New Revision: 69018 Log: More exhaustive combinatoric checks. 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 Tue Jan 27 11:36:14 2009 @@ -274,22 +274,34 @@ # Test relationships between product(), permutations(), # combinations() and combinations_with_replacement(). - s = 'ABCDE' - for r in range(8): - prod = list(product(s, repeat=r)) - cwr = list(combinations_with_replacement(s, r)) - perm = list(permutations(s, r)) - comb = list(combinations(s, r)) - - self.assertEquals(len(prod), len(s)**r) - self.assertEquals(prod, sorted(set(prod))) # prod in lexicographic order without repeats - self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted - self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups - self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted - self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups - self.assertEqual(comb, filter(set(cwr).__contains__, perm)) # comb: perm that is a cwr - self.assertEqual(comb, filter(set(perm).__contains__, cwr)) # comb: cwr that is a perm - self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm + for n in range(6): + s = 'ABCDEFG'[:n] + for r in range(8): + prod = list(product(s, repeat=r)) + cwr = list(combinations_with_replacement(s, r)) + perm = list(permutations(s, r)) + comb = list(combinations(s, r)) + + # Check size + self.assertEquals(len(prod), n**r) + self.assertEquals(len(cwr), (fact(n+r-1) / fact(r)/ fact(n-1)) if n else (not r)) + self.assertEquals(len(perm), 0 if r>n else fact(n) / fact(n-r)) + self.assertEquals(len(comb), 0 if r>n else fact(n) / fact(r) / fact(n-r)) + + # Check lexicographic order without repeated tuples + self.assertEquals(prod, sorted(set(prod))) + self.assertEquals(cwr, sorted(set(cwr))) + self.assertEquals(perm, sorted(set(perm))) + self.assertEquals(comb, sorted(set(comb))) + + # Check interrelationships + self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted + self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups + self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted + self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups + self.assertEqual(comb, filter(set(cwr).__contains__, perm)) # comb: perm that is a cwr + self.assertEqual(comb, filter(set(perm).__contains__, cwr)) # comb: cwr that is a perm + self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) From python-checkins at python.org Tue Jan 27 11:39:42 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 11:39:42 +0100 (CET) Subject: [Python-checkins] r69019 - python/branches/py3k/Lib/test/test_itertools.py Message-ID: <20090127103942.B9DEB1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 11:39:42 2009 New Revision: 69019 Log: More exhaustive combinatoric checks. 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 Tue Jan 27 11:39:42 2009 @@ -278,22 +278,34 @@ # Test relationships between product(), permutations(), # combinations() and combinations_with_replacement(). - s = 'ABCDE' - for r in range(8): - prod = list(product(s, repeat=r)) - cwr = list(combinations_with_replacement(s, r)) - perm = list(permutations(s, r)) - comb = list(combinations(s, r)) - - self.assertEquals(len(prod), len(s)**r) - self.assertEquals(prod, sorted(set(prod))) # prod in lexicographic order without repeats - self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted - self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups - self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted - self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups - self.assertEqual(comb, list(filter(set(cwr).__contains__, perm))) # comb: perm that is a cwr - self.assertEqual(comb, list(filter(set(perm).__contains__, cwr))) # comb: cwr that is a perm - self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm + for n in range(6): + s = 'ABCDEFG'[:n] + for r in range(8): + prod = list(product(s, repeat=r)) + cwr = list(combinations_with_replacement(s, r)) + perm = list(permutations(s, r)) + comb = list(combinations(s, r)) + + # Check size + self.assertEquals(len(prod), n**r) + self.assertEquals(len(cwr), (fact(n+r-1) / fact(r)/ fact(n-1)) if n else (not r)) + self.assertEquals(len(perm), 0 if r>n else fact(n) / fact(n-r)) + self.assertEquals(len(comb), 0 if r>n else fact(n) / fact(r) / fact(n-r)) + + # Check lexicographic order without repeated tuples + self.assertEquals(prod, sorted(set(prod))) + self.assertEquals(cwr, sorted(set(cwr))) + self.assertEquals(perm, sorted(set(perm))) + self.assertEquals(comb, sorted(set(comb))) + + # Check interrelationships + self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted + self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups + self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted + self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups + self.assertEqual(comb, list(filter(set(cwr).__contains__, perm))) # comb: perm that is a cwr + self.assertEqual(comb, list(filter(set(perm).__contains__, cwr))) # comb: cwr that is a perm + self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) From python-checkins at python.org Tue Jan 27 11:49:58 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 27 Jan 2009 11:49:58 +0100 (CET) Subject: [Python-checkins] r69020 - python/branches/py3k/Python/makeopcodetargets.py Message-ID: <20090127104958.8FCB71E401D@bag.python.org> Author: antoine.pitrou Date: Tue Jan 27 11:49:58 2009 New Revision: 69020 Log: Add executable property to Python/makeopcodetargets.py Modified: python/branches/py3k/Python/makeopcodetargets.py (props changed) From buildbot at python.org Tue Jan 27 12:04:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 11:04:41 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090127110442.1D1961E4002@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/556 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 Jan 27 12:04:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 12:04:59 +0100 (CET) Subject: [Python-checkins] r69021 - python/branches/release30-maint/Lib/test/test_array.py Message-ID: <20090127110459.477AB1E400C@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 12:04:59 2009 New Revision: 69021 Log: Resurrect two buffer tests, converting irepeat() to imul(). Undoes part of r68962. Modified: python/branches/release30-maint/Lib/test/test_array.py Modified: python/branches/release30-maint/Lib/test/test_array.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_array.py (original) +++ python/branches/release30-maint/Lib/test/test_array.py Tue Jan 27 12:04:59 2009 @@ -725,6 +725,8 @@ self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) self.assertRaises(BufferError, operator.delitem, a, 0) self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) + self.assertRaises(BufferError, operator.imul, a, 2) + self.assertRaises(BufferError, operator.imul, a, 0) def test_weakref(self): s = array.array(self.typecode, self.example) From buildbot at python.org Tue Jan 27 12:06:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 11:06:01 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090127110601.8F4321E4002@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/50 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_json make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 12:06:40 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 12:06:40 +0100 (CET) Subject: [Python-checkins] r69022 - python/branches/py3k/Lib/test/test_array.py Message-ID: <20090127110640.D7DE61E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 12:06:40 2009 New Revision: 69022 Log: Resurrect two buffer tests, converting irepeat() to imul(). Undoes part of r68962. Modified: python/branches/py3k/Lib/test/test_array.py Modified: python/branches/py3k/Lib/test/test_array.py ============================================================================== --- python/branches/py3k/Lib/test/test_array.py (original) +++ python/branches/py3k/Lib/test/test_array.py Tue Jan 27 12:06:40 2009 @@ -725,6 +725,8 @@ self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) self.assertRaises(BufferError, operator.delitem, a, 0) self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) + self.assertRaises(BufferError, operator.imul, a, 2) + self.assertRaises(BufferError, operator.imul, a, 0) def test_weakref(self): s = array.array(self.typecode, self.example) From buildbot at python.org Tue Jan 27 12:27:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 11:27:59 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090127112759.3C3AE1E4002@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/76 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: 2 tests failed: test_calendar test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 13:04:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 12:04:27 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090127120427.E20151E4024@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/74 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 failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 13:49:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 12:49:04 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090127124904.97DC61E4002@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/70 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: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 14:26:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 14:26:35 +0100 (CET) Subject: [Python-checkins] r69023 - python/trunk/Lib/test/test_itertools.py Message-ID: <20090127132635.682291E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 14:26:35 2009 New Revision: 69023 Log: Add more tests for the powerset() recipe. 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 Tue Jan 27 14:26:35 2009 @@ -1491,6 +1491,12 @@ >>> list(powerset([1,2,3])) [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] +>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18)) +True + +>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len) +True + >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] From python-checkins at python.org Tue Jan 27 14:29:43 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 27 Jan 2009 14:29:43 +0100 (CET) Subject: [Python-checkins] r69024 - python/branches/py3k/Lib/test/test_itertools.py Message-ID: <20090127132943.F15071E4002@bag.python.org> Author: raymond.hettinger Date: Tue Jan 27 14:29:43 2009 New Revision: 69024 Log: Add more tests for the powerset() recipe. 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 Tue Jan 27 14:29:43 2009 @@ -1512,6 +1512,12 @@ >>> list(powerset([1,2,3])) [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] +>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18)) +True + +>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len) +True + >>> list(unique_everseen('AAAABBBCCDAABBB')) ['A', 'B', 'C', 'D'] From buildbot at python.org Tue Jan 27 15:04:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 14:04:01 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090127140401.4BB581E4002@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/186 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,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 Tue Jan 27 15:45:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 14:45:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090127144513.DEA151E4002@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/96 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 python-checkins at python.org Tue Jan 27 19:17:46 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 27 Jan 2009 19:17:46 +0100 (CET) Subject: [Python-checkins] r69025 - in python/branches/py3k: Lib/collections.py Lib/ctypes/test/test_libc.py Lib/distutils/version.py Lib/heapq.py Lib/locale.py Lib/pydoc.py Lib/sqlite3/test/hooks.py Lib/test/crashers/loosing_mro_ref.py Lib/test/list_tests.py Lib/test/test_builtin.py Lib/test/test_contains.py Lib/test/test_copy.py Lib/test/test_datetime.py Lib/test/test_decimal.py Lib/test/test_deque.py Lib/test/test_descr.py Lib/test/test_dict.py Lib/test/test_hash.py Lib/test/test_heapq.py Lib/test/test_hmac.py Lib/test/test_kqueue.py Lib/test/test_long.py Lib/test/test_set.py Lib/test/test_sort.py Lib/test/test_unittest.py Lib/test/test_userdict.py Lib/test/test_uuid.py Lib/unittest.py Lib/xml/dom/minidom.py Lib/xml/etree/ElementTree.py Lib/xmlrpc/client.py Tools/unicode/makeunicodedata.py Message-ID: <20090127181746.83F321E4002@bag.python.org> Author: mark.dickinson Date: Tue Jan 27 19:17:45 2009 New Revision: 69025 Log: Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from the standard library and tests. Modified: python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/ctypes/test/test_libc.py python/branches/py3k/Lib/distutils/version.py python/branches/py3k/Lib/heapq.py python/branches/py3k/Lib/locale.py python/branches/py3k/Lib/pydoc.py python/branches/py3k/Lib/sqlite3/test/hooks.py python/branches/py3k/Lib/test/crashers/loosing_mro_ref.py python/branches/py3k/Lib/test/list_tests.py python/branches/py3k/Lib/test/test_builtin.py python/branches/py3k/Lib/test/test_contains.py python/branches/py3k/Lib/test/test_copy.py python/branches/py3k/Lib/test/test_datetime.py python/branches/py3k/Lib/test/test_decimal.py python/branches/py3k/Lib/test/test_deque.py python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Lib/test/test_dict.py python/branches/py3k/Lib/test/test_hash.py python/branches/py3k/Lib/test/test_heapq.py python/branches/py3k/Lib/test/test_hmac.py python/branches/py3k/Lib/test/test_kqueue.py python/branches/py3k/Lib/test/test_long.py python/branches/py3k/Lib/test/test_set.py python/branches/py3k/Lib/test/test_sort.py python/branches/py3k/Lib/test/test_unittest.py python/branches/py3k/Lib/test/test_userdict.py python/branches/py3k/Lib/test/test_uuid.py python/branches/py3k/Lib/unittest.py python/branches/py3k/Lib/xml/dom/minidom.py python/branches/py3k/Lib/xml/etree/ElementTree.py python/branches/py3k/Lib/xmlrpc/client.py python/branches/py3k/Tools/unicode/makeunicodedata.py Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Tue Jan 27 19:17:45 2009 @@ -436,8 +436,6 @@ def __ge__(self, other): return self.data >= self.__cast(other) def __cast(self, other): return other.data if isinstance(other, UserList) else other - def __cmp__(self, other): - return cmp(self.data, self.__cast(other)) def __contains__(self, item): return item in self.data def __len__(self): return len(self.data) def __getitem__(self, i): return self.data[i] Modified: python/branches/py3k/Lib/ctypes/test/test_libc.py ============================================================================== --- python/branches/py3k/Lib/ctypes/test/test_libc.py (original) +++ python/branches/py3k/Lib/ctypes/test/test_libc.py Tue Jan 27 19:17:45 2009 @@ -5,6 +5,10 @@ lib = CDLL(_ctypes_test.__file__) +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + class LibTest(unittest.TestCase): def test_sqrt(self): lib.my_sqrt.argtypes = c_double, @@ -19,7 +23,7 @@ lib.my_qsort.restype = None def sort(a, b): - return cmp(a[0], b[0]) + return three_way_cmp(a[0], b[0]) chars = create_string_buffer("spam, spam, and spam") lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) Modified: python/branches/py3k/Lib/distutils/version.py ============================================================================== --- python/branches/py3k/Lib/distutils/version.py (original) +++ python/branches/py3k/Lib/distutils/version.py Tue Jan 27 19:17:45 2009 @@ -21,7 +21,7 @@ an equivalent string -- ie. one that will generate an equivalent version number instance) * __repr__ generates Python code to recreate the version number instance - * __cmp__ compares the current instance with either another instance + * _cmp compares the current instance with either another instance of the same class or a string (which will be parsed to an instance of the same class, thus must follow the same rules) """ @@ -32,7 +32,7 @@ """Abstract base class for version numbering classes. Just provides constructor (__init__) and reproducer (__repr__), because those seem to be the same for all version numbering classes; and route - rich comparisons to __cmp__. + rich comparisons to _cmp. """ def __init__ (self, vstring=None): @@ -43,37 +43,37 @@ return "%s ('%s')" % (self.__class__.__name__, str(self)) def __eq__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c == 0 def __ne__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c != 0 def __lt__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c < 0 def __le__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c <= 0 def __gt__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c > 0 def __ge__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c >= 0 @@ -91,7 +91,7 @@ # (if not identical to) the string supplied to parse # __repr__ (self) - generate Python code to recreate # the instance -# __cmp__ (self, other) - compare two version numbers ('other' may +# _cmp (self, other) - compare two version numbers ('other' may # be an unparsed version string, or another # instance of your version class) @@ -169,30 +169,39 @@ return vstring - def __cmp__ (self, other): + def _cmp (self, other): if isinstance(other, str): other = StrictVersion(other) - compare = cmp(self.version, other.version) - if (compare == 0): # have to compare prerelease - - # case 1: neither has prerelease; they're equal - # case 2: self has prerelease, other doesn't; other is greater - # case 3: self doesn't have prerelease, other does: self is greater - # case 4: both have prerelease: must compare them! + if self.version != other.version: + # numeric versions don't match + # prerelease stuff doesn't matter + if self.version < other.version: + return -1 + else: + return 1 - if (not self.prerelease and not other.prerelease): + # have to compare prerelease + # case 1: neither has prerelease; they're equal + # case 2: self has prerelease, other doesn't; other is greater + # case 3: self doesn't have prerelease, other does: self is greater + # case 4: both have prerelease: must compare them! + + if (not self.prerelease and not other.prerelease): + return 0 + elif (self.prerelease and not other.prerelease): + return -1 + elif (not self.prerelease and other.prerelease): + return 1 + elif (self.prerelease and other.prerelease): + if self.prerelease == other.prerelease: return 0 - elif (self.prerelease and not other.prerelease): + elif self.prerelease < other.prerelease: return -1 - elif (not self.prerelease and other.prerelease): + else: return 1 - elif (self.prerelease and other.prerelease): - return cmp(self.prerelease, other.prerelease) - - else: # numeric versions don't match -- - return compare # prerelease stuff doesn't matter - + else: + assert False, "never get here" # end class StrictVersion @@ -325,7 +334,7 @@ return "LooseVersion ('%s')" % str(self) - def __cmp__ (self, other): + def _cmp (self, other): if isinstance(other, str): other = LooseVersion(other) Modified: python/branches/py3k/Lib/heapq.py ============================================================================== --- python/branches/py3k/Lib/heapq.py (original) +++ python/branches/py3k/Lib/heapq.py Tue Jan 27 19:17:45 2009 @@ -262,7 +262,7 @@ # # Cutting the # of comparisons is important, since these routines have no # way to extract "the priority" from an array element, so that intelligence -# is likely to be hiding in custom __cmp__ methods, or in array elements +# is likely to be hiding in custom comparison methods, or in array elements # storing (priority, record) tuples. Comparisons are thus potentially # expensive. # Modified: python/branches/py3k/Lib/locale.py ============================================================================== --- python/branches/py3k/Lib/locale.py (original) +++ python/branches/py3k/Lib/locale.py Tue Jan 27 19:17:45 2009 @@ -31,7 +31,7 @@ """ strcoll(string,string) -> int. Compares two strings according to the locale. """ - return cmp(a,b) + return (a > b) - (a < b) def _strxfrm(s): """ strxfrm(string) -> string. Modified: python/branches/py3k/Lib/pydoc.py ============================================================================== --- python/branches/py3k/Lib/pydoc.py (original) +++ python/branches/py3k/Lib/pydoc.py Tue Jan 27 19:17:45 2009 @@ -1643,7 +1643,7 @@ 'SPECIALMETHODS': ('specialnames', 'BASICMETHODS ATTRIBUTEMETHODS ' 'CALLABLEMETHODS SEQUENCEMETHODS1 MAPPINGMETHODS ' 'SEQUENCEMETHODS2 NUMBERMETHODS CLASSES'), - 'BASICMETHODS': ('customization', 'cmp hash repr str SPECIALMETHODS'), + 'BASICMETHODS': ('customization', 'hash repr str SPECIALMETHODS'), 'ATTRIBUTEMETHODS': ('attribute-access', 'ATTRIBUTES SPECIALMETHODS'), 'CALLABLEMETHODS': ('callable-types', 'CALLS SPECIALMETHODS'), 'SEQUENCEMETHODS': ('sequence-types', 'SEQUENCES SEQUENCEMETHODS2 ' Modified: python/branches/py3k/Lib/sqlite3/test/hooks.py ============================================================================== --- python/branches/py3k/Lib/sqlite3/test/hooks.py (original) +++ python/branches/py3k/Lib/sqlite3/test/hooks.py Tue Jan 27 19:17:45 2009 @@ -42,7 +42,7 @@ def CheckCreateCollationNotAscii(self): con = sqlite.connect(":memory:") try: - con.create_collation("coll?", cmp) + con.create_collation("coll?", lambda x, y: (x > y) - (x < y)) self.fail("should have raised a ProgrammingError") except sqlite.ProgrammingError as e: pass @@ -52,7 +52,7 @@ return def mycoll(x, y): # reverse order - return -cmp(x, y) + return -((x > y) - (x < y)) con = sqlite.connect(":memory:") con.create_collation("mycoll", mycoll) @@ -82,8 +82,8 @@ Verify that the last one is actually used. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) - con.create_collation("mycoll", lambda x, y: -cmp(x, y)) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) + con.create_collation("mycoll", lambda x, y: -((x > y) - (x < y))) result = con.execute(""" select x from (select 'a' as x union select 'b' as x) order by x collate mycoll """).fetchall() @@ -96,7 +96,7 @@ to use it. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) con.create_collation("mycoll", None) try: con.execute("select 'a' as x union select 'b' as x order by x collate mycoll") Modified: python/branches/py3k/Lib/test/crashers/loosing_mro_ref.py ============================================================================== --- python/branches/py3k/Lib/test/crashers/loosing_mro_ref.py (original) +++ python/branches/py3k/Lib/test/crashers/loosing_mro_ref.py Tue Jan 27 19:17:45 2009 @@ -10,7 +10,7 @@ def __hash__(self): return hash('mykey') - def __cmp__(self, other): + def __eq__(self, other): # the following line decrefs the previous X.__mro__ X.__bases__ = (Base2,) # trash all tuples of length 3, to make sure that the items of @@ -18,7 +18,7 @@ z = [] for i in range(1000): z.append((i, None, None)) - return -1 + return 0 class Base(object): Modified: python/branches/py3k/Lib/test/list_tests.py ============================================================================== --- python/branches/py3k/Lib/test/list_tests.py (original) +++ python/branches/py3k/Lib/test/list_tests.py Tue Jan 27 19:17:45 2009 @@ -439,13 +439,24 @@ self.assertRaises(TypeError, u.sort, 42, 42) def revcmp(a, b): - return cmp(b, a) + if a == b: + return 0 + elif a < b: + return 1 + else: # a > b + return -1 u.sort(key=CmpToKey(revcmp)) self.assertEqual(u, self.type2test([2,1,0,-1,-2])) # The following dumps core in unpatched Python 1.5: def myComparison(x,y): - return cmp(x%3, y%7) + xmod, ymod = x%3, y%7 + if xmod == ymod: + return 0 + elif xmod < ymod: + return -1 + else: # xmod > ymod + return 1 z = self.type2test(range(12)) z.sort(key=CmpToKey(myComparison)) @@ -453,7 +464,12 @@ def selfmodifyingComparison(x,y): z.append(1) - return cmp(x, y) + if x == y: + return 0 + elif x < y: + return -1 + else: # x > y + return 1 self.assertRaises(ValueError, z.sort, key=CmpToKey(selfmodifyingComparison)) self.assertRaises(TypeError, z.sort, 42, 42, 42, 42) 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 Tue Jan 27 19:17:45 2009 @@ -10,6 +10,7 @@ FutureWarning, __name__) warnings.filterwarnings("ignore", "integer argument expected", DeprecationWarning, "unittest") +import builtins class Squares: @@ -219,21 +220,9 @@ self.assertRaises((OverflowError, ValueError), chr, 2**32) def test_cmp(self): - self.assertEqual(cmp(-1, 1), -1) - self.assertEqual(cmp(1, -1), 1) - self.assertEqual(cmp(1, 1), 0) - # verify that circular objects are not handled - a = []; a.append(a) - b = []; b.append(b) - from collections import UserList - c = UserList(); c.append(c) - self.assertRaises(RuntimeError, cmp, a, b) - self.assertRaises(RuntimeError, cmp, b, c) - self.assertRaises(RuntimeError, cmp, c, a) - self.assertRaises(RuntimeError, cmp, a, c) - # okay, now break the cycles - a.pop(); b.pop(); c.pop() - self.assertRaises(TypeError, cmp) + # uncomment the following line once cmp has been removed + #self.assert_(not hasattr(builtins, "cmp")) + pass def test_compile(self): compile('print(1)\n', '', 'exec') @@ -736,10 +725,6 @@ def __getitem__(self, index): raise ValueError self.assertRaises(ValueError, min, BadSeq()) - class BadNumber: - def __cmp__(self, other): - raise ValueError - self.assertRaises(TypeError, min, (42, BadNumber())) for stmt in ( "min(key=int)", # no args Modified: python/branches/py3k/Lib/test/test_contains.py ============================================================================== --- python/branches/py3k/Lib/test/test_contains.py (original) +++ python/branches/py3k/Lib/test/test_contains.py Tue Jan 27 19:17:45 2009 @@ -56,31 +56,16 @@ This class is designed to make sure that the contains code works when the list is modified during the check. """ - aList = range(15) - def __cmp__(self, other): + aList = list(range(15)) + def __eq__(self, other): if other == 12: self.aList.remove(12) self.aList.remove(13) self.aList.remove(14) - return 1 + return 0 self.assert_(Deviant1() not in Deviant1.aList) - class Deviant2: - """Behaves strangely when compared - - This class raises an exception during comparison. That in - turn causes the comparison to fail with a TypeError. - """ - def __cmp__(self, other): - if other == 4: - raise RuntimeError("gotcha") - - try: - self.assert_(Deviant2() not in a) - except TypeError: - pass - def test_nonreflexive(self): # containment and equality tests involving elements that are # not necessarily equal to themselves Modified: python/branches/py3k/Lib/test/test_copy.py ============================================================================== --- python/branches/py3k/Lib/test/test_copy.py (original) +++ python/branches/py3k/Lib/test/test_copy.py Tue Jan 27 19:17:45 2009 @@ -2,10 +2,14 @@ import copy import copyreg - +from operator import le, lt, ge, gt, eq, ne import unittest from test import support +order_comparisons = le, lt, ge, gt +equality_comparisons = eq, ne +comparisons = order_comparisons + equality_comparisons + class TestCopy(unittest.TestCase): # Attempt full line coverage of copy.py from top to bottom @@ -271,7 +275,8 @@ x = [] x.append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, cmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is y) self.assertEqual(len(y), 1) @@ -287,7 +292,8 @@ x = ([],) x[0].append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, cmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) self.assert_(y[0][0] is y) @@ -303,7 +309,10 @@ x = {} x['foo'] = x y = copy.deepcopy(x) - self.assertRaises(TypeError, cmp, y, x) + for op in order_comparisons: + self.assertRaises(TypeError, op, y, x) + for op in equality_comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) self.assertEqual(len(y), 1) Modified: python/branches/py3k/Lib/test/test_datetime.py ============================================================================== --- python/branches/py3k/Lib/test/test_datetime.py (original) +++ python/branches/py3k/Lib/test/test_datetime.py Tue Jan 27 19:17:45 2009 @@ -7,6 +7,8 @@ import pickle import unittest +from operator import lt, le, gt, ge, eq, ne + from test import support from datetime import MINYEAR, MAXYEAR @@ -156,9 +158,6 @@ self.assertRaises(TypeError, lambda: () > me) self.assertRaises(TypeError, lambda: () >= me) - self.assertRaises(TypeError, cmp, (), me) - self.assertRaises(TypeError, cmp, me, ()) - ############################################################################# # timedelta tests @@ -309,8 +308,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for args in (3, 3, 3), (2, 4, 4), (2, 3, 5): t2 = timedelta(*args) # this is larger than t1 @@ -326,8 +323,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -953,8 +948,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for args in (3, 3, 3), (2, 4, 4), (2, 3, 5): t2 = self.theclass(*args) # this is larger than t1 @@ -970,8 +963,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -999,8 +990,6 @@ # But the ordering is undefined self.assertRaises(TypeError, lambda: our < 1) self.assertRaises(TypeError, lambda: 1 < our) - self.assertRaises(TypeError, cmp, our, 1) - self.assertRaises(TypeError, cmp, 1, our) # Repeat those tests with a different class @@ -1014,8 +1003,6 @@ self.assertEqual(their != our, True) self.assertRaises(TypeError, lambda: our < their) self.assertRaises(TypeError, lambda: their < our) - self.assertRaises(TypeError, cmp, our, their) - self.assertRaises(TypeError, cmp, their, our) # However, if the other class explicitly defines ordering # relative to our class, it is allowed to do so @@ -1041,8 +1028,6 @@ self.assertEqual(their != our, True) self.assertEqual(our < their, True) self.assertEqual(their < our, False) - self.assertEqual(cmp(our, their), -1) - self.assertEqual(cmp(their, our), 1) def test_bool(self): # All dates are considered true. @@ -1440,8 +1425,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for i in range(len(args)): newargs = args[:] @@ -1459,8 +1442,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) # A helper for timestamp constructor tests. @@ -1728,8 +1709,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for i in range(len(args)): newargs = args[:] @@ -1747,8 +1726,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -2122,9 +2099,10 @@ d2 = base.replace(minute=11) for x in d0, d1, d2: for y in d0, d1, d2: - got = cmp(x, y) - expected = cmp(x.minute, y.minute) - self.assertEqual(got, expected) + for op in lt, le, gt, ge, eq, ne: + got = op(x, y) + expected = op(x.minute, y.minute) + self.assertEqual(got, expected) # However, if they're different members, uctoffset is not ignored. # Note that a time can't actually have an operand-depedent offset, @@ -2136,7 +2114,7 @@ d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: - got = cmp(x, y) + got = (x > y) - (x < y) if (x is d0 or x is d1) and (y is d0 or y is d1): expected = 0 elif x is y is d2: 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 Jan 27 19:17:45 2009 @@ -1012,17 +1012,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') Modified: python/branches/py3k/Lib/test/test_deque.py ============================================================================== --- python/branches/py3k/Lib/test/test_deque.py (original) +++ python/branches/py3k/Lib/test/test_deque.py Tue Jan 27 19:17:45 2009 @@ -103,7 +103,6 @@ self.assertEqual(x <= y, list(x) <= list(y), (x,y)) self.assertEqual(x > y, list(x) > list(y), (x,y)) self.assertEqual(x >= y, list(x) >= list(y), (x,y)) - self.assertEqual(cmp(x,y), cmp(list(x),list(y)), (x,y)) def test_extend(self): d = deque('a') 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 Tue Jan 27 19:17:45 2009 @@ -172,7 +172,6 @@ def test_dicts(self): # Testing dict operations... - ## self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__") self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__") self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__") self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__") @@ -332,8 +331,6 @@ # This is an ugly hack: copy._deepcopy_dispatch[spam.spamdict] = spamdict - ## self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", - ## "__cmp__") self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__") @@ -1004,8 +1001,8 @@ # Test lookup leaks [SF bug 572567] import sys,gc class G(object): - def __cmp__(self, other): - return 0 + def __eq__(self, other): + return 1 g = G() orig_objects = len(gc.get_objects()) for i in range(10): @@ -1525,7 +1522,6 @@ self.assertNotEqual(id(c1), id(c2)) hash(c1) hash(c2) - ## self.assertEqual(cmp(c1, c2), cmp(id(c1), id(c2))) self.assertEqual(c1, c1) self.assert_(c1 != c2) self.assert_(not c1 != c1) @@ -1549,7 +1545,6 @@ self.assertNotEqual(id(d1), id(d2)) hash(d1) hash(d2) - ## self.assertEqual(cmp(d1, d2), cmp(id(d1), id(d2))) self.assertEqual(d1, d1) self.assertNotEqual(d1, d2) self.assert_(not d1 != d1) @@ -1610,23 +1605,6 @@ self.assert_(i in p10) self.assertFalse(10 in p10) - ## # Safety test for __cmp__ - ## def unsafecmp(a, b): - ## try: - ## a.__class__.__cmp__(a, b) - ## except TypeError: - ## pass - ## else: - ## self.fail("shouldn't allow %s.__cmp__(%r, %r)" % ( - ## a.__class__, a, b)) - ## - ## unsafecmp("123", "123") - ## unsafecmp("123", "123") - ## unsafecmp(1, 1.0) - ## unsafecmp(1.0, 1) - ## unsafecmp(1, 1) - ## unsafecmp(1, 1) - def test_weakrefs(self): # Testing weak references... import weakref @@ -2538,12 +2516,16 @@ c = {1: c1, 2: c2, 3: c3} for x in 1, 2, 3: for y in 1, 2, 3: - ## self.assert_(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) for op in "<", "<=", "==", "!=", ">", ">=": - self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - ## self.assert_(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y)) - ## self.assert_(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s c[y]" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s y" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("x %s c[y]" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) def test_rich_comparisons(self): # Testing rich comparisons... Modified: python/branches/py3k/Lib/test/test_dict.py ============================================================================== --- python/branches/py3k/Lib/test/test_dict.py (original) +++ python/branches/py3k/Lib/test/test_dict.py Tue Jan 27 19:17:45 2009 @@ -570,7 +570,7 @@ self.fail("missing KeyError") def test_bad_key(self): - # Dictionary lookups should fail if __cmp__() raises an exception. + # Dictionary lookups should fail if __eq__() raises an exception. class CustomException(Exception): pass 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 Tue Jan 27 19:17:45 2009 @@ -55,13 +55,8 @@ def __ne__(self, other): return self is not other -class OnlyCmp(object): - def __cmp__(self, other): - return cmp(id(self), id(other)) - class InheritedHashWithEquality(FixedHash, OnlyEquality): pass class InheritedHashWithInequality(FixedHash, OnlyInequality): pass -class InheritedHashWithCmp(FixedHash, OnlyCmp): pass class NoHash(object): __hash__ = None @@ -74,7 +69,6 @@ fixed_expected = [FixedHash(), InheritedHashWithEquality(), InheritedHashWithInequality(), - InheritedHashWithCmp(), ] error_expected = [NoHash(), OnlyEquality(), Modified: python/branches/py3k/Lib/test/test_heapq.py ============================================================================== --- python/branches/py3k/Lib/test/test_heapq.py (original) +++ python/branches/py3k/Lib/test/test_heapq.py Tue Jan 27 19:17:45 2009 @@ -234,9 +234,9 @@ class CmpErr: "Dummy element that always raises an error during comparison" - def __cmp__(self, other): + def __eq__(self, other): raise ZeroDivisionError - __eq__ = __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __cmp__ + __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __eq__ def R(seqn): 'Regular generator' Modified: python/branches/py3k/Lib/test/test_hmac.py ============================================================================== --- python/branches/py3k/Lib/test/test_hmac.py (original) +++ python/branches/py3k/Lib/test/test_hmac.py Tue Jan 27 19:17:45 2009 @@ -291,7 +291,7 @@ # Testing if the copy method created a real copy. h1 = hmac.HMAC(b"key") h2 = h1.copy() - # Using id() in case somebody has overridden __cmp__. + # Using id() in case somebody has overridden __eq__/__ne__. self.failUnless(id(h1) != id(h2), "No real copy of the HMAC instance.") self.failUnless(id(h1.inner) != id(h2.inner), "No real copy of the attribute 'inner'.") Modified: python/branches/py3k/Lib/test/test_kqueue.py ============================================================================== --- python/branches/py3k/Lib/test/test_kqueue.py (original) +++ python/branches/py3k/Lib/test/test_kqueue.py Tue Jan 27 19:17:45 2009 @@ -22,6 +22,7 @@ self.assertRaises(ValueError, kq.fileno) def test_create_event(self): + from operator import lt, le, gt, ge fd = sys.stderr.fileno() ev = select.kevent(fd) other = select.kevent(1000) @@ -33,12 +34,12 @@ self.assertEqual(ev.udata, 0) self.assertEqual(ev, ev) self.assertNotEqual(ev, other) - self.assertEqual(cmp(ev, other), -1) self.assert_(ev < other) self.assert_(other >= ev) - self.assertRaises(TypeError, cmp, ev, None) - self.assertRaises(TypeError, cmp, ev, 1) - self.assertRaises(TypeError, cmp, ev, "ev") + for op in lt, le, gt, ge: + self.assertRaises(TypeError, op, ev, None) + self.assertRaises(TypeError, op, ev, 1) + self.assertRaises(TypeError, op, ev, "ev") ev = select.kevent(fd, select.KQ_FILTER_WRITE) self.assertEqual(ev.ident, fd) Modified: python/branches/py3k/Lib/test/test_long.py ============================================================================== --- python/branches/py3k/Lib/test/test_long.py (original) +++ python/branches/py3k/Lib/test/test_long.py Tue Jan 27 19:17:45 2009 @@ -697,7 +697,8 @@ def _cmp__(self, other): if not isinstance(other, Rat): other = Rat(other) - return cmp(self.n * other.d, self.d * other.n) + x, y = self.n * other.d, self.d * other.n + return (x > y) - (x < y) def __eq__(self, other): return self._cmp__(other) == 0 def __ne__(self, other): @@ -727,8 +728,8 @@ Rx = Rat(x) for y in cases: Ry = Rat(y) - Rcmp = cmp(Rx, Ry) - xycmp = cmp(x, y) + Rcmp = (Rx > Ry) - (Rx < Ry) + xycmp = (x > y) - (x < y) eq(Rcmp, xycmp, Frm("%r %r %d %d", x, y, Rcmp, xycmp)) eq(x == y, Rcmp == 0, Frm("%r == %r %d", x, y, Rcmp)) eq(x != y, Rcmp != 0, Frm("%r != %r %d", x, y, Rcmp)) Modified: python/branches/py3k/Lib/test/test_set.py ============================================================================== --- python/branches/py3k/Lib/test/test_set.py (original) +++ python/branches/py3k/Lib/test/test_set.py Tue Jan 27 19:17:45 2009 @@ -1036,16 +1036,6 @@ result = self.set ^ set([8]) self.assertEqual(result, set([2, 4, 6, 8])) - def test_cmp(self): - a, b = set('a'), set('b') - self.assertRaises(TypeError, cmp, a, b) - - # In py3k, this works! - self.assertRaises(TypeError, cmp, a, a) - - self.assertRaises(TypeError, cmp, a, 12) - self.assertRaises(TypeError, cmp, "abc", a) - #============================================================================== class TestUpdateOps(unittest.TestCase): Modified: python/branches/py3k/Lib/test/test_sort.py ============================================================================== --- python/branches/py3k/Lib/test/test_sort.py (original) +++ python/branches/py3k/Lib/test/test_sort.py Tue Jan 27 19:17:45 2009 @@ -102,7 +102,7 @@ y = x[:] y.reverse() s = x[:] - check("reversed via function", y, s, lambda a, b: cmp(b, a)) + check("reversed via function", y, s, lambda a, b: (b>a)-(b y) - (x < y) L = [1,2] self.assertRaises(ValueError, L.sort, key=CmpToKey(mutating_cmp)) def mutating_cmp(x, y): L.append(3) del L[:] - return cmp(x, y) + return (x > y) - (x < y) self.assertRaises(ValueError, L.sort, key=CmpToKey(mutating_cmp)) memorywaster = [memorywaster] @@ -176,7 +176,10 @@ copy = data[:] random.shuffle(data) data.sort(key=str.lower) - copy.sort(key=CmpToKey(lambda x,y: cmp(x.lower(), y.lower()))) + def my_cmp(x, y): + xlower, ylower = x.lower(), y.lower() + return (xlower > ylower) - (xlower < ylower) + copy.sort(key=CmpToKey(my_cmp)) def test_baddecorator(self): data = 'The quick Brown fox Jumped over The lazy Dog'.split() @@ -246,8 +249,14 @@ data = [(random.randrange(100), i) for i in range(200)] copy1 = data[:] copy2 = data[:] - data.sort(key=CmpToKey(lambda x,y: cmp(x[0],y[0])), reverse=True) - copy1.sort(key=CmpToKey(lambda x,y: cmp(y[0],x[0]))) + def my_cmp(x, y): + x0, y0 = x[0], y[0] + return (x0 > y0) - (x0 < y0) + def my_cmp_reversed(x, y): + x0, y0 = x[0], y[0] + return (y0 > x0) - (y0 < x0) + data.sort(key=CmpToKey(my_cmp), reverse=True) + copy1.sort(key=CmpToKey(my_cmp_reversed)) self.assertEqual(data, copy1) copy2.sort(key=lambda x: x[0], reverse=True) self.assertEqual(data, copy2) Modified: python/branches/py3k/Lib/test/test_unittest.py ============================================================================== --- python/branches/py3k/Lib/test/test_unittest.py (original) +++ python/branches/py3k/Lib/test/test_unittest.py Tue Jan 27 19:17:45 2009 @@ -1103,7 +1103,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromTestCase(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) class Foo(unittest.TestCase): def test_1(self): pass @@ -1119,7 +1119,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromModule(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1137,7 +1137,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromName(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1155,7 +1155,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromNames(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1175,7 +1175,7 @@ # Does it actually affect getTestCaseNames()? def test_sortTestMethodsUsing__getTestCaseNames(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) class Foo(unittest.TestCase): def test_1(self): pass @@ -1188,9 +1188,19 @@ self.assertEqual(loader.getTestCaseNames(Foo), test_names) # "The default value is the built-in cmp() function" + # Since cmp is now defunct, we simply verify that the results + # occur in the same order as they would with the default sort. def test_sortTestMethodsUsing__default_value(self): loader = unittest.TestLoader() - self.failUnless(loader.sortTestMethodsUsing is cmp) + + class Foo(unittest.TestCase): + def test_2(self): pass + def test_3(self): pass + def test_1(self): pass + + test_names = ['test_2', 'test_3', 'test_1'] + self.assertEqual(loader.getTestCaseNames(Foo), sorted(test_names)) + # "it can be set to None to disable the sort." # Modified: python/branches/py3k/Lib/test/test_userdict.py ============================================================================== --- python/branches/py3k/Lib/test/test_userdict.py (original) +++ python/branches/py3k/Lib/test/test_userdict.py Tue Jan 27 19:17:45 2009 @@ -47,7 +47,7 @@ self.assertEqual(repr(u1), repr(d1)) self.assertEqual(repr(u2), repr(d2)) - # Test __cmp__ and __len__ + # Test rich comparison and __len__ all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2] for a in all: for b in all: Modified: python/branches/py3k/Lib/test/test_uuid.py ============================================================================== --- python/branches/py3k/Lib/test/test_uuid.py (original) +++ python/branches/py3k/Lib/test/test_uuid.py Tue Jan 27 19:17:45 2009 @@ -181,7 +181,12 @@ # Test comparison of UUIDs. for i in range(len(ascending)): for j in range(len(ascending)): - equal(cmp(i, j), cmp(ascending[i], ascending[j])) + equal(i < j, ascending[i] < ascending[j]) + equal(i <= j, ascending[i] <= ascending[j]) + equal(i == j, ascending[i] == ascending[j]) + equal(i > j, ascending[i] > ascending[j]) + equal(i >= j, ascending[i] >= ascending[j]) + equal(i != j, ascending[i] != ascending[j]) # Test sorting of UUIDs (above list is in ascending order). resorted = ascending[:] Modified: python/branches/py3k/Lib/unittest.py ============================================================================== --- python/branches/py3k/Lib/unittest.py (original) +++ python/branches/py3k/Lib/unittest.py Tue Jan 27 19:17:45 2009 @@ -539,12 +539,16 @@ return mycmp(self.obj, other.obj) == -1 return K +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + class TestLoader(object): """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ testMethodPrefix = 'test' - sortTestMethodsUsing = cmp + sortTestMethodsUsing = staticmethod(three_way_cmp) suiteClass = TestSuite def loadTestsFromTestCase(self, testCaseClass): Modified: python/branches/py3k/Lib/xml/dom/minidom.py ============================================================================== --- python/branches/py3k/Lib/xml/dom/minidom.py (original) +++ python/branches/py3k/Lib/xml/dom/minidom.py Tue Jan 27 19:17:45 2009 @@ -520,11 +520,29 @@ __len__ = _get_length - def __cmp__(self, other): + def _cmp(self, other): if self._attrs is getattr(other, "_attrs", None): return 0 else: - return cmp(id(self), id(other)) + return (id(self) > id(other)) - (id(self) < id(other)) + + def __eq__(self, other): + return self._cmp(other) == 0 + + def __ge__(self, other): + return self._cmp(other) >= 0 + + def __gt__(self, other): + return self._cmp(other) > 0 + + def __le__(self, other): + return self._cmp(other) <= 0 + + def __lt__(self, other): + return self._cmp(other) < 0 + + def __ne__(self, other): + return self._cmp(other) != 0 def __getitem__(self, attname_or_tuple): if isinstance(attname_or_tuple, tuple): Modified: python/branches/py3k/Lib/xml/etree/ElementTree.py ============================================================================== --- python/branches/py3k/Lib/xml/etree/ElementTree.py (original) +++ python/branches/py3k/Lib/xml/etree/ElementTree.py Tue Jan 27 19:17:45 2009 @@ -498,10 +498,30 @@ return self.text def __hash__(self): return hash(self.text) - def __cmp__(self, other): + def __le__(self, other): if isinstance(other, QName): - return cmp(self.text, other.text) - return cmp(self.text, other) + return self.text <= other.text + return self.text <= other + def __lt__(self, other): + if isinstance(other, QName): + return self.text < other.text + return self.text < other + def __ge__(self, other): + if isinstance(other, QName): + return self.text >= other.text + return self.text >= other + def __gt__(self, other): + if isinstance(other, QName): + return self.text > other.text + return self.text > other + def __eq__(self, other): + if isinstance(other, QName): + return self.text == other.text + return self.text == other + def __ne__(self, other): + if isinstance(other, QName): + return self.text != other.text + return self.text != other ## # ElementTree wrapper class. This class represents an entire element Modified: python/branches/py3k/Lib/xmlrpc/client.py ============================================================================== --- python/branches/py3k/Lib/xmlrpc/client.py (original) +++ python/branches/py3k/Lib/xmlrpc/client.py Tue Jan 27 19:17:45 2009 @@ -349,10 +349,6 @@ def timetuple(self): return time.strptime(self.value, "%Y%m%dT%H:%M:%S") - def __cmp__(self, other): - s, o = self.make_comparable(other) - return cmp(s, o) - ## # Get date/time value. # Modified: python/branches/py3k/Tools/unicode/makeunicodedata.py ============================================================================== --- python/branches/py3k/Tools/unicode/makeunicodedata.py (original) +++ python/branches/py3k/Tools/unicode/makeunicodedata.py Tue Jan 27 19:17:45 2009 @@ -457,15 +457,6 @@ # -------------------------------------------------------------------- # unicode name database -def CmpToKey(mycmp): - 'Convert a cmp= function into a key= function' - class K(object): - def __init__(self, obj, *args): - self.obj = obj - def __lt__(self, other): - return mycmp(self.obj, other.obj) == -1 - return K - def makeunicodename(unicode, trace): FILE = "Modules/unicodename_db.h" @@ -508,14 +499,10 @@ wordlist = list(words.items()) # sort on falling frequency, then by name - def cmpwords(a,b): + def word_key(a): aword, alist = a - bword, blist = b - r = -cmp(len(alist),len(blist)) - if r: - return r - return cmp(aword, bword) - wordlist.sort(key=CmpToKey(cmpwords)) + return -len(alist), aword + wordlist.sort(key=word_key) # figure out how many phrasebook escapes we need escapes = 0 From python-checkins at python.org Tue Jan 27 19:31:30 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 27 Jan 2009 19:31:30 +0100 (CET) Subject: [Python-checkins] r69026 - in python/branches/release30-maint: Lib/collections.py Lib/ctypes/test/test_libc.py Lib/distutils/version.py Lib/heapq.py Lib/locale.py Lib/pydoc.py Lib/sqlite3/test/hooks.py Lib/test/crashers/loosing_mro_ref.py Lib/test/list_tests.py Lib/test/test_builtin.py Lib/test/test_contains.py Lib/test/test_copy.py Lib/test/test_datetime.py Lib/test/test_decimal.py Lib/test/test_deque.py Lib/test/test_descr.py Lib/test/test_dict.py Lib/test/test_hash.py Lib/test/test_heapq.py Lib/test/test_hmac.py Lib/test/test_kqueue.py Lib/test/test_long.py Lib/test/test_set.py Lib/test/test_sort.py Lib/test/test_unittest.py Lib/test/test_userdict.py Lib/test/test_uuid.py Lib/unittest.py Lib/xml/dom/minidom.py Lib/xml/etree/ElementTree.py Lib/xmlrpc/client.py Tools/unicode/makeunicodedata.py Message-ID: <20090127183130.BED1C1E4002@bag.python.org> Author: mark.dickinson Date: Tue Jan 27 19:31:30 2009 New Revision: 69026 Log: Merged revisions 69025 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69025 | mark.dickinson | 2009-01-27 18:17:45 +0000 (Tue, 27 Jan 2009) | 3 lines Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from the standard library and tests. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/collections.py python/branches/release30-maint/Lib/ctypes/test/test_libc.py python/branches/release30-maint/Lib/distutils/version.py python/branches/release30-maint/Lib/heapq.py python/branches/release30-maint/Lib/locale.py python/branches/release30-maint/Lib/pydoc.py python/branches/release30-maint/Lib/sqlite3/test/hooks.py python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py python/branches/release30-maint/Lib/test/list_tests.py python/branches/release30-maint/Lib/test/test_builtin.py python/branches/release30-maint/Lib/test/test_contains.py python/branches/release30-maint/Lib/test/test_copy.py python/branches/release30-maint/Lib/test/test_datetime.py python/branches/release30-maint/Lib/test/test_decimal.py python/branches/release30-maint/Lib/test/test_deque.py python/branches/release30-maint/Lib/test/test_descr.py python/branches/release30-maint/Lib/test/test_dict.py python/branches/release30-maint/Lib/test/test_hash.py python/branches/release30-maint/Lib/test/test_heapq.py python/branches/release30-maint/Lib/test/test_hmac.py python/branches/release30-maint/Lib/test/test_kqueue.py python/branches/release30-maint/Lib/test/test_long.py python/branches/release30-maint/Lib/test/test_set.py python/branches/release30-maint/Lib/test/test_sort.py python/branches/release30-maint/Lib/test/test_unittest.py python/branches/release30-maint/Lib/test/test_userdict.py python/branches/release30-maint/Lib/test/test_uuid.py python/branches/release30-maint/Lib/unittest.py python/branches/release30-maint/Lib/xml/dom/minidom.py python/branches/release30-maint/Lib/xml/etree/ElementTree.py python/branches/release30-maint/Lib/xmlrpc/client.py python/branches/release30-maint/Tools/unicode/makeunicodedata.py Modified: python/branches/release30-maint/Lib/collections.py ============================================================================== --- python/branches/release30-maint/Lib/collections.py (original) +++ python/branches/release30-maint/Lib/collections.py Tue Jan 27 19:31:30 2009 @@ -191,8 +191,6 @@ def __ge__(self, other): return self.data >= self.__cast(other) def __cast(self, other): return other.data if isinstance(other, UserList) else other - def __cmp__(self, other): - return cmp(self.data, self.__cast(other)) def __contains__(self, item): return item in self.data def __len__(self): return len(self.data) def __getitem__(self, i): return self.data[i] Modified: python/branches/release30-maint/Lib/ctypes/test/test_libc.py ============================================================================== --- python/branches/release30-maint/Lib/ctypes/test/test_libc.py (original) +++ python/branches/release30-maint/Lib/ctypes/test/test_libc.py Tue Jan 27 19:31:30 2009 @@ -5,6 +5,10 @@ lib = CDLL(_ctypes_test.__file__) +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + class LibTest(unittest.TestCase): def test_sqrt(self): lib.my_sqrt.argtypes = c_double, @@ -19,7 +23,7 @@ lib.my_qsort.restype = None def sort(a, b): - return cmp(a[0], b[0]) + return three_way_cmp(a[0], b[0]) chars = create_string_buffer("spam, spam, and spam") lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) 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 Tue Jan 27 19:31:30 2009 @@ -21,7 +21,7 @@ an equivalent string -- ie. one that will generate an equivalent version number instance) * __repr__ generates Python code to recreate the version number instance - * __cmp__ compares the current instance with either another instance + * _cmp compares the current instance with either another instance of the same class or a string (which will be parsed to an instance of the same class, thus must follow the same rules) """ @@ -32,7 +32,7 @@ """Abstract base class for version numbering classes. Just provides constructor (__init__) and reproducer (__repr__), because those seem to be the same for all version numbering classes; and route - rich comparisons to __cmp__. + rich comparisons to _cmp. """ def __init__ (self, vstring=None): @@ -43,37 +43,37 @@ return "%s ('%s')" % (self.__class__.__name__, str(self)) def __eq__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c == 0 def __ne__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c != 0 def __lt__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c < 0 def __le__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c <= 0 def __gt__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c > 0 def __ge__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c >= 0 @@ -91,7 +91,7 @@ # (if not identical to) the string supplied to parse # __repr__ (self) - generate Python code to recreate # the instance -# __cmp__ (self, other) - compare two version numbers ('other' may +# _cmp (self, other) - compare two version numbers ('other' may # be an unparsed version string, or another # instance of your version class) @@ -169,30 +169,39 @@ return vstring - def __cmp__ (self, other): + def _cmp (self, other): if isinstance(other, str): other = StrictVersion(other) - compare = cmp(self.version, other.version) - if (compare == 0): # have to compare prerelease - - # case 1: neither has prerelease; they're equal - # case 2: self has prerelease, other doesn't; other is greater - # case 3: self doesn't have prerelease, other does: self is greater - # case 4: both have prerelease: must compare them! + if self.version != other.version: + # numeric versions don't match + # prerelease stuff doesn't matter + if self.version < other.version: + return -1 + else: + return 1 - if (not self.prerelease and not other.prerelease): + # have to compare prerelease + # case 1: neither has prerelease; they're equal + # case 2: self has prerelease, other doesn't; other is greater + # case 3: self doesn't have prerelease, other does: self is greater + # case 4: both have prerelease: must compare them! + + if (not self.prerelease and not other.prerelease): + return 0 + elif (self.prerelease and not other.prerelease): + return -1 + elif (not self.prerelease and other.prerelease): + return 1 + elif (self.prerelease and other.prerelease): + if self.prerelease == other.prerelease: return 0 - elif (self.prerelease and not other.prerelease): + elif self.prerelease < other.prerelease: return -1 - elif (not self.prerelease and other.prerelease): + else: return 1 - elif (self.prerelease and other.prerelease): - return cmp(self.prerelease, other.prerelease) - - else: # numeric versions don't match -- - return compare # prerelease stuff doesn't matter - + else: + assert False, "never get here" # end class StrictVersion @@ -325,7 +334,7 @@ return "LooseVersion ('%s')" % str(self) - def __cmp__ (self, other): + def _cmp (self, other): if isinstance(other, str): other = LooseVersion(other) Modified: python/branches/release30-maint/Lib/heapq.py ============================================================================== --- python/branches/release30-maint/Lib/heapq.py (original) +++ python/branches/release30-maint/Lib/heapq.py Tue Jan 27 19:31:30 2009 @@ -262,7 +262,7 @@ # # Cutting the # of comparisons is important, since these routines have no # way to extract "the priority" from an array element, so that intelligence -# is likely to be hiding in custom __cmp__ methods, or in array elements +# is likely to be hiding in custom comparison methods, or in array elements # storing (priority, record) tuples. Comparisons are thus potentially # expensive. # Modified: python/branches/release30-maint/Lib/locale.py ============================================================================== --- python/branches/release30-maint/Lib/locale.py (original) +++ python/branches/release30-maint/Lib/locale.py Tue Jan 27 19:31:30 2009 @@ -31,7 +31,7 @@ """ strcoll(string,string) -> int. Compares two strings according to the locale. """ - return cmp(a,b) + return (a > b) - (a < b) def _strxfrm(s): """ strxfrm(string) -> string. Modified: python/branches/release30-maint/Lib/pydoc.py ============================================================================== --- python/branches/release30-maint/Lib/pydoc.py (original) +++ python/branches/release30-maint/Lib/pydoc.py Tue Jan 27 19:31:30 2009 @@ -1643,7 +1643,7 @@ 'SPECIALMETHODS': ('specialnames', 'BASICMETHODS ATTRIBUTEMETHODS ' 'CALLABLEMETHODS SEQUENCEMETHODS1 MAPPINGMETHODS ' 'SEQUENCEMETHODS2 NUMBERMETHODS CLASSES'), - 'BASICMETHODS': ('customization', 'cmp hash repr str SPECIALMETHODS'), + 'BASICMETHODS': ('customization', 'hash repr str SPECIALMETHODS'), 'ATTRIBUTEMETHODS': ('attribute-access', 'ATTRIBUTES SPECIALMETHODS'), 'CALLABLEMETHODS': ('callable-types', 'CALLS SPECIALMETHODS'), 'SEQUENCEMETHODS': ('sequence-types', 'SEQUENCES SEQUENCEMETHODS2 ' Modified: python/branches/release30-maint/Lib/sqlite3/test/hooks.py ============================================================================== --- python/branches/release30-maint/Lib/sqlite3/test/hooks.py (original) +++ python/branches/release30-maint/Lib/sqlite3/test/hooks.py Tue Jan 27 19:31:30 2009 @@ -42,7 +42,7 @@ def CheckCreateCollationNotAscii(self): con = sqlite.connect(":memory:") try: - con.create_collation("coll?", cmp) + con.create_collation("coll?", lambda x, y: (x > y) - (x < y)) self.fail("should have raised a ProgrammingError") except sqlite.ProgrammingError as e: pass @@ -52,7 +52,7 @@ return def mycoll(x, y): # reverse order - return -cmp(x, y) + return -((x > y) - (x < y)) con = sqlite.connect(":memory:") con.create_collation("mycoll", mycoll) @@ -82,8 +82,8 @@ Verify that the last one is actually used. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) - con.create_collation("mycoll", lambda x, y: -cmp(x, y)) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) + con.create_collation("mycoll", lambda x, y: -((x > y) - (x < y))) result = con.execute(""" select x from (select 'a' as x union select 'b' as x) order by x collate mycoll """).fetchall() @@ -96,7 +96,7 @@ to use it. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) con.create_collation("mycoll", None) try: con.execute("select 'a' as x union select 'b' as x order by x collate mycoll") Modified: python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py ============================================================================== --- python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py (original) +++ python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py Tue Jan 27 19:31:30 2009 @@ -10,7 +10,7 @@ def __hash__(self): return hash('mykey') - def __cmp__(self, other): + def __eq__(self, other): # the following line decrefs the previous X.__mro__ X.__bases__ = (Base2,) # trash all tuples of length 3, to make sure that the items of @@ -18,7 +18,7 @@ z = [] for i in range(1000): z.append((i, None, None)) - return -1 + return 0 class Base(object): Modified: python/branches/release30-maint/Lib/test/list_tests.py ============================================================================== --- python/branches/release30-maint/Lib/test/list_tests.py (original) +++ python/branches/release30-maint/Lib/test/list_tests.py Tue Jan 27 19:31:30 2009 @@ -439,13 +439,24 @@ self.assertRaises(TypeError, u.sort, 42, 42) def revcmp(a, b): - return cmp(b, a) + if a == b: + return 0 + elif a < b: + return 1 + else: # a > b + return -1 u.sort(key=CmpToKey(revcmp)) self.assertEqual(u, self.type2test([2,1,0,-1,-2])) # The following dumps core in unpatched Python 1.5: def myComparison(x,y): - return cmp(x%3, y%7) + xmod, ymod = x%3, y%7 + if xmod == ymod: + return 0 + elif xmod < ymod: + return -1 + else: # xmod > ymod + return 1 z = self.type2test(range(12)) z.sort(key=CmpToKey(myComparison)) @@ -453,7 +464,12 @@ def selfmodifyingComparison(x,y): z.append(1) - return cmp(x, y) + if x == y: + return 0 + elif x < y: + return -1 + else: # x > y + return 1 self.assertRaises(ValueError, z.sort, key=CmpToKey(selfmodifyingComparison)) self.assertRaises(TypeError, z.sort, 42, 42, 42, 42) 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 Tue Jan 27 19:31:30 2009 @@ -10,6 +10,7 @@ FutureWarning, __name__) warnings.filterwarnings("ignore", "integer argument expected", DeprecationWarning, "unittest") +import builtins class Squares: @@ -219,21 +220,9 @@ self.assertRaises((OverflowError, ValueError), chr, 2**32) def test_cmp(self): - self.assertEqual(cmp(-1, 1), -1) - self.assertEqual(cmp(1, -1), 1) - self.assertEqual(cmp(1, 1), 0) - # verify that circular objects are not handled - a = []; a.append(a) - b = []; b.append(b) - from collections import UserList - c = UserList(); c.append(c) - self.assertRaises(RuntimeError, cmp, a, b) - self.assertRaises(RuntimeError, cmp, b, c) - self.assertRaises(RuntimeError, cmp, c, a) - self.assertRaises(RuntimeError, cmp, a, c) - # okay, now break the cycles - a.pop(); b.pop(); c.pop() - self.assertRaises(TypeError, cmp) + # uncomment the following line once cmp has been removed + #self.assert_(not hasattr(builtins, "cmp")) + pass def test_compile(self): compile('print(1)\n', '', 'exec') @@ -736,10 +725,6 @@ def __getitem__(self, index): raise ValueError self.assertRaises(ValueError, min, BadSeq()) - class BadNumber: - def __cmp__(self, other): - raise ValueError - self.assertRaises(TypeError, min, (42, BadNumber())) for stmt in ( "min(key=int)", # no args Modified: python/branches/release30-maint/Lib/test/test_contains.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_contains.py (original) +++ python/branches/release30-maint/Lib/test/test_contains.py Tue Jan 27 19:31:30 2009 @@ -56,31 +56,16 @@ This class is designed to make sure that the contains code works when the list is modified during the check. """ - aList = range(15) - def __cmp__(self, other): + aList = list(range(15)) + def __eq__(self, other): if other == 12: self.aList.remove(12) self.aList.remove(13) self.aList.remove(14) - return 1 + return 0 self.assert_(Deviant1() not in Deviant1.aList) - class Deviant2: - """Behaves strangely when compared - - This class raises an exception during comparison. That in - turn causes the comparison to fail with a TypeError. - """ - def __cmp__(self, other): - if other == 4: - raise RuntimeError("gotcha") - - try: - self.assert_(Deviant2() not in a) - except TypeError: - pass - def test_nonreflexive(self): # containment and equality tests involving elements that are # not necessarily equal to themselves Modified: python/branches/release30-maint/Lib/test/test_copy.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_copy.py (original) +++ python/branches/release30-maint/Lib/test/test_copy.py Tue Jan 27 19:31:30 2009 @@ -2,10 +2,14 @@ import copy import copyreg - +from operator import le, lt, ge, gt, eq, ne import unittest from test import support +order_comparisons = le, lt, ge, gt +equality_comparisons = eq, ne +comparisons = order_comparisons + equality_comparisons + class TestCopy(unittest.TestCase): # Attempt full line coverage of copy.py from top to bottom @@ -271,7 +275,8 @@ x = [] x.append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, cmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is y) self.assertEqual(len(y), 1) @@ -287,7 +292,8 @@ x = ([],) x[0].append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, cmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) self.assert_(y[0][0] is y) @@ -303,7 +309,10 @@ x = {} x['foo'] = x y = copy.deepcopy(x) - self.assertRaises(TypeError, cmp, y, x) + for op in order_comparisons: + self.assertRaises(TypeError, op, y, x) + for op in equality_comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) self.assertEqual(len(y), 1) Modified: python/branches/release30-maint/Lib/test/test_datetime.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_datetime.py (original) +++ python/branches/release30-maint/Lib/test/test_datetime.py Tue Jan 27 19:31:30 2009 @@ -7,6 +7,8 @@ import pickle import unittest +from operator import lt, le, gt, ge, eq, ne + from test import support from datetime import MINYEAR, MAXYEAR @@ -156,9 +158,6 @@ self.assertRaises(TypeError, lambda: () > me) self.assertRaises(TypeError, lambda: () >= me) - self.assertRaises(TypeError, cmp, (), me) - self.assertRaises(TypeError, cmp, me, ()) - ############################################################################# # timedelta tests @@ -309,8 +308,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for args in (3, 3, 3), (2, 4, 4), (2, 3, 5): t2 = timedelta(*args) # this is larger than t1 @@ -326,8 +323,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -936,8 +931,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for args in (3, 3, 3), (2, 4, 4), (2, 3, 5): t2 = self.theclass(*args) # this is larger than t1 @@ -953,8 +946,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -982,8 +973,6 @@ # But the ordering is undefined self.assertRaises(TypeError, lambda: our < 1) self.assertRaises(TypeError, lambda: 1 < our) - self.assertRaises(TypeError, cmp, our, 1) - self.assertRaises(TypeError, cmp, 1, our) # Repeat those tests with a different class @@ -997,8 +986,6 @@ self.assertEqual(their != our, True) self.assertRaises(TypeError, lambda: our < their) self.assertRaises(TypeError, lambda: their < our) - self.assertRaises(TypeError, cmp, our, their) - self.assertRaises(TypeError, cmp, their, our) # However, if the other class explicitly defines ordering # relative to our class, it is allowed to do so @@ -1024,8 +1011,6 @@ self.assertEqual(their != our, True) self.assertEqual(our < their, True) self.assertEqual(their < our, False) - self.assertEqual(cmp(our, their), -1) - self.assertEqual(cmp(their, our), 1) def test_bool(self): # All dates are considered true. @@ -1423,8 +1408,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for i in range(len(args)): newargs = args[:] @@ -1442,8 +1425,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) # A helper for timestamp constructor tests. @@ -1711,8 +1692,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for i in range(len(args)): newargs = args[:] @@ -1730,8 +1709,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -2105,9 +2082,10 @@ d2 = base.replace(minute=11) for x in d0, d1, d2: for y in d0, d1, d2: - got = cmp(x, y) - expected = cmp(x.minute, y.minute) - self.assertEqual(got, expected) + for op in lt, le, gt, ge, eq, ne: + got = op(x, y) + expected = op(x.minute, y.minute) + self.assertEqual(got, expected) # However, if they're different members, uctoffset is not ignored. # Note that a time can't actually have an operand-depedent offset, @@ -2119,7 +2097,7 @@ d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: - got = cmp(x, y) + got = (x > y) - (x < y) if (x is d0 or x is d1) and (y is d0 or y is d1): expected = 0 elif x is y is d2: 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 Jan 27 19:31:30 2009 @@ -1013,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') Modified: python/branches/release30-maint/Lib/test/test_deque.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_deque.py (original) +++ python/branches/release30-maint/Lib/test/test_deque.py Tue Jan 27 19:31:30 2009 @@ -103,7 +103,6 @@ self.assertEqual(x <= y, list(x) <= list(y), (x,y)) self.assertEqual(x > y, list(x) > list(y), (x,y)) self.assertEqual(x >= y, list(x) >= list(y), (x,y)) - self.assertEqual(cmp(x,y), cmp(list(x),list(y)), (x,y)) def test_extend(self): d = deque('a') 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 Tue Jan 27 19:31:30 2009 @@ -172,7 +172,6 @@ def test_dicts(self): # Testing dict operations... - ## self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__") self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__") self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__") self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__") @@ -332,8 +331,6 @@ # This is an ugly hack: copy._deepcopy_dispatch[spam.spamdict] = spamdict - ## self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", - ## "__cmp__") self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__") @@ -1004,8 +1001,8 @@ # Test lookup leaks [SF bug 572567] import sys,gc class G(object): - def __cmp__(self, other): - return 0 + def __eq__(self, other): + return 1 g = G() orig_objects = len(gc.get_objects()) for i in range(10): @@ -1525,7 +1522,6 @@ self.assertNotEqual(id(c1), id(c2)) hash(c1) hash(c2) - ## self.assertEqual(cmp(c1, c2), cmp(id(c1), id(c2))) self.assertEqual(c1, c1) self.assert_(c1 != c2) self.assert_(not c1 != c1) @@ -1549,7 +1545,6 @@ self.assertNotEqual(id(d1), id(d2)) hash(d1) hash(d2) - ## self.assertEqual(cmp(d1, d2), cmp(id(d1), id(d2))) self.assertEqual(d1, d1) self.assertNotEqual(d1, d2) self.assert_(not d1 != d1) @@ -1610,23 +1605,6 @@ self.assert_(i in p10) self.assertFalse(10 in p10) - ## # Safety test for __cmp__ - ## def unsafecmp(a, b): - ## try: - ## a.__class__.__cmp__(a, b) - ## except TypeError: - ## pass - ## else: - ## self.fail("shouldn't allow %s.__cmp__(%r, %r)" % ( - ## a.__class__, a, b)) - ## - ## unsafecmp("123", "123") - ## unsafecmp("123", "123") - ## unsafecmp(1, 1.0) - ## unsafecmp(1.0, 1) - ## unsafecmp(1, 1) - ## unsafecmp(1, 1) - def test_weakrefs(self): # Testing weak references... import weakref @@ -2538,12 +2516,16 @@ c = {1: c1, 2: c2, 3: c3} for x in 1, 2, 3: for y in 1, 2, 3: - ## self.assert_(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) for op in "<", "<=", "==", "!=", ">", ">=": - self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - ## self.assert_(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y)) - ## self.assert_(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s c[y]" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s y" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("x %s c[y]" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) def test_rich_comparisons(self): # Testing rich comparisons... Modified: python/branches/release30-maint/Lib/test/test_dict.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_dict.py (original) +++ python/branches/release30-maint/Lib/test/test_dict.py Tue Jan 27 19:31:30 2009 @@ -570,7 +570,7 @@ self.fail("missing KeyError") def test_bad_key(self): - # Dictionary lookups should fail if __cmp__() raises an exception. + # Dictionary lookups should fail if __eq__() raises an exception. class CustomException(Exception): pass 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 Tue Jan 27 19:31:30 2009 @@ -55,13 +55,8 @@ def __ne__(self, other): return self is not other -class OnlyCmp(object): - def __cmp__(self, other): - return cmp(id(self), id(other)) - class InheritedHashWithEquality(FixedHash, OnlyEquality): pass class InheritedHashWithInequality(FixedHash, OnlyInequality): pass -class InheritedHashWithCmp(FixedHash, OnlyCmp): pass class NoHash(object): __hash__ = None @@ -74,7 +69,6 @@ fixed_expected = [FixedHash(), InheritedHashWithEquality(), InheritedHashWithInequality(), - InheritedHashWithCmp(), ] error_expected = [NoHash(), OnlyEquality(), Modified: python/branches/release30-maint/Lib/test/test_heapq.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_heapq.py (original) +++ python/branches/release30-maint/Lib/test/test_heapq.py Tue Jan 27 19:31:30 2009 @@ -234,9 +234,9 @@ class CmpErr: "Dummy element that always raises an error during comparison" - def __cmp__(self, other): + def __eq__(self, other): raise ZeroDivisionError - __eq__ = __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __cmp__ + __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __eq__ def R(seqn): 'Regular generator' Modified: python/branches/release30-maint/Lib/test/test_hmac.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_hmac.py (original) +++ python/branches/release30-maint/Lib/test/test_hmac.py Tue Jan 27 19:31:30 2009 @@ -291,7 +291,7 @@ # Testing if the copy method created a real copy. h1 = hmac.HMAC(b"key") h2 = h1.copy() - # Using id() in case somebody has overridden __cmp__. + # Using id() in case somebody has overridden __eq__/__ne__. self.failUnless(id(h1) != id(h2), "No real copy of the HMAC instance.") self.failUnless(id(h1.inner) != id(h2.inner), "No real copy of the attribute 'inner'.") Modified: python/branches/release30-maint/Lib/test/test_kqueue.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_kqueue.py (original) +++ python/branches/release30-maint/Lib/test/test_kqueue.py Tue Jan 27 19:31:30 2009 @@ -22,6 +22,7 @@ self.assertRaises(ValueError, kq.fileno) def test_create_event(self): + from operator import lt, le, gt, ge fd = sys.stderr.fileno() ev = select.kevent(fd) other = select.kevent(1000) @@ -33,12 +34,12 @@ self.assertEqual(ev.udata, 0) self.assertEqual(ev, ev) self.assertNotEqual(ev, other) - self.assertEqual(cmp(ev, other), -1) self.assert_(ev < other) self.assert_(other >= ev) - self.assertRaises(TypeError, cmp, ev, None) - self.assertRaises(TypeError, cmp, ev, 1) - self.assertRaises(TypeError, cmp, ev, "ev") + for op in lt, le, gt, ge: + self.assertRaises(TypeError, op, ev, None) + self.assertRaises(TypeError, op, ev, 1) + self.assertRaises(TypeError, op, ev, "ev") ev = select.kevent(fd, select.KQ_FILTER_WRITE) self.assertEqual(ev.ident, fd) Modified: python/branches/release30-maint/Lib/test/test_long.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_long.py (original) +++ python/branches/release30-maint/Lib/test/test_long.py Tue Jan 27 19:31:30 2009 @@ -696,7 +696,8 @@ def _cmp__(self, other): if not isinstance(other, Rat): other = Rat(other) - return cmp(self.n * other.d, self.d * other.n) + x, y = self.n * other.d, self.d * other.n + return (x > y) - (x < y) def __eq__(self, other): return self._cmp__(other) == 0 def __ne__(self, other): @@ -726,8 +727,8 @@ Rx = Rat(x) for y in cases: Ry = Rat(y) - Rcmp = cmp(Rx, Ry) - xycmp = cmp(x, y) + Rcmp = (Rx > Ry) - (Rx < Ry) + xycmp = (x > y) - (x < y) eq(Rcmp, xycmp, Frm("%r %r %d %d", x, y, Rcmp, xycmp)) eq(x == y, Rcmp == 0, Frm("%r == %r %d", x, y, Rcmp)) eq(x != y, Rcmp != 0, Frm("%r != %r %d", x, y, Rcmp)) Modified: python/branches/release30-maint/Lib/test/test_set.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_set.py (original) +++ python/branches/release30-maint/Lib/test/test_set.py Tue Jan 27 19:31:30 2009 @@ -1036,16 +1036,6 @@ result = self.set ^ set([8]) self.assertEqual(result, set([2, 4, 6, 8])) - def test_cmp(self): - a, b = set('a'), set('b') - self.assertRaises(TypeError, cmp, a, b) - - # In py3k, this works! - self.assertRaises(TypeError, cmp, a, a) - - self.assertRaises(TypeError, cmp, a, 12) - self.assertRaises(TypeError, cmp, "abc", a) - #============================================================================== class TestUpdateOps(unittest.TestCase): Modified: python/branches/release30-maint/Lib/test/test_sort.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_sort.py (original) +++ python/branches/release30-maint/Lib/test/test_sort.py Tue Jan 27 19:31:30 2009 @@ -102,7 +102,7 @@ y = x[:] y.reverse() s = x[:] - check("reversed via function", y, s, lambda a, b: cmp(b, a)) + check("reversed via function", y, s, lambda a, b: (b>a)-(b y) - (x < y) L = [1,2] self.assertRaises(ValueError, L.sort, key=CmpToKey(mutating_cmp)) def mutating_cmp(x, y): L.append(3) del L[:] - return cmp(x, y) + return (x > y) - (x < y) self.assertRaises(ValueError, L.sort, key=CmpToKey(mutating_cmp)) memorywaster = [memorywaster] @@ -176,7 +176,10 @@ copy = data[:] random.shuffle(data) data.sort(key=str.lower) - copy.sort(key=CmpToKey(lambda x,y: cmp(x.lower(), y.lower()))) + def my_cmp(x, y): + xlower, ylower = x.lower(), y.lower() + return (xlower > ylower) - (xlower < ylower) + copy.sort(key=CmpToKey(my_cmp)) def test_baddecorator(self): data = 'The quick Brown fox Jumped over The lazy Dog'.split() @@ -246,8 +249,14 @@ data = [(random.randrange(100), i) for i in range(200)] copy1 = data[:] copy2 = data[:] - data.sort(key=CmpToKey(lambda x,y: cmp(x[0],y[0])), reverse=True) - copy1.sort(key=CmpToKey(lambda x,y: cmp(y[0],x[0]))) + def my_cmp(x, y): + x0, y0 = x[0], y[0] + return (x0 > y0) - (x0 < y0) + def my_cmp_reversed(x, y): + x0, y0 = x[0], y[0] + return (y0 > x0) - (y0 < x0) + data.sort(key=CmpToKey(my_cmp), reverse=True) + copy1.sort(key=CmpToKey(my_cmp_reversed)) self.assertEqual(data, copy1) copy2.sort(key=lambda x: x[0], reverse=True) self.assertEqual(data, copy2) Modified: python/branches/release30-maint/Lib/test/test_unittest.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_unittest.py (original) +++ python/branches/release30-maint/Lib/test/test_unittest.py Tue Jan 27 19:31:30 2009 @@ -1103,7 +1103,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromTestCase(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) class Foo(unittest.TestCase): def test_1(self): pass @@ -1119,7 +1119,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromModule(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1137,7 +1137,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromName(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1155,7 +1155,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromNames(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1175,7 +1175,7 @@ # Does it actually affect getTestCaseNames()? def test_sortTestMethodsUsing__getTestCaseNames(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) class Foo(unittest.TestCase): def test_1(self): pass @@ -1188,9 +1188,19 @@ self.assertEqual(loader.getTestCaseNames(Foo), test_names) # "The default value is the built-in cmp() function" + # Since cmp is now defunct, we simply verify that the results + # occur in the same order as they would with the default sort. def test_sortTestMethodsUsing__default_value(self): loader = unittest.TestLoader() - self.failUnless(loader.sortTestMethodsUsing is cmp) + + class Foo(unittest.TestCase): + def test_2(self): pass + def test_3(self): pass + def test_1(self): pass + + test_names = ['test_2', 'test_3', 'test_1'] + self.assertEqual(loader.getTestCaseNames(Foo), sorted(test_names)) + # "it can be set to None to disable the sort." # Modified: python/branches/release30-maint/Lib/test/test_userdict.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_userdict.py (original) +++ python/branches/release30-maint/Lib/test/test_userdict.py Tue Jan 27 19:31:30 2009 @@ -47,7 +47,7 @@ self.assertEqual(repr(u1), repr(d1)) self.assertEqual(repr(u2), repr(d2)) - # Test __cmp__ and __len__ + # Test rich comparison and __len__ all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2] for a in all: for b in all: Modified: python/branches/release30-maint/Lib/test/test_uuid.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_uuid.py (original) +++ python/branches/release30-maint/Lib/test/test_uuid.py Tue Jan 27 19:31:30 2009 @@ -181,7 +181,12 @@ # Test comparison of UUIDs. for i in range(len(ascending)): for j in range(len(ascending)): - equal(cmp(i, j), cmp(ascending[i], ascending[j])) + equal(i < j, ascending[i] < ascending[j]) + equal(i <= j, ascending[i] <= ascending[j]) + equal(i == j, ascending[i] == ascending[j]) + equal(i > j, ascending[i] > ascending[j]) + equal(i >= j, ascending[i] >= ascending[j]) + equal(i != j, ascending[i] != ascending[j]) # Test sorting of UUIDs (above list is in ascending order). resorted = ascending[:] Modified: python/branches/release30-maint/Lib/unittest.py ============================================================================== --- python/branches/release30-maint/Lib/unittest.py (original) +++ python/branches/release30-maint/Lib/unittest.py Tue Jan 27 19:31:30 2009 @@ -513,12 +513,16 @@ return mycmp(self.obj, other.obj) == -1 return K +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + class TestLoader: """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ testMethodPrefix = 'test' - sortTestMethodsUsing = cmp + sortTestMethodsUsing = staticmethod(three_way_cmp) suiteClass = TestSuite def loadTestsFromTestCase(self, testCaseClass): Modified: python/branches/release30-maint/Lib/xml/dom/minidom.py ============================================================================== --- python/branches/release30-maint/Lib/xml/dom/minidom.py (original) +++ python/branches/release30-maint/Lib/xml/dom/minidom.py Tue Jan 27 19:31:30 2009 @@ -520,11 +520,29 @@ __len__ = _get_length - def __cmp__(self, other): + def _cmp(self, other): if self._attrs is getattr(other, "_attrs", None): return 0 else: - return cmp(id(self), id(other)) + return (id(self) > id(other)) - (id(self) < id(other)) + + def __eq__(self, other): + return self._cmp(other) == 0 + + def __ge__(self, other): + return self._cmp(other) >= 0 + + def __gt__(self, other): + return self._cmp(other) > 0 + + def __le__(self, other): + return self._cmp(other) <= 0 + + def __lt__(self, other): + return self._cmp(other) < 0 + + def __ne__(self, other): + return self._cmp(other) != 0 def __getitem__(self, attname_or_tuple): if isinstance(attname_or_tuple, tuple): Modified: python/branches/release30-maint/Lib/xml/etree/ElementTree.py ============================================================================== --- python/branches/release30-maint/Lib/xml/etree/ElementTree.py (original) +++ python/branches/release30-maint/Lib/xml/etree/ElementTree.py Tue Jan 27 19:31:30 2009 @@ -498,10 +498,30 @@ return self.text def __hash__(self): return hash(self.text) - def __cmp__(self, other): + def __le__(self, other): if isinstance(other, QName): - return cmp(self.text, other.text) - return cmp(self.text, other) + return self.text <= other.text + return self.text <= other + def __lt__(self, other): + if isinstance(other, QName): + return self.text < other.text + return self.text < other + def __ge__(self, other): + if isinstance(other, QName): + return self.text >= other.text + return self.text >= other + def __gt__(self, other): + if isinstance(other, QName): + return self.text > other.text + return self.text > other + def __eq__(self, other): + if isinstance(other, QName): + return self.text == other.text + return self.text == other + def __ne__(self, other): + if isinstance(other, QName): + return self.text != other.text + return self.text != other ## # ElementTree wrapper class. This class represents an entire element Modified: python/branches/release30-maint/Lib/xmlrpc/client.py ============================================================================== --- python/branches/release30-maint/Lib/xmlrpc/client.py (original) +++ python/branches/release30-maint/Lib/xmlrpc/client.py Tue Jan 27 19:31:30 2009 @@ -349,10 +349,6 @@ def timetuple(self): return time.strptime(self.value, "%Y%m%dT%H:%M:%S") - def __cmp__(self, other): - s, o = self.make_comparable(other) - return cmp(s, o) - ## # Get date/time value. # Modified: python/branches/release30-maint/Tools/unicode/makeunicodedata.py ============================================================================== --- python/branches/release30-maint/Tools/unicode/makeunicodedata.py (original) +++ python/branches/release30-maint/Tools/unicode/makeunicodedata.py Tue Jan 27 19:31:30 2009 @@ -457,15 +457,6 @@ # -------------------------------------------------------------------- # unicode name database -def CmpToKey(mycmp): - 'Convert a cmp= function into a key= function' - class K(object): - def __init__(self, obj, *args): - self.obj = obj - def __lt__(self, other): - return mycmp(self.obj, other.obj) == -1 - return K - def makeunicodename(unicode, trace): FILE = "Modules/unicodename_db.h" @@ -508,14 +499,10 @@ wordlist = list(words.items()) # sort on falling frequency, then by name - def cmpwords(a,b): + def word_key(a): aword, alist = a - bword, blist = b - r = -cmp(len(alist),len(blist)) - if r: - return r - return cmp(aword, bword) - wordlist.sort(key=CmpToKey(cmpwords)) + return -len(alist), aword + wordlist.sort(key=word_key) # figure out how many phrasebook escapes we need escapes = 0 From buildbot at python.org Tue Jan 27 19:46:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 18:46:15 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090127184616.042111E4002@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/215 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: 2 tests failed: test_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Jan 27 20:10:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 19:10:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090127191022.A6C521E400C@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/188 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 Tue Jan 27 20:36:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 19:36:31 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090127193632.073241E401A@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/92 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 21:05:05 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 21:05:05 +0100 (CET) Subject: [Python-checkins] r69027 - peps/trunk/Makefile Message-ID: <20090127200505.7294F1E4052@bag.python.org> Author: brett.cannon Date: Tue Jan 27 21:05:05 2009 New Revision: 69027 Log: Make the use of Python a Makefile target. That allows for specifying which interpreter to use or pass in extra flags to the interpreter. Modified: peps/trunk/Makefile Modified: peps/trunk/Makefile ============================================================================== --- peps/trunk/Makefile (original) +++ peps/trunk/Makefile Tue Jan 27 21:05:05 2009 @@ -3,12 +3,14 @@ # # Not really important, but convenient. -PEP2HTML=./pep2html.py +PEP2HTML=pep2html.py + +PYTHON=python .SUFFIXES: .txt .html .txt.html: - $(PEP2HTML) $< + $(PYTHON) $(PEP2HTML) $< TARGETS=$(patsubst %.txt,%.html,$(wildcard pep-????.txt)) pep-0000.html @@ -17,7 +19,7 @@ $(TARGETS): pep2html.py pep-0000.txt: $(wildcard pep-????.txt) - ./genpepindex.py . + $(PYTHON) genpepindex.py . install: echo "Installing is not necessary anymore. It will be done in post-commit." From python-checkins at python.org Tue Jan 27 21:14:27 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 21:14:27 +0100 (CET) Subject: [Python-checkins] r69028 - peps/trunk/pep-0374.txt Message-ID: <20090127201427.AABAB1E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 27 21:14:27 2009 New Revision: 69028 Log: Clean up whitespace. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Tue Jan 27 21:14:27 2009 @@ -18,7 +18,7 @@ development. -Rationale +Rationale ========= Python has been using a centralized version control system (VCS; @@ -28,7 +28,7 @@ allowed for the storage of the history of the language, mostly for help with development, but also for posterity. And of course the V in VCS is very helpful when developing. - + But a centralized version control system has its drawbacks. First and foremost, in order to have the benefits of version control with Python in a seamless fashion, one must be a "core developer" (i.e. @@ -39,13 +39,13 @@ can be quite a limitation, since these non-core developers cannot do easily do basic tasks such as reverting changes to a previously saved state, creating branches, publishing one's changes with full -revision history, etc.? For non-core developers, the last safe tree +revision history, etc. For non-core developers, the last safe tree state is one the Python developers happen to set, and this prevents safe development. This second-class citizenship is a hindrance to people who wish to contribute to Python with a patch of any complexity and want a way to incrementally save their progress to make their development lives easier. - + There is also the issue of having to be online to be able to commit one's work. Because centralized VCSs keep a central copy that stores all revisions, one must have Internet access in order for their @@ -54,18 +54,18 @@ situation of someone wishing to contribute to Python but having a bad Internet connection where committing is time-consuming and expensive and it might work out better to do it in a single step. - + Another drawback to a centralized VCS is that a common use case is -for a developer to revise patches in response to review comments.? +for a developer to revise patches in response to review comments. This is more difficult with a centralized model because there's no -place to contain intermediate work.? It's either all checked in or -none of it is checked in.? In the centralized VCS, it's also very +place to contain intermediate work. It's either all checked in or +none of it is checked in. In the centralized VCS, it's also very difficult to track changes to the trunk as they are committed, while -you're working on your feature or bug fix branch.? This increases +you're working on your feature or bug fix branch. This increases the risk that such branches will grow stale, out-dated, or that merging them into the trunk will generate too may conflicts to be easily resolved. - + Lastly, there is the issue of maintenance of Python. At any one time there is at least one major version of Python under development (at the time of this writing there are two). For each major version of @@ -76,11 +76,11 @@ code bases where changes in one version do not (but could) belong in the other version. As of right now there is no natural support for this branch in time in central VCSs; you must use tools that -simulate the branching.? Tracking merges is similarly painful for +simulate the branching. Tracking merges is similarly painful for developers, as revisions often need to be merged between four active branches (e.g. 2.6 maintenance, 3.0 maintenance, 2.7 development, -3.1 development).? In this case, VCSs such as Subversion only handle -this through arcane third party tools. +3.1 development). In this case, VCSs such as Subversion only handle +this through arcane third party tools. Distributed VCSs (DVCSs) solve all of these problems. While one can keep a master copy of a revision tree, anyone is free to copy that @@ -88,9 +88,9 @@ changes to their copy, online or offline. It also more naturally ties into the idea of branching in the history of a revision tree for maintenance and the development of new features bound for -Python.? DVCSs also provide a great many additional features that +Python. DVCSs also provide a great many additional features that centralized VCSs don't or can't provide. - + This PEP explores the possibility of changing Python's use of Subversion to any of the currently popular DVCSs, in order to gain the benefits outlined above. This PEP does not guarantee that a switch @@ -98,16 +98,16 @@ possible that no clear winner will be found and that svn will continue to be used. If this happens, this PEP will be revisited and revised in the future as the state of DVCSs evolves. - -Terminology + +Terminology =========== Agreeing on a common terminology is surprisingly difficult, primarily because each VCS uses these terms when describing subtly -different tasks, objects, and concepts.? Where possible, we try to +different tasks, objects, and concepts. Where possible, we try to provide a generic definition of the concepts, but you should consult -the individual system's glossaries for details. ?Here are some basic +the individual system's glossaries for details. Here are some basic references for terminology, from some of the standard web-based references on each VCS. You can also refer to glossaries for each DVCS: @@ -120,56 +120,56 @@ -branch +branch A line of development; a collection of revisions, ordered by time. -checkout/working copy/working tree +checkout/working copy/working tree A tree of code the developer can edit, linked to a branch. -index +index A "staging area" where a revision is built (unique to git). -repository +repository A collection of revisions, organized into branches. -clone +clone A complete copy of a branch or repository. commit To record a revision in a repository. -merge +merge Applying all the changes and history from one branch/repository to another. -pull +pull To update a checkout/clone from the original branch/repository, - which can be remote or local + which can be remote or local -push/publish +push/publish To copy a revision, and all revisions it depends on, from a one repository to another. -cherry-pick +cherry-pick To merge one or more specific revisions from one branch to another, possibly in a different repository, possibly without its dependent revisions. -rebase +rebase To "detach" a branch, and move it to a new branch point; move commits to the beginning of a branch instead of where they happened in time. -Typical Workflow +Typical Workflow ================ At the moment, the typical workflow for a Python core developer is: - -* Edit code in a checkout until it is stable enough to commit/push. -* Commit to the master repository. + +* Edit code in a checkout until it is stable enough to commit/push. +* Commit to the master repository. It is a rather simple workflow, but it has drawbacks. For one, because any work that involves the repository takes time thanks to @@ -177,11 +177,11 @@ possible. There is also the drawback of there not being a necessarily cheap way to create new checkouts beyond a recursive copy of the checkout directory. - + A DVCS would lead to a workflow more like this: - -* Branch off of a local clone of the master repository. -* Edit code, committing in atomic pieces. + +* Branch off of a local clone of the master repository. +* Edit code, committing in atomic pieces. * Merge the branch into the mainline, and * Push all commits to the master repository. @@ -191,9 +191,9 @@ developer is able to do atomic commits much more frequently, minimizing having commits that do multiple things to the code. Also by using a branch, the changes are isolated (if desired) from other -changes being made by other developers.? Because branches are cheap, +changes being made by other developers. Because branches are cheap, it is easy to create and maintain many smaller branches that address -one specific issue, e.g. one bug or one new feature.? More +one specific issue, e.g. one bug or one new feature. More sophisticated features of DVCSs allow the developer to more easily track long running development branches as the official mainline progresses. @@ -206,7 +206,7 @@ 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/ +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 ========== ========== ======= =================================== ========================================== @@ -217,7 +217,7 @@ This PEP does not consider darcs, arch, or monotone. The main problem with these DVCSs is that they are simply not popular enough to bother supporting when they do not provide some very compelling -features that the other DVCSs provide. ?Arch and darcs also have +features that the other DVCSs provide. Arch and darcs also have significant performance problems which seem unlikely to be addressed in the near future. @@ -255,18 +255,18 @@ All of the DVCSs support configuring your project identification. Unlike the centralized systems, they use your email address to -identify your commits. ?(Access control is generally done by +identify your commits. (Access control is generally done by mechanisms external to the DVCS, such as ssh or console login). -This identity may be associated with a full name.? +This identity may be associated with a full name. All of the DVCSs will query the system to get some approximation to -this information, but that may not be what you want. ?They also +this information, but that may not be what you want. They also support setting this information on a per-user basis, and on a per- -project basis. ?Convenience commands to set these attributes vary, +project basis. Convenience commands to set these attributes vary, but all allow direct editing of configuration files. -Some VCSs support end-of-line (EOL) conversions on checkout/checkin. ? - +Some VCSs support end-of-line (EOL) conversions on checkout/checkin. + svn ''' @@ -281,15 +281,15 @@ No setup is required, but for much quicker and space-efficient local branching, you should create a shared repository to hold all your -Python branches.? A shared repository is really just a parent -directory containing a .bzr directory.? When bzr commits a revision, +Python branches. A shared repository is really just a parent +directory containing a .bzr directory. When bzr commits a revision, it searches from the local directory on up the file system for a .bzr -directory to hold the revision.? By sharing revisions across multiple -branches, you cut down on the amount of disk space used.? Do this:: +directory to hold the revision. By sharing revisions across multiple +branches, you cut down on the amount of disk space used. Do this:: - ? cd ~/projects - ? bzr init-repo python - ? cd python + cd ~/projects + bzr init-repo python + cd python Now, all your Python branches should be created inside of ``~/projects/python``. @@ -297,18 +297,18 @@ There are also some settings you can put in your ``~/.bzr/bazaar.conf`` and ``~/.bzr/locations.conf`` file to set up defaults for interacting -with Python code.? None of them are required, although some are -recommended.? E.g. I would suggest gpg signing all commits, but that -might be too high a barrier for developers.? Also, you can set up +with Python code. None of them are required, although some are +recommended. E.g. I would suggest gpg signing all commits, but that +might be too high a barrier for developers. Also, you can set up default push locations depending on where you want to push branches -by default.? If you have write access to the master branches, that -push location could be code.python.org.? Otherwise, it might be a -free Bazaar code hosting service such as Launchpad.? If Bazaar is +by default. If you have write access to the master branches, that +push location could be code.python.org. Otherwise, it might be a +free Bazaar code hosting service such as Launchpad. If Bazaar is chosen, we should decide what the policies and recommendations are. At a minimum, I would set up your email address:: - ? bzr whoami "Firstname Lastname " + bzr whoami "Firstname Lastname " hg @@ -317,14 +317,14 @@ Minimally, you should set your user name. To do so, create the file ``.hgrc`` in your home directory and add the following:: - ?[ui] - ?username = Firstname Lastname + [ui] + username = Firstname Lastname If you are using Windows, enable the win32text extension to use Unix-style newlines by adding to your configuration:: - - ?[extensions] - ?win32text = + + [extensions] + win32text = These options can also be set locally to a given repository by customizing ``/.hg/hgrc``, instead of ``~/.hgrc``. @@ -333,10 +333,10 @@ git ''' -None needed. ?However, git supports a number of features that can -smooth your work, with a little preparation. ?git supports setting -defaults at the workspace, user, and system levels. ?The system -level is out of scope of this PEP. ?The user configuration file is +None needed. However, git supports a number of features that can +smooth your work, with a little preparation. git supports setting +defaults at the workspace, user, and system levels. The system +level is out of scope of this PEP. The user configuration file is ``$HOME/.gitconfig`` on Unix-like systems, and the workspace configuration file is ``$REPOSITORY/.git/config``. @@ -353,9 +353,9 @@ # but use my Pythonic email address cd /path/to/python/repository git config user.email email.address at python.example.com - + If you are using Windows, you probably want to set the core.autocrlf -and core.safecrlf?preferences to true using ``git-config``.:: +and core.safecrlf preferences to true using ``git-config``.:: # check out files with CRLF line endings rather than Unix-style LF only git config --global core.autocrlf true @@ -379,16 +379,16 @@ 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, +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 +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:: +the child repository. Here's a complicated example:: # clone the trunk and py3k repositories cd /path/to/myrepos @@ -402,13 +402,13 @@ # 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 + # 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. - + One-Off Checkout ---------------- @@ -416,7 +416,7 @@ As a non-core developer, I want to create and publish a one-off patch that fixes a bug, so that a core developer can review it for inclusion in the mainline. - + * Checkout/branch/clone trunk. * Edit some code. * Generate a patch (based on what is best supported by the VCS, e.g. @@ -445,10 +445,10 @@ svn diff >> patch-2.diff # Upload patch-2 to bugs.python.org - + bzr ''' -:: +:: bzr branch http://code.python.org/python/trunk cd trunk @@ -462,10 +462,10 @@ bzr send -o bundle # Upload updated bundle to bugs.python.org - + hg '' -:: +:: hg clone http://code.python.org/hg/trunk cd trunk @@ -486,12 +486,12 @@ ''' The patches could be created with -``git diff master > stuff-i-did.patch``, too,?but +``git diff master > stuff-i-did.patch``, too, but ``git format-patch | git am`` knows some tricks -(empty files, renames, etc) that?ordinary patch can't handle.? git +(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.:: +name 0001-Stuff-I-did.patch. See Patch Review below for a +description of the git-format-patch format.:: # Get the mainline code. git clone git://code.python.org/python/trunk @@ -517,10 +517,10 @@ As a core developer, I want to undo a change that was not ready for inclusion in the mainline. - + * Back out the unwanted change. * Push patch to server. - + svn ''' @@ -530,7 +530,7 @@ svn merge -c -40 . # Resolve conflicts, if any. svn commit -m "Reverted revision 40" - + bzr ''' @@ -540,10 +540,10 @@ bzr merge -r 40..39 # Resolve conflicts, if any. bzr commit -m "Reverted revision 40" - + Note that if the change you want revert is the last one that was made, you can just use ``bzr uncommit``. - + hg '' @@ -554,7 +554,7 @@ # Resolve conflicts, if any. hg commit -m "Reverted changeset 9150dd9c6d30" hg push - + Note, you can use "hg rollback" and "hg strip" to revert changes you committed in your local repository, but did not yet push to other repositories. @@ -565,13 +565,13 @@ # Assume the change to revert is the grandfather of a revision tagged "newhotness". git revert newhotness~2 #if CONFLICTS - # ? ?Resolve conflicts if any. - git commit -m "Reverted changeset?9150dd9c6d30." + # Resolve conflicts if any. + git commit -m "Reverted changeset 9150dd9c6d30." #else - # ? ?Edit log message, commit will be done automatically. + # Edit log message, commit will be done automatically. #endif git push - + Patch Review ------------ @@ -602,7 +602,7 @@ dealing with individual patches. For this scenario the assumption will be the developer creates a local checkout of the trunk to work with.:: - + cp -r trunk issue0000 cd issue0000 patch -p0 < __patch__ @@ -614,11 +614,11 @@ Another option is to only have a single checkout running at any one time and use ``svn diff`` along with ``svn revert -R`` to store away independent changes you may have made. - + bzr ''' -:: +:: bzr branch trunk issueNNNN # Download `patch` bundle from Roundup @@ -629,10 +629,10 @@ rm -rf ../issueNNNN Alternatively, since you're probably going to commit these changes to -the trunk, you could just do a checkout.? That would give you a local +the trunk, you could just do a checkout. That would give you a local working tree while the branch (i.e. all revisions) would continue to -live on the server.? This is similar to the svn model and might allow -you to more quickly review the patch.? There's no need for the push +live on the server. This is similar to the svn model and might allow +you to more quickly review the patch. There's no need for the push in this case.:: bzr checkout trunk issueNNNN @@ -641,30 +641,30 @@ # Review patch bzr commit -m'Patch NNNN by So N. So' --fixes python:NNNN rm -rf ../issueNNNN - + hg '' -:: +:: hg clone trunk issue0000 cd issue0000 # If the patch was generated using hg export, the user name of the - # submitter is automatically recorded. Otherwise, + # submitter is automatically recorded. Otherwise, # use hg import --no-commit submitted.diff and commit with # hg commit -u "Firstname Lastname " hg import submitted.diff # Review patch. hg push ssh://alexandre at code.python.org/hg/trunk/ - + git ''' -We assume a patch created by git-format-patch. ?This is a Unix mbox +We assume a patch created by git-format-patch. This is a Unix mbox file containing one or more patches, each formatted as an RFC 2822 -message. ?git-am interprets each message as a commit as follows. ?The +message. git-am interprets each message as a commit as follows. The author of the patch is taken from the From: header, the date from the -Date header. ?The commit log is created by concatenating the content +Date header. The commit log is created by concatenating the content of the subject line, a blank line, and the message body up to the start of the patch.:: @@ -672,7 +672,7 @@ # Create a branch in case we don't like the patch. git checkout -b patch-review # Download patch from bugs.python.org to submitted.patch. - git am ? submitted.patch + git am < submitted.patch # Review and approve patch. # Merge into master and push. git checkout master @@ -724,9 +724,9 @@ ''' Bazaar is pretty straightforward here, since it supports cherry -picking revisions manually.? In the example below, we could have +picking revisions manually. In the example below, we could have given a revision id instead of a revision number, but that's usually -not necessary.? Martin Pool suggests "We'd generally recommend doing +not necessary. Martin Pool suggests "We'd generally recommend doing the fix first in the oldest supported branch, and then merging it forward to the later releases.":: @@ -808,7 +808,7 @@ ''' In git I would have an "integration" workspace which contains all of -the relevant master repository branches. ?git cherry-pick doesn't +the relevant master repository branches. git cherry-pick doesn't work across repositories; you need to have the branches in the same repository. :: @@ -821,26 +821,26 @@ git cherry-pick -x 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. + # 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 # 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 + # 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 -If you are regularly?merging?(rather than?cherry-picking) from a +If you are regularly merging (rather than cherry-picking) from a given branch, then you can block a given commit from being accidentally merged in the future by merging, then reverting it. This does not prevent a cherry-pick from pulling in the unwanted patch, and this technique requires blocking everything that you don't -want merged. ?I'm not sure if this differs from svn on this point. +want merged. I'm not sure if this differs from svn on this point. :: cd trunk @@ -848,25 +848,25 @@ git merge experimental-branch # We don't want the 3rd-to-last commit from the experimental-branch, # and we don't want it to ever be merged. - # The notation "^N" means Nth parent of the current commit. ?Thus HEAD^2^1^1 + # The notation "^N" means Nth parent of the current commit. Thus HEAD^2^1^1 # means the first parent of the first parent of the second parent of HEAD. git revert HEAD^2^1^1 # Propagate the merge and the prohibition to the public repository. git push - + Coordinated Development of a New Feature ---------------------------------------- Sometimes core developers end up working on a major feature with -several developers.??As a core developer, I want to be able to +several developers. As a core developer, I want to be able to publish feature branches to a common public location so that I can collaborate with other developers. This requires creating a branch on a server that other developers -can access. ?All of the DVCSs support creating new repositories on +can access. All of the DVCSs support creating new repositories on hosts where the developer is already able to commit, with -appropriate configuration of the repository?host. This is +appropriate configuration of the repository host. This is similar in concept to the existing sandbox in svn, although details of repository initialization may differ. @@ -885,7 +885,7 @@ .. _Launchpad: http://www.launchpad.net/ .. _bitbucket.org: http://www.bitbucket.org/ .. _GitHub: http://www.github.com/ - + * Branch trunk. * Pull from branch on the server. * Pull from trunk. @@ -907,11 +907,11 @@ # Pull in trunk and merge to the branch. svnmerge merge svn commit -F svnmerge-commit-message.txt - + bzr ''' -:: +:: XXX To be done by Brett as a test of knowledge and online documentation/community. @@ -939,7 +939,7 @@ working on a separate issue is very helpful to separate out issues into individual units of work instead of compounding them into a single, large unit. - + * Create a branch A (e.g. urllib has a bug). * Edit some code. * Create a new branch B that branch A depends on (e.g. the urllib @@ -974,7 +974,7 @@ cd .. rm -rf issue0000 - + bzr ''' Here's an approach that uses bzr shelf (now a standard part of bzr) @@ -984,7 +984,7 @@ bzr branch bzr+svn://trunk bug-0000 cd bug-0000 - # Edit some code.? Dang, we need to fix the socket module. + # Edit some code. Dang, we need to fix the socket module. bzr shelve --all # Edit some code. bzr commit -m "Socket module fixes" @@ -992,15 +992,15 @@ bzr unshelve # Edit some code -Another approach one might take uses the loom plugin.? Looms can +Another approach one might take uses the loom plugin. Looms can greatly simply working on dependent branches because they -automatically take care of the stacking dependencies for you.? +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 -diffs between threads, etc.? Occasionally, you may need or want to +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 +or commit. Higher threads incorporate all the changes in the lower threads, automatically. :: @@ -1008,7 +1008,7 @@ cd bug-0000 bzr loomify trunk bzr create-thread fix-urllib - # Edit some code.? Dang, we need to fix the socket module. + # Edit some code. Dang, we need to fix the socket module. bzr commit -m "Checkpointing my work so far" bzr down-thread bzr create-thread fix-socket @@ -1022,27 +1022,27 @@ bzr record done For bonus points, let's say someone else fixes the socket module in -exactly the same way you did.? Perhaps this person even grabbed your -fix-socket thread and applied just that to the trunk.? You'd like to +exactly the same way you did. Perhaps this person even grabbed your +fix-socket thread and applied just that to the trunk. You'd like to be able to merge their changes into your loom and delete your now-redundant fix-socket thread. -:: +:: bzr down-thread trunk - # Get all new revisions to the trunk.? If you've done things + # Get all new revisions to the trunk. If you've done things # correctly, this must succeed without conflict. bzr pull bzr up-thread - # See?? The fix-socket thread is now identical to the trunk + # See? The fix-socket thread is now identical to the trunk bzr commit -m 'Merge in trunk changes' - bzr diff -r thread: | wc -l? # returns 0 + bzr diff -r thread: | wc -l # returns 0 bzr combine-thread bzr up-thread # Resolve any conflicts bzr commit -m 'Merge trunk' # Now our top-thread has an up-to-date trunk and just the urllib fix. - + hg '' :: @@ -1065,9 +1065,9 @@ hg merge hg push cd .. - rm -rf?issue0000?fix-socket-bug + rm -rf issue0000 fix-socket-bug + - git ''' :: @@ -1110,39 +1110,39 @@ git reset --hard checkpoint 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 + # 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. + # 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. + # Now our HEAD has an up-to-date trunk and just the urllib fix. Doing a Python Release ---------------------- How does PEP 101 change when using a DVCS? - + bzr ''' -It will change, but not substantially so.? When doing the +It will change, but not substantially so. When doing the maintenance branch, we'll just push to the new location instead of -doing an svn cp.? Tags are totally different, since in svn they are +doing an svn cp. Tags are totally different, since in svn they are directory copies, but in bzr (and I'm guessing hg), they are just -symbolic names for revisions on a particular branch.? The release.py -script will have to change to use bzr commands instead.? It's +symbolic names for revisions on a particular branch. The release.py +script will have to change to use bzr commands instead. It's possible that because DVCS (in particular, bzr) does cherry picking and merging well enough that we'll be able to create the maint -branches sooner.? It would be a useful exercise to try to do a +branches sooner. It would be a useful exercise to try to do a release off the bzr/hg mirrors. - - + + hg '' @@ -1159,22 +1159,22 @@ git ''' -It will change, but not substantially so.? When doing the +It will change, but not substantially so. When doing the maintenance branch, we'll just git push to the new location instead -of doing an svn cp.? Tags are totally different, since in svn they +of doing an svn cp. Tags are totally different, since in svn they are directory copies, but in git they are just symbolic names for -revisions, as are branches. ?(The difference between a tag and a +revisions, as are branches. (The difference between a tag and a branch is that tags refer to a particular commit, and will never -change unless you use git tag -f to force them to move. ?The +change unless you use git tag -f to force them to move. The checked-out branch, on the other hand, is automatically updated by -git commit.) ?The release.py script will have to change to use git -commands instead. ?With git I would create a (local) maintenance -branch as soon as the release engineer is chosen. ?Then I'd "git +git commit.) The release.py script will have to change to use git +commands instead. With git I would create a (local) maintenance +branch as soon as the release engineer is chosen. Then I'd "git pull" until I didn't like a patch, when it would be "git pull; git revert ugly-patch", until it started to look like the sensible thing is to fork off, and start doing "git cherry-pick" on the good patches. - + Platform/Tool Support ===================== @@ -1182,8 +1182,8 @@ Operating Systems ----------------- ==== ======================================= ============================================= ============================= -DVCS Windows OS X UNIX ----- --------------------------------------- --------------------------------------------- ----------------------------- +DVCS Windows OS X UNIX +---- --------------------------------------- --------------------------------------------- ----------------------------- bzr yes (installer) w/ tortoise yes (installer, fink or MacPorts) yes (various package formats) hg yes (third-party installer) w/ tortoise yes (third-party installer, fink or MacPorts) yes (various package formats) git yes (third-party installer) yes (third-party installer, fink or MacPorts) yes (.deb or .rpm) @@ -1207,7 +1207,7 @@ bzr My understanding is that support for this is being worked on as - I type, landing in a version RSN.? I will try to dig up details. + I type, landing in a version RSN. I will try to dig up details. hg Supported via the win32text extension. @@ -1221,9 +1221,9 @@ Case-insensitive filesystem support ----------------------------------- -bzr - Should be OK.? I share branches between Linux and OS all the - time.? I've done case changes (e.g. bzr mv Mailman mailman) and +bzr + Should be OK. I share branches between Linux and OS all the + time. I've done case changes (e.g. bzr mv Mailman mailman) and as long as I did it on Linux (obviously), when I pulled in the changes on OS X everything was hunky dory. @@ -1236,7 +1236,7 @@ git does not have a problem with renames in either direction. However, case-insensitive filesystem support is usually taken to mean complaining about collisions on case-sensitive files - systems. ?git does not do that. + systems. git does not do that. Tools @@ -1244,9 +1244,9 @@ In terms of code review tools such as `Review Board`_ and Rietveld_, the former supports all three while the latter supports hg and git but -not bzr.? Bazaar does not yet have an online review board, but it -has several ways to manage email based reviews and trunk merging.? -There's?`Bundle Buggy`_, `Patch Queue Manager`_ (PQM), and +not bzr. Bazaar does not yet have an online review board, but it +has several ways to manage email based reviews and trunk merging. +There's `Bundle Buggy`_, `Patch Queue Manager`_ (PQM), and `Launchpad's code reviews `_. .. _Review Board: http://www.review-board.org/ @@ -1284,14 +1284,14 @@ All three DVCSs have svn support, although git is the only one to come with that support out-of-the-box. - + Server Support ============== ==== ================== DVCS Web page interface ----- ------------------ +---- ------------------ bzr loggerhead_ hg hgweb_ git gitweb_ @@ -1327,7 +1327,7 @@ Martin Pool adds: "bzr has a stable Python scripting interface, with a distinction between public and private interfaces and a -deprecation window for APIs that are changing.? Some plugins are +deprecation window for APIs that are changing. Some plugins are listed in https://edge.launchpad.net/bazaar and http://bazaar-vcs.org/Documentation". @@ -1347,7 +1347,7 @@ --- git has a cvsserver mode, ie, you can check out a tree from git -using CVS. ?You can even commit to the tree, but features like +using CVS. You can even commit to the tree, but features like merging are absent, and branches are handled as CVS modules, which is likely to shock a veteran CVS user. @@ -1367,19 +1367,19 @@ The amount of time and effort it takes to get a checkout of Python's repository is critical. If the difficulty or time is too great then a person wishing to contribute to Python may very well give up. That -cannot be allowed to happen. +cannot be allowed to happen. I measured the checking out of code 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 +DVCS Time Space ------- ---------------- -------------- -svn 1:04 139 M +svn 1:04 139 M bzr 10:45 276 M -hg 2:30 171 M -git 2:54 134 M +hg 2:30 171 M +git 2:54 134 M ======= ================ ============== .. note:: @@ -1476,7 +1476,7 @@ import random print(random.choice(['svn', 'bzr', 'hg', 'git'])) - + Transition Plan =============== From python-checkins at python.org Tue Jan 27 21:14:53 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 21:14:53 +0100 (CET) Subject: [Python-checkins] r69029 - peps/trunk/pep0 Message-ID: <20090127201453.EE4351E400C@bag.python.org> Author: brett.cannon Date: Tue Jan 27 21:14:53 2009 New Revision: 69029 Log: Ignore .pyc and .pyo files. Modified: peps/trunk/pep0/ (props changed) From python-checkins at python.org Tue Jan 27 21:17:04 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 27 Jan 2009 21:17:04 +0100 (CET) Subject: [Python-checkins] r69030 - peps/trunk/pep-0374.txt Message-ID: <20090127201704.482531E4002@bag.python.org> Author: brett.cannon Date: Tue Jan 27 21:17:04 2009 New Revision: 69030 Log: Add a note about expected performance changes if my tests had run against bzr 1.9 or newer. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Tue Jan 27 21:17:04 2009 @@ -1384,7 +1384,8 @@ .. 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 reported numbers. + 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 From python-checkins at python.org Tue Jan 27 21:24:53 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 27 Jan 2009 21:24:53 +0100 (CET) Subject: [Python-checkins] r69031 - in python/branches/py3k-issue1717: Doc/distutils/apiref.rst Doc/library/collections.rst Doc/library/importlib.rst Doc/library/itertools.rst Doc/library/operator.rst Lib/collections.py Lib/ctypes/test/test_libc.py Lib/distutils/ccompiler.py Lib/distutils/command/sdist.py Lib/distutils/mwerkscompiler.py Lib/distutils/tests/test_sdist.py Lib/doctest.py Lib/idlelib/PyShell.py Lib/importlib/NOTES Lib/importlib/test/builtin/test_finder.py Lib/importlib/test/extension/test_finder.py Lib/importlib/test/finder_tests.py Lib/importlib/test/frozen/test_finder.py Lib/importlib/test/loader_tests.py Lib/locale.py Lib/test/test_array.py Lib/test/test_bool.py Lib/test/test_cmd_line.py Lib/test/test_contains.py Lib/test/test_copy.py Lib/test/test_datetime.py Lib/test/test_itertools.py Lib/test/test_operator.py Lib/test/test_sundry.py Lib/test/test_uuid.py Lib/unittest.py Lib/xml/dom/minidom.py Lib/xml/etree/ElementTree.py Misc/NEWS Modules/_ssl.c Modules/itertoolsmodule.c Modules/operator.c Objects/longobject.c Python/makeopcodetargets.py Python/pythonrun.c Message-ID: <20090127202453.56DD91E4002@bag.python.org> Author: mark.dickinson Date: Tue Jan 27 21:24:52 2009 New Revision: 69031 Log: Merged revisions 68928,68931,68935,68937,68949,68954,68956-68957,68960-68961,68963,68965,68969,68977,68980-68981,68986,68991-68993,68995-68997,68999-69000,69002,69004-69005,69007,69011,69013,69015,69019-69020,69022,69024-69025 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68928 | hirokazu.yamamoto | 2009-01-25 17:50:07 +0000 (Sun, 25 Jan 2009) | 8 lines Blocked revisions 68927 via svnmerge ........ r68927 | hirokazu.yamamoto | 2009-01-26 02:46:48 +0900 | 1 line Fixed compile error on windows. ........ ................ r68931 | tarek.ziade | 2009-01-25 18:27:45 +0000 (Sun, 25 Jan 2009) | 9 lines Merged revisions 68929 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68929 | tarek.ziade | 2009-01-25 19:19:25 +0100 (Sun, 25 Jan 2009) | 1 line Fixed #4863: removed distutils.mwerkscompiler ........ ................ r68935 | tarek.ziade | 2009-01-25 19:31:22 +0000 (Sun, 25 Jan 2009) | 9 lines Merged revisions 68933 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68933 | tarek.ziade | 2009-01-25 20:29:10 +0100 (Sun, 25 Jan 2009) | 1 line Issue #4863, removing remaining bits ........ ................ r68937 | benjamin.peterson | 2009-01-25 19:44:16 +0000 (Sun, 25 Jan 2009) | 1 line use the classmethod directive ................ r68949 | mark.dickinson | 2009-01-25 22:25:06 +0000 (Sun, 25 Jan 2009) | 10 lines Merged revisions 68947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68947 | mark.dickinson | 2009-01-25 22:12:31 +0000 (Sun, 25 Jan 2009) | 3 lines No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. ........ ................ r68954 | brett.cannon | 2009-01-26 01:21:47 +0000 (Mon, 26 Jan 2009) | 9 lines Blocked revisions 68953 via svnmerge ........ r68953 | brett.cannon | 2009-01-25 17:16:50 -0800 (Sun, 25 Jan 2009) | 3 lines Backport importlib in the form of providing importlib.import_module(). This has been done purely to help transitions from 2.7 to 3.1. ........ ................ r68956 | brett.cannon | 2009-01-26 01:54:40 +0000 (Mon, 26 Jan 2009) | 1 line Update NOTES for importlib. ................ r68957 | raymond.hettinger | 2009-01-26 02:09:03 +0000 (Mon, 26 Jan 2009) | 9 lines As discussed on python-dev, remove several operator functions isSequenceType(), isMappingType(), and isNumberType() in favor of using abstract base classes. Also, remove repeat() and irepeat() in favor of mul() and imul(). After the buildbots have had a go at this. Will backport to Py3.0.1. For Py2.7, will just mark as deprecated. ................ r68960 | raymond.hettinger | 2009-01-26 02:23:50 +0000 (Mon, 26 Jan 2009) | 1 line Backport r68942: update powerset() recipe. ................ r68961 | raymond.hettinger | 2009-01-26 02:56:58 +0000 (Mon, 26 Jan 2009) | 1 line Forward port r68941 adding itertools.compress(). ................ r68963 | benjamin.peterson | 2009-01-26 03:50:45 +0000 (Mon, 26 Jan 2009) | 12 lines Blocked revisions 68941-68942 via svnmerge ........ r68941 | raymond.hettinger | 2009-01-25 15:04:14 -0600 (Sun, 25 Jan 2009) | 1 line Promote compress() from a recipe to being a regular itertool. ........ r68942 | raymond.hettinger | 2009-01-25 15:31:47 -0600 (Sun, 25 Jan 2009) | 1 line Improved itertools recipe for generating powerset(). ........ ................ r68965 | raymond.hettinger | 2009-01-26 16:53:29 +0000 (Mon, 26 Jan 2009) | 1 line Fix signed/unsigned mismatch. ................ r68969 | tarek.ziade | 2009-01-26 17:23:20 +0000 (Mon, 26 Jan 2009) | 9 lines Merged revisions 68951 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68951 | tarek.ziade | 2009-01-26 00:34:00 +0100 (Mon, 26 Jan 2009) | 1 line Fixed #1885: --formats=tar,gztar was not working properly in the sdist command ........ ................ r68977 | antoine.pitrou | 2009-01-26 21:48:00 +0000 (Mon, 26 Jan 2009) | 3 lines Followup of #4705: we can't skip the binary buffering layer for stdin because FileIO doesn't have a read1() method ................ r68980 | mark.dickinson | 2009-01-26 21:56:07 +0000 (Mon, 26 Jan 2009) | 14 lines Merged revisions 68974-68975 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68974 | mark.dickinson | 2009-01-26 21:36:30 +0000 (Mon, 26 Jan 2009) | 4 lines Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. ........ r68975 | mark.dickinson | 2009-01-26 21:40:08 +0000 (Mon, 26 Jan 2009) | 2 lines Fix comment. ........ ................ r68981 | antoine.pitrou | 2009-01-26 22:00:21 +0000 (Mon, 26 Jan 2009) | 3 lines Fix test so as to also pass in debug mode ................ r68986 | raymond.hettinger | 2009-01-27 00:28:36 +0000 (Tue, 27 Jan 2009) | 1 line Forward port r68985: Idle startup message. ................ r68991 | brett.cannon | 2009-01-27 01:33:54 +0000 (Tue, 27 Jan 2009) | 2 lines Move importlib.test.extension.test_finder over to importlib.test.finder_tests. ................ r68992 | brett.cannon | 2009-01-27 01:34:30 +0000 (Tue, 27 Jan 2009) | 2 lines Make importlib.test.finder_tests an ABC. ................ r68993 | brett.cannon | 2009-01-27 01:41:57 +0000 (Tue, 27 Jan 2009) | 2 lines Move importlib.test.builtin.test_finder over to importlib.test.finder_tests. ................ r68995 | brett.cannon | 2009-01-27 01:44:50 +0000 (Tue, 27 Jan 2009) | 2 lines Move importlib.test.frozen.test_finder over to importlib.test.finder_tests. ................ r68996 | brett.cannon | 2009-01-27 01:46:04 +0000 (Tue, 27 Jan 2009) | 1 line Update importlib NOTES. ................ r68997 | benjamin.peterson | 2009-01-27 02:30:47 +0000 (Tue, 27 Jan 2009) | 15 lines Blocked revisions 68964,68985 via svnmerge ........ r68964 | raymond.hettinger | 2009-01-26 10:52:22 -0600 (Mon, 26 Jan 2009) | 1 line Fix signed/unsigned mismatch. ........ r68985 | raymond.hettinger | 2009-01-26 17:29:09 -0600 (Mon, 26 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. ........ ................ r68999 | raymond.hettinger | 2009-01-27 02:38:22 +0000 (Tue, 27 Jan 2009) | 3 lines Tweak column alignment in collections docs. ................ r69000 | brett.cannon | 2009-01-27 02:39:33 +0000 (Tue, 27 Jan 2009) | 2 lines Initial take on importlib.test.loader_tests. ................ r69002 | benjamin.peterson | 2009-01-27 03:02:38 +0000 (Tue, 27 Jan 2009) | 8 lines Blocked revisions 68998 via svnmerge ........ r68998 | raymond.hettinger | 2009-01-26 20:36:33 -0600 (Mon, 26 Jan 2009) | 3 lines Tweak column alignment for collections docs. ........ ................ r69004 | raymond.hettinger | 2009-01-27 04:20:44 +0000 (Tue, 27 Jan 2009) | 1 line Forward port r69001: itertools.combinations_with_replacement(). ................ r69005 | raymond.hettinger | 2009-01-27 04:42:48 +0000 (Tue, 27 Jan 2009) | 1 line Put functions back in alphabetical order. ................ r69007 | raymond.hettinger | 2009-01-27 04:57:51 +0000 (Tue, 27 Jan 2009) | 1 line Beautify grouper() recipe in docs. ................ r69011 | raymond.hettinger | 2009-01-27 09:35:21 +0000 (Tue, 27 Jan 2009) | 1 line Add tests to verify combinatoric relationships. ................ r69013 | raymond.hettinger | 2009-01-27 09:56:30 +0000 (Tue, 27 Jan 2009) | 1 line Stronger tests for combinatoric relationships. ................ r69015 | raymond.hettinger | 2009-01-27 10:06:09 +0000 (Tue, 27 Jan 2009) | 1 line Issue 5021: doctest.testfile should set __name__ ................ r69019 | raymond.hettinger | 2009-01-27 10:39:42 +0000 (Tue, 27 Jan 2009) | 1 line More exhaustive combinatoric checks. ................ r69020 | antoine.pitrou | 2009-01-27 10:49:58 +0000 (Tue, 27 Jan 2009) | 3 lines Add executable property to Python/makeopcodetargets.py ................ r69022 | raymond.hettinger | 2009-01-27 11:06:40 +0000 (Tue, 27 Jan 2009) | 1 line Resurrect two buffer tests, converting irepeat() to imul(). Undoes part of r68962. ................ r69024 | raymond.hettinger | 2009-01-27 13:29:43 +0000 (Tue, 27 Jan 2009) | 1 line Add more tests for the powerset() recipe. ................ r69025 | mark.dickinson | 2009-01-27 18:17:45 +0000 (Tue, 27 Jan 2009) | 3 lines Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from the standard library and tests. ................ Added: python/branches/py3k-issue1717/Lib/importlib/test/loader_tests.py - copied unchanged from r69025, /python/branches/py3k/Lib/importlib/test/loader_tests.py Removed: python/branches/py3k-issue1717/Lib/distutils/mwerkscompiler.py Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Doc/distutils/apiref.rst python/branches/py3k-issue1717/Doc/library/collections.rst python/branches/py3k-issue1717/Doc/library/importlib.rst python/branches/py3k-issue1717/Doc/library/itertools.rst python/branches/py3k-issue1717/Doc/library/operator.rst python/branches/py3k-issue1717/Lib/collections.py python/branches/py3k-issue1717/Lib/ctypes/test/test_libc.py python/branches/py3k-issue1717/Lib/distutils/ccompiler.py python/branches/py3k-issue1717/Lib/distutils/command/sdist.py python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py python/branches/py3k-issue1717/Lib/doctest.py python/branches/py3k-issue1717/Lib/idlelib/PyShell.py python/branches/py3k-issue1717/Lib/importlib/NOTES python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py python/branches/py3k-issue1717/Lib/locale.py python/branches/py3k-issue1717/Lib/test/test_array.py python/branches/py3k-issue1717/Lib/test/test_bool.py python/branches/py3k-issue1717/Lib/test/test_cmd_line.py python/branches/py3k-issue1717/Lib/test/test_contains.py python/branches/py3k-issue1717/Lib/test/test_copy.py python/branches/py3k-issue1717/Lib/test/test_datetime.py python/branches/py3k-issue1717/Lib/test/test_itertools.py python/branches/py3k-issue1717/Lib/test/test_operator.py python/branches/py3k-issue1717/Lib/test/test_sundry.py python/branches/py3k-issue1717/Lib/test/test_uuid.py python/branches/py3k-issue1717/Lib/unittest.py python/branches/py3k-issue1717/Lib/xml/dom/minidom.py python/branches/py3k-issue1717/Lib/xml/etree/ElementTree.py python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/Modules/_ssl.c python/branches/py3k-issue1717/Modules/itertoolsmodule.c python/branches/py3k-issue1717/Modules/operator.c python/branches/py3k-issue1717/Objects/longobject.c python/branches/py3k-issue1717/Python/makeopcodetargets.py (props changed) python/branches/py3k-issue1717/Python/pythonrun.c Modified: python/branches/py3k-issue1717/Doc/distutils/apiref.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/distutils/apiref.rst (original) +++ python/branches/py3k-issue1717/Doc/distutils/apiref.rst Tue Jan 27 21:24:52 2009 @@ -847,23 +847,6 @@ :class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2. -:mod:`distutils.mwerkscompiler` --- Metrowerks CodeWarrior support -================================================================== - -.. module:: distutils.mwerkscompiler - :synopsis: Metrowerks CodeWarrior support - - -Contains :class:`MWerksCompiler`, an implementation of the abstract -:class:`CCompiler` class for MetroWerks CodeWarrior on the pre-Mac OS X -Macintosh. Needs work to support CW on Windows or Mac OS X. - -.. % \subsection{Utility modules} -.. % -.. % The following modules all provide general utility functions. They haven't -.. % all been documented yet. - - :mod:`distutils.archive_util` --- Archiving utilities ====================================================== Modified: python/branches/py3k-issue1717/Doc/library/collections.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/collections.rst (original) +++ python/branches/py3k-issue1717/Doc/library/collections.rst Tue Jan 27 21:24:52 2009 @@ -171,10 +171,10 @@ Elements are counted from an *iterable* or initialized from another *mapping* (or counter):: - >>> c = Counter() # a new, empty counter - >>> c = Counter('gallahad') # a new counter from an iterable - >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping - >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(cats=4, dogs=8) # a new counter from keyword args Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:: @@ -207,10 +207,10 @@ .. 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* is not specified or is ``None``, - return a list of all element counts in decreasing order of frequency. - Elements with equal counts are ordered arbitrarily:: + 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` + returns *all* elements in the counter. Elements with equal counts are + ordered arbitrarily:: >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] @@ -220,33 +220,26 @@ .. method:: fromkeys(iterable) - This class method is not implemented for :class:`Counter` objects. + This class method is not implemented for :class:`Counter` objects. .. method:: update([iterable-or-mapping]) - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter). Like :meth:`dict.update` but adds-in counts - instead of replacing them. Also, the *iterable* is expected to be a - sequence of elements, not a sequence of ``(key, value)`` pairs:: - - >>> c = Counter('which') - >>> c.update('witch') # add elements from another iterable - >>> d = Counter('watch') - >>> c.update(d) # add elements from another counter - >>> c['h'] # four 'h' in which, witch, and watch - 4 + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter). Like :meth:`dict.update` but adds counts + instead of replacing them. Also, the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs. Common patterns for working with :class:`Counter` objects:: - sum(c.values()) # total of all counts - c.clear() # reset all counts - list(c) # list unique elements - set(c) # convert to a set - dict(c) # convert to a regular dictionary - c.items() # convert to a list of (elem, cnt) pairs - Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs - c.most_common()[:-n:-1] # n least common elements - c += Counter() # remove zero and negative counts + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + 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 @@ -258,13 +251,13 @@ >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) - >>> c + d # add two counters together: c[x] + d[x] + >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) - >>> c - d # subtract (keeping only positive counts) + >>> c - d # subtract (keeping only positive counts) Counter({'a': 2}) - >>> c & d # intersection: min(c[x], d[x]) + >>> c & d # intersection: min(c[x], d[x]) Counter({'a': 1, 'b': 1}) - >>> c | d # union: max(c[x], d[x]) + >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) .. seealso:: @@ -286,8 +279,7 @@ Section 4.6.3, Exercise 19*\. * To enumerate all distinct multisets of a given size over a given set of - elements, see the :func:`combinations_with_replacement` function in the - :ref:`itertools-recipes` for itertools:: + elements, see :func:`itertools.combinations_with_replacement`. map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC Modified: python/branches/py3k-issue1717/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/importlib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/importlib.rst Tue Jan 27 21:24:52 2009 @@ -95,12 +95,12 @@ Only class methods are defined by this class to alleviate the need for instantiation. - .. method:: find_module(fullname, path=None) + .. classmethod:: find_module(fullname, path=None) Class method that allows this class to be a :term:`finder` for built-in modules. - .. method:: load_module(fullname) + .. classmethod:: load_module(fullname) Class method that allows this class to be a :term:`loader` for built-in modules. @@ -113,12 +113,12 @@ Only class methods are defined by this class to alleviate the need for instantiation. - .. method:: find_module(fullname, path=None) + .. classmethod:: find_module(fullname, path=None) Class method that allows this class to be a :term:`finder` for frozen modules. - .. method:: load_module(fullname) + .. classmethod:: load_module(fullname) Class method that allows this class to be a :term:`loader` for frozen modules. Modified: python/branches/py3k-issue1717/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/itertools.rst (original) +++ python/branches/py3k-issue1717/Doc/library/itertools.rst Tue Jan 27 21:24:52 2009 @@ -133,6 +133,67 @@ The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` or zero when ``r > n``. +.. function:: combinations_with_replacement(iterable, r) + + Return *r* length subsequences of elements from the input *iterable* + allowing individual elements to be repeated more than once. + + Combinations are emitted in lexicographic sort order. So, if the + input *iterable* is sorted, the combination tuples will be produced + in sorted order. + + Elements are treated as unique based on their position, not on their + value. So if the input elements are unique, the generated combinations + will also be unique. + + Equivalent to:: + + def combinations_with_replacement(iterable, r): + # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + The code for :func:`combinations_with_replacement` can be also expressed as + a subsequence of :func:`product` after filtering entries where the elements + are not in sorted order (according to their position in the input pool):: + + def combinations_with_replacement(iterable, r): + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``. + + .. versionadded:: 2.7 + +.. function:: compress(data, selectors) + + Make an iterator that filters elements from *data* returning only those that + have a corresponding element in *selectors* that evaluates to ``True``. + Stops when either the *data* or *selectors* iterables have been exhausted. + Equivalent to:: + + def compress(data, selectors): + # 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 + + .. function:: count([n]) Make an iterator that returns consecutive integers starting with *n*. If not @@ -184,6 +245,20 @@ for x in iterable: yield x +.. function:: filterfalse(predicate, iterable) + + Make an iterator that filters elements from iterable returning only those for + which the predicate is ``False``. If *predicate* is ``None``, return the items + that are false. Equivalent to:: + + def filterfalse(predicate, iterable): + # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 + if predicate is None: + predicate = bool + for x in iterable: + if not predicate(x): + yield x + .. function:: groupby(iterable[, key]) @@ -237,21 +312,6 @@ self.currkey = self.keyfunc(self.currvalue) -.. function:: filterfalse(predicate, iterable) - - Make an iterator that filters elements from iterable returning only those for - which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: - - def filterfalse(predicate, iterable): - # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 - if predicate is None: - predicate = bool - for x in iterable: - if not predicate(x): - yield x - - .. function:: islice(iterable, [start,] stop [, step]) Make an iterator that returns selected elements from the iterable. If *start* is @@ -281,30 +341,6 @@ then the step defaults to one. -.. function:: zip_longest(*iterables[, fillvalue]) - - Make an iterator that aggregates elements from each of the iterables. If the - iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: - - def zip_longest(*args, fillvalue=None): - # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- - def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): - yield counter() # yields the fillvalue, or raises IndexError - fillers = repeat(fillvalue) - iters = [chain(it, sentinel(), fillers) for it in args] - try: - for tup in zip(*iters): - yield tup - except IndexError: - pass - - If one of the iterables is potentially infinite, then the :func:`zip_longest` - function should be wrapped with something that limits the number of calls - (for example :func:`islice` or :func:`takewhile`). If not specified, - *fillvalue* defaults to ``None``. - - .. function:: permutations(iterable[, r]) Return successive *r* length permutations of elements in the *iterable*. @@ -464,6 +500,30 @@ is faster to use :func:`list` instead of :func:`tee`. +.. function:: zip_longest(*iterables[, fillvalue]) + + Make an iterator that aggregates elements from each of the iterables. If the + iterables are of uneven length, missing values are filled-in with *fillvalue*. + Iteration continues until the longest iterable is exhausted. Equivalent to:: + + def zip_longest(*args, fillvalue=None): + # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- + def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): + yield counter() # yields the fillvalue, or raises IndexError + fillers = repeat(fillvalue) + iters = [chain(it, sentinel(), fillers) for it in args] + try: + for tup in zip(*iters): + yield tup + except IndexError: + pass + + If one of the iterables is potentially infinite, then the :func:`zip_longest` + function should be wrapped with something that limits the number of calls + (for example :func:`islice` or :func:`takewhile`). If not specified, + *fillvalue* defaults to ``None``. + + .. _itertools-example: Examples @@ -574,7 +634,7 @@ def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n - return zip_longest(fillvalue=fillvalue, *args) + return zip_longest(*args, fillvalue=fillvalue) def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" @@ -590,31 +650,9 @@ nexts = cycle(islice(nexts, pending)) def powerset(iterable): - "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" - # Recipe credited to Eric Raymond - pairs = [(2**i, x) for i, x in enumerate(iterable)] - for n in xrange(2**len(pairs)): - yield set(x for m, x in pairs if m&n) - - def compress(data, selectors): - "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" - return (d for d, s in zip(data, selectors) if s) - - def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" - # number items returned: (n+r-1)! / r! / (n-1)! - pool = tuple(iterable) - n = len(pool) - indices = [0] * r - yield tuple(pool[i] for i in indices) - while True: - for i in reversed(range(r)): - if indices[i] != n - 1: - break - else: - return - indices[i:] = [indices[i] + 1] * (r - i) - yield tuple(pool[i] for i in indices) + "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_everseen(iterable, key=None): "List unique elements, preserving order. Remember all elements ever seen." Modified: python/branches/py3k-issue1717/Doc/library/operator.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/operator.rst (original) +++ python/branches/py3k-issue1717/Doc/library/operator.rst Tue Jan 27 21:24:52 2009 @@ -221,12 +221,6 @@ Return the index of the first of occurrence of *b* in *a*. -.. function:: repeat(a, b) - __repeat__(a, b) - - Return ``a * b`` where *a* is a sequence and *b* is an integer. - - .. function:: setitem(a, b, c) __setitem__(a, b, c) @@ -294,13 +288,6 @@ ``a = ipow(a, b)`` is equivalent to ``a **= b``. -.. function:: irepeat(a, b) - __irepeat__(a, b) - - ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and - *b* is an integer. - - .. function:: irshift(a, b) __irshift__(a, b) @@ -324,67 +311,6 @@ ``a = ixor(a, b)`` is equivalent to ``a ^= b``. - -The :mod:`operator` module also defines a few predicates to test the type of -objects. - -.. XXX just remove them? -.. note:: - - Be careful not to misinterpret the results of these functions; none have any - measure of reliability with instance objects. - For example: - - >>> class C: - ... pass - ... - >>> import operator - >>> obj = C() - >>> operator.isMappingType(obj) - True - -.. note:: - - Since there are now abstract classes for collection types, you should write, - for example, ``isinstance(obj, collections.Mapping)`` and ``isinstance(obj, - collections.Sequence)``. - -.. function:: isMappingType(obj) - - 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) - - 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) - - 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__`. - - .. 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. @@ -513,8 +439,6 @@ +-----------------------+-------------------------+---------------------------------+ | Right Shift | ``a >> b`` | ``rshift(a, b)`` | +-----------------------+-------------------------+---------------------------------+ -| Sequence Repetition | ``seq * i`` | ``repeat(seq, i)`` | -+-----------------------+-------------------------+---------------------------------+ | String Formatting | ``s % obj`` | ``mod(s, obj)`` | +-----------------------+-------------------------+---------------------------------+ | Subtraction | ``a - b`` | ``sub(a, b)`` | Modified: python/branches/py3k-issue1717/Lib/collections.py ============================================================================== --- python/branches/py3k-issue1717/Lib/collections.py (original) +++ python/branches/py3k-issue1717/Lib/collections.py Tue Jan 27 21:24:52 2009 @@ -111,7 +111,7 @@ # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result Modified: python/branches/py3k-issue1717/Lib/ctypes/test/test_libc.py ============================================================================== --- python/branches/py3k-issue1717/Lib/ctypes/test/test_libc.py (original) +++ python/branches/py3k-issue1717/Lib/ctypes/test/test_libc.py Tue Jan 27 21:24:52 2009 @@ -5,7 +5,8 @@ lib = CDLL(_ctypes_test.__file__) -def twcmp(x, y): +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" return (x > y) - (x < y) class LibTest(unittest.TestCase): @@ -22,7 +23,7 @@ lib.my_qsort.restype = None def sort(a, b): - return twcmp(a[0], b[0]) + return three_way_cmp(a[0], b[0]) chars = create_string_buffer("spam, spam, and spam") lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) Modified: python/branches/py3k-issue1717/Lib/distutils/ccompiler.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/ccompiler.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/ccompiler.py Tue Jan 27 21:24:52 2009 @@ -1004,7 +1004,6 @@ # OS name mappings ('posix', 'unix'), ('nt', 'msvc'), - ('mac', 'mwerks'), ) @@ -1042,8 +1041,6 @@ "Mingw32 port of GNU C Compiler for Win32"), 'bcpp': ('bcppcompiler', 'BCPPCompiler', "Borland C++ Compiler"), - 'mwerks': ('mwerkscompiler', 'MWerksCompiler', - "MetroWerks CodeWarrior"), 'emx': ('emxccompiler', 'EMXCCompiler', "EMX port of GNU C Compiler for OS/2"), } Modified: python/branches/py3k-issue1717/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/command/sdist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/command/sdist.py Tue Jan 27 21:24:52 2009 @@ -428,6 +428,10 @@ self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) Deleted: python/branches/py3k-issue1717/Lib/distutils/mwerkscompiler.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/mwerkscompiler.py Tue Jan 27 21:24:52 2009 +++ (empty file) @@ -1,245 +0,0 @@ -"""distutils.mwerkscompiler - -Contains MWerksCompiler, an implementation of the abstract CCompiler class -for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on -Windows.""" - -__revision__ = "$Id$" - -import sys, os -from distutils.errors import \ - DistutilsExecError, DistutilsPlatformError, \ - CompileError, LibError, LinkError -from distutils.ccompiler import \ - CCompiler, gen_preprocess_options, gen_lib_options -import distutils.util -import distutils.dir_util -from distutils import log - -class MWerksCompiler (CCompiler) : - """Concrete class that implements an interface to MetroWerks CodeWarrior, - as defined by the CCompiler abstract class.""" - - compiler_type = 'mwerks' - - # Just set this so CCompiler's constructor doesn't barf. We currently - # don't use the 'set_executables()' bureaucracy provided by CCompiler, - # as it really isn't necessary for this sort of single-compiler class. - # Would be nice to have a consistent interface with UnixCCompiler, - # though, so it's worth thinking about. - executables = {} - - # Private class data (need to distinguish C from C++ source for compiler) - _c_extensions = ['.c'] - _cpp_extensions = ['.cc', '.cpp', '.cxx'] - _rc_extensions = ['.r'] - _exp_extension = '.exp' - - # Needed for the filename generation methods provided by the - # base class, CCompiler. - src_extensions = (_c_extensions + _cpp_extensions + - _rc_extensions) - res_extension = '.rsrc' - obj_extension = '.obj' # Not used, really - static_lib_extension = '.lib' - shared_lib_extension = '.slb' - static_lib_format = shared_lib_format = '%s%s' - exe_extension = '' - - - def __init__ (self, - verbose=0, - dry_run=0, - force=0): - - CCompiler.__init__ (self, verbose, dry_run, force) - - - def compile (self, - sources, - output_dir=None, - macros=None, - include_dirs=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - depends=None): - (output_dir, macros, include_dirs) = \ - self._fix_compile_args (output_dir, macros, include_dirs) - self.__sources = sources - self.__macros = macros - self.__include_dirs = include_dirs - # Don't need extra_preargs and extra_postargs for CW - return [] - - def link (self, - target_desc, - objects, - output_filename, - output_dir=None, - libraries=None, - library_dirs=None, - runtime_library_dirs=None, - export_symbols=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - build_temp=None, - target_lang=None): - # First fixup. - (objects, output_dir) = self._fix_object_args (objects, output_dir) - (libraries, library_dirs, runtime_library_dirs) = \ - self._fix_lib_args (libraries, library_dirs, runtime_library_dirs) - - # First examine a couple of options for things that aren't implemented yet - if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT): - raise DistutilsPlatformError('Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac') - if runtime_library_dirs: - raise DistutilsPlatformError('Runtime library dirs not implemented yet') - if extra_preargs or extra_postargs: - raise DistutilsPlatformError('Runtime library dirs not implemented yet') - if len(export_symbols) != 1: - raise DistutilsPlatformError('Need exactly one export symbol') - # Next there are various things for which we need absolute pathnames. - # This is because we (usually) create the project in a subdirectory of - # where we are now, and keeping the paths relative is too much work right - # now. - sources = [self._filename_to_abs(s) for s in self.__sources] - include_dirs = [self._filename_to_abs(d) for d in self.__include_dirs] - if objects: - objects = [self._filename_to_abs(o) for o in objects] - else: - objects = [] - if build_temp: - build_temp = self._filename_to_abs(build_temp) - else: - build_temp = os.curdir() - if output_dir: - output_filename = os.path.join(output_dir, output_filename) - # The output filename needs special handling: splitting it into dir and - # filename part. Actually I'm not sure this is really needed, but it - # can't hurt. - output_filename = self._filename_to_abs(output_filename) - output_dir, output_filename = os.path.split(output_filename) - # Now we need the short names of a couple of things for putting them - # into the project. - if output_filename[-8:] == '.ppc.slb': - basename = output_filename[:-8] - elif output_filename[-11:] == '.carbon.slb': - basename = output_filename[:-11] - else: - basename = os.path.strip(output_filename)[0] - projectname = basename + '.mcp' - targetname = basename - xmlname = basename + '.xml' - exportname = basename + '.mcp.exp' - prefixname = 'mwerks_%s_config.h'%basename - # Create the directories we need - distutils.dir_util.mkpath(build_temp, dry_run=self.dry_run) - distutils.dir_util.mkpath(output_dir, dry_run=self.dry_run) - # And on to filling in the parameters for the project builder - settings = {} - settings['mac_exportname'] = exportname - settings['mac_outputdir'] = output_dir - settings['mac_dllname'] = output_filename - settings['mac_targetname'] = targetname - settings['sysprefix'] = sys.prefix - settings['mac_sysprefixtype'] = 'Absolute' - sourcefilenames = [] - sourcefiledirs = [] - for filename in sources + objects: - dirname, filename = os.path.split(filename) - sourcefilenames.append(filename) - if not dirname in sourcefiledirs: - sourcefiledirs.append(dirname) - settings['sources'] = sourcefilenames - settings['libraries'] = libraries - settings['extrasearchdirs'] = sourcefiledirs + include_dirs + library_dirs - if self.dry_run: - print('CALLING LINKER IN', os.getcwd()) - for key, value in settings.items(): - print('%20.20s %s'%(key, value)) - return - # Build the export file - exportfilename = os.path.join(build_temp, exportname) - log.debug("\tCreate export file %s", exportfilename) - fp = open(exportfilename, 'w') - fp.write('%s\n'%export_symbols[0]) - fp.close() - # Generate the prefix file, if needed, and put it in the settings - if self.__macros: - prefixfilename = os.path.join(os.getcwd(), os.path.join(build_temp, prefixname)) - fp = open(prefixfilename, 'w') - fp.write('#include "mwerks_shcarbon_config.h"\n') - for name, value in self.__macros: - if value is None: - fp.write('#define %s\n'%name) - else: - fp.write('#define %s %s\n'%(name, value)) - fp.close() - settings['prefixname'] = prefixname - - # Build the XML file. We need the full pathname (only lateron, really) - # because we pass this pathname to CodeWarrior in an AppleEvent, and CW - # doesn't have a clue about our working directory. - xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname)) - log.debug("\tCreate XML file %s", xmlfilename) - import mkcwproject - xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings) - xmlbuilder.generate() - xmldata = settings['tmp_projectxmldata'] - fp = open(xmlfilename, 'w') - fp.write(xmldata) - fp.close() - # Generate the project. Again a full pathname. - projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname)) - log.debug('\tCreate project file %s', projectfilename) - mkcwproject.makeproject(xmlfilename, projectfilename) - # And build it - log.debug('\tBuild project') - mkcwproject.buildproject(projectfilename) - - def _filename_to_abs(self, filename): - # Some filenames seem to be unix-like. Convert to Mac names. -## if '/' in filename and ':' in filename: -## raise DistutilsPlatformError, 'Filename may be Unix or Mac style: %s'%filename -## if '/' in filename: -## filename = macurl2path(filename) - filename = distutils.util.convert_path(filename) - if not os.path.isabs(filename): - curdir = os.getcwd() - filename = os.path.join(curdir, filename) - # Finally remove .. components - components = filename.split(':') - for i in range(1, len(components)): - if components[i] == '..': - components[i] = '' - return ':'.join(components) - - def library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for libraries. - """ - return # XXXX Not correct... - - def runtime_library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for runtime libraries. - """ - # Nothing needed or Mwerks/Mac. - return - - def library_option (self, lib): - """Return the compiler option to add 'dir' to the list of libraries - linked into the shared library or executable. - """ - return - - def find_library_file (self, dirs, lib, debug=0): - """Search the specified list of directories for a static or shared - library file 'lib' and return the full path to that file. If - 'debug' true, look for a debugging version (if that makes sense on - the current platform). Return None if 'lib' wasn't found in any of - the specified directories. - """ - return 0 Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py Tue Jan 27 21:24:52 2009 @@ -4,10 +4,13 @@ import shutil import zipfile from os.path import join +import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase +from distutils.errors import DistutilsExecError +from distutils.spawn import spawn CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -35,6 +38,19 @@ 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: @@ -46,15 +62,7 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - if not os.path.exists(TEMP_PKG): - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - - # 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) + self._init_tmp_pkg() # creating VCS directories with some files in them os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) @@ -68,8 +76,6 @@ self._write(join(TEMP_PKG, 'somecode', '.git', 'ok'), 'xxx') - os.chdir(TEMP_PKG) - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -103,6 +109,55 @@ # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + def test_make_distribution(self): + + self._init_tmp_pkg() + + # 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 + + # 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' + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.run() + + # making sure we have two files + dist_folder = join(TEMP_PKG, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz'] ) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/branches/py3k-issue1717/Lib/doctest.py ============================================================================== --- python/branches/py3k-issue1717/Lib/doctest.py (original) +++ python/branches/py3k-issue1717/Lib/doctest.py Tue Jan 27 21:24:52 2009 @@ -837,6 +837,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' # provide a default module name # Recursively expore `obj`, extracting DocTests. tests = [] @@ -1947,6 +1949,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) Modified: python/branches/py3k-issue1717/Lib/idlelib/PyShell.py ============================================================================== --- python/branches/py3k-issue1717/Lib/idlelib/PyShell.py (original) +++ python/branches/py3k-issue1717/Lib/idlelib/PyShell.py Tue Jan 27 21:24:52 2009 @@ -963,15 +963,6 @@ COPYRIGHT = \ 'Type "copyright", "credits" or "license()" for more information.' - firewallmessage = """ - **************************************************************** - Personal firewall software may warn about the connection IDLE - makes to its subprocess using this computer's internal loopback - interface. This connection is not visible on any external - interface and no data is sent to or received from the Internet. - **************************************************************** - """ - def begin(self): self.text.mark_set("iomark", "insert") self.resetoutput() @@ -983,9 +974,8 @@ return False else: nosub = "==== No Subprocess ====" - self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % - (sys.version, sys.platform, self.COPYRIGHT, - self.firewallmessage, idlever.IDLE_VERSION, nosub)) + self.write("Python %s on %s\n%s\n%s" % + (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.showprompt() import tkinter tkinter._default_root = None # 03Jan04 KBK What's this? Modified: python/branches/py3k-issue1717/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/NOTES (original) +++ python/branches/py3k-issue1717/Lib/importlib/NOTES Tue Jan 27 21:24:52 2009 @@ -1,19 +1,12 @@ to do ///// -* Expose resolve_name(). +* Use test.loader_tests -* Backport to Python 2.7. - - + import_module - + resolve_name - -* Create reasonable base tests that all finders and loaders must pass so - that various implementations can just subclass as needed. - -* Expose built-in and frozen importers. - - + Make staticmethods so that class can be used directly. + + builtin + + frozen + + extension + + source * Reorganize support code. @@ -31,13 +24,6 @@ + write_bytecode -> complete set of bytes for bytecode instead of individual arguments. -* Implement PEP 302 protocol for loaders (should just be a matter of testing). - - + Built-in. - + Frozen. - + Extension. - + Source/bytecode. - * Create meta_path importer for sys.path. * OPTIMIZE! @@ -48,6 +34,13 @@ - 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. + + Frozen. + + Extension. + + Source/bytecode. + * Public API to expose (w/ docs!) + abc @@ -80,6 +73,7 @@ - get_module decorator (new name) - check_name decorator (new name) + - resolve_name + machinery 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 Tue Jan 27 21:24:52 2009 @@ -1,29 +1,48 @@ from importlib import machinery +from .. import finder_tests from .. import support import sys import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test find_module() for built-in modules.""" assert 'errno' in sys.builtin_module_names name = 'errno' - find_module = staticmethod(lambda name, path=None: - machinery.BuiltinImporter.find_module(name, path)) - - - def test_find_module(self): + def test_module(self): # Common case. with support.uncache(self.name): - self.assert_(self.find_module(self.name)) + self.assert_(machinery.BuiltinImporter.find_module(self.name)) + + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_module_in_package(self): + # Built-in modules cannobt be in a package. + pass + + def test_package_in_package(self): + # Built-in modules cannot be a package. + pass + + def test_package_over_module(self): + # Built-in modules cannot be a package. + pass + + def test_failure(self): + assert 'importlib' not in sys.builtin_module_names + loader = machinery.BuiltinImporter.find_module('importlib') + self.assert_(loader is None) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with support.uncache(self.name): - self.assert_(self.find_module(self.name, ['pkg']) is None) + loader = machinery.BuiltinImporter.find_module(self.name, ['pkg']) + self.assert_(loader is None) Modified: python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py Tue Jan 27 21:24:52 2009 @@ -1,9 +1,10 @@ import importlib +from .. import finder_tests from . import test_path_hook import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test the finder for extension modules.""" @@ -11,9 +12,25 @@ importer = importlib.ExtensionFileImporter(test_path_hook.PATH) return importer.find_module(fullname) - def test_success(self): + def test_module(self): self.assert_(self.find_module(test_path_hook.NAME)) + def test_package(self): + # Extension modules cannot be an __init__ for a package. + pass + + def test_module_in_package(self): + # No extension module in a package available for testing. + pass + + def test_package_in_package(self): + # Extension modules cannot be an __init__ for a package. + pass + + def test_package_over_module(self): + # Extension modules cannot be an __init__ for a package. + pass + def test_failure(self): self.assert_(self.find_module('asdfjkl;') is None) Modified: python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py Tue Jan 27 21:24:52 2009 @@ -1,39 +1,39 @@ -# top-level. -# Package. -# module in pacakge. -# Package within a package. -# At least one tests with 'path'. -# Module that is not handled. - +import abc import unittest -class FinderTests(unittest.TestCase): +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. - raise NotImplementedError + pass + @abc.abstractmethod def test_package(self): # Test importing a package. - raise NotImplementedError + 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. - raise NotImplementedError + 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. - raise NotImplementedError + pass + @abc.abstractmethod def test_package_over_module(self): # Test that packages are chosen over modules. - raise NotImplementedError + pass + @abc.abstractmethod def test_failure(self): # Test trying to find a module that cannot be handled. - raise NotImplementedError + pass Modified: python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py Tue Jan 27 21:24:52 2009 @@ -1,11 +1,10 @@ -from importlib import machinery -from ..builtin import test_finder -from .. import support +from ... import machinery +from .. import finder_tests import unittest -class FinderTests(test_finder.FinderTests): +class FinderTests(finder_tests.FinderTests): """Test finding frozen modules.""" @@ -13,7 +12,6 @@ finder = machinery.FrozenImporter return finder.find_module(name, path) - def test_module(self): name = '__hello__' loader = self.find(name) @@ -28,6 +26,11 @@ self.assert_(hasattr(loader, 'load_module')) def test_package_in_package(self): + # No frozen package within another package to test with. + pass + + def test_package_over_module(self): + # No easy way to test. pass def test_failure(self): Modified: python/branches/py3k-issue1717/Lib/locale.py ============================================================================== --- python/branches/py3k-issue1717/Lib/locale.py (original) +++ python/branches/py3k-issue1717/Lib/locale.py Tue Jan 27 21:24:52 2009 @@ -187,7 +187,7 @@ formatted = _group(formatted, monetary=monetary)[0] return formatted -import re, operator +import re, collections _percent_re = re.compile(r'%(?:\((?P.*?)\))?' r'(?P[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]') @@ -207,7 +207,7 @@ del new_val[i+1:i+1+starcount] i += (1 + starcount) val = tuple(new_val) - elif operator.isMappingType(val): + elif isinstance(val, collections.Mapping): for perc in percents: key = perc.group("key") val[key] = format(perc.group(), val[key], grouping) Modified: python/branches/py3k-issue1717/Lib/test/test_array.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_array.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_array.py Tue Jan 27 21:24:52 2009 @@ -725,8 +725,8 @@ self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) self.assertRaises(BufferError, operator.delitem, a, 0) self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) - self.assertRaises(BufferError, operator.irepeat, a, 2) - self.assertRaises(BufferError, operator.irepeat, a, 0) + self.assertRaises(BufferError, operator.imul, a, 2) + self.assertRaises(BufferError, operator.imul, a, 0) def test_weakref(self): s = array.array(self.typecode, self.example) Modified: python/branches/py3k-issue1717/Lib/test/test_bool.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_bool.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_bool.py Tue Jan 27 21:24:52 2009 @@ -245,16 +245,10 @@ import operator self.assertIs(operator.truth(0), False) self.assertIs(operator.truth(1), True) - self.assertIs(operator.isNumberType(None), False) - self.assertIs(operator.isNumberType(0), True) self.assertIs(operator.not_(1), False) self.assertIs(operator.not_(0), True) - self.assertIs(operator.isSequenceType(0), False) - self.assertIs(operator.isSequenceType([]), True) self.assertIs(operator.contains([], 1), False) self.assertIs(operator.contains([1], 1), True) - self.assertIs(operator.isMappingType(1), False) - self.assertIs(operator.isMappingType({}), True) self.assertIs(operator.lt(0, 0), False) self.assertIs(operator.lt(0, 1), True) self.assertIs(operator.is_(True, True), True) Modified: python/branches/py3k-issue1717/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_cmd_line.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_cmd_line.py Tue Jan 27 21:24:52 2009 @@ -159,6 +159,16 @@ self.assertEqual(data.strip(), b'x', "text %s not line-buffered" % stream) + def test_unbuffered_input(self): + # sys.stdin still works with '-u' + code = ("import sys; sys.stdout.write(sys.stdin.read(1))") + p = _spawn_python('-u', '-c', code) + p.stdin.write(b'x') + p.stdin.flush() + data, rc = _kill_python_and_exit_code(p) + self.assertEqual(rc, 0) + self.assert_(data.startswith(b'x'), data) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/py3k-issue1717/Lib/test/test_contains.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_contains.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_contains.py Tue Jan 27 21:24:52 2009 @@ -56,31 +56,16 @@ This class is designed to make sure that the contains code works when the list is modified during the check. """ - aList = range(15) - def __lt__(self, other): + aList = list(range(15)) + def __eq__(self, other): if other == 12: self.aList.remove(12) self.aList.remove(13) self.aList.remove(14) - return 1 + return 0 self.assert_(Deviant1() not in Deviant1.aList) - class Deviant2: - """Behaves strangely when compared - - This class raises an exception during comparison. That in - turn causes the comparison to fail with a TypeError. - """ - def __lt__(self, other): - if other == 4: - raise RuntimeError("gotcha") - - try: - self.assert_(Deviant2() not in a) - except TypeError: - pass - def test_nonreflexive(self): # containment and equality tests involving elements that are # not necessarily equal to themselves Modified: python/branches/py3k-issue1717/Lib/test/test_copy.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_copy.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_copy.py Tue Jan 27 21:24:52 2009 @@ -2,10 +2,13 @@ import copy import copyreg - +from operator import le, lt, ge, gt, eq, ne import unittest from test import support -from test.support import fcmp + +order_comparisons = le, lt, ge, gt +equality_comparisons = eq, ne +comparisons = order_comparisons + equality_comparisons class TestCopy(unittest.TestCase): @@ -272,7 +275,8 @@ x = [] x.append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, fcmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is y) self.assertEqual(len(y), 1) @@ -288,7 +292,8 @@ x = ([],) x[0].append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, fcmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) self.assert_(y[0][0] is y) @@ -304,7 +309,10 @@ x = {} x['foo'] = x y = copy.deepcopy(x) - self.assertRaises(TypeError, fcmp, y, x) + for op in order_comparisons: + self.assertRaises(TypeError, op, y, x) + for op in equality_comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) self.assertEqual(len(y), 1) Modified: python/branches/py3k-issue1717/Lib/test/test_datetime.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_datetime.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_datetime.py Tue Jan 27 21:24:52 2009 @@ -7,8 +7,9 @@ import pickle import unittest +from operator import lt, le, gt, ge, eq, ne + from test import support -from test.support import fcmp from datetime import MINYEAR, MAXYEAR from datetime import timedelta @@ -2098,9 +2099,10 @@ d2 = base.replace(minute=11) for x in d0, d1, d2: for y in d0, d1, d2: - got = fcmp(x, y) - expected = fcmp(x.minute, y.minute) - self.assertEqual(got, expected) + for op in lt, le, gt, ge, eq, ne: + got = op(x, y) + expected = op(x.minute, y.minute) + self.assertEqual(got, expected) # However, if they're different members, uctoffset is not ignored. # Note that a time can't actually have an operand-depedent offset, @@ -2112,7 +2114,7 @@ d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: - got = fcmp(x, y) + got = (x > y) - (x < y) if (x is d0 or x is d1) and (y is d0 or y is d1): expected = 0 elif x is y is d2: Modified: python/branches/py3k-issue1717/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_itertools.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_itertools.py Tue Jan 27 21:24:52 2009 @@ -110,6 +110,14 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + def combinations3(iterable, r): + 'Pure python version from cwr()' + pool = tuple(iterable) + n = len(pool) + for indices in combinations_with_replacement(range(n), r): + if len(set(indices)) == r: + yield tuple(pool[i] for i in indices) + for n in range(7): values = [5*x-12 for x in range(n)] for r in range(n+2): @@ -126,11 +134,82 @@ [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version + self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(combinations('abcde', 3))))), 1) + def test_combinations_with_replacement(self): + cwr = combinations_with_replacement + self.assertRaises(TypeError, cwr, 'abc') # missing r argument + self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments + self.assertRaises(TypeError, cwr, None) # pool is not iterable + self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative + self.assertEqual(list(cwr('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + + def cwr1(iterable, r): + 'Pure python version shown in the docs' + # number items returned: (n+r-1)! / r! / (n-1)! when n>0 + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def cwr2(iterable, r): + 'Pure python version shown in the docs' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + def numcombs(n, r): + if not n: + return 0 if r else 1 + return fact(n+r-1) / fact(r)/ fact(n-1) + + for n in range(7): + values = [5*x-12 for x in range(n)] + for r in range(n+2): + result = list(cwr(values, r)) + + self.assertEqual(len(result), numcombs(n, r)) # right number of combs + self.assertEqual(len(result), len(set(result))) # no repeats + self.assertEqual(result, sorted(result)) # lexicographic order + + regular_combs = list(combinations(values, r)) # compare to combs without replacement + if n == 0 or r <= 1: + self.assertEquals(result, regular_combs) # cases that should be identical + else: + self.assert_(set(result) >= set(regular_combs)) # rest should be supersets of regular combs + + for c in result: + self.assertEqual(len(c), r) # r-length combinations + noruns = [k for k,v in groupby(c)] # combo without consecutive repeats + self.assertEqual(len(noruns), len(set(noruns))) # no repeats other than consecutive + self.assertEqual(list(c), sorted(c)) # keep original ordering + self.assert_(all(e in values for e in c)) # elements taken from input iterable + self.assertEqual(noruns, + [e for e in values if e in c]) # comb is a subsequence of the input iterable + self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version + self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version + + # Test implementation detail: tuple re-use + self.assertEqual(len(set(map(id, cwr('abcde', 3)))), 1) + self.assertNotEqual(len(set(map(id, list(cwr('abcde', 3))))), 1) + def test_permutations(self): self.assertRaises(TypeError, permutations) # too few arguments self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments @@ -195,6 +274,54 @@ self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1) + def test_combinatorics(self): + # Test relationships between product(), permutations(), + # combinations() and combinations_with_replacement(). + + for n in range(6): + s = 'ABCDEFG'[:n] + for r in range(8): + prod = list(product(s, repeat=r)) + cwr = list(combinations_with_replacement(s, r)) + perm = list(permutations(s, r)) + comb = list(combinations(s, r)) + + # Check size + self.assertEquals(len(prod), n**r) + self.assertEquals(len(cwr), (fact(n+r-1) / fact(r)/ fact(n-1)) if n else (not r)) + self.assertEquals(len(perm), 0 if r>n else fact(n) / fact(n-r)) + self.assertEquals(len(comb), 0 if r>n else fact(n) / fact(r) / fact(n-r)) + + # Check lexicographic order without repeated tuples + self.assertEquals(prod, sorted(set(prod))) + self.assertEquals(cwr, sorted(set(cwr))) + self.assertEquals(perm, sorted(set(perm))) + self.assertEquals(comb, sorted(set(comb))) + + # Check interrelationships + self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted + self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups + self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted + self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups + self.assertEqual(comb, list(filter(set(cwr).__contains__, perm))) # comb: perm that is a cwr + self.assertEqual(comb, list(filter(set(perm).__contains__, cwr))) # comb: cwr that is a perm + self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm + + def test_compress(self): + 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')) + self.assertEqual(list(compress('ABCDEF', [1,0,1])), list('AC')) + self.assertEqual(list(compress('ABC', [0,1,1,1,1,1])), list('BC')) + n = 10000 + data = chain.from_iterable(repeat(range(6), n)) + selectors = chain.from_iterable(repeat((0, 1))) + self.assertEqual(list(compress(data, selectors)), [1,3,5] * n) + self.assertRaises(TypeError, compress, None, range(6)) # 1st arg not iterable + self.assertRaises(TypeError, compress, range(6), None) # 2nd arg not iterable + self.assertRaises(TypeError, compress, range(6)) # too few args + self.assertRaises(TypeError, compress, range(6), None) # too many args + def test_count(self): self.assertEqual(lzip('abc',count()), [('a', 0), ('b', 1), ('c', 2)]) self.assertEqual(lzip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)]) @@ -715,6 +842,13 @@ self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) + def test_combinations_with_replacement(self): + self.assertEqual(list(combinations_with_replacement('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + + def test_compress(self): + self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) + def test_count(self): self.assertEqual(list(islice(count(10), 5)), [10, 11, 12, 13, 14]) @@ -795,6 +929,14 @@ a = [] self.makecycle(combinations([1,2,a,3], 3), a) + def test_combinations_with_replacement(self): + a = [] + self.makecycle(combinations_with_replacement([1,2,a,3], 3), a) + + def test_compress(self): + a = [] + self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) @@ -948,6 +1090,15 @@ self.assertRaises(TypeError, list, chain(N(s))) self.assertRaises(ZeroDivisionError, list, chain(E(s))) + def test_compress(self): + for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)): + n = len(s) + for g in (G, I, Ig, S, L, R): + self.assertEqual(list(compress(g(s), repeat(1))), list(g(s))) + self.assertRaises(TypeError, compress, X(s), repeat(1)) + self.assertRaises(TypeError, compress, N(s), repeat(1)) + self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1))) + def test_product(self): for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)): self.assertRaises(TypeError, product, X(s)) @@ -1144,7 +1295,7 @@ def test_keywords_in_subclass(self): # count is not subclassable... for cls in (repeat, zip, filter, filterfalse, chain, map, - starmap, islice, takewhile, dropwhile, cycle): + starmap, islice, takewhile, dropwhile, cycle, compress): class Subclass(cls): def __init__(self, newarg=None, *args): cls.__init__(self, *args) @@ -1261,7 +1412,7 @@ >>> def grouper(n, iterable, fillvalue=None): ... "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" ... args = [iter(iterable)] * n -... return zip_longest(fillvalue=fillvalue, *args) +... return zip_longest(*args, fillvalue=fillvalue) >>> def roundrobin(*iterables): ... "roundrobin('ABC', 'D', 'EF') --> A D E B F C" @@ -1277,30 +1428,9 @@ ... nexts = cycle(islice(nexts, pending)) >>> def powerset(iterable): -... "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" -... # Recipe credited to Eric Raymond -... pairs = [(2**i, x) for i, x in enumerate(iterable)] -... for n in range(2**len(pairs)): -... yield set(x for m, x in pairs if m&n) - ->>> def compress(data, selectors): -... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" -... return (d for d, s in zip(data, selectors) if s) - ->>> def combinations_with_replacement(iterable, r): -... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" -... pool = tuple(iterable) -... n = len(pool) -... indices = [0] * r -... yield tuple(pool[i] for i in indices) -... while 1: -... for i in reversed(range(r)): -... if indices[i] != n - 1: -... break -... else: -... return -... indices[i:] = [indices[i] + 1] * (r - i) -... yield tuple(pool[i] for i in indices) +... "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_everseen(iterable, key=None): ... "List unique elements, preserving order. Remember all elements ever seen." @@ -1379,33 +1509,13 @@ >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] ->>> list(map(sorted, powerset('ab'))) -[[], ['a'], ['b'], ['a', 'b']] - ->>> list(compress('abcdef', [1,0,1,0,1,1])) -['a', 'c', 'e', 'f'] - ->>> list(combinations_with_replacement('abc', 2)) -[('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] - ->>> list(combinations_with_replacement('01', 3)) -[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] - ->>> def combinations_with_replacement2(iterable, r): -... 'Alternate version that filters from product()' -... pool = tuple(iterable) -... n = len(pool) -... for indices in product(range(n), repeat=r): -... if sorted(indices) == list(indices): -... yield tuple(pool[i] for i in indices) - ->>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) -True +>>> list(powerset([1,2,3])) +[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] ->>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18)) True ->>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len) True >>> list(unique_everseen('AAAABBBCCDAABBB')) Modified: python/branches/py3k-issue1717/Lib/test/test_operator.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_operator.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_operator.py Tue Jan 27 21:24:52 2009 @@ -164,31 +164,6 @@ self.failUnlessRaises(TypeError, operator.invert, None) self.assertEqual(operator.inv(4), -5) - def test_isMappingType(self): - self.failUnlessRaises(TypeError, operator.isMappingType) - self.failIf(operator.isMappingType(1)) - self.failIf(operator.isMappingType(operator.isMappingType)) - self.failUnless(operator.isMappingType(operator.__dict__)) - self.failUnless(operator.isMappingType({})) - - def test_isNumberType(self): - self.failUnlessRaises(TypeError, operator.isNumberType) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8j)) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8.3)) - self.failIf(operator.isNumberType(dir())) - - def test_isSequenceType(self): - self.failUnlessRaises(TypeError, operator.isSequenceType) - self.failUnless(operator.isSequenceType(dir())) - self.failUnless(operator.isSequenceType(())) - self.failUnless(operator.isSequenceType(range(10))) - self.failUnless(operator.isSequenceType('yeahbuddy')) - self.failIf(operator.isSequenceType(3)) - class Dict(dict): pass - self.failIf(operator.isSequenceType(Dict())) - def test_lshift(self): self.failUnlessRaises(TypeError, operator.lshift) self.failUnlessRaises(TypeError, operator.lshift, None, 42) @@ -235,31 +210,6 @@ self.assertRaises(TypeError, operator.pow, 1) self.assertRaises(TypeError, operator.pow, 1, 2, 3) - def test_repeat(self): - a = list(range(3)) - self.failUnlessRaises(TypeError, operator.repeat) - self.failUnlessRaises(TypeError, operator.repeat, a, None) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == []) - a = (1, 2, 3) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == ()) - a = '123' - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == '') - a = Seq1([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - a = Seq2([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - self.failUnlessRaises(TypeError, operator.repeat, 6, 7) - def test_rshift(self): self.failUnlessRaises(TypeError, operator.rshift) self.failUnlessRaises(TypeError, operator.rshift, None, 42) @@ -443,7 +393,6 @@ self.assertEqual(operator.itruediv (c, 5), "itruediv") self.assertEqual(operator.ixor (c, 5), "ixor") self.assertEqual(operator.iconcat (c, c), "iadd") - self.assertEqual(operator.irepeat (c, 5), "imul") self.assertEqual(operator.__iadd__ (c, 5), "iadd") self.assertEqual(operator.__iand__ (c, 5), "iand") self.assertEqual(operator.__ifloordiv__(c, 5), "ifloordiv") @@ -457,7 +406,6 @@ self.assertEqual(operator.__itruediv__ (c, 5), "itruediv") self.assertEqual(operator.__ixor__ (c, 5), "ixor") self.assertEqual(operator.__iconcat__ (c, c), "iadd") - self.assertEqual(operator.__irepeat__ (c, 5), "imul") def test_main(verbose=None): import sys Modified: python/branches/py3k-issue1717/Lib/test/test_sundry.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_sundry.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_sundry.py Tue Jan 27 21:24:52 2009 @@ -21,7 +21,6 @@ import distutils.filelist if sys.platform.startswith('win'): import distutils.msvccompiler - import distutils.mwerkscompiler import distutils.text_file import distutils.unixccompiler Modified: python/branches/py3k-issue1717/Lib/test/test_uuid.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_uuid.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_uuid.py Tue Jan 27 21:24:52 2009 @@ -1,6 +1,5 @@ from unittest import TestCase from test import support -from test.support import fcmp import uuid def importable(name): @@ -182,7 +181,12 @@ # Test comparison of UUIDs. for i in range(len(ascending)): for j in range(len(ascending)): - equal(fcmp(i, j), fcmp(ascending[i], ascending[j])) + equal(i < j, ascending[i] < ascending[j]) + equal(i <= j, ascending[i] <= ascending[j]) + equal(i == j, ascending[i] == ascending[j]) + equal(i > j, ascending[i] > ascending[j]) + equal(i >= j, ascending[i] >= ascending[j]) + equal(i != j, ascending[i] != ascending[j]) # Test sorting of UUIDs (above list is in ascending order). resorted = ascending[:] Modified: python/branches/py3k-issue1717/Lib/unittest.py ============================================================================== --- python/branches/py3k-issue1717/Lib/unittest.py (original) +++ python/branches/py3k-issue1717/Lib/unittest.py Tue Jan 27 21:24:52 2009 @@ -539,7 +539,8 @@ return mycmp(self.obj, other.obj) == -1 return K -def cmp(x, y): +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" return (x > y) - (x < y) class TestLoader(object): @@ -547,7 +548,7 @@ criteria and returning them wrapped in a TestSuite """ testMethodPrefix = 'test' - sortTestMethodsUsing = staticmethod(cmp) + sortTestMethodsUsing = staticmethod(three_way_cmp) suiteClass = TestSuite def loadTestsFromTestCase(self, testCaseClass): @@ -655,14 +656,18 @@ if suiteClass: loader.suiteClass = suiteClass return loader -def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp): +def getTestCaseNames(testCaseClass, prefix, sortUsing=three_way_cmp): return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass) -def makeSuite(testCaseClass, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass) - -def findTestCases(module, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) +def makeSuite(testCaseClass, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase( + testCaseClass) + +def findTestCases(module, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule( + module) ############################################################################## Modified: python/branches/py3k-issue1717/Lib/xml/dom/minidom.py ============================================================================== --- python/branches/py3k-issue1717/Lib/xml/dom/minidom.py (original) +++ python/branches/py3k-issue1717/Lib/xml/dom/minidom.py Tue Jan 27 21:24:52 2009 @@ -520,12 +520,30 @@ __len__ = _get_length - def __cmp__(self, other): + def _cmp(self, other): if self._attrs is getattr(other, "_attrs", None): return 0 else: return (id(self) > id(other)) - (id(self) < id(other)) + def __eq__(self, other): + return self._cmp(other) == 0 + + def __ge__(self, other): + return self._cmp(other) >= 0 + + def __gt__(self, other): + return self._cmp(other) > 0 + + def __le__(self, other): + return self._cmp(other) <= 0 + + def __lt__(self, other): + return self._cmp(other) < 0 + + def __ne__(self, other): + return self._cmp(other) != 0 + def __getitem__(self, attname_or_tuple): if isinstance(attname_or_tuple, tuple): return self._attrsNS[attname_or_tuple] Modified: python/branches/py3k-issue1717/Lib/xml/etree/ElementTree.py ============================================================================== --- python/branches/py3k-issue1717/Lib/xml/etree/ElementTree.py (original) +++ python/branches/py3k-issue1717/Lib/xml/etree/ElementTree.py Tue Jan 27 21:24:52 2009 @@ -498,10 +498,30 @@ return self.text def __hash__(self): return hash(self.text) - def __cmp__(self, other): + def __le__(self, other): if isinstance(other, QName): - return (self.text > other.text) - (self.text < other.text) - return (self.text > other) - (self.text < other) + return self.text <= other.text + return self.text <= other + def __lt__(self, other): + if isinstance(other, QName): + return self.text < other.text + return self.text < other + def __ge__(self, other): + if isinstance(other, QName): + return self.text >= other.text + return self.text >= other + def __gt__(self, other): + if isinstance(other, QName): + return self.text > other.text + return self.text > other + def __eq__(self, other): + if isinstance(other, QName): + return self.text == other.text + return self.text == other + def __ne__(self, other): + if isinstance(other, QName): + return self.text != other.text + return self.text != other ## # ElementTree wrapper class. This class represents an entire element Modified: python/branches/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Tue Jan 27 21:24:52 2009 @@ -144,6 +144,24 @@ Library ------- +- Removed isSequenceType(), isMappingType, and isNumberType() from the + operator module; use the abstract base classes instead. Also removed + the repeat() function; use mul() instead. + +- Issue 5021: doctest.testfile() did not create __name__ and + collections.namedtuple() relied on __name__ being defined. + +- Backport importlib from Python 3.1. Only the import_module() function has + been backported to help facilitate transitions from 2.7 to 3.1. + +- Issue #1885: distutils. When running sdist with --formats=tar,gztar + the tar file was overriden by the gztar one. + +- Issue #4863: distutils.mwerkscompiler has been removed. + +- Added a new itertools functions: combinations_with_replacement() + and compress(). + - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage examples. Modified: python/branches/py3k-issue1717/Modules/_ssl.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_ssl.c (original) +++ python/branches/py3k-issue1717/Modules/_ssl.c Tue Jan 27 21:24:52 2009 @@ -1592,7 +1592,7 @@ for (i = 0; i < _ssl_locks_count; i++) { _ssl_locks[i] = PyThread_allocate_lock(); if (_ssl_locks[i] == NULL) { - int j; + unsigned int j; for (j = 0; j < i; j++) { PyThread_free_lock(_ssl_locks[j]); } Modified: python/branches/py3k-issue1717/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/itertoolsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/itertoolsmodule.c Tue Jan 27 21:24:52 2009 @@ -1683,7 +1683,8 @@ PyObject_GC_UnTrack(lz); Py_XDECREF(lz->pools); Py_XDECREF(lz->result); - PyMem_Free(lz->indices); + if (lz->indices != NULL) + PyMem_Free(lz->indices); Py_TYPE(lz)->tp_free(lz); } @@ -1911,7 +1912,8 @@ PyObject_GC_UnTrack(co); Py_XDECREF(co->pool); Py_XDECREF(co->result); - PyMem_Free(co->indices); + if (co->indices != NULL) + PyMem_Free(co->indices); Py_TYPE(co)->tp_free(co); } @@ -2060,6 +2062,252 @@ }; +/* combinations with replacement object *******************************************/ + +/* Equivalent to: + + def combinations_with_replacement(iterable, r): + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! + pool = tuple(iterable) + n = len(pool) + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def combinations_with_replacement2(iterable, r): + 'Alternate version that filters from product()' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) +*/ +typedef struct { + PyObject_HEAD + PyObject *pool; /* input converted to a tuple */ + Py_ssize_t *indices; /* one index per result element */ + PyObject *result; /* most recently returned result tuple */ + Py_ssize_t r; /* size of result tuple */ + int stopped; /* set to 1 when the cwr iterator is exhausted */ +} cwrobject; + +static PyTypeObject cwr_type; + +static PyObject * +cwr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + cwrobject *co; + Py_ssize_t n; + Py_ssize_t r; + PyObject *pool = NULL; + PyObject *iterable = NULL; + Py_ssize_t *indices = NULL; + Py_ssize_t i; + static char *kwargs[] = {"iterable", "r", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:combinations_with_replacement", kwargs, + &iterable, &r)) + return NULL; + + pool = PySequence_Tuple(iterable); + if (pool == NULL) + goto error; + n = PyTuple_GET_SIZE(pool); + if (r < 0) { + PyErr_SetString(PyExc_ValueError, "r must be non-negative"); + goto error; + } + + indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); + if (indices == NULL) { + PyErr_NoMemory(); + goto error; + } + + for (i=0 ; itp_alloc(type, 0); + if (co == NULL) + goto error; + + co->pool = pool; + co->indices = indices; + co->result = NULL; + co->r = r; + co->stopped = !n && r; + + return (PyObject *)co; + +error: + if (indices != NULL) + PyMem_Free(indices); + Py_XDECREF(pool); + return NULL; +} + +static void +cwr_dealloc(cwrobject *co) +{ + PyObject_GC_UnTrack(co); + Py_XDECREF(co->pool); + Py_XDECREF(co->result); + if (co->indices != NULL) + PyMem_Free(co->indices); + Py_TYPE(co)->tp_free(co); +} + +static int +cwr_traverse(cwrobject *co, visitproc visit, void *arg) +{ + Py_VISIT(co->pool); + Py_VISIT(co->result); + return 0; +} + +static PyObject * +cwr_next(cwrobject *co) +{ + PyObject *elem; + PyObject *oldelem; + PyObject *pool = co->pool; + Py_ssize_t *indices = co->indices; + PyObject *result = co->result; + Py_ssize_t n = PyTuple_GET_SIZE(pool); + Py_ssize_t r = co->r; + Py_ssize_t i, j, index; + + if (co->stopped) + return NULL; + + if (result == NULL) { + /* On the first pass, initialize result tuple using the indices */ + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i 1) { + PyObject *old_result = result; + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i= 0 && indices[i] == n-1; i--) + ; + + /* If i is negative, then the indices are all at + their maximum value and we're done. */ + if (i < 0) + goto empty; + + /* Increment the current index which we know is not at its + maximum. Then set all to the right to the same value. */ + indices[i]++; + for (j=i+1 ; jstopped = 1; + return NULL; +} + +PyDoc_STRVAR(cwr_doc, +"combinations_with_replacement(iterable[, r]) --> combinations_with_replacement object\n\ +\n\ +Return successive r-length combinations of elements in the iterable\n\ +allowing individual elements to have successive repeats.\n\ +combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"); + +static PyTypeObject cwr_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.combinations_with_replacement", /* tp_name */ + sizeof(cwrobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)cwr_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + cwr_doc, /* tp_doc */ + (traverseproc)cwr_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)cwr_next, /* tp_iternext */ + 0, /* 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 */ + cwr_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* permutations object ************************************************************ def permutations(iterable, r=None): @@ -2331,6 +2579,162 @@ }; +/* compress object ************************************************************/ + +/* Equivalent to: + + def compress(data, selectors): + "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" + return (d for d, s in zip(data, selectors) if s) +*/ + +typedef struct { + PyObject_HEAD + PyObject *data; + PyObject *selectors; +} compressobject; + +static PyTypeObject compress_type; + +static PyObject * +compress_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + 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)) + return NULL; + + data = PyObject_GetIter(seq1); + if (data == NULL) + goto fail; + selectors = PyObject_GetIter(seq2); + if (selectors == NULL) + goto fail; + + /* create compressobject structure */ + lz = (compressobject *)type->tp_alloc(type, 0); + if (lz == NULL) + goto fail; + lz->data = data; + lz->selectors = selectors; + return (PyObject *)lz; + +fail: + Py_XDECREF(data); + Py_XDECREF(selectors); + return NULL; +} + +static void +compress_dealloc(compressobject *lz) +{ + PyObject_GC_UnTrack(lz); + Py_XDECREF(lz->data); + Py_XDECREF(lz->selectors); + Py_TYPE(lz)->tp_free(lz); +} + +static int +compress_traverse(compressobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->data); + Py_VISIT(lz->selectors); + return 0; +} + +static PyObject * +compress_next(compressobject *lz) +{ + PyObject *data = lz->data, *selectors = lz->selectors; + PyObject *datum, *selector; + PyObject *(*datanext)(PyObject *) = *Py_TYPE(data)->tp_iternext; + PyObject *(*selectornext)(PyObject *) = *Py_TYPE(selectors)->tp_iternext; + int ok; + + while (1) { + /* Steps: get datum, get selector, evaluate selector. + Order is important (to match the pure python version + in terms of which input gets a chance to raise an + exception first). + */ + + datum = datanext(data); + if (datum == NULL) + return NULL; + + selector = selectornext(selectors); + if (selector == NULL) { + Py_DECREF(datum); + return NULL; + } + + ok = PyObject_IsTrue(selector); + Py_DECREF(selector); + if (ok == 1) + return datum; + Py_DECREF(datum); + if (ok == -1) + return NULL; + } +} + +PyDoc_STRVAR(compress_doc, +"compress(data sequence, selector sequence) --> 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\ +selectors to choose the data elements."); + +static PyTypeObject compress_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.compress", /* tp_name */ + sizeof(compressobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)compress_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + compress_doc, /* tp_doc */ + (traverseproc)compress_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)compress_next, /* tp_iternext */ + 0, /* 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 */ + compress_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* filterfalse object ************************************************************/ typedef struct { @@ -3035,12 +3439,14 @@ char *name; PyTypeObject *typelist[] = { &combinations_type, + &cwr_type, &cycle_type, &dropwhile_type, &takewhile_type, &islice_type, &starmap_type, &chain_type, + &compress_type, &filterfalse_type, &count_type, &ziplongest_type, Modified: python/branches/py3k-issue1717/Modules/operator.c ============================================================================== --- python/branches/py3k-issue1717/Modules/operator.c (original) +++ python/branches/py3k-issue1717/Modules/operator.c Tue Jan 27 21:24:52 2009 @@ -65,7 +65,6 @@ if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \ return PyObject_RichCompare(a1,a2,A); } -spami(isNumberType , PyNumber_Check) spami(truth , PyObject_IsTrue) spam2(op_add , PyNumber_Add) spam2(op_sub , PyNumber_Subtract) @@ -95,15 +94,11 @@ spam2(op_iand , PyNumber_InPlaceAnd) spam2(op_ixor , PyNumber_InPlaceXor) spam2(op_ior , PyNumber_InPlaceOr) -spami(isSequenceType , PySequence_Check) spam2(op_concat , PySequence_Concat) -spamoi(op_repeat , PySequence_Repeat) spam2(op_iconcat , PySequence_InPlaceConcat) -spamoi(op_irepeat , PySequence_InPlaceRepeat) spami2b(op_contains , PySequence_Contains) spamn2(indexOf , PySequence_Index) spamn2(countOf , PySequence_Count) -spami(isMappingType , PyMapping_Check) spam2(op_getitem , PyObject_GetItem) spam2n(op_delitem , PyObject_DelItem) spam3n(op_setitem , PyObject_SetItem) @@ -173,10 +168,6 @@ static struct PyMethodDef operator_methods[] = { -spam1o(isNumberType, - "isNumberType(a) -- Return True if a has a numeric type, False otherwise.") -spam1o(isSequenceType, - "isSequenceType(a) -- Return True if a has a sequence type, False otherwise.") spam1o(truth, "truth(a) -- Return True if a is true, False otherwise.") spam2(contains,__contains__, @@ -185,8 +176,6 @@ "indexOf(a, b) -- Return the first index of b in a.") spam1(countOf, "countOf(a, b) -- Return the number of times b occurs in a.") -spam1o(isMappingType, - "isMappingType(a) -- Return True if a has a mapping type, False otherwise.") spam1(is_, "is_(a, b) -- Same as a is b.") spam1(is_not, "is_not(a, b) -- Same as a is not b.") @@ -221,12 +210,8 @@ spam2(ior,__ior__, "ior(a, b) -- Same as a |= b.") spam2(concat,__concat__, "concat(a, b) -- Same as a + b, for a and b sequences.") -spam2(repeat,__repeat__, - "repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.") spam2(iconcat,__iconcat__, "iconcat(a, b) -- Same as a += b, for a and b sequences.") -spam2(irepeat,__irepeat__, - "irepeat(a, b) -- Same as a *= b, where a is a sequence, and b is an integer.") spam2(getitem,__getitem__, "getitem(a, b) -- Same as a[b].") spam2(setitem,__setitem__, Modified: python/branches/py3k-issue1717/Objects/longobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/longobject.c (original) +++ python/branches/py3k-issue1717/Objects/longobject.c Tue Jan 27 21:24:52 2009 @@ -776,7 +776,7 @@ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */ - twodigits carry; /* for computing 2's-comp */ + digit carry; /* for computing 2's-comp */ size_t j; /* # bytes filled */ unsigned char* p; /* pointer to next byte in bytes */ int pincr; /* direction to move p */ @@ -2274,7 +2274,7 @@ static long long_hash(PyLongObject *v) { - long x; + unsigned long x; Py_ssize_t i; int sign; @@ -2294,17 +2294,18 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C long x such that (unsigned long)x - is congruent to the absolute value of v modulo ULONG_MAX. The + /* 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 << PyLong_SHIFT) & ~PyLong_MASK) | + ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); x += v->ob_digit[i]; - /* If the addition above overflowed (thinking of x as - unsigned), we compensate by incrementing. This preserves - the value modulo ULONG_MAX. */ - if ((unsigned long)x < v->ob_digit[i]) + /* If the addition above overflowed we compensate by + incrementing. This preserves the value modulo + ULONG_MAX. */ + if (x < v->ob_digit[i]) x++; } #undef LONG_BIT_PyLong_SHIFT Modified: python/branches/py3k-issue1717/Python/pythonrun.c ============================================================================== --- python/branches/py3k-issue1717/Python/pythonrun.c (original) +++ python/branches/py3k-issue1717/Python/pythonrun.c Tue Jan 27 21:24:52 2009 @@ -739,7 +739,12 @@ PyObject *line_buffering; int buffering, isatty; - if (Py_UnbufferedStdioFlag) + /* stdin is always opened in buffered mode, first because it shouldn't + make a difference in common use cases, second because TextIOWrapper + depends on the presence of a read1() method which only exists on + buffered streams. + */ + if (Py_UnbufferedStdioFlag && write_mode) buffering = 0; else buffering = -1; @@ -753,7 +758,7 @@ if (buf == NULL) goto error; - if (!Py_UnbufferedStdioFlag) { + if (buffering) { raw = PyObject_GetAttrString(buf, "raw"); if (raw == NULL) goto error; From python-checkins at python.org Tue Jan 27 21:27:06 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 27 Jan 2009 21:27:06 +0100 (CET) Subject: [Python-checkins] r69032 - python/branches/py3k/Lib/unittest.py Message-ID: <20090127202706.0CF2E1E400C@bag.python.org> Author: mark.dickinson Date: Tue Jan 27 21:27:05 2009 New Revision: 69032 Log: Fix an occurrence of cmp that was missed in r69025 Modified: python/branches/py3k/Lib/unittest.py Modified: python/branches/py3k/Lib/unittest.py ============================================================================== --- python/branches/py3k/Lib/unittest.py (original) +++ python/branches/py3k/Lib/unittest.py Tue Jan 27 21:27:05 2009 @@ -656,14 +656,18 @@ if suiteClass: loader.suiteClass = suiteClass return loader -def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp): +def getTestCaseNames(testCaseClass, prefix, sortUsing=three_way_cmp): return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass) -def makeSuite(testCaseClass, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass) - -def findTestCases(module, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) +def makeSuite(testCaseClass, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase( + testCaseClass) + +def findTestCases(module, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule( + module) ############################################################################## From python-checkins at python.org Tue Jan 27 21:28:36 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 27 Jan 2009 21:28:36 +0100 (CET) Subject: [Python-checkins] r69033 - in python/branches/release30-maint: Lib/unittest.py Message-ID: <20090127202836.E5E0A1E400C@bag.python.org> Author: mark.dickinson Date: Tue Jan 27 21:28:36 2009 New Revision: 69033 Log: Merged revisions 69032 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69032 | mark.dickinson | 2009-01-27 20:27:05 +0000 (Tue, 27 Jan 2009) | 2 lines Fix an occurrence of cmp that was missed in r69025 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/unittest.py Modified: python/branches/release30-maint/Lib/unittest.py ============================================================================== --- python/branches/release30-maint/Lib/unittest.py (original) +++ python/branches/release30-maint/Lib/unittest.py Tue Jan 27 21:28:36 2009 @@ -630,14 +630,18 @@ if suiteClass: loader.suiteClass = suiteClass return loader -def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp): +def getTestCaseNames(testCaseClass, prefix, sortUsing=three_way_cmp): return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass) -def makeSuite(testCaseClass, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass) - -def findTestCases(module, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) +def makeSuite(testCaseClass, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase( + testCaseClass) + +def findTestCases(module, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule( + module) ############################################################################## From python-checkins at python.org Tue Jan 27 21:29:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 27 Jan 2009 21:29:59 +0100 (CET) Subject: [Python-checkins] r69034 - python/branches/py3k-issue1717 Message-ID: <20090127202959.F19DC1E4002@bag.python.org> Author: mark.dickinson Date: Tue Jan 27 21:29:59 2009 New Revision: 69034 Log: Merged revisions 69032 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69032 | mark.dickinson | 2009-01-27 20:27:05 +0000 (Tue, 27 Jan 2009) | 2 lines Fix an occurrence of cmp that was missed in r69025 ........ Modified: python/branches/py3k-issue1717/ (props changed) From buildbot at python.org Tue Jan 27 21:52:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 20:52:17 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090127205217.C9FD41E400C@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/126 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 Tue Jan 27 22:11:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 21:11:39 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090127211139.50B171E4002@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/226 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 python-checkins at python.org Tue Jan 27 22:37:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 27 Jan 2009 22:37:33 +0100 (CET) Subject: [Python-checkins] r69035 - python/branches/py3k Message-ID: <20090127213733.548871E4002@bag.python.org> Author: benjamin.peterson Date: Tue Jan 27 22:37:33 2009 New Revision: 69035 Log: Blocked revisions 69001,69010,69012,69014,69018,69023 via svnmerge ........ r69001 | raymond.hettinger | 2009-01-26 20:58:49 -0600 (Mon, 26 Jan 2009) | 1 line Promote combinations_with_replacement() from a recipe to a regular itertool. ........ r69010 | raymond.hettinger | 2009-01-27 03:33:06 -0600 (Tue, 27 Jan 2009) | 1 line Add tests to verify combinatoric relationships. ........ r69012 | raymond.hettinger | 2009-01-27 03:52:35 -0600 (Tue, 27 Jan 2009) | 1 line Stronger tests for combinatoric relationships. ........ r69014 | raymond.hettinger | 2009-01-27 04:03:04 -0600 (Tue, 27 Jan 2009) | 1 line Issue 5021: doctest.testfile should set __name__ ........ r69018 | raymond.hettinger | 2009-01-27 04:36:14 -0600 (Tue, 27 Jan 2009) | 1 line More exhaustive combinatoric checks. ........ r69023 | raymond.hettinger | 2009-01-27 07:26:35 -0600 (Tue, 27 Jan 2009) | 1 line Add more tests for the powerset() recipe. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Tue Jan 27 22:53:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 21:53:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090127215336.D665B1E4002@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/98 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue Jan 27 23:14:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Tue, 27 Jan 2009 23:14:59 +0100 (CET) Subject: [Python-checkins] r69036 - in python/branches/io-c: Doc/distutils/apiref.rst Doc/documenting/markup.rst Doc/glossary.rst Doc/library/collections.rst Doc/library/importlib.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/multiprocessing.rst Doc/library/operator.rst Doc/library/pickle.rst Doc/library/subprocess.rst Doc/library/symtable.rst Lib/collections.py Lib/ctypes/test/test_libc.py Lib/decimal.py Lib/distutils/ccompiler.py Lib/distutils/command/sdist.py Lib/distutils/mwerkscompiler.py Lib/distutils/tests/test_sdist.py Lib/distutils/version.py Lib/doctest.py Lib/heapq.py Lib/idlelib/PyShell.py Lib/importlib Lib/importlib/NOTES Lib/importlib/__init__.py Lib/importlib/_bootstrap.py Lib/importlib/machinery.py Lib/importlib/test Lib/importlib/test/builtin Lib/importlib/test/builtin/test_finder.py Lib/importlib/test/builtin/test_loader.py Lib/importlib/test/extension Lib/importlib/test/extension/test_finder.py Lib/importlib/test/finder_tests.py Lib/importlib/test/frozen Lib/importlib/test/frozen/test_finder.py Lib/importlib/test/frozen/test_loader.py Lib/importlib/test/import_ Lib/importlib/test/loader_tests.py Lib/importlib/test/source Lib/locale.py Lib/logging/__init__.py Lib/logging/handlers.py Lib/multiprocessing/__init__.py Lib/multiprocessing/managers.py Lib/multiprocessing/util.py Lib/pickletools.py Lib/pydoc.py Lib/sqlite3/test/hooks.py Lib/test/crashers/loosing_mro_ref.py Lib/test/list_tests.py Lib/test/pickletester.py Lib/test/test_array.py Lib/test/test_bool.py Lib/test/test_builtin.py Lib/test/test_cmd_line.py Lib/test/test_codecs.py Lib/test/test_collections.py Lib/test/test_contains.py Lib/test/test_copy.py Lib/test/test_datetime.py Lib/test/test_decimal.py Lib/test/test_deque.py Lib/test/test_descr.py Lib/test/test_dict.py Lib/test/test_hash.py Lib/test/test_heapq.py Lib/test/test_hmac.py Lib/test/test_import.py Lib/test/test_io.py Lib/test/test_itertools.py Lib/test/test_kqueue.py Lib/test/test_long.py Lib/test/test_multibytecodec.py Lib/test/test_multiprocessing.py Lib/test/test_operator.py Lib/test/test_set.py Lib/test/test_sort.py Lib/test/test_sundry.py Lib/test/test_unittest.py Lib/test/test_userdict.py Lib/test/test_uuid.py Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/tkinter/_fix.py Lib/unittest.py Lib/xml/dom/minidom.py Lib/xml/etree/ElementTree.py Lib/xmlrpc/client.py Lib/zipfile.py Makefile.pre.in Misc/ACKS Misc/NEWS Modules/_codecsmodule.c Modules/_fileio.c Modules/_pickle.c Modules/_ssl.c Modules/cjkcodecs/multibytecodec.c Modules/itertoolsmodule.c Modules/operator.c Objects/longobject.c Objects/stringlib/fastsearch.h Python/ceval.c Python/import.c Python/makeopcodetargets.py Python/opcode_targets.h Python/pythonrun.c Tools/unicode/makeunicodedata.py configure configure.in pyconfig.h.in setup.py Message-ID: <20090127221459.378DD1E4016@bag.python.org> Author: antoine.pitrou Date: Tue Jan 27 23:14:53 2009 New Revision: 69036 Log: Merged revisions 68832-68833,68836,68841,68844,68846-68848,68851,68854-68855,68857,68860-68861,68863-68870,68872-68873,68875,68878,68882-68883,68887,68889,68895,68898,68900,68908,68916,68918-68919,68922,68924,68926,68928,68931,68935,68937,68949,68954,68956-68957,68960-68961,68963,68965,68969,68977,68980-68981,68986,68991-68993,68995-68997,68999-69000,69002,69004-69005,69007,69011,69013,69015,69019-69020,69022,69024-69025,69032,69035 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r68832 | raymond.hettinger | 2009-01-21 00:44:31 +0100 (mer., 21 janv. 2009) | 1 line Beautify and cleanup the references section. ................ r68833 | vinay.sajip | 2009-01-21 01:19:28 +0100 (mer., 21 janv. 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. ................ r68836 | antoine.pitrou | 2009-01-21 01:55:13 +0100 (mer., 21 janv. 2009) | 12 lines Merged revisions 68835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object. ........ ................ r68841 | jesse.noller | 2009-01-21 03:15:48 +0100 (mer., 21 janv. 2009) | 1 line merge r68839 forward to py3k ................ r68844 | raymond.hettinger | 2009-01-21 21:36:27 +0100 (mer., 21 janv. 2009) | 1 line Simplify explanation of multiset operations by removing restrictions on negative inputs. ................ r68846 | raymond.hettinger | 2009-01-22 00:14:07 +0100 (jeu., 22 janv. 2009) | 1 line Tighten-up the docs for Counter(). ................ r68847 | benjamin.peterson | 2009-01-22 03:24:32 +0100 (jeu., 22 janv. 2009) | 12 lines Blocked revisions 68843,68845 via svnmerge ........ r68843 | raymond.hettinger | 2009-01-21 14:31:50 -0600 (Wed, 21 Jan 2009) | 1 line Simplify explanation of multiset operations by removing restrictions on negative inputs. ........ r68845 | raymond.hettinger | 2009-01-21 17:12:51 -0600 (Wed, 21 Jan 2009) | 1 line Tighten-up the docs for Counter(). ........ ................ r68848 | benjamin.peterson | 2009-01-22 04:21:11 +0100 (jeu., 22 janv. 2009) | 28 lines Blocked revisions 68760,68793,68813,68826,68829,68831 via svnmerge ........ r68760 | vinay.sajip | 2009-01-19 00:49:19 -0600 (Mon, 19 Jan 2009) | 1 line Added more cross-reference targets and tidied up list of useful handlers. ........ r68793 | raymond.hettinger | 2009-01-19 21:36:36 -0600 (Mon, 19 Jan 2009) | 1 line Make merging easier by formattng comment blocks the same in Py3.1 ........ r68813 | raymond.hettinger | 2009-01-20 14:34:19 -0600 (Tue, 20 Jan 2009) | 3 lines Issue 4998: __slots__ on Fractions was useless. ........ r68826 | vinay.sajip | 2009-01-20 16:43:17 -0600 (Tue, 20 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set. ........ r68829 | vinay.sajip | 2009-01-20 17:16:08 -0600 (Tue, 20 Jan 2009) | 1 line Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly. ........ r68831 | raymond.hettinger | 2009-01-20 17:42:54 -0600 (Tue, 20 Jan 2009) | 1 line Beautify and cleanup the references section. ........ ................ r68851 | raymond.hettinger | 2009-01-22 06:27:37 +0100 (jeu., 22 janv. 2009) | 1 line More doc tweaks. ................ r68854 | raymond.hettinger | 2009-01-22 10:09:55 +0100 (jeu., 22 janv. 2009) | 1 line Update comments and add an optimized path for Counter.update(). ................ r68855 | antoine.pitrou | 2009-01-22 11:11:36 +0100 (jeu., 22 janv. 2009) | 3 lines Issue #4874: Most builtin decoders now reject unicode input. ................ r68857 | antoine.pitrou | 2009-01-22 12:59:55 +0100 (jeu., 22 janv. 2009) | 3 lines Followup of #4874: also fix multibytecodec.c ................ r68860 | brett.cannon | 2009-01-22 19:37:20 +0100 (jeu., 22 janv. 2009) | 1 line Fix markup for arguments in importlib docs. ................ r68861 | benjamin.peterson | 2009-01-22 22:50:27 +0100 (jeu., 22 janv. 2009) | 12 lines Blocked revisions 68850,68853 via svnmerge ........ r68850 | raymond.hettinger | 2009-01-21 23:20:47 -0600 (Wed, 21 Jan 2009) | 1 line More doc tweaks. ........ r68853 | raymond.hettinger | 2009-01-22 03:05:43 -0600 (Thu, 22 Jan 2009) | 1 line Update comments and add an optimized path for Counter.update(). ........ ................ r68863 | jesse.noller | 2009-01-22 22:56:13 +0100 (jeu., 22 janv. 2009) | 1 line merge r68862 to py3k ................ r68864 | brett.cannon | 2009-01-22 23:43:07 +0100 (jeu., 22 janv. 2009) | 7 lines Add importlib.machinery with its first tenants, BuitinImporter and FrozenImporter. Docs forthcoming. I plan on all finders and loaders (and most likely hooks) to live in imoprtlib.machinery. Utility stuff will end up in importlib.util. Higher-level API stuff will stay on imoprtlib directly (e.g. import_module). ................ r68865 | brett.cannon | 2009-01-22 23:44:04 +0100 (jeu., 22 janv. 2009) | 4 lines Add some comment markers to more clearly delineate what different parts of the code are for. Also add a note that the import * at the end of the file should eventually go away. ................ r68866 | brett.cannon | 2009-01-22 23:45:00 +0100 (jeu., 22 janv. 2009) | 2 lines Ignore pyc and pyo files. ................ r68867 | benjamin.peterson | 2009-01-23 04:26:36 +0100 (ven., 23 janv. 2009) | 29 lines Merged revisions 68750,68776-68777,68811,68842,68859 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68750 | benjamin.peterson | 2009-01-18 16:47:04 -0600 (Sun, 18 Jan 2009) | 1 line fix encoding cookie case ........ r68776 | benjamin.peterson | 2009-01-19 10:17:54 -0600 (Mon, 19 Jan 2009) | 1 line move BufferedIOBase into the base class section ........ r68777 | benjamin.peterson | 2009-01-19 10:18:27 -0600 (Mon, 19 Jan 2009) | 1 line add email address ........ r68811 | benjamin.peterson | 2009-01-20 12:58:27 -0600 (Tue, 20 Jan 2009) | 1 line fix url ........ r68842 | andrew.kuchling | 2009-01-20 20:16:26 -0600 (Tue, 20 Jan 2009) | 1 line Markup fixes ........ r68859 | georg.brandl | 2009-01-22 12:29:28 -0600 (Thu, 22 Jan 2009) | 2 lines Clarify wording. ........ ................ r68868 | alexandre.vassalotti | 2009-01-23 05:43:46 +0100 (ven., 23 janv. 2009) | 2 lines Remove unnecessary copying in load_long(). ................ r68869 | alexandre.vassalotti | 2009-01-23 05:46:05 +0100 (ven., 23 janv. 2009) | 2 lines Remove obsolete note on binary-mode vs. text-mode file. ................ r68870 | alexandre.vassalotti | 2009-01-23 05:50:05 +0100 (ven., 23 janv. 2009) | 2 lines Issue 2980: Protocol 0 is not truly restricted to ASCII. ................ r68872 | alexandre.vassalotti | 2009-01-23 06:28:16 +0100 (ven., 23 janv. 2009) | 2 lines Clean up pickle usage examples. ................ r68873 | hirokazu.yamamoto | 2009-01-23 08:23:03 +0100 (ven., 23 janv. 2009) | 9 lines Merged revisions 68457 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68457 | kristjan.jonsson | 2009-01-10 05:10:59 +0900 | 1 line Issue 3677: Fix import from UNC paths on Windows. ........ ................ r68875 | jesse.noller | 2009-01-23 15:09:08 +0100 (ven., 23 janv. 2009) | 1 line merge 68874 to py3kwq! ................ r68878 | alexandre.vassalotti | 2009-01-24 02:47:57 +0100 (sam., 24 janv. 2009) | 4 lines Factor common branch in load_long(). Suggested by Neal Norwitz. ................ r68882 | kristjan.jonsson | 2009-01-24 11:33:25 +0100 (sam., 24 janv. 2009) | 1 line Issue 3677: Release the path string on py3k ................ r68883 | kristjan.jonsson | 2009-01-24 11:50:45 +0100 (sam., 24 janv. 2009) | 1 line Add a test for UNC import paths, see issue 3677 ................ r68887 | martin.v.loewis | 2009-01-24 15:10:07 +0100 (sam., 24 janv. 2009) | 10 lines Merged revisions 68885 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68885 | martin.v.loewis | 2009-01-24 15:00:33 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. ........ ................ r68889 | mark.dickinson | 2009-01-24 16:02:35 +0100 (sam., 24 janv. 2009) | 9 lines Some minor cleanups in PyLong_FromLong: - fast path wasn't being properly taken for negative ints; thanks Victor Stinner for pointing this out. - use Py_SAFE_DOWNCAST instead of direct casting to digit (it's safer, especially if we ever consider moving to 30-bit digits) - cleaner way to write negation ................ r68895 | mark.dickinson | 2009-01-24 16:56:57 +0100 (sam., 24 janv. 2009) | 13 lines Merged revisions 68890 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values ........ ................ r68898 | martin.v.loewis | 2009-01-24 17:19:45 +0100 (sam., 24 janv. 2009) | 10 lines Merged revisions 68893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68893 | martin.v.loewis | 2009-01-24 16:47:27 +0100 (Sa, 24 Jan 2009) | 3 lines Issue #3881: Help Tcl to load even when started through the unreadable local symlink to "Program Files" on Vista. ........ ................ r68900 | mark.dickinson | 2009-01-24 17:22:21 +0100 (sam., 24 janv. 2009) | 9 lines Merged revisions 68897 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68897 | mark.dickinson | 2009-01-24 16:17:27 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #5025: Fix occasional test_kqueue failure on OS X. ........ ................ r68908 | mark.dickinson | 2009-01-24 22:46:33 +0100 (sam., 24 janv. 2009) | 15 lines Merged revisions 68903,68906 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines Issue #1672332: Fix unpickling of subnormal floats, which was raising ValueError on some platforms as a result of the platform strtod setting errno on underflow. ........ r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines Issue #3657: fix occasional test_pickletools failures. ........ ................ r68916 | jesse.noller | 2009-01-25 04:45:53 +0100 (dim., 25 janv. 2009) | 1 line merge r68915 to py3k ................ r68918 | brett.cannon | 2009-01-25 05:21:39 +0100 (dim., 25 janv. 2009) | 2 lines Add the terms "finder", "loader", and "importer" to the glossary. ................ r68919 | brett.cannon | 2009-01-25 05:56:30 +0100 (dim., 25 janv. 2009) | 2 lines Document both importlib.machinery.BuiltinImporter and FrozenImporter. ................ r68922 | mark.dickinson | 2009-01-25 11:48:51 +0100 (dim., 25 janv. 2009) | 9 lines Merged revisions 68920 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68920 | mark.dickinson | 2009-01-25 10:39:15 +0000 (Sun, 25 Jan 2009) | 2 lines Remove uses of cmp from the decimal module. ........ ................ r68924 | antoine.pitrou | 2009-01-25 17:34:23 +0100 (dim., 25 janv. 2009) | 6 lines 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 speedups of up to 20%, depending on the system, on various benchmarks. ................ r68926 | benjamin.peterson | 2009-01-25 18:19:17 +0100 (dim., 25 janv. 2009) | 11 lines Blocked revisions 68925 via svnmerge ........ r68925 | benjamin.peterson | 2009-01-25 11:15:10 -0600 (Sun, 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 ........ ................ r68928 | hirokazu.yamamoto | 2009-01-25 18:50:07 +0100 (dim., 25 janv. 2009) | 8 lines Blocked revisions 68927 via svnmerge ........ r68927 | hirokazu.yamamoto | 2009-01-26 02:46:48 +0900 | 1 line Fixed compile error on windows. ........ ................ r68931 | tarek.ziade | 2009-01-25 19:27:45 +0100 (dim., 25 janv. 2009) | 9 lines Merged revisions 68929 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68929 | tarek.ziade | 2009-01-25 19:19:25 +0100 (Sun, 25 Jan 2009) | 1 line Fixed #4863: removed distutils.mwerkscompiler ........ ................ r68935 | tarek.ziade | 2009-01-25 20:31:22 +0100 (dim., 25 janv. 2009) | 9 lines Merged revisions 68933 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68933 | tarek.ziade | 2009-01-25 20:29:10 +0100 (Sun, 25 Jan 2009) | 1 line Issue #4863, removing remaining bits ........ ................ r68937 | benjamin.peterson | 2009-01-25 20:44:16 +0100 (dim., 25 janv. 2009) | 1 line use the classmethod directive ................ r68949 | mark.dickinson | 2009-01-25 23:25:06 +0100 (dim., 25 janv. 2009) | 10 lines Merged revisions 68947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68947 | mark.dickinson | 2009-01-25 22:12:31 +0000 (Sun, 25 Jan 2009) | 3 lines No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. ........ ................ r68954 | brett.cannon | 2009-01-26 02:21:47 +0100 (lun., 26 janv. 2009) | 9 lines Blocked revisions 68953 via svnmerge ........ r68953 | brett.cannon | 2009-01-25 17:16:50 -0800 (Sun, 25 Jan 2009) | 3 lines Backport importlib in the form of providing importlib.import_module(). This has been done purely to help transitions from 2.7 to 3.1. ........ ................ r68956 | brett.cannon | 2009-01-26 02:54:40 +0100 (lun., 26 janv. 2009) | 1 line Update NOTES for importlib. ................ r68957 | raymond.hettinger | 2009-01-26 03:09:03 +0100 (lun., 26 janv. 2009) | 9 lines As discussed on python-dev, remove several operator functions isSequenceType(), isMappingType(), and isNumberType() in favor of using abstract base classes. Also, remove repeat() and irepeat() in favor of mul() and imul(). After the buildbots have had a go at this. Will backport to Py3.0.1. For Py2.7, will just mark as deprecated. ................ r68960 | raymond.hettinger | 2009-01-26 03:23:50 +0100 (lun., 26 janv. 2009) | 1 line Backport r68942: update powerset() recipe. ................ r68961 | raymond.hettinger | 2009-01-26 03:56:58 +0100 (lun., 26 janv. 2009) | 1 line Forward port r68941 adding itertools.compress(). ................ r68963 | benjamin.peterson | 2009-01-26 04:50:45 +0100 (lun., 26 janv. 2009) | 12 lines Blocked revisions 68941-68942 via svnmerge ........ r68941 | raymond.hettinger | 2009-01-25 15:04:14 -0600 (Sun, 25 Jan 2009) | 1 line Promote compress() from a recipe to being a regular itertool. ........ r68942 | raymond.hettinger | 2009-01-25 15:31:47 -0600 (Sun, 25 Jan 2009) | 1 line Improved itertools recipe for generating powerset(). ........ ................ r68965 | raymond.hettinger | 2009-01-26 17:53:29 +0100 (lun., 26 janv. 2009) | 1 line Fix signed/unsigned mismatch. ................ r68969 | tarek.ziade | 2009-01-26 18:23:20 +0100 (lun., 26 janv. 2009) | 9 lines Merged revisions 68951 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68951 | tarek.ziade | 2009-01-26 00:34:00 +0100 (Mon, 26 Jan 2009) | 1 line Fixed #1885: --formats=tar,gztar was not working properly in the sdist command ........ ................ r68977 | antoine.pitrou | 2009-01-26 22:48:00 +0100 (lun., 26 janv. 2009) | 3 lines Followup of #4705: we can't skip the binary buffering layer for stdin because FileIO doesn't have a read1() method ................ r68980 | mark.dickinson | 2009-01-26 22:56:07 +0100 (lun., 26 janv. 2009) | 14 lines Merged revisions 68974-68975 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68974 | mark.dickinson | 2009-01-26 21:36:30 +0000 (Mon, 26 Jan 2009) | 4 lines Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. ........ r68975 | mark.dickinson | 2009-01-26 21:40:08 +0000 (Mon, 26 Jan 2009) | 2 lines Fix comment. ........ ................ r68981 | antoine.pitrou | 2009-01-26 23:00:21 +0100 (lun., 26 janv. 2009) | 3 lines Fix test so as to also pass in debug mode ................ r68986 | raymond.hettinger | 2009-01-27 01:28:36 +0100 (mar., 27 janv. 2009) | 1 line Forward port r68985: Idle startup message. ................ r68991 | brett.cannon | 2009-01-27 02:33:54 +0100 (mar., 27 janv. 2009) | 2 lines Move importlib.test.extension.test_finder over to importlib.test.finder_tests. ................ r68992 | brett.cannon | 2009-01-27 02:34:30 +0100 (mar., 27 janv. 2009) | 2 lines Make importlib.test.finder_tests an ABC. ................ r68993 | brett.cannon | 2009-01-27 02:41:57 +0100 (mar., 27 janv. 2009) | 2 lines Move importlib.test.builtin.test_finder over to importlib.test.finder_tests. ................ r68995 | brett.cannon | 2009-01-27 02:44:50 +0100 (mar., 27 janv. 2009) | 2 lines Move importlib.test.frozen.test_finder over to importlib.test.finder_tests. ................ r68996 | brett.cannon | 2009-01-27 02:46:04 +0100 (mar., 27 janv. 2009) | 1 line Update importlib NOTES. ................ r68997 | benjamin.peterson | 2009-01-27 03:30:47 +0100 (mar., 27 janv. 2009) | 15 lines Blocked revisions 68964,68985 via svnmerge ........ r68964 | raymond.hettinger | 2009-01-26 10:52:22 -0600 (Mon, 26 Jan 2009) | 1 line Fix signed/unsigned mismatch. ........ r68985 | raymond.hettinger | 2009-01-26 17:29:09 -0600 (Mon, 26 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. ........ ................ r68999 | raymond.hettinger | 2009-01-27 03:38:22 +0100 (mar., 27 janv. 2009) | 3 lines Tweak column alignment in collections docs. ................ r69000 | brett.cannon | 2009-01-27 03:39:33 +0100 (mar., 27 janv. 2009) | 2 lines Initial take on importlib.test.loader_tests. ................ r69002 | benjamin.peterson | 2009-01-27 04:02:38 +0100 (mar., 27 janv. 2009) | 8 lines Blocked revisions 68998 via svnmerge ........ r68998 | raymond.hettinger | 2009-01-26 20:36:33 -0600 (Mon, 26 Jan 2009) | 3 lines Tweak column alignment for collections docs. ........ ................ r69004 | raymond.hettinger | 2009-01-27 05:20:44 +0100 (mar., 27 janv. 2009) | 1 line Forward port r69001: itertools.combinations_with_replacement(). ................ r69005 | raymond.hettinger | 2009-01-27 05:42:48 +0100 (mar., 27 janv. 2009) | 1 line Put functions back in alphabetical order. ................ r69007 | raymond.hettinger | 2009-01-27 05:57:51 +0100 (mar., 27 janv. 2009) | 1 line Beautify grouper() recipe in docs. ................ r69011 | raymond.hettinger | 2009-01-27 10:35:21 +0100 (mar., 27 janv. 2009) | 1 line Add tests to verify combinatoric relationships. ................ r69013 | raymond.hettinger | 2009-01-27 10:56:30 +0100 (mar., 27 janv. 2009) | 1 line Stronger tests for combinatoric relationships. ................ r69015 | raymond.hettinger | 2009-01-27 11:06:09 +0100 (mar., 27 janv. 2009) | 1 line Issue 5021: doctest.testfile should set __name__ ................ r69019 | raymond.hettinger | 2009-01-27 11:39:42 +0100 (mar., 27 janv. 2009) | 1 line More exhaustive combinatoric checks. ................ r69020 | antoine.pitrou | 2009-01-27 11:49:58 +0100 (mar., 27 janv. 2009) | 3 lines Add executable property to Python/makeopcodetargets.py ................ r69022 | raymond.hettinger | 2009-01-27 12:06:40 +0100 (mar., 27 janv. 2009) | 1 line Resurrect two buffer tests, converting irepeat() to imul(). Undoes part of r68962. ................ r69024 | raymond.hettinger | 2009-01-27 14:29:43 +0100 (mar., 27 janv. 2009) | 1 line Add more tests for the powerset() recipe. ................ r69025 | mark.dickinson | 2009-01-27 19:17:45 +0100 (mar., 27 janv. 2009) | 3 lines Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from the standard library and tests. ................ r69032 | mark.dickinson | 2009-01-27 21:27:05 +0100 (mar., 27 janv. 2009) | 2 lines Fix an occurrence of cmp that was missed in r69025 ................ r69035 | benjamin.peterson | 2009-01-27 22:37:33 +0100 (mar., 27 janv. 2009) | 28 lines Blocked revisions 69001,69010,69012,69014,69018,69023 via svnmerge ........ r69001 | raymond.hettinger | 2009-01-26 20:58:49 -0600 (Mon, 26 Jan 2009) | 1 line Promote combinations_with_replacement() from a recipe to a regular itertool. ........ r69010 | raymond.hettinger | 2009-01-27 03:33:06 -0600 (Tue, 27 Jan 2009) | 1 line Add tests to verify combinatoric relationships. ........ r69012 | raymond.hettinger | 2009-01-27 03:52:35 -0600 (Tue, 27 Jan 2009) | 1 line Stronger tests for combinatoric relationships. ........ r69014 | raymond.hettinger | 2009-01-27 04:03:04 -0600 (Tue, 27 Jan 2009) | 1 line Issue 5021: doctest.testfile should set __name__ ........ r69018 | raymond.hettinger | 2009-01-27 04:36:14 -0600 (Tue, 27 Jan 2009) | 1 line More exhaustive combinatoric checks. ........ r69023 | raymond.hettinger | 2009-01-27 07:26:35 -0600 (Tue, 27 Jan 2009) | 1 line Add more tests for the powerset() recipe. ........ ................ Added: python/branches/io-c/Lib/importlib/machinery.py - copied unchanged from r69035, /python/branches/py3k/Lib/importlib/machinery.py python/branches/io-c/Lib/importlib/test/loader_tests.py - copied unchanged from r69035, /python/branches/py3k/Lib/importlib/test/loader_tests.py python/branches/io-c/Lib/test/zipdir.zip - copied unchanged from r69035, /python/branches/py3k/Lib/test/zipdir.zip python/branches/io-c/Python/makeopcodetargets.py - copied unchanged from r69035, /python/branches/py3k/Python/makeopcodetargets.py python/branches/io-c/Python/opcode_targets.h - copied unchanged from r69035, /python/branches/py3k/Python/opcode_targets.h Removed: python/branches/io-c/Lib/distutils/mwerkscompiler.py Modified: python/branches/io-c/ (props changed) python/branches/io-c/Doc/distutils/apiref.rst python/branches/io-c/Doc/documenting/markup.rst python/branches/io-c/Doc/glossary.rst python/branches/io-c/Doc/library/collections.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/multiprocessing.rst python/branches/io-c/Doc/library/operator.rst python/branches/io-c/Doc/library/pickle.rst python/branches/io-c/Doc/library/subprocess.rst python/branches/io-c/Doc/library/symtable.rst python/branches/io-c/Lib/collections.py python/branches/io-c/Lib/ctypes/test/test_libc.py python/branches/io-c/Lib/decimal.py python/branches/io-c/Lib/distutils/ccompiler.py python/branches/io-c/Lib/distutils/command/sdist.py python/branches/io-c/Lib/distutils/tests/test_sdist.py python/branches/io-c/Lib/distutils/version.py python/branches/io-c/Lib/doctest.py python/branches/io-c/Lib/heapq.py python/branches/io-c/Lib/idlelib/PyShell.py python/branches/io-c/Lib/importlib/ (props changed) 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/test/ (props changed) python/branches/io-c/Lib/importlib/test/builtin/ (props changed) 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/ (props changed) python/branches/io-c/Lib/importlib/test/extension/test_finder.py python/branches/io-c/Lib/importlib/test/finder_tests.py python/branches/io-c/Lib/importlib/test/frozen/ (props changed) 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_/ (props changed) python/branches/io-c/Lib/importlib/test/source/ (props changed) python/branches/io-c/Lib/locale.py python/branches/io-c/Lib/logging/__init__.py python/branches/io-c/Lib/logging/handlers.py python/branches/io-c/Lib/multiprocessing/__init__.py python/branches/io-c/Lib/multiprocessing/managers.py python/branches/io-c/Lib/multiprocessing/util.py python/branches/io-c/Lib/pickletools.py python/branches/io-c/Lib/pydoc.py python/branches/io-c/Lib/sqlite3/test/hooks.py python/branches/io-c/Lib/test/crashers/loosing_mro_ref.py python/branches/io-c/Lib/test/list_tests.py python/branches/io-c/Lib/test/pickletester.py python/branches/io-c/Lib/test/test_array.py python/branches/io-c/Lib/test/test_bool.py python/branches/io-c/Lib/test/test_builtin.py python/branches/io-c/Lib/test/test_cmd_line.py python/branches/io-c/Lib/test/test_codecs.py python/branches/io-c/Lib/test/test_collections.py python/branches/io-c/Lib/test/test_contains.py python/branches/io-c/Lib/test/test_copy.py python/branches/io-c/Lib/test/test_datetime.py python/branches/io-c/Lib/test/test_decimal.py python/branches/io-c/Lib/test/test_deque.py python/branches/io-c/Lib/test/test_descr.py python/branches/io-c/Lib/test/test_dict.py python/branches/io-c/Lib/test/test_hash.py python/branches/io-c/Lib/test/test_heapq.py python/branches/io-c/Lib/test/test_hmac.py python/branches/io-c/Lib/test/test_import.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_kqueue.py python/branches/io-c/Lib/test/test_long.py python/branches/io-c/Lib/test/test_multibytecodec.py python/branches/io-c/Lib/test/test_multiprocessing.py python/branches/io-c/Lib/test/test_operator.py python/branches/io-c/Lib/test/test_set.py python/branches/io-c/Lib/test/test_sort.py python/branches/io-c/Lib/test/test_sundry.py python/branches/io-c/Lib/test/test_unittest.py python/branches/io-c/Lib/test/test_userdict.py python/branches/io-c/Lib/test/test_uuid.py python/branches/io-c/Lib/test/test_zipfile.py python/branches/io-c/Lib/tkinter/_fix.py python/branches/io-c/Lib/unittest.py python/branches/io-c/Lib/xml/dom/minidom.py python/branches/io-c/Lib/xml/etree/ElementTree.py python/branches/io-c/Lib/xmlrpc/client.py python/branches/io-c/Lib/zipfile.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/_codecsmodule.c python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_pickle.c python/branches/io-c/Modules/_ssl.c python/branches/io-c/Modules/cjkcodecs/multibytecodec.c python/branches/io-c/Modules/itertoolsmodule.c python/branches/io-c/Modules/operator.c python/branches/io-c/Objects/longobject.c python/branches/io-c/Objects/stringlib/fastsearch.h python/branches/io-c/Python/ceval.c python/branches/io-c/Python/import.c python/branches/io-c/Python/pythonrun.c python/branches/io-c/Tools/unicode/makeunicodedata.py python/branches/io-c/configure python/branches/io-c/configure.in python/branches/io-c/pyconfig.h.in python/branches/io-c/setup.py Modified: python/branches/io-c/Doc/distutils/apiref.rst ============================================================================== --- python/branches/io-c/Doc/distutils/apiref.rst (original) +++ python/branches/io-c/Doc/distutils/apiref.rst Tue Jan 27 23:14:53 2009 @@ -847,23 +847,6 @@ :class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2. -:mod:`distutils.mwerkscompiler` --- Metrowerks CodeWarrior support -================================================================== - -.. module:: distutils.mwerkscompiler - :synopsis: Metrowerks CodeWarrior support - - -Contains :class:`MWerksCompiler`, an implementation of the abstract -:class:`CCompiler` class for MetroWerks CodeWarrior on the pre-Mac OS X -Macintosh. Needs work to support CW on Windows or Mac OS X. - -.. % \subsection{Utility modules} -.. % -.. % The following modules all provide general utility functions. They haven't -.. % all been documented yet. - - :mod:`distutils.archive_util` --- Archiving utilities ====================================================== 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 Tue Jan 27 23:14:53 2009 @@ -285,7 +285,8 @@ 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```. @@ -310,7 +311,7 @@ .. describe:: data - The name of a module-level variable. + The name of a module-level variable or constant. .. describe:: const Modified: python/branches/io-c/Doc/glossary.rst ============================================================================== --- python/branches/io-c/Doc/glossary.rst (original) +++ python/branches/io-c/Doc/glossary.rst Tue Jan 27 23:14:53 2009 @@ -179,6 +179,11 @@ A module written in C or C++, using Python's C API to interact with the core and with user code. + finder + An object that tries to find the :term:`loader` for a module. It must + implement a method named :meth:`find_module`. See :pep:`302` for + details. + floor division Mathematical division discarding any remainder. The floor division operator is ``//``. For example, the expression ``11//4`` evaluates to @@ -270,6 +275,10 @@ role in places where a constant hash value is needed, for example as a key in a dictionary. + importer + An object that both finds and loads a module; both a + :term:`finder` and :term:`loader` object. + interactive Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately @@ -351,6 +360,11 @@ clause is optional. If omitted, all elements in ``range(256)`` are processed. + loader + An object that loads a module. It must define a method named + :meth:`load_module`. A loader is typically returned by a + :term:`finder`. See :pep:`302` for details. + mapping A container object (such as :class:`dict`) which supports arbitrary key lookups using the special method :meth:`__getitem__`. 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 Tue Jan 27 23:14:53 2009 @@ -146,10 +146,9 @@ A counter tool is provided to support convenient and rapid tallies. For example:: - # Tally repeated words in a list - >>> words = ['red', 'blue', 'red', 'green', 'blue', 'blue'] + # Tally occurrences of words in a list >>> cnt = Counter() - >>> for word in words: + >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: ... cnt[word] += 1 >>> cnt Counter({'blue': 3, 'red': 2, 'green': 1}) @@ -163,7 +162,7 @@ .. class:: Counter([iterable-or-mapping]) - A :class:`Counter` is a :class:`dict` subclass for counting hashable items. + A :class:`Counter` is a :class:`dict` subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The :class:`Counter` @@ -172,27 +171,23 @@ Elements are counted from an *iterable* or initialized from another *mapping* (or counter):: - >>> c = Counter() # a new, empty counter - >>> c = Counter('gallahad') # a new counter from an iterable - >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping - >>> c = Counter(spam=8, eggs=1) # a new counter from keyword args - - The returned object has a dictionary style interface except that it returns - a zero count for missing items (instead of raising a :exc:`KeyError` like a - dictionary would):: + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping + >>> c = Counter(cats=4, dogs=8) # a new counter from keyword args - >>> c = Counter(['egg', 'ham']) + Counter objects have a dictionary interface except that they return a zero + count for missing items instead of raising a :exc:`KeyError`:: + + >>> c = Counter(['eggs', 'ham']) >>> c['bacon'] # count of a missing element is zero 0 - Assigning a count of zero or reducing the count to zero leaves the - element in the dictionary. Use ``del`` to remove the entry entirely: + Setting a count to zero does not remove an element from a counter. + Use ``del`` to remove it entirely: - >>> c = Counter(['arthur', 'gwain']) - >>> c['arthur'] = 0 # set the count of 'arthur' to zero - >>> 'arthur' in c # but 'arthur' is still in the counter - True - >>> del c['arthur'] # del will completely remove the entry + >>> c['sausage'] = 0 # counter entry with a zero count + >>> del c['sausage'] # del actually removes the entry .. versionadded:: 2.7 @@ -202,9 +197,9 @@ .. method:: elements() - Return an iterator over elements repeating each as many times as its count. - Elements are returned in arbitrary order. If an element's count has been - set to zero or a negative number, :meth:`elements` will ignore it. + Return an iterator over elements repeating each as many times as its + count. Elements are returned in arbitrary order. If an element's count + is less than one, :meth:`elements` will ignore it. >>> c = Counter(a=4, b=2, c=0, d=-2) >>> list(c.elements()) @@ -212,92 +207,81 @@ .. 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* is not specified or is ``None``, - return a list of all element counts in decreasing order of frequency. - Elements with equal counts are ordered arbitrarily:: + 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` + returns *all* elements in the counter. Elements with equal counts are + ordered arbitrarily:: >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] - The usual dictionary methods are available for :class:`Counter` objects. - All of those work the same as they do for dictionaries except for two - which work differently for counters. + The usual dictionary methods are available for :class:`Counter` objects + except for two which work differently for counters. .. method:: fromkeys(iterable) - There is no equivalent class method for :class:`Counter` objects. - Raises a :exc:`NotImplementedError` when called. + This class method is not implemented for :class:`Counter` objects. .. method:: update([iterable-or-mapping]) - Elements are counted from an *iterable* or added-in from another - *mapping* (or counter). Like :meth:`dict.update` but adds-in counts - instead of replacing them, and the *iterable* is expected to be a - sequence of elements, not a sequence of ``(key, value)`` pairs:: - - >>> c = Counter('which') - >>> c.update('witch') # add elements from another iterable - >>> d = Counter('watch') - >>> c.update(d) # add elements from another counter - >>> c['h'] # four 'h' in which, witch, and watch - 4 + Elements are counted from an *iterable* or added-in from another + *mapping* (or counter). Like :meth:`dict.update` but adds counts + instead of replacing them. Also, the *iterable* is expected to be a + sequence of elements, not a sequence of ``(key, value)`` pairs. Common patterns for working with :class:`Counter` objects:: - sum(c.values()) # total of all counts - c.clear() # reset all counts - list(c) # list unique elements - set(c) # convert to a set - dict(c) # convert to a regular dictionary - c.items() # convert to a list of (elem, cnt) pairs - Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs - c.most_common()[:-n:-1] # n least common elements + sum(c.values()) # total of all counts + c.clear() # reset all counts + list(c) # list unique elements + set(c) # convert to a set + dict(c) # convert to a regular dictionary + c.items() # convert to a list of (elem, cnt) pairs + Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs + 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 allowed to +: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:: +of corresponding counts. All four multiset operations exclude results with +counts less than one:: - >>> c = Counter({'a': 3, 'b': 1}) - >>> d = Counter({'a': 1, 'b': 2}) - >>> c + d # add two counters together: c[x] + d[x] + >>> c = Counter(a=3, b=1) + >>> d = Counter(a=1, b=2) + >>> c + d # add two counters together: c[x] + d[x] Counter({'a': 4, 'b': 3}) - >>> c - d # subtract (keeping only positive counts) + >>> c - d # subtract (keeping only positive counts) Counter({'a': 2}) - >>> c & d # intersection: min(c[x], d[x]) + >>> c & d # intersection: min(c[x], d[x]) Counter({'a': 1, 'b': 1}) - >>> c | d # union: max(c[x], d[x]) + >>> c | d # union: max(c[x], d[x]) Counter({'a': 3, 'b': 2}) -All four multiset operations produce only positive counts (negative and zero -results are skipped). If inputs include negative counts, addition will sum -both counts and then exclude non-positive results. The other three operations -are undefined for negative inputs:: - - >>> e = Counter(a=8, b=-2, c=0) - >>> e += Counter() # remove zero and negative counts - >>> e - Counter({'a': 8}) - -**References**: - -* Wikipedia entry for `Multisets `_ - -* `Bag class `_ - in Smalltalk -* `C++ multisets `_ - tutorial with standalone examples - -* An early Python `Bag `_ recipe - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later - -* Use cases for multisets and mathematical operations on multisets. - Knuth, Donald. The Art of Computer Programming Volume II, - Section 4.6.3, Exercise 19 +.. seealso:: + + * `Counter class `_ + adapted for Python 2.5 and an early `Bag recipe + `_ for Python 2.4. + + * `Bag class `_ + in Smalltalk. + + * Wikipedia entry for `Multisets `_\. + + * `C++ multisets `_ + tutorial with examples. + + * For mathematical operations on multisets and their use cases, see + *Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19*\. + + * To enumerate all distinct multisets of a given size over a given set of + elements, see :func:`itertools.combinations_with_replacement`. + + map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC :class:`deque` objects 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 Tue Jan 27 23:14:53 2009 @@ -61,18 +61,64 @@ Functions --------- -.. function:: __import__(name, globals={}, locals={}, fromlist=\[\], level=0) +.. function:: __import__(name, globals={}, locals={}, fromlist=list(), level=0) An implementation of the built-in :func:`__import__` function. See the built-in function's documentation for usage instructions. .. function:: import_module(name, package=None) - Import a module. The ``name`` argument specifies what module to + Import a module. The *name* argument specifies what module to 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 in relative terms, then the *package* argument must be specified 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. + + +:mod:`importlib.machinery` -- Importers and path hooks +------------------------------------------------------ + +.. module:: importlib.machinery + :synopsis: Importers and path hooks + +This module contains the various objects that help :keyword:`import` +find and load modules. + +.. class:: BuiltinImporter + + :term:`Importer` for built-in modules. All known built-in modules are + listed in :data:`sys.builtin_module_names`. + + Only class methods are defined by this class to alleviate the need for + instantiation. + + .. classmethod:: find_module(fullname, path=None) + + Class method that allows this class to be a :term:`finder` for built-in + modules. + + .. classmethod:: load_module(fullname) + + Class method that allows this class to be a :term:`loader` for built-in + modules. + + +.. class:: FrozenImporter + + :term:`Importer` for frozen modules. + + Only class methods are defined by this class to alleviate the need for + instantiation. + + .. classmethod:: find_module(fullname, path=None) + + Class method that allows this class to be a :term:`finder` for frozen + modules. + + .. classmethod:: load_module(fullname) + + Class method that allows this class to be a :term:`loader` for frozen + modules. 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 Tue Jan 27 23:14:53 2009 @@ -328,59 +328,6 @@ ``len(b)``, since if the write fails, an :exc:`IOError` will be raised). -Raw File I/O ------------- - -.. class:: FileIO(name[, mode]) - - :class:`FileIO` represents a file containing bytes data. It implements - the :class:`RawIOBase` interface (and therefore the :class:`IOBase` - interface, too). - - The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, - or appending. The file will be created if it doesn't exist when opened for - writing or appending; it will be truncated when opened for writing. Add a - ``'+'`` to the mode to allow simultaneous reading and writing. - - In addition to the attributes and methods from :class:`IOBase` and - :class:`RawIOBase`, :class:`FileIO` provides the following data - attributes and methods: - - .. attribute:: mode - - The mode as given in the constructor. - - .. attribute:: name - - The file name. This is the file descriptor of the file when no name is - given in the constructor. - - .. method:: read([n]) - - Read and return at most *n* bytes. Only one system call is made, so it is - possible that less data than was requested is returned. Use :func:`len` - on the returned bytes object to see how many bytes were actually returned. - (In non-blocking mode, ``None`` is returned when no data is available.) - - .. method:: readall() - - Read and return the entire file's contents in a single bytes object. As - much as immediately available is returned in non-blocking mode. If the - EOF has been reached, ``b''`` is returned. - - .. method:: write(b) - - Write the bytes or bytearray object, *b*, to the file, and return - the number actually written. Only one system call is made, so it - is possible that only some of the data is written. - - Note that the inherited ``readinto()`` method should not be used on - :class:`FileIO` objects. - - -Buffered Streams ----------------- - .. class:: BufferedIOBase Base class for streams that support buffering. It inherits :class:`IOBase`. @@ -438,6 +385,59 @@ underlying raw stream cannot accept more data at the moment. +Raw File I/O +------------ + +.. class:: FileIO(name[, mode]) + + :class:`FileIO` represents a file containing bytes data. It implements + the :class:`RawIOBase` interface (and therefore the :class:`IOBase` + interface, too). + + The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, + or appending. The file will be created if it doesn't exist when opened for + writing or appending; it will be truncated when opened for writing. Add a + ``'+'`` to the mode to allow simultaneous reading and writing. + + In addition to the attributes and methods from :class:`IOBase` and + :class:`RawIOBase`, :class:`FileIO` provides the following data + attributes and methods: + + .. attribute:: mode + + The mode as given in the constructor. + + .. attribute:: name + + The file name. This is the file descriptor of the file when no name is + given in the constructor. + + .. method:: read([n]) + + Read and return at most *n* bytes. Only one system call is made, so it is + possible that less data than was requested is returned. Use :func:`len` + on the returned bytes object to see how many bytes were actually returned. + (In non-blocking mode, ``None`` is returned when no data is available.) + + .. method:: readall() + + Read and return the entire file's contents in a single bytes object. As + much as immediately available is returned in non-blocking mode. If the + EOF has been reached, ``b''`` is returned. + + .. method:: write(b) + + Write the bytes or bytearray object, *b*, to the file, and return + the number actually written. Only one system call is made, so it + is possible that only some of the data is written. + + Note that the inherited ``readinto()`` method should not be used on + :class:`FileIO` objects. + + +Buffered Streams +---------------- + .. class:: BytesIO([initial_bytes]) A stream implementation using an in-memory bytes buffer. It inherits 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 Tue Jan 27 23:14:53 2009 @@ -133,6 +133,67 @@ The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` or zero when ``r > n``. +.. function:: combinations_with_replacement(iterable, r) + + Return *r* length subsequences of elements from the input *iterable* + allowing individual elements to be repeated more than once. + + Combinations are emitted in lexicographic sort order. So, if the + input *iterable* is sorted, the combination tuples will be produced + in sorted order. + + Elements are treated as unique based on their position, not on their + value. So if the input elements are unique, the generated combinations + will also be unique. + + Equivalent to:: + + def combinations_with_replacement(iterable, r): + # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + The code for :func:`combinations_with_replacement` can be also expressed as + a subsequence of :func:`product` after filtering entries where the elements + are not in sorted order (according to their position in the input pool):: + + def combinations_with_replacement(iterable, r): + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``. + + .. versionadded:: 2.7 + +.. function:: compress(data, selectors) + + Make an iterator that filters elements from *data* returning only those that + have a corresponding element in *selectors* that evaluates to ``True``. + Stops when either the *data* or *selectors* iterables have been exhausted. + Equivalent to:: + + def compress(data, selectors): + # 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 + + .. function:: count([n]) Make an iterator that returns consecutive integers starting with *n*. If not @@ -184,6 +245,20 @@ for x in iterable: yield x +.. function:: filterfalse(predicate, iterable) + + Make an iterator that filters elements from iterable returning only those for + which the predicate is ``False``. If *predicate* is ``None``, return the items + that are false. Equivalent to:: + + def filterfalse(predicate, iterable): + # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 + if predicate is None: + predicate = bool + for x in iterable: + if not predicate(x): + yield x + .. function:: groupby(iterable[, key]) @@ -237,21 +312,6 @@ self.currkey = self.keyfunc(self.currvalue) -.. function:: filterfalse(predicate, iterable) - - Make an iterator that filters elements from iterable returning only those for - which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: - - def filterfalse(predicate, iterable): - # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 - if predicate is None: - predicate = bool - for x in iterable: - if not predicate(x): - yield x - - .. function:: islice(iterable, [start,] stop [, step]) Make an iterator that returns selected elements from the iterable. If *start* is @@ -281,30 +341,6 @@ then the step defaults to one. -.. function:: zip_longest(*iterables[, fillvalue]) - - Make an iterator that aggregates elements from each of the iterables. If the - iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: - - def zip_longest(*args, fillvalue=None): - # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- - def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): - yield counter() # yields the fillvalue, or raises IndexError - fillers = repeat(fillvalue) - iters = [chain(it, sentinel(), fillers) for it in args] - try: - for tup in zip(*iters): - yield tup - except IndexError: - pass - - If one of the iterables is potentially infinite, then the :func:`zip_longest` - function should be wrapped with something that limits the number of calls - (for example :func:`islice` or :func:`takewhile`). If not specified, - *fillvalue* defaults to ``None``. - - .. function:: permutations(iterable[, r]) Return successive *r* length permutations of elements in the *iterable*. @@ -464,6 +500,30 @@ is faster to use :func:`list` instead of :func:`tee`. +.. function:: zip_longest(*iterables[, fillvalue]) + + Make an iterator that aggregates elements from each of the iterables. If the + iterables are of uneven length, missing values are filled-in with *fillvalue*. + Iteration continues until the longest iterable is exhausted. Equivalent to:: + + def zip_longest(*args, fillvalue=None): + # zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- + def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): + yield counter() # yields the fillvalue, or raises IndexError + fillers = repeat(fillvalue) + iters = [chain(it, sentinel(), fillers) for it in args] + try: + for tup in zip(*iters): + yield tup + except IndexError: + pass + + If one of the iterables is potentially infinite, then the :func:`zip_longest` + function should be wrapped with something that limits the number of calls + (for example :func:`islice` or :func:`takewhile`). If not specified, + *fillvalue* defaults to ``None``. + + .. _itertools-example: Examples @@ -574,7 +634,7 @@ def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n - return zip_longest(fillvalue=fillvalue, *args) + return zip_longest(*args, fillvalue=fillvalue) def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" @@ -590,31 +650,9 @@ nexts = cycle(islice(nexts, pending)) def powerset(iterable): - "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" - # Recipe credited to Eric Raymond - pairs = [(2**i, x) for i, x in enumerate(iterable)] - for n in xrange(2**len(pairs)): - yield set(x for m, x in pairs if m&n) - - def compress(data, selectors): - "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" - return (d for d, s in zip(data, selectors) if s) - - def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" - # number items returned: (n+r-1)! / r! / (n-1)! - pool = tuple(iterable) - n = len(pool) - indices = [0] * r - yield tuple(pool[i] for i in indices) - while True: - for i in reversed(range(r)): - if indices[i] != n - 1: - break - else: - return - indices[i:] = [indices[i] + 1] * (r - i) - yield tuple(pool[i] for i in indices) + "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_everseen(iterable, key=None): "List unique elements, preserving order. Remember all elements ever seen." Modified: python/branches/io-c/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/io-c/Doc/library/multiprocessing.rst (original) +++ python/branches/io-c/Doc/library/multiprocessing.rst Tue Jan 27 23:14:53 2009 @@ -1522,7 +1522,9 @@ .. method:: apply(func[, args[, kwds]]) Call *func* with arguments *args* and keyword arguments *kwds*. It blocks - till the result is ready. + till the result is ready. Given this blocks - :meth:`apply_async` is better suited + for performing work in parallel. Additionally, the passed + in function is only executed in one of the workers of the pool. .. method:: apply_async(func[, args[, kwds[, callback]]]) @@ -1855,30 +1857,74 @@ Returns the logger used by :mod:`multiprocessing`. If necessary, a new one will be created. - When first created the logger has level :data:`logging.NOTSET` and has a - handler which sends output to :data:`sys.stderr` using format - ``'[%(levelname)s/%(processName)s] %(message)s'``. (The logger allows use of - the non-standard ``'%(processName)s'`` format.) Message sent to this logger - will not by default propagate to the root logger. + When first created the logger has level :data:`logging.NOTSET` and no + default handler. Messages sent to this logger will not by default propagate + to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherited. +.. currentmodule:: multiprocessing +.. function:: log_to_stderr() + + This function performs a call to :func:`get_logger` but in addition to + returning the logger created by get_logger, it adds a handler which sends + output to :data:`sys.stderr` using format + ``'[%(levelname)s/%(processName)s] %(message)s'``. + Below is an example session with logging turned on:: >>> import multiprocessing, logging - >>> logger = multiprocessing.get_logger() + >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-1] child process calling self.run() - [INFO/SyncManager-1] manager bound to '\\\\.\\pipe\\pyc-2776-0-lj0tfa' + [INFO/SyncManager-1] created temp directory /.../pymp-Wh47O_ + [INFO/SyncManager-1] manager serving at '/.../listener-lWsERs' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-1] manager exiting with exitcode 0 +In addition to having these two logging functions, the multiprocessing also +exposes two additional logging level attributes. These are :const:`SUBWARNING` +and :const:`SUBDEBUG`. The table below illustrates where theses fit in the +normal level hierarchy. + ++----------------+----------------+ +| Level | Numeric value | ++================+================+ +| ``SUBWARNING`` | 25 | ++----------------+----------------+ +| ``SUBDEBUG`` | 5 | ++----------------+----------------+ + +For a full table of logging levels, see the :mod:`logging` module. + +These additional logging levels are used primarily for certain debug messages +within the multiprocessing module. Below is the same example as above, except +with :const:`SUBDEBUG` enabled:: + + >>> import multiprocessing, logging + >>> logger = multiprocessing.log_to_stderr() + >>> logger.setLevel(multiprocessing.SUBDEBUG) + >>> logger.warning('doomed') + [WARNING/MainProcess] doomed + >>> m = multiprocessing.Manager() + [INFO/SyncManager-1] child process calling self.run() + [INFO/SyncManager-1] created temp directory /.../pymp-djGBXN + [INFO/SyncManager-1] manager serving at '/.../pymp-djGBXN/listener-knBYGe' + >>> del m + [SUBDEBUG/MainProcess] finalizer calling ... + [INFO/MainProcess] sending shutdown message to manager + [DEBUG/SyncManager-1] manager received shutdown message + [SUBDEBUG/SyncManager-1] calling ... + [SUBDEBUG/SyncManager-1] calling + [SUBDEBUG/SyncManager-1] finalizer calling ... + [INFO/SyncManager-1] manager exiting with exitcode 0 The :mod:`multiprocessing.dummy` module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 Tue Jan 27 23:14:53 2009 @@ -221,12 +221,6 @@ Return the index of the first of occurrence of *b* in *a*. -.. function:: repeat(a, b) - __repeat__(a, b) - - Return ``a * b`` where *a* is a sequence and *b* is an integer. - - .. function:: setitem(a, b, c) __setitem__(a, b, c) @@ -294,13 +288,6 @@ ``a = ipow(a, b)`` is equivalent to ``a **= b``. -.. function:: irepeat(a, b) - __irepeat__(a, b) - - ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and - *b* is an integer. - - .. function:: irshift(a, b) __irshift__(a, b) @@ -324,67 +311,6 @@ ``a = ixor(a, b)`` is equivalent to ``a ^= b``. - -The :mod:`operator` module also defines a few predicates to test the type of -objects. - -.. XXX just remove them? -.. note:: - - Be careful not to misinterpret the results of these functions; none have any - measure of reliability with instance objects. - For example: - - >>> class C: - ... pass - ... - >>> import operator - >>> obj = C() - >>> operator.isMappingType(obj) - True - -.. note:: - - Since there are now abstract classes for collection types, you should write, - for example, ``isinstance(obj, collections.Mapping)`` and ``isinstance(obj, - collections.Sequence)``. - -.. function:: isMappingType(obj) - - 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) - - 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) - - 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__`. - - .. 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. @@ -513,8 +439,6 @@ +-----------------------+-------------------------+---------------------------------+ | Right Shift | ``a >> b`` | ``rshift(a, b)`` | +-----------------------+-------------------------+---------------------------------+ -| Sequence Repetition | ``seq * i`` | ``repeat(seq, i)`` | -+-----------------------+-------------------------+---------------------------------+ | String Formatting | ``s % obj`` | ``mod(s, obj)`` | +-----------------------+-------------------------+---------------------------------+ | Subtraction | ``a - b`` | ``sub(a, b)`` | Modified: python/branches/io-c/Doc/library/pickle.rst ============================================================================== --- python/branches/io-c/Doc/library/pickle.rst (original) +++ python/branches/io-c/Doc/library/pickle.rst Tue Jan 27 23:14:53 2009 @@ -98,8 +98,8 @@ There are currently 4 different protocols which can be used for pickling. -* Protocol version 0 is the original ASCII protocol and is backwards compatible - with earlier versions of Python. +* Protocol version 0 is the original human-readable protocol and is + backwards compatible with earlier versions of Python. * Protocol version 1 is the old binary format which is also compatible with earlier versions of Python. @@ -130,16 +130,6 @@ The highest protocol version available. This value can be passed as a *protocol* value. -.. note:: - - Be sure to always open pickle files created with protocols >= 1 in binary mode. - For the old ASCII-based pickle protocol 0 you can use either text mode or binary - mode as long as you stay consistent. - - A pickle file written with protocol 0 in binary mode will contain lone linefeeds - as line terminators and therefore will look "funny" when viewed in Notepad or - other editors which do not support this format. - .. data:: DEFAULT_PROTOCOL The default protocol used for pickling. May be less than HIGHEST_PROTOCOL. @@ -570,10 +560,8 @@ Here is a comprehensive example presenting how persistent ID can be used to pickle external objects by reference. -.. XXX Work around for some bug in sphinx/pygments. -.. highlightlang:: python .. literalinclude:: ../includes/dbpickle.py -.. highlightlang:: python3 + .. _pickle-state: @@ -725,46 +713,35 @@ .. _pickle-example: -Example -------- +Usage Examples +-------------- For the simplest code, use the :func:`dump` and :func:`load` functions. Note that a self-referencing list is pickled and restored correctly. :: import pickle - data1 = {'a': [1, 2.0, 3, 4+6j], - 'b': ("string", "string using Unicode features \u0394"), - 'c': None} - - selfref_list = [1, 2, 3] - selfref_list.append(selfref_list) - - output = open('data.pkl', 'wb') - - # Pickle dictionary using protocol 2. - pickle.dump(data1, output, 2) - - # Pickle the list using the highest protocol available. - pickle.dump(selfref_list, output, -1) - - output.close() + # An arbitrary collection of objects supported by pickle. + data = { + 'a': [1, 2.0, 3, 4+6j], + 'b': ("character string", b"byte string"), + 'c': set([None, True, False]) + } -The following example reads the resulting pickled data. When reading a -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. :: + with open('data.pickle', 'wb') as f: + # Pickle the 'data' dictionary using the highest protocol available. + pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) - import pprint, pickle - pkl_file = open('data.pkl', 'rb') +The following example reads the resulting pickled data. :: - data1 = pickle.load(pkl_file) - pprint.pprint(data1) + import pickle - data2 = pickle.load(pkl_file) - pprint.pprint(data2) + with open('data.pickle', 'rb') as f: + # The protocol version used is detected automatically, so we do not + # have to specify it. + data = pickle.load(f) - pkl_file.close() .. seealso:: 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 Tue Jan 27 23:14:53 2009 @@ -160,11 +160,12 @@ Run command with arguments and return its output as a byte string. - If the exit code was non-zero it raises a CalledProcessError. The - CalledProcessError object will have the return code in the returncode - attribute and output in the output attribute. + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + :exc:`CalledProcessError` object will have the return code in the + :attr:`returncode` + attribute and output in the :attr:`output` attribute. - The arguments are the same as for the Popen constructor. Example: + The arguments are the same as for the :class:`Popen` constructor. Example: >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' Modified: python/branches/io-c/Doc/library/symtable.rst ============================================================================== --- python/branches/io-c/Doc/library/symtable.rst (original) +++ python/branches/io-c/Doc/library/symtable.rst Tue Jan 27 23:14:53 2009 @@ -5,7 +5,7 @@ :synopsis: Interface to the compiler's internal symbol tables. .. moduleauthor:: Jeremy Hylton -.. sectionauthor:: Benjamin Peterson +.. sectionauthor:: Benjamin Peterson Symbol tables are generated by the compiler from AST just before bytecode is Modified: python/branches/io-c/Lib/collections.py ============================================================================== --- python/branches/io-c/Lib/collections.py (original) +++ python/branches/io-c/Lib/collections.py Tue Jan 27 23:14:53 2009 @@ -111,7 +111,7 @@ # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result @@ -255,8 +255,11 @@ if iterable is not None: if isinstance(iterable, Mapping): - for elem, count in iterable.items(): - self[elem] += count + if self: + for elem, count in iterable.items(): + self[elem] += count + else: + dict.update(self, iterable) # fast path when counter is empty else: for elem in iterable: self[elem] += 1 @@ -282,7 +285,6 @@ # Knuth TAOCP Volume II section 4.6.3 exercise 19 # and at http://en.wikipedia.org/wiki/Multiset # - # Results are undefined when inputs contain negative counts. # Outputs guaranteed to only include positive counts. # # To strip negative and zero counts, add-in an empty counter: @@ -314,8 +316,8 @@ if not isinstance(other, Counter): return NotImplemented result = Counter() - for elem, count in self.items(): - newcount = count - other[elem] + for elem in set(self) | set(other): + newcount = self[elem] - other[elem] if newcount > 0: result[elem] = newcount return result @@ -434,8 +436,6 @@ def __ge__(self, other): return self.data >= self.__cast(other) def __cast(self, other): return other.data if isinstance(other, UserList) else other - def __cmp__(self, other): - return cmp(self.data, self.__cast(other)) def __contains__(self, item): return item in self.data def __len__(self): return len(self.data) def __getitem__(self, i): return self.data[i] Modified: python/branches/io-c/Lib/ctypes/test/test_libc.py ============================================================================== --- python/branches/io-c/Lib/ctypes/test/test_libc.py (original) +++ python/branches/io-c/Lib/ctypes/test/test_libc.py Tue Jan 27 23:14:53 2009 @@ -5,6 +5,10 @@ lib = CDLL(_ctypes_test.__file__) +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + class LibTest(unittest.TestCase): def test_sqrt(self): lib.my_sqrt.argtypes = c_double, @@ -19,7 +23,7 @@ lib.my_qsort.restype = None def sort(a, b): - return cmp(a[0], b[0]) + return three_way_cmp(a[0], b[0]) chars = create_string_buffer("spam, spam, and spam") lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) Modified: python/branches/io-c/Lib/decimal.py ============================================================================== --- python/branches/io-c/Lib/decimal.py (original) +++ python/branches/io-c/Lib/decimal.py Tue Jan 27 23:14:53 2009 @@ -805,9 +805,16 @@ if self > other. This routine is for internal use only.""" if self._is_special or other._is_special: - return cmp(self._isinfinity(), other._isinfinity()) + self_inf = self._isinfinity() + other_inf = other._isinfinity() + if self_inf == other_inf: + return 0 + elif self_inf < other_inf: + return -1 + else: + return 1 - # check for zeros; note that cmp(0, -0) should return 0 + # check for zeros; Decimal('0') == Decimal('-0') if not self: if not other: return 0 @@ -827,7 +834,12 @@ if self_adjusted == other_adjusted: self_padded = self._int + '0'*(self._exp - other._exp) other_padded = other._int + '0'*(other._exp - self._exp) - return cmp(self_padded, other_padded) * (-1)**self._sign + if self_padded == other_padded: + return 0 + elif self_padded < other_padded: + return -(-1)**self._sign + else: + return (-1)**self._sign elif self_adjusted > other_adjusted: return (-1)**self._sign else: # self_adjusted < other_adjusted Modified: python/branches/io-c/Lib/distutils/ccompiler.py ============================================================================== --- python/branches/io-c/Lib/distutils/ccompiler.py (original) +++ python/branches/io-c/Lib/distutils/ccompiler.py Tue Jan 27 23:14:53 2009 @@ -1004,7 +1004,6 @@ # OS name mappings ('posix', 'unix'), ('nt', 'msvc'), - ('mac', 'mwerks'), ) @@ -1042,8 +1041,6 @@ "Mingw32 port of GNU C Compiler for Win32"), 'bcpp': ('bcppcompiler', 'BCPPCompiler', "Borland C++ Compiler"), - 'mwerks': ('mwerkscompiler', 'MWerksCompiler', - "MetroWerks CodeWarrior"), 'emx': ('emxccompiler', 'EMXCCompiler', "EMX port of GNU C Compiler for OS/2"), } 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 Tue Jan 27 23:14:53 2009 @@ -428,6 +428,10 @@ self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) Deleted: python/branches/io-c/Lib/distutils/mwerkscompiler.py ============================================================================== --- python/branches/io-c/Lib/distutils/mwerkscompiler.py Tue Jan 27 23:14:53 2009 +++ (empty file) @@ -1,245 +0,0 @@ -"""distutils.mwerkscompiler - -Contains MWerksCompiler, an implementation of the abstract CCompiler class -for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on -Windows.""" - -__revision__ = "$Id$" - -import sys, os -from distutils.errors import \ - DistutilsExecError, DistutilsPlatformError, \ - CompileError, LibError, LinkError -from distutils.ccompiler import \ - CCompiler, gen_preprocess_options, gen_lib_options -import distutils.util -import distutils.dir_util -from distutils import log - -class MWerksCompiler (CCompiler) : - """Concrete class that implements an interface to MetroWerks CodeWarrior, - as defined by the CCompiler abstract class.""" - - compiler_type = 'mwerks' - - # Just set this so CCompiler's constructor doesn't barf. We currently - # don't use the 'set_executables()' bureaucracy provided by CCompiler, - # as it really isn't necessary for this sort of single-compiler class. - # Would be nice to have a consistent interface with UnixCCompiler, - # though, so it's worth thinking about. - executables = {} - - # Private class data (need to distinguish C from C++ source for compiler) - _c_extensions = ['.c'] - _cpp_extensions = ['.cc', '.cpp', '.cxx'] - _rc_extensions = ['.r'] - _exp_extension = '.exp' - - # Needed for the filename generation methods provided by the - # base class, CCompiler. - src_extensions = (_c_extensions + _cpp_extensions + - _rc_extensions) - res_extension = '.rsrc' - obj_extension = '.obj' # Not used, really - static_lib_extension = '.lib' - shared_lib_extension = '.slb' - static_lib_format = shared_lib_format = '%s%s' - exe_extension = '' - - - def __init__ (self, - verbose=0, - dry_run=0, - force=0): - - CCompiler.__init__ (self, verbose, dry_run, force) - - - def compile (self, - sources, - output_dir=None, - macros=None, - include_dirs=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - depends=None): - (output_dir, macros, include_dirs) = \ - self._fix_compile_args (output_dir, macros, include_dirs) - self.__sources = sources - self.__macros = macros - self.__include_dirs = include_dirs - # Don't need extra_preargs and extra_postargs for CW - return [] - - def link (self, - target_desc, - objects, - output_filename, - output_dir=None, - libraries=None, - library_dirs=None, - runtime_library_dirs=None, - export_symbols=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - build_temp=None, - target_lang=None): - # First fixup. - (objects, output_dir) = self._fix_object_args (objects, output_dir) - (libraries, library_dirs, runtime_library_dirs) = \ - self._fix_lib_args (libraries, library_dirs, runtime_library_dirs) - - # First examine a couple of options for things that aren't implemented yet - if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT): - raise DistutilsPlatformError('Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac') - if runtime_library_dirs: - raise DistutilsPlatformError('Runtime library dirs not implemented yet') - if extra_preargs or extra_postargs: - raise DistutilsPlatformError('Runtime library dirs not implemented yet') - if len(export_symbols) != 1: - raise DistutilsPlatformError('Need exactly one export symbol') - # Next there are various things for which we need absolute pathnames. - # This is because we (usually) create the project in a subdirectory of - # where we are now, and keeping the paths relative is too much work right - # now. - sources = [self._filename_to_abs(s) for s in self.__sources] - include_dirs = [self._filename_to_abs(d) for d in self.__include_dirs] - if objects: - objects = [self._filename_to_abs(o) for o in objects] - else: - objects = [] - if build_temp: - build_temp = self._filename_to_abs(build_temp) - else: - build_temp = os.curdir() - if output_dir: - output_filename = os.path.join(output_dir, output_filename) - # The output filename needs special handling: splitting it into dir and - # filename part. Actually I'm not sure this is really needed, but it - # can't hurt. - output_filename = self._filename_to_abs(output_filename) - output_dir, output_filename = os.path.split(output_filename) - # Now we need the short names of a couple of things for putting them - # into the project. - if output_filename[-8:] == '.ppc.slb': - basename = output_filename[:-8] - elif output_filename[-11:] == '.carbon.slb': - basename = output_filename[:-11] - else: - basename = os.path.strip(output_filename)[0] - projectname = basename + '.mcp' - targetname = basename - xmlname = basename + '.xml' - exportname = basename + '.mcp.exp' - prefixname = 'mwerks_%s_config.h'%basename - # Create the directories we need - distutils.dir_util.mkpath(build_temp, dry_run=self.dry_run) - distutils.dir_util.mkpath(output_dir, dry_run=self.dry_run) - # And on to filling in the parameters for the project builder - settings = {} - settings['mac_exportname'] = exportname - settings['mac_outputdir'] = output_dir - settings['mac_dllname'] = output_filename - settings['mac_targetname'] = targetname - settings['sysprefix'] = sys.prefix - settings['mac_sysprefixtype'] = 'Absolute' - sourcefilenames = [] - sourcefiledirs = [] - for filename in sources + objects: - dirname, filename = os.path.split(filename) - sourcefilenames.append(filename) - if not dirname in sourcefiledirs: - sourcefiledirs.append(dirname) - settings['sources'] = sourcefilenames - settings['libraries'] = libraries - settings['extrasearchdirs'] = sourcefiledirs + include_dirs + library_dirs - if self.dry_run: - print('CALLING LINKER IN', os.getcwd()) - for key, value in settings.items(): - print('%20.20s %s'%(key, value)) - return - # Build the export file - exportfilename = os.path.join(build_temp, exportname) - log.debug("\tCreate export file %s", exportfilename) - fp = open(exportfilename, 'w') - fp.write('%s\n'%export_symbols[0]) - fp.close() - # Generate the prefix file, if needed, and put it in the settings - if self.__macros: - prefixfilename = os.path.join(os.getcwd(), os.path.join(build_temp, prefixname)) - fp = open(prefixfilename, 'w') - fp.write('#include "mwerks_shcarbon_config.h"\n') - for name, value in self.__macros: - if value is None: - fp.write('#define %s\n'%name) - else: - fp.write('#define %s %s\n'%(name, value)) - fp.close() - settings['prefixname'] = prefixname - - # Build the XML file. We need the full pathname (only lateron, really) - # because we pass this pathname to CodeWarrior in an AppleEvent, and CW - # doesn't have a clue about our working directory. - xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname)) - log.debug("\tCreate XML file %s", xmlfilename) - import mkcwproject - xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings) - xmlbuilder.generate() - xmldata = settings['tmp_projectxmldata'] - fp = open(xmlfilename, 'w') - fp.write(xmldata) - fp.close() - # Generate the project. Again a full pathname. - projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname)) - log.debug('\tCreate project file %s', projectfilename) - mkcwproject.makeproject(xmlfilename, projectfilename) - # And build it - log.debug('\tBuild project') - mkcwproject.buildproject(projectfilename) - - def _filename_to_abs(self, filename): - # Some filenames seem to be unix-like. Convert to Mac names. -## if '/' in filename and ':' in filename: -## raise DistutilsPlatformError, 'Filename may be Unix or Mac style: %s'%filename -## if '/' in filename: -## filename = macurl2path(filename) - filename = distutils.util.convert_path(filename) - if not os.path.isabs(filename): - curdir = os.getcwd() - filename = os.path.join(curdir, filename) - # Finally remove .. components - components = filename.split(':') - for i in range(1, len(components)): - if components[i] == '..': - components[i] = '' - return ':'.join(components) - - def library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for libraries. - """ - return # XXXX Not correct... - - def runtime_library_dir_option (self, dir): - """Return the compiler option to add 'dir' to the list of - directories searched for runtime libraries. - """ - # Nothing needed or Mwerks/Mac. - return - - def library_option (self, lib): - """Return the compiler option to add 'dir' to the list of libraries - linked into the shared library or executable. - """ - return - - def find_library_file (self, dirs, lib, debug=0): - """Search the specified list of directories for a static or shared - library file 'lib' and return the full path to that file. If - 'debug' true, look for a debugging version (if that makes sense on - the current platform). Return None if 'lib' wasn't found in any of - the specified directories. - """ - return 0 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 Tue Jan 27 23:14:53 2009 @@ -4,10 +4,13 @@ import shutil import zipfile from os.path import join +import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase +from distutils.errors import DistutilsExecError +from distutils.spawn import spawn CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -35,6 +38,19 @@ 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: @@ -46,15 +62,7 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - if not os.path.exists(TEMP_PKG): - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - - # 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) + self._init_tmp_pkg() # creating VCS directories with some files in them os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) @@ -68,8 +76,6 @@ self._write(join(TEMP_PKG, 'somecode', '.git', 'ok'), 'xxx') - os.chdir(TEMP_PKG) - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -103,6 +109,55 @@ # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + def test_make_distribution(self): + + self._init_tmp_pkg() + + # 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 + + # 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' + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.run() + + # making sure we have two files + dist_folder = join(TEMP_PKG, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz'] ) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEquals(result, + ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_suite(): return unittest.makeSuite(sdistTestCase) 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 Tue Jan 27 23:14:53 2009 @@ -21,7 +21,7 @@ an equivalent string -- ie. one that will generate an equivalent version number instance) * __repr__ generates Python code to recreate the version number instance - * __cmp__ compares the current instance with either another instance + * _cmp compares the current instance with either another instance of the same class or a string (which will be parsed to an instance of the same class, thus must follow the same rules) """ @@ -32,7 +32,7 @@ """Abstract base class for version numbering classes. Just provides constructor (__init__) and reproducer (__repr__), because those seem to be the same for all version numbering classes; and route - rich comparisons to __cmp__. + rich comparisons to _cmp. """ def __init__ (self, vstring=None): @@ -43,37 +43,37 @@ return "%s ('%s')" % (self.__class__.__name__, str(self)) def __eq__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c == 0 def __ne__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c != 0 def __lt__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c < 0 def __le__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c <= 0 def __gt__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c > 0 def __ge__(self, other): - c = self.__cmp__(other) + c = self._cmp(other) if c is NotImplemented: return c return c >= 0 @@ -91,7 +91,7 @@ # (if not identical to) the string supplied to parse # __repr__ (self) - generate Python code to recreate # the instance -# __cmp__ (self, other) - compare two version numbers ('other' may +# _cmp (self, other) - compare two version numbers ('other' may # be an unparsed version string, or another # instance of your version class) @@ -169,30 +169,39 @@ return vstring - def __cmp__ (self, other): + def _cmp (self, other): if isinstance(other, str): other = StrictVersion(other) - compare = cmp(self.version, other.version) - if (compare == 0): # have to compare prerelease - - # case 1: neither has prerelease; they're equal - # case 2: self has prerelease, other doesn't; other is greater - # case 3: self doesn't have prerelease, other does: self is greater - # case 4: both have prerelease: must compare them! + if self.version != other.version: + # numeric versions don't match + # prerelease stuff doesn't matter + if self.version < other.version: + return -1 + else: + return 1 - if (not self.prerelease and not other.prerelease): + # have to compare prerelease + # case 1: neither has prerelease; they're equal + # case 2: self has prerelease, other doesn't; other is greater + # case 3: self doesn't have prerelease, other does: self is greater + # case 4: both have prerelease: must compare them! + + if (not self.prerelease and not other.prerelease): + return 0 + elif (self.prerelease and not other.prerelease): + return -1 + elif (not self.prerelease and other.prerelease): + return 1 + elif (self.prerelease and other.prerelease): + if self.prerelease == other.prerelease: return 0 - elif (self.prerelease and not other.prerelease): + elif self.prerelease < other.prerelease: return -1 - elif (not self.prerelease and other.prerelease): + else: return 1 - elif (self.prerelease and other.prerelease): - return cmp(self.prerelease, other.prerelease) - - else: # numeric versions don't match -- - return compare # prerelease stuff doesn't matter - + else: + assert False, "never get here" # end class StrictVersion @@ -325,7 +334,7 @@ return "LooseVersion ('%s')" % str(self) - def __cmp__ (self, other): + def _cmp (self, other): if isinstance(other, str): other = LooseVersion(other) Modified: python/branches/io-c/Lib/doctest.py ============================================================================== --- python/branches/io-c/Lib/doctest.py (original) +++ python/branches/io-c/Lib/doctest.py Tue Jan 27 23:14:53 2009 @@ -837,6 +837,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' # provide a default module name # Recursively expore `obj`, extracting DocTests. tests = [] @@ -1947,6 +1949,8 @@ globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) + if '__name__' not in globs: + globs['__name__'] = '__main__' if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) Modified: python/branches/io-c/Lib/heapq.py ============================================================================== --- python/branches/io-c/Lib/heapq.py (original) +++ python/branches/io-c/Lib/heapq.py Tue Jan 27 23:14:53 2009 @@ -1,4 +1,4 @@ -# -*- coding: Latin-1 -*- +# -*- coding: latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). @@ -262,7 +262,7 @@ # # Cutting the # of comparisons is important, since these routines have no # way to extract "the priority" from an array element, so that intelligence -# is likely to be hiding in custom __cmp__ methods, or in array elements +# is likely to be hiding in custom comparison methods, or in array elements # storing (priority, record) tuples. Comparisons are thus potentially # expensive. # Modified: python/branches/io-c/Lib/idlelib/PyShell.py ============================================================================== --- python/branches/io-c/Lib/idlelib/PyShell.py (original) +++ python/branches/io-c/Lib/idlelib/PyShell.py Tue Jan 27 23:14:53 2009 @@ -963,15 +963,6 @@ COPYRIGHT = \ 'Type "copyright", "credits" or "license()" for more information.' - firewallmessage = """ - **************************************************************** - Personal firewall software may warn about the connection IDLE - makes to its subprocess using this computer's internal loopback - interface. This connection is not visible on any external - interface and no data is sent to or received from the Internet. - **************************************************************** - """ - def begin(self): self.text.mark_set("iomark", "insert") self.resetoutput() @@ -983,9 +974,8 @@ return False else: nosub = "==== No Subprocess ====" - self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % - (sys.version, sys.platform, self.COPYRIGHT, - self.firewallmessage, idlever.IDLE_VERSION, nosub)) + self.write("Python %s on %s\n%s\n%s" % + (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.showprompt() import tkinter tkinter._default_root = None # 03Jan04 KBK What's this? Modified: python/branches/io-c/Lib/importlib/NOTES ============================================================================== --- python/branches/io-c/Lib/importlib/NOTES (original) +++ python/branches/io-c/Lib/importlib/NOTES Tue Jan 27 23:14:53 2009 @@ -1,19 +1,15 @@ to do ///// -* Expose resolve_name(). +* Use test.loader_tests -* Backport to Python 2.7. - + import_module - + resolve_name - -* Create reasonable base tests that all finders and loaders must pass so - that various implementations can just subclass as needed. - -* Expose built-in and frozen importers. - + Make staticmethods so that class can be used directly. + + 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). @@ -22,53 +18,76 @@ - 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. -* Implement PEP 302 protocol for loaders (should just be a matter of testing). - + Built-in. - + Frozen. - + Extension. - + Source/bytecode. - * 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. + + Frozen. + + Extension. + + Source/bytecode. + * Public API to expose (w/ docs!) + + abc + - Finder + * find_module + - Loader + * load_module + - ResourceLoader(Loader) + * get_data + - InspectLoader(Loader) + * is_package * get_code * get_source + - (?) SourceLoader(ResourceLoader) + * source_path * bytecode_path * write_bytecode + + util + - get_module decorator (new name) - check_name decorator (new name) - + hooks (?) + - resolve_name + + + machinery + - (?) Chained path hook/finder - BuiltinImporter - FrozenImporter - (?) FileFinder - Extensions importers + * ExtensionFinder * (?) Loader + - Source/bytecode importers + * SourceFinder * (?) Loader 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 Tue Jan 27 23:14:53 2009 @@ -38,6 +38,8 @@ __builtins__['__import__'] = original__import__ +# Bootstrap help ##################################################### + def _case_ok(directory, check): """Check if the directory contains something matching 'check'. @@ -110,6 +112,8 @@ marshal._r_long = _r_long +# Public API ######################################################### + __import__ = _bootstrap.Import().__call__ @@ -134,5 +138,5 @@ return sys.modules[name] - +# XXX This should go away once the public API is done. from ._bootstrap import * 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 Tue Jan 27 23:14:53 2009 @@ -90,60 +90,17 @@ self.obj.close() -class _BuiltinFrozenBaseLoader(object): +class BuiltinImporter: - """Base class for meta_path loaders for built-in and frozen modules. + """Meta path loader for built-in modules. - Subclasses must implement: - - * _find(fullname:str) -> bool - Finder which returns whether the class can handle the module. - - * _load(fullname:str) -> module - Loader which returns the loaded module. The check for sys.modules - does not need to be handled by this method. - - * type_:str - Name of the type of module being handled. Used in error messages. + All methods are either class or static methods, allowing direct use of the + class. """ - def find_module(self, fullname, path=None): - """Find a module.""" - if not self._find(fullname): - return None - return self - - def load_module(self, fullname): - """Load a module.""" - try: - return sys.modules[fullname] - except KeyError: - pass - mod = self._load(fullname) - if not mod: - raise ImportError("expected {0} module not " - "loaded".format(self.type_)) - return mod - - -class BuiltinImporter(_BuiltinFrozenBaseLoader): - - """Meta path loader for built-in modules.""" - - type_ = "built-in" - - def __init__(self): - """Set the methods needed by the class. - - Cannot be set at the class level because the imp module is not - necessarily injected until after the class is created. - - """ - self._find = imp.is_builtin - self._load = imp.init_builtin - - def find_module(self, fullname, path=None): + @classmethod + def find_module(cls, fullname, path=None): """Try to find the built-in module. If 'path' is ever specified then the search is considered a failure. @@ -151,36 +108,36 @@ """ if path is not None: return None - return super().find_module(fullname, path) + return cls if imp.is_builtin(fullname) else None - def load_module(self, fullname): + @classmethod + 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 super().load_module(fullname) - + return imp.init_builtin(fullname) -class FrozenImporter(_BuiltinFrozenBaseLoader): - """Meta path class for importing frozen modules.""" +class FrozenImporter: - type_ = 'frozen' + """Meta path class for importing frozen modules. - def __init__(self): - """Specify the methods needed by the superclass. + All methods are either class or static method to allow direct use of the + class. - Because imp may not be injected until after class creation these - methods cannot be set at the class level. + """ - """ - self._find = imp.is_frozen - self._load = imp.init_frozen + @classmethod + def find_module(cls, fullname, path=None): + """Find a frozen module.""" + return cls if imp.is_frozen(fullname) else None - def load_module(self, fullname): + @classmethod + def load_module(cls, fullname): """Load a frozen module.""" - if not self.find_module(fullname): + if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - return super().load_module(fullname) + return imp.init_frozen(fullname) class ChainedImporter(object): @@ -707,7 +664,7 @@ """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() + self.extended_meta_path = BuiltinImporter, FrozenImporter else: self.extended_meta_path = extended_meta_path self.default_path_hook = default_path_hook 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 Tue Jan 27 23:14:53 2009 @@ -1,29 +1,48 @@ -import importlib +from importlib import machinery +from .. import finder_tests from .. import support import sys import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test find_module() for built-in modules.""" assert 'errno' in sys.builtin_module_names name = 'errno' - find_module = staticmethod(lambda name, path=None: - importlib.BuiltinImporter().find_module(name, path)) - - - def test_find_module(self): + def test_module(self): # Common case. with support.uncache(self.name): - self.assert_(self.find_module(self.name)) + self.assert_(machinery.BuiltinImporter.find_module(self.name)) + + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_module_in_package(self): + # Built-in modules cannobt be in a package. + pass + + def test_package_in_package(self): + # Built-in modules cannot be a package. + pass + + def test_package_over_module(self): + # Built-in modules cannot be a package. + pass + + def test_failure(self): + assert 'importlib' not in sys.builtin_module_names + loader = machinery.BuiltinImporter.find_module('importlib') + self.assert_(loader is None) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with support.uncache(self.name): - self.assert_(self.find_module(self.name, ['pkg']) is None) + 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 Tue Jan 27 23:14:53 2009 @@ -1,4 +1,5 @@ import importlib +from importlib import machinery from .. import support import sys @@ -23,7 +24,7 @@ self.assert_(module.__name__ in sys.modules) load_module = staticmethod(lambda name: - importlib.BuiltinImporter().load_module(name)) + machinery.BuiltinImporter.load_module(name)) def test_load_module(self): # Common case. 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 Tue Jan 27 23:14:53 2009 @@ -1,9 +1,10 @@ import importlib +from .. import finder_tests from . import test_path_hook import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test the finder for extension modules.""" @@ -11,9 +12,25 @@ importer = importlib.ExtensionFileImporter(test_path_hook.PATH) return importer.find_module(fullname) - def test_success(self): + def test_module(self): self.assert_(self.find_module(test_path_hook.NAME)) + def test_package(self): + # Extension modules cannot be an __init__ for a package. + pass + + def test_module_in_package(self): + # No extension module in a package available for testing. + pass + + def test_package_in_package(self): + # Extension modules cannot be an __init__ for a package. + pass + + def test_package_over_module(self): + # Extension modules cannot be an __init__ for a package. + pass + def test_failure(self): self.assert_(self.find_module('asdfjkl;') is None) Modified: python/branches/io-c/Lib/importlib/test/finder_tests.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/finder_tests.py (original) +++ python/branches/io-c/Lib/importlib/test/finder_tests.py Tue Jan 27 23:14:53 2009 @@ -1,39 +1,39 @@ -# top-level. -# Package. -# module in pacakge. -# Package within a package. -# At least one tests with 'path'. -# Module that is not handled. - +import abc import unittest -class FinderTests(unittest.TestCase): +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. - raise NotImplementedError + pass + @abc.abstractmethod def test_package(self): # Test importing a package. - raise NotImplementedError + 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. - raise NotImplementedError + 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. - raise NotImplementedError + pass + @abc.abstractmethod def test_package_over_module(self): # Test that packages are chosen over modules. - raise NotImplementedError + pass + @abc.abstractmethod def test_failure(self): # Test trying to find a module that cannot be handled. - raise NotImplementedError + pass 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 Tue Jan 27 23:14:53 2009 @@ -1,19 +1,17 @@ -import importlib -from ..builtin import test_finder -from .. import support +from ... import machinery +from .. import finder_tests import unittest -class FinderTests(test_finder.FinderTests): +class FinderTests(finder_tests.FinderTests): """Test finding frozen modules.""" def find(self, name, path=None): - finder = importlib.FrozenImporter() + finder = machinery.FrozenImporter return finder.find_module(name, path) - def test_module(self): name = '__hello__' loader = self.find(name) @@ -28,6 +26,11 @@ self.assert_(hasattr(loader, 'load_module')) def test_package_in_package(self): + # No frozen package within another package to test with. + pass + + def test_package_over_module(self): + # No easy way to test. pass def test_failure(self): 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 Tue Jan 27 23:14:53 2009 @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from ..builtin import test_loader @@ -6,7 +6,7 @@ name = '__phello__' load_module = staticmethod(lambda name: - importlib.FrozenImporter().load_module(name)) + machinery.FrozenImporter.load_module(name)) verification = {'__name__': '__phello__', '__file__': '', '__package__': None, '__path__': ['__phello__']} Modified: python/branches/io-c/Lib/locale.py ============================================================================== --- python/branches/io-c/Lib/locale.py (original) +++ python/branches/io-c/Lib/locale.py Tue Jan 27 23:14:53 2009 @@ -31,7 +31,7 @@ """ strcoll(string,string) -> int. Compares two strings according to the locale. """ - return cmp(a,b) + return (a > b) - (a < b) def _strxfrm(s): """ strxfrm(string) -> string. @@ -187,7 +187,7 @@ formatted = _group(formatted, monetary=monetary)[0] return formatted -import re, operator +import re, collections _percent_re = re.compile(r'%(?:\((?P.*?)\))?' r'(?P[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]') @@ -207,7 +207,7 @@ del new_val[i+1:i+1+starcount] i += (1 + starcount) val = tuple(new_val) - elif operator.isMappingType(val): + elif isinstance(val, collections.Mapping): for perc in percents: key = perc.group("key") val[key] = format(perc.group(), val[key], grouping) 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 Tue Jan 27 23:14:53 2009 @@ -18,7 +18,7 @@ Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ @@ -43,8 +43,8 @@ __author__ = "Vinay Sajip " __status__ = "production" -__version__ = "0.5.0.6" -__date__ = "03 December 2008" +__version__ = "0.5.0.7" +__date__ = "20 January 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -737,7 +737,6 @@ if strm is None: strm = sys.stderr self.stream = strm - self.formatter = None def flush(self): """ @@ -792,10 +791,12 @@ self.mode = mode self.encoding = encoding if delay: + #We don't open the stream, but we still need to call the + #Handler constructor to set level, formatter, lock etc. + Handler.__init__(self) self.stream = None else: - stream = self._open() - StreamHandler.__init__(self, stream) + StreamHandler.__init__(self, self._open()) def close(self): """ @@ -827,8 +828,7 @@ constructor, open it before calling the superclass's emit. """ if self.stream is None: - stream = self._open() - StreamHandler.__init__(self, stream) + self.stream = self._open() StreamHandler.emit(self, record) #--------------------------------------------------------------------------- Modified: python/branches/io-c/Lib/logging/handlers.py ============================================================================== --- python/branches/io-c/Lib/logging/handlers.py (original) +++ python/branches/io-c/Lib/logging/handlers.py Tue Jan 27 23:14:53 2009 @@ -19,9 +19,9 @@ based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. -To use, simply 'import logging' and log away! +To use, simply 'import logging.handlers' and log away! """ import logging, socket, os, pickle, struct, time, re @@ -112,8 +112,8 @@ """ Do a rollover, as described in __init__(). """ - - self.stream.close() + if self.stream: + self.stream.close() if self.backupCount > 0: for i in range(self.backupCount - 1, 0, -1): sfn = "%s.%d" % (self.baseFilename, i) @@ -138,6 +138,8 @@ Basically, see if the supplied record would cause the file to exceed the size limit we have. """ + if self.stream is None: # delay was set... + self.stream = self._open() if self.maxBytes > 0: # are we rolling over? msg = "%s\n" % self.format(record) self.stream.seek(0, 2) #due to non-posix-compliant Windows feature @@ -302,7 +304,8 @@ then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. """ - self.stream.close() + if self.stream: + self.stream.close() # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: Modified: python/branches/io-c/Lib/multiprocessing/__init__.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/__init__.py (original) +++ python/branches/io-c/Lib/multiprocessing/__init__.py Tue Jan 27 23:14:53 2009 @@ -48,7 +48,7 @@ 'allow_connection_pickling', 'BufferTooShort', 'TimeoutError', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array', - 'RawValue', 'RawArray' + 'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING', ] __author__ = 'R. Oudkerk (r.m.oudkerk at gmail.com)' @@ -61,6 +61,7 @@ import sys from multiprocessing.process import Process, current_process, active_children +from multiprocessing.util import SUBDEBUG, SUBWARNING # # Exceptions Modified: python/branches/io-c/Lib/multiprocessing/managers.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/managers.py (original) +++ python/branches/io-c/Lib/multiprocessing/managers.py Tue Jan 27 23:14:53 2009 @@ -139,7 +139,7 @@ self.listener = Listener(address=address, backlog=5) self.address = self.listener.address - self.id_to_obj = {0: (None, ())} + self.id_to_obj = {'0': (None, ())} self.id_to_refcount = {} self.mutex = threading.RLock() self.stop = 0 @@ -301,7 +301,7 @@ keys = list(self.id_to_obj.keys()) keys.sort() for ident in keys: - if ident != 0: + if ident != '0': result.append(' %s: refcount=%s\n %s' % (ident, self.id_to_refcount[ident], str(self.id_to_obj[ident][0])[:75])) @@ -313,7 +313,7 @@ ''' Number of shared objects ''' - return len(self.id_to_obj) - 1 # don't count ident=0 + return len(self.id_to_obj) - 1 # don't count ident='0' def shutdown(self, c): ''' Modified: python/branches/io-c/Lib/multiprocessing/util.py ============================================================================== --- python/branches/io-c/Lib/multiprocessing/util.py (original) +++ python/branches/io-c/Lib/multiprocessing/util.py Tue Jan 27 23:14:53 2009 @@ -17,7 +17,8 @@ __all__ = [ 'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger', 'log_to_stderr', 'get_temp_dir', 'register_after_fork', - 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal' + 'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal', + 'SUBDEBUG', 'SUBWARNING', ] # @@ -57,19 +58,27 @@ Returns logger used by multiprocessing ''' global _logger + import logging, atexit - if not _logger: - import logging, atexit + logging._acquireLock() + try: + if not _logger: + + _logger = logging.getLogger(LOGGER_NAME) + _logger.propagate = 0 + logging.addLevelName(SUBDEBUG, 'SUBDEBUG') + logging.addLevelName(SUBWARNING, 'SUBWARNING') + + # XXX multiprocessing should cleanup before logging + if hasattr(atexit, 'unregister'): + atexit.unregister(_exit_function) + atexit.register(_exit_function) + else: + atexit._exithandlers.remove((_exit_function, (), {})) + atexit._exithandlers.append((_exit_function, (), {})) - # XXX multiprocessing should cleanup before logging - if hasattr(atexit, 'unregister'): - atexit.unregister(_exit_function) - atexit.register(_exit_function) - else: - atexit._exithandlers.remove((_exit_function, (), {})) - atexit._exithandlers.append((_exit_function, (), {})) - - _logger = logging.getLogger(LOGGER_NAME) + finally: + logging._releaseLock() return _logger @@ -79,14 +88,17 @@ ''' global _log_to_stderr import logging + logger = get_logger() formatter = logging.Formatter(DEFAULT_LOGGING_FORMAT) handler = logging.StreamHandler() handler.setFormatter(formatter) logger.addHandler(handler) - if level is not None: + + if level: logger.setLevel(level) _log_to_stderr = True + return _logger # # Function returning a temp directory which will be removed on exit Modified: python/branches/io-c/Lib/pickletools.py ============================================================================== --- python/branches/io-c/Lib/pickletools.py (original) +++ python/branches/io-c/Lib/pickletools.py Tue Jan 27 23:14:53 2009 @@ -2128,11 +2128,11 @@ Exercise the INST/OBJ/BUILD family. ->>> import random ->>> dis(pickle.dumps(random.getrandbits, 0)) - 0: c GLOBAL 'random getrandbits' - 20: p PUT 0 - 23: . STOP +>>> import pickletools +>>> dis(pickle.dumps(pickletools.dis, 0)) + 0: c GLOBAL 'pickletools dis' + 17: p PUT 0 + 20: . STOP highest protocol among opcodes = 0 >>> from pickletools import _Example Modified: python/branches/io-c/Lib/pydoc.py ============================================================================== --- python/branches/io-c/Lib/pydoc.py (original) +++ python/branches/io-c/Lib/pydoc.py Tue Jan 27 23:14:53 2009 @@ -1643,7 +1643,7 @@ 'SPECIALMETHODS': ('specialnames', 'BASICMETHODS ATTRIBUTEMETHODS ' 'CALLABLEMETHODS SEQUENCEMETHODS1 MAPPINGMETHODS ' 'SEQUENCEMETHODS2 NUMBERMETHODS CLASSES'), - 'BASICMETHODS': ('customization', 'cmp hash repr str SPECIALMETHODS'), + 'BASICMETHODS': ('customization', 'hash repr str SPECIALMETHODS'), 'ATTRIBUTEMETHODS': ('attribute-access', 'ATTRIBUTES SPECIALMETHODS'), 'CALLABLEMETHODS': ('callable-types', 'CALLS SPECIALMETHODS'), 'SEQUENCEMETHODS': ('sequence-types', 'SEQUENCES SEQUENCEMETHODS2 ' Modified: python/branches/io-c/Lib/sqlite3/test/hooks.py ============================================================================== --- python/branches/io-c/Lib/sqlite3/test/hooks.py (original) +++ python/branches/io-c/Lib/sqlite3/test/hooks.py Tue Jan 27 23:14:53 2009 @@ -42,7 +42,7 @@ def CheckCreateCollationNotAscii(self): con = sqlite.connect(":memory:") try: - con.create_collation("coll?", cmp) + con.create_collation("coll?", lambda x, y: (x > y) - (x < y)) self.fail("should have raised a ProgrammingError") except sqlite.ProgrammingError as e: pass @@ -52,7 +52,7 @@ return def mycoll(x, y): # reverse order - return -cmp(x, y) + return -((x > y) - (x < y)) con = sqlite.connect(":memory:") con.create_collation("mycoll", mycoll) @@ -82,8 +82,8 @@ Verify that the last one is actually used. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) - con.create_collation("mycoll", lambda x, y: -cmp(x, y)) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) + con.create_collation("mycoll", lambda x, y: -((x > y) - (x < y))) result = con.execute(""" select x from (select 'a' as x union select 'b' as x) order by x collate mycoll """).fetchall() @@ -96,7 +96,7 @@ to use it. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) con.create_collation("mycoll", None) try: con.execute("select 'a' as x union select 'b' as x order by x collate mycoll") Modified: python/branches/io-c/Lib/test/crashers/loosing_mro_ref.py ============================================================================== --- python/branches/io-c/Lib/test/crashers/loosing_mro_ref.py (original) +++ python/branches/io-c/Lib/test/crashers/loosing_mro_ref.py Tue Jan 27 23:14:53 2009 @@ -10,7 +10,7 @@ def __hash__(self): return hash('mykey') - def __cmp__(self, other): + def __eq__(self, other): # the following line decrefs the previous X.__mro__ X.__bases__ = (Base2,) # trash all tuples of length 3, to make sure that the items of @@ -18,7 +18,7 @@ z = [] for i in range(1000): z.append((i, None, None)) - return -1 + return 0 class Base(object): Modified: python/branches/io-c/Lib/test/list_tests.py ============================================================================== --- python/branches/io-c/Lib/test/list_tests.py (original) +++ python/branches/io-c/Lib/test/list_tests.py Tue Jan 27 23:14:53 2009 @@ -439,13 +439,24 @@ self.assertRaises(TypeError, u.sort, 42, 42) def revcmp(a, b): - return cmp(b, a) + if a == b: + return 0 + elif a < b: + return 1 + else: # a > b + return -1 u.sort(key=CmpToKey(revcmp)) self.assertEqual(u, self.type2test([2,1,0,-1,-2])) # The following dumps core in unpatched Python 1.5: def myComparison(x,y): - return cmp(x%3, y%7) + xmod, ymod = x%3, y%7 + if xmod == ymod: + return 0 + elif xmod < ymod: + return -1 + else: # xmod > ymod + return 1 z = self.type2test(range(12)) z.sort(key=CmpToKey(myComparison)) @@ -453,7 +464,12 @@ def selfmodifyingComparison(x,y): z.append(1) - return cmp(x, y) + if x == y: + return 0 + elif x < y: + return -1 + else: # x > y + return 1 self.assertRaises(ValueError, z.sort, key=CmpToKey(selfmodifyingComparison)) self.assertRaises(TypeError, z.sort, 42, 42, 42, 42) Modified: python/branches/io-c/Lib/test/pickletester.py ============================================================================== --- python/branches/io-c/Lib/test/pickletester.py (original) +++ python/branches/io-c/Lib/test/pickletester.py Tue Jan 27 23:14:53 2009 @@ -545,6 +545,16 @@ got = self.loads(p) self.assertEqual(n, got) + def test_float(self): + test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5, + 3.14, 263.44582062374053, 6.022e23, 1e30] + test_values = test_values + [-x for x in test_values] + for proto in protocols: + for value in test_values: + pickle = self.dumps(value, proto) + got = self.loads(pickle) + self.assertEqual(value, got) + @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_float_format(self): # make sure that floats are formatted locale independent with proto 0 Modified: python/branches/io-c/Lib/test/test_array.py ============================================================================== --- python/branches/io-c/Lib/test/test_array.py (original) +++ python/branches/io-c/Lib/test/test_array.py Tue Jan 27 23:14:53 2009 @@ -725,8 +725,8 @@ self.assertRaises(BufferError, operator.setitem, a, slice(0, 0), a) self.assertRaises(BufferError, operator.delitem, a, 0) self.assertRaises(BufferError, operator.delitem, a, slice(0, 1)) - self.assertRaises(BufferError, operator.irepeat, a, 2) - self.assertRaises(BufferError, operator.irepeat, a, 0) + self.assertRaises(BufferError, operator.imul, a, 2) + self.assertRaises(BufferError, operator.imul, a, 0) def test_weakref(self): s = array.array(self.typecode, self.example) Modified: python/branches/io-c/Lib/test/test_bool.py ============================================================================== --- python/branches/io-c/Lib/test/test_bool.py (original) +++ python/branches/io-c/Lib/test/test_bool.py Tue Jan 27 23:14:53 2009 @@ -245,16 +245,10 @@ import operator self.assertIs(operator.truth(0), False) self.assertIs(operator.truth(1), True) - self.assertIs(operator.isNumberType(None), False) - self.assertIs(operator.isNumberType(0), True) self.assertIs(operator.not_(1), False) self.assertIs(operator.not_(0), True) - self.assertIs(operator.isSequenceType(0), False) - self.assertIs(operator.isSequenceType([]), True) self.assertIs(operator.contains([], 1), False) self.assertIs(operator.contains([1], 1), True) - self.assertIs(operator.isMappingType(1), False) - self.assertIs(operator.isMappingType({}), True) self.assertIs(operator.lt(0, 0), False) self.assertIs(operator.lt(0, 1), True) self.assertIs(operator.is_(True, True), True) 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 Tue Jan 27 23:14:53 2009 @@ -10,6 +10,7 @@ FutureWarning, __name__) warnings.filterwarnings("ignore", "integer argument expected", DeprecationWarning, "unittest") +import builtins class Squares: @@ -219,21 +220,9 @@ self.assertRaises((OverflowError, ValueError), chr, 2**32) def test_cmp(self): - self.assertEqual(cmp(-1, 1), -1) - self.assertEqual(cmp(1, -1), 1) - self.assertEqual(cmp(1, 1), 0) - # verify that circular objects are not handled - a = []; a.append(a) - b = []; b.append(b) - from collections import UserList - c = UserList(); c.append(c) - self.assertRaises(RuntimeError, cmp, a, b) - self.assertRaises(RuntimeError, cmp, b, c) - self.assertRaises(RuntimeError, cmp, c, a) - self.assertRaises(RuntimeError, cmp, a, c) - # okay, now break the cycles - a.pop(); b.pop(); c.pop() - self.assertRaises(TypeError, cmp) + # uncomment the following line once cmp has been removed + #self.assert_(not hasattr(builtins, "cmp")) + pass def test_compile(self): compile('print(1)\n', '', 'exec') @@ -736,10 +725,6 @@ def __getitem__(self, index): raise ValueError self.assertRaises(ValueError, min, BadSeq()) - class BadNumber: - def __cmp__(self, other): - raise ValueError - self.assertRaises(TypeError, min, (42, BadNumber())) for stmt in ( "min(key=int)", # no args Modified: python/branches/io-c/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/io-c/Lib/test/test_cmd_line.py (original) +++ python/branches/io-c/Lib/test/test_cmd_line.py Tue Jan 27 23:14:53 2009 @@ -159,6 +159,16 @@ self.assertEqual(data.strip(), b'x', "text %s not line-buffered" % stream) + def test_unbuffered_input(self): + # sys.stdin still works with '-u' + code = ("import sys; sys.stdout.write(sys.stdin.read(1))") + p = _spawn_python('-u', '-c', code) + p.stdin.write(b'x') + p.stdin.flush() + data, rc = _kill_python_and_exit_code(p) + self.assertEqual(rc, 0) + self.assert_(data.startswith(b'x'), data) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/io-c/Lib/test/test_codecs.py ============================================================================== --- python/branches/io-c/Lib/test/test_codecs.py (original) +++ python/branches/io-c/Lib/test/test_codecs.py Tue Jan 27 23:14:53 2009 @@ -1475,6 +1475,36 @@ info.streamwriter, 'strict') as srw: self.assertEquals(srw.read(), "\xfc") +class TypesTest(unittest.TestCase): + def test_decode_unicode(self): + # Most decoders don't accept unicode input + decoders = [ + codecs.utf_7_decode, + codecs.utf_8_decode, + codecs.utf_16_le_decode, + codecs.utf_16_be_decode, + codecs.utf_16_ex_decode, + codecs.utf_32_decode, + codecs.utf_32_le_decode, + codecs.utf_32_be_decode, + codecs.utf_32_ex_decode, + codecs.latin_1_decode, + codecs.ascii_decode, + codecs.charmap_decode, + ] + if hasattr(codecs, "mbcs_decode"): + decoders.append(codecs.mbcs_decode) + for decoder in decoders: + self.assertRaises(TypeError, decoder, "xxx") + + def test_unicode_escape(self): + # Escape-decoding an unicode string is supported ang gives the same + # result as decoding the equivalent ASCII bytes string. + self.assertEquals(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) + self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) + def test_main(): support.run_unittest( @@ -1501,6 +1531,7 @@ BasicUnicodeTest, CharmapTest, WithStmtTest, + TypesTest, ) 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 Tue Jan 27 23:14:53 2009 @@ -453,6 +453,11 @@ self.assertEqual(dict(Counter(s)), dict(Counter(s).items())) self.assertEqual(set(Counter(s)), set(s)) + def test_invariant_for_the_in_operator(self): + c = Counter(a=10, b=-2, c=0) + for elem in c: + self.assert_(elem in c) + def test_multiset_operations(self): # Verify that adding a zero counter will strip zeros and negatives c = Counter(a=10, b=-2, c=0) + Counter() @@ -462,18 +467,19 @@ for i in range(1000): # test random pairs of multisets p = Counter(dict((elem, randrange(-2,4)) for elem in elements)) + p.update(e=1, f=-1, g=0) q = Counter(dict((elem, randrange(-2,4)) for elem in elements)) - for counterop, numberop, defneg in [ - (Counter.__add__, lambda x, y: x+y if x+y>0 else 0, True), - (Counter.__sub__, lambda x, y: x-y if x-y>0 else 0, False), - (Counter.__or__, max, False), - (Counter.__and__, min, False), + q.update(h=1, i=-1, j=0) + for counterop, numberop in [ + (Counter.__add__, lambda x, y: max(0, x+y)), + (Counter.__sub__, lambda x, y: max(0, x-y)), + (Counter.__or__, lambda x, y: max(0,x,y)), + (Counter.__and__, lambda x, y: max(0, min(x,y))), ]: result = counterop(p, q) for x in elements: - # all except __add__ are undefined for negative inputs - if defneg or (p[x] >= 0 and q[x] >= 0): - self.assertEqual(numberop(p[x], q[x]), result[x]) + self.assertEqual(numberop(p[x], q[x]), result[x], + (counterop, x, p, q)) # verify that results exclude non-positive counts self.assert_(x>0 for x in result.values()) Modified: python/branches/io-c/Lib/test/test_contains.py ============================================================================== --- python/branches/io-c/Lib/test/test_contains.py (original) +++ python/branches/io-c/Lib/test/test_contains.py Tue Jan 27 23:14:53 2009 @@ -56,31 +56,16 @@ This class is designed to make sure that the contains code works when the list is modified during the check. """ - aList = range(15) - def __cmp__(self, other): + aList = list(range(15)) + def __eq__(self, other): if other == 12: self.aList.remove(12) self.aList.remove(13) self.aList.remove(14) - return 1 + return 0 self.assert_(Deviant1() not in Deviant1.aList) - class Deviant2: - """Behaves strangely when compared - - This class raises an exception during comparison. That in - turn causes the comparison to fail with a TypeError. - """ - def __cmp__(self, other): - if other == 4: - raise RuntimeError("gotcha") - - try: - self.assert_(Deviant2() not in a) - except TypeError: - pass - def test_nonreflexive(self): # containment and equality tests involving elements that are # not necessarily equal to themselves Modified: python/branches/io-c/Lib/test/test_copy.py ============================================================================== --- python/branches/io-c/Lib/test/test_copy.py (original) +++ python/branches/io-c/Lib/test/test_copy.py Tue Jan 27 23:14:53 2009 @@ -2,10 +2,14 @@ import copy import copyreg - +from operator import le, lt, ge, gt, eq, ne import unittest from test import support +order_comparisons = le, lt, ge, gt +equality_comparisons = eq, ne +comparisons = order_comparisons + equality_comparisons + class TestCopy(unittest.TestCase): # Attempt full line coverage of copy.py from top to bottom @@ -271,7 +275,8 @@ x = [] x.append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, cmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is y) self.assertEqual(len(y), 1) @@ -287,7 +292,8 @@ x = ([],) x[0].append(x) y = copy.deepcopy(x) - self.assertRaises(RuntimeError, cmp, y, x) + for op in comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) self.assert_(y[0][0] is y) @@ -303,7 +309,10 @@ x = {} x['foo'] = x y = copy.deepcopy(x) - self.assertRaises(TypeError, cmp, y, x) + for op in order_comparisons: + self.assertRaises(TypeError, op, y, x) + for op in equality_comparisons: + self.assertRaises(RuntimeError, op, y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) self.assertEqual(len(y), 1) Modified: python/branches/io-c/Lib/test/test_datetime.py ============================================================================== --- python/branches/io-c/Lib/test/test_datetime.py (original) +++ python/branches/io-c/Lib/test/test_datetime.py Tue Jan 27 23:14:53 2009 @@ -7,6 +7,8 @@ import pickle import unittest +from operator import lt, le, gt, ge, eq, ne + from test import support from datetime import MINYEAR, MAXYEAR @@ -156,9 +158,6 @@ self.assertRaises(TypeError, lambda: () > me) self.assertRaises(TypeError, lambda: () >= me) - self.assertRaises(TypeError, cmp, (), me) - self.assertRaises(TypeError, cmp, me, ()) - ############################################################################# # timedelta tests @@ -309,8 +308,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for args in (3, 3, 3), (2, 4, 4), (2, 3, 5): t2 = timedelta(*args) # this is larger than t1 @@ -326,8 +323,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -953,8 +948,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for args in (3, 3, 3), (2, 4, 4), (2, 3, 5): t2 = self.theclass(*args) # this is larger than t1 @@ -970,8 +963,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -999,8 +990,6 @@ # But the ordering is undefined self.assertRaises(TypeError, lambda: our < 1) self.assertRaises(TypeError, lambda: 1 < our) - self.assertRaises(TypeError, cmp, our, 1) - self.assertRaises(TypeError, cmp, 1, our) # Repeat those tests with a different class @@ -1014,8 +1003,6 @@ self.assertEqual(their != our, True) self.assertRaises(TypeError, lambda: our < their) self.assertRaises(TypeError, lambda: their < our) - self.assertRaises(TypeError, cmp, our, their) - self.assertRaises(TypeError, cmp, their, our) # However, if the other class explicitly defines ordering # relative to our class, it is allowed to do so @@ -1041,8 +1028,6 @@ self.assertEqual(their != our, True) self.assertEqual(our < their, True) self.assertEqual(their < our, False) - self.assertEqual(cmp(our, their), -1) - self.assertEqual(cmp(their, our), 1) def test_bool(self): # All dates are considered true. @@ -1440,8 +1425,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for i in range(len(args)): newargs = args[:] @@ -1459,8 +1442,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) # A helper for timestamp constructor tests. @@ -1728,8 +1709,6 @@ self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) - self.assertEqual(cmp(t1, t2), 0) - self.assertEqual(cmp(t2, t1), 0) for i in range(len(args)): newargs = args[:] @@ -1747,8 +1726,6 @@ self.failUnless(not t2 < t1) self.failUnless(not t1 >= t2) self.failUnless(not t2 <= t1) - self.assertEqual(cmp(t1, t2), -1) - self.assertEqual(cmp(t2, t1), 1) for badarg in OTHERSTUFF: self.assertEqual(t1 == badarg, False) @@ -2122,9 +2099,10 @@ d2 = base.replace(minute=11) for x in d0, d1, d2: for y in d0, d1, d2: - got = cmp(x, y) - expected = cmp(x.minute, y.minute) - self.assertEqual(got, expected) + for op in lt, le, gt, ge, eq, ne: + got = op(x, y) + expected = op(x.minute, y.minute) + self.assertEqual(got, expected) # However, if they're different members, uctoffset is not ignored. # Note that a time can't actually have an operand-depedent offset, @@ -2136,7 +2114,7 @@ d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: - got = cmp(x, y) + got = (x > y) - (x < y) if (x is d0 or x is d1) and (y is d0 or y is d1): expected = 0 elif x is y is d2: 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 Tue Jan 27 23:14:53 2009 @@ -1012,17 +1012,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') Modified: python/branches/io-c/Lib/test/test_deque.py ============================================================================== --- python/branches/io-c/Lib/test/test_deque.py (original) +++ python/branches/io-c/Lib/test/test_deque.py Tue Jan 27 23:14:53 2009 @@ -103,7 +103,6 @@ self.assertEqual(x <= y, list(x) <= list(y), (x,y)) self.assertEqual(x > y, list(x) > list(y), (x,y)) self.assertEqual(x >= y, list(x) >= list(y), (x,y)) - self.assertEqual(cmp(x,y), cmp(list(x),list(y)), (x,y)) def test_extend(self): d = deque('a') 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 Tue Jan 27 23:14:53 2009 @@ -172,7 +172,6 @@ def test_dicts(self): # Testing dict operations... - ## self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__") self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__") self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__") self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__") @@ -332,8 +331,6 @@ # This is an ugly hack: copy._deepcopy_dispatch[spam.spamdict] = spamdict - ## self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", - ## "__cmp__") self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__") @@ -1004,8 +1001,8 @@ # Test lookup leaks [SF bug 572567] import sys,gc class G(object): - def __cmp__(self, other): - return 0 + def __eq__(self, other): + return 1 g = G() orig_objects = len(gc.get_objects()) for i in range(10): @@ -1525,7 +1522,6 @@ self.assertNotEqual(id(c1), id(c2)) hash(c1) hash(c2) - ## self.assertEqual(cmp(c1, c2), cmp(id(c1), id(c2))) self.assertEqual(c1, c1) self.assert_(c1 != c2) self.assert_(not c1 != c1) @@ -1549,7 +1545,6 @@ self.assertNotEqual(id(d1), id(d2)) hash(d1) hash(d2) - ## self.assertEqual(cmp(d1, d2), cmp(id(d1), id(d2))) self.assertEqual(d1, d1) self.assertNotEqual(d1, d2) self.assert_(not d1 != d1) @@ -1610,23 +1605,6 @@ self.assert_(i in p10) self.assertFalse(10 in p10) - ## # Safety test for __cmp__ - ## def unsafecmp(a, b): - ## try: - ## a.__class__.__cmp__(a, b) - ## except TypeError: - ## pass - ## else: - ## self.fail("shouldn't allow %s.__cmp__(%r, %r)" % ( - ## a.__class__, a, b)) - ## - ## unsafecmp("123", "123") - ## unsafecmp("123", "123") - ## unsafecmp(1, 1.0) - ## unsafecmp(1.0, 1) - ## unsafecmp(1, 1) - ## unsafecmp(1, 1) - def test_weakrefs(self): # Testing weak references... import weakref @@ -2538,12 +2516,16 @@ c = {1: c1, 2: c2, 3: c3} for x in 1, 2, 3: for y in 1, 2, 3: - ## self.assert_(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) for op in "<", "<=", "==", "!=", ">", ">=": - self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - ## self.assert_(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y)) - ## self.assert_(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s c[y]" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s y" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("x %s c[y]" % op) == + eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) def test_rich_comparisons(self): # Testing rich comparisons... Modified: python/branches/io-c/Lib/test/test_dict.py ============================================================================== --- python/branches/io-c/Lib/test/test_dict.py (original) +++ python/branches/io-c/Lib/test/test_dict.py Tue Jan 27 23:14:53 2009 @@ -570,7 +570,7 @@ self.fail("missing KeyError") def test_bad_key(self): - # Dictionary lookups should fail if __cmp__() raises an exception. + # Dictionary lookups should fail if __eq__() raises an exception. class CustomException(Exception): pass 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 Tue Jan 27 23:14:53 2009 @@ -55,13 +55,8 @@ def __ne__(self, other): return self is not other -class OnlyCmp(object): - def __cmp__(self, other): - return cmp(id(self), id(other)) - class InheritedHashWithEquality(FixedHash, OnlyEquality): pass class InheritedHashWithInequality(FixedHash, OnlyInequality): pass -class InheritedHashWithCmp(FixedHash, OnlyCmp): pass class NoHash(object): __hash__ = None @@ -74,7 +69,6 @@ fixed_expected = [FixedHash(), InheritedHashWithEquality(), InheritedHashWithInequality(), - InheritedHashWithCmp(), ] error_expected = [NoHash(), OnlyEquality(), Modified: python/branches/io-c/Lib/test/test_heapq.py ============================================================================== --- python/branches/io-c/Lib/test/test_heapq.py (original) +++ python/branches/io-c/Lib/test/test_heapq.py Tue Jan 27 23:14:53 2009 @@ -234,9 +234,9 @@ class CmpErr: "Dummy element that always raises an error during comparison" - def __cmp__(self, other): + def __eq__(self, other): raise ZeroDivisionError - __eq__ = __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __cmp__ + __ne__ = __lt__ = __le__ = __gt__ = __ge__ = __eq__ def R(seqn): 'Regular generator' Modified: python/branches/io-c/Lib/test/test_hmac.py ============================================================================== --- python/branches/io-c/Lib/test/test_hmac.py (original) +++ python/branches/io-c/Lib/test/test_hmac.py Tue Jan 27 23:14:53 2009 @@ -291,7 +291,7 @@ # Testing if the copy method created a real copy. h1 = hmac.HMAC(b"key") h2 = h1.copy() - # Using id() in case somebody has overridden __cmp__. + # Using id() in case somebody has overridden __eq__/__ne__. self.failUnless(id(h1) != id(h2), "No real copy of the HMAC instance.") self.failUnless(id(h1.inner) != id(h2.inner), "No real copy of the attribute 'inner'.") Modified: python/branches/io-c/Lib/test/test_import.py ============================================================================== --- python/branches/io-c/Lib/test/test_import.py (original) +++ python/branches/io-c/Lib/test/test_import.py Tue Jan 27 23:14:53 2009 @@ -346,6 +346,27 @@ self.assertEqual(mod.testdata, 'test_trailing_slash') unload("test_trailing_slash") + # http://bugs.python.org/issue3677 + def _test_UNC_path(self): + f = open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') + f.write("testdata = 'test_trailing_slash'") + f.close() + #create the UNC path, like \\myhost\c$\foo\bar + path = os.path.abspath(self.path) + import socket + hn = socket.gethostname() + drive = path[0] + unc = "\\\\%s\\%s$"%(hn, drive) + unc += path[2:] + sys.path.append(path) + mod = __import__("test_trailing_slash") + self.assertEqual(mod.testdata, 'test_trailing_slash') + unload("test_trailing_slash") + + if sys.platform == "win32": + test_UNC_path = _test_UNC_path + + class RelativeImport(unittest.TestCase): def tearDown(self): try: 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 Tue Jan 27 23:14:53 2009 @@ -318,6 +318,17 @@ else: self.fail("1/0 didn't raise an exception") + # issue 5008 + def test_append_mode_tell(self): + with io.open(support.TESTFN, "wb") as f: + f.write(b"xxx") + with io.open(support.TESTFN, "ab", buffering=0) as f: + self.assertEqual(f.tell(), 3) + with io.open(support.TESTFN, "ab") as f: + self.assertEqual(f.tell(), 3) + with io.open(support.TESTFN, "a") as f: + self.assert_(f.tell() > 0) + def test_destructor(self): record = [] class MyFileIO(io.FileIO): 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 Tue Jan 27 23:14:53 2009 @@ -110,6 +110,14 @@ if sorted(indices) == list(indices): yield tuple(pool[i] for i in indices) + def combinations3(iterable, r): + 'Pure python version from cwr()' + pool = tuple(iterable) + n = len(pool) + for indices in combinations_with_replacement(range(n), r): + if len(set(indices)) == r: + yield tuple(pool[i] for i in indices) + for n in range(7): values = [5*x-12 for x in range(n)] for r in range(n+2): @@ -126,11 +134,82 @@ [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version + self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version # Test implementation detail: tuple re-use self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(combinations('abcde', 3))))), 1) + def test_combinations_with_replacement(self): + cwr = combinations_with_replacement + self.assertRaises(TypeError, cwr, 'abc') # missing r argument + self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments + self.assertRaises(TypeError, cwr, None) # pool is not iterable + self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative + self.assertEqual(list(cwr('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + + def cwr1(iterable, r): + 'Pure python version shown in the docs' + # number items returned: (n+r-1)! / r! / (n-1)! when n>0 + pool = tuple(iterable) + n = len(pool) + if not n and r: + return + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def cwr2(iterable, r): + 'Pure python version shown in the docs' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) + + def numcombs(n, r): + if not n: + return 0 if r else 1 + return fact(n+r-1) / fact(r)/ fact(n-1) + + for n in range(7): + values = [5*x-12 for x in range(n)] + for r in range(n+2): + result = list(cwr(values, r)) + + self.assertEqual(len(result), numcombs(n, r)) # right number of combs + self.assertEqual(len(result), len(set(result))) # no repeats + self.assertEqual(result, sorted(result)) # lexicographic order + + regular_combs = list(combinations(values, r)) # compare to combs without replacement + if n == 0 or r <= 1: + self.assertEquals(result, regular_combs) # cases that should be identical + else: + self.assert_(set(result) >= set(regular_combs)) # rest should be supersets of regular combs + + for c in result: + self.assertEqual(len(c), r) # r-length combinations + noruns = [k for k,v in groupby(c)] # combo without consecutive repeats + self.assertEqual(len(noruns), len(set(noruns))) # no repeats other than consecutive + self.assertEqual(list(c), sorted(c)) # keep original ordering + self.assert_(all(e in values for e in c)) # elements taken from input iterable + self.assertEqual(noruns, + [e for e in values if e in c]) # comb is a subsequence of the input iterable + self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version + self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version + + # Test implementation detail: tuple re-use + self.assertEqual(len(set(map(id, cwr('abcde', 3)))), 1) + self.assertNotEqual(len(set(map(id, list(cwr('abcde', 3))))), 1) + def test_permutations(self): self.assertRaises(TypeError, permutations) # too few arguments self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments @@ -195,6 +274,54 @@ self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1) self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1) + def test_combinatorics(self): + # Test relationships between product(), permutations(), + # combinations() and combinations_with_replacement(). + + for n in range(6): + s = 'ABCDEFG'[:n] + for r in range(8): + prod = list(product(s, repeat=r)) + cwr = list(combinations_with_replacement(s, r)) + perm = list(permutations(s, r)) + comb = list(combinations(s, r)) + + # Check size + self.assertEquals(len(prod), n**r) + self.assertEquals(len(cwr), (fact(n+r-1) / fact(r)/ fact(n-1)) if n else (not r)) + self.assertEquals(len(perm), 0 if r>n else fact(n) / fact(n-r)) + self.assertEquals(len(comb), 0 if r>n else fact(n) / fact(r) / fact(n-r)) + + # Check lexicographic order without repeated tuples + self.assertEquals(prod, sorted(set(prod))) + self.assertEquals(cwr, sorted(set(cwr))) + self.assertEquals(perm, sorted(set(perm))) + self.assertEquals(comb, sorted(set(comb))) + + # Check interrelationships + self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted + self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups + self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted + self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups + self.assertEqual(comb, list(filter(set(cwr).__contains__, perm))) # comb: perm that is a cwr + self.assertEqual(comb, list(filter(set(perm).__contains__, cwr))) # comb: cwr that is a perm + self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm + + def test_compress(self): + 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')) + self.assertEqual(list(compress('ABCDEF', [1,0,1])), list('AC')) + self.assertEqual(list(compress('ABC', [0,1,1,1,1,1])), list('BC')) + n = 10000 + data = chain.from_iterable(repeat(range(6), n)) + selectors = chain.from_iterable(repeat((0, 1))) + self.assertEqual(list(compress(data, selectors)), [1,3,5] * n) + self.assertRaises(TypeError, compress, None, range(6)) # 1st arg not iterable + self.assertRaises(TypeError, compress, range(6), None) # 2nd arg not iterable + self.assertRaises(TypeError, compress, range(6)) # too few args + self.assertRaises(TypeError, compress, range(6), None) # too many args + def test_count(self): self.assertEqual(lzip('abc',count()), [('a', 0), ('b', 1), ('c', 2)]) self.assertEqual(lzip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)]) @@ -715,6 +842,13 @@ self.assertEqual(list(combinations(range(4), 3)), [(0,1,2), (0,1,3), (0,2,3), (1,2,3)]) + def test_combinations_with_replacement(self): + self.assertEqual(list(combinations_with_replacement('ABC', 2)), + [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')]) + + def test_compress(self): + self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) + def test_count(self): self.assertEqual(list(islice(count(10), 5)), [10, 11, 12, 13, 14]) @@ -795,6 +929,14 @@ a = [] self.makecycle(combinations([1,2,a,3], 3), a) + def test_combinations_with_replacement(self): + a = [] + self.makecycle(combinations_with_replacement([1,2,a,3], 3), a) + + def test_compress(self): + a = [] + self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) @@ -948,6 +1090,15 @@ self.assertRaises(TypeError, list, chain(N(s))) self.assertRaises(ZeroDivisionError, list, chain(E(s))) + def test_compress(self): + for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)): + n = len(s) + for g in (G, I, Ig, S, L, R): + self.assertEqual(list(compress(g(s), repeat(1))), list(g(s))) + self.assertRaises(TypeError, compress, X(s), repeat(1)) + self.assertRaises(TypeError, compress, N(s), repeat(1)) + self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1))) + def test_product(self): for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)): self.assertRaises(TypeError, product, X(s)) @@ -1144,7 +1295,7 @@ def test_keywords_in_subclass(self): # count is not subclassable... for cls in (repeat, zip, filter, filterfalse, chain, map, - starmap, islice, takewhile, dropwhile, cycle): + starmap, islice, takewhile, dropwhile, cycle, compress): class Subclass(cls): def __init__(self, newarg=None, *args): cls.__init__(self, *args) @@ -1261,7 +1412,7 @@ >>> def grouper(n, iterable, fillvalue=None): ... "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" ... args = [iter(iterable)] * n -... return zip_longest(fillvalue=fillvalue, *args) +... return zip_longest(*args, fillvalue=fillvalue) >>> def roundrobin(*iterables): ... "roundrobin('ABC', 'D', 'EF') --> A D E B F C" @@ -1277,30 +1428,9 @@ ... nexts = cycle(islice(nexts, pending)) >>> def powerset(iterable): -... "powerset('ab') --> set([]), set(['a']), set(['b']), set(['a', 'b'])" -... # Recipe credited to Eric Raymond -... pairs = [(2**i, x) for i, x in enumerate(iterable)] -... for n in range(2**len(pairs)): -... yield set(x for m, x in pairs if m&n) - ->>> def compress(data, selectors): -... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" -... return (d for d, s in zip(data, selectors) if s) - ->>> def combinations_with_replacement(iterable, r): -... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" -... pool = tuple(iterable) -... n = len(pool) -... indices = [0] * r -... yield tuple(pool[i] for i in indices) -... while 1: -... for i in reversed(range(r)): -... if indices[i] != n - 1: -... break -... else: -... return -... indices[i:] = [indices[i] + 1] * (r - i) -... yield tuple(pool[i] for i in indices) +... "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_everseen(iterable, key=None): ... "List unique elements, preserving order. Remember all elements ever seen." @@ -1379,33 +1509,13 @@ >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] ->>> list(map(sorted, powerset('ab'))) -[[], ['a'], ['b'], ['a', 'b']] - ->>> list(compress('abcdef', [1,0,1,0,1,1])) -['a', 'c', 'e', 'f'] - ->>> list(combinations_with_replacement('abc', 2)) -[('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')] - ->>> list(combinations_with_replacement('01', 3)) -[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')] - ->>> def combinations_with_replacement2(iterable, r): -... 'Alternate version that filters from product()' -... pool = tuple(iterable) -... n = len(pool) -... for indices in product(range(n), repeat=r): -... if sorted(indices) == list(indices): -... yield tuple(pool[i] for i in indices) - ->>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2)) -True +>>> list(powerset([1,2,3])) +[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)] ->>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3)) +>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18)) True ->>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6)) +>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len) True >>> list(unique_everseen('AAAABBBCCDAABBB')) Modified: python/branches/io-c/Lib/test/test_kqueue.py ============================================================================== --- python/branches/io-c/Lib/test/test_kqueue.py (original) +++ python/branches/io-c/Lib/test/test_kqueue.py Tue Jan 27 23:14:53 2009 @@ -22,6 +22,7 @@ self.assertRaises(ValueError, kq.fileno) def test_create_event(self): + from operator import lt, le, gt, ge fd = sys.stderr.fileno() ev = select.kevent(fd) other = select.kevent(1000) @@ -33,12 +34,12 @@ self.assertEqual(ev.udata, 0) self.assertEqual(ev, ev) self.assertNotEqual(ev, other) - self.assertEqual(cmp(ev, other), -1) self.assert_(ev < other) self.assert_(other >= ev) - self.assertRaises(TypeError, cmp, ev, None) - self.assertRaises(TypeError, cmp, ev, 1) - self.assertRaises(TypeError, cmp, ev, "ev") + for op in lt, le, gt, ge: + self.assertRaises(TypeError, op, ev, None) + self.assertRaises(TypeError, op, ev, 1) + self.assertRaises(TypeError, op, ev, "ev") ev = select.kevent(fd, select.KQ_FILTER_WRITE) self.assertEqual(ev.ident, fd) @@ -120,12 +121,15 @@ client.send(b"Hello!") server.send(b"world!!!") - events = kq.control(None, 4, 1) # We may need to call it several times - for i in range(5): + for i in range(10): + events = kq.control(None, 4, 1) if len(events) == 4: break - events = kq.control(None, 4, 1) + time.sleep(1.0) + else: + self.fail('timeout waiting for event notifications') + events = [(e.ident, e.filter, e.flags) for e in events] events.sort() 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 Tue Jan 27 23:14:53 2009 @@ -697,7 +697,8 @@ def _cmp__(self, other): if not isinstance(other, Rat): other = Rat(other) - return cmp(self.n * other.d, self.d * other.n) + x, y = self.n * other.d, self.d * other.n + return (x > y) - (x < y) def __eq__(self, other): return self._cmp__(other) == 0 def __ne__(self, other): @@ -727,8 +728,8 @@ Rx = Rat(x) for y in cases: Ry = Rat(y) - Rcmp = cmp(Rx, Ry) - xycmp = cmp(x, y) + Rcmp = (Rx > Ry) - (Rx < Ry) + xycmp = (x > y) - (x < y) eq(Rcmp, xycmp, Frm("%r %r %d %d", x, y, Rcmp, xycmp)) eq(x == y, Rcmp == 0, Frm("%r == %r %d", x, y, Rcmp)) eq(x != y, Rcmp != 0, Frm("%r != %r %d", x, y, Rcmp)) Modified: python/branches/io-c/Lib/test/test_multibytecodec.py ============================================================================== --- python/branches/io-c/Lib/test/test_multibytecodec.py (original) +++ python/branches/io-c/Lib/test/test_multibytecodec.py Tue Jan 27 23:14:53 2009 @@ -44,7 +44,7 @@ myreplace = lambda exc: ('', sys.maxsize+1) codecs.register_error('test.cjktest', myreplace) self.assertRaises(IndexError, dec, - 'apple\x92ham\x93spam', 'test.cjktest') + b'apple\x92ham\x93spam', 'test.cjktest') def test_codingspec(self): try: @@ -61,6 +61,10 @@ self.assertRaises(AttributeError, _multibytecodec.MultibyteStreamWriter, None) + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + self.assertRaises(TypeError, codecs.getdecoder(enc), "") class Test_IncrementalEncoder(unittest.TestCase): @@ -146,6 +150,12 @@ self.assertRaises(UnicodeDecodeError, decoder.decode, b'', True) self.assertEqual(decoder.decode(b'B@$'), '\u4e16') + def test_decode_unicode(self): + # Trying to decode an unicode string should raise a TypeError + for enc in ALL_CJKENCODINGS: + decoder = codecs.getincrementaldecoder(enc)() + self.assertRaises(TypeError, decoder.decode, "") + class Test_StreamReader(unittest.TestCase): def test_bug1728403(self): try: Modified: python/branches/io-c/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/io-c/Lib/test/test_multiprocessing.py (original) +++ python/branches/io-c/Lib/test/test_multiprocessing.py Tue Jan 27 23:14:53 2009 @@ -1058,8 +1058,10 @@ multiprocessing.active_children() # discard dead process objs gc.collect() # do garbage collection refs = self.manager._number_of_objects() + debug_info = self.manager._debug_info() if refs != EXPECTED_NUMBER: print(self.manager._debug_info()) + print(debug_info) self.assertEqual(refs, EXPECTED_NUMBER) Modified: python/branches/io-c/Lib/test/test_operator.py ============================================================================== --- python/branches/io-c/Lib/test/test_operator.py (original) +++ python/branches/io-c/Lib/test/test_operator.py Tue Jan 27 23:14:53 2009 @@ -164,31 +164,6 @@ self.failUnlessRaises(TypeError, operator.invert, None) self.assertEqual(operator.inv(4), -5) - def test_isMappingType(self): - self.failUnlessRaises(TypeError, operator.isMappingType) - self.failIf(operator.isMappingType(1)) - self.failIf(operator.isMappingType(operator.isMappingType)) - self.failUnless(operator.isMappingType(operator.__dict__)) - self.failUnless(operator.isMappingType({})) - - def test_isNumberType(self): - self.failUnlessRaises(TypeError, operator.isNumberType) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8j)) - self.failUnless(operator.isNumberType(8)) - self.failUnless(operator.isNumberType(8.3)) - self.failIf(operator.isNumberType(dir())) - - def test_isSequenceType(self): - self.failUnlessRaises(TypeError, operator.isSequenceType) - self.failUnless(operator.isSequenceType(dir())) - self.failUnless(operator.isSequenceType(())) - self.failUnless(operator.isSequenceType(range(10))) - self.failUnless(operator.isSequenceType('yeahbuddy')) - self.failIf(operator.isSequenceType(3)) - class Dict(dict): pass - self.failIf(operator.isSequenceType(Dict())) - def test_lshift(self): self.failUnlessRaises(TypeError, operator.lshift) self.failUnlessRaises(TypeError, operator.lshift, None, 42) @@ -235,31 +210,6 @@ self.assertRaises(TypeError, operator.pow, 1) self.assertRaises(TypeError, operator.pow, 1, 2, 3) - def test_repeat(self): - a = list(range(3)) - self.failUnlessRaises(TypeError, operator.repeat) - self.failUnlessRaises(TypeError, operator.repeat, a, None) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == []) - a = (1, 2, 3) - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == ()) - a = '123' - self.failUnless(operator.repeat(a, 2) == a+a) - self.failUnless(operator.repeat(a, 1) == a) - self.failUnless(operator.repeat(a, 0) == '') - a = Seq1([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - a = Seq2([4, 5, 6]) - self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6]) - self.failUnless(operator.repeat(a, 1) == [4, 5, 6]) - self.failUnless(operator.repeat(a, 0) == []) - self.failUnlessRaises(TypeError, operator.repeat, 6, 7) - def test_rshift(self): self.failUnlessRaises(TypeError, operator.rshift) self.failUnlessRaises(TypeError, operator.rshift, None, 42) @@ -443,7 +393,6 @@ self.assertEqual(operator.itruediv (c, 5), "itruediv") self.assertEqual(operator.ixor (c, 5), "ixor") self.assertEqual(operator.iconcat (c, c), "iadd") - self.assertEqual(operator.irepeat (c, 5), "imul") self.assertEqual(operator.__iadd__ (c, 5), "iadd") self.assertEqual(operator.__iand__ (c, 5), "iand") self.assertEqual(operator.__ifloordiv__(c, 5), "ifloordiv") @@ -457,7 +406,6 @@ self.assertEqual(operator.__itruediv__ (c, 5), "itruediv") self.assertEqual(operator.__ixor__ (c, 5), "ixor") self.assertEqual(operator.__iconcat__ (c, c), "iadd") - self.assertEqual(operator.__irepeat__ (c, 5), "imul") def test_main(verbose=None): import sys Modified: python/branches/io-c/Lib/test/test_set.py ============================================================================== --- python/branches/io-c/Lib/test/test_set.py (original) +++ python/branches/io-c/Lib/test/test_set.py Tue Jan 27 23:14:53 2009 @@ -1036,16 +1036,6 @@ result = self.set ^ set([8]) self.assertEqual(result, set([2, 4, 6, 8])) - def test_cmp(self): - a, b = set('a'), set('b') - self.assertRaises(TypeError, cmp, a, b) - - # In py3k, this works! - self.assertRaises(TypeError, cmp, a, a) - - self.assertRaises(TypeError, cmp, a, 12) - self.assertRaises(TypeError, cmp, "abc", a) - #============================================================================== class TestUpdateOps(unittest.TestCase): Modified: python/branches/io-c/Lib/test/test_sort.py ============================================================================== --- python/branches/io-c/Lib/test/test_sort.py (original) +++ python/branches/io-c/Lib/test/test_sort.py Tue Jan 27 23:14:53 2009 @@ -102,7 +102,7 @@ y = x[:] y.reverse() s = x[:] - check("reversed via function", y, s, lambda a, b: cmp(b, a)) + check("reversed via function", y, s, lambda a, b: (b>a)-(b y) - (x < y) L = [1,2] self.assertRaises(ValueError, L.sort, key=CmpToKey(mutating_cmp)) def mutating_cmp(x, y): L.append(3) del L[:] - return cmp(x, y) + return (x > y) - (x < y) self.assertRaises(ValueError, L.sort, key=CmpToKey(mutating_cmp)) memorywaster = [memorywaster] @@ -176,7 +176,10 @@ copy = data[:] random.shuffle(data) data.sort(key=str.lower) - copy.sort(key=CmpToKey(lambda x,y: cmp(x.lower(), y.lower()))) + def my_cmp(x, y): + xlower, ylower = x.lower(), y.lower() + return (xlower > ylower) - (xlower < ylower) + copy.sort(key=CmpToKey(my_cmp)) def test_baddecorator(self): data = 'The quick Brown fox Jumped over The lazy Dog'.split() @@ -246,8 +249,14 @@ data = [(random.randrange(100), i) for i in range(200)] copy1 = data[:] copy2 = data[:] - data.sort(key=CmpToKey(lambda x,y: cmp(x[0],y[0])), reverse=True) - copy1.sort(key=CmpToKey(lambda x,y: cmp(y[0],x[0]))) + def my_cmp(x, y): + x0, y0 = x[0], y[0] + return (x0 > y0) - (x0 < y0) + def my_cmp_reversed(x, y): + x0, y0 = x[0], y[0] + return (y0 > x0) - (y0 < x0) + data.sort(key=CmpToKey(my_cmp), reverse=True) + copy1.sort(key=CmpToKey(my_cmp_reversed)) self.assertEqual(data, copy1) copy2.sort(key=lambda x: x[0], reverse=True) self.assertEqual(data, copy2) Modified: python/branches/io-c/Lib/test/test_sundry.py ============================================================================== --- python/branches/io-c/Lib/test/test_sundry.py (original) +++ python/branches/io-c/Lib/test/test_sundry.py Tue Jan 27 23:14:53 2009 @@ -21,7 +21,6 @@ import distutils.filelist if sys.platform.startswith('win'): import distutils.msvccompiler - import distutils.mwerkscompiler import distutils.text_file import distutils.unixccompiler Modified: python/branches/io-c/Lib/test/test_unittest.py ============================================================================== --- python/branches/io-c/Lib/test/test_unittest.py (original) +++ python/branches/io-c/Lib/test/test_unittest.py Tue Jan 27 23:14:53 2009 @@ -1103,7 +1103,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromTestCase(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) class Foo(unittest.TestCase): def test_1(self): pass @@ -1119,7 +1119,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromModule(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1137,7 +1137,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromName(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1155,7 +1155,7 @@ # getTestCaseNames() and all the loadTestsFromX() methods" def test_sortTestMethodsUsing__loadTestsFromNames(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) m = types.ModuleType('m') class Foo(unittest.TestCase): @@ -1175,7 +1175,7 @@ # Does it actually affect getTestCaseNames()? def test_sortTestMethodsUsing__getTestCaseNames(self): def reversed_cmp(x, y): - return -cmp(x, y) + return -((x > y) - (x < y)) class Foo(unittest.TestCase): def test_1(self): pass @@ -1188,9 +1188,19 @@ self.assertEqual(loader.getTestCaseNames(Foo), test_names) # "The default value is the built-in cmp() function" + # Since cmp is now defunct, we simply verify that the results + # occur in the same order as they would with the default sort. def test_sortTestMethodsUsing__default_value(self): loader = unittest.TestLoader() - self.failUnless(loader.sortTestMethodsUsing is cmp) + + class Foo(unittest.TestCase): + def test_2(self): pass + def test_3(self): pass + def test_1(self): pass + + test_names = ['test_2', 'test_3', 'test_1'] + self.assertEqual(loader.getTestCaseNames(Foo), sorted(test_names)) + # "it can be set to None to disable the sort." # Modified: python/branches/io-c/Lib/test/test_userdict.py ============================================================================== --- python/branches/io-c/Lib/test/test_userdict.py (original) +++ python/branches/io-c/Lib/test/test_userdict.py Tue Jan 27 23:14:53 2009 @@ -47,7 +47,7 @@ self.assertEqual(repr(u1), repr(d1)) self.assertEqual(repr(u2), repr(d2)) - # Test __cmp__ and __len__ + # Test rich comparison and __len__ all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2] for a in all: for b in all: Modified: python/branches/io-c/Lib/test/test_uuid.py ============================================================================== --- python/branches/io-c/Lib/test/test_uuid.py (original) +++ python/branches/io-c/Lib/test/test_uuid.py Tue Jan 27 23:14:53 2009 @@ -181,7 +181,12 @@ # Test comparison of UUIDs. for i in range(len(ascending)): for j in range(len(ascending)): - equal(cmp(i, j), cmp(ascending[i], ascending[j])) + equal(i < j, ascending[i] < ascending[j]) + equal(i <= j, ascending[i] <= ascending[j]) + equal(i == j, ascending[i] == ascending[j]) + equal(i > j, ascending[i] > ascending[j]) + equal(i >= j, ascending[i] >= ascending[j]) + equal(i != j, ascending[i] != ascending[j]) # Test sorting of UUIDs (above list is in ascending order). resorted = ascending[:] Modified: python/branches/io-c/Lib/test/test_zipfile.py ============================================================================== --- python/branches/io-c/Lib/test/test_zipfile.py (original) +++ python/branches/io-c/Lib/test/test_zipfile.py Tue Jan 27 23:14:53 2009 @@ -9,9 +9,10 @@ from random import randint, random import test.support as support -from test.support import TESTFN, run_unittest +from test.support import TESTFN, run_unittest, findfile TESTFN2 = TESTFN + "2" +TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), @@ -1000,6 +1001,28 @@ def tearDown(self): os.remove(TESTFN2) +class TestWithDirectory(unittest.TestCase): + def setUp(self): + os.mkdir(TESTFN2) + + def testExtractDir(self): + zipf = zipfile.ZipFile(findfile("zipdir.zip")) + zipf.extractall(TESTFN2) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a"))) + self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) + self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + + def testStoreDir(self): + os.mkdir(os.path.join(TESTFN2, "x")) + zipf = zipfile.ZipFile(TESTFN, "w") + zipf.write(os.path.join(TESTFN2, "x"), "x") + self.assertTrue(zipf.filelist[0].filename.endswith("x/")) + + def tearDown(self): + shutil.rmtree(TESTFN2) + if os.path.exists(TESTFN): + os.remove(TESTFN) + class UniversalNewlineTests(unittest.TestCase): def setUp(self): @@ -1114,6 +1137,7 @@ def test_main(): run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests, PyZipFileTests, DecryptionTests, TestsWithMultipleOpens, + TestWithDirectory, UniversalNewlineTests, TestsWithRandomBinaryFiles) if __name__ == "__main__": Modified: python/branches/io-c/Lib/tkinter/_fix.py ============================================================================== --- python/branches/io-c/Lib/tkinter/_fix.py (original) +++ python/branches/io-c/Lib/tkinter/_fix.py Tue Jan 27 23:14:53 2009 @@ -10,6 +10,40 @@ # \..\tcl, so anything close to # the real Tcl library will do. +# Expand symbolic links on Vista +try: + import ctypes + ctypes.windll.kernel32.GetFinalPathNameByHandleW +except (ImportError, AttributeError): + def convert_path(s): + return s +else: + def convert_path(s): + if isinstance(s, bytes): + s = s.decode("mbcs") + hdir = ctypes.windll.kernel32.\ + CreateFileW(s, 0x80, # FILE_READ_ATTRIBUTES + 1, # FILE_SHARE_READ + None, 3, # OPEN_EXISTING + 0x02000000, # FILE_FLAG_BACKUP_SEMANTICS + None) + if hdir == -1: + # Cannot open directory, give up + return s + buf = ctypes.create_unicode_buffer("", 32768) + res = ctypes.windll.kernel32.\ + GetFinalPathNameByHandleW(hdir, buf, len(buf), + 0) # VOLUME_NAME_DOS + ctypes.windll.kernel32.CloseHandle(hdir) + if res == 0: + # Conversion failed (e.g. network location) + return s + s = buf[:res] + # Ignore leading \\?\ + if s.startswith("\\\\?\\"): + s = s[4:] + return s + prefix = os.path.join(sys.prefix,"tcl") if not os.path.exists(prefix): # devdir/../tcltk/lib @@ -17,6 +51,7 @@ prefix = os.path.abspath(prefix) # if this does not exist, no further search is needed if os.path.exists(prefix): + prefix = convert_path(prefix) if "TCL_LIBRARY" not in os.environ: for name in os.listdir(prefix): if name.startswith("tcl"): Modified: python/branches/io-c/Lib/unittest.py ============================================================================== --- python/branches/io-c/Lib/unittest.py (original) +++ python/branches/io-c/Lib/unittest.py Tue Jan 27 23:14:53 2009 @@ -539,12 +539,16 @@ return mycmp(self.obj, other.obj) == -1 return K +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + class TestLoader(object): """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ testMethodPrefix = 'test' - sortTestMethodsUsing = cmp + sortTestMethodsUsing = staticmethod(three_way_cmp) suiteClass = TestSuite def loadTestsFromTestCase(self, testCaseClass): @@ -652,14 +656,18 @@ if suiteClass: loader.suiteClass = suiteClass return loader -def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp): +def getTestCaseNames(testCaseClass, prefix, sortUsing=three_way_cmp): return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass) -def makeSuite(testCaseClass, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass) - -def findTestCases(module, prefix='test', sortUsing=cmp, suiteClass=TestSuite): - return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) +def makeSuite(testCaseClass, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase( + testCaseClass) + +def findTestCases(module, prefix='test', sortUsing=three_way_cmp, + suiteClass=TestSuite): + return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule( + module) ############################################################################## Modified: python/branches/io-c/Lib/xml/dom/minidom.py ============================================================================== --- python/branches/io-c/Lib/xml/dom/minidom.py (original) +++ python/branches/io-c/Lib/xml/dom/minidom.py Tue Jan 27 23:14:53 2009 @@ -520,11 +520,29 @@ __len__ = _get_length - def __cmp__(self, other): + def _cmp(self, other): if self._attrs is getattr(other, "_attrs", None): return 0 else: - return cmp(id(self), id(other)) + return (id(self) > id(other)) - (id(self) < id(other)) + + def __eq__(self, other): + return self._cmp(other) == 0 + + def __ge__(self, other): + return self._cmp(other) >= 0 + + def __gt__(self, other): + return self._cmp(other) > 0 + + def __le__(self, other): + return self._cmp(other) <= 0 + + def __lt__(self, other): + return self._cmp(other) < 0 + + def __ne__(self, other): + return self._cmp(other) != 0 def __getitem__(self, attname_or_tuple): if isinstance(attname_or_tuple, tuple): Modified: python/branches/io-c/Lib/xml/etree/ElementTree.py ============================================================================== --- python/branches/io-c/Lib/xml/etree/ElementTree.py (original) +++ python/branches/io-c/Lib/xml/etree/ElementTree.py Tue Jan 27 23:14:53 2009 @@ -498,10 +498,30 @@ return self.text def __hash__(self): return hash(self.text) - def __cmp__(self, other): + def __le__(self, other): if isinstance(other, QName): - return cmp(self.text, other.text) - return cmp(self.text, other) + return self.text <= other.text + return self.text <= other + def __lt__(self, other): + if isinstance(other, QName): + return self.text < other.text + return self.text < other + def __ge__(self, other): + if isinstance(other, QName): + return self.text >= other.text + return self.text >= other + def __gt__(self, other): + if isinstance(other, QName): + return self.text > other.text + return self.text > other + def __eq__(self, other): + if isinstance(other, QName): + return self.text == other.text + return self.text == other + def __ne__(self, other): + if isinstance(other, QName): + return self.text != other.text + return self.text != other ## # ElementTree wrapper class. This class represents an entire element 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 Tue Jan 27 23:14:53 2009 @@ -349,10 +349,6 @@ def timetuple(self): return time.strptime(self.value, "%Y%m%dT%H:%M:%S") - def __cmp__(self, other): - s, o = self.make_comparable(other) - return cmp(s, o) - ## # Get date/time value. # Modified: python/branches/io-c/Lib/zipfile.py ============================================================================== --- python/branches/io-c/Lib/zipfile.py (original) +++ python/branches/io-c/Lib/zipfile.py Tue Jan 27 23:14:53 2009 @@ -4,7 +4,7 @@ XXX references to utf-8 need further investigation. """ import struct, os, time, sys, shutil -import binascii, io +import binascii, io, stat try: import zlib # We may need its compression method @@ -959,11 +959,11 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] == "/": + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present - if os.path.isabs(member.filename): + if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) @@ -975,6 +975,10 @@ if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) + if member.filename[-1] == '/': + os.mkdir(targetpath) + return targetpath + source = self.open(member, pwd=pwd) target = open(targetpath, "wb") shutil.copyfileobj(source, target) @@ -1014,6 +1018,7 @@ "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) + isdir = stat.S_ISDIR(st.st_mode) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information @@ -1022,6 +1027,8 @@ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] + if isdir: + arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes if compress_type is None: @@ -1035,6 +1042,16 @@ self._writecheck(zinfo) self._didModify = True + + if isdir: + zinfo.file_size = 0 + zinfo.compress_size = 0 + zinfo.CRC = 0 + self.filelist.append(zinfo) + self.NameToInfo[zinfo.filename] = zinfo + self.fp.write(zinfo.FileHeader()) + return + fp = io.open(filename, "rb") # Must overwrite CRC and sizes with correct data later zinfo.CRC = CRC = 0 Modified: python/branches/io-c/Makefile.pre.in ============================================================================== --- python/branches/io-c/Makefile.pre.in (original) +++ python/branches/io-c/Makefile.pre.in Tue Jan 27 23:14:53 2009 @@ -256,6 +256,16 @@ ########################################################################## # Python + +OPCODETARGETS_H= \ + $(srcdir)/Python/opcode_targets.h + +OPCODETARGETGEN= \ + $(srcdir)/Python/makeopcodetargets.py + +OPCODETARGETGEN_FILES= \ + $(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py + PYTHON_OBJS= \ Python/_warnings.o \ Python/Python-ast.o \ @@ -577,6 +587,11 @@ $(BYTESTR_DEPS) \ $(srcdir)/Objects/stringlib/formatter.h +$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) + $(OPCODETARGETGEN) $(OPCODETARGETS_H) + +Python/ceval.o: $(OPCODETARGETS_H) + Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ $(BYTESTR_DEPS) Modified: python/branches/io-c/Misc/ACKS ============================================================================== --- python/branches/io-c/Misc/ACKS (original) +++ python/branches/io-c/Misc/ACKS Tue Jan 27 23:14:53 2009 @@ -785,3 +785,4 @@ Uwe Zessin Tarek Ziad? Peter ?strand +Jesse Noller Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Tue Jan 27 23:14:53 2009 @@ -12,6 +12,13 @@ Core and Builtins ----------------- +- 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 + speedups of up to 20%, depending on the system, on various benchmarks. + +- Issue #4874: Most builtin decoders now reject unicode input. + - Issue #4842: Don't allow trailing 'L' when constructing an integer from a string. @@ -48,7 +55,7 @@ Martin von L??wis at http://mail.python.org/pipermail/python-dev/2008-June/080579.html. -- Issue #4604: Some objects of the I/O library could still be used after +- Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev. @@ -137,6 +144,49 @@ Library ------- +- Removed isSequenceType(), isMappingType, and isNumberType() from the + operator module; use the abstract base classes instead. Also removed + the repeat() function; use mul() instead. + +- Issue 5021: doctest.testfile() did not create __name__ and + collections.namedtuple() relied on __name__ being defined. + +- Backport importlib from Python 3.1. Only the import_module() function has + been backported to help facilitate transitions from 2.7 to 3.1. + +- Issue #1885: distutils. When running sdist with --formats=tar,gztar + the tar file was overriden by the gztar one. + +- Issue #4863: distutils.mwerkscompiler has been removed. + +- Added a new itertools functions: combinations_with_replacement() + and compress(). + +- Fix and properly document the multiprocessing module's logging + support, expose the internal levels and provide proper usage + examples. + +- Issue #1672332: fix unpickling of subnormal floats, which was + producing a ValueError on some platforms. + +- Issue #3881: Help Tcl to load even when started through the + unreadable local symlink to "Program Files" on Vista. + +- Issue #4710: Extract directories properly in the zipfile module; + allow adding directories to a zipfile. + +- Issue #3807: _multiprocessing build fails when configure is passed + --without-threads argument. When this occurs, _multiprocessing will + be disabled, and not compiled. + +- Issue #5008: When a file is opened in append mode with the new IO library, + do an explicit seek to the end of file (so that e.g. tell() returns the + file size rather than 0). This is consistent with the behaviour of the + traditional 2.x file object. + +- Issue #5013: Fixed a bug in FileHandler which occurred when the delay + parameter was set. + - Issue #4842: Always append a trailing 'L' when pickling longs using pickle protocol 0. When reading, the 'L' is optional. @@ -146,7 +196,7 @@ _check_logger_class from multiprocessing. - Issue #3325: Remove python2.x try: except: imports for old cPickle from - multiprocessing. + multiprocessing. - Issue #4959: inspect.formatargspec now works for keyword only arguments without defaults. @@ -183,8 +233,8 @@ - Issue #3638: Remove functions from _tkinter module level that depend on TkappObject to work with multiple threads. -- Issue #4718: Adapt the wsgiref package so that it actually works with - Python 3.x, in accordance with the `official amendments of the spec +- Issue #4718: Adapt the wsgiref package so that it actually works with + Python 3.x, in accordance with the `official amendments of the spec `_. - Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float() @@ -202,10 +252,10 @@ - Issue #4795: inspect.isgeneratorfunction() returns False instead of None when the function is not a generator. -- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case - no MSVC compiler is found under Windows. Original patch by Philip Jenvey. +- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case + no MSVC compiler is found under Windows. Original patch by Philip Jenvey. -- Issue #4646: distutils was choking on empty options arg in the setup +- Issue #4646: distutils was choking on empty options arg in the setup function. Original patch by Thomas Heller. - Issue #3767: Convert Tk object to string in tkColorChooser. Modified: python/branches/io-c/Modules/_codecsmodule.c ============================================================================== --- python/branches/io-c/Modules/_codecsmodule.c (original) +++ python/branches/io-c/Modules/_codecsmodule.c Tue Jan 27 23:14:53 2009 @@ -258,7 +258,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_7_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -281,7 +281,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_8_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; @@ -305,7 +305,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -328,7 +328,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode", &pbuf, &errors, &final)) return NULL; @@ -352,7 +352,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:utf_16_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode", &pbuf, &errors, &final)) return NULL; @@ -384,7 +384,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_16_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -409,7 +409,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -432,7 +432,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_le_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -455,7 +455,7 @@ Py_ssize_t consumed; PyObject *decoded; - if (!PyArg_ParseTuple(args, "s*|zi:utf_32_be_decode", + if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -486,7 +486,7 @@ int final = 0; Py_ssize_t consumed; - if (!PyArg_ParseTuple(args, "s*|zii:utf_32_ex_decode", + if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode", &pbuf, &errors, &byteorder, &final)) return NULL; consumed = pbuf.len; /* This is overwritten unless final is true. */ @@ -542,7 +542,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:latin_1_decode", + if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode", &pbuf, &errors)) return NULL; @@ -559,7 +559,7 @@ PyObject *unicode; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:ascii_decode", + if (!PyArg_ParseTuple(args, "y*|z:ascii_decode", &pbuf, &errors)) return NULL; @@ -577,7 +577,7 @@ const char *errors = NULL; PyObject *mapping = NULL; - if (!PyArg_ParseTuple(args, "s*|zO:charmap_decode", + if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode", &pbuf, &errors, &mapping)) return NULL; if (mapping == Py_None) @@ -600,7 +600,7 @@ Py_ssize_t consumed; PyObject *decoded = NULL; - if (!PyArg_ParseTuple(args, "s*|zi:mbcs_decode", + if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode", &pbuf, &errors, &final)) return NULL; consumed = pbuf.len; Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Tue Jan 27 23:14:53 2009 @@ -57,13 +57,15 @@ #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type)) - int _PyFileIO_closed(PyObject *self) { return ((PyFileIOObject *)self)->fd < 0; } +static PyObject * +portable_lseek(int fd, PyObject *posobj, int whence); + /* Returns 0 on success, -1 with exception set on failure. */ static int internal_close(PyFileIOObject *self) @@ -350,6 +352,16 @@ if (PyObject_SetAttrString((PyObject *)self, "name", nameobj) < 0) goto error; + if (append) { + /* For consistent behaviour, we explicitly seek to the + end of file (otherwise, it might be done only on the + first write()). */ + PyObject *pos = portable_lseek(self->fd, NULL, 2); + if (pos == NULL) + goto error; + Py_DECREF(pos); + } + goto done; error: Modified: python/branches/io-c/Modules/_pickle.c ============================================================================== --- python/branches/io-c/Modules/_pickle.c (original) +++ python/branches/io-c/Modules/_pickle.c Tue Jan 27 23:14:53 2009 @@ -2881,7 +2881,7 @@ load_long(UnpicklerObject *self) { PyObject *value; - char *s, *ss; + char *s; Py_ssize_t len; if ((len = unpickler_readline(self, &s)) < 0) @@ -2894,21 +2894,10 @@ compatibility with Python 3.0.0, we don't actually *require* the 'L' to be present. */ if (s[len-2] == 'L') { - ss = (char *)PyMem_Malloc(len-1); - if (ss == NULL) { - PyErr_NoMemory(); - return -1; - } - strncpy(ss, s, len-2); - ss[len-2] = '\0'; - - /* XXX: Should the base argument explicitly set to 10? */ - value = PyLong_FromString(ss, NULL, 0); - PyMem_Free(ss); - } - else { - value = PyLong_FromString(s, NULL, 0); + s[len-2] = '\0'; } + /* XXX: Should the base argument explicitly set to 10? */ + value = PyLong_FromString(s, NULL, 0); if (value == NULL) return -1; @@ -2969,7 +2958,8 @@ errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); return -1; } Modified: python/branches/io-c/Modules/_ssl.c ============================================================================== --- python/branches/io-c/Modules/_ssl.c (original) +++ python/branches/io-c/Modules/_ssl.c Tue Jan 27 23:14:53 2009 @@ -1592,7 +1592,7 @@ for (i = 0; i < _ssl_locks_count; i++) { _ssl_locks[i] = PyThread_allocate_lock(); if (_ssl_locks[i] == NULL) { - int j; + unsigned int j; for (j = 0; j < i; j++) { PyThread_free_lock(_ssl_locks[j]); } 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 Tue Jan 27 23:14:53 2009 @@ -612,7 +612,7 @@ const char *data, *errors = NULL; Py_ssize_t datalen, finalsize; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|z:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode", codeckwarglist, &pdata, &errors)) return NULL; data = pdata.buf; @@ -1038,7 +1038,7 @@ Py_ssize_t wsize, finalsize = 0, size, origpending; int final = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i:decode", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode", incrementalkwarglist, &pdata, &final)) return NULL; data = pdata.buf; Modified: python/branches/io-c/Modules/itertoolsmodule.c ============================================================================== --- python/branches/io-c/Modules/itertoolsmodule.c (original) +++ python/branches/io-c/Modules/itertoolsmodule.c Tue Jan 27 23:14:53 2009 @@ -1683,7 +1683,8 @@ PyObject_GC_UnTrack(lz); Py_XDECREF(lz->pools); Py_XDECREF(lz->result); - PyMem_Free(lz->indices); + if (lz->indices != NULL) + PyMem_Free(lz->indices); Py_TYPE(lz)->tp_free(lz); } @@ -1911,7 +1912,8 @@ PyObject_GC_UnTrack(co); Py_XDECREF(co->pool); Py_XDECREF(co->result); - PyMem_Free(co->indices); + if (co->indices != NULL) + PyMem_Free(co->indices); Py_TYPE(co)->tp_free(co); } @@ -2060,6 +2062,252 @@ }; +/* combinations with replacement object *******************************************/ + +/* Equivalent to: + + def combinations_with_replacement(iterable, r): + "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC" + # number items returned: (n+r-1)! / r! / (n-1)! + pool = tuple(iterable) + n = len(pool) + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) + + def combinations_with_replacement2(iterable, r): + 'Alternate version that filters from product()' + pool = tuple(iterable) + n = len(pool) + for indices in product(range(n), repeat=r): + if sorted(indices) == list(indices): + yield tuple(pool[i] for i in indices) +*/ +typedef struct { + PyObject_HEAD + PyObject *pool; /* input converted to a tuple */ + Py_ssize_t *indices; /* one index per result element */ + PyObject *result; /* most recently returned result tuple */ + Py_ssize_t r; /* size of result tuple */ + int stopped; /* set to 1 when the cwr iterator is exhausted */ +} cwrobject; + +static PyTypeObject cwr_type; + +static PyObject * +cwr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + cwrobject *co; + Py_ssize_t n; + Py_ssize_t r; + PyObject *pool = NULL; + PyObject *iterable = NULL; + Py_ssize_t *indices = NULL; + Py_ssize_t i; + static char *kwargs[] = {"iterable", "r", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:combinations_with_replacement", kwargs, + &iterable, &r)) + return NULL; + + pool = PySequence_Tuple(iterable); + if (pool == NULL) + goto error; + n = PyTuple_GET_SIZE(pool); + if (r < 0) { + PyErr_SetString(PyExc_ValueError, "r must be non-negative"); + goto error; + } + + indices = PyMem_Malloc(r * sizeof(Py_ssize_t)); + if (indices == NULL) { + PyErr_NoMemory(); + goto error; + } + + for (i=0 ; itp_alloc(type, 0); + if (co == NULL) + goto error; + + co->pool = pool; + co->indices = indices; + co->result = NULL; + co->r = r; + co->stopped = !n && r; + + return (PyObject *)co; + +error: + if (indices != NULL) + PyMem_Free(indices); + Py_XDECREF(pool); + return NULL; +} + +static void +cwr_dealloc(cwrobject *co) +{ + PyObject_GC_UnTrack(co); + Py_XDECREF(co->pool); + Py_XDECREF(co->result); + if (co->indices != NULL) + PyMem_Free(co->indices); + Py_TYPE(co)->tp_free(co); +} + +static int +cwr_traverse(cwrobject *co, visitproc visit, void *arg) +{ + Py_VISIT(co->pool); + Py_VISIT(co->result); + return 0; +} + +static PyObject * +cwr_next(cwrobject *co) +{ + PyObject *elem; + PyObject *oldelem; + PyObject *pool = co->pool; + Py_ssize_t *indices = co->indices; + PyObject *result = co->result; + Py_ssize_t n = PyTuple_GET_SIZE(pool); + Py_ssize_t r = co->r; + Py_ssize_t i, j, index; + + if (co->stopped) + return NULL; + + if (result == NULL) { + /* On the first pass, initialize result tuple using the indices */ + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i 1) { + PyObject *old_result = result; + result = PyTuple_New(r); + if (result == NULL) + goto empty; + co->result = result; + for (i=0; i= 0 && indices[i] == n-1; i--) + ; + + /* If i is negative, then the indices are all at + their maximum value and we're done. */ + if (i < 0) + goto empty; + + /* Increment the current index which we know is not at its + maximum. Then set all to the right to the same value. */ + indices[i]++; + for (j=i+1 ; jstopped = 1; + return NULL; +} + +PyDoc_STRVAR(cwr_doc, +"combinations_with_replacement(iterable[, r]) --> combinations_with_replacement object\n\ +\n\ +Return successive r-length combinations of elements in the iterable\n\ +allowing individual elements to have successive repeats.\n\ +combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"); + +static PyTypeObject cwr_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.combinations_with_replacement", /* tp_name */ + sizeof(cwrobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)cwr_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + cwr_doc, /* tp_doc */ + (traverseproc)cwr_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)cwr_next, /* tp_iternext */ + 0, /* 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 */ + cwr_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* permutations object ************************************************************ def permutations(iterable, r=None): @@ -2331,6 +2579,162 @@ }; +/* compress object ************************************************************/ + +/* Equivalent to: + + def compress(data, selectors): + "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" + return (d for d, s in zip(data, selectors) if s) +*/ + +typedef struct { + PyObject_HEAD + PyObject *data; + PyObject *selectors; +} compressobject; + +static PyTypeObject compress_type; + +static PyObject * +compress_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + 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)) + return NULL; + + data = PyObject_GetIter(seq1); + if (data == NULL) + goto fail; + selectors = PyObject_GetIter(seq2); + if (selectors == NULL) + goto fail; + + /* create compressobject structure */ + lz = (compressobject *)type->tp_alloc(type, 0); + if (lz == NULL) + goto fail; + lz->data = data; + lz->selectors = selectors; + return (PyObject *)lz; + +fail: + Py_XDECREF(data); + Py_XDECREF(selectors); + return NULL; +} + +static void +compress_dealloc(compressobject *lz) +{ + PyObject_GC_UnTrack(lz); + Py_XDECREF(lz->data); + Py_XDECREF(lz->selectors); + Py_TYPE(lz)->tp_free(lz); +} + +static int +compress_traverse(compressobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->data); + Py_VISIT(lz->selectors); + return 0; +} + +static PyObject * +compress_next(compressobject *lz) +{ + PyObject *data = lz->data, *selectors = lz->selectors; + PyObject *datum, *selector; + PyObject *(*datanext)(PyObject *) = *Py_TYPE(data)->tp_iternext; + PyObject *(*selectornext)(PyObject *) = *Py_TYPE(selectors)->tp_iternext; + int ok; + + while (1) { + /* Steps: get datum, get selector, evaluate selector. + Order is important (to match the pure python version + in terms of which input gets a chance to raise an + exception first). + */ + + datum = datanext(data); + if (datum == NULL) + return NULL; + + selector = selectornext(selectors); + if (selector == NULL) { + Py_DECREF(datum); + return NULL; + } + + ok = PyObject_IsTrue(selector); + Py_DECREF(selector); + if (ok == 1) + return datum; + Py_DECREF(datum); + if (ok == -1) + return NULL; + } +} + +PyDoc_STRVAR(compress_doc, +"compress(data sequence, selector sequence) --> 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\ +selectors to choose the data elements."); + +static PyTypeObject compress_type = { + PyVarObject_HEAD_INIT(NULL, 0) + "itertools.compress", /* tp_name */ + sizeof(compressobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)compress_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 | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + compress_doc, /* tp_doc */ + (traverseproc)compress_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)compress_next, /* tp_iternext */ + 0, /* 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 */ + compress_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ +}; + + /* filterfalse object ************************************************************/ typedef struct { @@ -3035,12 +3439,14 @@ char *name; PyTypeObject *typelist[] = { &combinations_type, + &cwr_type, &cycle_type, &dropwhile_type, &takewhile_type, &islice_type, &starmap_type, &chain_type, + &compress_type, &filterfalse_type, &count_type, &ziplongest_type, Modified: python/branches/io-c/Modules/operator.c ============================================================================== --- python/branches/io-c/Modules/operator.c (original) +++ python/branches/io-c/Modules/operator.c Tue Jan 27 23:14:53 2009 @@ -65,7 +65,6 @@ if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \ return PyObject_RichCompare(a1,a2,A); } -spami(isNumberType , PyNumber_Check) spami(truth , PyObject_IsTrue) spam2(op_add , PyNumber_Add) spam2(op_sub , PyNumber_Subtract) @@ -95,15 +94,11 @@ spam2(op_iand , PyNumber_InPlaceAnd) spam2(op_ixor , PyNumber_InPlaceXor) spam2(op_ior , PyNumber_InPlaceOr) -spami(isSequenceType , PySequence_Check) spam2(op_concat , PySequence_Concat) -spamoi(op_repeat , PySequence_Repeat) spam2(op_iconcat , PySequence_InPlaceConcat) -spamoi(op_irepeat , PySequence_InPlaceRepeat) spami2b(op_contains , PySequence_Contains) spamn2(indexOf , PySequence_Index) spamn2(countOf , PySequence_Count) -spami(isMappingType , PyMapping_Check) spam2(op_getitem , PyObject_GetItem) spam2n(op_delitem , PyObject_DelItem) spam3n(op_setitem , PyObject_SetItem) @@ -173,10 +168,6 @@ static struct PyMethodDef operator_methods[] = { -spam1o(isNumberType, - "isNumberType(a) -- Return True if a has a numeric type, False otherwise.") -spam1o(isSequenceType, - "isSequenceType(a) -- Return True if a has a sequence type, False otherwise.") spam1o(truth, "truth(a) -- Return True if a is true, False otherwise.") spam2(contains,__contains__, @@ -185,8 +176,6 @@ "indexOf(a, b) -- Return the first index of b in a.") spam1(countOf, "countOf(a, b) -- Return the number of times b occurs in a.") -spam1o(isMappingType, - "isMappingType(a) -- Return True if a has a mapping type, False otherwise.") spam1(is_, "is_(a, b) -- Same as a is b.") spam1(is_not, "is_not(a, b) -- Same as a is not b.") @@ -221,12 +210,8 @@ spam2(ior,__ior__, "ior(a, b) -- Same as a |= b.") spam2(concat,__concat__, "concat(a, b) -- Same as a + b, for a and b sequences.") -spam2(repeat,__repeat__, - "repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.") spam2(iconcat,__iconcat__, "iconcat(a, b) -- Same as a += b, for a and b sequences.") -spam2(irepeat,__irepeat__, - "irepeat(a, b) -- Same as a *= b, where a is a sequence, and b is an integer.") spam2(getitem,__getitem__, "getitem(a, b) -- Same as a[b].") spam2(setitem,__setitem__, Modified: python/branches/io-c/Objects/longobject.c ============================================================================== --- python/branches/io-c/Objects/longobject.c (original) +++ python/branches/io-c/Objects/longobject.c Tue Jan 27 23:14:53 2009 @@ -175,7 +175,7 @@ PyLong_FromLong(long ival) { PyLongObject *v; - unsigned long abs_ival; + unsigned long abs_ival; unsigned long t; /* unsigned so >> doesn't propagate sign bit */ int ndigits = 0; int sign = 1; @@ -183,33 +183,35 @@ CHECK_SMALL_INT(ival); if (ival < 0) { - /* if LONG_MIN == -LONG_MAX-1 (true on most platforms) then - ANSI C says that the result of -ival is undefined when ival - == LONG_MIN. Hence the following workaround. */ - abs_ival = (unsigned long)(-1-ival) + 1; + /* negate: can't write this as abs_ival = -ival since that + invokes undefined behaviour when ival is LONG_MIN */ + abs_ival = 0U-(unsigned long)ival; sign = -1; } else { abs_ival = (unsigned long)ival; } - /* Fast path for single-digits ints */ - if (!(ival>>PyLong_SHIFT)) { + /* Fast path for single-digit ints */ + if (!(abs_ival >> PyLong_SHIFT)) { v = _PyLong_New(1); if (v) { Py_SIZE(v) = sign; - v->ob_digit[0] = (digit)ival; + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival, unsigned long, digit); } return (PyObject*)v; } /* 2 digits */ - if (!(ival >> 2*PyLong_SHIFT)) { + if (!(abs_ival >> 2*PyLong_SHIFT)) { v = _PyLong_New(2); if (v) { Py_SIZE(v) = 2*sign; - v->ob_digit[0] = (digit)ival & PyLong_MASK; - v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT); + v->ob_digit[0] = Py_SAFE_DOWNCAST( + abs_ival & PyLong_MASK, unsigned long, digit); + v->ob_digit[1] = Py_SAFE_DOWNCAST( + abs_ival >> PyLong_SHIFT, unsigned long, digit); } return (PyObject*)v; } @@ -226,7 +228,8 @@ Py_SIZE(v) = ndigits*sign; t = abs_ival; while (t) { - *p++ = (digit)(t & PyLong_MASK); + *p++ = Py_SAFE_DOWNCAST( + t & PyLong_MASK, unsigned long, digit); t >>= PyLong_SHIFT; } } @@ -739,7 +742,7 @@ /* Because we're going LSB to MSB, thisbyte is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisbyte << accumbits; + accum |= (twodigits)thisbyte << accumbits; accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ @@ -768,12 +771,12 @@ unsigned char* bytes, size_t n, int little_endian, int is_signed) { - int i; /* index into v->ob_digit */ + Py_ssize_t i; /* index into v->ob_digit */ Py_ssize_t ndigits; /* |v->ob_size| */ twodigits accum; /* sliding register */ unsigned int accumbits; /* # bits in accum */ int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */ - twodigits carry; /* for computing 2's-comp */ + digit carry; /* for computing 2's-comp */ size_t j; /* # bytes filled */ unsigned char* p; /* pointer to next byte in bytes */ int pincr; /* direction to move p */ @@ -813,7 +816,7 @@ accumbits = 0; carry = do_twos_comp ? 1 : 0; for (i = 0; i < ndigits; ++i) { - twodigits thisdigit = v->ob_digit[i]; + digit thisdigit = v->ob_digit[i]; if (do_twos_comp) { thisdigit = (thisdigit ^ PyLong_MASK) + carry; carry = thisdigit >> PyLong_SHIFT; @@ -822,26 +825,23 @@ /* Because we're going LSB to MSB, thisdigit is more significant than what's already in accum, so needs to be prepended to accum. */ - accum |= thisdigit << accumbits; - accumbits += PyLong_SHIFT; + accum |= (twodigits)thisdigit << accumbits; /* The most-significant digit may be (probably is) at least partly empty. */ if (i == ndigits - 1) { /* Count # of sign bits -- they needn't be stored, * although for signed conversion we need later to - * make sure at least one sign bit gets stored. - * First shift conceptual sign bit to real sign bit. - */ - stwodigits s = (stwodigits)(thisdigit << - (8*sizeof(stwodigits) - PyLong_SHIFT)); - unsigned int nsignbits = 0; - while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) { - ++nsignbits; - s <<= 1; + * make sure at least one sign bit gets stored. */ + digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : + thisdigit; + while (s != 0) { + s >>= 1; + accumbits++; } - accumbits -= nsignbits; } + else + accumbits += PyLong_SHIFT; /* Store as many bytes as possible. */ while (accumbits >= 8) { @@ -1361,7 +1361,7 @@ static digit v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit carry = 0; assert(m >= n); @@ -1387,7 +1387,7 @@ static digit v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n) { - int i; + Py_ssize_t i; digit borrow = 0; assert(m >= n); @@ -1453,7 +1453,7 @@ digit hi; rem = (rem << PyLong_SHIFT) + *--pin; *--pout = hi = (digit)(rem / n); - rem -= hi * n; + rem -= (twodigits)hi * n; } return (digit)rem; } @@ -1712,11 +1712,11 @@ while (--p >= start) { int k = (int)_PyLong_DigitValue[Py_CHARMASK(*p)]; assert(k >= 0 && k < base); - accum |= (twodigits)(k << bits_in_accum); + accum |= (twodigits)k << bits_in_accum; bits_in_accum += bits_per_char; if (bits_in_accum >= PyLong_SHIFT) { *pdigit++ = (digit)(accum & PyLong_MASK); - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); accum >>= PyLong_SHIFT; bits_in_accum -= PyLong_SHIFT; assert(bits_in_accum < PyLong_SHIFT); @@ -1725,7 +1725,7 @@ if (bits_in_accum) { assert(bits_in_accum <= PyLong_SHIFT); *pdigit++ = (digit)accum; - assert(pdigit - z->ob_digit <= (int)n); + assert(pdigit - z->ob_digit <= n); } while (pdigit - z->ob_digit < n) *pdigit++ = 0; @@ -2120,7 +2120,7 @@ digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; twodigits q; stwodigits carry = 0; - int i; + Py_ssize_t i; SIGCHECK({ Py_DECREF(a); @@ -2274,7 +2274,7 @@ static long long_hash(PyLongObject *v) { - long x; + unsigned long x; Py_ssize_t i; int sign; @@ -2294,17 +2294,18 @@ i = -(i); } #define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) - /* The following loop produces a C long x such that (unsigned long)x - is congruent to the absolute value of v modulo ULONG_MAX. The + /* 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 << PyLong_SHIFT) & ~PyLong_MASK) | + ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); x += v->ob_digit[i]; - /* If the addition above overflowed (thinking of x as - unsigned), we compensate by incrementing. This preserves - the value modulo ULONG_MAX. */ - if ((unsigned long)x < v->ob_digit[i]) + /* If the addition above overflowed we compensate by + incrementing. This preserves the value modulo + ULONG_MAX. */ + if (x < v->ob_digit[i]) x++; } #undef LONG_BIT_PyLong_SHIFT @@ -2322,7 +2323,7 @@ { Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b)); PyLongObject *z; - int i; + Py_ssize_t i; digit carry = 0; /* Ensure a is the larger of the two: */ Modified: python/branches/io-c/Objects/stringlib/fastsearch.h ============================================================================== --- python/branches/io-c/Objects/stringlib/fastsearch.h (original) +++ python/branches/io-c/Objects/stringlib/fastsearch.h Tue Jan 27 23:14:53 2009 @@ -5,7 +5,7 @@ /* fast search/count implementation, based on a mix between boyer- moore and horspool, with a few more bells and whistles on the top. - for some more background, see: http://effbot.org/stringlib */ + for some more background, see: http://effbot.org/stringlib.htm */ /* note: fastsearch may access s[n], which isn't a problem when using Python's ordinary string types, but may cause problems if you're Modified: python/branches/io-c/Python/ceval.c ============================================================================== --- python/branches/io-c/Python/ceval.c (original) +++ python/branches/io-c/Python/ceval.c Tue Jan 27 23:14:53 2009 @@ -705,6 +705,114 @@ char *filename; #endif +/* Computed GOTOs, or + the-optimization-commonly-but-improperly-known-as-"threaded code" + using gcc's labels-as-values extension + (http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html). + + The traditional bytecode evaluation loop uses a "switch" statement, which + decent compilers will optimize as a single indirect branch instruction + combined with a lookup table of jump addresses. However, since the + indirect jump instruction is shared by all opcodes, the CPU will have a + hard time making the right prediction for where to jump next (actually, + it will be always wrong except in the uncommon case of a sequence of + several identical opcodes). + + "Threaded code" in contrast, uses an explicit jump table and an explicit + indirect jump instruction at the end of each opcode. Since the jump + instruction is at a different address for each opcode, the CPU will make a + separate prediction for each of these instructions, which is equivalent to + predicting the second opcode of each opcode pair. These predictions have + a much better chance to turn out valid, especially in small bytecode loops. + + A mispredicted branch on a modern CPU flushes the whole pipeline and + can cost several CPU cycles (depending on the pipeline depth), + and potentially many more instructions (depending on the pipeline width). + A correctly predicted branch, however, is nearly free. + + At the time of this writing, the "threaded code" version is up to 15-20% + faster than the normal "switch" version, depending on the compiler and the + CPU architecture. + + We disable the optimization if DYNAMIC_EXECUTION_PROFILE is defined, + because it would render the measurements invalid. + + + NOTE: care must be taken that the compiler doesn't try to "optimize" the + indirect jumps by sharing them between all opcodes. Such optimizations + can be disabled on gcc by using the -fno-gcse flag (or possibly + -fno-crossjumping). +*/ + +#if defined(USE_COMPUTED_GOTOS) && defined(DYNAMIC_EXECUTION_PROFILE) +#undef USE_COMPUTED_GOTOS +#endif + +#ifdef USE_COMPUTED_GOTOS +/* Import the static jump table */ +#include "opcode_targets.h" + +/* This macro is used when several opcodes defer to the same implementation + (e.g. SETUP_LOOP, SETUP_FINALLY) */ +#define TARGET_WITH_IMPL(op, impl) \ + TARGET_##op: \ + opcode = op; \ + if (HAS_ARG(op)) \ + oparg = NEXTARG(); \ + case op: \ + goto impl; \ + +#define TARGET(op) \ + TARGET_##op: \ + opcode = op; \ + if (HAS_ARG(op)) \ + oparg = NEXTARG(); \ + case op: + + +#define DISPATCH() \ + { \ + /* Avoid multiple loads from _Py_Ticker despite `volatile` */ \ + int _tick = _Py_Ticker - 1; \ + _Py_Ticker = _tick; \ + if (_tick >= 0) { \ + FAST_DISPATCH(); \ + } \ + continue; \ + } + +#ifdef LLTRACE +#define FAST_DISPATCH() \ + { \ + if (!lltrace && !_Py_TracingPossible) { \ + f->f_lasti = INSTR_OFFSET(); \ + goto *opcode_targets[*next_instr++]; \ + } \ + goto fast_next_opcode; \ + } +#else +#define FAST_DISPATCH() \ + { \ + if (!_Py_TracingPossible) { \ + f->f_lasti = INSTR_OFFSET(); \ + goto *opcode_targets[*next_instr++]; \ + } \ + goto fast_next_opcode; \ + } +#endif + +#else +#define TARGET(op) \ + case op: +#define TARGET_WITH_IMPL(op, impl) \ + /* silence compiler warnings about `impl` unused */ \ + if (0) goto impl; \ + case op: +#define DISPATCH() continue +#define FAST_DISPATCH() goto fast_next_opcode +#endif + + /* Tuple access macros */ #ifndef Py_DEBUG @@ -782,16 +890,23 @@ predictions turned-on and interpret the results as if some opcodes had been combined or turn-off predictions so that the opcode frequency counter updates for both opcodes. + + Opcode prediction is disabled with threaded code, since the latter allows + the CPU to record separate branch prediction information for each + opcode. + */ -#ifdef DYNAMIC_EXECUTION_PROFILE +#if defined(DYNAMIC_EXECUTION_PROFILE) || defined(USE_COMPUTED_GOTOS) #define PREDICT(op) if (0) goto PRED_##op +#define PREDICTED(op) PRED_##op: +#define PREDICTED_WITH_ARG(op) PRED_##op: #else #define PREDICT(op) if (*next_instr == op) goto PRED_##op -#endif - #define PREDICTED(op) PRED_##op: next_instr++ #define PREDICTED_WITH_ARG(op) PRED_##op: oparg = PEEKARG(); next_instr += 3 +#endif + /* Stack manipulation macros */ @@ -1153,56 +1268,56 @@ /* case STOP_CODE: this is an error! */ - case NOP: - goto fast_next_opcode; + TARGET(NOP) + FAST_DISPATCH(); - case LOAD_FAST: + TARGET(LOAD_FAST) x = GETLOCAL(oparg); if (x != NULL) { Py_INCREF(x); PUSH(x); - goto fast_next_opcode; + FAST_DISPATCH(); } format_exc_check_arg(PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, PyTuple_GetItem(co->co_varnames, oparg)); break; - case LOAD_CONST: + TARGET(LOAD_CONST) x = GETITEM(consts, oparg); Py_INCREF(x); PUSH(x); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED_WITH_ARG(STORE_FAST); - case STORE_FAST: + TARGET(STORE_FAST) v = POP(); SETLOCAL(oparg, v); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED(POP_TOP); - case POP_TOP: + TARGET(POP_TOP) v = POP(); Py_DECREF(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_TWO: + TARGET(ROT_TWO) v = TOP(); w = SECOND(); SET_TOP(w); SET_SECOND(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_THREE: + TARGET(ROT_THREE) v = TOP(); w = SECOND(); x = THIRD(); SET_TOP(w); SET_SECOND(x); SET_THIRD(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case ROT_FOUR: + TARGET(ROT_FOUR) u = TOP(); v = SECOND(); w = THIRD(); @@ -1211,15 +1326,15 @@ SET_SECOND(w); SET_THIRD(x); SET_FOURTH(u); - goto fast_next_opcode; + FAST_DISPATCH(); - case DUP_TOP: + TARGET(DUP_TOP) v = TOP(); Py_INCREF(v); PUSH(v); - goto fast_next_opcode; + FAST_DISPATCH(); - case DUP_TOPX: + TARGET(DUP_TOPX) if (oparg == 2) { x = TOP(); Py_INCREF(x); @@ -1228,7 +1343,7 @@ STACKADJ(2); SET_TOP(x); SET_SECOND(w); - goto fast_next_opcode; + FAST_DISPATCH(); } else if (oparg == 3) { x = TOP(); Py_INCREF(x); @@ -1240,106 +1355,106 @@ SET_TOP(x); SET_SECOND(w); SET_THIRD(v); - goto fast_next_opcode; + FAST_DISPATCH(); } Py_FatalError("invalid argument to DUP_TOPX" " (bytecode corruption?)"); /* Never returns, so don't bother to set why. */ break; - case UNARY_POSITIVE: + TARGET(UNARY_POSITIVE) v = TOP(); x = PyNumber_Positive(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case UNARY_NEGATIVE: + TARGET(UNARY_NEGATIVE) v = TOP(); x = PyNumber_Negative(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case UNARY_NOT: + TARGET(UNARY_NOT) v = TOP(); err = PyObject_IsTrue(v); Py_DECREF(v); if (err == 0) { Py_INCREF(Py_True); SET_TOP(Py_True); - continue; + DISPATCH(); } else if (err > 0) { Py_INCREF(Py_False); SET_TOP(Py_False); err = 0; - continue; + DISPATCH(); } STACKADJ(-1); break; - case UNARY_INVERT: + TARGET(UNARY_INVERT) v = TOP(); x = PyNumber_Invert(v); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_POWER: + TARGET(BINARY_POWER) w = POP(); v = TOP(); x = PyNumber_Power(v, w, Py_None); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_MULTIPLY: + TARGET(BINARY_MULTIPLY) w = POP(); v = TOP(); x = PyNumber_Multiply(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_TRUE_DIVIDE: + TARGET(BINARY_TRUE_DIVIDE) w = POP(); v = TOP(); x = PyNumber_TrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_FLOOR_DIVIDE: + TARGET(BINARY_FLOOR_DIVIDE) w = POP(); v = TOP(); x = PyNumber_FloorDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_MODULO: + TARGET(BINARY_MODULO) w = POP(); v = TOP(); x = PyNumber_Remainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_ADD: + TARGET(BINARY_ADD) w = POP(); v = TOP(); if (PyUnicode_CheckExact(v) && @@ -1355,152 +1470,152 @@ skip_decref_vx: Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_SUBTRACT: + TARGET(BINARY_SUBTRACT) w = POP(); v = TOP(); x = PyNumber_Subtract(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_SUBSCR: + TARGET(BINARY_SUBSCR) w = POP(); v = TOP(); x = PyObject_GetItem(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_LSHIFT: + TARGET(BINARY_LSHIFT) w = POP(); v = TOP(); x = PyNumber_Lshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_RSHIFT: + TARGET(BINARY_RSHIFT) w = POP(); v = TOP(); x = PyNumber_Rshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_AND: + TARGET(BINARY_AND) w = POP(); v = TOP(); x = PyNumber_And(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_XOR: + TARGET(BINARY_XOR) w = POP(); v = TOP(); x = PyNumber_Xor(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case BINARY_OR: + TARGET(BINARY_OR) w = POP(); v = TOP(); x = PyNumber_Or(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case LIST_APPEND: + TARGET(LIST_APPEND) w = POP(); v = stack_pointer[-oparg]; err = PyList_Append(v, w); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case SET_ADD: + TARGET(SET_ADD) w = POP(); v = stack_pointer[-oparg]; err = PySet_Add(v, w); Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case INPLACE_POWER: + TARGET(INPLACE_POWER) w = POP(); v = TOP(); x = PyNumber_InPlacePower(v, w, Py_None); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_MULTIPLY: + TARGET(INPLACE_MULTIPLY) w = POP(); v = TOP(); x = PyNumber_InPlaceMultiply(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_TRUE_DIVIDE: + TARGET(INPLACE_TRUE_DIVIDE) w = POP(); v = TOP(); x = PyNumber_InPlaceTrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_FLOOR_DIVIDE: + TARGET(INPLACE_FLOOR_DIVIDE) w = POP(); v = TOP(); x = PyNumber_InPlaceFloorDivide(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_MODULO: + TARGET(INPLACE_MODULO) w = POP(); v = TOP(); x = PyNumber_InPlaceRemainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_ADD: + TARGET(INPLACE_ADD) w = POP(); v = TOP(); if (PyUnicode_CheckExact(v) && @@ -1516,70 +1631,70 @@ skip_decref_v: Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_SUBTRACT: + TARGET(INPLACE_SUBTRACT) w = POP(); v = TOP(); x = PyNumber_InPlaceSubtract(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_LSHIFT: + TARGET(INPLACE_LSHIFT) w = POP(); v = TOP(); x = PyNumber_InPlaceLshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_RSHIFT: + TARGET(INPLACE_RSHIFT) w = POP(); v = TOP(); x = PyNumber_InPlaceRshift(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_AND: + TARGET(INPLACE_AND) w = POP(); v = TOP(); x = PyNumber_InPlaceAnd(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_XOR: + TARGET(INPLACE_XOR) w = POP(); v = TOP(); x = PyNumber_InPlaceXor(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case INPLACE_OR: + TARGET(INPLACE_OR) w = POP(); v = TOP(); x = PyNumber_InPlaceOr(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case STORE_SUBSCR: + TARGET(STORE_SUBSCR) w = TOP(); v = SECOND(); u = THIRD(); @@ -1589,10 +1704,10 @@ Py_DECREF(u); Py_DECREF(v); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_SUBSCR: + TARGET(DELETE_SUBSCR) w = TOP(); v = SECOND(); STACKADJ(-2); @@ -1600,10 +1715,10 @@ err = PyObject_DelItem(v, w); Py_DECREF(v); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case PRINT_EXPR: + TARGET(PRINT_EXPR) v = POP(); w = PySys_GetObject("displayhook"); if (w == NULL) { @@ -1630,7 +1745,7 @@ #ifdef CASE_TOO_BIG default: switch (opcode) { #endif - case RAISE_VARARGS: + TARGET(RAISE_VARARGS) v = w = NULL; switch (oparg) { case 2: @@ -1648,19 +1763,19 @@ } break; - case STORE_LOCALS: + TARGET(STORE_LOCALS) x = POP(); v = f->f_locals; Py_XDECREF(v); f->f_locals = x; - continue; + DISPATCH(); - case RETURN_VALUE: + TARGET(RETURN_VALUE) retval = POP(); why = WHY_RETURN; goto fast_block_end; - case YIELD_VALUE: + TARGET(YIELD_VALUE) retval = POP(); f->f_stacktop = stack_pointer; why = WHY_YIELD; @@ -1670,7 +1785,7 @@ SWAP_EXC_STATE(); goto fast_yield; - case POP_EXCEPT: + TARGET(POP_EXCEPT) { PyTryBlock *b = PyFrame_BlockPop(f); if (b->b_type != EXCEPT_HANDLER) { @@ -1681,17 +1796,17 @@ } UNWIND_EXCEPT_HANDLER(b); } - continue; + DISPATCH(); - case POP_BLOCK: + TARGET(POP_BLOCK) { PyTryBlock *b = PyFrame_BlockPop(f); UNWIND_BLOCK(b); } - continue; + DISPATCH(); PREDICTED(END_FINALLY); - case END_FINALLY: + TARGET(END_FINALLY) v = POP(); if (PyLong_Check(v)) { why = (enum why_code) PyLong_AS_LONG(v); @@ -1731,7 +1846,7 @@ Py_DECREF(v); break; - case LOAD_BUILD_CLASS: + TARGET(LOAD_BUILD_CLASS) x = PyDict_GetItemString(f->f_builtins, "__build_class__"); if (x == NULL) { @@ -1743,7 +1858,7 @@ PUSH(x); break; - case STORE_NAME: + TARGET(STORE_NAME) w = GETITEM(names, oparg); v = POP(); if ((x = f->f_locals) != NULL) { @@ -1752,14 +1867,14 @@ else err = PyObject_SetItem(x, w, v); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; } PyErr_Format(PyExc_SystemError, "no locals found when storing %R", w); break; - case DELETE_NAME: + TARGET(DELETE_NAME) w = GETITEM(names, oparg); if ((x = f->f_locals) != NULL) { if ((err = PyObject_DelItem(x, w)) != 0) @@ -1773,7 +1888,7 @@ break; PREDICTED_WITH_ARG(UNPACK_SEQUENCE); - case UNPACK_SEQUENCE: + TARGET(UNPACK_SEQUENCE) v = POP(); if (PyTuple_CheckExact(v) && PyTuple_GET_SIZE(v) == oparg) { @@ -1785,7 +1900,7 @@ PUSH(w); } Py_DECREF(v); - continue; + DISPATCH(); } else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) { PyObject **items = \ @@ -1805,7 +1920,7 @@ Py_DECREF(v); break; - case UNPACK_EX: + TARGET(UNPACK_EX) { int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); v = POP(); @@ -1820,7 +1935,7 @@ break; } - case STORE_ATTR: + TARGET(STORE_ATTR) w = GETITEM(names, oparg); v = TOP(); u = SECOND(); @@ -1828,10 +1943,10 @@ err = PyObject_SetAttr(v, w, u); /* v.w = u */ Py_DECREF(v); Py_DECREF(u); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_ATTR: + TARGET(DELETE_ATTR) w = GETITEM(names, oparg); v = POP(); err = PyObject_SetAttr(v, w, (PyObject *)NULL); @@ -1839,22 +1954,22 @@ Py_DECREF(v); break; - case STORE_GLOBAL: + TARGET(STORE_GLOBAL) w = GETITEM(names, oparg); v = POP(); err = PyDict_SetItem(f->f_globals, w, v); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case DELETE_GLOBAL: + TARGET(DELETE_GLOBAL) w = GETITEM(names, oparg); if ((err = PyDict_DelItem(f->f_globals, w)) != 0) format_exc_check_arg( PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w); break; - case LOAD_NAME: + TARGET(LOAD_NAME) w = GETITEM(names, oparg); if ((v = f->f_locals) == NULL) { PyErr_Format(PyExc_SystemError, @@ -1889,9 +2004,9 @@ Py_INCREF(x); } PUSH(x); - continue; + DISPATCH(); - case LOAD_GLOBAL: + TARGET(LOAD_GLOBAL) w = GETITEM(names, oparg); if (PyUnicode_CheckExact(w)) { /* Inline the PyDict_GetItem() calls. @@ -1911,7 +2026,7 @@ if (x != NULL) { Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); } d = (PyDictObject *)(f->f_builtins); e = d->ma_lookup(d, w, hash); @@ -1923,7 +2038,7 @@ if (x != NULL) { Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); } goto load_global_error; } @@ -1942,13 +2057,13 @@ } Py_INCREF(x); PUSH(x); - continue; + DISPATCH(); - case DELETE_FAST: + TARGET(DELETE_FAST) x = GETLOCAL(oparg); if (x != NULL) { SETLOCAL(oparg, NULL); - continue; + DISPATCH(); } format_exc_check_arg( PyExc_UnboundLocalError, @@ -1957,19 +2072,19 @@ ); break; - case LOAD_CLOSURE: + TARGET(LOAD_CLOSURE) x = freevars[oparg]; Py_INCREF(x); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case LOAD_DEREF: + TARGET(LOAD_DEREF) x = freevars[oparg]; w = PyCell_Get(x); if (w != NULL) { PUSH(w); - continue; + DISPATCH(); } err = -1; /* Don't stomp existing exception */ @@ -1990,14 +2105,14 @@ } break; - case STORE_DEREF: + TARGET(STORE_DEREF) w = POP(); x = freevars[oparg]; PyCell_Set(x, w); Py_DECREF(w); - continue; + DISPATCH(); - case BUILD_TUPLE: + TARGET(BUILD_TUPLE) x = PyTuple_New(oparg); if (x != NULL) { for (; --oparg >= 0;) { @@ -2005,11 +2120,11 @@ PyTuple_SET_ITEM(x, oparg, w); } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_LIST: + TARGET(BUILD_LIST) x = PyList_New(oparg); if (x != NULL) { for (; --oparg >= 0;) { @@ -2017,11 +2132,11 @@ PyList_SET_ITEM(x, oparg, w); } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_SET: + TARGET(BUILD_SET) x = PySet_New(NULL); if (x != NULL) { for (; --oparg >= 0;) { @@ -2035,17 +2150,17 @@ break; } PUSH(x); - continue; + DISPATCH(); } break; - case BUILD_MAP: + TARGET(BUILD_MAP) x = _PyDict_NewPresized((Py_ssize_t)oparg); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case STORE_MAP: + TARGET(STORE_MAP) w = TOP(); /* key */ u = SECOND(); /* value */ v = THIRD(); /* dict */ @@ -2054,10 +2169,10 @@ err = PyDict_SetItem(v, w, u); /* v[w] = u */ Py_DECREF(u); Py_DECREF(w); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case MAP_ADD: + TARGET(MAP_ADD) w = TOP(); /* key */ u = SECOND(); /* value */ STACKADJ(-2); @@ -2068,20 +2183,20 @@ Py_DECREF(w); if (err == 0) { PREDICT(JUMP_ABSOLUTE); - continue; + DISPATCH(); } break; - case LOAD_ATTR: + TARGET(LOAD_ATTR) w = GETITEM(names, oparg); v = TOP(); x = PyObject_GetAttr(v, w); Py_DECREF(v); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case COMPARE_OP: + TARGET(COMPARE_OP) w = POP(); v = TOP(); x = cmp_outcome(oparg, v, w); @@ -2091,9 +2206,9 @@ if (x == NULL) break; PREDICT(JUMP_IF_FALSE); PREDICT(JUMP_IF_TRUE); - continue; + DISPATCH(); - case IMPORT_NAME: + TARGET(IMPORT_NAME) w = GETITEM(names, oparg); x = PyDict_GetItemString(f->f_builtins, "__import__"); if (x == NULL) { @@ -2134,10 +2249,10 @@ READ_TIMESTAMP(intr1); Py_DECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case IMPORT_STAR: + TARGET(IMPORT_STAR) v = POP(); PyFrame_FastToLocals(f); if ((x = f->f_locals) == NULL) { @@ -2150,33 +2265,33 @@ READ_TIMESTAMP(intr1); PyFrame_LocalsToFast(f, 0); Py_DECREF(v); - if (err == 0) continue; + if (err == 0) DISPATCH(); break; - case IMPORT_FROM: + TARGET(IMPORT_FROM) w = GETITEM(names, oparg); v = TOP(); READ_TIMESTAMP(intr0); x = import_from(v, w); READ_TIMESTAMP(intr1); PUSH(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case JUMP_FORWARD: + TARGET(JUMP_FORWARD) JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); PREDICTED_WITH_ARG(JUMP_IF_FALSE); - case JUMP_IF_FALSE: + TARGET(JUMP_IF_FALSE) w = TOP(); if (w == Py_True) { PREDICT(POP_TOP); - goto fast_next_opcode; + FAST_DISPATCH(); } if (w == Py_False) { JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); } err = PyObject_IsTrue(w); if (err > 0) @@ -2185,18 +2300,18 @@ JUMPBY(oparg); else break; - continue; + DISPATCH(); PREDICTED_WITH_ARG(JUMP_IF_TRUE); - case JUMP_IF_TRUE: + TARGET(JUMP_IF_TRUE) w = TOP(); if (w == Py_False) { PREDICT(POP_TOP); - goto fast_next_opcode; + FAST_DISPATCH(); } if (w == Py_True) { JUMPBY(oparg); - goto fast_next_opcode; + FAST_DISPATCH(); } err = PyObject_IsTrue(w); if (err > 0) { @@ -2207,10 +2322,10 @@ ; else break; - continue; + DISPATCH(); PREDICTED_WITH_ARG(JUMP_ABSOLUTE); - case JUMP_ABSOLUTE: + TARGET(JUMP_ABSOLUTE) JUMPTO(oparg); #if FAST_LOOPS /* Enabling this path speeds-up all while and for-loops by bypassing @@ -2218,14 +2333,14 @@ because it prevents detection of a control-break in tight loops like "while 1: pass". Compile with this option turned-on when you need the speed-up and do not need break checking inside tight loops (ones - that contain only instructions ending with goto fast_next_opcode). + that contain only instructions ending with FAST_DISPATCH). */ - goto fast_next_opcode; + FAST_DISPATCH(); #else - continue; + DISPATCH(); #endif - case GET_ITER: + TARGET(GET_ITER) /* before: [obj]; after [getiter(obj)] */ v = TOP(); x = PyObject_GetIter(v); @@ -2233,13 +2348,13 @@ if (x != NULL) { SET_TOP(x); PREDICT(FOR_ITER); - continue; + DISPATCH(); } STACKADJ(-1); break; PREDICTED_WITH_ARG(FOR_ITER); - case FOR_ITER: + TARGET(FOR_ITER) /* before: [iter]; after: [iter, iter()] *or* [] */ v = TOP(); x = (*v->ob_type->tp_iternext)(v); @@ -2247,7 +2362,7 @@ PUSH(x); PREDICT(STORE_FAST); PREDICT(UNPACK_SEQUENCE); - continue; + DISPATCH(); } if (PyErr_Occurred()) { if (!PyErr_ExceptionMatches( @@ -2259,13 +2374,13 @@ x = v = POP(); Py_DECREF(v); JUMPBY(oparg); - continue; + DISPATCH(); - case BREAK_LOOP: + TARGET(BREAK_LOOP) why = WHY_BREAK; goto fast_block_end; - case CONTINUE_LOOP: + TARGET(CONTINUE_LOOP) retval = PyLong_FromLong(oparg); if (!retval) { x = NULL; @@ -2274,9 +2389,10 @@ why = WHY_CONTINUE; goto fast_block_end; - case SETUP_LOOP: - case SETUP_EXCEPT: - case SETUP_FINALLY: + TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally) + TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally) + TARGET(SETUP_FINALLY) + _setup_finally: /* NOTE: If you add any new block-setup opcodes that are not try/except/finally handlers, you may need to update the PyGen_NeedsFinalizing() function. @@ -2284,9 +2400,9 @@ PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg, STACK_LEVEL()); - continue; + DISPATCH(); - case WITH_CLEANUP: + TARGET(WITH_CLEANUP) { /* At the top of the stack are 1-3 values indicating how/why we entered the finally clause: @@ -2350,7 +2466,7 @@ break; } - case CALL_FUNCTION: + TARGET(CALL_FUNCTION) { PyObject **sp; PCALL(PCALL_ALL); @@ -2363,13 +2479,14 @@ stack_pointer = sp; PUSH(x); if (x != NULL) - continue; + DISPATCH(); break; } - case CALL_FUNCTION_VAR: - case CALL_FUNCTION_KW: - case CALL_FUNCTION_VAR_KW: + TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw) + TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw) + TARGET(CALL_FUNCTION_VAR_KW) + _call_function_var_kw: { int na = oparg & 0xff; int nk = (oparg>>8) & 0xff; @@ -2409,12 +2526,13 @@ } PUSH(x); if (x != NULL) - continue; + DISPATCH(); break; } - case MAKE_CLOSURE: - case MAKE_FUNCTION: + TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function) + TARGET(MAKE_FUNCTION) + _make_function: { int posdefaults = oparg & 0xff; int kwdefaults = (oparg>>8) & 0xff; @@ -2507,7 +2625,7 @@ break; } - case BUILD_SLICE: + TARGET(BUILD_SLICE) if (oparg == 3) w = POP(); else @@ -2519,14 +2637,17 @@ Py_DECREF(v); Py_XDECREF(w); SET_TOP(x); - if (x != NULL) continue; + if (x != NULL) DISPATCH(); break; - case EXTENDED_ARG: + TARGET(EXTENDED_ARG) opcode = NEXTOP(); oparg = oparg<<16 | NEXTARG(); goto dispatch_opcode; +#ifdef USE_COMPUTED_GOTOS + _unknown_opcode: +#endif default: fprintf(stderr, "XXX lineno: %d, opcode: %d\n", Modified: python/branches/io-c/Python/import.c ============================================================================== --- python/branches/io-c/Python/import.c (original) +++ python/branches/io-c/Python/import.c Tue Jan 27 23:14:53 2009 @@ -3233,24 +3233,11 @@ PyErr_SetString(PyExc_ImportError, "empty pathname"); return -1; } else { +#ifndef MS_WINDOWS struct stat statbuf; int rv; rv = stat(path, &statbuf); -#ifdef MS_WINDOWS - /* MS Windows stat() chokes on paths like C:\path\. Try to - * recover *one* time by stripping off a trailing slash or - * backslash. http://bugs.python.org/issue1293 - */ - if (rv != 0 && pathlen <= MAXPATHLEN && - (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { - char mangled[MAXPATHLEN+1]; - - strcpy(mangled, path); - mangled[pathlen-1] = '\0'; - rv = stat(mangled, &statbuf); - } -#endif PyMem_Free(path); if (rv == 0) { /* it exists */ @@ -3261,6 +3248,24 @@ return -1; } } +#else /* MS_WINDOWS */ + DWORD rv; + /* see issue1293 and issue3677: + * stat() on Windows doesn't recognise paths like + * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. + */ + rv = GetFileAttributesA(path); + PyMem_Free(path); + if (rv != INVALID_FILE_ATTRIBUTES) { + /* it exists */ + if (rv & FILE_ATTRIBUTE_DIRECTORY) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif } return 0; } Modified: python/branches/io-c/Python/pythonrun.c ============================================================================== --- python/branches/io-c/Python/pythonrun.c (original) +++ python/branches/io-c/Python/pythonrun.c Tue Jan 27 23:14:53 2009 @@ -739,7 +739,12 @@ PyObject *line_buffering; int buffering, isatty; - if (Py_UnbufferedStdioFlag) + /* stdin is always opened in buffered mode, first because it shouldn't + make a difference in common use cases, second because TextIOWrapper + depends on the presence of a read1() method which only exists on + buffered streams. + */ + if (Py_UnbufferedStdioFlag && write_mode) buffering = 0; else buffering = -1; @@ -753,7 +758,7 @@ if (buf == NULL) goto error; - if (!Py_UnbufferedStdioFlag) { + if (buffering) { raw = PyObject_GetAttrString(buf, "raw"); if (raw == NULL) goto error; Modified: python/branches/io-c/Tools/unicode/makeunicodedata.py ============================================================================== --- python/branches/io-c/Tools/unicode/makeunicodedata.py (original) +++ python/branches/io-c/Tools/unicode/makeunicodedata.py Tue Jan 27 23:14:53 2009 @@ -457,15 +457,6 @@ # -------------------------------------------------------------------- # unicode name database -def CmpToKey(mycmp): - 'Convert a cmp= function into a key= function' - class K(object): - def __init__(self, obj, *args): - self.obj = obj - def __lt__(self, other): - return mycmp(self.obj, other.obj) == -1 - return K - def makeunicodename(unicode, trace): FILE = "Modules/unicodename_db.h" @@ -508,14 +499,10 @@ wordlist = list(words.items()) # sort on falling frequency, then by name - def cmpwords(a,b): + def word_key(a): aword, alist = a - bword, blist = b - r = -cmp(len(alist),len(blist)) - if r: - return r - return cmp(aword, bword) - wordlist.sort(key=CmpToKey(cmpwords)) + return -len(alist), aword + wordlist.sort(key=word_key) # figure out how many phrasebook escapes we need escapes = 0 Modified: python/branches/io-c/configure ============================================================================== --- python/branches/io-c/configure (original) +++ python/branches/io-c/configure Tue Jan 27 23:14:53 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 68300 . +# From configure.in Revision: 68440 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for python 3.1. +# Generated by GNU Autoconf 2.63 for python 3.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,7 +18,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -40,17 +40,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -66,8 +94,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -90,7 +116,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -103,17 +129,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -135,7 +154,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -161,7 +180,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -243,7 +262,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -264,7 +283,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -344,10 +363,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -416,9 +435,10 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf at gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -454,7 +474,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -482,7 +502,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -495,19 +514,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -532,10 +554,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -616,123 +638,153 @@ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -VERSION -SOVERSION -CONFIG_ARGS -UNIVERSALSDK -ARCH_RUN_32BIT -PYTHONFRAMEWORK -PYTHONFRAMEWORKIDENTIFIER -PYTHONFRAMEWORKDIR -PYTHONFRAMEWORKPREFIX -PYTHONFRAMEWORKINSTALLDIR -FRAMEWORKINSTALLFIRST -FRAMEWORKINSTALLLAST -FRAMEWORKALTINSTALLFIRST -FRAMEWORKALTINSTALLLAST -FRAMEWORKUNIXTOOLSPREFIX -MACHDEP -SGI_ABI -CONFIGURE_MACOSX_DEPLOYMENT_TARGET -EXPORT_MACOSX_DEPLOYMENT_TARGET -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CXX -MAINCC -CPP -GREP -EGREP -BUILDEXEEXT -LIBRARY -LDLIBRARY -DLLLIBRARY -BLDLIBRARY -LDLIBRARYDIR -INSTSONAME -RUNSHARED -LINKCC -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 +ac_subst_vars='LTLIBOBJS SRCDIRS -LTLIBOBJS' +THREADHEADERS +LIBC +LIBM +HAVE_GETHOSTBYNAME +HAVE_GETHOSTBYNAME_R +HAVE_GETHOSTBYNAME_R_3_ARG +HAVE_GETHOSTBYNAME_R_5_ARG +HAVE_GETHOSTBYNAME_R_6_ARG +LIBOBJS +TRUE +MACHDEP_OBJS +DYNLOADFILE +DLINCLDIR +THREADOBJ +LDLAST +USE_THREAD_MODULE +SIGNAL_OBJS +USE_SIGNAL_MODULE +SHLIBS +CFLAGSFORSHARED +LINKFORSHARED +CCSHARED +BLDSHARED +LDSHARED +SO +LIBTOOL_CRUFT +OTHER_LIBTOOL_OPT +UNIVERSAL_ARCH_FLAGS +BASECFLAGS +OPT +LN +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SVNVERSION +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 +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_universalsdk +with_universal_archs +with_framework_name +enable_framework +with_gcc +with_cxx_main +with_suffix +enable_shared +enable_profiling +with_pydebug +with_libs +with_system_ffi +with_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 @@ -747,6 +799,8 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -845,13 +899,21 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -864,13 +926,21 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1061,22 +1131,38 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1096,7 +1182,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1105,16 +1191,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1123,22 +1209,38 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1153,7 +1255,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1169,10 +1271,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1180,12 +1282,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1212,12 +1314,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1266,9 +1368,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 @@ -1278,25 +1380,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 @@ -1310,6 +1412,7 @@ cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-universalsdk[=SDKDIR] @@ -1353,6 +1456,8 @@ --with-libm=STRING math library --with-libc=STRING C library --with-wide-unicode Use 4-byte Unicode characters (default is 2 bytes) + --with-computed-gotos Use computed gotos / threaded dispatch in evaluation + loop (not available on all compilers) Some influential environment variables: CC C compiler command @@ -1375,15 +1480,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1419,7 +1526,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1429,10 +1536,10 @@ if $ac_init_version; then cat <<\_ACEOF python configure 3.1 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1443,7 +1550,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1479,7 +1586,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1514,7 +1621,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1566,11 +1673,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1600,9 +1708,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1617,9 +1725,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1635,8 +1743,8 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1678,21 +1786,24 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1702,16 +1813,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1725,29 +1836,38 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1757,10 +1877,12 @@ fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1897,20 +2019,20 @@ UNIVERSAL_ARCHS="32-bit" -{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 -echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 +$as_echo_n "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. if test "${with_universal_archs+set}" = set; then withval=$with_universal_archs; - { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } UNIVERSAL_ARCHS="$withval" else - { echo "$as_me:$LINENO: result: 32-bit" >&5 -echo "${ECHO_T}32-bit" >&6; } + { $as_echo "$as_me:$LINENO: result: 32-bit" >&5 +$as_echo "32-bit" >&6; } fi @@ -2030,8 +2152,8 @@ ## # Set name for machine-dependent library files -{ echo "$as_me:$LINENO: checking MACHDEP" >&5 -echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5 +$as_echo_n "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then ac_sys_system=`uname -s` @@ -2194,8 +2316,8 @@ LDFLAGS="$SGI_ABI $LDFLAGS" MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` fi -{ echo "$as_me:$LINENO: result: $MACHDEP" >&5 -echo "${ECHO_T}$MACHDEP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5 +$as_echo "$MACHDEP" >&6; } # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils @@ -2205,11 +2327,11 @@ CONFIGURE_MACOSX_DEPLOYMENT_TARGET= EXPORT_MACOSX_DEPLOYMENT_TARGET='#' -{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 -echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 +$as_echo_n "checking machine type as reported by uname -m... " >&6; } ac_sys_machine=`uname -m` -{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 -echo "${ECHO_T}$ac_sys_machine" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 +$as_echo "$ac_sys_machine" >&6; } # checks for alternative programs @@ -2221,14 +2343,14 @@ # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? -{ echo "$as_me:$LINENO: checking for --without-gcc" >&5 -echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5 +$as_echo_n "checking for --without-gcc... " >&6; } # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then withval=$with_gcc; case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; @@ -2247,15 +2369,15 @@ esac fi -{ echo "$as_me:$LINENO: result: $without_gcc" >&5 -echo "${ECHO_T}$without_gcc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5 +$as_echo "$without_gcc" >&6; } # If the user switches compilers, we can't believe the cache if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then - { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file + { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&5 -echo "$as_me: error: cached CC is different -- throw away $cache_file +$as_echo "$as_me: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&2;} { (exit 1); exit 1; }; } fi @@ -2268,10 +2390,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2284,7 +2406,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2295,11 +2417,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2308,10 +2430,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2324,7 +2446,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2335,11 +2457,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2347,12 +2469,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2365,10 +2483,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2381,7 +2499,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2392,11 +2510,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2405,10 +2523,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2426,7 +2544,7 @@ continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2449,11 +2567,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2464,10 +2582,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2480,7 +2598,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2491,11 +2609,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2508,10 +2626,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2524,7 +2642,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2535,11 +2653,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2551,12 +2669,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2566,44 +2680,50 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2622,27 +2742,22 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2653,10 +2768,11 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2667,7 +2783,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2694,25 +2810,27 @@ ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2721,49 +2839,53 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2772,31 +2894,33 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2819,40 +2943,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2878,20 +3005,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2901,15 +3029,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -2936,20 +3068,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -2974,20 +3107,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3013,20 +3147,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3041,8 +3176,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3058,10 +3193,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3132,20 +3267,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3161,15 +3297,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3182,8 +3318,8 @@ -{ echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 -echo $ECHO_N "checking for --with-cxx-main=... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 +$as_echo_n "checking for --with-cxx-main=... " >&6; } # Check whether --with-cxx_main was given. if test "${with_cxx_main+set}" = set; then @@ -3208,8 +3344,8 @@ fi -{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5 -echo "${ECHO_T}$with_cxx_main" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5 +$as_echo "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -3217,10 +3353,10 @@ case "$CC" in gcc) # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3235,7 +3371,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3248,20 +3384,20 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; cc) # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3276,7 +3412,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3289,11 +3425,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; @@ -3309,10 +3445,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3325,7 +3461,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3336,11 +3472,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3355,12 +3491,12 @@ fi if test "$preset_cxx" != "$CXX" then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -3375,15 +3511,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3415,20 +3551,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3452,13 +3589,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3466,7 +3604,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3491,8 +3629,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3520,20 +3658,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3557,13 +3696,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3571,7 +3711,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3587,11 +3727,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3601,42 +3743,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3651,74 +3788,60 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3733,63 +3856,510 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done +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 -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; }; } +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 + + + 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 - ac_cv_path_EGREP=$EGREP -fi - + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - fi + ac_cv_safe_to_define___extensions__=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF -{ echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif + cat >>confdefs.h <<\_ACEOF +#define _GNU_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 + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest* + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF @@ -3802,8 +4372,8 @@ esac -{ echo "$as_me:$LINENO: checking for --with-suffix" >&5 -echo $ECHO_N "checking for --with-suffix... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5 +$as_echo_n "checking for --with-suffix... " >&6; } # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then @@ -3815,26 +4385,26 @@ esac fi -{ echo "$as_me:$LINENO: result: $EXEEXT" >&5 -echo "${ECHO_T}$EXEEXT" >&6; } +{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5 +$as_echo "$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 -echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 +$as_echo_n "checking for case-insensitive build directory... " >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILDEXEEXT=.exe else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -3867,14 +4437,14 @@ -{ echo "$as_me:$LINENO: checking LIBRARY" >&5 -echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5 +$as_echo_n "checking LIBRARY... " >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION).a' fi -{ echo "$as_me:$LINENO: result: $LIBRARY" >&5 -echo "${ECHO_T}$LIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5 +$as_echo "$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -3909,8 +4479,8 @@ # This is altered for AIX in order to build the export list before # linking. -{ echo "$as_me:$LINENO: checking LINKCC" >&5 -echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5 +$as_echo_n "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -3930,11 +4500,11 @@ LINKCC=qcc;; esac fi -{ echo "$as_me:$LINENO: result: $LINKCC" >&5 -echo "${ECHO_T}$LINKCC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5 +$as_echo "$LINKCC" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-shared" >&5 -echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5 +$as_echo_n "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; @@ -3950,11 +4520,11 @@ enable_shared="no";; esac fi -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5 -echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5 +$as_echo_n "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; ac_save_cc="$CC" @@ -3976,29 +4546,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_enable_profiling="yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_enable_profiling="no" fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4006,8 +4579,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 -echo "${ECHO_T}$ac_enable_profiling" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 +$as_echo "$ac_enable_profiling" >&6; } case "$ac_enable_profiling" in "yes") @@ -4016,8 +4589,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5 -echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5 +$as_echo_n "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -4101,16 +4674,16 @@ esac fi -{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 -echo "${ECHO_T}$LDLIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 +$as_echo "$LDLIBRARY" >&6; } if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4123,7 +4696,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4134,11 +4707,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4147,10 +4720,10 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4163,7 +4736,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4174,11 +4747,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4186,12 +4759,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -4205,10 +4774,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4221,7 +4790,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4232,11 +4801,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4248,10 +4817,10 @@ # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_SVNVERSION+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$SVNVERSION"; then ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. @@ -4264,7 +4833,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SVNVERSION="found" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4276,11 +4845,11 @@ fi SVNVERSION=$ac_cv_prog_SVNVERSION if test -n "$SVNVERSION"; then - { echo "$as_me:$LINENO: result: $SVNVERSION" >&5 -echo "${ECHO_T}$SVNVERSION" >&6; } + { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5 +$as_echo "$SVNVERSION" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4316,8 +4885,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -4343,11 +4912,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4376,17 +4946,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -4399,8 +4981,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4422,8 +5004,8 @@ fi # Check for --with-pydebug -{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5 -echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5 +$as_echo_n "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. if test "${with_pydebug+set}" = set; then @@ -4435,15 +5017,15 @@ #define Py_DEBUG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; }; + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; }; Py_DEBUG='true' -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; Py_DEBUG='false' +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; Py_DEBUG='false' fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4521,8 +5103,8 @@ # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. - { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 -echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then @@ -4542,36 +5124,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_no_strict_aliasing_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_no_strict_aliasing_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 -echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 +$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } if test $ac_cv_no_strict_aliasing_ok = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -4610,8 +5195,8 @@ ARCH_RUN_32BIT="arch -i386 -ppc" else - { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 -echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 +$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} { (exit 1); exit 1; }; } fi @@ -4685,10 +5270,10 @@ ac_cv_opt_olimit_ok=no fi -{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 -echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 +$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; } if test "${ac_cv_opt_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -OPT:Olimit=0" @@ -4709,29 +5294,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_opt_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_opt_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4739,8 +5327,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 +$as_echo "$ac_cv_opt_olimit_ok" >&6; } if test $ac_cv_opt_olimit_ok = yes; then case $ac_sys_system in # XXX is this branch needed? On MacOSX 10.2.2 the result of the @@ -4753,10 +5341,10 @@ ;; esac else - { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 -echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 +$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; } if test "${ac_cv_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Olimit 1500" @@ -4777,29 +5365,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4807,8 +5398,8 @@ CC="$ac_save_cc" fi - { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_olimit_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 +$as_echo "$ac_cv_olimit_ok" >&6; } if test $ac_cv_olimit_ok = yes; then BASECFLAGS="$BASECFLAGS -Olimit 1500" fi @@ -4817,8 +5408,8 @@ # Check whether GCC supports PyArg_ParseTuple format if test "$GCC" = "yes" then - { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 -echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -4844,13 +5435,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4860,14 +5452,14 @@ #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4880,10 +5472,10 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 -echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 +$as_echo_n "checking whether pthreads are available without options... " >&6; } if test "${ac_cv_pthread_is_default+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_is_default=no @@ -4914,19 +5506,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_is_default=yes @@ -4934,13 +5528,14 @@ ac_cv_pthread=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_is_default=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4948,8 +5543,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 -echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 +$as_echo "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -4961,10 +5556,10 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 +$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } if test "${ac_cv_kpthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kpthread" @@ -4997,29 +5592,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kpthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kpthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5027,8 +5625,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 -echo "${ECHO_T}$ac_cv_kpthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 +$as_echo "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -5038,10 +5636,10 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 +$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } if test "${ac_cv_kthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kthread" @@ -5074,29 +5672,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5104,8 +5705,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 -echo "${ECHO_T}$ac_cv_kthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 +$as_echo "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -5115,10 +5716,10 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 -echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 +$as_echo_n "checking whether $CC accepts -pthread... " >&6; } if test "${ac_cv_thread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -pthread" @@ -5151,29 +5752,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5181,8 +5785,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 -echo "${ECHO_T}$ac_cv_pthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 +$as_echo "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -5190,8 +5794,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 -echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 +$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -5221,17 +5825,17 @@ fi rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 -echo "${ECHO_T}$ac_cv_cxx_thread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 +$as_echo "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5258,20 +5862,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -5363,37 +5968,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -5402,75 +6010,6 @@ fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - @@ -5538,20 +6077,21 @@ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5567,32 +6107,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5606,51 +6147,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -5659,21 +6201,24 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5687,11 +6232,11 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5717,20 +6262,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -5738,12 +6284,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5752,10 +6301,10 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5793,26 +6342,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5827,8 +6380,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5836,10 +6389,10 @@ fi else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5877,26 +6430,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5911,8 +6468,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5921,10 +6478,10 @@ fi -{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 -echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5947,46 +6504,50 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_header_sys_types_h_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +$as_echo_n "checking sys/mkdev.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6002,32 +6563,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +$as_echo_n "checking sys/mkdev.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6041,51 +6603,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -6094,18 +6657,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } fi -if test $ac_cv_header_sys_mkdev_h = yes; then +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 @@ -6117,17 +6680,17 @@ if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +$as_echo_n "checking sys/sysmacros.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6143,32 +6706,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +$as_echo_n "checking sys/sysmacros.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6182,51 +6746,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -6235,18 +6800,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } fi -if test $ac_cv_header_sys_sysmacros_h = yes; then +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 @@ -6263,11 +6828,11 @@ for ac_header in term.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6289,20 +6854,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6310,12 +6876,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6327,11 +6896,11 @@ for ac_header in linux/netlink.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6356,20 +6925,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6377,12 +6947,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6392,8 +6965,8 @@ # checks for typedefs was_it_defined=no -{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 -echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 +$as_echo_n "checking for clock_t in time.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6417,12 +6990,12 @@ fi rm -f conftest* -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } # Check whether using makedev requires defining _OSF_SOURCE -{ echo "$as_me:$LINENO: checking for makedev" >&5 -echo $ECHO_N "checking for makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for makedev" >&5 +$as_echo_n "checking for makedev... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6444,26 +7017,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "no"; then @@ -6492,26 +7069,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "yes"; then @@ -6522,8 +7103,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 -echo "${ECHO_T}$ac_cv_has_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 +$as_echo "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -6540,8 +7121,8 @@ # work-around, disable LFS on such configurations use_lfs=yes -{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 -echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 +$as_echo_n "checking Solaris LFS bug... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6567,28 +7148,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sol_lfs_bug=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sol_lfs_bug=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 -echo "${ECHO_T}$sol_lfs_bug" >&6; } +{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 +$as_echo "$sol_lfs_bug" >&6; } if test "$sol_lfs_bug" = "yes"; then use_lfs=no fi @@ -6616,26 +7198,58 @@ EOF # Type availability checks -{ echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 +$as_echo_n "checking for mode_t... " >&6; } if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_mode_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef mode_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (mode_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((mode_t))) + return 0; ; return 0; } @@ -6646,30 +7260,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_mode_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mode_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } -if test $ac_cv_type_mode_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +$as_echo "$ac_cv_type_mode_t" >&6; } +if test "x$ac_cv_type_mode_t" = x""yes; then : else @@ -6679,26 +7302,58 @@ fi -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -6709,30 +7364,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then : else @@ -6742,26 +7406,58 @@ fi -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -6772,30 +7468,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -6805,10 +7510,10 @@ fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6833,20 +7538,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -6854,34 +7560,66 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (size_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -6892,30 +7630,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then : else @@ -6925,10 +7672,10 @@ fi -{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6948,8 +7695,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -6963,26 +7710,24 @@ fi -{ echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_ssize_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef ssize_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (ssize_t)) + return 0; ; return 0; } @@ -6993,45 +7738,18 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_ssize_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } -if test $ac_cv_type_ssize_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SSIZE_T 1 -_ACEOF - -fi - - -# Sizes of various common basic types -# ANSI C requires sizeof(char) == 1, so no need to check it -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7039,14 +7757,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((ssize_t))) + return 0; ; return 0; } @@ -7057,38 +7772,57 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_ssize_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +$as_echo "$ac_cv_type_ssize_t" >&6; } +if test "x$ac_cv_type_ssize_t" = x""yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_SSIZE_T 1 +_ACEOF + +fi + + +# Sizes of various common basic types +# ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7099,11 +7833,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; test_array [0] = 0 ; @@ -7116,13 +7849,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7136,11 +7870,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7153,20 +7886,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7180,7 +7914,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7190,11 +7924,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; test_array [0] = 0 ; @@ -7207,13 +7940,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7227,11 +7961,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7244,20 +7977,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7271,7 +8005,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7291,11 +8025,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7308,20 +8041,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7332,11 +8066,13 @@ case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi ;; @@ -7349,9 +8085,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (int)); } +static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int @@ -7361,20 +8096,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7387,43 +8124,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } @@ -7432,68 +8174,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7504,11 +8192,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -7521,13 +8208,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7541,11 +8229,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7558,20 +8245,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7585,7 +8273,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7595,11 +8283,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -7612,13 +8299,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7632,11 +8320,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7649,20 +8336,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7676,7 +8364,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7696,11 +8384,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7713,20 +8400,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7737,11 +8425,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -7754,9 +8444,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -7766,20 +8455,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7792,43 +8483,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -7837,68 +8533,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7909,11 +8551,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -7926,13 +8567,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7946,11 +8588,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7963,20 +8604,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7990,7 +8632,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8000,11 +8642,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -8017,13 +8658,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8037,11 +8679,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8054,20 +8695,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8081,7 +8723,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8101,11 +8743,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8118,20 +8759,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8142,11 +8784,13 @@ case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -8159,9 +8803,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -8171,20 +8814,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8197,43 +8842,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -8242,68 +8892,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6; } -if test "${ac_cv_type_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef short ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_short=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_short=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8314,11 +8910,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; test_array [0] = 0 ; @@ -8331,13 +8926,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8351,11 +8947,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8368,20 +8963,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8395,7 +8991,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8405,11 +9001,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; test_array [0] = 0 ; @@ -8422,13 +9017,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8442,11 +9038,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8459,20 +9054,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8486,7 +9082,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8506,11 +9102,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8523,20 +9118,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8547,11 +9143,13 @@ case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi ;; @@ -8564,9 +9162,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (short)); } +static unsigned long int ulongval () { return (long int) (sizeof (short)); } #include #include int @@ -8576,20 +9173,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (short))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8602,43 +9201,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } @@ -8647,68 +9251,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for float" >&5 -echo $ECHO_N "checking for float... $ECHO_C" >&6; } -if test "${ac_cv_type_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef float ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_float=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_float=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 -echo "${ECHO_T}$ac_cv_type_float" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of float" >&5 -echo $ECHO_N "checking size of float... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } if test "${ac_cv_sizeof_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8719,11 +9269,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; test_array [0] = 0 ; @@ -8736,13 +9285,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8756,11 +9306,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8773,20 +9322,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8800,7 +9350,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8810,11 +9360,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; test_array [0] = 0 ; @@ -8827,13 +9376,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8847,11 +9397,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8864,20 +9413,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8891,7 +9441,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8911,11 +9461,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8928,20 +9477,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8952,11 +9502,13 @@ case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi ;; @@ -8969,9 +9521,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (float)); } +static unsigned long int ulongval () { return (long int) (sizeof (float)); } #include #include int @@ -8981,20 +9532,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (float))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9007,113 +9560,64 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF - - -{ echo "$as_me:$LINENO: checking for double" >&5 -echo $ECHO_N "checking for double... $ECHO_C" >&6; } -if test "${ac_cv_type_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_double=no +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 core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 -echo "${ECHO_T}$ac_cv_type_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of double" >&5 -echo $ECHO_N "checking size of double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } if test "${ac_cv_sizeof_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9124,11 +9628,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; test_array [0] = 0 ; @@ -9141,13 +9644,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9161,11 +9665,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9178,20 +9681,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9205,7 +9709,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9215,11 +9719,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; test_array [0] = 0 ; @@ -9232,13 +9735,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9252,11 +9756,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9269,20 +9772,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9296,7 +9800,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9316,11 +9820,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9333,20 +9836,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9357,11 +9861,13 @@ case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi ;; @@ -9374,9 +9880,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (double)); } +static unsigned long int ulongval () { return (long int) (sizeof (double)); } #include #include int @@ -9386,20 +9891,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9412,43 +9919,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } @@ -9457,68 +9969,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for fpos_t" >&5 -echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } -if test "${ac_cv_type_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef fpos_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_fpos_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_fpos_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of fpos_t" >&5 -echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 +$as_echo_n "checking size of fpos_t... " >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9529,11 +9987,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; test_array [0] = 0 ; @@ -9546,13 +10003,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9566,11 +10024,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9583,20 +10040,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9610,7 +10068,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9620,11 +10078,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; test_array [0] = 0 ; @@ -9637,13 +10094,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9657,11 +10115,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9674,20 +10131,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9701,7 +10159,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9721,11 +10179,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9738,20 +10195,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9762,11 +10220,13 @@ case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi ;; @@ -9779,9 +10239,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (fpos_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } #include #include int @@ -9791,20 +10250,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (fpos_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9817,43 +10278,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +$as_echo "$ac_cv_sizeof_fpos_t" >&6; } @@ -9862,68 +10328,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9934,11 +10346,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; @@ -9951,13 +10362,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9971,11 +10383,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9988,20 +10399,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10015,7 +10427,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10025,11 +10437,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; @@ -10042,13 +10453,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10062,11 +10474,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10079,20 +10490,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10106,7 +10518,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10126,11 +10538,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10143,20 +10554,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10167,11 +10579,13 @@ case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -10184,9 +10598,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (size_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int @@ -10196,20 +10609,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10222,43 +10637,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } @@ -10267,68 +10687,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of pid_t" >&5 -echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5 +$as_echo_n "checking size of pid_t... " >&6; } if test "${ac_cv_sizeof_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10339,11 +10705,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)]; test_array [0] = 0 ; @@ -10356,13 +10721,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10376,11 +10742,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10393,20 +10758,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10420,7 +10786,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10430,11 +10796,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)]; test_array [0] = 0 ; @@ -10447,13 +10812,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10467,11 +10833,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10484,20 +10849,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10511,7 +10877,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10531,11 +10897,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10548,20 +10913,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10572,11 +10938,13 @@ case $ac_lo in ?*) ac_cv_sizeof_pid_t=$ac_lo;; '') if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi ;; @@ -10589,9 +10957,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (pid_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); } #include #include int @@ -10601,20 +10968,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (pid_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10627,43 +10996,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pid_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +$as_echo "$ac_cv_sizeof_pid_t" >&6; } @@ -10673,8 +11047,8 @@ -{ echo "$as_me:$LINENO: checking for long long support" >&5 -echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long long support" >&5 +$as_echo_n "checking for long long support... " >&6; } have_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10697,13 +11071,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10717,78 +11092,24 @@ have_long_long=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_long" >&5 -echo "${ECHO_T}$have_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5 +$as_echo "$have_long_long" >&6; } if test "$have_long_long" = yes ; then -{ echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10799,11 +11120,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; test_array [0] = 0 ; @@ -10816,13 +11136,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10836,11 +11157,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10853,20 +11173,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10880,7 +11201,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10890,11 +11211,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; test_array [0] = 0 ; @@ -10907,13 +11227,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10927,11 +11248,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10944,20 +11264,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10971,7 +11292,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10991,11 +11312,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11008,20 +11328,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11032,11 +11353,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi ;; @@ -11049,9 +11372,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long long)); } #include #include int @@ -11061,20 +11383,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11087,43 +11411,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } @@ -11134,8 +11463,8 @@ fi -{ echo "$as_me:$LINENO: checking for long double support" >&5 -echo $ECHO_N "checking for long double support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long double support" >&5 +$as_echo_n "checking for long double support... " >&6; } have_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11158,13 +11487,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11178,78 +11508,24 @@ have_long_double=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_double" >&5 -echo "${ECHO_T}$have_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5 +$as_echo "$have_long_double" >&6; } if test "$have_long_double" = yes ; then -{ echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; } -if test "${ac_cv_type_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_double=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 -echo "${ECHO_T}$ac_cv_type_long_double" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long double" >&5 -echo $ECHO_N "checking size of long double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11260,11 +11536,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; @@ -11277,13 +11552,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11297,11 +11573,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11314,20 +11589,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11341,7 +11617,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11351,11 +11627,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; test_array [0] = 0 ; @@ -11368,13 +11643,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11388,11 +11664,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11405,20 +11680,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11432,7 +11708,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11452,11 +11728,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11469,20 +11744,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11493,11 +11769,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi ;; @@ -11510,9 +11788,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long double)); } +static unsigned long int ulongval () { return (long int) (sizeof (long double)); } #include #include int @@ -11522,20 +11799,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11548,43 +11827,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } @@ -11596,8 +11880,8 @@ fi -{ echo "$as_me:$LINENO: checking for _Bool support" >&5 -echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5 +$as_echo_n "checking for _Bool support... " >&6; } have_c99_bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11620,13 +11904,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11636,82 +11921,28 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_C99_BOOL 1 _ACEOF - - have_c99_bool=yes - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5 -echo "${ECHO_T}$have_c99_bool" >&6; } -if test "$have_c99_bool" = yes ; then -{ echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + + have_c99_bool=yes + else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5 +$as_echo "$have_c99_bool" >&6; } +if test "$have_c99_bool" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of _Bool" >&5 -echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5 +$as_echo_n "checking size of _Bool... " >&6; } if test "${ac_cv_sizeof__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11722,11 +11953,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)]; test_array [0] = 0 ; @@ -11739,13 +11969,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11759,11 +11990,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11776,20 +12006,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11803,7 +12034,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11813,11 +12044,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)]; test_array [0] = 0 ; @@ -11830,13 +12060,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11850,11 +12081,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11867,20 +12097,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11894,7 +12125,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11914,11 +12145,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11931,20 +12161,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11955,11 +12186,13 @@ case $ac_lo in ?*) ac_cv_sizeof__Bool=$ac_lo;; '') if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi ;; @@ -11972,9 +12205,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (_Bool)); } +static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); } #include #include int @@ -11984,20 +12216,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (_Bool))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12010,43 +12244,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof__Bool=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 -echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 +$as_echo "$ac_cv_sizeof__Bool" >&6; } @@ -12057,12 +12296,13 @@ fi -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 +$as_echo_n "checking for uintptr_t... " >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_uintptr_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12072,14 +12312,11 @@ #include #endif -typedef uintptr_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (uintptr_t)) + return 0; ; return 0; } @@ -12090,55 +12327,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } -if test $ac_cv_type_uintptr_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF - -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef uintptr_t ac__type_new_; +#ifdef HAVE_STDINT_H + #include + #endif + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((uintptr_t))) + return 0; ; return 0; } @@ -12149,38 +12364,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_uintptr_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uintptr_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +$as_echo "$ac_cv_type_uintptr_t" >&6; } +if test "x$ac_cv_type_uintptr_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5 -echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +$as_echo_n "checking size of uintptr_t... " >&6; } if test "${ac_cv_sizeof_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12191,11 +12420,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)]; test_array [0] = 0 ; @@ -12208,13 +12436,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12228,11 +12457,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12245,20 +12473,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12272,7 +12501,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12282,11 +12511,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)]; test_array [0] = 0 ; @@ -12299,13 +12527,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12319,11 +12548,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12336,20 +12564,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12363,7 +12592,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12383,11 +12612,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12400,20 +12628,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12424,11 +12653,13 @@ case $ac_lo in ?*) ac_cv_sizeof_uintptr_t=$ac_lo;; '') if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi ;; @@ -12441,9 +12672,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (uintptr_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); } #include #include int @@ -12453,20 +12683,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (uintptr_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12479,43 +12711,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uintptr_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } @@ -12529,10 +12766,10 @@ # Hmph. AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_off_t=4 @@ -12559,29 +12796,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_off_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12589,16 +12829,16 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5 -echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -12607,18 +12847,18 @@ #define HAVE_LARGEFILE_SUPPORT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_time_t=4 @@ -12645,29 +12885,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_time_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12675,8 +12918,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t @@ -12693,8 +12936,8 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ echo "$as_me:$LINENO: checking for pthread_t" >&5 -echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5 +$as_echo_n "checking for pthread_t... " >&6; } have_pthread_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12717,34 +12960,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_pthread_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5 -echo "${ECHO_T}$have_pthread_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5 +$as_echo "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # AC_CHECK_SIZEOF() doesn't include . - { echo "$as_me:$LINENO: checking size of pthread_t" >&5 -echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } if test "${ac_cv_sizeof_pthread_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_pthread_t=4 @@ -12771,29 +13015,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pthread_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_pthread_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -12801,8 +13048,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t @@ -12847,8 +13094,8 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ echo "$as_me:$LINENO: checking for --enable-framework" >&5 -echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5 +$as_echo_n "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" @@ -12859,15 +13106,15 @@ #define WITH_NEXT_FRAMEWORK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for dyld" >&5 -echo $ECHO_N "checking for dyld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dyld" >&5 +$as_echo_n "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -12875,12 +13122,12 @@ #define WITH_DYLD 1 _ACEOF - { echo "$as_me:$LINENO: result: always on for Darwin" >&5 -echo "${ECHO_T}always on for Darwin" >&6; } + { $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5 +$as_echo "always on for Darwin" >&6; } ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac @@ -12892,8 +13139,8 @@ # SO is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ echo "$as_me:$LINENO: checking SO" >&5 -echo $ECHO_N "checking SO... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SO" >&5 +$as_echo_n "checking SO... " >&6; } if test -z "$SO" then case $ac_sys_system in @@ -12918,8 +13165,8 @@ echo '=====================================================================' sleep 10 fi -{ echo "$as_me:$LINENO: result: $SO" >&5 -echo "${ECHO_T}$SO" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SO" >&5 +$as_echo "$SO" >&6; } cat >>confdefs.h <<_ACEOF @@ -12930,8 +13177,8 @@ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ echo "$as_me:$LINENO: checking LDSHARED" >&5 -echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13033,13 +13280,13 @@ *) LDSHARED="ld";; esac fi -{ echo "$as_me:$LINENO: result: $LDSHARED" >&5 -echo "${ECHO_T}$LDSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking CCSHARED" >&5 -echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13074,12 +13321,12 @@ atheos*) CCSHARED="-fPIC";; esac fi -{ echo "$as_me:$LINENO: result: $CCSHARED" >&5 -echo "${ECHO_T}$CCSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 -echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13134,13 +13381,13 @@ LINKFORSHARED='-Wl,-E -N 2048K';; esac fi -{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 -echo "${ECHO_T}$LINKFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } -{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 -echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 +$as_echo_n "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -13152,8 +13399,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 -echo "${ECHO_T}$CFLAGSFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 +$as_echo "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -13164,22 +13411,22 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ echo "$as_me:$LINENO: checking SHLIBS" >&5 -echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5 +$as_echo_n "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ echo "$as_me:$LINENO: result: $SHLIBS" >&5 -echo "${ECHO_T}$SHLIBS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5 +$as_echo "$SHLIBS" >&6; } # checks for libraries -{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13211,33 +13458,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -13247,10 +13498,10 @@ fi # Dynamic linking for SunOS/Solaris and SYSV -{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13282,33 +13533,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF @@ -13320,10 +13575,10 @@ # only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then - { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 -echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } if test "${ac_cv_search_sem_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -13361,26 +13616,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_sem_init=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sem_init+set}" = set; then @@ -13395,8 +13654,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 -echo "${ECHO_T}$ac_cv_search_sem_init" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -13408,10 +13667,10 @@ fi # check if we need libintl for locale functions -{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 -echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 +$as_echo_n "checking for textdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_textdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -13443,33 +13702,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_textdomain=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_textdomain=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; } -if test $ac_cv_lib_intl_textdomain = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 +$as_echo "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_LIBINTL 1 @@ -13480,8 +13743,8 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 -echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; } + AIX*) { $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 +$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13503,43 +13766,47 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define AIX_GENUINE_CPLUSPLUS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext;; *) ;; esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 -echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_t_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -13571,40 +13838,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_t_open=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_open=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; } -if test $ac_cv_lib_nsl_t_open = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = x""yes; then LIBS="-lnsl $LIBS" fi # SVR4 -{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" @@ -13636,56 +13907,60 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_socket=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } -if test $ac_cv_lib_socket_socket = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = x""yes; then LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ echo "$as_me:$LINENO: checking for --with-libs" >&5 -echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5 +$as_echo_n "checking for --with-libs... " >&6; } # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LIBS="$withval $LIBS" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for use of the system libffi library -{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 -echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 +$as_echo_n "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. if test "${with_system_ffi+set}" = set; then @@ -13693,14 +13968,14 @@ fi -{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5 -echo "${ECHO_T}$with_system_ffi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5 +$as_echo "$with_system_ffi" >&6; } # Determine if signalmodule should be used. -{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5 -echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5 +$as_echo_n "checking for --with-signal-module... " >&6; } # Check whether --with-signal-module was given. if test "${with_signal_module+set}" = set; then @@ -13711,8 +13986,8 @@ if test -z "$with_signal_module" then with_signal_module="yes" fi -{ echo "$as_me:$LINENO: result: $with_signal_module" >&5 -echo "${ECHO_T}$with_signal_module" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5 +$as_echo "$with_signal_module" >&6; } if test "${with_signal_module}" = "yes"; then USE_SIGNAL_MODULE="" @@ -13726,22 +14001,22 @@ USE_THREAD_MODULE="" -{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 -echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 +$as_echo_n "checking for --with-dec-threads... " >&6; } # Check whether --with-dec-threads was given. if test "${with_dec_threads+set}" = set; then withval=$with_dec_threads; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LDLAST=-threads if test "${with_thread+set}" != set; then with_thread="$withval"; fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -13754,8 +14029,8 @@ -{ echo "$as_me:$LINENO: checking for --with-threads" >&5 -echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5 +$as_echo_n "checking for --with-threads... " >&6; } # Check whether --with-threads was given. if test "${with_threads+set}" = set; then @@ -13774,8 +14049,8 @@ if test -z "$with_threads" then with_threads="yes" fi -{ echo "$as_me:$LINENO: result: $with_threads" >&5 -echo "${ECHO_T}$with_threads" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5 +$as_echo "$with_threads" >&6; } if test "$with_threads" = "no" @@ -13841,8 +14116,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 -echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 +$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13864,25 +14139,25 @@ fi rm -f conftest* - { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 -echo "${ECHO_T}$unistd_defines_pthreads" >&6; } + { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 +$as_echo "$unistd_defines_pthreads" >&6; } cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "${ac_cv_header_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5 -echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5 +$as_echo_n "checking cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13898,32 +14173,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5 -echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5 +$as_echo_n "checking cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13937,51 +14213,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -13990,18 +14267,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } fi -if test $ac_cv_header_cthreads_h = yes; then +if test "x$ac_cv_header_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14020,17 +14297,17 @@ else if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 -echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 +$as_echo_n "checking mach/cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14046,32 +14323,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 -echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 +$as_echo_n "checking mach/cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14085,51 +14363,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -14138,18 +14417,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mach_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } fi -if test $ac_cv_header_mach_cthreads_h = yes; then +if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14166,13 +14445,13 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for --with-pth" >&5 -echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5 +$as_echo_n "checking for --with-pth... " >&6; } # Check whether --with-pth was given. if test "${with_pth+set}" = set; then - withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14185,16 +14464,16 @@ LIBS="-lpth $LIBS" THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14219,21 +14498,24 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14241,15 +14523,15 @@ posix_threads=yes THREADOBJ="Python/thread.o" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$_libs - { echo "$as_me:$LINENO: checking for pthread_detach" >&5 -echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5 +$as_echo_n "checking for pthread_detach... " >&6; } if test "${ac_cv_func_pthread_detach+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14302,32 +14584,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_pthread_detach=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pthread_detach=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 -echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; } -if test $ac_cv_func_pthread_detach = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 +$as_echo "$ac_cv_func_pthread_detach" >&6; } +if test "x$ac_cv_func_pthread_detach" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14337,17 +14623,17 @@ else if test "${ac_cv_header_atheos_threads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 -echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 +$as_echo_n "checking atheos/threads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14363,32 +14649,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 -echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 +$as_echo_n "checking atheos/threads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14402,51 +14689,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -14455,18 +14743,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_atheos_threads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } fi -if test $ac_cv_header_atheos_threads_h = yes; then +if test "x$ac_cv_header_atheos_threads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14479,10 +14767,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 +$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" @@ -14514,33 +14802,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthreads_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; } -if test $ac_cv_lib_pthreads_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14550,10 +14842,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 -echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +$as_echo_n "checking for pthread_create in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -14585,33 +14877,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_r_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } -if test $ac_cv_lib_c_r_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14621,10 +14917,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 +$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -14656,33 +14952,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread___pthread_create_system=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_create_system=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test $ac_cv_lib_pthread___pthread_create_system = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14692,10 +14992,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 -echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 +$as_echo_n "checking for pthread_create in -lcma... " >&6; } if test "${ac_cv_lib_cma_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" @@ -14727,33 +15027,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cma_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cma_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; } -if test $ac_cv_lib_cma_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 +$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14780,6 +15084,7 @@ fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -14791,10 +15096,10 @@ - { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 -echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 +$as_echo_n "checking for usconfig in -lmpc... " >&6; } if test "${ac_cv_lib_mpc_usconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" @@ -14826,33 +15131,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mpc_usconfig=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpc_usconfig=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 -echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; } -if test $ac_cv_lib_mpc_usconfig = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 +$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14864,10 +15173,10 @@ if test "$posix_threads" != "yes"; then - { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 -echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 +$as_echo_n "checking for thr_create in -lthread... " >&6; } if test "${ac_cv_lib_thread_thr_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" @@ -14899,33 +15208,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_thread_thr_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thread_thr_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 -echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; } -if test $ac_cv_lib_thread_thr_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 +$as_echo "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14978,10 +15291,10 @@ ;; esac - { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } if test "${ac_cv_pthread_system_supported+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_system_supported=no @@ -15011,29 +15324,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_system_supported=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_system_supported=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -15041,8 +15357,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 -echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 +$as_echo "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -15053,11 +15369,11 @@ for ac_func in pthread_sigmask do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15110,35 +15426,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF case $ac_sys_system in CYGWIN*) @@ -15158,18 +15481,18 @@ # Check for enable-ipv6 -{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 -echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 +$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; case "$enableval" in no) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no ;; - *) { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + *) { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF @@ -15180,8 +15503,8 @@ else if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no else @@ -15209,41 +15532,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 -echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 +$as_echo_n "checking if RFC2553 API is available... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15267,26 +15593,27 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi @@ -15308,8 +15635,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking ipv6 stack type" >&5 -echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5 +$as_echo_n "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -15465,8 +15792,8 @@ break fi done - { echo "$as_me:$LINENO: result: $ipv6type" >&5 -echo "${ECHO_T}$ipv6type" >&6; } + { $as_echo "$as_me:$LINENO: result: $ipv6type" >&5 +$as_echo "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -15485,8 +15812,8 @@ fi fi -{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 -echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15508,13 +15835,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -15524,22 +15852,22 @@ #define HAVE_OSX105_SDK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 -echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 +$as_echo_n "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. if test "${with_doc_strings+set}" = set; then @@ -15558,12 +15886,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 -echo "${ECHO_T}$with_doc_strings" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5 +$as_echo "$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-tsc" >&5 -echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5 +$as_echo_n "checking for --with-tsc... " >&6; } # Check whether --with-tsc was given. if test "${with_tsc+set}" = set; then @@ -15575,20 +15903,20 @@ #define WITH_TSC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 -echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 +$as_echo_n "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. if test "${with_pymalloc+set}" = set; then @@ -15607,12 +15935,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5 -echo "${ECHO_T}$with_pymalloc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5 +$as_echo "$with_pymalloc" >&6; } # Check for --with-wctype-functions -{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 -echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 +$as_echo_n "checking for --with-wctype-functions... " >&6; } # Check whether --with-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then @@ -15624,14 +15952,14 @@ #define WANT_WCTYPE_FUNCTIONS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -15644,11 +15972,11 @@ for ac_func in dlopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15701,35 +16029,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -15739,8 +16074,8 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 -echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 +$as_echo_n "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -15764,8 +16099,8 @@ ;; esac fi -{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 -echo "${ECHO_T}$DYNLOADFILE" >&6; } +{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 +$as_echo "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -15778,16 +16113,16 @@ # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 -echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 +$as_echo_n "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi -{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 -echo "${ECHO_T}MACHDEP_OBJS" >&6; } +{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 +$as_echo "MACHDEP_OBJS" >&6; } # checks for library functions @@ -15886,11 +16221,11 @@ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15943,35 +16278,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -15980,8 +16322,8 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ echo "$as_me:$LINENO: checking for chroot" >&5 -echo $ECHO_N "checking for chroot... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chroot" >&5 +$as_echo_n "checking for chroot... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16003,13 +16345,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16019,20 +16362,20 @@ #define HAVE_CHROOT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for link" >&5 -echo $ECHO_N "checking for link... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for link" >&5 +$as_echo_n "checking for link... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16054,13 +16397,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16070,20 +16414,20 @@ #define HAVE_LINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for symlink" >&5 -echo $ECHO_N "checking for symlink... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for symlink" >&5 +$as_echo_n "checking for symlink... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16105,13 +16449,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16121,20 +16466,20 @@ #define HAVE_SYMLINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fchdir" >&5 -echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5 +$as_echo_n "checking for fchdir... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16156,13 +16501,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16172,20 +16518,20 @@ #define HAVE_FCHDIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fsync" >&5 -echo $ECHO_N "checking for fsync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fsync" >&5 +$as_echo_n "checking for fsync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16207,13 +16553,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16223,20 +16570,20 @@ #define HAVE_FSYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fdatasync" >&5 -echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5 +$as_echo_n "checking for fdatasync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16258,13 +16605,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16274,20 +16622,20 @@ #define HAVE_FDATASYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for epoll" >&5 -echo $ECHO_N "checking for epoll... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for epoll" >&5 +$as_echo_n "checking for epoll... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16309,13 +16657,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16325,20 +16674,20 @@ #define HAVE_EPOLL 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for kqueue" >&5 -echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5 +$as_echo_n "checking for kqueue... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16363,13 +16712,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16379,14 +16729,14 @@ #define HAVE_KQUEUE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16397,8 +16747,8 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ echo "$as_me:$LINENO: checking for ctermid_r" >&5 -echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5 +$as_echo_n "checking for ctermid_r... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16423,13 +16773,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16439,21 +16790,21 @@ #define HAVE_CTERMID_R 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for flock" >&5 -echo $ECHO_N "checking for flock... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for flock" >&5 +$as_echo_n "checking for flock... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16478,13 +16829,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16494,21 +16846,21 @@ #define HAVE_FLOCK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for getpagesize" >&5 -echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16533,13 +16885,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16549,14 +16902,14 @@ #define HAVE_GETPAGESIZE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16566,10 +16919,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TRUE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. @@ -16582,7 +16935,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TRUE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16593,11 +16946,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { echo "$as_me:$LINENO: result: $TRUE" >&5 -echo "${ECHO_T}$TRUE" >&6; } + { $as_echo "$as_me:$LINENO: result: $TRUE" >&5 +$as_echo "$TRUE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16606,10 +16959,10 @@ test -n "$TRUE" || TRUE="/bin/true" -{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 -echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 +$as_echo_n "checking for inet_aton in -lc... " >&6; } if test "${ac_cv_lib_c_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" @@ -16641,40 +16994,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; } -if test $ac_cv_lib_c_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 +$as_echo "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = x""yes; then $ac_cv_prog_TRUE else -{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 -echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -16706,33 +17063,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_resolv_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; } -if test $ac_cv_lib_resolv_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -16747,14 +17108,16 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ echo "$as_me:$LINENO: checking for chflags" >&5 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chflags" >&5 +$as_echo_n "checking for chflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16779,50 +17142,55 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for lchflags" >&5 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5 +$as_echo_n "checking for lchflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16847,37 +17215,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -16892,10 +17263,10 @@ ;; esac -{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 -echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 +$as_echo_n "checking for inflateCopy in -lz... " >&6; } if test "${ac_cv_lib_z_inflateCopy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -16927,33 +17298,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_inflateCopy=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateCopy=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; } -if test $ac_cv_lib_z_inflateCopy = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 +$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_COPY 1 @@ -16969,8 +17344,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking for hstrerror" >&5 -echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5 +$as_echo_n "checking for hstrerror... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16995,39 +17370,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_HSTRERROR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_aton" >&5 -echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17055,39 +17434,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_pton" >&5 -echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5 +$as_echo_n "checking for inet_pton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17115,13 +17498,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17131,22 +17515,22 @@ #define HAVE_INET_PTON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ echo "$as_me:$LINENO: checking for setgroups" >&5 -echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5 +$as_echo_n "checking for setgroups... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17174,13 +17558,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17190,14 +17575,14 @@ #define HAVE_SETGROUPS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17208,11 +17593,11 @@ for ac_func in openpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17265,42 +17650,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 -echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +$as_echo_n "checking for openpty in -lutil... " >&6; } if test "${ac_cv_lib_util_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17332,42 +17724,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; } -if test $ac_cv_lib_util_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +$as_echo "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 -echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 +$as_echo_n "checking for openpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17399,33 +17795,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; } -if test $ac_cv_lib_bsd_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 +$as_echo "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF @@ -17442,11 +17842,11 @@ for ac_func in forkpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17499,42 +17899,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 -echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 +$as_echo_n "checking for forkpty in -lutil... " >&6; } if test "${ac_cv_lib_util_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17566,42 +17973,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; } -if test $ac_cv_lib_util_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 +$as_echo "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 -echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 +$as_echo_n "checking for forkpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17633,33 +18044,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; } -if test $ac_cv_lib_bsd_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 +$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -17678,11 +18093,11 @@ for ac_func in memmove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17735,35 +18150,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -17779,11 +18201,11 @@ for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17836,35 +18258,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -17876,11 +18305,11 @@ for ac_func in dup2 getcwd strdup do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17933,35 +18362,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -17978,11 +18414,11 @@ for ac_func in getpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18035,35 +18471,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18086,13 +18529,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18104,7 +18548,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18118,11 +18562,11 @@ for ac_func in setpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18175,35 +18619,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18226,13 +18677,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18244,7 +18696,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18258,11 +18710,11 @@ for ac_func in gettimeofday do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18315,35 +18767,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18366,20 +18825,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18396,8 +18856,8 @@ done -{ echo "$as_me:$LINENO: checking for major" >&5 -echo $ECHO_N "checking for major... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for major" >&5 +$as_echo_n "checking for major... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18429,44 +18889,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MACROS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18495,26 +18959,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 -echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 +$as_echo_n "checking getaddrinfo bug... " >&6; } if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } + { $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes else cat >conftest.$ac_ext <<_ACEOF @@ -18617,48 +19084,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: good" >&5 -echo "${ECHO_T}good" >&6; } + { $as_echo "$as_me:$LINENO: result: good" >&5 +$as_echo "good" >&6; } buggygetaddrinfo=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } +{ $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -18678,11 +19149,11 @@ for ac_func in getnameinfo do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18735,35 +19206,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18771,10 +19249,10 @@ # checks for structures -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18801,20 +19279,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -18822,8 +19301,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -18832,10 +19311,10 @@ fi -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18851,7 +19330,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -18862,20 +19341,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -18883,8 +19363,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -18893,10 +19373,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18924,20 +19404,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -18966,20 +19447,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -18990,9 +19472,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -19008,10 +19490,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19038,20 +19520,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -19059,9 +19542,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -19077,10 +19560,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19107,31 +19590,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -19141,10 +19628,10 @@ fi fi -{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +$as_echo_n "checking for struct stat.st_rdev... " >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19169,20 +19656,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19208,20 +19696,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no @@ -19232,9 +19721,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } -if test $ac_cv_member_struct_stat_st_rdev = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } +if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 @@ -19243,10 +19732,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +$as_echo_n "checking for struct stat.st_blksize... " >&6; } if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19271,20 +19760,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19310,20 +19800,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no @@ -19334,9 +19825,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } -if test $ac_cv_member_struct_stat_st_blksize = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; } +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -19345,10 +19836,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 -echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 +$as_echo_n "checking for struct stat.st_flags... " >&6; } if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19373,20 +19864,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19412,20 +19904,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_flags=no @@ -19436,9 +19929,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; } -if test $ac_cv_member_struct_stat_st_flags = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 +$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; } +if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 @@ -19447,10 +19940,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 -echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 +$as_echo_n "checking for struct stat.st_gen... " >&6; } if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19475,20 +19968,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19514,20 +20008,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_gen=no @@ -19538,9 +20033,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; } -if test $ac_cv_member_struct_stat_st_gen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 +$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; } +if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 @@ -19549,10 +20044,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 -echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 +$as_echo_n "checking for struct stat.st_birthtime... " >&6; } if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19577,20 +20072,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19616,20 +20112,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_birthtime=no @@ -19640,9 +20137,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; } -if test $ac_cv_member_struct_stat_st_birthtime = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; } +if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -19651,10 +20148,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +$as_echo_n "checking for struct stat.st_blocks... " >&6; } if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19679,20 +20176,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19718,20 +20216,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no @@ -19742,9 +20241,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } -if test $ac_cv_member_struct_stat_st_blocks = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -19766,10 +20265,10 @@ -{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 -echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 +$as_echo_n "checking for time.h that defines altzone... " >&6; } if test "${ac_cv_header_time_altzone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19792,20 +20291,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time_altzone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_altzone=no @@ -19814,8 +20314,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 -echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 +$as_echo "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then cat >>confdefs.h <<\_ACEOF @@ -19825,8 +20325,8 @@ fi was_it_defined=no -{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19852,13 +20352,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -19872,20 +20373,20 @@ was_it_defined=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ echo "$as_me:$LINENO: checking for addrinfo" >&5 -echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5 +$as_echo_n "checking for addrinfo... " >&6; } if test "${ac_cv_struct_addrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19909,20 +20410,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_addrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_addrinfo=no @@ -19931,8 +20433,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 +$as_echo "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then cat >>confdefs.h <<\_ACEOF @@ -19941,10 +20443,10 @@ fi -{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 -echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 +$as_echo_n "checking for sockaddr_storage... " >&6; } if test "${ac_cv_struct_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19969,20 +20471,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_sockaddr_storage=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no @@ -19991,8 +20494,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then cat >>confdefs.h <<\_ACEOF @@ -20004,10 +20507,10 @@ # checks for compiler characteristics -{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20032,20 +20535,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes @@ -20053,8 +20557,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 @@ -20062,10 +20566,10 @@ fi -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20137,20 +20641,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -20158,20 +20663,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const +#define const /**/ _ACEOF fi works=no -{ echo "$as_me:$LINENO: checking for working volatile" >&5 -echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20193,37 +20698,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define volatile +#define volatile /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } works=no -{ echo "$as_me:$LINENO: checking for working signed char" >&5 -echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5 +$as_echo_n "checking for working signed char... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20245,37 +20751,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define signed +#define signed /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } have_prototypes=no -{ echo "$as_me:$LINENO: checking for prototypes" >&5 -echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5 +$as_echo_n "checking for prototypes... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20297,13 +20804,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20317,19 +20825,19 @@ have_prototypes=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_prototypes" >&5 -echo "${ECHO_T}$have_prototypes" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5 +$as_echo "$have_prototypes" >&6; } works=no -{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 -echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 +$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20361,13 +20869,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20381,19 +20890,19 @@ works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } # check for socketpair -{ echo "$as_me:$LINENO: checking for socketpair" >&5 -echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5 +$as_echo_n "checking for socketpair... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20418,13 +20927,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20434,22 +20944,22 @@ #define HAVE_SOCKETPAIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 -echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 +$as_echo_n "checking if sockaddr has sa_len member... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20473,37 +20983,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext va_list_is_array=no -{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5 -echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5 +$as_echo_n "checking whether va_list is an array... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20531,20 +21042,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -20558,17 +21070,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5 -echo "${ECHO_T}$va_list_is_array" >&6; } +{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5 +$as_echo "$va_list_is_array" >&6; } # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( -{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 -echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 +$as_echo_n "checking for gethostbyname_r... " >&6; } if test "${ac_cv_func_gethostbyname_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20621,39 +21133,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname_r=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; } -if test $ac_cv_func_gethostbyname_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 +$as_echo "$ac_cv_func_gethostbyname_r" >&6; } +if test "x$ac_cv_func_gethostbyname_r" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF - { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 +$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat >conftest.$ac_ext <<_ACEOF @@ -20687,13 +21203,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20708,18 +21225,18 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 +$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20751,13 +21268,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20772,18 +21290,18 @@ #define HAVE_GETHOSTBYNAME_R_5_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 +$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20813,13 +21331,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20834,16 +21353,16 @@ #define HAVE_GETHOSTBYNAME_R_3_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -20863,11 +21382,11 @@ for ac_func in gethostbyname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20920,35 +21439,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -20967,10 +21493,10 @@ # (none yet) # Linux requires this for correct f.p. operations -{ echo "$as_me:$LINENO: checking for __fpu_control" >&5 -echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5 +$as_echo_n "checking for __fpu_control... " >&6; } if test "${ac_cv_func___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21023,39 +21549,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; } -if test $ac_cv_func___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 +$as_echo "$ac_cv_func___fpu_control" >&6; } +if test "x$ac_cv_func___fpu_control" = x""yes; then : else -{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 -echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 +$as_echo_n "checking for __fpu_control in -lieee... " >&6; } if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" @@ -21087,33 +21617,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ieee___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; } -if test $ac_cv_lib_ieee___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 +$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF @@ -21127,8 +21661,8 @@ # Check for --with-fpectl -{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5 -echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5 +$as_echo_n "checking for --with-fpectl... " >&6; } # Check whether --with-fpectl was given. if test "${with_fpectl+set}" = set; then @@ -21140,14 +21674,14 @@ #define WANT_SIGFPE_HANDLER 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21157,53 +21691,53 @@ Darwin) ;; *) LIBM=-lm esac -{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 -echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 +$as_echo_n "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. if test "${with_libm+set}" = set; then withval=$with_libm; if test "$withval" = no then LIBM= - { echo "$as_me:$LINENO: result: force LIBM empty" >&5 -echo "${ECHO_T}force LIBM empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5 +$as_echo "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 -echo "${ECHO_T}set LIBM=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 -echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 +$as_echo "set LIBM=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 -echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 +$as_echo "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 -echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 +$as_echo_n "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. if test "${with_libc+set}" = set; then withval=$with_libc; if test "$withval" = no then LIBC= - { echo "$as_me:$LINENO: result: force LIBC empty" >&5 -echo "${ECHO_T}force LIBC empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5 +$as_echo "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 -echo "${ECHO_T}set LIBC=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 -echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 +$as_echo "set LIBC=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 -echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 +$as_echo "default LIBC=\"$LIBC\"" >&6; } fi @@ -21219,10 +21753,10 @@ # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 -echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +$as_echo_n "checking for x87-style double rounding... " >&6; } if test "${ac_cv_x87_double_rounding+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21261,37 +21795,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_x87_double_rounding=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_x87_double_rounding=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 -echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +$as_echo "$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then @@ -21304,10 +21841,10 @@ # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. -{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 -echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 +$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; } if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21338,37 +21875,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_tanh_preserves_zero_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_tanh_preserves_zero_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 -echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 +$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; } if test "$ac_cv_tanh_preserves_zero_sign" = yes then @@ -21388,11 +21928,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21445,44 +21985,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done -{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 -echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +$as_echo_n "checking whether isinf is declared... " >&6; } if test "${ac_cv_have_decl_isinf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21509,20 +22056,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isinf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isinf=no @@ -21530,9 +22078,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } -if test $ac_cv_have_decl_isinf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +$as_echo "$ac_cv_have_decl_isinf" >&6; } +if test "x$ac_cv_have_decl_isinf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISINF 1 @@ -21546,10 +22094,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 -echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +$as_echo_n "checking whether isnan is declared... " >&6; } if test "${ac_cv_have_decl_isnan+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21576,20 +22124,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isnan=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isnan=no @@ -21597,9 +22146,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } -if test $ac_cv_have_decl_isnan = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +$as_echo "$ac_cv_have_decl_isnan" >&6; } +if test "x$ac_cv_have_decl_isnan" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISNAN 1 @@ -21613,10 +22162,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 -echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +$as_echo_n "checking whether isfinite is declared... " >&6; } if test "${ac_cv_have_decl_isfinite+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21643,20 +22192,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isfinite=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isfinite=no @@ -21664,9 +22214,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } -if test $ac_cv_have_decl_isfinite = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +$as_echo "$ac_cv_have_decl_isfinite" >&6; } +if test "x$ac_cv_have_decl_isfinite" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISFINITE 1 @@ -21687,17 +22237,17 @@ # check for wchar.h if test "${ac_cv_header_wchar_h+set}" = set; then - { echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking wchar.h usability" >&5 -echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5 +$as_echo_n "checking wchar.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21713,32 +22263,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking wchar.h presence" >&5 -echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5 +$as_echo_n "checking wchar.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21752,51 +22303,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------------ ## ## Report this to http://www.python.org/python-bugs ## @@ -21805,18 +22357,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } fi -if test $ac_cv_header_wchar_h = yes; then +if test "x$ac_cv_header_wchar_h" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -21835,69 +22387,14 @@ # determine wchar_t size if test "$wchar_h" = yes then - { echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } -if test "${ac_cv_type_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -typedef wchar_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_wchar_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; } - -# The cast to long int works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of wchar_t" >&5 -echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } if test "${ac_cv_sizeof_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -21909,11 +22406,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; test_array [0] = 0 ; @@ -21926,13 +22422,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21947,11 +22444,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -21964,20 +22460,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -21991,7 +22488,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -22002,11 +22499,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; test_array [0] = 0 ; @@ -22019,13 +22515,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22040,11 +22537,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -22057,20 +22553,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -22084,7 +22581,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -22105,11 +22602,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22122,20 +22618,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -22146,11 +22643,13 @@ case $ac_lo in ?*) ac_cv_sizeof_wchar_t=$ac_lo;; '') if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi ;; @@ -22164,9 +22663,8 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (wchar_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } #include #include int @@ -22176,20 +22674,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (wchar_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -22202,43 +22702,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_wchar_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } @@ -22249,8 +22754,8 @@ fi -{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 -echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 +$as_echo_n "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22277,13 +22782,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22297,24 +22803,24 @@ have_ucs4_tcl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 -echo "${ECHO_T}$have_ucs4_tcl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 +$as_echo "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 -echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 +$as_echo_n "checking whether wchar_t is signed... " >&6; } if test "${ac_cv_wchar_t_signed+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22341,41 +22847,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_wchar_t_signed=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_wchar_t_signed=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 -echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 +$as_echo "$ac_cv_wchar_t_signed" >&6; } fi -{ echo "$as_me:$LINENO: checking what type to use for str" >&5 -echo $ECHO_N "checking what type to use for str... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking what type to use for str" >&5 +$as_echo_n "checking what type to use for str... " >&6; } # Check whether --with-wide-unicode was given. if test "${with_wide_unicode+set}" = set; then @@ -22421,53 +22930,199 @@ #define HAVE_USABLE_WCHAR_T 1 _ACEOF - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE wchar_t -_ACEOF + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE wchar_t +_ACEOF + +elif test "$ac_cv_sizeof_short" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned short" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned short +_ACEOF + +elif test "$ac_cv_sizeof_long" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned long" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned long +_ACEOF + +else + PY_UNICODE_TYPE="no type found" +fi +{ $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 +$as_echo "$PY_UNICODE_TYPE" >&6; } + +# check for endianness + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi -elif test "$ac_cv_sizeof_short" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned short" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned short -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -elif test "$ac_cv_sizeof_long" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned long" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned long -_ACEOF -else - PY_UNICODE_TYPE="no type found" fi -{ echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 -echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; } -# check for endianness -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -22479,33 +23134,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; @@ -22517,20 +23172,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -22538,29 +23194,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - _ascii (); _ebcdic (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } @@ -22571,30 +23242,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22613,14 +23285,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; @@ -22632,63 +23304,70 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 -echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 +$as_echo_n "checking whether right shift extends the sign bit... " >&6; } if test "${ac_cv_rshift_extends_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22713,37 +23392,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_rshift_extends_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_rshift_extends_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 -echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 +$as_echo "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -22754,10 +23436,10 @@ fi # check for getc_unlocked and related locking functions -{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 -echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 +$as_echo_n "checking for getc_unlocked() and friends... " >&6; } if test "${ac_cv_have_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22786,32 +23468,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_have_getc_unlocked=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_getc_unlocked=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 +$as_echo "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -22829,8 +23515,8 @@ # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. py_cv_lib_readline=no -{ echo "$as_me:$LINENO: checking how to link readline libs" >&5 -echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5 +$as_echo_n "checking how to link readline libs... " >&6; } for py_libtermcap in "" ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-lreadline" @@ -22866,26 +23552,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then py_cv_lib_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then @@ -22895,11 +23585,11 @@ # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 -echo "${ECHO_T}$READLINE_LIBS" >&6; } + { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 +$as_echo "$READLINE_LIBS" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 @@ -22908,10 +23598,10 @@ fi # check for readline 2.1 -{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 -echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 +$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -22943,33 +23633,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_callback_handler_install=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; } -if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 +$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } +if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_CALLBACK 1 @@ -22992,20 +23686,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23036,10 +23731,10 @@ fi # check for readline 4.0 -{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 +$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23071,33 +23766,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_pre_input_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_pre_input_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; } -if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_PRE_INPUT_HOOK 1 @@ -23107,10 +23806,10 @@ # also in 4.0 -{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 +$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23142,33 +23841,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_display_matches_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_display_matches_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } -if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 @@ -23178,10 +23881,10 @@ # check for readline 4.2 -{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 +$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23213,33 +23916,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_matches=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_matches=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test $ac_cv_lib_readline_rl_completion_matches = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_MATCHES 1 @@ -23262,20 +23969,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23308,10 +24016,10 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ echo "$as_me:$LINENO: checking for broken nice()" >&5 -echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5 +$as_echo_n "checking for broken nice()... " >&6; } if test "${ac_cv_broken_nice+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23339,37 +24047,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_nice=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_nice=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 -echo "${ECHO_T}$ac_cv_broken_nice" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 +$as_echo "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -23379,8 +24090,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken poll()" >&5 -echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5 +$as_echo_n "checking for broken poll()... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_poll=no else @@ -23422,35 +24133,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_poll=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_poll=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 -echo "${ECHO_T}$ac_cv_broken_poll" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 +$as_echo "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -23463,10 +24177,10 @@ # Before we can test tzset, we need to check if struct tm has a tm_zone # (which is not required by ISO C or UNIX spec) and/or if we support # tzname[] -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23494,20 +24208,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -23536,20 +24251,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -23560,9 +24276,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -23578,10 +24294,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23608,20 +24324,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -23629,9 +24346,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -23647,10 +24364,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23677,31 +24394,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -23713,10 +24434,10 @@ # check tzset(3) exists and works like we expect it to -{ echo "$as_me:$LINENO: checking for working tzset()" >&5 -echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5 +$as_echo_n "checking for working tzset()... " >&6; } if test "${ac_cv_working_tzset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23799,37 +24520,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_tzset=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_working_tzset=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 -echo "${ECHO_T}$ac_cv_working_tzset" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 +$as_echo "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -23840,10 +24564,10 @@ fi # Look for subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 +$as_echo_n "checking for tv_nsec in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23869,20 +24593,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec=no @@ -23891,8 +24616,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 +$as_echo "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -23903,10 +24628,10 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 +$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23932,20 +24657,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec2=no @@ -23954,8 +24680,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 +$as_echo "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -23966,10 +24692,10 @@ fi # On HP/UX 11.0, mvwdelch is a block with a return statement -{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 -echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 +$as_echo_n "checking whether mvwdelch is an expression... " >&6; } if test "${ac_cv_mvwdelch_is_expression+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23995,20 +24721,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_mvwdelch_is_expression=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_mvwdelch_is_expression=no @@ -24017,8 +24744,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 -echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 +$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -24029,10 +24756,10 @@ fi -{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 -echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 +$as_echo_n "checking whether WINDOW has _flags... " >&6; } if test "${ac_cv_window_has_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24058,20 +24785,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_window_has_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_window_has_flags=no @@ -24080,8 +24808,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 -echo "${ECHO_T}$ac_cv_window_has_flags" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 +$as_echo "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes @@ -24093,8 +24821,8 @@ fi -{ echo "$as_me:$LINENO: checking for is_term_resized" >&5 -echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5 +$as_echo_n "checking for is_term_resized... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24116,13 +24844,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24132,21 +24861,21 @@ #define HAVE_CURSES_IS_TERM_RESIZED 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resize_term" >&5 -echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5 +$as_echo_n "checking for resize_term... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24168,13 +24897,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24184,21 +24914,21 @@ #define HAVE_CURSES_RESIZE_TERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resizeterm" >&5 -echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5 +$as_echo_n "checking for resizeterm... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24220,13 +24950,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24236,61 +24967,63 @@ #define HAVE_CURSES_RESIZETERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 -echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } if test -r /dev/ptmx then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5 -echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } if test -r /dev/ptc then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 +$as_echo_n "checking for %zd printf() format support... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24339,47 +25072,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PY_FORMAT_SIZE_T "z" _ACEOF else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -24394,14 +25131,53 @@ #endif -typedef socklen_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (socklen_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; ; return 0; } @@ -24412,30 +25188,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_socklen_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then : else @@ -24446,8 +25231,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 -echo $ECHO_N "checking for broken mbstowcs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 +$as_echo_n "checking for broken mbstowcs... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_mbstowcs=no else @@ -24473,35 +25258,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_mbstowcs=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_mbstowcs=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 -echo "${ECHO_T}$ac_cv_broken_mbstowcs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 +$as_echo "$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then @@ -24511,6 +25299,32 @@ 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; } + +# Check whether --with-computed-gotos was given. +if test "${with_computed_gotos+set}" = set; then + withval=$with_computed_gotos; +if test "$withval" != no +then + +cat >>confdefs.h <<\_ACEOF +#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; } +fi +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for h in `(cd $srcdir;echo Python/thread_*.h)` @@ -24520,15 +25334,15 @@ SRCDIRS="Parser Grammar Objects Python Modules Mac" -{ echo "$as_me:$LINENO: checking for build directories" >&5 -echo $ECHO_N "checking for build directories... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for build directories" >&5 +$as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6; } +{ $as_echo "$as_me:$LINENO: result: done" >&5 +$as_echo "done" >&6; } # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" @@ -24560,11 +25374,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -24597,12 +25412,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -24618,7 +25433,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -24630,12 +25445,14 @@ + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -24648,7 +25465,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24658,7 +25475,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -24680,17 +25497,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -24706,8 +25551,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -24730,7 +25573,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -24743,17 +25586,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -24775,7 +25611,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -24826,7 +25662,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -24854,7 +25690,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -24867,19 +25702,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -24904,10 +25742,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 @@ -24930,7 +25768,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -24943,29 +25781,39 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -24976,24 +25824,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ python config.status 3.1 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -25015,30 +25863,36 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -25057,30 +25911,32 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -25094,8 +25950,8 @@ "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -25135,222 +25991,145 @@ (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF +ac_cr=' +' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -VERSION!$VERSION$ac_delim -SOVERSION!$SOVERSION$ac_delim -CONFIG_ARGS!$CONFIG_ARGS$ac_delim -UNIVERSALSDK!$UNIVERSALSDK$ac_delim -ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim -PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim -PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim -PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim -PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim -PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim -FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim -FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim -FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim -FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim -FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim -MACHDEP!$MACHDEP$ac_delim -SGI_ABI!$SGI_ABI$ac_delim -CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim -EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CXX!$CXX$ac_delim -MAINCC!$MAINCC$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -BUILDEXEEXT!$BUILDEXEEXT$ac_delim -LIBRARY!$LIBRARY$ac_delim -LDLIBRARY!$LDLIBRARY$ac_delim -DLLLIBRARY!$DLLLIBRARY$ac_delim -BLDLIBRARY!$BLDLIBRARY$ac_delim -LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim -INSTSONAME!$INSTSONAME$ac_delim -RUNSHARED!$RUNSHARED$ac_delim -LINKCC!$LINKCC$ac_delim -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 + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + print line +} -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim -USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim -LDLAST!$LDLAST$ac_delim -THREADOBJ!$THREADOBJ$ac_delim -DLINCLDIR!$DLINCLDIR$ac_delim -DYNLOADFILE!$DYNLOADFILE$ac_delim -MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim -TRUE!$TRUE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim -HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim -HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim -LIBM!$LIBM$ac_delim -LIBC!$LIBC$ac_delim -THREADHEADERS!$THREADHEADERS$ac_delim -SRCDIRS!$SRCDIRS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACAWK _ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 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;} +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof _ACEOF - # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -25366,19 +26145,133 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -25407,26 +26300,38 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -25436,7 +26341,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -25462,7 +26367,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -25471,7 +26376,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -25492,17 +26397,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -25542,12 +26447,13 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -25556,13 +26462,14 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -25576,15 +26483,16 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -25594,119 +26502,58 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; @@ -25720,6 +26567,11 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -25741,6 +26593,10 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi echo "creating Modules/Setup" Modified: python/branches/io-c/configure.in ============================================================================== --- python/branches/io-c/configure.in (original) +++ python/branches/io-c/configure.in Tue Jan 27 23:14:53 2009 @@ -3660,6 +3660,22 @@ wide chars that would be converted.]) fi +# Check for --with-computed-gotos +AC_MSG_CHECKING(for --with-computed-gotos) +AC_ARG_WITH(computed-gotos, + AC_HELP_STRING(--with-computed-gotos, + Use computed gotos / threaded dispatch in evaluation loop (not available on all compilers)), +[ +if test "$withval" != no +then + AC_DEFINE(USE_COMPUTED_GOTOS, 1, + [Define if you want to use computed gotos in ceval.c.]) + AC_MSG_RESULT(yes) +else AC_MSG_RESULT(no) +fi], +[AC_MSG_RESULT(no)]) + + AC_SUBST(THREADHEADERS) for h in `(cd $srcdir;echo Python/thread_*.h)` Modified: python/branches/io-c/pyconfig.h.in ============================================================================== --- python/branches/io-c/pyconfig.h.in (original) +++ python/branches/io-c/pyconfig.h.in Tue Jan 27 23:14:53 2009 @@ -5,6 +5,9 @@ #define Py_PYCONFIG_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -949,6 +952,31 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* 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 @@ -986,20 +1014,21 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif /* Define if arithmetic is subject to x87-style double rounding issue */ #undef X87_DOUBLE_ROUNDING -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Define on OpenBSD to activate all library features */ #undef _BSD_SOURCE @@ -1018,15 +1047,25 @@ /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX + /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE /* Define _OSF_SOURCE to get the makedev macro. */ #undef _OSF_SOURCE +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS Modified: python/branches/io-c/setup.py ============================================================================== --- python/branches/io-c/setup.py (original) +++ python/branches/io-c/setup.py Tue Jan 27 23:14:53 2009 @@ -1061,9 +1061,12 @@ if macros.get('HAVE_SEM_OPEN', False): multiprocessing_srcs.append('_multiprocessing/semaphore.c') - exts.append ( Extension('_multiprocessing', multiprocessing_srcs, - define_macros=list(macros.items()), - include_dirs=["Modules/_multiprocessing"])) + if sysconfig.get_config_var('WITH_THREAD'): + exts.append ( Extension('_multiprocessing', multiprocessing_srcs, + define_macros=list(macros.items()), + include_dirs=["Modules/_multiprocessing"])) + else: + missing.append('_multiprocessing') # End multiprocessing # Platform-specific libraries From buildbot at python.org Tue Jan 27 23:41:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 27 Jan 2009 22:41:35 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090127224135.20C771E4002@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/190 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_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 python-checkins at python.org Wed Jan 28 00:10:25 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Wed, 28 Jan 2009 00:10:25 +0100 (CET) Subject: [Python-checkins] r69037 - in python/branches/io-c: PC/config.c PCbuild/pythoncore.vcproj Message-ID: <20090127231025.ABD381E402C@bag.python.org> Author: amaury.forgeotdarc Date: Wed Jan 28 00:10:25 2009 New Revision: 69037 Log: Update the win32 project files Modified: python/branches/io-c/PC/config.c python/branches/io-c/PCbuild/pythoncore.vcproj Modified: python/branches/io-c/PC/config.c ============================================================================== --- python/branches/io-c/PC/config.c (original) +++ python/branches/io-c/PC/config.c Wed Jan 28 00:10:25 2009 @@ -58,8 +58,7 @@ extern PyObject* PyInit__subprocess(void); extern PyObject* PyInit__lsprof(void); extern PyObject* PyInit__ast(void); -extern PyObject* PyInit__fileio(void); -extern PyObject* PyInit__bytesio(void); +extern PyObject* PyInit__io(void); extern PyObject* PyInit__stringio(void); extern PyObject* PyInit__pickle(void); extern PyObject* PyInit_atexit(void); @@ -150,8 +149,7 @@ {"sys", NULL}, {"_warnings", _PyWarnings_Init}, - {"_fileio", PyInit__fileio}, - {"_bytesio", PyInit__bytesio}, + {"_io", PyInit__io}, {"_stringio", PyInit__stringio}, {"_pickle", PyInit__pickle}, {"atexit", PyInit_atexit}, Modified: python/branches/io-c/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/io-c/PCbuild/pythoncore.vcproj (original) +++ python/branches/io-c/PCbuild/pythoncore.vcproj Wed Jan 28 00:10:25 2009 @@ -975,6 +975,10 @@ > + + @@ -1003,6 +1007,14 @@ > + + + + @@ -1035,6 +1047,10 @@ > + + @@ -1075,6 +1091,10 @@ > + + From python-checkins at python.org Wed Jan 28 00:12:23 2009 From: python-checkins at python.org (mark.hammond) Date: Wed, 28 Jan 2009 00:12:23 +0100 (CET) Subject: [Python-checkins] r69038 - in python/trunk: PC/dl_nt.c Python/dynload_win.c Message-ID: <20090127231223.82B4A1E4015@bag.python.org> Author: mark.hammond Date: Wed Jan 28 00:12:23 2009 New Revision: 69038 Log: On Windows, use the Python 'Activation Context' when loading extensions to avoid problems loading the CRT from a private assembly. Via bug 4566. Modified: python/trunk/PC/dl_nt.c python/trunk/Python/dynload_win.c Modified: python/trunk/PC/dl_nt.c ============================================================================== --- python/trunk/PC/dl_nt.c (original) +++ python/trunk/PC/dl_nt.c Wed Jan 28 00:12:23 2009 @@ -18,6 +18,63 @@ HMODULE PyWin_DLLhModule = NULL; const char *PyWin_DLLVersionString = dllVersionBuffer; +// Windows "Activation Context" work: +// Our .pyd extension modules are generally built without a manifest (ie, +// those included with Python and those built with a default distutils. +// This requires we perform some "activation context" magic when loading our +// extensions. In summary: +// * As our DLL loads we save the context being used. +// * Before loading our extensions we re-activate our saved context. +// * After extension load is complete we restore the old context. +// As an added complication, this magic only works on XP or later - we simply +// use the existence (or not) of the relevant function pointers from kernel32. +// See bug 4566 (http://python.org/sf/4566) for more details. + +typedef BOOL (WINAPI * PFN_GETCURRENTACTCTX)(HANDLE *); +typedef BOOL (WINAPI * PFN_ACTIVATEACTCTX)(HANDLE, ULONG_PTR *); +typedef BOOL (WINAPI * PFN_DEACTIVATEACTCTX)(DWORD, ULONG_PTR); +typedef BOOL (WINAPI * PFN_ADDREFACTCTX)(HANDLE); +typedef BOOL (WINAPI * PFN_RELEASEACTCTX)(HANDLE); + +// locals and function pointers for this activation context magic. +static HANDLE PyWin_DLLhActivationContext = NULL; // one day it might be public +static PFN_GETCURRENTACTCTX pfnGetCurrentActCtx = NULL; +static PFN_ACTIVATEACTCTX pfnActivateActCtx = NULL; +static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL; +static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL; +static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL; + +void _LoadActCtxPointers() +{ + HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll"); + if (hKernel32) + pfnGetCurrentActCtx = (PFN_GETCURRENTACTCTX) GetProcAddress(hKernel32, "GetCurrentActCtx"); + // If we can't load GetCurrentActCtx (ie, pre XP) , don't bother with the rest. + if (pfnGetCurrentActCtx) { + pfnActivateActCtx = (PFN_ACTIVATEACTCTX) GetProcAddress(hKernel32, "ActivateActCtx"); + pfnDeactivateActCtx = (PFN_DEACTIVATEACTCTX) GetProcAddress(hKernel32, "DeactivateActCtx"); + pfnAddRefActCtx = (PFN_ADDREFACTCTX) GetProcAddress(hKernel32, "AddRefActCtx"); + pfnReleaseActCtx = (PFN_RELEASEACTCTX) GetProcAddress(hKernel32, "ReleaseActCtx"); + } +} + +ULONG_PTR _Py_ActivateActCtx() +{ + ULONG_PTR ret = 0; + if (PyWin_DLLhActivationContext && pfnActivateActCtx) + if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) { + OutputDebugString("Python failed to activate the activation context before loading a DLL\n"); + ret = 0; // no promise the failing function didn't change it! + } + return ret; +} + +void _Py_DeactivateActCtx(ULONG_PTR cookie) +{ + if (cookie && pfnDeactivateActCtx) + if (!(*pfnDeactivateActCtx)(0, cookie)) + OutputDebugString("Python failed to de-activate the activation context\n"); +} BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, @@ -29,9 +86,18 @@ PyWin_DLLhModule = hInst; // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); - //initall(); + + // and capture our activation context for use when loading extensions. + _LoadActCtxPointers(); + if (pfnGetCurrentActCtx && pfnAddRefActCtx) + if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext)) + if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext)) + OutputDebugString("Python failed to load the default activation context\n"); break; + case DLL_PROCESS_DETACH: + if (pfnReleaseActCtx) + (*pfnReleaseActCtx)(PyWin_DLLhActivationContext); break; } return TRUE; Modified: python/trunk/Python/dynload_win.c ============================================================================== --- python/trunk/Python/dynload_win.c (original) +++ python/trunk/Python/dynload_win.c Wed Jan 28 00:12:23 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); From python-checkins at python.org Wed Jan 28 00:15:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 28 Jan 2009 00:15:48 +0100 (CET) Subject: [Python-checkins] r69039 - python/trunk/Lib/mutex.py Message-ID: <20090127231548.C63701E4002@bag.python.org> Author: benjamin.peterson Date: Wed Jan 28 00:15:48 2009 New Revision: 69039 Log: use True and False Modified: python/trunk/Lib/mutex.py Modified: python/trunk/Lib/mutex.py ============================================================================== --- python/trunk/Lib/mutex.py (original) +++ python/trunk/Lib/mutex.py Wed Jan 28 00:15:48 2009 @@ -20,7 +20,7 @@ class mutex: def __init__(self): """Create a new mutex -- initially unlocked.""" - self.locked = 0 + self.locked = False self.queue = deque() def test(self): @@ -31,7 +31,7 @@ """Atomic test-and-set -- grab the lock if it is not set, return True if it succeeded.""" if not self.locked: - self.locked = 1 + self.locked = True return True else: return False @@ -52,4 +52,4 @@ function, argument = self.queue.popleft() function(argument) else: - self.locked = 0 + self.locked = False From python-checkins at python.org Wed Jan 28 00:30:16 2009 From: python-checkins at python.org (mark.hammond) Date: Wed, 28 Jan 2009 00:30:16 +0100 (CET) Subject: [Python-checkins] r69040 - in python/branches/release26-maint: PC/dl_nt.c Python/dynload_win.c Message-ID: <20090127233016.3E4661E4031@bag.python.org> Author: mark.hammond Date: Wed Jan 28 00:30:15 2009 New Revision: 69040 Log: 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. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/PC/dl_nt.c python/branches/release26-maint/Python/dynload_win.c Modified: python/branches/release26-maint/PC/dl_nt.c ============================================================================== --- python/branches/release26-maint/PC/dl_nt.c (original) +++ python/branches/release26-maint/PC/dl_nt.c Wed Jan 28 00:30:15 2009 @@ -18,6 +18,63 @@ HMODULE PyWin_DLLhModule = NULL; const char *PyWin_DLLVersionString = dllVersionBuffer; +// Windows "Activation Context" work: +// Our .pyd extension modules are generally built without a manifest (ie, +// those included with Python and those built with a default distutils. +// This requires we perform some "activation context" magic when loading our +// extensions. In summary: +// * As our DLL loads we save the context being used. +// * Before loading our extensions we re-activate our saved context. +// * After extension load is complete we restore the old context. +// As an added complication, this magic only works on XP or later - we simply +// use the existence (or not) of the relevant function pointers from kernel32. +// See bug 4566 (http://python.org/sf/4566) for more details. + +typedef BOOL (WINAPI * PFN_GETCURRENTACTCTX)(HANDLE *); +typedef BOOL (WINAPI * PFN_ACTIVATEACTCTX)(HANDLE, ULONG_PTR *); +typedef BOOL (WINAPI * PFN_DEACTIVATEACTCTX)(DWORD, ULONG_PTR); +typedef BOOL (WINAPI * PFN_ADDREFACTCTX)(HANDLE); +typedef BOOL (WINAPI * PFN_RELEASEACTCTX)(HANDLE); + +// locals and function pointers for this activation context magic. +static HANDLE PyWin_DLLhActivationContext = NULL; // one day it might be public +static PFN_GETCURRENTACTCTX pfnGetCurrentActCtx = NULL; +static PFN_ACTIVATEACTCTX pfnActivateActCtx = NULL; +static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL; +static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL; +static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL; + +void _LoadActCtxPointers() +{ + HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll"); + if (hKernel32) + pfnGetCurrentActCtx = (PFN_GETCURRENTACTCTX) GetProcAddress(hKernel32, "GetCurrentActCtx"); + // If we can't load GetCurrentActCtx (ie, pre XP) , don't bother with the rest. + if (pfnGetCurrentActCtx) { + pfnActivateActCtx = (PFN_ACTIVATEACTCTX) GetProcAddress(hKernel32, "ActivateActCtx"); + pfnDeactivateActCtx = (PFN_DEACTIVATEACTCTX) GetProcAddress(hKernel32, "DeactivateActCtx"); + pfnAddRefActCtx = (PFN_ADDREFACTCTX) GetProcAddress(hKernel32, "AddRefActCtx"); + pfnReleaseActCtx = (PFN_RELEASEACTCTX) GetProcAddress(hKernel32, "ReleaseActCtx"); + } +} + +ULONG_PTR _Py_ActivateActCtx() +{ + ULONG_PTR ret = 0; + if (PyWin_DLLhActivationContext && pfnActivateActCtx) + if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) { + OutputDebugString("Python failed to activate the activation context before loading a DLL\n"); + ret = 0; // no promise the failing function didn't change it! + } + return ret; +} + +void _Py_DeactivateActCtx(ULONG_PTR cookie) +{ + if (cookie && pfnDeactivateActCtx) + if (!(*pfnDeactivateActCtx)(0, cookie)) + OutputDebugString("Python failed to de-activate the activation context\n"); +} BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, @@ -29,9 +86,18 @@ PyWin_DLLhModule = hInst; // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); - //initall(); + + // and capture our activation context for use when loading extensions. + _LoadActCtxPointers(); + if (pfnGetCurrentActCtx && pfnAddRefActCtx) + if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext)) + if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext)) + OutputDebugString("Python failed to load the default activation context\n"); break; + case DLL_PROCESS_DETACH: + if (pfnReleaseActCtx) + (*pfnReleaseActCtx)(PyWin_DLLhActivationContext); break; } return TRUE; Modified: python/branches/release26-maint/Python/dynload_win.c ============================================================================== --- python/branches/release26-maint/Python/dynload_win.c (original) +++ python/branches/release26-maint/Python/dynload_win.c Wed Jan 28 00:30:15 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); From python-checkins at python.org Wed Jan 28 00:46:57 2009 From: python-checkins at python.org (mark.hammond) Date: Wed, 28 Jan 2009 00:46:57 +0100 (CET) Subject: [Python-checkins] r69041 - in python/branches/py3k: PC/dl_nt.c Python/dynload_win.c Message-ID: <20090127234657.8A03E1E4002@bag.python.org> Author: mark.hammond Date: Wed Jan 28 00:46:57 2009 New Revision: 69041 Log: 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. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/PC/dl_nt.c python/branches/py3k/Python/dynload_win.c Modified: python/branches/py3k/PC/dl_nt.c ============================================================================== --- python/branches/py3k/PC/dl_nt.c (original) +++ python/branches/py3k/PC/dl_nt.c Wed Jan 28 00:46:57 2009 @@ -18,6 +18,63 @@ HMODULE PyWin_DLLhModule = NULL; const char *PyWin_DLLVersionString = dllVersionBuffer; +// Windows "Activation Context" work: +// Our .pyd extension modules are generally built without a manifest (ie, +// those included with Python and those built with a default distutils. +// This requires we perform some "activation context" magic when loading our +// extensions. In summary: +// * As our DLL loads we save the context being used. +// * Before loading our extensions we re-activate our saved context. +// * After extension load is complete we restore the old context. +// As an added complication, this magic only works on XP or later - we simply +// use the existence (or not) of the relevant function pointers from kernel32. +// See bug 4566 (http://python.org/sf/4566) for more details. + +typedef BOOL (WINAPI * PFN_GETCURRENTACTCTX)(HANDLE *); +typedef BOOL (WINAPI * PFN_ACTIVATEACTCTX)(HANDLE, ULONG_PTR *); +typedef BOOL (WINAPI * PFN_DEACTIVATEACTCTX)(DWORD, ULONG_PTR); +typedef BOOL (WINAPI * PFN_ADDREFACTCTX)(HANDLE); +typedef BOOL (WINAPI * PFN_RELEASEACTCTX)(HANDLE); + +// locals and function pointers for this activation context magic. +static HANDLE PyWin_DLLhActivationContext = NULL; // one day it might be public +static PFN_GETCURRENTACTCTX pfnGetCurrentActCtx = NULL; +static PFN_ACTIVATEACTCTX pfnActivateActCtx = NULL; +static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL; +static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL; +static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL; + +void _LoadActCtxPointers() +{ + HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll"); + if (hKernel32) + pfnGetCurrentActCtx = (PFN_GETCURRENTACTCTX) GetProcAddress(hKernel32, "GetCurrentActCtx"); + // If we can't load GetCurrentActCtx (ie, pre XP) , don't bother with the rest. + if (pfnGetCurrentActCtx) { + pfnActivateActCtx = (PFN_ACTIVATEACTCTX) GetProcAddress(hKernel32, "ActivateActCtx"); + pfnDeactivateActCtx = (PFN_DEACTIVATEACTCTX) GetProcAddress(hKernel32, "DeactivateActCtx"); + pfnAddRefActCtx = (PFN_ADDREFACTCTX) GetProcAddress(hKernel32, "AddRefActCtx"); + pfnReleaseActCtx = (PFN_RELEASEACTCTX) GetProcAddress(hKernel32, "ReleaseActCtx"); + } +} + +ULONG_PTR _Py_ActivateActCtx() +{ + ULONG_PTR ret = 0; + if (PyWin_DLLhActivationContext && pfnActivateActCtx) + if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) { + OutputDebugString("Python failed to activate the activation context before loading a DLL\n"); + ret = 0; // no promise the failing function didn't change it! + } + return ret; +} + +void _Py_DeactivateActCtx(ULONG_PTR cookie) +{ + if (cookie && pfnDeactivateActCtx) + if (!(*pfnDeactivateActCtx)(0, cookie)) + OutputDebugString("Python failed to de-activate the activation context\n"); +} BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, @@ -29,9 +86,18 @@ PyWin_DLLhModule = hInst; // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); - //initall(); + + // and capture our activation context for use when loading extensions. + _LoadActCtxPointers(); + if (pfnGetCurrentActCtx && pfnAddRefActCtx) + if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext)) + if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext)) + OutputDebugString("Python failed to load the default activation context\n"); break; + case DLL_PROCESS_DETACH: + if (pfnReleaseActCtx) + (*pfnReleaseActCtx)(PyWin_DLLhActivationContext); break; } return TRUE; Modified: python/branches/py3k/Python/dynload_win.c ============================================================================== --- python/branches/py3k/Python/dynload_win.c (original) +++ python/branches/py3k/Python/dynload_win.c Wed Jan 28 00:46:57 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); From python-checkins at python.org Wed Jan 28 00:48:31 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 00:48:31 +0100 (CET) Subject: [Python-checkins] r69042 - in sandbox/trunk/ttk-gsoc/src: 2.x/test/runtests.py 2.x/test/support.py 2.x/test/test_extensions.py 2.x/test/test_functions.py 2.x/test/test_style.py 2.x/test/test_widgets.py 2.x/ttk.py 3.x/test/runtests.py 3.x/test/support.py 3.x/test/test_extensions.py 3.x/test/test_functions.py 3.x/test/test_style.py 3.x/test/test_widgets.py 3.x/ttk.py Message-ID: <20090127234831.427001E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 00:48:30 2009 New Revision: 69042 Log: * Update tests to use Python's test support where possible; * Fixed some issues found in tests; * Fixed a bug in LabeledScale.destroy. Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/runtests.py sandbox/trunk/ttk-gsoc/src/2.x/test/support.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_extensions.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_style.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py sandbox/trunk/ttk-gsoc/src/2.x/ttk.py sandbox/trunk/ttk-gsoc/src/3.x/test/runtests.py sandbox/trunk/ttk-gsoc/src/3.x/test/support.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_extensions.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_style.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/runtests.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/runtests.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/runtests.py Wed Jan 28 00:48:30 2009 @@ -1,39 +1,25 @@ import os import sys -import _tkinter +import unittest +import test.test_support -# tests in the following modules do not require a running GUI -TEXTONLY = ('test_functions.py', ) +this_dir_path = os.path.abspath(os.path.dirname(__file__)) -def show_tcl_tk(): - tk_ver = _tkinter.TK_VERSION - print "Tcl %s, Tk %s" % (_tkinter.TCL_VERSION, tk_ver) - if float(tk_ver) < 8.5: - print "Will run tests using tile" - -def get_tests(gui_tests=True): - testdir = os.path.dirname(sys.argv[0]) or os.curdir - extension = ".py" - for testname in os.listdir(testdir): - if testname.startswith('test_') and testname.endswith(extension): - if not gui_tests and testname not in TEXTONLY: - continue - yield testname[:-len(extension)] - -def run_tests(tests): - for test in tests: - module = __import__(test) - getattr(module, "test_main", None)() - -def main(args): - gui_tests = False - if 'DISPLAY' in os.environ or (len(args) > 1 and "-g" in args): - gui_tests = True - - show_tcl_tk() - run_tests(get_tests(gui_tests)) - if not gui_tests: - print "\n** GUI tests didn't run **" +def get_tests_modules(path=this_dir_path): + """This will import and yield modules whose names start with test_ + and are inside packages found in path.""" + py_ext = '.py' + + for name in os.listdir(path): + if name.startswith('test_') and name.endswith(py_ext): + yield __import__(name[:-len(py_ext)]) + +def get_tests(): + """Yield all the tests in the modules found by get_tests_modules.""" + for module in get_tests_modules(): + for test in getattr(module, 'tests'): + yield test if __name__ == "__main__": - main(sys.argv) + test.test_support.use_resources = ['gui'] + test.test_support.run_unittest(*get_tests()) Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/support.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/support.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/support.py Wed Jan 28 00:48:30 2009 @@ -1,21 +1,20 @@ -import sys -import unittest -import _tkinter +import Tkinter -def run(*classes): - suite = unittest.TestSuite() - for cls in classes: - suite.addTest(unittest.makeSuite(cls)) +def get_tk_root(): + try: + root = Tkinter._default_root + except AttributeError: + # it is possible to disable default root in Tkinter, although + # I haven't seen people doing it (but apparently someone did it + # here). + root = None - if '-v' in sys.argv: - verbosity = 1 - elif '-vv' in sys.argv: - verbosity = 2 - else: - verbosity = 0 + if root is None: + # create a new master only if there isn't one already + root = Tkinter.Tk() + + return root - runner = unittest.TextTestRunner(sys.stdout, verbosity=verbosity) - runner.run(suite) def simulate_mouse_click(widget, x, y): """Generate proper events to click at the x, y position (tries to act Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_extensions.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_extensions.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_extensions.py Wed Jan 28 00:48:30 2009 @@ -2,9 +2,12 @@ import unittest import Tkinter import ttk +from test.test_support import requires, run_unittest import support +requires('gui') + class LabeledScaleTest(unittest.TestCase): def test_widget_destroy(self): @@ -170,20 +173,21 @@ class OptionMenuTest(unittest.TestCase): - # XXX Since a StringVar is being created without an explict master, this - # test case can't be the first one to run. def setUp(self): - self.textvar = Tkinter.StringVar() + self.root = support.get_tk_root() + self.textvar = Tkinter.StringVar(self.root) def tearDown(self): del self.textvar + self.root.destroy() def test_widget_destroy(self): var = Tkinter.StringVar() optmenu = ttk.OptionMenu(None, var) name = var._name + optmenu.update_idletasks() optmenu.destroy() self.failUnlessEqual(optmenu.tk.globalgetvar(name), var.get()) del var @@ -256,8 +260,7 @@ optmenu.destroy() -def test_main(): - support.run(LabeledScaleTest, OptionMenuTest) +tests = [LabeledScaleTest, OptionMenuTest] if __name__ == "__main__": - test_main() + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py Wed Jan 28 00:48:30 2009 @@ -3,8 +3,6 @@ import unittest import ttk -import support - class MockTclObj(object): typename = 'test' @@ -421,9 +419,8 @@ self.failUnlessEqual(ttk.tclobjs_to_py({'text': 'some text'}), {'text': 'some text'}) - -def test_main(): - support.run(InternalFunctionsTest, TclObjsToPyTest) +tests = [InternalFunctionsTest, TclObjsToPyTest] if __name__ == "__main__": - test_main() + from test.test_support import run_unittest + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_style.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_style.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_style.py Wed Jan 28 00:48:30 2009 @@ -1,17 +1,24 @@ import unittest import Tkinter import ttk +from test.test_support import requires, run_unittest import support +requires('gui') + class StyleTest(unittest.TestCase): def setUp(self): - root = Tkinter.Tk() - self.style = ttk.Style(root) + self.root = support.get_tk_root() + self.style = ttk.Style(self.root) def tearDown(self): - self.style.master.destroy() + # 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() def test_configure(self): @@ -86,8 +93,7 @@ self.style.theme_use(curr_theme) -def test_main(): - support.run(StyleTest) +tests = [StyleTest] if __name__ == "__main__": - test_main() + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py Wed Jan 28 00:48:30 2009 @@ -1,10 +1,13 @@ import unittest import Tkinter import ttk +from test.test_support import requires, run_unittest import support from test_functions import MockTclObj, MockStateSpec +requires('gui') + class WidgetTest(unittest.TestCase): """Tests methods available in every ttk widget.""" @@ -1102,10 +1105,9 @@ self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) -def test_main(): - support.run(WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, +tests = [WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, ComboboxTest, EntryTest, PanedwindowTest, ScaleTest, NotebookTest, - TreeviewTest) + TreeviewTest] if __name__ == "__main__": - test_main() + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py Wed Jan 28 00:48:30 2009 @@ -51,8 +51,12 @@ 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 _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. @@ -1521,9 +1525,14 @@ def destroy(self): """Destroy this widget and possibly its associated variable.""" - self._variable.trace_vdelete('w', self.__tracecb) - del self._variable - Frame.destroy(self) + try: + self._variable.trace_vdelete('w', self.__tracecb) + except AttributeError: + # widget has been destroyed already + pass + else: + del self._variable + Frame.destroy(self) def _adjust(self, *args): Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/runtests.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/runtests.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/runtests.py Wed Jan 28 00:48:30 2009 @@ -1,39 +1,25 @@ import os import sys -import _tkinter +import unittest +import test.support -# tests in the following modules do not require a running GUI -TEXTONLY = ('test_functions.py', ) +this_dir_path = os.path.abspath(os.path.dirname(__file__)) -def show_tcl_tk(): - tk_ver = _tkinter.TK_VERSION - print("Tcl %s, Tk %s" % (_tkinter.TCL_VERSION, tk_ver)) - if float(tk_ver) < 8.5: - print("Will run tests using tile") - -def get_tests(gui_tests=True): - testdir = os.path.dirname(sys.argv[0]) or os.curdir - extension = ".py" - for testname in os.listdir(testdir): - if testname.startswith('test_') and testname.endswith(extension): - if not gui_tests and testname not in TEXTONLY: - continue - yield testname[:-len(extension)] - -def run_tests(tests): - for test in tests: - module = __import__(test) - getattr(module, "test_main", None)() - -def main(args): - gui_tests = False - if 'DISPLAY' in os.environ or (len(args) > 1 and "-g" in args): - gui_tests = True - - show_tcl_tk() - run_tests(get_tests(gui_tests)) - if not gui_tests: - print("\n** GUI tests didn't run **") +def get_tests_modules(path=this_dir_path): + """This will import and yield modules whose names start with test_ + and are inside packages found in path.""" + py_ext = '.py' + + for name in os.listdir(path): + if name.startswith('test_') and name.endswith(py_ext): + yield __import__(name[:-len(py_ext)]) + +def get_tests(): + """Yield all the tests in the modules found by get_tests_modules.""" + for module in get_tests_modules(): + for test in getattr(module, 'tests'): + yield test if __name__ == "__main__": - main(sys.argv) + test.support.use_resources = ['gui'] + test.support.run_unittest(*get_tests()) Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/support.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/support.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/support.py Wed Jan 28 00:48:30 2009 @@ -1,20 +1,20 @@ -import sys -import unittest +import tkinter -def run(*classes): - suite = unittest.TestSuite() - for cls in classes: - suite.addTest(unittest.makeSuite(cls)) +def get_tk_root(): + try: + root = tkinter._default_root + except AttributeError: + # it is possible to disable default root in Tkinter, although + # I haven't seen people doing it (but apparently someone did it + # here). + root = None - if '-v' in sys.argv: - verbosity = 1 - elif '-vv' in sys.argv: - verbosity = 2 - else: - verbosity = 0 + if root is None: + # create a new master only if there isn't one already + root = tkinter.Tk() + + return root - runner = unittest.TextTestRunner(sys.stdout, verbosity=verbosity) - runner.run(suite) def simulate_mouse_click(widget, x, y): """Generate proper events to click at the x, y position (tries to act Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_extensions.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_extensions.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_extensions.py Wed Jan 28 00:48:30 2009 @@ -2,9 +2,12 @@ import unittest import tkinter import ttk +from test.support import requires, run_unittest import support +requires('gui') + class LabeledScaleTest(unittest.TestCase): def test_widget_destroy(self): @@ -170,20 +173,21 @@ class OptionMenuTest(unittest.TestCase): - # XXX Since a StringVar is being created without an explict master, this - # test case can't be the first one to run. def setUp(self): - self.textvar = tkinter.StringVar() + self.root = support.get_tk_root() + self.textvar = tkinter.StringVar(self.root) def tearDown(self): del self.textvar + self.root.destroy() def test_widget_destroy(self): var = tkinter.StringVar() optmenu = ttk.OptionMenu(None, var) name = var._name + optmenu.update_idletasks() optmenu.destroy() self.failUnlessEqual(optmenu.tk.globalgetvar(name), var.get()) del var @@ -256,8 +260,7 @@ optmenu.destroy() -def test_main(): - support.run(LabeledScaleTest, OptionMenuTest) +tests = [LabeledScaleTest, OptionMenuTest] if __name__ == "__main__": - test_main() + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py Wed Jan 28 00:48:30 2009 @@ -2,8 +2,6 @@ import unittest import ttk -import support - class MockTclObj(object): typename = 'test' @@ -418,9 +416,8 @@ self.failUnlessEqual(ttk.tclobjs_to_py({'text': 'some text'}), {'text': 'some text'}) - -def test_main(): - support.run(InternalFunctionsTest, TclObjsToPyTest) +tests = [InternalFunctionsTest, TclObjsToPyTest] if __name__ == "__main__": - test_main() + from test.support import run_unittest + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_style.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_style.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_style.py Wed Jan 28 00:48:30 2009 @@ -1,17 +1,24 @@ import unittest import tkinter import ttk +from test.support import requires, run_unittest import support +requires('gui') + class StyleTest(unittest.TestCase): def setUp(self): - root = tkinter.Tk() - self.style = ttk.Style(root) + self.root = support.get_tk_root() + self.style = ttk.Style(self.root) def tearDown(self): - self.style.master.destroy() + # 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() def test_configure(self): @@ -86,8 +93,7 @@ self.style.theme_use(curr_theme) -def test_main(): - support.run(StyleTest) +tests = [StyleTest] if __name__ == "__main__": - test_main() + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py Wed Jan 28 00:48:30 2009 @@ -1,10 +1,13 @@ import unittest import tkinter import ttk +from test.support import requires, run_unittest import support from test_functions import MockTclObj, MockStateSpec +requires('gui') + class WidgetTest(unittest.TestCase): """Tests methods available in every ttk widget.""" @@ -1102,10 +1105,9 @@ self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) -def test_main(): - support.run(WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, +tests = [WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, ComboboxTest, EntryTest, PanedwindowTest, ScaleTest, NotebookTest, - TreeviewTest) + TreeviewTest] if __name__ == "__main__": - test_main() + run_unittest(*tests) Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Wed Jan 28 00:48:30 2009 @@ -51,8 +51,12 @@ 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 _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. @@ -1521,9 +1525,14 @@ def destroy(self): """Destroy this widget and possibly its associated variable.""" - self._variable.trace_vdelete('w', self.__tracecb) - del self._variable - Frame.destroy(self) + try: + self._variable.trace_vdelete('w', self.__tracecb) + except AttributeError: + # widget has been destroyed already + pass + else: + del self._variable + Frame.destroy(self) def _adjust(self, *args): From python-checkins at python.org Wed Jan 28 00:50:56 2009 From: python-checkins at python.org (mark.hammond) Date: Wed, 28 Jan 2009 00:50:56 +0100 (CET) Subject: [Python-checkins] r69043 - in python/branches/release30-maint: PC/dl_nt.c Python/dynload_win.c Message-ID: <20090127235056.7052D1E4002@bag.python.org> Author: mark.hammond Date: Wed Jan 28 00:50:56 2009 New Revision: 69043 Log: Merged revisions 69041 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69041 | mark.hammond | 2009-01-28 10:46:57 +1100 (Wed, 28 Jan 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. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/PC/dl_nt.c python/branches/release30-maint/Python/dynload_win.c Modified: python/branches/release30-maint/PC/dl_nt.c ============================================================================== --- python/branches/release30-maint/PC/dl_nt.c (original) +++ python/branches/release30-maint/PC/dl_nt.c Wed Jan 28 00:50:56 2009 @@ -18,6 +18,63 @@ HMODULE PyWin_DLLhModule = NULL; const char *PyWin_DLLVersionString = dllVersionBuffer; +// Windows "Activation Context" work: +// Our .pyd extension modules are generally built without a manifest (ie, +// those included with Python and those built with a default distutils. +// This requires we perform some "activation context" magic when loading our +// extensions. In summary: +// * As our DLL loads we save the context being used. +// * Before loading our extensions we re-activate our saved context. +// * After extension load is complete we restore the old context. +// As an added complication, this magic only works on XP or later - we simply +// use the existence (or not) of the relevant function pointers from kernel32. +// See bug 4566 (http://python.org/sf/4566) for more details. + +typedef BOOL (WINAPI * PFN_GETCURRENTACTCTX)(HANDLE *); +typedef BOOL (WINAPI * PFN_ACTIVATEACTCTX)(HANDLE, ULONG_PTR *); +typedef BOOL (WINAPI * PFN_DEACTIVATEACTCTX)(DWORD, ULONG_PTR); +typedef BOOL (WINAPI * PFN_ADDREFACTCTX)(HANDLE); +typedef BOOL (WINAPI * PFN_RELEASEACTCTX)(HANDLE); + +// locals and function pointers for this activation context magic. +static HANDLE PyWin_DLLhActivationContext = NULL; // one day it might be public +static PFN_GETCURRENTACTCTX pfnGetCurrentActCtx = NULL; +static PFN_ACTIVATEACTCTX pfnActivateActCtx = NULL; +static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL; +static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL; +static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL; + +void _LoadActCtxPointers() +{ + HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll"); + if (hKernel32) + pfnGetCurrentActCtx = (PFN_GETCURRENTACTCTX) GetProcAddress(hKernel32, "GetCurrentActCtx"); + // If we can't load GetCurrentActCtx (ie, pre XP) , don't bother with the rest. + if (pfnGetCurrentActCtx) { + pfnActivateActCtx = (PFN_ACTIVATEACTCTX) GetProcAddress(hKernel32, "ActivateActCtx"); + pfnDeactivateActCtx = (PFN_DEACTIVATEACTCTX) GetProcAddress(hKernel32, "DeactivateActCtx"); + pfnAddRefActCtx = (PFN_ADDREFACTCTX) GetProcAddress(hKernel32, "AddRefActCtx"); + pfnReleaseActCtx = (PFN_RELEASEACTCTX) GetProcAddress(hKernel32, "ReleaseActCtx"); + } +} + +ULONG_PTR _Py_ActivateActCtx() +{ + ULONG_PTR ret = 0; + if (PyWin_DLLhActivationContext && pfnActivateActCtx) + if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) { + OutputDebugString("Python failed to activate the activation context before loading a DLL\n"); + ret = 0; // no promise the failing function didn't change it! + } + return ret; +} + +void _Py_DeactivateActCtx(ULONG_PTR cookie) +{ + if (cookie && pfnDeactivateActCtx) + if (!(*pfnDeactivateActCtx)(0, cookie)) + OutputDebugString("Python failed to de-activate the activation context\n"); +} BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, @@ -29,9 +86,18 @@ PyWin_DLLhModule = hInst; // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); - //initall(); + + // and capture our activation context for use when loading extensions. + _LoadActCtxPointers(); + if (pfnGetCurrentActCtx && pfnAddRefActCtx) + if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext)) + if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext)) + OutputDebugString("Python failed to load the default activation context\n"); break; + case DLL_PROCESS_DETACH: + if (pfnReleaseActCtx) + (*pfnReleaseActCtx)(PyWin_DLLhActivationContext); break; } return TRUE; Modified: python/branches/release30-maint/Python/dynload_win.c ============================================================================== --- python/branches/release30-maint/Python/dynload_win.c (original) +++ python/branches/release30-maint/Python/dynload_win.c Wed Jan 28 00:50:56 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); From buildbot at python.org Wed Jan 28 01:30:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 00:30:52 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090128003052.314DA1E4002@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/1825 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,mark.hammond BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Wed Jan 28 01:51:07 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 28 Jan 2009 01:51:07 +0100 (CET) Subject: [Python-checkins] r69044 - in python/branches/io-c/Modules: _iomodule.h _textio.c io.c Message-ID: <20090128005107.B94FF1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Jan 28 01:51:07 2009 New Revision: 69044 Log: Improve heuristic in IncrementalNewlineDecoder + some micro-optimizations 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 Wed Jan 28 01:51:07 2009 @@ -107,6 +107,7 @@ 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; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Wed Jan 28 01:51:07 2009 @@ -283,7 +283,7 @@ Py_UNICODE *in_str; Py_ssize_t len; int seennl = self->seennl; - int only_lf; + int only_lf = 0; in_str = PyUnicode_AS_UNICODE(output); len = PyUnicode_GET_SIZE(output); @@ -294,8 +294,16 @@ /* If, up to now, newlines are consistently \n, do a quick check for the \r *byte* with the libc's optimized memchr. */ - only_lf = ((seennl == SEEN_LF) - && !memchr(in_str, '\r', len * sizeof(Py_UNICODE))); + if (seennl == SEEN_LF || seennl == 0) { + int has_cr, has_lf; + has_lf = (seennl == SEEN_LF) || + (memchr(in_str, '\n', len * sizeof(Py_UNICODE)) != NULL); + has_cr = (memchr(in_str, '\r', len * sizeof(Py_UNICODE)) != NULL); + if (has_lf && !has_cr) { + only_lf = 1; + seennl = SEEN_LF; + } + } if (!self->translate) { Py_UNICODE *s, *end; @@ -453,7 +461,7 @@ { self->seennl = 0; self->pendingcr = 0; - return PyObject_CallMethod(self->decoder, "reset", NULL); + return PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); } static PyObject * @@ -1729,7 +1737,7 @@ utf-16, that we are expecting a BOM). */ if (cookie->start_pos == 0 && cookie->dec_flags == 0) - res = PyObject_CallMethod(self->decoder, "reset", NULL); + res = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); else res = PyObject_CallMethod(self->decoder, "setstate", "((yi))", "", cookie->dec_flags); @@ -1742,7 +1750,7 @@ static PyObject * TextIOWrapper_seek(PyTextIOWrapperObject *self, PyObject *args) { - PyObject *cookieObj; + PyObject *cookieObj, *posobj; CookieStruct cookie; int whence = 0; static PyObject *zero = NULL; @@ -1835,7 +1843,7 @@ goto fail; } - res = PyObject_CallMethod((PyObject *)self, "flush", NULL); + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); if (res == NULL) goto fail; Py_DECREF(res); @@ -1847,8 +1855,12 @@ goto fail; /* Seek back to the safe start point. */ - res = PyObject_CallMethod(self->buffer, "seek", - "L", (PY_LONG_LONG)cookie.start_pos); + posobj = PyLong_FromOff_t(cookie.start_pos); + if (posobj == NULL) + goto fail; + res = PyObject_CallMethodObjArgs(self->buffer, + _PyIO_str_seek, posobj, NULL); + Py_DECREF(posobj); if (res == NULL) goto fail; Py_DECREF(res); Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Wed Jan 28 01:51:07 2009 @@ -38,6 +38,7 @@ 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; @@ -722,6 +723,8 @@ goto fail; if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) goto fail; + if (!(_PyIO_str_reset = PyUnicode_InternFromString("reset"))) + goto fail; if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) goto fail; if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) From buildbot at python.org Wed Jan 28 02:08:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 01:08:53 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090128010853.8C7151E4002@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/73 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.hammond 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 130, in poll r, w, e = select.select(r, w, e, timeout) error: (9, 'Bad file descriptor') sincerely, -The Buildbot From buildbot at python.org Wed Jan 28 02:55:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 01:55:39 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090128015540.1A5861E4058@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/80 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.hammond 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 Wed Jan 28 12:41:14 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 28 Jan 2009 12:41:14 +0100 (CET) Subject: [Python-checkins] r69045 - in python/branches/py3k-issue1717: Lib/test/test_parser.py Modules/parsermodule.c Message-ID: <20090128114114.1E2C91E4002@bag.python.org> Author: mark.dickinson Date: Wed Jan 28 12:41:13 2009 New Revision: 69045 Log: Put (rich) comparisons back in for parser module, and add tests for those comparisons. (The parser module docs say that comparisons between ST objects should be supported.) Modified: python/branches/py3k-issue1717/Lib/test/test_parser.py python/branches/py3k-issue1717/Modules/parsermodule.c Modified: python/branches/py3k-issue1717/Lib/test/test_parser.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_parser.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_parser.py Wed Jan 28 12:41:13 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-issue1717/Modules/parsermodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/parsermodule.c (original) +++ python/branches/py3k-issue1717/Modules/parsermodule.c Wed Jan 28 12:41:13 2009 @@ -169,6 +169,7 @@ static void parser_free(PyST_Object *st); +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 *); @@ -222,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 */ @@ -230,6 +231,102 @@ }; /* 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) +{ + int j; + + if (TYPE(left) < TYPE(right)) + return (-1); + + if (TYPE(right) < TYPE(left)) + return (1); + + if (ISTERMINAL(TYPE(left))) + return (strcmp(STR(left), STR(right))); + + if (NCH(left) < NCH(right)) + return (-1); + + if (NCH(right) < NCH(left)) + return (1); + + for (j = 0; j < NCH(left); ++j) { + int v = parser_compare_nodes(CHILD(left, j), CHILD(right, j)); + + if (v != 0) + return (v); + } + return (0); +} + +/* 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. + * + */ + +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +parser_richcompare(PyObject *left, PyObject *right, int op) +{ + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + if (left == NULL || right == NULL) { + PyErr_BadInternalCall(); + return NULL; + } + + /* 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) * * Allocates a new Python object representing an ST. This is simply the From python-checkins at python.org Wed Jan 28 13:26:18 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 28 Jan 2009 13:26:18 +0100 (CET) Subject: [Python-checkins] r69046 - python/branches/py3k-issue1717/Modules/_tkinter.c Message-ID: <20090128122618.44A3B1E4002@bag.python.org> Author: mark.dickinson Date: Wed Jan 28 13:26:18 2009 New Revision: 69046 Log: Add rich comparisons to PyTclObject, to replace the removed three-way comparison code. This code is untested, and will remain so until I figure out how to get my hands on a PyTclObject from within Python. Modified: python/branches/py3k-issue1717/Modules/_tkinter.c Modified: python/branches/py3k-issue1717/Modules/_tkinter.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_tkinter.c (original) +++ python/branches/py3k-issue1717/Modules/_tkinter.c Wed Jan 28 13:26:18 2009 @@ -788,6 +788,61 @@ self->value->typePtr->name, self->value); } +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +PyTclObject_richcompare(PyObject *self, PyObject *other, int op) +{ + 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"); static PyObject* @@ -807,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*/ - 0, /*tp_reserved*/ + (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* From python-checkins at python.org Wed Jan 28 13:41:58 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 13:41:58 +0100 (CET) Subject: [Python-checkins] r69047 - in sandbox/trunk/ttk-gsoc/samples: dirbrowser.py widget_state.py Message-ID: <20090128124158.5AF3B1E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 13:41:58 2009 New Revision: 69047 Log: Adjusts to work with the 0.3 release. Modified: sandbox/trunk/ttk-gsoc/samples/dirbrowser.py sandbox/trunk/ttk-gsoc/samples/widget_state.py Modified: sandbox/trunk/ttk-gsoc/samples/dirbrowser.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/dirbrowser.py (original) +++ sandbox/trunk/ttk-gsoc/samples/dirbrowser.py Wed Jan 28 13:41:58 2009 @@ -19,7 +19,7 @@ return path = tree.set(node, "fullpath") - tree.delete(tree.get_children(node)) + tree.delete(*tree.get_children(node)) parent = tree.parent(node) special_dirs = [] if parent else glob.glob('.') + glob.glob('..') Modified: sandbox/trunk/ttk-gsoc/samples/widget_state.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/widget_state.py (original) +++ sandbox/trunk/ttk-gsoc/samples/widget_state.py Wed Jan 28 13:41:58 2009 @@ -19,7 +19,7 @@ self.style = ttk.Style() # get default font size and family - btn_font = self.style.lookup("TButton", "-font") + btn_font = self.style.lookup("TButton", "font") fsize = str(self.tk.eval("font configure %s -size" % btn_font)) self.font_family = self.tk.eval("font configure %s -family" % btn_font) if ' ' in self.font_family: From python-checkins at python.org Wed Jan 28 13:43:56 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 13:43:56 +0100 (CET) Subject: [Python-checkins] r69048 - in sandbox/trunk/ttk-gsoc/src: 2.x/ttk.py 3.x/ttk.py Message-ID: <20090128124356.B98A31E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 13:43:56 2009 New Revision: 69048 Log: Simpler zipping. Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py Wed Jan 28 13:43:56 2009 @@ -12,7 +12,7 @@ of the widgets appearance lies at Themes. """ -__version__ = "0.3" +__version__ = "0.3.1" __author__ = "Guilherme Polo " @@ -266,7 +266,8 @@ opt_start = 1 if cut_minus else 0 retdict = {} - for opt, val in zip(iter(ttuple[::2]), iter(ttuple[1::2])): + it = iter(ttuple) + for opt, val in zip(it, it): retdict[str(opt)[opt_start:]] = val return tclobjs_to_py(retdict) @@ -285,7 +286,8 @@ val = val.split() nval.append(val) - return [_flatten(spec) for spec in zip(iter(nval[::2]), iter(nval[1::2]))] + it = iter(nval) + return [_flatten(spec) for spec in zip(it, it)] def _list_from_layouttuple(ltuple): """Construct a list from the tuple returned by ttk::layout, this is Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Wed Jan 28 13:43:56 2009 @@ -12,7 +12,7 @@ of the widgets appearance lies at Themes. """ -__version__ = "0.3" +__version__ = "0.3.1" __author__ = "Guilherme Polo " @@ -266,7 +266,8 @@ opt_start = 1 if cut_minus else 0 retdict = {} - for opt, val in zip(iter(ttuple[::2]), iter(ttuple[1::2])): + it = iter(ttuple) + for opt, val in zip(it, it): retdict[str(opt)[opt_start:]] = val return tclobjs_to_py(retdict) @@ -285,7 +286,8 @@ val = val.split() nval.append(val) - return [_flatten(spec) for spec in zip(iter(nval[::2]), iter(nval[1::2]))] + it = iter(nval) + return [_flatten(spec) for spec in zip(it, it)] def _list_from_layouttuple(ltuple): """Construct a list from the tuple returned by ttk::layout, this is From python-checkins at python.org Wed Jan 28 14:08:21 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 14:08:21 +0100 (CET) Subject: [Python-checkins] r69049 - in sandbox/trunk/ttk-gsoc/src: 2.x/test/test_functions.py 2.x/test/test_widgets.py 2.x/ttk.py 3.x/test/test_functions.py 3.x/test/test_widgets.py 3.x/ttk.py Message-ID: <20090128130821.BDB641E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 14:08:21 2009 New Revision: 69049 Log: Normalizing whitespace. Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py sandbox/trunk/ttk-gsoc/src/2.x/ttk.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_functions.py Wed Jan 28 14:08:21 2009 @@ -131,7 +131,7 @@ # image type expects at least an image name, so this should raise # IndexError since it tries to access the index 0 of an empty tuple self.failUnlessRaises(IndexError, ttk._format_elemcreate, 'image') - + # don't format returned values as a tcl script # minimum acceptable for image type self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test'), Modified: sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/test/test_widgets.py Wed Jan 28 14:08:21 2009 @@ -284,7 +284,7 @@ self.entry.delete(0, 'end') self.failUnlessEqual(self.entry.get(), '') - + self.entry.insert('end', 'a1b') self.failUnlessEqual(self.entry.validate(), False) self.failUnlessEqual(self.entry.state(), ('invalid', )) Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py Wed Jan 28 14:08:21 2009 @@ -59,7 +59,7 @@ def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. - + E.g. (script=False): {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns: ('-foreground', 'blue', '-padding', '1 2 3 4')""" @@ -93,7 +93,7 @@ def _format_mapdict(mapdict, script=False): """Formats mapdict to pass it to tk.call. - + E.g. (script=False): {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} @@ -1203,7 +1203,7 @@ def get_children(self, item=None): """Returns a tuple of children belonging to item. - + If item is not specified, returns root children.""" return self.tk.call(self._w, "children", item or '') or () @@ -1486,7 +1486,7 @@ class LabeledScale(Frame, object): """A Ttk Scale widget with a Ttk Label widget indicating its current value. - + The Ttk Scale can be accessed through instance.scale, and Ttk Label can be accessed through instance.label""" Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_functions.py Wed Jan 28 14:08:21 2009 @@ -130,7 +130,7 @@ # image type expects at least an image name, so this should raise # IndexError since it tries to access the index 0 of an empty tuple self.failUnlessRaises(IndexError, ttk._format_elemcreate, 'image') - + # don't format returned values as a tcl script # minimum acceptable for image type self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test'), Modified: sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/test/test_widgets.py Wed Jan 28 14:08:21 2009 @@ -284,7 +284,7 @@ self.entry.delete(0, 'end') self.failUnlessEqual(self.entry.get(), '') - + self.entry.insert('end', 'a1b') self.failUnlessEqual(self.entry.validate(), False) self.failUnlessEqual(self.entry.state(), ('invalid', )) Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py ============================================================================== --- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py (original) +++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Wed Jan 28 14:08:21 2009 @@ -59,7 +59,7 @@ def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. - + E.g. (script=False): {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns: ('-foreground', 'blue', '-padding', '1 2 3 4')""" @@ -93,7 +93,7 @@ def _format_mapdict(mapdict, script=False): """Formats mapdict to pass it to tk.call. - + E.g. (script=False): {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} @@ -1203,7 +1203,7 @@ def get_children(self, item=None): """Returns a tuple of children belonging to item. - + If item is not specified, returns root children.""" return self.tk.call(self._w, "children", item or '') or () @@ -1486,7 +1486,7 @@ class LabeledScale(Frame): """A Ttk Scale widget with a Ttk Label widget indicating its current value. - + The Ttk Scale can be accessed through instance.scale, and Ttk Label can be accessed through instance.label""" From python-checkins at python.org Wed Jan 28 14:09:04 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 14:09:04 +0100 (CET) Subject: [Python-checkins] r69050 - in python/trunk: Doc/library/tk.rst Doc/library/ttk.rst Lib/lib-tk/test Lib/lib-tk/test/README Lib/lib-tk/test/runtktests.py Lib/lib-tk/test/test_ttk Lib/lib-tk/test/test_ttk/__init__.py Lib/lib-tk/test/test_ttk/support.py Lib/lib-tk/test/test_ttk/test_extensions.py Lib/lib-tk/test/test_ttk/test_functions.py Lib/lib-tk/test/test_ttk/test_style.py Lib/lib-tk/test/test_ttk/test_widgets.py Lib/lib-tk/ttk.py Lib/test/test_tk_guionly.py Lib/test/test_tk_textonly.py Misc/NEWS Message-ID: <20090128130904.371331E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 14:09:03 2009 New Revision: 69050 Log: Added the ttk module. See issue #2983: Ttk support for Tkinter. Added: python/trunk/Doc/library/ttk.rst (contents, props changed) python/trunk/Lib/lib-tk/test/ python/trunk/Lib/lib-tk/test/README python/trunk/Lib/lib-tk/test/runtktests.py (contents, props changed) python/trunk/Lib/lib-tk/test/test_ttk/ (props changed) python/trunk/Lib/lib-tk/test/test_ttk/__init__.py (contents, props changed) python/trunk/Lib/lib-tk/test/test_ttk/support.py (contents, props changed) python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py (contents, props changed) python/trunk/Lib/lib-tk/test/test_ttk/test_functions.py (contents, props changed) python/trunk/Lib/lib-tk/test/test_ttk/test_style.py (contents, props changed) python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py (contents, props changed) python/trunk/Lib/lib-tk/ttk.py (contents, props changed) python/trunk/Lib/test/test_tk_guionly.py (contents, props changed) python/trunk/Lib/test/test_tk_textonly.py (contents, props changed) Modified: python/trunk/Doc/library/tk.rst python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/tk.rst ============================================================================== --- python/trunk/Doc/library/tk.rst (original) +++ python/trunk/Doc/library/tk.rst Wed Jan 28 14:09:03 2009 @@ -12,7 +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` module, and its extension, the :mod:`Tix` module. +using the :mod:`Tkinter` module, and its extensions, the :mod:`Tix` and +the :mod:`ttk` modules. The :mod:`Tkinter` module 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 @@ -32,6 +33,7 @@ .. toctree:: tkinter.rst + ttk.rst tix.rst scrolledtext.rst turtle.rst Added: python/trunk/Doc/library/ttk.rst ============================================================================== --- (empty file) +++ python/trunk/Doc/library/ttk.rst Wed Jan 28 14:09:03 2009 @@ -0,0 +1,1399 @@ +:mod:`ttk` --- Tk themed widgets +================================ + +.. module:: ttk + :synopsis: Tk themed widget set +.. sectionauthor:: Guilherme Polo + + +.. index:: single: ttk + +The :mod:`ttk` module provides access to the Tk themed widget set, which +has been introduced in Tk 8.5. If you do not have Python compiled against +Tk 8.5 you may still use this module as long as you have Tile installed, but +then you will miss some features provided by the new Tk, like anti-aliased font +rendering under X11, window transparency (on X11 you will need a composition +window manager) and others. + +The basic idea of :mod:`ttk` is to separate, to the extent possible, the code +implementing a widget's behavior from the code implementing its appearance. + + +.. seealso:: + + `Tk Widget Styling Support `_ + The document which brought up theming support for Tk + + +Using Ttk +--------- + +Basically, to start using Ttk, you have to import its module:: + + import ttk + +But if you already have some code that does:: + + from Tkinter import * + +You may optionally want to use:: + + from Tkinter import * + from ttk import * + +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. + +This has the direct benefit of using the new widgets which gives 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 +longer present in Ttk widgets, instead you will have to use :class:`ttk.Style` +to achieve the same (or better) styling. + +.. seealso:: + + `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. + + +Ttk Widgets +----------- + +Ttk comes with 17 widgets, where 11 of these already existed 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 +subclasses of :class:`Widget`. + +Like it was told before, you will notice changes in look & feel as well in the +styling code. To demonstrate the latter, a very simple example is shown below. + +Tk code:: + + l1 = Tkinter.Label(text="Test", fg="black", bg="white") + l2 = Tkinter.Label(text="Test", fg="black", bg="white") + + +Ttk code:: + + style = ttk.Style() + style.configure("BW.TLabel", foreground="black", background="white") + + l1 = ttk.Label(text="Test", style="BW.TLabel") + l2 = ttk.Label(text="Test", style="BW.TLabel") + +For more information about TtkStyling_ read the :class:`Style` class +documentation. + +Widget +------ + +:class:`ttk.Widget` defines standard options and methods supported by Tk +themed widgets and is not supposed to be directly instantiated. + + +Standard Options +^^^^^^^^^^^^^^^^ + +All the :mod:`ttk` Widgets accepts the following options: + + +-----------+--------------------------------------------------------------+ + | Option | Description | + +===========+==============================================================+ + | class | Specifies the window class. The class is used when querying | + | | 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 | + +-----------+--------------------------------------------------------------+ + | 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. | + +-----------+--------------------------------------------------------------+ + | 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 | + | | decision about whether or not to focus on the window. | + +-----------+--------------------------------------------------------------+ + | style | May be used to specify a custom widget style. | + +-----------+--------------------------------------------------------------+ + + +Scrollable Widget Options +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The following options are supported by widgets that are controlled by a +scrollbar. + + +----------------+---------------------------------------------------------+ + | option | description | + +================+=========================================================+ + | xscrollcommand | Used to comunicate with horizontal scrollbars. | + | | | + | | When the view in the widget's window change, 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| + | | 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. | + +----------------+---------------------------------------------------------+ + + +Label Options +^^^^^^^^^^^^^ + +The following options are supported by labels, buttons and other button-like +widgets. + + +--------------+-----------------------------------------------------------+ + | option | description | + +==============+===========================================================+ + | text | Specifies a text string to be displayed inside the widget.| + +--------------+-----------------------------------------------------------+ + | textvariable | Specifies a name whose value will be used in place of the | + | | text option resource. | + +--------------+-----------------------------------------------------------+ + | underline | If set, specifies the index (0-based) of a character to | + | | underline in the text string. The underline character is | + | | used for mnemonic activation. | + +--------------+-----------------------------------------------------------+ + | 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| + | | 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. | + | | Valid values are: | + | | | + | | * text: display text only | + | | * image: display image only | + | | * top, bottom, left, right: display image above, below, | + | | left of, or right of the text, respectively. | + | | * none: the default. display the image if present, | + | | otherwise the text. | + +--------------+-----------------------------------------------------------+ + | width | If greater than zero, specifies how much space, in | + | | 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. | + +--------------+-----------------------------------------------------------+ + + +Compatibility Options +^^^^^^^^^^^^^^^^^^^^^ + + +--------+----------------------------------------------------------------+ + | option | description | + +========+================================================================+ + | state | May be set to "normal" or "disabled" to control the "disabled" | + | | state bit. This is a write-only option: setting it changes the | + | | widget state, but the :meth:`Widget.state` method does not | + | | affect this option. | + +--------+----------------------------------------------------------------+ + +Widget States +^^^^^^^^^^^^^ + +The widget state is a bitmap of independent state flags. + + +------------+-------------------------------------------------------------+ + | flag | description | + +============+=============================================================+ + | active | The mouse cursor is over the widget and pressing a mouse | + | | button will cause some action to occur | + +------------+-------------------------------------------------------------+ + | disabled | Widget is disabled under program control | + +------------+-------------------------------------------------------------+ + | focus | Widget has keyboard focus | + +------------+-------------------------------------------------------------+ + | pressed | Widget is being pressed | + +------------+-------------------------------------------------------------+ + | selected | "On", "true", or "current" for things like Checkbuttons and | + | | 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 | + +------------+-------------------------------------------------------------+ + | readonly | Widget should not allow user modification | + +------------+-------------------------------------------------------------+ + | alternate | A widget-specific alternate display format | + +------------+-------------------------------------------------------------+ + | invalid | The widget's value is invalid | + +------------+-------------------------------------------------------------+ + +A state specification is a sequence of state names, optionally prefixed with +an exclamation point indicating that the bit is off. + + +ttk.Widget +^^^^^^^^^^ + +Besides the methods described below, the class :class:`ttk.Widget` supports the +methods :meth:`Tkinter.Widget.cget` and :meth:`Tkinter.Widget.configure`. + +.. class:: Widget + + .. method:: identify(x, y) + + Returns the name of the element at position *x* *y*, or the empty string + if the point does not lie within any element. + + *x* and *y* are pixel coordinates relative to the widget. + + + .. method:: instate(statespec[, callback=None[, *args[, **kw]]]) + + 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 + *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 + which flags were changed. If *statespec* is not specified, returns + the currently-enabled state flags. + + *statespec* will usually be a list or a tuple. + + +Combobox +-------- + +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`, +: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`, +:meth:`Entry.index`, :meth:`Entry.inset`, :meth:`Entry.selection`, +:meth:`Entry.xview`, it has some other methods, described at +:class:`ttk.Combobox`. + + +Options +^^^^^^^ + +This widget accepts the following specific options: + + +-----------------+--------------------------------------------------------+ + | 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). | + +-----------------+--------------------------------------------------------+ + | 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 | + | | 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 | + | | dropdown list. In the "normal" state, the text field is| + | | directly editable. In the "disabled" state, no | + | | interaction is possible. | + +-----------------+--------------------------------------------------------+ + | textvariable | Specifies a name whose value is linked to the widget | + | | value. Whenever the value associated with that name | + | | changes, the widget value is updated, and vice versa. | + | | See :class:`Tkinter.StringVar`. | + +-----------------+--------------------------------------------------------+ + | values | Specifies the list of values to display in the | + | | drop-down listbox. | + +-----------------+--------------------------------------------------------+ + | width | Specifies an integer value indicating the desired width| + | | of the entry window, in average-size characters of the | + | | widget's font. | + +-----------------+--------------------------------------------------------+ + + +Virtual events +^^^^^^^^^^^^^^ + +The combobox widgets generates a **<>** virtual event +when the user selects an element from the list of values. + + +ttk.Combobox +^^^^^^^^^^^^ + +.. class:: Combobox + + .. method:: current([newindex=None]) + + If *newindex* is specified, sets the combobox value to the element + position *newindex*. Otherwise, returns the index of the current value or + -1 if the current value is not in the values list. + + + .. method:: get() + + Returns the current value of the combobox. + + + .. method:: set(value) + + Sets the value of the combobox to *value*. + + +Notebook +-------- + +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. + + +Options +^^^^^^^ + +This widget accepts the following specific options: + + +---------+----------------------------------------------------------------+ + | option | description | + +=========+================================================================+ + | height | If present and greater than zero, specifies the desired height | + | | of the pane area (not including internal padding or tabs). | + | | 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 | + | | 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 | + | | of the pane area (not including internal padding). Otherwise, | + | | the maximum width of all panes is used. | + +---------+----------------------------------------------------------------+ + + +Tab Options +^^^^^^^^^^^ + +There are also specific options for tabs: + + +-----------+--------------------------------------------------------------+ + | option | description | + +===========+==============================================================+ + | state | Either "normal", "disabled" or "hidden". If "disabled", then | + | | the tab is not selectable. If "hidden", then the tab is not | + | | shown. | + +-----------+--------------------------------------------------------------+ + | sticky | Specifies how the child window is positioned within the pane | + | | area. Value is a string containing zero or more of the | + | | characters "n", "s", "e" or "w". Each letter refers to a | + | | side (north, south, east or west) that the child window will | + | | stick to, as per the :meth:`grid` geometry manager. | + +-----------+--------------------------------------------------------------+ + | padding | Specifies the amount of extra space to add between the | + | | notebook and this pane. Syntax is the same as for the option | + | | padding used by this widget. | + +-----------+--------------------------------------------------------------+ + | text | Specifies a text to be displayed in the tab. | + +-----------+--------------------------------------------------------------+ + | image | Specifies an image to display in the tab. See the option | + | | 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 | + | | `Label Options`_ for legal values. | + +-----------+--------------------------------------------------------------+ + | underline | Specifies the index (0-based) of a character to underline in | + | | the text string. The underlined character is used for | + | | mnemonic activation if :meth:`Notebook.enable_traversal` is | + | | called. | + +-----------+--------------------------------------------------------------+ + + +Tab Identifiers +^^^^^^^^^^^^^^^ + +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 +* The literal string "end", which returns the number of tabs (only valid for + :meth:`Notebook.index`) + + +Virtual Events +^^^^^^^^^^^^^^ + +This widget generates a **<>** virtual event after a new +tab is selected. + + +ttk.Notebook +^^^^^^^^^^^^ + +.. class:: Notebook + + .. method:: add(child, **kw) + + Adds a new tab to the notebook. + + If window is currently managed by the notebook but hidden, it is + restored to its previous position. + + See `Tab Options`_ for the list of available options. + + + .. method:: forget(tab_id) + + Removes the tab specified by *tab_id*, unmaps and unmanages the + associated window. + + + .. method:: hide(tab_id) + + Hides the tab specified by *tab_id*. + + The tab will not be displayed, but the associated window remains + managed by the notebook and its configuration remembered. Hidden tabs + may be restored with the add command. + + + .. method:: identify(x, y) + + Returns the name of the tab element at position *x*, *y*, or the empty + string if none. + + + .. method:: index(tab_id) + + Returns the numeric index of the tab specified by *tab_id*, or the total + number of tabs if *tab_id* is the string "end". + + + .. method:: insert(pos, child, **kw) + + Inserts a pane at the specified position. + + *pos* is either the string end, an integer index, or the name of a + managed child. If *child* is already managed by the notebook, moves it to + the specified position. + + See `Tab Options`_ for the list of available options. + + + .. method:: select([tab_id]) + + Selects the specified *tab_id*. + + The associated child window will be displayed, and the + previously-selected window (if different) is unmapped. If *tab_id* is + omitted, returns the widget name of the currently selected pane. + + + .. method:: tab(tab_id[, option=None[, **kw]]) + + Query or modify the options of the specific *tab_id*. + + If *kw* is not given, returns a dict of the tab option values. If + *option* is specified, returns the value of that *option*. Otherwise, + sets the options to the corresponding values. + + + .. method:: tabs() + + Returns a list of windows managed by the notebook. + + + .. method:: enable_traversal() + + Enable keyboard traversal for a toplevel window containing this notebook. + + This will extend the bindings for the toplevel window containing the + notebook as follows: + + * Control-Tab: selects the tab following the currently selected one + * Shift-Control-Tab: selects the tab preceding the currently selected one + * Alt-K: where K is the mnemonic (underlined) character of any tab, will + select that tab. + + Multiple notebooks in a single toplevel may be enabled for traversal, + including nested notebooks. However, notebook traversal only works + properly if all panes have as master the notebook they are in. + + +Progressbar +----------- + +The :class:`ttk.Progressbar` widget shows the status of a long-running +operation. It can operate in two modes: determinate mode shows the amount +completed relative to the total amount of work to be done, and indeterminate +mode provides an animated display to let the user know that something is +happening. + + +Options +^^^^^^^ + +This widget accepts the following specific options: + + +----------+---------------------------------------------------------------+ + | option | description | + +==========+===============================================================+ + | orient | One of "horizontal" or "vertical". Specifies the orientation | + | | of the progress bar. | + +----------+---------------------------------------------------------------+ + | length | Specifies the length of the long axis of the progress bar | + | | (width if horizontal, height if vertical). | + +----------+---------------------------------------------------------------+ + | mode | One of "determinate" or "indeterminate". | + +----------+---------------------------------------------------------------+ + | maximum | A number specifying the maximum value. Defaults to 100. | + +----------+---------------------------------------------------------------+ + | value | The current value of the progress bar. In "determinate" mode, | + | | this represents the amount of work completed. In | + | | "indeterminate" mode, it is interpreted as modulo maximum; | + | | that is, the progress bar completes one "cycle" when its value| + | | increases by maximum. | + +----------+---------------------------------------------------------------+ + | variable | A name which is linked to the option value. If specified, the | + | | value of the progressbar is automatically set to the value of | + | | this name whenever the latter is modified. | + +----------+---------------------------------------------------------------+ + | phase | Read-only option. The widget periodically increments the value| + | | of this option whenever its value is greater than 0 and, in | + | | determinate mode, less than maximum. This option may be used | + | | by the current theme to provide additional animation effects. | + +----------+---------------------------------------------------------------+ + + +ttk.Progressbar +^^^^^^^^^^^^^^^ + +.. class:: Progressbar + + .. method:: start([interval]) + + Begin autoincrement mode: schedules a recurring timer even that calls + :meth:`Progressbar.step` every *interval* milliseconds. If omitted, + *interval* defaults to 50 milliseconds. + + + .. method:: step([amount]) + + Increments progressbar's value by *amount*. + + *amount* defaults to 1.0 if omitted. + + + .. method:: stop() + + Stop autoincrement mode: cancels any recurring timer event initiated by + :meth:`Progressbar.start` for this progressbar. + + +Separator +--------- + +The :class:`ttk.Separator` widget displays a horizontal or vertical separator +bar. + +It has no other method besides the ones inherited from :class:`ttk.Widget`. + + +Options +^^^^^^^ + +This widget accepts the following specific option: + + +--------+----------------------------------------------------------------+ + | option | description | + +========+================================================================+ + | orient | One of "horizontal" or "vertical". Specifies the orientation of| + | | the separator. | + +--------+----------------------------------------------------------------+ + + +Sizegrip +-------- + +The :class:`ttk.Sizegrip` widget (also known as grow box) allows the user to +resize the containing toplevel window by pressing and dragging the grip. + +This widget has no specific options neither specific methods, besides the +ones inherited from :class:`ttk.Widget`. + + +Platform-specific notes +^^^^^^^^^^^^^^^^^^^^^^^ + +* On Mac OSX, toplevel windows automatically include a built-in size grip + by default. Adding a Sizegrip there is harmless, since the built-in + grip will just mask the widget. + + +Bugs +^^^^ + +* If the containing toplevel's position was specified relative to the right + or bottom of the screen (e.g. ....), the Sizegrip widget will not resize + the window. +* This widget supports only "southeast" resizing. + + +Treeview +-------- + +The :class:`ttk.Treeview` widget displays a hierarchical collection of items. +Each item has a textual label, an optional image, and an optional list of data +values. The data values are displayed in successive columns after the tree +label. + +The order in which data values are displayed may be controlled by setting +the widget option displaycolumns. The tree widget can also display column +headings. Columns may be accessed by number or symbolic names listed in the +widget option columns. See `Column Identifiers`_. + +Each item is identified by an unique name. The widget will generate item IDs +if they are not supplied by the caller. There is a distinguished root item, +named {}. The root item itself is not displayed; its children appear at the +top level of the hierarchy. + +Each item also has a list of tags, which can be used to associate even bindings +with individual items and control the appearance of the item. + +The Treeview widget supports horizontal and vertical scrolling, according to +the options described in `Scrollable Widget Options`_ and the methods +:meth:`Treeview.xview` and :meth:`Treeview.yview`. + + +Options +^^^^^^^ + +This widget accepts the following specific option: + + +----------------+--------------------------------------------------------+ + | option | description | + +================+========================================================+ + | columns | A list of column identifiers, specifying the number of | + | | columns and their names. | + +----------------+--------------------------------------------------------+ + | displaycolumns | A list of column identifiers (either symbolic or | + | | integer indices) specifying which data columns are | + | | displayed and the order in which they appear, or the | + | | string "#all". | + +----------------+--------------------------------------------------------+ + | height | Specifies the number of rows which should be visible. | + | | Note: the requested width is determined from the sum | + | | of the column widths. | + +----------------+--------------------------------------------------------+ + | padding | Specifies the internal padding for the widget. The | + | | padding is a list of up to four length specifications. | + +----------------+--------------------------------------------------------+ + | selectmode | Controls how the built-in class bindings manage the | + | | selection. One of "extended", "browse" or "none". | + | | If set to "extended" (the default), multiple items may | + | | be selected. If "browse", only a single item will be | + | | selected at a time. If "none", the selection will not | + | | be changed. | + | | | + | | Note that the application code and tag bindings can set| + | | the selection however they wish, regardless the value | + | | of this option. | + +----------------+--------------------------------------------------------+ + | show | A list containing zero or more of the following values,| + | | specifying which elements of the tree to display. | + | | | + | | * tree: display tree labels in column #0. | + | | * headings: display the heading row. | + | | | + | | The default is "tree headings", i.e., show all | + | | elements. | + | | | + | | **Note**: Column #0 always refer to the tree column, | + | | even if show="tree" is not specified. | + +----------------+--------------------------------------------------------+ + + +Item Options +^^^^^^^^^^^^ + +The following item options may be specified for items in the insert and item +widget commands. + + +--------+---------------------------------------------------------------+ + | option | description | + +========+===============================================================+ + | text | The textual label to display for the item. | + +--------+---------------------------------------------------------------+ + | image | A Tk Image, displayed to the left of the label. | + +--------+---------------------------------------------------------------+ + | values | The list of values associated with the item. | + | | | + | | Each item should have the same number of values as the widget | + | | option columns. If there are fewer values than columns, the | + | | remaining values are assumed empty. If there are more values | + | | than columns, the extra values are ignored. | + +--------+---------------------------------------------------------------+ + | open | True/False value indicating whether the item's children should| + | | be displayed or hidden. | + +--------+---------------------------------------------------------------+ + | tags | A list of tags associated with this item. | + +--------+---------------------------------------------------------------+ + + +Tag Options +^^^^^^^^^^^ + +The following options may be specified on tags: + + +------------+-----------------------------------------------------------+ + | option | description | + +============+===========================================================+ + | foreground | Specifies the text foreground color. | + +------------+-----------------------------------------------------------+ + | background | Specifies the cell or item background color. | + +------------+-----------------------------------------------------------+ + | font | Specifies the font to use when drawing text. | + +------------+-----------------------------------------------------------+ + | image | Specifies the item image, in case the item's image option | + | | is empty. | + +------------+-----------------------------------------------------------+ + + +Column Identifiers +^^^^^^^^^^^^^^^^^^ + +Column identifiers take any of the following forms: + +* A symbolic name from the list of columns option. +* An integer n, specifying the nth data column. +* A string of the form #n, where n is an integer, specifying the nth display + column. + +Notes: + +* Item's option values may be displayed in a different order than the order + in which they are stored. +* Column #0 always refers to the tree column, even if show="tree" is not + specified. + +A data column number is an index into an item's option values list; a display +column number is the column number in the tree where the values are displayed. +Tree labels are displayed in column #0. If option displaycolumns is not set, +then data column n is displayed in column #n+1. Again, **column #0 always +refers to the tree column**. + + +Virtual Events +^^^^^^^^^^^^^^ + +The Treeview widget generates the following virtual events. + + +--------------------+--------------------------------------------------+ + | event | description | + +====================+==================================================+ + | <> | Generated whenever the selection changes. | + +--------------------+--------------------------------------------------+ + | <> | Generated just before settings the focus item to | + | | open=True. | + +--------------------+--------------------------------------------------+ + | <> | Generated just after setting the focus item to | + | | open=False. | + +--------------------+--------------------------------------------------+ + +The :meth:`Treeview.focus` and :meth:`Treeview.selection` methods can be used +to determine the affected item or items. + + +ttk.Treeview +^^^^^^^^^^^^ + +.. class:: Treeview + + .. method:: bbox(item[, column=None]) + + Returns the bounding box (relative to the treeview widget's window) of + the specified *item* in the form (x, y, width, height). + + If *column* is specified, returns the bounding box of that cell. If the + *item* is not visible (i.e., if it is a descendant of a closed item or is + scrolled offscreen), returns an empty string. + + + .. method:: get_children([item]) + + Returns the list of children belonging to *item*. + + If *item* is not specified, returns root children. + + + .. method:: set_children(item, *newchildren) + + Replaces item's child with *newchildren*. + + Children present in item that are not present in *newchildren* are + detached from tree. No items in *newchildren* may be an ancestor of + item. Note that not specifying *newchildren* results in detaching + *item*'s children. + + + .. method:: column(column[, option=None[, **kw]]) + + Query or modify the options for the specified *column*. + + If *kw* is not given, returns a dict of the column option values. If + *option* is specified then the value for that *option* is returned. + Otherwise, sets the options to the corresponding values. + + The valid options/values are: + + * id + Returns the column name, this is a read-only option. + * anchor: One of the standard Tk anchor values. + Specifies how the text in this column should be aligned with respect + to the cell. + * minwidth: width + The minimum width of the column in pixels. The treeview widget will + not make the column any smaller than the specified by this option when + the widget is resized or the user drags a column. + * stretch: True/False + Specifies wheter or not the column's width should be adjusted when + the widget is resized. + * width: width + The width of the column in pixels. + + To configure the tree column, call this with column = "#0" + + .. method:: delete(*items) + + Delete all specified *items* and all their descendants. + + The root item may not be deleted. + + + .. method:: detach(*items) + + Unlinks all of the specified *items* from the tree. + + The items and all of their descendants are still present, and may be + reinserted at another point in the tree, but will not be displayed. + + The root item may not be detached. + + + .. method:: exists(item) + + Returns True if the specified *item* is present in the three, + False otherwise. + + + .. method:: focus([item=None]) + + If *item* is specified, sets the focus item to *item*. Otherwise, returns + the current focus item, or '' if there is none. + + + .. method:: heading(column[, option=None[, **kw]]) + + Query or modify the heading options for the specified *column*. + + If *kw* is not given, returns a dict of the heading option values. If + *option* is specified then the value for that *option* is returned. + Otherwise, sets the options to the corresponding values. + + The valid options/values are: + + * text: text + The text to display in the column heading. + * image: imageName + Specifies an image to display to the right of the column heading. + * anchor: anchor + Specifies how the heading text should be aligned. One of the standard + Tk anchor values. + * command: callback + A callback to be invoked when the heading label is pressed. + + To configure the tree column heading, call this with column = "#0" + + + .. method:: identify(component, x, y) + + Returns a description of the specified *component* under the point given + by *x* and *y*, or the empty string if no such *component* is present at + that position. + + + .. method:: identify_row(y) + + Returns the item ID of the item at position *y*. + + + .. method:: identify_column(x) + + Returns the data column identifier of the cell at position *x*. + + The tree column has ID #0. + + + .. method:: identify_region(x, y) + + Returns one of: + + +-----------+--------------------------------------+ + | region | meaning | + +===========+======================================+ + | heading | Tree heading area. | + +-----------+--------------------------------------+ + | separator | Space between two columns headings. | + +-----------+--------------------------------------+ + | tree | The tree area. | + +-----------+--------------------------------------+ + | cell | A data cell. | + +-----------+--------------------------------------+ + + Availability: Tk 8.6. + + + .. method:: identify_element(x, y) + + Returns the element at position x, y. + + Availability: Tk 8.6. + + + .. method:: index(item) + + Returns the integer index of *item* within its parent's list of children. + + + .. method:: insert(parent, index[, iid=None[, **kw]]) + + Creates a new item and return the item identifier of the newly created + item. + + *parent* is the item ID of the parent item, or the empty string to create + a new top-level item. *index* is an integer, or the value "end", + specifying where in the list of parent's children to insert the new item. + If *index* is less than or equal to zero, the new node is inserted at + the beginning, if *index* is greater than or equal to the current number + of children, it is inserted at the end. If *iid* is specified, it is used + as the item identifier, *iid* must not already exist in the tree. + Otherwise, a new unique identifier is generated. + + See `Item Options`_ for the list of available points. + + + .. method:: item(item[, option[, **kw]]) + + Query or modify the options for the specified *item*. + + If no options are given, a dict with options/values for the item is + returned. + If *option* is specified then the value for that option is returned. + Otherwise, sets the options to the corresponding values as given by *kw*. + + + .. method:: move(item, parent, index) + + Moves *item* to position *index* in *parent*'s list of children. + + It is illegal to move an item under one of its descendants. If index is + less than or equal to zero, item is moved to the beginning, if greater + than or equal to the number of children, it is moved to the end. If item + was detached it is reattached. + + + .. method:: next(item) + + Returns the identifier of *item*'s next sibling, or '' if *item* is the + last child of its parent. + + + .. method:: parent(item) + + Returns the ID of the parent of *item*, or '' if *item* is at the top + level of the hierarchy. + + + .. method:: prev(item) + + Returns the identifier of *item*'s previous sibling, or '' if *item* is + the first child of its parent. + + + .. method:: reattach(item, parent, index) + + An alias for :meth:`Treeview.move`. + + + .. method:: see(item) + + Ensure that *item* is visible. + + Sets all of *item*'s ancestors open option to True, and scrolls the + widget if necessary so that *item* is within the visible portion of + the tree. + + + .. method:: selection([selop=None[, items=None]]) + + If *selop* is not specified, returns selected items. Otherwise, it will + act according to the following selection methods. + + + .. method:: selection_set(items) + + *items* becomes the new selection. + + + .. method:: selection_add(items) + + Add *items* to the selection. + + + .. method:: selection_remove(items) + + Remove *items* from the selection. + + + .. method:: selection_toggle(items) + + Toggle the selection state of each item in *items*. + + + .. method:: set(item[, column=None[, value=None]]) + + With one argument, returns a dictionary of column/value pairs for the + specified *item*. With two arguments, returns the current value of the + specified *column*. With three arguments, sets the value of given + *column* in given *item* to the specified *value*. + + + .. method:: tag_bind(tagname[, sequence=None[, callback=None]]) + + Bind a callback for the given event *sequence* to the tag *tagname*. + When an event is delivered to an item, the *callbacks* for each of the + item's tags option are called. + + + .. method:: tag_configure(tagname[, option=None[, **kw]]) + + Query or modify the options for the specified *tagname*. + + If *kw* is not given, returns a dict of the option settings for + *tagname*. If *option* is specified, returns the value for that *option* + for the specified *tagname*. Otherwise, sets the options to the + corresponding values for the given *tagname*. + + + .. method:: tag_has(tagname[, item]) + + If *item* is specified, returns 1 or 0 depending on whether the specified + *item* has the given *tagname*. Otherwise, returns a list of all items + which have the specified tag. + + Availability: Tk 8.6 + + + .. method:: xview(*args) + + Query or modify horizontal position of the treeview. + + + .. method:: yview(*args) + + Query or modify vertical position of the treeview. + + +.. _TtkStyling: + +Ttk Styling +----------- + +Each widget in :mod:`ttk` is assigned a style, which specifies the set of +elements making up the widget and how they are arranged, along with dynamic +and default settings for element options. By default the style name is the +same as the widget's class name, but it may be overriden by the widget's style +option. If you don't know the class name of a widget, use the method +:meth:`Misc.winfo_class` (somewidget.winfo_class()). + +.. seealso:: + + `Tcl'2004 conference presentation `_ + This document explains how the theme engine works + + +.. class:: Style + + This class is used to manipulate the style database. + + + .. method:: configure(style, query_opt=None, **kw) + + Query or sets the default value of the specified option(s) in *style*. + + Each key in *kw* is an option and each value is a string identifying + the value for that option. + + For example, to change every default button to be a flat button with + some padding and a different background color you could do:: + + import ttk + import Tkinter + + root = Tkinter.Tk() + + ttk.Style().configure("TButton", padding=6, relief="flat", + background="#ccc") + + btn = ttk.Button(text="Sample") + btn.pack() + + root.mainloop() + + + .. method:: map(style, query_opt=None, **kw) + + Query or sets dynamic values of the specified option(s) in *style*. + + Each key in kw is an option and each value should be a list or a + tuple (usually) containing statespecs grouped in tuples, or list, or + something else of your preference. A statespec is compound of one or more + states and then a value. + + An example may make it more understandable:: + + import Tkinter + import ttk + + root = Tkinter.Tk() + + style = ttk.Style() + style.map("C.TButton", + foreground=[('pressed', 'red'), ('active', 'blue')], + background=[('pressed', '!disabled', 'black'), ('active', 'white')] + ) + + colored_btn = ttk.Button(text="Test", style="C.TButton").pack() + + root.mainloop() + + + There is a thing to note in this previous short example: + + * The order of the (states, value) sequences for an option does matter, + if you changed the order to [('active', 'blue'), ('pressed', 'red')] + in the foreground option, for example, you would get a blue foreground + when the widget were in active or pressed states. + + + .. method:: lookup(style, option[, state=None[, default=None]]) + + Returns the value specified for *option* in *style*. + + If *state* is specified, it is expected to be a sequence of one or more + states. If the *default* argument is set, it is used as a fallback value + in case no specification for option is found. + + To check what font a Button uses by default, you would do:: + + import ttk + + print ttk.Style().lookup("TButton", "font") + + + .. method:: layout(style[, layoutspec=None]) + + Define the widget layout for given *style*. If *layoutspec* is omitted, + return the layout specification for given style. + + *layoutspec*, if specified, is expected to be a list, or some other + sequence type (excluding string), where each item should be a tuple and + the first item is the layout name and the second item should have the + format described described in `Layouts`_. + + To understand the format, check this example below (it is not intended + to do anything useful):: + + import ttk + import Tkinter + + root = Tkinter.Tk() + + style = ttk.Style() + style.layout("TMenubutton", [ + ("Menubutton.background", None), + ("Menubutton.button", {"children": + [("Menubutton.focus", {"children": + [("Menubutton.padding", {"children": + [("Menubutton.label", {"side": "left", "expand": 1})] + })] + })] + }), + ]) + + mbtn = ttk.Menubutton(text='Text') + mbtn.pack() + root.mainloop() + + + .. method:: element_create(elementname, etype, *args, **kw) + + Create a new element in the current theme of given *etype* which is + expected to be either "image", "from" or "vsapi". The latter is only + available in Tk 8.6a for Windows XP and Vista and is not described here. + + If "image" is used, *args* should contain the default image name followed + by statespec/value pairs (this is the imagespec), *kw* may have the + following options: + + * border=padding + padding is a list of up to four integers, specifying the left, top, + right, and bottom borders, respectively. + + * height=height + Specifies a minimum height for the element. If less than zero, the + base image's height is used as a default. + + * padding=padding + Specifies the element's interior padding. Defaults to border's value + if not specified. + + * sticky=spec + Specifies how the image is placed within the final parcel. spec + contains zero or more characters ?n?, ?s?, ?w?, or ?e?. + + * width=width + Specifies a minimum width for the element. If less than zero, the + base image's width is used as a default. + + But if "from" is used, then :meth:`element_create` will clone an existing + element. *args* is expected to contain a themename, which is from where + the element will be cloned, and optionally an element to clone from. + If this element to clone from is not specified, an empty element will + be used. *kw* is discarded here. + + + .. method:: element_names() + + Returns the list of elements defined in the current theme. + + + .. method:: element_options(elementname) + + Returns the list of *elementname*'s options. + + + .. method:: theme_create(themename[, parent=None[, settings=None]]) + + Create a new theme. + + It is an error if *themename* already exists. If *parent* is specified, + the new theme will inherit styles, elements and layouts from the parent + theme. If *settings* are present they are expected to have the same + syntax used for :meth:`theme_settings`. + + + .. method:: theme_settings(themename, settings) + + Temporarily sets the current theme to *themename*, apply specified + *settings* and then restore the previous theme. + + Each key in *settings* is a style and each value may contain the keys + 'configure', 'map', 'layout' and 'element create' and they are expected + to have the same format as specified by the methods + :meth:`Style.configure`, :meth:`Style.map`, :meth:`Style.layout` and + :meth:`Style.element_create` respectively. + + As an example, lets change the Combobox for the default theme a bit:: + + import ttk + import Tkinter + + root = Tkinter.Tk() + + style = ttk.Style() + style.theme_settings("default", { + "TCombobox": { + "configure": {"padding": 5}, + "map": { + "background": [("active", "green2"), + ("!disabled", "green4")], + "fieldbackground": [("!disabled", "green3")], + "foreground": [("focus", "OliveDrab1"), + ("!disabled", "OliveDrab2")] + } + } + }) + + combo = ttk.Combobox().pack() + + root.mainloop() + + + .. method:: theme_names() + + Returns a list of all known themes. + + + .. method:: theme_use([themename]) + + If *themename* is not given, returns the theme in use, otherwise, set + the current theme to *themename*, refreshes all widgets and emits a + <> event. + + +Layouts +^^^^^^^ + +A layout can be just None, if takes no options, or a dict of options specifying +how to arrange the element. The layout mechanism uses a simplified +version of the pack geometry manager: given an initial cavity, each element is +allocated a parcel. Valid options/values are: + + * side: whichside + Specifies which side of the cavity to place the the element; one of + top, right, bottom or left. If omitted, the element occupies the + entire cavity. + + * sticky: nswe + Specifies where the element is placed inside its allocated parcel. + + * unit: 0 or 1 + If set to 1, causes the element and all of its descendants to be treated as + a single element for the purposes of :meth:`Widget.identify` et al. It's + used for things like scrollbar thumbs with grips. + + * children: [sublayout... ] + Specifies a list of elements to place inside the element. Each + element is a tuple (or other sequence type) where the first item is + the layout name, and the other is a `Layout`_. + +.. _Layout: `Layouts`_ Added: python/trunk/Lib/lib-tk/test/README ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/README Wed Jan 28 14:09:03 2009 @@ -0,0 +1,14 @@ +Writing new tests +================= + +Precaution +---------- + + New tests should always use only one Tk window at once, like all the + current tests do. This means that you have to destroy the current window + before creating another one, and clean up after the test. The motivation + behind this is that some tests may depend on having its window focused + while it is running to work properly, and it may be hard to force focus + on your window across platforms (right now only test_traversal at + test_ttk.test_widgets.NotebookTest depends on this). + Added: python/trunk/Lib/lib-tk/test/runtktests.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/runtktests.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,65 @@ +""" +Use this module to get and run all tk tests. + +Tkinter tests should live in a package inside the directory where this file +lives, like test_tkinter. +Extensions also should live in packages following the same rule as above. +""" + +import os +import sys +import unittest +import test.test_support + +this_dir_path = os.path.abspath(os.path.dirname(__file__)) + +def is_package(path): + for name in os.listdir(path): + if name in ('__init__.py', '__init__.pyc', '__init.pyo'): + return True + return False + +def get_tests_modules(basepath=this_dir_path, gui=True): + """This will import and yield modules whose names start with test_ + and are inside packages found in the path starting at basepath.""" + py_ext = '.py' + + for dirpath, dirnames, filenames in os.walk(basepath): + for dirname in list(dirnames): + if dirname[0] == '.': + dirnames.remove(dirname) + + if is_package(dirpath) and filenames: + pkg_name = dirpath[len(basepath) + len(os.sep):].replace('/', '.') + filenames = filter( + lambda x: x.startswith('test_') and x.endswith(py_ext), + filenames) + + for name in filenames: + try: + yield __import__( + "%s.%s" % (pkg_name, name[:-len(py_ext)]), + fromlist=[''] + ) + except test.test_support.ResourceDenied: + if gui: + raise + +def get_tests(text=True, gui=True): + """Yield all the tests in the modules found by get_tests_modules. + + If nogui is True, only tests that do not require a GUI will be + returned.""" + attrs = [] + if text: + attrs.append('tests_nogui') + if gui: + attrs.append('tests_gui') + for module in get_tests_modules(gui=gui): + for attr in attrs: + for test in getattr(module, attr, ()): + yield test + +if __name__ == "__main__": + test.test_support.use_resources = ['gui'] + test.test_support.run_unittest(*get_tests()) Added: python/trunk/Lib/lib-tk/test/test_ttk/__init__.py ============================================================================== Added: python/trunk/Lib/lib-tk/test/test_ttk/support.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/test_ttk/support.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,25 @@ +import Tkinter + +def get_tk_root(): + try: + root = Tkinter._default_root + except AttributeError: + # it is possible to disable default root in Tkinter, although + # I haven't seen people doing it (but apparently someone did it + # here). + root = None + + if root is None: + # create a new master only if there isn't one already + root = Tkinter.Tk() + + return root + + +def simulate_mouse_click(widget, x, y): + """Generate proper events to click at the x, y position (tries to act + like an X server).""" + widget.event_generate('', x=0, y=0) + widget.event_generate('', x=x, y=y) + widget.event_generate('', x=x, y=y) + widget.event_generate('', x=x, y=y) Added: python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,266 @@ +import sys +import unittest +import Tkinter +import ttk +from test.test_support import requires, run_unittest + +import support + +requires('gui') + +class LabeledScaleTest(unittest.TestCase): + + def test_widget_destroy(self): + # automatically created variable + x = ttk.LabeledScale() + var = x._variable._name + x.destroy() + self.failUnlessRaises(Tkinter.TclError, x.tk.globalgetvar, var) + + # manually created variable + myvar = Tkinter.DoubleVar() + name = myvar._name + x = ttk.LabeledScale(variable=myvar) + x.destroy() + self.failUnlessEqual(x.tk.globalgetvar(name), myvar.get()) + del myvar + self.failUnlessRaises(Tkinter.TclError, x.tk.globalgetvar, name) + + # checking that the tracing callback is properly removed + myvar = Tkinter.IntVar() + # LabeledScale will start tracing myvar + x = ttk.LabeledScale(variable=myvar) + x.destroy() + # Unless the tracing callback was removed, creating a new + # LabeledScale with the same var will cause an error now. This + # happens because the variable will be set to (possibly) a new + # value which causes the tracing callback to be called and then + # it tries calling instance attributes not yet defined. + ttk.LabeledScale(variable=myvar) + if hasattr(sys, 'last_type'): + self.failIf(sys.last_type == Tkinter.TclError) + + + def test_initialization(self): + # master passing + x = ttk.LabeledScale() + self.failUnlessEqual(x.master, Tkinter._default_root) + x.destroy() + master = Tkinter.Frame() + x = ttk.LabeledScale(master) + self.failUnlessEqual(x.master, master) + x.destroy() + + # variable initialization/passing + passed_expected = ((2.5, 2), ('0', 0), (0, 0), (10, 10), + (-1, -1), (sys.maxint + 1, sys.maxint + 1)) + for pair in passed_expected: + x = ttk.LabeledScale(from_=pair[0]) + self.failUnlessEqual(x.value, pair[1]) + x.destroy() + x = ttk.LabeledScale(from_='2.5') + self.failUnlessRaises(ValueError, x._variable.get) + x.destroy() + x = ttk.LabeledScale(from_=None) + self.failUnlessRaises(ValueError, x._variable.get) + x.destroy() + # variable should have its default value set to the from_ value + myvar = Tkinter.DoubleVar(value=20) + x = ttk.LabeledScale(variable=myvar) + self.failUnlessEqual(x.value, 0) + x.destroy() + # check that it is really using a DoubleVar + x = ttk.LabeledScale(variable=myvar, from_=0.5) + self.failUnlessEqual(x.value, 0.5) + self.failUnlessEqual(x._variable._name, myvar._name) + x.destroy() + + # widget positionment + def check_positions(scale, scale_pos, label, label_pos): + self.failUnlessEqual(scale.pack_info()['side'], scale_pos) + self.failUnlessEqual(label.place_info()['anchor'], label_pos) + x = ttk.LabeledScale(compound='top') + check_positions(x.scale, 'bottom', x.label, 'n') + x.destroy() + x = ttk.LabeledScale(compound='bottom') + check_positions(x.scale, 'top', x.label, 's') + x.destroy() + x = ttk.LabeledScale(compound='unknown') # invert default positions + check_positions(x.scale, 'top', x.label, 's') + x.destroy() + x = ttk.LabeledScale() # take default positions + check_positions(x.scale, 'bottom', x.label, 'n') + x.destroy() + + # extra, and invalid, kwargs + self.failUnlessRaises(Tkinter.TclError, ttk.LabeledScale, a='b') + + + def test_horizontal_range(self): + lscale = ttk.LabeledScale(from_=0, to=10) + lscale.pack() + lscale.wait_visibility() + lscale.update() + + linfo_1 = lscale.label.place_info() + prev_xcoord = lscale.scale.coords()[0] + self.failUnlessEqual(prev_xcoord, int(linfo_1['x'])) + # change range to: from -5 to 5. This should change the x coord of + # the scale widget, since 0 is at the middle of the new + # range. + lscale.scale.configure(from_=-5, to=5) + # The following update is needed since the test doesn't use mainloop, + # at the same time this shouldn't affect test outcome + lscale.update() + curr_xcoord = lscale.scale.coords()[0] + self.failUnless(prev_xcoord != curr_xcoord) + # the label widget should have been repositioned too + linfo_2 = lscale.label.place_info() + self.failUnlessEqual(lscale.label['text'], 0) + self.failUnlessEqual(curr_xcoord, int(linfo_2['x'])) + # change the range back + lscale.scale.configure(from_=0, to=10) + self.failUnless(prev_xcoord != curr_xcoord) + self.failUnlessEqual(prev_xcoord, int(linfo_1['x'])) + + lscale.destroy() + + + def test_variable_change(self): + x = ttk.LabeledScale() + x.pack() + x.wait_visibility() + x.update() + + curr_xcoord = x.scale.coords()[0] + newval = x.value + 1 + x.value = newval + # The following update is needed since the test doesn't use mainloop, + # at the same time this shouldn't affect test outcome + x.update() + self.failUnlessEqual(x.label['text'], newval) + self.failUnless(x.scale.coords()[0] > curr_xcoord) + self.failUnlessEqual(x.scale.coords()[0], + int(x.label.place_info()['x'])) + + # value outside range + x.value = x.scale['to'] + 1 # no changes shouldn't happen + x.update() + self.failUnlessEqual(x.label['text'], newval) + self.failUnlessEqual(x.scale.coords()[0], + int(x.label.place_info()['x'])) + + x.destroy() + + + def test_resize(self): + x = ttk.LabeledScale() + x.pack(expand=True, fill='both') + x.wait_visibility() + x.update() + + width, height = x.master.winfo_width(), x.master.winfo_height() + width, height = width * 2, height * 2 + + x.value = 3 + x.update() + x.master.wm_geometry("%dx%d" % (width, height)) + self.failUnlessEqual(int(x.label.place_info()['x']), + x.scale.coords()[0]) + + x.master.wm_geometry("%dx%d" % (width, height)) + x.destroy() + + +class OptionMenuTest(unittest.TestCase): + + def setUp(self): + self.root = support.get_tk_root() + self.textvar = Tkinter.StringVar(self.root) + + def tearDown(self): + del self.textvar + self.root.destroy() + + + def test_widget_destroy(self): + var = Tkinter.StringVar() + optmenu = ttk.OptionMenu(None, var) + name = var._name + optmenu.update_idletasks() + optmenu.destroy() + self.failUnlessEqual(optmenu.tk.globalgetvar(name), var.get()) + del var + self.failUnlessRaises(Tkinter.TclError, optmenu.tk.globalgetvar, name) + + + def test_initialization(self): + self.failUnlessRaises(Tkinter.TclError, + ttk.OptionMenu, None, self.textvar, invalid='thing') + + optmenu = ttk.OptionMenu(None, self.textvar, 'b', 'a', 'b') + self.failUnlessEqual(optmenu._variable.get(), 'b') + + self.failUnless(optmenu['menu']) + self.failUnless(optmenu['textvariable']) + + optmenu.destroy() + + + def test_menu(self): + items = ('a', 'b', 'c') + default = 'a' + optmenu = ttk.OptionMenu(None, self.textvar, default, *items) + found_default = False + for i in range(len(items)): + value = optmenu['menu'].entrycget(i, 'value') + self.failUnlessEqual(value, items[i]) + if value == default: + found_default = True + self.failUnless(found_default) + optmenu.destroy() + + # default shouldn't be in menu if it is not part of values + default = 'd' + optmenu = ttk.OptionMenu(None, self.textvar, default, *items) + curr = None + i = 0 + while True: + last, curr = curr, optmenu['menu'].entryconfigure(i, 'value') + if last == curr: + # no more menu entries + break + self.failIf(curr == default) + i += 1 + self.failUnlessEqual(i, len(items)) + + # check that variable is updated correctly + optmenu.pack() + optmenu.wait_visibility() + optmenu['menu'].invoke(0) + self.failUnlessEqual(optmenu._variable.get(), items[0]) + + # changing to an invalid index shouldn't change the variable + self.failUnlessRaises(Tkinter.TclError, optmenu['menu'].invoke, -1) + self.failUnlessEqual(optmenu._variable.get(), items[0]) + + optmenu.destroy() + + # specifying a callback + success = [] + def cb_test(item): + self.failUnlessEqual(item, items[1]) + success.append(True) + optmenu = ttk.OptionMenu(None, self.textvar, 'a', command=cb_test, + *items) + optmenu['menu'].invoke(1) + if not success: + self.fail("Menu callback not invoked") + + optmenu.destroy() + + +tests_gui = (LabeledScaleTest, OptionMenuTest) + +if __name__ == "__main__": + run_unittest(*tests_gui) Added: python/trunk/Lib/lib-tk/test/test_ttk/test_functions.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_functions.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,426 @@ +# -*- encoding: utf-8 -*- +import sys +import unittest +import ttk + +class MockTclObj(object): + typename = 'test' + + def __init__(self, val): + self.val = val + + def __str__(self): + return unicode(self.val) + + +class MockStateSpec(object): + typename = 'StateSpec' + + def __init__(self, *args): + self.val = args + + def __str__(self): + return ' '.join(self.val) + + +class InternalFunctionsTest(unittest.TestCase): + + def test_format_optdict(self): + def check_against(fmt_opts, result): + for i in range(0, len(fmt_opts), 2): + self.failUnlessEqual(result.pop(fmt_opts[i]), fmt_opts[i + 1]) + if result: + self.fail("result still got elements: %s" % result) + + # passing an empty dict should return an empty object (tuple here) + self.failIf(ttk._format_optdict({})) + + # check list formatting + check_against( + ttk._format_optdict({'fg': 'blue', 'padding': [1, 2, 3, 4]}), + {'-fg': 'blue', '-padding': '1 2 3 4'}) + + # check tuple formatting (same as list) + check_against( + ttk._format_optdict({'test': (1, 2, '', 0)}), + {'-test': '1 2 {} 0'}) + + # check untouched values + check_against( + ttk._format_optdict({'test': {'left': 'as is'}}), + {'-test': {'left': 'as is'}}) + + # check script formatting and untouched value(s) + check_against( + ttk._format_optdict( + {'test': [1, -1, '', '2m', 0], 'nochange1': 3, + 'nochange2': 'abc def'}, script=True), + {'-test': '{1 -1 {} 2m 0}', '-nochange1': 3, + '-nochange2': 'abc def' }) + + opts = {u'???': True, u'?': False} + orig_opts = opts.copy() + # check if giving unicode keys is fine + check_against(ttk._format_optdict(opts), {u'-???': True, u'-?': False}) + # opts should remain unchanged + self.failUnlessEqual(opts, orig_opts) + + # passing values with spaces inside a tuple/list + check_against( + ttk._format_optdict( + {'option': ('one two', 'three')}), + {'-option': '{one two} three'}) + + # ignore an option + amount_opts = len(ttk._format_optdict(opts, ignore=(u'?'))) / 2 + self.failUnlessEqual(amount_opts, len(opts) - 1) + + # ignore non-existing options + amount_opts = len(ttk._format_optdict(opts, ignore=(u'?', 'b'))) / 2 + self.failUnlessEqual(amount_opts, len(opts) - 1) + + # ignore every option + self.failIf(ttk._format_optdict(opts, ignore=opts.keys())) + + + def test_format_mapdict(self): + opts = {'a': [('b', 'c', 'val'), ('d', 'otherval'), ('', 'single')]} + result = ttk._format_mapdict(opts) + self.failUnlessEqual(len(result), len(opts.keys()) * 2) + self.failUnlessEqual(result, ('-a', '{b c} val d otherval {} single')) + self.failUnlessEqual(ttk._format_mapdict(opts, script=True), + ('-a', '{{b c} val d otherval {} single}')) + + self.failUnlessEqual(ttk._format_mapdict({2: []}), ('-2', '')) + + opts = {u'?????d?': [(u'?', u'v?l')]} + result = ttk._format_mapdict(opts) + self.failUnlessEqual(result, (u'-?????d?', u'? v?l')) + + # empty states + valid = {'opt': [('', u'', 'hi')]} + self.failUnlessEqual(ttk._format_mapdict(valid), ('-opt', '{ } hi')) + + # when passing multiple states, they all must be strings + invalid = {'opt': [(1, 2, 'valid val')]} + self.failUnlessRaises(TypeError, ttk._format_mapdict, invalid) + invalid = {'opt': [([1], '2', 'valid val')]} + self.failUnlessRaises(TypeError, ttk._format_mapdict, invalid) + # but when passing a single state, it can be anything + valid = {'opt': [[1, 'value']]} + self.failUnlessEqual(ttk._format_mapdict(valid), ('-opt', '1 value')) + # special attention to single states which evalute to False + for stateval in (None, 0, False, '', set()): # just some samples + valid = {'opt': [(stateval, 'value')]} + self.failUnlessEqual(ttk._format_mapdict(valid), + ('-opt', '{} value')) + + # values must be iterable + opts = {'a': None} + self.failUnlessRaises(TypeError, ttk._format_mapdict, opts) + + # items in the value must have size >= 2 + self.failUnlessRaises(IndexError, ttk._format_mapdict, + {'a': [('invalid', )]}) + + + def test_format_elemcreate(self): + self.failUnless(ttk._format_elemcreate(None), (None, ())) + + ## Testing type = image + # image type expects at least an image name, so this should raise + # IndexError since it tries to access the index 0 of an empty tuple + self.failUnlessRaises(IndexError, ttk._format_elemcreate, 'image') + + # don't format returned values as a tcl script + # minimum acceptable for image type + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test'), + ("test ", ())) + # specifiyng a state spec + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test', + ('', 'a')), ("test {} a", ())) + # state spec with multiple states + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test', + ('a', 'b', 'c')), ("test {a b} c", ())) + # state spec and options + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test', + ('a', 'b'), a='x', b='y'), ("test a b", ("-a", "x", "-b", "y"))) + # format returned values as a tcl script + # state spec with multiple states and an option with a multivalue + self.failUnlessEqual(ttk._format_elemcreate('image', True, 'test', + ('a', 'b', 'c', 'd'), x=[2, 3]), ("{test {a b c} d}", "-x {2 3}")) + + ## Testing type = vsapi + # vsapi type expects at least a class name and a part_id, so this + # should raise an ValueError since it tries to get two elements from + # an empty tuple + self.failUnlessRaises(ValueError, ttk._format_elemcreate, 'vsapi') + + # don't format returned values as a tcl script + # minimum acceptable for vsapi + self.failUnlessEqual(ttk._format_elemcreate('vsapi', False, 'a', 'b'), + ("a b ", ())) + # now with a state spec with multiple states + self.failUnlessEqual(ttk._format_elemcreate('vsapi', False, 'a', 'b', + ('a', 'b', 'c')), ("a b {a b} c", ())) + # state spec and option + self.failUnlessEqual(ttk._format_elemcreate('vsapi', False, 'a', 'b', + ('a', 'b'), opt='x'), ("a b a b", ("-opt", "x"))) + # format returned values as a tcl script + # state spec with a multivalue and an option + self.failUnlessEqual(ttk._format_elemcreate('vsapi', True, 'a', 'b', + ('a', 'b', [1, 2]), opt='x'), ("{a b {a b} {1 2}}", "-opt x")) + + # Testing type = from + # from type expects at least a type name + self.failUnlessRaises(IndexError, ttk._format_elemcreate, 'from') + + self.failUnlessEqual(ttk._format_elemcreate('from', False, 'a'), + ('a', ())) + self.failUnlessEqual(ttk._format_elemcreate('from', False, 'a', 'b'), + ('a', ('b', ))) + self.failUnlessEqual(ttk._format_elemcreate('from', True, 'a', 'b'), + ('{a}', 'b')) + + + def test_format_layoutlist(self): + def sample(indent=0, indent_size=2): + return ttk._format_layoutlist( + [('a', {'other': [1, 2, 3], 'children': + [('b', {'children': + [('c', {'children': + [('d', {'nice': 'opt'})], 'something': (1, 2) + })] + })] + })], indent=indent, indent_size=indent_size)[0] + + def sample_expected(indent=0, indent_size=2): + spaces = lambda amount=0: ' ' * (amount + indent) + return ( + "%sa -other {1 2 3} -children {\n" + "%sb -children {\n" + "%sc -something {1 2} -children {\n" + "%sd -nice opt\n" + "%s}\n" + "%s}\n" + "%s}" % (spaces(), spaces(indent_size), + spaces(2 * indent_size), spaces(3 * indent_size), + spaces(2 * indent_size), spaces(indent_size), spaces())) + + # empty layout + self.failUnlessEqual(ttk._format_layoutlist([])[0], '') + + # smallest (after an empty one) acceptable layout + smallest = ttk._format_layoutlist([('a', None)], indent=0) + self.failUnlessEqual(smallest, + ttk._format_layoutlist([('a', '')], indent=0)) + self.failUnlessEqual(smallest[0], 'a') + + # testing indentation levels + self.failUnlessEqual(sample(), sample_expected()) + for i in range(4): + self.failUnlessEqual(sample(i), sample_expected(i)) + self.failUnlessEqual(sample(i, i), sample_expected(i, i)) + + # invalid layout format, different kind of exceptions will be + # raised + + # plain wrong format + self.failUnlessRaises(ValueError, ttk._format_layoutlist, + ['bad', 'format']) + self.failUnlessRaises(TypeError, ttk._format_layoutlist, None) + # _format_layoutlist always expects the second item (in every item) + # to act like a dict (except when the value evalutes to False). + self.failUnlessRaises(AttributeError, + ttk._format_layoutlist, [('a', 'b')]) + # bad children formatting + self.failUnlessRaises(ValueError, ttk._format_layoutlist, + [('name', {'children': {'a': None}})]) + + + def test_script_from_settings(self): + # empty options + self.failIf(ttk._script_from_settings({'name': + {'configure': None, 'map': None, 'element create': None}})) + + # empty layout + self.failUnlessEqual( + ttk._script_from_settings({'name': {'layout': None}}), + "ttk::style layout name {\nnull\n}") + + configdict = {u'???': True, u'?': False} + self.failUnless( + ttk._script_from_settings({'name': {'configure': configdict}})) + + mapdict = {u'?????d?': [(u'?', u'v?l')]} + self.failUnless( + ttk._script_from_settings({'name': {'map': mapdict}})) + + # invalid image element + self.failUnlessRaises(IndexError, + ttk._script_from_settings, {'name': {'element create': ['image']}}) + + # minimal valid image + self.failUnless(ttk._script_from_settings({'name': + {'element create': ['image', 'name']}})) + + image = {'thing': {'element create': + ['image', 'name', ('state1', 'state2', 'val')]}} + self.failUnlessEqual(ttk._script_from_settings(image), + "ttk::style element create thing image {name {state1 state2} val} ") + + image['thing']['element create'].append({'opt': 30}) + self.failUnlessEqual(ttk._script_from_settings(image), + "ttk::style element create thing image {name {state1 state2} val} " + "-opt 30") + + image['thing']['element create'][-1]['opt'] = [MockTclObj(3), + MockTclObj('2m')] + self.failUnlessEqual(ttk._script_from_settings(image), + "ttk::style element create thing image {name {state1 state2} val} " + "-opt {3 2m}") + + + def test_dict_from_tcltuple(self): + fakettuple = ('-a', '{1 2 3}', '-something', 'foo') + + self.failUnlessEqual(ttk._dict_from_tcltuple(fakettuple, False), + {'-a': '{1 2 3}', '-something': 'foo'}) + + self.failUnlessEqual(ttk._dict_from_tcltuple(fakettuple), + {'a': '{1 2 3}', 'something': 'foo'}) + + # passing a tuple with a single item should return an empty dict, + # since it tries to break the tuple by pairs. + self.failIf(ttk._dict_from_tcltuple(('single', ))) + + sspec = MockStateSpec('a', 'b') + self.failUnlessEqual(ttk._dict_from_tcltuple(('-a', (sspec, 'val'))), + {'a': [('a', 'b', 'val')]}) + + self.failUnlessEqual(ttk._dict_from_tcltuple((MockTclObj('-padding'), + [MockTclObj('1'), 2, MockTclObj('3m')])), + {'padding': [1, 2, '3m']}) + + + def test_list_from_statespec(self): + def test_it(sspec, value, res_value, states): + self.failUnlessEqual(ttk._list_from_statespec( + (sspec, value)), [states + (res_value, )]) + + states_even = tuple('state%d' % i for i in range(6)) + statespec = MockStateSpec(*states_even) + test_it(statespec, 'val', 'val', states_even) + test_it(statespec, MockTclObj('val'), 'val', states_even) + + states_odd = tuple('state%d' % i for i in range(5)) + statespec = MockStateSpec(*states_odd) + test_it(statespec, 'val', 'val', states_odd) + + test_it(('a', 'b', 'c'), MockTclObj('val'), 'val', ('a', 'b', 'c')) + + + def test_list_from_layouttuple(self): + # empty layout tuple + self.failIf(ttk._list_from_layouttuple(())) + + # shortest layout tuple + self.failUnlessEqual(ttk._list_from_layouttuple(('name', )), + [('name', {})]) + + # not so interesting ltuple + sample_ltuple = ('name', '-option', 'value') + self.failUnlessEqual(ttk._list_from_layouttuple(sample_ltuple), + [('name', {'option': 'value'})]) + + # empty children + self.failUnlessEqual(ttk._list_from_layouttuple( + ('something', '-children', ())), + [('something', {'children': []})] + ) + + # more interesting ltuple + ltuple = ( + 'name', '-option', 'niceone', '-children', ( + ('otherone', '-children', ( + ('child', )), '-otheropt', 'othervalue' + ) + ) + ) + self.failUnlessEqual(ttk._list_from_layouttuple(ltuple), + [('name', {'option': 'niceone', 'children': + [('otherone', {'otheropt': 'othervalue', 'children': + [('child', {})] + })] + })] + ) + + # bad tuples + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('name', 'no_minus')) + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('name', 'no_minus', 'value')) + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('something', '-children')) # no children + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('something', '-children', 'value')) # invalid children + + + def test_val_or_dict(self): + def func(opt, val=None): + if val is None: + return "test val" + return (opt, val) + + options = {'test': None} + self.failUnlessEqual(ttk._val_or_dict(options, func), "test val") + + options = {'test': 3} + self.failUnlessEqual(ttk._val_or_dict(options, func), options) + + + def test_convert_stringval(self): + tests = ( + (0, 0), ('09', 9), ('a', 'a'), (u'??', u'??'), ([], '[]'), + (None, 'None') + ) + for orig, expected in tests: + self.failUnlessEqual(ttk._convert_stringval(orig), expected) + + if sys.getdefaultencoding() == 'ascii': + self.failUnlessRaises(UnicodeDecodeError, + ttk._convert_stringval, '?') + + +class TclObjsToPyTest(unittest.TestCase): + + def test_unicode(self): + adict = {'opt': u'v?l??'} + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': u'v?l??'}) + + adict['opt'] = MockTclObj(adict['opt']) + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': u'v?l??'}) + + def test_multivalues(self): + adict = {'opt': [1, 2, 3, 4]} + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': [1, 2, 3, 4]}) + + adict['opt'] = [1, 'xm', 3] + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': [1, 'xm', 3]}) + + adict['opt'] = (MockStateSpec('a', 'b'), u'v?l??') + self.failUnlessEqual(ttk.tclobjs_to_py(adict), + {'opt': [('a', 'b', u'v?l??')]}) + + self.failUnlessEqual(ttk.tclobjs_to_py({'x': ['y z']}), + {'x': ['y z']}) + + def test_nosplit(self): + self.failUnlessEqual(ttk.tclobjs_to_py({'text': 'some text'}), + {'text': 'some text'}) + +tests_nogui = (InternalFunctionsTest, TclObjsToPyTest) + +if __name__ == "__main__": + from test.test_support import run_unittest + run_unittest(*tests_nogui) Added: python/trunk/Lib/lib-tk/test/test_ttk/test_style.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_style.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,99 @@ +import unittest +import Tkinter +import ttk +from test.test_support import requires, run_unittest + +import support + +requires('gui') + +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() + + + def test_configure(self): + style = self.style + style.configure('TButton', background='yellow') + self.failUnlessEqual(style.configure('TButton', 'background'), + 'yellow') + self.failUnless(isinstance(style.configure('TButton'), dict)) + + + def test_map(self): + style = self.style + style.map('TButton', background=[('active', 'background', 'blue')]) + self.failUnlessEqual(style.map('TButton', 'background'), + [('active', 'background', 'blue')]) + self.failUnless(isinstance(style.map('TButton'), dict)) + + + def test_lookup(self): + style = self.style + style.configure('TButton', background='yellow') + style.map('TButton', background=[('active', 'background', 'blue')]) + + self.failUnlessEqual(style.lookup('TButton', 'background'), 'yellow') + self.failUnlessEqual(style.lookup('TButton', 'background', + ['active', 'background']), 'blue') + self.failUnlessEqual(style.lookup('TButton', 'optionnotdefined', + default='iknewit'), 'iknewit') + + + def test_layout(self): + style = self.style + self.failUnlessRaises(Tkinter.TclError, style.layout, 'NotALayout') + tv_style = style.layout('Treeview') + + # "erase" Treeview layout + style.layout('Treeview', '') + self.failUnlessEqual(style.layout('Treeview'), + [('null', {'sticky': 'nswe'})] + ) + + # restore layout + style.layout('Treeview', tv_style) + self.failUnlessEqual(style.layout('Treeview'), tv_style) + + # should return a list + self.failUnless(isinstance(style.layout('TButton'), list)) + + # correct layout, but "option" doesn't exist as option + self.failUnlessRaises(Tkinter.TclError, style.layout, 'Treeview', + [('name', {'option': 'inexistant'})]) + + + def test_theme_use(self): + self.failUnlessRaises(Tkinter.TclError, self.style.theme_use, + 'nonexistingname') + + curr_theme = self.style.theme_use() + new_theme = None + for theme in self.style.theme_names(): + if theme != curr_theme: + new_theme = theme + self.style.theme_use(theme) + break + else: + # just one theme available, can't go on with tests + return + + self.failIf(curr_theme == new_theme) + self.failIf(new_theme != self.style.theme_use()) + + self.style.theme_use(curr_theme) + + +tests_gui = (StyleTest, ) + +if __name__ == "__main__": + run_unittest(*tests_gui) Added: python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,1115 @@ +import unittest +import Tkinter +import ttk +from test.test_support import requires, run_unittest + +import support +from test_functions import MockTclObj, MockStateSpec + +requires('gui') + +class WidgetTest(unittest.TestCase): + """Tests methods available in every ttk widget.""" + + def setUp(self): + self.widget = ttk.Button() + self.widget.pack() + self.widget.wait_visibility() + + def tearDown(self): + self.widget.destroy() + + + def test_identify(self): + self.widget.update_idletasks() + self.failUnlessEqual(self.widget.identify(5, 5), "label") + self.failUnlessEqual(self.widget.identify(-1, -1), "") + + self.failUnlessRaises(Tkinter.TclError, self.widget.identify, None, 5) + self.failUnlessRaises(Tkinter.TclError, self.widget.identify, 5, None) + self.failUnlessRaises(Tkinter.TclError, self.widget.identify, 5, '') + + + def test_widget_state(self): + # XXX not sure about the portability of all these tests + self.failUnlessEqual(self.widget.state(), ()) + self.failUnlessEqual(self.widget.instate(['!disabled']), True) + + # changing from !disabled to disabled + self.failUnlessEqual(self.widget.state(['disabled']), ('!disabled', )) + # no state change + self.failUnlessEqual(self.widget.state(['disabled']), ()) + # change back to !disable but also active + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), + ('!active', 'disabled')) + # no state changes, again + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), ()) + self.failUnlessEqual(self.widget.state(['active', '!disabled']), ()) + + def test_cb(arg1, **kw): + return arg1, kw + self.failUnlessEqual(self.widget.instate(['!disabled'], + test_cb, "hi", **{"msg": "there"}), + ('hi', {'msg': 'there'})) + + # attempt to set invalid statespec + currstate = self.widget.state() + self.failUnlessRaises(Tkinter.TclError, self.widget.instate, + ['badstate']) + self.failUnlessRaises(Tkinter.TclError, self.widget.instate, + ['disabled', 'badstate']) + # verify that widget didn't change its state + self.failUnlessEqual(currstate, self.widget.state()) + + # ensuring that passing None as state doesn't modify current state + self.widget.state(['active', '!disabled']) + self.failUnlessEqual(self.widget.state(), ('active', )) + + +class ButtonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + btn = ttk.Button(command=lambda: success.append(1)) + btn.invoke() + self.failUnless(success) + + +class CheckbuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + cbtn = ttk.Checkbutton(command=cb_test) + # the variable automatically created by ttk.Checkbutton is actually + # undefined till we invoke the Checkbutton + self.failUnlessEqual(cbtn.state(), ('alternate', )) + self.failUnlessRaises(Tkinter.TclError, cbtn.tk.globalgetvar, + cbtn['variable']) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['onvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn['command'] = '' + res = cbtn.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn['offvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + + +class ComboboxTest(unittest.TestCase): + + def setUp(self): + self.combo = ttk.Combobox() + + def tearDown(self): + self.combo.destroy() + + def _show_drop_down_listbox(self): + width = self.combo.winfo_width() + self.combo.event_generate('', x=width - 5, y=5) + self.combo.event_generate('', x=width - 5, y=5) + self.combo.update_idletasks() + + + def test_virtual_event(self): + success = [] + + self.combo['values'] = [1] + self.combo.bind('<>', + lambda evt: success.append(True)) + self.combo.pack() + self.combo.wait_visibility() + + height = self.combo.winfo_height() + self._show_drop_down_listbox() + self.combo.update() + self.combo.event_generate('') + self.combo.update() + + self.failUnless(success) + + + def test_postcommand(self): + success = [] + + self.combo['postcommand'] = lambda: success.append(True) + self.combo.pack() + self.combo.wait_visibility() + + self._show_drop_down_listbox() + self.failUnless(success) + + # testing postcommand removal + self.combo['postcommand'] = '' + self._show_drop_down_listbox() + self.failUnlessEqual(len(success), 1) + + + def test_values(self): + def check_get_current(getval, currval): + self.failUnlessEqual(self.combo.get(), getval) + self.failUnlessEqual(self.combo.current(), currval) + + check_get_current('', -1) + + self.combo['values'] = ['a', 1, 'c'] + + self.combo.set('c') + check_get_current('c', 2) + + self.combo.current(0) + check_get_current('a', 0) + + self.combo.set('d') + check_get_current('d', -1) + + # testing values with empty string + self.combo.set('') + self.combo['values'] = (1, 2, '', 3) + check_get_current('', 2) + + # testing values with empty string set through configure + self.combo.configure(values=[1, '', 2]) + self.failUnlessEqual(self.combo['values'], ('1', '', '2')) + + # out of range + self.failUnlessRaises(Tkinter.TclError, self.combo.current, + len(self.combo['values'])) + # it expects an integer (or something that can be converted to int) + self.failUnlessRaises(Tkinter.TclError, self.combo.current, '') + + # testing creating combobox with empty string in values + combo2 = ttk.Combobox(values=[1, 2, '']) + self.failUnlessEqual(combo2['values'], ('1', '2', '')) + combo2.destroy() + + +class EntryTest(unittest.TestCase): + + def setUp(self): + self.entry = ttk.Entry() + + def tearDown(self): + self.entry.destroy() + + + def test_bbox(self): + self.failUnlessEqual(len(self.entry.bbox(0)), 4) + for item in self.entry.bbox(0): + self.failUnless(isinstance(item, int)) + + self.failUnlessRaises(Tkinter.TclError, self.entry.bbox, 'noindex') + self.failUnlessRaises(Tkinter.TclError, self.entry.bbox, None) + + + def test_identify(self): + self.entry.pack() + self.entry.wait_visibility() + self.entry.update_idletasks() + + self.failUnlessEqual(self.entry.identify(5, 5), "textarea") + self.failUnlessEqual(self.entry.identify(-1, -1), "") + + self.failUnlessRaises(Tkinter.TclError, self.entry.identify, None, 5) + self.failUnlessRaises(Tkinter.TclError, self.entry.identify, 5, None) + self.failUnlessRaises(Tkinter.TclError, self.entry.identify, 5, '') + + + def test_validation_options(self): + success = [] + test_invalid = lambda: success.append(True) + + self.entry['validate'] = 'none' + self.entry['validatecommand'] = lambda: False + + self.entry['invalidcommand'] = test_invalid + self.entry.validate() + self.failUnless(success) + + self.entry['invalidcommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['invalidcommand'] = test_invalid + self.entry['validatecommand'] = lambda: True + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = True + self.failUnlessRaises(Tkinter.TclError, self.entry.validate) + + + def test_validation(self): + validation = [] + def validate(to_insert): + if not 'a' <= to_insert.lower() <= 'z': + validation.append(False) + return False + validation.append(True) + return True + + self.entry['validate'] = 'key' + self.entry['validatecommand'] = self.entry.register(validate), '%S' + + self.entry.insert('end', 1) + self.entry.insert('end', 'a') + self.failUnlessEqual(validation, [False, True]) + self.failUnlessEqual(self.entry.get(), 'a') + + + def test_revalidation(self): + def validate(content): + for letter in content: + if not 'a' <= letter.lower() <= 'z': + return False + return True + + self.entry['validatecommand'] = self.entry.register(validate), '%P' + + self.entry.insert('end', 'avocado') + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + self.entry.delete(0, 'end') + self.failUnlessEqual(self.entry.get(), '') + + self.entry.insert('end', 'a1b') + self.failUnlessEqual(self.entry.validate(), False) + self.failUnlessEqual(self.entry.state(), ('invalid', )) + + self.entry.delete(1) + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + +class PanedwindowTest(unittest.TestCase): + + def setUp(self): + self.paned = ttk.Panedwindow() + + def tearDown(self): + self.paned.destroy() + + + def test_add(self): + # attempt to add a child that is not a direct child of the paned window + label = ttk.Label(self.paned) + child = ttk.Label(label) + self.failUnlessRaises(Tkinter.TclError, self.paned.add, child) + label.destroy() + child.destroy() + # another attempt + label = ttk.Label() + child = ttk.Label(label) + self.failUnlessRaises(Tkinter.TclError, self.paned.add, child) + child.destroy() + label.destroy() + + good_child = ttk.Label() + self.paned.add(good_child) + # re-adding a child is not accepted + self.failUnlessRaises(Tkinter.TclError, self.paned.add, good_child) + + other_child = ttk.Label(self.paned) + self.paned.add(other_child) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(1)) + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 2) + good_child.destroy() + other_child.destroy() + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0) + + + def test_forget(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.forget, None) + self.failUnlessRaises(Tkinter.TclError, self.paned.forget, 0) + + self.paned.add(ttk.Label()) + self.paned.forget(0) + self.failUnlessRaises(Tkinter.TclError, self.paned.forget, 0) + + + def test_insert(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, None, 0) + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, None) + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, 0) + + child = ttk.Label() + child2 = ttk.Label() + child3 = ttk.Label() + + self.failUnlessRaises(Tkinter.TclError, self.paned.insert, 0, child) + + self.paned.insert('end', child2) + self.paned.insert(0, child) + self.failUnlessEqual(self.paned.panes(), (str(child), str(child2))) + + self.paned.insert(0, child2) + self.failUnlessEqual(self.paned.panes(), (str(child2), str(child))) + + self.paned.insert('end', child3) + self.failUnlessEqual(self.paned.panes(), + (str(child2), str(child), str(child3))) + + # reinserting a child should move it to its current position + panes = self.paned.panes() + self.paned.insert('end', child3) + self.failUnlessEqual(panes, self.paned.panes()) + + # moving child3 to child2 position should result in child2 ending up + # in previous child position and child ending up in previous child3 + # position + self.paned.insert(child2, child3) + self.failUnlessEqual(self.paned.panes(), + (str(child3), str(child2), str(child))) + + + def test_pane(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0) + + child = ttk.Label() + self.paned.add(child) + self.failUnless(isinstance(self.paned.pane(0), dict)) + self.failUnlessEqual(self.paned.pane(0, weight=None), 0) + # newer form for querying a single option + self.failUnlessEqual(self.paned.pane(0, 'weight'), 0) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(str(child))) + + self.failUnlessRaises(Tkinter.TclError, self.paned.pane, 0, + badoption='somevalue') + + + def test_sashpos(self): + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, None) + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, '') + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 0) + + child = ttk.Label(self.paned, text='a') + self.paned.add(child, weight=1) + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 0) + child2 = ttk.Label(self.paned, text='b') + self.paned.add(child2) + self.failUnlessRaises(Tkinter.TclError, self.paned.sashpos, 1) + + self.paned.pack(expand=True, fill='both') + self.paned.wait_visibility() + + curr_pos = self.paned.sashpos(0) + self.paned.sashpos(0, 1000) + self.failUnless(curr_pos != self.paned.sashpos(0)) + self.failUnless(isinstance(self.paned.sashpos(0), int)) + + +class RadiobuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + myvar = Tkinter.IntVar() + cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0) + cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn2['command'] = '' + res = cbtn2.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn2['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + + self.failUnlessEqual(str(cbtn['variable']), str(cbtn2['variable'])) + + + +class ScaleTest(unittest.TestCase): + + def setUp(self): + self.scale = ttk.Scale() + self.scale.pack() + self.scale.update() + + def tearDown(self): + self.scale.destroy() + + + def test_custom_event(self): + failure = [1, 1, 1] # will need to be empty + + funcid = self.scale.bind('<>', lambda evt: failure.pop()) + + self.scale['from'] = 10 + self.scale['from_'] = 10 + self.scale['to'] = 3 + + self.failIf(failure) + + failure = [1, 1, 1] + self.scale.configure(from_=2, to=5) + self.scale.configure(from_=0, to=-2) + self.scale.configure(to=10) + + self.failIf(failure) + + + def test_get(self): + scale_width = self.scale.winfo_width() + self.failUnlessEqual(self.scale.get(scale_width, 0), self.scale['to']) + + self.failUnlessEqual(self.scale.get(0, 0), self.scale['from']) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + self.scale['value'] = 30 + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + self.failUnlessRaises(Tkinter.TclError, self.scale.get, '', 0) + self.failUnlessRaises(Tkinter.TclError, self.scale.get, 0, '') + + + def test_set(self): + # set restricts the max/min values according to the current range + max = self.scale['to'] + new_max = max + 10 + self.scale.set(new_max) + self.failUnlessEqual(self.scale.get(), max) + min = self.scale['from'] + self.scale.set(min - 1) + self.failUnlessEqual(self.scale.get(), min) + + # changing directly the variable doesn't impose this limitation tho + var = Tkinter.DoubleVar() + self.scale['variable'] = var + var.set(max + 5) + self.failUnlessEqual(self.scale.get(), var.get()) + self.failUnlessEqual(self.scale.get(), max + 5) + del var + + # the same happens with the value option + self.scale['value'] = max + 10 + self.failUnlessEqual(self.scale.get(), max + 10) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + # nevertheless, note that the max/min values we can get specifying + # x, y coords are the ones according to the current range + self.failUnlessEqual(self.scale.get(0, 0), min) + self.failUnlessEqual(self.scale.get(self.scale.winfo_width(), 0), max) + + self.failUnlessRaises(Tkinter.TclError, self.scale.set, None) + + +class NotebookTest(unittest.TestCase): + + def setUp(self): + self.nb = ttk.Notebook() + self.child1 = ttk.Label() + self.child2 = ttk.Label() + self.nb.add(self.child1, text='a') + self.nb.add(self.child2, text='b') + + def tearDown(self): + self.child1.destroy() + self.child2.destroy() + self.nb.destroy() + + + def test_tab_identifiers(self): + self.nb.forget(0) + self.nb.hide(self.child2) + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, self.child1) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.select(self.child2) + + self.failUnless(self.nb.tab('current')) + self.nb.add(self.child1, text='a') + + self.nb.pack() + self.nb.wait_visibility() + self.failUnlessEqual(self.nb.tab('@5,5'), self.nb.tab('current')) + + for i in range(5, 100, 5): + if self.nb.tab('@%d, 5' % i, text=None) == 'a': + break + else: + self.fail("Tab with text 'a' not found") + + + def test_add_and_hidden(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.hide, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.hide, 'hi') + self.failUnlessRaises(Tkinter.TclError, self.nb.hide, None) + self.failUnlessRaises(Tkinter.TclError, self.nb.add, None) + self.failUnlessRaises(Tkinter.TclError, self.nb.add, ttk.Label(), + unknown='option') + + tabs = self.nb.tabs() + self.nb.hide(self.child1) + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.tabs(), tabs) + + child = ttk.Label() + self.nb.add(child, text='c') + tabs = self.nb.tabs() + + curr = self.nb.index('current') + # verify that the tab gets readded at its previous position + child2_index = self.nb.index(self.child2) + self.nb.hide(self.child2) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.failUnlessEqual(self.nb.index(self.child2), child2_index) + self.failUnless(str(self.child2) == self.nb.tabs()[child2_index]) + # but the tab next to it (not hidden) is the one selected now + self.failUnlessEqual(self.nb.index('current'), curr + 1) + + + def test_forget(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.forget, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.forget, 'hi') + self.failUnlessRaises(Tkinter.TclError, self.nb.forget, None) + + tabs = self.nb.tabs() + child1_index = self.nb.index(self.child1) + self.nb.forget(self.child1) + self.failIf(str(self.child1) in self.nb.tabs()) + self.failUnlessEqual(len(tabs) - 1, len(self.nb.tabs())) + + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.index(self.child1), 1) + self.failIf(child1_index == self.nb.index(self.child1)) + + + def test_index(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.index, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.index, None) + + self.failUnless(isinstance(self.nb.index('end'), int)) + self.failUnlessEqual(self.nb.index(self.child1), 0) + self.failUnlessEqual(self.nb.index(self.child2), 1) + self.failUnlessEqual(self.nb.index('end'), 2) + + + def test_insert(self): + # moving tabs + tabs = self.nb.tabs() + self.nb.insert(1, tabs[0]) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert(self.child1, self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert('end', self.child1) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert('end', 0) + self.failUnlessEqual(self.nb.tabs(), tabs) + # bad moves + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 2, tabs[0]) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, -1, tabs[0]) + + # new tab + child3 = ttk.Label() + self.nb.insert(1, child3) + self.failUnlessEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1])) + self.nb.forget(child3) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert(self.child1, child3) + self.failUnlessEqual(self.nb.tabs(), (str(child3), ) + tabs) + self.nb.forget(child3) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 2, child3) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, -1, child3) + + # bad inserts + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, 'end', None) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, None, 0) + self.failUnlessRaises(Tkinter.TclError, self.nb.insert, None, None) + + + def test_select(self): + self.nb.pack() + self.nb.wait_visibility() + + success = [] + tab_changed = [] + + self.child1.bind('', lambda evt: success.append(True)) + self.nb.bind('<>', + lambda evt: tab_changed.append(True)) + + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.select(self.child2) + self.failUnless(success) + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.update() + self.failUnless(tab_changed) + + + def test_tab(self): + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, -1) + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, 'notab') + self.failUnlessRaises(Tkinter.TclError, self.nb.tab, None) + + self.failUnless(isinstance(self.nb.tab(self.child1), dict)) + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'a') + # newer form for querying a single option + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'a') + self.nb.tab(self.child1, text='abc') + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'abc') + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'abc') + + + def test_tabs(self): + self.failUnlessEqual(len(self.nb.tabs()), 2) + + self.nb.forget(self.child1) + self.nb.forget(self.child2) + + self.failUnlessEqual(self.nb.tabs(), ()) + + + def test_traversal(self): + self.nb.pack() + self.nb.wait_visibility() + + self.nb.select(0) + + support.simulate_mouse_click(self.nb, 5, 5) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.tab(self.child1, text='a', underline=0) + self.nb.enable_traversal() + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + + +class TreeviewTest(unittest.TestCase): + + def setUp(self): + self.tv = ttk.Treeview() + + def tearDown(self): + self.tv.destroy() + + + def test_bbox(self): + self.tv.pack() + self.failUnlessEqual(self.tv.bbox(''), '') + self.tv.wait_visibility() + self.tv.update() + + item_id = self.tv.insert('', 'end') + children = self.tv.get_children() + self.failUnless(children) + + bbox = self.tv.bbox(children[0]) + self.failUnlessEqual(len(bbox), 4) + self.failUnless(isinstance(bbox, tuple)) + for item in bbox: + if not isinstance(item, int): + self.fail("Invalid bounding box: %s" % bbox) + break + + # compare width in bboxes + self.tv['columns'] = ['test'] + self.tv.column('test', width=50) + bbox_column0 = self.tv.bbox(children[0], 0) + root_width = self.tv.column('#0', width=None) + self.failUnlessEqual(bbox_column0[0], bbox[0] + root_width) + + # verify that bbox of a closed item is the empty string + child1 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.bbox(child1), '') + + + def test_children(self): + # no children yet, should get an empty tuple + self.failUnlessEqual(self.tv.get_children(), ()) + + item_id = self.tv.insert('', 'end') + self.failUnless(isinstance(self.tv.get_children(), tuple)) + self.failUnlessEqual(self.tv.get_children()[0], item_id) + + # add item_id and child3 as children of child2 + child2 = self.tv.insert('', 'end') + child3 = self.tv.insert('', 'end') + self.tv.set_children(child2, item_id, child3) + self.failUnlessEqual(self.tv.get_children(child2), (item_id, child3)) + + # child3 has child2 as parent, thus trying to set child2 as a children + # of child3 should result in an error + self.failUnlessRaises(Tkinter.TclError, + self.tv.set_children, child3, child2) + + # remove child2 children + self.tv.set_children(child2) + self.failUnlessEqual(self.tv.get_children(child2), ()) + + # remove root's children + self.tv.set_children('') + self.failUnlessEqual(self.tv.get_children(), ()) + + + def test_column(self): + # return a dict with all options/values + self.failUnless(isinstance(self.tv.column('#0'), dict)) + # return a single value of the given option + self.failUnless(isinstance(self.tv.column('#0', width=None), int)) + # set a new value for an option + self.tv.column('#0', width=10) + # testing new way to get option value + self.failUnlessEqual(self.tv.column('#0', 'width'), 10) + self.failUnlessEqual(self.tv.column('#0', width=None), 10) + # check read-only option + self.failUnlessRaises(Tkinter.TclError, self.tv.column, '#0', id='X') + + self.failUnlessRaises(Tkinter.TclError, self.tv.column, 'invalid') + invalid_kws = [ + {'unknown_option': 'some value'}, {'stretch': 'wrong'}, + {'anchor': 'wrong'}, {'width': 'wrong'}, {'minwidth': 'wrong'} + ] + for kw in invalid_kws: + self.failUnlessRaises(Tkinter.TclError, self.tv.column, '#0', + **kw) + + + def test_delete(self): + self.failUnlessRaises(Tkinter.TclError, self.tv.delete, '#0') + + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + self.tv.delete(item_id) + self.failIf(self.tv.get_children()) + + # reattach should fail + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, item_id, '', 'end') + + # test multiple item delete + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + self.failUnlessEqual(self.tv.get_children(), (item1, item2)) + + self.tv.delete(item1, item2) + self.failIf(self.tv.get_children()) + + + def test_detach_reattach(self): + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + + # calling detach without items is valid, although it does nothing + prev = self.tv.get_children() + self.tv.detach() # this should do nothing + self.failUnlessEqual(prev, self.tv.get_children()) + + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # detach item with children + self.tv.detach(item_id) + self.failIf(self.tv.get_children()) + + # reattach item with children + self.tv.reattach(item_id, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # move a children to the root + self.tv.move(item2, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, item2)) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + # bad values + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, 'nonexistant', '', 'end') + self.failUnlessRaises(Tkinter.TclError, + self.tv.detach, 'nonexistant') + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, item2, 'otherparent', 'end') + self.failUnlessRaises(Tkinter.TclError, + self.tv.reattach, item2, '', 'invalid') + + # multiple detach + self.tv.detach(item_id, item2) + self.failUnlessEqual(self.tv.get_children(), ()) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + + def test_exists(self): + self.failUnlessEqual(self.tv.exists('something'), False) + self.failUnlessEqual(self.tv.exists(''), True) + self.failUnlessEqual(self.tv.exists({}), False) + + # the following will make a tk.call equivalent to + # tk.call(treeview, "exists") which should result in an error + # in the tcl interpreter since tk requires an item. + self.failUnlessRaises(Tkinter.TclError, self.tv.exists, None) + + + def test_focus(self): + # nothing is focused right now + self.failUnlessEqual(self.tv.focus(), '') + + item1 = self.tv.insert('', 'end') + self.tv.focus(item1) + self.failUnlessEqual(self.tv.focus(), item1) + + self.tv.delete(item1) + self.failUnlessEqual(self.tv.focus(), '') + + # try focusing inexistant item + self.failUnlessRaises(Tkinter.TclError, self.tv.focus, 'hi') + + + def test_heading(self): + # check a dict is returned + self.failUnless(isinstance(self.tv.heading('#0'), dict)) + + # check a value is returned + self.tv.heading('#0', text='hi') + self.failUnlessEqual(self.tv.heading('#0', 'text'), 'hi') + self.failUnlessEqual(self.tv.heading('#0', text=None), 'hi') + + # invalid option + self.failUnlessRaises(Tkinter.TclError, self.tv.heading, '#0', + background=None) + # invalid value + self.failUnlessRaises(Tkinter.TclError, self.tv.heading, '#0', + anchor=1) + + + def test_heading_callback(self): + def simulate_heading_click(x, y): + support.simulate_mouse_click(self.tv, x, y) + self.tv.update_idletasks() + + success = [] # no success for now + + self.tv.pack() + self.tv.wait_visibility() + self.tv.heading('#0', command=lambda: success.append(True)) + self.tv.column('#0', width=100) + self.tv.update() + + # assuming that the coords (5, 5) fall into heading #0 + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + success = [] + commands = self.tv.master._tclCommands + self.tv.heading('#0', command=str(self.tv.heading('#0', command=None))) + self.failUnlessEqual(commands, self.tv.master._tclCommands) + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + # XXX The following raises an error in a tcl interpreter, but not in + # Python + #self.tv.heading('#0', command='I dont exist') + #simulate_heading_click(5, 5) + + + def test_index(self): + # item 'what' doesn't exist + self.failUnlessRaises(Tkinter.TclError, self.tv.index, 'what') + + self.failUnlessEqual(self.tv.index(''), 0) + + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + c1 = self.tv.insert(item1, 'end') + c2 = self.tv.insert(item1, 'end') + self.failUnlessEqual(self.tv.index(item1), 0) + self.failUnlessEqual(self.tv.index(c1), 0) + self.failUnlessEqual(self.tv.index(c2), 1) + self.failUnlessEqual(self.tv.index(item2), 1) + + self.tv.move(item2, '', 0) + self.failUnlessEqual(self.tv.index(item2), 0) + self.failUnlessEqual(self.tv.index(item1), 1) + + # check that index still works even after its parent and siblings + # have been detached + self.tv.detach(item1) + self.failUnlessEqual(self.tv.index(c2), 1) + self.tv.detach(c1) + self.failUnlessEqual(self.tv.index(c2), 0) + + # but it fails after item has been deleted + self.tv.delete(item1) + self.failUnlessRaises(Tkinter.TclError, self.tv.index, c2) + + + def test_insert_item(self): + # parent 'none' doesn't exist + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, 'none', 'end') + + # open values + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + open='') + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + open='please') + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=True))) + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=False))) + + # invalid index + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'middle') + + # trying to duplicate item id is invalid + itemid = self.tv.insert('', 'end', 'first-item') + self.failUnlessEqual(itemid, 'first-item') + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + 'first-item') + self.failUnlessRaises(Tkinter.TclError, self.tv.insert, '', 'end', + MockTclObj('first-item')) + + # unicode values + value = u'\xe1ba' + item = self.tv.insert('', 'end', values=(value, )) + self.failUnlessEqual(self.tv.item(item, 'values'), (value, )) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.tv.item(item, values=list(self.tv.item(item, values=None))) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.failUnless(isinstance(self.tv.item(item), dict)) + + # erase item values + self.tv.item(item, values='') + self.failIf(self.tv.item(item, values=None)) + + # item tags + item = self.tv.insert('', 'end', tags=[1, 2, value]) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2', value)) + self.tv.item(item, tags=[]) + self.failIf(self.tv.item(item, tags=None)) + self.tv.item(item, tags=(1, 2)) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2')) + + # values with spaces + item = self.tv.insert('', 'end', values=('a b c', + '%s %s' % (value, value))) + self.failUnlessEqual(self.tv.item(item, values=None), + ('a b c', '%s %s' % (value, value))) + + # text + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text="Label here"), text=None), + "Label here") + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text=value), text=None), + value) + + + def test_set(self): + self.tv['columns'] = ['A', 'B'] + item = self.tv.insert('', 'end', values=['a', 'b']) + self.failUnlessEqual(self.tv.set(item), {'A': 'a', 'B': 'b'}) + + self.tv.set(item, 'B', 'a') + self.failUnlessEqual(self.tv.item(item, values=None), ('a', 'a')) + + self.tv['columns'] = ['B'] + self.failUnlessEqual(self.tv.set(item), {'B': 'a'}) + + self.tv.set(item, 'B', 'b') + self.failUnlessEqual(self.tv.set(item, column='B'), 'b') + self.failUnlessEqual(self.tv.item(item, values=None), ('b', 'a')) + + self.tv.set(item, 'B', 123) + self.failUnlessEqual(self.tv.set(item, 'B'), 123) + self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) + self.failUnlessEqual(self.tv.set(item), {'B': 123}) + + # inexistant column + self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A') + self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A', 'b') + + # inexistant item + self.failUnlessRaises(Tkinter.TclError, self.tv.set, 'notme') + + + def test_tag_bind(self): + events = [] + item1 = self.tv.insert('', 'end', tags=['call']) + item2 = self.tv.insert('', 'end', tags=['call']) + self.tv.tag_bind('call', '', + lambda evt: events.append(1)) + self.tv.tag_bind('call', '', + lambda evt: events.append(2)) + + self.tv.pack() + self.tv.wait_visibility() + self.tv.update() + + pos_y = set() + found = set() + for i in range(0, 100, 10): + if len(found) == 2: # item1 and item2 already found + break + item_id = self.tv.identify_row(i) + if item_id and item_id not in found: + pos_y.add(i) + found.add(item_id) + + self.failUnlessEqual(len(pos_y), 2) # item1 and item2 y pos + for y in pos_y: + support.simulate_mouse_click(self.tv, 0, y) + + # by now there should be 4 things in the events list, since each + # item had a bind for two events that were simulated above + self.failUnlessEqual(len(events), 4) + for evt in zip(events[::2], events[1::2]): + self.failUnlessEqual(evt, (1, 2)) + + + def test_tag_configure(self): + # Just testing parameter passing for now + self.failUnlessRaises(TypeError, self.tv.tag_configure) + self.failUnlessRaises(Tkinter.TclError, self.tv.tag_configure, + 'test', sky='blue') + self.tv.tag_configure('test', foreground='blue') + self.failUnlessEqual(self.tv.tag_configure('test', 'foreground'), + 'blue') + self.failUnlessEqual(self.tv.tag_configure('test', foreground=None), + 'blue') + self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) + + +tests_gui = ( + WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, + ComboboxTest, EntryTest, PanedwindowTest, ScaleTest, NotebookTest, + TreeviewTest + ) + +if __name__ == "__main__": + run_unittest(*tests_gui) Added: python/trunk/Lib/lib-tk/ttk.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/ttk.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,1636 @@ +"""Ttk wrapper. + +This module provides classes to allow using Tk themed widget set. + +Ttk is based on a revised and enhanced version of +TIP #48 (http://tip.tcl.tk/48) specified style engine. + +Its basic idea is to separate, to the extent possible, the code +implementing a widget's behavior from the code implementing its +appearance. Widget class bindings are primarily responsible for +maintaining the widget state and invoking callbacks, all aspects +of the widgets appearance lies at Themes. +""" + +__version__ = "0.3.1" + +__author__ = "Guilherme Polo " + +__all__ = ["Button", "Checkbutton", "Combobox", "Entry", "Frame", "Label", + "Labelframe", "LabelFrame", "Menubutton", "Notebook", "Panedwindow", + "PanedWindow", "Progressbar", "Radiobutton", "Scale", "Scrollbar", + "Separator", "Sizegrip", "Style", "Treeview", + # Extensions + "LabeledScale", "OptionMenu", + # functions + "tclobjs_to_py"] + +import Tkinter + +_flatten = Tkinter._flatten + +# Verify if Tk is new enough to not need Tile checking +_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 _format_optdict(optdict, script=False, ignore=None): + """Formats optdict to a tuple to pass it to tk.call. + + E.g. (script=False): + {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns: + ('-foreground', 'blue', '-padding', '1 2 3 4')""" + format = "%s" if not script else "{%s}" + + opts = [] + for opt, value in optdict.iteritems(): + if ignore and opt in ignore: + continue + + if isinstance(value, (list, tuple)): + v = [] + for val in value: + if isinstance(val, basestring): + v.append(unicode(val) if val else '{}') + else: + v.append(str(val)) + + # format v according to the script option, but also check for + # space in any value in v in order to group them correctly + value = format % ' '.join( + ('{%s}' if ' ' in val else '%s') % val for val in v) + + if script and value == '': + value = '{}' # empty string in Python is equivalent to {} in Tcl + + opts.append(("-%s" % opt, value)) + + # Remember: _flatten skips over None + return _flatten(opts) + +def _format_mapdict(mapdict, script=False): + """Formats mapdict to pass it to tk.call. + + E.g. (script=False): + {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} + + returns: + + ('-expand', '{active selected} grey focus {1, 2, 3, 4}')""" + # if caller passes a Tcl script to tk.call, all the values need to + # be grouped into words (arguments to a command in Tcl dialect) + format = "%s" if not script else "{%s}" + + opts = [] + for opt, value in mapdict.iteritems(): + + opt_val = [] + # each value in mapdict is expected to be a sequence, where each item + # is another sequence containing a state (or several) and a value + for statespec in value: + state, val = statespec[:-1], statespec[-1] + + if len(state) > 1: # group multiple states + state = "{%s}" % ' '.join(state) + else: # single state + # if it is empty (something that evaluates to False), then + # format it to Tcl code to denote the "normal" state + state = state[0] or '{}' + + if isinstance(val, (list, tuple)): # val needs to be grouped + val = "{%s}" % ' '.join(map(str, val)) + + opt_val.append("%s %s" % (state, val)) + + opts.append(("-%s" % opt, format % ' '.join(opt_val))) + + return _flatten(opts) + +def _format_elemcreate(etype, script=False, *args, **kw): + """Formats args and kw according to the given element factory etype.""" + spec = None + opts = () + if etype in ("image", "vsapi"): + if etype == "image": # define an element based on an image + # first arg should be the default image name + iname = args[0] + # next args, if any, are statespec/value pairs which is almost + # a mapdict, but we just need the value + imagespec = _format_mapdict({None: args[1:]})[1] + spec = "%s %s" % (iname, imagespec) + + else: + # define an element whose visual appearance is drawn using the + # Microsoft Visual Styles API which is responsible for the + # themed styles on Windows XP and Vista. + # Availability: Tk 8.6, Windows XP and Vista. + class_name, part_id = args[:2] + statemap = _format_mapdict({None: args[2:]})[1] + spec = "%s %s %s" % (class_name, part_id, statemap) + + opts = _format_optdict(kw, script) + + elif etype == "from": # clone an element + # it expects a themename and optionally an element to clone from, + # otherwise it will clone {} (empty element) + spec = args[0] # theme name + if len(args) > 1: # elementfrom specified + opts = (args[1], ) + + if script: + spec = '{%s}' % spec + opts = ' '.join(map(str, opts)) + + return spec, opts + +def _format_layoutlist(layout, indent=0, indent_size=2): + """Formats a layout list so we can pass the result to ttk::style + layout and ttk::style settings. Note that the layout doesn't has to + be a list necessarily. + + E.g.: + [("Menubutton.background", None), + ("Menubutton.button", {"children": + [("Menubutton.focus", {"children": + [("Menubutton.padding", {"children": + [("Menubutton.label", {"side": "left", "expand": 1})] + })] + })] + }), + ("Menubutton.indicator", {"side": "right"}) + ] + + returns: + + Menubutton.background + Menubutton.button -children { + Menubutton.focus -children { + Menubutton.padding -children { + Menubutton.label -side left -expand 1 + } + } + } + Menubutton.indicator -side right""" + script = [] + + for layout_elem in layout: + elem, opts = layout_elem + opts = opts or {} + fopts = ' '.join(map(str, _format_optdict(opts, True, "children"))) + head = "%s%s%s" % (' ' * indent, elem, (" %s" % fopts) if fopts else '') + + if "children" in opts: + script.append(head + " -children {") + indent += indent_size + newscript, indent = _format_layoutlist(opts['children'], indent, + indent_size) + script.append(newscript) + indent -= indent_size + script.append('%s}' % (' ' * indent)) + else: + script.append(head) + + return '\n'.join(script), indent + +def _script_from_settings(settings): + """Returns an appropriate script, based on settings, according to + theme_settings definition to be used by theme_settings and + theme_create.""" + script = [] + # a script will be generated according to settings passed, which + # will then be evaluated by Tcl + for name, opts in settings.iteritems(): + # will format specific keys according to Tcl code + if opts.get('configure'): # format 'configure' + s = ' '.join(map(unicode, _format_optdict(opts['configure'], True))) + script.append("ttk::style configure %s %s;" % (name, s)) + + if opts.get('map'): # format 'map' + s = ' '.join(map(unicode, _format_mapdict(opts['map'], True))) + script.append("ttk::style map %s %s;" % (name, s)) + + if 'layout' in opts: # format 'layout' which may be empty + if not opts['layout']: + s = 'null' # could be any other word, but this one makes sense + else: + s, _ = _format_layoutlist(opts['layout']) + script.append("ttk::style layout %s {\n%s\n}" % (name, s)) + + if opts.get('element create'): # format 'element create' + eopts = opts['element create'] + etype = eopts[0] + + # find where args end, and where kwargs start + argc = 1 # etype was the first one + while argc < len(eopts) and not hasattr(eopts[argc], 'iteritems'): + argc += 1 + + elemargs = eopts[1:argc] + elemkw = eopts[argc] if argc < len(eopts) and eopts[argc] else {} + spec, opts = _format_elemcreate(etype, True, *elemargs, **elemkw) + + script.append("ttk::style element create %s %s %s %s" % ( + name, etype, spec, opts)) + + return '\n'.join(script) + +def _dict_from_tcltuple(ttuple, cut_minus=True): + """Break tuple in pairs, format it properly, then build the return + dict. If cut_minus is True, the supposed '-' prefixing options will + be removed. + + ttuple is expected to contain an even number of elements.""" + opt_start = 1 if cut_minus else 0 + + retdict = {} + it = iter(ttuple) + for opt, val in zip(it, it): + retdict[str(opt)[opt_start:]] = val + + return tclobjs_to_py(retdict) + +def _list_from_statespec(stuple): + """Construct a list from the given statespec tuple according to the + accepted statespec accepted by _format_mapdict.""" + nval = [] + for val in stuple: + typename = getattr(val, 'typename', None) + if typename is None: + nval.append(val) + else: # this is a Tcl object + val = str(val) + if typename == 'StateSpec': + val = val.split() + nval.append(val) + + it = iter(nval) + return [_flatten(spec) for spec in zip(it, it)] + +def _list_from_layouttuple(ltuple): + """Construct a list from the tuple returned by ttk::layout, this is + somewhat the reverse of _format_layoutlist.""" + res = [] + + indx = 0 + while indx < len(ltuple): + name = ltuple[indx] + opts = {} + res.append((name, opts)) + indx += 1 + + while indx < len(ltuple): # grab name's options + opt, val = ltuple[indx:indx + 2] + if not opt.startswith('-'): # found next name + break + + opt = opt[1:] # remove the '-' from the option + indx += 2 + + if opt == 'children': + val = _list_from_layouttuple(val) + + opts[opt] = val + + return res + +def _val_or_dict(options, func, *args): + """Format options then call func with args and options and return + the appropriate result. + + If no option is specified, a dict is returned. If a option is + specified with the None value, the value for that option is returned. + Otherwise, the function just sets the passed options and the caller + shouldn't be expecting a return value anyway.""" + options = _format_optdict(options) + res = func(*(args + options)) + + if len(options) % 2: # option specified without a value, return its value + return res + + return _dict_from_tcltuple(res) + +def _convert_stringval(value): + """Converts a value to, hopefully, a more appropriate Python object.""" + value = unicode(value) + try: + value = int(value) + except (ValueError, TypeError): + pass + + return value + +def tclobjs_to_py(adict): + """Returns adict with its values converted from Tcl objects to Python + objects.""" + for opt, val in adict.iteritems(): + if val and hasattr(val, '__len__') and not isinstance(val, basestring): + if getattr(val[0], 'typename', None) == 'StateSpec': + val = _list_from_statespec(val) + else: + val = map(_convert_stringval, val) + + elif hasattr(val, 'typename'): # some other (single) Tcl object + val = _convert_stringval(val) + + adict[opt] = val + + return adict + + +class Style(object): + """Manipulate style database.""" + + _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") + + self.master = master + self.tk = self.master.tk + + + def configure(self, style, query_opt=None, **kw): + """Query or sets the default value of the specified option(s) in + style. + + Each key in kw is an option and each value is either a string or + a sequence identifying the value for that option.""" + if query_opt is not None: + kw[query_opt] = None + return _val_or_dict(kw, self.tk.call, self._name, "configure", style) + + + def map(self, style, query_opt=None, **kw): + """Query or sets dynamic values of the specified option(s) in + style. + + Each key in kw is an option and each value should be a list or a + tuple (usually) containing statespecs grouped in tuples, or list, + or something else of your preference. A statespec is compound of + one or more states and then a value.""" + if query_opt is not None: + return _list_from_statespec( + self.tk.call(self._name, "map", style, '-%s' % query_opt)) + + return _dict_from_tcltuple( + self.tk.call(self._name, "map", style, *(_format_mapdict(kw)))) + + + def lookup(self, style, option, state=None, default=None): + """Returns the value specified for option in style. + + If state is specified it is expected to be a sequence of one + or more states. If the default argument is set, it is used as + a fallback value in case no specification for option is found.""" + state = ' '.join(state) if state else '' + + return self.tk.call(self._name, "lookup", style, '-%s' % option, + state, default) + + + def layout(self, style, layoutspec=None): + """Define the widget layout for given style. If layoutspec is + omitted, return the layout specification for given style. + + layoutspec is expected to be a list or an object different than + None that evaluates to False if you want to "turn off" that style. + If it is a list (or tuple, or something else), each item should be + a tuple where the first item is the layout name and the second item + should have the format described below: + + LAYOUTS + + A layout can contain the value None, if takes no options, or + a dict of options specifying how to arrange the element. + The layout mechanism uses a simplified version of the pack + geometry manager: given an initial cavity, each element is + allocated a parcel. Valid options/values are: + + side: whichside + Specifies which side of the cavity to place the + element; one of top, right, bottom or left. If + omitted, the element occupies the entire cavity. + + sticky: nswe + Specifies where the element is placed inside its + allocated parcel. + + children: [sublayout... ] + Specifies a list of elements to place inside the + element. Each element is a tuple (or other sequence) + where the first item is the layout name, and the other + is a LAYOUT.""" + lspec = None + if layoutspec: + lspec = _format_layoutlist(layoutspec)[0] + elif layoutspec is not None: # will disable the layout ({}, '', etc) + lspec = "null" # could be any other word, but this may make sense + # when calling layout(style) later + + return _list_from_layouttuple( + self.tk.call(self._name, "layout", style, lspec)) + + + def element_create(self, elementname, etype, *args, **kw): + """Create a new element in the current theme of given etype.""" + spec, opts = _format_elemcreate(etype, False, *args, **kw) + self.tk.call(self._name, "element", "create", elementname, etype, + spec, *opts) + + + def element_names(self): + """Returns the list of elements defined in the current theme.""" + return self.tk.call(self._name, "element", "names") + + + def element_options(self, elementname): + """Return the list of elementname's options.""" + return self.tk.call(self._name, "element", "options", elementname) + + + def theme_create(self, themename, parent=None, settings=None): + """Creates a new theme. + + It is an error if themename already exists. If parent is + specified, the new theme will inherit styles, elements and + layouts from the specified parent theme. If settings are present, + they are expected to have the same syntax used for theme_settings.""" + script = _script_from_settings(settings) if settings else '' + + if parent: + self.tk.call(self._name, "theme", "create", themename, + "-parent", parent, "-settings", script) + else: + self.tk.call(self._name, "theme", "create", themename, + "-settings", script) + + + def theme_settings(self, themename, settings): + """Temporarily sets the current theme to themename, apply specified + settings and then restore the previous theme. + + Each key in settings is a style and each value may contain the + keys 'configure', 'map', 'layout' and 'element create' and they + are expected to have the same format as specified by the methods + configure, map, layout and element_create respectively.""" + script = _script_from_settings(settings) + self.tk.call(self._name, "theme", "settings", themename, script) + + + def theme_names(self): + """Returns a list of all known themes.""" + return self.tk.call(self._name, "theme", "names") + + + def theme_use(self, themename=None): + """If themename is None, returns the theme in use, otherwise, set + the current theme to themename, refreshes all widgets and emits + a <> event.""" + if themename is None: + # Starting on Tk 8.6, checking this global is no longer needed + # since it allows doing self.tk.call(self._name, "theme", "use") + return self.tk.eval("return $ttk::currentTheme") + + # using "ttk::setTheme" instead of "ttk::style theme use" causes + # the variable currentTheme to be updated, also, ttk::setTheme calls + # "ttk::style theme use" in order to change theme. + self.tk.call("ttk::setTheme", themename) + + +class Widget(Tkinter.Widget): + """Base class for Tk themed widgets.""" + + def __init__(self, master, widgetname, kw=None): + """Constructs a Ttk Widget with the parent master. + + STANDARD OPTIONS + + class, cursor, takefocus, style + + SCROLLABLE WIDGET OPTIONS + + xscrollcommand, yscrollcommand + + LABEL WIDGET OPTIONS + + text, textvariable, underline, image, compound, width + + WIDGET STATES + + active, disabled, focus, pressed, selected, background, + readonly, alternate, invalid + """ + Tkinter.Widget.__init__(self, master, widgetname, kw=kw) + + + def identify(self, x, y): + """Returns the name of the element at position x, y, or the empty + string if the point does not lie within any element. + + x and y are pixel coordinates relative to the widget.""" + return self.tk.call(self._w, "identify", x, y) + + + def instate(self, statespec, callback=None, *args, **kw): + """Test the widget's state. + + If callback is not specified, returns True if the widget state + matches statespec and False otherwise. If callback is specified, + then it will be invoked with *args, **kw if the widget state + matches statespec. statespec is expected to be a sequence.""" + ret = self.tk.call(self._w, "instate", ' '.join(statespec)) + if ret and callback: + return callback(*args, **kw) + + return bool(ret) + + + def state(self, statespec=None): + """Modify or inquire widget state. + + Widget state is returned if statespec is None, otherwise it is + set according to the statespec flags and then a new state spec + is returned indicating which flags were changed. statespec is + expected to be a sequence.""" + if statespec is not None: + statespec = ' '.join(statespec) + + return self.tk.splitlist(str(self.tk.call(self._w, "state", statespec))) + + +class Button(Widget): + """Ttk Button widget, displays a textual label and/or image, and + evaluates a command when pressed.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Button widget with the parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + command, default, width + """ + Widget.__init__(self, master, "ttk::button", kw) + + + def invoke(self): + """Invokes the command associated with the button.""" + return self.tk.call(self._w, "invoke") + + +class Checkbutton(Widget): + """Ttk Checkbutton widget which is either in on- or off-state.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Checkbutton widget with the parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + command, offvalue, onvalue, variable + """ + Widget.__init__(self, master, "ttk::checkbutton", kw) + + + def invoke(self): + """Toggles between the selected and deselected states and + invokes the associated command. If the widget is currently + selected, sets the option variable to the offvalue option + and deselects the widget; otherwise, sets the option variable + to the option onvalue. + + Returns the result of the associated command.""" + return self.tk.call(self._w, "invoke") + + +class Entry(Widget, Tkinter.Entry): + """Ttk Entry widget displays a one-line text string and allows that + string to be edited by the user.""" + + def __init__(self, master=None, widget=None, **kw): + """Constructs a Ttk Entry widget with the parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus, xscrollcommand + + WIDGET-SPECIFIC OPTIONS + + exportselection, invalidcommand, justify, show, state, + textvariable, validate, validatecommand, width + + VALIDATION MODES + + none, key, focus, focusin, focusout, all + """ + Widget.__init__(self, master, widget or "ttk::entry", kw) + + + def bbox(self, index): + """Return a tuple of (x, y, width, height) which describes the + bounding box of the character given by index.""" + return self.tk.call(self._w, "bbox", index) + + + def identify(self, x, y): + """Returns the name of the element at position x, y, or the + empty string if the coordinates are outside the window.""" + return self.tk.call(self._w, "identify", x, y) + + + def validate(self): + """Force revalidation, independent of the conditions specified + by the validate option. Returns False if validation fails, True + if it succeeds. Sets or clears the invalid state accordingly.""" + return bool(self.tk.call(self._w, "validate")) + + +class Combobox(Entry): + """Ttk Combobox widget combines a text field with a pop-down list of + values.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Combobox widget with the parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + exportselection, justify, height, postcommand, state, + textvariable, values, width + """ + # The "values" option may need special formatting, so leave to + # _format_optdict the responsability to format it + if "values" in kw: + kw["values"] = _format_optdict({'v': kw["values"]})[1] + + Entry.__init__(self, master, "ttk::combobox", **kw) + + + def __setitem__(self, item, value): + if item == "values": + value = _format_optdict({item: value})[1] + + Entry.__setitem__(self, item, value) + + + def configure(self, cnf=None, **kw): + """Custom Combobox configure, created to properly format the values + option.""" + if "values" in kw: + kw["values"] = _format_optdict({'v': kw["values"]})[1] + + return Entry.configure(self, cnf, **kw) + + + def current(self, newindex=None): + """If newindex is supplied, sets the combobox value to the + element at position newindex in the list of values. Otherwise, + returns the index of the current value in the list of values + or -1 if the current value does not appear in the list.""" + return self.tk.call(self._w, "current", newindex) + + + def set(self, value): + """Sets the value of the combobox to value.""" + self.tk.call(self._w, "set", value) + + +class Frame(Widget): + """Ttk Frame widget is a container, used to group other widgets + together.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Frame with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + borderwidth, relief, padding, width, height + """ + Widget.__init__(self, master, "ttk::frame", kw) + + +class Label(Widget): + """Ttk Label widget displays a textual label and/or image.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Label with parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, style, takefocus, text, + textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + anchor, background, font, foreground, justify, padding, + relief, text, wraplength + """ + Widget.__init__(self, master, "ttk::label", kw) + + +class Labelframe(Widget): + """Ttk Labelframe widget is a container used to group other widgets + together. It has an optional label, which may be a plain text string + or another widget.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Labelframe with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + labelanchor, text, underline, padding, labelwidget, width, + height + """ + Widget.__init__(self, master, "ttk::labelframe", kw) + +LabelFrame = Labelframe # Tkinter name compatibility + + +class Menubutton(Widget): + """Ttk Menubutton widget displays a textual label and/or image, and + displays a menu when pressed.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Menubutton with parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + direction, menu + """ + Widget.__init__(self, master, "ttk::menubutton", kw) + + +class Notebook(Widget): + """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.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Notebook with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + height, padding, width + + TAB OPTIONS + + state, sticky, padding, text, image, compound, underline + + TAB IDENTIFIERS (tab_id) + + The tab_id argument found in several methods 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 + defines the tab + * The string "current", which identifies the + currently-selected tab + * The string "end", which returns the number of tabs (only + valid for method index) + """ + Widget.__init__(self, master, "ttk::notebook", kw) + + + def add(self, child, **kw): + """Adds a new tab to the notebook. + + If window is currently managed by the notebook but hidden, it is + restored to its previous position.""" + self.tk.call(self._w, "add", child, *(_format_optdict(kw))) + + + def forget(self, tab_id): + """Removes the tab specified by tab_id, unmaps and unmanages the + associated window.""" + self.tk.call(self._w, "forget", tab_id) + + + def hide(self, tab_id): + """Hides the tab specified by tab_id. + + The tab will not be displayed, but the associated window remains + managed by the notebook and its configuration remembered. Hidden + tabs may be restored with the add command.""" + self.tk.call(self._w, "hide", tab_id) + + + def identify(self, x, y): + """Returns the name of the tab element at position x, y, or the + empty string if none.""" + return self.tk.call(self._w, "identify", x, y) + + + def index(self, tab_id): + """Returns the numeric index of the tab specified by tab_id, or + the total number of tabs if tab_id is the string "end".""" + return self.tk.call(self._w, "index", tab_id) + + + def insert(self, pos, child, **kw): + """Inserts a pane at the specified position. + + pos is either the string end, an integer index, or the name of + a managed child. If child is already managed by the notebook, + moves it to the specified position.""" + self.tk.call(self._w, "insert", pos, child, *(_format_optdict(kw))) + + + def select(self, tab_id=None): + """Selects the specified tab. + + The associated child window will be displayed, and the + previously-selected window (if different) is unmapped. If tab_id + is omitted, returns the widget name of the currently selected + pane.""" + return self.tk.call(self._w, "select", tab_id) + + + def tab(self, tab_id, option=None, **kw): + """Query or modify the options of the specific tab_id. + + If kw is not given, returns a dict of the tab option values. If option + is specified, returns the value of that option. Otherwise, sets the + options to the corresponding values.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "tab", tab_id) + + + def tabs(self): + """Returns a list of windows managed by the notebook.""" + return self.tk.call(self._w, "tabs") or () + + + def enable_traversal(self): + """Enable keyboard traversal for a toplevel window containing + this notebook. + + This will extend the bindings for the toplevel window containing + this notebook as follows: + + Control-Tab: selects the tab following the currently selected + one + + Shift-Control-Tab: selects the tab preceding the currently + selected one + + Alt-K: where K is the mnemonic (underlined) character of any + tab, will select that tab. + + Multiple notebooks in a single toplevel may be enabled for + traversal, including nested notebooks. However, notebook traversal + only works properly if all panes are direct children of the + notebook.""" + # The only, and good, difference I see is about mnemonics, which works + # after calling this method. Control-Tab and Shift-Control-Tab always + # works (here at least). + self.tk.call("ttk::notebook::enableTraversal", self._w) + + +class Panedwindow(Widget, Tkinter.PanedWindow): + """Ttk Panedwindow widget displays a number of subwindows, stacked + either vertically or horizontally.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Panedwindow with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + orient, width, height + + PANE OPTIONS + + weight + """ + Widget.__init__(self, master, "ttk::panedwindow", kw) + + + forget = Tkinter.PanedWindow.forget # overrides Pack.forget + + + def insert(self, pos, child, **kw): + """Inserts a pane at the specified positions. + + pos is either the string end, and integer index, or the name + of a child. If child is already managed by the paned window, + moves it to the specified position.""" + self.tk.call(self._w, "insert", pos, child, *(_format_optdict(kw))) + + + def pane(self, pane, option=None, **kw): + """Query or modify the options of the specified pane. + + pane is either an integer index or the name of a managed subwindow. + If kw is not given, returns a dict of the pane option values. If + option is specified then the value for that option is returned. + Otherwise, sets the options to the correspoding values.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "pane", pane) + + + def sashpos(self, index, newpos=None): + """If newpos is specified, sets the position of sash number index. + + May adjust the positions of adjacent sashes to ensure that + positions are monotonically increasing. Sash positions are further + constrained to be between 0 and the total size of the widget. + + Returns the new position of sash number index.""" + return self.tk.call(self._w, "sashpos", index, newpos) + +PanedWindow = Panedwindow # Tkinter name compatibility + + +class Progressbar(Widget): + """Ttk Progressbar widget shows the status of a long-running + operation. They can operate in two modes: determinate mode shows the + amount completed relative to the total amount of work to be done, and + indeterminate mode provides an animated display to let the user know + that something is happening.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Progressbar with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + orient, length, mode, maximum, value, variable, phase + """ + Widget.__init__(self, master, "ttk::progressbar", kw) + + + def start(self, interval=None): + """Begin autoincrement mode: schedules a recurring timer event + that calls method step every interval milliseconds. + + interval defaults to 50 milliseconds (20 steps/second) if ommited.""" + self.tk.call(self._w, "start", interval) + + + def step(self, amount=None): + """Increments the value option by amount. + + amount defaults to 1.0 if omitted.""" + self.tk.call(self._w, "step", amount) + + + def stop(self): + """Stop autoincrement mode: cancels any recurring timer event + initiated by start.""" + self.tk.call(self._w, "stop") + + +class Radiobutton(Widget): + """Ttk Radiobutton widgets are used in groups to show or change a + set of mutually-exclusive options.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Radiobutton with parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + command, value, variable + """ + Widget.__init__(self, master, "ttk::radiobutton", kw) + + + def invoke(self): + """Sets the option variable to the option value, selects the + widget, and invokes the associated command. + + Returns the result of the command, or an empty string if + no command is specified.""" + return self.tk.call(self._w, "invoke") + + +class Scale(Widget, Tkinter.Scale): + """Ttk Scale widget is typically used to control the numeric value of + a linked variable that varies uniformly over some range.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Scale with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + command, from, length, orient, to, value, variable + """ + Widget.__init__(self, master, "ttk::scale", kw) + + + def configure(self, cnf=None, **kw): + """Modify or query scale options. + + Setting a value for any of the "from", "from_" or "to" options + generates a <> event.""" + if cnf: + kw.update(cnf) + Widget.configure(self, **kw) + if any(['from' in kw, 'from_' in kw, 'to' in kw]): + self.event_generate('<>') + + + def get(self, x=None, y=None): + """Get the current value of the value option, or the value + corresponding to the coordinates x, y if they are specified. + + x and y are pixel coordinates relative to the scale widget + origin.""" + return self.tk.call(self._w, 'get', x, y) + + +class Scrollbar(Widget, Tkinter.Scrollbar): + """Ttk Scrollbar controls the viewport of a scrollable widget.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Scrollbar with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + command, orient + """ + Widget.__init__(self, master, "ttk::scrollbar", kw) + + +class Separator(Widget): + """Ttk Separator widget displays a horizontal or vertical separator + bar.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Separator with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + orient + """ + Widget.__init__(self, master, "ttk::separator", kw) + + +class Sizegrip(Widget): + """Ttk Sizegrip allows the user to resize the containing toplevel + window by pressing and dragging the grip.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Sizegrip with parent master. + + STANDARD OPTIONS + + class, cursor, state, style, takefocus + """ + Widget.__init__(self, master, "ttk::sizegrip", kw) + + +class Treeview(Widget): + """Ttk Treeview widget displays a hierarchical collection of items. + + Each item has a textual label, an optional image, and an optional list + of data values. The data values are displayed in successive columns + after the tree label.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Treeview with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus, xscrollcommand, + yscrollcommand + + WIDGET-SPECIFIC OPTIONS + + columns, displaycolumns, height, padding, selectmode, show + + ITEM OPTIONS + + text, image, values, open, tags + + TAG OPTIONS + + foreground, background, font, image + """ + Widget.__init__(self, master, "ttk::treeview", kw) + + + def bbox(self, item, column=None): + """Returns the bounding box (relative to the treeview widget's + window) of the specified item in the form x y width height. + + If column is specified, returns the bounding box of that cell. + If the item is not visible (i.e., if it is a descendant of a + closed item or is scrolled offscreen), returns an empty string.""" + return self.tk.call(self._w, "bbox", item, column) + + + def get_children(self, item=None): + """Returns a tuple of children belonging to item. + + If item is not specified, returns root children.""" + return self.tk.call(self._w, "children", item or '') or () + + + def set_children(self, item, *newchildren): + """Replaces item's child with newchildren. + + Children present in item that are not present in newchildren + are detached from tree. No items in newchildren may be an + ancestor of item.""" + self.tk.call(self._w, "children", item, newchildren) + + + def column(self, column, option=None, **kw): + """Query or modify the options for the specified column. + + If kw is not given, returns a dict of the column option values. If + option is specified then the value for that option is returned. + Otherwise, sets the options to the corresponding values.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "column", column) + + + def delete(self, *items): + """Delete all specified items and all their descendants. The root + item may not be deleted.""" + self.tk.call(self._w, "delete", items) + + + def detach(self, *items): + """Unlinks all of the specified items from the tree. + + The items and all of their descendants are still present, and may + be reinserted at another point in the tree, but will not be + displayed. The root item may not be detached.""" + self.tk.call(self._w, "detach", items) + + + def exists(self, item): + """Returns True if the specified item is present in the three, + False otherwise.""" + return bool(self.tk.call(self._w, "exists", item)) + + + def focus(self, item=None): + """If item is specified, sets the focus item to item. Otherwise, + returns the current focus item, or '' if there is none.""" + return self.tk.call(self._w, "focus", item) + + + def heading(self, column, option=None, **kw): + """Query or modify the heading options for the specified column. + + If kw is not given, returns a dict of the heading option values. If + option is specified then the value for that option is returned. + Otherwise, sets the options to the corresponding values. + + Valid options/values are: + text: text + The text to display in the column heading + image: image_name + Specifies an image to display to the right of the column + heading + anchor: anchor + Specifies how the heading text should be aligned. One of + the standard Tk anchor values + command: callback + A callback to be invoked when the heading label is + pressed. + + To configure the tree column heading, call this with column = "#0" """ + cmd = kw.get('command') + if cmd and not isinstance(cmd, basestring): + # callback not registered yet, do it now + kw['command'] = self.master.register(cmd, self._substitute) + + if option is not None: + kw[option] = None + + return _val_or_dict(kw, self.tk.call, self._w, 'heading', column) + + + def identify(self, component, x, y): + """Returns a description of the specified component under the + point given by x and y, or the empty string if no such component + is present at that position.""" + return self.tk.call(self._w, "identify", component, x, y) + + + def identify_row(self, y): + """Returns the item ID of the item at position y.""" + return self.identify("row", 0, y) + + + def identify_column(self, x): + """Returns the data column identifier of the cell at position x. + + The tree column has ID #0.""" + return self.identify("column", x, 0) + + + def identify_region(self, x, y): + """Returns one of: + + heading: Tree heading area. + separator: Space between two columns headings; + tree: The tree area. + cell: A data cell. + + * Availability: Tk 8.6""" + return self.identify("region", x, y) + + + def identify_element(self, x, y): + """Returns the element at position x, y. + + * Availability: Tk 8.6""" + return self.identify("element", x, y) + + + def index(self, item): + """Returns the integer index of item within its parent's list + of children.""" + return self.tk.call(self._w, "index", item) + + + def insert(self, parent, index, iid=None, **kw): + """Creates a new item and return the item identifier of the newly + created item. + + parent is the item ID of the parent item, or the empty string + to create a new top-level item. index is an integer, or the value + end, specifying where in the list of parent's children to insert + the new item. If index is less than or equal to zero, the new node + is inserted at the beginning, if index is greater than or equal to + the current number of children, it is inserted at the end. If iid + is specified, it is used as the item identifier, iid must not + already exist in the tree. Otherwise, a new unique identifier + is generated.""" + opts = _format_optdict(kw) + if iid: + res = self.tk.call(self._w, "insert", parent, index, + "-id", iid, *opts) + else: + res = self.tk.call(self._w, "insert", parent, index, *opts) + + return res + + + def item(self, item, option=None, **kw): + """Query or modify the options for the specified item. + + If no options are given, a dict with options/values for the item + is returned. If option is specified then the value for that option + is returned. Otherwise, sets the options to the corresponding + values as given by kw.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "item", item) + + + def move(self, item, parent, index): + """Moves item to position index in parent's list of children. + + It is illegal to move an item under one of its descendants. If + index is less than or equal to zero, item is moved to the + beginning, if greater than or equal to the number of children, + it is moved to the end. If item was detached it is reattached.""" + self.tk.call(self._w, "move", item, parent, index) + + reattach = move # A sensible method name for reattaching detached items + + + def next(self, item): + """Returns the identifier of item's next sibling, or '' if item + is the last child of its parent.""" + return self.tk.call(self._w, "next", item) + + + def parent(self, item): + """Returns the ID of the parent of item, or '' if item is at the + top level of the hierarchy.""" + return self.tk.call(self._w, "parent", item) + + + def prev(self, item): + """Returns the identifier of item's previous sibling, or '' if + item is the first child of its parent.""" + return self.tk.call(self._w, "prev", item) + + + def see(self, item): + """Ensure that item is visible. + + Sets all of item's ancestors open option to True, and scrolls + the widget if necessary so that item is within the visible + portion of the tree.""" + self.tk.call(self._w, "see", item) + + + def selection(self, selop=None, items=None): + """If selop is not specified, returns selected items.""" + return self.tk.call(self._w, "selection", selop, items) + + + def selection_set(self, items): + """items becomes the new selection.""" + self.selection("set", items) + + + def selection_add(self, items): + """Add items to the selection.""" + self.selection("add", items) + + + def selection_remove(self, items): + """Remove items from the selection.""" + self.selection("remove", items) + + + def selection_toggle(self, items): + """Toggle the selection state of each item in items.""" + self.selection("toggle", items) + + + def set(self, item, column=None, value=None): + """With one argument, returns a dictionary of column/value pairs + for the specified item. With two arguments, returns the current + value of the specified column. With three arguments, sets the + value of given column in given item to the specified value.""" + res = self.tk.call(self._w, "set", item, column, value) + if column is None and value is None: + return _dict_from_tcltuple(res, False) + else: + return res + + + def tag_bind(self, tagname, sequence=None, callback=None): + """Bind a callback for the given event sequence to the tag tagname. + When an event is delivered to an item, the callbacks for each + of the item's tags option are called.""" + self._bind((self._w, "tag", "bind", tagname), sequence, callback, add=0) + + + def tag_configure(self, tagname, option=None, **kw): + """Query or modify the options for the specified tagname. + + If kw is not given, returns a dict of the option settings for tagname. + If option is specified, returns the value for that option for the + specified tagname. Otherwise, sets the options to the corresponding + values for the given tagname.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "tag", "configure", + tagname) + + + def tag_has(self, tagname, item=None): + """If item is specified, returns 1 or 0 depending on whether the + specified item has the given tagname. Otherwise, returns a list of + all items which have the specified tag. + + * Availability: Tk 8.6""" + return self.tk.call(self._w, "tag", "has", tagname, item) + + + def xview(self, *args): + """Query or modify horizontal position of the treeview.""" + return self.tk.call(self._w, "xview", *args) + + + def yview(self, *args): + """Query or modify vertical position of the treeview.""" + return self.tk.call(self._w, "yview", *args) + + +# Extensions + +class LabeledScale(Frame, object): + """A Ttk Scale widget with a Ttk Label widget indicating its + current value. + + The Ttk Scale can be accessed through instance.scale, and Ttk Label + can be accessed through instance.label""" + + def __init__(self, master=None, variable=None, from_=0, to=10, **kw): + """Construct an horizontal LabeledScale with parent master, a + variable to be associated with the Ttk Scale widget and its range. + If variable is not specified, a Tkinter.IntVar is created. + + WIDGET-SPECIFIC OPTIONS + + compound: 'top' or 'bottom' + Specifies how to display the label relative to the scale. + Defaults to 'top'. + """ + self._label_top = kw.pop('compound', 'top') == 'top' + + Frame.__init__(self, master, **kw) + self._variable = variable or Tkinter.IntVar(master) + self._variable.set(from_) + self._last_valid = from_ + + self.label = Label(self) + self.scale = Scale(self, variable=self._variable, from_=from_, to=to) + self.scale.bind('<>', self._adjust) + + # position scale and label according to the compound option + scale_side = 'bottom' if self._label_top else 'top' + label_side = 'top' if scale_side == 'bottom' else 'bottom' + self.scale.pack(side=scale_side, fill='x') + tmp = Label(self).pack(side=label_side) # place holder + self.label.place(anchor='n' if label_side == 'top' else 's') + + # update the label as scale or variable changes + self.__tracecb = self._variable.trace_variable('w', self._adjust) + self.bind('', self._adjust) + self.bind('', self._adjust) + + + def destroy(self): + """Destroy this widget and possibly its associated variable.""" + try: + self._variable.trace_vdelete('w', self.__tracecb) + except AttributeError: + # widget has been destroyed already + pass + else: + del self._variable + Frame.destroy(self) + + + def _adjust(self, *args): + """Adjust the label position according to the scale.""" + def adjust_label(): + self.update_idletasks() # "force" scale redraw + + x, y = self.scale.coords() + if self._label_top: + y = self.scale.winfo_y() - self.label.winfo_reqheight() + else: + y = self.scale.winfo_reqheight() + self.label.winfo_reqheight() + + self.label.place_configure(x=x, y=y) + + from_, to = self.scale['from'], self.scale['to'] + if to < from_: + from_, to = to, from_ + newval = self._variable.get() + if not from_ <= newval <= to: + # value outside range, set value back to the last valid one + self.value = self._last_valid + return + + self._last_valid = newval + self.label['text'] = newval + self.after_idle(adjust_label) + + + def _get_value(self): + """Return current scale value.""" + return self._variable.get() + + + def _set_value(self, val): + """Set new scale value.""" + self._variable.set(val) + + + value = property(_get_value, _set_value) + + +class OptionMenu(Menubutton): + """Themed OptionMenu, based after Tkinter's OptionMenu, which allows + the user to select a value from a menu.""" + + def __init__(self, master, variable, default=None, *values, **kwargs): + """Construct a themed OptionMenu widget with master as the parent, + the resource textvariable set to variable, the initially selected + value specified by the default parameter, the menu values given by + *values and additional keywords. + + WIDGET-SPECIFIC OPTIONS + + style: stylename + Menubutton style. + direction: 'above', 'below', 'left', 'right', or 'flush' + Menubutton direction. + command: callback + A callback that will be invoked after selecting an item. + """ + kw = {'textvariable': variable, 'style': kwargs.pop('style', None), + 'direction': kwargs.pop('direction', None)} + Menubutton.__init__(self, master, **kw) + self['menu'] = Tkinter.Menu(self, tearoff=False) + + self._variable = variable + self._callback = kwargs.pop('command', None) + if kwargs: + raise Tkinter.TclError('unknown option -%s' % ( + kwargs.iterkeys().next())) + + self.set_menu(default, *values) + + + def __getitem__(self, item): + if item == 'menu': + return self.nametowidget(Menubutton.__getitem__(self, item)) + + return Menubutton.__getitem__(self, item) + + + def set_menu(self, default=None, *values): + """Build a new menu of radiobuttons with *values and optionally + a default value.""" + menu = self['menu'] + menu.delete(0, 'end') + for val in values: + menu.add_radiobutton(label=val, + command=Tkinter._setit(self._variable, val, self._callback)) + + if default: + self._variable.set(default) + + + def destroy(self): + """Destroy this widget and its associated variable.""" + del self._variable + Menubutton.destroy(self) Added: python/trunk/Lib/test/test_tk_guionly.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_tk_guionly.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,23 @@ +import os +import sys +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)) + +if __name__ == '__main__': + test_main(enable_gui=True) Added: python/trunk/Lib/test/test_tk_textonly.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_tk_textonly.py Wed Jan 28 14:09:03 2009 @@ -0,0 +1,16 @@ +import os +import sys +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, '..', 'lib-tk', 'test')) +if lib_tk_test not in sys.path: + sys.path.append(lib_tk_test) + +import runtktests + +def test_main(): + test_support.run_unittest(*runtktests.get_tests(gui=False)) + +if __name__ == '__main__': + test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 28 14:09:03 2009 @@ -145,6 +145,8 @@ Library ------- +- Added the ttk module. See issue #2983: Ttk support for Tkinter. + - Issue 5021: doctest.testfile() did not create __name__ and collections.namedtuple() relied on __name__ being defined. From buildbot at python.org Wed Jan 28 14:54:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 13:54:37 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090128135437.7C1071E4016@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/776 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 failed slave lost sincerely, -The Buildbot From python-checkins at python.org Wed Jan 28 15:41:11 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 15:41:11 +0100 (CET) Subject: [Python-checkins] r69051 - in python/branches/py3k: Doc/library/tk.rst Doc/library/tkinter.ttk.rst Lib/test/test_tk_guionly.py Lib/test/test_tk_textonly.py Lib/tkinter/test Lib/tkinter/test/README Lib/tkinter/test/__init__.py Lib/tkinter/test/runtktests.py Lib/tkinter/test/support.py Lib/tkinter/test/test_ttk Lib/tkinter/test/test_ttk/__init__.py Lib/tkinter/test/test_ttk/test_extensions.py Lib/tkinter/test/test_ttk/test_functions.py Lib/tkinter/test/test_ttk/test_style.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/tkinter/ttk.py Misc/NEWS Message-ID: <20090128144111.876DE1E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 15:41:10 2009 New Revision: 69051 Log: 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. ........ Added: python/branches/py3k/Doc/library/tkinter.ttk.rst (contents, props changed) - copied, changed from r69050, /python/trunk/Doc/library/ttk.rst python/branches/py3k/Lib/test/test_tk_guionly.py - copied, changed from r69050, /python/trunk/Lib/test/test_tk_guionly.py python/branches/py3k/Lib/test/test_tk_textonly.py - copied, changed from r69050, /python/trunk/Lib/test/test_tk_textonly.py python/branches/py3k/Lib/tkinter/test/ python/branches/py3k/Lib/tkinter/test/README python/branches/py3k/Lib/tkinter/test/__init__.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/runtktests.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/support.py (contents, props changed) - copied, changed from r69050, /python/trunk/Lib/lib-tk/test/test_ttk/support.py python/branches/py3k/Lib/tkinter/test/test_ttk/ python/branches/py3k/Lib/tkinter/test/test_ttk/__init__.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/test_ttk/test_functions.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py (contents, props changed) python/branches/py3k/Lib/tkinter/ttk.py (contents, props changed) Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/tk.rst python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/tk.rst ============================================================================== --- python/branches/py3k/Doc/library/tk.rst (original) +++ python/branches/py3k/Doc/library/tk.rst Wed Jan 28 15:41:10 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 Copied: python/branches/py3k/Doc/library/tkinter.ttk.rst (from r69050, /python/trunk/Doc/library/ttk.rst) ============================================================================== --- /python/trunk/Doc/library/ttk.rst (original) +++ python/branches/py3k/Doc/library/tkinter.ttk.rst Wed Jan 28 15:41:10 2009 @@ -1,22 +1,23 @@ -:mod:`ttk` --- Tk themed widgets -================================ +:mod:`tkinter.ttk` --- Tk themed widgets +======================================== -.. module:: ttk +.. module:: tkinter.ttk :synopsis: Tk themed widget set .. sectionauthor:: Guilherme Polo .. index:: single: ttk -The :mod:`ttk` module provides access to the Tk themed widget set, which -has been introduced in Tk 8.5. If you do not have Python compiled against +The :mod:`tkinter.ttk` module provides access to the Tk themed widget set, +which has been introduced in Tk 8.5. If you do not have Python compiled against Tk 8.5 you may still use this module as long as you have Tile installed, but then you will miss some features provided by the new Tk, like anti-aliased font rendering under X11, window transparency (on X11 you will need a composition window manager) and others. -The basic idea of :mod:`ttk` is to separate, to the extent possible, the code -implementing a widget's behavior from the code implementing its appearance. +The basic idea of :mod:`tkinter.ttk` is to separate, to the extent possible, +the code implementing a widget's behavior from the code implementing its +appearance. .. seealso:: @@ -30,21 +31,22 @@ Basically, to start using Ttk, you have to import its module:: - import ttk + from tkinter import ttk But if you already have some code that does:: - from Tkinter import * + from tkinter import * You may optionally want to use:: - from Tkinter import * - from ttk import * + from tkinter import * + from tkinter.ttk import * -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 then several :mod:`tkinter.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. This has the direct benefit of using the new widgets which gives better look & feel across platforms, but you should be aware that they are not @@ -63,7 +65,7 @@ Ttk Widgets ----------- -Ttk comes with 17 widgets, where 11 of these already existed in Tkinter: +Ttk comes with 17 widgets, where 11 of these already existed 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 @@ -76,8 +78,8 @@ Tk code:: - l1 = Tkinter.Label(text="Test", fg="black", bg="white") - l2 = Tkinter.Label(text="Test", fg="black", bg="white") + l1 = tkinter.Label(text="Test", fg="black", bg="white") + l2 = tkinter.Label(text="Test", fg="black", bg="white") Ttk code:: @@ -248,7 +250,7 @@ ^^^^^^^^^^ Besides the methods described below, the class :class:`ttk.Widget` supports the -methods :meth:`Tkinter.Widget.cget` and :meth:`Tkinter.Widget.configure`. +methods :meth:`tkinter.Widget.cget` and :meth:`tkinter.Widget.configure`. .. class:: Widget @@ -324,7 +326,7 @@ | textvariable | Specifies a name whose value is linked to the widget | | | value. Whenever the value associated with that name | | | changes, the widget value is updated, and vice versa. | - | | See :class:`Tkinter.StringVar`. | + | | See :class:`tkinter.StringVar`. | +-----------------+--------------------------------------------------------+ | values | Specifies the list of values to display in the | | | drop-down listbox. | @@ -1165,10 +1167,10 @@ For example, to change every default button to be a flat button with some padding and a different background color you could do:: - import ttk - import Tkinter + from tkinter import ttk + import tkinter - root = Tkinter.Tk() + root = tkinter.Tk() ttk.Style().configure("TButton", padding=6, relief="flat", background="#ccc") @@ -1190,10 +1192,10 @@ An example may make it more understandable:: - import Tkinter - import ttk + import tkinter + from tkinter import ttk - root = Tkinter.Tk() + root = tkinter.Tk() style = ttk.Style() style.map("C.TButton", @@ -1224,7 +1226,7 @@ To check what font a Button uses by default, you would do:: - import ttk + from tkinter import ttk print ttk.Style().lookup("TButton", "font") @@ -1242,10 +1244,10 @@ To understand the format, check this example below (it is not intended to do anything useful):: - import ttk - import Tkinter + from tkinter import ttk + import tkinter - root = Tkinter.Tk() + root = tkinter.Tk() style = ttk.Style() style.layout("TMenubutton", [ @@ -1334,10 +1336,10 @@ As an example, lets change the Combobox for the default theme a bit:: - import ttk - import Tkinter + from tkinter import ttk + import tkinter - root = Tkinter.Tk() + root = tkinter.Tk() style = ttk.Style() style.theme_settings("default", { Copied: python/branches/py3k/Lib/test/test_tk_guionly.py (from r69050, /python/trunk/Lib/test/test_tk_guionly.py) ============================================================================== --- /python/trunk/Lib/test/test_tk_guionly.py (original) +++ python/branches/py3k/Lib/test/test_tk_guionly.py Wed Jan 28 15:41:10 2009 @@ -1,23 +1,14 @@ -import os -import sys -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 +from test import support +from tkinter.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') + if support.use_resources is None: + support.use_resources = ['gui'] + elif 'gui' not in support.use_resources: + support.use_resources.append('gui') - test_support.run_unittest(*runtktests.get_tests(text=False)) + support.run_unittest(*runtktests.get_tests(text=False)) if __name__ == '__main__': test_main(enable_gui=True) Copied: python/branches/py3k/Lib/test/test_tk_textonly.py (from r69050, /python/trunk/Lib/test/test_tk_textonly.py) ============================================================================== --- /python/trunk/Lib/test/test_tk_textonly.py (original) +++ python/branches/py3k/Lib/test/test_tk_textonly.py Wed Jan 28 15:41:10 2009 @@ -1,16 +1,8 @@ -import os -import sys -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, '..', 'lib-tk', 'test')) -if lib_tk_test not in sys.path: - sys.path.append(lib_tk_test) - -import runtktests +from test import support +from tkinter.test import runtktests def test_main(): - test_support.run_unittest(*runtktests.get_tests(gui=False)) + support.run_unittest(*runtktests.get_tests(gui=False)) if __name__ == '__main__': test_main() Added: python/branches/py3k/Lib/tkinter/test/README ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/README Wed Jan 28 15:41:10 2009 @@ -0,0 +1,14 @@ +Writing new tests +================= + +Precaution +---------- + + New tests should always use only one Tk window at once, like all the + current tests do. This means that you have to destroy the current window + before creating another one, and clean up after the test. The motivation + behind this is that some tests may depend on having its window focused + while it is running to work properly, and it may be hard to force focus + on your window across platforms (right now only test_traversal at + test_ttk.test_widgets.NotebookTest depends on this). + Added: python/branches/py3k/Lib/tkinter/test/__init__.py ============================================================================== Added: python/branches/py3k/Lib/tkinter/test/runtktests.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/runtktests.py Wed Jan 28 15:41:10 2009 @@ -0,0 +1,68 @@ +""" +Use this module to get and run all tk tests. + +tkinter tests should live in a package inside the directory where this file +lives, like test_tkinter. +Extensions also should live in packages following the same rule as above. +""" + +import os +import sys +import unittest +import test.support + +this_dir_path = os.path.abspath(os.path.dirname(__file__)) + +def is_package(path): + for name in os.listdir(path): + if name in ('__init__.py', '__init__.pyc', '__init.pyo'): + return True + return False + +def get_tests_modules(basepath=this_dir_path, gui=True): + """This will import and yield modules whose names start with test_ + and are inside packages found in the path starting at basepath.""" + py_ext = '.py' + + for dirpath, dirnames, filenames in os.walk(basepath): + for dirname in list(dirnames): + if dirname[0] == '.': + dirnames.remove(dirname) + + if is_package(dirpath) and filenames: + pkg_name = dirpath[len(basepath) + len(os.sep):].replace('/', '.') + filenames = filter( + lambda x: x.startswith('test_') and x.endswith(py_ext), + filenames) + + for name in filenames: + try: + yield __import__( + "%s.%s.%s" % ( + "tkinter.test", + pkg_name, + name[:-len(py_ext)]), + fromlist=[''] + ) + except test.support.ResourceDenied: + if gui: + raise + +def get_tests(text=True, gui=True): + """Yield all the tests in the modules found by get_tests_modules. + + If nogui is True, only tests that do not require a GUI will be + returned.""" + attrs = [] + if text: + attrs.append('tests_nogui') + if gui: + attrs.append('tests_gui') + for module in get_tests_modules(gui=gui): + for attr in attrs: + for test in getattr(module, attr, ()): + yield test + +if __name__ == "__main__": + test.support.use_resources = ['gui'] + test.support.run_unittest(*get_tests()) Copied: python/branches/py3k/Lib/tkinter/test/support.py (from r69050, /python/trunk/Lib/lib-tk/test/test_ttk/support.py) ============================================================================== --- /python/trunk/Lib/lib-tk/test/test_ttk/support.py (original) +++ python/branches/py3k/Lib/tkinter/test/support.py Wed Jan 28 15:41:10 2009 @@ -1,8 +1,8 @@ -import Tkinter +import tkinter def get_tk_root(): try: - root = Tkinter._default_root + root = tkinter._default_root except AttributeError: # it is possible to disable default root in Tkinter, although # I haven't seen people doing it (but apparently someone did it @@ -11,7 +11,7 @@ if root is None: # create a new master only if there isn't one already - root = Tkinter.Tk() + root = tkinter.Tk() return root Added: python/branches/py3k/Lib/tkinter/test/test_ttk/__init__.py ============================================================================== Added: python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py Wed Jan 28 15:41:10 2009 @@ -0,0 +1,266 @@ +import sys +import unittest +import tkinter +from tkinter import ttk +from test.support import requires, run_unittest + +import tkinter.test.support as support + +requires('gui') + +class LabeledScaleTest(unittest.TestCase): + + def test_widget_destroy(self): + # automatically created variable + x = ttk.LabeledScale() + var = x._variable._name + x.destroy() + self.failUnlessRaises(tkinter.TclError, x.tk.globalgetvar, var) + + # manually created variable + myvar = tkinter.DoubleVar() + name = myvar._name + x = ttk.LabeledScale(variable=myvar) + x.destroy() + self.failUnlessEqual(x.tk.globalgetvar(name), myvar.get()) + del myvar + self.failUnlessRaises(tkinter.TclError, x.tk.globalgetvar, name) + + # checking that the tracing callback is properly removed + myvar = tkinter.IntVar() + # LabeledScale will start tracing myvar + x = ttk.LabeledScale(variable=myvar) + x.destroy() + # Unless the tracing callback was removed, creating a new + # LabeledScale with the same var will cause an error now. This + # happens because the variable will be set to (possibly) a new + # value which causes the tracing callback to be called and then + # it tries calling instance attributes not yet defined. + ttk.LabeledScale(variable=myvar) + if hasattr(sys, 'last_type'): + self.failIf(sys.last_type == tkinter.TclError) + + + def test_initialization(self): + # master passing + x = ttk.LabeledScale() + self.failUnlessEqual(x.master, tkinter._default_root) + x.destroy() + master = tkinter.Frame() + x = ttk.LabeledScale(master) + self.failUnlessEqual(x.master, master) + x.destroy() + + # variable initialization/passing + passed_expected = ((2.5, 2), ('0', 0), (0, 0), (10, 10), + (-1, -1), (sys.maxsize + 1, sys.maxsize + 1)) + for pair in passed_expected: + x = ttk.LabeledScale(from_=pair[0]) + self.failUnlessEqual(x.value, pair[1]) + x.destroy() + x = ttk.LabeledScale(from_='2.5') + self.failUnlessRaises(ValueError, x._variable.get) + x.destroy() + x = ttk.LabeledScale(from_=None) + self.failUnlessRaises(ValueError, x._variable.get) + x.destroy() + # variable should have its default value set to the from_ value + myvar = tkinter.DoubleVar(value=20) + x = ttk.LabeledScale(variable=myvar) + self.failUnlessEqual(x.value, 0) + x.destroy() + # check that it is really using a DoubleVar + x = ttk.LabeledScale(variable=myvar, from_=0.5) + self.failUnlessEqual(x.value, 0.5) + self.failUnlessEqual(x._variable._name, myvar._name) + x.destroy() + + # widget positionment + def check_positions(scale, scale_pos, label, label_pos): + self.failUnlessEqual(scale.pack_info()['side'], scale_pos) + self.failUnlessEqual(label.place_info()['anchor'], label_pos) + x = ttk.LabeledScale(compound='top') + check_positions(x.scale, 'bottom', x.label, 'n') + x.destroy() + x = ttk.LabeledScale(compound='bottom') + check_positions(x.scale, 'top', x.label, 's') + x.destroy() + x = ttk.LabeledScale(compound='unknown') # invert default positions + check_positions(x.scale, 'top', x.label, 's') + x.destroy() + x = ttk.LabeledScale() # take default positions + check_positions(x.scale, 'bottom', x.label, 'n') + x.destroy() + + # extra, and invalid, kwargs + self.failUnlessRaises(tkinter.TclError, ttk.LabeledScale, a='b') + + + def test_horizontal_range(self): + lscale = ttk.LabeledScale(from_=0, to=10) + lscale.pack() + lscale.wait_visibility() + lscale.update() + + linfo_1 = lscale.label.place_info() + prev_xcoord = lscale.scale.coords()[0] + self.failUnlessEqual(prev_xcoord, int(linfo_1['x'])) + # change range to: from -5 to 5. This should change the x coord of + # the scale widget, since 0 is at the middle of the new + # range. + lscale.scale.configure(from_=-5, to=5) + # The following update is needed since the test doesn't use mainloop, + # at the same time this shouldn't affect test outcome + lscale.update() + curr_xcoord = lscale.scale.coords()[0] + self.failUnless(prev_xcoord != curr_xcoord) + # the label widget should have been repositioned too + linfo_2 = lscale.label.place_info() + self.failUnlessEqual(lscale.label['text'], 0) + self.failUnlessEqual(curr_xcoord, int(linfo_2['x'])) + # change the range back + lscale.scale.configure(from_=0, to=10) + self.failUnless(prev_xcoord != curr_xcoord) + self.failUnlessEqual(prev_xcoord, int(linfo_1['x'])) + + lscale.destroy() + + + def test_variable_change(self): + x = ttk.LabeledScale() + x.pack() + x.wait_visibility() + x.update() + + curr_xcoord = x.scale.coords()[0] + newval = x.value + 1 + x.value = newval + # The following update is needed since the test doesn't use mainloop, + # at the same time this shouldn't affect test outcome + x.update() + self.failUnlessEqual(x.label['text'], newval) + self.failUnless(x.scale.coords()[0] > curr_xcoord) + self.failUnlessEqual(x.scale.coords()[0], + int(x.label.place_info()['x'])) + + # value outside range + x.value = x.scale['to'] + 1 # no changes shouldn't happen + x.update() + self.failUnlessEqual(x.label['text'], newval) + self.failUnlessEqual(x.scale.coords()[0], + int(x.label.place_info()['x'])) + + x.destroy() + + + def test_resize(self): + x = ttk.LabeledScale() + x.pack(expand=True, fill='both') + x.wait_visibility() + x.update() + + width, height = x.master.winfo_width(), x.master.winfo_height() + width, height = width * 2, height * 2 + + x.value = 3 + x.update() + x.master.wm_geometry("%dx%d" % (width, height)) + self.failUnlessEqual(int(x.label.place_info()['x']), + x.scale.coords()[0]) + + x.master.wm_geometry("%dx%d" % (width, height)) + x.destroy() + + +class OptionMenuTest(unittest.TestCase): + + def setUp(self): + self.root = support.get_tk_root() + self.textvar = tkinter.StringVar(self.root) + + def tearDown(self): + del self.textvar + self.root.destroy() + + + def test_widget_destroy(self): + var = tkinter.StringVar() + optmenu = ttk.OptionMenu(None, var) + name = var._name + optmenu.update_idletasks() + optmenu.destroy() + self.failUnlessEqual(optmenu.tk.globalgetvar(name), var.get()) + del var + self.failUnlessRaises(tkinter.TclError, optmenu.tk.globalgetvar, name) + + + def test_initialization(self): + self.failUnlessRaises(tkinter.TclError, + ttk.OptionMenu, None, self.textvar, invalid='thing') + + optmenu = ttk.OptionMenu(None, self.textvar, 'b', 'a', 'b') + self.failUnlessEqual(optmenu._variable.get(), 'b') + + self.failUnless(optmenu['menu']) + self.failUnless(optmenu['textvariable']) + + optmenu.destroy() + + + def test_menu(self): + items = ('a', 'b', 'c') + default = 'a' + optmenu = ttk.OptionMenu(None, self.textvar, default, *items) + found_default = False + for i in range(len(items)): + value = optmenu['menu'].entrycget(i, 'value') + self.failUnlessEqual(value, items[i]) + if value == default: + found_default = True + self.failUnless(found_default) + optmenu.destroy() + + # default shouldn't be in menu if it is not part of values + default = 'd' + optmenu = ttk.OptionMenu(None, self.textvar, default, *items) + curr = None + i = 0 + while True: + last, curr = curr, optmenu['menu'].entryconfigure(i, 'value') + if last == curr: + # no more menu entries + break + self.failIf(curr == default) + i += 1 + self.failUnlessEqual(i, len(items)) + + # check that variable is updated correctly + optmenu.pack() + optmenu.wait_visibility() + optmenu['menu'].invoke(0) + self.failUnlessEqual(optmenu._variable.get(), items[0]) + + # changing to an invalid index shouldn't change the variable + self.failUnlessRaises(tkinter.TclError, optmenu['menu'].invoke, -1) + self.failUnlessEqual(optmenu._variable.get(), items[0]) + + optmenu.destroy() + + # specifying a callback + success = [] + def cb_test(item): + self.failUnlessEqual(item, items[1]) + success.append(True) + optmenu = ttk.OptionMenu(None, self.textvar, 'a', command=cb_test, + *items) + optmenu['menu'].invoke(1) + if not success: + self.fail("Menu callback not invoked") + + optmenu.destroy() + + +tests_gui = (LabeledScaleTest, OptionMenuTest) + +if __name__ == "__main__": + run_unittest(*tests_gui) Added: python/branches/py3k/Lib/tkinter/test/test_ttk/test_functions.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_functions.py Wed Jan 28 15:41:10 2009 @@ -0,0 +1,423 @@ +# -*- encoding: utf-8 -*- +import unittest +from tkinter import ttk + +class MockTclObj(object): + typename = 'test' + + def __init__(self, val): + self.val = val + + def __str__(self): + return str(self.val) + + +class MockStateSpec(object): + typename = 'StateSpec' + + def __init__(self, *args): + self.val = args + + def __str__(self): + return ' '.join(self.val) + + +class InternalFunctionsTest(unittest.TestCase): + + def test_format_optdict(self): + def check_against(fmt_opts, result): + for i in range(0, len(fmt_opts), 2): + self.failUnlessEqual(result.pop(fmt_opts[i]), fmt_opts[i + 1]) + if result: + self.fail("result still got elements: %s" % result) + + # passing an empty dict should return an empty object (tuple here) + self.failIf(ttk._format_optdict({})) + + # check list formatting + check_against( + ttk._format_optdict({'fg': 'blue', 'padding': [1, 2, 3, 4]}), + {'-fg': 'blue', '-padding': '1 2 3 4'}) + + # check tuple formatting (same as list) + check_against( + ttk._format_optdict({'test': (1, 2, '', 0)}), + {'-test': '1 2 {} 0'}) + + # check untouched values + check_against( + ttk._format_optdict({'test': {'left': 'as is'}}), + {'-test': {'left': 'as is'}}) + + # check script formatting and untouched value(s) + check_against( + ttk._format_optdict( + {'test': [1, -1, '', '2m', 0], 'nochange1': 3, + 'nochange2': 'abc def'}, script=True), + {'-test': '{1 -1 {} 2m 0}', '-nochange1': 3, + '-nochange2': 'abc def' }) + + opts = {'???': True, '?': False} + orig_opts = opts.copy() + # check if giving unicode keys is fine + check_against(ttk._format_optdict(opts), {'-???': True, '-?': False}) + # opts should remain unchanged + self.failUnlessEqual(opts, orig_opts) + + # passing values with spaces inside a tuple/list + check_against( + ttk._format_optdict( + {'option': ('one two', 'three')}), + {'-option': '{one two} three'}) + + # ignore an option + amount_opts = len(ttk._format_optdict(opts, ignore=('?'))) / 2 + self.failUnlessEqual(amount_opts, len(opts) - 1) + + # ignore non-existing options + amount_opts = len(ttk._format_optdict(opts, ignore=('?', 'b'))) / 2 + self.failUnlessEqual(amount_opts, len(opts) - 1) + + # ignore every option + self.failIf(ttk._format_optdict(opts, ignore=list(opts.keys()))) + + + def test_format_mapdict(self): + opts = {'a': [('b', 'c', 'val'), ('d', 'otherval'), ('', 'single')]} + result = ttk._format_mapdict(opts) + self.failUnlessEqual(len(result), len(list(opts.keys())) * 2) + self.failUnlessEqual(result, ('-a', '{b c} val d otherval {} single')) + self.failUnlessEqual(ttk._format_mapdict(opts, script=True), + ('-a', '{{b c} val d otherval {} single}')) + + self.failUnlessEqual(ttk._format_mapdict({2: []}), ('-2', '')) + + opts = {'?????d?': [('?', 'v?l')]} + result = ttk._format_mapdict(opts) + self.failUnlessEqual(result, ('-?????d?', '? v?l')) + + # empty states + valid = {'opt': [('', '', 'hi')]} + self.failUnlessEqual(ttk._format_mapdict(valid), ('-opt', '{ } hi')) + + # when passing multiple states, they all must be strings + invalid = {'opt': [(1, 2, 'valid val')]} + self.failUnlessRaises(TypeError, ttk._format_mapdict, invalid) + invalid = {'opt': [([1], '2', 'valid val')]} + self.failUnlessRaises(TypeError, ttk._format_mapdict, invalid) + # but when passing a single state, it can be anything + valid = {'opt': [[1, 'value']]} + self.failUnlessEqual(ttk._format_mapdict(valid), ('-opt', '1 value')) + # special attention to single states which evalute to False + for stateval in (None, 0, False, '', set()): # just some samples + valid = {'opt': [(stateval, 'value')]} + self.failUnlessEqual(ttk._format_mapdict(valid), + ('-opt', '{} value')) + + # values must be iterable + opts = {'a': None} + self.failUnlessRaises(TypeError, ttk._format_mapdict, opts) + + # items in the value must have size >= 2 + self.failUnlessRaises(IndexError, ttk._format_mapdict, + {'a': [('invalid', )]}) + + + def test_format_elemcreate(self): + self.failUnless(ttk._format_elemcreate(None), (None, ())) + + ## Testing type = image + # image type expects at least an image name, so this should raise + # IndexError since it tries to access the index 0 of an empty tuple + self.failUnlessRaises(IndexError, ttk._format_elemcreate, 'image') + + # don't format returned values as a tcl script + # minimum acceptable for image type + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test'), + ("test ", ())) + # specifiyng a state spec + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test', + ('', 'a')), ("test {} a", ())) + # state spec with multiple states + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test', + ('a', 'b', 'c')), ("test {a b} c", ())) + # state spec and options + self.failUnlessEqual(ttk._format_elemcreate('image', False, 'test', + ('a', 'b'), a='x', b='y'), ("test a b", ("-a", "x", "-b", "y"))) + # format returned values as a tcl script + # state spec with multiple states and an option with a multivalue + self.failUnlessEqual(ttk._format_elemcreate('image', True, 'test', + ('a', 'b', 'c', 'd'), x=[2, 3]), ("{test {a b c} d}", "-x {2 3}")) + + ## Testing type = vsapi + # vsapi type expects at least a class name and a part_id, so this + # should raise an ValueError since it tries to get two elements from + # an empty tuple + self.failUnlessRaises(ValueError, ttk._format_elemcreate, 'vsapi') + + # don't format returned values as a tcl script + # minimum acceptable for vsapi + self.failUnlessEqual(ttk._format_elemcreate('vsapi', False, 'a', 'b'), + ("a b ", ())) + # now with a state spec with multiple states + self.failUnlessEqual(ttk._format_elemcreate('vsapi', False, 'a', 'b', + ('a', 'b', 'c')), ("a b {a b} c", ())) + # state spec and option + self.failUnlessEqual(ttk._format_elemcreate('vsapi', False, 'a', 'b', + ('a', 'b'), opt='x'), ("a b a b", ("-opt", "x"))) + # format returned values as a tcl script + # state spec with a multivalue and an option + self.failUnlessEqual(ttk._format_elemcreate('vsapi', True, 'a', 'b', + ('a', 'b', [1, 2]), opt='x'), ("{a b {a b} {1 2}}", "-opt x")) + + # Testing type = from + # from type expects at least a type name + self.failUnlessRaises(IndexError, ttk._format_elemcreate, 'from') + + self.failUnlessEqual(ttk._format_elemcreate('from', False, 'a'), + ('a', ())) + self.failUnlessEqual(ttk._format_elemcreate('from', False, 'a', 'b'), + ('a', ('b', ))) + self.failUnlessEqual(ttk._format_elemcreate('from', True, 'a', 'b'), + ('{a}', 'b')) + + + def test_format_layoutlist(self): + def sample(indent=0, indent_size=2): + return ttk._format_layoutlist( + [('a', {'other': [1, 2, 3], 'children': + [('b', {'children': + [('c', {'children': + [('d', {'nice': 'opt'})], 'something': (1, 2) + })] + })] + })], indent=indent, indent_size=indent_size)[0] + + def sample_expected(indent=0, indent_size=2): + spaces = lambda amount=0: ' ' * (amount + indent) + return ( + "%sa -other {1 2 3} -children {\n" + "%sb -children {\n" + "%sc -something {1 2} -children {\n" + "%sd -nice opt\n" + "%s}\n" + "%s}\n" + "%s}" % (spaces(), spaces(indent_size), + spaces(2 * indent_size), spaces(3 * indent_size), + spaces(2 * indent_size), spaces(indent_size), spaces())) + + # empty layout + self.failUnlessEqual(ttk._format_layoutlist([])[0], '') + + # _format_layoutlist always expects the second item (in every item) + # to act like a dict (except when the value evalutes to False). + self.failUnlessRaises(AttributeError, + ttk._format_layoutlist, [('a', 'b')]) + + smallest = ttk._format_layoutlist([('a', None)], indent=0) + self.failUnlessEqual(smallest, + ttk._format_layoutlist([('a', '')], indent=0)) + self.failUnlessEqual(smallest[0], 'a') + + # testing indentation levels + self.failUnlessEqual(sample(), sample_expected()) + for i in range(4): + self.failUnlessEqual(sample(i), sample_expected(i)) + self.failUnlessEqual(sample(i, i), sample_expected(i, i)) + + # invalid layout format, different kind of exceptions will be + # raised by internal functions + + # plain wrong format + self.failUnlessRaises(ValueError, ttk._format_layoutlist, + ['bad', 'format']) + # will try to use iteritems in the 'bad' string + self.failUnlessRaises(AttributeError, ttk._format_layoutlist, + [('name', 'bad')]) + # bad children formatting + self.failUnlessRaises(ValueError, ttk._format_layoutlist, + [('name', {'children': {'a': None}})]) + + + def test_script_from_settings(self): + # empty options + self.failIf(ttk._script_from_settings({'name': + {'configure': None, 'map': None, 'element create': None}})) + + # empty layout + self.failUnlessEqual( + ttk._script_from_settings({'name': {'layout': None}}), + "ttk::style layout name {\nnull\n}") + + configdict = {'???': True, '?': False} + self.failUnless( + ttk._script_from_settings({'name': {'configure': configdict}})) + + mapdict = {'?????d?': [('?', 'v?l')]} + self.failUnless( + ttk._script_from_settings({'name': {'map': mapdict}})) + + # invalid image element + self.failUnlessRaises(IndexError, + ttk._script_from_settings, {'name': {'element create': ['image']}}) + + # minimal valid image + self.failUnless(ttk._script_from_settings({'name': + {'element create': ['image', 'name']}})) + + image = {'thing': {'element create': + ['image', 'name', ('state1', 'state2', 'val')]}} + self.failUnlessEqual(ttk._script_from_settings(image), + "ttk::style element create thing image {name {state1 state2} val} ") + + image['thing']['element create'].append({'opt': 30}) + self.failUnlessEqual(ttk._script_from_settings(image), + "ttk::style element create thing image {name {state1 state2} val} " + "-opt 30") + + image['thing']['element create'][-1]['opt'] = [MockTclObj(3), + MockTclObj('2m')] + self.failUnlessEqual(ttk._script_from_settings(image), + "ttk::style element create thing image {name {state1 state2} val} " + "-opt {3 2m}") + + + def test_dict_from_tcltuple(self): + fakettuple = ('-a', '{1 2 3}', '-something', 'foo') + + self.failUnlessEqual(ttk._dict_from_tcltuple(fakettuple, False), + {'-a': '{1 2 3}', '-something': 'foo'}) + + self.failUnlessEqual(ttk._dict_from_tcltuple(fakettuple), + {'a': '{1 2 3}', 'something': 'foo'}) + + # passing a tuple with a single item should return an empty dict, + # since it tries to break the tuple by pairs. + self.failIf(ttk._dict_from_tcltuple(('single', ))) + + sspec = MockStateSpec('a', 'b') + self.failUnlessEqual(ttk._dict_from_tcltuple(('-a', (sspec, 'val'))), + {'a': [('a', 'b', 'val')]}) + + self.failUnlessEqual(ttk._dict_from_tcltuple((MockTclObj('-padding'), + [MockTclObj('1'), 2, MockTclObj('3m')])), + {'padding': [1, 2, '3m']}) + + + def test_list_from_statespec(self): + def test_it(sspec, value, res_value, states): + self.failUnlessEqual(ttk._list_from_statespec( + (sspec, value)), [states + (res_value, )]) + + states_even = tuple('state%d' % i for i in range(6)) + statespec = MockStateSpec(*states_even) + test_it(statespec, 'val', 'val', states_even) + test_it(statespec, MockTclObj('val'), 'val', states_even) + + states_odd = tuple('state%d' % i for i in range(5)) + statespec = MockStateSpec(*states_odd) + test_it(statespec, 'val', 'val', states_odd) + + test_it(('a', 'b', 'c'), MockTclObj('val'), 'val', ('a', 'b', 'c')) + + + def test_list_from_layouttuple(self): + # empty layout tuple + self.failIf(ttk._list_from_layouttuple(())) + + # shortest layout tuple + self.failUnlessEqual(ttk._list_from_layouttuple(('name', )), + [('name', {})]) + + # not so interesting ltuple + sample_ltuple = ('name', '-option', 'value') + self.failUnlessEqual(ttk._list_from_layouttuple(sample_ltuple), + [('name', {'option': 'value'})]) + + # empty children + self.failUnlessEqual(ttk._list_from_layouttuple( + ('something', '-children', ())), + [('something', {'children': []})] + ) + + # more interesting ltuple + ltuple = ( + 'name', '-option', 'niceone', '-children', ( + ('otherone', '-children', ( + ('child', )), '-otheropt', 'othervalue' + ) + ) + ) + self.failUnlessEqual(ttk._list_from_layouttuple(ltuple), + [('name', {'option': 'niceone', 'children': + [('otherone', {'otheropt': 'othervalue', 'children': + [('child', {})] + })] + })] + ) + + # bad tuples + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('name', 'no_minus')) + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('name', 'no_minus', 'value')) + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('something', '-children')) # no children + self.failUnlessRaises(ValueError, ttk._list_from_layouttuple, + ('something', '-children', 'value')) # invalid children + + + def test_val_or_dict(self): + def func(opt, val=None): + if val is None: + return "test val" + return (opt, val) + + options = {'test': None} + self.failUnlessEqual(ttk._val_or_dict(options, func), "test val") + + options = {'test': 3} + self.failUnlessEqual(ttk._val_or_dict(options, func), options) + + + def test_convert_stringval(self): + tests = ( + (0, 0), ('09', 9), ('a', 'a'), ('??', '??'), ([], '[]'), + (None, 'None') + ) + for orig, expected in tests: + self.failUnlessEqual(ttk._convert_stringval(orig), expected) + + +class TclObjsToPyTest(unittest.TestCase): + + def test_unicode(self): + adict = {'opt': 'v?l??'} + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': 'v?l??'}) + + adict['opt'] = MockTclObj(adict['opt']) + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': 'v?l??'}) + + def test_multivalues(self): + adict = {'opt': [1, 2, 3, 4]} + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': [1, 2, 3, 4]}) + + adict['opt'] = [1, 'xm', 3] + self.failUnlessEqual(ttk.tclobjs_to_py(adict), {'opt': [1, 'xm', 3]}) + + adict['opt'] = (MockStateSpec('a', 'b'), 'v?l??') + self.failUnlessEqual(ttk.tclobjs_to_py(adict), + {'opt': [('a', 'b', 'v?l??')]}) + + self.failUnlessEqual(ttk.tclobjs_to_py({'x': ['y z']}), + {'x': ['y z']}) + + def test_nosplit(self): + self.failUnlessEqual(ttk.tclobjs_to_py({'text': 'some text'}), + {'text': 'some text'}) + +tests_nogui = (InternalFunctionsTest, TclObjsToPyTest) + +if __name__ == "__main__": + from test.support import run_unittest + run_unittest(*tests_nogui) Added: python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py Wed Jan 28 15:41:10 2009 @@ -0,0 +1,99 @@ +import unittest +import tkinter +from tkinter import ttk +from test.support import requires, run_unittest + +import tkinter.test.support as support + +requires('gui') + +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() + + + def test_configure(self): + style = self.style + style.configure('TButton', background='yellow') + self.failUnlessEqual(style.configure('TButton', 'background'), + 'yellow') + self.failUnless(isinstance(style.configure('TButton'), dict)) + + + def test_map(self): + style = self.style + style.map('TButton', background=[('active', 'background', 'blue')]) + self.failUnlessEqual(style.map('TButton', 'background'), + [('active', 'background', 'blue')]) + self.failUnless(isinstance(style.map('TButton'), dict)) + + + def test_lookup(self): + style = self.style + style.configure('TButton', background='yellow') + style.map('TButton', background=[('active', 'background', 'blue')]) + + self.failUnlessEqual(style.lookup('TButton', 'background'), 'yellow') + self.failUnlessEqual(style.lookup('TButton', 'background', + ['active', 'background']), 'blue') + self.failUnlessEqual(style.lookup('TButton', 'optionnotdefined', + default='iknewit'), 'iknewit') + + + def test_layout(self): + style = self.style + self.failUnlessRaises(tkinter.TclError, style.layout, 'NotALayout') + tv_style = style.layout('Treeview') + + # "erase" Treeview layout + style.layout('Treeview', '') + self.failUnlessEqual(style.layout('Treeview'), + [('null', {'sticky': 'nswe'})] + ) + + # restore layout + style.layout('Treeview', tv_style) + self.failUnlessEqual(style.layout('Treeview'), tv_style) + + # should return a list + self.failUnless(isinstance(style.layout('TButton'), list)) + + # correct layout, but "option" doesn't exist as option + self.failUnlessRaises(tkinter.TclError, style.layout, 'Treeview', + [('name', {'option': 'inexistant'})]) + + + def test_theme_use(self): + self.failUnlessRaises(tkinter.TclError, self.style.theme_use, + 'nonexistingname') + + curr_theme = self.style.theme_use() + new_theme = None + for theme in self.style.theme_names(): + if theme != curr_theme: + new_theme = theme + self.style.theme_use(theme) + break + else: + # just one theme available, can't go on with tests + return + + self.failIf(curr_theme == new_theme) + self.failIf(new_theme != self.style.theme_use()) + + self.style.theme_use(curr_theme) + + +tests_gui = (StyleTest, ) + +if __name__ == "__main__": + run_unittest(*tests_gui) Added: python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py Wed Jan 28 15:41:10 2009 @@ -0,0 +1,1115 @@ +import unittest +import tkinter +from tkinter import ttk +from test.support import requires, run_unittest + +import tkinter.test.support as support +from tkinter.test.test_ttk.test_functions import MockTclObj, MockStateSpec + +requires('gui') + +class WidgetTest(unittest.TestCase): + """Tests methods available in every ttk widget.""" + + def setUp(self): + self.widget = ttk.Button() + self.widget.pack() + self.widget.wait_visibility() + + def tearDown(self): + self.widget.destroy() + + + def test_identify(self): + self.widget.update_idletasks() + self.failUnlessEqual(self.widget.identify(5, 5), "label") + self.failUnlessEqual(self.widget.identify(-1, -1), "") + + self.failUnlessRaises(tkinter.TclError, self.widget.identify, None, 5) + self.failUnlessRaises(tkinter.TclError, self.widget.identify, 5, None) + self.failUnlessRaises(tkinter.TclError, self.widget.identify, 5, '') + + + def test_widget_state(self): + # XXX not sure about the portability of all these tests + self.failUnlessEqual(self.widget.state(), ()) + self.failUnlessEqual(self.widget.instate(['!disabled']), True) + + # changing from !disabled to disabled + self.failUnlessEqual(self.widget.state(['disabled']), ('!disabled', )) + # no state change + self.failUnlessEqual(self.widget.state(['disabled']), ()) + # change back to !disable but also active + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), + ('!active', 'disabled')) + # no state changes, again + self.failUnlessEqual(self.widget.state(['!disabled', 'active']), ()) + self.failUnlessEqual(self.widget.state(['active', '!disabled']), ()) + + def test_cb(arg1, **kw): + return arg1, kw + self.failUnlessEqual(self.widget.instate(['!disabled'], + test_cb, "hi", **{"msg": "there"}), + ('hi', {'msg': 'there'})) + + # attempt to set invalid statespec + currstate = self.widget.state() + self.failUnlessRaises(tkinter.TclError, self.widget.instate, + ['badstate']) + self.failUnlessRaises(tkinter.TclError, self.widget.instate, + ['disabled', 'badstate']) + # verify that widget didn't change its state + self.failUnlessEqual(currstate, self.widget.state()) + + # ensuring that passing None as state doesn't modify current state + self.widget.state(['active', '!disabled']) + self.failUnlessEqual(self.widget.state(), ('active', )) + + +class ButtonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + btn = ttk.Button(command=lambda: success.append(1)) + btn.invoke() + self.failUnless(success) + + +class CheckbuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + cbtn = ttk.Checkbutton(command=cb_test) + # the variable automatically created by ttk.Checkbutton is actually + # undefined till we invoke the Checkbutton + self.failUnlessEqual(cbtn.state(), ('alternate', )) + self.failUnlessRaises(tkinter.TclError, cbtn.tk.globalgetvar, + cbtn['variable']) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['onvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn['command'] = '' + res = cbtn.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn['offvalue'], + cbtn.tk.globalgetvar(cbtn['variable'])) + + +class ComboboxTest(unittest.TestCase): + + def setUp(self): + self.combo = ttk.Combobox() + + def tearDown(self): + self.combo.destroy() + + def _show_drop_down_listbox(self): + width = self.combo.winfo_width() + self.combo.event_generate('', x=width - 5, y=5) + self.combo.event_generate('', x=width - 5, y=5) + self.combo.update_idletasks() + + + def test_virtual_event(self): + success = [] + + self.combo['values'] = [1] + self.combo.bind('<>', + lambda evt: success.append(True)) + self.combo.pack() + self.combo.wait_visibility() + + height = self.combo.winfo_height() + self._show_drop_down_listbox() + self.combo.update() + self.combo.event_generate('') + self.combo.update() + + self.failUnless(success) + + + def test_postcommand(self): + success = [] + + self.combo['postcommand'] = lambda: success.append(True) + self.combo.pack() + self.combo.wait_visibility() + + self._show_drop_down_listbox() + self.failUnless(success) + + # testing postcommand removal + self.combo['postcommand'] = '' + self._show_drop_down_listbox() + self.failUnlessEqual(len(success), 1) + + + def test_values(self): + def check_get_current(getval, currval): + self.failUnlessEqual(self.combo.get(), getval) + self.failUnlessEqual(self.combo.current(), currval) + + check_get_current('', -1) + + self.combo['values'] = ['a', 1, 'c'] + + self.combo.set('c') + check_get_current('c', 2) + + self.combo.current(0) + check_get_current('a', 0) + + self.combo.set('d') + check_get_current('d', -1) + + # testing values with empty string + self.combo.set('') + self.combo['values'] = (1, 2, '', 3) + check_get_current('', 2) + + # testing values with empty string set through configure + self.combo.configure(values=[1, '', 2]) + self.failUnlessEqual(self.combo['values'], ('1', '', '2')) + + # out of range + self.failUnlessRaises(tkinter.TclError, self.combo.current, + len(self.combo['values'])) + # it expects an integer (or something that can be converted to int) + self.failUnlessRaises(tkinter.TclError, self.combo.current, '') + + # testing creating combobox with empty string in values + combo2 = ttk.Combobox(values=[1, 2, '']) + self.failUnlessEqual(combo2['values'], ('1', '2', '')) + combo2.destroy() + + +class EntryTest(unittest.TestCase): + + def setUp(self): + self.entry = ttk.Entry() + + def tearDown(self): + self.entry.destroy() + + + def test_bbox(self): + self.failUnlessEqual(len(self.entry.bbox(0)), 4) + for item in self.entry.bbox(0): + self.failUnless(isinstance(item, int)) + + self.failUnlessRaises(tkinter.TclError, self.entry.bbox, 'noindex') + self.failUnlessRaises(tkinter.TclError, self.entry.bbox, None) + + + def test_identify(self): + self.entry.pack() + self.entry.wait_visibility() + self.entry.update_idletasks() + + self.failUnlessEqual(self.entry.identify(5, 5), "textarea") + self.failUnlessEqual(self.entry.identify(-1, -1), "") + + self.failUnlessRaises(tkinter.TclError, self.entry.identify, None, 5) + self.failUnlessRaises(tkinter.TclError, self.entry.identify, 5, None) + self.failUnlessRaises(tkinter.TclError, self.entry.identify, 5, '') + + + def test_validation_options(self): + success = [] + test_invalid = lambda: success.append(True) + + self.entry['validate'] = 'none' + self.entry['validatecommand'] = lambda: False + + self.entry['invalidcommand'] = test_invalid + self.entry.validate() + self.failUnless(success) + + self.entry['invalidcommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['invalidcommand'] = test_invalid + self.entry['validatecommand'] = lambda: True + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = '' + self.entry.validate() + self.failUnlessEqual(len(success), 1) + + self.entry['validatecommand'] = True + self.failUnlessRaises(tkinter.TclError, self.entry.validate) + + + def test_validation(self): + validation = [] + def validate(to_insert): + if not 'a' <= to_insert.lower() <= 'z': + validation.append(False) + return False + validation.append(True) + return True + + self.entry['validate'] = 'key' + self.entry['validatecommand'] = self.entry.register(validate), '%S' + + self.entry.insert('end', 1) + self.entry.insert('end', 'a') + self.failUnlessEqual(validation, [False, True]) + self.failUnlessEqual(self.entry.get(), 'a') + + + def test_revalidation(self): + def validate(content): + for letter in content: + if not 'a' <= letter.lower() <= 'z': + return False + return True + + self.entry['validatecommand'] = self.entry.register(validate), '%P' + + self.entry.insert('end', 'avocado') + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + self.entry.delete(0, 'end') + self.failUnlessEqual(self.entry.get(), '') + + self.entry.insert('end', 'a1b') + self.failUnlessEqual(self.entry.validate(), False) + self.failUnlessEqual(self.entry.state(), ('invalid', )) + + self.entry.delete(1) + self.failUnlessEqual(self.entry.validate(), True) + self.failUnlessEqual(self.entry.state(), ()) + + +class PanedwindowTest(unittest.TestCase): + + def setUp(self): + self.paned = ttk.Panedwindow() + + def tearDown(self): + self.paned.destroy() + + + def test_add(self): + # attempt to add a child that is not a direct child of the paned window + label = ttk.Label(self.paned) + child = ttk.Label(label) + self.failUnlessRaises(tkinter.TclError, self.paned.add, child) + label.destroy() + child.destroy() + # another attempt + label = ttk.Label() + child = ttk.Label(label) + self.failUnlessRaises(tkinter.TclError, self.paned.add, child) + child.destroy() + label.destroy() + + good_child = ttk.Label() + self.paned.add(good_child) + # re-adding a child is not accepted + self.failUnlessRaises(tkinter.TclError, self.paned.add, good_child) + + other_child = ttk.Label(self.paned) + self.paned.add(other_child) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(1)) + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 2) + good_child.destroy() + other_child.destroy() + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0) + + + def test_forget(self): + self.failUnlessRaises(tkinter.TclError, self.paned.forget, None) + self.failUnlessRaises(tkinter.TclError, self.paned.forget, 0) + + self.paned.add(ttk.Label()) + self.paned.forget(0) + self.failUnlessRaises(tkinter.TclError, self.paned.forget, 0) + + + def test_insert(self): + self.failUnlessRaises(tkinter.TclError, self.paned.insert, None, 0) + self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, None) + self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, 0) + + child = ttk.Label() + child2 = ttk.Label() + child3 = ttk.Label() + + self.failUnlessRaises(tkinter.TclError, self.paned.insert, 0, child) + + self.paned.insert('end', child2) + self.paned.insert(0, child) + self.failUnlessEqual(self.paned.panes(), (str(child), str(child2))) + + self.paned.insert(0, child2) + self.failUnlessEqual(self.paned.panes(), (str(child2), str(child))) + + self.paned.insert('end', child3) + self.failUnlessEqual(self.paned.panes(), + (str(child2), str(child), str(child3))) + + # reinserting a child should move it to its current position + panes = self.paned.panes() + self.paned.insert('end', child3) + self.failUnlessEqual(panes, self.paned.panes()) + + # moving child3 to child2 position should result in child2 ending up + # in previous child position and child ending up in previous child3 + # position + self.paned.insert(child2, child3) + self.failUnlessEqual(self.paned.panes(), + (str(child3), str(child2), str(child))) + + + def test_pane(self): + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0) + + child = ttk.Label() + self.paned.add(child) + self.failUnless(isinstance(self.paned.pane(0), dict)) + self.failUnlessEqual(self.paned.pane(0, weight=None), 0) + # newer form for querying a single option + self.failUnlessEqual(self.paned.pane(0, 'weight'), 0) + self.failUnlessEqual(self.paned.pane(0), self.paned.pane(str(child))) + + self.failUnlessRaises(tkinter.TclError, self.paned.pane, 0, + badoption='somevalue') + + + def test_sashpos(self): + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, None) + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, '') + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 0) + + child = ttk.Label(self.paned, text='a') + self.paned.add(child, weight=1) + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 0) + child2 = ttk.Label(self.paned, text='b') + self.paned.add(child2) + self.failUnlessRaises(tkinter.TclError, self.paned.sashpos, 1) + + self.paned.pack(expand=True, fill='both') + self.paned.wait_visibility() + + curr_pos = self.paned.sashpos(0) + self.paned.sashpos(0, 1000) + self.failUnless(curr_pos != self.paned.sashpos(0)) + self.failUnless(isinstance(self.paned.sashpos(0), int)) + + +class RadiobuttonTest(unittest.TestCase): + + def test_invoke(self): + success = [] + def cb_test(): + success.append(1) + return "cb test called" + + myvar = tkinter.IntVar() + cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0) + cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1) + + res = cbtn.invoke() + self.failUnlessEqual(res, "cb test called") + self.failUnlessEqual(cbtn['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + self.failUnless(success) + + cbtn2['command'] = '' + res = cbtn2.invoke() + self.failUnlessEqual(res, '') + self.failIf(len(success) > 1) + self.failUnlessEqual(cbtn2['value'], myvar.get()) + self.failUnlessEqual(myvar.get(), + cbtn.tk.globalgetvar(cbtn['variable'])) + + self.failUnlessEqual(str(cbtn['variable']), str(cbtn2['variable'])) + + + +class ScaleTest(unittest.TestCase): + + def setUp(self): + self.scale = ttk.Scale() + self.scale.pack() + self.scale.update() + + def tearDown(self): + self.scale.destroy() + + + def test_custom_event(self): + failure = [1, 1, 1] # will need to be empty + + funcid = self.scale.bind('<>', lambda evt: failure.pop()) + + self.scale['from'] = 10 + self.scale['from_'] = 10 + self.scale['to'] = 3 + + self.failIf(failure) + + failure = [1, 1, 1] + self.scale.configure(from_=2, to=5) + self.scale.configure(from_=0, to=-2) + self.scale.configure(to=10) + + self.failIf(failure) + + + def test_get(self): + scale_width = self.scale.winfo_width() + self.failUnlessEqual(self.scale.get(scale_width, 0), self.scale['to']) + + self.failUnlessEqual(self.scale.get(0, 0), self.scale['from']) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + self.scale['value'] = 30 + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + self.failUnlessRaises(tkinter.TclError, self.scale.get, '', 0) + self.failUnlessRaises(tkinter.TclError, self.scale.get, 0, '') + + + def test_set(self): + # set restricts the max/min values according to the current range + max = self.scale['to'] + new_max = max + 10 + self.scale.set(new_max) + self.failUnlessEqual(self.scale.get(), max) + min = self.scale['from'] + self.scale.set(min - 1) + self.failUnlessEqual(self.scale.get(), min) + + # changing directly the variable doesn't impose this limitation tho + var = tkinter.DoubleVar() + self.scale['variable'] = var + var.set(max + 5) + self.failUnlessEqual(self.scale.get(), var.get()) + self.failUnlessEqual(self.scale.get(), max + 5) + del var + + # the same happens with the value option + self.scale['value'] = max + 10 + self.failUnlessEqual(self.scale.get(), max + 10) + self.failUnlessEqual(self.scale.get(), self.scale['value']) + + # nevertheless, note that the max/min values we can get specifying + # x, y coords are the ones according to the current range + self.failUnlessEqual(self.scale.get(0, 0), min) + self.failUnlessEqual(self.scale.get(self.scale.winfo_width(), 0), max) + + self.failUnlessRaises(tkinter.TclError, self.scale.set, None) + + +class NotebookTest(unittest.TestCase): + + def setUp(self): + self.nb = ttk.Notebook() + self.child1 = ttk.Label() + self.child2 = ttk.Label() + self.nb.add(self.child1, text='a') + self.nb.add(self.child2, text='b') + + def tearDown(self): + self.child1.destroy() + self.child2.destroy() + self.nb.destroy() + + + def test_tab_identifiers(self): + self.nb.forget(0) + self.nb.hide(self.child2) + self.failUnlessRaises(tkinter.TclError, self.nb.tab, self.child1) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.index('end'), 1) + self.nb.select(self.child2) + + self.failUnless(self.nb.tab('current')) + self.nb.add(self.child1, text='a') + + self.nb.pack() + self.nb.wait_visibility() + self.failUnlessEqual(self.nb.tab('@5,5'), self.nb.tab('current')) + + for i in range(5, 100, 5): + if self.nb.tab('@%d, 5' % i, text=None) == 'a': + break + else: + self.fail("Tab with text 'a' not found") + + + def test_add_and_hidden(self): + self.failUnlessRaises(tkinter.TclError, self.nb.hide, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.hide, 'hi') + self.failUnlessRaises(tkinter.TclError, self.nb.hide, None) + self.failUnlessRaises(tkinter.TclError, self.nb.add, None) + self.failUnlessRaises(tkinter.TclError, self.nb.add, ttk.Label(), + unknown='option') + + tabs = self.nb.tabs() + self.nb.hide(self.child1) + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.tabs(), tabs) + + child = ttk.Label() + self.nb.add(child, text='c') + tabs = self.nb.tabs() + + curr = self.nb.index('current') + # verify that the tab gets readded at its previous position + child2_index = self.nb.index(self.child2) + self.nb.hide(self.child2) + self.nb.add(self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.failUnlessEqual(self.nb.index(self.child2), child2_index) + self.failUnless(str(self.child2) == self.nb.tabs()[child2_index]) + # but the tab next to it (not hidden) is the one selected now + self.failUnlessEqual(self.nb.index('current'), curr + 1) + + + def test_forget(self): + self.failUnlessRaises(tkinter.TclError, self.nb.forget, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.forget, 'hi') + self.failUnlessRaises(tkinter.TclError, self.nb.forget, None) + + tabs = self.nb.tabs() + child1_index = self.nb.index(self.child1) + self.nb.forget(self.child1) + self.failIf(str(self.child1) in self.nb.tabs()) + self.failUnlessEqual(len(tabs) - 1, len(self.nb.tabs())) + + self.nb.add(self.child1) + self.failUnlessEqual(self.nb.index(self.child1), 1) + self.failIf(child1_index == self.nb.index(self.child1)) + + + def test_index(self): + self.failUnlessRaises(tkinter.TclError, self.nb.index, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.index, None) + + self.failUnless(isinstance(self.nb.index('end'), int)) + self.failUnlessEqual(self.nb.index(self.child1), 0) + self.failUnlessEqual(self.nb.index(self.child2), 1) + self.failUnlessEqual(self.nb.index('end'), 2) + + + def test_insert(self): + # moving tabs + tabs = self.nb.tabs() + self.nb.insert(1, tabs[0]) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert(self.child1, self.child2) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert('end', self.child1) + self.failUnlessEqual(self.nb.tabs(), (tabs[1], tabs[0])) + self.nb.insert('end', 0) + self.failUnlessEqual(self.nb.tabs(), tabs) + # bad moves + self.failUnlessRaises(tkinter.TclError, self.nb.insert, 2, tabs[0]) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, -1, tabs[0]) + + # new tab + child3 = ttk.Label() + self.nb.insert(1, child3) + self.failUnlessEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1])) + self.nb.forget(child3) + self.failUnlessEqual(self.nb.tabs(), tabs) + self.nb.insert(self.child1, child3) + self.failUnlessEqual(self.nb.tabs(), (str(child3), ) + tabs) + self.nb.forget(child3) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, 2, child3) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, -1, child3) + + # bad inserts + self.failUnlessRaises(tkinter.TclError, self.nb.insert, 'end', None) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, None, 0) + self.failUnlessRaises(tkinter.TclError, self.nb.insert, None, None) + + + def test_select(self): + self.nb.pack() + self.nb.wait_visibility() + + success = [] + tab_changed = [] + + self.child1.bind('', lambda evt: success.append(True)) + self.nb.bind('<>', + lambda evt: tab_changed.append(True)) + + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.select(self.child2) + self.failUnless(success) + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.update() + self.failUnless(tab_changed) + + + def test_tab(self): + self.failUnlessRaises(tkinter.TclError, self.nb.tab, -1) + self.failUnlessRaises(tkinter.TclError, self.nb.tab, 'notab') + self.failUnlessRaises(tkinter.TclError, self.nb.tab, None) + + self.failUnless(isinstance(self.nb.tab(self.child1), dict)) + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'a') + # newer form for querying a single option + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'a') + self.nb.tab(self.child1, text='abc') + self.failUnlessEqual(self.nb.tab(self.child1, text=None), 'abc') + self.failUnlessEqual(self.nb.tab(self.child1, 'text'), 'abc') + + + def test_tabs(self): + self.failUnlessEqual(len(self.nb.tabs()), 2) + + self.nb.forget(self.child1) + self.nb.forget(self.child2) + + self.failUnlessEqual(self.nb.tabs(), ()) + + + def test_traversal(self): + self.nb.pack() + self.nb.wait_visibility() + + self.nb.select(0) + + support.simulate_mouse_click(self.nb, 5, 5) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child2)) + + self.nb.tab(self.child1, text='a', underline=0) + self.nb.enable_traversal() + self.nb.event_generate('') + self.failUnlessEqual(self.nb.select(), str(self.child1)) + + +class TreeviewTest(unittest.TestCase): + + def setUp(self): + self.tv = ttk.Treeview() + + def tearDown(self): + self.tv.destroy() + + + def test_bbox(self): + self.tv.pack() + self.failUnlessEqual(self.tv.bbox(''), '') + self.tv.wait_visibility() + self.tv.update() + + item_id = self.tv.insert('', 'end') + children = self.tv.get_children() + self.failUnless(children) + + bbox = self.tv.bbox(children[0]) + self.failUnlessEqual(len(bbox), 4) + self.failUnless(isinstance(bbox, tuple)) + for item in bbox: + if not isinstance(item, int): + self.fail("Invalid bounding box: %s" % bbox) + break + + # compare width in bboxes + self.tv['columns'] = ['test'] + self.tv.column('test', width=50) + bbox_column0 = self.tv.bbox(children[0], 0) + root_width = self.tv.column('#0', width=None) + self.failUnlessEqual(bbox_column0[0], bbox[0] + root_width) + + # verify that bbox of a closed item is the empty string + child1 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.bbox(child1), '') + + + def test_children(self): + # no children yet, should get an empty tuple + self.failUnlessEqual(self.tv.get_children(), ()) + + item_id = self.tv.insert('', 'end') + self.failUnless(isinstance(self.tv.get_children(), tuple)) + self.failUnlessEqual(self.tv.get_children()[0], item_id) + + # add item_id and child3 as children of child2 + child2 = self.tv.insert('', 'end') + child3 = self.tv.insert('', 'end') + self.tv.set_children(child2, item_id, child3) + self.failUnlessEqual(self.tv.get_children(child2), (item_id, child3)) + + # child3 has child2 as parent, thus trying to set child2 as a children + # of child3 should result in an error + self.failUnlessRaises(tkinter.TclError, + self.tv.set_children, child3, child2) + + # remove child2 children + self.tv.set_children(child2) + self.failUnlessEqual(self.tv.get_children(child2), ()) + + # remove root's children + self.tv.set_children('') + self.failUnlessEqual(self.tv.get_children(), ()) + + + def test_column(self): + # return a dict with all options/values + self.failUnless(isinstance(self.tv.column('#0'), dict)) + # return a single value of the given option + self.failUnless(isinstance(self.tv.column('#0', width=None), int)) + # set a new value for an option + self.tv.column('#0', width=10) + # testing new way to get option value + self.failUnlessEqual(self.tv.column('#0', 'width'), 10) + self.failUnlessEqual(self.tv.column('#0', width=None), 10) + # check read-only option + self.failUnlessRaises(tkinter.TclError, self.tv.column, '#0', id='X') + + self.failUnlessRaises(tkinter.TclError, self.tv.column, 'invalid') + invalid_kws = [ + {'unknown_option': 'some value'}, {'stretch': 'wrong'}, + {'anchor': 'wrong'}, {'width': 'wrong'}, {'minwidth': 'wrong'} + ] + for kw in invalid_kws: + self.failUnlessRaises(tkinter.TclError, self.tv.column, '#0', + **kw) + + + def test_delete(self): + self.failUnlessRaises(tkinter.TclError, self.tv.delete, '#0') + + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + self.tv.delete(item_id) + self.failIf(self.tv.get_children()) + + # reattach should fail + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, item_id, '', 'end') + + # test multiple item delete + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + self.failUnlessEqual(self.tv.get_children(), (item1, item2)) + + self.tv.delete(item1, item2) + self.failIf(self.tv.get_children()) + + + def test_detach_reattach(self): + item_id = self.tv.insert('', 'end') + item2 = self.tv.insert(item_id, 'end') + + # calling detach without items is valid, although it does nothing + prev = self.tv.get_children() + self.tv.detach() # this should do nothing + self.failUnlessEqual(prev, self.tv.get_children()) + + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # detach item with children + self.tv.detach(item_id) + self.failIf(self.tv.get_children()) + + # reattach item with children + self.tv.reattach(item_id, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, )) + self.failUnlessEqual(self.tv.get_children(item_id), (item2, )) + + # move a children to the root + self.tv.move(item2, '', 'end') + self.failUnlessEqual(self.tv.get_children(), (item_id, item2)) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + # bad values + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, 'nonexistant', '', 'end') + self.failUnlessRaises(tkinter.TclError, + self.tv.detach, 'nonexistant') + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, item2, 'otherparent', 'end') + self.failUnlessRaises(tkinter.TclError, + self.tv.reattach, item2, '', 'invalid') + + # multiple detach + self.tv.detach(item_id, item2) + self.failUnlessEqual(self.tv.get_children(), ()) + self.failUnlessEqual(self.tv.get_children(item_id), ()) + + + def test_exists(self): + self.failUnlessEqual(self.tv.exists('something'), False) + self.failUnlessEqual(self.tv.exists(''), True) + self.failUnlessEqual(self.tv.exists({}), False) + + # the following will make a tk.call equivalent to + # tk.call(treeview, "exists") which should result in an error + # in the tcl interpreter since tk requires an item. + self.failUnlessRaises(tkinter.TclError, self.tv.exists, None) + + + def test_focus(self): + # nothing is focused right now + self.failUnlessEqual(self.tv.focus(), '') + + item1 = self.tv.insert('', 'end') + self.tv.focus(item1) + self.failUnlessEqual(self.tv.focus(), item1) + + self.tv.delete(item1) + self.failUnlessEqual(self.tv.focus(), '') + + # try focusing inexistant item + self.failUnlessRaises(tkinter.TclError, self.tv.focus, 'hi') + + + def test_heading(self): + # check a dict is returned + self.failUnless(isinstance(self.tv.heading('#0'), dict)) + + # check a value is returned + self.tv.heading('#0', text='hi') + self.failUnlessEqual(self.tv.heading('#0', 'text'), 'hi') + self.failUnlessEqual(self.tv.heading('#0', text=None), 'hi') + + # invalid option + self.failUnlessRaises(tkinter.TclError, self.tv.heading, '#0', + background=None) + # invalid value + self.failUnlessRaises(tkinter.TclError, self.tv.heading, '#0', + anchor=1) + + + def test_heading_callback(self): + def simulate_heading_click(x, y): + support.simulate_mouse_click(self.tv, x, y) + self.tv.update_idletasks() + + success = [] # no success for now + + self.tv.pack() + self.tv.wait_visibility() + self.tv.heading('#0', command=lambda: success.append(True)) + self.tv.column('#0', width=100) + self.tv.update() + + # assuming that the coords (5, 5) fall into heading #0 + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + success = [] + commands = self.tv.master._tclCommands + self.tv.heading('#0', command=str(self.tv.heading('#0', command=None))) + self.failUnlessEqual(commands, self.tv.master._tclCommands) + simulate_heading_click(5, 5) + if not success: + self.fail("The command associated to the treeview heading wasn't " + "invoked.") + + # XXX The following raises an error in a tcl interpreter, but not in + # Python + #self.tv.heading('#0', command='I dont exist') + #simulate_heading_click(5, 5) + + + def test_index(self): + # item 'what' doesn't exist + self.failUnlessRaises(tkinter.TclError, self.tv.index, 'what') + + self.failUnlessEqual(self.tv.index(''), 0) + + item1 = self.tv.insert('', 'end') + item2 = self.tv.insert('', 'end') + c1 = self.tv.insert(item1, 'end') + c2 = self.tv.insert(item1, 'end') + self.failUnlessEqual(self.tv.index(item1), 0) + self.failUnlessEqual(self.tv.index(c1), 0) + self.failUnlessEqual(self.tv.index(c2), 1) + self.failUnlessEqual(self.tv.index(item2), 1) + + self.tv.move(item2, '', 0) + self.failUnlessEqual(self.tv.index(item2), 0) + self.failUnlessEqual(self.tv.index(item1), 1) + + # check that index still works even after its parent and siblings + # have been detached + self.tv.detach(item1) + self.failUnlessEqual(self.tv.index(c2), 1) + self.tv.detach(c1) + self.failUnlessEqual(self.tv.index(c2), 0) + + # but it fails after item has been deleted + self.tv.delete(item1) + self.failUnlessRaises(tkinter.TclError, self.tv.index, c2) + + + def test_insert_item(self): + # parent 'none' doesn't exist + self.failUnlessRaises(tkinter.TclError, self.tv.insert, 'none', 'end') + + # open values + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + open='') + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + open='please') + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=True))) + self.failIf(self.tv.delete(self.tv.insert('', 'end', open=False))) + + # invalid index + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'middle') + + # trying to duplicate item id is invalid + itemid = self.tv.insert('', 'end', 'first-item') + self.failUnlessEqual(itemid, 'first-item') + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + 'first-item') + self.failUnlessRaises(tkinter.TclError, self.tv.insert, '', 'end', + MockTclObj('first-item')) + + # unicode values + value = '\xe1ba' + item = self.tv.insert('', 'end', values=(value, )) + self.failUnlessEqual(self.tv.item(item, 'values'), (value, )) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.tv.item(item, values=list(self.tv.item(item, values=None))) + self.failUnlessEqual(self.tv.item(item, values=None), (value, )) + + self.failUnless(isinstance(self.tv.item(item), dict)) + + # erase item values + self.tv.item(item, values='') + self.failIf(self.tv.item(item, values=None)) + + # item tags + item = self.tv.insert('', 'end', tags=[1, 2, value]) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2', value)) + self.tv.item(item, tags=[]) + self.failIf(self.tv.item(item, tags=None)) + self.tv.item(item, tags=(1, 2)) + self.failUnlessEqual(self.tv.item(item, tags=None), ('1', '2')) + + # values with spaces + item = self.tv.insert('', 'end', values=('a b c', + '%s %s' % (value, value))) + self.failUnlessEqual(self.tv.item(item, values=None), + ('a b c', '%s %s' % (value, value))) + + # text + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text="Label here"), text=None), + "Label here") + self.failUnlessEqual(self.tv.item( + self.tv.insert('', 'end', text=value), text=None), + value) + + + def test_set(self): + self.tv['columns'] = ['A', 'B'] + item = self.tv.insert('', 'end', values=['a', 'b']) + self.failUnlessEqual(self.tv.set(item), {'A': 'a', 'B': 'b'}) + + self.tv.set(item, 'B', 'a') + self.failUnlessEqual(self.tv.item(item, values=None), ('a', 'a')) + + self.tv['columns'] = ['B'] + self.failUnlessEqual(self.tv.set(item), {'B': 'a'}) + + self.tv.set(item, 'B', 'b') + self.failUnlessEqual(self.tv.set(item, column='B'), 'b') + self.failUnlessEqual(self.tv.item(item, values=None), ('b', 'a')) + + self.tv.set(item, 'B', 123) + self.failUnlessEqual(self.tv.set(item, 'B'), 123) + self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) + self.failUnlessEqual(self.tv.set(item), {'B': 123}) + + # inexistant column + self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A') + self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A', 'b') + + # inexistant item + self.failUnlessRaises(tkinter.TclError, self.tv.set, 'notme') + + + def test_tag_bind(self): + events = [] + item1 = self.tv.insert('', 'end', tags=['call']) + item2 = self.tv.insert('', 'end', tags=['call']) + self.tv.tag_bind('call', '', + lambda evt: events.append(1)) + self.tv.tag_bind('call', '', + lambda evt: events.append(2)) + + self.tv.pack() + self.tv.wait_visibility() + self.tv.update() + + pos_y = set() + found = set() + for i in range(0, 100, 10): + if len(found) == 2: # item1 and item2 already found + break + item_id = self.tv.identify_row(i) + if item_id and item_id not in found: + pos_y.add(i) + found.add(item_id) + + self.failUnlessEqual(len(pos_y), 2) # item1 and item2 y pos + for y in pos_y: + support.simulate_mouse_click(self.tv, 0, y) + + # by now there should be 4 things in the events list, since each + # item had a bind for two events that were simulated above + self.failUnlessEqual(len(events), 4) + for evt in zip(events[::2], events[1::2]): + self.failUnlessEqual(evt, (1, 2)) + + + def test_tag_configure(self): + # Just testing parameter passing for now + self.failUnlessRaises(TypeError, self.tv.tag_configure) + self.failUnlessRaises(tkinter.TclError, self.tv.tag_configure, + 'test', sky='blue') + self.tv.tag_configure('test', foreground='blue') + self.failUnlessEqual(self.tv.tag_configure('test', 'foreground'), + 'blue') + self.failUnlessEqual(self.tv.tag_configure('test', foreground=None), + 'blue') + self.failUnless(isinstance(self.tv.tag_configure('test'), dict)) + + +tests_gui = ( + WidgetTest, ButtonTest, CheckbuttonTest, RadiobuttonTest, + ComboboxTest, EntryTest, PanedwindowTest, ScaleTest, NotebookTest, + TreeviewTest + ) + +if __name__ == "__main__": + run_unittest(*tests_gui) Added: python/branches/py3k/Lib/tkinter/ttk.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/ttk.py Wed Jan 28 15:41:10 2009 @@ -0,0 +1,1636 @@ +"""Ttk wrapper. + +This module provides classes to allow using Tk themed widget set. + +Ttk is based on a revised and enhanced version of +TIP #48 (http://tip.tcl.tk/48) specified style engine. + +Its basic idea is to separate, to the extent possible, the code +implementing a widget's behavior from the code implementing its +appearance. Widget class bindings are primarily responsible for +maintaining the widget state and invoking callbacks, all aspects +of the widgets appearance lies at Themes. +""" + +__version__ = "0.3.1" + +__author__ = "Guilherme Polo " + +__all__ = ["Button", "Checkbutton", "Combobox", "Entry", "Frame", "Label", + "Labelframe", "LabelFrame", "Menubutton", "Notebook", "Panedwindow", + "PanedWindow", "Progressbar", "Radiobutton", "Scale", "Scrollbar", + "Separator", "Sizegrip", "Style", "Treeview", + # Extensions + "LabeledScale", "OptionMenu", + # functions + "tclobjs_to_py"] + +import tkinter + +_flatten = tkinter._flatten + +# Verify if Tk is new enough to not need Tile checking +_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 _format_optdict(optdict, script=False, ignore=None): + """Formats optdict to a tuple to pass it to tk.call. + + E.g. (script=False): + {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns: + ('-foreground', 'blue', '-padding', '1 2 3 4')""" + format = "%s" if not script else "{%s}" + + opts = [] + for opt, value in optdict.items(): + if ignore and opt in ignore: + continue + + if isinstance(value, (list, tuple)): + v = [] + for val in value: + if isinstance(val, str): + v.append(str(val) if val else '{}') + else: + v.append(str(val)) + + # format v according to the script option, but also check for + # space in any value in v in order to group them correctly + value = format % ' '.join( + ('{%s}' if ' ' in val else '%s') % val for val in v) + + if script and value == '': + value = '{}' # empty string in Python is equivalent to {} in Tcl + + opts.append(("-%s" % opt, value)) + + # Remember: _flatten skips over None + return _flatten(opts) + +def _format_mapdict(mapdict, script=False): + """Formats mapdict to pass it to tk.call. + + E.g. (script=False): + {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} + + returns: + + ('-expand', '{active selected} grey focus {1, 2, 3, 4}')""" + # if caller passes a Tcl script to tk.call, all the values need to + # be grouped into words (arguments to a command in Tcl dialect) + format = "%s" if not script else "{%s}" + + opts = [] + for opt, value in mapdict.items(): + + opt_val = [] + # each value in mapdict is expected to be a sequence, where each item + # is another sequence containing a state (or several) and a value + for statespec in value: + state, val = statespec[:-1], statespec[-1] + + if len(state) > 1: # group multiple states + state = "{%s}" % ' '.join(state) + else: # single state + # if it is empty (something that evaluates to False), then + # format it to Tcl code to denote the "normal" state + state = state[0] or '{}' + + if isinstance(val, (list, tuple)): # val needs to be grouped + val = "{%s}" % ' '.join(map(str, val)) + + opt_val.append("%s %s" % (state, val)) + + opts.append(("-%s" % opt, format % ' '.join(opt_val))) + + return _flatten(opts) + +def _format_elemcreate(etype, script=False, *args, **kw): + """Formats args and kw according to the given element factory etype.""" + spec = None + opts = () + if etype in ("image", "vsapi"): + if etype == "image": # define an element based on an image + # first arg should be the default image name + iname = args[0] + # next args, if any, are statespec/value pairs which is almost + # a mapdict, but we just need the value + imagespec = _format_mapdict({None: args[1:]})[1] + spec = "%s %s" % (iname, imagespec) + + else: + # define an element whose visual appearance is drawn using the + # Microsoft Visual Styles API which is responsible for the + # themed styles on Windows XP and Vista. + # Availability: Tk 8.6, Windows XP and Vista. + class_name, part_id = args[:2] + statemap = _format_mapdict({None: args[2:]})[1] + spec = "%s %s %s" % (class_name, part_id, statemap) + + opts = _format_optdict(kw, script) + + elif etype == "from": # clone an element + # it expects a themename and optionally an element to clone from, + # otherwise it will clone {} (empty element) + spec = args[0] # theme name + if len(args) > 1: # elementfrom specified + opts = (args[1], ) + + if script: + spec = '{%s}' % spec + opts = ' '.join(map(str, opts)) + + return spec, opts + +def _format_layoutlist(layout, indent=0, indent_size=2): + """Formats a layout list so we can pass the result to ttk::style + layout and ttk::style settings. Note that the layout doesn't has to + be a list necessarily. + + E.g.: + [("Menubutton.background", None), + ("Menubutton.button", {"children": + [("Menubutton.focus", {"children": + [("Menubutton.padding", {"children": + [("Menubutton.label", {"side": "left", "expand": 1})] + })] + })] + }), + ("Menubutton.indicator", {"side": "right"}) + ] + + returns: + + Menubutton.background + Menubutton.button -children { + Menubutton.focus -children { + Menubutton.padding -children { + Menubutton.label -side left -expand 1 + } + } + } + Menubutton.indicator -side right""" + script = [] + + for layout_elem in layout: + elem, opts = layout_elem + opts = opts or {} + fopts = ' '.join(map(str, _format_optdict(opts, True, "children"))) + head = "%s%s%s" % (' ' * indent, elem, (" %s" % fopts) if fopts else '') + + if "children" in opts: + script.append(head + " -children {") + indent += indent_size + newscript, indent = _format_layoutlist(opts['children'], indent, + indent_size) + script.append(newscript) + indent -= indent_size + script.append('%s}' % (' ' * indent)) + else: + script.append(head) + + return '\n'.join(script), indent + +def _script_from_settings(settings): + """Returns an appropriate script, based on settings, according to + theme_settings definition to be used by theme_settings and + theme_create.""" + script = [] + # a script will be generated according to settings passed, which + # will then be evaluated by Tcl + for name, opts in settings.items(): + # will format specific keys according to Tcl code + if opts.get('configure'): # format 'configure' + s = ' '.join(map(str, _format_optdict(opts['configure'], True))) + script.append("ttk::style configure %s %s;" % (name, s)) + + if opts.get('map'): # format 'map' + s = ' '.join(map(str, _format_mapdict(opts['map'], True))) + script.append("ttk::style map %s %s;" % (name, s)) + + if 'layout' in opts: # format 'layout' which may be empty + if not opts['layout']: + s = 'null' # could be any other word, but this one makes sense + else: + s, _ = _format_layoutlist(opts['layout']) + script.append("ttk::style layout %s {\n%s\n}" % (name, s)) + + if opts.get('element create'): # format 'element create' + eopts = opts['element create'] + etype = eopts[0] + + # find where args end, and where kwargs start + argc = 1 # etype was the first one + while argc < len(eopts) and not hasattr(eopts[argc], 'items'): + argc += 1 + + elemargs = eopts[1:argc] + elemkw = eopts[argc] if argc < len(eopts) and eopts[argc] else {} + spec, opts = _format_elemcreate(etype, True, *elemargs, **elemkw) + + script.append("ttk::style element create %s %s %s %s" % ( + name, etype, spec, opts)) + + return '\n'.join(script) + +def _dict_from_tcltuple(ttuple, cut_minus=True): + """Break tuple in pairs, format it properly, then build the return + dict. If cut_minus is True, the supposed '-' prefixing options will + be removed. + + ttuple is expected to contain an even number of elements.""" + opt_start = 1 if cut_minus else 0 + + retdict = {} + it = iter(ttuple) + for opt, val in zip(it, it): + retdict[str(opt)[opt_start:]] = val + + return tclobjs_to_py(retdict) + +def _list_from_statespec(stuple): + """Construct a list from the given statespec tuple according to the + accepted statespec accepted by _format_mapdict.""" + nval = [] + for val in stuple: + typename = getattr(val, 'typename', None) + if typename is None: + nval.append(val) + else: # this is a Tcl object + val = str(val) + if typename == 'StateSpec': + val = val.split() + nval.append(val) + + it = iter(nval) + return [_flatten(spec) for spec in zip(it, it)] + +def _list_from_layouttuple(ltuple): + """Construct a list from the tuple returned by ttk::layout, this is + somewhat the reverse of _format_layoutlist.""" + res = [] + + indx = 0 + while indx < len(ltuple): + name = ltuple[indx] + opts = {} + res.append((name, opts)) + indx += 1 + + while indx < len(ltuple): # grab name's options + opt, val = ltuple[indx:indx + 2] + if not opt.startswith('-'): # found next name + break + + opt = opt[1:] # remove the '-' from the option + indx += 2 + + if opt == 'children': + val = _list_from_layouttuple(val) + + opts[opt] = val + + return res + +def _val_or_dict(options, func, *args): + """Format options then call func with args and options and return + the appropriate result. + + If no option is specified, a dict is returned. If a option is + specified with the None value, the value for that option is returned. + Otherwise, the function just sets the passed options and the caller + shouldn't be expecting a return value anyway.""" + options = _format_optdict(options) + res = func(*(args + options)) + + if len(options) % 2: # option specified without a value, return its value + return res + + return _dict_from_tcltuple(res) + +def _convert_stringval(value): + """Converts a value to, hopefully, a more appropriate Python object.""" + value = str(value) + try: + value = int(value) + except (ValueError, TypeError): + pass + + return value + +def tclobjs_to_py(adict): + """Returns adict with its values converted from Tcl objects to Python + objects.""" + for opt, val in adict.items(): + if val and hasattr(val, '__len__') and not isinstance(val, str): + if getattr(val[0], 'typename', None) == 'StateSpec': + val = _list_from_statespec(val) + else: + val = list(map(_convert_stringval, val)) + + elif hasattr(val, 'typename'): # some other (single) Tcl object + val = _convert_stringval(val) + + adict[opt] = val + + return adict + + +class Style(object): + """Manipulate style database.""" + + _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") + + self.master = master + self.tk = self.master.tk + + + def configure(self, style, query_opt=None, **kw): + """Query or sets the default value of the specified option(s) in + style. + + Each key in kw is an option and each value is either a string or + a sequence identifying the value for that option.""" + if query_opt is not None: + kw[query_opt] = None + return _val_or_dict(kw, self.tk.call, self._name, "configure", style) + + + def map(self, style, query_opt=None, **kw): + """Query or sets dynamic values of the specified option(s) in + style. + + Each key in kw is an option and each value should be a list or a + tuple (usually) containing statespecs grouped in tuples, or list, + or something else of your preference. A statespec is compound of + one or more states and then a value.""" + if query_opt is not None: + return _list_from_statespec( + self.tk.call(self._name, "map", style, '-%s' % query_opt)) + + return _dict_from_tcltuple( + self.tk.call(self._name, "map", style, *(_format_mapdict(kw)))) + + + def lookup(self, style, option, state=None, default=None): + """Returns the value specified for option in style. + + If state is specified it is expected to be a sequence of one + or more states. If the default argument is set, it is used as + a fallback value in case no specification for option is found.""" + state = ' '.join(state) if state else '' + + return self.tk.call(self._name, "lookup", style, '-%s' % option, + state, default) + + + def layout(self, style, layoutspec=None): + """Define the widget layout for given style. If layoutspec is + omitted, return the layout specification for given style. + + layoutspec is expected to be a list or an object different than + None that evaluates to False if you want to "turn off" that style. + If it is a list (or tuple, or something else), each item should be + a tuple where the first item is the layout name and the second item + should have the format described below: + + LAYOUTS + + A layout can contain the value None, if takes no options, or + a dict of options specifying how to arrange the element. + The layout mechanism uses a simplified version of the pack + geometry manager: given an initial cavity, each element is + allocated a parcel. Valid options/values are: + + side: whichside + Specifies which side of the cavity to place the + element; one of top, right, bottom or left. If + omitted, the element occupies the entire cavity. + + sticky: nswe + Specifies where the element is placed inside its + allocated parcel. + + children: [sublayout... ] + Specifies a list of elements to place inside the + element. Each element is a tuple (or other sequence) + where the first item is the layout name, and the other + is a LAYOUT.""" + lspec = None + if layoutspec: + lspec = _format_layoutlist(layoutspec)[0] + elif layoutspec is not None: # will disable the layout ({}, '', etc) + lspec = "null" # could be any other word, but this may make sense + # when calling layout(style) later + + return _list_from_layouttuple( + self.tk.call(self._name, "layout", style, lspec)) + + + def element_create(self, elementname, etype, *args, **kw): + """Create a new element in the current theme of given etype.""" + spec, opts = _format_elemcreate(etype, False, *args, **kw) + self.tk.call(self._name, "element", "create", elementname, etype, + spec, *opts) + + + def element_names(self): + """Returns the list of elements defined in the current theme.""" + return self.tk.call(self._name, "element", "names") + + + def element_options(self, elementname): + """Return the list of elementname's options.""" + return self.tk.call(self._name, "element", "options", elementname) + + + def theme_create(self, themename, parent=None, settings=None): + """Creates a new theme. + + It is an error if themename already exists. If parent is + specified, the new theme will inherit styles, elements and + layouts from the specified parent theme. If settings are present, + they are expected to have the same syntax used for theme_settings.""" + script = _script_from_settings(settings) if settings else '' + + if parent: + self.tk.call(self._name, "theme", "create", themename, + "-parent", parent, "-settings", script) + else: + self.tk.call(self._name, "theme", "create", themename, + "-settings", script) + + + def theme_settings(self, themename, settings): + """Temporarily sets the current theme to themename, apply specified + settings and then restore the previous theme. + + Each key in settings is a style and each value may contain the + keys 'configure', 'map', 'layout' and 'element create' and they + are expected to have the same format as specified by the methods + configure, map, layout and element_create respectively.""" + script = _script_from_settings(settings) + self.tk.call(self._name, "theme", "settings", themename, script) + + + def theme_names(self): + """Returns a list of all known themes.""" + return self.tk.call(self._name, "theme", "names") + + + def theme_use(self, themename=None): + """If themename is None, returns the theme in use, otherwise, set + the current theme to themename, refreshes all widgets and emits + a <> event.""" + if themename is None: + # Starting on Tk 8.6, checking this global is no longer needed + # since it allows doing self.tk.call(self._name, "theme", "use") + return self.tk.eval("return $ttk::currentTheme") + + # using "ttk::setTheme" instead of "ttk::style theme use" causes + # the variable currentTheme to be updated, also, ttk::setTheme calls + # "ttk::style theme use" in order to change theme. + self.tk.call("ttk::setTheme", themename) + + +class Widget(tkinter.Widget): + """Base class for Tk themed widgets.""" + + def __init__(self, master, widgetname, kw=None): + """Constructs a Ttk Widget with the parent master. + + STANDARD OPTIONS + + class, cursor, takefocus, style + + SCROLLABLE WIDGET OPTIONS + + xscrollcommand, yscrollcommand + + LABEL WIDGET OPTIONS + + text, textvariable, underline, image, compound, width + + WIDGET STATES + + active, disabled, focus, pressed, selected, background, + readonly, alternate, invalid + """ + tkinter.Widget.__init__(self, master, widgetname, kw=kw) + + + def identify(self, x, y): + """Returns the name of the element at position x, y, or the empty + string if the point does not lie within any element. + + x and y are pixel coordinates relative to the widget.""" + return self.tk.call(self._w, "identify", x, y) + + + def instate(self, statespec, callback=None, *args, **kw): + """Test the widget's state. + + If callback is not specified, returns True if the widget state + matches statespec and False otherwise. If callback is specified, + then it will be invoked with *args, **kw if the widget state + matches statespec. statespec is expected to be a sequence.""" + ret = self.tk.call(self._w, "instate", ' '.join(statespec)) + if ret and callback: + return callback(*args, **kw) + + return bool(ret) + + + def state(self, statespec=None): + """Modify or inquire widget state. + + Widget state is returned if statespec is None, otherwise it is + set according to the statespec flags and then a new state spec + is returned indicating which flags were changed. statespec is + expected to be a sequence.""" + if statespec is not None: + statespec = ' '.join(statespec) + + return self.tk.splitlist(str(self.tk.call(self._w, "state", statespec))) + + +class Button(Widget): + """Ttk Button widget, displays a textual label and/or image, and + evaluates a command when pressed.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Button widget with the parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + command, default, width + """ + Widget.__init__(self, master, "ttk::button", kw) + + + def invoke(self): + """Invokes the command associated with the button.""" + return self.tk.call(self._w, "invoke") + + +class Checkbutton(Widget): + """Ttk Checkbutton widget which is either in on- or off-state.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Checkbutton widget with the parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + command, offvalue, onvalue, variable + """ + Widget.__init__(self, master, "ttk::checkbutton", kw) + + + def invoke(self): + """Toggles between the selected and deselected states and + invokes the associated command. If the widget is currently + selected, sets the option variable to the offvalue option + and deselects the widget; otherwise, sets the option variable + to the option onvalue. + + Returns the result of the associated command.""" + return self.tk.call(self._w, "invoke") + + +class Entry(Widget, tkinter.Entry): + """Ttk Entry widget displays a one-line text string and allows that + string to be edited by the user.""" + + def __init__(self, master=None, widget=None, **kw): + """Constructs a Ttk Entry widget with the parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus, xscrollcommand + + WIDGET-SPECIFIC OPTIONS + + exportselection, invalidcommand, justify, show, state, + textvariable, validate, validatecommand, width + + VALIDATION MODES + + none, key, focus, focusin, focusout, all + """ + Widget.__init__(self, master, widget or "ttk::entry", kw) + + + def bbox(self, index): + """Return a tuple of (x, y, width, height) which describes the + bounding box of the character given by index.""" + return self.tk.call(self._w, "bbox", index) + + + def identify(self, x, y): + """Returns the name of the element at position x, y, or the + empty string if the coordinates are outside the window.""" + return self.tk.call(self._w, "identify", x, y) + + + def validate(self): + """Force revalidation, independent of the conditions specified + by the validate option. Returns False if validation fails, True + if it succeeds. Sets or clears the invalid state accordingly.""" + return bool(self.tk.call(self._w, "validate")) + + +class Combobox(Entry): + """Ttk Combobox widget combines a text field with a pop-down list of + values.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Combobox widget with the parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + exportselection, justify, height, postcommand, state, + textvariable, values, width + """ + # The "values" option may need special formatting, so leave to + # _format_optdict the responsability to format it + if "values" in kw: + kw["values"] = _format_optdict({'v': kw["values"]})[1] + + Entry.__init__(self, master, "ttk::combobox", **kw) + + + def __setitem__(self, item, value): + if item == "values": + value = _format_optdict({item: value})[1] + + Entry.__setitem__(self, item, value) + + + def configure(self, cnf=None, **kw): + """Custom Combobox configure, created to properly format the values + option.""" + if "values" in kw: + kw["values"] = _format_optdict({'v': kw["values"]})[1] + + return Entry.configure(self, cnf, **kw) + + + def current(self, newindex=None): + """If newindex is supplied, sets the combobox value to the + element at position newindex in the list of values. Otherwise, + returns the index of the current value in the list of values + or -1 if the current value does not appear in the list.""" + return self.tk.call(self._w, "current", newindex) + + + def set(self, value): + """Sets the value of the combobox to value.""" + self.tk.call(self._w, "set", value) + + +class Frame(Widget): + """Ttk Frame widget is a container, used to group other widgets + together.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Frame with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + borderwidth, relief, padding, width, height + """ + Widget.__init__(self, master, "ttk::frame", kw) + + +class Label(Widget): + """Ttk Label widget displays a textual label and/or image.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Label with parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, style, takefocus, text, + textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + anchor, background, font, foreground, justify, padding, + relief, text, wraplength + """ + Widget.__init__(self, master, "ttk::label", kw) + + +class Labelframe(Widget): + """Ttk Labelframe widget is a container used to group other widgets + together. It has an optional label, which may be a plain text string + or another widget.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Labelframe with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + labelanchor, text, underline, padding, labelwidget, width, + height + """ + Widget.__init__(self, master, "ttk::labelframe", kw) + +LabelFrame = Labelframe # tkinter name compatibility + + +class Menubutton(Widget): + """Ttk Menubutton widget displays a textual label and/or image, and + displays a menu when pressed.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Menubutton with parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + direction, menu + """ + Widget.__init__(self, master, "ttk::menubutton", kw) + + +class Notebook(Widget): + """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.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Notebook with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + height, padding, width + + TAB OPTIONS + + state, sticky, padding, text, image, compound, underline + + TAB IDENTIFIERS (tab_id) + + The tab_id argument found in several methods 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 + defines the tab + * The string "current", which identifies the + currently-selected tab + * The string "end", which returns the number of tabs (only + valid for method index) + """ + Widget.__init__(self, master, "ttk::notebook", kw) + + + def add(self, child, **kw): + """Adds a new tab to the notebook. + + If window is currently managed by the notebook but hidden, it is + restored to its previous position.""" + self.tk.call(self._w, "add", child, *(_format_optdict(kw))) + + + def forget(self, tab_id): + """Removes the tab specified by tab_id, unmaps and unmanages the + associated window.""" + self.tk.call(self._w, "forget", tab_id) + + + def hide(self, tab_id): + """Hides the tab specified by tab_id. + + The tab will not be displayed, but the associated window remains + managed by the notebook and its configuration remembered. Hidden + tabs may be restored with the add command.""" + self.tk.call(self._w, "hide", tab_id) + + + def identify(self, x, y): + """Returns the name of the tab element at position x, y, or the + empty string if none.""" + return self.tk.call(self._w, "identify", x, y) + + + def index(self, tab_id): + """Returns the numeric index of the tab specified by tab_id, or + the total number of tabs if tab_id is the string "end".""" + return self.tk.call(self._w, "index", tab_id) + + + def insert(self, pos, child, **kw): + """Inserts a pane at the specified position. + + pos is either the string end, an integer index, or the name of + a managed child. If child is already managed by the notebook, + moves it to the specified position.""" + self.tk.call(self._w, "insert", pos, child, *(_format_optdict(kw))) + + + def select(self, tab_id=None): + """Selects the specified tab. + + The associated child window will be displayed, and the + previously-selected window (if different) is unmapped. If tab_id + is omitted, returns the widget name of the currently selected + pane.""" + return self.tk.call(self._w, "select", tab_id) + + + def tab(self, tab_id, option=None, **kw): + """Query or modify the options of the specific tab_id. + + If kw is not given, returns a dict of the tab option values. If option + is specified, returns the value of that option. Otherwise, sets the + options to the corresponding values.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "tab", tab_id) + + + def tabs(self): + """Returns a list of windows managed by the notebook.""" + return self.tk.call(self._w, "tabs") or () + + + def enable_traversal(self): + """Enable keyboard traversal for a toplevel window containing + this notebook. + + This will extend the bindings for the toplevel window containing + this notebook as follows: + + Control-Tab: selects the tab following the currently selected + one + + Shift-Control-Tab: selects the tab preceding the currently + selected one + + Alt-K: where K is the mnemonic (underlined) character of any + tab, will select that tab. + + Multiple notebooks in a single toplevel may be enabled for + traversal, including nested notebooks. However, notebook traversal + only works properly if all panes are direct children of the + notebook.""" + # The only, and good, difference I see is about mnemonics, which works + # after calling this method. Control-Tab and Shift-Control-Tab always + # works (here at least). + self.tk.call("ttk::notebook::enableTraversal", self._w) + + +class Panedwindow(Widget, tkinter.PanedWindow): + """Ttk Panedwindow widget displays a number of subwindows, stacked + either vertically or horizontally.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Panedwindow with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + orient, width, height + + PANE OPTIONS + + weight + """ + Widget.__init__(self, master, "ttk::panedwindow", kw) + + + forget = tkinter.PanedWindow.forget # overrides Pack.forget + + + def insert(self, pos, child, **kw): + """Inserts a pane at the specified positions. + + pos is either the string end, and integer index, or the name + of a child. If child is already managed by the paned window, + moves it to the specified position.""" + self.tk.call(self._w, "insert", pos, child, *(_format_optdict(kw))) + + + def pane(self, pane, option=None, **kw): + """Query or modify the options of the specified pane. + + pane is either an integer index or the name of a managed subwindow. + If kw is not given, returns a dict of the pane option values. If + option is specified then the value for that option is returned. + Otherwise, sets the options to the correspoding values.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "pane", pane) + + + def sashpos(self, index, newpos=None): + """If newpos is specified, sets the position of sash number index. + + May adjust the positions of adjacent sashes to ensure that + positions are monotonically increasing. Sash positions are further + constrained to be between 0 and the total size of the widget. + + Returns the new position of sash number index.""" + return self.tk.call(self._w, "sashpos", index, newpos) + +PanedWindow = Panedwindow # tkinter name compatibility + + +class Progressbar(Widget): + """Ttk Progressbar widget shows the status of a long-running + operation. They can operate in two modes: determinate mode shows the + amount completed relative to the total amount of work to be done, and + indeterminate mode provides an animated display to let the user know + that something is happening.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Progressbar with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + orient, length, mode, maximum, value, variable, phase + """ + Widget.__init__(self, master, "ttk::progressbar", kw) + + + def start(self, interval=None): + """Begin autoincrement mode: schedules a recurring timer event + that calls method step every interval milliseconds. + + interval defaults to 50 milliseconds (20 steps/second) if ommited.""" + self.tk.call(self._w, "start", interval) + + + def step(self, amount=None): + """Increments the value option by amount. + + amount defaults to 1.0 if omitted.""" + self.tk.call(self._w, "step", amount) + + + def stop(self): + """Stop autoincrement mode: cancels any recurring timer event + initiated by start.""" + self.tk.call(self._w, "stop") + + +class Radiobutton(Widget): + """Ttk Radiobutton widgets are used in groups to show or change a + set of mutually-exclusive options.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Radiobutton with parent master. + + STANDARD OPTIONS + + class, compound, cursor, image, state, style, takefocus, + text, textvariable, underline, width + + WIDGET-SPECIFIC OPTIONS + + command, value, variable + """ + Widget.__init__(self, master, "ttk::radiobutton", kw) + + + def invoke(self): + """Sets the option variable to the option value, selects the + widget, and invokes the associated command. + + Returns the result of the command, or an empty string if + no command is specified.""" + return self.tk.call(self._w, "invoke") + + +class Scale(Widget, tkinter.Scale): + """Ttk Scale widget is typically used to control the numeric value of + a linked variable that varies uniformly over some range.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Scale with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + command, from, length, orient, to, value, variable + """ + Widget.__init__(self, master, "ttk::scale", kw) + + + def configure(self, cnf=None, **kw): + """Modify or query scale options. + + Setting a value for any of the "from", "from_" or "to" options + generates a <> event.""" + if cnf: + kw.update(cnf) + Widget.configure(self, **kw) + if any(['from' in kw, 'from_' in kw, 'to' in kw]): + self.event_generate('<>') + + + def get(self, x=None, y=None): + """Get the current value of the value option, or the value + corresponding to the coordinates x, y if they are specified. + + x and y are pixel coordinates relative to the scale widget + origin.""" + return self.tk.call(self._w, 'get', x, y) + + +class Scrollbar(Widget, tkinter.Scrollbar): + """Ttk Scrollbar controls the viewport of a scrollable widget.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Scrollbar with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + command, orient + """ + Widget.__init__(self, master, "ttk::scrollbar", kw) + + +class Separator(Widget): + """Ttk Separator widget displays a horizontal or vertical separator + bar.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Separator with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus + + WIDGET-SPECIFIC OPTIONS + + orient + """ + Widget.__init__(self, master, "ttk::separator", kw) + + +class Sizegrip(Widget): + """Ttk Sizegrip allows the user to resize the containing toplevel + window by pressing and dragging the grip.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Sizegrip with parent master. + + STANDARD OPTIONS + + class, cursor, state, style, takefocus + """ + Widget.__init__(self, master, "ttk::sizegrip", kw) + + +class Treeview(Widget): + """Ttk Treeview widget displays a hierarchical collection of items. + + Each item has a textual label, an optional image, and an optional list + of data values. The data values are displayed in successive columns + after the tree label.""" + + def __init__(self, master=None, **kw): + """Construct a Ttk Treeview with parent master. + + STANDARD OPTIONS + + class, cursor, style, takefocus, xscrollcommand, + yscrollcommand + + WIDGET-SPECIFIC OPTIONS + + columns, displaycolumns, height, padding, selectmode, show + + ITEM OPTIONS + + text, image, values, open, tags + + TAG OPTIONS + + foreground, background, font, image + """ + Widget.__init__(self, master, "ttk::treeview", kw) + + + def bbox(self, item, column=None): + """Returns the bounding box (relative to the treeview widget's + window) of the specified item in the form x y width height. + + If column is specified, returns the bounding box of that cell. + If the item is not visible (i.e., if it is a descendant of a + closed item or is scrolled offscreen), returns an empty string.""" + return self.tk.call(self._w, "bbox", item, column) + + + def get_children(self, item=None): + """Returns a tuple of children belonging to item. + + If item is not specified, returns root children.""" + return self.tk.call(self._w, "children", item or '') or () + + + def set_children(self, item, *newchildren): + """Replaces item's child with newchildren. + + Children present in item that are not present in newchildren + are detached from tree. No items in newchildren may be an + ancestor of item.""" + self.tk.call(self._w, "children", item, newchildren) + + + def column(self, column, option=None, **kw): + """Query or modify the options for the specified column. + + If kw is not given, returns a dict of the column option values. If + option is specified then the value for that option is returned. + Otherwise, sets the options to the corresponding values.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "column", column) + + + def delete(self, *items): + """Delete all specified items and all their descendants. The root + item may not be deleted.""" + self.tk.call(self._w, "delete", items) + + + def detach(self, *items): + """Unlinks all of the specified items from the tree. + + The items and all of their descendants are still present, and may + be reinserted at another point in the tree, but will not be + displayed. The root item may not be detached.""" + self.tk.call(self._w, "detach", items) + + + def exists(self, item): + """Returns True if the specified item is present in the three, + False otherwise.""" + return bool(self.tk.call(self._w, "exists", item)) + + + def focus(self, item=None): + """If item is specified, sets the focus item to item. Otherwise, + returns the current focus item, or '' if there is none.""" + return self.tk.call(self._w, "focus", item) + + + def heading(self, column, option=None, **kw): + """Query or modify the heading options for the specified column. + + If kw is not given, returns a dict of the heading option values. If + option is specified then the value for that option is returned. + Otherwise, sets the options to the corresponding values. + + Valid options/values are: + text: text + The text to display in the column heading + image: image_name + Specifies an image to display to the right of the column + heading + anchor: anchor + Specifies how the heading text should be aligned. One of + the standard Tk anchor values + command: callback + A callback to be invoked when the heading label is + pressed. + + To configure the tree column heading, call this with column = "#0" """ + cmd = kw.get('command') + if cmd and not isinstance(cmd, str): + # callback not registered yet, do it now + kw['command'] = self.master.register(cmd, self._substitute) + + if option is not None: + kw[option] = None + + return _val_or_dict(kw, self.tk.call, self._w, 'heading', column) + + + def identify(self, component, x, y): + """Returns a description of the specified component under the + point given by x and y, or the empty string if no such component + is present at that position.""" + return self.tk.call(self._w, "identify", component, x, y) + + + def identify_row(self, y): + """Returns the item ID of the item at position y.""" + return self.identify("row", 0, y) + + + def identify_column(self, x): + """Returns the data column identifier of the cell at position x. + + The tree column has ID #0.""" + return self.identify("column", x, 0) + + + def identify_region(self, x, y): + """Returns one of: + + heading: Tree heading area. + separator: Space between two columns headings; + tree: The tree area. + cell: A data cell. + + * Availability: Tk 8.6""" + return self.identify("region", x, y) + + + def identify_element(self, x, y): + """Returns the element at position x, y. + + * Availability: Tk 8.6""" + return self.identify("element", x, y) + + + def index(self, item): + """Returns the integer index of item within its parent's list + of children.""" + return self.tk.call(self._w, "index", item) + + + def insert(self, parent, index, iid=None, **kw): + """Creates a new item and return the item identifier of the newly + created item. + + parent is the item ID of the parent item, or the empty string + to create a new top-level item. index is an integer, or the value + end, specifying where in the list of parent's children to insert + the new item. If index is less than or equal to zero, the new node + is inserted at the beginning, if index is greater than or equal to + the current number of children, it is inserted at the end. If iid + is specified, it is used as the item identifier, iid must not + already exist in the tree. Otherwise, a new unique identifier + is generated.""" + opts = _format_optdict(kw) + if iid: + res = self.tk.call(self._w, "insert", parent, index, + "-id", iid, *opts) + else: + res = self.tk.call(self._w, "insert", parent, index, *opts) + + return res + + + def item(self, item, option=None, **kw): + """Query or modify the options for the specified item. + + If no options are given, a dict with options/values for the item + is returned. If option is specified then the value for that option + is returned. Otherwise, sets the options to the corresponding + values as given by kw.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "item", item) + + + def move(self, item, parent, index): + """Moves item to position index in parent's list of children. + + It is illegal to move an item under one of its descendants. If + index is less than or equal to zero, item is moved to the + beginning, if greater than or equal to the number of children, + it is moved to the end. If item was detached it is reattached.""" + self.tk.call(self._w, "move", item, parent, index) + + reattach = move # A sensible method name for reattaching detached items + + + def next(self, item): + """Returns the identifier of item's next sibling, or '' if item + is the last child of its parent.""" + return self.tk.call(self._w, "next", item) + + + def parent(self, item): + """Returns the ID of the parent of item, or '' if item is at the + top level of the hierarchy.""" + return self.tk.call(self._w, "parent", item) + + + def prev(self, item): + """Returns the identifier of item's previous sibling, or '' if + item is the first child of its parent.""" + return self.tk.call(self._w, "prev", item) + + + def see(self, item): + """Ensure that item is visible. + + Sets all of item's ancestors open option to True, and scrolls + the widget if necessary so that item is within the visible + portion of the tree.""" + self.tk.call(self._w, "see", item) + + + def selection(self, selop=None, items=None): + """If selop is not specified, returns selected items.""" + return self.tk.call(self._w, "selection", selop, items) + + + def selection_set(self, items): + """items becomes the new selection.""" + self.selection("set", items) + + + def selection_add(self, items): + """Add items to the selection.""" + self.selection("add", items) + + + def selection_remove(self, items): + """Remove items from the selection.""" + self.selection("remove", items) + + + def selection_toggle(self, items): + """Toggle the selection state of each item in items.""" + self.selection("toggle", items) + + + def set(self, item, column=None, value=None): + """With one argument, returns a dictionary of column/value pairs + for the specified item. With two arguments, returns the current + value of the specified column. With three arguments, sets the + value of given column in given item to the specified value.""" + res = self.tk.call(self._w, "set", item, column, value) + if column is None and value is None: + return _dict_from_tcltuple(res, False) + else: + return res + + + def tag_bind(self, tagname, sequence=None, callback=None): + """Bind a callback for the given event sequence to the tag tagname. + When an event is delivered to an item, the callbacks for each + of the item's tags option are called.""" + self._bind((self._w, "tag", "bind", tagname), sequence, callback, add=0) + + + def tag_configure(self, tagname, option=None, **kw): + """Query or modify the options for the specified tagname. + + If kw is not given, returns a dict of the option settings for tagname. + If option is specified, returns the value for that option for the + specified tagname. Otherwise, sets the options to the corresponding + values for the given tagname.""" + if option is not None: + kw[option] = None + return _val_or_dict(kw, self.tk.call, self._w, "tag", "configure", + tagname) + + + def tag_has(self, tagname, item=None): + """If item is specified, returns 1 or 0 depending on whether the + specified item has the given tagname. Otherwise, returns a list of + all items which have the specified tag. + + * Availability: Tk 8.6""" + return self.tk.call(self._w, "tag", "has", tagname, item) + + + def xview(self, *args): + """Query or modify horizontal position of the treeview.""" + return self.tk.call(self._w, "xview", *args) + + + def yview(self, *args): + """Query or modify vertical position of the treeview.""" + return self.tk.call(self._w, "yview", *args) + + +# Extensions + +class LabeledScale(Frame): + """A Ttk Scale widget with a Ttk Label widget indicating its + current value. + + The Ttk Scale can be accessed through instance.scale, and Ttk Label + can be accessed through instance.label""" + + def __init__(self, master=None, variable=None, from_=0, to=10, **kw): + """Construct an horizontal LabeledScale with parent master, a + variable to be associated with the Ttk Scale widget and its range. + If variable is not specified, a tkinter.IntVar is created. + + WIDGET-SPECIFIC OPTIONS + + compound: 'top' or 'bottom' + Specifies how to display the label relative to the scale. + Defaults to 'top'. + """ + self._label_top = kw.pop('compound', 'top') == 'top' + + Frame.__init__(self, master, **kw) + self._variable = variable or tkinter.IntVar(master) + self._variable.set(from_) + self._last_valid = from_ + + self.label = Label(self) + self.scale = Scale(self, variable=self._variable, from_=from_, to=to) + self.scale.bind('<>', self._adjust) + + # position scale and label according to the compound option + scale_side = 'bottom' if self._label_top else 'top' + label_side = 'top' if scale_side == 'bottom' else 'bottom' + self.scale.pack(side=scale_side, fill='x') + tmp = Label(self).pack(side=label_side) # place holder + self.label.place(anchor='n' if label_side == 'top' else 's') + + # update the label as scale or variable changes + self.__tracecb = self._variable.trace_variable('w', self._adjust) + self.bind('', self._adjust) + self.bind('', self._adjust) + + + def destroy(self): + """Destroy this widget and possibly its associated variable.""" + try: + self._variable.trace_vdelete('w', self.__tracecb) + except AttributeError: + # widget has been destroyed already + pass + else: + del self._variable + Frame.destroy(self) + + + def _adjust(self, *args): + """Adjust the label position according to the scale.""" + def adjust_label(): + self.update_idletasks() # "force" scale redraw + + x, y = self.scale.coords() + if self._label_top: + y = self.scale.winfo_y() - self.label.winfo_reqheight() + else: + y = self.scale.winfo_reqheight() + self.label.winfo_reqheight() + + self.label.place_configure(x=x, y=y) + + from_, to = self.scale['from'], self.scale['to'] + if to < from_: + from_, to = to, from_ + newval = self._variable.get() + if not from_ <= newval <= to: + # value outside range, set value back to the last valid one + self.value = self._last_valid + return + + self._last_valid = newval + self.label['text'] = newval + self.after_idle(adjust_label) + + + def _get_value(self): + """Return current scale value.""" + return self._variable.get() + + + def _set_value(self, val): + """Set new scale value.""" + self._variable.set(val) + + + value = property(_get_value, _set_value) + + +class OptionMenu(Menubutton): + """Themed OptionMenu, based after tkinter's OptionMenu, which allows + the user to select a value from a menu.""" + + def __init__(self, master, variable, default=None, *values, **kwargs): + """Construct a themed OptionMenu widget with master as the parent, + the resource textvariable set to variable, the initially selected + value specified by the default parameter, the menu values given by + *values and additional keywords. + + WIDGET-SPECIFIC OPTIONS + + style: stylename + Menubutton style. + direction: 'above', 'below', 'left', 'right', or 'flush' + Menubutton direction. + command: callback + A callback that will be invoked after selecting an item. + """ + kw = {'textvariable': variable, 'style': kwargs.pop('style', None), + 'direction': kwargs.pop('direction', None)} + Menubutton.__init__(self, master, **kw) + self['menu'] = tkinter.Menu(self, tearoff=False) + + self._variable = variable + self._callback = kwargs.pop('command', None) + if kwargs: + raise tkinter.TclError('unknown option -%s' % ( + next(iter(kwargs.keys())))) + + self.set_menu(default, *values) + + + def __getitem__(self, item): + if item == 'menu': + return self.nametowidget(Menubutton.__getitem__(self, item)) + + return Menubutton.__getitem__(self, item) + + + def set_menu(self, default=None, *values): + """Build a new menu of radiobuttons with *values and optionally + a default value.""" + menu = self['menu'] + menu.delete(0, 'end') + for val in values: + menu.add_radiobutton(label=val, + command=tkinter._setit(self._variable, val, self._callback)) + + if default: + self._variable.set(default) + + + def destroy(self): + """Destroy this widget and its associated variable.""" + del self._variable + Menubutton.destroy(self) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 28 15:41:10 2009 @@ -144,6 +144,8 @@ Library ------- +- 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. From buildbot at python.org Wed Jan 28 16:06:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 15:06:14 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090128150614.CEBF11E4002@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/129 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 test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 28 16:34:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 15:34:34 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090128153435.03D961E4002@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/192 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: 4 tests failed: test_distutils test_doctest 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 python-checkins at python.org Wed Jan 28 16:55:15 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 16:55:15 +0100 (CET) Subject: [Python-checkins] r69052 - in sandbox/trunk/ttk-gsoc/samples: dirbrowser.py mac_searchentry.py plastik_theme.py treeview_multicolumn.py ttkcalendar.py Message-ID: <20090128155515.829991E403C@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 16:55:15 2009 New Revision: 69052 Log: Some minor adjusts. Modified: sandbox/trunk/ttk-gsoc/samples/dirbrowser.py sandbox/trunk/ttk-gsoc/samples/mac_searchentry.py sandbox/trunk/ttk-gsoc/samples/plastik_theme.py sandbox/trunk/ttk-gsoc/samples/treeview_multicolumn.py sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py Modified: sandbox/trunk/ttk-gsoc/samples/dirbrowser.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/dirbrowser.py (original) +++ sandbox/trunk/ttk-gsoc/samples/dirbrowser.py Wed Jan 28 16:55:15 2009 @@ -1,7 +1,6 @@ """A directory browser using Ttk Treeview. -Based on an example found at: -http://bitwalk.blogspot.com/2008/01/ttktreeview.html +Based on the demo found in Tk 8.5 library/demos/browse """ import os import glob @@ -62,9 +61,7 @@ populate_roots(tree) def autoscroll(sbar, first, last): - """Hide and show scrollbar as needed. - - Code from Joe English (JE) at http://wiki.tcl.tk/950""" + """Hide and show scrollbar as needed.""" first, last = float(first), float(last) if first <= 0 and last >= 1: sbar.grid_remove() Modified: sandbox/trunk/ttk-gsoc/samples/mac_searchentry.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/mac_searchentry.py (original) +++ sandbox/trunk/ttk-gsoc/samples/mac_searchentry.py Wed Jan 28 16:55:15 2009 @@ -1,6 +1,7 @@ """Mac style search widget -Translated from Tcl code by Schelte Bron, http://wiki.tcl.tk/18188""" +Translated from Tcl code by Schelte Bron, http://wiki.tcl.tk/18188 +""" try: import Tkinter except ImportError: Modified: sandbox/trunk/ttk-gsoc/samples/plastik_theme.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/plastik_theme.py (original) +++ sandbox/trunk/ttk-gsoc/samples/plastik_theme.py Wed Jan 28 16:55:15 2009 @@ -42,6 +42,8 @@ imgs = {} def _load_imgs(imgdir): imgdir = os.path.expanduser(imgdir) + if not os.path.isdir(imgdir): + raise Exception("%r is not a directory, can't load images" % imgdir) for f in glob.glob("%s/*.gif" % imgdir): img = os.path.split(f)[1] name = img[:-4] Modified: sandbox/trunk/ttk-gsoc/samples/treeview_multicolumn.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/treeview_multicolumn.py (original) +++ sandbox/trunk/ttk-gsoc/samples/treeview_multicolumn.py Wed Jan 28 16:55:15 2009 @@ -1,4 +1,4 @@ -"""Demo based on the demo mclist.tcl included with tk source distribution.""" +"""Demo based on the demo mclist included with tk source distribution.""" try: import Tkinter import tkFont @@ -99,7 +99,11 @@ root.wm_iconname("mclist") import plastik_theme - plastik_theme.install('~/tile-themes/plastik/plastik') + try: + plastik_theme.install('~/tile-themes/plastik/plastik') + except Exception: + import warnings + warnings.warn("plastik theme being used without images") app = App() root.mainloop() Modified: sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py ============================================================================== --- sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py (original) +++ sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py Wed Jan 28 16:55:15 2009 @@ -1,7 +1,6 @@ -"""Simple calendar using ttk Treeview together with calendar and datetime +""" +Simple calendar using ttk Treeview together with calendar and datetime classes. - -written by Guilherme Polo, 2008. """ import calendar @@ -22,7 +21,7 @@ return calendar.LocaleTextCalendar(fwday, locale) class Calendar(ttk.Frame): - # XXX ToDo: critical: cget and configure + # XXX ToDo: cget and configure datetime = calendar.datetime.datetime timedelta = calendar.datetime.timedelta From python-checkins at python.org Wed Jan 28 16:56:02 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 16:56:02 +0100 (CET) Subject: [Python-checkins] r69053 - in python/trunk: Demo/tkinter/README Demo/tkinter/ttk Demo/tkinter/ttk/combo_themes.py Demo/tkinter/ttk/dirbrowser.py Demo/tkinter/ttk/img Demo/tkinter/ttk/img/close.gif Demo/tkinter/ttk/img/close_active.gif Demo/tkinter/ttk/img/close_pressed.gif Demo/tkinter/ttk/listbox_scrollcmd.py Demo/tkinter/ttk/mac_searchentry.py Demo/tkinter/ttk/notebook_closebtn.py Demo/tkinter/ttk/plastik_theme.py Demo/tkinter/ttk/roundframe.py Demo/tkinter/ttk/theme_selector.py Demo/tkinter/ttk/treeview_multicolumn.py Demo/tkinter/ttk/ttkcalendar.py Demo/tkinter/ttk/widget_state.py Misc/NEWS Message-ID: <20090128155602.030A31E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 16:56:01 2009 New Revision: 69053 Log: Demos for ttk added. Added: python/trunk/Demo/tkinter/ttk/ python/trunk/Demo/tkinter/ttk/combo_themes.py (contents, props changed) python/trunk/Demo/tkinter/ttk/dirbrowser.py (contents, props changed) python/trunk/Demo/tkinter/ttk/img/ python/trunk/Demo/tkinter/ttk/img/close.gif (contents, props changed) python/trunk/Demo/tkinter/ttk/img/close_active.gif (contents, props changed) python/trunk/Demo/tkinter/ttk/img/close_pressed.gif (contents, props changed) python/trunk/Demo/tkinter/ttk/listbox_scrollcmd.py (contents, props changed) python/trunk/Demo/tkinter/ttk/mac_searchentry.py (contents, props changed) python/trunk/Demo/tkinter/ttk/notebook_closebtn.py (contents, props changed) python/trunk/Demo/tkinter/ttk/plastik_theme.py (contents, props changed) python/trunk/Demo/tkinter/ttk/roundframe.py (contents, props changed) python/trunk/Demo/tkinter/ttk/theme_selector.py (contents, props changed) python/trunk/Demo/tkinter/ttk/treeview_multicolumn.py (contents, props changed) python/trunk/Demo/tkinter/ttk/ttkcalendar.py (contents, props changed) python/trunk/Demo/tkinter/ttk/widget_state.py (contents, props changed) Modified: python/trunk/Demo/tkinter/README python/trunk/Misc/NEWS Modified: python/trunk/Demo/tkinter/README ============================================================================== --- python/trunk/Demo/tkinter/README (original) +++ python/trunk/Demo/tkinter/README Wed Jan 28 16:56:01 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 Added: python/trunk/Demo/tkinter/ttk/combo_themes.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/combo_themes.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,46 @@ +"""Ttk Theme Selector. + +Although it is a theme selector, you won't notice many changes since +there is only a combobox and a frame around. +""" +import ttk + +class App(ttk.Frame): + def __init__(self): + ttk.Frame.__init__(self) + + self.style = ttk.Style() + self._setup_widgets() + + def _change_theme(self, event): + if event.widget.current(): # value #0 is not a theme + newtheme = event.widget.get() + # change to the new theme and refresh all the widgets + self.style.theme_use(newtheme) + + def _setup_widgets(self): + themes = list(self.style.theme_names()) + themes.insert(0, "Pick a theme") + # Create a readonly Combobox which will display 4 values at max, + # which will cause it to create a scrollbar if there are more + # than 4 values in total. + themes_combo = ttk.Combobox(self, values=themes, state="readonly", + height=4) + themes_combo.set(themes[0]) # sets the combobox value to "Pick a theme" + # Combobox widget generates a <> virtual event + # when the user selects an element. This event is generated after + # the listbox is unposted (after you select an item, the combobox's + # listbox disappears, then it is said that listbox is now unposted). + themes_combo.bind("<>", self._change_theme) + themes_combo.pack(fill='x') + + self.pack(fill='both', expand=1) + + +def main(): + app = App() + app.master.title("Ttk Combobox") + app.mainloop() + +if __name__ == "__main__": + main() Added: python/trunk/Demo/tkinter/ttk/dirbrowser.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/dirbrowser.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,93 @@ +"""A directory browser using Ttk Treeview. + +Based on the demo found in Tk 8.5 library/demos/browse +""" +import os +import glob +import Tkinter +import ttk + +def populate_tree(tree, node): + if tree.set(node, "type") != 'directory': + return + + path = tree.set(node, "fullpath") + tree.delete(*tree.get_children(node)) + + parent = tree.parent(node) + special_dirs = [] if parent else glob.glob('.') + glob.glob('..') + + for p in special_dirs + os.listdir(path): + ptype = None + p = os.path.join(path, p).replace('\\', '/') + if os.path.isdir(p): ptype = "directory" + elif os.path.isfile(p): ptype = "file" + + fname = os.path.split(p)[1] + id = tree.insert(node, "end", text=fname, values=[p, ptype]) + + if ptype == 'directory': + if fname not in ('.', '..'): + tree.insert(id, 0, text="dummy") + tree.item(id, text=fname) + elif ptype == 'file': + size = os.stat(p).st_size + tree.set(id, "size", "%d bytes" % size) + + +def populate_roots(tree): + dir = os.path.abspath('.').replace('\\', '/') + node = tree.insert('', 'end', text=dir, values=[dir, "directory"]) + populate_tree(tree, node) + +def update_tree(event): + tree = event.widget + populate_tree(tree, tree.focus()) + +def change_dir(event): + tree = event.widget + node = tree.focus() + if tree.parent(node): + path = os.path.abspath(tree.set(node, "fullpath")) + if os.path.isdir(path): + os.chdir(path) + tree.delete(tree.get_children('')) + populate_roots(tree) + +def autoscroll(sbar, first, last): + """Hide and show scrollbar as needed.""" + first, last = float(first), float(last) + if first <= 0 and last >= 1: + sbar.grid_remove() + else: + sbar.grid() + sbar.set(first, last) + +root = Tkinter.Tk() + +vsb = ttk.Scrollbar(orient="vertical") +hsb = ttk.Scrollbar(orient="horizontal") + +tree = ttk.Treeview(columns=("fullpath", "type", "size"), + displaycolumns="size", yscrollcommand=lambda f, l: autoscroll(vsb, f, l), + xscrollcommand=lambda f, l:autoscroll(hsb, f, l)) + +vsb['command'] = tree.yview +hsb['command'] = tree.xview + +tree.heading("#0", text="Directory Structure", anchor='w') +tree.heading("size", text="File Size", anchor='w') +tree.column("size", stretch=0, width=100) + +populate_roots(tree) +tree.bind('<>', update_tree) +tree.bind('', change_dir) + +# Arrange the tree and its scrollbars in the toplevel +tree.grid(column=0, row=0, sticky='nswe') +vsb.grid(column=1, row=0, sticky='ns') +hsb.grid(column=0, row=1, sticky='ew') +root.grid_columnconfigure(0, weight=1) +root.grid_rowconfigure(0, weight=1) + +root.mainloop() Added: python/trunk/Demo/tkinter/ttk/img/close.gif ============================================================================== Binary file. No diff available. Added: python/trunk/Demo/tkinter/ttk/img/close_active.gif ============================================================================== Binary file. No diff available. Added: python/trunk/Demo/tkinter/ttk/img/close_pressed.gif ============================================================================== Binary file. No diff available. Added: python/trunk/Demo/tkinter/ttk/listbox_scrollcmd.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/listbox_scrollcmd.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,37 @@ +"""Sample taken from: http://www.tkdocs.com/tutorial/morewidgets.html and +converted to Python, mainly to demonstrate xscrollcommand option. + +grid [tk::listbox .l -yscrollcommand ".s set" -height 5] -column 0 -row 0 -sticky nwes +grid [ttk::scrollbar .s -command ".l yview" -orient vertical] -column 1 -row 0 -sticky ns +grid [ttk::label .stat -text "Status message here" -anchor w] -column 0 -row 1 -sticky we +grid [ttk::sizegrip .sz] -column 1 -row 1 -sticky se +grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1 +for {set i 0} {$i<100} {incr i} { + .l insert end "Line $i of 100" + } +""" +import Tkinter +import ttk + +root = Tkinter.Tk() + +l = Tkinter.Listbox(height=5) +l.grid(column=0, row=0, sticky='nwes') + +s = ttk.Scrollbar(command=l.yview, orient='vertical') +l['yscrollcommand'] = s.set +s.grid(column=1, row=0, sticky="ns") + +stat = ttk.Label(text="Status message here", anchor='w') +stat.grid(column=0, row=1, sticky='we') + +sz = ttk.Sizegrip() +sz.grid(column=1, row=1, sticky='se') + +root.grid_columnconfigure(0, weight=1) +root.grid_rowconfigure(0, weight=1) + +for i in range(100): + l.insert('end', "Line %d of 100" % i) + +root.mainloop() Added: python/trunk/Demo/tkinter/ttk/mac_searchentry.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/mac_searchentry.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,78 @@ +"""Mac style search widget + +Translated from Tcl code by Schelte Bron, http://wiki.tcl.tk/18188 +""" +import Tkinter +import ttk + +root = Tkinter.Tk() + +data = """ +R0lGODlhKgAaAOfnAFdZVllbWFpcWVtdWlxeW11fXF9hXmBiX2ZnZWhpZ2lraGxua25wbXJ0 +cXR2c3V3dHZ4dXh6d3x+e31/fH6AfYSGg4eJhoiKh4qMiYuNio2PjHmUqnqVq3yXrZGTkJKU +kX+asJSWk32cuJWXlIGcs5aYlX6euZeZloOetZial4SftpqbmIWgt4GhvYahuIKivpudmYei +uYOjv5yem4ijuoSkwIWlwYmlu56gnYamwp+hnoenw4unvaCin4ioxJCnuZykrImpxZmlsoaq +zI2pv6KkoZGouoqqxpqms4erzaOloo6qwYurx5Kqu5untIiszqSmo5CrwoysyJeqtpOrvJyo +tZGsw42typSsvaaopZKtxJWtvp6qt4+uy6epppOuxZCvzKiqp5quuZSvxoyx06mrqJWwx42y +1JKxzpmwwaqsqZaxyI6z1ZqxwqutqpOzz4+01qyuq56yvpizypS00Jm0y5W10Zq1zJa20rCy +rpu3zqizwbGzr6C3yZy4z7K0saG4yp250LO1sqK5y5660Z+70qO7zKy4xaC806S8zba4taG9 +1KW9zq66x6+7yLi6t6S/1rC8yrm7uLO8xLG9y7q8ubS9xabB2anB07K+zLW+xrO/za7CzrTA +zrjAyLXBz77BvbbC0K/G2LjD0bnE0rLK28TGw8bIxcLL07vP28HN28rMycvOyr/T38DU4cnR +2s/RztHT0NLU0cTY5MrW5MvX5dHX2c3Z59bY1dPb5Nbb3dLe7Nvd2t3f3NXh797g3d3j5dnl +9OPl4eTm4+Ln6tzo9uXn5Obo5eDp8efp5uHq8uXq7ejq5+nr6OPs9Ovu6unu8O3v6+vw8+7w +7ezx9O/x7vDy7/Hz8O/19/P18vT38/L3+fb49Pf59vX6/fj69/b7/vn7+Pr8+ff9//v9+vz/ ++/7//P////////////////////////////////////////////////////////////////// +/////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJZAD/ACwC +AAIAKAAWAAAI/gD/CRz4bwUGCg8eQFjIsGHDBw4iTLAQgqBFgisuePCiyJOpUyBDihRpypMi +Lx8qaLhIMIyGFZ5sAUsmjZrNmzhzWpO2DJgtTysqfGDpxoMbW8ekeQsXzty4p1CjRjUXrps3 +asJsuclQ4uKKSbamMR3n1JzZs2jRkh1HzuxVXX8y4CDYAwqua+DInVrRwMGJU2kDp31KThy1 +XGWGDlxhi1rTPAUICBBAoEAesoIzn6Vm68MKgVAUHftmzhOCBCtQwQKSoABgzZnJdSMmyIPA +FbCotdUQAIhNa9B6DPCAGbZac+SowVIMRVe4pwkA4GpqDlwuAAmMZx4nTtfnf1mO5JEDNy46 +MHJkxQEDgKC49rPjwC0bqGaZuOoZAKjBPE4NgAzUvYcWOc0QZF91imAnCDHJ5JFAAJN0I2Ba +4iRDUC/gOEVNDwIUcEABCAgAAATUTIgWOMBYRFp80ghiAQIIVAAEAwJIYI2JZnUji0XSYAYO +NcsQA8wy0hCTwAASXGOiONFcxAtpTokTHznfiLMNMAkcAMuE43jDC0vLeGOWe2R5o4sn1LgH +GzkWsvTPMgEOaA433Ag4TjjMuDkQMNi0tZ12sqWoJ0HATMPNffAZZ6U0wLAyqJ62RGoLLrhI +aqmlpzwaEAAh+QQJZAD/ACwAAAAAKgAaAAAI/gD/CRw40JEhQoEC+fGjcOHCMRAjRkxDsKLF +f5YcAcID582ZjyBDJhmZZIjJIUySEDHiBMhFghrtdNnRAgSHmzhz6sTZQcSLITx+CHn5bxSk +Nz5MCMGy55CjTVCjbuJEtSrVQ3uwqDBRQwrFi476SHHxow8qXcemVbPGtm21t3CnTaP27Jgu +VHtuiIjBsuImQkRiiEEFTNo2cOTMKV7MuLE5cN68QUOGSgwKG1EqJqJDY8+rZt8UjxtNunTj +cY3DgZOWS46KIFgGjiI0ZIsqaqNNjWjgYMUpx8Adc3v2aosNMAI1DbqyI9WycOb4IAggQEAB +A3lQBxet/TG4cMpI/tHwYeSfIzxM0uTKNs7UgAQrYL1akaDA7+3bueVqY4NJlUhIcQLNYx8E +AIQ01mwjTQ8DeNAdfouNA8440GBCQxJY3MEGD6p4Y844CQCAizcSgpMLAAlAuJ03qOyQRBR3 +nEHEK+BMGKIui4kDDAAIPKiiYuSYSMQQRCDCxhiziPMYBgDkEaEaAGQA3Y+MjUPOLFoMoUUh +cKxRC4ngeILiH8Qkk0cCAUzSDZWpzbLEE1EwggcYqWCj2DNADFDAAQUgIAAAEFDDJmPYqNJF +F1s4cscTmCDjDTjdSPOHBQggUAEQDAgggTWDPoYMJkFoUdRmddyyjWLeULMMMcAsIw0x4wkM +IME1g25zyxpHxFYUHmyIggw4H4ojITnfiLMNMAkcAAub4BQjihRdDGTJHmvc4Qo1wD6Imje6 +eILbj+BQ4wqu5Q3ECSJ0FOKKMtv4mBg33Pw4zjbKuBIIE1xYpIkhdQQiyi7OtAucj6dt48wu +otQhBRa6VvSJIRwhIkotvgRTzMUYZ6xxMcj4QkspeKDxxRhEmUfIHWjAgQcijEDissuXvCyz +zH7Q8YQURxDhUsn/bCInR3AELfTQZBRt9BBJkCGFFVhMwTNBlnBCSCGEIJQQIAklZMXWRBAR +RRRWENHwRQEBADs=""" + + +s1 = Tkinter.PhotoImage("search1", data=data, format="gif -index 0") +s2 = Tkinter.PhotoImage("search2", data=data, format="gif -index 1") + +style = ttk.Style() + +style.element_create("Search.field", "image", "search1", + ("focus", "search2"), border=[22, 7, 14], sticky="ew") + +style.layout("Search.entry", [ + ("Search.field", {"sticky": "nswe", "border": 1, "children": + [("Entry.padding", {"sticky": "nswe", "children": + [("Entry.textarea", {"sticky": "nswe"})] + })] + })] +) + +style.configure("Search.entry", background="#b2b2b2") + +root.configure(background="#b2b2b2") + +e1 = ttk.Entry(style="Search.entry", width=20) +e2 = ttk.Entry(style="Search.entry", width=20) + +e1.grid(padx=10, pady=10) +e2.grid(padx=10, pady=10) + +root.mainloop() Added: python/trunk/Demo/tkinter/ttk/notebook_closebtn.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/notebook_closebtn.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,78 @@ +"""A Ttk Notebook with close buttons. + +Based on an example by patthoyts, http://paste.tclers.tk/896 +""" +import os +import Tkinter +import ttk + +root = Tkinter.Tk() + +imgdir = os.path.join(os.path.dirname(__file__), 'img') +i1 = Tkinter.PhotoImage("img_close", file=os.path.join(imgdir, 'close.gif')) +i2 = Tkinter.PhotoImage("img_closeactive", + file=os.path.join(imgdir, 'close_active.gif')) +i3 = Tkinter.PhotoImage("img_closepressed", + file=os.path.join(imgdir, 'close_pressed.gif')) + +style = ttk.Style() + +style.element_create("close", "image", "img_close", + ("active", "pressed", "!disabled", "img_closepressed"), + ("active", "!disabled", "img_closeactive"), border=8, sticky='') + +style.layout("ButtonNotebook", [("ButtonNotebook.client", {"sticky": "nswe"})]) +style.layout("ButtonNotebook.Tab", [ + ("ButtonNotebook.tab", {"sticky": "nswe", "children": + [("ButtonNotebook.padding", {"side": "top", "sticky": "nswe", + "children": + [("ButtonNotebook.focus", {"side": "top", "sticky": "nswe", + "children": + [("ButtonNotebook.label", {"side": "left", "sticky": ''}), + ("ButtonNotebook.close", {"side": "left", "sticky": ''})] + })] + })] + })] +) + +def btn_press(event): + x, y, widget = event.x, event.y, event.widget + elem = widget.identify(x, y) + index = widget.index("@%d,%d" % (x, y)) + + if "close" in elem: + widget.state(['pressed']) + widget.pressed_index = index + +def btn_release(event): + x, y, widget = event.x, event.y, event.widget + + if not widget.instate(['pressed']): + return + + elem = widget.identify(x, y) + index = widget.index("@%d,%d" % (x, y)) + + if "close" in elem and widget.pressed_index == index: + widget.forget(index) + widget.event_generate("<>") + + widget.state(["!pressed"]) + widget.pressed_index = None + + +root.bind_class("TNotebook", "", btn_press, True) +root.bind_class("TNotebook", "", btn_release) + +# create a ttk notebook with our custom style, and add some tabs to it +nb = ttk.Notebook(width=200, height=200, style="ButtonNotebook") +nb.pressed_index = None +f1 = Tkinter.Frame(nb, background="red") +f2 = Tkinter.Frame(nb, background="green") +f3 = Tkinter.Frame(nb, background="blue") +nb.add(f1, text='Red', padding=3) +nb.add(f2, text='Green', padding=3) +nb.add(f3, text='Blue', padding=3) +nb.pack(expand=1, fill='both') + +root.mainloop() Added: python/trunk/Demo/tkinter/ttk/plastik_theme.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/plastik_theme.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,269 @@ +"""This demonstrates good part of the syntax accepted by theme_create. + +This is a translation of plastik.tcl to python. +You will need the images used by the plastik theme to test this. The +images (and other tile themes) can be retrived by doing: + +$ cvs -z3 -d:pserver:anonymous at tktable.cvs.sourceforge.net:/cvsroot/tktable \ + co tile-themes + +To test this module you should do, for example: + +import Tkinter +import plastik_theme + +root = Tkinter.Tk() +plastik_theme.install(plastik_image_dir) +... + +Where plastik_image_dir contains the path to the images directory used by +the plastik theme, something like: tile-themes/plastik/plastik +""" +import os +import glob +import ttk +from Tkinter import PhotoImage + +__all__ = ['install'] + +colors = { + "frame": "#efefef", + "disabledfg": "#aaaaaa", + "selectbg": "#657a9e", + "selectfg": "#ffffff" + } + +imgs = {} +def _load_imgs(imgdir): + imgdir = os.path.expanduser(imgdir) + if not os.path.isdir(imgdir): + raise Exception("%r is not a directory, can't load images" % imgdir) + for f in glob.glob("%s/*.gif" % imgdir): + img = os.path.split(f)[1] + name = img[:-4] + imgs[name] = PhotoImage(name, file=f, format="gif89") + +def install(imgdir): + _load_imgs(imgdir) + style = ttk.Style() + style.theme_create("plastik", "default", settings={ + ".": { + "configure": + {"background": colors['frame'], + "troughcolor": colors['frame'], + "selectbackground": colors['selectbg'], + "selectforeground": colors['selectfg'], + "fieldbackground": colors['frame'], + "font": "TkDefaultFont", + "borderwidth": 1}, + "map": {"foreground": [("disabled", colors['disabledfg'])]} + }, + + "Vertical.TScrollbar": {"layout": [ + ("Vertical.Scrollbar.uparrow", {"side": "top", "sticky": ''}), + ("Vertical.Scrollbar.downarrow", {"side": "bottom", "sticky": ''}), + ("Vertical.Scrollbar.uparrow", {"side": "bottom", "sticky": ''}), + ("Vertical.Scrollbar.trough", {"sticky": "ns", "children": + [("Vertical.Scrollbar.thumb", {"expand": 1, "unit": 1, + "children": [("Vertical.Scrollbar.grip", {"sticky": ''})] + })] + })] + }, + + "Horizontal.TScrollbar": {"layout": [ + ("Horizontal.Scrollbar.leftarrow", {"side": "left", "sticky": ''}), + ("Horizontal.Scrollbar.rightarrow", + {"side": "right", "sticky": ''}), + ("Horizontal.Scrollbar.leftarrow", + {"side": "right", "sticky": ''}), + ("Horizontal.Scrollbar.trough", {"sticky": "ew", "children": + [("Horizontal.Scrollbar.thumb", {"expand": 1, "unit": 1, + "children": [("Horizontal.Scrollbar.grip", {"sticky": ''})] + })] + })] + }, + + "TButton": { + "configure": {"width": 10, "anchor": "center"}, + "layout": [ + ("Button.button", {"children": + [("Button.focus", {"children": + [("Button.padding", {"children": + [("Button.label", {"side": "left", "expand": 1})] + })] + })] + }) + ] + }, + + "Toolbutton": { + "configure": {"anchor": "center"}, + "layout": [ + ("Toolbutton.border", {"children": + [("Toolbutton.button", {"children": + [("Toolbutton.padding", {"children": + [("Toolbutton.label", {"side":"left", "expand":1})] + })] + })] + }) + ] + }, + + "TMenubutton": {"layout": [ + ("Menubutton.button", {"children": + [("Menubutton.indicator", {"side": "right"}), + ("Menubutton.focus", {"children": + [("Menubutton.padding", {"children": + [("Menubutton.label", {"side": "left", "expand": 1})] + })] + })] + })] + }, + + "TNotebook": {"configure": {"tabmargins": [0, 2, 0, 0]}}, + "TNotebook.tab": { + "configure": {"padding": [6, 2, 6, 2], "expand": [0, 0, 2]}, + "map": {"expand": [("selected", [1, 2, 4, 2])]} + }, + "Treeview": {"configure": {"padding": 0}}, + + # elements + "Button.button": {"element create": + ("image", 'button-n', + ("pressed", 'button-p'), ("active", 'button-h'), + {"border": [4, 10], "padding": 4, "sticky":"ewns"} + ) + }, + + "Toolbutton.button": {"element create": + ("image", 'tbutton-n', + ("selected", 'tbutton-p'), ("pressed", 'tbutton-p'), + ("active", 'tbutton-h'), + {"border": [4, 9], "padding": 3, "sticky": "news"} + ) + }, + + "Checkbutton.indicator": {"element create": + ("image", 'check-nu', + ('active', 'selected', 'check-hc'), + ('pressed', 'selected', 'check-pc'), + ('active', 'check-hu'), + ("selected", 'check-nc'), + {"sticky": ''} + ) + }, + + "Radiobutton.indicator": {"element create": + ("image", 'radio-nu', + ('active', 'selected', 'radio-hc'), + ('pressed', 'selected', 'radio-pc'), + ('active', 'radio-hu'), ('selected', 'radio-nc'), + {"sticky": ''} + ) + }, + + "Horizontal.Scrollbar.thumb": {"element create": + ("image", 'hsb-n', {"border": 3, "sticky": "ew"}) + }, + + "Horizontal.Scrollbar.grip": {"element create": ("image", 'hsb-g')}, + "Horizontal.Scrollbar.trough": {"element create": ("image", 'hsb-t')}, + "Vertical.Scrollbar.thumb": {"element create": + ("image", 'vsb-n', {"border": 3, "sticky": "ns"}) + }, + "Vertical.Scrollbar.grip": {"element create": ("image", 'vsb-g')}, + "Vertical.Scrollbar.trough": {"element create": ("image", 'vsb-t')}, + "Scrollbar.uparrow": {"element create": + ("image", 'arrowup-n', ("pressed", 'arrowup-p'), {"sticky": ''}) + }, + "Scrollbar.downarrow": {"element create": + ("image", 'arrowdown-n', + ("pressed", 'arrowdown-p'), {'sticky': ''}) + }, + "Scrollbar.leftarrow": {"element create": + ("image", 'arrowleft-n', + ("pressed", 'arrowleft-p'), {'sticky': ''}) + }, + "Scrollbar.rightarrow": {"element create": + ("image", 'arrowright-n', ("pressed", 'arrowright-p'), + {'sticky': ''}) + }, + + "Horizontal.Scale.slider": {"element create": + ("image", 'hslider-n', {'sticky': ''}) + }, + "Horizontal.Scale.trough": {"element create": + ("image", 'hslider-t', {'border': 1, 'padding': 0}) + }, + "Vertical.Scale.slider": {"element create": + ("image", 'vslider-n', {'sticky': ''}) + }, + "Vertical.Scale.trough": {"element create": + ("image", 'vslider-t', {'border': 1, 'padding': 0}) + }, + + "Entry.field": {"element create": + ("image", 'entry-n', + ("focus", 'entry-f'), + {'border': 2, 'padding': [3, 4], 'sticky': 'news'} + ) + }, + + "Labelframe.border": {"element create": + ("image", 'border', {'border': 4, 'padding': 4, 'sticky': 'news'}) + }, + + "Menubutton.button": {"element create": + ("image", 'combo-r', + ('active', 'combo-ra'), + {'sticky': 'news', 'border': [4, 6, 24, 15], + 'padding': [4, 4, 5]} + ) + }, + "Menubutton.indicator": {"element create": + ("image", 'arrow-d', {"sticky": "e", "border": [15, 0, 0, 0]}) + }, + + "Combobox.field": {"element create": + ("image", 'combo-n', + ('readonly', 'active', 'combo-ra'), + ('focus', 'active', 'combo-fa'), + ('active', 'combo-a'), ('!readonly', 'focus', 'combo-f'), + ('readonly', 'combo-r'), + {'border': [4, 6, 24, 15], 'padding': [4, 4, 5], + 'sticky': 'news'} + ) + }, + "Combobox.downarrow": {"element create": + ("image", 'arrow-d', {'sticky': 'e', 'border': [15, 0, 0, 0]}) + }, + + "Notebook.client": {"element create": + ("image", 'notebook-c', {'border': 4}) + }, + "Notebook.tab": {"element create": + ("image", 'notebook-tn', + ("selected", 'notebook-ts'), ("active", 'notebook-ta'), + {'padding': [0, 2, 0, 0], 'border': [4, 10, 4, 10]} + ) + }, + + "Progressbar.trough": {"element create": + ("image", 'hprogress-t', {'border': 2}) + }, + "Horizontal.Progressbar.pbar": {"element create": + ("image", 'hprogress-b', {'border': [2, 9]}) + }, + "Vertical.Progressbar.pbar": {"element create": + ("image", 'vprogress-b', {'border': [9, 2]}) + }, + + "Treeheading.cell": {"element create": + ("image", 'tree-n', + ("pressed", 'tree-p'), + {'border': [4, 10], 'padding': 4, 'sticky': 'news'} + ) + } + + }) + style.theme_use("plastik") Added: python/trunk/Demo/tkinter/ttk/roundframe.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/roundframe.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,111 @@ +"""Ttk Frame with rounded corners. + +Based on an example by Bryan Oakley, found at: http://wiki.tcl.tk/20152""" +import Tkinter +import ttk + +root = Tkinter.Tk() + +img1 = Tkinter.PhotoImage("frameFocusBorder", data=""" +R0lGODlhQABAAPcAAHx+fMTCxKSipOTi5JSSlNTS1LSytPTy9IyKjMzKzKyq +rOzq7JyanNza3Ly6vPz6/ISChMTGxKSmpOTm5JSWlNTW1LS2tPT29IyOjMzO +zKyurOzu7JyenNze3Ly+vPz+/OkAKOUA5IEAEnwAAACuQACUAAFBAAB+AFYd +QAC0AABBAAB+AIjMAuEEABINAAAAAHMgAQAAAAAAAAAAAKjSxOIEJBIIpQAA +sRgBMO4AAJAAAHwCAHAAAAUAAJEAAHwAAP+eEP8CZ/8Aif8AAG0BDAUAAJEA +AHwAAIXYAOfxAIESAHwAAABAMQAbMBZGMAAAIEggJQMAIAAAAAAAfqgaXESI +5BdBEgB+AGgALGEAABYAAAAAAACsNwAEAAAMLwAAAH61MQBIAABCM8B+AAAU +AAAAAAAApQAAsf8Brv8AlP8AQf8Afv8AzP8A1P8AQf8AfgAArAAABAAADAAA +AACQDADjAAASAAAAAACAAADVABZBAAB+ALjMwOIEhxINUAAAANIgAOYAAIEA +AHwAAGjSAGEEABYIAAAAAEoBB+MAAIEAAHwCACABAJsAAFAAAAAAAGjJAGGL +AAFBFgB+AGmIAAAQAABHAAB+APQoAOE/ABIAAAAAAADQAADjAAASAAAAAPiF +APcrABKDAAB8ABgAGO4AAJAAqXwAAHAAAAUAAJEAAHwAAP8AAP8AAP8AAP8A +AG0pIwW3AJGSAHx8AEocI/QAAICpAHwAAAA0SABk6xaDEgB8AAD//wD//wD/ +/wD//2gAAGEAABYAAAAAAAC0/AHj5AASEgAAAAA01gBkWACDTAB8AFf43PT3 +5IASEnwAAOAYd+PuMBKQTwB8AGgAEGG35RaSEgB8AOj/NOL/ZBL/gwD/fMkc +q4sA5UGpEn4AAIg02xBk/0eD/358fx/4iADk5QASEgAAAALnHABkAACDqQB8 +AMyINARkZA2DgwB8fBABHL0AAEUAqQAAAIAxKOMAPxIwAAAAAIScAOPxABIS +AAAAAIIAnQwA/0IAR3cAACwAAAAAQABAAAAI/wA/CBxIsKDBgwgTKlzIsKFD +gxceNnxAsaLFixgzUrzAsWPFCw8kDgy5EeQDkBxPolypsmXKlx1hXnS48UEH +CwooMCDAgIJOCjx99gz6k+jQnkWR9lRgYYDJkAk/DlAgIMICZlizat3KtatX +rAsiCNDgtCJClQkoFMgqsu3ArBkoZDgA8uDJAwk4bGDmtm9BZgcYzK078m4D +Cgf4+l0skNkGCg3oUhR4d4GCDIoZM2ZWQMECyZQvLMggIbPmzQIyfCZ5YcME +AwFMn/bLLIKBCRtMHljQQcDV2ZqZTRDQYfWFAwMqUJANvC8zBhUWbDi5YUAB +Bsybt2VGoUKH3AcmdP+Im127xOcJih+oXsEDdvOLuQfIMGBD9QwBlsOnzcBD +hfrsuVfefgzJR599A+CnH4Hb9fcfgu29x6BIBgKYYH4DTojQc/5ZGGGGGhpU +IYIKghgiQRw+GKCEJxZIwXwWlthiQyl6KOCMLsJIIoY4LlQjhDf2mNCI9/Eo +5IYO2sjikX+9eGCRCzL5V5JALillY07GaOSVb1G5ookzEnlhlFx+8OOXZb6V +5Y5kcnlmckGmKaaMaZrpJZxWXjnnlmW++WGdZq5ZXQEetKmnlxPgl6eUYhJq +KKOI0imnoNbF2ScFHQJJwW99TsBAAAVYWEAAHEQAZoi1cQDqAAeEV0EACpT/ +JqcACgRQAW6uNWCbYKcyyEwGDBgQwa2tTlBBAhYIQMFejC5AgQAWJNDABK3y +loEDEjCgV6/aOcYBAwp4kIF6rVkXgAEc8IQZVifCBRQHGqya23HGIpsTBgSU +OsFX/PbrVVjpYsCABA4kQCxHu11ogAQUIOAwATpBLDFQFE9sccUYS0wAxD5h +4DACFEggbAHk3jVBA/gtTIHHEADg8sswxyzzzDQDAAEECGAQsgHiTisZResN +gLIHBijwLQEYePzx0kw37fTSSjuMr7ZMzfcgYZUZi58DGsTKwbdgayt22GSP +bXbYY3MggQIaONDzAJ8R9kFlQheQQAAOWGCAARrwdt23Bn8H7vfggBMueOEG +WOBBAAkU0EB9oBGUdXIFZJBABAEEsPjmmnfO+eeeh/55BBEk0Ph/E8Q9meQq +bbDABAN00EADFRRQ++2254777rr3jrvjFTTQwQCpz7u6QRut5/oEzA/g/PPQ +Ry/99NIz//oGrZpUUEAAOw==""") + +img2 = Tkinter.PhotoImage("frameBorder", data=""" +R0lGODlhQABAAPcAAHx+fMTCxKSipOTi5JSSlNTS1LSytPTy9IyKjMzKzKyq +rOzq7JyanNza3Ly6vPz6/ISChMTGxKSmpOTm5JSWlNTW1LS2tPT29IyOjMzO +zKyurOzu7JyenNze3Ly+vPz+/OkAKOUA5IEAEnwAAACuQACUAAFBAAB+AFYd +QAC0AABBAAB+AIjMAuEEABINAAAAAHMgAQAAAAAAAAAAAKjSxOIEJBIIpQAA +sRgBMO4AAJAAAHwCAHAAAAUAAJEAAHwAAP+eEP8CZ/8Aif8AAG0BDAUAAJEA +AHwAAIXYAOfxAIESAHwAAABAMQAbMBZGMAAAIEggJQMAIAAAAAAAfqgaXESI +5BdBEgB+AGgALGEAABYAAAAAAACsNwAEAAAMLwAAAH61MQBIAABCM8B+AAAU +AAAAAAAApQAAsf8Brv8AlP8AQf8Afv8AzP8A1P8AQf8AfgAArAAABAAADAAA +AACQDADjAAASAAAAAACAAADVABZBAAB+ALjMwOIEhxINUAAAANIgAOYAAIEA +AHwAAGjSAGEEABYIAAAAAEoBB+MAAIEAAHwCACABAJsAAFAAAAAAAGjJAGGL +AAFBFgB+AGmIAAAQAABHAAB+APQoAOE/ABIAAAAAAADQAADjAAASAAAAAPiF +APcrABKDAAB8ABgAGO4AAJAAqXwAAHAAAAUAAJEAAHwAAP8AAP8AAP8AAP8A +AG0pIwW3AJGSAHx8AEocI/QAAICpAHwAAAA0SABk6xaDEgB8AAD//wD//wD/ +/wD//2gAAGEAABYAAAAAAAC0/AHj5AASEgAAAAA01gBkWACDTAB8AFf43PT3 +5IASEnwAAOAYd+PuMBKQTwB8AGgAEGG35RaSEgB8AOj/NOL/ZBL/gwD/fMkc +q4sA5UGpEn4AAIg02xBk/0eD/358fx/4iADk5QASEgAAAALnHABkAACDqQB8 +AMyINARkZA2DgwB8fBABHL0AAEUAqQAAAIAxKOMAPxIwAAAAAIScAOPxABIS +AAAAAIIAnQwA/0IAR3cAACwAAAAAQABAAAAI/wA/CBxIsKDBgwgTKlzIsKFD +gxceNnxAsaLFixgzUrzAsWPFCw8kDgy5EeQDkBxPolypsmXKlx1hXnS48UEH +CwooMCDAgIJOCjx99gz6k+jQnkWR9lRgYYDJkAk/DlAgIMICkVgHLoggQIPT +ighVJqBQIKvZghkoZDgA8uDJAwk4bDhLd+ABBmvbjnzbgMKBuoA/bKDQgC1F +gW8XKMgQOHABBQsMI76wIIOExo0FZIhM8sKGCQYCYA4cwcCEDSYPLOgg4Oro +uhMEdOB84cCAChReB2ZQYcGGkxsGFGCgGzCFCh1QH5jQIW3xugwSzD4QvIIH +4s/PUgiQYcCG4BkC5P/ObpaBhwreq18nb3Z79+8Dwo9nL9I8evjWsdOX6D59 +fPH71Xeef/kFyB93/sln4EP2Ebjegg31B5+CEDLUIH4PVqiQhOABqKFCF6qn +34cHcfjffCQaFOJtGaZYkIkUuljQigXK+CKCE3po40A0trgjjDru+EGPI/6I +Y4co7kikkAMBmaSNSzL5gZNSDjkghkXaaGIBHjwpY4gThJeljFt2WSWYMQpZ +5pguUnClehS4tuMEDARQgH8FBMBBBExGwIGdAxywXAUBKHCZkAIoEEAFp33W +QGl47ZgBAwZEwKigE1SQgAUCUDCXiwtQIIAFCTQwgaCrZeCABAzIleIGHDD/ +oIAHGUznmXABGMABT4xpmBYBHGgAKGq1ZbppThgAG8EEAW61KwYMSOBAApdy +pNp/BkhAAQLcEqCTt+ACJW645I5rLrgEeOsTBtwiQIEElRZg61sTNBBethSw +CwEA/Pbr778ABywwABBAgAAG7xpAq6mGUUTdAPZ6YIACsRKAAbvtZqzxxhxn +jDG3ybbKFHf36ZVYpuE5oIGhHMTqcqswvyxzzDS/HDMHEiiggQMLDxCZXh8k +BnEBCQTggAUGGKCB0ktr0PTTTEfttNRQT22ABR4EkEABDXgnGUEn31ZABglE +EEAAWaeN9tpqt832221HEEECW6M3wc+Hga3SBgtMODBABw00UEEBgxdO+OGG +J4744oZzXUEDHQxwN7F5G7QRdXxPoPkAnHfu+eeghw665n1vIKhJBQUEADs=""") + +style = ttk.Style() + +style.element_create("RoundedFrame", "image", "frameBorder", + ("focus", "frameFocusBorder"), border=16, sticky="nsew") + +style.layout("RoundedFrame", [("RoundedFrame", {"sticky": "nsew"})]) +style.configure("TEntry", borderwidth=0) + +frame = ttk.Frame(style="RoundedFrame", padding=10) +frame.pack(fill='x') + +frame2 = ttk.Frame(style="RoundedFrame", padding=10) +frame2.pack(fill='both', expand=1) + +entry = ttk.Entry(frame, text='Test') +entry.pack(fill='x') +entry.bind("", lambda evt: frame.state(["focus"])) +entry.bind("", lambda evt: frame.state(["!focus"])) + +text = Tkinter.Text(frame2, borderwidth=0, bg="white", highlightthickness=0) +text.pack(fill='both', expand=1) +text.bind("", lambda evt: frame2.state(["focus"])) +text.bind("", lambda evt: frame2.state(["!focus"])) + +root.mainloop() Added: python/trunk/Demo/tkinter/ttk/theme_selector.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/theme_selector.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,61 @@ +"""Ttk Theme Selector v2. + +This is an improvement from the other theme selector (themes_combo.py) +since now you can notice theme changes in Ttk Combobox, Ttk Frame, +Ttk Label and Ttk Button. +""" +import Tkinter +import ttk + +class App(ttk.Frame): + def __init__(self): + ttk.Frame.__init__(self, borderwidth=3) + + self.style = ttk.Style() + + # XXX Ideally I wouldn't want to create a Tkinter.IntVar to make + # it works with Checkbutton variable option. + self.theme_autochange = Tkinter.IntVar(self, 0) + self._setup_widgets() + + def _change_theme(self): + self.style.theme_use(self.themes_combo.get()) + + def _theme_sel_changed(self, widget): + if self.theme_autochange.get(): + self._change_theme() + + def _setup_widgets(self): + themes_lbl = ttk.Label(self, text="Themes") + + themes = self.style.theme_names() + self.themes_combo = ttk.Combobox(self, values=themes, state="readonly") + self.themes_combo.set(themes[0]) + self.themes_combo.bind("<>", self._theme_sel_changed) + + change_btn = ttk.Button(self, text='Change Theme', + command=self._change_theme) + + theme_change_checkbtn = ttk.Checkbutton(self, + text="Change themes when combobox item is activated", + variable=self.theme_autochange) + + themes_lbl.grid(ipadx=6, sticky="w") + self.themes_combo.grid(row=0, column=1, padx=6, sticky="ew") + change_btn.grid(row=0, column=2, padx=6, sticky="e") + theme_change_checkbtn.grid(row=1, columnspan=3, sticky="w", pady=6) + + top = self.winfo_toplevel() + top.rowconfigure(0, weight=1) + top.columnconfigure(0, weight=1) + self.columnconfigure(1, weight=1) + self.grid(row=0, column=0, sticky="nsew", columnspan=3, rowspan=2) + + +def main(): + app = App() + app.master.title("Theme Selector") + app.mainloop() + +if __name__ == "__main__": + main() Added: python/trunk/Demo/tkinter/ttk/treeview_multicolumn.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/treeview_multicolumn.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,107 @@ +"""Demo based on the demo mclist included with tk source distribution.""" +import Tkinter +import tkFont +import ttk + +tree_columns = ("country", "capital", "currency") +tree_data = [ + ("Argentina", "Buenos Aires", "ARS"), + ("Australia", "Canberra", "AUD"), + ("Brazil", "Brazilia", "BRL"), + ("Canada", "Ottawa", "CAD"), + ("China", "Beijing", "CNY"), + ("France", "Paris", "EUR"), + ("Germany", "Berlin", "EUR"), + ("India", "New Delhi", "INR"), + ("Italy", "Rome", "EUR"), + ("Japan", "Tokyo", "JPY"), + ("Mexico", "Mexico City", "MXN"), + ("Russia", "Moscow", "RUB"), + ("South Africa", "Pretoria", "ZAR"), + ("United Kingdom", "London", "GBP"), + ("United States", "Washington, D.C.", "USD") + ] + +def sortby(tree, col, descending): + """Sort tree contents when a column is clicked on.""" + # grab values to sort + data = [(tree.set(child, col), child) for child in tree.get_children('')] + + # reorder data + data.sort(reverse=descending) + for indx, item in enumerate(data): + tree.move(item[1], '', indx) + + # switch the heading so that it will sort in the opposite direction + tree.heading(col, + command=lambda col=col: sortby(tree, col, int(not descending))) + +class App(object): + def __init__(self): + self.tree = None + self._setup_widgets() + self._build_tree() + + def _setup_widgets(self): + msg = ttk.Label(wraplength="4i", justify="left", anchor="n", + padding=(10, 2, 10, 6), + text=("Ttk is the new Tk themed widget set. One of the widgets it " + "includes is a tree widget, which can be configured to " + "display multiple columns of informational data without " + "displaying the tree itself. This is a simple way to build " + "a listbox that has multiple columns. Clicking on the " + "heading for a column will sort the data by that column. " + "You can also change the width of the columns by dragging " + "the boundary between them.")) + msg.pack(fill='x') + + container = ttk.Frame() + container.pack(fill='both', expand=True) + + # XXX Sounds like a good support class would be one for constructing + # a treeview with scrollbars. + self.tree = ttk.Treeview(columns=tree_columns, show="headings") + vsb = ttk.Scrollbar(orient="vertical", command=self.tree.yview) + hsb = ttk.Scrollbar(orient="horizontal", command=self.tree.xview) + self.tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set) + self.tree.grid(column=0, row=0, sticky='nsew', in_=container) + vsb.grid(column=1, row=0, sticky='ns', in_=container) + hsb.grid(column=0, row=1, sticky='ew', in_=container) + + container.grid_columnconfigure(0, weight=1) + container.grid_rowconfigure(0, weight=1) + + def _build_tree(self): + for col in tree_columns: + self.tree.heading(col, text=col.title(), + command=lambda c=col: sortby(self.tree, c, 0)) + # XXX tkFont.Font().measure expected args are incorrect according + # to the Tk docs + self.tree.column(col, width=tkFont.Font().measure(col.title())) + + for item in tree_data: + self.tree.insert('', 'end', values=item) + + # adjust columns lenghts if necessary + for indx, val in enumerate(item): + ilen = tkFont.Font().measure(val) + if self.tree.column(tree_columns[indx], width=None) < ilen: + self.tree.column(tree_columns[indx], width=ilen) + +def main(): + root = Tkinter.Tk() + root.wm_title("Multi-Column List") + root.wm_iconname("mclist") + + import plastik_theme + try: + plastik_theme.install('~/tile-themes/plastik/plastik') + except Exception: + import warnings + warnings.warn("plastik theme being used without images") + + app = App() + root.mainloop() + +if __name__ == "__main__": + main() Added: python/trunk/Demo/tkinter/ttk/ttkcalendar.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/ttkcalendar.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,231 @@ +""" +Simple calendar using ttk Treeview together with calendar and datetime +classes. +""" +import calendar +import Tkinter +import tkFont +import ttk + +def get_calendar(locale, fwday): + # instantiate proper calendar class + if locale is None: + return calendar.TextCalendar(fwday) + else: + return calendar.LocaleTextCalendar(fwday, locale) + +class Calendar(ttk.Frame): + # XXX ToDo: cget and configure + + datetime = calendar.datetime.datetime + timedelta = calendar.datetime.timedelta + + def __init__(self, master=None, **kw): + """ + WIDGET-SPECIFIC OPTIONS + + locale, firstweekday, year, month, selectbackground, + selectforeground + """ + # remove custom options from kw before initializating ttk.Frame + fwday = kw.pop('firstweekday', calendar.MONDAY) + year = kw.pop('year', self.datetime.now().year) + month = kw.pop('month', self.datetime.now().month) + locale = kw.pop('locale', None) + sel_bg = kw.pop('selectbackground', '#ecffc4') + sel_fg = kw.pop('selectforeground', '#05640e') + + self._date = self.datetime(year, month, 1) + self._selection = None # no date selected + + ttk.Frame.__init__(self, master, **kw) + + self._cal = get_calendar(locale, fwday) + + self.__setup_styles() # creates custom styles + self.__place_widgets() # pack/grid used widgets + self.__config_calendar() # adjust calendar columns and setup tags + # configure a canvas, and proper bindings, for selecting dates + self.__setup_selection(sel_bg, sel_fg) + + # store items ids, used for insertion later + self._items = [self._calendar.insert('', 'end', values='') + for _ in range(6)] + # insert dates in the currently empty calendar + self._build_calendar() + + # set the minimal size for the widget + self._calendar.bind('', self.__minsize) + + def __setitem__(self, item, value): + if item in ('year', 'month'): + raise AttributeError("attribute '%s' is not writeable" % item) + elif item == 'selectbackground': + self._canvas['background'] = value + elif item == 'selectforeground': + self._canvas.itemconfigure(self._canvas.text, item=value) + else: + ttk.Frame.__setitem__(self, item, value) + + def __getitem__(self, item): + if item in ('year', 'month'): + return getattr(self._date, item) + elif item == 'selectbackground': + return self._canvas['background'] + elif item == 'selectforeground': + return self._canvas.itemcget(self._canvas.text, 'fill') + else: + r = ttk.tclobjs_to_py({item: ttk.Frame.__getitem__(self, item)}) + return r[item] + + def __setup_styles(self): + # custom ttk styles + style = ttk.Style(self.master) + arrow_layout = lambda dir: ( + [('Button.focus', {'children': [('Button.%sarrow' % dir, None)]})] + ) + style.layout('L.TButton', arrow_layout('left')) + style.layout('R.TButton', arrow_layout('right')) + + def __place_widgets(self): + # header frame and its widgets + hframe = ttk.Frame(self) + lbtn = ttk.Button(hframe, style='L.TButton', command=self._prev_month) + rbtn = ttk.Button(hframe, style='R.TButton', command=self._next_month) + self._header = ttk.Label(hframe, width=15, anchor='center') + # the calendar + self._calendar = ttk.Treeview(show='', selectmode='none', height=7) + + # pack the widgets + hframe.pack(in_=self, side='top', pady=4, anchor='center') + lbtn.grid(in_=hframe) + self._header.grid(in_=hframe, column=1, row=0, padx=12) + rbtn.grid(in_=hframe, column=2, row=0) + self._calendar.pack(in_=self, expand=1, fill='both', side='bottom') + + def __config_calendar(self): + cols = self._cal.formatweekheader(3).split() + self._calendar['columns'] = cols + self._calendar.tag_configure('header', background='grey90') + self._calendar.insert('', 'end', values=cols, tag='header') + # adjust its columns width + font = tkFont.Font() + maxwidth = max(font.measure(col) for col in cols) + for col in cols: + self._calendar.column(col, width=maxwidth, minwidth=maxwidth, + anchor='e') + + def __setup_selection(self, sel_bg, sel_fg): + self._font = tkFont.Font() + self._canvas = canvas = Tkinter.Canvas(self._calendar, + background=sel_bg, borderwidth=0, highlightthickness=0) + canvas.text = canvas.create_text(0, 0, fill=sel_fg, anchor='w') + + canvas.bind('', lambda evt: canvas.place_forget()) + self._calendar.bind('', lambda evt: canvas.place_forget()) + self._calendar.bind('', self._pressed) + + def __minsize(self, evt): + width, height = self._calendar.master.geometry().split('x') + height = height[:height.index('+')] + self._calendar.master.minsize(width, height) + + def _build_calendar(self): + year, month = self._date.year, self._date.month + + # update header text (Month, YEAR) + header = self._cal.formatmonthname(year, month, 0) + self._header['text'] = header.title() + + # update calendar shown dates + cal = self._cal.monthdayscalendar(year, month) + for indx, item in enumerate(self._items): + week = cal[indx] if indx < len(cal) else [] + fmt_week = [('%02d' % day) if day else '' for day in week] + self._calendar.item(item, values=fmt_week) + + def _show_selection(self, text, bbox): + """Configure canvas for a new selection.""" + x, y, width, height = bbox + + textw = self._font.measure(text) + + canvas = self._canvas + canvas.configure(width=width, height=height) + canvas.coords(canvas.text, width - textw, height / 2 - 1) + canvas.itemconfigure(canvas.text, text=text) + canvas.place(in_=self._calendar, x=x, y=y) + + # Callbacks + + def _pressed(self, evt): + """Clicked somewhere in the calendar.""" + x, y, widget = evt.x, evt.y, evt.widget + item = widget.identify_row(y) + column = widget.identify_column(x) + + if not column or not item in self._items: + # clicked in the weekdays row or just outside the columns + return + + item_values = widget.item(item)['values'] + if not len(item_values): # row is empty for this month + return + + text = item_values[int(column[1]) - 1] + if not text: # date is empty + return + + bbox = widget.bbox(item, column) + if not bbox: # calendar not visible yet + return + + # update and then show selection + text = '%02d' % text + self._selection = (text, item, column) + self._show_selection(text, bbox) + + def _prev_month(self): + """Updated calendar to show the previous month.""" + self._canvas.place_forget() + + self._date = self._date - self.timedelta(days=1) + self._date = self.datetime(self._date.year, self._date.month, 1) + self._build_calendar() # reconstuct calendar + + def _next_month(self): + """Update calendar to show the next month.""" + self._canvas.place_forget() + + year, month = self._date.year, self._date.month + self._date = self._date + self.timedelta( + days=calendar.monthrange(year, month)[1] + 1) + self._date = self.datetime(self._date.year, self._date.month, 1) + self._build_calendar() # reconstruct calendar + + # Properties + + @property + def selection(self): + """Return a datetime representing the current selected date.""" + if not self._selection: + return None + + year, month = self._date.year, self._date.month + return self.datetime(year, month, int(self._selection[0])) + +def test(): + import sys + root = Tkinter.Tk() + root.title('Ttk Calendar') + ttkcal = Calendar(firstweekday=calendar.SUNDAY) + ttkcal.pack(expand=1, fill='both') + + if 'win' not in sys.platform: + style = ttk.Style() + style.theme_use('clam') + + root.mainloop() + +if __name__ == '__main__': + test() Added: python/trunk/Demo/tkinter/ttk/widget_state.py ============================================================================== --- (empty file) +++ python/trunk/Demo/tkinter/ttk/widget_state.py Wed Jan 28 16:56:01 2009 @@ -0,0 +1,83 @@ +"""Sample demo showing widget states and some font styling.""" +import ttk + +states = ['active', 'disabled', 'focus', 'pressed', 'selected', + 'background', 'readonly', 'alternate', 'invalid'] + +for state in states[:]: + states.append("!" + state) + +def reset_state(widget): + nostate = states[len(states) // 2:] + widget.state(nostate) + +class App(ttk.Frame): + def __init__(self, title=None): + ttk.Frame.__init__(self, borderwidth=6) + self.master.title(title) + + self.style = ttk.Style() + + # get default font size and family + btn_font = self.style.lookup("TButton", "font") + fsize = str(self.tk.eval("font configure %s -size" % btn_font)) + self.font_family = self.tk.eval("font configure %s -family" % btn_font) + if ' ' in self.font_family: + self.font_family = '{%s}' % self.font_family + self.fsize_prefix = fsize[0] if fsize[0] == '-' else '' + self.base_fsize = int(fsize[1 if fsize[0] == '-' else 0:]) + + # a list to hold all the widgets that will have their states changed + self.update_widgets = [] + + self._setup_widgets() + + def _set_font(self, extra=0): + self.style.configure("TButton", font="%s %s%d" % (self.font_family, + self.fsize_prefix, self.base_fsize + extra)) + + def _new_state(self, widget, newtext): + widget = self.nametowidget(widget) + + if not newtext: + goodstates = ["disabled"] + font_extra = 0 + else: + # set widget state according to what has been entered in the entry + newstates = set(newtext.split()) # eliminate duplicates + + # keep only the valid states + goodstates = [state for state in newstates if state in states] + # define a new font size based on amount of states + font_extra = 2 * len(goodstates) + + # set new widget state + for widget in self.update_widgets: + reset_state(widget) # remove any previous state from the widget + widget.state(goodstates) + + # update Ttk Button font size + self._set_font(font_extra) + return 1 + + def _setup_widgets(self): + btn = ttk.Button(self, text='Enter states and watch') + + entry = ttk.Entry(self, cursor='xterm', validate="key") + entry['validatecommand'] = (self.register(self._new_state), '%W', '%P') + entry.focus() + + self.update_widgets.append(btn) + entry.validate() + + entry.pack(fill='x', padx=6) + btn.pack(side='left', pady=6, padx=6, anchor='n') + self.pack(fill='both', expand=1) + + +def main(): + app = App("Widget State Tester") + app.mainloop() + +if __name__ == "__main__": + main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 28 16:56:01 2009 @@ -379,6 +379,8 @@ Tools/Demos ----------- +- Ttk demos added in Demo/tkinter/ttk/ + - Issue #4677: add two list comprehension tests to pybench. Build From python-checkins at python.org Wed Jan 28 17:01:54 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 17:01:54 +0100 (CET) Subject: [Python-checkins] r69054 - sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Message-ID: <20090128160154.5533C1E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 17:01:54 2009 New Revision: 69054 Log: Added mapping for the ttk module. Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Wed Jan 28 17:01:54 2009 @@ -27,6 +27,7 @@ 'ScrolledText': 'tkinter.scrolledtext', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', + 'ttk': 'tkinter.ttk', 'Tkinter': 'tkinter', 'markupbase': '_markupbase', '_winreg': 'winreg', From python-checkins at python.org Wed Jan 28 17:06:52 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 17:06:52 +0100 (CET) Subject: [Python-checkins] r69055 - in python/branches/py3k: Demo/tkinter/README Demo/tkinter/ttk Demo/tkinter/ttk/combo_themes.py Demo/tkinter/ttk/dirbrowser.py Demo/tkinter/ttk/listbox_scrollcmd.py Demo/tkinter/ttk/mac_searchentry.py Demo/tkinter/ttk/notebook_closebtn.py Demo/tkinter/ttk/plastik_theme.py Demo/tkinter/ttk/roundframe.py Demo/tkinter/ttk/theme_selector.py Demo/tkinter/ttk/treeview_multicolumn.py Demo/tkinter/ttk/ttkcalendar.py Demo/tkinter/ttk/widget_state.py Misc/NEWS Message-ID: <20090128160652.4D7241E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 17:06:51 2009 New Revision: 69055 Log: 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. ........ Added: python/branches/py3k/Demo/tkinter/ttk/ - copied from r69053, /python/trunk/Demo/tkinter/ttk/ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Demo/tkinter/README python/branches/py3k/Demo/tkinter/ttk/combo_themes.py python/branches/py3k/Demo/tkinter/ttk/dirbrowser.py python/branches/py3k/Demo/tkinter/ttk/listbox_scrollcmd.py python/branches/py3k/Demo/tkinter/ttk/mac_searchentry.py python/branches/py3k/Demo/tkinter/ttk/notebook_closebtn.py python/branches/py3k/Demo/tkinter/ttk/plastik_theme.py python/branches/py3k/Demo/tkinter/ttk/roundframe.py python/branches/py3k/Demo/tkinter/ttk/theme_selector.py python/branches/py3k/Demo/tkinter/ttk/treeview_multicolumn.py python/branches/py3k/Demo/tkinter/ttk/ttkcalendar.py python/branches/py3k/Demo/tkinter/ttk/widget_state.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Demo/tkinter/README ============================================================================== --- python/branches/py3k/Demo/tkinter/README (original) +++ python/branches/py3k/Demo/tkinter/README Wed Jan 28 17:06:51 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/py3k/Demo/tkinter/ttk/combo_themes.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/combo_themes.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/combo_themes.py Wed Jan 28 17:06:51 2009 @@ -3,7 +3,7 @@ Although it is a theme selector, you won't notice many changes since there is only a combobox and a frame around. """ -import ttk +from tkinter import ttk class App(ttk.Frame): def __init__(self): Modified: python/branches/py3k/Demo/tkinter/ttk/dirbrowser.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/dirbrowser.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/dirbrowser.py Wed Jan 28 17:06:51 2009 @@ -4,8 +4,8 @@ """ import os import glob -import Tkinter -import ttk +import tkinter +from tkinter import ttk def populate_tree(tree, node): if tree.set(node, "type") != 'directory': @@ -63,7 +63,7 @@ sbar.grid() sbar.set(first, last) -root = Tkinter.Tk() +root = tkinter.Tk() vsb = ttk.Scrollbar(orient="vertical") hsb = ttk.Scrollbar(orient="horizontal") Modified: python/branches/py3k/Demo/tkinter/ttk/listbox_scrollcmd.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/listbox_scrollcmd.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/listbox_scrollcmd.py Wed Jan 28 17:06:51 2009 @@ -10,12 +10,12 @@ .l insert end "Line $i of 100" } """ -import Tkinter -import ttk +import tkinter +from tkinter import ttk -root = Tkinter.Tk() +root = tkinter.Tk() -l = Tkinter.Listbox(height=5) +l = tkinter.Listbox(height=5) l.grid(column=0, row=0, sticky='nwes') s = ttk.Scrollbar(command=l.yview, orient='vertical') Modified: python/branches/py3k/Demo/tkinter/ttk/mac_searchentry.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/mac_searchentry.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/mac_searchentry.py Wed Jan 28 17:06:51 2009 @@ -2,10 +2,10 @@ Translated from Tcl code by Schelte Bron, http://wiki.tcl.tk/18188 """ -import Tkinter -import ttk +import tkinter +from tkinter import ttk -root = Tkinter.Tk() +root = tkinter.Tk() data = """ R0lGODlhKgAaAOfnAFdZVllbWFpcWVtdWlxeW11fXF9hXmBiX2ZnZWhpZ2lraGxua25wbXJ0 @@ -49,8 +49,8 @@ RRRWENHwRQEBADs=""" -s1 = Tkinter.PhotoImage("search1", data=data, format="gif -index 0") -s2 = Tkinter.PhotoImage("search2", data=data, format="gif -index 1") +s1 = tkinter.PhotoImage("search1", data=data, format="gif -index 0") +s2 = tkinter.PhotoImage("search2", data=data, format="gif -index 1") style = ttk.Style() Modified: python/branches/py3k/Demo/tkinter/ttk/notebook_closebtn.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/notebook_closebtn.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/notebook_closebtn.py Wed Jan 28 17:06:51 2009 @@ -3,16 +3,16 @@ Based on an example by patthoyts, http://paste.tclers.tk/896 """ import os -import Tkinter -import ttk +import tkinter +from tkinter import ttk -root = Tkinter.Tk() +root = tkinter.Tk() imgdir = os.path.join(os.path.dirname(__file__), 'img') -i1 = Tkinter.PhotoImage("img_close", file=os.path.join(imgdir, 'close.gif')) -i2 = Tkinter.PhotoImage("img_closeactive", +i1 = tkinter.PhotoImage("img_close", file=os.path.join(imgdir, 'close.gif')) +i2 = tkinter.PhotoImage("img_closeactive", file=os.path.join(imgdir, 'close_active.gif')) -i3 = Tkinter.PhotoImage("img_closepressed", +i3 = tkinter.PhotoImage("img_closepressed", file=os.path.join(imgdir, 'close_pressed.gif')) style = ttk.Style() @@ -67,9 +67,9 @@ # create a ttk notebook with our custom style, and add some tabs to it nb = ttk.Notebook(width=200, height=200, style="ButtonNotebook") nb.pressed_index = None -f1 = Tkinter.Frame(nb, background="red") -f2 = Tkinter.Frame(nb, background="green") -f3 = Tkinter.Frame(nb, background="blue") +f1 = tkinter.Frame(nb, background="red") +f2 = tkinter.Frame(nb, background="green") +f3 = tkinter.Frame(nb, background="blue") nb.add(f1, text='Red', padding=3) nb.add(f2, text='Green', padding=3) nb.add(f3, text='Blue', padding=3) Modified: python/branches/py3k/Demo/tkinter/ttk/plastik_theme.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/plastik_theme.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/plastik_theme.py Wed Jan 28 17:06:51 2009 @@ -21,8 +21,7 @@ """ import os import glob -import ttk -from Tkinter import PhotoImage +from tkinter import ttk, PhotoImage __all__ = ['install'] Modified: python/branches/py3k/Demo/tkinter/ttk/roundframe.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/roundframe.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/roundframe.py Wed Jan 28 17:06:51 2009 @@ -1,12 +1,12 @@ """Ttk Frame with rounded corners. Based on an example by Bryan Oakley, found at: http://wiki.tcl.tk/20152""" -import Tkinter -import ttk +import tkinter +from tkinter import ttk -root = Tkinter.Tk() +root = tkinter.Tk() -img1 = Tkinter.PhotoImage("frameFocusBorder", data=""" +img1 = tkinter.PhotoImage("frameFocusBorder", data=""" R0lGODlhQABAAPcAAHx+fMTCxKSipOTi5JSSlNTS1LSytPTy9IyKjMzKzKyq rOzq7JyanNza3Ly6vPz6/ISChMTGxKSmpOTm5JSWlNTW1LS2tPT29IyOjMzO zKyurOzu7JyenNze3Ly+vPz+/OkAKOUA5IEAEnwAAACuQACUAAFBAAB+AFYd @@ -46,7 +46,7 @@ bbDABAN00EADFRRQ++2254777rr3jrvjFTTQwQCpz7u6QRut5/oEzA/g/PPQ Ry/99NIz//oGrZpUUEAAOw==""") -img2 = Tkinter.PhotoImage("frameBorder", data=""" +img2 = tkinter.PhotoImage("frameBorder", data=""" R0lGODlhQABAAPcAAHx+fMTCxKSipOTi5JSSlNTS1LSytPTy9IyKjMzKzKyq rOzq7JyanNza3Ly6vPz6/ISChMTGxKSmpOTm5JSWlNTW1LS2tPT29IyOjMzO zKyurOzu7JyenNze3Ly+vPz+/OkAKOUA5IEAEnwAAACuQACUAAFBAAB+AFYd @@ -103,7 +103,7 @@ entry.bind("", lambda evt: frame.state(["focus"])) entry.bind("", lambda evt: frame.state(["!focus"])) -text = Tkinter.Text(frame2, borderwidth=0, bg="white", highlightthickness=0) +text = tkinter.Text(frame2, borderwidth=0, bg="white", highlightthickness=0) text.pack(fill='both', expand=1) text.bind("", lambda evt: frame2.state(["focus"])) text.bind("", lambda evt: frame2.state(["!focus"])) Modified: python/branches/py3k/Demo/tkinter/ttk/theme_selector.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/theme_selector.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/theme_selector.py Wed Jan 28 17:06:51 2009 @@ -4,8 +4,8 @@ since now you can notice theme changes in Ttk Combobox, Ttk Frame, Ttk Label and Ttk Button. """ -import Tkinter -import ttk +import tkinter +from tkinter import ttk class App(ttk.Frame): def __init__(self): @@ -15,7 +15,7 @@ # XXX Ideally I wouldn't want to create a Tkinter.IntVar to make # it works with Checkbutton variable option. - self.theme_autochange = Tkinter.IntVar(self, 0) + self.theme_autochange = tkinter.IntVar(self, 0) self._setup_widgets() def _change_theme(self): Modified: python/branches/py3k/Demo/tkinter/ttk/treeview_multicolumn.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/treeview_multicolumn.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/treeview_multicolumn.py Wed Jan 28 17:06:51 2009 @@ -1,7 +1,7 @@ """Demo based on the demo mclist included with tk source distribution.""" -import Tkinter -import tkFont -import ttk +import tkinter +import tkinter.font +from tkinter import ttk tree_columns = ("country", "capital", "currency") tree_data = [ @@ -77,19 +77,19 @@ command=lambda c=col: sortby(self.tree, c, 0)) # XXX tkFont.Font().measure expected args are incorrect according # to the Tk docs - self.tree.column(col, width=tkFont.Font().measure(col.title())) + self.tree.column(col, width=tkinter.font.Font().measure(col.title())) for item in tree_data: self.tree.insert('', 'end', values=item) # adjust columns lenghts if necessary for indx, val in enumerate(item): - ilen = tkFont.Font().measure(val) + ilen = tkinter.font.Font().measure(val) if self.tree.column(tree_columns[indx], width=None) < ilen: self.tree.column(tree_columns[indx], width=ilen) def main(): - root = Tkinter.Tk() + root = tkinter.Tk() root.wm_title("Multi-Column List") root.wm_iconname("mclist") Modified: python/branches/py3k/Demo/tkinter/ttk/ttkcalendar.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/ttkcalendar.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/ttkcalendar.py Wed Jan 28 17:06:51 2009 @@ -3,9 +3,9 @@ classes. """ import calendar -import Tkinter -import tkFont -import ttk +import tkinter +import tkinter.font +from tkinter import ttk def get_calendar(locale, fwday): # instantiate proper calendar class @@ -109,15 +109,15 @@ self._calendar.tag_configure('header', background='grey90') self._calendar.insert('', 'end', values=cols, tag='header') # adjust its columns width - font = tkFont.Font() + font = tkinter.font.Font() maxwidth = max(font.measure(col) for col in cols) for col in cols: self._calendar.column(col, width=maxwidth, minwidth=maxwidth, anchor='e') def __setup_selection(self, sel_bg, sel_fg): - self._font = tkFont.Font() - self._canvas = canvas = Tkinter.Canvas(self._calendar, + self._font = tkinter.font.Font() + self._canvas = canvas = tkinter.Canvas(self._calendar, background=sel_bg, borderwidth=0, highlightthickness=0) canvas.text = canvas.create_text(0, 0, fill=sel_fg, anchor='w') @@ -216,7 +216,7 @@ def test(): import sys - root = Tkinter.Tk() + root = tkinter.Tk() root.title('Ttk Calendar') ttkcal = Calendar(firstweekday=calendar.SUNDAY) ttkcal.pack(expand=1, fill='both') Modified: python/branches/py3k/Demo/tkinter/ttk/widget_state.py ============================================================================== --- /python/trunk/Demo/tkinter/ttk/widget_state.py (original) +++ python/branches/py3k/Demo/tkinter/ttk/widget_state.py Wed Jan 28 17:06:51 2009 @@ -1,5 +1,5 @@ """Sample demo showing widget states and some font styling.""" -import ttk +from tkinter import ttk states = ['active', 'disabled', 'focus', 'pressed', 'selected', 'background', 'readonly', 'alternate', 'invalid'] Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 28 17:06:51 2009 @@ -351,6 +351,8 @@ Tools/Demos ----------- +- Ttk demos added in Demo/tkinter/ttk/ + - Issue #4677: add two list comprehension tests to pybench. From python-checkins at python.org Wed Jan 28 17:12:36 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 17:12:36 +0100 (CET) Subject: [Python-checkins] r69056 - python/branches/release26-maint Message-ID: <20090128161236.207641E4034@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 17:12:35 2009 New Revision: 69056 Log: Blocked revisions 69050,69053 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. ........ r69053 | guilherme.polo | 2009-01-28 13:56:01 -0200 (Wed, 28 Jan 2009) | 2 lines Demos for ttk added. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed Jan 28 17:17:01 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 17:17:01 +0100 (CET) Subject: [Python-checkins] r69057 - python/branches/release30-maint Message-ID: <20090128161701.3CDA81E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 17:17:01 2009 New Revision: 69057 Log: Blocked revisions 69051,69055 via svnmerge ................ r69051 | guilherme.polo | 2009-01-28 12:41:10 -0200 (Wed, 28 Jan 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 14:06:51 -0200 (Wed, 28 Jan 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. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Wed Jan 28 17:47:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 16:47:00 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090128164701.2CC2F1E401F@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/181 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: 1 test failed: test_lib2to3 Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_lib2to3.py", line 3, in from lib2to3.tests import test_fixers, test_pytree, test_util, test_refactor File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/lib2to3/tests/__init__.py", line 11, in from . import support File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/lib2to3/tests/support.py", line 23, in driver = driver.Driver(grammar, convert=pytree.convert) AttributeError: 'module' object has no attribute 'convert' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Jan 28 17:49:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 16:49:49 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090128164949.2F8FC1E4002@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/26 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_platform make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Jan 28 18:02:57 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 28 Jan 2009 18:02:57 +0100 (CET) Subject: [Python-checkins] r69058 - in python/branches/py3k-issue1717: Demo/tkinter/README Demo/tkinter/ttk Doc/library/tk.rst Doc/library/tkinter.ttk.rst Lib/test/test_tk_guionly.py Lib/test/test_tk_textonly.py Lib/tkinter/test Lib/tkinter/ttk.py Misc/NEWS PC/dl_nt.c Python/dynload_win.c Message-ID: <20090128170257.CDD3E1E4002@bag.python.org> Author: mark.dickinson Date: Wed Jan 28 18:02:31 2009 New Revision: 69058 Log: Merged revisions 69035,69041,69051,69055 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69035 | benjamin.peterson | 2009-01-27 21:37:33 +0000 (Tue, 27 Jan 2009) | 28 lines Blocked revisions 69001,69010,69012,69014,69018,69023 via svnmerge ........ r69001 | raymond.hettinger | 2009-01-26 20:58:49 -0600 (Mon, 26 Jan 2009) | 1 line Promote combinations_with_replacement() from a recipe to a regular itertool. ........ r69010 | raymond.hettinger | 2009-01-27 03:33:06 -0600 (Tue, 27 Jan 2009) | 1 line Add tests to verify combinatoric relationships. ........ r69012 | raymond.hettinger | 2009-01-27 03:52:35 -0600 (Tue, 27 Jan 2009) | 1 line Stronger tests for combinatoric relationships. ........ r69014 | raymond.hettinger | 2009-01-27 04:03:04 -0600 (Tue, 27 Jan 2009) | 1 line Issue 5021: doctest.testfile should set __name__ ........ r69018 | raymond.hettinger | 2009-01-27 04:36:14 -0600 (Tue, 27 Jan 2009) | 1 line More exhaustive combinatoric checks. ........ r69023 | raymond.hettinger | 2009-01-27 07:26:35 -0600 (Tue, 27 Jan 2009) | 1 line Add more tests for the powerset() recipe. ........ ................ r69041 | mark.hammond | 2009-01-27 23:46:57 +0000 (Tue, 27 Jan 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 14:41:10 +0000 (Wed, 28 Jan 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 16:06:51 +0000 (Wed, 28 Jan 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. ........ ................ Added: python/branches/py3k-issue1717/Demo/tkinter/ttk/ - copied from r69055, /python/branches/py3k/Demo/tkinter/ttk/ python/branches/py3k-issue1717/Doc/library/tkinter.ttk.rst - copied unchanged from r69055, /python/branches/py3k/Doc/library/tkinter.ttk.rst python/branches/py3k-issue1717/Lib/test/test_tk_guionly.py - copied unchanged from r69055, /python/branches/py3k/Lib/test/test_tk_guionly.py python/branches/py3k-issue1717/Lib/test/test_tk_textonly.py - copied unchanged from r69055, /python/branches/py3k/Lib/test/test_tk_textonly.py python/branches/py3k-issue1717/Lib/tkinter/test/ - copied from r69055, /python/branches/py3k/Lib/tkinter/test/ python/branches/py3k-issue1717/Lib/tkinter/ttk.py - copied unchanged from r69055, /python/branches/py3k/Lib/tkinter/ttk.py Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Demo/tkinter/README python/branches/py3k-issue1717/Doc/library/tk.rst python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/PC/dl_nt.c python/branches/py3k-issue1717/Python/dynload_win.c Modified: python/branches/py3k-issue1717/Demo/tkinter/README ============================================================================== --- python/branches/py3k-issue1717/Demo/tkinter/README (original) +++ python/branches/py3k-issue1717/Demo/tkinter/README Wed Jan 28 18:02:31 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/py3k-issue1717/Doc/library/tk.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/tk.rst (original) +++ python/branches/py3k-issue1717/Doc/library/tk.rst Wed Jan 28 18:02:31 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/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Wed Jan 28 18:02:31 2009 @@ -144,6 +144,8 @@ Library ------- +- 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. @@ -349,6 +351,8 @@ Tools/Demos ----------- +- Ttk demos added in Demo/tkinter/ttk/ + - Issue #4677: add two list comprehension tests to pybench. Modified: python/branches/py3k-issue1717/PC/dl_nt.c ============================================================================== --- python/branches/py3k-issue1717/PC/dl_nt.c (original) +++ python/branches/py3k-issue1717/PC/dl_nt.c Wed Jan 28 18:02:31 2009 @@ -18,6 +18,63 @@ HMODULE PyWin_DLLhModule = NULL; const char *PyWin_DLLVersionString = dllVersionBuffer; +// Windows "Activation Context" work: +// Our .pyd extension modules are generally built without a manifest (ie, +// those included with Python and those built with a default distutils. +// This requires we perform some "activation context" magic when loading our +// extensions. In summary: +// * As our DLL loads we save the context being used. +// * Before loading our extensions we re-activate our saved context. +// * After extension load is complete we restore the old context. +// As an added complication, this magic only works on XP or later - we simply +// use the existence (or not) of the relevant function pointers from kernel32. +// See bug 4566 (http://python.org/sf/4566) for more details. + +typedef BOOL (WINAPI * PFN_GETCURRENTACTCTX)(HANDLE *); +typedef BOOL (WINAPI * PFN_ACTIVATEACTCTX)(HANDLE, ULONG_PTR *); +typedef BOOL (WINAPI * PFN_DEACTIVATEACTCTX)(DWORD, ULONG_PTR); +typedef BOOL (WINAPI * PFN_ADDREFACTCTX)(HANDLE); +typedef BOOL (WINAPI * PFN_RELEASEACTCTX)(HANDLE); + +// locals and function pointers for this activation context magic. +static HANDLE PyWin_DLLhActivationContext = NULL; // one day it might be public +static PFN_GETCURRENTACTCTX pfnGetCurrentActCtx = NULL; +static PFN_ACTIVATEACTCTX pfnActivateActCtx = NULL; +static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL; +static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL; +static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL; + +void _LoadActCtxPointers() +{ + HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll"); + if (hKernel32) + pfnGetCurrentActCtx = (PFN_GETCURRENTACTCTX) GetProcAddress(hKernel32, "GetCurrentActCtx"); + // If we can't load GetCurrentActCtx (ie, pre XP) , don't bother with the rest. + if (pfnGetCurrentActCtx) { + pfnActivateActCtx = (PFN_ACTIVATEACTCTX) GetProcAddress(hKernel32, "ActivateActCtx"); + pfnDeactivateActCtx = (PFN_DEACTIVATEACTCTX) GetProcAddress(hKernel32, "DeactivateActCtx"); + pfnAddRefActCtx = (PFN_ADDREFACTCTX) GetProcAddress(hKernel32, "AddRefActCtx"); + pfnReleaseActCtx = (PFN_RELEASEACTCTX) GetProcAddress(hKernel32, "ReleaseActCtx"); + } +} + +ULONG_PTR _Py_ActivateActCtx() +{ + ULONG_PTR ret = 0; + if (PyWin_DLLhActivationContext && pfnActivateActCtx) + if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) { + OutputDebugString("Python failed to activate the activation context before loading a DLL\n"); + ret = 0; // no promise the failing function didn't change it! + } + return ret; +} + +void _Py_DeactivateActCtx(ULONG_PTR cookie) +{ + if (cookie && pfnDeactivateActCtx) + if (!(*pfnDeactivateActCtx)(0, cookie)) + OutputDebugString("Python failed to de-activate the activation context\n"); +} BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, @@ -29,9 +86,18 @@ PyWin_DLLhModule = hInst; // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); - //initall(); + + // and capture our activation context for use when loading extensions. + _LoadActCtxPointers(); + if (pfnGetCurrentActCtx && pfnAddRefActCtx) + if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext)) + if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext)) + OutputDebugString("Python failed to load the default activation context\n"); break; + case DLL_PROCESS_DETACH: + if (pfnReleaseActCtx) + (*pfnReleaseActCtx)(PyWin_DLLhActivationContext); break; } return TRUE; Modified: python/branches/py3k-issue1717/Python/dynload_win.c ============================================================================== --- python/branches/py3k-issue1717/Python/dynload_win.c (original) +++ python/branches/py3k-issue1717/Python/dynload_win.c Wed Jan 28 18:02:31 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); From buildbot at python.org Wed Jan 28 19:21:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 18:21:25 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090128182208.3154D1E4027@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/100 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: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 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' sincerely, -The Buildbot From buildbot at python.org Wed Jan 28 20:01:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 19:01:12 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090128190112.4EBC41E4002@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/64 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 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: mark.dickinson Date: Wed Jan 28 20:11:04 2009 New Revision: 69059 Log: Fix refleak in range_length_obj. Set tp_reserved to 0 in PyHKEY_Type. Modified: python/branches/py3k-issue1717/Objects/rangeobject.c python/branches/py3k-issue1717/PC/winreg.c Modified: python/branches/py3k-issue1717/Objects/rangeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/rangeobject.c (original) +++ python/branches/py3k-issue1717/Objects/rangeobject.c Wed Jan 28 20:11:04 2009 @@ -134,10 +134,11 @@ PyObject *zero = PyLong_FromLong(0); if (zero == NULL) return NULL; - if ((cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT)) == -1) { - Py_DECREF(zero); + cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT); + Py_DECREF(zero); + if (cmp_result == -1) return NULL; - } + if (cmp_result == 1) { lo = r->start; hi = r->stop; Modified: python/branches/py3k-issue1717/PC/winreg.c ============================================================================== --- python/branches/py3k-issue1717/PC/winreg.c (original) +++ python/branches/py3k-issue1717/PC/winreg.c Wed Jan 28 20:11:04 2009 @@ -485,7 +485,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - PyHKEY_compareFunc, /* tp_reserved */ + 0, /* tp_reserved */ 0, /* tp_repr */ &PyHKEY_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ From python-checkins at python.org Wed Jan 28 20:23:28 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 20:23:28 +0100 (CET) Subject: [Python-checkins] r69060 - python/trunk/Lib/lib-tk/test/runtktests.py Message-ID: <20090128192328.DA2701E400C@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 20:23:28 2009 New Revision: 69060 Log: Added support for collecting tests only from specific packages. 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 Wed Jan 28 20:23:28 2009 @@ -19,9 +19,13 @@ return True return False -def get_tests_modules(basepath=this_dir_path, gui=True): +def get_tests_modules(basepath=this_dir_path, gui=True, packages=None): """This will import and yield modules whose names start with test_ - and are inside packages found in the path starting at basepath.""" + and are inside packages found in the path starting at basepath. + + If packages is specified it should contain package names that want + their tests colleted. + """ py_ext = '.py' for dirpath, dirnames, filenames in os.walk(basepath): @@ -31,6 +35,9 @@ if is_package(dirpath) and filenames: pkg_name = dirpath[len(basepath) + len(os.sep):].replace('/', '.') + if packages and pkg_name not in packages: + continue + filenames = filter( lambda x: x.startswith('test_') and x.endswith(py_ext), filenames) @@ -45,7 +52,7 @@ if gui: raise -def get_tests(text=True, gui=True): +def get_tests(text=True, gui=True, packages=None): """Yield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be @@ -55,7 +62,7 @@ attrs.append('tests_nogui') if gui: attrs.append('tests_gui') - for module in get_tests_modules(gui=gui): + for module in get_tests_modules(gui=gui, packages=packages): for attr in attrs: for test in getattr(module, attr, ()): yield test From python-checkins at python.org Wed Jan 28 20:28:05 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 20:28:05 +0100 (CET) Subject: [Python-checkins] r69061 - in python/trunk/Lib/test: regrtest.py test_tk_guionly.py test_tk_textonly.py test_ttk_guionly.py test_ttk_textonly.py Message-ID: <20090128192805.143F31E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 20:28:04 2009 New Revision: 69061 Log: * 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. Added: python/trunk/Lib/test/test_ttk_guionly.py - copied, changed from r69050, /python/trunk/Lib/test/test_tk_guionly.py python/trunk/Lib/test/test_ttk_textonly.py (contents, props changed) - copied, changed from r69050, /python/trunk/Lib/test/test_tk_textonly.py Removed: python/trunk/Lib/test/test_tk_guionly.py python/trunk/Lib/test/test_tk_textonly.py Modified: python/trunk/Lib/test/regrtest.py Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Wed Jan 28 20:28:04 2009 @@ -1045,6 +1045,8 @@ test_socket_ssl test_socketserver test_tcl + test_ttk_guionly + test_ttk_textonly test_timeout test_urllibnet test_multiprocessing @@ -1062,6 +1064,8 @@ test_kqueue test_ossaudiodev test_tcl + test_ttk_guionly + test_ttk_textonly test_zipimport test_zlib """, @@ -1078,6 +1082,8 @@ test_ossaudiodev test_pep277 test_tcl + test_ttk_guionly + test_ttk_textonly test_multiprocessing """, 'netbsd3': @@ -1094,6 +1100,8 @@ test_ossaudiodev test_pep277 test_tcl + test_ttk_guionly + test_ttk_textonly test_multiprocessing """, } Deleted: python/trunk/Lib/test/test_tk_guionly.py ============================================================================== --- python/trunk/Lib/test/test_tk_guionly.py Wed Jan 28 20:28:04 2009 +++ (empty file) @@ -1,23 +0,0 @@ -import os -import sys -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)) - -if __name__ == '__main__': - test_main(enable_gui=True) Deleted: python/trunk/Lib/test/test_tk_textonly.py ============================================================================== --- python/trunk/Lib/test/test_tk_textonly.py Wed Jan 28 20:28:04 2009 +++ (empty file) @@ -1,16 +0,0 @@ -import os -import sys -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, '..', 'lib-tk', 'test')) -if lib_tk_test not in sys.path: - sys.path.append(lib_tk_test) - -import runtktests - -def test_main(): - test_support.run_unittest(*runtktests.get_tests(gui=False)) - -if __name__ == '__main__': - test_main() Copied: python/trunk/Lib/test/test_ttk_guionly.py (from r69050, /python/trunk/Lib/test/test_tk_guionly.py) ============================================================================== --- /python/trunk/Lib/test/test_tk_guionly.py (original) +++ python/trunk/Lib/test/test_ttk_guionly.py Wed Jan 28 20:28:04 2009 @@ -1,7 +1,15 @@ import os import sys +import ttk +from _tkinter import TclError from test import test_support +try: + ttk.Button() +except TclError, msg: + # assuming ttk is not available + raise test_support.TestSkipped("ttk 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')) @@ -17,7 +25,8 @@ elif 'gui' not in test_support.use_resources: test_support.use_resources.append('gui') - test_support.run_unittest(*runtktests.get_tests(text=False)) + test_support.run_unittest( + *runtktests.get_tests(text=False, packages=['test_ttk'])) if __name__ == '__main__': test_main(enable_gui=True) Copied: python/trunk/Lib/test/test_ttk_textonly.py (from r69050, /python/trunk/Lib/test/test_tk_textonly.py) ============================================================================== --- /python/trunk/Lib/test/test_tk_textonly.py (original) +++ python/trunk/Lib/test/test_ttk_textonly.py Wed Jan 28 20:28:04 2009 @@ -10,7 +10,8 @@ import runtktests def test_main(): - test_support.run_unittest(*runtktests.get_tests(gui=False)) + test_support.run_unittest( + *runtktests.get_tests(gui=False, packages=['test_ttk'])) if __name__ == '__main__': test_main() From python-checkins at python.org Wed Jan 28 21:02:01 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 21:02:01 +0100 (CET) Subject: [Python-checkins] r69062 - python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py Message-ID: <20090128200201.C47611E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 21:02:01 2009 New Revision: 69062 Log: Make sure the root windows gets destroyed Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py 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 Wed Jan 28 21:02:01 2009 @@ -708,10 +708,13 @@ class TreeviewTest(unittest.TestCase): def setUp(self): - self.tv = ttk.Treeview() + self.root = support.get_tk_root() + self.tv = ttk.Treeview(self.root) def tearDown(self): self.tv.destroy() + self.root.update_idletasks() + self.root.destroy() def test_bbox(self): From python-checkins at python.org Wed Jan 28 21:03:27 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 21:03:27 +0100 (CET) Subject: [Python-checkins] r69063 - in python/trunk: Lib/test/regrtest.py Misc/NEWS Message-ID: <20090128200327.0F2911E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 21:03:26 2009 New Revision: 69063 Log: Issue #5083: New 'gui' resource for regrtest. Modified: python/trunk/Lib/test/regrtest.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Wed Jan 28 21:03:26 2009 @@ -116,6 +116,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'. @@ -168,7 +170,7 @@ from test import test_support RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb', - 'decimal', 'compiler', 'subprocess', 'urlfetch') + 'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui') def usage(code, msg=''): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Jan 28 21:03:26 2009 @@ -442,6 +442,11 @@ - Issue #4396: The parser module now correctly validates the with statement. +Tests +----- + +- Issue #5083: New 'gui' resource for regrtest. + What's New in Python 2.6 final ============================== From buildbot at python.org Wed Jan 28 21:15:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 20:15:28 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090128201529.0F2D81E4015@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/1765 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 failed slave lost sincerely, -The Buildbot From buildbot at python.org Wed Jan 28 21:31:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 20:31:17 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090128203117.B616E1E4002@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/75 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_distutils ====================================================================== ERROR: test_make_distribution (distutils.tests.test_sdist.sdistTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_sdist.py", line 119, in test_make_distribution spawn('tar --help') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 33, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 58, in _spawn_nt cmd = _nt_quote_args(cmd) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 53, in _nt_quote_args args[i] = '"%s"' % args[i] TypeError: 'str' object does not support item assignment sincerely, -The Buildbot From python-checkins at python.org Wed Jan 28 21:40:49 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 21:40:49 +0100 (CET) Subject: [Python-checkins] r69064 - in python/branches/py3k: Lib/test/regrtest.py Lib/test/test_tk_guionly.py Lib/test/test_tk_textonly.py Lib/test/test_ttk_guionly.py Lib/test/test_ttk_textonly.py Lib/tkinter/test/runtktests.py Lib/tkinter/test/test_ttk/test_widgets.py Misc/NEWS Message-ID: <20090128204049.70DBC1E4017@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 21:40:48 2009 New Revision: 69064 Log: 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. ........ Added: python/branches/py3k/Lib/test/test_ttk_guionly.py - copied, changed from r69063, /python/trunk/Lib/test/test_ttk_guionly.py python/branches/py3k/Lib/test/test_ttk_textonly.py - copied, changed from r69063, /python/trunk/Lib/test/test_ttk_textonly.py Removed: python/branches/py3k/Lib/test/test_tk_guionly.py python/branches/py3k/Lib/test/test_tk_textonly.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/regrtest.py python/branches/py3k/Lib/tkinter/test/runtktests.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/regrtest.py ============================================================================== --- python/branches/py3k/Lib/test/regrtest.py (original) +++ python/branches/py3k/Lib/test/regrtest.py Wed Jan 28 21:40:48 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 """, } Deleted: python/branches/py3k/Lib/test/test_tk_guionly.py ============================================================================== --- python/branches/py3k/Lib/test/test_tk_guionly.py Wed Jan 28 21:40:48 2009 +++ (empty file) @@ -1,14 +0,0 @@ -from test import support -from tkinter.test import runtktests - -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)) - -if __name__ == '__main__': - test_main(enable_gui=True) Deleted: python/branches/py3k/Lib/test/test_tk_textonly.py ============================================================================== --- python/branches/py3k/Lib/test/test_tk_textonly.py Wed Jan 28 21:40:48 2009 +++ (empty file) @@ -1,8 +0,0 @@ -from test import support -from tkinter.test import runtktests - -def test_main(): - support.run_unittest(*runtktests.get_tests(gui=False)) - -if __name__ == '__main__': - test_main() Copied: python/branches/py3k/Lib/test/test_ttk_guionly.py (from r69063, /python/trunk/Lib/test/test_ttk_guionly.py) ============================================================================== --- /python/trunk/Lib/test/test_ttk_guionly.py (original) +++ python/branches/py3k/Lib/test/test_ttk_guionly.py Wed Jan 28 21:40:48 2009 @@ -1,31 +1,24 @@ import os import sys -import ttk +from tkinter import ttk +from tkinter.test import runtktests from _tkinter import TclError -from test import test_support +from test import support try: ttk.Button() -except TclError, msg: +except TclError as msg: # assuming ttk is not available - raise test_support.TestSkipped("ttk 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')) -if lib_tk_test not in sys.path: - sys.path.append(lib_tk_test) - -import runtktests + raise support.TestSkipped("ttk not available: %s" % msg) 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') + if support.use_resources is None: + support.use_resources = ['gui'] + elif 'gui' not in support.use_resources: + support.use_resources.append('gui') - test_support.run_unittest( + support.run_unittest( *runtktests.get_tests(text=False, packages=['test_ttk'])) if __name__ == '__main__': Copied: python/branches/py3k/Lib/test/test_ttk_textonly.py (from r69063, /python/trunk/Lib/test/test_ttk_textonly.py) ============================================================================== --- /python/trunk/Lib/test/test_ttk_textonly.py (original) +++ python/branches/py3k/Lib/test/test_ttk_textonly.py Wed Jan 28 21:40:48 2009 @@ -1,16 +1,10 @@ import os import sys -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, '..', 'lib-tk', 'test')) -if lib_tk_test not in sys.path: - sys.path.append(lib_tk_test) - -import runtktests +from test import support +from tkinter.test import runtktests def test_main(): - test_support.run_unittest( + support.run_unittest( *runtktests.get_tests(gui=False, packages=['test_ttk'])) if __name__ == '__main__': 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 Wed Jan 28 21:40:48 2009 @@ -19,9 +19,13 @@ return True return False -def get_tests_modules(basepath=this_dir_path, gui=True): +def get_tests_modules(basepath=this_dir_path, gui=True, packages=None): """This will import and yield modules whose names start with test_ - and are inside packages found in the path starting at basepath.""" + and are inside packages found in the path starting at basepath. + + If packages is specified it should contain package names that + want their tests collected. + """ py_ext = '.py' for dirpath, dirnames, filenames in os.walk(basepath): @@ -31,6 +35,9 @@ if is_package(dirpath) and filenames: pkg_name = dirpath[len(basepath) + len(os.sep):].replace('/', '.') + if packages and pkg_name not in packages: + continue + filenames = filter( lambda x: x.startswith('test_') and x.endswith(py_ext), filenames) @@ -48,7 +55,7 @@ if gui: raise -def get_tests(text=True, gui=True): +def get_tests(text=True, gui=True, packages=None): """Yield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be @@ -58,7 +65,7 @@ attrs.append('tests_nogui') if gui: attrs.append('tests_gui') - for module in get_tests_modules(gui=gui): + for module in get_tests_modules(gui=gui, packages=packages): for attr in attrs: for test in getattr(module, attr, ()): yield test 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 Wed Jan 28 21:40:48 2009 @@ -708,10 +708,13 @@ class TreeviewTest(unittest.TestCase): def setUp(self): - self.tv = ttk.Treeview() + self.root = support.get_tk_root() + self.tv = ttk.Treeview(self.root) def tearDown(self): self.tv.destroy() + self.root.update_idletasks() + self.root.destroy() def test_bbox(self): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 28 21:40:48 2009 @@ -423,6 +423,12 @@ buffer. +Tests +----- + +- Issue #5083: New 'gui' resource for regrtest. + + Docs ---- From python-checkins at python.org Wed Jan 28 21:47:25 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 21:47:25 +0100 (CET) Subject: [Python-checkins] r69065 - python/branches/release30-maint Message-ID: <20090128204725.B85471E4010@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 21:47:25 2009 New Revision: 69065 Log: Blocked revisions 69064 via svnmerge ................ r69064 | guilherme.polo | 2009-01-28 18:40:48 -0200 (Wed, 28 Jan 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. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Wed Jan 28 21:47:52 2009 From: python-checkins at python.org (guilherme.polo) Date: Wed, 28 Jan 2009 21:47:52 +0100 (CET) Subject: [Python-checkins] r69066 - python/branches/release26-maint Message-ID: <20090128204752.B40CD1E4002@bag.python.org> Author: guilherme.polo Date: Wed Jan 28 21:47:52 2009 New Revision: 69066 Log: Blocked revisions 69060-69063 via svnmerge ........ 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. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed Jan 28 22:06:01 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 28 Jan 2009 22:06:01 +0100 (CET) Subject: [Python-checkins] r69067 - in python/branches/release30-maint/Lib/test/crashers: loosing_mro_ref.py losing_mro_ref.py Message-ID: <20090128210601.5504D1E4010@bag.python.org> Author: raymond.hettinger Date: Wed Jan 28 22:06:01 2009 New Revision: 69067 Log: Fix spelling in filename. Added: python/branches/release30-maint/Lib/test/crashers/losing_mro_ref.py - copied unchanged from r69066, /python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py Removed: python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py Deleted: python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py ============================================================================== --- python/branches/release30-maint/Lib/test/crashers/loosing_mro_ref.py Wed Jan 28 22:06:01 2009 +++ (empty file) @@ -1,35 +0,0 @@ -""" -There is a way to put keys of any type in a type's dictionary. -I think this allows various kinds of crashes, but so far I have only -found a convoluted attack of _PyType_Lookup(), which uses the mro of the -type without holding a strong reference to it. Probably works with -super.__getattribute__() too, which uses the same kind of code. -""" - -class MyKey(object): - def __hash__(self): - return hash('mykey') - - def __eq__(self, other): - # the following line decrefs the previous X.__mro__ - X.__bases__ = (Base2,) - # trash all tuples of length 3, to make sure that the items of - # the previous X.__mro__ are really garbage - z = [] - for i in range(1000): - z.append((i, None, None)) - return 0 - - -class Base(object): - mykey = 'from Base' - -class Base2(object): - mykey = 'from Base2' - -# you can't add a non-string key to X.__dict__, but it can be -# there from the beginning :-) -X = type('X', (Base,), {MyKey(): 5}) - -print(X.mykey) -# I get a segfault, or a slightly wrong assertion error in a debug build. From python-checkins at python.org Wed Jan 28 22:25:58 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 28 Jan 2009 22:25:58 +0100 (CET) Subject: [Python-checkins] r69068 - in python/branches/py3k: Lib/test/test_builtin.py Lib/test/test_long.py Misc/NEWS Objects/longobject.c Python/bltinmodule.c Message-ID: <20090128212558.92C171E4002@bag.python.org> Author: mark.dickinson Date: Wed Jan 28 22:25:58 2009 New Revision: 69068 Log: Issue #4707: round(x, n) now returns an integer when x is an integer. Previously it returned a float. Modified: python/branches/py3k/Lib/test/test_builtin.py python/branches/py3k/Lib/test/test_long.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/longobject.c python/branches/py3k/Python/bltinmodule.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 Wed Jan 28 22:25:58 2009 @@ -1068,9 +1068,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/py3k/Lib/test/test_long.py ============================================================================== --- python/branches/py3k/Lib/test/test_long.py (original) +++ python/branches/py3k/Lib/test/test_long.py Wed Jan 28 22:25:58 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/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Jan 28 22:25:58 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- 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 Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Wed Jan 28 22:25:58 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, Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Wed Jan 28 22:25:58 2009 @@ -1717,15 +1717,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 +1745,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\ From buildbot at python.org Wed Jan 28 22:27:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 21:27:05 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090128212705.9AD5E1E4002@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/231 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Jan 28 22:41:53 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 28 Jan 2009 22:41:53 +0100 (CET) Subject: [Python-checkins] r69069 - in python/branches/release30-maint: Lib/test/test_builtin.py Lib/test/test_long.py Misc/NEWS Objects/longobject.c Python/bltinmodule.c Message-ID: <20090128214153.E85111E4002@bag.python.org> Author: mark.dickinson Date: Wed Jan 28 22:41:53 2009 New Revision: 69069 Log: Merged revisions 69068 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69068 | mark.dickinson | 2009-01-28 21:25:58 +0000 (Wed, 28 Jan 2009) | 3 lines Issue #4707: round(x, n) now returns an integer when x is an integer. Previously it returned a float. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_builtin.py python/branches/release30-maint/Lib/test/test_long.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/longobject.c python/branches/release30-maint/Python/bltinmodule.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 Wed Jan 28 22:41:53 2009 @@ -1068,9 +1068,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/release30-maint/Lib/test/test_long.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_long.py (original) +++ python/branches/release30-maint/Lib/test/test_long.py Wed Jan 28 22:41:53 2009 @@ -861,6 +861,82 @@ self.assertTrue(i - i is 0) self.assertTrue(0 * i is 0) + 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/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Jan 28 22:41:53 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4707: round(x, n) now returns an integer if x is an integer. + Previously it returned a float. + - Issue #4874: Most builtin decoders now reject unicode input. - Issue #4842: Don't allow trailing 'L' when constructing an integer Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Wed Jan 28 22:41:53 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 * @@ -3702,8 +3810,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, Modified: python/branches/release30-maint/Python/bltinmodule.c ============================================================================== --- python/branches/release30-maint/Python/bltinmodule.c (original) +++ python/branches/release30-maint/Python/bltinmodule.c Wed Jan 28 22:41:53 2009 @@ -1718,15 +1718,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) @@ -1747,15 +1746,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\ From buildbot at python.org Wed Jan 28 22:47:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 21:47:15 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090128214715.6F0631E4002@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/194 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: 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 Jan 28 23:59:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 28 Jan 2009 22:59:46 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090128225947.0476E1E4002@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/206 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_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 29 00:02:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 00:02:26 +0100 (CET) Subject: [Python-checkins] r69070 - in python/trunk: Lib/_abcoll.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090128230226.D87E81E403F@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 00:02:26 2009 New Revision: 69070 Log: Issue 4920: Fixed next() vs __next__() issues in the ABCs for Iterator and MutableSet. Also added thorough test for required abstractmethods. Modified: python/trunk/Lib/_abcoll.py python/trunk/Lib/test/test_collections.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/_abcoll.py ============================================================================== --- python/trunk/Lib/_abcoll.py (original) +++ python/trunk/Lib/_abcoll.py Thu Jan 29 00:02:26 2009 @@ -60,7 +60,7 @@ class Iterator(Iterable): @abstractmethod - def __next__(self): + def next(self): raise StopIteration def __iter__(self): @@ -267,7 +267,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/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Thu Jan 29 00:02:26 2009 @@ -156,7 +156,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 @@ -182,6 +199,7 @@ __eq__ = Hashable.__eq__ # Silence Py3k warning self.assertEqual(hash(H()), 0) self.failIf(issubclass(int, H)) + self.validate_abstract_methods(Hashable, '__hash__') def test_Iterable(self): # Check some non-iterables @@ -205,6 +223,7 @@ return super(I, self).__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, "".encode('ascii'), "", (), [], @@ -223,6 +242,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, @@ -239,6 +259,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, @@ -255,6 +276,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, @@ -273,6 +295,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: @@ -291,7 +314,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 @@ -301,6 +324,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): @@ -322,22 +346,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, str]: self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) self.failUnless(issubclass(basestring, Sequence)) + self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', + '__getitem__') def test_MutableSequence(self): for sample in [tuple, str]: @@ -347,6 +406,8 @@ self.failUnless(isinstance(sample(), MutableSequence)) self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(basestring, MutableSequence)) + self.validate_abstract_methods(MutableSequence, '__contains__', '__iter__', + '__len__', '__getitem__', '__setitem__', '__delitem__', 'insert') class TestCounter(unittest.TestCase): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 29 00:02:26 2009 @@ -145,6 +145,9 @@ Library ------- +- Issue 4920: Fixed .next() vs .__next__() issues in the ABCs for + Iterator and MutableSet. + - Added the ttk module. See issue #2983: Ttk support for Tkinter. - Issue 5021: doctest.testfile() did not create __name__ and From python-checkins at python.org Thu Jan 29 00:14:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 00:14:59 +0100 (CET) Subject: [Python-checkins] r69071 - in python/branches/release26-maint: Lib/_abcoll.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090128231459.1043A1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 00:14:58 2009 New Revision: 69071 Log: Issue 4920: Fixed next() vs __next__() issues in the ABCs for Iterator and MutableSet. Also added thorough test for required abstractmethods. 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 Thu Jan 29 00:14:58 2009 @@ -60,7 +60,7 @@ class Iterator(Iterable): @abstractmethod - def __next__(self): + def next(self): raise StopIteration def __iter__(self): @@ -267,7 +267,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/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 Thu Jan 29 00:14:58 2009 @@ -154,7 +154,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 @@ -180,6 +197,7 @@ __eq__ = Hashable.__eq__ # Silence Py3k warning self.assertEqual(hash(H()), 0) self.failIf(issubclass(int, H)) + self.validate_abstract_methods(Hashable, '__hash__') def test_Iterable(self): # Check some non-iterables @@ -203,6 +221,7 @@ return super(I, self).__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, "".encode('ascii'), "", (), [], @@ -221,6 +240,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, @@ -237,6 +257,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, @@ -253,6 +274,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, @@ -271,6 +293,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: @@ -289,7 +312,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 @@ -299,6 +322,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): @@ -320,22 +344,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, str]: self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) self.failUnless(issubclass(basestring, Sequence)) + self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', + '__getitem__') def test_MutableSequence(self): for sample in [tuple, str]: @@ -345,6 +404,8 @@ self.failUnless(isinstance(sample(), MutableSequence)) self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(basestring, MutableSequence)) + self.validate_abstract_methods(MutableSequence, '__contains__', '__iter__', + '__len__', '__getitem__', '__setitem__', '__delitem__', 'insert') import doctest, collections Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Jan 29 00:14:58 2009 @@ -76,6 +76,9 @@ Library ------- +- Issue 4920: Fixed .next() vs .__next__() issues in the ABCs for + Iterator and MutableSet. + - Issue 5021: doctest.testfile() did not create __name__ and collections.namedtuple() relied on __name__ being defined. From python-checkins at python.org Thu Jan 29 00:33:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 00:33:59 +0100 (CET) Subject: [Python-checkins] r69072 - in python/branches/py3k/Lib: _abcoll.py test/test_collections.py Message-ID: <20090128233359.7D5B91E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 00:33:59 2009 New Revision: 69072 Log: Beef-up tests for collections ABCs. 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 Thu Jan 29 00:33:59 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/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Thu Jan 29 00:33:59 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): From python-checkins at python.org Thu Jan 29 00:38:10 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 00:38:10 +0100 (CET) Subject: [Python-checkins] r69073 - in python/branches/release30-maint/Lib: _abcoll.py test/test_collections.py Message-ID: <20090128233810.6C4E91E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 00:38:10 2009 New Revision: 69073 Log: Beef-up tests for collections ABCs. Modified: python/branches/release30-maint/Lib/_abcoll.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 Thu Jan 29 00:38:10 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/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 Thu Jan 29 00:38:10 2009 @@ -158,7 +158,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 @@ -183,6 +200,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 @@ -206,6 +224,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()] @@ -223,6 +242,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, @@ -239,6 +259,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, @@ -255,6 +276,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, @@ -273,6 +295,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: @@ -290,7 +313,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 @@ -300,6 +323,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): @@ -321,22 +345,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]: @@ -356,6 +415,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') import doctest, collections From python-checkins at python.org Thu Jan 29 00:58:16 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 00:58:16 +0100 (CET) Subject: [Python-checkins] r69074 - python/trunk/Doc/library/collections.rst Message-ID: <20090128235816.4866D1E400C@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 00:58:16 2009 New Revision: 69074 Log: Correct docs for ABCs (MutableSequence was missing __setiem). Simplify the table by taking out inherited requirements for abstract methods. 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 Thu Jan 29 00:58:16 2009 @@ -57,31 +57,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__``, From python-checkins at python.org Thu Jan 29 01:01:28 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 01:01:28 +0100 (CET) Subject: [Python-checkins] r69075 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090129000128.2E68E1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 01:01:27 2009 New Revision: 69075 Log: Correct docs for ABCs (MutableSequence was missing __setiem). Simplify the table by taking out inherited requirements for abstract methods. 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 Thu Jan 29 01:01:27 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__``, From python-checkins at python.org Thu Jan 29 01:02:31 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 01:02:31 +0100 (CET) Subject: [Python-checkins] r69076 - python/branches/release26-maint/Doc/library/collections.rst Message-ID: <20090129000231.ED7821E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 01:02:31 2009 New Revision: 69076 Log: Correct docs for ABCs (MutableSequence was missing __setiem). Simplify the table by taking out inherited requirements for abstract methods. 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 Thu Jan 29 01:02:31 2009 @@ -57,31 +57,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__``, From python-checkins at python.org Thu Jan 29 01:04:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 01:04:02 +0100 (CET) Subject: [Python-checkins] r69077 - python/branches/release30-maint/Doc/library/collections.rst Message-ID: <20090129000402.BA6871E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 01:04:02 2009 New Revision: 69077 Log: Correct docs for ABCs (MutableSequence was missing __setiem). Simplify the table by taking out inherited requirements for abstract methods. 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 Thu Jan 29 01:04: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__``, From buildbot at python.org Thu Jan 29 01:10:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 00:10:46 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090129001046.D422B1E4002@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/73 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Thu Jan 29 01:45:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 00:45:16 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090129004517.00D211E400C@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/102 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,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 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 Thu Jan 29 01:54:12 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 01:54:12 +0100 (CET) Subject: [Python-checkins] r69078 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20090129005412.15AAB1E4051@bag.python.org> Author: brett.cannon Date: Thu Jan 29 01:54:11 2009 New Revision: 69078 Log: Clarify some __del__ stuff. 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 Thu Jan 29 01:54:11 2009 @@ -1257,7 +1257,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 From python-checkins at python.org Thu Jan 29 01:54:32 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 01:54:32 +0100 (CET) Subject: [Python-checkins] r69079 - python/trunk/Doc/library/datetime.rst Message-ID: <20090129005432.701531E400C@bag.python.org> Author: brett.cannon Date: Thu Jan 29 01:54:32 2009 New Revision: 69079 Log: Minor spelling mistake in datetime docs. Modified: python/trunk/Doc/library/datetime.rst Modified: python/trunk/Doc/library/datetime.rst ============================================================================== --- python/trunk/Doc/library/datetime.rst (original) +++ python/trunk/Doc/library/datetime.rst Thu Jan 29 01:54:32 2009 @@ -1269,7 +1269,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 From python-checkins at python.org Thu Jan 29 01:55:33 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 01:55:33 +0100 (CET) Subject: [Python-checkins] r69080 - in python/trunk/Lib/lib-tk/test: test_ttk Message-ID: <20090129005533.E81311E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 29 01:55:33 2009 New Revision: 69080 Log: Ignore .pyc and .pyo files. Modified: python/trunk/Lib/lib-tk/test/ (props changed) python/trunk/Lib/lib-tk/test/test_ttk/ (props changed) From buildbot at python.org Thu Jan 29 02:08:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 01:08:50 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090129010850.341D21E4002@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/183 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 buildbot at python.org Thu Jan 29 02:52:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 01:52:44 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090129015244.E62021E4002@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/780 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Jan 29 02:59:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 29 Jan 2009 02:59:38 +0100 (CET) Subject: [Python-checkins] r69081 - python/branches/py3k Message-ID: <20090129015939.2F4091E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 29 02:59:38 2009 New Revision: 69081 Log: 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. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Jan 29 03:14:30 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 29 Jan 2009 03:14:30 +0100 (CET) Subject: [Python-checkins] r69082 - python/branches/py3k Message-ID: <20090129021430.A427F1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 29 03:14:30 2009 New Revision: 69082 Log: 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. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Thu Jan 29 03:58:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 02:58:28 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090129025828.ED1541E4002@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/196 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 Thu Jan 29 04:03:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 29 Jan 2009 04:03:00 +0100 (CET) Subject: [Python-checkins] r69083 - python/trunk/Doc/tools/sphinxext/download.html Message-ID: <20090129030300.82BE51E4002@bag.python.org> Author: benjamin.peterson Date: Thu Jan 29 04:03:00 2009 New Revision: 69083 Log: fix download url 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 Thu Jan 29 04:03:00 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 Jan 29 04:11:30 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 29 Jan 2009 04:11:30 +0100 (CET) Subject: [Python-checkins] r69084 - in python/branches/release26-maint: Doc/tools/sphinxext/download.html Message-ID: <20090129031130.647AA1E402D@bag.python.org> Author: benjamin.peterson Date: Thu Jan 29 04:11:30 2009 New Revision: 69084 Log: Merged revisions 69083 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69083 | benjamin.peterson | 2009-01-28 21:03:00 -0600 (Wed, 28 Jan 2009) | 1 line fix download url ........ 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 Jan 29 04:11:30 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 Jan 29 04:21:42 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 04:21:42 +0100 (CET) Subject: [Python-checkins] r69085 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090129032142.C0B2C1E4019@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 04:21:42 2009 New Revision: 69085 Log: Update itertools.__doc__ to include all tools. Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Jan 29 04:21:42 2009 @@ -3920,8 +3920,10 @@ repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\ \n\ Iterators terminating on the shortest input sequence:\n\ -izip(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ... \n\ -izip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ... \n\ +chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\ +combine(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\ ifilter(pred, seq) --> elements of seq where pred(elem) is True\n\ ifilterfalse(pred, seq) --> elements of seq where pred(elem) is False\n\ islice(seq, [start,] stop [, step]) --> elements from\n\ @@ -3929,10 +3931,15 @@ imap(fun, p, q, ...) --> fun(p0, q0), fun(p1, q1), ...\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\ +izip(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ... \n\ +izip_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\ "); From python-checkins at python.org Thu Jan 29 04:41:58 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 04:41:58 +0100 (CET) Subject: [Python-checkins] r69086 - python/branches/py3k/Modules/itertoolsmodule.c Message-ID: <20090129034158.A31EF1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 04:41:55 2009 New Revision: 69086 Log: Update itertools.__doc__ to include all tools. 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 Jan 29 04:41:55 2009 @@ -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\ "); From python-checkins at python.org Thu Jan 29 04:43:44 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 04:43:44 +0100 (CET) Subject: [Python-checkins] r69087 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090129034344.F345B1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 04:43:44 2009 New Revision: 69087 Log: Fix typo. Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Jan 29 04:43:44 2009 @@ -3921,7 +3921,7 @@ \n\ Iterators terminating on the shortest input sequence:\n\ chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\ -combine(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\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\ ifilter(pred, seq) --> elements of seq where pred(elem) is True\n\ From python-checkins at python.org Thu Jan 29 04:48:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 04:48:02 +0100 (CET) Subject: [Python-checkins] r69088 - python/branches/py3k/Modules/itertoolsmodule.c Message-ID: <20090129034802.A1C781E4002@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 04:48:02 2009 New Revision: 69088 Log: Fix typo. 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 Jan 29 04:48:02 2009 @@ -3411,12 +3411,12 @@ tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\n\ takewhile(pred, seq) --> seq[0], seq[1], until pred fails\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\ +\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\ "); From python-checkins at python.org Thu Jan 29 04:52:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 29 Jan 2009 04:52:26 +0100 (CET) Subject: [Python-checkins] r69089 - python/branches/py3k Message-ID: <20090129035226.51E151E4014@bag.python.org> Author: benjamin.peterson Date: Thu Jan 29 04:52:26 2009 New Revision: 69089 Log: 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. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Jan 29 04:58:16 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 04:58:16 +0100 (CET) Subject: [Python-checkins] r69090 - in python/branches/release26-maint: Doc/library/datetime.rst Doc/reference/datamodel.rst Message-ID: <20090129035817.008181E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 29 04:58:16 2009 New Revision: 69090 Log: Merged revisions 69078-69079 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. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/datetime.rst python/branches/release26-maint/Doc/reference/datamodel.rst 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 Thu Jan 29 04:58:16 2009 @@ -1269,7 +1269,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/release26-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release26-maint/Doc/reference/datamodel.rst Thu Jan 29 04:58:16 2009 @@ -1249,7 +1249,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 From buildbot at python.org Thu Jan 29 05:03:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 04:03:10 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090129040310.919FC1E4002@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/59 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,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') make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Thu Jan 29 05:05:43 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 05:05:43 +0100 (CET) Subject: [Python-checkins] r69091 - python/branches/release30-maint Message-ID: <20090129040543.5CEAE1E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 29 05:05:43 2009 New Revision: 69091 Log: Blocked revisions 68791 via svnmerge ........ r68791 | brett.cannon | 2009-01-19 18:21:27 -0800 (Mon, 19 Jan 2009) | 3 lines Document the (very small) public API for importlib. As time goes on and some key refactorings occur more of the API will be exposed and documented. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu Jan 29 05:10:22 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 05:10:22 +0100 (CET) Subject: [Python-checkins] r69092 - in python/branches/py3k: Doc/library/datetime.rst Doc/reference/datamodel.rst Message-ID: <20090129041022.1BBC51E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 29 05:10:21 2009 New Revision: 69092 Log: 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. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/datetime.rst python/branches/py3k/Doc/reference/datamodel.rst Modified: python/branches/py3k/Doc/library/datetime.rst ============================================================================== --- python/branches/py3k/Doc/library/datetime.rst (original) +++ python/branches/py3k/Doc/library/datetime.rst Thu Jan 29 05:10:21 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/py3k/Doc/reference/datamodel.rst ============================================================================== --- python/branches/py3k/Doc/reference/datamodel.rst (original) +++ python/branches/py3k/Doc/reference/datamodel.rst Thu Jan 29 05:10:21 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 From python-checkins at python.org Thu Jan 29 05:37:06 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 29 Jan 2009 05:37:06 +0100 (CET) Subject: [Python-checkins] r69093 - in python/branches/release30-maint/Doc: library/datetime.rst reference/datamodel.rst Message-ID: <20090129043706.5614B1E4002@bag.python.org> Author: brett.cannon Date: Thu Jan 29 05:37:06 2009 New Revision: 69093 Log: Backport r69092 by hand since svnmerge keeps saying there is a conflict on '.'. Modified: python/branches/release30-maint/Doc/library/datetime.rst python/branches/release30-maint/Doc/reference/datamodel.rst Modified: python/branches/release30-maint/Doc/library/datetime.rst ============================================================================== --- python/branches/release30-maint/Doc/library/datetime.rst (original) +++ python/branches/release30-maint/Doc/library/datetime.rst Thu Jan 29 05:37:06 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/release30-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release30-maint/Doc/reference/datamodel.rst Thu Jan 29 05:37:06 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 From buildbot at python.org Thu Jan 29 07:48:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 06:48:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090129064819.F02CE1E401B@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/104 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: brett.cannon,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.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 Jan 29 09:24:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 08:24:50 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090129082450.CAD4A1E4002@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/198 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,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.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 Thu Jan 29 11:19:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 10:19:53 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090129101954.19E941E4002@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/76 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: brett.cannon 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 Jan 29 13:13:31 2009 From: python-checkins at python.org (mark.hammond) Date: Thu, 29 Jan 2009 13:13:31 +0100 (CET) Subject: [Python-checkins] r69094 - in python/trunk: Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe PC/bdist_wininst/install.c PCbuild/bdist_wininst.vcproj Message-ID: <20090129121331.84C941E4002@bag.python.org> Author: mark.hammond Date: Thu Jan 29 13:13:31 2009 New Revision: 69094 Log: Fix issue5075: bdist_wininst should not depend on the vc runtime? Modified: python/trunk/Lib/distutils/command/wininst-9.0-amd64.exe python/trunk/Lib/distutils/command/wininst-9.0.exe python/trunk/PC/bdist_wininst/install.c python/trunk/PCbuild/bdist_wininst.vcproj Modified: python/trunk/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/trunk/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/trunk/PC/bdist_wininst/install.c ============================================================================== --- python/trunk/PC/bdist_wininst/install.c (original) +++ python/trunk/PC/bdist_wininst/install.c Thu Jan 29 13:13:31 2009 @@ -694,8 +694,9 @@ */ 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; DECLPROC(hPython, void, Py_Initialize, (void)); DECLPROC(hPython, int, PySys_SetArgv, (int, char **)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); @@ -706,9 +707,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,7 +728,7 @@ } SetDlgItemText(hDialog, IDC_INFO, "Running Script..."); - + Py_Initialize(); prepare_script_environment(hPython); @@ -751,7 +749,57 @@ Py_Finalize(); close(fh); + return result; +} +static int +run_installscript(char *pathname, int argc, char **argv, char **pOutput) +{ + HINSTANCE hPython; + int result = 1; + int out_buf_size; + HANDLE redirected, old_stderr, old_stdout; + char *tempname; + + *pOutput = NULL; + + tempname = tempnam(NULL, NULL); + // We use a static CRT while the Python version we load uses + // the CRT from one of various possibile DLLs. As a result we + // need to redirect the standard handles using the API rather + // than the CRT. + redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); + + hPython = LoadPythonDll(pythondll); + if (hPython) { + result = do_run_installscript(hPython, pathname, argc, argv); + FreeLibrary(hPython); + } else { + fprintf(stderr, "*** Could not load Python ***"); + } + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); + out_buf_size = min(GetFileSize(redirected, NULL), 4096); + *pOutput = malloc(out_buf_size+1); + if (*pOutput) { + DWORD nread = 0; + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, *pOutput, out_buf_size, &nread, NULL); + (*pOutput)[nread] = '\0'; + } + CloseHandle(redirected); + DeleteFile(tempname); return result; } @@ -781,11 +829,21 @@ static int run_simple_script(char *script) { int rc; - char *tempname; HINSTANCE hPython; - tempname = tempnam(NULL, NULL); - freopen(tempname, "a", stderr); - freopen(tempname, "a", stdout); + char *tempname = tempnam(NULL, NULL); + // Redirect output using win32 API - see comments above... + HANDLE redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + HANDLE old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + HANDLE old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); hPython = LoadPythonDll(pythondll); if (!hPython) { @@ -796,10 +854,8 @@ } rc = do_run_simple_script(hPython, script); FreeLibrary(hPython); - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); /* We only care about the output when we fail. If the script works OK, then we discard it */ @@ -808,24 +864,24 @@ char *err_buf; const char *prefix = "Running the pre-installation script failed\r\n"; int prefix_len = strlen(prefix); - FILE *fp = fopen(tempname, "rb"); - fseek(fp, 0, SEEK_END); - err_buf_size = ftell(fp); - fseek(fp, 0, SEEK_SET); + err_buf_size = GetFileSize(redirected, NULL); + if (err_buf_size==INVALID_FILE_SIZE) // an error - let's try anyway... + err_buf_size = 4096; err_buf = malloc(prefix_len + err_buf_size + 1); if (err_buf) { - int n; + DWORD n = 0; strcpy(err_buf, prefix); - n = fread(err_buf+prefix_len, 1, err_buf_size, fp); + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, err_buf+prefix_len, err_buf_size, &n, NULL); err_buf[prefix_len+n] = '\0'; - fclose(fp); set_failure_reason(err_buf); free(err_buf); } else { set_failure_reason("Out of memory!"); } } - remove(tempname); + CloseHandle(redirected); + DeleteFile(tempname); return rc; } @@ -1946,12 +2002,9 @@ if (success && install_script && install_script[0]) { char fname[MAX_PATH]; - char *tempname; - FILE *fp; - char buffer[4096]; - int n; + char *buffer; HCURSOR hCursor; - HINSTANCE hPython; + int result; char *argv[3] = {NULL, "-install", NULL}; @@ -1964,48 +2017,21 @@ if (logfile) fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); - tempname = tempnam(NULL, NULL); - - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); -/* - if (0 != setvbuf(stdout, NULL, _IONBF, 0)) - MessageBox(GetFocus(), "setvbuf stdout", NULL, MB_OK); -*/ hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); argv[0] = fname; - hPython = LoadPythonDll(pythondll); - if (hPython) { - int result; - result = run_installscript(hPython, fname, 2, argv); - if (-1 == result) { - fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); - } - FreeLibrary(hPython); - } else { - fprintf(stderr, "*** Could not load Python ***"); + result = run_installscript(fname, 2, argv, &buffer); + if (0 != result) { + fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); } - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - - SetDlgItemText(hwnd, IDC_INFO, buffer); + if (buffer) + SetDlgItemText(hwnd, IDC_INFO, buffer); SetDlgItemText(hwnd, IDC_TITLE, "Postinstall script finished.\n" "Click the Finish button to exit the Setup wizard."); + free(buffer); SetCursor(hCursor); CloseLogfile(); } @@ -2418,42 +2444,17 @@ /* this function may be called more than one time with the same script, only run it one time */ if (strcmp(lastscript, scriptname)) { - HINSTANCE hPython; char *argv[3] = {NULL, "-remove", NULL}; - char buffer[4096]; - FILE *fp; - char *tempname; - int n; + char *buffer = NULL; argv[0] = scriptname; - tempname = tempnam(NULL, NULL); + if (0 != run_installscript(scriptname, 2, argv, &buffer)) + fprintf(stderr, "*** Could not run installation script ***"); - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); - - hPython = LoadLibrary(dllname); - if (hPython) { - if (0x80000000 == run_installscript(hPython, scriptname, 2, argv)) - fprintf(stderr, "*** Could not load Python ***"); - FreeLibrary(hPython); - } - - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - if (buffer[0]) + if (buffer && buffer[0]) MessageBox(GetFocus(), buffer, "uninstall-script", MB_OK); + free(buffer); strcpy(lastscript, scriptname); } Modified: python/trunk/PCbuild/bdist_wininst.vcproj ============================================================================== --- python/trunk/PCbuild/bdist_wininst.vcproj (original) +++ python/trunk/PCbuild/bdist_wininst.vcproj Thu Jan 29 13:13:31 2009 @@ -55,7 +55,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" @@ -145,7 +145,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" From python-checkins at python.org Thu Jan 29 13:31:51 2009 From: python-checkins at python.org (mark.hammond) Date: Thu, 29 Jan 2009 13:31:51 +0100 (CET) Subject: [Python-checkins] r69095 - in python/branches/release26-maint: Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe PC/bdist_wininst/install.c PCbuild/bdist_wininst.vcproj Message-ID: <20090129123151.794D21E4002@bag.python.org> Author: mark.hammond Date: Thu Jan 29 13:31:51 2009 New Revision: 69095 Log: 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? ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/release26-maint/Lib/distutils/command/wininst-9.0.exe python/branches/release26-maint/PC/bdist_wininst/install.c python/branches/release26-maint/PCbuild/bdist_wininst.vcproj Modified: python/branches/release26-maint/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/release26-maint/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/release26-maint/PC/bdist_wininst/install.c ============================================================================== --- python/branches/release26-maint/PC/bdist_wininst/install.c (original) +++ python/branches/release26-maint/PC/bdist_wininst/install.c Thu Jan 29 13:31:51 2009 @@ -694,8 +694,9 @@ */ 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; DECLPROC(hPython, void, Py_Initialize, (void)); DECLPROC(hPython, int, PySys_SetArgv, (int, char **)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); @@ -706,9 +707,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,7 +728,7 @@ } SetDlgItemText(hDialog, IDC_INFO, "Running Script..."); - + Py_Initialize(); prepare_script_environment(hPython); @@ -751,7 +749,57 @@ Py_Finalize(); close(fh); + return result; +} +static int +run_installscript(char *pathname, int argc, char **argv, char **pOutput) +{ + HINSTANCE hPython; + int result = 1; + int out_buf_size; + HANDLE redirected, old_stderr, old_stdout; + char *tempname; + + *pOutput = NULL; + + tempname = tempnam(NULL, NULL); + // We use a static CRT while the Python version we load uses + // the CRT from one of various possibile DLLs. As a result we + // need to redirect the standard handles using the API rather + // than the CRT. + redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); + + hPython = LoadPythonDll(pythondll); + if (hPython) { + result = do_run_installscript(hPython, pathname, argc, argv); + FreeLibrary(hPython); + } else { + fprintf(stderr, "*** Could not load Python ***"); + } + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); + out_buf_size = min(GetFileSize(redirected, NULL), 4096); + *pOutput = malloc(out_buf_size+1); + if (*pOutput) { + DWORD nread = 0; + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, *pOutput, out_buf_size, &nread, NULL); + (*pOutput)[nread] = '\0'; + } + CloseHandle(redirected); + DeleteFile(tempname); return result; } @@ -781,11 +829,21 @@ static int run_simple_script(char *script) { int rc; - char *tempname; HINSTANCE hPython; - tempname = tempnam(NULL, NULL); - freopen(tempname, "a", stderr); - freopen(tempname, "a", stdout); + char *tempname = tempnam(NULL, NULL); + // Redirect output using win32 API - see comments above... + HANDLE redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + HANDLE old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + HANDLE old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); hPython = LoadPythonDll(pythondll); if (!hPython) { @@ -796,10 +854,8 @@ } rc = do_run_simple_script(hPython, script); FreeLibrary(hPython); - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); /* We only care about the output when we fail. If the script works OK, then we discard it */ @@ -808,24 +864,24 @@ char *err_buf; const char *prefix = "Running the pre-installation script failed\r\n"; int prefix_len = strlen(prefix); - FILE *fp = fopen(tempname, "rb"); - fseek(fp, 0, SEEK_END); - err_buf_size = ftell(fp); - fseek(fp, 0, SEEK_SET); + err_buf_size = GetFileSize(redirected, NULL); + if (err_buf_size==INVALID_FILE_SIZE) // an error - let's try anyway... + err_buf_size = 4096; err_buf = malloc(prefix_len + err_buf_size + 1); if (err_buf) { - int n; + DWORD n = 0; strcpy(err_buf, prefix); - n = fread(err_buf+prefix_len, 1, err_buf_size, fp); + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, err_buf+prefix_len, err_buf_size, &n, NULL); err_buf[prefix_len+n] = '\0'; - fclose(fp); set_failure_reason(err_buf); free(err_buf); } else { set_failure_reason("Out of memory!"); } } - remove(tempname); + CloseHandle(redirected); + DeleteFile(tempname); return rc; } @@ -1946,12 +2002,9 @@ if (success && install_script && install_script[0]) { char fname[MAX_PATH]; - char *tempname; - FILE *fp; - char buffer[4096]; - int n; + char *buffer; HCURSOR hCursor; - HINSTANCE hPython; + int result; char *argv[3] = {NULL, "-install", NULL}; @@ -1964,48 +2017,21 @@ if (logfile) fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); - tempname = tempnam(NULL, NULL); - - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); -/* - if (0 != setvbuf(stdout, NULL, _IONBF, 0)) - MessageBox(GetFocus(), "setvbuf stdout", NULL, MB_OK); -*/ hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); argv[0] = fname; - hPython = LoadPythonDll(pythondll); - if (hPython) { - int result; - result = run_installscript(hPython, fname, 2, argv); - if (-1 == result) { - fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); - } - FreeLibrary(hPython); - } else { - fprintf(stderr, "*** Could not load Python ***"); + result = run_installscript(fname, 2, argv, &buffer); + if (0 != result) { + fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); } - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - - SetDlgItemText(hwnd, IDC_INFO, buffer); + if (buffer) + SetDlgItemText(hwnd, IDC_INFO, buffer); SetDlgItemText(hwnd, IDC_TITLE, "Postinstall script finished.\n" "Click the Finish button to exit the Setup wizard."); + free(buffer); SetCursor(hCursor); CloseLogfile(); } @@ -2418,42 +2444,17 @@ /* this function may be called more than one time with the same script, only run it one time */ if (strcmp(lastscript, scriptname)) { - HINSTANCE hPython; char *argv[3] = {NULL, "-remove", NULL}; - char buffer[4096]; - FILE *fp; - char *tempname; - int n; + char *buffer = NULL; argv[0] = scriptname; - tempname = tempnam(NULL, NULL); + if (0 != run_installscript(scriptname, 2, argv, &buffer)) + fprintf(stderr, "*** Could not run installation script ***"); - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); - - hPython = LoadLibrary(dllname); - if (hPython) { - if (0x80000000 == run_installscript(hPython, scriptname, 2, argv)) - fprintf(stderr, "*** Could not load Python ***"); - FreeLibrary(hPython); - } - - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - if (buffer[0]) + if (buffer && buffer[0]) MessageBox(GetFocus(), buffer, "uninstall-script", MB_OK); + free(buffer); strcpy(lastscript, scriptname); } Modified: python/branches/release26-maint/PCbuild/bdist_wininst.vcproj ============================================================================== --- python/branches/release26-maint/PCbuild/bdist_wininst.vcproj (original) +++ python/branches/release26-maint/PCbuild/bdist_wininst.vcproj Thu Jan 29 13:31:51 2009 @@ -55,7 +55,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" @@ -145,7 +145,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" From python-checkins at python.org Thu Jan 29 13:36:50 2009 From: python-checkins at python.org (mark.hammond) Date: Thu, 29 Jan 2009 13:36:50 +0100 (CET) Subject: [Python-checkins] r69096 - in python/branches/py3k: Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe PC/bdist_wininst/install.c PCbuild/bdist_wininst.vcproj Message-ID: <20090129123650.F2AF81E4002@bag.python.org> Author: mark.hammond Date: Thu Jan 29 13:36:50 2009 New Revision: 69096 Log: 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? ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/py3k/Lib/distutils/command/wininst-9.0.exe python/branches/py3k/PC/bdist_wininst/install.c python/branches/py3k/PCbuild/bdist_wininst.vcproj Modified: python/branches/py3k/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/py3k/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/py3k/PC/bdist_wininst/install.c ============================================================================== --- python/branches/py3k/PC/bdist_wininst/install.c (original) +++ python/branches/py3k/PC/bdist_wininst/install.c Thu Jan 29 13:36:50 2009 @@ -694,8 +694,9 @@ */ 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; DECLPROC(hPython, void, Py_Initialize, (void)); DECLPROC(hPython, int, PySys_SetArgv, (int, char **)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); @@ -706,9 +707,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,7 +728,7 @@ } SetDlgItemText(hDialog, IDC_INFO, "Running Script..."); - + Py_Initialize(); prepare_script_environment(hPython); @@ -751,7 +749,57 @@ Py_Finalize(); close(fh); + return result; +} +static int +run_installscript(char *pathname, int argc, char **argv, char **pOutput) +{ + HINSTANCE hPython; + int result = 1; + int out_buf_size; + HANDLE redirected, old_stderr, old_stdout; + char *tempname; + + *pOutput = NULL; + + tempname = tempnam(NULL, NULL); + // We use a static CRT while the Python version we load uses + // the CRT from one of various possibile DLLs. As a result we + // need to redirect the standard handles using the API rather + // than the CRT. + redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); + + hPython = LoadPythonDll(pythondll); + if (hPython) { + result = do_run_installscript(hPython, pathname, argc, argv); + FreeLibrary(hPython); + } else { + fprintf(stderr, "*** Could not load Python ***"); + } + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); + out_buf_size = min(GetFileSize(redirected, NULL), 4096); + *pOutput = malloc(out_buf_size+1); + if (*pOutput) { + DWORD nread = 0; + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, *pOutput, out_buf_size, &nread, NULL); + (*pOutput)[nread] = '\0'; + } + CloseHandle(redirected); + DeleteFile(tempname); return result; } @@ -781,11 +829,21 @@ static int run_simple_script(char *script) { int rc; - char *tempname; HINSTANCE hPython; - tempname = tempnam(NULL, NULL); - freopen(tempname, "a", stderr); - freopen(tempname, "a", stdout); + char *tempname = tempnam(NULL, NULL); + // Redirect output using win32 API - see comments above... + HANDLE redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + HANDLE old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + HANDLE old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); hPython = LoadPythonDll(pythondll); if (!hPython) { @@ -796,10 +854,8 @@ } rc = do_run_simple_script(hPython, script); FreeLibrary(hPython); - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); /* We only care about the output when we fail. If the script works OK, then we discard it */ @@ -808,24 +864,24 @@ char *err_buf; const char *prefix = "Running the pre-installation script failed\r\n"; int prefix_len = strlen(prefix); - FILE *fp = fopen(tempname, "rb"); - fseek(fp, 0, SEEK_END); - err_buf_size = ftell(fp); - fseek(fp, 0, SEEK_SET); + err_buf_size = GetFileSize(redirected, NULL); + if (err_buf_size==INVALID_FILE_SIZE) // an error - let's try anyway... + err_buf_size = 4096; err_buf = malloc(prefix_len + err_buf_size + 1); if (err_buf) { - int n; + DWORD n = 0; strcpy(err_buf, prefix); - n = fread(err_buf+prefix_len, 1, err_buf_size, fp); + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, err_buf+prefix_len, err_buf_size, &n, NULL); err_buf[prefix_len+n] = '\0'; - fclose(fp); set_failure_reason(err_buf); free(err_buf); } else { set_failure_reason("Out of memory!"); } } - remove(tempname); + CloseHandle(redirected); + DeleteFile(tempname); return rc; } @@ -1946,12 +2002,9 @@ if (success && install_script && install_script[0]) { char fname[MAX_PATH]; - char *tempname; - FILE *fp; - char buffer[4096]; - int n; + char *buffer; HCURSOR hCursor; - HINSTANCE hPython; + int result; char *argv[3] = {NULL, "-install", NULL}; @@ -1964,48 +2017,21 @@ if (logfile) fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); - tempname = tempnam(NULL, NULL); - - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); -/* - if (0 != setvbuf(stdout, NULL, _IONBF, 0)) - MessageBox(GetFocus(), "setvbuf stdout", NULL, MB_OK); -*/ hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); argv[0] = fname; - hPython = LoadPythonDll(pythondll); - if (hPython) { - int result; - result = run_installscript(hPython, fname, 2, argv); - if (-1 == result) { - fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); - } - FreeLibrary(hPython); - } else { - fprintf(stderr, "*** Could not load Python ***"); + result = run_installscript(fname, 2, argv, &buffer); + if (0 != result) { + fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); } - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - - SetDlgItemText(hwnd, IDC_INFO, buffer); + if (buffer) + SetDlgItemText(hwnd, IDC_INFO, buffer); SetDlgItemText(hwnd, IDC_TITLE, "Postinstall script finished.\n" "Click the Finish button to exit the Setup wizard."); + free(buffer); SetCursor(hCursor); CloseLogfile(); } @@ -2418,42 +2444,17 @@ /* this function may be called more than one time with the same script, only run it one time */ if (strcmp(lastscript, scriptname)) { - HINSTANCE hPython; char *argv[3] = {NULL, "-remove", NULL}; - char buffer[4096]; - FILE *fp; - char *tempname; - int n; + char *buffer = NULL; argv[0] = scriptname; - tempname = tempnam(NULL, NULL); + if (0 != run_installscript(scriptname, 2, argv, &buffer)) + fprintf(stderr, "*** Could not run installation script ***"); - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); - - hPython = LoadLibrary(dllname); - if (hPython) { - if (0x80000000 == run_installscript(hPython, scriptname, 2, argv)) - fprintf(stderr, "*** Could not load Python ***"); - FreeLibrary(hPython); - } - - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - if (buffer[0]) + if (buffer && buffer[0]) MessageBox(GetFocus(), buffer, "uninstall-script", MB_OK); + free(buffer); strcpy(lastscript, scriptname); } Modified: python/branches/py3k/PCbuild/bdist_wininst.vcproj ============================================================================== --- python/branches/py3k/PCbuild/bdist_wininst.vcproj (original) +++ python/branches/py3k/PCbuild/bdist_wininst.vcproj Thu Jan 29 13:36:50 2009 @@ -55,7 +55,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" @@ -145,7 +145,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" From python-checkins at python.org Thu Jan 29 13:41:43 2009 From: python-checkins at python.org (mark.hammond) Date: Thu, 29 Jan 2009 13:41:43 +0100 (CET) Subject: [Python-checkins] r69097 - in python/branches/release30-maint: Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe PC/bdist_wininst/install.c PCbuild/bdist_wininst.vcproj Message-ID: <20090129124143.087E71E4002@bag.python.org> Author: mark.hammond Date: Thu Jan 29 13:41:42 2009 New Revision: 69097 Log: Merged revisions 69096 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69096 | mark.hammond | 2009-01-29 23:36:50 +1100 (Thu, 29 Jan 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? ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/release30-maint/Lib/distutils/command/wininst-9.0.exe python/branches/release30-maint/PC/bdist_wininst/install.c python/branches/release30-maint/PCbuild/bdist_wininst.vcproj Modified: python/branches/release30-maint/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/release30-maint/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/release30-maint/PC/bdist_wininst/install.c ============================================================================== --- python/branches/release30-maint/PC/bdist_wininst/install.c (original) +++ python/branches/release30-maint/PC/bdist_wininst/install.c Thu Jan 29 13:41:42 2009 @@ -694,8 +694,9 @@ */ 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; DECLPROC(hPython, void, Py_Initialize, (void)); DECLPROC(hPython, int, PySys_SetArgv, (int, char **)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); @@ -706,9 +707,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,7 +728,7 @@ } SetDlgItemText(hDialog, IDC_INFO, "Running Script..."); - + Py_Initialize(); prepare_script_environment(hPython); @@ -751,7 +749,57 @@ Py_Finalize(); close(fh); + return result; +} +static int +run_installscript(char *pathname, int argc, char **argv, char **pOutput) +{ + HINSTANCE hPython; + int result = 1; + int out_buf_size; + HANDLE redirected, old_stderr, old_stdout; + char *tempname; + + *pOutput = NULL; + + tempname = tempnam(NULL, NULL); + // We use a static CRT while the Python version we load uses + // the CRT from one of various possibile DLLs. As a result we + // need to redirect the standard handles using the API rather + // than the CRT. + redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); + + hPython = LoadPythonDll(pythondll); + if (hPython) { + result = do_run_installscript(hPython, pathname, argc, argv); + FreeLibrary(hPython); + } else { + fprintf(stderr, "*** Could not load Python ***"); + } + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); + out_buf_size = min(GetFileSize(redirected, NULL), 4096); + *pOutput = malloc(out_buf_size+1); + if (*pOutput) { + DWORD nread = 0; + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, *pOutput, out_buf_size, &nread, NULL); + (*pOutput)[nread] = '\0'; + } + CloseHandle(redirected); + DeleteFile(tempname); return result; } @@ -781,11 +829,21 @@ static int run_simple_script(char *script) { int rc; - char *tempname; HINSTANCE hPython; - tempname = tempnam(NULL, NULL); - freopen(tempname, "a", stderr); - freopen(tempname, "a", stdout); + char *tempname = tempnam(NULL, NULL); + // Redirect output using win32 API - see comments above... + HANDLE redirected = CreateFile( + tempname, + GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_READ, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, + NULL); + HANDLE old_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + HANDLE old_stderr = GetStdHandle(STD_ERROR_HANDLE); + SetStdHandle(STD_OUTPUT_HANDLE, redirected); + SetStdHandle(STD_ERROR_HANDLE, redirected); hPython = LoadPythonDll(pythondll); if (!hPython) { @@ -796,10 +854,8 @@ } rc = do_run_simple_script(hPython, script); FreeLibrary(hPython); - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); + SetStdHandle(STD_OUTPUT_HANDLE, old_stdout); + SetStdHandle(STD_ERROR_HANDLE, old_stderr); /* We only care about the output when we fail. If the script works OK, then we discard it */ @@ -808,24 +864,24 @@ char *err_buf; const char *prefix = "Running the pre-installation script failed\r\n"; int prefix_len = strlen(prefix); - FILE *fp = fopen(tempname, "rb"); - fseek(fp, 0, SEEK_END); - err_buf_size = ftell(fp); - fseek(fp, 0, SEEK_SET); + err_buf_size = GetFileSize(redirected, NULL); + if (err_buf_size==INVALID_FILE_SIZE) // an error - let's try anyway... + err_buf_size = 4096; err_buf = malloc(prefix_len + err_buf_size + 1); if (err_buf) { - int n; + DWORD n = 0; strcpy(err_buf, prefix); - n = fread(err_buf+prefix_len, 1, err_buf_size, fp); + SetFilePointer(redirected, 0, 0, FILE_BEGIN); + ReadFile(redirected, err_buf+prefix_len, err_buf_size, &n, NULL); err_buf[prefix_len+n] = '\0'; - fclose(fp); set_failure_reason(err_buf); free(err_buf); } else { set_failure_reason("Out of memory!"); } } - remove(tempname); + CloseHandle(redirected); + DeleteFile(tempname); return rc; } @@ -1946,12 +2002,9 @@ if (success && install_script && install_script[0]) { char fname[MAX_PATH]; - char *tempname; - FILE *fp; - char buffer[4096]; - int n; + char *buffer; HCURSOR hCursor; - HINSTANCE hPython; + int result; char *argv[3] = {NULL, "-install", NULL}; @@ -1964,48 +2017,21 @@ if (logfile) fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); - tempname = tempnam(NULL, NULL); - - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); -/* - if (0 != setvbuf(stdout, NULL, _IONBF, 0)) - MessageBox(GetFocus(), "setvbuf stdout", NULL, MB_OK); -*/ hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); argv[0] = fname; - hPython = LoadPythonDll(pythondll); - if (hPython) { - int result; - result = run_installscript(hPython, fname, 2, argv); - if (-1 == result) { - fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); - } - FreeLibrary(hPython); - } else { - fprintf(stderr, "*** Could not load Python ***"); + result = run_installscript(fname, 2, argv, &buffer); + if (0 != result) { + fprintf(stderr, "*** run_installscript: internal error 0x%X ***\n", result); } - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - - SetDlgItemText(hwnd, IDC_INFO, buffer); + if (buffer) + SetDlgItemText(hwnd, IDC_INFO, buffer); SetDlgItemText(hwnd, IDC_TITLE, "Postinstall script finished.\n" "Click the Finish button to exit the Setup wizard."); + free(buffer); SetCursor(hCursor); CloseLogfile(); } @@ -2418,42 +2444,17 @@ /* this function may be called more than one time with the same script, only run it one time */ if (strcmp(lastscript, scriptname)) { - HINSTANCE hPython; char *argv[3] = {NULL, "-remove", NULL}; - char buffer[4096]; - FILE *fp; - char *tempname; - int n; + char *buffer = NULL; argv[0] = scriptname; - tempname = tempnam(NULL, NULL); + if (0 != run_installscript(scriptname, 2, argv, &buffer)) + fprintf(stderr, "*** Could not run installation script ***"); - if (!freopen(tempname, "a", stderr)) - MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); - if (!freopen(tempname, "a", stdout)) - MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); - - hPython = LoadLibrary(dllname); - if (hPython) { - if (0x80000000 == run_installscript(hPython, scriptname, 2, argv)) - fprintf(stderr, "*** Could not load Python ***"); - FreeLibrary(hPython); - } - - fflush(stderr); - fclose(stderr); - fflush(stdout); - fclose(stdout); - - fp = fopen(tempname, "rb"); - n = fread(buffer, 1, sizeof(buffer), fp); - fclose(fp); - remove(tempname); - - buffer[n] = '\0'; - if (buffer[0]) + if (buffer && buffer[0]) MessageBox(GetFocus(), buffer, "uninstall-script", MB_OK); + free(buffer); strcpy(lastscript, scriptname); } Modified: python/branches/release30-maint/PCbuild/bdist_wininst.vcproj ============================================================================== --- python/branches/release30-maint/PCbuild/bdist_wininst.vcproj (original) +++ python/branches/release30-maint/PCbuild/bdist_wininst.vcproj Thu Jan 29 13:41:42 2009 @@ -55,7 +55,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" @@ -145,7 +145,7 @@ AdditionalIncludeDirectories="..\PC\bdist_wininst;..\Include;..\Modules\zlib" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" StringPooling="true" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" From python-checkins at python.org Thu Jan 29 14:08:02 2009 From: python-checkins at python.org (mark.hammond) Date: Thu, 29 Jan 2009 14:08:02 +0100 (CET) Subject: [Python-checkins] r69098 - in python/branches/py3k: Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe PC/bdist_wininst/install.c Message-ID: <20090129130802.11DF61E4015@bag.python.org> Author: mark.hammond Date: Thu Jan 29 14:08:01 2009 New Revision: 69098 Log: Fix issue5076: bdist_wininst fails on py3k Modified: python/branches/py3k/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/py3k/Lib/distutils/command/wininst-9.0.exe python/branches/py3k/PC/bdist_wininst/install.c Modified: python/branches/py3k/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/py3k/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/py3k/PC/bdist_wininst/install.c ============================================================================== --- python/branches/py3k/PC/bdist_wininst/install.c (original) +++ python/branches/py3k/PC/bdist_wininst/install.c Thu Jan 29 14:08:01 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); @@ -696,9 +718,10 @@ static int do_run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv) { - int fh, result; + 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 *, ...)); @@ -732,7 +755,16 @@ 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 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/79 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.hammond 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 python-checkins at python.org Thu Jan 29 14:12:11 2009 From: python-checkins at python.org (mark.hammond) Date: Thu, 29 Jan 2009 14:12:11 +0100 (CET) Subject: [Python-checkins] r69099 - in python/branches/release30-maint: Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe PC/bdist_wininst/install.c Message-ID: <20090129131211.28E551E4002@bag.python.org> Author: mark.hammond Date: Thu Jan 29 14:12:10 2009 New Revision: 69099 Log: Merged revisions 69098 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69098 | mark.hammond | 2009-01-30 00:08:01 +1100 (Fri, 30 Jan 2009) | 2 lines Fix issue5076: bdist_wininst fails on py3k ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/release30-maint/Lib/distutils/command/wininst-9.0.exe python/branches/release30-maint/PC/bdist_wininst/install.c Modified: python/branches/release30-maint/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/release30-maint/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/release30-maint/PC/bdist_wininst/install.c ============================================================================== --- python/branches/release30-maint/PC/bdist_wininst/install.c (original) +++ python/branches/release30-maint/PC/bdist_wininst/install.c Thu Jan 29 14:12:10 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); @@ -696,9 +718,10 @@ static int do_run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv) { - int fh, result; + 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 *, ...)); @@ -732,7 +755,16 @@ 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 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/238 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.hammond BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_threading_local make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 29 14:36:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 13:36:51 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090129133651.55A201E4002@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/78 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.hammond BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Jan 29 14:42:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 13:42:53 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090129134253.C35D71E4002@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/139 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.hammond BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From benjamin at python.org Thu Jan 29 17:04:06 2009 From: benjamin at python.org (Benjamin Peterson) Date: Thu, 29 Jan 2009 10:04:06 -0600 Subject: [Python-checkins] r69093 - in python/branches/release30-maint/Doc: library/datetime.rst reference/datamodel.rst In-Reply-To: <20090129043706.5614B1E4002@bag.python.org> References: <20090129043706.5614B1E4002@bag.python.org> Message-ID: <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> On Wed, Jan 28, 2009 at 10:37 PM, brett. cannon wrote: > Author: brett.cannon > Date: Thu Jan 29 05:37:06 2009 > New Revision: 69093 > > Log: > Backport r69092 by hand since svnmerge keeps saying there is a conflict on '.'. Just do "svn resolved ." -- Regards, Benjamin From buildbot at python.org Thu Jan 29 17:06:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 16:06:03 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090129160603.A28971E4002@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/200 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.hammond 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 Jan 29 17:55:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 16:55:51 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090129165552.1C8071E4002@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/106 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.hammond 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 brett at python.org Thu Jan 29 19:27:43 2009 From: brett at python.org (Brett Cannon) Date: Thu, 29 Jan 2009 10:27:43 -0800 Subject: [Python-checkins] r69093 - in python/branches/release30-maint/Doc: library/datetime.rst reference/datamodel.rst In-Reply-To: <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> Message-ID: On Thu, Jan 29, 2009 at 08:04, Benjamin Peterson wrote: > On Wed, Jan 28, 2009 at 10:37 PM, brett. cannon > wrote: >> Author: brett.cannon >> Date: Thu Jan 29 05:37:06 2009 >> New Revision: 69093 >> >> Log: >> Backport r69092 by hand since svnmerge keeps saying there is a conflict on '.'. > > Just do "svn resolved ." I was too tired after pushing the change to two other branches think about that. =) -Brett From python-checkins at python.org Thu Jan 29 21:19:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 29 Jan 2009 21:19:34 +0100 (CET) Subject: [Python-checkins] r69100 - in python/trunk: Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS Message-ID: <20090129201934.8DA761E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 29 21:19:34 2009 New Revision: 69100 Log: 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/trunk/Lib/shutil.py python/trunk/Lib/test/test_shutil.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/shutil.py ============================================================================== --- python/trunk/Lib/shutil.py (original) +++ python/trunk/Lib/shutil.py Thu Jan 29 21:19:34 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/trunk/Lib/test/test_shutil.py ============================================================================== --- python/trunk/Lib/test/test_shutil.py (original) +++ python/trunk/Lib/test/test_shutil.py Thu Jan 29 21:19:34 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(): test_support.run_unittest(TestShutil, TestMove) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Jan 29 21:19:34 2009 @@ -145,6 +145,10 @@ Library ------- +- 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"). + - Issue 4920: Fixed .next() vs .__next__() issues in the ABCs for Iterator and MutableSet. From python-checkins at python.org Thu Jan 29 21:26:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 29 Jan 2009 21:26:59 +0100 (CET) Subject: [Python-checkins] r69101 - in python/branches/py3k: Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS Message-ID: <20090129202659.946571E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 29 21:26:59 2009 New Revision: 69101 Log: 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"). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/shutil.py python/branches/py3k/Lib/test/test_shutil.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/shutil.py ============================================================================== --- python/branches/py3k/Lib/shutil.py (original) +++ python/branches/py3k/Lib/shutil.py Thu Jan 29 21:26:59 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/py3k/Lib/test/test_shutil.py ============================================================================== --- python/branches/py3k/Lib/test/test_shutil.py (original) +++ python/branches/py3k/Lib/test/test_shutil.py Thu Jan 29 21:26:59 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/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Jan 29 21:26:59 2009 @@ -147,6 +147,10 @@ Library ------- +- 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 From python-checkins at python.org Thu Jan 29 21:30:51 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 29 Jan 2009 21:30:51 +0100 (CET) Subject: [Python-checkins] r69102 - in python/branches/release26-maint: Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS Message-ID: <20090129203051.CC8A11E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 29 21:30:51 2009 New Revision: 69102 Log: 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"). ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/shutil.py python/branches/release26-maint/Lib/test/test_shutil.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/shutil.py ============================================================================== --- python/branches/release26-maint/Lib/shutil.py (original) +++ python/branches/release26-maint/Lib/shutil.py Thu Jan 29 21:30:51 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/release26-maint/Lib/test/test_shutil.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_shutil.py (original) +++ python/branches/release26-maint/Lib/test/test_shutil.py Thu Jan 29 21:30:51 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(): test_support.run_unittest(TestShutil, TestMove) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Jan 29 21:30:51 2009 @@ -76,6 +76,10 @@ Library ------- +- 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"). + - Issue 4920: Fixed .next() vs .__next__() issues in the ABCs for Iterator and MutableSet. From python-checkins at python.org Thu Jan 29 21:38:03 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 29 Jan 2009 21:38:03 +0100 (CET) Subject: [Python-checkins] r69103 - in python/branches/release30-maint: Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS Message-ID: <20090129203803.A343C1E4002@bag.python.org> Author: antoine.pitrou Date: Thu Jan 29 21:38:03 2009 New Revision: 69103 Log: Merged revisions 69101 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/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"). ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/shutil.py python/branches/release30-maint/Lib/test/test_shutil.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/shutil.py ============================================================================== --- python/branches/release30-maint/Lib/shutil.py (original) +++ python/branches/release30-maint/Lib/shutil.py Thu Jan 29 21:38:03 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/release30-maint/Lib/test/test_shutil.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_shutil.py (original) +++ python/branches/release30-maint/Lib/test/test_shutil.py Thu Jan 29 21:38:03 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/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Jan 29 21:38:03 2009 @@ -103,6 +103,10 @@ Library ------- +- 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"). + - Removed isSequenceType(), isMappingType, and isNumberType() from the operator module; use the abstract base classes instead. Also removed the repeat() function; use mul() instead. From buildbot at python.org Thu Jan 29 21:49:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 20:49:06 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090129204906.9B2E41E4031@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/68 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.hammond 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: antoine.pitrou Date: Thu Jan 29 22:23:42 2009 New Revision: 69104 Log: Fix some crashers found by Victor Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/io.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 Thu Jan 29 22:23:42 2009 @@ -1905,16 +1905,32 @@ b"" if "b" in kwargs['mode'] else "") self.assertRaises(ValueError, f.writelines, []) + 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.assertEqual(b.characters_written, 0) + class C(str): + pass + c = C("") + b = io.BlockingIOError(1, c) + c.b = b + b.c = c + wr = weakref.ref(c) + del c, b + gc.collect() + self.assert_(wr() is None, wr) def test_main(): - support.run_unittest( - IOTest, BytesIOTest, StringIOTest, - BufferedReaderTest, BufferedWriterTest, - BufferedRWPairTest, BufferedRandomTest, - StatefulIncrementalDecoderTest, - TextIOWrapperTest, MiscIOTest - ) + support.run_unittest(IOTest, BytesIOTest, StringIOTest, + BufferedReaderTest, BufferedWriterTest, + BufferedRWPairTest, BufferedRandomTest, + StatefulIncrementalDecoderTest, + TextIOWrapperTest, MiscIOTest + ) if __name__ == "__main__": test_main() - #unittest.main() Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Thu Jan 29 22:23:42 2009 @@ -92,41 +92,29 @@ BlockingIOError_init(PyBlockingIOErrorObject *self, PyObject *args, PyObject *kwds) { - PyObject *myerrno = NULL, *strerror = NULL, *written; + PyObject *myerrno = NULL, *strerror = NULL; PyObject *baseargs = NULL; + Py_ssize_t written = 0; assert(PyTuple_Check(args)); - if (PyTuple_GET_SIZE(args) <= 1 || PyTuple_GET_SIZE(args) > 3) - return 0; + self->written = 0; + if (!PyArg_ParseTuple(args, "OO|n:BlockingIOError", + &myerrno, &strerror, &written)) + return -1; - baseargs = PyTuple_GetSlice(args, 0, 2); + baseargs = PyTuple_Pack(2, myerrno, strerror); if (baseargs == NULL) return -1; - + /* This will take care of initializing of myerrno and strerror members */ if (((PyTypeObject *)PyExc_IOError)->tp_init( (PyObject *)self, baseargs, kwds) == -1) { Py_DECREF(baseargs); return -1; } - Py_DECREF(baseargs); - if (!PyArg_UnpackTuple(args, "BlockingIOError", 2, 3, - &myerrno, &strerror, &written)) { - return -1; - } - - Py_INCREF(myerrno); - self->myerrno = myerrno; - - Py_INCREF(strerror); - self->strerror = strerror; - - self->written = PyNumber_AsSsize_t(written, PyExc_ValueError); - if(self->written == -1 && PyErr_Occurred()) - return -1; - + self->written = written; return 0; } @@ -135,7 +123,6 @@ {NULL} /* Sentinel */ }; - static PyTypeObject _PyExc_BlockingIOError = { PyVarObject_HEAD_INIT(NULL, 0) "BlockingIOError", /*tp_name*/ @@ -156,8 +143,9 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - PyDoc_STR("Exception raised when I/O would block on a non-blocking I/O stream"), /* tp_doc */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + PyDoc_STR("Exception raised when I/O would block " + "on a non-blocking I/O stream"), /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ From ncoghlan at gmail.com Thu Jan 29 23:12:14 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Fri, 30 Jan 2009 08:12:14 +1000 Subject: [Python-checkins] Merging to the 3.0 maintenance branch In-Reply-To: <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> Message-ID: <498229BE.4060408@gmail.com> Benjamin Peterson wrote: > On Wed, Jan 28, 2009 at 10:37 PM, brett. cannon > wrote: >> Author: brett.cannon >> Date: Thu Jan 29 05:37:06 2009 >> New Revision: 69093 >> >> Log: >> Backport r69092 by hand since svnmerge keeps saying there is a conflict on '.'. > > Just do "svn resolved ." There are potential problems with doing it that way [1]. The safer option is to do: svn revert . svnmerge merge -M -F Perhaps we should add a "maintmerge" script (along with "maintmerge.bat" batch file) to the root development directory that automates this: #/bin/sh svnmerge merge -r $1 svn revert . svnmerge -M -F $1 (Note that my shell scripting is a little rusty and I haven't actually executed that example...) Then the advice will just be to use svnmerge directly most of the time, and maintmerge when merging a revision that was itself created with svnmerge. Cheers, Nick. [1] How to clobber svnmerge's revision tracking 101: http://mail.python.org/pipermail/python-dev/2008-December/084644.html -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From buildbot at python.org Thu Jan 29 23:18:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 29 Jan 2009 22:18:17 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090129221817.6E7891E4002@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/89 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: 3 tests failed: test_calendar test_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Jan 29 23:26:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 29 Jan 2009 23:26:22 +0100 (CET) Subject: [Python-checkins] r69105 - python/branches/py3k/Doc/library/shelve.rst Message-ID: <20090129222622.D464C1E4030@bag.python.org> Author: raymond.hettinger Date: Thu Jan 29 23:26:20 2009 New Revision: 69105 Log: Fix error in docs. The source says proto 2 is the default. Modified: python/branches/py3k/Doc/library/shelve.rst Modified: python/branches/py3k/Doc/library/shelve.rst ============================================================================== --- python/branches/py3k/Doc/library/shelve.rst (original) +++ python/branches/py3k/Doc/library/shelve.rst Thu Jan 29 23:26:20 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 2 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 From python-checkins at python.org Fri Jan 30 00:49:18 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 30 Jan 2009 00:49:18 +0100 (CET) Subject: [Python-checkins] r69106 - python/trunk/Lib/distutils/tests/test_sdist.py Message-ID: <20090129234918.05A0A1E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 30 00:49:17 2009 New Revision: 69106 Log: fixed test_make_distribution so it runs on any platform, as long as tar an gzip are available 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 Fri Jan 30 00:49:17 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() From python-checkins at python.org Fri Jan 30 00:51:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 30 Jan 2009 00:51:54 +0100 (CET) Subject: [Python-checkins] r69107 - in python/branches/release26-maint: Lib/distutils/tests/test_sdist.py Message-ID: <20090129235154.1A7411E4054@bag.python.org> Author: tarek.ziade Date: Fri Jan 30 00:51:53 2009 New Revision: 69107 Log: 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 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_sdist.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_sdist.py Fri Jan 30 00:51:53 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() From python-checkins at python.org Fri Jan 30 00:54:06 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 30 Jan 2009 00:54:06 +0100 (CET) Subject: [Python-checkins] r69108 - in python/branches/py3k: Lib/distutils/tests/test_sdist.py Message-ID: <20090129235406.8270B1E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 30 00:54:06 2009 New Revision: 69108 Log: 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 ........ 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 Fri Jan 30 00:54:06 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() From python-checkins at python.org Fri Jan 30 00:56:08 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 30 Jan 2009 00:56:08 +0100 (CET) Subject: [Python-checkins] r69109 - in python/branches/release30-maint: Lib/distutils/tests/test_sdist.py Message-ID: <20090129235608.CB76C1E4002@bag.python.org> Author: tarek.ziade Date: Fri Jan 30 00:56:08 2009 New Revision: 69109 Log: Merged revisions 69108 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69108 | tarek.ziade | 2009-01-30 00:54:06 +0100 (Fri, 30 Jan 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 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/tests/test_sdist.py Modified: python/branches/release30-maint/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_sdist.py Fri Jan 30 00:56:08 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() From python-checkins at python.org Fri Jan 30 01:22:35 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 30 Jan 2009 01:22:35 +0100 (CET) Subject: [Python-checkins] r69110 - in python/branches/py3k/Lib/importlib/test: abc.py builtin/test_finder.py extension/test_finder.py finder_tests.py frozen/test_finder.py loader_tests.py source/test_finder.py Message-ID: <20090130002235.7FE111E4002@bag.python.org> Author: brett.cannon Date: Fri Jan 30 01:22:35 2009 New Revision: 69110 Log: Merge testing ABCs for importlib into importlib.test.abc. Added: python/branches/py3k/Lib/importlib/test/abc.py Removed: python/branches/py3k/Lib/importlib/test/finder_tests.py python/branches/py3k/Lib/importlib/test/loader_tests.py Modified: python/branches/py3k/Lib/importlib/test/builtin/test_finder.py python/branches/py3k/Lib/importlib/test/extension/test_finder.py python/branches/py3k/Lib/importlib/test/frozen/test_finder.py python/branches/py3k/Lib/importlib/test/source/test_finder.py Added: python/branches/py3k/Lib/importlib/test/abc.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/abc.py Fri Jan 30 01:22:35 2009 @@ -0,0 +1,98 @@ +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 + + +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/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 Fri Jan 30 01:22:35 2009 @@ -1,11 +1,11 @@ from importlib import machinery -from .. import finder_tests +from .. import abc from .. import support import sys import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test find_module() for built-in modules.""" 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 Fri Jan 30 01:22:35 2009 @@ -1,10 +1,10 @@ import importlib -from .. import finder_tests +from .. import abc from . import test_path_hook import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" Deleted: python/branches/py3k/Lib/importlib/test/finder_tests.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/finder_tests.py Fri Jan 30 01:22:35 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 Modified: python/branches/py3k/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/frozen/test_finder.py Fri Jan 30 01:22:35 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.""" Deleted: python/branches/py3k/Lib/importlib/test/loader_tests.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/loader_tests.py Fri Jan 30 01:22:35 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/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 Fri Jan 30 01:22:35 2009 @@ -1,5 +1,5 @@ import importlib -from .. import finder_tests +from .. import abc from .. import support import os import py_compile @@ -7,7 +7,7 @@ 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 From buildbot at python.org Fri Jan 30 01:57:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 00:57:47 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090130005747.7570D1E4002@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/785 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 buildbot at python.org Fri Jan 30 01:57:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 00:57:56 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090130005756.2819D1E4002@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/81 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 Jan 30 01:59:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 00:59:11 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090130005911.DEB551E4040@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/81 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Fri Jan 30 01:59:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 00:59:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090130005918.3D8641E4017@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/142 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 Jan 30 02:31:34 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 30 Jan 2009 02:31:34 +0100 (CET) Subject: [Python-checkins] r69111 - in python/branches/py3k: Lib/trace.py Misc/NEWS Message-ID: <20090130013134.7C3F91E4002@bag.python.org> Author: brett.cannon Date: Fri Jan 30 02:31:34 2009 New Revision: 69111 Log: The trace module was trying to turn ints into ints since co_lnotab was changed to a bytes object. Modified: python/branches/py3k/Lib/trace.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/trace.py ============================================================================== --- python/branches/py3k/Lib/trace.py (original) +++ python/branches/py3k/Lib/trace.py Fri Jan 30 02:31:34 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/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Jan 30 02:31:34 2009 @@ -147,6 +147,9 @@ Library ------- +- 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"). From python-checkins at python.org Fri Jan 30 03:02:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 03:02:25 +0100 (CET) Subject: [Python-checkins] r69112 - python/trunk/Lib/colorsys.py Message-ID: <20090130020225.4EF961E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 03:02:25 2009 New Revision: 69112 Log: pep8tify conditionals Modified: python/trunk/Lib/colorsys.py Modified: python/trunk/Lib/colorsys.py ============================================================================== --- python/trunk/Lib/colorsys.py (original) +++ python/trunk/Lib/colorsys.py Fri Jan 30 03:02:25 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 From buildbot at python.org Fri Jan 30 03:15:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 02:15:47 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090130021548.1723F1E4002@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/202 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: 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 python-checkins at python.org Fri Jan 30 03:24:40 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 03:24:40 +0100 (CET) Subject: [Python-checkins] r69113 - in python/trunk: Lib/test/test_tcl.py Modules/_tkinter.c Message-ID: <20090130022440.0EE9D1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 03:24:39 2009 New Revision: 69113 Log: make _tkinter._flatten check the result of PySequence_Size for errors #3880 Modified: python/trunk/Lib/test/test_tcl.py python/trunk/Modules/_tkinter.c Modified: python/trunk/Lib/test/test_tcl.py ============================================================================== --- python/trunk/Lib/test/test_tcl.py (original) +++ python/trunk/Lib/test/test_tcl.py Fri Jan 30 03:24:39 2009 @@ -2,10 +2,19 @@ import unittest import os +import _tkinter from test import test_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(): - test_support.run_unittest(TclTest) + test_support.run_unittest(TclTest, TkinterTest) if __name__ == "__main__": test_main() Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Fri Jan 30 03:24:39 2009 @@ -2908,7 +2908,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); From martin at v.loewis.de Fri Jan 30 03:27:03 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Fri, 30 Jan 2009 03:27:03 +0100 Subject: [Python-checkins] Merging to the 3.0 maintenance branch In-Reply-To: <498229BE.4060408@gmail.com> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> Message-ID: <49826577.4030808@v.loewis.de> > There are potential problems with doing it that way [1]. The safer > option is to do: > > svn revert . > svnmerge merge -M -F I still don't see the potential problem. If you do svnmerge, svn commit, all is fine, right? The problem *only* arises if you do svnmerge, svn up, svn commit - and clearly, you shouldn't do that. If, on commit, you get a conflict, you should revert all your changes, svn up, and start all over with the merge. Regards, Martin From python-checkins at python.org Fri Jan 30 03:29:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 03:29:43 +0100 (CET) Subject: [Python-checkins] r69114 - python/branches/py3k/Doc/library/queue.rst Message-ID: <20090130022943.F398E1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 03:29:43 2009 New Revision: 69114 Log: fix a case of set_daemon #5087 Modified: python/branches/py3k/Doc/library/queue.rst Modified: python/branches/py3k/Doc/library/queue.rst ============================================================================== --- python/branches/py3k/Doc/library/queue.rst (original) +++ python/branches/py3k/Doc/library/queue.rst Fri Jan 30 03:29:43 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(): From buildbot at python.org Fri Jan 30 03:36:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 02:36:23 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090130023623.86A071E4002@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/242 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 python-checkins at python.org Fri Jan 30 03:36:28 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 30 Jan 2009 03:36:28 +0100 (CET) Subject: [Python-checkins] r69115 - python/branches/io-c/PC/VC6/pythoncore.dsp Message-ID: <20090130023628.75B3A1E402B@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 30 03:36:28 2009 New Revision: 69115 Log: Updated VC6 project file. Modified: python/branches/io-c/PC/VC6/pythoncore.dsp Modified: python/branches/io-c/PC/VC6/pythoncore.dsp ============================================================================== --- python/branches/io-c/PC/VC6/pythoncore.dsp (original) +++ python/branches/io-c/PC/VC6/pythoncore.dsp Fri Jan 30 03:36:28 2009 @@ -97,6 +97,10 @@ # End Source File # Begin Source File +SOURCE=..\..\Modules\_bufferedio.c +# End Source File +# Begin Source File + SOURCE=..\..\Modules\_bytesio.c # End Source File # Begin Source File @@ -149,6 +153,10 @@ # End Source File # Begin Source File +SOURCE=..\..\Modules\_iobase.c +# End Source File +# Begin Source File + SOURCE=..\..\Modules\_json.c # End Source File # Begin Source File @@ -185,6 +193,10 @@ # End Source File # Begin Source File +SOURCE=..\..\Modules\_textio.c +# End Source File +# Begin Source File + SOURCE=..\..\Modules\_threadmodule.c # End Source File # Begin Source File @@ -463,6 +475,10 @@ # End Source File # Begin Source File +SOURCE=..\..\Modules\io.c +# End Source File +# Begin Source File + SOURCE=..\..\Objects\iterobject.c # End Source File # Begin Source File From brett at python.org Fri Jan 30 03:52:00 2009 From: brett at python.org (Brett Cannon) Date: Thu, 29 Jan 2009 18:52:00 -0800 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: <49826577.4030808@v.loewis.de> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> Message-ID: On Thu, Jan 29, 2009 at 18:27, "Martin v. L?wis" wrote: >> There are potential problems with doing it that way [1]. The safer >> option is to do: >> >> svn revert . >> svnmerge merge -M -F > > I still don't see the potential problem. If you do svnmerge, svn commit, > all is fine, right? The problem *only* arises if you do svnmerge, > svn up, svn commit - and clearly, you shouldn't do that. If, on commit, > you get a conflict, you should revert all your changes, svn up, and > start all over with the merge. I did do that and I still got conflicts. -Brett From python-checkins at python.org Fri Jan 30 04:01:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 04:01:08 +0100 (CET) Subject: [Python-checkins] r69116 - python/branches/py3k Message-ID: <20090130030108.75F0D1E400C@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 04:01:08 2009 New Revision: 69116 Log: 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 ........ Modified: python/branches/py3k/ (props changed) From martin at v.loewis.de Fri Jan 30 04:03:54 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Fri, 30 Jan 2009 04:03:54 +0100 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> Message-ID: <49826E1A.6080809@v.loewis.de> Brett Cannon wrote: > On Thu, Jan 29, 2009 at 18:27, "Martin v. L?wis" wrote: >>> There are potential problems with doing it that way [1]. The safer >>> option is to do: >>> >>> svn revert . >>> svnmerge merge -M -F >> I still don't see the potential problem. If you do svnmerge, svn commit, >> all is fine, right? The problem *only* arises if you do svnmerge, >> svn up, svn commit - and clearly, you shouldn't do that. If, on commit, >> you get a conflict, you should revert all your changes, svn up, and >> start all over with the merge. > > I did do that and I still got conflicts. What is "that"? "svn revert -R" (plus rm for all added files), "svn up", "svnmerge", "svn revert ."? What conflicts? Martin From buildbot at python.org Fri Jan 30 04:04:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 03:04:26 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090130030426.9063C1E4002@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/108 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 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 brett at python.org Fri Jan 30 04:06:13 2009 From: brett at python.org (Brett Cannon) Date: Thu, 29 Jan 2009 19:06:13 -0800 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: <49826E1A.6080809@v.loewis.de> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> <49826E1A.6080809@v.loewis.de> Message-ID: On Thu, Jan 29, 2009 at 19:03, "Martin v. L?wis" wrote: > Brett Cannon wrote: >> On Thu, Jan 29, 2009 at 18:27, "Martin v. L?wis" wrote: >>>> There are potential problems with doing it that way [1]. The safer >>>> option is to do: >>>> >>>> svn revert . >>>> svnmerge merge -M -F >>> I still don't see the potential problem. If you do svnmerge, svn commit, >>> all is fine, right? The problem *only* arises if you do svnmerge, >>> svn up, svn commit - and clearly, you shouldn't do that. If, on commit, >>> you get a conflict, you should revert all your changes, svn up, and >>> start all over with the merge. >> >> I did do that and I still got conflicts. > > What is "that"? "svn revert -R" (plus rm for all added files), > "svn up", "svnmerge", "svn revert ."? svn up svnmerge ... conflicts svn revert -R . svn up svnmerge ... same conflicts > > What conflicts? Some metadata on '.'. -Brett From martin at v.loewis.de Fri Jan 30 04:09:17 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Fri, 30 Jan 2009 04:09:17 +0100 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> <49826E1A.6080809@v.loewis.de> Message-ID: <49826F5D.7000009@v.loewis.de> > svn up > svnmerge > ... conflicts > svn revert -R . > svn up > svnmerge > ... same conflicts Ah. In the 3.0 branch, always do "svn revert ." after svnmerge. It's ok (Nick says it isn't exactly ok, but I don't understand why) Martin From python-checkins at python.org Fri Jan 30 04:15:05 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 30 Jan 2009 04:15:05 +0100 (CET) Subject: [Python-checkins] r69117 - python/branches/py3k/Python/import.c Message-ID: <20090130031505.5ECF41E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 30 04:15:05 2009 New Revision: 69117 Log: Issue #5041: Fixed memory leak. Modified: python/branches/py3k/Python/import.c Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Fri Jan 30 04:15:05 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 * From python-checkins at python.org Fri Jan 30 04:39:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 04:39:35 +0100 (CET) Subject: [Python-checkins] r69118 - in python/branches/py3k: Doc/documenting/markup.rst Doc/tools/sphinxext/download.html Lib/colorsys.py Lib/posixpath.py Lib/test/test_tcl.py Modules/_tkinter.c Message-ID: <20090130033935.7C26A1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 04:39:35 2009 New Revision: 69118 Log: 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 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/documenting/markup.rst python/branches/py3k/Doc/tools/sphinxext/download.html python/branches/py3k/Lib/colorsys.py python/branches/py3k/Lib/posixpath.py python/branches/py3k/Lib/test/test_tcl.py python/branches/py3k/Modules/_tkinter.c Modified: python/branches/py3k/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k/Doc/documenting/markup.rst (original) +++ python/branches/py3k/Doc/documenting/markup.rst Fri Jan 30 04:39:35 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/py3k/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/py3k/Doc/tools/sphinxext/download.html (original) +++ python/branches/py3k/Doc/tools/sphinxext/download.html Fri Jan 30 04:39:35 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/Lib/colorsys.py ============================================================================== --- python/branches/py3k/Lib/colorsys.py (original) +++ python/branches/py3k/Lib/colorsys.py Fri Jan 30 04:39:35 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/py3k/Lib/posixpath.py ============================================================================== --- python/branches/py3k/Lib/posixpath.py (original) +++ python/branches/py3k/Lib/posixpath.py Fri Jan 30 04:39:35 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/py3k/Lib/test/test_tcl.py ============================================================================== --- python/branches/py3k/Lib/test/test_tcl.py (original) +++ python/branches/py3k/Lib/test/test_tcl.py Fri Jan 30 04:39:35 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/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Fri Jan 30 04:39:35 2009 @@ -2750,7 +2750,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); From buildbot at python.org Fri Jan 30 04:43:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 03:43:49 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090130034349.703B21E4002@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/787 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Jan 30 04:48:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 04:48:23 +0100 (CET) Subject: [Python-checkins] r69119 - in python/branches/release30-maint: Doc/documenting/markup.rst Doc/tools/sphinxext/download.html Lib/colorsys.py Lib/posixpath.py Lib/test/test_tcl.py Modules/_tkinter.c Message-ID: <20090130034823.B81291E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 04:48:23 2009 New Revision: 69119 Log: Merged revisions 69118 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69118 | benjamin.peterson | 2009-01-29 21:39:35 -0600 (Thu, 29 Jan 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 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/documenting/markup.rst python/branches/release30-maint/Doc/tools/sphinxext/download.html python/branches/release30-maint/Lib/colorsys.py python/branches/release30-maint/Lib/posixpath.py python/branches/release30-maint/Lib/test/test_tcl.py python/branches/release30-maint/Modules/_tkinter.c Modified: python/branches/release30-maint/Doc/documenting/markup.rst ============================================================================== --- python/branches/release30-maint/Doc/documenting/markup.rst (original) +++ python/branches/release30-maint/Doc/documenting/markup.rst Fri Jan 30 04:48:23 2009 @@ -289,10 +289,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/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 Jan 30 04:48:23 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/Lib/colorsys.py ============================================================================== --- python/branches/release30-maint/Lib/colorsys.py (original) +++ python/branches/release30-maint/Lib/colorsys.py Fri Jan 30 04:48:23 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/release30-maint/Lib/posixpath.py ============================================================================== --- python/branches/release30-maint/Lib/posixpath.py (original) +++ python/branches/release30-maint/Lib/posixpath.py Fri Jan 30 04:48:23 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/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 Jan 30 04:48:23 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/release30-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release30-maint/Modules/_tkinter.c (original) +++ python/branches/release30-maint/Modules/_tkinter.c Fri Jan 30 04:48:23 2009 @@ -2750,7 +2750,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); From python-checkins at python.org Fri Jan 30 05:00:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 05:00:29 +0100 (CET) Subject: [Python-checkins] r69120 - in python/branches/py3k: Doc/whatsnew/2.7.rst Lib/distutils/command/install_lib.py Message-ID: <20090130040029.4AABD1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 05:00:29 2009 New Revision: 69120 Log: 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 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/whatsnew/2.7.rst python/branches/py3k/Lib/distutils/command/install_lib.py 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 Jan 30 05:00:29 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,11 +190,9 @@ (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 @@ -145,7 +208,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 +226,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/py3k/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/install_lib.py (original) +++ python/branches/py3k/Lib/distutils/command/install_lib.py Fri Jan 30 05:00:29 2009 @@ -1,3 +1,8 @@ +"""distutils.command.install_lib + +Implements the Distutils 'install_lib' command +(install all Python modules).""" + __revision__ = "$Id$" import sys, os From python-checkins at python.org Fri Jan 30 05:03:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 30 Jan 2009 05:03:26 +0100 (CET) Subject: [Python-checkins] r69121 - python/branches/release30-maint Message-ID: <20090130040326.192721E4002@bag.python.org> Author: benjamin.peterson Date: Fri Jan 30 05:03:25 2009 New Revision: 69121 Log: Blocked revisions 69120 via svnmerge ................ r69120 | benjamin.peterson | 2009-01-29 22:00:29 -0600 (Thu, 29 Jan 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 ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Jan 30 05:06:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 04:06:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090130040630.602A91E4002@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/145 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 failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri Jan 30 06:12:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 05:12:26 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090130051226.BF74E1E4002@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/107 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Jan 30 07:53:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 06:53:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090130065356.CD62A1E4002@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/204 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,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.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 Jan 30 08:43:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 07:43:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090130074309.EC6391E400C@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/110 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: 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 Fri Jan 30 09:24:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 30 Jan 2009 08:24:51 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090130082451.873EC1E4002@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/1832 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows 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 ====================================================================== 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') ====================================================================== 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() Message-ID: writes: > > Author: raymond.hettinger > Date: Thu Jan 29 23:26:20 2009 > New Revision: 69105 > > Log: > Fix error in docs. The source says proto 2 is the default. Shouldn't the default become 3 in py3k? From python-checkins at python.org Fri Jan 30 12:05:54 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 30 Jan 2009 12:05:54 +0100 (CET) Subject: [Python-checkins] r69124 - in python/branches/release30-maint: Python/import.c Message-ID: <20090130110554.229F51E402E@bag.python.org> Author: hirokazu.yamamoto Date: Fri Jan 30 12:05:53 2009 New Revision: 69124 Log: Merged revisions 69117 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69117 | hirokazu.yamamoto | 2009-01-30 12:15:05 +0900 | 1 line Issue #5041: Fixed memory leak. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Python/import.c Modified: python/branches/release30-maint/Python/import.c ============================================================================== --- python/branches/release30-maint/Python/import.c (original) +++ python/branches/release30-maint/Python/import.c Fri Jan 30 12:05:53 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 * From ncoghlan at gmail.com Fri Jan 30 13:21:02 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Fri, 30 Jan 2009 22:21:02 +1000 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: <49826F5D.7000009@v.loewis.de> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> <49826E1A.6080809@v.loewis.de> <49826F5D.7000009@v.loewis.de> Message-ID: <4982F0AE.20308@gmail.com> Martin v. L?wis wrote: >> svn up >> svnmerge >> ... conflicts >> svn revert -R . >> svn up >> svnmerge >> ... same conflicts > > Ah. In the 3.0 branch, always do "svn revert ." after svnmerge. > It's ok (Nick says it isn't exactly ok, but I don't understand why) Doing "svn revert ." before making the commit will lose the metadata changes that svnmerge uses for its bookkeeping (i.e. if this practice is used regularly, the tool will completely lose track of which revisions have already been merged). That won't bother those of us that are only backporting cherry-picked revisions, but is rather inconvenient for anyone checking for revisions that haven't been backported yet, but haven't been explicitly blocked either. Doing "svn resolved ." assumes that you did everything else correctly, and even then I don't see how svnmerge could both backport the py3k changes to the metadata and make its own changes and still get the metadata to a sane state. The consequence of getting this approach wrong is that the merge state of the 3.0 maintenance branch can be clobbered completely (losing track both of which revisions have been backported and which have been blocked). Doing both "svn revert ." and "svnmerge merge -M -F " clears out the conflicted metadata and then correctly updates the metadata for the revisions that have been backported. It will always update the svnmerge metadata correctly, regardless of the relative order of the svnmerge and svn update operations. Given the choice of a method which will always do the right thing, over one which always does the wrong thing and another one which only does the right thing if I did two other things in the right order and will completely trash the bookkeeping if I get it wrong, I prefer the option which is guaranteed to be correct (even if it happens to be a little slower as svnmerge recreates the needed metadata updates). If there's something wrong with my understanding of either svn properties or the operation of svnmerge that means the quicker approaches aren't as broken as I think they are, then I'd be happy to adopt one of them (since they *are* faster than my current approach). But until someone pokes a hole in my logic, I'll stick with the slower-but-always-correct methodology (and continue advocating that approach to everyone else doing updates that affect all four branches). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Fri Jan 30 16:42:42 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 30 Jan 2009 16:42:42 +0100 (CET) Subject: [Python-checkins] r69125 - in python/branches/py3k-issue1717: Lib/test/test_funcattrs.py Objects/cellobject.c Message-ID: <20090130154242.1CAA11E4002@bag.python.org> Author: mark.dickinson Date: Fri Jan 30 16:42:41 2009 New Revision: 69125 Log: Add tp_richcompare slot for cell objects, together with tests. Modified: python/branches/py3k-issue1717/Lib/test/test_funcattrs.py python/branches/py3k-issue1717/Objects/cellobject.c Modified: python/branches/py3k-issue1717/Lib/test/test_funcattrs.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_funcattrs.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_funcattrs.py Fri Jan 30 16:42:41 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-issue1717/Objects/cellobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/cellobject.c (original) +++ python/branches/py3k-issue1717/Objects/cellobject.c Fri Jan 30 16:42:41 2009 @@ -51,6 +51,58 @@ PyObject_GC_Del(op); } +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +cell_richcompare(PyObject *a, PyObject *b, int op) +{ + 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 * cell_repr(PyCellObject *op) { @@ -117,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 */ From python-checkins at python.org Fri Jan 30 17:20:49 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 30 Jan 2009 17:20:49 +0100 (CET) Subject: [Python-checkins] r69126 - in python/branches/py3k-issue1717: Lib/test/test_descr.py Objects/descrobject.c Message-ID: <20090130162049.3B63C1E4002@bag.python.org> Author: mark.dickinson Date: Fri Jan 30 17:20:49 2009 New Revision: 69126 Log: Rich comparisons for method wrappers. Modified: python/branches/py3k-issue1717/Lib/test/test_descr.py python/branches/py3k-issue1717/Objects/descrobject.c 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 Fri Jan 30 17:20:49 2009 @@ -3885,8 +3885,6 @@ # Testing method-wrapper objects... # did not support any reflection before 2.5 - return # XXX should methods really support __eq__? - l = [] self.assertEqual(l.__add__, l.__add__) self.assertEqual(l.__add__, [].__add__) Modified: python/branches/py3k-issue1717/Objects/descrobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/descrobject.c (original) +++ python/branches/py3k-issue1717/Objects/descrobject.c Fri Jan 30 17:20:49 2009 @@ -838,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) { @@ -855,6 +860,62 @@ Py_TRASHCAN_SAFE_END(wp) } +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +wrapper_richcompare(PyObject *a, PyObject *b, int op) +{ + 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 wrapper_hash(wrapperobject *wp) { @@ -977,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 */ From python-checkins at python.org Fri Jan 30 17:52:03 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 30 Jan 2009 17:52:03 +0100 (CET) Subject: [Python-checkins] r69127 - in python/branches/py3k-issue1717: Doc/documenting/markup.rst Doc/library/collections.rst Doc/library/datetime.rst Doc/library/queue.rst Doc/library/shelve.rst Doc/reference/datamodel.rst Doc/tools/sphinxext/download.html Doc/whatsnew/2.7.rst Lib/_abcoll.py Lib/colorsys.py Lib/distutils/command/install_lib.py Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe Lib/distutils/tests/test_sdist.py Lib/importlib/test/abc.py Lib/importlib/test/builtin/test_finder.py Lib/importlib/test/extension/test_finder.py Lib/importlib/test/finder_tests.py Lib/importlib/test/frozen/test_finder.py Lib/importlib/test/loader_tests.py Lib/importlib/test/source/test_finder.py Lib/posixpath.py Lib/shutil.py Lib/test/regrtest.py Lib/test/test_builtin.py Lib/test/test_collections.py Lib/test/test_long.py Lib/test/test_shutil.py Lib/test/test_tcl.py Lib/test/test_tk_guionly.py Lib/test/test_tk_textonly.py Lib/test/test_ttk_guionly.py Lib/test/test_ttk_textonly.py Lib/tkinter/test/runtktests.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/trace.py Misc/NEWS Modules/_tkinter.c Modules/itertoolsmodule.c Objects/longobject.c PC/bdist_wininst/install.c PCbuild/bdist_wininst.vcproj Python/bltinmodule.c Python/import.c Message-ID: <20090130165203.5E7D31E4002@bag.python.org> Author: mark.dickinson Date: Fri Jan 30 17:52:02 2009 New Revision: 69127 Log: Merged revisions 69064,69068,69072,69075,69081-69082,69086,69088-69089,69092,69096,69098,69101,69105,69108,69110-69111,69114,69116-69118,69120 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69064 | guilherme.polo | 2009-01-28 20:40:48 +0000 (Wed, 28 Jan 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 21:25:58 +0000 (Wed, 28 Jan 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-28 23:33:59 +0000 (Wed, 28 Jan 2009) | 1 line Beef-up tests for collections ABCs. ................ r69075 | raymond.hettinger | 2009-01-29 00:01:27 +0000 (Thu, 29 Jan 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 01:59:38 +0000 (Thu, 29 Jan 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 02:14:30 +0000 (Thu, 29 Jan 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 03:41:55 +0000 (Thu, 29 Jan 2009) | 1 line Update itertools.__doc__ to include all tools. ................ r69088 | raymond.hettinger | 2009-01-29 03:48:02 +0000 (Thu, 29 Jan 2009) | 1 line Fix typo. ................ r69089 | benjamin.peterson | 2009-01-29 03:52:26 +0000 (Thu, 29 Jan 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 04:10:21 +0000 (Thu, 29 Jan 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 12:36:50 +0000 (Thu, 29 Jan 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 13:08:01 +0000 (Thu, 29 Jan 2009) | 2 lines Fix issue5076: bdist_wininst fails on py3k ................ r69101 | antoine.pitrou | 2009-01-29 20:26:59 +0000 (Thu, 29 Jan 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 22:26:20 +0000 (Thu, 29 Jan 2009) | 1 line Fix error in docs. The source says proto 2 is the default. ................ r69108 | tarek.ziade | 2009-01-29 23:54:06 +0000 (Thu, 29 Jan 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 00:22:35 +0000 (Fri, 30 Jan 2009) | 2 lines Merge testing ABCs for importlib into importlib.test.abc. ................ r69111 | brett.cannon | 2009-01-30 01:31:34 +0000 (Fri, 30 Jan 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 02:29:43 +0000 (Fri, 30 Jan 2009) | 1 line fix a case of set_daemon #5087 ................ r69116 | benjamin.peterson | 2009-01-30 03:01:08 +0000 (Fri, 30 Jan 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 03:15:05 +0000 (Fri, 30 Jan 2009) | 1 line Issue #5041: Fixed memory leak. ................ r69118 | benjamin.peterson | 2009-01-30 03:39:35 +0000 (Fri, 30 Jan 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 04:00:29 +0000 (Fri, 30 Jan 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 ........ ................ Added: python/branches/py3k-issue1717/Lib/importlib/test/abc.py - copied unchanged from r69120, /python/branches/py3k/Lib/importlib/test/abc.py python/branches/py3k-issue1717/Lib/test/test_ttk_guionly.py - copied unchanged from r69120, /python/branches/py3k/Lib/test/test_ttk_guionly.py python/branches/py3k-issue1717/Lib/test/test_ttk_textonly.py - copied unchanged from r69120, /python/branches/py3k/Lib/test/test_ttk_textonly.py Removed: python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py python/branches/py3k-issue1717/Lib/importlib/test/loader_tests.py python/branches/py3k-issue1717/Lib/test/test_tk_guionly.py python/branches/py3k-issue1717/Lib/test/test_tk_textonly.py Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Doc/documenting/markup.rst python/branches/py3k-issue1717/Doc/library/collections.rst python/branches/py3k-issue1717/Doc/library/datetime.rst python/branches/py3k-issue1717/Doc/library/queue.rst python/branches/py3k-issue1717/Doc/library/shelve.rst python/branches/py3k-issue1717/Doc/reference/datamodel.rst python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst python/branches/py3k-issue1717/Lib/_abcoll.py python/branches/py3k-issue1717/Lib/colorsys.py python/branches/py3k-issue1717/Lib/distutils/command/install_lib.py python/branches/py3k-issue1717/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/py3k-issue1717/Lib/distutils/command/wininst-9.0.exe python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_finder.py python/branches/py3k-issue1717/Lib/posixpath.py python/branches/py3k-issue1717/Lib/shutil.py python/branches/py3k-issue1717/Lib/test/regrtest.py python/branches/py3k-issue1717/Lib/test/test_builtin.py python/branches/py3k-issue1717/Lib/test/test_collections.py python/branches/py3k-issue1717/Lib/test/test_long.py python/branches/py3k-issue1717/Lib/test/test_shutil.py python/branches/py3k-issue1717/Lib/test/test_tcl.py python/branches/py3k-issue1717/Lib/tkinter/test/runtktests.py python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py python/branches/py3k-issue1717/Lib/trace.py python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/Modules/_tkinter.c python/branches/py3k-issue1717/Modules/itertoolsmodule.c python/branches/py3k-issue1717/Objects/longobject.c python/branches/py3k-issue1717/PC/bdist_wininst/install.c python/branches/py3k-issue1717/PCbuild/bdist_wininst.vcproj python/branches/py3k-issue1717/Python/bltinmodule.c python/branches/py3k-issue1717/Python/import.c Modified: python/branches/py3k-issue1717/Doc/documenting/markup.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/documenting/markup.rst (original) +++ python/branches/py3k-issue1717/Doc/documenting/markup.rst Fri Jan 30 17:52: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/py3k-issue1717/Doc/library/collections.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/collections.rst (original) +++ python/branches/py3k-issue1717/Doc/library/collections.rst Fri Jan 30 17:52: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__``, Modified: python/branches/py3k-issue1717/Doc/library/datetime.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/datetime.rst (original) +++ python/branches/py3k-issue1717/Doc/library/datetime.rst Fri Jan 30 17:52: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/py3k-issue1717/Doc/library/queue.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/queue.rst (original) +++ python/branches/py3k-issue1717/Doc/library/queue.rst Fri Jan 30 17:52: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/py3k-issue1717/Doc/library/shelve.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/shelve.rst (original) +++ python/branches/py3k-issue1717/Doc/library/shelve.rst Fri Jan 30 17:52: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 2 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-issue1717/Doc/reference/datamodel.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/reference/datamodel.rst (original) +++ python/branches/py3k-issue1717/Doc/reference/datamodel.rst Fri Jan 30 17:52: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/py3k-issue1717/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html (original) +++ python/branches/py3k-issue1717/Doc/tools/sphinxext/download.html Fri Jan 30 17:52: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/py3k-issue1717/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst (original) +++ python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst Fri Jan 30 17:52: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,11 +190,9 @@ (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 @@ -145,7 +208,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 +226,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/py3k-issue1717/Lib/_abcoll.py ============================================================================== --- python/branches/py3k-issue1717/Lib/_abcoll.py (original) +++ python/branches/py3k-issue1717/Lib/_abcoll.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/colorsys.py ============================================================================== --- python/branches/py3k-issue1717/Lib/colorsys.py (original) +++ python/branches/py3k-issue1717/Lib/colorsys.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/command/install_lib.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/command/install_lib.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/py3k-issue1717/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py Fri Jan 30 17:52: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/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 Fri Jan 30 17:52:02 2009 @@ -1,11 +1,11 @@ from importlib import machinery -from .. import finder_tests +from .. import abc from .. import support import sys import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test find_module() for built-in modules.""" Modified: python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/extension/test_finder.py Fri Jan 30 17:52:02 2009 @@ -1,10 +1,10 @@ import importlib -from .. import finder_tests +from .. import abc from . import test_path_hook import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" Deleted: python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/finder_tests.py Fri Jan 30 17:52: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 Modified: python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_finder.py Fri Jan 30 17:52: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.""" Deleted: python/branches/py3k-issue1717/Lib/importlib/test/loader_tests.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/loader_tests.py Fri Jan 30 17:52: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/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 Fri Jan 30 17:52:02 2009 @@ -1,5 +1,5 @@ import importlib -from .. import finder_tests +from .. import abc from .. import support import os import py_compile @@ -7,7 +7,7 @@ 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 Modified: python/branches/py3k-issue1717/Lib/posixpath.py ============================================================================== --- python/branches/py3k-issue1717/Lib/posixpath.py (original) +++ python/branches/py3k-issue1717/Lib/posixpath.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/shutil.py ============================================================================== --- python/branches/py3k-issue1717/Lib/shutil.py (original) +++ python/branches/py3k-issue1717/Lib/shutil.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/test/regrtest.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/regrtest.py (original) +++ python/branches/py3k-issue1717/Lib/test/regrtest.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/test/test_builtin.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_builtin.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_builtin.py Fri Jan 30 17:52:02 2009 @@ -1066,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/py3k-issue1717/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_collections.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_collections.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/test/test_long.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_long.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_long.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/test/test_shutil.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_shutil.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_shutil.py Fri Jan 30 17:52: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/py3k-issue1717/Lib/test/test_tcl.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_tcl.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_tcl.py Fri Jan 30 17:52: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() Deleted: python/branches/py3k-issue1717/Lib/test/test_tk_guionly.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_tk_guionly.py Fri Jan 30 17:52:02 2009 +++ (empty file) @@ -1,14 +0,0 @@ -from test import support -from tkinter.test import runtktests - -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)) - -if __name__ == '__main__': - test_main(enable_gui=True) Deleted: python/branches/py3k-issue1717/Lib/test/test_tk_textonly.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_tk_textonly.py Fri Jan 30 17:52:02 2009 +++ (empty file) @@ -1,8 +0,0 @@ -from test import support -from tkinter.test import runtktests - -def test_main(): - support.run_unittest(*runtktests.get_tests(gui=False)) - -if __name__ == '__main__': - test_main() Modified: python/branches/py3k-issue1717/Lib/tkinter/test/runtktests.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/test/runtktests.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/test/runtktests.py Fri Jan 30 17:52:02 2009 @@ -19,9 +19,13 @@ return True return False -def get_tests_modules(basepath=this_dir_path, gui=True): +def get_tests_modules(basepath=this_dir_path, gui=True, packages=None): """This will import and yield modules whose names start with test_ - and are inside packages found in the path starting at basepath.""" + and are inside packages found in the path starting at basepath. + + If packages is specified it should contain package names that + want their tests collected. + """ py_ext = '.py' for dirpath, dirnames, filenames in os.walk(basepath): @@ -31,6 +35,9 @@ if is_package(dirpath) and filenames: pkg_name = dirpath[len(basepath) + len(os.sep):].replace('/', '.') + if packages and pkg_name not in packages: + continue + filenames = filter( lambda x: x.startswith('test_') and x.endswith(py_ext), filenames) @@ -48,7 +55,7 @@ if gui: raise -def get_tests(text=True, gui=True): +def get_tests(text=True, gui=True, packages=None): """Yield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be @@ -58,7 +65,7 @@ attrs.append('tests_nogui') if gui: attrs.append('tests_gui') - for module in get_tests_modules(gui=gui): + for module in get_tests_modules(gui=gui, packages=packages): for attr in attrs: for test in getattr(module, attr, ()): yield test 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 Fri Jan 30 17:52:02 2009 @@ -708,10 +708,13 @@ class TreeviewTest(unittest.TestCase): def setUp(self): - self.tv = ttk.Treeview() + self.root = support.get_tk_root() + self.tv = ttk.Treeview(self.root) def tearDown(self): self.tv.destroy() + self.root.update_idletasks() + self.root.destroy() def test_bbox(self): Modified: python/branches/py3k-issue1717/Lib/trace.py ============================================================================== --- python/branches/py3k-issue1717/Lib/trace.py (original) +++ python/branches/py3k-issue1717/Lib/trace.py Fri Jan 30 17:52: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/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Fri Jan 30 17:52:02 2009 @@ -17,6 +17,14 @@ the type definition cmpfunc. The tp_compare slot is reserved for future usage. +- 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 + speedups of up to 20%, depending on the system, on various benchmarks. + - Issue #4874: Most builtin decoders now reject unicode input. - Issue #4842: Don't allow trailing 'L' when constructing an integer @@ -144,6 +152,13 @@ Library ------- +- 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 @@ -423,6 +438,12 @@ buffer. +Tests +----- + +- Issue #5083: New 'gui' resource for regrtest. + + Docs ---- Modified: python/branches/py3k-issue1717/Modules/_tkinter.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_tkinter.c (original) +++ python/branches/py3k-issue1717/Modules/_tkinter.c Fri Jan 30 17:52:02 2009 @@ -2794,7 +2794,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/py3k-issue1717/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/itertoolsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/itertoolsmodule.c Fri Jan 30 17:52:02 2009 @@ -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/py3k-issue1717/Objects/longobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/longobject.c (original) +++ python/branches/py3k-issue1717/Objects/longobject.c Fri Jan 30 17:52: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, Modified: python/branches/py3k-issue1717/PC/bdist_wininst/install.c ============================================================================== --- python/branches/py3k-issue1717/PC/bdist_wininst/install.c (original) +++ python/branches/py3k-issue1717/PC/bdist_wininst/install.c Fri Jan 30 17:52: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;itp_dict == NULL) { if (PyType_Ready(Py_TYPE(number)) < 0) @@ -1727,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\ Modified: python/branches/py3k-issue1717/Python/import.c ============================================================================== --- python/branches/py3k-issue1717/Python/import.c (original) +++ python/branches/py3k-issue1717/Python/import.c Fri Jan 30 17:52: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 * From guido at python.org Fri Jan 30 18:38:21 2009 From: guido at python.org (Guido van Rossum) Date: Fri, 30 Jan 2009 09:38:21 -0800 Subject: [Python-checkins] r69105 - python/branches/py3k/Doc/library/shelve.rst In-Reply-To: References: <20090129222622.D464C1E4030@bag.python.org> Message-ID: On Fri, Jan 30, 2009 at 2:42 AM, Antoine Pitrou wrote: > writes: >> >> Author: raymond.hettinger >> Date: Thu Jan 29 23:26:20 2009 >> New Revision: 69105 >> >> Log: >> Fix error in docs. The source says proto 2 is the default. > > Shouldn't the default become 3 in py3k? Yes it should, to match the updated default in the pickle module itself. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From python-checkins at python.org Fri Jan 30 23:32:10 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 30 Jan 2009 23:32:10 +0100 (CET) Subject: [Python-checkins] r69128 - peps/trunk/pep-0374.txt Message-ID: <20090130223210.1E90F1E4002@bag.python.org> Author: brett.cannon Date: Fri Jan 30 23:32:09 2009 New Revision: 69128 Log: Mention when scenarios are expected to be complete. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Fri Jan 30 23:32:09 2009 @@ -17,6 +17,10 @@ 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 ========= From martin at v.loewis.de Sat Jan 31 01:38:22 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Sat, 31 Jan 2009 01:38:22 +0100 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: <4982F0AE.20308@gmail.com> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> <49826E1A.6080809@v.loewis.de> <49826F5D.7000009@v.loewis.de> <4982F0AE.20308@gmail.com> Message-ID: <49839D7E.7070902@v.loewis.de> >> Ah. In the 3.0 branch, always do "svn revert ." after svnmerge. >> It's ok (Nick says it isn't exactly ok, but I don't understand why) > > Doing "svn revert ." before making the commit will lose the metadata > changes that svnmerge uses for its bookkeeping (i.e. if this practice is > used regularly, the tool will completely lose track of which revisions > have already been merged). How so? The metadata are getting tracked just fine, no loss whatsoever. > That won't bother those of us that are only > backporting cherry-picked revisions, but is rather inconvenient for > anyone checking for revisions that haven't been backported yet, but > haven't been explicitly blocked either. Take a look at r68901, which I merged using the procedure I described. svn diff -r68900:68901 --depth empty . gives Modified: svnmerge-integrated - /python/branches/py3k:1-67498,67522-67529,67531-67533,67535-67544,67546-67549,67551-67584,67586-67602,67604-67606,67608-67609,67611-67619,67621-67635,67638,67650,67653-67701,67703-67712,67714,67716-67746,67748,67750-67762,67764-67797,67799-67809,67811-67822,67825-67838,67840-67850,67852-67857,67859-67885,67888-67902,67904-67909,67911-67931,67933,67937-67938,67940,67950-67955,67957-67958,67960-67963,67965-67973,67975-67980,67982,67984-68014,68016-68058,68060-68089,68091-68093,68101,68103,68132,68137,68139-68152,68169-68170,68175,68178,68184,68193,68200,68205-68206,68212,68216,68223-68224,68226-68229,68237,68242,68245,68247,68249,68309,68321,68342,68363,68375,68401,68427,68440,68443,68451,68454,68463,68474-68475,68477,68508,68511,68525,68529,68553,68581,68587,68615,68619,68630,68638,68650-68653,68662,68669,68675,68677,68700,68709,68730,68732,68746,68767-68770,68782,68814-68815,68836,68855,68857,68887,68895 + /python/branches/py3k:1-67498,67522-67529,67531-67533,67535-67544,67546-67549,67551-67584,67586-67602,67604-67606,67608-67609,67611-67619,67621-67635,67638,67650,67653-67701,67703-67712,67714,67716-67746,67748,67750-67762,67764-67797,67799-67809,67811-67822,67825-67838,67840-67850,67852-67857,67859-67885,67888-67902,67904-67909,67911-67931,67933,67937-67938,67940,67950-67955,67957-67958,67960-67963,67965-67973,67975-67980,67982,67984-68014,68016-68058,68060-68089,68091-68093,68101,68103,68132,68137,68139-68152,68169-68170,68175,68178,68184,68193,68200,68205-68206,68212,68216,68223-68224,68226-68229,68237,68242,68245,68247,68249,68309,68321,68342,68363,68375,68401,68427,68440,68443,68451,68454,68463,68474-68475,68477,68508,68511,68525,68529,68553,68581,68587,68615,68619,68630,68638,68650-68653,68662,68669,68675,68677,68700,68709,68730,68732,68746,68767-68770,68782,68814-68815,68836,68855,68857,68887,68895,68898 As you can see, 68898 has been added to svnmerge-integrated, and this is indeed the revision that I merged. > Doing "svn resolved ." assumes that you did everything else correctly, > and even then I don't see how svnmerge could both backport the py3k > changes to the metadata and make its own changes and still get the > metadata to a sane state. The *only* interesting metadata in the svnmerge-integrated property are the ones that svnmerge has written, and svnmerge writes them correctly. > The consequence of getting this approach wrong > is that the merge state of the 3.0 maintenance branch can be clobbered > completely (losing track both of which revisions have been backported > and which have been blocked). Not with the procedure I described. > > Doing both "svn revert ." and "svnmerge merge -M -F " clears > out the conflicted metadata and then correctly updates the metadata for > the revisions that have been backported. It will always update the > svnmerge metadata correctly, regardless of the relative order of the > svnmerge and svn update operations. I don't understand why you bring up this "regardless of the relative order"? Who ever proposed a different order? If you do things in the order I suggest, everything will be fine, right? > Given the choice of a method which will always do the right thing, over > one which always does the wrong thing and another one which only does > the right thing if I did two other things in the right order and will > completely trash the bookkeeping if I get it wrong That's open for debate. What *specific* wrong order are you talking about? If you do things in the right order, will it still get the bookkeeping wrong? > If there's something wrong with my understanding of either svn > properties or the operation of svnmerge that means the quicker > approaches aren't as broken as I think they are, then I'd be happy to > adopt one of them (since they *are* faster than my current approach). > But until someone pokes a hole in my logic, I'll stick with the > slower-but-always-correct methodology (and continue advocating that > approach to everyone else doing updates that affect all four branches). See above. You claim that doing things the way I recommend will lose metadata; I believe this claim is false. Regards, Martin From python-checkins at python.org Sat Jan 31 02:42:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 02:42:55 +0100 (CET) Subject: [Python-checkins] r69129 - python/trunk/Lib/test/test_os.py Message-ID: <20090131014255.DE6271E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 02:42:55 2009 New Revision: 69129 Log: check the errno in bad fd cases Modified: python/trunk/Lib/test/test_os.py Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Sat Jan 31 02:42:55 2009 @@ -3,6 +3,7 @@ # portable than they had been thought to be. import os +import errno import unittest import warnings import sys @@ -249,7 +250,6 @@ result = os.statvfs(self.fname) except OSError, e: # On AtheOS, glibc always returns ENOSYS - import errno if e.errno == errno.ENOSYS: return @@ -549,7 +549,13 @@ locals()["test_"+f] = get_single(f) def check(self, f, *args): - self.assertRaises(OSError, f, test_support.make_bad_fd(), *args) + try: + f(test_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"): From buildbot at python.org Sat Jan 31 03:37:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 02:37:48 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090131023748.8E9991E4002@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/84 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bz2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 31 03:50:09 2009 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 31 Jan 2009 03:50:09 +0100 (CET) Subject: [Python-checkins] r69130 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090131025009.564A31E4002@bag.python.org> Author: andrew.kuchling Date: Sat Jan 31 03:50:09 2009 New Revision: 69130 Log: Add a section Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sat Jan 31 03:50:09 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. + .. ====================================================================== From python-checkins at python.org Sat Jan 31 04:26:02 2009 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 31 Jan 2009 04:26:02 +0100 (CET) Subject: [Python-checkins] r69131 - python/trunk/Doc/library/ttk.rst Message-ID: <20090131032602.ADC491E4002@bag.python.org> 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: +-----------------+--------------------------------------------------------+ | 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 From python-checkins at python.org Sat Jan 31 04:57:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 04:57:19 +0100 (CET) Subject: [Python-checkins] r69132 - python/branches/py3k/Doc/reference/executionmodel.rst Message-ID: <20090131035719.9997E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 04:57:19 2009 New Revision: 69132 Log: comprehrensions now have proper scoping #5106 Modified: python/branches/py3k/Doc/reference/executionmodel.rst Modified: python/branches/py3k/Doc/reference/executionmodel.rst ============================================================================== --- python/branches/py3k/Doc/reference/executionmodel.rst (original) +++ python/branches/py3k/Doc/reference/executionmodel.rst Sat Jan 31 04:57:19 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 From ncoghlan at gmail.com Sat Jan 31 06:00:49 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sat, 31 Jan 2009 15:00:49 +1000 Subject: [Python-checkins] [Python-Dev] Merging to the 3.0 maintenance branch In-Reply-To: <49839D7E.7070902@v.loewis.de> References: <20090129043706.5614B1E4002@bag.python.org> <1afaf6160901290804t3c08134egadfd14493dcb09ae@mail.gmail.com> <498229BE.4060408@gmail.com> <49826577.4030808@v.loewis.de> <49826E1A.6080809@v.loewis.de> <49826F5D.7000009@v.loewis.de> <4982F0AE.20308@gmail.com> <49839D7E.7070902@v.loewis.de> Message-ID: <4983DB01.70503@gmail.com> Martin v. L?wis wrote: > See above. You claim that doing things the way I recommend will lose > metadata; I believe this claim is false. I can see how "svn resolved ." gets it right (now that I understand how the conflict is being produced and then fixed automatically by svnmerge, but not actually marked as resolved). I still don't understand how "svn revert ." can avoid losing the metadata changes unless svnmerge is told to modify the properties again after they have been reverted. Or am I misunderstanding SVN, and the revert command doesn't actually revert property changes? Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Sat Jan 31 13:12:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 31 Jan 2009 13:12:41 +0100 (CET) Subject: [Python-checkins] r69133 - python/branches/py3k/Python/makeopcodetargets.py Message-ID: <20090131121241.792431E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 31 13:12:41 2009 New Revision: 69133 Log: Make Python/makeopcodetargets runnable with Python 2.3. With any luck, this should solve the 'failed compile' on the x86 gentoo 3.x buildbot. Modified: python/branches/py3k/Python/makeopcodetargets.py Modified: python/branches/py3k/Python/makeopcodetargets.py ============================================================================== --- python/branches/py3k/Python/makeopcodetargets.py (original) +++ python/branches/py3k/Python/makeopcodetargets.py Sat Jan 31 13:12:41 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 python-checkins at python.org Sat Jan 31 17:29:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 17:29:19 +0100 (CET) Subject: [Python-checkins] r69134 - python/trunk/Objects/unicodeobject.c Message-ID: <20090131162919.35EFF1E4030@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 17:29:18 2009 New Revision: 69134 Log: completely detabify unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Jan 31 17:29:18 2009 @@ -114,59 +114,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 }; @@ -174,11 +174,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 } @@ -238,16 +238,16 @@ /* 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 unicode objects"); return -1; @@ -260,9 +260,9 @@ 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; } @@ -309,33 +309,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() @@ -363,26 +363,26 @@ void unicode_dealloc(register PyUnicodeObject *unicode) { 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); } } @@ -393,28 +393,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 @@ -428,7 +428,7 @@ } PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -436,26 +436,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); @@ -464,7 +464,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; } @@ -473,11 +473,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. @@ -485,26 +485,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); } @@ -530,13 +530,13 @@ #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) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } unicode = _PyUnicode_New(size); @@ -548,11 +548,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 @@ -562,23 +562,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++;} @@ -586,373 +586,373 @@ 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 format specifications - * (we call PyObject_Str()/PyObject_Repr() for these objects - * once during step 3 and put the result in an array) */ - for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) - ++callcount; - } - /* 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')) + /* step 1: count the number of %S/%R format specifications + * (we call PyObject_Str()/PyObject_Repr() for these objects + * once during step 3 and put the result in an array) */ + for (f = format; *f; f++) { + if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) + ++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 '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++; - } + 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 '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; - } + 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; + 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; + if (callresults) { + PyObject **callresult2 = callresults; + while (callresult2 < callresult) { + Py_DECREF(*callresult2); + ++callresult2; + } + PyObject_Free(callresults); + } + if (abuffer) + PyObject_Free(abuffer); + return NULL; } #undef appendstring @@ -960,41 +960,41 @@ 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 @@ -1012,17 +1012,17 @@ #ifdef Py_UNICODE_WIDE if (ordinal < 0 || ordinal > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x110000) " - "(wide Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x110000) " + "(wide Python build)"); + return NULL; } #else if (ordinal < 0 || ordinal > 0xffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x10000) " - "(narrow Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x10000) " + "(narrow Python build)"); + return NULL; } #endif @@ -1035,29 +1035,29 @@ /* XXX Perhaps we should make this API an alias of PyObject_Unicode() 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)); } return PyUnicode_FromEncodedObject(obj, NULL, "strict"); } 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 0 @@ -1070,26 +1070,26 @@ represent *encoded* Unicode ! */ - if (PyUnicode_Check(obj)) { - if (encoding) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; - } - return PyObject_Unicode(obj); - } + if (PyUnicode_Check(obj)) { + if (encoding) { + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; + } + return PyObject_Unicode(obj); + } #else if (PyUnicode_Check(obj)) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; - } + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; + } #endif /* Coerce object */ if (PyString_Check(obj)) { - s = PyString_AS_STRING(obj); - len = PyString_GET_SIZE(obj); + s = PyString_AS_STRING(obj); + len = PyString_GET_SIZE(obj); } else if (PyByteArray_Check(obj)) { /* Python 2.x specific */ @@ -1098,23 +1098,23 @@ return NULL; } 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)) - PyErr_Format(PyExc_TypeError, - "coercing to Unicode: need string or buffer, " - "%.80s found", - Py_TYPE(obj)->tp_name); - goto onError; + /* Overwrite the error message with something more useful in + case of a TypeError. */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_Format(PyExc_TypeError, + "coercing to Unicode: 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; @@ -1123,14 +1123,14 @@ } 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; if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (strcmp(encoding, "utf-8") == 0) @@ -1178,7 +1178,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1191,15 +1191,15 @@ } 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; @@ -1217,7 +1217,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1241,20 +1241,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); } /* Encode via the codec registry */ @@ -1275,7 +1275,7 @@ } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; @@ -1324,11 +1324,11 @@ loads the encoding into the codec registry cache. */ v = _PyCodec_Lookup(encoding); if (v == NULL) - goto onError; + goto onError; Py_DECREF(v); strncpy(unicode_default_encoding, - encoding, - sizeof(unicode_default_encoding)); + encoding, + sizeof(unicode_default_encoding)); return 0; onError: @@ -1361,40 +1361,40 @@ 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, insize, *startinpos, *endinpos, reason); - if (*exceptionObject == NULL) - goto onError; + *exceptionObject = PyUnicodeDecodeError_Create( + encoding, input, insize, *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; 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 @@ -1405,11 +1405,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; @@ -1432,10 +1432,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, @@ -1491,16 +1491,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; @@ -1565,7 +1565,7 @@ } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -1592,7 +1592,7 @@ startinpos = s-starts; errmsg = "unexpected special character"; s++; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; @@ -1664,7 +1664,7 @@ return PyErr_NoMemory(); if (size == 0) - return PyString_FromStringAndSize(NULL, 0); + return PyString_FromStringAndSize(NULL, 0); v = PyString_FromStringAndSize(NULL, cbAllocated); if (v == NULL) @@ -1772,16 +1772,16 @@ }; 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); } 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; @@ -1822,72 +1822,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: @@ -1895,25 +1895,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); /* 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: */ @@ -1931,24 +1931,24 @@ 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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + errors, &errorHandler, + "utf8", errmsg, + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -1972,8 +1972,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 */ @@ -2038,7 +2038,7 @@ *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; - } + } encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); @@ -2055,7 +2055,7 @@ v = PyString_FromStringAndSize(stackbuf, nneeded); } else { - /* Cut back to size actually needed. */ + /* Cut back to size actually needed. */ nneeded = p - PyString_AS_STRING(v); assert(nneeded <= nallocated); _PyString_Resize(&v, nneeded); @@ -2072,27 +2072,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; @@ -2120,8 +2120,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 */ @@ -2148,25 +2148,25 @@ const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | (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) { @@ -2185,54 +2185,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; + 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); + outpos = p-PyUnicode_AS_UNICODE(unicode); if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf32", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, &unicode, &outpos, &p)) - goto onError; + 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) @@ -2251,9 +2251,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; @@ -2283,21 +2283,21 @@ 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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2317,16 +2317,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); } @@ -2341,28 +2341,28 @@ 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); } 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; @@ -2406,25 +2406,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) { @@ -2439,74 +2439,74 @@ } while (q < e) { - Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[ihi] << 8) | q[ilo]; - - q += 2; - - 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)-starts; - goto utf16Error; - } - if (0xD800 <= ch && ch <= 0xDBFF) { - Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; - q += 2; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + Py_UNICODE ch; + /* remaining bytes at the end? (size should be even) */ + if (e-q<2) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf16Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + ch = (q[ihi] << 8) | q[ilo]; + + q += 2; + + 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)-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 */ + 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, - starts, size, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf16", errmsg, + starts, size, &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) @@ -2525,9 +2525,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; @@ -2553,24 +2553,24 @@ #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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2586,13 +2586,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) @@ -2609,9 +2609,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 ----------------------------------------------- */ @@ -2619,8 +2619,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; @@ -2917,7 +2917,7 @@ */ if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyString_FromStringAndSize(NULL, 2 @@ -2938,10 +2938,10 @@ /* Escape quotes and backslashes */ if ((quotes && - ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { + ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { *p++ = '\\'; *p++ = (char) ch; - continue; + continue; } #ifdef Py_UNICODE_WIDE @@ -2957,34 +2957,34 @@ *p++ = hexdigit[(ch >> 8) & 0x0000000F]; *p++ = hexdigit[(ch >> 4) & 0x0000000F]; *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; + *p++ = hexdigit[ucs & 0x0000000F]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; + } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3032,7 +3032,7 @@ } PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { return unicodeescape_string(s, size, 0); } @@ -3044,14 +3044,14 @@ return NULL; } return PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3070,63 +3070,63 @@ 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, size, &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, size, &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; @@ -3146,15 +3146,15 @@ if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; + starts, size, &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; @@ -3167,7 +3167,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3179,22 +3179,22 @@ #else const Py_ssize_t expandsize = 6; #endif - + if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); - + return PyErr_NoMemory(); + repr = PyString_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) - return repr; + return repr; p = q = PyString_AS_STRING(repr); 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++ = hexdigit[(ch >> 28) & 0xf]; @@ -3208,34 +3208,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++ = hexdigit[(ucs >> 28) & 0xf]; - *p++ = hexdigit[(ucs >> 24) & 0xf]; - *p++ = hexdigit[(ucs >> 20) & 0xf]; - *p++ = hexdigit[(ucs >> 16) & 0xf]; - *p++ = hexdigit[(ucs >> 12) & 0xf]; - *p++ = hexdigit[(ucs >> 8) & 0xf]; - *p++ = hexdigit[(ucs >> 4) & 0xf]; - *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0xf]; + *p++ = hexdigit[(ucs >> 24) & 0xf]; + *p++ = hexdigit[(ucs >> 20) & 0xf]; + *p++ = hexdigit[(ucs >> 16) & 0xf]; + *p++ = hexdigit[(ucs >> 12) & 0xf]; + *p++ = hexdigit[(ucs >> 8) & 0xf]; + *p++ = hexdigit[(ucs >> 4) & 0xf]; + *p++ = hexdigit[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++ = hexdigit[(ch >> 12) & 0xf]; @@ -3243,8 +3243,8 @@ *p++ = hexdigit[(ch >> 4) & 0xf]; *p++ = hexdigit[ch & 15]; } - /* Copy everything else as-is */ - else + /* Copy everything else as-is */ + else *p++ = (char) ch; } *p = '\0'; @@ -3255,18 +3255,18 @@ PyObject *PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3286,9 +3286,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; @@ -3343,26 +3343,26 @@ /* --- 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; /* 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); while (size-- > 0) - *p++ = (unsigned char)*s++; + *p++ = (unsigned char)*s++; return (PyObject *)v; onError: @@ -3378,20 +3378,20 @@ 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; } } @@ -3403,9 +3403,9 @@ 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: @@ -3425,36 +3425,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); @@ -3462,9 +3462,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; @@ -3492,139 +3492,139 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; str = PyString_AS_STRING(res); 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 (_PyString_Resize(&res, requiredsize)) - goto onError; - str = PyString_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-PyString_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyString_Resize(&res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyString_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 (_PyString_Resize(&res, requiredsize)) + goto onError; + str = PyString_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-PyString_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyString_Resize(&res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyString_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 */ respos = str-PyString_AS_STRING(res); if (respos= 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 @@ -3849,8 +3849,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); } @@ -3860,8 +3860,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; @@ -3870,41 +3870,41 @@ /* 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 = PyString_FromStringAndSize(NULL, mbcssize); - if (*repr == NULL) - return -1; + /* Create string object */ + *repr = PyString_FromStringAndSize(NULL, mbcssize); + if (*repr == NULL) + return -1; } else { - /* Extend string object */ - n = PyString_Size(*repr); - if (_PyString_Resize(repr, n + mbcssize) < 0) - return -1; + /* Extend string object */ + n = PyString_Size(*repr); + if (_PyString_Resize(repr, n + mbcssize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - char *s = PyString_AS_STRING(*repr) + n; - if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + char *s = PyString_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; @@ -3912,21 +3912,21 @@ #ifdef NEED_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 @@ -3940,8 +3940,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -3951,9 +3951,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; @@ -3970,136 +3970,136 @@ /* 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, size, &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, size, &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 = PyInt_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 (PyInt_Check(x)) { - long value = PyInt_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, size, &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 unicode"); - 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 = PyInt_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 (PyInt_Check(x)) { + long value = PyInt_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, size, &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 unicode"); + 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; @@ -4124,12 +4124,12 @@ encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; - return PyInt_FromLong(sizeof(*map) - 1 + 16*map->count2 + + return PyInt_FromLong(sizeof(*map) - 1 + 16*map->count2 + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { - {"size", encoding_map_size, METH_NOARGS, + {"size", encoding_map_size, METH_NOARGS, PyDoc_STR("Return the size (in bytes) of this object") }, { 0 } }; @@ -4137,11 +4137,11 @@ static void encoding_map_dealloc(PyObject* o) { - PyObject_FREE(o); + PyObject_FREE(o); } static PyTypeObject EncodingMapType = { - PyVarObject_HEAD_INIT(NULL, 0) + PyVarObject_HEAD_INIT(NULL, 0) "EncodingMap", /*tp_name*/ sizeof(struct encoding_map), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -4228,7 +4228,7 @@ if (level1[l1] == 0xFF) level1[l1] = count2++; if (level2[l2] == 0xFF) - level2[l2] = count3++; + level2[l2] = count3++; } if (count2 >= 0xFF || count3 >= 0xFF) @@ -4302,7 +4302,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4334,57 +4334,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 (PyInt_Check(x)) { - long value = PyInt_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 = PyInt_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 (PyString_Check(x)) - return x; + return x; else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - return NULL; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + return NULL; } } static int charmapencode_resize(PyObject **outobj, Py_ssize_t *outpos, Py_ssize_t requiredsize) { - Py_ssize_t outsize = PyString_GET_SIZE(*outobj); - /* exponentially overallocate to minimize reallocations */ - if (requiredsize < 2*outsize) - requiredsize = 2*outsize; - if (_PyString_Resize(outobj, requiredsize)) { - return 0; - } - return 1; + Py_ssize_t outsize = PyString_GET_SIZE(*outobj); + /* exponentially overallocate to minimize reallocations */ + if (requiredsize < 2*outsize) + requiredsize = 2*outsize; + if (_PyString_Resize(outobj, requiredsize)) { + return 0; + } + return 1; } -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. Reallocate the output string if not enough @@ -4402,47 +4402,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; @@ -4586,7 +4586,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 */ @@ -4594,30 +4594,30 @@ 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 */ if (respossize) { - 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); @@ -4745,44 +4745,44 @@ 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 (PyInt_Check(x)) { - long value = PyInt_AS_LONG(x); - long max = PyUnicode_GetMax(); - if (value < 0 || value > max) { - PyErr_Format(PyExc_TypeError, - "character mapping must be in range(0x%lx)", max+1); - Py_DECREF(x); - return -1; - } - *result = x; - return 0; + long value = PyInt_AS_LONG(x); + long max = PyUnicode_GetMax(); + if (value < 0 || value > max) { + PyErr_Format(PyExc_TypeError, + "character mapping must be in range(0x%lx)", max+1); + 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 unicode"); - Py_DECREF(x); - return -1; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or unicode"); + Py_DECREF(x); + return -1; } } /* ensure that *outobj is at least requiredsize characters long, @@ -4794,14 +4794,14 @@ { 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; } @@ -4817,43 +4817,43 @@ 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 (PyInt_Check(*res)) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = (Py_UNICODE)PyInt_AS_LONG(*res); + /* no overflow check, because we know that the space is enough */ + *(*outp)++ = (Py_UNICODE)PyInt_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; @@ -4873,113 +4873,113 @@ 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'; @@ -5180,11 +5180,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); @@ -5209,11 +5209,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) @@ -5237,10 +5237,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; @@ -5249,39 +5249,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; @@ -5292,24 +5292,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; } @@ -5322,13 +5322,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++; } @@ -5343,13 +5343,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++; } @@ -5385,10 +5385,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) { @@ -5410,31 +5410,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 (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 (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5457,7 +5457,7 @@ fseq = PySequence_Fast(seq, ""); if (fseq == NULL) { - return NULL; + return NULL; } /* Grrrr. A codec may be invoked to convert str objects to @@ -5470,34 +5470,34 @@ 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; } /* If singleton sequence with an exact Unicode, return that. */ if (seqlen == 1) { - item = PySequence_Fast_GET_ITEM(fseq, 0); - if (PyUnicode_CheckExact(item)) { - Py_INCREF(item); - res = (PyUnicodeObject *)item; - goto Done; - } + item = PySequence_Fast_GET_ITEM(fseq, 0); + if (PyUnicode_CheckExact(item)) { + Py_INCREF(item); + res = (PyUnicodeObject *)item; + goto Done; + } } /* At least two items to join, or one that isn't exact Unicode. */ if (seqlen > 1) { /* Set up sep and seplen -- they're needed. */ - if (separator == NULL) { - sep = ␣ - seplen = 1; - } - else { - internal_separator = PyUnicode_FromObject(separator); - if (internal_separator == NULL) - goto onError; - sep = PyUnicode_AS_UNICODE(internal_separator); - seplen = PyUnicode_GET_SIZE(internal_separator); - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + if (separator == NULL) { + sep = ␣ + seplen = 1; + } + else { + internal_separator = PyUnicode_FromObject(separator); + if (internal_separator == NULL) + goto onError; + sep = PyUnicode_AS_UNICODE(internal_separator); + seplen = PyUnicode_GET_SIZE(internal_separator); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); } } @@ -5509,66 +5509,66 @@ res_used = 0; for (i = 0; i < seqlen; ++i) { - Py_ssize_t itemlen; - Py_ssize_t new_res_used; + Py_ssize_t itemlen; + Py_ssize_t new_res_used; - item = PySequence_Fast_GET_ITEM(fseq, i); - /* Convert item to Unicode. */ - if (! PyUnicode_Check(item) && ! PyString_Check(item)) { - PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected string or Unicode," - " %.80s found", - i, Py_TYPE(item)->tp_name); - goto onError; - } - item = PyUnicode_FromObject(item); - if (item == NULL) - goto onError; - /* We own a reference to item from here on. */ + item = PySequence_Fast_GET_ITEM(fseq, i); + /* Convert item to Unicode. */ + if (! PyUnicode_Check(item) && ! PyString_Check(item)) { + PyErr_Format(PyExc_TypeError, + "sequence item %zd: expected string or Unicode," + " %.80s found", + i, Py_TYPE(item)->tp_name); + goto onError; + } + item = PyUnicode_FromObject(item); + if (item == NULL) + goto onError; + /* We own a reference to item from here on. */ - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); /* Make sure we have enough space for the separator and the item. */ - itemlen = PyUnicode_GET_SIZE(item); - new_res_used = res_used + itemlen; - if (new_res_used < 0) - goto Overflow; - if (i < seqlen - 1) { - new_res_used += seplen; - if (new_res_used < 0) - goto Overflow; - } - if (new_res_used > res_alloc) { - /* double allocated size until it's big enough */ - do { - res_alloc += res_alloc; - if (res_alloc <= 0) - goto Overflow; - } while (new_res_used > res_alloc); - if (_PyUnicode_Resize(&res, res_alloc) < 0) { - Py_DECREF(item); - goto onError; - } + itemlen = PyUnicode_GET_SIZE(item); + new_res_used = res_used + itemlen; + if (new_res_used < 0) + goto Overflow; + if (i < seqlen - 1) { + new_res_used += seplen; + if (new_res_used < 0) + goto Overflow; + } + if (new_res_used > res_alloc) { + /* double allocated size until it's big enough */ + do { + res_alloc += res_alloc; + if (res_alloc <= 0) + goto Overflow; + } while (new_res_used > res_alloc); + if (_PyUnicode_Resize(&res, res_alloc) < 0) { + Py_DECREF(item); + goto onError; + } res_p = PyUnicode_AS_UNICODE(res) + res_used; - } + } - /* Copy item, and maybe the separator. */ - Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); - res_p += itemlen; - if (i < seqlen - 1) { - Py_UNICODE_COPY(res_p, sep, seplen); - res_p += seplen; - } - Py_DECREF(item); - res_used = new_res_used; + /* Copy item, and maybe the separator. */ + Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); + res_p += itemlen; + if (i < seqlen - 1) { + Py_UNICODE_COPY(res_p, sep, seplen); + res_p += seplen; + } + Py_DECREF(item); + res_used = new_res_used; } /* Shrink res to match the used area; this probably can't fail, * but it's cheap to check. */ if (_PyUnicode_Resize(&res, res_used) < 0) - goto onError; + goto onError; Done: Py_XDECREF(internal_separator); @@ -5590,9 +5590,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; @@ -5623,21 +5623,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 \ +#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; @@ -5646,23 +5646,23 @@ 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; @@ -5672,7 +5672,7 @@ } PyObject *PyUnicode_Splitlines(PyObject *string, - int keepends) + int keepends) { register Py_ssize_t i; register Py_ssize_t j; @@ -5683,7 +5683,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -5692,28 +5692,28 @@ 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); @@ -5727,9 +5727,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; @@ -5738,16 +5738,16 @@ 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; @@ -5758,9 +5758,9 @@ 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; @@ -5769,16 +5769,16 @@ 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; @@ -5789,8 +5789,8 @@ 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; @@ -5799,23 +5799,23 @@ 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; @@ -5826,11 +5826,11 @@ 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; @@ -5839,16 +5839,16 @@ 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; @@ -5859,11 +5859,11 @@ 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; @@ -5872,17 +5872,17 @@ 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; @@ -5897,8 +5897,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -5910,24 +5910,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; @@ -5939,30 +5939,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 */ @@ -6048,7 +6048,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6136,7 +6136,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)); @@ -6157,26 +6157,26 @@ 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__, @@ -6241,9 +6241,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 */ @@ -6287,7 +6287,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { PyUnicodeObject *u = NULL, *v = NULL; int result; @@ -6295,16 +6295,16 @@ /* 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; /* Shortcut for empty or interned objects */ if (v == u) { - Py_DECREF(u); - Py_DECREF(v); - return 0; + Py_DECREF(u); + Py_DECREF(v); + return 0; } result = unicode_compare(u, v); @@ -6381,8 +6381,8 @@ if (!PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) return NULL; PyErr_Clear(); - if (PyErr_Warn(PyExc_UnicodeWarning, - (op == Py_EQ) ? + if (PyErr_Warn(PyExc_UnicodeWarning, + (op == Py_EQ) ? "Unicode equal comparison " "failed to convert both arguments to Unicode - " "interpreting them as being unequal" : @@ -6396,7 +6396,7 @@ } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6404,8 +6404,8 @@ /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_SetString(PyExc_TypeError, - "'in ' requires string as left operand"); + PyErr_SetString(PyExc_TypeError, + "'in ' requires string as left operand"); return -1; } @@ -6426,32 +6426,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); @@ -6481,13 +6481,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); @@ -6517,7 +6517,7 @@ char *encoding = NULL; char *errors = NULL; PyObject *v; - + if (!PyArg_ParseTuple(args, "|ss:encode", &encoding, &errors)) return NULL; v = PyUnicode_AsEncodedObject((PyObject *)self, encoding, errors); @@ -6553,7 +6553,7 @@ char *encoding = NULL; char *errors = NULL; PyObject *v; - + if (!PyArg_ParseTuple(args, "|ss:decode", &encoding, &errors)) return NULL; v = PyUnicode_AsDecodedObject((PyObject *)self, encoding, errors); @@ -6591,7 +6591,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 */ @@ -6599,27 +6599,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); @@ -6632,20 +6632,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++ = ' '; + 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; + } + } + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -6716,15 +6716,15 @@ register long x; if (self->hash != -1) - return self->hash; + return self->hash; len = PyUnicode_GET_SIZE(self); p = PyUnicode_AS_UNICODE(self); x = *p << 7; while (--len >= 0) - x = (1000003*x) ^ *p++; + x = (1000003*x) ^ *p++; x ^= PyUnicode_GET_SIZE(self); if (x == -1) - x = -2; + x = -2; self->hash = x; return x; } @@ -6776,21 +6776,21 @@ /* 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); } @@ -6810,21 +6810,21 @@ /* 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); } @@ -6846,33 +6846,33 @@ /* 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); } @@ -6891,17 +6891,17 @@ /* 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); } @@ -6920,17 +6920,17 @@ /* 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); } @@ -6949,17 +6949,17 @@ /* 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); } @@ -6978,17 +6978,17 @@ /* 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); } @@ -7007,17 +7007,17 @@ /* 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); } @@ -7036,17 +7036,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); } @@ -7116,34 +7116,34 @@ 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; + 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) { + i = 0; + if (striptype != RIGHTSTRIP) { while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { i++; } - } + } - j = len; - if (striptype != LEFTSTRIP) { + 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)) { + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { Py_INCREF(self); return (PyObject*)self; - } - else + } + else return PyUnicode_FromUnicode(s+i, j-i); } @@ -7151,62 +7151,62 @@ 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++; + } + } - 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); + 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); } 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 if (PyString_Check(sep)) { - PyObject *res; - sep = PyUnicode_FromObject(sep); - if (sep==NULL) - return NULL; - res = _PyUnicode_XStrip(self, striptype, sep); - Py_DECREF(sep); - return res; - } - else { - PyErr_Format(PyExc_TypeError, - "%s arg must be None, unicode or str", - STRIPNAME(striptype)); - return NULL; - } - } + if (sep != NULL && sep != Py_None) { + if (PyUnicode_Check(sep)) + return _PyUnicode_XStrip(self, striptype, sep); + else if (PyString_Check(sep)) { + PyObject *res; + sep = PyUnicode_FromObject(sep); + if (sep==NULL) + return NULL; + res = _PyUnicode_XStrip(self, striptype, sep); + Py_DECREF(sep); + return res; + } + else { + PyErr_Format(PyExc_TypeError, + "%s arg must be None, unicode or str", + STRIPNAME(striptype)); + return NULL; + } + } - return do_strip(self, striptype); + return do_strip(self, striptype); } @@ -7221,10 +7221,10 @@ 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); } @@ -7238,10 +7238,10 @@ 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); } @@ -7255,10 +7255,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); } @@ -7303,25 +7303,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; @@ -7330,22 +7330,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); @@ -7371,11 +7371,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); @@ -7389,8 +7389,8 @@ PyObject *unicode_repr(PyObject *unicode) { return unicodeescape_string(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - 1); + PyUnicode_GET_SIZE(unicode), + 1); } PyDoc_STRVAR(rfind__doc__, @@ -7411,7 +7411,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), @@ -7438,7 +7438,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), @@ -7497,24 +7497,24 @@ start = end; /* copy slice */ return (PyObject*) PyUnicode_FromUnicode(self->str + start, - end - start); + end - start); } 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); @@ -7543,11 +7543,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 * @@ -7559,7 +7559,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); @@ -7587,7 +7587,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); @@ -7632,20 +7632,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); @@ -7674,11 +7674,11 @@ 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__, @@ -7730,9 +7730,9 @@ unicode_translate(PyUnicodeObject *self, PyObject *table) { return PyUnicode_TranslateCharmap(self->str, - self->length, - table, - "ignore"); + self->length, + table, + "ignore"); } PyDoc_STRVAR(upper__doc__, @@ -7808,7 +7808,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7817,8 +7817,8 @@ 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++) { @@ -7854,7 +7854,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7864,7 +7864,7 @@ if (!PyArg_ParseTuple(args, "O|O&O&:endswith", &subobj, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { @@ -7911,7 +7911,7 @@ goto done; if (!(PyBytes_Check(format_spec) || PyUnicode_Check(format_spec))) { PyErr_Format(PyExc_TypeError, "__format__ arg must be str " - "or unicode, not %s", Py_TYPE(format_spec)->tp_name); + "or unicode, not %s", Py_TYPE(format_spec)->tp_name); goto done; } tmp = PyObject_Unicode(format_spec); @@ -7947,7 +7947,7 @@ static PyObject * unicode_getnewargs(PyUnicodeObject *v) { - return Py_BuildValue("(u#)", v->str, v->length); + return Py_BuildValue("(u#)", v->str, v->length); } @@ -8010,7 +8010,7 @@ {"freelistsize", (PyCFunction) free_listsize, METH_NOARGS}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, {NULL, NULL} }; @@ -8025,22 +8025,22 @@ } static PyNumberMethods unicode_as_number = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - 0, /*nb_divide*/ - unicode_mod, /*nb_remainder*/ + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 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 */ - (ssizessizeargfunc) unicode_slice, /* 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 */ + (ssizessizeargfunc) unicode_slice, /* sq_slice */ + 0, /* sq_ass_item */ + 0, /* sq_ass_slice */ + PyUnicode_Contains, /* sq_contains */ }; static PyObject* @@ -8060,7 +8060,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8076,9 +8076,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]; @@ -8095,19 +8095,19 @@ } 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 */ }; static Py_ssize_t unicode_buffer_getreadbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } *ptr = (void *) self->str; @@ -8116,16 +8116,16 @@ static Py_ssize_t unicode_buffer_getwritebuf(PyUnicodeObject *self, Py_ssize_t index, - const void **ptr) + const void **ptr) { PyErr_SetString(PyExc_TypeError, - "cannot use unicode as modifiable buffer"); + "cannot use unicode as modifiable buffer"); return -1; } static int unicode_buffer_getsegcount(PyUnicodeObject *self, - Py_ssize_t *lenp) + Py_ssize_t *lenp) { if (lenp) *lenp = PyUnicode_GET_DATA_SIZE(self); @@ -8134,19 +8134,19 @@ static Py_ssize_t unicode_buffer_getcharbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { PyObject *str; if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } str = _PyUnicode_AsDefaultEncodedString((PyObject *)self, NULL); if (str == NULL) - return -1; + return -1; *ptr = (void *) PyString_AS_STRING(str); return PyString_GET_SIZE(str); } @@ -8158,22 +8158,22 @@ { 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; } #define F_LJUST (1<<0) -#define F_SIGN (1<<1) +#define F_SIGN (1<<1) #define F_BLANK (1<<2) -#define F_ALT (1<<3) -#define F_ZERO (1<<4) +#define F_ALT (1<<3) +#define F_ZERO (1<<4) static Py_ssize_t strtounicode(Py_UNICODE *buffer, const char *charbuffer) @@ -8181,7 +8181,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; } @@ -8212,11 +8212,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)*/ @@ -8225,70 +8225,70 @@ 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') && + 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; + (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 i, len; - PyObject *str; /* temporary string object. */ - PyUnicodeObject *result; - - str = _PyString_FormatLong(val, flags, prec, type, &buf, &len); - if (!str) - return NULL; - result = _PyUnicode_New(len); - if (!result) { - Py_DECREF(str); - return NULL; - } - for (i = 0; i < len; i++) - result->str[i] = buf[i]; - result->str[len] = 0; - Py_DECREF(str); - return (PyObject*)result; + char *buf; + int i, len; + PyObject *str; /* temporary string object. */ + PyUnicodeObject *result; + + str = _PyString_FormatLong(val, flags, prec, type, &buf, &len); + if (!str) + return NULL; + result = _PyUnicode_New(len); + if (!result) { + Py_DECREF(str); + return NULL; + } + for (i = 0; i < len; i++) + result->str[i] = buf[i]; + result->str[len] = 0; + Py_DECREF(str); + return (PyObject*)result; } 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) @@ -8317,7 +8317,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; } @@ -8364,46 +8364,46 @@ { /* presume that the buffer is at least 2 characters long */ if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) != 1) - goto onError; - buf[0] = PyUnicode_AS_UNICODE(v)[0]; + if (PyUnicode_GET_SIZE(v) != 1) + goto onError; + buf[0] = PyUnicode_AS_UNICODE(v)[0]; } else if (PyString_Check(v)) { - if (PyString_GET_SIZE(v) != 1) - goto onError; - buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; + if (PyString_GET_SIZE(v) != 1) + goto onError; + buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; } else { - /* Integer input truncated to a character */ + /* Integer input truncated to a character */ long x; - x = PyInt_AsLong(v); - if (x == -1 && PyErr_Occurred()) - goto onError; + x = PyInt_AsLong(v); + if (x == -1 && PyErr_Occurred()) + goto onError; #ifdef Py_UNICODE_WIDE - if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000) " - "(wide Python build)"); - return -1; - } + if (x < 0 || x > 0x10ffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x110000) " + "(wide Python build)"); + return -1; + } #else - if (x < 0 || x > 0xffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x10000) " - "(narrow Python build)"); - return -1; - } + if (x < 0 || x > 0xffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x10000) " + "(narrow Python build)"); + return -1; + } #endif - buf[0] = (Py_UNICODE) x; + buf[0] = (Py_UNICODE) x; } buf[1] = '\0'; return 1; onError: PyErr_SetString(PyExc_TypeError, - "%c requires int or char"); + "%c requires int or char"); return -1; } @@ -8418,7 +8418,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; @@ -8428,440 +8428,440 @@ 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) && !PyObject_TypeCheck(args, &PyBaseString_Type)) - 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - width = PyInt_AsLong(v); - 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - prec = PyInt_AsLong(v); - 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': - if (PyUnicode_Check(v) && c == 's') { - temp = v; - Py_INCREF(temp); - } - else { - PyObject *unicode; - if (c == 's') - temp = PyObject_Unicode(v); - else - temp = PyObject_Repr(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 (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + width = PyInt_AsLong(v); + 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 (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + prec = PyInt_AsLong(v); + 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': + if (PyUnicode_Check(v) && c == 's') { + temp = v; + Py_INCREF(temp); + } + else { + PyObject *unicode; + if (c == 's') + temp = PyObject_Unicode(v); + else + temp = PyObject_Repr(v); + if (temp == NULL) + goto onError; if (PyUnicode_Check(temp)) /* nothing to do */; else if (PyString_Check(temp)) { /* convert to string to Unicode */ - unicode = PyUnicode_Decode(PyString_AS_STRING(temp), - PyString_GET_SIZE(temp), - NULL, - "strict"); - Py_DECREF(temp); - temp = unicode; - if (temp == NULL) - goto onError; - } - 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 (PyInt_Check(v) || (PyLong_Check(v))) { - iobj = v; - Py_INCREF(iobj); - } - else { - iobj = PyNumber_Int(v); - if (iobj==NULL) iobj = PyNumber_Long(v); - } - if (iobj!=NULL) { - if (PyInt_Check(iobj)) { - isnumok = 1; - pbuf = formatbuf; - len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, iobj); - Py_DECREF(iobj); - if (len < 0) - goto onError; - sign = 1; - } - else 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, " + unicode = PyUnicode_Decode(PyString_AS_STRING(temp), + PyString_GET_SIZE(temp), + NULL, + "strict"); + Py_DECREF(temp); + temp = unicode; + if (temp == NULL) + goto onError; + } + 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 (PyInt_Check(v) || (PyLong_Check(v))) { + iobj = v; + Py_INCREF(iobj); + } + else { + iobj = PyNumber_Int(v); + if (iobj==NULL) iobj = PyNumber_Long(v); + } + if (iobj!=NULL) { + if (PyInt_Check(iobj)) { + isnumok = 1; + pbuf = formatbuf; + len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), + flags, prec, c, iobj); + Py_DECREF(iobj); + if (len < 0) + goto onError; + sign = 1; + } + else 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 : '?', + 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')) { - 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')) { - 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')) { + 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')) { + 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; @@ -8870,7 +8870,7 @@ Py_XDECREF(result); Py_DECREF(uformat); if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } return NULL; } @@ -8889,51 +8889,51 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = NULL; - static char *kwlist[] = {"string", "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:unicode", - kwlist, &x, &encoding, &errors)) - return NULL; - if (x == NULL) - return (PyObject *)_PyUnicode_New(0); - if (encoding == NULL && errors == NULL) - return PyObject_Unicode(x); - else - return PyUnicode_FromEncodedObject(x, encoding, errors); + static char *kwlist[] = {"string", "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:unicode", + kwlist, &x, &encoding, &errors)) + return NULL; + if (x == NULL) + return (PyObject *)_PyUnicode_New(0); + if (encoding == NULL && errors == NULL) + return PyObject_Unicode(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, @@ -8945,46 +8945,46 @@ PyTypeObject PyUnicode_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "unicode", /* tp_name */ - sizeof(PyUnicodeObject), /* tp_size */ - 0, /* tp_itemsize */ + "unicode", /* 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 */ - &unicode_as_buffer, /* tp_as_buffer */ + (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 */ + &unicode_as_buffer, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | - 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 */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - unicode_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &PyBaseString_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 */ + 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 */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + unicode_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyBaseString_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 */ @@ -9010,13 +9010,13 @@ numfree = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) - return; + return; strcpy(unicode_default_encoding, "ascii"); 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( @@ -9035,13 +9035,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); @@ -9057,10 +9057,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(); } From python-checkins at python.org Sat Jan 31 17:34:44 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 17:34:44 +0100 (CET) Subject: [Python-checkins] r69135 - python/branches/release26-maint/Objects/unicodeobject.c Message-ID: <20090131163444.B932F1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 17:34:44 2009 New Revision: 69135 Log: expand tabs in unicodeobject.c Modified: python/branches/release26-maint/Objects/unicodeobject.c Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Sat Jan 31 17:34:44 2009 @@ -114,59 +114,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 }; @@ -174,11 +174,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 } @@ -238,16 +238,16 @@ /* 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 unicode objects"); return -1; @@ -260,9 +260,9 @@ 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; } @@ -309,33 +309,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() @@ -363,26 +363,26 @@ void unicode_dealloc(register PyUnicodeObject *unicode) { 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); } } @@ -393,28 +393,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 @@ -428,7 +428,7 @@ } PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -436,26 +436,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); @@ -464,7 +464,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; } @@ -473,11 +473,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. @@ -485,26 +485,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); } @@ -530,13 +530,13 @@ #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) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } unicode = _PyUnicode_New(size); @@ -548,11 +548,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 @@ -562,23 +562,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++;} @@ -586,373 +586,373 @@ 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 format specifications - * (we call PyObject_Str()/PyObject_Repr() for these objects - * once during step 3 and put the result in an array) */ - for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) - ++callcount; - } - /* 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')) + /* step 1: count the number of %S/%R format specifications + * (we call PyObject_Str()/PyObject_Repr() for these objects + * once during step 3 and put the result in an array) */ + for (f = format; *f; f++) { + if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) + ++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 '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++; - } + 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 '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; - } + 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; + 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; + if (callresults) { + PyObject **callresult2 = callresults; + while (callresult2 < callresult) { + Py_DECREF(*callresult2); + ++callresult2; + } + PyObject_Free(callresults); + } + if (abuffer) + PyObject_Free(abuffer); + return NULL; } #undef appendstring @@ -960,41 +960,41 @@ 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 @@ -1012,17 +1012,17 @@ #ifdef Py_UNICODE_WIDE if (ordinal < 0 || ordinal > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x110000) " - "(wide Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x110000) " + "(wide Python build)"); + return NULL; } #else if (ordinal < 0 || ordinal > 0xffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x10000) " - "(narrow Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x10000) " + "(narrow Python build)"); + return NULL; } #endif @@ -1035,29 +1035,29 @@ /* XXX Perhaps we should make this API an alias of PyObject_Unicode() 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)); } return PyUnicode_FromEncodedObject(obj, NULL, "strict"); } 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 0 @@ -1070,26 +1070,26 @@ represent *encoded* Unicode ! */ - if (PyUnicode_Check(obj)) { - if (encoding) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; - } - return PyObject_Unicode(obj); - } + if (PyUnicode_Check(obj)) { + if (encoding) { + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; + } + return PyObject_Unicode(obj); + } #else if (PyUnicode_Check(obj)) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; - } + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; + } #endif /* Coerce object */ if (PyString_Check(obj)) { - s = PyString_AS_STRING(obj); - len = PyString_GET_SIZE(obj); + s = PyString_AS_STRING(obj); + len = PyString_GET_SIZE(obj); } else if (PyByteArray_Check(obj)) { /* Python 2.x specific */ @@ -1098,23 +1098,23 @@ return NULL; } 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)) - PyErr_Format(PyExc_TypeError, - "coercing to Unicode: need string or buffer, " - "%.80s found", - Py_TYPE(obj)->tp_name); - goto onError; + /* Overwrite the error message with something more useful in + case of a TypeError. */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_Format(PyExc_TypeError, + "coercing to Unicode: 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; @@ -1123,14 +1123,14 @@ } 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; if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (strcmp(encoding, "utf-8") == 0) @@ -1178,7 +1178,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1191,15 +1191,15 @@ } 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; @@ -1217,7 +1217,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1241,20 +1241,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); } /* Encode via the codec registry */ @@ -1275,7 +1275,7 @@ } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; @@ -1324,11 +1324,11 @@ loads the encoding into the codec registry cache. */ v = _PyCodec_Lookup(encoding); if (v == NULL) - goto onError; + goto onError; Py_DECREF(v); strncpy(unicode_default_encoding, - encoding, - sizeof(unicode_default_encoding)); + encoding, + sizeof(unicode_default_encoding)); return 0; onError: @@ -1361,40 +1361,40 @@ 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, insize, *startinpos, *endinpos, reason); - if (*exceptionObject == NULL) - goto onError; + *exceptionObject = PyUnicodeDecodeError_Create( + encoding, input, insize, *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; 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 @@ -1405,11 +1405,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; @@ -1432,10 +1432,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, @@ -1491,16 +1491,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; @@ -1565,7 +1565,7 @@ } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -1592,7 +1592,7 @@ startinpos = s-starts; errmsg = "unexpected special character"; s++; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; @@ -1664,7 +1664,7 @@ return PyErr_NoMemory(); if (size == 0) - return PyString_FromStringAndSize(NULL, 0); + return PyString_FromStringAndSize(NULL, 0); v = PyString_FromStringAndSize(NULL, cbAllocated); if (v == NULL) @@ -1772,16 +1772,16 @@ }; 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); } 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; @@ -1822,72 +1822,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: @@ -1895,25 +1895,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); /* 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: */ @@ -1931,24 +1931,24 @@ 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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + errors, &errorHandler, + "utf8", errmsg, + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -1972,8 +1972,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 */ @@ -2038,7 +2038,7 @@ *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; - } + } encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); @@ -2055,7 +2055,7 @@ v = PyString_FromStringAndSize(stackbuf, nneeded); } else { - /* Cut back to size actually needed. */ + /* Cut back to size actually needed. */ nneeded = p - PyString_AS_STRING(v); assert(nneeded <= nallocated); _PyString_Resize(&v, nneeded); @@ -2072,27 +2072,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; @@ -2120,8 +2120,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 */ @@ -2148,25 +2148,25 @@ const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | (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) { @@ -2185,54 +2185,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; + 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); + outpos = p-PyUnicode_AS_UNICODE(unicode); if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf32", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, &unicode, &outpos, &p)) - goto onError; + 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) @@ -2251,9 +2251,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; @@ -2283,21 +2283,21 @@ 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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2317,16 +2317,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); } @@ -2341,28 +2341,28 @@ 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); } 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; @@ -2406,25 +2406,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) { @@ -2439,74 +2439,74 @@ } while (q < e) { - Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[ihi] << 8) | q[ilo]; - - q += 2; - - 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)-starts; - goto utf16Error; - } - if (0xD800 <= ch && ch <= 0xDBFF) { - Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; - q += 2; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + Py_UNICODE ch; + /* remaining bytes at the end? (size should be even) */ + if (e-q<2) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf16Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + ch = (q[ihi] << 8) | q[ilo]; + + q += 2; + + 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)-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 */ + 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, - starts, size, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf16", errmsg, + starts, size, &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) @@ -2525,9 +2525,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; @@ -2553,24 +2553,24 @@ #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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2586,13 +2586,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) @@ -2609,9 +2609,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 ----------------------------------------------- */ @@ -2619,8 +2619,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; @@ -2917,7 +2917,7 @@ */ if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyString_FromStringAndSize(NULL, 2 @@ -2938,10 +2938,10 @@ /* Escape quotes and backslashes */ if ((quotes && - ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { + ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { *p++ = '\\'; *p++ = (char) ch; - continue; + continue; } #ifdef Py_UNICODE_WIDE @@ -2957,34 +2957,34 @@ *p++ = hexdigit[(ch >> 8) & 0x0000000F]; *p++ = hexdigit[(ch >> 4) & 0x0000000F]; *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; + *p++ = hexdigit[ucs & 0x0000000F]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; + } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3032,7 +3032,7 @@ } PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { return unicodeescape_string(s, size, 0); } @@ -3044,14 +3044,14 @@ return NULL; } return PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3070,63 +3070,63 @@ 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, size, &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, size, &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; @@ -3146,15 +3146,15 @@ if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; + starts, size, &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; @@ -3167,7 +3167,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3179,22 +3179,22 @@ #else const Py_ssize_t expandsize = 6; #endif - + if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); - + return PyErr_NoMemory(); + repr = PyString_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) - return repr; + return repr; p = q = PyString_AS_STRING(repr); 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++ = hexdigit[(ch >> 28) & 0xf]; @@ -3208,34 +3208,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++ = hexdigit[(ucs >> 28) & 0xf]; - *p++ = hexdigit[(ucs >> 24) & 0xf]; - *p++ = hexdigit[(ucs >> 20) & 0xf]; - *p++ = hexdigit[(ucs >> 16) & 0xf]; - *p++ = hexdigit[(ucs >> 12) & 0xf]; - *p++ = hexdigit[(ucs >> 8) & 0xf]; - *p++ = hexdigit[(ucs >> 4) & 0xf]; - *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0xf]; + *p++ = hexdigit[(ucs >> 24) & 0xf]; + *p++ = hexdigit[(ucs >> 20) & 0xf]; + *p++ = hexdigit[(ucs >> 16) & 0xf]; + *p++ = hexdigit[(ucs >> 12) & 0xf]; + *p++ = hexdigit[(ucs >> 8) & 0xf]; + *p++ = hexdigit[(ucs >> 4) & 0xf]; + *p++ = hexdigit[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++ = hexdigit[(ch >> 12) & 0xf]; @@ -3243,8 +3243,8 @@ *p++ = hexdigit[(ch >> 4) & 0xf]; *p++ = hexdigit[ch & 15]; } - /* Copy everything else as-is */ - else + /* Copy everything else as-is */ + else *p++ = (char) ch; } *p = '\0'; @@ -3255,18 +3255,18 @@ PyObject *PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3286,9 +3286,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; @@ -3343,26 +3343,26 @@ /* --- 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; /* 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); while (size-- > 0) - *p++ = (unsigned char)*s++; + *p++ = (unsigned char)*s++; return (PyObject *)v; onError: @@ -3378,20 +3378,20 @@ 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; } } @@ -3403,9 +3403,9 @@ 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: @@ -3425,36 +3425,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); @@ -3462,9 +3462,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; @@ -3492,139 +3492,139 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; str = PyString_AS_STRING(res); 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 (_PyString_Resize(&res, requiredsize)) - goto onError; - str = PyString_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-PyString_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyString_Resize(&res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyString_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 (_PyString_Resize(&res, requiredsize)) + goto onError; + str = PyString_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-PyString_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyString_Resize(&res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyString_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 */ respos = str-PyString_AS_STRING(res); if (respos= 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 @@ -3849,8 +3849,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); } @@ -3860,8 +3860,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; @@ -3870,41 +3870,41 @@ /* 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 = PyString_FromStringAndSize(NULL, mbcssize); - if (*repr == NULL) - return -1; + /* Create string object */ + *repr = PyString_FromStringAndSize(NULL, mbcssize); + if (*repr == NULL) + return -1; } else { - /* Extend string object */ - n = PyString_Size(*repr); - if (_PyString_Resize(repr, n + mbcssize) < 0) - return -1; + /* Extend string object */ + n = PyString_Size(*repr); + if (_PyString_Resize(repr, n + mbcssize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - char *s = PyString_AS_STRING(*repr) + n; - if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + char *s = PyString_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; @@ -3912,21 +3912,21 @@ #ifdef NEED_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 @@ -3940,8 +3940,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -3951,9 +3951,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; @@ -3970,136 +3970,136 @@ /* 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, size, &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, size, &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 = PyInt_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 (PyInt_Check(x)) { - long value = PyInt_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, size, &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 unicode"); - 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 = PyInt_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 (PyInt_Check(x)) { + long value = PyInt_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, size, &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 unicode"); + 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; @@ -4124,12 +4124,12 @@ encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; - return PyInt_FromLong(sizeof(*map) - 1 + 16*map->count2 + + return PyInt_FromLong(sizeof(*map) - 1 + 16*map->count2 + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { - {"size", encoding_map_size, METH_NOARGS, + {"size", encoding_map_size, METH_NOARGS, PyDoc_STR("Return the size (in bytes) of this object") }, { 0 } }; @@ -4137,11 +4137,11 @@ static void encoding_map_dealloc(PyObject* o) { - PyObject_FREE(o); + PyObject_FREE(o); } static PyTypeObject EncodingMapType = { - PyVarObject_HEAD_INIT(NULL, 0) + PyVarObject_HEAD_INIT(NULL, 0) "EncodingMap", /*tp_name*/ sizeof(struct encoding_map), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -4228,7 +4228,7 @@ if (level1[l1] == 0xFF) level1[l1] = count2++; if (level2[l2] == 0xFF) - level2[l2] = count3++; + level2[l2] = count3++; } if (count2 >= 0xFF || count3 >= 0xFF) @@ -4302,7 +4302,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4334,57 +4334,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 (PyInt_Check(x)) { - long value = PyInt_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 = PyInt_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 (PyString_Check(x)) - return x; + return x; else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - return NULL; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + return NULL; } } static int charmapencode_resize(PyObject **outobj, Py_ssize_t *outpos, Py_ssize_t requiredsize) { - Py_ssize_t outsize = PyString_GET_SIZE(*outobj); - /* exponentially overallocate to minimize reallocations */ - if (requiredsize < 2*outsize) - requiredsize = 2*outsize; - if (_PyString_Resize(outobj, requiredsize)) { - return 0; - } - return 1; + Py_ssize_t outsize = PyString_GET_SIZE(*outobj); + /* exponentially overallocate to minimize reallocations */ + if (requiredsize < 2*outsize) + requiredsize = 2*outsize; + if (_PyString_Resize(outobj, requiredsize)) { + return 0; + } + return 1; } -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. Reallocate the output string if not enough @@ -4402,47 +4402,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; @@ -4586,7 +4586,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 */ @@ -4594,30 +4594,30 @@ 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 */ if (respossize) { - 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); @@ -4745,44 +4745,44 @@ 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 (PyInt_Check(x)) { - long value = PyInt_AS_LONG(x); - long max = PyUnicode_GetMax(); - if (value < 0 || value > max) { - PyErr_Format(PyExc_TypeError, - "character mapping must be in range(0x%lx)", max+1); - Py_DECREF(x); - return -1; - } - *result = x; - return 0; + long value = PyInt_AS_LONG(x); + long max = PyUnicode_GetMax(); + if (value < 0 || value > max) { + PyErr_Format(PyExc_TypeError, + "character mapping must be in range(0x%lx)", max+1); + 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 unicode"); - Py_DECREF(x); - return -1; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or unicode"); + Py_DECREF(x); + return -1; } } /* ensure that *outobj is at least requiredsize characters long, @@ -4794,14 +4794,14 @@ { 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; } @@ -4817,43 +4817,43 @@ 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 (PyInt_Check(*res)) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = (Py_UNICODE)PyInt_AS_LONG(*res); + /* no overflow check, because we know that the space is enough */ + *(*outp)++ = (Py_UNICODE)PyInt_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; @@ -4873,113 +4873,113 @@ 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'; @@ -5180,11 +5180,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); @@ -5209,11 +5209,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) @@ -5237,10 +5237,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; @@ -5249,39 +5249,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; @@ -5292,24 +5292,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; } @@ -5322,13 +5322,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++; } @@ -5343,13 +5343,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++; } @@ -5385,10 +5385,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) { @@ -5410,31 +5410,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 (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 (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5457,7 +5457,7 @@ fseq = PySequence_Fast(seq, ""); if (fseq == NULL) { - return NULL; + return NULL; } /* Grrrr. A codec may be invoked to convert str objects to @@ -5470,34 +5470,34 @@ 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; } /* If singleton sequence with an exact Unicode, return that. */ if (seqlen == 1) { - item = PySequence_Fast_GET_ITEM(fseq, 0); - if (PyUnicode_CheckExact(item)) { - Py_INCREF(item); - res = (PyUnicodeObject *)item; - goto Done; - } + item = PySequence_Fast_GET_ITEM(fseq, 0); + if (PyUnicode_CheckExact(item)) { + Py_INCREF(item); + res = (PyUnicodeObject *)item; + goto Done; + } } /* At least two items to join, or one that isn't exact Unicode. */ if (seqlen > 1) { /* Set up sep and seplen -- they're needed. */ - if (separator == NULL) { - sep = ␣ - seplen = 1; - } - else { - internal_separator = PyUnicode_FromObject(separator); - if (internal_separator == NULL) - goto onError; - sep = PyUnicode_AS_UNICODE(internal_separator); - seplen = PyUnicode_GET_SIZE(internal_separator); - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + if (separator == NULL) { + sep = ␣ + seplen = 1; + } + else { + internal_separator = PyUnicode_FromObject(separator); + if (internal_separator == NULL) + goto onError; + sep = PyUnicode_AS_UNICODE(internal_separator); + seplen = PyUnicode_GET_SIZE(internal_separator); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); } } @@ -5509,66 +5509,66 @@ res_used = 0; for (i = 0; i < seqlen; ++i) { - Py_ssize_t itemlen; - Py_ssize_t new_res_used; + Py_ssize_t itemlen; + Py_ssize_t new_res_used; - item = PySequence_Fast_GET_ITEM(fseq, i); - /* Convert item to Unicode. */ - if (! PyUnicode_Check(item) && ! PyString_Check(item)) { - PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected string or Unicode," - " %.80s found", - i, Py_TYPE(item)->tp_name); - goto onError; - } - item = PyUnicode_FromObject(item); - if (item == NULL) - goto onError; - /* We own a reference to item from here on. */ + item = PySequence_Fast_GET_ITEM(fseq, i); + /* Convert item to Unicode. */ + if (! PyUnicode_Check(item) && ! PyString_Check(item)) { + PyErr_Format(PyExc_TypeError, + "sequence item %zd: expected string or Unicode," + " %.80s found", + i, Py_TYPE(item)->tp_name); + goto onError; + } + item = PyUnicode_FromObject(item); + if (item == NULL) + goto onError; + /* We own a reference to item from here on. */ - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); /* Make sure we have enough space for the separator and the item. */ - itemlen = PyUnicode_GET_SIZE(item); - new_res_used = res_used + itemlen; - if (new_res_used < 0) - goto Overflow; - if (i < seqlen - 1) { - new_res_used += seplen; - if (new_res_used < 0) - goto Overflow; - } - if (new_res_used > res_alloc) { - /* double allocated size until it's big enough */ - do { - res_alloc += res_alloc; - if (res_alloc <= 0) - goto Overflow; - } while (new_res_used > res_alloc); - if (_PyUnicode_Resize(&res, res_alloc) < 0) { - Py_DECREF(item); - goto onError; - } + itemlen = PyUnicode_GET_SIZE(item); + new_res_used = res_used + itemlen; + if (new_res_used < 0) + goto Overflow; + if (i < seqlen - 1) { + new_res_used += seplen; + if (new_res_used < 0) + goto Overflow; + } + if (new_res_used > res_alloc) { + /* double allocated size until it's big enough */ + do { + res_alloc += res_alloc; + if (res_alloc <= 0) + goto Overflow; + } while (new_res_used > res_alloc); + if (_PyUnicode_Resize(&res, res_alloc) < 0) { + Py_DECREF(item); + goto onError; + } res_p = PyUnicode_AS_UNICODE(res) + res_used; - } + } - /* Copy item, and maybe the separator. */ - Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); - res_p += itemlen; - if (i < seqlen - 1) { - Py_UNICODE_COPY(res_p, sep, seplen); - res_p += seplen; - } - Py_DECREF(item); - res_used = new_res_used; + /* Copy item, and maybe the separator. */ + Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); + res_p += itemlen; + if (i < seqlen - 1) { + Py_UNICODE_COPY(res_p, sep, seplen); + res_p += seplen; + } + Py_DECREF(item); + res_used = new_res_used; } /* Shrink res to match the used area; this probably can't fail, * but it's cheap to check. */ if (_PyUnicode_Resize(&res, res_used) < 0) - goto onError; + goto onError; Done: Py_XDECREF(internal_separator); @@ -5590,9 +5590,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; @@ -5623,21 +5623,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 \ +#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; @@ -5646,23 +5646,23 @@ 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; @@ -5672,7 +5672,7 @@ } PyObject *PyUnicode_Splitlines(PyObject *string, - int keepends) + int keepends) { register Py_ssize_t i; register Py_ssize_t j; @@ -5683,7 +5683,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -5692,28 +5692,28 @@ 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); @@ -5727,9 +5727,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; @@ -5738,16 +5738,16 @@ 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; @@ -5758,9 +5758,9 @@ 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; @@ -5769,16 +5769,16 @@ 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; @@ -5789,8 +5789,8 @@ 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; @@ -5799,23 +5799,23 @@ 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; @@ -5826,11 +5826,11 @@ 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; @@ -5839,16 +5839,16 @@ 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; @@ -5859,11 +5859,11 @@ 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; @@ -5872,17 +5872,17 @@ 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; @@ -5897,8 +5897,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -5910,24 +5910,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; @@ -5939,30 +5939,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 */ @@ -6048,7 +6048,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6136,7 +6136,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)); @@ -6157,26 +6157,26 @@ 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__, @@ -6241,9 +6241,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 */ @@ -6287,7 +6287,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { PyUnicodeObject *u = NULL, *v = NULL; int result; @@ -6295,16 +6295,16 @@ /* 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; /* Shortcut for empty or interned objects */ if (v == u) { - Py_DECREF(u); - Py_DECREF(v); - return 0; + Py_DECREF(u); + Py_DECREF(v); + return 0; } result = unicode_compare(u, v); @@ -6381,8 +6381,8 @@ if (!PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) return NULL; PyErr_Clear(); - if (PyErr_Warn(PyExc_UnicodeWarning, - (op == Py_EQ) ? + if (PyErr_Warn(PyExc_UnicodeWarning, + (op == Py_EQ) ? "Unicode equal comparison " "failed to convert both arguments to Unicode - " "interpreting them as being unequal" : @@ -6396,7 +6396,7 @@ } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6404,8 +6404,8 @@ /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_SetString(PyExc_TypeError, - "'in ' requires string as left operand"); + PyErr_SetString(PyExc_TypeError, + "'in ' requires string as left operand"); return -1; } @@ -6426,32 +6426,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); @@ -6481,13 +6481,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); @@ -6517,7 +6517,7 @@ char *encoding = NULL; char *errors = NULL; PyObject *v; - + if (!PyArg_ParseTuple(args, "|ss:encode", &encoding, &errors)) return NULL; v = PyUnicode_AsEncodedObject((PyObject *)self, encoding, errors); @@ -6553,7 +6553,7 @@ char *encoding = NULL; char *errors = NULL; PyObject *v; - + if (!PyArg_ParseTuple(args, "|ss:decode", &encoding, &errors)) return NULL; v = PyUnicode_AsDecodedObject((PyObject *)self, encoding, errors); @@ -6591,7 +6591,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 */ @@ -6599,27 +6599,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); @@ -6632,20 +6632,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++ = ' '; + 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; + } + } + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -6716,15 +6716,15 @@ register long x; if (self->hash != -1) - return self->hash; + return self->hash; len = PyUnicode_GET_SIZE(self); p = PyUnicode_AS_UNICODE(self); x = *p << 7; while (--len >= 0) - x = (1000003*x) ^ *p++; + x = (1000003*x) ^ *p++; x ^= PyUnicode_GET_SIZE(self); if (x == -1) - x = -2; + x = -2; self->hash = x; return x; } @@ -6776,21 +6776,21 @@ /* 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); } @@ -6810,21 +6810,21 @@ /* 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); } @@ -6846,33 +6846,33 @@ /* 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); } @@ -6891,17 +6891,17 @@ /* 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); } @@ -6920,17 +6920,17 @@ /* 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); } @@ -6949,17 +6949,17 @@ /* 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); } @@ -6978,17 +6978,17 @@ /* 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); } @@ -7007,17 +7007,17 @@ /* 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); } @@ -7036,17 +7036,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); } @@ -7116,34 +7116,34 @@ 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; + 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) { + i = 0; + if (striptype != RIGHTSTRIP) { while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { i++; } - } + } - j = len; - if (striptype != LEFTSTRIP) { + 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)) { + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { Py_INCREF(self); return (PyObject*)self; - } - else + } + else return PyUnicode_FromUnicode(s+i, j-i); } @@ -7151,62 +7151,62 @@ 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++; + } + } - 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); + 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); } 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 if (PyString_Check(sep)) { - PyObject *res; - sep = PyUnicode_FromObject(sep); - if (sep==NULL) - return NULL; - res = _PyUnicode_XStrip(self, striptype, sep); - Py_DECREF(sep); - return res; - } - else { - PyErr_Format(PyExc_TypeError, - "%s arg must be None, unicode or str", - STRIPNAME(striptype)); - return NULL; - } - } + if (sep != NULL && sep != Py_None) { + if (PyUnicode_Check(sep)) + return _PyUnicode_XStrip(self, striptype, sep); + else if (PyString_Check(sep)) { + PyObject *res; + sep = PyUnicode_FromObject(sep); + if (sep==NULL) + return NULL; + res = _PyUnicode_XStrip(self, striptype, sep); + Py_DECREF(sep); + return res; + } + else { + PyErr_Format(PyExc_TypeError, + "%s arg must be None, unicode or str", + STRIPNAME(striptype)); + return NULL; + } + } - return do_strip(self, striptype); + return do_strip(self, striptype); } @@ -7221,10 +7221,10 @@ 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); } @@ -7238,10 +7238,10 @@ 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); } @@ -7255,10 +7255,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); } @@ -7303,25 +7303,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; @@ -7330,22 +7330,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); @@ -7371,11 +7371,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); @@ -7389,8 +7389,8 @@ PyObject *unicode_repr(PyObject *unicode) { return unicodeescape_string(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - 1); + PyUnicode_GET_SIZE(unicode), + 1); } PyDoc_STRVAR(rfind__doc__, @@ -7411,7 +7411,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), @@ -7438,7 +7438,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), @@ -7497,24 +7497,24 @@ start = end; /* copy slice */ return (PyObject*) PyUnicode_FromUnicode(self->str + start, - end - start); + end - start); } 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); @@ -7543,11 +7543,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 * @@ -7559,7 +7559,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); @@ -7587,7 +7587,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); @@ -7632,20 +7632,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); @@ -7674,11 +7674,11 @@ 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__, @@ -7730,9 +7730,9 @@ unicode_translate(PyUnicodeObject *self, PyObject *table) { return PyUnicode_TranslateCharmap(self->str, - self->length, - table, - "ignore"); + self->length, + table, + "ignore"); } PyDoc_STRVAR(upper__doc__, @@ -7808,7 +7808,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7817,8 +7817,8 @@ 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++) { @@ -7854,7 +7854,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7864,7 +7864,7 @@ if (!PyArg_ParseTuple(args, "O|O&O&:endswith", &subobj, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { @@ -7911,7 +7911,7 @@ goto done; if (!(PyBytes_Check(format_spec) || PyUnicode_Check(format_spec))) { PyErr_Format(PyExc_TypeError, "__format__ arg must be str " - "or unicode, not %s", Py_TYPE(format_spec)->tp_name); + "or unicode, not %s", Py_TYPE(format_spec)->tp_name); goto done; } tmp = PyObject_Unicode(format_spec); @@ -7947,7 +7947,7 @@ static PyObject * unicode_getnewargs(PyUnicodeObject *v) { - return Py_BuildValue("(u#)", v->str, v->length); + return Py_BuildValue("(u#)", v->str, v->length); } @@ -8010,7 +8010,7 @@ {"freelistsize", (PyCFunction) free_listsize, METH_NOARGS}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, {NULL, NULL} }; @@ -8025,22 +8025,22 @@ } static PyNumberMethods unicode_as_number = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - 0, /*nb_divide*/ - unicode_mod, /*nb_remainder*/ + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 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 */ - (ssizessizeargfunc) unicode_slice, /* 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 */ + (ssizessizeargfunc) unicode_slice, /* sq_slice */ + 0, /* sq_ass_item */ + 0, /* sq_ass_slice */ + PyUnicode_Contains, /* sq_contains */ }; static PyObject* @@ -8060,7 +8060,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8076,9 +8076,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]; @@ -8095,19 +8095,19 @@ } 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 */ }; static Py_ssize_t unicode_buffer_getreadbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } *ptr = (void *) self->str; @@ -8116,16 +8116,16 @@ static Py_ssize_t unicode_buffer_getwritebuf(PyUnicodeObject *self, Py_ssize_t index, - const void **ptr) + const void **ptr) { PyErr_SetString(PyExc_TypeError, - "cannot use unicode as modifiable buffer"); + "cannot use unicode as modifiable buffer"); return -1; } static int unicode_buffer_getsegcount(PyUnicodeObject *self, - Py_ssize_t *lenp) + Py_ssize_t *lenp) { if (lenp) *lenp = PyUnicode_GET_DATA_SIZE(self); @@ -8134,19 +8134,19 @@ static Py_ssize_t unicode_buffer_getcharbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { PyObject *str; if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } str = _PyUnicode_AsDefaultEncodedString((PyObject *)self, NULL); if (str == NULL) - return -1; + return -1; *ptr = (void *) PyString_AS_STRING(str); return PyString_GET_SIZE(str); } @@ -8158,22 +8158,22 @@ { 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; } #define F_LJUST (1<<0) -#define F_SIGN (1<<1) +#define F_SIGN (1<<1) #define F_BLANK (1<<2) -#define F_ALT (1<<3) -#define F_ZERO (1<<4) +#define F_ALT (1<<3) +#define F_ZERO (1<<4) static Py_ssize_t strtounicode(Py_UNICODE *buffer, const char *charbuffer) @@ -8181,7 +8181,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; } @@ -8212,11 +8212,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)*/ @@ -8225,70 +8225,70 @@ 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') && + 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; + (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 i, len; - PyObject *str; /* temporary string object. */ - PyUnicodeObject *result; - - str = _PyString_FormatLong(val, flags, prec, type, &buf, &len); - if (!str) - return NULL; - result = _PyUnicode_New(len); - if (!result) { - Py_DECREF(str); - return NULL; - } - for (i = 0; i < len; i++) - result->str[i] = buf[i]; - result->str[len] = 0; - Py_DECREF(str); - return (PyObject*)result; + char *buf; + int i, len; + PyObject *str; /* temporary string object. */ + PyUnicodeObject *result; + + str = _PyString_FormatLong(val, flags, prec, type, &buf, &len); + if (!str) + return NULL; + result = _PyUnicode_New(len); + if (!result) { + Py_DECREF(str); + return NULL; + } + for (i = 0; i < len; i++) + result->str[i] = buf[i]; + result->str[len] = 0; + Py_DECREF(str); + return (PyObject*)result; } 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) @@ -8317,7 +8317,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; } @@ -8364,46 +8364,46 @@ { /* presume that the buffer is at least 2 characters long */ if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) != 1) - goto onError; - buf[0] = PyUnicode_AS_UNICODE(v)[0]; + if (PyUnicode_GET_SIZE(v) != 1) + goto onError; + buf[0] = PyUnicode_AS_UNICODE(v)[0]; } else if (PyString_Check(v)) { - if (PyString_GET_SIZE(v) != 1) - goto onError; - buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; + if (PyString_GET_SIZE(v) != 1) + goto onError; + buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; } else { - /* Integer input truncated to a character */ + /* Integer input truncated to a character */ long x; - x = PyInt_AsLong(v); - if (x == -1 && PyErr_Occurred()) - goto onError; + x = PyInt_AsLong(v); + if (x == -1 && PyErr_Occurred()) + goto onError; #ifdef Py_UNICODE_WIDE - if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000) " - "(wide Python build)"); - return -1; - } + if (x < 0 || x > 0x10ffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x110000) " + "(wide Python build)"); + return -1; + } #else - if (x < 0 || x > 0xffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x10000) " - "(narrow Python build)"); - return -1; - } + if (x < 0 || x > 0xffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x10000) " + "(narrow Python build)"); + return -1; + } #endif - buf[0] = (Py_UNICODE) x; + buf[0] = (Py_UNICODE) x; } buf[1] = '\0'; return 1; onError: PyErr_SetString(PyExc_TypeError, - "%c requires int or char"); + "%c requires int or char"); return -1; } @@ -8418,7 +8418,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; @@ -8428,440 +8428,440 @@ 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) && !PyObject_TypeCheck(args, &PyBaseString_Type)) - 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - width = PyInt_AsLong(v); - 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - prec = PyInt_AsLong(v); - 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': - if (PyUnicode_Check(v) && c == 's') { - temp = v; - Py_INCREF(temp); - } - else { - PyObject *unicode; - if (c == 's') - temp = PyObject_Unicode(v); - else - temp = PyObject_Repr(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 (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + width = PyInt_AsLong(v); + 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 (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + prec = PyInt_AsLong(v); + 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': + if (PyUnicode_Check(v) && c == 's') { + temp = v; + Py_INCREF(temp); + } + else { + PyObject *unicode; + if (c == 's') + temp = PyObject_Unicode(v); + else + temp = PyObject_Repr(v); + if (temp == NULL) + goto onError; if (PyUnicode_Check(temp)) /* nothing to do */; else if (PyString_Check(temp)) { /* convert to string to Unicode */ - unicode = PyUnicode_Decode(PyString_AS_STRING(temp), - PyString_GET_SIZE(temp), - NULL, - "strict"); - Py_DECREF(temp); - temp = unicode; - if (temp == NULL) - goto onError; - } - 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 (PyInt_Check(v) || (PyLong_Check(v))) { - iobj = v; - Py_INCREF(iobj); - } - else { - iobj = PyNumber_Int(v); - if (iobj==NULL) iobj = PyNumber_Long(v); - } - if (iobj!=NULL) { - if (PyInt_Check(iobj)) { - isnumok = 1; - pbuf = formatbuf; - len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, iobj); - Py_DECREF(iobj); - if (len < 0) - goto onError; - sign = 1; - } - else 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, " + unicode = PyUnicode_Decode(PyString_AS_STRING(temp), + PyString_GET_SIZE(temp), + NULL, + "strict"); + Py_DECREF(temp); + temp = unicode; + if (temp == NULL) + goto onError; + } + 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 (PyInt_Check(v) || (PyLong_Check(v))) { + iobj = v; + Py_INCREF(iobj); + } + else { + iobj = PyNumber_Int(v); + if (iobj==NULL) iobj = PyNumber_Long(v); + } + if (iobj!=NULL) { + if (PyInt_Check(iobj)) { + isnumok = 1; + pbuf = formatbuf; + len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), + flags, prec, c, iobj); + Py_DECREF(iobj); + if (len < 0) + goto onError; + sign = 1; + } + else 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 : '?', + 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')) { - 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')) { - 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')) { + 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')) { + 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; @@ -8870,7 +8870,7 @@ Py_XDECREF(result); Py_DECREF(uformat); if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } return NULL; } @@ -8889,51 +8889,51 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = NULL; - static char *kwlist[] = {"string", "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:unicode", - kwlist, &x, &encoding, &errors)) - return NULL; - if (x == NULL) - return (PyObject *)_PyUnicode_New(0); - if (encoding == NULL && errors == NULL) - return PyObject_Unicode(x); - else - return PyUnicode_FromEncodedObject(x, encoding, errors); + static char *kwlist[] = {"string", "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:unicode", + kwlist, &x, &encoding, &errors)) + return NULL; + if (x == NULL) + return (PyObject *)_PyUnicode_New(0); + if (encoding == NULL && errors == NULL) + return PyObject_Unicode(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, @@ -8945,46 +8945,46 @@ PyTypeObject PyUnicode_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "unicode", /* tp_name */ - sizeof(PyUnicodeObject), /* tp_size */ - 0, /* tp_itemsize */ + "unicode", /* 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 */ - &unicode_as_buffer, /* tp_as_buffer */ + (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 */ + &unicode_as_buffer, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | - 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 */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - unicode_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &PyBaseString_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 */ + 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 */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + unicode_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyBaseString_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 */ @@ -9010,13 +9010,13 @@ numfree = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) - return; + return; strcpy(unicode_default_encoding, "ascii"); 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( @@ -9035,13 +9035,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); @@ -9057,10 +9057,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(); } From python-checkins at python.org Sat Jan 31 17:36:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 17:36:08 +0100 (CET) Subject: [Python-checkins] r69136 - python/branches/py3k/Objects/unicodeobject.c Message-ID: <20090131163608.D38B91E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 17:36:08 2009 New Revision: 69136 Log: detabify Objects/unicodeobject.c Modified: python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat Jan 31 17:36:08 2009 @@ -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 } @@ -249,16 +249,16 @@ /* 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,9 +271,9 @@ 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; } @@ -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() @@ -395,26 +395,26 @@ } 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')) + /* 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++; - } + 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; - } + 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; + 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; + 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,41 +1012,41 @@ 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 @@ -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 @@ -1086,14 +1086,14 @@ /* XXX Perhaps we should make this API an alias of 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,23 +1130,23 @@ 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; @@ -1155,9 +1155,9 @@ } 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; @@ -1240,7 +1240,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1264,7 +1264,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1284,15 +1284,15 @@ } 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); @@ -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); @@ -1428,7 +1428,7 @@ } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) @@ -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; @@ -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, @@ -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; @@ -1788,7 +1788,7 @@ } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -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); /* 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); + 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) @@ -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,7 +2319,7 @@ *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; - } + } encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); @@ -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 */ @@ -2429,25 +2429,25 @@ const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | (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; + 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; + 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) @@ -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; @@ -2564,21 +2564,21 @@ 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); } @@ -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; - } - - /* 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) { + 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) { #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 */ + 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( + 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) @@ -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; @@ -2956,24 +2956,24 @@ #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; @@ -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,7 +3324,7 @@ 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 @@ -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,63 +3466,63 @@ 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; @@ -3542,15 +3542,15 @@ 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; @@ -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; @@ -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 @@ -3792,20 +3792,20 @@ 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; } } @@ -3817,9 +3817,9 @@ 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: @@ -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,38 +4088,38 @@ /* 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; @@ -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) @@ -4167,8 +4167,8 @@ 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,41 +4286,41 @@ /* 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; @@ -4328,21 +4328,21 @@ #ifdef NEED_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,136 +4386,136 @@ /* 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; @@ -4540,12 +4540,12 @@ encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; - return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + + return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { - {"size", encoding_map_size, METH_NOARGS, + {"size", encoding_map_size, METH_NOARGS, PyDoc_STR("Return the size (in bytes) of this object") }, { 0 } }; @@ -4553,11 +4553,11 @@ static void encoding_map_dealloc(PyObject* o) { - PyObject_FREE(o); + PyObject_FREE(o); } static PyTypeObject EncodingMapType = { - PyVarObject_HEAD_INIT(NULL, 0) + PyVarObject_HEAD_INIT(NULL, 0) "EncodingMap", /*tp_name*/ sizeof(struct encoding_map), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -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, + /* 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; + 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 @@ -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 */ @@ -5047,16 +5047,16 @@ } 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 */ @@ -5066,20 +5066,20 @@ 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; } } @@ -5090,9 +5090,9 @@ 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: @@ -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,44 +5161,44 @@ 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, @@ -5210,14 +5210,14 @@ { 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; } @@ -5233,43 +5233,43 @@ 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,113 +5289,113 @@ 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'; @@ -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,13 +5923,13 @@ 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; @@ -5950,13 +5950,13 @@ 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: @@ -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 \ +#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,23 +6027,23 @@ 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; @@ -6053,7 +6053,7 @@ } 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,28 +6073,28 @@ 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); @@ -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,16 +6119,16 @@ 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; @@ -6139,9 +6139,9 @@ 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,16 +6150,16 @@ 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; @@ -6170,8 +6170,8 @@ 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,23 +6180,23 @@ 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; @@ -6207,11 +6207,11 @@ 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,16 +6220,16 @@ 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; @@ -6240,11 +6240,11 @@ 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,17 +6253,17 @@ 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; @@ -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] */ @@ -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)); @@ -6538,26 +6538,26 @@ 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__, @@ -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) + ((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); @@ -6833,24 +6833,24 @@ 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__, @@ -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); @@ -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++ = ' '; + 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; + } + } + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -7124,21 +7124,21 @@ /* 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); } @@ -7158,21 +7158,21 @@ /* 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); } @@ -7194,33 +7194,33 @@ /* 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); } @@ -7239,17 +7239,17 @@ /* 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); } @@ -7268,17 +7268,17 @@ /* 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); } @@ -7297,17 +7297,17 @@ /* 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); } @@ -7326,17 +7326,17 @@ /* 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); } @@ -7355,17 +7355,17 @@ /* 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); } @@ -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,8 +7422,8 @@ 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; } @@ -7531,34 +7531,34 @@ 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; + 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) { + i = 0; + if (striptype != RIGHTSTRIP) { while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { i++; } - } + } - j = len; - if (striptype != LEFTSTRIP) { + 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)) { + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { Py_INCREF(self); return (PyObject*)self; - } - else + } + else return PyUnicode_FromUnicode(s+i, j-i); } @@ -7566,53 +7566,53 @@ 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++; + } + } - 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); + 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); } 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); } @@ -7626,10 +7626,10 @@ 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); } @@ -7642,10 +7642,10 @@ 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); } @@ -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); @@ -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); @@ -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; @@ -7878,14 +7878,14 @@ ch2 = *s; if (ch >= 0xD800 && ch < 0xDC00 && ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - s++; + 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)) { @@ -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), @@ -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), @@ -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); @@ -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); @@ -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); @@ -8196,11 +8196,11 @@ 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__, @@ -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(); @@ -8436,7 +8436,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8445,8 +8445,8 @@ 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++) { @@ -8482,7 +8482,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8492,7 +8492,7 @@ if (!PyArg_ParseTuple(args, "O|O&O&:endswith", &subobj, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { @@ -8555,7 +8555,7 @@ static PyObject * unicode_getnewargs(PyUnicodeObject *v) { - return Py_BuildValue("(u#)", v->str, v->length); + return Py_BuildValue("(u#)", v->str, v->length); } @@ -8620,7 +8620,7 @@ {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, {NULL, NULL} }; @@ -8635,21 +8635,21 @@ } 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') && + 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; + (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: 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,424 +8989,424 @@ 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, " + 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 : '?', + 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; @@ -9415,7 +9415,7 @@ Py_XDECREF(result); Py_DECREF(uformat); if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } return NULL; } @@ -9427,51 +9427,51 @@ 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); + 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, @@ -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)); + 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( + 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; + if (item != NULL) + ++it->it_index; + return item; + } + + 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__", (PyCFunction)unicodeiter_len, METH_NOARGS, length_hint_doc}, - {NULL, NULL} /* sentinel */ + {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 From python-checkins at python.org Sat Jan 31 17:40:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 17:40:43 +0100 (CET) Subject: [Python-checkins] r69137 - python/branches/release30-maint/Objects/unicodeobject.c Message-ID: <20090131164043.9C1AC1E4021@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 17:40:42 2009 New Revision: 69137 Log: replace the evil tabs of unicodeobject.c with beloved spaces Modified: python/branches/release30-maint/Objects/unicodeobject.c Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Sat Jan 31 17:40:42 2009 @@ -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 } @@ -249,16 +249,16 @@ /* 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,9 +271,9 @@ 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; } @@ -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() @@ -395,26 +395,26 @@ } 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')) + /* 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++; - } + 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; - } + 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; + 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; + 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,41 +1012,41 @@ 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 @@ -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 @@ -1086,14 +1086,14 @@ /* XXX Perhaps we should make this API an alias of 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,23 +1130,23 @@ 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; @@ -1155,9 +1155,9 @@ } 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; @@ -1240,7 +1240,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1264,7 +1264,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1284,15 +1284,15 @@ } 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); @@ -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); @@ -1428,7 +1428,7 @@ } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) @@ -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; @@ -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, @@ -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; @@ -1788,7 +1788,7 @@ } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -1996,16 +1996,16 @@ }; 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); } 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; @@ -2046,72 +2046,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: @@ -2119,25 +2119,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); /* 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: */ @@ -2155,24 +2155,24 @@ 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; + errors, &errorHandler, + "utf8", errmsg, + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2196,8 +2196,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 */ @@ -2262,7 +2262,7 @@ *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; - } + } encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); @@ -2296,27 +2296,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; @@ -2344,8 +2344,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 */ @@ -2372,25 +2372,25 @@ const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | (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) { @@ -2409,54 +2409,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; + 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; + 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) @@ -2475,9 +2475,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, *result; unsigned char *p; @@ -2507,21 +2507,21 @@ 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 = PyByteArray_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyByteArray_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2541,16 +2541,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); } @@ -2569,28 +2569,28 @@ 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); } 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; @@ -2634,25 +2634,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) { @@ -2667,74 +2667,74 @@ } while (q < e) { - Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[ihi] << 8) | q[ilo]; - - q += 2; - - 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)-starts; - goto utf16Error; - } - if (0xD800 <= ch && ch <= 0xDBFF) { - Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; - q += 2; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + Py_UNICODE ch; + /* remaining bytes at the end? (size should be even) */ + if (e-q<2) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf16Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + ch = (q[ihi] << 8) | q[ilo]; + + q += 2; + + 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)-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 */ + 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, - &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf16", 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) @@ -2753,9 +2753,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, *result; unsigned char *p; @@ -2781,24 +2781,24 @@ #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 = PyByteArray_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyByteArray_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2814,13 +2814,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) @@ -2841,9 +2841,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 ----------------------------------------------- */ @@ -2851,8 +2851,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; @@ -3118,7 +3118,7 @@ static const char *hexdigits = "0123456789abcdef"; PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr, *result; char *p; @@ -3148,7 +3148,7 @@ */ if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyByteArray_FromStringAndSize(NULL, 2 @@ -3182,34 +3182,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' */ @@ -3270,8 +3270,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; @@ -3290,63 +3290,63 @@ 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; @@ -3366,15 +3366,15 @@ 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; @@ -3387,7 +3387,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr, *result; char *p; @@ -3398,10 +3398,10 @@ #else const Py_ssize_t expandsize = 6; #endif - + if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); - + return PyErr_NoMemory(); + repr = PyByteArray_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; @@ -3412,8 +3412,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]; @@ -3427,34 +3427,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]; @@ -3462,8 +3462,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; @@ -3490,8 +3490,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; @@ -3511,9 +3511,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; @@ -3568,26 +3568,26 @@ /* --- 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; /* 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); while (size-- > 0) - *p++ = (unsigned char)*s++; + *p++ = (unsigned char)*s++; return (PyObject *)v; onError: @@ -3603,20 +3603,20 @@ 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; } } @@ -3628,9 +3628,9 @@ 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: @@ -3650,36 +3650,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); @@ -3687,9 +3687,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; @@ -3722,128 +3722,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 (PyByteArray_Resize(res, requiredsize)) - goto onError; - str = PyByteArray_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 - PyByteArray_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (PyByteArray_Resize(res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyByteArray_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 (PyByteArray_Resize(res, requiredsize)) + goto onError; + str = PyByteArray_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 - PyByteArray_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (PyByteArray_Resize(res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyByteArray_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); + } + } } result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(res), str - PyByteArray_AS_STRING(res)); @@ -3855,8 +3855,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); } @@ -3864,19 +3864,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; @@ -3890,38 +3890,38 @@ /* 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; @@ -3934,8 +3934,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); } @@ -3943,12 +3943,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) @@ -3969,8 +3969,8 @@ 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; } @@ -3980,9 +3980,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; @@ -3992,74 +3992,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 @@ -4067,8 +4067,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); } @@ -4078,8 +4078,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; @@ -4088,41 +4088,41 @@ /* 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; @@ -4130,21 +4130,21 @@ #ifdef NEED_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 @@ -4158,8 +4158,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -4169,9 +4169,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; @@ -4188,136 +4188,136 @@ /* 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; @@ -4342,12 +4342,12 @@ encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; - return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + + return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { - {"size", encoding_map_size, METH_NOARGS, + {"size", encoding_map_size, METH_NOARGS, PyDoc_STR("Return the size (in bytes) of this object") }, { 0 } }; @@ -4355,11 +4355,11 @@ static void encoding_map_dealloc(PyObject* o) { - PyObject_FREE(o); + PyObject_FREE(o); } static PyTypeObject EncodingMapType = { - PyVarObject_HEAD_INIT(NULL, 0) + PyVarObject_HEAD_INIT(NULL, 0) "EncodingMap", /*tp_name*/ sizeof(struct encoding_map), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -4446,7 +4446,7 @@ if (level1[l1] == 0xFF) level1[l1] = count2++; if (level2[l2] == 0xFF) - level2[l2] = count3++; + level2[l2] = count3++; } if (count2 >= 0xFF || count3 >= 0xFF) @@ -4520,7 +4520,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4552,57 +4552,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, + /* 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; + 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 @@ -4620,47 +4620,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; @@ -4804,7 +4804,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 */ @@ -4812,29 +4812,29 @@ 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 */ if (respossize) { - 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); @@ -4962,44 +4962,44 @@ 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, @@ -5011,14 +5011,14 @@ { 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; } @@ -5034,43 +5034,43 @@ 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; @@ -5090,113 +5090,113 @@ 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'; @@ -5398,11 +5398,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); @@ -5427,11 +5427,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) @@ -5455,10 +5455,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; @@ -5467,39 +5467,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; @@ -5510,24 +5510,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; } @@ -5540,13 +5540,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++; } @@ -5561,13 +5561,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++; } @@ -5603,10 +5603,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) { @@ -5628,31 +5628,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; } @@ -5673,7 +5673,7 @@ fseq = PySequence_Fast(seq, ""); if (fseq == NULL) { - return NULL; + return NULL; } /* NOTE: the following code can't call back into Python code, @@ -5683,18 +5683,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 */ @@ -5724,13 +5724,13 @@ 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; @@ -5751,13 +5751,13 @@ 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: @@ -5772,9 +5772,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; @@ -5805,21 +5805,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 \ +#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; @@ -5828,23 +5828,23 @@ 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; @@ -5854,7 +5854,7 @@ } PyObject *PyUnicode_Splitlines(PyObject *string, - int keepends) + int keepends) { register Py_ssize_t i; register Py_ssize_t j; @@ -5865,7 +5865,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -5874,28 +5874,28 @@ 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); @@ -5909,9 +5909,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; @@ -5920,16 +5920,16 @@ 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; @@ -5940,9 +5940,9 @@ 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; @@ -5951,16 +5951,16 @@ 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; @@ -5971,8 +5971,8 @@ 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; @@ -5981,23 +5981,23 @@ 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; @@ -6008,11 +6008,11 @@ 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; @@ -6021,16 +6021,16 @@ 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; @@ -6041,11 +6041,11 @@ 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; @@ -6054,17 +6054,17 @@ 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; @@ -6079,8 +6079,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -6092,24 +6092,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; @@ -6121,30 +6121,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 */ @@ -6230,7 +6230,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6318,7 +6318,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)); @@ -6339,26 +6339,26 @@ 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__, @@ -6423,9 +6423,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 */ @@ -6469,7 +6469,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { if (PyUnicode_Check(left) && PyUnicode_Check(right)) return unicode_compare((PyUnicodeObject *)left, @@ -6490,25 +6490,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) + ((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 != @@ -6527,7 +6527,7 @@ else result = unicode_compare((PyUnicodeObject *)left, (PyUnicodeObject *)right); - + /* Convert the return value to a Boolean */ switch (op) { case Py_EQ: @@ -6555,13 +6555,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; @@ -6569,9 +6569,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; } @@ -6592,32 +6592,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); @@ -6634,24 +6634,24 @@ 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__, @@ -6670,13 +6670,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); @@ -6744,7 +6744,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 */ @@ -6752,27 +6752,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); @@ -6785,20 +6785,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++ = ' '; + 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; + } + } + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -6925,21 +6925,21 @@ /* 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); } @@ -6959,21 +6959,21 @@ /* 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); } @@ -6995,33 +6995,33 @@ /* 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); } @@ -7040,17 +7040,17 @@ /* 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); } @@ -7069,17 +7069,17 @@ /* 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); } @@ -7098,17 +7098,17 @@ /* 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); } @@ -7127,17 +7127,17 @@ /* 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); } @@ -7156,17 +7156,17 @@ /* 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); } @@ -7185,17 +7185,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); } @@ -7208,12 +7208,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 @@ -7223,8 +7223,8 @@ 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; } @@ -7332,34 +7332,34 @@ 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; + 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) { + i = 0; + if (striptype != RIGHTSTRIP) { while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { i++; } - } + } - j = len; - if (striptype != LEFTSTRIP) { + 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)) { + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { Py_INCREF(self); return (PyObject*)self; - } - else + } + else return PyUnicode_FromUnicode(s+i, j-i); } @@ -7367,53 +7367,53 @@ 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++; + } + } - 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); + 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); } 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); } @@ -7427,10 +7427,10 @@ 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); } @@ -7443,10 +7443,10 @@ 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); } @@ -7459,10 +7459,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); } @@ -7507,25 +7507,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; @@ -7534,22 +7534,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); @@ -7575,11 +7575,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); @@ -7641,7 +7641,7 @@ continue; } - /* Map special whitespace to '\t', \n', '\r' */ + /* Map special whitespace to '\t', \n', '\r' */ if (ch == '\t') { *p++ = '\\'; *p++ = 't'; @@ -7668,7 +7668,7 @@ *p++ = ch; } - /* Non-ASCII characters */ + /* Non-ASCII characters */ else { Py_UCS4 ucs = ch; @@ -7679,14 +7679,14 @@ ch2 = *s; if (ch >= 0xD800 && ch < 0xDC00 && ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - s++; + 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)) { @@ -7756,7 +7756,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), @@ -7783,7 +7783,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), @@ -7824,20 +7824,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); @@ -7866,11 +7866,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 * @@ -7882,7 +7882,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); @@ -7910,7 +7910,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); @@ -7955,20 +7955,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); @@ -7997,11 +7997,11 @@ 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__, @@ -8065,7 +8065,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(); @@ -8237,7 +8237,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8246,8 +8246,8 @@ 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++) { @@ -8283,7 +8283,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8293,7 +8293,7 @@ if (!PyArg_ParseTuple(args, "O|O&O&:endswith", &subobj, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { @@ -8356,7 +8356,7 @@ static PyObject * unicode_getnewargs(PyUnicodeObject *v) { - return Py_BuildValue("(u#)", v->str, v->length); + return Py_BuildValue("(u#)", v->str, v->length); } @@ -8421,7 +8421,7 @@ {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, {NULL, NULL} }; @@ -8436,21 +8436,21 @@ } 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* @@ -8470,7 +8470,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8486,9 +8486,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]; @@ -8505,9 +8505,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 */ }; @@ -8518,14 +8518,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; } @@ -8535,7 +8535,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; } @@ -8550,7 +8550,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) { @@ -8568,11 +8568,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)*/ @@ -8581,64 +8581,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') && + 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; + (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) @@ -8667,7 +8667,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; } @@ -8675,7 +8675,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 @@ -8716,56 +8716,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: PyErr_SetString(PyExc_TypeError, - "%c requires int or char"); + "%c requires int or char"); return -1; } @@ -8780,7 +8780,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; @@ -8790,424 +8790,424 @@ 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, " + 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 : '?', + 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; @@ -9216,7 +9216,7 @@ Py_XDECREF(result); Py_DECREF(uformat); if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } return NULL; } @@ -9228,51 +9228,51 @@ 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); + 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, @@ -9286,46 +9286,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 */ @@ -9351,12 +9351,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( @@ -9375,13 +9375,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); @@ -9397,10 +9397,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(); } @@ -9408,238 +9408,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)); + 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( + 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; + if (item != NULL) + ++it->it_index; + return item; + } + + 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__", (PyCFunction)unicodeiter_len, METH_NOARGS, length_hint_doc}, - {NULL, NULL} /* sentinel */ + {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 From python-checkins at python.org Sat Jan 31 17:41:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 17:41:58 +0100 (CET) Subject: [Python-checkins] r69138 - python/branches/py3k Message-ID: <20090131164158.D1E191E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 17:41:58 2009 New Revision: 69138 Log: 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 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 31 17:44:04 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 31 Jan 2009 17:44:04 +0100 (CET) Subject: [Python-checkins] r69139 - python/trunk/Lib/test/test_hash.py Message-ID: <20090131164404.4B1C81E4002@bag.python.org> Author: mark.dickinson Date: Sat Jan 31 17:44:04 2009 New Revision: 69139 Log: Add an extra test for long <-> float hash equivalence. Modified: python/trunk/Lib/test/test_hash.py Modified: python/trunk/Lib/test/test_hash.py ============================================================================== --- python/trunk/Lib/test/test_hash.py (original) +++ python/trunk/Lib/test/test_hash.py Sat Jan 31 17:44:04 2009 @@ -35,6 +35,7 @@ self.same_hash(int(-2**63), long(-2**63), float(-2**63)) self.same_hash(int(1-2**63), long(1-2**63)) self.same_hash(int(2**63-1), long(2**63-1)) + self.same_hash(long(2**63), float(2**63)) def test_coerced_floats(self): self.same_hash(long(1.23e300), float(1.23e300)) From python-checkins at python.org Sat Jan 31 17:52:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 17:52:03 +0100 (CET) Subject: [Python-checkins] r69140 - python/trunk/Doc/c-api/exceptions.rst Message-ID: <20090131165203.5707C1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 17:52:03 2009 New Revision: 69140 Log: PyErr_BadInternalCall() raises a SystemError, not TypeError #5112 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 Sat Jan 31 17:52:03 2009 @@ -282,9 +282,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) From buildbot at python.org Sat Jan 31 18:54:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 17:54:50 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090131175450.6DC751E4002@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/790 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Sat Jan 31 19:17:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 18:17:38 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090131181739.1006E1E4002@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/68 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 buildbot at python.org Sat Jan 31 19:22:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 18:22:26 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090131182227.1D5621E4069@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/81 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Jan 31 19:32:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 18:32:34 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090131183235.03A551E4002@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/80 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: benjamin.peterson 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 Sat Jan 31 20:40:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 19:40:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090131194052.2BEC91E4002@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/112 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: 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 Jan 31 21:01:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 21:01:48 +0100 (CET) Subject: [Python-checkins] r69141 - python/trunk/Doc/library/itertools.rst Message-ID: <20090131200148.ABEB71E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 21:01:48 2009 New Revision: 69141 Log: fix indentation 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 Sat Jan 31 21:01:48 2009 @@ -738,26 +738,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 imap(next, imap(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 imap(next, imap(itemgetter(1), groupby(iterable, key))) From ggpolo at gmail.com Sat Jan 31 21:42:46 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Sat, 31 Jan 2009 18:42:46 -0200 Subject: [Python-checkins] buildbot failure in OS X x86 trunk In-Reply-To: <20090131181739.1006E1E4002@bag.python.org> References: <20090131181739.1006E1E4002@bag.python.org> Message-ID: On Sat, Jan 31, 2009 at 4:17 PM, wrote: > 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/68 > > 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 > Is it ok to disable test_ttk_guionly on mac for now ? I have noticed this abort() several times now, and I don't have a mac around to test things related to tcl. > sincerely, > -The Buildbot > -- -- Guilherme H. Polo Goncalves From python-checkins at python.org Sat Jan 31 21:57:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 31 Jan 2009 21:57:03 +0100 (CET) Subject: [Python-checkins] r69142 - in sandbox/trunk/dbm_sqlite/alt: dbsqlite.py Message-ID: <20090131205703.2245E1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Jan 31 21:57:02 2009 New Revision: 69142 Log: Save alternative code for dbsqlite. Added: sandbox/trunk/dbm_sqlite/alt/ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (contents, props changed) Added: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- (empty file) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Sat Jan 31 21:57:02 2009 @@ -0,0 +1,169 @@ +#!/usr/bin/env python3.0 +''' Dbm based on sqlite -- Needed to support shelves + +Key and values are always stored as bytes. This means that when strings are +used they are implicitly converted to the default encoding before being +stored. + +Issues: + + # ??? how to coordinate with whichdb + # ??? Size of text fields fixed or varchar (do we need blobs) + # ??? 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 +''' + +__all__ = ['error', 'open'] + +import sqlite3 +import collections +from operator import itemgetter + +error = sqlite3.DatabaseError + +class SQLhash(collections.MutableMapping): + + def __init__(self, filename=':memory:', flags='r', mode=None): + # XXX add flag/mode handling + # c -- create if it doesn't exist + # n -- new empty + # 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)' + 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): + GET_LEN = 'SELECT COUNT(*) FROM shelf' + return self.conn.execute(GET_LEN).fetchone()[0] + + def keys(self): + return SQLhashKeysView(self) + + def values(self): + return SQLhashValuesView(self) + + def items(self): + return SQLhashItemsView(self) + + def __iter__(self): + 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 + + def __getitem__(self, key): + GET_ITEM = 'SELECT value FROM shelf WHERE key = ?' + item = self.conn.execute(GET_ITEM, (key,)).fetchone() + if item is None: + raise KeyError(key) + return item[0] + + 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 = ?' + self.conn.execute(DEL_ITEM, (key,)) + #self.conn.commit() + + def update(self, items=(), **kwds): + if isinstance(items, collections.Mapping): + items = items.items() + UPDATE_ITEMS = 'REPLACE INTO shelf (key, value) VALUES (?, ?)' + self.conn.executemany(UPDATE_ITEMS, items) + self.conn.commit() + if kwds: + self.update(kwds) + + def clear(self): + CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' + self.conn.executescript(CLEAR_ALL) + self.conn.commit() + + def close(self): + if self.conn is not None: + self.conn.commit() + self.conn.close() + self.conn = None + + def __del__(self): + self.close() + +class ListRepr: + + def __repr__(self): + return repr(list(self)) + +class SQLhashKeysView(collections.KeysView, ListRepr): + + def __iter__(self): + GET_KEYS = 'SELECT key FROM shelf ORDER BY ROWID' # ??? does order by result in diff opcodes + 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)) + +def open(file=None, *args): + if file is not None: + return SQLhash(file) + return SQLhash() + + +if __name__ in '__main___': + for d in SQLhash(), SQLhash('example'): + print(list(d), "start") + d['abc'] = 'lmno' + print(d['abc']) + d['abc'] = 'rsvp' + d['xyz'] = 'pdq' + print(d.items()) + print(d.values()) + print(d.keys()) + print(list(d), 'list') + d.update(p='x', q='y', r='z') + print(d.items()) + + del d['abc'] + try: + print(d['abc']) + except KeyError: + pass + else: + raise Exception('oh noooo!') + + try: + del d['abc'] + except KeyError: + pass + else: + raise Exception('drat!') + + print(list(d)) + d.clear() + print(list(d)) + d.update(p='x', q='y', r='z') + print(list(d)) + d['xyz'] = 'pdq' + + print() + d.close() From python-checkins at python.org Sat Jan 31 22:00:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 22:00:11 +0100 (CET) Subject: [Python-checkins] r69143 - python/trunk/Lib/heapq.py Message-ID: <20090131210011.172ED1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 22:00:10 2009 New Revision: 69143 Log: I believe the intention here was to avoid a global lookup Modified: python/trunk/Lib/heapq.py Modified: python/trunk/Lib/heapq.py ============================================================================== --- python/trunk/Lib/heapq.py (original) +++ python/trunk/Lib/heapq.py Sat Jan 31 22:00:10 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 From martin at v.loewis.de Sat Jan 31 22:20:35 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 31 Jan 2009 22:20:35 +0100 Subject: [Python-checkins] buildbot failure in OS X x86 trunk In-Reply-To: References: <20090131181739.1006E1E4002@bag.python.org> Message-ID: <4984C0A3.2070402@v.loewis.de> > Is it ok to disable test_ttk_guionly on mac for now ? I have noticed > this abort() several times now, and I don't have a mac around to test > things related to tcl. Sure, but please create a bug report also. Regards, Martin From python-checkins at python.org Sat Jan 31 22:21:22 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 22:21:22 +0100 (CET) Subject: [Python-checkins] r69144 - sandbox/trunk/release/release.py Message-ID: <20090131212122.E26B41E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 22:21:22 2009 New Revision: 69144 Log: touch opcode_targets.h, too Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Sat Jan 31 22:21:22 2009 @@ -261,8 +261,9 @@ os.unlink(name) except OSError: pass - print 'Touching Python-ast.h and Python-ast.c' - for name in ('Include/Python-ast.h', 'Python/Python-ast.c'): + 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'): os.utime(name, None) docdist = build_docs() @@ -273,7 +274,7 @@ shutil.rmtree('build') shutil.rmtree('dist') shutil.rmtree('tools/docutils') - shutil.rmtree('tools/jinja') + shutil.rmtree('tools/jinja2') shutil.rmtree('tools/pygments') shutil.rmtree('tools/sphinx') for dirpath, dirnames, filenames in os.walk('.'): From buildbot at python.org Sat Jan 31 22:30:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 21:30:28 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090131213028.A56D21E4002@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/575 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 BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipimport_support make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Jan 31 22:44:09 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 31 Jan 2009 22:44:09 +0100 (CET) Subject: [Python-checkins] r69145 - peps/trunk/pep-0374.txt Message-ID: <20090131214409.85BF11E4002@bag.python.org> Author: brett.cannon Date: Sat Jan 31 22:44:09 2009 New Revision: 69145 Log: De-emphasize release schedules. Also mention how Mercurial is now on a timed release schedule. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Jan 31 22:44:09 2009 @@ -1312,15 +1312,9 @@ Development =========== -All three projects are under active development to some degree. Both -Git and Bazaar seem to release on a monthly schedule. Mercurial, on -the other hand, seems to release roughly once a quarter. - -For the two Python-based DVCSs, the amount of time until a release -that is compatible with Python 2.6 can also be a sign of how active -the development is. Bazaar was compatible with 2.6 as of version 1.8 -which was released two weeks after 2.6 came out. Mercurial, on the -other hand, took two months to be compatible with its 1.1 release. +All three projects are under active development. Git seems to be on a +monthly release schedule. Bazaar is on a time-released monthly +schedule. Mercurial is on a 4-month, timed release schedule. Special Features From python-checkins at python.org Sat Jan 31 22:47:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 22:47:42 +0100 (CET) Subject: [Python-checkins] r69146 - python/trunk/Objects/unicodeobject.c Message-ID: <20090131214742.83D331E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 22:47:42 2009 New Revision: 69146 Log: fix indentation Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Jan 31 22:47:42 2009 @@ -1217,7 +1217,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1241,7 +1241,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (errors == NULL) { From python-checkins at python.org Sat Jan 31 22:53:16 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 31 Jan 2009 22:53:16 +0100 (CET) Subject: [Python-checkins] r69147 - in python/sandbox: x x/a Message-ID: <20090131215316.F04481E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 31 22:53:16 2009 New Revision: 69147 Log: Test import Added: python/sandbox/ python/sandbox/x/ python/sandbox/x/a (contents, props changed) Added: python/sandbox/x/a ============================================================================== From python-checkins at python.org Sat Jan 31 22:53:57 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 31 Jan 2009 22:53:57 +0100 (CET) Subject: [Python-checkins] r69148 - python/sandbox/x Message-ID: <20090131215357.4BA601E4002@bag.python.org> Author: martin.v.loewis Date: Sat Jan 31 22:53:57 2009 New Revision: 69148 Log: Remove test import. Removed: python/sandbox/x/ From python-checkins at python.org Sat Jan 31 23:03:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 23:03:20 +0100 (CET) Subject: [Python-checkins] r69149 - python/trunk/Objects/unicodeobject.c Message-ID: <20090131220320.10A6F1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 23:03:19 2009 New Revision: 69149 Log: fix indentation; looks like all I managed to do the first time is make things uglier Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Jan 31 23:03:19 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, @@ -196,9 +196,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) { @@ -225,29 +225,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)) { + (unicode->length == 1 && + unicode->str[0] < 256U && + unicode_latin1[unicode->str[0]] == unicode)) { PyErr_SetString(PyExc_SystemError, "can't resize shared unicode objects"); return -1; @@ -260,16 +260,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); @@ -284,7 +284,7 @@ Ux0000 terminated -- XXX is this needed ? 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. */ @@ -309,33 +309,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() @@ -351,7 +351,7 @@ unicode->defenc = NULL; return unicode; - onError: + onError: /* XXX UNREF/NEWREF interface should be more symmetrical */ _Py_DEC_REFTOTAL; _Py_ForgetReference((PyObject *)unicode); @@ -363,26 +363,26 @@ void unicode_dealloc(register PyUnicodeObject *unicode) { 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); } } @@ -393,28 +393,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 @@ -428,7 +428,7 @@ } PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -436,26 +436,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; + /* 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; } - Py_INCREF(unicode); - return (PyObject *)unicode; - } } unicode = _PyUnicode_New(size); @@ -464,7 +464,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; } @@ -475,7 +475,7 @@ if (size < 0) { PyErr_SetString(PyExc_SystemError, - "Negative size passed to PyUnicode_FromStringAndSize"); + "Negative size passed to PyUnicode_FromStringAndSize"); return NULL; } @@ -485,26 +485,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; + 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; } - Py_INCREF(unicode); - return (PyObject *)unicode; - } return PyUnicode_DecodeUTF8(u, size, NULL); } @@ -530,13 +530,13 @@ #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) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } unicode = _PyUnicode_New(size); @@ -548,11 +548,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 @@ -647,8 +647,8 @@ * they don't affect the amount of space we reserve. */ if ((*f == 'l' || *f == 'z') && - (f[1] == 'd' || f[1] == 'u')) - ++f; + (f[1] == 'd' || f[1] == 'u')) + ++f; switch (*f) { case 'c': @@ -691,11 +691,11 @@ s++; if(!*s)break; s++; } else { - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE n++; - #else +#else n+=2; - #endif +#endif s++; if(!*s)break; s++; if(!*s)break; s++; if(!*s)break; @@ -771,7 +771,7 @@ } else n++; } - expand: + expand: if (abuffersize > 20) { abuffer = PyObject_Malloc(abuffersize); if (!abuffer) { @@ -863,11 +863,11 @@ PyObject *u; p = va_arg(vargs, char*); u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); + "replace"); if (!u) goto fail; Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); + PyUnicode_GET_SIZE(u)); s += PyUnicode_GET_SIZE(u); Py_DECREF(u); break; @@ -934,14 +934,14 @@ *s++ = *f; } - end: + end: if (callresults) PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; - fail: + fail: if (callresults) { PyObject **callresult2 = callresults; while (callresult2 < callresult) { @@ -974,34 +974,34 @@ } 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 @@ -1012,17 +1012,17 @@ #ifdef Py_UNICODE_WIDE if (ordinal < 0 || ordinal > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x110000) " - "(wide Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x110000) " + "(wide Python build)"); + return NULL; } #else if (ordinal < 0 || ordinal > 0xffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x10000) " - "(narrow Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x10000) " + "(narrow Python build)"); + return NULL; } #endif @@ -1033,31 +1033,31 @@ PyObject *PyUnicode_FromObject(register PyObject *obj) { /* XXX Perhaps we should make this API an alias of - PyObject_Unicode() instead ?! */ + PyObject_Unicode() 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)); } return PyUnicode_FromEncodedObject(obj, NULL, "strict"); } 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 0 @@ -1067,22 +1067,22 @@ Unicode subclasses. NOTE: This API should really only be used for object which - represent *encoded* Unicode ! + represent *encoded* Unicode ! */ if (PyUnicode_Check(obj)) { if (encoding) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; - } - return PyObject_Unicode(obj); + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; } + return PyObject_Unicode(obj); + } #else if (PyUnicode_Check(obj)) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; } #endif @@ -1098,39 +1098,39 @@ return NULL; } 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)) - PyErr_Format(PyExc_TypeError, - "coercing to Unicode: need string or buffer, " - "%.80s found", - Py_TYPE(obj)->tp_name); - goto onError; + /* Overwrite the error message with something more useful in + case of a TypeError. */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_Format(PyExc_TypeError, + "coercing to Unicode: 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; if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (strcmp(encoding, "utf-8") == 0) @@ -1161,7 +1161,7 @@ Py_DECREF(buffer); return unicode; - onError: + onError: Py_XDECREF(buffer); return NULL; } @@ -1178,7 +1178,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1186,20 +1186,20 @@ goto onError; 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; @@ -1225,7 +1225,7 @@ goto onError; return v; - onError: + onError: return NULL; } @@ -1245,16 +1245,16 @@ /* 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); } /* Encode via the codec registry */ @@ -1270,12 +1270,12 @@ } return v; - onError: + onError: return NULL; } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; @@ -1295,7 +1295,7 @@ } return PyUnicode_AS_UNICODE(unicode); - onError: + onError: return NULL; } @@ -1307,7 +1307,7 @@ } return PyUnicode_GET_SIZE(unicode); - onError: + onError: return -1; } @@ -1324,14 +1324,14 @@ loads the encoding into the codec registry cache. */ v = _PyCodec_Lookup(encoding); if (v == NULL) - goto onError; + goto onError; Py_DECREF(v); strncpy(unicode_default_encoding, - encoding, - sizeof(unicode_default_encoding)); + encoding, + sizeof(unicode_default_encoding)); return 0; - onError: + onError: return -1; } @@ -1344,10 +1344,10 @@ static int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler, - const char *encoding, const char *reason, - const char *input, Py_ssize_t insize, 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, Py_ssize_t insize, 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 (unicode, int) tuple"; @@ -1361,40 +1361,40 @@ 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, insize, *startinpos, *endinpos, reason); - if (*exceptionObject == NULL) - goto onError; + encoding, input, insize, *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; 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 @@ -1405,11 +1405,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; @@ -1419,7 +1419,7 @@ /* we made it! */ res = 0; - onError: + onError: Py_XDECREF(restuple); return res; } @@ -1452,17 +1452,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) \ @@ -1491,16 +1491,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; @@ -1531,7 +1531,7 @@ while (s < e) { Py_UNICODE ch; - restart: + restart: ch = (unsigned char) *s; if (inShift) { @@ -1599,28 +1599,28 @@ s++; } continue; - utf7Error: + utf7Error: outpos = p-PyUnicode_AS_UNICODE(unicode); endinpos = s-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf7", errmsg, - starts, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + errors, &errorHandler, + "utf7", errmsg, + starts, size, &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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) + errors, &errorHandler, + "utf7", "unterminated shift sequence", + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) goto onError; if (s < e) - goto restart; + goto restart; } if (consumed) { if(inShift) @@ -1636,7 +1636,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -1645,10 +1645,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 */ @@ -1772,16 +1772,16 @@ }; 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); } 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; @@ -1822,72 +1822,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: @@ -1895,25 +1895,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: */ @@ -1931,24 +1931,24 @@ 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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + utf8Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf8", errmsg, + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -1958,7 +1958,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -1972,8 +1972,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 */ @@ -2039,7 +2039,7 @@ *p++ = (char)(0x80 | (ch & 0x3f)); continue; } -encodeUCS4: + encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); @@ -2072,27 +2072,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; @@ -2120,8 +2120,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 */ @@ -2146,27 +2146,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) { @@ -2185,54 +2185,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]]; + 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; - } + 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 + 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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + *p++ = ch; + q += 4; + continue; + utf32Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf32", errmsg, + starts, size, &startinpos, &endinpos, &exc, &s, + &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) @@ -2242,7 +2242,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2251,9 +2251,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; @@ -2270,34 +2270,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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2317,16 +2317,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); } @@ -2341,28 +2341,28 @@ 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); } 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; @@ -2406,25 +2406,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) { @@ -2439,74 +2439,74 @@ } while (q < e) { - Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[ihi] << 8) | q[ilo]; + Py_UNICODE ch; + /* remaining bytes at the end? (size should be even) */ + if (e-q<2) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf16Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + 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)-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)-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; + 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 */ - } - 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, - starts, size, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + utf16Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf16", errmsg, + starts, size, &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) @@ -2516,7 +2516,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2525,9 +2525,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; @@ -2544,33 +2544,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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2586,13 +2586,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) @@ -2609,9 +2609,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 ----------------------------------------------- */ @@ -2619,8 +2619,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; @@ -2668,7 +2668,7 @@ c = '\0'; /* Invalid after \ */ switch (c) { - /* \x escapes */ + /* \x escapes */ case '\n': break; case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; @@ -2681,7 +2681,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'; @@ -2693,20 +2693,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"; @@ -2716,10 +2716,10 @@ if (s+digits>end) { endinpos = size; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "end of string in escape sequence", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "end of string in escape sequence", + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2728,10 +2728,10 @@ if (!isxdigit(c)) { endinpos = (s+i+1)-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2767,15 +2767,15 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "illegal Unicode character", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "illegal Unicode character", + starts, size, &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) { @@ -2809,10 +2809,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; break; @@ -2823,10 +2823,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; } else { @@ -2835,7 +2835,7 @@ } break; } - nextByte: + nextByte: ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) @@ -2844,7 +2844,7 @@ Py_XDECREF(exc); return (PyObject *)v; -ucnhashError: + ucnhashError: PyErr_SetString( PyExc_UnicodeError, "\\N escapes not supported (can't load unicodedata module)" @@ -2854,7 +2854,7 @@ Py_XDECREF(exc); return NULL; -onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2869,8 +2869,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 */ @@ -2917,12 +2917,12 @@ */ if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyString_FromStringAndSize(NULL, - 2 - + expandsize*size - + 1); + 2 + + expandsize*size + + 1); if (repr == NULL) return NULL; @@ -2938,10 +2938,10 @@ /* Escape quotes and backslashes */ if ((quotes && - ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { + ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { *p++ = '\\'; *p++ = (char) ch; - continue; + continue; } #ifdef Py_UNICODE_WIDE @@ -2957,34 +2957,34 @@ *p++ = hexdigit[(ch >> 8) & 0x0000000F]; *p++ = hexdigit[(ch >> 4) & 0x0000000F]; *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigit[ucs & 0x0000000F]; - continue; + /* 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++ = hexdigit[(ucs >> 28) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; + *p++ = hexdigit[ucs & 0x0000000F]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3032,7 +3032,7 @@ } PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { return unicodeescape_string(s, size, 0); } @@ -3044,14 +3044,14 @@ return NULL; } return PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3070,75 +3070,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; + /* 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--; + /* \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, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; - goto nextByte; + /* \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, size, &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'; } - 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; @@ -3146,20 +3146,20 @@ if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; + starts, size, &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); @@ -3167,7 +3167,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3181,20 +3181,20 @@ #endif if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyString_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) - return repr; + return repr; p = q = PyString_AS_STRING(repr); 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++ = hexdigit[(ch >> 28) & 0xf]; @@ -3208,34 +3208,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++ = hexdigit[(ucs >> 28) & 0xf]; - *p++ = hexdigit[(ucs >> 24) & 0xf]; - *p++ = hexdigit[(ucs >> 20) & 0xf]; - *p++ = hexdigit[(ucs >> 16) & 0xf]; - *p++ = hexdigit[(ucs >> 12) & 0xf]; - *p++ = hexdigit[(ucs >> 8) & 0xf]; - *p++ = hexdigit[(ucs >> 4) & 0xf]; - *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0xf]; + *p++ = hexdigit[(ucs >> 24) & 0xf]; + *p++ = hexdigit[(ucs >> 20) & 0xf]; + *p++ = hexdigit[(ucs >> 16) & 0xf]; + *p++ = hexdigit[(ucs >> 12) & 0xf]; + *p++ = hexdigit[(ucs >> 8) & 0xf]; + *p++ = hexdigit[(ucs >> 4) & 0xf]; + *p++ = hexdigit[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++ = hexdigit[(ch >> 12) & 0xf]; @@ -3243,8 +3243,8 @@ *p++ = hexdigit[(ch >> 4) & 0xf]; *p++ = hexdigit[ch & 15]; } - /* Copy everything else as-is */ - else + /* Copy everything else as-is */ + else *p++ = (char) ch; } *p = '\0'; @@ -3255,18 +3255,18 @@ PyObject *PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3286,9 +3286,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; @@ -3297,12 +3297,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; @@ -3333,7 +3333,7 @@ Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3343,69 +3343,69 @@ /* --- 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; /* 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); while (size-- > 0) - *p++ = (unsigned char)*s++; + *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: @@ -3413,11 +3413,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 (unicode, int) tuple"; @@ -3425,36 +3425,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); @@ -3462,9 +3462,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; @@ -3492,144 +3492,144 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; str = PyString_AS_STRING(res); 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; + /* can we encode this? */ + if (c=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 (_PyString_Resize(&res, requiredsize)) - goto onError; - str = PyString_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-PyString_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyString_Resize(&res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyString_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); + } + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyString_Resize(&res, requiredsize)) + goto onError; + str = PyString_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-PyString_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyString_Resize(&res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyString_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); - goto onError; } - *str = (char)c; - } - p = startp + newpos; - Py_DECREF(repunicode); } } - } /* Resize if we allocated to much */ respos = str-PyString_AS_STRING(res); if (respos= 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 @@ -3849,8 +3849,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); } @@ -3860,8 +3860,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; @@ -3870,63 +3870,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 = PyString_FromStringAndSize(NULL, mbcssize); - if (*repr == NULL) - return -1; + /* Create string object */ + *repr = PyString_FromStringAndSize(NULL, mbcssize); + if (*repr == NULL) + return -1; } else { - /* Extend string object */ - n = PyString_Size(*repr); - if (_PyString_Resize(repr, n + mbcssize) < 0) - return -1; + /* Extend string object */ + n = PyString_Size(*repr); + if (_PyString_Resize(repr, n + mbcssize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - char *s = PyString_AS_STRING(*repr) + n; - if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + char *s = PyString_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 @@ -3940,8 +3940,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -3951,9 +3951,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; @@ -3970,141 +3970,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 */ + 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 (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, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) { - goto onError; - } - continue; + 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, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) { + goto onError; + } + continue; + } + *p++ = x; + ++s; } - *p++ = x; - ++s; - } } else { - while (s < e) { - unsigned char ch = *s; - PyObject *w, *x; - - /* Get mapping (char ordinal -> integer, Unicode char or None) */ - w = PyInt_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; - } + while (s < e) { + unsigned char ch = *s; + PyObject *w, *x; + + /* Get mapping (char ordinal -> integer, Unicode char or None) */ + w = PyInt_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 (PyInt_Check(x)) { - long value = PyInt_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, size, &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); + /* Apply mapping */ + if (PyInt_Check(x)) { + long value = PyInt_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, size, &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) { + 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 unicode"); 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 unicode"); - Py_DECREF(x); - goto onError; + Py_DECREF(x); + ++s; } - 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); @@ -4114,10 +4114,10 @@ /* 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* @@ -4130,8 +4130,8 @@ static PyMethodDef encoding_map_methods[] = { {"size", encoding_map_size, METH_NOARGS, - PyDoc_STR("Return the size (in bytes) of this object") }, - { 0 } + PyDoc_STR("Return the size (in bytes) of this object") }, + { 0 } }; static void @@ -4142,46 +4142,46 @@ 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*/ + "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* @@ -4213,10 +4213,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; } @@ -4302,7 +4302,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4334,39 +4334,39 @@ 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 (PyInt_Check(x)) { - long value = PyInt_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 = PyInt_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 (PyString_Check(x)) - return x; + return x; else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - return NULL; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + return NULL; } } @@ -4384,7 +4384,7 @@ } typedef enum charmapencode_result { - enc_SUCCESS, enc_FAILED, enc_EXCEPTION + enc_SUCCESS, enc_FAILED, enc_EXCEPTION }charmapencode_result; /* lookup the character, put the result in the output string and adjust various state variables. Reallocate the output string if not enough @@ -4394,7 +4394,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; @@ -4402,47 +4402,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; - } + 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); @@ -4567,9 +4567,9 @@ } 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; @@ -4586,7 +4586,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 */ @@ -4594,36 +4594,36 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; while (inpos adjust input position */ - ++inpos; + else + /* done with this character => adjust input position */ + ++inpos; } /* Resize if we allocated to much */ if (respossize) { - 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); @@ -4745,63 +4745,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 (PyInt_Check(x)) { - long value = PyInt_AS_LONG(x); - long max = PyUnicode_GetMax(); - if (value < 0 || value > max) { - PyErr_Format(PyExc_TypeError, - "character mapping must be in range(0x%lx)", max+1); - Py_DECREF(x); - return -1; - } - *result = x; - return 0; + long value = PyInt_AS_LONG(x); + long max = PyUnicode_GetMax(); + if (value < 0 || value > max) { + PyErr_Format(PyExc_TypeError, + "character mapping must be in range(0x%lx)", max+1); + 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 unicode"); - Py_DECREF(x); - return -1; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or unicode"); + 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; } @@ -4813,47 +4813,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 (PyInt_Check(*res)) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = (Py_UNICODE)PyInt_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; + *(*outp)++ = (Py_UNICODE)PyInt_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; + } } 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; @@ -4873,119 +4873,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)) + /* 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) - 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; coll 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; } - p = collend; - break; - default: - repunicode = unicode_translate_call_errorhandler(errors, &errorHandler, - reason, startp, size, &exc, - collstart-startp, collend-startp, &newpos); - if (repunicode == NULL) - goto onError; - /* generate replacement */ - repsize = PyUnicode_GET_SIZE(repunicode); - if (charmaptranslate_makespace(&res, &str, - (str-PyUnicode_AS_UNICODE(res))+repsize+(endp-collend))) { - Py_DECREF(repunicode); - goto onError; + /* 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); } - for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++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) { + 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; + 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 */ + for (p = collstart; p < collend; ++p) + *output++ = '?'; + /* fall through */ case 3: /* ignore */ - p = collend; - break; + 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; + /* 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); + 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); } - p = s + newpos; - Py_DECREF(repunicode); - } } /* 0-terminate the output string */ *output++ = '\0'; @@ -5138,7 +5138,7 @@ Py_XDECREF(errorHandler); return 0; - onError: + onError: Py_XDECREF(exc); Py_XDECREF(errorHandler); return -1; @@ -5180,11 +5180,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); @@ -5209,11 +5209,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) @@ -5237,10 +5237,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; @@ -5249,39 +5249,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; @@ -5292,24 +5292,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; } @@ -5322,13 +5322,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++; } @@ -5343,13 +5343,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++; } @@ -5385,10 +5385,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) { @@ -5410,31 +5410,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 (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 (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5475,29 +5475,29 @@ } /* If singleton sequence with an exact Unicode, return that. */ if (seqlen == 1) { - item = PySequence_Fast_GET_ITEM(fseq, 0); - if (PyUnicode_CheckExact(item)) { - Py_INCREF(item); - res = (PyUnicodeObject *)item; - goto Done; - } + item = PySequence_Fast_GET_ITEM(fseq, 0); + if (PyUnicode_CheckExact(item)) { + Py_INCREF(item); + res = (PyUnicodeObject *)item; + goto Done; + } } /* At least two items to join, or one that isn't exact Unicode. */ if (seqlen > 1) { /* Set up sep and seplen -- they're needed. */ if (separator == NULL) { - sep = ␣ - seplen = 1; + sep = ␣ + seplen = 1; } else { - internal_separator = PyUnicode_FromObject(separator); - if (internal_separator == NULL) - goto onError; - sep = PyUnicode_AS_UNICODE(internal_separator); - seplen = PyUnicode_GET_SIZE(internal_separator); - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + internal_separator = PyUnicode_FromObject(separator); + if (internal_separator == NULL) + goto onError; + sep = PyUnicode_AS_UNICODE(internal_separator); + seplen = PyUnicode_GET_SIZE(internal_separator); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); } } @@ -5509,79 +5509,79 @@ res_used = 0; for (i = 0; i < seqlen; ++i) { - Py_ssize_t itemlen; - Py_ssize_t new_res_used; + Py_ssize_t itemlen; + Py_ssize_t new_res_used; - item = PySequence_Fast_GET_ITEM(fseq, i); - /* Convert item to Unicode. */ - if (! PyUnicode_Check(item) && ! PyString_Check(item)) { - PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected string or Unicode," - " %.80s found", - i, Py_TYPE(item)->tp_name); - goto onError; - } - item = PyUnicode_FromObject(item); - if (item == NULL) - goto onError; - /* We own a reference to item from here on. */ + item = PySequence_Fast_GET_ITEM(fseq, i); + /* Convert item to Unicode. */ + if (! PyUnicode_Check(item) && ! PyString_Check(item)) { + PyErr_Format(PyExc_TypeError, + "sequence item %zd: expected string or Unicode," + " %.80s found", + i, Py_TYPE(item)->tp_name); + goto onError; + } + item = PyUnicode_FromObject(item); + if (item == NULL) + goto onError; + /* We own a reference to item from here on. */ - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); /* Make sure we have enough space for the separator and the item. */ - itemlen = PyUnicode_GET_SIZE(item); - new_res_used = res_used + itemlen; - if (new_res_used < 0) - goto Overflow; - if (i < seqlen - 1) { - new_res_used += seplen; + itemlen = PyUnicode_GET_SIZE(item); + new_res_used = res_used + itemlen; if (new_res_used < 0) - goto Overflow; - } - if (new_res_used > res_alloc) { - /* double allocated size until it's big enough */ - do { - res_alloc += res_alloc; - if (res_alloc <= 0) + goto Overflow; + if (i < seqlen - 1) { + new_res_used += seplen; + if (new_res_used < 0) goto Overflow; - } while (new_res_used > res_alloc); - if (_PyUnicode_Resize(&res, res_alloc) < 0) { - Py_DECREF(item); - goto onError; } + if (new_res_used > res_alloc) { + /* double allocated size until it's big enough */ + do { + res_alloc += res_alloc; + if (res_alloc <= 0) + goto Overflow; + } while (new_res_used > res_alloc); + if (_PyUnicode_Resize(&res, res_alloc) < 0) { + Py_DECREF(item); + goto onError; + } res_p = PyUnicode_AS_UNICODE(res) + res_used; - } + } - /* Copy item, and maybe the separator. */ - Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); - res_p += itemlen; - if (i < seqlen - 1) { - Py_UNICODE_COPY(res_p, sep, seplen); - res_p += seplen; - } - Py_DECREF(item); - res_used = new_res_used; + /* Copy item, and maybe the separator. */ + Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); + res_p += itemlen; + if (i < seqlen - 1) { + Py_UNICODE_COPY(res_p, sep, seplen); + res_p += seplen; + } + Py_DECREF(item); + res_used = new_res_used; } /* Shrink res to match the used area; this probably can't fail, * but it's cheap to check. */ if (_PyUnicode_Resize(&res, res_used) < 0) - goto onError; + goto onError; - Done: + Done: Py_XDECREF(internal_separator); Py_DECREF(fseq); return (PyObject *)res; - Overflow: + Overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); Py_DECREF(item); /* fall through */ - onError: + onError: Py_XDECREF(internal_separator); Py_DECREF(fseq); Py_XDECREF(res); @@ -5590,9 +5590,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; @@ -5623,21 +5623,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; @@ -5646,33 +5646,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); + /* find a token */ while (i < len && Py_UNICODE_ISSPACE(buf[i])) - 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; @@ -5683,7 +5683,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -5692,34 +5692,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) + /* 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; - } - SPLIT_APPEND(data, j, eol); - j = 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; @@ -5727,9 +5727,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; @@ -5738,29 +5738,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; @@ -5769,28 +5769,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; @@ -5799,38 +5799,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); + /* find a token */ while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - 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 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; @@ -5839,31 +5839,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 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; @@ -5872,23 +5872,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; } @@ -5897,8 +5897,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -5910,24 +5910,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; @@ -5939,30 +5939,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 */ @@ -6048,7 +6048,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6079,7 +6079,7 @@ } return (PyObject *) u; -nothing: + nothing: /* nothing to replace; return original string (when possible) */ if (PyUnicode_CheckExact(self)) { Py_INCREF(self); @@ -6091,7 +6091,7 @@ /* --- Unicode Object Methods --------------------------------------------- */ PyDoc_STRVAR(title__doc__, -"S.title() -> unicode\n\ + "S.title() -> unicode\n\ \n\ Return a titlecased version of S, i.e. words start with title case\n\ characters, all remaining cased characters have lower case."); @@ -6103,7 +6103,7 @@ } PyDoc_STRVAR(capitalize__doc__, -"S.capitalize() -> unicode\n\ + "S.capitalize() -> unicode\n\ \n\ Return a capitalized version of S, i.e. make the first character\n\ have upper case."); @@ -6116,7 +6116,7 @@ #if 0 PyDoc_STRVAR(capwords__doc__, -"S.capwords() -> unicode\n\ + "S.capwords() -> unicode\n\ \n\ Apply .capitalize() to all words in S and return the result with\n\ normalized whitespace (all whitespace strings are replaced by ' ')."); @@ -6136,7 +6136,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)); @@ -6146,7 +6146,7 @@ /* Join the words to form a new string */ item = PyUnicode_Join(NULL, list); -onError: + onError: Py_DECREF(list); return (PyObject *)item; } @@ -6164,12 +6164,12 @@ uniobj = PyUnicode_FromObject(obj); if (uniobj == NULL) { PyErr_SetString(PyExc_TypeError, - "The fill character cannot be converted to Unicode"); + "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"); + "The fill character must be exactly one character long"); Py_DECREF(uniobj); return 0; } @@ -6180,7 +6180,7 @@ } PyDoc_STRVAR(center__doc__, -"S.center(width[, fillchar]) -> unicode\n\ + "S.center(width[, fillchar]) -> unicode\n\ \n\ Return S centered in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)"); @@ -6241,9 +6241,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 */ @@ -6287,7 +6287,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { PyUnicodeObject *u = NULL, *v = NULL; int result; @@ -6295,16 +6295,16 @@ /* 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; /* Shortcut for empty or interned objects */ if (v == u) { - Py_DECREF(u); - Py_DECREF(v); - return 0; + Py_DECREF(u); + Py_DECREF(v); + return 0; } result = unicode_compare(u, v); @@ -6313,7 +6313,7 @@ Py_DECREF(v); return result; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return -1; @@ -6352,7 +6352,7 @@ } return PyBool_FromLong(result); - onError: + onError: /* Standard case @@ -6389,14 +6389,14 @@ "Unicode unequal comparison " "failed to convert both arguments to Unicode - " "interpreting them as being unequal" - ) < 0) + ) < 0) return NULL; result = (op == Py_NE); return PyBool_FromLong(result); } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6404,8 +6404,8 @@ /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_SetString(PyExc_TypeError, - "'in ' requires string as left operand"); + PyErr_SetString(PyExc_TypeError, + "'in ' requires string as left operand"); return -1; } @@ -6426,32 +6426,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); @@ -6459,14 +6459,14 @@ Py_DECREF(v); return (PyObject *)w; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return NULL; } 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\ Unicode string S[start:end]. Optional arguments start and end are\n\ @@ -6481,13 +6481,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); @@ -6502,7 +6502,7 @@ } PyDoc_STRVAR(encode__doc__, -"S.encode([encoding[,errors]]) -> string or unicode\n\ + "S.encode([encoding[,errors]]) -> string or unicode\n\ \n\ Encodes S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ @@ -6533,12 +6533,12 @@ } return v; - onError: + onError: return NULL; } PyDoc_STRVAR(decode__doc__, -"S.decode([encoding[,errors]]) -> string or unicode\n\ + "S.decode([encoding[,errors]]) -> string or unicode\n\ \n\ Decodes S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ @@ -6569,12 +6569,12 @@ } return v; - onError: + onError: return NULL; } PyDoc_STRVAR(expandtabs__doc__, -"S.expandtabs([tabsize]) -> unicode\n\ + "S.expandtabs([tabsize]) -> unicode\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."); @@ -6591,7 +6591,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 */ @@ -6599,27 +6599,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); @@ -6632,20 +6632,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++ = ' '; + 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; + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -6661,7 +6661,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\ @@ -6716,21 +6716,21 @@ register long x; if (self->hash != -1) - return self->hash; + return self->hash; len = PyUnicode_GET_SIZE(self); p = PyUnicode_AS_UNICODE(self); x = *p << 7; while (--len >= 0) - x = (1000003*x) ^ *p++; + x = (1000003*x) ^ *p++; x ^= PyUnicode_GET_SIZE(self); if (x == -1) - x = -2; + x = -2; self->hash = x; return x; } 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."); @@ -6762,7 +6762,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."); @@ -6776,27 +6776,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."); @@ -6810,27 +6810,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\ @@ -6846,39 +6846,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."); @@ -6891,23 +6891,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."); @@ -6920,23 +6920,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."); @@ -6949,23 +6949,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."); @@ -6978,23 +6978,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."); @@ -7007,23 +7007,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."); @@ -7036,23 +7036,23 @@ /* 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); } PyDoc_STRVAR(join__doc__, -"S.join(sequence) -> unicode\n\ + "S.join(sequence) -> unicode\n\ \n\ Return a string which is the concatenation of the strings in the\n\ sequence. The separator between elements is S."); @@ -7070,7 +7070,7 @@ } PyDoc_STRVAR(ljust__doc__, -"S.ljust(width[, fillchar]) -> int\n\ + "S.ljust(width[, fillchar]) -> int\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)."); @@ -7093,7 +7093,7 @@ } PyDoc_STRVAR(lower__doc__, -"S.lower() -> unicode\n\ + "S.lower() -> unicode\n\ \n\ Return a copy of the string S converted to lowercase."); @@ -7122,29 +7122,29 @@ Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); Py_ssize_t i, j; - BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); + BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); i = 0; if (striptype != RIGHTSTRIP) { - while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { - i++; - } + 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++; + 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; + Py_INCREF(self); + return (PyObject*)self; } else - return PyUnicode_FromUnicode(s+i, j-i); + return PyUnicode_FromUnicode(s+i, j-i); } @@ -7200,8 +7200,8 @@ } else { PyErr_Format(PyExc_TypeError, - "%s arg must be None, unicode or str", - STRIPNAME(striptype)); + "%s arg must be None, unicode or str", + STRIPNAME(striptype)); return NULL; } } @@ -7211,7 +7211,7 @@ PyDoc_STRVAR(strip__doc__, -"S.strip([chars]) -> unicode\n\ + "S.strip([chars]) -> unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ @@ -7229,7 +7229,7 @@ PyDoc_STRVAR(lstrip__doc__, -"S.lstrip([chars]) -> unicode\n\ + "S.lstrip([chars]) -> unicode\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.\n\ @@ -7246,7 +7246,7 @@ PyDoc_STRVAR(rstrip__doc__, -"S.rstrip([chars]) -> unicode\n\ + "S.rstrip([chars]) -> unicode\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.\n\ @@ -7303,25 +7303,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; @@ -7330,22 +7330,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); @@ -7353,7 +7353,7 @@ } PyDoc_STRVAR(replace__doc__, -"S.replace (old, new[, count]) -> unicode\n\ + "S.replace (old, new[, count]) -> unicode\n\ \n\ Return a copy of S with all occurrences of substring\n\ old replaced by new. If the optional argument count is\n\ @@ -7371,11 +7371,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); @@ -7389,12 +7389,12 @@ PyObject *unicode_repr(PyObject *unicode) { return unicodeescape_string(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - 1); + PyUnicode_GET_SIZE(unicode), + 1); } 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\ @@ -7425,7 +7425,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."); @@ -7456,7 +7456,7 @@ } PyDoc_STRVAR(rjust__doc__, -"S.rjust(width[, fillchar]) -> unicode\n\ + "S.rjust(width[, fillchar]) -> unicode\n\ \n\ Return S right-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); @@ -7497,24 +7497,24 @@ start = end; /* copy slice */ return (PyObject*) PyUnicode_FromUnicode(self->str + start, - end - start); + end - start); } 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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != NULL) { + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = split((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -7525,7 +7525,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\ @@ -7543,11 +7543,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 * @@ -7559,7 +7559,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); @@ -7587,7 +7587,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); @@ -7606,7 +7606,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\ @@ -7619,7 +7619,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\ @@ -7632,20 +7632,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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != NULL) { + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = rsplit((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -7656,7 +7656,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\ @@ -7674,15 +7674,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\ @@ -7706,7 +7706,7 @@ } PyDoc_STRVAR(swapcase__doc__, -"S.swapcase() -> unicode\n\ + "S.swapcase() -> unicode\n\ \n\ Return a copy of S with uppercase characters converted to lowercase\n\ and vice versa."); @@ -7718,7 +7718,7 @@ } PyDoc_STRVAR(translate__doc__, -"S.translate(table) -> unicode\n\ + "S.translate(table) -> unicode\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\ @@ -7730,13 +7730,13 @@ unicode_translate(PyUnicodeObject *self, PyObject *table) { return PyUnicode_TranslateCharmap(self->str, - self->length, - table, - "ignore"); + self->length, + table, + "ignore"); } PyDoc_STRVAR(upper__doc__, -"S.upper() -> unicode\n\ + "S.upper() -> unicode\n\ \n\ Return a copy of S converted to uppercase."); @@ -7747,7 +7747,7 @@ } PyDoc_STRVAR(zfill__doc__, -"S.zfill(width) -> unicode\n\ + "S.zfill(width) -> unicode\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."); @@ -7771,7 +7771,7 @@ return PyUnicode_FromUnicode( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self) - ); + ); } fill = width - self->length; @@ -7799,7 +7799,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\ @@ -7808,7 +7808,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7817,13 +7817,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); @@ -7837,7 +7837,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); @@ -7845,7 +7845,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\ @@ -7854,7 +7854,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7863,15 +7863,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) { @@ -7882,7 +7882,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); @@ -7894,7 +7894,7 @@ #include "stringlib/string_format.h" PyDoc_STRVAR(format__doc__, -"S.format(*args, **kwargs) -> unicode\n\ + "S.format(*args, **kwargs) -> unicode\n\ \n\ "); @@ -7911,7 +7911,7 @@ goto done; if (!(PyBytes_Check(format_spec) || PyUnicode_Check(format_spec))) { PyErr_Format(PyExc_TypeError, "__format__ arg must be str " - "or unicode, not %s", Py_TYPE(format_spec)->tp_name); + "or unicode, not %s", Py_TYPE(format_spec)->tp_name); goto done; } tmp = PyObject_Unicode(format_spec); @@ -7922,13 +7922,13 @@ result = _PyUnicode_FormatAdvanced(self, PyUnicode_AS_UNICODE(format_spec), PyUnicode_GET_SIZE(format_spec)); -done: + done: Py_XDECREF(tmp); return result; } PyDoc_STRVAR(p_format__doc__, -"S.__format__(format_spec) -> unicode\n\ + "S.__format__(format_spec) -> unicode\n\ \n\ "); @@ -7940,7 +7940,7 @@ } PyDoc_STRVAR(sizeof__doc__, -"S.__sizeof__() -> size of S in memory, in bytes\n\ + "S.__sizeof__() -> size of S in memory, in bytes\n\ \n\ "); @@ -8017,11 +8017,11 @@ 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 = { @@ -8060,7 +8060,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8077,8 +8077,8 @@ 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]; @@ -8102,12 +8102,12 @@ static Py_ssize_t unicode_buffer_getreadbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } *ptr = (void *) self->str; @@ -8116,16 +8116,16 @@ static Py_ssize_t unicode_buffer_getwritebuf(PyUnicodeObject *self, Py_ssize_t index, - const void **ptr) + const void **ptr) { PyErr_SetString(PyExc_TypeError, - "cannot use unicode as modifiable buffer"); + "cannot use unicode as modifiable buffer"); return -1; } static int unicode_buffer_getsegcount(PyUnicodeObject *self, - Py_ssize_t *lenp) + Py_ssize_t *lenp) { if (lenp) *lenp = PyUnicode_GET_DATA_SIZE(self); @@ -8134,19 +8134,19 @@ static Py_ssize_t unicode_buffer_getcharbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { PyObject *str; if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } str = _PyUnicode_AsDefaultEncodedString((PyObject *)self, NULL); if (str == NULL) - return -1; + return -1; *ptr = (void *) PyString_AS_STRING(str); return PyString_GET_SIZE(str); } @@ -8158,14 +8158,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; } @@ -8181,7 +8181,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; } @@ -8212,11 +8212,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)*/ @@ -8225,37 +8225,37 @@ 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; + 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); } @@ -8284,11 +8284,11 @@ 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) @@ -8317,7 +8317,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; } @@ -8364,46 +8364,46 @@ { /* presume that the buffer is at least 2 characters long */ if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) != 1) - goto onError; - buf[0] = PyUnicode_AS_UNICODE(v)[0]; + if (PyUnicode_GET_SIZE(v) != 1) + goto onError; + buf[0] = PyUnicode_AS_UNICODE(v)[0]; } else if (PyString_Check(v)) { - if (PyString_GET_SIZE(v) != 1) - goto onError; - buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; + if (PyString_GET_SIZE(v) != 1) + goto onError; + buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; } else { - /* Integer input truncated to a character */ + /* Integer input truncated to a character */ long x; - x = PyInt_AsLong(v); - if (x == -1 && PyErr_Occurred()) - goto onError; + x = PyInt_AsLong(v); + if (x == -1 && PyErr_Occurred()) + goto onError; #ifdef Py_UNICODE_WIDE - if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000) " - "(wide Python build)"); - return -1; - } + if (x < 0 || x > 0x10ffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x110000) " + "(wide Python build)"); + return -1; + } #else - if (x < 0 || x > 0xffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x10000) " - "(narrow Python build)"); - return -1; - } + if (x < 0 || x > 0xffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x10000) " + "(narrow Python build)"); + return -1; + } #endif - buf[0] = (Py_UNICODE) x; + 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; } @@ -8418,7 +8418,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; @@ -8428,449 +8428,449 @@ 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) && !PyObject_TypeCheck(args, &PyBaseString_Type)) - 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; + 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++; } - *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; + 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}() */ - 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 == '(') { + 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - width = PyInt_AsLong(v); - 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - 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; } - prec = PyInt_AsLong(v); - 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') + 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 ((prec*10) / 10 != prec) { + } + if (c == '*') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + if (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + width = PyInt_AsLong(v); + 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 (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + prec = PyInt_AsLong(v); + 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, - "prec too big"); + "incomplete format"); goto onError; } - prec = prec*10 + (c - '0'); + if (c != '%') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; } - } - } /* 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) { + sign = 0; + fill = ' '; + switch (c) { - case '%': - pbuf = formatbuf; - /* presume that buffer length is at least 1 */ - pbuf[0] = '%'; - len = 1; - break; + case '%': + pbuf = formatbuf; + /* presume that buffer length is at least 1 */ + pbuf[0] = '%'; + len = 1; + break; - case 's': - case 'r': - if (PyUnicode_Check(v) && c == 's') { - temp = v; - Py_INCREF(temp); - } - else { - PyObject *unicode; - if (c == 's') - temp = PyObject_Unicode(v); - else - temp = PyObject_Repr(v); - if (temp == NULL) - goto onError; + case 's': + case 'r': + if (PyUnicode_Check(v) && c == 's') { + temp = v; + Py_INCREF(temp); + } + else { + PyObject *unicode; + if (c == 's') + temp = PyObject_Unicode(v); + else + temp = PyObject_Repr(v); + if (temp == NULL) + goto onError; if (PyUnicode_Check(temp)) /* nothing to do */; else if (PyString_Check(temp)) { /* convert to string to Unicode */ - unicode = PyUnicode_Decode(PyString_AS_STRING(temp), - PyString_GET_SIZE(temp), - NULL, - "strict"); - Py_DECREF(temp); - temp = unicode; - if (temp == NULL) - goto onError; - } - 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 (PyInt_Check(v) || (PyLong_Check(v))) { - iobj = v; - Py_INCREF(iobj); - } - else { - iobj = PyNumber_Int(v); - if (iobj==NULL) iobj = PyNumber_Long(v); - } - if (iobj!=NULL) { - if (PyInt_Check(iobj)) { - isnumok = 1; - pbuf = formatbuf; - len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, iobj); - Py_DECREF(iobj); - if (len < 0) + unicode = PyUnicode_Decode(PyString_AS_STRING(temp), + PyString_GET_SIZE(temp), + NULL, + "strict"); + Py_DECREF(temp); + temp = unicode; + if (temp == NULL) + goto onError; + } + else { + Py_DECREF(temp); + PyErr_SetString(PyExc_TypeError, + "%s argument has non-string str()"); goto onError; - sign = 1; + } } - else 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; + 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 (PyInt_Check(v) || (PyLong_Check(v))) { + iobj = v; + Py_INCREF(iobj); + } + else { + iobj = PyNumber_Int(v); + if (iobj==NULL) iobj = PyNumber_Long(v); + } + if (iobj!=NULL) { + if (PyInt_Check(iobj)) { + isnumok = 1; + pbuf = formatbuf; + len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), + flags, prec, c, iobj); + Py_DECREF(iobj); + if (len < 0) + goto onError; + sign = 1; + } + else 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); + } + } } - 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 (!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; + 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 '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; + 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 : '?', + 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')) { - 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')) { - 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')) { + 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')) { + 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; } @@ -8888,7 +8888,7 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *x = NULL; + PyObject *x = NULL; static char *kwlist[] = {"string", "encoding", "errors", 0}; char *encoding = NULL; char *errors = NULL; @@ -8896,14 +8896,14 @@ if (type != &PyUnicode_Type) return unicode_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:unicode", - kwlist, &x, &encoding, &errors)) + kwlist, &x, &encoding, &errors)) return NULL; if (x == NULL) return (PyObject *)_PyUnicode_New(0); if (encoding == NULL && errors == NULL) return PyObject_Unicode(x); else - return PyUnicode_FromEncodedObject(x, encoding, errors); + return PyUnicode_FromEncodedObject(x, encoding, errors); } static PyObject * @@ -8937,7 +8937,7 @@ } PyDoc_STRVAR(unicode_doc, -"unicode(string [, encoding[, errors]]) -> object\n\ + "unicode(string [, encoding[, errors]]) -> object\n\ \n\ Create a new Unicode object from the given encoded string.\n\ encoding defaults to the current default string encoding.\n\ @@ -8965,7 +8965,7 @@ 0, /* tp_setattro */ &unicode_as_buffer, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | - Py_TPFLAGS_BASETYPE | Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ + Py_TPFLAGS_BASETYPE | Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -9010,13 +9010,13 @@ numfree = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) - return; + return; strcpy(unicode_default_encoding, "ascii"); 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( @@ -9035,13 +9035,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); @@ -9057,10 +9057,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(); } @@ -9071,8 +9071,8 @@ /* -Local variables: -c-basic-offset: 4 -indent-tabs-mode: nil -End: + Local variables: + c-basic-offset: 4 + indent-tabs-mode: nil + End: */ From python-checkins at python.org Sat Jan 31 23:14:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 23:14:21 +0100 (CET) Subject: [Python-checkins] r69150 - python/branches/py3k/Objects/unicodeobject.c Message-ID: <20090131221421.E82491E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 23:14:21 2009 New Revision: 69150 Log: fix indentation again Modified: python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat Jan 31 23:14:21 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, @@ -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)) { + (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; + /* 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; } - 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; } @@ -507,7 +507,7 @@ if (size < 0) { PyErr_SetString(PyExc_SystemError, - "Negative size passed to PyUnicode_FromStringAndSize"); + "Negative size passed to PyUnicode_FromStringAndSize"); return NULL; } @@ -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; + 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; } - 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 @@ -657,7 +657,7 @@ /* 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) */ + an array) */ for (f = format; *f; f++) { if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) ++callcount; @@ -686,8 +686,8 @@ * they don't affect the amount of space we reserve. */ if ((*f == 'l' || *f == 'z') && - (f[1] == 'd' || f[1] == 'u')) - ++f; + (f[1] == 'd' || f[1] == 'u')) + ++f; switch (*f) { case 'c': @@ -730,11 +730,11 @@ s++; if(!*s)break; s++; } else { - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE n++; - #else +#else n+=2; - #endif +#endif s++; if(!*s)break; s++; if(!*s)break; s++; if(!*s)break; @@ -823,7 +823,7 @@ } else n++; } - expand: + expand: if (abuffersize > 20) { abuffer = PyObject_Malloc(abuffersize); if (!abuffer) { @@ -915,11 +915,11 @@ PyObject *u; p = va_arg(vargs, char*); u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); + "replace"); if (!u) goto fail; Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); + PyUnicode_GET_SIZE(u)); s += PyUnicode_GET_SIZE(u); Py_DECREF(u); break; @@ -986,14 +986,14 @@ *s++ = *f; } - end: + end: if (callresults) PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; - fail: + fail: if (callresults) { PyObject **callresult2 = callresults; while (callresult2 < callresult) { @@ -1026,34 +1026,34 @@ } 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,22 +1102,22 @@ } 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 */ @@ -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; + 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; } @@ -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) { @@ -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 */ @@ -2320,7 +2320,7 @@ *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]]; + 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; - } + 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 + 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; + *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; - } + 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 */ + } + 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( + 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; + /* 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++; } - /* 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; + /* 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--; + /* \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; + /* \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'; } - 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; @@ -3576,7 +3576,7 @@ #endif if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyBytes_FromStringAndSize(NULL, expandsize * size); if (repr == 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,129 +3910,129 @@ 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; + /* can we encode this? */ + if (c=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); + } + 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); - goto onError; - } - *str = (char)c; } - p = startp + newpos; - Py_DECREF(repunicode); } } - } /* Resize if we allocated to much */ size = str - PyBytes_AS_STRING(res); if (size < ressize) { /* If this falls res will be NULL */ @@ -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 */ + 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 (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; + 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; } - *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; - } + 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); + /* 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) { + 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; } - 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; } - 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,10 +4530,10 @@ /* 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* @@ -4541,13 +4541,13 @@ { struct encoding_map *map = (struct encoding_map*)obj; return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + - 128*map->count3); + 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 } + PyDoc_STR("Return the size (in bytes) of this object") }, + { 0 } }; static void @@ -4558,46 +4558,46 @@ 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*/ + "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; } @@ -4718,7 +4718,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4750,40 +4750,40 @@ 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; } } @@ -4800,7 +4800,7 @@ } typedef enum charmapencode_result { - enc_SUCCESS, enc_FAILED, enc_EXCEPTION + 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; - } + 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); @@ -4983,9 +4983,9 @@ } 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; + 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); + 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); - } - 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; + *(*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; + } } 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)) + /* 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) - 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; coll 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; } - p = collend; - break; - default: - repunicode = unicode_translate_call_errorhandler(errors, &errorHandler, - reason, startp, size, &exc, - collstart-startp, collend-startp, &newpos); - if (repunicode == NULL) - goto onError; - /* generate replacement */ - repsize = PyUnicode_GET_SIZE(repunicode); - if (charmaptranslate_makespace(&res, &str, - (str-PyUnicode_AS_UNICODE(res))+repsize+(endp-collend))) { - Py_DECREF(repunicode); - goto onError; + /* 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); } - for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++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) { + 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; + 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 */ + for (p = collstart; p < collend; ++p) + *output++ = '?'; + /* fall through */ case 3: /* ignore */ - p = collend; - break; + 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; + /* 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); + 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); } - 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 (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 (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5888,12 +5888,12 @@ 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); + /* find a token */ while (i < len && Py_UNICODE_ISSPACE(buf[i])) - 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) + /* 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; - } - SPLIT_APPEND(data, j, eol); - j = 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); + /* find a token */ while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - 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 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 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; } @@ -6545,12 +6545,12 @@ uniobj = PyUnicode_FromObject(obj); if (uniobj == NULL) { PyErr_SetString(PyExc_TypeError, - "The fill character cannot be converted to Unicode"); + "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"); + "The fill character must be exactly one character long"); Py_DECREF(uniobj); return 0; } @@ -6561,7 +6561,7 @@ } 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,17 +6689,17 @@ 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) \ +#define TEST_COND(cond) \ ((cond) ? Py_True : Py_False) PyObject *PyUnicode_RichCompare(PyObject *left, @@ -6760,7 +6760,7 @@ } 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; @@ -6854,7 +6854,7 @@ } 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++ = ' '; + 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; + 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,7 +7407,7 @@ /* 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, @@ -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."); @@ -7537,29 +7537,29 @@ Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); Py_ssize_t i, j; - BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); + BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); i = 0; if (striptype != RIGHTSTRIP) { - while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { - i++; - } + 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++; + 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; + Py_INCREF(self); + return (PyObject*)self; } else - return PyUnicode_FromUnicode(s+i, j-i); + return PyUnicode_FromUnicode(s+i, j-i); } @@ -7606,8 +7606,8 @@ return _PyUnicode_XStrip(self, striptype, sep); else { PyErr_Format(PyExc_TypeError, - "%s arg must be None or str", - STRIPNAME(striptype)); + "%s arg must be None or str", + STRIPNAME(striptype)); return NULL; } } @@ -7617,7 +7617,7 @@ 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\ @@ -7634,7 +7634,7 @@ 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."); @@ -7650,7 +7650,7 @@ 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."); @@ -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,9 +7877,9 @@ if (size > 0) { ch2 = *s; if (ch >= 0xD800 && ch < 0xDC00 && ch2 >= 0xDC00 - && ch2 <= 0xDFFF) { + && ch2 <= 0xDFFF) { ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) - + 0x00010000; + + 0x00010000; s++; size--; } @@ -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\ @@ -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."); @@ -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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != 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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != 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\ @@ -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,7 +8550,7 @@ } 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) @@ -8627,11 +8627,11 @@ 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 = { @@ -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; } @@ -8686,8 +8686,8 @@ 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]; @@ -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; } @@ -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,37 +8780,37 @@ 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; + 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); } @@ -8833,11 +8833,11 @@ #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; + 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; - } + 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; - } + 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; + 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; + 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++; } - *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; + 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}() */ - 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 == '(') { + 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; + 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; } - 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') + 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 ((prec*10) / 10 != prec) { + } + 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, - "prec too big"); + "incomplete format"); goto onError; } - prec = prec*10 + (c - '0'); + if (c != '%') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; } - } - } /* 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) { + sign = 0; + fill = ' '; + switch (c) { - case '%': - pbuf = formatbuf; - /* presume that buffer length is at least 1 */ - pbuf[0] = '%'; - len = 1; - break; + 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; + 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) + 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); - sign = 1; + } } - else { - Py_DECREF(iobj); + 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; + 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 '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; + 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 : '?', + 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,7 +9426,7 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *x = NULL; + PyObject *x = NULL; static char *kwlist[] = {"object", "encoding", "errors", 0}; char *encoding = NULL; char *errors = NULL; @@ -9434,14 +9434,14 @@ if (type != &PyUnicode_Type) return unicode_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str", - kwlist, &x, &encoding, &errors)) + 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); + return PyUnicode_FromEncodedObject(x, encoding, errors); } static PyObject * @@ -9475,7 +9475,7 @@ } 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\ @@ -9505,7 +9505,7 @@ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | - Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ + Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -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(); } @@ -9629,15 +9629,15 @@ 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); + t = PyDict_GetItem(interned, (PyObject *)s); Py_END_ALLOW_RECURSION - if (t) { - Py_INCREF(t); - Py_DECREF(*p); - *p = t; - return; - } + 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) { @@ -9694,7 +9694,7 @@ n = PyList_GET_SIZE(keys); fprintf(stderr, "releasing %" PY_FORMAT_SIZE_T "d interned strings\n", - n); + n); for (i = 0; i < n; i++) { s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i); switch (s->state) { @@ -9761,7 +9761,7 @@ if (it->it_index < PyUnicode_GET_SIZE(seq)) { item = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(seq)+it->it_index, 1); + PyUnicode_AS_UNICODE(seq)+it->it_index, 1); if (item != NULL) ++it->it_index; return item; @@ -9785,7 +9785,7 @@ static PyMethodDef unicodeiter_methods[] = { {"__length_hint__", (PyCFunction)unicodeiter_len, METH_NOARGS, - length_hint_doc}, + length_hint_doc}, {NULL, NULL} /* sentinel */ }; @@ -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: */ From python-checkins at python.org Sat Jan 31 23:17:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 23:17:25 +0100 (CET) Subject: [Python-checkins] r69151 - python/branches/py3k Message-ID: <20090131221725.8D0BA1E4045@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 23:17:25 2009 New Revision: 69151 Log: 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 ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Jan 31 23:25:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 23:25:08 +0100 (CET) Subject: [Python-checkins] r69152 - python/branches/release26-maint/Objects/unicodeobject.c Message-ID: <20090131222508.CA5E21E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 23:25:08 2009 New Revision: 69152 Log: reindent, again Modified: python/branches/release26-maint/Objects/unicodeobject.c Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Sat Jan 31 23:25:08 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, @@ -196,9 +196,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) { @@ -225,29 +225,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)) { + (unicode->length == 1 && + unicode->str[0] < 256U && + unicode_latin1[unicode->str[0]] == unicode)) { PyErr_SetString(PyExc_SystemError, "can't resize shared unicode objects"); return -1; @@ -260,16 +260,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); @@ -284,7 +284,7 @@ Ux0000 terminated -- XXX is this needed ? 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. */ @@ -309,33 +309,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() @@ -351,7 +351,7 @@ unicode->defenc = NULL; return unicode; - onError: + onError: /* XXX UNREF/NEWREF interface should be more symmetrical */ _Py_DEC_REFTOTAL; _Py_ForgetReference((PyObject *)unicode); @@ -363,26 +363,26 @@ void unicode_dealloc(register PyUnicodeObject *unicode) { 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); } } @@ -393,28 +393,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 @@ -428,7 +428,7 @@ } PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -436,26 +436,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; + /* 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; } - Py_INCREF(unicode); - return (PyObject *)unicode; - } } unicode = _PyUnicode_New(size); @@ -464,7 +464,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; } @@ -475,7 +475,7 @@ if (size < 0) { PyErr_SetString(PyExc_SystemError, - "Negative size passed to PyUnicode_FromStringAndSize"); + "Negative size passed to PyUnicode_FromStringAndSize"); return NULL; } @@ -485,26 +485,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; + 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; } - Py_INCREF(unicode); - return (PyObject *)unicode; - } return PyUnicode_DecodeUTF8(u, size, NULL); } @@ -530,13 +530,13 @@ #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) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } unicode = _PyUnicode_New(size); @@ -548,11 +548,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 @@ -647,8 +647,8 @@ * they don't affect the amount of space we reserve. */ if ((*f == 'l' || *f == 'z') && - (f[1] == 'd' || f[1] == 'u')) - ++f; + (f[1] == 'd' || f[1] == 'u')) + ++f; switch (*f) { case 'c': @@ -691,11 +691,11 @@ s++; if(!*s)break; s++; } else { - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE n++; - #else +#else n+=2; - #endif +#endif s++; if(!*s)break; s++; if(!*s)break; s++; if(!*s)break; @@ -771,7 +771,7 @@ } else n++; } - expand: + expand: if (abuffersize > 20) { abuffer = PyObject_Malloc(abuffersize); if (!abuffer) { @@ -863,11 +863,11 @@ PyObject *u; p = va_arg(vargs, char*); u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); + "replace"); if (!u) goto fail; Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); + PyUnicode_GET_SIZE(u)); s += PyUnicode_GET_SIZE(u); Py_DECREF(u); break; @@ -934,14 +934,14 @@ *s++ = *f; } - end: + end: if (callresults) PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; - fail: + fail: if (callresults) { PyObject **callresult2 = callresults; while (callresult2 < callresult) { @@ -974,34 +974,34 @@ } 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 @@ -1012,17 +1012,17 @@ #ifdef Py_UNICODE_WIDE if (ordinal < 0 || ordinal > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x110000) " - "(wide Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x110000) " + "(wide Python build)"); + return NULL; } #else if (ordinal < 0 || ordinal > 0xffff) { - PyErr_SetString(PyExc_ValueError, - "unichr() arg not in range(0x10000) " - "(narrow Python build)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x10000) " + "(narrow Python build)"); + return NULL; } #endif @@ -1033,31 +1033,31 @@ PyObject *PyUnicode_FromObject(register PyObject *obj) { /* XXX Perhaps we should make this API an alias of - PyObject_Unicode() instead ?! */ + PyObject_Unicode() 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)); } return PyUnicode_FromEncodedObject(obj, NULL, "strict"); } 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 0 @@ -1067,22 +1067,22 @@ Unicode subclasses. NOTE: This API should really only be used for object which - represent *encoded* Unicode ! + represent *encoded* Unicode ! */ if (PyUnicode_Check(obj)) { if (encoding) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; - } - return PyObject_Unicode(obj); + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; } + return PyObject_Unicode(obj); + } #else if (PyUnicode_Check(obj)) { - PyErr_SetString(PyExc_TypeError, - "decoding Unicode is not supported"); - return NULL; + PyErr_SetString(PyExc_TypeError, + "decoding Unicode is not supported"); + return NULL; } #endif @@ -1098,39 +1098,39 @@ return NULL; } 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)) - PyErr_Format(PyExc_TypeError, - "coercing to Unicode: need string or buffer, " - "%.80s found", - Py_TYPE(obj)->tp_name); - goto onError; + /* Overwrite the error message with something more useful in + case of a TypeError. */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_Format(PyExc_TypeError, + "coercing to Unicode: 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; if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (strcmp(encoding, "utf-8") == 0) @@ -1161,7 +1161,7 @@ Py_DECREF(buffer); return unicode; - onError: + onError: Py_XDECREF(buffer); return NULL; } @@ -1178,7 +1178,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1186,20 +1186,20 @@ goto onError; 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; @@ -1217,7 +1217,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1225,7 +1225,7 @@ goto onError; return v; - onError: + onError: return NULL; } @@ -1241,20 +1241,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); } /* Encode via the codec registry */ @@ -1270,12 +1270,12 @@ } return v; - onError: + onError: return NULL; } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; @@ -1295,7 +1295,7 @@ } return PyUnicode_AS_UNICODE(unicode); - onError: + onError: return NULL; } @@ -1307,7 +1307,7 @@ } return PyUnicode_GET_SIZE(unicode); - onError: + onError: return -1; } @@ -1324,14 +1324,14 @@ loads the encoding into the codec registry cache. */ v = _PyCodec_Lookup(encoding); if (v == NULL) - goto onError; + goto onError; Py_DECREF(v); strncpy(unicode_default_encoding, - encoding, - sizeof(unicode_default_encoding)); + encoding, + sizeof(unicode_default_encoding)); return 0; - onError: + onError: return -1; } @@ -1344,10 +1344,10 @@ static int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler, - const char *encoding, const char *reason, - const char *input, Py_ssize_t insize, 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, Py_ssize_t insize, 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 (unicode, int) tuple"; @@ -1361,40 +1361,40 @@ 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, insize, *startinpos, *endinpos, reason); - if (*exceptionObject == NULL) - goto onError; + encoding, input, insize, *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; 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 @@ -1405,11 +1405,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; @@ -1419,7 +1419,7 @@ /* we made it! */ res = 0; - onError: + onError: Py_XDECREF(restuple); return res; } @@ -1452,17 +1452,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) \ @@ -1491,16 +1491,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; @@ -1531,7 +1531,7 @@ while (s < e) { Py_UNICODE ch; - restart: + restart: ch = (unsigned char) *s; if (inShift) { @@ -1599,28 +1599,28 @@ s++; } continue; - utf7Error: + utf7Error: outpos = p-PyUnicode_AS_UNICODE(unicode); endinpos = s-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf7", errmsg, - starts, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + errors, &errorHandler, + "utf7", errmsg, + starts, size, &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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) + errors, &errorHandler, + "utf7", "unterminated shift sequence", + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) goto onError; if (s < e) - goto restart; + goto restart; } if (consumed) { if(inShift) @@ -1636,7 +1636,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -1645,10 +1645,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 */ @@ -1772,16 +1772,16 @@ }; 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); } 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; @@ -1822,72 +1822,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: @@ -1895,25 +1895,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: */ @@ -1931,24 +1931,24 @@ 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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + utf8Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf8", errmsg, + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -1958,7 +1958,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -1972,8 +1972,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 */ @@ -2039,7 +2039,7 @@ *p++ = (char)(0x80 | (ch & 0x3f)); continue; } -encodeUCS4: + encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); @@ -2072,27 +2072,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; @@ -2120,8 +2120,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 */ @@ -2146,27 +2146,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) { @@ -2185,54 +2185,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]]; + 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; - } + 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 + 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, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + *p++ = ch; + q += 4; + continue; + utf32Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf32", errmsg, + starts, size, &startinpos, &endinpos, &exc, &s, + &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) @@ -2242,7 +2242,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2251,9 +2251,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; @@ -2270,34 +2270,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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2317,16 +2317,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); } @@ -2341,28 +2341,28 @@ 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); } 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; @@ -2406,25 +2406,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) { @@ -2439,74 +2439,74 @@ } while (q < e) { - Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[ihi] << 8) | q[ilo]; + Py_UNICODE ch; + /* remaining bytes at the end? (size should be even) */ + if (e-q<2) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf16Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + 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)-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)-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; + 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 */ - } - 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, - starts, size, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + utf16Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf16", errmsg, + starts, size, &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) @@ -2516,7 +2516,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2525,9 +2525,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; @@ -2544,33 +2544,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 = PyString_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) return v; @@ -2586,13 +2586,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) @@ -2609,9 +2609,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 ----------------------------------------------- */ @@ -2619,8 +2619,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; @@ -2668,7 +2668,7 @@ c = '\0'; /* Invalid after \ */ switch (c) { - /* \x escapes */ + /* \x escapes */ case '\n': break; case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; @@ -2681,7 +2681,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'; @@ -2693,20 +2693,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"; @@ -2716,10 +2716,10 @@ if (s+digits>end) { endinpos = size; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "end of string in escape sequence", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "end of string in escape sequence", + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2728,10 +2728,10 @@ if (!isxdigit(c)) { endinpos = (s+i+1)-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -2767,15 +2767,15 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "illegal Unicode character", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "illegal Unicode character", + starts, size, &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) { @@ -2809,10 +2809,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; break; @@ -2823,10 +2823,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + starts, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; } else { @@ -2835,7 +2835,7 @@ } break; } - nextByte: + nextByte: ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) @@ -2844,7 +2844,7 @@ Py_XDECREF(exc); return (PyObject *)v; -ucnhashError: + ucnhashError: PyErr_SetString( PyExc_UnicodeError, "\\N escapes not supported (can't load unicodedata module)" @@ -2854,7 +2854,7 @@ Py_XDECREF(exc); return NULL; -onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2869,8 +2869,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 */ @@ -2917,12 +2917,12 @@ */ if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyString_FromStringAndSize(NULL, - 2 - + expandsize*size - + 1); + 2 + + expandsize*size + + 1); if (repr == NULL) return NULL; @@ -2938,10 +2938,10 @@ /* Escape quotes and backslashes */ if ((quotes && - ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { + ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') { *p++ = '\\'; *p++ = (char) ch; - continue; + continue; } #ifdef Py_UNICODE_WIDE @@ -2957,34 +2957,34 @@ *p++ = hexdigit[(ch >> 8) & 0x0000000F]; *p++ = hexdigit[(ch >> 4) & 0x0000000F]; *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigit[ucs & 0x0000000F]; - continue; + /* 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++ = hexdigit[(ucs >> 28) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 24) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 20) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 16) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 12) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 8) & 0x0000000F]; + *p++ = hexdigit[(ucs >> 4) & 0x0000000F]; + *p++ = hexdigit[ucs & 0x0000000F]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3032,7 +3032,7 @@ } PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { return unicodeescape_string(s, size, 0); } @@ -3044,14 +3044,14 @@ return NULL; } return PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3070,75 +3070,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; + /* 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--; + /* \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, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; - goto nextByte; + /* \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, size, &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'; } - 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; @@ -3146,20 +3146,20 @@ if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", - starts, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; + starts, size, &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); @@ -3167,7 +3167,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3181,20 +3181,20 @@ #endif if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyString_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; if (size == 0) - return repr; + return repr; p = q = PyString_AS_STRING(repr); 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++ = hexdigit[(ch >> 28) & 0xf]; @@ -3208,34 +3208,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++ = hexdigit[(ucs >> 28) & 0xf]; - *p++ = hexdigit[(ucs >> 24) & 0xf]; - *p++ = hexdigit[(ucs >> 20) & 0xf]; - *p++ = hexdigit[(ucs >> 16) & 0xf]; - *p++ = hexdigit[(ucs >> 12) & 0xf]; - *p++ = hexdigit[(ucs >> 8) & 0xf]; - *p++ = hexdigit[(ucs >> 4) & 0xf]; - *p++ = hexdigit[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++ = hexdigit[(ucs >> 28) & 0xf]; + *p++ = hexdigit[(ucs >> 24) & 0xf]; + *p++ = hexdigit[(ucs >> 20) & 0xf]; + *p++ = hexdigit[(ucs >> 16) & 0xf]; + *p++ = hexdigit[(ucs >> 12) & 0xf]; + *p++ = hexdigit[(ucs >> 8) & 0xf]; + *p++ = hexdigit[(ucs >> 4) & 0xf]; + *p++ = hexdigit[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++ = hexdigit[(ch >> 12) & 0xf]; @@ -3243,8 +3243,8 @@ *p++ = hexdigit[(ch >> 4) & 0xf]; *p++ = hexdigit[ch & 15]; } - /* Copy everything else as-is */ - else + /* Copy everything else as-is */ + else *p++ = (char) ch; } *p = '\0'; @@ -3255,18 +3255,18 @@ PyObject *PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode)); + PyUnicode_GET_SIZE(unicode)); } /* --- 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; @@ -3286,9 +3286,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; @@ -3297,12 +3297,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; @@ -3333,7 +3333,7 @@ Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3343,69 +3343,69 @@ /* --- 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; /* 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); while (size-- > 0) - *p++ = (unsigned char)*s++; + *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: @@ -3413,11 +3413,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 (unicode, int) tuple"; @@ -3425,36 +3425,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); @@ -3462,9 +3462,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; @@ -3492,144 +3492,144 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; str = PyString_AS_STRING(res); 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; + /* can we encode this? */ + if (c=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 (_PyString_Resize(&res, requiredsize)) - goto onError; - str = PyString_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-PyString_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyString_Resize(&res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyString_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); + } + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyString_Resize(&res, requiredsize)) + goto onError; + str = PyString_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-PyString_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyString_Resize(&res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyString_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); - goto onError; } - *str = (char)c; - } - p = startp + newpos; - Py_DECREF(repunicode); } } - } /* Resize if we allocated to much */ respos = str-PyString_AS_STRING(res); if (respos= 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 @@ -3849,8 +3849,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); } @@ -3860,8 +3860,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; @@ -3870,63 +3870,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 = PyString_FromStringAndSize(NULL, mbcssize); - if (*repr == NULL) - return -1; + /* Create string object */ + *repr = PyString_FromStringAndSize(NULL, mbcssize); + if (*repr == NULL) + return -1; } else { - /* Extend string object */ - n = PyString_Size(*repr); - if (_PyString_Resize(repr, n + mbcssize) < 0) - return -1; + /* Extend string object */ + n = PyString_Size(*repr); + if (_PyString_Resize(repr, n + mbcssize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - char *s = PyString_AS_STRING(*repr) + n; - if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + char *s = PyString_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 @@ -3940,8 +3940,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -3951,9 +3951,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; @@ -3970,141 +3970,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 */ + 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 (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, size, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) { - goto onError; - } - continue; + 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, size, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) { + goto onError; + } + continue; + } + *p++ = x; + ++s; } - *p++ = x; - ++s; - } } else { - while (s < e) { - unsigned char ch = *s; - PyObject *w, *x; - - /* Get mapping (char ordinal -> integer, Unicode char or None) */ - w = PyInt_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; - } + while (s < e) { + unsigned char ch = *s; + PyObject *w, *x; + + /* Get mapping (char ordinal -> integer, Unicode char or None) */ + w = PyInt_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 (PyInt_Check(x)) { - long value = PyInt_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, size, &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); + /* Apply mapping */ + if (PyInt_Check(x)) { + long value = PyInt_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, size, &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) { + 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 unicode"); 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 unicode"); - Py_DECREF(x); - goto onError; + Py_DECREF(x); + ++s; } - 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); @@ -4114,10 +4114,10 @@ /* 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* @@ -4130,8 +4130,8 @@ static PyMethodDef encoding_map_methods[] = { {"size", encoding_map_size, METH_NOARGS, - PyDoc_STR("Return the size (in bytes) of this object") }, - { 0 } + PyDoc_STR("Return the size (in bytes) of this object") }, + { 0 } }; static void @@ -4142,46 +4142,46 @@ 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*/ + "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* @@ -4213,10 +4213,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; } @@ -4302,7 +4302,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4334,39 +4334,39 @@ 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 (PyInt_Check(x)) { - long value = PyInt_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 = PyInt_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 (PyString_Check(x)) - return x; + return x; else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - return NULL; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + return NULL; } } @@ -4384,7 +4384,7 @@ } typedef enum charmapencode_result { - enc_SUCCESS, enc_FAILED, enc_EXCEPTION + enc_SUCCESS, enc_FAILED, enc_EXCEPTION }charmapencode_result; /* lookup the character, put the result in the output string and adjust various state variables. Reallocate the output string if not enough @@ -4394,7 +4394,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; @@ -4402,47 +4402,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; - } + 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); @@ -4567,9 +4567,9 @@ } 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; @@ -4586,7 +4586,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 */ @@ -4594,36 +4594,36 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; while (inpos adjust input position */ - ++inpos; + else + /* done with this character => adjust input position */ + ++inpos; } /* Resize if we allocated to much */ if (respossize) { - 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); @@ -4745,63 +4745,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 (PyInt_Check(x)) { - long value = PyInt_AS_LONG(x); - long max = PyUnicode_GetMax(); - if (value < 0 || value > max) { - PyErr_Format(PyExc_TypeError, - "character mapping must be in range(0x%lx)", max+1); - Py_DECREF(x); - return -1; - } - *result = x; - return 0; + long value = PyInt_AS_LONG(x); + long max = PyUnicode_GetMax(); + if (value < 0 || value > max) { + PyErr_Format(PyExc_TypeError, + "character mapping must be in range(0x%lx)", max+1); + 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 unicode"); - Py_DECREF(x); - return -1; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or unicode"); + 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; } @@ -4813,47 +4813,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 (PyInt_Check(*res)) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = (Py_UNICODE)PyInt_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; + *(*outp)++ = (Py_UNICODE)PyInt_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; + } } 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; @@ -4873,119 +4873,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)) + /* 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) - 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; coll 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; } - p = collend; - break; - default: - repunicode = unicode_translate_call_errorhandler(errors, &errorHandler, - reason, startp, size, &exc, - collstart-startp, collend-startp, &newpos); - if (repunicode == NULL) - goto onError; - /* generate replacement */ - repsize = PyUnicode_GET_SIZE(repunicode); - if (charmaptranslate_makespace(&res, &str, - (str-PyUnicode_AS_UNICODE(res))+repsize+(endp-collend))) { - Py_DECREF(repunicode); - goto onError; + /* 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); } - for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++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) { + 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; + 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 */ + for (p = collstart; p < collend; ++p) + *output++ = '?'; + /* fall through */ case 3: /* ignore */ - p = collend; - break; + 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; + /* 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); + 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); } - p = s + newpos; - Py_DECREF(repunicode); - } } /* 0-terminate the output string */ *output++ = '\0'; @@ -5138,7 +5138,7 @@ Py_XDECREF(errorHandler); return 0; - onError: + onError: Py_XDECREF(exc); Py_XDECREF(errorHandler); return -1; @@ -5180,11 +5180,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); @@ -5209,11 +5209,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) @@ -5237,10 +5237,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; @@ -5249,39 +5249,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; @@ -5292,24 +5292,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; } @@ -5322,13 +5322,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++; } @@ -5343,13 +5343,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++; } @@ -5385,10 +5385,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) { @@ -5410,31 +5410,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 (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 (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5475,29 +5475,29 @@ } /* If singleton sequence with an exact Unicode, return that. */ if (seqlen == 1) { - item = PySequence_Fast_GET_ITEM(fseq, 0); - if (PyUnicode_CheckExact(item)) { - Py_INCREF(item); - res = (PyUnicodeObject *)item; - goto Done; - } + item = PySequence_Fast_GET_ITEM(fseq, 0); + if (PyUnicode_CheckExact(item)) { + Py_INCREF(item); + res = (PyUnicodeObject *)item; + goto Done; + } } /* At least two items to join, or one that isn't exact Unicode. */ if (seqlen > 1) { /* Set up sep and seplen -- they're needed. */ if (separator == NULL) { - sep = ␣ - seplen = 1; + sep = ␣ + seplen = 1; } else { - internal_separator = PyUnicode_FromObject(separator); - if (internal_separator == NULL) - goto onError; - sep = PyUnicode_AS_UNICODE(internal_separator); - seplen = PyUnicode_GET_SIZE(internal_separator); - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + internal_separator = PyUnicode_FromObject(separator); + if (internal_separator == NULL) + goto onError; + sep = PyUnicode_AS_UNICODE(internal_separator); + seplen = PyUnicode_GET_SIZE(internal_separator); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); } } @@ -5509,79 +5509,79 @@ res_used = 0; for (i = 0; i < seqlen; ++i) { - Py_ssize_t itemlen; - Py_ssize_t new_res_used; + Py_ssize_t itemlen; + Py_ssize_t new_res_used; - item = PySequence_Fast_GET_ITEM(fseq, i); - /* Convert item to Unicode. */ - if (! PyUnicode_Check(item) && ! PyString_Check(item)) { - PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected string or Unicode," - " %.80s found", - i, Py_TYPE(item)->tp_name); - goto onError; - } - item = PyUnicode_FromObject(item); - if (item == NULL) - goto onError; - /* We own a reference to item from here on. */ + item = PySequence_Fast_GET_ITEM(fseq, i); + /* Convert item to Unicode. */ + if (! PyUnicode_Check(item) && ! PyString_Check(item)) { + PyErr_Format(PyExc_TypeError, + "sequence item %zd: expected string or Unicode," + " %.80s found", + i, Py_TYPE(item)->tp_name); + goto onError; + } + item = PyUnicode_FromObject(item); + if (item == NULL) + goto onError; + /* We own a reference to item from here on. */ - /* In case PyUnicode_FromObject() mutated seq. */ - seqlen = PySequence_Fast_GET_SIZE(fseq); + /* In case PyUnicode_FromObject() mutated seq. */ + seqlen = PySequence_Fast_GET_SIZE(fseq); /* Make sure we have enough space for the separator and the item. */ - itemlen = PyUnicode_GET_SIZE(item); - new_res_used = res_used + itemlen; - if (new_res_used < 0) - goto Overflow; - if (i < seqlen - 1) { - new_res_used += seplen; + itemlen = PyUnicode_GET_SIZE(item); + new_res_used = res_used + itemlen; if (new_res_used < 0) - goto Overflow; - } - if (new_res_used > res_alloc) { - /* double allocated size until it's big enough */ - do { - res_alloc += res_alloc; - if (res_alloc <= 0) + goto Overflow; + if (i < seqlen - 1) { + new_res_used += seplen; + if (new_res_used < 0) goto Overflow; - } while (new_res_used > res_alloc); - if (_PyUnicode_Resize(&res, res_alloc) < 0) { - Py_DECREF(item); - goto onError; } + if (new_res_used > res_alloc) { + /* double allocated size until it's big enough */ + do { + res_alloc += res_alloc; + if (res_alloc <= 0) + goto Overflow; + } while (new_res_used > res_alloc); + if (_PyUnicode_Resize(&res, res_alloc) < 0) { + Py_DECREF(item); + goto onError; + } res_p = PyUnicode_AS_UNICODE(res) + res_used; - } + } - /* Copy item, and maybe the separator. */ - Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); - res_p += itemlen; - if (i < seqlen - 1) { - Py_UNICODE_COPY(res_p, sep, seplen); - res_p += seplen; - } - Py_DECREF(item); - res_used = new_res_used; + /* Copy item, and maybe the separator. */ + Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); + res_p += itemlen; + if (i < seqlen - 1) { + Py_UNICODE_COPY(res_p, sep, seplen); + res_p += seplen; + } + Py_DECREF(item); + res_used = new_res_used; } /* Shrink res to match the used area; this probably can't fail, * but it's cheap to check. */ if (_PyUnicode_Resize(&res, res_used) < 0) - goto onError; + goto onError; - Done: + Done: Py_XDECREF(internal_separator); Py_DECREF(fseq); return (PyObject *)res; - Overflow: + Overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); Py_DECREF(item); /* fall through */ - onError: + onError: Py_XDECREF(internal_separator); Py_DECREF(fseq); Py_XDECREF(res); @@ -5590,9 +5590,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; @@ -5623,21 +5623,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; @@ -5646,33 +5646,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); + /* find a token */ while (i < len && Py_UNICODE_ISSPACE(buf[i])) - 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; @@ -5683,7 +5683,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -5692,34 +5692,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) + /* 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; - } - SPLIT_APPEND(data, j, eol); - j = 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; @@ -5727,9 +5727,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; @@ -5738,29 +5738,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; @@ -5769,28 +5769,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; @@ -5799,38 +5799,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); + /* find a token */ while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - 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 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; @@ -5839,31 +5839,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 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; @@ -5872,23 +5872,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; } @@ -5897,8 +5897,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -5910,24 +5910,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; @@ -5939,30 +5939,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 */ @@ -6048,7 +6048,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6079,7 +6079,7 @@ } return (PyObject *) u; -nothing: + nothing: /* nothing to replace; return original string (when possible) */ if (PyUnicode_CheckExact(self)) { Py_INCREF(self); @@ -6091,7 +6091,7 @@ /* --- Unicode Object Methods --------------------------------------------- */ PyDoc_STRVAR(title__doc__, -"S.title() -> unicode\n\ + "S.title() -> unicode\n\ \n\ Return a titlecased version of S, i.e. words start with title case\n\ characters, all remaining cased characters have lower case."); @@ -6103,7 +6103,7 @@ } PyDoc_STRVAR(capitalize__doc__, -"S.capitalize() -> unicode\n\ + "S.capitalize() -> unicode\n\ \n\ Return a capitalized version of S, i.e. make the first character\n\ have upper case."); @@ -6116,7 +6116,7 @@ #if 0 PyDoc_STRVAR(capwords__doc__, -"S.capwords() -> unicode\n\ + "S.capwords() -> unicode\n\ \n\ Apply .capitalize() to all words in S and return the result with\n\ normalized whitespace (all whitespace strings are replaced by ' ')."); @@ -6136,7 +6136,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)); @@ -6146,7 +6146,7 @@ /* Join the words to form a new string */ item = PyUnicode_Join(NULL, list); -onError: + onError: Py_DECREF(list); return (PyObject *)item; } @@ -6164,12 +6164,12 @@ uniobj = PyUnicode_FromObject(obj); if (uniobj == NULL) { PyErr_SetString(PyExc_TypeError, - "The fill character cannot be converted to Unicode"); + "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"); + "The fill character must be exactly one character long"); Py_DECREF(uniobj); return 0; } @@ -6180,7 +6180,7 @@ } PyDoc_STRVAR(center__doc__, -"S.center(width[, fillchar]) -> unicode\n\ + "S.center(width[, fillchar]) -> unicode\n\ \n\ Return S centered in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)"); @@ -6241,9 +6241,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 */ @@ -6287,7 +6287,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { PyUnicodeObject *u = NULL, *v = NULL; int result; @@ -6295,16 +6295,16 @@ /* 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; /* Shortcut for empty or interned objects */ if (v == u) { - Py_DECREF(u); - Py_DECREF(v); - return 0; + Py_DECREF(u); + Py_DECREF(v); + return 0; } result = unicode_compare(u, v); @@ -6313,7 +6313,7 @@ Py_DECREF(v); return result; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return -1; @@ -6352,7 +6352,7 @@ } return PyBool_FromLong(result); - onError: + onError: /* Standard case @@ -6389,14 +6389,14 @@ "Unicode unequal comparison " "failed to convert both arguments to Unicode - " "interpreting them as being unequal" - ) < 0) + ) < 0) return NULL; result = (op == Py_NE); return PyBool_FromLong(result); } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6404,8 +6404,8 @@ /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_SetString(PyExc_TypeError, - "'in ' requires string as left operand"); + PyErr_SetString(PyExc_TypeError, + "'in ' requires string as left operand"); return -1; } @@ -6426,32 +6426,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); @@ -6459,14 +6459,14 @@ Py_DECREF(v); return (PyObject *)w; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return NULL; } 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\ Unicode string S[start:end]. Optional arguments start and end are\n\ @@ -6481,13 +6481,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); @@ -6502,7 +6502,7 @@ } PyDoc_STRVAR(encode__doc__, -"S.encode([encoding[,errors]]) -> string or unicode\n\ + "S.encode([encoding[,errors]]) -> string or unicode\n\ \n\ Encodes S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ @@ -6533,12 +6533,12 @@ } return v; - onError: + onError: return NULL; } PyDoc_STRVAR(decode__doc__, -"S.decode([encoding[,errors]]) -> string or unicode\n\ + "S.decode([encoding[,errors]]) -> string or unicode\n\ \n\ Decodes S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ @@ -6569,12 +6569,12 @@ } return v; - onError: + onError: return NULL; } PyDoc_STRVAR(expandtabs__doc__, -"S.expandtabs([tabsize]) -> unicode\n\ + "S.expandtabs([tabsize]) -> unicode\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."); @@ -6591,7 +6591,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 */ @@ -6599,27 +6599,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); @@ -6632,20 +6632,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++ = ' '; + 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; + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -6661,7 +6661,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\ @@ -6716,21 +6716,21 @@ register long x; if (self->hash != -1) - return self->hash; + return self->hash; len = PyUnicode_GET_SIZE(self); p = PyUnicode_AS_UNICODE(self); x = *p << 7; while (--len >= 0) - x = (1000003*x) ^ *p++; + x = (1000003*x) ^ *p++; x ^= PyUnicode_GET_SIZE(self); if (x == -1) - x = -2; + x = -2; self->hash = x; return x; } 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."); @@ -6762,7 +6762,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."); @@ -6776,27 +6776,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."); @@ -6810,27 +6810,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\ @@ -6846,39 +6846,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."); @@ -6891,23 +6891,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."); @@ -6920,23 +6920,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."); @@ -6949,23 +6949,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."); @@ -6978,23 +6978,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."); @@ -7007,23 +7007,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."); @@ -7036,23 +7036,23 @@ /* 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); } PyDoc_STRVAR(join__doc__, -"S.join(sequence) -> unicode\n\ + "S.join(sequence) -> unicode\n\ \n\ Return a string which is the concatenation of the strings in the\n\ sequence. The separator between elements is S."); @@ -7070,7 +7070,7 @@ } PyDoc_STRVAR(ljust__doc__, -"S.ljust(width[, fillchar]) -> int\n\ + "S.ljust(width[, fillchar]) -> int\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)."); @@ -7093,7 +7093,7 @@ } PyDoc_STRVAR(lower__doc__, -"S.lower() -> unicode\n\ + "S.lower() -> unicode\n\ \n\ Return a copy of the string S converted to lowercase."); @@ -7122,29 +7122,29 @@ Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); Py_ssize_t i, j; - BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); + BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); i = 0; if (striptype != RIGHTSTRIP) { - while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { - i++; - } + 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++; + 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; + Py_INCREF(self); + return (PyObject*)self; } else - return PyUnicode_FromUnicode(s+i, j-i); + return PyUnicode_FromUnicode(s+i, j-i); } @@ -7200,8 +7200,8 @@ } else { PyErr_Format(PyExc_TypeError, - "%s arg must be None, unicode or str", - STRIPNAME(striptype)); + "%s arg must be None, unicode or str", + STRIPNAME(striptype)); return NULL; } } @@ -7211,7 +7211,7 @@ PyDoc_STRVAR(strip__doc__, -"S.strip([chars]) -> unicode\n\ + "S.strip([chars]) -> unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ @@ -7229,7 +7229,7 @@ PyDoc_STRVAR(lstrip__doc__, -"S.lstrip([chars]) -> unicode\n\ + "S.lstrip([chars]) -> unicode\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.\n\ @@ -7246,7 +7246,7 @@ PyDoc_STRVAR(rstrip__doc__, -"S.rstrip([chars]) -> unicode\n\ + "S.rstrip([chars]) -> unicode\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.\n\ @@ -7303,25 +7303,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; @@ -7330,22 +7330,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); @@ -7353,7 +7353,7 @@ } PyDoc_STRVAR(replace__doc__, -"S.replace (old, new[, count]) -> unicode\n\ + "S.replace (old, new[, count]) -> unicode\n\ \n\ Return a copy of S with all occurrences of substring\n\ old replaced by new. If the optional argument count is\n\ @@ -7371,11 +7371,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); @@ -7389,12 +7389,12 @@ PyObject *unicode_repr(PyObject *unicode) { return unicodeescape_string(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - 1); + PyUnicode_GET_SIZE(unicode), + 1); } 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\ @@ -7425,7 +7425,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."); @@ -7456,7 +7456,7 @@ } PyDoc_STRVAR(rjust__doc__, -"S.rjust(width[, fillchar]) -> unicode\n\ + "S.rjust(width[, fillchar]) -> unicode\n\ \n\ Return S right-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); @@ -7497,24 +7497,24 @@ start = end; /* copy slice */ return (PyObject*) PyUnicode_FromUnicode(self->str + start, - end - start); + end - start); } 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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != NULL) { + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = split((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -7525,7 +7525,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\ @@ -7543,11 +7543,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 * @@ -7559,7 +7559,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); @@ -7587,7 +7587,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); @@ -7606,7 +7606,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\ @@ -7619,7 +7619,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\ @@ -7632,20 +7632,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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != NULL) { + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = rsplit((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -7656,7 +7656,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\ @@ -7674,15 +7674,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\ @@ -7706,7 +7706,7 @@ } PyDoc_STRVAR(swapcase__doc__, -"S.swapcase() -> unicode\n\ + "S.swapcase() -> unicode\n\ \n\ Return a copy of S with uppercase characters converted to lowercase\n\ and vice versa."); @@ -7718,7 +7718,7 @@ } PyDoc_STRVAR(translate__doc__, -"S.translate(table) -> unicode\n\ + "S.translate(table) -> unicode\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\ @@ -7730,13 +7730,13 @@ unicode_translate(PyUnicodeObject *self, PyObject *table) { return PyUnicode_TranslateCharmap(self->str, - self->length, - table, - "ignore"); + self->length, + table, + "ignore"); } PyDoc_STRVAR(upper__doc__, -"S.upper() -> unicode\n\ + "S.upper() -> unicode\n\ \n\ Return a copy of S converted to uppercase."); @@ -7747,7 +7747,7 @@ } PyDoc_STRVAR(zfill__doc__, -"S.zfill(width) -> unicode\n\ + "S.zfill(width) -> unicode\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."); @@ -7771,7 +7771,7 @@ return PyUnicode_FromUnicode( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self) - ); + ); } fill = width - self->length; @@ -7799,7 +7799,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\ @@ -7808,7 +7808,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7817,13 +7817,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); @@ -7837,7 +7837,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); @@ -7845,7 +7845,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\ @@ -7854,7 +7854,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -7863,15 +7863,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) { @@ -7882,7 +7882,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); @@ -7894,7 +7894,7 @@ #include "stringlib/string_format.h" PyDoc_STRVAR(format__doc__, -"S.format(*args, **kwargs) -> unicode\n\ + "S.format(*args, **kwargs) -> unicode\n\ \n\ "); @@ -7911,7 +7911,7 @@ goto done; if (!(PyBytes_Check(format_spec) || PyUnicode_Check(format_spec))) { PyErr_Format(PyExc_TypeError, "__format__ arg must be str " - "or unicode, not %s", Py_TYPE(format_spec)->tp_name); + "or unicode, not %s", Py_TYPE(format_spec)->tp_name); goto done; } tmp = PyObject_Unicode(format_spec); @@ -7922,13 +7922,13 @@ result = _PyUnicode_FormatAdvanced(self, PyUnicode_AS_UNICODE(format_spec), PyUnicode_GET_SIZE(format_spec)); -done: + done: Py_XDECREF(tmp); return result; } PyDoc_STRVAR(p_format__doc__, -"S.__format__(format_spec) -> unicode\n\ + "S.__format__(format_spec) -> unicode\n\ \n\ "); @@ -7940,7 +7940,7 @@ } PyDoc_STRVAR(sizeof__doc__, -"S.__sizeof__() -> size of S in memory, in bytes\n\ + "S.__sizeof__() -> size of S in memory, in bytes\n\ \n\ "); @@ -8017,11 +8017,11 @@ 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 = { @@ -8060,7 +8060,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8077,8 +8077,8 @@ 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]; @@ -8102,12 +8102,12 @@ static Py_ssize_t unicode_buffer_getreadbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } *ptr = (void *) self->str; @@ -8116,16 +8116,16 @@ static Py_ssize_t unicode_buffer_getwritebuf(PyUnicodeObject *self, Py_ssize_t index, - const void **ptr) + const void **ptr) { PyErr_SetString(PyExc_TypeError, - "cannot use unicode as modifiable buffer"); + "cannot use unicode as modifiable buffer"); return -1; } static int unicode_buffer_getsegcount(PyUnicodeObject *self, - Py_ssize_t *lenp) + Py_ssize_t *lenp) { if (lenp) *lenp = PyUnicode_GET_DATA_SIZE(self); @@ -8134,19 +8134,19 @@ static Py_ssize_t unicode_buffer_getcharbuf(PyUnicodeObject *self, - Py_ssize_t index, - const void **ptr) + Py_ssize_t index, + const void **ptr) { PyObject *str; if (index != 0) { PyErr_SetString(PyExc_SystemError, - "accessing non-existent unicode segment"); + "accessing non-existent unicode segment"); return -1; } str = _PyUnicode_AsDefaultEncodedString((PyObject *)self, NULL); if (str == NULL) - return -1; + return -1; *ptr = (void *) PyString_AS_STRING(str); return PyString_GET_SIZE(str); } @@ -8158,14 +8158,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; } @@ -8181,7 +8181,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; } @@ -8212,11 +8212,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)*/ @@ -8225,37 +8225,37 @@ 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; + 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); } @@ -8284,11 +8284,11 @@ 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) @@ -8317,7 +8317,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; } @@ -8364,46 +8364,46 @@ { /* presume that the buffer is at least 2 characters long */ if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) != 1) - goto onError; - buf[0] = PyUnicode_AS_UNICODE(v)[0]; + if (PyUnicode_GET_SIZE(v) != 1) + goto onError; + buf[0] = PyUnicode_AS_UNICODE(v)[0]; } else if (PyString_Check(v)) { - if (PyString_GET_SIZE(v) != 1) - goto onError; - buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; + if (PyString_GET_SIZE(v) != 1) + goto onError; + buf[0] = (Py_UNICODE)PyString_AS_STRING(v)[0]; } else { - /* Integer input truncated to a character */ + /* Integer input truncated to a character */ long x; - x = PyInt_AsLong(v); - if (x == -1 && PyErr_Occurred()) - goto onError; + x = PyInt_AsLong(v); + if (x == -1 && PyErr_Occurred()) + goto onError; #ifdef Py_UNICODE_WIDE - if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000) " - "(wide Python build)"); - return -1; - } + if (x < 0 || x > 0x10ffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x110000) " + "(wide Python build)"); + return -1; + } #else - if (x < 0 || x > 0xffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x10000) " - "(narrow Python build)"); - return -1; - } + if (x < 0 || x > 0xffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x10000) " + "(narrow Python build)"); + return -1; + } #endif - buf[0] = (Py_UNICODE) x; + 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; } @@ -8418,7 +8418,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; @@ -8428,449 +8428,449 @@ 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) && !PyObject_TypeCheck(args, &PyBaseString_Type)) - 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; + 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++; } - *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; + 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}() */ - 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 == '(') { + 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - width = PyInt_AsLong(v); - 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 (!PyInt_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - 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; } - prec = PyInt_AsLong(v); - 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') + 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 ((prec*10) / 10 != prec) { + } + if (c == '*') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + if (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + width = PyInt_AsLong(v); + 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 (!PyInt_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + prec = PyInt_AsLong(v); + 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, - "prec too big"); + "incomplete format"); goto onError; } - prec = prec*10 + (c - '0'); + if (c != '%') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; } - } - } /* 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) { + sign = 0; + fill = ' '; + switch (c) { - case '%': - pbuf = formatbuf; - /* presume that buffer length is at least 1 */ - pbuf[0] = '%'; - len = 1; - break; + case '%': + pbuf = formatbuf; + /* presume that buffer length is at least 1 */ + pbuf[0] = '%'; + len = 1; + break; - case 's': - case 'r': - if (PyUnicode_Check(v) && c == 's') { - temp = v; - Py_INCREF(temp); - } - else { - PyObject *unicode; - if (c == 's') - temp = PyObject_Unicode(v); - else - temp = PyObject_Repr(v); - if (temp == NULL) - goto onError; + case 's': + case 'r': + if (PyUnicode_Check(v) && c == 's') { + temp = v; + Py_INCREF(temp); + } + else { + PyObject *unicode; + if (c == 's') + temp = PyObject_Unicode(v); + else + temp = PyObject_Repr(v); + if (temp == NULL) + goto onError; if (PyUnicode_Check(temp)) /* nothing to do */; else if (PyString_Check(temp)) { /* convert to string to Unicode */ - unicode = PyUnicode_Decode(PyString_AS_STRING(temp), - PyString_GET_SIZE(temp), - NULL, - "strict"); - Py_DECREF(temp); - temp = unicode; - if (temp == NULL) - goto onError; - } - 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 (PyInt_Check(v) || (PyLong_Check(v))) { - iobj = v; - Py_INCREF(iobj); - } - else { - iobj = PyNumber_Int(v); - if (iobj==NULL) iobj = PyNumber_Long(v); - } - if (iobj!=NULL) { - if (PyInt_Check(iobj)) { - isnumok = 1; - pbuf = formatbuf; - len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, iobj); - Py_DECREF(iobj); - if (len < 0) + unicode = PyUnicode_Decode(PyString_AS_STRING(temp), + PyString_GET_SIZE(temp), + NULL, + "strict"); + Py_DECREF(temp); + temp = unicode; + if (temp == NULL) + goto onError; + } + else { + Py_DECREF(temp); + PyErr_SetString(PyExc_TypeError, + "%s argument has non-string str()"); goto onError; - sign = 1; + } } - else 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; + 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 (PyInt_Check(v) || (PyLong_Check(v))) { + iobj = v; + Py_INCREF(iobj); + } + else { + iobj = PyNumber_Int(v); + if (iobj==NULL) iobj = PyNumber_Long(v); + } + if (iobj!=NULL) { + if (PyInt_Check(iobj)) { + isnumok = 1; + pbuf = formatbuf; + len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), + flags, prec, c, iobj); + Py_DECREF(iobj); + if (len < 0) + goto onError; + sign = 1; + } + else 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); + } + } } - 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 (!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; + 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 '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; + 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 : '?', + 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')) { - 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')) { - 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')) { + 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')) { + 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; } @@ -8888,7 +8888,7 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *x = NULL; + PyObject *x = NULL; static char *kwlist[] = {"string", "encoding", "errors", 0}; char *encoding = NULL; char *errors = NULL; @@ -8896,14 +8896,14 @@ if (type != &PyUnicode_Type) return unicode_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:unicode", - kwlist, &x, &encoding, &errors)) + kwlist, &x, &encoding, &errors)) return NULL; if (x == NULL) return (PyObject *)_PyUnicode_New(0); if (encoding == NULL && errors == NULL) return PyObject_Unicode(x); else - return PyUnicode_FromEncodedObject(x, encoding, errors); + return PyUnicode_FromEncodedObject(x, encoding, errors); } static PyObject * @@ -8937,7 +8937,7 @@ } PyDoc_STRVAR(unicode_doc, -"unicode(string [, encoding[, errors]]) -> object\n\ + "unicode(string [, encoding[, errors]]) -> object\n\ \n\ Create a new Unicode object from the given encoded string.\n\ encoding defaults to the current default string encoding.\n\ @@ -8965,7 +8965,7 @@ 0, /* tp_setattro */ &unicode_as_buffer, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | - Py_TPFLAGS_BASETYPE | Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ + Py_TPFLAGS_BASETYPE | Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -9010,13 +9010,13 @@ numfree = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) - return; + return; strcpy(unicode_default_encoding, "ascii"); 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( @@ -9035,13 +9035,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); @@ -9057,10 +9057,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(); } @@ -9071,8 +9071,8 @@ /* -Local variables: -c-basic-offset: 4 -indent-tabs-mode: nil -End: + Local variables: + c-basic-offset: 4 + indent-tabs-mode: nil + End: */ From python-checkins at python.org Sat Jan 31 23:31:18 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 23:31:18 +0100 (CET) Subject: [Python-checkins] r69153 - python/branches/release30-maint/Objects/unicodeobject.c Message-ID: <20090131223118.4186C1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 23:31:17 2009 New Revision: 69153 Log: fixup indentation hopefully for the last time Modified: python/branches/release30-maint/Objects/unicodeobject.c Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Sat Jan 31 23:31:17 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, @@ -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)) { + (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; + /* 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; } - 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; } @@ -507,7 +507,7 @@ if (size < 0) { PyErr_SetString(PyExc_SystemError, - "Negative size passed to PyUnicode_FromStringAndSize"); + "Negative size passed to PyUnicode_FromStringAndSize"); return NULL; } @@ -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; + 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; } - 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 @@ -657,7 +657,7 @@ /* 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) */ + an array) */ for (f = format; *f; f++) { if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) ++callcount; @@ -686,8 +686,8 @@ * they don't affect the amount of space we reserve. */ if ((*f == 'l' || *f == 'z') && - (f[1] == 'd' || f[1] == 'u')) - ++f; + (f[1] == 'd' || f[1] == 'u')) + ++f; switch (*f) { case 'c': @@ -730,11 +730,11 @@ s++; if(!*s)break; s++; } else { - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE n++; - #else +#else n+=2; - #endif +#endif s++; if(!*s)break; s++; if(!*s)break; s++; if(!*s)break; @@ -823,7 +823,7 @@ } else n++; } - expand: + expand: if (abuffersize > 20) { abuffer = PyObject_Malloc(abuffersize); if (!abuffer) { @@ -915,11 +915,11 @@ PyObject *u; p = va_arg(vargs, char*); u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); + "replace"); if (!u) goto fail; Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); + PyUnicode_GET_SIZE(u)); s += PyUnicode_GET_SIZE(u); Py_DECREF(u); break; @@ -986,14 +986,14 @@ *s++ = *f; } - end: + end: if (callresults) PyObject_Free(callresults); if (abuffer) PyObject_Free(abuffer); PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); return string; - fail: + fail: if (callresults) { PyObject **callresult2 = callresults; while (callresult2 < callresult) { @@ -1026,34 +1026,34 @@ } 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,22 +1102,22 @@ } 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 */ @@ -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; + 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; } @@ -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) { @@ -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, *result; /* 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(); @@ -1996,16 +1996,16 @@ }; 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); } 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; @@ -2046,72 +2046,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: @@ -2119,25 +2119,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: */ @@ -2155,24 +2155,24 @@ 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; + 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; } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2182,7 +2182,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -2196,8 +2196,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 */ @@ -2263,7 +2263,7 @@ *p++ = (char)(0x80 | (ch & 0x3f)); continue; } -encodeUCS4: + encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); @@ -2296,27 +2296,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; @@ -2344,8 +2344,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 */ @@ -2370,27 +2370,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) { @@ -2409,54 +2409,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]]; + 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; - } + 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 + 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; + *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) @@ -2466,7 +2466,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2475,9 +2475,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, *result; unsigned char *p; @@ -2494,34 +2494,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 = PyByteArray_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyByteArray_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2541,16 +2541,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); } @@ -2569,28 +2569,28 @@ 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); } 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; @@ -2634,25 +2634,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) { @@ -2667,74 +2667,74 @@ } while (q < e) { - Py_UNICODE ch; - /* remaining bytes at the end? (size should be even) */ - if (e-q<2) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf16Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[ihi] << 8) | q[ilo]; + Py_UNICODE ch; + /* remaining bytes at the end? (size should be even) */ + if (e-q<2) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf16Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + 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)-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)-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; + 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 */ - } - 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, - &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + utf16Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf16", 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) @@ -2744,7 +2744,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2753,9 +2753,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, *result; unsigned char *p; @@ -2772,33 +2772,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 = PyByteArray_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyByteArray_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2814,13 +2814,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) @@ -2841,9 +2841,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 ----------------------------------------------- */ @@ -2851,8 +2851,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; @@ -2900,7 +2900,7 @@ c = '\0'; /* Invalid after \ */ switch (c) { - /* \x escapes */ + /* \x escapes */ case '\n': break; case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; @@ -2913,7 +2913,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'; @@ -2925,20 +2925,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"; @@ -2948,10 +2948,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; } @@ -2960,10 +2960,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; } @@ -2999,15 +2999,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) { @@ -3041,10 +3041,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; @@ -3055,10 +3055,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 { @@ -3067,7 +3067,7 @@ } break; } - nextByte: + nextByte: ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) @@ -3076,7 +3076,7 @@ Py_XDECREF(exc); return (PyObject *)v; -ucnhashError: + ucnhashError: PyErr_SetString( PyExc_UnicodeError, "\\N escapes not supported (can't load unicodedata module)" @@ -3086,7 +3086,7 @@ Py_XDECREF(exc); return NULL; -onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3101,8 +3101,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 */ @@ -3118,7 +3118,7 @@ static const char *hexdigits = "0123456789abcdef"; PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr, *result; char *p; @@ -3148,12 +3148,12 @@ */ if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyByteArray_FromStringAndSize(NULL, - 2 - + expandsize*size - + 1); + 2 + + expandsize*size + + 1); if (repr == NULL) return NULL; @@ -3182,34 +3182,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; + /* 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++; } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3250,7 +3250,7 @@ } result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(repr), - p - PyByteArray_AS_STRING(repr)); + p - PyByteArray_AS_STRING(repr)); Py_DECREF(repr); return result; } @@ -3270,8 +3270,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; @@ -3290,75 +3290,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; + /* 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--; + /* \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; + /* \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'; } - 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; @@ -3366,20 +3366,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); @@ -3387,7 +3387,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr, *result; char *p; @@ -3400,7 +3400,7 @@ #endif if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyByteArray_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) @@ -3412,8 +3412,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]; @@ -3427,34 +3427,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]; @@ -3462,8 +3462,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; @@ -3490,8 +3490,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; @@ -3511,9 +3511,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; @@ -3522,12 +3522,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; @@ -3558,7 +3558,7 @@ Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3568,69 +3568,69 @@ /* --- 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; /* 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); while (size-- > 0) - *p++ = (unsigned char)*s++; + *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: @@ -3638,11 +3638,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"; @@ -3650,36 +3650,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); @@ -3687,9 +3687,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; @@ -3722,131 +3722,131 @@ 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; + /* can we encode this? */ + if (c=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 (PyByteArray_Resize(res, requiredsize)) - goto onError; - str = PyByteArray_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 - PyByteArray_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (PyByteArray_Resize(res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyByteArray_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); + } + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (PyByteArray_Resize(res, requiredsize)) + goto onError; + str = PyByteArray_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 - PyByteArray_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (PyByteArray_Resize(res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyByteArray_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); - goto onError; - } - *str = (char)c; } - p = startp + newpos; - Py_DECREF(repunicode); } } - } result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(res), - str - PyByteArray_AS_STRING(res)); + str - PyByteArray_AS_STRING(res)); onError: Py_DECREF(res); Py_XDECREF(errorHandler); @@ -3855,8 +3855,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); } @@ -3864,19 +3864,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; @@ -3890,43 +3890,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); @@ -3934,8 +3934,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); } @@ -3943,12 +3943,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) @@ -3962,15 +3962,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; } @@ -3980,9 +3980,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; @@ -3992,74 +3992,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 @@ -4067,8 +4067,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); } @@ -4078,8 +4078,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; @@ -4088,63 +4088,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 @@ -4158,8 +4158,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -4169,9 +4169,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; @@ -4188,141 +4188,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 */ + 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 (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; + 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; } - *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; - } + 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); + /* 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) { + 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; } - 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; } - 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); @@ -4332,10 +4332,10 @@ /* 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* @@ -4343,13 +4343,13 @@ { struct encoding_map *map = (struct encoding_map*)obj; return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + - 128*map->count3); + 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 } + PyDoc_STR("Return the size (in bytes) of this object") }, + { 0 } }; static void @@ -4360,46 +4360,46 @@ 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*/ + "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* @@ -4431,10 +4431,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; } @@ -4520,7 +4520,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4552,40 +4552,40 @@ 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; } } @@ -4602,7 +4602,7 @@ } typedef enum charmapencode_result { - enc_SUCCESS, enc_FAILED, enc_EXCEPTION + 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 @@ -4612,7 +4612,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; @@ -4620,47 +4620,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; - } + 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); @@ -4785,9 +4785,9 @@ } 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; @@ -4804,7 +4804,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 */ @@ -4812,35 +4812,35 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; while (inpos adjust input position */ - ++inpos; + else + /* done with this character => adjust input position */ + ++inpos; } /* Resize if we allocated to much */ if (respossize) { - 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); @@ -4962,63 +4962,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; } @@ -5030,47 +5030,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); - } - 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; + *(*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; + } } 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; @@ -5090,119 +5090,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)) + /* 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) - 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; coll 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; } - p = collend; - break; - default: - repunicode = unicode_translate_call_errorhandler(errors, &errorHandler, - reason, startp, size, &exc, - collstart-startp, collend-startp, &newpos); - if (repunicode == NULL) - goto onError; - /* generate replacement */ - repsize = PyUnicode_GET_SIZE(repunicode); - if (charmaptranslate_makespace(&res, &str, - (str-PyUnicode_AS_UNICODE(res))+repsize+(endp-collend))) { - Py_DECREF(repunicode); - goto onError; + /* 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); } - for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++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) { + 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; + 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 */ + for (p = collstart; p < collend; ++p) + *output++ = '?'; + /* fall through */ case 3: /* ignore */ - p = collend; - break; + 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; + /* 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); + 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); } - p = s + newpos; - Py_DECREF(repunicode); - } } /* 0-terminate the output string */ *output++ = '\0'; @@ -5355,7 +5355,7 @@ Py_XDECREF(errorHandler); return 0; - onError: + onError: Py_XDECREF(exc); Py_XDECREF(errorHandler); return -1; @@ -5398,11 +5398,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); @@ -5427,11 +5427,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) @@ -5455,10 +5455,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; @@ -5467,39 +5467,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; @@ -5510,24 +5510,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; } @@ -5540,13 +5540,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++; } @@ -5561,13 +5561,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++; } @@ -5603,10 +5603,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) { @@ -5628,31 +5628,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 (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 (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5689,12 +5689,12 @@ 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 */ @@ -5724,19 +5724,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; } } @@ -5751,20 +5751,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; @@ -5772,9 +5772,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; @@ -5805,21 +5805,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; @@ -5828,33 +5828,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); + /* find a token */ while (i < len && Py_UNICODE_ISSPACE(buf[i])) - 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; @@ -5865,7 +5865,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -5874,34 +5874,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) + /* 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; - } - SPLIT_APPEND(data, j, eol); - j = 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; @@ -5909,9 +5909,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; @@ -5920,29 +5920,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; @@ -5951,28 +5951,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; @@ -5981,38 +5981,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); + /* find a token */ while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - 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 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; @@ -6021,31 +6021,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 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; @@ -6054,23 +6054,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; } @@ -6079,8 +6079,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -6092,24 +6092,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; @@ -6121,30 +6121,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 */ @@ -6230,7 +6230,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6261,7 +6261,7 @@ } return (PyObject *) u; -nothing: + nothing: /* nothing to replace; return original string (when possible) */ if (PyUnicode_CheckExact(self)) { Py_INCREF(self); @@ -6273,7 +6273,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."); @@ -6285,7 +6285,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."); @@ -6298,7 +6298,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 ' ')."); @@ -6318,7 +6318,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)); @@ -6328,7 +6328,7 @@ /* Join the words to form a new string */ item = PyUnicode_Join(NULL, list); -onError: + onError: Py_DECREF(list); return (PyObject *)item; } @@ -6346,12 +6346,12 @@ uniobj = PyUnicode_FromObject(obj); if (uniobj == NULL) { PyErr_SetString(PyExc_TypeError, - "The fill character cannot be converted to Unicode"); + "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"); + "The fill character must be exactly one character long"); Py_DECREF(uniobj); return 0; } @@ -6362,7 +6362,7 @@ } 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)"); @@ -6423,9 +6423,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 */ @@ -6469,7 +6469,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { if (PyUnicode_Check(left) && PyUnicode_Check(right)) return unicode_compare((PyUnicodeObject *)left, @@ -6490,17 +6490,17 @@ 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) \ +#define TEST_COND(cond) \ ((cond) ? Py_True : Py_False) PyObject *PyUnicode_RichCompare(PyObject *left, @@ -6561,7 +6561,7 @@ } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6569,9 +6569,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; } @@ -6592,32 +6592,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); @@ -6625,7 +6625,7 @@ Py_DECREF(v); return (PyObject *)w; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return NULL; @@ -6655,7 +6655,7 @@ } 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\ @@ -6670,13 +6670,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); @@ -6691,7 +6691,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\ @@ -6722,12 +6722,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."); @@ -6744,7 +6744,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 */ @@ -6752,27 +6752,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); @@ -6785,20 +6785,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++ = ' '; + 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; + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -6814,7 +6814,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\ @@ -6879,7 +6879,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."); @@ -6911,7 +6911,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."); @@ -6925,27 +6925,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."); @@ -6959,27 +6959,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\ @@ -6995,39 +6995,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."); @@ -7040,23 +7040,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."); @@ -7069,23 +7069,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."); @@ -7098,23 +7098,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."); @@ -7127,23 +7127,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."); @@ -7156,23 +7156,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."); @@ -7185,17 +7185,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); } @@ -7208,7 +7208,7 @@ /* 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, @@ -7223,14 +7223,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."); @@ -7242,7 +7242,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."); @@ -7268,7 +7268,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."); @@ -7286,7 +7286,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)."); @@ -7309,7 +7309,7 @@ } PyDoc_STRVAR(lower__doc__, -"S.lower() -> str\n\ + "S.lower() -> str\n\ \n\ Return a copy of the string S converted to lowercase."); @@ -7338,29 +7338,29 @@ Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); Py_ssize_t i, j; - BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); + BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); i = 0; if (striptype != RIGHTSTRIP) { - while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { - i++; - } + 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++; + 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; + Py_INCREF(self); + return (PyObject*)self; } else - return PyUnicode_FromUnicode(s+i, j-i); + return PyUnicode_FromUnicode(s+i, j-i); } @@ -7407,8 +7407,8 @@ return _PyUnicode_XStrip(self, striptype, sep); else { PyErr_Format(PyExc_TypeError, - "%s arg must be None or str", - STRIPNAME(striptype)); + "%s arg must be None or str", + STRIPNAME(striptype)); return NULL; } } @@ -7418,7 +7418,7 @@ 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\ @@ -7435,7 +7435,7 @@ 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."); @@ -7451,7 +7451,7 @@ 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."); @@ -7507,25 +7507,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; @@ -7534,22 +7534,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); @@ -7557,7 +7557,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\ @@ -7575,11 +7575,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); @@ -7616,13 +7616,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; @@ -7641,7 +7641,7 @@ continue; } - /* Map special whitespace to '\t', \n', '\r' */ + /* Map special whitespace to '\t', \n', '\r' */ if (ch == '\t') { *p++ = '\\'; *p++ = 't'; @@ -7668,7 +7668,7 @@ *p++ = ch; } - /* Non-ASCII characters */ + /* Non-ASCII characters */ else { Py_UCS4 ucs = ch; @@ -7678,9 +7678,9 @@ if (size > 0) { ch2 = *s; if (ch >= 0xD800 && ch < 0xDC00 && ch2 >= 0xDC00 - && ch2 <= 0xDFFF) { + && ch2 <= 0xDFFF) { ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) - + 0x00010000; + + 0x00010000; s++; size--; } @@ -7739,7 +7739,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\ @@ -7770,7 +7770,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."); @@ -7801,7 +7801,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)."); @@ -7824,20 +7824,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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != NULL) { + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = split((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -7848,7 +7848,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\ @@ -7866,11 +7866,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 * @@ -7882,7 +7882,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); @@ -7910,7 +7910,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); @@ -7929,7 +7929,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\ @@ -7942,7 +7942,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\ @@ -7955,20 +7955,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; - if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); return NULL; - } + if (sep != NULL) { + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = rsplit((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -7979,7 +7979,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\ @@ -7997,15 +7997,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\ @@ -8035,7 +8035,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."); @@ -8047,7 +8047,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\ @@ -8150,7 +8150,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\ @@ -8165,7 +8165,7 @@ } PyDoc_STRVAR(upper__doc__, -"S.upper() -> str\n\ + "S.upper() -> str\n\ \n\ Return a copy of S converted to uppercase."); @@ -8176,7 +8176,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."); @@ -8200,7 +8200,7 @@ return PyUnicode_FromUnicode( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self) - ); + ); } fill = width - self->length; @@ -8228,7 +8228,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\ @@ -8237,7 +8237,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8246,13 +8246,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); @@ -8266,7 +8266,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); @@ -8274,7 +8274,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\ @@ -8283,7 +8283,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8292,15 +8292,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) { @@ -8311,7 +8311,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); @@ -8321,7 +8321,7 @@ #include "stringlib/string_format.h" PyDoc_STRVAR(format__doc__, -"S.format(*args, **kwargs) -> str\n\ + "S.format(*args, **kwargs) -> str\n\ \n\ "); @@ -8339,7 +8339,7 @@ } PyDoc_STRVAR(p_format__doc__, -"S.__format__(format_spec) -> str\n\ + "S.__format__(format_spec) -> str\n\ \n\ "); @@ -8351,7 +8351,7 @@ } 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) @@ -8428,11 +8428,11 @@ 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 = { @@ -8470,7 +8470,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8487,8 +8487,8 @@ 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]; @@ -8518,14 +8518,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; } @@ -8535,7 +8535,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; } @@ -8568,11 +8568,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)*/ @@ -8581,37 +8581,37 @@ 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; + 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); } @@ -8634,11 +8634,11 @@ #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) @@ -8667,7 +8667,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; } @@ -8675,7 +8675,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 @@ -8716,56 +8716,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; + 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; - } + 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; - } + 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; + 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; } @@ -8780,7 +8780,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; @@ -8790,433 +8790,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; + 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++; } - *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; + 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}() */ - 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 == '(') { + 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; + 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; } - 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') + 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 ((prec*10) / 10 != prec) { + } + 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, - "prec too big"); + "incomplete format"); goto onError; } - prec = prec*10 + (c - '0'); + if (c != '%') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; } - } - } /* 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) { + sign = 0; + fill = ' '; + switch (c) { - case '%': - pbuf = formatbuf; - /* presume that buffer length is at least 1 */ - pbuf[0] = '%'; - len = 1; - break; + 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; + 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) + 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); - sign = 1; + } } - else { - Py_DECREF(iobj); + 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; + 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 '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; + 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 : '?', + 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; } @@ -9227,7 +9227,7 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *x = NULL; + PyObject *x = NULL; static char *kwlist[] = {"object", "encoding", "errors", 0}; char *encoding = NULL; char *errors = NULL; @@ -9235,14 +9235,14 @@ if (type != &PyUnicode_Type) return unicode_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str", - kwlist, &x, &encoding, &errors)) + 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); + return PyUnicode_FromEncodedObject(x, encoding, errors); } static PyObject * @@ -9276,7 +9276,7 @@ } 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\ @@ -9306,7 +9306,7 @@ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | - Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ + Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -9351,12 +9351,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( @@ -9375,13 +9375,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); @@ -9397,10 +9397,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(); } @@ -9430,15 +9430,15 @@ 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); + t = PyDict_GetItem(interned, (PyObject *)s); Py_END_ALLOW_RECURSION - if (t) { - Py_INCREF(t); - Py_DECREF(*p); - *p = t; - return; - } + 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) { @@ -9495,7 +9495,7 @@ n = PyList_GET_SIZE(keys); fprintf(stderr, "releasing %" PY_FORMAT_SIZE_T "d interned strings\n", - n); + n); for (i = 0; i < n; i++) { s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i); switch (s->state) { @@ -9562,7 +9562,7 @@ if (it->it_index < PyUnicode_GET_SIZE(seq)) { item = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(seq)+it->it_index, 1); + PyUnicode_AS_UNICODE(seq)+it->it_index, 1); if (item != NULL) ++it->it_index; return item; @@ -9586,7 +9586,7 @@ static PyMethodDef unicodeiter_methods[] = { {"__length_hint__", (PyCFunction)unicodeiter_len, METH_NOARGS, - length_hint_doc}, + length_hint_doc}, {NULL, NULL} /* sentinel */ }; @@ -9700,8 +9700,8 @@ /* -Local variables: -c-basic-offset: 4 -indent-tabs-mode: nil -End: + Local variables: + c-basic-offset: 4 + indent-tabs-mode: nil + End: */ From python-checkins at python.org Sat Jan 31 23:33:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 31 Jan 2009 23:33:02 +0100 (CET) Subject: [Python-checkins] r69154 - python/trunk/Objects/unicodeobject.c Message-ID: <20090131223302.AC5EB1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Jan 31 23:33:02 2009 New Revision: 69154 Log: fix indentation in comment Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Jan 31 23:33: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, From python-checkins at python.org Sat Jan 31 23:53:47 2009 From: python-checkins at python.org (david.goodger) Date: Sat, 31 Jan 2009 23:53:47 +0100 (CET) Subject: [Python-checkins] r69155 - python/trunk/Doc/tutorial/floatingpoint.rst Message-ID: <20090131225347.7CA051E4002@bag.python.org> Author: david.goodger Date: Sat Jan 31 23:53:46 2009 New Revision: 69155 Log: markup fix Modified: python/trunk/Doc/tutorial/floatingpoint.rst Modified: python/trunk/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/trunk/Doc/tutorial/floatingpoint.rst (original) +++ python/trunk/Doc/tutorial/floatingpoint.rst Sat Jan 31 23:53:46 2009 @@ -157,7 +157,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) From python-checkins at python.org Sat Jan 31 23:57:30 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 31 Jan 2009 23:57:30 +0100 (CET) Subject: [Python-checkins] r69156 - in python/trunk: Lib/test/test_socket.py Misc/NEWS Modules/socketmodule.c Message-ID: <20090131225730.7C34E1E400C@bag.python.org> Author: gregory.p.smith Date: Sat Jan 31 23:57:30 2009 New Revision: 69156 Log: - 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(). 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 Sat Jan 31 23:57:30 2009 @@ -356,6 +356,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 @@ -456,15 +459,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() @@ -504,6 +515,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/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Jan 31 23:57:30 2009 @@ -383,6 +383,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/trunk/Modules/socketmodule.c ============================================================================== --- python/trunk/Modules/socketmodule.c (original) +++ python/trunk/Modules/socketmodule.c Sat Jan 31 23:57:30 2009 @@ -1259,6 +1259,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; @@ -1291,6 +1297,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; @@ -1417,6 +1429,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); @@ -3446,13 +3464,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");